From 765668086a25f0b3feff76de9bef5a59d16ecdc4 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 20 Jan 2021 21:14:13 -0800 Subject: [PATCH 001/825] wifi: fix a use of an uninitialized value This `if` is executed once, so using `legacy_status` from a prior execution is nonsensical. Caught by the static analyzer: > hardware/interfaces/wifi/1.5/default/wifi_chip.cpp:1053:39: warning: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage] Bug: None Test: atest -c VtsHalWifiApV1_5TargetTest Change-Id: Ib81f1496be53e453d9c99ede129a77bdaf860de7 --- wifi/1.5/default/wifi_chip.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wifi/1.5/default/wifi_chip.cpp b/wifi/1.5/default/wifi_chip.cpp index fbb4a52bd9..414d74c088 100644 --- a/wifi/1.5/default/wifi_chip.cpp +++ b/wifi/1.5/default/wifi_chip.cpp @@ -1036,7 +1036,6 @@ WifiStatus WifiChip::removeApIfaceInternal(const std::string& ifname) { WifiStatus WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal( const std::string& ifname, const std::string& ifInstanceName) { - legacy_hal::wifi_error legacy_status; const auto iface = findUsingName(ap_ifaces_, ifname); if (!iface.get() || ifInstanceName.empty()) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); @@ -1048,13 +1047,13 @@ WifiStatus WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal( if (iface == ifInstanceName) { if (!iface_util_.lock()->removeIfaceFromBridge(it.first, iface)) { - LOG(ERROR) << "Failed to remove interface: " << iface - << " from " << ifname << ", error: " - << legacyErrorToString(legacy_status); + LOG(ERROR) + << "Failed to remove interface: " << ifInstanceName + << " from " << ifname; return createWifiStatus( WifiStatusCode::ERROR_NOT_AVAILABLE); } - legacy_status = + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->deleteVirtualInterface(iface); if (legacy_status != legacy_hal::WIFI_SUCCESS) { LOG(ERROR) << "Failed to del interface: " << iface -- GitLab From 8090245174e252697a406852d302fc30ad97d5db Mon Sep 17 00:00:00 2001 From: Lev Proleev Date: Mon, 20 Jul 2020 20:01:54 +0100 Subject: [PATCH 002/825] Create first version of NNAPI AIDL interface Bug: 161428342 Test: m android.hardware.neuralnetworks-update-api && m Change-Id: Icf8123746def6f4c654dc3e413e5169ab020c8b4 --- .../compatibility_matrix.current.xml | 7 + neuralnetworks/aidl/Android.bp | 19 + .../hardware/neuralnetworks/BufferDesc.aidl | 22 + .../hardware/neuralnetworks/BufferRole.aidl | 24 + .../hardware/neuralnetworks/Capabilities.aidl | 26 + .../hardware/neuralnetworks/DataLocation.aidl | 24 + .../hardware/neuralnetworks/DeviceBuffer.aidl | 23 + .../hardware/neuralnetworks/DeviceType.aidl | 25 + .../hardware/neuralnetworks/ErrorStatus.aidl | 30 + .../neuralnetworks/ExecutionPreference.aidl | 24 + .../neuralnetworks/ExecutionResult.aidl | 24 + .../hardware/neuralnetworks/Extension.aidl | 23 + .../ExtensionNameAndPrefix.aidl | 23 + .../ExtensionOperandTypeInformation.aidl | 24 + .../neuralnetworks/FusedActivationFunc.aidl | 25 + .../hardware/neuralnetworks/IBuffer.aidl | 23 + .../hardware/neuralnetworks/IDevice.aidl | 36 + .../IFencedExecutionCallback.aidl | 22 + .../neuralnetworks/IPreparedModel.aidl | 25 + .../IPreparedModelCallback.aidl | 22 + .../neuralnetworks/IPreparedModelParcel.aidl | 22 + .../hardware/neuralnetworks/Memory.aidl | 24 + .../hardware/neuralnetworks/Model.aidl | 27 + .../neuralnetworks/NumberOfCacheFiles.aidl | 23 + .../hardware/neuralnetworks/Operand.aidl | 28 + .../neuralnetworks/OperandExtraParams.aidl | 23 + .../neuralnetworks/OperandLifeTime.aidl | 28 + .../neuralnetworks/OperandPerformance.aidl | 23 + .../hardware/neuralnetworks/OperandType.aidl | 37 + .../hardware/neuralnetworks/Operation.aidl | 24 + .../neuralnetworks/OperationType.aidl | 123 + .../hardware/neuralnetworks/OutputShape.aidl | 23 + .../neuralnetworks/PerformanceInfo.aidl | 23 + .../hardware/neuralnetworks/Priority.aidl | 24 + .../hardware/neuralnetworks/Request.aidl | 24 + .../neuralnetworks/RequestArgument.aidl | 24 + .../neuralnetworks/RequestMemoryPool.aidl | 23 + .../hardware/neuralnetworks/Subgraph.aidl | 25 + .../SymmPerChannelQuantParams.aidl | 23 + .../hardware/neuralnetworks/Timing.aidl | 23 + .../hardware/neuralnetworks/BufferDesc.aidl | 31 + .../hardware/neuralnetworks/BufferRole.aidl | 40 + .../hardware/neuralnetworks/Capabilities.aidl | 63 + .../hardware/neuralnetworks/DataLocation.aidl | 37 + .../hardware/neuralnetworks/DeviceBuffer.aidl | 36 + .../hardware/neuralnetworks/DeviceType.aidl | 45 + .../hardware/neuralnetworks/ErrorStatus.aidl | 52 + .../neuralnetworks/ExecutionPreference.aidl | 41 + .../neuralnetworks/ExecutionResult.aidl | 47 + .../hardware/neuralnetworks/Extension.aidl | 42 + .../ExtensionNameAndPrefix.aidl | 49 + .../ExtensionOperandTypeInformation.aidl | 38 + .../neuralnetworks/FusedActivationFunc.aidl | 30 + .../hardware/neuralnetworks/IBuffer.aidl | 58 + .../hardware/neuralnetworks/IDevice.aidl | 431 ++ .../IFencedExecutionCallback.aidl | 56 + .../neuralnetworks/IPreparedModel.aidl | 173 + .../IPreparedModelCallback.aidl | 51 + .../neuralnetworks/IPreparedModelParcel.aidl | 28 + .../hardware/neuralnetworks/Memory.aidl | 31 + .../hardware/neuralnetworks/Model.aidl | 70 + .../neuralnetworks/NumberOfCacheFiles.aidl | 27 + .../hardware/neuralnetworks/Operand.aidl | 113 + .../neuralnetworks/OperandExtraParams.aidl | 40 + .../neuralnetworks/OperandLifeTime.aidl | 63 + .../neuralnetworks/OperandPerformance.aidl | 31 + .../hardware/neuralnetworks/OperandType.aidl | 154 + .../hardware/neuralnetworks/Operation.aidl | 46 + .../neuralnetworks/OperationType.aidl | 5132 +++++++++++++++++ .../hardware/neuralnetworks/OutputShape.aidl | 33 + .../neuralnetworks/PerformanceInfo.aidl | 37 + .../hardware/neuralnetworks/Priority.aidl | 29 + .../hardware/neuralnetworks/Request.aidl | 55 + .../neuralnetworks/RequestArgument.aidl | 53 + .../neuralnetworks/RequestMemoryPool.aidl | 36 + .../hardware/neuralnetworks/Subgraph.aidl | 51 + .../SymmPerChannelQuantParams.aidl | 33 + .../hardware/neuralnetworks/Timing.aidl | 37 + 78 files changed, 8484 insertions(+) create mode 100644 neuralnetworks/aidl/Android.bp create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferDesc.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferRole.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Capabilities.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DataLocation.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceBuffer.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceType.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ErrorStatus.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionPreference.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionResult.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Extension.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/FusedActivationFunc.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBuffer.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IDevice.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelCallback.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelParcel.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Memory.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Model.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operand.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandExtraParams.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandLifeTime.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandPerformance.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandType.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operation.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OutputShape.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PerformanceInfo.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Priority.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Request.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestArgument.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestMemoryPool.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Subgraph.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Timing.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/BufferDesc.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/BufferRole.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/Capabilities.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/DataLocation.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/DeviceBuffer.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/DeviceType.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/ErrorStatus.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/ExecutionPreference.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/ExecutionResult.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/Extension.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/FusedActivationFunc.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/IBuffer.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModelCallback.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModelParcel.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/Memory.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/Model.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/Operand.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/OperandExtraParams.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/OperandLifeTime.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/OperandPerformance.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/OperandType.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/Operation.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/OutputShape.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/PerformanceInfo.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/Priority.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/Request.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/RequestArgument.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/RequestMemoryPool.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/Subgraph.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/Timing.aidl diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 91ca312d45..fd255551bf 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -393,6 +393,13 @@ .* + + android.hardware.neuralnetworks + + IDevice + .* + + android.hardware.nfc 1.2 diff --git a/neuralnetworks/aidl/Android.bp b/neuralnetworks/aidl/Android.bp new file mode 100644 index 0000000000..308f89f663 --- /dev/null +++ b/neuralnetworks/aidl/Android.bp @@ -0,0 +1,19 @@ +aidl_interface { + name: "android.hardware.neuralnetworks", + vendor_available: true, + srcs: [ + "android/hardware/neuralnetworks/*.aidl", + ], + stability: "vintf", + imports: [ + "android.hardware.common", + ], + backend: { + java: { + enabled: false, + }, + cpp: { + enabled: false, + }, + }, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferDesc.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferDesc.aidl new file mode 100644 index 0000000000..2074a2ad4d --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferDesc.aidl @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable BufferDesc { + int[] dimensions; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferRole.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferRole.aidl new file mode 100644 index 0000000000..97f748bcf8 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferRole.aidl @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable BufferRole { + int modelIndex; + int ioIndex; + float frequency; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Capabilities.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Capabilities.aidl new file mode 100644 index 0000000000..31afafc7df --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Capabilities.aidl @@ -0,0 +1,26 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable Capabilities { + android.hardware.neuralnetworks.PerformanceInfo relaxedFloat32toFloat16PerformanceScalar; + android.hardware.neuralnetworks.PerformanceInfo relaxedFloat32toFloat16PerformanceTensor; + android.hardware.neuralnetworks.OperandPerformance[] operandPerformance; + android.hardware.neuralnetworks.PerformanceInfo ifPerformance; + android.hardware.neuralnetworks.PerformanceInfo whilePerformance; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DataLocation.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DataLocation.aidl new file mode 100644 index 0000000000..5b03ba038e --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DataLocation.aidl @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable DataLocation { + int poolIndex; + long offset; + long length; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceBuffer.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceBuffer.aidl new file mode 100644 index 0000000000..9cff6db999 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceBuffer.aidl @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable DeviceBuffer { + android.hardware.neuralnetworks.IBuffer buffer; + int token; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceType.aidl new file mode 100644 index 0000000000..dd4dae7d0e --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceType.aidl @@ -0,0 +1,25 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@Backing(type="int") @VintfStability +enum DeviceType { + OTHER = 1, + CPU = 2, + GPU = 3, + ACCELERATOR = 4, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ErrorStatus.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ErrorStatus.aidl new file mode 100644 index 0000000000..ba18c3801e --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ErrorStatus.aidl @@ -0,0 +1,30 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@Backing(type="int") @VintfStability +enum ErrorStatus { + NONE = 0, + DEVICE_UNAVAILABLE = 1, + GENERAL_FAILURE = 2, + OUTPUT_INSUFFICIENT_SIZE = 3, + INVALID_ARGUMENT = 4, + MISSED_DEADLINE_TRANSIENT = 5, + MISSED_DEADLINE_PERSISTENT = 6, + RESOURCE_EXHAUSTED_TRANSIENT = 7, + RESOURCE_EXHAUSTED_PERSISTENT = 8, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionPreference.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionPreference.aidl new file mode 100644 index 0000000000..cccae5403d --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionPreference.aidl @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@Backing(type="int") @VintfStability +enum ExecutionPreference { + LOW_POWER = 0, + FAST_SINGLE_ANSWER = 1, + SUSTAINED_SPEED = 2, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionResult.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionResult.aidl new file mode 100644 index 0000000000..c17ddb9116 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionResult.aidl @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable ExecutionResult { + boolean outputSufficientSize; + android.hardware.neuralnetworks.OutputShape[] outputShapes; + android.hardware.neuralnetworks.Timing timing; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Extension.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Extension.aidl new file mode 100644 index 0000000000..9eb8896af7 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Extension.aidl @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable Extension { + String name; + android.hardware.neuralnetworks.ExtensionOperandTypeInformation[] operandTypes; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl new file mode 100644 index 0000000000..a271a63128 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable ExtensionNameAndPrefix { + String name; + char prefix; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl new file mode 100644 index 0000000000..d1c3f099b0 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable ExtensionOperandTypeInformation { + char type; + boolean isTensor; + int byteSize; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/FusedActivationFunc.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/FusedActivationFunc.aidl new file mode 100644 index 0000000000..ddd3c2abd7 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/FusedActivationFunc.aidl @@ -0,0 +1,25 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@Backing(type="int") @VintfStability +enum FusedActivationFunc { + NONE = 0, + RELU = 1, + RELU1 = 2, + RELU6 = 3, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBuffer.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBuffer.aidl new file mode 100644 index 0000000000..a297a6bb31 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBuffer.aidl @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +interface IBuffer { + void copyFrom(in android.hardware.neuralnetworks.Memory src, in int[] dimensions); + void copyTo(in android.hardware.neuralnetworks.Memory dst); +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IDevice.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IDevice.aidl new file mode 100644 index 0000000000..38fda16b56 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IDevice.aidl @@ -0,0 +1,36 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +interface IDevice { + android.hardware.neuralnetworks.DeviceBuffer allocate(in android.hardware.neuralnetworks.BufferDesc desc, in android.hardware.neuralnetworks.IPreparedModelParcel[] preparedModels, in android.hardware.neuralnetworks.BufferRole[] inputRoles, in android.hardware.neuralnetworks.BufferRole[] outputRoles); + android.hardware.neuralnetworks.Capabilities getCapabilities(); + android.hardware.neuralnetworks.NumberOfCacheFiles getNumberOfCacheFilesNeeded(); + android.hardware.neuralnetworks.Extension[] getSupportedExtensions(); + boolean[] getSupportedOperations(in android.hardware.neuralnetworks.Model model); + android.hardware.neuralnetworks.DeviceType getType(); + String getVersionString(); + void prepareModel(in android.hardware.neuralnetworks.Model model, in android.hardware.neuralnetworks.ExecutionPreference preference, in android.hardware.neuralnetworks.Priority priority, in long deadline, in ParcelFileDescriptor[] modelCache, in ParcelFileDescriptor[] dataCache, in byte[] token, in android.hardware.neuralnetworks.IPreparedModelCallback callback); + void prepareModelFromCache(in long deadline, in ParcelFileDescriptor[] modelCache, in ParcelFileDescriptor[] dataCache, in byte[] token, in android.hardware.neuralnetworks.IPreparedModelCallback callback); + const int BYTE_SIZE_OF_CACHE_TOKEN = 32; + const int MAX_NUMBER_OF_CACHE_FILES = 32; + const int EXTENSION_TYPE_HIGH_BITS_PREFIX = 15; + const int EXTENSION_TYPE_LOW_BITS_TYPE = 16; + const int OPERAND_TYPE_BASE_MAX = 65535; + const int OPERATION_TYPE_BASE_MAX = 65535; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl new file mode 100644 index 0000000000..a7cf90690e --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +interface IFencedExecutionCallback { + android.hardware.neuralnetworks.ErrorStatus getExecutionInfo(out android.hardware.neuralnetworks.Timing timingLaunched, out android.hardware.neuralnetworks.Timing timingFenced); +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl new file mode 100644 index 0000000000..87677122e9 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl @@ -0,0 +1,25 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +interface IPreparedModel { + android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in android.hardware.neuralnetworks.Request request, in boolean measureTiming, in long deadline, in long loopTimeoutDuration); + android.hardware.neuralnetworks.IFencedExecutionCallback executeFenced(in android.hardware.neuralnetworks.Request request, in ParcelFileDescriptor[] waitFor, in boolean measureTiming, in long deadline, in long loopTimeoutDuration, in long duration, out @nullable ParcelFileDescriptor syncFence); + const long DEFAULT_LOOP_TIMEOUT_DURATION_NS = 2000000000; + const long MAXIMUM_LOOP_TIMEOUT_DURATION_NS = 15000000000; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelCallback.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelCallback.aidl new file mode 100644 index 0000000000..d1ae2eb72b --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelCallback.aidl @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +interface IPreparedModelCallback { + void notify(in android.hardware.neuralnetworks.ErrorStatus status, in android.hardware.neuralnetworks.IPreparedModel preparedModel); +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelParcel.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelParcel.aidl new file mode 100644 index 0000000000..048251a361 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelParcel.aidl @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable IPreparedModelParcel { + android.hardware.neuralnetworks.IPreparedModel preparedModel; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Memory.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Memory.aidl new file mode 100644 index 0000000000..aa735c02d0 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Memory.aidl @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable Memory { + android.hardware.common.NativeHandle handle; + long size; + String name; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Model.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Model.aidl new file mode 100644 index 0000000000..944bd7f5ed --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Model.aidl @@ -0,0 +1,27 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable Model { + android.hardware.neuralnetworks.Subgraph main; + android.hardware.neuralnetworks.Subgraph[] referenced; + byte[] operandValues; + android.hardware.neuralnetworks.Memory[] pools; + boolean relaxComputationFloat32toFloat16; + android.hardware.neuralnetworks.ExtensionNameAndPrefix[] extensionNameToPrefix; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl new file mode 100644 index 0000000000..ca5f917578 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable NumberOfCacheFiles { + int numModelCache; + int numDataCache; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operand.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operand.aidl new file mode 100644 index 0000000000..6615b9b42c --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operand.aidl @@ -0,0 +1,28 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable Operand { + android.hardware.neuralnetworks.OperandType type; + int[] dimensions; + float scale; + int zeroPoint; + android.hardware.neuralnetworks.OperandLifeTime lifetime; + android.hardware.neuralnetworks.DataLocation location; + @nullable android.hardware.neuralnetworks.OperandExtraParams extraParams; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandExtraParams.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandExtraParams.aidl new file mode 100644 index 0000000000..20317c7016 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandExtraParams.aidl @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +union OperandExtraParams { + android.hardware.neuralnetworks.SymmPerChannelQuantParams channelQuant; + byte[] extension; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandLifeTime.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandLifeTime.aidl new file mode 100644 index 0000000000..1082f9ee1f --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandLifeTime.aidl @@ -0,0 +1,28 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@Backing(type="int") @VintfStability +enum OperandLifeTime { + TEMPORARY_VARIABLE = 0, + SUBGRAPH_INPUT = 1, + SUBGRAPH_OUTPUT = 2, + CONSTANT_COPY = 3, + CONSTANT_POOL = 4, + NO_VALUE = 5, + SUBGRAPH = 6, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandPerformance.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandPerformance.aidl new file mode 100644 index 0000000000..9232b4c70e --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandPerformance.aidl @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable OperandPerformance { + android.hardware.neuralnetworks.OperandType type; + android.hardware.neuralnetworks.PerformanceInfo info; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandType.aidl new file mode 100644 index 0000000000..bd95fab52a --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandType.aidl @@ -0,0 +1,37 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@Backing(type="int") @VintfStability +enum OperandType { + FLOAT32 = 0, + INT32 = 1, + UINT32 = 2, + TENSOR_FLOAT32 = 3, + TENSOR_INT32 = 4, + TENSOR_QUANT8_ASYMM = 5, + BOOL = 6, + TENSOR_QUANT16_SYMM = 7, + TENSOR_FLOAT16 = 8, + TENSOR_BOOL8 = 9, + FLOAT16 = 10, + TENSOR_QUANT8_SYMM_PER_CHANNEL = 11, + TENSOR_QUANT16_ASYMM = 12, + TENSOR_QUANT8_SYMM = 13, + TENSOR_QUANT8_ASYMM_SIGNED = 14, + SUBGRAPH = 15, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operation.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operation.aidl new file mode 100644 index 0000000000..383eba4a15 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operation.aidl @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable Operation { + android.hardware.neuralnetworks.OperationType type; + int[] inputs; + int[] outputs; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl new file mode 100644 index 0000000000..f786829eb9 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl @@ -0,0 +1,123 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@Backing(type="int") @VintfStability +enum OperationType { + ADD = 0, + AVERAGE_POOL_2D = 1, + CONCATENATION = 2, + CONV_2D = 3, + DEPTHWISE_CONV_2D = 4, + DEPTH_TO_SPACE = 5, + DEQUANTIZE = 6, + EMBEDDING_LOOKUP = 7, + FLOOR = 8, + FULLY_CONNECTED = 9, + HASHTABLE_LOOKUP = 10, + L2_NORMALIZATION = 11, + L2_POOL_2D = 12, + LOCAL_RESPONSE_NORMALIZATION = 13, + LOGISTIC = 14, + LSH_PROJECTION = 15, + LSTM = 16, + MAX_POOL_2D = 17, + MUL = 18, + RELU = 19, + RELU1 = 20, + RELU6 = 21, + RESHAPE = 22, + RESIZE_BILINEAR = 23, + RNN = 24, + SOFTMAX = 25, + SPACE_TO_DEPTH = 26, + SVDF = 27, + TANH = 28, + BATCH_TO_SPACE_ND = 29, + DIV = 30, + MEAN = 31, + PAD = 32, + SPACE_TO_BATCH_ND = 33, + SQUEEZE = 34, + STRIDED_SLICE = 35, + SUB = 36, + TRANSPOSE = 37, + ABS = 38, + ARGMAX = 39, + ARGMIN = 40, + AXIS_ALIGNED_BBOX_TRANSFORM = 41, + BIDIRECTIONAL_SEQUENCE_LSTM = 42, + BIDIRECTIONAL_SEQUENCE_RNN = 43, + BOX_WITH_NMS_LIMIT = 44, + CAST = 45, + CHANNEL_SHUFFLE = 46, + DETECTION_POSTPROCESSING = 47, + EQUAL = 48, + EXP = 49, + EXPAND_DIMS = 50, + GATHER = 51, + GENERATE_PROPOSALS = 52, + GREATER = 53, + GREATER_EQUAL = 54, + GROUPED_CONV_2D = 55, + HEATMAP_MAX_KEYPOINT = 56, + INSTANCE_NORMALIZATION = 57, + LESS = 58, + LESS_EQUAL = 59, + LOG = 60, + LOGICAL_AND = 61, + LOGICAL_NOT = 62, + LOGICAL_OR = 63, + LOG_SOFTMAX = 64, + MAXIMUM = 65, + MINIMUM = 66, + NEG = 67, + NOT_EQUAL = 68, + PAD_V2 = 69, + POW = 70, + PRELU = 71, + QUANTIZE = 72, + QUANTIZED_16BIT_LSTM = 73, + RANDOM_MULTINOMIAL = 74, + REDUCE_ALL = 75, + REDUCE_ANY = 76, + REDUCE_MAX = 77, + REDUCE_MIN = 78, + REDUCE_PROD = 79, + REDUCE_SUM = 80, + ROI_ALIGN = 81, + ROI_POOLING = 82, + RSQRT = 83, + SELECT = 84, + SIN = 85, + SLICE = 86, + SPLIT = 87, + SQRT = 88, + TILE = 89, + TOPK_V2 = 90, + TRANSPOSE_CONV_2D = 91, + UNIDIRECTIONAL_SEQUENCE_LSTM = 92, + UNIDIRECTIONAL_SEQUENCE_RNN = 93, + RESIZE_NEAREST_NEIGHBOR = 94, + QUANTIZED_LSTM = 95, + IF = 96, + WHILE = 97, + ELU = 98, + HARD_SWISH = 99, + FILL = 100, + RANK = 101, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OutputShape.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OutputShape.aidl new file mode 100644 index 0000000000..1300c49b7a --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OutputShape.aidl @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable OutputShape { + int[] dimensions; + boolean isSufficient; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PerformanceInfo.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PerformanceInfo.aidl new file mode 100644 index 0000000000..b5dc179943 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PerformanceInfo.aidl @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable PerformanceInfo { + float execTime; + float powerUsage; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Priority.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Priority.aidl new file mode 100644 index 0000000000..980bee328f --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Priority.aidl @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@Backing(type="int") @VintfStability +enum Priority { + LOW = 0, + MEDIUM = 1, + HIGH = 2, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Request.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Request.aidl new file mode 100644 index 0000000000..6f77066fa7 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Request.aidl @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable Request { + android.hardware.neuralnetworks.RequestArgument[] inputs; + android.hardware.neuralnetworks.RequestArgument[] outputs; + android.hardware.neuralnetworks.RequestMemoryPool[] pools; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestArgument.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestArgument.aidl new file mode 100644 index 0000000000..c9560efe4b --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestArgument.aidl @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable RequestArgument { + boolean hasNoValue; + android.hardware.neuralnetworks.DataLocation location; + int[] dimensions; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestMemoryPool.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestMemoryPool.aidl new file mode 100644 index 0000000000..123e4b0af4 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestMemoryPool.aidl @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +union RequestMemoryPool { + android.hardware.neuralnetworks.Memory pool; + int token; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Subgraph.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Subgraph.aidl new file mode 100644 index 0000000000..771d15a21d --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Subgraph.aidl @@ -0,0 +1,25 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable Subgraph { + android.hardware.neuralnetworks.Operand[] operands; + android.hardware.neuralnetworks.Operation[] operations; + int[] inputIndexes; + int[] outputIndexes; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl new file mode 100644 index 0000000000..2282febed2 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable SymmPerChannelQuantParams { + float[] scales; + int channelDim; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Timing.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Timing.aidl new file mode 100644 index 0000000000..b08d34acc1 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Timing.aidl @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL interface (or parcelable). Do not try to +// edit this file. It looks like you are doing that because you have modified +// an AIDL interface in a backward-incompatible way, e.g., deleting a function +// from an interface or a field from a parcelable and it broke the build. That +// breakage is intended. +// +// You must not make a backward incompatible changes to the AIDL files 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.neuralnetworks; +@VintfStability +parcelable Timing { + long timeOnDevice; + long timeInDriver; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/BufferDesc.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/BufferDesc.aidl new file mode 100644 index 0000000000..1b92ebc988 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/BufferDesc.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * A buffer descriptor. Describes the properties of a buffer. + */ +@VintfStability +parcelable BufferDesc { + /** + * Dimensions of the buffer. May have unknown dimensions or rank. A buffer with some number of + * unspecified dimensions is represented by setting each unspecified dimension to 0. A buffer + * with unspecified rank is represented by providing an empty dimensions vector. + */ + int[] dimensions; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/BufferRole.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/BufferRole.aidl new file mode 100644 index 0000000000..7877bc0180 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/BufferRole.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * Describes a role of an input or output to a prepared model. + */ +@VintfStability +parcelable BufferRole { + /** + * The index of the IPreparedModel within the "preparedModel" argument passed in + * IDevice::allocate. + */ + int modelIndex; + /** + * The index of the input or output operand. + */ + int ioIndex; + /** + * A floating-point value within the range (0.0, 1.0]. Describes how likely the buffer is to be + * used in the specified role. This is provided as a hint to optimize the case when multiple + * roles prefer different buffer locations or data layouts. + */ + float frequency; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/Capabilities.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/Capabilities.aidl new file mode 100644 index 0000000000..5ce78ee96f --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/Capabilities.aidl @@ -0,0 +1,63 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.OperandPerformance; +import android.hardware.neuralnetworks.PerformanceInfo; + +/** + * The capabilities of a driver. + * + * This represents performance of non-extension operations. + * + * Performance of an operation other than {@link OperationType::IF} and {@link OperationType::WHILE} + * comes from the type of its first operand. + */ +@VintfStability +parcelable Capabilities { + /** + * Driver performance when operating on float32 data but performing calculations with range + * and/or precision as low as that of the IEEE 754 16-bit floating-point format. + */ + PerformanceInfo relaxedFloat32toFloat16PerformanceScalar; + PerformanceInfo relaxedFloat32toFloat16PerformanceTensor; + /** + * Performance by operand type. Must be sorted by OperandType. + * + * If a particular {@link OperandType} is not present in operandPerformance, its performance is + * treated as { .execTime = FLT_MAX, .powerUsage = FLT_MAX }. + * + * Performance does not apply to {@link OperandType::SUBGRAPH}, and a driver must not report + * operand performance for {@link OperandType::SUBGRAPH}. + */ + OperandPerformance[] operandPerformance; + /** + * Performance of an {@link OperationType::IF} operation is the sum of + * {@link Capabilities::ifPerformance} and the mean of performance for the two branch subgraphs, + * where performance for a subgraph is the sum of the performance of all operations within the + * subgraph. + */ + PerformanceInfo ifPerformance; + /** + * Performance of a {@link OperationType::WHILE} operation is the sum of + * {@link Capabilities::whilePerformance}, performance for the condition subgraph and + * performance for the body subgraph, where performance for a subgraph is the sum of the + * performance of all operations within the subgraph. + */ + PerformanceInfo whilePerformance; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/DataLocation.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/DataLocation.aidl new file mode 100644 index 0000000000..57e3f4ade6 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/DataLocation.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * Describes the location of a data object. + */ +@VintfStability +parcelable DataLocation { + /** + * The index of the memory pool where this location is found. + */ + int poolIndex; + /** + * Offset in bytes from the start of the pool. + */ + long offset; + /** + * The length of the data in bytes. + */ + long length; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/DeviceBuffer.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/DeviceBuffer.aidl new file mode 100644 index 0000000000..d51e1b2881 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/DeviceBuffer.aidl @@ -0,0 +1,36 @@ +/* + * 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. + */ + + package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.IBuffer; + +/** + * A type that is used to represent a driver allocated buffer and token that corresponds to it. + */ + @VintfStability + parcelable DeviceBuffer { + /** + * An IBuffer object used to interact with the device allocated buffer. + */ + IBuffer buffer; + /** + * A positive token identifying the allocated buffer. The token is provided when referencing the + * buffer as one of the memory pools in the request of an execution. The token must not collide + * with the tokens of other IBuffer objects that are currently alive in the same driver service. + */ + int token; + } \ No newline at end of file diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/DeviceType.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/DeviceType.aidl new file mode 100644 index 0000000000..8399d504ce --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/DeviceType.aidl @@ -0,0 +1,45 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * Device types. + * + * The type of NNAPI device. + */ +@VintfStability +@Backing(type="int") +enum DeviceType { + /** + * The device does not fall into any category below. + */ + OTHER = 1, + /** + * The device runs NNAPI models on single or multi-core CPU. + */ + CPU = 2, + /** + * The device can run NNAPI models and also accelerate graphics APIs such as OpenGL ES and + * Vulkan. + */ + GPU = 3, + /** + * Dedicated accelerator for Machine Learning workloads. + */ + ACCELERATOR = 4, +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/ErrorStatus.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/ErrorStatus.aidl new file mode 100644 index 0000000000..860f86a156 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/ErrorStatus.aidl @@ -0,0 +1,52 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * Calls to neural networks AIDL interfaces may return a ServiceSpecificException with the following + * error codes. + */ +@VintfStability +@Backing(type="int") +enum ErrorStatus { + NONE, + DEVICE_UNAVAILABLE, + GENERAL_FAILURE, + OUTPUT_INSUFFICIENT_SIZE, + INVALID_ARGUMENT, + /** + * Failure because a deadline could not be met for a task, but future deadlines may still be met + * for the same task after a short delay. + */ + MISSED_DEADLINE_TRANSIENT, + /** + * Failure because a deadline could not be met for a task, and future deadlines will likely also + * not be met for the same task even after a short delay. + */ + MISSED_DEADLINE_PERSISTENT, + /** + * Failure because of a resource limitation within the driver, but future calls for the same + * task may still succeed after a short delay. + */ + RESOURCE_EXHAUSTED_TRANSIENT, + /** + * Failure because of a resource limitation within the driver, and future calls for the same + * task will likely also fail even after a short delay. + */ + RESOURCE_EXHAUSTED_PERSISTENT, +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/ExecutionPreference.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/ExecutionPreference.aidl new file mode 100644 index 0000000000..901cb384c9 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/ExecutionPreference.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * Execution preferences. + */ +@VintfStability +@Backing(type="int") +enum ExecutionPreference { + /** + * Prefer executing in a way that minimizes battery drain. This is desirable for compilations + * that will be executed often. + */ + LOW_POWER, + /** + * Prefer returning a single answer as fast as possible, even if this causes more power + * consumption. + */ + FAST_SINGLE_ANSWER, + /** + * Prefer maximizing the throughput of successive frames, for example when processing successive + * frames coming from the camera. + */ + SUSTAINED_SPEED, +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/ExecutionResult.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/ExecutionResult.aidl new file mode 100644 index 0000000000..403fe097ee --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/ExecutionResult.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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.ErrorStatus; +import android.hardware.neuralnetworks.OutputShape; +import android.hardware.neuralnetworks.Timing; + +/** + * A result from running a synchronous execution of a prepared model. + */ +@VintfStability +parcelable ExecutionResult { + /** + * A value of "true" indicates that the execution was successful. A value of "false" indicates + * the execution failed because at least one output operand buffer was not large enough to store + * the corresponding output. + */ + boolean outputSufficientSize; + /** + * A list of shape information of model output operands. The index in "outputShapes" corresponds + * to the index of the output operand in the Request outputs vector. + */ + OutputShape[] outputShapes; + /** + * Duration of execution. Unless measure is true and the execution is successful, all times must + * be reported as -1. A driver may choose to report any time as -1, indicating that measurement + * is not available. + */ + Timing timing; +} + diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/Extension.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/Extension.aidl new file mode 100644 index 0000000000..159e3c15aa --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/Extension.aidl @@ -0,0 +1,42 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.ExtensionOperandTypeInformation; + +/** + * Information about an extension. + */ +@VintfStability +parcelable Extension { + /** + * The extension name. + * + * The name must consist of lowercase latin letters, numbers, periods, and underscore signs. The + * name must contain at least one period. + * + * The name must start with the reverse domain name of the vendor. + * + * Example: com.google.test_extension + */ + String name; + /** + * Information about operand types defined by the extension. + */ + ExtensionOperandTypeInformation[] operandTypes; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl new file mode 100644 index 0000000000..76074bf416 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl @@ -0,0 +1,49 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * The mapping between extension names and prefixes of operand and operation type values. + * + * An operand or operation whose numeric type value is above {@link IDevice::OPERAND_TYPE_BASE_MAX} + * or {@link IDevice::OPERATION_TYPE_BASE_MAX} respectively should be interpreted as an extension + * operand/operation. The low {@link IDevice::EXTENSION_TYPE_LOW_BITS_TYPE} bits of the value + * correspond to the type ID within the extension and the high + * {@link IDevice::EXTENSION_TYPE_HIGH_BITS_PREFIX} bits encode the "prefix", which maps uniquely to + * the extension name. The sign bit is always 0. + * + * For example, if a model contains an operation whose value is 0x7AAABBBB and extensionNameToPrefix + * contains an entry with prefix=0x7AAA and name="vendor.test.test_extension", then the operation + * should be interpreted as the operation 0xBBBB of the extension named vendor.test.test_extension. + * + * This is a one-to-one correspondence. That is, there must be at most one prefix corresponding to + * each extension name and at most one extension name corresponding to each prefix. + */ +@VintfStability +parcelable ExtensionNameAndPrefix { + /** + * The extension name. + * + * See {@link Extension::name} for the format specification. + */ + String name; + /** + * The extension prefix. Only the lowest 15 bits are used, so the value must be less than 32768. + */ + char prefix; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl new file mode 100644 index 0000000000..d7f93c10b0 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl @@ -0,0 +1,38 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * Information about an extension operand type. + */ +@VintfStability +parcelable ExtensionOperandTypeInformation { + /** + * The extension operand type. + */ + char type; + /** + * Indicates whether the extension operand type represents a tensor or a scalar. + */ + boolean isTensor; + /** + * The byte size of the operand (if scalar) or of a single element (if tensor). + */ + int byteSize; +} + diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/FusedActivationFunc.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/FusedActivationFunc.aidl new file mode 100644 index 0000000000..40f1053f41 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/FusedActivationFunc.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * Fused activation function types. + */ +@VintfStability +@Backing(type="int") +enum FusedActivationFunc { + NONE, + RELU, + RELU1, + RELU6, +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IBuffer.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IBuffer.aidl new file mode 100644 index 0000000000..eb3dec6e4f --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IBuffer.aidl @@ -0,0 +1,58 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.Memory; + +/** + * This interface represents a device memory buffer. + */ +@VintfStability +interface IBuffer { + /** + * Sets the content of this buffer from a shared memory region. + * + * @param src The source shared memory region. + * @param dimensions Updated dimensional information. If the dimensions of the IBuffer object + * are not fully specified, then the dimensions must be fully specified here. + * If the dimensions of the IBuffer object are fully specified, then the + * dimensions may be empty here. If dimensions.size() > 0, then all dimensions + * must be specified here, and any dimension that was specified in the IBuffer + * object must have the same value here. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - INVALID_ARGUMENT if provided memory is invalid, or if the dimensions is invalid + */ + void copyFrom(in Memory src, in int[] dimensions); + + /** + * Retrieves the content of this buffer to a shared memory region. + * + * The IBuffer object must have been initialized before the call to IBuffer::copyTo. For more + * information on the state of the IBuffer object, refer to IDevice::allocate. + * + * @param dst The destination shared memory region. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if the IBuffer object is uninitialized, or there is an unspecified + * error + * - INVALID_ARGUMENT if provided memory is invalid + */ + void copyTo(in Memory dst); +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl new file mode 100644 index 0000000000..0c4954c1b8 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl @@ -0,0 +1,431 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.BufferDesc; +import android.hardware.neuralnetworks.BufferRole; +import android.hardware.neuralnetworks.Capabilities; +import android.hardware.neuralnetworks.DeviceBuffer; +import android.hardware.neuralnetworks.DeviceType; +import android.hardware.neuralnetworks.ExecutionPreference; +import android.hardware.neuralnetworks.Extension; +import android.hardware.neuralnetworks.IPreparedModel; +import android.hardware.neuralnetworks.IPreparedModelCallback; +import android.hardware.neuralnetworks.IPreparedModelParcel; +import android.hardware.neuralnetworks.Model; +import android.hardware.neuralnetworks.NumberOfCacheFiles; +import android.hardware.neuralnetworks.Priority; + +/** + * This interface represents a device driver. + */ +@VintfStability +interface IDevice { + /** + * The byte size of the cache token. + */ + const int BYTE_SIZE_OF_CACHE_TOKEN = 32; + /** + * The maximum number of files for each type of cache in compilation caching. + */ + const int MAX_NUMBER_OF_CACHE_FILES = 32; + + /** + * Numeric values of extension operand and operation types have the following structure: + * - The sign bit is always 0. + * - 15 high bits represent the "prefix", which corresponds uniquely to the extension name. + * - 16 low bits represent the type ID within the extension. + */ + const int EXTENSION_TYPE_HIGH_BITS_PREFIX = 15; + const int EXTENSION_TYPE_LOW_BITS_TYPE = 16; + /** + * OperandType with any value above {@link IDevice::OPERAND_TYPE_BASE_MAX} must be interpreted + * as an extension type according to {@link Model::extensionNameToPrefix}. + */ + const int OPERAND_TYPE_BASE_MAX = 0xFFFF; + /** + * OperationType with any value above {@link IDevice::OPERATION_TYPE_BASE_MAX} must be + * interpreted as an extension type according to {@link Model::extensionNameToPrefix}. + */ + const int OPERATION_TYPE_BASE_MAX = 0xFFFF; + + /** + * Allocates a driver-managed buffer with the properties specified by the buffer descriptor as + * well as the input and output roles. + * + * The allocate function must verify its inputs are correct. If there is an error, or if a + * certain role or property is not supported by the driver, the allocate function must return a + * service specific exception with an appropriate ErrorStatus. If the allocation is successful, + * this method must return a DeviceBuffer object with the produced IBuffer and a positive token + * identifying the allocated buffer. A successful allocation must accommodate all of the + * specified roles and buffer properties. + * + * The buffer is allocated to an uninitialized state. An uninitialized buffer may only be used + * in ways that are specified by outputRoles. A buffer is initialized after it is used as an + * output in a successful execution, or after a successful invocation of IBuffer::copyFrom on + * the buffer. An initialized buffer may be used according to all roles specified in inputRoles + * and outputRoles. A buffer will return to the uninitialized state if it is used as an output + * in a failed execution, or after a failed invocation of IBuffer::copyFrom on the buffer. + * + * The dimensions of the buffer can be deduced from the buffer descriptor as well as the + * dimensions of the corresponding model operands of the input and output roles. The dimensions + * or rank of the buffer may be unknown at this stage. As such, some driver services may only + * create a placeholder and defer the actual allocation until execution time. Note that the same + * buffer may be used for different shapes of outputs on different executions. When the buffer + * is used as an input, the input shape must be the same as the output shape from the last + * execution using this buffer as an output. + * + * The driver must apply proper validatation upon every usage of the buffer, and must fail the + * execution immediately if the usage is illegal. + * + * @param desc A buffer descriptor specifying the properties of the buffer to allocate. + * @param preparedModels A vector of IPreparedModel objects. Must only contain IPreparedModel + * objects from the same IDevice as this method is being invoked on. + * @param inputRoles A vector of roles with each specifying an input to a prepared model. + * @param outputRoles A vector of roles with each specifying an output to a prepared model. Each + * role specified in inputRoles and outputRoles must be unique. The + * corresponding model operands of the roles must have the same OperandType, + * scale, zero point, and ExtraParams. The dimensions of the operands and the + * dimensions specified in the buffer descriptor must be compatible with each + * other. Two dimensions are incompatible if there is at least one axis that + * is fully specified in both but has different values. + * @return DeviceBuffer object containing the allocated IBuffer object and a positive token that + * can be used to reference the buffer as one of the memory pools. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if a certain buffer property or a certain role is not supported, + * or if there is an unspecified error + * - INVALID_ARGUMENT if one of the input arguments is invalid + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + */ + DeviceBuffer allocate(in BufferDesc desc, in IPreparedModelParcel[] preparedModels, + in BufferRole[] inputRoles, in BufferRole[] outputRoles); + + /** + * Gets the capabilities of a driver. + * + * @return Capabilities of the driver. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + */ + Capabilities getCapabilities(); + + /** + * Gets the caching requirements of the driver implementation. + * + * There are two types of cache file descriptors provided to the driver: model cache and data + * cache. + * + * The data cache is for caching constant data, possibly including preprocessed and transformed + * tensor buffers. Any modification to the data cache should have no worse effect than + * generating bad output values at execution time. + * + * The model cache is for caching security-sensitive data such as compiled executable machine + * code in the device's native binary format. A modification to the model cache may affect the + * driver's execution behavior, and a malicious client could make use of this to execute beyond + * the granted permission. Thus, the driver must always check whether the model cache is + * corrupted before preparing the model from cache. + * + * getNumberOfCacheFilesNeeded returns how many of each type of cache files the driver + * implementation needs to cache a single prepared model. Returning 0 for both types indicates + * compilation caching is not supported by this driver. The driver may still choose not to cache + * certain compiled models even if it reports that caching is supported. + * + * If the device reports that caching is not supported, the user may avoid calling + * IDevice::prepareModelFromCache or providing cache file descriptors to + * IDevice::prepareModel. + * + * @return NumberOfCacheFiles structure indicating how many files for model and data cache the + * driver needs to cache a single prepared model. It must be less than or equal to + * MAX_NUMBER_OF_CACHE_FILES. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + */ + NumberOfCacheFiles getNumberOfCacheFilesNeeded(); + + /** + * Gets information about extensions supported by the driver implementation. + * + * All extension operations and operands must be fully supported for the extension to appear in + * the list of supported extensions. + * + * @return A list of supported extensions. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + */ + Extension[] getSupportedExtensions(); + + /** + * Gets the supported operations in a model. + * + * getSupportedOperations indicates which operations of the top-level subgraph are fully + * supported by the vendor driver. If an operation may not be supported for any reason, + * getSupportedOperations must return false for that operation. + * + * The {@link OperationType::IF} and {@link OperationType::WHILE} operations may only be fully + * supported if the vendor driver fully supports all operations in the referenced subgraphs. + * + * @param model A model whose operations -- and their corresponding operands -- are to be + * verified by the driver. + * @return A list of supported operations, where true indicates the operation is supported and + * false indicates the operation is not supported. The index of "supported" corresponds with + * the index of the operation it is describing in the main subgraph. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - INVALID_ARGUMENT if provided model is invalid + */ + boolean[] getSupportedOperations(in Model model); + + /** + * Get the type of a given device. + * + * The device type can be used to help application developers to distribute Machine Learning + * workloads and other workloads such as graphical rendering. E.g., for an app which renders AR + * scenes based on real time object detection results, the developer could choose an ACCELERATOR + * type device for ML workloads, and reserve GPU for graphical rendering. + * + * @return The DeviceType of the device. Please note, this is not a bitfield of DeviceTypes. + * Each device must only be of a single DeviceType. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if the query resulted in an unspecified error + */ + DeviceType getType(); + + /** + * Get the version string of the driver implementation. + * + * The version string must be a unique token among the set of version strings of drivers of a + * specific device. The token identifies the device driver's implementation. The token must not + * be confused with the feature level which is solely defined by the interface version. This API + * is opaque to the Android framework, but the Android framework may use the information for + * debugging or to pass on to NNAPI applications. + * + * Application developers sometimes have specific requirements to ensure good user experiences, + * and they need more information to make intelligent decisions when the Android framework + * cannot. For example, combined with the device name and other information, the token can help + * NNAPI applications filter devices based on their needs: + * - An application demands a certain level of performance, but a specific version of the + * driver cannot meet that requirement because of a performance regression. + * The application can disallow the driver based on the version provided. + * - An application has a minimum precision requirement, but certain versions of + * the driver cannot meet that requirement because of bugs or certain optimizations. + * The application can filter out versions of these drivers. + * + * @return The version string of the device implementation. Must have nonzero length. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if the query resulted in an unspecified error + */ + String getVersionString(); + + /** + * Asynchronously creates a prepared model for execution and optionally saves it into cache + * files. + * + * prepareModel is used to make any necessary transformations to or alternative representations + * to a model for execution, possibly including transformations on the constant data, + * optimization on the model's graph, or compilation into the device's native binary format. The + * model itself is not changed. + * + * Optionally, caching information may be provided for the driver to save the prepared model to + * cache files for faster model compilation time when the same model preparation is requested in + * the future. There are two types of cache file descriptors provided to the driver: model cache + * and data cache. For more information on the two types of cache, refer to + * getNumberOfCacheFilesNeeded. + * + * The file descriptors must be opened with read and write permission. A file may have any size, + * and the corresponding file descriptor may have any offset. The driver must truncate a file to + * zero size before writing to that file. The file descriptors may be closed by the client once + * the asynchronous preparation has finished. The driver must dup a file descriptor if it wants + * to get access to the cache file later. + * + * The model is prepared asynchronously with respect to the caller. The prepareModel function + * must verify the inputs to the preparedModel function related to preparing the model (as + * opposed to saving the prepared model to cache) are correct. If there is an error, + * prepareModel must immediately invoke the callback with the appropriate ErrorStatus value and + * nullptr for the IPreparedModel, then return a status with a service specific exception with + * the same ErrorStatus. If the inputs to the prepareModel function that are related to + * preparing the model are valid and there is no error, prepareModel must launch an asynchronous + * task to prepare the model in the background, and immediately return from prepareModel. If the + * asynchronous task fails to launch, prepareModel must immediately invoke the callback with + * ErrorStatus::GENERAL_FAILURE and nullptr for the IPreparedModel, then return a service + * specific exception with ErrorStatus::GENERAL_FAILURE. + * + * When the asynchronous task has finished preparing the model, it must immediately invoke the + * callback function provided as an input to prepareModel. If the model was prepared + * successfully, the callback object must be invoked with an error status of ErrorStatus::NONE + * and the produced IPreparedModel object. If an error occurred preparing the model, the + * callback object must be invoked with the appropriate ErrorStatus value and nullptr for the + * IPreparedModel. + * + * The model is prepared with a priority. This priority is relative to other prepared models + * owned by the same client. Higher priority executions may use more compute resources than + * lower priority executions, and may preempt or starve lower priority executions. + * + * prepareModel can be called with an optional deadline. If the model is not able to be prepared + * before the provided deadline, the model preparation may be aborted, and either + * {@link ErrorStatus::MISSED_DEADLINE_TRANSIENT} or {@link + * ErrorStatus::MISSED_DEADLINE_PERSISTENT} may be returned. The error due to an abort must be + * sent the same way as other errors, described above. + * + * Optionally, the driver may save the prepared model to cache during the asynchronous + * preparation. Any error that occurs when saving to cache must not affect the status of + * preparing the model. Even if the input arguments related to the cache may be invalid, or the + * driver may fail to save to cache, the prepareModel function must finish preparing the model. + * The driver may choose not to save to cache even if the caching information is provided and + * valid. + * + * The only information that may be unknown to the model at this stage is the shape of the + * tensors, which may only be known at execution time. As such, some driver services may return + * partially prepared models, where the prepared model may only be finished when it is paired + * with a set of inputs to the model. Note that the same prepared model object may be used with + * different shapes of inputs on different (possibly concurrent) executions. + * + * Multiple threads may call prepareModel on the same model concurrently. + * + * @param model The model to be prepared for execution. + * @param preference Indicates the intended execution behavior of a prepared model. + * @param priority The priority of the prepared model relative to other prepared models owned by + * the client. + * @param deadline The time by which the model is expected to be prepared. The time is measured + * in nanoseconds since epoch of the steady clock (as from + * std::chrono::steady_clock). If the model cannot be prepared by the deadline, + * the preparation may be aborted. Passing -1 means the deadline is omitted. + * Other negative values are invalid. + * @param modelCache A vector of file descriptors for the security-sensitive cache. The length + * of the vector must either be 0 indicating that caching information is not + * provided, or match the numModelCache returned from + * getNumberOfCacheFilesNeeded. The cache file descriptors will be provided in + * the same order when retrieving the preparedModel from cache files with + * prepareModelFromCache. + * @param dataCache A vector of file descriptors for the constants' cache. The length of the + * vector must either be 0 indicating that caching information is not provided, + * or match the numDataCache returned from getNumberOfCacheFilesNeeded. The + * cache file descriptors will be provided in the same order when retrieving + * the preparedModel from cache files with prepareModelFromCache. + * @param token A caching token of length BYTE_SIZE_OF_CACHE_TOKEN identifying the prepared + * model. The same token will be provided when retrieving the prepared model from + * the cache files with prepareModelFromCache. Tokens should be chosen to have a + * low rate of collision for a particular application. The driver cannot detect a + * collision; a collision will result in a failed execution or in a successful + * execution that produces incorrect output values. If both modelCache and + * dataCache are empty indicating that caching information is not provided, this + * token must be ignored. + * @param callback A callback object used to return the error status of preparing the model for + * execution and the prepared model if successful, nullptr otherwise. The + * callback object's notify function must be called exactly once, even if the + * model could not be prepared. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - INVALID_ARGUMENT if one of the input arguments related to preparing the model is + * invalid + * - MISSED_DEADLINE_* if the preparation is aborted because the model cannot be prepared by + * the deadline + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + */ + void prepareModel(in Model model, in ExecutionPreference preference, in Priority priority, + in long deadline, in ParcelFileDescriptor[] modelCache, in ParcelFileDescriptor[] dataCache, + in byte[] token, in IPreparedModelCallback callback); + + /** + * Creates a prepared model from cache files for execution. + * + * prepareModelFromCache is used to retrieve a prepared model directly from cache files to avoid + * slow model compilation time. There are two types of cache file descriptors provided to the + * driver: model cache and data cache. For more information on the two types of cache files, + * refer to getNumberOfCacheFilesNeeded. + * + * The file descriptors must be opened with read and write permission. A file may have any size, + * and the corresponding file descriptor may have any offset. The driver must truncate a file to + * zero size before writing to that file. The file descriptors may be closed by the client once + * the asynchronous preparation has finished. The driver must dup a file descriptor if it wants + * to get access to the cache file later. + * + * The model is prepared asynchronously with respect to the caller. The prepareModelFromCache + * function must verify the inputs to the prepareModelFromCache function are correct, and that + * the security-sensitive cache has not been modified since it was last written by the driver. + * If there is an error, or if compilation caching is not supported, or if the + * security-sensitive cache has been modified, prepareModelFromCache must immediately invoke the + * callback with the appropriate ErrorStatus value and nullptr for the IPreparedModel, then + * return a status with a service specific exception with the same ErrorStatus. If the inputs to + * the prepareModelFromCache function are valid, the security-sensitive cache is not modified, + * and there is no error, prepareModelFromCache must launch an asynchronous task to prepare the + * model in the background, and immediately return from prepareModelFromCache. If the + * asynchronous task fails to launch, prepareModelFromCache must immediately invoke the callback + * with ErrorStatus::GENERAL_FAILURE and nullptr for the IPreparedModel, then return a service + * specific exception with ErrorStatus::GENERAL_FAILURE. + * + * When the asynchronous task has finished preparing the model, it must immediately invoke the + * callback function provided as an input to prepareModelFromCache. If the model was prepared + * successfully, the callback object must be invoked with an error status of ErrorStatus::NONE + * and the produced IPreparedModel object. If an error occurred preparing the model, the + * callback object must be invoked with the appropriate ErrorStatus value and nullptr for the + * IPreparedModel. + * + * prepareModelFromCache can be called with an optional deadline. If the model is not able to + * prepared before the provided deadline, the model preparation may be aborted, and either + * {@link ErrorStatus::MISSED_DEADLINE_TRANSIENT} or + * {@link ErrorStatus::MISSED_DEADLINE_PERSISTENT} may be returned. The error due to an abort + * must be sent the same way as other errors, described above. + * + * The only information that may be unknown to the model at this stage is the shape of the + * tensors, which may only be known at execution time. As such, some driver services may return + * partially prepared models, where the prepared model may only be finished when it is paired + * with a set of inputs to the model. Note that the same prepared model object may be used with + * different shapes of inputs on different (possibly concurrent) executions. + * + * @param deadline The time by which the model is expected to be prepared. The time is measured + * in nanoseconds since epoch of the steady clock (as from + * std::chrono::steady_clock). If the model cannot be prepared by the deadline, + * the preparation may be aborted. Passing -1 means the deadline is omitted. + * Other negative values are invalid. + * @param modelCache A vector of file descriptors for the security-sensitive cache. The length + * of the vector must match the numModelCache returned from + * getNumberOfCacheFilesNeeded. The cache file descriptors will be provided in + * the same order as with prepareModel. + * @param dataCache A vector of file descriptors for the constants' cache. The length of the + * vector must match the numDataCache returned from + * getNumberOfCacheFilesNeeded. The cache file descriptors will be provided in + * the same order as with prepareModel. + * @param token A caching token of length BYTE_SIZE_OF_CACHE_TOKEN identifying the prepared + * model. It is the same token provided when saving the cache files with + * prepareModel. Tokens should be chosen to have a low rate of collision for a + * particular application. The driver cannot detect a collision; a collision will + * result in a failed execution or in a successful execution that produces + * incorrect output values. + * @param callback A callback object used to return the error status of preparing the model for + * execution and the prepared model if successful, nullptr otherwise. The + * callback object's notify function must be called exactly once, even if the + * model could not be prepared. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if caching is not supported or if there is an unspecified error + * - INVALID_ARGUMENT if one of the input arguments is invalid + * - MISSED_DEADLINE_* if the preparation is aborted because the model cannot be prepared by + * the deadline + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + */ + void prepareModelFromCache(in long deadline, in ParcelFileDescriptor[] modelCache, + in ParcelFileDescriptor[] dataCache, in byte[] token, in IPreparedModelCallback callback); +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl new file mode 100644 index 0000000000..47e5916665 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl @@ -0,0 +1,56 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.ErrorStatus; +import android.hardware.neuralnetworks.Timing; + +/** + * IFencedExecutionCallback can be used to query the error status result and duration information + * from an IPreparedModel::executeFenced call. + */ +@VintfStability +interface IFencedExecutionCallback { + /** + * The getExecutionInfo method is used by the clients to query error status result and duration + * information. The method must only be called after the actual evaluation has finished or + * resulted in an runtime error, as indicated by the status of the sync fence returned by the + * IPreparedModel::executeFenced call, otherwise GENERAL_FAILURE must be returned. + * + * @param out timingLaunched The duration starts when executeFenced is called and ends when + * executeFenced signals the returned syncFence. Unless measureTiming + * was set to true when launching the execution and status is NONE, + * all times must be reported as -1. A driver may choose to report any + * time as -1, indicating that particular measurement is not + * available. + * @param out timingFenced The duration starts when all waitFor sync fences have been signaled + * and ends when executeFenced signals the returned syncFence. Unless + * measureTiming was set to true when launching the execution and status + * is NONE, all times must be reported as -1. A driver may choose to + * report any time as -1, indicating that particular measurement is not + * available. + * @return Error status returned from the asynchronously dispatched execution must be: + * - NONE if the asynchronous execution was successful + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if the asynchronous task resulted in an unspecified error + * - MISSED_DEADLINE_* if the execution is aborted because it cannot be completed by the + * deadline + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + */ + ErrorStatus getExecutionInfo(out Timing timingLaunched, out Timing timingFenced); +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl new file mode 100644 index 0000000000..c1b2992010 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl @@ -0,0 +1,173 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.common.NativeHandle; +import android.hardware.neuralnetworks.ErrorStatus; +import android.hardware.neuralnetworks.ExecutionResult; +import android.hardware.neuralnetworks.IFencedExecutionCallback; +import android.hardware.neuralnetworks.Request; + +/** + * IPreparedModel describes a model that has been prepared for execution and is used to launch + * executions. + */ +@VintfStability +interface IPreparedModel { + /** + * Each {@link OperationType::WHILE} operation in the model has an implicit execution timeout + * duration associated with it ("loop timeout duration"). This duration is configurable on a + * per-execution basis and must not exceed 15 seconds. The default value is 2 seconds. The units + * are nanoseconds. + */ + const long DEFAULT_LOOP_TIMEOUT_DURATION_NS = 2000000000; + const long MAXIMUM_LOOP_TIMEOUT_DURATION_NS = 15000000000; + + /** + * Performs a synchronous execution on a prepared model. + * + * The execution is performed synchronously with respect to the caller. executeSynchronously + * must verify the inputs to the function are correct, and the usages of memory pools allocated + * by IDevice::allocate are valid. If there is an error, executeSynchronously must immediately + * return a service specific exception with the appropriate ErrorStatus value. If the inputs to + * the function are valid and there is no error, executeSynchronously must perform the + * execution, and must not return until the execution is complete. + * + * The caller must not change the content of any data object referenced by 'request' (described + * by the {@link DataLocation} of a {@link RequestArgument}) until executeSynchronously returns. + * executeSynchronously must not change the content of any of the data objects corresponding to + * 'request' inputs. + * + * If the prepared model was prepared from a model wherein all tensor operands have fully + * specified dimensions, and the inputs to the function are valid, and at execution time every + * operation's input operands have legal values, then the execution should complete + * successfully: there must be no failure unless the device itself is in a bad state. + * + * executeSynchronously may be called with an optional deadline. If the execution is not able to + * be completed before the provided deadline, the execution may be aborted, and either + * {@link ErrorStatus::MISSED_DEADLINE_TRANSIENT} or {@link + * ErrorStatus::MISSED_DEADLINE_PERSISTENT} may be returned. The error due to an abort must be + * sent the same way as other errors, described above. + * + * Any number of calls to the execute* functions, in any combination, may be made concurrently, + * even on the same IPreparedModel object. + * + * @param request The input and output information on which the prepared model is to be + * executed. + * @param measure Specifies whether or not to measure duration of the execution. The duration + * runs from the time the driver sees the call to the executeSynchronously + * function to the time the driver returns from the function. + * @param deadline The time by which the execution is expected to complete. The time is measured + * in nanoseconds since epoch of the steady clock (as from + * std::chrono::steady_clock). If the execution cannot be finished by the + * deadline, the execution may be aborted. Passing -1 means the deadline is + * omitted. Other negative values are invalid. + * @param loopTimeoutDuration The maximum amount of time in nanoseconds that should be spent + * executing a {@link OperationType::WHILE} operation. If a loop + * condition model does not output false within this duration, the + * execution must be aborted. If -1 is provided, the maximum amount + * of time is {@link DEFAULT_LOOP_TIMEOUT_DURATION_NS}. Other + * negative values are invalid. When provided, the duration must not + * exceed {@link MAXIMUM_LOOP_TIMEOUT_DURATION_NS}. + * @return ExecutionResult parcelable, containing the status of the execution, output shapes and + * timing information. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - INVALID_ARGUMENT if one of the input arguments is invalid + * - MISSED_DEADLINE_* if the execution is aborted because it cannot be completed by the + * deadline + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + */ + ExecutionResult executeSynchronously(in Request request, in boolean measureTiming, + in long deadline, in long loopTimeoutDuration); + + /** + * Launch a fenced asynchronous execution on a prepared model. + * + * The execution is performed asynchronously with respect to the caller. executeFenced must + * verify the inputs to the function are correct, and the usages of memory pools allocated by + * IDevice::allocate are valid. If there is an error, executeFenced must immediately return a + * service specific exception with the corresponding ErrorStatus. If the inputs to the function + * are valid and there is no error, executeFenced must dispatch an asynchronous task to perform + * the execution in the background, assign a sync fence that will be signaled once the execution + * is completed and immediately return a callback that can be used by the client to query the + * duration and runtime error status. If the task has finished before the call returns, + * syncFence file descriptor may be set to -1. The execution must wait for all the sync fences + * (if any) in waitFor to be signaled before starting the actual execution. + * + * When the asynchronous task has finished its execution, it must immediately signal the + * syncFence returned from the executeFenced call. After the syncFence is signaled, the task + * must not modify the content of any data object referenced by 'request' (described by the + * {@link DataLocation} of a {@link RequestArgument}). + * + * executeFenced may be called with an optional deadline and an optional duration. If the + * execution is not able to be completed before the provided deadline or within the timeout + * duration (measured from when all sync fences in waitFor are signaled), whichever comes + * earlier, the execution may be aborted, and either + * {@link ErrorStatus::MISSED_DEADLINE_TRANSIENT} or {@link + * ErrorStatus::MISSED_DEADLINE_PERSISTENT} may be returned. The error due to an abort must be + * sent the same way as other errors, described above. + * + * If any of the sync fences in waitFor changes to error status after the executeFenced call + * succeeds, or the execution is aborted because it cannot finish before the deadline has been + * reached or the duration has elapsed, the driver must immediately set the returned syncFence + * to error status. + * + * Any number of calls to the execute* functions, in any combination, may be made concurrently, + * even on the same IPreparedModel object. + * + * @param request The input and output information on which the prepared model is to be + * executed. The outputs in the request must have fully specified dimensions. + * @param waitFor A vector of sync fence file descriptors. Execution must not start until all + * sync fences have been signaled. + * @param measure Specifies whether or not to measure duration of the execution. + * @param deadline The time by which the execution is expected to complete. The time is measured + * in nanoseconds since epoch of the steady clock (as from + * std::chrono::steady_clock).If the execution cannot be finished by the + * deadline, the execution may be aborted. Passing -1 means the deadline is + * omitted. Other negative values are invalid. + * @param loopTimeoutDuration The maximum amount of time in nanoseconds that should be spent + * executing a {@link OperationType::WHILE} operation. If a loop + * condition model does not output false within this duration, the + * execution must be aborted. If -1 is provided, the maximum amount + * of time is {@link DEFAULT_LOOP_TIMEOUT_DURATION_NS}. Other + * negative values are invalid. When provided, the duration must not + * exceed {@link MAXIMUM_LOOP_TIMEOUT_DURATION_NS}. + * @param duration The length of time in nanoseconds within which the execution is expected to + * complete after all sync fences in waitFor are signaled. If the execution + * cannot be finished within the duration, the execution may be aborted. Passing + * -1 means the duration is omitted. Other negative values are invalid. + * @param out syncFence The sync fence that will be signaled when the task is completed. The + * sync fence will be set to error if a critical error, e.g. hardware + * failure or kernel panic, occurs when doing execution. + * @return The IFencedExecutionCallback can be used to query information like duration and error + * status when the execution is completed. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - INVALID_ARGUMENT if one of the input arguments is invalid, including fences in error + * states. + * - MISSED_DEADLINE_* if the execution is aborted because it cannot be completed by the + * deadline + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + */ + IFencedExecutionCallback executeFenced(in Request request, in ParcelFileDescriptor[] waitFor, + in boolean measureTiming, in long deadline, in long loopTimeoutDuration, in long duration, + out @nullable ParcelFileDescriptor syncFence); +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModelCallback.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModelCallback.aidl new file mode 100644 index 0000000000..adb421830c --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModelCallback.aidl @@ -0,0 +1,51 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.ErrorStatus; +import android.hardware.neuralnetworks.IPreparedModel; + +/** + * IPreparedModelCallback must be used to return a prepared model produced by an asynchronous task + * launched from IDevice::prepareModel*. + */ +@VintfStability +interface IPreparedModelCallback { + /** + * Notify must be invoked immediately after the asynchronous task holding this callback has + * finished preparing the model. If the model was successfully prepared, the method must be + * invoked with ErrorStatus::NONE and the prepared model. If the model was not able to be + * successfully prepared, the method must be invoked with the appropriate ErrorStatus and + * nullptr as the IPreparedModel. If the asynchronous task holding this callback fails to launch + * or if the model provided to IDevice::prepareModel is invalid, notify method must be invoked + * with the appropriate error as well as nullptr for the IPreparedModel. + * + * @param status Error status returned from the asynchronous model preparation task; must be: + * - NONE if the asynchronous task successfully prepared the model + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if the asynchronous task resulted in an unspecified error + * - INVALID_ARGUMENT if one of the input arguments to prepareModel is invalid + * - MISSED_DEADLINE_* if the preparation is aborted because the model cannot be + * prepared by the deadline + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + * @param preparedModel A model that has been asynchronously prepared for execution. If the + * model was unable to be prepared due to an error, nullptr must be passed + * in place of the IPreparedModel object. + */ + void notify(in ErrorStatus status, in IPreparedModel preparedModel); +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModelParcel.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModelParcel.aidl new file mode 100644 index 0000000000..f198c3f056 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModelParcel.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.IPreparedModel; + +/** + * A parcelable for passing a vector of IPreparedModel objects. + */ +@VintfStability +parcelable IPreparedModelParcel { + IPreparedModel preparedModel; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/Memory.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/Memory.aidl new file mode 100644 index 0000000000..8ecb067f30 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/Memory.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.neuralnetworks; +import android.hardware.common.NativeHandle; + +import android.os.ParcelFileDescriptor; + +/** + * A type that is used to pass pieces of shared memory between processes. + * The type structure mimics hidl_memory type from HIDL. + */ +@VintfStability +parcelable Memory { + NativeHandle handle; + long size; + String name; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/Model.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/Model.aidl new file mode 100644 index 0000000000..3bb73185f4 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/Model.aidl @@ -0,0 +1,70 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.ExtensionNameAndPrefix; +import android.hardware.neuralnetworks.Subgraph; +import android.hardware.neuralnetworks.Memory; + +/** + * A Neural Network Model. + * + * This includes not only the execution graph, but also constant data such as weights or scalars + * added at construction time. The only information that may not be known is the shape of the input + * tensors. + */ +@VintfStability +parcelable Model { + /** + * The top-level subgraph. + */ + Subgraph main; + /** + * Referenced subgraphs. + * + * Each subgraph is referenced by the main subgraph or at least one other referenced subgraph. + * + * There must be no reference cycles. + */ + Subgraph[] referenced; + /** + * A byte buffer containing operand data that were copied into the model. + * + * An operand's value must be located here if and only if Operand::lifetime equals + * OperandLifeTime::CONSTANT_COPY. + */ + byte[] operandValues; + /** + * A collection of shared memory pools containing operand values. + * + * An operand's value must be located here if and only if Operand::lifetime equals + * OperandLifeTime::CONSTANT_POOL. + */ + Memory[] pools; + /** + * 'true' indicates TENSOR_FLOAT32 may be calculated with range and/or precision as low as that + * of the IEEE 754 16-bit floating-point format. + * 'false' indicates TENSOR_FLOAT32 must be calculated using at least the range and precision of + * the IEEE 754 32-bit floating-point format. + */ + boolean relaxComputationFloat32toFloat16; + /** + * The mapping between extension names and prefixes of operand and operation type values. + */ + ExtensionNameAndPrefix[] extensionNameToPrefix; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl new file mode 100644 index 0000000000..1ca2676646 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.neuralnetworks; + +/** + * Structure indicating how many files for model and numDataCache cache the driver needs to cache a + * single prepared model. + */ +@VintfStability +parcelable NumberOfCacheFiles { + int numModelCache; + int numDataCache; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/Operand.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/Operand.aidl new file mode 100644 index 0000000000..243a89d719 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/Operand.aidl @@ -0,0 +1,113 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.DataLocation; +import android.hardware.neuralnetworks.OperandExtraParams; +import android.hardware.neuralnetworks.OperandLifeTime; +import android.hardware.neuralnetworks.OperandType; + +/** + * Describes one operand of the model's graph. + */ +@VintfStability +parcelable Operand { + /** + * The data type. + * + * Besides the values listed in {@link OperandType}, any value above + * {@link IDevice::OPERAND_TYPE_BASE_MAX} is possible and should be interpreted as an extension + * type according to {@link Model::extensionNameToPrefix}. + */ + OperandType type; + /** + * Dimensions of the operand. + * + * For a scalar operand, dimensions.size() must be 0. + * + * A tensor operand with all dimensions specified has "fully specified" dimensions. Whenever + * possible (i.e., whenever the dimensions are known at model construction time), a tensor + * operand should have (but is not required to have) fully specified dimensions, in order to + * enable the best possible performance. + * + * If a tensor operand's dimensions are not fully specified, the dimensions of the operand are + * deduced from the operand dimensions and values of the operation for which that operand is an + * output or from the corresponding {@link OperationType::IF} or {@link OperationType::WHILE} + * operation input operand dimensions in the case of referenced subgraph input operands. + * + * In the following situations, a tensor operand's dimensions must be fully specified: + * + * . The operand has lifetime CONSTANT_COPY or CONSTANT_POOL. + * + * . The operand has lifetime SUBGRAPH_INPUT and belongs to the main subgraph. Fully + * specified dimensions must either be present in the Operand or they must be provided in + * the corresponding RequestArgument. + * EXCEPTION: If the input is optional and omitted (by setting the hasNoValue field of the + * corresponding RequestArgument to true) then it need not have fully specified + * dimensions. + * + * A tensor operand with some number of unspecified dimensions is represented by setting each + * unspecified dimension to 0. + * + * A tensor operand with unspecified rank is represented by providing an empty dimensions + * vector. + */ + int[] dimensions; + /** + * Quantized scale of the operand. + * + * Must be 0 when not applicable to an operand type. + * + * See {@link OperandType}. + */ + float scale; + /** + * Quantized zero-point offset of the operand. + * + * Must be 0 when not applicable to an operand type. + * + * See {@link OperandType}. + */ + int zeroPoint; + /** + * How the operand is used. + */ + OperandLifeTime lifetime; + /** + * Where to find the data for this operand. + * If the lifetime is TEMPORARY_VARIABLE, SUBGRAPH_INPUT, SUBGRAPH_OUTPUT, or NO_VALUE: + * - All the fields must be 0. + * If the lifetime is CONSTANT_COPY: + * - location.poolIndex is 0. + * - location.offset is the offset in bytes into Model.operandValues. + * - location.length is set. + * If the lifetime is CONSTANT_POOL: + * - location.poolIndex is set. + * - location.offset is the offset in bytes into the specified pool. + * - location.length is set. + * If the lifetime is SUBGRAPH: + * - location.poolIndex is 0. + * - location.offset is the index of the referenced subgraph in {@link Model::referenced}. + * - location.length is 0. + */ + DataLocation location; + /** + * Additional parameters specific to a particular operand type. + */ + @nullable OperandExtraParams extraParams; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperandExtraParams.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperandExtraParams.aidl new file mode 100644 index 0000000000..b0112aea0c --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperandExtraParams.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.SymmPerChannelQuantParams; + +/** + * Parameters specific to a particular operand type. + */ +@VintfStability +union OperandExtraParams { + /** + * Symmetric per-channel quantization parameters. + * + * Only applicable to operands of type TENSOR_QUANT8_SYMM_PER_CHANNEL. + */ + SymmPerChannelQuantParams channelQuant; + /** + * Extension operand parameters. + * + * The framework treats this as an opaque data blob. + * The format is up to individual extensions. + */ + byte[] extension; +} \ No newline at end of file diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperandLifeTime.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperandLifeTime.aidl new file mode 100644 index 0000000000..63d1971717 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperandLifeTime.aidl @@ -0,0 +1,63 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * How an operand is used. + */ +@VintfStability +@Backing(type="int") +enum OperandLifeTime { + /** + * The operand is internal to the model. It's created by an operation and consumed by other + * operations. It must be an output operand of exactly one operation. + */ + TEMPORARY_VARIABLE, + /** + * The operand is an input of a subgraph. It must not be an output operand of any operation. + * + * An operand can't be both input and output of a subgraph. + */ + SUBGRAPH_INPUT, + /** + * The operand is an output of a subgraph. It must be an output operand of exactly one + * operation. + * + * An operand can't be both input and output of a subgraph. + */ + SUBGRAPH_OUTPUT, + /** + * The operand is a constant found in Model.operandValues. It must not be an output operand of + * any operation. + */ + CONSTANT_COPY, + /** + * The operand is a constant that was specified via a Memory object. It must not be an output + * operand of any operation. + */ + CONSTANT_POOL, + /** + * The operand does not have a value. This is valid only for optional arguments of operations. + */ + NO_VALUE, + /** + * The operand is a reference to a subgraph. It must be an input to one or more + * {@link OperationType::IF} or {@link OperationType::WHILE} operations. + */ + SUBGRAPH, +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperandPerformance.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperandPerformance.aidl new file mode 100644 index 0000000000..9a8c2cca23 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperandPerformance.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.OperandType; +import android.hardware.neuralnetworks.PerformanceInfo; + +/** + * Driver performance when operating on a particular data type. In the case of float32 data, this is + * used when the calculations are not relaxed. + */ +@VintfStability +parcelable OperandPerformance { + OperandType type; + PerformanceInfo info; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperandType.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperandType.aidl new file mode 100644 index 0000000000..9274b6f97e --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperandType.aidl @@ -0,0 +1,154 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * Operand types. + * + * The type of an operand in a model. + * + * Types prefaced with TENSOR_* must be used for tensor data (i.e., tensors + * with at least one dimension). Types not prefaced by TENSOR_* represent + * scalar values and must have no dimensions. + */ +@VintfStability +@Backing(type="int") +enum OperandType { + /** + * A 32 bit floating point scalar value. + */ + FLOAT32 = 0, + /** + * A signed 32 bit integer scalar value. + */ + INT32 = 1, + /** + * An unsigned 32 bit integer scalar value. + */ + UINT32 = 2, + /** + * A tensor of 32 bit floating point values. + */ + TENSOR_FLOAT32 = 3, + /** + * A tensor of 32 bit integer values. + */ + TENSOR_INT32 = 4, + /** + * A tensor of 8 bit unsigned integers that represent real numbers. + * + * Attached to this tensor are two numbers that can be used to convert the 8 bit integer to the + * real value and vice versa. These two numbers are: + * - scale: a 32 bit floating point value greater than zero. + * - zeroPoint: a 32 bit integer, in range [0, 255]. + * + * The formula is: + * real_value = (integer_value - zeroPoint) * scale. + */ + TENSOR_QUANT8_ASYMM = 5, + /** + * An 8 bit boolean scalar value. + * + * Values of this operand type are either true or false. A zero value represents false; any + * other value represents true. + */ + BOOL = 6, + /** + * A tensor of 16 bit signed integers that represent real numbers. + * + * Attached to this tensor is a number representing real value scale that is used to convert the + * 16 bit number to a real value in the following way: + * realValue = integerValue * scale. + * + * scale is a 32 bit floating point with value greater than zero. + */ + TENSOR_QUANT16_SYMM = 7, + /** + * A tensor of IEEE 754 16 bit floating point values. + */ + TENSOR_FLOAT16 = 8, + /** + * A tensor of 8 bit boolean values. + * + * Values of this operand type are either true or false. A zero value represents false; any + * other value represents true. + */ + TENSOR_BOOL8 = 9, + /** + * An IEEE 754 16 bit floating point scalar value. + */ + FLOAT16 = 10, + /** + * A tensor of 8 bit signed integers that represent real numbers. + * + * This tensor is associated with additional fields that can be used to convert the 8 bit signed + * integer to the real value and vice versa. These fields are: + * - channelDim: a 32 bit unsigned integer indicating channel dimension. + * - scales: an array of positive 32 bit floating point values. + * The size of the scales array must be equal to dimensions[channelDim]. + * + * {@link SymmPerChannelQuantParams} must hold the parameters for an Operand of this type. + * The channel dimension of this tensor must not be unknown (dimensions[channelDim] != 0). + * + * The formula is: + * realValue[..., C, ...] = + * integerValue[..., C, ...] * scales[C] + * where C is an index in the Channel dimension. + */ + TENSOR_QUANT8_SYMM_PER_CHANNEL = 11, + /** + * A tensor of 16 bit unsigned integers that represent real numbers. + * + * Attached to this tensor are two numbers that can be used to convert the 16 bit integer to the + * real value and vice versa. These two numbers are: + * - scale: a 32 bit floating point value greater than zero. + * - zeroPoint: a 32 bit integer, in range [0, 65535]. + * + * The formula is: + * real_value = (integer_value - zeroPoint) * scale. + */ + TENSOR_QUANT16_ASYMM = 12, + /** + * A tensor of 8 bit signed integers that represent real numbers. + * + * Attached to this tensor is a number representing real value scale that is used to convert the + * 8 bit number to a real value in the following way: + * realValue = integerValue * scale. + * + * scale is a 32 bit floating point with value greater than zero. + */ + TENSOR_QUANT8_SYMM = 13, + /** + * A tensor of 8 bit signed integers that represent real numbers. + * + * Attached to this tensor are two numbers that can be used to convert the 8 bit integer to the + * real value and vice versa. These two numbers are: + * - scale: a 32 bit floating point value greater than zero. + * - zeroPoint: a 32 bit integer, in range [-128, 127]. + * + * The formula is: + * real_value = (integer_value - zeroPoint) * scale. + */ + TENSOR_QUANT8_ASYMM_SIGNED = 14, + /** + * A reference to a subgraph. + * + * Must have the lifetime {@link OperandLifeTime::SUBGRAPH}. + */ + SUBGRAPH = 15, +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/Operation.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/Operation.aidl new file mode 100644 index 0000000000..acfb4b779f --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/Operation.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.OperationType; + +/** + * Describes one operation of the model's graph. + */ +@VintfStability +parcelable Operation { + /** + * The operation type. + * + * Besides the values listed in {@link OperationType}, any value above + * {@link IDevice::OPERATION_TYPE_BASE_MAX} is possible and should be interpreted as an + * extension type according to {@link Model::extensionNameToPrefix}. + */ + OperationType type; + /** + * Describes the table that contains the indexes of the inputs of the operation. The offset is + * the index in the operandIndexes table. + */ + int[] inputs; + /** + * Describes the table that contains the indexes of the outputs of the operation. The offset is + * the index in the operandIndexes table. + */ + int[] outputs; +} + diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl new file mode 100644 index 0000000000..fd9da67bce --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl @@ -0,0 +1,5132 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * Operation types. + * + * The type of an operation in a model. + */ +@VintfStability +@Backing(type="int") +enum OperationType { + /** + * Adds two tensors, element-wise. + * + * Takes two input tensors of identical {@link OperandType} and compatible + * dimensions. The output is the sum of both input tensors, optionally + * modified by an activation function. + * + * Two dimensions are compatible when: + * 1. they are equal, or + * 2. one of them is 1 + * + * The size of the output is the maximum size along each dimension of the + * input operands. It starts with the trailing dimensions, and works its + * way forward. + * + * Example: + * + * input1.dimension = {4, 1, 2} + * input2.dimension = {5, 4, 3, 1} + * output.dimension = {5, 4, 3, 2} + * + * Since HAL version 1.2, generic zero-sized input tensor is supported. Zero + * dimension is only compatible with 0 or 1. The size of the output + * dimension is zero if either of corresponding input dimension is zero. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * * {@link OperandType::TENSOR_INT32} (since HAL version 1.3) + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: A tensor. + * * 1: A tensor of the same {@link OperandType}, and compatible dimensions + * as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scales and zeroPoint can be different from input0 scale and zeroPoint. + * * 2: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * For a {@link OperandType::TENSOR_INT32} tensor, + * the {@link FusedActivationFunc} must be "NONE". + * + * Outputs: + * * 0: The sum, a tensor of the same {@link OperandType} as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint can be different from inputs' scale and zeroPoint. + */ + ADD = 0, + /** + * Performs a 2-D average pooling operation. + * + * The output dimensions are functions of the filter dimensions, stride, and + * padding. + * + * The values in the output tensor are computed as: + * + * output[b, i, j, channel] = + * sum_{di, dj}( + * input[b, strides[1] * i + di, strides[2] * j + dj, channel] + * ) / sum(1) + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * NCHW is supported since HAL version 1.2. + * + * Both explicit padding and implicit padding are supported. + * + * Inputs (explicit padding): + * * 0: A 4-D tensor, of shape [batches, height, width, depth], specifying + * the input. + * Since HAL version 1.2, zero batches is supported for this tensor. + * * 1: An {@link OperandType::INT32} scalar, specifying the padding on + * the left, in the ‘width’ dimension. + * * 2: An {@link OperandType::INT32} scalar, specifying the padding on + * the right, in the ‘width’ dimension. + * * 3: An {@link OperandType::INT32} scalar, specifying the padding on + * the top, in the ‘height’ dimension. + * * 4: An {@link OperandType::INT32} scalar, specifying the padding on + * the bottom, in the ‘height’ dimension. + * * 5: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘width’ dimension. + * * 6: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘height’ dimension. + * * 7: An {@link OperandType::INT32} scalar, specifying the filter + * width. + * * 8: An {@link OperandType::INT32} scalar, specifying the filter + * height. + * * 9: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * * 10: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since HAL version 1.2. + * + * Inputs (implicit padding): + * * 0: A 4-D tensor, of shape [batches, height, width, depth], specifying + * the input. + * Since HAL version 1.2, zero batches is supported for this tensor. + * * 1: An {@link OperandType::INT32} scalar, specifying the implicit + * padding scheme, has to be one of the + * following values: {0 (NONE), 1 (SAME), 2 (VALID)}. + * * 2: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘width’ dimension. + * * 3: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘height’ dimension. + * * 4: An {@link OperandType::INT32} scalar, specifying the filter + * width. + * * 5: An {@link OperandType::INT32} scalar, specifying the filter + * height. + * * 6: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * * 7: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since HAL version 1.2. + * + * Outputs: + * * 0: The output 4-D tensor, of shape + * [batches, out_height, out_width, depth]. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + AVERAGE_POOL_2D = 1, + /** + * Concatenates the input tensors along the given dimension. + * + * The input tensors must have identical {@link OperandType} and the same + * dimensions except the dimension along the concatenation axis. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * (full support since HAL version 1.2, see the input section) + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0 ~ n-1: The list of n input tensors, of shape + * [D0, D1, ..., Daxis(i), ..., Dm]. + * Before HAL version 1.2, all input tensors of + * {@link OperandType::TENSOR_QUANT8_ASYMM} + * must have the same scale and zeroPoint as the output tensor. + * Input tensors of + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * are allowed to have different scale and zeroPoint. + * Since HAL version 1.2, zero-sized tensors are supported. + * * n: An {@link OperandType::INT32} scalar, specifying the + * concatenation axis. + * + * Outputs: + * * 0: The output, a tensor of the same {@link OperandType} as the input + * tensors. The output shape is [D0, D1, ..., sum(Daxis(i)), ..., Dm]. + * Since HAL version 1.2, for a {@link OperandType::TENSOR_QUANT8_ASYMM} tensor, + * the scale and zeroPoint values can be different from + * input tensors. Before HAL version 1.2 they have to be the same as for the input tensors. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint values can be different from input tensors. + */ + CONCATENATION = 2, + /** + * Performs a 2-D convolution operation. + * + * The CONV_2D op sweeps a 2-D filter that can mix channels together over a + * batch of images, applying the filter to each window of each image of the + * appropriate size. + * + * The output dimensions are functions of the filter dimensions, stride, and + * padding. + * + * The values in the output tensor are computed as: + * + * output[b, i, j, channel] = + * sum_{di, dj, k} ( + * input[b, strides[1] * i + di, strides[2] * j + dj, k] * + * filter[channel, di, dj, k] + * ) + bias[channel] + * + * Supported tensor {@link OperandType} configurations: + * * 32 bit floating point: + * * * {@link OperandType::TENSOR_FLOAT32} for input, filter, output, and bias. + * + * * Quantized: + * * * {@link OperandType::TENSOR_QUANT8_ASYMM} for input, filter, and output. + * * * {@link OperandType::TENSOR_INT32} for bias (with scale set to + * * * input.scale * filter.scale). + * + * Available since HAL version 1.2: + * * 16 bit floating point: + * * * {@link OperandType::TENSOR_FLOAT16} for input, filter, output, and bias. + * + * * Quantized with symmetric per channel quantization for the filter: + * * * {@link OperandType::TENSOR_QUANT8_ASYMM} for input, and output. + * * * {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} for filter. + * * * {@link OperandType::TENSOR_INT32} for bias (scale set to 0.0, + * * * each value scaling is separate and equal to input.scale * filter.scales[channel]). + * + * Available since HAL version 1.3: + * * Quantized signed (since HAL version 1.3): + * * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} for input, filter, and output. + * * * {@link OperandType::TENSOR_INT32} for bias (with scale set to + * * * input.scale * filter.scale). + * + * * Quantized signed with filter symmetric per channel quantization (since HAL version 1.3): + * * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} for input, and output. + * * * {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} for filter. + * * * {@link OperandType::TENSOR_INT32} for bias (scale set to 0.0, + * * * each value scaling is separate and equal to input.scale * filter.scales[channel]). + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * NCHW is supported since HAL version 1.2. + * + * Both explicit padding and implicit padding are supported. + * + * Inputs (explicit padding): + * * 0: A 4-D tensor, of shape [batches, height, width, depth_in], + * specifying the input. + * Since HAL version 1.2, zero batches is supported for this tensor. + * * 1: A 4-D tensor, of shape + * [depth_out, filter_height, filter_width, depth_in], specifying the + * filter. + * For tensor of type {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} + * the channel dimension (SymmPerChannelQuantParams::channelDim) + * must be set to 0. + * * 2: A 1-D tensor, of shape [depth_out], specifying the bias. For input + * tensor of type {@link OperandType::TENSOR_FLOAT32} + * or {@link OperandType::TENSOR_FLOAT16} the bias must be of the same type. + * For filter tensor of {@link OperandType::TENSOR_QUANT8_ASYMM} + * and {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * the bias should be of {@link OperandType::TENSOR_INT32}, with zeroPoint + * of 0 and bias_scale == input_scale * filter_scale. + * For filter tensor of {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL}, + * the bias should be of {@link OperandType::TENSOR_INT32}, with zeroPoint of 0 + * and bias_scale of 0. The actual scale of each value 'i' is equal to + * bias_scale[i] = input_scale * filter_scale[i]. + * * 3: An {@link OperandType::INT32} scalar, specifying the padding on + * the left, in the ‘width’ dimension. + * * 4: An {@link OperandType::INT32} scalar, specifying the padding on + * the right, in the ‘width’ dimension. + * * 5: An {@link OperandType::INT32} scalar, specifying the padding on + * the top, in the ‘height’ dimension. + * * 6: An {@link OperandType::INT32} scalar, specifying the padding on + * the bottom, in the ‘height’ dimension. + * * 7: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘width’ dimension. + * * 8: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘height’ dimension. + * * 9: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * * 10: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since HAL version 1.2. + * * 11: An optional {@link OperandType::INT32} scalar, specifying the dilation + * factor for width. Defaults to 1. If set to k > 1, there will be k-1 skipped + * cells between each filter element on width dimension. If this input is set, + * input 12 (dilation factor for height) must be specified as well. + * Available since HAL version 1.2. + * * 12: An optional {@link OperandType::INT32} scalar, specifying the dilation + * factor for height. Defaults to 1. If set to k > 1, there will be k-1 skipped + * cells between each filter element on height dimension. If this input is set, + * input 11 (dilation factor for width) must be specified as well. + * Available since HAL version 1.2. + * + * Inputs (implicit padding): + * * 0: A 4-D tensor, of shape [batches, height, width, depth_in], + * specifying the input. + * Since HAL version 1.2, zero batches is supported for this tensor. + * * 1: A 4-D tensor, of shape + * [depth_out, filter_height, filter_width, depth_in], specifying the + * filter. + * For tensor of type {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} + * the channel dimension (SymmPerChannelQuantParams::channelDim) + * must be set to 0. + * * 2: A 1-D tensor, of shape [depth_out], specifying the bias. For input + * tensor of type {@link OperandType::TENSOR_FLOAT32} + * or {@link OperandType::TENSOR_FLOAT16} the bias must be of the same + * type. + * For filter tensor of {@link OperandType::TENSOR_QUANT8_ASYMM} + * and {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * the bias should be of {@link OperandType::TENSOR_INT32}, with zeroPoint + * of 0 and bias_scale == input_scale * filter_scale. + * For filter tensor of {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL}, + * the bias should be of {@link OperandType::TENSOR_INT32}, with zeroPoint of 0 + * and bias_scale of 0. The actual scale of each value 'i' is equal to + * bias_scale[i] = input_scale * filter_scale[i]. + * * 3: An {@link OperandType::INT32} scalar, specifying the implicit + * padding scheme, has to be one of the + * following values: {0 (NONE), 1 (SAME), 2 (VALID)}. + * * 4: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘width’ dimension. + * * 5: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘height’ dimension. + * * 6: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * * 7: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since HAL version 1.2. + * * 8: An optional {@link OperandType::INT32} scalar, specifying the dilation + * factor for width. Defaults to 1. If set to k > 1, there will be k-1 skipped + * cells between each filter element on width dimension. If this input is set, + * input 9 (dilation factor for height) must be specified as well. + * Available since HAL version 1.2. + * * 9: An optional {@link OperandType::INT32} scalar, specifying the dilation + * factor for height. Defaults to 1. If set to k > 1, there will be k-1 skipped + * cells between each filter element on height dimension. If this input is set, + * input 8 (dilation factor for width) must be specified as well. + * Available since HAL version 1.2. + * + * Outputs: + * * 0: The output 4-D tensor, of shape + * [batches, out_height, out_width, depth_out]. + * Before HAL version 1.2, for output tensor of {@link OperandType::TENSOR_QUANT8_ASYMM}, + * the following condition must be satisfied: output_scale > input_scale * filter_scale + */ + CONV_2D = 3, + /** + * Performs a depthwise 2-D convolution operation. + * + * Given an input tensor of shape [batches, height, width, depth_in] and a + * filter tensor of shape [1, filter_height, filter_width, depth_out] + * containing depth_out convolutional filters of depth 1, DEPTHWISE_CONV + * applies a different filter to each input channel (expanding from 1 + * channel to channel_multiplier channels for each), then concatenates the + * results together. + * + * The output has depth_out = depth_in * depth_multiplier channels. + * The output dimensions are functions of the filter dimensions, stride, and + * padding. + * + * The values in the output tensor are computed as: + * + * output[b, i, j, k * channel_multiplier + q] = + * sum_{di, dj} ( + * input[b, strides[1] * i + di, strides[2] * j + dj, k] * + * filter[1, di, dj, k * channel_multiplier + q] + * ) + bias[k * channel_multiplier + q] + * + * Supported tensor {@link OperandType} configurations: + * * 32 bit floating point: + * * * {@link OperandType::TENSOR_FLOAT32} for input, filter, output, and bias. + * + * * Quantized: + * * * {@link OperandType::TENSOR_QUANT8_ASYMM} for input, filter, and output. + * * * {@link OperandType::TENSOR_INT32} for bias (with scale set to + * * * input.scale * filter.scale). + * + * Available since HAL version 1.2: + * * 16 bit floating point: + * * * {@link OperandType::TENSOR_FLOAT16} for input, filter, output, and bias. + * + * * Quantized with symmetric per channel quantization for the filter: + * * * {@link OperandType::TENSOR_QUANT8_ASYMM} for input, and output. + * * * {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} for filter. + * * * {@link OperandType::TENSOR_INT32} for bias (scale set to 0.0, + * * * each value scaling is separate and equal to input.scale * filter.scales[channel]). + * + * Available since HAL version 1.3: + * * Quantized signed (since HAL version 1.3): + * * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} for input, filter, and output. + * * * {@link OperandType::TENSOR_INT32} for bias (with scale set to + * * * input.scale * filter.scale). + * + * * Quantized signed with filter symmetric per channel quantization (since HAL version 1.3): + * * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} for input, and output. + * * * {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} for filter. + * * * {@link OperandType::TENSOR_INT32} for bias (scale set to 0.0, + * * * each value scaling is separate and equal to input.scale * filter.scales[channel]). + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * NCHW is supported since HAL version 1.2. + * + * Both explicit padding and implicit padding are supported. + * + * Inputs (explicit padding): + * * 0: A 4-D tensor, of shape [batches, height, width, depth_in], + * specifying the input. + * * 1: A 4-D tensor, of shape [1, filter_height, filter_width, depth_out], + * specifying the filter. + * For tensor of type {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} + * the channel dimension (SymmPerChannelQuantParams::channelDim) + * must be set to 3. + * * 2: A 1-D tensor, of shape [depth_out], specifying the bias. For input + * tensor of type {@link OperandType::TENSOR_FLOAT32} + * or {@link OperandType::TENSOR_FLOAT16} the bias must be of the same type. + * For filter tensor of {@link OperandType::TENSOR_QUANT8_ASYMM} + * and {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * the bias should be of {@link OperandType::TENSOR_INT32}, with zeroPoint + * of 0 and bias_scale == input_scale * filter_scale. + * For filter tensor of {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL}, + * the bias should be of {@link OperandType::TENSOR_INT32}, with zeroPoint of 0 + * and bias_scale of 0. The actual scale of each value 'i' is equal to + * bias_scale[i] = input_scale * filter_scale[i]. + * * 3: An {@link OperandType::INT32} scalar, specifying the padding on + * the left, in the ‘width’ dimension. + * * 4: An {@link OperandType::INT32} scalar, specifying the padding on + * the right, in the ‘width’ dimension. + * * 5: An {@link OperandType::INT32} scalar, specifying the padding on + * the top, in the ‘height’ dimension. + * * 6: An {@link OperandType::INT32} scalar, specifying the padding on + * the bottom, in the ‘height’ dimension. + * * 7: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘width’ dimension. + * * 8: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘height’ dimension. + * * 9: An {@link OperandType::INT32} scalar, specifying the depthwise + * multiplier. + * * 10: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * * 11: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since HAL version 1.2. + * * 12: An optional {@link OperandType::INT32} scalar, specifying the dilation + * factor for width. Defaults to 1. If set to k > 1, there will be k-1 skipped + * cells between each filter element on width dimension. If this input is set, + * input 13 (dilation factor for height) must be specified as well. + * Available since HAL version 1.2. + * * 13: An optional {@link OperandType::INT32} scalar, specifying the dilation + * factor for height. Defaults to 1. If set to k > 1, there will be k-1 skipped + * cells between each filter element on height dimension. If this input is set, + * input 12 (dilation factor for width) must be specified as well. + * Available since HAL version 1.2. + * + * Inputs (implicit padding): + * * 0: A 4-D tensor, of shape [batches, height, width, depth_in], + * specifying the input. + * * 1: A 4-D tensor, of shape [1, filter_height, filter_width, depth_out], + * specifying the filter. + * * 2: A 1-D tensor, of shape [depth_out], specifying the bias. For input + * tensor of type {@link OperandType::TENSOR_FLOAT32} + * or {@link OperandType::TENSOR_FLOAT16} the bias must be of the same type. + * For filter tensor of {@link OperandType::TENSOR_QUANT8_ASYMM} + * and {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * the bias should be of {@link OperandType::TENSOR_INT32}, with zeroPoint + * of 0 and bias_scale == input_scale * filter_scale. + * For filter tensor of {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL}, + * the bias should be of {@link OperandType::TENSOR_INT32}, with zeroPoint of 0 + * and bias_scale of 0. The actual scale of each value 'i' is equal to + * bias_scale[i] = input_scale * filter_scale[i]. + * * 3: An {@link OperandType::INT32} scalar, specifying the implicit + * padding scheme, has to be one of the + * following values: {0 (NONE), 1 (SAME), 2 (VALID)}. + * * 4: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘width’ dimension. + * * 5: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘height’ dimension. + * * 6: An {@link OperandType::INT32} scalar, specifying the depthwise + * multiplier. + * * 7: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * * 8: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since HAL version 1.2. + * * 9: An optional {@link OperandType::INT32} scalar, specifying the dilation + * factor for width. Defaults to 1. If set to k > 1, there will be k-1 skipped + * cells between each filter element on width dimension. If this input is set, + * input 10 (dilation factor for height) must be specified as well. + * Available since HAL version 1.2. + * * 10: An optional {@link OperandType::INT32} scalar, specifying the dilation + * factor for height. Defaults to 1. If set to k > 1, there will be k-1 skipped + * cells between each filter element on height dimension. If this input is set, + * input 9 (dilation factor for width) must be specified as well. + * Available since HAL version 1.2. + * + * Outputs: + * * 0: The output 4-D tensor, of shape + * [batches, out_height, out_width, depth_out]. Before HAL version 1.2, for + * output tensor of {@link OperandType::TENSOR_QUANT8_ASYMM}, + * the following condition must be satisfied: + * output_scale > input_scale * filter_scale + */ + DEPTHWISE_CONV_2D = 4, + /** + * Rearranges data from depth into blocks of spatial data. + * + * More specifically, this op outputs a copy of the input tensor where + * values from the depth dimension are moved in spatial blocks to the height + * and width dimensions. The value block_size indicates the input block size + * and how the data is moved. + * + * Chunks of data of size block_size * block_size from depth are rearranged + * into non-overlapping blocks of size block_size x block_size. + * + * The width of the output tensor is input_depth * block_size, whereas the + * height is input_height * block_size. The depth of the input tensor must + * be divisible by block_size * block_size + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * NCHW is supported since HAL version 1.2. + * + * Inputs: + * * 0: A 4-D tensor, of shape [batches, height, width, depth_in], + * specifying the input. + * * 1: An {@link OperandType::INT32} scalar, specifying the block_size. + * block_size must be >=1 and block_size * block_size must be a divisor + * of the input depth. + * * 2: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since HAL version 1.2. + * + * Outputs: + * * 0: The output 4-D tensor, of shape [batch, height*block_size, + * width*block_size, depth/(block_size*block_size)]. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + DEPTH_TO_SPACE = 5, + /** + * Dequantizes the input tensor. + * + * The formula is: + * + * output = (input - zeroPoint) * scale. + * + * Supported input tensor {@link OperandType}: + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_SYMM} (since HAL version 1.2) + * * {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} (since HAL version 1.2) + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported output tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32}. + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: A tensor. + * Since HAL version 1.2, this tensor may be zero-sized. + * + * Outputs: + * * 0: A tensor with the same shape as input0. + */ + DEQUANTIZE = 6, + /** + * Looks up sub-tensors in the input tensor. + * + * This operator takes for input a tensor of values (Values) and + * a one-dimensional tensor of selection indices (Lookups). + * The output tensor is the concatenation of sub-tensors of Values as + * selected by Lookups. + * + * Think of Values as being sliced along its first dimension: + * The entries in Lookups select which slices are concatenated together + * to create the output tensor. + * + * For example, if Values has shape of [40, 200, 300] and + * Lookups has shape of [3], all three values found in Lookups are + * expected to be between 0 and 39. The resulting tensor must + * have shape of [3, 200, 300]. + * + * If a value in Lookups is out of bounds, the operation must fail + * and an error must be reported. + * + * Supported value tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.3) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} (since HAL version 1.2) + * * {@link OperandType::TENSOR_QUANT8_ASYMM} (since HAL version 1.2) + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported value tensor rank: from 2 + * + * Inputs: + * * 0: Lookups. A 1-D tensor of {@link OperandType::TENSOR_INT32}. + * The values are indices into the first dimension of Values. + * * 1: Values. An n-D tensor, where n >= 2, from which sub-tensors are + * extracted. + * + * Output: + * * 0: A n-D tensor with the same rank and shape as the Values + * tensor, except for the first dimension which has the same size + * as Lookups' only dimension. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input1. + */ + EMBEDDING_LOOKUP = 7, + /** + * Computes element-wise floor() on the input tensor. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: A tensor. + * + * Outputs: + * * 0: The output tensor, of the same {@link OperandType} and dimensions as + * the input tensor. + */ + FLOOR = 8, + /** + * Denotes a fully (densely) connected layer, which connects all elements + * in the input tensor with each element in the output tensor. + * + * This layer implements the operation: + * + * outputs = activation(inputs * weights’ + bias) + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4. + * + * Inputs: + * * 0: A tensor of at least rank 2, specifying the input. If rank is + * greater than 2, then it gets flattened to a 2-D Tensor. The + * (flattened) 2-D Tensor is reshaped (if necessary) to + * [batch_size, input_size], where "input_size" corresponds to the + * number of inputs to the layer, matching the second dimension of + * weights, and "batch_size" is calculated by dividing the number of + * elements by "input_size". + * Since HAL version 1.2, zero batch_size is supported for this tensor. + * * 1: A 2-D tensor, specifying the weights, of shape + * [num_units, input_size], where "num_units" corresponds to the number + * of output nodes. + * * 2: A 1-D tensor, of shape [num_units], specifying the bias. For input + * tensor of {@link OperandType::TENSOR_FLOAT32}, the bias should + * also be of {@link OperandType::TENSOR_FLOAT32}. + * For input tensor of {@link OperandType::TENSOR_QUANT8_ASYMM} + * and {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * the bias should be of {@link OperandType::TENSOR_INT32}, + * with zeroPoint of 0 and bias_scale == input_scale * filter_scale. + * * 3: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * + * Outputs: + * * 0: The output tensor, of shape [batch_size, num_units]. Before HAL version 1.2, for + * output tensor of {@link OperandType::TENSOR_QUANT8_ASYMM}, the following + * condition must be satisfied: output_scale > input_scale * filter_scale. + */ + FULLY_CONNECTED = 9, + /** + * Looks up sub-tensors in the input tensor using a key-value map. + * + * This operator takes for input a tensor of values (Values), + * a one-dimensional tensor of selection values (Lookups) and + * a one-dimensional tensor that maps these values to Values + * indexes. The output tensor is the concatenation of sub-tensors of + * Values as selected by Lookups via Keys. + * + * Think of Values as being sliced along its outer-most dimension. + * The output is a concatenation of selected slices, with one slice + * for each entry of Lookups. The slice selected is the one at the + * same index as the Maps entry that matches the value in Lookups. + * + * For a hit, the corresponding sub-tensor of Values is included + * in the Output tensor. For a miss, the corresponding sub-tensor in + * Output must have zero values. + * + * For example, if Values has shape of [40, 200, 300], + * Keys should have a shape of [40]. If Lookups tensor has shape + * of [3], three slices are being concatenated, so the resulting tensor + * must have the shape of [3, 200, 300]. If the first entry in Lookups + * has the value 123456, that value must be located in Keys tensor. + * If the sixth entry of Keys contains 123456, the sixth slice of Values + * must be selected. If no entry in Keys has 123456, a slice of zeroes + * must be concatenated. + * + * Supported value tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * + * Supported value tensor rank: from 2 + * + * Inputs: + * * 0: Lookups. A 1-D {@link OperandType::TENSOR_INT32} tensor with + * shape [ k ]. + * * 1: Keys. A 1-D {@link OperandType::TENSOR_INT32} tensor with shape + * [ n ]; Keys and Values pair represent a map, i.e., the ith element + * in Keys (Keys[i]) is the key to select the ith sub-tensor in Values + * (Values[i]), where 0 <= i <= n-1. Keys tensor *MUST* be sorted in + * ascending order. + * * 2: Values. A tensor with shape of [ n, … ]; i.e., the first dimension + * must be n. + * + * Outputs: + * * 0: Output. A tensor with shape [ k …]. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} tensor, + * the scale and zeroPoint must be the same as input2. + * * 1: Hits. A boolean tensor with shape [ k ] indicates whether the lookup + * hits (True) or not (False). + * Stored as {@link OperandType::TENSOR_QUANT8_ASYMM} with offset 0 + * and scale 1.0f. + * A non-zero byte represents True, a hit. A zero indicates otherwise. + */ + HASHTABLE_LOOKUP = 10, + /** + * Applies L2 normalization along the axis dimension. + * + * The values in the output tensor are computed as: + * + * output[batch, row, col, channel] = + * input[batch, row, col, channel] / + * sqrt(sum_{c} pow(input[batch, row, col, c], 2)) + * + * By default the axis dimension is the last dimension of the input tensor. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} (since HAL version 1.2) + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4 + * Tensors with rank less than 4 are only supported since HAL version 1.2. + * + * Inputs: + * * 0: An n-D tensor, specifying the tensor to be normalized. + * * 1: An optional {@link OperandType::INT32} scalar, default to -1, + * specifying the dimension normalization would be performed on. + * Negative index is used to specify axis from the end (e.g. -1 for + * the last axis). Must be in the range [-n, n). + * Available since HAL version 1.2. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} and same shape as input0. + * For {@link OperandType::TENSOR_QUANT8_ASYMM}, + * the scale must be 1.f / 128 and the zeroPoint must be 128. + * For {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * the scale must be 1.f / 128 and the zeroPoint must be 0. + * + * NOTE: Before HAL version 1.3, if the elements along an axis are all zeros, + * the result is undefined. Since HAL version 1.3, if the elements along an axis + * are all zeros, the result is logical zero. + */ + L2_NORMALIZATION = 11, + /** + * Performs an 2-D L2 pooling operation. + * + * The output dimensions are functions of the filter dimensions, stride, and + * padding. + * + * The values in the output tensor are computed as: + * + * output[b, i, j, c] = + * sqrt(sum_{di, dj} pow(input[b, strides[1] * i + di, strides[2] * j + dj, c], 2) / + * sum(1)) + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * NCHW is supported since HAL version 1.2. + * + * Both explicit padding and implicit padding are supported. + * + * Inputs (explicit padding): + * * 0: A 4-D tensor, of shape [batches, height, width, depth], specifying + * the input. + * Since HAL version 1.2, zero batches is supported for this tensor. + * * 1: An {@link OperandType::INT32} scalar, specifying the padding on + * the left, in the ‘width’ dimension. + * * 2: An {@link OperandType::INT32} scalar, specifying the padding on + * the right, in the ‘width’ dimension. + * * 3: An {@link OperandType::INT32} scalar, specifying the padding on + * the top, in the ‘height’ dimension. + * * 4: An {@link OperandType::INT32} scalar, specifying the padding on + * the bottom, in the ‘height’ dimension. + * * 5: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘width’ dimension. + * * 6: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘height’ dimension. + * * 7: An {@link OperandType::INT32} scalar, specifying the filter + * width. + * * 8: An {@link OperandType::INT32} scalar, specifying the filter + * height. + * * 9: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * * 10: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since HAL version 1.2. + * + * Inputs (implicit padding): + * * 0: A 4-D tensor, of shape [batches, height, width, depth], specifying + * the input. + * Since HAL version 1.2, zero batches is supported for this tensor. + * * 1: An {@link OperandType::INT32} scalar, specifying the implicit + * padding scheme, has to be one of the + * following values: {0 (NONE), 1 (SAME), 2 (VALID)}. + * * 2: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘width’ dimension. + * * 3: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘height’ dimension. + * * 4: An {@link OperandType::INT32} scalar, specifying the filter + * width. + * * 5: An {@link OperandType::INT32} scalar, specifying the filter + * height. + * * 6: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * * 7: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since HAL version 1.2. + * + * Outputs: + * * 0: The output 4-D tensor, of shape + * [batches, out_height, out_width, depth]. + */ + L2_POOL_2D = 12, + /** + * Applies Local Response Normalization along the depth dimension. + * + * The 4-D input tensor is treated as a 3-D array of 1-D vectors (along the + * last dimension), and each vector is normalized independently. Within a + * given vector, each component is divided by the weighted, squared sum of + * inputs within depth_radius. + * + * The output is calculated using this formula: + * + * sqr_sum[a, b, c, d] = sum( + * pow(input[a, b, c, d - depth_radius : d + depth_radius + 1], 2)) + * output = input / pow((bias + alpha * sqr_sum), beta) + * + * For input tensor with rank less than 4, independently normalizes each + * 1-D slice along specified dimension. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: up to 4 + * Tensors with rank less than 4 are only supported since HAL version 1.2. + * + * Inputs: + * * 0: A 4-D tensor, of shape [batches, height, width, depth], specifying + * the input. + * * 1: An {@link OperandType::INT32} scalar, specifying the radius of + * the normalization window. + * * 2: A scalar, specifying the bias, must not be zero. + * For input tensor of {@link OperandType::TENSOR_FLOAT16}, the bias + * value must be of {@link OperandType::FLOAT16}. + * For input tensor of {@link OperandType::TENSOR_FLOAT32}, the bias + * value must be of {@link OperandType::FLOAT32}. + * * 3: A scalar, specifying the scale factor, alpha. + * For input tensor of {@link OperandType::TENSOR_FLOAT16}, the + * alpha value must be of {@link OperandType::FLOAT16}. + * For input tensor of {@link OperandType::TENSOR_FLOAT32}, the + * alpha value must be of {@link OperandType::FLOAT32}. + * * 4: A scalar, specifying the exponent, beta. + * For input tensor of {@link OperandType::TENSOR_FLOAT16}, the beta + * value must be of {@link OperandType::FLOAT16}. + * For input tensor of {@link OperandType::TENSOR_FLOAT32}, the beta + * value must be of {@link OperandType::FLOAT32}. + * * 5: An optional {@link OperandType::INT32} scalar, default to -1, + * specifying the dimension normalization would be performed on. + * Negative index is used to specify axis from the end (e.g. -1 for + * the last axis). Must be in the range [-n, n). + * Available since HAL version 1.2. + * + * Outputs: + * * 0: The output tensor of same shape as input0. + */ + LOCAL_RESPONSE_NORMALIZATION = 13, + /** + * Computes sigmoid activation on the input tensor element-wise. + * + * The output is calculated using this formula: + * + * output = 1 / (1 + exp(-input)) + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4. + * + * Inputs: + * * 0: A tensor, specifying the input. + * Since HAL version 1.2, this tensor may be zero-sized. + * + * Outputs: + * * 0: The output tensor of same shape as input0. + * For {@link OperandType::TENSOR_QUANT8_ASYMM}, + * the scale must be 1.f / 256 and the zeroPoint must be 0. + * For {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * the scale must be 1.f / 256 and the zeroPoint must be -128. + */ + LOGISTIC = 14, + /** + * Projects an input to a bit vector via locality senstive hashing. + * + * Supported input tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * + * Supported input tensor rank: from 1 + * + * Inputs: + * * 0: Hash functions. Dim.size == 2, DataType: Float. + * Tensor[0].Dim[0]: 15 of hash functions. + * Tensor[0].Dim[1]: 16 of projected output bits generated by each + * hash function. + * If the projection type is Sparse: + * Tensor[0].Dim[1] + ceil(log2(Tensor[0].Dim[0])) <= 32 + * + * * 1: Input. Dim.size >= 1, no restriction on DataType. + * * 2: Weight. Optional. Dim.size == 1, DataType: Float. + * If not set, each input element is considered to have the same weight + * of 1.0. + * Tensor[1].Dim[0] == Tensor[2].Dim[0] + * * 3: Type: + * Sparse: + * Value LSHProjectionType_SPARSE(=3) (since HAL version 1.2). + * Computed bit vector is considered to be sparse. + * Each output element is an int32 made up of multiple bits + * computed from hash functions. + * + * NOTE: To avoid collisions across hash functions, an offset value + * of k * (1 << Tensor[0].Dim[1]) will be added to each signature, + * where k is the index of the hash function. + * + * Value LSHProjectionType_SPARSE_DEPRECATED(=1). + * Legacy behavior that does not include the offset value. + * + * Dense: + * Value LSHProjectionType_DENSE(=2). + * Computed bit vector is considered to be dense. Each output + * element represents a bit and can take the value of either + * 0 or 1. + * + * Outputs: + * * 0: If the projection type is Sparse: + * Output.Dim == { Tensor[0].Dim[0] } + * A tensor of int32 that represents hash signatures. + * + * If the projection type is Dense: + * Output.Dim == { Tensor[0].Dim[0] * Tensor[0].Dim[1] } + * A flattened tensor that represents projected bit vectors. + * The offset value for sparse projections was added in HAL version 1.2. + */ + LSH_PROJECTION = 15, + /** + * Performs a single time step in a Long Short-Term Memory (LSTM) layer + * + * The LSTM operation is described by the following equations. + * + * \f{eqnarray*}{ + * i_t =& \sigma(W_{xi}x_t+W_{hi}h_{t-1}+W_{ci}C_{t-1}+b_i) & \\ + * f_t =& \sigma(W_{xf}x_t+W_{hf}h_{t-1}+W_{cf}C_{t-1}+b_f) & \\ + * C_t =& clip(f_t \odot C_{t-1} + i_t \odot + * g(W_{xc}x_t+W_{hc}h_{t-1}+b_c),\ t_{cell}) & \\ + * o_t =& \sigma(W_{xo}x_t+W_{ho}h_{t-1}+W_{co}C_t+b_o) & \\ + * & & \\ + * & clip(W_{proj}(o_t \odot g(C_t))+b_{proj},\ t_{proj}) + * & if\ there\ is\ a\ projection; \\ + * h_t =& & \\ + * & o_t \odot g(C_t) & otherwise. \\ + * \f} + * Where: + * * \f$x_t\f$ is the input, + * * \f$i_t\f$ is the input gate, + * * \f$f_t\f$ is the forget gate, + * * \f$C_t\f$ is the cell state, + * * \f$o_t\f$ is the output, + * * \f$h_t\f$ is the output state, + * * \f$\sigma\f$ is the logistic sigmoid function, + * * \f$g\f$ is the cell input and cell output activation function, usually + * \f$tahn\f$, + * * \f$W_{xi}\f$ is the input-to-input weight matrix, + * * \f$W_{hi}\f$ is the recurrent to input weight matrix, + * * \f$W_{ci}\f$ is the cell-to-input weight matrix, + * * \f$b_i\f$ is the input gate bias, + * * \f$W_{xf}\f$ is the input-to-forget weight matrix, + * * \f$W_{hf}\f$ is the recurrent-to-forget weight matrix, + * * \f$W_{cf}\f$ is the cell-to-forget weight matrix, + * * \f$b_f\f$ is the forget gate bias, + * * \f$W_{xc}\f$ is the input-to-cell weight matrix, + * * \f$W_{hc}\f$ is the recurrent-to-cell weight matrix, + * * \f$b_c\f$ is the cell bias, + * * \f$W_{xo}\f$ is the input-to-output weight matrix, + * * \f$W_{ho}\f$ is the recurrent-to-output weight matrix, + * * \f$W_{co}\f$ is the cell-to-output weight matrix, + * * \f$b_o\f$ is the output gate bias, + * * \f$W_{proj}\f$ is the projection weight matrix, + * * \f$b_{proj}\f$ is the projection bias, + * * \f$t_{cell}\f$ is the threshold for clipping the cell state, and + * * \f$t_{proj}\f$ is the threshold for clipping the projected output. + * * \f$\odot\f$ is the + * + * Hadamard product that takes two matrices and produces another + * matrix, each element of which is the product of the corresponding + * elements of the input matrices. + * + * Since HAL version 1.2 LSTM supports layer normalization. + * In case layer normalization is used, the inputs to internal activation + * functions (sigmoid and \f$g\f$) are normalized, rescaled and recentered + * following an approach from section 3.1 from + * https://arxiv.org/pdf/1607.06450.pdf + * + * The operation has the following independently optional inputs: + * * The cell-to-input weights (\f$W_{ci}\f$), cell-to-forget weights + * (\f$W_{cf}\f$) and cell-to-output weights (\f$W_{co}\f$) either all + * have values or neither of them have values (i.e., all set to null). If + * they have values, the peephole optimization is used. + * * The input-to-input weights (\f$W_{xi}\f$), recurrent-to-input weights + * (\f$W_{hi}\f$) and input gate bias (\f$b_i\f$) either all have values, + * or none of them have values. If they have no values, coupling of input + * and forget gates (CIFG) is used, in which case the input gate + * (\f$i_t\f$) is calculated using the following equation instead. + * \f{eqnarray*}{ + * i_t = 1 - f_t + * \f} + * In case peephole optimization is used and CIFG is not used + * cell-to-input (\f$W_{ci}\f$) weights must be present. Otherwise, the + * cell-to-input weights must have no value. + * * The projection weights (\f$W_{proj}\f$) is required only for the + * recurrent projection layer, and should otherwise have no value. + * * The projection bias (\f$b_{proj}\f$) may (but not required to) have a + * value if the recurrent projection layer exists, and should otherwise + * have no value. + * * (HAL version 1.2 or later) The four layer normalization weights either all have + * values or none of them have values. Additionally, if CIFG is used, + * input layer normalization weights tensor is omitted and the other layer + * normalization weights either all have values or none of them have + * values. Layer normalization is used when the values of all the layer + * normalization weights are present. + * + * References: + * + * The default non-peephole non-CIFG implementation is based on: + * http://www.bioinf.jku.at/publications/older/2604.pdf + * S. Hochreiter and J. Schmidhuber. "Long Short-Term Memory". Neural + * Computation, 9(8):1735-1780, 1997. + * + * The peephole implementation and projection layer is based on: + * https://research.google.com/pubs/archive/43905.pdf + * Hasim Sak, Andrew Senior, and Francoise Beaufays. "Long short-term memory + * recurrent neural network architectures for large scale acoustic + * modeling." INTERSPEECH, 2014. + * (However, the concept of peephole optimization was introduced in work + * prior to this paper.) + * + * The coupling of input and forget gate (CIFG) is based on: + * http://arxiv.org/pdf/1503.04069.pdf + * Greff et al. "LSTM: A Search Space Odyssey" + * + * The layer normalization is based on: + * https://arxiv.org/pdf/1607.06450.pdf + * Jimmy Ba et al. "Layer Normalization" + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * + * All input and output tensors must be of the same type. + * + * Inputs: + * * 0: The input (\f$x_t\f$). + * A 2-D tensor of shape [batch_size, input_size], where “batch_size” + * corresponds to the batching dimension, and “input_size” is the size + * of the input. + * * 1: The input-to-input weights (\f$W_{xi}\f$). Optional. + * A 2-D tensor of shape [num_units, input_size], where “num_units” + * corresponds to the number of cell units. + * * 2: The input-to-forget weights (\f$W_{xf}\f$). + * A 2-D tensor of shape [num_units, input_size]. + * * 3: The input-to-cell weights (\f$W_{xc}\f$). + * A 2-D tensor of shape [num_units, input_size]. + * * 4: The input-to-output weights (\f$W_{xo}\f$). + * A 2-D tensor of shape [num_units, input_size]. + * * 5: The recurrent-to-input weights (\f$W_{hi}\f$). Optional. + * A 2-D tensor of shape [num_units, output_size], where “output_size” + * corresponds to either the number of cell units (i.e., “num_units”), + * or the second dimension of the “projection_weights”, if defined. + * * 6: The recurrent-to-forget weights (\f$W_{hf}\f$). + * A 2-D tensor of shape [num_units, output_size]. + * * 7: The recurrent-to-cell weights (\f$W_{hc}\f$). + * A 2-D tensor of shape [num_units, output_size]. + * * 8: The recurrent-to-output weights (\f$W_{ho}\f$). + * A 2-D tensor of shape [num_units, output_size]. + * * 9: The cell-to-input weights (\f$W_{ci}\f$). Optional. + * A 1-D tensor of shape [num_units]. + * * 10:The cell-to-forget weights (\f$W_{cf}\f$). Optional. + * A 1-D tensor of shape [num_units]. + * * 11:The cell-to-output weights (\f$W_{co}\f$). Optional. + * A 1-D tensor of shape [num_units]. + * * 12:The input gate bias (\f$b_i\f$). Optional. + * A 1-D tensor of shape [num_units]. + * * 13:The forget gate bias (\f$b_f\f$). + * A 1-D tensor of shape [num_units]. + * * 14:The cell bias (\f$b_c\f$). + * A 1-D tensor of shape [num_units]. + * * 15:The output gate bias (\f$b_o\f$). + * A 1-D tensor of shape [num_units]. + * * 16:The projection weights (\f$W_{proj}\f$). Optional. + * A 2-D tensor of shape [output_size, num_units]. + * * 17:The projection bias (\f$b_{proj}\f$). Optional. + * A 1-D tensor of shape [output_size]. + * * 18:The output state (in) (\f$h_{t-1}\f$). + * A 2-D tensor of shape [batch_size, output_size]. + * * 19:The cell state (in) (\f$C_{t-1}\f$). + * A 2-D tensor of shape [batch_size, num_units]. + * * 20:The activation function (\f$g\f$). + * A value indicating the activation function: + *
    + *
  • 0: None; + *
  • 1: Relu; + *
  • 3: Relu6; + *
  • 4: Tanh; + *
  • 6: Sigmoid. + *
+ * * 21:The clipping threshold (\f$t_{cell}\f$) for the cell state, such + * that values are bound within [-cell_clip, cell_clip]. If set to 0.0 + * then clipping is disabled. + * Until HAL version 1.2 this scalar must be of type {@link + * OperandType::FLOAT32}. Since HAL version 1.2, if all the input + * tensors have type {@link OperandType::TENSOR_FLOAT32}, this + * scalar must be of the type {@link OperandType::FLOAT32}, + * otherwise if all the input tensors have the type {@link + * OperandType::TENSOR_FLOAT16}, this scalar must be of type {@link + * OperandType::FLOAT16}. + * * 22:The clipping threshold (\f$t_{proj}\f$) for the output from the + * projection layer, such that values are bound within + * [-proj_clip, proj_clip]. If set to 0.0 then clipping is disabled. + * Until HAL version 1.2 this scalar must be of type {@link + * OperandType::FLOAT32}. Since HAL version 1.2, if all the input + * tensors have type {@link OperandType::TENSOR_FLOAT32}, this + * scalar must be of the type {@link OperandType::FLOAT32}, + * otherwise if all the input tensors have the type {@link + * OperandType::TENSOR_FLOAT16}, this scalar must be of type {@link + * OperandType::FLOAT16}. + * Since HAL version 1.2 there are additional inputs to this op: + * * 23:The input layer normalization weights. + * A 1-D tensor of shape [num_units]. Used to rescale normalized inputs + * to activation at input gate. + * * 24:The forget layer normalization weights. + * A 1-D tensor of shape [num_units]. Used to rescale normalized inputs + * to activation at forget gate. + * * 25:The cell layer normalization weights. + * A 1-D tensor of shape [num_units]. Used to rescale normalized inputs + * to activation at cell gate. + * * 26:The output layer normalization weights. + * A 1-D tensor of shape [num_units]. Used to rescale normalized inputs + * to activation at output gate. + * + * Outputs: + * * 0: The scratch buffer. + * A 2-D tensor of shape [batch_size, num_units * 3] with CIFG, or + * [batch_size, num_units * 4] without CIFG. + * * 1: The output state (out) (\f$h_t\f$). + * A 2-D tensor of shape [batch_size, output_size]. + * * 2: The cell state (out) (\f$C_t\f$). + * A 2-D tensor of shape [batch_size, num_units]. + * * 3: The output (\f$o_t\f$). + * A 2-D tensor of shape [batch_size, output_size]. This is effectively + * the same as the current “output state (out)” value. + */ + LSTM = 16, + /** + * Performs an 2-D max pooling operation. + * + * The output dimensions are functions of the filter dimensions, stride, and + * padding. + * + * The values in the output tensor are computed as: + * + * output[b, i, j, channel] = + * max_{di, dj} ( + * input[b, strides[1] * i + di, strides[2] * j + dj, channel] + * ) + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * NCHW is supported since HAL version 1.2. + * + * Both explicit padding and implicit padding are supported. + * + * Inputs (explicit padding): + * * 0: A 4-D tensor, of shape [batches, height, width, depth], specifying + * the input. + * Since HAL version 1.2, zero batches is supported for this tensor. + * * 1: An {@link OperandType::INT32} scalar, specifying the padding on + * the left, in the ‘width’ dimension. + * * 2: An {@link OperandType::INT32} scalar, specifying the padding on + * the right, in the ‘width’ dimension. + * * 3: An {@link OperandType::INT32} scalar, specifying the padding on + * the top, in the ‘height’ dimension. + * * 4: An {@link OperandType::INT32} scalar, specifying the padding on + * the bottom, in the ‘height’ dimension. + * * 5: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘width’ dimension. + * * 6: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘height’ dimension. + * * 7: An {@link OperandType::INT32} scalar, specifying the filter + * width. + * * 8: An {@link OperandType::INT32} scalar, specifying the filter + * height. + * * 9: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * * 10: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since HAL version 1.2. + * + * Inputs (implicit padding): + * * 0: A 4-D tensor, of shape [batches, height, width, depth], specifying + * the input. + * Since HAL version 1.2, zero batches is supported for this tensor. + * * 1: An {@link OperandType::INT32} scalar, specifying the implicit + * padding scheme, has to be one of the + * following values: {0 (NONE), 1 (SAME), 2 (VALID)}. + * * 2: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘width’ dimension. + * * 3: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘height’ dimension. + * * 4: An {@link OperandType::INT32} scalar, specifying the filter + * width. + * * 5: An {@link OperandType::INT32} scalar, specifying the filter + * height. + * * 6: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * * 7: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since HAL version 1.2. + * + * Outputs: + * * 0: The output 4-D tensor, of shape + * [batches, out_height, out_width, depth]. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + MAX_POOL_2D = 17, + /** + * Multiplies two tensors, element-wise. + * + * Takes two input tensors of identical {@link OperandType} and compatible + * dimensions. The output is the product of both input tensors, optionally + * modified by an activation function. + * + * Two dimensions are compatible when: + * 1. they are equal, or + * 2. one of them is 1 + * + * The size of the resulting output is the maximum size along each dimension + * of the input operands. It starts with the trailing dimensions, and works + * its way forward. + * + * Since HAL version 1.2, generic zero-sized input tensor is supported. Zero + * dimension is only compatible with 0 or 1. The size of the output + * dimension is zero if either of corresponding input dimension is zero. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * * {@link OperandType::TENSOR_INT32} (since HAL version 1.3) + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: A tensor. + * * 1: A tensor of the same {@link OperandType}, and compatible dimensions + * as input0. + * * 2: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * For a {@link OperandType::TENSOR_INT32} tensor, + * the {@link FusedActivationFunc} must be "NONE". + * + * Outputs: + * * 0: The product, a tensor of the same {@link OperandType} as input0. + * For output tensor of {@link OperandType::TENSOR_QUANT8_ASYMM} + * and {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * the following condition must be satisfied: + * output_scale > input1_scale * input2_scale. + */ + MUL = 18, + /** + * Computes rectified linear activation on the input tensor element-wise. + * + * The output is calculated using this formula: + * + * output = max(0, input) + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4. + * + * Inputs: + * * 0: A tensor, specifying the input. + * Since HAL version 1.2, this tensor may be zero-sized. + * + * Outputs: + * * 0: The output tensor of same shape as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + RELU = 19, + /** + * Computes rectified linear 1 activation on the input tensor element-wise. + * + * The output is calculated using this formula: + * + * output = min(1.f, max(-1.f, input)) + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4. + * + * Inputs: + * * 0: A tensor, specifying the input. + * Since HAL version 1.2, this tensor may be zero-sized. + * + * Outputs: + * * 0: The output tensor of the same shape as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + RELU1 = 20, + /** + * Computes rectified linear 6 activation on the input tensor element-wise. + * + * The output is calculated using this formula: + * + * output = min(6, max(0, input)) + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4. + * + * Inputs: + * * 0: A tensor, specifying the input. + * Since HAL version 1.2, this tensor may be zero-sized. + * + * Outputs: + * * 0: The output tensor of same shape as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + RELU6 = 21, + /** + * Reshapes a tensor. + * + * Given tensor, this operation returns a tensor that has the same values as + * tensor, but with a newly specified shape. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4. + * + * Inputs: + * * 0: A tensor, specifying the tensor to be reshaped. + * * 1: A 1-D tensor of {@link OperandType::TENSOR_INT32}, defining the + * shape of the output tensor. The number of elements implied by shape + * must be the same as the number of elements in the input tensor. + * + * If one component of shape is the special value -1, the size of that + * dimension is computed so that the total size remains constant. In + * particular, a shape of [-1] flattens into 1-D. At most one component + * of shape can be -1. + * + * Outputs: + * * 0: The output tensor, of shape specified by the input shape. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + RESHAPE = 22, + /** + * Resizes images to given size using the bilinear interpretation. + * + * Resized images must be distorted if their output aspect ratio is not the + * same as input aspect ratio. The corner pixels of output may not be the + * same as corner pixels of input. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} (since HAL version 1.2) + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * NCHW is supported since HAL version 1.2. + * + * Both resizing by shape and resizing by scale are supported. + * + * Inputs (resizing by shape): + * * 0: A 4-D tensor, of shape [batches, height, width, depth], specifying + * the input. + * Since HAL version 1.2, zero batches is supported for this tensor. + * * 1: An {@link OperandType::INT32} scalar, specifying the output + * width of the output tensor. + * * 2: An {@link OperandType::INT32} scalar, specifying the output + * height of the output tensor. + * * 3: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since HAL version 1.2. + * * 4: Align corners. An optional {@link OperandType::BOOL} + * scalar, default to false. If True, the centers of the 4 corner + * pixels of the input and output tensors are aligned, preserving the + * values at the corner pixels. + * Available since HAL version 1.3. + * * 5: Half pixel centers. An optional {@link OperandType::BOOL} + * scalar, default to false. If True, the pixel centers are assumed to + * be at (0.5, 0.5). This is the default behavior of image.resize in + * TF 2.0. If this parameter is True, then align_corners parameter + * must be False. + * Available since HAL version 1.3. + * + * Inputs (resizing by scale, since HAL version 1.2): + * * 0: A 4-D tensor, of shape [batches, height, width, depth], specifying + * the input. Zero batches is supported for this tensor. + * * 1: A scalar, specifying width_scale, the scaling factor of the width + * dimension from the input tensor to the output tensor. The output + * width is calculated as new_width = floor(width * width_scale). + * The scalar must be of {@link OperandType::FLOAT16} if input0 is + * of {@link OperandType::TENSOR_FLOAT16} and of + * {@link OperandType::FLOAT32} otherwise. + * * 2: A scalar, specifying height_scale, the scaling factor of the height + * dimension from the input tensor to the output tensor. The output + * height is calculated as new_height = floor(height * height_scale). + * The scalar must be of {@link OperandType::FLOAT16} if input0 is + * of {@link OperandType::TENSOR_FLOAT16} and of + * {@link OperandType::FLOAT32} otherwise. + * * 3: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * * 4: Align corners. An optional {@link OperandType::BOOL} + * scalar, default to false. If True, the centers of the 4 corner + * pixels of the input and output tensors are aligned, preserving the + * values at the corner pixels. + * Available since HAL version 1.3. + * * 5: Half pixel centers. An optional {@link OperandType::BOOL} + * scalar, default to false. If True, the pixel centers are assumed to + * be at (0.5, 0.5). This is the default behavior of image.resize in + * TF 2.0. If this parameter is True, then align_corners parameter + * must be False. + * Available since HAL version 1.3. + * + * Outputs: + * * 0: The output 4-D tensor, of shape + * [batches, new_height, new_width, depth]. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + RESIZE_BILINEAR = 23, + /** + * A basic recurrent neural network layer. + * + * This layer implements the operation: + * outputs = state = activation(inputs * input_weights + + * state * recurrent_weights + bias) + * + * Where: + * * “input_weights” is a weight matrix that multiplies the inputs; + * * “recurrent_weights” is a weight matrix that multiplies the current + * “state” which itself is the output from the previous time step + * computation; + * * “bias” is a bias vector (added to each output vector in the batch); + * * “activation” is the function passed as the “fused_activation_function” + * argument (if not “NONE”). + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * + * The input tensors must all be the same type. + * + * Inputs: + * * 0: input. + * A 2-D tensor of shape [batch_size, input_size], where “batch_size” + * corresponds to the batching dimension, and “input_size” is the size + * of the input. + * * 1: weights. + * A 2-D tensor of shape [num_units, input_size], where “num_units” + * corresponds to the number of units. + * * 2: recurrent_weights. + * A 2-D tensor of shape [num_units, num_units], with columns + * corresponding to the weights from each unit. + * * 3: bias. + * A 1-D tensor of shape [num_units]. + * * 4: hidden state (in). + * A 2-D tensor of shape [batch_size, num_units]. + * * 5: fused_activation_function. + * An optional {@link FusedActivationFunc} value indicating the + * activation function. If “NONE” is specified then it results in a + * linear activation. + * + * Outputs: + * * 0: hidden state (out). + * A 2-D tensor of shape [batch_size, num_units]. + * + * * 1: output. + * A 2-D tensor of shape [batch_size, num_units]. This is effectively + * the same as the current state value. + */ + RNN = 24, + /** + * Computes the softmax activation on the input tensor element-wise, per + * batch, by normalizing the input vector so the maximum coefficient is + * zero. + * + * The output is calculated using this formula: + * + * output[batch, i] = + * exp((input[batch, i] - max(input[batch, :])) * beta) / + * sum_{k}{exp((input[batch, k] - max(input[batch, :])) * beta)} + * + * For input tensor with rank other than 2, the activation will be applied + * independently on each 1-D slice along specified dimension. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4. + * Tensors with rank other than 2 or 4 are only supported since HAL version 1.2. + * + * Inputs: + * * 0: A 2-D or 4-D tensor, specifying the tensor to be reshaped. + * Since HAL version 1.2, this tensor may be zero-sized. + * * 1: A scalar, specifying the positive scaling factor for the exponent, + * beta. If input0 is of {@link OperandType::TENSOR_FLOAT32}, + * {@link OperandType::TENSOR_QUANT8_ASYMM} or + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, the scalar + * must be of {@link OperandType::FLOAT32}. + * If input0 is of {@link OperandType::TENSOR_FLOAT16}, then the + * scalar must be of {@link OperandType::FLOAT16}. + * * 2: An optional {@link OperandType::INT32} scalar, default to -1, + * specifying the dimension the activation would be performed on. + * Negative index is used to specify axis from the end (e.g. -1 for + * the last axis). Must be in the range [-n, n). + * Available since HAL version 1.2. + * + * Outputs: + * * 0: The output tensor of same shape as input0. + * For {@link OperandType::TENSOR_QUANT8_ASYMM}, + * the scale must be 1.f / 256 and the zeroPoint must be 0. + * For {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * the scale must be 1.f / 256 and the zeroPoint must be -128. + */ + SOFTMAX = 25, + /** + * Rearranges blocks of spatial data, into depth. + * + * More specifically, this op outputs a copy of the input tensor where + * values from the height and width dimensions are moved to the depth + * dimension. The value block_size indicates the input block size and how + * the data is moved. + * + * Chunks of data of size block_size * block_size from depth are rearranged + * into non-overlapping blocks of size block_size x block_size. + * + * The depth of the output tensor is input_depth * block_size * block_size. + * The input tensor's height and width must be divisible by block_size. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * NCHW is supported since HAL version 1.2. + * + * Inputs: + * * 0: A 4-D tensor, of shape [batches, height, width, depth_in], + * specifying the input. + * * 1: An {@link OperandType::INT32} scalar, specifying the block_size. + * block_size must be >=1 and block_size must be a divisor of both the + * input height and width. + * * 2: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since HAL version 1.2. + * + * Outputs: + * * 0: The output 4-D tensor, of shape [batches, height/block_size, + * width/block_size, depth_in*block_size*block_size]. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + SPACE_TO_DEPTH = 26, + /** + * SVDF op is a kind of stateful layer derived from the notion that a + * densely connected layer that's processing a sequence of input frames can + * be approximated by using a singular value decomposition of each of its + * nodes. The implementation is based on: + * + * https://research.google.com/pubs/archive/43813.pdf + * + * P. Nakkiran, R. Alvarez, R. Prabhavalkar, C. Parada. + * “Compressing Deep Neural Networks using a Rank-Constrained Topology”. + * INTERSPEECH, 2015. + * + * It processes the incoming input using a 2-stage filtering mechanism: + * * stage 1 performs filtering on the "features" dimension, whose outputs + * get pushed into a memory of fixed-size memory_size. + * * stage 2 performs filtering on the "time" dimension of the memory_size + * memoized outputs of stage 1. + * + * Specifically, for rank 1, this layer implements the operation: + * + * memory = push(conv1d(inputs, weights_feature, feature_dim, + * "PADDING_VALID")); + * outputs = activation(memory * weights_time + bias); + * + * Where: + * * “weights_feature” is a weights matrix that processes the inputs (by + * convolving the input with every “feature filter”), and whose outputs + * get pushed, stacked in order, into the fixed-size “memory” (the oldest + * entry gets dropped); + * * “weights_time” is a weights matrix that processes the “memory” (by a + * batched matrix multiplication on the num_units); + * * “bias” is an optional bias vector (added to each output vector in the + * batch); and + * * “activation” is the function passed as the “fused_activation_function” + * argument (if not “NONE”). + * + * Each rank adds a dimension to the weights matrices by means of stacking + * the filters. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * + * All input tensors must be the same type. + * + * Inputs: + * * 0: input. + * A 2-D tensor of shape [batch_size, input_size], where “batch_size” + * corresponds to the batching dimension, and “input_size” is the size + * of the input. + * * 1: weights_feature. + * A 2-D tensor of shape [num_units, input_size], where “num_units” + * corresponds to the number of units. + * * 2: weights_time. + * A 2-D tensor of shape [num_units, memory_size], where “memory_size” + * corresponds to the fixed-size of the memory. + * * 3: bias. + * An optional 1-D tensor of shape [num_units]. + * * 4: state (in). + * A 2-D tensor of shape [batch_size, (memory_size - 1) * num_units * rank]. + * * 5: rank. + * The rank of the SVD approximation. + * * 6: fused_activation_function. + * An optional {@link FusedActivationFunc} value indicating the + * activation function. If “NONE” is specified then it results in a + * linear activation. + * + * Outputs: + * * 0: state (out). + * A 2-D tensor of the same {@link OperandType} as the inputs, with shape + * [batch_size, (memory_size - 1) * num_units * rank]. + * * 1: output. + * A 2-D tensor of the same {@link OperandType} as the inputs, with shape + * [batch_size, num_units]. + */ + SVDF = 27, + /** + * Computes hyperbolic tangent of input tensor element-wise. + * + * The output is calculated using this formula: + * + * output = tanh(input) + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} (since HAL version 1.2) + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4. + * + * Inputs: + * * 0: A tensor, specifying the input. + * Since HAL version 1.2, this tensor may be zero-sized. + * + * Outputs: + * * 0: The output tensor of same shape as input0. + * For {@link OperandType::TENSOR_QUANT8_ASYMM}, + * the scale must be 1.f / 128 and the zeroPoint must be 128. + * For {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * the scale must be 1.f / 128 and the zeroPoint must be 0. + */ + TANH = 28, + /** + * BatchToSpace for N-dimensional tensors. + * + * This operation reshapes the batch dimension (dimension 0) into M + 1 + * dimensions of shape block_shape + [batch], interleaves these blocks back + * into the grid defined by the spatial dimensions [1, ..., M], to obtain a + * result with the same rank as the input. + * + * This is the reverse of SpaceToBatch. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * NCHW is supported since HAL version 1.2. + * + * Inputs: + * * 0: An n-D tensor, specifying the tensor to be reshaped + * * 1: A 1-D Tensor of {@link OperandType::TENSOR_INT32}, the block + * sizes for each spatial dimension of the input tensor. All values + * must be >= 1. + * * 2: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since API level 29. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + BATCH_TO_SPACE_ND = 29, + /** + * Element-wise division of two tensors. + * + * Takes two input tensors of identical {@link OperandType} and compatible + * dimensions. The output is the result of dividing the first input tensor + * by the second, optionally modified by an activation function. + * + * For inputs of {@link OperandType::TENSOR_INT32}, performs + * "floor division" ("//" in Python). For example, + * 5 // 2 = 2 + * -5 // 2 = -3 + * + * Two dimensions are compatible when: + * 1. they are equal, or + * 2. one of them is 1 + * + * The size of the output is the maximum size along each dimension of the + * input operands. It starts with the trailing dimensions, and works its way + * forward. + * + * Example: + * input1.dimension = {4, 1, 2} + * input2.dimension = {5, 4, 3, 1} + * output.dimension = {5, 4, 3, 2} + * + * Since HAL version 1.2, generic zero-sized input tensor is supported. Zero + * dimension is only compatible with 0 or 1. The size of the output + * dimension is zero if either of corresponding input dimension is zero. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} (since HAL version 1.3) + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An n-D tensor, specifying the first input. + * * 1: A tensor of the same {@link OperandType}, and compatible dimensions + * as input0. + * * 2: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * For a {@link OperandType::TENSOR_INT32} tensor, + * the {@link FusedActivationFunc} must be "NONE". + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + */ + DIV = 30, + /** + * Computes the mean of elements across dimensions of a tensor. + * + * Reduces the input tensor along the given dimensions to reduce. Unless + * keep_dims is true, the rank of the tensor is reduced by 1 for each entry + * in axis. If keep_dims is true, the reduced dimensions are retained with + * length 1. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: A tensor, specifying the input. + * * 1: A 1-D Tensor of {@link OperandType::TENSOR_INT32}. The dimensions + * to reduce. Must be in the range + * [-rank(input_tensor), rank(input_tensor)). + * + * NOTE: When the operation was introduced, the documentation + * incorrectly stated that if dimensions were empty, the operation + * would reduce across all dimensions. This behavior was never + * implemented. + * + * * 2: An {@link OperandType::INT32} scalar, keep_dims. If positive, + * retains reduced dimensions with length 1. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + * If all dimensions are reduced and keep_dims is false, the output + * shape is [1]. + */ + MEAN = 31, + /** + * Pads a tensor. + * + * This operation pads a tensor according to the specified paddings. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * (full support since HAL version 1.2, see the output section) + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An n-D tensor, specifying the tensor to be padded. + * * 1: A 2-D Tensor of {@link OperandType::TENSOR_INT32}, the paddings + * for each spatial dimension of the input tensor. The shape of the + * tensor must be {rank(input0), 2}. + * padding[i, 0] specifies the number of elements to be padded in the + * front of dimension i. + * padding[i, 1] specifies the number of elements to be padded after the + * end of dimension i. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. The + * output tensor has the same rank as input0, and each + * dimension of the output tensor has the same size as the + * corresponding dimension of the input tensor plus the size + * of the padding: + * output0.dimension[i] = + * padding[i, 0] + input0.dimension[i] + padding[i, 1] + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + * + * NOTE: Before HAL version 1.2, the pad value for + * {@link OperandType::TENSOR_QUANT8_ASYMM} is undefined. + * Since HAL version 1.2, the pad value is always the logical zero. + */ + PAD = 32, + /** + * SpaceToBatch for N-Dimensional tensors. + * + * This operation divides "spatial" dimensions [1, ..., M] of the input into + * a grid of blocks of shape block_shape, and interleaves these blocks with + * the "batch" dimension (0) such that in the output, the spatial dimensions + * [1, ..., M] correspond to the position within the grid, and the batch + * dimension combines both the position within a spatial block and the + * original batch position. Prior to division into blocks, the spatial + * dimensions of the input are optionally zero padded according to paddings. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * (full support since HAL version 1.2, see the output section) + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * NCHW is supported since HAL version 1.2. + * + * Inputs: + * * 0: An n-D tensor, specifying the input. + * * 1: A 1-D Tensor of {@link OperandType::TENSOR_INT32}, the block + * sizes for each spatial dimension of the input tensor. All values + * must be >= 1. + * * 2: A 2-D Tensor of {@link OperandType::TENSOR_INT32}, the paddings + * for each spatial dimension of the input tensor. All values must be + * >= 0. The shape of the tensor must be {M, 2}, where M is the number + * of spatial dimensions. + * padding[i, 0] specifies the number of element to be padded in the + * front of dimension i. + * padding[i, 1] specifies the number of element to be padded after the + * end of dimension i. + * * 3: An optional {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * Available since HAL version 1.2. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + * + * NOTE: Before HAL version 1.2, the pad value for + * {@link OperandType::TENSOR_QUANT8_ASYMM} is undefined. + * Since HAL version 1.2, the pad value is always the logical zero. + */ + SPACE_TO_BATCH_ND = 33, + /** + * Removes dimensions of size 1 from the shape of a tensor. + * + * Given a tensor input, this operation returns a tensor of the same + * {@link OperandType} with all dimensions of size 1 removed. If you don't + * want to remove all size 1 dimensions, you can remove specific size 1 + * dimensions by specifying the axes (input1). + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An n-D tensor, the tensor to be squeezed. + * * 1: An optional 1-D tensor of {@link OperandType::TENSOR_INT32}. The + * dimensions to squeeze. If specified only squeezes the dimensions + * listed. Otherwise, squeezes all dimensions. The dimension index + * starts at 0. An error must be reported if squeezing a dimension that + * is not 1. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. Contains the + * same data as input, but has one or more dimensions of size 1 + * removed. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + * If all input dimensions are equal to 1 and are to be squeezed, the + * output shape is [1]. + */ + SQUEEZE = 34, + /** + * Extracts a strided slice of a tensor. + * + * Roughly speaking, this op extracts a slice of size (end - begin) / stride + * from the given input tensor. Starting at the location specified by begin + * the slice continues by adding stride to the index until all dimensions + * are not less than end. Note that a stride can be negative, which causes a + * reverse slice. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An n-D tensor, specifying the tensor to be sliced. + * * 1: begin, a 1-D tensor of {@link OperandType::TENSOR_INT32}. The + * starts of the dimensions of the input tensor to be sliced. The + * length must be of rank(input0). + * * 2: end, a 1-D tensor of {@link OperandType::TENSOR_INT32}. The + * ends of the dimensions of the input tensor to be sliced. The length + * must be of rank(input0). + * * 3: strides, a 1-D tensor of {@link OperandType::TENSOR_INT32}. The + * strides of the dimensions of the input tensor to be sliced. The + * length must be of rank(input0). The entries must be non-zero. + * * 4: begin_mask, an {@link OperandType::INT32} scalar. If the ith bit + * of begin_mask is set, begin[i] is ignored and the fullest possible + * range in that dimension is used instead. + * * 5: end_mask, an {@link OperandType::INT32} scalar. If the ith bit of + * end_mask is set, end[i] is ignored and the fullest possible range in + * that dimension is used instead. + * * 6: shrink_axis_mask, an {@link OperandType::INT32} scalar. If the + * ith bit of shrink_axis_mask is set, the ith dimension specification + * shrinks the dimensionality by 1, taking on the value at index + * begin[i]. In this case, the ith specification must define a + * slice of size 1, e.g. begin[i] = x, end[i] = x + 1. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0 and rank (n - k), + * where k is the number of bits set in shrink_axis_mask. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + * If shrink_axis_mask is true for all input dimensions, the output + * shape is [1]. + */ + STRIDED_SLICE = 35, + /** + * Element-wise subtraction of two tensors. + * + * Takes two input tensors of identical {@link OperandType} and compatible + * dimensions. The output is the result of subtracting the second input + * tensor from the first one, optionally modified by an activation function. + * + * Two dimensions are compatible when: + * 1. they are equal, or + * 2. one of them is 1 + * + * The size of the output is the maximum size along each dimension of the + * input operands. It starts with the trailing dimensions, and works its way + * forward. + * + * Example: + * input1.dimension = {4, 1, 2} + * input2.dimension = {5, 4, 3, 1} + * output.dimension = {5, 4, 3, 2} + * + * Since HAL version 1.2, generic zero-sized input tensor is supported. Zero + * dimension is only compatible with 0 or 1. The size of the output + * dimension is zero if either of corresponding input dimension is zero. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} (since HAL version 1.2) + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * * {@link OperandType::TENSOR_INT32} (since HAL version 1.3) + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An n-D tensor, specifying the first input. + * * 1: A tensor of the same {@link OperandType}, and compatible dimensions + * as input0. + * * 2: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * For a {@link OperandType::TENSOR_INT32} tensor, + * the {@link FusedActivationFunc} must be "NONE". + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint can be different from inputs' scale and zeroPoint. + */ + SUB = 36, + /** + * Transposes the input tensor, permuting the dimensions according to the + * perm tensor. + * + * The returned tensor's dimension i corresponds to the input dimension + * perm[i]. If perm is not given, it is set to (n-1...0), where n is the + * rank of the input tensor. Hence by default, this operation performs a + * regular matrix transpose on 2-D input Tensors. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} (since HAL version 1.2) + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An n-D tensor, specifying the tensor to be transposed. + * Since HAL version 1.2, this tensor may be zero-sized. + * * 1: An optional 1-D Tensor of {@link OperandType::TENSOR_INT32}, + * the permutation of the dimensions of the input tensor. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + TRANSPOSE = 37, + /** + * Computes the absolute value of a tensor, element-wise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} (since HAL version 1.3) + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: A tensor. + * + * Outputs: + * * 0: The output tensor of same shape as input0. + */ + ABS = 38, + /** + * Returns the index of the largest element along an axis. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * Inputs: + * * 0: An n-D tensor specifying the input. Must be non-empty. + * * 1: An {@link OperandType::INT32} scalar specifying the axis to + * reduce across. Negative index is used to specify axis from the + * end (e.g. -1 for the last axis). Must be in the range [-n, n). + * + * Outputs: + * * 0: An (n - 1)-D {@link OperandType::TENSOR_INT32} tensor. + * If input is 1-dimensional, the output shape is [1]. + */ + ARGMAX = 39, + /** + * Returns the index of the smallest element along an axis. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * Inputs: + * * 0: An n-D tensor specifying the input. Must be non-empty. + * * 1: An {@link OperandType::INT32} scalar specifying the axis to + * reduce across. Negative index is used to specify axis from the + * end (e.g. -1 for the last axis). Must be in the range [-n, n). + * + * Outputs: + * * 0: An (n - 1)-D {@link OperandType::TENSOR_INT32} tensor. + * If input is 1-dimensional, the output shape is [1]. + */ + ARGMIN = 40, + /** + * Transform axis-aligned bounding box proposals using bounding box deltas. + * + * Given the positions of bounding box proposals and the corresponding + * bounding box deltas for each class, return the refined bounding box + * regions. The resulting bounding boxes are cliped against the edges of + * the image. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT16_ASYMM} + * + * Inputs: + * * 0: A 2-D Tensor of shape [num_rois, 4], specifying the locations of the + * bounding box proposals, each line with format [x1, y1, x2, y2]. + * For tensor of type {@link OperandType::TENSOR_QUANT16_ASYMM}, + * the zeroPoint must be 0 and the scale must be 0.125. Zero num_rois + * is supported for this tensor. + * * 1: A 2-D Tensor of shape [num_rois, num_classes * 4], specifying the + * bounding box delta for each region of interest and each class. The + * bounding box deltas are organized in the following order + * [dx, dy, dw, dh], where dx and dy is the relative correction factor + * for the center position of the bounding box with respect to the width + * and height, dw and dh is the log-scale relative correction factor + * for the width and height. For input0 of type + * {@link OperandType::TENSOR_QUANT16_ASYMM}, this tensor should be + * of {@link OperandType::TENSOR_QUANT8_ASYMM} or + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}. Zero num_rois is + * supported for this tensor. + * * 2: An 1-D {@link OperandType::TENSOR_INT32} tensor, of shape + * [num_rois], specifying the batch index of each box. Boxes with + * the same batch index are grouped together. Zero num_rois is + * supported for this tensor. + * * 3: A 2-D Tensor of shape [batches, 2], specifying the information of + * each image in the batch, each line with format + * [image_height, image_width]. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0, with shape + * [num_rois, num_classes * 4], specifying the coordinates of each + * output bounding box for each class, with format [x1, y1, x2, y2]. + * For type of {@link OperandType::TENSOR_QUANT16_ASYMM}, the + * scale must be 0.125 and the zero point must be 0. + */ + AXIS_ALIGNED_BBOX_TRANSFORM = 41, + /** + * A recurrent neural network layer that applies an LSTM cell to a + * sequence of inputs in forward and backward directions. + * + * The op supports cross-linking via an auxiliary input. Regular cell feeds + * one input into the two RNN cells in the following way: + * + * INPUT (INPUT_REVERSED) + * | | + * --------------------- + * | FW_LSTM BW_LSTM | + * --------------------- + * | | + * FW_OUT BW_OUT + * + * An op with cross-linking takes two inputs and feeds them into the RNN + * cells in the following way: + * + * AUX_INPUT (AUX_INPUT_REVERSED) + * | | + * INPUT | (INPUT_R'D.)| + * | | | | + * ----------------------- + * | \ / \ / | + * | FW_LSTM BW_LSTM | + * ----------------------- + * | | + * FW_OUT BW_OUT + * + * The cross-linking mode is enabled iff auxiliary input and auxiliary + * weights are present. While stacking this op on top of itself, this + * allows to connect both forward and backward outputs from previous cell + * to the next cell's input. + * + * Since HAL version 1.3 parallel linking mode is supported. The mode is + * enabled if auxiliary input is present but auxiliary weights are omitted. + * In this case, the cell feeds inputs into the RNN in the following way: + * + * INPUT (AUX_INPUT_REVERSED) + * | | + * --------------------- + * | FW_LSTM BW_LSTM | + * --------------------- + * | | + * FW_OUT BW_OUT + * + * While stacking this op on top of itself, this allows to connect both + * forward and backward outputs from previous cell to the next cell's + * corresponding inputs. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: 3, either time-major or batch-major. + * + * All input and output tensors must be of the same type. + * + * Inputs: + * * 0: The input. + * A 3-D tensor of shape: + * If time-major: [max_time, batch_size, input_size] + * If batch-major: [batch_size, max_time, input_size] + * where "max_time" is the number of timesteps (sequence length), + * "batch_size" corresponds to the batching dimension, and + * "input_size" is the size of the input. + * * 1: The forward input-to-input weights. Optional. + * A 2-D tensor of shape [fw_num_units, input_size], where “fw_num_units” + * corresponds to the number of forward cell units. + * * 2: The forward input-to-forget weights. + * A 2-D tensor of shape [fw_num_units, input_size]. + * * 3: The forward input-to-cell weights. + * A 2-D tensor of shape [fw_num_units, input_size]. + * * 4: The forward input-to-output weights. + * A 2-D tensor of shape [fw_num_units, input_size]. + * * 5: The forward recurrent-to-input weights. Optional. + * A 2-D tensor of shape [fw_num_units, fw_output_size], where “fw_output_size” + * corresponds to either the number of cell units (i.e., fw_num_units), + * or the second dimension of the “fw_projection_weights”, if defined. + * * 6: The forward recurrent-to-forget weights. + * A 2-D tensor of shape [fw_num_units, fw_output_size]. + * * 7: The forward recurrent-to-cell weights. + * A 2-D tensor of shape [fw_num_units, fw_output_size]. + * * 8: The forward recurrent-to-output weights. + * A 2-D tensor of shape [fw_num_units, fw_output_size]. + * * 9: The forward cell-to-input weights. Optional. + * A 1-D tensor of shape [fw_num_units]. + * * 10: The forward cell-to-forget weights. Optional. + * A 1-D tensor of shape [fw_num_units]. + * * 11: The forward cell-to-output weights. Optional. + * A 1-D tensor of shape [fw_num_units]. + * * 12: The forward input gate bias. Optional. + * A 1-D tensor of shape [fw_num_units]. + * * 13: The forward forget gate bias. + * A 1-D tensor of shape [fw_num_units]. + * * 14: The forward cell gate bias. + * A 1-D tensor of shape [fw_num_units]. + * * 15: The forward output gate bias. + * A 1-D tensor of shape [fw_num_units]. + * * 16: The forward projection weights. Optional. + * A 2-D tensor of shape [fw_output_size, fw_num_units]. + * * 17: The forward projection bias. Optional. + * A 1-D tensor of shape [fw_output_size]. + * * 18: The backward input-to-input weights. Optional. + * A 2-D tensor of shape [bw_num_units, input_size], where “bw_num_units” + * corresponds to the number of backward cell units. + * * 19: The backward input-to-forget weights. + * A 2-D tensor of shape [bw_num_units, input_size]. + * * 20: The backward input-to-cell weights. + * A 2-D tensor of shape [bw_num_units, input_size]. + * * 21: The backward input-to-output weights. + * A 2-D tensor of shape [bw_num_units, input_size]. + * * 22: The backward recurrent-to-input weights. Optional. + * A 2-D tensor of shape [bw_num_units, bw_output_size], where “bw_output_size” + * corresponds to either the number of cell units (i.e., “bw_num_units”), + * or the second dimension of the “bw_projection_weights”, if defined. + * * 23: The backward recurrent-to-forget weights. + * A 2-D tensor of shape [bw_num_units, bw_output_size]. + * * 24: The backward recurrent-to-cell weights. + * A 2-D tensor of shape [bw_num_units, bw_output_size]. + * * 25: The backward recurrent-to-output weights. + * A 2-D tensor of shape [bw_num_units, bw_output_size]. + * * 26: The backward cell-to-input weights. Optional. + * A 1-D tensor of shape [bw_num_units]. + * * 27: The backward cell-to-forget weights. Optional. + * A 1-D tensor of shape [bw_num_units]. + * * 28: The backward cell-to-output weights. Optional. + * A 1-D tensor of shape [bw_num_units]. + * * 29: The backward input gate bias. Optional. + * A 1-D tensor of shape [bw_num_units]. + * * 30: The backward forget gate bias. + * A 1-D tensor of shape [bw_num_units]. + * * 31: The backward cell gate bias. + * A 1-D tensor of shape [bw_num_units]. + * * 32: The backward output gate bias. + * A 1-D tensor of shape [bw_num_units]. + * * 33: The backward projection weights. Optional. + * A 2-D tensor of shape [bw_output_size, bw_num_units]. + * * 34: The backward projection bias. Optional. + * A 1-D tensor of shape [bw_output_size]. + * * 35: The forward input activation state. + * A 2-D tensor of shape [batch_size, bw_output_size]. + * * 36: The forward input cell state. + * A 2-D tensor of shape [batch_size, bw_num_units]. + * * 37: The backward input activation state. + * A 2-D tensor of shape [batch_size, bw_output_size]. + * * 38: The backward input cell state. + * A 2-D tensor of shape [batch_size, bw_num_units]. + * * 39: The auxiliary input. Optional. + * A 3-D tensor of shape [max_time, batch_size, aux_input_size], + * where “batch_size” corresponds to the batching dimension, and + * “aux_input_size” is the size of the auxiliary input. Optional. See + * the docs above for the usage modes explanation. + * * 40: The forward auxiliary input-to-input weights. + * Optional. See the docs above for the usage modes explanation. + * A 2-D tensor of shape [fw_num_units, aux_input_size]. + * * 41: The forward auxiliary input-to-forget weights. + * Optional. See the docs above for the usage modes explanation. + * A 2-D tensor of shape [fw_num_units, aux_input_size]. + * * 42: The forward auxiliary input-to-cell weights. + * Optional. See the docs above for the usage modes explanation. + * A 2-D tensor of shape [fw_num_units, aux_input_size]. + * * 43: The forward auxiliary input-to-output weights. + * Optional. See the docs above for the usage modes explanation. + * A 2-D tensor of shape [fw_num_units, aux_input_size]. + * * 44: The backward auxiliary input-to-input weights. + * Optional. See the docs above for the usage modes explanation. + * A 2-D tensor of shape [bw_num_units, aux_input_size]. + * * 45: The backward auxiliary input-to-forget weights. + * Optional. See the docs above for the usage modes explanation. + * A 2-D tensor of shape [bw_num_units, aux_input_size]. + * * 46: The backward auxiliary input-to-cell weights. + * Optional. See the docs above for the usage modes explanation. + * A 2-D tensor of shape [bw_num_units, aux_input_size]. + * * 47: The backward auxiliary input-to-output weights. + * Optional. See the docs above for the usage modes explanation. + * A 2-D tensor of shape [bw_num_units, aux_input_size]. + * * 48: The activation function. + * A value indicating the activation function: + *
    + *
  • 0: None; + *
  • 1: Relu; + *
  • 3: Relu6; + *
  • 4: Tanh; + *
  • 6: Sigmoid. + *
+ * * 49: The clipping threshold for the cell state, such + * that values are bound within [-cell_clip, cell_clip]. If set to 0.0 + * then clipping is disabled. + * If all the input tensors have type {@link OperandType::TENSOR_FLOAT32}, + * this scalar must be of the type {@link OperandType::FLOAT32}, + * otherwise if all the input tensors have the type + * {@link OperandType::TENSOR_FLOAT16}, this scalar must be + * of type {@link OperandType::FLOAT16}. + * * 50: The clipping threshold for the output from the + * projection layer, such that values are bound within + * [-proj_clip, proj_clip]. If set to 0.0 then clipping is disabled. + * If all the input tensors have type {@link OperandType::TENSOR_FLOAT32}, + * this scalar must be of the type {@link OperandType::FLOAT32}, + * otherwise if all the input tensors have the type + * {@link OperandType::TENSOR_FLOAT16}, this scalar must be + * of type {@link OperandType::FLOAT16}. + * * 51: merge_outputs + * An {@link OperandType::BOOL} scalar specifying if the outputs + * from forward and backward cells should be merged. + * * 52: time_major + * An {@link OperandType::BOOL} scalar specifying the shape format + * of input and output tensors. + * * 53: The forward input layer normalization weights. Optional. + * A 1-D tensor of shape [fw_num_units]. Used to rescale normalized inputs + * to activation at input gate. + * * 54: The forward forget layer normalization weights. Optional. + * A 1-D tensor of shape [fw_num_units]. Used to rescale normalized inputs + * to activation at forget gate. + * * 55: The forward cell layer normalization weights. Optional. + * A 1-D tensor of shape [fw_num_units]. Used to rescale normalized inputs + * to activation at cell gate. + * * 56: The forward output layer normalization weights. Optional. + * A 1-D tensor of shape [fw_num_units]. Used to rescale normalized inputs + * to activation at output gate. + * * 57: The backward input layer normalization weights. Optional. + * A 1-D tensor of shape [bw_num_units]. Used to rescale normalized inputs + * to activation at input gate. + * * 58: The backward forget layer normalization weights. Optional. + * A 1-D tensor of shape [bw_num_units]. Used to rescale normalized inputs + * to activation at forget gate. + * * 59: The backward cell layer normalization weights. Optional. + * A 1-D tensor of shape [bw_num_units]. Used to rescale normalized inputs + * to activation at cell gate. + * * 60: The backward output layer normalization weights. Optional. + * A 1-D tensor of shape [bw_num_units]. Used to rescale normalized inputs + * to activation at output gate. + * + * Outputs: + * * 0: The forward output. + * A 3-D tensor of shape: + * If time-major and not merge_outputs: + * [max_time, batch_size, fw_output_size] + * If time-major and merge_outputs: + * [max_time, batch_size, fw_output_size + bw_output_size] + * If batch-major and not merge_outputs: + * [batch_size, max_time, fw_output_size] + * If batch-major and merge_outputs: + * [batch_size, max_time, fw_output_size + bw_output_size] + * * 1: The backward output. Unused if merge_outputs is true. + * A 3-D tensor of shape: + * If time-major: [max_time, batch_size, bw_output_size] + * If batch-major: [batch_size, max_time, bw_output_size] + * * 2: The forward activation state output. + * A 2-D tensor of shape [batch_size, fw_output_size] containing an + * activation state from the last time step in the sequence. This + * output is optional and can be omitted. If this output is present + * then outputs 3-5 must be present as well. + * Available since HAL version 1.3. + * * 3: The forward cell state output. + * A tensor of shape [batch_size, fw_cell_size] containing a cell state + * from the last time step in the sequence. This output is optional + * and can be omitted. If this output is present + * then outputs 2, 4, 5 must be present as well. + * Available since HAL version 1.3. + * * 4: The backward activation state output. + * A 2-D tensor of shape [batch_size, bw_output_size] containing an + * activation state from the last time step in the sequence. This + * output is optional and can be omitted. If this output is present + * then outputs 2, 3, 5 must be present as well. + * Available since HAL version 1.3. + * * 5: The backward cell state output. + * A tensor of shape [batch_size, bw_cell_size] containing a cell state + * from the last time step in the sequence. This output is optional + * and can be omitted. If this output is present + * then outputs 2-4 must be present as well. + * Available since HAL version 1.3. + */ + BIDIRECTIONAL_SEQUENCE_LSTM = 42, + /** + * A recurrent neural network layer that applies a basic RNN cell to a + * sequence of inputs in forward and backward directions. + * + * This Op unrolls the input along the sequence dimension, and implements + * the following operation for each element in the sequence s = + * 1...sequence_length: + * fw_outputs[s] = fw_state = activation(inputs[s] * fw_input_weights’ + + * fw_state * fw_recurrent_weights’ + fw_bias) + * + * And for each element in sequence t = sequence_length : 1 + * bw_outputs[t] = bw_state = activation(inputs[t] * bw_input_weights’ + + * bw_state * bw_recurrent_weights’ + bw_bias) + * + * Where: + * * “{fw,bw}_input_weights” is a weight matrix that multiplies the inputs; + * * “{fw,bw}_recurrent_weights” is a weight matrix that multiplies the + * current “state” which itself is the output from the previous time step + * computation; + * * “{fw,bw}_bias” is a bias vector (added to each output vector in the + * batch); + * * “activation” is the function passed as the “fused_activation_function” + * argument (if not “NONE”). + * + * The op supports cross-linking via an auxiliary input. Regular cell feeds + * one input into the two RNN cells in the following way: + * + * INPUT (INPUT_REVERSED) + * | | + * --------------------- + * | FW_RNN BW_RNN | + * --------------------- + * | | + * FW_OUT BW_OUT + * + * An op with cross-linking takes two inputs and feeds them into the RNN + * cells in the following way: + * + * AUX_INPUT (AUX_INPUT_REVERSED) + * | | + * INPUT | (INPUT_R'D.)| + * | | | | + * ----------------------- + * | \ / \ / | + * | FW_RNN BW_RNN | + * ----------------------- + * | | + * FW_OUT BW_OUT + * + * The cross-linking mode is enabled iff auxiliary input and auxiliary + * weights are present. While stacking this op on top of itself, this + * allows to connect both forward and backward outputs from previous cell + * to the next cell's input. + * + * Since HAL version 1.3 parallel linking mode is supported. The mode is + * enabled if auxiliary input is present but auxiliary weights are omitted. + * In this case, the cell feeds inputs into the RNN in the following way: + * + * INPUT (AUX_INPUT_REVERSED) + * | | + * --------------------- + * | FW_RNN BW_RNN | + * --------------------- + * | | + * FW_OUT BW_OUT + * + * While stacking this op on top of itself, this allows to connect both + * forward and backward outputs from previous cell to the next cell's + * corresponding inputs. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * The input tensors must all be the same type. + * + * Inputs: + * * 0: input. + * A 3-D tensor. The shape is defined by the input 6 (timeMajor). If + * it is set to true, then the input has a shape [maxTime, batchSize, + * inputSize], otherwise the input has a shape [batchSize, maxTime, + * inputSize]. + * * 1: fwWeights. + * A 2-D tensor of shape [fwNumUnits, inputSize]. + * * 2: fwRecurrentWeights. + * A 2-D tensor of shape [fwNumUnits, fwNumUnits]. + * * 3: fwBias. + * A 1-D tensor of shape [fwNumUnits]. + * * 4: fwHiddenState. + * A 2-D tensor of shape [batchSize, fwNumUnits]. Specifies a hidden + * state input for the first time step of the computation. + * * 5: bwWeights. + * A 2-D tensor of shape [bwNumUnits, inputSize]. + * * 6: bwRecurrentWeights. + * A 2-D tensor of shape [bwNumUnits, bwNumUnits]. + * * 7: bwBias. + * A 1-D tensor of shape [bwNumUnits]. + * * 8: bwHiddenState + * A 2-D tensor of shape [batchSize, bwNumUnits]. Specifies a hidden + * state input for the first time step of the computation. + * * 9: auxInput. + * A 3-D tensor. The shape is defined by the input 6 (timeMajor). If + * it is set to true, then the input has a shape [maxTime, batchSize, + * auxInputSize], otherwise the input has a shape [batchSize, maxTime, + * auxInputSize]. Can be omitted. See the docs above for the usage + * modes explanation. + * * 10:fwAuxWeights. + * A 2-D tensor of shape [fwNumUnits, auxInputSize]. Can be omitted. + * See the docs above for the usage modes explanation. + * * 11:bwAuxWeights. + * A 2-D tensor of shape [bwNumUnits, auxInputSize]. Can be omitted. + * See the docs above for the usage modes explanation. + * * 12:fusedActivationFunction. + * A {@link FusedActivationFunc} value indicating the activation function. If + * “NONE” is specified then it results in a linear activation. + * * 13:timeMajor + * An {@link OperandType::BOOL} scalar specifying the shape format + * of input and output tensors. + * * 14:mergeOutputs + * An {@link OperandType::BOOL} scalar specifying if the outputs + * from forward and backward cells are separate (if set to false) or + * concatenated (if set to true). + * Outputs: + * * 0: fwOutput. + * A 3-D tensor. The first two dimensions of the shape are defined by + * the input 6 (timeMajor) and the third dimension is defined by the + * input 14 (mergeOutputs). If timeMajor is set to true, then the first + * two dimensions are [maxTime, batchSize], otherwise they are set to + * [batchSize, maxTime]. If mergeOutputs is set to true, then the third + * dimension is equal to (fwNumUnits + bwNumUnits), otherwise it is set + * to fwNumUnits. + * * 1: bwOutput. + * A 3-D tensor. If the input 14 (mergeOutputs) is set to true, then + * this tensor is not produced. The shape is defined by the input 6 + * (timeMajor). If it is set to true, then the shape is set to + * [maxTime, batchSize, bwNumUnits], otherwise the shape is set to + * [batchSize, maxTime, bwNumUnits]. + * * 2: The forward hidden state output. + * A 2-D tensor of shape [batchSize, fwNumUnits] containing a hidden + * state from the last time step in the sequence. This output is + * optional and can be omitted. If this output is present then output + * 3 must be present as well. + * Available since HAL version 1.3. + * * 3: The backward hidden state output. + * A 2-D tensor of shape [batchSize, bwNumUnits] containing a hidden + * state from the last time step in the sequence. This output is + * optional and can be omitted. If this output is present then output + * 2 must be present as well. + * Available since HAL version 1.3. + */ + BIDIRECTIONAL_SEQUENCE_RNN = 43, + /** + * Greedily selects a subset of bounding boxes in descending order of score. + * + * This op applies NMS algorithm to each class. In each loop of execution, + * the box with maximum score gets selected and removed from the pending set. + * The scores of the rest of boxes are lowered according to the + * intersection-over-union (IOU) overlapping with the previously selected + * boxes and a specified NMS kernel method. Any boxes with score less + * than a threshold are removed from the pending set. + * + * Three NMS kernels are supported: + * * Hard: score_new = score_old * (1 if IoU < threshold else 0) + * * Linear: score_new = score_old * (1 if IoU < threshold else 1 - IoU) + * * Gaussian: score_new = score_old * exp(- IoU^2 / sigma) + * + * Axis-aligned bounding boxes are represented by its upper-left corner + * coordinate (x1,y1) and lower-right corner coordinate (x2,y2). A valid + * bounding box should satisfy x1 <= x2 and y1 <= y2. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Inputs: + * * 0: A 2-D Tensor of shape [num_rois, num_classes], specifying the score + * of each bounding box proposal. The boxes are grouped by batches in the + * first dimension. Zero num_rois is supported for this tensor. + * * 1: A 2-D Tensor specifying the bounding boxes of shape + * [num_rois, num_classes * 4], organized in the order [x1, y1, x2, y2]. + * The boxes are grouped by batches in the first dimension. The sequential + * order of the boxes corresponds with input0. For input0 of type + * {@link OperandType::TENSOR_QUANT8_ASYMM}, this tensor should be of + * {@link OperandType::TENSOR_QUANT16_ASYMM}, with zeroPoint of 0 and + * scale of 0.125. + * For input0 of type {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * this tensor should be of {@link OperandType::TENSOR_QUANT16_ASYMM}, + * with zeroPoint of -128 and scale of 0.125. + * Zero num_rois is supported for this tensor. + * * 2: A 1-D {@link OperandType::TENSOR_INT32} tensor, of shape + * [num_rois], specifying the batch index of each box. Boxes with + * the same batch index are grouped together. + * * 3: An {@link OperandType::FLOAT32} scalar, score_threshold. Boxes + * with scores lower than the threshold are filtered before sending + * to the NMS algorithm. + * * 4: An {@link OperandType::INT32} scalar, specifying the maximum + * number of selected bounding boxes for each image. Set to a negative + * value for unlimited number of output bounding boxes. + * * 5: An {@link OperandType::INT32} scalar, specifying the NMS + * kernel method, options are 0:hard, 1:linear, 2:gaussian. + * * 6: An {@link OperandType::FLOAT32} scalar, specifying the IoU + * threshold in hard and linear NMS kernel. This field is ignored if + * gaussian kernel is selected. + * * 7: An {@link OperandType::FLOAT32} scalar, specifying the sigma in + * gaussian NMS kernel. This field is ignored if gaussian kernel is + * not selected. + * * 8: An {@link OperandType::FLOAT32} scalar, nms_score_threshold. + * Boxes with scores lower than the threshold are dropped during the + * score updating phase in soft NMS. + * + * Outputs: + * * 0: A 1-D Tensor of the same {@link OperandType} as input0, with shape + * [num_output_rois], specifying the score of each output box. The boxes + * are grouped by batches, but the sequential order in each batch is not + * guaranteed. For type of {@link OperandType::TENSOR_QUANT8_ASYMM}, + * guaranteed. For type of {@link OperandType::TENSOR_QUANT8_ASYMM} + * or {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * the scale and zero point must be the same as input0. + * * 1: A 2-D Tensor of the same {@link OperandType} as input1, with shape + * [num_output_rois, 4], specifying the coordinates of each + * output bounding box with the same format as input1. The sequential + * order of the boxes corresponds with output0. For type of + * {@link OperandType::TENSOR_QUANT16_ASYMM}, the scale must be + * 0.125 and the zero point must be 0. + * * 2: A 1-D {@link OperandType::TENSOR_INT32} tensor, of shape + * [num_output_rois], specifying the class of each output box. The + * sequential order of the boxes corresponds with output0. + * * 3: A 1-D {@link OperandType::TENSOR_INT32} tensor, of shape + * [num_output_rois], specifying the batch index of each box. Boxes + * with the same batch index are grouped together. + */ + BOX_WITH_NMS_LIMIT = 44, + /** + * Casts a tensor to a type. + * + * This operation ignores the scale and zeroPoint of quanized tensors, + * e.g. it treats a {@link OperandType::TENSOR_QUANT8_ASYMM} input + * as a tensor of uint8 values. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * Since HAL version 1.3, casting tensors of the following + * {@link OperandType} to the same {@link OperandType} is supported: + * * {@link OperandType::TENSOR_BOOL8} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT16_ASYMM} + * * {@link OperandType::TENSOR_QUANT16_SYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * * {@link OperandType::TENSOR_QUANT8_SYMM} + * + * Supported tensor rank: from 1 + * + * Inputs: + * * 0: A tensor. + * + * Outputs: + * * 0: A tensor with the same shape as input0. + */ + CAST = 45, + /** + * Shuffle the channels of the input tensor. + * + * Given an input tensor and a integer value of num_groups, CHANNEL_SHUFFLE + * divide the channel dimension into num_groups groups, and reorganize the + * channels by grouping channels with the same index in each group. + * + * Along the channel dimension, the output is calculated using this formula: + * + * output_channel[k * num_groups + g] = input_channel[g * group_size + k] + * + * where group_size = num_channels / num_groups + * + * The number of channels must be divisible by num_groups. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An n-D tensor, specifying the tensor to be shuffled. + * * 1: An {@link OperandType::INT32} scalar, specifying the number of + * groups. + * * 2: An {@link OperandType::INT32} scalar, specifying the dimension + * channel shuffle would be performed on. Negative index is used to + * specify axis from the end (e.g. -1 for the last axis). Must be in + * the range [-n, n). + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} and same shape as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + CHANNEL_SHUFFLE = 46, + /** + * Apply postprocessing steps to bounding box detections. + * + * Bounding box detections are generated by applying transformation on a set + * of predefined anchors with the bounding box deltas from bounding box + * regression. A final step of hard NMS is applied to limit the number of + * returned boxes. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Inputs: + * * 0: A 3-D Tensor of shape [batches, num_anchors, num_classes], specifying + * the score of each anchor with each class. Class 0 for each + * [batches, num_anchors, 0] is background and will be ignored. + * * 1: A 3-D Tensor of shape [batches, num_anchors, length_box_encoding], with + * the first four values in length_box_encoding specifying the bounding + * box deltas. The box deltas are encoded in the order of [dy, dx, dh, dw], + * where dy and dx is the linear-scale relative correction factor for the + * center position of the bounding box with respect to the width and height, + * dh and dw is the log-scale relative correction factor for the width and + * height. All the entries in length_box_encoding beyond the first four + * values are ignored in this operation. + * * 2: A 2-D Tensor of shape [num_anchors, 4], specifying the shape of each + * predefined anchor, with format [ctr_y, ctr_x, h, w], where ctr_y and + * ctr_x are the center position of the box, and h and w are the height + * and the width. + * * 3: An {@link OperandType::FLOAT32} scalar, specifying the scaling + * factor for dy in bounding box deltas. + * * 4: An {@link OperandType::FLOAT32} scalar, specifying the scaling + * factor for dx in bounding box deltas. + * * 5: An {@link OperandType::FLOAT32} scalar, specifying the scaling + * factor for dh in bounding box deltas. + * * 6: An {@link OperandType::FLOAT32} scalar, specifying the scaling + * factor for dw in bounding box deltas. + * * 7: An {@link OperandType::BOOL} scalar, set to true to use regular + * multi-class NMS algorithm that do NMS separately for each class, + * set to false for a faster algorithm that only do one single NMS + * using the highest class score.. + * * 8: An {@link OperandType::INT32} scalar, max_num_detections, specifying + * the maximum number of boxes for the output. Boxes with the lowest + * scores are discarded to meet the limit. + * * 9: An {@link OperandType::INT32} scalar, only used when input7 is + * set to false, specifying the maximum number of classes per detection. + * * 10: An {@link OperandType::INT32} scalar, only used when input7 is + * set to true, specifying the maximum number of detections when + * applying NMS algorithm for each single class. + * * 11: A scalar, score_threshold. Boxes with scores lower than the + * threshold are filtered before sending to the NMS algorithm. The + * scalar must be of {@link OperandType::FLOAT16} if input0 is of + * {@link OperandType::TENSOR_FLOAT16} and of + * {@link OperandType::FLOAT32} if input0 is of + * {@link OperandType::TENSOR_FLOAT32}. + * * 12: A scalar, specifying the IoU threshold for hard NMS. The scalar + * must be of {@link OperandType::FLOAT16} if input0 is of + * {@link OperandType::TENSOR_FLOAT16} and of + * {@link OperandType::FLOAT32} if input0 is of + * {@link OperandType::TENSOR_FLOAT32}. + * * 13: An {@link OperandType::BOOL} scalar, set to true to include + * background class in the list of label map for the output, set + * to false to not include the background. When the background + * class is included, it has label 0 and the output classes start + * at 1 in the label map, otherwise, the output classes start at 0. + * + * Outputs: + * * 0: A 2-D tensor of the same {@link OperandType} as input0, with shape + * [batches, max_num_detections], specifying the score of each output + * detections. + * * 1: A 3-D tensor of shape [batches, max_num_detections, 4], specifying the + * coordinates of each output bounding box, with format + * [y1, x1, y2, x2]. + * * 2: A 2-D {@link OperandType::TENSOR_INT32} tensor, of shape + * [batches, max_num_detections], specifying the class label for each + * output detection. + * * 3: An 1-D {@link OperandType::TENSOR_INT32} tensor, of shape [batches], + * specifying the number of valid output detections for each batch. + */ + DETECTION_POSTPROCESSING = 47, + /** + * For input tensors x and y, computes x == y elementwise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_BOOL8} + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * This operation supports broadcasting. + * + * Inputs: + * * 0: A tensor. + * * 1: A tensor of the same {@link OperandType} and dimensions compatible + * with input0. + * + * Outputs: + * * 0: A tensor of {@link OperandType::TENSOR_BOOL8}. + */ + EQUAL = 48, + /** + * Computes exponential of x element-wise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: A tensor. + * + * Outputs: + * * 0: The output tensor of same shape as input0. + */ + EXP = 49, + /** + * Inserts a dimension of 1 into a tensor's shape. + * + * Given a tensor input, this operation inserts a dimension of 1 at the + * given dimension index of input's shape. The dimension index starts at + * zero; if you specify a negative dimension index, it is counted backward + * from the end. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * Inputs: + * * 0: An n-D tensor. + * * 1: An {@link OperandType::INT32} scalar specifying the dimension + * index to expand. Must be in the range [-(n + 1), (n + 1)). + * + * Outputs: + * * 0: An (n + 1)-D tensor with the same {@link OperandType} and data as + * input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + EXPAND_DIMS = 50, + /** + * Gathers values along an axis. + * + * Produces an output tensor with shape + * input0.dimension[:axis] + indices.dimension + input0.dimension[axis + 1:] + * where: + * # Vector indices (output is rank(input0)). + * output[a_0, ..., a_n, i, b_0, ..., b_n] = + * input0[a_0, ..., a_n, indices[i], b_0, ..., b_n] + * + * # Higher rank indices (output is rank(input0) + rank(indices) - 1). + * output[a_0, ..., a_n, i, ..., j, b_0, ... b_n] = + * input0[a_0, ..., a_n, indices[i, ..., j], b_0, ..., b_n] + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * Inputs: + * * 0: An n-D tensor from which to gather values. + * * 1: An {@link OperandType::INT32} scalar specifying the axis. + * Negative index is used to specify axis from the end + * (e.g. -1 for the last axis). Must be in the range [-n, n). + * * 2: A k-D tensor {@link OperandType::TENSOR_INT32} of indices. + * The values must be in the bounds of the corresponding dimensions + * of input0. + * + * Outputs: + * * 0: An (n + k - 1)-D tensor with the same {@link OperandType} as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + GATHER = 51, + /** + * Generate aixs-aligned bounding box proposals. + * + * Bounding box proposals are generated by applying transformation on a set + * of predefined anchors with the bounding box deltas from bounding box + * regression. A final step of hard NMS is applied to limit the number of + * returned boxes. + * + * Axis-aligned bounding boxes are represented by its upper-left corner + * coordinate (x1,y1) and lower-right corner coordinate (x2,y2). A valid + * bounding box should satisfy x1 <= x2 and y1 <= y2. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Inputs: + * * 0: A 4-D Tensor specifying the score of each anchor at each + * location. With "NHWC" data layout, the tensor shape is + * [batches, height, width, num_anchors]. With "NCHW" data layout, + * the tensor shape is [batches, num_anchors, height, width]. + * * 1: A 4-D Tensor specifying the bounding box deltas. With "NHWC" data + * layout, the tensor shape is [batches, height, width, num_anchors * 4]. + * With "NCHW" data layout, the tensor shape is + * [batches, num_anchors * 4, height, width]. The box deltas are encoded + * in the order of [dx, dy, dw, dh], where dx and dy is the linear-scale + * relative correction factor for the center position of the bounding box + * with respect to the width and height, dw and dh is the log-scale + * relative correction factor for the width and height. The last + * dimensions is the channel dimension. + * * 2: A 2-D Tensor of shape [num_anchors, 4], specifying the shape of each + * predefined anchor, with format [x1, y1, x2, y2]. For input0 of type + * {@link OperandType::TENSOR_QUANT8_ASYMM} or + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, this tensor should be of + * {@link OperandType::TENSOR_QUANT16_SYMM}, with scale of 0.125. + * * 3: A 2-D Tensor of shape [batches, 2], specifying the size of + * each image in the batch, with format [image_height, image_width]. + * For input0 of type {@link OperandType::TENSOR_QUANT8_ASYMM} or + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, this + * tensor should be of {@link OperandType::TENSOR_QUANT16_SYMM}, with + * scale of 0.125. + * * 4: An {@link OperandType::FLOAT32} scalar, specifying the ratio + * from the height of original image to the height of feature map. + * * 5: An {@link OperandType::FLOAT32} scalar, specifying the ratio + * from the width of original image to the width of feature map. + * * 6: An {@link OperandType::INT32} scalar, specifying the maximum + * number of boxes before going into the hard NMS algorithm. Boxes + * with the lowest scores are discarded to meet the limit. Set to + * a non-positive value for unlimited number. + * * 7: An {@link OperandType::INT32} scalar, specifying the maximum + * number of boxes returning from the hard NMS algorithm. Boxes + * with the lowest scores are discarded to meet the limit. Set to + * a non-positive value for unlimited number. + * * 8: An {@link OperandType::FLOAT32} scalar, specifying the IoU + * threshold for hard NMS. + * * 9: An {@link OperandType::FLOAT32} scalar, min_size. Boxes with + * height or width lower than the absolute threshold are filtered out. + * * 10: An {@link OperandType::BOOL} scalar, set to true to specify + * NCHW data layout for input0 and input1. Set to false for NHWC. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0, of shape + * [num_output_rois], specifying the score of each output box. + * The boxes are grouped by batches, but the sequential order in + * each batch is not guaranteed. For type of + * {@link OperandType::TENSOR_QUANT8_ASYMM} or + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, the scale and zero + * point must be the same as input0. + * * 1: A tensor of the same {@link OperandType} as input3, of shape + * [num_output_rois, 4], specifying the coordinates of each output + * bounding box for each class, with format [x1, y1, x2, y2]. + * The sequential order of the boxes corresponds with output0. + * For type of {@link OperandType::TENSOR_QUANT16_ASYMM}, the + * scale must be 0.125 and the zero point must be 0. + * * 2: A 1-D {@link OperandType::TENSOR_INT32} tensor, of shape + * [num_output_rois], specifying the batch index of each box. Boxes + * with the same batch index are grouped together. + */ + GENERATE_PROPOSALS = 52, + /** + * For input tensors x and y, computes x > y elementwise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_BOOL8} + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * This operation supports broadcasting. + * + * Inputs: + * * 0: A tensor. + * * 1: A tensor of the same {@link OperandType} and dimensions compatible + * with input0. + * + * Outputs: + * * 0: A tensor of {@link OperandType::TENSOR_BOOL8}. + */ + GREATER = 53, + /** + * For input tensors x and y, computes x >= y elementwise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_BOOL8} + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * This operation supports broadcasting. + * + * Inputs: + * * 0: A tensor. + * * 1: A tensor of the same {@link OperandType} and dimensions compatible + * with input0. + * + * Outputs: + * * 0: A tensor of {@link OperandType::TENSOR_BOOL8}. + */ + GREATER_EQUAL = 54, + /** + * Performs a grouped 2-D convolution operation. + * + * Given an input tensor of shape [batches, height, width, depth_in] and a + * filter tensor of shape [depth_out, filter_height, filter_width, depth_group] + * containing depth_out convolutional filters of depth depth_group, GROUPED_CONV + * applies a group of different filters to each input channel group, then + * concatenates the results together. + * + * Specifically, the input channels are divided into num_groups groups, each with + * depth depth_group, i.e. depth_in = num_groups * depth_group. The convolutional + * filters are also divided into num_groups groups, i.e. depth_out is divisible + * by num_groups. GROUPED_CONV applies each group of filters to the corresponding + * input channel group, and the result are concatenated together. + * + * The output dimensions are functions of the filter dimensions, stride, and + * padding. + * + * The values in the output tensor are computed as: + * + * output[b, i, j, g * channel_multiplier + q] = + * sum_{di, dj, dk} ( + * input[b, strides[1] * i + di, strides[2] * j + dj, + * g * depth_group + dk] * + * filter[g * channel_multiplier + q, di, dj, dk] + * ) + bias[channel] + * + * where channel_multiplier = depth_out / num_groups + * + * Supported tensor {@link OperandType} configurations: + * * 16 bit floating point: + * * * {@link OperandType::TENSOR_FLOAT16} for input, filter, output, and bias. + * + * * 32 bit floating point: + * * * {@link OperandType::TENSOR_FLOAT32} for input, filter, output, and bias. + * + * * Quantized: + * * * {@link OperandType::TENSOR_QUANT8_ASYMM} for input, filter, and output. + * * * {@link OperandType::TENSOR_INT32} for bias (with scale set to + * * * input.scale * filter.scale). + * + * * Quantized signed (since HAL version 1.3): + * * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} for input, filter, and output. + * * * {@link OperandType::TENSOR_INT32} for bias (with scale set to + * * * input.scale * filter.scale). + * + * * Quantized with symmetric per channel quantization for the filter: + * * * {@link OperandType::TENSOR_QUANT8_ASYMM} for input, and output. + * * * {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} for filter. + * * * {@link OperandType::TENSOR_INT32} for bias (scale set to 0.0, + * * * each value scaling is separate and equal to input.scale * filter.scales[channel]). + * + * * Quantized signed with filter symmetric per channel quantization (since HAL version 1.3): + * * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} for input, and output. + * * * {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} for filter. + * * * {@link OperandType::TENSOR_INT32} for bias (scale set to 0.0, + * * * each value scaling is separate and equal to input.scale * filter.scales[channel]). + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * + * Both explicit padding and implicit padding are supported. + * + * Inputs (explicit padding): + * * 0: A 4-D tensor, of shape [batches, height, width, depth_in], + * specifying the input, where depth_in = num_groups * depth_group. + * * 1: A 4-D tensor, of shape + * [depth_out, filter_height, filter_width, depth_group], specifying + * the filter, where depth_out must be divisible by num_groups. For + * tensor of type {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} + * the channel dimension (channelDim at + * {@link SymmPerChannelQuantParams}) must be set to 0. + * * 2: A 1-D tensor, of shape [depth_out], specifying the bias. For input + * tensor of type {@link OperandType::TENSOR_FLOAT32} or + * {@link OperandType::TENSOR_FLOAT16}, the bias must be of the same type. + * For filter tensor of {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * the bias should be of {@link OperandType::TENSOR_INT32}, with zeroPoint + * of 0 and bias_scale == input_scale * filter_scale. For filter tensor + * of {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL}, the bias + * should be of {@link OperandType::TENSOR_INT32}, with zeroPoint of + * 0 and bias_scale of 0. The actual scale of each value 'i' is equal to + * bias_scale[i] = input_scale * filter_scale[i]. + * * 3: An {@link OperandType::INT32} scalar, specifying the padding on + * the left, in the ‘width’ dimension. + * * 4: An {@link OperandType::INT32} scalar, specifying the padding on + * the right, in the ‘width’ dimension. + * * 5: An {@link OperandType::INT32} scalar, specifying the padding on + * the top, in the ‘height’ dimension. + * * 6: An {@link OperandType::INT32} scalar, specifying the padding on + * the bottom, in the ‘height’ dimension. + * * 7: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘width’ dimension. + * * 8: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘height’ dimension. + * * 9: An {@link OperandType::INT32} scalar, specifying the number of + * groups. + * * 10: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * * 11: An {@link OperandType::BOOL} scalar, set to true to specify + * NCHW data layout for input0 and output0. Set to false for NHWC. + * + * Inputs (implicit padding): + * * 0: A 4-D tensor, of shape [batches, height, width, depth_in], + * specifying the input, where depth_in = num_groups * depth_group. + * * 1: A 4-D tensor, of shape + * [depth_out, filter_height, filter_width, depth_group], specifying + * the filter, where depth_out must be divisible by num_groups. For + * tensor of type {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} + * the channel dimension (SymmPerChannelQuantParams::channelDim) + * must be set to 0. + * * 2: A 1-D tensor, of shape [depth_out], specifying the bias. For input + * tensor of type {@link OperandType::TENSOR_FLOAT32} or + * {@link OperandType::TENSOR_FLOAT16}, the bias must be of the same + * {@link OperandType::TENSOR_FLOAT16}, the bias must be of the same type. + * For filter tensor of {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * the bias should be of {@link OperandType::TENSOR_INT32}, with zeroPoint + * of 0 and bias_scale == input_scale * filter_scale. For filter tensor + * of {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL}, the bias + * should be of {@link OperandType::TENSOR_INT32}, with zeroPoint of + * 0 and bias_scale of 0. The actual scale of each value 'i' is equal to + * bias_scale[i] = input_scale * filter_scale[i]. + * * 3: An {@link OperandType::INT32} scalar, specifying the implicit + * padding scheme, has to be one of the + * following values: {0 (NONE), 1 (SAME), 2 (VALID)}. + * * 4: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘width’ dimension. + * * 5: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘height’ dimension. + * * 6: An {@link OperandType::INT32} scalar, specifying the number of + * groups. + * * 7: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * * 8: An {@link OperandType::BOOL} scalar, set to true to specify + * NCHW data layout for input0 and output0. Set to false for NHWC. + * + * Outputs: + * * 0: The output 4-D tensor, of shape + * [batches, out_height, out_width, depth_out]. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint can be different from inputs' scale and zeroPoint. + */ + GROUPED_CONV_2D = 55, + /** + * Localize the maximum keypoints from heatmaps. + * + * This operation approximates the accurate maximum keypoint scores and + * indices after bicubic upscaling by using Taylor expansion up to the + * quadratic term. + * + * The bounding box is represented by its upper-left corner coordinate + * (x1,y1) and lower-right corner coordinate (x2,y2) in the original image. + * A valid bounding box should satisfy x1 <= x2 and y1 <= y2. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * + * Inputs: + * * 0: A 4-D Tensor of shape + * [num_boxes, heatmap_size, heatmap_size, num_keypoints], + * specifying the heatmaps, the height and width of heatmaps should + * be the same, and must be greater than or equal to 2. + * * 1: A 2-D Tensor of shape [num_boxes, 4], specifying the bounding boxes, + * each with format [x1, y1, x2, y2]. For input0 of type + * {@link OperandType::TENSOR_QUANT8_ASYMM}, this tensor should + * be of {@link OperandType::TENSOR_QUANT16_ASYMM}, with zeroPoint + * of 0 and scale of 0.125. + * For input0 of type + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, this tensor + * should be of {@link OperandType::TENSOR_QUANT16_ASYMM}, with + * zeroPoint of -128 and scale of 0.125. + * * 2: An {@link OperandType::BOOL} scalar, set to true to specify + * NCHW data layout for input0. Set to false for NHWC. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0, with shape + * [num_boxes, num_keypoints], specifying score of the keypoints. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} or + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint can be different from input0 scale and zeroPoint. + * * 1: A tensor of the same {@link OperandType} as input1, with shape + * [num_boxes, num_keypoints, 2], specifying the location of + * the keypoints, the second dimension is organized as + * [keypoint_x, keypoint_y]. + * For type of {@link OperandType::TENSOR_QUANT16_ASYMM}, the + * scale must be 0.125 and the zero point must be 0. + */ + HEATMAP_MAX_KEYPOINT = 56, + /** + * Applies instance normalization to the input tensor. + * + * The values in the output tensor are computed as: + * + * output[b, h, w, c] = + * (input[b, h, w, c] - mean[b, c]) * gamma / + * sqrt(var[b, c] + epsilon) + beta + * + * Where the mean and variance are computed across the spatial dimensions: + * + * mean[b, c] = + * sum_{h, w}(input[b, h, w, c]) / sum(1) + * + * var[b, c] = + * sum_{h, w}(pow(input[b, h, w, c] - mean[b, c], 2)) / sum(1) + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * + * Inputs: + * * 0: An n-D tensor, specifying the tensor to be normalized. + * * 1: A scalar, specifying gamma, the scale applied to the normalized + * tensor. The scalar must be of {@link OperandType::FLOAT16} if + * input0 is of {@link OperandType::TENSOR_FLOAT16} and of + * {@link OperandType::FLOAT32} if input0 is of + * {@link OperandType::TENSOR_FLOAT32}. + * * 2: A scalar, specifying beta, the offset applied to the normalized + * tensor. The scalar must be of {@link OperandType::FLOAT16} if + * input0 is of {@link OperandType::TENSOR_FLOAT16} and of + * {@link OperandType::FLOAT32} if input0 is of + * {@link OperandType::TENSOR_FLOAT32}. + * * 3: A scalar, specifying epsilon, the small value added to variance to + * avoid dividing by zero. The scalar must be of {@link OperandType::FLOAT16} if + * input0 is of {@link OperandType::TENSOR_FLOAT16} and of + * {@link OperandType::FLOAT32} if input0 is of + * {@link OperandType::TENSOR_FLOAT32}. + * * 4: An {@link OperandType::BOOL} scalar, set to true to specify + * NCHW data layout for input0 and output0. Set to false for NHWC. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} and same shape as input0. + */ + INSTANCE_NORMALIZATION = 57, + /** + * For input tensors x and y, computes x < y elementwise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_BOOL8} + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * This operation supports broadcasting. + * + * Inputs: + * * 0: A tensor. + * * 1: A tensor of the same {@link OperandType} and dimensions compatible + * with input0. + * + * Outputs: + * * 0: A tensor of {@link OperandType::TENSOR_BOOL8}. + */ + LESS = 58, + /** + * For input tensors x and y, computes x <= y elementwise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_BOOL8} + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * This operation supports broadcasting. + * + * Inputs: + * * 0: A tensor. + * * 1: A tensor of the same {@link OperandType} and dimensions compatible + * with input0. + * + * Outputs: + * * 0: A tensor of {@link OperandType::TENSOR_BOOL8}. + */ + LESS_EQUAL = 59, + /** + * Computes natural logarithm of x element-wise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: A tensor. + * + * Outputs: + * * 0: The output tensor of same shape as input0. + */ + LOG = 60, + /** + * Returns the truth value of x AND y element-wise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_BOOL8} + * + * Supported tensor rank: from 1 + * + * This operation supports broadcasting. + * + * Inputs: + * * 0: A tensor of {@link OperandType::TENSOR_BOOL8}. + * * 1: A tensor of {@link OperandType::TENSOR_BOOL8} and dimensions + * compatible with input0. + * + * Outputs: + * * 0: A tensor of {@link OperandType::TENSOR_BOOL8}. + */ + LOGICAL_AND = 61, + /** + * Computes the truth value of NOT x element-wise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_BOOL8} + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: A tensor. + * + * Outputs: + * * 0: The output tensor of same shape as input0. + */ + LOGICAL_NOT = 62, + /** + * Returns the truth value of x OR y element-wise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_BOOL8} + * + * Supported tensor rank: from 1 + * + * This operation supports broadcasting. + * + * Inputs: + * * 0: A tensor of {@link OperandType::TENSOR_BOOL8}. + * * 1: A tensor of {@link OperandType::TENSOR_BOOL8} and dimensions + * compatible with input0. + * + * Outputs: + * * 0: A tensor of {@link OperandType::TENSOR_BOOL8}. + */ + LOGICAL_OR = 63, + /** + * Computes the log softmax activations given logits. + * + * The output is calculated using this formula: + * + * output = logits * beta - log(reduce_sum(exp(logits * beta), axis)) + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: A tensor specifying the input logits. + * * 1: A scalar, specifying the positive scaling factor for the exponent, + * beta. + * For input tensor of {@link OperandType::TENSOR_FLOAT16}, the beta + * value must be of {@link OperandType::FLOAT16}. + * For input tensor of {@link OperandType::TENSOR_FLOAT32}, the beta + * value must be of {@link OperandType::FLOAT32}. + * * 2: An {@link OperandType::INT32} scalar specifying the axis to + * reduce across. Negative index is used to specify axis from the + * end (e.g. -1 for the last axis). Must be in the range [-n, n). + * + * Outputs: + * * 0: The output tensor of the same {@link OperandType} and shape as + * input0. + */ + LOG_SOFTMAX = 64, + /** + * Returns the element-wise maximum of two tensors. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: A tensor. + * * 1: A tensor of the same {@link OperandType} and compatible dimensions + * with input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} tensor, + * the scales and zeroPoint can be different from input0 scale and zeroPoint. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM} tensor, + * the scale and zeroPoint can be different from inputs' scale and zeroPoint. + */ + MAXIMUM = 65, + /** + * Returns the element-wise minimum of two tensors. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: A tensor. + * * 1: A tensor of the same {@link OperandType} and compatible dimensions + * with input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} tensor, + * the scales and zeroPoint can be different from input0 scale and zeroPoint. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM} tensor, + * the scale and zeroPoint can be different from inputs' scale and zeroPoint. + */ + MINIMUM = 66, + /** + * Computes numerical negative value element-wise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: A tensor. + * + * Outputs: + * * 0: The output tensor of same shape as input0. + */ + NEG = 67, + /** + * For input tensors x and y, computes x != y elementwise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_BOOL8} + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * This operation supports broadcasting. + * + * Inputs: + * * 0: A tensor. + * * 1: A tensor of the same {@link OperandType} and dimensions compatible + * with input0. + * + * Outputs: + * * 0: A tensor of {@link OperandType::TENSOR_BOOL8}. + */ + NOT_EQUAL = 68, + /** + * Pads a tensor with the given constant value according to the specified + * paddings. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An n-D tensor, specifying the tensor to be padded. + * * 1: A 2-D Tensor of {@link OperandType::TENSOR_INT32}, the paddings + * for each spatial dimension of the input tensor. The shape of the + * tensor must be {rank(input0), 2}. + * padding[i, 0] specifies the number of elements to be padded in the + * front of dimension i. + * padding[i, 1] specifies the number of elements to be padded after + * the end of dimension i. + * * 2: An scalar specifying the value to use for padding input0. + * For input tensor of {@link OperandType::TENSOR_FLOAT16}, the + * pad value must be of {@link OperandType::FLOAT16}. + * For input tensor of {@link OperandType::TENSOR_FLOAT32}, the + * pad value must be of {@link OperandType::FLOAT32}. + * For input tensor of {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * the pad value must be of {@link OperandType::INT32}. The + * scale and zeroPoint are assumed to be the same as in input0. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. The + * output tensor has the same rank as input0, and each + * dimension of the output tensor has the same size as the + * corresponding dimension of the input tensor plus the size + * of the padding: + * output0.dimension[i] = + * padding[i, 0] + input0.dimension[i] + padding[i, 1] + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + PAD_V2 = 69, + /** + * Computes the power of one value to another. + * + * Given a tensor base and a tensor exponent, this operation computes + * base^exponent elementwise. + * + * This operations supports broadcasting. The size of the output is the + * maximum size along each dimension of the input operands. It starts with + * the trailing dimensions, and works its way forward. + * + * For example: + * base.dimension = {4, 1, 2} + * exponent.dimension = {5, 4, 3, 1} + * output.dimension = {5, 4, 3, 2} + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: from 1 + * + * Inputs: + * * 0: A tensor specifying the base. + * * 1: A tensor specifying the exponent. + * + * Outputs: + * * 0: An output tensor. + */ + POW = 70, + /** + * Parametric Rectified Linear Unit. + * + * It follows: f(x) = alpha * x for x < 0, f(x) = x for x >= 0, where alpha + * is a learned array with the same {@link OperandType} and compatible + * dimensions as input x. + * + * Two dimensions are compatible when: + * 1. they are equal, or + * 2. one of them is 1 + * + * The size of the output is the maximum size along each dimension of the + * input operands. It starts with the trailing dimensions, and works its way + * forward. + * + * Example: + * input.dimension = {4, 1, 2} + * alpha.dimension = {5, 4, 3, 1} + * output.dimension = {5, 4, 3, 2} + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * Inputs: + * * 0: A tensor, specifying the input. + * * 1: A tensor of the same {@link OperandType}, and compatible dimensions + * as input0, specifying the alpha. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scales and zeroPoint can be different from input0 scale and zeroPoint. + */ + PRELU = 71, + /** + * Quantizes the input tensor. + * + * The formula for {@link OperandType::TENSOR_QUANT8_ASYMM} output tensor is: + * + * output = max(0, min(255, round(input / scale) + zeroPoint) + * + * The formula for {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} output + * tensor is: + * + * output = max(-128, min(127, round(input / scale) + zeroPoint) + * + * Supported input tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported output tensor {@link OperandType}: + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * Inputs: + * * 0: A tensor, may be zero-sized. + * + * Outputs: + * * 0: The output tensor of same shape as input0, but with + * {@link OperandType::TENSOR_QUANT8_ASYMM} or. + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}. + */ + QUANTIZE = 72, + /** + * A version of quantized LSTM, using 16 bit quantization for internal + * state. + * + * There is no projection layer, so cell state size is equal to the output + * size. + * + * Inputs: + * * 0: A 2-D tensor of type {@link OperandType::TENSOR_QUANT8_ASYMM} + * and shape [numBatches, inputSize] specifying the input to the LSTM + * cell. Tensor is quantized with a fixed quantization range of + * [-1, 127/128] (scale = 1/128, zeroPoint = 128). + * * 1: The input-to-input weights. + * A 2-D tensor of type {@link OperandType::TENSOR_QUANT8_ASYMM} + * and shape [outputSize, inputSize] specifying input-to-input part of + * weights for fully-connected layer inside the LSTM cell. + * Quantization zero point and scale must be the same across all the + * weights. + * * 2: The input-to-forget weights. + * A 2-D tensor of type {@link OperandType::TENSOR_QUANT8_ASYMM} + * and shape [outputSize, inputSize] specifying input-to-forget part of + * weights for fully-connected layer inside the LSTM cell. + * Quantization zero point and scale must be the same across all the + * weights. + * * 3: The input-to-cell weights. + * A 2-D tensor of type {@link OperandType::TENSOR_QUANT8_ASYMM} + * and shape [outputSize, inputSize] specifying input-to-cell part of + * weights for fully-connected layer inside the LSTM cell. + * Quantization zero point and scale must be the same across all the + * weights. + * * 4: The input-to-output weights. + * A 2-D tensor of type {@link OperandType::TENSOR_QUANT8_ASYMM} + * and shape [outputSize, inputSize] specifying input-to-output part of + * weights for fully-connected layer inside the LSTM cell. + * Quantization zero point and scale must be the same across all the + * weights. + * * 5: The recurrent-to-input weights. + * A 2-D tensor of type {@link OperandType::TENSOR_QUANT8_ASYMM} + * and shape [outputSize, outputSize] specifying recurrent-to-input part + * of weights for fully-connected layer inside the LSTM cell. + * Quantization zero point and scale must be the same across all the + * weights. + * * 6: The recurrent-to-forget weights. + * A 2-D tensor of type {@link OperandType::TENSOR_QUANT8_ASYMM} + * and shape [outputSize, outputSize] specifying recurrent-to-forget + * part of weights for fully-connected layer inside the LSTM cell. + * Quantization zero point and scale must be the same across all the + * weights. + * * 7: The recurrent-to-cell weights. + * A 2-D tensor of type {@link OperandType::TENSOR_QUANT8_ASYMM} + * and shape [outputSize, outputSize] specifying recurrent-to-cell part + * of weights for fully-connected layer inside the LSTM cell. + * Quantization zero point and scale must be the same across all the + * weights. + * * 8: The recurrent-to-output weights. + * A 2-D tensor of type {@link OperandType::TENSOR_QUANT8_ASYMM} + * and shape [outputSize, outputSize] specifying recurrent-to-output + * part of weights for fully-connected layer inside the LSTM cell. + * Quantization zero point and scale must be the same across all the + * weights. + * * 9: The input gate bias. + * A 1-D tensor of type {@link OperandType::TENSOR_INT32} and shape + * [outputSize] specifying the bias for the fully-connected layer + * inside the LSTM cell. Bias is quantized with scale being a product + * of input and weights scales and zeroPoint equal to 0. + * * 10:The forget gate bias. + * A 1-D tensor of type {@link OperandType::TENSOR_INT32} and shape + * [outputSize] specifying the bias for the fully-connected layer + * inside the LSTM cell. Bias is quantized with scale being a product + * of input and weights scales and zeroPoint equal to 0. + * * 11:The cell bias. + * A 1-D tensor of type {@link OperandType::TENSOR_INT32} and shape + * [outputSize] specifying the bias for the fully-connected layer + * inside the LSTM cell. Bias is quantized with scale being a product + * of input and weights scales and zeroPoint equal to 0. + * * 12:The output gate bias. + * A 1-D tensor of type {@link OperandType::TENSOR_INT32} and shape + * [outputSize] specifying the bias for the fully-connected layer + * inside the LSTM cell. Bias is quantized with scale being a product + * of input and weights scales and zeroPoint equal to 0. + * * 13: A 2-D tensor of type {@link OperandType::TENSOR_QUANT16_SYMM} + * and shape [numBatches, outputSize] specifying the cell state from the + * previous time step of the LSTM cell. It is quantized using a + * quantization range of [-2^4, 2^4 * 32767/32768] (scale = 2^4 / + * 32768, zeroPoint = 0). + * * 14: A 2-D tensor of type {@link OperandType::TENSOR_QUANT8_ASYMM} + * and shape [numBathes, outputSize] specifying the output of the LSTM + * cell from previous time-step. Tensor is quantized with a fixed + * quantization range of [-1, 127/128] (scale = 1/128, zeroPoint = + * 128). + * + * + * Outputs: + * * 0: A 2-D tensor of type {@link OperandType::TENSOR_QUANT16_SYMM} + * and shape [numBatches, outputSize] which contains a cell state from + * the current time step. Tensor is quantized using a quantization + * range of [-2^4, 2^4 * 32767/32768] (scale = 2^4 / 32768, zeroPoint = + * 0). + * * 1: A 2-D tensor of type {@link OperandType::TENSOR_QUANT8_ASYMM} + * and shape [numBathes, outputSize] which contains the output value. + * Tensor is quantized with a fixed quantization range of [-1, 127/128] + * (scale = 1/128, zeroPoint = 128). + */ + QUANTIZED_16BIT_LSTM = 73, + /** + * Draws samples from a multinomial distribution. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Inputs: + * * 0: A 2-D tensor with shape [batches, classes], specifying the + * unnormalized log-probabilities for all classes. + * * 1: A scalar {@link OperandType::INT32}, specifying the number of + * independent samples to draw for each row slice. + * * 2: A 1-D {@link OperandType::TENSOR_INT32} tensor with shape [2], + * specifying seeds used to initialize the random distribution. If both + * provided seeds are 0, both will be randomly generated. + * Outputs: + * * 0: A 2-D {@link OperandType::TENSOR_INT32} tensor with shape + * [batches, samples], containing the drawn samples. + */ + RANDOM_MULTINOMIAL = 74, + /** + * Reduces a tensor by computing the "logical and" of elements along given + * dimensions. + * + * If keep_dims is true, the reduced dimensions are + * retained with length 1. Otherwise, the rank of the tensor is reduced by + * 1 for each entry in dimensions. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_BOOL8} + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An n-D tensor. + * * 1: A 1-D tensor of {@link OperandType::TENSOR_INT32}. The dimensions + * to reduce. Dimension values must be in the range [-n, n). + * * 2: An {@link OperandType::BOOL} scalar, keep_dims. If true, + * retains reduced dimensions with length 1. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + * If all dimensions are reduced and keep_dims is false, the output + * shape is [1]. + */ + REDUCE_ALL = 75, + /** + * Reduces a tensor by computing the "logical or" of elements along given + * dimensions. + * + * If keep_dims is true, the reduced dimensions are + * retained with length 1. Otherwise, the rank of the tensor is reduced by + * 1 for each entry in dimensions. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_BOOL8} + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An n-D tensor. + * * 1: A 1-D tensor of {@link OperandType::TENSOR_INT32}. The dimensions + * to reduce. Dimension values must be in the range [-n, n). + * * 2: An {@link OperandType::BOOL} scalar, keep_dims. If true, + * retains reduced dimensions with length 1. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + * If all dimensions are reduced and keep_dims is false, the output + * shape is [1]. + */ + REDUCE_ANY = 76, + /** + * Reduces a tensor by computing the maximum of elements along given + * dimensions. + * + * If keep_dims is true, the reduced dimensions are + * retained with length 1. Otherwise, the rank of the tensor is reduced by + * 1 for each entry in dimensions. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An n-D tensor. + * * 1: A 1-D tensor of {@link OperandType::TENSOR_INT32}. The dimensions + * to reduce. Dimension values must be in the range [-n, n). + * * 2: An {@link OperandType::BOOL} scalar, keep_dims. If true, + * retains reduced dimensions with length 1. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + * If all dimensions are reduced and keep_dims is false, the output + * shape is [1]. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + REDUCE_MAX = 77, + /** + * Reduces a tensor by computing the minimum of elements along given + * dimensions. + * + * If keep_dims is true, the reduced dimensions are + * retained with length 1. Otherwise, the rank of the tensor is reduced by + * 1 for each entry in dimensions. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An n-D tensor. + * * 1: A 1-D tensor of {@link OperandType::TENSOR_INT32}. The dimensions + * to reduce. Dimension values must be in the range [-n, n). + * * 2: An {@link OperandType::BOOL} scalar, keep_dims. If true, + * retains reduced dimensions with length 1. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + * If all dimensions are reduced and keep_dims is false, the output + * shape is [1]. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + REDUCE_MIN = 78, + /** + * Reduces a tensor by multiplying elements along given dimensions. + * + * If keep_dims is true, the reduced dimensions are + * retained with length 1. Otherwise, the rank of the tensor is reduced by + * 1 for each entry in dimensions. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An n-D tensor. + * * 1: A 1-D tensor of {@link OperandType::TENSOR_INT32}. The dimensions + * to reduce. Dimension values must be in the range [-n, n). + * * 2: An {@link OperandType::BOOL} scalar, keep_dims. If true, + * retains reduced dimensions with length 1. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + * If all dimensions are reduced and keep_dims is false, the output + * shape is [1]. + */ + REDUCE_PROD = 79, + /** + * Reduces a tensor by summing elements along given dimensions. + * + * If keep_dims is true, the reduced dimensions are + * retained with length 1. Otherwise, the rank of the tensor is reduced by + * 1 for each entry in dimensions. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An n-D tensor. + * * 1: A 1-D tensor of {@link OperandType::TENSOR_INT32}. The dimensions + * to reduce. Dimension values must be in the range [-n, n). + * * 2: An {@link OperandType::BOOL} scalar, keep_dims. If true, + * retains reduced dimensions with length 1. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. + * If all dimensions are reduced and keep_dims is false, the output + * shape is [1]. + */ + REDUCE_SUM = 80, + /** + * Select and scale the feature map of each region of interest to a unified + * output size by average pooling sampling points from bilinear interpolation. + * + * The region of interest is represented by its upper-left corner coordinate + * (x1,y1) and lower-right corner coordinate (x2,y2) in the original image. + * A spatial scaling factor is applied to map into feature map coordinate. + * A valid region of interest should satisfy x1 <= x2 and y1 <= y2. + * + * No rounding is applied in this operation. The sampling points are unified + * distributed in the pooling bin and their values are calculated by bilinear + * interpolation. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * + * Inputs: + * * 0: A 4-D tensor, specifying the feature map. + * * 1: A 2-D Tensor of shape [num_rois, 4], specifying the locations of + * the regions of interest, each line with format [x1, y1, x2, y2]. + * For input0 of type {@link OperandType::TENSOR_QUANT8_ASYMM}, + * this tensor should be of {@link OperandType::TENSOR_QUANT16_ASYMM}, + * with zeroPoint of 0 and scale of 0.125. Zero num_rois is + * supported for this tensor. + * * 2: An 1-D {@link OperandType::TENSOR_INT32} tensor, of shape + * [num_rois], specifying the batch index of each box. Boxes with + * the same batch index are grouped together. Zero num_rois is + * supported for this tensor. + * * 3: An {@link OperandType::INT32} scalar, specifying the output + * height of the output tensor. + * * 4: An {@link OperandType::INT32} scalar, specifying the output + * width of the output tensor. + * * 5: An {@link OperandType::FLOAT32} scalar, specifying the ratio + * from the height of original image to the height of feature map. + * * 6: An {@link OperandType::FLOAT32} scalar, specifying the ratio + * from the width of original image to the width of feature map. + * * 7: An {@link OperandType::INT32} scalar, specifying the number of + * sampling points in height dimension used to compute the output. + * Set to 0 for adaptive value of ceil(roi_height/out_height). + * * 8: An {@link OperandType::INT32} scalar, specifying the number of + * sampling points in width dimension used to compute the output. + * Set to 0 for adaptive value of ceil(roi_width/out_width). + * * 9: An {@link OperandType::BOOL} scalar, set to true to specify + * NCHW data layout for input0 and output0. Set to false for NHWC. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. The output + * shape is [num_rois, out_height, out_width, depth]. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint can be different from the input0 scale and zeroPoint. + */ + ROI_ALIGN = 81, + /** + * Select and scale the feature map of each region of interest to a unified + * output size by max-pooling. + * + * The region of interest is represented by its upper-left corner coordinate + * (x1,y1) and lower-right corner coordinate (x2,y2) in the original image. + * A spatial scaling factor is applied to map into feature map coordinate. + * A valid region of interest should satisfy x1 <= x2 and y1 <= y2. + * + * Rounding is applied in this operation to ensure integer boundary for + * regions of interest and pooling bins. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * + * Inputs: + * * 0: A 4-D tensor, specifying the feature map. + * * 1: A 2-D Tensor of shape [num_rois, 4], specifying the locations of + * the regions of interest, each line with format [x1, y1, x2, y2]. + * For input0 of type {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * this tensor should be of {@link OperandType::TENSOR_QUANT16_ASYMM}, + * with zeroPoint of 0 and scale of 0.125. + * * 2: An 1-D {@link OperandType::TENSOR_INT32} tensor, of shape + * [num_rois], specifying the batch index of each box. Boxes with + * the same batch index are grouped together. + * * 3: An {@link OperandType::INT32} scalar, specifying the output + * height of the output tensor. + * * 4: An {@link OperandType::INT32} scalar, specifying the output + * width of the output tensor. + * * 5: An {@link OperandType::FLOAT32} scalar, specifying the ratio + * from the height of original image to the height of feature map. + * * 6: An {@link OperandType::FLOAT32} scalar, specifying the ratio + * from the width of original image to the width of feature map. + * * 7: An {@link OperandType::BOOL} scalar, set to true to specify + * NCHW data layout for input0 and output0. Set to false for NHWC. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. The output + * shape is [num_rois, out_height, out_width, depth]. + * For input0 of type {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + ROI_POOLING = 82, + /** + * Computes reciprocal of square root of x element-wise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: A tensor. + * + * Outputs: + * * 0: The output tensor of same shape as input0. + */ + RSQRT = 83, + /** + * Using a tensor of booleans c and input tensors x and y select values + * elementwise from both input tensors: + * + * O[i] = C[i] ? x[i] : y[i]. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * Inputs: + * * 0: A tensor of type {@link OperandType::TENSOR_BOOL8} acting as a + * mask that chooses, based on the value at each element, whether the + * corresponding element in the output should be taken from input1 (if + * true) or input2 (if false). + * * 1: An input tensor of the same shape as input0. + * * 2: An input tensor of the same shape and type as input1. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} + * and {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scales and zeroPoint can be different from input1 scale and zeroPoint. + * + * Outputs: + * * 0: A tensor of the same type and shape as input1 and input2. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} tensor, + * the scale and zeroPoint can be different from inputs' scale and zeroPoint. + */ + SELECT = 84, + /** + * Computes sin of x element-wise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: A tensor. + * + * Outputs: + * * 0: The output tensor of same shape as input0. + */ + SIN = 85, + /** + * Extracts a slice of specified size from the input tensor starting at a + * specified location. + * + * The starting location is specified as a 1-D tensor containing offsets + * for each dimension. The size is specified as a 1-D tensor containing + * either size of a slice along corresponding dimension or -1. In the latter + * case, all the remaining elements in dimension are included in the slice. + * + * A sum of begin offset and a size of a slice must not exceed size of a + * corresponding dimension. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * Inputs: + * * 0: An n-D tensor to take slice from, may be zero-sized. + * * 1: A 1-D tensor of type {@link OperandType::TENSOR_INT32} specifying + * the beginning indices of the slice in each dimension. + * * 2: A 1-D tensor of type {@link OperandType::TENSOR_INT32} specifying + * the size of the slice in each dimension. + * + * Outputs: + * * 0: An n-D tensor of the same type as the input containing the slice. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * its scale and zeroPoint has to be same as the input0 scale and zeroPoint. + */ + SLICE = 86, + /** + * Splits a tensor along a given axis into num_splits subtensors. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * Inputs: + * * 0: An n-D tensor to split. + * * 1: An {@link OperandType::INT32} scalar specifying the axis along + * which to split. + * * 2: An {@link OperandType::INT32} scalar indicating the number of + * splits along given axis. Must evenly divide axis size. + * + * Outputs: + * * 0 ~ (num_splits - 1): Resulting subtensors. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + SPLIT = 87, + /** + * Computes square root of x element-wise. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: A tensor. + * + * Outputs: + * * 0: The output tensor of same shape as input0. + */ + SQRT = 88, + /** + * Constructs a tensor by tiling a given tensor. + * + * This operation creates a new tensor by replicating `input` `multiples` + * times. The output tensor's i-th dimension has `input.dims(i) * multiples[i]` + * elements, and the values of `input` are replicated `multiples[i]` times + * along the i-th dimension. + * For example, tiling `[a b c d]` by `[2]` produces `[a b c d a b c d]`. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * Inputs: + * * 0: input, an n-D tensor specifying the input. + * * 1: multiples, a 1-D tensor of {@link OperandType::TENSOR_INT32}. + * The length of multiples must be n. + * + * Outputs: + * * 0: A tiled tensor of the same {@link OperandType} and rank as `input`. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + TILE = 89, + /** + * Finds values and indices of the k largest entries for the last dimension. + * + * Resulting values in each dimensions are sorted in descending order. If + * two values are equal, the one with larger index appears first. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: from 1 + * + * Inputs: + * * 0: input, an n-D tensor specifying the input. + * * 1: k, an {@link OperandType::INT32} scalar, specifying the number of + * top elements to look for along the last dimension. + * + * Outputs: + * * 0: An n-D tensor of the same type as the input, containing the k + * largest elements along each last dimensional slice. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + * * 1: An n-D tensor of type {@link OperandType::TENSOR_INT32} + * containing the indices of values within the last dimension of input. + */ + TOPK_V2 = 90, + /** + * Performs the transpose of 2-D convolution operation. + * + * This operation is sometimes called "deconvolution" after Deconvolutional + * Networks, but is actually the transpose (gradient) of + * {@link OperandType::CONV_2D} rather than an actual deconvolution. + * + * The output dimensions are functions of the filter dimensions, stride, and + * padding. + * + * Supported tensor {@link OperandType} configurations: + * * 16 bit floating point: + * * * {@link OperandType::TENSOR_FLOAT16} for input, filter, output, and bias. + * + * * 32 bit floating point: + * * * {@link OperandType::TENSOR_FLOAT32} for input, filter, output, and bias. + * + * * Quantized: + * * * {@link OperandType::TENSOR_QUANT8_ASYMM} for input, filter, and output. + * * * {@link OperandType::TENSOR_INT32} for bias (with scale set to + * * * input.scale * filter.scale). + * + * * Quantized with symmetric per channel quantization for the filter: + * * * {@link OperandType::TENSOR_QUANT8_ASYMM} for input, and output. + * * * {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} for filter. + * * * {@link OperandType::TENSOR_INT32} for bias (scale set to 0.0, + * * * each value scaling is separate and equal to input.scale * filter.scales[channel]). + * + * Available since HAL version 1.3: + * * Quantized signed (since HAL version 1.3): + * * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} for input, filter, and output. + * * * {@link OperandType::TENSOR_INT32} for bias (with scale set to + * * * input.scale * filter.scale). + * + * * Quantized signed with filter symmetric per channel quantization (since HAL version 1.3): + * * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} for input, and output. + * * * {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} for filter. + * * * {@link OperandType::TENSOR_INT32} for bias (scale set to 0.0, + * * * each value scaling is separate and equal to input.scale * filter.scales[channel]). + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * + * Both explicit padding and implicit padding are supported. + * + * Inputs (explicit padding): + * * 0: A 4-D tensor, of shape [batches, height, width, depth_in], + * specifying the input. + * * 1: A 4-D tensor, of shape + * [depth_out, filter_height, filter_width, depth_in], specifying the + * filter. For tensor of type + * {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} the channel + * dimension (SymmPerChannelQuantParams::channelDim) must be set to 0. + * * 2: A 1-D tensor, of shape [depth_out], specifying the bias. For input + * tensor of type {@link OperandType::TENSOR_FLOAT32} or + * {@link OperandType::TENSOR_FLOAT16}, the bias must be of the + * same type. + * For filter tensor of {@link OperandType::TENSOR_QUANT8_ASYMM} + * and {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * the bias should be of {@link OperandType::TENSOR_INT32}, + * with zeroPoint of 0 and bias_scale == input_scale * filter_scale. + * For filter tensor of {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL}, + * the bias must be of {@link OperandType::TENSOR_INT32}, with zeroPoint of 0 + * and bias_scale of 0. The actual scale of each value 'i' is equal to + * bias_scale[i] = input_scale * filter_scale[i]. + * * 3: An {@link OperandType::INT32} scalar, specifying the padding on + * the left, in the ‘width’ dimension. + * * 4: An {@link OperandType::INT32} scalar, specifying the padding on + * the right, in the ‘width’ dimension. + * * 5: An {@link OperandType::INT32} scalar, specifying the padding on + * the top, in the ‘height’ dimension. + * * 6: An {@link OperandType::INT32} scalar, specifying the padding on + * the bottom, in the ‘height’ dimension. + * * 7: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘width’ dimension. + * * 8: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘height’ dimension. + * * 9: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * * 10: An {@link OperandType::BOOL} scalar, set to true to specify + * NCHW data layout for input0 and output0. Set to false for NHWC. + * + * Inputs (implicit padding): + * * 0: A 4-D tensor, of shape [batches, height, width, depth_in], + * specifying the input. + * * 1: A 4-D tensor, of shape + * [depth_out, filter_height, filter_width, depth_in], specifying the + * filter. For tensor of type + * {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} the channel + * dimension (SymmPerChannelQuantParams::channelDim) must be set to 0. + * * 2: A 1-D tensor, of shape [depth_out], specifying the bias. For input + * tensor of type {@link OperandType::TENSOR_FLOAT32} or + * {@link OperandType::TENSOR_FLOAT16}, the bias should be of the + * same type. + * For filter tensor of {@link OperandType::TENSOR_QUANT8_ASYMM} + * and {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + * the bias should be of {@link OperandType::TENSOR_INT32}, + * with zeroPoint of 0 and bias_scale == input_scale * filter_scale. + * For filter tensor of {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL}, + * the bias must be of {@link OperandType::TENSOR_INT32}, with zeroPoint of 0 + * and bias_scale of 0. The actual scale of each value 'i' is equal to + * bias_scale[i] = input_scale * filter_scale[i]. + * * 3: An {@link OperandType::TENSOR_INT32} tensor, specifying the output + * tensor shape. + * * 4: An {@link OperandType::INT32} scalar, specifying the implicit + * padding scheme, has to be one of the + * following values: {0 (NONE), 1 (SAME), 2 (VALID)}. + * * 5: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘width’ dimension. + * * 6: An {@link OperandType::INT32} scalar, specifying the stride when + * walking through input in the ‘height’ dimension. + * * 7: An {@link OperandType::INT32} scalar, and has to be one of the + * {@link FusedActivationFunc} values. Specifies the activation to + * invoke on the result. + * * 8: An {@link OperandType::BOOL} scalar, set to true to specify + * NCHW data layout for input0 and output0. Set to false for NHWC. + * + * Outputs: + * * 0: The output 4-D tensor, of shape + * [batches, out_height, out_width, depth_out]. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint can be different from inputs' scale and zeroPoint. + */ + TRANSPOSE_CONV_2D = 91, + /** + * A recurrent neural network specified by an LSTM cell. + * + * Performs (fully) dynamic unrolling of input. + * + * This Op unrolls the input along the time dimension, and implements the + * following operation for each element in the sequence + * s = 1...sequence_length: + * outputs[s] = projection(state = activation(LSTMOp(inputs[s]))) + * + * Where LSTMOp is the LSTM op as in {@link OperandType::LSTM}, + * the "projection" is an optional projection layer from state and output + * and the “activation” is the function passed as the + * “fused_activation_function” argument (if not “NONE”). + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: 3, either time-major or batch-major. + * + * All input and output tensors must be of the same type. + * + * Inputs: + * * 0: The input (\f$x_t\f$). + * A 3-D tensor of shape: + * If time-major: [max_time, batch_size, input_size] + * If batch-major: [batch_size, max_time, input_size] + * where “max_time” is the number of timesteps (sequence length), + * “batch_size” corresponds to the batching dimension, and + * “input_size” is the size of the input. + * * 1: The input-to-input weights (\f$W_{xi}\f$). Optional. + * A 2-D tensor of shape [num_units, input_size], where “num_units” + * corresponds to the number of cell units. + * * 2: The input-to-forget weights (\f$W_{xf}\f$). + * A 2-D tensor of shape [num_units, input_size]. + * * 3: The input-to-cell weights (\f$W_{xc}\f$). + * A 2-D tensor of shape [num_units, input_size]. + * * 4: The input-to-output weights (\f$W_{xo}\f$). + * A 2-D tensor of shape [num_units, input_size]. + * * 5: The recurrent-to-input weights (\f$W_{hi}\f$). Optional. + * A 2-D tensor of shape [num_units, output_size], where “output_size” + * corresponds to either the number of cell units (i.e., “num_units”), + * or the second dimension of the “projection_weights”, if defined. + * * 6: The recurrent-to-forget weights (\f$W_{hf}\f$). + * A 2-D tensor of shape [num_units, output_size]. + * * 7: The recurrent-to-cell weights (\f$W_{hc}\f$). + * A 2-D tensor of shape [num_units, output_size]. + * * 8: The recurrent-to-output weights (\f$W_{ho}\f$). + * A 2-D tensor of shape [num_units, output_size]. + * * 9: The cell-to-input weights (\f$W_{ci}\f$). Optional. + * A 1-D tensor of shape [num_units]. + * * 10:The cell-to-forget weights (\f$W_{cf}\f$). Optional. + * A 1-D tensor of shape [num_units]. + * * 11:The cell-to-output weights (\f$W_{co}\f$). Optional. + * A 1-D tensor of shape [num_units]. + * * 12:The input gate bias (\f$b_i\f$). Optional. + * A 1-D tensor of shape [num_units]. + * * 13:The forget gate bias (\f$b_f\f$). + * A 1-D tensor of shape [num_units]. + * * 14:The cell bias (\f$b_c\f$). + * A 1-D tensor of shape [num_units]. + * * 15:The output gate bias (\f$b_o\f$). + * A 1-D tensor of shape [num_units]. + * * 16:The projection weights (\f$W_{proj}\f$). Optional. + * A 2-D tensor of shape [output_size, num_units]. + * * 17:The projection bias (\f$b_{proj}\f$). Optional. + * A 1-D tensor of shape [output_size]. + * * 18:The output state (in) (\f$h_{t-1}\f$). + * A 2-D tensor of shape [batch_size, output_size]. + * * 19:The cell state (in) (\f$C_{t-1}\f$). + * A 2-D tensor of shape [batch_size, num_units]. + * * 20:The activation function (\f$g\f$). + * A value indicating the activation function: + *
    + *
  • 0: None; + *
  • 1: Relu; + *
  • 3: Relu6; + *
  • 4: Tanh; + *
  • 6: Sigmoid. + *
+ * * 21:The clipping threshold (\f$t_{cell}\f$) for the cell state, such + * that values are bound within [-cell_clip, cell_clip]. If set to 0.0 + * then clipping is disabled. + * * 22:The clipping threshold (\f$t_{proj}\f$) for the output from the + * projection layer, such that values are bound within + * [-proj_clip, proj_clip]. If set to 0.0 then clipping is disabled. + * * 23:Time-major if true, batch-major if false. + * * 24:The input layer normalization weights. Optional. + * A 1-D tensor of shape [num_units]. Used to rescale normalized inputs + * to activation at input gate. + * * 25:The forget layer normalization weights. Optional. + * A 1-D tensor of shape [num_units]. Used to rescale normalized inputs + * to activation at forget gate. + * * 26:The cell layer normalization weights. Optional. + * A 1-D tensor of shape [num_units]. Used to rescale normalized inputs + * to activation at cell gate. + * * 27:The output layer normalization weights. Optional. + * A 1-D tensor of shape [num_units]. Used to rescale normalized inputs + * to activation at output gate. + * + * Outputs: + * * 0: The output (\f$o_t\f$). + * A 3-D tensor of shape: + * If time-major: [max_time, batch_size, output_size] + * If batch-major: [batch_size, max_time, output_size] + * * 1: A tensor of shape [batch_size, output_size] containing a hidden + * state from the last time step in the sequence. This output is + * optional and can be omitted. If this output is present then + * output #2 must be present as well. + * Available since HAL version 1.3. + * * 2: A tensor of shape [batch_size, cell_size] containing a cell state + * from the last time step in the sequence. This output is optional + * and can be omitted. + * Available since HAL version 1.3. + */ + UNIDIRECTIONAL_SEQUENCE_LSTM = 92, + /** + * A recurrent neural network layer that applies a basic RNN cell to a + * sequence of inputs. + * + * This layer unrolls the input along the sequence dimension, and implements + * the following operation + * for each element in the sequence s = 1...sequence_length: + * outputs[s] = state = activation(inputs[s] * input_weights’ + state * + * recurrent_weights’ + bias) + * + * Where: + * * “input_weights” is a weight matrix that multiplies the inputs; + * * “recurrent_weights” is a weight matrix that multiplies the current + * “state” which itself is the output from the previous time step + * computation; + * * “bias” is a bias vector (added to each output vector in the batch); + * * “activation” is the function passed as the “fused_activation_function” + * argument (if not “NONE”). + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * The input tensors must all be the same type. + * + * Inputs: + * * 0: input. + * A 3-D tensor. The shape is defined by the input 6 (timeMajor). If + * it is set to 1, then the input has a shape [maxTime, batchSize, + * inputSize], otherwise the input has a shape [batchSize, maxTime, + * inputSize]. + * * 1: weights. + * A 2-D tensor of shape [numUnits, inputSize]. + * * 2: recurrent_weights. + * A 2-D tensor of shape [numUnits, numUnits]. + * * 3: bias. + * A 1-D tensor of shape [numUnits]. + * * 4: hidden state + * A 2-D tensor of shape [batchSize, numUnits]. Specifies a hidden + * state input for the first time step of the computation. + * * 5: fusedActivationFunction. + * A {@link FusedActivationFunc} value indicating the activation function. If + * “NONE” is specified then it results in a linear activation. + * * 6: timeMajor + * An {@link OperandType::INT32} scalar specifying the shape format + * of input and output tensors. Must be set to either 0 or 1. + * Outputs: + * * 0: output. + * A 3-D tensor. The shape is defined by the input 6 (timeMajor). If + * it is set to 1, then the output has a shape [maxTime, batchSize, + * numUnits], otherwise the output has a shape [batchSize, maxTime, + * numUnits]. + * * 1: A tensor of shape [batchSize, numUnits] containing hidden state + * from the last time step in the sequence. This output is optional + * and can be omitted. + * Available since HAL version 1.3. + */ + UNIDIRECTIONAL_SEQUENCE_RNN = 93, + /** + * Resizes images to given size using the nearest neighbor interpretation. + * + * Resized images must be distorted if their output aspect ratio is not the + * same as input aspect ratio. The corner pixels of output may not be the + * same as corner pixels of input. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * + * Supported tensor rank: 4, with "NHWC" or "NCHW" data layout. + * With the default data layout NHWC, the data is stored in the order of: + * [batch, height, width, channels]. Alternatively, the data layout could + * be NCHW, the data storage order of: [batch, channels, height, width]. + * + * Both resizing by shape and resizing by scale are supported. + * + * Inputs (resizing by shape): + * * 0: A 4-D tensor, of shape [batches, height, width, depth], specifying + * the input. Zero batches is supported for this tensor. + * * 1: An {@link OperandType::INT32} scalar, specifying the output + * width of the output tensor. + * * 2: An {@link OperandType::INT32} scalar, specifying the output + * height of the output tensor. + * * 3: An {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * * 4: Align corners. An optional {@link OperandType::BOOL} + * scalar, default to false. If True, the centers of the 4 corner + * pixels of the input and output tensors are aligned, preserving the + * values at the corner pixels. + * Available since HAL version 1.3. + * * 5: Half pixel centers. An optional {@link OperandType::BOOL} + * scalar, default to false. If True, the pixel centers are assumed to + * be at (0.5, 0.5). This is the default behavior of image.resize in + * TF 2.0. If this parameter is True, then align_corners parameter + * must be False. + * Available since HAL version 1.3. + * + * Inputs (resizing by scale): + * * 0: A 4-D tensor, of shape [batches, height, width, depth], specifying + * the input. Zero batches is supported for this tensor. + * * 1: A scalar, specifying width_scale, the scaling factor of the width + * dimension from the input tensor to the output tensor. The output + * width is calculated as new_width = floor(width * width_scale). + * The scalar must be of {@link OperandType::FLOAT16} if input0 is + * of {@link OperandType::TENSOR_FLOAT16} and of + * {@link OperandType::FLOAT32} otherwise. + * * 2: A scalar, specifying height_scale, the scaling factor of the height + * dimension from the input tensor to the output tensor. The output + * height is calculated as new_height = floor(height * height_scale). + * The scalar must be of {@link OperandType::FLOAT16} if input0 is + * of {@link OperandType::TENSOR_FLOAT16} and of + * {@link OperandType::FLOAT32} otherwise. + * * 3: An {@link OperandType::BOOL} scalar, default to false. + * Set to true to specify NCHW data layout for input0 and output0. + * * 4: Align corners. An optional {@link OperandType::BOOL} + * scalar, default to false. If True, the centers of the 4 corner + * pixels of the input and output tensors are aligned, preserving the + * values at the corner pixels. + * Available since HAL version 1.3. + * * 5: Half pixel centers. An optional {@link OperandType::BOOL} + * scalar, default to false. If True, the pixel centers are assumed to + * be at (0.5, 0.5). This is the default behavior of image.resize in + * TF 2.0. If this parameter is True, then align_corners parameter + * must be False. + * Available since HAL version 1.3. + * + * Outputs: + * * 0: The output 4-D tensor, of shape + * [batches, new_height, new_width, depth]. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + RESIZE_NEAREST_NEIGHBOR = 94, + /** + * Quantized version of {@link OperationType::LSTM}. + * + * The input and the output use asymmetric quantized types, while the rest + * use symmetric ones. + * + * Inputs: + * * 0: The input to the LSTM cell. + * Type: {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * Shape: [batchSize, inputSize] + * * 1: The input-to-input weights. Optional. + * Type: {@link OperandType::TENSOR_QUANT8_SYMM} + * Shape: [numUnits, inputSize] + * * 2: The input-to-forget weights. + * Type: {@link OperandType::TENSOR_QUANT8_SYMM} + * Shape: [numUnits, inputSize] + * * 3: The input-to-cell weights. + * Type: {@link OperandType::TENSOR_QUANT8_SYMM} + * Shape: [numUnits, inputSize] + * * 4: The input-to-output weights. + * Type: {@link OperandType::TENSOR_QUANT8_SYMM} + * Shape: [numUnits, inputSize] + * * 5: The recurrent-to-input weights. Optional. + * Type: {@link OperandType::TENSOR_QUANT8_SYMM} + * Shape: [numUnits, outputSize] + * * 6: The recurrent-to-forget weights. + * Type: {@link OperandType::TENSOR_QUANT8_SYMM} + * Shape: [numUnits, outputSize] + * * 7: The recurrent-to-cell weights. + * Type: {@link OperandType::TENSOR_QUANT8_SYMM} + * Shape: [numUnits, outputSize] + * * 8: The recurrent-to-output weights. + * Type: {@link OperandType::TENSOR_QUANT8_SYMM} + * Shape: [numUnits, outputSize] + * * 9: The cell-to-input weights (for peephole). Optional. + * Type: {@link OperandType::TENSOR_QUANT16_SYMM} + * Shape: [numUnits] + * * 10: The cell-to-forget weights (for peephole). Optional. + * Type: {@link OperandType::TENSOR_QUANT16_SYMM} + * Shape: [numUnits] + * * 11: The cell-to-output weights (for peephole). Optional. + * Type: {@link OperandType::TENSOR_QUANT16_SYMM} + * Shape: [numUnits] + * * 12: The input gate bias. Quantized with scale being the + * product of input and weights scales and zeroPoint equal to 0. + * Optional. + * Type: {@link OperandType::TENSOR_INT32} + * Shape: [numUnits] + * * 13: The forget gate bias. Quantized with scale being the + * product of input and weights scales and zeroPoint equal to 0. + * Type: {@link OperandType::TENSOR_INT32} + * Shape: [numUnits] + * * 14: The cell bias. Quantized with scale being the + * product of input and weights scales and zeroPoint equal to 0. + * Type: {@link OperandType::TENSOR_INT32} + * Shape: [numUnits] + * * 15: The output gate bias. Quantized with scale being the + * product of input and weights scales and zeroPoint equal to 0. + * Type: {@link OperandType::TENSOR_INT32} + * Shape: [numUnits] + * * 16: The projection weights. Optional. + * Type: {@link OperandType::TENSOR_QUANT8_SYMM} + * Shape: [outputSize, numUnits] + * * 17: The projection bias. Quantized with scale being the + * product of input and weights scales and zeroPoint equal to 0. + * Optional. + * Type: {@link OperandType::TENSOR_INT32} + * Shape: [outputSize] + * * 18: The output from the previous time step. + * Type: {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * Shape: [batchSize, outputSize] + * * 19: The cell state from the previous time step. + * Type: {@link OperandType::TENSOR_QUANT16_SYMM} + * Shape: [batchSize, numUnits] + * * 20: The input layer normalization weights. Used to rescale + * normalized inputs to activation at input gate. Optional. + * Type: {@link OperandType::TENSOR_QUANT16_SYMM} + * Shape: [numUnits] + * * 21: The forget layer normalization weights. Used to + * rescale normalized inputs to activation at forget gate. Optional. + * Type: {@link OperandType::TENSOR_QUANT16_SYMM} + * Shape: [numUnits] + * * 22: The cell layer normalization weights. Used to rescale + * normalized inputs to activation at cell gate. Optional. + * Type: {@link OperandType::TENSOR_QUANT16_SYMM} + * Shape: [numUnits] + * * 23: The output layer normalization weights. Used to + * rescale normalized inputs to activation at output gate. Optional. + * Type: {@link OperandType::TENSOR_QUANT16_SYMM} + * Shape: [numUnits] + * * 24: The cell clip. If provided the cell state is clipped + * by this value prior to the cell output activation. Optional. + * Type: {@link OperandType::FLOAT32}. + * * 25: The projection clip. If provided and projection is enabled, + * this is used for clipping the projected values. Optional. + * Type: {@link OperandType::FLOAT32}. + * * 26: The scale of the intermediate result of matmul, + * i.e. input to layer normalization, at input gate. + * Type: {@link OperandType::FLOAT32}. + * * 27: The scale of the intermediate result of matmul, + * i.e. input to layer normalization, at forget gate. + * Type: {@link OperandType::FLOAT32}. + * * 28: The scale of the intermediate result of matmul, + * i.e. input to layer normalization, at cell gate. + * Type: {@link OperandType::FLOAT32}. + * * 29: The scale of the intermediate result of matmul, + * i.e. input to layer normalization, at output gate. + * Type: {@link OperandType::FLOAT32}. + * * 30: The zero point of the hidden state, i.e. input to + * projection. + * Type: {@link OperandType::INT32}. + * * 31: The scale of the hidden state, i.e. input to + * projection. + * Type: {@link OperandType::FLOAT32}. + * + * Outputs: + * * 0: The output state (out). + * Type: {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * Shape: [batchSize, outputSize] + * * 1: The cell state (out). + * Type: {@link OperandType::TENSOR_QUANT16_SYMM} + * Shape: [batchSize, numUnits] + * * 2: The output. This is effectively the same as the current + * "output state (out)" value. + * Type: {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * Shape: [batchSize, outputSize] + */ + QUANTIZED_LSTM = 95, + /** + * Executes one of the two referenced subgraphs as determined by a boolean + * value. + * + * The inputs and outputs of the two referenced subgraphs must agree with the + * signature of this operation. That is, if the operation has (3 + n) inputs + * and m outputs, both subgraphs must have n inputs and m outputs with the same + * types, ranks, dimensions, scales, + * zeroPoints, and extraParams as the corresponding operation + * inputs and outputs. + * All of the operands mentioned must have fully specified dimensions. + * + * Inputs: + * * 0: A value of type {@link OperandType::TENSOR_BOOL8} and shape [1] + * that determines which of the two referenced subgraphs to execute. + * The operand must have fully specified dimensions. + * * 1: A {@link OperandType::SUBGRAPH} reference to the subgraph to be + * executed if the condition is true. + * * 2: A {@link OperandType::SUBGRAPH} reference to the subgraph to be + * executed if the condition is false. + * * 3 ~ (n + 2): Inputs to be passed to the subgraph selected for execution. + * + * Outputs: + * * 0 ~ (m - 1): Outputs produced by the selected subgraph. + */ + IF = 96, + /** + * Executes the body subgraph until the condition subgraph outputs false. + * + * The inputs to this operation are the condition subgraph, the body subgraph, + * and operand values for the first iteration of the loop. The values are + * implicitly split into three groups of input-output, state-only, and + * input-only values, as described below. + * + * The outputs of this operation are the final values of input-output + * operands. + * + * Both the condition and body subgraph receive (m + k + n) inputs. + * * The first m (m >= 1) inputs are input-output operands. For the first + * iteration, these are initialized from the corresponding inputs of the + * WHILE operation. In subsequent iterations, their values come from the + * corresponding outputs of the body subgraph produced during the previous + * iteration. + * * The next k (k >= 0) inputs are state-only operands. They are similar to + * the input-output operands, except that their values are no longer + * available after the loop terminates. + * * The last n (n >= 0) inputs are input-only operands. Their values come + * from the corresponding inputs of the WHILE operation. + * + * The body subgraph produces (m + k) outputs. + * * The first m outputs are input-output operands. They become the outputs + * of the WHILE operation when a termination condition is reached. + * * The last k outputs are state-only operands. Their values are no longer + * available after the loop terminates. + * + * The numbers m, k, and n are inferred by the driver as follows: + * m = (WHILE operation output count) + * k = (body subgraph output count) - m + * n = (body subgraph input count) - m - k + * + * The pseudo-code below illustrates the flow of a WHILE operation with + * inputs condition, body, initial_input_output, initial_state, input_only + * (m = 1, k = 1, n = 1): + * + * input_output = initial_input_output + * state = initial_state + * while condition(input_output, state, input_only): + * input_output, state = body(input_output, state, input_only) + * return input_output + * + * Inputs: + * * 0: A {@link OperandType::SUBGRAPH} reference to the condition + * subgraph. The subgraph must have (m + k + n) inputs with + * the same types, ranks, dimensions, + * scales, zeroPoints, and extraParams as the + * corresponding inputs of the WHILE operation and exactly one output + * of {@link OperandType::TENSOR_BOOL8} and shape [1]. + * All of the operands mentioned must have fully specified dimensions. + * * 1: A {@link OperandType::SUBGRAPH} reference to the body subgraph. + * The subgraph must have (m + k + n) inputs and (m + k) outputs with + * the same types, ranks, dimensions, + * scales, zeroPoints, and extraParams as the + * corresponding inputs and outputs of the WHILE operation. + * All of the operands mentioned must have fully specified dimensions. + * * (m inputs): Initial values for input-output operands. + * * (k inputs): Initial values for state-only operands. + * * (n inputs): Values for input-only operands. + * + * Outputs: + * * 0 ~ (m - 1): Outputs produced by the loop. + */ + WHILE = 97, + /** + * Computes exponential linear activation on the input tensor element-wise. + * + * The output is calculated using the following formula: + * + * ELU(x) = max(0, x) + min(0, alpha * (exp(x) - 1)) + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: A tensor, specifying the input. May be zero-sized. + * * 1: A scalar, specifying the alpha parameter. + * For input tensor of {@link OperandType::TENSOR_FLOAT16}, + * the alpha value must be of {@link OperandType::FLOAT16}. + * For input tensor of {@link OperandType::TENSOR_FLOAT32}, + * the alpha value must be of {@link OperandType::FLOAT32}. + * + * Outputs: + * * 0: The output tensor of same shape and type as input0. + */ + ELU = 98, + /** + * Computes hard-swish activation on the input tensor element-wise. + * + * Hard swish activation is introduced in + * https://arxiv.org/pdf/1905.02244.pdf + * + * The output is calculated using the following formula: + * + * h-swish(x) = x * max(0, min(6, (x + 3))) / 6 + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: A tensor, specifying the input. May be zero-sized. + * + * Outputs: + * * 0: The output tensor of same shape and type as input0. + * Scale and zero point of this tensor may be different from the input + * tensor's parameters. + */ + HARD_SWISH = 99, + /** + * Creates a tensor filled with a scalar value. + * + * Supported output tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: A 1-D tensor, specifying the desired output tensor shape. + * * 1: A scalar, specifying the value to fill the output tensors with. + * For output tensor of {@link OperandType::TENSOR_FLOAT16}, + * the scalar must be of {@link OperandType::FLOAT16}. + * For output tensor of {@link OperandType::TENSOR_FLOAT32}, + * the scalar must be of {@link OperandType::FLOAT32}. + * For output tensor of {@link OperandType::TENSOR_INT32}, + * the scalar must be of {@link OperandType::INT32}. + * + * Outputs: + * * 0: The output tensor. + */ + FILL = 100, + /** + * Returns the rank of a tensor. + * + * The rank of a tensor is the number of dimensions in it. Also known as + * "order", "degree", "ndims". + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_INT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT16_SYMM} + * * {@link OperandType::TENSOR_BOOL8} + * * {@link OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL} + * * {@link OperandType::TENSOR_QUANT16_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_SYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: The input tensor. + * + * Outputs: + * * 0: A scalar of {@link OperandType::INT32}, specifying the rank + * of the input tensor. + */ + RANK = 101, +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/OutputShape.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/OutputShape.aidl new file mode 100644 index 0000000000..d206a2559c --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/OutputShape.aidl @@ -0,0 +1,33 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * Describes the shape information of an output operand after execution. + */ +@VintfStability +parcelable OutputShape { + /** + * Dimensions of the operand. + */ + int[] dimensions; + /** + * Whether the provided buffer size is sufficient for the output. + */ + boolean isSufficient; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/PerformanceInfo.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/PerformanceInfo.aidl new file mode 100644 index 0000000000..6ee29c2502 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/PerformanceInfo.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * Performance information for the reference workload. + * + * Used by a driver to report its performance characteristics. + */ +@VintfStability +parcelable PerformanceInfo { + /** + * Ratio of the time taken by the driver to execute the workload compared to the time the CPU + * would take for the same workload. A lower number is better. + */ + float execTime; + /** + * Ratio of the energy used by the driver compared to what the CPU would use for doing the same + * workload. A lower number is better. + */ + float powerUsage; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/Priority.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/Priority.aidl new file mode 100644 index 0000000000..fe87598829 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/Priority.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * Priority given to a prepared model for execution. + */ +@VintfStability +@Backing(type="int") +enum Priority { + LOW, + MEDIUM, + HIGH, +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/Request.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/Request.aidl new file mode 100644 index 0000000000..396ff30758 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/Request.aidl @@ -0,0 +1,55 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.RequestArgument; +import android.hardware.neuralnetworks.RequestMemoryPool; + +/** + * Inputs to be sent to and outputs to be retrieved from a prepared model. + * + * A Request serves two primary tasks: + * 1) Provides the input and output data to be used when executing the model. + * 2) Specifies any updates to the input operand metadata that were left unspecified at model + * preparation time. + * + * An output must not overlap with any other output, with an input, or with an operand of lifetime + * CONSTANT_POOL. + */ +@VintfStability +parcelable Request { + /** + * Input data and information to be used in the execution of a prepared model. + * + * The index of the input corresponds to the index in Model.main.inputIndexes. + * E.g., input[i] corresponds to Model.main.inputIndexes[i]. + */ + RequestArgument[] inputs; + /** + * Output data and information to be used in the execution of a prepared model. + * + * The index of the output corresponds to the index in Model.main.outputIndexes. + * E.g., output[i] corresponds to Model.main.outputIndexes[i]. + */ + RequestArgument[] outputs; + /** + * A collection of memory pools containing operand data for both the inputs and the outputs to a + * model. + */ + RequestMemoryPool[] pools; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/RequestArgument.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/RequestArgument.aidl new file mode 100644 index 0000000000..e615fa62b1 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/RequestArgument.aidl @@ -0,0 +1,53 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.DataLocation; + +/** + * Metadata information specifying the location of the input or output data and any updates to the + * input or output operand. + */ +@VintfStability +parcelable RequestArgument { + /** + * If true, the argument does not have a value. This can be used for operations that take + * optional arguments. If true, the fields of location are set to 0 and the dimensions vector is + * left empty. + */ + boolean hasNoValue; + /** + * The location within one of the memory pools passed in the Request. + */ + DataLocation location; + /** + * Updated dimension information. + * + * If dimensions.size() > 0, dimension information was provided along with the argument. This + * can be the case for models that accept inputs of varying size. This can't change the rank, + * just the value of the dimensions that were unspecified in the model. If dimensions.size() > + * 0, then all dimensions must be specified here; and any dimension that was specified in the + * model must have the same value here. + * + * If the dimensions in the model are not fully specified, then they must be fully specified + * here, unless hasNoValue is set to true. If the dimensions in the model are fully specified, + * then either dimensions.size() may be 0, or the dimensions in the model must be identical to + * the dimensions here. + */ + int[] dimensions; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/RequestMemoryPool.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/RequestMemoryPool.aidl new file mode 100644 index 0000000000..166746d388 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/RequestMemoryPool.aidl @@ -0,0 +1,36 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.Memory; + +/** + * A memory pool. + */ +@VintfStability +union RequestMemoryPool { + /** + * Specifies a client-managed shared memory pool. + */ + Memory pool; + /** + * Specifies a driver-managed buffer. It is the token returned from IDevice::allocate, and is + * specific to the IDevice object. + */ + int token; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/Subgraph.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/Subgraph.aidl new file mode 100644 index 0000000000..0a76285fca --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/Subgraph.aidl @@ -0,0 +1,51 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.Operand; +import android.hardware.neuralnetworks.Operation; + +/** + * An excerpt of the execution graph. + */ +@VintfStability +parcelable Subgraph { + /** + * All operands included in the subgraph. + */ + Operand[] operands; + /** + * All operations included in the subgraph. + * + * The operations are sorted into execution order. Every operand with lifetime SUBGRAPH_OUTPUT + * or TEMPORARY_VARIABLE must be written before it is read. + */ + Operation[] operations; + /** + * Input indexes of the subgraph. There must be at least one. + * + * Each value corresponds to the index of the operand in "operands". + */ + int[] inputIndexes; + /** + * Output indexes of the subgraph. There must be at least one. + * + * Each value corresponds to the index of the operand in "operands". + */ + int[] outputIndexes; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl new file mode 100644 index 0000000000..8ae41a4d3e --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl @@ -0,0 +1,33 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * Parameters for TENSOR_QUANT8_SYMM_PER_CHANNEL operand. + */ +@VintfStability +parcelable SymmPerChannelQuantParams { + /** + * Array of scaling values for each channel. Each value must be greater than zero. + */ + float[] scales; + /** + * Index of the channel dimension + */ + int channelDim; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/Timing.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/Timing.aidl new file mode 100644 index 0000000000..b04f74e4ee --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/Timing.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + + +package android.hardware.neuralnetworks; + +/** + * Timing information measured during execution. Each time is a duration from the beginning of some + * task to the end of that task, including time when that task is not active (for example, preempted + * by some other task, or waiting for some resource to become available). + * + * Times are measured in nanoseconds. When a time is not available, it must be reported as -1. + */ +@VintfStability +parcelable Timing { + /** + * Execution time on device (not driver, which runs on host processor). + */ + long timeOnDevice; + /** + * Execution time in driver (including time on device). + */ + long timeInDriver; +} -- GitLab From b4d97bdb0e969465b5fead9db71b6300996fa562 Mon Sep 17 00:00:00 2001 From: Hongbo Zeng Date: Thu, 21 Jan 2021 17:23:45 +0800 Subject: [PATCH 003/825] Update HAL 1.6 for 5G Slicing - add trafficDescriptor and matchAllRuleAllowed to setupDataCall - add trafficDescriptors to SetupDataCallResult - create structs TrafficDescriptor and OSAppId base on the definition in TS 24.526 Section 5.2 - add MATCH_ALL_RULE_NOT_ALLOWED and ALL_MATCHING_RULES_FAILED as DataCallFailCause Bug: 178075054 Test: make VtsHalRadioV1_6TargetTest Change-Id: I18d25a104e803c08cdfba961153b71a4a661fd2f --- radio/1.6/IRadio.hal | 15 +++- radio/1.6/types.hal | 71 ++++++++++++++++ .../1.6/vts/functional/radio_hidl_hal_api.cpp | 83 ++++++++++++++++++- .../functional/radio_hidl_hal_utils_v1_6.h | 1 + radio/1.6/vts/functional/radio_response.cpp | 3 +- 5 files changed, 170 insertions(+), 3 deletions(-) diff --git a/radio/1.6/IRadio.hal b/radio/1.6/IRadio.hal index 1862800f5e..e770a5d26c 100644 --- a/radio/1.6/IRadio.hal +++ b/radio/1.6/IRadio.hal @@ -120,6 +120,18 @@ interface IRadio extends @1.5::IRadio { * @param sliceInfo SliceInfo to be used for the data connection when a handover occurs from * EPDG to 5G. It is valid only when accessNetwork is AccessNetwork:NGRAN. If the slice * passed from EPDG is rejected, then the data failure cause must be DataCallFailCause:SLICE_REJECTED. + * @param trafficDescriptor TrafficDescriptor for which data connection needs to be + * established. It is used for URSP traffic matching as described in TS 24.526 + * Section 4.2.2. It includes an optional DNN which, if present, must be used for traffic + * matching -- it does not specify the end point to be used for the data call. The end + * point is specified by DataProfileInfo.apn; DataProfileInfo.apn must be used as the end + * point if one is not specified through URSP rules. + * @param matchAllRuleAllowed bool to indicate if using default match-all URSP rule for this + * request is allowed. If false, this request must not use the match-all URSP rule and if + * a non-match-all rule is not found (or if URSP rules are not available) it should return + * failure with cause DataCallFailCause:MATCH_ALL_RULE_NOT_ALLOWED. This is needed as some + * requests need to have a hard failure if the intention cannot be met, for example, a + * zero-rating slice. * * Response function is IRadioResponse.setupDataCallResponse_1_6() * @@ -128,7 +140,8 @@ interface IRadio extends @1.5::IRadio { oneway setupDataCall_1_6(int32_t serial, AccessNetwork accessNetwork, DataProfileInfo dataProfileInfo, bool roamingAllowed, DataRequestReason reason, vec addresses, vec dnses, - int32_t pduSessionId, OptionalSliceInfo sliceInfo); + int32_t pduSessionId, OptionalSliceInfo sliceInfo, + OptionalTrafficDescriptor trafficDescriptor, bool matchAllRuleAllowed); /** * Send an SMS message diff --git a/radio/1.6/types.hal b/radio/1.6/types.hal index 4eaf7be821..a6de033d20 100644 --- a/radio/1.6/types.hal +++ b/radio/1.6/types.hal @@ -365,6 +365,13 @@ struct SetupDataCallResult { * AccessNetwork:NGRAN. */ OptionalSliceInfo sliceInfo; + + /** + * TrafficDescriptors for which this data call must be used. It only includes + * the TDs for which a data call has been requested so far; it is not an + * exhaustive list. + */ + vec trafficDescriptors; }; /** @@ -824,6 +831,16 @@ enum DataCallFailCause : @1.4::DataCallFailCause { * Data call fail due to the slice not being allowed for the data call. */ SLICE_REJECTED = 0x8CC, + + /** + * No matching rule available for the request, and match-all rule is not allowed for it. + */ + MATCH_ALL_RULE_NOT_ALLOWED = 0x8CD, + + /** + * If connection failed for all matching URSP rules + */ + ALL_MATCHING_RULES_FAILED = 0x8CE, }; struct PhysicalChannelConfig { @@ -892,3 +909,57 @@ enum NgranBands : @1.5::NgranBands { BAND_53 = 53, BAND_96 = 96, }; + +/** + * This safe_union represents an optional DNN. DNN stands for Data Network Name + * and represents an APN as defined in 3GPP TS 23.003. + */ +safe_union OptionalDNN { + Monostate noinit; + string value; +}; + +/** + * This safe_union represents an optional OSAppId. + */ +safe_union OptionalOSAppId { + Monostate noinit; + OSAppId value; +}; + +/** + * This safe_union represents an optional TrafficDescriptor. + */ +safe_union OptionalTrafficDescriptor { + Monostate noinit; + TrafficDescriptor value; +}; + +/** + * 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. + */ +struct TrafficDescriptor { + /** + * DNN stands for Data Network Name and represents an APN as defined in + * 3GPP TS 23.003. + */ + OptionalDNN dnn; + /** + * Indicates the OSId + OSAppId (used as category in Android). + */ + OptionalOSAppId osAppId; +}; + +/** + * This struct represents the OSId + OSAppId as defined in TS 24.526 Section 5.2 + */ +struct OSAppId { + /** + * Byte array representing OSId + OSAppId. The minimum length of the array is + * 18 and maximum length is 272 (16 bytes for OSId + 1 byte for OSAppId length + * + up to 255 bytes for OSAppId). + */ + vec osAppId; +}; diff --git a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp index 8b872921ec..2acec4606d 100644 --- a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp @@ -59,9 +59,88 @@ TEST_P(RadioHidlTest_v1_6, setupDataCall_1_6) { ::android::hardware::radio::V1_6::OptionalSliceInfo optionalSliceInfo; memset(&optionalSliceInfo, 0, sizeof(optionalSliceInfo)); + ::android::hardware::radio::V1_6::OptionalTrafficDescriptor optionalTrafficDescriptor; + memset(&optionalTrafficDescriptor, 0, sizeof(optionalTrafficDescriptor)); + + bool matchAllRuleAllowed = true; + + Return res = + radio_v1_6->setupDataCall_1_6(serial, accessNetwork, dataProfileInfo, roamingAllowed, + reason, addresses, dnses, -1, optionalSliceInfo, + optionalTrafficDescriptor, matchAllRuleAllowed); + ASSERT_OK(res); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type); + EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial); + if (cardStatus.base.base.base.cardState == CardState::ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_v1_6->rspInfo.error, + {::android::hardware::radio::V1_6::RadioError::SIM_ABSENT, + ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, + ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); + } else if (cardStatus.base.base.base.cardState == CardState::PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_v1_6->rspInfo.error, + {::android::hardware::radio::V1_6::RadioError::NONE, + ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, + ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); + } +} + +TEST_P(RadioHidlTest_v1_6, setupDataCall_1_6_osAppId) { + serial = GetRandomSerialNumber(); + + ::android::hardware::radio::V1_5::AccessNetwork accessNetwork = + ::android::hardware::radio::V1_5::AccessNetwork::EUTRAN; + + android::hardware::radio::V1_5::DataProfileInfo dataProfileInfo; + memset(&dataProfileInfo, 0, sizeof(dataProfileInfo)); + dataProfileInfo.profileId = DataProfileId::DEFAULT; + dataProfileInfo.apn = hidl_string("internet"); + dataProfileInfo.protocol = PdpProtocolType::IP; + dataProfileInfo.roamingProtocol = PdpProtocolType::IP; + dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP; + dataProfileInfo.user = hidl_string("username"); + dataProfileInfo.password = hidl_string("password"); + dataProfileInfo.type = DataProfileInfoType::THREE_GPP; + dataProfileInfo.maxConnsTime = 300; + dataProfileInfo.maxConns = 20; + dataProfileInfo.waitTime = 0; + dataProfileInfo.enabled = true; + dataProfileInfo.supportedApnTypesBitmap = 320; + dataProfileInfo.bearerBitmap = 161543; + dataProfileInfo.mtuV4 = 0; + dataProfileInfo.mtuV6 = 0; + dataProfileInfo.preferred = true; + dataProfileInfo.persistent = false; + + bool roamingAllowed = false; + + std::vector<::android::hardware::radio::V1_5::LinkAddress> addresses = {}; + std::vector dnses = {}; + + ::android::hardware::radio::V1_2::DataRequestReason reason = + ::android::hardware::radio::V1_2::DataRequestReason::NORMAL; + + ::android::hardware::radio::V1_6::OptionalSliceInfo optionalSliceInfo; + memset(&optionalSliceInfo, 0, sizeof(optionalSliceInfo)); + + ::android::hardware::radio::V1_6::OptionalTrafficDescriptor optionalTrafficDescriptor; + memset(&optionalTrafficDescriptor, 0, sizeof(optionalTrafficDescriptor)); + + ::android::hardware::radio::V1_6::TrafficDescriptor trafficDescriptor; + ::android::hardware::radio::V1_6::OSAppId osAppId; + osAppId.osAppId = 1; + trafficDescriptor.osAppId.value(osAppId); + optionalTrafficDescriptor.value(trafficDescriptor); + + bool matchAllRuleAllowed = true; + Return res = radio_v1_6->setupDataCall_1_6(serial, accessNetwork, dataProfileInfo, roamingAllowed, - reason, addresses, dnses, -1, optionalSliceInfo); + reason, addresses, dnses, -1, optionalSliceInfo, + optionalTrafficDescriptor, matchAllRuleAllowed); ASSERT_OK(res); EXPECT_EQ(std::cv_status::no_timeout, wait()); @@ -79,6 +158,8 @@ TEST_P(RadioHidlTest_v1_6, setupDataCall_1_6) { {::android::hardware::radio::V1_6::RadioError::NONE, ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); + EXPECT_EQ(optionalTrafficDescriptor.value().osAppId.value().osAppId, + radioRsp_v1_6->setupDataCallResult.trafficDescriptors[0].osAppId.value().osAppId); } } diff --git a/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h b/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h index 334fec3622..ba2a359c2d 100644 --- a/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h +++ b/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h @@ -88,6 +88,7 @@ class RadioResponse_v1_6 : public ::android::hardware::radio::V1_6::IRadioRespon // Data ::android::hardware::radio::V1_4::DataRegStateResult dataRegResp; + ::android::hardware::radio::V1_6::SetupDataCallResult setupDataCallResult; // SimLock status ::android::hardware::radio::V1_4::CarrierRestrictionsWithPriority carrierRestrictionsResp; diff --git a/radio/1.6/vts/functional/radio_response.cpp b/radio/1.6/vts/functional/radio_response.cpp index 100fabd828..1104328c52 100644 --- a/radio/1.6/vts/functional/radio_response.cpp +++ b/radio/1.6/vts/functional/radio_response.cpp @@ -1050,8 +1050,9 @@ Return RadioResponse_v1_6::setRadioPowerResponse_1_6( Return RadioResponse_v1_6::setupDataCallResponse_1_6( const ::android::hardware::radio::V1_6::RadioResponseInfo& info, - const android::hardware::radio::V1_6::SetupDataCallResult& /* dcResponse */) { + const android::hardware::radio::V1_6::SetupDataCallResult& dcResponse) { rspInfo = info; + setupDataCallResult = dcResponse; parent_v1_6.notify(info.serial); return Void(); } -- GitLab From 1f3ccfc261b242b26529c2a9be3271d1996e1ba4 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Wed, 27 Jan 2021 14:17:45 -0800 Subject: [PATCH 004/825] Extend MessageMutator implementation to multi-message packets. Also, print all messages in a packet, not only the first one. Bug: 177251183 Test: Full Wi-Fi STA TCU test with HU booting before TCU Change-Id: I6449115b98d2a4d4bb11a733090e5230ee76ce2b --- .../1.0/default/libnl++/MessageMutator.cpp | 47 +++++++++++++++++-- .../default/libnl++/include/libnl++/Buffer.h | 2 +- .../libnl++/include/libnl++/MessageMutator.h | 20 +++++++- .../can/1.0/default/libnl++/printer.cpp | 24 ++++++++-- 4 files changed, 83 insertions(+), 10 deletions(-) diff --git a/automotive/can/1.0/default/libnl++/MessageMutator.cpp b/automotive/can/1.0/default/libnl++/MessageMutator.cpp index 00b48a66ae..de2a2b1e47 100644 --- a/automotive/can/1.0/default/libnl++/MessageMutator.cpp +++ b/automotive/can/1.0/default/libnl++/MessageMutator.cpp @@ -19,7 +19,7 @@ namespace android::nl { MessageMutator::MessageMutator(nlmsghdr* buffer, size_t totalLen) - : mConstBuffer(buffer, totalLen), mMutableBuffer(buffer) { + : mMutableBuffer(buffer), mTotalLen(totalLen) { CHECK(totalLen >= sizeof(nlmsghdr)); } @@ -27,8 +27,12 @@ nlmsghdr* MessageMutator::operator->() const { return mMutableBuffer; } +Buffer MessageMutator::constBuffer() const { + return {mMutableBuffer, mTotalLen}; +} + MessageMutator::operator Buffer() const { - return mConstBuffer; + return constBuffer(); } uint64_t MessageMutator::read(Buffer attr) const { @@ -37,7 +41,8 @@ uint64_t MessageMutator::read(Buffer attr) const { void MessageMutator::write(Buffer attr, uint64_t val) const { const auto attrData = attr.data(); - const auto offset = mConstBuffer.getOffset(attrData); + // TODO(b/177251183): deduplicate this code against fragment() + const auto offset = constBuffer().getOffset(attrData); CHECK(offset.has_value()) << "Trying to write attribute that's not a member of this message"; const auto writeableBuffer = reinterpret_cast(mMutableBuffer) + *offset; @@ -47,4 +52,40 @@ void MessageMutator::write(Buffer attr, uint64_t val) const { memcpy(writeableBuffer, &val, std::min(sizeof(val), attrSize)); } +MessageMutator MessageMutator::fragment(Buffer buf) const { + const auto offset = constBuffer().getOffset(buf); + CHECK(offset.has_value()) << "Trying to modify a fragment outside of buffer range"; + + const auto writeableBuffer = reinterpret_cast(uintptr_t(mMutableBuffer) + *offset); + const auto len = buf.getRaw().len(); + CHECK(len <= mTotalLen - *offset); + + return {writeableBuffer, len}; +} + +MessageMutator::iterator MessageMutator::begin() const { + return {*this, constBuffer().begin()}; +} + +MessageMutator::iterator MessageMutator::end() const { + return {*this, constBuffer().end()}; +} + +MessageMutator::iterator::iterator(const MessageMutator& container, + Buffer::iterator current) + : mContainer(container), mCurrent(current) {} + +MessageMutator::iterator MessageMutator::iterator::operator++() { + ++mCurrent; + return *this; +} + +bool MessageMutator::iterator::operator==(const iterator& other) const { + return other.mCurrent == mCurrent; +} + +const MessageMutator MessageMutator::iterator::operator*() const { + return mContainer.fragment(*mCurrent); +} + } // namespace android::nl diff --git a/automotive/can/1.0/default/libnl++/include/libnl++/Buffer.h b/automotive/can/1.0/default/libnl++/include/libnl++/Buffer.h index d759a0a570..4cabb9af87 100644 --- a/automotive/can/1.0/default/libnl++/include/libnl++/Buffer.h +++ b/automotive/can/1.0/default/libnl++/include/libnl++/Buffer.h @@ -138,7 +138,7 @@ class Buffer { class raw_iterator : public iterator { public: iterator operator++() { - this->mCurrent.mData++; // ignore alignment + ++this->mCurrent.mData; // ignore alignment return *this; } const T& operator*() const { return *this->mCurrent.mData; } diff --git a/automotive/can/1.0/default/libnl++/include/libnl++/MessageMutator.h b/automotive/can/1.0/default/libnl++/include/libnl++/MessageMutator.h index 7d495e9a5b..baadc44689 100644 --- a/automotive/can/1.0/default/libnl++/include/libnl++/MessageMutator.h +++ b/automotive/can/1.0/default/libnl++/include/libnl++/MessageMutator.h @@ -53,9 +53,27 @@ class MessageMutator { */ void write(Buffer attr, uint64_t val) const; + class iterator { + public: + iterator(const MessageMutator& container, Buffer::iterator current); + + iterator operator++(); + bool operator==(const iterator& other) const; + const MessageMutator operator*() const; + + protected: + const MessageMutator& mContainer; + Buffer::iterator mCurrent; + }; + iterator begin() const; + iterator end() const; + private: - const Buffer mConstBuffer; nlmsghdr* mMutableBuffer; + size_t mTotalLen; + + Buffer constBuffer() const; + MessageMutator fragment(Buffer buf) const; }; } // namespace android::nl diff --git a/automotive/can/1.0/default/libnl++/printer.cpp b/automotive/can/1.0/default/libnl++/printer.cpp index f08897e951..d5404825b8 100644 --- a/automotive/can/1.0/default/libnl++/printer.cpp +++ b/automotive/can/1.0/default/libnl++/printer.cpp @@ -154,16 +154,19 @@ static void toStream(std::stringstream& ss, const Buffer attr, } } -std::string toString(const Buffer hdr, int protocol, bool printPayload) { - if (!hdr.firstOk()) return "nlmsg{buffer overflow}"; +static void toStream(std::stringstream& ss, const Buffer hdr, int protocol, + bool printPayload) { + if (!hdr.firstOk()) { + ss << "nlmsg{buffer overflow}"; + return; + } - std::stringstream ss; ss << std::setfill('0'); auto protocolMaybe = protocols::get(protocol); if (!protocolMaybe.has_value()) { ss << "nlmsg{protocol=" << protocol << "}"; - return ss.str(); + return; } protocols::NetlinkProtocol& protocolDescr = *protocolMaybe; @@ -187,7 +190,7 @@ std::string toString(const Buffer hdr, int protocol, bool printPayload ss << ", crc=" << std::hex << std::setw(4) << crc16(hdr.data()) << std::dec; ss << '}'; - if (!printPayload) return ss.str(); + if (!printPayload) return; ss << ' '; if (!msgDescMaybe.has_value()) { @@ -210,6 +213,17 @@ std::string toString(const Buffer hdr, int protocol, bool printPayload } ss << "}"; +} + +std::string toString(const Buffer hdrs, int protocol, bool printPayload) { + std::stringstream ss; + bool first = true; + for (const auto hdr : hdrs) { + if (!first) ss << std::endl; + first = false; + + toStream(ss, hdr, protocol, printPayload); + } return ss.str(); } -- GitLab From 9d5f23a0d3c947d82615cdda065dc07773978a85 Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Mon, 1 Feb 2021 03:45:57 +0000 Subject: [PATCH 005/825] Revert "Update HAL 1.6 for 5G Slicing" Revert "Update ril_service in cuttlefish for 5G Slicing" Revert "Update framework for 5G Slicing" Revert submission 13372384-5g_slicing_master Reason for revert: Broken build: b/178985315 Reverted Changes: Ie2af7642d:Update ril_service in cuttlefish for 5G Slicing Ia81414769:Update framework for 5G Slicing I18d25a104:Update HAL 1.6 for 5G Slicing Change-Id: I3ba332c95bed611ec24be440ce5d6a0e8b0b6a66 --- radio/1.6/IRadio.hal | 15 +--- radio/1.6/types.hal | 71 ---------------- .../1.6/vts/functional/radio_hidl_hal_api.cpp | 83 +------------------ .../functional/radio_hidl_hal_utils_v1_6.h | 1 - radio/1.6/vts/functional/radio_response.cpp | 3 +- 5 files changed, 3 insertions(+), 170 deletions(-) diff --git a/radio/1.6/IRadio.hal b/radio/1.6/IRadio.hal index e770a5d26c..1862800f5e 100644 --- a/radio/1.6/IRadio.hal +++ b/radio/1.6/IRadio.hal @@ -120,18 +120,6 @@ interface IRadio extends @1.5::IRadio { * @param sliceInfo SliceInfo to be used for the data connection when a handover occurs from * EPDG to 5G. It is valid only when accessNetwork is AccessNetwork:NGRAN. If the slice * passed from EPDG is rejected, then the data failure cause must be DataCallFailCause:SLICE_REJECTED. - * @param trafficDescriptor TrafficDescriptor for which data connection needs to be - * established. It is used for URSP traffic matching as described in TS 24.526 - * Section 4.2.2. It includes an optional DNN which, if present, must be used for traffic - * matching -- it does not specify the end point to be used for the data call. The end - * point is specified by DataProfileInfo.apn; DataProfileInfo.apn must be used as the end - * point if one is not specified through URSP rules. - * @param matchAllRuleAllowed bool to indicate if using default match-all URSP rule for this - * request is allowed. If false, this request must not use the match-all URSP rule and if - * a non-match-all rule is not found (or if URSP rules are not available) it should return - * failure with cause DataCallFailCause:MATCH_ALL_RULE_NOT_ALLOWED. This is needed as some - * requests need to have a hard failure if the intention cannot be met, for example, a - * zero-rating slice. * * Response function is IRadioResponse.setupDataCallResponse_1_6() * @@ -140,8 +128,7 @@ interface IRadio extends @1.5::IRadio { oneway setupDataCall_1_6(int32_t serial, AccessNetwork accessNetwork, DataProfileInfo dataProfileInfo, bool roamingAllowed, DataRequestReason reason, vec addresses, vec dnses, - int32_t pduSessionId, OptionalSliceInfo sliceInfo, - OptionalTrafficDescriptor trafficDescriptor, bool matchAllRuleAllowed); + int32_t pduSessionId, OptionalSliceInfo sliceInfo); /** * Send an SMS message diff --git a/radio/1.6/types.hal b/radio/1.6/types.hal index a6de033d20..4eaf7be821 100644 --- a/radio/1.6/types.hal +++ b/radio/1.6/types.hal @@ -365,13 +365,6 @@ struct SetupDataCallResult { * AccessNetwork:NGRAN. */ OptionalSliceInfo sliceInfo; - - /** - * TrafficDescriptors for which this data call must be used. It only includes - * the TDs for which a data call has been requested so far; it is not an - * exhaustive list. - */ - vec trafficDescriptors; }; /** @@ -831,16 +824,6 @@ enum DataCallFailCause : @1.4::DataCallFailCause { * Data call fail due to the slice not being allowed for the data call. */ SLICE_REJECTED = 0x8CC, - - /** - * No matching rule available for the request, and match-all rule is not allowed for it. - */ - MATCH_ALL_RULE_NOT_ALLOWED = 0x8CD, - - /** - * If connection failed for all matching URSP rules - */ - ALL_MATCHING_RULES_FAILED = 0x8CE, }; struct PhysicalChannelConfig { @@ -909,57 +892,3 @@ enum NgranBands : @1.5::NgranBands { BAND_53 = 53, BAND_96 = 96, }; - -/** - * This safe_union represents an optional DNN. DNN stands for Data Network Name - * and represents an APN as defined in 3GPP TS 23.003. - */ -safe_union OptionalDNN { - Monostate noinit; - string value; -}; - -/** - * This safe_union represents an optional OSAppId. - */ -safe_union OptionalOSAppId { - Monostate noinit; - OSAppId value; -}; - -/** - * This safe_union represents an optional TrafficDescriptor. - */ -safe_union OptionalTrafficDescriptor { - Monostate noinit; - TrafficDescriptor value; -}; - -/** - * 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. - */ -struct TrafficDescriptor { - /** - * DNN stands for Data Network Name and represents an APN as defined in - * 3GPP TS 23.003. - */ - OptionalDNN dnn; - /** - * Indicates the OSId + OSAppId (used as category in Android). - */ - OptionalOSAppId osAppId; -}; - -/** - * This struct represents the OSId + OSAppId as defined in TS 24.526 Section 5.2 - */ -struct OSAppId { - /** - * Byte array representing OSId + OSAppId. The minimum length of the array is - * 18 and maximum length is 272 (16 bytes for OSId + 1 byte for OSAppId length - * + up to 255 bytes for OSAppId). - */ - vec osAppId; -}; diff --git a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp index 2acec4606d..8b872921ec 100644 --- a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp @@ -59,88 +59,9 @@ TEST_P(RadioHidlTest_v1_6, setupDataCall_1_6) { ::android::hardware::radio::V1_6::OptionalSliceInfo optionalSliceInfo; memset(&optionalSliceInfo, 0, sizeof(optionalSliceInfo)); - ::android::hardware::radio::V1_6::OptionalTrafficDescriptor optionalTrafficDescriptor; - memset(&optionalTrafficDescriptor, 0, sizeof(optionalTrafficDescriptor)); - - bool matchAllRuleAllowed = true; - - Return res = - radio_v1_6->setupDataCall_1_6(serial, accessNetwork, dataProfileInfo, roamingAllowed, - reason, addresses, dnses, -1, optionalSliceInfo, - optionalTrafficDescriptor, matchAllRuleAllowed); - ASSERT_OK(res); - - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type); - EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial); - if (cardStatus.base.base.base.cardState == CardState::ABSENT) { - ASSERT_TRUE(CheckAnyOfErrors( - radioRsp_v1_6->rspInfo.error, - {::android::hardware::radio::V1_6::RadioError::SIM_ABSENT, - ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, - ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); - } else if (cardStatus.base.base.base.cardState == CardState::PRESENT) { - ASSERT_TRUE(CheckAnyOfErrors( - radioRsp_v1_6->rspInfo.error, - {::android::hardware::radio::V1_6::RadioError::NONE, - ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, - ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); - } -} - -TEST_P(RadioHidlTest_v1_6, setupDataCall_1_6_osAppId) { - serial = GetRandomSerialNumber(); - - ::android::hardware::radio::V1_5::AccessNetwork accessNetwork = - ::android::hardware::radio::V1_5::AccessNetwork::EUTRAN; - - android::hardware::radio::V1_5::DataProfileInfo dataProfileInfo; - memset(&dataProfileInfo, 0, sizeof(dataProfileInfo)); - dataProfileInfo.profileId = DataProfileId::DEFAULT; - dataProfileInfo.apn = hidl_string("internet"); - dataProfileInfo.protocol = PdpProtocolType::IP; - dataProfileInfo.roamingProtocol = PdpProtocolType::IP; - dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP; - dataProfileInfo.user = hidl_string("username"); - dataProfileInfo.password = hidl_string("password"); - dataProfileInfo.type = DataProfileInfoType::THREE_GPP; - dataProfileInfo.maxConnsTime = 300; - dataProfileInfo.maxConns = 20; - dataProfileInfo.waitTime = 0; - dataProfileInfo.enabled = true; - dataProfileInfo.supportedApnTypesBitmap = 320; - dataProfileInfo.bearerBitmap = 161543; - dataProfileInfo.mtuV4 = 0; - dataProfileInfo.mtuV6 = 0; - dataProfileInfo.preferred = true; - dataProfileInfo.persistent = false; - - bool roamingAllowed = false; - - std::vector<::android::hardware::radio::V1_5::LinkAddress> addresses = {}; - std::vector dnses = {}; - - ::android::hardware::radio::V1_2::DataRequestReason reason = - ::android::hardware::radio::V1_2::DataRequestReason::NORMAL; - - ::android::hardware::radio::V1_6::OptionalSliceInfo optionalSliceInfo; - memset(&optionalSliceInfo, 0, sizeof(optionalSliceInfo)); - - ::android::hardware::radio::V1_6::OptionalTrafficDescriptor optionalTrafficDescriptor; - memset(&optionalTrafficDescriptor, 0, sizeof(optionalTrafficDescriptor)); - - ::android::hardware::radio::V1_6::TrafficDescriptor trafficDescriptor; - ::android::hardware::radio::V1_6::OSAppId osAppId; - osAppId.osAppId = 1; - trafficDescriptor.osAppId.value(osAppId); - optionalTrafficDescriptor.value(trafficDescriptor); - - bool matchAllRuleAllowed = true; - Return res = radio_v1_6->setupDataCall_1_6(serial, accessNetwork, dataProfileInfo, roamingAllowed, - reason, addresses, dnses, -1, optionalSliceInfo, - optionalTrafficDescriptor, matchAllRuleAllowed); + reason, addresses, dnses, -1, optionalSliceInfo); ASSERT_OK(res); EXPECT_EQ(std::cv_status::no_timeout, wait()); @@ -158,8 +79,6 @@ TEST_P(RadioHidlTest_v1_6, setupDataCall_1_6_osAppId) { {::android::hardware::radio::V1_6::RadioError::NONE, ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); - EXPECT_EQ(optionalTrafficDescriptor.value().osAppId.value().osAppId, - radioRsp_v1_6->setupDataCallResult.trafficDescriptors[0].osAppId.value().osAppId); } } diff --git a/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h b/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h index ba2a359c2d..334fec3622 100644 --- a/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h +++ b/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h @@ -88,7 +88,6 @@ class RadioResponse_v1_6 : public ::android::hardware::radio::V1_6::IRadioRespon // Data ::android::hardware::radio::V1_4::DataRegStateResult dataRegResp; - ::android::hardware::radio::V1_6::SetupDataCallResult setupDataCallResult; // SimLock status ::android::hardware::radio::V1_4::CarrierRestrictionsWithPriority carrierRestrictionsResp; diff --git a/radio/1.6/vts/functional/radio_response.cpp b/radio/1.6/vts/functional/radio_response.cpp index 1104328c52..100fabd828 100644 --- a/radio/1.6/vts/functional/radio_response.cpp +++ b/radio/1.6/vts/functional/radio_response.cpp @@ -1050,9 +1050,8 @@ Return RadioResponse_v1_6::setRadioPowerResponse_1_6( Return RadioResponse_v1_6::setupDataCallResponse_1_6( const ::android::hardware::radio::V1_6::RadioResponseInfo& info, - const android::hardware::radio::V1_6::SetupDataCallResult& dcResponse) { + const android::hardware::radio::V1_6::SetupDataCallResult& /* dcResponse */) { rspInfo = info; - setupDataCallResult = dcResponse; parent_v1_6.notify(info.serial); return Void(); } -- GitLab From 49b5e4ebea8901f2f190396e59098fc89d10df61 Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Mon, 1 Feb 2021 18:16:14 -0800 Subject: [PATCH 006/825] Add dynamic interface casting to NN utility code Prior to this CL, the NN utility code would always use the type of IPreparedModel provided by IPreparedModeCallback::notify*. This means that an IPreparedModel returned as a dynamic type of V1_X but static type of V1_Y would be used by the utility code as V1_Y. This CL adds dynamic casting, such that an IPreparedModel returned as a dynamic type of V1_X but static type V1_Y will be dynamically cast to V1_X and used as a V1_X::IPreparedModel. This CL also adds the utility functions V1_[0123]::convertFromNonCanonical to convert from a non-canonical type to another non-canonical type by using canonical types as an intermediate conversion "hop." Bug: 178180472 Test: mma Change-Id: I709b2a8944af2cc78b089aade55df1e2ab7b40cc --- .../1.0/utils/include/nnapi/hal/1.0/Utils.h | 6 ++++++ .../1.1/utils/include/nnapi/hal/1.1/Utils.h | 6 ++++++ .../1.2/utils/include/nnapi/hal/1.2/Utils.h | 6 ++++++ neuralnetworks/1.2/utils/src/Callbacks.cpp | 11 ++++++++++- .../1.3/utils/include/nnapi/hal/1.3/Utils.h | 6 ++++++ neuralnetworks/1.3/utils/src/Callbacks.cpp | 19 +++++++++++++++++-- 6 files changed, 51 insertions(+), 3 deletions(-) diff --git a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Utils.h b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Utils.h index 4cec545cf0..b695f48550 100644 --- a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Utils.h +++ b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Utils.h @@ -44,6 +44,12 @@ bool valid(const Type& halObject) { return result.has_value(); } +template +auto convertFromNonCanonical(const Type& nonCanonicalObject) + -> decltype(convert(nn::convert(nonCanonicalObject).value())) { + return convert(NN_TRY(nn::convert(nonCanonicalObject))); +} + } // namespace android::hardware::neuralnetworks::V1_0::utils #endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_0_UTILS_H diff --git a/neuralnetworks/1.1/utils/include/nnapi/hal/1.1/Utils.h b/neuralnetworks/1.1/utils/include/nnapi/hal/1.1/Utils.h index 052d88e922..09597a31f8 100644 --- a/neuralnetworks/1.1/utils/include/nnapi/hal/1.1/Utils.h +++ b/neuralnetworks/1.1/utils/include/nnapi/hal/1.1/Utils.h @@ -47,6 +47,12 @@ bool valid(const Type& halObject) { return result.has_value(); } +template +auto convertFromNonCanonical(const Type& nonCanonicalObject) + -> decltype(convert(nn::convert(nonCanonicalObject).value())) { + return convert(NN_TRY(nn::convert(nonCanonicalObject))); +} + } // namespace android::hardware::neuralnetworks::V1_1::utils #endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_1_UTILS_H diff --git a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Utils.h b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Utils.h index c289fc89ab..323311439f 100644 --- a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Utils.h +++ b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Utils.h @@ -54,6 +54,12 @@ bool valid(const Type& halObject) { return result.has_value(); } +template +auto convertFromNonCanonical(const Type& nonCanonicalObject) + -> decltype(convert(nn::convert(nonCanonicalObject).value())) { + return convert(NN_TRY(nn::convert(nonCanonicalObject))); +} + } // namespace android::hardware::neuralnetworks::V1_2::utils #endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_H diff --git a/neuralnetworks/1.2/utils/src/Callbacks.cpp b/neuralnetworks/1.2/utils/src/Callbacks.cpp index fefa122101..9f54bb12dd 100644 --- a/neuralnetworks/1.2/utils/src/Callbacks.cpp +++ b/neuralnetworks/1.2/utils/src/Callbacks.cpp @@ -43,6 +43,15 @@ namespace android::hardware::neuralnetworks::V1_2::utils { namespace { +nn::GeneralResult prepareModelCallback( + V1_0::ErrorStatus status, const sp& preparedModel) { + if (const auto dynamicPreparedModel = + V1_2::IPreparedModel::castFrom(preparedModel).withDefault(nullptr)) { + return V1_2::utils::prepareModelCallback(status, dynamicPreparedModel); + } + return V1_0::utils::prepareModelCallback(status, preparedModel); +} + nn::GeneralResult, nn::Timing>> convertExecutionGeneralResultsHelper(const hidl_vec& outputShapes, const Timing& timing) { @@ -72,7 +81,7 @@ nn::ExecutionResult, nn::Timing>> executi Return PreparedModelCallback::notify(V1_0::ErrorStatus status, const sp& preparedModel) { - mData.put(V1_0::utils::prepareModelCallback(status, preparedModel)); + mData.put(prepareModelCallback(status, preparedModel)); return Void(); } diff --git a/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Utils.h b/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Utils.h index 29b0c806ff..3ce412cde6 100644 --- a/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Utils.h +++ b/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Utils.h @@ -49,6 +49,12 @@ bool valid(const Type& halObject) { return result.has_value(); } +template +auto convertFromNonCanonical(const Type& nonCanonicalObject) + -> decltype(convert(nn::convert(nonCanonicalObject).value())) { + return convert(NN_TRY(nn::convert(nonCanonicalObject))); +} + } // namespace android::hardware::neuralnetworks::V1_3::utils #endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_H diff --git a/neuralnetworks/1.3/utils/src/Callbacks.cpp b/neuralnetworks/1.3/utils/src/Callbacks.cpp index af76e6a87e..8e9fb833b1 100644 --- a/neuralnetworks/1.3/utils/src/Callbacks.cpp +++ b/neuralnetworks/1.3/utils/src/Callbacks.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +47,20 @@ namespace android::hardware::neuralnetworks::V1_3::utils { namespace { +nn::GeneralResult prepareModelCallback( + V1_0::ErrorStatus status, const sp& preparedModel) { + if (const auto dynamicPreparedModel = + V1_3::IPreparedModel::castFrom(preparedModel).withDefault(nullptr)) { + const auto currentVersionStatus = NN_TRY(convertFromNonCanonical(status)); + return V1_3::utils::prepareModelCallback(currentVersionStatus, dynamicPreparedModel); + } + if (const auto dynamicPreparedModel = + V1_2::IPreparedModel::castFrom(preparedModel).withDefault(nullptr)) { + return V1_2::utils::prepareModelCallback(status, dynamicPreparedModel); + } + return V1_0::utils::prepareModelCallback(status, preparedModel); +} + nn::GeneralResult, nn::Timing>> convertExecutionGeneralResultsHelper(const hidl_vec& outputShapes, const V1_2::Timing& timing) { @@ -82,13 +97,13 @@ nn::ExecutionResult, nn::Timing>> executi Return PreparedModelCallback::notify(V1_0::ErrorStatus status, const sp& preparedModel) { - mData.put(V1_0::utils::prepareModelCallback(status, preparedModel)); + mData.put(prepareModelCallback(status, preparedModel)); return Void(); } Return PreparedModelCallback::notify_1_2(V1_0::ErrorStatus status, const sp& preparedModel) { - mData.put(V1_2::utils::prepareModelCallback(status, preparedModel)); + mData.put(prepareModelCallback(status, preparedModel)); return Void(); } -- GitLab From 532136b9d42e22a9c8280b8c62a3f5e91822e5b6 Mon Sep 17 00:00:00 2001 From: Lev Proleev Date: Wed, 11 Nov 2020 18:28:50 +0000 Subject: [PATCH 007/825] Add utils for AIDL types conversions Add conversions between canonical types and NNAPI AIDL interface types that are needed for AIDL sample driver implementation. Bug: 172922059 Test: VtsNeuralnetworksTargetTest Change-Id: I02803302e02457e52c752114b47b94239eff20e9 --- neuralnetworks/aidl/Android.bp | 8 + neuralnetworks/aidl/utils/Android.bp | 32 + neuralnetworks/aidl/utils/OWNERS | 11 + .../include/nnapi/hal/aidl/Conversions.h | 134 ++++ .../aidl/utils/include/nnapi/hal/aidl/Utils.h | 54 ++ neuralnetworks/aidl/utils/src/Assertions.cpp | 269 ++++++++ neuralnetworks/aidl/utils/src/Conversions.cpp | 582 ++++++++++++++++++ neuralnetworks/aidl/utils/src/Utils.cpp | 56 ++ .../common/include/nnapi/hal/CommonUtils.h | 12 +- 9 files changed, 1155 insertions(+), 3 deletions(-) create mode 100644 neuralnetworks/aidl/utils/Android.bp create mode 100644 neuralnetworks/aidl/utils/OWNERS create mode 100644 neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h create mode 100644 neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h create mode 100644 neuralnetworks/aidl/utils/src/Assertions.cpp create mode 100644 neuralnetworks/aidl/utils/src/Conversions.cpp create mode 100644 neuralnetworks/aidl/utils/src/Utils.cpp diff --git a/neuralnetworks/aidl/Android.bp b/neuralnetworks/aidl/Android.bp index 308f89f663..0557e43a5a 100644 --- a/neuralnetworks/aidl/Android.bp +++ b/neuralnetworks/aidl/Android.bp @@ -15,5 +15,13 @@ aidl_interface { cpp: { enabled: false, }, + ndk: { + apex_available: [ + "//apex_available:platform", + "com.android.neuralnetworks", + "test_com.android.neuralnetworks", + ], + min_sdk_version: "30", + }, }, } diff --git a/neuralnetworks/aidl/utils/Android.bp b/neuralnetworks/aidl/utils/Android.bp new file mode 100644 index 0000000000..56017da52d --- /dev/null +++ b/neuralnetworks/aidl/utils/Android.bp @@ -0,0 +1,32 @@ +// +// 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. +// + +cc_library_static { + name: "neuralnetworks_utils_hal_aidl", + defaults: ["neuralnetworks_utils_defaults"], + srcs: ["src/*"], + local_include_dirs: ["include/nnapi/hal/aidl/"], + export_include_dirs: ["include"], + static_libs: [ + "neuralnetworks_types", + "neuralnetworks_utils_hal_common", + ], + shared_libs: [ + "libhidlbase", + "android.hardware.neuralnetworks-V1-ndk_platform", + "libbinder_ndk", + ], +} diff --git a/neuralnetworks/aidl/utils/OWNERS b/neuralnetworks/aidl/utils/OWNERS new file mode 100644 index 0000000000..e4feee3496 --- /dev/null +++ b/neuralnetworks/aidl/utils/OWNERS @@ -0,0 +1,11 @@ +# Neuralnetworks team +butlermichael@google.com +dgross@google.com +galarragas@google.com +jeanluc@google.com +levp@google.com +miaowang@google.com +pszczepaniak@google.com +slavash@google.com +vddang@google.com +xusongw@google.com diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h new file mode 100644 index 0000000000..35de5befd0 --- /dev/null +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h @@ -0,0 +1,134 @@ +/* + * 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_INTERFACES_NEURALNETWORKS_AIDL_CONVERSIONS_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_CONVERSIONS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +namespace android::nn { + +GeneralResult unvalidatedConvert(const aidl_hal::OperandType& operandType); +GeneralResult unvalidatedConvert(const aidl_hal::OperationType& operationType); +GeneralResult unvalidatedConvert(const aidl_hal::DeviceType& deviceType); +GeneralResult unvalidatedConvert(const aidl_hal::Priority& priority); +GeneralResult unvalidatedConvert(const aidl_hal::Capabilities& capabilities); +GeneralResult unvalidatedConvert( + const aidl_hal::OperandPerformance& operandPerformance); +GeneralResult unvalidatedConvert( + const aidl_hal::PerformanceInfo& performanceInfo); +GeneralResult unvalidatedConvert(const aidl_hal::DataLocation& location); +GeneralResult unvalidatedConvert(const aidl_hal::Operand& operand); +GeneralResult unvalidatedConvert( + const std::optional& optionalExtraParams); +GeneralResult unvalidatedConvert( + const aidl_hal::OperandLifeTime& operandLifeTime); +GeneralResult unvalidatedConvert( + const aidl_hal::SymmPerChannelQuantParams& symmPerChannelQuantParams); +GeneralResult unvalidatedConvert(const aidl_hal::Operation& operation); +GeneralResult unvalidatedConvert(const aidl_hal::Model& model); +GeneralResult unvalidatedConvert( + const aidl_hal::ExtensionNameAndPrefix& extensionNameAndPrefix); +GeneralResult unvalidatedConvert(const std::vector& operandValues); +GeneralResult unvalidatedConvert(const aidl_hal::Subgraph& subgraph); +GeneralResult unvalidatedConvert(const aidl_hal::OutputShape& outputShape); +GeneralResult unvalidatedConvert(bool measureTiming); +GeneralResult unvalidatedConvert(const aidl_hal::Memory& memory); +GeneralResult unvalidatedConvert(const aidl_hal::Timing& timing); +GeneralResult unvalidatedConvert(const aidl_hal::BufferDesc& bufferDesc); +GeneralResult unvalidatedConvert(const aidl_hal::BufferRole& bufferRole); +GeneralResult unvalidatedConvert(const aidl_hal::Request& request); +GeneralResult unvalidatedConvert( + const aidl_hal::RequestArgument& requestArgument); +GeneralResult unvalidatedConvert( + const aidl_hal::RequestMemoryPool& memoryPool); +GeneralResult unvalidatedConvert(const aidl_hal::ErrorStatus& errorStatus); +GeneralResult unvalidatedConvert( + const aidl_hal::ExecutionPreference& executionPreference); +GeneralResult unvalidatedConvert(const aidl_hal::Extension& extension); +GeneralResult unvalidatedConvert( + const aidl_hal::ExtensionOperandTypeInformation& operandTypeInformation); +GeneralResult unvalidatedConvert( + const ::aidl::android::hardware::common::NativeHandle& handle); + +GeneralResult convert( + const aidl_hal::ExecutionPreference& executionPreference); +GeneralResult convert(const aidl_hal::Memory& memory); +GeneralResult convert(const aidl_hal::Model& model); +GeneralResult convert(const aidl_hal::Operand& operand); +GeneralResult convert(const aidl_hal::OperandType& operandType); +GeneralResult convert(const aidl_hal::Priority& priority); +GeneralResult convert(const aidl_hal::RequestMemoryPool& memoryPool); +GeneralResult convert(const aidl_hal::Request& request); + +GeneralResult> convert(const std::vector& outputShapes); +GeneralResult> convert(const std::vector& memories); + +GeneralResult> toUnsigned(const std::vector& vec); + +} // namespace android::nn + +namespace aidl::android::hardware::neuralnetworks::utils { + +namespace nn = ::android::nn; + +nn::GeneralResult unvalidatedConvert(const nn::Memory& memory); +nn::GeneralResult unvalidatedConvert(const nn::OutputShape& outputShape); +nn::GeneralResult unvalidatedConvert(const nn::ErrorStatus& errorStatus); + +nn::GeneralResult convert(const nn::Memory& memory); +nn::GeneralResult convert(const nn::ErrorStatus& errorStatus); +nn::GeneralResult> convert( + const std::vector& outputShapes); + +nn::GeneralResult> toSigned(const std::vector& vec); + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_CONVERSIONS_H diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h new file mode 100644 index 0000000000..802e70304a --- /dev/null +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h @@ -0,0 +1,54 @@ +/* + * 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_INTERFACES_NEURALNETWORKS_AIDL_UTILS_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_H + +#include "nnapi/hal/aidl/Conversions.h" + +#include +#include +#include +#include + +namespace aidl::android::hardware::neuralnetworks::utils { + +constexpr auto kDefaultPriority = Priority::MEDIUM; +constexpr auto kVersion = nn::Version::ANDROID_S; + +template +nn::Result validate(const Type& halObject) { + const auto maybeCanonical = nn::convert(halObject); + if (!maybeCanonical.has_value()) { + return nn::error() << maybeCanonical.error().message; + } + return {}; +} + +template +bool valid(const Type& halObject) { + const auto result = utils::validate(halObject); + if (!result.has_value()) { + LOG(ERROR) << result.error(); + } + return result.has_value(); +} + +nn::GeneralResult copyModel(const Model& model); + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_H diff --git a/neuralnetworks/aidl/utils/src/Assertions.cpp b/neuralnetworks/aidl/utils/src/Assertions.cpp new file mode 100644 index 0000000000..0e88091cfb --- /dev/null +++ b/neuralnetworks/aidl/utils/src/Assertions.cpp @@ -0,0 +1,269 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace { + +#define COMPARE_ENUMS_TYPES(lhsType, rhsType) \ + static_assert( \ + std::is_same_v< \ + std::underlying_type_t<::aidl::android::hardware::neuralnetworks::lhsType>, \ + std::underlying_type_t<::android::nn::rhsType>>, \ + "::aidl::android::hardware::neuralnetworks::" #lhsType \ + " does not have the same underlying type as ::android::nn::" #rhsType) + +COMPARE_ENUMS_TYPES(OperandType, OperandType); +COMPARE_ENUMS_TYPES(OperationType, OperationType); +COMPARE_ENUMS_TYPES(Priority, Priority); +COMPARE_ENUMS_TYPES(OperandLifeTime, Operand::LifeTime); +COMPARE_ENUMS_TYPES(ErrorStatus, ErrorStatus); + +#undef COMPARE_ENUMS_TYPES + +#define COMPARE_ENUMS_FULL(lhsSymbol, rhsSymbol, lhsType, rhsType) \ + static_assert( \ + static_cast< \ + std::underlying_type_t<::aidl::android::hardware::neuralnetworks::lhsType>>( \ + ::aidl::android::hardware::neuralnetworks::lhsType::lhsSymbol) == \ + static_cast>( \ + ::android::nn::rhsType::rhsSymbol), \ + "::aidl::android::hardware::neuralnetworks::" #lhsType "::" #lhsSymbol \ + " does not match ::android::nn::" #rhsType "::" #rhsSymbol) + +#define COMPARE_ENUMS(symbol) COMPARE_ENUMS_FULL(symbol, symbol, OperandType, OperandType) + +COMPARE_ENUMS(FLOAT32); +COMPARE_ENUMS(INT32); +COMPARE_ENUMS(UINT32); +COMPARE_ENUMS(TENSOR_FLOAT32); +COMPARE_ENUMS(TENSOR_INT32); +COMPARE_ENUMS(TENSOR_QUANT8_ASYMM); +COMPARE_ENUMS(BOOL); +COMPARE_ENUMS(TENSOR_QUANT16_SYMM); +COMPARE_ENUMS(TENSOR_FLOAT16); +COMPARE_ENUMS(TENSOR_BOOL8); +COMPARE_ENUMS(FLOAT16); +COMPARE_ENUMS(TENSOR_QUANT8_SYMM_PER_CHANNEL); +COMPARE_ENUMS(TENSOR_QUANT16_ASYMM); +COMPARE_ENUMS(TENSOR_QUANT8_SYMM); +COMPARE_ENUMS(TENSOR_QUANT8_ASYMM_SIGNED); +COMPARE_ENUMS(SUBGRAPH); + +#undef COMPARE_ENUMS + +#define COMPARE_ENUMS(symbol) COMPARE_ENUMS_FULL(symbol, symbol, OperationType, OperationType) + +COMPARE_ENUMS(ADD); +COMPARE_ENUMS(AVERAGE_POOL_2D); +COMPARE_ENUMS(CONCATENATION); +COMPARE_ENUMS(CONV_2D); +COMPARE_ENUMS(DEPTHWISE_CONV_2D); +COMPARE_ENUMS(DEPTH_TO_SPACE); +COMPARE_ENUMS(DEQUANTIZE); +COMPARE_ENUMS(EMBEDDING_LOOKUP); +COMPARE_ENUMS(FLOOR); +COMPARE_ENUMS(FULLY_CONNECTED); +COMPARE_ENUMS(HASHTABLE_LOOKUP); +COMPARE_ENUMS(L2_NORMALIZATION); +COMPARE_ENUMS(L2_POOL_2D); +COMPARE_ENUMS(LOCAL_RESPONSE_NORMALIZATION); +COMPARE_ENUMS(LOGISTIC); +COMPARE_ENUMS(LSH_PROJECTION); +COMPARE_ENUMS(LSTM); +COMPARE_ENUMS(MAX_POOL_2D); +COMPARE_ENUMS(MUL); +COMPARE_ENUMS(RELU); +COMPARE_ENUMS(RELU1); +COMPARE_ENUMS(RELU6); +COMPARE_ENUMS(RESHAPE); +COMPARE_ENUMS(RESIZE_BILINEAR); +COMPARE_ENUMS(RNN); +COMPARE_ENUMS(SOFTMAX); +COMPARE_ENUMS(SPACE_TO_DEPTH); +COMPARE_ENUMS(SVDF); +COMPARE_ENUMS(TANH); +COMPARE_ENUMS(BATCH_TO_SPACE_ND); +COMPARE_ENUMS(DIV); +COMPARE_ENUMS(MEAN); +COMPARE_ENUMS(PAD); +COMPARE_ENUMS(SPACE_TO_BATCH_ND); +COMPARE_ENUMS(SQUEEZE); +COMPARE_ENUMS(STRIDED_SLICE); +COMPARE_ENUMS(SUB); +COMPARE_ENUMS(TRANSPOSE); +COMPARE_ENUMS(ABS); +COMPARE_ENUMS(ARGMAX); +COMPARE_ENUMS(ARGMIN); +COMPARE_ENUMS(AXIS_ALIGNED_BBOX_TRANSFORM); +COMPARE_ENUMS(BIDIRECTIONAL_SEQUENCE_LSTM); +COMPARE_ENUMS(BIDIRECTIONAL_SEQUENCE_RNN); +COMPARE_ENUMS(BOX_WITH_NMS_LIMIT); +COMPARE_ENUMS(CAST); +COMPARE_ENUMS(CHANNEL_SHUFFLE); +COMPARE_ENUMS(DETECTION_POSTPROCESSING); +COMPARE_ENUMS(EQUAL); +COMPARE_ENUMS(EXP); +COMPARE_ENUMS(EXPAND_DIMS); +COMPARE_ENUMS(GATHER); +COMPARE_ENUMS(GENERATE_PROPOSALS); +COMPARE_ENUMS(GREATER); +COMPARE_ENUMS(GREATER_EQUAL); +COMPARE_ENUMS(GROUPED_CONV_2D); +COMPARE_ENUMS(HEATMAP_MAX_KEYPOINT); +COMPARE_ENUMS(INSTANCE_NORMALIZATION); +COMPARE_ENUMS(LESS); +COMPARE_ENUMS(LESS_EQUAL); +COMPARE_ENUMS(LOG); +COMPARE_ENUMS(LOGICAL_AND); +COMPARE_ENUMS(LOGICAL_NOT); +COMPARE_ENUMS(LOGICAL_OR); +COMPARE_ENUMS(LOG_SOFTMAX); +COMPARE_ENUMS(MAXIMUM); +COMPARE_ENUMS(MINIMUM); +COMPARE_ENUMS(NEG); +COMPARE_ENUMS(NOT_EQUAL); +COMPARE_ENUMS(PAD_V2); +COMPARE_ENUMS(POW); +COMPARE_ENUMS(PRELU); +COMPARE_ENUMS(QUANTIZE); +COMPARE_ENUMS(QUANTIZED_16BIT_LSTM); +COMPARE_ENUMS(RANDOM_MULTINOMIAL); +COMPARE_ENUMS(REDUCE_ALL); +COMPARE_ENUMS(REDUCE_ANY); +COMPARE_ENUMS(REDUCE_MAX); +COMPARE_ENUMS(REDUCE_MIN); +COMPARE_ENUMS(REDUCE_PROD); +COMPARE_ENUMS(REDUCE_SUM); +COMPARE_ENUMS(ROI_ALIGN); +COMPARE_ENUMS(ROI_POOLING); +COMPARE_ENUMS(RSQRT); +COMPARE_ENUMS(SELECT); +COMPARE_ENUMS(SIN); +COMPARE_ENUMS(SLICE); +COMPARE_ENUMS(SPLIT); +COMPARE_ENUMS(SQRT); +COMPARE_ENUMS(TILE); +COMPARE_ENUMS(TOPK_V2); +COMPARE_ENUMS(TRANSPOSE_CONV_2D); +COMPARE_ENUMS(UNIDIRECTIONAL_SEQUENCE_LSTM); +COMPARE_ENUMS(UNIDIRECTIONAL_SEQUENCE_RNN); +COMPARE_ENUMS(RESIZE_NEAREST_NEIGHBOR); +COMPARE_ENUMS(QUANTIZED_LSTM); +COMPARE_ENUMS(IF); +COMPARE_ENUMS(WHILE); +COMPARE_ENUMS(ELU); +COMPARE_ENUMS(HARD_SWISH); +COMPARE_ENUMS(FILL); +COMPARE_ENUMS(RANK); + +#undef COMPARE_ENUMS + +#define COMPARE_ENUMS(symbol) COMPARE_ENUMS_FULL(symbol, symbol, Priority, Priority) + +COMPARE_ENUMS(LOW); +COMPARE_ENUMS(MEDIUM); +COMPARE_ENUMS(HIGH); + +#undef COMPARE_ENUMS + +#define COMPARE_ENUMS(lhsSymbol, rhsSymbol) \ + COMPARE_ENUMS_FULL(lhsSymbol, rhsSymbol, OperandLifeTime, Operand::LifeTime) + +COMPARE_ENUMS(TEMPORARY_VARIABLE, TEMPORARY_VARIABLE); +COMPARE_ENUMS(SUBGRAPH_INPUT, SUBGRAPH_INPUT); +COMPARE_ENUMS(SUBGRAPH_OUTPUT, SUBGRAPH_OUTPUT); +COMPARE_ENUMS(CONSTANT_COPY, CONSTANT_COPY); +COMPARE_ENUMS(CONSTANT_POOL, CONSTANT_REFERENCE); +COMPARE_ENUMS(NO_VALUE, NO_VALUE); +COMPARE_ENUMS(SUBGRAPH, SUBGRAPH); + +#undef COMPARE_ENUMS + +#define COMPARE_ENUMS(symbol) COMPARE_ENUMS_FULL(symbol, symbol, ErrorStatus, ErrorStatus) + +COMPARE_ENUMS(NONE); +COMPARE_ENUMS(DEVICE_UNAVAILABLE); +COMPARE_ENUMS(GENERAL_FAILURE); +COMPARE_ENUMS(OUTPUT_INSUFFICIENT_SIZE); +COMPARE_ENUMS(INVALID_ARGUMENT); +COMPARE_ENUMS(MISSED_DEADLINE_TRANSIENT); +COMPARE_ENUMS(MISSED_DEADLINE_PERSISTENT); +COMPARE_ENUMS(RESOURCE_EXHAUSTED_TRANSIENT); +COMPARE_ENUMS(RESOURCE_EXHAUSTED_PERSISTENT); + +#undef COMPARE_ENUMS + +#define COMPARE_ENUMS(symbol) \ + COMPARE_ENUMS_FULL(symbol, symbol, ExecutionPreference, ExecutionPreference) + +COMPARE_ENUMS(LOW_POWER); +COMPARE_ENUMS(FAST_SINGLE_ANSWER); +COMPARE_ENUMS(SUSTAINED_SPEED); + +#undef COMPARE_ENUMS + +#define COMPARE_ENUMS(symbol) COMPARE_ENUMS_FULL(symbol, symbol, DeviceType, DeviceType) + +COMPARE_ENUMS(OTHER); +COMPARE_ENUMS(CPU); +COMPARE_ENUMS(GPU); +COMPARE_ENUMS(ACCELERATOR); + +#undef COMPARE_ENUMS + +#define COMPARE_ENUMS(symbol) \ + COMPARE_ENUMS_FULL(symbol, symbol, FusedActivationFunc, FusedActivationFunc) + +COMPARE_ENUMS(NONE); +COMPARE_ENUMS(RELU); +COMPARE_ENUMS(RELU1); +COMPARE_ENUMS(RELU6); + +#undef COMPARE_ENUMS + +#undef COMPARE_ENUMS_FULL + +#define COMPARE_CONSTANTS(halSymbol, canonicalSymbol) \ + static_assert(::aidl::android::hardware::neuralnetworks::halSymbol == \ + ::android::nn::canonicalSymbol); + +COMPARE_CONSTANTS(IDevice::BYTE_SIZE_OF_CACHE_TOKEN, kByteSizeOfCacheToken); +COMPARE_CONSTANTS(IDevice::MAX_NUMBER_OF_CACHE_FILES, kMaxNumberOfCacheFiles); +COMPARE_CONSTANTS(IDevice::EXTENSION_TYPE_HIGH_BITS_PREFIX, kExtensionPrefixBits - 1); +COMPARE_CONSTANTS(IDevice::EXTENSION_TYPE_LOW_BITS_TYPE, kExtensionTypeBits); +COMPARE_CONSTANTS(IPreparedModel::DEFAULT_LOOP_TIMEOUT_DURATION_NS, + operation_while::kTimeoutNsDefault); +COMPARE_CONSTANTS(IPreparedModel::MAXIMUM_LOOP_TIMEOUT_DURATION_NS, + operation_while::kTimeoutNsMaximum); + +#undef COMPARE_CONSTANTS + +} // anonymous namespace diff --git a/neuralnetworks/aidl/utils/src/Conversions.cpp b/neuralnetworks/aidl/utils/src/Conversions.cpp new file mode 100644 index 0000000000..0e93b02a1e --- /dev/null +++ b/neuralnetworks/aidl/utils/src/Conversions.cpp @@ -0,0 +1,582 @@ +/* + * 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 "Conversions.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#define VERIFY_NON_NEGATIVE(value) \ + while (UNLIKELY(value < 0)) return NN_ERROR() + +namespace { + +template +constexpr std::underlying_type_t underlyingType(Type value) { + return static_cast>(value); +} + +constexpr auto kVersion = android::nn::Version::ANDROID_S; + +} // namespace + +namespace android::nn { +namespace { + +constexpr auto validOperandType(nn::OperandType operandType) { + switch (operandType) { + case nn::OperandType::FLOAT32: + case nn::OperandType::INT32: + case nn::OperandType::UINT32: + case nn::OperandType::TENSOR_FLOAT32: + case nn::OperandType::TENSOR_INT32: + case nn::OperandType::TENSOR_QUANT8_ASYMM: + case nn::OperandType::BOOL: + case nn::OperandType::TENSOR_QUANT16_SYMM: + case nn::OperandType::TENSOR_FLOAT16: + case nn::OperandType::TENSOR_BOOL8: + case nn::OperandType::FLOAT16: + case nn::OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL: + case nn::OperandType::TENSOR_QUANT16_ASYMM: + case nn::OperandType::TENSOR_QUANT8_SYMM: + case nn::OperandType::TENSOR_QUANT8_ASYMM_SIGNED: + case nn::OperandType::SUBGRAPH: + return true; + case nn::OperandType::OEM: + case nn::OperandType::TENSOR_OEM_BYTE: + return false; + } + return nn::isExtension(operandType); +} + +template +using UnvalidatedConvertOutput = + std::decay_t()).value())>; + +template +GeneralResult>> unvalidatedConvertVec( + const std::vector& arguments) { + std::vector> canonical; + canonical.reserve(arguments.size()); + for (const auto& argument : arguments) { + canonical.push_back(NN_TRY(nn::unvalidatedConvert(argument))); + } + return canonical; +} + +template +GeneralResult>> unvalidatedConvert( + const std::vector& arguments) { + return unvalidatedConvertVec(arguments); +} + +template +GeneralResult> validatedConvert(const Type& halObject) { + auto canonical = NN_TRY(nn::unvalidatedConvert(halObject)); + const auto maybeVersion = validate(canonical); + if (!maybeVersion.has_value()) { + return error() << maybeVersion.error(); + } + const auto version = maybeVersion.value(); + if (version > kVersion) { + return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; + } + return canonical; +} + +template +GeneralResult>> validatedConvert( + const std::vector& arguments) { + std::vector> canonical; + canonical.reserve(arguments.size()); + for (const auto& argument : arguments) { + canonical.push_back(NN_TRY(validatedConvert(argument))); + } + return canonical; +} + +} // anonymous namespace + +GeneralResult unvalidatedConvert(const aidl_hal::OperandType& operandType) { + VERIFY_NON_NEGATIVE(underlyingType(operandType)) << "Negative operand types are not allowed."; + return static_cast(operandType); +} + +GeneralResult unvalidatedConvert(const aidl_hal::OperationType& operationType) { + VERIFY_NON_NEGATIVE(underlyingType(operationType)) + << "Negative operation types are not allowed."; + return static_cast(operationType); +} + +GeneralResult unvalidatedConvert(const aidl_hal::DeviceType& deviceType) { + return static_cast(deviceType); +} + +GeneralResult unvalidatedConvert(const aidl_hal::Priority& priority) { + return static_cast(priority); +} + +GeneralResult unvalidatedConvert(const aidl_hal::Capabilities& capabilities) { + const bool validOperandTypes = std::all_of( + capabilities.operandPerformance.begin(), capabilities.operandPerformance.end(), + [](const aidl_hal::OperandPerformance& operandPerformance) { + const auto maybeType = unvalidatedConvert(operandPerformance.type); + return !maybeType.has_value() ? false : validOperandType(maybeType.value()); + }); + if (!validOperandTypes) { + return NN_ERROR() << "Invalid OperandType when unvalidatedConverting OperandPerformance in " + "Capabilities"; + } + + auto operandPerformance = NN_TRY(unvalidatedConvert(capabilities.operandPerformance)); + auto table = NN_TRY(hal::utils::makeGeneralFailure( + Capabilities::OperandPerformanceTable::create(std::move(operandPerformance)), + nn::ErrorStatus::GENERAL_FAILURE)); + + return Capabilities{ + .relaxedFloat32toFloat16PerformanceScalar = NN_TRY( + unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceScalar)), + .relaxedFloat32toFloat16PerformanceTensor = NN_TRY( + unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceTensor)), + .operandPerformance = std::move(table), + .ifPerformance = NN_TRY(unvalidatedConvert(capabilities.ifPerformance)), + .whilePerformance = NN_TRY(unvalidatedConvert(capabilities.whilePerformance)), + }; +} + +GeneralResult unvalidatedConvert( + const aidl_hal::OperandPerformance& operandPerformance) { + return Capabilities::OperandPerformance{ + .type = NN_TRY(unvalidatedConvert(operandPerformance.type)), + .info = NN_TRY(unvalidatedConvert(operandPerformance.info)), + }; +} + +GeneralResult unvalidatedConvert( + const aidl_hal::PerformanceInfo& performanceInfo) { + return Capabilities::PerformanceInfo{ + .execTime = performanceInfo.execTime, + .powerUsage = performanceInfo.powerUsage, + }; +} + +GeneralResult unvalidatedConvert(const aidl_hal::DataLocation& location) { + VERIFY_NON_NEGATIVE(location.poolIndex) << "DataLocation: pool index must not be negative"; + VERIFY_NON_NEGATIVE(location.offset) << "DataLocation: offset must not be negative"; + VERIFY_NON_NEGATIVE(location.length) << "DataLocation: length must not be negative"; + if (location.offset > std::numeric_limits::max()) { + return NN_ERROR() << "DataLocation: offset must be <= std::numeric_limits::max()"; + } + if (location.length > std::numeric_limits::max()) { + return NN_ERROR() << "DataLocation: length must be <= std::numeric_limits::max()"; + } + return DataLocation{ + .poolIndex = static_cast(location.poolIndex), + .offset = static_cast(location.offset), + .length = static_cast(location.length), + }; +} + +GeneralResult unvalidatedConvert(const aidl_hal::Operation& operation) { + return Operation{ + .type = NN_TRY(unvalidatedConvert(operation.type)), + .inputs = NN_TRY(toUnsigned(operation.inputs)), + .outputs = NN_TRY(toUnsigned(operation.outputs)), + }; +} + +GeneralResult unvalidatedConvert( + const aidl_hal::OperandLifeTime& operandLifeTime) { + return static_cast(operandLifeTime); +} + +GeneralResult unvalidatedConvert(const aidl_hal::Operand& operand) { + return Operand{ + .type = NN_TRY(unvalidatedConvert(operand.type)), + .dimensions = NN_TRY(toUnsigned(operand.dimensions)), + .scale = operand.scale, + .zeroPoint = operand.zeroPoint, + .lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)), + .location = NN_TRY(unvalidatedConvert(operand.location)), + .extraParams = NN_TRY(unvalidatedConvert(operand.extraParams)), + }; +} + +GeneralResult unvalidatedConvert( + const std::optional& optionalExtraParams) { + if (!optionalExtraParams.has_value()) { + return Operand::NoParams{}; + } + const auto& extraParams = optionalExtraParams.value(); + using Tag = aidl_hal::OperandExtraParams::Tag; + switch (extraParams.getTag()) { + case Tag::channelQuant: + return unvalidatedConvert(extraParams.get()); + case Tag::extension: + return extraParams.get(); + } + return NN_ERROR() << "Unrecognized Operand::ExtraParams tag: " + << underlyingType(extraParams.getTag()); +} + +GeneralResult unvalidatedConvert( + const aidl_hal::SymmPerChannelQuantParams& symmPerChannelQuantParams) { + VERIFY_NON_NEGATIVE(symmPerChannelQuantParams.channelDim) + << "Per-channel quantization channel dimension must not be negative."; + return Operand::SymmPerChannelQuantParams{ + .scales = symmPerChannelQuantParams.scales, + .channelDim = static_cast(symmPerChannelQuantParams.channelDim), + }; +} + +GeneralResult unvalidatedConvert(const aidl_hal::Model& model) { + return Model{ + .main = NN_TRY(unvalidatedConvert(model.main)), + .referenced = NN_TRY(unvalidatedConvert(model.referenced)), + .operandValues = NN_TRY(unvalidatedConvert(model.operandValues)), + .pools = NN_TRY(unvalidatedConvert(model.pools)), + .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, + .extensionNameToPrefix = NN_TRY(unvalidatedConvert(model.extensionNameToPrefix)), + }; +} + +GeneralResult unvalidatedConvert(const aidl_hal::Subgraph& subgraph) { + return Model::Subgraph{ + .operands = NN_TRY(unvalidatedConvert(subgraph.operands)), + .operations = NN_TRY(unvalidatedConvert(subgraph.operations)), + .inputIndexes = NN_TRY(toUnsigned(subgraph.inputIndexes)), + .outputIndexes = NN_TRY(toUnsigned(subgraph.outputIndexes)), + }; +} + +GeneralResult unvalidatedConvert( + const aidl_hal::ExtensionNameAndPrefix& extensionNameAndPrefix) { + return Model::ExtensionNameAndPrefix{ + .name = extensionNameAndPrefix.name, + .prefix = extensionNameAndPrefix.prefix, + }; +} + +GeneralResult unvalidatedConvert(const aidl_hal::Extension& extension) { + return Extension{ + .name = extension.name, + .operandTypes = NN_TRY(unvalidatedConvert(extension.operandTypes)), + }; +} + +GeneralResult unvalidatedConvert( + const aidl_hal::ExtensionOperandTypeInformation& operandTypeInformation) { + VERIFY_NON_NEGATIVE(operandTypeInformation.byteSize) + << "Extension operand type byte size must not be negative"; + return Extension::OperandTypeInformation{ + .type = operandTypeInformation.type, + .isTensor = operandTypeInformation.isTensor, + .byteSize = static_cast(operandTypeInformation.byteSize), + }; +} + +GeneralResult unvalidatedConvert(const aidl_hal::OutputShape& outputShape) { + return OutputShape{ + .dimensions = NN_TRY(toUnsigned(outputShape.dimensions)), + .isSufficient = outputShape.isSufficient, + }; +} + +GeneralResult unvalidatedConvert(bool measureTiming) { + return measureTiming ? MeasureTiming::YES : MeasureTiming::NO; +} + +GeneralResult unvalidatedConvert(const aidl_hal::Memory& memory) { + VERIFY_NON_NEGATIVE(memory.size) << "Memory size must not be negative"; + return Memory{ + .handle = NN_TRY(unvalidatedConvert(memory.handle)), + .size = static_cast(memory.size), + .name = memory.name, + }; +} + +GeneralResult unvalidatedConvert(const std::vector& operandValues) { + return Model::OperandValues(operandValues.data(), operandValues.size()); +} + +GeneralResult unvalidatedConvert(const aidl_hal::BufferDesc& bufferDesc) { + return BufferDesc{.dimensions = NN_TRY(toUnsigned(bufferDesc.dimensions))}; +} + +GeneralResult unvalidatedConvert(const aidl_hal::BufferRole& bufferRole) { + VERIFY_NON_NEGATIVE(bufferRole.modelIndex) << "BufferRole: modelIndex must not be negative"; + VERIFY_NON_NEGATIVE(bufferRole.ioIndex) << "BufferRole: ioIndex must not be negative"; + return BufferRole{ + .modelIndex = static_cast(bufferRole.modelIndex), + .ioIndex = static_cast(bufferRole.ioIndex), + .frequency = bufferRole.frequency, + }; +} + +GeneralResult unvalidatedConvert(const aidl_hal::Request& request) { + return Request{ + .inputs = NN_TRY(unvalidatedConvert(request.inputs)), + .outputs = NN_TRY(unvalidatedConvert(request.outputs)), + .pools = NN_TRY(unvalidatedConvert(request.pools)), + }; +} + +GeneralResult unvalidatedConvert(const aidl_hal::RequestArgument& argument) { + const auto lifetime = argument.hasNoValue ? Request::Argument::LifeTime::NO_VALUE + : Request::Argument::LifeTime::POOL; + return Request::Argument{ + .lifetime = lifetime, + .location = NN_TRY(unvalidatedConvert(argument.location)), + .dimensions = NN_TRY(toUnsigned(argument.dimensions)), + }; +} + +GeneralResult unvalidatedConvert( + const aidl_hal::RequestMemoryPool& memoryPool) { + using Tag = aidl_hal::RequestMemoryPool::Tag; + switch (memoryPool.getTag()) { + case Tag::pool: + return unvalidatedConvert(memoryPool.get()); + case Tag::token: { + const auto token = memoryPool.get(); + VERIFY_NON_NEGATIVE(token) << "Memory pool token must not be negative"; + return static_cast(token); + } + } + return NN_ERROR() << "Invalid Request::MemoryPool tag " << underlyingType(memoryPool.getTag()); +} + +GeneralResult unvalidatedConvert(const aidl_hal::ErrorStatus& status) { + switch (status) { + case aidl_hal::ErrorStatus::NONE: + case aidl_hal::ErrorStatus::DEVICE_UNAVAILABLE: + case aidl_hal::ErrorStatus::GENERAL_FAILURE: + case aidl_hal::ErrorStatus::OUTPUT_INSUFFICIENT_SIZE: + case aidl_hal::ErrorStatus::INVALID_ARGUMENT: + case aidl_hal::ErrorStatus::MISSED_DEADLINE_TRANSIENT: + case aidl_hal::ErrorStatus::MISSED_DEADLINE_PERSISTENT: + case aidl_hal::ErrorStatus::RESOURCE_EXHAUSTED_TRANSIENT: + case aidl_hal::ErrorStatus::RESOURCE_EXHAUSTED_PERSISTENT: + return static_cast(status); + } + return NN_ERROR() << "Invalid ErrorStatus " << underlyingType(status); +} + +GeneralResult unvalidatedConvert( + const aidl_hal::ExecutionPreference& executionPreference) { + return static_cast(executionPreference); +} + +GeneralResult unvalidatedConvert( + const ::aidl::android::hardware::common::NativeHandle& aidlNativeHandle) { + std::vector fds; + fds.reserve(aidlNativeHandle.fds.size()); + for (const auto& fd : aidlNativeHandle.fds) { + int dupFd = dup(fd.get()); + if (dupFd == -1) { + // TODO(b/120417090): is ANEURALNETWORKS_UNEXPECTED_NULL the correct error to return + // here? + return NN_ERROR() << "Failed to dup the fd"; + } + fds.emplace_back(dupFd); + } + + return std::make_shared(Handle{ + .fds = std::move(fds), + .ints = aidlNativeHandle.ints, + }); +} + +GeneralResult convert( + const aidl_hal::ExecutionPreference& executionPreference) { + return validatedConvert(executionPreference); +} + +GeneralResult convert(const aidl_hal::Memory& operand) { + return validatedConvert(operand); +} + +GeneralResult convert(const aidl_hal::Model& model) { + return validatedConvert(model); +} + +GeneralResult convert(const aidl_hal::Operand& operand) { + return unvalidatedConvert(operand); +} + +GeneralResult convert(const aidl_hal::OperandType& operandType) { + return unvalidatedConvert(operandType); +} + +GeneralResult convert(const aidl_hal::Priority& priority) { + return validatedConvert(priority); +} + +GeneralResult convert(const aidl_hal::RequestMemoryPool& memoryPool) { + return unvalidatedConvert(memoryPool); +} + +GeneralResult convert(const aidl_hal::Request& request) { + return validatedConvert(request); +} + +GeneralResult> convert(const std::vector& operations) { + return unvalidatedConvert(operations); +} + +GeneralResult> convert(const std::vector& memories) { + return validatedConvert(memories); +} + +GeneralResult> toUnsigned(const std::vector& vec) { + if (!std::all_of(vec.begin(), vec.end(), [](int32_t v) { return v >= 0; })) { + return NN_ERROR() << "Negative value passed to conversion from signed to unsigned"; + } + return std::vector(vec.begin(), vec.end()); +} + +} // namespace android::nn + +namespace aidl::android::hardware::neuralnetworks::utils { +namespace { + +template +using UnvalidatedConvertOutput = + std::decay_t()).value())>; + +template +nn::GeneralResult>> unvalidatedConvertVec( + const std::vector& arguments) { + std::vector> halObject(arguments.size()); + for (size_t i = 0; i < arguments.size(); ++i) { + halObject[i] = NN_TRY(unvalidatedConvert(arguments[i])); + } + return halObject; +} + +template +nn::GeneralResult> validatedConvert(const Type& canonical) { + const auto maybeVersion = nn::validate(canonical); + if (!maybeVersion.has_value()) { + return nn::error() << maybeVersion.error(); + } + const auto version = maybeVersion.value(); + if (version > kVersion) { + return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; + } + return utils::unvalidatedConvert(canonical); +} + +template +nn::GeneralResult>> validatedConvert( + const std::vector& arguments) { + std::vector> halObject(arguments.size()); + for (size_t i = 0; i < arguments.size(); ++i) { + halObject[i] = NN_TRY(validatedConvert(arguments[i])); + } + return halObject; +} + +} // namespace + +nn::GeneralResult unvalidatedConvert(const nn::SharedHandle& sharedHandle) { + common::NativeHandle aidlNativeHandle; + aidlNativeHandle.fds.reserve(sharedHandle->fds.size()); + for (const auto& fd : sharedHandle->fds) { + int dupFd = dup(fd.get()); + if (dupFd == -1) { + // TODO(b/120417090): is ANEURALNETWORKS_UNEXPECTED_NULL the correct error to return + // here? + return NN_ERROR() << "Failed to dup the fd"; + } + aidlNativeHandle.fds.emplace_back(dupFd); + } + aidlNativeHandle.ints = sharedHandle->ints; + return aidlNativeHandle; +} + +nn::GeneralResult unvalidatedConvert(const nn::Memory& memory) { + if (memory.size > std::numeric_limits::max()) { + return NN_ERROR() << "Memory size doesn't fit into int64_t."; + } + return Memory{ + .handle = NN_TRY(unvalidatedConvert(memory.handle)), + .size = static_cast(memory.size), + .name = memory.name, + }; +} + +nn::GeneralResult unvalidatedConvert(const nn::ErrorStatus& errorStatus) { + switch (errorStatus) { + case nn::ErrorStatus::NONE: + case nn::ErrorStatus::DEVICE_UNAVAILABLE: + case nn::ErrorStatus::GENERAL_FAILURE: + case nn::ErrorStatus::OUTPUT_INSUFFICIENT_SIZE: + case nn::ErrorStatus::INVALID_ARGUMENT: + case nn::ErrorStatus::MISSED_DEADLINE_TRANSIENT: + case nn::ErrorStatus::MISSED_DEADLINE_PERSISTENT: + case nn::ErrorStatus::RESOURCE_EXHAUSTED_TRANSIENT: + case nn::ErrorStatus::RESOURCE_EXHAUSTED_PERSISTENT: + return static_cast(errorStatus); + default: + return ErrorStatus::GENERAL_FAILURE; + } +} + +nn::GeneralResult unvalidatedConvert(const nn::OutputShape& outputShape) { + return OutputShape{.dimensions = NN_TRY(toSigned(outputShape.dimensions)), + .isSufficient = outputShape.isSufficient}; +} + +nn::GeneralResult convert(const nn::Memory& memory) { + return validatedConvert(memory); +} + +nn::GeneralResult convert(const nn::ErrorStatus& errorStatus) { + return validatedConvert(errorStatus); +} + +nn::GeneralResult> convert( + const std::vector& outputShapes) { + return validatedConvert(outputShapes); +} + +nn::GeneralResult> toSigned(const std::vector& vec) { + if (!std::all_of(vec.begin(), vec.end(), + [](uint32_t v) { return v <= std::numeric_limits::max(); })) { + return NN_ERROR() << "Vector contains a value that doesn't fit into int32_t."; + } + return std::vector(vec.begin(), vec.end()); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/src/Utils.cpp b/neuralnetworks/aidl/utils/src/Utils.cpp new file mode 100644 index 0000000000..04aa0e9eba --- /dev/null +++ b/neuralnetworks/aidl/utils/src/Utils.cpp @@ -0,0 +1,56 @@ +/* + * 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 "Utils.h" + +#include + +namespace aidl::android::hardware::neuralnetworks::utils { + +using ::android::nn::GeneralResult; + +GeneralResult copyModel(const Model& model) { + Model newModel{ + .main = model.main, + .referenced = model.referenced, + .operandValues = model.operandValues, + .pools = {}, + .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, + .extensionNameToPrefix = model.extensionNameToPrefix, + }; + newModel.pools.reserve(model.pools.size()); + for (const auto& pool : model.pools) { + common::NativeHandle nativeHandle; + nativeHandle.ints = pool.handle.ints; + nativeHandle.fds.reserve(pool.handle.fds.size()); + for (const auto& fd : pool.handle.fds) { + const int newFd = dup(fd.get()); + if (newFd == -1) { + return NN_ERROR() << "Couldn't dup a file descriptor."; + } + nativeHandle.fds.emplace_back(newFd); + } + Memory memory = { + .handle = std::move(nativeHandle), + .size = pool.size, + .name = pool.name, + }; + newModel.pools.push_back(std::move(memory)); + } + return newModel; +} + +} // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h b/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h index b3989e5878..fef9d9cfb5 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h @@ -24,15 +24,21 @@ #include #include -// Shorthand +// Shorthands namespace android::hardware::neuralnetworks { namespace hal = ::android::hardware::neuralnetworks; } // namespace android::hardware::neuralnetworks -// Shorthand +// Shorthands +namespace aidl::android::hardware::neuralnetworks { +namespace aidl_hal = ::aidl::android::hardware::neuralnetworks; +} // namespace aidl::android::hardware::neuralnetworks + +// Shorthands namespace android::nn { namespace hal = ::android::hardware::neuralnetworks; -} +namespace aidl_hal = ::aidl::android::hardware::neuralnetworks; +} // namespace android::nn namespace android::hardware::neuralnetworks::utils { -- GitLab From b38bb4f12a1ceb33ebd0dd798650a74a8ef9d20e Mon Sep 17 00:00:00 2001 From: Lev Proleev Date: Tue, 15 Dec 2020 19:25:32 +0000 Subject: [PATCH 008/825] Implement VTS tests for NNAPI AIDL interface The tests are copied from HIDL 1.0-3 VTS tests and updated to use AIDL. Bug: 172922059 Test: VtsHalNeuralnetworksTargetTest Change-Id: Ife08409e9b46420685a1ccb0b3256286c973dbf5 --- neuralnetworks/1.3/vts/functional/Android.bp | 1 + .../aidl/utils/include/nnapi/hal/aidl/Utils.h | 5 +- neuralnetworks/aidl/utils/src/Utils.cpp | 85 +- neuralnetworks/aidl/vts/OWNERS | 12 + neuralnetworks/aidl/vts/functional/Android.bp | 68 + .../aidl/vts/functional/AndroidTest.xml | 33 + .../aidl/vts/functional/BasicTests.cpp | 193 +++ .../aidl/vts/functional/Callbacks.cpp | 59 + .../aidl/vts/functional/Callbacks.h | 131 ++ .../functional/CompilationCachingTests.cpp | 1177 +++++++++++++++ .../vts/functional/GeneratedTestHarness.cpp | 925 ++++++++++++ .../vts/functional/GeneratedTestHarness.h | 88 ++ .../aidl/vts/functional/LogTestCaseToLogcat.h | 40 + .../aidl/vts/functional/MemoryDomainTests.cpp | 1176 +++++++++++++++ .../vts/functional/QualityOfServiceTests.cpp | 270 ++++ .../aidl/vts/functional/TestAssertions.cpp | 153 ++ .../aidl/vts/functional/TestMain.cpp | 27 + neuralnetworks/aidl/vts/functional/Utils.cpp | 252 ++++ neuralnetworks/aidl/vts/functional/Utils.h | 153 ++ .../aidl/vts/functional/ValidateModel.cpp | 1338 +++++++++++++++++ .../aidl/vts/functional/ValidateRequest.cpp | 126 ++ .../vts/functional/VtsHalNeuralnetworks.cpp | 194 +++ .../vts/functional/VtsHalNeuralnetworks.h | 61 + 23 files changed, 6543 insertions(+), 24 deletions(-) create mode 100644 neuralnetworks/aidl/vts/OWNERS create mode 100644 neuralnetworks/aidl/vts/functional/Android.bp create mode 100644 neuralnetworks/aidl/vts/functional/AndroidTest.xml create mode 100644 neuralnetworks/aidl/vts/functional/BasicTests.cpp create mode 100644 neuralnetworks/aidl/vts/functional/Callbacks.cpp create mode 100644 neuralnetworks/aidl/vts/functional/Callbacks.h create mode 100644 neuralnetworks/aidl/vts/functional/CompilationCachingTests.cpp create mode 100644 neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp create mode 100644 neuralnetworks/aidl/vts/functional/GeneratedTestHarness.h create mode 100644 neuralnetworks/aidl/vts/functional/LogTestCaseToLogcat.h create mode 100644 neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp create mode 100644 neuralnetworks/aidl/vts/functional/QualityOfServiceTests.cpp create mode 100644 neuralnetworks/aidl/vts/functional/TestAssertions.cpp create mode 100644 neuralnetworks/aidl/vts/functional/TestMain.cpp create mode 100644 neuralnetworks/aidl/vts/functional/Utils.cpp create mode 100644 neuralnetworks/aidl/vts/functional/Utils.h create mode 100644 neuralnetworks/aidl/vts/functional/ValidateModel.cpp create mode 100644 neuralnetworks/aidl/vts/functional/ValidateRequest.cpp create mode 100644 neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp create mode 100644 neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h diff --git a/neuralnetworks/1.3/vts/functional/Android.bp b/neuralnetworks/1.3/vts/functional/Android.bp index b17d44559b..ee753bb951 100644 --- a/neuralnetworks/1.3/vts/functional/Android.bp +++ b/neuralnetworks/1.3/vts/functional/Android.bp @@ -57,6 +57,7 @@ cc_test { "VtsHalNeuralNetworksV1_0_utils", "VtsHalNeuralNetworksV1_2_utils", "VtsHalNeuralNetworksV1_3_utils", + "android.hardware.neuralnetworks-V1-ndk_platform", "android.hardware.neuralnetworks@1.0", "android.hardware.neuralnetworks@1.1", "android.hardware.neuralnetworks@1.2", diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h index 802e70304a..79b511dc56 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h @@ -47,7 +47,10 @@ bool valid(const Type& halObject) { return result.has_value(); } -nn::GeneralResult copyModel(const Model& model); +nn::GeneralResult clone(const Memory& memory); +nn::GeneralResult clone(const Request& request); +nn::GeneralResult clone(const RequestMemoryPool& requestPool); +nn::GeneralResult clone(const Model& model); } // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/src/Utils.cpp b/neuralnetworks/aidl/utils/src/Utils.cpp index 04aa0e9eba..8d00e5926a 100644 --- a/neuralnetworks/aidl/utils/src/Utils.cpp +++ b/neuralnetworks/aidl/utils/src/Utils.cpp @@ -19,38 +19,77 @@ #include namespace aidl::android::hardware::neuralnetworks::utils { +namespace { using ::android::nn::GeneralResult; -GeneralResult copyModel(const Model& model) { - Model newModel{ +template +nn::GeneralResult> cloneVec(const std::vector& arguments) { + std::vector clonedObjects; + clonedObjects.reserve(arguments.size()); + for (const auto& argument : arguments) { + clonedObjects.push_back(NN_TRY(clone(argument))); + } + return clonedObjects; +} + +template +GeneralResult> clone(const std::vector& arguments) { + return cloneVec(arguments); +} + +} // namespace + +GeneralResult clone(const Memory& memory) { + common::NativeHandle nativeHandle; + nativeHandle.ints = memory.handle.ints; + nativeHandle.fds.reserve(memory.handle.fds.size()); + for (const auto& fd : memory.handle.fds) { + const int newFd = dup(fd.get()); + if (newFd < 0) { + return NN_ERROR() << "Couldn't dup a file descriptor"; + } + nativeHandle.fds.emplace_back(newFd); + } + return Memory{ + .handle = std::move(nativeHandle), + .size = memory.size, + .name = memory.name, + }; +} + +GeneralResult clone(const RequestMemoryPool& requestPool) { + using Tag = RequestMemoryPool::Tag; + switch (requestPool.getTag()) { + case Tag::pool: + return RequestMemoryPool::make(NN_TRY(clone(requestPool.get()))); + case Tag::token: + return RequestMemoryPool::make(requestPool.get()); + } + // Using explicit type conversion because std::variant inside the RequestMemoryPool confuses the + // compiler. + return (NN_ERROR() << "Unrecognized request pool tag: " << requestPool.getTag()) + . + operator GeneralResult(); +} + +GeneralResult clone(const Request& request) { + return Request{ + .inputs = request.inputs, + .outputs = request.outputs, + .pools = NN_TRY(clone(request.pools)), + }; +} + +GeneralResult clone(const Model& model) { + return Model{ .main = model.main, .referenced = model.referenced, .operandValues = model.operandValues, - .pools = {}, + .pools = NN_TRY(clone(model.pools)), .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, .extensionNameToPrefix = model.extensionNameToPrefix, }; - newModel.pools.reserve(model.pools.size()); - for (const auto& pool : model.pools) { - common::NativeHandle nativeHandle; - nativeHandle.ints = pool.handle.ints; - nativeHandle.fds.reserve(pool.handle.fds.size()); - for (const auto& fd : pool.handle.fds) { - const int newFd = dup(fd.get()); - if (newFd == -1) { - return NN_ERROR() << "Couldn't dup a file descriptor."; - } - nativeHandle.fds.emplace_back(newFd); - } - Memory memory = { - .handle = std::move(nativeHandle), - .size = pool.size, - .name = pool.name, - }; - newModel.pools.push_back(std::move(memory)); - } - return newModel; } } // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/vts/OWNERS b/neuralnetworks/aidl/vts/OWNERS new file mode 100644 index 0000000000..6719a5b3a2 --- /dev/null +++ b/neuralnetworks/aidl/vts/OWNERS @@ -0,0 +1,12 @@ +# Neuralnetworks team +butlermichael@google.com +dgross@google.com +jeanluc@google.com +levp@google.com +miaowang@google.com +mikie@google.com +mks@google.com +pszczepaniak@google.com +slavash@google.com +vddang@google.com +xusongw@google.com diff --git a/neuralnetworks/aidl/vts/functional/Android.bp b/neuralnetworks/aidl/vts/functional/Android.bp new file mode 100644 index 0000000000..aa7afbf6a7 --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/Android.bp @@ -0,0 +1,68 @@ +// +// 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. +// + +cc_test { + name: "VtsHalNeuralnetworksTargetTest", + defaults: [ + "neuralnetworks_vts_functional_defaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: [ + "BasicTests.cpp", + "Callbacks.cpp", + "CompilationCachingTests.cpp", + "GeneratedTestHarness.cpp", + "MemoryDomainTests.cpp", + "QualityOfServiceTests.cpp", + "TestAssertions.cpp", + "TestMain.cpp", + "Utils.cpp", + "ValidateModel.cpp", + "ValidateRequest.cpp", + "VtsHalNeuralnetworks.cpp", + ], + shared_libs: [ + "libbinder_ndk", + "libnativewindow", + "libvndksupport", + ], + static_libs: [ + "android.hardware.common-V2-ndk_platform", + "android.hardware.neuralnetworks-V1-ndk_platform", + "android.hidl.allocator@1.0", + "android.hidl.memory@1.0", + "libgmock", + "libhidlmemory", + "libneuralnetworks_generated_test_harness", + "libneuralnetworks_utils", + "libsync", + "neuralnetworks_utils_hal_aidl", + ], + whole_static_libs: [ + "neuralnetworks_generated_V1_0_example", + "neuralnetworks_generated_V1_1_example", + "neuralnetworks_generated_V1_2_example", + "neuralnetworks_generated_V1_3_example", + ], + header_libs: [ + "libbase_headers", + "libneuralnetworks_headers", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/neuralnetworks/aidl/vts/functional/AndroidTest.xml b/neuralnetworks/aidl/vts/functional/AndroidTest.xml new file mode 100644 index 0000000000..384d42078f --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/AndroidTest.xml @@ -0,0 +1,33 @@ + + + + diff --git a/neuralnetworks/aidl/vts/functional/BasicTests.cpp b/neuralnetworks/aidl/vts/functional/BasicTests.cpp new file mode 100644 index 0000000000..b2f4507c22 --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/BasicTests.cpp @@ -0,0 +1,193 @@ +/* + * 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. + */ + +#define LOG_TAG "neuralnetworks_aidl_hal_test" + +#include +#include +#include +#include +#include +#include + +#include "Utils.h" +#include "VtsHalNeuralnetworks.h" + +namespace aidl::android::hardware::neuralnetworks::vts::functional { + +using implementation::PreparedModelCallback; + +// create device test +TEST_P(NeuralNetworksAidlTest, CreateDevice) {} + +// initialization +TEST_P(NeuralNetworksAidlTest, GetCapabilitiesTest) { + Capabilities capabilities; + const auto retStatus = kDevice->getCapabilities(&capabilities); + ASSERT_TRUE(retStatus.isOk()); + + auto isPositive = [](const PerformanceInfo& perf) { + return perf.execTime > 0.0f && perf.powerUsage > 0.0f; + }; + + EXPECT_TRUE(isPositive(capabilities.relaxedFloat32toFloat16PerformanceScalar)); + EXPECT_TRUE(isPositive(capabilities.relaxedFloat32toFloat16PerformanceTensor)); + const auto& opPerf = capabilities.operandPerformance; + EXPECT_TRUE( + std::all_of(opPerf.begin(), opPerf.end(), + [isPositive](const OperandPerformance& a) { return isPositive(a.info); })); + EXPECT_TRUE(std::is_sorted(opPerf.begin(), opPerf.end(), + [](const OperandPerformance& a, const OperandPerformance& b) { + return a.type < b.type; + })); + EXPECT_TRUE(std::all_of(opPerf.begin(), opPerf.end(), [](const OperandPerformance& a) { + return a.type != OperandType::SUBGRAPH; + })); + EXPECT_TRUE(isPositive(capabilities.ifPerformance)); + EXPECT_TRUE(isPositive(capabilities.whilePerformance)); +} + +// detect cycle +TEST_P(NeuralNetworksAidlTest, CycleTest) { + // opnd0 = TENSOR_FLOAT32 // model input + // opnd1 = TENSOR_FLOAT32 // model input + // opnd2 = INT32 // model input + // opnd3 = ADD(opnd0, opnd4, opnd2) + // opnd4 = ADD(opnd1, opnd3, opnd2) + // opnd5 = ADD(opnd4, opnd0, opnd2) // model output + // + // +-----+ + // | | + // v | + // 3 = ADD(0, 4, 2) | + // | | + // +----------+ | + // | | + // v | + // 4 = ADD(1, 3, 2) | + // | | + // +----------------+ + // | + // | + // +-------+ + // | + // v + // 5 = ADD(4, 0, 2) + + const std::vector operands = { + { + // operands[0] + .type = OperandType::TENSOR_FLOAT32, + .dimensions = {1}, + .scale = 0.0f, + .zeroPoint = 0, + .lifetime = OperandLifeTime::SUBGRAPH_INPUT, + .location = {.poolIndex = 0, .offset = 0, .length = 0}, + }, + { + // operands[1] + .type = OperandType::TENSOR_FLOAT32, + .dimensions = {1}, + .scale = 0.0f, + .zeroPoint = 0, + .lifetime = OperandLifeTime::SUBGRAPH_INPUT, + .location = {.poolIndex = 0, .offset = 0, .length = 0}, + }, + { + // operands[2] + .type = OperandType::INT32, + .dimensions = {}, + .scale = 0.0f, + .zeroPoint = 0, + .lifetime = OperandLifeTime::SUBGRAPH_INPUT, + .location = {.poolIndex = 0, .offset = 0, .length = 0}, + }, + { + // operands[3] + .type = OperandType::TENSOR_FLOAT32, + .dimensions = {1}, + .scale = 0.0f, + .zeroPoint = 0, + .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, + .location = {.poolIndex = 0, .offset = 0, .length = 0}, + }, + { + // operands[4] + .type = OperandType::TENSOR_FLOAT32, + .dimensions = {1}, + .scale = 0.0f, + .zeroPoint = 0, + .lifetime = OperandLifeTime::TEMPORARY_VARIABLE, + .location = {.poolIndex = 0, .offset = 0, .length = 0}, + }, + { + // operands[5] + .type = OperandType::TENSOR_FLOAT32, + .dimensions = {1}, + .scale = 0.0f, + .zeroPoint = 0, + .lifetime = OperandLifeTime::SUBGRAPH_OUTPUT, + .location = {.poolIndex = 0, .offset = 0, .length = 0}, + }, + }; + + const std::vector operations = { + {.type = OperationType::ADD, .inputs = {0, 4, 2}, .outputs = {3}}, + {.type = OperationType::ADD, .inputs = {1, 3, 2}, .outputs = {4}}, + {.type = OperationType::ADD, .inputs = {4, 0, 2}, .outputs = {5}}, + }; + + Subgraph subgraph = { + .operands = operands, + .operations = operations, + .inputIndexes = {0, 1, 2}, + .outputIndexes = {5}, + }; + const Model model = { + .main = std::move(subgraph), + .referenced = {}, + .operandValues = {}, + .pools = {}, + }; + + // ensure that getSupportedOperations() checks model validity + std::vector supportedOps; + const auto supportedOpsStatus = kDevice->getSupportedOperations(model, &supportedOps); + ASSERT_FALSE(supportedOpsStatus.isOk()); + ASSERT_EQ(supportedOpsStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(supportedOpsStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); + + // ensure that prepareModel() checks model validity + auto preparedModelCallback = ndk::SharedRefBase::make(); + auto prepareLaunchStatus = + kDevice->prepareModel(model, ExecutionPreference::FAST_SINGLE_ANSWER, kDefaultPriority, + kNoDeadline, {}, {}, kEmptyCacheToken, preparedModelCallback); + // Note that preparation can fail for reasons other than an + // invalid model (invalid model should result in + // INVALID_ARGUMENT) -- for example, perhaps not all + // operations are supported, or perhaps the device hit some + // kind of capacity limit. + ASSERT_FALSE(prepareLaunchStatus.isOk()); + EXPECT_EQ(prepareLaunchStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + EXPECT_NE(static_cast(prepareLaunchStatus.getServiceSpecificError()), + ErrorStatus::NONE); + + EXPECT_NE(preparedModelCallback->getStatus(), ErrorStatus::NONE); + EXPECT_EQ(preparedModelCallback->getPreparedModel(), nullptr); +} + +} // namespace aidl::android::hardware::neuralnetworks::vts::functional diff --git a/neuralnetworks/aidl/vts/functional/Callbacks.cpp b/neuralnetworks/aidl/vts/functional/Callbacks.cpp new file mode 100644 index 0000000000..ca2bb48a3e --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/Callbacks.cpp @@ -0,0 +1,59 @@ +/* + * 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. + */ + +#define LOG_TAG "Callbacks" + +#include "Callbacks.h" + +#include +#include +#include + +namespace aidl::android::hardware::neuralnetworks::implementation { + +ndk::ScopedAStatus PreparedModelCallback::notify( + ErrorStatus errorStatus, const std::shared_ptr& preparedModel) { + { + std::lock_guard hold(mMutex); + // quick-return if object has already been notified + if (mNotified) { + return ndk::ScopedAStatus::ok(); + } + // store results and mark as notified + mErrorStatus = errorStatus; + mPreparedModel = preparedModel; + mNotified = true; + } + mCondition.notify_all(); + return ndk::ScopedAStatus::ok(); +} + +void PreparedModelCallback::wait() const { + std::unique_lock lock(mMutex); + mCondition.wait(lock, [this] { return mNotified; }); +} + +ErrorStatus PreparedModelCallback::getStatus() const { + wait(); + return mErrorStatus; +} + +std::shared_ptr PreparedModelCallback::getPreparedModel() const { + wait(); + return mPreparedModel; +} + +} // namespace aidl::android::hardware::neuralnetworks::implementation diff --git a/neuralnetworks/aidl/vts/functional/Callbacks.h b/neuralnetworks/aidl/vts/functional/Callbacks.h new file mode 100644 index 0000000000..0eb4d5f4a6 --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/Callbacks.h @@ -0,0 +1,131 @@ +/* + * 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_NEURALNETWORKS_AIDL_CALLBACKS_H +#define ANDROID_HARDWARE_NEURALNETWORKS_AIDL_CALLBACKS_H + +#include +#include +#include + +#include +#include +#include + +/* + * The Callback classes are used internally by the NeuralNetworks runtime to + * synchronize between different threads. An asynchronous task is launched + * paired with a callback object. When a client thread requires the output being + * generated by the asynchronous task, the client thread can wait for the result + * and be blocked until it has completed. Any wait may safely be called + * concurrently, even on the same callback object. When the asynchronous task + * has finished its workload, it must immediately call "notify". If the + * asynchronous task has failed to launch, the function that tried to launch the + * asynchronous task must immediately call "notify". This "notify" call + * awakens any client threads waiting on the callback object. + * + * These classes exist to enable synchronization across AIDL. When + * synchronization is only required in the same process, consider using + * std::future, std::mutex, std::condition_variable, or std::experimental::latch + * instead. + */ + +namespace aidl::android::hardware::neuralnetworks::implementation { + +/** + * The PreparedModelCallback class is used to receive the error status of + * preparing a model as well as the prepared model from a task executing + * asynchronously with respect to the runtime. If a calling thread calls wait + * or get* on a PreparedModelCallback object and the corresponding asynchronous + * task has not finished preparing the model, the calling thread will block + * until the asynchronous task has called notify. + * + * If the callback object is notified more than once, only the results of the + * first call to notify are used, and the results from subsequent calls are + * discarded. + * + * This callback object is passed as an argument to IDevice::prepareModel*. + */ +class PreparedModelCallback : public BnPreparedModelCallback { + public: + /** + * IPreparedModelCallback::notify marks the callback object with the return + * status of the asynchronous model preparation along with the prepared + * model, and allows all prior and future wait calls on the + * PreparedModelCallback object to proceed. + * + * IPreparedModelCallback::notify must be called on a given PreparedModelCallback object. + * + * If the callback object is notified more than once, only the results of + * the first call to notify are used, and the results from subsequent calls + * are discarded. + * + * @param status Error status returned from asynchronously preparing the + * model; will be: + * - NONE if the asynchronous preparation was successful + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - INVALID_ARGUMENT if the input model is invalid + * @param preparedModel Returned model that has been prepared for execution, + * nullptr if the model was unable to be prepared. + */ + ndk::ScopedAStatus notify(ErrorStatus status, + const std::shared_ptr& preparedModel) override; + + /** + * PreparedModelCallback::wait blocks until notify has been called on the + * callback object. + */ + void wait() const; + + /** + * Retrieves the error status returned from the asynchronous task launched + * by IDevice::prepareModel*. If IDevice::prepareModel* has not finished + * asynchronously preparing the model, this call will block until the + * asynchronous task notifies the object. + * + * @return status Error status returned from asynchronously preparing the + * model; will be: + * - NONE if the asynchronous preparation was successful + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - INVALID_ARGUMENT if the input model is invalid + */ + ErrorStatus getStatus() const; + + /** + * Retrieves the model that has been prepared for execution from the + * asynchronous task launched by IDevice::prepareModel*. If + * IDevice::prepareModel* has not finished asynchronously preparing the + * model, this call will block until the asynchronous task notifies the + * object. + * + * @return preparedModel Returned model that has been prepared for + * execution, nullptr if the model was unable to be prepared. + */ + std::shared_ptr getPreparedModel() const; + + private: + mutable std::mutex mMutex; + mutable std::condition_variable mCondition; + bool mNotified GUARDED_BY(mMutex) = false; + ErrorStatus mErrorStatus = ErrorStatus::GENERAL_FAILURE; + std::shared_ptr mPreparedModel; +}; + +} // namespace aidl::android::hardware::neuralnetworks::implementation + +#endif // ANDROID_HARDWARE_NEURALNETWORKS_AIDL_CALLBACKS_H diff --git a/neuralnetworks/aidl/vts/functional/CompilationCachingTests.cpp b/neuralnetworks/aidl/vts/functional/CompilationCachingTests.cpp new file mode 100644 index 0000000000..e0b529f280 --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/CompilationCachingTests.cpp @@ -0,0 +1,1177 @@ +/* + * 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. + */ + +#define LOG_TAG "neuralnetworks_aidl_hal_test" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "Callbacks.h" +#include "GeneratedTestHarness.h" +#include "MemoryUtils.h" +#include "TestHarness.h" +#include "Utils.h" +#include "VtsHalNeuralnetworks.h" + +// Forward declaration of the mobilenet generated test models in +// frameworks/ml/nn/runtime/test/generated/. +namespace generated_tests::mobilenet_224_gender_basic_fixed { +const test_helper::TestModel& get_test_model(); +} // namespace generated_tests::mobilenet_224_gender_basic_fixed + +namespace generated_tests::mobilenet_quantized { +const test_helper::TestModel& get_test_model(); +} // namespace generated_tests::mobilenet_quantized + +namespace aidl::android::hardware::neuralnetworks::vts::functional { + +using namespace test_helper; +using implementation::PreparedModelCallback; + +namespace float32_model { + +constexpr auto get_test_model = generated_tests::mobilenet_224_gender_basic_fixed::get_test_model; + +} // namespace float32_model + +namespace quant8_model { + +constexpr auto get_test_model = generated_tests::mobilenet_quantized::get_test_model; + +} // namespace quant8_model + +namespace { + +enum class AccessMode { READ_WRITE, READ_ONLY, WRITE_ONLY }; + +// Creates cache handles based on provided file groups. +// The outer vector corresponds to handles and the inner vector is for fds held by each handle. +void createCacheFds(const std::vector& files, const std::vector& mode, + std::vector* fds) { + fds->clear(); + fds->reserve(files.size()); + for (uint32_t i = 0; i < files.size(); i++) { + const auto& file = files[i]; + int fd; + if (mode[i] == AccessMode::READ_ONLY) { + fd = open(file.c_str(), O_RDONLY); + } else if (mode[i] == AccessMode::WRITE_ONLY) { + fd = open(file.c_str(), O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); + } else if (mode[i] == AccessMode::READ_WRITE) { + fd = open(file.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); + } else { + FAIL(); + } + ASSERT_GE(fd, 0); + fds->emplace_back(fd); + } +} + +void createCacheFds(const std::vector& files, AccessMode mode, + std::vector* fds) { + createCacheFds(files, std::vector(files.size(), mode), fds); +} + +// Create a chain of broadcast operations. The second operand is always constant tensor [1]. +// For simplicity, activation scalar is shared. The second operand is not shared +// in the model to let driver maintain a non-trivial size of constant data and the corresponding +// data locations in cache. +// +// --------- activation -------- +// ↓ ↓ ↓ ↓ +// E.g. input -> ADD -> ADD -> ADD -> ... -> ADD -> output +// ↑ ↑ ↑ ↑ +// [1] [1] [1] [1] +// +// This function assumes the operation is either ADD or MUL. +template +TestModel createLargeTestModelImpl(TestOperationType op, uint32_t len) { + EXPECT_TRUE(op == TestOperationType::ADD || op == TestOperationType::MUL); + + // Model operations and operands. + std::vector operations(len); + std::vector operands(len * 2 + 2); + + // The activation scalar, value = 0. + operands[0] = { + .type = TestOperandType::INT32, + .dimensions = {}, + .numberOfConsumers = len, + .scale = 0.0f, + .zeroPoint = 0, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .data = TestBuffer::createFromVector({0}), + }; + + // The buffer value of the constant second operand. The logical value is always 1.0f. + CppType bufferValue; + // The scale of the first and second operand. + float scale1, scale2; + if (operandType == TestOperandType::TENSOR_FLOAT32) { + bufferValue = 1.0f; + scale1 = 0.0f; + scale2 = 0.0f; + } else if (op == TestOperationType::ADD) { + bufferValue = 1; + scale1 = 1.0f; + scale2 = 1.0f; + } else { + // To satisfy the constraint on quant8 MUL: input0.scale * input1.scale < output.scale, + // set input1 to have scale = 0.5f and bufferValue = 2, i.e. 1.0f in floating point. + bufferValue = 2; + scale1 = 1.0f; + scale2 = 0.5f; + } + + for (uint32_t i = 0; i < len; i++) { + const uint32_t firstInputIndex = i * 2 + 1; + const uint32_t secondInputIndex = firstInputIndex + 1; + const uint32_t outputIndex = secondInputIndex + 1; + + // The first operation input. + operands[firstInputIndex] = { + .type = operandType, + .dimensions = {1}, + .numberOfConsumers = 1, + .scale = scale1, + .zeroPoint = 0, + .lifetime = (i == 0 ? TestOperandLifeTime::MODEL_INPUT + : TestOperandLifeTime::TEMPORARY_VARIABLE), + .data = (i == 0 ? TestBuffer::createFromVector({1}) : TestBuffer()), + }; + + // The second operation input, value = 1. + operands[secondInputIndex] = { + .type = operandType, + .dimensions = {1}, + .numberOfConsumers = 1, + .scale = scale2, + .zeroPoint = 0, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .data = TestBuffer::createFromVector({bufferValue}), + }; + + // The operation. All operations share the same activation scalar. + // The output operand is created as an input in the next iteration of the loop, in the case + // of all but the last member of the chain; and after the loop as a model output, in the + // case of the last member of the chain. + operations[i] = { + .type = op, + .inputs = {firstInputIndex, secondInputIndex, /*activation scalar*/ 0}, + .outputs = {outputIndex}, + }; + } + + // For TestOperationType::ADD, output = 1 + 1 * len = len + 1 + // For TestOperationType::MUL, output = 1 * 1 ^ len = 1 + CppType outputResult = static_cast(op == TestOperationType::ADD ? len + 1u : 1u); + + // The model output. + operands.back() = { + .type = operandType, + .dimensions = {1}, + .numberOfConsumers = 0, + .scale = scale1, + .zeroPoint = 0, + .lifetime = TestOperandLifeTime::MODEL_OUTPUT, + .data = TestBuffer::createFromVector({outputResult}), + }; + + return { + .main = {.operands = std::move(operands), + .operations = std::move(operations), + .inputIndexes = {1}, + .outputIndexes = {len * 2 + 1}}, + .isRelaxed = false, + }; +} + +} // namespace + +// Tag for the compilation caching tests. +class CompilationCachingTestBase : public testing::Test { + protected: + CompilationCachingTestBase(std::shared_ptr device, OperandType type) + : kDevice(std::move(device)), kOperandType(type) {} + + void SetUp() override { + testing::Test::SetUp(); + ASSERT_NE(kDevice.get(), nullptr); + + // Create cache directory. The cache directory and a temporary cache file is always created + // to test the behavior of prepareModelFromCache, even when caching is not supported. + char cacheDirTemp[] = "/data/local/tmp/TestCompilationCachingXXXXXX"; + char* cacheDir = mkdtemp(cacheDirTemp); + ASSERT_NE(cacheDir, nullptr); + mCacheDir = cacheDir; + mCacheDir.push_back('/'); + + NumberOfCacheFiles numCacheFiles; + const auto ret = kDevice->getNumberOfCacheFilesNeeded(&numCacheFiles); + ASSERT_TRUE(ret.isOk()); + + mNumModelCache = numCacheFiles.numModelCache; + mNumDataCache = numCacheFiles.numDataCache; + ASSERT_GE(mNumModelCache, 0) << "Invalid numModelCache: " << mNumModelCache; + ASSERT_GE(mNumDataCache, 0) << "Invalid numDataCache: " << mNumDataCache; + mIsCachingSupported = mNumModelCache > 0 || mNumDataCache > 0; + + // Create empty cache files. + mTmpCache = mCacheDir + "tmp"; + for (uint32_t i = 0; i < mNumModelCache; i++) { + mModelCache.push_back({mCacheDir + "model" + std::to_string(i)}); + } + for (uint32_t i = 0; i < mNumDataCache; i++) { + mDataCache.push_back({mCacheDir + "data" + std::to_string(i)}); + } + // Placeholder handles, use AccessMode::WRITE_ONLY for createCacheFds to create files. + std::vector modelHandle, dataHandle, tmpHandle; + createCacheFds(mModelCache, AccessMode::WRITE_ONLY, &modelHandle); + createCacheFds(mDataCache, AccessMode::WRITE_ONLY, &dataHandle); + createCacheFds({mTmpCache}, AccessMode::WRITE_ONLY, &tmpHandle); + + if (!mIsCachingSupported) { + LOG(INFO) << "NN VTS: Early termination of test because vendor service does not " + "support compilation caching."; + std::cout << "[ ] Early termination of test because vendor service does not " + "support compilation caching." + << std::endl; + } + } + + void TearDown() override { + // If the test passes, remove the tmp directory. Otherwise, keep it for debugging purposes. + if (!testing::Test::HasFailure()) { + // Recursively remove the cache directory specified by mCacheDir. + auto callback = [](const char* entry, const struct stat*, int, struct FTW*) { + return remove(entry); + }; + nftw(mCacheDir.c_str(), callback, 128, FTW_DEPTH | FTW_MOUNT | FTW_PHYS); + } + testing::Test::TearDown(); + } + + // Model and examples creators. According to kOperandType, the following methods will return + // either float32 model/examples or the quant8 variant. + TestModel createTestModel() { + if (kOperandType == OperandType::TENSOR_FLOAT32) { + return float32_model::get_test_model(); + } else { + return quant8_model::get_test_model(); + } + } + + TestModel createLargeTestModel(OperationType op, uint32_t len) { + if (kOperandType == OperandType::TENSOR_FLOAT32) { + return createLargeTestModelImpl( + static_cast(op), len); + } else { + return createLargeTestModelImpl( + static_cast(op), len); + } + } + + // See if the service can handle the model. + bool isModelFullySupported(const Model& model) { + std::vector supportedOps; + const auto supportedCall = kDevice->getSupportedOperations(model, &supportedOps); + EXPECT_TRUE(supportedCall.isOk()); + EXPECT_EQ(supportedOps.size(), model.main.operations.size()); + if (!supportedCall.isOk() || supportedOps.size() != model.main.operations.size()) { + return false; + } + return std::all_of(supportedOps.begin(), supportedOps.end(), + [](bool valid) { return valid; }); + } + + void saveModelToCache(const Model& model, + const std::vector& modelCache, + const std::vector& dataCache, + std::shared_ptr* preparedModel = nullptr) { + if (preparedModel != nullptr) *preparedModel = nullptr; + + // Launch prepare model. + std::shared_ptr preparedModelCallback = + ndk::SharedRefBase::make(); + std::vector cacheToken(std::begin(mToken), std::end(mToken)); + const auto prepareLaunchStatus = kDevice->prepareModel( + model, ExecutionPreference::FAST_SINGLE_ANSWER, kDefaultPriority, kNoDeadline, + modelCache, dataCache, cacheToken, preparedModelCallback); + ASSERT_TRUE(prepareLaunchStatus.isOk()); + + // Retrieve prepared model. + preparedModelCallback->wait(); + ASSERT_EQ(preparedModelCallback->getStatus(), ErrorStatus::NONE); + if (preparedModel != nullptr) { + *preparedModel = preparedModelCallback->getPreparedModel(); + } + } + + bool checkEarlyTermination(ErrorStatus status) { + if (status == ErrorStatus::GENERAL_FAILURE) { + LOG(INFO) << "NN VTS: Early termination of test because vendor service cannot " + "save the prepared model that it does not support."; + std::cout << "[ ] Early termination of test because vendor service cannot " + "save the prepared model that it does not support." + << std::endl; + return true; + } + return false; + } + + bool checkEarlyTermination(const Model& model) { + if (!isModelFullySupported(model)) { + LOG(INFO) << "NN VTS: Early termination of test because vendor service cannot " + "prepare model that it does not support."; + std::cout << "[ ] Early termination of test because vendor service cannot " + "prepare model that it does not support." + << std::endl; + return true; + } + return false; + } + + void prepareModelFromCache(const std::vector& modelCache, + const std::vector& dataCache, + std::shared_ptr* preparedModel, + ErrorStatus* status) { + // Launch prepare model from cache. + std::shared_ptr preparedModelCallback = + ndk::SharedRefBase::make(); + std::vector cacheToken(std::begin(mToken), std::end(mToken)); + const auto prepareLaunchStatus = kDevice->prepareModelFromCache( + kNoDeadline, modelCache, dataCache, cacheToken, preparedModelCallback); + ASSERT_TRUE(prepareLaunchStatus.isOk() || + prepareLaunchStatus.getExceptionCode() == EX_SERVICE_SPECIFIC) + << "prepareLaunchStatus: " << prepareLaunchStatus.getDescription(); + if (!prepareLaunchStatus.isOk()) { + *preparedModel = nullptr; + *status = static_cast(prepareLaunchStatus.getServiceSpecificError()); + return; + } + + // Retrieve prepared model. + preparedModelCallback->wait(); + *status = preparedModelCallback->getStatus(); + *preparedModel = preparedModelCallback->getPreparedModel(); + } + + // Absolute path to the temporary cache directory. + std::string mCacheDir; + + // Groups of file paths for model and data cache in the tmp cache directory, initialized with + // size = mNum{Model|Data}Cache. The outer vector corresponds to handles and the inner vector is + // for fds held by each handle. + std::vector mModelCache; + std::vector mDataCache; + + // A separate temporary file path in the tmp cache directory. + std::string mTmpCache; + + uint8_t mToken[static_cast(IDevice::BYTE_SIZE_OF_CACHE_TOKEN)] = {}; + uint32_t mNumModelCache; + uint32_t mNumDataCache; + uint32_t mIsCachingSupported; + + const std::shared_ptr kDevice; + // The primary data type of the testModel. + const OperandType kOperandType; +}; + +using CompilationCachingTestParam = std::tuple; + +// A parameterized fixture of CompilationCachingTestBase. Every test will run twice, with the first +// pass running with float32 models and the second pass running with quant8 models. +class CompilationCachingTest : public CompilationCachingTestBase, + public testing::WithParamInterface { + protected: + CompilationCachingTest() + : CompilationCachingTestBase(getData(std::get(GetParam())), + std::get(GetParam())) {} +}; + +TEST_P(CompilationCachingTest, CacheSavingAndRetrieval) { + // Create test HIDL model and compile. + const TestModel& testModel = createTestModel(); + const Model model = createModel(testModel); + if (checkEarlyTermination(model)) return; + std::shared_ptr preparedModel = nullptr; + + // Save the compilation to cache. + { + std::vector modelCache, dataCache; + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + saveModelToCache(model, modelCache, dataCache); + } + + // Retrieve preparedModel from cache. + { + preparedModel = nullptr; + ErrorStatus status; + std::vector modelCache, dataCache; + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + if (!mIsCachingSupported) { + ASSERT_EQ(status, ErrorStatus::GENERAL_FAILURE); + ASSERT_EQ(preparedModel, nullptr); + return; + } else if (checkEarlyTermination(status)) { + ASSERT_EQ(preparedModel, nullptr); + return; + } else { + ASSERT_EQ(status, ErrorStatus::NONE); + ASSERT_NE(preparedModel, nullptr); + } + } + + // Execute and verify results. + EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL); +} + +TEST_P(CompilationCachingTest, CacheSavingAndRetrievalNonZeroOffset) { + // Create test HIDL model and compile. + const TestModel& testModel = createTestModel(); + const Model model = createModel(testModel); + if (checkEarlyTermination(model)) return; + std::shared_ptr preparedModel = nullptr; + + // Save the compilation to cache. + { + std::vector modelCache, dataCache; + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + uint8_t placeholderBytes[] = {0, 0}; + // Write a placeholder integer to the cache. + // The driver should be able to handle non-empty cache and non-zero fd offset. + for (uint32_t i = 0; i < modelCache.size(); i++) { + ASSERT_EQ(write(modelCache[i].get(), &placeholderBytes, sizeof(placeholderBytes)), + sizeof(placeholderBytes)); + } + for (uint32_t i = 0; i < dataCache.size(); i++) { + ASSERT_EQ(write(dataCache[i].get(), &placeholderBytes, sizeof(placeholderBytes)), + sizeof(placeholderBytes)); + } + saveModelToCache(model, modelCache, dataCache); + } + + // Retrieve preparedModel from cache. + { + preparedModel = nullptr; + ErrorStatus status; + std::vector modelCache, dataCache; + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + uint8_t placeholderByte = 0; + // Advance the offset of each handle by one byte. + // The driver should be able to handle non-zero fd offset. + for (uint32_t i = 0; i < modelCache.size(); i++) { + ASSERT_GE(read(modelCache[i].get(), &placeholderByte, 1), 0); + } + for (uint32_t i = 0; i < dataCache.size(); i++) { + ASSERT_GE(read(dataCache[i].get(), &placeholderByte, 1), 0); + } + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + if (!mIsCachingSupported) { + ASSERT_EQ(status, ErrorStatus::GENERAL_FAILURE); + ASSERT_EQ(preparedModel, nullptr); + return; + } else if (checkEarlyTermination(status)) { + ASSERT_EQ(preparedModel, nullptr); + return; + } else { + ASSERT_EQ(status, ErrorStatus::NONE); + ASSERT_NE(preparedModel, nullptr); + } + } + + // Execute and verify results. + EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL); +} + +TEST_P(CompilationCachingTest, SaveToCacheInvalidNumCache) { + // Create test HIDL model and compile. + const TestModel& testModel = createTestModel(); + const Model model = createModel(testModel); + if (checkEarlyTermination(model)) return; + + // Test with number of model cache files greater than mNumModelCache. + { + std::vector modelCache, dataCache; + // Pass an additional cache file for model cache. + mModelCache.push_back({mTmpCache}); + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + mModelCache.pop_back(); + std::shared_ptr preparedModel = nullptr; + saveModelToCache(model, modelCache, dataCache, &preparedModel); + ASSERT_NE(preparedModel, nullptr); + // Execute and verify results. + EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL); + // Check if prepareModelFromCache fails. + preparedModel = nullptr; + ErrorStatus status; + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + if (status != ErrorStatus::INVALID_ARGUMENT) { + ASSERT_EQ(status, ErrorStatus::GENERAL_FAILURE); + } + ASSERT_EQ(preparedModel, nullptr); + } + + // Test with number of model cache files smaller than mNumModelCache. + if (mModelCache.size() > 0) { + std::vector modelCache, dataCache; + // Pop out the last cache file. + auto tmp = mModelCache.back(); + mModelCache.pop_back(); + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + mModelCache.push_back(tmp); + std::shared_ptr preparedModel = nullptr; + saveModelToCache(model, modelCache, dataCache, &preparedModel); + ASSERT_NE(preparedModel, nullptr); + // Execute and verify results. + EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL); + // Check if prepareModelFromCache fails. + preparedModel = nullptr; + ErrorStatus status; + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + if (status != ErrorStatus::INVALID_ARGUMENT) { + ASSERT_EQ(status, ErrorStatus::GENERAL_FAILURE); + } + ASSERT_EQ(preparedModel, nullptr); + } + + // Test with number of data cache files greater than mNumDataCache. + { + std::vector modelCache, dataCache; + // Pass an additional cache file for data cache. + mDataCache.push_back({mTmpCache}); + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + mDataCache.pop_back(); + std::shared_ptr preparedModel = nullptr; + saveModelToCache(model, modelCache, dataCache, &preparedModel); + ASSERT_NE(preparedModel, nullptr); + // Execute and verify results. + EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL); + // Check if prepareModelFromCache fails. + preparedModel = nullptr; + ErrorStatus status; + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + if (status != ErrorStatus::INVALID_ARGUMENT) { + ASSERT_EQ(status, ErrorStatus::GENERAL_FAILURE); + } + ASSERT_EQ(preparedModel, nullptr); + } + + // Test with number of data cache files smaller than mNumDataCache. + if (mDataCache.size() > 0) { + std::vector modelCache, dataCache; + // Pop out the last cache file. + auto tmp = mDataCache.back(); + mDataCache.pop_back(); + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + mDataCache.push_back(tmp); + std::shared_ptr preparedModel = nullptr; + saveModelToCache(model, modelCache, dataCache, &preparedModel); + ASSERT_NE(preparedModel, nullptr); + // Execute and verify results. + EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL); + // Check if prepareModelFromCache fails. + preparedModel = nullptr; + ErrorStatus status; + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + if (status != ErrorStatus::INVALID_ARGUMENT) { + ASSERT_EQ(status, ErrorStatus::GENERAL_FAILURE); + } + ASSERT_EQ(preparedModel, nullptr); + } +} + +TEST_P(CompilationCachingTest, PrepareModelFromCacheInvalidNumCache) { + // Create test HIDL model and compile. + const TestModel& testModel = createTestModel(); + const Model model = createModel(testModel); + if (checkEarlyTermination(model)) return; + + // Save the compilation to cache. + { + std::vector modelCache, dataCache; + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + saveModelToCache(model, modelCache, dataCache); + } + + // Test with number of model cache files greater than mNumModelCache. + { + std::shared_ptr preparedModel = nullptr; + ErrorStatus status; + std::vector modelCache, dataCache; + mModelCache.push_back({mTmpCache}); + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + mModelCache.pop_back(); + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + if (status != ErrorStatus::GENERAL_FAILURE) { + ASSERT_EQ(status, ErrorStatus::INVALID_ARGUMENT); + } + ASSERT_EQ(preparedModel, nullptr); + } + + // Test with number of model cache files smaller than mNumModelCache. + if (mModelCache.size() > 0) { + std::shared_ptr preparedModel = nullptr; + ErrorStatus status; + std::vector modelCache, dataCache; + auto tmp = mModelCache.back(); + mModelCache.pop_back(); + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + mModelCache.push_back(tmp); + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + if (status != ErrorStatus::GENERAL_FAILURE) { + ASSERT_EQ(status, ErrorStatus::INVALID_ARGUMENT); + } + ASSERT_EQ(preparedModel, nullptr); + } + + // Test with number of data cache files greater than mNumDataCache. + { + std::shared_ptr preparedModel = nullptr; + ErrorStatus status; + std::vector modelCache, dataCache; + mDataCache.push_back({mTmpCache}); + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + mDataCache.pop_back(); + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + if (status != ErrorStatus::GENERAL_FAILURE) { + ASSERT_EQ(status, ErrorStatus::INVALID_ARGUMENT); + } + ASSERT_EQ(preparedModel, nullptr); + } + + // Test with number of data cache files smaller than mNumDataCache. + if (mDataCache.size() > 0) { + std::shared_ptr preparedModel = nullptr; + ErrorStatus status; + std::vector modelCache, dataCache; + auto tmp = mDataCache.back(); + mDataCache.pop_back(); + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + mDataCache.push_back(tmp); + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + if (status != ErrorStatus::GENERAL_FAILURE) { + ASSERT_EQ(status, ErrorStatus::INVALID_ARGUMENT); + } + ASSERT_EQ(preparedModel, nullptr); + } +} + +TEST_P(CompilationCachingTest, SaveToCacheInvalidAccessMode) { + // Create test HIDL model and compile. + const TestModel& testModel = createTestModel(); + const Model model = createModel(testModel); + if (checkEarlyTermination(model)) return; + std::vector modelCacheMode(mNumModelCache, AccessMode::READ_WRITE); + std::vector dataCacheMode(mNumDataCache, AccessMode::READ_WRITE); + + // Go through each handle in model cache, test with invalid access mode. + for (uint32_t i = 0; i < mNumModelCache; i++) { + std::vector modelCache, dataCache; + modelCacheMode[i] = AccessMode::READ_ONLY; + createCacheFds(mModelCache, modelCacheMode, &modelCache); + createCacheFds(mDataCache, dataCacheMode, &dataCache); + modelCacheMode[i] = AccessMode::READ_WRITE; + std::shared_ptr preparedModel = nullptr; + saveModelToCache(model, modelCache, dataCache, &preparedModel); + ASSERT_NE(preparedModel, nullptr); + // Execute and verify results. + EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL); + // Check if prepareModelFromCache fails. + preparedModel = nullptr; + ErrorStatus status; + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + if (status != ErrorStatus::INVALID_ARGUMENT) { + ASSERT_EQ(status, ErrorStatus::GENERAL_FAILURE); + } + ASSERT_EQ(preparedModel, nullptr); + } + + // Go through each handle in data cache, test with invalid access mode. + for (uint32_t i = 0; i < mNumDataCache; i++) { + std::vector modelCache, dataCache; + dataCacheMode[i] = AccessMode::READ_ONLY; + createCacheFds(mModelCache, modelCacheMode, &modelCache); + createCacheFds(mDataCache, dataCacheMode, &dataCache); + dataCacheMode[i] = AccessMode::READ_WRITE; + std::shared_ptr preparedModel = nullptr; + saveModelToCache(model, modelCache, dataCache, &preparedModel); + ASSERT_NE(preparedModel, nullptr); + // Execute and verify results. + EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL); + // Check if prepareModelFromCache fails. + preparedModel = nullptr; + ErrorStatus status; + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + if (status != ErrorStatus::INVALID_ARGUMENT) { + ASSERT_EQ(status, ErrorStatus::GENERAL_FAILURE); + } + ASSERT_EQ(preparedModel, nullptr); + } +} + +TEST_P(CompilationCachingTest, PrepareModelFromCacheInvalidAccessMode) { + // Create test HIDL model and compile. + const TestModel& testModel = createTestModel(); + const Model model = createModel(testModel); + if (checkEarlyTermination(model)) return; + std::vector modelCacheMode(mNumModelCache, AccessMode::READ_WRITE); + std::vector dataCacheMode(mNumDataCache, AccessMode::READ_WRITE); + + // Save the compilation to cache. + { + std::vector modelCache, dataCache; + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + saveModelToCache(model, modelCache, dataCache); + } + + // Go through each handle in model cache, test with invalid access mode. + for (uint32_t i = 0; i < mNumModelCache; i++) { + std::shared_ptr preparedModel = nullptr; + ErrorStatus status; + std::vector modelCache, dataCache; + modelCacheMode[i] = AccessMode::WRITE_ONLY; + createCacheFds(mModelCache, modelCacheMode, &modelCache); + createCacheFds(mDataCache, dataCacheMode, &dataCache); + modelCacheMode[i] = AccessMode::READ_WRITE; + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + ASSERT_EQ(status, ErrorStatus::GENERAL_FAILURE); + ASSERT_EQ(preparedModel, nullptr); + } + + // Go through each handle in data cache, test with invalid access mode. + for (uint32_t i = 0; i < mNumDataCache; i++) { + std::shared_ptr preparedModel = nullptr; + ErrorStatus status; + std::vector modelCache, dataCache; + dataCacheMode[i] = AccessMode::WRITE_ONLY; + createCacheFds(mModelCache, modelCacheMode, &modelCache); + createCacheFds(mDataCache, dataCacheMode, &dataCache); + dataCacheMode[i] = AccessMode::READ_WRITE; + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + ASSERT_EQ(status, ErrorStatus::GENERAL_FAILURE); + ASSERT_EQ(preparedModel, nullptr); + } +} + +// Copy file contents between files. +// The vector sizes must match. +static void copyCacheFiles(const std::vector& from, + const std::vector& to) { + constexpr size_t kBufferSize = 1000000; + uint8_t buffer[kBufferSize]; + + ASSERT_EQ(from.size(), to.size()); + for (uint32_t i = 0; i < from.size(); i++) { + int fromFd = open(from[i].c_str(), O_RDONLY); + int toFd = open(to[i].c_str(), O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); + ASSERT_GE(fromFd, 0); + ASSERT_GE(toFd, 0); + + ssize_t readBytes; + while ((readBytes = read(fromFd, &buffer, kBufferSize)) > 0) { + ASSERT_EQ(write(toFd, &buffer, readBytes), readBytes); + } + ASSERT_GE(readBytes, 0); + + close(fromFd); + close(toFd); + } +} + +// Number of operations in the large test model. +constexpr uint32_t kLargeModelSize = 100; +constexpr uint32_t kNumIterationsTOCTOU = 100; + +TEST_P(CompilationCachingTest, SaveToCache_TOCTOU) { + if (!mIsCachingSupported) return; + + // Create test models and check if fully supported by the service. + const TestModel testModelMul = createLargeTestModel(OperationType::MUL, kLargeModelSize); + const Model modelMul = createModel(testModelMul); + if (checkEarlyTermination(modelMul)) return; + const TestModel testModelAdd = createLargeTestModel(OperationType::ADD, kLargeModelSize); + const Model modelAdd = createModel(testModelAdd); + if (checkEarlyTermination(modelAdd)) return; + + // Save the modelMul compilation to cache. + auto modelCacheMul = mModelCache; + for (auto& cache : modelCacheMul) { + cache.append("_mul"); + } + { + std::vector modelCache, dataCache; + createCacheFds(modelCacheMul, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + saveModelToCache(modelMul, modelCache, dataCache); + } + + // Use a different token for modelAdd. + mToken[0]++; + + // This test is probabilistic, so we run it multiple times. + for (uint32_t i = 0; i < kNumIterationsTOCTOU; i++) { + // Save the modelAdd compilation to cache. + { + std::vector modelCache, dataCache; + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + + // Spawn a thread to copy the cache content concurrently while saving to cache. + std::thread thread(copyCacheFiles, std::cref(modelCacheMul), std::cref(mModelCache)); + saveModelToCache(modelAdd, modelCache, dataCache); + thread.join(); + } + + // Retrieve preparedModel from cache. + { + std::shared_ptr preparedModel = nullptr; + ErrorStatus status; + std::vector modelCache, dataCache; + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + + // The preparation may fail or succeed, but must not crash. If the preparation succeeds, + // the prepared model must be executed with the correct result and not crash. + if (status != ErrorStatus::NONE) { + ASSERT_EQ(preparedModel, nullptr); + } else { + ASSERT_NE(preparedModel, nullptr); + EvaluatePreparedModel(kDevice, preparedModel, testModelAdd, + /*testKind=*/TestKind::GENERAL); + } + } + } +} + +TEST_P(CompilationCachingTest, PrepareFromCache_TOCTOU) { + if (!mIsCachingSupported) return; + + // Create test models and check if fully supported by the service. + const TestModel testModelMul = createLargeTestModel(OperationType::MUL, kLargeModelSize); + const Model modelMul = createModel(testModelMul); + if (checkEarlyTermination(modelMul)) return; + const TestModel testModelAdd = createLargeTestModel(OperationType::ADD, kLargeModelSize); + const Model modelAdd = createModel(testModelAdd); + if (checkEarlyTermination(modelAdd)) return; + + // Save the modelMul compilation to cache. + auto modelCacheMul = mModelCache; + for (auto& cache : modelCacheMul) { + cache.append("_mul"); + } + { + std::vector modelCache, dataCache; + createCacheFds(modelCacheMul, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + saveModelToCache(modelMul, modelCache, dataCache); + } + + // Use a different token for modelAdd. + mToken[0]++; + + // This test is probabilistic, so we run it multiple times. + for (uint32_t i = 0; i < kNumIterationsTOCTOU; i++) { + // Save the modelAdd compilation to cache. + { + std::vector modelCache, dataCache; + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + saveModelToCache(modelAdd, modelCache, dataCache); + } + + // Retrieve preparedModel from cache. + { + std::shared_ptr preparedModel = nullptr; + ErrorStatus status; + std::vector modelCache, dataCache; + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + + // Spawn a thread to copy the cache content concurrently while preparing from cache. + std::thread thread(copyCacheFiles, std::cref(modelCacheMul), std::cref(mModelCache)); + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + thread.join(); + + // The preparation may fail or succeed, but must not crash. If the preparation succeeds, + // the prepared model must be executed with the correct result and not crash. + if (status != ErrorStatus::NONE) { + ASSERT_EQ(preparedModel, nullptr); + } else { + ASSERT_NE(preparedModel, nullptr); + EvaluatePreparedModel(kDevice, preparedModel, testModelAdd, + /*testKind=*/TestKind::GENERAL); + } + } + } +} + +TEST_P(CompilationCachingTest, ReplaceSecuritySensitiveCache) { + if (!mIsCachingSupported) return; + + // Create test models and check if fully supported by the service. + const TestModel testModelMul = createLargeTestModel(OperationType::MUL, kLargeModelSize); + const Model modelMul = createModel(testModelMul); + if (checkEarlyTermination(modelMul)) return; + const TestModel testModelAdd = createLargeTestModel(OperationType::ADD, kLargeModelSize); + const Model modelAdd = createModel(testModelAdd); + if (checkEarlyTermination(modelAdd)) return; + + // Save the modelMul compilation to cache. + auto modelCacheMul = mModelCache; + for (auto& cache : modelCacheMul) { + cache.append("_mul"); + } + { + std::vector modelCache, dataCache; + createCacheFds(modelCacheMul, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + saveModelToCache(modelMul, modelCache, dataCache); + } + + // Use a different token for modelAdd. + mToken[0]++; + + // Save the modelAdd compilation to cache. + { + std::vector modelCache, dataCache; + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + saveModelToCache(modelAdd, modelCache, dataCache); + } + + // Replace the model cache of modelAdd with modelMul. + copyCacheFiles(modelCacheMul, mModelCache); + + // Retrieve the preparedModel from cache, expect failure. + { + std::shared_ptr preparedModel = nullptr; + ErrorStatus status; + std::vector modelCache, dataCache; + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + ASSERT_EQ(status, ErrorStatus::GENERAL_FAILURE); + ASSERT_EQ(preparedModel, nullptr); + } +} + +// TODO(b/179270601): restore kNamedDeviceChoices. +static const auto kOperandTypeChoices = + testing::Values(OperandType::TENSOR_FLOAT32, OperandType::TENSOR_QUANT8_ASYMM); + +std::string printCompilationCachingTest( + const testing::TestParamInfo& info) { + const auto& [namedDevice, operandType] = info.param; + const std::string type = (operandType == OperandType::TENSOR_FLOAT32 ? "float32" : "quant8"); + return gtestCompliantName(getName(namedDevice) + "_" + type); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CompilationCachingTest); +INSTANTIATE_TEST_SUITE_P(TestCompilationCaching, CompilationCachingTest, + testing::Combine(testing::ValuesIn(getNamedDevices()), + kOperandTypeChoices), + printCompilationCachingTest); + +using CompilationCachingSecurityTestParam = std::tuple; + +class CompilationCachingSecurityTest + : public CompilationCachingTestBase, + public testing::WithParamInterface { + protected: + CompilationCachingSecurityTest() + : CompilationCachingTestBase(getData(std::get(GetParam())), + std::get(GetParam())) {} + + void SetUp() { + CompilationCachingTestBase::SetUp(); + generator.seed(kSeed); + } + + // Get a random integer within a closed range [lower, upper]. + template + T getRandomInt(T lower, T upper) { + std::uniform_int_distribution dis(lower, upper); + return dis(generator); + } + + // Randomly flip one single bit of the cache entry. + void flipOneBitOfCache(const std::string& filename, bool* skip) { + FILE* pFile = fopen(filename.c_str(), "r+"); + ASSERT_EQ(fseek(pFile, 0, SEEK_END), 0); + long int fileSize = ftell(pFile); + if (fileSize == 0) { + fclose(pFile); + *skip = true; + return; + } + ASSERT_EQ(fseek(pFile, getRandomInt(0l, fileSize - 1), SEEK_SET), 0); + int readByte = fgetc(pFile); + ASSERT_NE(readByte, EOF); + ASSERT_EQ(fseek(pFile, -1, SEEK_CUR), 0); + ASSERT_NE(fputc(static_cast(readByte) ^ (1U << getRandomInt(0, 7)), pFile), EOF); + fclose(pFile); + *skip = false; + } + + // Randomly append bytes to the cache entry. + void appendBytesToCache(const std::string& filename, bool* skip) { + FILE* pFile = fopen(filename.c_str(), "a"); + uint32_t appendLength = getRandomInt(1, 256); + for (uint32_t i = 0; i < appendLength; i++) { + ASSERT_NE(fputc(getRandomInt(0, 255), pFile), EOF); + } + fclose(pFile); + *skip = false; + } + + enum class ExpectedResult { GENERAL_FAILURE, NOT_CRASH }; + + // Test if the driver behaves as expected when given corrupted cache or token. + // The modifier will be invoked after save to cache but before prepare from cache. + // The modifier accepts one pointer argument "skip" as the returning value, indicating + // whether the test should be skipped or not. + void testCorruptedCache(ExpectedResult expected, std::function modifier) { + const TestModel& testModel = createTestModel(); + const Model model = createModel(testModel); + if (checkEarlyTermination(model)) return; + + // Save the compilation to cache. + { + std::vector modelCache, dataCache; + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + saveModelToCache(model, modelCache, dataCache); + } + + bool skip = false; + modifier(&skip); + if (skip) return; + + // Retrieve preparedModel from cache. + { + std::shared_ptr preparedModel = nullptr; + ErrorStatus status; + std::vector modelCache, dataCache; + createCacheFds(mModelCache, AccessMode::READ_WRITE, &modelCache); + createCacheFds(mDataCache, AccessMode::READ_WRITE, &dataCache); + prepareModelFromCache(modelCache, dataCache, &preparedModel, &status); + + switch (expected) { + case ExpectedResult::GENERAL_FAILURE: + ASSERT_EQ(status, ErrorStatus::GENERAL_FAILURE); + ASSERT_EQ(preparedModel, nullptr); + break; + case ExpectedResult::NOT_CRASH: + ASSERT_EQ(preparedModel == nullptr, status != ErrorStatus::NONE); + break; + default: + FAIL(); + } + } + } + + const uint32_t kSeed = std::get(GetParam()); + std::mt19937 generator; +}; + +TEST_P(CompilationCachingSecurityTest, CorruptedModelCache) { + if (!mIsCachingSupported) return; + for (uint32_t i = 0; i < mNumModelCache; i++) { + testCorruptedCache(ExpectedResult::GENERAL_FAILURE, + [this, i](bool* skip) { flipOneBitOfCache(mModelCache[i], skip); }); + } +} + +TEST_P(CompilationCachingSecurityTest, WrongLengthModelCache) { + if (!mIsCachingSupported) return; + for (uint32_t i = 0; i < mNumModelCache; i++) { + testCorruptedCache(ExpectedResult::GENERAL_FAILURE, + [this, i](bool* skip) { appendBytesToCache(mModelCache[i], skip); }); + } +} + +TEST_P(CompilationCachingSecurityTest, CorruptedDataCache) { + if (!mIsCachingSupported) return; + for (uint32_t i = 0; i < mNumDataCache; i++) { + testCorruptedCache(ExpectedResult::NOT_CRASH, + [this, i](bool* skip) { flipOneBitOfCache(mDataCache[i], skip); }); + } +} + +TEST_P(CompilationCachingSecurityTest, WrongLengthDataCache) { + if (!mIsCachingSupported) return; + for (uint32_t i = 0; i < mNumDataCache; i++) { + testCorruptedCache(ExpectedResult::NOT_CRASH, + [this, i](bool* skip) { appendBytesToCache(mDataCache[i], skip); }); + } +} + +TEST_P(CompilationCachingSecurityTest, WrongToken) { + if (!mIsCachingSupported) return; + testCorruptedCache(ExpectedResult::GENERAL_FAILURE, [this](bool* skip) { + // Randomly flip one single bit in mToken. + uint32_t ind = + getRandomInt(0u, static_cast(IDevice::BYTE_SIZE_OF_CACHE_TOKEN) - 1); + mToken[ind] ^= (1U << getRandomInt(0, 7)); + *skip = false; + }); +} + +std::string printCompilationCachingSecurityTest( + const testing::TestParamInfo& info) { + const auto& [namedDevice, operandType, seed] = info.param; + const std::string type = (operandType == OperandType::TENSOR_FLOAT32 ? "float32" : "quant8"); + return gtestCompliantName(getName(namedDevice) + "_" + type + "_" + std::to_string(seed)); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CompilationCachingSecurityTest); +INSTANTIATE_TEST_SUITE_P(TestCompilationCaching, CompilationCachingSecurityTest, + testing::Combine(testing::ValuesIn(getNamedDevices()), kOperandTypeChoices, + testing::Range(0U, 10U)), + printCompilationCachingSecurityTest); + +} // namespace aidl::android::hardware::neuralnetworks::vts::functional diff --git a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp new file mode 100644 index 0000000000..86d5f3f8d3 --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp @@ -0,0 +1,925 @@ +/* + * 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 "GeneratedTestHarness.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "Callbacks.h" +#include "TestHarness.h" +#include "Utils.h" +#include "VtsHalNeuralnetworks.h" + +namespace aidl::android::hardware::neuralnetworks::vts::functional { + +namespace nn = ::android::nn; +using namespace test_helper; +using implementation::PreparedModelCallback; + +namespace { + +enum class OutputType { FULLY_SPECIFIED, UNSPECIFIED, INSUFFICIENT, MISSED_DEADLINE }; + +struct TestConfig { + Executor executor; + bool measureTiming; + OutputType outputType; + MemoryType memoryType; + // `reportSkipping` indicates if a test should print an info message in case + // it is skipped. The field is set to true by default and is set to false in + // quantization coupling tests to suppress skipping a test + bool reportSkipping; + TestConfig(Executor executor, bool measureTiming, OutputType outputType, MemoryType memoryType) + : executor(executor), + measureTiming(measureTiming), + outputType(outputType), + memoryType(memoryType), + reportSkipping(true) {} + TestConfig(Executor executor, bool measureTiming, OutputType outputType, MemoryType memoryType, + bool reportSkipping) + : executor(executor), + measureTiming(measureTiming), + outputType(outputType), + memoryType(memoryType), + reportSkipping(reportSkipping) {} +}; + +enum class IOType { INPUT, OUTPUT }; + +class DeviceMemoryAllocator { + public: + DeviceMemoryAllocator(const std::shared_ptr& device, + const std::shared_ptr& preparedModel, + const TestModel& testModel) + : kDevice(device), kPreparedModel(preparedModel), kTestModel(testModel) {} + + // Allocate device memory for a target input/output operand. + // Return {IBuffer object, token} if successful. + // Return {nullptr, 0} if device memory is not supported. + template + std::pair, int32_t> allocate(uint32_t index) { + std::pair, int32_t> buffer; + allocateInternal(index, &buffer); + return buffer; + } + + private: + template + void allocateInternal(int32_t index, std::pair, int32_t>* result) { + ASSERT_NE(result, nullptr); + + // Prepare arguments. + BufferRole role = {.modelIndex = 0, .ioIndex = index, .frequency = 1.0f}; + std::vector inputRoles, outputRoles; + if constexpr (ioType == IOType::INPUT) { + inputRoles = {role}; + } else { + outputRoles = {role}; + } + + // Allocate device memory. + DeviceBuffer buffer; + IPreparedModelParcel parcel; + parcel.preparedModel = kPreparedModel; + const auto ret = kDevice->allocate({}, {parcel}, inputRoles, outputRoles, &buffer); + + // Check allocation results. + if (ret.isOk()) { + ASSERT_NE(buffer.buffer, nullptr); + ASSERT_GT(buffer.token, 0); + } else { + ASSERT_EQ(ret.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(ret.getServiceSpecificError()), + ErrorStatus::GENERAL_FAILURE); + buffer.buffer = nullptr; + buffer.token = 0; + } + + // Initialize input data from TestBuffer. + if constexpr (ioType == IOType::INPUT) { + if (buffer.buffer != nullptr) { + // TestBuffer -> Shared memory. + const auto& testBuffer = + kTestModel.main.operands[kTestModel.main.inputIndexes[index]].data; + ASSERT_GT(testBuffer.size(), 0); + const auto sharedMemory = nn::createSharedMemory(testBuffer.size()).value(); + const auto memory = utils::convert(sharedMemory).value(); + const auto mapping = nn::map(sharedMemory).value(); + uint8_t* inputPtr = static_cast(std::get(mapping.pointer)); + ASSERT_NE(inputPtr, nullptr); + const uint8_t* begin = testBuffer.get(); + const uint8_t* end = begin + testBuffer.size(); + std::copy(begin, end, inputPtr); + + // Shared memory -> IBuffer. + auto ret = buffer.buffer->copyFrom(memory, {}); + ASSERT_TRUE(ret.isOk()); + } + } + *result = {std::move(buffer.buffer), buffer.token}; + } + + const std::shared_ptr kDevice; + const std::shared_ptr kPreparedModel; + const TestModel& kTestModel; +}; + +Subgraph createSubgraph(const TestSubgraph& testSubgraph, uint32_t* constCopySize, + std::vector* constCopies, uint32_t* constRefSize, + std::vector* constReferences) { + CHECK(constCopySize != nullptr); + CHECK(constCopies != nullptr); + CHECK(constRefSize != nullptr); + CHECK(constReferences != nullptr); + + // Operands. + std::vector operands(testSubgraph.operands.size()); + for (uint32_t i = 0; i < testSubgraph.operands.size(); i++) { + const auto& op = testSubgraph.operands[i]; + + DataLocation loc = {}; + if (op.lifetime == TestOperandLifeTime::CONSTANT_COPY) { + loc = { + .poolIndex = 0, + .offset = *constCopySize, + .length = static_cast(op.data.size()), + }; + constCopies->push_back(&op.data); + *constCopySize += op.data.alignedSize(); + } else if (op.lifetime == TestOperandLifeTime::CONSTANT_REFERENCE) { + loc = { + .poolIndex = 0, + .offset = *constRefSize, + .length = static_cast(op.data.size()), + }; + constReferences->push_back(&op.data); + *constRefSize += op.data.alignedSize(); + } else if (op.lifetime == TestOperandLifeTime::SUBGRAPH) { + loc = { + .poolIndex = 0, + .offset = *op.data.get(), + .length = 0, + }; + } + + std::optional extraParams; + if (op.type == TestOperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL) { + using Tag = OperandExtraParams::Tag; + extraParams = OperandExtraParams::make(SymmPerChannelQuantParams{ + .scales = op.channelQuant.scales, + .channelDim = static_cast(op.channelQuant.channelDim)}); + } + + operands[i] = {.type = static_cast(op.type), + .dimensions = utils::toSigned(op.dimensions).value(), + .scale = op.scale, + .zeroPoint = op.zeroPoint, + .lifetime = static_cast(op.lifetime), + .location = loc, + .extraParams = std::move(extraParams)}; + } + + // Operations. + std::vector operations(testSubgraph.operations.size()); + std::transform(testSubgraph.operations.begin(), testSubgraph.operations.end(), + operations.begin(), [](const TestOperation& op) -> Operation { + return {.type = static_cast(op.type), + .inputs = utils::toSigned(op.inputs).value(), + .outputs = utils::toSigned(op.outputs).value()}; + }); + + return {.operands = std::move(operands), + .operations = std::move(operations), + .inputIndexes = utils::toSigned(testSubgraph.inputIndexes).value(), + .outputIndexes = utils::toSigned(testSubgraph.outputIndexes).value()}; +} + +void copyTestBuffers(const std::vector& buffers, uint8_t* output) { + uint32_t offset = 0; + for (const TestBuffer* buffer : buffers) { + const uint8_t* begin = buffer->get(); + const uint8_t* end = begin + buffer->size(); + std::copy(begin, end, output + offset); + offset += buffer->alignedSize(); + } +} + +} // namespace + +void waitForSyncFence(int syncFd) { + constexpr int kInfiniteTimeout = -1; + ASSERT_GT(syncFd, 0); + int r = sync_wait(syncFd, kInfiniteTimeout); + ASSERT_GE(r, 0); +} + +Model createModel(const TestModel& testModel) { + uint32_t constCopySize = 0; + uint32_t constRefSize = 0; + std::vector constCopies; + std::vector constReferences; + + Subgraph mainSubgraph = createSubgraph(testModel.main, &constCopySize, &constCopies, + &constRefSize, &constReferences); + std::vector refSubgraphs(testModel.referenced.size()); + std::transform(testModel.referenced.begin(), testModel.referenced.end(), refSubgraphs.begin(), + [&constCopySize, &constCopies, &constRefSize, + &constReferences](const TestSubgraph& testSubgraph) { + return createSubgraph(testSubgraph, &constCopySize, &constCopies, + &constRefSize, &constReferences); + }); + + // Constant copies. + std::vector operandValues(constCopySize); + copyTestBuffers(constCopies, operandValues.data()); + + // Shared memory. + std::vector pools = {}; + if (constRefSize > 0) { + const auto pool = nn::createSharedMemory(constRefSize).value(); + pools.push_back(pool); + + // load data + const auto mappedMemory = nn::map(pool).value(); + uint8_t* mappedPtr = static_cast(std::get(mappedMemory.pointer)); + CHECK(mappedPtr != nullptr); + + copyTestBuffers(constReferences, mappedPtr); + } + + std::vector aidlPools; + aidlPools.reserve(pools.size()); + for (auto& pool : pools) { + auto aidlPool = utils::convert(pool).value(); + aidlPools.push_back(std::move(aidlPool)); + } + + return {.main = std::move(mainSubgraph), + .referenced = std::move(refSubgraphs), + .operandValues = std::move(operandValues), + .pools = std::move(aidlPools), + .relaxComputationFloat32toFloat16 = testModel.isRelaxed}; +} + +static bool isOutputSizeGreaterThanOne(const TestModel& testModel, uint32_t index) { + const auto byteSize = testModel.main.operands[testModel.main.outputIndexes[index]].data.size(); + return byteSize > 1u; +} + +static void makeOutputInsufficientSize(uint32_t outputIndex, Request* request) { + auto& length = request->outputs[outputIndex].location.length; + ASSERT_GT(length, 1u); + length -= 1u; +} + +static void makeOutputDimensionsUnspecified(Model* model) { + for (auto i : model->main.outputIndexes) { + auto& dims = model->main.operands[i].dimensions; + std::fill(dims.begin(), dims.end(), 0); + } +} + +// Manages the lifetime of memory resources used in an execution. +class ExecutionContext { + public: + ExecutionContext(std::shared_ptr device, std::shared_ptr preparedModel) + : kDevice(std::move(device)), kPreparedModel(std::move(preparedModel)) {} + + std::optional createRequest(const TestModel& testModel, MemoryType memoryType); + std::vector getOutputBuffers(const TestModel& testModel, + const Request& request) const; + + private: + // Get a TestBuffer with data copied from an IBuffer object. + void getBuffer(const std::shared_ptr& buffer, size_t size, + TestBuffer* testBuffer) const; + + static constexpr uint32_t kInputPoolIndex = 0; + static constexpr uint32_t kOutputPoolIndex = 1; + static constexpr uint32_t kDeviceMemoryBeginIndex = 2; + + const std::shared_ptr kDevice; + const std::shared_ptr kPreparedModel; + std::unique_ptr mInputMemory, mOutputMemory; + std::vector> mBuffers; +}; + +std::optional ExecutionContext::createRequest(const TestModel& testModel, + MemoryType memoryType) { + // Memory pools are organized as: + // - 0: Input shared memory pool + // - 1: Output shared memory pool + // - [2, 2+i): Input device memories + // - [2+i, 2+i+o): Output device memories + DeviceMemoryAllocator allocator(kDevice, kPreparedModel, testModel); + std::vector tokens; + mBuffers.clear(); + + // Model inputs. + std::vector inputs(testModel.main.inputIndexes.size()); + size_t inputSize = 0; + for (uint32_t i = 0; i < testModel.main.inputIndexes.size(); i++) { + const auto& op = testModel.main.operands[testModel.main.inputIndexes[i]]; + if (op.data.size() == 0) { + // Omitted input. + inputs[i] = {.hasNoValue = true}; + continue; + } else if (memoryType == MemoryType::DEVICE) { + SCOPED_TRACE("Input index = " + std::to_string(i)); + auto [buffer, token] = allocator.allocate(i); + if (buffer != nullptr) { + DataLocation loc = {.poolIndex = static_cast(mBuffers.size() + + kDeviceMemoryBeginIndex)}; + mBuffers.push_back(std::move(buffer)); + tokens.push_back(token); + inputs[i] = {.hasNoValue = false, .location = loc, .dimensions = {}}; + continue; + } + } + + // Reserve shared memory for input. + DataLocation loc = {.poolIndex = kInputPoolIndex, + .offset = static_cast(inputSize), + .length = static_cast(op.data.size())}; + inputSize += op.data.alignedSize(); + inputs[i] = {.hasNoValue = false, .location = loc, .dimensions = {}}; + } + + // Model outputs. + std::vector outputs(testModel.main.outputIndexes.size()); + size_t outputSize = 0; + for (uint32_t i = 0; i < testModel.main.outputIndexes.size(); i++) { + const auto& op = testModel.main.operands[testModel.main.outputIndexes[i]]; + if (memoryType == MemoryType::DEVICE) { + SCOPED_TRACE("Output index = " + std::to_string(i)); + auto [buffer, token] = allocator.allocate(i); + if (buffer != nullptr) { + DataLocation loc = {.poolIndex = static_cast(mBuffers.size() + + kDeviceMemoryBeginIndex)}; + mBuffers.push_back(std::move(buffer)); + tokens.push_back(token); + outputs[i] = {.hasNoValue = false, .location = loc, .dimensions = {}}; + continue; + } + } + + // In the case of zero-sized output, we should at least provide a one-byte buffer. + // This is because zero-sized tensors are only supported internally to the driver, or + // reported in output shapes. It is illegal for the client to pre-specify a zero-sized + // tensor as model output. Otherwise, we will have two semantic conflicts: + // - "Zero dimension" conflicts with "unspecified dimension". + // - "Omitted operand buffer" conflicts with "zero-sized operand buffer". + size_t bufferSize = std::max(op.data.size(), 1); + + // Reserve shared memory for output. + DataLocation loc = {.poolIndex = kOutputPoolIndex, + .offset = static_cast(outputSize), + .length = static_cast(bufferSize)}; + outputSize += op.data.size() == 0 ? TestBuffer::kAlignment : op.data.alignedSize(); + outputs[i] = {.hasNoValue = false, .location = loc, .dimensions = {}}; + } + + if (memoryType == MemoryType::DEVICE && mBuffers.empty()) { + return std::nullopt; + } + + // Memory pools. + if (memoryType == MemoryType::BLOB_AHWB) { + mInputMemory = TestBlobAHWB::create(std::max(inputSize, 1)); + mOutputMemory = TestBlobAHWB::create(std::max(outputSize, 1)); + } else { + mInputMemory = TestAshmem::create(std::max(inputSize, 1)); + mOutputMemory = TestAshmem::create(std::max(outputSize, 1)); + } + CHECK_NE(mInputMemory, nullptr); + CHECK_NE(mOutputMemory, nullptr); + std::vector pools; + pools.reserve(kDeviceMemoryBeginIndex + mBuffers.size()); + + auto copiedInputMemory = utils::clone(*mInputMemory->getAidlMemory()); + CHECK(copiedInputMemory.has_value()) << copiedInputMemory.error().message; + auto copiedOutputMemory = utils::clone(*mOutputMemory->getAidlMemory()); + CHECK(copiedOutputMemory.has_value()) << copiedOutputMemory.error().message; + + pools.push_back(RequestMemoryPool::make( + std::move(copiedInputMemory).value())); + pools.push_back(RequestMemoryPool::make( + std::move(copiedOutputMemory).value())); + for (const auto& token : tokens) { + pools.push_back(RequestMemoryPool::make(token)); + } + + // Copy input data to the input shared memory pool. + uint8_t* inputPtr = mInputMemory->getPointer(); + for (uint32_t i = 0; i < testModel.main.inputIndexes.size(); i++) { + if (!inputs[i].hasNoValue && inputs[i].location.poolIndex == kInputPoolIndex) { + const auto& op = testModel.main.operands[testModel.main.inputIndexes[i]]; + const uint8_t* begin = op.data.get(); + const uint8_t* end = begin + op.data.size(); + std::copy(begin, end, inputPtr + inputs[i].location.offset); + } + } + return Request{ + .inputs = std::move(inputs), .outputs = std::move(outputs), .pools = std::move(pools)}; +} + +std::vector ExecutionContext::getOutputBuffers(const TestModel& testModel, + const Request& request) const { + // Copy out output results. + uint8_t* outputPtr = mOutputMemory->getPointer(); + std::vector outputBuffers; + for (uint32_t i = 0; i < request.outputs.size(); i++) { + const auto& outputLoc = request.outputs[i].location; + if (outputLoc.poolIndex == kOutputPoolIndex) { + outputBuffers.emplace_back(outputLoc.length, outputPtr + outputLoc.offset); + } else { + const auto& op = testModel.main.operands[testModel.main.outputIndexes[i]]; + if (op.data.size() == 0) { + outputBuffers.emplace_back(0, nullptr); + } else { + SCOPED_TRACE("Output index = " + std::to_string(i)); + const uint32_t bufferIndex = outputLoc.poolIndex - kDeviceMemoryBeginIndex; + TestBuffer buffer; + getBuffer(mBuffers[bufferIndex], op.data.size(), &buffer); + outputBuffers.push_back(std::move(buffer)); + } + } + } + return outputBuffers; +} + +// Get a TestBuffer with data copied from an IBuffer object. +void ExecutionContext::getBuffer(const std::shared_ptr& buffer, size_t size, + TestBuffer* testBuffer) const { + // IBuffer -> Shared memory. + auto sharedMemory = nn::createSharedMemory(size).value(); + auto aidlMemory = utils::convert(sharedMemory).value(); + const auto ret = buffer->copyTo(aidlMemory); + ASSERT_TRUE(ret.isOk()); + + // Shared memory -> TestBuffer. + const auto outputMemory = nn::map(sharedMemory).value(); + const uint8_t* outputPtr = std::visit( + [](auto* ptr) { return static_cast(ptr); }, outputMemory.pointer); + ASSERT_NE(outputPtr, nullptr); + ASSERT_NE(testBuffer, nullptr); + *testBuffer = TestBuffer(size, outputPtr); +} + +static bool hasZeroSizedOutput(const TestModel& testModel) { + return std::any_of(testModel.main.outputIndexes.begin(), testModel.main.outputIndexes.end(), + [&testModel](uint32_t index) { + return testModel.main.operands[index].data.size() == 0; + }); +} + +void EvaluatePreparedModel(const std::shared_ptr& device, + const std::shared_ptr& preparedModel, + const TestModel& testModel, const TestConfig& testConfig, + bool* skipped = nullptr) { + if (skipped != nullptr) { + *skipped = false; + } + // If output0 does not have size larger than one byte, we can not test with insufficient buffer. + if (testConfig.outputType == OutputType::INSUFFICIENT && + !isOutputSizeGreaterThanOne(testModel, 0)) { + return; + } + + ExecutionContext context(device, preparedModel); + auto maybeRequest = context.createRequest(testModel, testConfig.memoryType); + // Skip if testing memory domain but no device memory has been allocated. + if (!maybeRequest.has_value()) { + return; + } + + Request request = std::move(maybeRequest).value(); + + constexpr uint32_t kInsufficientOutputIndex = 0; + if (testConfig.outputType == OutputType::INSUFFICIENT) { + makeOutputInsufficientSize(kInsufficientOutputIndex, &request); + } + + int64_t loopTimeoutDuration = kOmittedTimeoutDuration; + // OutputType::MISSED_DEADLINE is only used by + // TestKind::INTINITE_LOOP_TIMEOUT tests to verify that an infinite loop is + // aborted after a timeout. + if (testConfig.outputType == OutputType::MISSED_DEADLINE) { + // Override the default loop timeout duration with a small value to + // speed up test execution. + constexpr int64_t kMillisecond = 1'000'000; + loopTimeoutDuration = 1 * kMillisecond; + } + + ErrorStatus executionStatus; + std::vector outputShapes; + Timing timing = kNoTiming; + switch (testConfig.executor) { + case Executor::SYNC: { + SCOPED_TRACE("synchronous"); + + ExecutionResult executionResult; + // execute + const auto ret = preparedModel->executeSynchronously(request, testConfig.measureTiming, + kNoDeadline, loopTimeoutDuration, + &executionResult); + ASSERT_TRUE(ret.isOk() || ret.getExceptionCode() == EX_SERVICE_SPECIFIC) + << ret.getDescription(); + if (ret.isOk()) { + executionStatus = executionResult.outputSufficientSize + ? ErrorStatus::NONE + : ErrorStatus::OUTPUT_INSUFFICIENT_SIZE; + outputShapes = std::move(executionResult.outputShapes); + timing = executionResult.timing; + } else { + executionStatus = static_cast(ret.getServiceSpecificError()); + } + break; + } + case Executor::FENCED: { + SCOPED_TRACE("fenced"); + ErrorStatus result = ErrorStatus::NONE; + ndk::ScopedFileDescriptor syncFenceFd; + std::shared_ptr fencedCallback; + auto ret = preparedModel->executeFenced(request, {}, testConfig.measureTiming, + kNoDeadline, loopTimeoutDuration, kNoDuration, + &syncFenceFd, &fencedCallback); + ASSERT_TRUE(ret.isOk() || ret.getExceptionCode() == EX_SERVICE_SPECIFIC) + << ret.getDescription(); + if (!ret.isOk()) { + result = static_cast(ret.getServiceSpecificError()); + executionStatus = result; + } else if (syncFenceFd.get() != -1) { + std::vector waitFor; + auto dupFd = dup(syncFenceFd.get()); + ASSERT_NE(dupFd, -1); + waitFor.emplace_back(dupFd); + // If a sync fence is returned, try start another run waiting for the sync fence. + ret = preparedModel->executeFenced(request, waitFor, testConfig.measureTiming, + kNoDeadline, loopTimeoutDuration, kNoDuration, + &syncFenceFd, &fencedCallback); + ASSERT_TRUE(ret.isOk()); + waitForSyncFence(syncFenceFd.get()); + } + if (result == ErrorStatus::NONE) { + ASSERT_NE(fencedCallback, nullptr); + Timing timingFenced; + auto ret = + fencedCallback->getExecutionInfo(&timing, &timingFenced, &executionStatus); + ASSERT_TRUE(ret.isOk()); + } + break; + } + default: { + FAIL() << "Unsupported execution mode for AIDL interface."; + } + } + + if (testConfig.outputType != OutputType::FULLY_SPECIFIED && + executionStatus == ErrorStatus::GENERAL_FAILURE) { + if (skipped != nullptr) { + *skipped = true; + } + if (!testConfig.reportSkipping) { + return; + } + LOG(INFO) << "NN VTS: Early termination of test because vendor service cannot " + "execute model that it does not support."; + std::cout << "[ ] Early termination of test because vendor service cannot " + "execute model that it does not support." + << std::endl; + GTEST_SKIP(); + } + if (!testConfig.measureTiming) { + EXPECT_EQ(timing, kNoTiming); + } else { + if (timing.timeOnDevice != -1 && timing.timeInDriver != -1) { + EXPECT_LE(timing.timeOnDevice, timing.timeInDriver); + } + } + + switch (testConfig.outputType) { + case OutputType::FULLY_SPECIFIED: + if (testConfig.executor == Executor::FENCED && hasZeroSizedOutput(testModel)) { + // Executor::FENCED does not support zero-sized output. + ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, executionStatus); + return; + } + // If the model output operands are fully specified, outputShapes must be either + // either empty, or have the same number of elements as the number of outputs. + ASSERT_EQ(ErrorStatus::NONE, executionStatus); + ASSERT_TRUE(outputShapes.size() == 0 || + outputShapes.size() == testModel.main.outputIndexes.size()); + break; + case OutputType::UNSPECIFIED: + if (testConfig.executor == Executor::FENCED) { + // For Executor::FENCED, the output shape must be fully specified. + ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, executionStatus); + return; + } + // If the model output operands are not fully specified, outputShapes must have + // the same number of elements as the number of outputs. + ASSERT_EQ(ErrorStatus::NONE, executionStatus); + ASSERT_EQ(outputShapes.size(), testModel.main.outputIndexes.size()); + break; + case OutputType::INSUFFICIENT: + if (testConfig.executor == Executor::FENCED) { + // For Executor::FENCED, the output shape must be fully specified. + ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, executionStatus); + return; + } + ASSERT_EQ(ErrorStatus::OUTPUT_INSUFFICIENT_SIZE, executionStatus); + ASSERT_EQ(outputShapes.size(), testModel.main.outputIndexes.size()); + // Check that all returned output dimensions are at least as fully specified as the + // union of the information about the corresponding operand in the model and in the + // request. In this test, all model outputs have known rank with all dimensions + // unspecified, and no dimensional information is provided in the request. + for (uint32_t i = 0; i < outputShapes.size(); i++) { + ASSERT_EQ(outputShapes[i].isSufficient, i != kInsufficientOutputIndex); + const auto& actual = outputShapes[i].dimensions; + const auto& golden = + testModel.main.operands[testModel.main.outputIndexes[i]].dimensions; + ASSERT_EQ(actual.size(), golden.size()); + for (uint32_t j = 0; j < actual.size(); j++) { + if (actual[j] == 0) continue; + EXPECT_EQ(actual[j], golden[j]) << "index: " << j; + } + } + return; + case OutputType::MISSED_DEADLINE: + ASSERT_TRUE(executionStatus == ErrorStatus::MISSED_DEADLINE_TRANSIENT || + executionStatus == ErrorStatus::MISSED_DEADLINE_PERSISTENT) + << "executionStatus = " << executionStatus; + return; + } + + // Go through all outputs, check returned output shapes. + for (uint32_t i = 0; i < outputShapes.size(); i++) { + EXPECT_TRUE(outputShapes[i].isSufficient); + const auto& expect = testModel.main.operands[testModel.main.outputIndexes[i]].dimensions; + const auto unsignedActual = nn::toUnsigned(outputShapes[i].dimensions); + ASSERT_TRUE(unsignedActual.has_value()); + const std::vector& actual = unsignedActual.value(); + EXPECT_EQ(expect, actual); + } + + // Retrieve execution results. + const std::vector outputs = context.getOutputBuffers(testModel, request); + + // We want "close-enough" results. + checkResults(testModel, outputs); +} + +void EvaluatePreparedModel(const std::shared_ptr& device, + const std::shared_ptr& preparedModel, + const TestModel& testModel, TestKind testKind) { + std::vector outputTypesList; + std::vector measureTimingList; + std::vector executorList; + std::vector memoryTypeList; + + switch (testKind) { + case TestKind::GENERAL: { + outputTypesList = {OutputType::FULLY_SPECIFIED}; + measureTimingList = {false, true}; + executorList = {Executor::SYNC}; + memoryTypeList = {MemoryType::ASHMEM}; + } break; + case TestKind::DYNAMIC_SHAPE: { + outputTypesList = {OutputType::UNSPECIFIED, OutputType::INSUFFICIENT}; + measureTimingList = {false, true}; + executorList = {Executor::SYNC, Executor::FENCED}; + memoryTypeList = {MemoryType::ASHMEM}; + } break; + case TestKind::MEMORY_DOMAIN: { + outputTypesList = {OutputType::FULLY_SPECIFIED}; + measureTimingList = {false}; + executorList = {Executor::SYNC, Executor::FENCED}; + memoryTypeList = {MemoryType::BLOB_AHWB, MemoryType::DEVICE}; + } break; + case TestKind::FENCED_COMPUTE: { + outputTypesList = {OutputType::FULLY_SPECIFIED}; + measureTimingList = {false, true}; + executorList = {Executor::FENCED}; + memoryTypeList = {MemoryType::ASHMEM}; + } break; + case TestKind::QUANTIZATION_COUPLING: { + LOG(FATAL) << "Wrong TestKind for EvaluatePreparedModel"; + return; + } break; + case TestKind::INTINITE_LOOP_TIMEOUT: { + outputTypesList = {OutputType::MISSED_DEADLINE}; + measureTimingList = {false, true}; + executorList = {Executor::SYNC, Executor::FENCED}; + memoryTypeList = {MemoryType::ASHMEM}; + } break; + } + + for (const OutputType outputType : outputTypesList) { + for (const bool measureTiming : measureTimingList) { + for (const Executor executor : executorList) { + for (const MemoryType memoryType : memoryTypeList) { + const TestConfig testConfig(executor, measureTiming, outputType, memoryType); + EvaluatePreparedModel(device, preparedModel, testModel, testConfig); + } + } + } + } +} + +void EvaluatePreparedCoupledModels(const std::shared_ptr& device, + const std::shared_ptr& preparedModel, + const TestModel& testModel, + const std::shared_ptr& preparedCoupledModel, + const TestModel& coupledModel) { + const std::vector outputTypesList = {OutputType::FULLY_SPECIFIED}; + const std::vector measureTimingList = {false, true}; + const std::vector executorList = {Executor::SYNC, Executor::FENCED}; + + for (const OutputType outputType : outputTypesList) { + for (const bool measureTiming : measureTimingList) { + for (const Executor executor : executorList) { + const TestConfig testConfig(executor, measureTiming, outputType, MemoryType::ASHMEM, + /*reportSkipping=*/false); + bool baseSkipped = false; + EvaluatePreparedModel(device, preparedModel, testModel, testConfig, &baseSkipped); + bool coupledSkipped = false; + EvaluatePreparedModel(device, preparedCoupledModel, coupledModel, testConfig, + &coupledSkipped); + ASSERT_EQ(baseSkipped, coupledSkipped); + if (baseSkipped) { + LOG(INFO) << "NN VTS: Early termination of test because vendor service cannot " + "execute model that it does not support."; + std::cout << "[ ] Early termination of test because vendor service " + "cannot " + "execute model that it does not support." + << std::endl; + GTEST_SKIP(); + } + } + } + } +} + +void Execute(const std::shared_ptr& device, const TestModel& testModel, + TestKind testKind) { + Model model = createModel(testModel); + if (testKind == TestKind::DYNAMIC_SHAPE) { + makeOutputDimensionsUnspecified(&model); + } + + std::shared_ptr preparedModel; + switch (testKind) { + case TestKind::GENERAL: + case TestKind::DYNAMIC_SHAPE: + case TestKind::MEMORY_DOMAIN: + case TestKind::FENCED_COMPUTE: + case TestKind::INTINITE_LOOP_TIMEOUT: { + createPreparedModel(device, model, &preparedModel); + if (preparedModel == nullptr) return; + EvaluatePreparedModel(device, preparedModel, testModel, testKind); + } break; + case TestKind::QUANTIZATION_COUPLING: { + ASSERT_TRUE(testModel.hasQuant8CoupledOperands()); + createPreparedModel(device, model, &preparedModel, + /*reportSkipping*/ false); + TestModel signedQuantizedModel = convertQuant8AsymmOperandsToSigned(testModel); + std::shared_ptr preparedCoupledModel; + createPreparedModel(device, createModel(signedQuantizedModel), &preparedCoupledModel, + /*reportSkipping*/ false); + // If we couldn't prepare a model with unsigned quantization, we must + // fail to prepare a model with signed quantization as well. + if (preparedModel == nullptr) { + ASSERT_EQ(preparedCoupledModel, nullptr); + // If we failed to prepare both of the models, we can safely skip + // the test. + LOG(INFO) << "NN VTS: Early termination of test because vendor service cannot " + "prepare model that it does not support."; + std::cout + << "[ ] Early termination of test because vendor service cannot " + "prepare model that it does not support." + << std::endl; + GTEST_SKIP(); + } + ASSERT_NE(preparedCoupledModel, nullptr); + EvaluatePreparedCoupledModels(device, preparedModel, testModel, preparedCoupledModel, + signedQuantizedModel); + } break; + } +} + +void GeneratedTestBase::SetUp() { + testing::TestWithParam::SetUp(); + ASSERT_NE(kDevice, nullptr); +} + +std::vector getNamedModels(const FilterFn& filter) { + return TestModelManager::get().getTestModels(filter); +} + +std::vector getNamedModels(const FilterNameFn& filter) { + return TestModelManager::get().getTestModels(filter); +} + +std::string printGeneratedTest(const testing::TestParamInfo& info) { + const auto& [namedDevice, namedModel] = info.param; + return gtestCompliantName(getName(namedDevice) + "_" + getName(namedModel)); +} + +// Tag for the generated tests +class GeneratedTest : public GeneratedTestBase {}; + +// Tag for the dynamic output shape tests +class DynamicOutputShapeTest : public GeneratedTest {}; + +// Tag for the memory domain tests +class MemoryDomainTest : public GeneratedTest {}; + +// Tag for the fenced compute tests +class FencedComputeTest : public GeneratedTest {}; + +// Tag for the dynamic output shape tests +class QuantizationCouplingTest : public GeneratedTest {}; + +// Tag for the loop timeout tests +class InfiniteLoopTimeoutTest : public GeneratedTest {}; + +TEST_P(GeneratedTest, Test) { + Execute(kDevice, kTestModel, TestKind::GENERAL); +} + +TEST_P(DynamicOutputShapeTest, Test) { + Execute(kDevice, kTestModel, TestKind::DYNAMIC_SHAPE); +} + +TEST_P(MemoryDomainTest, Test) { + Execute(kDevice, kTestModel, TestKind::MEMORY_DOMAIN); +} + +TEST_P(FencedComputeTest, Test) { + Execute(kDevice, kTestModel, TestKind::FENCED_COMPUTE); +} + +TEST_P(QuantizationCouplingTest, Test) { + Execute(kDevice, kTestModel, TestKind::QUANTIZATION_COUPLING); +} + +TEST_P(InfiniteLoopTimeoutTest, Test) { + Execute(kDevice, kTestModel, TestKind::INTINITE_LOOP_TIMEOUT); +} + +INSTANTIATE_GENERATED_TEST(GeneratedTest, + [](const TestModel& testModel) { return !testModel.expectFailure; }); + +INSTANTIATE_GENERATED_TEST(DynamicOutputShapeTest, [](const TestModel& testModel) { + return !testModel.expectFailure && !testModel.hasScalarOutputs(); +}); + +INSTANTIATE_GENERATED_TEST(MemoryDomainTest, + [](const TestModel& testModel) { return !testModel.expectFailure; }); + +INSTANTIATE_GENERATED_TEST(FencedComputeTest, + [](const TestModel& testModel) { return !testModel.expectFailure; }); + +INSTANTIATE_GENERATED_TEST(QuantizationCouplingTest, [](const TestModel& testModel) { + return !testModel.expectFailure && testModel.hasQuant8CoupledOperands() && + testModel.main.operations.size() == 1; +}); + +INSTANTIATE_GENERATED_TEST(InfiniteLoopTimeoutTest, [](const TestModel& testModel) { + return testModel.isInfiniteLoopTimeoutTest(); +}); + +} // namespace aidl::android::hardware::neuralnetworks::vts::functional diff --git a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.h b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.h new file mode 100644 index 0000000000..ad40f06874 --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.h @@ -0,0 +1,88 @@ +/* + * 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_NEURALNETWORKS_AIDL_GENERATED_TEST_HARNESS_H +#define ANDROID_HARDWARE_NEURALNETWORKS_AIDL_GENERATED_TEST_HARNESS_H + +#include +#include + +#include +#include "Utils.h" +#include "VtsHalNeuralnetworks.h" + +namespace aidl::android::hardware::neuralnetworks::vts::functional { + +using NamedModel = Named; +using GeneratedTestParam = std::tuple; + +class GeneratedTestBase : public testing::TestWithParam { + protected: + void SetUp() override; + const std::shared_ptr kDevice = getData(std::get(GetParam())); + const test_helper::TestModel& kTestModel = *getData(std::get(GetParam())); +}; + +using FilterFn = std::function; +std::vector getNamedModels(const FilterFn& filter); + +using FilterNameFn = std::function; +std::vector getNamedModels(const FilterNameFn& filter); + +std::string printGeneratedTest(const testing::TestParamInfo& info); + +#define INSTANTIATE_GENERATED_TEST(TestSuite, filter) \ + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TestSuite); \ + INSTANTIATE_TEST_SUITE_P(TestGenerated, TestSuite, \ + testing::Combine(testing::ValuesIn(getNamedDevices()), \ + testing::ValuesIn(getNamedModels(filter))), \ + printGeneratedTest) + +// Tag for the validation tests, instantiated in VtsHalNeuralnetworks.cpp. +// TODO: Clean up the hierarchy for ValidationTest. +class ValidationTest : public GeneratedTestBase {}; + +Model createModel(const test_helper::TestModel& testModel); + +void PrepareModel(const std::shared_ptr& device, const Model& model, + std::shared_ptr* preparedModel); + +enum class TestKind { + // Runs a test model and compares the results to a golden data + GENERAL, + // Same as GENERAL but sets dimensions for the output tensors to zeros + DYNAMIC_SHAPE, + // Same as GENERAL but use device memories for inputs and outputs + MEMORY_DOMAIN, + // Same as GENERAL but use executeFenced for exeuction + FENCED_COMPUTE, + // Tests if quantized model with TENSOR_QUANT8_ASYMM produces the same result + // (OK/SKIPPED/FAILED) as the model with all such tensors converted to + // TENSOR_QUANT8_ASYMM_SIGNED. + QUANTIZATION_COUPLING, + // Runs a test model and verifies that MISSED_DEADLINE_* is returned. + INTINITE_LOOP_TIMEOUT +}; + +void EvaluatePreparedModel(const std::shared_ptr& device, + const std::shared_ptr& preparedModel, + const test_helper::TestModel& testModel, TestKind testKind); + +void waitForSyncFence(int syncFd); + +} // namespace aidl::android::hardware::neuralnetworks::vts::functional + +#endif // ANDROID_HARDWARE_NEURALNETWORKS_AIDL_GENERATED_TEST_HARNESS_H diff --git a/neuralnetworks/aidl/vts/functional/LogTestCaseToLogcat.h b/neuralnetworks/aidl/vts/functional/LogTestCaseToLogcat.h new file mode 100644 index 0000000000..c9fd432a43 --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/LogTestCaseToLogcat.h @@ -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. + */ + +#ifndef ANDROID_HARDWARE_NEURALNETWORKS_AIDL_LOG_TEST_CASE_TO_LOGCAT_H +#define ANDROID_HARDWARE_NEURALNETWORKS_AIDL_LOG_TEST_CASE_TO_LOGCAT_H + +#include +#include + +namespace aidl::android::hardware::neuralnetworks { + +class LogTestCaseToLogcat : public ::testing::EmptyTestEventListener { + public: + void OnTestStart(const ::testing::TestInfo& test_info) override { + LOG(INFO) << "[Test Case] " << test_info.test_suite_name() << "." << test_info.name() + << " BEGIN"; + } + + void OnTestEnd(const ::testing::TestInfo& test_info) override { + LOG(INFO) << "[Test Case] " << test_info.test_suite_name() << "." << test_info.name() + << " END"; + } +}; + +} // namespace aidl::android::hardware::neuralnetworks + +#endif // ANDROID_HARDWARE_NEURALNETWORKS_AIDL_LOG_TEST_CASE_TO_LOGCAT_H diff --git a/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp b/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp new file mode 100644 index 0000000000..a37a0caa29 --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp @@ -0,0 +1,1176 @@ +/* + * 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. + */ + +#define LOG_TAG "neuralnetworks_aidl_hal_test" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "AidlHalInterfaces.h" +#include "Callbacks.h" +#include "GeneratedTestHarness.h" +#include "MemoryUtils.h" +#include "Utils.h" +#include "VtsHalNeuralnetworks.h" + +namespace aidl::android::hardware::neuralnetworks::vts::functional { + +using namespace test_helper; +using implementation::PreparedModelCallback; + +namespace { + +// An AIDL driver is likely to support at least one of the following operand types. +const std::vector kTestOperandTypeChoicesVector = { + TestOperandType::TENSOR_FLOAT32, + TestOperandType::TENSOR_FLOAT16, + TestOperandType::TENSOR_QUANT8_ASYMM, + TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, +}; +const auto kTestOperandTypeChoices = testing::ValuesIn(kTestOperandTypeChoicesVector); +// TODO(b/179270601): restore kNamedDeviceChoices + +bool isInChoices(TestOperandType type) { + return std::count(kTestOperandTypeChoicesVector.begin(), kTestOperandTypeChoicesVector.end(), + type) > 0; +} + +bool isFloat(TestOperandType type) { + CHECK(isInChoices(type)); + return type == TestOperandType::TENSOR_FLOAT32 || type == TestOperandType::TENSOR_FLOAT16; +} + +// Create placeholder buffers for model constants as well as inputs and outputs. +// We only care about the size here because we will not check accuracy in validation tests. +void createDummyData(TestModel* testModel) { + for (auto& operand : testModel->main.operands) { + if (operand.data != nullptr) continue; + switch (operand.lifetime) { + case TestOperandLifeTime::SUBGRAPH_INPUT: + case TestOperandLifeTime::SUBGRAPH_OUTPUT: + case TestOperandLifeTime::CONSTANT_COPY: + case TestOperandLifeTime::CONSTANT_REFERENCE: { + const uint32_t size = nn::nonExtensionOperandSizeOfData( + static_cast(operand.type), operand.dimensions); + operand.data = TestBuffer(size); + } break; + default: + break; + } + } +} + +TestOperand createInt32Scalar(int32_t value) { + return { + .type = TestOperandType::INT32, + .dimensions = {}, + .numberOfConsumers = 1, + .scale = 0.0f, + .zeroPoint = 0, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .data = TestBuffer::createFromVector({value}), + }; +} + +// Construct a test model with multiple CONV_2D operations with the given operand as inputs. +// The dimensions of the filters are chosen to ensure outputs has the same dimensions as inputs. +// We choose CONV_2D operation because it is commonly supported by most drivers. +TestModel createConvModel(const TestOperand& operand, uint32_t numOperations) { + CHECK(isInChoices(operand.type)); + + TestOperand weight = {.type = operand.type, + .dimensions = {operand.dimensions[3], 3, 3, operand.dimensions[3]}, + .numberOfConsumers = 1, + .scale = isFloat(operand.type) ? 0.0f : 1.0f, + .zeroPoint = 0, + .lifetime = TestOperandLifeTime::CONSTANT_COPY}; + + TestOperand bias = { + .type = isFloat(operand.type) ? operand.type : TestOperandType::TENSOR_INT32, + .dimensions = {operand.dimensions[3]}, + .numberOfConsumers = 1, + .scale = operand.scale * weight.scale, + .zeroPoint = 0, + .lifetime = TestOperandLifeTime::CONSTANT_COPY}; + + TestOperand output = operand; + output.numberOfConsumers = 0; + output.lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT; + + const std::vector operands = { + operand, + std::move(weight), + std::move(bias), + createInt32Scalar(1), // same padding + createInt32Scalar(1), // width stride + createInt32Scalar(1), // height stride + createInt32Scalar(0), // activation = NONE + std::move(output), + }; + + TestModel model; + for (uint32_t i = 0; i < numOperations; i++) { + model.main.operands.insert(model.main.operands.end(), operands.begin(), operands.end()); + const uint32_t inputIndex = operands.size() * i; + const uint32_t outputIndex = inputIndex + operands.size() - 1; + std::vector inputs(operands.size() - 1); + std::iota(inputs.begin(), inputs.end(), inputIndex); + model.main.operations.push_back({.type = TestOperationType::CONV_2D, + .inputs = std::move(inputs), + .outputs = {outputIndex}}); + model.main.inputIndexes.push_back(inputIndex); + model.main.outputIndexes.push_back(outputIndex); + } + createDummyData(&model); + return model; +} + +// Construct a test model with a single ADD operation with the given operand as input0 and input1. +// This is to cover additional cases that the CONV_2D model does not support, e.g. arbitrary input +// operand rank, scalar input operand. We choose ADD operation because it is commonly supported by +// most drivers. +TestModel createSingleAddModel(const TestOperand& operand) { + CHECK(isInChoices(operand.type)); + + TestOperand act = { + .type = TestOperandType::INT32, + .dimensions = {}, + .numberOfConsumers = 1, + .scale = 0.0f, + .zeroPoint = 0, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + }; + + TestOperand output = operand; + output.numberOfConsumers = 0; + output.lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT; + + TestModel model = { + .main = + { + .operands = + { + operand, + operand, + std::move(act), + output, + }, + .operations = {{.type = TestOperationType::ADD, + .inputs = {0, 1, 2}, + .outputs = {3}}}, + .inputIndexes = {0, 1, 2}, + .outputIndexes = {3}, + }, + }; + createDummyData(&model); + return model; +} + +// A placeholder invalid IPreparedModel class for MemoryDomainAllocateTest.InvalidPreparedModel +class InvalidPreparedModel : public BnPreparedModel { + public: + ndk::ScopedAStatus executeSynchronously(const Request&, bool, int64_t, int64_t, + ExecutionResult*) override { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(ErrorStatus::GENERAL_FAILURE)); + } + ndk::ScopedAStatus executeFenced(const Request&, const std::vector&, + bool, int64_t, int64_t, int64_t, ndk::ScopedFileDescriptor*, + std::shared_ptr*) override { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(ErrorStatus::GENERAL_FAILURE)); + } +}; + +template +std::vector createRequestMemoryPools(const Args&... pools) { + std::vector memoryPools; + memoryPools.reserve(sizeof...(Args)); + // This fold operator calls push_back on each of the function arguments. + (memoryPools.push_back(utils::clone(pools).value()), ...); + return memoryPools; +}; + +} // namespace + +class MemoryDomainTestBase : public testing::Test { + protected: + MemoryDomainTestBase(std::shared_ptr device, TestOperandType type) + : kDevice(std::move(device)), + kTestOperandType(type), + kTestOperand(kTestOperandMap.at(type)), + kTestOperandDataSize(nn::nonExtensionOperandSizeOfData(static_cast(type), + kTestOperand.dimensions)) {} + + void SetUp() override { + testing::Test::SetUp(); + ASSERT_NE(kDevice, nullptr); + } + + std::shared_ptr createConvPreparedModel(const TestOperand& testOperand, + uint32_t numOperations = 1) { + const TestModel testModel = createConvModel(testOperand, numOperations); + const Model model = createModel(testModel); + std::shared_ptr preparedModel; + createPreparedModel(kDevice, model, &preparedModel, /*reportSkipping=*/false); + return preparedModel; + } + + std::shared_ptr createAddPreparedModel(const TestOperand& testOperand) { + const TestModel testModel = createSingleAddModel(testOperand); + const Model model = createModel(testModel); + std::shared_ptr preparedModel; + createPreparedModel(kDevice, model, &preparedModel, /*reportSkipping=*/false); + return preparedModel; + } + + static const std::map kTestOperandMap; + + const std::shared_ptr kDevice; + const TestOperandType kTestOperandType; + const TestOperand& kTestOperand; + const uint32_t kTestOperandDataSize; +}; + +const std::map MemoryDomainTestBase::kTestOperandMap = { + {TestOperandType::TENSOR_FLOAT32, + { + .type = TestOperandType::TENSOR_FLOAT32, + .dimensions = {1, 32, 32, 8}, + .numberOfConsumers = 1, + .scale = 0.0f, + .zeroPoint = 0, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + }}, + {TestOperandType::TENSOR_FLOAT16, + { + .type = TestOperandType::TENSOR_FLOAT16, + .dimensions = {1, 32, 32, 8}, + .numberOfConsumers = 1, + .scale = 0.0f, + .zeroPoint = 0, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + }}, + {TestOperandType::TENSOR_QUANT8_ASYMM, + { + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .dimensions = {1, 32, 32, 8}, + .numberOfConsumers = 1, + .scale = 0.5f, + .zeroPoint = 0, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + }}, + {TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + { + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .dimensions = {1, 32, 32, 8}, + .numberOfConsumers = 1, + .scale = 0.5f, + .zeroPoint = 0, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + }}, +}; + +using MemoryDomainAllocateTestParam = std::tuple; +class MemoryDomainAllocateTest : public MemoryDomainTestBase, + public testing::WithParamInterface { + protected: + MemoryDomainAllocateTest() + : MemoryDomainTestBase(getData(std::get(GetParam())), + std::get(GetParam())) {} + + struct AllocateTestArgs { + std::vector dimensions; + std::vector> preparedModels; + std::vector inputRoles; + std::vector outputRoles; + }; + + // Validation test for IDevice::allocate. The driver is expected to fail with INVALID_ARGUMENT, + // or GENERAL_FAILURE if memory domain is not supported. + void validateAllocate(AllocateTestArgs args) { + std::vector preparedModelParcels; + preparedModelParcels.reserve(args.preparedModels.size()); + for (const auto& model : args.preparedModels) { + preparedModelParcels.push_back({.preparedModel = model}); + } + DeviceBuffer buffer; + const auto ret = + kDevice->allocate({.dimensions = std::move(args.dimensions)}, preparedModelParcels, + args.inputRoles, args.outputRoles, &buffer); + + ASSERT_EQ(ret.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_TRUE(static_cast(ret.getServiceSpecificError()) == + ErrorStatus::INVALID_ARGUMENT || + static_cast(ret.getServiceSpecificError()) == + ErrorStatus::GENERAL_FAILURE); + } + + void testConflictOperands(const std::shared_ptr& model1, + const std::shared_ptr& model2) { + validateAllocate({ + .preparedModels = {model1, model2}, + .inputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}, + {.modelIndex = 1, .ioIndex = 0, .frequency = 1.0f}}, + }); + validateAllocate({ + .preparedModels = {model1, model2}, + .inputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}}, + .outputRoles = {{.modelIndex = 1, .ioIndex = 0, .frequency = 1.0f}}, + }); + validateAllocate({ + .preparedModels = {model1, model2}, + .outputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}, + {.modelIndex = 1, .ioIndex = 0, .frequency = 1.0f}}, + }); + } +}; + +TEST_P(MemoryDomainAllocateTest, EmptyRole) { + // Test with empty prepared models and roles. + validateAllocate({}); + + auto preparedModel = createConvPreparedModel(kTestOperand); + if (preparedModel == nullptr) return; + + // Test again with non-empty prepared models but empty roles. + validateAllocate({ + .preparedModels = {preparedModel}, + }); +} + +TEST_P(MemoryDomainAllocateTest, NullptrPreparedModel) { + // Test with nullptr prepared model as input role. + validateAllocate({ + .preparedModels = {nullptr}, + .inputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}}, + }); + + // Test with nullptr prepared model as output role. + validateAllocate({ + .preparedModels = {nullptr}, + .outputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}}, + }); +} + +TEST_P(MemoryDomainAllocateTest, InvalidPreparedModel) { + std::shared_ptr invalidPreparedModel = + ndk::SharedRefBase::make(); + + // Test with invalid prepared model as input role. + validateAllocate({ + .preparedModels = {invalidPreparedModel}, + .inputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}}, + }); + + // Test with invalid prepared model as output role. + validateAllocate({ + .preparedModels = {invalidPreparedModel}, + .outputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}}, + }); +} + +TEST_P(MemoryDomainAllocateTest, InvalidModelIndex) { + auto preparedModel = createConvPreparedModel(kTestOperand); + if (preparedModel == nullptr) return; + + // This should fail, because the model index is out of bound. + validateAllocate({ + .preparedModels = {preparedModel}, + .inputRoles = {{.modelIndex = 1, .ioIndex = 0, .frequency = 1.0f}}, + }); + + // This should fail, because the model index is out of bound. + validateAllocate({ + .preparedModels = {preparedModel}, + .outputRoles = {{.modelIndex = 1, .ioIndex = 0, .frequency = 1.0f}}, + }); +} + +TEST_P(MemoryDomainAllocateTest, InvalidIOIndex) { + auto preparedModel = createConvPreparedModel(kTestOperand); + if (preparedModel == nullptr) return; + + // This should fail, because the model only has one input. + validateAllocate({ + .preparedModels = {preparedModel}, + .inputRoles = {{.modelIndex = 0, .ioIndex = 1, .frequency = 1.0f}}, + }); + + // This should fail, because the model only has one output. + validateAllocate({ + .preparedModels = {preparedModel}, + .outputRoles = {{.modelIndex = 0, .ioIndex = 1, .frequency = 1.0f}}, + }); +} + +TEST_P(MemoryDomainAllocateTest, InvalidFrequency) { + auto preparedModel = createConvPreparedModel(kTestOperand); + if (preparedModel == nullptr) return; + + for (float invalidFreq : {10.0f, 0.0f, -0.5f}) { + // Test with invalid frequency for input roles. + validateAllocate({ + .preparedModels = {preparedModel}, + .inputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = invalidFreq}}, + }); + // Test with invalid frequency for output roles. + validateAllocate({ + .preparedModels = {preparedModel}, + .outputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = invalidFreq}}, + }); + } +} + +TEST_P(MemoryDomainAllocateTest, SameRoleSpecifiedTwice) { + auto preparedModel = createConvPreparedModel(kTestOperand); + if (preparedModel == nullptr) return; + + // Same role with same model index. + validateAllocate({ + .preparedModels = {preparedModel}, + .inputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}, + {.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}}, + }); + validateAllocate({ + .preparedModels = {preparedModel}, + .outputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}, + {.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}}, + }); + + // Different model indexes, but logically referring to the same role. + validateAllocate({ + .preparedModels = {preparedModel, preparedModel}, + .inputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}, + {.modelIndex = 1, .ioIndex = 0, .frequency = 1.0f}}, + }); + validateAllocate({ + .preparedModels = {preparedModel, preparedModel}, + .outputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}, + {.modelIndex = 1, .ioIndex = 0, .frequency = 1.0f}}, + }); +} + +TEST_P(MemoryDomainAllocateTest, ConflictOperandType) { + const std::map conflictTypeMap = { + {TestOperandType::TENSOR_FLOAT32, TestOperandType::TENSOR_FLOAT16}, + {TestOperandType::TENSOR_FLOAT16, TestOperandType::TENSOR_FLOAT32}, + {TestOperandType::TENSOR_QUANT8_ASYMM, TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED}, + {TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, TestOperandType::TENSOR_QUANT8_ASYMM}, + }; + + TestOperand conflictTestOperand = kTestOperand; + const auto it = conflictTypeMap.find(kTestOperandType); + ASSERT_FALSE(it == conflictTypeMap.end()); + conflictTestOperand.type = it->second; + + auto preparedModel = createConvPreparedModel(kTestOperand); + auto conflictPreparedModel = createConvPreparedModel(conflictTestOperand); + if (preparedModel == nullptr || conflictPreparedModel == nullptr) return; + testConflictOperands(preparedModel, conflictPreparedModel); +} + +TEST_P(MemoryDomainAllocateTest, ConflictScale) { + if (isFloat(kTestOperandType)) return; + + TestOperand conflictTestOperand = kTestOperand; + ASSERT_NE(conflictTestOperand.scale, 1.0f); + conflictTestOperand.scale = 1.0f; + + auto preparedModel = createConvPreparedModel(kTestOperand); + auto conflictPreparedModel = createConvPreparedModel(conflictTestOperand); + if (preparedModel == nullptr || conflictPreparedModel == nullptr) return; + testConflictOperands(preparedModel, conflictPreparedModel); +} + +TEST_P(MemoryDomainAllocateTest, ConflictZeroPoint) { + if (isFloat(kTestOperandType)) return; + + TestOperand conflictTestOperand = kTestOperand; + ASSERT_NE(conflictTestOperand.zeroPoint, 10); + conflictTestOperand.zeroPoint = 10; + + auto preparedModel = createConvPreparedModel(kTestOperand); + auto conflictPreparedModel = createConvPreparedModel(conflictTestOperand); + if (preparedModel == nullptr || conflictPreparedModel == nullptr) return; + testConflictOperands(preparedModel, conflictPreparedModel); +} + +TEST_P(MemoryDomainAllocateTest, ConflictRankBetweenRoles) { + TestOperand conflictTestOperand = kTestOperand; + conflictTestOperand.dimensions.pop_back(); + + auto preparedModel = createAddPreparedModel(kTestOperand); + auto conflictPreparedModel = createAddPreparedModel(conflictTestOperand); + if (preparedModel == nullptr || conflictPreparedModel == nullptr) return; + testConflictOperands(preparedModel, conflictPreparedModel); +} + +TEST_P(MemoryDomainAllocateTest, ConflictDimensionsBetweenRoles) { + TestOperand conflictTestOperand = kTestOperand; + conflictTestOperand.dimensions[0] = 4; + + auto preparedModel = createConvPreparedModel(kTestOperand); + auto conflictPreparedModel = createConvPreparedModel(conflictTestOperand); + if (preparedModel == nullptr || conflictPreparedModel == nullptr) return; + testConflictOperands(preparedModel, conflictPreparedModel); +} + +TEST_P(MemoryDomainAllocateTest, ConflictRankBetweenRoleAndDesc) { + auto preparedModel = createConvPreparedModel(kTestOperand); + if (preparedModel == nullptr) return; + + auto badDimensions = utils::toSigned(kTestOperand.dimensions).value(); + badDimensions.pop_back(); + + validateAllocate({ + .dimensions = badDimensions, + .preparedModels = {preparedModel}, + .inputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}}, + }); + validateAllocate({ + .dimensions = badDimensions, + .preparedModels = {preparedModel}, + .outputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}}, + }); +} + +TEST_P(MemoryDomainAllocateTest, ConflictDimensionsBetweenRoleAndDesc) { + auto preparedModel = createConvPreparedModel(kTestOperand); + if (preparedModel == nullptr) return; + + auto badDimensions = utils::toSigned(kTestOperand.dimensions).value(); + badDimensions[0] = 4; + + validateAllocate({ + .dimensions = badDimensions, + .preparedModels = {preparedModel}, + .inputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}}, + }); + validateAllocate({ + .dimensions = badDimensions, + .preparedModels = {preparedModel}, + .outputRoles = {{.modelIndex = 0, .ioIndex = 0, .frequency = 1.0f}}, + }); +} + +TEST_P(MemoryDomainAllocateTest, ConflictRankWithScalarRole) { + auto preparedModel = createAddPreparedModel(kTestOperand); + if (preparedModel == nullptr) return; + + // This should fail, because the target operand is a scalar but a non-empty dimension is + // specified. + validateAllocate({ + .dimensions = {1}, + .preparedModels = {preparedModel}, + .inputRoles = {{.modelIndex = 0, .ioIndex = 2, .frequency = 1.0f}}, + }); +} + +std::string printMemoryDomainAllocateTest( + const testing::TestParamInfo& info) { + const auto& [namedDevice, operandType] = info.param; + const std::string type = toString(static_cast(operandType)); + return gtestCompliantName(getName(namedDevice) + "_" + type); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(MemoryDomainAllocateTest); +INSTANTIATE_TEST_SUITE_P(TestMemoryDomain, MemoryDomainAllocateTest, + testing::Combine(testing::ValuesIn(getNamedDevices()), + kTestOperandTypeChoices), + printMemoryDomainAllocateTest); + +class MemoryDomainCopyTestBase : public MemoryDomainTestBase { + protected: + MemoryDomainCopyTestBase(std::shared_ptr device, TestOperandType type) + : MemoryDomainTestBase(std::move(device), type) {} + + // Allocates device memory for roles of a single prepared model. + // Returns {IBuffer, token} if success; returns {nullptr, 0} if not supported. + DeviceBuffer allocateBuffer(const std::shared_ptr& preparedModel, + const std::vector& inputIndexes, + const std::vector& outputIndexes, + const std::vector& dimensions) { + if (preparedModel == nullptr) { + return {.buffer = nullptr, .token = 0}; + } + + std::vector inputRoles(inputIndexes.size()), outputRoles(outputIndexes.size()); + auto trans = [](int32_t ind) -> BufferRole { + return {.modelIndex = 0, .ioIndex = ind, .frequency = 1.0f}; + }; + std::transform(inputIndexes.begin(), inputIndexes.end(), inputRoles.begin(), trans); + std::transform(outputIndexes.begin(), outputIndexes.end(), outputRoles.begin(), trans); + + IPreparedModelParcel parcel; + parcel.preparedModel = preparedModel; + + DeviceBuffer buffer; + + const auto ret = kDevice->allocate({.dimensions = dimensions}, {parcel}, inputRoles, + outputRoles, &buffer); + + if (!ret.isOk()) { + EXPECT_EQ(ret.getExceptionCode(), EX_SERVICE_SPECIFIC); + EXPECT_EQ(static_cast(ret.getServiceSpecificError()), + ErrorStatus::GENERAL_FAILURE); + return DeviceBuffer{ + .buffer = nullptr, + .token = 0, + }; + } + + EXPECT_NE(buffer.buffer, nullptr); + EXPECT_GT(buffer.token, 0); + + return buffer; + } + + DeviceBuffer allocateBuffer(const std::shared_ptr& preparedModel, + const std::vector& inputIndexes, + const std::vector& outputIndexes) { + return allocateBuffer(preparedModel, inputIndexes, outputIndexes, {}); + } + + Memory allocateSharedMemory(uint32_t size) { + const auto sharedMemory = nn::createSharedMemory(size).value(); + auto memory = utils::convert(sharedMemory).value(); + EXPECT_EQ(memory.size, size); + return memory; + } + + void testCopyFrom(const std::shared_ptr& buffer, const Memory& memory, + const std::vector& dimensions, ErrorStatus expectedStatus) { + const auto ret = buffer->copyFrom(memory, dimensions); + if (expectedStatus == ErrorStatus::NONE) { + ASSERT_TRUE(ret.isOk()); + } else { + ASSERT_EQ(ret.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(expectedStatus, static_cast(ret.getServiceSpecificError())); + } + } + + void testCopyTo(const std::shared_ptr& buffer, const Memory& memory, + ErrorStatus expectedStatus) { + const auto ret = buffer->copyTo(memory); + if (expectedStatus == ErrorStatus::NONE) { + ASSERT_TRUE(ret.isOk()); + } else { + ASSERT_EQ(ret.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(expectedStatus, static_cast(ret.getServiceSpecificError())); + } + } + + void initializeDeviceMemory(const std::shared_ptr& buffer) { + Memory memory = allocateSharedMemory(kTestOperandDataSize); + ASSERT_EQ(memory.size, kTestOperandDataSize); + testCopyFrom(buffer, memory, utils::toSigned(kTestOperand.dimensions).value(), + ErrorStatus::NONE); + } +}; + +using MemoryDomainCopyTestParam = std::tuple; +class MemoryDomainCopyTest : public MemoryDomainCopyTestBase, + public testing::WithParamInterface { + protected: + MemoryDomainCopyTest() + : MemoryDomainCopyTestBase(getData(std::get(GetParam())), + std::get(GetParam())) {} +}; + +TEST_P(MemoryDomainCopyTest, CopyFrom_InvalidMemorySize) { + auto preparedModel = createConvPreparedModel(kTestOperand); + auto [buffer, token] = allocateBuffer(preparedModel, {0}, {0}); + if (buffer == nullptr) return; + + uint32_t badMemorySize1 = kTestOperandDataSize / 2, badMemorySize2 = kTestOperandDataSize * 2; + Memory badMemory1 = allocateSharedMemory(badMemorySize1); + Memory badMemory2 = allocateSharedMemory(badMemorySize2); + testCopyFrom(buffer, badMemory1, {}, ErrorStatus::INVALID_ARGUMENT); + testCopyFrom(buffer, badMemory2, {}, ErrorStatus::INVALID_ARGUMENT); +} + +TEST_P(MemoryDomainCopyTest, CopyFrom_InvalidMemorySize_DynamicShape) { + TestOperand testOperand = kTestOperand; + testOperand.dimensions[0] = 0; + auto preparedModel = createConvPreparedModel(testOperand); + auto [buffer, token] = allocateBuffer(preparedModel, {0}, {0}); + if (buffer == nullptr) return; + + uint32_t badMemorySize1 = kTestOperandDataSize / 2, badMemorySize2 = kTestOperandDataSize * 2; + Memory badMemory1 = allocateSharedMemory(badMemorySize1); + Memory badMemory2 = allocateSharedMemory(badMemorySize2); + Memory goodMemory = allocateSharedMemory(kTestOperandDataSize); + + const auto goodDimensions = utils::toSigned(kTestOperand.dimensions).value(); + auto badDimensions = goodDimensions; + badDimensions[0] = 2; + + testCopyFrom(buffer, badMemory1, goodDimensions, ErrorStatus::INVALID_ARGUMENT); + testCopyFrom(buffer, badMemory2, goodDimensions, ErrorStatus::INVALID_ARGUMENT); + testCopyFrom(buffer, goodMemory, goodDimensions, ErrorStatus::NONE); + testCopyFrom(buffer, goodMemory, badDimensions, ErrorStatus::INVALID_ARGUMENT); +} + +TEST_P(MemoryDomainCopyTest, CopyFrom_InvalidDimensions) { + auto preparedModel = createConvPreparedModel(kTestOperand); + auto [buffer, token] = allocateBuffer(preparedModel, {0}, {0}); + if (buffer == nullptr) return; + + Memory memory = allocateSharedMemory(kTestOperandDataSize); + + const auto goodDimensions = utils::toSigned(kTestOperand.dimensions).value(); + std::vector badDimensions = goodDimensions; + badDimensions.pop_back(); + testCopyFrom(buffer, memory, badDimensions, ErrorStatus::INVALID_ARGUMENT); + + badDimensions = goodDimensions; + badDimensions[0] = 2; + testCopyFrom(buffer, memory, badDimensions, ErrorStatus::INVALID_ARGUMENT); + + badDimensions = goodDimensions; + badDimensions[0] = 0; + testCopyFrom(buffer, memory, badDimensions, ErrorStatus::INVALID_ARGUMENT); + + testCopyFrom(buffer, memory, {}, ErrorStatus::NONE); + testCopyFrom(buffer, memory, goodDimensions, ErrorStatus::NONE); +} + +TEST_P(MemoryDomainCopyTest, CopyFrom_InvalidDimensions_DynamicShape) { + TestOperand testOperand = kTestOperand; + testOperand.dimensions[0] = 0; + auto preparedModel = createConvPreparedModel(testOperand); + auto [buffer, token] = allocateBuffer(preparedModel, {0}, {0}); + if (buffer == nullptr) return; + + Memory memory = allocateSharedMemory(kTestOperandDataSize); + + const auto goodDimensions = utils::toSigned(kTestOperand.dimensions).value(); + std::vector badDimensions = goodDimensions; + badDimensions.pop_back(); + testCopyFrom(buffer, memory, badDimensions, ErrorStatus::INVALID_ARGUMENT); + + badDimensions = goodDimensions; + badDimensions[0] = 2; + badDimensions[3] = 4; + testCopyFrom(buffer, memory, badDimensions, ErrorStatus::INVALID_ARGUMENT); + + badDimensions = goodDimensions; + badDimensions[0] = 1; + badDimensions[3] = 0; + testCopyFrom(buffer, memory, badDimensions, ErrorStatus::INVALID_ARGUMENT); + + testCopyFrom(buffer, memory, {}, ErrorStatus::INVALID_ARGUMENT); + testCopyFrom(buffer, memory, goodDimensions, ErrorStatus::NONE); +} + +TEST_P(MemoryDomainCopyTest, CopyTo_UninitializedMemory) { + auto preparedModel = createConvPreparedModel(kTestOperand); + auto [buffer, token] = allocateBuffer(preparedModel, {0}, {0}); + if (buffer == nullptr) return; + + Memory memory = allocateSharedMemory(kTestOperandDataSize); + testCopyTo(buffer, memory, ErrorStatus::GENERAL_FAILURE); +} + +TEST_P(MemoryDomainCopyTest, CopyTo_InvalidMemorySize) { + auto preparedModel = createConvPreparedModel(kTestOperand); + auto [buffer, token] = allocateBuffer(preparedModel, {0}, {0}); + if (buffer == nullptr) return; + + uint32_t badMemorySize1 = kTestOperandDataSize / 2, badMemorySize2 = kTestOperandDataSize * 2; + Memory badMemory1 = allocateSharedMemory(badMemorySize1); + Memory badMemory2 = allocateSharedMemory(badMemorySize2); + Memory goodMemory = allocateSharedMemory(kTestOperandDataSize); + + initializeDeviceMemory(buffer); + testCopyTo(buffer, badMemory1, ErrorStatus::INVALID_ARGUMENT); + testCopyTo(buffer, badMemory2, ErrorStatus::INVALID_ARGUMENT); + testCopyTo(buffer, goodMemory, ErrorStatus::NONE); +} + +TEST_P(MemoryDomainCopyTest, CopyTo_InvalidMemorySize_DynamicShape) { + TestOperand testOperand = kTestOperand; + testOperand.dimensions[0] = 0; + auto preparedModel = createConvPreparedModel(testOperand); + auto [buffer, token] = allocateBuffer(preparedModel, {0}, {0}); + if (buffer == nullptr) return; + + uint32_t badMemorySize1 = kTestOperandDataSize / 2, badMemorySize2 = kTestOperandDataSize * 2; + Memory badMemory1 = allocateSharedMemory(badMemorySize1); + Memory badMemory2 = allocateSharedMemory(badMemorySize2); + Memory goodMemory = allocateSharedMemory(kTestOperandDataSize); + + initializeDeviceMemory(buffer); + testCopyTo(buffer, badMemory1, ErrorStatus::INVALID_ARGUMENT); + testCopyTo(buffer, badMemory2, ErrorStatus::INVALID_ARGUMENT); + testCopyTo(buffer, goodMemory, ErrorStatus::NONE); +} + +std::string printMemoryDomainCopyTest( + const testing::TestParamInfo& info) { + const auto& [namedDevice, operandType] = info.param; + const std::string type = toString(static_cast(operandType)); + return gtestCompliantName(getName(namedDevice) + "_" + type); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(MemoryDomainCopyTest); +INSTANTIATE_TEST_SUITE_P(TestMemoryDomain, MemoryDomainCopyTest, + testing::Combine(testing::ValuesIn(getNamedDevices()), + kTestOperandTypeChoices), + printMemoryDomainCopyTest); + +using MemoryDomainExecutionTestParam = std::tuple; +class MemoryDomainExecutionTest + : public MemoryDomainCopyTestBase, + public testing::WithParamInterface { + protected: + MemoryDomainExecutionTest() + : MemoryDomainCopyTestBase(getData(std::get(GetParam())), + std::get(GetParam())) {} + + RequestMemoryPool createSharedMemoryPool(uint32_t size) { + return RequestMemoryPool(allocateSharedMemory(size)); + } + + RequestMemoryPool createDeviceMemoryPool(uint32_t token) { + return RequestMemoryPool(static_cast(token)); + } + + void testExecution(const std::shared_ptr& preparedModel, const Request& request, + ErrorStatus expectedStatus) { + switch (kExecutor) { + case Executor::SYNC: + EXPECT_EQ(executeSync(preparedModel, request), expectedStatus); + break; + case Executor::FENCED: + EXPECT_EQ(executeFenced(preparedModel, request), expectedStatus); + break; + default: + ASSERT_TRUE(false); + } + } + + ErrorStatus executeSync(const std::shared_ptr& preparedModel, + const Request& request) { + ExecutionResult executionResult; + const auto ret = preparedModel->executeSynchronously( + request, false, kNoDeadline, kOmittedTimeoutDuration, &executionResult); + + if (!ret.isOk()) { + EXPECT_EQ(ret.getExceptionCode(), EX_SERVICE_SPECIFIC); + return static_cast(ret.getServiceSpecificError()); + } + const ErrorStatus executionStatus = executionResult.outputSufficientSize + ? ErrorStatus::NONE + : ErrorStatus::OUTPUT_INSUFFICIENT_SIZE; + EXPECT_EQ(executionResult.timing, kNoTiming); + return executionStatus; + } + + ErrorStatus executeFenced(const std::shared_ptr& preparedModel, + const Request& request) { + ndk::ScopedFileDescriptor syncFence; + std::shared_ptr fencedCallback; + const auto ret = preparedModel->executeFenced(request, {}, false, kNoDeadline, + kOmittedTimeoutDuration, kNoDuration, + &syncFence, &fencedCallback); + if (!ret.isOk()) { + EXPECT_EQ(ret.getExceptionCode(), EX_SERVICE_SPECIFIC); + return static_cast(ret.getServiceSpecificError()); + } + if (syncFence.get() != -1) { + waitForSyncFence(syncFence.get()); + } + EXPECT_NE(fencedCallback, nullptr); + + ErrorStatus executionStatus = ErrorStatus::GENERAL_FAILURE; + Timing time = kNoTiming; + Timing timeFenced = kNoTiming; + const auto retExecutionInfo = + fencedCallback->getExecutionInfo(&time, &timeFenced, &executionStatus); + EXPECT_TRUE(retExecutionInfo.isOk()); + EXPECT_EQ(time, kNoTiming); + return executionStatus; + } + + const Executor kExecutor = std::get(GetParam()); +}; + +TEST_P(MemoryDomainExecutionTest, InvalidToken) { + auto preparedModel = createConvPreparedModel(kTestOperand); + if (preparedModel == nullptr) return; + + RequestMemoryPool sharedMemory = createSharedMemoryPool(kTestOperandDataSize); + RequestMemoryPool badDeviceMemory1 = createDeviceMemoryPool(0); // Invalid token. + RequestMemoryPool badDeviceMemory2 = createDeviceMemoryPool(100); // Unknown token. + RequestArgument sharedMemoryArg = { + .location = {.poolIndex = 0, .offset = 0, .length = kTestOperandDataSize}}; + RequestArgument deviceMemoryArg = {.location = {.poolIndex = 1}}; + + testExecution(preparedModel, + {.inputs = {deviceMemoryArg}, + .outputs = {sharedMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory, badDeviceMemory1)}, + ErrorStatus::INVALID_ARGUMENT); + testExecution(preparedModel, + {.inputs = {deviceMemoryArg}, + .outputs = {sharedMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory, badDeviceMemory2)}, + ErrorStatus::INVALID_ARGUMENT); + testExecution(preparedModel, + {.inputs = {sharedMemoryArg}, + .outputs = {deviceMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory, badDeviceMemory1)}, + ErrorStatus::INVALID_ARGUMENT); + testExecution(preparedModel, + {.inputs = {sharedMemoryArg}, + .outputs = {deviceMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory, badDeviceMemory2)}, + ErrorStatus::INVALID_ARGUMENT); +} + +TEST_P(MemoryDomainExecutionTest, InvalidPreparedModel) { + auto preparedModel = createConvPreparedModel(kTestOperand); + auto [buffer, token] = allocateBuffer(preparedModel, {0}, {0}); + if (buffer == nullptr) return; + auto badPreparedModel = createConvPreparedModel(kTestOperand); + if (badPreparedModel == nullptr) return; + + RequestMemoryPool sharedMemory = createSharedMemoryPool(kTestOperandDataSize); + RequestMemoryPool deviceMemory = createDeviceMemoryPool(token); + RequestArgument sharedMemoryArg = { + .location = {.poolIndex = 0, .offset = 0, .length = kTestOperandDataSize}}; + RequestArgument deviceMemoryArg = {.location = {.poolIndex = 1}}; + + // This should fail, because the buffer is not allocated for badPreparedModel. + initializeDeviceMemory(buffer); + testExecution(badPreparedModel, + {.inputs = {deviceMemoryArg}, + .outputs = {sharedMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory, deviceMemory)}, + ErrorStatus::INVALID_ARGUMENT); + testExecution(badPreparedModel, + {.inputs = {sharedMemoryArg}, + .outputs = {deviceMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory, deviceMemory)}, + ErrorStatus::INVALID_ARGUMENT); +} + +TEST_P(MemoryDomainExecutionTest, InvalidIOIndex) { + auto preparedModel = createConvPreparedModel(kTestOperand, 2); + auto [buffer, token] = allocateBuffer(preparedModel, {0}, {}); + if (buffer == nullptr) return; + + RequestMemoryPool sharedMemory1 = createSharedMemoryPool(kTestOperandDataSize); + RequestMemoryPool sharedMemory2 = createSharedMemoryPool(kTestOperandDataSize); + RequestMemoryPool sharedMemory3 = createSharedMemoryPool(kTestOperandDataSize); + RequestMemoryPool deviceMemory = createDeviceMemoryPool(token); + RequestArgument sharedMemoryArg1 = { + .location = {.poolIndex = 0, .offset = 0, .length = kTestOperandDataSize}}; + RequestArgument sharedMemoryArg2 = { + .location = {.poolIndex = 1, .offset = 0, .length = kTestOperandDataSize}}; + RequestArgument sharedMemoryArg3 = { + .location = {.poolIndex = 2, .offset = 0, .length = kTestOperandDataSize}}; + RequestArgument deviceMemoryArg = {.location = {.poolIndex = 3}}; + + // This should fail, because the device memory is not allocated for input 1. + initializeDeviceMemory(buffer); + testExecution(preparedModel, + {.inputs = {sharedMemoryArg1, deviceMemoryArg}, + .outputs = {sharedMemoryArg2, sharedMemoryArg3}, + .pools = createRequestMemoryPools(sharedMemory1, sharedMemory2, sharedMemory3, + deviceMemory)}, + ErrorStatus::INVALID_ARGUMENT); + + // This should fail, because the device memory is not allocated for output 1. + testExecution(preparedModel, + {.inputs = {sharedMemoryArg1, sharedMemoryArg2}, + .outputs = {sharedMemoryArg3, deviceMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory1, sharedMemory2, sharedMemory3, + deviceMemory)}, + ErrorStatus::INVALID_ARGUMENT); +} + +TEST_P(MemoryDomainExecutionTest, InvalidIOType) { + auto preparedModel = createConvPreparedModel(kTestOperand); + auto [inputBuffer, inputToken] = allocateBuffer(preparedModel, {0}, {}); + auto [outputBuffer, outputToken] = allocateBuffer(preparedModel, {}, {0}); + if (inputBuffer == nullptr || outputBuffer == nullptr) return; + + RequestMemoryPool sharedMemory = createSharedMemoryPool(kTestOperandDataSize); + RequestMemoryPool deviceMemory = createDeviceMemoryPool(inputToken); + RequestArgument sharedMemoryArg = { + .location = {.poolIndex = 0, .offset = 0, .length = kTestOperandDataSize}}; + RequestArgument deviceMemoryArg = {.location = {.poolIndex = 1}}; + + // This should fail, because the device memory is allocated for input but used as output. + testExecution(preparedModel, + {.inputs = {sharedMemoryArg}, + .outputs = {deviceMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory, deviceMemory)}, + ErrorStatus::INVALID_ARGUMENT); + + // This should fail, because the device memory is allocated for output but used as input. + deviceMemory.set(outputToken); + initializeDeviceMemory(outputBuffer); + testExecution(preparedModel, + {.inputs = {deviceMemoryArg}, + .outputs = {sharedMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory, deviceMemory)}, + ErrorStatus::INVALID_ARGUMENT); +} + +TEST_P(MemoryDomainExecutionTest, UninitializedMemory) { + auto preparedModel = createConvPreparedModel(kTestOperand); + auto [buffer, token] = allocateBuffer(preparedModel, {0}, {0}); + if (buffer == nullptr) return; + + RequestMemoryPool sharedMemory = createSharedMemoryPool(kTestOperandDataSize); + RequestMemoryPool deviceMemory = createDeviceMemoryPool(token); + RequestArgument sharedMemoryArg = { + .location = {.poolIndex = 0, .offset = 0, .length = kTestOperandDataSize}}; + RequestArgument deviceMemoryArg = {.location = {.poolIndex = 1}}; + + // This should fail, because the device memory is not initialized. + testExecution(preparedModel, + {.inputs = {deviceMemoryArg}, + .outputs = {sharedMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory, deviceMemory)}, + ErrorStatus::GENERAL_FAILURE); + + // This should initialize the device memory. + testExecution(preparedModel, + {.inputs = {sharedMemoryArg}, + .outputs = {deviceMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory, deviceMemory)}, + ErrorStatus::NONE); + + // Test again with initialized device memory. + testExecution(preparedModel, + {.inputs = {deviceMemoryArg}, + .outputs = {sharedMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory, deviceMemory)}, + ErrorStatus::NONE); +} + +TEST_P(MemoryDomainExecutionTest, SameRequestMultipleRoles) { + auto preparedModel = createConvPreparedModel(kTestOperand, 2); + auto [buffer, token] = allocateBuffer(preparedModel, {0, 1}, {0, 1}); + if (buffer == nullptr) return; + + RequestMemoryPool sharedMemory1 = createSharedMemoryPool(kTestOperandDataSize); + RequestMemoryPool sharedMemory2 = createSharedMemoryPool(kTestOperandDataSize); + RequestMemoryPool deviceMemory = createDeviceMemoryPool(token); + RequestArgument sharedMemoryArg1 = { + .location = {.poolIndex = 0, .offset = 0, .length = kTestOperandDataSize}}; + RequestArgument sharedMemoryArg2 = { + .location = {.poolIndex = 1, .offset = 0, .length = kTestOperandDataSize}}; + RequestArgument deviceMemoryArg = {.location = {.poolIndex = 2}}; + + // This should fail, because the same device memory cannot be used for both input and output. + initializeDeviceMemory(buffer); + testExecution(preparedModel, + {.inputs = {deviceMemoryArg, sharedMemoryArg1}, + .outputs = {deviceMemoryArg, sharedMemoryArg2}, + .pools = createRequestMemoryPools(sharedMemory1, sharedMemory2, deviceMemory)}, + ErrorStatus::INVALID_ARGUMENT); + + // This should fail, because the same device memory cannot be used for multiple outputs. + testExecution(preparedModel, + {.inputs = {sharedMemoryArg1, sharedMemoryArg2}, + .outputs = {deviceMemoryArg, deviceMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory1, sharedMemory2, deviceMemory)}, + ErrorStatus::INVALID_ARGUMENT); + + // The same device memory can be used for multiple inputs. + initializeDeviceMemory(buffer); + testExecution(preparedModel, + {.inputs = {deviceMemoryArg, deviceMemoryArg}, + .outputs = {sharedMemoryArg1, sharedMemoryArg2}, + .pools = createRequestMemoryPools(sharedMemory1, sharedMemory2, deviceMemory)}, + ErrorStatus::NONE); +} + +TEST_P(MemoryDomainExecutionTest, InvalidDimensions) { + // FENCED execution does not support dynamic shape. + if (kExecutor == Executor::FENCED) return; + + TestOperand testOperand = kTestOperand; + testOperand.dimensions[0] = 0; + auto preparedModel = createConvPreparedModel(testOperand); + auto deviceBuffer = allocateBuffer(preparedModel, {0}, {0}, + utils::toSigned(kTestOperand.dimensions).value()); + if (deviceBuffer.buffer == nullptr) return; + + RequestMemoryPool sharedMemory = createSharedMemoryPool(kTestOperandDataSize); + RequestMemoryPool deviceMemory = createDeviceMemoryPool(deviceBuffer.token); + auto badDimensions = utils::toSigned(kTestOperand.dimensions).value(); + badDimensions[0] = 2; + RequestArgument sharedMemoryArg = { + .location = {.poolIndex = 0, .offset = 0, .length = kTestOperandDataSize}, + .dimensions = badDimensions}; + RequestArgument deviceMemoryArg = {.location = {.poolIndex = 1}}; + RequestArgument deviceMemoryArgWithBadDimensions = {.location = {.poolIndex = 1}, + .dimensions = badDimensions}; + + initializeDeviceMemory(deviceBuffer.buffer); + testExecution(preparedModel, + {.inputs = {deviceMemoryArgWithBadDimensions}, + .outputs = {sharedMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory, deviceMemory)}, + ErrorStatus::INVALID_ARGUMENT); + + testExecution(preparedModel, + {.inputs = {sharedMemoryArg}, + .outputs = {deviceMemoryArgWithBadDimensions}, + .pools = createRequestMemoryPools(sharedMemory, deviceMemory)}, + ErrorStatus::INVALID_ARGUMENT); + + testExecution(preparedModel, + {.inputs = {sharedMemoryArg}, + .outputs = {deviceMemoryArg}, + .pools = createRequestMemoryPools(sharedMemory, deviceMemory)}, + ErrorStatus::GENERAL_FAILURE); +} + +const auto kExecutorChoices = testing::Values(Executor::SYNC, Executor::FENCED); + +std::string printMemoryDomainExecutionTest( + const testing::TestParamInfo& info) { + const auto& [namedDevice, operandType, executor] = info.param; + const std::string type = toString(static_cast(operandType)); + const std::string executorStr = toString(executor); + return gtestCompliantName(getName(namedDevice) + "_" + type + "_" + executorStr); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(MemoryDomainExecutionTest); +INSTANTIATE_TEST_SUITE_P(TestMemoryDomain, MemoryDomainExecutionTest, + testing::Combine(testing::ValuesIn(getNamedDevices()), + kTestOperandTypeChoices, kExecutorChoices), + printMemoryDomainExecutionTest); + +} // namespace aidl::android::hardware::neuralnetworks::vts::functional diff --git a/neuralnetworks/aidl/vts/functional/QualityOfServiceTests.cpp b/neuralnetworks/aidl/vts/functional/QualityOfServiceTests.cpp new file mode 100644 index 0000000000..58db98f374 --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/QualityOfServiceTests.cpp @@ -0,0 +1,270 @@ +/* + * 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 +#include +#include + +#include + +#include "Callbacks.h" +#include "GeneratedTestHarness.h" +#include "Utils.h" + +namespace aidl::android::hardware::neuralnetworks::vts::functional { + +using implementation::PreparedModelCallback; +using test_helper::TestBuffer; +using test_helper::TestModel; + +enum class DeadlineBoundType { NOW, UNLIMITED, SHORT }; +constexpr std::array deadlineBounds = { + DeadlineBoundType::NOW, DeadlineBoundType::UNLIMITED, DeadlineBoundType::SHORT}; +std::string toString(DeadlineBoundType type) { + switch (type) { + case DeadlineBoundType::NOW: + return "NOW"; + case DeadlineBoundType::UNLIMITED: + return "UNLIMITED"; + case DeadlineBoundType::SHORT: + return "SHORT"; + } + LOG(FATAL) << "Unrecognized DeadlineBoundType: " << static_cast(type); + return {}; +} + +constexpr auto kShortDuration = std::chrono::milliseconds{5}; + +using Results = std::tuple, Timing>; +using MaybeResults = std::optional; + +static int64_t makeDeadline(DeadlineBoundType deadlineBoundType) { + const auto getNanosecondsSinceEpoch = [](const auto& time) -> int64_t { + const auto timeSinceEpoch = time.time_since_epoch(); + return std::chrono::duration_cast(timeSinceEpoch).count(); + }; + + std::chrono::steady_clock::time_point timePoint; + switch (deadlineBoundType) { + case DeadlineBoundType::NOW: + timePoint = std::chrono::steady_clock::now(); + break; + case DeadlineBoundType::UNLIMITED: + timePoint = std::chrono::steady_clock::time_point::max(); + break; + case DeadlineBoundType::SHORT: + timePoint = std::chrono::steady_clock::now() + kShortDuration; + break; + } + + return getNanosecondsSinceEpoch(timePoint); +} + +void runPrepareModelTest(const std::shared_ptr& device, const Model& model, + Priority priority, std::optional deadlineBound) { + int64_t deadline = kNoDeadline; + if (deadlineBound.has_value()) { + deadline = makeDeadline(deadlineBound.value()); + } + + // see if service can handle model + std::vector supportedOps; + const auto supportedCallStatus = device->getSupportedOperations(model, &supportedOps); + ASSERT_TRUE(supportedCallStatus.isOk()); + ASSERT_NE(0ul, supportedOps.size()); + const bool fullySupportsModel = + std::all_of(supportedOps.begin(), supportedOps.end(), [](bool valid) { return valid; }); + + // launch prepare model + const std::shared_ptr preparedModelCallback = + ndk::SharedRefBase::make(); + const auto prepareLaunchStatus = + device->prepareModel(model, ExecutionPreference::FAST_SINGLE_ANSWER, priority, deadline, + {}, {}, kEmptyCacheToken, preparedModelCallback); + ASSERT_TRUE(prepareLaunchStatus.isOk()) + << "prepareLaunchStatus: " << prepareLaunchStatus.getDescription(); + + // retrieve prepared model + preparedModelCallback->wait(); + const ErrorStatus prepareReturnStatus = preparedModelCallback->getStatus(); + const std::shared_ptr preparedModel = preparedModelCallback->getPreparedModel(); + + // The getSupportedOperations call returns a list of operations that are guaranteed not to fail + // if prepareModel is called, and 'fullySupportsModel' is true i.f.f. the entire model is + // guaranteed. If a driver has any doubt that it can prepare an operation, it must return false. + // So here, if a driver isn't sure if it can support an operation, but reports that it + // successfully prepared the model, the test can continue. + if (!fullySupportsModel && prepareReturnStatus != ErrorStatus::NONE) { + ASSERT_EQ(nullptr, preparedModel.get()); + return; + } + + // verify return status + if (!deadlineBound.has_value()) { + EXPECT_EQ(ErrorStatus::NONE, prepareReturnStatus); + } else { + switch (deadlineBound.value()) { + case DeadlineBoundType::NOW: + case DeadlineBoundType::SHORT: + // Either the driver successfully completed the task or it + // aborted and returned MISSED_DEADLINE_*. + EXPECT_TRUE(prepareReturnStatus == ErrorStatus::NONE || + prepareReturnStatus == ErrorStatus::MISSED_DEADLINE_TRANSIENT || + prepareReturnStatus == ErrorStatus::MISSED_DEADLINE_PERSISTENT); + break; + case DeadlineBoundType::UNLIMITED: + // If an unlimited deadline is supplied, we expect the execution to + // proceed normally. In this case, check it normally by breaking out + // of the switch statement. + EXPECT_EQ(ErrorStatus::NONE, prepareReturnStatus); + break; + } + } + ASSERT_EQ(prepareReturnStatus == ErrorStatus::NONE, preparedModel.get() != nullptr); +} + +void runPrepareModelTests(const std::shared_ptr& device, const Model& model) { + // test priority + for (auto priority : ndk::enum_range{}) { + SCOPED_TRACE("priority: " + toString(priority)); + if (priority == kDefaultPriority) continue; + runPrepareModelTest(device, model, priority, {}); + } + + // test deadline + for (auto deadlineBound : deadlineBounds) { + SCOPED_TRACE("deadlineBound: " + toString(deadlineBound)); + runPrepareModelTest(device, model, kDefaultPriority, deadlineBound); + } +} + +static MaybeResults executeSynchronously(const std::shared_ptr& preparedModel, + const Request& request, int64_t deadline) { + SCOPED_TRACE("synchronous"); + const bool measure = false; + + // run execution + ExecutionResult executionResult; + const auto ret = preparedModel->executeSynchronously(request, measure, deadline, + kOmittedTimeoutDuration, &executionResult); + EXPECT_TRUE(ret.isOk() || ret.getExceptionCode() == EX_SERVICE_SPECIFIC) + << ret.getDescription(); + if (!ret.isOk()) { + if (ret.getExceptionCode() != EX_SERVICE_SPECIFIC) { + return std::nullopt; + } + return MaybeResults( + {static_cast(ret.getServiceSpecificError()), {}, kNoTiming}); + } + + // return results + return MaybeResults({executionResult.outputSufficientSize + ? ErrorStatus::NONE + : ErrorStatus::OUTPUT_INSUFFICIENT_SIZE, + std::move(executionResult.outputShapes), executionResult.timing}); +} + +void runExecutionTest(const std::shared_ptr& preparedModel, + const TestModel& testModel, const Request& request, + const ExecutionContext& context, DeadlineBoundType deadlineBound) { + const auto deadline = makeDeadline(deadlineBound); + + // Perform execution and unpack results. + const auto results = executeSynchronously(preparedModel, request, deadline); + if (!results.has_value()) return; + const auto& [status, outputShapes, timing] = results.value(); + + // Verify no timing information was returned + EXPECT_EQ(timing, kNoTiming); + + // Validate deadline information if applicable. + switch (deadlineBound) { + case DeadlineBoundType::NOW: + case DeadlineBoundType::SHORT: + // Either the driver successfully completed the task or it + // aborted and returned MISSED_DEADLINE_*. + ASSERT_TRUE(status == ErrorStatus::NONE || + status == ErrorStatus::MISSED_DEADLINE_TRANSIENT || + status == ErrorStatus::MISSED_DEADLINE_PERSISTENT); + break; + case DeadlineBoundType::UNLIMITED: + // If an unlimited deadline is supplied, we expect the execution to + // proceed normally. In this case, check it normally by breaking out + // of the switch statement. + ASSERT_EQ(ErrorStatus::NONE, status); + break; + } + + // If the model output operands are fully specified, outputShapes must be either + // either empty, or have the same number of elements as the number of outputs. + ASSERT_TRUE(outputShapes.size() == 0 || + outputShapes.size() == testModel.main.outputIndexes.size()); + + // Go through all outputs, check returned output shapes. + for (uint32_t i = 0; i < outputShapes.size(); i++) { + EXPECT_TRUE(outputShapes[i].isSufficient); + const auto expect = + utils::toSigned(testModel.main.operands[testModel.main.outputIndexes[i]].dimensions) + .value(); + const std::vector& actual = outputShapes[i].dimensions; + EXPECT_EQ(expect, actual); + } + + // Retrieve execution results. + const std::vector outputs = context.getOutputBuffers(request); + + // We want "close-enough" results. + if (status == ErrorStatus::NONE) { + checkResults(testModel, outputs); + } +} + +void runExecutionTests(const std::shared_ptr& preparedModel, + const TestModel& testModel, const Request& request, + const ExecutionContext& context) { + for (auto deadlineBound : deadlineBounds) { + runExecutionTest(preparedModel, testModel, request, context, deadlineBound); + } +} + +void runTests(const std::shared_ptr& device, const TestModel& testModel) { + // setup + const Model model = createModel(testModel); + + // run prepare model tests + runPrepareModelTests(device, model); + + // prepare model + std::shared_ptr preparedModel; + createPreparedModel(device, model, &preparedModel); + if (preparedModel == nullptr) return; + + // run execution tests + ExecutionContext context; + const Request request = context.createRequest(testModel); + runExecutionTests(preparedModel, testModel, request, context); +} + +class DeadlineTest : public GeneratedTestBase {}; + +TEST_P(DeadlineTest, Test) { + runTests(kDevice, kTestModel); +} + +INSTANTIATE_GENERATED_TEST(DeadlineTest, + [](const TestModel& testModel) { return !testModel.expectFailure; }); + +} // namespace aidl::android::hardware::neuralnetworks::vts::functional diff --git a/neuralnetworks/aidl/vts/functional/TestAssertions.cpp b/neuralnetworks/aidl/vts/functional/TestAssertions.cpp new file mode 100644 index 0000000000..a9e945608c --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/TestAssertions.cpp @@ -0,0 +1,153 @@ +/* + * 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 +#include +#include + +#include +#include + +namespace aidl::android::hardware::neuralnetworks { + +namespace nn = ::android::nn; + +static_assert(static_cast(IPreparedModel::DEFAULT_LOOP_TIMEOUT_DURATION_NS) == + nn::operation_while::kTimeoutNsDefault); +static_assert(static_cast(IPreparedModel::MAXIMUM_LOOP_TIMEOUT_DURATION_NS) == + nn::operation_while::kTimeoutNsMaximum); + +// Make sure that the HIDL enums are compatible with the values defined in +// frameworks/ml/nn/tools/test_generator/test_harness/include/TestHarness.h. +using namespace test_helper; +#define CHECK_TEST_ENUM(EnumType, enumValue) \ + static_assert(static_cast(Test##EnumType::enumValue) == EnumType::enumValue) + +CHECK_TEST_ENUM(OperandType, FLOAT32); +CHECK_TEST_ENUM(OperandType, INT32); +CHECK_TEST_ENUM(OperandType, UINT32); +CHECK_TEST_ENUM(OperandType, TENSOR_FLOAT32); +CHECK_TEST_ENUM(OperandType, TENSOR_INT32); +CHECK_TEST_ENUM(OperandType, TENSOR_QUANT8_ASYMM); +CHECK_TEST_ENUM(OperandType, BOOL); +CHECK_TEST_ENUM(OperandType, TENSOR_QUANT16_SYMM); +CHECK_TEST_ENUM(OperandType, TENSOR_FLOAT16); +CHECK_TEST_ENUM(OperandType, TENSOR_BOOL8); +CHECK_TEST_ENUM(OperandType, FLOAT16); +CHECK_TEST_ENUM(OperandType, TENSOR_QUANT8_SYMM_PER_CHANNEL); +CHECK_TEST_ENUM(OperandType, TENSOR_QUANT16_ASYMM); +CHECK_TEST_ENUM(OperandType, TENSOR_QUANT8_SYMM); +CHECK_TEST_ENUM(OperandType, TENSOR_QUANT8_ASYMM_SIGNED); + +CHECK_TEST_ENUM(OperationType, ADD); +CHECK_TEST_ENUM(OperationType, AVERAGE_POOL_2D); +CHECK_TEST_ENUM(OperationType, CONCATENATION); +CHECK_TEST_ENUM(OperationType, CONV_2D); +CHECK_TEST_ENUM(OperationType, DEPTHWISE_CONV_2D); +CHECK_TEST_ENUM(OperationType, DEPTH_TO_SPACE); +CHECK_TEST_ENUM(OperationType, DEQUANTIZE); +CHECK_TEST_ENUM(OperationType, EMBEDDING_LOOKUP); +CHECK_TEST_ENUM(OperationType, FLOOR); +CHECK_TEST_ENUM(OperationType, FULLY_CONNECTED); +CHECK_TEST_ENUM(OperationType, HASHTABLE_LOOKUP); +CHECK_TEST_ENUM(OperationType, L2_NORMALIZATION); +CHECK_TEST_ENUM(OperationType, L2_POOL_2D); +CHECK_TEST_ENUM(OperationType, LOCAL_RESPONSE_NORMALIZATION); +CHECK_TEST_ENUM(OperationType, LOGISTIC); +CHECK_TEST_ENUM(OperationType, LSH_PROJECTION); +CHECK_TEST_ENUM(OperationType, LSTM); +CHECK_TEST_ENUM(OperationType, MAX_POOL_2D); +CHECK_TEST_ENUM(OperationType, MUL); +CHECK_TEST_ENUM(OperationType, RELU); +CHECK_TEST_ENUM(OperationType, RELU1); +CHECK_TEST_ENUM(OperationType, RELU6); +CHECK_TEST_ENUM(OperationType, RESHAPE); +CHECK_TEST_ENUM(OperationType, RESIZE_BILINEAR); +CHECK_TEST_ENUM(OperationType, RNN); +CHECK_TEST_ENUM(OperationType, SOFTMAX); +CHECK_TEST_ENUM(OperationType, SPACE_TO_DEPTH); +CHECK_TEST_ENUM(OperationType, SVDF); +CHECK_TEST_ENUM(OperationType, TANH); +CHECK_TEST_ENUM(OperationType, BATCH_TO_SPACE_ND); +CHECK_TEST_ENUM(OperationType, DIV); +CHECK_TEST_ENUM(OperationType, MEAN); +CHECK_TEST_ENUM(OperationType, PAD); +CHECK_TEST_ENUM(OperationType, SPACE_TO_BATCH_ND); +CHECK_TEST_ENUM(OperationType, SQUEEZE); +CHECK_TEST_ENUM(OperationType, STRIDED_SLICE); +CHECK_TEST_ENUM(OperationType, SUB); +CHECK_TEST_ENUM(OperationType, TRANSPOSE); +CHECK_TEST_ENUM(OperationType, ABS); +CHECK_TEST_ENUM(OperationType, ARGMAX); +CHECK_TEST_ENUM(OperationType, ARGMIN); +CHECK_TEST_ENUM(OperationType, AXIS_ALIGNED_BBOX_TRANSFORM); +CHECK_TEST_ENUM(OperationType, BIDIRECTIONAL_SEQUENCE_LSTM); +CHECK_TEST_ENUM(OperationType, BIDIRECTIONAL_SEQUENCE_RNN); +CHECK_TEST_ENUM(OperationType, BOX_WITH_NMS_LIMIT); +CHECK_TEST_ENUM(OperationType, CAST); +CHECK_TEST_ENUM(OperationType, CHANNEL_SHUFFLE); +CHECK_TEST_ENUM(OperationType, DETECTION_POSTPROCESSING); +CHECK_TEST_ENUM(OperationType, EQUAL); +CHECK_TEST_ENUM(OperationType, EXP); +CHECK_TEST_ENUM(OperationType, EXPAND_DIMS); +CHECK_TEST_ENUM(OperationType, GATHER); +CHECK_TEST_ENUM(OperationType, GENERATE_PROPOSALS); +CHECK_TEST_ENUM(OperationType, GREATER); +CHECK_TEST_ENUM(OperationType, GREATER_EQUAL); +CHECK_TEST_ENUM(OperationType, GROUPED_CONV_2D); +CHECK_TEST_ENUM(OperationType, HEATMAP_MAX_KEYPOINT); +CHECK_TEST_ENUM(OperationType, INSTANCE_NORMALIZATION); +CHECK_TEST_ENUM(OperationType, LESS); +CHECK_TEST_ENUM(OperationType, LESS_EQUAL); +CHECK_TEST_ENUM(OperationType, LOG); +CHECK_TEST_ENUM(OperationType, LOGICAL_AND); +CHECK_TEST_ENUM(OperationType, LOGICAL_NOT); +CHECK_TEST_ENUM(OperationType, LOGICAL_OR); +CHECK_TEST_ENUM(OperationType, LOG_SOFTMAX); +CHECK_TEST_ENUM(OperationType, MAXIMUM); +CHECK_TEST_ENUM(OperationType, MINIMUM); +CHECK_TEST_ENUM(OperationType, NEG); +CHECK_TEST_ENUM(OperationType, NOT_EQUAL); +CHECK_TEST_ENUM(OperationType, PAD_V2); +CHECK_TEST_ENUM(OperationType, POW); +CHECK_TEST_ENUM(OperationType, PRELU); +CHECK_TEST_ENUM(OperationType, QUANTIZE); +CHECK_TEST_ENUM(OperationType, QUANTIZED_16BIT_LSTM); +CHECK_TEST_ENUM(OperationType, RANDOM_MULTINOMIAL); +CHECK_TEST_ENUM(OperationType, REDUCE_ALL); +CHECK_TEST_ENUM(OperationType, REDUCE_ANY); +CHECK_TEST_ENUM(OperationType, REDUCE_MAX); +CHECK_TEST_ENUM(OperationType, REDUCE_MIN); +CHECK_TEST_ENUM(OperationType, REDUCE_PROD); +CHECK_TEST_ENUM(OperationType, REDUCE_SUM); +CHECK_TEST_ENUM(OperationType, ROI_ALIGN); +CHECK_TEST_ENUM(OperationType, ROI_POOLING); +CHECK_TEST_ENUM(OperationType, RSQRT); +CHECK_TEST_ENUM(OperationType, SELECT); +CHECK_TEST_ENUM(OperationType, SIN); +CHECK_TEST_ENUM(OperationType, SLICE); +CHECK_TEST_ENUM(OperationType, SPLIT); +CHECK_TEST_ENUM(OperationType, SQRT); +CHECK_TEST_ENUM(OperationType, TILE); +CHECK_TEST_ENUM(OperationType, TOPK_V2); +CHECK_TEST_ENUM(OperationType, TRANSPOSE_CONV_2D); +CHECK_TEST_ENUM(OperationType, UNIDIRECTIONAL_SEQUENCE_LSTM); +CHECK_TEST_ENUM(OperationType, UNIDIRECTIONAL_SEQUENCE_RNN); +CHECK_TEST_ENUM(OperationType, RESIZE_NEAREST_NEIGHBOR); + +#undef CHECK_TEST_ENUM + +} // namespace aidl::android::hardware::neuralnetworks diff --git a/neuralnetworks/aidl/vts/functional/TestMain.cpp b/neuralnetworks/aidl/vts/functional/TestMain.cpp new file mode 100644 index 0000000000..1d58608fa3 --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/TestMain.cpp @@ -0,0 +1,27 @@ +/* + * 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 +#include +#include "LogTestCaseToLogcat.h" + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + testing::UnitTest::GetInstance()->listeners().Append( + new aidl::android::hardware::neuralnetworks::LogTestCaseToLogcat()); + ABinderProcess_startThreadPool(); + return RUN_ALL_TESTS(); +} diff --git a/neuralnetworks/aidl/vts/functional/Utils.cpp b/neuralnetworks/aidl/vts/functional/Utils.cpp new file mode 100644 index 0000000000..14a496a303 --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/Utils.cpp @@ -0,0 +1,252 @@ +/* + * 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 "Utils.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +namespace aidl::android::hardware::neuralnetworks { + +using test_helper::TestBuffer; +using test_helper::TestModel; + +uint32_t sizeOfData(OperandType type) { + switch (type) { + case OperandType::FLOAT32: + case OperandType::INT32: + case OperandType::UINT32: + case OperandType::TENSOR_FLOAT32: + case OperandType::TENSOR_INT32: + return 4; + case OperandType::TENSOR_QUANT16_SYMM: + case OperandType::TENSOR_FLOAT16: + case OperandType::FLOAT16: + case OperandType::TENSOR_QUANT16_ASYMM: + return 2; + case OperandType::TENSOR_QUANT8_ASYMM: + case OperandType::BOOL: + case OperandType::TENSOR_BOOL8: + case OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL: + case OperandType::TENSOR_QUANT8_SYMM: + case OperandType::TENSOR_QUANT8_ASYMM_SIGNED: + return 1; + case OperandType::SUBGRAPH: + return 0; + default: + CHECK(false) << "Invalid OperandType " << static_cast(type); + return 0; + } +} + +static bool isTensor(OperandType type) { + switch (type) { + case OperandType::FLOAT32: + case OperandType::INT32: + case OperandType::UINT32: + case OperandType::FLOAT16: + case OperandType::BOOL: + case OperandType::SUBGRAPH: + return false; + case OperandType::TENSOR_FLOAT32: + case OperandType::TENSOR_INT32: + case OperandType::TENSOR_QUANT16_SYMM: + case OperandType::TENSOR_FLOAT16: + case OperandType::TENSOR_QUANT16_ASYMM: + case OperandType::TENSOR_QUANT8_ASYMM: + case OperandType::TENSOR_BOOL8: + case OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL: + case OperandType::TENSOR_QUANT8_SYMM: + case OperandType::TENSOR_QUANT8_ASYMM_SIGNED: + return true; + default: + CHECK(false) << "Invalid OperandType " << static_cast(type); + return false; + } +} + +uint32_t sizeOfData(const Operand& operand) { + const uint32_t dataSize = sizeOfData(operand.type); + if (isTensor(operand.type) && operand.dimensions.size() == 0) return 0; + return std::accumulate(operand.dimensions.begin(), operand.dimensions.end(), dataSize, + std::multiplies<>{}); +} + +std::unique_ptr TestAshmem::create(uint32_t size) { + auto ashmem = std::make_unique(size); + return ashmem->mIsValid ? std::move(ashmem) : nullptr; +} + +void TestAshmem::initialize(uint32_t size) { + mIsValid = false; + ASSERT_GT(size, 0); + const auto sharedMemory = nn::createSharedMemory(size).value(); + mMappedMemory = nn::map(sharedMemory).value(); + mPtr = static_cast(std::get(mMappedMemory.pointer)); + CHECK_NE(mPtr, nullptr); + mAidlMemory = utils::convert(sharedMemory).value(); + mIsValid = true; +} + +std::unique_ptr TestBlobAHWB::create(uint32_t size) { + auto ahwb = std::make_unique(size); + return ahwb->mIsValid ? std::move(ahwb) : nullptr; +} + +void TestBlobAHWB::initialize(uint32_t size) { + mIsValid = false; + ASSERT_GT(size, 0); + const auto usage = AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN | AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN; + const AHardwareBuffer_Desc desc = { + .width = size, + .height = 1, + .layers = 1, + .format = AHARDWAREBUFFER_FORMAT_BLOB, + .usage = usage, + .stride = size, + }; + + ASSERT_EQ(AHardwareBuffer_allocate(&desc, &mAhwb), 0); + ASSERT_NE(mAhwb, nullptr); + + const auto sharedMemory = nn::createSharedMemoryFromAHWB(*mAhwb).value(); + mMapping = nn::map(sharedMemory).value(); + mPtr = static_cast(std::get(mMapping.pointer)); + CHECK_NE(mPtr, nullptr); + mAidlMemory = utils::convert(sharedMemory).value(); + + mIsValid = true; +} + +TestBlobAHWB::~TestBlobAHWB() { + if (mAhwb) { + AHardwareBuffer_unlock(mAhwb, nullptr); + AHardwareBuffer_release(mAhwb); + } +} + +std::string gtestCompliantName(std::string name) { + // gtest test names must only contain alphanumeric characters + std::replace_if( + name.begin(), name.end(), [](char c) { return !std::isalnum(c); }, '_'); + return name; +} + +::std::ostream& operator<<(::std::ostream& os, ErrorStatus errorStatus) { + return os << toString(errorStatus); +} + +Request ExecutionContext::createRequest(const TestModel& testModel, MemoryType memoryType) { + CHECK(memoryType == MemoryType::ASHMEM || memoryType == MemoryType::BLOB_AHWB); + + // Model inputs. + std::vector inputs(testModel.main.inputIndexes.size()); + size_t inputSize = 0; + for (uint32_t i = 0; i < testModel.main.inputIndexes.size(); i++) { + const auto& op = testModel.main.operands[testModel.main.inputIndexes[i]]; + if (op.data.size() == 0) { + // Omitted input. + inputs[i] = {.hasNoValue = true}; + } else { + DataLocation loc = {.poolIndex = kInputPoolIndex, + .offset = static_cast(inputSize), + .length = static_cast(op.data.size())}; + inputSize += op.data.alignedSize(); + inputs[i] = {.hasNoValue = false, .location = loc, .dimensions = {}}; + } + } + + // Model outputs. + std::vector outputs(testModel.main.outputIndexes.size()); + size_t outputSize = 0; + for (uint32_t i = 0; i < testModel.main.outputIndexes.size(); i++) { + const auto& op = testModel.main.operands[testModel.main.outputIndexes[i]]; + + // In the case of zero-sized output, we should at least provide a one-byte buffer. + // This is because zero-sized tensors are only supported internally to the driver, or + // reported in output shapes. It is illegal for the client to pre-specify a zero-sized + // tensor as model output. Otherwise, we will have two semantic conflicts: + // - "Zero dimension" conflicts with "unspecified dimension". + // - "Omitted operand buffer" conflicts with "zero-sized operand buffer". + size_t bufferSize = std::max(op.data.size(), 1); + + DataLocation loc = {.poolIndex = kOutputPoolIndex, + .offset = static_cast(outputSize), + .length = static_cast(bufferSize)}; + outputSize += op.data.size() == 0 ? TestBuffer::kAlignment : op.data.alignedSize(); + outputs[i] = {.hasNoValue = false, .location = loc, .dimensions = {}}; + } + + // Allocate memory pools. + if (memoryType == MemoryType::ASHMEM) { + mInputMemory = TestAshmem::create(inputSize); + mOutputMemory = TestAshmem::create(outputSize); + } else { + mInputMemory = TestBlobAHWB::create(inputSize); + mOutputMemory = TestBlobAHWB::create(outputSize); + } + CHECK_NE(mInputMemory, nullptr); + CHECK_NE(mOutputMemory, nullptr); + + auto copiedInputMemory = utils::clone(*mInputMemory->getAidlMemory()); + CHECK(copiedInputMemory.has_value()) << copiedInputMemory.error().message; + auto copiedOutputMemory = utils::clone(*mOutputMemory->getAidlMemory()); + CHECK(copiedOutputMemory.has_value()) << copiedOutputMemory.error().message; + + std::vector pools; + pools.push_back(RequestMemoryPool::make( + std::move(copiedInputMemory).value())); + pools.push_back(RequestMemoryPool::make( + std::move(copiedOutputMemory).value())); + + // Copy input data to the memory pool. + uint8_t* inputPtr = mInputMemory->getPointer(); + for (uint32_t i = 0; i < testModel.main.inputIndexes.size(); i++) { + const auto& op = testModel.main.operands[testModel.main.inputIndexes[i]]; + if (op.data.size() > 0) { + const uint8_t* begin = op.data.get(); + const uint8_t* end = begin + op.data.size(); + std::copy(begin, end, inputPtr + inputs[i].location.offset); + } + } + + return {.inputs = std::move(inputs), .outputs = std::move(outputs), .pools = std::move(pools)}; +} + +std::vector ExecutionContext::getOutputBuffers(const Request& request) const { + // Copy out output results. + uint8_t* outputPtr = mOutputMemory->getPointer(); + std::vector outputBuffers; + for (const auto& output : request.outputs) { + outputBuffers.emplace_back(output.location.length, outputPtr + output.location.offset); + } + return outputBuffers; +} + +} // namespace aidl::android::hardware::neuralnetworks diff --git a/neuralnetworks/aidl/vts/functional/Utils.h b/neuralnetworks/aidl/vts/functional/Utils.h new file mode 100644 index 0000000000..266301ca97 --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/Utils.h @@ -0,0 +1,153 @@ +/* + * 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_NEURALNETWORKS_AIDL_UTILS_H +#define ANDROID_HARDWARE_NEURALNETWORKS_AIDL_UTILS_H + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace aidl::android::hardware::neuralnetworks { + +namespace nn = ::android::nn; + +inline constexpr Priority kDefaultPriority = Priority::MEDIUM; + +inline constexpr Timing kNoTiming = {.timeOnDevice = -1, .timeInDriver = -1}; +inline constexpr int64_t kNoDeadline = -1; +inline constexpr int64_t kOmittedTimeoutDuration = -1; +inline constexpr int64_t kNoDuration = -1; +inline const std::vector kEmptyCacheToken(IDevice::BYTE_SIZE_OF_CACHE_TOKEN); + +// Returns the amount of space needed to store a value of the specified type. +// +// Aborts if the specified type is an extension type or OEM type. +uint32_t sizeOfData(OperandType type); + +// Returns the amount of space needed to store a value of the dimensions and +// type of this operand. For a non-extension, non-OEM tensor with unspecified +// rank or at least one unspecified dimension, returns zero. +// +// Aborts if the specified type is an extension type or OEM type. +uint32_t sizeOfData(const Operand& operand); + +// Convenience class to manage the lifetime of memory resources. +class TestMemoryBase { + DISALLOW_COPY_AND_ASSIGN(TestMemoryBase); + + public: + TestMemoryBase() = default; + virtual ~TestMemoryBase() = default; + uint8_t* getPointer() const { return mPtr; } + const Memory* getAidlMemory() const { return &mAidlMemory; } + + protected: + uint8_t* mPtr = nullptr; + Memory mAidlMemory; + bool mIsValid = false; +}; + +class TestAshmem : public TestMemoryBase { + public: + static std::unique_ptr create(uint32_t size); + + // Prefer TestAshmem::create. + // The constructor calls initialize, which constructs the memory resources. This is a workaround + // that gtest macros cannot be used directly in a constructor. + TestAshmem(uint32_t size) { initialize(size); } + + private: + void initialize(uint32_t size); + nn::Mapping mMappedMemory; +}; + +class TestBlobAHWB : public TestMemoryBase { + public: + static std::unique_ptr create(uint32_t size); + + // Prefer TestBlobAHWB::create. + // The constructor calls initialize, which constructs the memory resources. This is a + // workaround that gtest macros cannot be used directly in a constructor. + TestBlobAHWB(uint32_t size) { initialize(size); } + ~TestBlobAHWB(); + + private: + void initialize(uint32_t size); + AHardwareBuffer* mAhwb = nullptr; + nn::Mapping mMapping; +}; + +enum class MemoryType { ASHMEM, BLOB_AHWB, DEVICE }; + +// Manages the lifetime of memory resources used in an execution. +class ExecutionContext { + DISALLOW_COPY_AND_ASSIGN(ExecutionContext); + + public: + static constexpr uint32_t kInputPoolIndex = 0; + static constexpr uint32_t kOutputPoolIndex = 1; + + ExecutionContext() = default; + + // Create HIDL Request from the TestModel struct. + Request createRequest(const test_helper::TestModel& testModel, + MemoryType memoryType = MemoryType::ASHMEM); + + // After execution, copy out output results from the output memory pool. + std::vector getOutputBuffers(const Request& request) const; + + private: + std::unique_ptr mInputMemory, mOutputMemory; +}; + +template +using Named = std::pair; + +template +const std::string& getName(const Named& namedData) { + return namedData.first; +} + +template +const Type& getData(const Named& namedData) { + return namedData.second; +} + +std::string gtestCompliantName(std::string name); + +// pretty-print values for error messages +::std::ostream& operator<<(::std::ostream& os, ErrorStatus errorStatus); + +} // namespace aidl::android::hardware::neuralnetworks + +#endif // ANDROID_HARDWARE_NEURALNETWORKS_AIDL_UTILS_H diff --git a/neuralnetworks/aidl/vts/functional/ValidateModel.cpp b/neuralnetworks/aidl/vts/functional/ValidateModel.cpp new file mode 100644 index 0000000000..b84d981abd --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/ValidateModel.cpp @@ -0,0 +1,1338 @@ +/* + * 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. + */ + +#define LOG_TAG "neuralnetworks_aidl_hal_test" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "Callbacks.h" +#include "GeneratedTestHarness.h" +#include "Utils.h" +#include "VtsHalNeuralnetworks.h" + +namespace aidl::android::hardware::neuralnetworks::vts::functional { + +using common::NativeHandle; +using implementation::PreparedModelCallback; + +using PrepareModelMutation = std::function; + +///////////////////////// UTILITY FUNCTIONS ///////////////////////// + +static void validateGetSupportedOperations(const std::shared_ptr& device, + const std::string& message, const Model& model) { + SCOPED_TRACE(message + " [getSupportedOperations]"); + + std::vector supported; + const auto retStatus = device->getSupportedOperations(model, &supported); + + ASSERT_FALSE(retStatus.isOk()); + ASSERT_EQ(retStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(retStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); +} + +static void validatePrepareModel(const std::shared_ptr& device, const std::string& message, + const Model& model, ExecutionPreference preference, + Priority priority) { + SCOPED_TRACE(message + " [prepareModel]"); + + std::shared_ptr preparedModelCallback = + ndk::SharedRefBase::make(); + const auto prepareLaunchStatus = + device->prepareModel(model, preference, priority, kNoDeadline, {}, {}, kEmptyCacheToken, + preparedModelCallback); + ASSERT_FALSE(prepareLaunchStatus.isOk()); + ASSERT_EQ(prepareLaunchStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(prepareLaunchStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); + + preparedModelCallback->wait(); + ErrorStatus prepareReturnStatus = preparedModelCallback->getStatus(); + ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, prepareReturnStatus); + std::shared_ptr preparedModel = preparedModelCallback->getPreparedModel(); + ASSERT_EQ(nullptr, preparedModel.get()); +} + +static bool validExecutionPreference(ExecutionPreference preference) { + return preference == ExecutionPreference::LOW_POWER || + preference == ExecutionPreference::FAST_SINGLE_ANSWER || + preference == ExecutionPreference::SUSTAINED_SPEED; +} + +static bool validExecutionPriority(Priority priority) { + return priority == Priority::LOW || priority == Priority::MEDIUM || priority == Priority::HIGH; +} + +// Primary validation function. This function will take a valid model, apply a +// mutation to invalidate the model, the execution preference, or the priority, +// then pass these to supportedOperations and/or prepareModel if that method is +// called with an invalid argument. +static void validate(const std::shared_ptr& device, const std::string& message, + const Model& originalModel, const PrepareModelMutation& mutate) { + Model model = utils::clone(originalModel).value(); + ExecutionPreference preference = ExecutionPreference::FAST_SINGLE_ANSWER; + Priority priority = kDefaultPriority; + mutate(&model, &preference, &priority); + + if (validExecutionPreference(preference) && validExecutionPriority(priority)) { + validateGetSupportedOperations(device, message, model); + } + + validatePrepareModel(device, message, model, preference, priority); +} + +static uint32_t addOperand(Model* model) { + model->main.operands.push_back({ + .type = OperandType::INT32, + .dimensions = {}, + .scale = 0.0f, + .zeroPoint = 0, + .lifetime = OperandLifeTime::SUBGRAPH_INPUT, + .location = {.poolIndex = 0, .offset = 0, .length = 0}, + }); + return model->main.operands.size() - 1; +} + +static uint32_t addOperand(Model* model, OperandLifeTime lifetime) { + uint32_t index = addOperand(model); + model->main.operands[index].lifetime = lifetime; + return index; +} + +// If we introduce a CONSTANT_COPY for an operand of size operandSize, +// how much will this increase the size of the model? This assumes +// that we can (re)use all of model.operandValues for the operand +// value. +static size_t constantCopyExtraSize(const Model& model, size_t operandSize) { + const size_t operandValuesSize = model.operandValues.size(); + return (operandValuesSize < operandSize) ? (operandSize - operandValuesSize) : 0; +} + +// Highly specialized utility routine for converting an operand to +// CONSTANT_COPY lifetime. +// +// Expects that: +// - operand has a known size +// - operand->lifetime has already been set to CONSTANT_COPY +// - operand->location has been zeroed out +// +// Does the following: +// - initializes operand->location to point to the beginning of model->operandValues +// - resizes model->operandValues (if necessary) to be large enough for the operand +// value, padding it with zeroes on the end +// +// Potential problem: +// By changing the operand to CONSTANT_COPY lifetime, this function is effectively initializing the +// operand with unspecified (but deterministic) data. This means that the model may be invalidated +// in two ways: not only is the lifetime of CONSTANT_COPY invalid, but the operand's value in the +// graph may also be invalid (e.g., if the operand is used as an activation code and has an invalid +// value). For now, this should be fine because it just means we're not testing what we think we're +// testing in certain cases; but we can handwave this and assume we're probabilistically likely to +// exercise the validation code over the span of the entire test set and operand space. +// +// Aborts if the specified operand type is an extension type or OEM type. +static void becomeConstantCopy(Model* model, Operand* operand) { + // sizeOfData will abort if the specified type is an extension type or OEM type. + const size_t sizeOfOperand = sizeOfData(*operand); + EXPECT_NE(sizeOfOperand, size_t(0)); + operand->location.poolIndex = 0; + operand->location.offset = 0; + operand->location.length = sizeOfOperand; + if (model->operandValues.size() < sizeOfOperand) { + model->operandValues.resize(sizeOfOperand); + } +} + +// The sizeForBinder() functions estimate the size of the +// representation of a value when sent to binder. It's probably a bit +// of an under-estimate, because we don't know the size of the +// metadata in the binder format (e.g., representation of the size of +// a vector); but at least it adds up "big" things like vector +// contents. However, it doesn't treat inter-field or end-of-struct +// padding in a methodical way -- there's no attempt to be consistent +// in whether or not padding in the native (C++) representation +// contributes to the estimated size for the binder representation; +// and there's no attempt to understand what padding (if any) is +// needed in the binder representation. +// +// This assumes that non-metadata uses a fixed length encoding (e.g., +// a uint32_t is always encoded in sizeof(uint32_t) bytes, rather than +// using an encoding whose length is related to the magnitude of the +// encoded value). + +template +static size_t sizeForBinder(const Type& val) { + static_assert(std::is_trivially_copyable_v>, + "expected a trivially copyable type"); + return sizeof(val); +} + +template +static size_t sizeForBinder(const std::vector& vec) { + return std::accumulate(vec.begin(), vec.end(), 0, + [](size_t acc, const Type& x) { return acc + sizeForBinder(x); }); +} + +template <> +size_t sizeForBinder(const SymmPerChannelQuantParams& symmPerChannelQuantParams) { + size_t size = 0; + + size += sizeForBinder(symmPerChannelQuantParams.scales); + size += sizeForBinder(symmPerChannelQuantParams.channelDim); + + return size; +} + +template <> +size_t sizeForBinder(const std::optional& optionalExtraParams) { + if (!optionalExtraParams.has_value()) { + return 0; + } + const auto& extraParams = optionalExtraParams.value(); + using Tag = OperandExtraParams::Tag; + switch (extraParams.getTag()) { + case Tag::channelQuant: + return sizeForBinder(extraParams.get()); + case Tag::extension: + return sizeForBinder(extraParams.get()); + } + LOG(FATAL) << "Unrecognized extraParams tag: " << static_cast(extraParams.getTag()); + return 0; +} + +template <> +size_t sizeForBinder(const Operand& operand) { + size_t size = 0; + + size += sizeForBinder(operand.type); + size += sizeForBinder(operand.dimensions); + size += sizeForBinder(operand.scale); + size += sizeForBinder(operand.zeroPoint); + size += sizeForBinder(operand.lifetime); + size += sizeForBinder(operand.location); + size += sizeForBinder(operand.extraParams); + + return size; +} + +template <> +size_t sizeForBinder(const Operation& operation) { + size_t size = 0; + + size += sizeForBinder(operation.type); + size += sizeForBinder(operation.inputs); + size += sizeForBinder(operation.outputs); + + return size; +} + +template <> +size_t sizeForBinder(const std::string& name) { + return name.size(); +} + +template <> +size_t sizeForBinder(const Memory& memory) { + // This is just a guess. + + size_t size = 0; + const NativeHandle& handle = memory.handle; + size += sizeof(decltype(handle.fds)::value_type) * handle.fds.size(); + size += sizeof(decltype(handle.ints)::value_type) * handle.ints.size(); + size += sizeForBinder(memory.name); + size += sizeof(memory); + + return size; +} + +template <> +size_t sizeForBinder(const Subgraph& subgraph) { + size_t size = 0; + + size += sizeForBinder(subgraph.operands); + size += sizeForBinder(subgraph.operations); + size += sizeForBinder(subgraph.inputIndexes); + size += sizeForBinder(subgraph.outputIndexes); + + return size; +} + +template <> +size_t sizeForBinder(const ExtensionNameAndPrefix& extensionNameToPrefix) { + size_t size = 0; + + size += sizeForBinder(extensionNameToPrefix.name); + size += sizeForBinder(extensionNameToPrefix.prefix); + + return size; +} + +template <> +size_t sizeForBinder(const Model& model) { + size_t size = 0; + + size += sizeForBinder(model.main); + size += sizeForBinder(model.referenced); + size += sizeForBinder(model.operandValues); + size += sizeForBinder(model.pools); + size += sizeForBinder(model.relaxComputationFloat32toFloat16); + size += sizeForBinder(model.extensionNameToPrefix); + + return size; +} + +// https://developer.android.com/reference/android/os/TransactionTooLargeException.html +// +// "The Binder transaction buffer has a limited fixed size, +// currently 1Mb, which is shared by all transactions in progress +// for the process." +// +// Will our representation fit under this limit? There are two complications: +// - Our representation size is just approximate (see sizeForBinder()). +// - This object may not be the only occupant of the Binder transaction buffer. +// So we'll be very conservative: We want the representation size to be no +// larger than half the transaction buffer size. +// +// If our representation grows large enough that it still fits within +// the transaction buffer but combined with other transactions may +// exceed the buffer size, then we may see intermittent HAL transport +// errors. +static bool exceedsBinderSizeLimit(size_t representationSize) { + // Instead of using this fixed buffer size, we might instead be able to use + // ProcessState::self()->getMmapSize(). However, this has a potential + // problem: The binder/mmap size of the current process does not necessarily + // indicate the binder/mmap size of the service (i.e., the other process). + // The only way it would be a good indication is if both the current process + // and the service use the default size. + static const size_t kHalfBufferSize = 1024 * 1024 / 2; + + return representationSize > kHalfBufferSize; +} + +///////////////////////// VALIDATE EXECUTION ORDER //////////////////////////// + +static void mutateExecutionOrderTest(const std::shared_ptr& device, const Model& model, + const std::vector& numberOfConsumers) { + for (size_t operation = 0; operation < model.main.operations.size(); ++operation) { + const Operation& operationObj = model.main.operations[operation]; + for (uint32_t input : operationObj.inputs) { + if (model.main.operands[input].lifetime == OperandLifeTime::TEMPORARY_VARIABLE || + model.main.operands[input].lifetime == OperandLifeTime::SUBGRAPH_OUTPUT) { + // This operation reads an operand written by some + // other operation. Move this operation to the + // beginning of the sequence, ensuring that it reads + // the operand before that operand is written, thereby + // violating execution order rules. + const std::string message = "mutateExecutionOrderTest: operation " + + std::to_string(operation) + " is a reader"; + validate(device, message, model, + [operation](Model* model, ExecutionPreference*, Priority*) { + auto& operations = model->main.operations; + std::rotate(operations.begin(), operations.begin() + operation, + operations.begin() + operation + 1); + }); + break; // only need to do this once per operation + } + } + for (uint32_t output : operationObj.outputs) { + if (numberOfConsumers[output] > 0) { + // This operation writes an operand read by some other + // operation. Move this operation to the end of the + // sequence, ensuring that it writes the operand after + // that operand is read, thereby violating execution + // order rules. + const std::string message = "mutateExecutionOrderTest: operation " + + std::to_string(operation) + " is a writer"; + validate(device, message, model, + [operation](Model* model, ExecutionPreference*, Priority*) { + auto& operations = model->main.operations; + std::rotate(operations.begin() + operation, + operations.begin() + operation + 1, operations.end()); + }); + break; // only need to do this once per operation + } + } + } +} + +///////////////////////// VALIDATE MODEL OPERAND TYPE ///////////////////////// + +static const int32_t invalidOperandTypes[] = { + -1, + static_cast(*(ndk::enum_range().end() - 1)) + 1, +}; + +static void mutateOperandTypeTest(const std::shared_ptr& device, const Model& model) { + for (size_t operand = 0; operand < model.main.operands.size(); ++operand) { + for (int32_t invalidOperandType : invalidOperandTypes) { + const std::string message = "mutateOperandTypeTest: operand " + + std::to_string(operand) + " set to value " + + std::to_string(invalidOperandType); + validate(device, message, model, + [operand, invalidOperandType](Model* model, ExecutionPreference*, Priority*) { + model->main.operands[operand].type = + static_cast(invalidOperandType); + }); + } + } +} + +///////////////////////// VALIDATE OPERAND RANK ///////////////////////// + +static uint32_t getInvalidRank(OperandType type) { + switch (type) { + case OperandType::FLOAT16: + case OperandType::FLOAT32: + case OperandType::INT32: + case OperandType::UINT32: + case OperandType::BOOL: + return 1; + case OperandType::TENSOR_BOOL8: + case OperandType::TENSOR_FLOAT16: + case OperandType::TENSOR_FLOAT32: + case OperandType::TENSOR_INT32: + case OperandType::TENSOR_QUANT8_ASYMM: + case OperandType::TENSOR_QUANT8_SYMM: + case OperandType::TENSOR_QUANT16_ASYMM: + case OperandType::TENSOR_QUANT16_SYMM: + case OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL: + return 0; + default: + return 0; + } +} + +static void mutateOperandRankTest(const std::shared_ptr& device, const Model& model) { + for (size_t operand = 0; operand < model.main.operands.size(); ++operand) { + const uint32_t invalidRank = getInvalidRank(model.main.operands[operand].type); + if (invalidRank == 0) { + continue; + } + const std::string message = "mutateOperandRankTest: operand " + std::to_string(operand) + + " has rank of " + std::to_string(invalidRank); + validate(device, message, model, + [operand, invalidRank](Model* model, ExecutionPreference*, Priority*) { + model->main.operands[operand].dimensions = + std::vector(invalidRank, 0); + }); + } +} + +///////////////////////// VALIDATE OPERAND SCALE ///////////////////////// + +static float getInvalidScale(OperandType type) { + switch (type) { + case OperandType::FLOAT16: + case OperandType::FLOAT32: + case OperandType::INT32: + case OperandType::UINT32: + case OperandType::BOOL: + case OperandType::TENSOR_BOOL8: + case OperandType::TENSOR_FLOAT16: + case OperandType::TENSOR_FLOAT32: + case OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL: + case OperandType::SUBGRAPH: + return 1.0f; + case OperandType::TENSOR_INT32: + return -1.0f; + case OperandType::TENSOR_QUANT8_SYMM: + case OperandType::TENSOR_QUANT8_ASYMM: + case OperandType::TENSOR_QUANT16_ASYMM: + case OperandType::TENSOR_QUANT16_SYMM: + return 0.0f; + default: + return 0.0f; + } +} + +static void mutateOperandScaleTest(const std::shared_ptr& device, const Model& model) { + for (size_t operand = 0; operand < model.main.operands.size(); ++operand) { + const float invalidScale = getInvalidScale(model.main.operands[operand].type); + const std::string message = "mutateOperandScaleTest: operand " + std::to_string(operand) + + " has scale of " + std::to_string(invalidScale); + validate(device, message, model, + [operand, invalidScale](Model* model, ExecutionPreference*, Priority*) { + model->main.operands[operand].scale = invalidScale; + }); + } +} + +///////////////////////// VALIDATE OPERAND ZERO POINT ///////////////////////// + +static std::vector getInvalidZeroPoints(OperandType type) { + switch (type) { + case OperandType::FLOAT16: + case OperandType::FLOAT32: + case OperandType::INT32: + case OperandType::UINT32: + case OperandType::BOOL: + case OperandType::TENSOR_BOOL8: + case OperandType::TENSOR_FLOAT16: + case OperandType::TENSOR_FLOAT32: + case OperandType::TENSOR_INT32: + case OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL: + case OperandType::SUBGRAPH: + return {1}; + case OperandType::TENSOR_QUANT8_ASYMM: + return {-1, 256}; + case OperandType::TENSOR_QUANT8_SYMM: + return {-129, -1, 1, 128}; + case OperandType::TENSOR_QUANT16_ASYMM: + return {-1, 65536}; + case OperandType::TENSOR_QUANT16_SYMM: + return {-32769, -1, 1, 32768}; + default: + return {}; + } +} + +static void mutateOperandZeroPointTest(const std::shared_ptr& device, const Model& model) { + for (size_t operand = 0; operand < model.main.operands.size(); ++operand) { + const std::vector invalidZeroPoints = + getInvalidZeroPoints(model.main.operands[operand].type); + for (int32_t invalidZeroPoint : invalidZeroPoints) { + const std::string message = "mutateOperandZeroPointTest: operand " + + std::to_string(operand) + " has zero point of " + + std::to_string(invalidZeroPoint); + validate(device, message, model, + [operand, invalidZeroPoint](Model* model, ExecutionPreference*, Priority*) { + model->main.operands[operand].zeroPoint = invalidZeroPoint; + }); + } + } +} + +///////////////////////// VALIDATE OPERAND LIFETIME ///////////////////////////////////////////// + +static std::vector getInvalidLifeTimes(const Model& model, size_t modelSize, + const Operand& operand) { + // TODO: Support OperandLifeTime::CONSTANT_REFERENCE as an invalid lifetime + // TODO: Support OperandLifeTime::NO_VALUE as an invalid lifetime + + // Ways to get an invalid lifetime: + // - change whether a lifetime means an operand should have a writer + std::vector ret; + switch (operand.lifetime) { + case OperandLifeTime::SUBGRAPH_OUTPUT: + case OperandLifeTime::TEMPORARY_VARIABLE: + ret = { + OperandLifeTime::SUBGRAPH_INPUT, + OperandLifeTime::CONSTANT_COPY, + }; + break; + case OperandLifeTime::CONSTANT_COPY: + case OperandLifeTime::CONSTANT_POOL: + case OperandLifeTime::SUBGRAPH_INPUT: + ret = { + OperandLifeTime::TEMPORARY_VARIABLE, + OperandLifeTime::SUBGRAPH_OUTPUT, + }; + break; + case OperandLifeTime::NO_VALUE: + // Not enough information to know whether + // TEMPORARY_VARIABLE or CONSTANT_COPY would be invalid -- + // is this operand written (then CONSTANT_COPY would be + // invalid) or not (then TEMPORARY_VARIABLE would be + // invalid)? + break; + case OperandLifeTime::SUBGRAPH: + break; + default: + ADD_FAILURE(); + break; + } + + const size_t operandSize = sizeOfData(operand); // will be zero if shape is unknown + if (!operandSize || + exceedsBinderSizeLimit(modelSize + constantCopyExtraSize(model, operandSize))) { + // Unknown size or too-large size + ret.erase(std::remove(ret.begin(), ret.end(), OperandLifeTime::CONSTANT_COPY), ret.end()); + } + + return ret; +} + +static void mutateOperandLifeTimeTest(const std::shared_ptr& device, const Model& model) { + const size_t modelSize = sizeForBinder(model); + for (size_t operand = 0; operand < model.main.operands.size(); ++operand) { + const std::vector invalidLifeTimes = + getInvalidLifeTimes(model, modelSize, model.main.operands[operand]); + for (OperandLifeTime invalidLifeTime : invalidLifeTimes) { + const std::string message = "mutateOperandLifetimeTest: operand " + + std::to_string(operand) + " has lifetime " + + toString(invalidLifeTime) + " instead of lifetime " + + toString(model.main.operands[operand].lifetime); + validate(device, message, model, + [operand, invalidLifeTime](Model* model, ExecutionPreference*, Priority*) { + static const DataLocation kZeroDataLocation = {}; + Operand& operandObj = model->main.operands[operand]; + switch (operandObj.lifetime) { + case OperandLifeTime::SUBGRAPH_INPUT: { + auto& inputs = model->main.inputIndexes; + inputs.erase(std::remove(inputs.begin(), inputs.end(), operand), + inputs.end()); + break; + } + case OperandLifeTime::SUBGRAPH_OUTPUT: { + auto& outputs = model->main.outputIndexes; + outputs.erase(std::remove(outputs.begin(), outputs.end(), operand), + outputs.end()); + break; + } + default: + break; + } + operandObj.lifetime = invalidLifeTime; + operandObj.location = kZeroDataLocation; + switch (invalidLifeTime) { + case OperandLifeTime::CONSTANT_COPY: { + becomeConstantCopy(model, &operandObj); + break; + } + case OperandLifeTime::SUBGRAPH_INPUT: + model->main.inputIndexes.push_back(operand); + break; + case OperandLifeTime::SUBGRAPH_OUTPUT: + model->main.outputIndexes.push_back(operand); + break; + default: + break; + } + }); + } + } +} + +///////////////////////// VALIDATE OPERAND INPUT-or-OUTPUT ////////////////////////////////////// + +static std::optional getInputOutputLifeTime(const Model& model, size_t modelSize, + const Operand& operand) { + // Ways to get an invalid lifetime (with respect to model inputIndexes and outputIndexes): + // - change whether a lifetime means an operand is a model input, a model output, or neither + // - preserve whether or not a lifetime means an operand should have a writer + switch (operand.lifetime) { + case OperandLifeTime::CONSTANT_COPY: + case OperandLifeTime::CONSTANT_POOL: + return OperandLifeTime::SUBGRAPH_INPUT; + case OperandLifeTime::SUBGRAPH_INPUT: { + const size_t operandSize = sizeOfData(operand); // will be zero if shape is unknown + if (!operandSize || + exceedsBinderSizeLimit(modelSize + constantCopyExtraSize(model, operandSize))) { + // Unknown size or too-large size + break; + } + return OperandLifeTime::CONSTANT_COPY; + } + case OperandLifeTime::SUBGRAPH_OUTPUT: + return OperandLifeTime::TEMPORARY_VARIABLE; + case OperandLifeTime::TEMPORARY_VARIABLE: + return OperandLifeTime::SUBGRAPH_OUTPUT; + case OperandLifeTime::NO_VALUE: + // Not enough information to know whether + // TEMPORARY_VARIABLE or CONSTANT_COPY would be an + // appropriate choice -- is this operand written (then + // TEMPORARY_VARIABLE would be appropriate) or not (then + // CONSTANT_COPY would be appropriate)? + break; + case OperandLifeTime::SUBGRAPH: + break; + default: + ADD_FAILURE(); + break; + } + + return std::nullopt; +} + +static void mutateOperandInputOutputTest(const std::shared_ptr& device, + const Model& model) { + const size_t modelSize = sizeForBinder(model); + for (size_t operand = 0; operand < model.main.operands.size(); ++operand) { + const std::optional changedLifeTime = + getInputOutputLifeTime(model, modelSize, model.main.operands[operand]); + if (changedLifeTime) { + const std::string message = "mutateOperandInputOutputTest: operand " + + std::to_string(operand) + " has lifetime " + + toString(*changedLifeTime) + " instead of lifetime " + + toString(model.main.operands[operand].lifetime); + validate(device, message, model, + [operand, changedLifeTime](Model* model, ExecutionPreference*, Priority*) { + static const DataLocation kZeroDataLocation = {}; + Operand& operandObj = model->main.operands[operand]; + operandObj.lifetime = *changedLifeTime; + operandObj.location = kZeroDataLocation; + if (*changedLifeTime == OperandLifeTime::CONSTANT_COPY) { + becomeConstantCopy(model, &operandObj); + } + }); + } + } +} + +///////////////////////// VALIDATE OPERAND NUMBER OF WRITERS //////////////////////////////////// + +static void mutateOperandAddWriterTest(const std::shared_ptr& device, const Model& model) { + for (size_t operation = 0; operation < model.main.operations.size(); ++operation) { + for (size_t badOutputNum = 0; + badOutputNum < model.main.operations[operation].outputs.size(); ++badOutputNum) { + const uint32_t outputOperandIndex = + model.main.operations[operation].outputs[badOutputNum]; + const std::string message = "mutateOperandAddWriterTest: operation " + + std::to_string(operation) + " writes to " + + std::to_string(outputOperandIndex); + // We'll insert a copy of the operation, all of whose + // OTHER output operands are newly-created -- i.e., + // there'll only be a duplicate write of ONE of that + // operation's output operands. + validate(device, message, model, + [operation, badOutputNum](Model* model, ExecutionPreference*, Priority*) { + Operation newOperation = model->main.operations[operation]; + for (size_t outputNum = 0; outputNum < newOperation.outputs.size(); + ++outputNum) { + if (outputNum == badOutputNum) continue; + + Operand operandValue = + model->main.operands[newOperation.outputs[outputNum]]; + if (operandValue.lifetime == OperandLifeTime::SUBGRAPH_OUTPUT) { + operandValue.lifetime = OperandLifeTime::TEMPORARY_VARIABLE; + } else { + ASSERT_EQ(operandValue.lifetime, + OperandLifeTime::TEMPORARY_VARIABLE); + } + newOperation.outputs[outputNum] = model->main.operands.size(); + model->main.operands.push_back(operandValue); + } + // Where do we insert the extra writer (a new + // operation)? It has to be later than all the + // writers of its inputs. The easiest thing to do + // is to insert it at the end of the operation + // sequence. + model->main.operations.push_back(newOperation); + }); + } + } +} + +///////////////////////// VALIDATE EXTRA ??? ///////////////////////// + +// TODO: Operand::location + +///////////////////////// VALIDATE OPERATION OPERAND TYPE ///////////////////////// + +static void mutateOperand(Operand* operand, OperandType type) { + Operand newOperand = *operand; + newOperand.type = type; + switch (type) { + case OperandType::FLOAT16: + case OperandType::FLOAT32: + case OperandType::INT32: + case OperandType::UINT32: + case OperandType::BOOL: + newOperand.dimensions = {}; + newOperand.scale = 0.0f; + newOperand.zeroPoint = 0; + break; + case OperandType::TENSOR_BOOL8: + case OperandType::TENSOR_FLOAT16: + case OperandType::TENSOR_FLOAT32: + newOperand.dimensions = operand->dimensions.size() > 0 ? operand->dimensions + : std::vector({1}); + newOperand.scale = 0.0f; + newOperand.zeroPoint = 0; + break; + case OperandType::TENSOR_INT32: + newOperand.dimensions = operand->dimensions.size() > 0 ? operand->dimensions + : std::vector({1}); + newOperand.zeroPoint = 0; + break; + case OperandType::TENSOR_QUANT8_ASYMM: + case OperandType::TENSOR_QUANT8_SYMM: + case OperandType::TENSOR_QUANT16_ASYMM: + case OperandType::TENSOR_QUANT16_SYMM: + newOperand.dimensions = operand->dimensions.size() > 0 ? operand->dimensions + : std::vector({1}); + newOperand.scale = operand->scale != 0.0f ? operand->scale : 1.0f; + break; + case OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL: { + newOperand.dimensions = operand->dimensions.size() > 0 ? operand->dimensions + : std::vector({1}); + newOperand.scale = 0.0f; + newOperand.zeroPoint = 0; + + SymmPerChannelQuantParams channelQuant; + channelQuant.channelDim = 0; + channelQuant.scales = std::vector( + operand->dimensions.size() > 0 ? static_cast(operand->dimensions[0]) + : 0); + for (size_t i = 0; i < channelQuant.scales.size(); ++i) { + channelQuant.scales[i] = 1.0f; + } + newOperand.extraParams->set( + std::move(channelQuant)); + } break; + default: + break; + } + *operand = newOperand; +} + +static bool mutateOperationOperandTypeSkip(size_t operand, OperandType type, const Model& model) { + if (type == model.main.operands[operand].type) { + return true; + } + for (const Operation& operation : model.main.operations) { + // Skip mutateOperationOperandTypeTest for the following operations. + // - LSH_PROJECTION's second argument is allowed to have any type. + // - ARGMIN and ARGMAX's first argument can be any of + // TENSOR_(FLOAT16|FLOAT32|INT32|QUANT8_ASYMM). + // - CAST's argument can be any of TENSOR_(FLOAT16|FLOAT32|INT32|QUANT8_ASYMM). + // - RANDOM_MULTINOMIAL's argument can be either TENSOR_FLOAT16 or TENSOR_FLOAT32. + // - DEQUANTIZE input can be any of + // TENSOR_(QUANT8_ASYMM|QUANT8_ASYMM_SIGNED|QUANT8_SYMM|QUANT8_SYMM_PER_CHANNEL), + // output can be of either TENSOR_FLOAT16 or TENSOR_FLOAT32. + // - QUANTIZE input can be either TENSOR_FLOAT16 or TENSOR_FLOAT32 + // - CONV_2D filter type (arg 1) can be QUANT8_ASYMM or QUANT8_SYMM_PER_CHANNEL + // - DEPTHWISE_CONV_2D filter type (arg 1) can be QUANT8_ASYMM or QUANT8_SYMM_PER_CHANNEL + // - GROUPED_CONV_2D filter type (arg 1) can be QUANT8_ASYMM or QUANT8_SYMM_PER_CHANNEL + // - TRANSPOSE_CONV_2D filter type (arg 1) can be QUANT8_ASYMM or QUANT8_SYMM_PER_CHANNEL + // - AXIS_ALIGNED_BBOX_TRANSFORM bounding boxes (arg 1) can be of + // TENSOR_QUANT8_ASYMM or TENSOR_QUANT8_ASYMM_SIGNED. + // - RANK's input can have any TENSOR_* type. + switch (operation.type) { + case OperationType::LSH_PROJECTION: { + if (operand == operation.inputs[1]) { + return true; + } + } break; + case OperationType::CAST: + case OperationType::ARGMAX: + case OperationType::ARGMIN: { + if (type == OperandType::TENSOR_FLOAT16 || type == OperandType::TENSOR_FLOAT32 || + type == OperandType::TENSOR_INT32 || type == OperandType::TENSOR_QUANT8_ASYMM || + type == OperandType::TENSOR_QUANT8_ASYMM_SIGNED) { + return true; + } + } break; + case OperationType::QUANTIZE: { + if (operand == operation.inputs[0] && + (type == OperandType::TENSOR_FLOAT16 || type == OperandType::TENSOR_FLOAT32)) { + return true; + } + if (operand == operation.outputs[0] && + (type == OperandType::TENSOR_QUANT8_ASYMM || + type == OperandType::TENSOR_QUANT8_ASYMM_SIGNED)) { + return true; + } + } break; + case OperationType::RANDOM_MULTINOMIAL: { + if (operand == operation.inputs[0] && + (type == OperandType::TENSOR_FLOAT16 || type == OperandType::TENSOR_FLOAT32)) { + return true; + } + } break; + case OperationType::DEQUANTIZE: { + if (operand == operation.inputs[0] && + (type == OperandType::TENSOR_QUANT8_ASYMM || + type == OperandType::TENSOR_QUANT8_ASYMM_SIGNED || + type == OperandType::TENSOR_QUANT8_SYMM || + type == OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL)) { + return true; + } + if (operand == operation.outputs[0] && + (type == OperandType::TENSOR_FLOAT16 || type == OperandType::TENSOR_FLOAT32)) { + return true; + } + } break; + case OperationType::TRANSPOSE_CONV_2D: + case OperationType::GROUPED_CONV_2D: + case OperationType::DEPTHWISE_CONV_2D: + case OperationType::CONV_2D: { + if (operand == operation.inputs[1] && + (type == OperandType::TENSOR_QUANT8_ASYMM || + type == OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL)) { + return true; + } + } break; + case OperationType::AXIS_ALIGNED_BBOX_TRANSFORM: { + if (operand == operation.inputs[1] && + (type == OperandType::TENSOR_QUANT8_ASYMM || + type == OperandType::TENSOR_QUANT8_ASYMM_SIGNED)) { + return true; + } + } break; + case OperationType::RANK: { + if (operand == operation.inputs[0] && + (type == OperandType::TENSOR_FLOAT16 || type == OperandType::TENSOR_FLOAT32 || + type == OperandType::TENSOR_INT32 || + type == OperandType::TENSOR_QUANT8_ASYMM || + type == OperandType::TENSOR_QUANT16_SYMM || + type == OperandType::TENSOR_BOOL8 || + type == OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL || + type == OperandType::TENSOR_QUANT16_ASYMM || + type == OperandType::TENSOR_QUANT8_SYMM || + type == OperandType::TENSOR_QUANT8_ASYMM_SIGNED)) { + return true; + } + } break; + default: + break; + } + } + return false; +} + +static void mutateOperationOperandTypeTest(const std::shared_ptr& device, + const Model& model) { + for (size_t operand = 0; operand < model.main.operands.size(); ++operand) { + for (OperandType invalidOperandType : ndk::enum_range()) { + if (mutateOperationOperandTypeSkip(operand, invalidOperandType, model)) { + continue; + } + const std::string message = "mutateOperationOperandTypeTest: operand " + + std::to_string(operand) + " set to type " + + toString(invalidOperandType); + validate(device, message, model, + [operand, invalidOperandType](Model* model, ExecutionPreference*, Priority*) { + mutateOperand(&model->main.operands[operand], invalidOperandType); + }); + } + } +} + +///////////////////////// VALIDATE MODEL OPERATION TYPE ///////////////////////// + +static const int32_t invalidOperationTypes[] = { + -1, + static_cast(*(ndk::enum_range().end() - 1)) + 1, +}; + +static void mutateOperationTypeTest(const std::shared_ptr& device, const Model& model) { + for (size_t operation = 0; operation < model.main.operations.size(); ++operation) { + for (int32_t invalidOperationType : invalidOperationTypes) { + const std::string message = "mutateOperationTypeTest: operation " + + std::to_string(operation) + " set to value " + + std::to_string(invalidOperationType); + validate(device, message, model, + [operation, invalidOperationType](Model* model, ExecutionPreference*, + Priority*) { + model->main.operations[operation].type = + static_cast(invalidOperationType); + }); + } + } +} + +///////////////////////// VALIDATE MODEL OPERATION INPUT OPERAND INDEX ///////////////////////// + +static void mutateOperationInputOperandIndexTest(const std::shared_ptr& device, + const Model& model) { + for (size_t operation = 0; operation < model.main.operations.size(); ++operation) { + const uint32_t invalidOperand = model.main.operands.size(); + for (size_t input = 0; input < model.main.operations[operation].inputs.size(); ++input) { + const std::string message = "mutateOperationInputOperandIndexTest: operation " + + std::to_string(operation) + " input " + + std::to_string(input); + validate(device, message, model, + [operation, input, invalidOperand](Model* model, ExecutionPreference*, + Priority*) { + model->main.operations[operation].inputs[input] = invalidOperand; + }); + } + } +} + +///////////////////////// VALIDATE MODEL OPERATION OUTPUT OPERAND INDEX ///////////////////////// + +static void mutateOperationOutputOperandIndexTest(const std::shared_ptr& device, + const Model& model) { + for (size_t operation = 0; operation < model.main.operations.size(); ++operation) { + const uint32_t invalidOperand = model.main.operands.size(); + for (size_t output = 0; output < model.main.operations[operation].outputs.size(); + ++output) { + const std::string message = "mutateOperationOutputOperandIndexTest: operation " + + std::to_string(operation) + " output " + + std::to_string(output); + validate(device, message, model, + [operation, output, invalidOperand](Model* model, ExecutionPreference*, + Priority*) { + model->main.operations[operation].outputs[output] = invalidOperand; + }); + } + } +} + +///////////////////////// VALIDATE MODEL OPERANDS WRITTEN /////////////////////////////////////// + +static void mutateOperationRemoveWriteTest(const std::shared_ptr& device, + const Model& model, + const std::vector& numberOfConsumers) { + for (size_t operation = 0; operation < model.main.operations.size(); ++operation) { + for (size_t outputNum = 0; outputNum < model.main.operations[operation].outputs.size(); + ++outputNum) { + const uint32_t outputOperandIndex = model.main.operations[operation].outputs[outputNum]; + if (numberOfConsumers[outputOperandIndex] > 0) { + const std::string message = "mutateOperationRemoveWriteTest: operation " + + std::to_string(operation) + " writes to " + + std::to_string(outputOperandIndex); + validate(device, message, model, + [operation, outputNum](Model* model, ExecutionPreference*, Priority*) { + int32_t& outputOperandIndex = + model->main.operations[operation].outputs[outputNum]; + Operand operandValue = model->main.operands[outputOperandIndex]; + if (operandValue.lifetime == OperandLifeTime::SUBGRAPH_OUTPUT) { + operandValue.lifetime = OperandLifeTime::TEMPORARY_VARIABLE; + } else { + ASSERT_EQ(operandValue.lifetime, + OperandLifeTime::TEMPORARY_VARIABLE); + } + outputOperandIndex = model->main.operands.size(); + model->main.operands.push_back(operandValue); + }); + } + } + } +} + +///////////////////////// REMOVE OPERAND FROM EVERYTHING ///////////////////////// + +static void removeValueAndDecrementGreaterValues(std::vector* vec, uint32_t value) { + if (vec) { + // remove elements matching "value" + vec->erase(std::remove(vec->begin(), vec->end(), value), vec->end()); + + // decrement elements exceeding "value" + std::transform(vec->begin(), vec->end(), vec->begin(), + [value](uint32_t v) { return v > value ? v-- : v; }); + } +} + +static void removeOperand(Model* model, uint32_t index) { + model->main.operands.erase(model->main.operands.begin() + index); + for (Operation& operation : model->main.operations) { + removeValueAndDecrementGreaterValues(&operation.inputs, index); + removeValueAndDecrementGreaterValues(&operation.outputs, index); + } + removeValueAndDecrementGreaterValues(&model->main.inputIndexes, index); + removeValueAndDecrementGreaterValues(&model->main.outputIndexes, index); +} + +static bool removeOperandSkip(size_t operandIndex, const Model& model, + const std::vector& numberOfConsumers) { + if (numberOfConsumers[operandIndex] == 0) { + // Removing an unused operand has no effect. + return true; + } + for (const Operation& operation : model.main.operations) { + // Skip removeOperandTest for the following operations. + // - SPLIT's outputs are not checked during prepareModel. + if (operation.type == OperationType::SPLIT) { + for (const size_t index : operation.outputs) { + if (index == operandIndex) { + return true; + } + } + } + // BIDIRECTIONAL_SEQUENCE_LSTM and BIDIRECTIONAL_SEQUENCE_RNN can have + // either one, two, three or four outputs depending on their + // mergeOutputs parameter and if state outputs are provided. + // UNIDIRECTIONAL_SEQUENCE_LSTM and UNIDIRECTIONAL_SEQUENCE_RNN can have + // either one or three outputs depending on whether state outputs are + // provided. + if (operation.type == OperationType::UNIDIRECTIONAL_SEQUENCE_LSTM || + operation.type == OperationType::UNIDIRECTIONAL_SEQUENCE_RNN || + operation.type == OperationType::BIDIRECTIONAL_SEQUENCE_LSTM || + operation.type == OperationType::BIDIRECTIONAL_SEQUENCE_RNN) { + for (const size_t index : operation.outputs) { + if (index == operandIndex) { + return true; + } + } + } + } + return false; +} + +static void removeOperandTest(const std::shared_ptr& device, const Model& model, + const std::vector& numberOfConsumers) { + for (size_t operand = 0; operand < model.main.operands.size(); ++operand) { + if (removeOperandSkip(operand, model, numberOfConsumers)) { + continue; + } + const std::string message = "removeOperandTest: operand " + std::to_string(operand); + validate(device, message, model, [operand](Model* model, ExecutionPreference*, Priority*) { + removeOperand(model, operand); + }); + } +} + +///////////////////////// REMOVE OPERATION ///////////////////////// + +static void removeOperation(Model* model, uint32_t index) { + auto& operations = model->main.operations; + operations.erase(operations.begin() + index); +} + +static void removeOperationTest(const std::shared_ptr& device, const Model& model) { + for (size_t operation = 0; operation < model.main.operations.size(); ++operation) { + const std::string message = "removeOperationTest: operation " + std::to_string(operation); + validate(device, message, model, + [operation](Model* model, ExecutionPreference*, Priority*) { + removeOperation(model, operation); + }); + } +} + +///////////////////////// REMOVE OPERATION INPUT ///////////////////////// + +static bool removeOperationInputSkip(const Operation& op, size_t input) { + // Skip removeOperationInputTest for the following operations. + // - CONCATENATION has at least 2 inputs, with the last element being INT32. + // - CONV_2D, DEPTHWISE_CONV_2D, MAX_POOL_2D, AVERAGE_POOL_2D, L2_POOL_2D, RESIZE_BILINEAR, + // SPACE_TO_DEPTH, SPACE_TO_DEPTH, SPACE_TO_BATCH_ND, BATCH_TO_SPACE_ND can have an optional + // layout parameter. + // RESIZE_BILINEAR and RESIZE_NEAREST_NEIGHBOR can have optional + // align_corners and half_pixel_centers parameters. + // - L2_NORMALIZATION, LOCAL_RESPONSE_NORMALIZATION, SOFTMAX can have an optional axis + // parameter. + switch (op.type) { + case OperationType::CONCATENATION: { + if (op.inputs.size() > 2 && input != op.inputs.size() - 1) { + return true; + } + } break; + case OperationType::DEPTHWISE_CONV_2D: { + if ((op.inputs.size() == 12 && input == 11) || (op.inputs.size() == 9 && input == 8)) { + return true; + } + } break; + case OperationType::CONV_2D: + case OperationType::AVERAGE_POOL_2D: + case OperationType::MAX_POOL_2D: + case OperationType::L2_POOL_2D: { + if ((op.inputs.size() == 11 && input == 10) || (op.inputs.size() == 8 && input == 7)) { + return true; + } + } break; + case OperationType::RESIZE_BILINEAR: { + if (op.inputs.size() >= 4 && input >= 3) { + return true; + } + } break; + case OperationType::RESIZE_NEAREST_NEIGHBOR: { + if (op.inputs.size() >= 5 && input >= 3) { + return true; + } + } break; + case OperationType::SPACE_TO_DEPTH: + case OperationType::DEPTH_TO_SPACE: + case OperationType::BATCH_TO_SPACE_ND: { + if (op.inputs.size() == 3 && input == 2) { + return true; + } + } break; + case OperationType::SPACE_TO_BATCH_ND: { + if (op.inputs.size() == 4 && input == 3) { + return true; + } + } break; + case OperationType::L2_NORMALIZATION: { + if (op.inputs.size() == 2 && input == 1) { + return true; + } + } break; + case OperationType::LOCAL_RESPONSE_NORMALIZATION: { + if (op.inputs.size() == 6 && input == 5) { + return true; + } + } break; + case OperationType::SOFTMAX: { + if (op.inputs.size() == 3 && input == 2) { + return true; + } + } break; + default: + break; + } + return false; +} + +static void removeOperationInputTest(const std::shared_ptr& device, const Model& model) { + for (size_t operation = 0; operation < model.main.operations.size(); ++operation) { + for (size_t input = 0; input < model.main.operations[operation].inputs.size(); ++input) { + const Operation& op = model.main.operations[operation]; + if (removeOperationInputSkip(op, input)) { + continue; + } + const std::string message = "removeOperationInputTest: operation " + + std::to_string(operation) + ", input " + + std::to_string(input); + validate(device, message, model, + [operation, input](Model* model, ExecutionPreference*, Priority*) { + auto& inputs = model->main.operations[operation].inputs; + inputs.erase(inputs.begin() + input); + }); + } + } +} + +///////////////////////// REMOVE OPERATION OUTPUT ///////////////////////// + +static void removeOperationOutputTest(const std::shared_ptr& device, const Model& model) { + for (size_t operation = 0; operation < model.main.operations.size(); ++operation) { + for (size_t output = 0; output < model.main.operations[operation].outputs.size(); + ++output) { + const std::string message = "removeOperationOutputTest: operation " + + std::to_string(operation) + ", output " + + std::to_string(output); + validate(device, message, model, + [operation, output](Model* model, ExecutionPreference*, Priority*) { + auto& outputs = model->main.operations[operation].outputs; + outputs.erase(outputs.begin() + output); + }); + } + } +} + +///////////////////////// MODEL VALIDATION ///////////////////////// + +// TODO: remove model input +// TODO: remove model output +// TODO: add unused operation + +///////////////////////// ADD OPERATION INPUT ///////////////////////// + +static bool addOperationInputSkip(const Operation& op) { + // Skip addOperationInputTest for the following operations. + // - L2_NORMALIZATION, LOCAL_RESPONSE_NORMALIZATION, SOFTMAX can have an optional INT32 axis + // parameter. + if ((op.type == OperationType::L2_NORMALIZATION && op.inputs.size() == 1) || + (op.type == OperationType::LOCAL_RESPONSE_NORMALIZATION && op.inputs.size() == 5) || + (op.type == OperationType::SOFTMAX && op.inputs.size() == 2) || + (op.type == OperationType::RESIZE_BILINEAR && op.inputs.size() < 6) || + (op.type == OperationType::RESIZE_NEAREST_NEIGHBOR && op.inputs.size() < 6)) { + return true; + } + return false; +} + +static void addOperationInputTest(const std::shared_ptr& device, const Model& model) { + for (size_t operation = 0; operation < model.main.operations.size(); ++operation) { + if (addOperationInputSkip(model.main.operations[operation])) { + continue; + } + const std::string message = "addOperationInputTest: operation " + std::to_string(operation); + validate(device, message, model, + [operation](Model* model, ExecutionPreference*, Priority*) { + uint32_t index = addOperand(model, OperandLifeTime::SUBGRAPH_INPUT); + model->main.operations[operation].inputs.push_back(index); + model->main.inputIndexes.push_back(index); + }); + } +} + +///////////////////////// ADD OPERATION OUTPUT ///////////////////////// + +static void addOperationOutputTest(const std::shared_ptr& device, const Model& model) { + for (size_t operation = 0; operation < model.main.operations.size(); ++operation) { + const std::string message = + "addOperationOutputTest: operation " + std::to_string(operation); + validate(device, message, model, + [operation](Model* model, ExecutionPreference*, Priority*) { + uint32_t index = addOperand(model, OperandLifeTime::SUBGRAPH_OUTPUT); + model->main.operations[operation].outputs.push_back(index); + model->main.outputIndexes.push_back(index); + }); + } +} + +///////////////////////// VALIDATE EXECUTION PREFERENCE ///////////////////////// + +static const int32_t invalidExecutionPreferences[] = { + static_cast(ExecutionPreference::LOW_POWER) - 1, // lower bound + static_cast(ExecutionPreference::SUSTAINED_SPEED) + 1, // upper bound +}; + +static void mutateExecutionPreferenceTest(const std::shared_ptr& device, + const Model& model) { + for (int32_t invalidPreference : invalidExecutionPreferences) { + const std::string message = + "mutateExecutionPreferenceTest: preference " + std::to_string(invalidPreference); + validate(device, message, model, + [invalidPreference](Model*, ExecutionPreference* preference, Priority*) { + *preference = static_cast(invalidPreference); + }); + } +} + +///////////////////////// VALIDATE PRIORITY ///////////////////////// + +static const int32_t invalidPriorities[] = { + static_cast(Priority::LOW) - 1, // lower bound + static_cast(Priority::HIGH) + 1, // upper bound +}; + +static void mutateExecutionPriorityTest(const std::shared_ptr& device, + const Model& model) { + for (int32_t invalidPriority : invalidPriorities) { + const std::string message = + "mutatePriorityTest: priority " + std::to_string(invalidPriority); + validate(device, message, model, + [invalidPriority](Model*, ExecutionPreference*, Priority* priority) { + *priority = static_cast(invalidPriority); + }); + } +} + +////////////////////////// ENTRY POINT ////////////////////////////// + +void validateModel(const std::shared_ptr& device, const Model& model) { + const auto numberOfConsumers = nn::countNumberOfConsumers( + model.main.operands.size(), nn::convert(model.main.operations).value()); + mutateExecutionOrderTest(device, model, numberOfConsumers); + mutateOperandTypeTest(device, model); + mutateOperandRankTest(device, model); + mutateOperandScaleTest(device, model); + mutateOperandZeroPointTest(device, model); + mutateOperandLifeTimeTest(device, model); + mutateOperandInputOutputTest(device, model); + mutateOperandAddWriterTest(device, model); + mutateOperationOperandTypeTest(device, model); + mutateOperationTypeTest(device, model); + mutateOperationInputOperandIndexTest(device, model); + mutateOperationOutputOperandIndexTest(device, model); + mutateOperationRemoveWriteTest(device, model, numberOfConsumers); + removeOperandTest(device, model, numberOfConsumers); + removeOperationTest(device, model); + removeOperationInputTest(device, model); + removeOperationOutputTest(device, model); + addOperationInputTest(device, model); + addOperationOutputTest(device, model); + mutateExecutionPreferenceTest(device, model); + mutateExecutionPriorityTest(device, model); +} + +} // namespace aidl::android::hardware::neuralnetworks::vts::functional diff --git a/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp b/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp new file mode 100644 index 0000000000..db8f429f13 --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp @@ -0,0 +1,126 @@ +/* + * 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. + */ + +#define LOG_TAG "neuralnetworks_aidl_hal_test" + +#include + +#include + +#include +#include + +#include "Callbacks.h" +#include "GeneratedTestHarness.h" +#include "Utils.h" +#include "VtsHalNeuralnetworks.h" + +namespace aidl::android::hardware::neuralnetworks::vts::functional { + +using ExecutionMutation = std::function; + +///////////////////////// UTILITY FUNCTIONS ///////////////////////// + +// Primary validation function. This function will take a valid request, apply a +// mutation to it to invalidate the request, then pass it to interface calls +// that use the request. +static void validate(const std::shared_ptr& preparedModel, + const std::string& message, const Request& originalRequest, + const ExecutionMutation& mutate) { + Request request = utils::clone(originalRequest).value(); + mutate(&request); + + // We'd like to test both with timing requested and without timing + // requested. Rather than running each test both ways, we'll decide whether + // to request timing by hashing the message. We do not use std::hash because + // it is not guaranteed stable across executions. + char hash = 0; + for (auto c : message) { + hash ^= c; + }; + bool measure = (hash & 1); + + // synchronous + { + SCOPED_TRACE(message + " [executeSynchronously]"); + ExecutionResult executionResult; + const auto executeStatus = preparedModel->executeSynchronously( + request, measure, kNoDeadline, kOmittedTimeoutDuration, &executionResult); + ASSERT_FALSE(executeStatus.isOk()); + ASSERT_EQ(executeStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(executeStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); + } + + // fenced + { + SCOPED_TRACE(message + " [executeFenced]"); + ndk::ScopedFileDescriptor syncFence; + std::shared_ptr callback; + const auto executeStatus = preparedModel->executeFenced(request, {}, false, kNoDeadline, + kOmittedTimeoutDuration, + kNoDuration, &syncFence, &callback); + ASSERT_FALSE(executeStatus.isOk()); + ASSERT_EQ(executeStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(executeStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); + } +} + +///////////////////////// REMOVE INPUT //////////////////////////////////// + +static void removeInputTest(const std::shared_ptr& preparedModel, + const Request& request) { + for (size_t input = 0; input < request.inputs.size(); ++input) { + const std::string message = "removeInput: removed input " + std::to_string(input); + validate(preparedModel, message, request, [input](Request* request) { + request->inputs.erase(request->inputs.begin() + input); + }); + } +} + +///////////////////////// REMOVE OUTPUT //////////////////////////////////// + +static void removeOutputTest(const std::shared_ptr& preparedModel, + const Request& request) { + for (size_t output = 0; output < request.outputs.size(); ++output) { + const std::string message = "removeOutput: removed Output " + std::to_string(output); + validate(preparedModel, message, request, [output](Request* request) { + request->outputs.erase(request->outputs.begin() + output); + }); + } +} + +///////////////////////////// ENTRY POINT ////////////////////////////////// + +void validateRequest(const std::shared_ptr& preparedModel, const Request& request) { + removeInputTest(preparedModel, request); + removeOutputTest(preparedModel, request); +} + +void validateRequestFailure(const std::shared_ptr& preparedModel, + const Request& request) { + SCOPED_TRACE("Expecting request to fail [executeSynchronously]"); + ExecutionResult executionResult; + const auto executeStatus = preparedModel->executeSynchronously( + request, false, kNoDeadline, kOmittedTimeoutDuration, &executionResult); + + ASSERT_FALSE(executeStatus.isOk()); + ASSERT_EQ(executeStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_NE(static_cast(executeStatus.getServiceSpecificError()), ErrorStatus::NONE); +} + +} // namespace aidl::android::hardware::neuralnetworks::vts::functional diff --git a/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp new file mode 100644 index 0000000000..2d91b8edd9 --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp @@ -0,0 +1,194 @@ +/* + * 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. + */ + +#define LOG_TAG "neuralnetworks_aidl_hal_test" +#include "VtsHalNeuralnetworks.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "Callbacks.h" +#include "GeneratedTestHarness.h" +#include "Utils.h" + +namespace aidl::android::hardware::neuralnetworks::vts::functional { + +using implementation::PreparedModelCallback; + +// internal helper function +void createPreparedModel(const std::shared_ptr& device, const Model& model, + std::shared_ptr* preparedModel, bool reportSkipping) { + ASSERT_NE(nullptr, preparedModel); + *preparedModel = nullptr; + + // see if service can handle model + std::vector supportedOperations; + const auto supportedCallStatus = device->getSupportedOperations(model, &supportedOperations); + ASSERT_TRUE(supportedCallStatus.isOk()); + ASSERT_NE(0ul, supportedOperations.size()); + const bool fullySupportsModel = std::all_of( + supportedOperations.begin(), supportedOperations.end(), [](bool v) { return v; }); + + // launch prepare model + const std::shared_ptr preparedModelCallback = + ndk::SharedRefBase::make(); + const auto prepareLaunchStatus = + device->prepareModel(model, ExecutionPreference::FAST_SINGLE_ANSWER, kDefaultPriority, + kNoDeadline, {}, {}, kEmptyCacheToken, preparedModelCallback); + ASSERT_TRUE(prepareLaunchStatus.isOk()) << prepareLaunchStatus.getDescription(); + + // retrieve prepared model + preparedModelCallback->wait(); + const ErrorStatus prepareReturnStatus = preparedModelCallback->getStatus(); + *preparedModel = preparedModelCallback->getPreparedModel(); + + // The getSupportedOperations call returns a list of operations that are guaranteed not to fail + // if prepareModel is called, and 'fullySupportsModel' is true i.f.f. the entire model is + // guaranteed. If a driver has any doubt that it can prepare an operation, it must return false. + // So here, if a driver isn't sure if it can support an operation, but reports that it + // successfully prepared the model, the test can continue. + if (!fullySupportsModel && prepareReturnStatus != ErrorStatus::NONE) { + ASSERT_EQ(nullptr, preparedModel->get()); + if (!reportSkipping) { + return; + } + LOG(INFO) << "NN VTS: Early termination of test because vendor service cannot prepare " + "model that it does not support."; + std::cout << "[ ] Early termination of test because vendor service cannot " + "prepare model that it does not support." + << std::endl; + GTEST_SKIP(); + } + + ASSERT_EQ(ErrorStatus::NONE, prepareReturnStatus); + ASSERT_NE(nullptr, preparedModel->get()); +} + +void NeuralNetworksAidlTest::SetUp() { + testing::TestWithParam::SetUp(); + ASSERT_NE(kDevice, nullptr); +} + +static NamedDevice makeNamedDevice(const std::string& name) { + ndk::SpAIBinder binder(AServiceManager_getService(name.c_str())); + return {name, IDevice::fromBinder(binder)}; +} + +static std::vector getNamedDevicesImpl() { + // Retrieves the name of all service instances that implement IDevice, + // including any Lazy HAL instances. + const std::vector names = ::android::getAidlHalInstanceNames(IDevice::descriptor); + + // Get a handle to each device and pair it with its name. + std::vector namedDevices; + namedDevices.reserve(names.size()); + std::transform(names.begin(), names.end(), std::back_inserter(namedDevices), makeNamedDevice); + return namedDevices; +} + +const std::vector& getNamedDevices() { + const static std::vector devices = getNamedDevicesImpl(); + return devices; +} + +std::string printNeuralNetworksAidlTest( + const testing::TestParamInfo& info) { + return gtestCompliantName(getName(info.param)); +} + +INSTANTIATE_DEVICE_TEST(NeuralNetworksAidlTest); + +// Forward declaration from ValidateModel.cpp +void validateModel(const std::shared_ptr& device, const Model& model); +// Forward declaration from ValidateRequest.cpp +void validateRequest(const std::shared_ptr& preparedModel, const Request& request); +// Forward declaration from ValidateRequest.cpp +void validateRequestFailure(const std::shared_ptr& preparedModel, + const Request& request); + +void validateEverything(const std::shared_ptr& device, const Model& model, + const Request& request) { + validateModel(device, model); + + // Create IPreparedModel. + std::shared_ptr preparedModel; + createPreparedModel(device, model, &preparedModel); + if (preparedModel == nullptr) return; + + validateRequest(preparedModel, request); + // HIDL also had test that expected executeFenced to fail on received null fd (-1). This is not + // allowed in AIDL and will result in EX_TRANSACTION_FAILED. +} + +void validateFailure(const std::shared_ptr& device, const Model& model, + const Request& request) { + // TODO: Should this always succeed? + // What if the invalid input is part of the model (i.e., a parameter). + validateModel(device, model); + + // Create IPreparedModel. + std::shared_ptr preparedModel; + createPreparedModel(device, model, &preparedModel); + if (preparedModel == nullptr) return; + + validateRequestFailure(preparedModel, request); +} + +TEST_P(ValidationTest, Test) { + const Model model = createModel(kTestModel); + ExecutionContext context; + const Request request = context.createRequest(kTestModel); + if (kTestModel.expectFailure) { + validateFailure(kDevice, model, request); + } else { + validateEverything(kDevice, model, request); + } +} + +INSTANTIATE_GENERATED_TEST(ValidationTest, [](const std::string& testName) { + // Skip validation for the "inputs_as_internal" and "all_tensors_as_inputs" + // generated tests. + return testName.find("inputs_as_internal") == std::string::npos && + testName.find("all_tensors_as_inputs") == std::string::npos; +}); + +std::string toString(Executor executor) { + switch (executor) { + case Executor::ASYNC: + return "ASYNC"; + case Executor::SYNC: + return "SYNC"; + case Executor::BURST: + return "BURST"; + case Executor::FENCED: + return "FENCED"; + default: + CHECK(false); + } +} + +} // namespace aidl::android::hardware::neuralnetworks::vts::functional diff --git a/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h new file mode 100644 index 0000000000..9b81ee116e --- /dev/null +++ b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h @@ -0,0 +1,61 @@ +/* + * 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_NEURALNETWORKS_AIDL_VTS_HAL_NEURALNETWORKS_H +#define ANDROID_HARDWARE_NEURALNETWORKS_AIDL_VTS_HAL_NEURALNETWORKS_H + +#include +#include + +#include + +#include "Callbacks.h" +#include "Utils.h" + +namespace aidl::android::hardware::neuralnetworks::vts::functional { + +using NamedDevice = Named>; +using NeuralNetworksAidlTestParam = NamedDevice; + +class NeuralNetworksAidlTest : public testing::TestWithParam { + protected: + void SetUp() override; + const std::shared_ptr kDevice = getData(GetParam()); +}; + +const std::vector& getNamedDevices(); + +std::string printNeuralNetworksAidlTest( + const testing::TestParamInfo& info); + +#define INSTANTIATE_DEVICE_TEST(TestSuite) \ + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TestSuite); \ + INSTANTIATE_TEST_SUITE_P(PerInstance, TestSuite, testing::ValuesIn(getNamedDevices()), \ + printNeuralNetworksAidlTest) + +// Create an IPreparedModel object. If the model cannot be prepared, +// "preparedModel" will be nullptr instead. +void createPreparedModel(const std::shared_ptr& device, const Model& model, + std::shared_ptr* preparedModel, + bool reportSkipping = true); + +enum class Executor { ASYNC, SYNC, BURST, FENCED }; + +std::string toString(Executor executor); + +} // namespace aidl::android::hardware::neuralnetworks::vts::functional + +#endif // ANDROID_HARDWARE_NEURALNETWORKS_AIDL_VTS_HAL_NEURALNETWORKS_H -- GitLab From edd3cb2336e5a8f307a1b0356c2f796d537d342e Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Fri, 5 Feb 2021 13:24:55 -0800 Subject: [PATCH 009/825] Implement printer for mac80211_hwsim generic netlink family Bug: 179393922 Test: run `iw dev wlan0 scan` with modified nlproxy Change-Id: I2e66b485711aeff3ac74c06f1e2c3340bf753074 --- automotive/can/1.0/default/libnl++/Android.bp | 2 + .../default/libnl++/include/libnl++/Message.h | 9 +- .../libnl++/generic/families/mac80211_hwsim.h | 73 +++++++++++++++ .../libnl++/protocols/generic/Ctrl.cpp | 6 +- .../protocols/generic/GenericMessageBase.cpp | 4 +- .../generic/families/Mac80211hwsim.cpp | 91 +++++++++++++++++++ .../generic/families/Mac80211hwsim.h | 28 ++++++ .../1.0/default/libnl++/protocols/structs.cpp | 57 ++++++++++++ .../1.0/default/libnl++/protocols/structs.h | 7 ++ 9 files changed, 270 insertions(+), 7 deletions(-) create mode 100644 automotive/can/1.0/default/libnl++/include/libnl++/generic/families/mac80211_hwsim.h create mode 100644 automotive/can/1.0/default/libnl++/protocols/generic/families/Mac80211hwsim.cpp create mode 100644 automotive/can/1.0/default/libnl++/protocols/generic/families/Mac80211hwsim.h create mode 100644 automotive/can/1.0/default/libnl++/protocols/structs.cpp diff --git a/automotive/can/1.0/default/libnl++/Android.bp b/automotive/can/1.0/default/libnl++/Android.bp index a69e302658..9e18ba0a8f 100644 --- a/automotive/can/1.0/default/libnl++/Android.bp +++ b/automotive/can/1.0/default/libnl++/Android.bp @@ -26,6 +26,7 @@ cc_library_static { "protocols/generic/Generic.cpp", "protocols/generic/GenericMessageBase.cpp", "protocols/generic/Unknown.cpp", + "protocols/generic/families/Mac80211hwsim.cpp", "protocols/generic/families/Nl80211.cpp", "protocols/route/Link.cpp", "protocols/route/Route.cpp", @@ -33,6 +34,7 @@ cc_library_static { "protocols/MessageDefinition.cpp", "protocols/NetlinkProtocol.cpp", "protocols/all.cpp", + "protocols/structs.cpp", "Attributes.cpp", "MessageFactory.cpp", "MessageMutator.cpp", diff --git a/automotive/can/1.0/default/libnl++/include/libnl++/Message.h b/automotive/can/1.0/default/libnl++/include/libnl++/Message.h index 50b3c4b05d..29f397d430 100644 --- a/automotive/can/1.0/default/libnl++/include/libnl++/Message.h +++ b/automotive/can/1.0/default/libnl++/include/libnl++/Message.h @@ -34,7 +34,7 @@ namespace android::nl { * a single instance can only be used by a single thread - the one owning the underlying buffer). */ template -class Message { +class Message : public Buffer { public: /** * Validate buffer contents as a message carrying T data and create instance of parsed message. @@ -51,7 +51,7 @@ class Message { const auto attributes = buf.data(sizeof(T)); - return Message(nlHeader, dataHeader, attributes); + return Message(buf, nlHeader, dataHeader, attributes); } /** @@ -94,8 +94,9 @@ class Message { const T* operator->() const { return &data; } private: - Message(const nlmsghdr& nlHeader, const T& dataHeader, Attributes attributes) - : header(nlHeader), data(dataHeader), attributes(attributes) {} + Message(Buffer buffer, const nlmsghdr& nlHeader, const T& dataHeader, + Attributes attributes) + : Buffer(buffer), header(nlHeader), data(dataHeader), attributes(attributes) {} }; } // namespace android::nl diff --git a/automotive/can/1.0/default/libnl++/include/libnl++/generic/families/mac80211_hwsim.h b/automotive/can/1.0/default/libnl++/include/libnl++/generic/families/mac80211_hwsim.h new file mode 100644 index 0000000000..9b811f8a3d --- /dev/null +++ b/automotive/can/1.0/default/libnl++/include/libnl++/generic/families/mac80211_hwsim.h @@ -0,0 +1,73 @@ +/* + * 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. + */ + +// API definitions from kernel drivers/net/wireless/mac80211_hwsim.h + +#define BIT(n) (1 << (n)) + +enum hwsim_tx_control_flags { + HWSIM_TX_CTL_REQ_TX_STATUS = BIT(0), + HWSIM_TX_CTL_NO_ACK = BIT(1), + HWSIM_TX_STAT_ACK = BIT(2), +}; + +enum { + HWSIM_CMD_UNSPEC, + HWSIM_CMD_REGISTER, + HWSIM_CMD_FRAME, + HWSIM_CMD_TX_INFO_FRAME, + HWSIM_CMD_NEW_RADIO, + HWSIM_CMD_DEL_RADIO, + HWSIM_CMD_GET_RADIO, + HWSIM_CMD_ADD_MAC_ADDR, + HWSIM_CMD_DEL_MAC_ADDR, +}; + +enum { + HWSIM_ATTR_UNSPEC, + HWSIM_ATTR_ADDR_RECEIVER, + HWSIM_ATTR_ADDR_TRANSMITTER, + HWSIM_ATTR_FRAME, + HWSIM_ATTR_FLAGS, + HWSIM_ATTR_RX_RATE, + HWSIM_ATTR_SIGNAL, + HWSIM_ATTR_TX_INFO, + HWSIM_ATTR_COOKIE, + HWSIM_ATTR_CHANNELS, + HWSIM_ATTR_RADIO_ID, + HWSIM_ATTR_REG_HINT_ALPHA2, + HWSIM_ATTR_REG_CUSTOM_REG, + HWSIM_ATTR_REG_STRICT_REG, + HWSIM_ATTR_SUPPORT_P2P_DEVICE, + HWSIM_ATTR_USE_CHANCTX, + HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE, + HWSIM_ATTR_RADIO_NAME, + HWSIM_ATTR_NO_VIF, + HWSIM_ATTR_FREQ, + HWSIM_ATTR_PAD, + HWSIM_ATTR_TX_INFO_FLAGS, + HWSIM_ATTR_PERM_ADDR, + HWSIM_ATTR_IFTYPE_SUPPORT, + HWSIM_ATTR_CIPHER_SUPPORT, +}; + +struct hwsim_tx_rate { + int8_t idx; + uint8_t count; +} __packed; +static_assert(sizeof(hwsim_tx_rate) == 2); + +#undef BIT diff --git a/automotive/can/1.0/default/libnl++/protocols/generic/Ctrl.cpp b/automotive/can/1.0/default/libnl++/protocols/generic/Ctrl.cpp index 1e1ad12c84..478c3831cf 100644 --- a/automotive/can/1.0/default/libnl++/protocols/generic/Ctrl.cpp +++ b/automotive/can/1.0/default/libnl++/protocols/generic/Ctrl.cpp @@ -16,6 +16,7 @@ #include "Ctrl.h" +#include "families/Mac80211hwsim.h" #include "families/Nl80211.h" #include @@ -68,12 +69,15 @@ void Ctrl::track(const Buffer hdr) { const auto familyId = msg.attributes.get(CTRL_ATTR_FAMILY_ID); const auto familyName = msg.attributes.get(CTRL_ATTR_FAMILY_NAME); - /* For now, we support just a single family. But if you add more, please define proper + /* For now, we support just two families. But if you add more, please define proper * abstraction and not hardcode every name and class here. */ if (familyName == "nl80211") { mFamilyRegister[familyId] = std::make_shared(familyId); } + if (familyName == "MAC80211_HWSIM") { + mFamilyRegister[familyId] = std::make_shared(familyId); + } } } // namespace android::nl::protocols::generic diff --git a/automotive/can/1.0/default/libnl++/protocols/generic/GenericMessageBase.cpp b/automotive/can/1.0/default/libnl++/protocols/generic/GenericMessageBase.cpp index b7b811b629..f92d6c000b 100644 --- a/automotive/can/1.0/default/libnl++/protocols/generic/GenericMessageBase.cpp +++ b/automotive/can/1.0/default/libnl++/protocols/generic/GenericMessageBase.cpp @@ -40,9 +40,9 @@ void GenericMessageBase::toStream(std::stringstream& ss, const genlmsghdr& data) ss << "genlmsghdr{"; if (commandName.has_value()) { - ss << "cmd=" << unsigned(data.cmd); - } else { ss << "cmd=" << *commandName; + } else { + ss << "cmd=" << unsigned(data.cmd); } ss << ", version=" << unsigned(data.version); if (data.reserved != 0) ss << ", reserved=" << data.reserved; diff --git a/automotive/can/1.0/default/libnl++/protocols/generic/families/Mac80211hwsim.cpp b/automotive/can/1.0/default/libnl++/protocols/generic/families/Mac80211hwsim.cpp new file mode 100644 index 0000000000..f85309e7a2 --- /dev/null +++ b/automotive/can/1.0/default/libnl++/protocols/generic/families/Mac80211hwsim.cpp @@ -0,0 +1,91 @@ +/* + * 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 "Mac80211hwsim.h" + +#include "../../structs.h" +#include "common.h" + +#include + +namespace android::nl::protocols::generic::families { + +using DataType = AttributeDefinition::DataType; +using Flags = AttributeDefinition::Flags; + +static void hwsim_tx_rateToStream(std::stringstream& ss, const Buffer attr); + +static const FlagsMap txControlFlags{ + {HWSIM_TX_CTL_REQ_TX_STATUS, "REQ_TX"}, + {HWSIM_TX_CTL_NO_ACK, "NO_ACK"}, + {HWSIM_TX_STAT_ACK, "ACK"}, +}; + +// clang-format off +Mac80211hwsim::Mac80211hwsim(nlmsgtype_t familyId) : GenericMessageBase(familyId, "hwsim", { + {HWSIM_CMD_UNSPEC, "UNSPEC"}, + {HWSIM_CMD_REGISTER, "REGISTER"}, + {HWSIM_CMD_FRAME, "FRAME"}, + {HWSIM_CMD_TX_INFO_FRAME, "TX_INFO_FRAME"}, + {HWSIM_CMD_NEW_RADIO, "NEW_RADIO"}, + {HWSIM_CMD_DEL_RADIO, "DEL_RADIO"}, + {HWSIM_CMD_GET_RADIO, "GET_RADIO"}, + {HWSIM_CMD_ADD_MAC_ADDR, "ADD_MAC_ADDR"}, + {HWSIM_CMD_DEL_MAC_ADDR, "DEL_MAC_ADDR"}, +}, { + {HWSIM_ATTR_UNSPEC, {"UNSPEC"}}, + {HWSIM_ATTR_ADDR_RECEIVER, {"ADDR_RECEIVER", DataType::Struct, hwaddrToStream}}, + {HWSIM_ATTR_ADDR_TRANSMITTER, {"ADDR_TRANSMITTER", DataType::Struct, hwaddrToStream}}, + {HWSIM_ATTR_FRAME, {"FRAME", DataType::Raw, AttributeMap{}, Flags::Verbose}}, + {HWSIM_ATTR_FLAGS, {"FLAGS", DataType::Struct, flagsToStream(txControlFlags)}}, + {HWSIM_ATTR_RX_RATE, {"RX_RATE", DataType::Uint}}, + {HWSIM_ATTR_SIGNAL, {"SIGNAL", DataType::Uint}}, + {HWSIM_ATTR_TX_INFO, {"TX_INFO", DataType::Struct, hwsim_tx_rateToStream}}, + {HWSIM_ATTR_COOKIE, {"COOKIE", DataType::Uint}}, + {HWSIM_ATTR_CHANNELS, {"CHANNELS", DataType::Uint}}, + {HWSIM_ATTR_RADIO_ID, {"RADIO_ID", DataType::Uint}}, + {HWSIM_ATTR_REG_HINT_ALPHA2, {"REG_HINT_ALPHA2", DataType::String}}, + {HWSIM_ATTR_REG_CUSTOM_REG, {"REG_CUSTOM_REG", DataType::Uint}}, + {HWSIM_ATTR_REG_STRICT_REG, {"REG_STRICT_REG", DataType::Flag}}, + {HWSIM_ATTR_SUPPORT_P2P_DEVICE, {"SUPPORT_P2P_DEVICE", DataType::Flag}}, + {HWSIM_ATTR_USE_CHANCTX, {"USE_CHANCTX", DataType::Flag}}, + {HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE, {"DESTROY_RADIO_ON_CLOSE", DataType::Flag}}, + {HWSIM_ATTR_RADIO_NAME, {"RADIO_NAME", DataType::String}}, + {HWSIM_ATTR_NO_VIF, {"NO_VIF", DataType::Flag}}, + {HWSIM_ATTR_FREQ, {"FREQ", DataType::Uint}}, + {HWSIM_ATTR_PAD, {"PAD", DataType::Uint}}, + {HWSIM_ATTR_TX_INFO_FLAGS, {"TX_INFO_FLAGS"}}, // hwsim_tx_rate_flag + {HWSIM_ATTR_PERM_ADDR, {"PERM_ADDR"}}, + {HWSIM_ATTR_IFTYPE_SUPPORT, {"IFTYPE_SUPPORT", DataType::Uint}}, // NL80211_IFTYPE_STATION etc + {HWSIM_ATTR_CIPHER_SUPPORT, {"CIPHER_SUPPORT", DataType::Struct, arrayToStream}}, +}) {} +// clang-format on + +static void hwsim_tx_rateToStream(std::stringstream& ss, const Buffer attr) { + ss << '{'; + bool first = true; + for (const auto rate : attr.data().getRaw()) { + if (rate.idx == -1) continue; + + ss << (int)rate.idx << ": " << (unsigned)rate.count; + + if (!first) ss << ", "; + first = false; + } + ss << '}'; +} + +} // namespace android::nl::protocols::generic::families diff --git a/automotive/can/1.0/default/libnl++/protocols/generic/families/Mac80211hwsim.h b/automotive/can/1.0/default/libnl++/protocols/generic/families/Mac80211hwsim.h new file mode 100644 index 0000000000..c01eb93b91 --- /dev/null +++ b/automotive/can/1.0/default/libnl++/protocols/generic/families/Mac80211hwsim.h @@ -0,0 +1,28 @@ +/* + * 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 "../GenericMessageBase.h" + +namespace android::nl::protocols::generic::families { + +class Mac80211hwsim : public GenericMessageBase { + public: + Mac80211hwsim(nlmsgtype_t familyId); +}; + +} // namespace android::nl::protocols::generic::families diff --git a/automotive/can/1.0/default/libnl++/protocols/structs.cpp b/automotive/can/1.0/default/libnl++/protocols/structs.cpp new file mode 100644 index 0000000000..8ff71f006a --- /dev/null +++ b/automotive/can/1.0/default/libnl++/protocols/structs.cpp @@ -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. + */ + +#include "structs.h" + +#include + +namespace android::nl::protocols { + +AttributeDefinition::ToStream flagsToStream(FlagsMap flags) { + return [flags](std::stringstream& ss, const Buffer attr) { + auto val = attr.data().copyFirst(); + + bool first = true; + for (const auto& [flag, name] : flags) { + if ((val & flag) != flag) continue; + val &= ~flag; + + if (!first) ss << '|'; + first = false; + + ss << name; + } + + if (val == 0) return; + + if (!first) ss << '|'; + ss << std::hex << val << std::dec; + }; +} + +void hwaddrToStream(std::stringstream& ss, const Buffer attr) { + ss << std::hex; + bool first = true; + for (const auto byte : attr.data().getRaw()) { + if (!first) ss << ':'; + first = false; + + ss << std::setw(2) << unsigned(byte); + } + ss << std::dec; +} + +} // namespace android::nl::protocols diff --git a/automotive/can/1.0/default/libnl++/protocols/structs.h b/automotive/can/1.0/default/libnl++/protocols/structs.h index 44c17b84b9..f3a8c44afe 100644 --- a/automotive/can/1.0/default/libnl++/protocols/structs.h +++ b/automotive/can/1.0/default/libnl++/protocols/structs.h @@ -16,6 +16,8 @@ #pragma once +#include "MessageDefinition.h" + #include namespace android::nl::protocols { @@ -30,4 +32,9 @@ void arrayToStream(std::stringstream& ss, const Buffer attr) { ss << '}'; } +typedef std::map FlagsMap; +AttributeDefinition::ToStream flagsToStream(FlagsMap flags); + +void hwaddrToStream(std::stringstream& ss, const Buffer attr); + } // namespace android::nl::protocols -- GitLab From 98b06b9fdd913ef4c5a86e02b884631d17ac1c3f Mon Sep 17 00:00:00 2001 From: Kai Date: Mon, 8 Feb 2021 20:28:10 -0800 Subject: [PATCH 010/825] Add Kiran as VHAL owner Add Kiran as VHAL owner Bug: 179717304 Test: build Change-Id: I311024d66be562ad792a33108e61b0f367c69cf9 --- automotive/OWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automotive/OWNERS b/automotive/OWNERS index fb3e3d63bf..43c5f3e30e 100644 --- a/automotive/OWNERS +++ b/automotive/OWNERS @@ -1,6 +1,6 @@ pirozzoj@google.com twasilczyk@google.com -pfg@google.com +krachuri@google.com gurunagarajan@google.com keunyoung@google.com felipeal@google.com -- GitLab From 79a16ebb6f42c21a21202f7b63ce372f2df15137 Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Sun, 7 Feb 2021 00:11:13 -0800 Subject: [PATCH 011/825] Change NNAPI Memory to ref-counted SharedMemory -- hal Bug: 179906132 Test: mma Test: NeuralNetworksTest_static Test: presubmit Change-Id: I6435db906a2efe4938da18149a1fcd6d24730a95 --- .../1.0/utils/include/nnapi/hal/1.0/Burst.h | 2 +- .../utils/include/nnapi/hal/1.0/Conversions.h | 4 +-- neuralnetworks/1.0/utils/src/Burst.cpp | 2 +- neuralnetworks/1.0/utils/src/Conversions.cpp | 11 ++++---- neuralnetworks/1.1/utils/src/Conversions.cpp | 2 +- neuralnetworks/1.2/utils/src/Conversions.cpp | 2 +- .../1.3/utils/include/nnapi/hal/1.3/Buffer.h | 4 +-- .../utils/include/nnapi/hal/1.3/Conversions.h | 4 +-- neuralnetworks/1.3/utils/src/Buffer.cpp | 4 +-- neuralnetworks/1.3/utils/src/Conversions.cpp | 8 +++--- .../include/nnapi/hal/aidl/Conversions.h | 10 +++---- neuralnetworks/aidl/utils/src/Conversions.cpp | 28 ++++++++++--------- .../vts/functional/GeneratedTestHarness.cpp | 2 +- .../common/include/nnapi/hal/CommonUtils.h | 2 +- .../common/include/nnapi/hal/HandleError.h | 13 +++++++-- .../common/include/nnapi/hal/InvalidBuffer.h | 4 +-- .../common/include/nnapi/hal/InvalidBurst.h | 2 +- .../include/nnapi/hal/ResilientBuffer.h | 4 +-- .../common/include/nnapi/hal/ResilientBurst.h | 2 +- .../utils/common/src/CommonUtils.cpp | 4 +-- .../utils/common/src/InvalidBuffer.cpp | 4 +-- .../utils/common/src/InvalidBurst.cpp | 3 +- .../utils/common/src/ResilientBuffer.cpp | 4 +-- .../utils/common/src/ResilientBurst.cpp | 3 +- neuralnetworks/utils/common/test/MockBuffer.h | 6 ++-- .../utils/common/test/ResilientBufferTest.cpp | 26 +++++++++++------ 26 files changed, 91 insertions(+), 69 deletions(-) diff --git a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Burst.h b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Burst.h index f2cbe93c7c..832930359e 100644 --- a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Burst.h +++ b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Burst.h @@ -41,7 +41,7 @@ class Burst final : public nn::IBurst { Burst(PrivateConstructorTag tag, nn::SharedPreparedModel preparedModel); - OptionalCacheHold cacheMemory(const nn::Memory& memory) const override; + OptionalCacheHold cacheMemory(const nn::SharedMemory& memory) const override; nn::ExecutionResult, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure) const override; diff --git a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Conversions.h b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Conversions.h index d3d933b22c..5d4bdbce82 100644 --- a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Conversions.h +++ b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Conversions.h @@ -36,7 +36,7 @@ GeneralResult unvalidatedConvert(const hal::V1_0::Operand& operand); GeneralResult unvalidatedConvert(const hal::V1_0::Operation& operation); GeneralResult unvalidatedConvert( const hardware::hidl_vec& operandValues); -GeneralResult unvalidatedConvert(const hardware::hidl_memory& memory); +GeneralResult unvalidatedConvert(const hardware::hidl_memory& memory); GeneralResult unvalidatedConvert(const hal::V1_0::Model& model); GeneralResult unvalidatedConvert( const hal::V1_0::RequestArgument& requestArgument); @@ -65,7 +65,7 @@ nn::GeneralResult unvalidatedConvert(const nn::Operand& operand); nn::GeneralResult unvalidatedConvert(const nn::Operation& operation); nn::GeneralResult> unvalidatedConvert( const nn::Model::OperandValues& operandValues); -nn::GeneralResult unvalidatedConvert(const nn::Memory& memory); +nn::GeneralResult unvalidatedConvert(const nn::SharedMemory& memory); nn::GeneralResult unvalidatedConvert(const nn::Model& model); nn::GeneralResult unvalidatedConvert(const nn::Request::Argument& requestArgument); nn::GeneralResult unvalidatedConvert(const nn::Request::MemoryPool& memoryPool); diff --git a/neuralnetworks/1.0/utils/src/Burst.cpp b/neuralnetworks/1.0/utils/src/Burst.cpp index 384bd9b699..971ad08015 100644 --- a/neuralnetworks/1.0/utils/src/Burst.cpp +++ b/neuralnetworks/1.0/utils/src/Burst.cpp @@ -43,7 +43,7 @@ Burst::Burst(PrivateConstructorTag /*tag*/, nn::SharedPreparedModel preparedMode CHECK(kPreparedModel != nullptr); } -Burst::OptionalCacheHold Burst::cacheMemory(const nn::Memory& /*memory*/) const { +Burst::OptionalCacheHold Burst::cacheMemory(const nn::SharedMemory& /*memory*/) const { return nullptr; } diff --git a/neuralnetworks/1.0/utils/src/Conversions.cpp b/neuralnetworks/1.0/utils/src/Conversions.cpp index fde7346470..34862c00cb 100644 --- a/neuralnetworks/1.0/utils/src/Conversions.cpp +++ b/neuralnetworks/1.0/utils/src/Conversions.cpp @@ -153,7 +153,7 @@ GeneralResult unvalidatedConvert(const hidl_vec& return Model::OperandValues(operandValues.data(), operandValues.size()); } -GeneralResult unvalidatedConvert(const hidl_memory& memory) { +GeneralResult unvalidatedConvert(const hidl_memory& memory) { return createSharedMemoryFromHidlMemory(memory); } @@ -346,9 +346,10 @@ nn::GeneralResult> unvalidatedConvert( return hidl_vec(operandValues.data(), operandValues.data() + operandValues.size()); } -nn::GeneralResult unvalidatedConvert(const nn::Memory& memory) { - return hidl_memory(memory.name, NN_TRY(hal::utils::hidlHandleFromSharedHandle(memory.handle)), - memory.size); +nn::GeneralResult unvalidatedConvert(const nn::SharedMemory& memory) { + CHECK(memory != nullptr); + return hidl_memory(memory->name, NN_TRY(hal::utils::hidlHandleFromSharedHandle(memory->handle)), + memory->size); } nn::GeneralResult unvalidatedConvert(const nn::Model& model) { @@ -392,7 +393,7 @@ nn::GeneralResult unvalidatedConvert( } nn::GeneralResult unvalidatedConvert(const nn::Request::MemoryPool& memoryPool) { - return unvalidatedConvert(std::get(memoryPool)); + return unvalidatedConvert(std::get(memoryPool)); } nn::GeneralResult unvalidatedConvert(const nn::Request& request) { diff --git a/neuralnetworks/1.1/utils/src/Conversions.cpp b/neuralnetworks/1.1/utils/src/Conversions.cpp index b47f25a68c..07bf7bc88f 100644 --- a/neuralnetworks/1.1/utils/src/Conversions.cpp +++ b/neuralnetworks/1.1/utils/src/Conversions.cpp @@ -175,7 +175,7 @@ nn::GeneralResult> unvalidatedConvert( return V1_0::utils::unvalidatedConvert(operandValues); } -nn::GeneralResult unvalidatedConvert(const nn::Memory& memory) { +nn::GeneralResult unvalidatedConvert(const nn::SharedMemory& memory) { return V1_0::utils::unvalidatedConvert(memory); } diff --git a/neuralnetworks/1.2/utils/src/Conversions.cpp b/neuralnetworks/1.2/utils/src/Conversions.cpp index 062f6f712f..50556509d2 100644 --- a/neuralnetworks/1.2/utils/src/Conversions.cpp +++ b/neuralnetworks/1.2/utils/src/Conversions.cpp @@ -365,7 +365,7 @@ nn::GeneralResult> unvalidatedConvert( return V1_0::utils::unvalidatedConvert(operandValues); } -nn::GeneralResult unvalidatedConvert(const nn::Memory& memory) { +nn::GeneralResult unvalidatedConvert(const nn::SharedMemory& memory) { return V1_0::utils::unvalidatedConvert(memory); } diff --git a/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Buffer.h b/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Buffer.h index fda79c88c1..69e87f7566 100644 --- a/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Buffer.h +++ b/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Buffer.h @@ -42,8 +42,8 @@ class Buffer final : public nn::IBuffer { nn::Request::MemoryDomainToken getToken() const override; - nn::GeneralResult copyTo(const nn::Memory& dst) const override; - nn::GeneralResult copyFrom(const nn::Memory& src, + nn::GeneralResult copyTo(const nn::SharedMemory& dst) const override; + nn::GeneralResult copyFrom(const nn::SharedMemory& src, const nn::Dimensions& dimensions) const override; private: diff --git a/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Conversions.h b/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Conversions.h index 74a6534aff..8e1cdb82c9 100644 --- a/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Conversions.h +++ b/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Conversions.h @@ -59,7 +59,7 @@ GeneralResult convert( GeneralResult convert(const hal::V1_3::ErrorStatus& errorStatus); GeneralResult convert(const hardware::hidl_handle& handle); -GeneralResult convert(const hardware::hidl_memory& memory); +GeneralResult convert(const hardware::hidl_memory& memory); GeneralResult> convert( const hardware::hidl_vec& bufferRoles); @@ -100,7 +100,7 @@ nn::GeneralResult convert( nn::GeneralResult convert(const nn::ErrorStatus& errorStatus); nn::GeneralResult convert(const nn::SharedHandle& handle); -nn::GeneralResult convert(const nn::Memory& memory); +nn::GeneralResult convert(const nn::SharedMemory& memory); nn::GeneralResult> convert(const std::vector& bufferRoles); nn::GeneralResult convert(const nn::DeviceStatus& deviceStatus); diff --git a/neuralnetworks/1.3/utils/src/Buffer.cpp b/neuralnetworks/1.3/utils/src/Buffer.cpp index 614033e268..ada526573b 100644 --- a/neuralnetworks/1.3/utils/src/Buffer.cpp +++ b/neuralnetworks/1.3/utils/src/Buffer.cpp @@ -61,7 +61,7 @@ nn::Request::MemoryDomainToken Buffer::getToken() const { return kToken; } -nn::GeneralResult Buffer::copyTo(const nn::Memory& dst) const { +nn::GeneralResult Buffer::copyTo(const nn::SharedMemory& dst) const { const auto hidlDst = NN_TRY(convert(dst)); const auto ret = kBuffer->copyTo(hidlDst); @@ -71,7 +71,7 @@ nn::GeneralResult Buffer::copyTo(const nn::Memory& dst) const { return {}; } -nn::GeneralResult Buffer::copyFrom(const nn::Memory& src, +nn::GeneralResult Buffer::copyFrom(const nn::SharedMemory& src, const nn::Dimensions& dimensions) const { const auto hidlSrc = NN_TRY(convert(src)); const auto hidlDimensions = hidl_vec(dimensions); diff --git a/neuralnetworks/1.3/utils/src/Conversions.cpp b/neuralnetworks/1.3/utils/src/Conversions.cpp index 8b7db2b90e..d96588e34c 100644 --- a/neuralnetworks/1.3/utils/src/Conversions.cpp +++ b/neuralnetworks/1.3/utils/src/Conversions.cpp @@ -352,7 +352,7 @@ GeneralResult convert(const hardware::hidl_handle& handle) { return validatedConvert(handle); } -GeneralResult convert(const hardware::hidl_memory& memory) { +GeneralResult convert(const hardware::hidl_memory& memory) { return validatedConvert(memory); } @@ -386,7 +386,7 @@ nn::GeneralResult unvalidatedConvert(const nn::SharedHandle& handle return V1_2::utils::unvalidatedConvert(handle); } -nn::GeneralResult unvalidatedConvert(const nn::Memory& memory) { +nn::GeneralResult unvalidatedConvert(const nn::SharedMemory& memory) { return V1_0::utils::unvalidatedConvert(memory); } @@ -424,7 +424,7 @@ nn::GeneralResult>> unvalidatedConvert( return unvalidatedConvertVec(arguments); } -nn::GeneralResult makeMemoryPool(const nn::Memory& memory) { +nn::GeneralResult makeMemoryPool(const nn::SharedMemory& memory) { Request::MemoryPool ret; ret.hidlMemory(NN_TRY(unvalidatedConvert(memory))); return ret; @@ -677,7 +677,7 @@ nn::GeneralResult convert(const nn::SharedHandle& handle) { return validatedConvert(handle); } -nn::GeneralResult convert(const nn::Memory& memory) { +nn::GeneralResult convert(const nn::SharedMemory& memory) { return validatedConvert(memory); } diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h index 35de5befd0..1b2f69c245 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h @@ -79,7 +79,7 @@ GeneralResult unvalidatedConvert(const std::vector unvalidatedConvert(const aidl_hal::Subgraph& subgraph); GeneralResult unvalidatedConvert(const aidl_hal::OutputShape& outputShape); GeneralResult unvalidatedConvert(bool measureTiming); -GeneralResult unvalidatedConvert(const aidl_hal::Memory& memory); +GeneralResult unvalidatedConvert(const aidl_hal::Memory& memory); GeneralResult unvalidatedConvert(const aidl_hal::Timing& timing); GeneralResult unvalidatedConvert(const aidl_hal::BufferDesc& bufferDesc); GeneralResult unvalidatedConvert(const aidl_hal::BufferRole& bufferRole); @@ -99,7 +99,7 @@ GeneralResult unvalidatedConvert( GeneralResult convert( const aidl_hal::ExecutionPreference& executionPreference); -GeneralResult convert(const aidl_hal::Memory& memory); +GeneralResult convert(const aidl_hal::Memory& memory); GeneralResult convert(const aidl_hal::Model& model); GeneralResult convert(const aidl_hal::Operand& operand); GeneralResult convert(const aidl_hal::OperandType& operandType); @@ -108,7 +108,7 @@ GeneralResult convert(const aidl_hal::RequestMemoryPool& me GeneralResult convert(const aidl_hal::Request& request); GeneralResult> convert(const std::vector& outputShapes); -GeneralResult> convert(const std::vector& memories); +GeneralResult> convert(const std::vector& memories); GeneralResult> toUnsigned(const std::vector& vec); @@ -118,11 +118,11 @@ namespace aidl::android::hardware::neuralnetworks::utils { namespace nn = ::android::nn; -nn::GeneralResult unvalidatedConvert(const nn::Memory& memory); +nn::GeneralResult unvalidatedConvert(const nn::SharedMemory& memory); nn::GeneralResult unvalidatedConvert(const nn::OutputShape& outputShape); nn::GeneralResult unvalidatedConvert(const nn::ErrorStatus& errorStatus); -nn::GeneralResult convert(const nn::Memory& memory); +nn::GeneralResult convert(const nn::SharedMemory& memory); nn::GeneralResult convert(const nn::ErrorStatus& errorStatus); nn::GeneralResult> convert( const std::vector& outputShapes); diff --git a/neuralnetworks/aidl/utils/src/Conversions.cpp b/neuralnetworks/aidl/utils/src/Conversions.cpp index 0e93b02a1e..486d01bc51 100644 --- a/neuralnetworks/aidl/utils/src/Conversions.cpp +++ b/neuralnetworks/aidl/utils/src/Conversions.cpp @@ -53,6 +53,8 @@ constexpr auto kVersion = android::nn::Version::ANDROID_S; namespace android::nn { namespace { +using ::aidl::android::hardware::common::NativeHandle; + constexpr auto validOperandType(nn::OperandType operandType) { switch (operandType) { case nn::OperandType::FLOAT32: @@ -316,13 +318,13 @@ GeneralResult unvalidatedConvert(bool measureTiming) { return measureTiming ? MeasureTiming::YES : MeasureTiming::NO; } -GeneralResult unvalidatedConvert(const aidl_hal::Memory& memory) { +GeneralResult unvalidatedConvert(const aidl_hal::Memory& memory) { VERIFY_NON_NEGATIVE(memory.size) << "Memory size must not be negative"; - return Memory{ + return std::make_shared(Memory{ .handle = NN_TRY(unvalidatedConvert(memory.handle)), .size = static_cast(memory.size), .name = memory.name, - }; + }); } GeneralResult unvalidatedConvert(const std::vector& operandValues) { @@ -397,8 +399,7 @@ GeneralResult unvalidatedConvert( return static_cast(executionPreference); } -GeneralResult unvalidatedConvert( - const ::aidl::android::hardware::common::NativeHandle& aidlNativeHandle) { +GeneralResult unvalidatedConvert(const NativeHandle& aidlNativeHandle) { std::vector fds; fds.reserve(aidlNativeHandle.fds.size()); for (const auto& fd : aidlNativeHandle.fds) { @@ -422,7 +423,7 @@ GeneralResult convert( return validatedConvert(executionPreference); } -GeneralResult convert(const aidl_hal::Memory& operand) { +GeneralResult convert(const aidl_hal::Memory& operand) { return validatedConvert(operand); } @@ -454,7 +455,7 @@ GeneralResult> convert(const std::vector> convert(const std::vector& memories) { +GeneralResult> convert(const std::vector& memories) { return validatedConvert(memories); } @@ -525,14 +526,15 @@ nn::GeneralResult unvalidatedConvert(const nn::SharedHandl return aidlNativeHandle; } -nn::GeneralResult unvalidatedConvert(const nn::Memory& memory) { - if (memory.size > std::numeric_limits::max()) { +nn::GeneralResult unvalidatedConvert(const nn::SharedMemory& memory) { + CHECK(memory != nullptr); + if (memory->size > std::numeric_limits::max()) { return NN_ERROR() << "Memory size doesn't fit into int64_t."; } return Memory{ - .handle = NN_TRY(unvalidatedConvert(memory.handle)), - .size = static_cast(memory.size), - .name = memory.name, + .handle = NN_TRY(unvalidatedConvert(memory->handle)), + .size = static_cast(memory->size), + .name = memory->name, }; } @@ -558,7 +560,7 @@ nn::GeneralResult unvalidatedConvert(const nn::OutputShape& outputS .isSufficient = outputShape.isSufficient}; } -nn::GeneralResult convert(const nn::Memory& memory) { +nn::GeneralResult convert(const nn::SharedMemory& memory) { return validatedConvert(memory); } diff --git a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp index 86d5f3f8d3..4beb828253 100644 --- a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp +++ b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp @@ -266,7 +266,7 @@ Model createModel(const TestModel& testModel) { copyTestBuffers(constCopies, operandValues.data()); // Shared memory. - std::vector pools = {}; + std::vector pools = {}; if (constRefSize > 0) { const auto pool = nn::createSharedMemory(constRefSize).value(); pools.push_back(pool); diff --git a/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h b/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h index fef9d9cfb5..b13785dcd9 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h @@ -74,7 +74,7 @@ nn::GeneralResult unflushDataFromSharedToPointer( std::vector countNumberOfConsumers(size_t numberOfOperands, const std::vector& operations); -nn::GeneralResult createSharedMemoryFromHidlMemory(const hidl_memory& memory); +nn::GeneralResult createSharedMemoryFromHidlMemory(const hidl_memory& memory); nn::GeneralResult hidlHandleFromSharedHandle(const nn::SharedHandle& handle); nn::GeneralResult sharedHandleFromNativeHandle(const native_handle_t* handle); diff --git a/neuralnetworks/utils/common/include/nnapi/hal/HandleError.h b/neuralnetworks/utils/common/include/nnapi/hal/HandleError.h index 95a20a8f80..209b66304c 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/HandleError.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/HandleError.h @@ -14,6 +14,9 @@ * limitations under the License. */ +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_HANDLE_ERROR_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_HANDLE_ERROR_H + #include #include #include @@ -50,7 +53,8 @@ nn::GeneralResult handleTransportError(const hardware::Return& ret) }) template -nn::GeneralResult makeGeneralFailure(nn::Result result, nn::ErrorStatus status) { +nn::GeneralResult makeGeneralFailure( + nn::Result result, nn::ErrorStatus status = nn::ErrorStatus::GENERAL_FAILURE) { if (!result.has_value()) { return nn::error(status) << std::move(result).error(); } @@ -75,7 +79,8 @@ nn::ExecutionResult makeExecutionFailure(nn::GeneralResult result) { } template -nn::ExecutionResult makeExecutionFailure(nn::Result result, nn::ErrorStatus status) { +nn::ExecutionResult makeExecutionFailure( + nn::Result result, nn::ErrorStatus status = nn::ErrorStatus::GENERAL_FAILURE) { return makeExecutionFailure(makeGeneralFailure(result, status)); } @@ -86,4 +91,6 @@ nn::ExecutionResult makeExecutionFailure(nn::Result result, nn::Erro } else \ return NN_ERROR(canonical) -} // namespace android::hardware::neuralnetworks::utils \ No newline at end of file +} // namespace android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_HANDLE_ERROR_H diff --git a/neuralnetworks/utils/common/include/nnapi/hal/InvalidBuffer.h b/neuralnetworks/utils/common/include/nnapi/hal/InvalidBuffer.h index 8c04b8887b..0e98c2eea2 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/InvalidBuffer.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/InvalidBuffer.h @@ -31,9 +31,9 @@ class InvalidBuffer final : public nn::IBuffer { public: nn::Request::MemoryDomainToken getToken() const override; - nn::GeneralResult copyTo(const nn::Memory& dst) const override; + nn::GeneralResult copyTo(const nn::SharedMemory& dst) const override; - nn::GeneralResult copyFrom(const nn::Memory& src, + nn::GeneralResult copyFrom(const nn::SharedMemory& src, const nn::Dimensions& dimensions) const override; }; diff --git a/neuralnetworks/utils/common/include/nnapi/hal/InvalidBurst.h b/neuralnetworks/utils/common/include/nnapi/hal/InvalidBurst.h index 83e60b6a25..996858cd55 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/InvalidBurst.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/InvalidBurst.h @@ -29,7 +29,7 @@ namespace android::hardware::neuralnetworks::utils { class InvalidBurst final : public nn::IBurst { public: - OptionalCacheHold cacheMemory(const nn::Memory& memory) const override; + OptionalCacheHold cacheMemory(const nn::SharedMemory& memory) const override; nn::ExecutionResult, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure) const override; diff --git a/neuralnetworks/utils/common/include/nnapi/hal/ResilientBuffer.h b/neuralnetworks/utils/common/include/nnapi/hal/ResilientBuffer.h index d2c2469403..c8ca6f2d36 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/ResilientBuffer.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/ResilientBuffer.h @@ -46,9 +46,9 @@ class ResilientBuffer final : public nn::IBuffer { nn::Request::MemoryDomainToken getToken() const override; - nn::GeneralResult copyTo(const nn::Memory& dst) const override; + nn::GeneralResult copyTo(const nn::SharedMemory& dst) const override; - nn::GeneralResult copyFrom(const nn::Memory& src, + nn::GeneralResult copyFrom(const nn::SharedMemory& src, const nn::Dimensions& dimensions) const override; private: diff --git a/neuralnetworks/utils/common/include/nnapi/hal/ResilientBurst.h b/neuralnetworks/utils/common/include/nnapi/hal/ResilientBurst.h index 0df287f2f8..3b87330872 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/ResilientBurst.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/ResilientBurst.h @@ -44,7 +44,7 @@ class ResilientBurst final : public nn::IBurst, nn::SharedBurst getBurst() const; nn::GeneralResult recover(const nn::IBurst* failingBurst) const; - OptionalCacheHold cacheMemory(const nn::Memory& memory) const override; + OptionalCacheHold cacheMemory(const nn::SharedMemory& memory) const override; nn::ExecutionResult, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure) const override; diff --git a/neuralnetworks/utils/common/src/CommonUtils.cpp b/neuralnetworks/utils/common/src/CommonUtils.cpp index c04c8dfa8b..90215630c9 100644 --- a/neuralnetworks/utils/common/src/CommonUtils.cpp +++ b/neuralnetworks/utils/common/src/CommonUtils.cpp @@ -203,13 +203,13 @@ nn::GeneralResult> flushDataFromPointe nn::GeneralResult unflushDataFromSharedToPointer( const nn::Request& request, const std::optional& maybeRequestInShared) { if (!maybeRequestInShared.has_value() || maybeRequestInShared->pools.empty() || - !std::holds_alternative(maybeRequestInShared->pools.back())) { + !std::holds_alternative(maybeRequestInShared->pools.back())) { return {}; } const auto& requestInShared = *maybeRequestInShared; // Map the memory. - const auto& outputMemory = std::get(requestInShared.pools.back()); + const auto& outputMemory = std::get(requestInShared.pools.back()); const auto [pointer, size, context] = NN_TRY(map(outputMemory)); const uint8_t* constantPointer = std::visit([](const auto& o) { return static_cast(o); }, pointer); diff --git a/neuralnetworks/utils/common/src/InvalidBuffer.cpp b/neuralnetworks/utils/common/src/InvalidBuffer.cpp index c6f75d7137..e73001dee5 100644 --- a/neuralnetworks/utils/common/src/InvalidBuffer.cpp +++ b/neuralnetworks/utils/common/src/InvalidBuffer.cpp @@ -30,11 +30,11 @@ nn::Request::MemoryDomainToken InvalidBuffer::getToken() const { return nn::Request::MemoryDomainToken{}; } -nn::GeneralResult InvalidBuffer::copyTo(const nn::Memory& /*dst*/) const { +nn::GeneralResult InvalidBuffer::copyTo(const nn::SharedMemory& /*dst*/) const { return NN_ERROR() << "InvalidBuffer"; } -nn::GeneralResult InvalidBuffer::copyFrom(const nn::Memory& /*src*/, +nn::GeneralResult InvalidBuffer::copyFrom(const nn::SharedMemory& /*src*/, const nn::Dimensions& /*dimensions*/) const { return NN_ERROR() << "InvalidBuffer"; } diff --git a/neuralnetworks/utils/common/src/InvalidBurst.cpp b/neuralnetworks/utils/common/src/InvalidBurst.cpp index 4ca6603eb7..81ca18d259 100644 --- a/neuralnetworks/utils/common/src/InvalidBurst.cpp +++ b/neuralnetworks/utils/common/src/InvalidBurst.cpp @@ -26,7 +26,8 @@ namespace android::hardware::neuralnetworks::utils { -InvalidBurst::OptionalCacheHold InvalidBurst::cacheMemory(const nn::Memory& /*memory*/) const { +InvalidBurst::OptionalCacheHold InvalidBurst::cacheMemory( + const nn::SharedMemory& /*memory*/) const { return nullptr; } diff --git a/neuralnetworks/utils/common/src/ResilientBuffer.cpp b/neuralnetworks/utils/common/src/ResilientBuffer.cpp index 47abbe268f..1904375fd4 100644 --- a/neuralnetworks/utils/common/src/ResilientBuffer.cpp +++ b/neuralnetworks/utils/common/src/ResilientBuffer.cpp @@ -99,12 +99,12 @@ nn::Request::MemoryDomainToken ResilientBuffer::getToken() const { return getBuffer()->getToken(); } -nn::GeneralResult ResilientBuffer::copyTo(const nn::Memory& dst) const { +nn::GeneralResult ResilientBuffer::copyTo(const nn::SharedMemory& dst) const { const auto fn = [&dst](const nn::IBuffer& buffer) { return buffer.copyTo(dst); }; return protect(*this, fn); } -nn::GeneralResult ResilientBuffer::copyFrom(const nn::Memory& src, +nn::GeneralResult ResilientBuffer::copyFrom(const nn::SharedMemory& src, const nn::Dimensions& dimensions) const { const auto fn = [&src, &dimensions](const nn::IBuffer& buffer) { return buffer.copyFrom(src, dimensions); diff --git a/neuralnetworks/utils/common/src/ResilientBurst.cpp b/neuralnetworks/utils/common/src/ResilientBurst.cpp index 0d3cb33a98..5ca868bc9a 100644 --- a/neuralnetworks/utils/common/src/ResilientBurst.cpp +++ b/neuralnetworks/utils/common/src/ResilientBurst.cpp @@ -94,7 +94,8 @@ nn::GeneralResult ResilientBurst::recover(const nn::IBurst* fai return mBurst; } -ResilientBurst::OptionalCacheHold ResilientBurst::cacheMemory(const nn::Memory& memory) const { +ResilientBurst::OptionalCacheHold ResilientBurst::cacheMemory( + const nn::SharedMemory& memory) const { return getBurst()->cacheMemory(memory); } diff --git a/neuralnetworks/utils/common/test/MockBuffer.h b/neuralnetworks/utils/common/test/MockBuffer.h index c5405fb837..59d57007ae 100644 --- a/neuralnetworks/utils/common/test/MockBuffer.h +++ b/neuralnetworks/utils/common/test/MockBuffer.h @@ -27,9 +27,9 @@ namespace android::nn { class MockBuffer final : public IBuffer { public: MOCK_METHOD(Request::MemoryDomainToken, getToken, (), (const, override)); - MOCK_METHOD(GeneralResult, copyTo, (const Memory& dst), (const, override)); - MOCK_METHOD(GeneralResult, copyFrom, (const Memory& src, const Dimensions& dimensions), - (const, override)); + MOCK_METHOD(GeneralResult, copyTo, (const SharedMemory& dst), (const, override)); + MOCK_METHOD(GeneralResult, copyFrom, + (const SharedMemory& src, const Dimensions& dimensions), (const, override)); }; } // namespace android::nn diff --git a/neuralnetworks/utils/common/test/ResilientBufferTest.cpp b/neuralnetworks/utils/common/test/ResilientBufferTest.cpp index deb9b7cf21..7afd0203bb 100644 --- a/neuralnetworks/utils/common/test/ResilientBufferTest.cpp +++ b/neuralnetworks/utils/common/test/ResilientBufferTest.cpp @@ -15,9 +15,11 @@ */ #include +#include #include #include #include +#include #include #include #include "MockBuffer.h" @@ -113,7 +115,8 @@ TEST(ResilientBufferTest, copyTo) { EXPECT_CALL(*mockBuffer, copyTo(_)).Times(1).WillOnce(Return(kNoError)); // run test - const auto result = buffer->copyTo({}); + const nn::SharedMemory memory = std::make_shared(); + const auto result = buffer->copyTo(memory); // verify result ASSERT_TRUE(result.has_value()) @@ -126,7 +129,8 @@ TEST(ResilientBufferTest, copyToError) { EXPECT_CALL(*mockBuffer, copyTo(_)).Times(1).WillOnce(kReturnGeneralFailure); // run test - const auto result = buffer->copyTo({}); + const nn::SharedMemory memory = std::make_shared(); + const auto result = buffer->copyTo(memory); // verify result ASSERT_FALSE(result.has_value()); @@ -140,7 +144,8 @@ TEST(ResilientBufferTest, copyToDeadObjectFailedRecovery) { EXPECT_CALL(*mockBufferFactory, Call()).Times(1).WillOnce(kReturnGeneralFailure); // run test - const auto result = buffer->copyTo({}); + const nn::SharedMemory memory = std::make_shared(); + const auto result = buffer->copyTo(memory); // verify result ASSERT_FALSE(result.has_value()); @@ -156,7 +161,8 @@ TEST(ResilientBufferTest, copyToDeadObjectSuccessfulRecovery) { EXPECT_CALL(*mockBufferFactory, Call()).Times(1).WillOnce(Return(recoveredMockBuffer)); // run test - const auto result = buffer->copyTo({}); + const nn::SharedMemory memory = std::make_shared(); + const auto result = buffer->copyTo(memory); // verify result ASSERT_TRUE(result.has_value()) @@ -169,7 +175,8 @@ TEST(ResilientBufferTest, copyFrom) { EXPECT_CALL(*mockBuffer, copyFrom(_, _)).Times(1).WillOnce(Return(kNoError)); // run test - const auto result = buffer->copyFrom({}, {}); + const nn::SharedMemory memory = std::make_shared(); + const auto result = buffer->copyFrom(memory, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -182,7 +189,8 @@ TEST(ResilientBufferTest, copyFromError) { EXPECT_CALL(*mockBuffer, copyFrom(_, _)).Times(1).WillOnce(kReturnGeneralFailure); // run test - const auto result = buffer->copyFrom({}, {}); + const nn::SharedMemory memory = std::make_shared(); + const auto result = buffer->copyFrom(memory, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -196,7 +204,8 @@ TEST(ResilientBufferTest, copyFromDeadObjectFailedRecovery) { EXPECT_CALL(*mockBufferFactory, Call()).Times(1).WillOnce(kReturnGeneralFailure); // run test - const auto result = buffer->copyFrom({}, {}); + const nn::SharedMemory memory = std::make_shared(); + const auto result = buffer->copyFrom(memory, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -212,7 +221,8 @@ TEST(ResilientBufferTest, copyFromDeadObjectSuccessfulRecovery) { EXPECT_CALL(*mockBufferFactory, Call()).Times(1).WillOnce(Return(recoveredMockBuffer)); // run test - const auto result = buffer->copyFrom({}, {}); + const nn::SharedMemory memory = std::make_shared(); + const auto result = buffer->copyFrom(memory, {}); // verify result ASSERT_TRUE(result.has_value()) -- GitLab From bbe43d950e981cfb5c06622c8f80b57ab60b0497 Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Mon, 8 Feb 2021 00:05:07 -0800 Subject: [PATCH 012/825] Store AHWB in NN canonical memory type -- hal Prior to this CL, the canonical memory type only held a SharedHandle, which mirrors the behavior of native_handle_t/hidl_handle. This means memory types including AHardwareBuffer were stored as this SharedHandle type. With this CL, the canonical memory type is stored directly as AHardwareBuffer to avoid using non-NDK AHardwareBuffer calls in the NN runtime. Bug: 179906132 Test: mma Test: NeuralNetworksTest_static Test: presubmit Change-Id: I394071c193d15ac0c90ac47e5a2a9a79c635db6c --- neuralnetworks/1.0/utils/src/Conversions.cpp | 6 +- neuralnetworks/1.2/utils/src/Conversions.cpp | 11 +- neuralnetworks/1.3/utils/src/Conversions.cpp | 2 +- neuralnetworks/aidl/utils/Android.bp | 4 +- neuralnetworks/aidl/utils/src/Conversions.cpp | 197 +++++++++++++++--- neuralnetworks/aidl/vts/functional/Utils.cpp | 3 +- neuralnetworks/utils/common/Android.bp | 2 + .../common/include/nnapi/hal/CommonUtils.h | 6 +- .../utils/common/src/CommonUtils.cpp | 121 +++++++++-- 9 files changed, 299 insertions(+), 53 deletions(-) diff --git a/neuralnetworks/1.0/utils/src/Conversions.cpp b/neuralnetworks/1.0/utils/src/Conversions.cpp index 34862c00cb..7a099cfd49 100644 --- a/neuralnetworks/1.0/utils/src/Conversions.cpp +++ b/neuralnetworks/1.0/utils/src/Conversions.cpp @@ -154,7 +154,7 @@ GeneralResult unvalidatedConvert(const hidl_vec& } GeneralResult unvalidatedConvert(const hidl_memory& memory) { - return createSharedMemoryFromHidlMemory(memory); + return hal::utils::createSharedMemoryFromHidlMemory(memory); } GeneralResult unvalidatedConvert(const hal::V1_0::Model& model) { @@ -347,9 +347,7 @@ nn::GeneralResult> unvalidatedConvert( } nn::GeneralResult unvalidatedConvert(const nn::SharedMemory& memory) { - CHECK(memory != nullptr); - return hidl_memory(memory->name, NN_TRY(hal::utils::hidlHandleFromSharedHandle(memory->handle)), - memory->size); + return hal::utils::createHidlMemoryFromSharedMemory(memory); } nn::GeneralResult unvalidatedConvert(const nn::Model& model) { diff --git a/neuralnetworks/1.2/utils/src/Conversions.cpp b/neuralnetworks/1.2/utils/src/Conversions.cpp index 50556509d2..7ae483ede2 100644 --- a/neuralnetworks/1.2/utils/src/Conversions.cpp +++ b/neuralnetworks/1.2/utils/src/Conversions.cpp @@ -304,7 +304,11 @@ GeneralResult unvalidatedConvert( } GeneralResult unvalidatedConvert(const hidl_handle& hidlHandle) { - return hal::utils::sharedHandleFromNativeHandle(hidlHandle.getNativeHandle()); + if (hidlHandle.getNativeHandle() == nullptr) { + return nullptr; + } + auto handle = NN_TRY(hal::utils::sharedHandleFromNativeHandle(hidlHandle.getNativeHandle())); + return std::make_shared(std::move(handle)); } GeneralResult convert(const hal::V1_2::DeviceType& deviceType) { @@ -588,7 +592,10 @@ nn::GeneralResult unvalidatedConvert( } nn::GeneralResult unvalidatedConvert(const nn::SharedHandle& handle) { - return hal::utils::hidlHandleFromSharedHandle(handle); + if (handle == nullptr) { + return {}; + } + return hal::utils::hidlHandleFromSharedHandle(*handle); } nn::GeneralResult convert(const nn::DeviceType& deviceType) { diff --git a/neuralnetworks/1.3/utils/src/Conversions.cpp b/neuralnetworks/1.3/utils/src/Conversions.cpp index d96588e34c..6e74a6239d 100644 --- a/neuralnetworks/1.3/utils/src/Conversions.cpp +++ b/neuralnetworks/1.3/utils/src/Conversions.cpp @@ -261,7 +261,7 @@ GeneralResult unvalidatedConvert( using Discriminator = hal::V1_3::Request::MemoryPool::hidl_discriminator; switch (memoryPool.getDiscriminator()) { case Discriminator::hidlMemory: - return createSharedMemoryFromHidlMemory(memoryPool.hidlMemory()); + return hal::utils::createSharedMemoryFromHidlMemory(memoryPool.hidlMemory()); case Discriminator::token: return static_cast(memoryPool.token()); } diff --git a/neuralnetworks/aidl/utils/Android.bp b/neuralnetworks/aidl/utils/Android.bp index 56017da52d..147d401201 100644 --- a/neuralnetworks/aidl/utils/Android.bp +++ b/neuralnetworks/aidl/utils/Android.bp @@ -21,12 +21,14 @@ cc_library_static { local_include_dirs: ["include/nnapi/hal/aidl/"], export_include_dirs: ["include"], static_libs: [ + "libarect", "neuralnetworks_types", "neuralnetworks_utils_hal_common", ], shared_libs: [ - "libhidlbase", "android.hardware.neuralnetworks-V1-ndk_platform", "libbinder_ndk", + "libhidlbase", + "libnativewindow", ], } diff --git a/neuralnetworks/aidl/utils/src/Conversions.cpp b/neuralnetworks/aidl/utils/src/Conversions.cpp index 486d01bc51..db3504bb74 100644 --- a/neuralnetworks/aidl/utils/src/Conversions.cpp +++ b/neuralnetworks/aidl/utils/src/Conversions.cpp @@ -18,6 +18,8 @@ #include #include +#include +#include #include #include #include @@ -27,6 +29,7 @@ #include #include #include +#include #include #include @@ -127,6 +130,61 @@ GeneralResult>> validatedConvert( return canonical; } +GeneralResult unvalidatedConvertHelper(const NativeHandle& aidlNativeHandle) { + std::vector fds; + fds.reserve(aidlNativeHandle.fds.size()); + for (const auto& fd : aidlNativeHandle.fds) { + const int dupFd = dup(fd.get()); + if (dupFd == -1) { + // TODO(b/120417090): is ANEURALNETWORKS_UNEXPECTED_NULL the correct error to return + // here? + return NN_ERROR() << "Failed to dup the fd"; + } + fds.emplace_back(dupFd); + } + + return Handle{.fds = std::move(fds), .ints = aidlNativeHandle.ints}; +} + +struct NativeHandleDeleter { + void operator()(native_handle_t* handle) const { + if (handle) { + native_handle_close(handle); + native_handle_delete(handle); + } + } +}; + +using UniqueNativeHandle = std::unique_ptr; + +static nn::GeneralResult nativeHandleFromAidlHandle( + const NativeHandle& handle) { + std::vector fds; + fds.reserve(handle.fds.size()); + for (const auto& fd : handle.fds) { + const int dupFd = dup(fd.get()); + if (dupFd == -1) { + return NN_ERROR() << "Failed to dup the fd"; + } + fds.emplace_back(dupFd); + } + + constexpr size_t kIntMax = std::numeric_limits::max(); + CHECK_LE(handle.fds.size(), kIntMax); + CHECK_LE(handle.ints.size(), kIntMax); + native_handle_t* nativeHandle = native_handle_create(static_cast(handle.fds.size()), + static_cast(handle.ints.size())); + if (nativeHandle == nullptr) { + return NN_ERROR() << "Failed to create native_handle"; + } + for (size_t i = 0; i < fds.size(); ++i) { + nativeHandle->data[i] = fds[i].release(); + } + std::copy(handle.ints.begin(), handle.ints.end(), &nativeHandle->data[nativeHandle->numFds]); + + return UniqueNativeHandle(nativeHandle); +} + } // anonymous namespace GeneralResult unvalidatedConvert(const aidl_hal::OperandType& operandType) { @@ -318,10 +376,64 @@ GeneralResult unvalidatedConvert(bool measureTiming) { return measureTiming ? MeasureTiming::YES : MeasureTiming::NO; } +static uint32_t roundUpToMultiple(uint32_t value, uint32_t multiple) { + return (value + multiple - 1) / multiple * multiple; +} + GeneralResult unvalidatedConvert(const aidl_hal::Memory& memory) { VERIFY_NON_NEGATIVE(memory.size) << "Memory size must not be negative"; + if (memory.size > std::numeric_limits::max()) { + return NN_ERROR() << "Memory: size must be <= std::numeric_limits::max()"; + } + + if (memory.name != "hardware_buffer_blob") { + return std::make_shared(Memory{ + .handle = NN_TRY(unvalidatedConvertHelper(memory.handle)), + .size = static_cast(memory.size), + .name = memory.name, + }); + } + + const auto size = static_cast(memory.size); + const auto format = AHARDWAREBUFFER_FORMAT_BLOB; + const auto usage = AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN | AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN; + const uint32_t width = size; + const uint32_t height = 1; // height is always 1 for BLOB mode AHardwareBuffer. + const uint32_t layers = 1; // layers is always 1 for BLOB mode AHardwareBuffer. + + const UniqueNativeHandle handle = NN_TRY(nativeHandleFromAidlHandle(memory.handle)); + const native_handle_t* nativeHandle = handle.get(); + + // AHardwareBuffer_createFromHandle() might fail because an allocator + // expects a specific stride value. In that case, we try to guess it by + // aligning the width to small powers of 2. + // TODO(b/174120849): Avoid stride assumptions. + AHardwareBuffer* hardwareBuffer = nullptr; + status_t status = UNKNOWN_ERROR; + for (uint32_t alignment : {1, 4, 32, 64, 128, 2, 8, 16}) { + const uint32_t stride = roundUpToMultiple(width, alignment); + AHardwareBuffer_Desc desc{ + .width = width, + .height = height, + .layers = layers, + .format = format, + .usage = usage, + .stride = stride, + }; + status = AHardwareBuffer_createFromHandle(&desc, nativeHandle, + AHARDWAREBUFFER_CREATE_FROM_HANDLE_METHOD_CLONE, + &hardwareBuffer); + if (status == NO_ERROR) { + break; + } + } + if (status != NO_ERROR) { + return NN_ERROR(ErrorStatus::GENERAL_FAILURE) + << "Can't create AHardwareBuffer from handle. Error: " << status; + } + return std::make_shared(Memory{ - .handle = NN_TRY(unvalidatedConvert(memory.handle)), + .handle = HardwareBufferHandle(hardwareBuffer, /*takeOwnership=*/true), .size = static_cast(memory.size), .name = memory.name, }); @@ -400,22 +512,7 @@ GeneralResult unvalidatedConvert( } GeneralResult unvalidatedConvert(const NativeHandle& aidlNativeHandle) { - std::vector fds; - fds.reserve(aidlNativeHandle.fds.size()); - for (const auto& fd : aidlNativeHandle.fds) { - int dupFd = dup(fd.get()); - if (dupFd == -1) { - // TODO(b/120417090): is ANEURALNETWORKS_UNEXPECTED_NULL the correct error to return - // here? - return NN_ERROR() << "Failed to dup the fd"; - } - fds.emplace_back(dupFd); - } - - return std::make_shared(Handle{ - .fds = std::move(fds), - .ints = aidlNativeHandle.ints, - }); + return std::make_shared(NN_TRY(unvalidatedConvertHelper(aidlNativeHandle))); } GeneralResult convert( @@ -508,13 +605,11 @@ nn::GeneralResult>> validatedConvert( return halObject; } -} // namespace - -nn::GeneralResult unvalidatedConvert(const nn::SharedHandle& sharedHandle) { +nn::GeneralResult unvalidatedConvert(const nn::Handle& handle) { common::NativeHandle aidlNativeHandle; - aidlNativeHandle.fds.reserve(sharedHandle->fds.size()); - for (const auto& fd : sharedHandle->fds) { - int dupFd = dup(fd.get()); + aidlNativeHandle.fds.reserve(handle.fds.size()); + for (const auto& fd : handle.fds) { + const int dupFd = dup(fd.get()); if (dupFd == -1) { // TODO(b/120417090): is ANEURALNETWORKS_UNEXPECTED_NULL the correct error to return // here? @@ -522,17 +617,69 @@ nn::GeneralResult unvalidatedConvert(const nn::SharedHandl } aidlNativeHandle.fds.emplace_back(dupFd); } - aidlNativeHandle.ints = sharedHandle->ints; + aidlNativeHandle.ints = handle.ints; + return aidlNativeHandle; +} + +static nn::GeneralResult aidlHandleFromNativeHandle( + const native_handle_t& handle) { + common::NativeHandle aidlNativeHandle; + + aidlNativeHandle.fds.reserve(handle.numFds); + for (int i = 0; i < handle.numFds; ++i) { + const int dupFd = dup(handle.data[i]); + if (dupFd == -1) { + return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) << "Failed to dup the fd"; + } + aidlNativeHandle.fds.emplace_back(dupFd); + } + + aidlNativeHandle.ints = std::vector(&handle.data[handle.numFds], + &handle.data[handle.numFds + handle.numInts]); + return aidlNativeHandle; } +} // namespace + +nn::GeneralResult unvalidatedConvert(const nn::SharedHandle& sharedHandle) { + CHECK(sharedHandle != nullptr); + return unvalidatedConvert(*sharedHandle); +} + nn::GeneralResult unvalidatedConvert(const nn::SharedMemory& memory) { CHECK(memory != nullptr); if (memory->size > std::numeric_limits::max()) { return NN_ERROR() << "Memory size doesn't fit into int64_t."; } + if (const auto* handle = std::get_if(&memory->handle)) { + return Memory{ + .handle = NN_TRY(unvalidatedConvert(*handle)), + .size = static_cast(memory->size), + .name = memory->name, + }; + } + + const auto* ahwb = std::get(memory->handle).get(); + AHardwareBuffer_Desc bufferDesc; + AHardwareBuffer_describe(ahwb, &bufferDesc); + + if (bufferDesc.format == AHARDWAREBUFFER_FORMAT_BLOB) { + CHECK_EQ(memory->size, bufferDesc.width); + CHECK_EQ(memory->name, "hardware_buffer_blob"); + } else { + CHECK_EQ(memory->size, 0u); + CHECK_EQ(memory->name, "hardware_buffer"); + } + + const native_handle_t* nativeHandle = AHardwareBuffer_getNativeHandle(ahwb); + if (nativeHandle == nullptr) { + return NN_ERROR() << "unvalidatedConvert failed because AHardwareBuffer_getNativeHandle " + "returned nullptr"; + } + return Memory{ - .handle = NN_TRY(unvalidatedConvert(memory->handle)), + .handle = NN_TRY(aidlHandleFromNativeHandle(*nativeHandle)), .size = static_cast(memory->size), .name = memory->name, }; diff --git a/neuralnetworks/aidl/vts/functional/Utils.cpp b/neuralnetworks/aidl/vts/functional/Utils.cpp index 14a496a303..3c7f5f797d 100644 --- a/neuralnetworks/aidl/vts/functional/Utils.cpp +++ b/neuralnetworks/aidl/vts/functional/Utils.cpp @@ -135,7 +135,8 @@ void TestBlobAHWB::initialize(uint32_t size) { ASSERT_EQ(AHardwareBuffer_allocate(&desc, &mAhwb), 0); ASSERT_NE(mAhwb, nullptr); - const auto sharedMemory = nn::createSharedMemoryFromAHWB(*mAhwb).value(); + const auto sharedMemory = + nn::createSharedMemoryFromAHWB(mAhwb, /*takeOwnership=*/false).value(); mMapping = nn::map(sharedMemory).value(); mPtr = static_cast(std::get(mMapping.pointer)); CHECK_NE(mPtr, nullptr); diff --git a/neuralnetworks/utils/common/Android.bp b/neuralnetworks/utils/common/Android.bp index 6c491ae7ae..50295f1aad 100644 --- a/neuralnetworks/utils/common/Android.bp +++ b/neuralnetworks/utils/common/Android.bp @@ -22,10 +22,12 @@ cc_library_static { export_include_dirs: ["include"], cflags: ["-Wthread-safety"], static_libs: [ + "libarect", "neuralnetworks_types", ], shared_libs: [ "libhidlbase", + "libnativewindow", ], } diff --git a/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h b/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h index b13785dcd9..547f203d6d 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h @@ -74,10 +74,12 @@ nn::GeneralResult unflushDataFromSharedToPointer( std::vector countNumberOfConsumers(size_t numberOfOperands, const std::vector& operations); +nn::GeneralResult createHidlMemoryFromSharedMemory(const nn::SharedMemory& memory); nn::GeneralResult createSharedMemoryFromHidlMemory(const hidl_memory& memory); -nn::GeneralResult hidlHandleFromSharedHandle(const nn::SharedHandle& handle); -nn::GeneralResult sharedHandleFromNativeHandle(const native_handle_t* handle); +nn::GeneralResult hidlHandleFromSharedHandle(const nn::Handle& handle); +nn::GeneralResult sharedHandleFromNativeHandle(const native_handle_t* handle); + nn::GeneralResult> convertSyncFences( const std::vector& fences); diff --git a/neuralnetworks/utils/common/src/CommonUtils.cpp b/neuralnetworks/utils/common/src/CommonUtils.cpp index 90215630c9..7a5035f6fc 100644 --- a/neuralnetworks/utils/common/src/CommonUtils.cpp +++ b/neuralnetworks/utils/common/src/CommonUtils.cpp @@ -20,11 +20,14 @@ #include #include +#include +#include #include #include #include #include #include +#include #include #include @@ -248,44 +251,128 @@ std::vector countNumberOfConsumers(size_t numberOfOperands, return nn::countNumberOfConsumers(numberOfOperands, operations); } -nn::GeneralResult hidlHandleFromSharedHandle(const nn::SharedHandle& handle) { - if (handle == nullptr) { - return {}; +nn::GeneralResult createHidlMemoryFromSharedMemory(const nn::SharedMemory& memory) { + if (memory == nullptr) { + return NN_ERROR() << "Memory must be non-empty"; + } + if (const auto* handle = std::get_if(&memory->handle)) { + return hidl_memory(memory->name, NN_TRY(hidlHandleFromSharedHandle(*handle)), memory->size); + } + + const auto* ahwb = std::get(memory->handle).get(); + AHardwareBuffer_Desc bufferDesc; + AHardwareBuffer_describe(ahwb, &bufferDesc); + + if (bufferDesc.format == AHARDWAREBUFFER_FORMAT_BLOB) { + CHECK_EQ(memory->size, bufferDesc.width); + CHECK_EQ(memory->name, "hardware_buffer_blob"); + } else { + CHECK_EQ(memory->size, 0u); + CHECK_EQ(memory->name, "hardware_buffer"); } + const native_handle_t* nativeHandle = AHardwareBuffer_getNativeHandle(ahwb); + const hidl_handle hidlHandle(nativeHandle); + hidl_handle handle(hidlHandle); + + return hidl_memory(memory->name, std::move(handle), memory->size); +} + +static uint32_t roundUpToMultiple(uint32_t value, uint32_t multiple) { + return (value + multiple - 1) / multiple * multiple; +} + +nn::GeneralResult createSharedMemoryFromHidlMemory(const hidl_memory& memory) { + CHECK_LE(memory.size(), std::numeric_limits::max()); + + if (memory.name() != "hardware_buffer_blob") { + return std::make_shared(nn::Memory{ + .handle = NN_TRY(sharedHandleFromNativeHandle(memory.handle())), + .size = static_cast(memory.size()), + .name = memory.name(), + }); + } + + const auto size = memory.size(); + const auto format = AHARDWAREBUFFER_FORMAT_BLOB; + const auto usage = AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN | AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN; + const uint32_t width = size; + const uint32_t height = 1; // height is always 1 for BLOB mode AHardwareBuffer. + const uint32_t layers = 1; // layers is always 1 for BLOB mode AHardwareBuffer. + + // AHardwareBuffer_createFromHandle() might fail because an allocator + // expects a specific stride value. In that case, we try to guess it by + // aligning the width to small powers of 2. + // TODO(b/174120849): Avoid stride assumptions. + AHardwareBuffer* hardwareBuffer = nullptr; + status_t status = UNKNOWN_ERROR; + for (uint32_t alignment : {1, 4, 32, 64, 128, 2, 8, 16}) { + const uint32_t stride = roundUpToMultiple(width, alignment); + AHardwareBuffer_Desc desc{ + .width = width, + .height = height, + .layers = layers, + .format = format, + .usage = usage, + .stride = stride, + }; + status = AHardwareBuffer_createFromHandle(&desc, memory.handle(), + AHARDWAREBUFFER_CREATE_FROM_HANDLE_METHOD_CLONE, + &hardwareBuffer); + if (status == NO_ERROR) { + break; + } + } + if (status != NO_ERROR) { + return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) + << "Can't create AHardwareBuffer from handle. Error: " << status; + } + + return std::make_shared(nn::Memory{ + .handle = nn::HardwareBufferHandle(hardwareBuffer, /*takeOwnership=*/true), + .size = static_cast(memory.size()), + .name = memory.name(), + }); +} + +nn::GeneralResult hidlHandleFromSharedHandle(const nn::Handle& handle) { std::vector fds; - fds.reserve(handle->fds.size()); - for (const auto& fd : handle->fds) { - int dupFd = dup(fd); + fds.reserve(handle.fds.size()); + for (const auto& fd : handle.fds) { + const int dupFd = dup(fd); if (dupFd == -1) { return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) << "Failed to dup the fd"; } fds.emplace_back(dupFd); } - native_handle_t* nativeHandle = native_handle_create(handle->fds.size(), handle->ints.size()); + constexpr size_t kIntMax = std::numeric_limits::max(); + CHECK_LE(handle.fds.size(), kIntMax); + CHECK_LE(handle.ints.size(), kIntMax); + native_handle_t* nativeHandle = native_handle_create(static_cast(handle.fds.size()), + static_cast(handle.ints.size())); if (nativeHandle == nullptr) { return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) << "Failed to create native_handle"; } for (size_t i = 0; i < fds.size(); ++i) { nativeHandle->data[i] = fds[i].release(); } - std::copy(handle->ints.begin(), handle->ints.end(), &nativeHandle->data[nativeHandle->numFds]); + std::copy(handle.ints.begin(), handle.ints.end(), &nativeHandle->data[nativeHandle->numFds]); hidl_handle hidlHandle; hidlHandle.setTo(nativeHandle, /*shouldOwn=*/true); return hidlHandle; } -nn::GeneralResult sharedHandleFromNativeHandle(const native_handle_t* handle) { +nn::GeneralResult sharedHandleFromNativeHandle(const native_handle_t* handle) { if (handle == nullptr) { - return nullptr; + return NN_ERROR() << "sharedHandleFromNativeHandle failed because handle is nullptr"; } std::vector fds; fds.reserve(handle->numFds); for (int i = 0; i < handle->numFds; ++i) { - int dupFd = dup(handle->data[i]); + const int dupFd = dup(handle->data[i]); if (dupFd == -1) { return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) << "Failed to dup the fd"; } @@ -295,18 +382,18 @@ nn::GeneralResult sharedHandleFromNativeHandle(const native_ha std::vector ints(&handle->data[handle->numFds], &handle->data[handle->numFds + handle->numInts]); - return std::make_shared(nn::Handle{ - .fds = std::move(fds), - .ints = std::move(ints), - }); + return nn::Handle{.fds = std::move(fds), .ints = std::move(ints)}; } nn::GeneralResult> convertSyncFences( const std::vector& syncFences) { hidl_vec handles(syncFences.size()); for (size_t i = 0; i < syncFences.size(); ++i) { - handles[i] = - NN_TRY(hal::utils::hidlHandleFromSharedHandle(syncFences[i].getSharedHandle())); + const auto& handle = syncFences[i].getSharedHandle(); + if (handle == nullptr) { + return NN_ERROR() << "convertSyncFences failed because sync fence is empty"; + } + handles[i] = NN_TRY(hidlHandleFromSharedHandle(*handle)); } return handles; } -- GitLab From 64bd20e416d13d3f10d670c0dc42a9892f248763 Mon Sep 17 00:00:00 2001 From: Albert Wang Date: Tue, 17 Nov 2020 13:23:40 +0800 Subject: [PATCH 013/825] USB HAL 1.3 interface Supports to enable/disable USB data signaling Bug: 142105910 Bug: 161414036 Test: USB HAL V1.3 HIDL tests Signed-off-by: Albert Wang Change-Id: I55ac262dbcdd89ab039193ed467b94f80664c9ba --- .../compatibility_matrix.current.xml | 2 +- usb/1.3/Android.bp | 16 +++++ usb/1.3/IUsb.hal | 32 +++++++++ usb/1.3/vts/OWNERS | 2 + usb/1.3/vts/functional/Android.bp | 31 +++++++++ .../functional/VtsHalUsbV1_3TargetTest.cpp | 69 +++++++++++++++++++ 6 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 usb/1.3/Android.bp create mode 100644 usb/1.3/IUsb.hal create mode 100644 usb/1.3/vts/OWNERS create mode 100644 usb/1.3/vts/functional/Android.bp create mode 100644 usb/1.3/vts/functional/VtsHalUsbV1_3TargetTest.cpp diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 871b3250ac..07112a1f77 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -580,7 +580,7 @@
android.hardware.usb - 1.0-2 + 1.0-3 IUsb default diff --git a/usb/1.3/Android.bp b/usb/1.3/Android.bp new file mode 100644 index 0000000000..17367d3d8d --- /dev/null +++ b/usb/1.3/Android.bp @@ -0,0 +1,16 @@ +// This file is autogenerated by hidl-gen -Landroidbp. + +hidl_interface { + name: "android.hardware.usb@1.3", + root: "android.hardware", + srcs: [ + "IUsb.hal", + ], + interfaces: [ + "android.hardware.usb@1.0", + "android.hardware.usb@1.1", + "android.hardware.usb@1.2", + "android.hidl.base@1.0", + ], + gen_java: true, +} diff --git a/usb/1.3/IUsb.hal b/usb/1.3/IUsb.hal new file mode 100644 index 0000000000..3d1d380578 --- /dev/null +++ b/usb/1.3/IUsb.hal @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.usb@1.3; + +import android.hardware.usb@1.2::IUsb; + +interface IUsb extends @1.2::IUsb { + /** + * This function is used to enable/disable USB controller when some + * scenarios need. This function can stop and restore USB data signaling. + * + * @param enable true Enable USB data signaling. + * false Disable USB data signaling. + * @return true enable or disable USB data successfully + * false if something wrong + */ + enableUsbDataSignal(bool enable) generates(bool result); +}; diff --git a/usb/1.3/vts/OWNERS b/usb/1.3/vts/OWNERS new file mode 100644 index 0000000000..a6a1e5416a --- /dev/null +++ b/usb/1.3/vts/OWNERS @@ -0,0 +1,2 @@ +albertccwang@google.com +badhri@google.com diff --git a/usb/1.3/vts/functional/Android.bp b/usb/1.3/vts/functional/Android.bp new file mode 100644 index 0000000000..b62bb9d03f --- /dev/null +++ b/usb/1.3/vts/functional/Android.bp @@ -0,0 +1,31 @@ +// +// 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. +// + +cc_test { + name: "VtsHalUsbV1_3TargetTest", + defaults: ["VtsHalTargetTestDefaults"], + srcs: ["VtsHalUsbV1_3TargetTest.cpp"], + static_libs: [ + "android.hardware.usb@1.0", + "android.hardware.usb@1.1", + "android.hardware.usb@1.2", + "android.hardware.usb@1.3", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/usb/1.3/vts/functional/VtsHalUsbV1_3TargetTest.cpp b/usb/1.3/vts/functional/VtsHalUsbV1_3TargetTest.cpp new file mode 100644 index 0000000000..ed35d4223e --- /dev/null +++ b/usb/1.3/vts/functional/VtsHalUsbV1_3TargetTest.cpp @@ -0,0 +1,69 @@ +/* + * 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. + */ + +#define LOG_TAG "VtsHalUsbV1_3TargetTest" +#include + +#include + +#include +#include +#include + +#include +#include +#include + +using ::android::sp; +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::usb::V1_0::Status; +using ::android::hardware::usb::V1_3::IUsb; +using ::android::hidl::base::V1_0::IBase; + +// The main test class for the USB hidl HAL +class UsbHidlTest : public ::testing::TestWithParam { + public: + virtual void SetUp() override { + ALOGI(__FUNCTION__); + usb = IUsb::getService(GetParam()); + ASSERT_NE(usb, nullptr); + } + + virtual void TearDown() override { ALOGI("Teardown"); } + + // USB hidl hal Proxy + sp usb; +}; + +/* + * Check to see if enable usb data signal succeeds. + * HAL service should call enableUsbDataSignal. + */ +TEST_P(UsbHidlTest, enableUsbDataSignal) { + Return ret = usb->enableUsbDataSignal(true); + ASSERT_TRUE(ret.isOk()); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(UsbHidlTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, UsbHidlTest, + testing::ValuesIn(android::hardware::getAllHalInstanceNames(IUsb::descriptor)), + android::hardware::PrintInstanceNameToString); -- GitLab From 3665d245adf481cc7b710c642711565d256d326c Mon Sep 17 00:00:00 2001 From: Lev Proleev Date: Mon, 15 Feb 2021 15:52:56 +0000 Subject: [PATCH 014/825] Add VtsHalNeuralnetworksTargetTest to NNAPI test mapping Bug: 172921927 Test: presubmit on cuttlefish Change-Id: Ia59446246bef2a41912a6b0c9d11abd125e8d913 --- neuralnetworks/TEST_MAPPING | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/neuralnetworks/TEST_MAPPING b/neuralnetworks/TEST_MAPPING index de846244a1..5d168d2766 100644 --- a/neuralnetworks/TEST_MAPPING +++ b/neuralnetworks/TEST_MAPPING @@ -60,6 +60,17 @@ "include-filter": "-*sample_float_fast*:*sample_float_slow*:*sample_minimal*:*sample_quant*" } ] + }, + { + "name": "VtsHalNeuralnetworksTargetTest", + "options": [ + { + // Do not use any sample driver except sample-all in order to reduce + // testing time. The other sample drivers (fast-float, quant, etc.) + // are subsets of sample-all. + "include-filter": "-*sample_float_fast*:*sample_float_slow*:*sample_minimal*:*sample_quant*" + } + ] } ] } -- GitLab From dfc4a2fa322ea77bbf2ed5f15fa831fb1002be06 Mon Sep 17 00:00:00 2001 From: Slava Shklyaev Date: Thu, 4 Feb 2021 13:31:18 +0000 Subject: [PATCH 015/825] Reformat neuralnetworks/1.2/types.hal according to clang-format While we cannot run clang-format on types.hal directly, we can do so on the canonical Types.h (which is generated from the same template) and observe the difference. See change Ia43936d8. Bug: 160667417 Test: m Change-Id: Id6a237f29c8156b213455ab093d11ed4c2015460 --- current.txt | 2 +- neuralnetworks/1.2/types.hal | 12 ++++++------ neuralnetworks/1.2/types.t | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/current.txt b/current.txt index 5e9a34c5f6..dfe5d9d5e7 100644 --- a/current.txt +++ b/current.txt @@ -780,7 +780,7 @@ bda492ec4021d13869de72bd6f8c15c5837b78d6136b8d538efec5320573a5ec android.hardwar dabe23dde7c9e3ad65c61def7392f186d7efe7f4216f9b6f9cf0863745b1a9f4 android.hardware.keymaster@4.1::IKeymasterDevice cd84ab19c590e0e73dd2307b591a3093ee18147ef95e6d5418644463a6620076 android.hardware.neuralnetworks@1.2::IDevice f729ee6a5f136b25d79ea6895d24700fce413df555baaecf2c39e4440d15d043 android.hardware.neuralnetworks@1.0::types -c6ae443608502339aec4256feef48e7b2d36f7477ca5361cc95cd27a8ed9c612 android.hardware.neuralnetworks@1.2::types +ba84f3a750b1cc43ac51074e8b8e22df924f3e6d9068fac50d95bcf57b2b1d61 android.hardware.neuralnetworks@1.2::types 9fe5a4093043c2b5da4e9491aed1646c388a5d3059b8fd77d5b6a9807e6d3a3e android.hardware.neuralnetworks@1.3::types e8c86c69c438da8d1549856c1bb3e2d1b8da52722f8235ff49a30f2cce91742c android.hardware.soundtrigger@2.1::ISoundTriggerHwCallback b9fbb6e2e061ed0960939d48b785e9700210add1f13ed32ecd688d0f1ca20ef7 android.hardware.renderscript@1.0::types diff --git a/neuralnetworks/1.2/types.hal b/neuralnetworks/1.2/types.hal index 7cec49e0e2..e3cee93bce 100644 --- a/neuralnetworks/1.2/types.hal +++ b/neuralnetworks/1.2/types.hal @@ -4711,14 +4711,14 @@ enum DeviceType : int32_t { // HAL equivalent of unknown type and a 1.2 HAL implementation must belong // to one of the categories below. /** The device does not fall into any category below. */ - OTHER = 1, + OTHER = 1, /** The device runs NNAPI models on single or multi-core CPU. */ - CPU = 2, + CPU = 2, /** The device can run NNAPI models and also accelerate graphics APIs such - * as OpenGL ES and Vulkan. */ - GPU = 3, + * as OpenGL ES and Vulkan. */ + GPU = 3, /** Dedicated accelerator for Machine Learning workloads. */ - ACCELERATOR = 4, + ACCELERATOR = 4, }; /** @@ -5054,7 +5054,7 @@ struct OutputShape { * Specifies whether or not to measure timing information during execution. */ enum MeasureTiming : int32_t { - NO = 0, + NO = 0, YES = 1, }; diff --git a/neuralnetworks/1.2/types.t b/neuralnetworks/1.2/types.t index 21d88acf8f..054d516104 100644 --- a/neuralnetworks/1.2/types.t +++ b/neuralnetworks/1.2/types.t @@ -107,14 +107,14 @@ enum DeviceType : int32_t { // HAL equivalent of unknown type and a 1.2 HAL implementation must belong // to one of the categories below. /** The device does not fall into any category below. */ - OTHER = 1, + OTHER = 1, /** The device runs NNAPI models on single or multi-core CPU. */ - CPU = 2, + CPU = 2, /** The device can run NNAPI models and also accelerate graphics APIs such - * as OpenGL ES and Vulkan. */ - GPU = 3, + * as OpenGL ES and Vulkan. */ + GPU = 3, /** Dedicated accelerator for Machine Learning workloads. */ - ACCELERATOR = 4, + ACCELERATOR = 4, }; /** @@ -450,7 +450,7 @@ struct OutputShape { * Specifies whether or not to measure timing information during execution. */ enum MeasureTiming : int32_t { - NO = 0, + NO = 0, YES = 1, }; -- GitLab From c4d98007fd2ff50031b270801274ee4c498afd87 Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Tue, 9 Feb 2021 15:36:11 -0800 Subject: [PATCH 016/825] Make NNAPI countNumberOfConsumers return GeneralResult -- hal Previously, countNumberOfConsumers would trigger a CHECK if the input was invalid. This CL makes countNumberOfConsumers gracefully fail on errors, instead returning the error through the GeneralResult. Bug: N/A Test: mma Change-Id: Iee54f87768e52fdf701c22d94083c053b881733d --- neuralnetworks/1.0/utils/src/Conversions.cpp | 4 ++-- neuralnetworks/1.1/utils/src/Conversions.cpp | 4 ++-- neuralnetworks/1.2/utils/src/Conversions.cpp | 4 ++-- neuralnetworks/1.3/utils/src/Conversions.cpp | 4 ++-- neuralnetworks/aidl/vts/functional/ValidateModel.cpp | 6 ++++-- neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h | 4 ++-- neuralnetworks/utils/common/src/CommonUtils.cpp | 6 +++--- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/neuralnetworks/1.0/utils/src/Conversions.cpp b/neuralnetworks/1.0/utils/src/Conversions.cpp index 7a099cfd49..700b050ce7 100644 --- a/neuralnetworks/1.0/utils/src/Conversions.cpp +++ b/neuralnetworks/1.0/utils/src/Conversions.cpp @@ -162,7 +162,7 @@ GeneralResult unvalidatedConvert(const hal::V1_0::Model& model) { // Verify number of consumers. const auto numberOfConsumers = - hal::utils::countNumberOfConsumers(model.operands.size(), operations); + NN_TRY(hal::utils::countNumberOfConsumers(model.operands.size(), operations)); CHECK(model.operands.size() == numberOfConsumers.size()); for (size_t i = 0; i < model.operands.size(); ++i) { if (model.operands[i].numberOfConsumers != numberOfConsumers[i]) { @@ -360,7 +360,7 @@ nn::GeneralResult unvalidatedConvert(const nn::Model& model) { // Update number of consumers. const auto numberOfConsumers = - hal::utils::countNumberOfConsumers(operands.size(), model.main.operations); + NN_TRY(hal::utils::countNumberOfConsumers(operands.size(), model.main.operations)); CHECK(operands.size() == numberOfConsumers.size()); for (size_t i = 0; i < operands.size(); ++i) { operands[i].numberOfConsumers = numberOfConsumers[i]; diff --git a/neuralnetworks/1.1/utils/src/Conversions.cpp b/neuralnetworks/1.1/utils/src/Conversions.cpp index 07bf7bc88f..d07f7d00bc 100644 --- a/neuralnetworks/1.1/utils/src/Conversions.cpp +++ b/neuralnetworks/1.1/utils/src/Conversions.cpp @@ -111,7 +111,7 @@ GeneralResult unvalidatedConvert(const hal::V1_1::Model& model) { // Verify number of consumers. const auto numberOfConsumers = - hal::utils::countNumberOfConsumers(model.operands.size(), operations); + NN_TRY(hal::utils::countNumberOfConsumers(model.operands.size(), operations)); CHECK(model.operands.size() == numberOfConsumers.size()); for (size_t i = 0; i < model.operands.size(); ++i) { if (model.operands[i].numberOfConsumers != numberOfConsumers[i]) { @@ -241,7 +241,7 @@ nn::GeneralResult unvalidatedConvert(const nn::Model& model) { // Update number of consumers. const auto numberOfConsumers = - hal::utils::countNumberOfConsumers(operands.size(), model.main.operations); + NN_TRY(hal::utils::countNumberOfConsumers(operands.size(), model.main.operations)); CHECK(operands.size() == numberOfConsumers.size()); for (size_t i = 0; i < operands.size(); ++i) { operands[i].numberOfConsumers = numberOfConsumers[i]; diff --git a/neuralnetworks/1.2/utils/src/Conversions.cpp b/neuralnetworks/1.2/utils/src/Conversions.cpp index 7ae483ede2..86a417a352 100644 --- a/neuralnetworks/1.2/utils/src/Conversions.cpp +++ b/neuralnetworks/1.2/utils/src/Conversions.cpp @@ -227,7 +227,7 @@ GeneralResult unvalidatedConvert(const hal::V1_2::Model& model) { // Verify number of consumers. const auto numberOfConsumers = - hal::utils::countNumberOfConsumers(model.operands.size(), operations); + NN_TRY(hal::utils::countNumberOfConsumers(model.operands.size(), operations)); CHECK(model.operands.size() == numberOfConsumers.size()); for (size_t i = 0; i < model.operands.size(); ++i) { if (model.operands[i].numberOfConsumers != numberOfConsumers[i]) { @@ -529,7 +529,7 @@ nn::GeneralResult unvalidatedConvert(const nn::Model& model) { // Update number of consumers. const auto numberOfConsumers = - hal::utils::countNumberOfConsumers(operands.size(), model.main.operations); + NN_TRY(hal::utils::countNumberOfConsumers(operands.size(), model.main.operations)); CHECK(operands.size() == numberOfConsumers.size()); for (size_t i = 0; i < operands.size(); ++i) { operands[i].numberOfConsumers = numberOfConsumers[i]; diff --git a/neuralnetworks/1.3/utils/src/Conversions.cpp b/neuralnetworks/1.3/utils/src/Conversions.cpp index 6e74a6239d..320c74c2c6 100644 --- a/neuralnetworks/1.3/utils/src/Conversions.cpp +++ b/neuralnetworks/1.3/utils/src/Conversions.cpp @@ -217,7 +217,7 @@ GeneralResult unvalidatedConvert(const hal::V1_3::Subgraph& sub // Verify number of consumers. const auto numberOfConsumers = - hal::utils::countNumberOfConsumers(subgraph.operands.size(), operations); + NN_TRY(hal::utils::countNumberOfConsumers(subgraph.operands.size(), operations)); CHECK(subgraph.operands.size() == numberOfConsumers.size()); for (size_t i = 0; i < subgraph.operands.size(); ++i) { if (subgraph.operands[i].numberOfConsumers != numberOfConsumers[i]) { @@ -559,7 +559,7 @@ nn::GeneralResult unvalidatedConvert(const nn::Model::Subgraph& subgra // Update number of consumers. const auto numberOfConsumers = - hal::utils::countNumberOfConsumers(operands.size(), subgraph.operations); + NN_TRY(hal::utils::countNumberOfConsumers(operands.size(), subgraph.operations)); CHECK(operands.size() == numberOfConsumers.size()); for (size_t i = 0; i < operands.size(); ++i) { operands[i].numberOfConsumers = numberOfConsumers[i]; diff --git a/neuralnetworks/aidl/vts/functional/ValidateModel.cpp b/neuralnetworks/aidl/vts/functional/ValidateModel.cpp index b84d981abd..6d84e1ed7b 100644 --- a/neuralnetworks/aidl/vts/functional/ValidateModel.cpp +++ b/neuralnetworks/aidl/vts/functional/ValidateModel.cpp @@ -1310,8 +1310,10 @@ static void mutateExecutionPriorityTest(const std::shared_ptr& device, ////////////////////////// ENTRY POINT ////////////////////////////// void validateModel(const std::shared_ptr& device, const Model& model) { - const auto numberOfConsumers = nn::countNumberOfConsumers( - model.main.operands.size(), nn::convert(model.main.operations).value()); + const auto numberOfConsumers = + nn::countNumberOfConsumers(model.main.operands.size(), + nn::convert(model.main.operations).value()) + .value(); mutateExecutionOrderTest(device, model, numberOfConsumers); mutateOperandTypeTest(device, model); mutateOperandRankTest(device, model); diff --git a/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h b/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h index 547f203d6d..2f6112a4c9 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h @@ -71,8 +71,8 @@ nn::GeneralResult> flushDataFromPointe nn::GeneralResult unflushDataFromSharedToPointer( const nn::Request& request, const std::optional& maybeRequestInShared); -std::vector countNumberOfConsumers(size_t numberOfOperands, - const std::vector& operations); +nn::GeneralResult> countNumberOfConsumers( + size_t numberOfOperands, const std::vector& operations); nn::GeneralResult createHidlMemoryFromSharedMemory(const nn::SharedMemory& memory); nn::GeneralResult createSharedMemoryFromHidlMemory(const hidl_memory& memory); diff --git a/neuralnetworks/utils/common/src/CommonUtils.cpp b/neuralnetworks/utils/common/src/CommonUtils.cpp index 7a5035f6fc..924ecb2d1b 100644 --- a/neuralnetworks/utils/common/src/CommonUtils.cpp +++ b/neuralnetworks/utils/common/src/CommonUtils.cpp @@ -246,9 +246,9 @@ nn::GeneralResult unflushDataFromSharedToPointer( return {}; } -std::vector countNumberOfConsumers(size_t numberOfOperands, - const std::vector& operations) { - return nn::countNumberOfConsumers(numberOfOperands, operations); +nn::GeneralResult> countNumberOfConsumers( + size_t numberOfOperands, const std::vector& operations) { + return makeGeneralFailure(nn::countNumberOfConsumers(numberOfOperands, operations)); } nn::GeneralResult createHidlMemoryFromSharedMemory(const nn::SharedMemory& memory) { -- GitLab From 323dd0c2dc3ca771a5c66a8fe5fd41819e841a1c Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Mon, 10 Aug 2020 18:20:14 -0700 Subject: [PATCH 017/825] Create NNAPI adapter interface This CL creates Device, PreparedModel, and Buffer classes which adapt a canonical interface to a NN 1.3 HIDL interface. Bug: 160668438 Test: mma Change-Id: Ifee27858efd280307a299b3fe2e1a4bd9240e9de --- neuralnetworks/utils/adapter/Android.bp | 37 ++ .../utils/adapter/include/nnapi/hal/Adapter.h | 72 +++ .../utils/adapter/include/nnapi/hal/Buffer.h | 46 ++ .../utils/adapter/include/nnapi/hal/Device.h | 96 +++ .../adapter/include/nnapi/hal/PreparedModel.h | 79 +++ neuralnetworks/utils/adapter/src/Adapter.cpp | 46 ++ neuralnetworks/utils/adapter/src/Buffer.cpp | 83 +++ neuralnetworks/utils/adapter/src/Device.cpp | 556 ++++++++++++++++++ .../utils/adapter/src/PreparedModel.cpp | 417 +++++++++++++ 9 files changed, 1432 insertions(+) create mode 100644 neuralnetworks/utils/adapter/Android.bp create mode 100644 neuralnetworks/utils/adapter/include/nnapi/hal/Adapter.h create mode 100644 neuralnetworks/utils/adapter/include/nnapi/hal/Buffer.h create mode 100644 neuralnetworks/utils/adapter/include/nnapi/hal/Device.h create mode 100644 neuralnetworks/utils/adapter/include/nnapi/hal/PreparedModel.h create mode 100644 neuralnetworks/utils/adapter/src/Adapter.cpp create mode 100644 neuralnetworks/utils/adapter/src/Buffer.cpp create mode 100644 neuralnetworks/utils/adapter/src/Device.cpp create mode 100644 neuralnetworks/utils/adapter/src/PreparedModel.cpp diff --git a/neuralnetworks/utils/adapter/Android.bp b/neuralnetworks/utils/adapter/Android.bp new file mode 100644 index 0000000000..e8dc3e7dd7 --- /dev/null +++ b/neuralnetworks/utils/adapter/Android.bp @@ -0,0 +1,37 @@ +// +// 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. +// + +cc_library_static { + name: "neuralnetworks_utils_hal_adapter", + defaults: ["neuralnetworks_utils_defaults"], + srcs: ["src/*"], + local_include_dirs: ["include/nnapi/hal"], + export_include_dirs: ["include"], + static_libs: [ + "neuralnetworks_types", + "neuralnetworks_utils_hal_1_0", + "neuralnetworks_utils_hal_1_1", + "neuralnetworks_utils_hal_1_2", + "neuralnetworks_utils_hal_1_3", + ], + shared_libs: [ + "android.hardware.neuralnetworks@1.0", + "android.hardware.neuralnetworks@1.1", + "android.hardware.neuralnetworks@1.2", + "android.hardware.neuralnetworks@1.3", + "libfmq", + ], +} diff --git a/neuralnetworks/utils/adapter/include/nnapi/hal/Adapter.h b/neuralnetworks/utils/adapter/include/nnapi/hal/Adapter.h new file mode 100644 index 0000000000..da00a090ed --- /dev/null +++ b/neuralnetworks/utils/adapter/include/nnapi/hal/Adapter.h @@ -0,0 +1,72 @@ +/* + * 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 ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_ADAPTER_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_ADAPTER_H + +#include +#include +#include +#include +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on HIDL interface +// lifetimes across processes and for protecting asynchronous calls across HIDL. + +namespace android::hardware::neuralnetworks::adapter { + +/** + * A self-contained unit of work to be executed. + */ +using Task = std::function; + +/** + * A type-erased executor which executes a task asynchronously. + * + * This executor is also provided with an Application ID (Android User ID) and an optional deadline + * for when the caller expects is the upper bound for the amount of time to complete the task. + */ +using Executor = std::function; + +/** + * Adapt an NNAPI canonical interface object to a HIDL NN HAL interface object. + * + * The IPreparedModel object created from IDevice::prepareModel or IDevice::preparedModelFromCache + * must return "const nn::Model*" from IPreparedModel::getUnderlyingResource(). + * + * @param device NNAPI canonical IDevice interface object to be adapted. + * @param executor Type-erased executor to handle executing tasks asynchronously. + * @return HIDL NN HAL IDevice interface object. + */ +sp adapt(nn::SharedDevice device, Executor executor); + +/** + * Adapt an NNAPI canonical interface object to a HIDL NN HAL interface object. + * + * The IPreparedModel object created from IDevice::prepareModel or IDevice::preparedModelFromCache + * must return "const nn::Model*" from IPreparedModel::getUnderlyingResource(). + * + * This function uses a default executor, which will execute tasks from a detached thread. + * + * @param device NNAPI canonical IDevice interface object to be adapted. + * @return HIDL NN HAL IDevice interface object. + */ +sp adapt(nn::SharedDevice device); + +} // namespace android::hardware::neuralnetworks::adapter + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_ADAPTER_H diff --git a/neuralnetworks/utils/adapter/include/nnapi/hal/Buffer.h b/neuralnetworks/utils/adapter/include/nnapi/hal/Buffer.h new file mode 100644 index 0000000000..e53c7d4f09 --- /dev/null +++ b/neuralnetworks/utils/adapter/include/nnapi/hal/Buffer.h @@ -0,0 +1,46 @@ +/* + * 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 ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_BUFFER_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_BUFFER_H + +#include +#include +#include +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on HIDL interface +// lifetimes across processes and for protecting asynchronous calls across HIDL. + +namespace android::hardware::neuralnetworks::adapter { + +// Class that adapts nn::IBuffer to V1_3::IBuffer. +class Buffer final : public V1_3::IBuffer { + public: + explicit Buffer(nn::SharedBuffer buffer); + + Return copyTo(const hidl_memory& dst) override; + Return copyFrom(const hidl_memory& src, + const hidl_vec& dimensions) override; + + private: + const nn::SharedBuffer kBuffer; +}; + +} // namespace android::hardware::neuralnetworks::adapter + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_BUFFER_H diff --git a/neuralnetworks/utils/adapter/include/nnapi/hal/Device.h b/neuralnetworks/utils/adapter/include/nnapi/hal/Device.h new file mode 100644 index 0000000000..148d0a0341 --- /dev/null +++ b/neuralnetworks/utils/adapter/include/nnapi/hal/Device.h @@ -0,0 +1,96 @@ +/* + * 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 ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_DEVICE_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_DEVICE_H + +#include "nnapi/hal/Adapter.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on HIDL interface +// lifetimes across processes and for protecting asynchronous calls across HIDL. + +namespace android::hardware::neuralnetworks::adapter { + +using CacheToken = hidl_array; + +// Class that adapts nn::IDevice to V1_3::IDevice. +class Device final : public V1_3::IDevice { + public: + Device(nn::SharedDevice device, Executor executor); + + Return getCapabilities(getCapabilities_cb cb) override; + Return getCapabilities_1_1(getCapabilities_1_1_cb cb) override; + Return getCapabilities_1_2(getCapabilities_1_2_cb cb) override; + Return getCapabilities_1_3(getCapabilities_1_3_cb cb) override; + Return getVersionString(getVersionString_cb cb) override; + Return getType(getType_cb cb) override; + Return getSupportedExtensions(getSupportedExtensions_cb) override; + Return getSupportedOperations(const V1_0::Model& model, + getSupportedOperations_cb cb) override; + Return getSupportedOperations_1_1(const V1_1::Model& model, + getSupportedOperations_1_1_cb cb) override; + Return getSupportedOperations_1_2(const V1_2::Model& model, + getSupportedOperations_1_2_cb cb) override; + Return getSupportedOperations_1_3(const V1_3::Model& model, + getSupportedOperations_1_3_cb cb) override; + Return getNumberOfCacheFilesNeeded(getNumberOfCacheFilesNeeded_cb cb) override; + Return prepareModel( + const V1_0::Model& model, const sp& callback) override; + Return prepareModel_1_1( + const V1_1::Model& model, V1_1::ExecutionPreference preference, + const sp& callback) override; + Return prepareModel_1_2( + const V1_2::Model& model, V1_1::ExecutionPreference preference, + const hidl_vec& modelCache, const hidl_vec& dataCache, + const CacheToken& token, const sp& callback) override; + Return prepareModel_1_3( + const V1_3::Model& model, V1_1::ExecutionPreference preference, V1_3::Priority priority, + const V1_3::OptionalTimePoint& deadline, const hidl_vec& modelCache, + const hidl_vec& dataCache, const CacheToken& token, + const sp& callback) override; + Return prepareModelFromCache( + const hidl_vec& modelCache, const hidl_vec& dataCache, + const CacheToken& token, const sp& callback) override; + Return prepareModelFromCache_1_3( + const V1_3::OptionalTimePoint& deadline, const hidl_vec& modelCache, + const hidl_vec& dataCache, const CacheToken& token, + const sp& callback) override; + Return getStatus() override; + Return allocate(const V1_3::BufferDesc& desc, + const hidl_vec>& preparedModels, + const hidl_vec& inputRoles, + const hidl_vec& outputRoles, allocate_cb cb) override; + + private: + const nn::SharedDevice kDevice; + const Executor kExecutor; +}; + +} // namespace android::hardware::neuralnetworks::adapter + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_DEVICE_H diff --git a/neuralnetworks/utils/adapter/include/nnapi/hal/PreparedModel.h b/neuralnetworks/utils/adapter/include/nnapi/hal/PreparedModel.h new file mode 100644 index 0000000000..65763b8d19 --- /dev/null +++ b/neuralnetworks/utils/adapter/include/nnapi/hal/PreparedModel.h @@ -0,0 +1,79 @@ +/* + * 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 ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_PREPARED_MODEL_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_PREPARED_MODEL_H + +#include "nnapi/hal/Adapter.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on HIDL interface +// lifetimes across processes and for protecting asynchronous calls across HIDL. + +namespace android::hardware::neuralnetworks::adapter { + +// Class that adapts nn::IPreparedModel to V1_3::IPreparedModel. +class PreparedModel final : public V1_3::IPreparedModel { + public: + PreparedModel(nn::SharedPreparedModel preparedModel, Executor executor, uid_t userId); + + Return execute(const V1_0::Request& request, + const sp& callback) override; + Return execute_1_2(const V1_0::Request& request, V1_2::MeasureTiming measure, + const sp& callback) override; + Return execute_1_3(const V1_3::Request& request, V1_2::MeasureTiming measure, + const V1_3::OptionalTimePoint& deadline, + const V1_3::OptionalTimeoutDuration& loopTimeoutDuration, + const sp& callback) override; + Return executeSynchronously(const V1_0::Request& request, V1_2::MeasureTiming measure, + executeSynchronously_cb cb) override; + Return executeSynchronously_1_3(const V1_3::Request& request, V1_2::MeasureTiming measure, + const V1_3::OptionalTimePoint& deadline, + const V1_3::OptionalTimeoutDuration& loopTimeoutDuration, + executeSynchronously_1_3_cb cb) override; + Return configureExecutionBurst( + const sp& callback, + const MQDescriptorSync& requestChannel, + const MQDescriptorSync& resultChannel, + configureExecutionBurst_cb cb) override; + Return executeFenced(const V1_3::Request& request, const hidl_vec& waitFor, + V1_2::MeasureTiming measure, const V1_3::OptionalTimePoint& deadline, + const V1_3::OptionalTimeoutDuration& loopTimeoutDuration, + const V1_3::OptionalTimeoutDuration& duration, + executeFenced_cb callback) override; + + nn::SharedPreparedModel getUnderlyingPreparedModel() const; + + private: + const nn::SharedPreparedModel kPreparedModel; + const Executor kExecutor; + const uid_t kUserId; +}; + +} // namespace android::hardware::neuralnetworks::adapter + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_PREPARED_MODEL_H diff --git a/neuralnetworks/utils/adapter/src/Adapter.cpp b/neuralnetworks/utils/adapter/src/Adapter.cpp new file mode 100644 index 0000000000..d6f53f05a5 --- /dev/null +++ b/neuralnetworks/utils/adapter/src/Adapter.cpp @@ -0,0 +1,46 @@ +/* + * 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. + */ + +#include "Adapter.h" + +#include "Device.h" + +#include +#include +#include +#include + +#include +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on HIDL interface +// lifetimes across processes and for protecting asynchronous calls across HIDL. + +namespace android::hardware::neuralnetworks::adapter { + +sp adapt(nn::SharedDevice device, Executor executor) { + return sp::make(std::move(device), std::move(executor)); +} + +sp adapt(nn::SharedDevice device) { + Executor defaultExecutor = [](Task task, uid_t /*uid*/, nn::OptionalTimePoint /*deadline*/) { + std::thread(std::move(task)).detach(); + }; + return adapt(std::move(device), std::move(defaultExecutor)); +} + +} // namespace android::hardware::neuralnetworks::adapter diff --git a/neuralnetworks/utils/adapter/src/Buffer.cpp b/neuralnetworks/utils/adapter/src/Buffer.cpp new file mode 100644 index 0000000000..3a04bf6b79 --- /dev/null +++ b/neuralnetworks/utils/adapter/src/Buffer.cpp @@ -0,0 +1,83 @@ +/* + * 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. + */ + +#include "Buffer.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on HIDL interface +// lifetimes across processes and for protecting asynchronous calls across HIDL. + +namespace android::hardware::neuralnetworks::adapter { +namespace { + +template +auto convertInput(const Type& object) -> decltype(nn::convert(std::declval())) { + auto result = nn::convert(object); + if (!result.has_value()) { + result.error().code = nn::ErrorStatus::INVALID_ARGUMENT; + } + return result; +} + +nn::GeneralResult copyTo(const nn::SharedBuffer& buffer, const hidl_memory& dst) { + const auto memory = NN_TRY(convertInput(dst)); + NN_TRY(buffer->copyTo(memory)); + return {}; +} + +nn::GeneralResult copyFrom(const nn::SharedBuffer& buffer, const hidl_memory& src, + const hidl_vec& dimensions) { + const auto memory = NN_TRY(convertInput(src)); + NN_TRY(buffer->copyFrom(memory, dimensions)); + return {}; +} + +} // namespace + +Buffer::Buffer(nn::SharedBuffer buffer) : kBuffer(std::move(buffer)) { + CHECK(kBuffer != nullptr); +} + +Return Buffer::copyTo(const hidl_memory& dst) { + auto result = adapter::copyTo(kBuffer, dst); + if (!result.has_value()) { + const auto [message, code] = std::move(result).error(); + LOG(ERROR) << "adapter::Buffer::copyTo failed with " << code << ": " << message; + return V1_3::utils::convert(code).value(); + } + return V1_3::ErrorStatus::NONE; +} + +Return Buffer::copyFrom(const hidl_memory& src, + const hidl_vec& dimensions) { + auto result = adapter::copyFrom(kBuffer, src, dimensions); + if (!result.has_value()) { + const auto [message, code] = std::move(result).error(); + LOG(ERROR) << "adapter::Buffer::copyFrom failed with " << code << ": " << message; + return V1_3::utils::convert(code).value(); + } + return V1_3::ErrorStatus::NONE; +} + +} // namespace android::hardware::neuralnetworks::adapter diff --git a/neuralnetworks/utils/adapter/src/Device.cpp b/neuralnetworks/utils/adapter/src/Device.cpp new file mode 100644 index 0000000000..96142c3577 --- /dev/null +++ b/neuralnetworks/utils/adapter/src/Device.cpp @@ -0,0 +1,556 @@ +/* + * 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. + */ + +#include "Device.h" + +#include "Buffer.h" +#include "PreparedModel.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on HIDL interface +// lifetimes across processes and for protecting asynchronous calls across HIDL. + +namespace android::hardware::neuralnetworks::adapter { +namespace { + +template +auto convertInput(const Type& object) -> decltype(nn::convert(std::declval())) { + auto result = nn::convert(object); + if (!result.has_value()) { + result.error().code = nn::ErrorStatus::INVALID_ARGUMENT; + } + return result; +} + +using PrepareModelResult = nn::GeneralResult; + +sp adaptPreparedModel(nn::SharedPreparedModel preparedModel, Executor executor, + uid_t userId) { + if (preparedModel == nullptr) { + return nullptr; + } + return sp::make(std::move(preparedModel), std::move(executor), userId); +} + +void notify(V1_0::IPreparedModelCallback* callback, nn::ErrorStatus status, + const sp& hidlPreparedModel) { + if (callback != nullptr) { + const auto hidlStatus = V1_0::utils::convert(status).value(); + const auto ret = callback->notify(hidlStatus, hidlPreparedModel); + if (!ret.isOk()) { + LOG(ERROR) << "V1_0::IPreparedModelCallback::notify failed with " << ret.description(); + } + } +} + +void notify(V1_2::IPreparedModelCallback* callback, nn::ErrorStatus status, + const sp& hidlPreparedModel) { + if (callback != nullptr) { + const auto hidlStatus = V1_2::utils::convert(status).value(); + const auto ret = callback->notify_1_2(hidlStatus, hidlPreparedModel); + if (!ret.isOk()) { + LOG(ERROR) << "V1_2::IPreparedModelCallback::notify_1_2 failed with " + << ret.description(); + } + } +} + +void notify(V1_3::IPreparedModelCallback* callback, nn::ErrorStatus status, + const sp& hidlPreparedModel) { + if (callback != nullptr) { + const auto hidlStatus = V1_3::utils::convert(status).value(); + const auto ret = callback->notify_1_3(hidlStatus, hidlPreparedModel); + if (!ret.isOk()) { + LOG(ERROR) << "V1_3::IPreparedModelCallback::notify_1_3 failed with " + << ret.description(); + } + } +} + +template +void notify(CallbackType* callback, PrepareModelResult result, Executor executor, uid_t userId) { + if (!result.has_value()) { + const auto [message, status] = std::move(result).error(); + LOG(ERROR) << message; + notify(callback, status, nullptr); + } else { + auto preparedModel = std::move(result).value(); + auto hidlPreparedModel = + adaptPreparedModel(std::move(preparedModel), std::move(executor), userId); + notify(callback, nn::ErrorStatus::NONE, std::move(hidlPreparedModel)); + } +} + +template +nn::GeneralResult> getSupportedOperations(const nn::SharedDevice& device, + const ModelType& model) { + const auto nnModel = NN_TRY(convertInput(model)); + return NN_TRY(device->getSupportedOperations(nnModel)); +} + +nn::GeneralResult prepareModel(const nn::SharedDevice& device, const Executor& executor, + const V1_0::Model& model, + const sp& callback) { + if (callback.get() == nullptr) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) << "Invalid callback"; + } + + auto nnModel = NN_TRY(convertInput(model)); + + const uid_t userId = hardware::IPCThreadState::self()->getCallingUid(); + Task task = [device, nnModel = std::move(nnModel), userId, executor, callback] { + auto result = device->prepareModel(nnModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}); + notify(callback.get(), std::move(result), executor, userId); + }; + executor(std::move(task), userId, {}); + + return {}; +} + +nn::GeneralResult prepareModel_1_1(const nn::SharedDevice& device, const Executor& executor, + const V1_1::Model& model, + V1_1::ExecutionPreference preference, + const sp& callback) { + if (callback.get() == nullptr) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) << "Invalid callback"; + } + + auto nnModel = NN_TRY(convertInput(model)); + const auto nnPreference = NN_TRY(convertInput(preference)); + + const uid_t userId = hardware::IPCThreadState::self()->getCallingUid(); + Task task = [device, nnModel = std::move(nnModel), nnPreference, userId, executor, callback] { + auto result = + device->prepareModel(nnModel, nnPreference, nn::Priority::DEFAULT, {}, {}, {}, {}); + notify(callback.get(), std::move(result), executor, userId); + }; + executor(std::move(task), userId, {}); + + return {}; +} + +nn::GeneralResult prepareModel_1_2(const nn::SharedDevice& device, const Executor& executor, + const V1_2::Model& model, + V1_1::ExecutionPreference preference, + const hidl_vec& modelCache, + const hidl_vec& dataCache, + const CacheToken& token, + const sp& callback) { + if (callback.get() == nullptr) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) << "Invalid callback"; + } + + auto nnModel = NN_TRY(convertInput(model)); + const auto nnPreference = NN_TRY(convertInput(preference)); + auto nnModelCache = NN_TRY(convertInput(modelCache)); + auto nnDataCache = NN_TRY(convertInput(dataCache)); + const auto nnToken = nn::CacheToken(token); + + const uid_t userId = hardware::IPCThreadState::self()->getCallingUid(); + Task task = [device, nnModel = std::move(nnModel), nnPreference, + nnModelCache = std::move(nnModelCache), nnDataCache = std::move(nnDataCache), + nnToken, userId, executor, callback] { + auto result = device->prepareModel(nnModel, nnPreference, nn::Priority::DEFAULT, {}, + nnModelCache, nnDataCache, nnToken); + notify(callback.get(), std::move(result), executor, userId); + }; + executor(std::move(task), userId, {}); + + return {}; +} + +nn::GeneralResult prepareModel_1_3( + const nn::SharedDevice& device, const Executor& executor, const V1_3::Model& model, + V1_1::ExecutionPreference preference, V1_3::Priority priority, + const V1_3::OptionalTimePoint& deadline, const hidl_vec& modelCache, + const hidl_vec& dataCache, const CacheToken& token, + const sp& callback) { + if (callback.get() == nullptr) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) << "Invalid callback"; + } + + auto nnModel = NN_TRY(convertInput(model)); + const auto nnPreference = NN_TRY(convertInput(preference)); + const auto nnPriority = NN_TRY(convertInput(priority)); + const auto nnDeadline = NN_TRY(convertInput(deadline)); + auto nnModelCache = NN_TRY(convertInput(modelCache)); + auto nnDataCache = NN_TRY(convertInput(dataCache)); + const auto nnToken = nn::CacheToken(token); + + const uid_t userId = hardware::IPCThreadState::self()->getCallingUid(); + Task task = [device, nnModel = std::move(nnModel), nnPreference, nnPriority, nnDeadline, + nnModelCache = std::move(nnModelCache), nnDataCache = std::move(nnDataCache), + nnToken, userId, executor, callback] { + auto result = device->prepareModel(nnModel, nnPreference, nnPriority, nnDeadline, + nnModelCache, nnDataCache, nnToken); + notify(callback.get(), std::move(result), executor, userId); + }; + executor(std::move(task), userId, nnDeadline); + + return {}; +} + +nn::GeneralResult prepareModelFromCache(const nn::SharedDevice& device, + const Executor& executor, + const hidl_vec& modelCache, + const hidl_vec& dataCache, + const CacheToken& token, + const sp& callback) { + if (callback.get() == nullptr) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) << "Invalid callback"; + } + + auto nnModelCache = NN_TRY(convertInput(modelCache)); + auto nnDataCache = NN_TRY(convertInput(dataCache)); + const auto nnToken = nn::CacheToken(token); + + const uid_t userId = hardware::IPCThreadState::self()->getCallingUid(); + Task task = [device, nnModelCache = std::move(nnModelCache), + nnDataCache = std::move(nnDataCache), nnToken, userId, executor, callback] { + auto result = device->prepareModelFromCache({}, nnModelCache, nnDataCache, nnToken); + notify(callback.get(), std::move(result), executor, userId); + }; + executor(std::move(task), userId, {}); + + return {}; +} + +nn::GeneralResult prepareModelFromCache_1_3( + const nn::SharedDevice& device, const Executor& executor, + const V1_3::OptionalTimePoint& deadline, const hidl_vec& modelCache, + const hidl_vec& dataCache, const CacheToken& token, + const sp& callback) { + if (callback.get() == nullptr) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) << "Invalid callback"; + } + + const auto nnDeadline = NN_TRY(convertInput(deadline)); + auto nnModelCache = NN_TRY(convertInput(modelCache)); + auto nnDataCache = NN_TRY(convertInput(dataCache)); + const auto nnToken = nn::CacheToken(token); + + const uid_t userId = hardware::IPCThreadState::self()->getCallingUid(); + auto task = [device, nnDeadline, nnModelCache = std::move(nnModelCache), + nnDataCache = std::move(nnDataCache), nnToken, userId, executor, callback] { + auto result = device->prepareModelFromCache(nnDeadline, nnModelCache, nnDataCache, nnToken); + notify(callback.get(), std::move(result), executor, userId); + }; + executor(std::move(task), userId, nnDeadline); + + return {}; +} + +nn::GeneralResult downcast(const sp& preparedModel) { + if (preparedModel == nullptr) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) << "preparedModel is nullptr"; + } + if (preparedModel->isRemote()) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) << "Cannot convert remote models"; + } + + // This static_cast is safe because adapter::PreparedModel is the only class that implements + // the IPreparedModel interface in the adapter service code. + const auto* casted = static_cast(preparedModel.get()); + return casted->getUnderlyingPreparedModel(); +} + +nn::GeneralResult> downcastAll( + const hidl_vec>& preparedModels) { + std::vector canonical; + canonical.reserve(preparedModels.size()); + for (const auto& preparedModel : preparedModels) { + canonical.push_back(NN_TRY(downcast(preparedModel))); + } + return canonical; +} + +nn::GeneralResult, uint32_t>> allocate( + const nn::SharedDevice& device, const V1_3::BufferDesc& desc, + const hidl_vec>& preparedModels, + const hidl_vec& inputRoles, + const hidl_vec& outputRoles) { + auto nnDesc = NN_TRY(convertInput(desc)); + auto nnPreparedModels = NN_TRY(downcastAll(preparedModels)); + auto nnInputRoles = NN_TRY(convertInput(inputRoles)); + auto nnOutputRoles = NN_TRY(convertInput(outputRoles)); + + auto buffer = NN_TRY(device->allocate(nnDesc, nnPreparedModels, nnInputRoles, nnOutputRoles)); + + const nn::Request::MemoryDomainToken token = buffer->getToken(); + auto hidlBuffer = sp::make(std::move(buffer)); + return std::make_pair(std::move(hidlBuffer), static_cast(token)); +} + +} // namespace + +Device::Device(nn::SharedDevice device, Executor executor) + : kDevice(std::move(device)), kExecutor(std::move(executor)) { + CHECK(kDevice != nullptr); + CHECK(kExecutor != nullptr); +} + +Return Device::getCapabilities(getCapabilities_cb cb) { + const auto capabilities = V1_0::utils::convert(kDevice->getCapabilities()).value(); + cb(V1_0::ErrorStatus::NONE, capabilities); + return Void(); +} + +Return Device::getCapabilities_1_1(getCapabilities_1_1_cb cb) { + const auto capabilities = V1_1::utils::convert(kDevice->getCapabilities()).value(); + cb(V1_0::ErrorStatus::NONE, capabilities); + return Void(); +} + +Return Device::getCapabilities_1_2(getCapabilities_1_2_cb cb) { + const auto capabilities = V1_2::utils::convert(kDevice->getCapabilities()).value(); + cb(V1_0::ErrorStatus::NONE, capabilities); + return Void(); +} + +Return Device::getCapabilities_1_3(getCapabilities_1_3_cb cb) { + const auto capabilities = V1_3::utils::convert(kDevice->getCapabilities()).value(); + cb(V1_3::ErrorStatus::NONE, capabilities); + return Void(); +} + +Return Device::getVersionString(getVersionString_cb cb) { + cb(V1_0::ErrorStatus::NONE, kDevice->getVersionString()); + return Void(); +} + +Return Device::getType(getType_cb cb) { + const auto maybeDeviceType = V1_2::utils::convert(kDevice->getType()); + if (!maybeDeviceType.has_value()) { + const auto& [message, code] = maybeDeviceType.error(); + LOG(ERROR) << "adapter::Device::getType failed with " << code << ": " << message; + cb(V1_2::utils::convert(code).value(), {}); + } else { + cb(V1_0::ErrorStatus::NONE, maybeDeviceType.value()); + } + return Void(); +} + +Return Device::getSupportedExtensions(getSupportedExtensions_cb cb) { + const auto maybeSupportedExtensions = V1_2::utils::convert(kDevice->getSupportedExtensions()); + if (!maybeSupportedExtensions.has_value()) { + const auto& [message, code] = maybeSupportedExtensions.error(); + LOG(ERROR) << "adapter::Device::getSupportedExtensions failed with " << code << ": " + << message; + cb(V1_2::utils::convert(code).value(), {}); + } else { + cb(V1_0::ErrorStatus::NONE, maybeSupportedExtensions.value()); + } + return Void(); +} + +Return Device::getSupportedOperations(const V1_0::Model& model, + getSupportedOperations_cb cb) { + const auto result = adapter::getSupportedOperations(kDevice, model); + if (!result.has_value()) { + const auto& [message, code] = result.error(); + LOG(ERROR) << "adapter::Device::getSupportedOperations_1_0 failed with " << code << ": " + << message; + cb(V1_0::utils::convert(code).value(), {}); + } else { + cb(V1_0::ErrorStatus::NONE, result.value()); + } + return Void(); +} + +Return Device::getSupportedOperations_1_1(const V1_1::Model& model, + getSupportedOperations_1_1_cb cb) { + const auto result = adapter::getSupportedOperations(kDevice, model); + if (!result.has_value()) { + const auto& [message, code] = result.error(); + LOG(ERROR) << "adapter::Device::getSupportedOperations_1_1 failed with " << code << ": " + << message; + cb(V1_1::utils::convert(code).value(), {}); + } else { + cb(V1_0::ErrorStatus::NONE, result.value()); + } + return Void(); +} + +Return Device::getSupportedOperations_1_2(const V1_2::Model& model, + getSupportedOperations_1_2_cb cb) { + const auto result = adapter::getSupportedOperations(kDevice, model); + if (!result.has_value()) { + const auto& [message, code] = result.error(); + LOG(ERROR) << "adapter::Device::getSupportedOperations_1_2 failed with " << code << ": " + << message; + cb(V1_2::utils::convert(code).value(), {}); + } else { + cb(V1_0::ErrorStatus::NONE, result.value()); + } + return Void(); +} + +Return Device::getSupportedOperations_1_3(const V1_3::Model& model, + getSupportedOperations_1_3_cb cb) { + const auto result = adapter::getSupportedOperations(kDevice, model); + if (!result.has_value()) { + const auto& [message, code] = result.error(); + LOG(ERROR) << "adapter::Device::getSupportedOperations_1_3 failed with " << code << ": " + << message; + cb(V1_3::utils::convert(code).value(), {}); + } else { + cb(V1_3::ErrorStatus::NONE, result.value()); + } + return Void(); +} + +Return Device::getNumberOfCacheFilesNeeded(getNumberOfCacheFilesNeeded_cb cb) { + const auto [numModelCache, numDataCache] = kDevice->getNumberOfCacheFilesNeeded(); + cb(V1_0::ErrorStatus::NONE, numModelCache, numDataCache); + return Void(); +} + +Return Device::prepareModel(const V1_0::Model& model, + const sp& callback) { + auto result = adapter::prepareModel(kDevice, kExecutor, model, callback); + if (!result.has_value()) { + auto [message, code] = std::move(result).error(); + LOG(ERROR) << "adapter::Device::prepareModel failed with " << code << ": " << message; + notify(callback.get(), code, nullptr); + return V1_0::utils::convert(code).value(); + } + return V1_0::ErrorStatus::NONE; +} + +Return Device::prepareModel_1_1( + const V1_1::Model& model, V1_1::ExecutionPreference preference, + const sp& callback) { + auto result = adapter::prepareModel_1_1(kDevice, kExecutor, model, preference, callback); + if (!result.has_value()) { + auto [message, code] = std::move(result).error(); + LOG(ERROR) << "adapter::Device::prepareModel_1_1 failed with " << code << ": " << message; + notify(callback.get(), code, nullptr); + return V1_1::utils::convert(code).value(); + } + return V1_0::ErrorStatus::NONE; +} + +Return Device::prepareModel_1_2( + const V1_2::Model& model, V1_1::ExecutionPreference preference, + const hidl_vec& modelCache, const hidl_vec& dataCache, + const CacheToken& token, const sp& callback) { + auto result = adapter::prepareModel_1_2(kDevice, kExecutor, model, preference, modelCache, + dataCache, token, callback); + if (!result.has_value()) { + auto [message, code] = std::move(result).error(); + LOG(ERROR) << "adapter::Device::prepareModel_1_2 failed with " << code << ": " << message; + notify(callback.get(), code, nullptr); + return V1_2::utils::convert(code).value(); + } + return V1_0::ErrorStatus::NONE; +} + +Return Device::prepareModel_1_3( + const V1_3::Model& model, V1_1::ExecutionPreference preference, V1_3::Priority priority, + const V1_3::OptionalTimePoint& deadline, const hidl_vec& modelCache, + const hidl_vec& dataCache, const CacheToken& token, + const sp& callback) { + auto result = adapter::prepareModel_1_3(kDevice, kExecutor, model, preference, priority, + deadline, modelCache, dataCache, token, callback); + if (!result.has_value()) { + auto [message, code] = std::move(result).error(); + LOG(ERROR) << "adapter::Device::prepareModel_1_3 failed with " << code << ": " << message; + notify(callback.get(), code, nullptr); + return V1_3::utils::convert(code).value(); + } + return V1_3::ErrorStatus::NONE; +} + +Return Device::prepareModelFromCache( + const hidl_vec& modelCache, const hidl_vec& dataCache, + const CacheToken& token, const sp& callback) { + auto result = adapter::prepareModelFromCache(kDevice, kExecutor, modelCache, dataCache, token, + callback); + if (!result.has_value()) { + auto [message, code] = std::move(result).error(); + LOG(ERROR) << "adapter::Device::prepareModelFromCache failed with " << code << ": " + << message; + notify(callback.get(), code, nullptr); + return V1_2::utils::convert(code).value(); + } + return V1_0::ErrorStatus::NONE; +} + +Return Device::prepareModelFromCache_1_3( + const V1_3::OptionalTimePoint& deadline, const hidl_vec& modelCache, + const hidl_vec& dataCache, const CacheToken& token, + const sp& callback) { + auto result = adapter::prepareModelFromCache_1_3(kDevice, kExecutor, deadline, modelCache, + dataCache, token, callback); + if (!result.has_value()) { + auto [message, code] = std::move(result).error(); + LOG(ERROR) << "adapter::Device::prepareModelFromCache_1_3 failed with " << code << ": " + << message; + notify(callback.get(), code, nullptr); + return V1_3::utils::convert(code).value(); + } + return V1_3::ErrorStatus::NONE; +} + +Return Device::getStatus() { + return V1_0::DeviceStatus::AVAILABLE; +} + +Return Device::allocate(const V1_3::BufferDesc& desc, + const hidl_vec>& preparedModels, + const hidl_vec& inputRoles, + const hidl_vec& outputRoles, allocate_cb cb) { + auto result = adapter::allocate(kDevice, desc, preparedModels, inputRoles, outputRoles); + if (!result.has_value()) { + const auto [message, code] = std::move(result).error(); + LOG(ERROR) << "adapter::Device::allocate failed with " << code << ": " << message; + cb(V1_3::utils::convert(code).value(), nullptr, /*token=*/0); + return Void(); + } + auto [buffer, token] = std::move(result).value(); + cb(V1_3::ErrorStatus::NONE, buffer, token); + return Void(); +} + +} // namespace android::hardware::neuralnetworks::adapter diff --git a/neuralnetworks/utils/adapter/src/PreparedModel.cpp b/neuralnetworks/utils/adapter/src/PreparedModel.cpp new file mode 100644 index 0000000000..8968c2cc91 --- /dev/null +++ b/neuralnetworks/utils/adapter/src/PreparedModel.cpp @@ -0,0 +1,417 @@ +/* + * 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. + */ + +#include "PreparedModel.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on HIDL interface +// lifetimes across processes and for protecting asynchronous calls across HIDL. + +namespace android::hardware::neuralnetworks::adapter { +namespace { + +template +auto convertInput(const Type& object) -> decltype(nn::convert(std::declval())) { + auto result = nn::convert(object); + if (!result.has_value()) { + result.error().code = nn::ErrorStatus::INVALID_ARGUMENT; + } + return result; +} + +class FencedExecutionCallback final : public V1_3::IFencedExecutionCallback { + public: + explicit FencedExecutionCallback(const nn::ExecuteFencedInfoCallback& callback) + : kCallback(callback) { + CHECK(callback != nullptr); + } + + Return getExecutionInfo(getExecutionInfo_cb cb) override { + const auto result = kCallback(); + if (!result.has_value()) { + const auto& [message, code] = result.error(); + const auto status = + V1_3::utils::convert(code).value_or(V1_3::ErrorStatus::GENERAL_FAILURE); + LOG(ERROR) << message; + cb(status, V1_2::utils::kNoTiming, V1_2::utils::kNoTiming); + return Void(); + } + const auto [timingLaunched, timingFenced] = result.value(); + const auto hidlTimingLaunched = V1_3::utils::convert(timingLaunched).value(); + const auto hidlTimingFenced = V1_3::utils::convert(timingFenced).value(); + cb(V1_3::ErrorStatus::NONE, hidlTimingLaunched, hidlTimingFenced); + return Void(); + } + + private: + const nn::ExecuteFencedInfoCallback kCallback; +}; + +using ExecutionResult = nn::ExecutionResult, nn::Timing>>; + +void notify(V1_0::IExecutionCallback* callback, nn::ErrorStatus status, + const std::vector& /*outputShapes*/, const nn::Timing& /*timing*/) { + if (callback != nullptr) { + const auto hidlStatus = V1_0::utils::convert(status).value(); + const auto ret = callback->notify(hidlStatus); + if (!ret.isOk()) { + LOG(ERROR) << "V1_0::IExecutionCallback::notify failed with " << ret.description(); + } + } +} + +void notify(V1_2::IExecutionCallback* callback, nn::ErrorStatus status, + const std::vector& outputShapes, const nn::Timing& timing) { + if (callback != nullptr) { + const auto hidlStatus = V1_2::utils::convert(status).value(); + const auto hidlOutputShapes = V1_2::utils::convert(outputShapes).value(); + const auto hidlTiming = V1_2::utils::convert(timing).value(); + const auto ret = callback->notify_1_2(hidlStatus, hidlOutputShapes, hidlTiming); + if (!ret.isOk()) { + LOG(ERROR) << "V1_2::IExecutionCallback::notify_1_2 failed with " << ret.description(); + } + } +} + +void notify(V1_3::IExecutionCallback* callback, nn::ErrorStatus status, + const std::vector& outputShapes, const nn::Timing& timing) { + if (callback != nullptr) { + const auto hidlStatus = V1_3::utils::convert(status).value(); + const auto hidlOutputShapes = V1_3::utils::convert(outputShapes).value(); + const auto hidlTiming = V1_3::utils::convert(timing).value(); + const auto ret = callback->notify_1_3(hidlStatus, hidlOutputShapes, hidlTiming); + if (!ret.isOk()) { + LOG(ERROR) << "V1_3::IExecutionCallback::notify_1_3 failed with " << ret.description(); + } + } +} + +template +void notify(CallbackType* callback, ExecutionResult result) { + if (!result.has_value()) { + const auto [message, status, outputShapes] = std::move(result).error(); + LOG(ERROR) << message; + notify(callback, status, outputShapes, {}); + } else { + const auto [outputShapes, timing] = std::move(result).value(); + notify(callback, nn::ErrorStatus::NONE, outputShapes, timing); + } +} + +nn::GeneralResult execute(const nn::SharedPreparedModel& preparedModel, uid_t userId, + const Executor& executor, const V1_0::Request& request, + const sp& callback) { + if (callback.get() == nullptr) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) << "Invalid callback"; + } + + auto nnRequest = NN_TRY(convertInput(request)); + + const std::any resource = preparedModel->getUnderlyingResource(); + if (const auto* model = std::any_cast(&resource)) { + CHECK(*model != nullptr); + NN_TRY(utils::makeGeneralFailure(nn::validateRequestForModel(nnRequest, **model), + nn::ErrorStatus::INVALID_ARGUMENT)); + } + + Task task = [preparedModel, nnRequest = std::move(nnRequest), callback] { + auto result = preparedModel->execute(nnRequest, nn::MeasureTiming::NO, {}, {}); + notify(callback.get(), std::move(result)); + }; + executor(std::move(task), userId, {}); + + return {}; +} + +nn::GeneralResult execute_1_2(const nn::SharedPreparedModel& preparedModel, uid_t userId, + const Executor& executor, const V1_0::Request& request, + V1_2::MeasureTiming measure, + const sp& callback) { + if (callback.get() == nullptr) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) << "Invalid callback"; + } + + auto nnRequest = NN_TRY(convertInput(request)); + const auto nnMeasure = NN_TRY(convertInput(measure)); + + const std::any resource = preparedModel->getUnderlyingResource(); + if (const auto* model = std::any_cast(&resource)) { + CHECK(*model != nullptr); + NN_TRY(utils::makeGeneralFailure(nn::validateRequestForModel(nnRequest, **model), + nn::ErrorStatus::INVALID_ARGUMENT)); + } + + Task task = [preparedModel, nnRequest = std::move(nnRequest), nnMeasure, callback] { + auto result = preparedModel->execute(nnRequest, nnMeasure, {}, {}); + notify(callback.get(), std::move(result)); + }; + executor(std::move(task), userId, {}); + + return {}; +} + +nn::GeneralResult execute_1_3(const nn::SharedPreparedModel& preparedModel, uid_t userId, + const Executor& executor, const V1_3::Request& request, + V1_2::MeasureTiming measure, + const V1_3::OptionalTimePoint& deadline, + const V1_3::OptionalTimeoutDuration& loopTimeoutDuration, + const sp& callback) { + if (callback.get() == nullptr) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) << "Invalid callback"; + } + + auto nnRequest = NN_TRY(convertInput(request)); + const auto nnMeasure = NN_TRY(convertInput(measure)); + const auto nnDeadline = NN_TRY(convertInput(deadline)); + const auto nnLoopTimeoutDuration = NN_TRY(convertInput(loopTimeoutDuration)); + + const std::any resource = preparedModel->getUnderlyingResource(); + if (const auto* model = std::any_cast(&resource)) { + CHECK(*model != nullptr); + NN_TRY(utils::makeGeneralFailure(nn::validateRequestForModel(nnRequest, **model), + nn::ErrorStatus::INVALID_ARGUMENT)); + } + + Task task = [preparedModel, nnRequest = std::move(nnRequest), nnMeasure, nnDeadline, + nnLoopTimeoutDuration, callback] { + auto result = + preparedModel->execute(nnRequest, nnMeasure, nnDeadline, nnLoopTimeoutDuration); + notify(callback.get(), std::move(result)); + }; + executor(std::move(task), userId, nnDeadline); + + return {}; +} + +nn::ExecutionResult, V1_2::Timing>> executeSynchronously( + const nn::SharedPreparedModel& preparedModel, const V1_0::Request& request, + V1_2::MeasureTiming measure) { + const auto nnRequest = NN_TRY(utils::makeExecutionFailure(convertInput(request))); + const auto nnMeasure = NN_TRY(utils::makeExecutionFailure(convertInput(measure))); + + const auto [outputShapes, timing] = + NN_TRY(preparedModel->execute(nnRequest, nnMeasure, {}, {})); + + auto hidlOutputShapes = NN_TRY(utils::makeExecutionFailure(V1_2::utils::convert(outputShapes))); + const auto hidlTiming = NN_TRY(utils::makeExecutionFailure(V1_2::utils::convert(timing))); + return std::make_pair(std::move(hidlOutputShapes), hidlTiming); +} + +nn::ExecutionResult, V1_2::Timing>> executeSynchronously_1_3( + const nn::SharedPreparedModel& preparedModel, const V1_3::Request& request, + V1_2::MeasureTiming measure, const V1_3::OptionalTimePoint& deadline, + const V1_3::OptionalTimeoutDuration& loopTimeoutDuration) { + const auto nnRequest = NN_TRY(utils::makeExecutionFailure(convertInput(request))); + const auto nnMeasure = NN_TRY(utils::makeExecutionFailure(convertInput(measure))); + const auto nnDeadline = NN_TRY(utils::makeExecutionFailure(convertInput(deadline))); + const auto nnLoopTimeoutDuration = + NN_TRY(utils::makeExecutionFailure(convertInput(loopTimeoutDuration))); + + const auto [outputShapes, timing] = + NN_TRY(preparedModel->execute(nnRequest, nnMeasure, nnDeadline, nnLoopTimeoutDuration)); + + auto hidlOutputShapes = NN_TRY(utils::makeExecutionFailure(V1_3::utils::convert(outputShapes))); + const auto hidlTiming = NN_TRY(utils::makeExecutionFailure(V1_3::utils::convert(timing))); + return std::make_pair(std::move(hidlOutputShapes), hidlTiming); +} + +nn::GeneralResult> convertSyncFences( + const hidl_vec& handles) { + std::vector syncFences; + syncFences.reserve(handles.size()); + for (const auto& handle : handles) { + auto nativeHandle = NN_TRY(convertInput(handle)); + auto syncFence = NN_TRY(utils::makeGeneralFailure( + nn::SyncFence::create(std::move(nativeHandle)), nn::ErrorStatus::INVALID_ARGUMENT)); + syncFences.push_back(std::move(syncFence)); + } + return syncFences; +} + +nn::GeneralResult>> executeFenced( + const nn::SharedPreparedModel& preparedModel, const V1_3::Request& request, + const hidl_vec& waitFor, V1_2::MeasureTiming measure, + const V1_3::OptionalTimePoint& deadline, + const V1_3::OptionalTimeoutDuration& loopTimeoutDuration, + const V1_3::OptionalTimeoutDuration& duration) { + const auto nnRequest = NN_TRY(convertInput(request)); + const auto nnWaitFor = NN_TRY(convertSyncFences(waitFor)); + const auto nnMeasure = NN_TRY(convertInput(measure)); + const auto nnDeadline = NN_TRY(convertInput(deadline)); + const auto nnLoopTimeoutDuration = NN_TRY(convertInput(loopTimeoutDuration)); + const auto nnDuration = NN_TRY(convertInput(duration)); + + auto [syncFence, executeFencedCallback] = NN_TRY(preparedModel->executeFenced( + nnRequest, nnWaitFor, nnMeasure, nnDeadline, nnLoopTimeoutDuration, nnDuration)); + + auto hidlSyncFence = NN_TRY(V1_3::utils::convert(syncFence.getSharedHandle())); + auto hidlExecuteFencedCallback = sp::make(executeFencedCallback); + return std::make_pair(std::move(hidlSyncFence), std::move(hidlExecuteFencedCallback)); +} + +} // namespace + +PreparedModel::PreparedModel(nn::SharedPreparedModel preparedModel, Executor executor, uid_t userId) + : kPreparedModel(std::move(preparedModel)), kExecutor(std::move(executor)), kUserId(userId) { + CHECK(kPreparedModel != nullptr); + CHECK(kExecutor != nullptr); +} + +nn::SharedPreparedModel PreparedModel::getUnderlyingPreparedModel() const { + return kPreparedModel; +} + +Return PreparedModel::execute(const V1_0::Request& request, + const sp& callback) { + auto result = adapter::execute(kPreparedModel, kUserId, kExecutor, request, callback); + if (!result.has_value()) { + auto [message, code] = std::move(result).error(); + LOG(ERROR) << "adapter::PreparedModel::execute failed with " << code << ": " << message; + notify(callback.get(), code, {}, {}); + return V1_0::utils::convert(code).value(); + } + return V1_0::ErrorStatus::NONE; +} + +Return PreparedModel::execute_1_2(const V1_0::Request& request, + V1_2::MeasureTiming measure, + const sp& callback) { + auto result = + adapter::execute_1_2(kPreparedModel, kUserId, kExecutor, request, measure, callback); + if (!result.has_value()) { + auto [message, code] = std::move(result).error(); + LOG(ERROR) << "adapter::PreparedModel::execute_1_2 failed with " << code << ": " << message; + notify(callback.get(), code, {}, {}); + return V1_2::utils::convert(code).value(); + } + return V1_0::ErrorStatus::NONE; +} + +Return PreparedModel::execute_1_3( + const V1_3::Request& request, V1_2::MeasureTiming measure, + const V1_3::OptionalTimePoint& deadline, + const V1_3::OptionalTimeoutDuration& loopTimeoutDuration, + const sp& callback) { + auto result = adapter::execute_1_3(kPreparedModel, kUserId, kExecutor, request, measure, + deadline, loopTimeoutDuration, callback); + if (!result.has_value()) { + auto [message, code] = std::move(result).error(); + LOG(ERROR) << "adapter::PreparedModel::execute_1_3 failed with " << code << ": " << message; + notify(callback.get(), code, {}, {}); + return V1_3::utils::convert(code).value(); + } + return V1_3::ErrorStatus::NONE; +} + +Return PreparedModel::executeSynchronously(const V1_0::Request& request, + V1_2::MeasureTiming measure, + executeSynchronously_cb cb) { + auto result = adapter::executeSynchronously(kPreparedModel, request, measure); + if (!result.has_value()) { + auto [message, code, outputShapes] = std::move(result).error(); + LOG(ERROR) << "adapter::PreparedModel::executeSynchronously failed with " << code << ": " + << message; + cb(V1_2::utils::convert(code).value(), V1_2::utils::convert(outputShapes).value(), + V1_2::utils::kNoTiming); + return Void(); + } + auto [outputShapes, timing] = std::move(result).value(); + cb(V1_0::ErrorStatus::NONE, outputShapes, timing); + return Void(); +} + +Return PreparedModel::executeSynchronously_1_3( + const V1_3::Request& request, V1_2::MeasureTiming measure, + const V1_3::OptionalTimePoint& deadline, + const V1_3::OptionalTimeoutDuration& loopTimeoutDuration, executeSynchronously_1_3_cb cb) { + auto result = adapter::executeSynchronously_1_3(kPreparedModel, request, measure, deadline, + loopTimeoutDuration); + if (!result.has_value()) { + auto [message, code, outputShapes] = std::move(result).error(); + LOG(ERROR) << "adapter::PreparedModel::executeSynchronously_1_3 failed with " << code + << ": " << message; + cb(V1_3::utils::convert(code).value(), V1_3::utils::convert(outputShapes).value(), + V1_2::utils::kNoTiming); + return Void(); + } + auto [outputShapes, timing] = std::move(result).value(); + cb(V1_3::ErrorStatus::NONE, outputShapes, timing); + return Void(); +} + +Return PreparedModel::configureExecutionBurst( + const sp& callback, + const MQDescriptorSync& requestChannel, + const MQDescriptorSync& resultChannel, + configureExecutionBurst_cb cb) { + const sp burst = nn::ExecutionBurstServer::create( + callback, requestChannel, resultChannel, this, std::chrono::microseconds{0}); + + if (burst == nullptr) { + cb(V1_0::ErrorStatus::GENERAL_FAILURE, {}); + } else { + cb(V1_0::ErrorStatus::NONE, burst); + } + return Void(); +} + +Return PreparedModel::executeFenced(const V1_3::Request& request, + const hidl_vec& waitFor, + V1_2::MeasureTiming measure, + const V1_3::OptionalTimePoint& deadline, + const V1_3::OptionalTimeoutDuration& loopTimeoutDuration, + const V1_3::OptionalTimeoutDuration& duration, + executeFenced_cb callback) { + auto result = adapter::executeFenced(kPreparedModel, request, waitFor, measure, deadline, + loopTimeoutDuration, duration); + if (!result.has_value()) { + auto [message, code] = std::move(result).error(); + LOG(ERROR) << "adapter::PreparedModel::executeFenced failed with " << code << ": " + << message; + callback(V1_3::utils::convert(code).value(), {}, nullptr); + return Void(); + } + auto [syncFence, executeFencedCallback] = std::move(result).value(); + callback(V1_3::ErrorStatus::NONE, syncFence, executeFencedCallback); + return Void(); +} + +} // namespace android::hardware::neuralnetworks::adapter -- GitLab From e55db240a6e08311b550922af2c2540a1473d5f0 Mon Sep 17 00:00:00 2001 From: Edwin Wong Date: Tue, 2 Feb 2021 22:28:41 -0800 Subject: [PATCH 018/825] Fix potential decrypt destPtr overflow. There is a potential integer overflow to bypass the destination base size check in decrypt. The destPtr can then point to the outside of the destination buffer. Test: sts-tradefed sts-tradefed run sts-engbuild-no-spl-lock -m StsHostTestCases --test android.security.sts.Bug_176444622#testPocBug_176444622 Test: push to device with target_hwasan-userdebug build adb shell /data/local/tmp/Bug-17644462264 Bug: 176444622 Bug: 176496353 Change-Id: I63043d10796f82ad805038ba1fad5bd7d5c89961 --- drm/1.0/default/CryptoPlugin.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drm/1.0/default/CryptoPlugin.cpp b/drm/1.0/default/CryptoPlugin.cpp index e6d4e8447b..17a2f241b4 100644 --- a/drm/1.0/default/CryptoPlugin.cpp +++ b/drm/1.0/default/CryptoPlugin.cpp @@ -79,7 +79,7 @@ namespace implementation { } } - android::CryptoPlugin::Mode legacyMode; + android::CryptoPlugin::Mode legacyMode = android::CryptoPlugin::kMode_Unencrypted; switch(mode) { case Mode::UNENCRYPTED: legacyMode = android::CryptoPlugin::kMode_Unencrypted; @@ -146,7 +146,10 @@ namespace implementation { return Void(); } - if (destBuffer.offset + destBuffer.size > destBase->getSize()) { + size_t totalSize = 0; + if (__builtin_add_overflow(destBuffer.offset, destBuffer.size, &totalSize) || + totalSize > destBase->getSize()) { + android_errorWriteLog(0x534e4554, "176496353"); _hidl_cb(Status::ERROR_DRM_CANNOT_HANDLE, 0, "invalid buffer size"); return Void(); } @@ -157,7 +160,7 @@ namespace implementation { } base = static_cast(static_cast(destBase->getPointer())); - destPtr = static_cast(base + destination.nonsecureMemory.offset); + destPtr = static_cast(base + destination.nonsecureMemory.offset); } else if (destination.type == BufferType::NATIVE_HANDLE) { if (!secure) { _hidl_cb(Status::BAD_VALUE, 0, "native handle destination must be secure"); -- GitLab From b479e5704ac2a5b2b7293ab44ac5f1bd1d4d6b8e Mon Sep 17 00:00:00 2001 From: Kai Date: Wed, 9 Dec 2020 22:01:20 -0800 Subject: [PATCH 019/825] Add EVS_SERVICE_REQUEST property Add EVS_SERVICE_REQUEST property to let android trigger the EVS service Bug: 173759534 Test: check the property in KitchenSink Change-Id: I219eecadfea1ca5fca281d51bd9bc45589e5b9ef --- .../default/impl/vhal_v2_0/DefaultConfig.h | 9 ++++ automotive/vehicle/2.0/types.hal | 50 +++++++++++++++++++ 2 files changed, 59 insertions(+) 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 73513f4e4c..5915a53c03 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 @@ -996,6 +996,15 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, + {.config = + { + .prop = toInt(VehicleProperty::EVS_SERVICE_REQUEST), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {toInt(EvsServiceType::REARVIEW), + toInt(EvsServiceState::OFF)}}}, + {.config = {.prop = VEHICLE_MAP_SERVICE, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE}}, diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal index e3fd16de57..0eb73a7a9e 100644 --- a/automotive/vehicle/2.0/types.hal +++ b/automotive/vehicle/2.0/types.hal @@ -2926,6 +2926,29 @@ enum VehicleProperty : int32_t { | VehiclePropertyType:MIXED | VehicleArea:GLOBAL), + /** + * Enable/request an EVS service. + * + * The property provides a generalized way to trigger EVS services. VHAL + * should use this property to request Android to start or stop EVS service. + * + * int32Values[0] = a type of the EVS service. The value must be one of enums in + * EvsServiceType. + * int32Values[1] = the state of the EVS service. The value must be one of enums in + * EvsServiceState. + * + * For example, to enable rear view EVS service, android side can set the property value as + * [EvsServiceType::REAR_VIEW, EvsServiceState::ON]. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + EVS_SERVICE_REQUEST = ( + 0x0F10 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32_VEC + | VehicleArea:GLOBAL), + /** * Defines a request to apply power policy. * @@ -3212,6 +3235,33 @@ enum VehicleSeatOccupancyState : int32_t { OCCUPIED = 2 }; +/** + * Used by EVS_SERVICE_REQUEST to enumerate the service's type. + */ +enum EvsServiceType : int32_t { + + REARVIEW = 0, + SURROUNDVIEW = 1, +}; + +/** + * Used by EVS_SERVICE_REQUEST to enumerate the service's state. + */ +enum EvsServiceState : int32_t { + + OFF = 0, + ON = 1, +}; + +/** + * Index in int32VAlues for VehicleProperty#EVS_SERVICE_REQUEST property. + */ +enum EvsServiceRequestIndex : int32_t { + + TYPE = 0, + STATE = 1, +}; + /** * Used by lights state properties to enumerate the current state of the lights. * -- GitLab From 83578e05ddaa5aff5b1aedf7fe80ba5ded4f436c Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Wed, 3 Mar 2021 14:26:55 +0000 Subject: [PATCH 020/825] Remove myself from owners Change-Id: I9202c680e627ce5ac471078a7db2d6b9d7f950d8 --- audio/common/all-versions/default/OWNERS | 1 - 1 file changed, 1 deletion(-) diff --git a/audio/common/all-versions/default/OWNERS b/audio/common/all-versions/default/OWNERS index 6fdc97ca29..24071af220 100644 --- a/audio/common/all-versions/default/OWNERS +++ b/audio/common/all-versions/default/OWNERS @@ -1,3 +1,2 @@ elaurent@google.com -krocard@google.com mnaganov@google.com -- GitLab From a2cd51a0b9af63550c53bce42f3ee4289328808d Mon Sep 17 00:00:00 2001 From: Ytai Ben-Tsvi Date: Mon, 25 Jan 2021 16:56:25 -0800 Subject: [PATCH 021/825] STHAL 2.4 This version of the soundtrigger HAL adds support for dynamic resource management by the HAL, allowing it to refuse to start/load and to preemptively stop/unload models at its discretion. This give the HAL more freedom to make resource allocation decisions and avoids the need to precisely model the various constraints and have them enforced by the framework. Bug: 178722883 Change-Id: I58807407417fc099b7538e685309d2c846ed66fd --- .../compatibility_matrix.current.xml | 2 +- soundtrigger/2.4/Android.bp | 21 ++ soundtrigger/2.4/ISoundTriggerHw.hal | 190 ++++++++++++++++++ soundtrigger/2.4/ISoundTriggerHwCallback.hal | 34 ++++ .../2.4/ISoundTriggerHwGlobalCallback.hal | 32 +++ soundtrigger/2.4/vts/functional/Android.bp | 32 +++ .../VtsHalSoundtriggerV2_4TargetTest.cpp | 84 ++++++++ 7 files changed, 394 insertions(+), 1 deletion(-) create mode 100644 soundtrigger/2.4/Android.bp create mode 100644 soundtrigger/2.4/ISoundTriggerHw.hal create mode 100644 soundtrigger/2.4/ISoundTriggerHwCallback.hal create mode 100644 soundtrigger/2.4/ISoundTriggerHwGlobalCallback.hal create mode 100644 soundtrigger/2.4/vts/functional/Android.bp create mode 100644 soundtrigger/2.4/vts/functional/VtsHalSoundtriggerV2_4TargetTest.cpp diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 6562f2282f..08e28ea597 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -529,7 +529,7 @@ android.hardware.soundtrigger - 2.3 + 2.3-4 ISoundTriggerHw default diff --git a/soundtrigger/2.4/Android.bp b/soundtrigger/2.4/Android.bp new file mode 100644 index 0000000000..38c32dff73 --- /dev/null +++ b/soundtrigger/2.4/Android.bp @@ -0,0 +1,21 @@ +// This file is autogenerated by hidl-gen -Landroidbp. + +hidl_interface { + name: "android.hardware.soundtrigger@2.4", + root: "android.hardware", + srcs: [ + "ISoundTriggerHw.hal", + "ISoundTriggerHwCallback.hal", + "ISoundTriggerHwGlobalCallback.hal", + ], + interfaces: [ + "android.hardware.audio.common@2.0", + "android.hardware.soundtrigger@2.0", + "android.hardware.soundtrigger@2.1", + "android.hardware.soundtrigger@2.2", + "android.hardware.soundtrigger@2.3", + "android.hidl.base@1.0", + "android.hidl.safe_union@1.0", + ], + gen_java: true, +} diff --git a/soundtrigger/2.4/ISoundTriggerHw.hal b/soundtrigger/2.4/ISoundTriggerHw.hal new file mode 100644 index 0000000000..fd393036d8 --- /dev/null +++ b/soundtrigger/2.4/ISoundTriggerHw.hal @@ -0,0 +1,190 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.soundtrigger@2.4; + +import @2.0::SoundModelHandle; +import @2.1::ISoundTriggerHw.SoundModel; +import @2.1::ISoundTriggerHw.PhraseSoundModel; +import @2.3::ISoundTriggerHw; +import @2.3::RecognitionConfig; +import ISoundTriggerHwCallback; +import ISoundTriggerHwGlobalCallback; + +/** + * SoundTrigger HAL interface. Used for hardware recognition of hotwords + * and other sounds. + * + * Important notes about the threading model: + * ========================================== + * Both this interface and the corresponding callback interface use a synchronized calling + * convention. This model comes with some advantages, but also with some risks of deadlocks if the + * implementation does not handle this correctly. Please consider the following: + * - After stopRecognition() returns no more recognition events for that model may be sent. This + * implies that any queues holding such events must be flushed before the call returns and that + * may imply that callback from the HAL to the client are done while stopRecognition() is blocked. + * This is OK, and supported by the framework. + * - Similarly, the same relationship applies between unloadModel() and subsequent callbacks to + * modelUnloaded(). + * - Other than these two cases, calls into the HAL *MAY NOT* block on callbacks from the HAL, or + * else deadlock conditions may result, which may be handled by rebooting of the HAL process and + * cause service outages. + * + * Similarly, it is expected that a single call to startRecognition() generates at most one event + * (the model automatically becomes stopped when the event occurs, until explicitly started again) + * and that after a modelUnloaded() event no more events would be sent regarding the model. + * Note that a getModelState() call may generate a recognition event, but this event DOES NOT modify + * the model state - the model remains started. + * + * The HAL is expected to correctly handle a stopRecognition() call even after it sent an event + * indicating that recognition is stopped and an unloadModel() call even after it sent an event + * indicating that it has been unloaded. This is required in order to prevent race conditions + * between these calls. This also implies that model handles should generally not be reused until + * explicitly unloaded. To avoid the rare possibility of running out of handles, the framework will + * call unloadModel() on models that have been preemptively unloaded by the HAL. + * + * Due to the asynchronous nature of recognition events and preemptive model unloading, the HAL must + * correctly handle requests that would have been valid before an event has been delivered, but + * became moot as result of the event. Namely: + * - stopRecognition() may be called on a model that has already delivered an event and became + * inactive as a result. The HAL must return a successful return code in this case. + * - Furthermore, if a model is preemptively unloaded after it triggers (typically, this would + * happen when it is first aborted and immediately preemptively unloaded), stopRecognition() may + * be called on it. The HAL must return a successful return code in this case. + * - startRecognition() may be called on a model that has been preemptively unloaded. In this case, + * the HAL must return -EBUSY to indicate that the operation is temporarily unsuccessful. + * - unloadSoundModel() may be called on a model that has been preemptively unloaded. The HAL must + * return a successful return code in this case. + * + * Important notes about resource constraints and concurrency + * ========================================================= + * Up until this version, the framework would enforce concurrency constraints expressed by the + * Properties presented by the soundtrigger instance. These include constraints on the maximum + * amount of models that can be loaded at the same time and on running recognition while capturing + * from the microphone. + * This version changes the approach for how these constraints are modeled, both offering the HAL + * implementation more flexibility and simplifying the framework's job in enforcing these + * limitations. Note that there is no change for how the framework behaves with earlier versions, + * everything described below only applies to this version and onward. + * The way this is achieved is as following: + * - The framework will no longer enforce constraints on concurrent loading of models, as expressed + * in the Properties.maxSoundModels field (this property is merely a hint at this point and may be + * deprecated in the future. + * - The framework will no longer enforce constraints on concurrency of audio recording and + * soundtrigger operation, as expressed in the Properties.concurrentCapture field (this property + * is merely a hint at this point and may be deprecated in the future). + * - The framework will no longer enforce constraints on concurrent loading of models, as expressed + * in the Properties (these properties are merely hints at this point and may be deprecated in the + * future. + * - The HAL implementation is free to reject starting of any model at any time by having the + * respective start*() method return -EBUSY. + * - The HAL implementation is free to reject loading of any model at any time by having the + * respective load*() method return -EBUSY. + * - The HAL implementation is free to preemptively stop a previously started model at its own + * discretion (for example, if a higher priority use-case which cannot coexist with detection + * has been requested). The HAL must notify the framework of the preemption by sending a + * recognition event with an `ABORT` status. The implementation must NOT attempt to restart the + * recognition automatically when conditions change. + * - The HAL implementation is free to preemptively unload a previously loaded model at its own + * discretion (for example, if a higher-priority model is being loaded and the two cannot + * coexist). When doing so, it must first abort the detection if active (as per above) and then + * notify the framework of the unload using the newly added modelUnloaded callback. + * - When conditions change, such that a model that couldn't previously load or start or that had + * previously been preemptively stopped or unloaded, the HAL must notify the framework via the + * newly added tryAgain() callback. This callback is not a guarantee that any operation would now + * succeed, but merely a hint that retrying something that had previously failed, now MAY succeed. + * Until this callback arrives, the framework may assume that any operation that had previously + * failed or aborted would still fail if retried, so the implementation should not forget to + * deliver it. There are no guarantees regarding how the framework may respond to this event and + * the order in which it may choose to reload/restart its models. Typically, as result of this + * event the framework will make a single attempt per model to bring this model to its desired + * state (loaded, started). + */ +interface ISoundTriggerHw extends @2.3::ISoundTriggerHw { + /** + * This will get called at most once per every attachment to the service. + * + * All events not tied to a specific model should go through this callback. + */ + registerGlobalCallback(ISoundTriggerHwGlobalCallback callback); + + /** + * Load a sound model. Once loaded, recognition of this model can be + * started and stopped. + * The implementation returns a unique handle used by other functions + * (unloadSoundModel(), startRecognition*(), etc... + * + * Must have the exact same semantics as loadSoundModel from ISoundTriggerHw@2.3 except that the + * return values have changed and that there is no cookie provided (the implementation may pass + * any value to the callback, as it is ignored). + * + * @param soundModel A SoundModel structure describing the sound model + * to load. + * @param callback The callback interface on which the soundModelCallback*() + * method must be called upon completion and modelUnloaded() upon preempted unload. + * @return retval Operation completion status: 0 in case of success, + * -EBUSY in case the operation is temporarily unavailable (but possible in general). + * @return modelHandle A unique handle assigned by the HAL for use by the + * framework when controlling activity for this sound model. + */ + loadSoundModel_2_4(SoundModel soundModel, ISoundTriggerHwCallback callback) + generates (int32_t retval, SoundModelHandle modelHandle); + + /** + * Load a key phrase sound model. Once loaded, recognition of this model can + * be started and stopped. Only one active recognition per model at a time. + * The SoundTrigger service must handle concurrent recognition requests by + * different users/applications on the same model. + * The implementation returns a unique handle used by other functions + * (unloadSoundModel(), startRecognition*(), etc... + * + * Must have the exact same semantics as loadPhraseSoundModel from ISoundTriggerHw@2.3 except + * that the return values have changed and that there is no cookie provided (the implementation + * may pass any value to the callback, as it is ignored). + * + * @param soundModel A PhraseSoundModel structure describing the sound model + * to load. + * @param callback The callback interface on which the soundModelCallback*() + * method must be called upon completion and modelUnloaded() upon preempted unload. + * @return retval Operation completion status: 0 in case of success, + * -EBUSY in case the operation is temporarily unavailable (but possible in general). + * @return modelHandle A unique handle assigned by the HAL for use by the + * framework when controlling activity for this sound model. + */ + loadPhraseSoundModel_2_4(PhraseSoundModel soundModel, ISoundTriggerHwCallback callback) + generates (int32_t retval, SoundModelHandle modelHandle); + + /** + * Start recognition on a given model. Only one recognition active + * at a time per model. Once recognition succeeds or fails, the callback + * associated with the model handle is called. + * + * Must have the exact same semantics as startRecognition from ISoundTriggerHw@2.3 except that + * there are different expectations of the return value and that there is no cookie provided + * (the implementation may pass any value to the callback, as it is ignored). + * + * @param modelHandle the handle of the sound model to use for recognition + * @param config A RecognitionConfig structure containing attributes of the + * recognition to perform + * @param callback The callback interface on which the recognitionCallback() + * method must be called upon recognition. + * @return retval Operation completion status: 0 in case of success, + * -EBUSY in case the operation is temporarily unavailable (but possible in general), or in + * case model has been preemtively unloaded. + */ + startRecognition_2_4(SoundModelHandle modelHandle, RecognitionConfig config) + generates (int32_t retval); +}; diff --git a/soundtrigger/2.4/ISoundTriggerHwCallback.hal b/soundtrigger/2.4/ISoundTriggerHwCallback.hal new file mode 100644 index 0000000000..594deb09d3 --- /dev/null +++ b/soundtrigger/2.4/ISoundTriggerHwCallback.hal @@ -0,0 +1,34 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.soundtrigger@2.4; + +import @2.0::SoundModelHandle; +import @2.1::ISoundTriggerHwCallback; + +/** + * SoundTrigger HAL per-model Callback interface. + */ +interface ISoundTriggerHwCallback extends @2.1::ISoundTriggerHwCallback { + /** + * Callback method called by the HAL when a model has been unloaded at the HAL implementation's + * discretion. Only a stopped model may be unloaded. + * This event is NOT sent as part of an unload sequence initiated by the client. + * + * @param model The model handle. + */ + modelUnloaded(SoundModelHandle model); +}; diff --git a/soundtrigger/2.4/ISoundTriggerHwGlobalCallback.hal b/soundtrigger/2.4/ISoundTriggerHwGlobalCallback.hal new file mode 100644 index 0000000000..2f1a977a12 --- /dev/null +++ b/soundtrigger/2.4/ISoundTriggerHwGlobalCallback.hal @@ -0,0 +1,32 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.soundtrigger@2.4; + +/** + * SoundTrigger HAL callback interface for events not associated with a particular model. + */ +interface ISoundTriggerHwGlobalCallback { + /** + * Callback method called by the HAL whenever internal conditions have been made available, such + * that a call that would previously have failed with an -EBUSY status may now succeed. + * There is no guarantee that any call would succeed following this event. It is merely a hint + * to the client that it may retry. + * Conversely, any call that have failed previously with -EBUSY is guaranteed to fail again if + * retried, until this callback is delivered. + */ + onResourcesAvailable(); +}; diff --git a/soundtrigger/2.4/vts/functional/Android.bp b/soundtrigger/2.4/vts/functional/Android.bp new file mode 100644 index 0000000000..0e69bf4844 --- /dev/null +++ b/soundtrigger/2.4/vts/functional/Android.bp @@ -0,0 +1,32 @@ +// +// 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. +// + +cc_test { + name: "VtsHalSoundtriggerV2_4TargetTest", + defaults: ["VtsHalTargetTestDefaults"], + srcs: ["VtsHalSoundtriggerV2_4TargetTest.cpp"], + static_libs: [ + "android.hardware.soundtrigger@2.0", + "android.hardware.soundtrigger@2.1", + "android.hardware.soundtrigger@2.2", + "android.hardware.soundtrigger@2.3", + "android.hardware.soundtrigger@2.4", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/soundtrigger/2.4/vts/functional/VtsHalSoundtriggerV2_4TargetTest.cpp b/soundtrigger/2.4/vts/functional/VtsHalSoundtriggerV2_4TargetTest.cpp new file mode 100644 index 0000000000..13d70058e1 --- /dev/null +++ b/soundtrigger/2.4/vts/functional/VtsHalSoundtriggerV2_4TargetTest.cpp @@ -0,0 +1,84 @@ +/* + * 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. + */ + +#define LOG_TAG "SoundTriggerHidlHalTest" + +#include +#include +#include +#include +#include +#include +#include + +using ::android::sp; +using ::android::hardware::Return; +using ::android::hardware::Status; +using ::android::hardware::soundtrigger::V2_4::ISoundTriggerHw; +using ::android::hardware::soundtrigger::V2_4::ISoundTriggerHwGlobalCallback; + +/** + * Test class holding the instance of the SoundTriggerHW service to test. + * The passed parameter is the registered name of the implementing service + * supplied by INSTANTIATE_TEST_SUITE_P() call. + */ +class SoundTriggerHidlTest : public testing::TestWithParam { +public: + void SetUp() override { + mSoundtrigger = ISoundTriggerHw::getService(GetParam()); + + ASSERT_NE(mSoundtrigger, nullptr); + LOG(INFO) << "Test is remote " << mSoundtrigger->isRemote(); + } + +protected: + sp mSoundtrigger; +}; + +/** + * Empty test is in place to ensure service is initialized. + * Due to the nature of SoundTrigger HAL providing an interface for + * proprietary or vendor specific implementations, limited testing on + * individual APIs is possible. + */ +TEST_P(SoundTriggerHidlTest, ServiceIsInstantiated) {} + +class GlobalCallback : public ISoundTriggerHwGlobalCallback { + Return onResourcesAvailable() override { + return Status::ok(); + } +}; + +/** + * Test ISoundTriggerHw::registerGlobalCallback method + * + * Verifies that: + * - the implementation implements the method + * - the method returns no error + */ +TEST_P(SoundTriggerHidlTest, RegisterGlobalCallback) { + Return hidlReturn; + sp callback = new GlobalCallback(); + hidlReturn = mSoundtrigger->registerGlobalCallback(callback); + EXPECT_TRUE(hidlReturn.isOk()); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SoundTriggerHidlTest); + +INSTANTIATE_TEST_SUITE_P( + PerInstance, SoundTriggerHidlTest, + testing::ValuesIn(android::hardware::getAllHalInstanceNames(ISoundTriggerHw::descriptor)), + android::hardware::PrintInstanceNameToString); -- GitLab From c6cf50ad425d60796da6a326f5d5515fb3b28fc0 Mon Sep 17 00:00:00 2001 From: Lev Proleev Date: Mon, 8 Mar 2021 10:46:33 +0000 Subject: [PATCH 022/825] Add missing NNAPI HIDL interface mock tests prepareModelFromCache* was tested for handling of errors happening during the preparation launch but not during the actual preparation. Bug: 163801800 Test: mma Test: atest neuralnetworks_utils_hal_common_test Test: atest neuralnetworks_utils_hal_1_[0-3]_test Change-Id: I2c4b235fd4877238d7a18be8b0ea051434c1df6b --- neuralnetworks/1.2/utils/test/DeviceTest.cpp | 19 ++++++++++++++++++- neuralnetworks/1.3/utils/test/DeviceTest.cpp | 19 ++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/neuralnetworks/1.2/utils/test/DeviceTest.cpp b/neuralnetworks/1.2/utils/test/DeviceTest.cpp index 9c8addef1f..215d44c83f 100644 --- a/neuralnetworks/1.2/utils/test/DeviceTest.cpp +++ b/neuralnetworks/1.2/utils/test/DeviceTest.cpp @@ -772,7 +772,7 @@ TEST(DeviceTest, prepareModelFromCache) { EXPECT_NE(result.value(), nullptr); } -TEST(DeviceTest, prepareModelFromCacheError) { +TEST(DeviceTest, prepareModelFromCacheLaunchError) { // setup call const auto mockDevice = createMockDevice(); const auto device = Device::create(kName, mockDevice).value(); @@ -790,6 +790,23 @@ TEST(DeviceTest, prepareModelFromCacheError) { EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); } +TEST(DeviceTest, prepareModelFromCacheReturnError) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, prepareModelFromCache(_, _, _, _)) + .Times(1) + .WillOnce(Invoke(makePreparedModelFromCacheReturn( + V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::GENERAL_FAILURE, nullptr))); + + // run test + const auto result = device->prepareModelFromCache({}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + TEST(DeviceTest, prepareModelFromCacheNullptrError) { // setup call const auto mockDevice = createMockDevice(); diff --git a/neuralnetworks/1.3/utils/test/DeviceTest.cpp b/neuralnetworks/1.3/utils/test/DeviceTest.cpp index f260990471..2d1b2f295a 100644 --- a/neuralnetworks/1.3/utils/test/DeviceTest.cpp +++ b/neuralnetworks/1.3/utils/test/DeviceTest.cpp @@ -794,7 +794,7 @@ TEST(DeviceTest, prepareModelFromCache) { EXPECT_NE(result.value(), nullptr); } -TEST(DeviceTest, prepareModelFromCacheError) { +TEST(DeviceTest, prepareModelFromCacheLaunchError) { // setup call const auto mockDevice = createMockDevice(); const auto device = Device::create(kName, mockDevice).value(); @@ -812,6 +812,23 @@ TEST(DeviceTest, prepareModelFromCacheError) { EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); } +TEST(DeviceTest, prepareModelFromCacheReturnError) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, prepareModelFromCache_1_3(_, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(makePreparedModelFromCacheReturn( + V1_3::ErrorStatus::NONE, V1_3::ErrorStatus::GENERAL_FAILURE, nullptr))); + + // run test + const auto result = device->prepareModelFromCache({}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + TEST(DeviceTest, prepareModelFromCacheNullptrError) { // setup call const auto mockDevice = createMockDevice(); -- GitLab From 3b93b0b56a4f5128eaa942d804dd490317c0abcb Mon Sep 17 00:00:00 2001 From: Lev Proleev Date: Tue, 26 Jan 2021 19:40:20 +0000 Subject: [PATCH 023/825] Add canonical types adapters for NNAPI AIDL interface Also: * Add missing AIDL<->CT conversions * Add AIDL-specific info to neuralnetworks/utils/README.md * Add mock classes and tests AIDL adapters Bug: 179015258 Test: neuralnetworks_utils_hal_test Change-Id: Ifa98fadd46dca5dbf9b3ceb4da811aa8da45b6e4 --- neuralnetworks/TEST_MAPPING | 3 + neuralnetworks/aidl/utils/Android.bp | 37 + .../utils/include/nnapi/hal/aidl/Buffer.h | 56 ++ .../utils/include/nnapi/hal/aidl/Callbacks.h | 53 ++ .../include/nnapi/hal/aidl/Conversions.h | 60 +- .../utils/include/nnapi/hal/aidl/Device.h | 98 ++ .../include/nnapi/hal/aidl/PreparedModel.h | 70 ++ .../include/nnapi/hal/aidl/ProtectCallback.h | 81 ++ .../utils/include/nnapi/hal/aidl/Service.h | 33 + .../aidl/utils/include/nnapi/hal/aidl/Utils.h | 7 + neuralnetworks/aidl/utils/src/Buffer.cpp | 78 ++ neuralnetworks/aidl/utils/src/Callbacks.cpp | 61 ++ neuralnetworks/aidl/utils/src/Conversions.cpp | 419 ++++++++- neuralnetworks/aidl/utils/src/Device.cpp | 294 ++++++ .../aidl/utils/src/PreparedModel.cpp | 172 ++++ .../aidl/utils/src/ProtectCallback.cpp | 112 +++ neuralnetworks/aidl/utils/src/Service.cpp | 50 + neuralnetworks/aidl/utils/src/Utils.cpp | 31 +- neuralnetworks/aidl/utils/test/BufferTest.cpp | 212 +++++ neuralnetworks/aidl/utils/test/DeviceTest.cpp | 861 ++++++++++++++++++ neuralnetworks/aidl/utils/test/MockBuffer.h | 43 + neuralnetworks/aidl/utils/test/MockDevice.h | 67 ++ .../utils/test/MockFencedExecutionCallback.h | 45 + .../aidl/utils/test/MockPreparedModel.h | 50 + .../aidl/utils/test/PreparedModelTest.cpp | 272 ++++++ neuralnetworks/utils/README.md | 33 +- neuralnetworks/utils/common/Android.bp | 2 + .../common/include/nnapi/hal/CommonUtils.h | 2 + 28 files changed, 3258 insertions(+), 44 deletions(-) create mode 100644 neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Buffer.h create mode 100644 neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Callbacks.h create mode 100644 neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Device.h create mode 100644 neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h create mode 100644 neuralnetworks/aidl/utils/include/nnapi/hal/aidl/ProtectCallback.h create mode 100644 neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Service.h create mode 100644 neuralnetworks/aidl/utils/src/Buffer.cpp create mode 100644 neuralnetworks/aidl/utils/src/Callbacks.cpp create mode 100644 neuralnetworks/aidl/utils/src/Device.cpp create mode 100644 neuralnetworks/aidl/utils/src/PreparedModel.cpp create mode 100644 neuralnetworks/aidl/utils/src/ProtectCallback.cpp create mode 100644 neuralnetworks/aidl/utils/src/Service.cpp create mode 100644 neuralnetworks/aidl/utils/test/BufferTest.cpp create mode 100644 neuralnetworks/aidl/utils/test/DeviceTest.cpp create mode 100644 neuralnetworks/aidl/utils/test/MockBuffer.h create mode 100644 neuralnetworks/aidl/utils/test/MockDevice.h create mode 100644 neuralnetworks/aidl/utils/test/MockFencedExecutionCallback.h create mode 100644 neuralnetworks/aidl/utils/test/MockPreparedModel.h create mode 100644 neuralnetworks/aidl/utils/test/PreparedModelTest.cpp diff --git a/neuralnetworks/TEST_MAPPING b/neuralnetworks/TEST_MAPPING index 5d168d2766..d29682887a 100644 --- a/neuralnetworks/TEST_MAPPING +++ b/neuralnetworks/TEST_MAPPING @@ -15,6 +15,9 @@ { "name": "neuralnetworks_utils_hal_1_3_test" }, + { + "name": "neuralnetworks_utils_hal_aidl_test" + }, { "name": "VtsHalNeuralnetworksV1_0TargetTest", "options": [ diff --git a/neuralnetworks/aidl/utils/Android.bp b/neuralnetworks/aidl/utils/Android.bp index 2673caef0e..476dac9d4d 100644 --- a/neuralnetworks/aidl/utils/Android.bp +++ b/neuralnetworks/aidl/utils/Android.bp @@ -29,10 +29,12 @@ cc_library_static { srcs: ["src/*"], local_include_dirs: ["include/nnapi/hal/aidl/"], export_include_dirs: ["include"], + cflags: ["-Wthread-safety"], static_libs: [ "libarect", "neuralnetworks_types", "neuralnetworks_utils_hal_common", + "neuralnetworks_utils_hal_1_0", ], shared_libs: [ "android.hardware.neuralnetworks-V1-ndk_platform", @@ -41,3 +43,38 @@ cc_library_static { "libnativewindow", ], } + +cc_test { + name: "neuralnetworks_utils_hal_aidl_test", + defaults: ["neuralnetworks_utils_defaults"], + srcs: [ + "test/*.cpp", + ], + static_libs: [ + "android.hardware.common-V2-ndk_platform", + "android.hardware.neuralnetworks-V1-ndk_platform", + "libgmock", + "libneuralnetworks_common", + "neuralnetworks_types", + "neuralnetworks_utils_hal_aidl", + "neuralnetworks_utils_hal_common", + ], + shared_libs: [ + "android.hidl.allocator@1.0", + "libbase", + "libbinder_ndk", + "libcutils", + "libhidlbase", + "libhidlmemory", + "liblog", + "libnativewindow", + "libutils", + ], + cflags: [ + /* GMOCK defines functions for printing all MOCK_DEVICE arguments and + * MockDevice contains a string pointer which triggers a warning in the + * base logging library. */ + "-Wno-user-defined-warnings", + ], + test_suites: ["general-tests"], +} diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Buffer.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Buffer.h new file mode 100644 index 0000000000..46190c4078 --- /dev/null +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Buffer.h @@ -0,0 +1,56 @@ +/* + * 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_INTERFACES_NEURALNETWORKS_AIDL_UTILS_BUFFER_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_BUFFER_H + +#include +#include +#include +#include +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on AIDL interface +// lifetimes across processes. + +namespace aidl::android::hardware::neuralnetworks::utils { + +// Class that adapts aidl_hal::IBuffer to nn::IBuffer. +class Buffer final : public nn::IBuffer { + struct PrivateConstructorTag {}; + + public: + static nn::GeneralResult> create( + std::shared_ptr buffer, nn::Request::MemoryDomainToken token); + + Buffer(PrivateConstructorTag tag, std::shared_ptr buffer, + nn::Request::MemoryDomainToken token); + + nn::Request::MemoryDomainToken getToken() const override; + + nn::GeneralResult copyTo(const nn::SharedMemory& dst) const override; + nn::GeneralResult copyFrom(const nn::SharedMemory& src, + const nn::Dimensions& dimensions) const override; + + private: + const std::shared_ptr kBuffer; + const nn::Request::MemoryDomainToken kToken; +}; + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_BUFFER_H diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Callbacks.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Callbacks.h new file mode 100644 index 0000000000..8651912cb8 --- /dev/null +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Callbacks.h @@ -0,0 +1,53 @@ +/* + * 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_INTERFACES_NEURALNETWORKS_AIDL_UTILS_CALLBACKS_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_CALLBACKS_H + +#include +#include +#include +#include +#include +#include +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on AIDL interface +// lifetimes across processes and for protecting asynchronous calls across AIDL. + +namespace aidl::android::hardware::neuralnetworks::utils { + +// An AIDL callback class to receive the results of IDevice::prepareModel* asynchronously. +class PreparedModelCallback final : public BnPreparedModelCallback, + public hal::utils::IProtectedCallback { + public: + using Data = nn::GeneralResult; + + ndk::ScopedAStatus notify(ErrorStatus status, + const std::shared_ptr& preparedModel) override; + + void notifyAsDeadObject() override; + + Data get(); + + private: + hal::utils::TransferValue mData; +}; + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_CALLBACKS_H diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h index 1b2f69c245..4922a6ea1e 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -96,7 +97,11 @@ GeneralResult unvalidatedConvert( const aidl_hal::ExtensionOperandTypeInformation& operandTypeInformation); GeneralResult unvalidatedConvert( const ::aidl::android::hardware::common::NativeHandle& handle); +GeneralResult unvalidatedConvert(const ndk::ScopedFileDescriptor& syncFence); +GeneralResult convert(const aidl_hal::Capabilities& capabilities); +GeneralResult convert(const aidl_hal::DeviceType& deviceType); +GeneralResult convert(const aidl_hal::ErrorStatus& errorStatus); GeneralResult convert( const aidl_hal::ExecutionPreference& executionPreference); GeneralResult convert(const aidl_hal::Memory& memory); @@ -106,9 +111,14 @@ GeneralResult convert(const aidl_hal::OperandType& operandType); GeneralResult convert(const aidl_hal::Priority& priority); GeneralResult convert(const aidl_hal::RequestMemoryPool& memoryPool); GeneralResult convert(const aidl_hal::Request& request); +GeneralResult convert(const aidl_hal::Timing& timing); +GeneralResult convert(const ndk::ScopedFileDescriptor& syncFence); +GeneralResult> convert(const std::vector& extension); GeneralResult> convert(const std::vector& outputShapes); GeneralResult> convert(const std::vector& memories); +GeneralResult> convert( + const std::vector& outputShapes); GeneralResult> toUnsigned(const std::vector& vec); @@ -118,14 +128,62 @@ namespace aidl::android::hardware::neuralnetworks::utils { namespace nn = ::android::nn; +nn::GeneralResult> unvalidatedConvert(const nn::CacheToken& cacheToken); +nn::GeneralResult unvalidatedConvert(const nn::BufferDesc& bufferDesc); +nn::GeneralResult unvalidatedConvert(const nn::BufferRole& bufferRole); +nn::GeneralResult unvalidatedConvert(const nn::MeasureTiming& measureTiming); nn::GeneralResult unvalidatedConvert(const nn::SharedMemory& memory); nn::GeneralResult unvalidatedConvert(const nn::OutputShape& outputShape); nn::GeneralResult unvalidatedConvert(const nn::ErrorStatus& errorStatus); - +nn::GeneralResult unvalidatedConvert( + const nn::ExecutionPreference& executionPreference); +nn::GeneralResult unvalidatedConvert(const nn::OperandType& operandType); +nn::GeneralResult unvalidatedConvert(const nn::Operand::LifeTime& operandLifeTime); +nn::GeneralResult unvalidatedConvert(const nn::DataLocation& location); +nn::GeneralResult> unvalidatedConvert( + const nn::Operand::ExtraParams& extraParams); +nn::GeneralResult unvalidatedConvert(const nn::Operand& operand); +nn::GeneralResult unvalidatedConvert(const nn::OperationType& operationType); +nn::GeneralResult unvalidatedConvert(const nn::Operation& operation); +nn::GeneralResult unvalidatedConvert(const nn::Model::Subgraph& subgraph); +nn::GeneralResult> unvalidatedConvert( + const nn::Model::OperandValues& operandValues); +nn::GeneralResult unvalidatedConvert( + const nn::Model::ExtensionNameAndPrefix& extensionNameToPrefix); +nn::GeneralResult unvalidatedConvert(const nn::Model& model); +nn::GeneralResult unvalidatedConvert(const nn::Priority& priority); +nn::GeneralResult unvalidatedConvert(const nn::Request& request); +nn::GeneralResult unvalidatedConvert(const nn::Request::Argument& requestArgument); +nn::GeneralResult unvalidatedConvert(const nn::Request::MemoryPool& memoryPool); +nn::GeneralResult unvalidatedConvert(const nn::Timing& timing); +nn::GeneralResult unvalidatedConvert(const nn::Duration& duration); +nn::GeneralResult unvalidatedConvert(const nn::OptionalDuration& optionalDuration); +nn::GeneralResult unvalidatedConvert(const nn::OptionalTimePoint& optionalTimePoint); +nn::GeneralResult unvalidatedConvert(const nn::SyncFence& syncFence); +nn::GeneralResult unvalidatedConvert(const nn::SharedHandle& sharedHandle); +nn::GeneralResult unvalidatedConvertCache( + const nn::SharedHandle& handle); + +nn::GeneralResult> convert(const nn::CacheToken& cacheToken); +nn::GeneralResult convert(const nn::BufferDesc& bufferDesc); +nn::GeneralResult convert(const nn::MeasureTiming& measureTiming); nn::GeneralResult convert(const nn::SharedMemory& memory); nn::GeneralResult convert(const nn::ErrorStatus& errorStatus); +nn::GeneralResult convert(const nn::ExecutionPreference& executionPreference); +nn::GeneralResult convert(const nn::Model& model); +nn::GeneralResult convert(const nn::Priority& priority); +nn::GeneralResult convert(const nn::Request& request); +nn::GeneralResult convert(const nn::Timing& timing); +nn::GeneralResult convert(const nn::OptionalDuration& optionalDuration); +nn::GeneralResult convert(const nn::OptionalTimePoint& optionalTimePoint); + +nn::GeneralResult> convert(const std::vector& bufferRoles); nn::GeneralResult> convert( const std::vector& outputShapes); +nn::GeneralResult> convert( + const std::vector& handles); +nn::GeneralResult> convert( + const std::vector& syncFences); nn::GeneralResult> toSigned(const std::vector& vec); diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Device.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Device.h new file mode 100644 index 0000000000..eb194e3549 --- /dev/null +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Device.h @@ -0,0 +1,98 @@ +/* + * 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_INTERFACES_NEURALNETWORKS_AIDL_UTILS_DEVICE_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_DEVICE_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on AIDL interface +// lifetimes across processes and for protecting asynchronous calls across AIDL. + +namespace aidl::android::hardware::neuralnetworks::utils { + +// Class that adapts aidl_hal::IDevice to nn::IDevice. +class Device final : public nn::IDevice { + struct PrivateConstructorTag {}; + + public: + static nn::GeneralResult> create( + std::string name, std::shared_ptr device); + + Device(PrivateConstructorTag tag, std::string name, std::string versionString, + nn::DeviceType deviceType, std::vector extensions, + nn::Capabilities capabilities, std::pair numberOfCacheFilesNeeded, + std::shared_ptr device, DeathHandler deathHandler); + + const std::string& getName() const override; + const std::string& getVersionString() const override; + nn::Version getFeatureLevel() const override; + nn::DeviceType getType() const override; + bool isUpdatable() const override; + const std::vector& getSupportedExtensions() const override; + const nn::Capabilities& getCapabilities() const override; + std::pair getNumberOfCacheFilesNeeded() const override; + + nn::GeneralResult wait() const override; + + nn::GeneralResult> getSupportedOperations( + const nn::Model& model) const override; + + nn::GeneralResult prepareModel( + const nn::Model& model, nn::ExecutionPreference preference, nn::Priority priority, + nn::OptionalTimePoint deadline, const std::vector& modelCache, + const std::vector& dataCache, + const nn::CacheToken& token) const override; + + nn::GeneralResult prepareModelFromCache( + nn::OptionalTimePoint deadline, const std::vector& modelCache, + const std::vector& dataCache, + const nn::CacheToken& token) const override; + + nn::GeneralResult allocate( + const nn::BufferDesc& desc, const std::vector& preparedModels, + const std::vector& inputRoles, + const std::vector& outputRoles) const override; + + DeathMonitor* getDeathMonitor() const; + + private: + const std::string kName; + const std::string kVersionString; + const nn::DeviceType kDeviceType; + const std::vector kExtensions; + const nn::Capabilities kCapabilities; + const std::pair kNumberOfCacheFilesNeeded; + const std::shared_ptr kDevice; + const DeathHandler kDeathHandler; +}; + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_DEVICE_H diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h new file mode 100644 index 0000000000..9b28588610 --- /dev/null +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h @@ -0,0 +1,70 @@ +/* + * 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_INTERFACES_NEURALNETWORKS_AIDL_UTILS_PREPARED_MODEL_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_PREPARED_MODEL_H + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on AIDL interface +// lifetimes across processes and for protecting asynchronous calls across AIDL. + +namespace aidl::android::hardware::neuralnetworks::utils { + +// Class that adapts aidl_hal::IPreparedModel to nn::IPreparedModel. +class PreparedModel final : public nn::IPreparedModel, + public std::enable_shared_from_this { + struct PrivateConstructorTag {}; + + public: + static nn::GeneralResult> create( + std::shared_ptr preparedModel); + + PreparedModel(PrivateConstructorTag tag, + std::shared_ptr preparedModel); + + nn::ExecutionResult, nn::Timing>> execute( + const nn::Request& request, nn::MeasureTiming measure, + const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration) const override; + + nn::GeneralResult> executeFenced( + const nn::Request& request, const std::vector& waitFor, + nn::MeasureTiming measure, const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration, + const nn::OptionalDuration& timeoutDurationAfterFence) const override; + + nn::GeneralResult configureExecutionBurst() const override; + + std::any getUnderlyingResource() const override; + + private: + const std::shared_ptr kPreparedModel; +}; + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_PREPARED_MODEL_H diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/ProtectCallback.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/ProtectCallback.h new file mode 100644 index 0000000000..ab1108c182 --- /dev/null +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/ProtectCallback.h @@ -0,0 +1,81 @@ +/* + * 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_INTERFACES_NEURALNETWORKS_AIDL_UTILS_PROTECT_CALLBACK_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_PROTECT_CALLBACK_H + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on AIDL interface +// lifetimes across processes and for protecting asynchronous calls across AIDL. + +namespace aidl::android::hardware::neuralnetworks::utils { + +// Thread safe class +class DeathMonitor final { + public: + static void serviceDied(void* cookie); + void serviceDied(); + // Precondition: `killable` must be non-null. + void add(hal::utils::IProtectedCallback* killable) const; + // Precondition: `killable` must be non-null. + void remove(hal::utils::IProtectedCallback* killable) const; + + private: + mutable std::mutex mMutex; + mutable std::vector mObjects GUARDED_BY(mMutex); +}; + +class DeathHandler final { + public: + static nn::GeneralResult create(std::shared_ptr object); + + DeathHandler(const DeathHandler&) = delete; + DeathHandler(DeathHandler&&) noexcept = default; + DeathHandler& operator=(const DeathHandler&) = delete; + DeathHandler& operator=(DeathHandler&&) noexcept = delete; + ~DeathHandler(); + + using Cleanup = std::function; + // Precondition: `killable` must be non-null. + [[nodiscard]] ::android::base::ScopeGuard protectCallback( + hal::utils::IProtectedCallback* killable) const; + + std::shared_ptr getDeathMonitor() const { return kDeathMonitor; } + + private: + DeathHandler(std::shared_ptr object, + ndk::ScopedAIBinder_DeathRecipient deathRecipient, + std::shared_ptr deathMonitor); + + std::shared_ptr kObject; + ndk::ScopedAIBinder_DeathRecipient kDeathRecipient; + std::shared_ptr kDeathMonitor; +}; + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_PROTECT_CALLBACK_H diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Service.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Service.h new file mode 100644 index 0000000000..b4587acbf7 --- /dev/null +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Service.h @@ -0,0 +1,33 @@ +/* + * 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_INTERFACES_NEURALNETWORKS_AIDL_UTILS_SERVICE_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_SERVICE_H + +#include +#include +#include +#include + +#include + +namespace aidl::android::hardware::neuralnetworks::utils { + +nn::GeneralResult getDevice(const std::string& name); + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_SERVICE_H diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h index 79b511dc56..58dcfe3af6 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h @@ -23,6 +23,7 @@ #include #include #include +#include namespace aidl::android::hardware::neuralnetworks::utils { @@ -52,6 +53,12 @@ nn::GeneralResult clone(const Request& request); nn::GeneralResult clone(const RequestMemoryPool& requestPool); nn::GeneralResult clone(const Model& model); +nn::GeneralResult handleTransportError(const ndk::ScopedAStatus& ret); + +#define HANDLE_ASTATUS(ret) \ + for (const auto status = handleTransportError(ret); !status.ok();) \ + return NN_ERROR(status.error().code) << status.error().message << ": " + } // namespace aidl::android::hardware::neuralnetworks::utils #endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_H diff --git a/neuralnetworks/aidl/utils/src/Buffer.cpp b/neuralnetworks/aidl/utils/src/Buffer.cpp new file mode 100644 index 0000000000..c729a688d1 --- /dev/null +++ b/neuralnetworks/aidl/utils/src/Buffer.cpp @@ -0,0 +1,78 @@ +/* + * 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 "Buffer.h" + +#include +#include +#include + +#include "Conversions.h" +#include "Utils.h" +#include "nnapi/hal/aidl/Conversions.h" + +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on AIDL interface +// lifetimes across processes. + +namespace aidl::android::hardware::neuralnetworks::utils { + +nn::GeneralResult> Buffer::create( + std::shared_ptr buffer, nn::Request::MemoryDomainToken token) { + if (buffer == nullptr) { + return NN_ERROR() << "aidl_hal::utils::Buffer::create must have non-null buffer"; + } + if (token == static_cast(0)) { + return NN_ERROR() << "aidl_hal::utils::Buffer::create must have non-zero token"; + } + + return std::make_shared(PrivateConstructorTag{}, std::move(buffer), token); +} + +Buffer::Buffer(PrivateConstructorTag /*tag*/, std::shared_ptr buffer, + nn::Request::MemoryDomainToken token) + : kBuffer(std::move(buffer)), kToken(token) { + CHECK(kBuffer != nullptr); + CHECK(kToken != static_cast(0)); +} + +nn::Request::MemoryDomainToken Buffer::getToken() const { + return kToken; +} + +nn::GeneralResult Buffer::copyTo(const nn::SharedMemory& dst) const { + const auto aidlDst = NN_TRY(convert(dst)); + + const auto ret = kBuffer->copyTo(aidlDst); + HANDLE_ASTATUS(ret) << "IBuffer::copyTo failed"; + + return {}; +} + +nn::GeneralResult Buffer::copyFrom(const nn::SharedMemory& src, + const nn::Dimensions& dimensions) const { + const auto aidlSrc = NN_TRY(convert(src)); + const auto aidlDimensions = NN_TRY(toSigned(dimensions)); + + const auto ret = kBuffer->copyFrom(aidlSrc, aidlDimensions); + HANDLE_ASTATUS(ret) << "IBuffer::copyFrom failed"; + + return {}; +} + +} // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/src/Callbacks.cpp b/neuralnetworks/aidl/utils/src/Callbacks.cpp new file mode 100644 index 0000000000..8055665228 --- /dev/null +++ b/neuralnetworks/aidl/utils/src/Callbacks.cpp @@ -0,0 +1,61 @@ +/* + * 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 "Callbacks.h" + +#include "Conversions.h" +#include "PreparedModel.h" +#include "ProtectCallback.h" +#include "Utils.h" + +#include +#include +#include + +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on AIDL interface +// lifetimes across processes and for protecting asynchronous calls across AIDL. + +namespace aidl::android::hardware::neuralnetworks::utils { +namespace { + +// Converts the results of IDevice::prepareModel* to the NN canonical format. On success, this +// function returns with a non-null nn::SharedPreparedModel with a feature level of +// nn::Version::ANDROID_S. On failure, this function returns with the appropriate nn::GeneralError. +nn::GeneralResult prepareModelCallback( + ErrorStatus status, const std::shared_ptr& preparedModel) { + HANDLE_HAL_STATUS(status) << "model preparation failed with " << toString(status); + return NN_TRY(PreparedModel::create(preparedModel)); +} + +} // namespace + +ndk::ScopedAStatus PreparedModelCallback::notify( + ErrorStatus status, const std::shared_ptr& preparedModel) { + mData.put(prepareModelCallback(status, preparedModel)); + return ndk::ScopedAStatus::ok(); +} + +void PreparedModelCallback::notifyAsDeadObject() { + mData.put(NN_ERROR(nn::ErrorStatus::DEAD_OBJECT) << "Dead object"); +} + +PreparedModelCallback::Data PreparedModelCallback::get() { + return mData.take(); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/src/Conversions.cpp b/neuralnetworks/aidl/utils/src/Conversions.cpp index db3504bb74..5d9c55b1ba 100644 --- a/neuralnetworks/aidl/utils/src/Conversions.cpp +++ b/neuralnetworks/aidl/utils/src/Conversions.cpp @@ -18,6 +18,8 @@ #include #include +#include +#include #include #include #include @@ -42,14 +44,17 @@ #define VERIFY_NON_NEGATIVE(value) \ while (UNLIKELY(value < 0)) return NN_ERROR() -namespace { +#define VERIFY_LE_INT32_MAX(value) \ + while (UNLIKELY(value > std::numeric_limits::max())) return NN_ERROR() +namespace { template constexpr std::underlying_type_t underlyingType(Type value) { return static_cast>(value); } constexpr auto kVersion = android::nn::Version::ANDROID_S; +constexpr int64_t kNoTiming = -1; } // namespace @@ -134,13 +139,8 @@ GeneralResult unvalidatedConvertHelper(const NativeHandle& aidlNativeHan std::vector fds; fds.reserve(aidlNativeHandle.fds.size()); for (const auto& fd : aidlNativeHandle.fds) { - const int dupFd = dup(fd.get()); - if (dupFd == -1) { - // TODO(b/120417090): is ANEURALNETWORKS_UNEXPECTED_NULL the correct error to return - // here? - return NN_ERROR() << "Failed to dup the fd"; - } - fds.emplace_back(dupFd); + auto duplicatedFd = NN_TRY(dupFd(fd.get())); + fds.emplace_back(duplicatedFd.release()); } return Handle{.fds = std::move(fds), .ints = aidlNativeHandle.ints}; @@ -157,16 +157,12 @@ struct NativeHandleDeleter { using UniqueNativeHandle = std::unique_ptr; -static nn::GeneralResult nativeHandleFromAidlHandle( - const NativeHandle& handle) { +static GeneralResult nativeHandleFromAidlHandle(const NativeHandle& handle) { std::vector fds; fds.reserve(handle.fds.size()); for (const auto& fd : handle.fds) { - const int dupFd = dup(fd.get()); - if (dupFd == -1) { - return NN_ERROR() << "Failed to dup the fd"; - } - fds.emplace_back(dupFd); + auto duplicatedFd = NN_TRY(dupFd(fd.get())); + fds.emplace_back(duplicatedFd.release()); } constexpr size_t kIntMax = std::numeric_limits::max(); @@ -382,14 +378,14 @@ static uint32_t roundUpToMultiple(uint32_t value, uint32_t multiple) { GeneralResult unvalidatedConvert(const aidl_hal::Memory& memory) { VERIFY_NON_NEGATIVE(memory.size) << "Memory size must not be negative"; - if (memory.size > std::numeric_limits::max()) { + if (memory.size > std::numeric_limits::max()) { return NN_ERROR() << "Memory: size must be <= std::numeric_limits::max()"; } if (memory.name != "hardware_buffer_blob") { return std::make_shared(Memory{ .handle = NN_TRY(unvalidatedConvertHelper(memory.handle)), - .size = static_cast(memory.size), + .size = static_cast(memory.size), .name = memory.name, }); } @@ -434,11 +430,28 @@ GeneralResult unvalidatedConvert(const aidl_hal::Memory& memory) { return std::make_shared(Memory{ .handle = HardwareBufferHandle(hardwareBuffer, /*takeOwnership=*/true), - .size = static_cast(memory.size), + .size = static_cast(memory.size), .name = memory.name, }); } +GeneralResult unvalidatedConvert(const aidl_hal::Timing& timing) { + if (timing.timeInDriver < -1) { + return NN_ERROR() << "Timing: timeInDriver must not be less than -1"; + } + if (timing.timeOnDevice < -1) { + return NN_ERROR() << "Timing: timeOnDevice must not be less than -1"; + } + constexpr auto convertTiming = [](int64_t halTiming) -> OptionalDuration { + if (halTiming == kNoTiming) { + return {}; + } + return nn::Duration(static_cast(halTiming)); + }; + return Timing{.timeOnDevice = convertTiming(timing.timeOnDevice), + .timeInDriver = convertTiming(timing.timeInDriver)}; +} + GeneralResult unvalidatedConvert(const std::vector& operandValues) { return Model::OperandValues(operandValues.data(), operandValues.size()); } @@ -515,6 +528,23 @@ GeneralResult unvalidatedConvert(const NativeHandle& aidlNativeHan return std::make_shared(NN_TRY(unvalidatedConvertHelper(aidlNativeHandle))); } +GeneralResult unvalidatedConvert(const ndk::ScopedFileDescriptor& syncFence) { + auto duplicatedFd = NN_TRY(dupFd(syncFence.get())); + return SyncFence::create(std::move(duplicatedFd)); +} + +GeneralResult convert(const aidl_hal::Capabilities& capabilities) { + return validatedConvert(capabilities); +} + +GeneralResult convert(const aidl_hal::DeviceType& deviceType) { + return validatedConvert(deviceType); +} + +GeneralResult convert(const aidl_hal::ErrorStatus& errorStatus) { + return validatedConvert(errorStatus); +} + GeneralResult convert( const aidl_hal::ExecutionPreference& executionPreference) { return validatedConvert(executionPreference); @@ -548,6 +578,18 @@ GeneralResult convert(const aidl_hal::Request& request) { return validatedConvert(request); } +GeneralResult convert(const aidl_hal::Timing& timing) { + return validatedConvert(timing); +} + +GeneralResult convert(const ndk::ScopedFileDescriptor& syncFence) { + return unvalidatedConvert(syncFence); +} + +GeneralResult> convert(const std::vector& extension) { + return validatedConvert(extension); +} + GeneralResult> convert(const std::vector& operations) { return unvalidatedConvert(operations); } @@ -556,6 +598,11 @@ GeneralResult> convert(const std::vector> convert( + const std::vector& outputShapes) { + return validatedConvert(outputShapes); +} + GeneralResult> toUnsigned(const std::vector& vec) { if (!std::all_of(vec.begin(), vec.end(), [](int32_t v) { return v >= 0; })) { return NN_ERROR() << "Negative value passed to conversion from signed to unsigned"; @@ -575,13 +622,20 @@ using UnvalidatedConvertOutput = template nn::GeneralResult>> unvalidatedConvertVec( const std::vector& arguments) { - std::vector> halObject(arguments.size()); - for (size_t i = 0; i < arguments.size(); ++i) { - halObject[i] = NN_TRY(unvalidatedConvert(arguments[i])); + std::vector> halObject; + halObject.reserve(arguments.size()); + for (const auto& argument : arguments) { + halObject.push_back(NN_TRY(unvalidatedConvert(argument))); } return halObject; } +template +nn::GeneralResult>> unvalidatedConvert( + const std::vector& arguments) { + return unvalidatedConvertVec(arguments); +} + template nn::GeneralResult> validatedConvert(const Type& canonical) { const auto maybeVersion = nn::validate(canonical); @@ -609,29 +663,29 @@ nn::GeneralResult unvalidatedConvert(const nn::Handle& han common::NativeHandle aidlNativeHandle; aidlNativeHandle.fds.reserve(handle.fds.size()); for (const auto& fd : handle.fds) { - const int dupFd = dup(fd.get()); - if (dupFd == -1) { - // TODO(b/120417090): is ANEURALNETWORKS_UNEXPECTED_NULL the correct error to return - // here? - return NN_ERROR() << "Failed to dup the fd"; - } - aidlNativeHandle.fds.emplace_back(dupFd); + auto duplicatedFd = NN_TRY(nn::dupFd(fd.get())); + aidlNativeHandle.fds.emplace_back(duplicatedFd.release()); } aidlNativeHandle.ints = handle.ints; return aidlNativeHandle; } +// Helper template for std::visit +template +struct overloaded : Ts... { + using Ts::operator()...; +}; +template +overloaded(Ts...)->overloaded; + static nn::GeneralResult aidlHandleFromNativeHandle( const native_handle_t& handle) { common::NativeHandle aidlNativeHandle; aidlNativeHandle.fds.reserve(handle.numFds); for (int i = 0; i < handle.numFds; ++i) { - const int dupFd = dup(handle.data[i]); - if (dupFd == -1) { - return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) << "Failed to dup the fd"; - } - aidlNativeHandle.fds.emplace_back(dupFd); + auto duplicatedFd = NN_TRY(nn::dupFd(handle.data[i])); + aidlNativeHandle.fds.emplace_back(duplicatedFd.release()); } aidlNativeHandle.ints = std::vector(&handle.data[handle.numFds], @@ -642,6 +696,30 @@ static nn::GeneralResult aidlHandleFromNativeHandle( } // namespace +nn::GeneralResult> unvalidatedConvert(const nn::CacheToken& cacheToken) { + return std::vector(cacheToken.begin(), cacheToken.end()); +} + +nn::GeneralResult unvalidatedConvert(const nn::BufferDesc& bufferDesc) { + return BufferDesc{.dimensions = NN_TRY(toSigned(bufferDesc.dimensions))}; +} + +nn::GeneralResult unvalidatedConvert(const nn::BufferRole& bufferRole) { + VERIFY_LE_INT32_MAX(bufferRole.modelIndex) + << "BufferRole: modelIndex must be <= std::numeric_limits::max()"; + VERIFY_LE_INT32_MAX(bufferRole.ioIndex) + << "BufferRole: ioIndex must be <= std::numeric_limits::max()"; + return BufferRole{ + .modelIndex = static_cast(bufferRole.modelIndex), + .ioIndex = static_cast(bufferRole.ioIndex), + .frequency = bufferRole.frequency, + }; +} + +nn::GeneralResult unvalidatedConvert(const nn::MeasureTiming& measureTiming) { + return measureTiming == nn::MeasureTiming::YES; +} + nn::GeneralResult unvalidatedConvert(const nn::SharedHandle& sharedHandle) { CHECK(sharedHandle != nullptr); return unvalidatedConvert(*sharedHandle); @@ -707,6 +785,230 @@ nn::GeneralResult unvalidatedConvert(const nn::OutputShape& outputS .isSufficient = outputShape.isSufficient}; } +nn::GeneralResult unvalidatedConvert( + const nn::ExecutionPreference& executionPreference) { + return static_cast(executionPreference); +} + +nn::GeneralResult unvalidatedConvert(const nn::OperandType& operandType) { + return static_cast(operandType); +} + +nn::GeneralResult unvalidatedConvert( + const nn::Operand::LifeTime& operandLifeTime) { + return static_cast(operandLifeTime); +} + +nn::GeneralResult unvalidatedConvert(const nn::DataLocation& location) { + VERIFY_LE_INT32_MAX(location.poolIndex) + << "DataLocation: pool index must be <= std::numeric_limits::max()"; + return DataLocation{ + .poolIndex = static_cast(location.poolIndex), + .offset = static_cast(location.offset), + .length = static_cast(location.length), + }; +} + +nn::GeneralResult> unvalidatedConvert( + const nn::Operand::ExtraParams& extraParams) { + return std::visit( + overloaded{ + [](const nn::Operand::NoParams&) + -> nn::GeneralResult> { + return std::nullopt; + }, + [](const nn::Operand::SymmPerChannelQuantParams& symmPerChannelQuantParams) + -> nn::GeneralResult> { + if (symmPerChannelQuantParams.channelDim > + std::numeric_limits::max()) { + // Using explicit type conversion because std::optional in successful + // result confuses the compiler. + return (NN_ERROR() << "symmPerChannelQuantParams.channelDim must be <= " + "std::numeric_limits::max(), received: " + << symmPerChannelQuantParams.channelDim) + . + operator nn::GeneralResult>(); + } + return OperandExtraParams::make( + SymmPerChannelQuantParams{ + .scales = symmPerChannelQuantParams.scales, + .channelDim = static_cast( + symmPerChannelQuantParams.channelDim), + }); + }, + [](const nn::Operand::ExtensionParams& extensionParams) + -> nn::GeneralResult> { + return OperandExtraParams::make( + extensionParams); + }, + }, + extraParams); +} + +nn::GeneralResult unvalidatedConvert(const nn::Operand& operand) { + return Operand{ + .type = NN_TRY(unvalidatedConvert(operand.type)), + .dimensions = NN_TRY(toSigned(operand.dimensions)), + .scale = operand.scale, + .zeroPoint = operand.zeroPoint, + .lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)), + .location = NN_TRY(unvalidatedConvert(operand.location)), + .extraParams = NN_TRY(unvalidatedConvert(operand.extraParams)), + }; +} + +nn::GeneralResult unvalidatedConvert(const nn::OperationType& operationType) { + return static_cast(operationType); +} + +nn::GeneralResult unvalidatedConvert(const nn::Operation& operation) { + return Operation{ + .type = NN_TRY(unvalidatedConvert(operation.type)), + .inputs = NN_TRY(toSigned(operation.inputs)), + .outputs = NN_TRY(toSigned(operation.outputs)), + }; +} + +nn::GeneralResult unvalidatedConvert(const nn::Model::Subgraph& subgraph) { + return Subgraph{ + .operands = NN_TRY(unvalidatedConvert(subgraph.operands)), + .operations = NN_TRY(unvalidatedConvert(subgraph.operations)), + .inputIndexes = NN_TRY(toSigned(subgraph.inputIndexes)), + .outputIndexes = NN_TRY(toSigned(subgraph.outputIndexes)), + }; +} + +nn::GeneralResult> unvalidatedConvert( + const nn::Model::OperandValues& operandValues) { + return std::vector(operandValues.data(), operandValues.data() + operandValues.size()); +} + +nn::GeneralResult unvalidatedConvert( + const nn::Model::ExtensionNameAndPrefix& extensionNameToPrefix) { + return ExtensionNameAndPrefix{ + .name = extensionNameToPrefix.name, + .prefix = extensionNameToPrefix.prefix, + }; +} + +nn::GeneralResult unvalidatedConvert(const nn::Model& model) { + return Model{ + .main = NN_TRY(unvalidatedConvert(model.main)), + .referenced = NN_TRY(unvalidatedConvert(model.referenced)), + .operandValues = NN_TRY(unvalidatedConvert(model.operandValues)), + .pools = NN_TRY(unvalidatedConvert(model.pools)), + .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, + .extensionNameToPrefix = NN_TRY(unvalidatedConvert(model.extensionNameToPrefix)), + }; +} + +nn::GeneralResult unvalidatedConvert(const nn::Priority& priority) { + return static_cast(priority); +} + +nn::GeneralResult unvalidatedConvert(const nn::Request& request) { + return Request{ + .inputs = NN_TRY(unvalidatedConvert(request.inputs)), + .outputs = NN_TRY(unvalidatedConvert(request.outputs)), + .pools = NN_TRY(unvalidatedConvert(request.pools)), + }; +} + +nn::GeneralResult unvalidatedConvert( + const nn::Request::Argument& requestArgument) { + if (requestArgument.lifetime == nn::Request::Argument::LifeTime::POINTER) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) + << "Request cannot be unvalidatedConverted because it contains pointer-based memory"; + } + const bool hasNoValue = requestArgument.lifetime == nn::Request::Argument::LifeTime::NO_VALUE; + return RequestArgument{ + .hasNoValue = hasNoValue, + .location = NN_TRY(unvalidatedConvert(requestArgument.location)), + .dimensions = NN_TRY(toSigned(requestArgument.dimensions)), + }; +} + +nn::GeneralResult unvalidatedConvert(const nn::Request::MemoryPool& memoryPool) { + return std::visit( + overloaded{ + [](const nn::SharedMemory& memory) -> nn::GeneralResult { + return RequestMemoryPool::make( + NN_TRY(unvalidatedConvert(memory))); + }, + [](const nn::Request::MemoryDomainToken& token) + -> nn::GeneralResult { + return RequestMemoryPool::make( + underlyingType(token)); + }, + [](const nn::SharedBuffer& /*buffer*/) { + return (NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) + << "Unable to make memory pool from IBuffer") + . + operator nn::GeneralResult(); + }, + }, + memoryPool); +} + +nn::GeneralResult unvalidatedConvert(const nn::Timing& timing) { + return Timing{ + .timeOnDevice = NN_TRY(unvalidatedConvert(timing.timeOnDevice)), + .timeInDriver = NN_TRY(unvalidatedConvert(timing.timeInDriver)), + }; +} + +nn::GeneralResult unvalidatedConvert(const nn::Duration& duration) { + const uint64_t nanoseconds = duration.count(); + if (nanoseconds > std::numeric_limits::max()) { + return std::numeric_limits::max(); + } + return static_cast(nanoseconds); +} + +nn::GeneralResult unvalidatedConvert(const nn::OptionalDuration& optionalDuration) { + if (!optionalDuration.has_value()) { + return kNoTiming; + } + return unvalidatedConvert(optionalDuration.value()); +} + +nn::GeneralResult unvalidatedConvert(const nn::OptionalTimePoint& optionalTimePoint) { + if (!optionalTimePoint.has_value()) { + return kNoTiming; + } + return unvalidatedConvert(optionalTimePoint->time_since_epoch()); +} + +nn::GeneralResult unvalidatedConvert(const nn::SyncFence& syncFence) { + auto duplicatedFd = NN_TRY(nn::dupFd(syncFence.getFd())); + return ndk::ScopedFileDescriptor(duplicatedFd.release()); +} + +nn::GeneralResult unvalidatedConvertCache( + const nn::SharedHandle& handle) { + if (handle->ints.size() != 0) { + NN_ERROR() << "Cache handle must not contain ints"; + } + if (handle->fds.size() != 1) { + NN_ERROR() << "Cache handle must contain exactly one fd but contains " + << handle->fds.size(); + } + auto duplicatedFd = NN_TRY(nn::dupFd(handle->fds.front().get())); + return ndk::ScopedFileDescriptor(duplicatedFd.release()); +} + +nn::GeneralResult> convert(const nn::CacheToken& cacheToken) { + return unvalidatedConvert(cacheToken); +} + +nn::GeneralResult convert(const nn::BufferDesc& bufferDesc) { + return validatedConvert(bufferDesc); +} + +nn::GeneralResult convert(const nn::MeasureTiming& measureTiming) { + return validatedConvert(measureTiming); +} + nn::GeneralResult convert(const nn::SharedMemory& memory) { return validatedConvert(memory); } @@ -715,11 +1017,62 @@ nn::GeneralResult convert(const nn::ErrorStatus& errorStatus) { return validatedConvert(errorStatus); } +nn::GeneralResult convert(const nn::ExecutionPreference& executionPreference) { + return validatedConvert(executionPreference); +} + +nn::GeneralResult convert(const nn::Model& model) { + return validatedConvert(model); +} + +nn::GeneralResult convert(const nn::Priority& priority) { + return validatedConvert(priority); +} + +nn::GeneralResult convert(const nn::Request& request) { + return validatedConvert(request); +} + +nn::GeneralResult convert(const nn::Timing& timing) { + return validatedConvert(timing); +} + +nn::GeneralResult convert(const nn::OptionalDuration& optionalDuration) { + return validatedConvert(optionalDuration); +} + +nn::GeneralResult convert(const nn::OptionalTimePoint& outputShapes) { + return validatedConvert(outputShapes); +} + +nn::GeneralResult> convert(const std::vector& bufferRoles) { + return validatedConvert(bufferRoles); +} + nn::GeneralResult> convert( const std::vector& outputShapes) { return validatedConvert(outputShapes); } +nn::GeneralResult> convert( + const std::vector& cacheHandles) { + const auto version = NN_TRY(hal::utils::makeGeneralFailure(nn::validate(cacheHandles))); + if (version > kVersion) { + return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; + } + std::vector cacheFds; + cacheFds.reserve(cacheHandles.size()); + for (const auto& cacheHandle : cacheHandles) { + cacheFds.push_back(NN_TRY(unvalidatedConvertCache(cacheHandle))); + } + return cacheFds; +} + +nn::GeneralResult> convert( + const std::vector& syncFences) { + return unvalidatedConvert(syncFences); +} + nn::GeneralResult> toSigned(const std::vector& vec) { if (!std::all_of(vec.begin(), vec.end(), [](uint32_t v) { return v <= std::numeric_limits::max(); })) { diff --git a/neuralnetworks/aidl/utils/src/Device.cpp b/neuralnetworks/aidl/utils/src/Device.cpp new file mode 100644 index 0000000000..02ca861b6b --- /dev/null +++ b/neuralnetworks/aidl/utils/src/Device.cpp @@ -0,0 +1,294 @@ +/* + * 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 "Device.h" + +#include "Buffer.h" +#include "Callbacks.h" +#include "Conversions.h" +#include "PreparedModel.h" +#include "ProtectCallback.h" +#include "Utils.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on AIDL interface +// lifetimes across processes and for protecting asynchronous calls across AIDL. + +namespace aidl::android::hardware::neuralnetworks::utils { + +namespace { + +nn::GeneralResult>> convert( + const std::vector& preparedModels) { + std::vector> aidlPreparedModels(preparedModels.size()); + for (size_t i = 0; i < preparedModels.size(); ++i) { + std::any underlyingResource = preparedModels[i]->getUnderlyingResource(); + if (const auto* aidlPreparedModel = + std::any_cast>(&underlyingResource)) { + aidlPreparedModels[i] = *aidlPreparedModel; + } else { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) + << "Unable to convert from nn::IPreparedModel to aidl_hal::IPreparedModel"; + } + } + return aidlPreparedModels; +} + +nn::GeneralResult getCapabilitiesFrom(IDevice* device) { + CHECK(device != nullptr); + Capabilities capabilities; + const auto ret = device->getCapabilities(&capabilities); + HANDLE_ASTATUS(ret) << "getCapabilities failed"; + return nn::convert(capabilities); +} + +nn::GeneralResult getVersionStringFrom(aidl_hal::IDevice* device) { + CHECK(device != nullptr); + std::string version; + const auto ret = device->getVersionString(&version); + HANDLE_ASTATUS(ret) << "getVersionString failed"; + return version; +} + +nn::GeneralResult getDeviceTypeFrom(aidl_hal::IDevice* device) { + CHECK(device != nullptr); + DeviceType deviceType; + const auto ret = device->getType(&deviceType); + HANDLE_ASTATUS(ret) << "getDeviceType failed"; + return nn::convert(deviceType); +} + +nn::GeneralResult> getSupportedExtensionsFrom( + aidl_hal::IDevice* device) { + CHECK(device != nullptr); + std::vector supportedExtensions; + const auto ret = device->getSupportedExtensions(&supportedExtensions); + HANDLE_ASTATUS(ret) << "getExtensions failed"; + return nn::convert(supportedExtensions); +} + +nn::GeneralResult> getNumberOfCacheFilesNeededFrom( + aidl_hal::IDevice* device) { + CHECK(device != nullptr); + NumberOfCacheFiles numberOfCacheFiles; + const auto ret = device->getNumberOfCacheFilesNeeded(&numberOfCacheFiles); + HANDLE_ASTATUS(ret) << "getNumberOfCacheFilesNeeded failed"; + + if (numberOfCacheFiles.numDataCache < 0 || numberOfCacheFiles.numModelCache < 0) { + return NN_ERROR() << "Driver reported negative numer of cache files needed"; + } + if (static_cast(numberOfCacheFiles.numModelCache) > nn::kMaxNumberOfCacheFiles) { + return NN_ERROR() << "getNumberOfCacheFilesNeeded returned numModelCache files greater " + "than allowed max (" + << numberOfCacheFiles.numModelCache << " vs " + << nn::kMaxNumberOfCacheFiles << ")"; + } + if (static_cast(numberOfCacheFiles.numDataCache) > nn::kMaxNumberOfCacheFiles) { + return NN_ERROR() << "getNumberOfCacheFilesNeeded returned numDataCache files greater " + "than allowed max (" + << numberOfCacheFiles.numDataCache << " vs " << nn::kMaxNumberOfCacheFiles + << ")"; + } + return std::make_pair(numberOfCacheFiles.numDataCache, numberOfCacheFiles.numModelCache); +} + +} // namespace + +nn::GeneralResult> Device::create( + std::string name, std::shared_ptr device) { + if (name.empty()) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) + << "aidl_hal::utils::Device::create must have non-empty name"; + } + if (device == nullptr) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) + << "aidl_hal::utils::Device::create must have non-null device"; + } + + auto versionString = NN_TRY(getVersionStringFrom(device.get())); + const auto deviceType = NN_TRY(getDeviceTypeFrom(device.get())); + auto extensions = NN_TRY(getSupportedExtensionsFrom(device.get())); + auto capabilities = NN_TRY(getCapabilitiesFrom(device.get())); + const auto numberOfCacheFilesNeeded = NN_TRY(getNumberOfCacheFilesNeededFrom(device.get())); + + auto deathHandler = NN_TRY(DeathHandler::create(device)); + return std::make_shared( + PrivateConstructorTag{}, std::move(name), std::move(versionString), deviceType, + std::move(extensions), std::move(capabilities), numberOfCacheFilesNeeded, + std::move(device), std::move(deathHandler)); +} + +Device::Device(PrivateConstructorTag /*tag*/, std::string name, std::string versionString, + nn::DeviceType deviceType, std::vector extensions, + nn::Capabilities capabilities, + std::pair numberOfCacheFilesNeeded, + std::shared_ptr device, DeathHandler deathHandler) + : kName(std::move(name)), + kVersionString(std::move(versionString)), + kDeviceType(deviceType), + kExtensions(std::move(extensions)), + kCapabilities(std::move(capabilities)), + kNumberOfCacheFilesNeeded(numberOfCacheFilesNeeded), + kDevice(std::move(device)), + kDeathHandler(std::move(deathHandler)) {} + +const std::string& Device::getName() const { + return kName; +} + +const std::string& Device::getVersionString() const { + return kVersionString; +} + +nn::Version Device::getFeatureLevel() const { + return nn::Version::ANDROID_S; +} + +nn::DeviceType Device::getType() const { + return kDeviceType; +} + +bool Device::isUpdatable() const { + return false; +} + +const std::vector& Device::getSupportedExtensions() const { + return kExtensions; +} + +const nn::Capabilities& Device::getCapabilities() const { + return kCapabilities; +} + +std::pair Device::getNumberOfCacheFilesNeeded() const { + return kNumberOfCacheFilesNeeded; +} + +nn::GeneralResult Device::wait() const { + const auto ret = ndk::ScopedAStatus::fromStatus(AIBinder_ping(kDevice->asBinder().get())); + HANDLE_ASTATUS(ret) << "ping failed"; + return {}; +} + +nn::GeneralResult> Device::getSupportedOperations(const nn::Model& model) const { + // Ensure that model is ready for IPC. + std::optional maybeModelInShared; + const nn::Model& modelInShared = + NN_TRY(hal::utils::flushDataFromPointerToShared(&model, &maybeModelInShared)); + + const auto aidlModel = NN_TRY(convert(modelInShared)); + + std::vector supportedOperations; + const auto ret = kDevice->getSupportedOperations(aidlModel, &supportedOperations); + HANDLE_ASTATUS(ret) << "getSupportedOperations failed"; + + return supportedOperations; +} + +nn::GeneralResult Device::prepareModel( + const nn::Model& model, nn::ExecutionPreference preference, nn::Priority priority, + nn::OptionalTimePoint deadline, const std::vector& modelCache, + const std::vector& dataCache, const nn::CacheToken& token) const { + // Ensure that model is ready for IPC. + std::optional maybeModelInShared; + const nn::Model& modelInShared = + NN_TRY(hal::utils::flushDataFromPointerToShared(&model, &maybeModelInShared)); + + const auto aidlModel = NN_TRY(convert(modelInShared)); + const auto aidlPreference = NN_TRY(convert(preference)); + const auto aidlPriority = NN_TRY(convert(priority)); + const auto aidlDeadline = NN_TRY(convert(deadline)); + const auto aidlModelCache = NN_TRY(convert(modelCache)); + const auto aidlDataCache = NN_TRY(convert(dataCache)); + const auto aidlToken = NN_TRY(convert(token)); + + const auto cb = ndk::SharedRefBase::make(); + const auto scoped = kDeathHandler.protectCallback(cb.get()); + + const auto ret = kDevice->prepareModel(aidlModel, aidlPreference, aidlPriority, aidlDeadline, + aidlModelCache, aidlDataCache, aidlToken, cb); + HANDLE_ASTATUS(ret) << "prepareModel failed"; + + return cb->get(); +} + +nn::GeneralResult Device::prepareModelFromCache( + nn::OptionalTimePoint deadline, const std::vector& modelCache, + const std::vector& dataCache, const nn::CacheToken& token) const { + const auto aidlDeadline = NN_TRY(convert(deadline)); + const auto aidlModelCache = NN_TRY(convert(modelCache)); + const auto aidlDataCache = NN_TRY(convert(dataCache)); + const auto aidlToken = NN_TRY(convert(token)); + + const auto cb = ndk::SharedRefBase::make(); + const auto scoped = kDeathHandler.protectCallback(cb.get()); + + const auto ret = kDevice->prepareModelFromCache(aidlDeadline, aidlModelCache, aidlDataCache, + aidlToken, cb); + HANDLE_ASTATUS(ret) << "prepareModelFromCache failed"; + + return cb->get(); +} + +nn::GeneralResult Device::allocate( + const nn::BufferDesc& desc, const std::vector& preparedModels, + const std::vector& inputRoles, + const std::vector& outputRoles) const { + const auto aidlDesc = NN_TRY(convert(desc)); + const auto aidlPreparedModels = NN_TRY(convert(preparedModels)); + const auto aidlInputRoles = NN_TRY(convert(inputRoles)); + const auto aidlOutputRoles = NN_TRY(convert(outputRoles)); + + std::vector aidlPreparedModelParcels; + aidlPreparedModelParcels.reserve(aidlPreparedModels.size()); + for (const auto& preparedModel : aidlPreparedModels) { + aidlPreparedModelParcels.push_back({.preparedModel = preparedModel}); + } + + DeviceBuffer buffer; + const auto ret = kDevice->allocate(aidlDesc, aidlPreparedModelParcels, aidlInputRoles, + aidlOutputRoles, &buffer); + HANDLE_ASTATUS(ret) << "IDevice::allocate failed"; + + if (buffer.token < 0) { + return NN_ERROR() << "IDevice::allocate returned negative token"; + } + + return Buffer::create(buffer.buffer, static_cast(buffer.token)); +} + +DeathMonitor* Device::getDeathMonitor() const { + return kDeathHandler.getDeathMonitor().get(); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/src/PreparedModel.cpp b/neuralnetworks/aidl/utils/src/PreparedModel.cpp new file mode 100644 index 0000000000..aee4d90dab --- /dev/null +++ b/neuralnetworks/aidl/utils/src/PreparedModel.cpp @@ -0,0 +1,172 @@ +/* + * 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 "PreparedModel.h" + +#include "Callbacks.h" +#include "Conversions.h" +#include "ProtectCallback.h" +#include "Utils.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on AIDL interface +// lifetimes across processes and for protecting asynchronous calls across AIDL. + +namespace aidl::android::hardware::neuralnetworks::utils { +namespace { + +nn::GeneralResult, nn::Timing>> convertExecutionResults( + const std::vector& outputShapes, const Timing& timing) { + return std::make_pair(NN_TRY(nn::convert(outputShapes)), NN_TRY(nn::convert(timing))); +} + +nn::GeneralResult> convertFencedExecutionResults( + ErrorStatus status, const aidl_hal::Timing& timingLaunched, + const aidl_hal::Timing& timingFenced) { + HANDLE_HAL_STATUS(status) << "fenced execution callback info failed with " << toString(status); + return std::make_pair(NN_TRY(nn::convert(timingLaunched)), NN_TRY(nn::convert(timingFenced))); +} + +} // namespace + +nn::GeneralResult> PreparedModel::create( + std::shared_ptr preparedModel) { + if (preparedModel == nullptr) { + return NN_ERROR() + << "aidl_hal::utils::PreparedModel::create must have non-null preparedModel"; + } + + return std::make_shared(PrivateConstructorTag{}, std::move(preparedModel)); +} + +PreparedModel::PreparedModel(PrivateConstructorTag /*tag*/, + std::shared_ptr preparedModel) + : kPreparedModel(std::move(preparedModel)) {} + +nn::ExecutionResult, nn::Timing>> PreparedModel::execute( + const nn::Request& request, nn::MeasureTiming measure, + const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration) const { + // Ensure that request is ready for IPC. + std::optional maybeRequestInShared; + const nn::Request& requestInShared = NN_TRY(hal::utils::makeExecutionFailure( + hal::utils::flushDataFromPointerToShared(&request, &maybeRequestInShared))); + + const auto aidlRequest = NN_TRY(hal::utils::makeExecutionFailure(convert(requestInShared))); + const auto aidlMeasure = NN_TRY(hal::utils::makeExecutionFailure(convert(measure))); + const auto aidlDeadline = NN_TRY(hal::utils::makeExecutionFailure(convert(deadline))); + const auto aidlLoopTimeoutDuration = + NN_TRY(hal::utils::makeExecutionFailure(convert(loopTimeoutDuration))); + + ExecutionResult executionResult; + const auto ret = kPreparedModel->executeSynchronously( + aidlRequest, aidlMeasure, aidlDeadline, aidlLoopTimeoutDuration, &executionResult); + HANDLE_ASTATUS(ret) << "executeSynchronously failed"; + if (!executionResult.outputSufficientSize) { + auto canonicalOutputShapes = + nn::convert(executionResult.outputShapes).value_or(std::vector{}); + return NN_ERROR(nn::ErrorStatus::OUTPUT_INSUFFICIENT_SIZE, std::move(canonicalOutputShapes)) + << "execution failed with " << nn::ErrorStatus::OUTPUT_INSUFFICIENT_SIZE; + } + auto [outputShapes, timing] = NN_TRY(hal::utils::makeExecutionFailure( + convertExecutionResults(executionResult.outputShapes, executionResult.timing))); + + NN_TRY(hal::utils::makeExecutionFailure( + hal::utils::unflushDataFromSharedToPointer(request, maybeRequestInShared))); + + return std::make_pair(std::move(outputShapes), timing); +} + +nn::GeneralResult> +PreparedModel::executeFenced(const nn::Request& request, const std::vector& waitFor, + nn::MeasureTiming measure, const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration, + const nn::OptionalDuration& timeoutDurationAfterFence) const { + // Ensure that request is ready for IPC. + std::optional maybeRequestInShared; + const nn::Request& requestInShared = + NN_TRY(hal::utils::flushDataFromPointerToShared(&request, &maybeRequestInShared)); + + const auto aidlRequest = NN_TRY(convert(requestInShared)); + const auto aidlWaitFor = NN_TRY(convert(waitFor)); + const auto aidlMeasure = NN_TRY(convert(measure)); + const auto aidlDeadline = NN_TRY(convert(deadline)); + const auto aidlLoopTimeoutDuration = NN_TRY(convert(loopTimeoutDuration)); + const auto aidlTimeoutDurationAfterFence = NN_TRY(convert(timeoutDurationAfterFence)); + + FencedExecutionResult result; + const auto ret = kPreparedModel->executeFenced(aidlRequest, aidlWaitFor, aidlMeasure, + aidlDeadline, aidlLoopTimeoutDuration, + aidlTimeoutDurationAfterFence, &result); + HANDLE_ASTATUS(ret) << "executeFenced failed"; + + auto resultSyncFence = nn::SyncFence::createAsSignaled(); + if (result.syncFence.get() != -1) { + resultSyncFence = NN_TRY(nn::convert(result.syncFence)); + } + + auto callback = result.callback; + if (callback == nullptr) { + return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) << "callback is null"; + } + + // If executeFenced required the request memory to be moved into shared memory, block here until + // the fenced execution has completed and flush the memory back. + if (maybeRequestInShared.has_value()) { + const auto state = resultSyncFence.syncWait({}); + if (state != nn::SyncFence::FenceState::SIGNALED) { + return NN_ERROR() << "syncWait failed with " << state; + } + NN_TRY(hal::utils::unflushDataFromSharedToPointer(request, maybeRequestInShared)); + } + + // Create callback which can be used to retrieve the execution error status and timings. + nn::ExecuteFencedInfoCallback resultCallback = + [callback]() -> nn::GeneralResult> { + ErrorStatus errorStatus; + Timing timingLaunched; + Timing timingFenced; + const auto ret = callback->getExecutionInfo(&timingLaunched, &timingFenced, &errorStatus); + HANDLE_ASTATUS(ret) << "fenced execution callback getExecutionInfo failed"; + return convertFencedExecutionResults(errorStatus, timingLaunched, timingFenced); + }; + + return std::make_pair(std::move(resultSyncFence), std::move(resultCallback)); +} + +nn::GeneralResult PreparedModel::configureExecutionBurst() const { + return hal::V1_0::utils::Burst::create(shared_from_this()); +} + +std::any PreparedModel::getUnderlyingResource() const { + std::shared_ptr resource = kPreparedModel; + return resource; +} + +} // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/src/ProtectCallback.cpp b/neuralnetworks/aidl/utils/src/ProtectCallback.cpp new file mode 100644 index 0000000000..124641cbb8 --- /dev/null +++ b/neuralnetworks/aidl/utils/src/ProtectCallback.cpp @@ -0,0 +1,112 @@ +/* + * 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 "ProtectCallback.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "Utils.h" + +namespace aidl::android::hardware::neuralnetworks::utils { + +void DeathMonitor::serviceDied() { + std::lock_guard guard(mMutex); + std::for_each(mObjects.begin(), mObjects.end(), + [](hal::utils::IProtectedCallback* killable) { killable->notifyAsDeadObject(); }); +} + +void DeathMonitor::serviceDied(void* cookie) { + auto deathMonitor = static_cast(cookie); + deathMonitor->serviceDied(); +} + +void DeathMonitor::add(hal::utils::IProtectedCallback* killable) const { + CHECK(killable != nullptr); + std::lock_guard guard(mMutex); + mObjects.push_back(killable); +} + +void DeathMonitor::remove(hal::utils::IProtectedCallback* killable) const { + CHECK(killable != nullptr); + std::lock_guard guard(mMutex); + const auto removedIter = std::remove(mObjects.begin(), mObjects.end(), killable); + mObjects.erase(removedIter); +} + +nn::GeneralResult DeathHandler::create(std::shared_ptr object) { + if (object == nullptr) { + return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) + << "utils::DeathHandler::create must have non-null object"; + } + auto deathMonitor = std::make_shared(); + auto deathRecipient = ndk::ScopedAIBinder_DeathRecipient( + AIBinder_DeathRecipient_new(DeathMonitor::serviceDied)); + + // If passed a local binder, AIBinder_linkToDeath will do nothing and return + // STATUS_INVALID_OPERATION. We ignore this case because we only use local binders in tests + // where this is not an error. + if (object->isRemote()) { + const auto ret = ndk::ScopedAStatus::fromStatus(AIBinder_linkToDeath( + object->asBinder().get(), deathRecipient.get(), deathMonitor.get())); + HANDLE_ASTATUS(ret) << "AIBinder_linkToDeath failed"; + } + + return DeathHandler(std::move(object), std::move(deathRecipient), std::move(deathMonitor)); +} + +DeathHandler::DeathHandler(std::shared_ptr object, + ndk::ScopedAIBinder_DeathRecipient deathRecipient, + std::shared_ptr deathMonitor) + : kObject(std::move(object)), + kDeathRecipient(std::move(deathRecipient)), + kDeathMonitor(std::move(deathMonitor)) { + CHECK(kObject != nullptr); + CHECK(kDeathRecipient.get() != nullptr); + CHECK(kDeathMonitor != nullptr); +} + +DeathHandler::~DeathHandler() { + if (kObject != nullptr && kDeathRecipient.get() != nullptr && kDeathMonitor != nullptr) { + const auto ret = ndk::ScopedAStatus::fromStatus(AIBinder_unlinkToDeath( + kObject->asBinder().get(), kDeathRecipient.get(), kDeathMonitor.get())); + const auto maybeSuccess = handleTransportError(ret); + if (!maybeSuccess.ok()) { + LOG(ERROR) << maybeSuccess.error().message; + } + } +} + +[[nodiscard]] ::android::base::ScopeGuard DeathHandler::protectCallback( + hal::utils::IProtectedCallback* killable) const { + CHECK(killable != nullptr); + kDeathMonitor->add(killable); + return ::android::base::make_scope_guard( + [deathMonitor = kDeathMonitor, killable] { deathMonitor->remove(killable); }); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/src/Service.cpp b/neuralnetworks/aidl/utils/src/Service.cpp new file mode 100644 index 0000000000..5ec6ded5e5 --- /dev/null +++ b/neuralnetworks/aidl/utils/src/Service.cpp @@ -0,0 +1,50 @@ +/* + * 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 "Service.h" + +#include +#include + +#include +#include +#include +#include +#include + +#include "Device.h" + +namespace aidl::android::hardware::neuralnetworks::utils { + +nn::GeneralResult getDevice(const std::string& name) { + hal::utils::ResilientDevice::Factory makeDevice = + [name](bool blocking) -> nn::GeneralResult { + auto service = blocking ? IDevice::fromBinder( + ndk::SpAIBinder(AServiceManager_getService(name.c_str()))) + : IDevice::fromBinder(ndk::SpAIBinder( + AServiceManager_checkService(name.c_str()))); + if (service == nullptr) { + return NN_ERROR() << (blocking ? "AServiceManager_getService" + : "AServiceManager_checkService") + << " returned nullptr"; + } + return Device::create(name, std::move(service)); + }; + + return hal::utils::ResilientDevice::create(std::move(makeDevice)); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/src/Utils.cpp b/neuralnetworks/aidl/utils/src/Utils.cpp index 8d00e5926a..95516c854b 100644 --- a/neuralnetworks/aidl/utils/src/Utils.cpp +++ b/neuralnetworks/aidl/utils/src/Utils.cpp @@ -16,13 +16,12 @@ #include "Utils.h" +#include #include namespace aidl::android::hardware::neuralnetworks::utils { namespace { -using ::android::nn::GeneralResult; - template nn::GeneralResult> cloneVec(const std::vector& arguments) { std::vector clonedObjects; @@ -34,13 +33,13 @@ nn::GeneralResult> cloneVec(const std::vector& arguments } template -GeneralResult> clone(const std::vector& arguments) { +nn::GeneralResult> clone(const std::vector& arguments) { return cloneVec(arguments); } } // namespace -GeneralResult clone(const Memory& memory) { +nn::GeneralResult clone(const Memory& memory) { common::NativeHandle nativeHandle; nativeHandle.ints = memory.handle.ints; nativeHandle.fds.reserve(memory.handle.fds.size()); @@ -58,7 +57,7 @@ GeneralResult clone(const Memory& memory) { }; } -GeneralResult clone(const RequestMemoryPool& requestPool) { +nn::GeneralResult clone(const RequestMemoryPool& requestPool) { using Tag = RequestMemoryPool::Tag; switch (requestPool.getTag()) { case Tag::pool: @@ -70,10 +69,10 @@ GeneralResult clone(const RequestMemoryPool& requestPool) { // compiler. return (NN_ERROR() << "Unrecognized request pool tag: " << requestPool.getTag()) . - operator GeneralResult(); + operator nn::GeneralResult(); } -GeneralResult clone(const Request& request) { +nn::GeneralResult clone(const Request& request) { return Request{ .inputs = request.inputs, .outputs = request.outputs, @@ -81,7 +80,7 @@ GeneralResult clone(const Request& request) { }; } -GeneralResult clone(const Model& model) { +nn::GeneralResult clone(const Model& model) { return Model{ .main = model.main, .referenced = model.referenced, @@ -92,4 +91,20 @@ GeneralResult clone(const Model& model) { }; } +nn::GeneralResult handleTransportError(const ndk::ScopedAStatus& ret) { + if (ret.getStatus() == STATUS_DEAD_OBJECT) { + return nn::error(nn::ErrorStatus::DEAD_OBJECT) + << "Binder transaction returned STATUS_DEAD_OBJECT: " << ret.getDescription(); + } + if (ret.isOk()) { + return {}; + } + if (ret.getExceptionCode() != EX_SERVICE_SPECIFIC) { + return nn::error(nn::ErrorStatus::GENERAL_FAILURE) + << "Binder transaction returned exception: " << ret.getDescription(); + } + return nn::error(static_cast(ret.getServiceSpecificError())) + << ret.getMessage(); +} + } // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/test/BufferTest.cpp b/neuralnetworks/aidl/utils/test/BufferTest.cpp new file mode 100644 index 0000000000..9736160395 --- /dev/null +++ b/neuralnetworks/aidl/utils/test/BufferTest.cpp @@ -0,0 +1,212 @@ +/* + * 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 "MockBuffer.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace aidl::android::hardware::neuralnetworks::utils { +namespace { + +using ::testing::_; +using ::testing::Invoke; +using ::testing::InvokeWithoutArgs; +using ::testing::Return; + +const auto kMemory = nn::createSharedMemory(4).value(); +const std::shared_ptr kInvalidBuffer; +constexpr auto kInvalidToken = nn::Request::MemoryDomainToken{0}; +constexpr auto kToken = nn::Request::MemoryDomainToken{1}; + +constexpr auto makeStatusOk = [] { return ndk::ScopedAStatus::ok(); }; + +constexpr auto makeGeneralFailure = [] { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(ErrorStatus::GENERAL_FAILURE)); +}; +constexpr auto makeGeneralTransportFailure = [] { + return ndk::ScopedAStatus::fromStatus(STATUS_NO_MEMORY); +}; +constexpr auto makeDeadObjectFailure = [] { + return ndk::ScopedAStatus::fromStatus(STATUS_DEAD_OBJECT); +}; + +} // namespace + +TEST(BufferTest, invalidBuffer) { + // run test + const auto result = Buffer::create(kInvalidBuffer, kToken); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(BufferTest, invalidToken) { + // setup call + const auto mockBuffer = MockBuffer::create(); + + // run test + const auto result = Buffer::create(mockBuffer, kInvalidToken); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(BufferTest, create) { + // setup call + const auto mockBuffer = MockBuffer::create(); + const auto buffer = Buffer::create(mockBuffer, kToken).value(); + + // run test + const auto token = buffer->getToken(); + + // verify result + EXPECT_EQ(token, kToken); +} + +TEST(BufferTest, copyTo) { + // setup call + const auto mockBuffer = MockBuffer::create(); + const auto buffer = Buffer::create(mockBuffer, kToken).value(); + EXPECT_CALL(*mockBuffer, copyTo(_)).Times(1).WillOnce(InvokeWithoutArgs(makeStatusOk)); + + // run test + const auto result = buffer->copyTo(kMemory); + + // verify result + EXPECT_TRUE(result.has_value()) << result.error().message; +} + +TEST(BufferTest, copyToError) { + // setup test + const auto mockBuffer = MockBuffer::create(); + const auto buffer = Buffer::create(mockBuffer, kToken).value(); + EXPECT_CALL(*mockBuffer, copyTo(_)).Times(1).WillOnce(InvokeWithoutArgs(makeGeneralFailure)); + + // run test + const auto result = buffer->copyTo(kMemory); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(BufferTest, copyToTransportFailure) { + // setup test + const auto mockBuffer = MockBuffer::create(); + const auto buffer = Buffer::create(mockBuffer, kToken).value(); + EXPECT_CALL(*mockBuffer, copyTo(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = buffer->copyTo(kMemory); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(BufferTest, copyToDeadObject) { + // setup test + const auto mockBuffer = MockBuffer::create(); + const auto buffer = Buffer::create(mockBuffer, kToken).value(); + EXPECT_CALL(*mockBuffer, copyTo(_)).Times(1).WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = buffer->copyTo(kMemory); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST(BufferTest, copyFrom) { + // setup call + const auto mockBuffer = MockBuffer::create(); + const auto buffer = Buffer::create(mockBuffer, kToken).value(); + EXPECT_CALL(*mockBuffer, copyFrom(_, _)).Times(1).WillOnce(InvokeWithoutArgs(makeStatusOk)); + + // run test + const auto result = buffer->copyFrom(kMemory, {}); + + // verify result + EXPECT_TRUE(result.has_value()); +} + +TEST(BufferTest, copyFromError) { + // setup test + const auto mockBuffer = MockBuffer::create(); + const auto buffer = Buffer::create(mockBuffer, kToken).value(); + EXPECT_CALL(*mockBuffer, copyFrom(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); + + // run test + const auto result = buffer->copyFrom(kMemory, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(BufferTest, copyFromTransportFailure) { + // setup test + const auto mockBuffer = MockBuffer::create(); + const auto buffer = Buffer::create(mockBuffer, kToken).value(); + EXPECT_CALL(*mockBuffer, copyFrom(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = buffer->copyFrom(kMemory, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(BufferTest, copyFromDeadObject) { + // setup test + const auto mockBuffer = MockBuffer::create(); + const auto buffer = Buffer::create(mockBuffer, kToken).value(); + EXPECT_CALL(*mockBuffer, copyFrom(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = buffer->copyFrom(kMemory, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/test/DeviceTest.cpp b/neuralnetworks/aidl/utils/test/DeviceTest.cpp new file mode 100644 index 0000000000..e53b0a8df9 --- /dev/null +++ b/neuralnetworks/aidl/utils/test/DeviceTest.cpp @@ -0,0 +1,861 @@ +/* + * 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 "MockBuffer.h" +#include "MockDevice.h" +#include "MockPreparedModel.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace aidl::android::hardware::neuralnetworks::utils { +namespace { + +namespace nn = ::android::nn; +using ::testing::_; +using ::testing::DoAll; +using ::testing::Invoke; +using ::testing::InvokeWithoutArgs; +using ::testing::SetArgPointee; + +const nn::Model kSimpleModel = { + .main = {.operands = {{.type = nn::OperandType::TENSOR_FLOAT32, + .dimensions = {1}, + .lifetime = nn::Operand::LifeTime::SUBGRAPH_INPUT}, + {.type = nn::OperandType::TENSOR_FLOAT32, + .dimensions = {1}, + .lifetime = nn::Operand::LifeTime::SUBGRAPH_OUTPUT}}, + .operations = {{.type = nn::OperationType::RELU, .inputs = {0}, .outputs = {1}}}, + .inputIndexes = {0}, + .outputIndexes = {1}}}; + +const std::string kName = "Google-MockV1"; +const std::string kInvalidName = ""; +const std::shared_ptr kInvalidDevice; +constexpr PerformanceInfo kNoPerformanceInfo = {.execTime = std::numeric_limits::max(), + .powerUsage = std::numeric_limits::max()}; +constexpr NumberOfCacheFiles kNumberOfCacheFiles = {.numModelCache = nn::kMaxNumberOfCacheFiles, + .numDataCache = nn::kMaxNumberOfCacheFiles}; + +constexpr auto makeStatusOk = [] { return ndk::ScopedAStatus::ok(); }; + +std::shared_ptr createMockDevice() { + const auto mockDevice = MockDevice::create(); + + // Setup default actions for each relevant call. + ON_CALL(*mockDevice, getVersionString(_)) + .WillByDefault(DoAll(SetArgPointee<0>(kName), InvokeWithoutArgs(makeStatusOk))); + ON_CALL(*mockDevice, getType(_)) + .WillByDefault( + DoAll(SetArgPointee<0>(DeviceType::OTHER), InvokeWithoutArgs(makeStatusOk))); + ON_CALL(*mockDevice, getSupportedExtensions(_)) + .WillByDefault(DoAll(SetArgPointee<0>(std::vector{}), + InvokeWithoutArgs(makeStatusOk))); + ON_CALL(*mockDevice, getNumberOfCacheFilesNeeded(_)) + .WillByDefault( + DoAll(SetArgPointee<0>(kNumberOfCacheFiles), InvokeWithoutArgs(makeStatusOk))); + ON_CALL(*mockDevice, getCapabilities(_)) + .WillByDefault( + DoAll(SetArgPointee<0>(Capabilities{ + .relaxedFloat32toFloat16PerformanceScalar = kNoPerformanceInfo, + .relaxedFloat32toFloat16PerformanceTensor = kNoPerformanceInfo, + .ifPerformance = kNoPerformanceInfo, + .whilePerformance = kNoPerformanceInfo, + }), + InvokeWithoutArgs(makeStatusOk))); + + // These EXPECT_CALL(...).Times(testing::AnyNumber()) calls are to suppress warnings on the + // uninteresting methods calls. + EXPECT_CALL(*mockDevice, getVersionString(_)).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, getType(_)).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, getSupportedExtensions(_)).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, getNumberOfCacheFilesNeeded(_)).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, getCapabilities(_)).Times(testing::AnyNumber()); + + return mockDevice; +} + +constexpr auto makePreparedModelReturnImpl = + [](ErrorStatus launchStatus, ErrorStatus returnStatus, + const std::shared_ptr& preparedModel, + const std::shared_ptr& cb) { + cb->notify(returnStatus, preparedModel); + if (launchStatus == ErrorStatus::NONE) { + return ndk::ScopedAStatus::ok(); + } + return ndk::ScopedAStatus::fromServiceSpecificError(static_cast(launchStatus)); + }; + +auto makePreparedModelReturn(ErrorStatus launchStatus, ErrorStatus returnStatus, + const std::shared_ptr& preparedModel) { + return [launchStatus, returnStatus, preparedModel]( + const Model& /*model*/, ExecutionPreference /*preference*/, + Priority /*priority*/, const int64_t& /*deadline*/, + const std::vector& /*modelCache*/, + const std::vector& /*dataCache*/, + const std::vector& /*token*/, + const std::shared_ptr& cb) -> ndk::ScopedAStatus { + return makePreparedModelReturnImpl(launchStatus, returnStatus, preparedModel, cb); + }; +} + +auto makePreparedModelFromCacheReturn(ErrorStatus launchStatus, ErrorStatus returnStatus, + const std::shared_ptr& preparedModel) { + return [launchStatus, returnStatus, preparedModel]( + const int64_t& /*deadline*/, + const std::vector& /*modelCache*/, + const std::vector& /*dataCache*/, + const std::vector& /*token*/, + const std::shared_ptr& cb) { + return makePreparedModelReturnImpl(launchStatus, returnStatus, preparedModel, cb); + }; +} + +constexpr auto makeGeneralFailure = [] { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(ErrorStatus::GENERAL_FAILURE)); +}; +constexpr auto makeGeneralTransportFailure = [] { + return ndk::ScopedAStatus::fromStatus(STATUS_NO_MEMORY); +}; +constexpr auto makeDeadObjectFailure = [] { + return ndk::ScopedAStatus::fromStatus(STATUS_DEAD_OBJECT); +}; + +} // namespace + +TEST(DeviceTest, invalidName) { + // run test + const auto device = MockDevice::create(); + const auto result = Device::create(kInvalidName, device); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::INVALID_ARGUMENT); +} + +TEST(DeviceTest, invalidDevice) { + // run test + const auto result = Device::create(kName, kInvalidDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::INVALID_ARGUMENT); +} + +TEST(DeviceTest, getVersionStringError) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getVersionString(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, getVersionStringTransportFailure) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getVersionString(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, getVersionStringDeadObject) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getVersionString(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST(DeviceTest, getTypeError) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getType(_)).Times(1).WillOnce(InvokeWithoutArgs(makeGeneralFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, getTypeTransportFailure) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getType(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, getTypeDeadObject) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getType(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST(DeviceTest, getSupportedExtensionsError) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getSupportedExtensions(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, getSupportedExtensionsTransportFailure) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getSupportedExtensions(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, getSupportedExtensionsDeadObject) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getSupportedExtensions(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST(DeviceTest, getNumberOfCacheFilesNeededError) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getNumberOfCacheFilesNeeded(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, dataCacheFilesExceedsSpecifiedMax) { + // setup test + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getNumberOfCacheFilesNeeded(_)) + .Times(1) + .WillOnce(DoAll(SetArgPointee<0>(NumberOfCacheFiles{ + .numModelCache = nn::kMaxNumberOfCacheFiles + 1, + .numDataCache = nn::kMaxNumberOfCacheFiles}), + InvokeWithoutArgs(makeStatusOk))); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, modelCacheFilesExceedsSpecifiedMax) { + // setup test + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getNumberOfCacheFilesNeeded(_)) + .Times(1) + .WillOnce(DoAll(SetArgPointee<0>(NumberOfCacheFiles{ + .numModelCache = nn::kMaxNumberOfCacheFiles, + .numDataCache = nn::kMaxNumberOfCacheFiles + 1}), + InvokeWithoutArgs(makeStatusOk))); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, getNumberOfCacheFilesNeededTransportFailure) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getNumberOfCacheFilesNeeded(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, getNumberOfCacheFilesNeededDeadObject) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getNumberOfCacheFilesNeeded(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST(DeviceTest, getCapabilitiesError) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getCapabilities(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, getCapabilitiesTransportFailure) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getCapabilities(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, getCapabilitiesDeadObject) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getCapabilities(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = Device::create(kName, mockDevice); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST(DeviceTest, getName) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + + // run test + const auto& name = device->getName(); + + // verify result + EXPECT_EQ(name, kName); +} + +TEST(DeviceTest, getFeatureLevel) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + + // run test + const auto featureLevel = device->getFeatureLevel(); + + // verify result + EXPECT_EQ(featureLevel, nn::Version::ANDROID_S); +} + +TEST(DeviceTest, getCachedData) { + // setup call + const auto mockDevice = createMockDevice(); + EXPECT_CALL(*mockDevice, getVersionString(_)).Times(1); + EXPECT_CALL(*mockDevice, getType(_)).Times(1); + EXPECT_CALL(*mockDevice, getSupportedExtensions(_)).Times(1); + EXPECT_CALL(*mockDevice, getNumberOfCacheFilesNeeded(_)).Times(1); + EXPECT_CALL(*mockDevice, getCapabilities(_)).Times(1); + + const auto result = Device::create(kName, mockDevice); + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + const auto& device = result.value(); + + // run test and verify results + EXPECT_EQ(device->getVersionString(), device->getVersionString()); + EXPECT_EQ(device->getType(), device->getType()); + EXPECT_EQ(device->getSupportedExtensions(), device->getSupportedExtensions()); + EXPECT_EQ(device->getNumberOfCacheFilesNeeded(), device->getNumberOfCacheFilesNeeded()); + EXPECT_EQ(device->getCapabilities(), device->getCapabilities()); +} + +TEST(DeviceTest, getSupportedOperations) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, getSupportedOperations(_, _)) + .Times(1) + .WillOnce(DoAll( + SetArgPointee<1>(std::vector(kSimpleModel.main.operations.size(), true)), + InvokeWithoutArgs(makeStatusOk))); + + // run test + const auto result = device->getSupportedOperations(kSimpleModel); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + const auto& supportedOperations = result.value(); + EXPECT_EQ(supportedOperations.size(), kSimpleModel.main.operations.size()); + EXPECT_THAT(supportedOperations, Each(testing::IsTrue())); +} + +TEST(DeviceTest, getSupportedOperationsError) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, getSupportedOperations(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); + + // run test + const auto result = device->getSupportedOperations(kSimpleModel); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, getSupportedOperationsTransportFailure) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, getSupportedOperations(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = device->getSupportedOperations(kSimpleModel); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, getSupportedOperationsDeadObject) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, getSupportedOperations(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = device->getSupportedOperations(kSimpleModel); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST(DeviceTest, prepareModel) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + const auto mockPreparedModel = MockPreparedModel::create(); + EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(makePreparedModelReturn(ErrorStatus::NONE, ErrorStatus::NONE, + mockPreparedModel))); + + // run test + const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + EXPECT_NE(result.value(), nullptr); +} + +TEST(DeviceTest, prepareModelLaunchError) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(makePreparedModelReturn(ErrorStatus::GENERAL_FAILURE, + ErrorStatus::GENERAL_FAILURE, nullptr))); + + // run test + const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, prepareModelReturnError) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(makePreparedModelReturn(ErrorStatus::NONE, + ErrorStatus::GENERAL_FAILURE, nullptr))); + + // run test + const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, prepareModelNullptrError) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce( + Invoke(makePreparedModelReturn(ErrorStatus::NONE, ErrorStatus::NONE, nullptr))); + + // run test + const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, prepareModelTransportFailure) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, prepareModelDeadObject) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST(DeviceTest, prepareModelAsyncCrash) { + // setup test + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + const auto ret = [&device]() { + DeathMonitor::serviceDied(device->getDeathMonitor()); + return ndk::ScopedAStatus::ok(); + }; + EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(ret)); + + // run test + const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST(DeviceTest, prepareModelFromCache) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + const auto mockPreparedModel = MockPreparedModel::create(); + EXPECT_CALL(*mockDevice, prepareModelFromCache(_, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(makePreparedModelFromCacheReturn(ErrorStatus::NONE, ErrorStatus::NONE, + mockPreparedModel))); + + // run test + const auto result = device->prepareModelFromCache({}, {}, {}, {}); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + EXPECT_NE(result.value(), nullptr); +} + +TEST(DeviceTest, prepareModelFromCacheLaunchError) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, prepareModelFromCache(_, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(makePreparedModelFromCacheReturn( + ErrorStatus::GENERAL_FAILURE, ErrorStatus::GENERAL_FAILURE, nullptr))); + + // run test + const auto result = device->prepareModelFromCache({}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, prepareModelFromCacheReturnError) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, prepareModelFromCache(_, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(makePreparedModelFromCacheReturn( + ErrorStatus::NONE, ErrorStatus::GENERAL_FAILURE, nullptr))); + + // run test + const auto result = device->prepareModelFromCache({}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, prepareModelFromCacheNullptrError) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, prepareModelFromCache(_, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(makePreparedModelFromCacheReturn(ErrorStatus::NONE, ErrorStatus::NONE, + nullptr))); + + // run test + const auto result = device->prepareModelFromCache({}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, prepareModelFromCacheTransportFailure) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, prepareModelFromCache(_, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = device->prepareModelFromCache({}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, prepareModelFromCacheDeadObject) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, prepareModelFromCache(_, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = device->prepareModelFromCache({}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST(DeviceTest, prepareModelFromCacheAsyncCrash) { + // setup test + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + const auto ret = [&device]() { + DeathMonitor::serviceDied(device->getDeathMonitor()); + return ndk::ScopedAStatus::ok(); + }; + EXPECT_CALL(*mockDevice, prepareModelFromCache(_, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(ret)); + + // run test + const auto result = device->prepareModelFromCache({}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST(DeviceTest, allocate) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + const auto mockBuffer = DeviceBuffer{.buffer = MockBuffer::create(), .token = 1}; + EXPECT_CALL(*mockDevice, allocate(_, _, _, _, _)) + .Times(1) + .WillOnce(DoAll(SetArgPointee<4>(mockBuffer), InvokeWithoutArgs(makeStatusOk))); + + // run test + const auto result = device->allocate({}, {}, {}, {}); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + EXPECT_NE(result.value(), nullptr); +} + +TEST(DeviceTest, allocateError) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, allocate(_, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); + + // run test + const auto result = device->allocate({}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, allocateTransportFailure) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, allocate(_, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = device->allocate({}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(DeviceTest, allocateDeadObject) { + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice).value(); + EXPECT_CALL(*mockDevice, allocate(_, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = device->allocate({}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/test/MockBuffer.h b/neuralnetworks/aidl/utils/test/MockBuffer.h new file mode 100644 index 0000000000..5746176116 --- /dev/null +++ b/neuralnetworks/aidl/utils/test/MockBuffer.h @@ -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. + */ + +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_BUFFER +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_BUFFER + +#include +#include +#include +#include +#include + +namespace aidl::android::hardware::neuralnetworks::utils { + +class MockBuffer final : public BnBuffer { + public: + static std::shared_ptr create(); + + MOCK_METHOD(ndk::ScopedAStatus, copyTo, (const Memory& dst), (override)); + MOCK_METHOD(ndk::ScopedAStatus, copyFrom, + (const Memory& src, const std::vector& dimensions), (override)); +}; + +inline std::shared_ptr MockBuffer::create() { + return ndk::SharedRefBase::make(); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_BUFFER diff --git a/neuralnetworks/aidl/utils/test/MockDevice.h b/neuralnetworks/aidl/utils/test/MockDevice.h new file mode 100644 index 0000000000..9b35bf8f81 --- /dev/null +++ b/neuralnetworks/aidl/utils/test/MockDevice.h @@ -0,0 +1,67 @@ +/* + * 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_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_DEVICE +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_DEVICE + +#include +#include +#include +#include +#include + +namespace aidl::android::hardware::neuralnetworks::utils { + +class MockDevice final : public BnDevice { + public: + static std::shared_ptr create(); + + MOCK_METHOD(ndk::ScopedAStatus, allocate, + (const BufferDesc& desc, const std::vector& preparedModels, + const std::vector& inputRoles, + const std::vector& outputRoles, DeviceBuffer* deviceBuffer), + (override)); + MOCK_METHOD(ndk::ScopedAStatus, getCapabilities, (Capabilities * capabilities), (override)); + MOCK_METHOD(ndk::ScopedAStatus, getNumberOfCacheFilesNeeded, + (NumberOfCacheFiles * numberOfCacheFiles), (override)); + MOCK_METHOD(ndk::ScopedAStatus, getSupportedExtensions, (std::vector * extensions), + (override)); + MOCK_METHOD(ndk::ScopedAStatus, getSupportedOperations, + (const Model& model, std::vector* supportedOperations), (override)); + MOCK_METHOD(ndk::ScopedAStatus, getType, (DeviceType * deviceType), (override)); + MOCK_METHOD(ndk::ScopedAStatus, getVersionString, (std::string * version), (override)); + MOCK_METHOD(ndk::ScopedAStatus, prepareModel, + (const Model& model, ExecutionPreference preference, Priority priority, + int64_t deadline, const std::vector& modelCache, + const std::vector& dataCache, + const std::vector& token, + const std::shared_ptr& callback), + (override)); + MOCK_METHOD(ndk::ScopedAStatus, prepareModelFromCache, + (int64_t deadline, const std::vector& modelCache, + const std::vector& dataCache, + const std::vector& token, + const std::shared_ptr& callback), + (override)); +}; + +inline std::shared_ptr MockDevice::create() { + return ndk::SharedRefBase::make(); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_DEVICE diff --git a/neuralnetworks/aidl/utils/test/MockFencedExecutionCallback.h b/neuralnetworks/aidl/utils/test/MockFencedExecutionCallback.h new file mode 100644 index 0000000000..463e1c9700 --- /dev/null +++ b/neuralnetworks/aidl/utils/test/MockFencedExecutionCallback.h @@ -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. + */ + +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK + +#include +#include +#include +#include +#include +#include + +namespace aidl::android::hardware::neuralnetworks::utils { + +class MockFencedExecutionCallback final : public BnFencedExecutionCallback { + public: + static std::shared_ptr create(); + + // V1_3 methods below. + MOCK_METHOD(ndk::ScopedAStatus, getExecutionInfo, + (Timing * timingLaunched, Timing* timingFenced, ErrorStatus* errorStatus), + (override)); +}; + +inline std::shared_ptr MockFencedExecutionCallback::create() { + return ndk::SharedRefBase::make(); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK diff --git a/neuralnetworks/aidl/utils/test/MockPreparedModel.h b/neuralnetworks/aidl/utils/test/MockPreparedModel.h new file mode 100644 index 0000000000..545b491f1d --- /dev/null +++ b/neuralnetworks/aidl/utils/test/MockPreparedModel.h @@ -0,0 +1,50 @@ +/* + * 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_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_PREPARED_MODEL +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_PREPARED_MODEL + +#include +#include +#include +#include +#include +#include + +namespace aidl::android::hardware::neuralnetworks::utils { + +class MockPreparedModel final : public BnPreparedModel { + public: + static std::shared_ptr create(); + + MOCK_METHOD(ndk::ScopedAStatus, executeSynchronously, + (const Request& request, bool measureTiming, int64_t deadline, + int64_t loopTimeoutDuration, ExecutionResult* executionResult), + (override)); + MOCK_METHOD(ndk::ScopedAStatus, executeFenced, + (const Request& request, const std::vector& waitFor, + bool measureTiming, int64_t deadline, int64_t loopTimeoutDuration, + int64_t duration, FencedExecutionResult* fencedExecutionResult), + (override)); +}; + +inline std::shared_ptr MockPreparedModel::create() { + return ndk::SharedRefBase::make(); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_PREPARED_MODEL diff --git a/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp b/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp new file mode 100644 index 0000000000..7e28861054 --- /dev/null +++ b/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp @@ -0,0 +1,272 @@ +/* + * 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 "MockFencedExecutionCallback.h" +#include "MockPreparedModel.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace aidl::android::hardware::neuralnetworks::utils { +namespace { + +using ::testing::_; +using ::testing::DoAll; +using ::testing::Invoke; +using ::testing::InvokeWithoutArgs; +using ::testing::SetArgPointee; + +const std::shared_ptr kInvalidPreparedModel; +constexpr auto kNoTiming = Timing{.timeOnDevice = -1, .timeInDriver = -1}; + +constexpr auto makeStatusOk = [] { return ndk::ScopedAStatus::ok(); }; + +constexpr auto makeGeneralFailure = [] { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(ErrorStatus::GENERAL_FAILURE)); +}; +constexpr auto makeGeneralTransportFailure = [] { + return ndk::ScopedAStatus::fromStatus(STATUS_NO_MEMORY); +}; +constexpr auto makeDeadObjectFailure = [] { + return ndk::ScopedAStatus::fromStatus(STATUS_DEAD_OBJECT); +}; + +auto makeFencedExecutionResult(const std::shared_ptr& callback) { + return [callback](const Request& /*request*/, + const std::vector& /*waitFor*/, + bool /*measureTiming*/, int64_t /*deadline*/, int64_t /*loopTimeoutDuration*/, + int64_t /*duration*/, FencedExecutionResult* fencedExecutionResult) { + *fencedExecutionResult = FencedExecutionResult{.callback = callback, + .syncFence = ndk::ScopedFileDescriptor(-1)}; + return ndk::ScopedAStatus::ok(); + }; +} + +} // namespace + +TEST(PreparedModelTest, invalidPreparedModel) { + // run test + const auto result = PreparedModel::create(kInvalidPreparedModel); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(PreparedModelTest, executeSync) { + // setup call + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto mockExecutionResult = ExecutionResult{ + .outputSufficientSize = true, + .outputShapes = {}, + .timing = kNoTiming, + }; + EXPECT_CALL(*mockPreparedModel, executeSynchronously(_, _, _, _, _)) + .Times(1) + .WillOnce( + DoAll(SetArgPointee<4>(mockExecutionResult), InvokeWithoutArgs(makeStatusOk))); + + // run test + const auto result = preparedModel->execute({}, {}, {}, {}); + + // verify result + EXPECT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; +} + +TEST(PreparedModelTest, executeSyncError) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + EXPECT_CALL(*mockPreparedModel, executeSynchronously(_, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(makeGeneralFailure)); + + // run test + const auto result = preparedModel->execute({}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(PreparedModelTest, executeSyncTransportFailure) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + EXPECT_CALL(*mockPreparedModel, executeSynchronously(_, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = preparedModel->execute({}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(PreparedModelTest, executeSyncDeadObject) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + EXPECT_CALL(*mockPreparedModel, executeSynchronously(_, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = preparedModel->execute({}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST(PreparedModelTest, executeFenced) { + // setup call + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto mockCallback = MockFencedExecutionCallback::create(); + EXPECT_CALL(*mockCallback, getExecutionInfo(_, _, _)) + .Times(1) + .WillOnce(DoAll(SetArgPointee<0>(kNoTiming), SetArgPointee<1>(kNoTiming), + SetArgPointee<2>(ErrorStatus::NONE), Invoke(makeStatusOk))); + EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(makeFencedExecutionResult(mockCallback))); + + // run test + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + const auto& [syncFence, callback] = result.value(); + EXPECT_EQ(syncFence.syncWait({}), nn::SyncFence::FenceState::SIGNALED); + ASSERT_NE(callback, nullptr); + + // get results from callback + const auto callbackResult = callback(); + ASSERT_TRUE(callbackResult.has_value()) << "Failed with " << callbackResult.error().code << ": " + << callbackResult.error().message; +} + +TEST(PreparedModelTest, executeFencedCallbackError) { + // setup call + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto mockCallback = MockFencedExecutionCallback::create(); + EXPECT_CALL(*mockCallback, getExecutionInfo(_, _, _)) + .Times(1) + .WillOnce(Invoke(DoAll(SetArgPointee<0>(kNoTiming), SetArgPointee<1>(kNoTiming), + SetArgPointee<2>(ErrorStatus::GENERAL_FAILURE), + Invoke(makeStatusOk)))); + EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(makeFencedExecutionResult(mockCallback))); + + // run test + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + const auto& [syncFence, callback] = result.value(); + EXPECT_NE(syncFence.syncWait({}), nn::SyncFence::FenceState::ACTIVE); + ASSERT_NE(callback, nullptr); + + // verify callback failure + const auto callbackResult = callback(); + ASSERT_FALSE(callbackResult.has_value()); + EXPECT_EQ(callbackResult.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(PreparedModelTest, executeFencedError) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); + + // run test + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(PreparedModelTest, executeFencedTransportFailure) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(PreparedModelTest, executeFencedDeadObject) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +// TODO: test burst execution if/when it is added to nn::IPreparedModel. + +TEST(PreparedModelTest, getUnderlyingResource) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + + // run test + const auto resource = preparedModel->getUnderlyingResource(); + + // verify resource + const std::shared_ptr* maybeMock = + std::any_cast>(&resource); + ASSERT_NE(maybeMock, nullptr); + EXPECT_EQ(maybeMock->get(), mockPreparedModel.get()); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/utils/README.md b/neuralnetworks/utils/README.md index 45ca0b442f..87b3f9f676 100644 --- a/neuralnetworks/utils/README.md +++ b/neuralnetworks/utils/README.md @@ -49,7 +49,9 @@ The `convert` functions operate only on types that used in a HIDL method call di (i.e., not as a nested class) or used in a subsequent version of the NN HAL. Prefer using `convert` over `unvalidatedConvert`. -# HIDL Interface Lifetimes across Processes +# Interface Lifetimes across Processes + +## HIDL Some notes about HIDL interface objects and lifetimes across processes: @@ -68,7 +70,20 @@ behave strangely with `::android::wp` references.) If the process which created the HIDL interface object dies, any call on this object from another process will result in a HIDL transport error with the code `DEAD_OBJECT`. -# Protecting Asynchronous Calls across HIDL +## AIDL + +We use NDK backend for AIDL interfaces. Handling of lifetimes is generally the same with the +following differences: +* Interfaces inherit from `ndk::ICInterface`, which inherits from `ndk::SharedRefBase`. The latter + is an analog of `::android::RefBase` using `std::shared_ptr` for reference counting. +* AIDL calls return `ndk::ScopedAStatus` which wraps fields of types `binder_status_t` and + `binder_exception_t`. In case the call is made on a dead object, the call will return + `ndk::ScopedAStatus` with exception `EX_TRANSACTION_FAILED` and binder status + `STATUS_DEAD_OBJECT`. + +# Protecting Asynchronous Calls + +## Across HIDL Some notes about asynchronous calls across HIDL: @@ -95,3 +110,17 @@ died. nnapi/hal/ProtectCallback.h's `DeathHandler` uses `hidl_death_recipient`s driver process has died, and `DeathHandler` will unblock any thread waiting on the results of an `IProtectedCallback` callback object that may otherwise not be signaled. In order for this to work, the `IProtectedCallback` object must have been registered via `DeathHandler::protectCallback()`. + +## Across AIDL + +We use NDK backend for AIDL interfaces. Handling of asynchronous calls is generally the same with +the following differences: +* AIDL calls return `ndk::ScopedAStatus` which wraps fields of types `binder_status_t` and + `binder_exception_t`. In case the call is made on a dead object, the call will return + `ndk::ScopedAStatus` with exception `EX_TRANSACTION_FAILED` and binder status + `STATUS_DEAD_OBJECT`. +* AIDL interface doesn't contain asynchronous `IPreparedModel::execute`. +* Service death is handled using `AIBinder_DeathRecipient` object which is linked to an interface + object using `AIBinder_linkToDeath`. nnapi/hal/aidl/ProtectCallback.h provides `DeathHandler` + object that is a direct analog of HIDL `DeathHandler`, only using libbinder_ndk objects for + implementation. diff --git a/neuralnetworks/utils/common/Android.bp b/neuralnetworks/utils/common/Android.bp index 6162fe8cbc..2ed1e407ef 100644 --- a/neuralnetworks/utils/common/Android.bp +++ b/neuralnetworks/utils/common/Android.bp @@ -35,8 +35,10 @@ cc_library_static { "neuralnetworks_types", ], shared_libs: [ + "android.hardware.neuralnetworks-V1-ndk_platform", "libhidlbase", "libnativewindow", + "libbinder_ndk", ], } diff --git a/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h b/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h index 2f6112a4c9..8fe6b904b2 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/CommonUtils.h @@ -32,6 +32,8 @@ namespace hal = ::android::hardware::neuralnetworks; // Shorthands namespace aidl::android::hardware::neuralnetworks { namespace aidl_hal = ::aidl::android::hardware::neuralnetworks; +namespace hal = ::android::hardware::neuralnetworks; +namespace nn = ::android::nn; } // namespace aidl::android::hardware::neuralnetworks // Shorthands -- GitLab From 14c1f985b0ac8d95e3b331871c4ddd0976da1bb3 Mon Sep 17 00:00:00 2001 From: Slava Shklyaev Date: Wed, 15 Jul 2020 14:57:27 +0100 Subject: [PATCH 024/825] Move NNAPI type information to types.spec See change Ic31ed957. The changes to the *.t files in this CL do not introduce any changes to the generated *.hal files. Bug: 160667417 Test: generate_api.sh Change-Id: Ie2dbbc0fc92e52b08adc807a7f514bd8945a055f --- neuralnetworks/1.0/types.t | 356 +---------------------------- neuralnetworks/1.1/types.t | 126 +--------- neuralnetworks/1.2/types.t | 418 +--------------------------------- neuralnetworks/1.3/types.t | 454 +------------------------------------ 4 files changed, 34 insertions(+), 1320 deletions(-) diff --git a/neuralnetworks/1.0/types.t b/neuralnetworks/1.0/types.t index d7b26aab35..be1ee07d57 100644 --- a/neuralnetworks/1.0/types.t +++ b/neuralnetworks/1.0/types.t @@ -63,361 +63,25 @@ enum FusedActivationFunc : int32_t { RELU6 = 3, }; -/** - * How an operand is used. - */ -enum OperandLifeTime : int32_t { - /** - * The operand is internal to the model. It's created by an operation and - * consumed by other operations. It must be an output operand of - * exactly one operation. - */ - TEMPORARY_VARIABLE, - - /** - * The operand is an input of the model. It must not be an output - * operand of any operation. - * - * An operand can't be both input and output of a model. - */ - MODEL_INPUT, - - /** - * The operand is an output of the model. It must be an output - * operand of exactly one operation. - * - * An operand can't be both input and output of a model. - */ - MODEL_OUTPUT, - - /** - * The operand is a constant found in Model.operandValues. It must - * not be an output operand of any operation. - */ - CONSTANT_COPY, - - /** - * The operand is a constant that was specified via a Memory - * object. It must not be an output operand of any operation. - */ - CONSTANT_REFERENCE, - - /** - * The operand does not have a value. This is valid only for optional - * arguments of operations. - */ - NO_VALUE, -}; - -/** - * Status of a device. - */ -enum DeviceStatus : int32_t { - AVAILABLE, - BUSY, - OFFLINE, - UNKNOWN, -}; - -/** - * Performance information for the reference workload. - * - * Used by a driver to report its performance characteristics. - */ -struct PerformanceInfo { - /** - * Ratio of the time taken by the driver to execute the - * workload compared to the time the CPU would take for the - * same workload. A lower number is better. - */ - float execTime; - - /** - * Ratio of the energy used by the driver compared to what - * the CPU would use for doing the same workload. A lower number - * is better. - */ - float powerUsage; -}; - -/** - * The capabilities of a driver. - */ -struct Capabilities { - /** - * Driver performance when operating on float32 data. - */ - PerformanceInfo float32Performance; - - /** - * Driver performance when operating on asymmetric 8-bit quantized data. - */ - PerformanceInfo quantized8Performance; -}; - -/** - * Describes the location of a data object. - */ -struct DataLocation { - /** - * The index of the memory pool where this location is found. - */ - uint32_t poolIndex; - - /** - * Offset in bytes from the start of the pool. - */ - uint32_t offset; - - /** - * The length of the data in bytes. - */ - uint32_t length; -}; - -/** - * Describes one operand of the model's graph. - */ -struct Operand { - /** - * Data type of the operand. - */ - OperandType type; - - /** - * Dimensions of the operand. - * - * For a scalar operand, dimensions.size() must be 0. - * - * For a tensor operand, dimensions.size() must be at least 1; - * however, any of the dimensions may be unspecified. - * - * A tensor operand with all dimensions specified has "fully - * specified" dimensions. Whenever possible (i.e., whenever the - * dimensions are known at model construction time), a tensor - * operand should have (but is not required to have) fully - * specified dimensions, in order to enable the best possible - * performance. - * - * If a tensor operand's dimensions are not fully specified, the - * dimensions of the operand are deduced from the operand - * dimensions and values of the operation for which that operand - * is an output. - * - * In the following situations, a tensor operand's dimensions must - * be fully specified: - * - * . The operand has lifetime CONSTANT_COPY or - * CONSTANT_REFERENCE. - * - * . The operand has lifetime MODEL_INPUT or MODEL_OUTPUT. Fully - * specified dimensions must either be present in the - * Operand or they must be provided in the corresponding - * RequestArgument. - * EXCEPTION: If the input or output is optional and omitted - * (by setting the hasNoValue field of the corresponding - * RequestArgument to true) then it need not have fully - * specified dimensions. - * - * A tensor operand with some number of unspecified dimensions is - * represented by setting each unspecified dimension to 0. - */ - vec dimensions; - - /** - * The number of times this operand appears as an operation input. - * - * (For example, if this operand appears once in one operation's - * input list, and three times in another operation's input list, - * then numberOfConsumers = 4.) - */ - uint32_t numberOfConsumers; - - /** - * Quantized scale of the operand. - * - * Only applicable if the operand is of type TENSOR_QUANT8_ASYMM or - * TENSOR_INT32. - */ - float scale; - - /** - * Quantized zero-point offset of the operand. - * - * Only applicable if the operand is of type TENSOR_QUANT8_ASYMM. - */ - int32_t zeroPoint; - - /** - * How the operand is used. - */ - OperandLifeTime lifetime; - - /** - * Where to find the data for this operand. - * If the lifetime is TEMPORARY_VARIABLE, MODEL_INPUT, MODEL_OUTPUT, or - * NO_VALUE: - * - All the fields must be 0. - * If the lifetime is CONSTANT_COPY: - * - location.poolIndex is 0. - * - location.offset is the offset in bytes into Model.operandValues. - * - location.length is set. - * If the lifetime is CONSTANT_REFERENCE: - * - location.poolIndex is set. - * - location.offset is the offset in bytes into the specified pool. - * - location.length is set. - */ - DataLocation location; -}; - -/** - * Describes one operation of the model's graph. - */ -struct Operation { - /** - * The operation type. - */ - OperationType type; - - /** - * Describes the table that contains the indexes of the inputs of the - * operation. The offset is the index in the operandIndexes table. - */ - vec inputs; - - /** - * Describes the table that contains the indexes of the outputs of the - * operation. The offset is the index in the operandIndexes table. - */ - vec outputs; -}; - -/** - * A Neural Network Model. - * - * This includes not only the execution graph, but also constant data such as - * weights or scalars added at construction time. The only information that - * might not be known is the shape of the input tensors. - */ -struct Model { - /** - * All operands included in the model. - */ - vec operands; - - /** - * All operations included in the model. - * - * The operations are sorted into execution order. Every operand - * with lifetime MODEL_OUTPUT or TEMPORARY_VARIABLE must be - * written before it is read. - */ - vec operations; +%insert OperandLifeTime - /** - * Input indexes of the model. There must be at least one. - * - * Each value corresponds to the index of the operand in "operands". - */ - vec inputIndexes; +%insert DeviceStatus - /** - * Output indexes of the model. There must be at least one. - * - * Each value corresponds to the index of the operand in "operands". - */ - vec outputIndexes; +%insert PerformanceInfo - /** - * A byte buffer containing operand data that were copied into the model. - * - * An operand's value must be located here if and only if Operand::lifetime - * equals OperandLifeTime::CONSTANT_COPY. - */ - vec operandValues; +%insert Capabilities - /** - * A collection of shared memory pools containing operand values. - * - * An operand's value must be located here if and only if Operand::lifetime - * equals OperandLifeTime::CONSTANT_REFERENCE. - */ - vec pools; -}; +%insert DataLocation -/** - * Metadata information specifying the location of the input or output data and - * any updates to the input or output operand. - */ -struct RequestArgument { - /** - * If true, the argument does not have a value. This can be used for - * operations that take optional arguments. If true, the fields of location - * are set to 0 and the dimensions vector is left empty. - */ - bool hasNoValue; - - /** - * The location within one of the memory pools passed in the Request. - */ - DataLocation location; +%insert Operand - /** - * Updated dimension information. - * - * If dimensions.size() > 0, dimension information was provided - * along with the argument. This can be the case for models that - * accept inputs of varying size. This can't change the rank, just - * the value of the dimensions that were unspecified in the - * model. If dimensions.size() > 0, then all dimensions must be - * specified here; and any dimension that was specified in the - * model must have the same value here. - * - * If the dimensions in the model are not fully specified, then - * they must be fully specified here, unless hasNoValue is set to - * true. If the dimensions in the model are fully specified, then - * either dimensions.size() may be 0, or the dimensions in the - * model must be identical to the dimensions here. - */ - vec dimensions; -}; +%insert Operation -/** - * Inputs to be sent to and outputs to be retrieved from a prepared model. - * - * A Request serves two primary tasks: - * 1) Provides the input and output data to be used when executing the model. - * 2) Specifies any updates to the input operand metadata that were left - * unspecified at model preparation time. - * - * An output must not overlap with any other output, with an input, or - * with an operand of lifetime CONSTANT_REFERENCE. - */ -struct Request { - /** - * Input data and information to be used in the execution of a prepared - * model. - * - * The index of the input corresponds to the index in Model.inputIndexes. - * E.g., input[i] corresponds to Model.inputIndexes[i]. - */ - vec inputs; +%insert Model - /** - * Output data and information to be used in the execution of a prepared - * model. - * - * The index of the output corresponds to the index in Model.outputIndexes. - * E.g., output[i] corresponds to Model.outputIndexes[i]. - */ - vec outputs; +%insert RequestArgument - /** - * A collection of shared memory pools containing operand data for both the - * inputs and the outputs to a model. - */ - vec pools; -}; +%insert Request /** * Return status of a function. diff --git a/neuralnetworks/1.1/types.t b/neuralnetworks/1.1/types.t index 75ac2e7be8..8c22b302a5 100644 --- a/neuralnetworks/1.1/types.t +++ b/neuralnetworks/1.1/types.t @@ -31,128 +31,10 @@ enum OperationType : @1.0::OperationType { %insert Operation_1.1 }; -/** - * The capabilities of a driver. - */ -struct Capabilities { - /** - * Driver performance when operating on float32 data. - */ - PerformanceInfo float32Performance; - - /** - * Driver performance when operating on asymmetric 8-bit quantized data. - */ - PerformanceInfo quantized8Performance; - - /** - * Driver performance when operating on float32 data but performing - * calculations with range and/or precision as low as that of the IEEE - * 754 16-bit floating-point format. - */ - PerformanceInfo relaxedFloat32toFloat16Performance; -}; - -/** - * Describes one operation of the model's graph. - */ -struct Operation { - /** - * The operation type. - */ - OperationType type; +%insert Capabilities - /** - * Describes the table that contains the indexes of the inputs of the - * operation. The offset is the index in the operandIndexes table. - */ - vec inputs; +%insert Operation - /** - * Describes the table that contains the indexes of the outputs of the - * operation. The offset is the index in the operandIndexes table. - */ - vec outputs; -}; +%insert Model -/** - * A Neural Network Model. - * - * This includes not only the execution graph, but also constant data such as - * weights or scalars added at construction time. The only information that - * may not be known is the shape of the input tensors. - */ -struct Model { - /** - * All operands included in the model. - */ - vec operands; - - /** - * All operations included in the model. - * - * The operations are sorted into execution order. Every operand - * with lifetime MODEL_OUTPUT or TEMPORARY_VARIABLE must be - * written before it is read. - */ - vec operations; - - /** - * Input indexes of the model. There must be at least one. - * - * Each value corresponds to the index of the operand in "operands". - */ - vec inputIndexes; - - /** - * Output indexes of the model. There must be at least one. - * - * Each value corresponds to the index of the operand in "operands". - */ - vec outputIndexes; - - /** - * A byte buffer containing operand data that were copied into the model. - * - * An operand's value must be located here if and only if Operand::lifetime - * equals OperandLifeTime::CONSTANT_COPY. - */ - vec operandValues; - - /** - * A collection of shared memory pools containing operand values. - * - * An operand's value must be located here if and only if Operand::lifetime - * equals OperandLifeTime::CONSTANT_REFERENCE. - */ - vec pools; - - /** - * 'true' indicates TENSOR_FLOAT32 may be calculated with range and/or - * precision as low as that of the IEEE 754 16-bit floating-point format. - * 'false' indicates TENSOR_FLOAT32 must be calculated using at least the - * range and precision of the IEEE 754 32-bit floating-point format. - */ - bool relaxComputationFloat32toFloat16; -}; - -/** - * Execution preferences. - */ -enum ExecutionPreference : int32_t { - /** - * Prefer executing in a way that minimizes battery drain. - * This is desirable for compilations that will be executed often. - */ - LOW_POWER = 0, - /** - * Prefer returning a single answer as fast as possible, even if this causes - * more power consumption. - */ - FAST_SINGLE_ANSWER = 1, - /** - * Prefer maximizing the throughput of successive frames, for example when - * processing successive frames coming from the camera. - */ - SUSTAINED_SPEED = 2, -}; +%insert ExecutionPreference diff --git a/neuralnetworks/1.2/types.t b/neuralnetworks/1.2/types.t index 4c9fd02403..b490f7f932 100644 --- a/neuralnetworks/1.2/types.t +++ b/neuralnetworks/1.2/types.t @@ -97,379 +97,23 @@ enum OperationTypeRange : uint32_t { BASE_MAX = 0xFFFF, }; -/** - * Device types. - * - * The type of NNAPI device. - */ -enum DeviceType : int32_t { - // Leaving 0 unused as it means unknown type in NDK NNAPI. There is no - // HAL equivalent of unknown type and a 1.2 HAL implementation must belong - // to one of the categories below. - /** The device does not fall into any category below. */ - OTHER = 1, - /** The device runs NNAPI models on single or multi-core CPU. */ - CPU = 2, - /** The device can run NNAPI models and also accelerate graphics APIs such - * as OpenGL ES and Vulkan. */ - GPU = 3, - /** Dedicated accelerator for Machine Learning workloads. */ - ACCELERATOR = 4, -}; - -/** - * The capabilities of a driver. - * - * Performance of an operation comes from the type of its first operand. - * This represents performance for non extension operand types. - */ -struct Capabilities { - /** - * Driver performance when operating on float32 data but performing - * calculations with range and/or precision as low as that of the IEEE - * 754 16-bit floating-point format. - */ - PerformanceInfo relaxedFloat32toFloat16PerformanceScalar; - PerformanceInfo relaxedFloat32toFloat16PerformanceTensor; - - /** - * Driver performance when operating on a particular data type. - * In the case of float32 data, this is used when the calculations - * are not relaxed. - */ - struct OperandPerformance { - OperandType type; - PerformanceInfo info; - }; - - /** - * Performance by operand type. Must be sorted by OperandType. - * If a particular OperandType is not present in operandPerformance, - * its performance is treated as { .execTime = FLT_MAX, .powerUsage = FLT_MAX }. - */ - vec operandPerformance; -}; - -/** - * Describes one operation of the model's graph. - */ -struct Operation { - /** - * The operation type. - * - * Besides the values listed in {@link OperationType}, any value above - * {@link OperationTypeRange::BASE_MAX} is possible and should be interpreted - * as an extension type according to {@link Model::extensionNameToPrefix}. - */ - OperationType type; - - /** - * Describes the table that contains the indexes of the inputs of the - * operation. The offset is the index in the operandIndexes table. - */ - vec inputs; - - /** - * Describes the table that contains the indexes of the outputs of the - * operation. The offset is the index in the operandIndexes table. - */ - vec outputs; -}; - -/** - * Parameters for TENSOR_QUANT8_SYMM_PER_CHANNEL operand. - */ -struct SymmPerChannelQuantParams { - /** Array of scaling values for each channel. Each value must be greater than zero. */ - vec scales; - /** Index of the channel dimension */ - uint32_t channelDim; -}; - -/** - * Describes one operand of the model's graph. - */ -struct Operand { - /** - * The data type. - * - * Besides the values listed in {@link OperandType}, any value above - * {@link OperandTypeRange::BASE_MAX} is possible and should be interpreted - * as an extension type according to {@link Model::extensionNameToPrefix}. - */ - OperandType type; - - /** - * Dimensions of the operand. - * - * For a scalar operand, dimensions.size() must be 0. - * - * A tensor operand with all dimensions specified has "fully - * specified" dimensions. Whenever possible (i.e., whenever the - * dimensions are known at model construction time), a tensor - * operand should have (but is not required to have) fully - * specified dimensions, in order to enable the best possible - * performance. - * - * If a tensor operand's dimensions are not fully specified, the - * dimensions of the operand are deduced from the operand - * dimensions and values of the operation for which that operand - * is an output. - * - * In the following situations, a tensor operand's dimensions must - * be fully specified: - * - * . The operand has lifetime CONSTANT_COPY or - * CONSTANT_REFERENCE. - * - * . The operand has lifetime MODEL_INPUT. Fully - * specified dimensions must either be present in the - * Operand or they must be provided in the corresponding - * RequestArgument. - * EXCEPTION: If the input is optional and omitted - * (by setting the hasNoValue field of the corresponding - * RequestArgument to true) then it need not have fully - * specified dimensions. - * - * A tensor operand with some number of unspecified dimensions is - * represented by setting each unspecified dimension to 0. - * - * A tensor operand with unspecified rank is represented by providing - * an empty dimensions vector. - */ - vec dimensions; +%insert DeviceType - /** - * The number of times this operand appears as an operation input. - * - * (For example, if this operand appears once in one operation's - * input list, and three times in another operation's input list, - * then numberOfConsumers = 4.) - */ - uint32_t numberOfConsumers; +%insert Capabilities - /** - * Quantized scale of the operand. - * - * Must be 0 when not applicable to an operand type. - * - * See {@link OperandType}. - */ - float scale; +%insert Operation - /** - * Quantized zero-point offset of the operand. - * - * Must be 0 when not applicable to an operand type. - * - * See {@link OperandType}. - */ - int32_t zeroPoint; +%insert SymmPerChannelQuantParams - /** - * How the operand is used. - */ - OperandLifeTime lifetime; +%insert Operand - /** - * Where to find the data for this operand. - * If the lifetime is TEMPORARY_VARIABLE, MODEL_INPUT, MODEL_OUTPUT, or - * NO_VALUE: - * - All the fields must be 0. - * If the lifetime is CONSTANT_COPY: - * - location.poolIndex is 0. - * - location.offset is the offset in bytes into Model.operandValues. - * - location.length is set. - * If the lifetime is CONSTANT_REFERENCE: - * - location.poolIndex is set. - * - location.offset is the offset in bytes into the specified pool. - * - location.length is set. - */ - DataLocation location; +%insert Model - /** - * Additional parameters specific to a particular operand type. - */ - safe_union ExtraParams { - /** - * No additional parameters. - */ - Monostate none; +%insert OutputShape - /** - * Symmetric per-channel quantization parameters. - * - * Only applicable to operands of type TENSOR_QUANT8_SYMM_PER_CHANNEL. - */ - SymmPerChannelQuantParams channelQuant; +%insert MeasureTiming - /** - * Extension operand parameters. - * - * The framework treats this as an opaque data blob. - * The format is up to individual extensions. - */ - vec extension; - } extraParams; -}; - -/** - * A Neural Network Model. - * - * This includes not only the execution graph, but also constant data such as - * weights or scalars added at construction time. The only information that - * may not be known is the shape of the input tensors. - */ -struct Model { - /** - * All operands included in the model. - */ - vec operands; - - /** - * All operations included in the model. - * - * The operations are sorted into execution order. Every operand - * with lifetime MODEL_OUTPUT or TEMPORARY_VARIABLE must be - * written before it is read. - */ - vec operations; - - /** - * Input indexes of the model. There must be at least one. - * - * Each value corresponds to the index of the operand in "operands". - */ - vec inputIndexes; - - /** - * Output indexes of the model. There must be at least one. - * - * Each value corresponds to the index of the operand in "operands". - */ - vec outputIndexes; - - /** - * A byte buffer containing operand data that were copied into the model. - * - * An operand's value must be located here if and only if Operand::lifetime - * equals OperandLifeTime::CONSTANT_COPY. - */ - vec operandValues; - - /** - * A collection of shared memory pools containing operand values. - * - * An operand's value must be located here if and only if Operand::lifetime - * equals OperandLifeTime::CONSTANT_REFERENCE. - */ - vec pools; - - /** - * 'true' indicates TENSOR_FLOAT32 may be calculated with range and/or - * precision as low as that of the IEEE 754 16-bit floating-point format. - * 'false' indicates TENSOR_FLOAT32 must be calculated using at least the - * range and precision of the IEEE 754 32-bit floating-point format. - */ - bool relaxComputationFloat32toFloat16; - - /** - * The mapping between extension names and prefixes of operand and - * operation type values. - * - * An operand or operation whose numeric type value is above - * {@link OperandTypeRange::BASE_MAX} or - * {@link OperationTypeRange::BASE_MAX} respectively should be interpreted - * as an extension operand. The low - * {@link Model::ExtensionTypeEncoding::LOW_BITS_TYPE} bits of the value - * correspond to the type ID within the extension and the high - * {@link Model::ExtensionTypeEncoding::HIGH_BITS_PREFIX} bits encode - * the "prefix", which maps uniquely to the extension name. - * - * For example, if a model contains an operation whose value is - * 0xAAAABBBB and extensionNameToPrefix contains an entry with - * prefix=0xAAAA and name="vendor.test.test_extension", then - * the operation should be interpreted as the operation 0xBBBB - * of the extension named vendor.test.test_extension. - * - * This is a one-to-one correspondence. That is, there must be at most one - * prefix corresponding to each extension name and at most one extension - * name corresponding to each prefix. - */ - vec extensionNameToPrefix; - - /** - * A correspondence between an extension name and a prefix of operand and - * operation type values. - */ - struct ExtensionNameAndPrefix { - /** - * The extension name. - * - * See {@link Extension::name} for the format specification. - */ - string name; - - /** - * The unique extension identifier within the model. - * - * See {@link Model::extensionNameToPrefix}. - */ - uint16_t prefix; - }; - - /** - * Numeric values of extension operand and operation types have the - * following structure: - * - 16 high bits represent the "prefix", which corresponds uniquely to the - * extension name. - * - 16 low bits represent the type ID within the extension. - */ - enum ExtensionTypeEncoding : uint8_t { - HIGH_BITS_PREFIX = 16, - LOW_BITS_TYPE = 16, - }; -}; - -/** - * Describes the shape information of an output operand after execution. - */ -struct OutputShape { - /** - * Dimensions of the operand. - */ - vec dimensions; - - /** - * Whether the provided buffer size is sufficient for the output. - */ - bool isSufficient; -}; - -/** - * Specifies whether or not to measure timing information during execution. - */ -enum MeasureTiming : int32_t { - NO = 0, - YES = 1, -}; - -/** - - * Timing information measured during execution. Each time is a duration from - * the beginning of some task to the end of that task, including time when that - * task is not active (for example, preempted by some other task, or - * waiting for some resource to become available). - * - * Times are measured in microseconds. - * When a time is not available, it must be reported as UINT64_MAX. - */ -struct Timing { - /** Execution time on device (not driver, which runs on host processor). */ - uint64_t timeOnDevice; - /** Execution time in driver (including time on device). */ - uint64_t timeInDriver; -}; +%insert Timing /** * FmqRequestDatum is a single element of a serialized representation of an @@ -683,46 +327,4 @@ safe_union FmqResultDatum { Timing executionTiming; }; -/** - * Information about an extension. - */ -struct Extension { - /** - * The extension name. - * - * The name must consist of lowercase latin letters, numbers, periods, and - * underscore signs. The name must contain at least one period. - * - * The name must start with the reverse domain name of the vendor. - * - * Example: com.google.test_extension - */ - string name; - - /** - * Information about an extension operand type. - */ - struct OperandTypeInformation { - /** - * The extension operand type. - */ - uint16_t type; - - /** - * Indicates whether the extension operand type represents a tensor or - * a scalar. - */ - bool isTensor; - - /** - * The byte size of the operand (if scalar) or of a single element (if - * tensor). - */ - uint32_t byteSize; - }; - - /** - * Information about operand types defined by the extension. - */ - vec operandTypes; -}; +%insert Extension diff --git a/neuralnetworks/1.3/types.t b/neuralnetworks/1.3/types.t index 9f69c9e070..96d1a1b975 100644 --- a/neuralnetworks/1.3/types.t +++ b/neuralnetworks/1.3/types.t @@ -90,459 +90,25 @@ enum OperationTypeRange : uint32_t { BASE_MAX = 0xFFFF, }; -/** - * Priority given to a prepared model for execution. - */ -enum Priority : int32_t { - LOW, - MEDIUM, - HIGH, -}; - -/** - * The capabilities of a driver. - * - * This represents performance of non-extension operations. - * - * Performance of an operation other than {@link OperationType::IF} and - * {@link OperationType::WHILE} comes from the type of its first operand. - */ -struct Capabilities { - /** - * Driver performance when operating on float32 data but performing - * calculations with range and/or precision as low as that of the IEEE - * 754 16-bit floating-point format. - */ - PerformanceInfo relaxedFloat32toFloat16PerformanceScalar; - PerformanceInfo relaxedFloat32toFloat16PerformanceTensor; +%insert Priority - /** - * Driver performance when operating on a particular data type. - * In the case of float32 data, this is used when the calculations - * are not relaxed. - */ - struct OperandPerformance { - OperandType type; - PerformanceInfo info; - }; - - /** - * Performance by operand type. Must be sorted by OperandType. - * - * If a particular {@link OperandType} is not present in operandPerformance, - * its performance is treated as - * { .execTime = FLT_MAX, .powerUsage = FLT_MAX }. - * - * Performance does not apply to {@link OperandType::SUBGRAPH}, and a driver - * must not report operand performance for {@link OperandType::SUBGRAPH}. - */ - vec operandPerformance; - - /** - * Performance of an {@link OperationType::IF} operation is the sum of - * {@link Capabilities::ifPerformance} and the mean of performance for the - * two branch subgraphs, where performance for a subgraph is the sum of the - * performance of all operations within the subgraph. - */ - PerformanceInfo ifPerformance; - - /** - * Performance of a {@link OperationType::WHILE} operation is the sum of - * {@link Capabilities::whilePerformance}, performance for the condition - * subgraph and performance for the body subgraph, where performance for a - * subgraph is the sum of the performance of all operations within the - * subgraph. - */ - PerformanceInfo whilePerformance; -}; +%insert Capabilities -/** - * Describes one operation of the model's graph. - */ -struct Operation { - /** - * The operation type. - * - * Besides the values listed in {@link OperationType}, any value above - * {@link OperationTypeRange::BASE_MAX} is possible and should be interpreted - * as an extension type according to {@link Model::extensionNameToPrefix}. - */ - OperationType type; +%insert Operation - /** - * Describes the table that contains the indexes of the inputs of the - * operation. The offset is the index in the operandIndexes table. - */ - vec inputs; +%insert OperandLifeTime - /** - * Describes the table that contains the indexes of the outputs of the - * operation. The offset is the index in the operandIndexes table. - */ - vec outputs; -}; +%insert Operand -/** - * How an operand is used. - */ -enum OperandLifeTime : int32_t { - /** - * The operand is internal to the model. It's created by an operation and - * consumed by other operations. It must be an output operand of - * exactly one operation. - */ - TEMPORARY_VARIABLE, +%insert Model - /** - * The operand is an input of a subgraph. It must not be an output - * operand of any operation. - * - * An operand can't be both input and output of a subgraph. - */ - SUBGRAPH_INPUT, +%insert Subgraph - /** - * The operand is an output of a subgraph. It must be an output - * operand of exactly one operation. - * - * An operand can't be both input and output of a subgraph. - */ - SUBGRAPH_OUTPUT, +%insert BufferDesc - /** - * The operand is a constant found in Model.operandValues. It must - * not be an output operand of any operation. - */ - CONSTANT_COPY, +%insert BufferRole - /** - * The operand is a constant that was specified via a Memory - * object. It must not be an output operand of any operation. - */ - CONSTANT_REFERENCE, - - /** - * The operand does not have a value. This is valid only for optional - * arguments of operations. - */ - NO_VALUE, - - /** - * The operand is a reference to a subgraph. It must be an input to one - * or more {@link OperationType::IF} or {@link OperationType::WHILE} - * operations. - */ - SUBGRAPH, -}; - -/** - * Describes one operand of the model's graph. - */ -struct Operand { - /** - * The data type. - * - * Besides the values listed in {@link OperandType}, any value above - * {@link OperandTypeRange::BASE_MAX} is possible and should be interpreted - * as an extension type according to {@link Model::extensionNameToPrefix}. - */ - OperandType type; - - /** - * Dimensions of the operand. - * - * For a scalar operand, dimensions.size() must be 0. - * - * A tensor operand with all dimensions specified has "fully - * specified" dimensions. Whenever possible (i.e., whenever the - * dimensions are known at model construction time), a tensor - * operand should have (but is not required to have) fully - * specified dimensions, in order to enable the best possible - * performance. - * - * If a tensor operand's dimensions are not fully specified, the - * dimensions of the operand are deduced from the operand - * dimensions and values of the operation for which that operand - * is an output or from the corresponding {@link OperationType::IF} or - * {@link OperationType::WHILE} operation input operand dimensions in the - * case of referenced subgraph input operands. - * - * In the following situations, a tensor operand's dimensions must - * be fully specified: - * - * . The operand has lifetime CONSTANT_COPY or - * CONSTANT_REFERENCE. - * - * . The operand has lifetime SUBGRAPH_INPUT and belongs to the main - * subgraph. Fully specified dimensions must either be present in the - * Operand or they must be provided in the corresponding - * RequestArgument. - * EXCEPTION: If the input is optional and omitted - * (by setting the hasNoValue field of the corresponding - * RequestArgument to true) then it need not have fully - * specified dimensions. - * - * A tensor operand with some number of unspecified dimensions is - * represented by setting each unspecified dimension to 0. - * - * A tensor operand with unspecified rank is represented by providing - * an empty dimensions vector. - */ - vec dimensions; - - /** - * The number of times this operand appears as an operation input. - * - * (For example, if this operand appears once in one operation's - * input list, and three times in another operation's input list, - * then numberOfConsumers = 4.) - */ - uint32_t numberOfConsumers; - - /** - * Quantized scale of the operand. - * - * Must be 0 when not applicable to an operand type. - * - * See {@link OperandType}. - */ - float scale; - - /** - * Quantized zero-point offset of the operand. - * - * Must be 0 when not applicable to an operand type. - * - * See {@link OperandType}. - */ - int32_t zeroPoint; - - /** - * How the operand is used. - */ - OperandLifeTime lifetime; - - /** - * Where to find the data for this operand. - * If the lifetime is TEMPORARY_VARIABLE, SUBGRAPH_INPUT, SUBGRAPH_OUTPUT, - * or NO_VALUE: - * - All the fields must be 0. - * If the lifetime is CONSTANT_COPY: - * - location.poolIndex is 0. - * - location.offset is the offset in bytes into Model.operandValues. - * - location.length is set. - * If the lifetime is CONSTANT_REFERENCE: - * - location.poolIndex is set. - * - location.offset is the offset in bytes into the specified pool. - * - location.length is set. - * If the lifetime is SUBGRAPH: - * - location.poolIndex is 0. - * - location.offset is the index of the referenced subgraph in - * {@link Model::referenced}. - * - location.length is 0. - */ - DataLocation location; - - /** - * Additional parameters specific to a particular operand type. - */ - @1.2::Operand.ExtraParams extraParams; -}; - -/** - * A Neural Network Model. - * - * This includes not only the execution graph, but also constant data such as - * weights or scalars added at construction time. The only information that - * may not be known is the shape of the input tensors. - */ -struct Model { - /** - * The top-level subgraph. - */ - Subgraph main; - - /** - * Referenced subgraphs. - * - * Each subgraph is referenced by the main subgraph or at least one other - * referenced subgraph. - * - * There must be no reference cycles. - */ - vec referenced; - - /** - * A byte buffer containing operand data that were copied into the model. - * - * An operand's value must be located here if and only if Operand::lifetime - * equals OperandLifeTime::CONSTANT_COPY. - */ - vec operandValues; - - /** - * A collection of shared memory pools containing operand values. - * - * An operand's value must be located here if and only if Operand::lifetime - * equals OperandLifeTime::CONSTANT_REFERENCE. - */ - vec pools; - - /** - * 'true' indicates TENSOR_FLOAT32 may be calculated with range and/or - * precision as low as that of the IEEE 754 16-bit floating-point format. - * 'false' indicates TENSOR_FLOAT32 must be calculated using at least the - * range and precision of the IEEE 754 32-bit floating-point format. - */ - bool relaxComputationFloat32toFloat16; - - /** - * The mapping between extension names and prefixes of operand and - * operation type values. - * - * An operand or operation whose numeric type value is above - * {@link OperandTypeRange::BASE_MAX} or - * {@link OperationTypeRange::BASE_MAX} respectively should be interpreted - * as an extension operand. The low - * {@link @1.2::Model::ExtensionTypeEncoding::LOW_BITS_TYPE} bits of the - * value correspond to the type ID within the extension and the high - * {@link @1.2::Model::ExtensionTypeEncoding::HIGH_BITS_PREFIX} bits encode - * the "prefix", which maps uniquely to the extension name. - * - * For example, if a model contains an operation whose value is - * 0xAAAABBBB and extensionNameToPrefix contains an entry with - * prefix=0xAAAA and name="vendor.test.test_extension", then - * the operation should be interpreted as the operation 0xBBBB - * of the extension named vendor.test.test_extension. - * - * This is a one-to-one correspondence. That is, there must be at most one - * prefix corresponding to each extension name and at most one extension - * name corresponding to each prefix. - */ - vec<@1.2::Model.ExtensionNameAndPrefix> extensionNameToPrefix; -}; - -/** - * An excerpt of the execution graph. - */ -struct Subgraph { - /** - * All operands included in the subgraph. - */ - vec operands; - - /** - * All operations included in the subgraph. - * - * The operations are sorted into execution order. Every operand - * with lifetime SUBGRAPH_OUTPUT or TEMPORARY_VARIABLE must be - * written before it is read. - */ - vec operations; - - /** - * Input indexes of the subgraph. There must be at least one. - * - * Each value corresponds to the index of the operand in "operands". - */ - vec inputIndexes; - - /** - * Output indexes of the subgraph. There must be at least one. - * - * Each value corresponds to the index of the operand in "operands". - */ - vec outputIndexes; -}; - -/** - * A buffer descriptor. Describes the properties of a buffer. - */ -struct BufferDesc { - /** - * Dimensions of the buffer. May have unknown dimensions or rank. A buffer with some number - * of unspecified dimensions is represented by setting each unspecified dimension to 0. A - * buffer with unspecified rank is represented by providing an empty dimensions vector. - */ - vec dimensions; -}; - -/** - * Describes a role of an input or output to a prepared model. - */ -struct BufferRole { - /** - * The index of the IPreparedModel within the "preparedModel" argument passed in - * IDevice::allocate. - */ - uint32_t modelIndex; - - /** - * The index of the input or output operand. - */ - uint32_t ioIndex; - - /** - * A floating-point value within the range (0.0, 1.0]. Describes how likely the - * buffer is to be used in the specified role. This is provided as a hint to - * optimize the case when multiple roles prefer different buffer locations or data - * layouts. - */ - float frequency; -}; - -/** - * Inputs to be sent to and outputs to be retrieved from a prepared model. - * - * A Request serves two primary tasks: - * 1) Provides the input and output data to be used when executing the model. - * 2) Specifies any updates to the input operand metadata that were left - * unspecified at model preparation time. - * - * An output must not overlap with any other output, with an input, or - * with an operand of lifetime CONSTANT_REFERENCE. - */ -struct Request { - /** - * Input data and information to be used in the execution of a prepared - * model. - * - * The index of the input corresponds to the index in Model.main.inputIndexes. - * E.g., input[i] corresponds to Model.main.inputIndexes[i]. - */ - vec inputs; - - /** - * Output data and information to be used in the execution of a prepared - * model. - * - * The index of the output corresponds to the index in Model.main.outputIndexes. - * E.g., output[i] corresponds to Model.main.outputIndexes[i]. - */ - vec outputs; - - /** - * A memory pool. - */ - safe_union MemoryPool { - /** - * Specifies a client-managed shared memory pool. - */ - memory hidlMemory; - - /** - * Specifies a driver-managed buffer. It is the token returned from IDevice::allocate, - * and is specific to the IDevice object. - */ - uint32_t token; - }; - - /** - * A collection of memory pools containing operand data for both the - * inputs and the outputs to a model. - */ - vec pools; -}; +%insert Request /** * Optional time point of the steady clock (as from std::chrono::steady_clock) -- GitLab From acff4063b63c04cbb28af87eab61e9a1fa70980a Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Sat, 19 Dec 2020 01:55:32 -0800 Subject: [PATCH 025/825] Implement full canonical Burst in NN util code Bug: 180492058 Bug: 177267324 Test: mma Test: presubmit Change-Id: I5018f6cf2dbaf705f74f4f46318142c64433e19d --- neuralnetworks/1.2/utils/Android.bp | 7 +- .../utils/include/nnapi/hal/1.2/Conversions.h | 1 + .../nnapi/hal/1.2/ExecutionBurstController.h | 223 ++++---- .../nnapi/hal/1.2/ExecutionBurstServer.h | 201 +++---- .../nnapi/hal/1.2/ExecutionBurstUtils.h | 252 ++++----- neuralnetworks/1.2/utils/src/Conversions.cpp | 4 + .../utils/src/ExecutionBurstController.cpp | 444 ++++++++------- .../1.2/utils/src/ExecutionBurstServer.cpp | 334 +++++------ .../1.2/utils/src/ExecutionBurstUtils.cpp | 521 ++++++++---------- .../1.2/utils/src/PreparedModel.cpp | 13 +- neuralnetworks/1.3/utils/Android.bp | 1 + .../utils/include/nnapi/hal/1.3/Conversions.h | 1 - neuralnetworks/1.3/utils/src/Conversions.cpp | 4 - .../1.3/utils/src/PreparedModel.cpp | 13 +- .../include/nnapi/hal/ProtectCallback.h | 16 +- .../utils/common/src/ProtectCallback.cpp | 38 +- 16 files changed, 1013 insertions(+), 1060 deletions(-) diff --git a/neuralnetworks/1.2/utils/Android.bp b/neuralnetworks/1.2/utils/Android.bp index 2921141484..41281ee955 100644 --- a/neuralnetworks/1.2/utils/Android.bp +++ b/neuralnetworks/1.2/utils/Android.bp @@ -27,7 +27,6 @@ cc_library_static { name: "neuralnetworks_utils_hal_1_2", defaults: ["neuralnetworks_utils_defaults"], srcs: ["src/*"], - exclude_srcs: ["src/ExecutionBurst*"], local_include_dirs: ["include/nnapi/hal/1.2/"], export_include_dirs: ["include"], cflags: ["-Wthread-safety"], @@ -41,10 +40,16 @@ cc_library_static { "android.hardware.neuralnetworks@1.0", "android.hardware.neuralnetworks@1.1", "android.hardware.neuralnetworks@1.2", + "libfmq", ], export_static_lib_headers: [ "neuralnetworks_utils_hal_common", ], + product_variables: { + debuggable: { // eng and userdebug builds + cflags: ["-DNN_DEBUGGABLE"], + }, + }, } cc_test { diff --git a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Conversions.h b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Conversions.h index 6fd13379ef..272cee7e88 100644 --- a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Conversions.h +++ b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Conversions.h @@ -52,6 +52,7 @@ GeneralResult convert(const hal::V1_2::Capabilities& capabilities) GeneralResult convert(const hal::V1_2::Model& model); GeneralResult convert(const hal::V1_2::MeasureTiming& measureTiming); GeneralResult convert(const hal::V1_2::Timing& timing); +GeneralResult convert(const hardware::hidl_memory& memory); GeneralResult> convert( const hardware::hidl_vec& extensions); diff --git a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstController.h b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstController.h index 5356a912bd..6b6fc71f65 100644 --- a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstController.h +++ b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstController.h @@ -14,23 +14,28 @@ * limitations under the License. */ -#ifndef ANDROID_FRAMEWORKS_ML_NN_COMMON_EXECUTION_BURST_CONTROLLER_H -#define ANDROID_FRAMEWORKS_ML_NN_COMMON_EXECUTION_BURST_CONTROLLER_H +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_EXECUTION_BURST_CONTROLLER_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_EXECUTION_BURST_CONTROLLER_H #include "ExecutionBurstUtils.h" -#include +#include #include -#include #include #include #include #include #include #include +#include +#include +#include +#include +#include #include #include +#include #include #include #include @@ -39,147 +44,145 @@ #include #include -namespace android::nn { +namespace android::hardware::neuralnetworks::V1_2::utils { /** - * The ExecutionBurstController class manages both the serialization and - * deserialization of data across FMQ, making it appear to the runtime as a - * regular synchronous inference. Additionally, this class manages the burst's - * memory cache. + * The ExecutionBurstController class manages both the serialization and deserialization of data + * across FMQ, making it appear to the runtime as a regular synchronous inference. Additionally, + * this class manages the burst's memory cache. */ -class ExecutionBurstController { - DISALLOW_IMPLICIT_CONSTRUCTORS(ExecutionBurstController); +class ExecutionBurstController final : public nn::IBurst { + struct PrivateConstructorTag {}; public: + using FallbackFunction = + std::function, nn::Timing>>( + const nn::Request&, nn::MeasureTiming)>; + /** - * NN runtime burst callback object and memory cache. + * NN runtime memory cache. + * + * MemoryCache associates a Memory object with a slot number to be passed across FMQ. The + * ExecutionBurstServer can use this callback to retrieve a hidl_memory corresponding to the + * slot via HIDL. * - * ExecutionBurstCallback associates a hidl_memory object with a slot number - * to be passed across FMQ. The ExecutionBurstServer can use this callback - * to retrieve this hidl_memory corresponding to the slot via HIDL. + * Whenever a hidl_memory object is copied, it will duplicate the underlying file descriptor. + * Because the NN runtime currently copies the hidl_memory on each execution, it is difficult to + * associate hidl_memory objects with previously cached hidl_memory objects. For this reason, + * callers of this class must pair each hidl_memory object with an associated key. For + * efficiency, if two hidl_memory objects represent the same underlying buffer, they must use + * the same key. * - * Whenever a hidl_memory object is copied, it will duplicate the underlying - * file descriptor. Because the NN runtime currently copies the hidl_memory - * on each execution, it is difficult to associate hidl_memory objects with - * previously cached hidl_memory objects. For this reason, callers of this - * class must pair each hidl_memory object with an associated key. For - * efficiency, if two hidl_memory objects represent the same underlying - * buffer, they must use the same key. + * This class is thread-safe. */ - class ExecutionBurstCallback : public hardware::neuralnetworks::V1_2::IBurstCallback { - DISALLOW_COPY_AND_ASSIGN(ExecutionBurstCallback); + class MemoryCache : public std::enable_shared_from_this { + struct PrivateConstructorTag {}; public: - ExecutionBurstCallback() = default; + using Task = std::function; + using Cleanup = base::ScopeGuard; + using SharedCleanup = std::shared_ptr; + using WeakCleanup = std::weak_ptr; - hardware::Return getMemories(const hardware::hidl_vec& slots, - getMemories_cb cb) override; + // Custom constructor to pre-allocate cache sizes. + MemoryCache(); /** - * This function performs one of two different actions: - * 1) If a key corresponding to a memory resource is unrecognized by the - * ExecutionBurstCallback object, the ExecutionBurstCallback object - * will allocate a slot, bind the memory to the slot, and return the - * slot identifier. - * 2) If a key corresponding to a memory resource is recognized by the - * ExecutionBurstCallback object, the ExecutionBurstCallback object - * will return the existing slot identifier. + * Add a burst context to the MemoryCache object. * - * @param memories Memory resources used in an inference. - * @param keys Unique identifiers where each element corresponds to a - * memory resource element in "memories". - * @return Unique slot identifiers where each returned slot element - * corresponds to a memory resource element in "memories". + * If this method is called, it must be called before the MemoryCache::cacheMemory or + * MemoryCache::getMemory is used. + * + * @param burstContext Burst context to be added to the MemoryCache object. */ - std::vector getSlots(const hardware::hidl_vec& memories, - const std::vector& keys); - - /* - * This function performs two different actions: - * 1) Removes an entry from the cache (if present), including the local - * storage of the hidl_memory object. Note that this call does not - * free any corresponding hidl_memory object in ExecutionBurstServer, - * which is separately freed via IBurstContext::freeMemory. - * 2) Return whether a cache entry was removed and which slot was removed if - * found. If the key did not to correspond to any entry in the cache, a - * slot number of 0 is returned. The slot number and whether the entry - * existed is useful so the same slot can be freed in the - * ExecutionBurstServer's cache via IBurstContext::freeMemory. + void setBurstContext(sp burstContext); + + /** + * Cache a memory object in the MemoryCache object. + * + * @param memory Memory object to be cached while the returned `SharedCleanup` is alive. + * @return A pair of (1) a unique identifier for the cache entry and (2) a ref-counted + * "hold" object which preserves the cache as long as the hold object is alive. */ - std::pair freeMemory(intptr_t key); + std::pair cacheMemory(const nn::SharedMemory& memory); + + /** + * Get the memory object corresponding to a slot identifier. + * + * @param slot Slot which identifies the memory object to retrieve. + * @return The memory object corresponding to slot, otherwise GeneralError. + */ + nn::GeneralResult getMemory(int32_t slot); private: - int32_t getSlotLocked(const hardware::hidl_memory& memory, intptr_t key); - int32_t allocateSlotLocked(); + void freeMemory(const nn::SharedMemory& memory); + int32_t allocateSlotLocked() REQUIRES(mMutex); std::mutex mMutex; - std::stack> mFreeSlots; - std::map mMemoryIdToSlot; - std::vector mMemoryCache; + std::condition_variable mCond; + sp mBurstContext GUARDED_BY(mMutex); + std::stack> mFreeSlots GUARDED_BY(mMutex); + std::map mMemoryIdToSlot GUARDED_BY(mMutex); + std::vector mMemoryCache GUARDED_BY(mMutex); + std::vector mCacheCleaner GUARDED_BY(mMutex); + }; + + /** + * HIDL Callback class to pass memory objects to the Burst server when given corresponding + * slots. + */ + class ExecutionBurstCallback : public IBurstCallback { + public: + // Precondition: memoryCache must be non-null. + explicit ExecutionBurstCallback(const std::shared_ptr& memoryCache); + + // See IBurstCallback::getMemories for information on this method. + Return getMemories(const hidl_vec& slots, getMemories_cb cb) override; + + private: + const std::weak_ptr kMemoryCache; }; /** * Creates a burst controller on a prepared model. * - * Prefer this over ExecutionBurstController's constructor. - * * @param preparedModel Model prepared for execution to execute on. - * @param pollingTimeWindow How much time (in microseconds) the - * ExecutionBurstController is allowed to poll the FMQ before waiting on - * the blocking futex. Polling may result in lower latencies at the - * potential cost of more power usage. + * @param pollingTimeWindow How much time (in microseconds) the ExecutionBurstController is + * allowed to poll the FMQ before waiting on the blocking futex. Polling may result in lower + * latencies at the potential cost of more power usage. * @return ExecutionBurstController Execution burst controller object. */ - static std::unique_ptr create( - const sp& preparedModel, + static nn::GeneralResult> create( + const sp& preparedModel, FallbackFunction fallback, std::chrono::microseconds pollingTimeWindow); - // prefer calling ExecutionBurstController::create - ExecutionBurstController(const std::shared_ptr& requestChannelSender, - const std::shared_ptr& resultChannelReceiver, - const sp& burstContext, - const sp& callback, - const sp& deathHandler = nullptr); + ExecutionBurstController(PrivateConstructorTag tag, FallbackFunction fallback, + std::unique_ptr requestChannelSender, + std::unique_ptr resultChannelReceiver, + sp callback, sp burstContext, + std::shared_ptr memoryCache, + neuralnetworks::utils::DeathHandler deathHandler); - // explicit destructor to unregister the death recipient - ~ExecutionBurstController(); + // See IBurst::cacheMemory for information on this method. + OptionalCacheHold cacheMemory(const nn::SharedMemory& memory) const override; - /** - * Execute a request on a model. - * - * @param request Arguments to be executed on a model. - * @param measure Whether to collect timing measurements, either YES or NO - * @param memoryIds Identifiers corresponding to each memory object in the - * request's pools. - * @return A tuple of: - * - result code of the execution - * - dynamic output shapes from the execution - * - any execution time measurements of the execution - * - whether or not a failed burst execution should be re-run using a - * different path (e.g., IPreparedModel::executeSynchronously) - */ - std::tuple, - hardware::neuralnetworks::V1_2::Timing, bool> - compute(const hardware::neuralnetworks::V1_0::Request& request, - hardware::neuralnetworks::V1_2::MeasureTiming measure, - const std::vector& memoryIds); - - /** - * Propagate a user's freeing of memory to the service. - * - * @param key Key corresponding to the memory object. - */ - void freeMemory(intptr_t key); + // See IBurst::execute for information on this method. + nn::ExecutionResult, nn::Timing>> execute( + const nn::Request& request, nn::MeasureTiming measure) const override; private: - std::mutex mMutex; - const std::shared_ptr mRequestChannelSender; - const std::shared_ptr mResultChannelReceiver; - const sp mBurstContext; - const sp mMemoryCache; - const sp mDeathHandler; + mutable std::atomic_flag mExecutionInFlight = ATOMIC_FLAG_INIT; + const FallbackFunction kFallback; + const std::unique_ptr mRequestChannelSender; + const std::unique_ptr mResultChannelReceiver; + const sp mBurstCallback; + const sp mBurstContext; + const std::shared_ptr mMemoryCache; + // `kDeathHandler` must come after `mRequestChannelSender` and `mResultChannelReceiver` because + // it holds references to both objects. + const neuralnetworks::utils::DeathHandler kDeathHandler; }; -} // namespace android::nn +} // namespace android::hardware::neuralnetworks::V1_2::utils -#endif // ANDROID_FRAMEWORKS_ML_NN_COMMON_EXECUTION_BURST_CONTROLLER_H +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_EXECUTION_BURST_CONTROLLER_H diff --git a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstServer.h b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstServer.h index 2e109b2de7..f7926f5835 100644 --- a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstServer.h +++ b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstServer.h @@ -14,19 +14,22 @@ * limitations under the License. */ -#ifndef ANDROID_FRAMEWORKS_ML_NN_COMMON_EXECUTION_BURST_SERVER_H -#define ANDROID_FRAMEWORKS_ML_NN_COMMON_EXECUTION_BURST_SERVER_H +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_EXECUTION_BURST_SERVER_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_EXECUTION_BURST_SERVER_H #include "ExecutionBurstUtils.h" -#include +#include #include -#include #include #include #include #include #include +#include +#include +#include +#include #include #include @@ -36,84 +39,61 @@ #include #include -namespace android::nn { +namespace android::hardware::neuralnetworks::V1_2::utils { /** - * The ExecutionBurstServer class is responsible for waiting for and - * deserializing a request object from a FMQ, performing the inference, and - * serializing the result back across another FMQ. + * The ExecutionBurstServer class is responsible for waiting for and deserializing a request object + * from a FMQ, performing the inference, and serializing the result back across another FMQ. */ -class ExecutionBurstServer : public hardware::neuralnetworks::V1_2::IBurstContext { - DISALLOW_IMPLICIT_CONSTRUCTORS(ExecutionBurstServer); +class ExecutionBurstServer : public IBurstContext { + struct PrivateConstructorTag {}; public: /** - * IBurstExecutorWithCache is a callback object passed to - * ExecutionBurstServer's factory function that is used to perform an - * execution. Because some memory resources are needed across multiple - * executions, this object also contains a local cache that can directly be - * used in the execution. + * Class to cache the memory objects for a burst object. * - * ExecutionBurstServer will never access its IBurstExecutorWithCache object - * with concurrent calls. + * This class is thread-safe. */ - class IBurstExecutorWithCache { - DISALLOW_COPY_AND_ASSIGN(IBurstExecutorWithCache); - + class MemoryCache { public: - IBurstExecutorWithCache() = default; - virtual ~IBurstExecutorWithCache() = default; - - /** - * Checks if a cache entry specified by a slot is present in the cache. - * - * @param slot Identifier of the cache entry. - * @return 'true' if the cache entry is present in the cache, 'false' - * otherwise. - */ - virtual bool isCacheEntryPresent(int32_t slot) const = 0; + // Precondition: burstExecutor != nullptr + // Precondition: burstCallback != nullptr + MemoryCache(nn::SharedBurst burstExecutor, sp burstCallback); /** - * Adds an entry specified by a slot to the cache. + * Get the cached memory objects corresponding to provided slot identifiers. * - * The caller of this function must ensure that the cache entry that is - * being added is not already present in the cache. This can be checked - * via isCacheEntryPresent. + * If the slot entry is not present in the cache, this class will use IBurstCallback to + * retrieve those entries that are not present in the cache, then cache them. * - * @param memory Memory resource to be cached. - * @param slot Slot identifier corresponding to the memory resource. + * @param slots Identifiers of memory objects to be retrieved. + * @return A vector where each element is the memory object and a ref-counted cache "hold" + * object to preserve the cache entry of the IBurst object as long as the "hold" object + * is alive, otherwise GeneralError. Each element of the vector corresponds to the + * element of slot. */ - virtual void addCacheEntry(const hardware::hidl_memory& memory, int32_t slot) = 0; + nn::GeneralResult>> + getCacheEntries(const std::vector& slots); /** - * Removes an entry specified by a slot from the cache. - * - * If the cache entry corresponding to the slot number does not exist, - * the call does nothing. + * Remove an entry from the cache. * - * @param slot Slot identifier corresponding to the memory resource. + * @param slot Identifier of the memory object to be removed from the cache. */ - virtual void removeCacheEntry(int32_t slot) = 0; - - /** - * Perform an execution. - * - * @param request Request object with inputs and outputs specified. - * Request::pools is empty, and DataLocation::poolIndex instead - * refers to the 'slots' argument as if it were Request::pools. - * @param slots Slots corresponding to the cached memory entries to be - * used. - * @param measure Whether timing information is requested for the - * execution. - * @return Result of the execution, including the status of the - * execution, dynamic output shapes, and any timing information. - */ - virtual std::tuple, - hardware::neuralnetworks::V1_2::Timing> - execute(const hardware::neuralnetworks::V1_0::Request& request, - const std::vector& slots, - hardware::neuralnetworks::V1_2::MeasureTiming measure) = 0; + void removeCacheEntry(int32_t slot); + + private: + nn::GeneralResult ensureCacheEntriesArePresentLocked( + const std::vector& slots) REQUIRES(mMutex); + nn::GeneralResult> + getCacheEntryLocked(int32_t slot) REQUIRES(mMutex); + void addCacheEntryLocked(int32_t slot, nn::SharedMemory memory) REQUIRES(mMutex); + + std::mutex mMutex; + std::map> mCache + GUARDED_BY(mMutex); + nn::SharedBurst kBurstExecutor; + const sp kBurstCallback; }; /** @@ -124,85 +104,52 @@ class ExecutionBurstServer : public hardware::neuralnetworks::V1_2::IBurstContex * 2) Execute a model with the given information * 3) Send the result to the created FMQ * - * @param callback Callback used to retrieve memories corresponding to - * unrecognized slots. - * @param requestChannel Input FMQ channel through which the client passes the - * request to the service. - * @param resultChannel Output FMQ channel from which the client can retrieve - * the result of the execution. - * @param executorWithCache Object which maintains a local cache of the - * memory pools and executes using the cached memory pools. - * @param pollingTimeWindow How much time (in microseconds) the - * ExecutionBurstServer is allowed to poll the FMQ before waiting on - * the blocking futex. Polling may result in lower latencies at the - * potential cost of more power usage. - * @result IBurstContext Handle to the burst context. - */ - static sp create( - const sp& callback, - const FmqRequestDescriptor& requestChannel, const FmqResultDescriptor& resultChannel, - std::shared_ptr executorWithCache, - std::chrono::microseconds pollingTimeWindow = std::chrono::microseconds{0}); - - /** - * Create automated context to manage FMQ-based executions. - * - * This function is intended to be used by a service to automatically: - * 1) Receive data from a provided FMQ - * 2) Execute a model with the given information - * 3) Send the result to the created FMQ - * - * @param callback Callback used to retrieve memories corresponding to - * unrecognized slots. - * @param requestChannel Input FMQ channel through which the client passes the - * request to the service. - * @param resultChannel Output FMQ channel from which the client can retrieve - * the result of the execution. - * @param preparedModel PreparedModel that the burst object was created from. - * IPreparedModel::executeSynchronously will be used to perform the + * @param callback Callback used to retrieve memories corresponding to unrecognized slots. + * @param requestChannel Input FMQ channel through which the client passes the request to the + * service. + * @param resultChannel Output FMQ channel from which the client can retrieve the result of the * execution. - * @param pollingTimeWindow How much time (in microseconds) the - * ExecutionBurstServer is allowed to poll the FMQ before waiting on - * the blocking futex. Polling may result in lower latencies at the - * potential cost of more power usage. - * @result IBurstContext Handle to the burst context. + * @param burstExecutor Object which maintains a local cache of the memory pools and executes + * using the cached memory pools. + * @param pollingTimeWindow How much time (in microseconds) the ExecutionBurstServer is allowed + * to poll the FMQ before waiting on the blocking futex. Polling may result in lower + * latencies at the potential cost of more power usage. + * @return IBurstContext Handle to the burst context. */ - static sp create( - const sp& callback, - const FmqRequestDescriptor& requestChannel, const FmqResultDescriptor& resultChannel, - hardware::neuralnetworks::V1_2::IPreparedModel* preparedModel, + static nn::GeneralResult> create( + const sp& callback, + const MQDescriptorSync& requestChannel, + const MQDescriptorSync& resultChannel, nn::SharedBurst burstExecutor, std::chrono::microseconds pollingTimeWindow = std::chrono::microseconds{0}); - ExecutionBurstServer(const sp& callback, + ExecutionBurstServer(PrivateConstructorTag tag, const sp& callback, std::unique_ptr requestChannel, std::unique_ptr resultChannel, - std::shared_ptr cachedExecutor); + nn::SharedBurst burstExecutor); ~ExecutionBurstServer(); - // Used by the NN runtime to preemptively remove any stored memory. - hardware::Return freeMemory(int32_t slot) override; + // Used by the NN runtime to preemptively remove any stored memory. See + // IBurstContext::freeMemory for more information. + Return freeMemory(int32_t slot) override; private: - // Ensures all cache entries contained in mExecutorWithCache are present in - // the cache. If they are not present, they are retrieved (via - // IBurstCallback::getMemories) and added to mExecutorWithCache. - // - // This method is locked via mMutex when it is called. - void ensureCacheEntriesArePresentLocked(const std::vector& slots); - - // Work loop that will continue processing execution requests until the - // ExecutionBurstServer object is freed. + // Work loop that will continue processing execution requests until the ExecutionBurstServer + // object is freed. void task(); + nn::ExecutionResult, Timing>> execute( + const V1_0::Request& requestWithoutPools, const std::vector& slotsOfPools, + MeasureTiming measure); + std::thread mWorker; - std::mutex mMutex; std::atomic mTeardown{false}; - const sp mCallback; + const sp mCallback; const std::unique_ptr mRequestChannelReceiver; const std::unique_ptr mResultChannelSender; - const std::shared_ptr mExecutorWithCache; + const nn::SharedBurst mBurstExecutor; + MemoryCache mMemoryCache; }; -} // namespace android::nn +} // namespace android::hardware::neuralnetworks::V1_2::utils -#endif // ANDROID_FRAMEWORKS_ML_NN_COMMON_EXECUTION_BURST_SERVER_H +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_EXECUTION_BURST_SERVER_H diff --git a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstUtils.h b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstUtils.h index 8a4159122e..c662bc3eed 100644 --- a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstUtils.h +++ b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstUtils.h @@ -18,15 +18,16 @@ #define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_EXECUTION_BURST_UTILS_H #include -#include #include #include #include +#include +#include +#include #include #include #include -#include #include #include #include @@ -38,159 +39,139 @@ namespace android::hardware::neuralnetworks::V1_2::utils { */ constexpr const size_t kExecutionBurstChannelLength = 1024; -using FmqRequestDescriptor = MQDescriptorSync; -using FmqResultDescriptor = MQDescriptorSync; +/** + * Get how long the burst controller should poll while waiting for results to be returned. + * + * This time can be affected by the property "debug.nn.burst-controller-polling-window". + * + * @return Polling time in microseconds. + */ +std::chrono::microseconds getBurstControllerPollingTimeWindow(); /** - * Function to serialize a request. + * Get how long the burst server should poll while waiting for a request to be received. * - * Prefer calling RequestChannelSender::send. + * This time can be affected by the property "debug.nn.burst-server-polling-window". + * + * @return Polling time in microseconds. + */ +std::chrono::microseconds getBurstServerPollingTimeWindow(); + +/** + * Function to serialize a request. * * @param request Request object without the pool information. * @param measure Whether to collect timing information for the execution. - * @param memoryIds Slot identifiers corresponding to memory resources for the - * request. + * @param memoryIds Slot identifiers corresponding to memory resources for the request. * @return Serialized FMQ request data. */ -std::vector serialize( - const hardware::neuralnetworks::V1_0::Request& request, - hardware::neuralnetworks::V1_2::MeasureTiming measure, const std::vector& slots); +std::vector serialize(const V1_0::Request& request, MeasureTiming measure, + const std::vector& slots); /** * Deserialize the FMQ request data. * - * The three resulting fields are the Request object (where Request::pools is - * empty), slot identifiers (which are stand-ins for Request::pools), and - * whether timing information must be collected for the run. + * The three resulting fields are the Request object (where Request::pools is empty), slot + * identifiers (which are stand-ins for Request::pools), and whether timing information must be + * collected for the run. * * @param data Serialized FMQ request data. - * @return Request object if successfully deserialized, std::nullopt otherwise. + * @return Request object if successfully deserialized, otherwise an error message. */ -std::optional, - hardware::neuralnetworks::V1_2::MeasureTiming>> -deserialize(const std::vector& data); +nn::Result, MeasureTiming>> deserialize( + const std::vector& data); /** * Function to serialize results. * - * Prefer calling ResultChannelSender::send. - * * @param errorStatus Status of the execution. * @param outputShapes Dynamic shapes of the output tensors. * @param timing Timing information of the execution. * @return Serialized FMQ result data. */ -std::vector serialize( - hardware::neuralnetworks::V1_0::ErrorStatus errorStatus, - const std::vector& outputShapes, - hardware::neuralnetworks::V1_2::Timing timing); +std::vector serialize(V1_0::ErrorStatus errorStatus, + const std::vector& outputShapes, Timing timing); /** * Deserialize the FMQ result data. * - * The three resulting fields are the status of the execution, the dynamic - * shapes of the output tensors, and the timing information of the execution. + * The three resulting fields are the status of the execution, the dynamic shapes of the output + * tensors, and the timing information of the execution. * * @param data Serialized FMQ result data. - * @return Result object if successfully deserialized, std::nullopt otherwise. + * @return Result object if successfully deserialized, otherwise an error message. */ -std::optional, - hardware::neuralnetworks::V1_2::Timing>> -deserialize(const std::vector& data); +nn::Result, Timing>> deserialize( + const std::vector& data); /** - * Convert result code to error status. - * - * @param resultCode Result code to be converted. - * @return ErrorStatus Resultant error status. - */ -hardware::neuralnetworks::V1_0::ErrorStatus legacyConvertResultCodeToErrorStatus(int resultCode); - -/** - * RequestChannelSender is responsible for serializing the result packet of - * information, sending it on the result channel, and signaling that the data is - * available. + * RequestChannelSender is responsible for serializing the result packet of information, sending it + * on the result channel, and signaling that the data is available. */ -class RequestChannelSender { - using FmqRequestDescriptor = - hardware::MQDescriptorSync; - using FmqRequestChannel = - hardware::MessageQueue; +class RequestChannelSender final : public neuralnetworks::utils::IProtectedCallback { + struct PrivateConstructorTag {}; public: /** * Create the sending end of a request channel. * - * Prefer this call over the constructor. - * * @param channelLength Number of elements in the FMQ. - * @return A pair of ResultChannelReceiver and the FMQ descriptor on - * successful creation, both nullptr otherwise. + * @return A pair of ResultChannelReceiver and the FMQ descriptor on successful creation, + * GeneralError otherwise. */ - static std::pair, const FmqRequestDescriptor*> create( - size_t channelLength); + static nn::GeneralResult, + const MQDescriptorSync*>> + create(size_t channelLength); /** * Send the request to the channel. * * @param request Request object without the pool information. * @param measure Whether to collect timing information for the execution. - * @param memoryIds Slot identifiers corresponding to memory resources for - * the request. - * @return 'true' on successful send, 'false' otherwise. + * @param slots Slot identifiers corresponding to memory resources for the request. + * @return An empty `Result` on successful send, otherwise an error message. */ - bool send(const hardware::neuralnetworks::V1_0::Request& request, - hardware::neuralnetworks::V1_2::MeasureTiming measure, - const std::vector& slots); + nn::Result send(const V1_0::Request& request, MeasureTiming measure, + const std::vector& slots); /** - * Method to mark the channel as invalid, causing all future calls to - * RequestChannelSender::send to immediately return false without attempting - * to send a message across the FMQ. + * Method to mark the channel as invalid, causing all future calls to RequestChannelSender::send + * to immediately return false without attempting to send a message across the FMQ. */ - void invalidate(); + void notifyAsDeadObject() override; // prefer calling RequestChannelSender::send - bool sendPacket(const std::vector& packet); + nn::Result sendPacket(const std::vector& packet); - RequestChannelSender(std::unique_ptr fmqRequestChannel); + RequestChannelSender(PrivateConstructorTag tag, size_t channelLength); private: - const std::unique_ptr mFmqRequestChannel; + MessageQueue mFmqRequestChannel; std::atomic mValid{true}; }; /** - * RequestChannelReceiver is responsible for waiting on the channel until the - * packet is available, extracting the packet from the channel, and - * deserializing the packet. + * RequestChannelReceiver is responsible for waiting on the channel until the packet is available, + * extracting the packet from the channel, and deserializing the packet. * - * Because the receiver can wait on a packet that may never come (e.g., because - * the sending side of the packet has been closed), this object can be - * invalidated, unblocking the receiver. + * Because the receiver can wait on a packet that may never come (e.g., because the sending side of + * the packet has been closed), this object can be invalidated, unblocking the receiver. */ -class RequestChannelReceiver { - using FmqRequestChannel = - hardware::MessageQueue; +class RequestChannelReceiver final { + struct PrivateConstructorTag {}; public: /** * Create the receiving end of a request channel. * - * Prefer this call over the constructor. - * * @param requestChannel Descriptor for the request channel. - * @param pollingTimeWindow How much time (in microseconds) the - * RequestChannelReceiver is allowed to poll the FMQ before waiting on - * the blocking futex. Polling may result in lower latencies at the - * potential cost of more power usage. + * @param pollingTimeWindow How much time (in microseconds) the RequestChannelReceiver is + * allowed to poll the FMQ before waiting on the blocking futex. Polling may result in lower + * latencies at the potential cost of more power usage. * @return RequestChannelReceiver on successful creation, nullptr otherwise. */ - static std::unique_ptr create( - const FmqRequestDescriptor& requestChannel, + static nn::GeneralResult> create( + const MQDescriptorSync& requestChannel, std::chrono::microseconds pollingTimeWindow); /** @@ -200,49 +181,45 @@ class RequestChannelReceiver { * 1) The packet has been retrieved, or * 2) The receiver has been invalidated * - * @return Request object if successfully received, std::nullopt if error or - * if the receiver object was invalidated. + * @return Request object if successfully received, an appropriate message if error or if the + * receiver object was invalidated. */ - std::optional, - hardware::neuralnetworks::V1_2::MeasureTiming>> - getBlocking(); + nn::Result, MeasureTiming>> getBlocking(); /** - * Method to mark the channel as invalid, unblocking any current or future - * calls to RequestChannelReceiver::getBlocking. + * Method to mark the channel as invalid, unblocking any current or future calls to + * RequestChannelReceiver::getBlocking. */ void invalidate(); - RequestChannelReceiver(std::unique_ptr fmqRequestChannel, + RequestChannelReceiver(PrivateConstructorTag tag, + const MQDescriptorSync& requestChannel, std::chrono::microseconds pollingTimeWindow); private: - std::optional> getPacketBlocking(); + nn::Result> getPacketBlocking(); - const std::unique_ptr mFmqRequestChannel; + MessageQueue mFmqRequestChannel; std::atomic mTeardown{false}; const std::chrono::microseconds kPollingTimeWindow; }; /** - * ResultChannelSender is responsible for serializing the result packet of - * information, sending it on the result channel, and signaling that the data is - * available. + * ResultChannelSender is responsible for serializing the result packet of information, sending it + * on the result channel, and signaling that the data is available. */ -class ResultChannelSender { - using FmqResultChannel = hardware::MessageQueue; +class ResultChannelSender final { + struct PrivateConstructorTag {}; public: /** * Create the sending end of a result channel. * - * Prefer this call over the constructor. - * * @param resultChannel Descriptor for the result channel. * @return ResultChannelSender on successful creation, nullptr otherwise. */ - static std::unique_ptr create(const FmqResultDescriptor& resultChannel); + static nn::GeneralResult> create( + const MQDescriptorSync& resultChannel); /** * Send the result to the channel. @@ -250,52 +227,44 @@ class ResultChannelSender { * @param errorStatus Status of the execution. * @param outputShapes Dynamic shapes of the output tensors. * @param timing Timing information of the execution. - * @return 'true' on successful send, 'false' otherwise. */ - bool send(hardware::neuralnetworks::V1_0::ErrorStatus errorStatus, - const std::vector& outputShapes, - hardware::neuralnetworks::V1_2::Timing timing); + void send(V1_0::ErrorStatus errorStatus, const std::vector& outputShapes, + Timing timing); // prefer calling ResultChannelSender::send - bool sendPacket(const std::vector& packet); + void sendPacket(const std::vector& packet); - ResultChannelSender(std::unique_ptr fmqResultChannel); + ResultChannelSender(PrivateConstructorTag tag, + const MQDescriptorSync& resultChannel); private: - const std::unique_ptr mFmqResultChannel; + MessageQueue mFmqResultChannel; }; /** - * ResultChannelReceiver is responsible for waiting on the channel until the - * packet is available, extracting the packet from the channel, and - * deserializing the packet. + * ResultChannelReceiver is responsible for waiting on the channel until the packet is available, + * extracting the packet from the channel, and deserializing the packet. * - * Because the receiver can wait on a packet that may never come (e.g., because - * the sending side of the packet has been closed), this object can be - * invalidated, unblocking the receiver. + * Because the receiver can wait on a packet that may never come (e.g., because the sending side of + * the packet has been closed), this object can be invalidated, unblocking the receiver. */ -class ResultChannelReceiver { - using FmqResultDescriptor = - hardware::MQDescriptorSync; - using FmqResultChannel = hardware::MessageQueue; +class ResultChannelReceiver final : public neuralnetworks::utils::IProtectedCallback { + struct PrivateConstructorTag {}; public: /** * Create the receiving end of a result channel. * - * Prefer this call over the constructor. - * * @param channelLength Number of elements in the FMQ. - * @param pollingTimeWindow How much time (in microseconds) the - * ResultChannelReceiver is allowed to poll the FMQ before waiting on - * the blocking futex. Polling may result in lower latencies at the - * potential cost of more power usage. - * @return A pair of ResultChannelReceiver and the FMQ descriptor on - * successful creation, both nullptr otherwise. + * @param pollingTimeWindow How much time (in microseconds) the ResultChannelReceiver is allowed + * to poll the FMQ before waiting on the blocking futex. Polling may result in lower + * latencies at the potential cost of more power usage. + * @return A pair of ResultChannelReceiver and the FMQ descriptor on successful creation, or + * GeneralError otherwise. */ - static std::pair, const FmqResultDescriptor*> create( - size_t channelLength, std::chrono::microseconds pollingTimeWindow); + static nn::GeneralResult, + const MQDescriptorSync*>> + create(size_t channelLength, std::chrono::microseconds pollingTimeWindow); /** * Get the result from the channel. @@ -304,28 +273,25 @@ class ResultChannelReceiver { * 1) The packet has been retrieved, or * 2) The receiver has been invalidated * - * @return Result object if successfully received, std::nullopt if error or + * @return Result object if successfully received, otherwise an appropriate message if error or * if the receiver object was invalidated. */ - std::optional, - hardware::neuralnetworks::V1_2::Timing>> - getBlocking(); + nn::Result, Timing>> getBlocking(); /** - * Method to mark the channel as invalid, unblocking any current or future - * calls to ResultChannelReceiver::getBlocking. + * Method to mark the channel as invalid, unblocking any current or future calls to + * ResultChannelReceiver::getBlocking. */ - void invalidate(); + void notifyAsDeadObject() override; // prefer calling ResultChannelReceiver::getBlocking - std::optional> getPacketBlocking(); + nn::Result> getPacketBlocking(); - ResultChannelReceiver(std::unique_ptr fmqResultChannel, + ResultChannelReceiver(PrivateConstructorTag tag, size_t channelLength, std::chrono::microseconds pollingTimeWindow); private: - const std::unique_ptr mFmqResultChannel; + MessageQueue mFmqResultChannel; std::atomic mValid{true}; const std::chrono::microseconds kPollingTimeWindow; }; diff --git a/neuralnetworks/1.2/utils/src/Conversions.cpp b/neuralnetworks/1.2/utils/src/Conversions.cpp index 86a417a352..2c45583d0c 100644 --- a/neuralnetworks/1.2/utils/src/Conversions.cpp +++ b/neuralnetworks/1.2/utils/src/Conversions.cpp @@ -331,6 +331,10 @@ GeneralResult convert(const hal::V1_2::Timing& timing) { return validatedConvert(timing); } +GeneralResult convert(const hardware::hidl_memory& memory) { + return validatedConvert(memory); +} + GeneralResult> convert(const hidl_vec& extensions) { return validatedConvert(extensions); } diff --git a/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp b/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp index 2265861b41..eedf5916bc 100644 --- a/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp +++ b/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp @@ -17,283 +17,321 @@ #define LOG_TAG "ExecutionBurstController" #include "ExecutionBurstController.h" +#include "ExecutionBurstUtils.h" #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include #include +#include #include #include #include -#include "ExecutionBurstUtils.h" -#include "HalInterfaces.h" +#include "Callbacks.h" +#include "Conversions.h" #include "Tracing.h" #include "Utils.h" -namespace android::nn { +namespace android::hardware::neuralnetworks::V1_2::utils { namespace { -class BurstContextDeathHandler : public hardware::hidl_death_recipient { - public: - using Callback = std::function; - - BurstContextDeathHandler(const Callback& onDeathCallback) : mOnDeathCallback(onDeathCallback) { - CHECK(onDeathCallback != nullptr); +nn::GeneralResult> executionBurstResultCallback( + V1_0::ErrorStatus status, const sp& burstContext) { + HANDLE_HAL_STATUS(status) << "IPreparedModel::configureExecutionBurst failed with status " + << toString(status); + if (burstContext == nullptr) { + return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) + << "IPreparedModel::configureExecutionBurst returned nullptr for burst"; } + return burstContext; +} - void serviceDied(uint64_t /*cookie*/, const wp& /*who*/) override { - LOG(ERROR) << "BurstContextDeathHandler::serviceDied -- service unexpectedly died!"; - mOnDeathCallback(); +nn::GeneralResult> getMemoriesHelper( + const hidl_vec& slots, + const std::shared_ptr& memoryCache) { + hidl_vec memories(slots.size()); + for (size_t i = 0; i < slots.size(); ++i) { + const int32_t slot = slots[i]; + const auto memory = NN_TRY(memoryCache->getMemory(slot)); + memories[i] = NN_TRY(V1_0::utils::unvalidatedConvert(memory)); + if (!memories[i].valid()) { + return NN_ERROR() << "memory at slot " << slot << " is invalid"; + } } + return memories; +} - private: - const Callback mOnDeathCallback; -}; - -} // anonymous namespace - -hardware::Return ExecutionBurstController::ExecutionBurstCallback::getMemories( - const hardware::hidl_vec& slots, getMemories_cb cb) { - std::lock_guard guard(mMutex); +} // namespace - // get all memories - hardware::hidl_vec memories(slots.size()); - std::transform(slots.begin(), slots.end(), memories.begin(), [this](int32_t slot) { - return slot < mMemoryCache.size() ? mMemoryCache[slot] : hardware::hidl_memory{}; - }); +// MemoryCache methods - // ensure all memories are valid - if (!std::all_of(memories.begin(), memories.end(), - [](const hardware::hidl_memory& memory) { return memory.valid(); })) { - cb(V1_0::ErrorStatus::INVALID_ARGUMENT, {}); - return hardware::Void(); - } +ExecutionBurstController::MemoryCache::MemoryCache() { + constexpr size_t kPreallocatedCount = 1024; + std::vector freeSlotsSpace; + freeSlotsSpace.reserve(kPreallocatedCount); + mFreeSlots = std::stack>(std::move(freeSlotsSpace)); + mMemoryCache.reserve(kPreallocatedCount); + mCacheCleaner.reserve(kPreallocatedCount); +} - // return successful - cb(V1_0::ErrorStatus::NONE, std::move(memories)); - return hardware::Void(); +void ExecutionBurstController::MemoryCache::setBurstContext(sp burstContext) { + std::lock_guard guard(mMutex); + mBurstContext = std::move(burstContext); } -std::vector ExecutionBurstController::ExecutionBurstCallback::getSlots( - const hardware::hidl_vec& memories, - const std::vector& keys) { - std::lock_guard guard(mMutex); +std::pair +ExecutionBurstController::MemoryCache::cacheMemory(const nn::SharedMemory& memory) { + std::unique_lock lock(mMutex); + base::ScopedLockAssertion lockAssert(mMutex); - // retrieve (or bind) all slots corresponding to memories - std::vector slots; - slots.reserve(memories.size()); - for (size_t i = 0; i < memories.size(); ++i) { - slots.push_back(getSlotLocked(memories[i], keys[i])); + // Use existing cache entry if (1) the Memory object is in the cache and (2) the cache entry is + // not currently being freed. + auto iter = mMemoryIdToSlot.find(memory); + while (iter != mMemoryIdToSlot.end()) { + const int32_t slot = iter->second; + if (auto cleaner = mCacheCleaner.at(slot).lock()) { + return std::make_pair(slot, std::move(cleaner)); + } + + // If the code reaches this point, the Memory object was in the cache, but is currently + // being destroyed. This code waits until the cache entry has been freed, then loops to + // ensure the cache entry has been freed or has been made present by another thread. + mCond.wait(lock); + iter = mMemoryIdToSlot.find(memory); } - return slots; -} -std::pair ExecutionBurstController::ExecutionBurstCallback::freeMemory( - intptr_t key) { - std::lock_guard guard(mMutex); + // Allocate a new cache entry. + const int32_t slot = allocateSlotLocked(); + mMemoryIdToSlot[memory] = slot; + mMemoryCache[slot] = memory; + + // Create reference-counted self-cleaning cache object. + auto self = weak_from_this(); + Task cleanup = [memory, memoryCache = std::move(self)] { + if (const auto lock = memoryCache.lock()) { + lock->freeMemory(memory); + } + }; + auto cleaner = std::make_shared(std::move(cleanup)); + mCacheCleaner[slot] = cleaner; + + return std::make_pair(slot, std::move(cleaner)); +} - auto iter = mMemoryIdToSlot.find(key); - if (iter == mMemoryIdToSlot.end()) { - return {false, 0}; +nn::GeneralResult ExecutionBurstController::MemoryCache::getMemory(int32_t slot) { + std::lock_guard guard(mMutex); + if (slot < 0 || static_cast(slot) >= mMemoryCache.size()) { + return NN_ERROR() << "Invalid slot: " << slot << " vs " << mMemoryCache.size(); } - const int32_t slot = iter->second; - mMemoryIdToSlot.erase(key); - mMemoryCache[slot] = {}; - mFreeSlots.push(slot); - return {true, slot}; + return mMemoryCache[slot]; } -int32_t ExecutionBurstController::ExecutionBurstCallback::getSlotLocked( - const hardware::hidl_memory& memory, intptr_t key) { - auto iter = mMemoryIdToSlot.find(key); - if (iter == mMemoryIdToSlot.end()) { - const int32_t slot = allocateSlotLocked(); - mMemoryIdToSlot[key] = slot; - mMemoryCache[slot] = memory; - return slot; - } else { - const int32_t slot = iter->second; - return slot; +void ExecutionBurstController::MemoryCache::freeMemory(const nn::SharedMemory& memory) { + { + std::lock_guard guard(mMutex); + const int32_t slot = mMemoryIdToSlot.at(memory); + if (mBurstContext) { + mBurstContext->freeMemory(slot); + } + mMemoryIdToSlot.erase(memory); + mMemoryCache[slot] = {}; + mCacheCleaner[slot].reset(); + mFreeSlots.push(slot); } + mCond.notify_all(); } -int32_t ExecutionBurstController::ExecutionBurstCallback::allocateSlotLocked() { +int32_t ExecutionBurstController::MemoryCache::allocateSlotLocked() { constexpr size_t kMaxNumberOfSlots = std::numeric_limits::max(); - // if there is a free slot, use it - if (mFreeSlots.size() > 0) { + // If there is a free slot, use it. + if (!mFreeSlots.empty()) { const int32_t slot = mFreeSlots.top(); mFreeSlots.pop(); return slot; } - // otherwise use a slot for the first time - CHECK(mMemoryCache.size() < kMaxNumberOfSlots) << "Exceeded maximum number of slots!"; + // Use a slot for the first time. + CHECK_LT(mMemoryCache.size(), kMaxNumberOfSlots) << "Exceeded maximum number of slots!"; const int32_t slot = static_cast(mMemoryCache.size()); mMemoryCache.emplace_back(); + mCacheCleaner.emplace_back(); return slot; } -std::unique_ptr ExecutionBurstController::create( - const sp& preparedModel, +// ExecutionBurstCallback methods + +ExecutionBurstController::ExecutionBurstCallback::ExecutionBurstCallback( + const std::shared_ptr& memoryCache) + : kMemoryCache(memoryCache) { + CHECK(memoryCache != nullptr); +} + +Return ExecutionBurstController::ExecutionBurstCallback::getMemories( + const hidl_vec& slots, getMemories_cb cb) { + const auto memoryCache = kMemoryCache.lock(); + if (memoryCache == nullptr) { + LOG(ERROR) << "ExecutionBurstController::ExecutionBurstCallback::getMemories called after " + "the MemoryCache has been freed"; + cb(V1_0::ErrorStatus::GENERAL_FAILURE, {}); + return Void(); + } + + const auto maybeMemories = getMemoriesHelper(slots, memoryCache); + if (!maybeMemories.has_value()) { + const auto& [message, code] = maybeMemories.error(); + LOG(ERROR) << "ExecutionBurstController::ExecutionBurstCallback::getMemories failed with " + << code << ": " << message; + cb(V1_0::ErrorStatus::INVALID_ARGUMENT, {}); + return Void(); + } + + cb(V1_0::ErrorStatus::NONE, maybeMemories.value()); + return Void(); +} + +// ExecutionBurstController methods + +nn::GeneralResult> ExecutionBurstController::create( + const sp& preparedModel, FallbackFunction fallback, std::chrono::microseconds pollingTimeWindow) { // check inputs if (preparedModel == nullptr) { - LOG(ERROR) << "ExecutionBurstController::create passed a nullptr"; - return nullptr; + return NN_ERROR() << "ExecutionBurstController::create passed a nullptr"; } - // create callback object - sp callback = new ExecutionBurstCallback(); - // create FMQ objects - auto [requestChannelSenderTemp, requestChannelDescriptor] = - RequestChannelSender::create(kExecutionBurstChannelLength); - auto [resultChannelReceiverTemp, resultChannelDescriptor] = - ResultChannelReceiver::create(kExecutionBurstChannelLength, pollingTimeWindow); - std::shared_ptr requestChannelSender = - std::move(requestChannelSenderTemp); - std::shared_ptr resultChannelReceiver = - std::move(resultChannelReceiverTemp); + auto [requestChannelSender, requestChannelDescriptor] = + NN_TRY(RequestChannelSender::create(kExecutionBurstChannelLength)); + auto [resultChannelReceiver, resultChannelDescriptor] = + NN_TRY(ResultChannelReceiver::create(kExecutionBurstChannelLength, pollingTimeWindow)); // check FMQ objects - if (!requestChannelSender || !resultChannelReceiver || !requestChannelDescriptor || - !resultChannelDescriptor) { - LOG(ERROR) << "ExecutionBurstController::create failed to create FastMessageQueue"; - return nullptr; - } + CHECK(requestChannelSender != nullptr); + CHECK(requestChannelDescriptor != nullptr); + CHECK(resultChannelReceiver != nullptr); + CHECK(resultChannelDescriptor != nullptr); + + // create memory cache + auto memoryCache = std::make_shared(); + + // create callback object + auto burstCallback = sp::make(memoryCache); + auto cb = hal::utils::CallbackValue(executionBurstResultCallback); // configure burst - V1_0::ErrorStatus errorStatus; - sp burstContext; - const hardware::Return ret = preparedModel->configureExecutionBurst( - callback, *requestChannelDescriptor, *resultChannelDescriptor, - [&errorStatus, &burstContext](V1_0::ErrorStatus status, - const sp& context) { - errorStatus = status; - burstContext = context; - }); - - // check burst - if (!ret.isOk()) { - LOG(ERROR) << "IPreparedModel::configureExecutionBurst failed with description " - << ret.description(); - return nullptr; - } - if (errorStatus != V1_0::ErrorStatus::NONE) { - LOG(ERROR) << "IPreparedModel::configureExecutionBurst failed with status " - << toString(errorStatus); - return nullptr; - } - if (burstContext == nullptr) { - LOG(ERROR) << "IPreparedModel::configureExecutionBurst returned nullptr for burst"; - return nullptr; - } + const Return ret = preparedModel->configureExecutionBurst( + burstCallback, *requestChannelDescriptor, *resultChannelDescriptor, cb); + HANDLE_TRANSPORT_FAILURE(ret); + + auto burstContext = NN_TRY(cb.take()); + memoryCache->setBurstContext(burstContext); // create death handler object - BurstContextDeathHandler::Callback onDeathCallback = [requestChannelSender, - resultChannelReceiver] { - requestChannelSender->invalidate(); - resultChannelReceiver->invalidate(); - }; - const sp deathHandler = new BurstContextDeathHandler(onDeathCallback); - - // linkToDeath registers a callback that will be invoked on service death to - // proactively handle service crashes. If the linkToDeath call fails, - // asynchronous calls are susceptible to hangs if the service crashes before - // providing the response. - const hardware::Return deathHandlerRet = burstContext->linkToDeath(deathHandler, 0); - if (!deathHandlerRet.isOk() || deathHandlerRet != true) { - LOG(ERROR) << "ExecutionBurstController::create -- Failed to register a death recipient " - "for the IBurstContext object."; - return nullptr; - } + auto deathHandler = NN_TRY(neuralnetworks::utils::DeathHandler::create(burstContext)); + deathHandler.protectCallbackForLifetimeOfDeathHandler(requestChannelSender.get()); + deathHandler.protectCallbackForLifetimeOfDeathHandler(resultChannelReceiver.get()); // make and return controller - return std::make_unique(requestChannelSender, resultChannelReceiver, - burstContext, callback, deathHandler); + return std::make_shared( + PrivateConstructorTag{}, std::move(fallback), std::move(requestChannelSender), + std::move(resultChannelReceiver), std::move(burstCallback), std::move(burstContext), + std::move(memoryCache), std::move(deathHandler)); } ExecutionBurstController::ExecutionBurstController( - const std::shared_ptr& requestChannelSender, - const std::shared_ptr& resultChannelReceiver, - const sp& burstContext, const sp& callback, - const sp& deathHandler) - : mRequestChannelSender(requestChannelSender), - mResultChannelReceiver(resultChannelReceiver), - mBurstContext(burstContext), - mMemoryCache(callback), - mDeathHandler(deathHandler) {} - -ExecutionBurstController::~ExecutionBurstController() { - // It is safe to ignore any errors resulting from this unlinkToDeath call - // because the ExecutionBurstController object is already being destroyed - // and its underlying IBurstContext object is no longer being used by the NN - // runtime. - if (mDeathHandler) { - mBurstContext->unlinkToDeath(mDeathHandler).isOk(); - } + PrivateConstructorTag /*tag*/, FallbackFunction fallback, + std::unique_ptr requestChannelSender, + std::unique_ptr resultChannelReceiver, + sp callback, sp burstContext, + std::shared_ptr memoryCache, neuralnetworks::utils::DeathHandler deathHandler) + : kFallback(std::move(fallback)), + mRequestChannelSender(std::move(requestChannelSender)), + mResultChannelReceiver(std::move(resultChannelReceiver)), + mBurstCallback(std::move(callback)), + mBurstContext(std::move(burstContext)), + mMemoryCache(std::move(memoryCache)), + kDeathHandler(std::move(deathHandler)) {} + +ExecutionBurstController::OptionalCacheHold ExecutionBurstController::cacheMemory( + const nn::SharedMemory& memory) const { + auto [slot, hold] = mMemoryCache->cacheMemory(memory); + return hold; } -static std::tuple, V1_2::Timing, bool> getExecutionResult( - V1_0::ErrorStatus status, std::vector outputShapes, V1_2::Timing timing, - bool fallback) { - auto [n, checkedOutputShapes, checkedTiming] = - getExecutionResult(convertToV1_3(status), std::move(outputShapes), timing); - return {n, convertToV1_2(checkedOutputShapes), convertToV1_2(checkedTiming), fallback}; -} +nn::ExecutionResult, nn::Timing>> +ExecutionBurstController::execute(const nn::Request& request, nn::MeasureTiming measure) const { + // This is the first point when we know an execution is occurring, so begin to collect + // systraces. Note that the first point we can begin collecting systraces in + // ExecutionBurstServer is when the RequestChannelReceiver realizes there is data in the FMQ, so + // ExecutionBurstServer collects systraces at different points in the code. + NNTRACE_FULL(NNTRACE_LAYER_IPC, NNTRACE_PHASE_EXECUTION, "ExecutionBurstController::execute"); + + // if the request is valid but of a higher version than what's supported in burst execution, + // fall back to another execution path + if (const auto version = NN_TRY(hal::utils::makeExecutionFailure(nn::validate(request))); + version > nn::Version::ANDROID_Q) { + // fallback to another execution path if the packet could not be sent + if (kFallback) { + return kFallback(request, measure); + } + return NN_ERROR() << "Request object has features not supported by IBurst::execute"; + } -std::tuple, V1_2::Timing, bool> -ExecutionBurstController::compute(const V1_0::Request& request, V1_2::MeasureTiming measure, - const std::vector& memoryIds) { - // This is the first point when we know an execution is occurring, so begin - // to collect systraces. Note that the first point we can begin collecting - // systraces in ExecutionBurstServer is when the RequestChannelReceiver - // realizes there is data in the FMQ, so ExecutionBurstServer collects - // systraces at different points in the code. - NNTRACE_FULL(NNTRACE_LAYER_IPC, NNTRACE_PHASE_EXECUTION, "ExecutionBurstController::compute"); + // clear pools field of request, as they will be provided via slots + const auto requestWithoutPools = + nn::Request{.inputs = request.inputs, .outputs = request.outputs, .pools = {}}; + auto hidlRequest = NN_TRY( + hal::utils::makeExecutionFailure(V1_0::utils::unvalidatedConvert(requestWithoutPools))); + const auto hidlMeasure = NN_TRY(hal::utils::makeExecutionFailure(convert(measure))); + + // Ensure that at most one execution is in flight at any given time. + const bool alreadyInFlight = mExecutionInFlight.test_and_set(); + if (alreadyInFlight) { + return NN_ERROR() << "IBurst already has an execution in flight"; + } + const auto guard = base::make_scope_guard([this] { mExecutionInFlight.clear(); }); - std::lock_guard guard(mMutex); + std::vector slots; + std::vector holds; + slots.reserve(request.pools.size()); + holds.reserve(request.pools.size()); + for (const auto& memoryPool : request.pools) { + auto [slot, hold] = mMemoryCache->cacheMemory(std::get(memoryPool)); + slots.push_back(slot); + holds.push_back(std::move(hold)); + } // send request packet - const std::vector slots = mMemoryCache->getSlots(request.pools, memoryIds); - const bool success = mRequestChannelSender->send(request, measure, slots); - if (!success) { - LOG(ERROR) << "Error sending FMQ packet"; - // only use fallback execution path if the packet could not be sent - return getExecutionResult(V1_0::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming12, - /*fallback=*/true); + const auto sendStatus = mRequestChannelSender->send(hidlRequest, hidlMeasure, slots); + if (!sendStatus.ok()) { + // fallback to another execution path if the packet could not be sent + if (kFallback) { + return kFallback(request, measure); + } + return NN_ERROR() << "Error sending FMQ packet: " << sendStatus.error(); } // get result packet - const auto result = mResultChannelReceiver->getBlocking(); - if (!result) { - LOG(ERROR) << "Error retrieving FMQ packet"; - // only use fallback execution path if the packet could not be sent - return getExecutionResult(V1_0::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming12, - /*fallback=*/false); - } - - // unpack results and return (only use fallback execution path if the - // packet could not be sent) - auto [status, outputShapes, timing] = std::move(*result); - return getExecutionResult(status, std::move(outputShapes), timing, /*fallback=*/false); -} - -void ExecutionBurstController::freeMemory(intptr_t key) { - std::lock_guard guard(mMutex); - - bool valid; - int32_t slot; - std::tie(valid, slot) = mMemoryCache->freeMemory(key); - if (valid) { - mBurstContext->freeMemory(slot).isOk(); - } + const auto [status, outputShapes, timing] = + NN_TRY(hal::utils::makeExecutionFailure(mResultChannelReceiver->getBlocking())); + return executionCallback(status, outputShapes, timing); } -} // namespace android::nn +} // namespace android::hardware::neuralnetworks::V1_2::utils diff --git a/neuralnetworks/1.2/utils/src/ExecutionBurstServer.cpp b/neuralnetworks/1.2/utils/src/ExecutionBurstServer.cpp index 022548dcd4..50af881d23 100644 --- a/neuralnetworks/1.2/utils/src/ExecutionBurstServer.cpp +++ b/neuralnetworks/1.2/utils/src/ExecutionBurstServer.cpp @@ -17,8 +17,19 @@ #define LOG_TAG "ExecutionBurstServer" #include "ExecutionBurstServer.h" +#include "Conversions.h" +#include "ExecutionBurstUtils.h" #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -29,134 +40,146 @@ #include #include -#include "ExecutionBurstUtils.h" -#include "HalInterfaces.h" #include "Tracing.h" -namespace android::nn { +namespace android::hardware::neuralnetworks::V1_2::utils { namespace { -// DefaultBurstExecutorWithCache adapts an IPreparedModel so that it can be -// used as an IBurstExecutorWithCache. Specifically, the cache simply stores the -// hidl_memory object, and the execution forwards calls to the provided -// IPreparedModel's "executeSynchronously" method. With this class, hidl_memory -// must be mapped and unmapped for each execution. -class DefaultBurstExecutorWithCache : public ExecutionBurstServer::IBurstExecutorWithCache { - public: - DefaultBurstExecutorWithCache(V1_2::IPreparedModel* preparedModel) - : mpPreparedModel(preparedModel) {} - - bool isCacheEntryPresent(int32_t slot) const override { - const auto it = mMemoryCache.find(slot); - return (it != mMemoryCache.end()) && it->second.valid(); +using neuralnetworks::utils::makeExecutionFailure; + +constexpr V1_2::Timing kNoTiming = {std::numeric_limits::max(), + std::numeric_limits::max()}; + +nn::GeneralResult> getMemoriesCallback( + V1_0::ErrorStatus status, const hidl_vec& memories) { + HANDLE_HAL_STATUS(status) << "getting burst memories failed with " << toString(status); + std::vector canonicalMemories; + canonicalMemories.reserve(memories.size()); + for (const auto& memory : memories) { + canonicalMemories.push_back(NN_TRY(nn::convert(memory))); } + return canonicalMemories; +} + +} // anonymous namespace + +ExecutionBurstServer::MemoryCache::MemoryCache(nn::SharedBurst burstExecutor, + sp burstCallback) + : kBurstExecutor(std::move(burstExecutor)), kBurstCallback(std::move(burstCallback)) { + CHECK(kBurstExecutor != nullptr); + CHECK(kBurstCallback != nullptr); +} + +nn::GeneralResult>> +ExecutionBurstServer::MemoryCache::getCacheEntries(const std::vector& slots) { + std::lock_guard guard(mMutex); + NN_TRY(ensureCacheEntriesArePresentLocked(slots)); - void addCacheEntry(const hardware::hidl_memory& memory, int32_t slot) override { - mMemoryCache[slot] = memory; + std::vector> results; + results.reserve(slots.size()); + for (int32_t slot : slots) { + results.push_back(NN_TRY(getCacheEntryLocked(slot))); } - void removeCacheEntry(int32_t slot) override { mMemoryCache.erase(slot); } - - std::tuple, V1_2::Timing> execute( - const V1_0::Request& request, const std::vector& slots, - V1_2::MeasureTiming measure) override { - // convert slots to pools - hardware::hidl_vec pools(slots.size()); - std::transform(slots.begin(), slots.end(), pools.begin(), - [this](int32_t slot) { return mMemoryCache[slot]; }); - - // create full request - V1_0::Request fullRequest = request; - fullRequest.pools = std::move(pools); - - // setup execution - V1_0::ErrorStatus returnedStatus = V1_0::ErrorStatus::GENERAL_FAILURE; - hardware::hidl_vec returnedOutputShapes; - V1_2::Timing returnedTiming; - auto cb = [&returnedStatus, &returnedOutputShapes, &returnedTiming]( - V1_0::ErrorStatus status, - const hardware::hidl_vec& outputShapes, - const V1_2::Timing& timing) { - returnedStatus = status; - returnedOutputShapes = outputShapes; - returnedTiming = timing; - }; - - // execute - const hardware::Return ret = - mpPreparedModel->executeSynchronously(fullRequest, measure, cb); - if (!ret.isOk() || returnedStatus != V1_0::ErrorStatus::NONE) { - LOG(ERROR) << "IPreparedModelAdapter::execute -- Error executing"; - return {returnedStatus, std::move(returnedOutputShapes), kNoTiming}; - } + return results; +} + +nn::GeneralResult ExecutionBurstServer::MemoryCache::ensureCacheEntriesArePresentLocked( + const std::vector& slots) { + const auto slotIsKnown = [this](int32_t slot) + REQUIRES(mMutex) { return mCache.count(slot) > 0; }; + + // find unique unknown slots + std::vector unknownSlots = slots; + std::sort(unknownSlots.begin(), unknownSlots.end()); + auto unknownSlotsEnd = std::unique(unknownSlots.begin(), unknownSlots.end()); + unknownSlotsEnd = std::remove_if(unknownSlots.begin(), unknownSlotsEnd, slotIsKnown); + unknownSlots.erase(unknownSlotsEnd, unknownSlots.end()); - return std::make_tuple(returnedStatus, std::move(returnedOutputShapes), returnedTiming); + // quick-exit if all slots are known + if (unknownSlots.empty()) { + return {}; } - private: - V1_2::IPreparedModel* const mpPreparedModel; - std::map mMemoryCache; -}; + auto cb = neuralnetworks::utils::CallbackValue(getMemoriesCallback); -} // anonymous namespace + const auto ret = kBurstCallback->getMemories(unknownSlots, cb); + HANDLE_TRANSPORT_FAILURE(ret); -// ExecutionBurstServer methods + auto returnedMemories = NN_TRY(cb.take()); -sp ExecutionBurstServer::create( - const sp& callback, const MQDescriptorSync& requestChannel, - const MQDescriptorSync& resultChannel, - std::shared_ptr executorWithCache, - std::chrono::microseconds pollingTimeWindow) { - // check inputs - if (callback == nullptr || executorWithCache == nullptr) { - LOG(ERROR) << "ExecutionBurstServer::create passed a nullptr"; - return nullptr; + if (returnedMemories.size() != unknownSlots.size()) { + return NN_ERROR() + << "ExecutionBurstServer::MemoryCache::ensureCacheEntriesArePresentLocked: Error " + "retrieving memories -- count mismatch between requested memories (" + << unknownSlots.size() << ") and returned memories (" << returnedMemories.size() + << ")"; } - // create FMQ objects - std::unique_ptr requestChannelReceiver = - RequestChannelReceiver::create(requestChannel, pollingTimeWindow); - std::unique_ptr resultChannelSender = - ResultChannelSender::create(resultChannel); + // add memories to unknown slots + for (size_t i = 0; i < unknownSlots.size(); ++i) { + addCacheEntryLocked(unknownSlots[i], std::move(returnedMemories[i])); + } - // check FMQ objects - if (!requestChannelReceiver || !resultChannelSender) { - LOG(ERROR) << "ExecutionBurstServer::create failed to create FastMessageQueue"; - return nullptr; + return {}; +} + +nn::GeneralResult> +ExecutionBurstServer::MemoryCache::getCacheEntryLocked(int32_t slot) { + if (const auto iter = mCache.find(slot); iter != mCache.end()) { + return iter->second; } + return NN_ERROR() + << "ExecutionBurstServer::MemoryCache::getCacheEntryLocked failed because slot " << slot + << " is not present in the cache"; +} - // make and return context - return new ExecutionBurstServer(callback, std::move(requestChannelReceiver), - std::move(resultChannelSender), std::move(executorWithCache)); +void ExecutionBurstServer::MemoryCache::addCacheEntryLocked(int32_t slot, nn::SharedMemory memory) { + auto hold = kBurstExecutor->cacheMemory(memory); + mCache.emplace(slot, std::make_pair(std::move(memory), std::move(hold))); +} + +void ExecutionBurstServer::MemoryCache::removeCacheEntry(int32_t slot) { + std::lock_guard guard(mMutex); + mCache.erase(slot); } -sp ExecutionBurstServer::create( +// ExecutionBurstServer methods + +nn::GeneralResult> ExecutionBurstServer::create( const sp& callback, const MQDescriptorSync& requestChannel, - const MQDescriptorSync& resultChannel, V1_2::IPreparedModel* preparedModel, + const MQDescriptorSync& resultChannel, nn::SharedBurst burstExecutor, std::chrono::microseconds pollingTimeWindow) { - // check relevant input - if (preparedModel == nullptr) { - LOG(ERROR) << "ExecutionBurstServer::create passed a nullptr"; - return nullptr; + // check inputs + if (callback == nullptr || burstExecutor == nullptr) { + return NN_ERROR() << "ExecutionBurstServer::create passed a nullptr"; } - // adapt IPreparedModel to have caching - const std::shared_ptr preparedModelAdapter = - std::make_shared(preparedModel); + // create FMQ objects + auto requestChannelReceiver = + NN_TRY(RequestChannelReceiver::create(requestChannel, pollingTimeWindow)); + auto resultChannelSender = NN_TRY(ResultChannelSender::create(resultChannel)); + + // check FMQ objects + CHECK(requestChannelReceiver != nullptr); + CHECK(resultChannelSender != nullptr); // make and return context - return ExecutionBurstServer::create(callback, requestChannel, resultChannel, - preparedModelAdapter, pollingTimeWindow); + return sp::make(PrivateConstructorTag{}, callback, + std::move(requestChannelReceiver), + std::move(resultChannelSender), std::move(burstExecutor)); } -ExecutionBurstServer::ExecutionBurstServer( - const sp& callback, std::unique_ptr requestChannel, - std::unique_ptr resultChannel, - std::shared_ptr executorWithCache) +ExecutionBurstServer::ExecutionBurstServer(PrivateConstructorTag /*tag*/, + const sp& callback, + std::unique_ptr requestChannel, + std::unique_ptr resultChannel, + nn::SharedBurst burstExecutor) : mCallback(callback), mRequestChannelReceiver(std::move(requestChannel)), mResultChannelSender(std::move(resultChannel)), - mExecutorWithCache(std::move(executorWithCache)) { + mBurstExecutor(std::move(burstExecutor)), + mMemoryCache(mBurstExecutor, mCallback) { // TODO: highly document the threading behavior of this class mWorker = std::thread([this] { task(); }); } @@ -170,51 +193,9 @@ ExecutionBurstServer::~ExecutionBurstServer() { mWorker.join(); } -hardware::Return ExecutionBurstServer::freeMemory(int32_t slot) { - std::lock_guard hold(mMutex); - mExecutorWithCache->removeCacheEntry(slot); - return hardware::Void(); -} - -void ExecutionBurstServer::ensureCacheEntriesArePresentLocked(const std::vector& slots) { - const auto slotIsKnown = [this](int32_t slot) { - return mExecutorWithCache->isCacheEntryPresent(slot); - }; - - // find unique unknown slots - std::vector unknownSlots = slots; - auto unknownSlotsEnd = unknownSlots.end(); - std::sort(unknownSlots.begin(), unknownSlotsEnd); - unknownSlotsEnd = std::unique(unknownSlots.begin(), unknownSlotsEnd); - unknownSlotsEnd = std::remove_if(unknownSlots.begin(), unknownSlotsEnd, slotIsKnown); - unknownSlots.erase(unknownSlotsEnd, unknownSlots.end()); - - // quick-exit if all slots are known - if (unknownSlots.empty()) { - return; - } - - V1_0::ErrorStatus errorStatus = V1_0::ErrorStatus::GENERAL_FAILURE; - std::vector returnedMemories; - auto cb = [&errorStatus, &returnedMemories]( - V1_0::ErrorStatus status, - const hardware::hidl_vec& memories) { - errorStatus = status; - returnedMemories = memories; - }; - - const hardware::Return ret = mCallback->getMemories(unknownSlots, cb); - - if (!ret.isOk() || errorStatus != V1_0::ErrorStatus::NONE || - returnedMemories.size() != unknownSlots.size()) { - LOG(ERROR) << "Error retrieving memories"; - return; - } - - // add memories to unknown slots - for (size_t i = 0; i < unknownSlots.size(); ++i) { - mExecutorWithCache->addCacheEntry(returnedMemories[i], unknownSlots[i]); - } +Return ExecutionBurstServer::freeMemory(int32_t slot) { + mMemoryCache.removeCacheEntry(slot); + return Void(); } void ExecutionBurstServer::task() { @@ -223,38 +204,65 @@ void ExecutionBurstServer::task() { // receive request auto arguments = mRequestChannelReceiver->getBlocking(); - // if the request packet was not properly received, return a generic - // error and skip the execution + // if the request packet was not properly received, return a generic error and skip the + // execution // - // if the burst is being torn down, skip the execution so the "task" - // function can end - if (!arguments) { + // if the burst is being torn down, skip the execution so the "task" function can end + if (!arguments.has_value()) { if (!mTeardown) { mResultChannelSender->send(V1_0::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming); } continue; } - // otherwise begin tracing execution - NNTRACE_FULL(NNTRACE_LAYER_IPC, NNTRACE_PHASE_EXECUTION, - "ExecutionBurstServer getting memory, executing, and returning results"); - - // unpack the arguments; types are Request, std::vector, and - // MeasureTiming, respectively - const auto [requestWithoutPools, slotsOfPools, measure] = std::move(*arguments); + // unpack the arguments; types are Request, std::vector, and MeasureTiming, + // respectively + const auto [requestWithoutPools, slotsOfPools, measure] = std::move(arguments).value(); - // ensure executor with cache has required memory - std::lock_guard hold(mMutex); - ensureCacheEntriesArePresentLocked(slotsOfPools); - - // perform computation; types are ErrorStatus, hidl_vec, - // and Timing, respectively - const auto [errorStatus, outputShapes, returnedTiming] = - mExecutorWithCache->execute(requestWithoutPools, slotsOfPools, measure); + auto result = execute(requestWithoutPools, slotsOfPools, measure); // return result - mResultChannelSender->send(errorStatus, outputShapes, returnedTiming); + if (result.has_value()) { + const auto& [outputShapes, timing] = result.value(); + mResultChannelSender->send(V1_0::ErrorStatus::NONE, outputShapes, timing); + } else { + const auto& [message, code, outputShapes] = result.error(); + LOG(ERROR) << "IBurst::execute failed with " << code << ": " << message; + mResultChannelSender->send(convert(code).value(), convert(outputShapes).value(), + kNoTiming); + } } } -} // namespace android::nn +nn::ExecutionResult, Timing>> ExecutionBurstServer::execute( + const V1_0::Request& requestWithoutPools, const std::vector& slotsOfPools, + MeasureTiming measure) { + NNTRACE_FULL(NNTRACE_LAYER_IPC, NNTRACE_PHASE_EXECUTION, + "ExecutionBurstServer getting memory, executing, and returning results"); + + // ensure executor with cache has required memory + const auto cacheEntries = + NN_TRY(makeExecutionFailure(mMemoryCache.getCacheEntries(slotsOfPools))); + + // convert request, populating its pools + // This code performs an unvalidated convert because the request object without its pools is + // invalid because it is incomplete. Instead, the validation is performed after the memory pools + // have been added to the request. + auto canonicalRequest = + NN_TRY(makeExecutionFailure(nn::unvalidatedConvert(requestWithoutPools))); + CHECK(canonicalRequest.pools.empty()); + std::transform(cacheEntries.begin(), cacheEntries.end(), + std::back_inserter(canonicalRequest.pools), + [](const auto& cacheEntry) { return cacheEntry.first; }); + NN_TRY(makeExecutionFailure(validate(canonicalRequest))); + + nn::MeasureTiming canonicalMeasure = NN_TRY(makeExecutionFailure(nn::convert(measure))); + + const auto [outputShapes, timing] = + NN_TRY(mBurstExecutor->execute(canonicalRequest, canonicalMeasure)); + + return std::make_pair(NN_TRY(makeExecutionFailure(convert(outputShapes))), + NN_TRY(makeExecutionFailure(convert(timing)))); +} + +} // namespace android::hardware::neuralnetworks::V1_2::utils diff --git a/neuralnetworks/1.2/utils/src/ExecutionBurstUtils.cpp b/neuralnetworks/1.2/utils/src/ExecutionBurstUtils.cpp index f0275f933a..ca3a52c17b 100644 --- a/neuralnetworks/1.2/utils/src/ExecutionBurstUtils.cpp +++ b/neuralnetworks/1.2/utils/src/ExecutionBurstUtils.cpp @@ -19,11 +19,15 @@ #include "ExecutionBurstUtils.h" #include +#include #include #include #include #include #include +#include +#include +#include #include #include @@ -39,84 +43,97 @@ namespace { constexpr V1_2::Timing kNoTiming = {std::numeric_limits::max(), std::numeric_limits::max()}; +std::chrono::microseconds getPollingTimeWindow(const std::string& property) { + constexpr int32_t kDefaultPollingTimeWindow = 0; +#ifdef NN_DEBUGGABLE + constexpr int32_t kMinPollingTimeWindow = 0; + const int32_t selectedPollingTimeWindow = + base::GetIntProperty(property, kDefaultPollingTimeWindow, kMinPollingTimeWindow); + return std::chrono::microseconds(selectedPollingTimeWindow); +#else + (void)property; + return std::chrono::microseconds(kDefaultPollingTimeWindow); +#endif // NN_DEBUGGABLE +} + +} // namespace + +std::chrono::microseconds getBurstControllerPollingTimeWindow() { + return getPollingTimeWindow("debug.nn.burst-controller-polling-window"); +} + +std::chrono::microseconds getBurstServerPollingTimeWindow() { + return getPollingTimeWindow("debug.nn.burst-server-polling-window"); } // serialize a request into a packet std::vector serialize(const V1_0::Request& request, V1_2::MeasureTiming measure, const std::vector& slots) { // count how many elements need to be sent for a request - size_t count = 2 + request.inputs.size() + request.outputs.size() + request.pools.size(); + size_t count = 2 + request.inputs.size() + request.outputs.size() + slots.size(); for (const auto& input : request.inputs) { count += input.dimensions.size(); } for (const auto& output : request.outputs) { count += output.dimensions.size(); } + CHECK_LE(count, std::numeric_limits::max()); // create buffer to temporarily store elements std::vector data; data.reserve(count); // package packetInfo - { - FmqRequestDatum datum; - datum.packetInformation( - {/*.packetSize=*/static_cast(count), - /*.numberOfInputOperands=*/static_cast(request.inputs.size()), - /*.numberOfOutputOperands=*/static_cast(request.outputs.size()), - /*.numberOfPools=*/static_cast(request.pools.size())}); - data.push_back(datum); - } + data.emplace_back(); + data.back().packetInformation( + {.packetSize = static_cast(count), + .numberOfInputOperands = static_cast(request.inputs.size()), + .numberOfOutputOperands = static_cast(request.outputs.size()), + .numberOfPools = static_cast(slots.size())}); // package input data for (const auto& input : request.inputs) { // package operand information - FmqRequestDatum datum; - datum.inputOperandInformation( - {/*.hasNoValue=*/input.hasNoValue, - /*.location=*/input.location, - /*.numberOfDimensions=*/static_cast(input.dimensions.size())}); - data.push_back(datum); + data.emplace_back(); + data.back().inputOperandInformation( + {.hasNoValue = input.hasNoValue, + .location = input.location, + .numberOfDimensions = static_cast(input.dimensions.size())}); // package operand dimensions for (uint32_t dimension : input.dimensions) { - FmqRequestDatum datum; - datum.inputOperandDimensionValue(dimension); - data.push_back(datum); + data.emplace_back(); + data.back().inputOperandDimensionValue(dimension); } } // package output data for (const auto& output : request.outputs) { // package operand information - FmqRequestDatum datum; - datum.outputOperandInformation( - {/*.hasNoValue=*/output.hasNoValue, - /*.location=*/output.location, - /*.numberOfDimensions=*/static_cast(output.dimensions.size())}); - data.push_back(datum); + data.emplace_back(); + data.back().outputOperandInformation( + {.hasNoValue = output.hasNoValue, + .location = output.location, + .numberOfDimensions = static_cast(output.dimensions.size())}); // package operand dimensions for (uint32_t dimension : output.dimensions) { - FmqRequestDatum datum; - datum.outputOperandDimensionValue(dimension); - data.push_back(datum); + data.emplace_back(); + data.back().outputOperandDimensionValue(dimension); } } // package pool identifier for (int32_t slot : slots) { - FmqRequestDatum datum; - datum.poolIdentifier(slot); - data.push_back(datum); + data.emplace_back(); + data.back().poolIdentifier(slot); } // package measureTiming - { - FmqRequestDatum datum; - datum.measureTiming(measure); - data.push_back(datum); - } + data.emplace_back(); + data.back().measureTiming(measure); + + CHECK_EQ(data.size(), count); // return packet return data; @@ -137,46 +154,38 @@ std::vector serialize(V1_0::ErrorStatus errorStatus, data.reserve(count); // package packetInfo - { - FmqResultDatum datum; - datum.packetInformation({/*.packetSize=*/static_cast(count), - /*.errorStatus=*/errorStatus, - /*.numberOfOperands=*/static_cast(outputShapes.size())}); - data.push_back(datum); - } + data.emplace_back(); + data.back().packetInformation({.packetSize = static_cast(count), + .errorStatus = errorStatus, + .numberOfOperands = static_cast(outputShapes.size())}); // package output shape data for (const auto& operand : outputShapes) { // package operand information - FmqResultDatum::OperandInformation info{}; - info.isSufficient = operand.isSufficient; - info.numberOfDimensions = static_cast(operand.dimensions.size()); - - FmqResultDatum datum; - datum.operandInformation(info); - data.push_back(datum); + data.emplace_back(); + data.back().operandInformation( + {.isSufficient = operand.isSufficient, + .numberOfDimensions = static_cast(operand.dimensions.size())}); // package operand dimensions for (uint32_t dimension : operand.dimensions) { - FmqResultDatum datum; - datum.operandDimensionValue(dimension); - data.push_back(datum); + data.emplace_back(); + data.back().operandDimensionValue(dimension); } } // package executionTiming - { - FmqResultDatum datum; - datum.executionTiming(timing); - data.push_back(datum); - } + data.emplace_back(); + data.back().executionTiming(timing); + + CHECK_EQ(data.size(), count); // return result return data; } // deserialize request -std::optional, V1_2::MeasureTiming>> deserialize( +nn::Result, V1_2::MeasureTiming>> deserialize( const std::vector& data) { using discriminator = FmqRequestDatum::hidl_discriminator; @@ -184,8 +193,7 @@ std::optional, V1_2::MeasureTimin // validate packet information if (data.size() == 0 || data[index].getDiscriminator() != discriminator::packetInformation) { - LOG(ERROR) << "FMQ Request packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Request packet ill-formed"; } // unpackage packet information @@ -198,8 +206,7 @@ std::optional, V1_2::MeasureTimin // verify packet size if (data.size() != packetSize) { - LOG(ERROR) << "FMQ Request packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Request packet ill-formed"; } // unpackage input operands @@ -208,8 +215,7 @@ std::optional, V1_2::MeasureTimin for (size_t operand = 0; operand < numberOfInputOperands; ++operand) { // validate input operand information if (data[index].getDiscriminator() != discriminator::inputOperandInformation) { - LOG(ERROR) << "FMQ Request packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Request packet ill-formed"; } // unpackage operand information @@ -226,8 +232,7 @@ std::optional, V1_2::MeasureTimin for (size_t i = 0; i < numberOfDimensions; ++i) { // validate dimension if (data[index].getDiscriminator() != discriminator::inputOperandDimensionValue) { - LOG(ERROR) << "FMQ Request packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Request packet ill-formed"; } // unpackage dimension @@ -240,7 +245,7 @@ std::optional, V1_2::MeasureTimin // store result inputs.push_back( - {/*.hasNoValue=*/hasNoValue, /*.location=*/location, /*.dimensions=*/dimensions}); + {.hasNoValue = hasNoValue, .location = location, .dimensions = dimensions}); } // unpackage output operands @@ -249,8 +254,7 @@ std::optional, V1_2::MeasureTimin for (size_t operand = 0; operand < numberOfOutputOperands; ++operand) { // validate output operand information if (data[index].getDiscriminator() != discriminator::outputOperandInformation) { - LOG(ERROR) << "FMQ Request packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Request packet ill-formed"; } // unpackage operand information @@ -267,8 +271,7 @@ std::optional, V1_2::MeasureTimin for (size_t i = 0; i < numberOfDimensions; ++i) { // validate dimension if (data[index].getDiscriminator() != discriminator::outputOperandDimensionValue) { - LOG(ERROR) << "FMQ Request packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Request packet ill-formed"; } // unpackage dimension @@ -281,7 +284,7 @@ std::optional, V1_2::MeasureTimin // store result outputs.push_back( - {/*.hasNoValue=*/hasNoValue, /*.location=*/location, /*.dimensions=*/dimensions}); + {.hasNoValue = hasNoValue, .location = location, .dimensions = dimensions}); } // unpackage pools @@ -290,8 +293,7 @@ std::optional, V1_2::MeasureTimin for (size_t pool = 0; pool < numberOfPools; ++pool) { // validate input operand information if (data[index].getDiscriminator() != discriminator::poolIdentifier) { - LOG(ERROR) << "FMQ Request packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Request packet ill-formed"; } // unpackage operand information @@ -304,8 +306,7 @@ std::optional, V1_2::MeasureTimin // validate measureTiming if (data[index].getDiscriminator() != discriminator::measureTiming) { - LOG(ERROR) << "FMQ Request packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Request packet ill-formed"; } // unpackage measureTiming @@ -314,27 +315,23 @@ std::optional, V1_2::MeasureTimin // validate packet information if (index != packetSize) { - LOG(ERROR) << "FMQ Result packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Result packet ill-formed"; } // return request - V1_0::Request request = {/*.inputs=*/inputs, /*.outputs=*/outputs, /*.pools=*/{}}; + V1_0::Request request = {.inputs = inputs, .outputs = outputs, .pools = {}}; return std::make_tuple(std::move(request), std::move(slots), measure); } // deserialize a packet into the result -std::optional, V1_2::Timing>> -deserialize(const std::vector& data) { +nn::Result, V1_2::Timing>> deserialize( + const std::vector& data) { using discriminator = FmqResultDatum::hidl_discriminator; - - std::vector outputShapes; size_t index = 0; // validate packet information if (data.size() == 0 || data[index].getDiscriminator() != discriminator::packetInformation) { - LOG(ERROR) << "FMQ Result packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Result packet ill-formed"; } // unpackage packet information @@ -346,16 +343,16 @@ deserialize(const std::vector& data) { // verify packet size if (data.size() != packetSize) { - LOG(ERROR) << "FMQ Result packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Result packet ill-formed"; } // unpackage operands + std::vector outputShapes; + outputShapes.reserve(numberOfOperands); for (size_t operand = 0; operand < numberOfOperands; ++operand) { // validate operand information if (data[index].getDiscriminator() != discriminator::operandInformation) { - LOG(ERROR) << "FMQ Result packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Result packet ill-formed"; } // unpackage operand information @@ -370,8 +367,7 @@ deserialize(const std::vector& data) { for (size_t i = 0; i < numberOfDimensions; ++i) { // validate dimension if (data[index].getDiscriminator() != discriminator::operandDimensionValue) { - LOG(ERROR) << "FMQ Result packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Result packet ill-formed"; } // unpackage dimension @@ -383,13 +379,12 @@ deserialize(const std::vector& data) { } // store result - outputShapes.push_back({/*.dimensions=*/dimensions, /*.isSufficient=*/isSufficient}); + outputShapes.push_back({.dimensions = dimensions, .isSufficient = isSufficient}); } // validate execution timing if (data[index].getDiscriminator() != discriminator::executionTiming) { - LOG(ERROR) << "FMQ Result packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Result packet ill-formed"; } // unpackage execution timing @@ -398,123 +393,113 @@ deserialize(const std::vector& data) { // validate packet information if (index != packetSize) { - LOG(ERROR) << "FMQ Result packet ill-formed"; - return std::nullopt; + return NN_ERROR() << "FMQ Result packet ill-formed"; } // return result return std::make_tuple(errorStatus, std::move(outputShapes), timing); } -V1_0::ErrorStatus legacyConvertResultCodeToErrorStatus(int resultCode) { - return convertToV1_0(convertResultCodeToErrorStatus(resultCode)); -} - // RequestChannelSender methods -std::pair, const FmqRequestDescriptor*> +nn::GeneralResult< + std::pair, const MQDescriptorSync*>> RequestChannelSender::create(size_t channelLength) { - std::unique_ptr fmqRequestChannel = - std::make_unique(channelLength, /*confEventFlag=*/true); - if (!fmqRequestChannel->isValid()) { - LOG(ERROR) << "Unable to create RequestChannelSender"; - return {nullptr, nullptr}; + auto requestChannelSender = + std::make_unique(PrivateConstructorTag{}, channelLength); + if (!requestChannelSender->mFmqRequestChannel.isValid()) { + return NN_ERROR() << "Unable to create RequestChannelSender"; } - const FmqRequestDescriptor* descriptor = fmqRequestChannel->getDesc(); - return std::make_pair(std::make_unique(std::move(fmqRequestChannel)), - descriptor); + const MQDescriptorSync* descriptor = + requestChannelSender->mFmqRequestChannel.getDesc(); + return std::make_pair(std::move(requestChannelSender), descriptor); } -RequestChannelSender::RequestChannelSender(std::unique_ptr fmqRequestChannel) - : mFmqRequestChannel(std::move(fmqRequestChannel)) {} +RequestChannelSender::RequestChannelSender(PrivateConstructorTag /*tag*/, size_t channelLength) + : mFmqRequestChannel(channelLength, /*configureEventFlagWord=*/true) {} -bool RequestChannelSender::send(const V1_0::Request& request, V1_2::MeasureTiming measure, - const std::vector& slots) { +nn::Result RequestChannelSender::send(const V1_0::Request& request, + V1_2::MeasureTiming measure, + const std::vector& slots) { const std::vector serialized = serialize(request, measure, slots); return sendPacket(serialized); } -bool RequestChannelSender::sendPacket(const std::vector& packet) { +nn::Result RequestChannelSender::sendPacket(const std::vector& packet) { if (!mValid) { - return false; + return NN_ERROR() << "FMQ object is invalid"; } - if (packet.size() > mFmqRequestChannel->availableToWrite()) { - LOG(ERROR) - << "RequestChannelSender::sendPacket -- packet size exceeds size available in FMQ"; - return false; + if (packet.size() > mFmqRequestChannel.availableToWrite()) { + return NN_ERROR() + << "RequestChannelSender::sendPacket -- packet size exceeds size available in FMQ"; + } + + // Always send the packet with "blocking" because this signals the futex and unblocks the + // consumer if it is waiting on the futex. + const bool success = mFmqRequestChannel.writeBlocking(packet.data(), packet.size()); + if (!success) { + return NN_ERROR() + << "RequestChannelSender::sendPacket -- FMQ's writeBlocking returned an error"; } - // Always send the packet with "blocking" because this signals the futex and - // unblocks the consumer if it is waiting on the futex. - return mFmqRequestChannel->writeBlocking(packet.data(), packet.size()); + return {}; } -void RequestChannelSender::invalidate() { +void RequestChannelSender::notifyAsDeadObject() { mValid = false; } // RequestChannelReceiver methods -std::unique_ptr RequestChannelReceiver::create( - const FmqRequestDescriptor& requestChannel, std::chrono::microseconds pollingTimeWindow) { - std::unique_ptr fmqRequestChannel = - std::make_unique(requestChannel); +nn::GeneralResult> RequestChannelReceiver::create( + const MQDescriptorSync& requestChannel, + std::chrono::microseconds pollingTimeWindow) { + auto requestChannelReceiver = std::make_unique( + PrivateConstructorTag{}, requestChannel, pollingTimeWindow); - if (!fmqRequestChannel->isValid()) { - LOG(ERROR) << "Unable to create RequestChannelReceiver"; - return nullptr; + if (!requestChannelReceiver->mFmqRequestChannel.isValid()) { + return NN_ERROR() << "Unable to create RequestChannelReceiver"; } - if (fmqRequestChannel->getEventFlagWord() == nullptr) { - LOG(ERROR) - << "RequestChannelReceiver::create was passed an MQDescriptor without an EventFlag"; - return nullptr; + if (requestChannelReceiver->mFmqRequestChannel.getEventFlagWord() == nullptr) { + return NN_ERROR() + << "RequestChannelReceiver::create was passed an MQDescriptor without an EventFlag"; } - return std::make_unique(std::move(fmqRequestChannel), - pollingTimeWindow); + return requestChannelReceiver; } -RequestChannelReceiver::RequestChannelReceiver(std::unique_ptr fmqRequestChannel, - std::chrono::microseconds pollingTimeWindow) - : mFmqRequestChannel(std::move(fmqRequestChannel)), kPollingTimeWindow(pollingTimeWindow) {} +RequestChannelReceiver::RequestChannelReceiver( + PrivateConstructorTag /*tag*/, const MQDescriptorSync& requestChannel, + std::chrono::microseconds pollingTimeWindow) + : mFmqRequestChannel(requestChannel), kPollingTimeWindow(pollingTimeWindow) {} -std::optional, V1_2::MeasureTiming>> +nn::Result, V1_2::MeasureTiming>> RequestChannelReceiver::getBlocking() { - const auto packet = getPacketBlocking(); - if (!packet) { - return std::nullopt; - } - - return deserialize(*packet); + const auto packet = NN_TRY(getPacketBlocking()); + return deserialize(packet); } void RequestChannelReceiver::invalidate() { mTeardown = true; // force unblock - // ExecutionBurstServer is by default waiting on a request packet. If the - // client process destroys its burst object, the server may still be waiting - // on the futex. This force unblock wakes up any thread waiting on the - // futex. - // TODO: look for a different/better way to signal/notify the futex to wake - // up any thread waiting on it - FmqRequestDatum datum; - datum.packetInformation({/*.packetSize=*/0, /*.numberOfInputOperands=*/0, - /*.numberOfOutputOperands=*/0, /*.numberOfPools=*/0}); - mFmqRequestChannel->writeBlocking(&datum, 1); + // ExecutionBurstServer is by default waiting on a request packet. If the client process + // destroys its burst object, the server may still be waiting on the futex. This force unblock + // wakes up any thread waiting on the futex. + const auto data = serialize(V1_0::Request{}, V1_2::MeasureTiming::NO, {}); + mFmqRequestChannel.writeBlocking(data.data(), data.size()); } -std::optional> RequestChannelReceiver::getPacketBlocking() { +nn::Result> RequestChannelReceiver::getPacketBlocking() { if (mTeardown) { - return std::nullopt; + return NN_ERROR() << "FMQ object is being torn down"; } - // First spend time polling if results are available in FMQ instead of - // waiting on the futex. Polling is more responsive (yielding lower - // latencies), but can take up more power, so only poll for a limited period - // of time. + // First spend time polling if results are available in FMQ instead of waiting on the futex. + // Polling is more responsive (yielding lower latencies), but can take up more power, so only + // poll for a limited period of time. auto& getCurrentTime = std::chrono::high_resolution_clock::now; const auto timeToStopPolling = getCurrentTime() + kPollingTimeWindow; @@ -522,173 +507,144 @@ std::optional> RequestChannelReceiver::getPacketBlo while (getCurrentTime() < timeToStopPolling) { // if class is being torn down, immediately return if (mTeardown.load(std::memory_order_relaxed)) { - return std::nullopt; + return NN_ERROR() << "FMQ object is being torn down"; } - // Check if data is available. If it is, immediately retrieve it and - // return. - const size_t available = mFmqRequestChannel->availableToRead(); + // Check if data is available. If it is, immediately retrieve it and return. + const size_t available = mFmqRequestChannel.availableToRead(); if (available > 0) { - // This is the first point when we know an execution is occurring, - // so begin to collect systraces. Note that a similar systrace does - // not exist at the corresponding point in - // ResultChannelReceiver::getPacketBlocking because the execution is - // already in flight. - NNTRACE_FULL(NNTRACE_LAYER_IPC, NNTRACE_PHASE_EXECUTION, - "ExecutionBurstServer getting packet"); std::vector packet(available); - const bool success = mFmqRequestChannel->read(packet.data(), available); + const bool success = mFmqRequestChannel.readBlocking(packet.data(), available); if (!success) { - LOG(ERROR) << "Error receiving packet"; - return std::nullopt; + return NN_ERROR() << "Error receiving packet"; } - return std::make_optional(std::move(packet)); + return packet; } } - // If we get to this point, we either stopped polling because it was taking - // too long or polling was not allowed. Instead, perform a blocking call - // which uses a futex to save power. + // If we get to this point, we either stopped polling because it was taking too long or polling + // was not allowed. Instead, perform a blocking call which uses a futex to save power. // wait for request packet and read first element of request packet FmqRequestDatum datum; - bool success = mFmqRequestChannel->readBlocking(&datum, 1); - - // This is the first point when we know an execution is occurring, so begin - // to collect systraces. Note that a similar systrace does not exist at the - // corresponding point in ResultChannelReceiver::getPacketBlocking because - // the execution is already in flight. - NNTRACE_FULL(NNTRACE_LAYER_IPC, NNTRACE_PHASE_EXECUTION, "ExecutionBurstServer getting packet"); + bool success = mFmqRequestChannel.readBlocking(&datum, 1); // retrieve remaining elements - // NOTE: all of the data is already available at this point, so there's no - // need to do a blocking wait to wait for more data. This is known because - // in FMQ, all writes are published (made available) atomically. Currently, - // the producer always publishes the entire packet in one function call, so - // if the first element of the packet is available, the remaining elements - // are also available. - const size_t count = mFmqRequestChannel->availableToRead(); + // NOTE: all of the data is already available at this point, so there's no need to do a blocking + // wait to wait for more data. This is known because in FMQ, all writes are published (made + // available) atomically. Currently, the producer always publishes the entire packet in one + // function call, so if the first element of the packet is available, the remaining elements are + // also available. + const size_t count = mFmqRequestChannel.availableToRead(); std::vector packet(count + 1); std::memcpy(&packet.front(), &datum, sizeof(datum)); - success &= mFmqRequestChannel->read(packet.data() + 1, count); + success &= mFmqRequestChannel.read(packet.data() + 1, count); // terminate loop if (mTeardown) { - return std::nullopt; + return NN_ERROR() << "FMQ object is being torn down"; } // ensure packet was successfully received if (!success) { - LOG(ERROR) << "Error receiving packet"; - return std::nullopt; + return NN_ERROR() << "Error receiving packet"; } - return std::make_optional(std::move(packet)); + return packet; } // ResultChannelSender methods -std::unique_ptr ResultChannelSender::create( - const FmqResultDescriptor& resultChannel) { - std::unique_ptr fmqResultChannel = - std::make_unique(resultChannel); +nn::GeneralResult> ResultChannelSender::create( + const MQDescriptorSync& resultChannel) { + auto resultChannelSender = + std::make_unique(PrivateConstructorTag{}, resultChannel); - if (!fmqResultChannel->isValid()) { - LOG(ERROR) << "Unable to create RequestChannelSender"; - return nullptr; + if (!resultChannelSender->mFmqResultChannel.isValid()) { + return NN_ERROR() << "Unable to create RequestChannelSender"; } - if (fmqResultChannel->getEventFlagWord() == nullptr) { - LOG(ERROR) << "ResultChannelSender::create was passed an MQDescriptor without an EventFlag"; - return nullptr; + if (resultChannelSender->mFmqResultChannel.getEventFlagWord() == nullptr) { + return NN_ERROR() + << "ResultChannelSender::create was passed an MQDescriptor without an EventFlag"; } - return std::make_unique(std::move(fmqResultChannel)); + return resultChannelSender; } -ResultChannelSender::ResultChannelSender(std::unique_ptr fmqResultChannel) - : mFmqResultChannel(std::move(fmqResultChannel)) {} +ResultChannelSender::ResultChannelSender(PrivateConstructorTag /*tag*/, + const MQDescriptorSync& resultChannel) + : mFmqResultChannel(resultChannel) {} -bool ResultChannelSender::send(V1_0::ErrorStatus errorStatus, +void ResultChannelSender::send(V1_0::ErrorStatus errorStatus, const std::vector& outputShapes, V1_2::Timing timing) { const std::vector serialized = serialize(errorStatus, outputShapes, timing); - return sendPacket(serialized); + sendPacket(serialized); } -bool ResultChannelSender::sendPacket(const std::vector& packet) { - if (packet.size() > mFmqResultChannel->availableToWrite()) { +void ResultChannelSender::sendPacket(const std::vector& packet) { + if (packet.size() > mFmqResultChannel.availableToWrite()) { LOG(ERROR) << "ResultChannelSender::sendPacket -- packet size exceeds size available in FMQ"; const std::vector errorPacket = serialize(V1_0::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming); - // Always send the packet with "blocking" because this signals the futex - // and unblocks the consumer if it is waiting on the futex. - return mFmqResultChannel->writeBlocking(errorPacket.data(), errorPacket.size()); + // Always send the packet with "blocking" because this signals the futex and unblocks the + // consumer if it is waiting on the futex. + mFmqResultChannel.writeBlocking(errorPacket.data(), errorPacket.size()); + } else { + // Always send the packet with "blocking" because this signals the futex and unblocks the + // consumer if it is waiting on the futex. + mFmqResultChannel.writeBlocking(packet.data(), packet.size()); } - - // Always send the packet with "blocking" because this signals the futex and - // unblocks the consumer if it is waiting on the futex. - return mFmqResultChannel->writeBlocking(packet.data(), packet.size()); } // ResultChannelReceiver methods -std::pair, const FmqResultDescriptor*> +nn::GeneralResult< + std::pair, const MQDescriptorSync*>> ResultChannelReceiver::create(size_t channelLength, std::chrono::microseconds pollingTimeWindow) { - std::unique_ptr fmqResultChannel = - std::make_unique(channelLength, /*confEventFlag=*/true); - if (!fmqResultChannel->isValid()) { - LOG(ERROR) << "Unable to create ResultChannelReceiver"; - return {nullptr, nullptr}; + auto resultChannelReceiver = std::make_unique( + PrivateConstructorTag{}, channelLength, pollingTimeWindow); + if (!resultChannelReceiver->mFmqResultChannel.isValid()) { + return NN_ERROR() << "Unable to create ResultChannelReceiver"; } - const FmqResultDescriptor* descriptor = fmqResultChannel->getDesc(); - return std::make_pair( - std::make_unique(std::move(fmqResultChannel), pollingTimeWindow), - descriptor); + const MQDescriptorSync* descriptor = + resultChannelReceiver->mFmqResultChannel.getDesc(); + return std::make_pair(std::move(resultChannelReceiver), descriptor); } -ResultChannelReceiver::ResultChannelReceiver(std::unique_ptr fmqResultChannel, +ResultChannelReceiver::ResultChannelReceiver(PrivateConstructorTag /*tag*/, size_t channelLength, std::chrono::microseconds pollingTimeWindow) - : mFmqResultChannel(std::move(fmqResultChannel)), kPollingTimeWindow(pollingTimeWindow) {} + : mFmqResultChannel(channelLength, /*configureEventFlagWord=*/true), + kPollingTimeWindow(pollingTimeWindow) {} -std::optional, V1_2::Timing>> +nn::Result, V1_2::Timing>> ResultChannelReceiver::getBlocking() { - const auto packet = getPacketBlocking(); - if (!packet) { - return std::nullopt; - } - - return deserialize(*packet); + const auto packet = NN_TRY(getPacketBlocking()); + return deserialize(packet); } -void ResultChannelReceiver::invalidate() { +void ResultChannelReceiver::notifyAsDeadObject() { mValid = false; // force unblock - // ExecutionBurstController waits on a result packet after sending a - // request. If the driver containing ExecutionBurstServer crashes, the - // controller may be waiting on the futex. This force unblock wakes up any - // thread waiting on the futex. - // TODO: look for a different/better way to signal/notify the futex to - // wake up any thread waiting on it - FmqResultDatum datum; - datum.packetInformation({/*.packetSize=*/0, - /*.errorStatus=*/V1_0::ErrorStatus::GENERAL_FAILURE, - /*.numberOfOperands=*/0}); - mFmqResultChannel->writeBlocking(&datum, 1); + // ExecutionBurstController waits on a result packet after sending a request. If the driver + // containing ExecutionBurstServer crashes, the controller may be waiting on the futex. This + // force unblock wakes up any thread waiting on the futex. + const auto data = serialize(V1_0::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming); + mFmqResultChannel.writeBlocking(data.data(), data.size()); } -std::optional> ResultChannelReceiver::getPacketBlocking() { +nn::Result> ResultChannelReceiver::getPacketBlocking() { if (!mValid) { - return std::nullopt; + return NN_ERROR() << "FMQ object is invalid"; } - // First spend time polling if results are available in FMQ instead of - // waiting on the futex. Polling is more responsive (yielding lower - // latencies), but can take up more power, so only poll for a limited period - // of time. + // First spend time polling if results are available in FMQ instead of waiting on the futex. + // Polling is more responsive (yielding lower latencies), but can take up more power, so only + // poll for a limited period of time. auto& getCurrentTime = std::chrono::high_resolution_clock::now; const auto timeToStopPolling = getCurrentTime() + kPollingTimeWindow; @@ -696,54 +652,49 @@ std::optional> ResultChannelReceiver::getPacketBlock while (getCurrentTime() < timeToStopPolling) { // if class is being torn down, immediately return if (!mValid.load(std::memory_order_relaxed)) { - return std::nullopt; + return NN_ERROR() << "FMQ object is invalid"; } - // Check if data is available. If it is, immediately retrieve it and - // return. - const size_t available = mFmqResultChannel->availableToRead(); + // Check if data is available. If it is, immediately retrieve it and return. + const size_t available = mFmqResultChannel.availableToRead(); if (available > 0) { std::vector packet(available); - const bool success = mFmqResultChannel->read(packet.data(), available); + const bool success = mFmqResultChannel.readBlocking(packet.data(), available); if (!success) { - LOG(ERROR) << "Error receiving packet"; - return std::nullopt; + return NN_ERROR() << "Error receiving packet"; } - return std::make_optional(std::move(packet)); + return packet; } } - // If we get to this point, we either stopped polling because it was taking - // too long or polling was not allowed. Instead, perform a blocking call - // which uses a futex to save power. + // If we get to this point, we either stopped polling because it was taking too long or polling + // was not allowed. Instead, perform a blocking call which uses a futex to save power. // wait for result packet and read first element of result packet FmqResultDatum datum; - bool success = mFmqResultChannel->readBlocking(&datum, 1); + bool success = mFmqResultChannel.readBlocking(&datum, 1); // retrieve remaining elements - // NOTE: all of the data is already available at this point, so there's no - // need to do a blocking wait to wait for more data. This is known because - // in FMQ, all writes are published (made available) atomically. Currently, - // the producer always publishes the entire packet in one function call, so - // if the first element of the packet is available, the remaining elements - // are also available. - const size_t count = mFmqResultChannel->availableToRead(); + // NOTE: all of the data is already available at this point, so there's no need to do a blocking + // wait to wait for more data. This is known because in FMQ, all writes are published (made + // available) atomically. Currently, the producer always publishes the entire packet in one + // function call, so if the first element of the packet is available, the remaining elements are + // also available. + const size_t count = mFmqResultChannel.availableToRead(); std::vector packet(count + 1); std::memcpy(&packet.front(), &datum, sizeof(datum)); - success &= mFmqResultChannel->read(packet.data() + 1, count); + success &= mFmqResultChannel.read(packet.data() + 1, count); if (!mValid) { - return std::nullopt; + return NN_ERROR() << "FMQ object is invalid"; } // ensure packet was successfully received if (!success) { - LOG(ERROR) << "Error receiving packet"; - return std::nullopt; + return NN_ERROR() << "Error receiving packet"; } - return std::make_optional(std::move(packet)); + return packet; } } // namespace android::hardware::neuralnetworks::V1_2::utils diff --git a/neuralnetworks/1.2/utils/src/PreparedModel.cpp b/neuralnetworks/1.2/utils/src/PreparedModel.cpp index 6841c5e007..71a4ea872b 100644 --- a/neuralnetworks/1.2/utils/src/PreparedModel.cpp +++ b/neuralnetworks/1.2/utils/src/PreparedModel.cpp @@ -18,6 +18,8 @@ #include "Callbacks.h" #include "Conversions.h" +#include "ExecutionBurstController.h" +#include "ExecutionBurstUtils.h" #include "Utils.h" #include @@ -27,12 +29,12 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include @@ -119,7 +121,14 @@ PreparedModel::executeFenced(const nn::Request& /*request*/, } nn::GeneralResult PreparedModel::configureExecutionBurst() const { - return V1_0::utils::Burst::create(shared_from_this()); + auto self = shared_from_this(); + auto fallback = [preparedModel = std::move(self)](const nn::Request& request, + nn::MeasureTiming measure) + -> nn::ExecutionResult, nn::Timing>> { + return preparedModel->execute(request, measure, {}, {}); + }; + const auto pollingTimeWindow = getBurstControllerPollingTimeWindow(); + return ExecutionBurstController::create(kPreparedModel, std::move(fallback), pollingTimeWindow); } std::any PreparedModel::getUnderlyingResource() const { diff --git a/neuralnetworks/1.3/utils/Android.bp b/neuralnetworks/1.3/utils/Android.bp index 2b1dcc40bb..28c036a8ea 100644 --- a/neuralnetworks/1.3/utils/Android.bp +++ b/neuralnetworks/1.3/utils/Android.bp @@ -42,6 +42,7 @@ cc_library_static { "android.hardware.neuralnetworks@1.1", "android.hardware.neuralnetworks@1.2", "android.hardware.neuralnetworks@1.3", + "libfmq", ], export_static_lib_headers: [ "neuralnetworks_utils_hal_common", diff --git a/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Conversions.h b/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Conversions.h index 8e1cdb82c9..b677c62505 100644 --- a/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Conversions.h +++ b/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Conversions.h @@ -59,7 +59,6 @@ GeneralResult convert( GeneralResult convert(const hal::V1_3::ErrorStatus& errorStatus); GeneralResult convert(const hardware::hidl_handle& handle); -GeneralResult convert(const hardware::hidl_memory& memory); GeneralResult> convert( const hardware::hidl_vec& bufferRoles); diff --git a/neuralnetworks/1.3/utils/src/Conversions.cpp b/neuralnetworks/1.3/utils/src/Conversions.cpp index 320c74c2c6..9788fe1b9d 100644 --- a/neuralnetworks/1.3/utils/src/Conversions.cpp +++ b/neuralnetworks/1.3/utils/src/Conversions.cpp @@ -352,10 +352,6 @@ GeneralResult convert(const hardware::hidl_handle& handle) { return validatedConvert(handle); } -GeneralResult convert(const hardware::hidl_memory& memory) { - return validatedConvert(memory); -} - GeneralResult> convert( const hardware::hidl_vec& bufferRoles) { return validatedConvert(bufferRoles); diff --git a/neuralnetworks/1.3/utils/src/PreparedModel.cpp b/neuralnetworks/1.3/utils/src/PreparedModel.cpp index 725e4f546a..64275a3729 100644 --- a/neuralnetworks/1.3/utils/src/PreparedModel.cpp +++ b/neuralnetworks/1.3/utils/src/PreparedModel.cpp @@ -29,8 +29,9 @@ #include #include #include -#include #include +#include +#include #include #include #include @@ -199,7 +200,15 @@ PreparedModel::executeFenced(const nn::Request& request, const std::vector PreparedModel::configureExecutionBurst() const { - return V1_0::utils::Burst::create(shared_from_this()); + auto self = shared_from_this(); + auto fallback = [preparedModel = std::move(self)](const nn::Request& request, + nn::MeasureTiming measure) + -> nn::ExecutionResult, nn::Timing>> { + return preparedModel->execute(request, measure, {}, {}); + }; + const auto pollingTimeWindow = V1_2::utils::getBurstControllerPollingTimeWindow(); + return V1_2::utils::ExecutionBurstController::create(kPreparedModel, std::move(fallback), + pollingTimeWindow); } std::any PreparedModel::getUnderlyingResource() const { diff --git a/neuralnetworks/utils/common/include/nnapi/hal/ProtectCallback.h b/neuralnetworks/utils/common/include/nnapi/hal/ProtectCallback.h index c9218857ac..05110bc364 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/ProtectCallback.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/ProtectCallback.h @@ -56,7 +56,7 @@ class IProtectedCallback { // Thread safe class class DeathRecipient final : public hidl_death_recipient { public: - void serviceDied(uint64_t /*cookie*/, const wp& /*who*/) override; + void serviceDied(uint64_t cookie, const wp& who) override; // Precondition: `killable` must be non-null. void add(IProtectedCallback* killable) const; // Precondition: `killable` must be non-null. @@ -64,6 +64,7 @@ class DeathRecipient final : public hidl_death_recipient { private: mutable std::mutex mMutex; + mutable bool mIsDeadObject GUARDED_BY(mMutex) = false; mutable std::vector mObjects GUARDED_BY(mMutex); }; @@ -78,14 +79,21 @@ class DeathHandler final { ~DeathHandler(); using Cleanup = std::function; + using Hold = base::ScopeGuard; + + // Precondition: `killable` must be non-null. + // `killable` must outlive the return value `Hold`. + [[nodiscard]] Hold protectCallback(IProtectedCallback* killable) const; + // Precondition: `killable` must be non-null. - [[nodiscard]] base::ScopeGuard protectCallback(IProtectedCallback* killable) const; + // `killable` must outlive the `DeathHandler`. + void protectCallbackForLifetimeOfDeathHandler(IProtectedCallback* killable) const; private: DeathHandler(sp object, sp deathRecipient); - sp kObject; - sp kDeathRecipient; + sp mObject; + sp mDeathRecipient; }; } // namespace android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/utils/common/src/ProtectCallback.cpp b/neuralnetworks/utils/common/src/ProtectCallback.cpp index abe4cb675e..18e1f3bf0b 100644 --- a/neuralnetworks/utils/common/src/ProtectCallback.cpp +++ b/neuralnetworks/utils/common/src/ProtectCallback.cpp @@ -35,19 +35,25 @@ void DeathRecipient::serviceDied(uint64_t /*cookie*/, const wpnotifyAsDeadObject(); }); + mObjects.clear(); + mIsDeadObject = true; } void DeathRecipient::add(IProtectedCallback* killable) const { CHECK(killable != nullptr); std::lock_guard guard(mMutex); - mObjects.push_back(killable); + if (mIsDeadObject) { + killable->notifyAsDeadObject(); + } else { + mObjects.push_back(killable); + } } void DeathRecipient::remove(IProtectedCallback* killable) const { CHECK(killable != nullptr); std::lock_guard guard(mMutex); - const auto removedIter = std::remove(mObjects.begin(), mObjects.end(), killable); - mObjects.erase(removedIter); + const auto newEnd = std::remove(mObjects.begin(), mObjects.end(), killable); + mObjects.erase(newEnd, mObjects.end()); } nn::GeneralResult DeathHandler::create(sp object) { @@ -67,19 +73,16 @@ nn::GeneralResult DeathHandler::create(sp } DeathHandler::DeathHandler(sp object, sp deathRecipient) - : kObject(std::move(object)), kDeathRecipient(std::move(deathRecipient)) { - CHECK(kObject != nullptr); - CHECK(kDeathRecipient != nullptr); + : mObject(std::move(object)), mDeathRecipient(std::move(deathRecipient)) { + CHECK(mObject != nullptr); + CHECK(mDeathRecipient != nullptr); } DeathHandler::~DeathHandler() { - if (kObject != nullptr && kDeathRecipient != nullptr) { - const auto ret = kObject->unlinkToDeath(kDeathRecipient); - const auto maybeSuccess = handleTransportError(ret); - if (!maybeSuccess.has_value()) { - LOG(ERROR) << maybeSuccess.error().message; - } else if (!maybeSuccess.value()) { - LOG(ERROR) << "IBase::linkToDeath returned false"; + if (mObject != nullptr && mDeathRecipient != nullptr) { + const auto successful = mObject->unlinkToDeath(mDeathRecipient).isOk(); + if (!successful) { + LOG(ERROR) << "IBase::linkToDeath failed"; } } } @@ -87,9 +90,14 @@ DeathHandler::~DeathHandler() { [[nodiscard]] base::ScopeGuard DeathHandler::protectCallback( IProtectedCallback* killable) const { CHECK(killable != nullptr); - kDeathRecipient->add(killable); + mDeathRecipient->add(killable); return base::make_scope_guard( - [deathRecipient = kDeathRecipient, killable] { deathRecipient->remove(killable); }); + [deathRecipient = mDeathRecipient, killable] { deathRecipient->remove(killable); }); +} + +void DeathHandler::protectCallbackForLifetimeOfDeathHandler(IProtectedCallback* killable) const { + CHECK(killable != nullptr); + mDeathRecipient->add(killable); } } // namespace android::hardware::neuralnetworks::utils -- GitLab From d0f8b44f97f8f408796b2599adb1df6c9053298f Mon Sep 17 00:00:00 2001 From: Ytai Ben-Tsvi Date: Fri, 19 Feb 2021 16:07:27 -0800 Subject: [PATCH 026/825] Add sthal_cli This is a simple console app that overrides the default STHAL with a mock one, useful for manual testing. This is not production code and it is not designed to be rigorous and/ or complete, but rather as a quick tool that can be easily changed to need. Test: Manual running and verification of basic functionality Change-Id: Ibd13a9dd83c163e02e76ce93f28d036d843854d5 --- soundtrigger/sthal_cli/Android.bp | 8 + soundtrigger/sthal_cli/OWNERS | 1 + .../hardware/soundtrigger/cli/SthalCli.java | 406 ++++++++++++++++++ soundtrigger/sthal_cli/sthal_cli | 7 + 4 files changed, 422 insertions(+) create mode 100644 soundtrigger/sthal_cli/Android.bp create mode 100644 soundtrigger/sthal_cli/OWNERS create mode 100644 soundtrigger/sthal_cli/java/android/hardware/soundtrigger/cli/SthalCli.java create mode 100644 soundtrigger/sthal_cli/sthal_cli diff --git a/soundtrigger/sthal_cli/Android.bp b/soundtrigger/sthal_cli/Android.bp new file mode 100644 index 0000000000..dafdfc3962 --- /dev/null +++ b/soundtrigger/sthal_cli/Android.bp @@ -0,0 +1,8 @@ +java_binary { + name: "sthal_cli", + wrapper: "sthal_cli", + srcs: ["java/**/*.java"], + static_libs: [ + "android.hardware.soundtrigger-V2.4-java", + ], +} diff --git a/soundtrigger/sthal_cli/OWNERS b/soundtrigger/sthal_cli/OWNERS new file mode 100644 index 0000000000..e21b66ecb3 --- /dev/null +++ b/soundtrigger/sthal_cli/OWNERS @@ -0,0 +1 @@ +include /media/java/android/media/soundtrigger_middleware/OWNERS diff --git a/soundtrigger/sthal_cli/java/android/hardware/soundtrigger/cli/SthalCli.java b/soundtrigger/sthal_cli/java/android/hardware/soundtrigger/cli/SthalCli.java new file mode 100644 index 0000000000..ebefd90187 --- /dev/null +++ b/soundtrigger/sthal_cli/java/android/hardware/soundtrigger/cli/SthalCli.java @@ -0,0 +1,406 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.soundtrigger.cli; + +import android.hardware.soundtrigger.V2_0.PhraseRecognitionExtra; +import android.hardware.soundtrigger.V2_0.RecognitionMode; +import android.hardware.soundtrigger.V2_0.SoundModelType; +import android.hardware.soundtrigger.V2_3.OptionalModelParameterRange; +import android.hardware.soundtrigger.V2_4.ISoundTriggerHw; +import android.hardware.soundtrigger.V2_4.ISoundTriggerHwCallback; +import android.hardware.soundtrigger.V2_4.ISoundTriggerHwGlobalCallback; +import android.os.HidlMemoryUtil; +import android.os.HwBinder; +import android.os.RemoteException; +import android.os.SystemProperties; +import java.util.Scanner; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +/** + * This is a quick-and-dirty sound trigger HAL console mock. + * + * It would only work on userdebug builds. + * + * When this app is started, it will initially: + * - Register a ISoundTriggerHw HAL with an instance name "mock". + * - Set a sysprop that tells SoundTriggerMiddlewareService to try to connect to the mock instance + * rather than the default one. + * - Reboot the real (default) HAL. + * + * In response to that, SoundTriggerMiddlewareService is going to connect to the mock HAL and resume + * normal operation. + * + * Our mock HAL will print to stdout every call it receives as well as expose a basic set of + * operations for sending event callbacks to the client. This allows us to simulate the frameworks + * behavior in response to different HAL behaviors. + */ +public class SthalCli { + private static SoundTriggerImpl mService; + private static final Scanner scanner = new Scanner(System.in); + + public static void main(String[] args) { + try { + System.out.println("Registering mock STHAL"); + HwBinder.setTrebleTestingOverride(true); + mService = new SoundTriggerImpl(); + mService.registerAsService("mock"); + + System.out.println("Rebooting STHAL"); + SystemProperties.set("debug.soundtrigger_middleware.use_mock_hal", "true"); + SystemProperties.set("sys.audio.restart.hal", "1"); + + while (processCommand()) + ; + } catch (Exception e) { + e.printStackTrace(); + } finally { + cleanup(); + } + } + + private static void cleanup() { + System.out.println("Cleaning up."); + SystemProperties.set("debug.soundtrigger_middleware.use_mock_hal", "false"); + HwBinder.setTrebleTestingOverride(false); + } + + private static boolean processCommand() { + String line = scanner.nextLine(); + String[] tokens = line.split("\\s+"); + if (tokens.length < 1) { + return false; + } + switch (tokens[0]) { + case "q": + return false; + + case "a": + mService.sendOnResourcesAvailable(); + return true; + + case "u": + mService.sendModelUnloaded(Integer.parseInt(tokens[1])); + return true; + + case "r": + mService.sendRecognitionEvent( + Integer.parseInt(tokens[1]), Integer.parseInt(tokens[2])); + return true; + + case "p": + mService.sendPhraseRecognitionEvent( + Integer.parseInt(tokens[1]), Integer.parseInt(tokens[2])); + return true; + + case "d": + mService.dumpModels(); + return true; + + case "h": + System.out.print("Available commands:\n" + + "h - help\n" + + "q - quit\n" + + "a - send onResourcesAvailable event\n" + + "u - send modelUnloaded event\n" + + "r - send recognitionEvent\n" + + "p - send phraseRecognitionEvent\n" + + "d - dump models\n"); + + default: + return true; + } + } + + private static class SoundTriggerImpl extends ISoundTriggerHw.Stub { + static class Model { + final ISoundTriggerHwCallback callback; + final SoundModel model; + final PhraseSoundModel phraseModel; + public android.hardware.soundtrigger.V2_3.RecognitionConfig config = null; + + Model(ISoundTriggerHwCallback callback, SoundModel model) { + this.callback = callback; + this.model = model; + this.phraseModel = null; + } + + Model(ISoundTriggerHwCallback callback, PhraseSoundModel model) { + this.callback = callback; + this.model = null; + this.phraseModel = model; + } + } + + private ISoundTriggerHwGlobalCallback mGlobalCallback; + private final ConcurrentMap mLoadedModels = new ConcurrentHashMap<>(); + private int mHandleCounter = 1; + + public void dumpModels() { + mLoadedModels.forEach((handle, model) -> { + System.out.println("+++ Model " + handle); + System.out.println(" config = " + model.config); + android.hardware.soundtrigger.V2_3.RecognitionConfig recognitionConfig = + model.config; + if (recognitionConfig != null) { + System.out.println(" ACTIVE recognitionConfig = " + recognitionConfig); + } else { + System.out.println(" INACTIVE"); + } + }); + } + + public void sendOnResourcesAvailable() { + if (mGlobalCallback != null) { + try { + mGlobalCallback.onResourcesAvailable(); + } catch (RemoteException e) { + e.printStackTrace(); + } + } + } + + public void sendRecognitionEvent(int modelHandle, int status) { + Model model = mLoadedModels.get(modelHandle); + if (model != null && model.config != null) { + android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback.RecognitionEvent event = + new android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback + .RecognitionEvent(); + event.header.model = modelHandle; + event.header.type = SoundModelType.GENERIC; + event.header.status = status; + event.header.captureSession = model.config.base.header.captureHandle; + event.header.captureAvailable = true; + event.header.audioConfig.channelMask = 16; + event.header.audioConfig.format = 1; + event.header.audioConfig.sampleRateHz = 16000; + event.data = HidlMemoryUtil.byteArrayToHidlMemory(new byte[0]); + try { + model.callback.recognitionCallback_2_1(event, 0); + } catch (RemoteException e) { + e.printStackTrace(); + } + model.config = null; + } + } + + public void sendPhraseRecognitionEvent(int modelHandle, int status) { + Model model = mLoadedModels.get(modelHandle); + if (model != null && model.config != null) { + android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback + .PhraseRecognitionEvent event = + new android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback + .PhraseRecognitionEvent(); + event.common.header.model = modelHandle; + event.common.header.type = SoundModelType.KEYPHRASE; + event.common.header.status = status; + event.common.header.captureSession = model.config.base.header.captureHandle; + event.common.header.captureAvailable = true; + event.common.header.audioConfig.channelMask = 16; + event.common.header.audioConfig.format = 1; + event.common.header.audioConfig.sampleRateHz = 16000; + event.common.data = HidlMemoryUtil.byteArrayToHidlMemory(new byte[0]); + if (!model.phraseModel.phrases.isEmpty()) { + PhraseRecognitionExtra extra = new PhraseRecognitionExtra(); + extra.id = model.phraseModel.phrases.get(0).id; + extra.confidenceLevel = 100; + extra.recognitionModes = model.phraseModel.phrases.get(0).recognitionModes; + event.phraseExtras.add(extra); + } + try { + model.callback.phraseRecognitionCallback_2_1(event, 0); + } catch (RemoteException e) { + e.printStackTrace(); + } + model.config = null; + } + } + + public void sendModelUnloaded(int modelHandle) { + Model model = mLoadedModels.remove(modelHandle); + if (model != null) { + try { + model.callback.modelUnloaded(modelHandle); + } catch (RemoteException e) { + e.printStackTrace(); + } + } + } + + @Override + public void registerGlobalCallback(ISoundTriggerHwGlobalCallback callback) { + System.out.println("registerGlobalCallback()"); + mGlobalCallback = callback; + } + + @Override + public void loadSoundModel_2_4(SoundModel soundModel, ISoundTriggerHwCallback callback, + loadSoundModel_2_4Callback _hidl_cb) { + int handle = mHandleCounter++; + System.out.println( + String.format("loadSoundModel_2_4(soundModel=%s) -> %d", soundModel, handle)); + mLoadedModels.put(handle, new Model(callback, soundModel)); + _hidl_cb.onValues(0, handle); + } + + @Override + public void loadPhraseSoundModel_2_4(PhraseSoundModel soundModel, + ISoundTriggerHwCallback callback, loadPhraseSoundModel_2_4Callback _hidl_cb) { + int handle = mHandleCounter++; + System.out.println(String.format( + "loadPhraseSoundModel_2_4(soundModel=%s) -> %d", soundModel, handle)); + mLoadedModels.put(handle, new Model(callback, soundModel)); + _hidl_cb.onValues(0, handle); + } + + @Override + public int startRecognition_2_4( + int modelHandle, android.hardware.soundtrigger.V2_3.RecognitionConfig config) { + System.out.println(String.format("startRecognition_2_4(modelHandle=%d)", modelHandle)); + Model model = mLoadedModels.get(modelHandle); + if (model != null) { + model.config = config; + } + return 0; + } + + @Override + public void getProperties_2_3(getProperties_2_3Callback _hidl_cb) { + System.out.println("getProperties_2_3()"); + android.hardware.soundtrigger.V2_3.Properties properties = + new android.hardware.soundtrigger.V2_3.Properties(); + properties.base.implementor = "Android"; + properties.base.description = "Mock STHAL"; + properties.base.maxSoundModels = 2; + properties.base.maxKeyPhrases = 1; + properties.base.recognitionModes = + RecognitionMode.VOICE_TRIGGER | RecognitionMode.GENERIC_TRIGGER; + _hidl_cb.onValues(0, properties); + } + + @Override + public void queryParameter( + int modelHandle, int modelParam, queryParameterCallback _hidl_cb) { + _hidl_cb.onValues(0, new OptionalModelParameterRange()); + } + + @Override + public int getModelState(int modelHandle) { + System.out.println(String.format("getModelState(modelHandle=%d)", modelHandle)); + return 0; + } + + @Override + public int unloadSoundModel(int modelHandle) { + System.out.println(String.format("unloadSoundModel(modelHandle=%d)", modelHandle)); + return 0; + } + + @Override + public int stopRecognition(int modelHandle) { + System.out.println(String.format("stopRecognition(modelHandle=%d)", modelHandle)); + Model model = mLoadedModels.get(modelHandle); + if (model != null) { + model.config = null; + } + return 0; + } + + @Override + public void debug(android.os.NativeHandle fd, java.util.ArrayList options) { + if (!options.isEmpty()) { + switch (options.get(0)) { + case "reboot": + System.out.println("Received a reboot request. Exiting."); + cleanup(); + System.exit(1); + } + } + } + + //////////////////////////////////////////////////////////////////////////////////////////// + // Everything below is not implemented and not expected to be called. + + @Override + public int startRecognition_2_3( + int modelHandle, android.hardware.soundtrigger.V2_3.RecognitionConfig config) { + throw new UnsupportedOperationException(); + } + + @Override + public int setParameter(int modelHandle, int modelParam, int value) { + throw new UnsupportedOperationException(); + } + + @Override + public void getParameter(int modelHandle, int modelParam, getParameterCallback _hidl_cb) { + throw new UnsupportedOperationException(); + } + + @Override + public void loadSoundModel_2_1(SoundModel soundModel, + android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback callback, int cookie, + loadSoundModel_2_1Callback _hidl_cb) { + throw new UnsupportedOperationException(); + } + + @Override + public void loadPhraseSoundModel_2_1(PhraseSoundModel soundModel, + android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback callback, int cookie, + loadPhraseSoundModel_2_1Callback _hidl_cb) { + throw new UnsupportedOperationException(); + } + + @Override + public int startRecognition_2_1(int modelHandle, RecognitionConfig config, + android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback callback, int cookie) { + throw new UnsupportedOperationException(); + } + + @Override + public void getProperties(getPropertiesCallback _hidl_cb) { + throw new UnsupportedOperationException(); + } + + @Override + public void loadSoundModel( + android.hardware.soundtrigger.V2_0.ISoundTriggerHw.SoundModel soundModel, + android.hardware.soundtrigger.V2_0.ISoundTriggerHwCallback callback, int cookie, + loadSoundModelCallback _hidl_cb) { + throw new UnsupportedOperationException(); + } + + @Override + public void loadPhraseSoundModel( + android.hardware.soundtrigger.V2_0.ISoundTriggerHw.PhraseSoundModel soundModel, + android.hardware.soundtrigger.V2_0.ISoundTriggerHwCallback callback, int cookie, + loadPhraseSoundModelCallback _hidl_cb) { + throw new UnsupportedOperationException(); + } + + @Override + public int startRecognition(int modelHandle, + android.hardware.soundtrigger.V2_0.ISoundTriggerHw.RecognitionConfig config, + android.hardware.soundtrigger.V2_0.ISoundTriggerHwCallback callback, int cookie) { + throw new UnsupportedOperationException(); + } + + @Override + public int stopAllRecognitions() { + throw new UnsupportedOperationException(); + } + } +} \ No newline at end of file diff --git a/soundtrigger/sthal_cli/sthal_cli b/soundtrigger/sthal_cli/sthal_cli new file mode 100644 index 0000000000..9fc6779bf7 --- /dev/null +++ b/soundtrigger/sthal_cli/sthal_cli @@ -0,0 +1,7 @@ +#!/system/bin/sh +# Script to start "sthal_cli" on the device +# +base=/system +export CLASSPATH=$base/framework/sthal_cli.jar +exec app_process $base/bin android.hardware.soundtrigger.cli.SthalCli "$@" + -- GitLab From 5f732ff683211e14bcb489839e46b99ee4c39106 Mon Sep 17 00:00:00 2001 From: Lev Proleev Date: Tue, 16 Feb 2021 12:58:16 +0000 Subject: [PATCH 027/825] NNAPI: Add AIDL drivers registration Bug: 179015258 Test: adb shell setprop debug.nn.partition 2 && \ Test: NeuralNetworksTest_static Change-Id: I2c8c9a49ff917b243348043df1158a8d98f131ce --- .../utils/include/nnapi/hal/aidl/Service.h | 3 +- neuralnetworks/aidl/utils/src/Service.cpp | 17 +++--- neuralnetworks/utils/service/Android.bp | 3 + neuralnetworks/utils/service/src/Service.cpp | 60 +++++++++++++++---- 4 files changed, 63 insertions(+), 20 deletions(-) diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Service.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Service.h index b4587acbf7..cb6ff4b1cd 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Service.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Service.h @@ -20,13 +20,12 @@ #include #include #include -#include #include namespace aidl::android::hardware::neuralnetworks::utils { -nn::GeneralResult getDevice(const std::string& name); +::android::nn::GeneralResult<::android::nn::SharedDevice> getDevice(const std::string& name); } // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/src/Service.cpp b/neuralnetworks/aidl/utils/src/Service.cpp index 5ec6ded5e5..511de559a6 100644 --- a/neuralnetworks/aidl/utils/src/Service.cpp +++ b/neuralnetworks/aidl/utils/src/Service.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -29,19 +30,21 @@ namespace aidl::android::hardware::neuralnetworks::utils { -nn::GeneralResult getDevice(const std::string& name) { +nn::GeneralResult getDevice(const std::string& instanceName) { + auto fullName = std::string(IDevice::descriptor) + "/" + instanceName; hal::utils::ResilientDevice::Factory makeDevice = - [name](bool blocking) -> nn::GeneralResult { - auto service = blocking ? IDevice::fromBinder( - ndk::SpAIBinder(AServiceManager_getService(name.c_str()))) - : IDevice::fromBinder(ndk::SpAIBinder( - AServiceManager_checkService(name.c_str()))); + [instanceName, + name = std::move(fullName)](bool blocking) -> nn::GeneralResult { + const auto& getService = + blocking ? AServiceManager_getService : AServiceManager_checkService; + auto service = IDevice::fromBinder(ndk::SpAIBinder(getService(name.c_str()))); if (service == nullptr) { return NN_ERROR() << (blocking ? "AServiceManager_getService" : "AServiceManager_checkService") << " returned nullptr"; } - return Device::create(name, std::move(service)); + ABinderProcess_startThreadPool(); + return Device::create(instanceName, std::move(service)); }; return hal::utils::ResilientDevice::create(std::move(makeDevice)); diff --git a/neuralnetworks/utils/service/Android.bp b/neuralnetworks/utils/service/Android.bp index 9f8b9bbbfd..5f36dff2cd 100644 --- a/neuralnetworks/utils/service/Android.bp +++ b/neuralnetworks/utils/service/Android.bp @@ -35,12 +35,15 @@ cc_library_static { "neuralnetworks_utils_hal_1_1", "neuralnetworks_utils_hal_1_2", "neuralnetworks_utils_hal_1_3", + "neuralnetworks_utils_hal_aidl", "neuralnetworks_utils_hal_common", ], shared_libs: [ + "android.hardware.neuralnetworks-V1-ndk_platform", "android.hardware.neuralnetworks@1.0", "android.hardware.neuralnetworks@1.1", "android.hardware.neuralnetworks@1.2", "android.hardware.neuralnetworks@1.3", + "libbinder_ndk", ], } diff --git a/neuralnetworks/utils/service/src/Service.cpp b/neuralnetworks/utils/service/src/Service.cpp index a59549dbf9..c83bcc916c 100644 --- a/neuralnetworks/utils/service/src/Service.cpp +++ b/neuralnetworks/utils/service/src/Service.cpp @@ -16,7 +16,9 @@ #include "Service.h" +#include #include +#include #include #include #include @@ -31,6 +33,7 @@ #include #include #include +#include #include #include @@ -42,11 +45,12 @@ namespace android::hardware::neuralnetworks::service { namespace { +namespace aidl_hal = ::aidl::android::hardware::neuralnetworks; using getDeviceFn = std::add_pointer_t(const std::string&)>; -void getDevicesForVersion(const std::string& descriptor, getDeviceFn getDevice, - std::vector* devices, - std::unordered_set* registeredDevices) { +void getHidlDevicesForVersion(const std::string& descriptor, getDeviceFn getDevice, + std::vector* devices, + std::unordered_set* registeredDevices) { CHECK(devices != nullptr); CHECK(registeredDevices != nullptr); @@ -66,18 +70,52 @@ void getDevicesForVersion(const std::string& descriptor, getDeviceFn getDevice, } } +void getAidlDevices(std::vector* devices, + std::unordered_set* registeredDevices) { + CHECK(devices != nullptr); + CHECK(registeredDevices != nullptr); + + std::vector names; + constexpr auto callback = [](const char* serviceName, void* names) { + static_cast*>(names)->emplace_back(serviceName); + }; + + // Devices with SDK level lower than 31 (Android S) don't have any AIDL drivers available, so + // there is no need for a workaround supported on lower levels. + if (__builtin_available(android __ANDROID_API_S__, *)) { + AServiceManager_forEachDeclaredInstance(aidl_hal::IDevice::descriptor, + static_cast(&names), callback); + } + + for (const auto& name : names) { + if (const auto [it, unregistered] = registeredDevices->insert(name); unregistered) { + auto maybeDevice = aidl_hal::utils::getDevice(name); + if (maybeDevice.has_value()) { + auto device = std::move(maybeDevice).value(); + CHECK(device != nullptr); + devices->push_back(std::move(device)); + } else { + LOG(ERROR) << "getDevice(" << name << ") failed with " << maybeDevice.error().code + << ": " << maybeDevice.error().message; + } + } + } +} + std::vector getDevices() { std::vector devices; std::unordered_set registeredDevices; - getDevicesForVersion(V1_3::IDevice::descriptor, &V1_3::utils::getDevice, &devices, - ®isteredDevices); - getDevicesForVersion(V1_2::IDevice::descriptor, &V1_2::utils::getDevice, &devices, - ®isteredDevices); - getDevicesForVersion(V1_1::IDevice::descriptor, &V1_1::utils::getDevice, &devices, - ®isteredDevices); - getDevicesForVersion(V1_0::IDevice::descriptor, &V1_0::utils::getDevice, &devices, - ®isteredDevices); + getAidlDevices(&devices, ®isteredDevices); + + getHidlDevicesForVersion(V1_3::IDevice::descriptor, &V1_3::utils::getDevice, &devices, + ®isteredDevices); + getHidlDevicesForVersion(V1_2::IDevice::descriptor, &V1_2::utils::getDevice, &devices, + ®isteredDevices); + getHidlDevicesForVersion(V1_1::IDevice::descriptor, &V1_1::utils::getDevice, &devices, + ®isteredDevices); + getHidlDevicesForVersion(V1_0::IDevice::descriptor, &V1_0::utils::getDevice, &devices, + ®isteredDevices); return devices; } -- GitLab From 402497e049ec2078026e1f3c5c3af0fcaa71cfee Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Wed, 10 Mar 2021 17:40:54 -0800 Subject: [PATCH 028/825] Format NN AIDL HAL There were some comment changes made to tha auto-generated AIDL files. Bug: N/A Test: mma Change-Id: I1a360115b82b0c222666c5d9189a220e74390654 --- .../current/android/hardware/neuralnetworks/BufferDesc.aidl | 3 ++- .../current/android/hardware/neuralnetworks/BufferRole.aidl | 3 ++- .../current/android/hardware/neuralnetworks/Capabilities.aidl | 3 ++- .../current/android/hardware/neuralnetworks/DataLocation.aidl | 3 ++- .../current/android/hardware/neuralnetworks/DeviceBuffer.aidl | 3 ++- .../current/android/hardware/neuralnetworks/DeviceType.aidl | 3 ++- .../current/android/hardware/neuralnetworks/ErrorStatus.aidl | 3 ++- .../android/hardware/neuralnetworks/ExecutionPreference.aidl | 3 ++- .../android/hardware/neuralnetworks/ExecutionResult.aidl | 3 ++- .../current/android/hardware/neuralnetworks/Extension.aidl | 3 ++- .../hardware/neuralnetworks/ExtensionNameAndPrefix.aidl | 3 ++- .../neuralnetworks/ExtensionOperandTypeInformation.aidl | 3 ++- .../android/hardware/neuralnetworks/FusedActivationFunc.aidl | 3 ++- .../current/android/hardware/neuralnetworks/IBuffer.aidl | 3 ++- .../current/android/hardware/neuralnetworks/IDevice.aidl | 3 ++- .../hardware/neuralnetworks/IFencedExecutionCallback.aidl | 3 ++- .../android/hardware/neuralnetworks/IPreparedModel.aidl | 3 ++- .../hardware/neuralnetworks/IPreparedModelCallback.aidl | 3 ++- .../android/hardware/neuralnetworks/IPreparedModelParcel.aidl | 3 ++- .../current/android/hardware/neuralnetworks/Memory.aidl | 3 ++- .../current/android/hardware/neuralnetworks/Model.aidl | 3 ++- .../android/hardware/neuralnetworks/NumberOfCacheFiles.aidl | 3 ++- .../current/android/hardware/neuralnetworks/Operand.aidl | 3 ++- .../android/hardware/neuralnetworks/OperandExtraParams.aidl | 3 ++- .../android/hardware/neuralnetworks/OperandLifeTime.aidl | 3 ++- .../android/hardware/neuralnetworks/OperandPerformance.aidl | 3 ++- .../current/android/hardware/neuralnetworks/OperandType.aidl | 3 ++- .../current/android/hardware/neuralnetworks/Operation.aidl | 3 ++- .../current/android/hardware/neuralnetworks/OperationType.aidl | 3 ++- .../current/android/hardware/neuralnetworks/OutputShape.aidl | 3 ++- .../android/hardware/neuralnetworks/PerformanceInfo.aidl | 3 ++- .../current/android/hardware/neuralnetworks/Priority.aidl | 3 ++- .../current/android/hardware/neuralnetworks/Request.aidl | 3 ++- .../android/hardware/neuralnetworks/RequestArgument.aidl | 3 ++- .../android/hardware/neuralnetworks/RequestMemoryPool.aidl | 3 ++- .../current/android/hardware/neuralnetworks/Subgraph.aidl | 3 ++- .../hardware/neuralnetworks/SymmPerChannelQuantParams.aidl | 3 ++- .../current/android/hardware/neuralnetworks/Timing.aidl | 3 ++- 38 files changed, 76 insertions(+), 38 deletions(-) diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferDesc.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferDesc.aidl index 71b7758f20..05cec76c88 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferDesc.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferDesc.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferRole.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferRole.aidl index c2d636c53d..f18e92a4e7 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferRole.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/BufferRole.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Capabilities.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Capabilities.aidl index 01cc753b58..30877c0294 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Capabilities.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Capabilities.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DataLocation.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DataLocation.aidl index e836daec96..db49a38979 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DataLocation.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DataLocation.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceBuffer.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceBuffer.aidl index 7bc8aa739a..7cdd6db742 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceBuffer.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceBuffer.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceType.aidl index 1abacc8a6f..82fe8ae3e7 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceType.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/DeviceType.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ErrorStatus.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ErrorStatus.aidl index 873c584f7c..57d5d6e4cd 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ErrorStatus.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ErrorStatus.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionPreference.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionPreference.aidl index c4badc0ad9..4352d8f334 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionPreference.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionPreference.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionResult.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionResult.aidl index b99bb3131e..44e9922f52 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionResult.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionResult.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Extension.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Extension.aidl index a7ae9421e9..c47028d99f 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Extension.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Extension.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl index 4c255387d1..6c287fd460 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl index b32b217960..a3680aa9dd 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/FusedActivationFunc.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/FusedActivationFunc.aidl index 2fee136e19..7e61bbbdb1 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/FusedActivationFunc.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/FusedActivationFunc.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBuffer.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBuffer.aidl index 2860692378..f10e7e24ca 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBuffer.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBuffer.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IDevice.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IDevice.aidl index 4c5fd2fa47..b328b29eab 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IDevice.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IDevice.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl index abe67b8801..0bfb80ac78 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl index 1f7cbe0e4b..5c54355186 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelCallback.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelCallback.aidl index 8eaaab68e4..e0c763bc2a 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelCallback.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelCallback.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelParcel.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelParcel.aidl index 8388fdabb4..dbedf12772 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelParcel.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModelParcel.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Memory.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Memory.aidl index 3b2f240b48..8207b25570 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Memory.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Memory.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Model.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Model.aidl index 9d12e58f98..30d8dda55d 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Model.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Model.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl index c1e87da229..9314760a43 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operand.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operand.aidl index bb78caaa17..5a9f4ffc72 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operand.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operand.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandExtraParams.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandExtraParams.aidl index 3f6d93b3bf..14792cff08 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandExtraParams.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandExtraParams.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandLifeTime.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandLifeTime.aidl index d581cedf54..40adfb1dd8 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandLifeTime.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandLifeTime.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandPerformance.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandPerformance.aidl index 87fd3a64bd..de93d8b444 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandPerformance.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandPerformance.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandType.aidl index 186c13dfe9..9f2c759d38 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandType.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperandType.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operation.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operation.aidl index fec83a89a8..33fcd60abc 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operation.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Operation.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl index ad42b02055..de3b438115 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OutputShape.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OutputShape.aidl index 09a43f7b6b..f7335054cf 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OutputShape.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OutputShape.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PerformanceInfo.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PerformanceInfo.aidl index 178946c217..04910f5410 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PerformanceInfo.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PerformanceInfo.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Priority.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Priority.aidl index d9b77fa917..8f357097ab 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Priority.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Priority.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Request.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Request.aidl index 599b3f4bfa..39ec7a9acd 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Request.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Request.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestArgument.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestArgument.aidl index 91b9aa7751..e3541c0ece 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestArgument.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestArgument.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestMemoryPool.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestMemoryPool.aidl index 3813b51578..312f5813bc 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestMemoryPool.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/RequestMemoryPool.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Subgraph.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Subgraph.aidl index dec976f8e8..b7d44515f4 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Subgraph.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Subgraph.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl index 66fdfe7d82..02d68f9ed1 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Timing.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Timing.aidl index d0de34a123..9690e01db3 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Timing.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Timing.aidl @@ -12,7 +12,8 @@ * WITHOUT 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. // /////////////////////////////////////////////////////////////////////////////// -- GitLab From 5dc72d5485c1f64147815e4ca8caad6fd5db2886 Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Thu, 4 Mar 2021 16:42:07 -0800 Subject: [PATCH 029/825] Add IBurst to NN AIDL HAL -- hal Burst executions are a sequence of executions of the same prepared model that occur in rapid succession, such as frames of a camera capture or successive audio samples. A burst object is used to control a set of burst executions, and to preserve resources between executions, enabling executions to have lower overhead. This CL has the following changes: 1) Adds an IBurst interface to the NN AIDL HAL 2) Adds IPreparedModel::configureExecutionBurst to create an IBurst object 3) Extends VTS's InvalidPreparedModel to implement configureExecutionBurst. Bug: 180492058 Bug: 177267324 Test: mma Test: VTS+presubmit Change-Id: I90cb18dcc392f07f342604a7fb2edae041848251 --- .../hardware/neuralnetworks/IBurst.aidl | 39 ++++++ .../neuralnetworks/IPreparedModel.aidl | 1 + .../hardware/neuralnetworks/IBurst.aidl | 120 ++++++++++++++++++ .../neuralnetworks/IPreparedModel.aidl | 19 +++ 4 files changed, 179 insertions(+) create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBurst.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/IBurst.aidl diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBurst.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBurst.aidl new file mode 100644 index 0000000000..634f39e670 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBurst.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 -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.neuralnetworks; +@VintfStability +interface IBurst { + android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in android.hardware.neuralnetworks.Request request, in long[] memoryIdentifierTokens, in boolean measureTiming, in long deadline, in long loopTimeoutDuration); + void releaseMemoryResource(in long memoryIdentifierToken); +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl index 5c54355186..52882cd0ab 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl @@ -36,6 +36,7 @@ package android.hardware.neuralnetworks; interface IPreparedModel { android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in android.hardware.neuralnetworks.Request request, in boolean measureTiming, in long deadline, in long loopTimeoutDuration); android.hardware.neuralnetworks.FencedExecutionResult executeFenced(in android.hardware.neuralnetworks.Request request, in ParcelFileDescriptor[] waitFor, in boolean measureTiming, in long deadline, in long loopTimeoutDuration, in long duration); + android.hardware.neuralnetworks.IBurst configureExecutionBurst(); const long DEFAULT_LOOP_TIMEOUT_DURATION_NS = 2000000000; const long MAXIMUM_LOOP_TIMEOUT_DURATION_NS = 15000000000; } diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IBurst.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IBurst.aidl new file mode 100644 index 0000000000..85d2a03a48 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IBurst.aidl @@ -0,0 +1,120 @@ +/* + * 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. + */ + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.ErrorStatus; +import android.hardware.neuralnetworks.ExecutionResult; +import android.hardware.neuralnetworks.Request; + +/** + * IBurst represents a burst execution object. + * + * Burst executions are a sequence of executions of the same prepared model that occur in rapid + * succession, such as frames of a camera capture or successive audio samples. A burst object is + * used to control a set of burst executions, and to preserve resources between executions, enabling + * executions to have lower overhead. Burst objects enable some optimizations: + * (1) A burst object is created before a sequence of executions, and freed when the sequence has + * ended. Because of this, the lifetime of the burst object hints to a driver how long it should + * remain in a high performance state. + * (2) A burst object can preserve resources between executions. For example, a driver can map a + * memory object on the first execution and cache the mapping in the burst object for reuse in + * subsequent executions. Any cached resource can be released when the burst object is destroyed + * or when the NNAPI runtime notifies the burst object that the resource is no longer required. + * (3) A burst object may be used for at most one execution at a time. This enables any transient + * execution resources such as intermediate tensors to be allocated once when the burst object + * is created and freed when the burst object is destroyed. + */ +@VintfStability +interface IBurst { + /** + * Performs a synchronous execution on a burst object. + * + * The execution is performed synchronously with respect to the caller. executeSynchronously + * must verify the inputs to the function are correct, and the usages of memory pools allocated + * by IDevice::allocate are valid. If there is an error, executeSynchronously must immediately + * return a service specific exception with the appropriate ErrorStatus value. If the inputs to + * the function are valid and there is no error, executeSynchronously must perform the + * execution, and must not return until the execution is complete. + * + * The caller must not change the content of any data object referenced by 'request' (described + * by the {@link DataLocation} of a {@link RequestArgument}) until executeSynchronously returns. + * executeSynchronously must not change the content of any of the data objects corresponding to + * 'request' inputs. + * + * If the burst object was configured from a prepared model wherein all tensor operands have + * fully specified dimensions, and the inputs to the function are valid, and at execution time + * every operation's input operands have legal values, then the execution should complete + * successfully: there must be no failure unless the device itself is in a bad state. + * + * executeSynchronously may be called with an optional deadline. If the execution is not able to + * be completed before the provided deadline, the execution may be aborted, and either + * {@link ErrorStatus::MISSED_DEADLINE_TRANSIENT} or {@link + * ErrorStatus::MISSED_DEADLINE_PERSISTENT} may be returned. The error due to an abort must be + * sent the same way as other errors, described above. + * + * Only a single execution on a given burst object may be active at any time. + * + * @param request The input and output information on which the prepared model is to be + * executed. + * @param memoryIdentifierTokens A list of tokens where each token is a non-negative number + * that uniquely identifies a memory object. Each memory + * identifier token corresponds to an element of request.pools. A + * value of -1 indicates no identity. + * @param measure Specifies whether or not to measure duration of the execution. The duration + * runs from the time the driver sees the call to the executeSynchronously + * function to the time the driver returns from the function. + * @param deadline The time by which the execution is expected to complete. The time is measured + * in nanoseconds since epoch of the steady clock (as from + * std::chrono::steady_clock). If the execution cannot be finished by the + * deadline, the execution may be aborted. Passing -1 means the deadline is + * omitted. Other negative values are invalid. + * @param loopTimeoutDuration The maximum amount of time in nanoseconds that should be spent + * executing a {@link OperationType::WHILE} operation. If a loop + * condition model does not output false within this duration, the + * execution must be aborted. If -1 is provided, the maximum amount + * of time is {@link DEFAULT_LOOP_TIMEOUT_DURATION_NS}. Other + * negative values are invalid. When provided, the duration must not + * exceed {@link MAXIMUM_LOOP_TIMEOUT_DURATION_NS}. + * @return ExecutionResult parcelable, containing the status of the execution, output shapes and + * timing information. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - INVALID_ARGUMENT if one of the input arguments is invalid + * - MISSED_DEADLINE_* if the execution is aborted because it cannot be completed by the + * deadline + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + */ + ExecutionResult executeSynchronously(in Request request, in long[] memoryIdentifierTokens, + in boolean measureTiming, in long deadline, in long loopTimeoutDuration); + + /** + * releaseMemoryResource is used by the client to signal to the service that a memory buffer + * corresponding to a slot number is no longer needed by the client, and any cached resources + * associated with that memory object may be released. + * + * The identifier tokens are unique to the burst object. + * + * @param memoryIdentifierToken Value uniquely identifying a memory object that is no longer + * used. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - INVALID_ARGUMENT if one of the input arguments is invalid + */ + void releaseMemoryResource(in long memoryIdentifierToken); +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl index 0240e3c0df..2a9757b323 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl @@ -20,6 +20,7 @@ import android.hardware.common.NativeHandle; import android.hardware.neuralnetworks.ErrorStatus; import android.hardware.neuralnetworks.ExecutionResult; import android.hardware.neuralnetworks.FencedExecutionResult; +import android.hardware.neuralnetworks.IBurst; import android.hardware.neuralnetworks.Request; /** @@ -166,4 +167,22 @@ interface IPreparedModel { FencedExecutionResult executeFenced(in Request request, in ParcelFileDescriptor[] waitFor, in boolean measureTiming, in long deadline, in long loopTimeoutDuration, in long duration); + + /** + * Configure a Burst object used to execute multiple inferences on a prepared model in rapid + * succession. + * + * If the prepared model was prepared from a model wherein all tensor operands have fully + * specified dimensions, and a valid serialized Request is sent to the Burst for execution, and + * at execution time every operation's input operands have legal values, then the execution + * should complete successfully (ErrorStatus::NONE): There must be no failure unless the device + * itself is in a bad state. + * + * @return burst Execution burst controller object. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + */ + IBurst configureExecutionBurst(); } -- GitLab From a0b82f3235bff3505b1c0fe5d5fd60be9ffa51da Mon Sep 17 00:00:00 2001 From: Xusong Wang Date: Wed, 17 Feb 2021 21:59:39 -0800 Subject: [PATCH 030/825] Test padded request memories in VTS generated tests. This CL modifies the VTS generated tests to specify input and output padding. Bug: 179691454 Test: VtsHalNeuralnetworksTargetTest Change-Id: Iec83199d6f046203acefdbd165887943447984a9 --- .../vts/functional/GeneratedTestHarness.cpp | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp index 4eb704b6e0..7a042ed37e 100644 --- a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp +++ b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp @@ -299,9 +299,11 @@ static bool isOutputSizeGreaterThanOne(const TestModel& testModel, uint32_t inde } static void makeOutputInsufficientSize(uint32_t outputIndex, Request* request) { - auto& length = request->outputs[outputIndex].location.length; - ASSERT_GT(length, 1u); - length -= 1u; + auto& loc = request->outputs[outputIndex].location; + ASSERT_GT(loc.length, 1u); + loc.length -= 1u; + // Test that the padding is not used for output data. + loc.padding += 1u; } static void makeOutputDimensionsUnspecified(Model* model) { @@ -336,6 +338,12 @@ class ExecutionContext { std::vector> mBuffers; }; +// Returns the number of bytes needed to round up "size" to the nearest multiple of "multiple". +static uint32_t roundUpBytesNeeded(uint32_t size, uint32_t multiple) { + CHECK(multiple != 0); + return ((size + multiple - 1) / multiple) * multiple - size; +} + std::optional ExecutionContext::createRequest(const TestModel& testModel, MemoryType memoryType) { // Memory pools are organized as: @@ -370,10 +378,13 @@ std::optional ExecutionContext::createRequest(const TestModel& testMode } // Reserve shared memory for input. + inputSize += roundUpBytesNeeded(inputSize, nn::kDefaultRequestMemoryAlignment); + const auto padding = roundUpBytesNeeded(op.data.size(), nn::kDefaultRequestMemoryPadding); DataLocation loc = {.poolIndex = kInputPoolIndex, .offset = static_cast(inputSize), - .length = static_cast(op.data.size())}; - inputSize += op.data.alignedSize(); + .length = static_cast(op.data.size()), + .padding = static_cast(padding)}; + inputSize += (op.data.size() + padding); inputs[i] = {.hasNoValue = false, .location = loc, .dimensions = {}}; } @@ -404,10 +415,13 @@ std::optional ExecutionContext::createRequest(const TestModel& testMode size_t bufferSize = std::max(op.data.size(), 1); // Reserve shared memory for output. + outputSize += roundUpBytesNeeded(outputSize, nn::kDefaultRequestMemoryAlignment); + const auto padding = roundUpBytesNeeded(bufferSize, nn::kDefaultRequestMemoryPadding); DataLocation loc = {.poolIndex = kOutputPoolIndex, .offset = static_cast(outputSize), - .length = static_cast(bufferSize)}; - outputSize += op.data.size() == 0 ? TestBuffer::kAlignment : op.data.alignedSize(); + .length = static_cast(bufferSize), + .padding = static_cast(padding)}; + outputSize += (bufferSize + padding); outputs[i] = {.hasNoValue = false, .location = loc, .dimensions = {}}; } -- GitLab From 8b7e8138685678c1e7b1d7de8b06ff0899c61b2d Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Wed, 10 Mar 2021 22:51:53 -0800 Subject: [PATCH 031/825] Add Burst tests to NN AIDL HAL VTS Bug: 180492058 Bug: 177267324 Test: mma Test: VtsHalNeuralnetworksTargetTest Change-Id: I1744005cbf750b70b42367b81a2fa6b8f24c1904 --- .../aidl/utils/test/MockPreparedModel.h | 2 + .../vts/functional/GeneratedTestHarness.cpp | 58 ++++++++++-- .../aidl/vts/functional/MemoryDomainTests.cpp | 38 +++++++- .../vts/functional/QualityOfServiceTests.cpp | 55 +++++++++++- .../aidl/vts/functional/ValidateRequest.cpp | 90 +++++++++++++++++++ .../vts/functional/VtsHalNeuralnetworks.cpp | 5 +- .../vts/functional/VtsHalNeuralnetworks.h | 2 +- 7 files changed, 237 insertions(+), 13 deletions(-) diff --git a/neuralnetworks/aidl/utils/test/MockPreparedModel.h b/neuralnetworks/aidl/utils/test/MockPreparedModel.h index 545b491f1d..36e0ec392d 100644 --- a/neuralnetworks/aidl/utils/test/MockPreparedModel.h +++ b/neuralnetworks/aidl/utils/test/MockPreparedModel.h @@ -39,6 +39,8 @@ class MockPreparedModel final : public BnPreparedModel { bool measureTiming, int64_t deadline, int64_t loopTimeoutDuration, int64_t duration, FencedExecutionResult* fencedExecutionResult), (override)); + MOCK_METHOD(ndk::ScopedAStatus, configureExecutionBurst, (std::shared_ptr * burst), + (override)); }; inline std::shared_ptr MockPreparedModel::create() { diff --git a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp index 4eb704b6e0..621e2255b0 100644 --- a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp +++ b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp @@ -17,6 +17,7 @@ #include "GeneratedTestHarness.h" #include +#include #include #include #include @@ -568,6 +569,53 @@ void EvaluatePreparedModel(const std::shared_ptr& device, } break; } + case Executor::BURST: { + SCOPED_TRACE("burst"); + + // create burst + std::shared_ptr burst; + auto ret = preparedModel->configureExecutionBurst(&burst); + ASSERT_TRUE(ret.isOk()) << ret.getDescription(); + ASSERT_NE(nullptr, burst.get()); + + // associate a unique slot with each memory pool + int64_t currentSlot = 0; + std::vector slots; + slots.reserve(request.pools.size()); + for (const auto& pool : request.pools) { + if (pool.getTag() == RequestMemoryPool::Tag::pool) { + slots.push_back(currentSlot++); + } else { + EXPECT_EQ(pool.getTag(), RequestMemoryPool::Tag::token); + slots.push_back(-1); + } + } + + ExecutionResult executionResult; + // execute + ret = burst->executeSynchronously(request, slots, testConfig.measureTiming, kNoDeadline, + loopTimeoutDuration, &executionResult); + ASSERT_TRUE(ret.isOk() || ret.getExceptionCode() == EX_SERVICE_SPECIFIC) + << ret.getDescription(); + if (ret.isOk()) { + executionStatus = executionResult.outputSufficientSize + ? ErrorStatus::NONE + : ErrorStatus::OUTPUT_INSUFFICIENT_SIZE; + outputShapes = std::move(executionResult.outputShapes); + timing = executionResult.timing; + } else { + executionStatus = static_cast(ret.getServiceSpecificError()); + } + + // Mark each slot as unused after the execution. This is unnecessary because the burst + // is freed after this scope ends, but this is here to test the functionality. + for (int64_t slot : slots) { + ret = burst->releaseMemoryResource(slot); + ASSERT_TRUE(ret.isOk()) << ret.getDescription(); + } + + break; + } case Executor::FENCED: { SCOPED_TRACE("fenced"); ErrorStatus result = ErrorStatus::NONE; @@ -713,19 +761,19 @@ void EvaluatePreparedModel(const std::shared_ptr& device, case TestKind::GENERAL: { outputTypesList = {OutputType::FULLY_SPECIFIED}; measureTimingList = {false, true}; - executorList = {Executor::SYNC}; + executorList = {Executor::SYNC, Executor::BURST}; memoryTypeList = {MemoryType::ASHMEM}; } break; case TestKind::DYNAMIC_SHAPE: { outputTypesList = {OutputType::UNSPECIFIED, OutputType::INSUFFICIENT}; measureTimingList = {false, true}; - executorList = {Executor::SYNC, Executor::FENCED}; + executorList = {Executor::SYNC, Executor::BURST, Executor::FENCED}; memoryTypeList = {MemoryType::ASHMEM}; } break; case TestKind::MEMORY_DOMAIN: { outputTypesList = {OutputType::FULLY_SPECIFIED}; measureTimingList = {false}; - executorList = {Executor::SYNC, Executor::FENCED}; + executorList = {Executor::SYNC, Executor::BURST, Executor::FENCED}; memoryTypeList = {MemoryType::BLOB_AHWB, MemoryType::DEVICE}; } break; case TestKind::FENCED_COMPUTE: { @@ -741,7 +789,7 @@ void EvaluatePreparedModel(const std::shared_ptr& device, case TestKind::INTINITE_LOOP_TIMEOUT: { outputTypesList = {OutputType::MISSED_DEADLINE}; measureTimingList = {false, true}; - executorList = {Executor::SYNC, Executor::FENCED}; + executorList = {Executor::SYNC, Executor::BURST, Executor::FENCED}; memoryTypeList = {MemoryType::ASHMEM}; } break; } @@ -765,7 +813,7 @@ void EvaluatePreparedCoupledModels(const std::shared_ptr& device, const TestModel& coupledModel) { const std::vector outputTypesList = {OutputType::FULLY_SPECIFIED}; const std::vector measureTimingList = {false, true}; - const std::vector executorList = {Executor::SYNC, Executor::FENCED}; + const std::vector executorList = {Executor::SYNC, Executor::BURST, Executor::FENCED}; for (const OutputType outputType : outputTypesList) { for (const bool measureTiming : measureTimingList) { diff --git a/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp b/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp index 57bc1aed54..627c26a6ec 100644 --- a/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp +++ b/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp @@ -203,6 +203,10 @@ class InvalidPreparedModel : public BnPreparedModel { return ndk::ScopedAStatus::fromServiceSpecificError( static_cast(ErrorStatus::GENERAL_FAILURE)); } + ndk::ScopedAStatus configureExecutionBurst(std::shared_ptr*) override { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(ErrorStatus::GENERAL_FAILURE)); + } }; template @@ -866,6 +870,9 @@ class MemoryDomainExecutionTest case Executor::SYNC: EXPECT_EQ(executeSync(preparedModel, request), expectedStatus); break; + case Executor::BURST: + EXPECT_EQ(executeBurst(preparedModel, request), expectedStatus); + break; case Executor::FENCED: EXPECT_EQ(executeFenced(preparedModel, request), expectedStatus); break; @@ -916,6 +923,35 @@ class MemoryDomainExecutionTest return executionStatus; } + ErrorStatus executeBurst(const std::shared_ptr& preparedModel, + const Request& request) { + // create burst + std::shared_ptr burst; + auto ret = preparedModel->configureExecutionBurst(&burst); + EXPECT_TRUE(ret.isOk()) << ret.getDescription(); + EXPECT_NE(nullptr, burst.get()); + if (!ret.isOk() || burst.get() == nullptr) { + return ErrorStatus::GENERAL_FAILURE; + } + + // use -1 for all memory identifier tokens + const std::vector slots(request.pools.size(), -1); + + ExecutionResult executionResult; + ret = burst->executeSynchronously(request, slots, false, kNoDeadline, + kOmittedTimeoutDuration, &executionResult); + + if (!ret.isOk()) { + EXPECT_EQ(ret.getExceptionCode(), EX_SERVICE_SPECIFIC); + return static_cast(ret.getServiceSpecificError()); + } + const ErrorStatus executionStatus = executionResult.outputSufficientSize + ? ErrorStatus::NONE + : ErrorStatus::OUTPUT_INSUFFICIENT_SIZE; + EXPECT_EQ(executionResult.timing, kNoTiming); + return executionStatus; + } + const Executor kExecutor = std::get(GetParam()); }; @@ -1159,7 +1195,7 @@ TEST_P(MemoryDomainExecutionTest, InvalidDimensions) { ErrorStatus::GENERAL_FAILURE); } -const auto kExecutorChoices = testing::Values(Executor::SYNC, Executor::FENCED); +const auto kExecutorChoices = testing::Values(Executor::SYNC, Executor::BURST, Executor::FENCED); std::string printMemoryDomainExecutionTest( const testing::TestParamInfo& info) { diff --git a/neuralnetworks/aidl/vts/functional/QualityOfServiceTests.cpp b/neuralnetworks/aidl/vts/functional/QualityOfServiceTests.cpp index 58db98f374..9ace1a9591 100644 --- a/neuralnetworks/aidl/vts/functional/QualityOfServiceTests.cpp +++ b/neuralnetworks/aidl/vts/functional/QualityOfServiceTests.cpp @@ -51,6 +51,10 @@ constexpr auto kShortDuration = std::chrono::milliseconds{5}; using Results = std::tuple, Timing>; using MaybeResults = std::optional; +using ExecutionFunction = + std::function& preparedModel, + const Request& request, int64_t deadline)>; + static int64_t makeDeadline(DeadlineBoundType deadlineBoundType) { const auto getNanosecondsSinceEpoch = [](const auto& time) -> int64_t { const auto timeSinceEpoch = time.time_since_epoch(); @@ -177,13 +181,53 @@ static MaybeResults executeSynchronously(const std::shared_ptr& std::move(executionResult.outputShapes), executionResult.timing}); } +static MaybeResults executeBurst(const std::shared_ptr& preparedModel, + const Request& request, int64_t deadline) { + SCOPED_TRACE("burst"); + const bool measure = false; + + // create burst + std::shared_ptr burst; + auto ret = preparedModel->configureExecutionBurst(&burst); + EXPECT_TRUE(ret.isOk()) << ret.getDescription(); + EXPECT_NE(nullptr, burst.get()); + if (!ret.isOk() || burst.get() == nullptr) { + return std::nullopt; + } + + // use -1 for all memory identifier tokens + const std::vector slots(request.pools.size(), -1); + + // run execution + ExecutionResult executionResult; + ret = burst->executeSynchronously(request, slots, measure, deadline, kOmittedTimeoutDuration, + &executionResult); + EXPECT_TRUE(ret.isOk() || ret.getExceptionCode() == EX_SERVICE_SPECIFIC) + << ret.getDescription(); + if (!ret.isOk()) { + if (ret.getExceptionCode() != EX_SERVICE_SPECIFIC) { + return std::nullopt; + } + return MaybeResults( + {static_cast(ret.getServiceSpecificError()), {}, kNoTiming}); + } + + // return results + return MaybeResults({executionResult.outputSufficientSize + ? ErrorStatus::NONE + : ErrorStatus::OUTPUT_INSUFFICIENT_SIZE, + std::move(executionResult.outputShapes), executionResult.timing}); +} + void runExecutionTest(const std::shared_ptr& preparedModel, const TestModel& testModel, const Request& request, - const ExecutionContext& context, DeadlineBoundType deadlineBound) { + const ExecutionContext& context, bool synchronous, + DeadlineBoundType deadlineBound) { + const ExecutionFunction execute = synchronous ? executeSynchronously : executeBurst; const auto deadline = makeDeadline(deadlineBound); // Perform execution and unpack results. - const auto results = executeSynchronously(preparedModel, request, deadline); + const auto results = execute(preparedModel, request, deadline); if (!results.has_value()) return; const auto& [status, outputShapes, timing] = results.value(); @@ -235,8 +279,11 @@ void runExecutionTest(const std::shared_ptr& preparedModel, void runExecutionTests(const std::shared_ptr& preparedModel, const TestModel& testModel, const Request& request, const ExecutionContext& context) { - for (auto deadlineBound : deadlineBounds) { - runExecutionTest(preparedModel, testModel, request, context, deadlineBound); + for (bool synchronous : {false, true}) { + for (auto deadlineBound : deadlineBounds) { + runExecutionTest(preparedModel, testModel, request, context, synchronous, + deadlineBound); + } } } diff --git a/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp b/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp index 3be4c1b97d..29e2471777 100644 --- a/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp +++ b/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp @@ -16,7 +16,9 @@ #define LOG_TAG "neuralnetworks_aidl_hal_test" +#include #include +#include #include @@ -77,6 +79,35 @@ static void validate(const std::shared_ptr& preparedModel, ASSERT_EQ(static_cast(executeStatus.getServiceSpecificError()), ErrorStatus::INVALID_ARGUMENT); } + + // burst + { + SCOPED_TRACE(message + " [burst]"); + + // create burst + std::shared_ptr burst; + auto ret = preparedModel->configureExecutionBurst(&burst); + ASSERT_TRUE(ret.isOk()) << ret.getDescription(); + ASSERT_NE(nullptr, burst.get()); + + // use -1 for all memory identifier tokens + const std::vector slots(request.pools.size(), -1); + + ExecutionResult executionResult; + const auto executeStatus = burst->executeSynchronously( + request, slots, measure, kNoDeadline, kOmittedTimeoutDuration, &executionResult); + ASSERT_FALSE(executeStatus.isOk()); + ASSERT_EQ(executeStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(executeStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); + } +} + +std::shared_ptr createBurst(const std::shared_ptr& preparedModel) { + std::shared_ptr burst; + const auto ret = preparedModel->configureExecutionBurst(&burst); + if (!ret.isOk()) return nullptr; + return burst; } ///////////////////////// REMOVE INPUT //////////////////////////////////// @@ -110,6 +141,65 @@ void validateRequest(const std::shared_ptr& preparedModel, const removeOutputTest(preparedModel, request); } +void validateBurst(const std::shared_ptr& preparedModel, const Request& request) { + // create burst + std::shared_ptr burst; + auto ret = preparedModel->configureExecutionBurst(&burst); + ASSERT_TRUE(ret.isOk()) << ret.getDescription(); + ASSERT_NE(nullptr, burst.get()); + + const auto test = [&burst, &request](const std::vector& slots) { + ExecutionResult executionResult; + const auto executeStatus = + burst->executeSynchronously(request, slots, /*measure=*/false, kNoDeadline, + kOmittedTimeoutDuration, &executionResult); + ASSERT_FALSE(executeStatus.isOk()); + ASSERT_EQ(executeStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(executeStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); + }; + + int64_t currentSlot = 0; + std::vector slots; + slots.reserve(request.pools.size()); + for (const auto& pool : request.pools) { + if (pool.getTag() == RequestMemoryPool::Tag::pool) { + slots.push_back(currentSlot++); + } else { + slots.push_back(-1); + } + } + + constexpr int64_t invalidSlot = -2; + + // validate failure when invalid memory identifier token value + for (size_t i = 0; i < request.pools.size(); ++i) { + const int64_t oldSlotValue = slots[i]; + + slots[i] = invalidSlot; + test(slots); + + slots[i] = oldSlotValue; + } + + // validate failure when request.pools.size() != memoryIdentifierTokens.size() + if (request.pools.size() > 0) { + slots = std::vector(request.pools.size() - 1, -1); + test(slots); + } + + // validate failure when request.pools.size() != memoryIdentifierTokens.size() + slots = std::vector(request.pools.size() + 1, -1); + test(slots); + + // validate failure when invalid memory identifier token value + const auto freeStatus = burst->releaseMemoryResource(invalidSlot); + ASSERT_FALSE(freeStatus.isOk()); + ASSERT_EQ(freeStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(freeStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); +} + void validateRequestFailure(const std::shared_ptr& preparedModel, const Request& request) { SCOPED_TRACE("Expecting request to fail [executeSynchronously]"); diff --git a/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp index 2d91b8edd9..0c3a19674e 100644 --- a/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp +++ b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp @@ -127,6 +127,8 @@ void validateModel(const std::shared_ptr& device, const Model& model); // Forward declaration from ValidateRequest.cpp void validateRequest(const std::shared_ptr& preparedModel, const Request& request); // Forward declaration from ValidateRequest.cpp +void validateBurst(const std::shared_ptr& preparedModel, const Request& request); +// Forward declaration from ValidateRequest.cpp void validateRequestFailure(const std::shared_ptr& preparedModel, const Request& request); @@ -140,6 +142,7 @@ void validateEverything(const std::shared_ptr& device, const Model& mod if (preparedModel == nullptr) return; validateRequest(preparedModel, request); + validateBurst(preparedModel, request); // HIDL also had test that expected executeFenced to fail on received null fd (-1). This is not // allowed in AIDL and will result in EX_TRANSACTION_FAILED. } @@ -178,8 +181,6 @@ INSTANTIATE_GENERATED_TEST(ValidationTest, [](const std::string& testName) { std::string toString(Executor executor) { switch (executor) { - case Executor::ASYNC: - return "ASYNC"; case Executor::SYNC: return "SYNC"; case Executor::BURST: diff --git a/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h index 9b81ee116e..4312d3a4a1 100644 --- a/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h +++ b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h @@ -52,7 +52,7 @@ void createPreparedModel(const std::shared_ptr& device, const Model& mo std::shared_ptr* preparedModel, bool reportSkipping = true); -enum class Executor { ASYNC, SYNC, BURST, FENCED }; +enum class Executor { SYNC, BURST, FENCED }; std::string toString(Executor executor); -- GitLab From b97a2512ebdaaeeda2541269b8de37724fa925c3 Mon Sep 17 00:00:00 2001 From: Ytai Ben-Tsvi Date: Thu, 18 Mar 2021 16:07:39 -0700 Subject: [PATCH 032/825] Move sthal_cli under 2.4 This version is specifically a mock of STHAL 2.4, so it makes more sense to put it under 2.4 and name it as such. I intend to add a separate mock for the AIDL version, so making sure the two don't collide. Test: Ran the mock HAL and manually verified operation. Change-Id: Ica8e53b981d73737bfb1720628592e650fc86ee0 --- .../{sthal_cli => 2.4/cli}/Android.bp | 4 +- soundtrigger/{sthal_cli => 2.4/cli}/OWNERS | 0 .../soundtrigger/V2_4}/cli/SthalCli.java | 57 +++++++++---------- soundtrigger/2.4/cli/sthal_cli_2.4 | 7 +++ soundtrigger/sthal_cli/sthal_cli | 7 --- 5 files changed, 35 insertions(+), 40 deletions(-) rename soundtrigger/{sthal_cli => 2.4/cli}/Android.bp (68%) rename soundtrigger/{sthal_cli => 2.4/cli}/OWNERS (100%) rename soundtrigger/{sthal_cli/java/android/hardware/soundtrigger => 2.4/cli/java/android/hardware/soundtrigger/V2_4}/cli/SthalCli.java (89%) create mode 100644 soundtrigger/2.4/cli/sthal_cli_2.4 delete mode 100644 soundtrigger/sthal_cli/sthal_cli diff --git a/soundtrigger/sthal_cli/Android.bp b/soundtrigger/2.4/cli/Android.bp similarity index 68% rename from soundtrigger/sthal_cli/Android.bp rename to soundtrigger/2.4/cli/Android.bp index dafdfc3962..7647967135 100644 --- a/soundtrigger/sthal_cli/Android.bp +++ b/soundtrigger/2.4/cli/Android.bp @@ -1,6 +1,6 @@ java_binary { - name: "sthal_cli", - wrapper: "sthal_cli", + name: "sthal_cli_2.4", + wrapper: "sthal_cli_2.4", srcs: ["java/**/*.java"], static_libs: [ "android.hardware.soundtrigger-V2.4-java", diff --git a/soundtrigger/sthal_cli/OWNERS b/soundtrigger/2.4/cli/OWNERS similarity index 100% rename from soundtrigger/sthal_cli/OWNERS rename to soundtrigger/2.4/cli/OWNERS diff --git a/soundtrigger/sthal_cli/java/android/hardware/soundtrigger/cli/SthalCli.java b/soundtrigger/2.4/cli/java/android/hardware/soundtrigger/V2_4/cli/SthalCli.java similarity index 89% rename from soundtrigger/sthal_cli/java/android/hardware/soundtrigger/cli/SthalCli.java rename to soundtrigger/2.4/cli/java/android/hardware/soundtrigger/V2_4/cli/SthalCli.java index ebefd90187..e6870aaf24 100644 --- a/soundtrigger/sthal_cli/java/android/hardware/soundtrigger/cli/SthalCli.java +++ b/soundtrigger/2.4/cli/java/android/hardware/soundtrigger/V2_4/cli/SthalCli.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.hardware.soundtrigger.cli; +package android.hardware.soundtrigger.V2_4.cli; import android.hardware.soundtrigger.V2_0.PhraseRecognitionExtra; import android.hardware.soundtrigger.V2_0.RecognitionMode; @@ -26,6 +26,7 @@ import android.os.HidlMemoryUtil; import android.os.HwBinder; import android.os.RemoteException; import android.os.SystemProperties; + import java.util.Scanner; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -63,8 +64,7 @@ public class SthalCli { SystemProperties.set("debug.soundtrigger_middleware.use_mock_hal", "true"); SystemProperties.set("sys.audio.restart.hal", "1"); - while (processCommand()) - ; + while (processCommand()) ; } catch (Exception e) { e.printStackTrace(); } finally { @@ -97,13 +97,13 @@ public class SthalCli { return true; case "r": - mService.sendRecognitionEvent( - Integer.parseInt(tokens[1]), Integer.parseInt(tokens[2])); + mService.sendRecognitionEvent(Integer.parseInt(tokens[1]), + Integer.parseInt(tokens[2])); return true; case "p": - mService.sendPhraseRecognitionEvent( - Integer.parseInt(tokens[1]), Integer.parseInt(tokens[2])); + mService.sendPhraseRecognitionEvent(Integer.parseInt(tokens[1]), + Integer.parseInt(tokens[2])); return true; case "d": @@ -111,9 +111,7 @@ public class SthalCli { return true; case "h": - System.out.print("Available commands:\n" - + "h - help\n" - + "q - quit\n" + System.out.print("Available commands:\n" + "h - help\n" + "q - quit\n" + "a - send onResourcesAvailable event\n" + "u - send modelUnloaded event\n" + "r - send recognitionEvent\n" @@ -177,8 +175,7 @@ public class SthalCli { Model model = mLoadedModels.get(modelHandle); if (model != null && model.config != null) { android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback.RecognitionEvent event = - new android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback - .RecognitionEvent(); + new android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback.RecognitionEvent(); event.header.model = modelHandle; event.header.type = SoundModelType.GENERIC; event.header.status = status; @@ -200,10 +197,9 @@ public class SthalCli { public void sendPhraseRecognitionEvent(int modelHandle, int status) { Model model = mLoadedModels.get(modelHandle); if (model != null && model.config != null) { - android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback - .PhraseRecognitionEvent event = - new android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback - .PhraseRecognitionEvent(); + android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback.PhraseRecognitionEvent + event = + new android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback.PhraseRecognitionEvent(); event.common.header.model = modelHandle; event.common.header.type = SoundModelType.KEYPHRASE; event.common.header.status = status; @@ -250,8 +246,7 @@ public class SthalCli { public void loadSoundModel_2_4(SoundModel soundModel, ISoundTriggerHwCallback callback, loadSoundModel_2_4Callback _hidl_cb) { int handle = mHandleCounter++; - System.out.println( - String.format("loadSoundModel_2_4(soundModel=%s) -> %d", soundModel, handle)); + System.out.printf("loadSoundModel_2_4(soundModel=%s) -> %d%n", soundModel, handle); mLoadedModels.put(handle, new Model(callback, soundModel)); _hidl_cb.onValues(0, handle); } @@ -260,16 +255,16 @@ public class SthalCli { public void loadPhraseSoundModel_2_4(PhraseSoundModel soundModel, ISoundTriggerHwCallback callback, loadPhraseSoundModel_2_4Callback _hidl_cb) { int handle = mHandleCounter++; - System.out.println(String.format( - "loadPhraseSoundModel_2_4(soundModel=%s) -> %d", soundModel, handle)); + System.out.printf("loadPhraseSoundModel_2_4(soundModel=%s) -> %d%n", soundModel, + handle); mLoadedModels.put(handle, new Model(callback, soundModel)); _hidl_cb.onValues(0, handle); } @Override - public int startRecognition_2_4( - int modelHandle, android.hardware.soundtrigger.V2_3.RecognitionConfig config) { - System.out.println(String.format("startRecognition_2_4(modelHandle=%d)", modelHandle)); + public int startRecognition_2_4(int modelHandle, + android.hardware.soundtrigger.V2_3.RecognitionConfig config) { + System.out.printf("startRecognition_2_4(modelHandle=%d)%n", modelHandle); Model model = mLoadedModels.get(modelHandle); if (model != null) { model.config = config; @@ -292,26 +287,26 @@ public class SthalCli { } @Override - public void queryParameter( - int modelHandle, int modelParam, queryParameterCallback _hidl_cb) { + public void queryParameter(int modelHandle, int modelParam, + queryParameterCallback _hidl_cb) { _hidl_cb.onValues(0, new OptionalModelParameterRange()); } @Override public int getModelState(int modelHandle) { - System.out.println(String.format("getModelState(modelHandle=%d)", modelHandle)); + System.out.printf("getModelState(modelHandle=%d)%n", modelHandle); return 0; } @Override public int unloadSoundModel(int modelHandle) { - System.out.println(String.format("unloadSoundModel(modelHandle=%d)", modelHandle)); + System.out.printf("unloadSoundModel(modelHandle=%d)%n", modelHandle); return 0; } @Override public int stopRecognition(int modelHandle) { - System.out.println(String.format("stopRecognition(modelHandle=%d)", modelHandle)); + System.out.printf("stopRecognition(modelHandle=%d)%n", modelHandle); Model model = mLoadedModels.get(modelHandle); if (model != null) { model.config = null; @@ -335,8 +330,8 @@ public class SthalCli { // Everything below is not implemented and not expected to be called. @Override - public int startRecognition_2_3( - int modelHandle, android.hardware.soundtrigger.V2_3.RecognitionConfig config) { + public int startRecognition_2_3(int modelHandle, + android.hardware.soundtrigger.V2_3.RecognitionConfig config) { throw new UnsupportedOperationException(); } @@ -403,4 +398,4 @@ public class SthalCli { throw new UnsupportedOperationException(); } } -} \ No newline at end of file +} diff --git a/soundtrigger/2.4/cli/sthal_cli_2.4 b/soundtrigger/2.4/cli/sthal_cli_2.4 new file mode 100644 index 0000000000..08014643ff --- /dev/null +++ b/soundtrigger/2.4/cli/sthal_cli_2.4 @@ -0,0 +1,7 @@ +#!/system/bin/sh +# Script to start "sthal_cli_2.4" on the device +# +base=/system +export CLASSPATH=$base/framework/sthal_cli_2.4.jar +exec app_process $base/bin android.hardware.soundtrigger.V2_4.cli.SthalCli "$@" + diff --git a/soundtrigger/sthal_cli/sthal_cli b/soundtrigger/sthal_cli/sthal_cli deleted file mode 100644 index 9fc6779bf7..0000000000 --- a/soundtrigger/sthal_cli/sthal_cli +++ /dev/null @@ -1,7 +0,0 @@ -#!/system/bin/sh -# Script to start "sthal_cli" on the device -# -base=/system -export CLASSPATH=$base/framework/sthal_cli.jar -exec app_process $base/bin android.hardware.soundtrigger.cli.SthalCli "$@" - -- GitLab From cc62c0b2a2e6de06e7f0b16ea4dd46a40d781924 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Fri, 19 Mar 2021 16:49:48 -0700 Subject: [PATCH 033/825] [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces Added SPDX-license-identifier-Apache-2.0 to: camera/device/3.7/Android.bp camera/provider/2.7/Android.bp soundtrigger/2.4/Android.bp soundtrigger/2.4/cli/Android.bp soundtrigger/2.4/vts/functional/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: Ibb3fc9cd32846ad8359f4e6b5f4460c3b54d4a36 --- soundtrigger/2.4/Android.bp | 9 +++++++++ soundtrigger/2.4/cli/Android.bp | 9 +++++++++ soundtrigger/2.4/vts/functional/Android.bp | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/soundtrigger/2.4/Android.bp b/soundtrigger/2.4/Android.bp index 38c32dff73..44befc3892 100644 --- a/soundtrigger/2.4/Android.bp +++ b/soundtrigger/2.4/Android.bp @@ -1,5 +1,14 @@ // This file is autogenerated by hidl-gen -Landroidbp. +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"], +} + hidl_interface { name: "android.hardware.soundtrigger@2.4", root: "android.hardware", diff --git a/soundtrigger/2.4/cli/Android.bp b/soundtrigger/2.4/cli/Android.bp index 7647967135..8d0979bed7 100644 --- a/soundtrigger/2.4/cli/Android.bp +++ b/soundtrigger/2.4/cli/Android.bp @@ -1,3 +1,12 @@ +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"], +} + java_binary { name: "sthal_cli_2.4", wrapper: "sthal_cli_2.4", diff --git a/soundtrigger/2.4/vts/functional/Android.bp b/soundtrigger/2.4/vts/functional/Android.bp index 0e69bf4844..4b7ae91f37 100644 --- a/soundtrigger/2.4/vts/functional/Android.bp +++ b/soundtrigger/2.4/vts/functional/Android.bp @@ -14,6 +14,15 @@ // 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: "VtsHalSoundtriggerV2_4TargetTest", defaults: ["VtsHalTargetTestDefaults"], -- GitLab From 08ee3f9287811e9087a5263c3176ce1439f70c2c Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Wed, 3 Feb 2021 15:15:43 -0800 Subject: [PATCH 034/825] Add missing validation for NN canonical types Bug: 177669661 Test: mma Test: NeuralNetworksTest_static Change-Id: Ic05c177f61a906a69bf82ff9c4d5bb8b0556d5ca --- .../1.0/utils/include/nnapi/hal/1.0/Utils.h | 14 +++ neuralnetworks/1.0/utils/src/Conversions.cpp | 38 +++----- .../1.1/utils/include/nnapi/hal/1.1/Utils.h | 13 +++ neuralnetworks/1.1/utils/src/Conversions.cpp | 42 +++------ .../1.2/utils/include/nnapi/hal/1.2/Utils.h | 15 +++ neuralnetworks/1.2/utils/src/Conversions.cpp | 92 +++++------------- .../1.3/utils/include/nnapi/hal/1.3/Utils.h | 20 ++++ neuralnetworks/1.3/utils/src/Conversions.cpp | 88 ++++-------------- .../include/nnapi/hal/aidl/Conversions.h | 6 +- .../aidl/utils/include/nnapi/hal/aidl/Utils.h | 17 ++++ neuralnetworks/aidl/utils/src/Conversions.cpp | 93 ++++++------------- .../aidl/vts/functional/ValidateModel.cpp | 2 +- 12 files changed, 176 insertions(+), 264 deletions(-) diff --git a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Utils.h b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Utils.h index b695f48550..1baabdf562 100644 --- a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Utils.h +++ b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Utils.h @@ -22,10 +22,15 @@ #include #include #include +#include #include +#include +#include namespace android::hardware::neuralnetworks::V1_0::utils { +constexpr auto kVersion = nn::Version::ANDROID_OC_MR1; + template nn::Result validate(const Type& halObject) { const auto maybeCanonical = nn::convert(halObject); @@ -44,6 +49,15 @@ bool valid(const Type& halObject) { return result.has_value(); } +template +nn::GeneralResult compliantVersion(const Type& canonical) { + const auto version = NN_TRY(hal::utils::makeGeneralFailure(nn::validate(canonical))); + if (version > kVersion) { + return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; + } + return {}; +} + template auto convertFromNonCanonical(const Type& nonCanonicalObject) -> decltype(convert(nn::convert(nonCanonicalObject).value())) { diff --git a/neuralnetworks/1.0/utils/src/Conversions.cpp b/neuralnetworks/1.0/utils/src/Conversions.cpp index 700b050ce7..c0498eb876 100644 --- a/neuralnetworks/1.0/utils/src/Conversions.cpp +++ b/neuralnetworks/1.0/utils/src/Conversions.cpp @@ -35,6 +35,8 @@ #include #include +#include "Utils.h" + namespace { template @@ -42,8 +44,6 @@ constexpr std::underlying_type_t underlyingType(Type value) { return static_cast>(value); } -constexpr auto kVersion = android::nn::Version::ANDROID_OC_MR1; - } // namespace namespace android::nn { @@ -53,13 +53,13 @@ using hardware::hidl_memory; using hardware::hidl_vec; template -using unvalidatedConvertOutput = +using UnvalidatedConvertOutput = std::decay_t()).value())>; template -GeneralResult>> unvalidatedConvert( +GeneralResult>> unvalidatedConvert( const hidl_vec& arguments) { - std::vector> canonical; + std::vector> canonical; canonical.reserve(arguments.size()); for (const auto& argument : arguments) { canonical.push_back(NN_TRY(nn::unvalidatedConvert(argument))); @@ -68,16 +68,9 @@ GeneralResult>> unvalidatedConvert( } template -decltype(nn::unvalidatedConvert(std::declval())) validatedConvert(const Type& halObject) { +GeneralResult> validatedConvert(const Type& halObject) { auto canonical = NN_TRY(nn::unvalidatedConvert(halObject)); - const auto maybeVersion = validate(canonical); - if (!maybeVersion.has_value()) { - return error() << maybeVersion.error(); - } - const auto version = maybeVersion.value(); - if (version > kVersion) { - return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; - } + NN_TRY(hal::V1_0::utils::compliantVersion(canonical)); return canonical; } @@ -248,13 +241,13 @@ namespace android::hardware::neuralnetworks::V1_0::utils { namespace { template -using unvalidatedConvertOutput = +using UnvalidatedConvertOutput = std::decay_t()).value())>; template -nn::GeneralResult>> unvalidatedConvert( +nn::GeneralResult>> unvalidatedConvert( const std::vector& arguments) { - hidl_vec> halObject(arguments.size()); + hidl_vec> halObject(arguments.size()); for (size_t i = 0; i < arguments.size(); ++i) { halObject[i] = NN_TRY(utils::unvalidatedConvert(arguments[i])); } @@ -262,15 +255,8 @@ nn::GeneralResult>> unvalidatedConvert( } template -decltype(utils::unvalidatedConvert(std::declval())) validatedConvert(const Type& canonical) { - const auto maybeVersion = nn::validate(canonical); - if (!maybeVersion.has_value()) { - return nn::error() << maybeVersion.error(); - } - const auto version = maybeVersion.value(); - if (version > kVersion) { - return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; - } +nn::GeneralResult> validatedConvert(const Type& canonical) { + NN_TRY(compliantVersion(canonical)); return utils::unvalidatedConvert(canonical); } diff --git a/neuralnetworks/1.1/utils/include/nnapi/hal/1.1/Utils.h b/neuralnetworks/1.1/utils/include/nnapi/hal/1.1/Utils.h index 09597a31f8..a8cf8cf7b9 100644 --- a/neuralnetworks/1.1/utils/include/nnapi/hal/1.1/Utils.h +++ b/neuralnetworks/1.1/utils/include/nnapi/hal/1.1/Utils.h @@ -22,12 +22,16 @@ #include #include #include +#include #include +#include #include +#include namespace android::hardware::neuralnetworks::V1_1::utils { constexpr auto kDefaultExecutionPreference = ExecutionPreference::FAST_SINGLE_ANSWER; +constexpr auto kVersion = nn::Version::ANDROID_P; template nn::Result validate(const Type& halObject) { @@ -47,6 +51,15 @@ bool valid(const Type& halObject) { return result.has_value(); } +template +nn::GeneralResult compliantVersion(const Type& canonical) { + const auto version = NN_TRY(hal::utils::makeGeneralFailure(nn::validate(canonical))); + if (version > kVersion) { + return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; + } + return {}; +} + template auto convertFromNonCanonical(const Type& nonCanonicalObject) -> decltype(convert(nn::convert(nonCanonicalObject).value())) { diff --git a/neuralnetworks/1.1/utils/src/Conversions.cpp b/neuralnetworks/1.1/utils/src/Conversions.cpp index d07f7d00bc..467ceb389b 100644 --- a/neuralnetworks/1.1/utils/src/Conversions.cpp +++ b/neuralnetworks/1.1/utils/src/Conversions.cpp @@ -35,11 +35,7 @@ #include #include -namespace { - -constexpr auto kVersion = android::nn::Version::ANDROID_P; - -} // namespace +#include "Utils.h" namespace android::nn { namespace { @@ -47,13 +43,13 @@ namespace { using hardware::hidl_vec; template -using unvalidatedConvertOutput = +using UnvalidatedConvertOutput = std::decay_t()).value())>; template -GeneralResult>> unvalidatedConvert( +GeneralResult>> unvalidatedConvert( const hidl_vec& arguments) { - std::vector> canonical; + std::vector> canonical; canonical.reserve(arguments.size()); for (const auto& argument : arguments) { canonical.push_back(NN_TRY(nn::unvalidatedConvert(argument))); @@ -62,16 +58,9 @@ GeneralResult>> unvalidatedConvert( } template -decltype(nn::unvalidatedConvert(std::declval())) validatedConvert(const Type& halObject) { +GeneralResult> validatedConvert(const Type& halObject) { auto canonical = NN_TRY(nn::unvalidatedConvert(halObject)); - const auto maybeVersion = validate(canonical); - if (!maybeVersion.has_value()) { - return error() << maybeVersion.error(); - } - const auto version = maybeVersion.value(); - if (version > kVersion) { - return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; - } + NN_TRY(hal::V1_1::utils::compliantVersion(canonical)); return canonical; } @@ -180,13 +169,13 @@ nn::GeneralResult unvalidatedConvert(const nn::SharedMemory& memory } template -using unvalidatedConvertOutput = +using UnvalidatedConvertOutput = std::decay_t()).value())>; template -nn::GeneralResult>> unvalidatedConvert( +nn::GeneralResult>> unvalidatedConvert( const std::vector& arguments) { - hidl_vec> halObject(arguments.size()); + hidl_vec> halObject(arguments.size()); for (size_t i = 0; i < arguments.size(); ++i) { halObject[i] = NN_TRY(unvalidatedConvert(arguments[i])); } @@ -194,16 +183,9 @@ nn::GeneralResult>> unvalidatedConvert( } template -decltype(utils::unvalidatedConvert(std::declval())) validatedConvert(const Type& canonical) { - const auto maybeVersion = nn::validate(canonical); - if (!maybeVersion.has_value()) { - return nn::error() << maybeVersion.error(); - } - const auto version = maybeVersion.value(); - if (version > kVersion) { - return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; - } - return utils::unvalidatedConvert(canonical); +nn::GeneralResult> validatedConvert(const Type& canonical) { + NN_TRY(compliantVersion(canonical)); + return unvalidatedConvert(canonical); } } // anonymous namespace diff --git a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Utils.h b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Utils.h index 323311439f..09691b65ee 100644 --- a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Utils.h +++ b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Utils.h @@ -22,19 +22,25 @@ #include #include #include +#include #include +#include #include #include +#include +#include #include namespace android::hardware::neuralnetworks::V1_2::utils { using CacheToken = hidl_array(Constant::BYTE_SIZE_OF_CACHE_TOKEN)>; +using V1_1::utils::kDefaultExecutionPreference; constexpr auto kDefaultMesaureTiming = MeasureTiming::NO; constexpr auto kNoTiming = Timing{.timeOnDevice = std::numeric_limits::max(), .timeInDriver = std::numeric_limits::max()}; +constexpr auto kVersion = nn::Version::ANDROID_Q; template nn::Result validate(const Type& halObject) { @@ -54,6 +60,15 @@ bool valid(const Type& halObject) { return result.has_value(); } +template +nn::GeneralResult compliantVersion(const Type& canonical) { + const auto version = NN_TRY(hal::utils::makeGeneralFailure(nn::validate(canonical))); + if (version > kVersion) { + return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; + } + return {}; +} + template auto convertFromNonCanonical(const Type& nonCanonicalObject) -> decltype(convert(nn::convert(nonCanonicalObject).value())) { diff --git a/neuralnetworks/1.2/utils/src/Conversions.cpp b/neuralnetworks/1.2/utils/src/Conversions.cpp index 2c45583d0c..29945b75e5 100644 --- a/neuralnetworks/1.2/utils/src/Conversions.cpp +++ b/neuralnetworks/1.2/utils/src/Conversions.cpp @@ -37,6 +37,8 @@ #include #include +#include "Utils.h" + namespace { template @@ -45,50 +47,23 @@ constexpr std::underlying_type_t underlyingType(Type value) { } using HalDuration = std::chrono::duration; -constexpr auto kVersion = android::nn::Version::ANDROID_Q; -constexpr uint64_t kNoTiming = std::numeric_limits::max(); } // namespace namespace android::nn { namespace { -constexpr bool validOperandType(OperandType operandType) { - switch (operandType) { - case OperandType::FLOAT32: - case OperandType::INT32: - case OperandType::UINT32: - case OperandType::TENSOR_FLOAT32: - case OperandType::TENSOR_INT32: - case OperandType::TENSOR_QUANT8_ASYMM: - case OperandType::BOOL: - case OperandType::TENSOR_QUANT16_SYMM: - case OperandType::TENSOR_FLOAT16: - case OperandType::TENSOR_BOOL8: - case OperandType::FLOAT16: - case OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL: - case OperandType::TENSOR_QUANT16_ASYMM: - case OperandType::TENSOR_QUANT8_SYMM: - case OperandType::OEM: - case OperandType::TENSOR_OEM_BYTE: - return true; - default: - break; - } - return isExtension(operandType); -} - using hardware::hidl_handle; using hardware::hidl_vec; template -using unvalidatedConvertOutput = +using UnvalidatedConvertOutput = std::decay_t()).value())>; template -GeneralResult>> unvalidatedConvertVec( +GeneralResult>> unvalidatedConvert( const hidl_vec& arguments) { - std::vector> canonical; + std::vector> canonical; canonical.reserve(arguments.size()); for (const auto& argument : arguments) { canonical.push_back(NN_TRY(nn::unvalidatedConvert(argument))); @@ -97,29 +72,16 @@ GeneralResult>> unvalidatedConvertVec } template -GeneralResult>> unvalidatedConvert( - const hidl_vec& arguments) { - return unvalidatedConvertVec(arguments); -} - -template -decltype(nn::unvalidatedConvert(std::declval())) validatedConvert(const Type& halObject) { +GeneralResult> validatedConvert(const Type& halObject) { auto canonical = NN_TRY(nn::unvalidatedConvert(halObject)); - const auto maybeVersion = validate(canonical); - if (!maybeVersion.has_value()) { - return error() << maybeVersion.error(); - } - const auto version = maybeVersion.value(); - if (version > kVersion) { - return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; - } + NN_TRY(hal::V1_2::utils::compliantVersion(canonical)); return canonical; } template -GeneralResult>> validatedConvert( +GeneralResult>> validatedConvert( const hidl_vec& arguments) { - std::vector> canonical; + std::vector> canonical; canonical.reserve(arguments.size()); for (const auto& argument : arguments) { canonical.push_back(NN_TRY(validatedConvert(argument))); @@ -145,8 +107,7 @@ GeneralResult unvalidatedConvert(const hal::V1_2::Capabilities& ca const bool validOperandTypes = std::all_of( capabilities.operandPerformance.begin(), capabilities.operandPerformance.end(), [](const hal::V1_2::Capabilities::OperandPerformance& operandPerformance) { - const auto maybeType = unvalidatedConvert(operandPerformance.type); - return !maybeType.has_value() ? false : validOperandType(maybeType.value()); + return validatedConvert(operandPerformance.type).has_value(); }); if (!validOperandTypes) { return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) @@ -275,6 +236,7 @@ GeneralResult unvalidatedConvert(const hal::V1_2::MeasureTiming& GeneralResult unvalidatedConvert(const hal::V1_2::Timing& timing) { constexpr uint64_t kMaxTiming = std::chrono::floor(Duration::max()).count(); constexpr auto convertTiming = [](uint64_t halTiming) -> OptionalDuration { + constexpr uint64_t kNoTiming = std::numeric_limits::max(); if (halTiming == kNoTiming) { return {}; } @@ -378,25 +340,19 @@ nn::GeneralResult unvalidatedConvert(const nn::SharedMemory& memory } template -using unvalidatedConvertOutput = +using UnvalidatedConvertOutput = std::decay_t()).value())>; template -nn::GeneralResult>> unvalidatedConvertVec( +nn::GeneralResult>> unvalidatedConvert( const std::vector& arguments) { - hidl_vec> halObject(arguments.size()); + hidl_vec> halObject(arguments.size()); for (size_t i = 0; i < arguments.size(); ++i) { halObject[i] = NN_TRY(unvalidatedConvert(arguments[i])); } return halObject; } -template -nn::GeneralResult>> unvalidatedConvert( - const std::vector& arguments) { - return unvalidatedConvertVec(arguments); -} - nn::GeneralResult makeExtraParams(nn::Operand::NoParams /*noParams*/) { return Operand::ExtraParams{}; } @@ -416,22 +372,15 @@ nn::GeneralResult makeExtraParams( } template -decltype(utils::unvalidatedConvert(std::declval())) validatedConvert(const Type& canonical) { - const auto maybeVersion = nn::validate(canonical); - if (!maybeVersion.has_value()) { - return nn::error() << maybeVersion.error(); - } - const auto version = maybeVersion.value(); - if (version > kVersion) { - return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; - } - return utils::unvalidatedConvert(canonical); +nn::GeneralResult> validatedConvert(const Type& canonical) { + NN_TRY(compliantVersion(canonical)); + return unvalidatedConvert(canonical); } template -nn::GeneralResult>> validatedConvert( +nn::GeneralResult>> validatedConvert( const std::vector& arguments) { - hidl_vec> halObject(arguments.size()); + hidl_vec> halObject(arguments.size()); for (size_t i = 0; i < arguments.size(); ++i) { halObject[i] = NN_TRY(validatedConvert(arguments[i])); } @@ -469,7 +418,7 @@ nn::GeneralResult unvalidatedConvert(const nn::Capabilities& capab capabilities.operandPerformance.asVector().end(), std::back_inserter(operandPerformance), [](const nn::Capabilities::OperandPerformance& operandPerformance) { - return nn::validOperandType(operandPerformance.type); + return compliantVersion(operandPerformance.type).has_value(); }); return Capabilities{ @@ -570,6 +519,7 @@ nn::GeneralResult unvalidatedConvert(const nn::MeasureTiming& mea nn::GeneralResult unvalidatedConvert(const nn::Timing& timing) { constexpr auto convertTiming = [](nn::OptionalDuration canonicalTiming) -> uint64_t { + constexpr uint64_t kNoTiming = std::numeric_limits::max(); if (!canonicalTiming.has_value()) { return kNoTiming; } diff --git a/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Utils.h b/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Utils.h index 3ce412cde6..1d76caaba6 100644 --- a/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Utils.h +++ b/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Utils.h @@ -22,14 +22,25 @@ #include #include #include +#include #include +#include #include #include +#include #include +#include +#include namespace android::hardware::neuralnetworks::V1_3::utils { +using V1_1::utils::kDefaultExecutionPreference; +using V1_2::utils::CacheToken; +using V1_2::utils::kDefaultMesaureTiming; +using V1_2::utils::kNoTiming; + constexpr auto kDefaultPriority = Priority::MEDIUM; +constexpr auto kVersion = nn::Version::ANDROID_R; template nn::Result validate(const Type& halObject) { @@ -49,6 +60,15 @@ bool valid(const Type& halObject) { return result.has_value(); } +template +nn::GeneralResult compliantVersion(const Type& canonical) { + const auto version = NN_TRY(hal::utils::makeGeneralFailure(nn::validate(canonical))); + if (version > kVersion) { + return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; + } + return {}; +} + template auto convertFromNonCanonical(const Type& nonCanonicalObject) -> decltype(convert(nn::convert(nonCanonicalObject).value())) { diff --git a/neuralnetworks/1.3/utils/src/Conversions.cpp b/neuralnetworks/1.3/utils/src/Conversions.cpp index 9788fe1b9d..baea9364f9 100644 --- a/neuralnetworks/1.3/utils/src/Conversions.cpp +++ b/neuralnetworks/1.3/utils/src/Conversions.cpp @@ -38,6 +38,8 @@ #include #include +#include "Utils.h" + namespace { template @@ -45,48 +47,21 @@ constexpr std::underlying_type_t underlyingType(Type value) { return static_cast>(value); } -constexpr auto kVersion = android::nn::Version::ANDROID_R; - } // namespace namespace android::nn { namespace { -constexpr auto validOperandType(nn::OperandType operandType) { - switch (operandType) { - case nn::OperandType::FLOAT32: - case nn::OperandType::INT32: - case nn::OperandType::UINT32: - case nn::OperandType::TENSOR_FLOAT32: - case nn::OperandType::TENSOR_INT32: - case nn::OperandType::TENSOR_QUANT8_ASYMM: - case nn::OperandType::BOOL: - case nn::OperandType::TENSOR_QUANT16_SYMM: - case nn::OperandType::TENSOR_FLOAT16: - case nn::OperandType::TENSOR_BOOL8: - case nn::OperandType::FLOAT16: - case nn::OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL: - case nn::OperandType::TENSOR_QUANT16_ASYMM: - case nn::OperandType::TENSOR_QUANT8_SYMM: - case nn::OperandType::TENSOR_QUANT8_ASYMM_SIGNED: - case nn::OperandType::SUBGRAPH: - case nn::OperandType::OEM: - case nn::OperandType::TENSOR_OEM_BYTE: - return true; - } - return nn::isExtension(operandType); -} - using hardware::hidl_vec; template -using unvalidatedConvertOutput = +using UnvalidatedConvertOutput = std::decay_t()).value())>; template -GeneralResult>> unvalidatedConvertVec( +GeneralResult>> unvalidatedConvert( const hidl_vec& arguments) { - std::vector> canonical; + std::vector> canonical; canonical.reserve(arguments.size()); for (const auto& argument : arguments) { canonical.push_back(NN_TRY(nn::unvalidatedConvert(argument))); @@ -95,29 +70,16 @@ GeneralResult>> unvalidatedConvertVec } template -GeneralResult>> unvalidatedConvert( - const hidl_vec& arguments) { - return unvalidatedConvertVec(arguments); -} - -template -decltype(nn::unvalidatedConvert(std::declval())) validatedConvert(const Type& halObject) { +GeneralResult> validatedConvert(const Type& halObject) { auto canonical = NN_TRY(nn::unvalidatedConvert(halObject)); - const auto maybeVersion = validate(canonical); - if (!maybeVersion.has_value()) { - return error() << maybeVersion.error(); - } - const auto version = maybeVersion.value(); - if (version > kVersion) { - return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; - } + NN_TRY(hal::V1_3::utils::compliantVersion(canonical)); return canonical; } template -GeneralResult>> validatedConvert( +GeneralResult>> validatedConvert( const hidl_vec& arguments) { - std::vector> canonical; + std::vector> canonical; canonical.reserve(arguments.size()); for (const auto& argument : arguments) { canonical.push_back(NN_TRY(validatedConvert(argument))); @@ -143,8 +105,7 @@ GeneralResult unvalidatedConvert(const hal::V1_3::Capabilities& ca const bool validOperandTypes = std::all_of( capabilities.operandPerformance.begin(), capabilities.operandPerformance.end(), [](const hal::V1_3::Capabilities::OperandPerformance& operandPerformance) { - const auto maybeType = unvalidatedConvert(operandPerformance.type); - return !maybeType.has_value() ? false : validOperandType(maybeType.value()); + return validatedConvert(operandPerformance.type).has_value(); }); if (!validOperandTypes) { return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) @@ -401,25 +362,19 @@ nn::GeneralResult unvalidatedConvert( } template -using unvalidatedConvertOutput = +using UnvalidatedConvertOutput = std::decay_t()).value())>; template -nn::GeneralResult>> unvalidatedConvertVec( +nn::GeneralResult>> unvalidatedConvert( const std::vector& arguments) { - hidl_vec> halObject(arguments.size()); + hidl_vec> halObject(arguments.size()); for (size_t i = 0; i < arguments.size(); ++i) { halObject[i] = NN_TRY(unvalidatedConvert(arguments[i])); } return halObject; } -template -nn::GeneralResult>> unvalidatedConvert( - const std::vector& arguments) { - return unvalidatedConvertVec(arguments); -} - nn::GeneralResult makeMemoryPool(const nn::SharedMemory& memory) { Request::MemoryPool ret; ret.hidlMemory(NN_TRY(unvalidatedConvert(memory))); @@ -439,22 +394,15 @@ nn::GeneralResult makeMemoryPool(const nn::SharedBuffer& /* using utils::unvalidatedConvert; template -decltype(unvalidatedConvert(std::declval())) validatedConvert(const Type& canonical) { - const auto maybeVersion = nn::validate(canonical); - if (!maybeVersion.has_value()) { - return nn::error() << maybeVersion.error(); - } - const auto version = maybeVersion.value(); - if (version > kVersion) { - return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; - } +nn::GeneralResult> validatedConvert(const Type& canonical) { + NN_TRY(compliantVersion(canonical)); return unvalidatedConvert(canonical); } template -nn::GeneralResult>> validatedConvert( +nn::GeneralResult>> validatedConvert( const std::vector& arguments) { - hidl_vec> halObject(arguments.size()); + hidl_vec> halObject(arguments.size()); for (size_t i = 0; i < arguments.size(); ++i) { halObject[i] = NN_TRY(validatedConvert(arguments[i])); } @@ -482,7 +430,7 @@ nn::GeneralResult unvalidatedConvert(const nn::Capabilities& capab capabilities.operandPerformance.asVector().end(), std::back_inserter(operandPerformance), [](const nn::Capabilities::OperandPerformance& operandPerformance) { - return nn::validOperandType(operandPerformance.type); + return compliantVersion(operandPerformance.type).has_value(); }); return Capabilities{ diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h index 4922a6ea1e..5eab9ffaf6 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h @@ -99,6 +99,9 @@ GeneralResult unvalidatedConvert( const ::aidl::android::hardware::common::NativeHandle& handle); GeneralResult unvalidatedConvert(const ndk::ScopedFileDescriptor& syncFence); +GeneralResult> unvalidatedConvert( + const std::vector& operations); + GeneralResult convert(const aidl_hal::Capabilities& capabilities); GeneralResult convert(const aidl_hal::DeviceType& deviceType); GeneralResult convert(const aidl_hal::ErrorStatus& errorStatus); @@ -106,16 +109,13 @@ GeneralResult convert( const aidl_hal::ExecutionPreference& executionPreference); GeneralResult convert(const aidl_hal::Memory& memory); GeneralResult convert(const aidl_hal::Model& model); -GeneralResult convert(const aidl_hal::Operand& operand); GeneralResult convert(const aidl_hal::OperandType& operandType); GeneralResult convert(const aidl_hal::Priority& priority); -GeneralResult convert(const aidl_hal::RequestMemoryPool& memoryPool); GeneralResult convert(const aidl_hal::Request& request); GeneralResult convert(const aidl_hal::Timing& timing); GeneralResult convert(const ndk::ScopedFileDescriptor& syncFence); GeneralResult> convert(const std::vector& extension); -GeneralResult> convert(const std::vector& outputShapes); GeneralResult> convert(const std::vector& memories); GeneralResult> convert( const std::vector& outputShapes); diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h index 58dcfe3af6..316d34fdfe 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -48,6 +49,22 @@ bool valid(const Type& halObject) { return result.has_value(); } +template +nn::GeneralResult compliantVersion(const Type& canonical) { + const auto version = NN_TRY(::android::hardware::neuralnetworks::utils::makeGeneralFailure( + nn::validate(canonical))); + if (version > kVersion) { + return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; + } + return {}; +} + +template +auto convertFromNonCanonical(const Type& nonCanonicalObject) + -> decltype(convert(nn::convert(nonCanonicalObject).value())) { + return convert(NN_TRY(nn::convert(nonCanonicalObject))); +} + nn::GeneralResult clone(const Memory& memory); nn::GeneralResult clone(const Request& request); nn::GeneralResult clone(const RequestMemoryPool& requestPool); diff --git a/neuralnetworks/aidl/utils/src/Conversions.cpp b/neuralnetworks/aidl/utils/src/Conversions.cpp index c47ba0ec1c..edd6982cb3 100644 --- a/neuralnetworks/aidl/utils/src/Conversions.cpp +++ b/neuralnetworks/aidl/utils/src/Conversions.cpp @@ -41,6 +41,8 @@ #include #include +#include "Utils.h" + #define VERIFY_NON_NEGATIVE(value) \ while (UNLIKELY(value < 0)) return NN_ERROR() @@ -53,7 +55,6 @@ constexpr std::underlying_type_t underlyingType(Type value) { return static_cast>(value); } -constexpr auto kVersion = android::nn::Version::ANDROID_S; constexpr int64_t kNoTiming = -1; } // namespace @@ -63,32 +64,6 @@ namespace { using ::aidl::android::hardware::common::NativeHandle; -constexpr auto validOperandType(nn::OperandType operandType) { - switch (operandType) { - case nn::OperandType::FLOAT32: - case nn::OperandType::INT32: - case nn::OperandType::UINT32: - case nn::OperandType::TENSOR_FLOAT32: - case nn::OperandType::TENSOR_INT32: - case nn::OperandType::TENSOR_QUANT8_ASYMM: - case nn::OperandType::BOOL: - case nn::OperandType::TENSOR_QUANT16_SYMM: - case nn::OperandType::TENSOR_FLOAT16: - case nn::OperandType::TENSOR_BOOL8: - case nn::OperandType::FLOAT16: - case nn::OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL: - case nn::OperandType::TENSOR_QUANT16_ASYMM: - case nn::OperandType::TENSOR_QUANT8_SYMM: - case nn::OperandType::TENSOR_QUANT8_ASYMM_SIGNED: - case nn::OperandType::SUBGRAPH: - return true; - case nn::OperandType::OEM: - case nn::OperandType::TENSOR_OEM_BYTE: - return false; - } - return nn::isExtension(operandType); -} - template using UnvalidatedConvertOutput = std::decay_t()).value())>; @@ -113,14 +88,7 @@ GeneralResult>> unvalidatedConvert( template GeneralResult> validatedConvert(const Type& halObject) { auto canonical = NN_TRY(nn::unvalidatedConvert(halObject)); - const auto maybeVersion = validate(canonical); - if (!maybeVersion.has_value()) { - return error() << maybeVersion.error(); - } - const auto version = maybeVersion.value(); - if (version > kVersion) { - return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; - } + NN_TRY(aidl_hal::utils::compliantVersion(canonical)); return canonical; } @@ -185,13 +153,21 @@ static GeneralResult nativeHandleFromAidlHandle(const Native GeneralResult unvalidatedConvert(const aidl_hal::OperandType& operandType) { VERIFY_NON_NEGATIVE(underlyingType(operandType)) << "Negative operand types are not allowed."; - return static_cast(operandType); + const auto canonical = static_cast(operandType); + if (canonical == OperandType::OEM || canonical == OperandType::TENSOR_OEM_BYTE) { + return NN_ERROR() << "Unable to convert invalid OperandType " << canonical; + } + return canonical; } GeneralResult unvalidatedConvert(const aidl_hal::OperationType& operationType) { VERIFY_NON_NEGATIVE(underlyingType(operationType)) << "Negative operation types are not allowed."; - return static_cast(operationType); + const auto canonical = static_cast(operationType); + if (canonical == OperationType::OEM_OPERATION) { + return NN_ERROR() << "Unable to convert invalid OperationType OEM_OPERATION"; + } + return canonical; } GeneralResult unvalidatedConvert(const aidl_hal::DeviceType& deviceType) { @@ -206,8 +182,7 @@ GeneralResult unvalidatedConvert(const aidl_hal::Capabilities& cap const bool validOperandTypes = std::all_of( capabilities.operandPerformance.begin(), capabilities.operandPerformance.end(), [](const aidl_hal::OperandPerformance& operandPerformance) { - const auto maybeType = unvalidatedConvert(operandPerformance.type); - return !maybeType.has_value() ? false : validOperandType(maybeType.value()); + return validatedConvert(operandPerformance.type).has_value(); }); if (!validOperandTypes) { return NN_ERROR() << "Invalid OperandType when unvalidatedConverting OperandPerformance in " @@ -534,6 +509,11 @@ GeneralResult unvalidatedConvert(const NativeHandle& aidlNativeHan return std::make_shared(NN_TRY(unvalidatedConvertHelper(aidlNativeHandle))); } +GeneralResult> unvalidatedConvert( + const std::vector& operations) { + return unvalidatedConvertVec(operations); +} + GeneralResult unvalidatedConvert(const ndk::ScopedFileDescriptor& syncFence) { auto duplicatedFd = NN_TRY(dupFd(syncFence.get())); return SyncFence::create(std::move(duplicatedFd)); @@ -564,22 +544,14 @@ GeneralResult convert(const aidl_hal::Model& model) { return validatedConvert(model); } -GeneralResult convert(const aidl_hal::Operand& operand) { - return unvalidatedConvert(operand); -} - GeneralResult convert(const aidl_hal::OperandType& operandType) { - return unvalidatedConvert(operandType); + return validatedConvert(operandType); } GeneralResult convert(const aidl_hal::Priority& priority) { return validatedConvert(priority); } -GeneralResult convert(const aidl_hal::RequestMemoryPool& memoryPool) { - return unvalidatedConvert(memoryPool); -} - GeneralResult convert(const aidl_hal::Request& request) { return validatedConvert(request); } @@ -589,17 +561,13 @@ GeneralResult convert(const aidl_hal::Timing& timing) { } GeneralResult convert(const ndk::ScopedFileDescriptor& syncFence) { - return unvalidatedConvert(syncFence); + return validatedConvert(syncFence); } GeneralResult> convert(const std::vector& extension) { return validatedConvert(extension); } -GeneralResult> convert(const std::vector& operations) { - return unvalidatedConvert(operations); -} - GeneralResult> convert(const std::vector& memories) { return validatedConvert(memories); } @@ -644,14 +612,7 @@ nn::GeneralResult>> unvalidatedConver template nn::GeneralResult> validatedConvert(const Type& canonical) { - const auto maybeVersion = nn::validate(canonical); - if (!maybeVersion.has_value()) { - return nn::error() << maybeVersion.error(); - } - const auto version = maybeVersion.value(); - if (version > kVersion) { - return NN_ERROR() << "Insufficient version: " << version << " vs required " << kVersion; - } + NN_TRY(compliantVersion(canonical)); return utils::unvalidatedConvert(canonical); } @@ -797,6 +758,9 @@ nn::GeneralResult unvalidatedConvert( } nn::GeneralResult unvalidatedConvert(const nn::OperandType& operandType) { + if (operandType == nn::OperandType::OEM || operandType == nn::OperandType::TENSOR_OEM_BYTE) { + return NN_ERROR() << "Unable to convert invalid OperandType " << operandType; + } return static_cast(operandType); } @@ -864,6 +828,9 @@ nn::GeneralResult unvalidatedConvert(const nn::Operand& operand) { } nn::GeneralResult unvalidatedConvert(const nn::OperationType& operationType) { + if (operationType == nn::OperationType::OEM_OPERATION) { + return NN_ERROR() << "Unable to convert invalid OperationType OEM_OPERATION"; + } return static_cast(operationType); } @@ -1004,7 +971,7 @@ nn::GeneralResult unvalidatedConvertCache( } nn::GeneralResult> convert(const nn::CacheToken& cacheToken) { - return unvalidatedConvert(cacheToken); + return validatedConvert(cacheToken); } nn::GeneralResult convert(const nn::BufferDesc& bufferDesc) { @@ -1076,7 +1043,7 @@ nn::GeneralResult> convert( nn::GeneralResult> convert( const std::vector& syncFences) { - return unvalidatedConvert(syncFences); + return validatedConvert(syncFences); } nn::GeneralResult> toSigned(const std::vector& vec) { diff --git a/neuralnetworks/aidl/vts/functional/ValidateModel.cpp b/neuralnetworks/aidl/vts/functional/ValidateModel.cpp index 6d84e1ed7b..94d3daf6bb 100644 --- a/neuralnetworks/aidl/vts/functional/ValidateModel.cpp +++ b/neuralnetworks/aidl/vts/functional/ValidateModel.cpp @@ -1312,7 +1312,7 @@ static void mutateExecutionPriorityTest(const std::shared_ptr& device, void validateModel(const std::shared_ptr& device, const Model& model) { const auto numberOfConsumers = nn::countNumberOfConsumers(model.main.operands.size(), - nn::convert(model.main.operations).value()) + nn::unvalidatedConvert(model.main.operations).value()) .value(); mutateExecutionOrderTest(device, model, numberOfConsumers); mutateOperandTypeTest(device, model); -- GitLab From bbbdb0d5f118efa8159c3cc98304208fd7631609 Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Wed, 10 Mar 2021 18:41:05 -0800 Subject: [PATCH 035/825] Add additional parameters for NN Burst -- HAL Adds deadline and loopTimeoutDuration to nn::IBurst::execute. This CL additionally adds a test case for IPreparedModel::configureExecutionBurst and adds the suffix "_H" to the header guards that were missing "_H". Bug: 180492058 Bug: 177267324 Test: mma Test: NeuralNetworksTest_static Change-Id: Ic9ba2fb9b4dee4e40d99ae91bb9555a58d0508d2 --- .../1.0/utils/include/nnapi/hal/1.0/Burst.h | 4 +- neuralnetworks/1.0/utils/src/Burst.cpp | 7 +- neuralnetworks/1.0/utils/test/MockDevice.h | 6 +- .../1.0/utils/test/MockPreparedModel.h | 6 +- .../1.0/utils/test/PreparedModelTest.cpp | 14 +++- neuralnetworks/1.1/utils/test/MockDevice.h | 6 +- .../1.1/utils/test/MockPreparedModel.h | 6 +- .../nnapi/hal/1.2/ExecutionBurstController.h | 7 +- .../utils/src/ExecutionBurstController.cpp | 8 +- .../1.2/utils/src/ExecutionBurstServer.cpp | 2 +- .../1.2/utils/src/PreparedModel.cpp | 8 +- .../1.2/utils/test/MockBurstContext.h | 36 ++++++++ neuralnetworks/1.2/utils/test/MockDevice.h | 6 +- .../1.2/utils/test/MockPreparedModel.h | 6 +- .../1.2/utils/test/PreparedModelTest.cpp | 84 ++++++++++++++++++- .../1.3/utils/src/PreparedModel.cpp | 8 +- neuralnetworks/1.3/utils/test/MockBuffer.h | 6 +- .../1.3/utils/test/MockBurstContext.h | 36 ++++++++ neuralnetworks/1.3/utils/test/MockDevice.h | 6 +- .../utils/test/MockFencedExecutionCallback.h | 6 +- .../1.3/utils/test/MockPreparedModel.h | 6 +- .../1.3/utils/test/PreparedModelTest.cpp | 83 +++++++++++++++++- neuralnetworks/aidl/utils/test/MockBuffer.h | 6 +- neuralnetworks/aidl/utils/test/MockDevice.h | 6 +- .../utils/test/MockFencedExecutionCallback.h | 6 +- .../aidl/utils/test/MockPreparedModel.h | 6 +- .../aidl/utils/test/PreparedModelTest.cpp | 14 +++- .../common/include/nnapi/hal/InvalidBurst.h | 4 +- .../common/include/nnapi/hal/ResilientBurst.h | 4 +- .../utils/common/src/InvalidBurst.cpp | 4 +- .../utils/common/src/ResilientBurst.cpp | 8 +- neuralnetworks/utils/common/test/MockBuffer.h | 6 +- neuralnetworks/utils/common/test/MockDevice.h | 6 +- .../utils/common/test/MockPreparedModel.h | 6 +- 34 files changed, 357 insertions(+), 76 deletions(-) create mode 100644 neuralnetworks/1.2/utils/test/MockBurstContext.h create mode 100644 neuralnetworks/1.3/utils/test/MockBurstContext.h diff --git a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Burst.h b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Burst.h index 832930359e..7849ca7a46 100644 --- a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Burst.h +++ b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Burst.h @@ -44,7 +44,9 @@ class Burst final : public nn::IBurst { OptionalCacheHold cacheMemory(const nn::SharedMemory& memory) const override; nn::ExecutionResult, nn::Timing>> execute( - const nn::Request& request, nn::MeasureTiming measure) const override; + const nn::Request& request, nn::MeasureTiming measure, + const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration) const override; private: const nn::SharedPreparedModel kPreparedModel; diff --git a/neuralnetworks/1.0/utils/src/Burst.cpp b/neuralnetworks/1.0/utils/src/Burst.cpp index 971ad08015..e3a97579cd 100644 --- a/neuralnetworks/1.0/utils/src/Burst.cpp +++ b/neuralnetworks/1.0/utils/src/Burst.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -48,8 +49,10 @@ Burst::OptionalCacheHold Burst::cacheMemory(const nn::SharedMemory& /*memory*/) } nn::ExecutionResult, nn::Timing>> Burst::execute( - const nn::Request& request, nn::MeasureTiming measure) const { - return kPreparedModel->execute(request, measure, {}, {}); + const nn::Request& request, nn::MeasureTiming measure, + const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration) const { + return kPreparedModel->execute(request, measure, deadline, loopTimeoutDuration); } } // namespace android::hardware::neuralnetworks::V1_0::utils diff --git a/neuralnetworks/1.0/utils/test/MockDevice.h b/neuralnetworks/1.0/utils/test/MockDevice.h index 0fb59e3a63..7c399ec580 100644 --- a/neuralnetworks/1.0/utils/test/MockDevice.h +++ b/neuralnetworks/1.0/utils/test/MockDevice.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_0_UTILS_TEST_MOCK_DEVICE -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_0_UTILS_TEST_MOCK_DEVICE +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_0_UTILS_TEST_MOCK_DEVICE_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_0_UTILS_TEST_MOCK_DEVICE_H #include #include @@ -83,4 +83,4 @@ inline void MockDevice::simulateCrash() { } // namespace android::hardware::neuralnetworks::V1_0::utils -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_0_UTILS_TEST_MOCK_DEVICE +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_0_UTILS_TEST_MOCK_DEVICE_H diff --git a/neuralnetworks/1.0/utils/test/MockPreparedModel.h b/neuralnetworks/1.0/utils/test/MockPreparedModel.h index 7a48a834ac..03f1a4bea3 100644 --- a/neuralnetworks/1.0/utils/test/MockPreparedModel.h +++ b/neuralnetworks/1.0/utils/test/MockPreparedModel.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_0_UTILS_TEST_MOCK_PREPARED_MODEL -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_0_UTILS_TEST_MOCK_PREPARED_MODEL +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_0_UTILS_TEST_MOCK_PREPARED_MODEL_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_0_UTILS_TEST_MOCK_PREPARED_MODEL_H #include #include @@ -82,4 +82,4 @@ inline void MockPreparedModel::simulateCrash() { } // namespace android::hardware::neuralnetworks::V1_0::utils -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_0_UTILS_TEST_MOCK_PREPARED_MODEL +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_0_UTILS_TEST_MOCK_PREPARED_MODEL_H diff --git a/neuralnetworks/1.0/utils/test/PreparedModelTest.cpp b/neuralnetworks/1.0/utils/test/PreparedModelTest.cpp index a5cbc72a71..f19ed7756e 100644 --- a/neuralnetworks/1.0/utils/test/PreparedModelTest.cpp +++ b/neuralnetworks/1.0/utils/test/PreparedModelTest.cpp @@ -224,7 +224,19 @@ TEST(PreparedModelTest, executeFencedNotSupported) { EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); } -// TODO: test burst execution if/when it is added to nn::IPreparedModel. +TEST(PreparedModelTest, configureExecutionBurst) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + + // run test + const auto result = preparedModel->configureExecutionBurst(); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + EXPECT_NE(result.value(), nullptr); +} TEST(PreparedModelTest, getUnderlyingResource) { // setup test diff --git a/neuralnetworks/1.1/utils/test/MockDevice.h b/neuralnetworks/1.1/utils/test/MockDevice.h index 3b92e58102..db7392d2cb 100644 --- a/neuralnetworks/1.1/utils/test/MockDevice.h +++ b/neuralnetworks/1.1/utils/test/MockDevice.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_1_UTILS_TEST_MOCK_DEVICE -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_1_UTILS_TEST_MOCK_DEVICE +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_1_UTILS_TEST_MOCK_DEVICE_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_1_UTILS_TEST_MOCK_DEVICE_H #include #include @@ -92,4 +92,4 @@ inline void MockDevice::simulateCrash() { } // namespace android::hardware::neuralnetworks::V1_1::utils -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_1_UTILS_TEST_MOCK_DEVICE +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_1_UTILS_TEST_MOCK_DEVICE_H diff --git a/neuralnetworks/1.1/utils/test/MockPreparedModel.h b/neuralnetworks/1.1/utils/test/MockPreparedModel.h index aba731efa1..257397da2c 100644 --- a/neuralnetworks/1.1/utils/test/MockPreparedModel.h +++ b/neuralnetworks/1.1/utils/test/MockPreparedModel.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_1_UTILS_TEST_MOCK_PREPARED_MODEL -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_1_UTILS_TEST_MOCK_PREPARED_MODEL +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_1_UTILS_TEST_MOCK_PREPARED_MODEL_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_1_UTILS_TEST_MOCK_PREPARED_MODEL_H #include #include @@ -41,4 +41,4 @@ inline sp MockPreparedModel::create() { } // namespace android::hardware::neuralnetworks::V1_0::utils -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_1_UTILS_TEST_MOCK_PREPARED_MODEL +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_1_UTILS_TEST_MOCK_PREPARED_MODEL_H diff --git a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstController.h b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstController.h index 6b6fc71f65..9669d8c031 100644 --- a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstController.h +++ b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/ExecutionBurstController.h @@ -57,7 +57,8 @@ class ExecutionBurstController final : public nn::IBurst { public: using FallbackFunction = std::function, nn::Timing>>( - const nn::Request&, nn::MeasureTiming)>; + const nn::Request&, nn::MeasureTiming, const nn::OptionalTimePoint&, + const nn::OptionalDuration&)>; /** * NN runtime memory cache. @@ -168,7 +169,9 @@ class ExecutionBurstController final : public nn::IBurst { // See IBurst::execute for information on this method. nn::ExecutionResult, nn::Timing>> execute( - const nn::Request& request, nn::MeasureTiming measure) const override; + const nn::Request& request, nn::MeasureTiming measure, + const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration) const override; private: mutable std::atomic_flag mExecutionInFlight = ATOMIC_FLAG_INIT; diff --git a/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp b/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp index eedf5916bc..7a17f257c2 100644 --- a/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp +++ b/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp @@ -276,7 +276,9 @@ ExecutionBurstController::OptionalCacheHold ExecutionBurstController::cacheMemor } nn::ExecutionResult, nn::Timing>> -ExecutionBurstController::execute(const nn::Request& request, nn::MeasureTiming measure) const { +ExecutionBurstController::execute(const nn::Request& request, nn::MeasureTiming measure, + const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration) const { // This is the first point when we know an execution is occurring, so begin to collect // systraces. Note that the first point we can begin collecting systraces in // ExecutionBurstServer is when the RequestChannelReceiver realizes there is data in the FMQ, so @@ -289,7 +291,7 @@ ExecutionBurstController::execute(const nn::Request& request, nn::MeasureTiming version > nn::Version::ANDROID_Q) { // fallback to another execution path if the packet could not be sent if (kFallback) { - return kFallback(request, measure); + return kFallback(request, measure, deadline, loopTimeoutDuration); } return NN_ERROR() << "Request object has features not supported by IBurst::execute"; } @@ -323,7 +325,7 @@ ExecutionBurstController::execute(const nn::Request& request, nn::MeasureTiming if (!sendStatus.ok()) { // fallback to another execution path if the packet could not be sent if (kFallback) { - return kFallback(request, measure); + return kFallback(request, measure, deadline, loopTimeoutDuration); } return NN_ERROR() << "Error sending FMQ packet: " << sendStatus.error(); } diff --git a/neuralnetworks/1.2/utils/src/ExecutionBurstServer.cpp b/neuralnetworks/1.2/utils/src/ExecutionBurstServer.cpp index 50af881d23..c67159e895 100644 --- a/neuralnetworks/1.2/utils/src/ExecutionBurstServer.cpp +++ b/neuralnetworks/1.2/utils/src/ExecutionBurstServer.cpp @@ -259,7 +259,7 @@ nn::ExecutionResult, Timing>> ExecutionBurstServ nn::MeasureTiming canonicalMeasure = NN_TRY(makeExecutionFailure(nn::convert(measure))); const auto [outputShapes, timing] = - NN_TRY(mBurstExecutor->execute(canonicalRequest, canonicalMeasure)); + NN_TRY(mBurstExecutor->execute(canonicalRequest, canonicalMeasure, {}, {})); return std::make_pair(NN_TRY(makeExecutionFailure(convert(outputShapes))), NN_TRY(makeExecutionFailure(convert(timing)))); diff --git a/neuralnetworks/1.2/utils/src/PreparedModel.cpp b/neuralnetworks/1.2/utils/src/PreparedModel.cpp index 71a4ea872b..b209a44eba 100644 --- a/neuralnetworks/1.2/utils/src/PreparedModel.cpp +++ b/neuralnetworks/1.2/utils/src/PreparedModel.cpp @@ -122,10 +122,12 @@ PreparedModel::executeFenced(const nn::Request& /*request*/, nn::GeneralResult PreparedModel::configureExecutionBurst() const { auto self = shared_from_this(); - auto fallback = [preparedModel = std::move(self)](const nn::Request& request, - nn::MeasureTiming measure) + auto fallback = [preparedModel = std::move(self)]( + const nn::Request& request, nn::MeasureTiming measure, + const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration) -> nn::ExecutionResult, nn::Timing>> { - return preparedModel->execute(request, measure, {}, {}); + return preparedModel->execute(request, measure, deadline, loopTimeoutDuration); }; const auto pollingTimeWindow = getBurstControllerPollingTimeWindow(); return ExecutionBurstController::create(kPreparedModel, std::move(fallback), pollingTimeWindow); diff --git a/neuralnetworks/1.2/utils/test/MockBurstContext.h b/neuralnetworks/1.2/utils/test/MockBurstContext.h new file mode 100644 index 0000000000..e364178ce4 --- /dev/null +++ b/neuralnetworks/1.2/utils/test/MockBurstContext.h @@ -0,0 +1,36 @@ +/* + * 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_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_BURST_CONTEXT_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_BURST_CONTEXT_H + +#include +#include +#include +#include +#include + +namespace android::hardware::neuralnetworks::V1_2::utils { + +class MockBurstContext final : public IBurstContext { + public: + // V1_2 methods below. + MOCK_METHOD(Return, freeMemory, (int32_t slot), (override)); +}; + +} // namespace android::hardware::neuralnetworks::V1_2::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_BURST_CONTEXT_H diff --git a/neuralnetworks/1.2/utils/test/MockDevice.h b/neuralnetworks/1.2/utils/test/MockDevice.h index b4599430a2..0d34c70f1b 100644 --- a/neuralnetworks/1.2/utils/test/MockDevice.h +++ b/neuralnetworks/1.2/utils/test/MockDevice.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_DEVICE -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_DEVICE +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_DEVICE_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_DEVICE_H #include #include @@ -114,4 +114,4 @@ inline void MockDevice::simulateCrash() { } // namespace android::hardware::neuralnetworks::V1_2::utils -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_DEVICE +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_DEVICE_H diff --git a/neuralnetworks/1.2/utils/test/MockPreparedModel.h b/neuralnetworks/1.2/utils/test/MockPreparedModel.h index f5fd1f3204..bd81712731 100644 --- a/neuralnetworks/1.2/utils/test/MockPreparedModel.h +++ b/neuralnetworks/1.2/utils/test/MockPreparedModel.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_PREPARED_MODEL -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_PREPARED_MODEL +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_PREPARED_MODEL_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_PREPARED_MODEL_H #include #include @@ -98,4 +98,4 @@ inline void MockPreparedModel::simulateCrash() { } // namespace android::hardware::neuralnetworks::V1_2::utils -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_PREPARED_MODEL +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_2_UTILS_TEST_MOCK_PREPARED_MODEL_H diff --git a/neuralnetworks/1.2/utils/test/PreparedModelTest.cpp b/neuralnetworks/1.2/utils/test/PreparedModelTest.cpp index 5062ac9a97..d297b1a417 100644 --- a/neuralnetworks/1.2/utils/test/PreparedModelTest.cpp +++ b/neuralnetworks/1.2/utils/test/PreparedModelTest.cpp @@ -16,6 +16,8 @@ #include "MockPreparedModel.h" +#include "MockBurstContext.h" + #include #include #include @@ -67,6 +69,17 @@ auto makeExecuteAsynchronously(V1_0::ErrorStatus launchStatus, V1_0::ErrorStatus return launchStatus; }; } +auto makeConfigureExecutionBurstReturn(V1_0::ErrorStatus status, + const sp& burstContext) { + return [status, burstContext]( + const sp& /*callback*/, + const MQDescriptorSync& /*requestChannel*/, + const MQDescriptorSync& /*resultChannel*/, + V1_2::IPreparedModel::configureExecutionBurst_cb cb) -> hardware::Return { + cb(status, burstContext); + return hardware::Void(); + }; +} std::function makeTransportFailure(status_t status) { return [status] { return hardware::Status::fromStatusT(status); }; @@ -321,7 +334,76 @@ TEST(PreparedModelTest, executeFencedNotSupported) { EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); } -// TODO: test burst execution if/when it is added to nn::IPreparedModel. +TEST(PreparedModelTest, configureExecutionBurst) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto mockBurstContext = sp::make(); + EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce(makeConfigureExecutionBurstReturn(V1_0::ErrorStatus::NONE, mockBurstContext)); + const auto preparedModel = + PreparedModel::create(mockPreparedModel, /*executeSynchronously=*/true).value(); + + // run test + const auto result = preparedModel->configureExecutionBurst(); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + EXPECT_NE(result.value(), nullptr); +} + +TEST(PreparedModelTest, configureExecutionBurstError) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = + PreparedModel::create(mockPreparedModel, /*executeSynchronously=*/true).value(); + EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce( + makeConfigureExecutionBurstReturn(V1_0::ErrorStatus::GENERAL_FAILURE, nullptr)); + + // run test + const auto result = preparedModel->configureExecutionBurst(); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(PreparedModelTest, configureExecutionBurstTransportFailure) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = + PreparedModel::create(mockPreparedModel, /*executeSynchronously=*/true).value(); + EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = preparedModel->configureExecutionBurst(); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(PreparedModelTest, configureExecutionBurstDeadObject) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = + PreparedModel::create(mockPreparedModel, /*executeSynchronously=*/true).value(); + EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = preparedModel->configureExecutionBurst(); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} TEST(PreparedModelTest, getUnderlyingResource) { // setup test diff --git a/neuralnetworks/1.3/utils/src/PreparedModel.cpp b/neuralnetworks/1.3/utils/src/PreparedModel.cpp index 64275a3729..fd7f8f2ba8 100644 --- a/neuralnetworks/1.3/utils/src/PreparedModel.cpp +++ b/neuralnetworks/1.3/utils/src/PreparedModel.cpp @@ -201,10 +201,12 @@ PreparedModel::executeFenced(const nn::Request& request, const std::vector PreparedModel::configureExecutionBurst() const { auto self = shared_from_this(); - auto fallback = [preparedModel = std::move(self)](const nn::Request& request, - nn::MeasureTiming measure) + auto fallback = [preparedModel = std::move(self)]( + const nn::Request& request, nn::MeasureTiming measure, + const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration) -> nn::ExecutionResult, nn::Timing>> { - return preparedModel->execute(request, measure, {}, {}); + return preparedModel->execute(request, measure, deadline, loopTimeoutDuration); }; const auto pollingTimeWindow = V1_2::utils::getBurstControllerPollingTimeWindow(); return V1_2::utils::ExecutionBurstController::create(kPreparedModel, std::move(fallback), diff --git a/neuralnetworks/1.3/utils/test/MockBuffer.h b/neuralnetworks/1.3/utils/test/MockBuffer.h index fb31b51261..a67c5f613e 100644 --- a/neuralnetworks/1.3/utils/test/MockBuffer.h +++ b/neuralnetworks/1.3/utils/test/MockBuffer.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_BUFFER -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_BUFFER +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_BUFFER_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_BUFFER_H #include #include @@ -40,4 +40,4 @@ inline sp MockBuffer::create() { } // namespace android::hardware::neuralnetworks::V1_3::utils -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_BUFFER +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_BUFFER_H diff --git a/neuralnetworks/1.3/utils/test/MockBurstContext.h b/neuralnetworks/1.3/utils/test/MockBurstContext.h new file mode 100644 index 0000000000..e102b46dfa --- /dev/null +++ b/neuralnetworks/1.3/utils/test/MockBurstContext.h @@ -0,0 +1,36 @@ +/* + * 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_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_BURST_CONTEXT_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_BURST_CONTEXT_H + +#include +#include +#include +#include +#include + +namespace android::hardware::neuralnetworks::V1_3::utils { + +class MockBurstContext final : public V1_2::IBurstContext { + public: + // V1_2 methods below. + MOCK_METHOD(Return, freeMemory, (int32_t slot), (override)); +}; + +} // namespace android::hardware::neuralnetworks::V1_3::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_BURST_CONTEXT_H diff --git a/neuralnetworks/1.3/utils/test/MockDevice.h b/neuralnetworks/1.3/utils/test/MockDevice.h index 85d3750d22..b79037f5c4 100644 --- a/neuralnetworks/1.3/utils/test/MockDevice.h +++ b/neuralnetworks/1.3/utils/test/MockDevice.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_DEVICE -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_DEVICE +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_DEVICE_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_DEVICE_H #include #include @@ -136,4 +136,4 @@ inline void MockDevice::simulateCrash() { } // namespace android::hardware::neuralnetworks::V1_3::utils -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_DEVICE +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_DEVICE_H diff --git a/neuralnetworks/1.3/utils/test/MockFencedExecutionCallback.h b/neuralnetworks/1.3/utils/test/MockFencedExecutionCallback.h index fc08a7fc70..04c0a9298b 100644 --- a/neuralnetworks/1.3/utils/test/MockFencedExecutionCallback.h +++ b/neuralnetworks/1.3/utils/test/MockFencedExecutionCallback.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK_H #include #include @@ -39,4 +39,4 @@ inline sp MockFencedExecutionCallback::create() { } // namespace android::hardware::neuralnetworks::V1_3::utils -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK_H diff --git a/neuralnetworks/1.3/utils/test/MockPreparedModel.h b/neuralnetworks/1.3/utils/test/MockPreparedModel.h index e44152426b..ef64fa45c8 100644 --- a/neuralnetworks/1.3/utils/test/MockPreparedModel.h +++ b/neuralnetworks/1.3/utils/test/MockPreparedModel.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_PREPARED_MODEL -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_PREPARED_MODEL +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_PREPARED_MODEL_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_PREPARED_MODEL_H #include #include @@ -118,4 +118,4 @@ inline void MockPreparedModel::simulateCrash() { } // namespace android::hardware::neuralnetworks::V1_3::utils -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_PREPARED_MODEL +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_1_3_UTILS_TEST_MOCK_PREPARED_MODEL_H diff --git a/neuralnetworks/1.3/utils/test/PreparedModelTest.cpp b/neuralnetworks/1.3/utils/test/PreparedModelTest.cpp index 11796ddc2d..5303c2ad23 100644 --- a/neuralnetworks/1.3/utils/test/PreparedModelTest.cpp +++ b/neuralnetworks/1.3/utils/test/PreparedModelTest.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "MockBurstContext.h" #include "MockFencedExecutionCallback.h" #include "MockPreparedModel.h" @@ -96,6 +97,17 @@ auto makeExecuteFencedCallbackReturn(V1_3::ErrorStatus status, const V1_2::Timin return hardware::Void(); }; } +auto makeConfigureExecutionBurstReturn(V1_0::ErrorStatus status, + const sp& burstContext) { + return [status, burstContext]( + const sp& /*callback*/, + const MQDescriptorSync& /*requestChannel*/, + const MQDescriptorSync& /*resultChannel*/, + V1_2::IPreparedModel::configureExecutionBurst_cb cb) -> hardware::Return { + cb(status, burstContext); + return hardware::Void(); + }; +} std::function makeTransportFailure(status_t status) { return [status] { return hardware::Status::fromStatusT(status); }; @@ -450,7 +462,76 @@ TEST(PreparedModelTest, executeFencedDeadObject) { EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); } -// TODO: test burst execution if/when it is added to nn::IPreparedModel. +TEST(PreparedModelTest, configureExecutionBurst) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto mockBurstContext = sp::make(); + EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce(makeConfigureExecutionBurstReturn(V1_0::ErrorStatus::NONE, mockBurstContext)); + const auto preparedModel = + PreparedModel::create(mockPreparedModel, /*executeSynchronously=*/true).value(); + + // run test + const auto result = preparedModel->configureExecutionBurst(); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + EXPECT_NE(result.value(), nullptr); +} + +TEST(PreparedModelTest, configureExecutionBurstError) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = + PreparedModel::create(mockPreparedModel, /*executeSynchronously=*/true).value(); + EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce( + makeConfigureExecutionBurstReturn(V1_0::ErrorStatus::GENERAL_FAILURE, nullptr)); + + // run test + const auto result = preparedModel->configureExecutionBurst(); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(PreparedModelTest, configureExecutionBurstTransportFailure) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = + PreparedModel::create(mockPreparedModel, /*executeSynchronously=*/true).value(); + EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = preparedModel->configureExecutionBurst(); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(PreparedModelTest, configureExecutionBurstDeadObject) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = + PreparedModel::create(mockPreparedModel, /*executeSynchronously=*/true).value(); + EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = preparedModel->configureExecutionBurst(); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} TEST(PreparedModelTest, getUnderlyingResource) { // setup test diff --git a/neuralnetworks/aidl/utils/test/MockBuffer.h b/neuralnetworks/aidl/utils/test/MockBuffer.h index 5746176116..f77fa86953 100644 --- a/neuralnetworks/aidl/utils/test/MockBuffer.h +++ b/neuralnetworks/aidl/utils/test/MockBuffer.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_BUFFER -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_BUFFER +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_BUFFER_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_BUFFER_H #include #include @@ -40,4 +40,4 @@ inline std::shared_ptr MockBuffer::create() { } // namespace aidl::android::hardware::neuralnetworks::utils -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_BUFFER +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_BUFFER_H diff --git a/neuralnetworks/aidl/utils/test/MockDevice.h b/neuralnetworks/aidl/utils/test/MockDevice.h index 9b35bf8f81..3a28d55580 100644 --- a/neuralnetworks/aidl/utils/test/MockDevice.h +++ b/neuralnetworks/aidl/utils/test/MockDevice.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_DEVICE -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_DEVICE +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_DEVICE_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_DEVICE_H #include #include @@ -64,4 +64,4 @@ inline std::shared_ptr MockDevice::create() { } // namespace aidl::android::hardware::neuralnetworks::utils -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_DEVICE +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_DEVICE_H diff --git a/neuralnetworks/aidl/utils/test/MockFencedExecutionCallback.h b/neuralnetworks/aidl/utils/test/MockFencedExecutionCallback.h index 463e1c9700..06f9ea2e41 100644 --- a/neuralnetworks/aidl/utils/test/MockFencedExecutionCallback.h +++ b/neuralnetworks/aidl/utils/test/MockFencedExecutionCallback.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK_H #include #include @@ -42,4 +42,4 @@ inline std::shared_ptr MockFencedExecutionCallback: } // namespace aidl::android::hardware::neuralnetworks::utils -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_FENCED_EXECUTION_CALLBACK_H diff --git a/neuralnetworks/aidl/utils/test/MockPreparedModel.h b/neuralnetworks/aidl/utils/test/MockPreparedModel.h index 36e0ec392d..a4ae2b778a 100644 --- a/neuralnetworks/aidl/utils/test/MockPreparedModel.h +++ b/neuralnetworks/aidl/utils/test/MockPreparedModel.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_PREPARED_MODEL -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_PREPARED_MODEL +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_PREPARED_MODEL_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_PREPARED_MODEL_H #include #include @@ -49,4 +49,4 @@ inline std::shared_ptr MockPreparedModel::create() { } // namespace aidl::android::hardware::neuralnetworks::utils -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_PREPARED_MODEL +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_PREPARED_MODEL_H diff --git a/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp b/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp index 7e28861054..83304bc103 100644 --- a/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp +++ b/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp @@ -252,7 +252,19 @@ TEST(PreparedModelTest, executeFencedDeadObject) { EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); } -// TODO: test burst execution if/when it is added to nn::IPreparedModel. +TEST(PreparedModelTest, configureExecutionBurst) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + + // run test + const auto result = preparedModel->configureExecutionBurst(); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + EXPECT_NE(result.value(), nullptr); +} TEST(PreparedModelTest, getUnderlyingResource) { // setup test diff --git a/neuralnetworks/utils/common/include/nnapi/hal/InvalidBurst.h b/neuralnetworks/utils/common/include/nnapi/hal/InvalidBurst.h index 996858cd55..17b3fd9d2b 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/InvalidBurst.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/InvalidBurst.h @@ -32,7 +32,9 @@ class InvalidBurst final : public nn::IBurst { OptionalCacheHold cacheMemory(const nn::SharedMemory& memory) const override; nn::ExecutionResult, nn::Timing>> execute( - const nn::Request& request, nn::MeasureTiming measure) const override; + const nn::Request& request, nn::MeasureTiming measure, + const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration) const override; }; } // namespace android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/utils/common/include/nnapi/hal/ResilientBurst.h b/neuralnetworks/utils/common/include/nnapi/hal/ResilientBurst.h index 3b87330872..c92cc41dae 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/ResilientBurst.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/ResilientBurst.h @@ -47,7 +47,9 @@ class ResilientBurst final : public nn::IBurst, OptionalCacheHold cacheMemory(const nn::SharedMemory& memory) const override; nn::ExecutionResult, nn::Timing>> execute( - const nn::Request& request, nn::MeasureTiming measure) const override; + const nn::Request& request, nn::MeasureTiming measure, + const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration) const override; private: const Factory kMakeBurst; diff --git a/neuralnetworks/utils/common/src/InvalidBurst.cpp b/neuralnetworks/utils/common/src/InvalidBurst.cpp index 81ca18d259..0c34f05265 100644 --- a/neuralnetworks/utils/common/src/InvalidBurst.cpp +++ b/neuralnetworks/utils/common/src/InvalidBurst.cpp @@ -32,7 +32,9 @@ InvalidBurst::OptionalCacheHold InvalidBurst::cacheMemory( } nn::ExecutionResult, nn::Timing>> InvalidBurst::execute( - const nn::Request& /*request*/, nn::MeasureTiming /*measure*/) const { + const nn::Request& /*request*/, nn::MeasureTiming /*measure*/, + const nn::OptionalTimePoint& /*deadline*/, + const nn::OptionalDuration& /*loopTimeoutDuration*/) const { return NN_ERROR() << "InvalidBurst"; } diff --git a/neuralnetworks/utils/common/src/ResilientBurst.cpp b/neuralnetworks/utils/common/src/ResilientBurst.cpp index 5ca868bc9a..38ccc62156 100644 --- a/neuralnetworks/utils/common/src/ResilientBurst.cpp +++ b/neuralnetworks/utils/common/src/ResilientBurst.cpp @@ -100,9 +100,11 @@ ResilientBurst::OptionalCacheHold ResilientBurst::cacheMemory( } nn::ExecutionResult, nn::Timing>> ResilientBurst::execute( - const nn::Request& request, nn::MeasureTiming measure) const { - const auto fn = [&request, measure](const nn::IBurst& burst) { - return burst.execute(request, measure); + const nn::Request& request, nn::MeasureTiming measure, + const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration) const { + const auto fn = [&request, measure, deadline, loopTimeoutDuration](const nn::IBurst& burst) { + return burst.execute(request, measure, deadline, loopTimeoutDuration); }; return protect(*this, fn); } diff --git a/neuralnetworks/utils/common/test/MockBuffer.h b/neuralnetworks/utils/common/test/MockBuffer.h index 59d57007ae..3599d0c988 100644 --- a/neuralnetworks/utils/common/test/MockBuffer.h +++ b/neuralnetworks/utils/common/test/MockBuffer.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_BUFFER -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_BUFFER +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_BUFFER_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_BUFFER_H #include #include @@ -34,4 +34,4 @@ class MockBuffer final : public IBuffer { } // namespace android::nn -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_BUFFER +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_BUFFER_H diff --git a/neuralnetworks/utils/common/test/MockDevice.h b/neuralnetworks/utils/common/test/MockDevice.h index 5566968c68..b274716882 100644 --- a/neuralnetworks/utils/common/test/MockDevice.h +++ b/neuralnetworks/utils/common/test/MockDevice.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_DEVICE -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_DEVICE +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_DEVICE_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_DEVICE_H #include #include @@ -55,4 +55,4 @@ class MockDevice final : public IDevice { } // namespace android::nn -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_DEVICE +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_DEVICE_H diff --git a/neuralnetworks/utils/common/test/MockPreparedModel.h b/neuralnetworks/utils/common/test/MockPreparedModel.h index 418af61666..c0048615ef 100644 --- a/neuralnetworks/utils/common/test/MockPreparedModel.h +++ b/neuralnetworks/utils/common/test/MockPreparedModel.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_PREPARED_MODEL -#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_PREPARED_MODEL +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_PREPARED_MODEL_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_PREPARED_MODEL_H #include #include @@ -41,4 +41,4 @@ class MockPreparedModel final : public IPreparedModel { } // namespace android::nn -#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_PREPARED_MODEL +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_COMMON_TEST_MOCK_PREPARED_MODEL_H -- GitLab From 504f44926c0e0ce0a5b5a591dbb848fdb732d8b2 Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Wed, 10 Mar 2021 21:57:13 -0800 Subject: [PATCH 036/825] Create NN AIDL Burst adapter Bug: 180492058 Bug: 177267324 Test: mma Test: NeuralNetworksTest_static Change-Id: I2947faeb3820faa963e4df1eaf7aefec57b66c79 --- neuralnetworks/aidl/utils/Android.bp | 1 - .../aidl/utils/include/nnapi/hal/aidl/Burst.h | 111 ++++++++++ .../include/nnapi/hal/aidl/PreparedModel.h | 4 +- neuralnetworks/aidl/utils/src/Burst.cpp | 197 ++++++++++++++++++ .../aidl/utils/src/PreparedModel.cpp | 8 +- neuralnetworks/aidl/utils/test/MockBurst.h | 41 ++++ .../aidl/utils/test/PreparedModelTest.cpp | 53 +++++ 7 files changed, 408 insertions(+), 7 deletions(-) create mode 100644 neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Burst.h create mode 100644 neuralnetworks/aidl/utils/src/Burst.cpp create mode 100644 neuralnetworks/aidl/utils/test/MockBurst.h diff --git a/neuralnetworks/aidl/utils/Android.bp b/neuralnetworks/aidl/utils/Android.bp index 476dac9d4d..ad961cfe99 100644 --- a/neuralnetworks/aidl/utils/Android.bp +++ b/neuralnetworks/aidl/utils/Android.bp @@ -34,7 +34,6 @@ cc_library_static { "libarect", "neuralnetworks_types", "neuralnetworks_utils_hal_common", - "neuralnetworks_utils_hal_1_0", ], shared_libs: [ "android.hardware.neuralnetworks-V1-ndk_platform", diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Burst.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Burst.h new file mode 100644 index 0000000000..008e4e4fe3 --- /dev/null +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Burst.h @@ -0,0 +1,111 @@ +/* + * 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_INTERFACES_NEURALNETWORKS_AIDL_UTILS_BURST_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_BURST_H + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on AIDL interface +// lifetimes across processes and for protecting asynchronous calls across AIDL. + +namespace aidl::android::hardware::neuralnetworks::utils { + +// Class that adapts aidl_hal::IBurst to nn::IBurst. +class Burst final : public nn::IBurst { + struct PrivateConstructorTag {}; + + public: + /** + * Thread-safe, self-cleaning cache that relates an nn::Memory object to a unique int64_t + * identifier. + */ + class MemoryCache : public std::enable_shared_from_this { + public: + using Task = std::function; + using Cleanup = ::android::base::ScopeGuard; + using SharedCleanup = std::shared_ptr; + using WeakCleanup = std::weak_ptr; + + explicit MemoryCache(std::shared_ptr burst); + + /** + * Get or cache a memory object in the MemoryCache object. + * + * @param memory Memory object to be cached while the returned `SharedCleanup` is alive. + * @return A pair of (1) a unique identifier for the cache entry and (2) a ref-counted + * "hold" object which preserves the cache as long as the hold object is alive. + */ + std::pair getOrCacheMemory(const nn::SharedMemory& memory); + + /** + * Get a cached memory object in the MemoryCache object if it exists, otherwise + * std::nullopt. + * + * @param memory Memory object to be cached while the returned `SharedCleanup` is alive. + * @return A pair of (1) a unique identifier for the cache entry and (2) a ref-counted + * "hold" object which preserves the cache as long as the hold object is alive. IF the + * cache entry is not present, std::nullopt is returned instead. + */ + std::optional> getMemoryIfAvailable( + const nn::SharedMemory& memory); + + private: + void tryFreeMemory(const nn::SharedMemory& memory, int64_t identifier); + + const std::shared_ptr kBurst; + std::mutex mMutex; + int64_t mUnusedIdentifier GUARDED_BY(mMutex) = 0; + std::unordered_map> mCache + GUARDED_BY(mMutex); + }; + + static nn::GeneralResult> create( + std::shared_ptr burst); + + Burst(PrivateConstructorTag tag, std::shared_ptr burst); + + // See IBurst::cacheMemory for information. + OptionalCacheHold cacheMemory(const nn::SharedMemory& memory) const override; + + // See IBurst::execute for information. + nn::ExecutionResult, nn::Timing>> execute( + const nn::Request& request, nn::MeasureTiming measure, + const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration) const override; + + private: + mutable std::atomic_flag mExecutionInFlight = ATOMIC_FLAG_INIT; + const std::shared_ptr kBurst; + const std::shared_ptr kMemoryCache; +}; + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_BURST_H diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h index 9b28588610..abce6cc3aa 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -35,8 +34,7 @@ namespace aidl::android::hardware::neuralnetworks::utils { // Class that adapts aidl_hal::IPreparedModel to nn::IPreparedModel. -class PreparedModel final : public nn::IPreparedModel, - public std::enable_shared_from_this { +class PreparedModel final : public nn::IPreparedModel { struct PrivateConstructorTag {}; public: diff --git a/neuralnetworks/aidl/utils/src/Burst.cpp b/neuralnetworks/aidl/utils/src/Burst.cpp new file mode 100644 index 0000000000..0b475bcf53 --- /dev/null +++ b/neuralnetworks/aidl/utils/src/Burst.cpp @@ -0,0 +1,197 @@ +/* + * 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 "Burst.h" + +#include "Conversions.h" +#include "Utils.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace aidl::android::hardware::neuralnetworks::utils { +namespace { + +nn::GeneralResult, nn::Timing>> convertExecutionResults( + const std::vector& outputShapes, const Timing& timing) { + return std::make_pair(NN_TRY(nn::convert(outputShapes)), NN_TRY(nn::convert(timing))); +} + +} // namespace + +Burst::MemoryCache::MemoryCache(std::shared_ptr burst) + : kBurst(std::move(burst)) {} + +std::pair Burst::MemoryCache::getOrCacheMemory( + const nn::SharedMemory& memory) { + std::lock_guard lock(mMutex); + + // Get the cache payload or create it (with default values) if it does not exist. + auto& cachedPayload = mCache[memory]; + { + const auto& [identifier, maybeCleaner] = cachedPayload; + // If cache payload already exists, reuse it. + if (auto cleaner = maybeCleaner.lock()) { + return std::make_pair(identifier, std::move(cleaner)); + } + } + + // If the code reaches this point, the cached payload either did not exist or expired prior to + // this call. + + // Allocate a new identifier. + CHECK_LT(mUnusedIdentifier, std::numeric_limits::max()); + const int64_t identifier = mUnusedIdentifier++; + + // Create reference-counted self-cleaning cache object. + auto self = weak_from_this(); + Task cleanup = [memory, identifier, maybeMemoryCache = std::move(self)] { + if (const auto memoryCache = maybeMemoryCache.lock()) { + memoryCache->tryFreeMemory(memory, identifier); + } + }; + auto cleaner = std::make_shared(std::move(cleanup)); + + // Store the result in the cache and return it. + auto result = std::make_pair(identifier, std::move(cleaner)); + cachedPayload = result; + return result; +} + +std::optional> +Burst::MemoryCache::getMemoryIfAvailable(const nn::SharedMemory& memory) { + std::lock_guard lock(mMutex); + + // Get the existing cached entry if it exists. + const auto iter = mCache.find(memory); + if (iter != mCache.end()) { + const auto& [identifier, maybeCleaner] = iter->second; + if (auto cleaner = maybeCleaner.lock()) { + return std::make_pair(identifier, std::move(cleaner)); + } + } + + // If the code reaches this point, the cached payload did not exist or was actively being + // deleted. + return std::nullopt; +} + +void Burst::MemoryCache::tryFreeMemory(const nn::SharedMemory& memory, int64_t identifier) { + { + std::lock_guard guard(mMutex); + // Remove the cached memory and payload if it is present but expired. Note that it may not + // be present or may not be expired because another thread may have removed or cached the + // same memory object before the current thread locked mMutex in tryFreeMemory. + const auto iter = mCache.find(memory); + if (iter != mCache.end()) { + if (std::get(iter->second).expired()) { + mCache.erase(iter); + } + } + } + kBurst->releaseMemoryResource(identifier); +} + +nn::GeneralResult> Burst::create( + std::shared_ptr burst) { + if (burst == nullptr) { + return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) + << "aidl_hal::utils::Burst::create must have non-null burst"; + } + + return std::make_shared(PrivateConstructorTag{}, std::move(burst)); +} + +Burst::Burst(PrivateConstructorTag /*tag*/, std::shared_ptr burst) + : kBurst(std::move(burst)), kMemoryCache(std::make_shared(kBurst)) { + CHECK(kBurst != nullptr); +} + +Burst::OptionalCacheHold Burst::cacheMemory(const nn::SharedMemory& memory) const { + auto [identifier, hold] = kMemoryCache->getOrCacheMemory(memory); + return hold; +} + +nn::ExecutionResult, nn::Timing>> Burst::execute( + const nn::Request& request, nn::MeasureTiming measure, + const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration) const { + // Ensure that at most one execution is in flight at any given time. + const bool alreadyInFlight = mExecutionInFlight.test_and_set(); + if (alreadyInFlight) { + return NN_ERROR() << "IBurst already has an execution in flight"; + } + const auto guard = ::android::base::make_scope_guard([this] { mExecutionInFlight.clear(); }); + + // Ensure that request is ready for IPC. + std::optional maybeRequestInShared; + const nn::Request& requestInShared = NN_TRY(hal::utils::makeExecutionFailure( + hal::utils::flushDataFromPointerToShared(&request, &maybeRequestInShared))); + + const auto aidlRequest = NN_TRY(hal::utils::makeExecutionFailure(convert(requestInShared))); + const auto aidlMeasure = NN_TRY(hal::utils::makeExecutionFailure(convert(measure))); + const auto aidlDeadline = NN_TRY(hal::utils::makeExecutionFailure(convert(deadline))); + const auto aidlLoopTimeoutDuration = + NN_TRY(hal::utils::makeExecutionFailure(convert(loopTimeoutDuration))); + + std::vector memoryIdentifierTokens; + std::vector holds; + memoryIdentifierTokens.reserve(request.pools.size()); + holds.reserve(request.pools.size()); + for (const auto& memoryPool : request.pools) { + if (const auto* memory = std::get_if(&memoryPool)) { + if (auto cached = kMemoryCache->getMemoryIfAvailable(*memory)) { + auto& [identifier, hold] = *cached; + memoryIdentifierTokens.push_back(identifier); + holds.push_back(std::move(hold)); + continue; + } + } + memoryIdentifierTokens.push_back(-1); + } + CHECK_EQ(request.pools.size(), memoryIdentifierTokens.size()); + + ExecutionResult executionResult; + const auto ret = + kBurst->executeSynchronously(aidlRequest, memoryIdentifierTokens, aidlMeasure, + aidlDeadline, aidlLoopTimeoutDuration, &executionResult); + HANDLE_ASTATUS(ret) << "execute failed"; + if (!executionResult.outputSufficientSize) { + auto canonicalOutputShapes = + nn::convert(executionResult.outputShapes).value_or(std::vector{}); + return NN_ERROR(nn::ErrorStatus::OUTPUT_INSUFFICIENT_SIZE, std::move(canonicalOutputShapes)) + << "execution failed with " << nn::ErrorStatus::OUTPUT_INSUFFICIENT_SIZE; + } + auto [outputShapes, timing] = NN_TRY(hal::utils::makeExecutionFailure( + convertExecutionResults(executionResult.outputShapes, executionResult.timing))); + + NN_TRY(hal::utils::makeExecutionFailure( + hal::utils::unflushDataFromSharedToPointer(request, maybeRequestInShared))); + + return std::make_pair(std::move(outputShapes), timing); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/src/PreparedModel.cpp b/neuralnetworks/aidl/utils/src/PreparedModel.cpp index aee4d90dab..003965b619 100644 --- a/neuralnetworks/aidl/utils/src/PreparedModel.cpp +++ b/neuralnetworks/aidl/utils/src/PreparedModel.cpp @@ -16,9 +16,9 @@ #include "PreparedModel.h" +#include "Burst.h" #include "Callbacks.h" #include "Conversions.h" -#include "ProtectCallback.h" #include "Utils.h" #include @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -161,7 +160,10 @@ PreparedModel::executeFenced(const nn::Request& request, const std::vector PreparedModel::configureExecutionBurst() const { - return hal::V1_0::utils::Burst::create(shared_from_this()); + std::shared_ptr burst; + const auto ret = kPreparedModel->configureExecutionBurst(&burst); + HANDLE_ASTATUS(ret) << "configureExecutionBurst failed"; + return Burst::create(std::move(burst)); } std::any PreparedModel::getUnderlyingResource() const { diff --git a/neuralnetworks/aidl/utils/test/MockBurst.h b/neuralnetworks/aidl/utils/test/MockBurst.h new file mode 100644 index 0000000000..5083bbdc86 --- /dev/null +++ b/neuralnetworks/aidl/utils/test/MockBurst.h @@ -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. + */ + +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_BURST_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_BURST_H + +#include +#include +#include +#include +#include + +namespace aidl::android::hardware::neuralnetworks::utils { + +class MockBurst final : public BnBurst { + public: + MOCK_METHOD(ndk::ScopedAStatus, executeSynchronously, + (const Request& request, const std::vector& memoryIdentifierTokens, + bool measureTiming, int64_t deadline, int64_t loopTimeoutDuration, + ExecutionResult* executionResult), + (override)); + MOCK_METHOD(ndk::ScopedAStatus, releaseMemoryResource, (int64_t memoryIdentifierToken), + (override)); +}; + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_BURST_H diff --git a/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp b/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp index 83304bc103..630a460cf5 100644 --- a/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp +++ b/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "MockBurst.h" #include "MockFencedExecutionCallback.h" #include "MockPreparedModel.h" @@ -255,6 +256,10 @@ TEST(PreparedModelTest, executeFencedDeadObject) { TEST(PreparedModelTest, configureExecutionBurst) { // setup test const auto mockPreparedModel = MockPreparedModel::create(); + const auto mockBurst = ndk::SharedRefBase::make(); + EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_)) + .Times(1) + .WillOnce(DoAll(SetArgPointee<0>(mockBurst), Invoke(makeStatusOk))); const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); // run test @@ -266,6 +271,54 @@ TEST(PreparedModelTest, configureExecutionBurst) { EXPECT_NE(result.value(), nullptr); } +TEST(PreparedModelTest, configureExecutionBurstError) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + + // run test + const auto result = preparedModel->configureExecutionBurst(); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(PreparedModelTest, configureExecutionBurstTransportFailure) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + + // run test + const auto result = preparedModel->configureExecutionBurst(); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(PreparedModelTest, configureExecutionBurstDeadObject) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + + // run test + const auto result = preparedModel->configureExecutionBurst(); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + TEST(PreparedModelTest, getUnderlyingResource) { // setup test const auto mockPreparedModel = MockPreparedModel::create(); -- GitLab From b8cf54cf5a5dc1639364cc6d79cc986efa6dceab Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Thu, 18 Mar 2021 21:15:09 -0700 Subject: [PATCH 037/825] Change NNAPI time from steady_clock to boot_clock -- hal Previously, the NNAPI used std::chrono::steady_clock to represent and measure timings. However, steady_clock does not count while the system is suspended. Instead, boot_clock is monotonic like steady_clock but does include the time when the system is suspended. This change also indicates that services may convert from std::chrono::steady_clock::time_point to android::base::boot_clock::time_point in the HIDL 1.3 NN HAL. Bug: 183118340 Test: mma Test: VtsHalNeuralnetworksV1_3TargetTest Test: VtsHalNeuralnetworksTargetTest Test: presubmit Change-Id: I5a7d039a31d9ce98602a301387ec99635f279f42 --- current.txt | 2 + neuralnetworks/1.3/IDevice.hal | 18 ++++- neuralnetworks/1.3/IPreparedModel.hal | 24 +++++++ neuralnetworks/1.3/utils/src/Conversions.cpp | 71 ++++++++++++++++++- .../hardware/neuralnetworks/IDevice.aidl | 16 ++--- .../neuralnetworks/IPreparedModel.aidl | 8 +-- neuralnetworks/aidl/utils/src/Conversions.cpp | 9 +-- .../vts/functional/QualityOfServiceTests.cpp | 10 +-- 8 files changed, 133 insertions(+), 25 deletions(-) diff --git a/current.txt b/current.txt index 6c576cab7a..270880fbf1 100644 --- a/current.txt +++ b/current.txt @@ -782,6 +782,8 @@ cd84ab19c590e0e73dd2307b591a3093ee18147ef95e6d5418644463a6620076 android.hardwar f729ee6a5f136b25d79ea6895d24700fce413df555baaecf2c39e4440d15d043 android.hardware.neuralnetworks@1.0::types a84f8dac7a9b75de1cc2936a9b429b9b62b32a31ea88ca52c29f98f5ddc0fa95 android.hardware.neuralnetworks@1.2::types cd331b92312d16ab89f475c39296abbf539efc4114a8c5c2b136ad99b904ef33 android.hardware.neuralnetworks@1.3::types +c3fec5bd470984402997f78a74b6511efc4063b270f2bd9ee7b78f48b683a1bb android.hardware.neuralnetworks@1.3::IDevice +0fdfad62c2ec33b52e6687004e5a1971c02d10b93ee4d26df5ccff7ce032494a android.hardware.neuralnetworks@1.3::IPreparedModel e8c86c69c438da8d1549856c1bb3e2d1b8da52722f8235ff49a30f2cce91742c android.hardware.soundtrigger@2.1::ISoundTriggerHwCallback b9fbb6e2e061ed0960939d48b785e9700210add1f13ed32ecd688d0f1ca20ef7 android.hardware.renderscript@1.0::types 0f53d70e1eadf8d987766db4bf6ae2048004682168f4cab118da576787def3fa android.hardware.radio@1.0::types diff --git a/neuralnetworks/1.3/IDevice.hal b/neuralnetworks/1.3/IDevice.hal index e0b04a8b62..de889e4b25 100644 --- a/neuralnetworks/1.3/IDevice.hal +++ b/neuralnetworks/1.3/IDevice.hal @@ -131,6 +131,14 @@ interface IDevice extends @1.2::IDevice { * ErrorStatus::MISSED_DEADLINE_TRANSIENT} or {@link * ErrorStatus::MISSED_DEADLINE_PERSISTENT} may be returned. The error due * to an abort must be sent the same way as other errors, described above. + * The deadline is represented as nanoseconds since the epoch of the steady + * clock (as if from std::chrono::steady_clock::time_point), but the service + * may convert it to the nanoseconds since boot time (as if from + * clock_gettime(CLOCK_BOOTTIME, &ts) or + * android::base::boot_clock::time_point) to account for time when the + * system is suspended. This conversion can by done by finding the timeout + * duration remaining compared to the steady_clock and adding it to the + * current boot_clock time. * * Optionally, the driver may save the prepared model to cache during the * asynchronous preparation. Any error that occurs when saving to cache must @@ -249,7 +257,15 @@ interface IDevice extends @1.2::IDevice { * ErrorStatus::MISSED_DEADLINE_TRANSIENT} * or {@link ErrorStatus::MISSED_DEADLINE_PERSISTENT} may be returned. The * error due to an abort must be sent the same way as other errors, - * described above. + * described above. The deadline is represented as nanoseconds since the + * epoch of the steady clock (as if from + * std::chrono::steady_clock::time_point), but the service may convert it to + * the nanoseconds since boot time (as if from + * clock_gettime(CLOCK_BOOTTIME, &ts) or + * android::base::boot_clock::time_point) to account for time when the + * system is suspended. This conversion can by done by finding the timeout + * duration remaining compared to the steady_clock and adding it to the + * current boot_clock time. * * The only information that may be unknown to the model at this stage is * the shape of the tensors, which may only be known at execution time. As diff --git a/neuralnetworks/1.3/IPreparedModel.hal b/neuralnetworks/1.3/IPreparedModel.hal index e7d63f4851..8b86a1a20e 100644 --- a/neuralnetworks/1.3/IPreparedModel.hal +++ b/neuralnetworks/1.3/IPreparedModel.hal @@ -74,6 +74,14 @@ interface IPreparedModel extends @1.2::IPreparedModel { * ErrorStatus::MISSED_DEADLINE_TRANSIENT} or {@link * ErrorStatus::MISSED_DEADLINE_PERSISTENT} may be returned. The error due * to an abort must be sent the same way as other errors, described above. + * The deadline is represented as nanoseconds since the epoch of the steady + * clock (as if from std::chrono::steady_clock::time_point), but the service + * may convert it to the nanoseconds since boot time (as if from + * clock_gettime(CLOCK_BOOTTIME, &ts) or + * android::base::boot_clock::time_point) to account for time when the + * system is suspended. This conversion can by done by finding the timeout + * duration remaining compared to the steady_clock and adding it to the + * current boot_clock time. * * Any number of calls to the execute* and executeSynchronously* functions, * in any combination, may be made concurrently, even on the same @@ -150,6 +158,14 @@ interface IPreparedModel extends @1.2::IPreparedModel { * ErrorStatus::MISSED_DEADLINE_TRANSIENT} or {@link * ErrorStatus::MISSED_DEADLINE_PERSISTENT} may be returned. The error due * to an abort must be sent the same way as other errors, described above. + * The deadline is represented as nanoseconds since the epoch of the steady + * clock (as if from std::chrono::steady_clock::time_point), but the service + * may convert it to the nanoseconds since boot time (as if from + * clock_gettime(CLOCK_BOOTTIME, &ts) or + * android::base::boot_clock::time_point) to account for time when the + * system is suspended. This conversion can by done by finding the timeout + * duration remaining compared to the steady_clock and adding it to the + * current boot_clock time. * * Any number of calls to the execute* and executeSynchronously* functions, * in any combination, may be made concurrently, even on the same @@ -231,6 +247,14 @@ interface IPreparedModel extends @1.2::IPreparedModel { * {@link ErrorStatus::MISSED_DEADLINE_TRANSIENT} or {@link * ErrorStatus::MISSED_DEADLINE_PERSISTENT} may be returned. The error due * to an abort must be sent the same way as other errors, described above. + * The deadline is represented as nanoseconds since the epoch of the steady + * clock (as if from std::chrono::steady_clock::time_point), but the service + * may convert it to the nanoseconds since boot time (as if from + * clock_gettime(CLOCK_BOOTTIME, &ts) or + * android::base::boot_clock::time_point) to account for time when the + * system is suspended. This conversion can by done by finding the timeout + * duration remaining compared to the steady_clock and adding it to the + * current boot_clock time. * * If any of the sync fences in waitFor changes to error status after the executeFenced * call succeeds, or the execution is aborted because it cannot finish before the deadline diff --git a/neuralnetworks/1.3/utils/src/Conversions.cpp b/neuralnetworks/1.3/utils/src/Conversions.cpp index 9788fe1b9d..a400240179 100644 --- a/neuralnetworks/1.3/utils/src/Conversions.cpp +++ b/neuralnetworks/1.3/utils/src/Conversions.cpp @@ -40,6 +40,23 @@ namespace { +std::chrono::nanoseconds makeNanosFromUint64(uint64_t nanoseconds) { + constexpr auto kMaxCount = std::chrono::nanoseconds::max().count(); + using CommonType = std::common_type_t; + const auto count = std::min(kMaxCount, nanoseconds); + return std::chrono::nanoseconds{static_cast(count)}; +} + +uint64_t makeUint64FromNanos(std::chrono::nanoseconds nanoseconds) { + if (nanoseconds < std::chrono::nanoseconds::zero()) { + return 0; + } + constexpr auto kMaxCount = std::numeric_limits::max(); + using CommonType = std::common_type_t; + const auto count = std::min(kMaxCount, nanoseconds.count()); + return static_cast(count); +} + template constexpr std::underlying_type_t underlyingType(Type value) { return static_cast>(value); @@ -276,8 +293,32 @@ GeneralResult unvalidatedConvert( switch (optionalTimePoint.getDiscriminator()) { case Discriminator::none: return {}; - case Discriminator::nanosecondsSinceEpoch: - return TimePoint{Duration{optionalTimePoint.nanosecondsSinceEpoch()}}; + case Discriminator::nanosecondsSinceEpoch: { + const auto currentSteadyTime = std::chrono::steady_clock::now(); + const auto currentBootTime = Clock::now(); + + const auto timeSinceEpoch = + makeNanosFromUint64(optionalTimePoint.nanosecondsSinceEpoch()); + const auto steadyTimePoint = std::chrono::steady_clock::time_point{timeSinceEpoch}; + + // Both steadyTimePoint and currentSteadyTime are guaranteed to be non-negative, so this + // subtraction will never overflow or underflow. + const auto timeRemaining = steadyTimePoint - currentSteadyTime; + + // currentBootTime is guaranteed to be non-negative, so this code only protects against + // an overflow. + nn::TimePoint bootTimePoint; + constexpr auto kZeroNano = std::chrono::nanoseconds::zero(); + constexpr auto kMaxTime = nn::TimePoint::max(); + if (timeRemaining > kZeroNano && currentBootTime > kMaxTime - timeRemaining) { + bootTimePoint = kMaxTime; + } else { + bootTimePoint = currentBootTime + timeRemaining; + } + + constexpr auto kZeroTime = nn::TimePoint{}; + return std::max(bootTimePoint, kZeroTime); + } } return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) << "Invalid OptionalTimePoint discriminator " @@ -601,9 +642,33 @@ nn::GeneralResult unvalidatedConvert( nn::GeneralResult unvalidatedConvert( const nn::OptionalTimePoint& optionalTimePoint) { + const auto currentSteadyTime = std::chrono::steady_clock::now(); + const auto currentBootTime = nn::Clock::now(); + OptionalTimePoint ret; if (optionalTimePoint.has_value()) { - const auto count = optionalTimePoint.value().time_since_epoch().count(); + const auto bootTimePoint = optionalTimePoint.value(); + + if (bootTimePoint < nn::TimePoint{}) { + return NN_ERROR() << "Trying to cast invalid time point"; + } + + // Both bootTimePoint and currentBootTime are guaranteed to be non-negative, so this + // subtraction will never overflow or underflow. + const auto timeRemaining = bootTimePoint - currentBootTime; + + // currentSteadyTime is guaranteed to be non-negative, so this code only protects against an + // overflow. + std::chrono::steady_clock::time_point steadyTimePoint; + constexpr auto kZeroNano = std::chrono::nanoseconds::zero(); + constexpr auto kMaxTime = std::chrono::steady_clock::time_point::max(); + if (timeRemaining > kZeroNano && currentSteadyTime > kMaxTime - timeRemaining) { + steadyTimePoint = kMaxTime; + } else { + steadyTimePoint = currentSteadyTime + timeRemaining; + } + + const uint64_t count = makeUint64FromNanos(steadyTimePoint.time_since_epoch()); ret.nanosecondsSinceEpoch(count); } return ret; diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl index e17e0cd765..c5b4ab1b8f 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl @@ -307,10 +307,10 @@ interface IDevice { * @param priority The priority of the prepared model relative to other prepared models owned by * the client. * @param deadline The time by which the model is expected to be prepared. The time is measured - * in nanoseconds since epoch of the steady clock (as from - * std::chrono::steady_clock). If the model cannot be prepared by the deadline, - * the preparation may be aborted. Passing -1 means the deadline is omitted. - * Other negative values are invalid. + * in nanoseconds since boot (as from clock_gettime(CLOCK_BOOTTIME, &ts) + * or ::android::base::boot_clock). If the model cannot be prepared by the + * deadline, the preparation may be aborted. Passing -1 means the deadline is + * omitted. Other negative values are invalid. * @param modelCache A vector of file descriptors for the security-sensitive cache. The length * of the vector must either be 0 indicating that caching information is not * provided, or match the numModelCache returned from @@ -396,10 +396,10 @@ interface IDevice { * different shapes of inputs on different (possibly concurrent) executions. * * @param deadline The time by which the model is expected to be prepared. The time is measured - * in nanoseconds since epoch of the steady clock (as from - * std::chrono::steady_clock). If the model cannot be prepared by the deadline, - * the preparation may be aborted. Passing -1 means the deadline is omitted. - * Other negative values are invalid. + * in nanoseconds since boot (as from clock_gettime(CLOCK_BOOTTIME, &ts) or + * ::android::base::boot_clock). If the model cannot be prepared by the + * deadline, the preparation may be aborted. Passing -1 means the deadline is + * omitted. Other negative values are invalid. * @param modelCache A vector of file descriptors for the security-sensitive cache. The length * of the vector must match the numModelCache returned from * getNumberOfCacheFilesNeeded. The cache file descriptors will be provided in diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl index 2a9757b323..bfab9067d1 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl @@ -73,8 +73,8 @@ interface IPreparedModel { * runs from the time the driver sees the call to the executeSynchronously * function to the time the driver returns from the function. * @param deadline The time by which the execution is expected to complete. The time is measured - * in nanoseconds since epoch of the steady clock (as from - * std::chrono::steady_clock). If the execution cannot be finished by the + * in nanoseconds since boot (as from clock_gettime(CLOCK_BOOTTIME, &ts) or + * ::android::base::boot_clock). If the execution cannot be finished by the * deadline, the execution may be aborted. Passing -1 means the deadline is * omitted. Other negative values are invalid. * @param loopTimeoutDuration The maximum amount of time in nanoseconds that should be spent @@ -138,8 +138,8 @@ interface IPreparedModel { * sync fences have been signaled. * @param measure Specifies whether or not to measure duration of the execution. * @param deadline The time by which the execution is expected to complete. The time is measured - * in nanoseconds since epoch of the steady clock (as from - * std::chrono::steady_clock).If the execution cannot be finished by the + * in nanoseconds since boot (as from clock_gettime(CLOCK_BOOTTIME, &ts) or + * ::android::base::boot_clock). If the execution cannot be finished by the * deadline, the execution may be aborted. Passing -1 means the deadline is * omitted. Other negative values are invalid. * @param loopTimeoutDuration The maximum amount of time in nanoseconds that should be spent diff --git a/neuralnetworks/aidl/utils/src/Conversions.cpp b/neuralnetworks/aidl/utils/src/Conversions.cpp index c47ba0ec1c..a34b952d9b 100644 --- a/neuralnetworks/aidl/utils/src/Conversions.cpp +++ b/neuralnetworks/aidl/utils/src/Conversions.cpp @@ -964,11 +964,12 @@ nn::GeneralResult unvalidatedConvert(const nn::Timing& timing) { } nn::GeneralResult unvalidatedConvert(const nn::Duration& duration) { - const uint64_t nanoseconds = duration.count(); - if (nanoseconds > std::numeric_limits::max()) { - return std::numeric_limits::max(); + if (duration < nn::Duration::zero()) { + return NN_ERROR() << "Unable to convert invalid (negative) duration"; } - return static_cast(nanoseconds); + constexpr std::chrono::nanoseconds::rep kIntMax = std::numeric_limits::max(); + const auto count = duration.count(); + return static_cast(std::min(count, kIntMax)); } nn::GeneralResult unvalidatedConvert(const nn::OptionalDuration& optionalDuration) { diff --git a/neuralnetworks/aidl/vts/functional/QualityOfServiceTests.cpp b/neuralnetworks/aidl/vts/functional/QualityOfServiceTests.cpp index 9ace1a9591..e803e38092 100644 --- a/neuralnetworks/aidl/vts/functional/QualityOfServiceTests.cpp +++ b/neuralnetworks/aidl/vts/functional/QualityOfServiceTests.cpp @@ -14,10 +14,10 @@ * limitations under the License. */ +#include #include #include #include - #include #include "Callbacks.h" @@ -61,16 +61,16 @@ static int64_t makeDeadline(DeadlineBoundType deadlineBoundType) { return std::chrono::duration_cast(timeSinceEpoch).count(); }; - std::chrono::steady_clock::time_point timePoint; + ::android::base::boot_clock::time_point timePoint; switch (deadlineBoundType) { case DeadlineBoundType::NOW: - timePoint = std::chrono::steady_clock::now(); + timePoint = ::android::base::boot_clock::now(); break; case DeadlineBoundType::UNLIMITED: - timePoint = std::chrono::steady_clock::time_point::max(); + timePoint = ::android::base::boot_clock::time_point::max(); break; case DeadlineBoundType::SHORT: - timePoint = std::chrono::steady_clock::now() + kShortDuration; + timePoint = ::android::base::boot_clock::now() + kShortDuration; break; } -- GitLab From fb55702452ead49042cf8ecafdbf38028bf288ed Mon Sep 17 00:00:00 2001 From: Ytai Ben-Tsvi Date: Fri, 5 Mar 2021 17:05:19 -0800 Subject: [PATCH 038/825] Introduce soundtrigger HAL v3 This is the initial AIDL version of the soundtrigger HAL. It is functionally equivalent to v2.4 (HIDL), but with a clean-up interface that removes obsolete / legacy functionality and conforms to AIDL style. Test: Mocked the HAL and observed framework logs for basic use-cases. Change-Id: I4525301ad1205cf41937a98b7b9f67f052cb5bd9 --- .../compatibility_matrix.current.xml | 8 + soundtrigger/3/Android.bp | 29 ++ .../soundtrigger3/ISoundTriggerHw.aidl | 269 ++++++++++++++++++ .../ISoundTriggerHwCallback.aidl | 59 ++++ .../ISoundTriggerHwGlobalCallback.aidl | 34 +++ .../soundtrigger3/ISoundTriggerHw.aidl | 48 ++++ .../ISoundTriggerHwCallback.aidl | 40 +++ .../ISoundTriggerHwGlobalCallback.aidl | 38 +++ 8 files changed, 525 insertions(+) create mode 100644 soundtrigger/3/Android.bp create mode 100644 soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl create mode 100644 soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl create mode 100644 soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl create mode 100644 soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHw.aidl create mode 100644 soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl create mode 100644 soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index bb5365461a..6ea6783652 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -527,6 +527,14 @@ default + + android.hardware.soundtrigger3 + 1 + + ISoundTriggerHw + default + + android.hardware.tetheroffload.config 1.0 diff --git a/soundtrigger/3/Android.bp b/soundtrigger/3/Android.bp new file mode 100644 index 0000000000..e56c5ad311 --- /dev/null +++ b/soundtrigger/3/Android.bp @@ -0,0 +1,29 @@ +aidl_interface { + name: "android.hardware.soundtrigger3", + vendor_available: true, + local_include_dir: "aidl", + flags: ["-Werror", "-Weverything", ], + srcs: [ + "aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl", + "aidl/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl", + "aidl/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl", + ], + stability: "vintf", + imports: [ + "android.media.soundtrigger.types", + ], + backend: { + cpp: { + // prefer NDK backend which can be used anywhere + enabled: false, + }, + java: { + sdk_version: "module_current", + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, +} diff --git a/soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl b/soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl new file mode 100644 index 0000000000..2a3fc644ee --- /dev/null +++ b/soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl @@ -0,0 +1,269 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.soundtrigger3; + +import android.hardware.soundtrigger3.ISoundTriggerHwCallback; +import android.hardware.soundtrigger3.ISoundTriggerHwGlobalCallback; + +import android.media.soundtrigger.PhraseSoundModel; +import android.media.soundtrigger.Properties; +import android.media.soundtrigger.RecognitionConfig; +import android.media.soundtrigger.SoundModel; +import android.media.soundtrigger.ModelParameter; +import android.media.soundtrigger.ModelParameterRange; +import android.media.soundtrigger.Properties; +import android.media.soundtrigger.RecognitionConfig; + +/** + * SoundTrigger HAL interface. Used for hardware recognition of hotwords + * and other sounds. + * + * Basic usage: + * ============ + * ISoundTriggerHw supports the ability to have one of more detection sessions running at a given + * time, and listening to acoustic events. The basic flow of setting up such a session is: + * - Load a model using loadSoundModel() or loadPhraseSoundModel(). The provided model object would + * indicate the (implementation-specific) detection algorithm (engine) to use, as well as any + * parameters applicable for this agorithm. Upon success, those methods would return a handle + * which will be used to reference this model in subsequent calls. + * - Once the model had been successfully loaded, detection can begin by calling startRecognition(). + * - Recognition will continue running in the background until one of the following events occurs: + * - stopRecognition() has been called on this model. + * - A detection has occurred. + * - Detection was aborted, typically for resource constraints, for example, when a higher- + * priority use-case has been initiated. + * - In the latter two cases, a recognition event will be sent via a the callback interface that was + * registered by the client upon loading. In either case, after any of these events occur, the + * detection becomes inactive and no more recognition callbacks are allowed. + * - The same model maybe started again at a later time, and this process may repeat as many times + * as needed. + * - Finally, an inactive model that is no longer needed may be unloaded via unloadModel(). + * + * Important notes about the threading model: + * ========================================== + * Both this interface and the corresponding callback interface use a synchronous calling + * convention. This model comes with some advantages, but also with some risks of deadlocks if the + * implementation does not handle this correctly. Please consider the following: + * - After stopRecognition() returns, no more recognition events for that model may be sent. This + * implies that any queues holding such events must be flushed before the call returns and that + * may imply that callback from the HAL to the client are done while stopRecognition() is blocked. + * This is OK, and supported by the framework. + * - Similarly, the same relationship applies between unloadModel() and subsequent callbacks to + * modelUnloaded(). + * - Other than these two cases, calls into the HAL *MAY NOT* block on callbacks from the HAL, or + * else deadlock conditions may result, which may be handled by rebooting of the HAL process and + * cause service outages. + * + * Due to the asynchronous nature of recognition events and preemptive model unloading, the HAL must + * correctly handle requests that would have been valid before an event has been delivered, but + * became moot as result of the event. Namely: + * - stopRecognition() may be called on a model that has already delivered an event and became + * inactive as a result. The HAL must return a successful return code in this case. + * - Furthermore, if a model is preemptively unloaded after it triggers (typically, this would + * happen when it is first aborted and immediately preemptively unloaded), stopRecognition() may + * be called on it. The HAL must return successfully in this case. + * - startRecognition() may be called on a model that has been preemptively unloaded. In this case, + * the HAL must signal a ServiceSpecificException(RESOURCE_CONTENTION) to indicate that the + * operation is temporarily unsuccessful. + * - unloadSoundModel() may be called on a model that has been preemptively unloaded. The HAL must + * return a successful return code in this case. This also implies that model handles should + * generally not be reused until explicitly unloaded. To avoid the rare possibility of running out + * of handles, the framework may call unloadModel() on models that have been preemptively unloaded + * by the HAL. + * + * Important notes about resource constraints and concurrency + * ========================================================= + * Up until this version, the framework would enforce concurrency constraints expressed by the + * Properties presented by the soundtrigger instance. These include constraints on the maximum + * amount of models that can be loaded at the same time and on running recognition while capturing + * from the microphone. + * This version changes the approach for how these constraints are modeled, both offering the HAL + * implementation more flexibility and simplifying the framework's job in enforcing these + * limitations. Note that there is no change for how the framework behaves with earlier versions, + * everything described below only applies to this version and onward. + * The way this is achieved is as following: + * - The framework will no longer enforce constraints on concurrent loading of models, as expressed + * in the Properties.maxSoundModels field (this property is merely a hint at this point and may be + * deprecated in the future), or any other implicit constraints. + * - The framework will no longer enforce constraints on concurrency of audio recording and + * soundtrigger operation, as expressed in the Properties.concurrentCapture field (this property + * is merely a hint at this point and may be deprecated in the future). + * - The HAL implementation is free to reject loading of any model at any time by having the + * respective load*() method signal a ServiceSpecificException(RESOURCE_CONTENTION). + * - The HAL implementation is free to reject starting of any model at any time by having the + * respective start*() method signal a ServiceSpecificException(RESOURCE_CONTENTION). + * - The HAL implementation is free to preemptively stop a previously started model at its own + * discretion (for example, if a higher priority use-case which cannot coexist with detection + * has been requested). The HAL must notify the framework of the preemption by sending a + * recognition event with an `ABORTED` status. The implementation must NOT attempt to restart the + * recognition automatically when conditions change. + * - The HAL implementation is free to preemptively unload a previously loaded model at its own + * discretion (for example, if a higher-priority model is being loaded and the two cannot + * coexist). When doing so, it must first abort the detection if active (as per above) and then + * notify the framework of the unload using the modelUnloaded() callback. + * - When conditions change, such that a model that couldn't previously load or start or that had + * previously been preemptively stopped or unloaded, the HAL must notify the framework via the + * newly added onResourcesAvailable() callback. This callback is not a guarantee that any + * operation would now succeed, but merely a hint that retrying something that had previously + * failed, now MAY succeed. Until this callback is invoked, the client may assume that any + * operation that had previously failed or aborted would still fail if retried, so the + * implementation should not forget to deliver it. + * There are no guarantees regarding how the framework may respond to this event and the order in + * which it may choose to reload/restart its models. Typically, as result of this event the + * framework will make a single attempt per model to bring this model to its desired state + * (loaded, started). + */ +@VintfStability +interface ISoundTriggerHw { + /** + * Retrieve implementation properties. + * + * @return A Properties structure containing implementation description and capabilities. + */ + Properties getProperties(); + + /** + * This will get called at most once per every attachment to the service. + * + * All events not tied to a specific model should go through this callback. + * + * @param callback An interface to receive global event callbacks. + */ + void registerGlobalCallback(in ISoundTriggerHwGlobalCallback callback); + + /** + * Load a sound model. Once loaded, recognition of this model can be started and stopped. + * + * @param soundModel A SoundModel structure describing the sound model to load. + * @param callback The callback interface on which the recognitionCallback() + * method will be called upon completion and modelUnloaded() upon preemptive unload. + * @return A unique handle assigned by the HAL for use by the client when controlling + * activity for this sound model. + * @throws ServiceSpecificException(RESOURCE_CONTENTION) if the model cannot be loaded due + * to resource constraints. This is typically a temporary condition and the client may + * retry after the onResourcesAvailable() global callback is invoked. + */ + int loadSoundModel(in SoundModel soundModel, in ISoundTriggerHwCallback callback); + + /** + * Load a key phrase sound model. Once loaded, recognition of this model can be started and + * stopped. + * + * @param soundModel A PhraseSoundModel structure describing the sound model to load. + * @param callback The callback interface on which the phraseRecognitionCallback() method will + * be called upon completion and modelUnloaded() upon preempted unload. + * @return A unique handle assigned by the HAL for use by the framework when controlling + * activity for this sound model. + * @throws ServiceSpecificException(RESOURCE_CONTENTION) if the model cannot be loaded due + * to resource constraints. This is typically a temporary condition and the client may + * retry after the onResourcesAvailable() global callback is invoked. + */ + int loadPhraseSoundModel(in PhraseSoundModel soundModel, in ISoundTriggerHwCallback callback); + + /** + * Unload a sound model. A sound model may be unloaded to free up resources and make room for a + * new one to overcome implementation limitations. + * This call is idempotent, to avoid any race conditions. + * + * @param modelHandle the handle of the sound model to unload. + */ + void unloadSoundModel(in int modelHandle); + + /** + * Start recognition on a given model. + * This must be called on a model that is in the stopped state. + * The state of this model becomes active and will remain so until explicitly stopped, or a + * recognition event had been delivered to the client. + * + * @param modelHandle the handle of the sound model to use for recognition + * @param deviceHandle The handle of the audio device to be used for recognition, as declared by + * the audio subsystem. + * @param ioHandle A handle assigned by the framework, which will later be used to retrieve + * an audio stream associated with this recognition session. + * @param config A RecognitionConfig structure containing attributes of the recognition to + * perform. + * @throws ServiceSpecificException(RESOURCE_CONTENTION) if the model cannot be started due + * to resource constraints. This is typically a temporary condition and the client may + * retry after the onResourcesAvailable() global callback is invoked. + */ + void startRecognition(in int modelHandle, in int deviceHandle, + in int ioHandle, in RecognitionConfig config); + + /** + * Stop recognition on a given model. + * This call is idempotent, to avoid any race conditions. + * + * @param modelHandle The handle of the sound model to use for recognition + */ + void stopRecognition(in int modelHandle); + + /** + * Request a recognition event to be generated. + * The model must be in the started state and will remain started after the event is sent. + * The model state is returned asynchronously as a RecognitionEvent via the callback that was + * registered upon loading. That event must have a RecognitionStatus.FORCED status. + * + * @param modelHandle The handle of the sound model whose state is being + * queried. + */ + void forceRecognitionEvent(in int modelHandle); + + /** + * Get supported parameter attributes with respect to the provided model handle. + * Model parameters are used to query/control model-specific detection behavior during a + * detection session. + * Along with determining the valid range, this API is also used to determine if a given + * parameter ID is supported at all by the modelHandle for use with getParameter() and + * setParameter() APIs. + * + * @param modelHandle The sound model handle indicating which model to query. + * @param modelParam Parameter to set which will be validated against the ModelParameter type. + * @return This structure indicates supported attributes of the parameter for the given model + * handle. If the parameter is not supported, null is returned. + */ + @nullable ModelParameterRange queryParameter(in int modelHandle, in ModelParameter modelParam); + + /** + * Get a model specific parameter. + * If the value has not been set, a default value is returned. See ModelParameter for parameter + * default values. + * The caller must check if the handle supports the parameter via the queryParameter API prior + * to calling this method. + * + * @param modelHandle The sound model associated with given modelParam + * @param modelParam Parameter to set which will be validated against the ModelParameter type. + * Not putting ModelParameter type directly in the definition and validating internally + * allows for forward compatibility. + * @return Value set to the requested parameter. + */ + int getParameter(in int modelHandle, in ModelParameter modelParam); + + /** + * Set a model specific parameter with the given value. + * This parameter will keep its value for the duration the model is loaded regardless of + * starting and stopping recognition. Once the model is unloaded, the value will be lost. + * The caller must check if the handle supports the parameter via the queryParameter API prior + * to calling this method. + * + * @param modelHandle The sound model handle indicating which model to modify parameters + * @param modelParam Parameter to set which will be validated against the ModelParameter type. + * Not putting ModelParameter type directly in the definition and validating internally + * allows for forward compatibility. + * @param value The value to set for the given model parameter. + */ + void setParameter(in int modelHandle, in ModelParameter modelParam, in int value); +} diff --git a/soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl b/soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl new file mode 100644 index 0000000000..049ca6574a --- /dev/null +++ b/soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl @@ -0,0 +1,59 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.soundtrigger3; + +import android.media.soundtrigger.PhraseRecognitionEvent; +import android.media.soundtrigger.RecognitionEvent; + +/** + * SoundTrigger HAL per-model Callback interface. + */ +@VintfStability +interface ISoundTriggerHwCallback { + /** + * Callback method called by the HAL when a model has been unloaded at the HAL implementation's + * discretion. + * This event may only be delivered when the model state is 'stopped'. + * This event is NOT sent as part of an unload sequence initiated by the client. + * + * @param model The model handle. + */ + void modelUnloaded(in int model); + + /** + * Callback method called by the HAL when the sound recognition triggers for a key phrase sound + * model. + * This event may only be delivered when the model state is 'started'. + * Unless the status of the event is RecognitionStatus.FORCED, this event indicates that the + * state of this model has become 'stopped'. + * + * @param event A RecognitionEvent structure containing detailed results of the recognition + * triggered + */ + void phraseRecognitionCallback(in int model, in PhraseRecognitionEvent event); + + /** + * Callback method called by the HAL when the sound recognition triggers. + * This event may only be delivered when the model state is 'started'. + * Unless the status of the event is RecognitionStatus.FORCED, this event indicates that the + * state of this model has become 'stopped'. + * + * @param event A RecognitionEvent structure containing detailed results of the recognition + * triggered + */ + void recognitionCallback(in int model, in RecognitionEvent event); +} diff --git a/soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl b/soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl new file mode 100644 index 0000000000..d6d86308ba --- /dev/null +++ b/soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl @@ -0,0 +1,34 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.soundtrigger3; + +/** + * SoundTrigger HAL callback interface for events not associated with a particular model. + */ +@VintfStability +interface ISoundTriggerHwGlobalCallback { + /** + * Callback method called by the HAL whenever internal conditions have been made available, such + * that a call that would previously have failed with an -EBUSY status may now succeed. + * There is no guarantee that any call would succeed following this event. It is merely a hint + * to the client that it may retry. + * Conversely, any call that have failed previously with a + * ServiceSpecificException(RESOURCE_CONTENTION) is guaranteed to fail again if retried, until + * this callback is delivered. + */ + void onResourcesAvailable(); +} diff --git a/soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHw.aidl b/soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHw.aidl new file mode 100644 index 0000000000..bbfe7d9161 --- /dev/null +++ b/soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHw.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.soundtrigger3; +@VintfStability +interface ISoundTriggerHw { + android.media.soundtrigger.Properties getProperties(); + void registerGlobalCallback(in android.hardware.soundtrigger3.ISoundTriggerHwGlobalCallback callback); + int loadSoundModel(in android.media.soundtrigger.SoundModel soundModel, in android.hardware.soundtrigger3.ISoundTriggerHwCallback callback); + int loadPhraseSoundModel(in android.media.soundtrigger.PhraseSoundModel soundModel, in android.hardware.soundtrigger3.ISoundTriggerHwCallback callback); + void unloadSoundModel(in int modelHandle); + void startRecognition(in int modelHandle, in int deviceHandle, in int ioHandle, in android.media.soundtrigger.RecognitionConfig config); + void stopRecognition(in int modelHandle); + void forceRecognitionEvent(in int modelHandle); + @nullable android.media.soundtrigger.ModelParameterRange queryParameter(in int modelHandle, in android.media.soundtrigger.ModelParameter modelParam); + int getParameter(in int modelHandle, in android.media.soundtrigger.ModelParameter modelParam); + void setParameter(in int modelHandle, in android.media.soundtrigger.ModelParameter modelParam, in int value); +} diff --git a/soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl b/soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl new file mode 100644 index 0000000000..152dfed637 --- /dev/null +++ b/soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.soundtrigger3; +@VintfStability +interface ISoundTriggerHwCallback { + void modelUnloaded(in int model); + void phraseRecognitionCallback(in int model, in android.media.soundtrigger.PhraseRecognitionEvent event); + void recognitionCallback(in int model, in android.media.soundtrigger.RecognitionEvent event); +} diff --git a/soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl b/soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl new file mode 100644 index 0000000000..6dfee9fa2f --- /dev/null +++ b/soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.soundtrigger3; +@VintfStability +interface ISoundTriggerHwGlobalCallback { + void onResourcesAvailable(); +} -- GitLab From 64027cbd0bd99c5648d35df505b8cda65e47b8b3 Mon Sep 17 00:00:00 2001 From: Ytai Ben-Tsvi Date: Fri, 19 Mar 2021 11:12:35 -0700 Subject: [PATCH 039/825] Add sthal_cli_3 This is a command-line HAL mock, which registers as an AIDL HAL. Change-Id: Idab4c6298bbdd7dafc360c50ac519efb7066cd0e --- soundtrigger/3/cli/Android.bp | 8 + soundtrigger/3/cli/OWNERS | 1 + .../hardware/soundtrigger3/cli/SthalCli.java | 351 ++++++++++++++++++ soundtrigger/3/cli/sthal_cli_3 | 6 + 4 files changed, 366 insertions(+) create mode 100644 soundtrigger/3/cli/Android.bp create mode 100644 soundtrigger/3/cli/OWNERS create mode 100644 soundtrigger/3/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java create mode 100644 soundtrigger/3/cli/sthal_cli_3 diff --git a/soundtrigger/3/cli/Android.bp b/soundtrigger/3/cli/Android.bp new file mode 100644 index 0000000000..880903a4c2 --- /dev/null +++ b/soundtrigger/3/cli/Android.bp @@ -0,0 +1,8 @@ +java_binary { + name: "sthal_cli_3", + wrapper: "sthal_cli_3", + srcs: ["java/**/*.java"], + static_libs: [ + "android.hardware.soundtrigger3-V1-java", + ], +} diff --git a/soundtrigger/3/cli/OWNERS b/soundtrigger/3/cli/OWNERS new file mode 100644 index 0000000000..e21b66ecb3 --- /dev/null +++ b/soundtrigger/3/cli/OWNERS @@ -0,0 +1 @@ +include /media/java/android/media/soundtrigger_middleware/OWNERS diff --git a/soundtrigger/3/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java b/soundtrigger/3/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java new file mode 100644 index 0000000000..d3e1aa7eaa --- /dev/null +++ b/soundtrigger/3/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java @@ -0,0 +1,351 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.soundtrigger3.cli; + +import android.annotation.NonNull; +import android.hardware.soundtrigger3.ISoundTriggerHw; +import android.hardware.soundtrigger3.ISoundTriggerHwCallback; +import android.hardware.soundtrigger3.ISoundTriggerHwGlobalCallback; +import android.media.audio.common.AudioConfig; +import android.media.soundtrigger.ConfidenceLevel; +import android.media.soundtrigger.ModelParameterRange; +import android.media.soundtrigger.PhraseRecognitionEvent; +import android.media.soundtrigger.PhraseRecognitionExtra; +import android.media.soundtrigger.PhraseSoundModel; +import android.media.soundtrigger.Properties; +import android.media.soundtrigger.RecognitionConfig; +import android.media.soundtrigger.RecognitionEvent; +import android.media.soundtrigger.RecognitionMode; +import android.media.soundtrigger.SoundModel; +import android.media.soundtrigger.SoundModelType; +import android.os.HwBinder; +import android.os.ParcelFileDescriptor; +import android.os.RemoteException; +import android.os.ServiceManager; +import android.os.SystemProperties; + +import java.util.Scanner; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +/** + * This is a quick-and-dirty sound trigger HAL console mock. + * + * It would only work on userdebug builds. + * + * When this app is started, it will initially: + * - Register a ISoundTriggerHw HAL with an instance name "mock". + * - Set a sysprop that tells SoundTriggerMiddlewareService to try to connect to the mock instance + * rather than the default one. + * - Reboot the real (default) HAL. + * + * In response to that, SoundTriggerMiddlewareService is going to connect to the mock HAL and resume + * normal operation. + * + * Our mock HAL will print to stdout every call it receives as well as expose a basic set of + * operations for sending event callbacks to the client. This allows us to simulate the frameworks + * behavior in response to different HAL behaviors. + */ +public class SthalCli { + private static SoundTriggerImpl mService; + private static final Scanner scanner = new Scanner(System.in); + + public static void main(String[] args) { + try { + printUsage(); + + System.out.println("Registering mock STHAL"); + mService = new SoundTriggerImpl(); + // This allows us to register the service, even if it is not declared in the manifest. + mService.forceDowngradeToSystemStability(); + ServiceManager.addService(ISoundTriggerHw.class.getCanonicalName() + "/mock", mService); + + System.out.println("Rebooting STHAL"); + SystemProperties.set("debug.soundtrigger_middleware.use_mock_hal", "3"); + SystemProperties.set("sys.audio.restart.hal", "1"); + + while (processCommand()) ; + } catch (Exception e) { + e.printStackTrace(); + } finally { + cleanup(); + } + } + + private static void cleanup() { + System.out.println("Cleaning up."); + SystemProperties.set("debug.soundtrigger_middleware.use_mock_hal", null); + HwBinder.setTrebleTestingOverride(false); + } + + private static boolean processCommand() { + String line = scanner.nextLine(); + String[] tokens = line.split("\\s+"); + if (tokens.length < 1) { + return false; + } + switch (tokens[0]) { + case "q": + return false; + + case "a": + mService.sendOnResourcesAvailable(); + return true; + + case "u": + mService.sendModelUnloaded(Integer.parseInt(tokens[1])); + return true; + + case "r": + mService.sendRecognitionEvent(Integer.parseInt(tokens[1]), + Integer.parseInt(tokens[2])); + return true; + + case "p": + mService.sendPhraseRecognitionEvent(Integer.parseInt(tokens[1]), + Integer.parseInt(tokens[2])); + return true; + + case "d": + mService.dumpModels(); + return true; + + default: + printUsage(); + return true; + } + } + + private static void printUsage() { + System.out.print( + "Sound Trigger HAL v3 mock\n" + + "Available commands:\n" + + "h - help\n" + + "q - quit\n" + + "a - send onResourcesAvailable event\n" + + "u - send modelUnloaded event\n" + + "r - send recognitionEvent\n" + + "p - send phraseRecognitionEvent\n" + + "d - dump models\n"); + } + + private static class SoundTriggerImpl extends ISoundTriggerHw.Stub { + static class Model { + final ISoundTriggerHwCallback callback; + final SoundModel model; + final PhraseSoundModel phraseModel; + public RecognitionConfig config = null; + + Model(ISoundTriggerHwCallback callback, SoundModel model) { + this.callback = callback; + this.model = model; + this.phraseModel = null; + } + + Model(ISoundTriggerHwCallback callback, PhraseSoundModel model) { + this.callback = callback; + this.model = null; + this.phraseModel = model; + } + } + + private ISoundTriggerHwGlobalCallback mGlobalCallback; + private final ConcurrentMap mLoadedModels = new ConcurrentHashMap<>(); + private int mHandleCounter = 1; + + public void dumpModels() { + mLoadedModels.forEach((handle, model) -> { + System.out.println("+++ Model " + handle); + System.out.println(" config = " + model.config); + RecognitionConfig recognitionConfig = model.config; + if (recognitionConfig != null) { + System.out.println(" ACTIVE recognitionConfig = " + recognitionConfig); + } else { + System.out.println(" INACTIVE"); + } + }); + } + + public void sendOnResourcesAvailable() { + if (mGlobalCallback != null) { + try { + mGlobalCallback.onResourcesAvailable(); + } catch (RemoteException e) { + e.printStackTrace(); + } + } + } + + public void sendRecognitionEvent(int modelHandle, int status) { + Model model = mLoadedModels.get(modelHandle); + if (model != null && model.config != null) { + RecognitionEvent event = new RecognitionEvent(); + event.type = SoundModelType.GENERIC; + event.status = status; + event.captureAvailable = true; + event.audioConfig.channelMask = 16; + event.audioConfig.format = 1; + event.audioConfig.sampleRateHz = 16000; + try { + model.callback.recognitionCallback(modelHandle, event); + } catch (RemoteException e) { + e.printStackTrace(); + } + model.config = null; + } + } + + public void sendPhraseRecognitionEvent(int modelHandle, int status) { + Model model = mLoadedModels.get(modelHandle); + if (model != null && model.config != null) { + PhraseRecognitionEvent event = new PhraseRecognitionEvent(); + event.common = new RecognitionEvent(); + event.common.type = SoundModelType.KEYPHRASE; + event.common.status = status; + event.common.captureAvailable = true; + event.common.audioConfig = new AudioConfig(); + event.common.audioConfig.channelMask = 16; + event.common.audioConfig.format = 1; + event.common.audioConfig.sampleRateHz = 16000; + if (model.phraseModel.phrases.length > 0) { + PhraseRecognitionExtra extra = new PhraseRecognitionExtra(); + extra.id = model.phraseModel.phrases[0].id; + extra.confidenceLevel = 100; + extra.recognitionModes = model.phraseModel.phrases[0].recognitionModes; + extra.levels = new ConfidenceLevel[0]; + event.phraseExtras = new PhraseRecognitionExtra[]{extra}; + } else { + event.phraseExtras = new PhraseRecognitionExtra[0]; + } + try { + model.callback.phraseRecognitionCallback(modelHandle, event); + } catch (RemoteException e) { + e.printStackTrace(); + } + model.config = null; + } + } + + public void sendModelUnloaded(int modelHandle) { + Model model = mLoadedModels.remove(modelHandle); + if (model != null) { + try { + model.callback.modelUnloaded(modelHandle); + } catch (RemoteException e) { + e.printStackTrace(); + } + } + } + + @Override + public void registerGlobalCallback(ISoundTriggerHwGlobalCallback callback) { + System.out.println("registerGlobalCallback()"); + mGlobalCallback = callback; + } + + @Override + public int loadSoundModel(SoundModel soundModel, ISoundTriggerHwCallback callback) { + int handle = mHandleCounter++; + System.out.printf("loadSoundModel(soundModel=%s) -> %d%n", soundModel, handle); + mLoadedModels.put(handle, new Model(callback, soundModel)); + return handle; + } + + @Override + public int loadPhraseSoundModel(PhraseSoundModel soundModel, + ISoundTriggerHwCallback callback) { + int handle = mHandleCounter++; + System.out.printf("loadPhraseSoundModel(soundModel=%s) -> %d%n", soundModel, handle); + mLoadedModels.put(handle, new Model(callback, soundModel)); + return handle; + } + + @Override + public void startRecognition(int modelHandle, int deviceHandle, int ioHandle, + RecognitionConfig config) { + System.out.printf("startRecognition(modelHandle=%d, deviceHandle=%d, ioHandle=%d)%n", + modelHandle, deviceHandle, ioHandle); + Model model = mLoadedModels.get(modelHandle); + if (model != null) { + model.config = config; + } + } + + @Override + public Properties getProperties() { + System.out.println("getProperties()"); + Properties properties = new Properties(); + properties.implementor = "Android"; + properties.description = "Mock STHAL"; + properties.maxSoundModels = 2; + properties.maxKeyPhrases = 1; + properties.recognitionModes = + RecognitionMode.VOICE_TRIGGER | RecognitionMode.GENERIC_TRIGGER; + return properties; + } + + @Override + public ModelParameterRange queryParameter(int modelHandle, int modelParam) { + System.out.printf("queryParameter(modelHandle=%d, modelParam=%d)%n", modelHandle, + modelParam); + return null; + } + + @Override + public void forceRecognitionEvent(int modelHandle) { + System.out.printf("getModelState(modelHandle=%d)%n", modelHandle); + } + + @Override + public void unloadSoundModel(int modelHandle) { + System.out.printf("unloadSoundModel(modelHandle=%d)%n", modelHandle); + } + + @Override + public void stopRecognition(int modelHandle) { + System.out.printf("stopRecognition(modelHandle=%d)%n", modelHandle); + Model model = mLoadedModels.get(modelHandle); + if (model != null) { + model.config = null; + } + } + + @Override + public int handleShellCommand(@NonNull ParcelFileDescriptor in, + @NonNull ParcelFileDescriptor out, @NonNull ParcelFileDescriptor err, + @NonNull String[] args) { + if (args.length > 0) { + switch (args[0]) { + case "reboot": + System.out.println("Received a reboot request. Exiting."); + cleanup(); + System.exit(1); + } + } + return 0; + } + + @Override + public void setParameter(int modelHandle, int modelParam, int value) { + throw new IllegalArgumentException(); + } + + @Override + public int getParameter(int modelHandle, int modelParam) { + throw new IllegalArgumentException(); + } + } +} diff --git a/soundtrigger/3/cli/sthal_cli_3 b/soundtrigger/3/cli/sthal_cli_3 new file mode 100644 index 0000000000..f157c50276 --- /dev/null +++ b/soundtrigger/3/cli/sthal_cli_3 @@ -0,0 +1,6 @@ +#!/system/bin/sh +# Script to start "sthal_cli_3" on the device +# +base=/system +export CLASSPATH=$base/framework/sthal_cli_3.jar +exec app_process $base/bin android.hardware.soundtrigger3.cli.SthalCli "$@" -- GitLab From 9227f181376da503613eca10c90b84277590307c Mon Sep 17 00:00:00 2001 From: Ytai Ben-Tsvi Date: Fri, 19 Mar 2021 15:34:31 -0700 Subject: [PATCH 040/825] Update STHAL mock sysprop to integer Change-Id: I995dafdd6426bff2983ded589fb8c892068639ff --- .../java/android/hardware/soundtrigger/V2_4/cli/SthalCli.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/soundtrigger/2.4/cli/java/android/hardware/soundtrigger/V2_4/cli/SthalCli.java b/soundtrigger/2.4/cli/java/android/hardware/soundtrigger/V2_4/cli/SthalCli.java index e6870aaf24..4931105137 100644 --- a/soundtrigger/2.4/cli/java/android/hardware/soundtrigger/V2_4/cli/SthalCli.java +++ b/soundtrigger/2.4/cli/java/android/hardware/soundtrigger/V2_4/cli/SthalCli.java @@ -61,7 +61,7 @@ public class SthalCli { mService.registerAsService("mock"); System.out.println("Rebooting STHAL"); - SystemProperties.set("debug.soundtrigger_middleware.use_mock_hal", "true"); + SystemProperties.set("debug.soundtrigger_middleware.use_mock_hal", "2"); SystemProperties.set("sys.audio.restart.hal", "1"); while (processCommand()) ; @@ -74,7 +74,7 @@ public class SthalCli { private static void cleanup() { System.out.println("Cleaning up."); - SystemProperties.set("debug.soundtrigger_middleware.use_mock_hal", "false"); + SystemProperties.set("debug.soundtrigger_middleware.use_mock_hal", null); HwBinder.setTrebleTestingOverride(false); } -- GitLab From 316f2fa1a3d4633b3de5507092a8245e0c15f29f Mon Sep 17 00:00:00 2001 From: Ytai Ben-Tsvi Date: Wed, 24 Mar 2021 15:25:47 -0700 Subject: [PATCH 041/825] Rearrange soundtrigger3 directory structure Test: m Change-Id: I35f041769c3835fa6d63bcb0d4bffac3c8a1aa46 --- soundtrigger/{3 => aidl}/Android.bp | 7 +++---- .../android/hardware/soundtrigger3/ISoundTriggerHw.aidl | 0 .../hardware/soundtrigger3/ISoundTriggerHwCallback.aidl | 0 .../soundtrigger3/ISoundTriggerHwGlobalCallback.aidl | 0 .../android/hardware/soundtrigger3/ISoundTriggerHw.aidl | 0 .../hardware/soundtrigger3/ISoundTriggerHwCallback.aidl | 0 .../soundtrigger3/ISoundTriggerHwGlobalCallback.aidl | 0 soundtrigger/{3 => aidl}/cli/Android.bp | 0 soundtrigger/{3 => aidl}/cli/OWNERS | 0 .../java/android/hardware/soundtrigger3/cli/SthalCli.java | 0 soundtrigger/{3 => aidl}/cli/sthal_cli_3 | 0 11 files changed, 3 insertions(+), 4 deletions(-) rename soundtrigger/{3 => aidl}/Android.bp (67%) rename soundtrigger/{3 => aidl}/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHw.aidl (100%) rename soundtrigger/{3 => aidl}/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl (100%) rename soundtrigger/{3 => aidl}/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl (100%) rename soundtrigger/{3 => }/aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl (100%) rename soundtrigger/{3 => }/aidl/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl (100%) rename soundtrigger/{3 => }/aidl/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl (100%) rename soundtrigger/{3 => aidl}/cli/Android.bp (100%) rename soundtrigger/{3 => aidl}/cli/OWNERS (100%) rename soundtrigger/{3 => aidl}/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java (100%) rename soundtrigger/{3 => aidl}/cli/sthal_cli_3 (100%) diff --git a/soundtrigger/3/Android.bp b/soundtrigger/aidl/Android.bp similarity index 67% rename from soundtrigger/3/Android.bp rename to soundtrigger/aidl/Android.bp index e56c5ad311..6c084da740 100644 --- a/soundtrigger/3/Android.bp +++ b/soundtrigger/aidl/Android.bp @@ -1,12 +1,11 @@ aidl_interface { name: "android.hardware.soundtrigger3", vendor_available: true, - local_include_dir: "aidl", flags: ["-Werror", "-Weverything", ], srcs: [ - "aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl", - "aidl/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl", - "aidl/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl", + "android/hardware/soundtrigger3/ISoundTriggerHw.aidl", + "android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl", + "android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl", ], stability: "vintf", imports: [ diff --git a/soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHw.aidl b/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHw.aidl similarity index 100% rename from soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHw.aidl rename to soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHw.aidl diff --git a/soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl b/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl similarity index 100% rename from soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl rename to soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl diff --git a/soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl b/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl similarity index 100% rename from soundtrigger/3/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl rename to soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/current/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl diff --git a/soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl b/soundtrigger/aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl similarity index 100% rename from soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl rename to soundtrigger/aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl diff --git a/soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl b/soundtrigger/aidl/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl similarity index 100% rename from soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl rename to soundtrigger/aidl/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl diff --git a/soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl b/soundtrigger/aidl/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl similarity index 100% rename from soundtrigger/3/aidl/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl rename to soundtrigger/aidl/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl diff --git a/soundtrigger/3/cli/Android.bp b/soundtrigger/aidl/cli/Android.bp similarity index 100% rename from soundtrigger/3/cli/Android.bp rename to soundtrigger/aidl/cli/Android.bp diff --git a/soundtrigger/3/cli/OWNERS b/soundtrigger/aidl/cli/OWNERS similarity index 100% rename from soundtrigger/3/cli/OWNERS rename to soundtrigger/aidl/cli/OWNERS diff --git a/soundtrigger/3/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java b/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java similarity index 100% rename from soundtrigger/3/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java rename to soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java diff --git a/soundtrigger/3/cli/sthal_cli_3 b/soundtrigger/aidl/cli/sthal_cli_3 similarity index 100% rename from soundtrigger/3/cli/sthal_cli_3 rename to soundtrigger/aidl/cli/sthal_cli_3 -- GitLab From b1659864bfd64ef9fa5d608992e7fd96c8beccae Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Wed, 31 Mar 2021 11:00:14 -0700 Subject: [PATCH 042/825] Don't limit VHAL instances to just default. This breaks configurable VHAL instance names (ag/9679700). Bug: 184056488 Test: build and flash with ProtoCAN enabled Change-Id: I463bfeb951bb4242dae5fc7f8cc8a8116c4f3570 --- compatibility_matrices/compatibility_matrix.current.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index bb5365461a..d59c6c5ac1 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -90,7 +90,7 @@ 2.0 IVehicle - default + .* -- GitLab From 80451ef0c39078e535b51668d709914c599be657 Mon Sep 17 00:00:00 2001 From: Yipeng Cao Date: Wed, 23 Dec 2020 17:04:29 -0800 Subject: [PATCH 043/825] Fix gnss replay Change the /dev/gnss0 read logic, will send the CMD_GET_LOCATION to /dev/gnss0 first. launch_cvd --start_gnss_proxy --gnss_file_path=xxx Test: Manually Change-Id: Ic493790e80ceb6fd4d890b31e596b5c08addee40 --- gnss/common/utils/default/NmeaFixInfo.cpp | 7 +++++++ gnss/common/utils/default/include/NmeaFixInfo.h | 1 + gnss/common/utils/default/include/v2_1/GnssTemplate.h | 11 +++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gnss/common/utils/default/NmeaFixInfo.cpp b/gnss/common/utils/default/NmeaFixInfo.cpp index 43e008bb72..c7ee13488b 100644 --- a/gnss/common/utils/default/NmeaFixInfo.cpp +++ b/gnss/common/utils/default/NmeaFixInfo.cpp @@ -202,8 +202,15 @@ std::unique_ptr NmeaFixInfo::getLocationFromInputStr( uint32_t fixId = 0; double lastTimeStamp = 0; for (const auto& line : nmeaRecords) { + if (line.compare(0, strlen(GPGA_RECORD_TAG), GPGA_RECORD_TAG) != 0 && + line.compare(0, strlen(GPRMC_RECORD_TAG), GPRMC_RECORD_TAG) != 0) { + continue; + } std::vector sentenceValues; splitStr(line, COMMA_SEPARATOR, sentenceValues); + if (sentenceValues.size() < MIN_COL_NUM) { + continue; + } double currentTimeStamp = std::stof(sentenceValues[1]); // If see a new timestamp, report correct location. if ((currentTimeStamp - lastTimeStamp) > TIMESTAMP_EPSILON && diff --git a/gnss/common/utils/default/include/NmeaFixInfo.h b/gnss/common/utils/default/include/NmeaFixInfo.h index 06eae7eda9..c96eecea00 100644 --- a/gnss/common/utils/default/include/NmeaFixInfo.h +++ b/gnss/common/utils/default/include/NmeaFixInfo.h @@ -32,6 +32,7 @@ constexpr char GPRMC_RECORD_TAG[] = "$GPRMC"; constexpr char LINE_SEPARATOR = '\n'; constexpr char COMMA_SEPARATOR = ','; constexpr double TIMESTAMP_EPSILON = 0.001; +constexpr int MIN_COL_NUM = 13; /** Helper class to parse and store the GNSS fix details information. */ class NmeaFixInfo { diff --git a/gnss/common/utils/default/include/v2_1/GnssTemplate.h b/gnss/common/utils/default/include/v2_1/GnssTemplate.h index 79c78c3f07..a6e8f58206 100644 --- a/gnss/common/utils/default/include/v2_1/GnssTemplate.h +++ b/gnss/common/utils/default/include/v2_1/GnssTemplate.h @@ -196,6 +196,7 @@ std::unique_ptr GnssTemplate::getLocationFromHW() { return nullptr; } while (true) { + memset(inputBuffer, 0, INPUT_BUFFER_SIZE); bytes_read = read(mGnssFd, &inputBuffer, INPUT_BUFFER_SIZE); if (bytes_read <= 0) { break; @@ -218,9 +219,14 @@ Return GnssTemplate::start() { auto svStatus = filterBlocklistedSatellitesV2_1(Utils::getMockSvInfoListV2_1()); this->reportSvStatus(svStatus); auto currentLocation = getLocationFromHW(); - if (mGnssFd != -1 && currentLocation != nullptr) { + if (mGnssFd != -1) { // Only report location if the return from hardware is valid - this->reportLocation(*currentLocation); + // note that we can not merge these two "if" together, if didn't + // get location from hardware, we shouldn't report location, not + // report the "default" one. + if (currentLocation != nullptr) { + this->reportLocation(*currentLocation); + } } else { if (sGnssCallback_2_1 != nullptr || sGnssCallback_2_0 != nullptr) { const auto location = Utils::getMockLocationV2_0(); @@ -259,6 +265,7 @@ Return GnssTemplate::stop() { if (mGnssFd != -1) { close(mGnssFd); mGnssFd = -1; + mHardwareModeChecked = false; } return true; } -- GitLab From 1158c80ff6f24223b8add271945b66f34db78d60 Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Wed, 24 Mar 2021 21:26:02 -0700 Subject: [PATCH 044/825] Improve the structure of NNAPI AIDL Memory Prior to this change, the NN AIDL HAL created a Memory struct analogous to hidl_memory, consisting of a name, size, and native handle. However, this Memory struct is not very structured, and requires both the client and server to agree on how the data should be interpreted. This CL tightens the structure of the Memory representation by introducing Ashmem and MappableFile structs to android.hardware.common in order to hold specific file descriptors representing memory regions. Further, this CL redefines android.hardwre.neuralnetworks's Memory object as a union of the Ashmem, MappableFile, and (existing) HardwareBuffer memory types. This change also adds "com.android.neuralnetworks" to the graphics AIDL HAL's apex_available build rule. Bug: 183118727 Test: mma Change-Id: I32322df676b83597c9e95f13662c322a6a80accc --- .../android/hardware/common/Ashmem.aidl | 39 ++++++++++++++ .../android/hardware/common/MappableFile.aidl | 41 ++++++++++++++ .../android/hardware/common/NativeHandle.aidl | 28 +++++++--- .../aidl/android/hardware/common/Ashmem.aidl | 34 ++++++++++++ .../android/hardware/common/MappableFile.aidl | 53 +++++++++++++++++++ graphics/common/aidl/Android.bp | 1 + neuralnetworks/aidl/Android.bp | 1 + .../hardware/neuralnetworks/Memory.aidl | 8 +-- .../hardware/neuralnetworks/Memory.aidl | 26 ++++++--- 9 files changed, 213 insertions(+), 18 deletions(-) create mode 100644 common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/Ashmem.aidl create mode 100644 common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/MappableFile.aidl create mode 100644 common/aidl/android/hardware/common/Ashmem.aidl create mode 100644 common/aidl/android/hardware/common/MappableFile.aidl diff --git a/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/Ashmem.aidl b/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/Ashmem.aidl new file mode 100644 index 0000000000..a4380315c9 --- /dev/null +++ b/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/Ashmem.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.common; +@VintfStability +parcelable Ashmem { + ParcelFileDescriptor fd; + long size; +} diff --git a/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/MappableFile.aidl b/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/MappableFile.aidl new file mode 100644 index 0000000000..394ea8ff07 --- /dev/null +++ b/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/MappableFile.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.common; +@VintfStability +parcelable MappableFile { + long length; + int prot; + ParcelFileDescriptor fd; + long offset; +} diff --git a/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/NativeHandle.aidl b/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/NativeHandle.aidl index f37b7d506f..2ed5c0b22d 100644 --- a/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/NativeHandle.aidl +++ b/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/NativeHandle.aidl @@ -1,14 +1,30 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/common/aidl/android/hardware/common/Ashmem.aidl b/common/aidl/android/hardware/common/Ashmem.aidl new file mode 100644 index 0000000000..8e402668bf --- /dev/null +++ b/common/aidl/android/hardware/common/Ashmem.aidl @@ -0,0 +1,34 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.common; + +import android.os.ParcelFileDescriptor; + +/** + * Type that holds same memory as the "ashmem" hidl_memory type from HIDL. + */ +@VintfStability +parcelable Ashmem { + /** + * A handle to a memory region. + */ + ParcelFileDescriptor fd; + /** + * Size of the memory region in bytes. + */ + long size; +} diff --git a/common/aidl/android/hardware/common/MappableFile.aidl b/common/aidl/android/hardware/common/MappableFile.aidl new file mode 100644 index 0000000000..a7763eab37 --- /dev/null +++ b/common/aidl/android/hardware/common/MappableFile.aidl @@ -0,0 +1,53 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.common; + +import android.os.ParcelFileDescriptor; + +/** + * A region of a file that can be mapped into memory. + * + * In Linux, MappableFile may be used with mmap as `MAP_SHARED`. + * + * MappableFile is compatible with ::android::base::MappedFile. + */ +@VintfStability +parcelable MappableFile { + /** + * Length of the mapping region in bytes. + */ + long length; + /** + * The desired memory protection for the mapping. + * + * In Linux, prot is either `PROT_NONE` (indicating that mapped pages may not be accessed) or + * the bitwise OR of one or more of the following flags: + * - `PROT_READ` (indicating that the mapped pages may be read) + * - `PROT_WRITE` (indicating that the mapped pages may be written) + */ + int prot; + /** + * A handle to a mappable file. + */ + ParcelFileDescriptor fd; + /** + * The offset in the file to the beginning of the mapping region in number of bytes. + * + * Note: Some mapping functions require that the offset is aligned to the page size. + */ + long offset; +} diff --git a/graphics/common/aidl/Android.bp b/graphics/common/aidl/Android.bp index 2a46f9dc7f..cadd13cdde 100644 --- a/graphics/common/aidl/Android.bp +++ b/graphics/common/aidl/Android.bp @@ -34,6 +34,7 @@ aidl_interface { apex_available: [ "//apex_available:platform", "com.android.media.swcodec", + "com.android.neuralnetworks", ], min_sdk_version: "29", }, diff --git a/neuralnetworks/aidl/Android.bp b/neuralnetworks/aidl/Android.bp index b1860e2bd0..ebf4654885 100644 --- a/neuralnetworks/aidl/Android.bp +++ b/neuralnetworks/aidl/Android.bp @@ -16,6 +16,7 @@ aidl_interface { stability: "vintf", imports: [ "android.hardware.common", + "android.hardware.graphics.common", ], backend: { java: { diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Memory.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Memory.aidl index 8207b25570..37fa102cf4 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Memory.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/Memory.aidl @@ -33,8 +33,8 @@ package android.hardware.neuralnetworks; @VintfStability -parcelable Memory { - android.hardware.common.NativeHandle handle; - long size; - String name; +union Memory { + android.hardware.common.Ashmem ashmem; + android.hardware.common.MappableFile mappableFile; + android.hardware.graphics.common.HardwareBuffer hardwareBuffer; } diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/Memory.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/Memory.aidl index 870f0aeb08..244ac8752d 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/Memory.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/Memory.aidl @@ -15,16 +15,26 @@ */ package android.hardware.neuralnetworks; -import android.hardware.common.NativeHandle; -import android.os.ParcelFileDescriptor; + +import android.hardware.common.Ashmem; +import android.hardware.common.MappableFile; +import android.hardware.graphics.common.HardwareBuffer; /** - * A type that is used to pass pieces of shared memory between processes. - * The type structure mimics hidl_memory type from HIDL. + * The different types of memory that can be shared across processes. */ @VintfStability -parcelable Memory { - NativeHandle handle; - long size; - String name; +union Memory { + /** + * Ashmem hidl_memory type from HIDL. + */ + Ashmem ashmem; + /** + * File that can be mapped. + */ + MappableFile mappableFile; + /** + * AIDL representation of AHardwareBuffer. + */ + HardwareBuffer hardwareBuffer; } -- GitLab From b0fcb3927d848e9721f05a458b5d6d4d2cb8079d Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Thu, 25 Mar 2021 15:27:38 -0700 Subject: [PATCH 045/825] Update NN utility code and VTS tests with new Memory type This CL fixes the compiler errors that arose of changing the Memory representation of the NN AIDL HAL, and updates the conversion and utility code to work with the new Memory type. This change also makes libaidlcommonsupport available to apex modules at min sdk level 29. Bug: 183118727 Test: mma Test: VtsHalNeuralnetworksTargetTest Change-Id: Ief565473b4d82e0bb43785fc3b8275b16bd26cf6 --- common/support/Android.bp | 5 + neuralnetworks/aidl/utils/Android.bp | 4 + neuralnetworks/aidl/utils/src/Conversions.cpp | 283 ++++++++++-------- neuralnetworks/aidl/utils/src/Utils.cpp | 62 +++- neuralnetworks/aidl/vts/functional/Android.bp | 2 + .../aidl/vts/functional/MemoryDomainTests.cpp | 21 +- .../aidl/vts/functional/ValidateModel.cpp | 16 +- .../utils/common/src/CommonUtils.cpp | 128 ++++++-- 8 files changed, 348 insertions(+), 173 deletions(-) diff --git a/common/support/Android.bp b/common/support/Android.bp index 8aea306dae..730798d840 100644 --- a/common/support/Android.bp +++ b/common/support/Android.bp @@ -18,6 +18,11 @@ cc_library_static { "android.hardware.common-V2-ndk_platform", "libcutils", ], + apex_available: [ + "//apex_available:platform", + "com.android.neuralnetworks", + ], + min_sdk_version: "29", } cc_test { diff --git a/neuralnetworks/aidl/utils/Android.bp b/neuralnetworks/aidl/utils/Android.bp index ad961cfe99..0ccc711ecf 100644 --- a/neuralnetworks/aidl/utils/Android.bp +++ b/neuralnetworks/aidl/utils/Android.bp @@ -31,6 +31,8 @@ cc_library_static { export_include_dirs: ["include"], cflags: ["-Wthread-safety"], static_libs: [ + "android.hardware.graphics.common-V2-ndk_platform", + "libaidlcommonsupport", "libarect", "neuralnetworks_types", "neuralnetworks_utils_hal_common", @@ -51,7 +53,9 @@ cc_test { ], static_libs: [ "android.hardware.common-V2-ndk_platform", + "android.hardware.graphics.common-V2-ndk_platform", "android.hardware.neuralnetworks-V1-ndk_platform", + "libaidlcommonsupport", "libgmock", "libneuralnetworks_common", "neuralnetworks_types", diff --git a/neuralnetworks/aidl/utils/src/Conversions.cpp b/neuralnetworks/aidl/utils/src/Conversions.cpp index d5f7f81663..93ac51c233 100644 --- a/neuralnetworks/aidl/utils/src/Conversions.cpp +++ b/neuralnetworks/aidl/utils/src/Conversions.cpp @@ -16,8 +16,13 @@ #include "Conversions.h" +#include +#include #include +#include +#include #include +#include #include #include #include @@ -125,28 +130,17 @@ struct NativeHandleDeleter { using UniqueNativeHandle = std::unique_ptr; -static GeneralResult nativeHandleFromAidlHandle(const NativeHandle& handle) { - std::vector fds; - fds.reserve(handle.fds.size()); - for (const auto& fd : handle.fds) { - auto duplicatedFd = NN_TRY(dupFd(fd.get())); - fds.emplace_back(duplicatedFd.release()); - } - - constexpr size_t kIntMax = std::numeric_limits::max(); - CHECK_LE(handle.fds.size(), kIntMax); - CHECK_LE(handle.ints.size(), kIntMax); - native_handle_t* nativeHandle = native_handle_create(static_cast(handle.fds.size()), - static_cast(handle.ints.size())); - if (nativeHandle == nullptr) { - return NN_ERROR() << "Failed to create native_handle"; +GeneralResult nativeHandleFromAidlHandle(const NativeHandle& handle) { + auto nativeHandle = UniqueNativeHandle(dupFromAidl(handle)); + if (nativeHandle.get() == nullptr) { + return NN_ERROR() << "android::dupFromAidl failed to convert the common::NativeHandle to a " + "native_handle_t"; } - for (size_t i = 0; i < fds.size(); ++i) { - nativeHandle->data[i] = fds[i].release(); + if (!std::all_of(nativeHandle->data + 0, nativeHandle->data + nativeHandle->numFds, + [](int fd) { return fd >= 0; })) { + return NN_ERROR() << "android::dupFromAidl returned an invalid native_handle_t"; } - std::copy(handle.ints.begin(), handle.ints.end(), &nativeHandle->data[nativeHandle->numFds]); - - return UniqueNativeHandle(nativeHandle); + return nativeHandle; } } // anonymous namespace @@ -353,67 +347,66 @@ GeneralResult unvalidatedConvert(bool measureTiming) { return measureTiming ? MeasureTiming::YES : MeasureTiming::NO; } -static uint32_t roundUpToMultiple(uint32_t value, uint32_t multiple) { - return (value + multiple - 1) / multiple * multiple; -} - GeneralResult unvalidatedConvert(const aidl_hal::Memory& memory) { - VERIFY_NON_NEGATIVE(memory.size) << "Memory size must not be negative"; - if (memory.size > std::numeric_limits::max()) { - return NN_ERROR() << "Memory: size must be <= std::numeric_limits::max()"; - } - - if (memory.name != "hardware_buffer_blob") { - return std::make_shared(Memory{ - .handle = NN_TRY(unvalidatedConvertHelper(memory.handle)), - .size = static_cast(memory.size), - .name = memory.name, - }); - } - - const auto size = static_cast(memory.size); - const auto format = AHARDWAREBUFFER_FORMAT_BLOB; - const auto usage = AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN | AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN; - const uint32_t width = size; - const uint32_t height = 1; // height is always 1 for BLOB mode AHardwareBuffer. - const uint32_t layers = 1; // layers is always 1 for BLOB mode AHardwareBuffer. - - const UniqueNativeHandle handle = NN_TRY(nativeHandleFromAidlHandle(memory.handle)); - const native_handle_t* nativeHandle = handle.get(); - - // AHardwareBuffer_createFromHandle() might fail because an allocator - // expects a specific stride value. In that case, we try to guess it by - // aligning the width to small powers of 2. - // TODO(b/174120849): Avoid stride assumptions. - AHardwareBuffer* hardwareBuffer = nullptr; - status_t status = UNKNOWN_ERROR; - for (uint32_t alignment : {1, 4, 32, 64, 128, 2, 8, 16}) { - const uint32_t stride = roundUpToMultiple(width, alignment); - AHardwareBuffer_Desc desc{ - .width = width, - .height = height, - .layers = layers, - .format = format, - .usage = usage, - .stride = stride, - }; - status = AHardwareBuffer_createFromHandle(&desc, nativeHandle, - AHARDWAREBUFFER_CREATE_FROM_HANDLE_METHOD_CLONE, - &hardwareBuffer); - if (status == NO_ERROR) { - break; + using Tag = aidl_hal::Memory::Tag; + switch (memory.getTag()) { + case Tag::ashmem: { + const auto& ashmem = memory.get(); + VERIFY_NON_NEGATIVE(ashmem.size) << "Memory size must not be negative"; + if (ashmem.size > std::numeric_limits::max()) { + return NN_ERROR() << "Memory: size must be <= std::numeric_limits::max()"; + } + + auto handle = Memory::Ashmem{ + .fd = NN_TRY(dupFd(ashmem.fd.get())), + .size = static_cast(ashmem.size), + }; + return std::make_shared(Memory{.handle = std::move(handle)}); + } + case Tag::mappableFile: { + const auto& mappableFile = memory.get(); + VERIFY_NON_NEGATIVE(mappableFile.length) << "Memory size must not be negative"; + VERIFY_NON_NEGATIVE(mappableFile.offset) << "Memory offset must not be negative"; + if (mappableFile.length > std::numeric_limits::max()) { + return NN_ERROR() << "Memory: size must be <= std::numeric_limits::max()"; + } + if (mappableFile.offset > std::numeric_limits::max()) { + return NN_ERROR() << "Memory: offset must be <= std::numeric_limits::max()"; + } + + const size_t size = static_cast(mappableFile.length); + const int prot = mappableFile.prot; + const int fd = mappableFile.fd.get(); + const size_t offset = static_cast(mappableFile.offset); + + return createSharedMemoryFromFd(size, prot, fd, offset); + } + case Tag::hardwareBuffer: { + const auto& hardwareBuffer = memory.get(); + + const UniqueNativeHandle handle = + NN_TRY(nativeHandleFromAidlHandle(hardwareBuffer.handle)); + const native_handle_t* nativeHandle = handle.get(); + + const AHardwareBuffer_Desc desc{ + .width = static_cast(hardwareBuffer.description.width), + .height = static_cast(hardwareBuffer.description.height), + .layers = static_cast(hardwareBuffer.description.layers), + .format = static_cast(hardwareBuffer.description.format), + .usage = static_cast(hardwareBuffer.description.usage), + .stride = static_cast(hardwareBuffer.description.stride), + }; + AHardwareBuffer* ahwb = nullptr; + const status_t status = AHardwareBuffer_createFromHandle( + &desc, nativeHandle, AHARDWAREBUFFER_CREATE_FROM_HANDLE_METHOD_CLONE, &ahwb); + if (status != NO_ERROR) { + return NN_ERROR() << "createFromHandle failed"; + } + + return createSharedMemoryFromAHWB(ahwb, /*takeOwnership=*/true); } } - if (status != NO_ERROR) { - return NN_ERROR(ErrorStatus::GENERAL_FAILURE) - << "Can't create AHardwareBuffer from handle. Error: " << status; - } - - return std::make_shared(Memory{ - .handle = HardwareBufferHandle(hardwareBuffer, /*takeOwnership=*/true), - .size = static_cast(memory.size), - .name = memory.name, - }); + return NN_ERROR() << "Unrecognized Memory::Tag: " << memory.getTag(); } GeneralResult unvalidatedConvert(const aidl_hal::Timing& timing) { @@ -645,20 +638,95 @@ struct overloaded : Ts... { template overloaded(Ts...)->overloaded; -static nn::GeneralResult aidlHandleFromNativeHandle( - const native_handle_t& handle) { - common::NativeHandle aidlNativeHandle; +nn::GeneralResult aidlHandleFromNativeHandle( + const native_handle_t& nativeHandle) { + auto handle = ::android::dupToAidl(&nativeHandle); + if (!std::all_of(handle.fds.begin(), handle.fds.end(), + [](const ndk::ScopedFileDescriptor& fd) { return fd.get() >= 0; })) { + return NN_ERROR() << "android::dupToAidl returned an invalid common::NativeHandle"; + } + return handle; +} - aidlNativeHandle.fds.reserve(handle.numFds); - for (int i = 0; i < handle.numFds; ++i) { - auto duplicatedFd = NN_TRY(nn::dupFd(handle.data[i])); - aidlNativeHandle.fds.emplace_back(duplicatedFd.release()); +nn::GeneralResult unvalidatedConvert(const nn::Memory::Ashmem& memory) { + if constexpr (std::numeric_limits::max() > std::numeric_limits::max()) { + if (memory.size > std::numeric_limits::max()) { + return ( + NN_ERROR() + << "Memory::Ashmem: size must be <= std::numeric_limits::max()") + . + operator nn::GeneralResult(); + } } - aidlNativeHandle.ints = std::vector(&handle.data[handle.numFds], - &handle.data[handle.numFds + handle.numInts]); + auto fd = NN_TRY(nn::dupFd(memory.fd)); + auto handle = common::Ashmem{ + .fd = ndk::ScopedFileDescriptor(fd.release()), + .size = static_cast(memory.size), + }; + return Memory::make(std::move(handle)); +} - return aidlNativeHandle; +nn::GeneralResult unvalidatedConvert(const nn::Memory::Fd& memory) { + if constexpr (std::numeric_limits::max() > std::numeric_limits::max()) { + if (memory.size > std::numeric_limits::max()) { + return (NN_ERROR() << "Memory::Fd: size must be <= std::numeric_limits::max()") + . + operator nn::GeneralResult(); + } + if (memory.offset > std::numeric_limits::max()) { + return ( + NN_ERROR() + << "Memory::Fd: offset must be <= std::numeric_limits::max()") + . + operator nn::GeneralResult(); + } + } + + auto fd = NN_TRY(nn::dupFd(memory.fd)); + auto handle = common::MappableFile{ + .length = static_cast(memory.size), + .prot = memory.prot, + .fd = ndk::ScopedFileDescriptor(fd.release()), + .offset = static_cast(memory.offset), + }; + return Memory::make(std::move(handle)); +} + +nn::GeneralResult unvalidatedConvert(const nn::Memory::HardwareBuffer& memory) { + const native_handle_t* nativeHandle = AHardwareBuffer_getNativeHandle(memory.handle.get()); + if (nativeHandle == nullptr) { + return (NN_ERROR() << "unvalidatedConvert failed because AHardwareBuffer_getNativeHandle " + "returned nullptr") + . + operator nn::GeneralResult(); + } + + auto handle = NN_TRY(aidlHandleFromNativeHandle(*nativeHandle)); + + AHardwareBuffer_Desc desc; + AHardwareBuffer_describe(memory.handle.get(), &desc); + + const auto description = graphics::common::HardwareBufferDescription{ + .width = static_cast(desc.width), + .height = static_cast(desc.height), + .layers = static_cast(desc.layers), + .format = static_cast(desc.format), + .usage = static_cast(desc.usage), + .stride = static_cast(desc.stride), + }; + + auto hardwareBuffer = graphics::common::HardwareBuffer{ + .description = std::move(description), + .handle = std::move(handle), + }; + return Memory::make(std::move(hardwareBuffer)); +} + +nn::GeneralResult unvalidatedConvert(const nn::Memory::Unknown& /*memory*/) { + return (NN_ERROR() << "Unable to convert Unknown memory type") + . + operator nn::GeneralResult(); } } // namespace @@ -693,41 +761,12 @@ nn::GeneralResult unvalidatedConvert(const nn::SharedHandl } nn::GeneralResult unvalidatedConvert(const nn::SharedMemory& memory) { - CHECK(memory != nullptr); - if (memory->size > std::numeric_limits::max()) { - return NN_ERROR() << "Memory size doesn't fit into int64_t."; + if (memory == nullptr) { + return (NN_ERROR() << "Unable to convert nullptr memory") + . + operator nn::GeneralResult(); } - if (const auto* handle = std::get_if(&memory->handle)) { - return Memory{ - .handle = NN_TRY(unvalidatedConvert(*handle)), - .size = static_cast(memory->size), - .name = memory->name, - }; - } - - const auto* ahwb = std::get(memory->handle).get(); - AHardwareBuffer_Desc bufferDesc; - AHardwareBuffer_describe(ahwb, &bufferDesc); - - if (bufferDesc.format == AHARDWAREBUFFER_FORMAT_BLOB) { - CHECK_EQ(memory->size, bufferDesc.width); - CHECK_EQ(memory->name, "hardware_buffer_blob"); - } else { - CHECK_EQ(memory->size, 0u); - CHECK_EQ(memory->name, "hardware_buffer"); - } - - const native_handle_t* nativeHandle = AHardwareBuffer_getNativeHandle(ahwb); - if (nativeHandle == nullptr) { - return NN_ERROR() << "unvalidatedConvert failed because AHardwareBuffer_getNativeHandle " - "returned nullptr"; - } - - return Memory{ - .handle = NN_TRY(aidlHandleFromNativeHandle(*nativeHandle)), - .size = static_cast(memory->size), - .name = memory->name, - }; + return std::visit([](const auto& x) { return unvalidatedConvert(x); }, memory->handle); } nn::GeneralResult unvalidatedConvert(const nn::ErrorStatus& errorStatus) { diff --git a/neuralnetworks/aidl/utils/src/Utils.cpp b/neuralnetworks/aidl/utils/src/Utils.cpp index 95516c854b..03407be4ce 100644 --- a/neuralnetworks/aidl/utils/src/Utils.cpp +++ b/neuralnetworks/aidl/utils/src/Utils.cpp @@ -16,12 +16,20 @@ #include "Utils.h" +#include +#include +#include +#include #include #include +#include namespace aidl::android::hardware::neuralnetworks::utils { namespace { +nn::GeneralResult clone(const ndk::ScopedFileDescriptor& fd); +using utils::clone; + template nn::GeneralResult> cloneVec(const std::vector& arguments) { std::vector clonedObjects; @@ -37,24 +45,52 @@ nn::GeneralResult> clone(const std::vector& arguments) { return cloneVec(arguments); } +nn::GeneralResult clone(const ndk::ScopedFileDescriptor& fd) { + auto duplicatedFd = NN_TRY(nn::dupFd(fd.get())); + return ndk::ScopedFileDescriptor(duplicatedFd.release()); +} + +nn::GeneralResult clone(const common::NativeHandle& handle) { + return common::NativeHandle{ + .fds = NN_TRY(cloneVec(handle.fds)), + .ints = handle.ints, + }; +} + } // namespace nn::GeneralResult clone(const Memory& memory) { - common::NativeHandle nativeHandle; - nativeHandle.ints = memory.handle.ints; - nativeHandle.fds.reserve(memory.handle.fds.size()); - for (const auto& fd : memory.handle.fds) { - const int newFd = dup(fd.get()); - if (newFd < 0) { - return NN_ERROR() << "Couldn't dup a file descriptor"; + switch (memory.getTag()) { + case Memory::Tag::ashmem: { + const auto& ashmem = memory.get(); + auto handle = common::Ashmem{ + .fd = NN_TRY(clone(ashmem.fd)), + .size = ashmem.size, + }; + return Memory::make(std::move(handle)); + } + case Memory::Tag::mappableFile: { + const auto& memFd = memory.get(); + auto handle = common::MappableFile{ + .length = memFd.length, + .prot = memFd.prot, + .fd = NN_TRY(clone(memFd.fd)), + .offset = memFd.offset, + }; + return Memory::make(std::move(handle)); + } + case Memory::Tag::hardwareBuffer: { + const auto& hardwareBuffer = memory.get(); + auto handle = graphics::common::HardwareBuffer{ + .description = hardwareBuffer.description, + .handle = NN_TRY(clone(hardwareBuffer.handle)), + }; + return Memory::make(std::move(handle)); } - nativeHandle.fds.emplace_back(newFd); } - return Memory{ - .handle = std::move(nativeHandle), - .size = memory.size, - .name = memory.name, - }; + return (NN_ERROR() << "Unrecognized Memory::Tag: " << memory.getTag()) + . + operator nn::GeneralResult(); } nn::GeneralResult clone(const RequestMemoryPool& requestPool) { diff --git a/neuralnetworks/aidl/vts/functional/Android.bp b/neuralnetworks/aidl/vts/functional/Android.bp index 7804c2a765..d5b150a934 100644 --- a/neuralnetworks/aidl/vts/functional/Android.bp +++ b/neuralnetworks/aidl/vts/functional/Android.bp @@ -50,9 +50,11 @@ cc_test { ], static_libs: [ "android.hardware.common-V2-ndk_platform", + "android.hardware.graphics.common-V2-ndk_platform", "android.hardware.neuralnetworks-V1-ndk_platform", "android.hidl.allocator@1.0", "android.hidl.memory@1.0", + "libaidlcommonsupport", "libgmock", "libhidlmemory", "libneuralnetworks_generated_test_harness", diff --git a/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp b/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp index 596f8ae58e..e8313f19eb 100644 --- a/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp +++ b/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp @@ -16,6 +16,7 @@ #define LOG_TAG "neuralnetworks_aidl_hal_test" +#include #include #include #include @@ -659,10 +660,26 @@ class MemoryDomainCopyTestBase : public MemoryDomainTestBase { return allocateBuffer(preparedModel, inputIndexes, outputIndexes, {}); } + size_t getSize(const Memory& memory) { + switch (memory.getTag()) { + case Memory::Tag::ashmem: + return memory.get().size; + case Memory::Tag::mappableFile: + return memory.get().length; + case Memory::Tag::hardwareBuffer: { + const auto& hardwareBuffer = memory.get(); + const bool isBlob = + hardwareBuffer.description.format == graphics::common::PixelFormat::BLOB; + return isBlob ? hardwareBuffer.description.width : 0; + } + } + return 0; + } + Memory allocateSharedMemory(uint32_t size) { const auto sharedMemory = nn::createSharedMemory(size).value(); auto memory = utils::convert(sharedMemory).value(); - EXPECT_EQ(memory.size, size); + EXPECT_EQ(getSize(memory), size); return memory; } @@ -690,7 +707,7 @@ class MemoryDomainCopyTestBase : public MemoryDomainTestBase { void initializeDeviceMemory(const std::shared_ptr& buffer) { Memory memory = allocateSharedMemory(kTestOperandDataSize); - ASSERT_EQ(memory.size, kTestOperandDataSize); + ASSERT_EQ(getSize(memory), kTestOperandDataSize); testCopyFrom(buffer, memory, utils::toSigned(kTestOperand.dimensions).value(), ErrorStatus::NONE); } diff --git a/neuralnetworks/aidl/vts/functional/ValidateModel.cpp b/neuralnetworks/aidl/vts/functional/ValidateModel.cpp index 94d3daf6bb..698c054941 100644 --- a/neuralnetworks/aidl/vts/functional/ValidateModel.cpp +++ b/neuralnetworks/aidl/vts/functional/ValidateModel.cpp @@ -259,12 +259,16 @@ template <> size_t sizeForBinder(const Memory& memory) { // This is just a guess. - size_t size = 0; - const NativeHandle& handle = memory.handle; - size += sizeof(decltype(handle.fds)::value_type) * handle.fds.size(); - size += sizeof(decltype(handle.ints)::value_type) * handle.ints.size(); - size += sizeForBinder(memory.name); - size += sizeof(memory); + size_t size = sizeof(Memory); + + // Only hardwareBuffer type memory has dynamic memory that needs to be accounted for (in the + // form of a NativeHandle type). The other other types of memory (MappableFile, Ashmem) use a + // single file descriptor (with metadata) instead. + if (memory.getTag() == Memory::Tag::hardwareBuffer) { + const NativeHandle& handle = memory.get().handle; + size += sizeof(decltype(handle.fds)::value_type) * handle.fds.size(); + size += sizeof(decltype(handle.ints)::value_type) * handle.ints.size(); + } return size; } diff --git a/neuralnetworks/utils/common/src/CommonUtils.cpp b/neuralnetworks/utils/common/src/CommonUtils.cpp index 924ecb2d1b..4d26795d89 100644 --- a/neuralnetworks/utils/common/src/CommonUtils.cpp +++ b/neuralnetworks/utils/common/src/CommonUtils.cpp @@ -89,6 +89,59 @@ void copyPointersToSharedMemory(nn::Model::Subgraph* subgraph, }); } +nn::GeneralResult createNativeHandleFrom(base::unique_fd fd, + const std::vector& ints) { + constexpr size_t kIntMax = std::numeric_limits::max(); + CHECK_LE(ints.size(), kIntMax); + native_handle_t* nativeHandle = native_handle_create(1, static_cast(ints.size())); + if (nativeHandle == nullptr) { + return NN_ERROR() << "Failed to create native_handle"; + } + + nativeHandle->data[0] = fd.release(); + std::copy(ints.begin(), ints.end(), nativeHandle->data + 1); + + hidl_handle handle; + handle.setTo(nativeHandle, /*shouldOwn=*/true); + return handle; +} + +nn::GeneralResult createHidlMemoryFrom(const nn::Memory::Ashmem& memory) { + auto fd = NN_TRY(nn::dupFd(memory.fd)); + auto handle = NN_TRY(createNativeHandleFrom(std::move(fd), {})); + return hidl_memory("ashmem", std::move(handle), memory.size); +} + +nn::GeneralResult createHidlMemoryFrom(const nn::Memory::Fd& memory) { + auto fd = NN_TRY(nn::dupFd(memory.fd)); + + const auto [lowOffsetBits, highOffsetBits] = nn::getIntsFromOffset(memory.offset); + const std::vector ints = {memory.prot, lowOffsetBits, highOffsetBits}; + + auto handle = NN_TRY(createNativeHandleFrom(std::move(fd), ints)); + return hidl_memory("mmap_fd", std::move(handle), memory.size); +} + +nn::GeneralResult createHidlMemoryFrom(const nn::Memory::HardwareBuffer& memory) { + const auto* ahwb = memory.handle.get(); + AHardwareBuffer_Desc bufferDesc; + AHardwareBuffer_describe(ahwb, &bufferDesc); + + const bool isBlob = bufferDesc.format == AHARDWAREBUFFER_FORMAT_BLOB; + const size_t size = isBlob ? bufferDesc.width : 0; + const char* const name = isBlob ? "hardware_buffer_blob" : "hardware_buffer"; + + const native_handle_t* nativeHandle = AHardwareBuffer_getNativeHandle(ahwb); + const hidl_handle hidlHandle(nativeHandle); + hidl_handle copiedHandle(hidlHandle); + + return hidl_memory(name, std::move(copiedHandle), size); +} + +nn::GeneralResult createHidlMemoryFrom(const nn::Memory::Unknown& memory) { + return hidl_memory(memory.name, NN_TRY(hidlHandleFromSharedHandle(memory.handle)), memory.size); +} + } // anonymous namespace nn::Capabilities::OperandPerformanceTable makeQuantized8PerformanceConsistentWithP( @@ -255,27 +308,7 @@ nn::GeneralResult createHidlMemoryFromSharedMemory(const nn::Shared if (memory == nullptr) { return NN_ERROR() << "Memory must be non-empty"; } - if (const auto* handle = std::get_if(&memory->handle)) { - return hidl_memory(memory->name, NN_TRY(hidlHandleFromSharedHandle(*handle)), memory->size); - } - - const auto* ahwb = std::get(memory->handle).get(); - AHardwareBuffer_Desc bufferDesc; - AHardwareBuffer_describe(ahwb, &bufferDesc); - - if (bufferDesc.format == AHARDWAREBUFFER_FORMAT_BLOB) { - CHECK_EQ(memory->size, bufferDesc.width); - CHECK_EQ(memory->name, "hardware_buffer_blob"); - } else { - CHECK_EQ(memory->size, 0u); - CHECK_EQ(memory->name, "hardware_buffer"); - } - - const native_handle_t* nativeHandle = AHardwareBuffer_getNativeHandle(ahwb); - const hidl_handle hidlHandle(nativeHandle); - hidl_handle handle(hidlHandle); - - return hidl_memory(memory->name, std::move(handle), memory->size); + return std::visit([](const auto& x) { return createHidlMemoryFrom(x); }, memory->handle); } static uint32_t roundUpToMultiple(uint32_t value, uint32_t multiple) { @@ -283,14 +316,53 @@ static uint32_t roundUpToMultiple(uint32_t value, uint32_t multiple) { } nn::GeneralResult createSharedMemoryFromHidlMemory(const hidl_memory& memory) { - CHECK_LE(memory.size(), std::numeric_limits::max()); + CHECK_LE(memory.size(), std::numeric_limits::max()); + if (!memory.valid()) { + return NN_ERROR() << "Unable to convert invalid hidl_memory"; + } + + if (memory.name() == "ashmem") { + if (memory.handle()->numFds != 1) { + return NN_ERROR() << "Unable to convert invalid ashmem memory object with " + << memory.handle()->numFds << " numFds, but expected 1"; + } + if (memory.handle()->numInts != 0) { + return NN_ERROR() << "Unable to convert invalid ashmem memory object with " + << memory.handle()->numInts << " numInts, but expected 0"; + } + auto handle = nn::Memory::Ashmem{ + .fd = NN_TRY(nn::dupFd(memory.handle()->data[0])), + .size = static_cast(memory.size()), + }; + return std::make_shared(nn::Memory{.handle = std::move(handle)}); + } + + if (memory.name() == "mmap_fd") { + if (memory.handle()->numFds != 1) { + return NN_ERROR() << "Unable to convert invalid mmap_fd memory object with " + << memory.handle()->numFds << " numFds, but expected 1"; + } + if (memory.handle()->numInts != 3) { + return NN_ERROR() << "Unable to convert invalid mmap_fd memory object with " + << memory.handle()->numInts << " numInts, but expected 3"; + } + + const int fd = memory.handle()->data[0]; + const int prot = memory.handle()->data[1]; + const int lower = memory.handle()->data[2]; + const int higher = memory.handle()->data[3]; + const size_t offset = nn::getOffsetFromInts(lower, higher); + + return nn::createSharedMemoryFromFd(static_cast(memory.size()), prot, fd, offset); + } if (memory.name() != "hardware_buffer_blob") { - return std::make_shared(nn::Memory{ + auto handle = nn::Memory::Unknown{ .handle = NN_TRY(sharedHandleFromNativeHandle(memory.handle())), - .size = static_cast(memory.size()), + .size = static_cast(memory.size()), .name = memory.name(), - }); + }; + return std::make_shared(nn::Memory{.handle = std::move(handle)}); } const auto size = memory.size(); @@ -328,11 +400,7 @@ nn::GeneralResult createSharedMemoryFromHidlMemory(const hidl_ << "Can't create AHardwareBuffer from handle. Error: " << status; } - return std::make_shared(nn::Memory{ - .handle = nn::HardwareBufferHandle(hardwareBuffer, /*takeOwnership=*/true), - .size = static_cast(memory.size()), - .name = memory.name(), - }); + return nn::createSharedMemoryFromAHWB(hardwareBuffer, /*takeOwnership=*/true); } nn::GeneralResult hidlHandleFromSharedHandle(const nn::Handle& handle) { -- GitLab From d99d544f086fcfb3dae1bf8c96afaf3e973159ed Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Wed, 7 Apr 2021 14:12:12 -0700 Subject: [PATCH 046/825] [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces Added SPDX-license-identifier-Apache-2.0 to: soundtrigger/aidl/Android.bp soundtrigger/aidl/cli/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: I5bb1bf59e40996301a0b002211669de320d3cfb3 --- soundtrigger/aidl/Android.bp | 9 +++++++++ soundtrigger/aidl/cli/Android.bp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/soundtrigger/aidl/Android.bp b/soundtrigger/aidl/Android.bp index 6c084da740..fcccc27722 100644 --- a/soundtrigger/aidl/Android.bp +++ b/soundtrigger/aidl/Android.bp @@ -1,3 +1,12 @@ +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.soundtrigger3", vendor_available: true, diff --git a/soundtrigger/aidl/cli/Android.bp b/soundtrigger/aidl/cli/Android.bp index 880903a4c2..e8999ff6b1 100644 --- a/soundtrigger/aidl/cli/Android.bp +++ b/soundtrigger/aidl/cli/Android.bp @@ -1,3 +1,12 @@ +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"], +} + java_binary { name: "sthal_cli_3", wrapper: "sthal_cli_3", -- GitLab From 520e0adb58ea871d2a5d3ae3c102e08bc8060d65 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Thu, 15 Apr 2021 16:27:01 +0000 Subject: [PATCH 047/825] Revert "Update Readback VTS to align with RenderEngine interface..." Revert "Update WaylandRenderSurface to accomodate interface change" Revert "Add ExternalTexture class into RenderEngine interface" Revert submission 14086921-renderengine-external-tex Reason for revert: Potential culprit for b/185361988 Reverted Changes: I7796764e2:Update WaylandRenderSurface to accomodate interfac... I13904eec4:Update Readback VTS to align with RenderEngine int... I222c71e6e:Add ExternalTexture class into RenderEngine interf... Change-Id: I7d58118c1c2284a04eb52e992e901d82faaf5bb0 (cherry picked from commit 51daee615fd434d768986b8dc8e5207165c2a603) --- .../composer/2.2/utils/vts/ReadbackVts.cpp | 15 +++---- .../2.2/utils/vts/RenderEngineVts.cpp | 4 +- .../include/composer-vts/2.2/ReadbackVts.h | 6 +-- .../composer-vts/2.2/RenderEngineVts.h | 6 --- ...VtsHalGraphicsComposerV2_2ReadbackTest.cpp | 44 +++++++++---------- 5 files changed, 29 insertions(+), 46 deletions(-) diff --git a/graphics/composer/2.2/utils/vts/ReadbackVts.cpp b/graphics/composer/2.2/utils/vts/ReadbackVts.cpp index 19f5e8c614..b179f35109 100644 --- a/graphics/composer/2.2/utils/vts/ReadbackVts.cpp +++ b/graphics/composer/2.2/utils/vts/ReadbackVts.cpp @@ -15,8 +15,6 @@ */ #include -#include -#include "renderengine/ExternalTexture.h" namespace android { namespace hardware { @@ -259,11 +257,10 @@ LayerSettings TestColorLayer::toRenderEngineLayerSettings() { } TestBufferLayer::TestBufferLayer(const std::shared_ptr& client, - const std::shared_ptr& gralloc, - TestRenderEngine& renderEngine, Display display, int32_t width, - int32_t height, PixelFormat format, + const std::shared_ptr& gralloc, Display display, + int32_t width, int32_t height, PixelFormat format, IComposerClient::Composition composition) - : TestLayer{client, display}, mRenderEngine(renderEngine) { + : TestLayer{client, display} { mGralloc = gralloc; mComposition = composition; mWidth = width; @@ -296,11 +293,9 @@ void TestBufferLayer::write(const std::shared_ptr& writer) { LayerSettings TestBufferLayer::toRenderEngineLayerSettings() { LayerSettings layerSettings = TestLayer::toRenderEngineLayerSettings(); - layerSettings.source.buffer.buffer = std::make_shared( + layerSettings.source.buffer.buffer = new GraphicBuffer(mBufferHandle, GraphicBuffer::CLONE_HANDLE, mWidth, mHeight, - static_cast(mFormat), 1, mUsage, mStride), - mRenderEngine.getInternalRenderEngine(), - renderengine::ExternalTexture::Usage::READABLE); + static_cast(mFormat), 1, mUsage, mStride); layerSettings.source.buffer.usePremultipliedAlpha = mBlendMode == IComposerClient::BlendMode::PREMULTIPLIED; diff --git a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp index f78dda2689..3becacea91 100644 --- a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp +++ b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp @@ -69,9 +69,7 @@ void TestRenderEngine::drawLayers() { [](renderengine::LayerSettings& settings) -> renderengine::LayerSettings* { return &settings; }); - auto texture = std::make_shared( - mGraphicBuffer, *mRenderEngine, renderengine::ExternalTexture::Usage::WRITEABLE); - mRenderEngine->drawLayers(mDisplaySettings, compositionLayerPointers, texture, true, + mRenderEngine->drawLayers(mDisplaySettings, compositionLayerPointers, mGraphicBuffer, true, std::move(bufferFence), &readyFence); int fd = readyFence.release(); if (fd != -1) { 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 b24e3b63bd..d5eedf122c 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 @@ -50,8 +50,6 @@ static const IComposerClient::Color TRANSLUCENT_RED = {0xff, 0, 0, 0x33}; static const IComposerClient::Color GREEN = {0, 0xff, 0, 0xff}; static const IComposerClient::Color BLUE = {0, 0, 0xff, 0xff}; -class TestRenderEngine; - class TestLayer { public: TestLayer(const std::shared_ptr& client, Display display) @@ -112,8 +110,7 @@ class TestBufferLayer : public TestLayer { public: TestBufferLayer( const std::shared_ptr& client, const std::shared_ptr& gralloc, - TestRenderEngine& renderEngine, Display display, int32_t width, int32_t height, - PixelFormat format, + Display display, int32_t width, int32_t height, PixelFormat format, IComposerClient::Composition composition = IComposerClient::Composition::DEVICE); ~TestBufferLayer(); @@ -141,7 +138,6 @@ class TestBufferLayer : public TestLayer { protected: IComposerClient::Composition mComposition; std::shared_ptr mGralloc; - TestRenderEngine& mRenderEngine; int32_t mFillFence; const native_handle_t* mBufferHandle = nullptr; }; 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 26027d33a2..f2d5f1933f 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 @@ -14,12 +14,9 @@ * limitations under the License. */ -#pragma once - #include #include #include -#include #include #include #include @@ -54,15 +51,12 @@ class TestRenderEngine { void drawLayers(); void checkColorBuffer(std::vector& expectedColors); - renderengine::RenderEngine& getInternalRenderEngine() { return *mRenderEngine; } - private: common::V1_1::PixelFormat mFormat; std::vector mCompositionLayers; std::unique_ptr mRenderEngine; std::vector mRenderLayers; sp mGraphicBuffer; - DisplaySettings mDisplaySettings; }; diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp index 8d52173e59..1463c3be6c 100644 --- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp +++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp @@ -288,9 +288,9 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, BLUE); - auto layer = std::make_shared( - mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, PixelFormat::RGBA_8888); + auto layer = std::make_shared(mComposerClient, mGralloc, mPrimaryDisplay, + mDisplayWidth, mDisplayHeight, + PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); @@ -422,9 +422,9 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, BLUE); - auto layer = std::make_shared( - mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, PixelFormat::RGBA_FP16); + auto layer = std::make_shared(mComposerClient, mGralloc, mPrimaryDisplay, + mDisplayWidth, mDisplayHeight, + PixelFormat::RGBA_FP16); layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); @@ -538,8 +538,8 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); auto deviceLayer = std::make_shared( - mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight / 2, PixelFormat::RGBA_8888); + mComposerClient, mGralloc, mPrimaryDisplay, mDisplayWidth, mDisplayHeight / 2, + PixelFormat::RGBA_8888); std::vector deviceColors(deviceLayer->mWidth * deviceLayer->mHeight); ReadbackHelper::fillColorsArea(deviceColors, deviceLayer->mWidth, @@ -575,8 +575,8 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { } auto clientLayer = std::make_shared( - mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, clientWidth, - clientHeight, PixelFormat::RGBA_FP16, IComposerClient::Composition::DEVICE); + mComposerClient, mGralloc, mPrimaryDisplay, clientWidth, clientHeight, + PixelFormat::RGBA_FP16, IComposerClient::Composition::DEVICE); IComposerClient::Rect clientFrame = {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}; clientLayer->setDisplayFrame(clientFrame); clientLayer->setZOrder(0); @@ -657,9 +657,9 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { std::vector expectedColors(mDisplayWidth * mDisplayHeight); ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); - auto layer = std::make_shared( - mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, PixelFormat::RGBA_8888); + auto layer = std::make_shared(mComposerClient, mGralloc, mPrimaryDisplay, + mDisplayWidth, mDisplayHeight, + PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); @@ -805,9 +805,9 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, BLUE); - auto layer = std::make_shared( - mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, PixelFormat::RGBA_8888); + auto layer = std::make_shared(mComposerClient, mGralloc, mPrimaryDisplay, + mDisplayWidth, mDisplayHeight, + PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); @@ -957,9 +957,9 @@ class GraphicsBlendModeCompositionTest backgroundLayer->setZOrder(0); backgroundLayer->setColor(mBackgroundColor); - auto layer = std::make_shared( - mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, PixelFormat::RGBA_8888); + auto layer = std::make_shared(mComposerClient, mGralloc, mPrimaryDisplay, + mDisplayWidth, mDisplayHeight, + PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); layer->setZOrder(10); layer->setDataspace(Dataspace::UNKNOWN, mWriter); @@ -1195,9 +1195,9 @@ class GraphicsTransformCompositionTest : public GraphicsCompositionTest { IComposerClient::Rect blueRect = {mSideLength / 2, mSideLength / 2, mSideLength, mSideLength}; - mLayer = std::make_shared(mComposerClient, mGralloc, *mTestRenderEngine, - mPrimaryDisplay, mSideLength, mSideLength, - PixelFormat::RGBA_8888); + mLayer = + std::make_shared(mComposerClient, mGralloc, mPrimaryDisplay, + mSideLength, mSideLength, PixelFormat::RGBA_8888); mLayer->setDisplayFrame({0, 0, mSideLength, mSideLength}); mLayer->setZOrder(10); -- GitLab From 1de210f40a704a7e9a4d7ea0411acee370c23374 Mon Sep 17 00:00:00 2001 From: Joe Huang Date: Tue, 27 Apr 2021 19:32:49 +0800 Subject: [PATCH 048/825] Add additonal doc for SatellitePvt Bug: 183239007 Test: atest VtsHalGnssTargetTest Change-Id: I83d1aefd594be9616630ef17cdc1027d39bc0086 --- .../hardware/gnss/GnssMeasurement.aidl | 11 ++++++++++ .../hardware/gnss/SatelliteClockInfo.aidl | 21 ++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl b/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl index 336e9272a6..58f29c5f92 100644 --- a/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl @@ -625,6 +625,17 @@ parcelable GnssMeasurement { * The position and velocity must be in ECEF coordinates. * * If the data is available, gnssMeasurementFlags must contain HAS_SATELLITE_PVT. + * + * If SatellitePvt is derived from Broadcast ephemeris, then the position is already w.r.t. + * the antenna phase center. However, if SatellitePvt is derived from other modeled orbits, + * such as long-term-orbits, or precise orbits, then the orbits may have been computed w.r.t. + * the satellite center of mass, and then GNSS vendors are expected to correct for the effect + * on different phase centers (can differ by meters) of different GNSS signals (e.g. L1, L5) + * on the reported satellite position. Accordingly, we might observe a different satellite + * position reported for L1 GnssMeasurement struct compared to L5 GnssMeasurement struct. + * + * If receivedSvTimeNs is not fully decoded, Satellite PVT could still be reported and + * receivedSvTimeNs uncertainty field would be used to provide confidence. */ SatellitePvt satellitePvt; diff --git a/gnss/aidl/android/hardware/gnss/SatelliteClockInfo.aidl b/gnss/aidl/android/hardware/gnss/SatelliteClockInfo.aidl index 844fd1c47d..4b7d5d68cb 100644 --- a/gnss/aidl/android/hardware/gnss/SatelliteClockInfo.aidl +++ b/gnss/aidl/android/hardware/gnss/SatelliteClockInfo.aidl @@ -24,6 +24,14 @@ parcelable SatelliteClockInfo { /** * Satellite hardware code bias of the reported code type w.r.t * ionosphere-free measurement in meters. + * + * When broadcast ephemeris is used, this is the offset caused + * by the satellite hardware delays at different frequencies; + * e.g. in IS-GPS-705D, this term is described in Section + * 20.3.3.3.1.2.1. + * + * For GPS this term is ~10ns, and affects the satellite position + * computation by less than a millimeter. */ double satHardwareCodeBiasMeters; @@ -31,9 +39,20 @@ parcelable SatelliteClockInfo { * Satellite time correction for ionospheric-free signal measurement * (meters). The satellite clock correction for the given signal type * = satTimeCorrectionMeters - satHardwareCodeBiasMeters. + * + * When broadcast ephemeris is used, this is the offset modeled in the + * clock terms broadcast over the air by the satellites; + * e.g. in IS-GPS-200H, Section 20.3.3.3.3.1, this term is + * ∆tsv = af0 + af1(t - toc) + af2(t - toc)^2 + ∆tr. + * + * If another source of ephemeris is used for SatellitePvt, then the + * equivalent value of satTimeCorrection must be provided. + * + * For GPS this term is ~1ms, and affects the satellite position + * computation by ~1m. */ double satTimeCorrectionMeters; /** Satellite clock drift (meters per second). */ double satClkDriftMps; -} \ No newline at end of file +} -- GitLab From 402d62f7bee0ef162d25543886a5310b1ebb9221 Mon Sep 17 00:00:00 2001 From: Paul Crowley Date: Thu, 29 Apr 2021 10:07:30 -0700 Subject: [PATCH 049/825] Add getKeyCharacteristics method to KeyMint Bug: 186685601 Test: Treehugger Change-Id: Ie72d865a37e2b6834fe6a86bf843d30286384aa5 --- .../security/keymint/IKeyMintDevice.aidl | 1 + .../security/keymint/IKeyMintDevice.aidl | 25 ++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/current/android/hardware/security/keymint/IKeyMintDevice.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/current/android/hardware/security/keymint/IKeyMintDevice.aidl index 3f75af6dd0..fa643fc494 100644 --- a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/current/android/hardware/security/keymint/IKeyMintDevice.aidl +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/current/android/hardware/security/keymint/IKeyMintDevice.aidl @@ -48,5 +48,6 @@ interface IKeyMintDevice { void deviceLocked(in boolean passwordOnly, in @nullable android.hardware.security.secureclock.TimeStampToken timestampToken); void earlyBootEnded(); byte[] convertStorageKeyToEphemeral(in byte[] storageKeyBlob); + android.hardware.security.keymint.KeyCharacteristics[] getKeyCharacteristics(in byte[] keyBlob, in byte[] appId, in byte[] appData); const int AUTH_TOKEN_MAC_LENGTH = 32; } diff --git a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl index a3260f51c6..b4a2bed72d 100644 --- a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl +++ b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl @@ -20,6 +20,7 @@ import android.hardware.security.keymint.AttestationKey; import android.hardware.security.keymint.BeginResult; import android.hardware.security.keymint.HardwareAuthToken; import android.hardware.security.keymint.IKeyMintOperation; +import android.hardware.security.keymint.KeyCharacteristics; import android.hardware.security.keymint.KeyCreationResult; import android.hardware.security.keymint.KeyFormat; import android.hardware.security.keymint.KeyMintHardwareInfo; @@ -766,7 +767,7 @@ interface IKeyMintDevice { */ void earlyBootEnded(); - /* + /** * Called by the client to get a wrapped per-boot ephemeral key from a wrapped storage key. * Clients will then use the returned per-boot ephemeral key in place of the wrapped storage * key. Whenever the hardware is presented with a per-boot ephemeral key for an operation, it @@ -786,4 +787,26 @@ interface IKeyMintDevice { * place of the input storageKeyBlob */ byte[] convertStorageKeyToEphemeral(in byte[] storageKeyBlob); + + /** + * Returns parameters associated with the provided key. This should match the + * KeyCharacteristics present in the KeyCreationResult returned by generateKey(), + * importKey(), or importWrappedKey(). + * + * @param keyBlob The opaque descriptor returned by generateKey, importKey or importWrappedKey. + * + * @param appId An opaque byte string identifying the client. This value must match the + * Tag::APPLICATION_ID data provided during key generation/import. Without the correct + * value, it must be computationally infeasible for the secure hardware to obtain the + * key material. + * + * @param appData An opaque byte string provided by the application. This value must match the + * Tag::APPLICATION_DATA data provided during key generation/import. Without the + * correct value, it must be computationally infeasible for the secure hardware to + * obtain the key material. + * + * @return Characteristics of the generated key. See KeyCreationResult for details. + */ + KeyCharacteristics[] getKeyCharacteristics( + in byte[] keyBlob, in byte[] appId, in byte[] appData); } -- GitLab From ca8504a4fef7bfc48880292f74f82002ccf835f6 Mon Sep 17 00:00:00 2001 From: Chris Weir Date: Fri, 30 Apr 2021 11:44:32 -0700 Subject: [PATCH 050/825] Update nl::Socket for TCU-gRPC Add a new wrapper for nl::Socket::send() that doesn't require sockaddr_nl to be passed in, just a uint32_t pid. Bug: 173213787 Test: manual - switch hu/tcu to use new send() function and verify that they still work. Change-Id: Iba49f8b3db35d96772fc0cc0a5b0aca5fb4ae307 --- automotive/can/1.0/default/libnl++/Socket.cpp | 5 +++++ .../can/1.0/default/libnl++/include/libnl++/Socket.h | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/automotive/can/1.0/default/libnl++/Socket.cpp b/automotive/can/1.0/default/libnl++/Socket.cpp index 514d9bb1b9..b0e67beee3 100644 --- a/automotive/can/1.0/default/libnl++/Socket.cpp +++ b/automotive/can/1.0/default/libnl++/Socket.cpp @@ -68,6 +68,11 @@ bool Socket::send(const Buffer& msg, const sockaddr_nl& sa) { return true; } +bool Socket::send(const Buffer& msg, uint32_t destination) { + sockaddr_nl sa = {.nl_family = AF_NETLINK, .nl_pad = 0, .nl_pid = destination, .nl_groups = 0}; + return send(msg, sa); +} + bool Socket::increaseReceiveBuffer(size_t maxSize) { if (maxSize == 0) { LOG(ERROR) << "Maximum receive size should not be zero"; diff --git a/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h b/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h index 8ea3575720..118b9f7b20 100644 --- a/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h +++ b/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h @@ -94,6 +94,15 @@ class Socket { */ bool send(const Buffer& msg, const sockaddr_nl& sa); + /** + * Send Netlink message. + * + * \param msg Message to send. + * \param destination Destination PID. + * \return true, if succeeded. + */ + bool send(const Buffer& msg, uint32_t destination); + /** * Receive one or multiple Netlink messages. * -- GitLab From 0b7c287fc8d4be9ffed55167be40c9d086e42d1f Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Wed, 12 May 2021 12:21:33 -0700 Subject: [PATCH 051/825] Use PropStore on the Server Side to Simulate ECU Test: build and unit tests Bug: 188005769 Change-Id: I5aff41acbc4795def84ceb8e363019ff9668120c --- automotive/vehicle/2.0/default/Android.bp | 1 + .../include/vhal_v2_0/VehiclePropertyStore.h | 3 +- .../impl/vhal_v2_0/VehicleHalServer.cpp | 63 ++++++++++++++++--- .../default/impl/vhal_v2_0/VehicleHalServer.h | 4 ++ 4 files changed, 62 insertions(+), 9 deletions(-) diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp index 21c1a6e854..ffa0c13958 100644 --- a/automotive/vehicle/2.0/default/Android.bp +++ b/automotive/vehicle/2.0/default/Android.bp @@ -134,6 +134,7 @@ cc_library_static { srcs: [ "common/src/Obd2SensorStore.cpp", "common/src/VehicleObjectPool.cpp", + "common/src/VehiclePropertyStore.cpp", "common/src/VehicleUtils.cpp", ], } 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 0a243fe352..6a02cf3cab 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 @@ -19,10 +19,11 @@ #include #include +#include #include #include -#include +#include namespace android { namespace hardware { diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.cpp index 6b870527c3..1e468975a2 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.cpp @@ -30,6 +30,58 @@ namespace android::hardware::automotive::vehicle::V2_0::impl { +static bool isDiagnosticProperty(VehiclePropConfig propConfig) { + switch (propConfig.prop) { + case OBD2_LIVE_FRAME: + case OBD2_FREEZE_FRAME: + case OBD2_FREEZE_FRAME_CLEAR: + case OBD2_FREEZE_FRAME_INFO: + return true; + } + return false; +} + +VehicleHalServer::VehicleHalServer() { + constexpr bool shouldUpdateStatus = true; + + for (auto& it : kVehicleProperties) { + VehiclePropConfig cfg = it.config; + + mServerSidePropStore.registerProperty(cfg); + + if (isDiagnosticProperty(cfg)) { + continue; + } + + // A global property will have only a single area + int32_t numAreas = isGlobalProp(cfg.prop) ? 1 : cfg.areaConfigs.size(); + + for (int i = 0; i < numAreas; i++) { + int32_t curArea = isGlobalProp(cfg.prop) ? 0 : cfg.areaConfigs[i].areaId; + + // Create a separate instance for each individual zone + VehiclePropValue prop = { + .areaId = curArea, + .prop = cfg.prop, + }; + + if (it.initialAreaValues.empty()) { + prop.value = it.initialValue; + } else if (auto valueForAreaIt = it.initialAreaValues.find(curArea); + valueForAreaIt != it.initialAreaValues.end()) { + prop.value = valueForAreaIt->second; + } else { + LOG(WARNING) << __func__ << " failed to get default value for" + << " prop 0x" << std::hex << cfg.prop << " area 0x" << std::hex + << curArea; + prop.status = VehiclePropertyStatus::UNAVAILABLE; + } + + mServerSidePropStore.writeValue(prop, shouldUpdateStatus); + } + } +} + GeneratorHub* VehicleHalServer::getGenerator() { return &mGeneratorHub; } @@ -55,19 +107,13 @@ void VehicleHalServer::onFakeValueGenerated(const VehiclePropValue& value) { if (updatedPropValue) { updatedPropValue->timestamp = value.timestamp; updatedPropValue->status = VehiclePropertyStatus::AVAILABLE; + mServerSidePropStore.writeValue(*updatedPropValue, updateStatus); onPropertyValueFromCar(*updatedPropValue, updateStatus); } } std::vector VehicleHalServer::onGetAllPropertyConfig() const { - std::vector vehiclePropConfigs; - constexpr size_t numOfVehiclePropConfigs = - sizeof(kVehicleProperties) / sizeof(kVehicleProperties[0]); - vehiclePropConfigs.reserve(numOfVehiclePropConfigs); - for (auto& it : kVehicleProperties) { - vehiclePropConfigs.emplace_back(it.config); - } - return vehiclePropConfigs; + return mServerSidePropStore.getAllConfigs(); } StatusCode VehicleHalServer::handleGenerateFakeDataRequest(const VehiclePropValue& request) { @@ -278,6 +324,7 @@ StatusCode VehicleHalServer::onSetProperty(const VehiclePropValue& value, bool u auto updatedPropValue = getValuePool()->obtain(value); updatedPropValue->timestamp = elapsedRealtimeNano(); + mServerSidePropStore.writeValue(*updatedPropValue, updateStatus); onPropertyValueFromCar(*updatedPropValue, updateStatus); return StatusCode::OK; } diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.h index 117eadb1e2..2ad75e368a 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.h @@ -17,6 +17,7 @@ #pragma once #include +#include #include #include "GeneratorHub.h" @@ -28,6 +29,8 @@ namespace android::hardware::automotive::vehicle::V2_0::impl { // scenario, the server may be run on a different OS than Android. class VehicleHalServer : public IVehicleServer { public: + VehicleHalServer(); + // Methods from IVehicleServer std::vector onGetAllPropertyConfig() const override; @@ -58,6 +61,7 @@ class VehicleHalServer : public IVehicleServer { std::bind(&VehicleHalServer::onFakeValueGenerated, this, std::placeholders::_1)}; VehiclePropValuePool* mValuePool{nullptr}; + VehiclePropertyStore mServerSidePropStore; }; } // namespace android::hardware::automotive::vehicle::V2_0::impl -- GitLab From 4c9d6b0d1b1d384cdcb79fa98d568c9f75421d44 Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Wed, 12 May 2021 14:24:52 -0700 Subject: [PATCH 052/825] Split the utility parts out of DefaultConfig.h So that the client side may use the utilities without introducing the "default configs". "default configs" should only be visible to the server, and the vehicle hal server will take care of configs. Test: build and unit tests Bug: 188005769 Change-Id: If418dcdd1c5b261179104bb414c52f3eb04d3ea8 --- .../default/impl/vhal_v2_0/DefaultConfig.h | 176 +--------------- .../default/impl/vhal_v2_0/PropertyUtils.h | 197 ++++++++++++++++++ 2 files changed, 198 insertions(+), 175 deletions(-) create mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h 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 81f31987e0..1f3bac1a8a 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,8 +17,7 @@ #ifndef android_hardware_automotive_vehicle_V2_0_impl_DefaultConfig_H_ #define android_hardware_automotive_vehicle_V2_0_impl_DefaultConfig_H_ -#include -#include +#include "PropertyUtils.h" #include @@ -29,179 +28,6 @@ namespace vehicle { namespace V2_0 { namespace impl { -// -// Some handy constants to avoid conversions from enum to int. -constexpr int ABS_ACTIVE = (int)VehicleProperty::ABS_ACTIVE; -constexpr int AP_POWER_STATE_REQ = (int)VehicleProperty::AP_POWER_STATE_REQ; -constexpr int AP_POWER_STATE_REPORT = (int)VehicleProperty::AP_POWER_STATE_REPORT; -constexpr int DOOR_1_LEFT = (int)VehicleAreaDoor::ROW_1_LEFT; -constexpr int DOOR_1_RIGHT = (int)VehicleAreaDoor::ROW_1_RIGHT; -constexpr int DOOR_2_LEFT = (int)VehicleAreaDoor::ROW_2_LEFT; -constexpr int DOOR_2_RIGHT = (int)VehicleAreaDoor::ROW_2_RIGHT; -constexpr int DOOR_REAR = (int)VehicleAreaDoor::REAR; -constexpr int WINDOW_1_LEFT = (int)VehicleAreaWindow::ROW_1_LEFT; -constexpr int WINDOW_1_RIGHT = (int)VehicleAreaWindow::ROW_1_RIGHT; -constexpr int WINDOW_2_LEFT = (int)VehicleAreaWindow::ROW_2_LEFT; -constexpr int WINDOW_2_RIGHT = (int)VehicleAreaWindow::ROW_2_RIGHT; -constexpr int WINDOW_ROOF_TOP_1 = (int)VehicleAreaWindow::ROOF_TOP_1; -constexpr int FAN_DIRECTION_FACE = (int)VehicleHvacFanDirection::FACE; -constexpr int FAN_DIRECTION_FLOOR = (int)VehicleHvacFanDirection::FLOOR; -constexpr int OBD2_LIVE_FRAME = (int)VehicleProperty::OBD2_LIVE_FRAME; -constexpr int OBD2_FREEZE_FRAME = (int)VehicleProperty::OBD2_FREEZE_FRAME; -constexpr int OBD2_FREEZE_FRAME_INFO = (int)VehicleProperty::OBD2_FREEZE_FRAME_INFO; -constexpr int OBD2_FREEZE_FRAME_CLEAR = (int)VehicleProperty::OBD2_FREEZE_FRAME_CLEAR; -constexpr int TRACTION_CONTROL_ACTIVE = (int)VehicleProperty::TRACTION_CONTROL_ACTIVE; -constexpr int VEHICLE_MAP_SERVICE = (int)VehicleProperty::VEHICLE_MAP_SERVICE; -constexpr int WHEEL_TICK = (int)VehicleProperty::WHEEL_TICK; -constexpr int ALL_WHEELS = - (int)(VehicleAreaWheel::LEFT_FRONT | VehicleAreaWheel::RIGHT_FRONT | - VehicleAreaWheel::LEFT_REAR | VehicleAreaWheel::RIGHT_REAR); -constexpr int SEAT_1_LEFT = (int)(VehicleAreaSeat::ROW_1_LEFT); -constexpr int SEAT_1_RIGHT = (int)(VehicleAreaSeat::ROW_1_RIGHT); -constexpr int HVAC_LEFT = (int)(VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_2_LEFT | - VehicleAreaSeat::ROW_2_CENTER); -constexpr int HVAC_RIGHT = (int)(VehicleAreaSeat::ROW_1_RIGHT | VehicleAreaSeat::ROW_2_RIGHT); -constexpr int HVAC_ALL = HVAC_LEFT | HVAC_RIGHT; -constexpr int VENDOR_EXTENSION_BOOLEAN_PROPERTY = - (int)(0x101 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::BOOLEAN | VehicleArea::DOOR); -constexpr int VENDOR_EXTENSION_FLOAT_PROPERTY = - (int)(0x102 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::FLOAT | VehicleArea::SEAT); -constexpr int VENDOR_EXTENSION_INT_PROPERTY = - (int)(0x103 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::INT32 | VehicleArea::WINDOW); -constexpr int VENDOR_EXTENSION_STRING_PROPERTY = - (int)(0x104 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::STRING | VehicleArea::GLOBAL); -constexpr int FUEL_DOOR_REAR_LEFT = (int)PortLocationType::REAR_LEFT; -constexpr int CHARGE_PORT_FRONT_LEFT = (int)PortLocationType::FRONT_LEFT; -constexpr int CHARGE_PORT_REAR_LEFT = (int)PortLocationType::REAR_LEFT; -constexpr int LIGHT_STATE_ON = (int)VehicleLightState::ON; -constexpr int LIGHT_SWITCH_AUTO = (int)VehicleLightSwitch::AUTOMATIC; -constexpr int WHEEL_FRONT_LEFT = (int)VehicleAreaWheel::LEFT_FRONT; -constexpr int WHEEL_FRONT_RIGHT = (int)VehicleAreaWheel::RIGHT_FRONT; -constexpr int WHEEL_REAR_LEFT = (int)VehicleAreaWheel::LEFT_REAR; -constexpr int WHEEL_REAR_RIGHT = (int)VehicleAreaWheel::RIGHT_REAR; - -/** - * This property is used for test purpose to generate fake events. Here is the test package that - * is referencing this property definition: packages/services/Car/tests/vehiclehal_test - */ -const int32_t kGenerateFakeDataControllingProperty = - 0x0666 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; - -/** - * This property is used for test purpose to set properties' value from vehicle. - * For example: Mocking hard button press triggering a HVAC fan speed change. - * Android set kSetPropertyFromVehicleForTest with an array of integer {HVAC_FAN_SPEED, value of - * fan speed} and a long value indicates the timestamp of the events . - * It only works with integer type properties. - */ -const int32_t kSetIntPropertyFromVehicleForTest = - 0x1112 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; -/** - * This property is used for test purpose to set properties' value from vehicle. - * It only works with float type properties. - */ -const int32_t kSetFloatPropertyFromVehicleForTest = - 0x1113 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; -/** - * This property is used for test purpose to set properties' value from vehicle. - * It only works with boolean type properties. - */ -const int32_t kSetBooleanPropertyFromVehicleForTest = - 0x1114 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; - -/** - * This property is used for test purpose. End to end tests use this property to test set and get - * method for MIXED type properties. - */ -const int32_t kMixedTypePropertyForTest = - 0x1111 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; - -#ifdef ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING -/** - * 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(VehicleProperty prop) { - return (toInt(prop) & ~toInt(VehiclePropertyGroup::MASK)) | VehiclePropertyGroup::VENDOR; -} - -/** - * These properties are used for the end-to-end testing of ClusterHomeService. - */ -constexpr int32_t VENDOR_CLUSTER_SWITCH_UI = toVendor(VehicleProperty::CLUSTER_SWITCH_UI); -constexpr int32_t VENDOR_CLUSTER_DISPLAY_STATE = toVendor(VehicleProperty::CLUSTER_DISPLAY_STATE); -constexpr int32_t VENDOR_CLUSTER_REPORT_STATE = toVendor(VehicleProperty::CLUSTER_REPORT_STATE); -constexpr int32_t VENDOR_CLUSTER_REQUEST_DISPLAY = - toVendor(VehicleProperty::CLUSTER_REQUEST_DISPLAY); -constexpr int32_t VENDOR_CLUSTER_NAVIGATION_STATE = - toVendor(VehicleProperty::CLUSTER_NAVIGATION_STATE); -#endif // ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING - -/** - * FakeDataCommand enum defines the supported command type for kGenerateFakeDataControllingProperty. - * All those commands can be send independently with each other. And each will override the one sent - * previously. - * - * The controlling property has the following format: - * - * int32Values[0] - command enum defined in FakeDataCommand - * - * The format of the arguments is defined for each command type as below: - */ -enum class FakeDataCommand : int32_t { - /** - * Starts linear fake data generation. Caller must provide additional data: - * int32Values[1] - vehicle property to which command applies - * int64Values[0] - periodic interval in nanoseconds - * floatValues[0] - initial value - * floatValues[1] - dispersion defines the min/max value relative to initial value, where - * max = initial_value + dispersion, min = initial_value - dispersion. - * Dispersion should be non-negative, otherwise the behavior is undefined. - * floatValues[2] - increment, with every timer tick the value will be incremented by this - * amount. When reaching to max value, the current value will be set to - * min. It should be non-negative, otherwise the behavior is undefined. - */ - StartLinear = 0, - - /** Stops linear fake data generation that was triggered by StartLinear commands. - * int32Values[1] - vehicle property to which command applies. VHAL will stop the - * corresponding linear generation for that property. - */ - StopLinear = 1, - - /** - * Starts JSON-based fake data generation. It iterates through JSON-encoded VHAL events from a - * file and inject them to VHAL. The iteration can be repeated multiple times or infinitely. - * Caller must provide additional data: - * int32Values[1] - number of iterations. If it is not provided or -1. The iteration will be - * repeated infinite times. - * stringValue - path to the fake values JSON file - */ - StartJson = 2, - - /** - * Stops JSON-based fake data generation. As multiple JSON-based generation can happen at the - * same time. Caller must provide the path of fake value JSON file to stop the corresponding - * generation: - * stringValue - path to the fake values JSON file - */ - StopJson = 3, - - /** - * Injects key press event (HAL incorporates UP/DOWN acction and triggers 2 HAL events for every - * key-press). We set the enum with high number to leave space for future start/stop commands. - * Caller must provide the following data: - * int32Values[2] - Android key code - * int32Values[3] - target display (0 - for main display, 1 - for instrument cluster, see - * VehicleDisplay) - */ - KeyPress = 100, -}; - -const int32_t kHvacPowerProperties[] = { - toInt(VehicleProperty::HVAC_FAN_SPEED), - toInt(VehicleProperty::HVAC_FAN_DIRECTION), -}; struct ConfigDeclaration { VehiclePropConfig config; diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h new file mode 100644 index 0000000000..d5f6a1841e --- /dev/null +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h @@ -0,0 +1,197 @@ +/* + * 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 +#include + +namespace android::hardware::automotive::vehicle::V2_0::impl { + +// Some handy constants to avoid conversions from enum to int. +constexpr int ABS_ACTIVE = (int)VehicleProperty::ABS_ACTIVE; +constexpr int AP_POWER_STATE_REQ = (int)VehicleProperty::AP_POWER_STATE_REQ; +constexpr int AP_POWER_STATE_REPORT = (int)VehicleProperty::AP_POWER_STATE_REPORT; +constexpr int DOOR_1_LEFT = (int)VehicleAreaDoor::ROW_1_LEFT; +constexpr int DOOR_1_RIGHT = (int)VehicleAreaDoor::ROW_1_RIGHT; +constexpr int DOOR_2_LEFT = (int)VehicleAreaDoor::ROW_2_LEFT; +constexpr int DOOR_2_RIGHT = (int)VehicleAreaDoor::ROW_2_RIGHT; +constexpr int DOOR_REAR = (int)VehicleAreaDoor::REAR; +constexpr int WINDOW_1_LEFT = (int)VehicleAreaWindow::ROW_1_LEFT; +constexpr int WINDOW_1_RIGHT = (int)VehicleAreaWindow::ROW_1_RIGHT; +constexpr int WINDOW_2_LEFT = (int)VehicleAreaWindow::ROW_2_LEFT; +constexpr int WINDOW_2_RIGHT = (int)VehicleAreaWindow::ROW_2_RIGHT; +constexpr int WINDOW_ROOF_TOP_1 = (int)VehicleAreaWindow::ROOF_TOP_1; +constexpr int FAN_DIRECTION_FACE = (int)VehicleHvacFanDirection::FACE; +constexpr int FAN_DIRECTION_FLOOR = (int)VehicleHvacFanDirection::FLOOR; +constexpr int OBD2_LIVE_FRAME = (int)VehicleProperty::OBD2_LIVE_FRAME; +constexpr int OBD2_FREEZE_FRAME = (int)VehicleProperty::OBD2_FREEZE_FRAME; +constexpr int OBD2_FREEZE_FRAME_INFO = (int)VehicleProperty::OBD2_FREEZE_FRAME_INFO; +constexpr int OBD2_FREEZE_FRAME_CLEAR = (int)VehicleProperty::OBD2_FREEZE_FRAME_CLEAR; +constexpr int TRACTION_CONTROL_ACTIVE = (int)VehicleProperty::TRACTION_CONTROL_ACTIVE; +constexpr int VEHICLE_MAP_SERVICE = (int)VehicleProperty::VEHICLE_MAP_SERVICE; +constexpr int WHEEL_TICK = (int)VehicleProperty::WHEEL_TICK; +constexpr int ALL_WHEELS = + (int)(VehicleAreaWheel::LEFT_FRONT | VehicleAreaWheel::RIGHT_FRONT | + VehicleAreaWheel::LEFT_REAR | VehicleAreaWheel::RIGHT_REAR); +constexpr int SEAT_1_LEFT = (int)(VehicleAreaSeat::ROW_1_LEFT); +constexpr int SEAT_1_RIGHT = (int)(VehicleAreaSeat::ROW_1_RIGHT); +constexpr int HVAC_LEFT = (int)(VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_2_LEFT | + VehicleAreaSeat::ROW_2_CENTER); +constexpr int HVAC_RIGHT = (int)(VehicleAreaSeat::ROW_1_RIGHT | VehicleAreaSeat::ROW_2_RIGHT); +constexpr int HVAC_ALL = HVAC_LEFT | HVAC_RIGHT; +constexpr int VENDOR_EXTENSION_BOOLEAN_PROPERTY = + (int)(0x101 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::BOOLEAN | VehicleArea::DOOR); +constexpr int VENDOR_EXTENSION_FLOAT_PROPERTY = + (int)(0x102 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::FLOAT | VehicleArea::SEAT); +constexpr int VENDOR_EXTENSION_INT_PROPERTY = + (int)(0x103 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::INT32 | VehicleArea::WINDOW); +constexpr int VENDOR_EXTENSION_STRING_PROPERTY = + (int)(0x104 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::STRING | VehicleArea::GLOBAL); +constexpr int FUEL_DOOR_REAR_LEFT = (int)PortLocationType::REAR_LEFT; +constexpr int CHARGE_PORT_FRONT_LEFT = (int)PortLocationType::FRONT_LEFT; +constexpr int CHARGE_PORT_REAR_LEFT = (int)PortLocationType::REAR_LEFT; +constexpr int LIGHT_STATE_ON = (int)VehicleLightState::ON; +constexpr int LIGHT_SWITCH_AUTO = (int)VehicleLightSwitch::AUTOMATIC; +constexpr int WHEEL_FRONT_LEFT = (int)VehicleAreaWheel::LEFT_FRONT; +constexpr int WHEEL_FRONT_RIGHT = (int)VehicleAreaWheel::RIGHT_FRONT; +constexpr int WHEEL_REAR_LEFT = (int)VehicleAreaWheel::LEFT_REAR; +constexpr int WHEEL_REAR_RIGHT = (int)VehicleAreaWheel::RIGHT_REAR; + +/** + * This property is used for test purpose to generate fake events. Here is the test package that + * is referencing this property definition: packages/services/Car/tests/vehiclehal_test + */ +const int32_t kGenerateFakeDataControllingProperty = + 0x0666 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; + +/** + * This property is used for test purpose to set properties' value from vehicle. + * For example: Mocking hard button press triggering a HVAC fan speed change. + * Android set kSetPropertyFromVehicleForTest with an array of integer {HVAC_FAN_SPEED, value of + * fan speed} and a long value indicates the timestamp of the events . + * It only works with integer type properties. + */ +const int32_t kSetIntPropertyFromVehicleForTest = + 0x1112 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; +/** + * This property is used for test purpose to set properties' value from vehicle. + * It only works with float type properties. + */ +const int32_t kSetFloatPropertyFromVehicleForTest = + 0x1113 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; +/** + * This property is used for test purpose to set properties' value from vehicle. + * It only works with boolean type properties. + */ +const int32_t kSetBooleanPropertyFromVehicleForTest = + 0x1114 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; + +/** + * This property is used for test purpose. End to end tests use this property to test set and get + * method for MIXED type properties. + */ +const int32_t kMixedTypePropertyForTest = + 0x1111 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; + +#ifdef ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING +/** + * 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(VehicleProperty prop) { + return (toInt(prop) & ~toInt(VehiclePropertyGroup::MASK)) | VehiclePropertyGroup::VENDOR; +} + +/** + * These properties are used for the end-to-end testing of ClusterHomeService. + */ +constexpr int32_t VENDOR_CLUSTER_SWITCH_UI = toVendor(VehicleProperty::CLUSTER_SWITCH_UI); +constexpr int32_t VENDOR_CLUSTER_DISPLAY_STATE = toVendor(VehicleProperty::CLUSTER_DISPLAY_STATE); +constexpr int32_t VENDOR_CLUSTER_REPORT_STATE = toVendor(VehicleProperty::CLUSTER_REPORT_STATE); +constexpr int32_t VENDOR_CLUSTER_REQUEST_DISPLAY = + toVendor(VehicleProperty::CLUSTER_REQUEST_DISPLAY); +constexpr int32_t VENDOR_CLUSTER_NAVIGATION_STATE = + toVendor(VehicleProperty::CLUSTER_NAVIGATION_STATE); +#endif // ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING + +/** + * FakeDataCommand enum defines the supported command type for kGenerateFakeDataControllingProperty. + * All those commands can be send independently with each other. And each will override the one sent + * previously. + * + * The controlling property has the following format: + * + * int32Values[0] - command enum defined in FakeDataCommand + * + * The format of the arguments is defined for each command type as below: + */ +enum class FakeDataCommand : int32_t { + /** + * Starts linear fake data generation. Caller must provide additional data: + * int32Values[1] - vehicle property to which command applies + * int64Values[0] - periodic interval in nanoseconds + * floatValues[0] - initial value + * floatValues[1] - dispersion defines the min/max value relative to initial value, where + * max = initial_value + dispersion, min = initial_value - dispersion. + * Dispersion should be non-negative, otherwise the behavior is undefined. + * floatValues[2] - increment, with every timer tick the value will be incremented by this + * amount. When reaching to max value, the current value will be set to + * min. It should be non-negative, otherwise the behavior is undefined. + */ + StartLinear = 0, + + /** Stops linear fake data generation that was triggered by StartLinear commands. + * int32Values[1] - vehicle property to which command applies. VHAL will stop the + * corresponding linear generation for that property. + */ + StopLinear = 1, + + /** + * Starts JSON-based fake data generation. It iterates through JSON-encoded VHAL events from a + * file and inject them to VHAL. The iteration can be repeated multiple times or infinitely. + * Caller must provide additional data: + * int32Values[1] - number of iterations. If it is not provided or -1. The iteration will be + * repeated infinite times. + * stringValue - path to the fake values JSON file + */ + StartJson = 2, + + /** + * Stops JSON-based fake data generation. As multiple JSON-based generation can happen at the + * same time. Caller must provide the path of fake value JSON file to stop the corresponding + * generation: + * stringValue - path to the fake values JSON file + */ + StopJson = 3, + + /** + * Injects key press event (HAL incorporates UP/DOWN acction and triggers 2 HAL events for every + * key-press). We set the enum with high number to leave space for future start/stop commands. + * Caller must provide the following data: + * int32Values[2] - Android key code + * int32Values[3] - target display (0 - for main display, 1 - for instrument cluster, see + * VehicleDisplay) + */ + KeyPress = 100, +}; + +const int32_t kHvacPowerProperties[] = { + toInt(VehicleProperty::HVAC_FAN_SPEED), + toInt(VehicleProperty::HVAC_FAN_DIRECTION), +}; + +} // namespace android::hardware::automotive::vehicle::V2_0::impl -- GitLab From e5970af7885c3e8a480683f8800bd0b3f03946bc Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Wed, 12 May 2021 20:55:22 -0700 Subject: [PATCH 053/825] Remove duplicates in DefaultConfig.h Test: build and unit tests Bug: 188005769 Change-Id: I5c55bae2f54725542ac56ebd04ba58de6af63d9e --- .../vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h | 8 -------- 1 file changed, 8 deletions(-) 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 1f3bac1a8a..19a299569f 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 @@ -73,14 +73,6 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.int32Values = {(int)EvConnectorType::IEC_TYPE_1_AC}}}, - {.config = - { - .prop = toInt(VehicleProperty::INFO_DRIVER_SEAT), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = {.int32Values = {SEAT_1_LEFT}}}, - {.config = { .prop = toInt(VehicleProperty::INFO_FUEL_DOOR_LOCATION), -- GitLab From 930e3aab3943e426f78b062eefc523a328344eaf Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Wed, 12 May 2021 15:19:06 -0700 Subject: [PATCH 054/825] Vehicle HAL client reads the config from the server instead of DefaultConfigs.h Test: Launch cf auto instance (with default vhal) and atest packages/services/Car/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/CarPropertyTest.java Bug: 188005769 Change-Id: If98db799be8c894bd9a7ba44bf3075f1f7384e5c --- .../vhal_v2_0/EmulatedVehicleConnector.cpp | 5 +- .../impl/vhal_v2_0/EmulatedVehicleConnector.h | 4 +- .../impl/vhal_v2_0/EmulatedVehicleHal.cpp | 57 +++++++------------ .../impl/vhal_v2_0/EmulatedVehicleHal.h | 2 +- .../default/impl/vhal_v2_0/VehicleHalClient.h | 4 ++ .../impl/vhal_v2_0/VehicleHalServer.cpp | 8 +++ .../default/impl/vhal_v2_0/VehicleHalServer.h | 2 + 7 files changed, 44 insertions(+), 38 deletions(-) diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.cpp index ed3f4a2e8f..eae58d0759 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.cpp @@ -21,7 +21,6 @@ #include #include -#include "DefaultConfig.h" #include "EmulatedVehicleConnector.h" #include "JsonFakeValueGenerator.h" #include "LinearFakeValueGenerator.h" @@ -39,6 +38,10 @@ EmulatedUserHal* EmulatedVehicleConnector::getEmulatedUserHal() { return &mEmulatedUserHal; } +void EmulatedVehicleConnector::triggerSendAllValues() { + sendAllValuesToClient(); +} + StatusCode EmulatedVehicleConnector::onSetProperty(const VehiclePropValue& value, bool updateStatus) { if (mEmulatedUserHal.isSupported(value.prop)) { diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.h index 4c6c66150b..31ac7d8fb5 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.h @@ -33,11 +33,13 @@ namespace impl { class EmulatedVehicleConnector : public IPassThroughConnector { public: - EmulatedVehicleConnector() {} + EmulatedVehicleConnector() = default; EmulatedUserHal* getEmulatedUserHal(); // Methods from VehicleHalServer + void triggerSendAllValues() override; + StatusCode onSetProperty(const VehiclePropValue& value, bool updateStatus) override; bool onDump(const hidl_handle& fd, const hidl_vec& options) override; diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp index 1608e5294d..e8b79dc394 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp @@ -105,9 +105,6 @@ EmulatedVehicleHal::EmulatedVehicleHal(VehiclePropertyStore* propStore, VehicleH mVehicleClient(client), mEmulatedUserHal(emulatedUserHal) { initStaticConfig(); - for (size_t i = 0; i < arraysize(kVehicleProperties); i++) { - mPropStore->registerProperty(kVehicleProperties[i].config); - } mVehicleClient->registerPropertyValueCallback(std::bind(&EmulatedVehicleHal::onPropertyValue, this, std::placeholders::_1, std::placeholders::_2)); @@ -180,7 +177,13 @@ VehicleHal::VehiclePropValuePtr EmulatedVehicleHal::get( v = getValuePool()->obtain(*internalPropValue); } - *outStatus = v != nullptr ? StatusCode::OK : StatusCode::INVALID_ARG; + if (!v) { + *outStatus = StatusCode::INVALID_ARG; + } else if (v->status == VehiclePropertyStatus::AVAILABLE) { + *outStatus = StatusCode::OK; + } else { + *outStatus = StatusCode::TRY_AGAIN; + } break; } if (v.get()) { @@ -280,57 +283,41 @@ static bool isDiagnosticProperty(VehiclePropConfig propConfig) { void EmulatedVehicleHal::onCreate() { static constexpr bool shouldUpdateStatus = true; - for (auto& it : kVehicleProperties) { - VehiclePropConfig cfg = it.config; - int32_t numAreas = cfg.areaConfigs.size(); + auto configs = mVehicleClient->getAllPropertyConfig(); + for (const auto& cfg : configs) { if (isDiagnosticProperty(cfg)) { // do not write an initial empty value for the diagnostic properties // as we will initialize those separately. continue; } - // A global property will have only a single area - if (isGlobalProp(cfg.prop)) { - numAreas = 1; - } + int32_t numAreas = isGlobalProp(cfg.prop) ? 0 : cfg.areaConfigs.size(); for (int i = 0; i < numAreas; i++) { - int32_t curArea; - - if (isGlobalProp(cfg.prop)) { - curArea = 0; - } else { - curArea = cfg.areaConfigs[i].areaId; - } + int32_t curArea = isGlobalProp(cfg.prop) ? 0 : cfg.areaConfigs[i].areaId; // Create a separate instance for each individual zone VehiclePropValue prop = { .areaId = curArea, .prop = cfg.prop, + .status = VehiclePropertyStatus::UNAVAILABLE, }; - if (it.initialAreaValues.size() > 0) { - auto valueForAreaIt = it.initialAreaValues.find(curArea); - if (valueForAreaIt != it.initialAreaValues.end()) { - prop.value = valueForAreaIt->second; - } else { - ALOGW("%s failed to get default value for prop 0x%x area 0x%x", - __func__, cfg.prop, curArea); - } - } else { - prop.value = it.initialValue; - if (mInitVhalValueOverride) { - for (auto& itOverride : mVehiclePropertiesOverride) { - if (itOverride.prop == cfg.prop) { - prop.value = itOverride.value; - } + if (mInitVhalValueOverride) { + for (auto& itOverride : mVehiclePropertiesOverride) { + if (itOverride.prop == cfg.prop) { + prop.status = VehiclePropertyStatus::AVAILABLE; + prop.value = itOverride.value; } } } mPropStore->writeValue(prop, shouldUpdateStatus); } } + + mVehicleClient->triggerSendAllValues(); + initObd2LiveFrame(*mPropStore->getConfigOrDie(OBD2_LIVE_FRAME)); initObd2FreezeFrame(*mPropStore->getConfigOrDie(OBD2_FREEZE_FRAME)); mInEmulator = isInEmulator(); @@ -414,8 +401,8 @@ void EmulatedVehicleHal::onPropertyValue(const VehiclePropValue& value, bool upd } void EmulatedVehicleHal::initStaticConfig() { - for (auto&& it = std::begin(kVehicleProperties); it != std::end(kVehicleProperties); ++it) { - const auto& cfg = it->config; + auto configs = mVehicleClient->getAllPropertyConfig(); + for (auto&& cfg : configs) { VehiclePropertyStore::TokenFunction tokenFunction = nullptr; switch (cfg.prop) { diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h index 5c676416d7..7871c7b41a 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h @@ -29,10 +29,10 @@ #include #include "vhal_v2_0/VehiclePropertyStore.h" -#include "DefaultConfig.h" #include "EmulatedUserHal.h" #include "EmulatedVehicleConnector.h" #include "GeneratorHub.h" +#include "PropertyUtils.h" #include "VehicleEmulator.h" namespace android { diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalClient.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalClient.h index 6559e2aa84..81dfca1b06 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalClient.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalClient.h @@ -27,6 +27,10 @@ class VehicleHalClient : public IVehicleClient { // Type of callback function for handling the new property values using PropertyCallBackType = std::function; + // The server will call sendAllValuesToClient, onPropertyValue will be called when values are + // received. + virtual void triggerSendAllValues() = 0; + // Method from IVehicleClient void onPropertyValue(const VehiclePropValue& value, bool updateStatus) override; diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.cpp index 1e468975a2..57dd7d4215 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.cpp @@ -82,6 +82,14 @@ VehicleHalServer::VehicleHalServer() { } } +void VehicleHalServer::sendAllValuesToClient() { + constexpr bool update_status = true; + auto values = mServerSidePropStore.readAllValues(); + for (const auto& value : values) { + onPropertyValueFromCar(value, update_status); + } +} + GeneratorHub* VehicleHalServer::getGenerator() { return &mGeneratorHub; } diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.h index 2ad75e368a..be88cd94cd 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.h @@ -31,6 +31,8 @@ class VehicleHalServer : public IVehicleServer { public: VehicleHalServer(); + void sendAllValuesToClient(); + // Methods from IVehicleServer std::vector onGetAllPropertyConfig() const override; -- GitLab From fb023d01f8a2f7cfc1e9e3c2693e4f6a95089d65 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 1 Jun 2021 15:41:24 -0700 Subject: [PATCH 055/825] Fix two unit test failures. Test: 'atest android.hardware.automotive.vehicle@2.0-manager-unit-tests' Verify all tests pass. Change-Id: Id5941e5dea77098a3a5cd853fd2bd0f30f9a8ae2 --- .../vehicle/2.0/default/tests/RecurrentTimer_test.cpp | 6 ++++-- .../vehicle/2.0/default/tests/VehicleObjectPool_test.cpp | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/automotive/vehicle/2.0/default/tests/RecurrentTimer_test.cpp b/automotive/vehicle/2.0/default/tests/RecurrentTimer_test.cpp index 9fc17c6652..d7547f6556 100644 --- a/automotive/vehicle/2.0/default/tests/RecurrentTimer_test.cpp +++ b/automotive/vehicle/2.0/default/tests/RecurrentTimer_test.cpp @@ -41,7 +41,8 @@ TEST(RecurrentTimerTest, oneInterval) { timer.registerRecurrentEvent(milliseconds(1), 0xdead); std::this_thread::sleep_for(milliseconds(100)); - ASSERT_EQ_WITH_TOLERANCE(100, counter.load(), 20); + // This test is unstable, so set the tolerance to 50. + ASSERT_EQ_WITH_TOLERANCE(100, counter.load(), 50); } TEST(RecurrentTimerTest, multipleIntervals) { @@ -66,7 +67,8 @@ TEST(RecurrentTimerTest, multipleIntervals) { timer.registerRecurrentEvent(milliseconds(5), 0xbeef); std::this_thread::sleep_for(milliseconds(100)); - ASSERT_EQ_WITH_TOLERANCE(100, counter1ms.load(), 20); + // This test is unstable, so set the tolerance to 50. + ASSERT_EQ_WITH_TOLERANCE(100, counter1ms.load(), 50); ASSERT_EQ_WITH_TOLERANCE(20, counter5ms.load(), 5); } diff --git a/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp b/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp index 4e3ade15a3..096816600f 100644 --- a/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp +++ b/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp @@ -58,10 +58,12 @@ public: TEST_F(VehicleObjectPoolTest, valuePoolBasicCorrectness) { auto value = valuePool->obtain(VehiclePropertyType::INT32); - // At this point, v1 should be recycled and the only object in the pool. - ASSERT_EQ(value.get(), valuePool->obtain(VehiclePropertyType::INT32).get()); + void* raw = value.get(); + value.reset(); + // At this point, value should be recycled and the only object in the pool. + ASSERT_EQ(raw, valuePool->obtain(VehiclePropertyType::INT32).get()); // Obtaining value of another type - should return a new object - ASSERT_NE(value.get(), valuePool->obtain(VehiclePropertyType::FLOAT).get()); + ASSERT_NE(raw, valuePool->obtain(VehiclePropertyType::FLOAT).get()); ASSERT_EQ(3u, stats->Obtained); ASSERT_EQ(2u, stats->Created); -- GitLab From 8ae3ea981335007de5e837bcb64d3c917e1edcce Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 1 Jun 2021 15:44:43 -0700 Subject: [PATCH 056/825] Support more types for set property cmd. Now support int64, float and bytes. This CL also allows setting read-only properties or reading write-only properties through cmdline. The cmdline debug interface is for test only and does not need to enforce these restrictions. Test: unit tests. Bug: b/189969547 Change-Id: Ib0e085f7a68e3d54782c21fb12caa500a0ad82ec --- automotive/vehicle/2.0/default/Android.bp | 1 + .../include/vhal_v2_0/VehicleHalManager.h | 26 +- .../default/common/src/VehicleHalManager.cpp | 306 +++++++++++++----- .../default/tests/VehicleHalManager_test.cpp | 207 ++++++++++-- 4 files changed, 423 insertions(+), 117 deletions(-) diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp index ffa0c13958..0b49ef9d2c 100644 --- a/automotive/vehicle/2.0/default/Android.bp +++ b/automotive/vehicle/2.0/default/Android.bp @@ -182,6 +182,7 @@ cc_test { ], shared_libs: [ "libbase", + "libcutils", ], header_libs: ["libbase_headers"], test_suites: ["general-tests"], diff --git a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleHalManager.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleHalManager.h index fcfe7612ac..6706258717 100644 --- a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleHalManager.h +++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleHalManager.h @@ -76,6 +76,9 @@ public: Return debug(const hidl_handle& fd, const hidl_vec& options) override; private: + // Set unit test class as friend class to test private functions. + friend class VehicleHalManagerTestHelper; + using VehiclePropValuePtr = VehicleHal::VehiclePropValuePtr; // Returns true if needs to call again shortly. using RetriableAction = std::function; @@ -105,14 +108,20 @@ public: void cmdDumpOneProperty(int fd, int32_t prop, int32_t areaId); void cmdDumpOneProperty(int fd, int rowNumber, const VehiclePropConfig& config); + bool cmdSetOneProperty(int fd, const hidl_vec& options); + static bool checkArgumentsSize(int fd, const hidl_vec& options, size_t minSize); static bool checkCallerHasWritePermissions(int fd); - static bool safelyParseInt(int fd, int index, std::string s, int* out); + template + static bool safelyParseInt(int fd, int index, const std::string& s, T* out); + static bool safelyParseFloat(int fd, int index, const std::string& s, float* out); + // Parses "s" as a hex string and populate "*bytes". The hex string must be in the format of + // valid hex format, e.g. "0xABCD". + static bool parseHexString(int fd, const std::string& s, std::vector* bytes); void cmdHelp(int fd) const; void cmdListAllProperties(int fd) const; void cmdDumpAllProperties(int fd); void cmdDumpSpecificProperties(int fd, const hidl_vec& options); - void cmdSetOneProperty(int fd, const hidl_vec& options); static bool isSubscribable(const VehiclePropConfig& config, SubscribeFlags flags); @@ -120,7 +129,18 @@ public: static float checkSampleRate(const VehiclePropConfig& config, float sampleRate); static ClientId getClientId(const sp& callback); -private: + + // Parses the cmdline options for "--set" command. "*prop" would be populated with the + // the properties to be set. Returns true when the cmdline options are valid, false otherwise. + static bool parseSetPropOptions(int fd, const hidl_vec& options, + VehiclePropValue* prop); + // Parses the options and get the values for the current option specified by "*index". "*index" + // would advance to the next option field (e.g., the next "-f"). Returns a list of values for + // the current option. + static std::vector getOptionValues(const hidl_vec& options, + size_t* index); + + private: VehicleHal* mHal; std::unique_ptr mConfigIndex; SubscriptionManager mSubscriptionManager; diff --git a/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp b/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp index dc5d3d300e..e34e692bfc 100644 --- a/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp +++ b/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp @@ -20,7 +20,9 @@ #include #include +#include +#include #include #include #include @@ -44,15 +46,34 @@ using ::android::base::EqualsIgnoreCase; using ::android::hardware::hidl_handle; using ::android::hardware::hidl_string; +namespace { + constexpr std::chrono::milliseconds kHalEventBatchingTimeWindow(10); const VehiclePropValue kEmptyValue{}; +// A list of supported options for "--set" command. +const std::unordered_set kSetPropOptions = { + // integer. + "-i", + // 64bit integer. + "-i64", + // float. + "-f", + // string. + "-s", + // bytes in hex format, e.g. 0xDEADBEEF. + "-b", + // Area id in integer. + "-a"}; + +} // namespace + /** * Indicates what's the maximum size of hidl_vec we want * to store in reusable object pool. */ -constexpr auto kMaxHidlVecOfVehiclPropValuePoolSize = 20; +constexpr auto kMaxHidlVecOfVehiclePropValuePoolSize = 20; Return VehicleHalManager::getAllPropConfigs(getAllPropConfigs_cb _hidl_cb) { ALOGI("getAllPropConfigs called"); @@ -213,6 +234,11 @@ void VehicleHalManager::cmdDump(int fd, const hidl_vec& options) { } else if (EqualsIgnoreCase(option, "--get")) { cmdDumpSpecificProperties(fd, options); } else if (EqualsIgnoreCase(option, "--set")) { + if (!checkCallerHasWritePermissions(fd)) { + dprintf(fd, "Caller does not have write permission\n"); + return; + } + // Ignore the return value for this. cmdSetOneProperty(fd, options); } else { dprintf(fd, "Invalid option: %s\n", option.c_str()); @@ -239,7 +265,8 @@ bool VehicleHalManager::checkArgumentsSize(int fd, const hidl_vec& return false; } -bool VehicleHalManager::safelyParseInt(int fd, int index, std::string s, int* out) { +template +bool VehicleHalManager::safelyParseInt(int fd, int index, const std::string& s, T* out) { if (!android::base::ParseInt(s, out)) { dprintf(fd, "non-integer argument at index %d: %s\n", index, s.c_str()); return false; @@ -247,19 +274,27 @@ bool VehicleHalManager::safelyParseInt(int fd, int index, std::string s, int* ou return true; } +bool VehicleHalManager::safelyParseFloat(int fd, int index, const std::string& s, float* out) { + if (!android::base::ParseFloat(s, out)) { + dprintf(fd, "non-float argument at index %d: %s\n", index, s.c_str()); + return false; + } + return true; +} + void VehicleHalManager::cmdHelp(int fd) const { dprintf(fd, "Usage: \n\n"); dprintf(fd, "[no args]: dumps (id and value) all supported properties \n"); dprintf(fd, "--help: shows this help\n"); dprintf(fd, "--list: lists the ids of all supported properties\n"); dprintf(fd, "--get [PROP2] [PROPN]: dumps the value of specific properties \n"); - // TODO: support other formats (int64, float, bytes) dprintf(fd, - "--set [ ] [a AREA_ID] : sets the value of " - "property PROP, using arbitrary number of key/value parameters (i for int32, " - "s for string) and an optional area.\n" - "Notice that the string value can be set just once, while the other can have multiple " - "values (so they're used in the respective array)\n"); + "--set [-i INT_VALUE [INT_VALUE ...]] [-i64 INT64_VALUE [INT64_VALUE ...]] " + "[-f FLOAT_VALUE [FLOAT_VALUE ...]] [-s STR_VALUE] " + "[-b BYTES_VALUE] [-a AREA_ID] : sets the value of property PROP. " + "Notice that the string, bytes and area value can be set just once, while the other can" + " have multiple values (so they're used in the respective array), " + "BYTES_VALUE is in the form of 0xXXXX, e.g. 0xdeadbeef.\n"); } void VehicleHalManager::cmdListAllProperties(int fd) const { @@ -337,102 +372,49 @@ void VehicleHalManager::cmdDumpOneProperty(int fd, int32_t prop, int32_t areaId) VehiclePropValue input; input.prop = prop; input.areaId = areaId; - auto callback = [&](StatusCode status, const VehiclePropValue& output) { + auto callback = [&fd, &prop](StatusCode status, const VehiclePropValue& output) { if (status == StatusCode::OK) { dprintf(fd, "%s\n", toString(output).c_str()); } else { dprintf(fd, "Could not get property %d. Error: %s\n", prop, toString(status).c_str()); } }; - get(input, callback); -} - -void VehicleHalManager::cmdSetOneProperty(int fd, const hidl_vec& options) { - if (!checkCallerHasWritePermissions(fd) || !checkArgumentsSize(fd, options, 3)) return; - size_t size = options.size(); + StatusCode status; + auto value = mHal->get(input, &status); + callback(status, value.get() ? *value : kEmptyValue); +} - // Syntax is --set PROP Type1 Value1 TypeN ValueN, so number of arguments must be even - if (size % 2 != 0) { - dprintf(fd, "must pass even number of arguments (passed %zu)\n", size); - return; +bool VehicleHalManager::cmdSetOneProperty(int fd, const hidl_vec& options) { + if (!checkArgumentsSize(fd, options, 4)) { + dprintf(fd, "Requires at least 4 options, see help\n"); + return false; } - int numberValues = (size - 2) / 2; - - VehiclePropValue prop; - if (!safelyParseInt(fd, 1, options[1], &prop.prop)) return; - prop.timestamp = elapsedRealtimeNano(); - prop.status = VehiclePropertyStatus::AVAILABLE; - - // First pass: calculate sizes - int sizeInt32 = 0; - int stringIndex = 0; - int areaIndex = 0; - for (int i = 2, kv = 1; kv <= numberValues; kv++) { - // iterate through the kv=1..n key/value pairs, accessing indexes i / i+1 at each step - std::string type = options[i]; - std::string value = options[i + 1]; - if (EqualsIgnoreCase(type, "i")) { - sizeInt32++; - } else if (EqualsIgnoreCase(type, "s")) { - if (stringIndex != 0) { - dprintf(fd, - "defining string value (%s) again at index %d (already defined at %d=%s" - ")\n", - value.c_str(), i, stringIndex, options[stringIndex + 1].c_str()); - return; - } - stringIndex = i; - } else if (EqualsIgnoreCase(type, "a")) { - if (areaIndex != 0) { - dprintf(fd, - "defining area value (%s) again at index %d (already defined at %d=%s" - ")\n", - value.c_str(), i, areaIndex, options[areaIndex + 1].c_str()); - return; - } - areaIndex = i; - } else { - dprintf(fd, "invalid (%s) type at index %d\n", type.c_str(), i); - return; - } - i += 2; - } - prop.value.int32Values.resize(sizeInt32); - - // Second pass: populate it - int indexInt32 = 0; - for (int i = 2, kv = 1; kv <= numberValues; kv++) { - // iterate through the kv=1..n key/value pairs, accessing indexes i / i+1 at each step - int valueIndex = i + 1; - std::string type = options[i]; - std::string value = options[valueIndex]; - if (EqualsIgnoreCase(type, "i")) { - int safeInt; - if (!safelyParseInt(fd, valueIndex, value, &safeInt)) return; - prop.value.int32Values[indexInt32++] = safeInt; - } else if (EqualsIgnoreCase(type, "s")) { - prop.value.stringValue = value; - } else if (EqualsIgnoreCase(type, "a")) { - if (!safelyParseInt(fd, valueIndex, value, &prop.areaId)) return; - } - i += 2; + + VehiclePropValue prop = {}; + if (!parseSetPropOptions(fd, options, &prop)) { + return false; } ALOGD("Setting prop %s", toString(prop).c_str()); - auto status = set(prop); + + // Do not use VehicleHalManager::set here because we don't want to check write permission. + // Caller should be able to use the debug interface to set read-only properties. + handlePropertySetEvent(prop); + auto status = mHal->set(prop); + if (status == StatusCode::OK) { dprintf(fd, "Set property %s\n", toString(prop).c_str()); - } else { - dprintf(fd, "Failed to set property %s: %s\n", toString(prop).c_str(), - toString(status).c_str()); + return true; } + dprintf(fd, "Failed to set property %s: %s\n", toString(prop).c_str(), + toString(status).c_str()); + return false; } void VehicleHalManager::init() { ALOGI("VehicleHalManager::init"); - mHidlVecOfVehiclePropValuePool.resize(kMaxHidlVecOfVehiclPropValuePoolSize); - + mHidlVecOfVehiclePropValuePool.resize(kMaxHidlVecOfVehiclePropValuePoolSize); mBatchingConsumer.run(&mEventQueue, kHalEventBatchingTimeWindow, @@ -486,7 +468,7 @@ void VehicleHalManager::onBatchHalEvent(const std::vector& for (const HalClientValues& cv : clientValues) { auto vecSize = cv.values.size(); hidl_vec vec; - if (vecSize < kMaxHidlVecOfVehiclPropValuePoolSize) { + if (vecSize < kMaxHidlVecOfVehiclePropValuePoolSize) { vec.setToExternal(&mHidlVecOfVehiclePropValuePool[0], vecSize); } else { vec.resize(vecSize); @@ -595,6 +577,158 @@ ClientId VehicleHalManager::getClientId(const sp& callback) { } } +std::vector VehicleHalManager::getOptionValues(const hidl_vec& options, + size_t* index) { + std::vector values; + while (*index < options.size()) { + std::string option = options[*index]; + if (kSetPropOptions.find(option) != kSetPropOptions.end()) { + return std::move(values); + } + values.push_back(option); + (*index)++; + } + return std::move(values); +} + +bool VehicleHalManager::parseSetPropOptions(int fd, const hidl_vec& options, + VehiclePropValue* prop) { + // Options format: + // --set PROP [-f f1 f2...] [-i i1 i2...] [-i64 i1 i2...] [-s s1 s2...] [-b b1 b2...] [-a a] + size_t optionIndex = 1; + int propValue; + if (!safelyParseInt(fd, optionIndex, options[optionIndex], &propValue)) { + dprintf(fd, "property value: \"%s\" is not a valid int\n", options[optionIndex].c_str()); + return false; + } + prop->prop = propValue; + prop->timestamp = elapsedRealtimeNano(); + prop->status = VehiclePropertyStatus::AVAILABLE; + optionIndex++; + std::unordered_set parsedOptions; + + while (optionIndex < options.size()) { + std::string type = options[optionIndex]; + optionIndex++; + size_t currentIndex = optionIndex; + std::vector values = getOptionValues(options, &optionIndex); + if (parsedOptions.find(type) != parsedOptions.end()) { + dprintf(fd, "duplicate \"%s\" options\n", type.c_str()); + return false; + } + parsedOptions.insert(type); + if (EqualsIgnoreCase(type, "-i")) { + if (values.size() == 0) { + dprintf(fd, "no values specified when using \"-i\"\n"); + return false; + } + prop->value.int32Values.resize(values.size()); + for (size_t i = 0; i < values.size(); i++) { + int32_t safeInt; + if (!safelyParseInt(fd, currentIndex + i, values[i], &safeInt)) { + dprintf(fd, "value: \"%s\" is not a valid int\n", values[i].c_str()); + return false; + } + prop->value.int32Values[i] = safeInt; + } + } else if (EqualsIgnoreCase(type, "-i64")) { + if (values.size() == 0) { + dprintf(fd, "no values specified when using \"-i64\"\n"); + return false; + } + prop->value.int64Values.resize(values.size()); + for (size_t i = 0; i < values.size(); i++) { + int64_t safeInt; + if (!safelyParseInt(fd, currentIndex + i, values[i], &safeInt)) { + dprintf(fd, "value: \"%s\" is not a valid int64\n", values[i].c_str()); + return false; + } + prop->value.int64Values[i] = safeInt; + } + } else if (EqualsIgnoreCase(type, "-f")) { + if (values.size() == 0) { + dprintf(fd, "no values specified when using \"-f\"\n"); + return false; + } + prop->value.floatValues.resize(values.size()); + for (size_t i = 0; i < values.size(); i++) { + float safeFloat; + if (!safelyParseFloat(fd, currentIndex + i, values[i], &safeFloat)) { + dprintf(fd, "value: \"%s\" is not a valid float\n", values[i].c_str()); + return false; + } + prop->value.floatValues[i] = safeFloat; + } + } else if (EqualsIgnoreCase(type, "-s")) { + if (values.size() != 1) { + dprintf(fd, "expect exact one value when using \"-s\"\n"); + return false; + } + prop->value.stringValue = values[0]; + } else if (EqualsIgnoreCase(type, "-b")) { + if (values.size() != 1) { + dprintf(fd, "expect exact one value when using \"-b\"\n"); + return false; + } + std::vector bytes; + if (!parseHexString(fd, values[0], &bytes)) { + dprintf(fd, "value: \"%s\" is not a valid hex string\n", values[0].c_str()); + return false; + } + prop->value.bytes = bytes; + } else if (EqualsIgnoreCase(type, "-a")) { + if (values.size() != 1) { + dprintf(fd, "expect exact one value when using \"-a\"\n"); + return false; + } + if (!safelyParseInt(fd, currentIndex, values[0], &(prop->areaId))) { + dprintf(fd, "area ID: \"%s\" is not a valid int\n", values[0].c_str()); + return false; + } + } else { + dprintf(fd, "unknown option: %s\n", type.c_str()); + return false; + } + } + + return true; +} + +bool VehicleHalManager::parseHexString(int fd, const std::string& s, std::vector* bytes) { + if (s.size() % 2 != 0) { + dprintf(fd, "invalid hex string: %s, should have even size\n", s.c_str()); + return false; + } + if (strncmp(s.substr(0, 2).c_str(), "0x", 2)) { + dprintf(fd, "hex string should start with \"0x\", got %s\n", s.c_str()); + return false; + } + std::string subs = s.substr(2); + std::transform(subs.begin(), subs.end(), subs.begin(), + [](unsigned char c) { return std::tolower(c); }); + + bool highDigit = true; + for (size_t i = 0; i < subs.size(); i++) { + char c = subs[i]; + uint8_t v; + if (c >= '0' && c <= '9') { + v = c - '0'; + } else if (c >= 'a' && c <= 'f') { + v = c - 'a' + 10; + } else { + dprintf(fd, "invalid character %c in hex string %s\n", c, subs.c_str()); + return false; + } + if (highDigit) { + (*bytes).push_back(v * 16); + } else { + (*bytes)[bytes->size() - 1] += v; + } + highDigit = !highDigit; + } + return true; +} + } // namespace V2_0 } // namespace vehicle } // namespace automotive diff --git a/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp b/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp index 09750718a0..bdf46fb24c 100644 --- a/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp +++ b/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -32,6 +33,18 @@ namespace automotive { namespace vehicle { namespace V2_0 { +// A simple helper class to expose 'cmdSetOneProperty' to the unit tests. +class VehicleHalManagerTestHelper { + public: + VehicleHalManagerTestHelper(VehicleHalManager* manager) { mManager = manager; } + bool cmdSetOneProperty(int fd, const hidl_vec& options) { + return mManager->cmdSetOneProperty(fd, options); + } + + public: + VehicleHalManager* mManager; +}; + namespace { using namespace std::placeholders; @@ -57,33 +70,21 @@ public: auto property = static_cast(requestedPropValue.prop); int32_t areaId = requestedPropValue.areaId; - switch (property) { - case VehicleProperty::INFO_MAKE: - pValue = getValuePool()->obtainString(kCarMake); - break; - case VehicleProperty::INFO_FUEL_CAPACITY: - if (fuelCapacityAttemptsLeft-- > 0) { - // Emulate property not ready yet. - *outStatus = StatusCode::TRY_AGAIN; - } else { - pValue = getValuePool()->obtainFloat(42.42); - } - break; - default: - if (requestedPropValue.prop == kCustomComplexProperty) { - pValue = getValuePool()->obtainComplex(); - pValue->value.int32Values = hidl_vec { 10, 20 }; - pValue->value.int64Values = hidl_vec { 30, 40 }; - pValue->value.floatValues = hidl_vec { 1.1, 2.2 }; - pValue->value.bytes = hidl_vec { 1, 2, 3 }; - pValue->value.stringValue = kCarMake; - break; - } - auto key = makeKey(toInt(property), areaId); - if (mValues.count(key) == 0) { - ALOGW(""); - } - pValue = getValuePool()->obtain(mValues[key]); + if (property == VehicleProperty::INFO_FUEL_CAPACITY) { + if (fuelCapacityAttemptsLeft-- > 0) { + // Emulate property not ready yet. + *outStatus = StatusCode::TRY_AGAIN; + } else { + pValue = getValuePool()->obtainFloat(42.42); + } + } else { + auto key = makeKey(requestedPropValue); + if (mValues.count(key) == 0) { + ALOGW("key not found\n"); + *outStatus = StatusCode::INVALID_ARG; + return pValue; + } + pValue = getValuePool()->obtain(mValues[key]); } if (*outStatus == StatusCode::OK && pValue.get() != nullptr) { @@ -100,7 +101,6 @@ public: && mirrorFoldAttemptsLeft-- > 0) { return StatusCode::TRY_AGAIN; } - mValues[makeKey(propValue)] = propValue; return StatusCode::OK; } @@ -181,6 +181,18 @@ public: actualStatusCode = refStatus; } + MockedVehicleHal::VehiclePropValuePtr getComplexProperty() { + auto pValue = objectPool->obtainComplex(); + pValue->prop = kCustomComplexProperty; + pValue->areaId = 0; + pValue->value.int32Values = hidl_vec{10, 20}; + pValue->value.int64Values = hidl_vec{30, 40}; + pValue->value.floatValues = hidl_vec{1.1, 2.2}; + pValue->value.bytes = hidl_vec{1, 2, 3}; + pValue->value.stringValue = kCarMake; + return pValue; + } + public: VehiclePropValue actualValue; StatusCode actualStatusCode; @@ -308,6 +320,8 @@ TEST_F(VehicleHalManagerTest, subscribe_WriteOnly) { } TEST_F(VehicleHalManagerTest, get_Complex) { + ASSERT_EQ(StatusCode::OK, hal->set(*getComplexProperty().get())); + invokeGet(kCustomComplexProperty, 0); ASSERT_EQ(StatusCode::OK, actualStatusCode); @@ -334,6 +348,11 @@ TEST_F(VehicleHalManagerTest, get_Complex) { } TEST_F(VehicleHalManagerTest, get_StaticString) { + auto pValue = objectPool->obtainString(kCarMake); + pValue->prop = toInt(VehicleProperty::INFO_MAKE); + pValue->areaId = 0; + ASSERT_EQ(StatusCode::OK, hal->set(*pValue.get())); + invokeGet(toInt(VehicleProperty::INFO_MAKE), 0); ASSERT_EQ(StatusCode::OK, actualStatusCode); @@ -458,6 +477,138 @@ TEST(HalClientVectorTest, basic) { ASSERT_TRUE(clients.isEmpty()); } +TEST_F(VehicleHalManagerTest, debug) { + hidl_handle fd = {}; + fd.setTo(native_handle_create(/*numFds=*/1, /*numInts=*/0), /*shouldOwn=*/true); + + // Because debug function returns void, so no way to check return value. + manager->debug(fd, {}); + manager->debug(fd, {"--help"}); + manager->debug(fd, {"--list"}); + manager->debug(fd, {"--get"}); + manager->debug(fd, {"--set"}); + manager->debug(fd, {"invalid"}); +} + +struct SetPropTestCase { + std::string test_name; + const hidl_vec configs; + bool success; +}; + +class VehicleHalManagerSetPropTest : public VehicleHalManagerTest, + public testing::WithParamInterface {}; + +TEST_P(VehicleHalManagerSetPropTest, cmdSetOneProperty) { + const SetPropTestCase& tc = GetParam(); + VehicleHalManagerTestHelper helper(manager.get()); + ASSERT_EQ(tc.success, helper.cmdSetOneProperty(STDERR_FILENO, tc.configs)); +} + +std::vector GenSetPropParams() { + char infoMakeProperty[100] = {}; + snprintf(infoMakeProperty, sizeof(infoMakeProperty), "%d", toInt(VehicleProperty::INFO_MAKE)); + return { + {"success_set_string", {"--set", infoMakeProperty, "-s", kCarMake}, true}, + {"success_set_bytes", {"--set", infoMakeProperty, "-b", "0xdeadbeef"}, true}, + {"success_set_bytes_caps", {"--set", infoMakeProperty, "-b", "0xDEADBEEF"}, true}, + {"success_set_int", {"--set", infoMakeProperty, "-i", "2147483647"}, true}, + {"success_set_ints", + {"--set", infoMakeProperty, "-i", "2147483647", "0", "-2147483648"}, + true}, + {"success_set_int64", + {"--set", infoMakeProperty, "-i64", "-9223372036854775808"}, + true}, + {"success_set_int64s", + {"--set", infoMakeProperty, "-i64", "-9223372036854775808", "0", + "9223372036854775807"}, + true}, + {"success_set_float", {"--set", infoMakeProperty, "-f", "1.175494351E-38"}, true}, + {"success_set_floats", + {"--set", infoMakeProperty, "-f", "-3.402823466E+38", "0", "3.402823466E+38"}, + true}, + {"success_set_area", {"--set", infoMakeProperty, "-a", "2147483647"}, true}, + {"fail_no_options", {}, false}, + {"fail_less_than_4_options", {"--set", infoMakeProperty, "-i"}, false}, + {"fail_unknown_options", {"--set", infoMakeProperty, "-s", kCarMake, "-abcd"}, false}, + {"fail_invalid_property", {"--set", "not valid", "-s", kCarMake}, false}, + {"fail_duplicate_string", + {"--set", infoMakeProperty, "-s", kCarMake, "-s", kCarMake}, + false}, + {"fail_multiple_strings", {"--set", infoMakeProperty, "-s", kCarMake, kCarMake}, false}, + {"fail_no_string_value", {"--set", infoMakeProperty, "-s", "-a", "1234"}, false}, + {"fail_duplicate_bytes", + {"--set", infoMakeProperty, "-b", "0xdeadbeef", "-b", "0xdeadbeef"}, + false}, + {"fail_multiple_bytes", + {"--set", infoMakeProperty, "-b", "0xdeadbeef", "0xdeadbeef"}, + false}, + {"fail_invalid_bytes", {"--set", infoMakeProperty, "-b", "0xgood"}, false}, + {"fail_invalid_bytes_no_prefix", {"--set", infoMakeProperty, "-b", "deadbeef"}, false}, + {"fail_invalid_int", {"--set", infoMakeProperty, "-i", "abc"}, false}, + {"fail_int_out_of_range", {"--set", infoMakeProperty, "-i", "2147483648"}, false}, + {"fail_no_int_value", {"--set", infoMakeProperty, "-i", "-s", kCarMake}, false}, + {"fail_invalid_int64", {"--set", infoMakeProperty, "-i64", "abc"}, false}, + {"fail_int64_out_of_range", + {"--set", infoMakeProperty, "-i64", "-9223372036854775809"}, + false}, + {"fail_no_int64_value", {"--set", infoMakeProperty, "-i64", "-s", kCarMake}, false}, + {"fail_invalid_float", {"--set", infoMakeProperty, "-f", "abc"}, false}, + {"fail_float_out_of_range", + {"--set", infoMakeProperty, "-f", "-3.402823466E+39"}, + false}, + {"fail_no_float_value", {"--set", infoMakeProperty, "-f", "-s", kCarMake}, false}, + {"fail_multiple_areas", {"--set", infoMakeProperty, "-a", "2147483648", "0"}, false}, + {"fail_invalid_area", {"--set", infoMakeProperty, "-a", "abc"}, false}, + {"fail_area_out_of_range", {"--set", infoMakeProperty, "-a", "2147483648"}, false}, + {"fail_no_area_value", {"--set", infoMakeProperty, "-a", "-s", kCarMake}, false}, + }; +} + +INSTANTIATE_TEST_SUITE_P( + VehicleHalManagerSetPropTests, VehicleHalManagerSetPropTest, + testing::ValuesIn(GenSetPropParams()), + [](const testing::TestParamInfo& info) { + return info.param.test_name; + }); + +TEST_F(VehicleHalManagerTest, SetComplexPropTest) { + char infoMakeProperty[100] = {}; + snprintf(infoMakeProperty, sizeof(infoMakeProperty), "%d", toInt(VehicleProperty::INFO_MAKE)); + VehicleHalManagerTestHelper helper(manager.get()); + ASSERT_TRUE(helper.cmdSetOneProperty( + STDERR_FILENO, {"--set", infoMakeProperty, "-s", kCarMake, + "-b", "0xdeadbeef", "-i", "2147483647", + "0", "-2147483648", "-i64", "-9223372036854775808", + "0", "9223372036854775807", "-f", "-3.402823466E+38", + "0", "3.402823466E+38", "-a", "123"})); + StatusCode status = StatusCode::OK; + VehiclePropValue requestProp; + requestProp.prop = toInt(VehicleProperty::INFO_MAKE); + requestProp.areaId = 123; + auto value = hal->get(requestProp, &status); + ASSERT_EQ(StatusCode::OK, status); + ASSERT_EQ(value->prop, toInt(VehicleProperty::INFO_MAKE)); + ASSERT_EQ(value->areaId, 123); + ASSERT_STREQ(kCarMake, value->value.stringValue.c_str()); + uint8_t bytes[] = {0xde, 0xad, 0xbe, 0xef}; + ASSERT_FALSE(memcmp(bytes, value->value.bytes.data(), sizeof(bytes))); + ASSERT_EQ(3u, value->value.int32Values.size()); + ASSERT_EQ(2147483647, value->value.int32Values[0]); + ASSERT_EQ(0, value->value.int32Values[1]); + ASSERT_EQ(-2147483648, value->value.int32Values[2]); + ASSERT_EQ(3u, value->value.int64Values.size()); + // -9223372036854775808 is not a valid literal since '-' and '9223372036854775808' would be two + // tokens and the later does not fit in unsigned long long. + ASSERT_EQ(-9223372036854775807 - 1, value->value.int64Values[0]); + ASSERT_EQ(0, value->value.int64Values[1]); + ASSERT_EQ(9223372036854775807, value->value.int64Values[2]); + ASSERT_EQ(3u, value->value.floatValues.size()); + ASSERT_EQ(-3.402823466E+38f, value->value.floatValues[0]); + ASSERT_EQ(0.0f, value->value.floatValues[1]); + ASSERT_EQ(3.402823466E+38f, value->value.floatValues[2]); +} + } // namespace anonymous } // namespace V2_0 -- GitLab From 045138dedde5b1bcd00cecfd8b3c6cf202d4d9d5 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 2 Jun 2021 16:15:29 -0700 Subject: [PATCH 057/825] Add vhal unit tests to presubmit. Test: presubmit. Bug: b/189883643 Change-Id: I8e93ffb1f5ea8bb7d8656d8955c97494638df85c --- automotive/vehicle/2.0/default/Android.bp | 14 ++++++++++++++ automotive/vehicle/2.0/default/TEST_MAPPING | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 automotive/vehicle/2.0/default/TEST_MAPPING diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp index 0b49ef9d2c..ea42c3eaa6 100644 --- a/automotive/vehicle/2.0/default/Android.bp +++ b/automotive/vehicle/2.0/default/Android.bp @@ -184,6 +184,14 @@ cc_test { "libbase", "libcutils", ], + exclude_shared_libs: [ + "android.automotive.watchdog-V2-ndk_platform", + "android.hardware.automotive.vehicle@2.0", + ], + static_libs: [ + "android.automotive.watchdog-V2-ndk_platform", + "android.hardware.automotive.vehicle@2.0", + ], header_libs: ["libbase_headers"], test_suites: ["general-tests"], } @@ -196,10 +204,16 @@ cc_test { "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp", ], static_libs: [ + "android.automotive.watchdog-V2-ndk_platform", + "android.hardware.automotive.vehicle@2.0", "android.hardware.automotive.vehicle@2.0-default-impl-lib", "android.hardware.automotive.vehicle@2.0-libproto-native", "libprotobuf-cpp-lite", ], + exclude_shared_libs: [ + "android.automotive.watchdog-V2-ndk_platform", + "android.hardware.automotive.vehicle@2.0", + ], test_suites: ["general-tests"], } diff --git a/automotive/vehicle/2.0/default/TEST_MAPPING b/automotive/vehicle/2.0/default/TEST_MAPPING new file mode 100644 index 0000000000..bb58700f62 --- /dev/null +++ b/automotive/vehicle/2.0/default/TEST_MAPPING @@ -0,0 +1,10 @@ +{ + "presubmit": [ + { + "name": "android.hardware.automotive.vehicle@2.0-manager-unit-tests" + }, + { + "name": "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests" + } + ] +} -- GitLab From 7339375409eaf192a96d3d269bc789f907d8ffc0 Mon Sep 17 00:00:00 2001 From: Keun young Park Date: Fri, 25 Sep 2020 17:44:43 -0700 Subject: [PATCH 058/825] Add AIDL version of vehicle hal - This is still under development but will replace HIDL version later. - It will become stable later when all necessary features are ready. - This CL translated HIDL into AIDL as it is. More changes will be added later. - Most code was generate from hidl2aidl: $ hidl2aidl -o tmp android.hardware.automotive.vehicle@2.0 - translate_vehicle_props.py types.hal to generate VehicleProperty enum. - added @utf8InCpp for all String Bug: 148703287 Test: build, make -j android.hardware.automotive.vehicle-cpp android.hardware.automotive.vehicle-java Change-Id: I7a7f1c0c0751ad0101958d56db939324c05400b5 --- automotive/vehicle/aidl/Android.bp | 40 + .../automotive/vehicle/CreateUserRequest.aidl | 46 + .../vehicle/CreateUserResponse.aidl | 44 + .../automotive/vehicle/CreateUserStatus.aidl | 34 + .../automotive/vehicle/CustomInputType.aidl | 41 + .../vehicle/DiagnosticFloatSensorIndex.aidl | 314 ++ .../vehicle/DiagnosticIntegerSensorIndex.aidl | 178 ++ .../ElectronicTollCollectionCardStatus.aidl | 29 + .../ElectronicTollCollectionCardType.aidl | 28 + .../automotive/vehicle/EvConnectorType.aidl | 48 + .../vehicle/EvsServiceRequestIndex.aidl | 27 + .../automotive/vehicle/EvsServiceState.aidl | 27 + .../automotive/vehicle/EvsServiceType.aidl | 27 + .../hardware/automotive/vehicle/FuelType.aidl | 80 + .../hardware/automotive/vehicle/IVehicle.aidl | 115 + .../automotive/vehicle/IVehicleCallback.aidl | 60 + .../vehicle/InitialUserInfoRequest.aidl | 42 + .../vehicle/InitialUserInfoRequestType.aidl | 41 + .../vehicle/InitialUserInfoResponse.aidl | 51 + .../InitialUserInfoResponseAction.aidl | 40 + .../vehicle/Obd2CommonIgnitionMonitors.aidl | 32 + .../Obd2CompressionIgnitionMonitors.aidl | 46 + .../vehicle/Obd2FuelSystemStatus.aidl | 31 + .../automotive/vehicle/Obd2FuelType.aidl | 50 + .../vehicle/Obd2IgnitionMonitorKind.aidl | 27 + .../vehicle/Obd2SecondaryAirStatus.aidl | 30 + .../vehicle/Obd2SparkIgnitionMonitors.aidl | 50 + .../automotive/vehicle/PortLocationType.aidl | 37 + .../vehicle/ProcessTerminationReason.aidl | 38 + .../automotive/vehicle/RemoveUserRequest.aidl | 42 + .../automotive/vehicle/RotaryInputType.aidl | 34 + .../automotive/vehicle/StatusCode.aidl | 48 + .../automotive/vehicle/SubscribeFlags.aidl | 43 + .../automotive/vehicle/SubscribeOptions.aidl | 42 + .../vehicle/SwitchUserMessageType.aidl | 32 + .../automotive/vehicle/SwitchUserRequest.aidl | 51 + .../vehicle/SwitchUserResponse.aidl | 49 + .../automotive/vehicle/SwitchUserStatus.aidl | 33 + .../automotive/vehicle/UserFlags.aidl | 55 + .../UserIdentificationAssociation.aidl | 29 + ...UserIdentificationAssociationSetValue.aidl | 38 + .../UserIdentificationAssociationType.aidl | 48 + .../UserIdentificationAssociationValue.aidl | 43 + .../vehicle/UserIdentificationGetRequest.aidl | 46 + .../vehicle/UserIdentificationResponse.aidl | 48 + .../UserIdentificationSetAssociation.aidl | 29 + .../vehicle/UserIdentificationSetRequest.aidl | 45 + .../hardware/automotive/vehicle/UserInfo.aidl | 28 + .../automotive/vehicle/UsersInfo.aidl | 44 + .../VehicleApPowerStateConfigFlag.aidl | 32 + .../vehicle/VehicleApPowerStateReport.aidl | 92 + .../vehicle/VehicleApPowerStateReq.aidl | 66 + .../vehicle/VehicleApPowerStateReqIndex.aidl | 27 + .../VehicleApPowerStateShutdownParam.aidl | 39 + .../automotive/vehicle/VehicleArea.aidl | 35 + .../automotive/vehicle/VehicleAreaConfig.aidl | 42 + .../automotive/vehicle/VehicleAreaDoor.aidl | 30 + .../automotive/vehicle/VehicleAreaMirror.aidl | 25 + .../automotive/vehicle/VehicleAreaSeat.aidl | 34 + .../automotive/vehicle/VehicleAreaWheel.aidl | 27 + .../automotive/vehicle/VehicleAreaWindow.aidl | 35 + .../automotive/vehicle/VehicleDisplay.aidl | 27 + .../automotive/vehicle/VehicleGear.aidl | 39 + .../vehicle/VehicleHvacFanDirection.aidl | 37 + .../vehicle/VehicleHwKeyInputAction.aidl | 30 + .../vehicle/VehicleIgnitionState.aidl | 47 + .../automotive/vehicle/VehicleLightState.aidl | 31 + .../vehicle/VehicleLightSwitch.aidl | 40 + .../automotive/vehicle/VehicleOilLevel.aidl | 30 + .../automotive/vehicle/VehiclePropConfig.aidl | 63 + .../automotive/vehicle/VehiclePropValue.aidl | 63 + .../vehicle/VehiclePropValueRawValue.aidl | 47 + .../automotive/vehicle/VehicleProperty.aidl | 2587 +++++++++++++++++ .../vehicle/VehiclePropertyAccess.aidl | 33 + .../vehicle/VehiclePropertyChangeMode.aidl | 48 + .../vehicle/VehiclePropertyGroup.aidl | 33 + .../vehicle/VehiclePropertyStatus.aidl | 41 + .../vehicle/VehiclePropertyType.aidl | 59 + .../vehicle/VehicleSeatOccupancyState.aidl | 28 + .../automotive/vehicle/VehicleTurnSignal.aidl | 25 + .../automotive/vehicle/VehicleUnit.aidl | 60 + .../vehicle/VehicleVendorPermission.aidl | 63 + ...msAvailabilityStateIntegerValuesIndex.aidl | 44 + .../VmsBaseMessageIntegerValuesIndex.aidl | 31 + .../automotive/vehicle/VmsMessageType.aidl | 141 + ...LayerAndPublisherIdIntegerValuesIndex.aidl | 37 + ...VmsMessageWithLayerIntegerValuesIndex.aidl | 38 + .../VmsOfferingMessageIntegerValuesIndex.aidl | 43 + ...ublisherInformationIntegerValuesIndex.aidl | 34 + ...StartSessionMessageIntegerValuesIndex.aidl | 53 + ...sSubscriptionsStateIntegerValuesIndex.aidl | 50 + .../vehicle/tools/translate_vehicle_props.py | 151 + .../compatibility_matrix.current.xml | 7 + 93 files changed, 7024 insertions(+) create mode 100644 automotive/vehicle/aidl/Android.bp create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserStatus.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvConnectorType.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceState.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceType.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/FuelType.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicleCallback.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelType.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/PortLocationType.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/RotaryInputType.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeFlags.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserStatus.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserFlags.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleArea.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleDisplay.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleGear.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightState.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleOilLevel.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValueRawValue.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyType.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageType.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/tools/translate_vehicle_props.py diff --git a/automotive/vehicle/aidl/Android.bp b/automotive/vehicle/aidl/Android.bp new file mode 100644 index 0000000000..56a85b9cd2 --- /dev/null +++ b/automotive/vehicle/aidl/Android.bp @@ -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. + +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.automotive.vehicle", + vendor_available: true, + srcs: [ + "android/hardware/automotive/vehicle/**/*.aidl", + ], + // TODO(b/148703287) Make it stable with new APIs + unstable: true, + backend: { + cpp: { + enabled: true, + }, + java: { + enabled: true, + }, + }, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl new file mode 100644 index 0000000000..95537dc368 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.UserInfo; +import android.hardware.automotive.vehicle.UsersInfo; + +/** + * Defines the format of a CREATE_USER property. + * + * NOTE: this struct is not used in the HAL properties directly, it must be converted to + * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. + */ +// @VintfStability +parcelable CreateUserRequest { + /** + * Arbitrary id used to map the response to the request. + */ + int requestId; + /** + * Basic information about Android user that was created. + */ + UserInfo newUserInfo; + /** + * Name of the new Android user. + */ + @utf8InCpp String newUserName; + /** + * Information about the current state of the Android system. + */ + UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl new file mode 100644 index 0000000000..0588052ef4 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.CreateUserStatus; + +/** + * Defines the result of a CreateUserRequest. + * + * NOTE: this struct is not used in the HAL properties directly, it must be converted to + * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. + */ +// @VintfStability +parcelable CreateUserResponse { + /** + * Id of the request being responded. + */ + int requestId; + /** + * Status of the request. + */ + CreateUserStatus status; + /** + * HAL-specific error message. + * + * This argument is optional, and when defined, it's passed "as-is" to the caller. It could be + * used to show custom error messages to the end user. + */ + @utf8InCpp String errorMessage; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserStatus.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserStatus.aidl new file mode 100644 index 0000000000..f841ff6578 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserStatus.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Status of the response to a CreateUserRequest. + */ +// @VintfStability +@Backing(type="int") +enum CreateUserStatus { + /** + * The request succeeded (for example, HAL created a new internal user, or associated the + * Android user to an existing internal user). + */ + SUCCESS = 1, + /** + * The request failed (and Android will remove the Android user). + */ + FAILURE = 2, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl new file mode 100644 index 0000000000..1335eea669 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Input code values for HW_CUSTOM_INPUT. + */ +// @VintfStability +@Backing(type="int") +enum CustomInputType { + /** + * Ten functions representing the custom input code to be defined and implemented by OEM + * partners. + * + * OEMs need to formally contact Android team if more than 10 functions are required. + */ + CUSTOM_EVENT_F1 = 1001, + CUSTOM_EVENT_F2 = 1002, + CUSTOM_EVENT_F3 = 1003, + CUSTOM_EVENT_F4 = 1004, + CUSTOM_EVENT_F5 = 1005, + CUSTOM_EVENT_F6 = 1006, + CUSTOM_EVENT_F7 = 1007, + CUSTOM_EVENT_F8 = 1008, + CUSTOM_EVENT_F9 = 1009, + CUSTOM_EVENT_F10 = 1010, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl new file mode 100644 index 0000000000..017589fe6e --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl @@ -0,0 +1,314 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * This enum provides the canonical mapping for sensor properties that have a floating-point value. + * The ordering of the values is taken from the OBD2 specification. + * Any value greater than the last reserved index is available to vendors to map their extensions. + * While these values do not directly map to SAE J1979 PIDs, an equivalence is listed next + * to each one to aid implementors. + */ +// @VintfStability +@Backing(type="int") +enum DiagnosticFloatSensorIndex { + CALCULATED_ENGINE_LOAD = 0, + /* + * PID 0x04 + */ + ENGINE_COOLANT_TEMPERATURE = 1, + /* + * PID 0x05 + */ + SHORT_TERM_FUEL_TRIM_BANK1 = 2, + /* + * PID 0x06 + */ + LONG_TERM_FUEL_TRIM_BANK1 = 3, + /* + * PID 0x07 + */ + SHORT_TERM_FUEL_TRIM_BANK2 = 4, + /* + * PID 0x08 + */ + LONG_TERM_FUEL_TRIM_BANK2 = 5, + /* + * PID 0x09 + */ + FUEL_PRESSURE = 6, + /* + * PID 0x0A + */ + INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 7, + /* + * PID 0x0B + */ + ENGINE_RPM = 8, + /* + * PID 0x0C + */ + VEHICLE_SPEED = 9, + /* + * PID 0x0D + */ + TIMING_ADVANCE = 10, + /* + * PID 0x0E + */ + MAF_AIR_FLOW_RATE = 11, + /* + * PID 0x10 + */ + THROTTLE_POSITION = 12, + /* + * PID 0x11 + */ + OXYGEN_SENSOR1_VOLTAGE = 13, + /* + * PID 0x14 + */ + OXYGEN_SENSOR1_SHORT_TERM_FUEL_TRIM = 14, + /* + * PID 0x14 + */ + OXYGEN_SENSOR1_FUEL_AIR_EQUIVALENCE_RATIO = 15, + /* + * PID 0x24 + */ + OXYGEN_SENSOR2_VOLTAGE = 16, + /* + * PID 0x15 + */ + OXYGEN_SENSOR2_SHORT_TERM_FUEL_TRIM = 17, + /* + * PID 0x15 + */ + OXYGEN_SENSOR2_FUEL_AIR_EQUIVALENCE_RATIO = 18, + /* + * PID 0x25 + */ + OXYGEN_SENSOR3_VOLTAGE = 19, + /* + * PID 0x16 + */ + OXYGEN_SENSOR3_SHORT_TERM_FUEL_TRIM = 20, + /* + * PID 0x16 + */ + OXYGEN_SENSOR3_FUEL_AIR_EQUIVALENCE_RATIO = 21, + /* + * PID 0x26 + */ + OXYGEN_SENSOR4_VOLTAGE = 22, + /* + * PID 0x17 + */ + OXYGEN_SENSOR4_SHORT_TERM_FUEL_TRIM = 23, + /* + * PID 0x17 + */ + OXYGEN_SENSOR4_FUEL_AIR_EQUIVALENCE_RATIO = 24, + /* + * PID 0x27 + */ + OXYGEN_SENSOR5_VOLTAGE = 25, + /* + * PID 0x18 + */ + OXYGEN_SENSOR5_SHORT_TERM_FUEL_TRIM = 26, + /* + * PID 0x18 + */ + OXYGEN_SENSOR5_FUEL_AIR_EQUIVALENCE_RATIO = 27, + /* + * PID 0x28 + */ + OXYGEN_SENSOR6_VOLTAGE = 28, + /* + * PID 0x19 + */ + OXYGEN_SENSOR6_SHORT_TERM_FUEL_TRIM = 29, + /* + * PID 0x19 + */ + OXYGEN_SENSOR6_FUEL_AIR_EQUIVALENCE_RATIO = 30, + /* + * PID 0x29 + */ + OXYGEN_SENSOR7_VOLTAGE = 31, + /* + * PID 0x1A + */ + OXYGEN_SENSOR7_SHORT_TERM_FUEL_TRIM = 32, + /* + * PID 0x1A + */ + OXYGEN_SENSOR7_FUEL_AIR_EQUIVALENCE_RATIO = 33, + /* + * PID 0x2A + */ + OXYGEN_SENSOR8_VOLTAGE = 34, + /* + * PID 0x1B + */ + OXYGEN_SENSOR8_SHORT_TERM_FUEL_TRIM = 35, + /* + * PID 0x1B + */ + OXYGEN_SENSOR8_FUEL_AIR_EQUIVALENCE_RATIO = 36, + /* + * PID 0x2B + */ + FUEL_RAIL_PRESSURE = 37, + /* + * PID 0x22 + */ + FUEL_RAIL_GAUGE_PRESSURE = 38, + /* + * PID 0x23 + */ + COMMANDED_EXHAUST_GAS_RECIRCULATION = 39, + /* + * PID 0x2C + */ + EXHAUST_GAS_RECIRCULATION_ERROR = 40, + /* + * PID 0x2D + */ + COMMANDED_EVAPORATIVE_PURGE = 41, + /* + * PID 0x2E + */ + FUEL_TANK_LEVEL_INPUT = 42, + /* + * PID 0x2F + */ + EVAPORATION_SYSTEM_VAPOR_PRESSURE = 43, + /* + * PID 0x32 + */ + CATALYST_TEMPERATURE_BANK1_SENSOR1 = 44, + /* + * PID 0x3C + */ + CATALYST_TEMPERATURE_BANK2_SENSOR1 = 45, + /* + * PID 0x3D + */ + CATALYST_TEMPERATURE_BANK1_SENSOR2 = 46, + /* + * PID 0x3E + */ + CATALYST_TEMPERATURE_BANK2_SENSOR2 = 47, + /* + * PID 0x3F + */ + ABSOLUTE_LOAD_VALUE = 48, + /* + * PID 0x43 + */ + FUEL_AIR_COMMANDED_EQUIVALENCE_RATIO = 49, + /* + * PID 0x44 + */ + RELATIVE_THROTTLE_POSITION = 50, + /* + * PID 0x45 + */ + ABSOLUTE_THROTTLE_POSITION_B = 51, + /* + * PID 0x47 + */ + ABSOLUTE_THROTTLE_POSITION_C = 52, + /* + * PID 0x48 + */ + ACCELERATOR_PEDAL_POSITION_D = 53, + /* + * PID 0x49 + */ + ACCELERATOR_PEDAL_POSITION_E = 54, + /* + * PID 0x4A + */ + ACCELERATOR_PEDAL_POSITION_F = 55, + /* + * PID 0x4B + */ + COMMANDED_THROTTLE_ACTUATOR = 56, + /* + * PID 0x4C + */ + ETHANOL_FUEL_PERCENTAGE = 57, + /* + * PID 0x52 + */ + ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE = 58, + /* + * PID 0x53 + */ + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 59, + /* + * PID 0x55 + */ + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 60, + /* + * PID 0x57 + */ + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 61, + /* + * PID 0x55 + */ + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 62, + /* + * PID 0x57 + */ + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 63, + /* + * PID 0x56 + */ + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 64, + /* + * PID 0x58 + */ + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 65, + /* + * PID 0x56 + */ + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 66, + /* + * PID 0x58 + */ + RELATIVE_ACCELERATOR_PEDAL_POSITION = 67, + /* + * PID 0x5A + */ + HYBRID_BATTERY_PACK_REMAINING_LIFE = 68, + /* + * PID 0x5B + */ + FUEL_INJECTION_TIMING = 69, + /* + * PID 0x5D + */ + ENGINE_FUEL_RATE = 70, + /* + * PID 0x5E + */ + // LAST_SYSTEM_INDEX = ENGINE_FUEL_RATE, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl new file mode 100644 index 0000000000..86c8a459c4 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl @@ -0,0 +1,178 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * This enum provides the canonical mapping for sensor properties that have an integer value. + * The ordering of the values is taken from the OBD2 specification. + * Some of the properties are represented as an integer mapping to another enum. In those cases + * expect a comment by the property definition describing the enum to look at for the mapping. + * Any value greater than the last reserved index is available to vendors to map their extensions. + * While these values do not directly map to SAE J1979 PIDs, an equivalence is listed next + * to each one to aid implementors. + */ +// @VintfStability +@Backing(type="int") +enum DiagnosticIntegerSensorIndex { + /** + * refer to FuelSystemStatus for a description of this value. + */ + FUEL_SYSTEM_STATUS = 0, + /* + * PID 0x03 + */ + MALFUNCTION_INDICATOR_LIGHT_ON = 1, + /* + * PID 0x01 + * + * + * refer to IgnitionMonitorKind for a description of this value. + */ + IGNITION_MONITORS_SUPPORTED = 2, + /* + * PID 0x01 + * + * + * The value of this sensor is a bitmask that specifies whether ignition-specific + * tests are available and whether they are complete. The semantics of the individual + * bits in this value are given by, respectively, SparkIgnitionMonitors and + * CompressionIgnitionMonitors depending on the value of IGNITION_MONITORS_SUPPORTED. + */ + IGNITION_SPECIFIC_MONITORS = 3, + /* + * PID 0x01 + */ + INTAKE_AIR_TEMPERATURE = 4, + /* + * PID 0x0F + * + * + * refer to SecondaryAirStatus for a description of this value. + */ + COMMANDED_SECONDARY_AIR_STATUS = 5, + /* + * PID 0x12 + */ + NUM_OXYGEN_SENSORS_PRESENT = 6, + /* + * PID 0x13 + */ + RUNTIME_SINCE_ENGINE_START = 7, + /* + * PID 0x1F + */ + DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON = 8, + /* + * PID 0x21 + */ + WARMUPS_SINCE_CODES_CLEARED = 9, + /* + * PID 0x30 + */ + DISTANCE_TRAVELED_SINCE_CODES_CLEARED = 10, + /* + * PID 0x31 + */ + ABSOLUTE_BAROMETRIC_PRESSURE = 11, + /* + * PID 0x33 + */ + CONTROL_MODULE_VOLTAGE = 12, + /* + * PID 0x42 + */ + AMBIENT_AIR_TEMPERATURE = 13, + /* + * PID 0x46 + */ + TIME_WITH_MALFUNCTION_LIGHT_ON = 14, + /* + * PID 0x4D + */ + TIME_SINCE_TROUBLE_CODES_CLEARED = 15, + /* + * PID 0x4E + */ + MAX_FUEL_AIR_EQUIVALENCE_RATIO = 16, + /* + * PID 0x4F + */ + MAX_OXYGEN_SENSOR_VOLTAGE = 17, + /* + * PID 0x4F + */ + MAX_OXYGEN_SENSOR_CURRENT = 18, + /* + * PID 0x4F + */ + MAX_INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 19, + /* + * PID 0x4F + */ + MAX_AIR_FLOW_RATE_FROM_MASS_AIR_FLOW_SENSOR = 20, + /* + * PID 0x50 + * + * + * refer to FuelType for a description of this value. + */ + FUEL_TYPE = 21, + /* + * PID 0x51 + */ + FUEL_RAIL_ABSOLUTE_PRESSURE = 22, + /* + * PID 0x59 + */ + ENGINE_OIL_TEMPERATURE = 23, + /* + * PID 0x5C + */ + DRIVER_DEMAND_PERCENT_TORQUE = 24, + /* + * PID 0x61 + */ + ENGINE_ACTUAL_PERCENT_TORQUE = 25, + /* + * PID 0x62 + */ + ENGINE_REFERENCE_PERCENT_TORQUE = 26, + /* + * PID 0x63 + */ + ENGINE_PERCENT_TORQUE_DATA_IDLE = 27, + /* + * PID 0x64 + */ + ENGINE_PERCENT_TORQUE_DATA_POINT1 = 28, + /* + * PID 0x64 + */ + ENGINE_PERCENT_TORQUE_DATA_POINT2 = 29, + /* + * PID 0x64 + */ + ENGINE_PERCENT_TORQUE_DATA_POINT3 = 30, + /* + * PID 0x64 + */ + ENGINE_PERCENT_TORQUE_DATA_POINT4 = 31, + /* + * PID 0x64 + */ + // LAST_SYSTEM_INDEX = 31, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl new file mode 100644 index 0000000000..cb55ffa10b --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by ELECTRONIC_TOLL_COLLECTION_CARD_STATUS. + */ +// @VintfStability +@Backing(type="int") +enum ElectronicTollCollectionCardStatus { + UNKNOWN = 0, + ELECTRONIC_TOLL_COLLECTION_CARD_VALID = 1, + ELECTRONIC_TOLL_COLLECTION_CARD_INVALID = 2, + ELECTRONIC_TOLL_COLLECTION_CARD_NOT_INSERTED = 3, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl new file mode 100644 index 0000000000..78254fb30f --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by ELECTRONIC_TOLL_COLLECTION_CARD_TYPE. + */ +// @VintfStability +@Backing(type="int") +enum ElectronicTollCollectionCardType { + UNKNOWN = 0, + JP_ELECTRONIC_TOLL_COLLECTION_CARD = 1, + JP_ELECTRONIC_TOLL_COLLECTION_CARD_V2 = 2, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvConnectorType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvConnectorType.aidl new file mode 100644 index 0000000000..fc95bb0f10 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvConnectorType.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by INFO_EV_CONNECTOR_TYPE to enumerate the type of connectors + * available to charge the vehicle. + */ +// @VintfStability +@Backing(type="int") +enum EvConnectorType { + /** + * Default type if the vehicle does not know or report the EV connector + * type. + */ + UNKNOWN = 0, + IEC_TYPE_1_AC = 1, + IEC_TYPE_2_AC = 2, + IEC_TYPE_3_AC = 3, + IEC_TYPE_4_DC = 4, + IEC_TYPE_1_CCS_DC = 5, + IEC_TYPE_2_CCS_DC = 6, + TESLA_ROADSTER = 7, + TESLA_HPWC = 8, + TESLA_SUPERCHARGER = 9, + GBT_AC = 10, + GBT_DC = 11, + /** + * Connector type to use when no other types apply. Before using this + * value, work with Google to see if the EvConnectorType enum can be + * extended with an appropriate value. + */ + OTHER = 101, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl new file mode 100644 index 0000000000..6853ccd570 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Index in int32VAlues for VehicleProperty#EVS_SERVICE_REQUEST property. + */ +// @VintfStability +@Backing(type="int") +enum EvsServiceRequestIndex { + TYPE = 0, + STATE = 1, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceState.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceState.aidl new file mode 100644 index 0000000000..e351949f71 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceState.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by EVS_SERVICE_REQUEST to enumerate the service's state. + */ +// @VintfStability +@Backing(type="int") +enum EvsServiceState { + OFF = 0, + ON = 1, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceType.aidl new file mode 100644 index 0000000000..4ca241a308 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceType.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by EVS_SERVICE_REQUEST to enumerate the service's type. + */ +// @VintfStability +@Backing(type="int") +enum EvsServiceType { + REARVIEW = 0, + SURROUNDVIEW = 1, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/FuelType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/FuelType.aidl new file mode 100644 index 0000000000..131ac148ee --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/FuelType.aidl @@ -0,0 +1,80 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by INFO_FUEL_TYPE to enumerate the type of fuels this vehicle uses. + * Consistent with projection protocol. + */ +// @VintfStability +@Backing(type="int") +enum FuelType { + /** + * Fuel type to use if the HU does not know on which types of fuel the vehicle + * runs. The use of this value is generally discouraged outside of aftermarket units. + */ + FUEL_TYPE_UNKNOWN = 0, + /** + * Unleaded gasoline + */ + FUEL_TYPE_UNLEADED = 1, + /** + * Leaded gasoline + */ + FUEL_TYPE_LEADED = 2, + /** + * Diesel #1 + */ + FUEL_TYPE_DIESEL_1 = 3, + /** + * Diesel #2 + */ + FUEL_TYPE_DIESEL_2 = 4, + /** + * Biodiesel + */ + FUEL_TYPE_BIODIESEL = 5, + /** + * 85% ethanol/gasoline blend + */ + FUEL_TYPE_E85 = 6, + /** + * Liquified petroleum gas + */ + FUEL_TYPE_LPG = 7, + /** + * Compressed natural gas + */ + FUEL_TYPE_CNG = 8, + /** + * Liquified natural gas + */ + FUEL_TYPE_LNG = 9, + /** + * Electric + */ + FUEL_TYPE_ELECTRIC = 10, + /** + * Hydrogen fuel cell + */ + FUEL_TYPE_HYDROGEN = 11, + /** + * Fuel type to use when no other types apply. Before using this value, work with + * Google to see if the FuelType enum can be extended with an appropriate value. + */ + FUEL_TYPE_OTHER = 12, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl new file mode 100644 index 0000000000..acb840995e --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl @@ -0,0 +1,115 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.IVehicleCallback; +import android.hardware.automotive.vehicle.StatusCode; +import android.hardware.automotive.vehicle.SubscribeOptions; +import android.hardware.automotive.vehicle.VehiclePropConfig; +import android.hardware.automotive.vehicle.VehiclePropValue; + +// @VintfStability +interface IVehicle { + // Adding return type to method instead of out param String s since there is only one return + // value. + /** + * Print out debugging state for the vehicle hal. + * + * The text must be in ASCII encoding only. + * + * Performance requirements: + * + * The HAL must return from this call in less than 10ms. This call must avoid + * deadlocks, as it may be called at any point of operation. Any synchronization + * primitives used (such as mutex locks or semaphores) must be acquired + * with a timeout. + * + */ + String debugDump(); + + /** + * Get a vehicle property value. + * + * For VehiclePropertyChangeMode::STATIC properties, this method must always + * return the same value always. + * For VehiclePropertyChangeMode::ON_CHANGE properties, it must return the + * latest available value. + * + * Some properties like RADIO_PRESET requires to pass additional data in + * GET request in VehiclePropValue object. + * + * If there is no data available yet, which can happen during initial stage, + * this call must return immediately with an error code of + * StatusCode::TRY_AGAIN. + */ + StatusCode get(in VehiclePropValue requestedPropValue, out VehiclePropValue propValue); + + // Adding return type to method instead of out param VehiclePropConfig[] propConfigs since there + // is only one return value. + /** + * Returns a list of all property configurations supported by this vehicle + * HAL. + */ + VehiclePropConfig[] getAllPropConfigs(); + + /** + * Returns a list of property configurations for given properties. + * + * If requested VehicleProperty wasn't found it must return + * StatusCode::INVALID_ARG, otherwise a list of vehicle property + * configurations with StatusCode::OK + */ + StatusCode getPropConfigs(in int[] props, out VehiclePropConfig[] propConfigs); + + // Adding return type to method instead of out param StatusCode status since there is only one + // return value. + /** + * Set a vehicle property value. + * + * Timestamp of data must be ignored for set operation. + * + * Setting some properties require having initial state available. If initial + * data is not available yet this call must return StatusCode::TRY_AGAIN. + * For a property with separate power control this call must return + * StatusCode::NOT_AVAILABLE error if property is not powered on. + */ + StatusCode set(in VehiclePropValue propValue); + + // Adding return type to method instead of out param StatusCode status since there is only one + // return value. + /** + * Subscribes to property events. + * + * Clients must be able to subscribe to multiple properties at a time + * depending on data provided in options argument. + * + * @param listener This client must be called on appropriate event. + * @param options List of options to subscribe. SubscribeOption contains + * information such as property Id, area Id, sample rate, etc. + */ + StatusCode subscribe(in IVehicleCallback callback, in SubscribeOptions[] options); + + // Adding return type to method instead of out param StatusCode status since there is only one + // return value. + /** + * Unsubscribes from property events. + * + * If this client wasn't subscribed to the given property, this method + * must return StatusCode::INVALID_ARG. + */ + StatusCode unsubscribe(in IVehicleCallback callback, in int propId); +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicleCallback.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicleCallback.aidl new file mode 100644 index 0000000000..1b5a1e2027 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicleCallback.aidl @@ -0,0 +1,60 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.StatusCode; +import android.hardware.automotive.vehicle.VehiclePropValue; + +// @VintfStability +interface IVehicleCallback { + /** + * Event callback happens whenever a variable that the API user has + * subscribed to needs to be reported. This may be based purely on + * threshold and frequency (a regular subscription, see subscribe call's + * arguments) or when the IVehicle#set method was called and the actual + * change needs to be reported. + * + * These callbacks are chunked. + * + * @param values that has been updated. + */ + oneway void onPropertyEvent(in VehiclePropValue[] propValues); + + /** + * This method gets called if the client was subscribed to a property using + * SubscribeFlags::EVENTS_FROM_ANDROID flag and IVehicle#set(...) method was called. + * + * These events must be delivered to subscriber immediately without any + * batching. + * + * @param value Value that was set by a client. + */ + oneway void onPropertySet(in VehiclePropValue propValue); + + /** + * Set property value is usually asynchronous operation. Thus even if + * client received StatusCode::OK from the IVehicle::set(...) this + * doesn't guarantee that the value was successfully propagated to the + * vehicle network. If such rare event occurs this method must be called. + * + * @param errorCode - any value from StatusCode enum. + * @param property - a property where error has happened. + * @param areaId - bitmask that specifies in which areas the problem has + * occurred, must be 0 for global properties + */ + oneway void onPropertySetError(in StatusCode errorCode, in int propId, in int areaId); +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl new file mode 100644 index 0000000000..12746ce993 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.InitialUserInfoRequestType; +import android.hardware.automotive.vehicle.UsersInfo; + +/** + * Defines the format of a INITIAL_USER_INFO request made by the Android system. + * + * NOTE: this struct is not used in the HAL properties directly, it must be converted to + * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. + */ +// @VintfStability +parcelable InitialUserInfoRequest { + /** + * Arbitrary id used to map the HAL response to the request. + */ + int requestId; + /** + * Type of request. + */ + InitialUserInfoRequestType requestType; + /** + * Information about the current state of the Android system. + */ + UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl new file mode 100644 index 0000000000..12fec24475 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequestType.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Defines when a INITIAL_USER_INFO request was made. + */ +// @VintfStability +@Backing(type="int") +enum InitialUserInfoRequestType { + /** + * At the first time Android was booted (or after a factory reset). + */ + FIRST_BOOT = 1, + /** + * At the first time Android was booted after the system was updated. + */ + FIRST_BOOT_AFTER_OTA = 2, + /** + * When Android was booted "from scratch". + */ + COLD_BOOT = 3, + /** + * When Android was resumed after the system was suspended to memory. + */ + RESUME = 4, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl new file mode 100644 index 0000000000..34d9062618 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.InitialUserInfoResponseAction; +import android.hardware.automotive.vehicle.UserInfo; + +/** + * Defines the format of a HAL response to a INITIAL_USER_INFO request. + * + * NOTE: this struct is not used in the HAL properties directly, it must be converted to + * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. + */ +// @VintfStability +parcelable InitialUserInfoResponse { + /** + * Id of the request being responded. + */ + int requestId; + /** + * which action the Android system should take. + */ + InitialUserInfoResponseAction action; + /** + * Information about the user that should be switched to or created. + */ + UserInfo userToSwitchOrCreate; + /** + * System locales of the initial user (value will be passed as-is to + * android.provider.Settings.System.SYSTEM_LOCALES) + */ + @utf8InCpp String userLocales; + /** + * Name of the user that should be created. + */ + @utf8InCpp String userNameToCreate; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl new file mode 100644 index 0000000000..e35fa9ab03 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Defines which action the Android system should take in an INITIAL_USER_INFO request. + */ +// @VintfStability +@Backing(type="int") +enum InitialUserInfoResponseAction { + /** + * Let the Android System decide what to do. + * + * For example, it might create a new user on first boot, and switch to the last + * active user afterwards. + */ + DEFAULT = 0, + /** + * Switch to an existing Android user. + */ + SWITCH = 1, + /** + * Create a new Android user (and switch to it). + */ + CREATE = 2, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl new file mode 100644 index 0000000000..775d53112a --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Ignition monitors common to both SPARK and COMPRESSION. + * These values come from the SAE J1979 standard. + */ +// @VintfStability +@Backing(type="int") +enum Obd2CommonIgnitionMonitors { + COMPONENTS_AVAILABLE = 0x1 << 0, + COMPONENTS_INCOMPLETE = 0x1 << 1, + FUEL_SYSTEM_AVAILABLE = 0x1 << 2, + FUEL_SYSTEM_INCOMPLETE = 0x1 << 3, + MISFIRE_AVAILABLE = 0x1 << 4, + MISFIRE_INCOMPLETE = 0x1 << 5, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl new file mode 100644 index 0000000000..ab444e16e0 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.Obd2CommonIgnitionMonitors; + +/** + * Ignition monitors only available for COMPRESSION vehicles. + * These values come from the SAE J1979 standard. + */ +// @VintfStability +@Backing(type="int") +enum Obd2CompressionIgnitionMonitors { + COMPONENTS_AVAILABLE = 0x1 << 0, + COMPONENTS_INCOMPLETE = 0x1 << 1, + FUEL_SYSTEM_AVAILABLE = 0x1 << 2, + FUEL_SYSTEM_INCOMPLETE = 0x1 << 3, + MISFIRE_AVAILABLE = 0x1 << 4, + MISFIRE_INCOMPLETE = 0x1 << 5, + EGR_OR_VVT_AVAILABLE = 0x1 << 6, + EGR_OR_VVT_INCOMPLETE = 0x1 << 7, + PM_FILTER_AVAILABLE = 0x1 << 8, + PM_FILTER_INCOMPLETE = 0x1 << 9, + EXHAUST_GAS_SENSOR_AVAILABLE = 0x1 << 10, + EXHAUST_GAS_SENSOR_INCOMPLETE = 0x1 << 11, + BOOST_PRESSURE_AVAILABLE = 0x1 << 12, + BOOST_PRESSURE_INCOMPLETE = 0x1 << 13, + NOx_SCR_AVAILABLE = 0x1 << 14, + NOx_SCR_INCOMPLETE = 0x1 << 15, + NMHC_CATALYST_AVAILABLE = 0x1 << 16, + NMHC_CATALYST_INCOMPLETE = 0x1 << 17, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl new file mode 100644 index 0000000000..9b4ce8f976 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * The status of the vehicle's fuel system. + * These values come from the SAE J1979 standard. + */ +// @VintfStability +@Backing(type="int") +enum Obd2FuelSystemStatus { + OPEN_INSUFFICIENT_ENGINE_TEMPERATURE = 1, + CLOSED_LOOP = 2, + OPEN_ENGINE_LOAD_OR_DECELERATION = 4, + OPEN_SYSTEM_FAILURE = 8, + CLOSED_LOOP_BUT_FEEDBACK_FAULT = 16, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelType.aidl new file mode 100644 index 0000000000..1428f2c05a --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelType.aidl @@ -0,0 +1,50 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * The fuel type(s) supported by a vehicle. + * These values come from the SAE J1979 standard. + */ +// @VintfStability +@Backing(type="int") +enum Obd2FuelType { + NOT_AVAILABLE = 0, + GASOLINE = 1, + METHANOL = 2, + ETHANOL = 3, + DIESEL = 4, + LPG = 5, + CNG = 6, + PROPANE = 7, + ELECTRIC = 8, + BIFUEL_RUNNING_GASOLINE = 9, + BIFUEL_RUNNING_METHANOL = 10, + BIFUEL_RUNNING_ETHANOL = 11, + BIFUEL_RUNNING_LPG = 12, + BIFUEL_RUNNING_CNG = 13, + BIFUEL_RUNNING_PROPANE = 14, + BIFUEL_RUNNING_ELECTRIC = 15, + BIFUEL_RUNNING_ELECTRIC_AND_COMBUSTION = 16, + HYBRID_GASOLINE = 17, + HYBRID_ETHANOL = 18, + HYBRID_DIESEL = 19, + HYBRID_ELECTRIC = 20, + HYBRID_RUNNING_ELECTRIC_AND_COMBUSTION = 21, + HYBRID_REGENERATIVE = 22, + BIFUEL_RUNNING_DIESEL = 23, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl new file mode 100644 index 0000000000..477b38d358 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Defines which ignition monitors are available to be read. + */ +// @VintfStability +@Backing(type="int") +enum Obd2IgnitionMonitorKind { + SPARK = 0, + COMPRESSION = 1, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl new file mode 100644 index 0000000000..f257164066 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * The status of the vehicle's secondary air system. + * These values come from the SAE J1979 standard. + */ +// @VintfStability +@Backing(type="int") +enum Obd2SecondaryAirStatus { + UPSTREAM = 1, + DOWNSTREAM_OF_CATALYCIC_CONVERTER = 2, + FROM_OUTSIDE_OR_OFF = 4, + PUMP_ON_FOR_DIAGNOSTICS = 8, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl new file mode 100644 index 0000000000..75504df675 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl @@ -0,0 +1,50 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.Obd2CommonIgnitionMonitors; + +/** + * Ignition monitors available for SPARK vehicles. + * These values come from the SAE J1979 standard. + */ +// @VintfStability +@Backing(type="int") +enum Obd2SparkIgnitionMonitors { + COMPONENTS_AVAILABLE = 0x1 << 0, + COMPONENTS_INCOMPLETE = 0x1 << 1, + FUEL_SYSTEM_AVAILABLE = 0x1 << 2, + FUEL_SYSTEM_INCOMPLETE = 0x1 << 3, + MISFIRE_AVAILABLE = 0x1 << 4, + MISFIRE_INCOMPLETE = 0x1 << 5, + EGR_AVAILABLE = 0x1 << 6, + EGR_INCOMPLETE = 0x1 << 7, + OXYGEN_SENSOR_HEATER_AVAILABLE = 0x1 << 8, + OXYGEN_SENSOR_HEATER_INCOMPLETE = 0x1 << 9, + OXYGEN_SENSOR_AVAILABLE = 0x1 << 10, + OXYGEN_SENSOR_INCOMPLETE = 0x1 << 11, + AC_REFRIGERANT_AVAILABLE = 0x1 << 12, + AC_REFRIGERANT_INCOMPLETE = 0x1 << 13, + SECONDARY_AIR_SYSTEM_AVAILABLE = 0x1 << 14, + SECONDARY_AIR_SYSTEM_INCOMPLETE = 0x1 << 15, + EVAPORATIVE_SYSTEM_AVAILABLE = 0x1 << 16, + EVAPORATIVE_SYSTEM_INCOMPLETE = 0x1 << 17, + HEATED_CATALYST_AVAILABLE = 0x1 << 18, + HEATED_CATALYST_INCOMPLETE = 0x1 << 19, + CATALYST_AVAILABLE = 0x1 << 20, + CATALYST_INCOMPLETE = 0x1 << 21, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/PortLocationType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/PortLocationType.aidl new file mode 100644 index 0000000000..260dd42ee4 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/PortLocationType.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by INFO_FUEL_DOOR_LOCATION/INFO_CHARGE_PORT_LOCATION to enumerate fuel door or + * ev port location. + */ +// @VintfStability +@Backing(type="int") +enum PortLocationType { + /** + * Default type if the vehicle does not know or report the Fuel door + * and ev port location. + */ + UNKNOWN = 0, + FRONT_LEFT = 1, + FRONT_RIGHT = 2, + REAR_RIGHT = 3, + REAR_LEFT = 4, + FRONT = 5, + REAR = 6, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl new file mode 100644 index 0000000000..e54a08b3be --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ProcessTerminationReason.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * The reason why a process is terminated by car watchdog. + * This is used with WATCHDOG_TERMINATED_PROCESS property. + */ +// @VintfStability +@Backing(type="int") +enum ProcessTerminationReason { + /** + * A process doesn't respond to car watchdog within the timeout. + */ + NOT_RESPONDING = 1, + /** + * A process uses more IO operations than what is allowed. + */ + IO_OVERUSE = 2, + /** + * A process uses more memory space than what is allowed. + */ + MEMORY_OVERUSE = 3, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl new file mode 100644 index 0000000000..79a8c598dc --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.UserInfo; +import android.hardware.automotive.vehicle.UsersInfo; + +/** + * Defines the format of a REMOVE_USER property. + * + * NOTE: this struct is not used in the HAL properties directly, it must be converted to + * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. + */ +// @VintfStability +parcelable RemoveUserRequest { + /** + * Arbitrary id used to map the response to the request. + */ + int requestId; + /** + * Information about the Android user that was removed. + */ + UserInfo removedUserInfo; + /** + * Information about the current state of the Android system. + */ + UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RotaryInputType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RotaryInputType.aidl new file mode 100644 index 0000000000..eca703a9c2 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RotaryInputType.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * A rotary control which can rotate without limits. These controls use HW_ROTARY_INPUT to report + * relative clockwise or counterclockwise motion. They have no absolute position. + */ +// @VintfStability +@Backing(type="int") +enum RotaryInputType { + /** + * Main rotary control, typically in the center console, used to navigate the user interface. + */ + ROTARY_INPUT_TYPE_SYSTEM_NAVIGATION = 0, + /** + * Volume control for adjusting audio volume. + */ + ROTARY_INPUT_TYPE_AUDIO_VOLUME = 1, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl new file mode 100644 index 0000000000..9b29229757 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Error codes used in vehicle HAL interface. + */ +// @VintfStability +@Backing(type="int") +enum StatusCode { + OK = 0, + /** + * Try again. + */ + TRY_AGAIN = 1, + /** + * Invalid argument provided. + */ + INVALID_ARG = 2, + /** + * This code must be returned when device that associated with the vehicle + * property is not available. For example, when client tries to set HVAC + * temperature when the whole HVAC unit is turned OFF. + */ + NOT_AVAILABLE = 3, + /** + * Access denied + */ + ACCESS_DENIED = 4, + /** + * Something unexpected has happened in Vehicle HAL + */ + INTERNAL_ERROR = 5, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeFlags.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeFlags.aidl new file mode 100644 index 0000000000..d997990d1d --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeFlags.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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum SubscribeFlags { + UNDEFINED = 0x0, + + /** + * Subscribe to event that was originated in vehicle HAL + * (most likely this event came from the vehicle itself). + */ + EVENTS_FROM_CAR = 0x1, + + /** + * Use this flag to subscribe on events when IVehicle#set(...) was called by + * vehicle HAL's client (e.g. Car Service). + */ + EVENTS_FROM_ANDROID = 0x2, + + /** + * Property event for this property should be passed through shared memory with only this + * property's data included. This can be helpful for reducing memory copy in upper layer + * for data with bigger payload. If payload size is small, VHAL can send this through non-shared + * memory path instead. + */ + EXCLUSIVE_SHARED_MEMORY = 0x4, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl new file mode 100644 index 0000000000..0769f286cb --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.SubscribeFlags; + +/** + * Encapsulates information about subscription to vehicle property events. + */ +// @VintfStability +parcelable SubscribeOptions { + /** Property to subscribe */ + int propId; + + /** + * Sample rate in Hz. + * + * Must be provided for properties with + * VehiclePropertyChangeMode::CONTINUOUS. The value must be within + * VehiclePropConfig#minSamplingRate .. VehiclePropConfig#maxSamplingRate + * for a given property. + * This value indicates how many updates per second client wants to receive. + */ + float sampleRate; + + /** Flags that indicate to which event sources to listen. */ + SubscribeFlags flags; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl new file mode 100644 index 0000000000..c0b5d68be1 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Defines the reason a SWITCH_USER call was made. + * + * The meaning of each constant is explained in that property. + */ +// @VintfStability +@Backing(type="int") +enum SwitchUserMessageType { + LEGACY_ANDROID_SWITCH = 1, + ANDROID_SWITCH = 2, + VEHICLE_RESPONSE = 3, + VEHICLE_REQUEST = 4, + ANDROID_POST_SWITCH = 5, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl new file mode 100644 index 0000000000..9a324f417a --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.SwitchUserMessageType; +import android.hardware.automotive.vehicle.UserInfo; +import android.hardware.automotive.vehicle.UsersInfo; + +/** + * Defines the format of a SWITCH_USER property. + * + * NOTE: this struct is not used in the HAL properties directly, it must be converted to + * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. + */ +// @VintfStability +parcelable SwitchUserRequest { + /** + * Arbitrary id used to map the response to the request. + */ + int requestId; + /** + * Type of message. + */ + SwitchUserMessageType messageType; + /** + * Information about the Android user being switched to. + * + * Only the user id (but not the flags) should be set when the request is made by HAL. + */ + UserInfo targetUser; + /** + * Information about the current state of the Android system. + * + * Should not be set when the request is made by HAL. + */ + UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl new file mode 100644 index 0000000000..175859d4dd --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl @@ -0,0 +1,49 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.SwitchUserMessageType; +import android.hardware.automotive.vehicle.SwitchUserStatus; + +/** + * Defines the result of a SwitchUserRequest. + * + * NOTE: this struct is not used in the HAL properties directly, it must be converted to + * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. + */ +// @VintfStability +parcelable SwitchUserResponse { + /** + * Id of the request being responded. + */ + int requestId; + /** + * Type of message. + */ + SwitchUserMessageType messageType; + /** + * Status of the request. + */ + SwitchUserStatus status; + /** + * HAL-specific error message. + * + * This argument is optional, and when defined, it's passed "as-is" to the caller. It could be + * used to show custom error messages to the end user. + */ + @utf8InCpp String errorMessage; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserStatus.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserStatus.aidl new file mode 100644 index 0000000000..11dc5f291d --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserStatus.aidl @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Status of the response to a SwitchUserRequest. + */ +// @VintfStability +@Backing(type="int") +enum SwitchUserStatus { + /** + * The request succeeded and the HAL user was switched. + */ + SUCCESS = 1, + /** + * The request failed and the HAL user remained the same. + */ + FAILURE = 2, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserFlags.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserFlags.aidl new file mode 100644 index 0000000000..8daa0c1c09 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserFlags.aidl @@ -0,0 +1,55 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Flags used to define the characteristics of an Android user. + */ +// @VintfStability +@Backing(type="int") +enum UserFlags { + /** + * No flags. + */ + NONE = 0x0, + /** + * System user. + * On automotive, that user is always running, although never on foreground (except during + * boot or exceptional circumstances). + */ + SYSTEM = 0x01, + /** + * Guest users have restrictions. + */ + GUEST = 0x02, + /** + * Ephemeral users have non-persistent state. + */ + EPHEMERAL = 0x04, + /** + * Admin users have additional privileges such as permission to create other users. + */ + ADMIN = 0x08, + /** + * Disabled users are marked for deletion. + */ + DISABLED = 0x10, + /** + * Profile user is a profile of another user. + */ + PROFILE = 0x20, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl new file mode 100644 index 0000000000..9531bb39ca --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.UserIdentificationAssociationType; +import android.hardware.automotive.vehicle.UserIdentificationAssociationValue; + +/** + * Helper struct used when getting a user/identification association type. + */ +// @VintfStability +parcelable UserIdentificationAssociation { + UserIdentificationAssociationType type = UserIdentificationAssociationType.INVALID; + UserIdentificationAssociationValue value = UserIdentificationAssociationValue.UNKNOWN; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl new file mode 100644 index 0000000000..5be7f99c8e --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to set a UserIdentificationAssociationType with an Android user. + */ +// @VintfStability +@Backing(type="int") +enum UserIdentificationAssociationSetValue { + INVALID = 0, + /** + * Associate the identification type with the current foreground Android user. + */ + ASSOCIATE_CURRENT_USER = 1, + /** + * Disassociate the identification type from the current foreground Android user. + */ + DISASSOCIATE_CURRENT_USER = 2, + /** + * Disassociate the identification type from all Android users. + */ + DISASSOCIATE_ALL_USERS = 3, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl new file mode 100644 index 0000000000..141aca883c --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationType.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Types of mechanisms used to identify an Android user. + * + * See USER_IDENTIFICATION_ASSOCIATION for more details and example. + */ +// @VintfStability +@Backing(type="int") +enum UserIdentificationAssociationType { + INVALID = 0, + /** + * Key used to unlock the car. + */ + KEY_FOB = 1, + /** + * Custom mechanism defined by the OEM. + */ + CUSTOM_1 = 101, + /** + * Custom mechanism defined by the OEM. + */ + CUSTOM_2 = 102, + /** + * Custom mechanism defined by the OEM. + */ + CUSTOM_3 = 103, + /** + * Custom mechanism defined by the OEM. + */ + CUSTOM_4 = 104, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl new file mode 100644 index 0000000000..c11ad2a41e --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Whether a UserIdentificationAssociationType is associate with an Android user. + */ +// @VintfStability +@Backing(type="int") +enum UserIdentificationAssociationValue { + /** + * Used when the status of an association could not be determined. + * + * For example, in a set() request, it would indicate a failure to set the given type. + */ + UNKNOWN = 1, + /** + * The identification type is associated with the current foreground Android user. + */ + ASSOCIATED_CURRENT_USER = 2, + /** + * The identification type is associated with another Android user. + */ + ASSOCIATED_ANOTHER_USER = 3, + /** + * The identification type is not associated with any Android user. + */ + NOT_ASSOCIATED_ANY_USER = 4, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl new file mode 100644 index 0000000000..cb4b8cf60e --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.UserIdentificationAssociationType; +import android.hardware.automotive.vehicle.UserInfo; + +/** + * Defines the format of a get() call to USER_IDENTIFICATION_ASSOCIATION. + * + * NOTE: this struct is not used in the HAL properties directly, it must be converted to + * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. + */ +// @VintfStability +parcelable UserIdentificationGetRequest { + /** + * Id of the request being responded. + */ + int requestId; + /** + * Information about the current foreground Android user. + */ + UserInfo userInfo; + /** + * Number of association being queried. + */ + int numberAssociationTypes; + /** + * Types of association being queried. + */ + UserIdentificationAssociationType[] associationTypes; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl new file mode 100644 index 0000000000..e8eb3a36c2 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.UserIdentificationAssociation; + +/** + * Defines the result of a USER_IDENTIFICATION_ASSOCIATION - both for get() and set(). + * + * NOTE: this struct is not used in the HAL properties directly, it must be converted to + * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. + */ +// @VintfStability +parcelable UserIdentificationResponse { + /** + * Id of the request being responded. + */ + int requestId; + /** + * Number of associations being returned. + */ + int numberAssociation; + /** + * Values associated with the user. + */ + UserIdentificationAssociation[] associations; + /** + * HAL-specific error message. + * + * This argument is optional, and when defined, it's passed "as-is" to the caller. It could be + * used to show custom error messages to the end user. + */ + @utf8InCpp String errorMessage; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl new file mode 100644 index 0000000000..392ae995aa --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.UserIdentificationAssociationSetValue; +import android.hardware.automotive.vehicle.UserIdentificationAssociationType; + +/** + * Helper struct used when setting a user/identification association type. + */ +// @VintfStability +parcelable UserIdentificationSetAssociation { + UserIdentificationAssociationType type = UserIdentificationAssociationType.INVALID; + UserIdentificationAssociationSetValue value = UserIdentificationAssociationSetValue.INVALID; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl new file mode 100644 index 0000000000..dafb1d1436 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.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. + */ +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.UserIdentificationSetAssociation; +import android.hardware.automotive.vehicle.UserInfo; + +/** + * Defines the format of a set() call to USER_IDENTIFICATION_ASSOCIATION. + * + * NOTE: this struct is not used in the HAL properties directly, it must be converted to + * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. + */ +// @VintfStability +parcelable UserIdentificationSetRequest { + /** + * Id of the request being responded. + */ + int requestId; + /** + * Information about the current foreground Android user. + */ + UserInfo userInfo; + /** + * Number of association being set. + */ + int numberAssociations; + /** + * Associations being set. + */ + UserIdentificationSetAssociation[] associations; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl new file mode 100644 index 0000000000..0a84308c75 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.UserFlags; + +/** + * Information about a specific Android user. + */ +// @VintfStability +parcelable UserInfo { + int userId = 0; + UserFlags flags = UserFlags.NONE; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl new file mode 100644 index 0000000000..28b3f95679 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.UserInfo; + +/** + * Information about all Android users. + * + * NOTE: this struct is not used in the HAL properties directly, it's part of other structs, which + * in turn are converted to a VehiclePropValue.RawValue through libraries provided by the default + * Vehicle HAL implementation. + */ +// @VintfStability +parcelable UsersInfo { + /** + * The current foreground user. + */ + UserInfo currentUser; + /** + * Number of existing users; includes the current user, recently removed users (with DISABLED + * flag), and profile users (with PROFILE flag). + */ + int numberUsers; + /** + * List of existing users; includes the current user, recently removed users (with DISABLED + * flag), and profile users (with PROFILE flag). + */ + UserInfo[] existingUsers; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl new file mode 100644 index 0000000000..9e593c5f26 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum VehicleApPowerStateConfigFlag { + /** + * AP can enter deep sleep state. If not set, AP will always shutdown from + * VehicleApPowerState#SHUTDOWN_PREPARE power state. + */ + ENABLE_DEEP_SLEEP_FLAG = 0x1, + /** + * The power controller can power on AP from off state after timeout + * specified in VehicleApPowerSet VEHICLE_AP_POWER_SET_SHUTDOWN_READY message. + */ + CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 0x2, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl new file mode 100644 index 0000000000..b6cc70d34d --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl @@ -0,0 +1,92 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum VehicleApPowerStateReport { + /** + * The device has booted. CarService has initialized and is ready to accept commands + * from VHAL. The user is not logged in, and vendor apps and services are expected to + * control the display and audio. + * After reporting this state, AP will accept VehicleApPowerStateReq#ON or + * VehicleApPowerStateReq#SHUTDOWN_PREPARE. Other power state requests are ignored. + */ + WAIT_FOR_VHAL = 0x1, + /** + * AP is ready to suspend. + * The AP will not send any more state reports after this. + * After reporting this state, AP will accept VehicleApPowerStateReq#FINISHED. + * Other power state requests are ignored. + * + * int32Values[1]: Time to turn AP back on, in seconds. Power controller should turn on + * AP after the specified time has elapsed, so AP can run tasks like + * update. If this value is 0, no wake up is requested. The power + * controller may not necessarily support timed wake-up. + */ + DEEP_SLEEP_ENTRY = 0x2, + /** + * AP is exiting from deep sleep state. + * After reporting this state, AP will accept VehicleApPowerStateReq#ON or + * VehicleApPowerStateReq#SHUTDOWN_PREPARE. Other power state requests are ignored. + */ + DEEP_SLEEP_EXIT = 0x3, + /** + * AP sends this message repeatedly while cleanup and idle tasks execute. + * After reporting this state, AP will accept VehicleApPowerStateReq#SHUTDOWN_PREPARE + * requesting immediate shutdown or VehicleApPowerStateReq#CANCEL_SHUTDOWN. Other + * power state requests are ignored. + * + * int32Values[1]: Time to postpone shutdown in ms. Maximum value is + * 5000 ms. + * If AP needs more time, it will send another SHUTDOWN_POSTPONE + * message before the previous one expires. + */ + SHUTDOWN_POSTPONE = 0x4, + /** + * AP is ready to shutdown. + * The AP will not send any more state reports after this. + * After reporting this state, AP will accept VehicleApPowerStateReq#FINISHED. + * Other power state requests are ignored. + * + * int32Values[1]: Time to turn AP back on, in seconds. Power controller should turn on + * AP after the specified time has elapsed so AP can run tasks like + * update. If this value is 0, no wake up is specified. The power + * controller may not necessarily support timed wake-up. + */ + SHUTDOWN_START = 0x5, + /** + * AP is entering its normal operating state. + * After reporting this state, AP will accept VehicleApPowerStateReq#SHUTDOWN_PREPARE. + * Other power state requests are ignored. + */ + ON = 0x6, + /** + * AP is preparing to shut down. In this state, Garage Mode is active and idle + * tasks are allowed to run. + * After reporting this state, AP will accept VehicleApPowerStateReq#SHUTDOWN_PREPARE + * requesting immediate shutdown or VehicleApPowerStateReq#CANCEL_SHUTDOWN. Other + * power state requests are ignored. + */ + SHUTDOWN_PREPARE = 0x7, + /** + * AP has stopped preparing to shut down. + * After reporting this state, AP will accept VehicleApPowerStateReq#ON or + * VehicleApPowerStateReq#SHUTDOWN_PREPARE. Other power state requests are ignored. + */ + SHUTDOWN_CANCELLED = 0x8, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl new file mode 100644 index 0000000000..06bc073287 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl @@ -0,0 +1,66 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum VehicleApPowerStateReq { + /** + * This requests Android to enter its normal operating state. + * This may be sent after the AP has reported + * VehicleApPowerStateReport#DEEP_SLEEP_EXIT, + * VehicleApPowerStateReport#SHUTDOWN_CANCELLED, or + * VehicleApPowerStateReport#WAIT_FOR_VHAL. + */ + ON = 0, + /** + * The power controller issues this request to shutdown the system. + * This may be sent after the AP has reported + * VehicleApPowerStateReport#DEEP_SLEEP_EXIT, + * VehicleApPowerStateReport#ON, + * VehicleApPowerStateReport#SHUTDOWN_CANCELLED, + * VehicleApPowerStateReport#SHUTDOWN_POSTPONE, + * VehicleApPowerStateReport#SHUTDOWN_PREPARE, or + * VehicleApPowerStateReport#WAIT_FOR_VHAL. + * + * int32Values[1] : One of VehicleApPowerStateShutdownParam. + * This parameter indicates if the AP should shut + * down fully or sleep. This parameter also + * indicates if the shutdown should be immediate + * or if it can be postponed. If the shutdown can + * be postponed, AP requests postponing by sending + * VehicleApPowerStateReport#SHUTDOWN_POSTPONE. + */ + SHUTDOWN_PREPARE = 1, + /** + * Cancel the shutdown. + * This may be sent after the AP has reported + * VehicleApPowerStateReport#SHUTDOWN_POSTPONE or + * VehicleApPowerStateReport#SHUTDOWN_PREPARE. + * After receiving this request, the AP will report + * VehicleApPowerStateReport#WAIT_FOR_VHAL in preparation to going ON. + */ + CANCEL_SHUTDOWN = 2, + /** + * Completes the shutdown process. + * This may be sent after the AP has reported + * VehicleApPowerStateReport#DEEP_SLEEP_ENTRY or + * VehicleApPowerStateReport#SHUTDOWN_START. The AP will not report new + * state information after receiving this request. + */ + FINISHED = 3, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl new file mode 100644 index 0000000000..a3d6c7f812 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Index in int32Values for VehicleProperty#AP_POWER_STATE_REQ property. + */ +// @VintfStability +@Backing(type="int") +enum VehicleApPowerStateReqIndex { + STATE = 0, + ADDITIONAL = 1, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl new file mode 100644 index 0000000000..f4ab08052d --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum VehicleApPowerStateShutdownParam { + /** + * AP must shutdown immediately. Postponing is not allowed. + */ + SHUTDOWN_IMMEDIATELY = 1, + /** + * AP can enter deep sleep instead of shutting down completely. + */ + CAN_SLEEP = 2, + /** + * AP can only shutdown with postponing allowed. + */ + SHUTDOWN_ONLY = 3, + /** + * AP may enter deep sleep, but must either sleep or shut down immediately. + * Postponing is not allowed. + */ + SLEEP_IMMEDIATELY = 4, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleArea.aidl new file mode 100644 index 0000000000..53b85ebdde --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleArea.aidl @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum VehicleArea { + GLOBAL = 0x01000000, + /** WINDOW maps to enum VehicleAreaWindow */ + WINDOW = 0x03000000, + /** MIRROR maps to enum VehicleAreaMirror */ + MIRROR = 0x04000000, + /** SEAT maps to enum VehicleAreaSeat */ + SEAT = 0x05000000, + /** DOOR maps to enum VehicleAreaDoor */ + DOOR = 0x06000000, + /** WHEEL maps to enum VehicleAreaWheel */ + WHEEL = 0x07000000, + + MASK = 0x0f000000, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl new file mode 100644 index 0000000000..0a688c0edc --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +parcelable VehicleAreaConfig { + /** + * Area id is ignored for VehiclePropertyGroup:GLOBAL properties. + */ + int areaId; + + /** + * If the property has @data_enum, leave the range to zero. + * + * Range will be ignored in the following cases: + * - The VehiclePropertyType is not INT32, INT64 or FLOAT. + * - Both of min value and max value are zero. + */ + + int minInt32Value; + int maxInt32Value; + + long minInt64Value; + long maxInt64Value; + + float minFloatValue; + float maxFloatValue; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl new file mode 100644 index 0000000000..c85b171c00 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum VehicleAreaDoor { + ROW_1_LEFT = 0x00000001, + ROW_1_RIGHT = 0x00000004, + ROW_2_LEFT = 0x00000010, + ROW_2_RIGHT = 0x00000040, + ROW_3_LEFT = 0x00000100, + ROW_3_RIGHT = 0x00000400, + HOOD = 0x10000000, + REAR = 0x20000000, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl new file mode 100644 index 0000000000..daecf0b612 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum VehicleAreaMirror { + DRIVER_LEFT = 0x00000001, + DRIVER_RIGHT = 0x00000002, + DRIVER_CENTER = 0x00000004, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl new file mode 100644 index 0000000000..9d16c8678c --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Various Seats in the car. + */ +// @VintfStability +@Backing(type="int") +enum VehicleAreaSeat { + ROW_1_LEFT = 0x0001, + ROW_1_CENTER = 0x0002, + ROW_1_RIGHT = 0x0004, + ROW_2_LEFT = 0x0010, + ROW_2_CENTER = 0x0020, + ROW_2_RIGHT = 0x0040, + ROW_3_LEFT = 0x0100, + ROW_3_CENTER = 0x0200, + ROW_3_RIGHT = 0x0400, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl new file mode 100644 index 0000000000..0e5b995531 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum VehicleAreaWheel { + UNKNOWN = 0x0, + LEFT_FRONT = 0x1, + RIGHT_FRONT = 0x2, + LEFT_REAR = 0x4, + RIGHT_REAR = 0x8, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl new file mode 100644 index 0000000000..bab0a3f802 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Various windshields/windows in the car. + */ +// @VintfStability +@Backing(type="int") +enum VehicleAreaWindow { + FRONT_WINDSHIELD = 0x00000001, + REAR_WINDSHIELD = 0x00000002, + ROW_1_LEFT = 0x00000010, + ROW_1_RIGHT = 0x00000040, + ROW_2_LEFT = 0x00000100, + ROW_2_RIGHT = 0x00000400, + ROW_3_LEFT = 0x00001000, + ROW_3_RIGHT = 0x00004000, + ROOF_TOP_1 = 0x00010000, + ROOF_TOP_2 = 0x00020000, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleDisplay.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleDisplay.aidl new file mode 100644 index 0000000000..a7531c4965 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleDisplay.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum VehicleDisplay { + /** + * The primary Android display (for example, center console) + */ + MAIN = 0, + INSTRUMENT_CLUSTER = 1, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleGear.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleGear.aidl new file mode 100644 index 0000000000..8b08ff8079 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleGear.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Various gears which can be selected by user and chosen in system. + */ +// @VintfStability +@Backing(type="int") +enum VehicleGear { + GEAR_UNKNOWN = 0x0000, + GEAR_NEUTRAL = 0x0001, + GEAR_REVERSE = 0x0002, + GEAR_PARK = 0x0004, + GEAR_DRIVE = 0x0008, + GEAR_1 = 0x0010, + GEAR_2 = 0x0020, + GEAR_3 = 0x0040, + GEAR_4 = 0x0080, + GEAR_5 = 0x0100, + GEAR_6 = 0x0200, + GEAR_7 = 0x0400, + GEAR_8 = 0x0800, + GEAR_9 = 0x1000, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl new file mode 100644 index 0000000000..19676790c6 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Bit flags for fan direction + */ +// @VintfStability +@Backing(type="int") +enum VehicleHvacFanDirection { + UNKNOWN = 0x0, + FACE = 0x1, + FLOOR = 0x2, + /** + * FACE_AND_FLOOR = FACE | FLOOR + */ + FACE_AND_FLOOR = 0x3, + DEFROST = 0x4, + /** + * DEFROST_AND_FLOOR = DEFROST | FLOOR + */ + DEFROST_AND_FLOOR = 0x06, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl new file mode 100644 index 0000000000..2dfd070eaa --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum VehicleHwKeyInputAction { + /** + * Key down + */ + ACTION_DOWN = 0, + /** + * Key up + */ + ACTION_UP = 1, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl new file mode 100644 index 0000000000..cf9db976b8 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleIgnitionState.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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum VehicleIgnitionState { + UNDEFINED = 0, + /** + * Steering wheel is locked + */ + LOCK = 1, + /** + * Steering wheel is not locked, engine and all accessories are OFF. If + * car can be in LOCK and OFF state at the same time than HAL must report + * LOCK state. + */ + OFF, + /** + * Typically in this state accessories become available (e.g. radio). + * Instrument cluster and engine are turned off + */ + ACC, + /** + * Ignition is in state ON. Accessories and instrument cluster available, + * engine might be running or ready to be started. + */ + ON, + /** + * Typically in this state engine is starting (cranking). + */ + START, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightState.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightState.aidl new file mode 100644 index 0000000000..bfe9163dc7 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightState.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by lights state properties to enumerate the current state of the lights. + * + * Most XXX_LIGHTS_STATE properties will only report ON and OFF states. Only + * the HEADLIGHTS_STATE property will report DAYTIME_RUNNING. + */ +// @VintfStability +@Backing(type="int") +enum VehicleLightState { + OFF = 0, + ON = 1, + DAYTIME_RUNNING = 2, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl new file mode 100644 index 0000000000..061f85d714 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightSwitch.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by lights switch properties to enumerate user selected switch setting. + * + * XXX_LIGHTS_SWITCH properties report the switch settings that the user + * selects. The switch setting may be decoupled from the state reported if the + * user selects AUTOMATIC. + */ +// @VintfStability +@Backing(type="int") +enum VehicleLightSwitch { + OFF = 0, + ON = 1, + /** + * Daytime running lights mode. Most cars automatically use DRL but some + * cars allow the user to activate them manually. + */ + DAYTIME_RUNNING = 2, + /** + * Allows the vehicle ECU to set the lights automatically + */ + AUTOMATIC = 0x100, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleOilLevel.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleOilLevel.aidl new file mode 100644 index 0000000000..8ea629321b --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleOilLevel.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum VehicleOilLevel { + /** + * Oil level values + */ + CRITICALLY_LOW = 0, + LOW = 1, + NORMAL = 2, + HIGH = 3, + ERROR = 4, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl new file mode 100644 index 0000000000..3b4e10a1ff --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VehicleAreaConfig; +import android.hardware.automotive.vehicle.VehiclePropertyAccess; +import android.hardware.automotive.vehicle.VehiclePropertyChangeMode; + +// @VintfStability +parcelable VehiclePropConfig { + /** Property identifier */ + int prop; + + /** + * Defines if the property is read or write or both. + */ + VehiclePropertyAccess access = VehiclePropertyAccess.NONE; + + /** + * Defines the change mode of the property. + */ + VehiclePropertyChangeMode changeMode = VehiclePropertyChangeMode.STATIC; + + /** + * Contains per-area configuration. + */ + VehicleAreaConfig[] areaConfigs; + + /** Contains additional configuration parameters */ + int[] configArray; + + /** + * Some properties may require additional information passed over this + * string. Most properties do not need to set this. + */ + @utf8InCpp String configString; + + /** + * Min sample rate in Hz. + * Must be defined for VehiclePropertyChangeMode::CONTINUOUS + */ + float minSampleRate; + + /** + * Must be defined for VehiclePropertyChangeMode::CONTINUOUS + * Max sample rate in Hz. + */ + float maxSampleRate; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl new file mode 100644 index 0000000000..4d403f93be --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VehiclePropertyStatus; + +/** + * Encapsulates the property name and the associated value. It + * is used across various API calls to set values, get values or to register for + * events. + */ +// @VintfStability +parcelable VehiclePropValue { + /** Time is elapsed nanoseconds since boot */ + long timestamp; + + /** + * Area type(s) for non-global property it must be one of the value from + * VehicleArea* enums or 0 for global properties. + */ + int areaId; + + /** Property identifier */ + int prop; + + /** Status of the property */ + VehiclePropertyStatus status; + + /** + * This is used for properties of types VehiclePropertyType#INT + * and VehiclePropertyType#INT_VEC + */ + int[] int32Values; + + /** + * This is used for properties of types VehiclePropertyType#FLOAT + * and VehiclePropertyType#FLOAT_VEC + */ + float[] floatValues; + + /** This is used for properties of type VehiclePropertyType#INT64 */ + long[] int64Values; + + /** This is used for properties of type VehiclePropertyType#BYTES */ + byte[] byteValues; + + /** This is used for properties of type VehiclePropertyType#STRING */ + @utf8InCpp String stringValue; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValueRawValue.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValueRawValue.aidl new file mode 100644 index 0000000000..325b7f0efa --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValueRawValue.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Contains value for a single property. Depending on property data type of + * this property (VehiclePropetyType) one field of this structure must be filled in. + */ +// @VintfStability +parcelable VehiclePropValueRawValue { + /** + * This is used for properties of types VehiclePropertyType#INT + * and VehiclePropertyType#INT_VEC + */ + int[] int32Values; + /** + * This is used for properties of types VehiclePropertyType#FLOAT + * and VehiclePropertyType#FLOAT_VEC + */ + float[] floatValues; + /** + * This is used for properties of type VehiclePropertyType#INT64 + */ + long[] int64Values; + /** + * This is used for properties of type VehiclePropertyType#BYTES + */ + byte[] bytes; + /** + * This is used for properties of type VehiclePropertyType#STRING + */ + @utf8InCpp String stringValue; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl new file mode 100644 index 0000000000..a3a4b3d62f --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -0,0 +1,2587 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VehiclePropertyType; +/** + * Declares all vehicle properties. VehicleProperty has a bitwise structure. + * Each property must have: + * - a unique id from range 0x0100 - 0xffff + * - associated data type using VehiclePropertyType + * - property group (VehiclePropertyGroup) + * - vehicle area (VehicleArea) + * + * Vendors are allowed to extend this enum with their own properties. In this + * case they must use VehiclePropertyGroup:VENDOR flag when the property is + * declared. + * + * When a property's status field is not set to AVAILABLE: + * - IVehicle#set may return StatusCode::NOT_AVAILABLE. + * - IVehicle#get is not guaranteed to work. + * + * Properties set to values out of range must be ignored and no action taken + * in response to such ill formed requests. + */ +// @VintfStability +@Backing(type="int") +enum VehicleProperty { + /** + * Undefined property. + */ + INVALID = 0x00000000, + /** + * VIN of vehicle + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + */ + INFO_VIN = 0x0100 + 0x10000000 + 0x01000000 + + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING + /** + * Manufacturer of vehicle + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + */ + INFO_MAKE = 0x0101 + 0x10000000 + 0x01000000 + + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING + /** + * Model of vehicle + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + */ + INFO_MODEL = 0x0102 + 0x10000000 + 0x01000000 + + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING + /** + * Model year of vehicle. + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:YEAR + */ + INFO_MODEL_YEAR = 0x0103 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Fuel capacity of the vehicle in milliliters + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:MILLILITER + */ + INFO_FUEL_CAPACITY = 0x0104 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * List of fuels the vehicle may use + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @data_enum FuelType + */ + INFO_FUEL_TYPE = 0x0105 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Battery capacity of the vehicle, if EV or hybrid. This is the nominal + * battery capacity when the vehicle is new. + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:WH + */ + INFO_EV_BATTERY_CAPACITY = 0x0106 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * List of connectors this EV may use + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @data_enum EvConnectorType + * @access VehiclePropertyAccess:READ + */ + INFO_EV_CONNECTOR_TYPE = 0x0107 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Fuel door location + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @data_enum PortLocationType + * @access VehiclePropertyAccess:READ + */ + INFO_FUEL_DOOR_LOCATION = 0x0108 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * EV port location + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @data_enum PortLocationType + */ + INFO_EV_PORT_LOCATION = 0x0109 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Driver's seat location + * VHAL implementations must ignore the areaId. Use VehicleArea:GLOBAL. + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @data_enum VehicleAreaSeat + * @access VehiclePropertyAccess:READ + */ + INFO_DRIVER_SEAT = 0x010A + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Exterior dimensions of vehicle. + * + * int32Values[0] = height + * int32Values[1] = length + * int32Values[2] = width + * int32Values[3] = width including mirrors + * int32Values[4] = wheel base + * int32Values[5] = track width front + * int32Values[6] = track width rear + * int32Values[7] = curb to curb turning radius + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:MILLIMETER + */ + INFO_EXTERIOR_DIMENSIONS = 0x010B + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Multiple EV port locations + * + * Implement this property if the vehicle has multiple EV ports. + * Port locations are defined in PortLocationType. + * For example, a car has one port in front left and one port in rear left: + * int32Values[0] = PortLocationType::FRONT_LEFT + * int32Values[0] = PortLocationType::REAR_LEFT + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @data_enum PortLocationType + */ + INFO_MULTI_EV_PORT_LOCATIONS = 0x010C + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Current odometer value of the vehicle + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:KILOMETER + */ + PERF_ODOMETER = 0x0204 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Speed of the vehicle + * + * The value must be positive when the vehicle is moving forward and negative when + * the vehicle is moving backward. This value is independent of gear value + * (CURRENT_GEAR or GEAR_SELECTION), for example, if GEAR_SELECTION is GEAR_NEUTRAL, + * PERF_VEHICLE_SPEED is positive when the vehicle is moving forward, negative when moving + * backward, and zero when not moving. + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:METER_PER_SEC + */ + PERF_VEHICLE_SPEED = 0x0207 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Speed of the vehicle for displays + * + * Some cars display a slightly slower speed than the actual speed. This is + * usually displayed on the speedometer. + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:METER_PER_SEC + */ + PERF_VEHICLE_SPEED_DISPLAY = 0x0208 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Front bicycle model steering angle for vehicle + * + * Angle is in degrees. Left is negative. + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:DEGREES + */ + PERF_STEERING_ANGLE = 0x0209 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Rear bicycle model steering angle for vehicle + * + * Angle is in degrees. Left is negative. + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:DEGREES + */ + PERF_REAR_STEERING_ANGLE = 0x0210 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Temperature of engine coolant + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:CELSIUS + */ + ENGINE_COOLANT_TEMP = 0x0301 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Engine oil level + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleOilLevel + */ + ENGINE_OIL_LEVEL = 0x0303 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Temperature of engine oil + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:CELSIUS + */ + ENGINE_OIL_TEMP = 0x0304 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Engine rpm + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:RPM + */ + ENGINE_RPM = 0x0305 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Reports wheel ticks + * + * The first element in the vector is a reset count. A reset indicates + * previous tick counts are not comparable with this and future ones. Some + * sort of discontinuity in tick counting has occurred. + * + * The next four elements represent ticks for individual wheels in the + * following order: front left, front right, rear right, rear left. All + * tick counts are cumulative. Tick counts increment when the vehicle + * moves forward, and decrement when vehicles moves in reverse. The ticks + * should be reset to 0 when the vehicle is started by the user. + * + * int64Values[0] = reset count + * int64Values[1] = front left ticks + * int64Values[2] = front right ticks + * int64Values[3] = rear right ticks + * int64Values[4] = rear left ticks + * + * configArray is used to indicate the micrometers-per-wheel-tick value and + * which wheels are supported. configArray is set as follows: + * + * configArray[0], bits [0:3] = supported wheels. Uses enum Wheel. + * configArray[1] = micrometers per front left wheel tick + * configArray[2] = micrometers per front right wheel tick + * configArray[3] = micrometers per rear right wheel tick + * configArray[4] = micrometers per rear left wheel tick + * + * NOTE: If a wheel is not supported, its value shall always be set to 0. + * + * VehiclePropValue.timestamp must be correctly filled in. + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + */ + WHEEL_TICK = 0x0306 + 0x10000000 + 0x01000000 + + 0x00510000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64_VEC + /** + * Fuel remaining in the vehicle, in milliliters + * + * Value may not exceed INFO_FUEL_CAPACITY + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:MILLILITER + */ + FUEL_LEVEL = 0x0307 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Fuel door open + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + FUEL_DOOR_OPEN = 0x0308 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * EV battery level in WH, if EV or hybrid + * + * Value may not exceed INFO_EV_BATTERY_CAPACITY + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:WH + */ + EV_BATTERY_LEVEL = 0x0309 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * EV charge port open + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + EV_CHARGE_PORT_OPEN = 0x030A + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * EV charge port connected + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + EV_CHARGE_PORT_CONNECTED = 0x030B + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * EV instantaneous charge rate in milliwatts + * + * Positive value indicates battery is being charged. + * Negative value indicates battery being discharged. + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:MW + */ + EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = 0x030C + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Range remaining + * + * Meters remaining of fuel and charge. Range remaining shall account for + * all energy sources in a vehicle. For example, a hybrid car's range will + * be the sum of the ranges based on fuel and battery. + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ_WRITE + * @unit VehicleUnit:METER + */ + RANGE_REMAINING = 0x0308 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Tire pressure + * + * Each tires is identified by its areaConfig.areaId config and their + * minFloatValue/maxFloatValue are used to store OEM recommended pressure + * range. + * The Min value in the areaConfig data represents the lower bound of + * the recommended tire pressure. + * The Max value in the areaConfig data represents the upper bound of + * the recommended tire pressure. + * For example: + * The following areaConfig indicates the recommended tire pressure + * of left_front tire is from 200.0 KILOPASCAL to 240.0 KILOPASCAL. + * .areaConfigs = { + * VehicleAreaConfig { + * .areaId = VehicleAreaWheel::LEFT_FRONT, + * .minFloatValue = 200.0, + * .maxFloatValue = 240.0, + * } + * }, + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:KILOPASCAL + */ + TIRE_PRESSURE = 0x0309 + 0x10000000 + 0x07000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WHEEL,VehiclePropertyType:FLOAT + /** + * Critically low tire pressure + * + * This property indicates the critically low pressure threshold for each tire. + * It indicates when it is time for tires to be replaced or fixed. The value + * must be less than or equal to minFloatValue in TIRE_PRESSURE. + * Minimum and maximum property values (that is, minFloatValue, maxFloatValue) + * are not applicable to this property. + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:KILOPASCAL + */ + CRITICALLY_LOW_TIRE_PRESSURE = 0x030A + 0x10000000 + 0x07000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WHEEL,VehiclePropertyType:FLOAT + /** + * Currently selected gear + * + * This is the gear selected by the user. + * + * Values in the config data must represent the list of supported gears + * for this vehicle. For example, config data for an automatic transmission + * must contain {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_PARK, GEAR_DRIVE, + * GEAR_1, GEAR_2,...} and for manual transmission the list must be + * {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...} + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleGear + */ + GEAR_SELECTION = 0x0400 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Current gear. In non-manual case, selected gear may not + * match the current gear. For example, if the selected gear is GEAR_DRIVE, + * the current gear will be one of GEAR_1, GEAR_2 etc, which reflects + * the actual gear the transmission is currently running in. + * + * Values in the config data must represent the list of supported gears + * for this vehicle. For example, config data for an automatic transmission + * must contain {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_PARK, GEAR_1, GEAR_2,...} + * and for manual transmission the list must be + * {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...}. This list need not be the + * same as that of the supported gears reported in GEAR_SELECTION. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleGear + */ + CURRENT_GEAR = 0x0401 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Parking brake state. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + PARKING_BRAKE_ON = 0x0402 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Auto-apply parking brake. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + PARKING_BRAKE_AUTO_APPLY = 0x0403 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Warning for fuel low level. + * + * This property corresponds to the low fuel warning on the dashboard. + * Once FUEL_LEVEL_LOW is set, it should not be cleared until more fuel is + * added to the vehicle. This property may take into account all fuel + * sources for a vehicle - for example: + * + * For a gas powered vehicle, this property is based soley on gas level. + * For a battery powered vehicle, this property is based solely on battery level. + * For a hybrid vehicle, this property may be based on the combination of gas and battery + * levels, at the OEM's discretion. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + FUEL_LEVEL_LOW = 0x0405 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Night mode + * + * True indicates that the night mode sensor has detected that the car cabin environment has + * low light. The platform could use this, for example, to enable appropriate UI for + * better viewing in dark or low light environments. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + NIGHT_MODE = 0x0407 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * State of the vehicles turn signals + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleTurnSignal + */ + TURN_SIGNAL_STATE = 0x0408 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Represents ignition state + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleIgnitionState + */ + IGNITION_STATE = 0x0409 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * ABS is active + * + * Set to true when ABS is active. Reset to false when ABS is off. This + * property may be intermittently set (pulsing) based on the real-time + * state of the ABS system. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + ABS_ACTIVE = 0x040A + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Traction Control is active + * + * Set to true when traction control (TC) is active. Reset to false when + * TC is off. This property may be intermittently set (pulsing) based on + * the real-time state of the TC system. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + TRACTION_CONTROL_ACTIVE = 0x040B + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /* + * HVAC Properties + * + * Additional rules for mapping a zoned HVAC property (except + * HVAC_MAX_DEFROST_ON) to AreaIDs: + * - Every seat in VehicleAreaSeat that is available in the car, must be + * part of an AreaID in the AreaID array. + * + * Example 1: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three + * back seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). There are two + * temperature control units -- driver side and passenger side. + * - A valid mapping set of AreaIDs for HVAC_TEMPERATURE_SET would be a + * two element array: + * - ROW_1_LEFT | ROW_2_LEFT + * - ROW_1_RIGHT | ROW_2_CENTER | ROW_2_RIGHT + * - An alternative mapping for the same hardware configuration would be: + * - ROW_1_LEFT | ROW_2_CENTER | ROW_2_LEFT + * - ROW_1_RIGHT | ROW_2_RIGHT + * The temperature controllers are assigned to the seats which they + * "most influence", but every seat must be included exactly once. The + * assignment of the center rear seat to the left or right AreaID may seem + * arbitrary, but the inclusion of every seat in exactly one AreaID ensures + * that the seats in the car are all expressed and that a "reasonable" way + * to affect each seat is available. + * + * Example 2: A car has three seat rows with two seats in the front row (ROW_1_LEFT, + * ROW_1_RIGHT) and three seats in the second (ROW_2_LEFT, ROW_2_CENTER, + * ROW_2_RIGHT) and third rows (ROW_3_LEFT, ROW_3_CENTER, ROW_3_RIGHT). There + * are three temperature control units -- driver side, passenger side, and rear. + * - A reasonable way to map HVAC_TEMPERATURE_SET to AreaIDs is a three + * element array: + * - ROW_1_LEFT + * - ROW_1_RIGHT + * - ROW_2_LEFT | ROW_2_CENTER | ROW_2_RIGHT | ROW_3_LEFT | ROW_3_CENTER | ROW_3_RIGHT + * + * + * Fan speed setting + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_FAN_SPEED = 0x0500 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Fan direction setting + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleHvacFanDirection + */ + HVAC_FAN_DIRECTION = 0x0501 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * HVAC current temperature. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:CELSIUS + */ + HVAC_TEMPERATURE_CURRENT = 0x0502 + 0x10000000 + 0x05000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:FLOAT + /** + * HVAC, target temperature set. + * + * The configArray is used to indicate the valid values for HVAC in Fahrenheit and Celsius. + * Android might use it in the HVAC app UI. + * The configArray is set as follows: + * configArray[0] = [the lower bound of the supported temperature in Celsius] * 10. + * configArray[1] = [the upper bound of the supported temperature in Celsius] * 10. + * configArray[2] = [the increment in Celsius] * 10. + * configArray[3] = [the lower bound of the supported temperature in Fahrenheit] * 10. + * configArray[4] = [the upper bound of the supported temperature in Fahrenheit] * 10. + * configArray[5] = [the increment in Fahrenheit] * 10. + * For example, if the vehicle supports temperature values as: + * [16.0, 16.5, 17.0 ,..., 28.0] in Celsius + * [60.5, 61.5, 62.5 ,..., 85.5] in Fahrenheit. + * The configArray should be configArray = {160, 280, 5, 605, 825, 10}. + * + * If the vehicle supports HVAC_TEMPERATURE_VALUE_SUGGESTION, the application can use + * that property to get the suggested value before setting HVAC_TEMPERATURE_SET. Otherwise, + * the application may choose the value in HVAC_TEMPERATURE_SET configArray by itself. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @unit VehicleUnit:CELSIUS + */ + HVAC_TEMPERATURE_SET = 0x0503 + 0x10000000 + 0x05000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:FLOAT + /** + * Fan-based defrost for designated window. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_DEFROSTER = 0x0504 + 0x10000000 + 0x03000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN + /** + * On/off AC for designated areaId + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @config_flags Supported areaIds + */ + HVAC_AC_ON = 0x0505 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * On/off max AC + * + * When MAX AC is on, the ECU may adjust the vent position, fan speed, + * temperature, etc as necessary to cool the vehicle as quickly as possible. + * Any parameters modified as a side effect of turning on/off the MAX AC + * parameter shall generate onPropertyEvent() callbacks to the VHAL. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_MAX_AC_ON = 0x0506 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * On/off max defrost + * + * When MAX DEFROST is on, the ECU may adjust the vent position, fan speed, + * temperature, etc as necessary to defrost the windows as quickly as + * possible. Any parameters modified as a side effect of turning on/off + * the MAX DEFROST parameter shall generate onPropertyEvent() callbacks to + * the VHAL. + * The AreaIDs for HVAC_MAX_DEFROST_ON indicate MAX DEFROST can be controlled + * in the area. + * For example: + * areaConfig.areaId = {ROW_1_LEFT | ROW_1_RIGHT} indicates HVAC_MAX_DEFROST_ON + * only can be controlled for the front rows. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_MAX_DEFROST_ON = 0x0507 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * Recirculation on/off + * + * Controls the supply of exterior air to the cabin. Recirc “on” means the + * majority of the airflow into the cabin is originating in the cabin. + * Recirc “off” means the majority of the airflow into the cabin is coming + * from outside the car. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_RECIRC_ON = 0x0508 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * Enable temperature coupling between areas. + * + * The AreaIDs for HVAC_DUAL_ON property shall contain a combination of + * HVAC_TEMPERATURE_SET AreaIDs that can be coupled together. If + * HVAC_TEMPERATURE_SET is mapped to AreaIDs [a_1, a_2, ..., a_n], and if + * HVAC_DUAL_ON can be enabled to couple a_i and a_j, then HVAC_DUAL_ON + * property must be mapped to [a_i | a_j]. Further, if a_k and a_l can also + * be coupled together separately then HVAC_DUAL_ON must be mapped to + * [a_i | a_j, a_k | a_l]. + * + * Example: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three + * back seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). There are two + * temperature control units -- driver side and passenger side -- which can + * be optionally synchronized. This may be expressed in the AreaIDs this way: + * - HVAC_TEMPERATURE_SET->[ROW_1_LEFT | ROW_2_LEFT, ROW_1_RIGHT | ROW_2_CENTER | ROW_2_RIGHT] + * - HVAC_DUAL_ON->[ROW_1_LEFT | ROW_2_LEFT | ROW_1_RIGHT | ROW_2_CENTER | ROW_2_RIGHT] + * + * When the property is enabled, the ECU must synchronize the temperature + * for the affected areas. Any parameters modified as a side effect + * of turning on/off the DUAL_ON parameter shall generate + * onPropertyEvent() callbacks to the VHAL. In addition, if setting + * a temperature (i.e. driver's temperature) changes another temperature + * (i.e. front passenger's temperature), then the appropriate + * onPropertyEvent() callbacks must be generated. If a user changes a + * temperature that breaks the coupling (e.g. setting the passenger + * temperature independently) then the VHAL must send the appropriate + * onPropertyEvent() callbacks (i.e. HVAC_DUAL_ON = false, + * HVAC_TEMPERATURE_SET[AreaID] = xxx, etc). + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_DUAL_ON = 0x0509 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * On/off automatic mode + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_AUTO_ON = 0x050A + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * Seat heating/cooling + * + * Negative values indicate cooling. + * 0 indicates off. + * Positive values indicate heating. + * + * Some vehicles may have multiple levels of heating and cooling. The + * min/max range defines the allowable range and number of steps in each + * direction. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_SEAT_TEMPERATURE = 0x050B + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Side Mirror Heat + * + * Increasing values denote higher heating levels for side mirrors. + * The Max value in the config data represents the highest heating level. + * The Min value in the config data MUST be zero and indicates no heating. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_SIDE_MIRROR_HEAT = 0x050C + 0x10000000 + 0x04000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 + /** + * Steering Wheel Heating/Cooling + * + * Sets the amount of heating/cooling for the steering wheel + * config data Min and Max MUST be set appropriately. + * Positive value indicates heating. + * Negative value indicates cooling. + * 0 indicates temperature control is off. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_STEERING_WHEEL_HEAT = 0x050D + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Temperature units for display + * + * Indicates whether the vehicle is displaying temperature to the user as + * Celsius or Fahrenheit. + * VehiclePropConfig.configArray is used to indicate the supported temperature display units. + * For example: configArray[0] = CELSIUS + * configArray[1] = FAHRENHEIT + * + * This parameter MAY be used for displaying any HVAC temperature in the system. + * Values must be one of VehicleUnit::CELSIUS or VehicleUnit::FAHRENHEIT + * Note that internally, all temperatures are represented in floating point Celsius. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleUnit + */ + HVAC_TEMPERATURE_DISPLAY_UNITS = 0x050E + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Actual fan speed + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + HVAC_ACTUAL_FAN_SPEED_RPM = 0x050F + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Represents global power state for HVAC. Setting this property to false + * MAY mark some properties that control individual HVAC features/subsystems + * to UNAVAILABLE state. Setting this property to true MAY mark some + * properties that control individual HVAC features/subsystems to AVAILABLE + * state (unless any/all of them are UNAVAILABLE on their own individual + * merits). + * + * [Definition] HvacPower_DependentProperties: Properties that need HVAC to be + * powered on in order to enable their functionality. For example, in some cars, + * in order to turn on the AC, HVAC must be powered on first. + * + * HvacPower_DependentProperties list must be set in the + * VehiclePropConfig.configArray. HvacPower_DependentProperties must only contain + * properties that are associated with VehicleArea:SEAT. Properties that are not + * associated with VehicleArea:SEAT, for example, HVAC_DEFROSTER, must never + * depend on HVAC_POWER_ON property and must never be part of + * HvacPower_DependentProperties list. + * + * AreaID mapping for HVAC_POWER_ON property must contain all AreaIDs that + * HvacPower_DependentProperties are mapped to. + * + * Example 1: A car has two front seats (ROW_1_LEFT, ROW_1_RIGHT) and three back + * seats (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT). If the HVAC features (AC, + * Temperature etc.) throughout the car are dependent on a single HVAC power + * controller then HVAC_POWER_ON must be mapped to + * [ROW_1_LEFT | ROW_1_RIGHT | ROW_2_LEFT | ROW_2_CENTER | ROW_2_RIGHT]. + * + * Example 2: A car has two seats in the front row (ROW_1_LEFT, ROW_1_RIGHT) and + * three seats in the second (ROW_2_LEFT, ROW_2_CENTER, ROW_2_RIGHT) and third + * rows (ROW_3_LEFT, ROW_3_CENTER, ROW_3_RIGHT). If the car has temperature + * controllers in the front row which can operate entirely independently of + * temperature controllers in the back of the vehicle, then HVAC_POWER_ON + * must be mapped to a two element array: + * - ROW_1_LEFT | ROW_1_RIGHT + * - ROW_2_LEFT | ROW_2_CENTER | ROW_2_RIGHT | ROW_3_LEFT | ROW_3_CENTER | ROW_3_RIGHT + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_POWER_ON = 0x0510 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * Fan Positions Available + * + * This is a bit mask of fan positions available for the zone. Each + * available fan direction is denoted by a separate entry in the vector. A + * fan direction may have multiple bits from vehicle_hvac_fan_direction set. + * For instance, a typical car may have the following fan positions: + * - FAN_DIRECTION_FACE (0x1) + * - FAN_DIRECTION_FLOOR (0x2) + * - FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR (0x3) + * - FAN_DIRECTION_DEFROST (0x4) + * - FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST (0x6) + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @data_enum VehicleHvacFanDirection + */ + HVAC_FAN_DIRECTION_AVAILABLE = 0x0511 + 0x10000000 + 0x05000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32_VEC + /** + * Automatic recirculation on/off + * + * When automatic recirculation is ON, the HVAC system may automatically + * switch to recirculation mode if the vehicle detects poor incoming air + * quality. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_AUTO_RECIRC_ON = 0x0512 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * Seat ventilation + * + * 0 indicates off. + * Positive values indicates ventilation level. + * + * Used by HVAC apps and Assistant to enable, change, or read state of seat + * ventilation. This is different than seating cooling. It can be on at the + * same time as cooling, or not. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_SEAT_VENTILATION = 0x0513 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Electric defrosters' status + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_ELECTRIC_DEFROSTER_ON = 0x0514 + 0x10000000 + 0x03000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN + /** + * Suggested values for setting HVAC temperature. + * + * Implement the property to help applications understand the closest supported temperature + * value in Celsius or Fahrenheit. + * + * floatValues[0] = the requested value that an application wants to set a temperature to. + * floatValues[1] = the unit for floatValues[0]. It should be one of + * {VehicleUnit:CELSIUS, VehicleUnit:FAHRENHEIT}. + * floatValues[2] = the value OEMs suggested in CELSIUS. This value is not included + * in the request. + * floatValues[3] = the value OEMs suggested in FAHRENHEIT. This value is not included + * in the request. + * + * An application calls set(VehiclePropValue propValue) with the requested value and unit for + * the value. OEMs need to return the suggested values in floatValues[2] and floatValues[3] by + * onPropertyEvent() callbacks. + * + * For example, when a user uses the voice assistant to set HVAC temperature to 66.2 in + * Fahrenheit. + * First, an application will set this property with the value + * [66.2, (float)VehicleUnit:FAHRENHEIT,0,0]. + * If OEMs suggest to set 19.0 in Celsius or 66.5 in Fahrenheit for user's request, then VHAL + * must generate a callback with property value + * [66.2, (float)VehicleUnit:FAHRENHEIT, 19.0, 66.5]. After the voice assistant gets the + * callback, it will inform the user and set HVAC temperature to the suggested value. + * + * Another example, an application receives 21 Celsius as the current temperature value by + * querying HVC_TEMPERATURE_SET. But the application wants to know what value is displayed on + * the car's UI in Fahrenheit. + * For this, the application sets the property to [21, (float)VehicleUnit:CELSIUS, 0, 0]. If + * the suggested value by the OEM for 21 Celsius is 70 Fahrenheit, then VHAL must generate a + * callback with property value [21, (float)VehicleUnit:CELSIUS, 21.0, 70.0]. + * In this case, the application can know that the value is 70.0 Fahrenheit in the car’s UI. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_TEMPERATURE_VALUE_SUGGESTION = 0x0515 + 0x10000000 + 0x01000000 + + 0x00610000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT_VEC + /** + * Distance units for display + * + * Indicates which units the car is using to display distances to the user. Eg. Mile, Meter + * Kilometer. + * + * Distance units are defined in VehicleUnit. + * VehiclePropConfig.configArray is used to indicate the supported distance display units. + * For example: configArray[0] = METER + * configArray[1] = KILOMETER + * configArray[2] = MILE + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleUnit + */ + DISTANCE_DISPLAY_UNITS = 0x0600 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Fuel volume units for display + * + * Indicates which units the car is using to display fuel volume to the user. Eg. Liter or + * Gallon. + * + * VehiclePropConfig.configArray is used to indicate the supported fuel volume display units. + * Volume units are defined in VehicleUnit. + * For example: configArray[0] = LITER + * configArray[1] = GALLON + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleUnit + */ + FUEL_VOLUME_DISPLAY_UNITS = 0x0601 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Tire pressure units for display + * + * Indicates which units the car is using to display tire pressure to the user. Eg. PSI, Bar or + * Kilopascal. + * + * VehiclePropConfig.configArray is used to indicate the supported pressure display units. + * Pressure units are defined in VehicleUnit. + * For example: configArray[0] = KILOPASCAL + * configArray[1] = PSI + * configArray[2] = BAR + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleUnit + */ + TIRE_PRESSURE_DISPLAY_UNITS = 0x0602 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * EV battery units for display + * + * Indicates which units the car is using to display EV battery information to the user. Eg. + * watt-hours(Wh), kilowatt-hours(kWh) or ampere-hours(Ah). + * + * VehiclePropConfig.configArray is used to indicate the supported electrical energy units. + * Electrical energy units are defined in VehicleUnit. + * For example: configArray[0] = WATT_HOUR + * configArray[1] = AMPERE_HOURS + * configArray[2] = KILOWATT_HOUR + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleUnit + */ + EV_BATTERY_DISPLAY_UNITS = 0x0603 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Fuel consumption units for display + * + * Indicates type of units the car is using to display fuel consumption information to user + * True indicates units are distance over volume such as MPG. + * False indicates units are volume over distance such as L/100KM. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = 0x0604 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Speed units for display + * + * Indicates type of units the car is using to display speed to user. Eg. m/s, km/h, or mph. + * + * VehiclePropConfig.configArray is used to indicate the supported speed display units. + * Pressure units are defined in VehicleUnit. + * For example: configArray[0] = METER_PER_SEC + * configArray[1] = MILES_PER_HOUR + * configArray[2] = KILOMETERS_PER_HOUR + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + VEHICLE_SPEED_DISPLAY_UNITS = 0x0605 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Current date and time, encoded as Unix time (in milliseconds). + * This value denotes the number of milliseconds seconds that have + * elapsed since 1/1/1970 UTC. + * + * Reading this value will give you the system’s time. This can be + * useful to synchronize other vehicle systems (dash clock etc). + * + * Writing this value will update the ‘ExternalTimeSuggestion’ + * value (if enabled). This value may be consumed by the “Time + * Detector Service”, if other sources do not have a higher + * priority. For information on how to adjust time source + * priorities see Time Detector Service documentation. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @unit VehicleUnit:MILLI_SECS + */ + EPOCH_TIME = 0x0606 + 0x10000000 + 0x01000000 + + 0x00500000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64 + /** + * External encryption binding seed. + * + * This value is mixed with the local key storage encryption key. + * This property holds 16 bytes, and is expected to be persisted on an ECU separate from + * the IVI. The property is initially set by AAOS, who generates it using a CSRNG. + * AAOS will then read the property on subsequent boots. The binding seed is expected to be + * reliably persisted. Any loss of the seed results in a factory reset of the IVI. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + STORAGE_ENCRYPTION_BINDING_SEED = 0x0607 + 0x10000000 + 0x01000000 + + 0x00700000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BYTES + /** + * Outside temperature + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:CELSIUS + */ + ENV_OUTSIDE_TEMPERATURE = 0x0703 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * Property to control power state of application processor + * + * It is assumed that AP's power state is controlled by a separate power + * controller. + * + * For configuration information, VehiclePropConfig.configArray can have bit flag combining + * values in VehicleApPowerStateConfigFlag. + * + * int32Values[0] : VehicleApPowerStateReq enum value + * int32Values[1] : additional parameter relevant for each state, + * 0 if not used. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + AP_POWER_STATE_REQ = 0x0A00 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Property to report power state of application processor + * + * It is assumed that AP's power state is controller by separate power + * controller. + * + * int32Values[0] : VehicleApPowerStateReport enum value + * int32Values[1] : Time in ms to wake up, if necessary. Otherwise 0. + + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + AP_POWER_STATE_REPORT = 0x0A01 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Property to report bootup reason for the current power on. This is a + * static property that will not change for the whole duration until power + * off. For example, even if user presses power on button after automatic + * power on with door unlock, bootup reason must stay with + * VehicleApPowerBootupReason#USER_UNLOCK. + * + * int32Values[0] must be VehicleApPowerBootupReason. + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + */ + AP_POWER_BOOTUP_REASON = 0x0A02 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Property to represent brightness of the display. Some cars have single + * control for the brightness of all displays and this property is to share + * change in that control. + * + * If this is writable, android side can set this value when user changes + * display brightness from Settings. If this is read only, user may still + * change display brightness from Settings, but that must not be reflected + * to other displays. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + DISPLAY_BRIGHTNESS = 0x0A03 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Property to feed H/W input events to android + * + * int32Values[0] : action defined by VehicleHwKeyInputAction + * int32Values[1] : key code, must use standard android key code + * int32Values[2] : target display defined in VehicleDisplay. Events not + * tied to specific display must be sent to + * VehicleDisplay#MAIN. + * int32Values[3] : [optional] Number of ticks. The value must be equal or + * greater than 1. When omitted, Android will default to 1. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @config_flags + */ + HW_KEY_INPUT = 0x0A10 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Property to feed H/W rotary events to android + * + * int32Values[0] : RotaryInputType identifying which rotary knob rotated + * int32Values[1] : number of detents (clicks), positive for clockwise, + * negative for counterclockwise + * int32Values[2] : target display defined in VehicleDisplay. Events not + * tied to specific display must be sent to + * VehicleDisplay#MAIN. + * int32values[3 .. 3 + abs(number of detents) - 2]: + * nanosecond deltas between pairs of consecutive detents, + * if the number of detents is > 1 or < -1 + * + * VehiclePropValue.timestamp: when the rotation occurred. If the number of + * detents is > 1 or < -1, this is when the + * first detent of rotation occurred. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @data_enum RotaryInputType + * @access VehiclePropertyAccess:READ + */ + HW_ROTARY_INPUT = 0x0A20 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Defines a custom OEM partner input event. + * + * This input event must be used by OEM partners who wish to propagate events not supported + * by Android. It is composed by an array of int32 values only. + * + * The Android properties are: + * + * int32Values[0] : Input code identifying the function representing this event. Valid event + * types are defined by CustomInputType.CUSTOM_EVENT_F1 up to + * CustomInputType.CUSTOM_EVENT_F10. They represent the custom event to be + * defined by OEM partners. + * int32Values[1] : target display type defined in VehicleDisplay. Events not tied to specific + * display must be sent to VehicleDisplay#MAIN. + * int32Values[2] : repeat counter, if 0 then event is not repeated. Values 1 or above means + * how many times this event repeated. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @data_enum CustomInputType + * @access VehiclePropertyAccess:READ + */ + HW_CUSTOM_INPUT = 0X0A30 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /*************************************************************************** + * Most Car Cabin properties have both a POSition and MOVE parameter. These + * are used to control the various movements for seats, doors, and windows + * in a vehicle. + * + * A POS parameter allows the user to set the absolution position. For + * instance, for a door, 0 indicates fully closed and max value indicates + * fully open. Thus, a value halfway between min and max must indicate + * the door is halfway open. + * + * A MOVE parameter moves the device in a particular direction. The sign + * indicates direction, and the magnitude indicates speed (if multiple + * speeds are available). For a door, a move of -1 will close the door, and + * a move of +1 will open it. Once a door reaches the limit of open/close, + * the door should automatically stop moving. The user must NOT need to + * send a MOVE(0) command to stop the door at the end of its range. + **************************************************************************/ + + /** + * Door position + * + * This is an integer in case a door may be set to a particular position. + * Max value indicates fully open, min value (0) indicates fully closed. + * + * Some vehicles (minivans) can open the door electronically. Hence, the + * ability to write this property. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + DOOR_POS = 0x0B00 + 0x10000000 + 0x06000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:INT32 + /** + * Door move + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + DOOR_MOVE = 0x0B01 + 0x10000000 + 0x06000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:INT32 + /** + * Door lock + * + * 'true' indicates door is locked + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + DOOR_LOCK = 0x0B02 + 0x10000000 + 0x06000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:BOOLEAN + /** + * Mirror Z Position + * + * Positive value indicates tilt upwards, negative value is downwards + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + MIRROR_Z_POS = 0x0B40 + 0x10000000 + 0x04000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 + /** + * Mirror Z Move + * + * Positive value indicates tilt upwards, negative value is downwards + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + MIRROR_Z_MOVE = 0x0B41 + 0x10000000 + 0x04000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 + /** + * Mirror Y Position + * + * Positive value indicate tilt right, negative value is left + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + MIRROR_Y_POS = 0x0B42 + 0x10000000 + 0x04000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 + /** + * Mirror Y Move + * + * Positive value indicate tilt right, negative value is left + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + MIRROR_Y_MOVE = 0x0B43 + 0x10000000 + 0x04000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 + /** + * Mirror Lock + * + * True indicates mirror positions are locked and not changeable + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + MIRROR_LOCK = 0x0B44 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Mirror Fold + * + * True indicates mirrors are folded + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + MIRROR_FOLD = 0x0B45 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Seat memory select + * + * This parameter selects the memory preset to use to select the seat + * position. The minValue is always 0, and the maxValue determines the + * number of seat positions available. + * + * For instance, if the driver's seat has 3 memory presets, the maxValue + * will be 3. When the user wants to select a preset, the desired preset + * number (1, 2, or 3) is set. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:WRITE + */ + SEAT_MEMORY_SELECT = 0x0B80 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat memory set + * + * This setting allows the user to save the current seat position settings + * into the selected preset slot. The maxValue for each seat position + * must match the maxValue for SEAT_MEMORY_SELECT. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:WRITE + */ + SEAT_MEMORY_SET = 0x0B81 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seatbelt buckled + * + * True indicates belt is buckled. + * + * Write access indicates automatic seat buckling capabilities. There are + * no known cars at this time, but you never know... + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_BELT_BUCKLED = 0x0B82 + 0x10000000 + 0x05000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN + /** + * Seatbelt height position + * + * Adjusts the shoulder belt anchor point. + * Max value indicates highest position + * Min value indicates lowest position + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_BELT_HEIGHT_POS = 0x0B83 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seatbelt height move + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_BELT_HEIGHT_MOVE = 0x0B84 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat fore/aft position + * + * Sets the seat position forward (closer to steering wheel) and backwards. + * Max value indicates closest to wheel, min value indicates most rearward + * position. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_FORE_AFT_POS = 0x0B85 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat fore/aft move + * + * Moves the seat position forward and aft. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_FORE_AFT_MOVE = 0x0B86 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat backrest angle 1 position + * + * Backrest angle 1 is the actuator closest to the bottom of the seat. + * Max value indicates angling forward towards the steering wheel. + * Min value indicates full recline. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_BACKREST_ANGLE_1_POS = 0x0B87 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat backrest angle 1 move + * + * Moves the backrest forward or recline. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_BACKREST_ANGLE_1_MOVE = 0x0B88 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat backrest angle 2 position + * + * Backrest angle 2 is the next actuator up from the bottom of the seat. + * Max value indicates angling forward towards the steering wheel. + * Min value indicates full recline. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_BACKREST_ANGLE_2_POS = 0x0B89 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat backrest angle 2 move + * + * Moves the backrest forward or recline. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_BACKREST_ANGLE_2_MOVE = 0x0B8A + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat height position + * + * Sets the seat height. + * Max value indicates highest position. + * Min value indicates lowest position. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_HEIGHT_POS = 0x0B8B + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat height move + * + * Moves the seat height. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_HEIGHT_MOVE = 0x0B8C + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat depth position + * + * Sets the seat depth, distance from back rest to front edge of seat. + * Max value indicates longest depth position. + * Min value indicates shortest position. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_DEPTH_POS = 0x0B8D + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat depth move + * + * Adjusts the seat depth. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_DEPTH_MOVE = 0x0B8E + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat tilt position + * + * Sets the seat tilt. + * Max value indicates front edge of seat higher than back edge. + * Min value indicates front edge of seat lower than back edge. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_TILT_POS = 0x0B8F + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat tilt move + * + * Tilts the seat. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_TILT_MOVE = 0x0B90 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Lumber fore/aft position + * + * Pushes the lumbar support forward and backwards + * Max value indicates most forward position. + * Min value indicates most rearward position. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_LUMBAR_FORE_AFT_POS = 0x0B91 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Lumbar fore/aft move + * + * Adjusts the lumbar support. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_LUMBAR_FORE_AFT_MOVE = 0x0B92 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Lumbar side support position + * + * Sets the amount of lateral lumbar support. + * Max value indicates widest lumbar setting (i.e. least support) + * Min value indicates thinnest lumbar setting. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_LUMBAR_SIDE_SUPPORT_POS = 0x0B93 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Lumbar side support move + * + * Adjusts the amount of lateral lumbar support. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_LUMBAR_SIDE_SUPPORT_MOVE = 0x0B94 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Headrest height position + * + * Sets the headrest height. + * Max value indicates tallest setting. + * Min value indicates shortest setting. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_HEADREST_HEIGHT_POS = 0x0B95 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Headrest height move + * + * Moves the headrest up and down. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_HEADREST_HEIGHT_MOVE = 0x0B96 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Headrest angle position + * + * Sets the angle of the headrest. + * Max value indicates most upright angle. + * Min value indicates shallowest headrest angle. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_HEADREST_ANGLE_POS = 0x0B97 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Headrest angle move + * + * Adjusts the angle of the headrest + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_HEADREST_ANGLE_MOVE = 0x0B98 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Headrest fore/aft position + * + * Adjusts the headrest forwards and backwards. + * Max value indicates position closest to front of car. + * Min value indicates position closest to rear of car. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_HEADREST_FORE_AFT_POS = 0x0B99 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Headrest fore/aft move + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SEAT_HEADREST_FORE_AFT_MOVE = 0x0B9A + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Seat Occupancy + * + * Indicates whether a particular seat is occupied or not, to the best of the car's ability + * to determine. Valid values are from the VehicleSeatOccupancyState enum. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleSeatOccupancyState + */ + SEAT_OCCUPANCY = 0x0BB0 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Window Position + * + * Min = window up / closed + * Max = window down / open + * + * For a window that may open out of plane (i.e. vent mode of sunroof) this + * parameter will work with negative values as follows: + * Max = sunroof completely open + * 0 = sunroof closed. + * Min = sunroof vent completely open + * + * Note that in this mode, 0 indicates the window is closed. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + WINDOW_POS = 0x0BC0 + 0x10000000 + 0x03000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32 + /** + * Window Move + * + * Max = Open the window as fast as possible + * Min = Close the window as fast as possible + * Magnitude denotes relative speed. I.e. +2 is faster than +1 in closing + * the window. + * + * For a window that may open out of plane (i.e. vent mode of sunroof) this + * parameter will work as follows: + * + * If sunroof is open: + * Max = open the sunroof further, automatically stop when fully open. + * Min = close the sunroof, automatically stop when sunroof is closed. + * + * If vent is open: + * Max = close the vent, automatically stop when vent is closed. + * Min = open the vent further, automatically stop when vent is fully open. + * + * If sunroof is in the closed position: + * Max = open the sunroof, automatically stop when sunroof is fully open. + * Min = open the vent, automatically stop when vent is fully open. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + WINDOW_MOVE = 0x0BC1 + 0x10000000 + 0x03000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32 + /** + * Window Lock + * + * True indicates windows are locked and can't be moved. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + WINDOW_LOCK = 0x0BC4 + 0x10000000 + 0x03000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN + /** + * Vehicle Maps Service (VMS) message + * + * This property uses MIXED data to communicate vms messages. + * + * Its contents are to be interpreted as follows: + * the indices defined in VmsMessageIntegerValuesIndex are to be used to + * read from int32Values; + * bytes is a serialized VMS message as defined in the vms protocol + * which is opaque to the framework; + * + * IVehicle#get must always return StatusCode::NOT_AVAILABLE. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + VEHICLE_MAP_SERVICE = 0x0C00 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * OBD2 Live Sensor Data + * + * Reports a snapshot of the current (live) values of the OBD2 sensors available. + * + * The configArray is set as follows: + * configArray[0] = number of vendor-specific integer-valued sensors + * configArray[1] = number of vendor-specific float-valued sensors + * + * The values of this property are to be interpreted as in the following example. + * Considering a configArray = {2,3} + * int32Values must be a vector containing Obd2IntegerSensorIndex.LAST_SYSTEM_INDEX + 2 + * elements (that is, 33 elements); + * floatValues must be a vector containing Obd2FloatSensorIndex.LAST_SYSTEM_INDEX + 3 + * elements (that is, 73 elements); + * + * It is possible for each frame to contain a different subset of sensor values, both system + * provided sensors, and vendor-specific ones. In order to support that, the bytes element + * of the property value is used as a bitmask,. + * + * bytes must have a sufficient number of bytes to represent the total number of possible + * sensors (in this case, 14 bytes to represent 106 possible values); it is to be read as + * a contiguous bitmask such that each bit indicates the presence or absence of a sensor + * from the frame, starting with as many bits as the size of int32Values, immediately + * followed by as many bits as the size of floatValues. + * + * For example, should bytes[0] = 0x4C (0b01001100) it would mean that: + * int32Values[0 and 1] are not valid sensor values + * int32Values[2 and 3] are valid sensor values + * int32Values[4 and 5] are not valid sensor values + * int32Values[6] is a valid sensor value + * int32Values[7] is not a valid sensor value + * Should bytes[5] = 0x61 (0b01100001) it would mean that: + * int32Values[32] is a valid sensor value + * floatValues[0 thru 3] are not valid sensor values + * floatValues[4 and 5] are valid sensor values + * floatValues[6] is not a valid sensor value + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + OBD2_LIVE_FRAME = 0x0D00 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * OBD2 Freeze Frame Sensor Data + * + * Reports a snapshot of the value of the OBD2 sensors available at the time that a fault + * occurred and was detected. + * + * A configArray must be provided with the same meaning as defined for OBD2_LIVE_FRAME. + * + * The values of this property are to be interpreted in a similar fashion as those for + * OBD2_LIVE_FRAME, with the exception that the stringValue field may contain a non-empty + * diagnostic troubleshooting code (DTC). + * + * A IVehicle#get request of this property must provide a value for int64Values[0]. + * This will be interpreted as the timestamp of the freeze frame to retrieve. A list of + * timestamps can be obtained by a IVehicle#get of OBD2_FREEZE_FRAME_INFO. + * + * Should no freeze frame be available at the given timestamp, a response of NOT_AVAILABLE + * must be returned by the implementation. Because vehicles may have limited storage for + * freeze frames, it is possible for a frame request to respond with NOT_AVAILABLE even if + * the associated timestamp has been recently obtained via OBD2_FREEZE_FRAME_INFO. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + OBD2_FREEZE_FRAME = 0x0D01 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * OBD2 Freeze Frame Information + * + * This property describes the current freeze frames stored in vehicle + * memory and available for retrieval via OBD2_FREEZE_FRAME. + * + * The values are to be interpreted as follows: + * each element of int64Values must be the timestamp at which a a fault code + * has been detected and the corresponding freeze frame stored, and each + * such element can be used as the key to OBD2_FREEZE_FRAME to retrieve + * the corresponding freeze frame. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + OBD2_FREEZE_FRAME_INFO = 0x0D02 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * OBD2 Freeze Frame Clear + * + * This property allows deletion of any of the freeze frames stored in + * vehicle memory, as described by OBD2_FREEZE_FRAME_INFO. + * + * The configArray is set as follows: + * configArray[0] = 1 if the implementation is able to clear individual freeze frames + * by timestamp, 0 otherwise + * + * IVehicle#set of this property is to be interpreted as follows: + * if int64Values contains no elements, then all frames stored must be cleared; + * if int64Values contains one or more elements, then frames at the timestamps + * stored in int64Values must be cleared, and the others not cleared. Should the + * vehicle not support selective clearing of freeze frames, this latter mode must + * return NOT_AVAILABLE. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:WRITE + */ + OBD2_FREEZE_FRAME_CLEAR = 0x0D03 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Headlights State + * + * Return the current state of headlights. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleLightState + */ + HEADLIGHTS_STATE = 0x0E00 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * High beam lights state + * + * Return the current state of high beam lights. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleLightState + */ + HIGH_BEAM_LIGHTS_STATE = 0x0E01 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Fog light state + * + * Return the current state of fog lights. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleLightState + */ + FOG_LIGHTS_STATE = 0x0E02 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Hazard light status + * + * Return the current status of hazard lights. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleLightState + */ + HAZARD_LIGHTS_STATE = 0x0E03 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Headlight switch + * + * The setting that the user wants. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleLightSwitch + */ + HEADLIGHTS_SWITCH = 0x0E10 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * High beam light switch + * + * The setting that the user wants. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleLightSwitch + */ + HIGH_BEAM_LIGHTS_SWITCH = 0x0E11 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Fog light switch + * + * The setting that the user wants. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleLightSwitch + */ + FOG_LIGHTS_SWITCH = 0x0E12 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Hazard light switch + * + * The setting that the user wants. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleLightSwitch + */ + HAZARD_LIGHTS_SWITCH = 0x0E13 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Cabin lights + * + * Return current status of cabin lights. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleLightState + */ + CABIN_LIGHTS_STATE = 0x0F01 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Cabin lights switch + * + * The position of the physical switch which controls the cabin lights. + * This might be different than the CABIN_LIGHTS_STATE if the lights are on because a door + * is open or because of a voice command. + * For example, while the switch is in the "off" or "automatic" position. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleLightSwitch + */ + CABIN_LIGHTS_SWITCH = 0x0F02 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Reading lights + * + * Return current status of reading lights. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleLightState + */ + READING_LIGHTS_STATE = 0x0F03 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Reading lights switch + * + * The position of the physical switch which controls the reading lights. + * This might be different than the READING_LIGHTS_STATE if the lights are on because a door + * is open or because of a voice command. + * For example, while the switch is in the "off" or "automatic" position. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleLightSwitch + */ + READING_LIGHTS_SWITCH = 0x0F04 + 0x10000000 + 0x05000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 + /** + * Support customize permissions for vendor properties + * + * Implement this property if vehicle hal support customize vendor permissions feature. + * VehiclePropConfig.configArray is used to indicate vendor properties and permissions + * which selected for this vendor property. The permission must be one of enum in + * VehicleVendorPermission. + * The configArray is set as follows: + * configArray[n] = propId : property ID for the vendor property + * configArray[n+1] = one of enums in VehicleVendorPermission. It indicates the permission + * for reading value of the property. + * configArray[n+2] = one of enums in VehicleVendorPermission. It indicates the permission + * for writing value of the property. + * + * For example: + * configArray = { + * vendor_prop_1, PERMISSION_VENDOR_SEAT_READ, PERMISSION_VENDOR_SEAT_WRITE, + * vendor_prop_2, PERMISSION_VENDOR_INFO, PERMISSION_NOT_ACCESSIBLE, + * } + * If vendor properties are not in this array, they will have the default vendor permission. + * If vendor chose PERMISSION_NOT_ACCESSIBLE, android will not have access to the property. In + * the example, Android can not write value for vendor_prop_2. + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + */ + SUPPORT_CUSTOMIZE_VENDOR_PERMISSION = 0x0F05 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + /** + * Allow disabling optional featurs from vhal. + * + * This property reports optional features that should be disabled. + * All allowed optional features for the system is declared in Car service overlay, + * config_allowed_optional_car_features. + * This property allows disabling features defined in the overlay. Without this property, + * all the features declared in the overlay will be enabled. + * + * Value read should include all features disabled with ',' separation. + * ex) "com.android.car.user.CarUserNoticeService,storage_monitoring" + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + */ + DISABLED_OPTIONAL_FEATURES = 0x0F06 + 0x10000000 + 0x01000000 + + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING + /** + * Defines the initial Android user to be used during initialization. + * + * This property is called by the Android system when it initializes and it lets the HAL + * define which Android user should be started. + * + * This request is made by setting a VehiclePropValue (defined by InitialUserInfoRequest), + * and the HAL must respond with a property change event (defined by InitialUserInfoResponse). + * If the HAL doesn't respond after some time (defined by the Android system), the Android + * system will proceed as if HAL returned a response of action + * InitialUserInfoResponseAction:DEFAULT. + * + * For example, on first boot, the request could be: + * + * int32[0]: 42 // request id (arbitrary number set by Android system) + * int32[1]: 1 // InitialUserInfoRequestType::FIRST_BOOT + * int32[2]: 0 // id of current user (usersInfo.currentUser.userId) + * int32[3]: 1 // flag of current user (usersInfo.currentUser.flags = SYSTEM) + * int32[4]: 1 // number of existing users (usersInfo.numberUsers); + * int32[5]: 0 // user #0 (usersInfo.existingUsers[0].userId) + * int32[6]: 1 // flags of user #0 (usersInfo.existingUsers[0].flags) + * + * And if the HAL want to respond with the creation of an admin user called "Owner", the + * response would be: + * + * int32[0]: 42 // must match the request id from the request + * int32[1]: 2 // action = InitialUserInfoResponseAction::CREATE + * int32[2]: -10000 // userToSwitchOrCreate.userId (not used as user will be created) + * int32[3]: 8 // userToSwitchOrCreate.flags = ADMIN + * string: "||Owner" // userLocales + separator + userNameToCreate + * + * Notice the string value represents multiple values, separated by ||. The first value is the + * (optional) system locales for the user to be created (in this case, it's empty, meaning it + * will use Android's default value), while the second value is the (also optional) name of the + * to user to be created (when the type of response is InitialUserInfoResponseAction:CREATE). + * For example, to create the same "Owner" user with "en-US" and "pt-BR" locales, the string + * value of the response would be "en-US,pt-BR||Owner". As such, neither the locale nor the + * name can have || on it, although a single | is fine. + * + * NOTE: if the HAL doesn't support user management, then it should not define this property, + * which in turn would disable the other user-related properties (for example, the Android + * system would never issue them and user-related requests from the HAL layer would be ignored + * by the Android System). But if it supports user management, then it must support all core + * user-related properties (INITIAL_USER_INFO, SWITCH_USER, CREATE_USER, and REMOVE_USER). + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + INITIAL_USER_INFO = 0x0F07 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Defines a request to switch the foreground Android user. + * + * This property is used primarily by the Android System to inform the HAL that the + * current foreground Android user is switching, but it could also be used by the HAL to request + * the Android system to switch users - the + * + * When the request is made by Android, it sets a VehiclePropValue and the HAL must responde + * with a property change event; when the HAL is making the request, it must also do it through + * a property change event (the main difference is that the request id will be positive in the + * former case, and negative in the latter; the SwitchUserMessageType will also be different). + * + * The format of both request is defined by SwitchUserRequest and the format of the response + * (when needed) is defined by SwitchUserResponse. How the HAL (or Android System) should + * proceed depends on the message type (which is defined by the SwitchUserMessageType + * parameter), as defined below. + * + * 1.LEGACY_ANDROID_SWITCH + * ----------------------- + * + * Called by the Android System to indicate the Android user is about to change, when the change + * request was made in a way that is not integrated with the HAL (for example, through + * adb shell am switch-user). + * + * The HAL can switch its internal user once it receives this request, but it doesn't need to + * reply back to the Android System. If its internal user cannot be changed for some reason, + * then it must wait for the SWITCH_USER(type=ANDROID_POST_SWITCH) call to recover + * (for example, it could issue a SWITCH_USER(type=VEHICLE_REQUEST) to switch back to + * the previous user), but ideally it should never fail (as switching back could result in a + * confusing experience for the end user). + * + * For example, if the system have users (0, 10, 11) and it's switching from 0 to 11 (where none + * of them have any special flag), the request would be: + * + * int32[0]: 42 // request id + * int32[1]: 1 // SwitchUserMessageType::LEGACY_ANDROID_SWITCH + * int32[2]: 11 // target user id + * int32[3]: 0 // target user flags (none) + * int32[4]: 10 // current user + * int32[5]: 0 // current user flags (none) + * int32[6]: 3 // number of users + * int32[7]: 0 // user #0 (Android user id 0) + * int32[8]: 0 // flags of user #0 (none) + * int32[9]: 10 // user #1 (Android user id 10) + * int32[10]: 0 // flags of user #1 (none) + * int32[11]: 11 // user #2 (Android user id 11) + * int32[12]: 0 // flags of user #2 (none) + * + * 2.ANDROID_SWITCH + * ---------------- + * Called by the Android System to indicate the Android user is about to change, but Android + * will wait for the HAL's response (up to some time) before proceeding. + * + * The HAL must switch its internal user once it receives this request, then respond back to + * Android with a SWITCH_USER(type=VEHICLE_RESPONSE) indicating whether its internal + * user was switched or not (through the SwitchUserStatus enum). + * + * For example, if Android has users (0, 10, 11) and it's switching from 10 to 11 (where + * none of them have any special flag), the request would be: + * + * int32[0]: 42 // request id + * int32[1]: 2 // SwitchUserMessageType::ANDROID_SWITCH + * int32[2]: 11 // target user id + * int32[3]: 0 // target user flags (none) + * int32[4]: 10 // current user + * int32[5]: 0 // current user flags (none) + * int32[6]: 3 // number of users + * int32[7]: 0 // 1st user (user 0) + * int32[8]: 1 // 1st user flags (SYSTEM) + * int32[9]: 10 // 2nd user (user 10) + * int32[10]: 0 // 2nd user flags (none) + * int32[11]: 11 // 3rd user (user 11) + * int32[12]: 0 // 3rd user flags (none) + * + * If the request succeeded, the HAL must update the property with: + * + * int32[0]: 42 // request id + * int32[1]: 3 // messageType = SwitchUserMessageType::VEHICLE_RESPONSE + * int32[2]: 1 // status = SwitchUserStatus::SUCCESS + * + * But if it failed, the response would be something like: + * + * int32[0]: 42 // request id + * int32[1]: 3 // messageType = SwitchUserMessageType::VEHICLE_RESPONSE + * int32[2]: 2 // status = SwitchUserStatus::FAILURE + * string: "108-D'OH!" // OEM-specific error message + * + * 3.VEHICLE_RESPONSE + * ------------------ + * Called by the HAL to indicate whether a request of type ANDROID_SWITCH should proceed or + * abort - see the ANDROID_SWITCH section above for more info. + * + * 4.VEHICLE_REQUEST + * ------------------ + * Called by the HAL to request that the current foreground Android user is switched. + * + * This is useful in situations where Android started as one user, but the vehicle identified + * the driver as another user. For example, user A unlocked the car using the key fob of user B; + * the INITIAL_USER_INFO request returned user B, but then a face recognition subsubsystem + * identified the user as A. + * + * The HAL makes this request by a property change event (passing a negative request id), and + * the Android system will response by issue an ANDROID_POST_SWITCH call which the same + * request id. + * + * For example, if the current foreground Android user is 10 and the HAL asked it to switch to + * 11, the request would be: + * + * int32[0]: -108 // request id + * int32[1]: 4 // messageType = SwitchUserMessageType::VEHICLE_REQUEST + * int32[2]: 11 // Android user id + * + * If the request succeeded and Android has 3 users (0, 10, 11), the response would be: + * + * int32[0]: -108 // request id + * int32[1]: 5 // messageType = SwitchUserMessageType::ANDROID_POST_SWITCH + * int32[2]: 11 // target user id + * int32[3]: 0 // target user id flags (none) + * int32[4]: 11 // current user + * int32[5]: 0 // current user flags (none) + * int32[6]: 3 // number of users + * int32[7]: 0 // 1st user (user 0) + * int32[8]: 0 // 1st user flags (none) + * int32[9]: 10 // 2nd user (user 10) + * int32[10]: 4 // 2nd user flags (none) + * int32[11]: 11 // 3rd user (user 11) + * int32[12]: 3 // 3rd user flags (none) + * + * Notice that both the current and target user ids are the same - if the request failed, then + * they would be different (i.e, target user would be 11, but current user would still be 10). + * + * 5.ANDROID_POST_SWITCH + * --------------------- + * Called by the Android System after a request to switch a user was made. + * + * This property is called after switch requests of any type (i.e., LEGACY_ANDROID_SWITCH, + * ANDROID_SWITCH, or VEHICLE_REQUEST) and can be used to determine if the request succeeded or + * failed: + * + * 1. When it succeeded, it's called when the Android user is in the unlocked state and the + * value of the current and target users ids in the response are the same. This would be + * equivalent to receiving an Intent.ACTION_USER_UNLOCKED in an Android app. + * 2. When it failed it's called right away and the value of the current and target users ids + * in the response are different (as the current user didn't change to the target). + * 3. If a new switch request is made before the HAL responded to the previous one or before + * the user was unlocked, then the ANDROID_POST_SWITCH request is not made. For example, + * the driver could accidentally switch to the wrong user which has lock credentials, then + * switch to the right one before entering the credentials. + * + * The HAL can update its internal state once it receives this request, but it doesn't need to + * reply back to the Android System. + * + * Request: the first N values as defined by INITIAL_USER_INFO (where the request-specific + * value at index 1 is SwitchUserMessageType::ANDROID_POST_SWITCH), then 2 more values for the + * target user id (i.e., the Android user id that was requested to be switched to) and its flags + * (as defined by UserFlags). + * + * Response: none. + * + * Example: see VEHICLE_REQUEST section above. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + SWITCH_USER = 0x0F08 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Called by the Android System after an Android user was created. + * + * The HAL can use this property to create its equivalent user. + * + * This is an async request: Android makes the request by setting a VehiclePropValue, and HAL + * must respond with a property change indicating whether the request succeeded or failed. If + * it failed, the Android system will remove the user. + * + * The format of the request is defined by CreateUserRequest and the format of the response by + * CreateUserResponse. + * + * For example, if system had 2 users (0 and 10) and a 3rd one (which is an ephemeral guest) was + * created, the request would be: + * + * int32[0]: 42 // request id + * int32[1]: 11 // Android id of the created user + * int32[2]: 6 // Android flags (ephemeral guest) of the created user + * int32[3]: 10 // current user + * int32[4]: 0 // current user flags (none) + * int32[5]: 3 // number of users + * int32[6]: 0 // 1st user (user 0) + * int32[7]: 0 // 1st user flags (none) + * int32[8]: 10 // 2nd user (user 10) + * int32[9]: 0 // 2nd user flags (none) + * int32[19]: 11 // 3rd user (user 11) + * int32[11]: 6 // 3rd user flags (ephemeral guest) + * string: "ElGuesto" // name of the new user + * + * Then if the request succeeded, the HAL would return: + * + * int32[0]: 42 // request id + * int32[1]: 1 // CreateUserStatus::SUCCESS + * + * But if it failed: + * + * int32[0]: 42 // request id + * int32[1]: 2 // CreateUserStatus::FAILURE + * string: "D'OH!" // The meaning is a blackbox - it's passed to the caller (like Settings UI), + * // which in turn can take the proper action. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + CREATE_USER = 0x0F09 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Called by the Android System after an Android user was removed. + * + * The HAL can use this property to remove its equivalent user. + * + * This is write-only call - the Android System is not expecting a reply from the HAL. Hence, + * this request should not fail - if the equivalent HAL user cannot be removed, then HAL should + * mark it as inactive or recover in some other way. + * + * The request is made by setting the VehiclePropValue with the contents defined by + * RemoveUserRequest. + * + * For example, if system had 3 users (0, 10, and 11) and user 11 was removed, the request + * would be: + * + * int32[0]: 42 // request id + * int32[1]: 11 // (Android user id of the removed user) + * int32[2]: 0 // (Android user flags of the removed user) + * int32[3]: 10 // current user + * int32[4]: 0 // current user flags (none) + * int32[5]: 2 // number of users + * int32[6]: 0 // 1st user (user 0) + * int32[7]: 0 // 1st user flags (none) + * int32[8]: 10 // 2nd user (user 10) + * int32[9]: 0 // 2nd user flags (none) + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:WRITE + */ + REMOVE_USER = 0x0F0A + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Property used to associate (or query the association) the current user with vehicle-specific + * identification mechanisms (such as key FOB). + * + * This is an optional user management property - the OEM could still support user management + * without defining it. In fact, this property could be used without supporting the core + * user-related functions described on INITIAL_USER_INFO. + * + * To query the association, the Android system gets the property, passing a VehiclePropValue + * containing the types of associations are being queried, as defined by + * UserIdentificationGetRequest. The HAL must return right away, returning a VehiclePropValue + * with a UserIdentificationResponse. Notice that user identification should have already + * happened while system is booting up and the VHAL implementation should only return the + * already identified association (like the key FOB used to unlock the car), instead of starting + * a new association from the get call. + * + * To associate types, the Android system sets the property, passing a VehiclePropValue + * containing the types and values of associations being set, as defined by the + * UserIdentificationSetRequest. The HAL will then use a property change event (whose + * VehiclePropValue is defined by UserIdentificationResponse) indicating the current status of + * the types after the request. + * + * For example, to query if the current user (10) is associated with the FOB that unlocked the + * car and a custom mechanism provided by the OEM, the request would be: + * + * int32[0]: 42 // request id + * int32[1]: 10 (Android user id) + * int32[2]: 0 (Android user flags) + * int32[3]: 2 (number of types queried) + * int32[4]: 1 (1st type queried, UserIdentificationAssociationType::KEY_FOB) + * int32[5]: 101 (2nd type queried, UserIdentificationAssociationType::CUSTOM_1) + * + * If the user is associated with the FOB but not with the custom mechanism, the response would + * be: + * + * int32[0]: 42 // request id + * int32[1]: 2 (number of associations in the response) + * int32[2]: 1 (1st type: UserIdentificationAssociationType::KEY_FOB) + * int32[3]: 2 (1st value: UserIdentificationAssociationValue::ASSOCIATED_CURRENT_USER) + * int32[4]: 101 (2st type: UserIdentificationAssociationType::CUSTOM_1) + * int32[5]: 4 (2nd value: UserIdentificationAssociationValue::NOT_ASSOCIATED_ANY_USER) + * + * Then to associate the user with the custom mechanism, a set request would be made: + * + * int32[0]: 43 // request id + * int32[1]: 10 (Android user id) + * int32[2]: 0 (Android user flags) + * int32[3]: 1 (number of associations being set) + * int32[4]: 101 (1st type: UserIdentificationAssociationType::CUSTOM_1) + * int32[5]: 1 (1st value: UserIdentificationAssociationSetValue::ASSOCIATE_CURRENT_USER) + * + * If the request succeeded, the response would be simply: + * + * int32[0]: 43 // request id + * int32[1]: 1 (number of associations in the response) + * int32[2]: 101 (1st type: UserIdentificationAssociationType::CUSTOM_1) + * int32[3]: 1 (1st value: UserIdentificationAssociationValue::ASSOCIATED_CURRENT_USER) + * + * Notice that the set request adds associations, but doesn't remove the existing ones. In the + * example above, the end state would be 2 associations (FOB and CUSTOM_1). If we wanted to + * associate the user with just CUSTOM_1 but not FOB, then the request should have been: + * + * int32[0]: 43 // request id + * int32[1]: 10 (Android user id) + * int32[2]: 2 (number of types set) + * int32[3]: 1 (1st type: UserIdentificationAssociationType::KEY_FOB) + * int32[4]: 2 (1st value: UserIdentificationAssociationValue::DISASSOCIATE_CURRENT_USER) + * int32[5]: 101 (2nd type: UserIdentificationAssociationType::CUSTOM_1) + * int32[6]: 1 (2nd value: UserIdentificationAssociationValue::ASSOCIATE_CURRENT_USER) + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + USER_IDENTIFICATION_ASSOCIATION = 0x0F0B + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Enable/request an EVS service. + * + * The property provides a generalized way to trigger EVS services. VHAL + * should use this property to request Android to start or stop EVS service. + * + * int32Values[0] = a type of the EVS service. The value must be one of enums in + * EvsServiceType. + * int32Values[1] = the state of the EVS service. The value must be one of enums in + * EvsServiceState. + * + * For example, to enable rear view EVS service, android side can set the property value as + * [EvsServiceType::REAR_VIEW, EvsServiceState::ON]. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + EVS_SERVICE_REQUEST = 0x0F10 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Defines a request to apply power policy. + * + * VHAL sets this property to change car power policy. Car power policy service subscribes to + * this property and actually changes the power policy. + * The request is made by setting the VehiclePropValue with the ID of a power policy which is + * defined at /vendor/etc/power_policy.xml. If the given ID is not defined, car power policy + * service ignores the request and the current power policy is maintained. + * + * string: "sample_policy_id" // power policy ID + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + POWER_POLICY_REQ = 0x0F21 + 0x10000000 + 0x01000000 + + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING + /** + * Defines a request to set the power polic group used to decide a default power policy per + * power status transition. + * + * VHAL sets this property with the ID of a power policy group in order to set the default power + * policy applied at power status transition. Power policy groups are defined at + * /vendor/etc/power_policy.xml. If the given ID is not defined, car power policy service + * ignores the request. + * Car power policy service subscribes to this property and sets the power policy group. + * The actual application of power policy takes place when the system power status changes and + * there is a valid mapped power policy for the new power status. + * + * string: "sample_policy_group_id" // power policy group ID + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + POWER_POLICY_GROUP_REQ = 0x0F22 + 0x10000000 + 0x01000000 + + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING + /** + * Notifies the current power policy to VHAL layer. + * + * Car power policy service sets this property when the current power policy is changed. + * + * string: "sample_policy_id" // power policy ID + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + CURRENT_POWER_POLICY = 0x0F23 + 0x10000000 + 0x01000000 + + 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING + /** + * Defines an event that car watchdog updates to tell it's alive. + * + * Car watchdog sets this property to system uptime in milliseconds at every 3 second. + * During the boot, the update may take longer time. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:WRITE + */ + WATCHDOG_ALIVE = 0xF31 + 0x10000000 + 0x01000000 + + 0x00500000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64 + /** + * Defines a process terminated by car watchdog and the reason of termination. + * + * int32Values[0]: 1 // ProcessTerminationReason showing why a process is terminated. + * string: "/system/bin/log" // Process execution command. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:WRITE + */ + WATCHDOG_TERMINATED_PROCESS = 0x0F32 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Defines an event that VHAL signals to car watchdog as a heartbeat. + * + * If VHAL supports this property, VHAL should write system uptime to this property at every 3 + * second. Car watchdog subscribes to this property and checks if the property is updated at + * every 3 second. With the buffer time of 3 second, car watchdog waits for a heart beat to be + * signaled up to 6 seconds from the last heart beat. If it isn’t, car watchdog considers + * VHAL unhealthy and terminates it. + * If this property is not supported by VHAL, car watchdog doesn't check VHAL health status. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + VHAL_HEARTBEAT = 0x0F33 + 0x10000000 + 0x01000000 + + 0x00500000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64 + /** + * Starts the ClusterUI in cluster display. + * + * int32: the type of ClusterUI to show + * 0 indicates ClusterHome, that is a home screen of cluster display, and provides + * the default UI and a kind of launcher functionality for cluster display. + * the other values are followed by OEM's definition. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + CLUSTER_SWITCH_UI = 0x0F34 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Changes the state of the cluster display. + * + * Bounds: the area to render the cluster Activity. + * Inset: the area which Activity should avoid from placing any important + * information. + * + * int32[0]: on/off: 0 - off, 1 - on, -1 - don't care + * int32[1]: Bounds - left: positive number - left position in pixels + -1 - don't care (should set all Bounds fields) + * int32[2]: Bounds - top: same format with 'left' + * int32[3]: Bounds - right: same format with 'left' + * int32[4]: Bounds - bottom: same format with 'left' + * int32[5]: Inset - left: positive number - actual left inset value in pixels + -1 - don't care (should set "don't care" all Inset fields) + * int32[6]: Inset - top: same format with 'left' + * int32[7]: Inset - right: same format with 'left' + * int32[8]: Inset - bottom: same format with 'left' + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + */ + CLUSTER_DISPLAY_STATE = 0x0F35 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Reports the current display state and ClusterUI state. + * + * ClusterHome will send this message when it handles CLUSTER_SWITCH_UI, CLUSTER_DISPLAY_STATE. + * + * In addition, ClusterHome should send this message when it starts for the first time. + * When ClusterOS receives this message and if the internal expectation is different with the + * received message, then it should send CLUSTER_SWITCH_UI, CLUSTER_DISPLAY_STATE again to + * match the state. + * + * int32[0]: on/off: 0 - off, 1 - on + * int32[1]: Bounds - left + * int32[2]: Bounds - top + * int32[3]: Bounds - right + * int32[4]: Bounds - bottom + * int32[5]: Inset - left + * int32[6]: Inset - top + * int32[7]: Inset - right + * int32[8]: Inset - bottom + * int32[9]: the type of ClusterUI in the fullscreen or main screen. + * 0 indicates ClusterHome. + * the other values are followed by OEM's definition. + * int32[10]: the type of ClusterUI in sub screen if the currently two UIs are shown. + * -1 indicates the area isn't used any more. + * bytes: the array to represent the availability of ClusterUI. + * 0 indicates non-available and 1 indicates available. + * For example, let's assume a car supports 3 OEM defined ClusterUI like HOME, MAPS, CALL, + * and it only supports CALL UI only when the cellular network is available. Then, if the + * nework is avaibale, it'll send [1 1 1], and if it's out of network, it'll send [1 1 0]. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:WRITE + */ + CLUSTER_REPORT_STATE = 0x0F36 + 0x10000000 + 0x01000000 + + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Requests to change the cluster display state to show some ClusterUI. + * + * When the current display state is off and ClusterHome sends this message to ClusterOS to + * request to turn the display on to show some specific ClusterUI. + * ClusterOS should response this with CLUSTER_DISPLAY_STATE. + * + * int32: the type of ClusterUI to show + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:WRITE + */ + CLUSTER_REQUEST_DISPLAY = 0x0F37 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Informs the current navigation state. + * + * bytes: the serialized message of NavigationStateProto. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:WRITE + */ + CLUSTER_NAVIGATION_STATE = 0x0F38 + 0x10000000 + 0x01000000 + + 0x00700000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BYTES + /** + * Electronic Toll Collection card type. + * + * This property indicates the type of ETC card in this vehicle. + * If the head unit is aware of an ETC card attached to the vehicle, this property should + * return the type of card attached; otherwise, this property should be UNAVAILABLE. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum ElectronicTollCollectionCardType + */ + ELECTRONIC_TOLL_COLLECTION_CARD_TYPE = 0x0F39 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Electronic Toll Collection card status. + * + * This property indicates the status of ETC card in this vehicle. + * If the head unit is aware of an ETC card attached to the vehicle, + * ELECTRONIC_TOLL_COLLECTION_CARD_TYPE gives that status of the card; otherwise, + * this property should be UNAVAILABLE. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum ElectronicTollCollectionCardStatus + */ + ELECTRONIC_TOLL_COLLECTION_CARD_STATUS = 0x0F3A + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl new file mode 100644 index 0000000000..055f96f2cc --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Property config defines the capabilities of it. User of the API + * must first get the property config to understand the output from get() + * commands and also to ensure that set() or events commands are in sync with + * the expected output. + */ +// @VintfStability +@Backing(type="int") +enum VehiclePropertyAccess { + NONE = 0x00, + + READ = 0x01, + WRITE = 0x02, + READ_WRITE = 0x03, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl new file mode 100644 index 0000000000..2628730179 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * This describes how value of property can change. + */ +// @VintfStability +@Backing(type="int") +enum VehiclePropertyChangeMode { + /** + * Property of this type must never be changed. Subscription is not supported + * for these properties. + */ + STATIC = 0x00, + + /** + * Properties of this type must report when there is a change. + * IVehicle#get call must return the current value. + * Set operation for this property is assumed to be asynchronous. When the + * property is read (using IVehicle#get) after IVehicle#set, it may still + * return old value until underlying H/W backing this property has actually + * changed the state. Once state is changed, the property must dispatch + * changed value as event. + */ + ON_CHANGE = 0x01, + + /** + * Properties of this type change continuously and require a fixed rate of + * sampling to retrieve the data. Implementers may choose to send extra + * notifications on significant value changes. + */ + CONTINUOUS = 0x02, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl new file mode 100644 index 0000000000..529a46da6f --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum VehiclePropertyGroup { + /** + * Properties declared in AOSP must use this flag. + */ + SYSTEM = 0x10000000, + + /** + * Properties declared by vendors must use this flag. + */ + VENDOR = 0x20000000, + + MASK = 0xf0000000, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl new file mode 100644 index 0000000000..6dea0d1e2b --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyStatus.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Property status is a dynamic value that may change based on the vehicle state. + */ +// @VintfStability +@Backing(type="int") +enum VehiclePropertyStatus { + /** Property is available and behaving normally */ + AVAILABLE = 0x00, + /** + * A property in this state is not available for reading and writing. This + * is a transient state that depends on the availability of the underlying + * implementation (e.g. hardware or driver). It MUST NOT be used to + * represent features that this vehicle is always incapable of. A get() of + * a property in this state MAY return an undefined value, but MUST + * correctly describe its status as UNAVAILABLE A set() of a property in + * this state MAY return NOT_AVAILABLE. The HAL implementation MUST ignore + * the value of the status field when writing a property value coming from + * Android. + */ + UNAVAILABLE = 0x01, + /** There is an error with this property. */ + ERROR = 0x02, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyType.aidl new file mode 100644 index 0000000000..4591e9293a --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyType.aidl @@ -0,0 +1,59 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Enumerates supported data type for VehicleProperty. + * + * Used to create property ID in VehicleProperty enum. + */ +// @VintfStability +@Backing(type="int") +enum VehiclePropertyType { + STRING = 0x00100000, + BOOLEAN = 0x00200000, + INT32 = 0x00400000, + INT32_VEC = 0x00410000, + INT64 = 0x00500000, + INT64_VEC = 0x00510000, + FLOAT = 0x00600000, + FLOAT_VEC = 0x00610000, + BYTES = 0x00700000, + + /** + * Any combination of scalar or vector types. The exact format must be + * provided in the description of the property. + * + * For vendor MIXED type properties, configArray needs to be formatted in this + * structure. + * configArray[0], 1 indicates the property has a String value + * configArray[1], 1 indicates the property has a Boolean value . + * configArray[2], 1 indicates the property has an Integer value. + * configArray[3], the number indicates the size of Integer[] in the property. + * configArray[4], 1 indicates the property has a Long value. + * configArray[5], the number indicates the size of Long[] in the property. + * configArray[6], 1 indicates the property has a Float value. + * configArray[7], the number indicates the size of Float[] in the property. + * configArray[8], the number indicates the size of byte[] in the property. + * For example: + * {@code configArray = {1, 1, 1, 3, 0, 0, 0, 0, 0}} indicates the property has + * a String value, a Boolean value, an Integer value and an array with 3 integers. + */ + MIXED = 0x00e00000, + + MASK = 0x00ff0000, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl new file mode 100644 index 0000000000..a17c9f0a86 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by seat occupancy to enumerate the current occupancy state of the seat. + */ +// @VintfStability +@Backing(type="int") +enum VehicleSeatOccupancyState { + UNKNOWN = 0, + VACANT = 1, + OCCUPIED = 2, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl new file mode 100644 index 0000000000..cec86db73c --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +// @VintfStability +@Backing(type="int") +enum VehicleTurnSignal { + NONE = 0x00, + RIGHT = 0x01, + LEFT = 0x02, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl new file mode 100644 index 0000000000..3fc69de766 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl @@ -0,0 +1,60 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Units used for int or float type with no attached enum types. + */ +// @VintfStability +@Backing(type="int") +enum VehicleUnit { + SHOULD_NOT_USE = 0x000, + METER_PER_SEC = 0x01, + RPM = 0x02, + HERTZ = 0x03, + PERCENTILE = 0x10, + MILLIMETER = 0x20, + METER = 0x21, + KILOMETER = 0x23, + MILE = 0x24, + CELSIUS = 0x30, + FAHRENHEIT = 0x31, + KELVIN = 0x32, + MILLILITER = 0x40, + LITER = 0x41, + /** + * deprecated. Use US_GALLON instead. + */ + GALLON = 0x42, + US_GALLON = 0x42, + IMPERIAL_GALLON = 0x43, + NANO_SECS = 0x50, + SECS = 0x53, + YEAR = 0x59, + WATT_HOUR = 0x60, + MILLIAMPERE = 0x61, + MILLIVOLT = 0x62, + MILLIWATTS = 0x63, + AMPERE_HOURS = 0x64, + KILOWATT_HOUR = 0x65, + KILOPASCAL = 0x70, + PSI = 0x71, + BAR = 0x72, + DEGREES = 0x80, + MILES_PER_HOUR = 0x90, + KILOMETERS_PER_HOUR = 0x91, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl new file mode 100644 index 0000000000..46a66e129a --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleVendorPermission.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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by SUPPORT_CUSTOMIZE_VENDOR_PERMISSION to indicate the permission of vendor properties. + */ +// @VintfStability +@Backing(type="int") +enum VehicleVendorPermission { + PERMISSION_DEFAULT = 0x00000000, + PERMISSION_SET_VENDOR_CATEGORY_WINDOW = 0X00000001, + PERMISSION_GET_VENDOR_CATEGORY_WINDOW = 0x00000002, + PERMISSION_SET_VENDOR_CATEGORY_DOOR = 0x00000003, + PERMISSION_GET_VENDOR_CATEGORY_DOOR = 0x00000004, + PERMISSION_SET_VENDOR_CATEGORY_SEAT = 0x00000005, + PERMISSION_GET_VENDOR_CATEGORY_SEAT = 0x00000006, + PERMISSION_SET_VENDOR_CATEGORY_MIRROR = 0x00000007, + PERMISSION_GET_VENDOR_CATEGORY_MIRROR = 0x00000008, + PERMISSION_SET_VENDOR_CATEGORY_INFO = 0x00000009, + PERMISSION_GET_VENDOR_CATEGORY_INFO = 0x0000000A, + PERMISSION_SET_VENDOR_CATEGORY_ENGINE = 0x0000000B, + PERMISSION_GET_VENDOR_CATEGORY_ENGINE = 0x0000000C, + PERMISSION_SET_VENDOR_CATEGORY_HVAC = 0x0000000D, + PERMISSION_GET_VENDOR_CATEGORY_HVAC = 0x0000000E, + PERMISSION_SET_VENDOR_CATEGORY_LIGHT = 0x0000000F, + PERMISSION_GET_VENDOR_CATEGORY_LIGHT = 0x00000010, + PERMISSION_SET_VENDOR_CATEGORY_1 = 0x00010000, + PERMISSION_GET_VENDOR_CATEGORY_1 = 0x00011000, + PERMISSION_SET_VENDOR_CATEGORY_2 = 0x00020000, + PERMISSION_GET_VENDOR_CATEGORY_2 = 0x00021000, + PERMISSION_SET_VENDOR_CATEGORY_3 = 0x00030000, + PERMISSION_GET_VENDOR_CATEGORY_3 = 0x00031000, + PERMISSION_SET_VENDOR_CATEGORY_4 = 0x00040000, + PERMISSION_GET_VENDOR_CATEGORY_4 = 0x00041000, + PERMISSION_SET_VENDOR_CATEGORY_5 = 0x00050000, + PERMISSION_GET_VENDOR_CATEGORY_5 = 0x00051000, + PERMISSION_SET_VENDOR_CATEGORY_6 = 0x00060000, + PERMISSION_GET_VENDOR_CATEGORY_6 = 0x00061000, + PERMISSION_SET_VENDOR_CATEGORY_7 = 0x00070000, + PERMISSION_GET_VENDOR_CATEGORY_7 = 0x00071000, + PERMISSION_SET_VENDOR_CATEGORY_8 = 0x00080000, + PERMISSION_GET_VENDOR_CATEGORY_8 = 0x00081000, + PERMISSION_SET_VENDOR_CATEGORY_9 = 0x00090000, + PERMISSION_GET_VENDOR_CATEGORY_9 = 0x00091000, + PERMISSION_SET_VENDOR_CATEGORY_10 = 0x000A0000, + PERMISSION_GET_VENDOR_CATEGORY_10 = 0x000A1000, + PERMISSION_NOT_ACCESSIBLE = 0xF0000000, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl new file mode 100644 index 0000000000..74e944ddb7 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VmsBaseMessageIntegerValuesIndex; + +/** + * An availability state is sent to the subscribers in response to a change in the available + * layers as part of a VmsMessageType.AVAILABILITY_CHANGE message, or in response to a + * VmsMessageType.AVAILABILITY_REQUEST message as part of a VmsMessageType.AVAILABILITY_RESPONSE. + * The VMS service issues monotonically increasing sequence numbers, and in case a subscriber + * receives a smaller sequence number, it should ignore the message. An available associated layer + * is a layer with a list of publisher IDs: + * - Layer type + * - Layer subtype + * - Layer version + * - Number of publisher IDs (N) + * - N x publisher ID + */ +// @VintfStability +@Backing(type="int") +enum VmsAvailabilityStateIntegerValuesIndex { + /* + * The message type as enumerated by VmsMessageType enum. + */ + MESSAGE_TYPE = 0, + SEQUENCE_NUMBER = 1, + NUMBER_OF_ASSOCIATED_LAYERS = 2, + LAYERS_START = 3, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl new file mode 100644 index 0000000000..a3a2e18759 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Every VMS message starts with the type of the message from the VmsMessageType enum. + * Messages with no parameters such as VmsMessageType.AVAILABILITY_REQUEST, + * VmsMessageType.SUBSCRIPTIONS_REQUEST and VmsMessageType.DATA are also based on this enum. + */ +// @VintfStability +@Backing(type="int") +enum VmsBaseMessageIntegerValuesIndex { + /* + * The message type as enumerated by VmsMessageType enum. + */ + MESSAGE_TYPE = 0, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageType.aidl new file mode 100644 index 0000000000..bdffde7a6f --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageType.aidl @@ -0,0 +1,141 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * This enum lists the types of supported VMS messages. It is used as the first + * integer in the vehicle property integers array and determines how the rest of + * the message is decoded. + */ +// @VintfStability +@Backing(type="int") +enum VmsMessageType { + /** + * A request from the subscribers to the VMS service to subscribe to a layer. + * + * This message type uses enum VmsMessageWithLayerIntegerValuesIndex. + */ + SUBSCRIBE = 1, + /** + * A request from the subscribers to the VMS service to subscribe to a layer from a specific + * publisher. + * + * This message type uses enum VmsMessageWithLayerAndPublisherIdIntegerValuesIndex. + */ + SUBSCRIBE_TO_PUBLISHER = 2, + /** + * A request from the subscribers to the VMS service to unsubscribes from a layer. + * + * This message type uses enum VmsMessageWithLayerIntegerValuesIndex. + */ + UNSUBSCRIBE = 3, + /** + * A request from the subscribers to the VMS service to unsubscribes from a layer from a + * specific publisher. + * + * This message type uses enum VmsMessageWithLayerAndPublisherIdIntegerValuesIndex. + */ + UNSUBSCRIBE_TO_PUBLISHER = 4, + /** + * Information from the publishers to the VMS service about the layers which the client can + * publish. + * + * This message type uses enum VmsOfferingMessageIntegerValuesIndex. + */ + OFFERING = 5, + /** + * A request from the subscribers to the VMS service to get the available layers. + * + * This message type uses enum VmsBaseMessageIntegerValuesIndex. + */ + AVAILABILITY_REQUEST = 6, + /** + * A request from the publishers to the VMS service to get the layers with subscribers. + * + * This message type uses enum VmsBaseMessageIntegerValuesIndex. + */ + SUBSCRIPTIONS_REQUEST = 7, + /** + * A response from the VMS service to the subscribers to a VmsMessageType.AVAILABILITY_REQUEST + * + * This message type uses enum VmsAvailabilityStateIntegerValuesIndex. + */ + AVAILABILITY_RESPONSE = 8, + /** + * A notification from the VMS service to the subscribers on a change in the available layers. + * + * This message type uses enum VmsAvailabilityStateIntegerValuesIndex. + */ + AVAILABILITY_CHANGE = 9, + /** + * A response from the VMS service to the publishers to a VmsMessageType.SUBSCRIPTIONS_REQUEST + * + * This message type uses enum VmsSubscriptionsStateIntegerValuesIndex. + */ + SUBSCRIPTIONS_RESPONSE = 10, + /** + * A notification from the VMS service to the publishers on a change in the layers with + * subscribers. + * + * This message type uses enum VmsSubscriptionsStateIntegerValuesIndex. + */ + SUBSCRIPTIONS_CHANGE = 11, + /** + * A message from the VMS service to the subscribers or from the publishers to the VMS service + * with a serialized VMS data packet as defined in the VMS protocol. + * + * This message type uses enum VmsMessageWithLayerAndPublisherIdIntegerValuesIndex. + */ + DATA = 12, + /** + * A request from the publishers to the VMS service to get a Publisher ID for a serialized VMS + * provider description packet as defined in the VMS protocol. + * + * This message type uses enum VmsBaseMessageIntegerValuesIndex. + */ + PUBLISHER_ID_REQUEST = 13, + /** + * A response from the VMS service to the publisher that contains a provider description packet + * and the publisher ID assigned to it. + * + * This message type uses enum VmsPublisherInformationIntegerValuesIndex. + */ + PUBLISHER_ID_RESPONSE = 14, + /** + * A request from the subscribers to the VMS service to get information for a Publisher ID. + * + * This message type uses enum VmsPublisherInformationIntegerValuesIndex. + */ + PUBLISHER_INFORMATION_REQUEST = 15, + /** + * A response from the VMS service to the subscribers that contains a provider description + * packet and the publisher ID assigned to it. + * + * This message type uses enum VmsPublisherInformationIntegerValuesIndex. + */ + PUBLISHER_INFORMATION_RESPONSE = 16, + /** + * A notification indicating that the sender has been reset. + * + * The receiving party must reset its internal state and respond to the + * sender with a START_SESSION message as acknowledgement. + * + * This message type uses enum VmsStartSessionMessageIntegerValuesIndex. + */ + START_SESSION = 17, + // LAST_VMS_MESSAGE_TYPE = START_SESSION, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl new file mode 100644 index 0000000000..594ddbc303 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VmsMessageWithLayerIntegerValuesIndex; + +/* + * A VMS message with a layer and publisher ID is sent as part of a + * VmsMessageType.SUBSCRIBE_TO_PUBLISHER, VmsMessageType.UNSUBSCRIBE_TO_PUBLISHER messages and + * VmsMessageType.DATA . + */ +// @VintfStability +@Backing(type="int") +enum VmsMessageWithLayerAndPublisherIdIntegerValuesIndex { + /* + * The message type as enumerated by VmsMessageType enum. + */ + MESSAGE_TYPE = 0, + LAYER_TYPE = 1, + LAYER_SUBTYPE = 2, + LAYER_VERSION = 3, + PUBLISHER_ID = 4, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl new file mode 100644 index 0000000000..e3a6126502 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VmsBaseMessageIntegerValuesIndex; + +/* + * A VMS message with a layer is sent as part of a VmsMessageType.SUBSCRIBE or + * VmsMessageType.UNSUBSCRIBE messages. + * + * The layer type is defined in the VMS protocol, and the subtype and version are + * controlled by the implementer of the publisher. + */ +// @VintfStability +@Backing(type="int") +enum VmsMessageWithLayerIntegerValuesIndex { + /* + * The message type as enumerated by VmsMessageType enum. + */ + MESSAGE_TYPE = 0, + LAYER_TYPE = 1, + LAYER_SUBTYPE = 2, + LAYER_VERSION = 3, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl new file mode 100644 index 0000000000..9dc7a58736 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VmsBaseMessageIntegerValuesIndex; + +/* + * An offering can be sent by publishers as part of VmsMessageType.OFFERING in order to + * advertise which layers they can publish and under which constraints: e.g., I can publish Layer X + * if someone else will publish Layer Y. + * The offering contains the publisher ID which was assigned to the publisher by the VMS service. + * A single offering is represented as: + * - Layer type + * - Layer subtype + * - Layer version + * - Number of dependencies (N) + * - N x (Layer type, Layer subtype, Layer version) + */ +// @VintfStability +@Backing(type="int") +enum VmsOfferingMessageIntegerValuesIndex { + /* + * The message type as enumerated by VmsMessageType enum. + */ + MESSAGE_TYPE = 0, + PUBLISHER_ID = 1, + NUMBER_OF_OFFERS = 2, + OFFERING_START = 3, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl new file mode 100644 index 0000000000..32049ccb0b --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VmsBaseMessageIntegerValuesIndex; + +/* + * Publishers send the VMS service their information and assigned in response a publisher ID. + * Subscribers can request the publisher information for a publisher ID they received in other + * messages. + */ +// @VintfStability +@Backing(type="int") +enum VmsPublisherInformationIntegerValuesIndex { + /* + * The message type as enumerated by VmsMessageType enum. + */ + MESSAGE_TYPE = 0, + PUBLISHER_ID = 1, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl new file mode 100644 index 0000000000..95f2d6d597 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl @@ -0,0 +1,53 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VmsBaseMessageIntegerValuesIndex; + +/* + * Handshake data sent as part of a VmsMessageType.START_SESSION message. + * + * A new session is initiated by sending a START_SESSION message with the + * sender's identifier populated and the receiver's identifier set to -1. + * + * Identifier values are independently generated, but must be non-negative, and + * increase monotonically between reboots. + * + * Upon receiving a START_SESSION with a mis-matching identifier, the receiver + * must clear any cached VMS offering or subscription state and acknowledge the + * new session by responding with a START_SESSION message that populates both + * identifier fields. + * + * Any VMS messages received between initiation and completion of the handshake + * must be discarded. + */ +// @VintfStability +@Backing(type="int") +enum VmsStartSessionMessageIntegerValuesIndex { + /* + * The message type as enumerated by VmsMessageType enum. + */ + MESSAGE_TYPE = 0, + /* + * Identifier field for the Android system service. + */ + SERVICE_ID = 1, + /* + * Identifier field for the HAL client process. + */ + CLIENT_ID = 2, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl new file mode 100644 index 0000000000..87d59e5471 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl @@ -0,0 +1,50 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VmsBaseMessageIntegerValuesIndex; + +/** + * A subscriptions state is sent to the publishers in response to a change in the subscriptions + * as part of a VmsMessageType.SUBSCRIPTIONS_CHANGE, or in response to a + * VmsMessageType.SUBSCRIPTIONS_REQUEST message as part of VmsMessageType.SUBSCRIPTIONS_RESPONSE. + * The VMS service issues monotonically increasing sequence numbers, and in case a subscriber + * receives a smaller sequence number it should ignore the message. The subscriptions are sent as a + * list of layers followed by a list of associated layers: {Sequence number, N, M, N x layer, M x + * associated layer} A subscribed layer is represented as three integers: + * - Layer type + * - Layer subtype + * - Layer version + * A subscribed associated layer is a layer with a list of publisher IDs. It is represented as: + * - Layer type + * - Layer subtype + * - Layer version + * - Number of publisher IDs (N) + * - N x publisher ID + */ +// @VintfStability +@Backing(type="int") +enum VmsSubscriptionsStateIntegerValuesIndex { + /* + * The message type as enumerated by VmsMessageType enum. + */ + MESSAGE_TYPE = 0, + SEQUENCE_NUMBER = 1, + NUMBER_OF_LAYERS = 2, + NUMBER_OF_ASSOCIATED_LAYERS = 3, + SUBSCRIPTIONS_START = 4, +} diff --git a/automotive/vehicle/tools/translate_vehicle_props.py b/automotive/vehicle/tools/translate_vehicle_props.py new file mode 100644 index 0000000000..59eb17d981 --- /dev/null +++ b/automotive/vehicle/tools/translate_vehicle_props.py @@ -0,0 +1,151 @@ +#!/usr/bin/python + +# 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. +# +"""Tools to translate VehicleProperty from types.hal into AIDL format. + To store it to a file: + $ python translate_vehicle_props.py types.hal > VehicleProperty.aidl +""" +import re +import sys + +ENUM_TYPE_TO_PARSE = [ "VehiclePropertyType", "VehiclePropertyGroup", "VehicleArea" ] +VEHICLE_PROP_ENUM = "VehicleProperty" + +RE_COMMENT_BEGIN = re.compile("\s*\/\*\*") +RE_COMMENT_END = re.compile("\s*\*\/") +RE_COMMENT_SINGLE_LINE = re.compile("\s*\/\*\*.*\*\/") + +RE_ENUM_START = re.compile("\s*enum\s*(\w+)\s?.*\{") +RE_ENUM_END = re.compile("\s*\}\;") + +RE_ENUM_ELEMENT = re.compile("\s*(\w+)\s*\=\s*(\w+),") + +RE_VEHICLE_PROP_ELEMENT = re.compile("\s*(\w+)\s*\=\s*\(?\s*(\w+)\s*\|?\s*(\w+\:\w+)?\s*\|?\s*(\w+:\w+)?\s*\|?\s*(\w+:\w+)?\s*\)?,") + +DBG_COMMENT = False +DBG_ENUM = False + +class HIDLParser: + def __init__(self): + self.inEnum = False + self.currentEnumName = None + self.inVehicleProperty = False + self.inComment = False + self.recentComments = [] + self.currentType = None + self.enumMap = {} + self.outputMsg = [] + self.multilineFormat = [] + self.outputMsg.append("package android.hardware.automotive.vehicle\n\n") + + def addRecentCommentToMsg(self): + self.outputMsg.extend(self.recentComments) + self.recentComments = [] + + def addToMsg(self, msg): + self.outputMsg.append(msg) + + def printOutputMsg(self): + msg = "".join(self.outputMsg) + print(msg) + + def parseLine(self, line): + if self.inComment: + self.recentComments.append(line) + if RE_COMMENT_END.match(line): + self.inComment = False + if DBG_COMMENT: + print("Comment end:{}".format(self.recentComments)) + return + elif RE_COMMENT_BEGIN.match(line): + self.recentComments = [] + self.recentComments.append(line) + if RE_COMMENT_SINGLE_LINE.match(line): + if DBG_COMMENT: + print("Single line Comment:{}".format(self.recentComments)) + return + self.inComment = True + if DBG_COMMENT: + print("Comment start") + return + + if self.inEnum: + if RE_ENUM_END.match(line): + self.inEnum = False + if DBG_ENUM: + print("End enum {}".format(self.currentEnumName)) + else: + matchElement = RE_ENUM_ELEMENT.match(line); + if matchElement: + elementName = matchElement.group(1) + elementValue = matchElement.group(2) + self.enumMap[self.currentEnumName + ':' + elementName] = elementValue + elif self.inVehicleProperty: + if RE_ENUM_END.match(line): + self.inVehicleProperty = False + self.addToMsg("}\n") + else: + text = line.strip() + if len(text) == 0: + self.multilineFormat = [] + else: + self.multilineFormat.append(text) + textToMatch = "".join(self.multilineFormat) + match = RE_VEHICLE_PROP_ELEMENT.match(textToMatch) + if match: + self.multilineFormat = [] + name = match.group(1) + val = match.group(2) + type1 = match.group(3) + self.addRecentCommentToMsg() + if type1 == None: # one line case + self.addToMsg(" {} = {},\n".format(name, val)) + else: + type2 = match.group(4) + type3 = match.group(5) + self.addToMsg(" {} = {} + {} + {} + {}, // {},{},{}\n".\ + format(name, val, self.enumMap[type1], self.enumMap[type3],\ + self.enumMap[type2], type1, type3, type2)) + else: + matchEnum = RE_ENUM_START.match(line) + if matchEnum: + enumName = matchEnum.group(1) + if enumName in ENUM_TYPE_TO_PARSE: + self.currentEnumName = enumName + self.inEnum = True + if DBG_ENUM: + print("enum {}".format(enumName)) + elif enumName == VEHICLE_PROP_ENUM: + self.inVehicleProperty = True + self.addRecentCommentToMsg() + self.addToMsg("@Backing(type=\"int\")\nenum VehicleProperty {\n") + if DBG_ENUM: + print("VehicleProperty starts, all enum values {}".format(self.enumMap)) + + +def main(): + if len(sys.argv) != 2: + print("Usage: {} types_hal_file".format(sys.argv[0])) + sys.exit(1) + file_name = sys.argv[1] + with open(file_name, 'r') as f: + parser = HIDLParser() + for line in f.readlines(): + parser.parseLine(line) + parser.printOutputMsg() + +if __name__ == "__main__": + main() diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 1d7de247fc..d4b49af8f4 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -85,6 +85,13 @@ default + + android.hardware.automotive.vehicle + + IVehicle + .* + + android.hardware.automotive.vehicle 2.0 -- GitLab From f8dcd3f1e45547b83d0f7017ad9be2c6e035b501 Mon Sep 17 00:00:00 2001 From: Lais Andrade Date: Tue, 15 Jun 2021 15:40:12 +0000 Subject: [PATCH 059/825] Update AIDL vibrator version for benchmarks Change-Id: I2574bf18b633feedbc0484a347360b3bc89b9dfd Fix: 191147627 Test: VibratorHalIntegrationBenchmark --- vibrator/bench/Android.bp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vibrator/bench/Android.bp b/vibrator/bench/Android.bp index e4c9cfb33d..73e274fe41 100644 --- a/vibrator/bench/Android.bp +++ b/vibrator/bench/Android.bp @@ -29,7 +29,7 @@ cc_benchmark { "benchmark.cpp", ], shared_libs: [ - "android.hardware.vibrator-V1-cpp", + "android.hardware.vibrator-V2-cpp", "android.hardware.vibrator@1.0", "android.hardware.vibrator@1.1", "android.hardware.vibrator@1.2", -- GitLab From 14a301837172d25463fe1d58f3031d888ec354d4 Mon Sep 17 00:00:00 2001 From: Yuchen He Date: Thu, 10 Jun 2021 17:10:15 -0700 Subject: [PATCH 060/825] Refactor and reuse some read device file logic Add skeleton on HAL for Gnss raw measurement injection Bug: 190757198 Test: manual test Change-Id: I9b58043d5ed321aa71ff4f23031df251ae89c407 --- .../aidl/default/GnssMeasurementInterface.cpp | 21 ++++- gnss/common/utils/default/Android.bp | 1 + gnss/common/utils/default/GnssReplayUtils.cpp | 88 +++++++++++++++++++ gnss/common/utils/default/include/Constants.h | 12 +++ .../utils/default/include/GnssReplayUtils.h | 54 ++++++++++++ .../utils/default/include/NmeaFixInfo.h | 7 -- .../utils/default/include/v2_1/GnssTemplate.h | 42 ++------- 7 files changed, 178 insertions(+), 47 deletions(-) create mode 100644 gnss/common/utils/default/GnssReplayUtils.cpp create mode 100644 gnss/common/utils/default/include/GnssReplayUtils.h diff --git a/gnss/aidl/default/GnssMeasurementInterface.cpp b/gnss/aidl/default/GnssMeasurementInterface.cpp index fcc1f986cc..0e489c59e4 100644 --- a/gnss/aidl/default/GnssMeasurementInterface.cpp +++ b/gnss/aidl/default/GnssMeasurementInterface.cpp @@ -19,11 +19,13 @@ #include "GnssMeasurementInterface.h" #include #include +#include "GnssReplayUtils.h" #include "Utils.h" namespace aidl::android::hardware::gnss { using Utils = ::android::hardware::gnss::common::Utils; +using ReplayUtils = ::android::hardware::gnss::common::ReplayUtils; std::shared_ptr GnssMeasurementInterface::sCallback = nullptr; @@ -63,9 +65,22 @@ void GnssMeasurementInterface::start(const bool enableCorrVecOutputs) { mIsActive = true; mThread = std::thread([this, enableCorrVecOutputs]() { while (mIsActive == true) { - auto measurement = Utils::getMockMeasurement(enableCorrVecOutputs); - this->reportMeasurement(measurement); - + std::string rawMeasurementStr = ""; + if (ReplayUtils::hasGnssDeviceFile() && + ReplayUtils::isGnssRawMeasurement( + rawMeasurementStr = ReplayUtils::getDataFromDeviceFile( + std::string( + ::android::hardware::gnss::common::CMD_GET_RAWMEASUREMENT), + mMinIntervalMillis))) { + // TODO: implement rawMeasurementStr parser and report measurement. + ALOGD("rawMeasurementStr(size: %zu) from device file: %s", rawMeasurementStr.size(), + rawMeasurementStr.c_str()); + auto measurement = Utils::getMockMeasurement(enableCorrVecOutputs); + this->reportMeasurement(measurement); + } else { + auto measurement = Utils::getMockMeasurement(enableCorrVecOutputs); + this->reportMeasurement(measurement); + } std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMillis)); } }); diff --git a/gnss/common/utils/default/Android.bp b/gnss/common/utils/default/Android.bp index 43db8739d1..f9225c24d0 100644 --- a/gnss/common/utils/default/Android.bp +++ b/gnss/common/utils/default/Android.bp @@ -41,6 +41,7 @@ cc_library_static { "MockLocation.cpp", "Utils.cpp", "NmeaFixInfo.cpp", + "GnssReplayUtils.cpp", ], export_include_dirs: ["include"], shared_libs: [ diff --git a/gnss/common/utils/default/GnssReplayUtils.cpp b/gnss/common/utils/default/GnssReplayUtils.cpp new file mode 100644 index 0000000000..6dcf6ea252 --- /dev/null +++ b/gnss/common/utils/default/GnssReplayUtils.cpp @@ -0,0 +1,88 @@ +/* + * 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 "GnssReplayUtils.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace common { + +const char* ReplayUtils::getGnssPath() { + const char* gnss_dev_path = GNSS_PATH; + char devname_value[PROPERTY_VALUE_MAX] = ""; + if (property_get("debug.location.gnss.devname", devname_value, NULL) > 0) { + gnss_dev_path = devname_value; + } + return gnss_dev_path; +} + +bool ReplayUtils::hasGnssDeviceFile() { + struct stat sb; + return stat(getGnssPath(), &sb) != -1; +} + +bool ReplayUtils::isGnssRawMeasurement(const std::string& inputStr) { + // TODO: add more logic check to by pass invalid data. + return !inputStr.empty() && (inputStr.find("Raw") != std::string::npos); +} + +bool ReplayUtils::isNMEA(const std::string& inputStr) { + return !inputStr.empty() && + (inputStr.rfind("$GPRMC,", 0) == 0 || inputStr.rfind("$GPRMA,", 0) == 0); +} + +std::string ReplayUtils::getDataFromDeviceFile(const std::string& command, int mMinIntervalMs) { + char inputBuffer[INPUT_BUFFER_SIZE]; + int mGnssFd = open(getGnssPath(), O_RDWR | O_NONBLOCK); + + if (mGnssFd == -1) { + return ""; + } + + int bytes_write = write(mGnssFd, command.c_str(), command.size()); + if (bytes_write <= 0) { + return ""; + } + + struct epoll_event ev, events[1]; + ev.data.fd = mGnssFd; + ev.events = EPOLLIN; + int epoll_fd = epoll_create1(0); + epoll_ctl(epoll_fd, EPOLL_CTL_ADD, mGnssFd, &ev); + int bytes_read = -1; + std::string inputStr = ""; + int epoll_ret = epoll_wait(epoll_fd, events, 1, mMinIntervalMs); + + if (epoll_ret == -1) { + return ""; + } + while (true) { + memset(inputBuffer, 0, INPUT_BUFFER_SIZE); + bytes_read = read(mGnssFd, &inputBuffer, INPUT_BUFFER_SIZE); + if (bytes_read <= 0) { + break; + } + inputStr += std::string(inputBuffer, bytes_read); + } + + return inputStr; +} + +} // namespace common +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/gnss/common/utils/default/include/Constants.h b/gnss/common/utils/default/include/Constants.h index a290ed243f..75811662e8 100644 --- a/gnss/common/utils/default/include/Constants.h +++ b/gnss/common/utils/default/include/Constants.h @@ -30,6 +30,18 @@ const float kMockSpeedAccuracyMetersPerSecond = 1; const float kMockBearingAccuracyDegrees = 90; const int64_t kMockTimestamp = 1519930775453L; +// Location replay constants +constexpr char GNSS_PATH[] = "/dev/gnss0"; +constexpr int INPUT_BUFFER_SIZE = 256; +constexpr char CMD_GET_LOCATION[] = "CMD_GET_LOCATION"; +constexpr char CMD_GET_RAWMEASUREMENT[] = "CMD_GET_RAWMEASUREMENT"; +constexpr char LINE_SEPARATOR = '\n'; +constexpr char COMMA_SEPARATOR = ','; +constexpr char GPGA_RECORD_TAG[] = "$GPGGA"; +constexpr char GPRMC_RECORD_TAG[] = "$GPRMC"; +constexpr double TIMESTAMP_EPSILON = 0.001; +constexpr int MIN_COL_NUM = 13; + } // namespace common } // namespace gnss } // namespace hardware diff --git a/gnss/common/utils/default/include/GnssReplayUtils.h b/gnss/common/utils/default/include/GnssReplayUtils.h new file mode 100644 index 0000000000..d7530f741a --- /dev/null +++ b/gnss/common/utils/default/include/GnssReplayUtils.h @@ -0,0 +1,54 @@ +/* + * 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_gnss_common_GnssReplayUtils_H_ +#define android_hardware_gnss_common_GnssReplayUtils_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Constants.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace common { + +struct ReplayUtils { + static const char* getGnssPath(); + + static std::string getDataFromDeviceFile(const std::string& command, int mMinIntervalMs); + + static bool hasGnssDeviceFile(); + + static bool isGnssRawMeasurement(const std::string& inputStr); + + static bool isNMEA(const std::string& inputStr); +}; + +} // namespace common +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // android_hardware_gnss_common_GnssReplayUtils_H_ diff --git a/gnss/common/utils/default/include/NmeaFixInfo.h b/gnss/common/utils/default/include/NmeaFixInfo.h index c96eecea00..5c27045316 100644 --- a/gnss/common/utils/default/include/NmeaFixInfo.h +++ b/gnss/common/utils/default/include/NmeaFixInfo.h @@ -27,13 +27,6 @@ namespace hardware { namespace gnss { namespace common { -constexpr char GPGA_RECORD_TAG[] = "$GPGGA"; -constexpr char GPRMC_RECORD_TAG[] = "$GPRMC"; -constexpr char LINE_SEPARATOR = '\n'; -constexpr char COMMA_SEPARATOR = ','; -constexpr double TIMESTAMP_EPSILON = 0.001; -constexpr int MIN_COL_NUM = 13; - /** Helper class to parse and store the GNSS fix details information. */ class NmeaFixInfo { private: diff --git a/gnss/common/utils/default/include/v2_1/GnssTemplate.h b/gnss/common/utils/default/include/v2_1/GnssTemplate.h index a1d698167c..e87a7f4f6a 100644 --- a/gnss/common/utils/default/include/v2_1/GnssTemplate.h +++ b/gnss/common/utils/default/include/v2_1/GnssTemplate.h @@ -35,6 +35,7 @@ #include "GnssDebug.h" #include "GnssMeasurement.h" #include "GnssMeasurementCorrections.h" +#include "GnssReplayUtils.h" #include "MockLocation.h" #include "NmeaFixInfo.h" #include "Utils.h" @@ -158,15 +159,9 @@ GnssTemplate::~GnssTemplate() { template std::unique_ptr GnssTemplate::getLocationFromHW() { - char inputBuffer[INPUT_BUFFER_SIZE]; if (!mHardwareModeChecked) { - // default using gnss0 - const char * gnss_dev_path = GNSS_PATH; - char devname_value[PROPERTY_VALUE_MAX] = ""; - if (property_get("debug.location.gnss.devname", devname_value, NULL) > 0) { - gnss_dev_path = devname_value; - ALOGD("using %s instead of the default %s", gnss_dev_path, GNSS_PATH); - } + // default using /dev/gnss0 + const char* gnss_dev_path = ReplayUtils::getGnssPath(); mGnssFd = open(gnss_dev_path, O_RDWR | O_NONBLOCK); if (mGnssFd == -1) { @@ -175,35 +170,8 @@ std::unique_ptr GnssTemplate::getLocationFromHW() { mHardwareModeChecked = true; } - if (mGnssFd == -1) { - return nullptr; - } - - int bytes_write = write(mGnssFd, CMD_GET_LOCATION, strlen(CMD_GET_LOCATION)); - if (bytes_write <= 0) { - return nullptr; - } - - struct epoll_event ev, events[1]; - ev.data.fd = mGnssFd; - ev.events = EPOLLIN; - int epoll_fd = epoll_create1(0); - epoll_ctl(epoll_fd, EPOLL_CTL_ADD, mGnssFd, &ev); - int bytes_read = -1; - std::string inputStr = ""; - int epoll_ret = epoll_wait(epoll_fd, events, 1, mMinIntervalMs); - - if (epoll_ret == -1) { - return nullptr; - } - while (true) { - memset(inputBuffer, 0, INPUT_BUFFER_SIZE); - bytes_read = read(mGnssFd, &inputBuffer, INPUT_BUFFER_SIZE); - if (bytes_read <= 0) { - break; - } - inputStr += std::string(inputBuffer, bytes_read); - } + std::string inputStr = ::android::hardware::gnss::common::ReplayUtils::getDataFromDeviceFile( + CMD_GET_LOCATION, mMinIntervalMs); return NmeaFixInfo::getLocationFromInputStr(inputStr); } -- GitLab From 9624ae08ae44c1ae7a77e49176885f2dbd11550b Mon Sep 17 00:00:00 2001 From: Evgenii Stepanov Date: Mon, 21 Jun 2021 15:47:59 -0700 Subject: [PATCH 061/825] Fingerprint service example - import all deps. Must include all parent classes in HIDL. As is, this code breaks in HWASan, and most likely will break with -O0. Bug: none Test: build aosp_cf_arm64_phone-userdebug with SANITIZE_TARGET=hwaddress Change-Id: I93e6990e758e5ae899ba15606e53f6ad7993d01d --- biometrics/fingerprint/2.2/default/Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/biometrics/fingerprint/2.2/default/Android.bp b/biometrics/fingerprint/2.2/default/Android.bp index f4fb57f20c..2d262f01f5 100644 --- a/biometrics/fingerprint/2.2/default/Android.bp +++ b/biometrics/fingerprint/2.2/default/Android.bp @@ -25,6 +25,7 @@ cc_binary { "libhidlbase", "libhardware", "libutils", + "android.hardware.biometrics.fingerprint@2.1", "android.hardware.biometrics.fingerprint@2.2", ], -- GitLab From 882c00f47d88a772420a66a9ff283671990b6e29 Mon Sep 17 00:00:00 2001 From: ramindani Date: Thu, 17 Jun 2021 22:17:36 +0000 Subject: [PATCH 062/825] Add test in VTS MapperV4 for YCbCr_P010 Fixed comments. Test: atest VtsHalGraphicsMapperV4_0TargetTest BUG=181069130 Change-Id: I7c4f8edc20e8772c4a393b03e934868a0b963b2b Change-Id: Idba57d496051f6a4f92748267e4ae4b13f8f98fb --- .../VtsHalGraphicsMapperV4_0TargetTest.cpp | 172 ++++++++++++++++-- 1 file changed, 154 insertions(+), 18 deletions(-) diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp index f55a6b77ed..e18b1faa9f 100644 --- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp +++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp @@ -59,6 +59,12 @@ using aidl::android::hardware::graphics::common::StandardMetadataType; using DecodeFunction = std::function& vec)>; +struct YCbCr { + android_ycbcr yCbCr; + int64_t horizontalSubSampling; + int64_t verticalSubSampling; +}; + class GraphicsMapperHidlTest : public ::testing::TestWithParam> { protected: @@ -215,8 +221,8 @@ class GraphicsMapperHidlTest } ASSERT_EQ(0, planeLayoutComponent.offsetInBits % 8); - uint8_t* tmpData = - data + planeLayout.offsetInBytes + (planeLayoutComponent.offsetInBits / 8); + uint8_t* tmpData = data + planeLayout.offsetInBytes + + bitsToBytes(planeLayoutComponent.offsetInBits); uint64_t sampleIncrementInBytes; auto type = static_cast(planeLayoutComponent.type.value); @@ -271,6 +277,96 @@ class GraphicsMapperHidlTest ASSERT_NE(nullptr, outYCbCr->cr); } + YCbCr getAndroidYCbCr_P010(const native_handle_t* bufferHandle, uint8_t* data) { + YCbCr yCbCr_P010; + hidl_vec vec; + EXPECT_EQ(Error::NONE, + mGralloc->get(bufferHandle, gralloc4::MetadataType_PlaneLayouts, &vec)); + std::vector planeLayouts; + EXPECT_EQ(NO_ERROR, gralloc4::decodePlaneLayouts(vec, &planeLayouts)); + EXPECT_EQ(2, planeLayouts.size()); + EXPECT_EQ(1, planeLayouts[0].components.size()); + EXPECT_EQ(2, planeLayouts[1].components.size()); + + yCbCr_P010.yCbCr.y = nullptr; + yCbCr_P010.yCbCr.cb = nullptr; + yCbCr_P010.yCbCr.cr = nullptr; + yCbCr_P010.yCbCr.ystride = 0; + yCbCr_P010.yCbCr.cstride = 0; + yCbCr_P010.yCbCr.chroma_step = 0; + int64_t cb_offset = 0; + int64_t cr_offset = 0; + + for (const auto& planeLayout : planeLayouts) { + for (const auto& planeLayoutComponent : planeLayout.components) { + if (!gralloc4::isStandardPlaneLayoutComponentType(planeLayoutComponent.type)) { + continue; + } + + uint8_t* tmpData = data + planeLayout.offsetInBytes + + bitsToBytes(planeLayoutComponent.offsetInBits); + uint64_t sampleIncrementInBytes = 0; + auto type = static_cast(planeLayoutComponent.type.value); + switch (type) { + case PlaneLayoutComponentType::Y: + // For specs refer: + // https://docs.microsoft.com/en-us/windows/win32/medfound/10-bit-and-16-bit-yuv-video-formats + EXPECT_EQ(6, planeLayoutComponent.offsetInBits); + EXPECT_EQ(nullptr, yCbCr_P010.yCbCr.y); + EXPECT_EQ(10, planeLayoutComponent.sizeInBits); + EXPECT_EQ(16, planeLayout.sampleIncrementInBits); + + yCbCr_P010.yCbCr.y = tmpData; + yCbCr_P010.yCbCr.ystride = planeLayout.strideInBytes; + break; + + case PlaneLayoutComponentType::CB: + case PlaneLayoutComponentType::CR: + sampleIncrementInBytes = bitsToBytes(planeLayout.sampleIncrementInBits); + EXPECT_EQ(4, sampleIncrementInBytes); + + if (yCbCr_P010.yCbCr.cstride == 0 && yCbCr_P010.yCbCr.chroma_step == 0) { + yCbCr_P010.yCbCr.cstride = planeLayout.strideInBytes; + yCbCr_P010.yCbCr.chroma_step = sampleIncrementInBytes; + } else { + EXPECT_EQ(yCbCr_P010.yCbCr.cstride, planeLayout.strideInBytes); + EXPECT_EQ(yCbCr_P010.yCbCr.chroma_step, sampleIncrementInBytes); + } + + if (yCbCr_P010.horizontalSubSampling == 0 && + yCbCr_P010.verticalSubSampling == 0) { + yCbCr_P010.horizontalSubSampling = planeLayout.horizontalSubsampling; + yCbCr_P010.verticalSubSampling = planeLayout.verticalSubsampling; + } else { + EXPECT_EQ(yCbCr_P010.horizontalSubSampling, + planeLayout.horizontalSubsampling); + EXPECT_EQ(yCbCr_P010.verticalSubSampling, + planeLayout.verticalSubsampling); + } + + if (type == PlaneLayoutComponentType::CB) { + EXPECT_EQ(nullptr, yCbCr_P010.yCbCr.cb); + yCbCr_P010.yCbCr.cb = tmpData; + cb_offset = planeLayoutComponent.offsetInBits; + } else { + EXPECT_EQ(nullptr, yCbCr_P010.yCbCr.cr); + yCbCr_P010.yCbCr.cr = tmpData; + cr_offset = planeLayoutComponent.offsetInBits; + } + break; + default: + break; + }; + } + } + + EXPECT_EQ(cb_offset + bytesToBits(2), cr_offset); + EXPECT_NE(nullptr, yCbCr_P010.yCbCr.y); + EXPECT_NE(nullptr, yCbCr_P010.yCbCr.cb); + EXPECT_NE(nullptr, yCbCr_P010.yCbCr.cr); + return yCbCr_P010; + } + void fillRGBA8888(uint8_t* data, uint32_t height, size_t strideInBytes, size_t widthInBytes, uint32_t seed = 0) { for (uint32_t y = 0; y < height; y++) { @@ -297,9 +393,9 @@ class GraphicsMapperHidlTest } } - void traverseYCbCr888Data(const android_ycbcr& yCbCr, int32_t width, int32_t height, - int64_t hSubsampling, int64_t vSubsampling, - std::function traverseFuncion) { + void traverseYCbCrData(const android_ycbcr& yCbCr, int32_t width, int32_t height, + int64_t hSubsampling, int64_t vSubsampling, + std::function traverseFuncion) { auto yData = static_cast(yCbCr.y); auto cbData = static_cast(yCbCr.cb); auto crData = static_cast(yCbCr.cr); @@ -327,21 +423,25 @@ class GraphicsMapperHidlTest } } - void fillYCbCr888Data(const android_ycbcr& yCbCr, int32_t width, int32_t height, - int64_t hSubsampling, int64_t vSubsampling) { - traverseYCbCr888Data(yCbCr, width, height, hSubsampling, vSubsampling, - [](auto address, auto fillingData) { *address = fillingData; }); + void fillYCbCrData(const android_ycbcr& yCbCr, int32_t width, int32_t height, + int64_t hSubsampling, int64_t vSubsampling) { + traverseYCbCrData(yCbCr, width, height, hSubsampling, vSubsampling, + [](auto address, auto fillingData) { *address = fillingData; }); } - void verifyYCbCr888Data(const android_ycbcr& yCbCr, int32_t width, int32_t height, - int64_t hSubsampling, int64_t vSubsampling) { - traverseYCbCr888Data( + void verifyYCbCrData(const android_ycbcr& yCbCr, int32_t width, int32_t height, + int64_t hSubsampling, int64_t vSubsampling) { + traverseYCbCrData( yCbCr, width, height, hSubsampling, vSubsampling, [](auto address, auto expectedData) { EXPECT_EQ(*address, expectedData); }); } bool isEqual(float a, float b) { return abs(a - b) < 0.0001; } + uint64_t bitsToBytes(int64_t bits) { return bits / 8; } + + uint64_t bytesToBits(int64_t bytes) { return bytes * 8; } + std::unique_ptr mGralloc; IMapper::BufferDescriptorInfo mDummyDescriptorInfo{}; static const std::set sRequiredMetadataTypes; @@ -645,7 +745,7 @@ TEST_P(GraphicsMapperHidlTest, Lock_YCRCB_420_SP) { ASSERT_EQ(crData + 1, cbData); ASSERT_EQ(2, yCbCr.chroma_step); - fillYCbCr888Data(yCbCr, info.width, info.height, hSubsampling, vSubsampling); + fillYCbCrData(yCbCr, info.width, info.height, hSubsampling, vSubsampling); ASSERT_NO_FATAL_FAILURE(fence.reset(mGralloc->unlock(bufferHandle))); @@ -656,7 +756,7 @@ TEST_P(GraphicsMapperHidlTest, Lock_YCRCB_420_SP) { ASSERT_NO_FATAL_FAILURE( getAndroidYCbCr(bufferHandle, data, &yCbCr, &hSubsampling, &vSubsampling)); - verifyYCbCr888Data(yCbCr, info.width, info.height, hSubsampling, vSubsampling); + verifyYCbCrData(yCbCr, info.width, info.height, hSubsampling, vSubsampling); ASSERT_NO_FATAL_FAILURE(fence.reset(mGralloc->unlock(bufferHandle))); } @@ -744,7 +844,7 @@ TEST_P(GraphicsMapperHidlTest, Lock_YV12) { ASSERT_EQ(crData + yCbCr.cstride * info.height / vSubsampling, cbData); ASSERT_EQ(1, yCbCr.chroma_step); - fillYCbCr888Data(yCbCr, info.width, info.height, hSubsampling, vSubsampling); + fillYCbCrData(yCbCr, info.width, info.height, hSubsampling, vSubsampling); ASSERT_NO_FATAL_FAILURE(fence.reset(mGralloc->unlock(bufferHandle))); @@ -755,7 +855,7 @@ TEST_P(GraphicsMapperHidlTest, Lock_YV12) { ASSERT_NO_FATAL_FAILURE( getAndroidYCbCr(bufferHandle, data, &yCbCr, &hSubsampling, &vSubsampling)); - verifyYCbCr888Data(yCbCr, info.width, info.height, hSubsampling, vSubsampling); + verifyYCbCrData(yCbCr, info.width, info.height, hSubsampling, vSubsampling); ASSERT_NO_FATAL_FAILURE(fence.reset(mGralloc->unlock(bufferHandle))); } @@ -788,7 +888,7 @@ TEST_P(GraphicsMapperHidlTest, Lock_YCBCR_420_888) { ASSERT_EQ(kCbCrSubSampleFactor, hSubsampling); ASSERT_EQ(kCbCrSubSampleFactor, vSubsampling); - fillYCbCr888Data(yCbCr, info.width, info.height, hSubsampling, vSubsampling); + fillYCbCrData(yCbCr, info.width, info.height, hSubsampling, vSubsampling); ASSERT_NO_FATAL_FAILURE(fence.reset(mGralloc->unlock(bufferHandle))); @@ -799,7 +899,7 @@ TEST_P(GraphicsMapperHidlTest, Lock_YCBCR_420_888) { ASSERT_NO_FATAL_FAILURE( getAndroidYCbCr(bufferHandle, data, &yCbCr, &hSubsampling, &vSubsampling)); - verifyYCbCr888Data(yCbCr, info.width, info.height, hSubsampling, vSubsampling); + verifyYCbCrData(yCbCr, info.width, info.height, hSubsampling, vSubsampling); ASSERT_NO_FATAL_FAILURE(fence.reset(mGralloc->unlock(bufferHandle))); } @@ -888,6 +988,42 @@ TEST_P(GraphicsMapperHidlTest, Lock_RAW12) { ASSERT_NO_FATAL_FAILURE(fence.reset(mGralloc->unlock(bufferHandle))); } +TEST_P(GraphicsMapperHidlTest, Lock_YCBCR_P010) { + auto info = mDummyDescriptorInfo; + info.format = PixelFormat::YCBCR_P010; + + const native_handle_t* bufferHandle; + uint32_t stride; + ASSERT_NO_FATAL_FAILURE( + bufferHandle = mGralloc->allocate(info, true, Tolerance::kToleranceStrict, &stride)); + + const IMapper::Rect region{0, 0, static_cast(info.width), + static_cast(info.height)}; + unique_fd fence; + uint8_t* data; + + ASSERT_NO_FATAL_FAILURE(data = static_cast(mGralloc->lock(bufferHandle, info.usage, + region, fence.release()))); + + YCbCr yCbCr; + ASSERT_NO_FATAL_FAILURE(yCbCr = getAndroidYCbCr_P010(bufferHandle, data)); + + constexpr uint32_t kCbCrSubSampleFactor = 2; + ASSERT_EQ(kCbCrSubSampleFactor, yCbCr.horizontalSubSampling); + ASSERT_EQ(kCbCrSubSampleFactor, yCbCr.verticalSubSampling); + + ASSERT_EQ(0, info.height % 2); + + // fill the data + fillYCbCrData(yCbCr.yCbCr, info.width, info.height, yCbCr.horizontalSubSampling, + yCbCr.verticalSubSampling); + // verify the YCbCr data + verifyYCbCrData(yCbCr.yCbCr, info.width, info.height, yCbCr.horizontalSubSampling, + yCbCr.verticalSubSampling); + + ASSERT_NO_FATAL_FAILURE(fence.reset(mGralloc->unlock(bufferHandle))); +} + /** * Test IMapper::unlock with bad access region */ -- GitLab From 6029a37036b78d31e7143a722e11d0df2f0b84ec Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 22 Jun 2021 19:11:05 -0700 Subject: [PATCH 063/825] Separate VHAL emulator logic out. Create EmulatedVehicleServer logic and moves emulator dependency under it. This is part of the default VHAL refactoring. By letting EmulatedVehicleServer depends on emulator, if we provides a different VehicleServer implementation, it would not have emulator dependency. Create DefaultVehicleHal and let EmulatedVehicleHal inherits from DefaultVehicleHal. Test: Locally run in an emulator, test setting/getting properties through emulator. Would add more tests in following CL. Bug: 188204722 Change-Id: I20c4f69144277c717fed880a3bb9824f23ae0490 --- automotive/vehicle/2.0/default/Android.bp | 40 +- .../vehicle/2.0/default/VehicleService.cpp | 8 +- .../vhal_v2_0/ProtoMessageConverter.h | 0 .../src}/ProtoMessageConverter.cpp | 0 .../2.0/default/impl/vhal_v2_0/CommConn.cpp | 80 --- .../2.0/default/impl/vhal_v2_0/CommConn.h | 117 ---- ...eConnector.h => DefaultVehicleConnector.h} | 28 +- .../impl/vhal_v2_0/DefaultVehicleHal.cpp | 198 +++++++ .../impl/vhal_v2_0/DefaultVehicleHal.h | 74 +++ ...Server.cpp => DefaultVehicleHalServer.cpp} | 114 ++-- .../impl/vhal_v2_0/DefaultVehicleHalServer.h | 82 +++ .../impl/vhal_v2_0/EmulatedUserHal.cpp | 351 ------------ .../default/impl/vhal_v2_0/EmulatedUserHal.h | 151 ----- .../vhal_v2_0/EmulatedVehicleConnector.cpp | 100 ---- .../impl/vhal_v2_0/EmulatedVehicleHal.cpp | 532 ------------------ .../impl/vhal_v2_0/EmulatedVehicleHal.h | 86 +-- .../2.0/default/impl/vhal_v2_0/PipeComm.cpp | 105 ---- .../2.0/default/impl/vhal_v2_0/PipeComm.h | 64 --- .../2.0/default/impl/vhal_v2_0/SocketComm.cpp | 226 -------- .../2.0/default/impl/vhal_v2_0/SocketComm.h | 125 ---- .../impl/vhal_v2_0/VehicleEmulator.cpp | 239 -------- .../default/impl/vhal_v2_0/VehicleEmulator.h | 109 ---- .../impl/vhal_v2_0/VehicleHalClient.cpp | 16 +- .../default/impl/vhal_v2_0/VehicleHalClient.h | 16 +- .../default/impl/vhal_v2_0/VehicleHalServer.h | 68 +-- .../default/impl/vhal_v2_0/proto/Android.bp | 4 + .../2.0/default/impl/vhal_v2_0/qemu_pipe.cpp | 104 ---- .../2.0/default/impl/vhal_v2_0/qemu_pipe.h | 64 --- .../tests/ProtoMessageConverter_test.cpp | 2 +- 29 files changed, 504 insertions(+), 2599 deletions(-) rename automotive/vehicle/2.0/default/{impl => common/include}/vhal_v2_0/ProtoMessageConverter.h (100%) rename automotive/vehicle/2.0/default/{impl/vhal_v2_0 => common/src}/ProtoMessageConverter.cpp (100%) delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/CommConn.cpp delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/CommConn.h rename automotive/vehicle/2.0/default/impl/vhal_v2_0/{EmulatedVehicleConnector.h => DefaultVehicleConnector.h} (51%) create mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp create mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h rename automotive/vehicle/2.0/default/impl/vhal_v2_0/{VehicleHalServer.cpp => DefaultVehicleHalServer.cpp} (81%) create mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.h delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.cpp delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/PipeComm.cpp delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/PipeComm.h delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/SocketComm.cpp delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/SocketComm.h delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.cpp delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.h delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/qemu_pipe.cpp delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/qemu_pipe.h diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp index ea42c3eaa6..4c51c62c24 100644 --- a/automotive/vehicle/2.0/default/Android.bp +++ b/automotive/vehicle/2.0/default/Android.bp @@ -47,6 +47,7 @@ cc_defaults { cc_library_headers { name: "vhal_v2_0_common_headers", + visibility: ["//visibility:public"], vendor: true, export_include_dirs: ["common/include/vhal_v2_0"], } @@ -58,6 +59,7 @@ cc_library { defaults: ["vhal_v2_0_target_defaults"], srcs: [ "common/src/Obd2SensorStore.cpp", + "common/src/ProtoMessageConverter.cpp", "common/src/SubscriptionManager.cpp", "common/src/VehicleHalManager.cpp", "common/src/VehicleObjectPool.cpp", @@ -68,9 +70,13 @@ cc_library { ], shared_libs: [ "libbase", + "libprotobuf-cpp-lite", ], local_include_dirs: ["common/include/vhal_v2_0"], export_include_dirs: ["common/include"], + static_libs: [ + "android.hardware.automotive.vehicle@2.0-libproto-native", + ], } // Vehicle default VehicleHAL implementation @@ -80,24 +86,16 @@ cc_library_static { defaults: ["vhal_v2_0_target_defaults"], cflags: ["-DENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING"], srcs: [ - "impl/vhal_v2_0/CommConn.cpp", - "impl/vhal_v2_0/EmulatedVehicleConnector.cpp", - "impl/vhal_v2_0/EmulatedVehicleHal.cpp", + "impl/vhal_v2_0/DefaultVehicleHal.cpp", "impl/vhal_v2_0/VehicleHalClient.cpp", - "impl/vhal_v2_0/VehicleHalServer.cpp", - "impl/vhal_v2_0/VehicleEmulator.cpp", - "impl/vhal_v2_0/PipeComm.cpp", - "impl/vhal_v2_0/ProtoMessageConverter.cpp", - "impl/vhal_v2_0/SocketComm.cpp", + "impl/vhal_v2_0/DefaultVehicleHalServer.cpp", "impl/vhal_v2_0/LinearFakeValueGenerator.cpp", "impl/vhal_v2_0/JsonFakeValueGenerator.cpp", "impl/vhal_v2_0/GeneratorHub.cpp", - "impl/vhal_v2_0/qemu_pipe.cpp", ], local_include_dirs: ["common/include/vhal_v2_0"], export_include_dirs: ["impl"], whole_static_libs: [ - "android.hardware.automotive.vehicle@2.0-emulated-user-hal-lib", "android.hardware.automotive.vehicle@2.0-manager-lib", ], shared_libs: [ @@ -110,19 +108,6 @@ cc_library_static { ], } -// Library used to emulate User HAL behavior through lshal debug requests. -cc_library_static { - name: "android.hardware.automotive.vehicle@2.0-emulated-user-hal-lib", - vendor: true, - defaults: ["vhal_v2_0_target_defaults"], - srcs: [ - "impl/vhal_v2_0/EmulatedUserHal.cpp", - ], - whole_static_libs: [ - "android.hardware.automotive.vehicle@2.0-user-hal-helper-lib", - ], -} - // Vehicle HAL Server reference impl lib cc_library_static { name: "android.hardware.automotive.vehicle@2.0-server-common-lib", @@ -133,10 +118,14 @@ cc_library_static { export_include_dirs: ["common/include"], srcs: [ "common/src/Obd2SensorStore.cpp", + "common/src/ProtoMessageConverter.cpp", "common/src/VehicleObjectPool.cpp", "common/src/VehiclePropertyStore.cpp", "common/src/VehicleUtils.cpp", ], + static_libs: [ + "android.hardware.automotive.vehicle@2.0-libproto-native", + ], } // Vehicle HAL Server default implementation @@ -151,8 +140,7 @@ cc_library_static { "impl/vhal_v2_0/GeneratorHub.cpp", "impl/vhal_v2_0/JsonFakeValueGenerator.cpp", "impl/vhal_v2_0/LinearFakeValueGenerator.cpp", - "impl/vhal_v2_0/ProtoMessageConverter.cpp", - "impl/vhal_v2_0/VehicleHalServer.cpp", + "impl/vhal_v2_0/DefaultVehicleHalServer.cpp", ], whole_static_libs: [ "android.hardware.automotive.vehicle@2.0-server-common-lib", @@ -234,8 +222,8 @@ cc_binary { ], static_libs: [ "android.hardware.automotive.vehicle@2.0-manager-lib", - "android.hardware.automotive.vehicle@2.0-default-impl-lib", "android.hardware.automotive.vehicle@2.0-libproto-native", + "//device/generic/car/emulator/vhal_v2_0:android.hardware.automotive.vehicle@2.0-emulator-impl-lib", ], } diff --git a/automotive/vehicle/2.0/default/VehicleService.cpp b/automotive/vehicle/2.0/default/VehicleService.cpp index 7e8deb6777..ba2a60638a 100644 --- a/automotive/vehicle/2.0/default/VehicleService.cpp +++ b/automotive/vehicle/2.0/default/VehicleService.cpp @@ -20,9 +20,9 @@ #include -#include -#include -#include +#include +#include +#include #include using namespace android; @@ -34,7 +34,7 @@ int main(int /* argc */, char* /* argv */ []) { auto connector = std::make_unique(); auto userHal = connector->getEmulatedUserHal(); auto hal = std::make_unique(store.get(), connector.get(), userHal); - auto emulator = std::make_unique(hal.get()); + auto emulator = connector->getEmulator(); auto service = std::make_unique(hal.get()); connector->setValuePool(hal->getValuePool()); diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/ProtoMessageConverter.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/ProtoMessageConverter.h similarity index 100% rename from automotive/vehicle/2.0/default/impl/vhal_v2_0/ProtoMessageConverter.h rename to automotive/vehicle/2.0/default/common/include/vhal_v2_0/ProtoMessageConverter.h diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/ProtoMessageConverter.cpp b/automotive/vehicle/2.0/default/common/src/ProtoMessageConverter.cpp similarity index 100% rename from automotive/vehicle/2.0/default/impl/vhal_v2_0/ProtoMessageConverter.cpp rename to automotive/vehicle/2.0/default/common/src/ProtoMessageConverter.cpp diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/CommConn.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/CommConn.cpp deleted file mode 100644 index 136b2e0758..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/CommConn.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "CommConn" - -#include - -#include -#include - -#include "CommConn.h" - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { -namespace V2_0 { - -namespace impl { - -void CommConn::start() { - mReadThread = std::make_unique(std::bind(&CommConn::readThread, this)); -} - -void CommConn::stop() { - if (mReadThread->joinable()) { - mReadThread->join(); - } -} - -void CommConn::sendMessage(vhal_proto::EmulatorMessage const& msg) { - int numBytes = msg.ByteSize(); - std::vector buffer(static_cast(numBytes)); - if (!msg.SerializeToArray(buffer.data(), numBytes)) { - ALOGE("%s: SerializeToString failed!", __func__); - return; - } - - write(buffer); -} - -void CommConn::readThread() { - std::vector buffer; - while (isOpen()) { - buffer = read(); - if (buffer.size() == 0) { - ALOGI("%s: Read returned empty message, exiting read loop.", __func__); - break; - } - - vhal_proto::EmulatorMessage rxMsg; - if (rxMsg.ParseFromArray(buffer.data(), static_cast(buffer.size()))) { - vhal_proto::EmulatorMessage respMsg; - mMessageProcessor->processMessage(rxMsg, respMsg); - - sendMessage(respMsg); - } - } -} - -} // namespace impl - -} // namespace V2_0 -} // namespace vehicle -} // namespace automotive -} // namespace hardware -} // namespace android diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/CommConn.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/CommConn.h deleted file mode 100644 index 6d36da417f..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/CommConn.h +++ /dev/null @@ -1,117 +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. - */ - -#ifndef android_hardware_automotive_vehicle_V2_0_impl_CommBase_H_ -#define android_hardware_automotive_vehicle_V2_0_impl_CommBase_H_ - -#include -#include -#include -#include - -#include "VehicleHalProto.pb.h" - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { -namespace V2_0 { - -namespace impl { - -/** - * MessageProcess is an interface implemented by VehicleEmulator to process messages received - * over a CommConn. - */ -class MessageProcessor { - public: - virtual ~MessageProcessor() = default; - - /** - * Process a single message received over a CommConn. Populate the given respMsg with the reply - * message we should send. - */ - virtual void processMessage(vhal_proto::EmulatorMessage const& rxMsg, - vhal_proto::EmulatorMessage& respMsg) = 0; -}; - -/** - * This is the interface that both PipeComm and SocketComm use to represent a connection. The - * connection will listen for commands on a separate 'read' thread. - */ -class CommConn { - public: - CommConn(MessageProcessor* messageProcessor) : mMessageProcessor(messageProcessor) {} - - virtual ~CommConn() {} - - /** - * Start the read thread reading messages from this connection. - */ - virtual void start(); - - /** - * Closes a connection if it is open. - */ - virtual void stop(); - - /** - * Returns true if the connection is open and available to send/receive. - */ - virtual bool isOpen() = 0; - - /** - * Blocking call to read data from the connection. - * - * @return std::vector Serialized protobuf data received from emulator. This will be - * an empty vector if the connection was closed or some other error occurred. - */ - virtual std::vector read() = 0; - - /** - * Transmits a string of data to the emulator. - * - * @param data Serialized protobuf data to transmit. - * - * @return int Number of bytes transmitted, or -1 if failed. - */ - virtual int write(const std::vector& data) = 0; - - /** - * Serialized and send the given message to the other side. - */ - void sendMessage(vhal_proto::EmulatorMessage const& msg); - - protected: - std::unique_ptr mReadThread; - MessageProcessor* mMessageProcessor; - - /** - * A thread that reads messages in a loop, and responds. You can stop this thread by calling - * stop(). - */ - void readThread(); -}; - -} // namespace impl - -} // namespace V2_0 -} // namespace vehicle -} // namespace automotive -} // namespace hardware -} // namespace android - -#endif // android_hardware_automotive_vehicle_V2_0_impl_CommBase_H_ diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleConnector.h similarity index 51% rename from automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.h rename to automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleConnector.h index 31ac7d8fb5..c3affb04b3 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleConnector.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * 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. @@ -14,14 +14,13 @@ * limitations under the License. */ -#ifndef android_hardware_automotive_vehicle_V2_0_impl_EmulatedVehicleConnector_H_ -#define android_hardware_automotive_vehicle_V2_0_impl_EmulatedVehicleConnector_H_ +#ifndef android_hardware_automotive_vehicle_V2_0_impl_DefaultVehicleConnector_H_ +#define android_hardware_automotive_vehicle_V2_0_impl_DefaultVehicleConnector_H_ #include -#include "EmulatedUserHal.h" +#include "DefaultVehicleHalServer.h" #include "VehicleHalClient.h" -#include "VehicleHalServer.h" namespace android { namespace hardware { @@ -31,21 +30,12 @@ namespace V2_0 { namespace impl { -class EmulatedVehicleConnector : public IPassThroughConnector { +class DefaultVehicleConnector + : public IPassThroughConnector { public: - EmulatedVehicleConnector() = default; + DefaultVehicleConnector() = default; - EmulatedUserHal* getEmulatedUserHal(); - - // Methods from VehicleHalServer - void triggerSendAllValues() override; - - StatusCode onSetProperty(const VehiclePropValue& value, bool updateStatus) override; - - bool onDump(const hidl_handle& fd, const hidl_vec& options) override; - - private: - EmulatedUserHal mEmulatedUserHal; + void triggerSendAllValues() { this->sendAllValuesToClient(); } }; } // namespace impl @@ -56,4 +46,4 @@ class EmulatedVehicleConnector : public IPassThroughConnector +#include +#include + +#include "VehicleUtils.h" + +#include "DefaultVehicleHal.h" + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace V2_0 { + +namespace impl { + +DefaultVehicleHal::DefaultVehicleHal(VehiclePropertyStore* propStore, VehicleHalClient* client) + : mPropStore(propStore), mRecurrentTimer(getTimerAction()), mVehicleClient(client) { + initStaticConfig(); + mVehicleClient->registerPropertyValueCallback( + [this](const VehiclePropValue& value, bool updateStatus) { + onPropertyValue(value, updateStatus); + }); +} + +VehicleHal::VehiclePropValuePtr DefaultVehicleHal::get(const VehiclePropValue& requestedPropValue, + StatusCode* outStatus) { + auto propId = requestedPropValue.prop; + ALOGV("get(%d)", propId); + + VehiclePropValuePtr v = nullptr; + auto internalPropValue = mPropStore->readValueOrNull(requestedPropValue); + if (internalPropValue != nullptr) { + v = getValuePool()->obtain(*internalPropValue); + } + + if (!v) { + *outStatus = StatusCode::INVALID_ARG; + } else if (v->status == VehiclePropertyStatus::AVAILABLE) { + *outStatus = StatusCode::OK; + } else { + *outStatus = StatusCode::TRY_AGAIN; + } + if (v.get()) { + v->timestamp = elapsedRealtimeNano(); + } + return v; +} + +std::vector DefaultVehicleHal::listProperties() { + return mPropStore->getAllConfigs(); +} + +bool DefaultVehicleHal::dump(const hidl_handle& fd, const hidl_vec& options) { + return mVehicleClient->dump(fd, options); +} + +StatusCode DefaultVehicleHal::set(const VehiclePropValue& propValue) { + if (propValue.status != VehiclePropertyStatus::AVAILABLE) { + // Android side cannot set property status - this value is the + // purview of the HAL implementation to reflect the state of + // its underlying hardware + return StatusCode::INVALID_ARG; + } + auto currentPropValue = mPropStore->readValueOrNull(propValue); + + if (currentPropValue == nullptr) { + return StatusCode::INVALID_ARG; + } + if (currentPropValue->status != VehiclePropertyStatus::AVAILABLE) { + // do not allow Android side to set() a disabled/error property + return StatusCode::NOT_AVAILABLE; + } + + // Send the value to the vehicle server, the server will talk to the (real or emulated) car + return mVehicleClient->setProperty(propValue, /*updateStatus=*/false); +} + +// Parse supported properties list and generate vector of property values to hold current values. +void DefaultVehicleHal::onCreate() { + auto configs = mVehicleClient->getAllPropertyConfig(); + + for (const auto& cfg : configs) { + int32_t numAreas = isGlobalProp(cfg.prop) ? 0 : cfg.areaConfigs.size(); + + for (int i = 0; i < numAreas; i++) { + int32_t curArea = isGlobalProp(cfg.prop) ? 0 : cfg.areaConfigs[i].areaId; + + // Create a separate instance for each individual zone + VehiclePropValue prop = { + .areaId = curArea, + .prop = cfg.prop, + .status = VehiclePropertyStatus::UNAVAILABLE, + }; + // Allow the initial values to set status. + mPropStore->writeValue(prop, /*updateStatus=*/true); + } + } + + mVehicleClient->triggerSendAllValues(); +} + +void DefaultVehicleHal::onContinuousPropertyTimer(const std::vector& properties) { + auto& pool = *getValuePool(); + + for (int32_t property : properties) { + VehiclePropValuePtr v; + if (isContinuousProperty(property)) { + auto internalPropValue = mPropStore->readValueOrNull(property); + if (internalPropValue != nullptr) { + v = pool.obtain(*internalPropValue); + } + } else { + ALOGE("Unexpected onContinuousPropertyTimer for property: 0x%x", property); + continue; + } + + if (v.get()) { + v->timestamp = elapsedRealtimeNano(); + doHalEvent(std::move(v)); + } + } +} + +RecurrentTimer::Action DefaultVehicleHal::getTimerAction() { + return [this](const std::vector& properties) { + onContinuousPropertyTimer(properties); + }; +} + +StatusCode DefaultVehicleHal::subscribe(int32_t property, float sampleRate) { + ALOGI("%s propId: 0x%x, sampleRate: %f", __func__, property, sampleRate); + + if (!isContinuousProperty(property)) { + return StatusCode::INVALID_ARG; + } + mRecurrentTimer.registerRecurrentEvent(hertzToNanoseconds(sampleRate), property); + return StatusCode::OK; +} + +StatusCode DefaultVehicleHal::unsubscribe(int32_t property) { + ALOGI("%s propId: 0x%x", __func__, property); + if (!isContinuousProperty(property)) { + return StatusCode::INVALID_ARG; + } + // If the event was not registered before, this would do nothing. + mRecurrentTimer.unregisterRecurrentEvent(property); + return StatusCode::OK; +} + +bool DefaultVehicleHal::isContinuousProperty(int32_t propId) const { + const VehiclePropConfig* config = mPropStore->getConfigOrNull(propId); + if (config == nullptr) { + ALOGW("Config not found for property: 0x%x", propId); + return false; + } + return config->changeMode == VehiclePropertyChangeMode::CONTINUOUS; +} + +void DefaultVehicleHal::onPropertyValue(const VehiclePropValue& value, bool updateStatus) { + VehiclePropValuePtr updatedPropValue = getValuePool()->obtain(value); + + if (mPropStore->writeValue(*updatedPropValue, updateStatus)) { + doHalEvent(std::move(updatedPropValue)); + } +} + +void DefaultVehicleHal::initStaticConfig() { + auto configs = mVehicleClient->getAllPropertyConfig(); + for (auto&& cfg : configs) { + mPropStore->registerProperty(cfg, nullptr); + } +} + +} // namespace impl + +} // namespace V2_0 +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h new file mode 100644 index 0000000000..cc66c0f680 --- /dev/null +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h @@ -0,0 +1,74 @@ +/* + * 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_V2_0_impl_DefaultVehicleHal_H_ +#define android_hardware_automotive_vehicle_V2_0_impl_DefaultVehicleHal_H_ + +#include +#include +#include "vhal_v2_0/VehiclePropertyStore.h" + +#include "VehicleHalClient.h" + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace V2_0 { + +namespace impl { + +/** Implementation of VehicleHal that connected to emulator instead of real vehicle network. */ +class DefaultVehicleHal : public VehicleHal { + public: + DefaultVehicleHal(VehiclePropertyStore* propStore, VehicleHalClient* client); + ~DefaultVehicleHal() = default; + + // Methods from VehicleHal + void onCreate() override; + std::vector listProperties() override; + VehiclePropValuePtr get(const VehiclePropValue& requestedPropValue, + StatusCode* outStatus) override; + StatusCode set(const VehiclePropValue& propValue) override; + StatusCode subscribe(int32_t property, float sampleRate) override; + StatusCode unsubscribe(int32_t property) override; + bool dump(const hidl_handle& fd, const hidl_vec& options) override; + + protected: + constexpr std::chrono::nanoseconds hertzToNanoseconds(float hz) const { + return std::chrono::nanoseconds(static_cast(1000000000L / hz)); + } + + VehiclePropertyStore* mPropStore; + RecurrentTimer mRecurrentTimer; + VehicleHalClient* mVehicleClient; + virtual bool isContinuousProperty(int32_t propId) const; + virtual void initStaticConfig(); + virtual void onContinuousPropertyTimer(const std::vector& properties); + virtual void onPropertyValue(const VehiclePropValue& value, bool updateStatus); + // Returns a lambda that could be used in mRecurrentTimer. + RecurrentTimer::Action getTimerAction(); +}; + +} // namespace impl + +} // namespace V2_0 +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_V2_0_impl_DefaultVehicleHal_H_ diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp similarity index 81% rename from automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.cpp rename to automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp index 57dd7d4215..e7cc6a0a4e 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 The Android Open Source Project + * 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. @@ -14,9 +14,7 @@ * limitations under the License. */ -#define LOG_TAG "VehicleHalServer" - -#include "VehicleHalServer.h" +#define LOG_TAG "DefaultVehicleHalServer" #include @@ -26,63 +24,56 @@ #include "DefaultConfig.h" #include "JsonFakeValueGenerator.h" #include "LinearFakeValueGenerator.h" -#include "Obd2SensorStore.h" -namespace android::hardware::automotive::vehicle::V2_0::impl { +#include "DefaultVehicleHalServer.h" -static bool isDiagnosticProperty(VehiclePropConfig propConfig) { - switch (propConfig.prop) { - case OBD2_LIVE_FRAME: - case OBD2_FREEZE_FRAME: - case OBD2_FREEZE_FRAME_CLEAR: - case OBD2_FREEZE_FRAME_INFO: - return true; - } - return false; -} +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace V2_0 { -VehicleHalServer::VehicleHalServer() { - constexpr bool shouldUpdateStatus = true; +namespace impl { - for (auto& it : kVehicleProperties) { - VehiclePropConfig cfg = it.config; +void DefaultVehicleHalServer::storePropInitialValue(const ConfigDeclaration& config) { + VehiclePropConfig cfg = config.config; - mServerSidePropStore.registerProperty(cfg); - - if (isDiagnosticProperty(cfg)) { - continue; - } + // A global property will have only a single area + int32_t numAreas = isGlobalProp(cfg.prop) ? 1 : cfg.areaConfigs.size(); - // A global property will have only a single area - int32_t numAreas = isGlobalProp(cfg.prop) ? 1 : cfg.areaConfigs.size(); + for (int i = 0; i < numAreas; i++) { + int32_t curArea = isGlobalProp(cfg.prop) ? 0 : cfg.areaConfigs[i].areaId; - for (int i = 0; i < numAreas; i++) { - int32_t curArea = isGlobalProp(cfg.prop) ? 0 : cfg.areaConfigs[i].areaId; + // Create a separate instance for each individual zone + VehiclePropValue prop = { + .areaId = curArea, + .prop = cfg.prop, + }; - // Create a separate instance for each individual zone - VehiclePropValue prop = { - .areaId = curArea, - .prop = cfg.prop, - }; + if (config.initialAreaValues.empty()) { + prop.value = config.initialValue; + } else if (auto valueForAreaIt = config.initialAreaValues.find(curArea); + valueForAreaIt != config.initialAreaValues.end()) { + prop.value = valueForAreaIt->second; + } else { + LOG(WARNING) << __func__ << " failed to get default value for" + << " prop 0x" << std::hex << cfg.prop << " area 0x" << std::hex << curArea; + prop.status = VehiclePropertyStatus::UNAVAILABLE; + } - if (it.initialAreaValues.empty()) { - prop.value = it.initialValue; - } else if (auto valueForAreaIt = it.initialAreaValues.find(curArea); - valueForAreaIt != it.initialAreaValues.end()) { - prop.value = valueForAreaIt->second; - } else { - LOG(WARNING) << __func__ << " failed to get default value for" - << " prop 0x" << std::hex << cfg.prop << " area 0x" << std::hex - << curArea; - prop.status = VehiclePropertyStatus::UNAVAILABLE; - } + mServerSidePropStore.writeValue(prop, true); + } +} - mServerSidePropStore.writeValue(prop, shouldUpdateStatus); - } +DefaultVehicleHalServer::DefaultVehicleHalServer() { + for (auto& it : kVehicleProperties) { + VehiclePropConfig cfg = it.config; + mServerSidePropStore.registerProperty(cfg); + storePropInitialValue(it); } } -void VehicleHalServer::sendAllValuesToClient() { +void DefaultVehicleHalServer::sendAllValuesToClient() { constexpr bool update_status = true; auto values = mServerSidePropStore.readAllValues(); for (const auto& value : values) { @@ -90,25 +81,25 @@ void VehicleHalServer::sendAllValuesToClient() { } } -GeneratorHub* VehicleHalServer::getGenerator() { +GeneratorHub* DefaultVehicleHalServer::getGenerator() { return &mGeneratorHub; } -VehiclePropValuePool* VehicleHalServer::getValuePool() const { +VehiclePropValuePool* DefaultVehicleHalServer::getValuePool() const { if (!mValuePool) { LOG(WARNING) << __func__ << ": Value pool not set!"; } return mValuePool; } -void VehicleHalServer::setValuePool(VehiclePropValuePool* valuePool) { +void DefaultVehicleHalServer::setValuePool(VehiclePropValuePool* valuePool) { if (!valuePool) { LOG(WARNING) << __func__ << ": Setting value pool to nullptr!"; } mValuePool = valuePool; } -void VehicleHalServer::onFakeValueGenerated(const VehiclePropValue& value) { +void DefaultVehicleHalServer::onFakeValueGenerated(const VehiclePropValue& value) { constexpr bool updateStatus = true; LOG(DEBUG) << __func__ << ": " << toString(value); auto updatedPropValue = getValuePool()->obtain(value); @@ -120,11 +111,11 @@ void VehicleHalServer::onFakeValueGenerated(const VehiclePropValue& value) { } } -std::vector VehicleHalServer::onGetAllPropertyConfig() const { +std::vector DefaultVehicleHalServer::onGetAllPropertyConfig() const { return mServerSidePropStore.getAllConfigs(); } -StatusCode VehicleHalServer::handleGenerateFakeDataRequest(const VehiclePropValue& request) { +StatusCode DefaultVehicleHalServer::handleGenerateFakeDataRequest(const VehiclePropValue& request) { constexpr bool updateStatus = true; LOG(INFO) << __func__; @@ -209,7 +200,7 @@ StatusCode VehicleHalServer::handleGenerateFakeDataRequest(const VehiclePropValu return StatusCode::OK; } -VehicleHalServer::VehiclePropValuePtr VehicleHalServer::createApPowerStateReq( +DefaultVehicleHalServer::VehiclePropValuePtr DefaultVehicleHalServer::createApPowerStateReq( VehicleApPowerStateReq state, int32_t param) { auto req = getValuePool()->obtain(VehiclePropertyType::INT32_VEC, 2); req->prop = toInt(VehicleProperty::AP_POWER_STATE_REQ); @@ -221,7 +212,7 @@ VehicleHalServer::VehiclePropValuePtr VehicleHalServer::createApPowerStateReq( return req; } -VehicleHalServer::VehiclePropValuePtr VehicleHalServer::createHwInputKeyProp( +DefaultVehicleHalServer::VehiclePropValuePtr DefaultVehicleHalServer::createHwInputKeyProp( VehicleHwKeyInputAction action, int32_t keyCode, int32_t targetDisplay) { auto keyEvent = getValuePool()->obtain(VehiclePropertyType::INT32_VEC, 3); keyEvent->prop = toInt(VehicleProperty::HW_KEY_INPUT); @@ -234,7 +225,8 @@ VehicleHalServer::VehiclePropValuePtr VehicleHalServer::createHwInputKeyProp( return keyEvent; } -StatusCode VehicleHalServer::onSetProperty(const VehiclePropValue& value, bool updateStatus) { +StatusCode DefaultVehicleHalServer::onSetProperty(const VehiclePropValue& value, + bool updateStatus) { LOG(DEBUG) << "onSetProperty(" << value.prop << ")"; // Some properties need to be treated non-trivially @@ -337,4 +329,10 @@ StatusCode VehicleHalServer::onSetProperty(const VehiclePropValue& value, bool u return StatusCode::OK; } -} // namespace android::hardware::automotive::vehicle::V2_0::impl +} // namespace impl + +} // namespace V2_0 +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h new file mode 100644 index 0000000000..d8e1b4efcf --- /dev/null +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h @@ -0,0 +1,82 @@ +/* + * 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 +#include +#include + +#include "DefaultConfig.h" +#include "GeneratorHub.h" + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace V2_0 { + +namespace impl { + +// This contains the server operation for VHAL running in emulator. +class DefaultVehicleHalServer : public IVehicleServer { + public: + DefaultVehicleHalServer(); + + // Send all the property values to client. + void sendAllValuesToClient(); + + // Methods from IVehicleServer + + std::vector onGetAllPropertyConfig() const override; + + StatusCode onSetProperty(const VehiclePropValue& value, bool updateStatus) override; + + // Set the Property Value Pool used in this server + void setValuePool(VehiclePropValuePool* valuePool); + + protected: + using VehiclePropValuePtr = recyclable_ptr; + GeneratorHub* getGenerator(); + + VehiclePropValuePool* getValuePool() const; + + void onFakeValueGenerated(const VehiclePropValue& value); + + StatusCode handleGenerateFakeDataRequest(const VehiclePropValue& request); + + VehiclePropValuePtr createApPowerStateReq(VehicleApPowerStateReq req, int32_t param); + + VehiclePropValuePtr createHwInputKeyProp(VehicleHwKeyInputAction action, int32_t keyCode, + int32_t targetDisplay); + + void storePropInitialValue(const ConfigDeclaration& config); + + protected: + GeneratorHub mGeneratorHub{ + [this](const VehiclePropValue& value) { return onFakeValueGenerated(value); }}; + + VehiclePropValuePool* mValuePool{nullptr}; + VehiclePropertyStore mServerSidePropStore; +}; + +} // namespace impl + +} // namespace V2_0 +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp deleted file mode 100644 index 3bdf5a84a0..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp +++ /dev/null @@ -1,351 +0,0 @@ -/* - * 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. - */ -#define LOG_TAG "EmulatedUserHal" - -#include "EmulatedUserHal.h" - -#include -#include - -#include "UserHalHelper.h" - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { -namespace V2_0 { - -namespace impl { - -namespace { - -using android::base::Error; -using android::base::Result; - -constexpr int32_t INITIAL_USER_INFO = static_cast(VehicleProperty::INITIAL_USER_INFO); -constexpr int32_t SWITCH_USER = static_cast(VehicleProperty::SWITCH_USER); -constexpr int32_t CREATE_USER = static_cast(VehicleProperty::CREATE_USER); -constexpr int32_t REMOVE_USER = static_cast(VehicleProperty::REMOVE_USER); -constexpr int32_t USER_IDENTIFICATION_ASSOCIATION = - static_cast(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION); - -Result getRequestId(const VehiclePropValue& value) { - if (value.value.int32Values.size() < 1) { - return Error(static_cast(StatusCode::INVALID_ARG)) - << "no int32values on " << toString(value); - } - return value.value.int32Values[0]; -} - -Result getSwitchUserMessageType(const VehiclePropValue& value) { - if (value.value.int32Values.size() < 2) { - return Error(static_cast(StatusCode::INVALID_ARG)) - << "missing switch user message type " << toString(value); - } - return user_hal_helper::verifyAndCast(value.value.int32Values[1]); -} - -} // namespace - -bool EmulatedUserHal::isSupported(int32_t prop) { - switch (prop) { - case INITIAL_USER_INFO: - case SWITCH_USER: - case CREATE_USER: - case REMOVE_USER: - case USER_IDENTIFICATION_ASSOCIATION: - return true; - default: - return false; - } -} - -Result> EmulatedUserHal::onSetProperty( - const VehiclePropValue& value) { - ALOGV("onSetProperty(): %s", toString(value).c_str()); - - switch (value.prop) { - case INITIAL_USER_INFO: - return onSetInitialUserInfoResponse(value); - case SWITCH_USER: - return onSetSwitchUserResponse(value); - case CREATE_USER: - return onSetCreateUserResponse(value); - case REMOVE_USER: - ALOGI("REMOVE_USER is FYI only, nothing to do..."); - return {}; - case USER_IDENTIFICATION_ASSOCIATION: - return onSetUserIdentificationAssociation(value); - default: - return Error(static_cast(StatusCode::INVALID_ARG)) - << "Unsupported property: " << toString(value); - } -} - -Result> EmulatedUserHal::onGetProperty( - const VehiclePropValue& value) { - ALOGV("onGetProperty(%s)", toString(value).c_str()); - switch (value.prop) { - case INITIAL_USER_INFO: - case SWITCH_USER: - case CREATE_USER: - case REMOVE_USER: - ALOGE("onGetProperty(): %d is only supported on SET", value.prop); - return Error(static_cast(StatusCode::INVALID_ARG)) << "only supported on SET"; - case USER_IDENTIFICATION_ASSOCIATION: - return onGetUserIdentificationAssociation(value); - default: - ALOGE("onGetProperty(): %d is not supported", value.prop); - return Error(static_cast(StatusCode::INVALID_ARG)) << "not supported by User HAL"; - } -} - -Result> EmulatedUserHal::onGetUserIdentificationAssociation( - const VehiclePropValue& value) { - if (mSetUserIdentificationAssociationResponseFromCmd == nullptr) { - return defaultUserIdentificationAssociation(value); - } - ALOGI("get(USER_IDENTIFICATION_ASSOCIATION): returning %s", - toString(*mSetUserIdentificationAssociationResponseFromCmd).c_str()); - auto newValue = std::unique_ptr( - new VehiclePropValue(*mSetUserIdentificationAssociationResponseFromCmd)); - auto requestId = getRequestId(value); - if (requestId.ok()) { - // Must use the same requestId - newValue->value.int32Values[0] = *requestId; - } else { - ALOGE("get(USER_IDENTIFICATION_ASSOCIATION): no requestId on %s", toString(value).c_str()); - } - return newValue; -} - -Result> EmulatedUserHal::onSetInitialUserInfoResponse( - const VehiclePropValue& value) { - auto requestId = getRequestId(value); - if (!requestId.ok()) { - ALOGE("Failed to get requestId on set(INITIAL_USER_INFO): %s", - requestId.error().message().c_str()); - return requestId.error(); - } - - if (value.areaId != 0) { - ALOGD("set(INITIAL_USER_INFO) called from lshal; storing it: %s", toString(value).c_str()); - mInitialUserResponseFromCmd.reset(new VehiclePropValue(value)); - return {}; - } - - ALOGD("set(INITIAL_USER_INFO) called from Android: %s", toString(value).c_str()); - if (mInitialUserResponseFromCmd != nullptr) { - ALOGI("replying INITIAL_USER_INFO with lshal value: %s", - toString(*mInitialUserResponseFromCmd).c_str()); - return sendUserHalResponse(std::move(mInitialUserResponseFromCmd), *requestId); - } - - // Returns default response - auto updatedValue = user_hal_helper::toVehiclePropValue(InitialUserInfoResponse{ - .requestId = *requestId, - .action = InitialUserInfoResponseAction::DEFAULT, - }); - ALOGI("no lshal response; replying with InitialUserInfoResponseAction::DEFAULT: %s", - toString(*updatedValue).c_str()); - return updatedValue; -} - -Result> EmulatedUserHal::onSetSwitchUserResponse( - const VehiclePropValue& value) { - auto requestId = getRequestId(value); - if (!requestId.ok()) { - ALOGE("Failed to get requestId on set(SWITCH_USER): %s", - requestId.error().message().c_str()); - return requestId.error(); - } - - auto messageType = getSwitchUserMessageType(value); - if (!messageType.ok()) { - ALOGE("Failed to get messageType on set(SWITCH_USER): %s", - messageType.error().message().c_str()); - return messageType.error(); - } - - if (value.areaId != 0) { - if (*messageType == SwitchUserMessageType::VEHICLE_REQUEST) { - // User HAL can also request a user switch, so we need to check it first - ALOGD("set(SWITCH_USER) called from lshal to emulate a vehicle request: %s", - toString(value).c_str()); - return std::unique_ptr(new VehiclePropValue(value)); - } - // Otherwise, we store it - ALOGD("set(SWITCH_USER) called from lshal; storing it: %s", toString(value).c_str()); - mSwitchUserResponseFromCmd.reset(new VehiclePropValue(value)); - return {}; - } - ALOGD("set(SWITCH_USER) called from Android: %s", toString(value).c_str()); - - if (mSwitchUserResponseFromCmd != nullptr) { - ALOGI("replying SWITCH_USER with lshal value: %s", - toString(*mSwitchUserResponseFromCmd).c_str()); - return sendUserHalResponse(std::move(mSwitchUserResponseFromCmd), *requestId); - } - - if (*messageType == SwitchUserMessageType::LEGACY_ANDROID_SWITCH || - *messageType == SwitchUserMessageType::ANDROID_POST_SWITCH) { - ALOGI("request is %s; ignoring it", toString(*messageType).c_str()); - return {}; - } - - // Returns default response - auto updatedValue = user_hal_helper::toVehiclePropValue(SwitchUserResponse{ - .requestId = *requestId, - .messageType = SwitchUserMessageType::VEHICLE_RESPONSE, - .status = SwitchUserStatus::SUCCESS, - }); - ALOGI("no lshal response; replying with VEHICLE_RESPONSE / SUCCESS: %s", - toString(*updatedValue).c_str()); - return updatedValue; -} - -Result> EmulatedUserHal::onSetCreateUserResponse( - const VehiclePropValue& value) { - auto requestId = getRequestId(value); - if (!requestId.ok()) { - ALOGE("Failed to get requestId on set(CREATE_USER): %s", - requestId.error().message().c_str()); - return requestId.error(); - } - - if (value.areaId != 0) { - ALOGD("set(CREATE_USER) called from lshal; storing it: %s", toString(value).c_str()); - mCreateUserResponseFromCmd.reset(new VehiclePropValue(value)); - return {}; - } - ALOGD("set(CREATE_USER) called from Android: %s", toString(value).c_str()); - - if (mCreateUserResponseFromCmd != nullptr) { - ALOGI("replying CREATE_USER with lshal value: %s", - toString(*mCreateUserResponseFromCmd).c_str()); - return sendUserHalResponse(std::move(mCreateUserResponseFromCmd), *requestId); - } - - // Returns default response - auto updatedValue = user_hal_helper::toVehiclePropValue(CreateUserResponse{ - .requestId = *requestId, - .status = CreateUserStatus::SUCCESS, - }); - ALOGI("no lshal response; replying with SUCCESS: %s", toString(*updatedValue).c_str()); - return updatedValue; -} - -Result> EmulatedUserHal::onSetUserIdentificationAssociation( - const VehiclePropValue& value) { - auto requestId = getRequestId(value); - if (!requestId.ok()) { - ALOGE("Failed to get requestId on set(USER_IDENTIFICATION_ASSOCIATION): %s", - requestId.error().message().c_str()); - return requestId.error(); - } - - if (value.areaId != 0) { - ALOGD("set(USER_IDENTIFICATION_ASSOCIATION) called from lshal; storing it: %s", - toString(value).c_str()); - mSetUserIdentificationAssociationResponseFromCmd.reset(new VehiclePropValue(value)); - return {}; - } - ALOGD("set(USER_IDENTIFICATION_ASSOCIATION) called from Android: %s", toString(value).c_str()); - - if (mSetUserIdentificationAssociationResponseFromCmd != nullptr) { - ALOGI("replying USER_IDENTIFICATION_ASSOCIATION with lshal value: %s", - toString(*mSetUserIdentificationAssociationResponseFromCmd).c_str()); - // Not moving response so it can be used on GET requests - auto copy = std::unique_ptr( - new VehiclePropValue(*mSetUserIdentificationAssociationResponseFromCmd)); - return sendUserHalResponse(std::move(copy), *requestId); - } - // Returns default response - return defaultUserIdentificationAssociation(value); -} - -Result> EmulatedUserHal::defaultUserIdentificationAssociation( - const VehiclePropValue& request) { - // TODO(b/159498909): return a response with NOT_ASSOCIATED_ANY_USER for all requested types - ALOGE("no lshal response for %s; replying with NOT_AVAILABLE", toString(request).c_str()); - return Error(static_cast(StatusCode::NOT_AVAILABLE)) << "not set by lshal"; -} - -Result> EmulatedUserHal::sendUserHalResponse( - std::unique_ptr response, int32_t requestId) { - switch (response->areaId) { - case 1: - ALOGD("returning response with right request id"); - response->value.int32Values[0] = requestId; - break; - case 2: - ALOGD("returning response with wrong request id"); - response->value.int32Values[0] = -requestId; - break; - case 3: - ALOGD("not generating a property change event because of lshal prop: %s", - toString(*response).c_str()); - return Error(static_cast(StatusCode::NOT_AVAILABLE)) - << "not generating a property change event because of lshal prop: " - << toString(*response); - default: - ALOGE("invalid action on lshal response: %s", toString(*response).c_str()); - return Error(static_cast(StatusCode::INTERNAL_ERROR)) - << "invalid action on lshal response: " << toString(*response); - } - - ALOGD("updating property to: %s", toString(*response).c_str()); - return response; -} - -void EmulatedUserHal::showDumpHelp(int fd) { - dprintf(fd, "%s: dumps state used for user management\n", kUserHalDumpOption); -} - -void EmulatedUserHal::dump(int fd, std::string indent) { - if (mInitialUserResponseFromCmd != nullptr) { - dprintf(fd, "%sInitialUserInfo response: %s\n", indent.c_str(), - toString(*mInitialUserResponseFromCmd).c_str()); - } else { - dprintf(fd, "%sNo InitialUserInfo response\n", indent.c_str()); - } - if (mSwitchUserResponseFromCmd != nullptr) { - dprintf(fd, "%sSwitchUser response: %s\n", indent.c_str(), - toString(*mSwitchUserResponseFromCmd).c_str()); - } else { - dprintf(fd, "%sNo SwitchUser response\n", indent.c_str()); - } - if (mCreateUserResponseFromCmd != nullptr) { - dprintf(fd, "%sCreateUser response: %s\n", indent.c_str(), - toString(*mCreateUserResponseFromCmd).c_str()); - } else { - dprintf(fd, "%sNo CreateUser response\n", indent.c_str()); - } - if (mSetUserIdentificationAssociationResponseFromCmd != nullptr) { - dprintf(fd, "%sSetUserIdentificationAssociation response: %s\n", indent.c_str(), - toString(*mSetUserIdentificationAssociationResponseFromCmd).c_str()); - } else { - dprintf(fd, "%sNo SetUserIdentificationAssociation response\n", indent.c_str()); - } -} - -} // namespace impl - -} // namespace V2_0 -} // namespace vehicle -} // namespace automotive -} // namespace hardware -} // namespace android diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.h deleted file mode 100644 index db2f117e3e..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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 android_hardware_automotive_vehicle_V2_0_impl_EmulatedUserHal_H_ -#define android_hardware_automotive_vehicle_V2_0_impl_EmulatedUserHal_H_ - -#include - -#include - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { -namespace V2_0 { - -namespace impl { - -constexpr char kUserHalDumpOption[] = "--user-hal"; - -/** - * Class used to emulate User HAL behavior through lshal debug requests. - */ -class EmulatedUserHal { - public: - EmulatedUserHal() {} - - ~EmulatedUserHal() = default; - - /** - * Checks if the emulator can handle the property. - */ - bool isSupported(int32_t prop); - - /** - * Lets the emulator set the property. - * - * @return updated property and StatusCode - */ - android::base::Result> onSetProperty( - const VehiclePropValue& value); - - /** - * Gets the property value from the emulator. - * - * @return property value and StatusCode - */ - android::base::Result> onGetProperty( - const VehiclePropValue& value); - - /** - * Shows the User HAL emulation help. - */ - void showDumpHelp(int fd); - - /** - * Dump its contents. - */ - void dump(int fd, std::string indent); - - private: - /** - * INITIAL_USER_INFO is called by Android when it starts, and it's expecting a property change - * indicating what the initial user should be. - * - * During normal circumstances, the emulator will reply right away, passing a response if - * InitialUserInfoResponseAction::DEFAULT (so Android could use its own logic to decide which - * user to boot). - * - * But during development / testing, the behavior can be changed using lshal dump, which must - * use the areaId to indicate what should happen next. - * - * So, the behavior of set(INITIAL_USER_INFO) is: - * - * - if it has an areaId, store the property into mInitialUserResponseFromCmd (as it was called - * by lshal). - * - else if mInitialUserResponseFromCmd is not set, return a response with the same request id - * and InitialUserInfoResponseAction::DEFAULT - * - else the behavior is defined by the areaId on mInitialUserResponseFromCmd: - * - if it's 1, reply with mInitialUserResponseFromCmd and the right request id - * - if it's 2, reply with mInitialUserResponseFromCmd but a wrong request id (so Android can - * test this error scenario) - * - if it's 3, then don't send a property change (so Android can emulate a timeout) - * - */ - android::base::Result> onSetInitialUserInfoResponse( - const VehiclePropValue& value); - - /** - * Used to emulate SWITCH_USER - see onSetInitialUserInfoResponse() for usage. - */ - android::base::Result> onSetSwitchUserResponse( - const VehiclePropValue& value); - - /** - * Used to emulate CREATE_USER - see onSetInitialUserInfoResponse() for usage. - */ - android::base::Result> onSetCreateUserResponse( - const VehiclePropValue& value); - - /** - * Used to emulate set USER_IDENTIFICATION_ASSOCIATION - see onSetInitialUserInfoResponse() for - * usage. - */ - android::base::Result> onSetUserIdentificationAssociation( - const VehiclePropValue& value); - - /** - * Used to emulate get USER_IDENTIFICATION_ASSOCIATION - see onSetInitialUserInfoResponse() for - * usage. - */ - android::base::Result> onGetUserIdentificationAssociation( - const VehiclePropValue& value); - - /** - * Creates a default USER_IDENTIFICATION_ASSOCIATION when it was not set by lshal. - */ - android::base::Result> defaultUserIdentificationAssociation( - const VehiclePropValue& request); - - android::base::Result> sendUserHalResponse( - std::unique_ptr response, int32_t requestId); - - std::unique_ptr mInitialUserResponseFromCmd; - std::unique_ptr mSwitchUserResponseFromCmd; - std::unique_ptr mCreateUserResponseFromCmd; - std::unique_ptr mSetUserIdentificationAssociationResponseFromCmd; -}; - -} // namespace impl - -} // namespace V2_0 -} // namespace vehicle -} // namespace automotive -} // namespace hardware -} // namespace android - -#endif // android_hardware_automotive_vehicle_V2_0_impl_EmulatedUserHal_H_ diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.cpp deleted file mode 100644 index eae58d0759..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleConnector.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2019 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "automotive.vehicle@2.0-connector" - -#include - -#include -#include - -#include "EmulatedVehicleConnector.h" -#include "JsonFakeValueGenerator.h" -#include "LinearFakeValueGenerator.h" -#include "Obd2SensorStore.h" - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { -namespace V2_0 { - -namespace impl { - -EmulatedUserHal* EmulatedVehicleConnector::getEmulatedUserHal() { - return &mEmulatedUserHal; -} - -void EmulatedVehicleConnector::triggerSendAllValues() { - sendAllValuesToClient(); -} - -StatusCode EmulatedVehicleConnector::onSetProperty(const VehiclePropValue& value, - bool updateStatus) { - if (mEmulatedUserHal.isSupported(value.prop)) { - LOG(INFO) << "onSetProperty(): property " << value.prop << " will be handled by UserHal"; - - const auto& ret = mEmulatedUserHal.onSetProperty(value); - if (!ret.ok()) { - LOG(ERROR) << "onSetProperty(): HAL returned error: " << ret.error().message(); - return StatusCode(ret.error().code()); - } - auto updatedValue = ret.value().get(); - if (updatedValue != nullptr) { - LOG(INFO) << "onSetProperty(): updating property returned by HAL: " - << toString(*updatedValue); - onPropertyValueFromCar(*updatedValue, updateStatus); - } - return StatusCode::OK; - } - return this->VehicleHalServer::onSetProperty(value, updateStatus); -} - -bool EmulatedVehicleConnector::onDump(const hidl_handle& handle, - const hidl_vec& options) { - int fd = handle->data[0]; - - if (options.size() > 0) { - if (options[0] == "--help") { - dprintf(fd, "Emulator-specific usage:\n"); - mEmulatedUserHal.showDumpHelp(fd); - dprintf(fd, "\n"); - // Include caller's help options - return true; - } else if (options[0] == kUserHalDumpOption) { - mEmulatedUserHal.dump(fd, ""); - return false; - - } else { - // Let caller handle the options... - return true; - } - } - - dprintf(fd, "Emulator-specific state:\n"); - mEmulatedUserHal.dump(fd, " "); - dprintf(fd, "\n"); - - return true; -} - -} // namespace impl - -} // namespace V2_0 -} // namespace vehicle -} // namespace automotive -} // namespace hardware -} // namespace android diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp deleted file mode 100644 index e8b79dc394..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp +++ /dev/null @@ -1,532 +0,0 @@ -/* - * 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 "DefaultVehicleHal_v2_0" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "EmulatedVehicleHal.h" -#include "JsonFakeValueGenerator.h" -#include "LinearFakeValueGenerator.h" -#include "Obd2SensorStore.h" - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { -namespace V2_0 { - -namespace impl { - -static constexpr std::chrono::nanoseconds kHeartBeatIntervalNs = 3s; - -static std::unique_ptr fillDefaultObd2Frame(size_t numVendorIntegerSensors, - size_t numVendorFloatSensors) { - std::unique_ptr sensorStore( - new Obd2SensorStore(numVendorIntegerSensors, numVendorFloatSensors)); - - sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::FUEL_SYSTEM_STATUS, - toInt(Obd2FuelSystemStatus::CLOSED_LOOP)); - sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::MALFUNCTION_INDICATOR_LIGHT_ON, 0); - sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::IGNITION_MONITORS_SUPPORTED, - toInt(Obd2IgnitionMonitorKind::SPARK)); - sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::IGNITION_SPECIFIC_MONITORS, - Obd2CommonIgnitionMonitors::COMPONENTS_AVAILABLE | - Obd2CommonIgnitionMonitors::MISFIRE_AVAILABLE | - Obd2SparkIgnitionMonitors::AC_REFRIGERANT_AVAILABLE | - Obd2SparkIgnitionMonitors::EVAPORATIVE_SYSTEM_AVAILABLE); - sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::INTAKE_AIR_TEMPERATURE, 35); - sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::COMMANDED_SECONDARY_AIR_STATUS, - toInt(Obd2SecondaryAirStatus::FROM_OUTSIDE_OR_OFF)); - sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::NUM_OXYGEN_SENSORS_PRESENT, 1); - sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::RUNTIME_SINCE_ENGINE_START, 500); - sensorStore->setIntegerSensor( - DiagnosticIntegerSensorIndex::DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON, 0); - sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::WARMUPS_SINCE_CODES_CLEARED, 51); - sensorStore->setIntegerSensor( - DiagnosticIntegerSensorIndex::DISTANCE_TRAVELED_SINCE_CODES_CLEARED, 365); - sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE, 30); - sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::CONTROL_MODULE_VOLTAGE, 12); - sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::AMBIENT_AIR_TEMPERATURE, 18); - sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::MAX_FUEL_AIR_EQUIVALENCE_RATIO, 1); - sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::FUEL_TYPE, - toInt(Obd2FuelType::GASOLINE)); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::CALCULATED_ENGINE_LOAD, 0.153); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK1, -0.16); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK1, -0.16); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK2, -0.16); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK2, -0.16); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::INTAKE_MANIFOLD_ABSOLUTE_PRESSURE, 7.5); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::ENGINE_RPM, 1250.); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::VEHICLE_SPEED, 40.); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::TIMING_ADVANCE, 2.5); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::THROTTLE_POSITION, 19.75); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::OXYGEN_SENSOR1_VOLTAGE, 0.265); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::FUEL_TANK_LEVEL_INPUT, 0.824); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::EVAPORATION_SYSTEM_VAPOR_PRESSURE, - -0.373); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::CATALYST_TEMPERATURE_BANK1_SENSOR1, - 190.); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::RELATIVE_THROTTLE_POSITION, 3.); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::ABSOLUTE_THROTTLE_POSITION_B, 0.306); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::ACCELERATOR_PEDAL_POSITION_D, 0.188); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::ACCELERATOR_PEDAL_POSITION_E, 0.094); - sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::COMMANDED_THROTTLE_ACTUATOR, 0.024); - - return sensorStore; -} - -EmulatedVehicleHal::EmulatedVehicleHal(VehiclePropertyStore* propStore, VehicleHalClient* client, - EmulatedUserHal* emulatedUserHal) - : mPropStore(propStore), - mHvacPowerProps(std::begin(kHvacPowerProperties), std::end(kHvacPowerProperties)), - mRecurrentTimer(std::bind(&EmulatedVehicleHal::onContinuousPropertyTimer, this, - std::placeholders::_1)), - mVehicleClient(client), - mEmulatedUserHal(emulatedUserHal) { - initStaticConfig(); - mVehicleClient->registerPropertyValueCallback(std::bind(&EmulatedVehicleHal::onPropertyValue, - this, std::placeholders::_1, - std::placeholders::_2)); - - mInitVhalValueOverride = - android::base::GetBoolProperty("persist.vendor.vhal_init_value_override", false); - if (mInitVhalValueOverride) { - getAllPropertiesOverride(); - } -} - -void EmulatedVehicleHal::getAllPropertiesOverride() { - if (auto dir = opendir("/vendor/etc/vhaloverride/")) { - std::regex reg_json(".*[.]json", std::regex::icase); - while (auto f = readdir(dir)) { - if (!regex_match(f->d_name, reg_json)) { - continue; - } - std::string file = "/vendor/etc/vhaloverride/" + std::string(f->d_name); - JsonFakeValueGenerator tmpGenerator(file); - - std::vector propvalues = tmpGenerator.getAllEvents(); - mVehiclePropertiesOverride.insert(std::end(mVehiclePropertiesOverride), - std::begin(propvalues), std::end(propvalues)); - } - closedir(dir); - } -} - -VehicleHal::VehiclePropValuePtr EmulatedVehicleHal::get( - const VehiclePropValue& requestedPropValue, StatusCode* outStatus) { - auto propId = requestedPropValue.prop; - ALOGV("get(%d)", propId); - - auto& pool = *getValuePool(); - VehiclePropValuePtr v = nullptr; - - switch (propId) { - case OBD2_FREEZE_FRAME: - v = pool.obtainComplex(); - *outStatus = fillObd2FreezeFrame(requestedPropValue, v.get()); - break; - case OBD2_FREEZE_FRAME_INFO: - v = pool.obtainComplex(); - *outStatus = fillObd2DtcInfo(v.get()); - break; - default: - if (mEmulatedUserHal != nullptr && mEmulatedUserHal->isSupported(propId)) { - ALOGI("get(): getting value for prop %d from User HAL", propId); - const auto& ret = mEmulatedUserHal->onGetProperty(requestedPropValue); - if (!ret.ok()) { - ALOGE("get(): User HAL returned error: %s", ret.error().message().c_str()); - *outStatus = StatusCode(ret.error().code()); - } else { - auto value = ret.value().get(); - if (value != nullptr) { - ALOGI("get(): User HAL returned value: %s", toString(*value).c_str()); - v = getValuePool()->obtain(*value); - *outStatus = StatusCode::OK; - } else { - ALOGE("get(): User HAL returned null value"); - *outStatus = StatusCode::INTERNAL_ERROR; - } - } - break; - } - - auto internalPropValue = mPropStore->readValueOrNull(requestedPropValue); - if (internalPropValue != nullptr) { - v = getValuePool()->obtain(*internalPropValue); - } - - if (!v) { - *outStatus = StatusCode::INVALID_ARG; - } else if (v->status == VehiclePropertyStatus::AVAILABLE) { - *outStatus = StatusCode::OK; - } else { - *outStatus = StatusCode::TRY_AGAIN; - } - break; - } - if (v.get()) { - v->timestamp = elapsedRealtimeNano(); - } - return v; -} - -bool EmulatedVehicleHal::dump(const hidl_handle& fd, const hidl_vec& options) { - return mVehicleClient->dump(fd, options); -} - -StatusCode EmulatedVehicleHal::set(const VehiclePropValue& propValue) { - constexpr bool updateStatus = false; - - if (propValue.prop == kGenerateFakeDataControllingProperty) { - // Send the generator controlling request to the server. - // 'updateStatus' flag is only for the value sent by setProperty (propValue in this case) - // instead of the generated values triggered by it. 'propValue' works as a control signal - // here, since we never send the control signal back, the value of 'updateStatus' flag - // does not matter here. - auto status = mVehicleClient->setProperty(propValue, updateStatus); - return status; - } else if (mHvacPowerProps.count(propValue.prop)) { - auto hvacPowerOn = mPropStore->readValueOrNull( - toInt(VehicleProperty::HVAC_POWER_ON), - (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT | - VehicleAreaSeat::ROW_2_LEFT | VehicleAreaSeat::ROW_2_CENTER | - VehicleAreaSeat::ROW_2_RIGHT)); - - if (hvacPowerOn && hvacPowerOn->value.int32Values.size() == 1 - && hvacPowerOn->value.int32Values[0] == 0) { - return StatusCode::NOT_AVAILABLE; - } - } else { - // Handle property specific code - switch (propValue.prop) { - case OBD2_FREEZE_FRAME_CLEAR: - return clearObd2FreezeFrames(propValue); - case 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. - return StatusCode::OK; - } - } - - if (propValue.status != VehiclePropertyStatus::AVAILABLE) { - // Android side cannot set property status - this value is the - // purview of the HAL implementation to reflect the state of - // its underlying hardware - return StatusCode::INVALID_ARG; - } - auto currentPropValue = mPropStore->readValueOrNull(propValue); - - if (currentPropValue == nullptr) { - return StatusCode::INVALID_ARG; - } - if (currentPropValue->status != VehiclePropertyStatus::AVAILABLE) { - // do not allow Android side to set() a disabled/error property - return StatusCode::NOT_AVAILABLE; - } - - if (mInEmulator && propValue.prop == toInt(VehicleProperty::DISPLAY_BRIGHTNESS)) { - // Emulator does not support remote brightness control, b/139959479 - // do not send it down so that it does not bring unnecessary property change event - // return other error code, such NOT_AVAILABLE, causes Emulator to be freezing - // TODO: return StatusCode::NOT_AVAILABLE once the above issue is fixed - return StatusCode::OK; - } - - /** - * After checking all conditions, such as the property is available, a real vhal will - * sent the events to Car ECU to take actions. - */ - - // Send the value to the vehicle server, the server will talk to the (real or emulated) car - auto setValueStatus = mVehicleClient->setProperty(propValue, updateStatus); - if (setValueStatus != StatusCode::OK) { - return setValueStatus; - } - - return StatusCode::OK; -} - -static bool isDiagnosticProperty(VehiclePropConfig propConfig) { - switch (propConfig.prop) { - case OBD2_LIVE_FRAME: - case OBD2_FREEZE_FRAME: - case OBD2_FREEZE_FRAME_CLEAR: - case OBD2_FREEZE_FRAME_INFO: - return true; - } - return false; -} - -// Parse supported properties list and generate vector of property values to hold current values. -void EmulatedVehicleHal::onCreate() { - static constexpr bool shouldUpdateStatus = true; - - auto configs = mVehicleClient->getAllPropertyConfig(); - - for (const auto& cfg : configs) { - if (isDiagnosticProperty(cfg)) { - // do not write an initial empty value for the diagnostic properties - // as we will initialize those separately. - continue; - } - - int32_t numAreas = isGlobalProp(cfg.prop) ? 0 : cfg.areaConfigs.size(); - - for (int i = 0; i < numAreas; i++) { - int32_t curArea = isGlobalProp(cfg.prop) ? 0 : cfg.areaConfigs[i].areaId; - - // Create a separate instance for each individual zone - VehiclePropValue prop = { - .areaId = curArea, - .prop = cfg.prop, - .status = VehiclePropertyStatus::UNAVAILABLE, - }; - - if (mInitVhalValueOverride) { - for (auto& itOverride : mVehiclePropertiesOverride) { - if (itOverride.prop == cfg.prop) { - prop.status = VehiclePropertyStatus::AVAILABLE; - prop.value = itOverride.value; - } - } - } - mPropStore->writeValue(prop, shouldUpdateStatus); - } - } - - mVehicleClient->triggerSendAllValues(); - - initObd2LiveFrame(*mPropStore->getConfigOrDie(OBD2_LIVE_FRAME)); - initObd2FreezeFrame(*mPropStore->getConfigOrDie(OBD2_FREEZE_FRAME)); - mInEmulator = isInEmulator(); - ALOGD("mInEmulator=%s", mInEmulator ? "true" : "false"); - mRecurrentTimer.registerRecurrentEvent(kHeartBeatIntervalNs, - static_cast(VehicleProperty::VHAL_HEARTBEAT)); -} - -std::vector EmulatedVehicleHal::listProperties() { - return mPropStore->getAllConfigs(); -} - -void EmulatedVehicleHal::onContinuousPropertyTimer(const std::vector& properties) { - VehiclePropValuePtr v; - - auto& pool = *getValuePool(); - - for (int32_t property : properties) { - if (isContinuousProperty(property)) { - auto internalPropValue = mPropStore->readValueOrNull(property); - if (internalPropValue != nullptr) { - v = pool.obtain(*internalPropValue); - } - } else if (property == static_cast(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(); - } else { - ALOGE("Unexpected onContinuousPropertyTimer for property: 0x%x", property); - } - - if (v.get()) { - v->timestamp = elapsedRealtimeNano(); - doHalEvent(std::move(v)); - } - } -} - -StatusCode EmulatedVehicleHal::subscribe(int32_t property, float sampleRate) { - ALOGI("%s propId: 0x%x, sampleRate: %f", __func__, property, sampleRate); - - if (isContinuousProperty(property)) { - mRecurrentTimer.registerRecurrentEvent(hertzToNanoseconds(sampleRate), property); - } - return StatusCode::OK; -} - -StatusCode EmulatedVehicleHal::unsubscribe(int32_t property) { - ALOGI("%s propId: 0x%x", __func__, property); - if (isContinuousProperty(property)) { - mRecurrentTimer.unregisterRecurrentEvent(property); - } - return StatusCode::OK; -} - -bool EmulatedVehicleHal::isContinuousProperty(int32_t propId) const { - const VehiclePropConfig* config = mPropStore->getConfigOrNull(propId); - if (config == nullptr) { - ALOGW("Config not found for property: 0x%x", propId); - return false; - } - return config->changeMode == VehiclePropertyChangeMode::CONTINUOUS; -} - -bool EmulatedVehicleHal::setPropertyFromVehicle(const VehiclePropValue& propValue) { - constexpr bool updateStatus = true; - return mVehicleClient->setProperty(propValue, updateStatus) == StatusCode::OK; -} - -std::vector EmulatedVehicleHal::getAllProperties() const { - return mPropStore->readAllValues(); -} - -void EmulatedVehicleHal::onPropertyValue(const VehiclePropValue& value, bool updateStatus) { - VehiclePropValuePtr updatedPropValue = getValuePool()->obtain(value); - - if (mPropStore->writeValue(*updatedPropValue, updateStatus)) { - getEmulatorOrDie()->doSetValueFromClient(*updatedPropValue); - doHalEvent(std::move(updatedPropValue)); - } -} - -void EmulatedVehicleHal::initStaticConfig() { - auto configs = mVehicleClient->getAllPropertyConfig(); - for (auto&& cfg : configs) { - VehiclePropertyStore::TokenFunction tokenFunction = nullptr; - - switch (cfg.prop) { - case OBD2_FREEZE_FRAME: { - tokenFunction = [](const VehiclePropValue& propValue) { - return propValue.timestamp; - }; - break; - } - default: - break; - } - - mPropStore->registerProperty(cfg, tokenFunction); - } -} - -void EmulatedVehicleHal::initObd2LiveFrame(const VehiclePropConfig& propConfig) { - static constexpr bool shouldUpdateStatus = true; - - auto liveObd2Frame = createVehiclePropValue(VehiclePropertyType::MIXED, 0); - auto sensorStore = fillDefaultObd2Frame(static_cast(propConfig.configArray[0]), - static_cast(propConfig.configArray[1])); - sensorStore->fillPropValue("", liveObd2Frame.get()); - liveObd2Frame->prop = OBD2_LIVE_FRAME; - - mPropStore->writeValue(*liveObd2Frame, shouldUpdateStatus); -} - -void EmulatedVehicleHal::initObd2FreezeFrame(const VehiclePropConfig& propConfig) { - static constexpr bool shouldUpdateStatus = true; - - auto sensorStore = fillDefaultObd2Frame(static_cast(propConfig.configArray[0]), - static_cast(propConfig.configArray[1])); - - static std::vector sampleDtcs = {"P0070", - "P0102" - "P0123"}; - for (auto&& dtc : sampleDtcs) { - auto freezeFrame = createVehiclePropValue(VehiclePropertyType::MIXED, 0); - sensorStore->fillPropValue(dtc, freezeFrame.get()); - freezeFrame->prop = OBD2_FREEZE_FRAME; - - mPropStore->writeValue(*freezeFrame, shouldUpdateStatus); - } -} - -StatusCode EmulatedVehicleHal::fillObd2FreezeFrame(const VehiclePropValue& requestedPropValue, - VehiclePropValue* outValue) { - if (requestedPropValue.value.int64Values.size() != 1) { - ALOGE("asked for OBD2_FREEZE_FRAME without valid timestamp"); - return StatusCode::INVALID_ARG; - } - auto timestamp = requestedPropValue.value.int64Values[0]; - auto freezeFrame = mPropStore->readValueOrNull(OBD2_FREEZE_FRAME, 0, timestamp); - if (freezeFrame == nullptr) { - ALOGE("asked for OBD2_FREEZE_FRAME at invalid timestamp"); - return StatusCode::INVALID_ARG; - } - outValue->prop = OBD2_FREEZE_FRAME; - outValue->value.int32Values = freezeFrame->value.int32Values; - outValue->value.floatValues = freezeFrame->value.floatValues; - outValue->value.bytes = freezeFrame->value.bytes; - outValue->value.stringValue = freezeFrame->value.stringValue; - outValue->timestamp = freezeFrame->timestamp; - return StatusCode::OK; -} - -StatusCode EmulatedVehicleHal::clearObd2FreezeFrames(const VehiclePropValue& propValue) { - if (propValue.value.int64Values.size() == 0) { - mPropStore->removeValuesForProperty(OBD2_FREEZE_FRAME); - return StatusCode::OK; - } else { - for (int64_t timestamp : propValue.value.int64Values) { - auto freezeFrame = mPropStore->readValueOrNull(OBD2_FREEZE_FRAME, 0, timestamp); - if (freezeFrame == nullptr) { - ALOGE("asked for OBD2_FREEZE_FRAME at invalid timestamp"); - return StatusCode::INVALID_ARG; - } - mPropStore->removeValue(*freezeFrame); - } - } - return StatusCode::OK; -} - -StatusCode EmulatedVehicleHal::fillObd2DtcInfo(VehiclePropValue* outValue) { - std::vector timestamps; - for (const auto& freezeFrame : mPropStore->readValuesForProperty(OBD2_FREEZE_FRAME)) { - timestamps.push_back(freezeFrame.timestamp); - } - outValue->value.int64Values = timestamps; - outValue->prop = OBD2_FREEZE_FRAME_INFO; - return StatusCode::OK; -} - -VehicleHal::VehiclePropValuePtr EmulatedVehicleHal::doInternalHealthCheck() { - VehicleHal::VehiclePropValuePtr v = nullptr; - - // This is an example of very simpe health checking. VHAL is considered healthy if we can read - // PERF_VEHICLE_SPEED. The more comprehensive health checking is required. - VehiclePropValue propValue = { - .prop = static_cast(VehicleProperty::PERF_VEHICLE_SPEED), - }; - auto internalPropValue = mPropStore->readValueOrNull(propValue); - if (internalPropValue != nullptr) { - v = createVhalHeartBeatProp(); - } else { - ALOGW("VHAL health check failed"); - } - return v; -} - -VehicleHal::VehiclePropValuePtr EmulatedVehicleHal::createVhalHeartBeatProp() { - VehicleHal::VehiclePropValuePtr v = getValuePool()->obtainInt64(uptimeMillis()); - v->prop = static_cast(VehicleProperty::VHAL_HEARTBEAT); - v->areaId = 0; - v->status = VehiclePropertyStatus::AVAILABLE; - return v; -} - -} // impl - -} // namespace V2_0 -} // namespace vehicle -} // namespace automotive -} // namespace hardware -} // namespace android diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h index 7871c7b41a..1387f851ef 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Android Open Source Project + * 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. @@ -14,26 +14,14 @@ * limitations under the License. */ -#ifndef android_hardware_automotive_vehicle_V2_0_impl_EmulatedVehicleHal_H_ -#define android_hardware_automotive_vehicle_V2_0_impl_EmulatedVehicleHal_H_ +// This file is just used for soft migration from EmulatedVehicleHal to DefaultVehicleHal. +// The virtualized VHAL that uses EmulatedVehicleHal is at a different repo and cannot be updated +// together with this repo, so we need a soft migration. Once the rename is finished at the +// virtualized VHAL side, this file would be removed. -#include -#include -#include -#include -#include +#pragma once -#include - -#include -#include -#include "vhal_v2_0/VehiclePropertyStore.h" - -#include "EmulatedUserHal.h" -#include "EmulatedVehicleConnector.h" -#include "GeneratorHub.h" -#include "PropertyUtils.h" -#include "VehicleEmulator.h" +#include "DefaultVehicleHal.h" namespace android { namespace hardware { @@ -43,66 +31,16 @@ namespace V2_0 { namespace impl { -/** Implementation of VehicleHal that connected to emulator instead of real vehicle network. */ -class EmulatedVehicleHal : public EmulatedVehicleHalIface { -public: - EmulatedVehicleHal(VehiclePropertyStore* propStore, VehicleHalClient* client, - EmulatedUserHal* emulatedUserHal = nullptr); - ~EmulatedVehicleHal() = default; - - // Methods from VehicleHal - void onCreate() override; - std::vector listProperties() override; - VehiclePropValuePtr get(const VehiclePropValue& requestedPropValue, - StatusCode* outStatus) override; - StatusCode set(const VehiclePropValue& propValue) override; - StatusCode subscribe(int32_t property, float sampleRate) override; - StatusCode unsubscribe(int32_t property) override; - bool dump(const hidl_handle& fd, const hidl_vec& options) override; - - // Methods from EmulatedVehicleHalIface - bool setPropertyFromVehicle(const VehiclePropValue& propValue) override; - std::vector getAllProperties() const override; - void getAllPropertiesOverride(); - -private: - constexpr std::chrono::nanoseconds hertzToNanoseconds(float hz) const { - return std::chrono::nanoseconds(static_cast(1000000000L / hz)); - } - - StatusCode handleGenerateFakeDataRequest(const VehiclePropValue& request); - void onPropertyValue(const VehiclePropValue& value, bool updateStatus); - - void onContinuousPropertyTimer(const std::vector& properties); - bool isContinuousProperty(int32_t propId) const; - void initStaticConfig(); - void initObd2LiveFrame(const VehiclePropConfig& propConfig); - void initObd2FreezeFrame(const VehiclePropConfig& propConfig); - StatusCode fillObd2FreezeFrame(const VehiclePropValue& requestedPropValue, - VehiclePropValue* outValue); - StatusCode fillObd2DtcInfo(VehiclePropValue* outValue); - StatusCode clearObd2FreezeFrames(const VehiclePropValue& propValue); - VehicleHal::VehiclePropValuePtr doInternalHealthCheck(); - VehicleHal::VehiclePropValuePtr createVhalHeartBeatProp(); - - /* Private members */ - VehiclePropertyStore* mPropStore; - std::unordered_set mHvacPowerProps; - RecurrentTimer mRecurrentTimer; - VehicleHalClient* mVehicleClient; - bool mInEmulator; - bool mInitVhalValueOverride; - std::vector mVehiclePropertiesOverride; - EmulatedUserHal* mEmulatedUserHal; +class EmulatedVehicleHal : public DefaultVehicleHal { + public: + EmulatedVehicleHal(VehiclePropertyStore* propStore, VehicleHalClient* client) + : DefaultVehicleHal(propStore, client){}; }; -} // impl +} // namespace impl } // namespace V2_0 } // namespace vehicle } // namespace automotive } // namespace hardware } // namespace android - - -#endif // android_hardware_automotive_vehicle_V2_0_impl_EmulatedVehicleHal_H_ diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/PipeComm.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/PipeComm.cpp deleted file mode 100644 index 81e7c781c2..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/PipeComm.cpp +++ /dev/null @@ -1,105 +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. - */ - -#define LOG_TAG "PipeComm" - -#include -#include - -#include "PipeComm.h" -#include "qemu_pipe.h" - -#define CAR_SERVICE_NAME "pipe:qemud:car" - - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { -namespace V2_0 { - -namespace impl { - -PipeComm::PipeComm(MessageProcessor* messageProcessor) : CommConn(messageProcessor), mPipeFd(-1) {} - -void PipeComm::start() { - int fd = qemu_pipe_open(CAR_SERVICE_NAME); - - if (fd < 0) { - ALOGE("%s: Could not open connection to service: %s %d", __FUNCTION__, strerror(errno), fd); - return; - } - - ALOGI("%s: Starting pipe connection, fd=%d", __FUNCTION__, fd); - mPipeFd = fd; - - CommConn::start(); -} - -void PipeComm::stop() { - if (mPipeFd > 0) { - ::close(mPipeFd); - mPipeFd = -1; - } - CommConn::stop(); -} - -std::vector PipeComm::read() { - static constexpr int MAX_RX_MSG_SZ = 2048; - std::vector msg = std::vector(MAX_RX_MSG_SZ); - int numBytes; - - numBytes = qemu_pipe_frame_recv(mPipeFd, msg.data(), msg.size()); - - if (numBytes == MAX_RX_MSG_SZ) { - ALOGE("%s: Received max size = %d", __FUNCTION__, MAX_RX_MSG_SZ); - } else if (numBytes > 0) { - msg.resize(numBytes); - return msg; - } else { - ALOGD("%s: Connection terminated on pipe %d, numBytes=%d", __FUNCTION__, mPipeFd, numBytes); - mPipeFd = -1; - } - - return std::vector(); -} - -int PipeComm::write(const std::vector& data) { - int retVal = 0; - - if (mPipeFd != -1) { - retVal = qemu_pipe_frame_send(mPipeFd, data.data(), data.size()); - } - - if (retVal < 0) { - retVal = -errno; - ALOGE("%s: send_cmd: (fd=%d): ERROR: %s", __FUNCTION__, mPipeFd, strerror(errno)); - } - - return retVal; -} - - -} // impl - -} // namespace V2_0 -} // namespace vehicle -} // namespace automotive -} // namespace hardware -} // namespace android - - - diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/PipeComm.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/PipeComm.h deleted file mode 100644 index c8eabb8aa7..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/PipeComm.h +++ /dev/null @@ -1,64 +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. - */ - -#ifndef android_hardware_automotive_vehicle_V2_0_impl_PipeComm_H_ -#define android_hardware_automotive_vehicle_V2_0_impl_PipeComm_H_ - -#include -#include -#include "CommConn.h" - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { -namespace V2_0 { - -namespace impl { - -/** - * PipeComm opens a qemu pipe to connect to the emulator, allowing the emulator UI to access the - * Vehicle HAL and simulate changing properties. - * - * Since the pipe is a client, it directly implements CommConn, and only one PipeComm can be open - * at a time. - */ -class PipeComm : public CommConn { - public: - PipeComm(MessageProcessor* messageProcessor); - - void start() override; - void stop() override; - - std::vector read() override; - int write(const std::vector& data) override; - - inline bool isOpen() override { return mPipeFd > 0; } - - private: - int mPipeFd; -}; - -} // impl - -} // namespace V2_0 -} // namespace vehicle -} // namespace automotive -} // namespace hardware -} // namespace android - - -#endif // android_hardware_automotive_vehicle_V2_0_impl_PipeComm_H_ diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/SocketComm.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/SocketComm.cpp deleted file mode 100644 index 916c320b90..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/SocketComm.cpp +++ /dev/null @@ -1,226 +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. - */ - -#define LOG_TAG "SocketComm" - -#include -#include -#include -#include -#include -#include - -#include "SocketComm.h" - -// Socket to use when communicating with Host PC -static constexpr int DEBUG_SOCKET = 33452; - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { -namespace V2_0 { - -namespace impl { - -SocketComm::SocketComm(MessageProcessor* messageProcessor) - : mListenFd(-1), mMessageProcessor(messageProcessor) {} - -SocketComm::~SocketComm() { -} - -void SocketComm::start() { - if (!listen()) { - return; - } - - mListenThread = std::make_unique(std::bind(&SocketComm::listenThread, this)); -} - -void SocketComm::stop() { - if (mListenFd > 0) { - ::close(mListenFd); - if (mListenThread->joinable()) { - mListenThread->join(); - } - mListenFd = -1; - } -} - -void SocketComm::sendMessage(vhal_proto::EmulatorMessage const& msg) { - std::lock_guard lock(mMutex); - for (std::unique_ptr const& conn : mOpenConnections) { - conn->sendMessage(msg); - } -} - -bool SocketComm::listen() { - int retVal; - struct sockaddr_in servAddr; - - mListenFd = socket(AF_INET, SOCK_STREAM, 0); - if (mListenFd < 0) { - ALOGE("%s: socket() failed, mSockFd=%d, errno=%d", __FUNCTION__, mListenFd, errno); - mListenFd = -1; - return false; - } - - memset(&servAddr, 0, sizeof(servAddr)); - servAddr.sin_family = AF_INET; - servAddr.sin_addr.s_addr = INADDR_ANY; - servAddr.sin_port = htons(DEBUG_SOCKET); - - retVal = bind(mListenFd, reinterpret_cast(&servAddr), sizeof(servAddr)); - if(retVal < 0) { - ALOGE("%s: Error on binding: retVal=%d, errno=%d", __FUNCTION__, retVal, errno); - close(mListenFd); - mListenFd = -1; - return false; - } - - ALOGI("%s: Listening for connections on port %d", __FUNCTION__, DEBUG_SOCKET); - if (::listen(mListenFd, 1) == -1) { - ALOGE("%s: Error on listening: errno: %d: %s", __FUNCTION__, errno, strerror(errno)); - return false; - } - return true; -} - -SocketConn* SocketComm::accept() { - sockaddr_in cliAddr; - socklen_t cliLen = sizeof(cliAddr); - int sfd = ::accept(mListenFd, reinterpret_cast(&cliAddr), &cliLen); - - if (sfd > 0) { - char addr[INET_ADDRSTRLEN]; - inet_ntop(AF_INET, &cliAddr.sin_addr, addr, INET_ADDRSTRLEN); - - ALOGD("%s: Incoming connection received from %s:%d", __FUNCTION__, addr, cliAddr.sin_port); - return new SocketConn(mMessageProcessor, sfd); - } - - return nullptr; -} - -void SocketComm::listenThread() { - while (true) { - SocketConn* conn = accept(); - if (conn == nullptr) { - return; - } - - conn->start(); - { - std::lock_guard lock(mMutex); - mOpenConnections.push_back(std::unique_ptr(conn)); - } - } -} - -/** - * Called occasionally to clean up connections that have been closed. - */ -void SocketComm::removeClosedConnections() { - std::lock_guard lock(mMutex); - std::remove_if(mOpenConnections.begin(), mOpenConnections.end(), - [](std::unique_ptr const& c) { return !c->isOpen(); }); -} - -SocketConn::SocketConn(MessageProcessor* messageProcessor, int sfd) - : CommConn(messageProcessor), mSockFd(sfd) {} - -/** - * Reads, in a loop, exactly numBytes from the given fd. If the connection is closed, returns - * an empty buffer, otherwise will return exactly the given number of bytes. - */ -std::vector readExactly(int fd, int numBytes) { - std::vector buffer(numBytes); - int totalRead = 0; - int offset = 0; - while (totalRead < numBytes) { - int numRead = ::read(fd, &buffer.data()[offset], numBytes - offset); - if (numRead == 0) { - buffer.resize(0); - return buffer; - } - - totalRead += numRead; - } - return buffer; -} - -/** - * Reads an int, guaranteed to be non-zero, from the given fd. If the connection is closed, returns - * -1. - */ -int32_t readInt(int fd) { - std::vector buffer = readExactly(fd, sizeof(int32_t)); - if (buffer.size() == 0) { - return -1; - } - - int32_t value = *reinterpret_cast(buffer.data()); - return ntohl(value); -} - -std::vector SocketConn::read() { - int32_t msgSize = readInt(mSockFd); - if (msgSize <= 0) { - ALOGD("%s: Connection terminated on socket %d", __FUNCTION__, mSockFd); - return std::vector(); - } - - return readExactly(mSockFd, msgSize); -} - -void SocketConn::stop() { - if (mSockFd > 0) { - close(mSockFd); - mSockFd = -1; - } -} - -int SocketConn::write(const std::vector& data) { - static constexpr int MSG_HEADER_LEN = 4; - int retVal = 0; - union { - uint32_t msgLen; - uint8_t msgLenBytes[MSG_HEADER_LEN]; - }; - - // Prepare header for the message - msgLen = static_cast(data.size()); - msgLen = htonl(msgLen); - - if (mSockFd > 0) { - retVal = ::write(mSockFd, msgLenBytes, MSG_HEADER_LEN); - - if (retVal == MSG_HEADER_LEN) { - retVal = ::write(mSockFd, data.data(), data.size()); - } - } - - return retVal; -} - -} // impl - -} // namespace V2_0 -} // namespace vehicle -} // namespace automotive -} // namespace hardware -} // namespace android - diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/SocketComm.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/SocketComm.h deleted file mode 100644 index 52326b9fc7..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/SocketComm.h +++ /dev/null @@ -1,125 +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. - */ - -#ifndef android_hardware_automotive_vehicle_V2_0_impl_SocketComm_H_ -#define android_hardware_automotive_vehicle_V2_0_impl_SocketComm_H_ - -#include -#include -#include -#include "CommConn.h" - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { -namespace V2_0 { - -namespace impl { - -class SocketConn; - -/** - * SocketComm opens a socket, and listens for connections from clients. Typically the client will be - * adb's TCP port-forwarding to enable a host PC to connect to the VehicleHAL. - */ -class SocketComm { - public: - SocketComm(MessageProcessor* messageProcessor); - virtual ~SocketComm(); - - void start(); - void stop(); - - /** - * Serialized and send the given message to all connected clients. - */ - void sendMessage(vhal_proto::EmulatorMessage const& msg); - - private: - int mListenFd; - std::unique_ptr mListenThread; - std::vector> mOpenConnections; - MessageProcessor* mMessageProcessor; - std::mutex mMutex; - - /** - * Opens the socket and begins listening. - * - * @return bool Returns true on success. - */ - bool listen(); - - /** - * Blocks and waits for a connection from a client, returns a new SocketConn with the connection - * or null, if the connection has been closed. - * - * @return int Returns fd or socket number if connection is successful. - * Otherwise, returns -1 if no connection is availble. - */ - SocketConn* accept(); - - void listenThread(); - - void removeClosedConnections(); -}; - -/** - * SocketConn represents a single connection to a client. - */ -class SocketConn : public CommConn { - public: - SocketConn(MessageProcessor* messageProcessor, int sfd); - virtual ~SocketConn() = default; - - /** - * Blocking call to read data from the connection. - * - * @return std::vector Serialized protobuf data received from emulator. This will be - * an empty vector if the connection was closed or some other error occurred. - */ - std::vector read() override; - - /** - * Closes a connection if it is open. - */ - void stop() override; - - /** - * Transmits a string of data to the emulator. - * - * @param data Serialized protobuf data to transmit. - * - * @return int Number of bytes transmitted, or -1 if failed. - */ - int write(const std::vector& data) override; - - inline bool isOpen() override { return mSockFd > 0; } - - private: - int mSockFd; -}; - -} // impl - -} // namespace V2_0 -} // namespace vehicle -} // namespace automotive -} // namespace hardware -} // namespace android - - -#endif // android_hardware_automotive_vehicle_V2_0_impl_SocketComm_H_ diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.cpp deleted file mode 100644 index f7d0854d1c..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.cpp +++ /dev/null @@ -1,239 +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. - */ -#define LOG_TAG "VehicleEmulator_v2_0" -#include - -#include -#include -#include -#include - -#include - -#include "PipeComm.h" -#include "ProtoMessageConverter.h" -#include "SocketComm.h" - -#include "VehicleEmulator.h" - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { -namespace V2_0 { - -namespace impl { - -VehicleEmulator::VehicleEmulator(EmulatedVehicleHalIface* hal) : mHal{hal} { - mHal->registerEmulator(this); - - ALOGI("Starting SocketComm"); - mSocketComm = std::make_unique(this); - mSocketComm->start(); - - if (isInEmulator()) { - ALOGI("Starting PipeComm"); - mPipeComm = std::make_unique(this); - mPipeComm->start(); - } -} - -VehicleEmulator::~VehicleEmulator() { - mSocketComm->stop(); - if (mPipeComm) { - mPipeComm->stop(); - } -} - -/** - * This is called by the HAL when a property changes. We need to notify our clients that it has - * changed. - */ -void VehicleEmulator::doSetValueFromClient(const VehiclePropValue& propValue) { - vhal_proto::EmulatorMessage msg; - vhal_proto::VehiclePropValue* val = msg.add_value(); - populateProtoVehiclePropValue(val, &propValue); - msg.set_status(vhal_proto::RESULT_OK); - msg.set_msg_type(vhal_proto::SET_PROPERTY_ASYNC); - - mSocketComm->sendMessage(msg); - if (mPipeComm) { - mPipeComm->sendMessage(msg); - } -} - -void VehicleEmulator::doGetConfig(VehicleEmulator::EmulatorMessage const& rxMsg, - VehicleEmulator::EmulatorMessage& respMsg) { - std::vector configs = mHal->listProperties(); - vhal_proto::VehiclePropGet getProp = rxMsg.prop(0); - - respMsg.set_msg_type(vhal_proto::GET_CONFIG_RESP); - respMsg.set_status(vhal_proto::ERROR_INVALID_PROPERTY); - - for (auto& config : configs) { - // Find the config we are looking for - if (config.prop == getProp.prop()) { - vhal_proto::VehiclePropConfig* protoCfg = respMsg.add_config(); - populateProtoVehicleConfig(protoCfg, config); - respMsg.set_status(vhal_proto::RESULT_OK); - break; - } - } -} - -void VehicleEmulator::doGetConfigAll(VehicleEmulator::EmulatorMessage const& /* rxMsg */, - VehicleEmulator::EmulatorMessage& respMsg) { - std::vector configs = mHal->listProperties(); - - respMsg.set_msg_type(vhal_proto::GET_CONFIG_ALL_RESP); - respMsg.set_status(vhal_proto::RESULT_OK); - - for (auto& config : configs) { - vhal_proto::VehiclePropConfig* protoCfg = respMsg.add_config(); - populateProtoVehicleConfig(protoCfg, config); - } -} - -void VehicleEmulator::doGetProperty(VehicleEmulator::EmulatorMessage const& rxMsg, - VehicleEmulator::EmulatorMessage& respMsg) { - int32_t areaId = 0; - vhal_proto::VehiclePropGet getProp = rxMsg.prop(0); - int32_t propId = getProp.prop(); - vhal_proto::Status status = vhal_proto::ERROR_INVALID_PROPERTY; - - respMsg.set_msg_type(vhal_proto::GET_PROPERTY_RESP); - - if (getProp.has_area_id()) { - areaId = getProp.area_id(); - } - - { - VehiclePropValue request = { - .areaId = areaId, - .prop = propId, - }; - StatusCode halStatus; - auto val = mHal->get(request, &halStatus); - if (val != nullptr) { - vhal_proto::VehiclePropValue* protoVal = respMsg.add_value(); - populateProtoVehiclePropValue(protoVal, val.get()); - status = vhal_proto::RESULT_OK; - } - } - - respMsg.set_status(status); -} - -void VehicleEmulator::doGetPropertyAll(VehicleEmulator::EmulatorMessage const& /* rxMsg */, - VehicleEmulator::EmulatorMessage& respMsg) { - respMsg.set_msg_type(vhal_proto::GET_PROPERTY_ALL_RESP); - respMsg.set_status(vhal_proto::RESULT_OK); - - { - for (const auto& prop : mHal->getAllProperties()) { - vhal_proto::VehiclePropValue* protoVal = respMsg.add_value(); - populateProtoVehiclePropValue(protoVal, &prop); - } - } -} - -void VehicleEmulator::doSetProperty(VehicleEmulator::EmulatorMessage const& rxMsg, - VehicleEmulator::EmulatorMessage& respMsg) { - vhal_proto::VehiclePropValue protoVal = rxMsg.value(0); - VehiclePropValue val = { - .timestamp = elapsedRealtimeNano(), - .areaId = protoVal.area_id(), - .prop = protoVal.prop(), - .status = (VehiclePropertyStatus)protoVal.status(), - }; - - respMsg.set_msg_type(vhal_proto::SET_PROPERTY_RESP); - - // Copy value data if it is set. This automatically handles complex data types if needed. - if (protoVal.has_string_value()) { - val.value.stringValue = protoVal.string_value().c_str(); - } - - if (protoVal.has_bytes_value()) { - val.value.bytes = std::vector { protoVal.bytes_value().begin(), - protoVal.bytes_value().end() }; - } - - if (protoVal.int32_values_size() > 0) { - val.value.int32Values = std::vector { protoVal.int32_values().begin(), - protoVal.int32_values().end() }; - } - - if (protoVal.int64_values_size() > 0) { - val.value.int64Values = std::vector { protoVal.int64_values().begin(), - protoVal.int64_values().end() }; - } - - if (protoVal.float_values_size() > 0) { - val.value.floatValues = std::vector { protoVal.float_values().begin(), - protoVal.float_values().end() }; - } - - bool halRes = mHal->setPropertyFromVehicle(val); - respMsg.set_status(halRes ? vhal_proto::RESULT_OK : vhal_proto::ERROR_INVALID_PROPERTY); -} - -void VehicleEmulator::processMessage(vhal_proto::EmulatorMessage const& rxMsg, - vhal_proto::EmulatorMessage& respMsg) { - switch (rxMsg.msg_type()) { - case vhal_proto::GET_CONFIG_CMD: - doGetConfig(rxMsg, respMsg); - break; - case vhal_proto::GET_CONFIG_ALL_CMD: - doGetConfigAll(rxMsg, respMsg); - break; - case vhal_proto::GET_PROPERTY_CMD: - doGetProperty(rxMsg, respMsg); - break; - case vhal_proto::GET_PROPERTY_ALL_CMD: - doGetPropertyAll(rxMsg, respMsg); - break; - case vhal_proto::SET_PROPERTY_CMD: - doSetProperty(rxMsg, respMsg); - break; - default: - ALOGW("%s: Unknown message received, type = %d", __func__, rxMsg.msg_type()); - respMsg.set_status(vhal_proto::ERROR_UNIMPLEMENTED_CMD); - break; - } -} - -void VehicleEmulator::populateProtoVehicleConfig(vhal_proto::VehiclePropConfig* protoCfg, - const VehiclePropConfig& cfg) { - return proto_msg_converter::toProto(protoCfg, cfg); -} - -void VehicleEmulator::populateProtoVehiclePropValue(vhal_proto::VehiclePropValue* protoVal, - const VehiclePropValue* val) { - return proto_msg_converter::toProto(protoVal, *val); -} - -bool isInEmulator() { - return android::base::GetBoolProperty("ro.boot.qemu", false); -} - -} // impl - -} // namespace V2_0 -} // namespace vehicle -} // namespace automotive -} // namespace hardware -} // namespace android diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.h deleted file mode 100644 index 434d79b542..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.h +++ /dev/null @@ -1,109 +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. - */ - -#ifndef android_hardware_automotive_vehicle_V2_0_impl_VehicleHalEmulator_H_ -#define android_hardware_automotive_vehicle_V2_0_impl_VehicleHalEmulator_H_ - -#include -#include -#include -#include - -#include "vhal_v2_0/VehicleHal.h" - -#include "CommConn.h" -#include "PipeComm.h" -#include "SocketComm.h" -#include "VehicleHalProto.pb.h" - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { -namespace V2_0 { - -namespace impl { - -class VehicleEmulator; // Forward declaration. - -/** Extension of VehicleHal that used by VehicleEmulator. */ -class EmulatedVehicleHalIface : public VehicleHal { -public: - virtual bool setPropertyFromVehicle(const VehiclePropValue& propValue) = 0; - virtual std::vector getAllProperties() const = 0; - - void registerEmulator(VehicleEmulator* emulator) { - ALOGI("%s, emulator: %p", __func__, emulator); - std::lock_guard g(mEmulatorLock); - mEmulator = emulator; - } - -protected: - VehicleEmulator* getEmulatorOrDie() { - std::lock_guard g(mEmulatorLock); - if (mEmulator == nullptr) abort(); - return mEmulator; - } - -private: - mutable std::mutex mEmulatorLock; - VehicleEmulator* mEmulator; -}; - -/** - * Emulates vehicle by providing controlling interface from host side either through ADB or Pipe. - */ -class VehicleEmulator : public MessageProcessor { - public: - VehicleEmulator(EmulatedVehicleHalIface* hal); - virtual ~VehicleEmulator(); - - void doSetValueFromClient(const VehiclePropValue& propValue); - void processMessage(vhal_proto::EmulatorMessage const& rxMsg, - vhal_proto::EmulatorMessage& respMsg) override; - - private: - friend class ConnectionThread; - using EmulatorMessage = vhal_proto::EmulatorMessage; - - void doGetConfig(EmulatorMessage const& rxMsg, EmulatorMessage& respMsg); - void doGetConfigAll(EmulatorMessage const& rxMsg, EmulatorMessage& respMsg); - void doGetProperty(EmulatorMessage const& rxMsg, EmulatorMessage& respMsg); - void doGetPropertyAll(EmulatorMessage const& rxMsg, EmulatorMessage& respMsg); - void doSetProperty(EmulatorMessage const& rxMsg, EmulatorMessage& respMsg); - void populateProtoVehicleConfig(vhal_proto::VehiclePropConfig* protoCfg, - const VehiclePropConfig& cfg); - void populateProtoVehiclePropValue(vhal_proto::VehiclePropValue* protoVal, - const VehiclePropValue* val); - -private: - EmulatedVehicleHalIface* mHal; - std::unique_ptr mSocketComm; - std::unique_ptr mPipeComm; -}; - -// determine if it's running inside Android Emulator -bool isInEmulator(); - -} // impl - -} // namespace V2_0 -} // namespace vehicle -} // namespace automotive -} // namespace hardware -} // namespace android - -#endif // android_hardware_automotive_vehicle_V2_0_impl_VehicleHalEmulator_H_ diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalClient.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalClient.cpp index 25ffc6d70d..bafd170dcc 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalClient.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalClient.cpp @@ -18,7 +18,13 @@ #include -namespace android::hardware::automotive::vehicle::V2_0::impl { +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace V2_0 { + +namespace impl { void VehicleHalClient::onPropertyValue(const VehiclePropValue& value, bool updateStatus) { if (!mPropCallback) { @@ -36,4 +42,10 @@ void VehicleHalClient::registerPropertyValueCallback(PropertyCallBackType&& call mPropCallback = std::move(callback); } -} // namespace android::hardware::automotive::vehicle::V2_0::impl +} // namespace impl + +} // namespace V2_0 +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalClient.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalClient.h index 81dfca1b06..2473f194c5 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalClient.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalClient.h @@ -18,7 +18,13 @@ #include -namespace android::hardware::automotive::vehicle::V2_0::impl { +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace V2_0 { + +namespace impl { // The common client operations that may be used by both native and // virtualized VHAL clients. @@ -40,4 +46,10 @@ class VehicleHalClient : public IVehicleClient { PropertyCallBackType mPropCallback; }; -} // namespace android::hardware::automotive::vehicle::V2_0::impl +} // namespace impl + +} // namespace V2_0 +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.h index be88cd94cd..1290f30a9e 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleHalServer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 The Android Open Source Project + * 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. @@ -14,56 +14,32 @@ * limitations under the License. */ +// This file is just used for soft migration from VehicleHalServer to DefaultVehicleHalServer. +// The virtualized VHAL that uses VehichleHalServer is at a different repo and cannot be updated +// together with this repo, so we need a soft migration. Once the rename is finished at the +// virtualized VHAL side, this file would be removed. + #pragma once -#include -#include -#include +#include "DefaultVehicleHalServer.h" -#include "GeneratorHub.h" +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace V2_0 { -namespace android::hardware::automotive::vehicle::V2_0::impl { +namespace impl { -// This contains the common server operations that will be used by -// both native and virtualized VHAL server. Notice that in the virtualized -// scenario, the server may be run on a different OS than Android. -class VehicleHalServer : public IVehicleServer { +class VehicleHalServer : public DefaultVehicleHalServer { public: - VehicleHalServer(); - - void sendAllValuesToClient(); - - // Methods from IVehicleServer - - std::vector onGetAllPropertyConfig() const override; - - StatusCode onSetProperty(const VehiclePropValue& value, bool updateStatus) override; - - // Set the Property Value Pool used in this server - void setValuePool(VehiclePropValuePool* valuePool); - - private: - using VehiclePropValuePtr = recyclable_ptr; - - GeneratorHub* getGenerator(); - - VehiclePropValuePool* getValuePool() const; - - void onFakeValueGenerated(const VehiclePropValue& value); - - StatusCode handleGenerateFakeDataRequest(const VehiclePropValue& request); - - VehiclePropValuePtr createApPowerStateReq(VehicleApPowerStateReq req, int32_t param); - - VehiclePropValuePtr createHwInputKeyProp(VehicleHwKeyInputAction action, int32_t keyCode, - int32_t targetDisplay); - - private: - GeneratorHub mGeneratorHub{ - std::bind(&VehicleHalServer::onFakeValueGenerated, this, std::placeholders::_1)}; - - VehiclePropValuePool* mValuePool{nullptr}; - VehiclePropertyStore mServerSidePropStore; + VehicleHalServer() : DefaultVehicleHalServer(){}; }; -} // namespace android::hardware::automotive::vehicle::V2_0::impl +} // namespace impl + +} // namespace V2_0 +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/Android.bp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/Android.bp index 6e85ae96ee..3307bd62a3 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/Android.bp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/Android.bp @@ -24,6 +24,10 @@ package { cc_library_static { name: "android.hardware.automotive.vehicle@2.0-libproto-native", + visibility: [ + "//hardware/interfaces/automotive/vehicle/2.0/default:__subpackages__", + "//device/generic/car/emulator/vhal_v2_0:__subpackages__", + ], vendor: true, host_supported: true, proto: { diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/qemu_pipe.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/qemu_pipe.cpp deleted file mode 100644 index cf1a002479..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/qemu_pipe.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "qemu_pipe.h" - -#include -#include -#include -#include -#include - -#include - -using android::base::ReadFully; -using android::base::WriteFully; - -// Define QEMU_PIPE_DEBUG if you want to print error messages when an error -// occurs during pipe operations. The macro should simply take a printf-style -// formatting string followed by optional arguments. -#ifndef QEMU_PIPE_DEBUG -#define QEMU_PIPE_DEBUG(...) (void)0 -#endif - -int qemu_pipe_open(const char* pipeName) { - if (!pipeName) { - errno = EINVAL; - return -1; - } - - int fd = TEMP_FAILURE_RETRY(open("/dev/qemu_pipe", O_RDWR)); - if (fd < 0) { - QEMU_PIPE_DEBUG("%s: Could not open /dev/qemu_pipe: %s", __FUNCTION__, strerror(errno)); - return -1; - } - - // Write the pipe name, *including* the trailing zero which is necessary. - size_t pipeNameLen = strlen(pipeName); - if (WriteFully(fd, pipeName, pipeNameLen + 1U)) { - return fd; - } - - // now, add 'pipe:' prefix and try again - // Note: host side will wait for the trailing '\0' to start - // service lookup. - const char pipe_prefix[] = "pipe:"; - if (WriteFully(fd, pipe_prefix, strlen(pipe_prefix)) && - WriteFully(fd, pipeName, pipeNameLen + 1U)) { - return fd; - } - QEMU_PIPE_DEBUG("%s: Could not write to %s pipe service: %s", __FUNCTION__, pipeName, - strerror(errno)); - close(fd); - return -1; -} - -int qemu_pipe_frame_send(int fd, const void* buff, size_t len) { - char header[5]; - snprintf(header, sizeof(header), "%04zx", len); - if (!WriteFully(fd, header, 4)) { - QEMU_PIPE_DEBUG("Can't write qemud frame header: %s", strerror(errno)); - return -1; - } - if (!WriteFully(fd, buff, len)) { - QEMU_PIPE_DEBUG("Can't write qemud frame payload: %s", strerror(errno)); - return -1; - } - return 0; -} - -int qemu_pipe_frame_recv(int fd, void* buff, size_t len) { - char header[5]; - if (!ReadFully(fd, header, 4)) { - QEMU_PIPE_DEBUG("Can't read qemud frame header: %s", strerror(errno)); - return -1; - } - header[4] = '\0'; - size_t size; - if (sscanf(header, "%04zx", &size) != 1) { - QEMU_PIPE_DEBUG("Malformed qemud frame header: [%.*s]", 4, header); - return -1; - } - if (size > len) { - QEMU_PIPE_DEBUG("Oversized qemud frame (% bytes, expected <= %)", size, len); - return -1; - } - if (!ReadFully(fd, buff, size)) { - QEMU_PIPE_DEBUG("Could not read qemud frame payload: %s", strerror(errno)); - return -1; - } - return size; -} diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/qemu_pipe.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/qemu_pipe.h deleted file mode 100644 index 0987498990..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/qemu_pipe.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_CORE_INCLUDE_QEMU_PIPE_H -#define ANDROID_CORE_INCLUDE_QEMU_PIPE_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif -// Try to open a new Qemu fast-pipe. This function returns a file descriptor -// that can be used to communicate with a named service managed by the -// emulator. -// -// This file descriptor can be used as a standard pipe/socket descriptor. -// -// 'pipeName' is the name of the emulator service you want to connect to, -// and should begin with 'pipe:' (e.g. 'pipe:camera' or 'pipe:opengles'). -// For backward compatibility, the 'pipe:' prefix can be omitted, and in -// that case, qemu_pipe_open will add it for you. - -// On success, return a valid file descriptor, or -1/errno on failure. E.g.: -// -// EINVAL -> unknown/unsupported pipeName -// ENOSYS -> fast pipes not available in this system. -// -// ENOSYS should never happen, except if you're trying to run within a -// misconfigured emulator. -// -// You should be able to open several pipes to the same pipe service, -// except for a few special cases (e.g. GSM modem), where EBUSY will be -// returned if more than one client tries to connect to it. -int qemu_pipe_open(const char* pipeName); - -// Send a framed message |buff| of |len| bytes through the |fd| descriptor. -// This really adds a 4-hexchar prefix describing the payload size. -// Returns 0 on success, and -1 on error. -int qemu_pipe_frame_send(int fd, const void* buff, size_t len); - -// Read a frame message from |fd|, and store it into |buff| of |len| bytes. -// If the framed message is larger than |len|, then this returns -1 and the -// content is lost. Otherwise, this returns the size of the message. NOTE: -// empty messages are possible in a framed wire protocol and do not mean -// end-of-stream. -int qemu_pipe_frame_recv(int fd, void* buff, size_t len); - -#ifdef __cplusplus -} -#endif - -#endif /* ANDROID_CORE_INCLUDE_QEMU_PIPE_H */ diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp index 3817e4406e..a507b501b8 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp @@ -17,9 +17,9 @@ #include #include +#include #include "vhal_v2_0/DefaultConfig.h" -#include "vhal_v2_0/ProtoMessageConverter.h" #include "vhal_v2_0/VehicleUtils.h" namespace android { -- GitLab From e45604161a0b6cd2f191931878846a174e1e32b3 Mon Sep 17 00:00:00 2001 From: Nathalie Le Clair Date: Wed, 30 Jun 2021 09:32:11 +0000 Subject: [PATCH 064/825] Adding OWNERS for CEC HAL Bug: 185434120 Test: none Change-Id: Ie475d581a7e703f9f82a7afb9188c9a2c789189b --- tv/cec/1.0/default/OWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 tv/cec/1.0/default/OWNERS diff --git a/tv/cec/1.0/default/OWNERS b/tv/cec/1.0/default/OWNERS new file mode 100644 index 0000000000..c1d3f1d4b9 --- /dev/null +++ b/tv/cec/1.0/default/OWNERS @@ -0,0 +1 @@ +include platform/frameworks/base:/core/java/android/hardware/hdmi/OWNERS -- GitLab From 872cc0af1a7082c6b420864b7ff52e34e6101f84 Mon Sep 17 00:00:00 2001 From: ramindani Date: Tue, 29 Jun 2021 00:32:43 +0000 Subject: [PATCH 065/825] Add VTS test for YCbCr_P010 to denote that YCbCr_P010 is supported in Gralloc BUG: 181069130 Test: atest VtsHalGraphicsMapperV3_0TargetTest Change-Id: I43737dcbb530c0c4018b9609434eef38d8daa887 --- .../VtsHalGraphicsMapperV3_0TargetTest.cpp | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/graphics/mapper/3.0/vts/functional/VtsHalGraphicsMapperV3_0TargetTest.cpp b/graphics/mapper/3.0/vts/functional/VtsHalGraphicsMapperV3_0TargetTest.cpp index 4187dd1354..6c90af407a 100644 --- a/graphics/mapper/3.0/vts/functional/VtsHalGraphicsMapperV3_0TargetTest.cpp +++ b/graphics/mapper/3.0/vts/functional/VtsHalGraphicsMapperV3_0TargetTest.cpp @@ -326,6 +326,39 @@ TEST_P(GraphicsMapperHidlTest, LockUnlockBasic) { } } +/** + * Test IMapper::lockYCbCr. This locks a YCbCr_P010 buffer and verifies that it's initialized. + */ +TEST_P(GraphicsMapperHidlTest, LockYCbCrP010) { + auto info = mDummyDescriptorInfo; + info.format = PixelFormat::YCBCR_P010; + + const native_handle_t* bufferHandle; + uint32_t stride; + ASSERT_NO_FATAL_FAILURE(bufferHandle = mGralloc->allocate(info, true, &stride)); + + ASSERT_NE(nullptr, bufferHandle); + + const IMapper::Rect region{0, 0, static_cast(info.width), + static_cast(info.height)}; + int fence = -1; + YCbCrLayout y_cb_cr_layout{}; + // lock buffer + ASSERT_NO_FATAL_FAILURE(y_cb_cr_layout = + mGralloc->lockYCbCr(bufferHandle, info.usage, region, fence)); + + ASSERT_NE(nullptr, &y_cb_cr_layout); + EXPECT_EQ(stride, info.width); + EXPECT_EQ(y_cb_cr_layout.yStride, info.height * 2); + EXPECT_EQ(y_cb_cr_layout.cStride, y_cb_cr_layout.yStride); + EXPECT_EQ(4, y_cb_cr_layout.chromaStep); + + ASSERT_NO_FATAL_FAILURE(fence = mGralloc->unlock(bufferHandle)); + if (fence >= 0) { + close(fence); + } +} + /** * Test IMapper::lockYCbCr. This locks a YV12 buffer, and makes sure we can * write to and read from it. -- GitLab From eadcf71d4b5ff6e2f6234af31e340d7f8bf32b01 Mon Sep 17 00:00:00 2001 From: Keun young Park Date: Wed, 30 Jun 2021 12:14:40 -0700 Subject: [PATCH 066/825] change all automotive AIDL HAL to generate Java for module - CarService will become mainline module, Bug: 192462140 Test: build Change-Id: I71e2955de12594ff0a8dc74cdcc269997e214ef1 --- automotive/occupant_awareness/aidl/Android.bp | 2 +- automotive/vehicle/aidl/Android.bp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/automotive/occupant_awareness/aidl/Android.bp b/automotive/occupant_awareness/aidl/Android.bp index 26c53fa4bb..288dc6d0c0 100644 --- a/automotive/occupant_awareness/aidl/Android.bp +++ b/automotive/occupant_awareness/aidl/Android.bp @@ -16,7 +16,7 @@ aidl_interface { stability: "vintf", backend: { java: { - platform_apis: true, + sdk_version: "module_current", }, ndk: { vndk: { diff --git a/automotive/vehicle/aidl/Android.bp b/automotive/vehicle/aidl/Android.bp index 56a85b9cd2..477f8ed3e6 100644 --- a/automotive/vehicle/aidl/Android.bp +++ b/automotive/vehicle/aidl/Android.bp @@ -34,7 +34,7 @@ aidl_interface { enabled: true, }, java: { - enabled: true, + sdk_version: "module_current", }, }, } -- GitLab From 39844576b73648577328a3644d8f115bd97b9c15 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 23 Jun 2021 20:42:24 -0700 Subject: [PATCH 067/825] Add default VHAL test. Add tests for default VHAL implementation. This CL also modifies the onDump interface for IVehicleServer. The onDump interface now returns the dumped info to the caller and let the caller print the info to hidl_handle. This is due to IVehicleServer might run in non-android VM that has no notion of HIDL handle. Test: atest Change-Id: I4fc5dedf69d6730b1b196ce171be08339ee7fbd2 Test: run test --- automotive/vehicle/2.0/default/Android.bp | 18 +- .../include/vhal_v2_0/VehicleConnector.h | 17 +- .../common/include/vhal_v2_0/VehicleServer.h | 18 +- .../default/impl/vhal_v2_0/DefaultConfig.h | 12 +- .../vhal_v2_0/DefaultVehicleHalServer.cpp | 16 + .../impl/vhal_v2_0/DefaultVehicleHalServer.h | 2 + .../vhal_v2_0/tests/DefaultVhalImpl_test.cpp | 303 ++++++++++++++++++ 7 files changed, 368 insertions(+), 18 deletions(-) create mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp index 4c51c62c24..aabc60c2db 100644 --- a/automotive/vehicle/2.0/default/Android.bp +++ b/automotive/vehicle/2.0/default/Android.bp @@ -172,6 +172,8 @@ cc_test { "libbase", "libcutils", ], + // Exclude share libraries from default because they might be missing on + // some test platforms and we are using static libraries instead. exclude_shared_libs: [ "android.automotive.watchdog-V2-ndk_platform", "android.hardware.automotive.vehicle@2.0", @@ -190,18 +192,26 @@ cc_test { defaults: ["vhal_v2_0_target_defaults"], srcs: [ "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp", + "impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp", ], static_libs: [ - "android.automotive.watchdog-V2-ndk_platform", - "android.hardware.automotive.vehicle@2.0", - "android.hardware.automotive.vehicle@2.0-default-impl-lib", - "android.hardware.automotive.vehicle@2.0-libproto-native", + "libbase", + "libcutils", + "libjsoncpp", "libprotobuf-cpp-lite", ], + // Exclude share libraries from default because they might be missing on + // some test platforms and we are using static libraries instead. exclude_shared_libs: [ "android.automotive.watchdog-V2-ndk_platform", "android.hardware.automotive.vehicle@2.0", ], + whole_static_libs: [ + "android.automotive.watchdog-V2-ndk_platform", + "android.hardware.automotive.vehicle@2.0", + "android.hardware.automotive.vehicle@2.0-default-impl-lib", + "android.hardware.automotive.vehicle@2.0-libproto-native", + ], test_suites: ["general-tests"], } diff --git a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleConnector.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleConnector.h index 2908a55c25..345c356714 100644 --- a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleConnector.h +++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleConnector.h @@ -20,6 +20,7 @@ #include #include +#include #include "VehicleClient.h" #include "VehicleServer.h" @@ -72,7 +73,21 @@ class IPassThroughConnector : public VehicleClientType, public VehicleServerType } bool dump(const hidl_handle& handle, const hidl_vec& options) override { - return this->onDump(handle, options); + // Calls server's onDump function and print the dumped info to the handle. + std::vector stdOptions; + for (size_t i = 0; i < options.size(); i++) { + stdOptions.push_back(options[i]); + } + IVehicleServer::DumpResult result = this->onDump(stdOptions); + int fd = handle->data[0]; + if (fd < 0) { + ALOGW("Invalid fd from HIDL handle: %d", fd); + return false; + } + if (result.buffer.size() != 0) { + dprintf(fd, "[VehicleHalServer] Dumped info: %s\n", result.buffer.c_str()); + } + return result.callerShouldDumpState; } // To be implemented: diff --git a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleServer.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleServer.h index ba9799af1b..2c484e8462 100644 --- a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleServer.h +++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleServer.h @@ -28,6 +28,16 @@ namespace android::hardware::automotive::vehicle::V2_0 { */ class IVehicleServer { public: + // The return structure for onDump function. + struct DumpResult { + // If callerShouldDumpState is true, caller would print the information in buffer and + // continue to dump its state, otherwise would just dump the buffer and skip its own + // dumping logic. + bool callerShouldDumpState; + // The dumped information for the caller to print. + std::string buffer; + }; + IVehicleServer() = default; IVehicleServer(const IVehicleServer&) = delete; @@ -54,15 +64,9 @@ class IVehicleServer { // generated by car (ECU/fake generator/injected) virtual void onPropertyValueFromCar(const VehiclePropValue& value, bool updateStatus) = 0; - // TODO (chenhaosjtuacm): fix this since there are no HIDL in non-Android OS -#ifdef __ANDROID__ // Dump method forwarded from HIDL's debug() // If implemented, it must return whether the caller should dump its state. - virtual bool onDump(const hidl_handle& /* handle */, - const hidl_vec& /* options */) { - return true; - } -#endif // __ANDROID__ + virtual DumpResult onDump(const std::vector& options) = 0; }; } // namespace android::hardware::automotive::vehicle::V2_0 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 a85cdf06a5..899428e75e 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 @@ -124,7 +124,7 @@ const ConfigDeclaration kVehicleProperties[]{ .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::STATIC, }, - .initialValue = {.floatValues = {1776, 4950, 2008, 2140, 2984, 1665, 1667, 11800}}}, + .initialValue = {.int32Values = {1776, 4950, 2008, 2140, 2984, 1665, 1667, 11800}}}, {.config = { .prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED), @@ -1072,8 +1072,8 @@ const ConfigDeclaration kVehicleProperties[]{ .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, - .initialValue = {.int32Values = {0 /* Off */, -1, -1, -1, -1 /* Bounds */, - -1, -1, -1, -1 /* Insets */}}, + .initialValue = {.int32Values = {0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1, + -1, -1 /* Insets */}}, }, { .config = @@ -1126,9 +1126,9 @@ const ConfigDeclaration kVehicleProperties[]{ .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {0, 0, 0, 11, 0, 0, 0, 0, 16}, }, - .initialValue = {.int32Values = {0 /* Off */, -1, -1, -1, -1 /* Bounds */, - -1, -1, -1, -1 /* Insets */, - 0 /* ClusterHome */, -1 /* ClusterNone */}}, + .initialValue = {.int32Values = {0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1, + -1, -1 /* Insets */, 0 /* ClusterHome */, + -1 /* ClusterNone */}}, }, { .config = diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp index e7cc6a0a4e..66849bcc9e 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp @@ -18,6 +18,7 @@ #include +#include #include #include @@ -329,6 +330,21 @@ StatusCode DefaultVehicleHalServer::onSetProperty(const VehiclePropValue& value, return StatusCode::OK; } +IVehicleServer::DumpResult DefaultVehicleHalServer::onDump( + const std::vector& /* options */) { + DumpResult result; + result.callerShouldDumpState = true; + + result.buffer += "Server side properties: \n"; + auto values = mServerSidePropStore.readAllValues(); + size_t i = 0; + for (const auto& value : values) { + result.buffer += fmt::format("[{}]: {}\n", i, toString(value)); + i++; + } + return result; +} + } // namespace impl } // namespace V2_0 diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h index d8e1b4efcf..1a42cb8e73 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h @@ -45,6 +45,8 @@ class DefaultVehicleHalServer : public IVehicleServer { StatusCode onSetProperty(const VehiclePropValue& value, bool updateStatus) override; + DumpResult onDump(const std::vector& options) override; + // Set the Property Value Pool used in this server void setValuePool(VehiclePropValuePool* valuePool); 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 new file mode 100644 index 0000000000..e943e67db1 --- /dev/null +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp @@ -0,0 +1,303 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include +#include + +namespace { + +using ::android::hardware::hidl_handle; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::automotive::vehicle::V2_0::FuelType; +using ::android::hardware::automotive::vehicle::V2_0::recyclable_ptr; +using ::android::hardware::automotive::vehicle::V2_0::StatusCode; +using ::android::hardware::automotive::vehicle::V2_0::VehiclePropConfig; +using ::android::hardware::automotive::vehicle::V2_0::VehicleProperty; +using ::android::hardware::automotive::vehicle::V2_0::VehiclePropertyStatus; +using ::android::hardware::automotive::vehicle::V2_0::VehiclePropertyStore; +using ::android::hardware::automotive::vehicle::V2_0::VehiclePropValue; +using ::android::hardware::automotive::vehicle::V2_0::VehiclePropValuePool; +using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVehicleConnector; +using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVehicleHal; + +using VehiclePropValuePtr = recyclable_ptr; + +class DefaultVhalImplTest : public ::testing::Test { + public: + ~DefaultVhalImplTest() { mEventQueue.deactivate(); } + + protected: + void SetUp() override { + mPropStore.reset(new VehiclePropertyStore); + mConnector.reset(new DefaultVehicleConnector); + mHal.reset(new DefaultVehicleHal(mPropStore.get(), mConnector.get())); + mConnector->setValuePool(&mValueObjectPool); + mHal->init(&mValueObjectPool, + std::bind(&DefaultVhalImplTest::onHalEvent, this, std::placeholders::_1), + std::bind(&DefaultVhalImplTest::onHalPropertySetError, this, + std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + } + + private: + void onHalEvent(VehiclePropValuePtr v) { mEventQueue.push(std::move(v)); } + + void onHalPropertySetError(StatusCode /*errorCode*/, int32_t /*property*/, int32_t /*areaId*/) { + } + + protected: + std::unique_ptr mHal; + std::unique_ptr mConnector; + std::unique_ptr mPropStore; + VehiclePropValuePool mValueObjectPool; + android::ConcurrentQueue mEventQueue; +}; + +TEST_F(DefaultVhalImplTest, testListProperties) { + std::vector configs = mHal->listProperties(); + + EXPECT_EQ((size_t)122, configs.size()); +} + +TEST_F(DefaultVhalImplTest, testGetDefaultPropertyFloat) { + VehiclePropValue value; + StatusCode status; + value.prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY); + + auto gotValue = mHal->get(value, &status); + + EXPECT_EQ(StatusCode::OK, status); + EXPECT_EQ((unsigned int)1, gotValue->value.floatValues.size()); + EXPECT_EQ(15000.0f, gotValue->value.floatValues[0]); +} + +TEST_F(DefaultVhalImplTest, testGetDefaultPropertyEnum) { + VehiclePropValue value; + StatusCode status; + value.prop = toInt(VehicleProperty::INFO_FUEL_TYPE); + + auto gotValue = mHal->get(value, &status); + + EXPECT_EQ(StatusCode::OK, status); + EXPECT_EQ((unsigned int)1, gotValue->value.int32Values.size()); + EXPECT_EQ((int)FuelType::FUEL_TYPE_UNLEADED, gotValue->value.int32Values[0]); +} + +TEST_F(DefaultVhalImplTest, testGetDefaultPropertyInt) { + VehiclePropValue value; + StatusCode status; + value.prop = toInt(VehicleProperty::INFO_MODEL_YEAR); + + auto gotValue = mHal->get(value, &status); + + EXPECT_EQ(StatusCode::OK, status); + EXPECT_EQ((unsigned int)1, gotValue->value.int32Values.size()); + EXPECT_EQ(2020, gotValue->value.int32Values[0]); +} + +TEST_F(DefaultVhalImplTest, testGetDefaultPropertyString) { + VehiclePropValue value; + StatusCode status; + value.prop = toInt(VehicleProperty::INFO_MAKE); + + auto gotValue = mHal->get(value, &status); + + EXPECT_EQ(StatusCode::OK, status); + EXPECT_EQ("Toy Vehicle", gotValue->value.stringValue); +} + +TEST_F(DefaultVhalImplTest, testGetUnknownProperty) { + VehiclePropValue value; + StatusCode status; + value.prop = 0; + + auto gotValue = mHal->get(value, &status); + + EXPECT_EQ(StatusCode::INVALID_ARG, status); +} + +TEST_F(DefaultVhalImplTest, testSetFloat) { + VehiclePropValue value; + value.prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY); + value.value.floatValues.resize(1); + value.value.floatValues[0] = 1.0f; + + StatusCode status = mHal->set(value); + EXPECT_EQ(StatusCode::OK, status); + + auto gotValue = mHal->get(value, &status); + EXPECT_EQ(StatusCode::OK, status); + EXPECT_EQ((unsigned int)1, gotValue->value.floatValues.size()); + EXPECT_EQ(1.0f, gotValue->value.floatValues[0]); +} + +TEST_F(DefaultVhalImplTest, testSetEnum) { + VehiclePropValue value; + value.prop = toInt(VehicleProperty::INFO_FUEL_TYPE); + value.value.int32Values.resize(1); + value.value.int32Values[0] = (int)FuelType::FUEL_TYPE_LEADED; + + StatusCode status = mHal->set(value); + EXPECT_EQ(StatusCode::OK, status); + + auto gotValue = mHal->get(value, &status); + EXPECT_EQ(StatusCode::OK, status); + EXPECT_EQ((unsigned int)1, gotValue->value.int32Values.size()); + EXPECT_EQ((int)FuelType::FUEL_TYPE_LEADED, gotValue->value.int32Values[0]); +} + +TEST_F(DefaultVhalImplTest, testSetInt) { + VehiclePropValue value; + value.prop = toInt(VehicleProperty::INFO_MODEL_YEAR); + value.value.int32Values.resize(1); + value.value.int32Values[0] = 2021; + + StatusCode status = mHal->set(value); + EXPECT_EQ(StatusCode::OK, status); + + auto gotValue = mHal->get(value, &status); + EXPECT_EQ(StatusCode::OK, status); + EXPECT_EQ((unsigned int)1, gotValue->value.int32Values.size()); + EXPECT_EQ(2021, gotValue->value.int32Values[0]); +} + +TEST_F(DefaultVhalImplTest, testSetString) { + VehiclePropValue value; + value.prop = toInt(VehicleProperty::INFO_MAKE); + value.value.stringValue = "My Vehicle"; + + StatusCode status = mHal->set(value); + EXPECT_EQ(StatusCode::OK, status); + + auto gotValue = mHal->get(value, &status); + EXPECT_EQ(StatusCode::OK, status); + EXPECT_EQ("My Vehicle", gotValue->value.stringValue); +} + +TEST_F(DefaultVhalImplTest, testSetUnknownProperty) { + VehiclePropValue value; + value.prop = 0; + + EXPECT_EQ(StatusCode::INVALID_ARG, mHal->set(value)); +} + +TEST_F(DefaultVhalImplTest, testSetStatusNotAllowed) { + VehiclePropValue value; + value.prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY); + value.status = VehiclePropertyStatus::UNAVAILABLE; + value.value.floatValues.resize(1); + value.value.floatValues[0] = 1.0f; + + StatusCode status = mHal->set(value); + + EXPECT_EQ(StatusCode::INVALID_ARG, status); +} + +TEST_F(DefaultVhalImplTest, testSubscribe) { + // Clear existing events. + mEventQueue.flush(); + + auto status = mHal->subscribe(toInt(VehicleProperty::PERF_VEHICLE_SPEED), 10); + + EXPECT_EQ(StatusCode::OK, status); + + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + + // Modify the speed after 0.5 seconds. + VehiclePropValue value; + value.prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED); + value.value.floatValues.resize(1); + value.value.floatValues[0] = 1.0f; + EXPECT_EQ(StatusCode::OK, mHal->set(value)); + + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + + auto events = mEventQueue.flush(); + EXPECT_LE((size_t)10, events.size()); + + // The first event should be the default value. + EXPECT_EQ((size_t)1, events[0]->value.floatValues.size()); + EXPECT_EQ(0.0f, events[0]->value.floatValues[0]); + // The last event should be the value after update. + EXPECT_EQ((size_t)1, events[events.size() - 1]->value.floatValues.size()); + EXPECT_EQ(1.0f, events[events.size() - 1]->value.floatValues[0]); +} + +TEST_F(DefaultVhalImplTest, testSubscribeInvalidProp) { + EXPECT_EQ(StatusCode::INVALID_ARG, mHal->subscribe(toInt(VehicleProperty::INFO_MAKE), 10)); +} + +TEST_F(DefaultVhalImplTest, testUnsubscribe) { + auto status = mHal->subscribe(toInt(VehicleProperty::PERF_VEHICLE_SPEED), 10); + EXPECT_EQ(StatusCode::OK, status); + + // Wait for 0.5 seconds to generate some events. + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + + status = mHal->unsubscribe(toInt(VehicleProperty::PERF_VEHICLE_SPEED)); + EXPECT_EQ(StatusCode::OK, status); + + // Clear all the events. + mEventQueue.flush(); + + // Wait for 0.5 seconds. + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + + // There should be no new events generated. + auto events = mEventQueue.flush(); + EXPECT_EQ((size_t)0, events.size()); +} + +TEST_F(DefaultVhalImplTest, testUnsubscribeInvalidProp) { + EXPECT_EQ(StatusCode::INVALID_ARG, mHal->unsubscribe(toInt(VehicleProperty::INFO_MAKE))); +} + +TEST_F(DefaultVhalImplTest, testDump) { + hidl_vec options; + hidl_handle fd = {}; + native_handle_t* handle = native_handle_create(/*numFds=*/1, /*numInts=*/0); + int memfd = memfd_create("memfile", 0); + handle->data[0] = dup(memfd); + fd.setTo(handle, /*shouldOwn=*/true); + + EXPECT_TRUE(mHal->dump(fd, options)); + + lseek(memfd, 0, SEEK_SET); + char buf[10240] = {}; + read(memfd, buf, sizeof(buf)); + close(memfd); + + // Read one property and check that it is in the dumped info. + VehiclePropValue value; + StatusCode status; + value.prop = toInt(VehicleProperty::INFO_MAKE); + auto gotValue = mHal->get(value, &status); + EXPECT_EQ(StatusCode::OK, status); + // Server side prop store does not have timestamp. + gotValue->timestamp = 0; + + std::string infoMake = toString(*gotValue); + EXPECT_NE(std::string::npos, std::string(buf).find(infoMake)); +} + +} // namespace -- GitLab From f2493a3c3acb9b10969006903e7c49eaf713315a Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 7 Jul 2021 09:59:32 -0700 Subject: [PATCH 068/825] fix potential use-after-frees of stack memory `devname_value` is a local variable; if `property_get` succeeds, we'll return a pointer to it. Returning a `std::string` instead sidesteps this problem. Bug: 190757198 Test: TreeHugger Change-Id: If9ca733dd21128706f2a9f62e8460b1286631aa5 --- gnss/common/utils/default/GnssReplayUtils.cpp | 11 +++++------ gnss/common/utils/default/include/GnssReplayUtils.h | 2 +- gnss/common/utils/default/include/v2_1/GnssTemplate.h | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/gnss/common/utils/default/GnssReplayUtils.cpp b/gnss/common/utils/default/GnssReplayUtils.cpp index 6dcf6ea252..fc4c477ae8 100644 --- a/gnss/common/utils/default/GnssReplayUtils.cpp +++ b/gnss/common/utils/default/GnssReplayUtils.cpp @@ -21,18 +21,17 @@ namespace hardware { namespace gnss { namespace common { -const char* ReplayUtils::getGnssPath() { - const char* gnss_dev_path = GNSS_PATH; +std::string ReplayUtils::getGnssPath() { char devname_value[PROPERTY_VALUE_MAX] = ""; if (property_get("debug.location.gnss.devname", devname_value, NULL) > 0) { - gnss_dev_path = devname_value; + return devname_value; } - return gnss_dev_path; + return GNSS_PATH; } bool ReplayUtils::hasGnssDeviceFile() { struct stat sb; - return stat(getGnssPath(), &sb) != -1; + return stat(getGnssPath().c_str(), &sb) != -1; } bool ReplayUtils::isGnssRawMeasurement(const std::string& inputStr) { @@ -47,7 +46,7 @@ bool ReplayUtils::isNMEA(const std::string& inputStr) { std::string ReplayUtils::getDataFromDeviceFile(const std::string& command, int mMinIntervalMs) { char inputBuffer[INPUT_BUFFER_SIZE]; - int mGnssFd = open(getGnssPath(), O_RDWR | O_NONBLOCK); + int mGnssFd = open(getGnssPath().c_str(), O_RDWR | O_NONBLOCK); if (mGnssFd == -1) { return ""; diff --git a/gnss/common/utils/default/include/GnssReplayUtils.h b/gnss/common/utils/default/include/GnssReplayUtils.h index d7530f741a..32c0e58c0c 100644 --- a/gnss/common/utils/default/include/GnssReplayUtils.h +++ b/gnss/common/utils/default/include/GnssReplayUtils.h @@ -35,7 +35,7 @@ namespace gnss { namespace common { struct ReplayUtils { - static const char* getGnssPath(); + static std::string getGnssPath(); static std::string getDataFromDeviceFile(const std::string& command, int mMinIntervalMs); diff --git a/gnss/common/utils/default/include/v2_1/GnssTemplate.h b/gnss/common/utils/default/include/v2_1/GnssTemplate.h index e87a7f4f6a..76024aad0d 100644 --- a/gnss/common/utils/default/include/v2_1/GnssTemplate.h +++ b/gnss/common/utils/default/include/v2_1/GnssTemplate.h @@ -161,11 +161,11 @@ template std::unique_ptr GnssTemplate::getLocationFromHW() { if (!mHardwareModeChecked) { // default using /dev/gnss0 - const char* gnss_dev_path = ReplayUtils::getGnssPath(); + std::string gnss_dev_path = ReplayUtils::getGnssPath(); - mGnssFd = open(gnss_dev_path, O_RDWR | O_NONBLOCK); + mGnssFd = open(gnss_dev_path.c_str(), O_RDWR | O_NONBLOCK); if (mGnssFd == -1) { - ALOGW("Failed to open %s errno: %d", gnss_dev_path, errno); + ALOGW("Failed to open %s errno: %d", gnss_dev_path.c_str(), errno); } mHardwareModeChecked = true; } -- GitLab From ac8f96b922d96a743540628658837d03c7f0ff9a Mon Sep 17 00:00:00 2001 From: Hongguang Date: Fri, 2 Jul 2021 17:38:58 -0700 Subject: [PATCH 069/825] Use reference or pointer in tuner vts. Bug: 188709323 Bug: 191825295 Test: VtsHalTvTunerV1_0TargetTest and VtsHalTvTunerV1_1TargetTest. Change-Id: I93f2c9639033f8cb0f48de035e1c6ba488ea83e0 --- tv/tuner/1.0/vts/functional/FilterTests.cpp | 9 ++++----- tv/tuner/1.0/vts/functional/FilterTests.h | 12 +++++------- tv/tuner/1.0/vts/functional/FrontendTests.cpp | 15 ++++++++------- tv/tuner/1.0/vts/functional/FrontendTests.h | 11 ++++++++--- .../functional/VtsHalTvTunerV1_0TargetTest.cpp | 2 +- .../functional/VtsHalTvTunerV1_0TargetTest.h | 2 +- tv/tuner/1.1/vts/functional/FilterTests.cpp | 17 +++++++++++------ tv/tuner/1.1/vts/functional/FilterTests.h | 17 +++++++---------- tv/tuner/1.1/vts/functional/FrontendTests.cpp | 15 ++++++++------- tv/tuner/1.1/vts/functional/FrontendTests.h | 11 ++++++++--- .../functional/VtsHalTvTunerV1_1TargetTest.cpp | 2 +- .../functional/VtsHalTvTunerV1_1TargetTest.h | 2 +- 12 files changed, 63 insertions(+), 52 deletions(-) diff --git a/tv/tuner/1.0/vts/functional/FilterTests.cpp b/tv/tuner/1.0/vts/functional/FilterTests.cpp index f47024526d..a7792f5a85 100644 --- a/tv/tuner/1.0/vts/functional/FilterTests.cpp +++ b/tv/tuner/1.0/vts/functional/FilterTests.cpp @@ -16,7 +16,7 @@ #include "FilterTests.h" -void FilterCallback::startFilterEventThread(DemuxFilterEvent event) { +void FilterCallback::startFilterEventThread(DemuxFilterEvent& event) { struct FilterThreadArgs* threadArgs = (struct FilterThreadArgs*)malloc(sizeof(struct FilterThreadArgs)); threadArgs->user = this; @@ -69,9 +69,8 @@ void FilterCallback::filterThreadLoop(DemuxFilterEvent& /* event */) { // end thread } -bool FilterCallback::readFilterEventData() { +bool FilterCallback::readFilterEventData(const DemuxFilterEvent& filterEvent) { bool result = false; - DemuxFilterEvent filterEvent = mFilterEvent; ALOGW("[vts] reading from filter FMQ or buffer %d", mFilterId); // todo separate filter handlers for (auto event : filterEvent.events) { @@ -107,7 +106,7 @@ bool FilterCallback::readFilterEventData() { return result; } -bool FilterCallback::dumpAvData(DemuxFilterMediaEvent event) { +bool FilterCallback::dumpAvData(DemuxFilterMediaEvent& event) { uint32_t length = event.dataLength; uint64_t dataId = event.avDataId; // read data from buffer pointed by a handle @@ -127,7 +126,7 @@ bool FilterCallback::dumpAvData(DemuxFilterMediaEvent event) { return true; } -bool FilterCallback::readRecordData(DemuxFilterTsRecordEvent event) { +bool FilterCallback::readRecordData(DemuxFilterTsRecordEvent& event) { ALOGD("[vts] got DemuxFilterTsRecordEvent with pid=%d.", event.pid.tPid()); return true; } diff --git a/tv/tuner/1.0/vts/functional/FilterTests.h b/tv/tuner/1.0/vts/functional/FilterTests.h index 7bc4832171..d37b9e1d84 100644 --- a/tv/tuner/1.0/vts/functional/FilterTests.h +++ b/tv/tuner/1.0/vts/functional/FilterTests.h @@ -77,8 +77,7 @@ class FilterCallback : public IFilterCallback { android::Mutex::Autolock autoLock(mMsgLock); // Temprarily we treat the first coming back filter data on the matching pid a success // once all of the MQ are cleared, means we got all the expected output - mFilterEvent = filterEvent; - readFilterEventData(); + readFilterEventData(filterEvent); mPidFilterOutputCount++; // mFilterIdToMQ.erase(filterEvent.filterId); @@ -96,15 +95,15 @@ class FilterCallback : public IFilterCallback { void testFilterDataOutput(); - void startFilterEventThread(DemuxFilterEvent event); + void startFilterEventThread(DemuxFilterEvent& event); static void* __threadLoopFilter(void* threadArgs); void filterThreadLoop(DemuxFilterEvent& event); void updateFilterMQ(MQDesc& filterMQDescriptor); void updateGoldenOutputMap(string goldenOutputFile); - bool readFilterEventData(); - bool dumpAvData(DemuxFilterMediaEvent event); - bool readRecordData(DemuxFilterTsRecordEvent event); + bool readFilterEventData(const DemuxFilterEvent& filterEvent); + bool dumpAvData(DemuxFilterMediaEvent& event); + bool readRecordData(DemuxFilterTsRecordEvent& event); private: struct FilterThreadArgs { @@ -120,7 +119,6 @@ class FilterCallback : public IFilterCallback { sp mFilter; std::unique_ptr mFilterMQ; EventFlag* mFilterMQEventFlag; - DemuxFilterEvent mFilterEvent; android::Mutex mMsgLock; android::Mutex mFilterOutputLock; diff --git a/tv/tuner/1.0/vts/functional/FrontendTests.cpp b/tv/tuner/1.0/vts/functional/FrontendTests.cpp index b35d11220d..62ac6f7716 100644 --- a/tv/tuner/1.0/vts/functional/FrontendTests.cpp +++ b/tv/tuner/1.0/vts/functional/FrontendTests.cpp @@ -370,11 +370,12 @@ AssertionResult FrontendTests::tuneFrontend(FrontendConfig config, bool testWith mIsSoftwareFe = config.isSoftwareFe; bool result = true; if (mIsSoftwareFe && testWithDemux) { - result &= mDvrTests.openDvrInDemux(mDvrConfig.type, mDvrConfig.bufferSize) == success(); - result &= mDvrTests.configDvrPlayback(mDvrConfig.settings) == success(); - result &= mDvrTests.getDvrPlaybackMQDescriptor() == success(); - mDvrTests.startPlaybackInputThread(mDvrConfig.playbackInputFile, - mDvrConfig.settings.playback()); + result &= + getDvrTests()->openDvrInDemux(mDvrConfig.type, mDvrConfig.bufferSize) == success(); + result &= getDvrTests()->configDvrPlayback(mDvrConfig.settings) == success(); + result &= getDvrTests()->getDvrPlaybackMQDescriptor() == success(); + getDvrTests()->startPlaybackInputThread(mDvrConfig.playbackInputFile, + mDvrConfig.settings.playback()); if (!result) { ALOGW("[vts] Software frontend dvr configure failed."); return failure(); @@ -397,8 +398,8 @@ AssertionResult FrontendTests::stopTuneFrontend(bool testWithDemux) { Result status; status = mFrontend->stopTune(); if (mIsSoftwareFe && testWithDemux) { - mDvrTests.stopPlaybackThread(); - mDvrTests.closeDvrPlayback(); + getDvrTests()->stopPlaybackThread(); + getDvrTests()->closeDvrPlayback(); } return AssertionResult(status == Result::SUCCESS); } diff --git a/tv/tuner/1.0/vts/functional/FrontendTests.h b/tv/tuner/1.0/vts/functional/FrontendTests.h index 33ff603b85..c789d94c2b 100644 --- a/tv/tuner/1.0/vts/functional/FrontendTests.h +++ b/tv/tuner/1.0/vts/functional/FrontendTests.h @@ -103,7 +103,7 @@ class FrontendTests { void setService(sp tuner) { mService = tuner; - mDvrTests.setService(tuner); + getDvrTests()->setService(tuner); getDefaultSoftwareFrontendPlaybackConfig(mDvrConfig); } @@ -124,8 +124,8 @@ class FrontendTests { void tuneTest(FrontendConfig frontendConf); void scanTest(FrontendConfig frontend, FrontendScanType type); - void setDvrTests(DvrTests dvrTests) { mDvrTests = dvrTests; } - void setDemux(sp demux) { mDvrTests.setDemux(demux); } + void setDvrTests(DvrTests* dvrTests) { mExternalDvrTests = dvrTests; } + void setDemux(sp demux) { getDvrTests()->setDemux(demux); } void setSoftwareFrontendDvrConfig(DvrConfig conf) { mDvrConfig = conf; } protected: @@ -147,11 +147,16 @@ class FrontendTests { dvrConfig.settings.playback(playbackSettings); } + DvrTests* getDvrTests() { + return (mExternalDvrTests != nullptr ? mExternalDvrTests : &mDvrTests); + } + sp mFrontend; FrontendInfo mFrontendInfo; sp mFrontendCallback; hidl_vec mFeIds; + DvrTests* mExternalDvrTests = nullptr; DvrTests mDvrTests; bool mIsSoftwareFe = false; DvrConfig mDvrConfig; diff --git a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp index b39abe3547..3e3a4d4732 100644 --- a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp +++ b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp @@ -177,7 +177,7 @@ void TunerRecordHidlTest::recordSingleFilterTest(FilterConfig filterConf, mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[record.dvrSoftwareFeId]); } ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); - mFrontendTests.setDvrTests(mDvrTests); + mFrontendTests.setDvrTests(&mDvrTests); } else { dvrSourceConfig = dvrMap[record.dvrSourceId]; ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrSourceConfig.type, dvrSourceConfig.bufferSize)); diff --git a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.h b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.h index 7243a42c60..0b84b58bf7 100644 --- a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.h +++ b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.h @@ -50,7 +50,7 @@ bool initConfiguration() { return true; } -AssertionResult filterDataOutputTestBase(FilterTests tests) { +AssertionResult filterDataOutputTestBase(FilterTests& tests) { // Data Verify Module std::map>::iterator it; std::map> filterCallbacks = tests.getFilterCallbacks(); diff --git a/tv/tuner/1.1/vts/functional/FilterTests.cpp b/tv/tuner/1.1/vts/functional/FilterTests.cpp index 4dff8533f3..8bdf8f68b8 100644 --- a/tv/tuner/1.1/vts/functional/FilterTests.cpp +++ b/tv/tuner/1.1/vts/functional/FilterTests.cpp @@ -64,11 +64,11 @@ void FilterCallback::testStartIdAfterReconfigure() { ALOGW("[vts] pass and stop"); } -void FilterCallback::readFilterEventData() { +void FilterCallback::readFilterEventData(const DemuxFilterEvent& filterEvent) { ALOGW("[vts] reading filter event"); // todo separate filter handlers - for (int i = 0; i < mFilterEvent.events.size(); i++) { - auto event = mFilterEvent.events[i]; + for (int i = 0; i < filterEvent.events.size(); i++) { + auto event = filterEvent.events[i]; switch (event.getDiscriminator()) { case DemuxFilterEvent::Event::hidl_discriminator::media: ALOGD("[vts] Media filter event, avMemHandle numFds=%d.", @@ -79,8 +79,13 @@ void FilterCallback::readFilterEventData() { break; } } - for (int i = 0; i < mFilterEventExt.events.size(); i++) { - auto eventExt = mFilterEventExt.events[i]; +} + +void FilterCallback::readFilterEventExtData(const DemuxFilterEventExt& filterEventExt) { + ALOGW("[vts] reading filter event ext"); + // todo separate filter handlers + for (int i = 0; i < filterEventExt.events.size(); i++) { + auto eventExt = filterEventExt.events[i]; switch (eventExt.getDiscriminator()) { case DemuxFilterEventExt::Event::hidl_discriminator::tsRecord: ALOGD("[vts] Extended TS record filter event, pts=%" PRIu64 ", firstMbInSlice=%d", @@ -114,7 +119,7 @@ void FilterCallback::readFilterEventData() { } } -bool FilterCallback::dumpAvData(DemuxFilterMediaEvent event) { +bool FilterCallback::dumpAvData(DemuxFilterMediaEvent& event) { uint32_t length = event.dataLength; uint32_t offset = event.offset; // read data from buffer pointed by a handle diff --git a/tv/tuner/1.1/vts/functional/FilterTests.h b/tv/tuner/1.1/vts/functional/FilterTests.h index 72c8129f4a..1a1273ecb4 100644 --- a/tv/tuner/1.1/vts/functional/FilterTests.h +++ b/tv/tuner/1.1/vts/functional/FilterTests.h @@ -88,9 +88,8 @@ class FilterCallback : public IFilterCallback { android::Mutex::Autolock autoLock(mMsgLock); // Temprarily we treat the first coming back filter data on the matching pid a success // once all of the MQ are cleared, means we got all the expected output - mFilterEvent = filterEvent; - mFilterEventExt = filterEventExt; - readFilterEventData(); + readFilterEventData(filterEvent); + readFilterEventExtData(filterEventExt); mPidFilterOutputCount++; mMsgCondition.signal(); return Void(); @@ -101,8 +100,7 @@ class FilterCallback : public IFilterCallback { android::Mutex::Autolock autoLock(mMsgLock); // Temprarily we treat the first coming back filter data on the matching pid a success // once all of the MQ are cleared, means we got all the expected output - mFilterEvent = filterEvent; - readFilterEventData(); + readFilterEventData(filterEvent); mPidFilterOutputCount++; mMsgCondition.signal(); return Void(); @@ -115,7 +113,7 @@ class FilterCallback : public IFilterCallback { void setFilterId(uint32_t filterId) { mFilterId = filterId; } void setFilterInterface(sp filter) { mFilter = filter; } void setFilterEventType(FilterEventType type) { mFilterEventType = type; } - void setSharedHandle(hidl_handle sharedHandle) { mAvSharedHandle = sharedHandle; } + void setSharedHandle(hidl_handle& sharedHandle) { mAvSharedHandle = sharedHandle; } void setMemSize(uint64_t size) { mAvSharedMemSize = size; } void testFilterDataOutput(); @@ -123,15 +121,14 @@ class FilterCallback : public IFilterCallback { void testFilterIpCidEvent(); void testStartIdAfterReconfigure(); - void readFilterEventData(); - bool dumpAvData(DemuxFilterMediaEvent event); + void readFilterEventData(const DemuxFilterEvent& filterEvent); + void readFilterEventExtData(const DemuxFilterEventExt& filterEventExt); + bool dumpAvData(DemuxFilterMediaEvent& event); private: uint32_t mFilterId; sp mFilter; FilterEventType mFilterEventType; - DemuxFilterEvent mFilterEvent; - DemuxFilterEventExt mFilterEventExt; hidl_handle mAvSharedHandle = NULL; uint64_t mAvSharedMemSize = -1; diff --git a/tv/tuner/1.1/vts/functional/FrontendTests.cpp b/tv/tuner/1.1/vts/functional/FrontendTests.cpp index 9c575ff782..9c0933eb26 100644 --- a/tv/tuner/1.1/vts/functional/FrontendTests.cpp +++ b/tv/tuner/1.1/vts/functional/FrontendTests.cpp @@ -437,11 +437,12 @@ AssertionResult FrontendTests::tuneFrontend(FrontendConfig1_1 config, bool testW mIsSoftwareFe = config.config1_0.isSoftwareFe; bool result = true; if (mIsSoftwareFe && testWithDemux) { - result &= mDvrTests.openDvrInDemux(mDvrConfig.type, mDvrConfig.bufferSize) == success(); - result &= mDvrTests.configDvrPlayback(mDvrConfig.settings) == success(); - result &= mDvrTests.getDvrPlaybackMQDescriptor() == success(); - mDvrTests.startPlaybackInputThread(mDvrConfig.playbackInputFile, - mDvrConfig.settings.playback()); + result &= + getDvrTests()->openDvrInDemux(mDvrConfig.type, mDvrConfig.bufferSize) == success(); + result &= getDvrTests()->configDvrPlayback(mDvrConfig.settings) == success(); + result &= getDvrTests()->getDvrPlaybackMQDescriptor() == success(); + getDvrTests()->startPlaybackInputThread(mDvrConfig.playbackInputFile, + mDvrConfig.settings.playback()); if (!result) { ALOGW("[vts] Software frontend dvr configure failed."); return failure(); @@ -456,8 +457,8 @@ AssertionResult FrontendTests::stopTuneFrontend(bool testWithDemux) { Result status; status = mFrontend->stopTune(); if (mIsSoftwareFe && testWithDemux) { - mDvrTests.stopPlaybackThread(); - mDvrTests.closeDvrPlayback(); + getDvrTests()->stopPlaybackThread(); + getDvrTests()->closeDvrPlayback(); } return AssertionResult(status == Result::SUCCESS); } diff --git a/tv/tuner/1.1/vts/functional/FrontendTests.h b/tv/tuner/1.1/vts/functional/FrontendTests.h index 3687389571..03e5417744 100644 --- a/tv/tuner/1.1/vts/functional/FrontendTests.h +++ b/tv/tuner/1.1/vts/functional/FrontendTests.h @@ -106,7 +106,7 @@ class FrontendTests { void setService(sp tuner) { mService = tuner; - mDvrTests.setService(tuner); + getDvrTests()->setService(tuner); getDefaultSoftwareFrontendPlaybackConfig(mDvrConfig); } @@ -131,8 +131,8 @@ class FrontendTests { void scanTest(FrontendConfig1_1 frontend, FrontendScanType type); void getFrontendDtmbCapsTest(); - void setDvrTests(DvrTests dvrTests) { mDvrTests = dvrTests; } - void setDemux(sp demux) { mDvrTests.setDemux(demux); } + void setDvrTests(DvrTests* dvrTests) { mExternalDvrTests = dvrTests; } + void setDemux(sp demux) { getDvrTests()->setDemux(demux); } void setSoftwareFrontendDvrConfig(DvrConfig conf) { mDvrConfig = conf; } protected: @@ -153,11 +153,16 @@ class FrontendTests { dvrConfig.settings.playback(playbackSettings); } + DvrTests* getDvrTests() { + return (mExternalDvrTests != nullptr ? mExternalDvrTests : &mDvrTests); + } + sp mFrontend; FrontendInfo mFrontendInfo; sp mFrontendCallback; hidl_vec mFeIds; + DvrTests* mExternalDvrTests = nullptr; DvrTests mDvrTests; bool mIsSoftwareFe = false; DvrConfig mDvrConfig; diff --git a/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.cpp b/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.cpp index 1a9def83b1..41acaa1704 100644 --- a/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.cpp +++ b/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.cpp @@ -147,7 +147,7 @@ void TunerRecordHidlTest::recordSingleFilterTest(FilterConfig1_1 filterConf, mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[record.dvrSoftwareFeId]); } ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); - mFrontendTests.setDvrTests(mDvrTests); + mFrontendTests.setDvrTests(&mDvrTests); } else { dvrSourceConfig = dvrMap[record.dvrSourceId]; ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrSourceConfig.type, dvrSourceConfig.bufferSize)); diff --git a/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.h b/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.h index 13b9640749..d1a9beab09 100644 --- a/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.h +++ b/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.h @@ -39,7 +39,7 @@ static AssertionResult success() { return ::testing::AssertionSuccess(); } -AssertionResult filterDataOutputTestBase(FilterTests tests) { +AssertionResult filterDataOutputTestBase(FilterTests& tests) { // Data Verify Module std::map>::iterator it; std::map> filterCallbacks = tests.getFilterCallbacks(); -- GitLab From ab4bc8d0d020db8d0c8590886ad2d06a47968c00 Mon Sep 17 00:00:00 2001 From: Sally Qi Date: Thu, 8 Jul 2021 21:48:42 +0000 Subject: [PATCH 070/825] Fix vts gfx readback test issue because clearRegion was removed in I11f369d26e080ba49c7108957f8cf44c85146021. Bug: 181073175 Test: VtsHalGraphicsComposerV2_2TargetTest passed Change-Id: Ic50b968f2d2334a016d0e83a66e43e89e6d2ad80 --- .../vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp index 7a1568bd9f..c25ff195d3 100644 --- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp +++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp @@ -97,7 +97,6 @@ class GraphicsCompositionTestBase : public ::testing::Test { renderengine::DisplaySettings clientCompositionDisplay; clientCompositionDisplay.physicalDisplay = Rect(mDisplayWidth, mDisplayHeight); clientCompositionDisplay.clip = clientCompositionDisplay.physicalDisplay; - clientCompositionDisplay.clearRegion = Region(clientCompositionDisplay.physicalDisplay); mTestRenderEngine->initGraphicBuffer( static_cast(mDisplayWidth), static_cast(mDisplayHeight), 1, -- GitLab From e48c26f482c5da588bb2bce4b2563be6758ca17c Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 30 Jun 2021 13:30:55 -0700 Subject: [PATCH 071/825] Add input checks for Default VHAL. Test: atest android.hardware.automotive.vehicle@2.0-default-impl-unit-tests Bug: 188204722 Change-Id: I5f7084796a62c7e53a00f488fafb1026a182ce0c --- .../impl/vhal_v2_0/DefaultVehicleHal.cpp | 196 +++++++++++++++++- .../impl/vhal_v2_0/DefaultVehicleHal.h | 10 + .../vhal_v2_0/tests/DefaultVhalImpl_test.cpp | 184 ++++++++++++++++ 3 files changed, 387 insertions(+), 3 deletions(-) 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 a6e2c8f17c..f410f4cc6f 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 @@ -15,6 +15,7 @@ */ #define LOG_TAG "DefaultVehicleHal_v2_0" +#include #include #include #include @@ -72,6 +73,173 @@ bool DefaultVehicleHal::dump(const hidl_handle& fd, const hidl_vec& return mVehicleClient->dump(fd, options); } +StatusCode DefaultVehicleHal::checkPropValue(const VehiclePropValue& value, + const VehiclePropConfig* config) { + int32_t property = value.prop; + VehiclePropertyType type = getPropType(property); + switch (type) { + case VehiclePropertyType::BOOLEAN: + case VehiclePropertyType::INT32: + if (value.value.int32Values.size() != 1) { + return StatusCode::INVALID_ARG; + } + break; + case VehiclePropertyType::INT32_VEC: + if (value.value.int32Values.size() < 1) { + return StatusCode::INVALID_ARG; + } + break; + case VehiclePropertyType::INT64: + if (value.value.int64Values.size() != 1) { + return StatusCode::INVALID_ARG; + } + break; + case VehiclePropertyType::INT64_VEC: + if (value.value.int64Values.size() < 1) { + return StatusCode::INVALID_ARG; + } + break; + case VehiclePropertyType::FLOAT: + if (value.value.floatValues.size() != 1) { + return StatusCode::INVALID_ARG; + } + break; + case VehiclePropertyType::FLOAT_VEC: + if (value.value.floatValues.size() < 1) { + return StatusCode::INVALID_ARG; + } + break; + case VehiclePropertyType::BYTES: + // We allow setting an empty bytes array. + break; + case VehiclePropertyType::STRING: + // We allow setting an empty string. + break; + case VehiclePropertyType::MIXED: + if (getPropGroup(property) == VehiclePropertyGroup::VENDOR) { + // We only checks vendor mixed properties. + return checkVendorMixedPropValue(value, config); + } + break; + default: + ALOGW("Unknown property type: %d", type); + return StatusCode::INVALID_ARG; + } + return StatusCode::OK; +} + +StatusCode DefaultVehicleHal::checkVendorMixedPropValue(const VehiclePropValue& value, + const VehiclePropConfig* config) { + auto configArray = config->configArray; + // configArray[0], 1 indicates the property has a String value, we allow the string value to + // be empty. + + size_t int32Count = 0; + // configArray[1], 1 indicates the property has a Boolean value. + if (configArray[1] == 1) { + int32Count++; + } + // configArray[2], 1 indicates the property has an Integer value. + if (configArray[2] == 1) { + int32Count++; + } + // configArray[3], the number indicates the size of Integer[] in the property. + int32Count += static_cast(configArray[3]); + if (value.value.int32Values.size() != int32Count) { + return StatusCode::INVALID_ARG; + } + + size_t int64Count = 0; + // configArray[4], 1 indicates the property has a Long value. + if (configArray[4] == 1) { + int64Count++; + } + // configArray[5], the number indicates the size of Long[] in the property. + int64Count += static_cast(configArray[5]); + if (value.value.int64Values.size() != int64Count) { + return StatusCode::INVALID_ARG; + } + + size_t floatCount = 0; + // configArray[6], 1 indicates the property has a Float value. + if (configArray[6] == 1) { + floatCount++; + } + // configArray[7], the number indicates the size of Float[] in the property. + floatCount += static_cast(configArray[7]); + if (value.value.floatValues.size() != floatCount) { + return StatusCode::INVALID_ARG; + } + + // configArray[8], the number indicates the size of byte[] in the property. + if (configArray[8] != 0 && value.value.bytes.size() != static_cast(configArray[8])) { + return StatusCode::INVALID_ARG; + } + return StatusCode::OK; +} + +StatusCode DefaultVehicleHal::checkValueRange(const VehiclePropValue& value, + const VehiclePropConfig* config) { + int32_t property = value.prop; + VehiclePropertyType type = getPropType(property); + const VehicleAreaConfig* areaConfig; + if (isGlobalProp(property)) { + if (config->areaConfigs.size() == 0) { + return StatusCode::OK; + } + areaConfig = &(config->areaConfigs[0]); + } else { + for (auto& c : config->areaConfigs) { + // areaId might contain multiple areas. + if (c.areaId & value.areaId) { + areaConfig = &c; + break; + } + } + } + switch (type) { + case VehiclePropertyType::INT32: + if (areaConfig->minInt32Value == 0 && areaConfig->maxInt32Value == 0) { + break; + } + // We already checked this in checkPropValue. + assert(value.value.int32Values.size() > 0); + if (value.value.int32Values[0] < areaConfig->minInt32Value || + value.value.int32Values[0] > areaConfig->maxInt32Value) { + return StatusCode::INVALID_ARG; + } + break; + case VehiclePropertyType::INT64: + if (areaConfig->minInt64Value == 0 && areaConfig->maxInt64Value == 0) { + break; + } + // We already checked this in checkPropValue. + assert(value.value.int64Values.size() > 0); + if (value.value.int64Values[0] < areaConfig->minInt64Value || + value.value.int64Values[0] > areaConfig->maxInt64Value) { + return StatusCode::INVALID_ARG; + } + break; + case VehiclePropertyType::FLOAT: + if (areaConfig->minFloatValue == 0 && areaConfig->maxFloatValue == 0) { + break; + } + // We already checked this in checkPropValue. + assert(value.value.floatValues.size() > 0); + if (value.value.floatValues[0] < areaConfig->minFloatValue || + value.value.floatValues[0] > areaConfig->maxFloatValue) { + return StatusCode::INVALID_ARG; + } + break; + default: + // We don't check the rest of property types. Additional logic needs to be added if + // required for real implementation. E.g., you might want to enforce the range + // checks on vector as well or you might want to check the range for mixed property. + break; + } + return StatusCode::OK; +} + StatusCode DefaultVehicleHal::set(const VehiclePropValue& propValue) { if (propValue.status != VehiclePropertyStatus::AVAILABLE) { // Android side cannot set property status - this value is the @@ -79,12 +247,26 @@ StatusCode DefaultVehicleHal::set(const VehiclePropValue& propValue) { // its underlying hardware return StatusCode::INVALID_ARG; } - auto currentPropValue = mPropStore->readValueOrNull(propValue); - if (currentPropValue == nullptr) { + int32_t property = propValue.prop; + const VehiclePropConfig* config = mPropStore->getConfigOrNull(property); + if (config == nullptr) { + ALOGW("no config for prop 0x%x", property); return StatusCode::INVALID_ARG; } - if (currentPropValue->status != VehiclePropertyStatus::AVAILABLE) { + auto status = checkPropValue(propValue, config); + if (status != StatusCode::OK) { + ALOGW("invalid property value: %s", toString(propValue).c_str()); + return status; + } + status = checkValueRange(propValue, config); + if (status != StatusCode::OK) { + ALOGW("property value out of range: %s", toString(propValue).c_str()); + return status; + } + + auto currentPropValue = mPropStore->readValueOrNull(propValue); + if (currentPropValue && currentPropValue->status != VehiclePropertyStatus::AVAILABLE) { // do not allow Android side to set() a disabled/error property return StatusCode::NOT_AVAILABLE; } @@ -151,6 +333,14 @@ StatusCode DefaultVehicleHal::subscribe(int32_t property, float sampleRate) { if (!isContinuousProperty(property)) { return StatusCode::INVALID_ARG; } + + // If the config does not exist, isContinuousProperty should return false. + const VehiclePropConfig* config = mPropStore->getConfigOrNull(property); + if (sampleRate < config->minSampleRate || sampleRate > config->maxSampleRate) { + ALOGW("sampleRate out of range"); + return StatusCode::INVALID_ARG; + } + mRecurrentTimer.registerRecurrentEvent(hertzToNanoseconds(sampleRate), property); return StatusCode::OK; } diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h index cc66c0f680..2a0d430ea1 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h @@ -61,6 +61,16 @@ class DefaultVehicleHal : public VehicleHal { virtual void onPropertyValue(const VehiclePropValue& value, bool updateStatus); // Returns a lambda that could be used in mRecurrentTimer. RecurrentTimer::Action getTimerAction(); + // Check whether a propValue is valid according to its type. + StatusCode checkPropValue(const VehiclePropValue& propValue, const VehiclePropConfig* config); + // Check whether the property value is within the range according to area config. + StatusCode checkValueRange(const VehiclePropValue& propValue, const VehiclePropConfig* config); + + private: + // Check whether a vendor mixed value property is valid according to its config array. + // See 'VehiclePropertyType' documentation in 'types.hal' for detail. + StatusCode checkVendorMixedPropValue(const VehiclePropValue& value, + const VehiclePropConfig* config); }; } // namespace impl 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 e943e67db1..a2ec0dd688 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 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -40,6 +41,8 @@ using ::android::hardware::automotive::vehicle::V2_0::VehiclePropValue; using ::android::hardware::automotive::vehicle::V2_0::VehiclePropValuePool; using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVehicleConnector; using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVehicleHal; +using ::android::hardware::automotive::vehicle::V2_0::impl::HVAC_LEFT; +using ::android::hardware::automotive::vehicle::V2_0::impl::kMixedTypePropertyForTest; using VehiclePropValuePtr = recyclable_ptr; @@ -194,6 +197,32 @@ TEST_F(DefaultVhalImplTest, testSetString) { EXPECT_EQ("My Vehicle", gotValue->value.stringValue); } +TEST_F(DefaultVhalImplTest, testSetMixed) { + VehiclePropValue value; + value.prop = kMixedTypePropertyForTest; + // mixed prop. + // .configArray = {1, 1, 0, 2, 0, 0, 1, 0, 0} + // 1 string, 1 int, 0 bool, 2 ints, 0 int64, 0 int64s, 1 float, 0 floats, 0 bytes + value.value.stringValue = "test"; + value.value.int32Values.resize(3); + value.value.int32Values[0] = 1; + value.value.int32Values[1] = 2; + value.value.int32Values[2] = 3; + value.value.floatValues.resize(1); + value.value.floatValues[0] = 1.0f; + + StatusCode status = mHal->set(value); + EXPECT_EQ(StatusCode::OK, status); + + auto gotValue = mHal->get(value, &status); + EXPECT_EQ(StatusCode::OK, status); + EXPECT_EQ("test", gotValue->value.stringValue); + EXPECT_EQ(1, gotValue->value.int32Values[0]); + EXPECT_EQ(2, gotValue->value.int32Values[1]); + EXPECT_EQ(3, gotValue->value.int32Values[2]); + EXPECT_EQ(1.0f, gotValue->value.floatValues[0]); +} + TEST_F(DefaultVhalImplTest, testSetUnknownProperty) { VehiclePropValue value; value.prop = 0; @@ -247,6 +276,13 @@ TEST_F(DefaultVhalImplTest, testSubscribeInvalidProp) { EXPECT_EQ(StatusCode::INVALID_ARG, mHal->subscribe(toInt(VehicleProperty::INFO_MAKE), 10)); } +TEST_F(DefaultVhalImplTest, testSubscribeSampleRateOutOfRange) { + EXPECT_EQ(StatusCode::INVALID_ARG, + mHal->subscribe(toInt(VehicleProperty::PERF_VEHICLE_SPEED), 10.1)); + EXPECT_EQ(StatusCode::INVALID_ARG, + mHal->subscribe(toInt(VehicleProperty::PERF_VEHICLE_SPEED), 0.5)); +} + TEST_F(DefaultVhalImplTest, testUnsubscribe) { auto status = mHal->subscribe(toInt(VehicleProperty::PERF_VEHICLE_SPEED), 10); EXPECT_EQ(StatusCode::OK, status); @@ -300,4 +336,152 @@ TEST_F(DefaultVhalImplTest, testDump) { EXPECT_NE(std::string::npos, std::string(buf).find(infoMake)); } +class DefaultVhalImplSetInvalidPropTest : public DefaultVhalImplTest, + public testing::WithParamInterface {}; + +std::vector GenSetInvalidPropParams() { + std::vector props; + // int prop with no value. + VehiclePropValue intProp = {.prop = toInt(VehicleProperty::INFO_MODEL_YEAR)}; + props.push_back(intProp); + + // int prop with more than one value. + VehiclePropValue intPropWithValues = {.prop = toInt(VehicleProperty::INFO_MODEL_YEAR)}; + intPropWithValues.value.int32Values.resize(2); + props.push_back(intPropWithValues); + + // int vec prop with no value. + VehiclePropValue intVecProp = {.prop = toInt(VehicleProperty::INFO_FUEL_TYPE)}; + props.push_back(intVecProp); + + // int64 prop with no value. + VehiclePropValue int64Prop = {.prop = toInt(VehicleProperty::EPOCH_TIME)}; + props.push_back(int64Prop); + + // int64 prop with more than one value. + VehiclePropValue int64PropWithValues = {.prop = toInt(VehicleProperty::EPOCH_TIME)}; + int64PropWithValues.value.int64Values.resize(2); + props.push_back(int64PropWithValues); + + // int64 vec prop with no value. + VehiclePropValue int64VecProp = {.prop = toInt(VehicleProperty::WHEEL_TICK)}; + props.push_back(int64VecProp); + + // float prop with no value. + VehiclePropValue floatProp = {.prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY)}; + props.push_back(floatProp); + + // float prop with more than one value. + VehiclePropValue floatPropWithValues = {.prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY)}; + floatPropWithValues.value.floatValues.resize(2); + props.push_back(floatPropWithValues); + + // float vec prop with no value. + VehiclePropValue floatVecProp = { + .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION)}; + props.push_back(floatVecProp); + + // bool prop with no value. + VehiclePropValue boolProp = { + .prop = toInt(VehicleProperty::FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME)}; + props.push_back(boolProp); + + // bool prop with more than one value. + VehiclePropValue boolPropWithValues = { + .prop = toInt(VehicleProperty::FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME)}; + boolPropWithValues.value.int32Values.resize(2); + props.push_back(boolPropWithValues); + + // mixed prop. + // .configArray = {1, 1, 0, 2, 0, 0, 1, 0, 0} + // 1 string, 1 int, 0 bool, 2 ints, 0 int64, 0 int64s, 1 float, 0 floats, 0 bytes + VehiclePropValue mixedProp1 = {.prop = kMixedTypePropertyForTest}; + // Expect 1 bool, and 2 ints, we only have 1 value. + mixedProp1.value.int32Values.resize(1); + mixedProp1.value.floatValues.resize(1); + props.push_back(mixedProp1); + + VehiclePropValue mixedProp2 = {.prop = kMixedTypePropertyForTest}; + mixedProp2.value.int32Values.resize(3); + // Missing float value. + mixedProp2.value.floatValues.resize(0); + props.push_back(mixedProp2); + + return props; +} + +TEST_P(DefaultVhalImplSetInvalidPropTest, testSetInvalidPropValue) { + VehiclePropValue value = GetParam(); + + StatusCode status = mHal->set(value); + + EXPECT_EQ(StatusCode::INVALID_ARG, status); +} + +INSTANTIATE_TEST_SUITE_P(DefaultVhalImplSetInvalidPropTests, DefaultVhalImplSetInvalidPropTest, + testing::ValuesIn(GenSetInvalidPropParams())); + +struct SetPropRangeTestCase { + std::string name; + VehiclePropValue prop; + StatusCode code; +}; + +class DefaultVhalImplSetPropRangeTest : public DefaultVhalImplTest, + public testing::WithParamInterface {}; + +std::vector GenSetPropRangeParams() { + std::vector tc; + VehiclePropValue intPropNormal = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), + .areaId = HVAC_LEFT, + // min: 1, max: 7 + .value.int32Values = {3}}; + tc.push_back({"normal_case_int", intPropNormal, StatusCode::OK}); + + VehiclePropValue intPropSmall = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), + .areaId = HVAC_LEFT, + // min: 1, max: 7 + .value.int32Values = {0}}; + tc.push_back({"normal_case_int_too_small", intPropSmall, StatusCode::INVALID_ARG}); + + VehiclePropValue intPropLarge = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), + .areaId = HVAC_LEFT, + // min: 1, max: 7 + .value.int32Values = {8}}; + tc.push_back({"normal_case_int_too_large", intPropLarge, StatusCode::INVALID_ARG}); + + VehiclePropValue floatPropNormal = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET), + .areaId = HVAC_LEFT, + // min: 16, max: 32 + .value.floatValues = {26}}; + tc.push_back({"normal_case_float", floatPropNormal, StatusCode::OK}); + VehiclePropValue floatPropSmall = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET), + .areaId = HVAC_LEFT, + // min: 16, max: 32 + .value.floatValues = {15.5}}; + tc.push_back({"normal_case_float_too_small", floatPropSmall, StatusCode::INVALID_ARG}); + VehiclePropValue floatPropLarge = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET), + .areaId = HVAC_LEFT, + // min: 16, max: 32 + .value.floatValues = {32.6}}; + tc.push_back({"normal_case_float_too_large", floatPropLarge, StatusCode::INVALID_ARG}); + + return tc; +} + +TEST_P(DefaultVhalImplSetPropRangeTest, testSetPropRange) { + SetPropRangeTestCase tc = GetParam(); + + StatusCode status = mHal->set(tc.prop); + + EXPECT_EQ(tc.code, status); +} + +INSTANTIATE_TEST_SUITE_P( + DefaultVhalImplSetPropRangeTests, DefaultVhalImplSetPropRangeTest, + testing::ValuesIn(GenSetPropRangeParams()), + [](const testing::TestParamInfo& info) { + return info.param.name; + }); + } // namespace -- GitLab From 795f4de0b46e574bbc8e3d0a1d20394f11ffa93b Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 1 Jul 2021 15:41:19 -0700 Subject: [PATCH 072/825] Extend onDump to support debug options. Extend onDump to support debugging. This CL only adds genFakeData option. Test: atest android.hardware.automotive.vehicle@2.0-default-impl-unit-tests Bug: 193565753 Change-Id: I11d5d0f12c0ef050544c798bff2b4b27962bd3df --- automotive/vehicle/2.0/default/Android.bp | 4 +- .../vhal_v2_0/DefaultVehicleHalServer.cpp | 244 ++++++++++++++- .../impl/vhal_v2_0/DefaultVehicleHalServer.h | 8 +- .../impl/vhal_v2_0/JsonFakeValueGenerator.cpp | 33 +- .../impl/vhal_v2_0/JsonFakeValueGenerator.h | 3 +- .../vhal_v2_0/LinearFakeValueGenerator.cpp | 39 ++- .../impl/vhal_v2_0/LinearFakeValueGenerator.h | 12 +- .../default/impl/vhal_v2_0/tests/Android.bp | 18 ++ .../vhal_v2_0/tests/DefaultVhalImpl_test.cpp | 286 ++++++++++++++++-- .../default/impl/vhal_v2_0/tests/prop.json | 26 ++ 10 files changed, 619 insertions(+), 54 deletions(-) create mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/Android.bp create mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/prop.json diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp index aabc60c2db..2e8ca66473 100644 --- a/automotive/vehicle/2.0/default/Android.bp +++ b/automotive/vehicle/2.0/default/Android.bp @@ -197,6 +197,7 @@ cc_test { static_libs: [ "libbase", "libcutils", + "libgmock", "libjsoncpp", "libprotobuf-cpp-lite", ], @@ -212,6 +213,7 @@ cc_test { "android.hardware.automotive.vehicle@2.0-default-impl-lib", "android.hardware.automotive.vehicle@2.0-libproto-native", ], + data: [":vhal_test_json"], test_suites: ["general-tests"], } @@ -233,7 +235,7 @@ cc_binary { static_libs: [ "android.hardware.automotive.vehicle@2.0-manager-lib", "android.hardware.automotive.vehicle@2.0-libproto-native", - "//device/generic/car/emulator/vhal_v2_0:android.hardware.automotive.vehicle@2.0-emulator-impl-lib", + "android.hardware.automotive.vehicle@2.0-emulator-impl-lib", ], } diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp index 66849bcc9e..f61a93b5bf 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp @@ -20,6 +20,8 @@ #include #include +#include +#include #include #include "DefaultConfig.h" @@ -82,7 +84,7 @@ void DefaultVehicleHalServer::sendAllValuesToClient() { } } -GeneratorHub* DefaultVehicleHalServer::getGenerator() { +GeneratorHub* DefaultVehicleHalServer::getGeneratorHub() { return &mGeneratorHub; } @@ -145,8 +147,8 @@ StatusCode DefaultVehicleHalServer::handleGenerateFakeDataRequest(const VehicleP return StatusCode::INVALID_ARG; } int32_t cookie = v.int32Values[1]; - getGenerator()->registerGenerator(cookie, - std::make_unique(request)); + getGeneratorHub()->registerGenerator( + cookie, std::make_unique(request)); break; } case FakeDataCommand::StartJson: { @@ -156,8 +158,12 @@ StatusCode DefaultVehicleHalServer::handleGenerateFakeDataRequest(const VehicleP return StatusCode::INVALID_ARG; } int32_t cookie = std::hash()(v.stringValue); - getGenerator()->registerGenerator(cookie, - std::make_unique(request)); + auto generator = std::make_unique(request); + if (!generator->hasNext()) { + LOG(ERROR) << __func__ << ": invalid JSON file, no events"; + return StatusCode::INVALID_ARG; + } + getGeneratorHub()->registerGenerator(cookie, std::move(generator)); break; } case FakeDataCommand::StopLinear: { @@ -167,7 +173,7 @@ StatusCode DefaultVehicleHalServer::handleGenerateFakeDataRequest(const VehicleP return StatusCode::INVALID_ARG; } int32_t cookie = v.int32Values[1]; - getGenerator()->unregisterGenerator(cookie); + getGeneratorHub()->unregisterGenerator(cookie); break; } case FakeDataCommand::StopJson: { @@ -177,7 +183,7 @@ StatusCode DefaultVehicleHalServer::handleGenerateFakeDataRequest(const VehicleP return StatusCode::INVALID_ARG; } int32_t cookie = std::hash()(v.stringValue); - getGenerator()->unregisterGenerator(cookie); + getGeneratorHub()->unregisterGenerator(cookie); break; } case FakeDataCommand::KeyPress: { @@ -331,17 +337,225 @@ StatusCode DefaultVehicleHalServer::onSetProperty(const VehiclePropValue& value, } IVehicleServer::DumpResult DefaultVehicleHalServer::onDump( - const std::vector& /* options */) { + const std::vector& options) { DumpResult result; - result.callerShouldDumpState = true; + if (options.size() == 0) { + // No options, dump all stored properties. + result.callerShouldDumpState = true; + result.buffer += "Server side properties: \n"; + auto values = mServerSidePropStore.readAllValues(); + size_t i = 0; + for (const auto& value : values) { + result.buffer += fmt::format("[{}]: {}\n", i, toString(value)); + i++; + } + return result; + } + if (options[0] != "--debughal") { + // We only expect "debughal" command. This might be some commands that the caller knows + // about, so let caller handle it. + result.callerShouldDumpState = true; + return result; + } - result.buffer += "Server side properties: \n"; - auto values = mServerSidePropStore.readAllValues(); - size_t i = 0; - for (const auto& value : values) { - result.buffer += fmt::format("[{}]: {}\n", i, toString(value)); - i++; + return debug(options); +} + +IVehicleServer::DumpResult DefaultVehicleHalServer::debug(const std::vector& options) { + DumpResult result; + // This is a debug command for the HAL, caller should not continue to dump state. + result.callerShouldDumpState = false; + + if (options.size() < 2) { + result.buffer += "No command specified\n"; + result.buffer += getHelpInfo(); + return result; + } + + std::string command = options[1]; + if (command == "--help") { + result.buffer += getHelpInfo(); + return result; + } else if (command == "--genfakedata") { + return genFakeData(options); + } + + result.buffer += "Unknown command: \"" + command + "\"\n"; + result.buffer += getHelpInfo(); + return result; +} + +std::string DefaultVehicleHalServer::getHelpInfo() { + return "Help: \n" + "Generate Fake Data: \n" + "\tStart a linear generator: \n" + "\t--debughal --genfakedata --startlinear [propID(int32)] [middleValue(float)] " + "[currentValue(float)] [dispersion(float)] [increment(float)] [interval(int64)]\n" + "\tStop a linear generator: \n" + "\t--debughal --genfakedata --stoplinear [propID(int32)]\n" + "\tStart a json generator: \n" + "\t--debughal --genfakedata --startjson [jsonFilePath(string)] " + "[repetition(int32)(optional)]\n" + "\tStop a json generator: \n" + "\t--debughal --genfakedata --stopjson [jsonFilePath(string)]\n" + "\tGenerate key press: \n" + "\t--debughal --genfakedata --keypress [keyCode(int32)] [display[int32]]\n"; +} + +IVehicleServer::DumpResult DefaultVehicleHalServer::genFakeData( + const std::vector& options) { + DumpResult result; + // This is a debug command for the HAL, caller should not continue to dump state. + result.callerShouldDumpState = false; + + if (options.size() < 3) { + result.buffer += "No subcommand specified for genfakedata\n"; + result.buffer += getHelpInfo(); + return result; } + + std::string command = options[2]; + if (command == "--startlinear") { + LOG(INFO) << __func__ << "FakeDataCommand::StartLinear"; + // --debughal --genfakedata --startlinear [propID(int32)] [middleValue(float)] + // [currentValue(float)] [dispersion(float)] [increment(float)] [interval(int64)] + if (options.size() != 9) { + result.buffer += + "incorrect argument count, need 9 arguments for --genfakedata --startlinear\n"; + result.buffer += getHelpInfo(); + return result; + } + int32_t propId; + float middleValue; + float currentValue; + float dispersion; + float increment; + int64_t interval; + if (!android::base::ParseInt(options[3], &propId)) { + result.buffer += "failed to parse propdID as int: \"" + options[3] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + if (!android::base::ParseFloat(options[4], &middleValue)) { + result.buffer += "failed to parse middleValue as float: \"" + options[4] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + if (!android::base::ParseFloat(options[5], ¤tValue)) { + result.buffer += "failed to parse currentValue as float: \"" + options[5] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + if (!android::base::ParseFloat(options[6], &dispersion)) { + result.buffer += "failed to parse dispersion as float: \"" + options[6] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + if (!android::base::ParseFloat(options[7], &increment)) { + result.buffer += "failed to parse increment as float: \"" + options[7] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + if (!android::base::ParseInt(options[8], &interval)) { + result.buffer += "failed to parse interval as int: \"" + options[8] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + auto generator = std::make_unique( + propId, middleValue, currentValue, dispersion, increment, interval); + getGeneratorHub()->registerGenerator(propId, std::move(generator)); + return result; + } else if (command == "--stoplinear") { + LOG(INFO) << __func__ << "FakeDataCommand::StopLinear"; + // --debughal --genfakedata --stoplinear [propID(int32)] + if (options.size() != 4) { + result.buffer += + "incorrect argument count, need 4 arguments for --genfakedata --stoplinear\n"; + result.buffer += getHelpInfo(); + return result; + } + int32_t propId; + if (!android::base::ParseInt(options[3], &propId)) { + result.buffer += "failed to parse propdID as int: \"" + options[3] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + getGeneratorHub()->unregisterGenerator(propId); + return result; + } else if (command == "--startjson") { + LOG(INFO) << __func__ << "FakeDataCommand::StartJson"; + // --debughal --genfakedata --startjson [jsonFilePath(string)] [repetition(int32)(optional)] + if (options.size() != 4 && options.size() != 5) { + result.buffer += + "incorrect argument count, need 4 or 5 arguments for --genfakedata " + "--startjson\n"; + result.buffer += getHelpInfo(); + return result; + } + std::string fileName = options[3]; + int32_t cookie = std::hash()(fileName); + // Iterate infinitely if repetition number is not provided + int32_t repetition = -1; + if (options.size() == 5) { + if (!android::base::ParseInt(options[4], &repetition)) { + result.buffer += "failed to parse repetition as int: \"" + options[4] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + } + auto generator = std::make_unique(fileName, repetition); + if (!generator->hasNext()) { + result.buffer += "invalid JSON file, no events"; + return result; + } + getGeneratorHub()->registerGenerator(cookie, std::move(generator)); + return result; + } else if (command == "--stopjson") { + LOG(INFO) << __func__ << "FakeDataCommand::StopJson"; + // --debughal --genfakedata --stopjson [jsonFilePath(string)] + if (options.size() != 4) { + result.buffer += + "incorrect argument count, need 4 arguments for --genfakedata --stopjson\n"; + result.buffer += getHelpInfo(); + return result; + } + std::string fileName = options[3]; + int32_t cookie = std::hash()(fileName); + getGeneratorHub()->unregisterGenerator(cookie); + return result; + } else if (command == "--keypress") { + LOG(INFO) << __func__ << "FakeDataCommand::KeyPress"; + int32_t keyCode; + int32_t display; + // --debughal --genfakedata --keypress [keyCode(int32)] [display[int32]] + if (options.size() != 5) { + result.buffer += + "incorrect argument count, need 5 arguments for --genfakedata --keypress\n"; + result.buffer += getHelpInfo(); + return result; + } + if (!android::base::ParseInt(options[3], &keyCode)) { + result.buffer += "failed to parse keyCode as int: \"" + options[3] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + if (!android::base::ParseInt(options[4], &display)) { + result.buffer += "failed to parse display as int: \"" + options[4] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + // Send back to HAL + onPropertyValueFromCar( + *createHwInputKeyProp(VehicleHwKeyInputAction::ACTION_DOWN, keyCode, display), + /*updateStatus=*/true); + onPropertyValueFromCar( + *createHwInputKeyProp(VehicleHwKeyInputAction::ACTION_UP, keyCode, display), + /*updateStatus=*/true); + return result; + } + + result.buffer += "Unknown command: \"" + command + "\"\n"; + result.buffer += getHelpInfo(); return result; } diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h index 1a42cb8e73..aa6cf0bf49 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h @@ -52,7 +52,7 @@ class DefaultVehicleHalServer : public IVehicleServer { protected: using VehiclePropValuePtr = recyclable_ptr; - GeneratorHub* getGenerator(); + GeneratorHub* getGeneratorHub(); VehiclePropValuePool* getValuePool() const; @@ -67,6 +67,12 @@ class DefaultVehicleHalServer : public IVehicleServer { void storePropInitialValue(const ConfigDeclaration& config); + DumpResult debug(const std::vector& options); + + std::string getHelpInfo(); + + DumpResult genFakeData(const std::vector& options); + protected: GeneratorHub mGeneratorHub{ [this](const VehiclePropValue& value) { return onFakeValueGenerated(value); }}; diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.cpp index b62918f61e..b728d62e25 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.cpp @@ -33,12 +33,37 @@ namespace V2_0 { namespace impl { +JsonFakeValueGenerator::JsonFakeValueGenerator(const std::string& path, int32_t repetition) { + const char* file = path.c_str(); + std::ifstream ifs(file); + if (!ifs) { + ALOGE("%s: couldn't open %s for parsing.", __func__, file); + mGenCfg = { + .index = 0, + .events = {}, + }; + mNumOfIterations = 0; + return; + } + mGenCfg = { + .index = 0, + .events = parseFakeValueJson(ifs), + }; + mNumOfIterations = repetition; +} + JsonFakeValueGenerator::JsonFakeValueGenerator(const VehiclePropValue& request) { const auto& v = request.value; const char* file = v.stringValue.c_str(); std::ifstream ifs(file); if (!ifs) { ALOGE("%s: couldn't open %s for parsing.", __func__, file); + mGenCfg = { + .index = 0, + .events = {}, + }; + mNumOfIterations = 0; + return; } mGenCfg = { .index = 0, @@ -48,10 +73,16 @@ JsonFakeValueGenerator::JsonFakeValueGenerator(const VehiclePropValue& request) mNumOfIterations = v.int32Values.size() < 2 ? -1 : v.int32Values[1]; } -JsonFakeValueGenerator::JsonFakeValueGenerator(std::string path) { +JsonFakeValueGenerator::JsonFakeValueGenerator(const std::string& path) { std::ifstream ifs(path); if (!ifs) { ALOGE("%s: couldn't open %s for parsing.", __func__, path.c_str()); + mGenCfg = { + .index = 0, + .events = {}, + }; + mNumOfIterations = 0; + return; } mGenCfg = { .index = 0, diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.h index dc8ff6680c..caa3417b6d 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.h @@ -41,7 +41,8 @@ private: public: JsonFakeValueGenerator(const VehiclePropValue& request); - JsonFakeValueGenerator(std::string path); + JsonFakeValueGenerator(const std::string& path, int32_t repetition); + JsonFakeValueGenerator(const std::string& path); ~JsonFakeValueGenerator() = default; diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/LinearFakeValueGenerator.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/LinearFakeValueGenerator.cpp index 96aaafe0b0..a2278bd088 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/LinearFakeValueGenerator.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/LinearFakeValueGenerator.cpp @@ -29,23 +29,36 @@ namespace V2_0 { namespace impl { +LinearFakeValueGenerator::LinearFakeValueGenerator(int32_t propId, float middleValue, + float currentValue, float dispersion, + float increment, int64_t interval) { + initGenCfg(propId, middleValue, currentValue, dispersion, increment, interval); +} + LinearFakeValueGenerator::LinearFakeValueGenerator(const VehiclePropValue& request) { const auto& v = request.value; + initGenCfg(v.int32Values[1], v.floatValues[0], v.floatValues[0], v.floatValues[1], + v.floatValues[2], v.int64Values[0]); +} + +void LinearFakeValueGenerator::initGenCfg(int32_t propId, float middleValue, float currentValue, + float dispersion, float increment, int64_t interval) { + if (currentValue < middleValue - dispersion || currentValue >= middleValue + dispersion) { + ALOGW("%s: invalid initValue: %f, out of range, default to %f", __func__, currentValue, + middleValue); + currentValue = middleValue; + } mGenCfg = GeneratorCfg{ - .propId = v.int32Values[1], - .initialValue = v.floatValues[0], - .currentValue = v.floatValues[0], - .dispersion = v.floatValues[1], - .increment = v.floatValues[2], - .interval = Nanos(v.int64Values[0]), + .propId = propId, + .middleValue = middleValue, + .currentValue = currentValue, + .dispersion = dispersion, + .increment = increment, + .interval = Nanos(interval), }; } VehiclePropValue LinearFakeValueGenerator::nextEvent() { - mGenCfg.currentValue += mGenCfg.increment; - if (mGenCfg.currentValue > mGenCfg.initialValue + mGenCfg.dispersion) { - mGenCfg.currentValue = mGenCfg.initialValue - mGenCfg.dispersion; - } // TODO: (chenhaosjtuacm) remove "{}" if AGL compiler updated VehiclePropValue event = {.timestamp = {}, .areaId = {}, .prop = mGenCfg.propId}; auto& value = event.value; @@ -67,6 +80,12 @@ VehiclePropValue LinearFakeValueGenerator::nextEvent() { } TimePoint eventTime = Clock::now() + mGenCfg.interval; event.timestamp = eventTime.time_since_epoch().count(); + + mGenCfg.currentValue += mGenCfg.increment; + if (mGenCfg.currentValue >= mGenCfg.middleValue + mGenCfg.dispersion) { + // Wrap around, (i - d) + c - (i + d) = c - 2 * d + mGenCfg.currentValue = mGenCfg.currentValue - 2 * mGenCfg.dispersion; + } return event; } diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/LinearFakeValueGenerator.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/LinearFakeValueGenerator.h index d3b666dd9d..d870209409 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/LinearFakeValueGenerator.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/LinearFakeValueGenerator.h @@ -35,8 +35,8 @@ private: struct GeneratorCfg { int32_t propId; - float initialValue; - float currentValue; // Should be in range (initialValue +/- dispersion). + float middleValue; + float currentValue; // Should be in range (middleValue +/- dispersion). float dispersion; // Defines minimum and maximum value based on initial value. float increment; // Value that we will be added to currentValue with each timer tick. Nanos interval; @@ -44,6 +44,11 @@ private: public: LinearFakeValueGenerator(const VehiclePropValue& request); + // A linear value generator in range [middleValue - dispersion, middleValue + dispersion), + // starts at 'currentValue' and at each 'interval', increase by 'increment' and loop back if + // exceeds middleValue + dispersion. + LinearFakeValueGenerator(int32_t propId, float middleValue, float currentValue, + float dispersion, float increment, int64_t interval); ~LinearFakeValueGenerator() = default; VehiclePropValue nextEvent(); @@ -52,6 +57,9 @@ public: private: GeneratorCfg mGenCfg; + + void initGenCfg(int32_t propId, float middleValue, float currentValue, float dispersion, + float increment, int64_t interval); }; } // namespace impl diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/Android.bp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/Android.bp new file mode 100644 index 0000000000..576222380e --- /dev/null +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/Android.bp @@ -0,0 +1,18 @@ +// 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. + +filegroup { + name: "vhal_test_json", + srcs: ["prop.json"], +} 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 a2ec0dd688..3b0d5fb7f6 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 @@ -14,7 +14,9 @@ * limitations under the License. */ +#include #include +#include #include #include #include @@ -33,6 +35,7 @@ using ::android::hardware::hidl_vec; using ::android::hardware::automotive::vehicle::V2_0::FuelType; using ::android::hardware::automotive::vehicle::V2_0::recyclable_ptr; using ::android::hardware::automotive::vehicle::V2_0::StatusCode; +using ::android::hardware::automotive::vehicle::V2_0::VehicleHwKeyInputAction; using ::android::hardware::automotive::vehicle::V2_0::VehiclePropConfig; using ::android::hardware::automotive::vehicle::V2_0::VehicleProperty; using ::android::hardware::automotive::vehicle::V2_0::VehiclePropertyStatus; @@ -44,8 +47,13 @@ using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVehicleHal; using ::android::hardware::automotive::vehicle::V2_0::impl::HVAC_LEFT; using ::android::hardware::automotive::vehicle::V2_0::impl::kMixedTypePropertyForTest; +using ::testing::HasSubstr; + using VehiclePropValuePtr = recyclable_ptr; +// The maximum length of property ID in string. +const size_t MAX_PROP_ID_LENGTH = 100; + class DefaultVhalImplTest : public ::testing::Test { public: ~DefaultVhalImplTest() { mEventQueue.deactivate(); } @@ -90,7 +98,7 @@ TEST_F(DefaultVhalImplTest, testGetDefaultPropertyFloat) { auto gotValue = mHal->get(value, &status); EXPECT_EQ(StatusCode::OK, status); - EXPECT_EQ((unsigned int)1, gotValue->value.floatValues.size()); + ASSERT_EQ((unsigned int)1, gotValue->value.floatValues.size()); EXPECT_EQ(15000.0f, gotValue->value.floatValues[0]); } @@ -102,7 +110,7 @@ TEST_F(DefaultVhalImplTest, testGetDefaultPropertyEnum) { auto gotValue = mHal->get(value, &status); EXPECT_EQ(StatusCode::OK, status); - EXPECT_EQ((unsigned int)1, gotValue->value.int32Values.size()); + ASSERT_EQ((unsigned int)1, gotValue->value.int32Values.size()); EXPECT_EQ((int)FuelType::FUEL_TYPE_UNLEADED, gotValue->value.int32Values[0]); } @@ -114,7 +122,7 @@ TEST_F(DefaultVhalImplTest, testGetDefaultPropertyInt) { auto gotValue = mHal->get(value, &status); EXPECT_EQ(StatusCode::OK, status); - EXPECT_EQ((unsigned int)1, gotValue->value.int32Values.size()); + ASSERT_EQ((unsigned int)1, gotValue->value.int32Values.size()); EXPECT_EQ(2020, gotValue->value.int32Values[0]); } @@ -146,11 +154,11 @@ TEST_F(DefaultVhalImplTest, testSetFloat) { value.value.floatValues[0] = 1.0f; StatusCode status = mHal->set(value); - EXPECT_EQ(StatusCode::OK, status); + ASSERT_EQ(StatusCode::OK, status); auto gotValue = mHal->get(value, &status); EXPECT_EQ(StatusCode::OK, status); - EXPECT_EQ((unsigned int)1, gotValue->value.floatValues.size()); + ASSERT_EQ((unsigned int)1, gotValue->value.floatValues.size()); EXPECT_EQ(1.0f, gotValue->value.floatValues[0]); } @@ -161,11 +169,11 @@ TEST_F(DefaultVhalImplTest, testSetEnum) { value.value.int32Values[0] = (int)FuelType::FUEL_TYPE_LEADED; StatusCode status = mHal->set(value); - EXPECT_EQ(StatusCode::OK, status); + ASSERT_EQ(StatusCode::OK, status); auto gotValue = mHal->get(value, &status); EXPECT_EQ(StatusCode::OK, status); - EXPECT_EQ((unsigned int)1, gotValue->value.int32Values.size()); + ASSERT_EQ((unsigned int)1, gotValue->value.int32Values.size()); EXPECT_EQ((int)FuelType::FUEL_TYPE_LEADED, gotValue->value.int32Values[0]); } @@ -190,7 +198,7 @@ TEST_F(DefaultVhalImplTest, testSetString) { value.value.stringValue = "My Vehicle"; StatusCode status = mHal->set(value); - EXPECT_EQ(StatusCode::OK, status); + ASSERT_EQ(StatusCode::OK, status); auto gotValue = mHal->get(value, &status); EXPECT_EQ(StatusCode::OK, status); @@ -212,14 +220,16 @@ TEST_F(DefaultVhalImplTest, testSetMixed) { value.value.floatValues[0] = 1.0f; StatusCode status = mHal->set(value); - EXPECT_EQ(StatusCode::OK, status); + ASSERT_EQ(StatusCode::OK, status); auto gotValue = mHal->get(value, &status); EXPECT_EQ(StatusCode::OK, status); EXPECT_EQ("test", gotValue->value.stringValue); + ASSERT_EQ((size_t)3, gotValue->value.int32Values.size()); EXPECT_EQ(1, gotValue->value.int32Values[0]); EXPECT_EQ(2, gotValue->value.int32Values[1]); EXPECT_EQ(3, gotValue->value.int32Values[2]); + ASSERT_EQ((size_t)1, gotValue->value.floatValues.size()); EXPECT_EQ(1.0f, gotValue->value.floatValues[0]); } @@ -248,7 +258,7 @@ TEST_F(DefaultVhalImplTest, testSubscribe) { auto status = mHal->subscribe(toInt(VehicleProperty::PERF_VEHICLE_SPEED), 10); - EXPECT_EQ(StatusCode::OK, status); + ASSERT_EQ(StatusCode::OK, status); std::this_thread::sleep_for(std::chrono::milliseconds(500)); @@ -257,18 +267,18 @@ TEST_F(DefaultVhalImplTest, testSubscribe) { value.prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED); value.value.floatValues.resize(1); value.value.floatValues[0] = 1.0f; - EXPECT_EQ(StatusCode::OK, mHal->set(value)); + ASSERT_EQ(StatusCode::OK, mHal->set(value)); std::this_thread::sleep_for(std::chrono::milliseconds(500)); auto events = mEventQueue.flush(); - EXPECT_LE((size_t)10, events.size()); + ASSERT_LE((size_t)10, events.size()); // The first event should be the default value. - EXPECT_EQ((size_t)1, events[0]->value.floatValues.size()); + ASSERT_EQ((size_t)1, events[0]->value.floatValues.size()); EXPECT_EQ(0.0f, events[0]->value.floatValues[0]); // The last event should be the value after update. - EXPECT_EQ((size_t)1, events[events.size() - 1]->value.floatValues.size()); + ASSERT_EQ((size_t)1, events[events.size() - 1]->value.floatValues.size()); EXPECT_EQ(1.0f, events[events.size() - 1]->value.floatValues[0]); } @@ -285,13 +295,13 @@ TEST_F(DefaultVhalImplTest, testSubscribeSampleRateOutOfRange) { TEST_F(DefaultVhalImplTest, testUnsubscribe) { auto status = mHal->subscribe(toInt(VehicleProperty::PERF_VEHICLE_SPEED), 10); - EXPECT_EQ(StatusCode::OK, status); + ASSERT_EQ(StatusCode::OK, status); // Wait for 0.5 seconds to generate some events. std::this_thread::sleep_for(std::chrono::milliseconds(500)); status = mHal->unsubscribe(toInt(VehicleProperty::PERF_VEHICLE_SPEED)); - EXPECT_EQ(StatusCode::OK, status); + ASSERT_EQ(StatusCode::OK, status); // Clear all the events. mEventQueue.flush(); @@ -308,15 +318,20 @@ TEST_F(DefaultVhalImplTest, testUnsubscribeInvalidProp) { EXPECT_EQ(StatusCode::INVALID_ARG, mHal->unsubscribe(toInt(VehicleProperty::INFO_MAKE))); } -TEST_F(DefaultVhalImplTest, testDump) { - hidl_vec options; - hidl_handle fd = {}; +int createMemfd(hidl_handle* fd) { native_handle_t* handle = native_handle_create(/*numFds=*/1, /*numInts=*/0); int memfd = memfd_create("memfile", 0); handle->data[0] = dup(memfd); - fd.setTo(handle, /*shouldOwn=*/true); + fd->setTo(handle, /*shouldOwn=*/true); + return memfd; +} + +TEST_F(DefaultVhalImplTest, testDump) { + hidl_vec options; + hidl_handle fd = {}; + int memfd = createMemfd(&fd); - EXPECT_TRUE(mHal->dump(fd, options)); + ASSERT_TRUE(mHal->dump(fd, options)); lseek(memfd, 0, SEEK_SET); char buf[10240] = {}; @@ -328,12 +343,12 @@ TEST_F(DefaultVhalImplTest, testDump) { StatusCode status; value.prop = toInt(VehicleProperty::INFO_MAKE); auto gotValue = mHal->get(value, &status); - EXPECT_EQ(StatusCode::OK, status); + ASSERT_EQ(StatusCode::OK, status); // Server side prop store does not have timestamp. gotValue->timestamp = 0; std::string infoMake = toString(*gotValue); - EXPECT_NE(std::string::npos, std::string(buf).find(infoMake)); + EXPECT_THAT(std::string(buf), HasSubstr(infoMake)); } class DefaultVhalImplSetInvalidPropTest : public DefaultVhalImplTest, @@ -484,4 +499,229 @@ INSTANTIATE_TEST_SUITE_P( return info.param.name; }); +std::string getPropIdString(VehicleProperty prop) { + char s[MAX_PROP_ID_LENGTH] = {}; + snprintf(s, sizeof(s), "%d", toInt(prop)); + return std::string(s); +} + +struct OptionsTestCase { + std::string name; + hidl_vec options; + std::string expectMsg; +}; + +class DefaultVhalImplOptionsTest : public DefaultVhalImplTest, + public testing::WithParamInterface {}; + +TEST_P(DefaultVhalImplOptionsTest, testInvalidOptions) { + auto tc = GetParam(); + hidl_handle fd = {}; + int memfd = createMemfd(&fd); + + bool shouldDump = mHal->dump(fd, tc.options); + + EXPECT_FALSE(shouldDump); + char buf[10240] = {}; + lseek(memfd, 0, SEEK_SET); + read(memfd, buf, sizeof(buf)); + EXPECT_THAT(std::string(buf), HasSubstr(tc.expectMsg)); +} + +std::vector GenInvalidOptions() { + return {{"no_command", {"--debughal"}, "No command specified"}, + {"unknown_command", {"--debughal", "--unknown"}, "Unknown command: \"--unknown\""}, + {"help", {"--debughal", "--help"}, "Help:"}, + {"genfakedata_no_subcommand", + {"--debughal", "--genfakedata"}, + "No subcommand specified for genfakedata"}, + {"genfakedata_unknown_subcommand", + {"--debughal", "--genfakedata", "--unknown"}, + "Unknown command: \"--unknown\""}, + {"genfakedata_start_linear_no_args", + {"--debughal", "--genfakedata", "--startlinear"}, + "incorrect argument count"}, + {"genfakedata_start_linear_invalid_propId", + {"--debughal", "--genfakedata", "--startlinear", "abcd", "0.1", "0.1", "0.1", "0.1", + "100000000"}, + "failed to parse propdID as int: \"abcd\""}, + {"genfakedata_start_linear_invalid_middleValue", + {"--debughal", "--genfakedata", "--startlinear", "1", "abcd", "0.1", "0.1", "0.1", + "100000000"}, + "failed to parse middleValue as float: \"abcd\""}, + {"genfakedata_start_linear_invalid_currentValue", + {"--debughal", "--genfakedata", "--startlinear", "1", "0.1", "abcd", "0.1", "0.1", + "100000000"}, + "failed to parse currentValue as float: \"abcd\""}, + {"genfakedata_start_linear_invalid_dispersion", + {"--debughal", "--genfakedata", "--startlinear", "1", "0.1", "0.1", "abcd", "0.1", + "100000000"}, + "failed to parse dispersion as float: \"abcd\""}, + {"genfakedata_start_linear_invalid_increment", + {"--debughal", "--genfakedata", "--startlinear", "1", "0.1", "0.1", "0.1", "abcd", + "100000000"}, + "failed to parse increment as float: \"abcd\""}, + {"genfakedata_start_linear_invalid_interval", + {"--debughal", "--genfakedata", "--startlinear", "1", "0.1", "0.1", "0.1", "0.1", + "0.1"}, + "failed to parse interval as int: \"0.1\""}, + {"genfakedata_stop_linear_no_args", + {"--debughal", "--genfakedata", "--stoplinear"}, + "incorrect argument count"}, + {"genfakedata_stop_linear_invalid_propId", + {"--debughal", "--genfakedata", "--stoplinear", "abcd"}, + "failed to parse propdID as int: \"abcd\""}, + {"genfakedata_startjson_no_args", + {"--debughal", "--genfakedata", "--startjson"}, + "incorrect argument count"}, + {"genfakedata_startjson_invalid_repetition", + {"--debughal", "--genfakedata", "--startjson", "file", "0.1"}, + "failed to parse repetition as int: \"0.1\""}, + {"genfakedata_startjson_invalid_json_file", + {"--debughal", "--genfakedata", "--startjson", "file", "1"}, + "invalid JSON file"}, + {"genfakedata_stopjson_no_args", + {"--debughal", "--genfakedata", "--stopjson"}, + "incorrect argument count"}, + {"genfakedata_keypress_no_args", + {"--debughal", "--genfakedata", "--keypress"}, + "incorrect argument count"}, + {"genfakedata_keypress_invalid_keyCode", + {"--debughal", "--genfakedata", "--keypress", "0.1", "1"}, + "failed to parse keyCode as int: \"0.1\""}, + {"genfakedata_keypress_invalid_display", + {"--debughal", "--genfakedata", "--keypress", "1", "0.1"}, + "failed to parse display as int: \"0.1\""}}; +} + +INSTANTIATE_TEST_SUITE_P( + DefaultVhalImplOptionsTests, DefaultVhalImplOptionsTest, + testing::ValuesIn(GenInvalidOptions()), + [](const testing::TestParamInfo& info) { + return info.param.name; + }); + +TEST_F(DefaultVhalImplTest, testDebugGenFakeDataLinear) { + // Start a fake linear data generator for vehicle speed at 0.1s interval. + // range: 0 - 100, current value: 30, step: 20. + hidl_vec options = {"--debughal", + "--genfakedata", + "--startlinear", + getPropIdString(VehicleProperty::PERF_VEHICLE_SPEED), + /*middleValue=*/"50", + /*currentValue=*/"30", + /*dispersion=*/"50", + /*increment=*/"20", + /*interval=*/"100000000"}; + hidl_handle fd = {}; + int memfd = createMemfd(&fd); + // Clear existing events. + mEventQueue.flush(); + + EXPECT_FALSE(mHal->dump(fd, options)); + + lseek(memfd, 0, SEEK_SET); + char buf[10240] = {}; + // The dumped info should be empty. + read(memfd, buf, sizeof(buf)); + EXPECT_STREQ("", buf); + + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + + auto events = mEventQueue.flush(); + // We should get 10 events ideally, but let's be safe here. + ASSERT_LE((size_t)5, events.size()); + int32_t value = 30; + for (size_t i = 0; i < 5; i++) { + ASSERT_EQ((size_t)1, events[i]->value.floatValues.size()); + EXPECT_EQ((float)value, events[i]->value.floatValues[0]); + value = (value + 20) % 100; + } + + // Stop the linear generator. + options = {"--debughal", "--genfakedata", "--stoplinear", + getPropIdString(VehicleProperty::PERF_VEHICLE_SPEED)}; + EXPECT_FALSE(mHal->dump(fd, options)); + + // The dumped info should be empty. + lseek(memfd, 0, SEEK_SET); + read(memfd, buf, sizeof(buf)); + EXPECT_STREQ("", buf); + + close(memfd); + + // Clear existing events. + mEventQueue.flush(); + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + // There should be no new events generated. + EXPECT_EQ((size_t)0, mEventQueue.flush().size()); +} + +std::string getTestFilePath(const char* filename) { + static std::string baseDir = android::base::GetExecutableDirectory(); + return baseDir + "/" + filename; +} + +TEST_F(DefaultVhalImplTest, testDebugGenFakeDataJson) { + hidl_vec options = {"--debughal", "--genfakedata", "--startjson", + getTestFilePath("prop.json"), "2"}; + hidl_handle fd = {}; + int memfd = createMemfd(&fd); + // Clear existing events. + mEventQueue.flush(); + + EXPECT_FALSE(mHal->dump(fd, options)); + + lseek(memfd, 0, SEEK_SET); + char buf[10240] = {}; + // The dumped info should be empty. + read(memfd, buf, sizeof(buf)); + EXPECT_STREQ("", buf); + + // wait for some time. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + + auto events = mEventQueue.flush(); + ASSERT_EQ((size_t)8, events.size()); + // First set of events, we test 1st and the last. + EXPECT_EQ((size_t)1, events[0]->value.int32Values.size()); + EXPECT_EQ(8, events[0]->value.int32Values[0]); + EXPECT_EQ((size_t)1, events[3]->value.int32Values.size()); + EXPECT_EQ(4, events[3]->value.int32Values[0]); + // Second set of the same events. + EXPECT_EQ((size_t)1, events[4]->value.int32Values.size()); + EXPECT_EQ(8, events[4]->value.int32Values[0]); + EXPECT_EQ((size_t)1, events[7]->value.int32Values.size()); + EXPECT_EQ(4, events[7]->value.int32Values[0]); +} + +TEST_F(DefaultVhalImplTest, testDebugGenFakeDataKeyPress) { + hidl_vec options = {"--debughal", "--genfakedata", "--keypress", "1", "2"}; + hidl_handle fd = {}; + int memfd = createMemfd(&fd); + // Clear existing events. + mEventQueue.flush(); + + EXPECT_FALSE(mHal->dump(fd, options)); + + lseek(memfd, 0, SEEK_SET); + char buf[10240] = {}; + // The dumped info should be empty. + read(memfd, buf, sizeof(buf)); + EXPECT_STREQ("", buf); + + auto events = mEventQueue.flush(); + ASSERT_EQ((size_t)2, events.size()); + EXPECT_EQ(toInt(VehicleProperty::HW_KEY_INPUT), events[0]->prop); + EXPECT_EQ(toInt(VehicleProperty::HW_KEY_INPUT), events[1]->prop); + ASSERT_EQ((size_t)3, events[0]->value.int32Values.size()); + ASSERT_EQ((size_t)3, events[1]->value.int32Values.size()); + EXPECT_EQ(toInt(VehicleHwKeyInputAction::ACTION_DOWN), events[0]->value.int32Values[0]); + EXPECT_EQ(1, events[0]->value.int32Values[1]); + EXPECT_EQ(2, events[0]->value.int32Values[2]); + EXPECT_EQ(toInt(VehicleHwKeyInputAction::ACTION_UP), events[1]->value.int32Values[0]); + EXPECT_EQ(1, events[1]->value.int32Values[1]); + EXPECT_EQ(2, events[1]->value.int32Values[2]); +} + } // namespace diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/prop.json b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/prop.json new file mode 100644 index 0000000000..2e77a44094 --- /dev/null +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/prop.json @@ -0,0 +1,26 @@ +[ + { + "timestamp": 1000000, + "areaId": 0, + "value": 8, + "prop": 289408000 + }, + { + "timestamp": 2000000, + "areaId": 0, + "value": 4, + "prop": 289408000 + }, + { + "timestamp": 3000000, + "areaId": 0, + "value": 16, + "prop": 289408000 + }, + { + "timestamp": 4000000, + "areaId": 0, + "value": 4, + "prop": 289408000 + } +] -- GitLab From 8a572821be212dfff933ca90b8cabb71c0ade9fb Mon Sep 17 00:00:00 2001 From: Keith Mok Date: Wed, 14 Jul 2021 01:17:28 +0000 Subject: [PATCH 073/825] Remove vehicle binding seed property in emulator Emulator does not support vehicle binding seed property, but it reports it supports it. Remove it for now. Otherwise the vehicle binding utilities will try to set the vehicle binding seed but that will not be saved anywhere in the emulator. Test: manual Bug: 157501579 Change-Id: I874e94b06fe675a96e5b15c9bff087023b4ea109 --- .../vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h | 8 -------- .../default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) 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 899428e75e..da6de74b5b 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 @@ -1024,14 +1024,6 @@ const ConfigDeclaration kVehicleProperties[]{ .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, - { - .config = - { - .prop = toInt(VehicleProperty::STORAGE_ENCRYPTION_BINDING_SEED), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - }, { .config = { 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 3b0d5fb7f6..1b20bf5e1f 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 @@ -87,7 +87,7 @@ class DefaultVhalImplTest : public ::testing::Test { TEST_F(DefaultVhalImplTest, testListProperties) { std::vector configs = mHal->listProperties(); - EXPECT_EQ((size_t)122, configs.size()); + EXPECT_EQ((size_t)121, configs.size()); } TEST_F(DefaultVhalImplTest, testGetDefaultPropertyFloat) { -- GitLab From 91f3d412699e5be45576a7d4e4f1467e13a274fd Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Fri, 16 Jul 2021 14:59:15 -0700 Subject: [PATCH 074/825] Update audio VTS Android.bp to add new dependency AIDL conversion library libaudioclient_aidl_conversion uses media type names from libstagefright_foundation. Bug: 188932434 Test: m Change-Id: Ida3623dddb63f4d156044d70211819f0f4f8908a --- audio/core/all-versions/vts/functional/Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/audio/core/all-versions/vts/functional/Android.bp b/audio/core/all-versions/vts/functional/Android.bp index e446a7f2cf..9f4a2952c6 100644 --- a/audio/core/all-versions/vts/functional/Android.bp +++ b/audio/core/all-versions/vts/functional/Android.bp @@ -30,6 +30,7 @@ cc_defaults { "android.hardware.audio.common.test.utility", "audioclient-types-aidl-cpp", "libaudioclient_aidl_conversion", + "libstagefright_foundation", ], shared_libs: [ "libbinder", -- GitLab From fdf28cf28d90d2c77453b8468309515dbef38a8e Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 15 Jul 2021 16:27:12 -0700 Subject: [PATCH 075/825] Add heart beat event to Default VHAL. VHAL needs to send out heartbeat event so that watchdog does not kill it. This is required for all VHAL so move the logic to default VHAL. Test: Local run on emulator. Add a test case in android.hardware.automotive.vehicle@2.0-default-impl-unit-tests Bug: 193831021 Change-Id: Ieacd991c22fa0d70d254426d728d3827a38d0b42 --- .../impl/vhal_v2_0/DefaultVehicleHal.cpp | 44 +++++++++++++++++++ .../impl/vhal_v2_0/DefaultVehicleHal.h | 10 ++++- .../vhal_v2_0/tests/DefaultVhalImpl_test.cpp | 31 +++++++++++-- 3 files changed, 80 insertions(+), 5 deletions(-) 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 f410f4cc6f..5b06c33aa5 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 @@ -15,6 +15,7 @@ */ #define LOG_TAG "DefaultVehicleHal_v2_0" +#include #include #include #include @@ -32,6 +33,10 @@ namespace V2_0 { namespace impl { +namespace { +constexpr std::chrono::nanoseconds kHeartBeatIntervalNs = 3s; +} // namespace + DefaultVehicleHal::DefaultVehicleHal(VehiclePropertyStore* propStore, VehicleHalClient* client) : mPropStore(propStore), mRecurrentTimer(getTimerAction()), mVehicleClient(client) { initStaticConfig(); @@ -297,6 +302,41 @@ void DefaultVehicleHal::onCreate() { } mVehicleClient->triggerSendAllValues(); + registerHeartBeatEvent(); +} + +DefaultVehicleHal::~DefaultVehicleHal() { + mRecurrentTimer.unregisterRecurrentEvent(static_cast(VehicleProperty::VHAL_HEARTBEAT)); +} + +void DefaultVehicleHal::registerHeartBeatEvent() { + mRecurrentTimer.registerRecurrentEvent(kHeartBeatIntervalNs, + static_cast(VehicleProperty::VHAL_HEARTBEAT)); +} + +VehicleHal::VehiclePropValuePtr DefaultVehicleHal::doInternalHealthCheck() { + VehicleHal::VehiclePropValuePtr v = nullptr; + + // This is an example of very simple health checking. VHAL is considered healthy if we can read + // PERF_VEHICLE_SPEED. The more comprehensive health checking is required. + VehiclePropValue propValue = { + .prop = static_cast(VehicleProperty::PERF_VEHICLE_SPEED), + }; + auto internalPropValue = mPropStore->readValueOrNull(propValue); + if (internalPropValue != nullptr) { + v = createVhalHeartBeatProp(); + } else { + ALOGW("VHAL health check failed"); + } + return v; +} + +VehicleHal::VehiclePropValuePtr DefaultVehicleHal::createVhalHeartBeatProp() { + VehicleHal::VehiclePropValuePtr v = getValuePool()->obtainInt64(uptimeMillis()); + v->prop = static_cast(VehicleProperty::VHAL_HEARTBEAT); + v->areaId = 0; + v->status = VehiclePropertyStatus::AVAILABLE; + return v; } void DefaultVehicleHal::onContinuousPropertyTimer(const std::vector& properties) { @@ -309,6 +349,10 @@ void DefaultVehicleHal::onContinuousPropertyTimer(const std::vector& pr if (internalPropValue != nullptr) { v = pool.obtain(*internalPropValue); } + } else if (property == static_cast(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(); } else { ALOGE("Unexpected onContinuousPropertyTimer for property: 0x%x", property); continue; diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h index 2a0d430ea1..ecdb9a84a0 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h @@ -35,9 +35,9 @@ namespace impl { class DefaultVehicleHal : public VehicleHal { public: DefaultVehicleHal(VehiclePropertyStore* propStore, VehicleHalClient* client); - ~DefaultVehicleHal() = default; + ~DefaultVehicleHal(); - // Methods from VehicleHal + // Initialize VHAL. Should always call registerHeartBeatEvent() during onCreate. void onCreate() override; std::vector listProperties() override; VehiclePropValuePtr get(const VehiclePropValue& requestedPropValue, @@ -65,6 +65,12 @@ class DefaultVehicleHal : public VehicleHal { StatusCode checkPropValue(const VehiclePropValue& propValue, const VehiclePropConfig* config); // Check whether the property value is within the range according to area config. StatusCode checkValueRange(const VehiclePropValue& propValue, const VehiclePropConfig* config); + // Register the heart beat event to be sent every 3s. This is required to inform watch dog that + // VHAL is alive. Subclasses should always calls this function during onCreate. + void registerHeartBeatEvent(); + + VehicleHal::VehiclePropValuePtr doInternalHealthCheck(); + VehicleHal::VehiclePropValuePtr createVhalHeartBeatProp(); private: // Check whether a vendor mixed value property is valid according to its config array. 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 1b20bf5e1f..bbefce733a 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 @@ -56,14 +56,21 @@ const size_t MAX_PROP_ID_LENGTH = 100; class DefaultVhalImplTest : public ::testing::Test { public: - ~DefaultVhalImplTest() { mEventQueue.deactivate(); } + ~DefaultVhalImplTest() { + mEventQueue.deactivate(); + mHeartBeatQueue.deactivate(); + // Destroy mHal before destroying its dependencies. + mHal.reset(); + mConnector.reset(); + mPropStore.reset(); + } protected: void SetUp() override { mPropStore.reset(new VehiclePropertyStore); mConnector.reset(new DefaultVehicleConnector); - mHal.reset(new DefaultVehicleHal(mPropStore.get(), mConnector.get())); mConnector->setValuePool(&mValueObjectPool); + mHal.reset(new DefaultVehicleHal(mPropStore.get(), mConnector.get())); mHal->init(&mValueObjectPool, std::bind(&DefaultVhalImplTest::onHalEvent, this, std::placeholders::_1), std::bind(&DefaultVhalImplTest::onHalPropertySetError, this, @@ -71,7 +78,14 @@ class DefaultVhalImplTest : public ::testing::Test { } private: - void onHalEvent(VehiclePropValuePtr v) { mEventQueue.push(std::move(v)); } + void onHalEvent(VehiclePropValuePtr v) { + if (v->prop != toInt(VehicleProperty::VHAL_HEARTBEAT)) { + // Ignore heartbeat properties. + mEventQueue.push(std::move(v)); + } else { + mHeartBeatQueue.push(std::move(v)); + } + } void onHalPropertySetError(StatusCode /*errorCode*/, int32_t /*property*/, int32_t /*areaId*/) { } @@ -82,6 +96,7 @@ class DefaultVhalImplTest : public ::testing::Test { std::unique_ptr mPropStore; VehiclePropValuePool mValueObjectPool; android::ConcurrentQueue mEventQueue; + android::ConcurrentQueue mHeartBeatQueue; }; TEST_F(DefaultVhalImplTest, testListProperties) { @@ -724,4 +739,14 @@ TEST_F(DefaultVhalImplTest, testDebugGenFakeDataKeyPress) { EXPECT_EQ(2, events[1]->value.int32Values[2]); } +TEST_F(DefaultVhalImplTest, testHeartBeatEvent) { + // A heart beat would be sent every 3s, but let's wait for 6s to be sure at least 2 events have + // been generated (at 0s and 3s). + std::this_thread::sleep_for(std::chrono::milliseconds(6000)); + + auto events = mHeartBeatQueue.flush(); + ASSERT_GE(events.size(), (size_t)2); + ASSERT_EQ(toInt(VehicleProperty::VHAL_HEARTBEAT), events[0]->prop); +} + } // namespace -- GitLab From 656882ac79a1ae2545e8643c7b7b6d15430ea01f Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 20 Jul 2021 13:27:29 -0700 Subject: [PATCH 076/825] Add areaId check. According to types.hal, a non-global properties should have areaConfigs that define allowed areaIds. We need to check that the areaId is in the areaConfigs list before setting the value to prevent unexpected behavior. Test: unit test. Bug: 193831021 Change-Id: I90faf808aa6ac5278e99cf6313454515afaaca2f --- .../impl/vhal_v2_0/DefaultVehicleHal.cpp | 47 ++++++++++++------- .../impl/vhal_v2_0/DefaultVehicleHal.h | 3 +- .../vhal_v2_0/tests/DefaultVhalImpl_test.cpp | 25 ++++++++-- 3 files changed, 54 insertions(+), 21 deletions(-) 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 5b06c33aa5..1b37cbd6fd 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 @@ -35,6 +35,23 @@ namespace impl { namespace { constexpr std::chrono::nanoseconds kHeartBeatIntervalNs = 3s; + +const VehicleAreaConfig* getAreaConfig(const VehiclePropValue& propValue, + const VehiclePropConfig* config) { + if (isGlobalProp(propValue.prop)) { + if (config->areaConfigs.size() == 0) { + return nullptr; + } + return &(config->areaConfigs[0]); + } else { + for (auto& c : config->areaConfigs) { + if (c.areaId == propValue.areaId) { + return &c; + } + } + } + return nullptr; +} } // namespace DefaultVehicleHal::DefaultVehicleHal(VehiclePropertyStore* propStore, VehicleHalClient* client) @@ -184,24 +201,12 @@ StatusCode DefaultVehicleHal::checkVendorMixedPropValue(const VehiclePropValue& } StatusCode DefaultVehicleHal::checkValueRange(const VehiclePropValue& value, - const VehiclePropConfig* config) { + const VehicleAreaConfig* areaConfig) { + if (areaConfig == nullptr) { + return StatusCode::OK; + } int32_t property = value.prop; VehiclePropertyType type = getPropType(property); - const VehicleAreaConfig* areaConfig; - if (isGlobalProp(property)) { - if (config->areaConfigs.size() == 0) { - return StatusCode::OK; - } - areaConfig = &(config->areaConfigs[0]); - } else { - for (auto& c : config->areaConfigs) { - // areaId might contain multiple areas. - if (c.areaId & value.areaId) { - areaConfig = &c; - break; - } - } - } switch (type) { case VehiclePropertyType::INT32: if (areaConfig->minInt32Value == 0 && areaConfig->maxInt32Value == 0) { @@ -259,12 +264,20 @@ StatusCode DefaultVehicleHal::set(const VehiclePropValue& propValue) { ALOGW("no config for prop 0x%x", property); return StatusCode::INVALID_ARG; } + const VehicleAreaConfig* areaConfig = getAreaConfig(propValue, config); + if (!isGlobalProp(property) && areaConfig == nullptr) { + // Ignore areaId for global property. For non global property, check whether areaId is + // allowed. areaId must appear in areaConfig. + ALOGW("invalid area ID: 0x%x for prop 0x%x, not listed in config", propValue.areaId, + property); + return StatusCode::INVALID_ARG; + } auto status = checkPropValue(propValue, config); if (status != StatusCode::OK) { ALOGW("invalid property value: %s", toString(propValue).c_str()); return status; } - status = checkValueRange(propValue, config); + status = checkValueRange(propValue, areaConfig); if (status != StatusCode::OK) { ALOGW("property value out of range: %s", toString(propValue).c_str()); return status; diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h index ecdb9a84a0..af29143bc2 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h @@ -64,7 +64,8 @@ class DefaultVehicleHal : public VehicleHal { // Check whether a propValue is valid according to its type. StatusCode checkPropValue(const VehiclePropValue& propValue, const VehiclePropConfig* config); // Check whether the property value is within the range according to area config. - StatusCode checkValueRange(const VehiclePropValue& propValue, const VehiclePropConfig* config); + StatusCode checkValueRange(const VehiclePropValue& propValue, + const VehicleAreaConfig* areaConfig); // Register the heart beat event to be sent every 3s. This is required to inform watch dog that // VHAL is alive. Subclasses should always calls this function during onCreate. void registerHeartBeatEvent(); 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 bbefce733a..891d8d60e3 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 @@ -44,6 +44,7 @@ using ::android::hardware::automotive::vehicle::V2_0::VehiclePropValue; using ::android::hardware::automotive::vehicle::V2_0::VehiclePropValuePool; using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVehicleConnector; using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVehicleHal; +using ::android::hardware::automotive::vehicle::V2_0::impl::HVAC_ALL; using ::android::hardware::automotive::vehicle::V2_0::impl::HVAC_LEFT; using ::android::hardware::automotive::vehicle::V2_0::impl::kMixedTypePropertyForTest; @@ -366,6 +367,24 @@ TEST_F(DefaultVhalImplTest, testDump) { EXPECT_THAT(std::string(buf), HasSubstr(infoMake)); } +TEST_F(DefaultVhalImplTest, testSetPropInvalidAreaId) { + VehiclePropValue propNormal = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), + .areaId = HVAC_ALL, + .value.int32Values = {3}}; + StatusCode status = mHal->set(propNormal); + + EXPECT_EQ(StatusCode::OK, status); + + // HVAC_FAN_SPEED only have HVAC_ALL area config and is not allowed to set by LEFT/RIGHT. + VehiclePropValue propWrongId = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), + .areaId = HVAC_LEFT, + .value.int32Values = {3}}; + + status = mHal->set(propWrongId); + + EXPECT_EQ(StatusCode::INVALID_ARG, status); +} + class DefaultVhalImplSetInvalidPropTest : public DefaultVhalImplTest, public testing::WithParamInterface {}; @@ -463,19 +482,19 @@ class DefaultVhalImplSetPropRangeTest : public DefaultVhalImplTest, std::vector GenSetPropRangeParams() { std::vector tc; VehiclePropValue intPropNormal = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), - .areaId = HVAC_LEFT, + .areaId = HVAC_ALL, // min: 1, max: 7 .value.int32Values = {3}}; tc.push_back({"normal_case_int", intPropNormal, StatusCode::OK}); VehiclePropValue intPropSmall = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), - .areaId = HVAC_LEFT, + .areaId = HVAC_ALL, // min: 1, max: 7 .value.int32Values = {0}}; tc.push_back({"normal_case_int_too_small", intPropSmall, StatusCode::INVALID_ARG}); VehiclePropValue intPropLarge = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), - .areaId = HVAC_LEFT, + .areaId = HVAC_ALL, // min: 1, max: 7 .value.int32Values = {8}}; tc.push_back({"normal_case_int_too_large", intPropLarge, StatusCode::INVALID_ARG}); -- GitLab From 4a23901e50466d05ed7246e840f983bd4e9fc545 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 20 Jul 2021 18:12:53 -0700 Subject: [PATCH 077/825] Support vendor override in default VHAL. Move vendor override property logic from emulated VHAL to default VHAL. If system property "persist.vendor.vhal_init_value_override" is set, then we would try to parse JSON files in "/vendor/etc/vhaloverride/" and use the values there to override the default initial values. Test: unit test Bug: 193831021 Change-Id: I6823aab3de284d5b1d96186bc9f1325d868fd8d6 --- automotive/vehicle/2.0/default/Android.bp | 6 +- .../vehicle/2.0/default/VehicleService.cpp | 4 +- .../impl/vhal_v2_0/DefaultVehicleHal.cpp | 68 ++++++-- .../impl/vhal_v2_0/DefaultVehicleHal.h | 23 ++- .../vhal_v2_0/DefaultVehicleHalServer.cpp | 33 ++++ .../impl/vhal_v2_0/DefaultVehicleHalServer.h | 10 ++ .../default/impl/vhal_v2_0/tests/Android.bp | 5 + .../vhal_v2_0/tests/DefaultVhalImpl_test.cpp | 158 ++++++++++++++++-- .../tests/override/gear_selection.json | 9 + .../tests/override/hvac_temperature_set.json | 10 ++ .../default/impl/vhal_v2_0/tests/prop.json | 2 +- 11 files changed, 293 insertions(+), 35 deletions(-) create mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/override/gear_selection.json create mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/override/hvac_temperature_set.json diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp index 2e8ca66473..3be460c554 100644 --- a/automotive/vehicle/2.0/default/Android.bp +++ b/automotive/vehicle/2.0/default/Android.bp @@ -144,7 +144,6 @@ cc_library_static { ], whole_static_libs: [ "android.hardware.automotive.vehicle@2.0-server-common-lib", - "android.hardware.automotive.vehicle@2.0-user-hal-helper-lib", ], static_libs: [ "android.hardware.automotive.vehicle@2.0-libproto-native", @@ -213,7 +212,10 @@ cc_test { "android.hardware.automotive.vehicle@2.0-default-impl-lib", "android.hardware.automotive.vehicle@2.0-libproto-native", ], - data: [":vhal_test_json"], + data: [ + ":vhal_test_override_json", + ":vhal_test_json", + ], test_suites: ["general-tests"], } diff --git a/automotive/vehicle/2.0/default/VehicleService.cpp b/automotive/vehicle/2.0/default/VehicleService.cpp index ba2a60638a..fae6e43377 100644 --- a/automotive/vehicle/2.0/default/VehicleService.cpp +++ b/automotive/vehicle/2.0/default/VehicleService.cpp @@ -20,7 +20,6 @@ #include -#include #include #include #include @@ -32,8 +31,7 @@ using namespace android::hardware::automotive::vehicle::V2_0; int main(int /* argc */, char* /* argv */ []) { auto store = std::make_unique(); auto connector = std::make_unique(); - auto userHal = connector->getEmulatedUserHal(); - auto hal = std::make_unique(store.get(), connector.get(), userHal); + auto hal = std::make_unique(store.get(), connector.get()); auto emulator = connector->getEmulator(); auto service = std::make_unique(hal.get()); connector->setValuePool(hal->getValuePool()); 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 1b37cbd6fd..51ba6fd9c5 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 @@ -17,10 +17,13 @@ #include #include +#include #include #include #include +#include +#include "PropertyUtils.h" #include "VehicleUtils.h" #include "DefaultVehicleHal.h" @@ -52,8 +55,30 @@ const VehicleAreaConfig* getAreaConfig(const VehiclePropValue& propValue, } return nullptr; } + +VehicleHal::VehiclePropValuePtr addTimestamp(VehicleHal::VehiclePropValuePtr v) { + if (v.get()) { + v->timestamp = elapsedRealtimeNano(); + } + return v; +} + +bool isDebugProperty(int propId) { + return (propId == kGenerateFakeDataControllingProperty || + propId == kSetIntPropertyFromVehicleForTest || + propId == kSetFloatPropertyFromVehicleForTest || + propId == kSetBooleanPropertyFromVehicleForTest); +} } // namespace +VehicleHal::VehiclePropValuePtr DefaultVehicleHal::createVhalHeartBeatProp() { + VehicleHal::VehiclePropValuePtr v = getValuePool()->obtainInt64(uptimeMillis()); + v->prop = static_cast(VehicleProperty::VHAL_HEARTBEAT); + v->areaId = 0; + v->status = VehiclePropertyStatus::AVAILABLE; + return v; +} + DefaultVehicleHal::DefaultVehicleHal(VehiclePropertyStore* propStore, VehicleHalClient* client) : mPropStore(propStore), mRecurrentTimer(getTimerAction()), mVehicleClient(client) { initStaticConfig(); @@ -69,6 +94,7 @@ VehicleHal::VehiclePropValuePtr DefaultVehicleHal::get(const VehiclePropValue& r ALOGV("get(%d)", propId); VehiclePropValuePtr v = nullptr; + auto internalPropValue = mPropStore->readValueOrNull(requestedPropValue); if (internalPropValue != nullptr) { v = getValuePool()->obtain(*internalPropValue); @@ -81,10 +107,7 @@ VehicleHal::VehiclePropValuePtr DefaultVehicleHal::get(const VehiclePropValue& r } else { *outStatus = StatusCode::TRY_AGAIN; } - if (v.get()) { - v->timestamp = elapsedRealtimeNano(); - } - return v; + return addTimestamp(std::move(v)); } std::vector DefaultVehicleHal::listProperties() { @@ -258,6 +281,32 @@ StatusCode DefaultVehicleHal::set(const VehiclePropValue& propValue) { return StatusCode::INVALID_ARG; } + std::unordered_set powerProps(std::begin(kHvacPowerProperties), + std::end(kHvacPowerProperties)); + if (powerProps.count(propValue.prop)) { + auto hvacPowerOn = mPropStore->readValueOrNull( + toInt(VehicleProperty::HVAC_POWER_ON), + (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT | + VehicleAreaSeat::ROW_2_LEFT | VehicleAreaSeat::ROW_2_CENTER | + VehicleAreaSeat::ROW_2_RIGHT)); + + if (hvacPowerOn && hvacPowerOn->value.int32Values.size() == 1 && + hvacPowerOn->value.int32Values[0] == 0) { + return StatusCode::NOT_AVAILABLE; + } + } + + if (propValue.prop == 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. + return StatusCode::OK; + } + if (isDebugProperty(propValue.prop)) { + // These are special debug properties and do not need a config or check. + // TODO(shanyu): Remove this after we remove debug properties. + return mVehicleClient->setProperty(propValue, /*updateStatus=*/false); + } + int32_t property = propValue.prop; const VehiclePropConfig* config = mPropStore->getConfigOrNull(property); if (config == nullptr) { @@ -298,7 +347,7 @@ void DefaultVehicleHal::onCreate() { auto configs = mVehicleClient->getAllPropertyConfig(); for (const auto& cfg : configs) { - int32_t numAreas = isGlobalProp(cfg.prop) ? 0 : cfg.areaConfigs.size(); + int32_t numAreas = isGlobalProp(cfg.prop) ? 1 : cfg.areaConfigs.size(); for (int i = 0; i < numAreas; i++) { int32_t curArea = isGlobalProp(cfg.prop) ? 0 : cfg.areaConfigs[i].areaId; @@ -315,6 +364,7 @@ void DefaultVehicleHal::onCreate() { } mVehicleClient->triggerSendAllValues(); + registerHeartBeatEvent(); } @@ -344,14 +394,6 @@ VehicleHal::VehiclePropValuePtr DefaultVehicleHal::doInternalHealthCheck() { return v; } -VehicleHal::VehiclePropValuePtr DefaultVehicleHal::createVhalHeartBeatProp() { - VehicleHal::VehiclePropValuePtr v = getValuePool()->obtainInt64(uptimeMillis()); - v->prop = static_cast(VehicleProperty::VHAL_HEARTBEAT); - v->areaId = 0; - v->status = VehiclePropertyStatus::AVAILABLE; - return v; -} - void DefaultVehicleHal::onContinuousPropertyTimer(const std::vector& properties) { auto& pool = *getValuePool(); diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h index af29143bc2..027dc8559a 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h @@ -19,7 +19,7 @@ #include #include -#include "vhal_v2_0/VehiclePropertyStore.h" +#include #include "VehicleHalClient.h" @@ -55,10 +55,20 @@ class DefaultVehicleHal : public VehicleHal { VehiclePropertyStore* mPropStore; RecurrentTimer mRecurrentTimer; VehicleHalClient* mVehicleClient; - virtual bool isContinuousProperty(int32_t propId) const; - virtual void initStaticConfig(); - virtual void onContinuousPropertyTimer(const std::vector& properties); + + // The callback that would be called when a property value is updated. This function could + // be extended to handle specific property update event. virtual void onPropertyValue(const VehiclePropValue& value, bool updateStatus); + // Do an internal health check, vendor should add health check logic in this function. + virtual VehicleHal::VehiclePropValuePtr doInternalHealthCheck(); + + // The callback that would be called for every event generated by 'subscribe' or heartbeat. + // Properties contains a list of properties that need to be handled. + void onContinuousPropertyTimer(const std::vector& properties); + // Initiate config for all properties, would be called during onCreate(). + void initStaticConfig(); + // Whether the property is a continuous property. + bool isContinuousProperty(int32_t propId) const; // Returns a lambda that could be used in mRecurrentTimer. RecurrentTimer::Action getTimerAction(); // Check whether a propValue is valid according to its type. @@ -69,8 +79,7 @@ class DefaultVehicleHal : public VehicleHal { // Register the heart beat event to be sent every 3s. This is required to inform watch dog that // VHAL is alive. Subclasses should always calls this function during onCreate. void registerHeartBeatEvent(); - - VehicleHal::VehiclePropValuePtr doInternalHealthCheck(); + // Create a VHAL heart beat property. VehicleHal::VehiclePropValuePtr createVhalHeartBeatProp(); private: @@ -78,6 +87,8 @@ class DefaultVehicleHal : public VehicleHal { // See 'VehiclePropertyType' documentation in 'types.hal' for detail. StatusCode checkVendorMixedPropValue(const VehiclePropValue& value, const VehiclePropConfig* config); + // Read the override properties from a config file. + void getAllPropertiesOverride(); }; } // namespace impl diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp index f61a93b5bf..595a1d1eb1 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp @@ -17,11 +17,13 @@ #define LOG_TAG "DefaultVehicleHalServer" #include +#include #include #include #include #include +#include #include #include "DefaultConfig.h" @@ -38,6 +40,10 @@ namespace V2_0 { namespace impl { +namespace { +const char* VENDOR_OVERRIDE_DIR = "/vendor/etc/vhaloverride/"; +} // namespace + void DefaultVehicleHalServer::storePropInitialValue(const ConfigDeclaration& config) { VehiclePropConfig cfg = config.config; @@ -74,6 +80,7 @@ DefaultVehicleHalServer::DefaultVehicleHalServer() { mServerSidePropStore.registerProperty(cfg); storePropInitialValue(it); } + maybeOverrideProperties(VENDOR_OVERRIDE_DIR); } void DefaultVehicleHalServer::sendAllValuesToClient() { @@ -559,6 +566,32 @@ IVehicleServer::DumpResult DefaultVehicleHalServer::genFakeData( return result; } +void DefaultVehicleHalServer::maybeOverrideProperties(const char* overrideDir) { + if (android::base::GetBoolProperty("persist.vendor.vhal_init_value_override", false)) { + overrideProperties(overrideDir); + } +} + +void DefaultVehicleHalServer::overrideProperties(const char* overrideDir) { + LOG(INFO) << "loading vendor override properties from " << overrideDir; + if (auto dir = opendir(overrideDir)) { + std::regex reg_json(".*[.]json", std::regex::icase); + while (auto f = readdir(dir)) { + if (!regex_match(f->d_name, reg_json)) { + continue; + } + std::string file = overrideDir + std::string(f->d_name); + JsonFakeValueGenerator tmpGenerator(file); + + std::vector propValues = tmpGenerator.getAllEvents(); + for (const VehiclePropValue& prop : propValues) { + mServerSidePropStore.writeValue(prop, true); + } + } + closedir(dir); + } +} + } // namespace impl } // namespace V2_0 diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h index aa6cf0bf49..5858325758 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h @@ -72,6 +72,10 @@ class DefaultVehicleHalServer : public IVehicleServer { std::string getHelpInfo(); DumpResult genFakeData(const std::vector& options); + // If "persist.vendor.vhal_init_value_override" is true, try to override the properties default + // values according to JSON files in 'overrideDir'. Would be called in constructor using + // VENDOR_OVERRIDE_DIR as overrideDir. + void maybeOverrideProperties(const char* overrideDir); protected: GeneratorHub mGeneratorHub{ @@ -79,6 +83,12 @@ class DefaultVehicleHalServer : public IVehicleServer { VehiclePropValuePool* mValuePool{nullptr}; VehiclePropertyStore mServerSidePropStore; + + private: + // Expose protected methods to unit test. + friend class DefaultVhalImplTestHelper; + // Override the properties using config files in 'overrideDir'. + void overrideProperties(const char* overrideDir); }; } // namespace impl diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/Android.bp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/Android.bp index 576222380e..a7d5440b39 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/Android.bp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/Android.bp @@ -16,3 +16,8 @@ filegroup { name: "vhal_test_json", srcs: ["prop.json"], } + +filegroup { + name: "vhal_test_override_json", + srcs: ["override/*"], +} 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 891d8d60e3..4fb74f6660 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 @@ -27,6 +27,32 @@ #include #include +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace V2_0 { +namespace impl { + +class DefaultVhalImplTestHelper { + public: + DefaultVhalImplTestHelper(DefaultVehicleHalServer* server) { mServer = server; } + + void overrideProperties(const char* overrideDir) { + mServer->overrideProperties(overrideDir); + } + + private: + DefaultVehicleHalServer* mServer; +}; + +} // namespace impl +} // namespace V2_0 +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + namespace { using ::android::hardware::hidl_handle; @@ -44,9 +70,15 @@ using ::android::hardware::automotive::vehicle::V2_0::VehiclePropValue; using ::android::hardware::automotive::vehicle::V2_0::VehiclePropValuePool; using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVehicleConnector; using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVehicleHal; +using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVhalImplTestHelper; using ::android::hardware::automotive::vehicle::V2_0::impl::HVAC_ALL; using ::android::hardware::automotive::vehicle::V2_0::impl::HVAC_LEFT; +using ::android::hardware::automotive::vehicle::V2_0::impl::HVAC_RIGHT; using ::android::hardware::automotive::vehicle::V2_0::impl::kMixedTypePropertyForTest; +using ::android::hardware::automotive::vehicle::V2_0::impl::OBD2_FREEZE_FRAME; +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 ::testing::HasSubstr; @@ -72,12 +104,24 @@ class DefaultVhalImplTest : public ::testing::Test { mConnector.reset(new DefaultVehicleConnector); mConnector->setValuePool(&mValueObjectPool); mHal.reset(new DefaultVehicleHal(mPropStore.get(), mConnector.get())); + initHal(); + } + + void initHal() { mHal->init(&mValueObjectPool, std::bind(&DefaultVhalImplTest::onHalEvent, this, std::placeholders::_1), std::bind(&DefaultVhalImplTest::onHalPropertySetError, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); } + protected: + std::unique_ptr mHal; + std::unique_ptr mConnector; + std::unique_ptr mPropStore; + VehiclePropValuePool mValueObjectPool; + android::ConcurrentQueue mEventQueue; + android::ConcurrentQueue mHeartBeatQueue; + private: void onHalEvent(VehiclePropValuePtr v) { if (v->prop != toInt(VehicleProperty::VHAL_HEARTBEAT)) { @@ -90,14 +134,6 @@ class DefaultVhalImplTest : public ::testing::Test { void onHalPropertySetError(StatusCode /*errorCode*/, int32_t /*property*/, int32_t /*areaId*/) { } - - protected: - std::unique_ptr mHal; - std::unique_ptr mConnector; - std::unique_ptr mPropStore; - VehiclePropValuePool mValueObjectPool; - android::ConcurrentQueue mEventQueue; - android::ConcurrentQueue mHeartBeatQueue; }; TEST_F(DefaultVhalImplTest, testListProperties) { @@ -721,12 +757,12 @@ TEST_F(DefaultVhalImplTest, testDebugGenFakeDataJson) { EXPECT_EQ((size_t)1, events[0]->value.int32Values.size()); EXPECT_EQ(8, events[0]->value.int32Values[0]); EXPECT_EQ((size_t)1, events[3]->value.int32Values.size()); - EXPECT_EQ(4, events[3]->value.int32Values[0]); + EXPECT_EQ(10, events[3]->value.int32Values[0]); // Second set of the same events. EXPECT_EQ((size_t)1, events[4]->value.int32Values.size()); EXPECT_EQ(8, events[4]->value.int32Values[0]); EXPECT_EQ((size_t)1, events[7]->value.int32Values.size()); - EXPECT_EQ(4, events[7]->value.int32Values[0]); + EXPECT_EQ(10, events[7]->value.int32Values[0]); } TEST_F(DefaultVhalImplTest, testDebugGenFakeDataKeyPress) { @@ -768,4 +804,106 @@ TEST_F(DefaultVhalImplTest, testHeartBeatEvent) { ASSERT_EQ(toInt(VehicleProperty::VHAL_HEARTBEAT), events[0]->prop); } +TEST_F(DefaultVhalImplTest, testVendorOverrideProperties) { + // Destroy the existing VHAL first to prevent it using destroyed connector or propstore. + mHal.reset(); + // Create a new Default VHAL and reinitialize it to load the override properties. + std::string overrideDir = android::base::GetExecutableDirectory() + "/override/"; + mPropStore.reset(new VehiclePropertyStore); + mConnector.reset(new DefaultVehicleConnector); + mConnector->setValuePool(&mValueObjectPool); + mHal.reset(new DefaultVehicleHal(mPropStore.get(), mConnector.get())); + // Set vendor override directory. + DefaultVhalImplTestHelper helper(mConnector.get()); + helper.overrideProperties(overrideDir.c_str()); + + initHal(); + + VehiclePropValue value; + StatusCode status; + // This is the same as the prop in 'gear_selection.json'. + value.prop = toInt(VehicleProperty::GEAR_SELECTION); + + auto gotValue = mHal->get(value, &status); + + ASSERT_EQ(StatusCode::OK, status); + ASSERT_EQ((size_t)1, gotValue->value.int32Values.size()); + ASSERT_EQ(8, gotValue->value.int32Values[0]); + + // If we set the value, it should update despite the override. + value.prop = toInt(VehicleProperty::GEAR_SELECTION); + value.value.int32Values.resize(1); + value.value.int32Values[0] = 5; + + status = mHal->set(value); + ASSERT_EQ(StatusCode::OK, status); + + gotValue = mHal->get(value, &status); + ASSERT_EQ(StatusCode::OK, status); + ASSERT_EQ((size_t)1, gotValue->value.int32Values.size()); + ASSERT_EQ(5, gotValue->value.int32Values[0]); +} + +TEST_F(DefaultVhalImplTest, testVendorOverridePropertiesMultipleAreas) { + // Destroy the existing VHAL first to prevent it using destroyed connector or propstore. + mHal.reset(); + // Create a new Default VHAL and reinitialize it to load the override properties. + std::string overrideDir = android::base::GetExecutableDirectory() + "/override/"; + mPropStore.reset(new VehiclePropertyStore); + mConnector.reset(new DefaultVehicleConnector); + mConnector->setValuePool(&mValueObjectPool); + mHal.reset(new DefaultVehicleHal(mPropStore.get(), mConnector.get())); + // Set vendor override directory. + DefaultVhalImplTestHelper helper(mConnector.get()); + helper.overrideProperties(overrideDir.c_str()); + + initHal(); + + VehiclePropValue value; + StatusCode status; + // This is the same as the prop in 'hvac_temperature_set.json'. + value.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET); + value.areaId = HVAC_LEFT; + + auto gotValue = mHal->get(value, &status); + + ASSERT_EQ(StatusCode::OK, status); + ASSERT_EQ((size_t)1, gotValue->value.floatValues.size()); + ASSERT_EQ(30.0f, gotValue->value.floatValues[0]); + + // HVAC_RIGHT should not be affected and return the default value. + value.areaId = HVAC_RIGHT; + + gotValue = mHal->get(value, &status); + + ASSERT_EQ(StatusCode::OK, status); + ASSERT_EQ((size_t)1, gotValue->value.floatValues.size()); + ASSERT_EQ(20.0f, gotValue->value.floatValues[0]); +} + +TEST_F(DefaultVhalImplTest, testVendorOverridePropertiesDirDoesNotExist) { + // Destroy the existing VHAL first to prevent it using destroyed connector or propstore. + mHal.reset(); + // Create a new Default VHAL and reinitialize it to load the override properties. + mPropStore.reset(new VehiclePropertyStore); + mConnector.reset(new DefaultVehicleConnector); + mConnector->setValuePool(&mValueObjectPool); + mHal.reset(new DefaultVehicleHal(mPropStore.get(), mConnector.get())); + // Set vendor override directory to a non-existing dir + DefaultVhalImplTestHelper helper(mConnector.get()); + helper.overrideProperties("123"); + initHal(); + + VehiclePropValue value; + StatusCode status; + value.prop = toInt(VehicleProperty::GEAR_SELECTION); + + auto gotValue = mHal->get(value, &status); + + // We should get the default value. + ASSERT_EQ(StatusCode::OK, status); + ASSERT_EQ((size_t)1, gotValue->value.int32Values.size()); + ASSERT_EQ(4, gotValue->value.int32Values[0]); +} + } // namespace diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/override/gear_selection.json b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/override/gear_selection.json new file mode 100644 index 0000000000..59666b8046 --- /dev/null +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/override/gear_selection.json @@ -0,0 +1,9 @@ +[ + { + "timestamp": 1000000, + "areaId": 0, + "value": 8, + // GEAR_SELECTION + "prop": 289408000 + } +] diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/override/hvac_temperature_set.json b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/override/hvac_temperature_set.json new file mode 100644 index 0000000000..93a97ed095 --- /dev/null +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/override/hvac_temperature_set.json @@ -0,0 +1,10 @@ +[ + { + "timestamp": 1000000, + // HVAC_LEFT + "areaId": 49, + "value": 30, + // HVAC_TEMPERATURE_SET + "prop": 358614275 + } +] diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/prop.json b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/prop.json index 2e77a44094..b881109237 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/prop.json +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/prop.json @@ -20,7 +20,7 @@ { "timestamp": 4000000, "areaId": 0, - "value": 4, + "value": 10, "prop": 289408000 } ] -- GitLab From 122eea67d3e4a10a125d8d8cc3d6157ceab4bdb6 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 20 Jul 2021 18:22:23 -0700 Subject: [PATCH 078/825] Add fake OBD2 frame logic to default VHAL. Test: unit test Bug: 193831021 Change-Id: Ie26cf0c5468984781bd6d7a0bf7edc2e0b2426e3 --- automotive/vehicle/2.0/default/Android.bp | 2 + .../impl/vhal_v2_0/DefaultVehicleHal.cpp | 40 +++- .../vhal_v2_0/DefaultVehicleHalServer.cpp | 5 + .../default/impl/vhal_v2_0/FakeObd2Frame.cpp | 184 ++++++++++++++++++ .../default/impl/vhal_v2_0/FakeObd2Frame.h | 48 +++++ .../vhal_v2_0/tests/DefaultVhalImpl_test.cpp | 141 ++++++++++++++ 6 files changed, 419 insertions(+), 1 deletion(-) create mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/FakeObd2Frame.cpp create mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/FakeObd2Frame.h diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp index 3be460c554..8bf6bbea87 100644 --- a/automotive/vehicle/2.0/default/Android.bp +++ b/automotive/vehicle/2.0/default/Android.bp @@ -92,6 +92,7 @@ cc_library_static { "impl/vhal_v2_0/LinearFakeValueGenerator.cpp", "impl/vhal_v2_0/JsonFakeValueGenerator.cpp", "impl/vhal_v2_0/GeneratorHub.cpp", + "impl/vhal_v2_0/FakeObd2Frame.cpp", ], local_include_dirs: ["common/include/vhal_v2_0"], export_include_dirs: ["impl"], @@ -141,6 +142,7 @@ cc_library_static { "impl/vhal_v2_0/JsonFakeValueGenerator.cpp", "impl/vhal_v2_0/LinearFakeValueGenerator.cpp", "impl/vhal_v2_0/DefaultVehicleHalServer.cpp", + "impl/vhal_v2_0/FakeObd2Frame.cpp", ], whole_static_libs: [ "android.hardware.automotive.vehicle@2.0-server-common-lib", 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 51ba6fd9c5..74337b8b00 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 @@ -23,6 +23,7 @@ #include #include +#include "FakeObd2Frame.h" #include "PropertyUtils.h" #include "VehicleUtils.h" @@ -94,6 +95,17 @@ VehicleHal::VehiclePropValuePtr DefaultVehicleHal::get(const VehiclePropValue& r ALOGV("get(%d)", propId); VehiclePropValuePtr v = nullptr; + if (propId == OBD2_FREEZE_FRAME) { + v = getValuePool()->obtainComplex(); + *outStatus = fillObd2FreezeFrame(mPropStore, requestedPropValue, v.get()); + return addTimestamp(std::move(v)); + } + + if (propId == OBD2_FREEZE_FRAME_INFO) { + v = getValuePool()->obtainComplex(); + *outStatus = fillObd2DtcInfo(mPropStore, v.get()); + return addTimestamp(std::move(v)); + } auto internalPropValue = mPropStore->readValueOrNull(requestedPropValue); if (internalPropValue != nullptr) { @@ -296,6 +308,9 @@ StatusCode DefaultVehicleHal::set(const VehiclePropValue& propValue) { } } + if (propValue.prop == OBD2_FREEZE_FRAME_CLEAR) { + return clearObd2FreezeFrames(mPropStore, propValue); + } if (propValue.prop == 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. @@ -347,6 +362,12 @@ void DefaultVehicleHal::onCreate() { auto configs = mVehicleClient->getAllPropertyConfig(); for (const auto& cfg : configs) { + if (isDiagnosticProperty(cfg)) { + // do not write an initial empty value for the diagnostic properties + // as we will initialize those separately. + continue; + } + int32_t numAreas = isGlobalProp(cfg.prop) ? 1 : cfg.areaConfigs.size(); for (int i = 0; i < numAreas; i++) { @@ -365,6 +386,9 @@ void DefaultVehicleHal::onCreate() { mVehicleClient->triggerSendAllValues(); + initObd2LiveFrame(mPropStore, *mPropStore->getConfigOrDie(OBD2_LIVE_FRAME)); + initObd2FreezeFrame(mPropStore, *mPropStore->getConfigOrDie(OBD2_FREEZE_FRAME)); + registerHeartBeatEvent(); } @@ -474,7 +498,21 @@ void DefaultVehicleHal::onPropertyValue(const VehiclePropValue& value, bool upda void DefaultVehicleHal::initStaticConfig() { auto configs = mVehicleClient->getAllPropertyConfig(); for (auto&& cfg : configs) { - mPropStore->registerProperty(cfg, nullptr); + VehiclePropertyStore::TokenFunction tokenFunction = nullptr; + + switch (cfg.prop) { + case OBD2_FREEZE_FRAME: { + // We use timestamp as token for OBD2_FREEZE_FRAME + tokenFunction = [](const VehiclePropValue& propValue) { + return propValue.timestamp; + }; + break; + } + default: + break; + } + + mPropStore->registerProperty(cfg, tokenFunction); } } diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp index 595a1d1eb1..0aaa4c1fc6 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp @@ -27,6 +27,7 @@ #include #include "DefaultConfig.h" +#include "FakeObd2Frame.h" #include "JsonFakeValueGenerator.h" #include "LinearFakeValueGenerator.h" @@ -78,6 +79,10 @@ DefaultVehicleHalServer::DefaultVehicleHalServer() { for (auto& it : kVehicleProperties) { VehiclePropConfig cfg = it.config; mServerSidePropStore.registerProperty(cfg); + // Skip diagnostic properties since there is special logic to handle those. + if (isDiagnosticProperty(cfg)) { + continue; + } storePropInitialValue(it); } maybeOverrideProperties(VENDOR_OVERRIDE_DIR); diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/FakeObd2Frame.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/FakeObd2Frame.cpp new file mode 100644 index 0000000000..d95584d2ee --- /dev/null +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/FakeObd2Frame.cpp @@ -0,0 +1,184 @@ +/* + * 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 +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace V2_0 { + +namespace impl { + +namespace { + +std::unique_ptr fillDefaultObd2Frame(size_t numVendorIntegerSensors, + size_t numVendorFloatSensors) { + std::unique_ptr sensorStore( + new Obd2SensorStore(numVendorIntegerSensors, numVendorFloatSensors)); + + sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::FUEL_SYSTEM_STATUS, + toInt(Obd2FuelSystemStatus::CLOSED_LOOP)); + sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::MALFUNCTION_INDICATOR_LIGHT_ON, 0); + sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::IGNITION_MONITORS_SUPPORTED, + toInt(Obd2IgnitionMonitorKind::SPARK)); + sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::IGNITION_SPECIFIC_MONITORS, + Obd2CommonIgnitionMonitors::COMPONENTS_AVAILABLE | + Obd2CommonIgnitionMonitors::MISFIRE_AVAILABLE | + Obd2SparkIgnitionMonitors::AC_REFRIGERANT_AVAILABLE | + Obd2SparkIgnitionMonitors::EVAPORATIVE_SYSTEM_AVAILABLE); + sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::INTAKE_AIR_TEMPERATURE, 35); + sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::COMMANDED_SECONDARY_AIR_STATUS, + toInt(Obd2SecondaryAirStatus::FROM_OUTSIDE_OR_OFF)); + sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::NUM_OXYGEN_SENSORS_PRESENT, 1); + sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::RUNTIME_SINCE_ENGINE_START, 500); + sensorStore->setIntegerSensor( + DiagnosticIntegerSensorIndex::DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON, 0); + sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::WARMUPS_SINCE_CODES_CLEARED, 51); + sensorStore->setIntegerSensor( + DiagnosticIntegerSensorIndex::DISTANCE_TRAVELED_SINCE_CODES_CLEARED, 365); + sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE, 30); + sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::CONTROL_MODULE_VOLTAGE, 12); + sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::AMBIENT_AIR_TEMPERATURE, 18); + sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::MAX_FUEL_AIR_EQUIVALENCE_RATIO, 1); + sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::FUEL_TYPE, + toInt(Obd2FuelType::GASOLINE)); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::CALCULATED_ENGINE_LOAD, 0.153); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK1, -0.16); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK1, -0.16); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK2, -0.16); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK2, -0.16); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::INTAKE_MANIFOLD_ABSOLUTE_PRESSURE, 7.5); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::ENGINE_RPM, 1250.); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::VEHICLE_SPEED, 40.); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::TIMING_ADVANCE, 2.5); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::THROTTLE_POSITION, 19.75); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::OXYGEN_SENSOR1_VOLTAGE, 0.265); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::FUEL_TANK_LEVEL_INPUT, 0.824); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::EVAPORATION_SYSTEM_VAPOR_PRESSURE, + -0.373); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::CATALYST_TEMPERATURE_BANK1_SENSOR1, + 190.); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::RELATIVE_THROTTLE_POSITION, 3.); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::ABSOLUTE_THROTTLE_POSITION_B, 0.306); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::ACCELERATOR_PEDAL_POSITION_D, 0.188); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::ACCELERATOR_PEDAL_POSITION_E, 0.094); + sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::COMMANDED_THROTTLE_ACTUATOR, 0.024); + + return sensorStore; +} + +} // namespace + +void initObd2LiveFrame(VehiclePropertyStore* propStore, const VehiclePropConfig& propConfig) { + auto liveObd2Frame = createVehiclePropValue(VehiclePropertyType::MIXED, 0); + auto sensorStore = fillDefaultObd2Frame(static_cast(propConfig.configArray[0]), + static_cast(propConfig.configArray[1])); + sensorStore->fillPropValue("", liveObd2Frame.get()); + liveObd2Frame->prop = OBD2_LIVE_FRAME; + + propStore->writeValue(*liveObd2Frame, true); +} + +void initObd2FreezeFrame(VehiclePropertyStore* propStore, const VehiclePropConfig& propConfig) { + auto sensorStore = fillDefaultObd2Frame(static_cast(propConfig.configArray[0]), + static_cast(propConfig.configArray[1])); + + static std::vector sampleDtcs = {"P0070", "P0102", "P0123"}; + for (auto&& dtc : sampleDtcs) { + auto freezeFrame = createVehiclePropValue(VehiclePropertyType::MIXED, 0); + sensorStore->fillPropValue(dtc, freezeFrame.get()); + freezeFrame->prop = OBD2_FREEZE_FRAME; + ALOGE("freeze frame: %lld", (long long)freezeFrame->timestamp); + + propStore->writeValue(*freezeFrame, true); + } +} + +StatusCode fillObd2FreezeFrame(VehiclePropertyStore* propStore, + const VehiclePropValue& requestedPropValue, + VehiclePropValue* outValue) { + if (requestedPropValue.value.int64Values.size() != 1) { + ALOGE("asked for OBD2_FREEZE_FRAME without valid timestamp"); + return StatusCode::INVALID_ARG; + } + if (propStore->readValuesForProperty(OBD2_FREEZE_FRAME).size() == 0) { + // Should no freeze frame be available at the given timestamp, a response of NOT_AVAILABLE + // must be returned by the implementation + return StatusCode::NOT_AVAILABLE; + } + auto timestamp = requestedPropValue.value.int64Values[0]; + auto freezeFrame = propStore->readValueOrNull(OBD2_FREEZE_FRAME, 0, timestamp); + if (freezeFrame == nullptr) { + ALOGE("asked for OBD2_FREEZE_FRAME at invalid timestamp"); + return StatusCode::INVALID_ARG; + } + outValue->prop = OBD2_FREEZE_FRAME; + outValue->value.int32Values = freezeFrame->value.int32Values; + outValue->value.floatValues = freezeFrame->value.floatValues; + outValue->value.bytes = freezeFrame->value.bytes; + outValue->value.stringValue = freezeFrame->value.stringValue; + outValue->timestamp = freezeFrame->timestamp; + return StatusCode::OK; +} + +StatusCode fillObd2DtcInfo(VehiclePropertyStore* propStore, VehiclePropValue* outValue) { + std::vector timestamps; + for (const auto& freezeFrame : propStore->readValuesForProperty(OBD2_FREEZE_FRAME)) { + timestamps.push_back(freezeFrame.timestamp); + } + outValue->value.int64Values = timestamps; + outValue->prop = OBD2_FREEZE_FRAME_INFO; + return StatusCode::OK; +} + +StatusCode clearObd2FreezeFrames(VehiclePropertyStore* propStore, + const VehiclePropValue& propValue) { + if (propValue.value.int64Values.size() == 0) { + propStore->removeValuesForProperty(OBD2_FREEZE_FRAME); + return StatusCode::OK; + } else { + for (int64_t timestamp : propValue.value.int64Values) { + auto freezeFrame = propStore->readValueOrNull(OBD2_FREEZE_FRAME, 0, timestamp); + if (freezeFrame == nullptr) { + ALOGE("asked for OBD2_FREEZE_FRAME at invalid timestamp"); + return StatusCode::INVALID_ARG; + } + propStore->removeValue(*freezeFrame); + } + } + return StatusCode::OK; +} + +bool isDiagnosticProperty(const VehiclePropConfig& propConfig) { + return (propConfig.prop == OBD2_LIVE_FRAME || propConfig.prop == OBD2_FREEZE_FRAME || + propConfig.prop == OBD2_FREEZE_FRAME_CLEAR || + propConfig.prop == OBD2_FREEZE_FRAME_INFO); +} + +} // namespace impl + +} // namespace V2_0 +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/FakeObd2Frame.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/FakeObd2Frame.h new file mode 100644 index 0000000000..704964ca5e --- /dev/null +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/FakeObd2Frame.h @@ -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. + */ +#ifndef android_hardware_automotive_vehicle_V2_0_impl_FakeObd2Frame_H_ +#define android_hardware_automotive_vehicle_V2_0_impl_FakeObd2Frame_H_ + +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace V2_0 { + +namespace impl { + +void initObd2LiveFrame(VehiclePropertyStore* propStore, const VehiclePropConfig& propConfig); +void initObd2FreezeFrame(VehiclePropertyStore* propStore, const VehiclePropConfig& propConfig); +StatusCode fillObd2FreezeFrame(VehiclePropertyStore* propStore, + const VehiclePropValue& requestedPropValue, + VehiclePropValue* outValue); +StatusCode fillObd2DtcInfo(VehiclePropertyStore* propStore, VehiclePropValue* outValue); +StatusCode clearObd2FreezeFrames(VehiclePropertyStore* propStore, + const VehiclePropValue& propValue); +bool isDiagnosticProperty(const VehiclePropConfig& propConfig); + +} // namespace impl + +} // namespace V2_0 +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_V2_0_impl_FakeObd2Frame_H_ 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 4fb74f6660..27c1f4d45f 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 @@ -906,4 +906,145 @@ TEST_F(DefaultVhalImplTest, testVendorOverridePropertiesDirDoesNotExist) { ASSERT_EQ(4, gotValue->value.int32Values[0]); } +TEST_F(DefaultVhalImplTest, testGetObd2FreezeFrameNoTimestamp) { + VehiclePropValue value; + value.prop = OBD2_FREEZE_FRAME; + StatusCode status; + + auto gotValue = mHal->get(value, &status); + + ASSERT_EQ(StatusCode::INVALID_ARG, status); +} + +TEST_F(DefaultVhalImplTest, testGetObd2FreezeFrameInvalidTimestamp) { + VehiclePropValue value; + value.prop = OBD2_FREEZE_FRAME; + value.value.int64Values.resize(1); + value.value.int64Values[0] = 0; + StatusCode status; + + auto gotValue = mHal->get(value, &status); + + ASSERT_EQ(StatusCode::INVALID_ARG, status); +} + +TEST_F(DefaultVhalImplTest, testGetObd2FreezeFrameInfoGetObd2FreezeFrame) { + VehiclePropValue value; + value.prop = OBD2_FREEZE_FRAME_INFO; + StatusCode status; + + auto gotValue = mHal->get(value, &status); + + ASSERT_EQ(StatusCode::OK, status); + ASSERT_EQ((size_t)3, gotValue->value.int64Values.size()); + + std::vector dtcs; + std::vector sampleDtcs = {"P0070", "P0102", "P0123"}; + for (int64_t timestamp : gotValue->value.int64Values) { + VehiclePropValue freezeFrameRequest; + freezeFrameRequest.prop = OBD2_FREEZE_FRAME; + freezeFrameRequest.value.int64Values.resize(1); + freezeFrameRequest.value.int64Values[0] = timestamp; + + auto freezeFrameValue = mHal->get(freezeFrameRequest, &status); + + ASSERT_EQ(StatusCode::OK, status); + // Obd2IntegerSensorIndex.LAST_SYSTEM_INDEX + 1 + EXPECT_EQ((size_t)32, freezeFrameValue->value.int32Values.size()); + // Obd2FloatSensorIndex.LAST_SYSTEM_INDEX + 1 + EXPECT_EQ((size_t)71, freezeFrameValue->value.floatValues.size()); + // (intValues.size() + floatValues.size()) / 8 + EXPECT_EQ((size_t)13, freezeFrameValue->value.bytes.size()); + + dtcs.push_back(freezeFrameValue->value.stringValue); + } + + for (std::string expectDtc : sampleDtcs) { + EXPECT_NE(std::find(dtcs.begin(), dtcs.end(), expectDtc), dtcs.end()); + } +} + +TEST_F(DefaultVhalImplTest, testGetObd2LiveFrame) { + VehiclePropValue value; + value.prop = OBD2_LIVE_FRAME; + StatusCode status; + + auto gotValue = mHal->get(value, &status); + + ASSERT_EQ(StatusCode::OK, status); + // Obd2IntegerSensorIndex.LAST_SYSTEM_INDEX + 1 + EXPECT_EQ((size_t)32, gotValue->value.int32Values.size()); + // Obd2FloatSensorIndex.LAST_SYSTEM_INDEX + 1 + EXPECT_EQ((size_t)71, gotValue->value.floatValues.size()); + // (intValues.size() + floatValues.size()) / 8 + EXPECT_EQ((size_t)13, gotValue->value.bytes.size()); +} + +TEST_F(DefaultVhalImplTest, testClearObd2FreezeFrameAll) { + VehiclePropValue value; + value.prop = OBD2_FREEZE_FRAME_CLEAR; + // No int64Values is to clear all frames. + + auto status = mHal->set(value); + + EXPECT_EQ(StatusCode::OK, status); + + VehiclePropValue freezeFrameRequest; + freezeFrameRequest.prop = OBD2_FREEZE_FRAME; + freezeFrameRequest.value.int64Values.resize(1); + + auto gotValue = mHal->get(freezeFrameRequest, &status); + + EXPECT_EQ(StatusCode::NOT_AVAILABLE, status); + + VehiclePropValue freezeFrameInfoRequest; + freezeFrameInfoRequest.prop = OBD2_FREEZE_FRAME_INFO; + + gotValue = mHal->get(freezeFrameInfoRequest, &status); + + EXPECT_EQ(StatusCode::OK, status); + EXPECT_EQ((size_t)0, gotValue->value.int64Values.size()); +} + +TEST_F(DefaultVhalImplTest, testClearObd2FreezeFrameOneFrame) { + // Get existing freeze frame info first. + VehiclePropValue frameInfoRequest; + frameInfoRequest.prop = OBD2_FREEZE_FRAME_INFO; + StatusCode status; + auto gotValue = mHal->get(frameInfoRequest, &status); + ASSERT_EQ(StatusCode::OK, status); + ASSERT_EQ((size_t)3, gotValue->value.int64Values.size()); + + VehiclePropValue clearRequest; + int64_t timestamp = gotValue->value.int64Values[0]; + clearRequest.prop = OBD2_FREEZE_FRAME_CLEAR; + clearRequest.value.int64Values.resize(1); + clearRequest.value.int64Values[0] = timestamp; + + // Try to clear the first frame. + status = mHal->set(clearRequest); + + // Get freeze frame info again. + gotValue = mHal->get(frameInfoRequest, &status); + + ASSERT_EQ(StatusCode::OK, status); + // Now we should only have 2 frames. + ASSERT_EQ((size_t)2, gotValue->value.int64Values.size()); + + // Try to get the deleted frame, should fail. + VehiclePropValue frameRequest; + frameRequest.prop = OBD2_FREEZE_FRAME; + frameRequest.value.int64Values.resize(1); + frameRequest.value.int64Values[0] = timestamp; + + gotValue = mHal->get(frameRequest, &status); + + ASSERT_EQ(StatusCode::INVALID_ARG, status); + + // Clear the same frame again should fail. + status = mHal->set(clearRequest); + + ASSERT_EQ(StatusCode::INVALID_ARG, status); +} + } // namespace -- GitLab From 56020bc1c7be8cc6d87e68b65eb0c5cb509c7c26 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 16 Jul 2021 15:51:16 -0700 Subject: [PATCH 079/825] Move emulatedUserHal to default VHAL. Test: Run on emulator. Verify user hal logic works. unit test. Bug: 193831021 Change-Id: I9b91205ac11837f31950018f2de12542df85e202 --- automotive/vehicle/2.0/default/Android.bp | 3 +- .../impl/vhal_v2_0/DefaultVehicleHal.cpp | 78 ++++ .../impl/vhal_v2_0/DefaultVehicleHal.h | 7 + .../vhal_v2_0/tests/DefaultVhalImpl_test.cpp | 216 +++++++++++ .../default/impl/vhal_v2_0/userhal/Android.bp | 31 ++ .../vhal_v2_0/userhal/EmulatedUserHal.cpp | 353 ++++++++++++++++++ .../userhal/include/EmulatedUserHal.h | 152 ++++++++ 7 files changed, 839 insertions(+), 1 deletion(-) create mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/Android.bp create mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/EmulatedUserHal.cpp create mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/include/EmulatedUserHal.h diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp index 8bf6bbea87..2c3422e82d 100644 --- a/automotive/vehicle/2.0/default/Android.bp +++ b/automotive/vehicle/2.0/default/Android.bp @@ -97,6 +97,7 @@ cc_library_static { local_include_dirs: ["common/include/vhal_v2_0"], export_include_dirs: ["impl"], whole_static_libs: [ + "android.hardware.automotive.vehicle@2.0-emulated-user-hal-lib", "android.hardware.automotive.vehicle@2.0-manager-lib", ], shared_libs: [ @@ -215,8 +216,8 @@ cc_test { "android.hardware.automotive.vehicle@2.0-libproto-native", ], data: [ - ":vhal_test_override_json", ":vhal_test_json", + ":vhal_test_override_json", ], test_suites: ["general-tests"], } 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 74337b8b00..25a698b9fc 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 @@ -89,11 +89,38 @@ DefaultVehicleHal::DefaultVehicleHal(VehiclePropertyStore* propStore, VehicleHal }); } +VehicleHal::VehiclePropValuePtr DefaultVehicleHal::getUserHalProp( + const VehiclePropValue& requestedPropValue, StatusCode* outStatus) { + auto propId = requestedPropValue.prop; + ALOGI("get(): getting value for prop %d from User HAL", propId); + const auto& ret = mEmulatedUserHal.onGetProperty(requestedPropValue); + VehicleHal::VehiclePropValuePtr v = nullptr; + if (!ret.ok()) { + ALOGE("get(): User HAL returned error: %s", ret.error().message().c_str()); + *outStatus = StatusCode(ret.error().code()); + } else { + auto value = ret.value().get(); + if (value != nullptr) { + ALOGI("get(): User HAL returned value: %s", toString(*value).c_str()); + v = getValuePool()->obtain(*value); + *outStatus = StatusCode::OK; + } else { + ALOGE("get(): User HAL returned null value"); + *outStatus = StatusCode::INTERNAL_ERROR; + } + } + return addTimestamp(std::move(v)); +} + VehicleHal::VehiclePropValuePtr DefaultVehicleHal::get(const VehiclePropValue& requestedPropValue, StatusCode* outStatus) { auto propId = requestedPropValue.prop; ALOGV("get(%d)", propId); + if (mEmulatedUserHal.isSupported(propId)) { + return getUserHalProp(requestedPropValue, outStatus); + } + VehiclePropValuePtr v = nullptr; if (propId == OBD2_FREEZE_FRAME) { v = getValuePool()->obtainComplex(); @@ -127,6 +154,36 @@ std::vector DefaultVehicleHal::listProperties() { } bool DefaultVehicleHal::dump(const hidl_handle& fd, const hidl_vec& options) { + int nativeFd = fd->data[0]; + if (nativeFd < 0) { + ALOGW("Invalid fd from HIDL handle: %d", nativeFd); + return false; + } + if (options.size() > 0) { + if (options[0] == "--help") { + std::string buffer; + buffer += "Emulated user hal usage:\n"; + buffer += mEmulatedUserHal.showDumpHelp(); + buffer += "\n"; + buffer += "VHAL server debug usage:\n"; + buffer += "--debughal: send debug command to VHAL server, see '--debughal --help'\n"; + buffer += "\n"; + dprintf(nativeFd, "%s", buffer.c_str()); + return false; + } else if (options[0] == kUserHalDumpOption) { + dprintf(nativeFd, "%s", mEmulatedUserHal.dump("").c_str()); + return false; + } + } else { + // No options, dump the emulated user hal state first and then send command to VHAL server + // to dump its state. + std::string buffer; + buffer += "Emulator user hal state:\n"; + buffer += mEmulatedUserHal.dump(" "); + buffer += "\n"; + dprintf(nativeFd, "%s", buffer.c_str()); + } + return mVehicleClient->dump(fd, options); } @@ -285,6 +342,23 @@ StatusCode DefaultVehicleHal::checkValueRange(const VehiclePropValue& value, return StatusCode::OK; } +StatusCode DefaultVehicleHal::setUserHalProp(const VehiclePropValue& propValue) { + ALOGI("onSetProperty(): property %d will be handled by UserHal", propValue.prop); + + const auto& ret = mEmulatedUserHal.onSetProperty(propValue); + if (!ret.ok()) { + ALOGE("onSetProperty(): HAL returned error: %s", ret.error().message().c_str()); + return StatusCode(ret.error().code()); + } + auto updatedValue = ret.value().get(); + if (updatedValue != nullptr) { + ALOGI("onSetProperty(): updating property returned by HAL: %s", + toString(*updatedValue).c_str()); + onPropertyValue(*updatedValue, true); + } + return StatusCode::OK; +} + StatusCode DefaultVehicleHal::set(const VehiclePropValue& propValue) { if (propValue.status != VehiclePropertyStatus::AVAILABLE) { // Android side cannot set property status - this value is the @@ -293,6 +367,10 @@ StatusCode DefaultVehicleHal::set(const VehiclePropValue& propValue) { return StatusCode::INVALID_ARG; } + if (mEmulatedUserHal.isSupported(propValue.prop)) { + return setUserHalProp(propValue); + } + std::unordered_set powerProps(std::begin(kHvacPowerProperties), std::end(kHvacPowerProperties)); if (powerProps.count(propValue.prop)) { diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h index 027dc8559a..7cd7ac2a38 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h @@ -21,6 +21,7 @@ #include #include +#include "EmulatedUserHal.h" #include "VehicleHalClient.h" namespace android { @@ -55,6 +56,7 @@ class DefaultVehicleHal : public VehicleHal { VehiclePropertyStore* mPropStore; RecurrentTimer mRecurrentTimer; VehicleHalClient* mVehicleClient; + EmulatedUserHal mEmulatedUserHal; // The callback that would be called when a property value is updated. This function could // be extended to handle specific property update event. @@ -79,6 +81,11 @@ class DefaultVehicleHal : public VehicleHal { // Register the heart beat event to be sent every 3s. This is required to inform watch dog that // VHAL is alive. Subclasses should always calls this function during onCreate. void registerHeartBeatEvent(); + // Get a user HAL property. + VehiclePropValuePtr getUserHalProp(const VehiclePropValue& requestedPropValue, + StatusCode* outStatus); + // Set a user HAL property. + StatusCode setUserHalProp(const VehiclePropValue& propValue); // Create a VHAL heart beat property. VehicleHal::VehiclePropValuePtr createVhalHeartBeatProp(); 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 27c1f4d45f..2268df80a0 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 @@ -1047,4 +1047,220 @@ TEST_F(DefaultVhalImplTest, testClearObd2FreezeFrameOneFrame) { ASSERT_EQ(StatusCode::INVALID_ARG, status); } +TEST_F(DefaultVhalImplTest, testGetUserPropertySetOnly) { + VehiclePropValue value; + value.prop = toInt(VehicleProperty::INITIAL_USER_INFO); + StatusCode status; + + mHal->get(value, &status); + + ASSERT_EQ(StatusCode::INVALID_ARG, status); + + value.prop = toInt(VehicleProperty::SWITCH_USER); + + mHal->get(value, &status); + + ASSERT_EQ(StatusCode::INVALID_ARG, status); + + value.prop = toInt(VehicleProperty::CREATE_USER); + + mHal->get(value, &status); + + ASSERT_EQ(StatusCode::INVALID_ARG, status); + + value.prop = toInt(VehicleProperty::REMOVE_USER); + + mHal->get(value, &status); + + ASSERT_EQ(StatusCode::INVALID_ARG, status); +} + +TEST_F(DefaultVhalImplTest, testGetUserIdAssoc) { + VehiclePropValue value; + value.prop = toInt(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION); + StatusCode status; + + mHal->get(value, &status); + + // Default returns NOT_AVAILABLE. + ASSERT_EQ(StatusCode::NOT_AVAILABLE, status); + + // This is the same example as used in User HAL Emulation doc. + VehiclePropValue setValue = { + .prop = toInt(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION), + .areaId = 1, + .value.int32Values = {666, 1, 1, 2}, + }; + + status = mHal->set(setValue); + + ASSERT_EQ(StatusCode::OK, status); + + auto gotValue = mHal->get(value, &status); + + ASSERT_EQ(StatusCode::OK, status); + ASSERT_EQ((size_t)4, gotValue->value.int32Values.size()); + EXPECT_EQ(1, gotValue->areaId); + EXPECT_EQ(666, gotValue->value.int32Values[0]); + EXPECT_EQ(1, gotValue->value.int32Values[1]); + EXPECT_EQ(1, gotValue->value.int32Values[2]); + EXPECT_EQ(2, gotValue->value.int32Values[3]); + EXPECT_EQ(toInt(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION), gotValue->prop); +} + +TEST_F(DefaultVhalImplTest, testSwitchUser) { + // This is the same example as used in User HAL Emulation doc. + VehiclePropValue setValue = { + .prop = toInt(VehicleProperty::SWITCH_USER), + .areaId = 1, + .value.int32Values = {666, 3, 2}, + }; + + auto status = mHal->set(setValue); + + ASSERT_EQ(StatusCode::OK, status); + + // Simulate a request from Android side. + setValue = { + .prop = toInt(VehicleProperty::SWITCH_USER), + .areaId = 0, + .value.int32Values = {666, 3}, + }; + // Clear existing events. + mEventQueue.flush(); + + status = mHal->set(setValue); + + ASSERT_EQ(StatusCode::OK, status); + + // Should generate an event for user hal response. + auto events = mEventQueue.flush(); + ASSERT_EQ((size_t)1, events.size()); + EXPECT_EQ(1, events[0]->areaId); + EXPECT_EQ(toInt(VehicleProperty::SWITCH_USER), events[0]->prop); + ASSERT_EQ((size_t)3, events[0]->value.int32Values.size()); + EXPECT_EQ(666, events[0]->value.int32Values[0]); + EXPECT_EQ(3, events[0]->value.int32Values[1]); + EXPECT_EQ(2, events[0]->value.int32Values[2]); + + // Try to get switch_user again, should return default value. + status = mHal->set(setValue); + ASSERT_EQ(StatusCode::OK, status); + + events = mEventQueue.flush(); + ASSERT_EQ((size_t)1, events.size()); + EXPECT_EQ(0, events[0]->areaId); + EXPECT_EQ(toInt(VehicleProperty::SWITCH_USER), events[0]->prop); + ASSERT_EQ((size_t)3, events[0]->value.int32Values.size()); + // Request ID + EXPECT_EQ(666, events[0]->value.int32Values[0]); + // VEHICLE_RESPONSE + EXPECT_EQ(3, events[0]->value.int32Values[1]); + // SUCCESS + EXPECT_EQ(1, events[0]->value.int32Values[2]); +} + +TEST_F(DefaultVhalImplTest, testCreateUser) { + // This is the same example as used in User HAL Emulation doc. + VehiclePropValue setValue = { + .prop = toInt(VehicleProperty::CREATE_USER), + .areaId = 1, + .value.int32Values = {666, 2}, + }; + + auto status = mHal->set(setValue); + + ASSERT_EQ(StatusCode::OK, status); + + // Simulate a request from Android side. + setValue = { + .prop = toInt(VehicleProperty::CREATE_USER), + .areaId = 0, + .value.int32Values = {666}, + }; + // Clear existing events. + mEventQueue.flush(); + + status = mHal->set(setValue); + + ASSERT_EQ(StatusCode::OK, status); + + // Should generate an event for user hal response. + auto events = mEventQueue.flush(); + ASSERT_EQ((size_t)1, events.size()); + EXPECT_EQ(1, events[0]->areaId); + EXPECT_EQ(toInt(VehicleProperty::CREATE_USER), events[0]->prop); + ASSERT_EQ((size_t)2, events[0]->value.int32Values.size()); + EXPECT_EQ(666, events[0]->value.int32Values[0]); + EXPECT_EQ(2, events[0]->value.int32Values[1]); + + // Try to get create_user again, should return default value. + status = mHal->set(setValue); + ASSERT_EQ(StatusCode::OK, status); + + events = mEventQueue.flush(); + ASSERT_EQ((size_t)1, events.size()); + EXPECT_EQ(0, events[0]->areaId); + EXPECT_EQ(toInt(VehicleProperty::CREATE_USER), events[0]->prop); + ASSERT_EQ((size_t)2, events[0]->value.int32Values.size()); + // Request ID + EXPECT_EQ(666, events[0]->value.int32Values[0]); + // SUCCESS + EXPECT_EQ(1, events[0]->value.int32Values[1]); +} + +TEST_F(DefaultVhalImplTest, testInitialUserInfo) { + // This is the same example as used in User HAL Emulation doc. + VehiclePropValue setValue = { + .prop = toInt(VehicleProperty::INITIAL_USER_INFO), + .areaId = 1, + .value.int32Values = {666, 1, 11}, + }; + + auto status = mHal->set(setValue); + + ASSERT_EQ(StatusCode::OK, status); + + // Simulate a request from Android side. + setValue = { + .prop = toInt(VehicleProperty::INITIAL_USER_INFO), + .areaId = 0, + .value.int32Values = {3}, + }; + // Clear existing events. + mEventQueue.flush(); + + status = mHal->set(setValue); + + ASSERT_EQ(StatusCode::OK, status); + + // Should generate an event for user hal response. + auto events = mEventQueue.flush(); + ASSERT_EQ((size_t)1, events.size()); + EXPECT_EQ(1, events[0]->areaId); + EXPECT_EQ(toInt(VehicleProperty::INITIAL_USER_INFO), events[0]->prop); + ASSERT_EQ((size_t)3, events[0]->value.int32Values.size()); + EXPECT_EQ(3, events[0]->value.int32Values[0]); + EXPECT_EQ(1, events[0]->value.int32Values[1]); + EXPECT_EQ(11, events[0]->value.int32Values[2]); + + // Try to get create_user again, should return default value. + status = mHal->set(setValue); + ASSERT_EQ(StatusCode::OK, status); + + events = mEventQueue.flush(); + ASSERT_EQ((size_t)1, events.size()); + EXPECT_EQ(0, events[0]->areaId); + EXPECT_EQ(toInt(VehicleProperty::INITIAL_USER_INFO), events[0]->prop); + ASSERT_EQ((size_t)4, events[0]->value.int32Values.size()); + // Request ID + EXPECT_EQ(3, events[0]->value.int32Values[0]); + // ACTION: DEFAULT + EXPECT_EQ(0, events[0]->value.int32Values[1]); + // User id: 0 + EXPECT_EQ(0, events[0]->value.int32Values[2]); + // Flags: 0 + EXPECT_EQ(0, events[0]->value.int32Values[3]); +} + } // namespace diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/Android.bp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/Android.bp new file mode 100644 index 0000000000..0058d33a6a --- /dev/null +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/Android.bp @@ -0,0 +1,31 @@ +// 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. + +// Library used to emulate User HAL behavior through lshal debug requests. +cc_library { + name: "android.hardware.automotive.vehicle@2.0-emulated-user-hal-lib", + vendor: true, + defaults: ["vhal_v2_0_target_defaults"], + srcs: ["EmulatedUserHal.cpp"], + shared_libs: [ + "libbase", + "libutils", + "libcutils", + ], + local_include_dirs: ["include"], + export_include_dirs: ["include"], + whole_static_libs: [ + "android.hardware.automotive.vehicle@2.0-user-hal-helper-lib", + ], +} diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/EmulatedUserHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/EmulatedUserHal.cpp new file mode 100644 index 0000000000..55dc01a4e6 --- /dev/null +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/EmulatedUserHal.cpp @@ -0,0 +1,353 @@ +/* + * 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. + */ +#define LOG_TAG "EmulatedUserHal" + +#include +#include + +#include "UserHalHelper.h" + +#include "EmulatedUserHal.h" + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace V2_0 { + +namespace impl { + +namespace { + +using android::base::Error; +using android::base::Result; + +constexpr int32_t INITIAL_USER_INFO = static_cast(VehicleProperty::INITIAL_USER_INFO); +constexpr int32_t SWITCH_USER = static_cast(VehicleProperty::SWITCH_USER); +constexpr int32_t CREATE_USER = static_cast(VehicleProperty::CREATE_USER); +constexpr int32_t REMOVE_USER = static_cast(VehicleProperty::REMOVE_USER); +constexpr int32_t USER_IDENTIFICATION_ASSOCIATION = + static_cast(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION); + +Result getRequestId(const VehiclePropValue& value) { + if (value.value.int32Values.size() < 1) { + return Error(static_cast(StatusCode::INVALID_ARG)) + << "no int32values on " << toString(value); + } + return value.value.int32Values[0]; +} + +Result getSwitchUserMessageType(const VehiclePropValue& value) { + if (value.value.int32Values.size() < 2) { + return Error(static_cast(StatusCode::INVALID_ARG)) + << "missing switch user message type " << toString(value); + } + return user_hal_helper::verifyAndCast(value.value.int32Values[1]); +} + +} // namespace + +bool EmulatedUserHal::isSupported(int32_t prop) { + switch (prop) { + case INITIAL_USER_INFO: + case SWITCH_USER: + case CREATE_USER: + case REMOVE_USER: + case USER_IDENTIFICATION_ASSOCIATION: + return true; + default: + return false; + } +} + +Result> EmulatedUserHal::onSetProperty( + const VehiclePropValue& value) { + ALOGV("onSetProperty(): %s", toString(value).c_str()); + + switch (value.prop) { + case INITIAL_USER_INFO: + return onSetInitialUserInfoResponse(value); + case SWITCH_USER: + return onSetSwitchUserResponse(value); + case CREATE_USER: + return onSetCreateUserResponse(value); + case REMOVE_USER: + ALOGI("REMOVE_USER is FYI only, nothing to do..."); + return {}; + case USER_IDENTIFICATION_ASSOCIATION: + return onSetUserIdentificationAssociation(value); + default: + return Error(static_cast(StatusCode::INVALID_ARG)) + << "Unsupported property: " << toString(value); + } +} + +Result> EmulatedUserHal::onGetProperty( + const VehiclePropValue& value) { + ALOGV("onGetProperty(%s)", toString(value).c_str()); + switch (value.prop) { + case INITIAL_USER_INFO: + case SWITCH_USER: + case CREATE_USER: + case REMOVE_USER: + ALOGE("onGetProperty(): %d is only supported on SET", value.prop); + return Error(static_cast(StatusCode::INVALID_ARG)) << "only supported on SET"; + case USER_IDENTIFICATION_ASSOCIATION: + return onGetUserIdentificationAssociation(value); + default: + ALOGE("onGetProperty(): %d is not supported", value.prop); + return Error(static_cast(StatusCode::INVALID_ARG)) << "not supported by User HAL"; + } +} + +Result> EmulatedUserHal::onGetUserIdentificationAssociation( + const VehiclePropValue& value) { + if (mSetUserIdentificationAssociationResponseFromCmd == nullptr) { + return defaultUserIdentificationAssociation(value); + } + ALOGI("get(USER_IDENTIFICATION_ASSOCIATION): returning %s", + toString(*mSetUserIdentificationAssociationResponseFromCmd).c_str()); + auto newValue = std::unique_ptr( + new VehiclePropValue(*mSetUserIdentificationAssociationResponseFromCmd)); + auto requestId = getRequestId(value); + if (requestId.ok()) { + // Must use the same requestId + newValue->value.int32Values[0] = *requestId; + } else { + ALOGE("get(USER_IDENTIFICATION_ASSOCIATION): no requestId on %s", toString(value).c_str()); + } + return newValue; +} + +Result> EmulatedUserHal::onSetInitialUserInfoResponse( + const VehiclePropValue& value) { + auto requestId = getRequestId(value); + if (!requestId.ok()) { + ALOGE("Failed to get requestId on set(INITIAL_USER_INFO): %s", + requestId.error().message().c_str()); + return requestId.error(); + } + + if (value.areaId != 0) { + ALOGD("set(INITIAL_USER_INFO) called from lshal; storing it: %s", toString(value).c_str()); + mInitialUserResponseFromCmd.reset(new VehiclePropValue(value)); + return {}; + } + + ALOGD("set(INITIAL_USER_INFO) called from Android: %s", toString(value).c_str()); + if (mInitialUserResponseFromCmd != nullptr) { + ALOGI("replying INITIAL_USER_INFO with lshal value: %s", + toString(*mInitialUserResponseFromCmd).c_str()); + return sendUserHalResponse(std::move(mInitialUserResponseFromCmd), *requestId); + } + + // Returns default response + auto updatedValue = user_hal_helper::toVehiclePropValue(InitialUserInfoResponse{ + .requestId = *requestId, + .action = InitialUserInfoResponseAction::DEFAULT, + }); + ALOGI("no lshal response; replying with InitialUserInfoResponseAction::DEFAULT: %s", + toString(*updatedValue).c_str()); + return updatedValue; +} + +Result> EmulatedUserHal::onSetSwitchUserResponse( + const VehiclePropValue& value) { + auto requestId = getRequestId(value); + if (!requestId.ok()) { + ALOGE("Failed to get requestId on set(SWITCH_USER): %s", + requestId.error().message().c_str()); + return requestId.error(); + } + + auto messageType = getSwitchUserMessageType(value); + if (!messageType.ok()) { + ALOGE("Failed to get messageType on set(SWITCH_USER): %s", + messageType.error().message().c_str()); + return messageType.error(); + } + + if (value.areaId != 0) { + if (*messageType == SwitchUserMessageType::VEHICLE_REQUEST) { + // User HAL can also request a user switch, so we need to check it first + ALOGD("set(SWITCH_USER) called from lshal to emulate a vehicle request: %s", + toString(value).c_str()); + return std::unique_ptr(new VehiclePropValue(value)); + } + // Otherwise, we store it + ALOGD("set(SWITCH_USER) called from lshal; storing it: %s", toString(value).c_str()); + mSwitchUserResponseFromCmd.reset(new VehiclePropValue(value)); + return {}; + } + ALOGD("set(SWITCH_USER) called from Android: %s", toString(value).c_str()); + + if (mSwitchUserResponseFromCmd != nullptr) { + ALOGI("replying SWITCH_USER with lshal value: %s", + toString(*mSwitchUserResponseFromCmd).c_str()); + return sendUserHalResponse(std::move(mSwitchUserResponseFromCmd), *requestId); + } + + if (*messageType == SwitchUserMessageType::LEGACY_ANDROID_SWITCH || + *messageType == SwitchUserMessageType::ANDROID_POST_SWITCH) { + ALOGI("request is %s; ignoring it", toString(*messageType).c_str()); + return {}; + } + + // Returns default response + auto updatedValue = user_hal_helper::toVehiclePropValue(SwitchUserResponse{ + .requestId = *requestId, + .messageType = SwitchUserMessageType::VEHICLE_RESPONSE, + .status = SwitchUserStatus::SUCCESS, + }); + ALOGI("no lshal response; replying with VEHICLE_RESPONSE / SUCCESS: %s", + toString(*updatedValue).c_str()); + return updatedValue; +} + +Result> EmulatedUserHal::onSetCreateUserResponse( + const VehiclePropValue& value) { + auto requestId = getRequestId(value); + if (!requestId.ok()) { + ALOGE("Failed to get requestId on set(CREATE_USER): %s", + requestId.error().message().c_str()); + return requestId.error(); + } + + if (value.areaId != 0) { + ALOGD("set(CREATE_USER) called from lshal; storing it: %s", toString(value).c_str()); + mCreateUserResponseFromCmd.reset(new VehiclePropValue(value)); + return {}; + } + ALOGD("set(CREATE_USER) called from Android: %s", toString(value).c_str()); + + if (mCreateUserResponseFromCmd != nullptr) { + ALOGI("replying CREATE_USER with lshal value: %s", + toString(*mCreateUserResponseFromCmd).c_str()); + return sendUserHalResponse(std::move(mCreateUserResponseFromCmd), *requestId); + } + + // Returns default response + auto updatedValue = user_hal_helper::toVehiclePropValue(CreateUserResponse{ + .requestId = *requestId, + .status = CreateUserStatus::SUCCESS, + }); + ALOGI("no lshal response; replying with SUCCESS: %s", toString(*updatedValue).c_str()); + return updatedValue; +} + +Result> EmulatedUserHal::onSetUserIdentificationAssociation( + const VehiclePropValue& value) { + auto requestId = getRequestId(value); + if (!requestId.ok()) { + ALOGE("Failed to get requestId on set(USER_IDENTIFICATION_ASSOCIATION): %s", + requestId.error().message().c_str()); + return requestId.error(); + } + + if (value.areaId != 0) { + ALOGD("set(USER_IDENTIFICATION_ASSOCIATION) called from lshal; storing it: %s", + toString(value).c_str()); + mSetUserIdentificationAssociationResponseFromCmd.reset(new VehiclePropValue(value)); + return {}; + } + ALOGD("set(USER_IDENTIFICATION_ASSOCIATION) called from Android: %s", toString(value).c_str()); + + if (mSetUserIdentificationAssociationResponseFromCmd != nullptr) { + ALOGI("replying USER_IDENTIFICATION_ASSOCIATION with lshal value: %s", + toString(*mSetUserIdentificationAssociationResponseFromCmd).c_str()); + // Not moving response so it can be used on GET requests + auto copy = std::unique_ptr( + new VehiclePropValue(*mSetUserIdentificationAssociationResponseFromCmd)); + return sendUserHalResponse(std::move(copy), *requestId); + } + // Returns default response + return defaultUserIdentificationAssociation(value); +} + +Result> EmulatedUserHal::defaultUserIdentificationAssociation( + const VehiclePropValue& request) { + // TODO(b/159498909): return a response with NOT_ASSOCIATED_ANY_USER for all requested types + ALOGE("no lshal response for %s; replying with NOT_AVAILABLE", toString(request).c_str()); + return Error(static_cast(StatusCode::NOT_AVAILABLE)) << "not set by lshal"; +} + +Result> EmulatedUserHal::sendUserHalResponse( + std::unique_ptr response, int32_t requestId) { + switch (response->areaId) { + case 1: + ALOGD("returning response with right request id"); + response->value.int32Values[0] = requestId; + break; + case 2: + ALOGD("returning response with wrong request id"); + response->value.int32Values[0] = -requestId; + break; + case 3: + ALOGD("not generating a property change event because of lshal prop: %s", + toString(*response).c_str()); + return Error(static_cast(StatusCode::NOT_AVAILABLE)) + << "not generating a property change event because of lshal prop: " + << toString(*response); + default: + ALOGE("invalid action on lshal response: %s", toString(*response).c_str()); + return Error(static_cast(StatusCode::INTERNAL_ERROR)) + << "invalid action on lshal response: " << toString(*response); + } + + ALOGD("updating property to: %s", toString(*response).c_str()); + return response; +} + +std::string EmulatedUserHal::showDumpHelp() { + return fmt::format("{}: dumps state used for user management\n", kUserHalDumpOption); +} + +std::string EmulatedUserHal::dump(std::string indent) { + std::string info; + if (mInitialUserResponseFromCmd != nullptr) { + info += fmt::format("{}InitialUserInfo response: {}\n", indent.c_str(), + toString(*mInitialUserResponseFromCmd).c_str()); + } else { + info += fmt::format("{}No InitialUserInfo response\n", indent.c_str()); + } + if (mSwitchUserResponseFromCmd != nullptr) { + info += fmt::format("{}SwitchUser response: {}\n", indent.c_str(), + toString(*mSwitchUserResponseFromCmd).c_str()); + } else { + info += fmt::format("{}No SwitchUser response\n", indent.c_str()); + } + if (mCreateUserResponseFromCmd != nullptr) { + info += fmt::format("{}CreateUser response: {}\n", indent.c_str(), + toString(*mCreateUserResponseFromCmd).c_str()); + } else { + info += fmt::format("{}No CreateUser response\n", indent.c_str()); + } + if (mSetUserIdentificationAssociationResponseFromCmd != nullptr) { + info += fmt::format("{}SetUserIdentificationAssociation response: {}\n", indent.c_str(), + toString(*mSetUserIdentificationAssociationResponseFromCmd).c_str()); + } else { + info += fmt::format("{}No SetUserIdentificationAssociation response\n", indent.c_str()); + } + return info; +} + +} // namespace impl + +} // namespace V2_0 +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/include/EmulatedUserHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/include/EmulatedUserHal.h new file mode 100644 index 0000000000..46f6d0f2dc --- /dev/null +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/include/EmulatedUserHal.h @@ -0,0 +1,152 @@ +/* + * 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 android_hardware_automotive_vehicle_V2_0_impl_EmulatedUserHal_H_ +#define android_hardware_automotive_vehicle_V2_0_impl_EmulatedUserHal_H_ + +#include +#include + +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace V2_0 { + +namespace impl { + +constexpr char kUserHalDumpOption[] = "--user-hal"; + +/** + * Class used to emulate a real User HAL behavior through lshal debug requests. + */ +class EmulatedUserHal { + public: + EmulatedUserHal() {} + + ~EmulatedUserHal() = default; + + /** + * Checks if the emulator can handle the property. + */ + bool isSupported(int32_t prop); + + /** + * Lets the emulator set the property. + * + * @return updated property and StatusCode + */ + android::base::Result> onSetProperty( + const VehiclePropValue& value); + + /** + * Gets the property value from the emulator. + * + * @return property value and StatusCode + */ + android::base::Result> onGetProperty( + const VehiclePropValue& value); + + /** + * Shows the User HAL emulation help. + */ + std::string showDumpHelp(); + + /** + * Dump its contents. + */ + std::string dump(std::string indent); + + private: + /** + * INITIAL_USER_INFO is called by Android when it starts, and it's expecting a property change + * indicating what the initial user should be. + * + * During normal circumstances, the emulator will reply right away, passing a response if + * InitialUserInfoResponseAction::DEFAULT (so Android could use its own logic to decide which + * user to boot). + * + * But during development / testing, the behavior can be changed using lshal dump, which must + * use the areaId to indicate what should happen next. + * + * So, the behavior of set(INITIAL_USER_INFO) is: + * + * - if it has an areaId, store the property into mInitialUserResponseFromCmd (as it was called + * by lshal). + * - else if mInitialUserResponseFromCmd is not set, return a response with the same request id + * and InitialUserInfoResponseAction::DEFAULT + * - else the behavior is defined by the areaId on mInitialUserResponseFromCmd: + * - if it's 1, reply with mInitialUserResponseFromCmd and the right request id + * - if it's 2, reply with mInitialUserResponseFromCmd but a wrong request id (so Android can + * test this error scenario) + * - if it's 3, then don't send a property change (so Android can emulate a timeout) + * + */ + android::base::Result> onSetInitialUserInfoResponse( + const VehiclePropValue& value); + + /** + * Used to emulate SWITCH_USER - see onSetInitialUserInfoResponse() for usage. + */ + android::base::Result> onSetSwitchUserResponse( + const VehiclePropValue& value); + + /** + * Used to emulate CREATE_USER - see onSetInitialUserInfoResponse() for usage. + */ + android::base::Result> onSetCreateUserResponse( + const VehiclePropValue& value); + + /** + * Used to emulate set USER_IDENTIFICATION_ASSOCIATION - see onSetInitialUserInfoResponse() for + * usage. + */ + android::base::Result> onSetUserIdentificationAssociation( + const VehiclePropValue& value); + + /** + * Used to emulate get USER_IDENTIFICATION_ASSOCIATION - see onSetInitialUserInfoResponse() for + * usage. + */ + android::base::Result> onGetUserIdentificationAssociation( + const VehiclePropValue& value); + + /** + * Creates a default USER_IDENTIFICATION_ASSOCIATION when it was not set by lshal. + */ + android::base::Result> defaultUserIdentificationAssociation( + const VehiclePropValue& request); + + android::base::Result> sendUserHalResponse( + std::unique_ptr response, int32_t requestId); + + std::unique_ptr mInitialUserResponseFromCmd; + std::unique_ptr mSwitchUserResponseFromCmd; + std::unique_ptr mCreateUserResponseFromCmd; + std::unique_ptr mSetUserIdentificationAssociationResponseFromCmd; +}; + +} // namespace impl + +} // namespace V2_0 +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_V2_0_impl_EmulatedUserHal_H_ -- GitLab From 87331887db50ff0350fd7c7be8f0f14e36b3a06f Mon Sep 17 00:00:00 2001 From: Hongguang Date: Thu, 22 Jul 2021 14:15:00 -0700 Subject: [PATCH 080/825] Setting the version explicitly on the face HAL. Bug: 194348824 Fix: 194348824 Test: make Change-Id: I35a4778fbd2d64412e4a318ed4a1c356ac68b554 --- biometrics/face/aidl/Android.bp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biometrics/face/aidl/Android.bp b/biometrics/face/aidl/Android.bp index 54d3ecd1e1..27496fb322 100644 --- a/biometrics/face/aidl/Android.bp +++ b/biometrics/face/aidl/Android.bp @@ -15,7 +15,7 @@ aidl_interface { ], imports: [ "android.hardware.biometrics.common", - "android.hardware.common", + "android.hardware.common-V2", "android.hardware.keymaster", ], stability: "vintf", -- GitLab From 93b24545632ea68625365b39d71d3c12ff5a3937 Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Fri, 23 Jul 2021 13:58:32 +0200 Subject: [PATCH 081/825] Remove Unused Member from Default Impl Bug: 194476544 Test: atest VtsHalTvTunerV1_0TargetTest && atest VtsHalTvTunerV1_1TargetTest Change-Id: I347ca125bdc557e36ca42b7a4f308a6151e12fe5 --- tv/tuner/1.0/default/Dvr.cpp | 1 - tv/tuner/1.0/default/Dvr.h | 6 +----- tv/tuner/1.1/default/Dvr.cpp | 1 - tv/tuner/1.1/default/Dvr.h | 6 +----- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/tv/tuner/1.0/default/Dvr.cpp b/tv/tuner/1.0/default/Dvr.cpp index c3edac973e..c62b878891 100644 --- a/tv/tuner/1.0/default/Dvr.cpp +++ b/tv/tuner/1.0/default/Dvr.cpp @@ -131,7 +131,6 @@ Return Dvr::stop() { lock_guard lock(mDvrThreadLock); - mIsRecordStarted = false; mDemux->setIsRecording(false); return Result::SUCCESS; diff --git a/tv/tuner/1.0/default/Dvr.h b/tv/tuner/1.0/default/Dvr.h index 30695866ca..fc4cb21791 100644 --- a/tv/tuner/1.0/default/Dvr.h +++ b/tv/tuner/1.0/default/Dvr.h @@ -155,10 +155,6 @@ class Dvr : public IDvr { std::mutex mDvrThreadLock; const bool DEBUG_DVR = false; - - // Booleans to check if recording is running. - // Recording is ready when both of the following are set to true. - bool mIsRecordStarted = false; }; } // namespace implementation @@ -168,4 +164,4 @@ class Dvr : public IDvr { } // namespace hardware } // namespace android -#endif // ANDROID_HARDWARE_TV_TUNER_V1_0_DVR_H_ \ No newline at end of file +#endif // ANDROID_HARDWARE_TV_TUNER_V1_0_DVR_H_ diff --git a/tv/tuner/1.1/default/Dvr.cpp b/tv/tuner/1.1/default/Dvr.cpp index 93f4519f10..fd84d49946 100644 --- a/tv/tuner/1.1/default/Dvr.cpp +++ b/tv/tuner/1.1/default/Dvr.cpp @@ -152,7 +152,6 @@ Return Dvr::stop() { mDvrThreadRunning = false; lock_guard lock(mDvrThreadLock); - mIsRecordStarted = false; mDemux->setIsRecording(false); return Result::SUCCESS; diff --git a/tv/tuner/1.1/default/Dvr.h b/tv/tuner/1.1/default/Dvr.h index 7b7efefada..9fabb49da5 100644 --- a/tv/tuner/1.1/default/Dvr.h +++ b/tv/tuner/1.1/default/Dvr.h @@ -151,10 +151,6 @@ class Dvr : public IDvr { std::mutex mDvrThreadLock; const bool DEBUG_DVR = false; - - // Booleans to check if recording is running. - // Recording is ready when both of the following are set to true. - bool mIsRecordStarted = false; }; } // namespace implementation @@ -164,4 +160,4 @@ class Dvr : public IDvr { } // namespace hardware } // namespace android -#endif // ANDROID_HARDWARE_TV_TUNER_V1_1_DVR_H_ \ No newline at end of file +#endif // ANDROID_HARDWARE_TV_TUNER_V1_1_DVR_H_ -- GitLab From 45eff329e0a71647f56ce4455ba8356feaf4298d Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Fri, 23 Jul 2021 14:56:53 +0200 Subject: [PATCH 082/825] Clean Up Playback Thread in DVR Test Implementation Bug: 194476544 Test: atest VtsHalTvTunerV1_0TargetTest && atest VtsHalTvTunerV1_1TargetTest Change-Id: I639e8314a499c07758c4927fa10cb4ff0e6dcb50 --- tv/tuner/1.0/default/Dvr.cpp | 25 +++++++++++-------------- tv/tuner/1.0/default/Dvr.h | 8 ++++---- tv/tuner/1.1/default/Dvr.cpp | 25 +++++++++---------------- tv/tuner/1.1/default/Dvr.h | 8 ++++---- 4 files changed, 28 insertions(+), 38 deletions(-) diff --git a/tv/tuner/1.0/default/Dvr.cpp b/tv/tuner/1.0/default/Dvr.cpp index c62b878891..40879f2041 100644 --- a/tv/tuner/1.0/default/Dvr.cpp +++ b/tv/tuner/1.0/default/Dvr.cpp @@ -37,7 +37,10 @@ Dvr::Dvr(DvrType type, uint32_t bufferSize, const sp& cb, sp Dvr::getQueueDesc(getQueueDesc_cb _hidl_cb) { ALOGV("%s", __FUNCTION__); @@ -112,8 +115,7 @@ Return Dvr::start() { } if (mType == DvrType::PLAYBACK) { - pthread_create(&mDvrThread, NULL, __threadLoopPlayback, this); - pthread_setname_np(mDvrThread, "playback_waiting_loop"); + mDvrThread = std::thread(&Dvr::playbackThreadLoop, this); } else if (mType == DvrType::RECORD) { mRecordStatus = RecordStatus::DATA_READY; mDemux->setIsRecording(mType == DvrType::RECORD); @@ -128,9 +130,11 @@ Return Dvr::stop() { ALOGV("%s", __FUNCTION__); mDvrThreadRunning = false; - - lock_guard lock(mDvrThreadLock); - + if (mDvrThread.joinable()) { + mDvrThread.join(); + } + // thread should always be joinable if it is running, + // so it should be safe to assume recording stopped. mDemux->setIsRecording(false); return Result::SUCCESS; @@ -146,7 +150,7 @@ Return Dvr::flush() { Return Dvr::close() { ALOGV("%s", __FUNCTION__); - + stop(); return Result::SUCCESS; } @@ -173,15 +177,8 @@ EventFlag* Dvr::getDvrEventFlag() { return mDvrEventFlag; } -void* Dvr::__threadLoopPlayback(void* user) { - Dvr* const self = static_cast(user); - self->playbackThreadLoop(); - return 0; -} - void Dvr::playbackThreadLoop() { ALOGD("[Dvr] playback threadLoop start."); - lock_guard lock(mDvrThreadLock); mDvrThreadRunning = true; while (mDvrThreadRunning) { diff --git a/tv/tuner/1.0/default/Dvr.h b/tv/tuner/1.0/default/Dvr.h index fc4cb21791..264268a264 100644 --- a/tv/tuner/1.0/default/Dvr.h +++ b/tv/tuner/1.0/default/Dvr.h @@ -20,7 +20,9 @@ #include #include #include +#include #include +#include #include "Demux.h" #include "Frontend.h" #include "Tuner.h" @@ -119,7 +121,6 @@ class Dvr : public IDvr { * Each filter handler handles the data filtering/output writing/filterEvent updating. */ void startTpidFilter(vector data); - static void* __threadLoopPlayback(void* user); static void* __threadLoopRecord(void* user); void playbackThreadLoop(); void recordThreadLoop(); @@ -133,7 +134,7 @@ class Dvr : public IDvr { DvrSettings mDvrSettings; // Thread handlers - pthread_t mDvrThread; + std::thread mDvrThread; // FMQ status local records PlaybackStatus mPlaybackStatus; @@ -141,7 +142,7 @@ class Dvr : public IDvr { /** * If a specific filter's writing loop is still running */ - bool mDvrThreadRunning; + std::atomic mDvrThreadRunning; bool mKeepFetchingDataFromFrontend; /** * Lock to protect writes to the FMQs @@ -152,7 +153,6 @@ class Dvr : public IDvr { */ std::mutex mPlaybackStatusLock; std::mutex mRecordStatusLock; - std::mutex mDvrThreadLock; const bool DEBUG_DVR = false; }; diff --git a/tv/tuner/1.1/default/Dvr.cpp b/tv/tuner/1.1/default/Dvr.cpp index fd84d49946..fdb66c1fd4 100644 --- a/tv/tuner/1.1/default/Dvr.cpp +++ b/tv/tuner/1.1/default/Dvr.cpp @@ -38,8 +38,8 @@ Dvr::Dvr(DvrType type, uint32_t bufferSize, const sp& cb, sp lock(mDvrThreadLock); + // make sure thread has joined + close(); } Return Dvr::getQueueDesc(getQueueDesc_cb _hidl_cb) { @@ -134,8 +134,7 @@ Return Dvr::start() { if (mType == DvrType::PLAYBACK) { mDvrThreadRunning = true; - pthread_create(&mDvrThread, NULL, __threadLoopPlayback, this); - pthread_setname_np(mDvrThread, "playback_waiting_loop"); + mDvrThread = std::thread(&Dvr::playbackThreadLoop, this); } else if (mType == DvrType::RECORD) { mRecordStatus = RecordStatus::DATA_READY; mDemux->setIsRecording(mType == DvrType::RECORD); @@ -150,8 +149,11 @@ Return Dvr::stop() { ALOGV("%s", __FUNCTION__); mDvrThreadRunning = false; - lock_guard lock(mDvrThreadLock); - + if (mDvrThread.joinable()) { + mDvrThread.join(); + } + // thread should always be joinable if it is running, + // so it should be safe to assume recording stopped. mDemux->setIsRecording(false); return Result::SUCCESS; @@ -167,9 +169,7 @@ Return Dvr::flush() { Return Dvr::close() { ALOGV("%s", __FUNCTION__); - - mDvrThreadRunning = false; - lock_guard lock(mDvrThreadLock); + stop(); return Result::SUCCESS; } @@ -196,15 +196,8 @@ EventFlag* Dvr::getDvrEventFlag() { return mDvrEventFlag; } -void* Dvr::__threadLoopPlayback(void* user) { - Dvr* const self = static_cast(user); - self->playbackThreadLoop(); - return 0; -} - void Dvr::playbackThreadLoop() { ALOGD("[Dvr] playback threadLoop start."); - lock_guard lock(mDvrThreadLock); while (mDvrThreadRunning) { uint32_t efState = 0; diff --git a/tv/tuner/1.1/default/Dvr.h b/tv/tuner/1.1/default/Dvr.h index 9fabb49da5..bf46c1e3cd 100644 --- a/tv/tuner/1.1/default/Dvr.h +++ b/tv/tuner/1.1/default/Dvr.h @@ -19,7 +19,9 @@ #include #include +#include #include +#include #include "Demux.h" #include "Frontend.h" #include "Tuner.h" @@ -115,7 +117,6 @@ class Dvr : public IDvr { * Each filter handler handles the data filtering/output writing/filterEvent updating. */ void startTpidFilter(vector data); - static void* __threadLoopPlayback(void* user); static void* __threadLoopRecord(void* user); void playbackThreadLoop(); void recordThreadLoop(); @@ -129,7 +130,7 @@ class Dvr : public IDvr { DvrSettings mDvrSettings; // Thread handlers - pthread_t mDvrThread; + std::thread mDvrThread; // FMQ status local records PlaybackStatus mPlaybackStatus; @@ -137,7 +138,7 @@ class Dvr : public IDvr { /** * If a specific filter's writing loop is still running */ - bool mDvrThreadRunning; + std::atomic mDvrThreadRunning; bool mKeepFetchingDataFromFrontend; /** * Lock to protect writes to the FMQs @@ -148,7 +149,6 @@ class Dvr : public IDvr { */ std::mutex mPlaybackStatusLock; std::mutex mRecordStatusLock; - std::mutex mDvrThreadLock; const bool DEBUG_DVR = false; }; -- GitLab From eae26b7608e5018320601742d1eb1910d53595e8 Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Fri, 23 Jul 2021 15:00:27 +0200 Subject: [PATCH 083/825] Remove Unused Function Declarations from DVR Default Implementation Bug: 194476544 Test: atest VtsHalTvTunerV1_0TargetTest && atest VtsHalTvTunerV1_1TargetTest Change-Id: I388fc2b864763ca38f960de2698d292964d0c15b --- tv/tuner/1.0/default/Dvr.h | 2 -- tv/tuner/1.1/default/Dvr.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/tv/tuner/1.0/default/Dvr.h b/tv/tuner/1.0/default/Dvr.h index 264268a264..fd7fba2c0a 100644 --- a/tv/tuner/1.0/default/Dvr.h +++ b/tv/tuner/1.0/default/Dvr.h @@ -121,9 +121,7 @@ class Dvr : public IDvr { * Each filter handler handles the data filtering/output writing/filterEvent updating. */ void startTpidFilter(vector data); - static void* __threadLoopRecord(void* user); void playbackThreadLoop(); - void recordThreadLoop(); unique_ptr mDvrMQ; EventFlag* mDvrEventFlag; diff --git a/tv/tuner/1.1/default/Dvr.h b/tv/tuner/1.1/default/Dvr.h index bf46c1e3cd..1bbb55c45e 100644 --- a/tv/tuner/1.1/default/Dvr.h +++ b/tv/tuner/1.1/default/Dvr.h @@ -117,9 +117,7 @@ class Dvr : public IDvr { * Each filter handler handles the data filtering/output writing/filterEvent updating. */ void startTpidFilter(vector data); - static void* __threadLoopRecord(void* user); void playbackThreadLoop(); - void recordThreadLoop(); unique_ptr mDvrMQ; EventFlag* mDvrEventFlag; -- GitLab From 7b2bb9cc3cfe32d1955cf4a672d1c8236a3b9ab8 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Mon, 19 Jul 2021 14:48:05 -0700 Subject: [PATCH 084/825] Implement add/remove membership for Netlink sockets Change-Id: Ib98f14b1d758ee7b4d464b359d4792c3ca7027b0 Test: with other b/169681573 changes Bug: 169681573 --- automotive/can/1.0/default/libnl++/Socket.cpp | 20 +++++++++++++++++++ .../default/libnl++/include/libnl++/Socket.h | 16 +++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/automotive/can/1.0/default/libnl++/Socket.cpp b/automotive/can/1.0/default/libnl++/Socket.cpp index b0e67beee3..cc1d839434 100644 --- a/automotive/can/1.0/default/libnl++/Socket.cpp +++ b/automotive/can/1.0/default/libnl++/Socket.cpp @@ -162,6 +162,26 @@ pollfd Socket::preparePoll(short events) { return {mFd.get(), events, 0}; } +bool Socket::addMembership(unsigned group) { + const auto res = + setsockopt(mFd.get(), SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &group, sizeof(group)); + if (res < 0) { + PLOG(ERROR) << "Failed joining multicast group " << group; + return false; + } + return true; +} + +bool Socket::dropMembership(unsigned group) { + const auto res = + setsockopt(mFd.get(), SOL_NETLINK, NETLINK_DROP_MEMBERSHIP, &group, sizeof(group)); + if (res < 0) { + PLOG(ERROR) << "Failed leaving multicast group " << group; + return false; + } + return true; +} + Socket::receive_iterator::receive_iterator(Socket& socket, bool end) : mSocket(socket), mIsEnd(end) { if (!end) receive(); diff --git a/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h b/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h index 118b9f7b20..7ec0f7bdf9 100644 --- a/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h +++ b/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h @@ -191,6 +191,22 @@ class Socket { */ pollfd preparePoll(short events = 0); + /** + * Join a multicast group. + * + * \param group Group ID (*not* a bitfield) + * \return whether the operation succeeded + */ + bool addMembership(unsigned group); + + /** + * Leave a multicast group. + * + * \param group Group ID (*not* a bitfield) + * \return whether the operation succeeded + */ + bool dropMembership(unsigned group); + /** * Live iterator continuously receiving messages from Netlink socket. * -- GitLab From 6ee5dc3327f542f7facec614afa9c0b1dd520f31 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Thu, 8 Jul 2021 18:48:47 -0700 Subject: [PATCH 085/825] Convert Tuner 1.1 HIDL HAL to AIDL Bug: 191825295 Test: make and run VtsHalTvTunerTargetTest Change-Id: I0c346c2c2d58fd6319d0310013da4d4c00ea2b50 --- .../compatibility_matrix.current.xml | 8 + tv/tuner/aidl/Android.bp | 28 ++ .../hardware/tv/tuner/AudioExtraMetaData.aidl | 44 +++ .../hardware/tv/tuner/AudioStreamType.aidl | 54 ++++ .../hardware/tv/tuner/AvStreamType.aidl | 40 +++ .../android/hardware/tv/tuner/Constant.aidl | 50 +++ .../hardware/tv/tuner/Constant64Bit.aidl | 41 +++ .../android/hardware/tv/tuner/DataFormat.aidl | 43 +++ .../tv/tuner/DemuxAlpFilterSettings.aidl | 41 +++ .../DemuxAlpFilterSettingsFilterSettings.aidl | 40 +++ .../hardware/tv/tuner/DemuxAlpFilterType.aidl | 42 +++ .../hardware/tv/tuner/DemuxAlpLengthType.aidl | 41 +++ .../hardware/tv/tuner/DemuxCapabilities.aidl | 51 +++ .../tv/tuner/DemuxFilterAvSettings.aidl | 39 +++ .../tv/tuner/DemuxFilterDownloadEvent.aidl | 43 +++ .../tv/tuner/DemuxFilterDownloadSettings.aidl | 39 +++ .../hardware/tv/tuner/DemuxFilterEvent.aidl | 48 +++ .../tv/tuner/DemuxFilterIpPayloadEvent.aidl | 39 +++ .../tv/tuner/DemuxFilterMainType.aidl | 44 +++ .../tv/tuner/DemuxFilterMediaEvent.aidl | 49 +++ .../DemuxFilterMediaEventExtraMetaData.aidl | 40 +++ .../tv/tuner/DemuxFilterMmtpRecordEvent.aidl | 44 +++ .../tv/tuner/DemuxFilterMonitorEvent.aidl | 40 +++ .../tv/tuner/DemuxFilterMonitorEventType.aidl | 40 +++ .../tv/tuner/DemuxFilterPesDataSettings.aidl | 40 +++ .../tv/tuner/DemuxFilterPesEvent.aidl | 41 +++ .../tv/tuner/DemuxFilterRecordSettings.aidl | 41 +++ .../tv/tuner/DemuxFilterScIndexMask.aidl | 40 +++ .../tv/tuner/DemuxFilterSectionBits.aidl | 41 +++ .../tv/tuner/DemuxFilterSectionEvent.aidl | 42 +++ .../tv/tuner/DemuxFilterSectionSettings.aidl | 42 +++ .../DemuxFilterSectionSettingsCondition.aidl | 40 +++ ...lterSectionSettingsConditionTableInfo.aidl | 40 +++ .../tv/tuner/DemuxFilterSettings.aidl | 43 +++ .../hardware/tv/tuner/DemuxFilterStatus.aidl | 42 +++ .../tv/tuner/DemuxFilterTemiEvent.aidl | 41 +++ .../tv/tuner/DemuxFilterTsRecordEvent.aidl | 44 +++ .../hardware/tv/tuner/DemuxFilterType.aidl | 40 +++ .../DemuxFilterTypeDemuxFilterSubType.aidl | 43 +++ .../hardware/tv/tuner/DemuxIpAddress.aidl | 42 +++ .../tv/tuner/DemuxIpAddressIpAddress.aidl | 40 +++ .../tv/tuner/DemuxIpFilterSettings.aidl | 40 +++ .../DemuxIpFilterSettingsFilterSettings.aidl | 41 +++ .../hardware/tv/tuner/DemuxIpFilterType.aidl | 44 +++ .../tv/tuner/DemuxMmtpFilterSettings.aidl | 40 +++ ...DemuxMmtpFilterSettingsFilterSettings.aidl | 44 +++ .../tv/tuner/DemuxMmtpFilterType.aidl | 46 +++ .../android/hardware/tv/tuner/DemuxPid.aidl | 40 +++ .../tv/tuner/DemuxQueueNotifyBits.aidl | 40 +++ .../tv/tuner/DemuxRecordScIndexType.aidl | 42 +++ .../hardware/tv/tuner/DemuxScHevcIndex.aidl | 46 +++ .../hardware/tv/tuner/DemuxScIndex.aidl | 48 +++ .../tv/tuner/DemuxTlvFilterSettings.aidl | 41 +++ .../DemuxTlvFilterSettingsFilterSettings.aidl | 41 +++ .../hardware/tv/tuner/DemuxTlvFilterType.aidl | 42 +++ .../tv/tuner/DemuxTsFilterSettings.aidl | 40 +++ .../DemuxTsFilterSettingsFilterSettings.aidl | 43 +++ .../hardware/tv/tuner/DemuxTsFilterType.aidl | 47 +++ .../hardware/tv/tuner/DemuxTsIndex.aidl | 56 ++++ .../hardware/tv/tuner/DvrSettings.aidl | 40 +++ .../android/hardware/tv/tuner/DvrType.aidl | 40 +++ .../tv/tuner/FrontendAnalogAftFlag.aidl | 41 +++ .../tv/tuner/FrontendAnalogCapabilities.aidl | 40 +++ .../tv/tuner/FrontendAnalogSettings.aidl | 44 +++ .../tv/tuner/FrontendAnalogSifStandard.aidl | 57 ++++ .../hardware/tv/tuner/FrontendAnalogType.aidl | 47 +++ .../tv/tuner/FrontendAtsc3Bandwidth.aidl | 43 +++ .../tv/tuner/FrontendAtsc3Capabilities.aidl | 44 +++ .../tv/tuner/FrontendAtsc3CodeRate.aidl | 52 +++ .../tuner/FrontendAtsc3DemodOutputFormat.aidl | 41 +++ .../hardware/tv/tuner/FrontendAtsc3Fec.aidl | 46 +++ .../tv/tuner/FrontendAtsc3Modulation.aidl | 46 +++ .../tv/tuner/FrontendAtsc3PlpSettings.aidl | 43 +++ .../tv/tuner/FrontendAtsc3Settings.aidl | 44 +++ .../FrontendAtsc3TimeInterleaveMode.aidl | 42 +++ .../tv/tuner/FrontendAtscCapabilities.aidl | 39 +++ .../tv/tuner/FrontendAtscModulation.aidl | 42 +++ .../tv/tuner/FrontendAtscSettings.aidl | 42 +++ .../hardware/tv/tuner/FrontendBandwidth.aidl | 43 +++ .../FrontendCableTimeInterleaveMode.aidl | 49 +++ .../tv/tuner/FrontendCapabilities.aidl | 48 +++ .../tv/tuner/FrontendDtmbBandwidth.aidl | 42 +++ .../tv/tuner/FrontendDtmbCapabilities.aidl | 44 +++ .../tv/tuner/FrontendDtmbCodeRate.aidl | 43 +++ .../tv/tuner/FrontendDtmbGuardInterval.aidl | 46 +++ .../tv/tuner/FrontendDtmbModulation.aidl | 45 +++ .../tv/tuner/FrontendDtmbSettings.aidl | 47 +++ .../tuner/FrontendDtmbTimeInterleaveMode.aidl | 42 +++ .../tuner/FrontendDtmbTransmissionMode.aidl | 42 +++ .../hardware/tv/tuner/FrontendDvbcAnnex.aidl | 42 +++ .../tv/tuner/FrontendDvbcBandwidth.aidl | 43 +++ .../tv/tuner/FrontendDvbcCapabilities.aidl | 41 +++ .../tv/tuner/FrontendDvbcModulation.aidl | 45 +++ .../tv/tuner/FrontendDvbcOuterFec.aidl | 41 +++ .../tv/tuner/FrontendDvbcSettings.aidl | 48 +++ .../tv/tuner/FrontendDvbsCapabilities.aidl | 41 +++ .../tv/tuner/FrontendDvbsCodeRate.aidl | 42 +++ .../tv/tuner/FrontendDvbsModulation.aidl | 53 ++++ .../hardware/tv/tuner/FrontendDvbsPilot.aidl | 42 +++ .../tv/tuner/FrontendDvbsRolloff.aidl | 45 +++ .../tv/tuner/FrontendDvbsScanType.aidl | 43 +++ .../tv/tuner/FrontendDvbsSettings.aidl | 51 +++ .../tv/tuner/FrontendDvbsStandard.aidl | 43 +++ .../tv/tuner/FrontendDvbsVcmMode.aidl | 41 +++ .../tv/tuner/FrontendDvbtBandwidth.aidl | 46 +++ .../tv/tuner/FrontendDvbtCapabilities.aidl | 46 +++ .../tv/tuner/FrontendDvbtCoderate.aidl | 49 +++ .../tv/tuner/FrontendDvbtConstellation.aidl | 48 +++ .../tv/tuner/FrontendDvbtGuardInterval.aidl | 47 +++ .../tv/tuner/FrontendDvbtHierarchy.aidl | 48 +++ .../tv/tuner/FrontendDvbtPlpMode.aidl | 41 +++ .../tv/tuner/FrontendDvbtSettings.aidl | 54 ++++ .../tv/tuner/FrontendDvbtStandard.aidl | 42 +++ .../tuner/FrontendDvbtTransmissionMode.aidl | 49 +++ .../hardware/tv/tuner/FrontendEventType.aidl | 41 +++ .../tv/tuner/FrontendGuardInterval.aidl | 41 +++ .../hardware/tv/tuner/FrontendInfo.aidl | 47 +++ .../hardware/tv/tuner/FrontendInnerFec.aidl | 92 ++++++ .../tv/tuner/FrontendInterleaveMode.aidl | 41 +++ .../tv/tuner/FrontendIsdbs3Capabilities.aidl | 40 +++ .../tv/tuner/FrontendIsdbs3Coderate.aidl | 51 +++ .../tv/tuner/FrontendIsdbs3Modulation.aidl | 45 +++ .../tv/tuner/FrontendIsdbs3Rolloff.aidl | 40 +++ .../tv/tuner/FrontendIsdbs3Settings.aidl | 46 +++ .../tv/tuner/FrontendIsdbsCapabilities.aidl | 40 +++ .../tv/tuner/FrontendIsdbsCoderate.aidl | 45 +++ .../tv/tuner/FrontendIsdbsModulation.aidl | 43 +++ .../tv/tuner/FrontendIsdbsRolloff.aidl | 40 +++ .../tv/tuner/FrontendIsdbsSettings.aidl | 46 +++ .../tv/tuner/FrontendIsdbsStreamIdType.aidl | 41 +++ .../tv/tuner/FrontendIsdbtBandwidth.aidl | 43 +++ .../tv/tuner/FrontendIsdbtCapabilities.aidl | 43 +++ .../tv/tuner/FrontendIsdbtCoderate.aidl | 49 +++ .../tv/tuner/FrontendIsdbtGuardInterval.aidl | 47 +++ .../hardware/tv/tuner/FrontendIsdbtMode.aidl | 43 +++ .../tv/tuner/FrontendIsdbtModulation.aidl | 44 +++ .../tv/tuner/FrontendIsdbtSettings.aidl | 47 +++ .../hardware/tv/tuner/FrontendModulation.aidl | 47 +++ .../tv/tuner/FrontendModulationStatus.aidl | 43 +++ .../hardware/tv/tuner/FrontendRollOff.aidl | 41 +++ .../tv/tuner/FrontendScanAtsc3PlpInfo.aidl | 40 +++ .../tv/tuner/FrontendScanMessage.aidl | 53 ++++ .../tv/tuner/FrontendScanMessageStandard.aidl | 41 +++ .../tv/tuner/FrontendScanMessageType.aidl | 53 ++++ .../hardware/tv/tuner/FrontendScanType.aidl | 41 +++ .../hardware/tv/tuner/FrontendSettings.aidl | 48 +++ .../tv/tuner/FrontendSpectralInversion.aidl | 41 +++ .../hardware/tv/tuner/FrontendStatus.aidl | 75 +++++ .../tv/tuner/FrontendStatusAtsc3PlpInfo.aidl | 41 +++ .../hardware/tv/tuner/FrontendStatusType.aidl | 75 +++++ .../tv/tuner/FrontendTransmissionMode.aidl | 41 +++ .../hardware/tv/tuner/FrontendType.aidl | 49 +++ .../android/hardware/tv/tuner/IDemux.aidl | 47 +++ .../hardware/tv/tuner/IDescrambler.aidl | 43 +++ .../android/hardware/tv/tuner/IDvr.aidl | 46 +++ .../hardware/tv/tuner/IDvrCallback.aidl | 40 +++ .../android/hardware/tv/tuner/IFilter.aidl | 52 +++ .../hardware/tv/tuner/IFilterCallback.aidl | 40 +++ .../android/hardware/tv/tuner/IFrontend.aidl | 49 +++ .../hardware/tv/tuner/IFrontendCallback.aidl | 40 +++ .../android/hardware/tv/tuner/ILnb.aidl | 44 +++ .../hardware/tv/tuner/ILnbCallback.aidl | 40 +++ .../hardware/tv/tuner/ITimeFilter.aidl | 43 +++ .../android/hardware/tv/tuner/ITuner.aidl | 47 +++ .../hardware/tv/tuner/LnbEventType.aidl | 42 +++ .../hardware/tv/tuner/LnbPosition.aidl | 41 +++ .../android/hardware/tv/tuner/LnbTone.aidl | 40 +++ .../android/hardware/tv/tuner/LnbVoltage.aidl | 47 +++ .../hardware/tv/tuner/PlaybackSettings.aidl | 43 +++ .../hardware/tv/tuner/PlaybackStatus.aidl | 42 +++ .../hardware/tv/tuner/RecordSettings.aidl | 43 +++ .../hardware/tv/tuner/RecordStatus.aidl | 42 +++ .../hardware/tv/tuner/ScramblingStatus.aidl | 41 +++ .../hardware/tv/tuner/VideoStreamType.aidl | 51 +++ .../hardware/tv/tuner/AudioExtraMetaData.aidl | 37 +++ .../hardware/tv/tuner/AudioStreamType.aidl | 102 ++++++ .../hardware/tv/tuner/AvStreamType.aidl | 31 ++ .../android/hardware/tv/tuner/Constant.aidl | 86 +++++ .../hardware/tv/tuner/Constant64Bit.aidl | 39 +++ .../android/hardware/tv/tuner/DataFormat.aidl | 50 +++ .../tv/tuner/DemuxAlpFilterSettings.aidl | 41 +++ .../DemuxAlpFilterSettingsFilterSettings.aidl | 33 ++ .../hardware/tv/tuner/DemuxAlpFilterType.aidl | 43 +++ .../hardware/tv/tuner/DemuxAlpLengthType.aidl | 37 +++ .../hardware/tv/tuner/DemuxCapabilities.aidl | 93 ++++++ .../tv/tuner/DemuxFilterAvSettings.aidl | 29 ++ .../tv/tuner/DemuxFilterDownloadEvent.aidl | 43 +++ .../tv/tuner/DemuxFilterDownloadSettings.aidl | 30 ++ .../hardware/tv/tuner/DemuxFilterEvent.aidl | 62 ++++ .../tv/tuner/DemuxFilterIpPayloadEvent.aidl | 29 ++ .../tv/tuner/DemuxFilterMainType.aidl | 53 ++++ .../tv/tuner/DemuxFilterMediaEvent.aidl | 77 +++++ .../DemuxFilterMediaEventExtraMetaData.aidl | 33 ++ .../tv/tuner/DemuxFilterMmtpRecordEvent.aidl | 55 ++++ .../tv/tuner/DemuxFilterMonitorEvent.aidl | 36 +++ .../tv/tuner/DemuxFilterMonitorEventType.aidl | 29 ++ .../tv/tuner/DemuxFilterPesDataSettings.aidl | 31 ++ .../tv/tuner/DemuxFilterPesEvent.aidl | 36 +++ .../tv/tuner/DemuxFilterRecordSettings.aidl | 36 +++ .../tv/tuner/DemuxFilterScIndexMask.aidl | 36 +++ .../tv/tuner/DemuxFilterSectionBits.aidl | 42 +++ .../tv/tuner/DemuxFilterSectionEvent.aidl | 44 +++ .../tv/tuner/DemuxFilterSectionSettings.aidl | 43 +++ .../DemuxFilterSectionSettingsCondition.aidl | 32 ++ ...lterSectionSettingsConditionTableInfo.aidl | 34 ++ .../tv/tuner/DemuxFilterSettings.aidl | 40 +++ .../hardware/tv/tuner/DemuxFilterStatus.aidl | 48 +++ .../tv/tuner/DemuxFilterTemiEvent.aidl | 40 +++ .../tv/tuner/DemuxFilterTsRecordEvent.aidl | 55 ++++ .../hardware/tv/tuner/DemuxFilterType.aidl | 31 ++ .../DemuxFilterTypeDemuxFilterSubType.aidl | 39 +++ .../hardware/tv/tuner/DemuxIpAddress.aidl | 40 +++ .../tv/tuner/DemuxIpAddressIpAddress.aidl | 33 ++ .../tv/tuner/DemuxIpFilterSettings.aidl | 31 ++ .../DemuxIpFilterSettingsFilterSettings.aidl | 38 +++ .../hardware/tv/tuner/DemuxIpFilterType.aidl | 56 ++++ .../tv/tuner/DemuxMmtpFilterSettings.aidl | 30 ++ ...DemuxMmtpFilterSettingsFilterSettings.aidl | 45 +++ .../tv/tuner/DemuxMmtpFilterType.aidl | 69 ++++ .../android/hardware/tv/tuner/DemuxPid.aidl | 34 ++ .../tv/tuner/DemuxQueueNotifyBits.aidl | 36 +++ .../tv/tuner/DemuxRecordScIndexType.aidl | 45 +++ .../hardware/tv/tuner/DemuxScHevcIndex.aidl | 41 +++ .../hardware/tv/tuner/DemuxScIndex.aidl | 73 +++++ .../tv/tuner/DemuxTlvFilterSettings.aidl | 43 +++ .../DemuxTlvFilterSettingsFilterSettings.aidl | 39 +++ .../hardware/tv/tuner/DemuxTlvFilterType.aidl | 45 +++ .../tv/tuner/DemuxTsFilterSettings.aidl | 33 ++ .../DemuxTsFilterSettingsFilterSettings.aidl | 43 +++ .../hardware/tv/tuner/DemuxTsFilterType.aidl | 75 +++++ .../hardware/tv/tuner/DemuxTsIndex.aidl | 76 +++++ .../hardware/tv/tuner/DvrSettings.aidl | 31 ++ .../android/hardware/tv/tuner/DvrType.aidl | 29 ++ .../tv/tuner/FrontendAnalogAftFlag.aidl | 31 ++ .../tv/tuner/FrontendAnalogCapabilities.aidl | 34 ++ .../tv/tuner/FrontendAnalogSettings.aidl | 47 +++ .../tv/tuner/FrontendAnalogSifStandard.aidl | 63 ++++ .../hardware/tv/tuner/FrontendAnalogType.aidl | 43 +++ .../tv/tuner/FrontendAtsc3Bandwidth.aidl | 38 +++ .../tv/tuner/FrontendAtsc3Capabilities.aidl | 54 ++++ .../tv/tuner/FrontendAtsc3CodeRate.aidl | 56 ++++ .../tuner/FrontendAtsc3DemodOutputFormat.aidl | 40 +++ .../hardware/tv/tuner/FrontendAtsc3Fec.aidl | 44 +++ .../tv/tuner/FrontendAtsc3Modulation.aidl | 44 +++ .../tv/tuner/FrontendAtsc3PlpSettings.aidl | 39 +++ .../tv/tuner/FrontendAtsc3Settings.aidl | 50 +++ .../FrontendAtsc3TimeInterleaveMode.aidl | 36 +++ .../tv/tuner/FrontendAtscCapabilities.aidl | 31 ++ .../tv/tuner/FrontendAtscModulation.aidl | 36 +++ .../tv/tuner/FrontendAtscSettings.aidl | 41 +++ .../hardware/tv/tuner/FrontendBandwidth.aidl | 39 +++ .../FrontendCableTimeInterleaveMode.aidl | 47 +++ .../tv/tuner/FrontendCapabilities.aidl | 54 ++++ .../tv/tuner/FrontendDtmbBandwidth.aidl | 36 +++ .../tv/tuner/FrontendDtmbCapabilities.aidl | 54 ++++ .../tv/tuner/FrontendDtmbCodeRate.aidl | 38 +++ .../tv/tuner/FrontendDtmbGuardInterval.aidl | 44 +++ .../tv/tuner/FrontendDtmbModulation.aidl | 42 +++ .../tv/tuner/FrontendDtmbSettings.aidl | 56 ++++ .../tuner/FrontendDtmbTimeInterleaveMode.aidl | 36 +++ .../tuner/FrontendDtmbTransmissionMode.aidl | 36 +++ .../hardware/tv/tuner/FrontendDvbcAnnex.aidl | 33 ++ .../tv/tuner/FrontendDvbcBandwidth.aidl | 35 +++ .../tv/tuner/FrontendDvbcCapabilities.aidl | 39 +++ .../tv/tuner/FrontendDvbcModulation.aidl | 42 +++ .../tv/tuner/FrontendDvbcOuterFec.aidl | 31 ++ .../tv/tuner/FrontendDvbcSettings.aidl | 61 ++++ .../tv/tuner/FrontendDvbsCapabilities.aidl | 39 +++ .../tv/tuner/FrontendDvbsCodeRate.aidl | 40 +++ .../tv/tuner/FrontendDvbsModulation.aidl | 61 ++++ .../hardware/tv/tuner/FrontendDvbsPilot.aidl | 33 ++ .../tv/tuner/FrontendDvbsRolloff.aidl | 39 +++ .../tv/tuner/FrontendDvbsScanType.aidl | 35 +++ .../tv/tuner/FrontendDvbsSettings.aidl | 68 ++++ .../tv/tuner/FrontendDvbsStandard.aidl | 35 +++ .../tv/tuner/FrontendDvbsVcmMode.aidl | 31 ++ .../tv/tuner/FrontendDvbtBandwidth.aidl | 44 +++ .../tv/tuner/FrontendDvbtCapabilities.aidl | 58 ++++ .../tv/tuner/FrontendDvbtCoderate.aidl | 50 +++ .../tv/tuner/FrontendDvbtConstellation.aidl | 48 +++ .../tv/tuner/FrontendDvbtGuardInterval.aidl | 46 +++ .../tv/tuner/FrontendDvbtHierarchy.aidl | 48 +++ .../tv/tuner/FrontendDvbtPlpMode.aidl | 31 ++ .../tv/tuner/FrontendDvbtSettings.aidl | 84 +++++ .../tv/tuner/FrontendDvbtStandard.aidl | 33 ++ .../tuner/FrontendDvbtTransmissionMode.aidl | 50 +++ .../hardware/tv/tuner/FrontendEventType.aidl | 40 +++ .../tv/tuner/FrontendGuardInterval.aidl | 32 ++ .../hardware/tv/tuner/FrontendInfo.aidl | 68 ++++ .../hardware/tv/tuner/FrontendInnerFec.aidl | 296 ++++++++++++++++++ .../tv/tuner/FrontendInterleaveMode.aidl | 34 ++ .../tv/tuner/FrontendIsdbs3Capabilities.aidl | 34 ++ .../tv/tuner/FrontendIsdbs3Coderate.aidl | 54 ++++ .../tv/tuner/FrontendIsdbs3Modulation.aidl | 42 +++ .../tv/tuner/FrontendIsdbs3Rolloff.aidl | 29 ++ .../tv/tuner/FrontendIsdbs3Settings.aidl | 54 ++++ .../tv/tuner/FrontendIsdbsCapabilities.aidl | 34 ++ .../tv/tuner/FrontendIsdbsCoderate.aidl | 42 +++ .../tv/tuner/FrontendIsdbsModulation.aidl | 38 +++ .../tv/tuner/FrontendIsdbsRolloff.aidl | 29 ++ .../tv/tuner/FrontendIsdbsSettings.aidl | 54 ++++ .../tv/tuner/FrontendIsdbsStreamIdType.aidl | 31 ++ .../tv/tuner/FrontendIsdbtBandwidth.aidl | 38 +++ .../tv/tuner/FrontendIsdbtCapabilities.aidl | 49 +++ .../tv/tuner/FrontendIsdbtCoderate.aidl | 50 +++ .../tv/tuner/FrontendIsdbtGuardInterval.aidl | 46 +++ .../hardware/tv/tuner/FrontendIsdbtMode.aidl | 38 +++ .../tv/tuner/FrontendIsdbtModulation.aidl | 40 +++ .../tv/tuner/FrontendIsdbtSettings.aidl | 55 ++++ .../hardware/tv/tuner/FrontendModulation.aidl | 51 +++ .../tv/tuner/FrontendModulationStatus.aidl | 40 +++ .../hardware/tv/tuner/FrontendRollOff.aidl | 33 ++ .../tv/tuner/FrontendScanAtsc3PlpInfo.aidl | 28 ++ .../tv/tuner/FrontendScanMessage.aidl | 73 +++++ .../tv/tuner/FrontendScanMessageStandard.aidl | 33 ++ .../tv/tuner/FrontendScanMessageType.aidl | 89 ++++++ .../hardware/tv/tuner/FrontendScanType.aidl | 31 ++ .../hardware/tv/tuner/FrontendSettings.aidl | 55 ++++ .../tv/tuner/FrontendSpectralInversion.aidl | 31 ++ .../hardware/tv/tuner/FrontendStatus.aidl | 193 ++++++++++++ .../tv/tuner/FrontendStatusAtsc3PlpInfo.aidl | 39 +++ .../hardware/tv/tuner/FrontendStatusType.aidl | 211 +++++++++++++ .../tv/tuner/FrontendTransmissionMode.aidl | 33 ++ .../hardware/tv/tuner/FrontendType.aidl | 82 +++++ .../android/hardware/tv/tuner/IDemux.aidl | 133 ++++++++ .../hardware/tv/tuner/IDescrambler.aidl | 81 +++++ .../aidl/android/hardware/tv/tuner/IDvr.aidl | 104 ++++++ .../hardware/tv/tuner/IDvrCallback.aidl | 43 +++ .../android/hardware/tv/tuner/IFilter.aidl | 190 +++++++++++ .../hardware/tv/tuner/IFilterCallback.aidl | 43 +++ .../android/hardware/tv/tuner/IFrontend.aidl | 146 +++++++++ .../hardware/tv/tuner/IFrontendCallback.aidl | 47 +++ .../aidl/android/hardware/tv/tuner/ILnb.aidl | 85 +++++ .../hardware/tv/tuner/ILnbCallback.aidl | 45 +++ .../hardware/tv/tuner/ITimeFilter.aidl | 71 +++++ .../android/hardware/tv/tuner/ITuner.aidl | 124 ++++++++ .../hardware/tv/tuner/LnbEventType.aidl | 42 +++ .../hardware/tv/tuner/LnbPosition.aidl | 31 ++ .../android/hardware/tv/tuner/LnbTone.aidl | 29 ++ .../android/hardware/tv/tuner/LnbVoltage.aidl | 43 +++ .../hardware/tv/tuner/PlaybackSettings.aidl | 54 ++++ .../hardware/tv/tuner/PlaybackStatus.aidl | 45 +++ .../hardware/tv/tuner/RecordSettings.aidl | 54 ++++ .../hardware/tv/tuner/RecordStatus.aidl | 48 +++ .../hardware/tv/tuner/ScramblingStatus.aidl | 40 +++ .../hardware/tv/tuner/VideoStreamType.aidl | 87 +++++ 346 files changed, 16470 insertions(+) create mode 100644 tv/tuner/aidl/Android.bp create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioExtraMetaData.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AvStreamType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Constant.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Constant64Bit.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DataFormat.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpLengthType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMainType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterStatus.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpAddress.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpFilterType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxPid.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScHevcIndex.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScIndex.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsIndex.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DvrSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DvrType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscModulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendBandwidth.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbModulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcModulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsModulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsPilot.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsScanType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsStandard.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtStandard.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendEventType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendGuardInterval.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInfo.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInnerFec.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInterleaveMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendModulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendModulationStatus.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendRollOff.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSpectralInversion.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendTransmissionMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDemux.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDescrambler.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDvr.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDvrCallback.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFilter.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFilterCallback.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontendCallback.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ILnb.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ILnbCallback.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITimeFilter.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbEventType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbPosition.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbTone.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbVoltage.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/PlaybackSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/PlaybackStatus.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/RecordSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/RecordStatus.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ScramblingStatus.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/VideoStreamType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/AudioExtraMetaData.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/AvStreamType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/Constant.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/Constant64Bit.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DataFormat.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpLengthType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxCapabilities.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterEvent.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMainType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpAddress.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpFilterType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxPid.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxScHevcIndex.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxScIndex.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsIndex.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DvrSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DvrType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscModulation.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendBandwidth.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendCapabilities.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbModulation.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcModulation.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsModulation.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsPilot.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsScanType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsStandard.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtStandard.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendEventType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendGuardInterval.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendInfo.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendInnerFec.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendInterleaveMode.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtMode.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendModulation.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendModulationStatus.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendRollOff.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendSpectralInversion.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendTransmissionMode.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/IDemux.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/IDescrambler.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/IDvr.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/IDvrCallback.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/IFilter.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/IFilterCallback.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/IFrontendCallback.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/ILnb.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/ILnbCallback.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/ITimeFilter.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/LnbEventType.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/LnbPosition.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/LnbTone.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/LnbVoltage.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/PlaybackSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/PlaybackStatus.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/RecordSettings.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/RecordStatus.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/ScramblingStatus.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/VideoStreamType.aidl diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index d4b49af8f4..7620d36669 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -591,6 +591,14 @@ default + + android.hardware.tv.tuner + 1 + + ITuner + default + + android.hardware.usb 1.0-3 diff --git a/tv/tuner/aidl/Android.bp b/tv/tuner/aidl/Android.bp new file mode 100644 index 0000000000..c33572deb0 --- /dev/null +++ b/tv/tuner/aidl/Android.bp @@ -0,0 +1,28 @@ +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.tv.tuner", + vendor_available: true, + srcs: ["android/hardware/tv/tuner/*.aidl"], + imports: [ + "android.hardware.common-V2", + "android.hardware.common.fmq-V1", + ], + stability: "vintf", + backend: { + java: { + sdk_version: "module_current", + srcs_available: true, + }, + cpp: { + enabled: false, + }, + }, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioExtraMetaData.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioExtraMetaData.aidl new file mode 100644 index 0000000000..20c6e5f35e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioExtraMetaData.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable AudioExtraMetaData { + byte adFade; + byte adPan; + byte versionTextTag; + byte adGainCenter; + byte adGainFront; + byte adGainSurround; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl new file mode 100644 index 0000000000..bfd2aa8b1f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum AudioStreamType { + UNDEFINED = 0, + PCM = 1, + MP3 = 2, + MPEG1 = 3, + MPEG2 = 4, + MPEGH = 5, + AAC = 6, + AC3 = 7, + EAC3 = 8, + AC4 = 9, + DTS = 10, + DTS_HD = 11, + WMA = 12, + OPUS = 13, + VORBIS = 14, + DRA = 15, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AvStreamType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AvStreamType.aidl new file mode 100644 index 0000000000..4d6acfffa1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AvStreamType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union AvStreamType { + android.hardware.tv.tuner.VideoStreamType video = android.hardware.tv.tuner.VideoStreamType.UNDEFINED; + android.hardware.tv.tuner.AudioStreamType audio; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Constant.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Constant.aidl new file mode 100644 index 0000000000..8e31bd9f77 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Constant.aidl @@ -0,0 +1,50 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum Constant { + INVALID_TS_PID = 65535, + INVALID_STREAM_ID = 65535, + INVALID_FILTER_ID = -1, + INVALID_AV_SYNC_ID = -1, + INVALID_MMTP_RECORD_EVENT_MPT_SEQUENCE_NUM = -1, + INVALID_FIRST_MACROBLOCK_IN_SLICE = -1, + INVALID_FRONTEND_SETTING_FREQUENCY = -1, + INVALID_IP_FILTER_CONTEXT_ID = -1, + INVALID_LTS_ID = -1, + INVALID_FRONTEND_ID = -1, + INVALID_LNB_ID = -1, + INVALID_KEYTOKEN = 0, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Constant64Bit.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Constant64Bit.aidl new file mode 100644 index 0000000000..a56a0cf2f9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Constant64Bit.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="long") @VintfStability +enum Constant64Bit { + INVALID_FILTER_ID_64BIT = -1, + INVALID_AV_SYNC_ID_64BIT = -1, + INVALID_PRESENTATION_TIME_STAMP = -1, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DataFormat.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DataFormat.aidl new file mode 100644 index 0000000000..3b8fee403d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DataFormat.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DataFormat { + TS = 0, + PES = 1, + ES = 2, + SHV_TLV = 3, + UNDEFINED = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl new file mode 100644 index 0000000000..ee8db8fa28 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxAlpFilterSettings { + byte packetType; + android.hardware.tv.tuner.DemuxAlpLengthType lengthType = android.hardware.tv.tuner.DemuxAlpLengthType.UNDEFINED; + android.hardware.tv.tuner.DemuxAlpFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..6b15492768 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxAlpFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterType.aidl new file mode 100644 index 0000000000..f0df497ed2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxAlpFilterType { + UNDEFINED = 0, + SECTION = 1, + PTP = 2, + PAYLOAD_THROUGH = 3, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpLengthType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpLengthType.aidl new file mode 100644 index 0000000000..ccca6de8c6 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpLengthType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum DemuxAlpLengthType { + UNDEFINED = 0, + WITHOUT_ADDITIONAL_HEADER = 1, + WITH_ADDITIONAL_HEADER = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxCapabilities.aidl new file mode 100644 index 0000000000..729b797376 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxCapabilities.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxCapabilities { + int numDemux; + int numRecord; + int numPlayback; + int numTsFilter; + int numSectionFilter; + int numAudioFilter; + int numVideoFilter; + int numPesFilter; + int numPcrFilter; + int numBytesInSectionFilter; + int filterCaps; + int[] linkCaps; + boolean bTimeFilter; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl new file mode 100644 index 0000000000..95911f93d7 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterAvSettings { + boolean isPassthrough; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl new file mode 100644 index 0000000000..a9e7b7c676 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterDownloadEvent { + int itemId; + int mpuSequenceNumber; + int itemFragmentIndex; + int lastItemFragmentIndex; + char dataLength; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl new file mode 100644 index 0000000000..ff06888b47 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterDownloadSettings { + int downloadId; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterEvent.aidl new file mode 100644 index 0000000000..617f71cc34 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterEvent.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterEvent { + android.hardware.tv.tuner.DemuxFilterSectionEvent section; + android.hardware.tv.tuner.DemuxFilterMediaEvent media; + android.hardware.tv.tuner.DemuxFilterPesEvent pes; + android.hardware.tv.tuner.DemuxFilterTsRecordEvent tsRecord; + android.hardware.tv.tuner.DemuxFilterMmtpRecordEvent mmtpRecord; + android.hardware.tv.tuner.DemuxFilterDownloadEvent download; + android.hardware.tv.tuner.DemuxFilterIpPayloadEvent ipPayload; + android.hardware.tv.tuner.DemuxFilterTemiEvent temi; + android.hardware.tv.tuner.DemuxFilterMonitorEvent monitorEvent; + int startId; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl new file mode 100644 index 0000000000..0d20f8e50f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterIpPayloadEvent { + char dataLength; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMainType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMainType.aidl new file mode 100644 index 0000000000..6abd87b0f3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMainType.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxFilterMainType { + UNDEFINED = 0, + TS = 1, + MMTP = 2, + IP = 4, + TLV = 8, + ALP = 16, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl new file mode 100644 index 0000000000..351a3406db --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterMediaEvent { + char streamId; + boolean isPtsPresent; + long pts; + int dataLength; + int offset; + android.hardware.common.NativeHandle avMemory; + boolean isSecureMemory; + long avDataId; + int mpuSequenceNumber; + boolean isPesPrivateData; + android.hardware.tv.tuner.DemuxFilterMediaEventExtraMetaData extraMetaData; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl new file mode 100644 index 0000000000..ab36188069 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterMediaEventExtraMetaData { + boolean noinit; + android.hardware.tv.tuner.AudioExtraMetaData audio; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl new file mode 100644 index 0000000000..4e31ba8c73 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterMmtpRecordEvent { + int scHevcIndexMask; + long byteNumber; + long pts; + int mpuSequenceNumber; + int firstMbInSlice; + int tsIndexMask; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl new file mode 100644 index 0000000000..177de7a0c1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterMonitorEvent { + android.hardware.tv.tuner.ScramblingStatus scramblingStatus = android.hardware.tv.tuner.ScramblingStatus.UNKNOWN; + int cid; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl new file mode 100644 index 0000000000..5d27f76025 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxFilterMonitorEventType { + SCRAMBLING_STATUS = 1, + IP_CID_CHANGE = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl new file mode 100644 index 0000000000..ac7f8a59cb --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterPesDataSettings { + char streamId; + boolean isRaw; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl new file mode 100644 index 0000000000..a4593b4255 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterPesEvent { + char streamId; + char dataLength; + int mpuSequenceNumber; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl new file mode 100644 index 0000000000..17bdd1fe3f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterRecordSettings { + int tsIndexMask; + android.hardware.tv.tuner.DemuxRecordScIndexType scIndexType = android.hardware.tv.tuner.DemuxRecordScIndexType.UNDEFINED; + android.hardware.tv.tuner.DemuxFilterScIndexMask scIndexMask; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl new file mode 100644 index 0000000000..3fd19100b5 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterScIndexMask { + int scIndex; + int scHevc; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl new file mode 100644 index 0000000000..b666c7b6ba --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterSectionBits { + byte[] filter; + byte[] mask; + byte[] mode; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl new file mode 100644 index 0000000000..114d1ebc0a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterSectionEvent { + char tableId; + char version; + char sectionNum; + char dataLength; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl new file mode 100644 index 0000000000..2858565099 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterSectionSettings { + android.hardware.tv.tuner.DemuxFilterSectionSettingsCondition condition; + boolean isCheckCrc; + boolean isRepeat; + boolean isRaw; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl new file mode 100644 index 0000000000..0b101dece4 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterSectionSettingsCondition { + android.hardware.tv.tuner.DemuxFilterSectionBits sectionBits; + android.hardware.tv.tuner.DemuxFilterSectionSettingsConditionTableInfo tableInfo; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl new file mode 100644 index 0000000000..be25137bbb --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterSectionSettingsConditionTableInfo { + char tableId; + char version; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSettings.aidl new file mode 100644 index 0000000000..c12fde25ab --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterSettings { + android.hardware.tv.tuner.DemuxTsFilterSettings ts; + android.hardware.tv.tuner.DemuxMmtpFilterSettings mmtp; + android.hardware.tv.tuner.DemuxIpFilterSettings ip; + android.hardware.tv.tuner.DemuxTlvFilterSettings tlv; + android.hardware.tv.tuner.DemuxAlpFilterSettings alp; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterStatus.aidl new file mode 100644 index 0000000000..36b40ea5b9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum DemuxFilterStatus { + DATA_READY = 1, + LOW_WATER = 2, + HIGH_WATER = 4, + OVERFLOW = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl new file mode 100644 index 0000000000..ce158618e3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterTemiEvent { + long pts; + byte descrTag; + byte[] descrData; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl new file mode 100644 index 0000000000..5c27faf95d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterTsRecordEvent { + android.hardware.tv.tuner.DemuxPid pid; + int tsIndexMask; + android.hardware.tv.tuner.DemuxFilterScIndexMask scIndexMask; + long byteNumber; + long pts; + int firstMbInSlice; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterType.aidl new file mode 100644 index 0000000000..14f9202105 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterType { + android.hardware.tv.tuner.DemuxFilterMainType mainType = android.hardware.tv.tuner.DemuxFilterMainType.UNDEFINED; + android.hardware.tv.tuner.DemuxFilterTypeDemuxFilterSubType subType; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl new file mode 100644 index 0000000000..2aa3a89665 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterTypeDemuxFilterSubType { + android.hardware.tv.tuner.DemuxTsFilterType tsFilterType = android.hardware.tv.tuner.DemuxTsFilterType.UNDEFINED; + android.hardware.tv.tuner.DemuxMmtpFilterType mmtpFilterType; + android.hardware.tv.tuner.DemuxIpFilterType ipFilterType; + android.hardware.tv.tuner.DemuxTlvFilterType tlvFilterType; + android.hardware.tv.tuner.DemuxAlpFilterType alpFilterType; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpAddress.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpAddress.aidl new file mode 100644 index 0000000000..935476a80d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpAddress.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxIpAddress { + android.hardware.tv.tuner.DemuxIpAddressIpAddress srcIpAddress; + android.hardware.tv.tuner.DemuxIpAddressIpAddress dstIpAddress; + char srcPort; + char dstPort; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl new file mode 100644 index 0000000000..62de08847e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxIpAddressIpAddress { + byte[] v4 = {}; + byte[] v6; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl new file mode 100644 index 0000000000..2b0610b4ef --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxIpFilterSettings { + android.hardware.tv.tuner.DemuxIpAddress ipAddr; + android.hardware.tv.tuner.DemuxIpFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..daac2847a6 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxIpFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; + boolean bPassthrough; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpFilterType.aidl new file mode 100644 index 0000000000..b78ac9a69e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpFilterType.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxIpFilterType { + UNDEFINED = 0, + SECTION = 1, + NTP = 2, + IP_PAYLOAD = 3, + IP = 4, + PAYLOAD_THROUGH = 5, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl new file mode 100644 index 0000000000..b0fad65eb7 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxMmtpFilterSettings { + char mmtpPid; + android.hardware.tv.tuner.DemuxMmtpFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..4b23306818 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxMmtpFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; + android.hardware.tv.tuner.DemuxFilterAvSettings av; + android.hardware.tv.tuner.DemuxFilterPesDataSettings pesData; + android.hardware.tv.tuner.DemuxFilterRecordSettings record; + android.hardware.tv.tuner.DemuxFilterDownloadSettings download; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl new file mode 100644 index 0000000000..7e9e3a64a7 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxMmtpFilterType { + UNDEFINED = 0, + SECTION = 1, + PES = 2, + MMTP = 3, + AUDIO = 4, + VIDEO = 5, + RECORD = 6, + DOWNLOAD = 7, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxPid.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxPid.aidl new file mode 100644 index 0000000000..0a29f93887 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxPid.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxPid { + char tPid; + char mmtpPid; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl new file mode 100644 index 0000000000..bcd0aebbde --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxQueueNotifyBits { + DATA_READY = 1, + DATA_CONSUMED = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl new file mode 100644 index 0000000000..91a5e52996 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxRecordScIndexType { + NONE = 0, + SC = 1, + SC_HEVC = 2, + UNDEFINED = 3, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScHevcIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScHevcIndex.aidl new file mode 100644 index 0000000000..3035dad332 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScHevcIndex.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxScHevcIndex { + SPS = 1, + AUD = 2, + SLICE_CE_BLA_W_LP = 4, + SLICE_BLA_W_RADL = 8, + SLICE_BLA_N_LP = 16, + SLICE_IDR_W_RADL = 32, + SLICE_IDR_N_LP = 64, + SLICE_TRAIL_CRA = 128, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScIndex.aidl new file mode 100644 index 0000000000..808b212311 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScIndex.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxScIndex { + UNDEFINED = 0, + I_FRAME = 1, + P_FRAME = 2, + B_FRAME = 4, + SEQUENCE = 8, + I_SLICE = 16, + P_SLICE = 32, + B_SLICE = 64, + SI_SLICE = 128, + SP_SLICE = 256, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl new file mode 100644 index 0000000000..dd949800d8 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxTlvFilterSettings { + byte packetType; + boolean isCompressedIpPacket; + android.hardware.tv.tuner.DemuxTlvFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..a9d319803c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxTlvFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; + boolean bPassthrough; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterType.aidl new file mode 100644 index 0000000000..a4e1ff176e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxTlvFilterType { + UNDEFINED = 0, + SECTION = 1, + TLV = 2, + PAYLOAD_THROUGH = 3, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl new file mode 100644 index 0000000000..131cab02bc --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxTsFilterSettings { + char tpid; + android.hardware.tv.tuner.DemuxTsFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..5d81bb6237 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxTsFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; + android.hardware.tv.tuner.DemuxFilterAvSettings av; + android.hardware.tv.tuner.DemuxFilterPesDataSettings pesData; + android.hardware.tv.tuner.DemuxFilterRecordSettings record; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterType.aidl new file mode 100644 index 0000000000..8b806bf6ec --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterType.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxTsFilterType { + UNDEFINED = 0, + SECTION = 1, + PES = 2, + TS = 3, + AUDIO = 4, + VIDEO = 5, + PCR = 6, + RECORD = 7, + TEMI = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsIndex.aidl new file mode 100644 index 0000000000..ed034779f9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsIndex.aidl @@ -0,0 +1,56 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxTsIndex { + FIRST_PACKET = 1, + PAYLOAD_UNIT_START_INDICATOR = 2, + CHANGE_TO_NOT_SCRAMBLED = 4, + CHANGE_TO_EVEN_SCRAMBLED = 8, + CHANGE_TO_ODD_SCRAMBLED = 16, + DISCONTINUITY_INDICATOR = 32, + RANDOM_ACCESS_INDICATOR = 64, + PRIORITY_INDICATOR = 128, + PCR_FLAG = 256, + OPCR_FLAG = 512, + SPLICING_POINT_FLAG = 1024, + PRIVATE_DATA = 2048, + ADAPTATION_EXTENSION_FLAG = 4096, + MPT_INDEX_MPT = 65536, + MPT_INDEX_VIDEO = 131072, + MPT_INDEX_AUDIO = 262144, + MPT_INDEX_TIMESTAMP_TARGET_VIDEO = 524288, + MPT_INDEX_TIMESTAMP_TARGET_AUDIO = 1048576, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DvrSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DvrSettings.aidl new file mode 100644 index 0000000000..26f864a08e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DvrSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DvrSettings { + android.hardware.tv.tuner.RecordSettings record; + android.hardware.tv.tuner.PlaybackSettings playback; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DvrType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DvrType.aidl new file mode 100644 index 0000000000..3a0c1e421e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DvrType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum DvrType { + RECORD = 0, + PLAYBACK = 1, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl new file mode 100644 index 0000000000..6b32110389 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAnalogAftFlag { + UNDEFINED = 0, + AFT_TRUE = 1, + AFT_FALSE = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl new file mode 100644 index 0000000000..46131be795 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAnalogCapabilities { + int typeCap; + int sifStandardCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogSettings.aidl new file mode 100644 index 0000000000..efb91ca5a4 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogSettings.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAnalogSettings { + int frequency; + int endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendAnalogType type = android.hardware.tv.tuner.FrontendAnalogType.UNDEFINED; + android.hardware.tv.tuner.FrontendAnalogAftFlag aftFlag = android.hardware.tv.tuner.FrontendAnalogAftFlag.UNDEFINED; + android.hardware.tv.tuner.FrontendAnalogSifStandard sifStandard = android.hardware.tv.tuner.FrontendAnalogSifStandard.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl new file mode 100644 index 0000000000..35025220ac --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl @@ -0,0 +1,57 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAnalogSifStandard { + UNDEFINED = 0, + AUTO = 1, + BG = 2, + BG_A2 = 4, + BG_NICAM = 8, + I = 16, + DK = 32, + DK1_A2 = 64, + DK2_A2 = 128, + DK3_A2 = 256, + DK_NICAM = 512, + L = 1024, + M = 2048, + M_BTSC = 4096, + M_A2 = 8192, + M_EIAJ = 16384, + I_NICAM = 32768, + L_NICAM = 65536, + L_PRIME = 131072, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogType.aidl new file mode 100644 index 0000000000..33fd93dc63 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogType.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAnalogType { + UNDEFINED = 0, + AUTO = 1, + PAL = 2, + PAL_M = 4, + PAL_N = 8, + PAL_60 = 16, + NTSC = 32, + NTSC_443 = 64, + SECAM = 128, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl new file mode 100644 index 0000000000..51a3fc5c50 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3Bandwidth { + UNDEFINED = 0, + AUTO = 1, + BANDWIDTH_6MHZ = 2, + BANDWIDTH_7MHZ = 4, + BANDWIDTH_8MHZ = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl new file mode 100644 index 0000000000..b2a25c7d49 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtsc3Capabilities { + int bandwidthCap; + int modulationCap; + int timeInterleaveModeCap; + int codeRateCap; + int fecCap; + byte demodOutputFormatCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl new file mode 100644 index 0000000000..aec07186a3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl @@ -0,0 +1,52 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3CodeRate { + UNDEFINED = 0, + AUTO = 1, + CODERATE_2_15 = 2, + CODERATE_3_15 = 4, + CODERATE_4_15 = 8, + CODERATE_5_15 = 16, + CODERATE_6_15 = 32, + CODERATE_7_15 = 64, + CODERATE_8_15 = 128, + CODERATE_9_15 = 256, + CODERATE_10_15 = 512, + CODERATE_11_15 = 1024, + CODERATE_12_15 = 2048, + CODERATE_13_15 = 4096, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl new file mode 100644 index 0000000000..8702a496c5 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum FrontendAtsc3DemodOutputFormat { + UNDEFINED = 0, + ATSC3_LINKLAYER_PACKET = 1, + BASEBAND_PACKET = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl new file mode 100644 index 0000000000..a2c140aa9f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3Fec { + UNDEFINED = 0, + AUTO = 1, + BCH_LDPC_16K = 2, + BCH_LDPC_64K = 4, + CRC_LDPC_16K = 8, + CRC_LDPC_64K = 16, + LDPC_16K = 32, + LDPC_64K = 64, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl new file mode 100644 index 0000000000..09e513d8aa --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3Modulation { + UNDEFINED = 0, + AUTO = 1, + MOD_QPSK = 2, + MOD_16QAM = 4, + MOD_64QAM = 8, + MOD_256QAM = 16, + MOD_1024QAM = 32, + MOD_4096QAM = 64, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl new file mode 100644 index 0000000000..b569c21da1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtsc3PlpSettings { + byte plpId; + android.hardware.tv.tuner.FrontendAtsc3Modulation modulation = android.hardware.tv.tuner.FrontendAtsc3Modulation.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode interleaveMode = android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3CodeRate codeRate = android.hardware.tv.tuner.FrontendAtsc3CodeRate.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3Fec fec = android.hardware.tv.tuner.FrontendAtsc3Fec.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl new file mode 100644 index 0000000000..bd96d14502 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtsc3Settings { + int frequency; + int endFrequency; + android.hardware.tv.tuner.FrontendAtsc3Bandwidth bandwidth = android.hardware.tv.tuner.FrontendAtsc3Bandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3DemodOutputFormat demodOutputFormat = android.hardware.tv.tuner.FrontendAtsc3DemodOutputFormat.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3PlpSettings[] plpSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl new file mode 100644 index 0000000000..a9747f0eb7 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3TimeInterleaveMode { + UNDEFINED = 0, + AUTO = 1, + CTI = 2, + HTI = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl new file mode 100644 index 0000000000..c24afae7b0 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtscCapabilities { + int modulationCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscModulation.aidl new file mode 100644 index 0000000000..426fe20739 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscModulation.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtscModulation { + UNDEFINED = 0, + AUTO = 1, + MOD_8VSB = 4, + MOD_16VSB = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscSettings.aidl new file mode 100644 index 0000000000..5ccdb85195 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscSettings.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtscSettings { + int frequency; + int endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendAtscModulation modulation = android.hardware.tv.tuner.FrontendAtscModulation.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendBandwidth.aidl new file mode 100644 index 0000000000..5355637422 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendBandwidth.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendBandwidth { + android.hardware.tv.tuner.FrontendAtsc3Bandwidth atsc3 = android.hardware.tv.tuner.FrontendAtsc3Bandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbcBandwidth dvbc; + android.hardware.tv.tuner.FrontendDvbtBandwidth dvbt; + android.hardware.tv.tuner.FrontendIsdbtBandwidth isdbt; + android.hardware.tv.tuner.FrontendDtmbBandwidth dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl new file mode 100644 index 0000000000..ff71df39cf --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendCableTimeInterleaveMode { + UNDEFINED = 0, + AUTO = 1, + INTERLEAVING_128_1_0 = 2, + INTERLEAVING_128_1_1 = 4, + INTERLEAVING_64_2 = 8, + INTERLEAVING_32_4 = 16, + INTERLEAVING_16_8 = 32, + INTERLEAVING_8_16 = 64, + INTERLEAVING_128_2 = 128, + INTERLEAVING_128_3 = 256, + INTERLEAVING_128_4 = 512, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendCapabilities.aidl new file mode 100644 index 0000000000..c013cd111a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendCapabilities.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendCapabilities { + android.hardware.tv.tuner.FrontendAnalogCapabilities analogCaps; + android.hardware.tv.tuner.FrontendAtscCapabilities atscCaps; + android.hardware.tv.tuner.FrontendAtsc3Capabilities atsc3Caps; + android.hardware.tv.tuner.FrontendDtmbCapabilities dtmbCaps; + android.hardware.tv.tuner.FrontendDvbsCapabilities dvbsCaps; + android.hardware.tv.tuner.FrontendDvbcCapabilities dvbcCaps; + android.hardware.tv.tuner.FrontendDvbtCapabilities dvbtCaps; + android.hardware.tv.tuner.FrontendIsdbsCapabilities isdbsCaps; + android.hardware.tv.tuner.FrontendIsdbs3Capabilities isdbs3Caps; + android.hardware.tv.tuner.FrontendIsdbtCapabilities isdbtCaps; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl new file mode 100644 index 0000000000..18d71d2a7f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbBandwidth { + UNDEFINED = 0, + AUTO = 1, + BANDWIDTH_8MHZ = 2, + BANDWIDTH_6MHZ = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl new file mode 100644 index 0000000000..8d35104e09 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDtmbCapabilities { + int transmissionModeCap; + int bandwidthCap; + int modulationCap; + int codeRateCap; + int guardIntervalCap; + int interleaveModeCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl new file mode 100644 index 0000000000..c9454e7506 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbCodeRate { + UNDEFINED = 0, + AUTO = 1, + CODERATE_2_5 = 2, + CODERATE_3_5 = 4, + CODERATE_4_5 = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl new file mode 100644 index 0000000000..872eb6ae1c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbGuardInterval { + UNDEFINED = 0, + AUTO = 1, + PN_420_VARIOUS = 2, + PN_595_CONST = 4, + PN_945_VARIOUS = 8, + PN_420_CONST = 16, + PN_945_CONST = 32, + PN_RESERVED = 64, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbModulation.aidl new file mode 100644 index 0000000000..088aac5e50 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbModulation.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbModulation { + UNDEFINED = 0, + AUTO = 1, + CONSTELLATION_4QAM = 2, + CONSTELLATION_4QAM_NR = 4, + CONSTELLATION_16QAM = 8, + CONSTELLATION_32QAM = 16, + CONSTELLATION_64QAM = 32, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbSettings.aidl new file mode 100644 index 0000000000..9a2e341b2a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbSettings.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDtmbSettings { + int frequency; + int endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbTransmissionMode transmissionMode = android.hardware.tv.tuner.FrontendDtmbTransmissionMode.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbBandwidth bandwidth = android.hardware.tv.tuner.FrontendDtmbBandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbModulation modulation = android.hardware.tv.tuner.FrontendDtmbModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbCodeRate codeRate = android.hardware.tv.tuner.FrontendDtmbCodeRate.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbGuardInterval guardInterval = android.hardware.tv.tuner.FrontendDtmbGuardInterval.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbTimeInterleaveMode interleaveMode = android.hardware.tv.tuner.FrontendDtmbTimeInterleaveMode.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl new file mode 100644 index 0000000000..8321ad0ebc --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbTimeInterleaveMode { + UNDEFINED = 0, + AUTO = 1, + TIMER_INT_240 = 2, + TIMER_INT_720 = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl new file mode 100644 index 0000000000..5298291cd2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbTransmissionMode { + UNDEFINED = 0, + AUTO = 1, + C1 = 2, + C3780 = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl new file mode 100644 index 0000000000..cdfedb6702 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum FrontendDvbcAnnex { + UNDEFINED = 0, + A = 1, + B = 2, + C = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl new file mode 100644 index 0000000000..f0fe460d68 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbcBandwidth { + UNDEFINED = 0, + BANDWIDTH_5MHZ = 1, + BANDWIDTH_6MHZ = 2, + BANDWIDTH_7MHZ = 4, + BANDWIDTH_8MHZ = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl new file mode 100644 index 0000000000..0c0e3ee5d0 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbcCapabilities { + int modulationCap; + long fecCap; + byte annexCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcModulation.aidl new file mode 100644 index 0000000000..0871777509 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcModulation.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbcModulation { + UNDEFINED = 0, + AUTO = 1, + MOD_16QAM = 2, + MOD_32QAM = 4, + MOD_64QAM = 8, + MOD_128QAM = 16, + MOD_256QAM = 32, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl new file mode 100644 index 0000000000..f1e92c9d5a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbcOuterFec { + UNDEFINED = 0, + OUTER_FEC_NONE = 1, + OUTER_FEC_RS = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcSettings.aidl new file mode 100644 index 0000000000..55f04029f2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcSettings.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbcSettings { + int frequency; + int endFrequency; + android.hardware.tv.tuner.FrontendDvbcModulation modulation = android.hardware.tv.tuner.FrontendDvbcModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendInnerFec fec = android.hardware.tv.tuner.FrontendInnerFec.FEC_UNDEFINED; + int symbolRate; + android.hardware.tv.tuner.FrontendDvbcOuterFec outerFec = android.hardware.tv.tuner.FrontendDvbcOuterFec.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbcAnnex annex = android.hardware.tv.tuner.FrontendDvbcAnnex.UNDEFINED; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendCableTimeInterleaveMode interleaveMode = android.hardware.tv.tuner.FrontendCableTimeInterleaveMode.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbcBandwidth bandwidth = android.hardware.tv.tuner.FrontendDvbcBandwidth.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl new file mode 100644 index 0000000000..43e8aee23b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbsCapabilities { + int modulationCap; + long innerfecCap; + byte standard; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl new file mode 100644 index 0000000000..4c3d4e466a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbsCodeRate { + android.hardware.tv.tuner.FrontendInnerFec fec = android.hardware.tv.tuner.FrontendInnerFec.FEC_UNDEFINED; + boolean isLinear; + boolean isShortFrames; + int bitsPer1000Symbol; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsModulation.aidl new file mode 100644 index 0000000000..25951ccecb --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsModulation.aidl @@ -0,0 +1,53 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsModulation { + UNDEFINED = 0, + AUTO = 1, + MOD_QPSK = 2, + MOD_8PSK = 4, + MOD_16QAM = 8, + MOD_16PSK = 16, + MOD_32PSK = 32, + MOD_ACM = 64, + MOD_8APSK = 128, + MOD_16APSK = 256, + MOD_32APSK = 512, + MOD_64APSK = 1024, + MOD_128APSK = 2048, + MOD_256APSK = 4096, + MOD_RESERVED = 8192, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsPilot.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsPilot.aidl new file mode 100644 index 0000000000..4f2c6eb8d7 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsPilot.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsPilot { + UNDEFINED = 0, + ON = 1, + OFF = 2, + AUTO = 3, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl new file mode 100644 index 0000000000..56ee37b613 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsRolloff { + UNDEFINED = 0, + ROLLOFF_0_35 = 1, + ROLLOFF_0_25 = 2, + ROLLOFF_0_20 = 3, + ROLLOFF_0_15 = 4, + ROLLOFF_0_10 = 5, + ROLLOFF_0_5 = 6, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsScanType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsScanType.aidl new file mode 100644 index 0000000000..110b1d8b1f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsScanType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsScanType { + UNDEFINED = 0, + DIRECT = 1, + DISEQC = 2, + UNICABLE = 3, + JESS = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsSettings.aidl new file mode 100644 index 0000000000..8a8c76f7f6 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsSettings.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbsSettings { + int frequency; + int endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsModulation modulation = android.hardware.tv.tuner.FrontendDvbsModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsCodeRate coderate; + int symbolRate; + android.hardware.tv.tuner.FrontendDvbsRolloff rolloff = android.hardware.tv.tuner.FrontendDvbsRolloff.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsPilot pilot = android.hardware.tv.tuner.FrontendDvbsPilot.UNDEFINED; + int inputStreamId; + android.hardware.tv.tuner.FrontendDvbsStandard standard = android.hardware.tv.tuner.FrontendDvbsStandard.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsVcmMode vcmMode = android.hardware.tv.tuner.FrontendDvbsVcmMode.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsScanType scanType = android.hardware.tv.tuner.FrontendDvbsScanType.UNDEFINED; + boolean isDiseqcRxMessage; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsStandard.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsStandard.aidl new file mode 100644 index 0000000000..b9cb657fb5 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsStandard.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum FrontendDvbsStandard { + UNDEFINED = 0, + AUTO = 1, + S = 2, + S2 = 4, + S2X = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl new file mode 100644 index 0000000000..2cbff7cc1b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsVcmMode { + UNDEFINED = 0, + AUTO = 1, + MANUAL = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl new file mode 100644 index 0000000000..f5d14e898b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtBandwidth { + UNDEFINED = 0, + AUTO = 1, + BANDWIDTH_8MHZ = 2, + BANDWIDTH_7MHZ = 4, + BANDWIDTH_6MHZ = 8, + BANDWIDTH_5MHZ = 16, + BANDWIDTH_1_7MHZ = 32, + BANDWIDTH_10MHZ = 64, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl new file mode 100644 index 0000000000..a0e6ce2710 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbtCapabilities { + int transmissionModeCap; + int bandwidthCap; + int constellationCap; + int coderateCap; + int hierarchyCap; + int guardIntervalCap; + boolean isT2Supported; + boolean isMisoSupported; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl new file mode 100644 index 0000000000..8bd0489a6e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtCoderate { + UNDEFINED = 0, + AUTO = 1, + CODERATE_1_2 = 2, + CODERATE_2_3 = 4, + CODERATE_3_4 = 8, + CODERATE_5_6 = 16, + CODERATE_7_8 = 32, + CODERATE_3_5 = 64, + CODERATE_4_5 = 128, + CODERATE_6_7 = 256, + CODERATE_8_9 = 512, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl new file mode 100644 index 0000000000..bc40901de4 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtConstellation { + UNDEFINED = 0, + AUTO = 1, + CONSTELLATION_QPSK = 2, + CONSTELLATION_16QAM = 4, + CONSTELLATION_64QAM = 8, + CONSTELLATION_256QAM = 16, + CONSTELLATION_QPSK_R = 32, + CONSTELLATION_16QAM_R = 64, + CONSTELLATION_64QAM_R = 128, + CONSTELLATION_256QAM_R = 256, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl new file mode 100644 index 0000000000..073a77e2b8 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtGuardInterval { + UNDEFINED = 0, + AUTO = 1, + INTERVAL_1_32 = 2, + INTERVAL_1_16 = 4, + INTERVAL_1_8 = 8, + INTERVAL_1_4 = 16, + INTERVAL_1_128 = 32, + INTERVAL_19_128 = 64, + INTERVAL_19_256 = 128, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl new file mode 100644 index 0000000000..9ed5c8ceae --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtHierarchy { + UNDEFINED = 0, + AUTO = 1, + HIERARCHY_NON_NATIVE = 2, + HIERARCHY_1_NATIVE = 4, + HIERARCHY_2_NATIVE = 8, + HIERARCHY_4_NATIVE = 16, + HIERARCHY_NON_INDEPTH = 32, + HIERARCHY_1_INDEPTH = 64, + HIERARCHY_2_INDEPTH = 128, + HIERARCHY_4_INDEPTH = 256, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl new file mode 100644 index 0000000000..c80bc2aa5a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtPlpMode { + UNDEFINED = 0, + AUTO = 1, + MANUAL = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtSettings.aidl new file mode 100644 index 0000000000..cc64549a47 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtSettings.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbtSettings { + int frequency; + int endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtTransmissionMode transmissionMode = android.hardware.tv.tuner.FrontendDvbtTransmissionMode.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtBandwidth bandwidth = android.hardware.tv.tuner.FrontendDvbtBandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtConstellation constellation = android.hardware.tv.tuner.FrontendDvbtConstellation.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtHierarchy hierarchy = android.hardware.tv.tuner.FrontendDvbtHierarchy.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtCoderate hpCoderate = android.hardware.tv.tuner.FrontendDvbtCoderate.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtCoderate lpCoderate = android.hardware.tv.tuner.FrontendDvbtCoderate.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtGuardInterval guardInterval = android.hardware.tv.tuner.FrontendDvbtGuardInterval.UNDEFINED; + boolean isHighPriority; + android.hardware.tv.tuner.FrontendDvbtStandard standard = android.hardware.tv.tuner.FrontendDvbtStandard.UNDEFINED; + boolean isMiso; + android.hardware.tv.tuner.FrontendDvbtPlpMode plpMode = android.hardware.tv.tuner.FrontendDvbtPlpMode.UNDEFINED; + byte plpId; + byte plpGroupId; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtStandard.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtStandard.aidl new file mode 100644 index 0000000000..c7ba68abc6 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtStandard.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum FrontendDvbtStandard { + UNDEFINED = 0, + AUTO = 1, + T = 2, + T2 = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl new file mode 100644 index 0000000000..e3ca2e3901 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtTransmissionMode { + UNDEFINED = 0, + AUTO = 1, + MODE_2K = 2, + MODE_8K = 4, + MODE_4K = 8, + MODE_1K = 16, + MODE_16K = 32, + MODE_32K = 64, + MODE_8K_E = 128, + MODE_16K_E = 256, + MODE_32K_E = 512, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendEventType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendEventType.aidl new file mode 100644 index 0000000000..443313fead --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendEventType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendEventType { + LOCKED = 0, + NO_SIGNAL = 1, + LOST_LOCK = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendGuardInterval.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendGuardInterval.aidl new file mode 100644 index 0000000000..3d9963316d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendGuardInterval.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendGuardInterval { + android.hardware.tv.tuner.FrontendDvbtGuardInterval dvbt = android.hardware.tv.tuner.FrontendDvbtGuardInterval.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtGuardInterval isdbt; + android.hardware.tv.tuner.FrontendDtmbGuardInterval dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInfo.aidl new file mode 100644 index 0000000000..2f8e6e5bd0 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInfo.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendInfo { + android.hardware.tv.tuner.FrontendType type = android.hardware.tv.tuner.FrontendType.UNDEFINED; + int minFrequency; + int maxFrequency; + int minSymbolRate; + int maxSymbolRate; + int acquireRange; + int exclusiveGroupId; + android.hardware.tv.tuner.FrontendStatusType[] statusCaps; + android.hardware.tv.tuner.FrontendCapabilities frontendCaps; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInnerFec.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInnerFec.aidl new file mode 100644 index 0000000000..19599a3f82 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInnerFec.aidl @@ -0,0 +1,92 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="long") @VintfStability +enum FrontendInnerFec { + FEC_UNDEFINED = 0, + AUTO = 1, + FEC_1_2 = 2, + FEC_1_3 = 4, + FEC_1_4 = 8, + FEC_1_5 = 16, + FEC_2_3 = 32, + FEC_2_5 = 64, + FEC_2_9 = 128, + FEC_3_4 = 256, + FEC_3_5 = 512, + FEC_4_5 = 1024, + FEC_4_15 = 2048, + FEC_5_6 = 4096, + FEC_5_9 = 8192, + FEC_6_7 = 16384, + FEC_7_8 = 32768, + FEC_7_9 = 65536, + FEC_7_15 = 131072, + FEC_8_9 = 262144, + FEC_8_15 = 524288, + FEC_9_10 = 1048576, + FEC_9_20 = 2097152, + FEC_11_15 = 4194304, + FEC_11_20 = 8388608, + FEC_11_45 = 16777216, + FEC_13_18 = 33554432, + FEC_13_45 = 67108864, + FEC_14_45 = 134217728, + FEC_23_36 = 268435456, + FEC_25_36 = 536870912, + FEC_26_45 = 1073741824, + FEC_28_45 = 2147483648, + FEC_29_45 = 4294967296, + FEC_31_45 = 8589934592, + FEC_32_45 = 17179869184, + FEC_77_90 = 34359738368, + FEC_2_15 = 68719476736, + FEC_3_15 = 137438953472, + FEC_5_15 = 274877906944, + FEC_6_15 = 549755813888, + FEC_9_15 = 1099511627776, + FEC_10_15 = 2199023255552, + FEC_12_15 = 4398046511104, + FEC_13_15 = 8796093022208, + FEC_18_30 = 17592186044416, + FEC_20_30 = 35184372088832, + FEC_90_180 = 70368744177664, + FEC_96_180 = 140737488355328, + FEC_104_180 = 281474976710656, + FEC_128_180 = 562949953421312, + FEC_132_180 = 1125899906842624, + FEC_135_180 = 2251799813685248, + FEC_140_180 = 4503599627370496, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInterleaveMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInterleaveMode.aidl new file mode 100644 index 0000000000..5e037318df --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInterleaveMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendInterleaveMode { + android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode atsc3 = android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode.UNDEFINED; + android.hardware.tv.tuner.FrontendCableTimeInterleaveMode dvbc; + android.hardware.tv.tuner.FrontendDtmbTimeInterleaveMode dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl new file mode 100644 index 0000000000..4be37c2006 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbs3Capabilities { + int modulationCap; + int coderateCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl new file mode 100644 index 0000000000..1ee7f07e71 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbs3Coderate { + UNDEFINED = 0, + AUTO = 1, + CODERATE_1_3 = 2, + CODERATE_2_5 = 4, + CODERATE_1_2 = 8, + CODERATE_3_5 = 16, + CODERATE_2_3 = 32, + CODERATE_3_4 = 64, + CODERATE_7_9 = 128, + CODERATE_4_5 = 256, + CODERATE_5_6 = 512, + CODERATE_7_8 = 1024, + CODERATE_9_10 = 2048, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl new file mode 100644 index 0000000000..3603292eca --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbs3Modulation { + UNDEFINED = 0, + AUTO = 1, + MOD_BPSK = 2, + MOD_QPSK = 4, + MOD_8PSK = 8, + MOD_16APSK = 16, + MOD_32APSK = 32, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl new file mode 100644 index 0000000000..733760c471 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbs3Rolloff { + UNDEFINED = 0, + ROLLOFF_0_03 = 1, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl new file mode 100644 index 0000000000..b96bf32f2a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbs3Settings { + int frequency; + int endFrequency; + char streamId; + android.hardware.tv.tuner.FrontendIsdbsStreamIdType streamIdType = android.hardware.tv.tuner.FrontendIsdbsStreamIdType.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbs3Modulation modulation = android.hardware.tv.tuner.FrontendIsdbs3Modulation.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbs3Coderate coderate = android.hardware.tv.tuner.FrontendIsdbs3Coderate.UNDEFINED; + int symbolRate; + android.hardware.tv.tuner.FrontendIsdbs3Rolloff rolloff = android.hardware.tv.tuner.FrontendIsdbs3Rolloff.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl new file mode 100644 index 0000000000..2cb892cd3d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbsCapabilities { + int modulationCap; + int coderateCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl new file mode 100644 index 0000000000..09e9c5902d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbsCoderate { + UNDEFINED = 0, + AUTO = 1, + CODERATE_1_2 = 2, + CODERATE_2_3 = 4, + CODERATE_3_4 = 8, + CODERATE_5_6 = 16, + CODERATE_7_8 = 32, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl new file mode 100644 index 0000000000..7b9bde66dd --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbsModulation { + UNDEFINED = 0, + AUTO = 1, + MOD_BPSK = 2, + MOD_QPSK = 4, + MOD_TC8PSK = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl new file mode 100644 index 0000000000..a2ab154661 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbsRolloff { + UNDEFINED = 0, + ROLLOFF_0_35 = 1, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl new file mode 100644 index 0000000000..0b48ac5a3d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbsSettings { + int frequency; + int endFrequency; + char streamId; + android.hardware.tv.tuner.FrontendIsdbsStreamIdType streamIdType = android.hardware.tv.tuner.FrontendIsdbsStreamIdType.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbsModulation modulation = android.hardware.tv.tuner.FrontendIsdbsModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbsCoderate coderate = android.hardware.tv.tuner.FrontendIsdbsCoderate.UNDEFINED; + int symbolRate; + android.hardware.tv.tuner.FrontendIsdbsRolloff rolloff = android.hardware.tv.tuner.FrontendIsdbsRolloff.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl new file mode 100644 index 0000000000..089f611e9c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbsStreamIdType { + STREAM_ID = 0, + RELATIVE_STREAM_NUMBER = 1, + UNDEFINED = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl new file mode 100644 index 0000000000..cd492142a9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtBandwidth { + UNDEFINED = 0, + AUTO = 1, + BANDWIDTH_8MHZ = 2, + BANDWIDTH_7MHZ = 4, + BANDWIDTH_6MHZ = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl new file mode 100644 index 0000000000..097fcb89b3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbtCapabilities { + int modeCap; + int bandwidthCap; + int modulationCap; + int coderateCap; + int guardIntervalCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl new file mode 100644 index 0000000000..2b747edbbd --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtCoderate { + UNDEFINED = 0, + AUTO = 1, + CODERATE_1_2 = 2, + CODERATE_2_3 = 4, + CODERATE_3_4 = 8, + CODERATE_5_6 = 16, + CODERATE_7_8 = 32, + CODERATE_3_5 = 64, + CODERATE_4_5 = 128, + CODERATE_6_7 = 256, + CODERATE_8_9 = 512, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl new file mode 100644 index 0000000000..42a023adc9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtGuardInterval { + UNDEFINED = 0, + AUTO = 1, + INTERVAL_1_32 = 2, + INTERVAL_1_16 = 4, + INTERVAL_1_8 = 8, + INTERVAL_1_4 = 16, + INTERVAL_1_128 = 32, + INTERVAL_19_128 = 64, + INTERVAL_19_256 = 128, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtMode.aidl new file mode 100644 index 0000000000..54698abb53 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtMode.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtMode { + UNDEFINED = 0, + AUTO = 1, + MODE_1 = 2, + MODE_2 = 4, + MODE_3 = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl new file mode 100644 index 0000000000..a31e0cf7b0 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtModulation { + UNDEFINED = 0, + AUTO = 1, + MOD_DQPSK = 2, + MOD_QPSK = 4, + MOD_16QAM = 8, + MOD_64QAM = 16, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl new file mode 100644 index 0000000000..5fcdf3638d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbtSettings { + int frequency; + int endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtModulation modulation = android.hardware.tv.tuner.FrontendIsdbtModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtBandwidth bandwidth = android.hardware.tv.tuner.FrontendIsdbtBandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtMode mode = android.hardware.tv.tuner.FrontendIsdbtMode.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtCoderate coderate = android.hardware.tv.tuner.FrontendDvbtCoderate.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtGuardInterval guardInterval = android.hardware.tv.tuner.FrontendDvbtGuardInterval.UNDEFINED; + int serviceAreaId; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendModulation.aidl new file mode 100644 index 0000000000..6e396b0422 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendModulation.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendModulation { + android.hardware.tv.tuner.FrontendDvbcModulation dvbc = android.hardware.tv.tuner.FrontendDvbcModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsModulation dvbs; + android.hardware.tv.tuner.FrontendDvbtConstellation dvbt; + android.hardware.tv.tuner.FrontendIsdbsModulation isdbs; + android.hardware.tv.tuner.FrontendIsdbs3Modulation isdbs3; + android.hardware.tv.tuner.FrontendIsdbtModulation isdbt; + android.hardware.tv.tuner.FrontendAtscModulation atsc; + android.hardware.tv.tuner.FrontendAtsc3Modulation atsc3; + android.hardware.tv.tuner.FrontendDtmbModulation dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendModulationStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendModulationStatus.aidl new file mode 100644 index 0000000000..723fdd044b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendModulationStatus.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendModulationStatus { + android.hardware.tv.tuner.FrontendDvbcModulation dvbc = android.hardware.tv.tuner.FrontendDvbcModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsModulation dvbs; + android.hardware.tv.tuner.FrontendIsdbsModulation isdbs; + android.hardware.tv.tuner.FrontendIsdbs3Modulation isdbs3; + android.hardware.tv.tuner.FrontendIsdbtModulation isdbt; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendRollOff.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendRollOff.aidl new file mode 100644 index 0000000000..c5f8b8e8b7 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendRollOff.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendRollOff { + android.hardware.tv.tuner.FrontendDvbsRolloff dvbs = android.hardware.tv.tuner.FrontendDvbsRolloff.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbsRolloff isdbs; + android.hardware.tv.tuner.FrontendIsdbs3Rolloff isdbs3; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl new file mode 100644 index 0000000000..4e217ef8f3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendScanAtsc3PlpInfo { + byte plpId; + boolean bLlsFlag; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl new file mode 100644 index 0000000000..882bdadf83 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl @@ -0,0 +1,53 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendScanMessage { + boolean isLocked; + boolean isEnd; + byte progressPercent; + int[] frequencies; + int[] symbolRates; + android.hardware.tv.tuner.FrontendDvbtHierarchy hierarchy; + android.hardware.tv.tuner.FrontendAnalogType analogType; + byte[] plpIds; + byte[] groupIds; + char[] inputStreamIds; + android.hardware.tv.tuner.FrontendScanMessageStandard std; + android.hardware.tv.tuner.FrontendScanAtsc3PlpInfo[] atsc3PlpInfos; + android.hardware.tv.tuner.FrontendModulation modulation; + android.hardware.tv.tuner.FrontendDvbcAnnex annex; + boolean isHighPriority; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl new file mode 100644 index 0000000000..e163fc6670 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendScanMessageStandard { + android.hardware.tv.tuner.FrontendDvbsStandard sStd = android.hardware.tv.tuner.FrontendDvbsStandard.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtStandard tStd; + android.hardware.tv.tuner.FrontendAnalogSifStandard sifStd; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl new file mode 100644 index 0000000000..b121c8513a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl @@ -0,0 +1,53 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendScanMessageType { + LOCKED = 0, + END = 1, + PROGRESS_PERCENT = 2, + FREQUENCY = 3, + SYMBOL_RATE = 4, + HIERARCHY = 5, + ANALOG_TYPE = 6, + PLP_IDS = 7, + GROUP_IDS = 8, + INPUT_STREAM_IDS = 9, + STANDARD = 10, + ATSC3_PLP_INFO = 11, + MODULATION = 12, + DVBC_ANNEX = 13, + HIGH_PRIORITY = 14, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanType.aidl new file mode 100644 index 0000000000..ed42d0aac9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendScanType { + SCAN_UNDEFINED = 0, + SCAN_AUTO = 1, + SCAN_BLIND = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSettings.aidl new file mode 100644 index 0000000000..7eae9df379 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSettings.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendSettings { + android.hardware.tv.tuner.FrontendAnalogSettings analog; + android.hardware.tv.tuner.FrontendAtscSettings atsc; + android.hardware.tv.tuner.FrontendAtsc3Settings atsc3; + android.hardware.tv.tuner.FrontendDvbsSettings dvbs; + android.hardware.tv.tuner.FrontendDvbcSettings dvbc; + android.hardware.tv.tuner.FrontendDvbtSettings dvbt; + android.hardware.tv.tuner.FrontendIsdbsSettings isdbs; + android.hardware.tv.tuner.FrontendIsdbs3Settings isdbs3; + android.hardware.tv.tuner.FrontendIsdbtSettings isdbt; + android.hardware.tv.tuner.FrontendDtmbSettings dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSpectralInversion.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSpectralInversion.aidl new file mode 100644 index 0000000000..ff11bb8dab --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendSpectralInversion.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendSpectralInversion { + UNDEFINED = 0, + NORMAL = 1, + INVERTED = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl new file mode 100644 index 0000000000..114b72f940 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl @@ -0,0 +1,75 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendStatus { + boolean isDemodLocked; + int snr; + int ber; + int per; + int preBer; + int signalQuality; + int signalStrength; + int symbolRate; + android.hardware.tv.tuner.FrontendInnerFec innerFec; + android.hardware.tv.tuner.FrontendModulationStatus modulationStatus; + android.hardware.tv.tuner.FrontendSpectralInversion inversion; + android.hardware.tv.tuner.LnbVoltage lnbVoltage; + byte plpId; + boolean isEWBS; + byte agc; + boolean isLnaOn; + boolean[] isLayerError; + int mer; + int freqOffset; + android.hardware.tv.tuner.FrontendDvbtHierarchy hierarchy; + boolean isRfLocked; + android.hardware.tv.tuner.FrontendStatusAtsc3PlpInfo[] plpInfo; + android.hardware.tv.tuner.FrontendModulation[] modulations; + int[] bers; + android.hardware.tv.tuner.FrontendInnerFec[] codeRates; + android.hardware.tv.tuner.FrontendBandwidth bandwidth; + android.hardware.tv.tuner.FrontendGuardInterval interval; + android.hardware.tv.tuner.FrontendTransmissionMode transmissionMode; + int uec; + char systemId; + android.hardware.tv.tuner.FrontendInterleaveMode[] interleaving; + byte[] isdbtSegment; + int[] tsDataRate; + android.hardware.tv.tuner.FrontendRollOff rollOff; + boolean isMiso; + boolean isLinear; + boolean isShortFrames; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl new file mode 100644 index 0000000000..9cd1b8a8f9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendStatusAtsc3PlpInfo { + byte plpId; + boolean isLocked; + int uec; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl new file mode 100644 index 0000000000..7b8bc47c3d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl @@ -0,0 +1,75 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendStatusType { + DEMOD_LOCK = 0, + SNR = 1, + BER = 2, + PER = 3, + PRE_BER = 4, + SIGNAL_QUALITY = 5, + SIGNAL_STRENGTH = 6, + SYMBOL_RATE = 7, + FEC = 8, + MODULATION = 9, + SPECTRAL = 10, + LNB_VOLTAGE = 11, + PLP_ID = 12, + EWBS = 13, + AGC = 14, + LNA = 15, + LAYER_ERROR = 16, + MER = 17, + FREQ_OFFSET = 18, + HIERARCHY = 19, + RF_LOCK = 20, + ATSC3_PLP_INFO = 21, + MODULATIONS = 22, + BERS = 23, + CODERATES = 24, + BANDWIDTH = 25, + GUARD_INTERVAL = 26, + TRANSMISSION_MODE = 27, + UEC = 28, + T2_SYSTEM_ID = 29, + INTERLEAVINGS = 30, + ISDBT_SEGMENTS = 31, + TS_DATA_RATES = 32, + ROLL_OFF = 33, + IS_MISO = 34, + IS_LINEAR = 35, + IS_SHORT_FRAMES = 36, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendTransmissionMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendTransmissionMode.aidl new file mode 100644 index 0000000000..72c36419ec --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendTransmissionMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendTransmissionMode { + android.hardware.tv.tuner.FrontendDvbtTransmissionMode dvbt = android.hardware.tv.tuner.FrontendDvbtTransmissionMode.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtMode isdbt; + android.hardware.tv.tuner.FrontendDtmbTransmissionMode dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendType.aidl new file mode 100644 index 0000000000..99a120bcb3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendType.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendType { + UNDEFINED = 0, + ANALOG = 1, + ATSC = 2, + ATSC3 = 3, + DVBC = 4, + DVBS = 5, + DVBT = 6, + ISDBS = 7, + ISDBS3 = 8, + ISDBT = 9, + DTMB = 10, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDemux.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDemux.aidl new file mode 100644 index 0000000000..59ec92ba3b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDemux.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IDemux { + void setFrontendDataSource(in int frontendId); + android.hardware.tv.tuner.IFilter openFilter(in android.hardware.tv.tuner.DemuxFilterType type, in int bufferSize, in android.hardware.tv.tuner.IFilterCallback cb); + android.hardware.tv.tuner.ITimeFilter openTimeFilter(); + int getAvSyncHwId(in android.hardware.tv.tuner.IFilter filter); + long getAvSyncTime(in int avSyncHwId); + void close(); + android.hardware.tv.tuner.IDvr openDvr(in android.hardware.tv.tuner.DvrType type, in int bufferSize, in android.hardware.tv.tuner.IDvrCallback cb); + void connectCiCam(in int ciCamId); + void disconnectCiCam(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDescrambler.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDescrambler.aidl new file mode 100644 index 0000000000..3cf3c044ba --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDescrambler.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IDescrambler { + void setDemuxSource(in int demuxId); + void setKeyToken(in byte[] keyToken); + void addPid(in android.hardware.tv.tuner.DemuxPid pid, in android.hardware.tv.tuner.IFilter optionalSourceFilter); + void removePid(in android.hardware.tv.tuner.DemuxPid pid, in android.hardware.tv.tuner.IFilter optionalSourceFilter); + void close(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDvr.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDvr.aidl new file mode 100644 index 0000000000..450cd79129 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDvr.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IDvr { + void getQueueDesc(out android.hardware.common.fmq.MQDescriptor queue); + void configure(in android.hardware.tv.tuner.DvrSettings settings); + void attachFilter(in android.hardware.tv.tuner.IFilter filter); + void detachFilter(in android.hardware.tv.tuner.IFilter filter); + void start(); + void stop(); + void flush(); + void close(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDvrCallback.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDvrCallback.aidl new file mode 100644 index 0000000000..13c8644b7b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IDvrCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IDvrCallback { + oneway void onPlaybackStatus(in android.hardware.tv.tuner.PlaybackStatus status); + oneway void onRecordStatus(in android.hardware.tv.tuner.RecordStatus status); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFilter.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFilter.aidl new file mode 100644 index 0000000000..a0454f436a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFilter.aidl @@ -0,0 +1,52 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IFilter { + void getQueueDesc(out android.hardware.common.fmq.MQDescriptor queue); + void close(); + void configure(in android.hardware.tv.tuner.DemuxFilterSettings settings); + void configureAvStreamType(in android.hardware.tv.tuner.AvStreamType avStreamType); + void configureIpCid(in int ipCid); + void configureMonitorEvent(in int monitorEventTypes); + void start(); + void stop(); + void flush(); + long getAvSharedHandle(out android.hardware.common.NativeHandle avMemory); + int getId(); + long getId64Bit(); + void releaseAvHandle(in android.hardware.common.NativeHandle avMemory, in long avDataId); + void setDataSource(in android.hardware.tv.tuner.IFilter filter); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFilterCallback.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFilterCallback.aidl new file mode 100644 index 0000000000..d8bedba451 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFilterCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IFilterCallback { + oneway void onFilterEvent(in android.hardware.tv.tuner.DemuxFilterEvent[] events); + oneway void onFilterStatus(in android.hardware.tv.tuner.DemuxFilterStatus status); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl new file mode 100644 index 0000000000..ed5b0c02c7 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IFrontend { + void setCallback(in android.hardware.tv.tuner.IFrontendCallback callback); + void tune(in android.hardware.tv.tuner.FrontendSettings settings); + void stopTune(); + void close(); + void scan(in android.hardware.tv.tuner.FrontendSettings settings, in android.hardware.tv.tuner.FrontendScanType type); + void stopScan(); + android.hardware.tv.tuner.FrontendStatus[] getStatus(in android.hardware.tv.tuner.FrontendStatusType[] statusTypes); + void setLnb(in int lnbId); + void setLna(in boolean bEnable); + int linkCiCam(in int ciCamId); + void unlinkCiCam(in int ciCamId); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontendCallback.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontendCallback.aidl new file mode 100644 index 0000000000..c22d280834 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontendCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IFrontendCallback { + oneway void onEvent(in android.hardware.tv.tuner.FrontendEventType frontendEventType); + oneway void onScanMessage(in android.hardware.tv.tuner.FrontendScanMessageType type, in android.hardware.tv.tuner.FrontendScanMessage message); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ILnb.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ILnb.aidl new file mode 100644 index 0000000000..c3fdd87e62 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ILnb.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface ILnb { + void setCallback(in android.hardware.tv.tuner.ILnbCallback callback); + void setVoltage(in android.hardware.tv.tuner.LnbVoltage voltage); + void setTone(in android.hardware.tv.tuner.LnbTone tone); + void setSatellitePosition(in android.hardware.tv.tuner.LnbPosition position); + void sendDiseqcMessage(in byte[] diseqcMessage); + void close(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ILnbCallback.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ILnbCallback.aidl new file mode 100644 index 0000000000..42e84da4d1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ILnbCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface ILnbCallback { + oneway void onDiseqcMessage(in byte[] diseqcMessage); + oneway void onEvent(in android.hardware.tv.tuner.LnbEventType lnbEventType); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITimeFilter.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITimeFilter.aidl new file mode 100644 index 0000000000..838eeba1d2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITimeFilter.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface ITimeFilter { + void setTimeStamp(in long timeStamp); + void clearTimeStamp(); + long getTimeStamp(); + long getSourceTime(); + void close(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl new file mode 100644 index 0000000000..0e903d8a36 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@SuppressWarnings(value={"out-array"}) @VintfStability +interface ITuner { + int[] getFrontendIds(); + android.hardware.tv.tuner.IFrontend openFrontendById(in int frontendId); + android.hardware.tv.tuner.IDemux openDemux(out int[] demuxId); + android.hardware.tv.tuner.DemuxCapabilities getDemuxCaps(); + android.hardware.tv.tuner.IDescrambler openDescrambler(); + android.hardware.tv.tuner.FrontendInfo getFrontendInfo(in int frontendId); + int[] getLnbIds(); + android.hardware.tv.tuner.ILnb openLnbById(in int lnbId); + android.hardware.tv.tuner.ILnb openLnbByName(in String lnbName, out int[] lnbId); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbEventType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbEventType.aidl new file mode 100644 index 0000000000..e6e2b0548b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbEventType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum LnbEventType { + DISEQC_RX_OVERFLOW = 0, + DISEQC_RX_TIMEOUT = 1, + DISEQC_RX_PARITY_ERROR = 2, + LNB_OVERLOAD = 3, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbPosition.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbPosition.aidl new file mode 100644 index 0000000000..5fc4d152d2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbPosition.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum LnbPosition { + UNDEFINED = 0, + POSITION_A = 1, + POSITION_B = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbTone.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbTone.aidl new file mode 100644 index 0000000000..3217de99ff --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbTone.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum LnbTone { + NONE = 0, + CONTINUOUS = 1, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbVoltage.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbVoltage.aidl new file mode 100644 index 0000000000..034c7e6a6e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/LnbVoltage.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum LnbVoltage { + NONE = 0, + VOLTAGE_5V = 1, + VOLTAGE_11V = 2, + VOLTAGE_12V = 3, + VOLTAGE_13V = 4, + VOLTAGE_14V = 5, + VOLTAGE_15V = 6, + VOLTAGE_18V = 7, + VOLTAGE_19V = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/PlaybackSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/PlaybackSettings.aidl new file mode 100644 index 0000000000..ff459e227f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/PlaybackSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable PlaybackSettings { + int statusMask; + int lowThreshold; + int highThreshold; + android.hardware.tv.tuner.DataFormat dataFormat = android.hardware.tv.tuner.DataFormat.UNDEFINED; + byte packetSize; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/PlaybackStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/PlaybackStatus.aidl new file mode 100644 index 0000000000..850b737559 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/PlaybackStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum PlaybackStatus { + SPACE_EMPTY = 1, + SPACE_ALMOST_EMPTY = 2, + SPACE_ALMOST_FULL = 4, + SPACE_FULL = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/RecordSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/RecordSettings.aidl new file mode 100644 index 0000000000..447de9871d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/RecordSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable RecordSettings { + int statusMask; + int lowThreshold; + int highThreshold; + android.hardware.tv.tuner.DataFormat dataFormat = android.hardware.tv.tuner.DataFormat.UNDEFINED; + byte packetSize; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/RecordStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/RecordStatus.aidl new file mode 100644 index 0000000000..48bf9ecacf --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/RecordStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum RecordStatus { + DATA_READY = 1, + LOW_WATER = 2, + HIGH_WATER = 4, + OVERFLOW = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ScramblingStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ScramblingStatus.aidl new file mode 100644 index 0000000000..656fe20f21 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ScramblingStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum ScramblingStatus { + UNKNOWN = 1, + NOT_SCRAMBLED = 2, + SCRAMBLED = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/VideoStreamType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/VideoStreamType.aidl new file mode 100644 index 0000000000..9dfd686a69 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/VideoStreamType.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum VideoStreamType { + UNDEFINED = 0, + RESERVED = 1, + MPEG1 = 2, + MPEG2 = 3, + MPEG4P2 = 4, + AVC = 5, + HEVC = 6, + VC1 = 7, + VP8 = 8, + VP9 = 9, + AV1 = 10, + AVS = 11, + AVS2 = 12, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AudioExtraMetaData.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AudioExtraMetaData.aidl new file mode 100644 index 0000000000..b5adb7ddd0 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/AudioExtraMetaData.aidl @@ -0,0 +1,37 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Extra Meta Data from AD (Audio Descriptor) according to + * ETSI TS 101 154 V2.1.1. + * @hide + */ +@VintfStability +parcelable AudioExtraMetaData { + byte adFade; + + byte adPan; + + byte versionTextTag; + + byte adGainCenter; + + byte adGainFront; + + byte adGainSurround; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl new file mode 100644 index 0000000000..1bb5c68fb3 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl @@ -0,0 +1,102 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Audio stream coding format. + * @hide + */ +@VintfStability +@Backing(type="int") +enum AudioStreamType { + UNDEFINED, + + /* + * Uncompressed Audio + */ + PCM, + + /* + * MPEG Audio Layer III versions + */ + MP3, + + /* + * ISO/IEC 11172 Audio + */ + MPEG1, + + /* + * ISO/IEC 13818-3 + */ + MPEG2, + + /* + * ISO/IEC 23008-3 (MPEG-H Part 3) + */ + MPEGH, + + /* + * ISO/IEC 14496-3 + */ + AAC, + + /* + * Dolby Digital + */ + AC3, + + /* + * Dolby Digital Plus + */ + EAC3, + + /* + * Dolby AC-4 + */ + AC4, + + /* + * Basic DTS + */ + DTS, + + /* + * High Resolution DTS + */ + DTS_HD, + + /* + * Windows Media Audio + */ + WMA, + + /* + * Opus Interactive Audio Codec + */ + OPUS, + + /* + * VORBIS Interactive Audio Codec + */ + VORBIS, + + /* + * SJ/T 11368-2006 + */ + DRA, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AvStreamType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AvStreamType.aidl new file mode 100644 index 0000000000..684dfb9eb1 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/AvStreamType.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.AudioStreamType; +import android.hardware.tv.tuner.VideoStreamType; + +/** + * Stream type for A/V filter. + * @hide + */ +@VintfStability +union AvStreamType { + VideoStreamType video = VideoStreamType.UNDEFINED; + + AudioStreamType audio; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/Constant.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/Constant.aidl new file mode 100644 index 0000000000..891794a50f --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/Constant.aidl @@ -0,0 +1,86 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * @hide + */ +@VintfStability +@Backing(type="int") +enum Constant { + /** + * An invalid packet ID in transport stream according to ISO/IEC 13818-1. + */ + INVALID_TS_PID = 0xFFFF, + + /** + * An invalid Stream ID. + */ + INVALID_STREAM_ID = 0xFFFF, + + /** + * An invalid Filter ID. + */ + INVALID_FILTER_ID = 0xFFFFFFFF, + + /** + * An invalid AV sync hardware ID. + */ + INVALID_AV_SYNC_ID = 0xFFFFFFFF, + + /** + * An invalid mpuSequenceNumber. + */ + INVALID_MMTP_RECORD_EVENT_MPT_SEQUENCE_NUM = 0xFFFFFFFF, + + /** + * An invalid first macroblock address. + */ + INVALID_FIRST_MACROBLOCK_IN_SLICE = 0xFFFFFFFF, + + /** + * An invalid frenquency that can be used as the default value of the frontend setting. + */ + INVALID_FRONTEND_SETTING_FREQUENCY = 0xFFFFFFFF, + + /** + * An invalid context id that can be used as the default value of the unconfigured id. It can + * be used to reset the configured ip context id. + */ + INVALID_IP_FILTER_CONTEXT_ID = 0xFFFFFFFF, + + /** + * An invalid local transport stream id used as the return value on a failed operation of + * IFrontend.linkCiCam. + */ + INVALID_LTS_ID = 0xFFFFFFFF, + + /** + * An invalid frontend ID. + */ + INVALID_FRONTEND_ID = 0xFFFFFFFF, + + /** + * An invalid LNB ID. + */ + INVALID_LNB_ID = 0xFFFFFFFF, + + /** + * An invalid key token. It is used to remove the current key from the descrambler. + */ + INVALID_KEYTOKEN = 0x00, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/Constant64Bit.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/Constant64Bit.aidl new file mode 100644 index 0000000000..31a7f5b712 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/Constant64Bit.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * @hide + */ +@VintfStability +@Backing(type="long") +enum Constant64Bit { + /** + * An invalid 64-bit Filter ID. + */ + INVALID_FILTER_ID_64BIT = 0xFFFFFFFFFFFFFFFF, + + /** + * An invalid 64-bit AV sync hardware ID. + */ + INVALID_AV_SYNC_ID_64BIT = 0xFFFFFFFFFFFFFFFF, + + /** + * An invalid pts. + */ + INVALID_PRESENTATION_TIME_STAMP = 0xFFFFFFFFFFFFFFFF, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DataFormat.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DataFormat.aidl new file mode 100644 index 0000000000..bbc811df36 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DataFormat.aidl @@ -0,0 +1,50 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * A data format in demux's output or input according to ISO/IEC 13818-1. + * @hide + */ +@VintfStability +@Backing(type="int") +enum DataFormat { + /** + * Data is Transport Stream. + */ + TS, + + /** + * Data is Packetized Elementary Stream. + */ + PES, + + /** + * Data is Elementary Stream. + */ + ES, + + /** + * Data is TLV (type-length-value) Stream for JP SHV + */ + SHV_TLV, + + /** + * Data format is undefined. + */ + UNDEFINED, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl new file mode 100644 index 0000000000..397002d932 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxAlpFilterSettingsFilterSettings; +import android.hardware.tv.tuner.DemuxAlpLengthType; + +/** + * Filter Settings for a ALP filter. + * @hide + */ +@VintfStability +parcelable DemuxAlpFilterSettings { + /** + * Packet type according to A/330 ATSC3.0. + * 0: IPv4 packet + * 2: Compressed IP packet + * 4: Link layer signaling packet + * 6: Packet Type Extension + * 8: MPEG-2 Transport Stream + */ + byte packetType; + + DemuxAlpLengthType lengthType = DemuxAlpLengthType.UNDEFINED; + + DemuxAlpFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..9ab967e752 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl @@ -0,0 +1,33 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxFilterSectionSettings; + +/** + * @hide + */ +@VintfStability +union DemuxAlpFilterSettingsFilterSettings { + /** + * Not additional parameters. it's used by PTP, PAYLOAD_THROUGH subtype + * filters. + */ + boolean noinit; + + DemuxFilterSectionSettings section; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterType.aidl new file mode 100644 index 0000000000..fc36b9323e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * ALP Filter Type according to A/330 ATSC3.0. + * @hide + */ +@VintfStability +@Backing(type="int") +enum DemuxAlpFilterType { + UNDEFINED, + /** + * A filter to filter signaling data out from input stream, and queue the + * data to the filter's FMQ (Fast Message Queue). + */ + SECTION, + + /** + * A filter to set PTP (Precision Time Protocol) channel from input stream. + */ + PTP, + + /** + * A filter to strip out ALP message header and be a data source of another + * filter. + */ + PAYLOAD_THROUGH, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpLengthType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpLengthType.aidl new file mode 100644 index 0000000000..7d697ad70f --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpLengthType.aidl @@ -0,0 +1,37 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * ALP Length Type + * @hide + */ +@VintfStability +@Backing(type="byte") +enum DemuxAlpLengthType { + UNDEFINED = 0, + + /** + * Length does NOT include additional header. Used in US region. + */ + WITHOUT_ADDITIONAL_HEADER, + + /** + * Length includes additional header. Used in Korea region. + */ + WITH_ADDITIONAL_HEADER, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxCapabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxCapabilities.aidl new file mode 100644 index 0000000000..49fa08d17d --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxCapabilities.aidl @@ -0,0 +1,93 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Capabilities for Demux. + * @hide + */ +@VintfStability +parcelable DemuxCapabilities { + /** + * The number of Demux to be supported. + */ + int numDemux; + + /** + * The number of record to be supported. + */ + int numRecord; + + /** + * The number of playback to be supported. + */ + int numPlayback; + + /** + * The number of TS Filter to be supported. + */ + int numTsFilter; + + /** + * The number of Section Filter to be supported. + */ + int numSectionFilter; + + /** + * The number of Audio Filter to be supported. + */ + int numAudioFilter; + + /** + * The number of Video Filter to be supported. + */ + int numVideoFilter; + + /** + * The number of PES Filter to be supported. + */ + int numPesFilter; + + /** + * The number of PCR Filter to be supported. + */ + int numPcrFilter; + + /** + * The maximum number of bytes is supported in the mask of Section Filter. + */ + int numBytesInSectionFilter; + + /** + * Filter Main Types defined by DemuxFilterMainType. The DemuxFilterMainTypes + * is set by bitwise OR. + */ + int filterCaps; + + /** + * The array has same elements as DemuxFilterMainType. linkCaps[i] presents + * filter's capability as source for the ith type in DemuxFilterMainType. + * The jth bit of linkCaps[i] is 1 if the output of ith type filter can be + * data source for the filter type j. + */ + int[] linkCaps; + + /** + * True if Time Filter to be supported. + */ + boolean bTimeFilter; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl new file mode 100644 index 0000000000..30a1054575 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl @@ -0,0 +1,29 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Filter Settings for a Video and Audio. + * @hide + */ +@VintfStability +parcelable DemuxFilterAvSettings { + /** + * true if the filter output goes to decoder directly in pass through mode. + */ + boolean isPassthrough; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl new file mode 100644 index 0000000000..d59dd2eed4 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Filter Event for Download data. + * @hide + */ +@VintfStability +parcelable DemuxFilterDownloadEvent { + /** + * ID of object/module in the carousel + */ + int itemId; + + /** + * MPU sequence number of filtered data (only for MMTP) + */ + int mpuSequenceNumber; + + int itemFragmentIndex; + + int lastItemFragmentIndex; + + /** + * Data size in bytes of filtered data + */ + char dataLength; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl new file mode 100644 index 0000000000..bd79bd529e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl @@ -0,0 +1,30 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Filter Settings for a Download. + * @hide + */ +@VintfStability +parcelable DemuxFilterDownloadSettings { + /** + * Download ID (also known as the carousel ID) is carried in the PMT in + * ISO/IEC 13818-1 for the service containing the object carousel. + */ + int downloadId; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterEvent.aidl new file mode 100644 index 0000000000..8de80e0f94 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterEvent.aidl @@ -0,0 +1,62 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxFilterDownloadEvent; +import android.hardware.tv.tuner.DemuxFilterIpPayloadEvent; +import android.hardware.tv.tuner.DemuxFilterMediaEvent; +import android.hardware.tv.tuner.DemuxFilterMmtpRecordEvent; +import android.hardware.tv.tuner.DemuxFilterMonitorEvent; +import android.hardware.tv.tuner.DemuxFilterPesEvent; +import android.hardware.tv.tuner.DemuxFilterSectionEvent; +import android.hardware.tv.tuner.DemuxFilterTemiEvent; +import android.hardware.tv.tuner.DemuxFilterTsRecordEvent; + +/** + * Filter Event. + * @hide + */ +@VintfStability +union DemuxFilterEvent { + DemuxFilterSectionEvent section; + + DemuxFilterMediaEvent media; + + DemuxFilterPesEvent pes; + + DemuxFilterTsRecordEvent tsRecord; + + DemuxFilterMmtpRecordEvent mmtpRecord; + + DemuxFilterDownloadEvent download; + + DemuxFilterIpPayloadEvent ipPayload; + + DemuxFilterTemiEvent temi; + + DemuxFilterMonitorEvent monitorEvent; + + /** + * An unique ID to mark the start point of receiving the valid filter events after + * reconfiguring the filter. It must be sent at least once in the first event after the + * filter is restarted. 0 is reserved for the newly opened filter's first start, which is + * optional for HAL to send. + * + * When sending starId, DemuxFilterEvent.events should only contain one startId event. + */ + int startId; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl new file mode 100644 index 0000000000..0619b4543f --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl @@ -0,0 +1,29 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Filter Event for IP payload data. + * @hide + */ +@VintfStability +parcelable DemuxFilterIpPayloadEvent { + /** + * Data size in bytes of IP data + */ + char dataLength; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMainType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMainType.aidl new file mode 100644 index 0000000000..663bdfbd2a --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMainType.aidl @@ -0,0 +1,53 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Filter Main Type specifies the protocol that the filter use to extract data + * from input stream. + * @hide + */ +@VintfStability +@Backing(type="int") +enum DemuxFilterMainType { + UNDEFINED = 0, + + /** + * Transport Stream according to ISO/IEC 13818-1. + */ + TS = 1 << 0, + + /** + * MPEG Media Transport Protocol according to ISO/IEC 23008-1. + */ + MMTP = 1 << 1, + + /** + * Internet Protocol. + */ + IP = 1 << 2, + + /** + * Type Length Value according to ITU-R BT.1869. + */ + TLV = 1 << 3, + + /** + * ATSC Link-Layer Protocol according to A/330 ATSC3.0. + */ + ALP = 1 << 4, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl new file mode 100644 index 0000000000..754708c635 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl @@ -0,0 +1,77 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.common.NativeHandle; + +import android.hardware.tv.tuner.DemuxFilterMediaEventExtraMetaData; + +/** + * Filter Event for Audio or Video Filter. + * @hide + */ +@VintfStability +parcelable DemuxFilterMediaEvent { + char streamId; + + /** + * true if PTS is present in PES header. + */ + boolean isPtsPresent; + + /** + * Presentation Time Stamp for audio or video frame. It based on 90KHz has + * the same format as PTS (Presentation Time Stamp). + */ + long pts; + + /** + * Data size in bytes of audio or video frame + */ + int dataLength; + + /** + * The offset in the memory block which is shared among multiple + * MediaEvents. + */ + int offset; + + /** + * A handle associated to the memory where audio or video data stays. + */ + NativeHandle avMemory; + + /** + * True if the avMemory is in secure area, and isn't mappable. + */ + boolean isSecureMemory; + + /** + * An Id is used by HAL to provide additional information for AV data. + * For secure audio, it's the audio handle used by Audio Track. + */ + long avDataId; + + /** + * MPU sequence number of filtered data (only for MMTP) + */ + int mpuSequenceNumber; + + boolean isPesPrivateData; + + DemuxFilterMediaEventExtraMetaData extraMetaData; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl new file mode 100644 index 0000000000..f01952bc43 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl @@ -0,0 +1,33 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.AudioExtraMetaData; + +/** + * Extra Meta Data for DemuxFilterMediaEvent. + * @hide + */ +@VintfStability +union DemuxFilterMediaEventExtraMetaData { + /** + * Not additional parameters. it's used for video. + */ + boolean noinit; + + AudioExtraMetaData audio; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl new file mode 100644 index 0000000000..39083a9d23 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl @@ -0,0 +1,55 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Filter Event for MMTP Record data. + * @hide + */ +@VintfStability +parcelable DemuxFilterMmtpRecordEvent { + /** + * Indexes defined by DemuxScHevcIndex. + */ + int scHevcIndexMask; + + /** + * Byte number from beginning of the filter's output + */ + long byteNumber; + + /** + * The Presentation Time Stamp(PTS) for the audio or video frame. It is based on 90KHz + * and has the same format as the PTS in ISO/IEC 13818-1. + */ + long pts; + + /** + * MPU sequence number of the filtered data. This is only used for MMTP. + */ + int mpuSequenceNumber; + + /** + * Specifies the address of the first macroblock in the slice defined in ITU-T Rec. H.264. + */ + int firstMbInSlice; + + /** + * TS index mask defined by DemuxTsIndex. + */ + int tsIndexMask; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl new file mode 100644 index 0000000000..2dd11e2b1c --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl @@ -0,0 +1,36 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.ScramblingStatus; + +/** + * Monitor event to notify monitored status change. + * @hide + */ +@VintfStability +union DemuxFilterMonitorEvent { + /** + * New scrambling status. + */ + ScramblingStatus scramblingStatus = ScramblingStatus.UNKNOWN; + + /** + * New cid for the IP filter. + */ + int cid; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl new file mode 100644 index 0000000000..87a4d9d6f4 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl @@ -0,0 +1,29 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Monitor event type. + * @hide + */ +@VintfStability +@Backing(type="int") +enum DemuxFilterMonitorEventType { + SCRAMBLING_STATUS = 1 << 0, + + IP_CID_CHANGE = 1 << 1, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl new file mode 100644 index 0000000000..9780f40ad2 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Filter Settings for a PES Data. + * @hide + */ +@VintfStability +parcelable DemuxFilterPesDataSettings { + char streamId; + + /** + * true if the filter send onFilterStatus instead of onFilterEvent. + */ + boolean isRaw; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl new file mode 100644 index 0000000000..2b24cd9046 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl @@ -0,0 +1,36 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Filter Event for PES data. + * @hide + */ +@VintfStability +parcelable DemuxFilterPesEvent { + char streamId; + + /** + * Data size in bytes of PES data + */ + char dataLength; + + /** + * MPU sequence number of filtered data (only for MMTP) + */ + int mpuSequenceNumber; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl new file mode 100644 index 0000000000..2f8886469e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl @@ -0,0 +1,36 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxFilterScIndexMask; +import android.hardware.tv.tuner.DemuxRecordScIndexType; + +/** + * Filter Settings for Record data. + * @hide + */ +@VintfStability +parcelable DemuxFilterRecordSettings { + /** + * Indexes defined by DemuxTsIndex. + */ + int tsIndexMask; + + DemuxRecordScIndexType scIndexType = DemuxRecordScIndexType.UNDEFINED; + + DemuxFilterScIndexMask scIndexMask; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl new file mode 100644 index 0000000000..a9f4b6fede --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl @@ -0,0 +1,36 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxScHevcIndex; +import android.hardware.tv.tuner.DemuxScIndex; + +/** + * @hide + */ +@VintfStability +union DemuxFilterScIndexMask { + /** + * Indexes defined by DemuxScIndex. + */ + int scIndex; + + /** + * Indexes defined by DemuxScHevcIndex. + */ + int scHevc; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl new file mode 100644 index 0000000000..eea544f36e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Bits Settings for Section Filter. + * @hide + */ +@VintfStability +parcelable DemuxFilterSectionBits { + /** + * The bytes are configured for Section Filter + */ + byte[] filter; + + /** + * Active bits in the configured bytes to be used for filtering + */ + byte[] mask; + + /** + * Do positive match at the bit position of the configured bytes when the + * bit at same position of the mode is 0. + * Do negative match at the bit position of the configured bytes when the + * bit at same position of the mode is 1. + */ + byte[] mode; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl new file mode 100644 index 0000000000..1a327f30a7 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Filter Event for Section Filter. + * @hide + */ +@VintfStability +parcelable DemuxFilterSectionEvent { + /** + * Table ID of filtered data + */ + char tableId; + + /** + * Version number of filtered data + */ + char version; + + /** + * Section number of filtered data + */ + char sectionNum; + + /** + * Data size in bytes of filtered data + */ + char dataLength; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl new file mode 100644 index 0000000000..2102aa0a90 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxFilterSectionSettingsCondition; + +/** + * Filter Settings for Section data according to ISO/IEC 13818-1. + * @hide + */ +@VintfStability +parcelable DemuxFilterSectionSettings { + DemuxFilterSectionSettingsCondition condition; + + /** + * true if the filter checks CRC and discards data with wrong CRC + */ + boolean isCheckCrc; + + /** + * true if the filter repeats the data with the same version + */ + boolean isRepeat; + + /** + * true if the filter send onFilterStatus instead of onFilterEvent. + */ + boolean isRaw; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl new file mode 100644 index 0000000000..374511a4c5 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl @@ -0,0 +1,32 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxFilterSectionBits; +import android.hardware.tv.tuner.DemuxFilterSectionSettingsConditionTableInfo; + +/** + * The union of Section Filter Bits Settings and Table information that can be + * set by client. + * @hide + */ +@VintfStability +union DemuxFilterSectionSettingsCondition { + DemuxFilterSectionBits sectionBits; + + DemuxFilterSectionSettingsConditionTableInfo tableInfo; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl new file mode 100644 index 0000000000..c76d84caf2 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl @@ -0,0 +1,34 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Table information for Section Filter. + * @hide + */ +@VintfStability +parcelable DemuxFilterSectionSettingsConditionTableInfo { + /** + * Table ID for Section Filter + */ + char tableId; + + /** + * Version number for Section Filter + */ + char version; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSettings.aidl new file mode 100644 index 0000000000..7e9d2a105a --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxAlpFilterSettings; +import android.hardware.tv.tuner.DemuxIpFilterSettings; +import android.hardware.tv.tuner.DemuxMmtpFilterSettings; +import android.hardware.tv.tuner.DemuxTlvFilterSettings; +import android.hardware.tv.tuner.DemuxTsFilterSettings; + +/** + * Filter Settings. + * @hide + */ +@VintfStability +union DemuxFilterSettings { + DemuxTsFilterSettings ts; + + DemuxMmtpFilterSettings mmtp; + + DemuxIpFilterSettings ip; + + DemuxTlvFilterSettings tlv; + + DemuxAlpFilterSettings alp; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl new file mode 100644 index 0000000000..f07c26f4de --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * A status of data in the filter's buffer. + * @hide + */ +@VintfStability +@Backing(type="byte") +enum DemuxFilterStatus { + /** + * The data in the filter buffer is ready to be read. + */ + DATA_READY = 1 << 0, + + /** + * The available data amount in the filter buffer is at low level which is + * set to 25 percent by default. + */ + LOW_WATER = 1 << 1, + + /** + * The available data amount in the filter buffer is at high level which is + * set to 75 percent by default. + */ + HIGH_WATER = 1 << 2, + + /** + * The data in the filter buffer is full and newly filtered data is being + * discarded. + */ + OVERFLOW = 1 << 3, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl new file mode 100644 index 0000000000..a752e7c74c --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Filter Event for Timed External Media Information (TEMI) data. + * @hide + */ +@VintfStability +parcelable DemuxFilterTemiEvent { + /** + * Presentation Time Stamp for audio or video frame. It based on 90KHz has + * the same format as PTS (Presentation Time Stamp) in ISO/IEC 13818-1. + */ + long pts; + + /** + * TEMI Descriptor Tag + */ + byte descrTag; + + /** + * TEMI Descriptor + */ + byte[] descrData; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl new file mode 100644 index 0000000000..4992a3342e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl @@ -0,0 +1,55 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxFilterScIndexMask; +import android.hardware.tv.tuner.DemuxPid; + +/** + * Filter Event for TS Record data. + * @hide + */ +@VintfStability +parcelable DemuxFilterTsRecordEvent { + DemuxPid pid; + + /** + * Indexes defined by DemuxTsIndex. + */ + int tsIndexMask; + + /** + * Indexes of record output + */ + DemuxFilterScIndexMask scIndexMask; + + /** + * Byte number from beginning of the filter's output + */ + long byteNumber; + + /** + * The Presentation Time Stamp(PTS) for the audio or video frame. It is based on 90KHz + * and has the same format as the PTS in ISO/IEC 13818-1. + */ + long pts; + + /** + * Specifies the address of the first macroblock in the slice defined in ITU-T Rec. H.264. + */ + int firstMbInSlice; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterType.aidl new file mode 100644 index 0000000000..38348b64a5 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterType.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxFilterMainType; +import android.hardware.tv.tuner.DemuxFilterTypeDemuxFilterSubType; + +/** + * Demux Filter Type. + * @hide + */ +@VintfStability +parcelable DemuxFilterType { + DemuxFilterMainType mainType = DemuxFilterMainType.UNDEFINED; + + DemuxFilterTypeDemuxFilterSubType subType; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl new file mode 100644 index 0000000000..cf1a59cc0d --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxAlpFilterType; +import android.hardware.tv.tuner.DemuxIpFilterType; +import android.hardware.tv.tuner.DemuxMmtpFilterType; +import android.hardware.tv.tuner.DemuxTlvFilterType; +import android.hardware.tv.tuner.DemuxTsFilterType; + +/** + * @hide + */ +@VintfStability +union DemuxFilterTypeDemuxFilterSubType { + DemuxTsFilterType tsFilterType = DemuxTsFilterType.UNDEFINED; + + DemuxMmtpFilterType mmtpFilterType; + + DemuxIpFilterType ipFilterType; + + DemuxTlvFilterType tlvFilterType; + + DemuxAlpFilterType alpFilterType; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpAddress.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpAddress.aidl new file mode 100644 index 0000000000..9c704a3e6e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpAddress.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxIpAddressIpAddress; + +/** + * IP Settings for a IP filter. + * @hide + */ +@VintfStability +parcelable DemuxIpAddress { + DemuxIpAddressIpAddress srcIpAddress; + + DemuxIpAddressIpAddress dstIpAddress; + + /** + * 0 is invalid. should be ignored. + */ + char srcPort; + + /** + * 0 is invalid. should be ignored. + */ + char dstPort; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl new file mode 100644 index 0000000000..1a57215aa7 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl @@ -0,0 +1,33 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * @hide + */ +@VintfStability +union DemuxIpAddressIpAddress { + /** + * 0.0.0.0 is invalid. should be ignored. + */ + byte[] v4 = {}; + + /** + * 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 is invalid. should be ignored. + */ + byte[] v6; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl new file mode 100644 index 0000000000..6265aa6959 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxIpAddress; +import android.hardware.tv.tuner.DemuxIpFilterSettingsFilterSettings; + +/** + * Filter Settings for a IP filter. + * @hide + */ +@VintfStability +parcelable DemuxIpFilterSettings { + DemuxIpAddress ipAddr; + + DemuxIpFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..b8aa9f282e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxFilterSectionSettings; + +/** + * @hide + */ +@VintfStability +union DemuxIpFilterSettingsFilterSettings { + /** + * Not additional parameters. it's used by NTP, IP_PAYLOAD, + * PAYLOAD_THROUGH subtype filters. + */ + boolean noinit; + + DemuxFilterSectionSettings section; + + /** + * true if the data from IP subtype go to next filter directly + */ + boolean bPassthrough; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpFilterType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpFilterType.aidl new file mode 100644 index 0000000000..f975195277 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpFilterType.aidl @@ -0,0 +1,56 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * IP Filter Type. + * @hide + */ +@VintfStability +@Backing(type="int") +enum DemuxIpFilterType { + UNDEFINED, + + /** + * A filter to filter section data out from input stream, and queue the + * data to the filter's FMQ (Fast Message Queue). + */ + SECTION, + + /** + * A filter to set NTP (Network Time Procotol) channel from input stream. + */ + NTP, + + /** + * A filter to strip out IP message header and queue the data to the + * filter's FMQ. + */ + IP_PAYLOAD, + + /** + * A filter to filter a IP stream out from input stream. The output can be + * either upper stream of another filter or queued to the filter's FMQ. + */ + IP, + + /** + * A filter to strip out IP message header and be a data source of another + * filter. + */ + PAYLOAD_THROUGH, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl new file mode 100644 index 0000000000..3759ce0810 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl @@ -0,0 +1,30 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxMmtpFilterSettingsFilterSettings; + +/** + * Filter Settings for a MMTP filter. + * @hide + */ +@VintfStability +parcelable DemuxMmtpFilterSettings { + char mmtpPid; + + DemuxMmtpFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..0f960b692a --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxFilterAvSettings; +import android.hardware.tv.tuner.DemuxFilterDownloadSettings; +import android.hardware.tv.tuner.DemuxFilterPesDataSettings; +import android.hardware.tv.tuner.DemuxFilterRecordSettings; +import android.hardware.tv.tuner.DemuxFilterSectionSettings; + +/** + * The different types of MMTP Filter Settings that can be set by client. + * @hide + */ +@VintfStability +union DemuxMmtpFilterSettingsFilterSettings { + /** + * Not additional parameters. it's used by MMTP subtype filters. + */ + boolean noinit; + + DemuxFilterSectionSettings section; + + DemuxFilterAvSettings av; + + DemuxFilterPesDataSettings pesData; + + DemuxFilterRecordSettings record; + + DemuxFilterDownloadSettings download; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl new file mode 100644 index 0000000000..eb0016c6ef --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl @@ -0,0 +1,69 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * MMTP Filter Type according to ISO/IEC 23008-1 + * @hide + */ +@VintfStability +@Backing(type="int") +enum DemuxMmtpFilterType { + UNDEFINED, + + /** + * A filter to filter signaling data out from input stream, and queue the + * data to the filter's FMQ (Fast Message Queue). + */ + SECTION, + + /** + * A filter to filter MFU (Media fragment unit) out from input stream, and + * queue the data to the filter's FMQ. + */ + PES, + + /** + * A filter to filter a MMTP stream out from input stream, and queue the + * data to the filter's FMQ. + */ + MMTP, + + /** + * A filter to filter Audio data out from input stream, and send Audio's + * Metadata to client through onFilterEvent. + */ + AUDIO, + + /** + * A filter to filter Video data out from input stream, and send Video's + * Metadata to client through onFilterEvent. + */ + VIDEO, + + /** + * A filter to filter data out from input stream, and queue the data to the + * buffer of the record. + */ + RECORD, + + /** + * A filter to filter application data out from input stream, and queue the + * data to the filter's FMQ. + */ + DOWNLOAD, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxPid.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxPid.aidl new file mode 100644 index 0000000000..a76d208017 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxPid.aidl @@ -0,0 +1,34 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Demux Packet ID. + * @hide + */ +@VintfStability +union DemuxPid { + /** + * Packet ID is used to specify packets in transport stream. + */ + char tPid; + + /** + * Packet ID is used to specify packets in MMTP. + */ + char mmtpPid; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl new file mode 100644 index 0000000000..b8858efb63 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl @@ -0,0 +1,36 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * The bits of EventFlag in FMQ (Fast message queue) are used by client to + * notify HAL the status change. + * @hide + */ +@VintfStability +@Backing(type="int") +enum DemuxQueueNotifyBits { + /** + * client writes data and notify HAL the data is ready. + */ + DATA_READY = 1 << 0, + + /** + * client reads data and notify HAL the data is consumed. + */ + DATA_CONSUMED = 1 << 1, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl new file mode 100644 index 0000000000..44b985cc67 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Start Code Index type to be used in the filter for record + * @hide + */ +@VintfStability +@Backing(type="int") +enum DemuxRecordScIndexType { + /** + * Don't use SC index + */ + NONE, + + /** + * Use Start Code index + */ + SC, + + /** + * Use Start Code index for HEVC + */ + SC_HEVC, + + /** + * SC index is undefined + */ + UNDEFINED, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScHevcIndex.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScHevcIndex.aidl new file mode 100644 index 0000000000..f2ddd004b9 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScHevcIndex.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Indexes can be tagged by NAL unit group in HEVC according to ISO/IEC 23008-2. + * @hide + */ +@VintfStability +@Backing(type="int") +enum DemuxScHevcIndex { + SPS = 1 << 0, + + AUD = 1 << 1, + + SLICE_CE_BLA_W_LP = 1 << 2, + + SLICE_BLA_W_RADL = 1 << 3, + + SLICE_BLA_N_LP = 1 << 4, + + SLICE_IDR_W_RADL = 1 << 5, + + SLICE_IDR_N_LP = 1 << 6, + + SLICE_TRAIL_CRA = 1 << 7, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScIndex.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScIndex.aidl new file mode 100644 index 0000000000..0aef739742 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScIndex.aidl @@ -0,0 +1,73 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Indexes can be tagged by Start Code in PES (Packetized Elementary Stream) + * according to ISO/IEC 13818-1 and Slice Groups according to ISO/IEC 14496-10. + * @hide + */ +@VintfStability +@Backing(type="int") +enum DemuxScIndex { + UNDEFINED = 0, + + /** + * Start Code is for a new I Frame + */ + I_FRAME = 1 << 0, + + /** + * Start Code is for a new P Frame + */ + P_FRAME = 1 << 1, + + /** + * Start Code is for a new B Frame + */ + B_FRAME = 1 << 2, + + /** + * Start Code is for a new Sequence + */ + SEQUENCE = 1 << 3, + + /** + * All blocks are coded as I blocks. + */ + I_SLICE = 1 << 4, + + /** + * Blocks are coded as I or P blocks. + */ + P_SLICE = 1 << 5, + + /** + * Blocks are coded as I, P or B blocks. + */ + B_SLICE = 1 << 6, + + /** + * A so-called switching I slice that is coded. + */ + SI_SLICE = 1 << 7, + + /** + * A so-called switching P slice that is coded. + */ + SP_SLICE = 1 << 8, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl new file mode 100644 index 0000000000..fd1289df00 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxTlvFilterSettingsFilterSettings; + +/** + * Filter Settings for a TLV filter. + * @hide + */ +@VintfStability +parcelable DemuxTlvFilterSettings { + /** + * Packet type according to ITU-R BT.1869. + * 0x01: IPv4 packet + * 0x02: IPv6 packet + * 0x03: IP packet with header compression + * 0xFE: Signaling packet + * 0xFF: NULL packet + */ + byte packetType; + + /** + * true if the filtered data is commpressed ip packet + */ + boolean isCompressedIpPacket; + + DemuxTlvFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..7837c1d415 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxFilterSectionSettings; + +/** + * The different types of TLV Filter Settings that can be set by client. + * @hide + */ +@VintfStability +union DemuxTlvFilterSettingsFilterSettings { + /** + * Not additional parameters. it's used by PAYLOAD_THROUGH subtype + * filters. + */ + boolean noinit; + + DemuxFilterSectionSettings section; + + /** + * true if the data from TLV subtype go to next filter directly + */ + boolean bPassthrough; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterType.aidl new file mode 100644 index 0000000000..1566f74155 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterType.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * TLV Filter Type according to ITU-R BT.1869. + * @hide + */ +@VintfStability +@Backing(type="int") +enum DemuxTlvFilterType { + UNDEFINED, + + /** + * A filter to filter signaling data out from input stream, and queue the + * data to the filter's FMQ (Fast Message Queue). + */ + SECTION, + + /** + * A filter to filter a TLV stream out from input stream. The output can be + * either upper stream of another filter or queued to the filter's FMQ. + */ + TLV, + + /** + * A filter to strip out TLV message header and be a data source of another + * filter. + */ + PAYLOAD_THROUGH, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl new file mode 100644 index 0000000000..1345831dc6 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl @@ -0,0 +1,33 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxTsFilterSettingsFilterSettings; + +/** + * Filter Settings for a TS filter. + * @hide + */ +@VintfStability +parcelable DemuxTsFilterSettings { + /** + * Packet ID is used to specify packets in transport stream. + */ + char tpid; + + DemuxTsFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..81e36f36a2 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxFilterAvSettings; +import android.hardware.tv.tuner.DemuxFilterPesDataSettings; +import android.hardware.tv.tuner.DemuxFilterRecordSettings; +import android.hardware.tv.tuner.DemuxFilterSectionSettings; + +/** + * The different types of TS Filter Settings that can be set by client. + * @hide + */ +@VintfStability +union DemuxTsFilterSettingsFilterSettings { + /** + * Not additional parameters. it's used by PCR, TS, TEMI subtype + * filters. + */ + boolean noinit; + + DemuxFilterSectionSettings section; + + DemuxFilterAvSettings av; + + DemuxFilterPesDataSettings pesData; + + DemuxFilterRecordSettings record; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterType.aidl new file mode 100644 index 0000000000..cdf5c58e2e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterType.aidl @@ -0,0 +1,75 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * TS Filter Type according to ISO/IEC 13818-1 + * @hide + */ +@VintfStability +@Backing(type="int") +enum DemuxTsFilterType { + UNDEFINED, + + /** + * A filter to filter Section data out from input stream, and queue the + * data to the filter's FMQ (Fast Message Queue). + */ + SECTION, + + /** + * A filter to filter Packetized Elementary Stream data out from input + * stream, and queue the data to the filter's FMQ. + */ + PES, + + /** + * A filter to filter a Transport Stream out from input stream, and queue + * the data to the filter's FMQ. + */ + TS, + + /** + * A filter to filter Audio data out from input stream, and send Audio's + * Metadata to client through onFilterEvent. + */ + AUDIO, + + /** + * A filter to filter Video data out from input stream, and send Video's + * Metadata to client through onFilterEvent. + */ + VIDEO, + + /** + * A filter to set PCR (Program Clock Reference) channel from input stream. + */ + PCR, + + /** + * A filter to filter data out from input stream, and queue the data to the + * buffer of the record. + */ + RECORD, + + /** + * A filter to filter out Timed External Media Information (TEMI) according + * to ISO/IEC 13818-1:2013/ DAM 6 from input stream, and send TEMI event to + * client through onFilterEvent. + */ + TEMI, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsIndex.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsIndex.aidl new file mode 100644 index 0000000000..9d0e7c504a --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsIndex.aidl @@ -0,0 +1,76 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Indexes can be tagged through TS (Transport Stream) header. + * @hide + */ +@VintfStability +@Backing(type="int") +enum DemuxTsIndex { + FIRST_PACKET = 1 << 0, + + PAYLOAD_UNIT_START_INDICATOR = 1 << 1, + + CHANGE_TO_NOT_SCRAMBLED = 1 << 2, + + CHANGE_TO_EVEN_SCRAMBLED = 1 << 3, + + CHANGE_TO_ODD_SCRAMBLED = 1 << 4, + + DISCONTINUITY_INDICATOR = 1 << 5, + + RANDOM_ACCESS_INDICATOR = 1 << 6, + + PRIORITY_INDICATOR = 1 << 7, + + PCR_FLAG = 1 << 8, + + OPCR_FLAG = 1 << 9, + + SPLICING_POINT_FLAG = 1 << 10, + + PRIVATE_DATA = 1 << 11, + + ADAPTATION_EXTENSION_FLAG = 1 << 12, + + /** + * Index the address of MMT Packet Table(MPT). + */ + MPT_INDEX_MPT = 1 << 16, + + /** + * Index the address of Video. + */ + MPT_INDEX_VIDEO = 1 << 17, + + /** + * Index the address of Audio. + */ + MPT_INDEX_AUDIO = 1 << 18, + + /** + * Index to indicate this is a target of timestamp extraction for video. + */ + MPT_INDEX_TIMESTAMP_TARGET_VIDEO = 1 << 19, + + /** + * Index to indicate this is a target of timestamp extraction for audio. + */ + MPT_INDEX_TIMESTAMP_TARGET_AUDIO = 1 << 20, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DvrSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DvrSettings.aidl new file mode 100644 index 0000000000..aa21cf69ab --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DvrSettings.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.PlaybackSettings; +import android.hardware.tv.tuner.RecordSettings; + +/** + * The Setting for DVR. + * @hide + */ +@VintfStability +union DvrSettings { + RecordSettings record; + + PlaybackSettings playback; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DvrType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DvrType.aidl new file mode 100644 index 0000000000..21dcc4aa2e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DvrType.aidl @@ -0,0 +1,29 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * The type of DVR. + * @hide + */ +@VintfStability +@Backing(type="byte") +enum DvrType { + RECORD, + + PLAYBACK, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl new file mode 100644 index 0000000000..72291a5101 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * AFT flag for an Analog Frontend. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendAnalogAftFlag { + UNDEFINED, + + AFT_TRUE, + + AFT_FALSE, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl new file mode 100644 index 0000000000..7f0cd04e4b --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl @@ -0,0 +1,34 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Capabilities for Analog Frontend. + * @hide + */ +@VintfStability +parcelable FrontendAnalogCapabilities { + /** + * Signal Types defined by FrontendAnalogType. + */ + int typeCap; + + /** + * Standard Interchange Formats defined by FrontendAnalogSifStandard. + */ + int sifStandardCap; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogSettings.aidl new file mode 100644 index 0000000000..926929f82f --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogSettings.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendAnalogAftFlag; +import android.hardware.tv.tuner.FrontendAnalogSifStandard; +import android.hardware.tv.tuner.FrontendAnalogType; +import android.hardware.tv.tuner.FrontendSpectralInversion; + +/** + * Signal Settings for Analog Frontend. + * @hide + */ +@VintfStability +parcelable FrontendAnalogSettings { + /** + * Signal frequency in Hertz + */ + int frequency; + + /** + * Signal end frequency in Hertz used by scan + */ + int endFrequency; + + FrontendSpectralInversion inversion = FrontendSpectralInversion.UNDEFINED; + + FrontendAnalogType type = FrontendAnalogType.UNDEFINED; + + FrontendAnalogAftFlag aftFlag = FrontendAnalogAftFlag.UNDEFINED; + + FrontendAnalogSifStandard sifStandard = FrontendAnalogSifStandard.UNDEFINED; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl new file mode 100644 index 0000000000..3c0f9b4cc7 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl @@ -0,0 +1,63 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Standard Interchange Format (SIF) for Analog Frontend. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendAnalogSifStandard { + UNDEFINED = 0, + + AUTO = 1 << 0, + + BG = 1 << 1, + + BG_A2 = 1 << 2, + + BG_NICAM = 1 << 3, + + I = 1 << 4, + + DK = 1 << 5, + + DK1_A2 = 1 << 6, + + DK2_A2 = 1 << 7, + + DK3_A2 = 1 << 8, + + DK_NICAM = 1 << 9, + + L = 1 << 10, + + M = 1 << 11, + + M_BTSC = 1 << 12, + + M_A2 = 1 << 13, + + M_EIAJ = 1 << 14, + + I_NICAM = 1 << 15, + + L_NICAM = 1 << 16, + + L_PRIME = 1 << 17, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogType.aidl new file mode 100644 index 0000000000..e4b05a67cf --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Signal Type for Analog Frontend. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendAnalogType { + UNDEFINED = 0, + + AUTO = 1 << 0, + + PAL = 1 << 1, + + PAL_M = 1 << 2, + + PAL_N = 1 << 3, + + PAL_60 = 1 << 4, + + NTSC = 1 << 5, + + NTSC_443 = 1 << 6, + + SECAM = 1 << 7, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl new file mode 100644 index 0000000000..af78a96628 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Bandwidth for ATSC3. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendAtsc3Bandwidth { + UNDEFINED = 0, + + /** + * hardware is able to detect and set bandwidth automatically + */ + AUTO = 1 << 0, + + BANDWIDTH_6MHZ = 1 << 1, + + BANDWIDTH_7MHZ = 1 << 2, + + BANDWIDTH_8MHZ = 1 << 3, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl new file mode 100644 index 0000000000..98c7b8db20 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Capabilities for ATSC3 Frontend. + * @hide + */ +@VintfStability +parcelable FrontendAtsc3Capabilities { + /** + * Bandwidth capabilities defined by FrontendAtsc3Bandwidth. + */ + int bandwidthCap; + + /** + * Modulation capabilities defined by FrontendAtsc3Modulation. + */ + int modulationCap; + + /** + * TimeInterleaveMode capabilities defined by FrontendAtsc3TimeInterleaveMode. + */ + int timeInterleaveModeCap; + + /** + * CodeRate capabilities defined by FrontendAtsc3CodeRate. + */ + int codeRateCap; + + /** + * FEC capabilities defined by FrontendAtsc3Fec. + */ + int fecCap; + + /** + * Demodulator Output Format capabilities FrontendAtsc3DemodOutputFormat. + */ + byte demodOutputFormatCap; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl new file mode 100644 index 0000000000..8a2ee03632 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl @@ -0,0 +1,56 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Code Rate for ATSC3. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendAtsc3CodeRate { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Coderate automatically + */ + AUTO = 1 << 0, + + CODERATE_2_15 = 1 << 1, + + CODERATE_3_15 = 1 << 2, + + CODERATE_4_15 = 1 << 3, + + CODERATE_5_15 = 1 << 4, + + CODERATE_6_15 = 1 << 5, + + CODERATE_7_15 = 1 << 6, + + CODERATE_8_15 = 1 << 7, + + CODERATE_9_15 = 1 << 8, + + CODERATE_10_15 = 1 << 9, + + CODERATE_11_15 = 1 << 10, + + CODERATE_12_15 = 1 << 11, + + CODERATE_13_15 = 1 << 12, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl new file mode 100644 index 0000000000..b17616c66a --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Demodulator Output Format for an ATSC3 Frontend. + * @hide + */ +@VintfStability +@Backing(type="byte") +enum FrontendAtsc3DemodOutputFormat { + /** + * Undefined. Scan uses this. + */ + UNDEFINED = 0, + + /** + * ALP format. Typically used in US region. + */ + ATSC3_LINKLAYER_PACKET = 1 << 0, + + /** + * BaseBand packet format. Typically used in Korea region. + */ + BASEBAND_PACKET = 1 << 1, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl new file mode 100644 index 0000000000..af0bf042ea --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Forward Error Correction (FEC) for ATSC3. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendAtsc3Fec { + UNDEFINED = 0, + + /** + * hardware is able to detect and set FEC automatically + */ + AUTO = 1 << 0, + + BCH_LDPC_16K = 1 << 1, + + BCH_LDPC_64K = 1 << 2, + + CRC_LDPC_16K = 1 << 3, + + CRC_LDPC_64K = 1 << 4, + + LDPC_16K = 1 << 5, + + LDPC_64K = 1 << 6, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl new file mode 100644 index 0000000000..3108234e74 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Modulation Type for ATSC3. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendAtsc3Modulation { + UNDEFINED = 0, + + /** + * hardware is able to detect and set modulation automatically + */ + AUTO = 1 << 0, + + MOD_QPSK = 1 << 1, + + MOD_16QAM = 1 << 2, + + MOD_64QAM = 1 << 3, + + MOD_256QAM = 1 << 4, + + MOD_1024QAM = 1 << 5, + + MOD_4096QAM = 1 << 6, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl new file mode 100644 index 0000000000..5678dd39fc --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendAtsc3CodeRate; +import android.hardware.tv.tuner.FrontendAtsc3Fec; +import android.hardware.tv.tuner.FrontendAtsc3Modulation; +import android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode; + +/** + * PLP basis Signal Settings for an ATSC3 Frontend. + * @hide + */ +@VintfStability +parcelable FrontendAtsc3PlpSettings { + byte plpId; + + FrontendAtsc3Modulation modulation = FrontendAtsc3Modulation.UNDEFINED; + + FrontendAtsc3TimeInterleaveMode interleaveMode = FrontendAtsc3TimeInterleaveMode.UNDEFINED; + + FrontendAtsc3CodeRate codeRate = FrontendAtsc3CodeRate.UNDEFINED; + + FrontendAtsc3Fec fec = FrontendAtsc3Fec.UNDEFINED; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl new file mode 100644 index 0000000000..dc1e52038b --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl @@ -0,0 +1,50 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendAtsc3Bandwidth; +import android.hardware.tv.tuner.FrontendAtsc3DemodOutputFormat; +import android.hardware.tv.tuner.FrontendAtsc3PlpSettings; +import android.hardware.tv.tuner.FrontendSpectralInversion; + +/** + * Signal Settings for an ATSC3 Frontend. + * @hide + */ +@VintfStability +parcelable FrontendAtsc3Settings { + /** + * Signal frequency in Hertz + */ + int frequency; + + /** + * Signal end frequency in Hertz used by scan + */ + int endFrequency; + + /** + * Bandwidth of tuning band. + */ + FrontendAtsc3Bandwidth bandwidth = FrontendAtsc3Bandwidth.UNDEFINED; + + FrontendSpectralInversion inversion = FrontendSpectralInversion.UNDEFINED; + + FrontendAtsc3DemodOutputFormat demodOutputFormat = FrontendAtsc3DemodOutputFormat.UNDEFINED; + + FrontendAtsc3PlpSettings[] plpSettings; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl new file mode 100644 index 0000000000..451a9229f8 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl @@ -0,0 +1,36 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Time Interleave Mode for ATSC3. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendAtsc3TimeInterleaveMode { + UNDEFINED = 0, + + /** + * hardware is able to detect and set TimeInterleaveMode automatically + */ + AUTO = 1 << 0, + + CTI = 1 << 1, + + HTI = 1 << 2, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl new file mode 100644 index 0000000000..c8a3d2bc6a --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendAtscModulation; + +/** + * Capabilities for ATSC Frontend. + * @hide + */ +@VintfStability +parcelable FrontendAtscCapabilities { + /** + * Modulation capabilities defined by FrontendAtscModulation. + */ + int modulationCap; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscModulation.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscModulation.aidl new file mode 100644 index 0000000000..960a2991ee --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscModulation.aidl @@ -0,0 +1,36 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Modulation Type for ATSC. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendAtscModulation { + UNDEFINED = 0, + + /** + * hardware is able to detect and set modulation automatically + */ + AUTO = 1 << 0, + + MOD_8VSB = 1 << 2, + + MOD_16VSB = 1 << 3, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscSettings.aidl new file mode 100644 index 0000000000..1279b1494f --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendAtscModulation; +import android.hardware.tv.tuner.FrontendSpectralInversion; + +/** + * Signal Settings for an ATSC Frontend. + * @hide + */ +@VintfStability +parcelable FrontendAtscSettings { + /** + * Signal frequency in Hertz + */ + int frequency; + + /** + * Signal end frequency in Hertz used by scan + */ + int endFrequency; + + FrontendSpectralInversion inversion = FrontendSpectralInversion.UNDEFINED; + + FrontendAtscModulation modulation = FrontendAtscModulation.UNDEFINED; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendBandwidth.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendBandwidth.aidl new file mode 100644 index 0000000000..c1c2355b47 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendBandwidth.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendAtsc3Bandwidth; +import android.hardware.tv.tuner.FrontendDvbtBandwidth; +import android.hardware.tv.tuner.FrontendIsdbtBandwidth; +import android.hardware.tv.tuner.FrontendDtmbBandwidth; +import android.hardware.tv.tuner.FrontendDvbcBandwidth; + +/** + * @hide + */ +@VintfStability +union FrontendBandwidth { + FrontendAtsc3Bandwidth atsc3 = FrontendAtsc3Bandwidth.UNDEFINED; + + FrontendDvbcBandwidth dvbc; + + FrontendDvbtBandwidth dvbt; + + FrontendIsdbtBandwidth isdbt; + + FrontendDtmbBandwidth dtmb; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl new file mode 100644 index 0000000000..a2b4356af8 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Time Interleave Mode for DVBC Frontend. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendCableTimeInterleaveMode { + UNDEFINED = 0, + + AUTO = 1 << 0, + + INTERLEAVING_128_1_0 = 1 << 1, + + INTERLEAVING_128_1_1 = 1 << 2, + + INTERLEAVING_64_2 = 1 << 3, + + INTERLEAVING_32_4 = 1 << 4, + + INTERLEAVING_16_8 = 1 << 5, + + INTERLEAVING_8_16 = 1 << 6, + + INTERLEAVING_128_2 = 1 << 7, + + INTERLEAVING_128_3 = 1 << 8, + + INTERLEAVING_128_4 = 1 << 9, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendCapabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendCapabilities.aidl new file mode 100644 index 0000000000..a6f14900d1 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendCapabilities.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendAnalogCapabilities; +import android.hardware.tv.tuner.FrontendAtsc3Capabilities; +import android.hardware.tv.tuner.FrontendAtscCapabilities; +import android.hardware.tv.tuner.FrontendDtmbCapabilities; +import android.hardware.tv.tuner.FrontendDvbcCapabilities; +import android.hardware.tv.tuner.FrontendDvbsCapabilities; +import android.hardware.tv.tuner.FrontendDvbtCapabilities; +import android.hardware.tv.tuner.FrontendIsdbs3Capabilities; +import android.hardware.tv.tuner.FrontendIsdbsCapabilities; +import android.hardware.tv.tuner.FrontendIsdbtCapabilities; + +/** + * @hide + */ +@VintfStability +union FrontendCapabilities { + FrontendAnalogCapabilities analogCaps; + + FrontendAtscCapabilities atscCaps; + + FrontendAtsc3Capabilities atsc3Caps; + + FrontendDtmbCapabilities dtmbCaps; + + FrontendDvbsCapabilities dvbsCaps; + + FrontendDvbcCapabilities dvbcCaps; + + FrontendDvbtCapabilities dvbtCaps; + + FrontendIsdbsCapabilities isdbsCaps; + + FrontendIsdbs3Capabilities isdbs3Caps; + + FrontendIsdbtCapabilities isdbtCaps; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl new file mode 100644 index 0000000000..4dc3f0fc9d --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl @@ -0,0 +1,36 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Bandwidth Type for DTMB. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDtmbBandwidth { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Bandwidth automatically + */ + AUTO = 1 << 0, + + BANDWIDTH_8MHZ = 1 << 1, + + BANDWIDTH_6MHZ = 1 << 2, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl new file mode 100644 index 0000000000..eda0d463f8 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Capabilities for DTMB Frontend. + * @hide + */ +@VintfStability +parcelable FrontendDtmbCapabilities { + /** + * Transmission Modes defined by FrontendDtmbTransmissionMode. + */ + int transmissionModeCap; + + /** + * Bandwidth Types defined by FrontendDtmbBandwidth. + */ + int bandwidthCap; + + /** + * Modulations defined by FrontendDtmbModulation. + */ + int modulationCap; + + /** + * CODERATE Types defined by FrontendDtmbCodeRate. + */ + int codeRateCap; + + /** + * Guard Interval Types defined by FrontendDtmbGuardInterval. + */ + int guardIntervalCap; + + /** + * Time Interleave Mode Type defined by FrontendDtmbTimeInterleaveMode. + */ + int interleaveModeCap; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl new file mode 100644 index 0000000000..7b4a438793 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * CODERATE Type for DTMB. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDtmbCodeRate { + UNDEFINED = 0, + + /** + * hardware is able to detect and set code rate automatically + */ + AUTO = 1 << 0, + + CODERATE_2_5 = 1 << 1, + + CODERATE_3_5 = 1 << 2, + + CODERATE_4_5 = 1 << 3, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl new file mode 100644 index 0000000000..3c2e06a9fe --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Guard Interval Type for DTMB. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDtmbGuardInterval { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Guard Interval automatically + */ + AUTO = 1 << 0, + + PN_420_VARIOUS = 1 << 1, + + PN_595_CONST = 1 << 2, + + PN_945_VARIOUS = 1 << 3, + + PN_420_CONST = 1 << 4, + + PN_945_CONST = 1 << 5, + + PN_RESERVED = 1 << 6, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbModulation.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbModulation.aidl new file mode 100644 index 0000000000..87bd8da287 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbModulation.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Frontend Modulation Type for DTMB. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDtmbModulation { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Constellation automatically + */ + AUTO = 1 << 0, + + CONSTELLATION_4QAM = 1 << 1, + + CONSTELLATION_4QAM_NR = 1 << 2, + + CONSTELLATION_16QAM = 1 << 3, + + CONSTELLATION_32QAM = 1 << 4, + + CONSTELLATION_64QAM = 1 << 5, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbSettings.aidl new file mode 100644 index 0000000000..ccac650d84 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbSettings.aidl @@ -0,0 +1,56 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendDtmbBandwidth; +import android.hardware.tv.tuner.FrontendDtmbCodeRate; +import android.hardware.tv.tuner.FrontendDtmbGuardInterval; +import android.hardware.tv.tuner.FrontendDtmbModulation; +import android.hardware.tv.tuner.FrontendDtmbTimeInterleaveMode; +import android.hardware.tv.tuner.FrontendDtmbTransmissionMode; +import android.hardware.tv.tuner.FrontendSpectralInversion; + +/** + * Signal Setting for DTMB Frontend. + * @hide + */ +@VintfStability +parcelable FrontendDtmbSettings { + /** + * Signal frequency in Hertz + */ + int frequency; + + /** + * Signal end frequency in Hertz used by scan + */ + int endFrequency; + + FrontendSpectralInversion inversion = FrontendSpectralInversion.UNDEFINED; + + FrontendDtmbTransmissionMode transmissionMode = FrontendDtmbTransmissionMode.UNDEFINED; + + FrontendDtmbBandwidth bandwidth = FrontendDtmbBandwidth.UNDEFINED; + + FrontendDtmbModulation modulation = FrontendDtmbModulation.UNDEFINED; + + FrontendDtmbCodeRate codeRate = FrontendDtmbCodeRate.UNDEFINED; + + FrontendDtmbGuardInterval guardInterval = FrontendDtmbGuardInterval.UNDEFINED; + + FrontendDtmbTimeInterleaveMode interleaveMode = FrontendDtmbTimeInterleaveMode.UNDEFINED; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl new file mode 100644 index 0000000000..a992524b06 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl @@ -0,0 +1,36 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Time Interleave Mode Type for DTMB. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDtmbTimeInterleaveMode { + UNDEFINED = 0, + + /** + * hardware is able to detect and set time interleave mode automatically + */ + AUTO = 1 << 0, + + TIMER_INT_240 = 1 << 1, + + TIMER_INT_720 = 1 << 2, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl new file mode 100644 index 0000000000..7ebed8490a --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl @@ -0,0 +1,36 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Transmission Mode for DTMB. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDtmbTransmissionMode { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Transmission Mode automatically + */ + AUTO = 1 << 0, + + C1 = 1 << 1, + + C3780 = 1 << 2, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl new file mode 100644 index 0000000000..3d99ceea41 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl @@ -0,0 +1,33 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Annex Type for DVBC. + * @hide + */ +@VintfStability +@Backing(type="byte") +enum FrontendDvbcAnnex { + UNDEFINED = 0, + + A = 1 << 0, + + B = 1 << 1, + + C = 1 << 2, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl new file mode 100644 index 0000000000..ff921a7de8 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl @@ -0,0 +1,35 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Bandwidth Type for Cable Frontend. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbcBandwidth { + UNDEFINED = 0, + + BANDWIDTH_5MHZ = 1 << 0, + + BANDWIDTH_6MHZ = 1 << 1, + + BANDWIDTH_7MHZ = 1 << 2, + + BANDWIDTH_8MHZ = 1 << 3, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl new file mode 100644 index 0000000000..bd7f18067e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Capabilities for DVBC Frontend. + * @hide + */ +@VintfStability +parcelable FrontendDvbcCapabilities { + /** + * Modulation Types defined by FrontendDvbcModulation. + */ + int modulationCap; + + /** + * Inner Forward Error Correction types defined by FrontendInnerFec. + */ + long fecCap; + + /** + * Annex Types defined by FrontendDvbcAnnex. + */ + byte annexCap; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcModulation.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcModulation.aidl new file mode 100644 index 0000000000..3435e764db --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcModulation.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Modulation Type for DVBC. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbcModulation { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Modulation automatically + */ + AUTO = 1 << 0, + + MOD_16QAM = 1 << 1, + + MOD_32QAM = 1 << 2, + + MOD_64QAM = 1 << 3, + + MOD_128QAM = 1 << 4, + + MOD_256QAM = 1 << 5, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl new file mode 100644 index 0000000000..7dc3f0f858 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Outer Forward Error Correction (FEC) Type for DVBC. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbcOuterFec { + UNDEFINED = 0, + + OUTER_FEC_NONE, + + OUTER_FEC_RS, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcSettings.aidl new file mode 100644 index 0000000000..d18d373d6d --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcSettings.aidl @@ -0,0 +1,61 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendCableTimeInterleaveMode; +import android.hardware.tv.tuner.FrontendDvbcAnnex; +import android.hardware.tv.tuner.FrontendDvbcBandwidth; +import android.hardware.tv.tuner.FrontendDvbcModulation; +import android.hardware.tv.tuner.FrontendDvbcOuterFec; +import android.hardware.tv.tuner.FrontendInnerFec; +import android.hardware.tv.tuner.FrontendSpectralInversion; + +/** + * Signal Settings for an DVBC Frontend. + * @hide + */ +@VintfStability +parcelable FrontendDvbcSettings { + /** + * Signal frequency in Hertz + */ + int frequency; + + /** + * Signal end frequency in Hertz used by scan + */ + int endFrequency; + + FrontendDvbcModulation modulation = FrontendDvbcModulation.UNDEFINED; + + FrontendInnerFec fec = FrontendInnerFec.FEC_UNDEFINED; + + /** + * Symbols per second + */ + int symbolRate; + + FrontendDvbcOuterFec outerFec = FrontendDvbcOuterFec.UNDEFINED; + + FrontendDvbcAnnex annex = FrontendDvbcAnnex.UNDEFINED; + + FrontendSpectralInversion inversion = FrontendSpectralInversion.UNDEFINED; + + FrontendCableTimeInterleaveMode interleaveMode = FrontendCableTimeInterleaveMode.UNDEFINED; + + FrontendDvbcBandwidth bandwidth = FrontendDvbcBandwidth.UNDEFINED; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl new file mode 100644 index 0000000000..acff0125f6 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Capabilities for DVBS Frontend. + * @hide + */ +@VintfStability +parcelable FrontendDvbsCapabilities { + /** + * Modulation Types defined by FrontendDvbsModulation.. + */ + int modulationCap; + + /** + * Inner Forward Error Correction types defined by FrontendInnerFec. + */ + long innerfecCap; + + /** + * Sub standards defined by FrontendDvbsStandard. + */ + byte standard; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl new file mode 100644 index 0000000000..70ea3aba0c --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendInnerFec; + +/** + * Code Rate for DVBS. + * @hide + */ +@VintfStability +parcelable FrontendDvbsCodeRate { + FrontendInnerFec fec = FrontendInnerFec.FEC_UNDEFINED; + + boolean isLinear; + + /** + * true if enable short frame + */ + boolean isShortFrames; + + /** + * bits number in 1000 symbol. 0 if use the default. + */ + int bitsPer1000Symbol; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsModulation.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsModulation.aidl new file mode 100644 index 0000000000..3ba4c5ba9e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsModulation.aidl @@ -0,0 +1,61 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Modulation Type for DVBS. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbsModulation { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Modulation automatically + */ + AUTO = 1 << 0, + + MOD_QPSK = 1 << 1, + + MOD_8PSK = 1 << 2, + + MOD_16QAM = 1 << 3, + + MOD_16PSK = 1 << 4, + + MOD_32PSK = 1 << 5, + + MOD_ACM = 1 << 6, + + MOD_8APSK = 1 << 7, + + MOD_16APSK = 1 << 8, + + MOD_32APSK = 1 << 9, + + MOD_64APSK = 1 << 10, + + MOD_128APSK = 1 << 11, + + MOD_256APSK = 1 << 12, + + /** + * Reserved for Proprietary modulation + */ + MOD_RESERVED = 1 << 13, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsPilot.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsPilot.aidl new file mode 100644 index 0000000000..625ac2d457 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsPilot.aidl @@ -0,0 +1,33 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Pilot mode for DVBS. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbsPilot { + UNDEFINED, + + ON, + + OFF, + + AUTO, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl new file mode 100644 index 0000000000..76d0e16744 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Roll Off value for DVBS. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbsRolloff { + UNDEFINED, + + ROLLOFF_0_35, + + ROLLOFF_0_25, + + ROLLOFF_0_20, + + ROLLOFF_0_15, + + ROLLOFF_0_10, + + ROLLOFF_0_5, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsScanType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsScanType.aidl new file mode 100644 index 0000000000..1afbd938d5 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsScanType.aidl @@ -0,0 +1,35 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Scan type for a DVBS Frontend. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbsScanType { + UNDEFINED = 0, + + DIRECT, + + DISEQC, + + UNICABLE, + + JESS, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsSettings.aidl new file mode 100644 index 0000000000..d285ac1791 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsSettings.aidl @@ -0,0 +1,68 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendDvbsCodeRate; +import android.hardware.tv.tuner.FrontendDvbsModulation; +import android.hardware.tv.tuner.FrontendDvbsPilot; +import android.hardware.tv.tuner.FrontendDvbsRolloff; +import android.hardware.tv.tuner.FrontendDvbsStandard; +import android.hardware.tv.tuner.FrontendDvbsVcmMode; +import android.hardware.tv.tuner.FrontendDvbsScanType; +import android.hardware.tv.tuner.FrontendSpectralInversion; + +/** + * Signal Settings for an DVBS Frontend. + * @hide + */ +@VintfStability +parcelable FrontendDvbsSettings { + /** + * Signal frequency in Hertz + */ + int frequency; + + /** + * Signal end frequency in Hertz used by scan + */ + int endFrequency; + + FrontendSpectralInversion inversion = FrontendSpectralInversion.UNDEFINED; + + FrontendDvbsModulation modulation = FrontendDvbsModulation.UNDEFINED; + + FrontendDvbsCodeRate coderate; + + /** + * Symbols per second + */ + int symbolRate; + + FrontendDvbsRolloff rolloff = FrontendDvbsRolloff.UNDEFINED; + + FrontendDvbsPilot pilot = FrontendDvbsPilot.UNDEFINED; + + int inputStreamId; + + FrontendDvbsStandard standard = FrontendDvbsStandard.UNDEFINED; + + FrontendDvbsVcmMode vcmMode = FrontendDvbsVcmMode.UNDEFINED; + + FrontendDvbsScanType scanType = FrontendDvbsScanType.UNDEFINED; + + boolean isDiseqcRxMessage; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsStandard.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsStandard.aidl new file mode 100644 index 0000000000..bc8e0ea404 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsStandard.aidl @@ -0,0 +1,35 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Sub standards in DVBS. + * @hide + */ +@VintfStability +@Backing(type="byte") +enum FrontendDvbsStandard { + UNDEFINED = 0, + + AUTO = 1 << 0, + + S = 1 << 1, + + S2 = 1 << 2, + + S2X = 1 << 3, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl new file mode 100644 index 0000000000..2b41dcd201 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * VCM mode in DVBS. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbsVcmMode { + UNDEFINED, + + AUTO, + + MANUAL, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl new file mode 100644 index 0000000000..1d3135869c --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Bandwidth Type for DVBT. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbtBandwidth { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Bandwidth automatically + */ + AUTO = 1 << 0, + + BANDWIDTH_8MHZ = 1 << 1, + + BANDWIDTH_7MHZ = 1 << 2, + + BANDWIDTH_6MHZ = 1 << 3, + + BANDWIDTH_5MHZ = 1 << 4, + + BANDWIDTH_1_7MHZ = 1 << 5, + + BANDWIDTH_10MHZ = 1 << 6, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl new file mode 100644 index 0000000000..6bb473de00 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl @@ -0,0 +1,58 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Capabilities for DVBT Frontend. + * @hide + */ +@VintfStability +parcelable FrontendDvbtCapabilities { + /** + * Transmission Modes defined by FrontendDvbtTransmissionMode. + */ + int transmissionModeCap; + + /** + * Bandwidth Types defined by FrontendDvbtBandwidth. + */ + int bandwidthCap; + + /** + * Extended Constellations defined by FrontendDvbtConstellation. + */ + int constellationCap; + + /** + * Code Rates defined by FrontendDvbtCoderate. + */ + int coderateCap; + + /** + * Hierarchy Types defined by FrontendDvbtHierarchy. + */ + int hierarchyCap; + + /** + * Guard Interval Types defined by FrontendDvbtGuardInterval. + */ + int guardIntervalCap; + + boolean isT2Supported; + + boolean isMisoSupported; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl new file mode 100644 index 0000000000..511100386c --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl @@ -0,0 +1,50 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Code Rate for DVBT. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbtCoderate { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Hierarchy automatically + */ + AUTO = 1 << 0, + + CODERATE_1_2 = 1 << 1, + + CODERATE_2_3 = 1 << 2, + + CODERATE_3_4 = 1 << 3, + + CODERATE_5_6 = 1 << 4, + + CODERATE_7_8 = 1 << 5, + + CODERATE_3_5 = 1 << 6, + + CODERATE_4_5 = 1 << 7, + + CODERATE_6_7 = 1 << 8, + + CODERATE_8_9 = 1 << 9, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl new file mode 100644 index 0000000000..268077838d --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Extended Constellation for DVBT. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbtConstellation { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Constellation automatically + */ + AUTO = 1 << 0, + + CONSTELLATION_QPSK = 1 << 1, + + CONSTELLATION_16QAM = 1 << 2, + + CONSTELLATION_64QAM = 1 << 3, + + CONSTELLATION_256QAM = 1 << 4, + + CONSTELLATION_QPSK_R = 1 << 5, + + CONSTELLATION_16QAM_R = 1 << 6, + + CONSTELLATION_64QAM_R = 1 << 7, + + CONSTELLATION_256QAM_R = 1 << 8, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl new file mode 100644 index 0000000000..8d60b2ffd5 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Guard Interval Type for DVBT. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbtGuardInterval { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Guard Interval automatically + */ + AUTO = 1 << 0, + + INTERVAL_1_32 = 1 << 1, + + INTERVAL_1_16 = 1 << 2, + + INTERVAL_1_8 = 1 << 3, + + INTERVAL_1_4 = 1 << 4, + + INTERVAL_1_128 = 1 << 5, + + INTERVAL_19_128 = 1 << 6, + + INTERVAL_19_256 = 1 << 7, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl new file mode 100644 index 0000000000..859c7603f6 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Hierarchy Type for DVBT. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbtHierarchy { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Hierarchy automatically + */ + AUTO = 1 << 0, + + HIERARCHY_NON_NATIVE = 1 << 1, + + HIERARCHY_1_NATIVE = 1 << 2, + + HIERARCHY_2_NATIVE = 1 << 3, + + HIERARCHY_4_NATIVE = 1 << 4, + + HIERARCHY_NON_INDEPTH = 1 << 5, + + HIERARCHY_1_INDEPTH = 1 << 6, + + HIERARCHY_2_INDEPTH = 1 << 7, + + HIERARCHY_4_INDEPTH = 1 << 8, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl new file mode 100644 index 0000000000..fa70cc76e9 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Physical Layer Pipe (PLP) Mode for DVBT. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbtPlpMode { + UNDEFINED, + + AUTO, + + MANUAL, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtSettings.aidl new file mode 100644 index 0000000000..4af0d10294 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtSettings.aidl @@ -0,0 +1,84 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendDvbtBandwidth; +import android.hardware.tv.tuner.FrontendDvbtCoderate; +import android.hardware.tv.tuner.FrontendDvbtConstellation; +import android.hardware.tv.tuner.FrontendDvbtGuardInterval; +import android.hardware.tv.tuner.FrontendDvbtHierarchy; +import android.hardware.tv.tuner.FrontendDvbtPlpMode; +import android.hardware.tv.tuner.FrontendDvbtStandard; +import android.hardware.tv.tuner.FrontendDvbtTransmissionMode; +import android.hardware.tv.tuner.FrontendSpectralInversion; + +/** + * Signal Settings for DVBT Frontend. + * @hide + */ +@VintfStability +parcelable FrontendDvbtSettings { + /** + * Signal frequency in Hertz + */ + int frequency; + + /** + * Signal end frequency in Hertz used by scan + */ + int endFrequency; + + FrontendSpectralInversion inversion = FrontendSpectralInversion.UNDEFINED; + + FrontendDvbtTransmissionMode transmissionMode = FrontendDvbtTransmissionMode.UNDEFINED; + + FrontendDvbtBandwidth bandwidth = FrontendDvbtBandwidth.UNDEFINED; + + FrontendDvbtConstellation constellation = FrontendDvbtConstellation.UNDEFINED; + + FrontendDvbtHierarchy hierarchy = FrontendDvbtHierarchy.UNDEFINED; + + /** + * Code Rate for High Priority level + */ + FrontendDvbtCoderate hpCoderate = FrontendDvbtCoderate.UNDEFINED; + + /** + * Code Rate for Low Priority level + */ + FrontendDvbtCoderate lpCoderate = FrontendDvbtCoderate.UNDEFINED; + + FrontendDvbtGuardInterval guardInterval = FrontendDvbtGuardInterval.UNDEFINED; + + boolean isHighPriority; + + FrontendDvbtStandard standard = FrontendDvbtStandard.UNDEFINED; + + boolean isMiso; + + FrontendDvbtPlpMode plpMode = FrontendDvbtPlpMode.UNDEFINED; + + /** + * Physical Layer Pipe (PLP) Id + */ + byte plpId; + + /** + * Group Id for Physical Layer Pipe (PLP) + */ + byte plpGroupId; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtStandard.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtStandard.aidl new file mode 100644 index 0000000000..bf18618cdf --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtStandard.aidl @@ -0,0 +1,33 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Sub standards in DVBT. + * @hide + */ +@VintfStability +@Backing(type="byte") +enum FrontendDvbtStandard { + UNDEFINED = 0, + + AUTO = 1 << 0, + + T = 1 << 1, + + T2 = 1 << 2, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl new file mode 100644 index 0000000000..ef2ceef1b0 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl @@ -0,0 +1,50 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Extended Transmission Mode for DVBT. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendDvbtTransmissionMode { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Transmission Mode automatically + */ + AUTO = 1 << 0, + + MODE_2K = 1 << 1, + + MODE_8K = 1 << 2, + + MODE_4K = 1 << 3, + + MODE_1K = 1 << 4, + + MODE_16K = 1 << 5, + + MODE_32K = 1 << 6, + + MODE_8K_E = 1 << 7, + + MODE_16K_E = 1 << 8, + + MODE_32K_E = 1 << 9, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendEventType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendEventType.aidl new file mode 100644 index 0000000000..40b5161b3b --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendEventType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Frontend Event Type. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendEventType { + /** + * The frontend has locked to the signal specified by the tune method. + */ + LOCKED, + + /** + * The frontend is unable to lock to the signal specified by the tune method. + */ + NO_SIGNAL, + + /** + * The frontend has lost the lock to the signal specified by the tune method. + */ + LOST_LOCK, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendGuardInterval.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendGuardInterval.aidl new file mode 100644 index 0000000000..38935230da --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendGuardInterval.aidl @@ -0,0 +1,32 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendDvbtGuardInterval; +import android.hardware.tv.tuner.FrontendDtmbGuardInterval; + +/** + * @hide + */ +@VintfStability +union FrontendGuardInterval { + FrontendDvbtGuardInterval dvbt = FrontendDvbtGuardInterval.UNDEFINED; + + FrontendDvbtGuardInterval isdbt; + + FrontendDtmbGuardInterval dtmb; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendInfo.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendInfo.aidl new file mode 100644 index 0000000000..9f178db5a4 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendInfo.aidl @@ -0,0 +1,68 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendCapabilities; +import android.hardware.tv.tuner.FrontendStatusType; +import android.hardware.tv.tuner.FrontendType; + +/** + * Information for the Frontend. + * @hide + */ +@VintfStability +parcelable FrontendInfo { + FrontendType type = FrontendType.UNDEFINED; + + /** + * Frequency in Hertz + */ + int minFrequency; + + /** + * Frequency in Hertz + */ + int maxFrequency; + + /** + * Minimum symbols per second + */ + int minSymbolRate; + + /** + * Maximum symbols per second + */ + int maxSymbolRate; + + /** + * Range in Hertz + */ + int acquireRange; + + /** + * Frontends are assigned with the same exclusiveGroupId if they can't + * function at same time. For instance, they share same hardware module. + */ + int exclusiveGroupId; + + /** + * A list of supported status types which client can inquiry + */ + FrontendStatusType[] statusCaps; + + FrontendCapabilities frontendCaps; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendInnerFec.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendInnerFec.aidl new file mode 100644 index 0000000000..b94af4b825 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendInnerFec.aidl @@ -0,0 +1,296 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Inner Forward Error Correction type as specified in ETSI EN 300 468 V1.15.1 + * and ETSI EN 302 307-2 V1.1.1. + * @hide + */ +@VintfStability +@Backing(type="long") +enum FrontendInnerFec { + /** + * Not defined + */ + FEC_UNDEFINED = 0, + + /** + * hardware is able to detect and set FEC automatically + */ + AUTO = 1L << 0, + + /** + * 1/2 conv. code rate + */ + FEC_1_2 = 1L << 1, + + /** + * 1/3 conv. code rate + */ + FEC_1_3 = 1L << 2, + + /** + * 1/4 conv. code rate + */ + FEC_1_4 = 1L << 3, + + /** + * 1/5 conv. code rate + */ + FEC_1_5 = 1L << 4, + + /** + * 2/3 conv. code rate + */ + FEC_2_3 = 1L << 5, + + /** + * 2/5 conv. code rate + */ + FEC_2_5 = 1L << 6, + + /** + * 2/9 conv. code rate + */ + FEC_2_9 = 1L << 7, + + /** + * 3/4 conv. code rate + */ + FEC_3_4 = 1L << 8, + + /** + * 3/5 conv. code rate + */ + FEC_3_5 = 1L << 9, + + /** + * 4/5 conv. code rate + */ + FEC_4_5 = 1L << 10, + + /** + * 4/15 conv. code rate + */ + FEC_4_15 = 1L << 11, + + /** + * 5/6 conv. code rate + */ + FEC_5_6 = 1L << 12, + + /** + * 5/9 conv. code rate + */ + FEC_5_9 = 1L << 13, + + /** + * 6/7 conv. code rate + */ + FEC_6_7 = 1L << 14, + + /** + * 7/8 conv. code rate + */ + FEC_7_8 = 1L << 15, + + /** + * 7/9 conv. code rate + */ + FEC_7_9 = 1L << 16, + + /** + * 7/15 conv. code rate + */ + FEC_7_15 = 1L << 17, + + /** + * 8/9 conv. code rate + */ + FEC_8_9 = 1L << 18, + + /** + * 8/15 conv. code rate + */ + FEC_8_15 = 1L << 19, + + /** + * 9/10 conv. code rate + */ + FEC_9_10 = 1L << 20, + + /** + * 9/20 conv. code rate + */ + FEC_9_20 = 1L << 21, + + /** + * 11/15 conv. code rate + */ + FEC_11_15 = 1L << 22, + + /** + * 11/20 conv. code rate + */ + FEC_11_20 = 1L << 23, + + /** + * 11/45 conv. code rate + */ + FEC_11_45 = 1L << 24, + + /** + * 13/18 conv. code rate + */ + FEC_13_18 = 1L << 25, + + /** + * 13/45 conv. code rate + */ + FEC_13_45 = 1L << 26, + + /** + * 14/45 conv. code rate + */ + FEC_14_45 = 1L << 27, + + /** + * 23/36 conv. code rate + */ + FEC_23_36 = 1L << 28, + + /** + * 25/36 conv. code rate + */ + FEC_25_36 = 1L << 29, + + /** + * 26/45 conv. code rate + */ + FEC_26_45 = 1L << 30, + + /** + * 28/45 conv. code rate + */ + FEC_28_45 = 1L << 31, + + /** + * 29/45 conv. code rate + */ + FEC_29_45 = 1L << 32, + + /** + * 31/45 conv. code rate + */ + FEC_31_45 = 1L << 33, + + /** + * 32/45 conv. code rate + */ + FEC_32_45 = 1L << 34, + + /** + * 77/90 conv. code rate + */ + FEC_77_90 = 1L << 35, + + /** + * 2/15 conv. code rate + */ + FEC_2_15 = 1L << 36, + + /** + * 3/15 conv. code rate + */ + FEC_3_15 = 1L << 37, + + /** + * 5/15 conv. code rate + */ + FEC_5_15 = 1L << 38, + + /** + * 6/15 conv. code rate + */ + FEC_6_15 = 1L << 39, + + /** + * 9/15 conv. code rate + */ + FEC_9_15 = 1L << 40, + + /** + * 10/15 conv. code rate + */ + FEC_10_15 = 1L << 41, + + /** + * 12/15 conv. code rate + */ + FEC_12_15 = 1L << 42, + + /** + * 13/15 conv. code rate + */ + FEC_13_15 = 1L << 43, + + /** + * 18/30 conv. code rate + */ + FEC_18_30 = 1L << 44, + + /** + * 20/30 conv. code rate + */ + FEC_20_30 = 1L << 45, + + /** + * 90/180 conv. code rate + */ + FEC_90_180 = 1L << 46, + + /** + * 96/180 conv. code rate + */ + FEC_96_180 = 1L << 47, + + /** + * 104/180 conv. code rate + */ + FEC_104_180 = 1L << 48, + + /** + * 128/180 conv. code rate + */ + FEC_128_180 = 1L << 49, + + /** + * 132/180 conv. code rate + */ + FEC_132_180 = 1L << 50, + + /** + * 135/180 conv. code rate + */ + FEC_135_180 = 1L << 51, + + /** + * 140/180 conv. code rate + */ + FEC_140_180 = 1L << 52, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendInterleaveMode.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendInterleaveMode.aidl new file mode 100644 index 0000000000..3aa17ddd33 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendInterleaveMode.aidl @@ -0,0 +1,34 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode; +import android.hardware.tv.tuner.FrontendCableTimeInterleaveMode; +import android.hardware.tv.tuner.FrontendDtmbTimeInterleaveMode; + +/** + * @hide + */ +@VintfStability +union FrontendInterleaveMode { + FrontendAtsc3TimeInterleaveMode atsc3 + = FrontendAtsc3TimeInterleaveMode.UNDEFINED; + + FrontendCableTimeInterleaveMode dvbc; + + FrontendDtmbTimeInterleaveMode dtmb; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl new file mode 100644 index 0000000000..a98e1b35b9 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl @@ -0,0 +1,34 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Capabilities for ISDBS3 Frontend. + * @hide + */ +@VintfStability +parcelable FrontendIsdbs3Capabilities { + /** + * Modulaltion Types defined by FrontendIsdbs3Modulation. + */ + int modulationCap; + + /** + * Code Rate Types defined by FrontendIsdbs3Coderate. + */ + int coderateCap; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl new file mode 100644 index 0000000000..9e36c1e576 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Code Rate Type for ISDBS3. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIsdbs3Coderate { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Code Rate automatically + */ + AUTO = 1 << 0, + + CODERATE_1_3 = 1 << 1, + + CODERATE_2_5 = 1 << 2, + + CODERATE_1_2 = 1 << 3, + + CODERATE_3_5 = 1 << 4, + + CODERATE_2_3 = 1 << 5, + + CODERATE_3_4 = 1 << 6, + + CODERATE_7_9 = 1 << 7, + + CODERATE_4_5 = 1 << 8, + + CODERATE_5_6 = 1 << 9, + + CODERATE_7_8 = 1 << 10, + + CODERATE_9_10 = 1 << 11, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl new file mode 100644 index 0000000000..5041f631df --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Modulaltion Type for ISDBS3. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIsdbs3Modulation { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Modulation automatically + */ + AUTO = 1 << 0, + + MOD_BPSK = 1 << 1, + + MOD_QPSK = 1 << 2, + + MOD_8PSK = 1 << 3, + + MOD_16APSK = 1 << 4, + + MOD_32APSK = 1 << 5, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl new file mode 100644 index 0000000000..bdef4d772b --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl @@ -0,0 +1,29 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Roll of Type for ISDBS3. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIsdbs3Rolloff { + UNDEFINED, + + ROLLOFF_0_03, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl new file mode 100644 index 0000000000..a7c85ac153 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendIsdbs3Coderate; +import android.hardware.tv.tuner.FrontendIsdbs3Modulation; +import android.hardware.tv.tuner.FrontendIsdbs3Rolloff; +import android.hardware.tv.tuner.FrontendIsdbsStreamIdType; + +/** + * Signal Settings for ISDBS3 Frontend. + * @hide + */ +@VintfStability +parcelable FrontendIsdbs3Settings { + /** + * Signal frequency in Hertz + */ + int frequency; + + /** + * Signal end frequency in Hertz used by scan + */ + int endFrequency; + + char streamId; + + FrontendIsdbsStreamIdType streamIdType = FrontendIsdbsStreamIdType.UNDEFINED; + + FrontendIsdbs3Modulation modulation = FrontendIsdbs3Modulation.UNDEFINED; + + FrontendIsdbs3Coderate coderate = FrontendIsdbs3Coderate.UNDEFINED; + + /** + * Symbols per second + */ + int symbolRate; + + FrontendIsdbs3Rolloff rolloff = FrontendIsdbs3Rolloff.UNDEFINED; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl new file mode 100644 index 0000000000..842609ec31 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl @@ -0,0 +1,34 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Capabilities for ISDBS Frontend. + * @hide + */ +@VintfStability +parcelable FrontendIsdbsCapabilities { + /** + * Modulation Types defined by FrontendIsdbsModulation. + */ + int modulationCap; + + /** + * Code Rates defined by FrontendIsdbsCoderate. + */ + int coderateCap; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl new file mode 100644 index 0000000000..afcb05e437 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Code Rate Type for ISDBS. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIsdbsCoderate { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Code Rate automatically + */ + AUTO = 1 << 0, + + CODERATE_1_2 = 1 << 1, + + CODERATE_2_3 = 1 << 2, + + CODERATE_3_4 = 1 << 3, + + CODERATE_5_6 = 1 << 4, + + CODERATE_7_8 = 1 << 5, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl new file mode 100644 index 0000000000..051580cbba --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Modulation Type for ISDBS. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIsdbsModulation { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Modulation automatically + */ + AUTO = 1 << 0, + + MOD_BPSK = 1 << 1, + + MOD_QPSK = 1 << 2, + + MOD_TC8PSK = 1 << 3, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl new file mode 100644 index 0000000000..961f16b333 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl @@ -0,0 +1,29 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Roll Off Type for ISDBS. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIsdbsRolloff { + UNDEFINED, + + ROLLOFF_0_35, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl new file mode 100644 index 0000000000..dde3002434 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendIsdbsCoderate; +import android.hardware.tv.tuner.FrontendIsdbsModulation; +import android.hardware.tv.tuner.FrontendIsdbsRolloff; +import android.hardware.tv.tuner.FrontendIsdbsStreamIdType; + +/** + * Signal Settings for ISDBS Frontend. + * @hide + */ +@VintfStability +parcelable FrontendIsdbsSettings { + /** + * Signal frequency in Hertz + */ + int frequency; + + /** + * Signal end frequency in Hertz used by scan + */ + int endFrequency; + + char streamId; + + FrontendIsdbsStreamIdType streamIdType = FrontendIsdbsStreamIdType.UNDEFINED; + + FrontendIsdbsModulation modulation = FrontendIsdbsModulation.UNDEFINED; + + FrontendIsdbsCoderate coderate = FrontendIsdbsCoderate.UNDEFINED; + + /** + * Symbols per second + */ + int symbolRate; + + FrontendIsdbsRolloff rolloff = FrontendIsdbsRolloff.UNDEFINED; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl new file mode 100644 index 0000000000..66b56947c8 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Stream Id Type for ISDBS. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIsdbsStreamIdType { + STREAM_ID, + + RELATIVE_STREAM_NUMBER, + + UNDEFINED, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl new file mode 100644 index 0000000000..f4a1450479 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Bandwidth for ISDBT. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIsdbtBandwidth { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Bandwidth automatically + */ + AUTO = 1 << 0, + + BANDWIDTH_8MHZ = 1 << 1, + + BANDWIDTH_7MHZ = 1 << 2, + + BANDWIDTH_6MHZ = 1 << 3, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl new file mode 100644 index 0000000000..148090613e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Capabilities for ISDBT Frontend. + * @hide + */ +@VintfStability +parcelable FrontendIsdbtCapabilities { + /** + * Modes defined by FrontendIsdbtMode. + */ + int modeCap; + + /** + * Bandwidths defined by FrontendIsdbtBandwidth. + */ + int bandwidthCap; + + /** + * Modulations defined by FrontendIsdbtModulation. + */ + int modulationCap; + + /** + * Code Rates defined by FrontendDvbtCoderate. + */ + int coderateCap; + + /** + * Guard Interval Types defined by FrontendDvbtGuardInterval. + */ + int guardIntervalCap; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl new file mode 100644 index 0000000000..0a857b1dd9 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl @@ -0,0 +1,50 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Hierarchy Type for ISDBT. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIsdbtCoderate { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Hierarchy automatically + */ + AUTO = 1 << 0, + + CODERATE_1_2 = 1 << 1, + + CODERATE_2_3 = 1 << 2, + + CODERATE_3_4 = 1 << 3, + + CODERATE_5_6 = 1 << 4, + + CODERATE_7_8 = 1 << 5, + + CODERATE_3_5 = 1 << 6, + + CODERATE_4_5 = 1 << 7, + + CODERATE_6_7 = 1 << 8, + + CODERATE_8_9 = 1 << 9, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl new file mode 100644 index 0000000000..a3540dcb6e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Guard Interval Type for ISDBT. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIsdbtGuardInterval { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Guard Interval automatically + */ + AUTO = 1 << 0, + + INTERVAL_1_32 = 1 << 1, + + INTERVAL_1_16 = 1 << 2, + + INTERVAL_1_8 = 1 << 3, + + INTERVAL_1_4 = 1 << 4, + + INTERVAL_1_128 = 1 << 5, + + INTERVAL_19_128 = 1 << 6, + + INTERVAL_19_256 = 1 << 7, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtMode.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtMode.aidl new file mode 100644 index 0000000000..1a130fb220 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtMode.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Mode for ISDBT. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIsdbtMode { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Mode automatically + */ + AUTO = 1 << 0, + + MODE_1 = 1 << 1, + + MODE_2 = 1 << 2, + + MODE_3 = 1 << 3, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl new file mode 100644 index 0000000000..b94f57882a --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Modulation for ISDBT. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendIsdbtModulation { + UNDEFINED = 0, + + /** + * hardware is able to detect and set Modulation automatically + */ + AUTO = 1 << 0, + + MOD_DQPSK = 1 << 1, + + MOD_QPSK = 1 << 2, + + MOD_16QAM = 1 << 3, + + MOD_64QAM = 1 << 4, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl new file mode 100644 index 0000000000..73d935ad9b --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl @@ -0,0 +1,55 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendDvbtCoderate; +import android.hardware.tv.tuner.FrontendDvbtGuardInterval; +import android.hardware.tv.tuner.FrontendIsdbtBandwidth; +import android.hardware.tv.tuner.FrontendIsdbtMode; +import android.hardware.tv.tuner.FrontendIsdbtModulation; +import android.hardware.tv.tuner.FrontendSpectralInversion; + +/** + * Signal Settings for ISDBT Frontend. + * @hide + */ +@VintfStability +parcelable FrontendIsdbtSettings { + /** + * Signal frequency in Hertz + */ + int frequency; + + /** + * Signal end frequency in Hertz used by scan + */ + int endFrequency; + + FrontendSpectralInversion inversion = FrontendSpectralInversion.UNDEFINED; + + FrontendIsdbtModulation modulation = FrontendIsdbtModulation.UNDEFINED; + + FrontendIsdbtBandwidth bandwidth = FrontendIsdbtBandwidth.UNDEFINED; + + FrontendIsdbtMode mode = FrontendIsdbtMode.UNDEFINED; + + FrontendDvbtCoderate coderate = FrontendDvbtCoderate.UNDEFINED; + + FrontendDvbtGuardInterval guardInterval = FrontendDvbtGuardInterval.UNDEFINED; + + int serviceAreaId; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendModulation.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendModulation.aidl new file mode 100644 index 0000000000..dd09ff6f09 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendModulation.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendAtsc3Modulation; +import android.hardware.tv.tuner.FrontendAtscModulation; +import android.hardware.tv.tuner.FrontendDvbcModulation; +import android.hardware.tv.tuner.FrontendDvbsModulation; +import android.hardware.tv.tuner.FrontendIsdbs3Modulation; +import android.hardware.tv.tuner.FrontendIsdbsModulation; +import android.hardware.tv.tuner.FrontendIsdbtModulation; +import android.hardware.tv.tuner.FrontendDtmbModulation; +import android.hardware.tv.tuner.FrontendDvbtConstellation; + +/** + * @hide + */ +@VintfStability +union FrontendModulation { + FrontendDvbcModulation dvbc = FrontendDvbcModulation.UNDEFINED; + + FrontendDvbsModulation dvbs; + + FrontendDvbtConstellation dvbt; + + FrontendIsdbsModulation isdbs; + + FrontendIsdbs3Modulation isdbs3; + + FrontendIsdbtModulation isdbt; + + FrontendAtscModulation atsc; + + FrontendAtsc3Modulation atsc3; + + FrontendDtmbModulation dtmb; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendModulationStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendModulationStatus.aidl new file mode 100644 index 0000000000..8630c7dde7 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendModulationStatus.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendDvbcModulation; +import android.hardware.tv.tuner.FrontendDvbsModulation; +import android.hardware.tv.tuner.FrontendIsdbs3Modulation; +import android.hardware.tv.tuner.FrontendIsdbsModulation; +import android.hardware.tv.tuner.FrontendIsdbtModulation; + +/** + * Modulation Type for Frontend's status. + * @hide + */ +@VintfStability +union FrontendModulationStatus { + FrontendDvbcModulation dvbc = FrontendDvbcModulation.UNDEFINED; + + FrontendDvbsModulation dvbs; + + FrontendIsdbsModulation isdbs; + + FrontendIsdbs3Modulation isdbs3; + + FrontendIsdbtModulation isdbt; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendRollOff.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendRollOff.aidl new file mode 100644 index 0000000000..2b8e887749 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendRollOff.aidl @@ -0,0 +1,33 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendDvbsRolloff; +import android.hardware.tv.tuner.FrontendIsdbs3Rolloff; +import android.hardware.tv.tuner.FrontendIsdbsRolloff; + +/** + * @hide + */ +@VintfStability +union FrontendRollOff { + FrontendDvbsRolloff dvbs = FrontendDvbsRolloff.UNDEFINED; + + FrontendIsdbsRolloff isdbs; + + FrontendIsdbs3Rolloff isdbs3; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl new file mode 100644 index 0000000000..1fe2b1ff2c --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl @@ -0,0 +1,28 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * ATSC3.0 PLP information for scan + * @hide + */ +@VintfStability +parcelable FrontendScanAtsc3PlpInfo { + byte plpId; + + boolean bLlsFlag; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl new file mode 100644 index 0000000000..d89e9b1c36 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl @@ -0,0 +1,73 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendAnalogType; +import android.hardware.tv.tuner.FrontendDvbcAnnex; +import android.hardware.tv.tuner.FrontendDvbtHierarchy; +import android.hardware.tv.tuner.FrontendModulation; +import android.hardware.tv.tuner.FrontendScanAtsc3PlpInfo; +import android.hardware.tv.tuner.FrontendScanMessageStandard; + +/** + * Scan Message for Frontend. + * @hide + */ +@VintfStability +union FrontendScanMessage { + boolean isLocked; + + boolean isEnd; + + /** + * scan progress percent (0..100) + */ + byte progressPercent; + + /** + * Signal frequencies in Hertz + */ + int[] frequencies; + + /** + * Symbols per second + */ + int[] symbolRates; + + FrontendDvbtHierarchy hierarchy; + + FrontendAnalogType analogType; + + byte[] plpIds; + + byte[] groupIds; + + char[] inputStreamIds; + + FrontendScanMessageStandard std; + + /** + * A list of PLP status in a tuned frequency band for ATSC3 frontend. + */ + FrontendScanAtsc3PlpInfo[] atsc3PlpInfos; + + FrontendModulation modulation; + + FrontendDvbcAnnex annex; + + boolean isHighPriority; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl new file mode 100644 index 0000000000..9df725ed99 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl @@ -0,0 +1,33 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendAnalogSifStandard; +import android.hardware.tv.tuner.FrontendDvbsStandard; +import android.hardware.tv.tuner.FrontendDvbtStandard; + +/** + * @hide + */ +@VintfStability +union FrontendScanMessageStandard { + FrontendDvbsStandard sStd = FrontendDvbsStandard.UNDEFINED; + + FrontendDvbtStandard tStd; + + FrontendAnalogSifStandard sifStd; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl new file mode 100644 index 0000000000..2b91216f6e --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl @@ -0,0 +1,89 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Scan Message Type for Frontend. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendScanMessageType { + /** + * Scan locked the signal. + */ + LOCKED, + + /** + * Scan stopped. + */ + END, + + /** + * Scan progress report. + */ + PROGRESS_PERCENT, + + /** + * Locked frequency report. + */ + FREQUENCY, + + /** + * Locked symbol rate. + */ + SYMBOL_RATE, + + /** + * Locked HIERARCHY for DVBT2 frontend. + */ + HIERARCHY, + + ANALOG_TYPE, + + /** + * Locked Plp Ids for DVBT2 frontend. + */ + + PLP_IDS, + + /** + * Locked group Ids for DVBT2 frontend. + */ + GROUP_IDS, + + /** + * Stream Ids. + */ + INPUT_STREAM_IDS, + + /** + * Locked signal standard. + */ + STANDARD, + + /** + * PLP status in a tuned frequency band for ATSC3 frontend. + */ + ATSC3_PLP_INFO, + + MODULATION, + + DVBC_ANNEX, + + HIGH_PRIORITY, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanType.aidl new file mode 100644 index 0000000000..a548a3d0ba --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanType.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Scan type for Frontend. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendScanType { + SCAN_UNDEFINED = 0, + + SCAN_AUTO = 1 << 0, + + SCAN_BLIND = 1 << 1, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendSettings.aidl new file mode 100644 index 0000000000..f78b2ae82b --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendSettings.aidl @@ -0,0 +1,55 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendAnalogSettings; +import android.hardware.tv.tuner.FrontendAtsc3Settings; +import android.hardware.tv.tuner.FrontendAtscSettings; +import android.hardware.tv.tuner.FrontendDvbcSettings; +import android.hardware.tv.tuner.FrontendDvbsSettings; +import android.hardware.tv.tuner.FrontendDvbtSettings; +import android.hardware.tv.tuner.FrontendIsdbs3Settings; +import android.hardware.tv.tuner.FrontendIsdbsSettings; +import android.hardware.tv.tuner.FrontendIsdbtSettings; +import android.hardware.tv.tuner.FrontendDtmbSettings; + +/** + * Signal Settings for Frontend. + * @hide + */ +@VintfStability +union FrontendSettings { + FrontendAnalogSettings analog; + + FrontendAtscSettings atsc; + + FrontendAtsc3Settings atsc3; + + FrontendDvbsSettings dvbs; + + FrontendDvbcSettings dvbc; + + FrontendDvbtSettings dvbt; + + FrontendIsdbsSettings isdbs; + + FrontendIsdbs3Settings isdbs3; + + FrontendIsdbtSettings isdbt; + + FrontendDtmbSettings dtmb; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendSpectralInversion.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendSpectralInversion.aidl new file mode 100644 index 0000000000..232385b1b0 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendSpectralInversion.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Spectral Inversion Type. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendSpectralInversion { + UNDEFINED, + + NORMAL, + + INVERTED, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl new file mode 100644 index 0000000000..b9f73add65 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl @@ -0,0 +1,193 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendBandwidth; +import android.hardware.tv.tuner.FrontendDvbtHierarchy; +import android.hardware.tv.tuner.FrontendGuardInterval; +import android.hardware.tv.tuner.FrontendInnerFec; +import android.hardware.tv.tuner.FrontendInterleaveMode; +import android.hardware.tv.tuner.FrontendModulation; +import android.hardware.tv.tuner.FrontendModulationStatus; +import android.hardware.tv.tuner.FrontendRollOff; +import android.hardware.tv.tuner.FrontendSpectralInversion; +import android.hardware.tv.tuner.FrontendStatusAtsc3PlpInfo; +import android.hardware.tv.tuner.FrontendTransmissionMode; +import android.hardware.tv.tuner.LnbVoltage; + +/** + * The status for Frontend. + * @hide + */ +@VintfStability +union FrontendStatus { + /** + * Lock status for Demod in True/False. + */ + boolean isDemodLocked; + + /** + * SNR value measured by 0.001 dB. + */ + int snr; + + /** + * The number of error bit per 1 billion bits. + */ + int ber; + + /** + * The number of error package per 1 billion packages. + */ + int per; + + /** + * The number of error bit per 1 billion bits before FEC. + */ + int preBer; + + /** + * Signal Quality in percent. + */ + int signalQuality; + + /** + * Signal Strength measured by 0.001 dBm. + */ + int signalStrength; + + /** + * Symbols per second + */ + int symbolRate; + + FrontendInnerFec innerFec; + + FrontendModulationStatus modulationStatus; + + FrontendSpectralInversion inversion; + + LnbVoltage lnbVoltage; + + byte plpId; + + boolean isEWBS; + + /** + * AGC value is normalized from 0 to 255. + */ + byte agc; + + boolean isLnaOn; + + boolean[] isLayerError; + + /** + * MER value measured by 0.001 dB + */ + int mer; + + /** + * Frequency difference in Hertz. + */ + int freqOffset; + + FrontendDvbtHierarchy hierarchy; + + boolean isRfLocked; + + /** + * A list of PLP status for tuned PLPs for ATSC3 frontend. + */ + FrontendStatusAtsc3PlpInfo[] plpInfo; + + /** + * Modulation status. + */ + FrontendModulation[] modulations; + + /** + * Bit error ratio status. + */ + int[] bers; + + /** + * Code rate status. + */ + FrontendInnerFec[] codeRates; + + /** + * Bandwidth status. + */ + FrontendBandwidth bandwidth; + + /** + * Guard interval status. + */ + FrontendGuardInterval interval; + + /** + * Transmission mode status. + */ + FrontendTransmissionMode transmissionMode; + + /** + * Uncorrectable Error Counts of the frontend's Physical Layer Pipe (PLP) + * since the last tune operation. + */ + int uec; + + /** + * The current DVB-T2 system id status. + */ + char systemId; + + /** + * Frontend Interleaving Modes. + */ + FrontendInterleaveMode[] interleaving; + + /** + * Segments in ISDB-T Specification of all the channels. + */ + byte[] isdbtSegment; + + /** + * Transport Stream Data Rate in BPS of the current channel. + */ + int[] tsDataRate; + + /** + * Roll Off Type status of the frontend. + */ + FrontendRollOff rollOff; + + /** + * If the frontend currently supports MISO or not. + */ + boolean isMiso; + + /** + * If the frontend code rate is linear or not. + */ + boolean isLinear; + + /** + * If short frames is enabled or not. + */ + boolean isShortFrames; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl new file mode 100644 index 0000000000..c10a08c00f --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Status for each tuning PLPs + * @hide + */ +@VintfStability +parcelable FrontendStatusAtsc3PlpInfo { + /** + * PLP Id value. + */ + byte plpId; + + /** + * Demod Lock/Unlock status of this particular PLP. + */ + boolean isLocked; + + /** + * Uncorrectable Error Counts (UEC) of this particular PLP since last tune operation. + */ + int uec; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl new file mode 100644 index 0000000000..93b75b00d2 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl @@ -0,0 +1,211 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Frontend Status Type. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendStatusType { + /** + * Lock status for Demod. + */ + DEMOD_LOCK, + + /** + * Signal to Noise Ratio. + */ + SNR, + + /** + * Bit Error Ratio. + */ + BER, + + /** + * Packages Error Ratio. + */ + PER, + + /** + * Bit Error Ratio before FEC. + */ + PRE_BER, + + /** + * Signal Quality (0..100). Good data over total data in percent can be + * used as a way to present Signal Quality. + */ + SIGNAL_QUALITY, + + /** + * Signal Strength. + */ + SIGNAL_STRENGTH, + + /** + * Symbol Rate. + */ + SYMBOL_RATE, + + /** + * Forward Error Correction Type. + */ + FEC, + + /** + * Modulation Type. + */ + MODULATION, + + /** + * Spectral Inversion Type. + */ + SPECTRAL, + + /** + * LNB Voltage. + */ + LNB_VOLTAGE, + + /** + * Physical Layer Pipe ID. + */ + PLP_ID, + + /** + * Status for Emergency Warning Broadcasting System. + */ + EWBS, + + /** + * Automatic Gain Control. + */ + AGC, + + /** + * Low Noise Amplifier. + */ + LNA, + + /** + * Error status by layer. + */ + LAYER_ERROR, + + /** + * Moduration Error Ratio. + */ + MER, + + /** + * Difference between tuning frequency and actual locked frequency. + */ + FREQ_OFFSET, + + /** + * Hierarchy for DVBT. + */ + HIERARCHY, + + /** + * Lock status for RF. + */ + RF_LOCK, + + /** + * PLP information in a frequency band for ATSC3.0 frontend. + */ + ATSC3_PLP_INFO, + + /** + * Modulation Types. + */ + MODULATIONS, + + /** + * Bit Error Ratios. + */ + BERS, + /** + * Code Rates. + */ + CODERATES, + + /** + * Extended Bandwidth. + */ + BANDWIDTH, + + /** + * Extended Guard Intervals. + */ + GUARD_INTERVAL, + + /** + * Extended Transmission Mode. + */ + TRANSMISSION_MODE, + + /** + * Uncorrectable Error Counts of the frontend's Physical Layer Pipe (PLP) + * since the last tune operation. + */ + UEC, + + /** + * DVB-T2 System Id. + */ + T2_SYSTEM_ID, + + /** + * Frontend Interleaving Modes. + */ + INTERLEAVINGS, + + /** + * Segments in ISDB-T Specification of all the channels. + */ + ISDBT_SEGMENTS, + + /** + * Transport Stream Data Rate in BPS of the current channel. + */ + TS_DATA_RATES, + + /** + * Roll Off Type status of the frontend. + */ + ROLL_OFF, + + /** + * If the frontend currently supports MISO or not. + */ + IS_MISO, + + /** + * If the frontend code rate is linear or not. + */ + IS_LINEAR, + + /** + * If short frames is enabled or not. + */ + IS_SHORT_FRAMES, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendTransmissionMode.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendTransmissionMode.aidl new file mode 100644 index 0000000000..42b8718ac6 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendTransmissionMode.aidl @@ -0,0 +1,33 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendIsdbtMode; +import android.hardware.tv.tuner.FrontendDtmbTransmissionMode; +import android.hardware.tv.tuner.FrontendDvbtTransmissionMode; + +/** + * @hide + */ +@VintfStability +union FrontendTransmissionMode { + FrontendDvbtTransmissionMode dvbt = FrontendDvbtTransmissionMode.UNDEFINED; + + FrontendIsdbtMode isdbt; + + FrontendDtmbTransmissionMode dtmb; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendType.aidl new file mode 100644 index 0000000000..8ade389393 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendType.aidl @@ -0,0 +1,82 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Extended Frontend Type. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendType { + UNDEFINED = 0, + + ANALOG, + + /** + * Advanced Television Systems Committee (ATSC) Standard A/72. + */ + ATSC, + + /** + * Advanced Television Systems Committee (ATSC 3.0) Standard A/300. + */ + ATSC3, + + /** + * Digital Video Broadcasting - Cable + * DVB Cable Frontend Standard ETSI EN 300 468 V1.15.1. + */ + DVBC, + + /** + * Digital Video Broadcasting - Satellite + * DVB Satellite Frontend Standard ETSI EN 300 468 V1.15.1 and + * ETSI EN 302 307-2 V1.1.1. + */ + DVBS, + + /** + * Digital Video Broadcasting - Terrestrial + * DVB Terrestrial Frontend Standard ETSI EN 300 468 V1.15.1 and + * ETSI EN 302 755 V1.4.1. + */ + DVBT, + + /** + * Integrated Services Digital Broadcasting-Satellite (ISDB-S) + * ARIB STD-B20 is technical document of ISDB-S. + */ + ISDBS, + + /** + * Integrated Services Digital Broadcasting-Satellite (ISDB-S) + * ARIB STD-B44 is technical document of ISDB-S3. + */ + ISDBS3, + + /** + * Integrated Services Digital Broadcasting-Terrestrial (ISDB-T or SBTVD) + * ABNT NBR 15603 is technical document of ISDB-T. + */ + ISDBT, + + /** + * DTMB (Digital Terrestrial Multimedia Broadcast) standard. + */ + DTMB, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IDemux.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IDemux.aidl new file mode 100644 index 0000000000..7d69240116 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/IDemux.aidl @@ -0,0 +1,133 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxFilterType; +import android.hardware.tv.tuner.DvrType; +import android.hardware.tv.tuner.IDvr; +import android.hardware.tv.tuner.IDvrCallback; +import android.hardware.tv.tuner.IFilter; +import android.hardware.tv.tuner.IFilterCallback; +import android.hardware.tv.tuner.ITimeFilter; + +/** + * Demultiplexer(Demux) takes a single multiplexed input and splits it into + * one or more output. + * @hide + */ +@VintfStability +interface IDemux { + /** + * Set a frontend resource as data input of the demux + * + * It is used by the client to specify a hardware frontend as data source of + * this demux instance. A demux instance can have only one data source. + */ + void setFrontendDataSource(in int frontendId); + + /** + * Open a new filter in the demux + * + * It is used by the client to open a filter in the demux. + * + * @param type the type of the filter to be added. + * @param bufferSize the buffer size of the filter to be opened. It's used + * to create a FMQ(Fast Message Queue) to hold data output from the filter. + * @param cb the callback for the filter to be used to send notifications + * back to the client. + * + * @return the filter instance of the newly added. + */ + IFilter openFilter(in DemuxFilterType type, in int bufferSize, + in IFilterCallback cb); + + /** + * Open time filter of the demux + * + * It is used by the client to open time filter of the demux. + * + * @return the time filter instance of the newly added. + */ + ITimeFilter openTimeFilter(); + + /** + * Get hardware sync ID for audio and video. + * + * It is used by the client to get the hardware sync ID for audio and video. + * + * @param filter the filter instance. + * + * @return the ID of hardware A/V sync. + */ + int getAvSyncHwId(in IFilter filter); + + /** + * Get current time stamp to use for A/V sync + * + * It is used by the client to get current time stamp for A/V sync. HW is + * supported to increment and maintain current time stamp. + * + * @param avSyncHwId the hardware id of A/V sync. + * + * @return the current time stamp of hardware A/V sync. The time stamp + * based on 90KHz has the same format as PTS (Presentation Time Stamp). + */ + long getAvSyncTime(in int avSyncHwId); + + /** + * Close the Demux instance + * + * It is used by the client to release the demux instance. HAL clear + * underneath resource. client mustn't access the instance any more. + */ + void close(); + + /** + * Open a DVR (Digital Video Record) instance in the demux + * + * It is used by the client to record and playback. + * + * @param type specify which kind of DVR to open. + * @param bufferSize the buffer size of the output to be added. It's used to + * create a FMQ(Fast Message Queue) to hold data from selected filters. + * @param cb the callback for the DVR to be used to send notifications + * back to the client. + * + * @return the newly opened DVR instance. + */ + IDvr openDvr(in DvrType type, in int bufferSize, in IDvrCallback cb); + + /** + * Connect Conditional Access Modules (CAM) through Common Interface (CI) + * + * It is used by the client to connect CI-CAM. The demux uses the output + * from the frontend as the input by default, and must change to use the + * output from CI-CAM as the input after this call take place. + * + * @param ciCamId specify CI-CAM Id to connect. + */ + void connectCiCam(in int ciCamId); + + /** + * Disconnect Conditional Access Modules (CAM) + * + * It is used by the client to disconnect CI-CAM. The demux will use the + * output from the frontend as the input after this call take place. + * + */ + void disconnectCiCam(); +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IDescrambler.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IDescrambler.aidl new file mode 100644 index 0000000000..86438284d7 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/IDescrambler.aidl @@ -0,0 +1,81 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxPid; +import android.hardware.tv.tuner.IFilter; + +/** + * Descrambler is used to descramble input data. + * @hide + */ +@VintfStability +interface IDescrambler { + /** + * Set a demux as source of the descrambler + * + * It is used by the client to specify a demux as source of this + * descrambler. A descrambler instance can have only one source, and + * this method can be only called once. + * + * @param demuxId the id of the demux to be used as descrambler's source. + */ + void setDemuxSource(in int demuxId); + + /** + * Set a key token to link descrambler to a key slot + * + * It is used by the client to link a hardware key slot to a descrambler. + * A descrambler instance can have only one key slot to link, but a key + * slot can hold a few keys for different purposes. + * + * @param keyToken the token to be used to link the key slot. + */ + void setKeyToken(in byte[] keyToken); + + /** + * Add packets' PID to the descrambler for descrambling + * + * It is used by the client to specify Package ID (PID) of packets which the + * descrambler start to descramble. Multiple PIDs can be added into one + * descrambler instance because descambling can happen simultaneously on + * packets from different PIDs. + * + * @param pid the PID of packets to start to be descrambled. + * @param filter an optional filter instance to identify upper stream. + */ + void addPid(in DemuxPid pid, in IFilter optionalSourceFilter); + + /** + * Remove packets' PID from the descrambler + * + * It is used by the client to specify Package ID (PID) of packets which the + * descrambler stop to descramble. + * + * @param pid the PID of packets to stop to be descrambled. + * @param filter an optional filter instance to identify upper stream. + */ + void removePid(in DemuxPid pid, in IFilter optionalSourceFilter); + + /** + * Release the descrambler instance + * + * It is used by the client to release the descrambler instance. HAL clear + * underneath resource. client mustn't access the instance any more. + */ + void close(); +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IDvr.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IDvr.aidl new file mode 100644 index 0000000000..0534f9d884 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/IDvr.aidl @@ -0,0 +1,104 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.common.fmq.MQDescriptor; +import android.hardware.common.fmq.SynchronizedReadWrite; + +import android.hardware.tv.tuner.DvrSettings; +import android.hardware.tv.tuner.IFilter; + +/** + * Digtal Video Record (DVR) interface provides record control on Demux's + * output buffer and playback control on Demux's input buffer. + * @hide + */ +@VintfStability +interface IDvr { + /** + * Get the descriptor of the DVR's FMQ + * + * It is used by the client to get the descriptor of the DVR's Fast + * Message Queue. The FMQ is used to transfer record or playback data + * between the client and the HAL. + * + * @return the descriptor of the DVR's FMQ + */ + void getQueueDesc(out MQDescriptor queue); + + /** + * Configure the DVR. + * + * It is used by the client to configure the DVR interface. + * + * @param settings the settings of the DVR interface. + */ + void configure(in DvrSettings settings); + + /** + * Attach one filter to DVR interface for recording. + * + * It is used by the client to add the data filtered out from the filter + * to record. + * + * @param filter the instance of the attached filter. + */ + void attachFilter(in IFilter filter); + + /** + * Detach one filter from the DVR's recording. + * + * It is used by the client to remove the data of the filter from DVR's + * recording. + * + * @param filter the instance of the detached filter. + */ + void detachFilter(in IFilter filter); + + /** + * Start DVR. + * + * It is used by the client to ask the DVR to start consuming playback data + * or producing data for record. + */ + void start(); + + /** + * Stop DVR. + * + * It is used by the client to ask the DVR to stop consuming playback data + * or producing data for record. + */ + void stop(); + + /** + * Flush DVR data. + * + * It is used by the client to ask the DVR to flush the data which is + * not consumed by HAL for playback or the client for record yet. + */ + void flush(); + + /** + * close the DVR instance to release resource for DVR. + * + * It is used by the client to close the DVR instance, and HAL clears + * underneath resource for this DVR instance. Client mustn't access the + * instance any more and all methods should return a failure. + */ + void close(); +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IDvrCallback.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IDvrCallback.aidl new file mode 100644 index 0000000000..46d48567b0 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/IDvrCallback.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.PlaybackStatus; +import android.hardware.tv.tuner.RecordStatus; + +/** + * This interface is used by the HAL to notify the DVR playback and record status + * back to the client, the cient implements the interfaces and passes a handle to + * the HAL. + * @hide + */ +@VintfStability +oneway interface IDvrCallback { + /** + * Notify the client a new status of the demux's playback. + * + * @param status a new status of the demux's playback. + */ + void onPlaybackStatus(in PlaybackStatus status); + + /** + * Notify the client a new status of the demux's record. + * + * @param status a new status of the demux's record. + */ + void onRecordStatus(in RecordStatus status); +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IFilter.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IFilter.aidl new file mode 100644 index 0000000000..63fe1dd364 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/IFilter.aidl @@ -0,0 +1,190 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.common.fmq.MQDescriptor; +import android.hardware.common.fmq.SynchronizedReadWrite; +import android.hardware.common.NativeHandle; + +import android.hardware.tv.tuner.DemuxFilterSettings; +import android.hardware.tv.tuner.IFilter; +import android.hardware.tv.tuner.AvStreamType; +import android.hardware.tv.tuner.DemuxFilterMonitorEventType; + +/** + * The Filter is used to filter wanted data according to the filter's + * configuration. + * + * Note that reconfiguring Filter must happen after the Filter is stopped. + * @hide + */ +@VintfStability +interface IFilter { + /** + * Get the descriptor of the filter's FMQ + * + * It is used by the client to get the descriptor of the filter's Fast + * Message Queue. The data in FMQ is filtered out from demux input or upper + * stream's filter. The data is origanized to data blocks which may have + * different length. The length's information of one or multiple data blocks + * is sent to client through DemuxFilterEvent. The data in each block + * follows the stardard specified by filter's type. + * E.X. one data block from the filter with Main_Type==TS and Sub_Type==PES + * is Packetized Elementary Stream from Transport Stream according to + * ISO/IEC 13818-1. + * + * @return the descriptor of the filter's FMQ + */ + void getQueueDesc(out MQDescriptor queue); + + /** + * Release the Filter instance + * + * It is used by the client to release the Filter instance. HAL clear + * underneath resource. client mustn't access the instance any more. + */ + void close(); + + /** + * Configure the filter. + * + * It is used by the client to configure the filter so that it can filter out + * intended data. + * + * @param settings the settings of the filter. + */ + void configure(in DemuxFilterSettings settings); + + /** + * Configure A/V filter’s stream type. This API only applies to A/V filters. + * + * @param avStreamType the stream type for A/V. + */ + void configureAvStreamType(in AvStreamType avStreamType); + + /** + * Configure additional Context ID on the IP filter. + * + * @param ipCid Context Id of the IP filter. + */ + void configureIpCid(in int ipCid); + + /** + * Configure the monitor event. + * + * The event for Scrambling Status should be sent at the following two scenarios: + * 1. When this method is called, the first detected scrambling status should be sent. + * 2. When the Scrambling status transits into different status, event should be sent. + * + * The event for IP CID change should be sent at the following two scenarios: + * 1. When this method is called, the first detected CID for the IP should be sent. + * 2. When the CID is changed to different value for the IP filter, event should be sent. + * + * @param monitorEventypes the DemuxFilterMonitorEventType events to monitor. Set + * corresponding bit of the event to monitor. Reset to stop monitoring. + */ + void configureMonitorEvent(in int monitorEventTypes); + + /** + * Start the filter. + * + * It is used by the client to ask the filter to start filterring data. + */ + void start(); + + /** + * Stop the filter. + * + * It is used by the client to ask the filter to stop filterring data. + * It won't discard the data already filtered out by the filter. The filter + * will be stopped and removed automatically if the demux is closed. + */ + void stop(); + + /** + * Flush the filter. + * + * It is used by the client to ask the filter to flush the data which is + * already produced but not consumed yet. + */ + void flush(); + + /** + * Get the shared AV memory handle. Use IFilter.releaseAvHandle to release + * the handle. + * + * When media filters are opened, call this API to initialize the share + * memory handle if it's needed. + * + * If DemuxFilterMediaEvent.avMemory contains file descriptor, share memory + * should be ignored. + * + * @param out avMemory A handle associated to the shared memory for audio or + * video. avMemory.data[0] is normally an fd for ION memory. When + * the avMemory->numFd is 0, the share memory is not initialized and + * does not contain valid fd. avMemory.data[avMemory.numFds] is an + * index used as a parameter of C2DataIdInfo to build C2 buffer in + * Codec. No C2 buffer would be created if the index does not exist. + * + * @return the size of the shared av memory. It should be ignored when the share + * memory is not initialized. + */ + long getAvSharedHandle(out NativeHandle avMemory); + + /** + * Get the 32-bit filter Id. + * + * It is used by the client to ask the hardware resource id for the filter. + * + * @return the hardware 32-bit resource Id for the filter. + */ + int getId(); + + /** + * Get the 64-bit filter Id. + * + * It is used by the client to ask the hardware resource id for the filter. + * + * @return the hardware 64-bit resource Id for the filter. + */ + long getId64Bit(); + + /** + * Release the handle reported by the HAL for AV memory. + * + * It is used by the client to notify the HAL that the AV handle won't be + * used any more in client side, so that the HAL can mark the memory + * presented by file descripor in the handle as released. + * + * @param avMemory A handle associated to the memory for audio or video. + * @param avDataId An Id provides additional information for AV data. + */ + void releaseAvHandle(in NativeHandle avMemory, in long avDataId); + + /** + * Set the filter's data source. + * + * A filter uses demux as data source by default. If the data was packetized + * by multiple protocols, multiple filters may need to work together to + * extract all protocols' header. Then a filter's data source can be output + * from another filter. + * + * @param filter the filter instance which provides data input. Switch to + * use demux as data source if the filter instance is NULL. + */ + void setDataSource(in IFilter filter); +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IFilterCallback.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IFilterCallback.aidl new file mode 100644 index 0000000000..f4e01ee980 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/IFilterCallback.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxFilterEvent; +import android.hardware.tv.tuner.DemuxFilterStatus; + +/** + * This interface is used by the HAL to notify the filter event and scan status + * back to the client, the cient implements the interfaces and passes a handle + * to the HAL. + * @hide + */ +@VintfStability +oneway interface IFilterCallback { + /** + * Notify the client that a new filter event happened. + * + * @param events an array of DemuxFilterEvent. + */ + void onFilterEvent(in DemuxFilterEvent[] events); + + /** + * Notify the client a new status of a filter. + * + * @param status a new status of the filter. + */ + void onFilterStatus(in DemuxFilterStatus status); +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl new file mode 100644 index 0000000000..b2717db3c1 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl @@ -0,0 +1,146 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendScanType; +import android.hardware.tv.tuner.FrontendSettings; +import android.hardware.tv.tuner.FrontendStatus; +import android.hardware.tv.tuner.FrontendStatusType; +import android.hardware.tv.tuner.IFrontendCallback; + +/** + * A Tuner Frontend is used to tune to a frequency and lock signal. + * + * IFrontend provides a bit stream to the Tuner Demux interface. + * @hide + */ +@VintfStability +interface IFrontend { + /** + * Set the frontend callback. + * + * IFrontendCallback is used by the client to receive events from the Frontend. + * Only one callback per IFrontend instance is supported. The callback + * will be replaced if it's set again. + * + * @param callback Callback object to pass Frontend events to the system. + * The previously registered callback must be replaced with this one. + * It can be null. + */ + void setCallback(in IFrontendCallback callback); + + /** + * Tunes the frontend to using the settings given. + * + * This locks the frontend to a frequency by providing signal + * delivery information. If previous tuning isn't completed, this call MUST + * stop previous tuning, and start a new tuning. + * Tune is an async call, with LOCKED or NO_SIGNAL events sent via callback. + * + * @param settings Signal delivery information the frontend uses to + * search and lock the signal. + */ + void tune(in FrontendSettings settings); + + /** + * Stops a previous tuning. + * + * If the method completes successfully the frontend is no longer tuned and no data + * will be sent to attached demuxes. + */ + void stopTune(); + + /** + * Releases the Frontend instance + * + * Associated resources are released. close may be called more than once. + * Calls to any other method after this will return an error + */ + void close(); + + /** + * Scan the frontend to use the settings given. + * + * This uses the frontend to start a scan from signal delivery information. + * If previous scan isn't completed, this call MUST stop previous scan, + * and start a new scan. + * Scan is an async call, with FrontendScanMessage sent via callback. + * + * @param settings Signal delivery information which the frontend uses to + * scan the signal. + * @param type the type which the frontend uses to scan the signal. + */ + void scan(in FrontendSettings settings, in FrontendScanType type); + + /** + * Stops a previous scanning. + * + * If the method completes successfully, the frontend stop previous + * scanning. + */ + void stopScan(); + + /** + * Gets the statuses of the frontend. + * + * This retrieve the statuses of the frontend for given status types. + * + * @param statusTypes an array of status type which the caller request. + * + * @return an array of statuses which response the caller's request. + */ + FrontendStatus[] getStatus(in FrontendStatusType[] statusTypes); + + /** + * Sets Low-Noise Block downconverter (LNB) for satellite frontend. + * + * This assigns a hardware LNB resource to the satellite frontend. It can be + * called multiple times to update LNB assignment. The LNB resource must be + * released when the frontend is closed. + * + * @param lnbId the Id of assigned LNB resource. + */ + void setLnb(in int lnbId); + + /** + * Enable or Disable Low Noise Amplifier (LNA). + * + * @param bEnable true if activate LNA module; false if deactivate LNA + */ + void setLna(in boolean bEnable); + + /** + * Link Conditional Access Modules (CAM) to Frontend support Common + * Interface (CI) bypass mode. + * + * The client may use this to link CI-CAM to a frontend. CI bypass mode + * requires that the CICAM also receives the TS concurrently from the + * frontend when the Demux is receiving the TS directly from the frontend. + * + * @param ciCamId specify CI-CAM Id to link. + * + * @return the Local Transport Stream Id. + */ + int linkCiCam(in int ciCamId); + + /** + * Unlink Conditional Access Modules (CAM) to Frontend. + * + * @param ciCamId specify CI-CAM Id to unlink. + */ + void unlinkCiCam(in int ciCamId); +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontendCallback.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontendCallback.aidl new file mode 100644 index 0000000000..6822869d3d --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontendCallback.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.FrontendEventType; +import android.hardware.tv.tuner.FrontendScanMessage; +import android.hardware.tv.tuner.FrontendScanMessageType; + +/** + * This interface is used by the HAL to notify the fronted event and scan messages + * back to the client, the cient implements the interfaces and passes a handle to + * the HAL. + * @hide + */ +@VintfStability +oneway interface IFrontendCallback { + /** + * Notify the client that a new event happened on the frontend. + * + * @param frontendEventType the event type. + */ + void onEvent(in FrontendEventType frontendEventType); + + /** + * The callback function that must be called by HAL implementation to notify + * the client of scan messages. + * + * @param type the type of scan message. + * @param message the scan message sent by HAL to the client. + */ + void onScanMessage(in FrontendScanMessageType type, + in FrontendScanMessage message); +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/ILnb.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/ILnb.aidl new file mode 100644 index 0000000000..28eae45412 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/ILnb.aidl @@ -0,0 +1,85 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.ILnbCallback; +import android.hardware.tv.tuner.LnbPosition; +import android.hardware.tv.tuner.LnbTone; +import android.hardware.tv.tuner.LnbVoltage; + +/** + * A Tuner LNB (low-noise block downconverter) is used by satellite frontend + * to receive the microwave signal from the satellite, amplify it, and + * downconvert the frequency to a lower frequency. + * @hide + */ +@VintfStability +interface ILnb { + /** + * Set the lnb callback. + * + * ILnbCallback is used by the client to receive events from the Lnb. + * Only one callback per ILnb instance is supported. The callback + * will be replaced if it's set again. + * + * @param callback Callback object to pass Lnb events to the system. + * The previously registered callback must be replaced with this one. + * It can be null. + */ + void setCallback(in ILnbCallback callback); + + /** + * Set the lnb's power voltage. + * + * @param voltage the power's voltage the Lnb to use. + */ + void setVoltage(in LnbVoltage voltage); + + /** + * Set the lnb's tone mode. + * + * @param tone the tone mode the Lnb to use. + */ + void setTone(in LnbTone tone); + + /** + * Select the lnb's position. + * + * @param position the position the Lnb to use. + */ + void setSatellitePosition(in LnbPosition position); + + /** + * Sends DiSEqC (Digital Satellite Equipment Control) message. + * + * Client sends DiSeqc message to DiSEqc to LNB. The response message from + * the device comes back to the client through frontend's callback + * onDiseqcMessage. + * + * @param diseqcMessage a byte array of data for DiSEqC message which is + * specified by EUTELSAT Bus Functional Specification Version 4.2. + */ + void sendDiseqcMessage(in byte[] diseqcMessage); + + /** + * Releases the LNB instance + * + * Associated resources are released. close may be called more than once. + * Calls to any other method after this will return an error + */ + void close(); +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/ILnbCallback.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/ILnbCallback.aidl new file mode 100644 index 0000000000..98ef1417bb --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/ILnbCallback.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.LnbEventType; + +/** + * This interface is used by the HAL to notify the Lnb event and DiSEqC (Digital + * Satellite Equipment Control) message back to the client, the cient implements + * the interfaces and passes a handle to the HAL. + * @hide + */ +@VintfStability +oneway interface ILnbCallback { + /** + * The callback function that must be called by HAL implementation to notify + * the client of new DiSEqC message. + * + * @param diseqcMessage a byte array of data for DiSEqC (Digital Satellite + * Equipment Control) message which is specified by EUTELSAT Bus Functional + * Specification Version 4.2. + */ + void onDiseqcMessage(in byte[] diseqcMessage); + + /** + * Notify the client that a new event happened on the Lnb. + * + * @param LnbEventType the event type. + */ + void onEvent(in LnbEventType lnbEventType); +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/ITimeFilter.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/ITimeFilter.aidl new file mode 100644 index 0000000000..dee6cd8415 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/ITimeFilter.aidl @@ -0,0 +1,71 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Timer Filter is used by Demux to filter data based on time stamp. + * @hide + */ +@VintfStability +interface ITimeFilter { + /** + * Set time stamp for time based filter. + * + * It is used by the client to set initial time stamp and enable time + * filtering. The time will be incremented locally. The demux discards + * the content which time stamp is older than the time in the time filter. + * + * @param timeStamp initial time stamp for the time filter. It based on + * 90KHz has the same format as PTS (Presentation Time Stamp). + */ + void setTimeStamp(in long timeStamp); + + /** + * Clear the time stamp in the time filter. + * + * It is used by the client to clear the time value of the time filter, + * then disable time filter. + */ + void clearTimeStamp(); + + /** + * Get the current time in the time filter. + * + * It is used by the client to inquiry current time in the time filter. + * + * @return the current time stamp in the time filter. + */ + long getTimeStamp(); + + /** + * Get the time from the beginning of current data source. + * + * It is used by the client to inquiry the time stamp from the beginning + * of current data source. + * + * @return the time stamp from the beginning of current data source. + */ + long getSourceTime(); + + /** + * Close the Time Filter instance + * + * It is used by the client to release the demux instance. HAL clear + * underneath resource. client mustn't access the instance any more. + */ + void close(); +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl new file mode 100644 index 0000000000..f8810827e7 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl @@ -0,0 +1,124 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DemuxCapabilities; +import android.hardware.tv.tuner.FrontendInfo; +import android.hardware.tv.tuner.IDemux; +import android.hardware.tv.tuner.IDescrambler; +import android.hardware.tv.tuner.IFrontend; +import android.hardware.tv.tuner.ILnb; +import android.hardware.tv.tuner.FrontendDtmbCapabilities; + +/** + * Top level interface to manage Frontend, Demux and Decrambler hardware + * resources which are needed for Android TV. + * @hide + */ +@VintfStability +@SuppressWarnings(value={"out-array"}) +interface ITuner { + /** + * Get Frontend IDs + * + * It is used by the client to get all available frontends' IDs. + * + * @return an array of IDs for the available Frontends. + */ + int[] getFrontendIds(); + + /** + * Create a new instance of Frontend given a frontendId. + * + * It is used by the client to create a frontend instance. + * + * @param frontendId the id of the frontend to be opened. + * + * @return the newly created frontend interface. + */ + IFrontend openFrontendById(in int frontendId); + + /** + * Create a new instance of Demux. + * + * It is used by the client to create a Demux instance. + * + * @param out demuxId the newly created demux id will be the first + * element of the array. + * + * @return the newly created demux interface. + */ + IDemux openDemux(out int[] demuxId); + + /** + * Retrieve the Demux's Capabilities. + * + * @return the Demux's Capabilities. + */ + DemuxCapabilities getDemuxCaps(); + + /** + * Create a new instance of Descrambler. + * + * It is used by the client to create a Descrambler instance. + * + * @return the newly created descrambler interface. + */ + IDescrambler openDescrambler(); + + /** + * Retrieve the frontend's information. + * + * @return the frontend's information. + */ + FrontendInfo getFrontendInfo(in int frontendId); + + /** + * Get low-noise block downconverter (LNB) IDs. + * + * It is used by the client to get all available LNBs' IDs. + * + * @return an array of LnbId for the available LNBs. + */ + int[] getLnbIds(); + + /** + * Create a new instance of Lnb given a lnbId. + * + * It is used by the client to create a Lnb instance for satellite Frontend. + * + * @param lnbId the id of the LNB to be opened. + * + * @return the newly created Lnb interface. + */ + ILnb openLnbById(in int lnbId); + + /** + * Create a new instance of Lnb given a LNB name. + * + * It is used by the client to create a LNB instance for external device. + * + * @param lnbName the name for an external LNB to be opened. The app + * provides the name. Frammework doesn't depend on the name, instead + * use lnbId return from this call. + * @param out demuxId the newly opened Lnb id will be the first element of + * the array. + * + * @return the newly opened Lnb iterface. + */ + ILnb openLnbByName(in String lnbName, out int[] lnbId); +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/LnbEventType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/LnbEventType.aidl new file mode 100644 index 0000000000..a6230b0272 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/LnbEventType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Lnb Event Type. + * @hide + */ +@VintfStability +@Backing(type="int") +enum LnbEventType { + DISEQC_RX_OVERFLOW, + + /** + * If LNB detect that outgoing Diseqc message isn't delivered on time. + */ + DISEQC_RX_TIMEOUT, + + /** + * If LNB detect that the incoming Diseqc message has parity error. + */ + DISEQC_RX_PARITY_ERROR, + + /** + * If LNB detect that the LNB is overload. + */ + LNB_OVERLOAD, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/LnbPosition.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/LnbPosition.aidl new file mode 100644 index 0000000000..067f6b199a --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/LnbPosition.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * The Position of LNB. + * @hide + */ +@VintfStability +@Backing(type="int") +enum LnbPosition { + UNDEFINED, + + POSITION_A, + + POSITION_B, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/LnbTone.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/LnbTone.aidl new file mode 100644 index 0000000000..f1d1598990 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/LnbTone.aidl @@ -0,0 +1,29 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Tone Type for LNB. + * @hide + */ +@VintfStability +@Backing(type="int") +enum LnbTone { + NONE, + + CONTINUOUS, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/LnbVoltage.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/LnbVoltage.aidl new file mode 100644 index 0000000000..03a42f23b0 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/LnbVoltage.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Power Voltage Type for LNB. + * @hide + */ +@VintfStability +@Backing(type="int") +enum LnbVoltage { + NONE, + + VOLTAGE_5V, + + VOLTAGE_11V, + + VOLTAGE_12V, + + VOLTAGE_13V, + + VOLTAGE_14V, + + VOLTAGE_15V, + + VOLTAGE_18V, + + VOLTAGE_19V, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/PlaybackSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/PlaybackSettings.aidl new file mode 100644 index 0000000000..47d3db6545 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/PlaybackSettings.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DataFormat; + +/** + * The Setting for the playback in DVR. + * @hide + */ +@VintfStability +parcelable PlaybackSettings { + /** + * Register for interested PlaybackStatus events so that the HAL can send these + * PlaybackStatus events back to client. + */ + int statusMask; + + /** + * Unused space size in bytes in the playback. The HAL uses it to trigger + * InputStatus::SPACE_ALMOST_EMPTY. + */ + int lowThreshold; + + /** + * Unused space size in bytes in the playback. The HAL uses it to trigger + * InputStatus::SPACE_ALMOST_FULL. + */ + int highThreshold; + + /** + * The data format in the playback. + */ + DataFormat dataFormat = DataFormat.UNDEFINED; + + /** + * The packet size in bytes in the playback. + */ + byte packetSize; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/PlaybackStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/PlaybackStatus.aidl new file mode 100644 index 0000000000..545dc89e88 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/PlaybackStatus.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * A status of the playback in DVR. + * @hide + */ +@VintfStability +@Backing(type="int") +enum PlaybackStatus { + /** + * The space of the demux's playback is empty. + */ + SPACE_EMPTY = 1 << 0, + + /** + * The spece of the demux's playback is almost empty. + */ + SPACE_ALMOST_EMPTY = 1 << 1, + + /** + * The space of the demux's playback is almost full. + */ + SPACE_ALMOST_FULL = 1 << 2, + + /** + * The space of the demux's playback is full. + */ + SPACE_FULL = 1 << 3, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/RecordSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/RecordSettings.aidl new file mode 100644 index 0000000000..94370d6974 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/RecordSettings.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +import android.hardware.tv.tuner.DataFormat; + +/** + * The Settings for the record in DVR. + * @hide + */ +@VintfStability +parcelable RecordSettings { + /** + * Register for interested RecordStatus events so that the HAL can send these + * PlaybackStatus events back to client. + */ + int statusMask; + + /** + * Unconsumed data size in bytes in the record. The HAL uses it to trigger + * OutputStatus::LOW_WATER. + */ + int lowThreshold; + + /** + * Unconsumed data size in bytes in the record. The HAL uses it to trigger + * OutputStatus::High_WATER. + */ + int highThreshold; + + /** + * The data format in the record. + */ + DataFormat dataFormat = DataFormat.UNDEFINED; + + /** + * The packet size in bytes in the record. + */ + byte packetSize; +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/RecordStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/RecordStatus.aidl new file mode 100644 index 0000000000..64d9bd4a6f --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/RecordStatus.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * A status of data in the filter's buffer. + * @hide + */ +@VintfStability +@Backing(type="byte") +enum RecordStatus { + /** + * The data in the filter buffer is ready to be read. + */ + DATA_READY = 1 << 0, + + /** + * The available data amount in the filter buffer is at low level which is + * set to 25 percent by default. + */ + LOW_WATER = 1 << 1, + + /** + * The available data amount in the filter buffer is at high level which is + * set to 75 percent by default. + */ + HIGH_WATER = 1 << 2, + + /** + * The data in the filter buffer is full and newly filtered data is being + * discarded. + */ + OVERFLOW = 1 << 3, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/ScramblingStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/ScramblingStatus.aidl new file mode 100644 index 0000000000..76f56ae6e7 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/ScramblingStatus.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Scrambling Status Type. + * @hide + */ +@VintfStability +@Backing(type="int") +enum ScramblingStatus { + /** + * Content’s scrambling status is unknown + */ + UNKNOWN = 1 << 0, + + /** + * Content is not scrambled. + */ + NOT_SCRAMBLED = 1 << 1, + + /** + * Content is scrambled. + */ + SCRAMBLED = 1 << 2, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/VideoStreamType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/VideoStreamType.aidl new file mode 100644 index 0000000000..108d986bd8 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/VideoStreamType.aidl @@ -0,0 +1,87 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Video stream coding format. + * @hide + */ +@VintfStability +@Backing(type="int") +enum VideoStreamType { + UNDEFINED, + + /* + * ITU-T | ISO/IEC Reserved + */ + RESERVED, + + /* + * ISO/IEC 11172 + */ + MPEG1, + + /* + * ITU-T Rec.H.262 and ISO/IEC 13818-2 + */ + MPEG2, + + /* + * ISO/IEC 14496-2 (MPEG-4 H.263 based video) + */ + MPEG4P2, + + /* + * ITU-T Rec.H.264 and ISO/IEC 14496-10 + */ + AVC, + + /* + * ITU-T Rec. H.265 and ISO/IEC 23008-2 + */ + HEVC, + + /* + * Microsoft VC.1 + */ + VC1, + + /* + * Google VP8 + */ + VP8, + + /* + * Google VP9 + */ + VP9, + + /* + * AOMedia Video 1 + */ + AV1, + + /* + * Chinese Standard + */ + AVS, + + /* + * New Chinese Standard + */ + AVS2, +} -- GitLab From 4092f2f39cdacffb26d0f6aa050be56709394695 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Thu, 8 Jul 2021 18:49:12 -0700 Subject: [PATCH 086/825] Add Tuner AIDL default implementation Bug: 191825295 Test: make and run VtsHalTvTunerTargetTest Change-Id: I781f67424ca1890f038160a4fda660507ab9e916 --- tv/tuner/aidl/default/Android.bp | 46 + tv/tuner/aidl/default/Demux.cpp | 427 +++++++++ tv/tuner/aidl/default/Demux.h | 189 ++++ tv/tuner/aidl/default/Descrambler.cpp | 81 ++ tv/tuner/aidl/default/Descrambler.h | 54 ++ tv/tuner/aidl/default/Dvr.cpp | 489 ++++++++++ tv/tuner/aidl/default/Dvr.h | 156 ++++ tv/tuner/aidl/default/Filter.cpp | 1103 +++++++++++++++++++++++ tv/tuner/aidl/default/Filter.h | 242 +++++ tv/tuner/aidl/default/Frontend.cpp | 721 +++++++++++++++ tv/tuner/aidl/default/Frontend.h | 75 ++ tv/tuner/aidl/default/Lnb.cpp | 81 ++ tv/tuner/aidl/default/Lnb.h | 53 ++ tv/tuner/aidl/default/OWNERS | 3 + tv/tuner/aidl/default/TimeFilter.cpp | 86 ++ tv/tuner/aidl/default/TimeFilter.h | 57 ++ tv/tuner/aidl/default/Tuner.cpp | 347 +++++++ tv/tuner/aidl/default/Tuner.h | 86 ++ tv/tuner/aidl/default/service.cpp | 38 + tv/tuner/aidl/default/tuner-default.rc | 6 + tv/tuner/aidl/default/tuner-default.xml | 6 + 21 files changed, 4346 insertions(+) create mode 100644 tv/tuner/aidl/default/Android.bp create mode 100644 tv/tuner/aidl/default/Demux.cpp create mode 100644 tv/tuner/aidl/default/Demux.h create mode 100644 tv/tuner/aidl/default/Descrambler.cpp create mode 100644 tv/tuner/aidl/default/Descrambler.h create mode 100644 tv/tuner/aidl/default/Dvr.cpp create mode 100644 tv/tuner/aidl/default/Dvr.h create mode 100644 tv/tuner/aidl/default/Filter.cpp create mode 100644 tv/tuner/aidl/default/Filter.h create mode 100644 tv/tuner/aidl/default/Frontend.cpp create mode 100644 tv/tuner/aidl/default/Frontend.h create mode 100644 tv/tuner/aidl/default/Lnb.cpp create mode 100644 tv/tuner/aidl/default/Lnb.h create mode 100644 tv/tuner/aidl/default/OWNERS create mode 100644 tv/tuner/aidl/default/TimeFilter.cpp create mode 100644 tv/tuner/aidl/default/TimeFilter.h create mode 100644 tv/tuner/aidl/default/Tuner.cpp create mode 100644 tv/tuner/aidl/default/Tuner.h create mode 100644 tv/tuner/aidl/default/service.cpp create mode 100644 tv/tuner/aidl/default/tuner-default.rc create mode 100644 tv/tuner/aidl/default/tuner-default.xml diff --git a/tv/tuner/aidl/default/Android.bp b/tv/tuner/aidl/default/Android.bp new file mode 100644 index 0000000000..ba4af445e6 --- /dev/null +++ b/tv/tuner/aidl/default/Android.bp @@ -0,0 +1,46 @@ +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.tv.tuner-service.example", + relative_install_path: "hw", + init_rc: ["tuner-default.rc"], + vintf_fragments: ["tuner-default.xml"], + vendor: true, + compile_multilib: "first", + srcs: [ + "Demux.cpp", + "Descrambler.cpp", + "Dvr.cpp", + "Filter.cpp", + "Frontend.cpp", + "Lnb.cpp", + "TimeFilter.cpp", + "Tuner.cpp", + "service.cpp", + ], + static_libs: [ + "libaidlcommonsupport", + ], + shared_libs: [ + "android.hardware.common.fmq-V1-ndk_platform", + "android.hardware.tv.tuner-V1-ndk_platform", + "libbase", + "libbinder_ndk", + "libcutils", + "libdmabufheap", + "libfmq", + "libion", + "liblog", + "libutils", + ], + header_libs: [ + "media_plugin_headers", + ], +} diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp new file mode 100644 index 0000000000..15022ee9ac --- /dev/null +++ b/tv/tuner/aidl/default/Demux.cpp @@ -0,0 +1,427 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//#define LOG_NDEBUG 0 +#define LOG_TAG "android.hardware.tv.tuner-service.example-Demux" + +#include + +#include +#include "Demux.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace tuner { + +#define WAIT_TIMEOUT 3000000000 + +Demux::Demux(int32_t demuxId, std::shared_ptr tuner) { + mDemuxId = demuxId; + mTunerService = tuner; +} + +Demux::~Demux() { + mFrontendInputThreadRunning = false; + std::lock_guard lock(mFrontendInputThreadLock); +} + +::ndk::ScopedAStatus Demux::setFrontendDataSource(int32_t in_frontendId) { + ALOGV("%s", __FUNCTION__); + + if (mTunerService == nullptr) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_NO_INIT); + } + + mFrontend = mTunerService->getFrontendById(in_frontendId); + + if (mFrontend == nullptr) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + mTunerService->setFrontendAsDemuxSource(in_frontendId, mDemuxId); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Demux::openFilter(const DemuxFilterType& in_type, int32_t in_bufferSize, + const std::shared_ptr& in_cb, + std::shared_ptr* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + int64_t filterId; + filterId = ++mLastUsedFilterId; + + if (in_cb == nullptr) { + ALOGW("[Demux] callback can't be null"); + *_aidl_return = nullptr; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + std::shared_ptr filter = + ndk::SharedRefBase::make(in_type, filterId, in_bufferSize, in_cb, ref()); + if (!filter->createFilterMQ()) { + *_aidl_return = nullptr; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + } + + mFilters[filterId] = filter; + if (filter->isPcrFilter()) { + mPcrFilterIds.insert(filterId); + } + bool result = true; + if (!filter->isRecordFilter()) { + // Only save non-record filters for now. Record filters are saved when the + // IDvr.attacheFilter is called. + mPlaybackFilterIds.insert(filterId); + if (mDvrPlayback != nullptr) { + result = mDvrPlayback->addPlaybackFilter(filterId, filter); + } + } + + if (!result) { + *_aidl_return = nullptr; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + *_aidl_return = filter; + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Demux::openTimeFilter(std::shared_ptr* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + mTimeFilter = ndk::SharedRefBase::make(ref()); + + *_aidl_return = mTimeFilter; + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Demux::getAvSyncHwId(const std::shared_ptr& in_filter, + int32_t* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + int64_t id; + ::ndk::ScopedAStatus status; + + status = in_filter->getId64Bit(&id); + if (!status.isOk()) { + ALOGE("[Demux] Can't get filter Id."); + *_aidl_return = -1; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + if (!mFilters[id]->isMediaFilter()) { + ALOGE("[Demux] Given filter is not a media filter."); + *_aidl_return = -1; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + if (!mPcrFilterIds.empty()) { + // Return the lowest pcr filter id in the default implementation as the av sync id + *_aidl_return = *mPcrFilterIds.begin(); + return ::ndk::ScopedAStatus::ok(); + } + + ALOGE("[Demux] No PCR filter opened."); + *_aidl_return = -1; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); +} + +::ndk::ScopedAStatus Demux::getAvSyncTime(int32_t in_avSyncHwId, int64_t* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + if (mPcrFilterIds.empty()) { + *_aidl_return = -1; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + if (in_avSyncHwId != *mPcrFilterIds.begin()) { + *_aidl_return = -1; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + *_aidl_return = -1; + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Demux::close() { + ALOGV("%s", __FUNCTION__); + + set::iterator it; + for (it = mPlaybackFilterIds.begin(); it != mPlaybackFilterIds.end(); it++) { + mDvrPlayback->removePlaybackFilter(*it); + } + mPlaybackFilterIds.clear(); + mRecordFilterIds.clear(); + mFilters.clear(); + mLastUsedFilterId = -1; + mTunerService->removeDemux(mDemuxId); + mFrontendInputThreadRunning = false; + std::lock_guard lock(mFrontendInputThreadLock); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Demux::openDvr(DvrType in_type, int32_t in_bufferSize, + const std::shared_ptr& in_cb, + std::shared_ptr* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + if (in_cb == nullptr) { + ALOGW("[Demux] DVR callback can't be null"); + *_aidl_return = nullptr; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + set::iterator it; + switch (in_type) { + case DvrType::PLAYBACK: + mDvrPlayback = + ndk::SharedRefBase::make(in_type, in_bufferSize, in_cb, ref()); + if (!mDvrPlayback->createDvrMQ()) { + mDvrPlayback = nullptr; + *_aidl_return = mDvrPlayback; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_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::fromExceptionCode(STATUS_UNKNOWN_ERROR); + } + } + + *_aidl_return = mDvrPlayback; + return ::ndk::ScopedAStatus::ok(); + case DvrType::RECORD: + mDvrRecord = ndk::SharedRefBase::make(in_type, in_bufferSize, in_cb, ref()); + if (!mDvrRecord->createDvrMQ()) { + mDvrRecord = nullptr; + *_aidl_return = mDvrRecord; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + } + + *_aidl_return = mDvrRecord; + return ::ndk::ScopedAStatus::ok(); + default: + *_aidl_return = nullptr; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } +} + +::ndk::ScopedAStatus Demux::connectCiCam(int32_t in_ciCamId) { + ALOGV("%s", __FUNCTION__); + + mCiCamId = in_ciCamId; + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Demux::disconnectCiCam() { + ALOGV("%s", __FUNCTION__); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Demux::removeFilter(int64_t filterId) { + ALOGV("%s", __FUNCTION__); + + if (mDvrPlayback != nullptr) { + mDvrPlayback->removePlaybackFilter(filterId); + } + mPlaybackFilterIds.erase(filterId); + mRecordFilterIds.erase(filterId); + mFilters.erase(filterId); + + return ::ndk::ScopedAStatus::ok(); +} + +void Demux::startBroadcastTsFilter(vector data) { + set::iterator it; + uint16_t pid = ((data[1] & 0x1f) << 8) | ((data[2] & 0xff)); + if (DEBUG_DEMUX) { + ALOGW("[Demux] start ts filter pid: %d", pid); + } + for (it = mPlaybackFilterIds.begin(); it != mPlaybackFilterIds.end(); it++) { + if (pid == mFilters[*it]->getTpid()) { + mFilters[*it]->updateFilterOutput(data); + } + } +} + +void Demux::sendFrontendInputToRecord(vector data) { + set::iterator it; + if (DEBUG_DEMUX) { + ALOGW("[Demux] update record filter output"); + } + for (it = mRecordFilterIds.begin(); it != mRecordFilterIds.end(); it++) { + mFilters[*it]->updateRecordOutput(data); + } +} + +void Demux::sendFrontendInputToRecord(vector data, uint16_t pid, uint64_t pts) { + sendFrontendInputToRecord(data); + set::iterator it; + for (it = mRecordFilterIds.begin(); it != mRecordFilterIds.end(); it++) { + if (pid == mFilters[*it]->getTpid()) { + mFilters[*it]->updatePts(pts); + } + } +} + +bool Demux::startBroadcastFilterDispatcher() { + set::iterator it; + + // Handle the output data per filter type + for (it = mPlaybackFilterIds.begin(); it != mPlaybackFilterIds.end(); it++) { + if (!mFilters[*it]->startFilterHandler().isOk()) { + return false; + } + } + + return true; +} + +bool Demux::startRecordFilterDispatcher() { + set::iterator it; + + for (it = mRecordFilterIds.begin(); it != mRecordFilterIds.end(); it++) { + if (!mFilters[*it]->startRecordFilterHandler().isOk()) { + return false; + } + } + + return true; +} + +::ndk::ScopedAStatus Demux::startFilterHandler(int64_t filterId) { + return mFilters[filterId]->startFilterHandler(); +} + +void Demux::updateFilterOutput(int64_t filterId, vector data) { + mFilters[filterId]->updateFilterOutput(data); +} + +void Demux::updateMediaFilterOutput(int64_t filterId, vector data, uint64_t pts) { + updateFilterOutput(filterId, data); + mFilters[filterId]->updatePts(pts); +} + +uint16_t Demux::getFilterTpid(int64_t filterId) { + return mFilters[filterId]->getTpid(); +} + +void Demux::startFrontendInputLoop() { + mFrontendInputThreadRunning = true; + pthread_create(&mFrontendInputThread, NULL, __threadLoopFrontend, this); + pthread_setname_np(mFrontendInputThread, "frontend_input_thread"); +} + +void* Demux::__threadLoopFrontend(void* user) { + Demux* const self = static_cast(user); + self->frontendInputThreadLoop(); + return 0; +} + +void Demux::frontendInputThreadLoop() { + if (!mFrontendInputThreadRunning) { + return; + } + + std::lock_guard lock(mFrontendInputThreadLock); + if (!mDvrPlayback) { + ALOGW("[Demux] No software Frontend input configured. Ending Frontend thread loop."); + mFrontendInputThreadRunning = false; + return; + } + + while (mFrontendInputThreadRunning) { + uint32_t efState = 0; + ::android::status_t status = mDvrPlayback->getDvrEventFlag()->wait( + static_cast(DemuxQueueNotifyBits::DATA_READY), &efState, WAIT_TIMEOUT, + true /* retry on spurious wake */); + if (status != ::android::OK) { + ALOGD("[Demux] wait for data ready on the playback FMQ"); + continue; + } + if (mDvrPlayback->getSettings().get().dataFormat == + DataFormat::ES) { + if (!mDvrPlayback->processEsDataOnPlayback(true /*isVirtualFrontend*/, mIsRecording)) { + ALOGE("[Demux] playback es data failed to be filtered. Ending thread"); + break; + } + continue; + } + // Our current implementation filter the data and write it into the filter FMQ immediately + // after the DATA_READY from the VTS/framework + // This is for the non-ES data source, real playback use case handling. + if (!mDvrPlayback->readPlaybackFMQ(true /*isVirtualFrontend*/, mIsRecording) || + !mDvrPlayback->startFilterDispatcher(true /*isVirtualFrontend*/, mIsRecording)) { + ALOGE("[Demux] playback data failed to be filtered. Ending thread"); + break; + } + } + + mFrontendInputThreadRunning = false; + ALOGW("[Demux] Frontend Input thread end."); +} + +void Demux::stopFrontendInput() { + ALOGD("[Demux] stop frontend on demux"); + mKeepFetchingDataFromFrontend = false; + mFrontendInputThreadRunning = false; + std::lock_guard lock(mFrontendInputThreadLock); +} + +void Demux::setIsRecording(bool isRecording) { + mIsRecording = isRecording; +} + +bool Demux::isRecording() { + return mIsRecording; +} + +bool Demux::attachRecordFilter(int64_t filterId) { + if (mFilters[filterId] == nullptr || mDvrRecord == nullptr || + !mFilters[filterId]->isRecordFilter()) { + return false; + } + + mRecordFilterIds.insert(filterId); + mFilters[filterId]->attachFilterToRecord(mDvrRecord); + + return true; +} + +bool Demux::detachRecordFilter(int64_t filterId) { + if (mFilters[filterId] == nullptr || mDvrRecord == nullptr) { + return false; + } + + mRecordFilterIds.erase(filterId); + mFilters[filterId]->detachFilterFromRecord(); + + return true; +} + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/Demux.h b/tv/tuner/aidl/default/Demux.h new file mode 100644 index 0000000000..9f96d0f1bc --- /dev/null +++ b/tv/tuner/aidl/default/Demux.h @@ -0,0 +1,189 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include +#include +#include "Dvr.h" +#include "Filter.h" +#include "Frontend.h" +#include "TimeFilter.h" +#include "Tuner.h" + +using namespace std; + +namespace aidl { +namespace android { +namespace hardware { +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; + +class Dvr; +class Filter; +class Frontend; +class TimeFilter; +class Tuner; + +class Demux : public BnDemux { + public: + Demux(int32_t demuxId, std::shared_ptr tuner); + ~Demux(); + + ::ndk::ScopedAStatus setFrontendDataSource(int32_t in_frontendId) override; + ::ndk::ScopedAStatus openFilter(const DemuxFilterType& in_type, int32_t in_bufferSize, + const std::shared_ptr& in_cb, + std::shared_ptr* _aidl_return) override; + ::ndk::ScopedAStatus openTimeFilter(std::shared_ptr* _aidl_return) override; + ::ndk::ScopedAStatus getAvSyncHwId(const std::shared_ptr& in_filter, + int32_t* _aidl_return) override; + ::ndk::ScopedAStatus getAvSyncTime(int32_t in_avSyncHwId, int64_t* _aidl_return) override; + ::ndk::ScopedAStatus close() override; + ::ndk::ScopedAStatus openDvr(DvrType in_type, int32_t in_bufferSize, + const std::shared_ptr& in_cb, + std::shared_ptr* _aidl_return) override; + ::ndk::ScopedAStatus connectCiCam(int32_t in_ciCamId) override; + ::ndk::ScopedAStatus disconnectCiCam() override; + + // Functions interacts with Tuner Service + void stopFrontendInput(); + ::ndk::ScopedAStatus removeFilter(int64_t filterId); + bool attachRecordFilter(int64_t filterId); + bool detachRecordFilter(int64_t filterId); + ::ndk::ScopedAStatus startFilterHandler(int64_t filterId); + void updateFilterOutput(int64_t filterId, vector data); + void updateMediaFilterOutput(int64_t filterId, vector data, uint64_t pts); + uint16_t getFilterTpid(int64_t filterId); + void setIsRecording(bool isRecording); + bool isRecording(); + void startFrontendInputLoop(); + + /** + * A dispatcher to read and dispatch input data to all the started filters. + * Each filter handler handles the data filtering/output writing/filterEvent updating. + * Note that recording filters are not included. + */ + bool startBroadcastFilterDispatcher(); + void startBroadcastTsFilter(vector data); + + void sendFrontendInputToRecord(vector data); + void sendFrontendInputToRecord(vector data, uint16_t pid, uint64_t pts); + bool startRecordFilterDispatcher(); + + private: + // Tuner service + std::shared_ptr mTunerService; + + // Frontend source + std::shared_ptr mFrontend; + + // A struct that passes the arguments to a newly created filter thread + struct ThreadArgs { + Demux* user; + int64_t filterId; + }; + + static void* __threadLoopFrontend(void* user); + void frontendInputThreadLoop(); + + /** + * To create a FilterMQ with the next available Filter ID. + * Creating Event Flag at the same time. + * Add the successfully created/saved FilterMQ into the local list. + * + * Return false is any of the above processes fails. + */ + void deleteEventFlag(); + bool readDataFromMQ(); + + int32_t mDemuxId = -1; + int32_t mCiCamId; + set mPcrFilterIds; + /** + * Record the last used filter id. Initial value is -1. + * Filter Id starts with 0. + */ + int64_t mLastUsedFilterId = -1; + /** + * Record all the used playback filter Ids. + * Any removed filter id should be removed from this set. + */ + set mPlaybackFilterIds; + /** + * Record all the attached record filter Ids. + * Any removed filter id should be removed from this set. + */ + set mRecordFilterIds; + /** + * A list of created Filter sp. + * The array number is the filter ID. + */ + std::map> mFilters; + + /** + * Local reference to the opened Timer Filter instance. + */ + std::shared_ptr mTimeFilter; + + /** + * Local reference to the opened DVR object. + */ + std::shared_ptr mDvrPlayback; + std::shared_ptr mDvrRecord; + + // Thread handlers + pthread_t mFrontendInputThread; + /** + * If a specific filter's writing loop is still running + */ + bool mFrontendInputThreadRunning; + bool mKeepFetchingDataFromFrontend; + /** + * If the dvr recording is running. + */ + bool mIsRecording = false; + /** + * Lock to protect writes to the FMQs + */ + std::mutex mWriteLock; + /** + * Lock to protect writes to the input status + */ + std::mutex mFrontendInputThreadLock; + + // temp handle single PES filter + // TODO handle mulptiple Pes filters + int mPesSizeLeft = 0; + vector mPesOutput; + + const bool DEBUG_DEMUX = false; +}; + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/Descrambler.cpp b/tv/tuner/aidl/default/Descrambler.cpp new file mode 100644 index 0000000000..8af3a92830 --- /dev/null +++ b/tv/tuner/aidl/default/Descrambler.cpp @@ -0,0 +1,81 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//#define LOG_NDEBUG 0 +#define LOG_TAG "android.hardware.tv.tuner-service.example-Descrambler" + +#include +#include + +#include "Descrambler.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace tuner { + +Descrambler::Descrambler() {} + +Descrambler::~Descrambler() {} + +::ndk::ScopedAStatus Descrambler::setDemuxSource(int32_t in_demuxId) { + ALOGV("%s", __FUNCTION__); + if (mDemuxSet) { + ALOGW("[ WARN ] Descrambler has already been set with a demux id %" PRIu32, + mSourceDemuxId); + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + mDemuxSet = true; + mSourceDemuxId = in_demuxId; + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Descrambler::setKeyToken(const std::vector& /* in_keyToken */) { + ALOGV("%s", __FUNCTION__); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Descrambler::addPid( + const DemuxPid& /* in_pid */, + const std::shared_ptr& /* in_optionalSourceFilter */) { + ALOGV("%s", __FUNCTION__); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Descrambler::removePid( + const DemuxPid& /* in_pid */, + const std::shared_ptr& /* in_optionalSourceFilter */) { + ALOGV("%s", __FUNCTION__); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Descrambler::close() { + ALOGV("%s", __FUNCTION__); + mDemuxSet = false; + + return ::ndk::ScopedAStatus::ok(); +} + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/Descrambler.h b/tv/tuner/aidl/default/Descrambler.h new file mode 100644 index 0000000000..ddf2c1db49 --- /dev/null +++ b/tv/tuner/aidl/default/Descrambler.h @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +using namespace std; + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace tuner { + +class Descrambler : public BnDescrambler { + public: + Descrambler(); + + ::ndk::ScopedAStatus setDemuxSource(int32_t in_demuxId) override; + ::ndk::ScopedAStatus setKeyToken(const std::vector& in_keyToken) override; + ::ndk::ScopedAStatus addPid(const DemuxPid& in_pid, + const std::shared_ptr& in_optionalSourceFilter) override; + ::ndk::ScopedAStatus removePid( + const DemuxPid& in_pid, + const std::shared_ptr& in_optionalSourceFilter) override; + ::ndk::ScopedAStatus close() override; + + private: + virtual ~Descrambler(); + int32_t mSourceDemuxId; + bool mDemuxSet = false; +}; + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/Dvr.cpp b/tv/tuner/aidl/default/Dvr.cpp new file mode 100644 index 0000000000..a042dc3590 --- /dev/null +++ b/tv/tuner/aidl/default/Dvr.cpp @@ -0,0 +1,489 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//#define LOG_NDEBUG 0 +#define LOG_TAG "android.hardware.tv.tuner-service.example-Dvr" + +#include + +#include +#include "Dvr.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace tuner { + +#define WAIT_TIMEOUT 3000000000 + +Dvr::Dvr(DvrType type, uint32_t bufferSize, const std::shared_ptr& cb, + std::shared_ptr demux) { + mType = type; + mBufferSize = bufferSize; + mCallback = cb; + mDemux = demux; +} + +Dvr::~Dvr() { + mDvrThreadRunning = false; + lock_guard lock(mDvrThreadLock); +} + +::ndk::ScopedAStatus Dvr::getQueueDesc(MQDescriptor* out_queue) { + ALOGV("%s", __FUNCTION__); + + *out_queue = mDvrMQ->dupeDesc(); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Dvr::configure(const DvrSettings& in_settings) { + ALOGV("%s", __FUNCTION__); + + mDvrSettings = in_settings; + mDvrConfigured = true; + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Dvr::attachFilter(const std::shared_ptr& in_filter) { + ALOGV("%s", __FUNCTION__); + + int64_t filterId; + ::ndk::ScopedAStatus status = in_filter->getId64Bit(&filterId); + if (!status.isOk()) { + return status; + } + + if (!mDemux->attachRecordFilter(filterId)) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Dvr::detachFilter(const std::shared_ptr& in_filter) { + ALOGV("%s", __FUNCTION__); + + int64_t filterId; + ::ndk::ScopedAStatus status = in_filter->getId64Bit(&filterId); + if (!status.isOk()) { + return status; + } + + if (!mDemux->detachRecordFilter(filterId)) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Dvr::start() { + ALOGV("%s", __FUNCTION__); + if (mDvrThreadRunning) { + return ::ndk::ScopedAStatus::ok(); + } + + if (!mCallback) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_NO_INIT); + } + + if (!mDvrConfigured) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + if (mType == DvrType::PLAYBACK) { + mDvrThreadRunning = true; + pthread_create(&mDvrThread, NULL, __threadLoopPlayback, this); + pthread_setname_np(mDvrThread, "playback_waiting_loop"); + } else if (mType == DvrType::RECORD) { + mRecordStatus = RecordStatus::DATA_READY; + mDemux->setIsRecording(mType == DvrType::RECORD); + } + + // TODO start another thread to send filter status callback to the framework + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Dvr::stop() { + ALOGV("%s", __FUNCTION__); + + mDvrThreadRunning = false; + lock_guard lock(mDvrThreadLock); + + mIsRecordStarted = false; + mDemux->setIsRecording(false); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Dvr::flush() { + ALOGV("%s", __FUNCTION__); + + mRecordStatus = RecordStatus::DATA_READY; + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Dvr::close() { + ALOGV("%s", __FUNCTION__); + + mDvrThreadRunning = false; + lock_guard lock(mDvrThreadLock); + return ::ndk::ScopedAStatus::ok(); +} + +bool Dvr::createDvrMQ() { + ALOGV("%s", __FUNCTION__); + + // Create a synchronized FMQ that supports blocking read/write + unique_ptr tmpDvrMQ = unique_ptr(new (nothrow) DvrMQ(mBufferSize, true)); + if (!tmpDvrMQ->isValid()) { + ALOGW("[Dvr] Failed to create FMQ of DVR"); + return false; + } + + mDvrMQ = move(tmpDvrMQ); + + if (EventFlag::createEventFlag(mDvrMQ->getEventFlagWord(), &mDvrEventFlag) != ::android::OK) { + return false; + } + + return true; +} + +EventFlag* Dvr::getDvrEventFlag() { + return mDvrEventFlag; +} + +void* Dvr::__threadLoopPlayback(void* user) { + Dvr* const self = static_cast(user); + self->playbackThreadLoop(); + return 0; +} + +void Dvr::playbackThreadLoop() { + ALOGD("[Dvr] playback threadLoop start."); + lock_guard lock(mDvrThreadLock); + + while (mDvrThreadRunning) { + uint32_t efState = 0; + ::android::status_t status = + mDvrEventFlag->wait(static_cast(DemuxQueueNotifyBits::DATA_READY), + &efState, WAIT_TIMEOUT, true /* retry on spurious wake */); + if (status != ::android::OK) { + ALOGD("[Dvr] wait for data ready on the playback FMQ"); + continue; + } + + // If the both dvr playback and dvr record are created, the playback will be treated as + // the source of the record. isVirtualFrontend set to true would direct the dvr playback + // input to the demux record filters or live broadcast filters. + bool isRecording = mDemux->isRecording(); + bool isVirtualFrontend = isRecording; + + if (mDvrSettings.get().dataFormat == DataFormat::ES) { + if (!processEsDataOnPlayback(isVirtualFrontend, isRecording)) { + ALOGE("[Dvr] playback es data failed to be filtered. Ending thread"); + break; + } + maySendPlaybackStatusCallback(); + continue; + } + + // Our current implementation filter the data and write it into the filter FMQ immediately + // after the DATA_READY from the VTS/framework + // This is for the non-ES data source, real playback use case handling. + if (!readPlaybackFMQ(isVirtualFrontend, isRecording) || + !startFilterDispatcher(isVirtualFrontend, isRecording)) { + ALOGE("[Dvr] playback data failed to be filtered. Ending thread"); + break; + } + + maySendPlaybackStatusCallback(); + } + + mDvrThreadRunning = false; + ALOGD("[Dvr] playback thread ended."); +} + +void Dvr::maySendPlaybackStatusCallback() { + lock_guard lock(mPlaybackStatusLock); + int availableToRead = mDvrMQ->availableToRead(); + int availableToWrite = mDvrMQ->availableToWrite(); + + PlaybackStatus newStatus = + checkPlaybackStatusChange(availableToWrite, availableToRead, + mDvrSettings.get().highThreshold, + mDvrSettings.get().lowThreshold); + if (mPlaybackStatus != newStatus) { + mCallback->onPlaybackStatus(newStatus); + mPlaybackStatus = newStatus; + } +} + +PlaybackStatus Dvr::checkPlaybackStatusChange(uint32_t availableToWrite, uint32_t availableToRead, + uint32_t highThreshold, uint32_t lowThreshold) { + if (availableToWrite == 0) { + return PlaybackStatus::SPACE_FULL; + } else if (availableToRead > highThreshold) { + return PlaybackStatus::SPACE_ALMOST_FULL; + } else if (availableToRead < lowThreshold) { + return PlaybackStatus::SPACE_ALMOST_EMPTY; + } else if (availableToRead == 0) { + return PlaybackStatus::SPACE_EMPTY; + } + return mPlaybackStatus; +} + +bool Dvr::readPlaybackFMQ(bool isVirtualFrontend, bool isRecording) { + // Read playback data from the input FMQ + int size = mDvrMQ->availableToRead(); + int playbackPacketSize = mDvrSettings.get().packetSize; + vector dataOutputBuffer; + dataOutputBuffer.resize(playbackPacketSize); + // Dispatch the packet to the PID matching filter output buffer + for (int i = 0; i < size / playbackPacketSize; i++) { + if (!mDvrMQ->read(dataOutputBuffer.data(), playbackPacketSize)) { + return false; + } + if (isVirtualFrontend) { + if (isRecording) { + mDemux->sendFrontendInputToRecord(dataOutputBuffer); + } else { + mDemux->startBroadcastTsFilter(dataOutputBuffer); + } + } else { + startTpidFilter(dataOutputBuffer); + } + } + + return true; +} + +bool Dvr::processEsDataOnPlayback(bool isVirtualFrontend, bool isRecording) { + // Read ES from the DVR FMQ + // Note that currently we only provides ES with metaData in a specific format to be parsed. + // The ES size should be smaller than the Playback FMQ size to avoid reading truncated data. + int size = mDvrMQ->availableToRead(); + vector dataOutputBuffer; + dataOutputBuffer.resize(size); + if (!mDvrMQ->read(dataOutputBuffer.data(), size)) { + return false; + } + + int metaDataSize = size; + int totalFrames = 0; + int videoEsDataSize = 0; + int audioEsDataSize = 0; + int audioPid = 0; + int videoPid = 0; + + vector esMeta; + int videoReadPointer = 0; + int audioReadPointer = 0; + int frameCount = 0; + // Get meta data from the es + for (int i = 0; i < metaDataSize; i++) { + switch (dataOutputBuffer[i]) { + case 'm': + metaDataSize = 0; + getMetaDataValue(i, dataOutputBuffer.data(), metaDataSize); + videoReadPointer = metaDataSize; + continue; + case 'l': + getMetaDataValue(i, dataOutputBuffer.data(), totalFrames); + esMeta.resize(totalFrames); + continue; + case 'V': + getMetaDataValue(i, dataOutputBuffer.data(), videoEsDataSize); + audioReadPointer = metaDataSize + videoEsDataSize; + continue; + case 'A': + getMetaDataValue(i, dataOutputBuffer.data(), audioEsDataSize); + continue; + case 'p': + if (dataOutputBuffer[++i] == 'a') { + getMetaDataValue(i, dataOutputBuffer.data(), audioPid); + } else if (dataOutputBuffer[i] == 'v') { + getMetaDataValue(i, dataOutputBuffer.data(), videoPid); + } + continue; + case 'v': + case 'a': + if (dataOutputBuffer[i + 1] != ',') { + ALOGE("[Dvr] Invalid format meta data."); + return false; + } + esMeta[frameCount] = { + .isAudio = dataOutputBuffer[i] == 'a' ? true : false, + }; + i += 5; // Move to Len + getMetaDataValue(i, dataOutputBuffer.data(), esMeta[frameCount].len); + if (esMeta[frameCount].isAudio) { + esMeta[frameCount].startIndex = audioReadPointer; + audioReadPointer += esMeta[frameCount].len; + } else { + esMeta[frameCount].startIndex = videoReadPointer; + videoReadPointer += esMeta[frameCount].len; + } + i += 4; // move to PTS + getMetaDataValue(i, dataOutputBuffer.data(), esMeta[frameCount].pts); + frameCount++; + continue; + default: + continue; + } + } + + if (frameCount != totalFrames) { + ALOGE("[Dvr] Invalid meta data, frameCount=%d, totalFrames reported=%d", frameCount, + totalFrames); + return false; + } + + if (metaDataSize + audioEsDataSize + videoEsDataSize != size) { + ALOGE("[Dvr] Invalid meta data, metaSize=%d, videoSize=%d, audioSize=%d, totolSize=%d", + metaDataSize, videoEsDataSize, audioEsDataSize, size); + return false; + } + + // Read es raw data from the FMQ per meta data built previously + vector frameData; + map>::iterator it; + int pid = 0; + for (int i = 0; i < totalFrames; i++) { + frameData.resize(esMeta[i].len); + pid = esMeta[i].isAudio ? audioPid : videoPid; + memcpy(frameData.data(), dataOutputBuffer.data() + esMeta[i].startIndex, esMeta[i].len); + // Send to the media filters or record filters + if (!isRecording) { + for (it = mFilters.begin(); it != mFilters.end(); it++) { + if (pid == mDemux->getFilterTpid(it->first)) { + mDemux->updateMediaFilterOutput(it->first, frameData, + static_cast(esMeta[i].pts)); + } + } + } else { + mDemux->sendFrontendInputToRecord(frameData, pid, static_cast(esMeta[i].pts)); + } + startFilterDispatcher(isVirtualFrontend, isRecording); + frameData.clear(); + } + + return true; +} + +void Dvr::getMetaDataValue(int& index, int8_t* dataOutputBuffer, int& value) { + index += 2; // Move the pointer across the ":" to the value + while (dataOutputBuffer[index] != ',' && dataOutputBuffer[index] != '\n') { + value = ((dataOutputBuffer[index++] - 48) + value * 10); + } +} + +void Dvr::startTpidFilter(vector data) { + map>::iterator it; + for (it = mFilters.begin(); it != mFilters.end(); it++) { + uint16_t pid = ((data[1] & 0x1f) << 8) | ((data[2] & 0xff)); + if (DEBUG_DVR) { + ALOGW("[Dvr] start ts filter pid: %d", pid); + } + if (pid == mDemux->getFilterTpid(it->first)) { + mDemux->updateFilterOutput(it->first, data); + } + } +} + +bool Dvr::startFilterDispatcher(bool isVirtualFrontend, bool isRecording) { + if (isVirtualFrontend) { + if (isRecording) { + return mDemux->startRecordFilterDispatcher(); + } else { + return mDemux->startBroadcastFilterDispatcher(); + } + } + + map>::iterator it; + // Handle the output data per filter type + for (it = mFilters.begin(); it != mFilters.end(); it++) { + if (mDemux->startFilterHandler(it->first).isOk()) { + return false; + } + } + + return true; +} + +bool Dvr::writeRecordFMQ(const vector& data) { + lock_guard lock(mWriteLock); + if (mRecordStatus == RecordStatus::OVERFLOW) { + ALOGW("[Dvr] stops writing and wait for the client side flushing."); + return true; + } + if (mDvrMQ->write(data.data(), data.size())) { + mDvrEventFlag->wake(static_cast(DemuxQueueNotifyBits::DATA_READY)); + maySendRecordStatusCallback(); + return true; + } + + maySendRecordStatusCallback(); + return false; +} + +void Dvr::maySendRecordStatusCallback() { + lock_guard lock(mRecordStatusLock); + int availableToRead = mDvrMQ->availableToRead(); + int availableToWrite = mDvrMQ->availableToWrite(); + + RecordStatus newStatus = + checkRecordStatusChange(availableToWrite, availableToRead, + mDvrSettings.get().highThreshold, + mDvrSettings.get().lowThreshold); + if (mRecordStatus != newStatus) { + mCallback->onRecordStatus(newStatus); + mRecordStatus = newStatus; + } +} + +RecordStatus Dvr::checkRecordStatusChange(uint32_t availableToWrite, uint32_t availableToRead, + uint32_t highThreshold, uint32_t lowThreshold) { + if (availableToWrite == 0) { + return RecordStatus::OVERFLOW; + } else if (availableToRead > highThreshold) { + return RecordStatus::HIGH_WATER; + } else if (availableToRead < lowThreshold) { + return RecordStatus::LOW_WATER; + } + return mRecordStatus; +} + +bool Dvr::addPlaybackFilter(int64_t filterId, std::shared_ptr filter) { + mFilters[filterId] = filter; + return true; +} + +bool Dvr::removePlaybackFilter(int64_t filterId) { + mFilters.erase(filterId); + return true; +} + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/Dvr.h b/tv/tuner/aidl/default/Dvr.h new file mode 100644 index 0000000000..fb22a2ee1f --- /dev/null +++ b/tv/tuner/aidl/default/Dvr.h @@ -0,0 +1,156 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include +#include +#include +#include "Demux.h" +#include "Frontend.h" +#include "Tuner.h" + +using namespace std; + +namespace aidl { +namespace android { +namespace hardware { +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 DvrMQ = AidlMessageQueue; + +struct MediaEsMetaData { + bool isAudio; + int startIndex; + int len; + int pts; +}; + +class Demux; +class Filter; +class Frontend; +class Tuner; + +class Dvr : public BnDvr { + public: + Dvr(DvrType type, uint32_t bufferSize, const std::shared_ptr& cb, + std::shared_ptr demux); + ~Dvr(); + + ::ndk::ScopedAStatus getQueueDesc( + MQDescriptor* out_queue) override; + ::ndk::ScopedAStatus configure(const DvrSettings& in_settings) override; + ::ndk::ScopedAStatus attachFilter(const std::shared_ptr& in_filter) override; + ::ndk::ScopedAStatus detachFilter(const std::shared_ptr& in_filter) override; + ::ndk::ScopedAStatus start() override; + ::ndk::ScopedAStatus stop() override; + ::ndk::ScopedAStatus flush() override; + ::ndk::ScopedAStatus close() override; + + /** + * To create a DvrMQ and its Event Flag. + * + * Return false is any of the above processes fails. + */ + bool createDvrMQ(); + bool writeRecordFMQ(const std::vector& data); + bool addPlaybackFilter(int64_t filterId, std::shared_ptr filter); + bool removePlaybackFilter(int64_t filterId); + bool readPlaybackFMQ(bool isVirtualFrontend, bool isRecording); + bool processEsDataOnPlayback(bool isVirtualFrontend, bool isRecording); + bool startFilterDispatcher(bool isVirtualFrontend, bool isRecording); + EventFlag* getDvrEventFlag(); + DvrSettings getSettings() { return mDvrSettings; } + + private: + // Demux service + std::shared_ptr mDemux; + + DvrType mType; + uint32_t mBufferSize; + std::shared_ptr mCallback; + std::map> mFilters; + + void deleteEventFlag(); + bool readDataFromMQ(); + void getMetaDataValue(int& index, int8_t* dataOutputBuffer, int& value); + void maySendPlaybackStatusCallback(); + void maySendRecordStatusCallback(); + PlaybackStatus checkPlaybackStatusChange(uint32_t availableToWrite, uint32_t availableToRead, + uint32_t highThreshold, uint32_t lowThreshold); + RecordStatus checkRecordStatusChange(uint32_t availableToWrite, uint32_t availableToRead, + uint32_t highThreshold, uint32_t lowThreshold); + /** + * A dispatcher to read and dispatch input data to all the started filters. + * Each filter handler handles the data filtering/output writing/filterEvent updating. + */ + void startTpidFilter(vector data); + static void* __threadLoopPlayback(void* user); + static void* __threadLoopRecord(void* user); + void playbackThreadLoop(); + void recordThreadLoop(); + + unique_ptr mDvrMQ; + EventFlag* mDvrEventFlag; + /** + * Demux callbacks used on filter events or IO buffer status + */ + bool mDvrConfigured = false; + DvrSettings mDvrSettings; + + // Thread handlers + pthread_t mDvrThread; + + // FMQ status local records + PlaybackStatus mPlaybackStatus; + RecordStatus mRecordStatus; + /** + * If a specific filter's writing loop is still running + */ + bool mDvrThreadRunning; + bool mKeepFetchingDataFromFrontend; + /** + * Lock to protect writes to the FMQs + */ + std::mutex mWriteLock; + /** + * Lock to protect writes to the input status + */ + std::mutex mPlaybackStatusLock; + std::mutex mRecordStatusLock; + std::mutex mDvrThreadLock; + + const bool DEBUG_DVR = false; + + // Booleans to check if recording is running. + // Recording is ready when both of the following are set to true. + bool mIsRecordStarted = false; +}; + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp new file mode 100644 index 0000000000..18c1f00608 --- /dev/null +++ b/tv/tuner/aidl/default/Filter.cpp @@ -0,0 +1,1103 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//#define LOG_NDEBUG 0 +#define LOG_TAG "android.hardware.tv.tuner-service.example-Filter" + +#include +#include +#include +#include +#include + +#include "Filter.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace tuner { + +#define WAIT_TIMEOUT 3000000000 + +Filter::Filter() {} + +Filter::Filter(DemuxFilterType type, int64_t filterId, uint32_t bufferSize, + const std::shared_ptr& cb, std::shared_ptr demux) { + mType = type; + mFilterId = filterId; + mBufferSize = bufferSize; + mDemux = demux; + mCallback = cb; + + switch (mType.mainType) { + case DemuxFilterMainType::TS: + if (mType.subType.get() == + DemuxTsFilterType::AUDIO || + mType.subType.get() == + DemuxTsFilterType::VIDEO) { + mIsMediaFilter = true; + } + if (mType.subType.get() == + DemuxTsFilterType::PCR) { + mIsPcrFilter = true; + } + if (mType.subType.get() == + DemuxTsFilterType::RECORD) { + mIsRecordFilter = true; + } + break; + case DemuxFilterMainType::MMTP: + if (mType.subType.get() == + DemuxMmtpFilterType::AUDIO || + mType.subType.get() == + DemuxMmtpFilterType::VIDEO) { + mIsMediaFilter = true; + } + if (mType.subType.get() == + DemuxMmtpFilterType::RECORD) { + mIsRecordFilter = true; + } + break; + case DemuxFilterMainType::IP: + break; + case DemuxFilterMainType::TLV: + break; + case DemuxFilterMainType::ALP: + break; + default: + break; + } +} + +Filter::~Filter() { + mFilterThreadRunning = false; + std::lock_guard lock(mFilterThreadLock); +} + +::ndk::ScopedAStatus Filter::getId64Bit(int64_t* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + *_aidl_return = mFilterId; + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::getId(int32_t* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + *_aidl_return = static_cast(mFilterId); + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::setDataSource(const std::shared_ptr& in_filter) { + ALOGV("%s", __FUNCTION__); + + mDataSource = in_filter; + mIsDataSourceDemux = false; + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::getQueueDesc(MQDescriptor* out_queue) { + ALOGV("%s", __FUNCTION__); + + mIsUsingFMQ = mIsRecordFilter ? false : true; + + *out_queue = mFilterMQ->dupeDesc(); + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::configure(const DemuxFilterSettings& in_settings) { + ALOGV("%s", __FUNCTION__); + + mFilterSettings = in_settings; + switch (mType.mainType) { + case DemuxFilterMainType::TS: + mTpid = in_settings.get().tpid; + break; + case DemuxFilterMainType::MMTP: + break; + case DemuxFilterMainType::IP: + break; + case DemuxFilterMainType::TLV: + break; + case DemuxFilterMainType::ALP: + break; + default: + break; + } + + mConfigured = true; + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::start() { + ALOGV("%s", __FUNCTION__); + mFilterThreadRunning = true; + vector events; + // All the filter event callbacks in start are for testing purpose. + switch (mType.mainType) { + case DemuxFilterMainType::TS: + createMediaEvent(events); + mCallback->onFilterEvent(events); + createTsRecordEvent(events); + mCallback->onFilterEvent(events); + createTemiEvent(events); + mCallback->onFilterEvent(events); + break; + case DemuxFilterMainType::MMTP: + createDownloadEvent(events); + mCallback->onFilterEvent(events); + createMmtpRecordEvent(events); + mCallback->onFilterEvent(events); + break; + case DemuxFilterMainType::IP: + createSectionEvent(events); + mCallback->onFilterEvent(events); + createIpPayloadEvent(events); + mCallback->onFilterEvent(events); + break; + case DemuxFilterMainType::TLV: + createMonitorEvent(events); + mCallback->onFilterEvent(events); + break; + case DemuxFilterMainType::ALP: + createMonitorEvent(events); + mCallback->onFilterEvent(events); + break; + default: + break; + } + return startFilterLoop(); +} + +::ndk::ScopedAStatus Filter::stop() { + ALOGV("%s", __FUNCTION__); + mFilterThreadRunning = false; + std::lock_guard lock(mFilterThreadLock); + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::flush() { + ALOGV("%s", __FUNCTION__); + + // temp implementation to flush the FMQ + int size = mFilterMQ->availableToRead(); + int8_t* buffer = new int8_t[size]; + mFilterMQ->read(buffer, size); + delete[] buffer; + mFilterStatus = DemuxFilterStatus::DATA_READY; + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::releaseAvHandle(const NativeHandle& in_avMemory, int64_t in_avDataId) { + ALOGV("%s", __FUNCTION__); + + if ((mSharedAvMemHandle != nullptr) && (in_avMemory.fds.size() > 0) && + (sameFile(in_avMemory.fds[0].get(), mSharedAvMemHandle->data[0]))) { + freeSharedAvHandle(); + return ::ndk::ScopedAStatus::ok(); + } + + if (mDataId2Avfd.find(in_avDataId) == mDataId2Avfd.end()) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + ::close(mDataId2Avfd[in_avDataId]); + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::close() { + ALOGV("%s", __FUNCTION__); + + mFilterThreadRunning = false; + std::lock_guard lock(mFilterThreadLock); + return mDemux->removeFilter(mFilterId); +} + +::ndk::ScopedAStatus Filter::configureIpCid(int32_t in_ipCid) { + ALOGV("%s", __FUNCTION__); + + if (mType.mainType != DemuxFilterMainType::IP) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + mCid = in_ipCid; + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::getAvSharedHandle(NativeHandle* out_avMemory, int64_t* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + if (!mIsMediaFilter) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + if (mSharedAvMemHandle != nullptr) { + *out_avMemory = ::android::dupToAidl(mSharedAvMemHandle); + *_aidl_return = BUFFER_SIZE_16M; + mUsingSharedAvMem = true; + return ::ndk::ScopedAStatus::ok(); + } + + int av_fd = createAvIonFd(BUFFER_SIZE_16M); + if (av_fd < 0) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_NO_MEMORY); + } + + mSharedAvMemHandle = createNativeHandle(av_fd); + if (mSharedAvMemHandle == nullptr) { + ::close(av_fd); + *_aidl_return = 0; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + } + ::close(av_fd); + mUsingSharedAvMem = true; + + *out_avMemory = ::android::dupToAidl(mSharedAvMemHandle); + *_aidl_return = BUFFER_SIZE_16M; + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::configureAvStreamType(const AvStreamType& in_avStreamType) { + ALOGV("%s", __FUNCTION__); + + if (!mIsMediaFilter) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + switch (in_avStreamType.getTag()) { + case AvStreamType::Tag::audio: + mAudioStreamType = + static_cast(in_avStreamType.get()); + break; + case AvStreamType::Tag::video: + mVideoStreamType = + static_cast(in_avStreamType.get()); + break; + default: + break; + } + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::configureMonitorEvent(int in_monitorEventTypes) { + ALOGV("%s", __FUNCTION__); + + int32_t newScramblingStatus = + in_monitorEventTypes & + static_cast(DemuxFilterMonitorEventType::SCRAMBLING_STATUS); + int32_t newIpCid = + in_monitorEventTypes & static_cast(DemuxFilterMonitorEventType::IP_CID_CHANGE); + + // if scrambling status monitoring flipped, record the new state and send msg on enabling + if (newScramblingStatus ^ mScramblingStatusMonitored) { + mScramblingStatusMonitored = newScramblingStatus; + if (mScramblingStatusMonitored) { + if (mCallback != nullptr) { + // Assuming current status is always NOT_SCRAMBLED + vector events; + DemuxFilterMonitorEvent monitorEvent; + events.resize(1); + monitorEvent.set( + ScramblingStatus::NOT_SCRAMBLED); + events[0].set(monitorEvent); + mCallback->onFilterEvent(events); + } else { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + } + } + + // if ip cid monitoring flipped, record the new state and send msg on enabling + if (newIpCid ^ mIpCidMonitored) { + mIpCidMonitored = newIpCid; + if (mIpCidMonitored) { + if (mCallback != nullptr) { + // Return random cid + vector events; + DemuxFilterMonitorEvent monitorEvent; + events.resize(1); + monitorEvent.set(1); + events[0].set(monitorEvent); + mCallback->onFilterEvent(events); + } else { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + } + } + + return ::ndk::ScopedAStatus::ok(); +} + +bool Filter::createFilterMQ() { + ALOGV("%s", __FUNCTION__); + + // Create a synchronized FMQ that supports blocking read/write + std::unique_ptr tmpFilterMQ = + std::unique_ptr(new (std::nothrow) FilterMQ(mBufferSize, true)); + if (!tmpFilterMQ->isValid()) { + ALOGW("[Filter] Failed to create FMQ of filter with id: %" PRIu64, mFilterId); + return false; + } + + mFilterMQ = std::move(tmpFilterMQ); + + if (EventFlag::createEventFlag(mFilterMQ->getEventFlagWord(), &mFilterEventsFlag) != + ::android::OK) { + return false; + } + + return true; +} + +::ndk::ScopedAStatus Filter::startFilterLoop() { + pthread_create(&mFilterThread, NULL, __threadLoopFilter, this); + pthread_setname_np(mFilterThread, "filter_waiting_loop"); + return ::ndk::ScopedAStatus::ok(); +} + +void* Filter::__threadLoopFilter(void* user) { + Filter* const self = static_cast(user); + self->filterThreadLoop(); + return 0; +} + +void Filter::filterThreadLoop() { + if (!mFilterThreadRunning) { + return; + } + std::lock_guard lock(mFilterThreadLock); + ALOGD("[Filter] filter %" PRIu64 " threadLoop start.", mFilterId); + + // 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) { + if (mFilterEvents.size() == 0) { + if (DEBUG_FILTER) { + ALOGD("[Filter] wait for filter data output."); + } + usleep(1000 * 1000); + continue; + } + + // After successfully write, send a callback and wait for the read to be done + if (mCallback != nullptr) { + if (mConfigured) { + vector startEvent; + startEvent.resize(1); + startEvent[0].set(mStartId++); + mCallback->onFilterEvent(startEvent); + mConfigured = false; + } + mCallback->onFilterEvent(mFilterEvents); + } else { + ALOGD("[Filter] filter callback is not configured yet."); + mFilterThreadRunning = false; + return; + } + + mFilterEvents.resize(0); + mFilterStatus = DemuxFilterStatus::DATA_READY; + if (mCallback != nullptr) { + mCallback->onFilterStatus(mFilterStatus); + } + break; + } + + while (mFilterThreadRunning) { + uint32_t efState = 0; + // We do not wait for the last round of written data to be read to finish the thread + // because the VTS can verify the reading itself. + for (int i = 0; i < SECTION_WRITE_COUNT; i++) { + if (!mFilterThreadRunning) { + break; + } + while (mFilterThreadRunning && mIsUsingFMQ) { + ::android::status_t status = mFilterEventsFlag->wait( + static_cast(DemuxQueueNotifyBits::DATA_CONSUMED), &efState, + WAIT_TIMEOUT, true /* retry on spurious wake */); + if (status != ::android::OK) { + ALOGD("[Filter] wait for data consumed"); + continue; + } + break; + } + + maySendFilterStatusCallback(); + + while (mFilterThreadRunning) { + std::lock_guard lock(mFilterEventsLock); + if (mFilterEvents.size() == 0) { + continue; + } + // After successfully write, send a callback and wait for the read to be done + if (mCallback != nullptr) { + mCallback->onFilterEvent(mFilterEvents); + } + mFilterEvents.resize(0); + break; + } + // We do not wait for the last read to be done + // VTS can verify the read result itself. + if (i == SECTION_WRITE_COUNT - 1) { + ALOGD("[Filter] filter %" PRIu64 " writing done. Ending thread", mFilterId); + break; + } + } + break; + } + ALOGD("[Filter] filter thread ended."); +} + +void Filter::freeSharedAvHandle() { + if (!mIsMediaFilter) { + return; + } + native_handle_close(mSharedAvMemHandle); + native_handle_delete(mSharedAvMemHandle); + mSharedAvMemHandle = nullptr; +} + +void Filter::maySendFilterStatusCallback() { + if (!mIsUsingFMQ) { + return; + } + std::lock_guard lock(mFilterStatusLock); + int availableToRead = mFilterMQ->availableToRead(); + int availableToWrite = mFilterMQ->availableToWrite(); + int fmqSize = mFilterMQ->getQuantumCount(); + + DemuxFilterStatus newStatus = checkFilterStatusChange( + availableToWrite, availableToRead, ceil(fmqSize * 0.75), ceil(fmqSize * 0.25)); + if (mFilterStatus != newStatus) { + if (mCallback != nullptr) { + mCallback->onFilterStatus(newStatus); + } + mFilterStatus = newStatus; + } +} + +DemuxFilterStatus Filter::checkFilterStatusChange(uint32_t availableToWrite, + uint32_t availableToRead, uint32_t highThreshold, + uint32_t lowThreshold) { + if (availableToWrite == 0) { + return DemuxFilterStatus::OVERFLOW; + } else if (availableToRead > highThreshold) { + return DemuxFilterStatus::HIGH_WATER; + } else if (availableToRead < lowThreshold) { + return DemuxFilterStatus::LOW_WATER; + } + return mFilterStatus; +} + +uint16_t Filter::getTpid() { + return mTpid; +} + +void Filter::updateFilterOutput(vector data) { + std::lock_guard lock(mFilterOutputLock); + mFilterOutput.insert(mFilterOutput.end(), data.begin(), data.end()); +} + +void Filter::updatePts(uint64_t pts) { + std::lock_guard lock(mFilterOutputLock); + mPts = pts; +} + +void Filter::updateRecordOutput(vector data) { + std::lock_guard lock(mRecordFilterOutputLock); + mRecordFilterOutput.insert(mRecordFilterOutput.end(), data.begin(), data.end()); +} + +::ndk::ScopedAStatus Filter::startFilterHandler() { + std::lock_guard lock(mFilterOutputLock); + switch (mType.mainType) { + case DemuxFilterMainType::TS: + switch (mType.subType.get()) { + case DemuxTsFilterType::UNDEFINED: + break; + case DemuxTsFilterType::SECTION: + startSectionFilterHandler(); + break; + case DemuxTsFilterType::PES: + startPesFilterHandler(); + break; + case DemuxTsFilterType::TS: + startTsFilterHandler(); + break; + case DemuxTsFilterType::AUDIO: + case DemuxTsFilterType::VIDEO: + startMediaFilterHandler(); + break; + case DemuxTsFilterType::PCR: + startPcrFilterHandler(); + break; + case DemuxTsFilterType::TEMI: + startTemiFilterHandler(); + break; + default: + break; + } + break; + case DemuxFilterMainType::MMTP: + /*mmtpSettings*/ + break; + case DemuxFilterMainType::IP: + /*ipSettings*/ + break; + case DemuxFilterMainType::TLV: + /*tlvSettings*/ + break; + case DemuxFilterMainType::ALP: + /*alpSettings*/ + break; + default: + break; + } + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::startSectionFilterHandler() { + if (mFilterOutput.empty()) { + return ::ndk::ScopedAStatus::ok(); + } + if (!writeSectionsAndCreateEvent(mFilterOutput)) { + ALOGD("[Filter] filter %" PRIu64 " fails to write into FMQ. Ending thread", mFilterId); + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + } + + mFilterOutput.clear(); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::startPesFilterHandler() { + std::lock_guard lock(mFilterEventsLock); + if (mFilterOutput.empty()) { + return ::ndk::ScopedAStatus::ok(); + } + + for (int i = 0; i < mFilterOutput.size(); i += 188) { + if (mPesSizeLeft == 0) { + uint32_t prefix = (mFilterOutput[i + 4] << 16) | (mFilterOutput[i + 5] << 8) | + mFilterOutput[i + 6]; + if (DEBUG_FILTER) { + ALOGD("[Filter] prefix %d", prefix); + } + if (prefix == 0x000001) { + // TODO handle mulptiple Pes filters + mPesSizeLeft = (mFilterOutput[i + 8] << 8) | mFilterOutput[i + 9]; + mPesSizeLeft += 6; + if (DEBUG_FILTER) { + ALOGD("[Filter] pes data length %d", mPesSizeLeft); + } + } else { + continue; + } + } + + int endPoint = min(184, mPesSizeLeft); + // append data and check size + vector::const_iterator first = mFilterOutput.begin() + i + 4; + vector::const_iterator last = mFilterOutput.begin() + i + 4 + endPoint; + mPesOutput.insert(mPesOutput.end(), first, last); + // size does not match then continue + mPesSizeLeft -= endPoint; + if (DEBUG_FILTER) { + ALOGD("[Filter] pes data left %d", mPesSizeLeft); + } + if (mPesSizeLeft > 0) { + continue; + } + // size match then create event + if (!writeDataToFilterMQ(mPesOutput)) { + ALOGD("[Filter] pes data write failed"); + mFilterOutput.clear(); + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + maySendFilterStatusCallback(); + DemuxFilterPesEvent pesEvent; + pesEvent = { + // temp dump meta data + .streamId = static_cast(mPesOutput[3]), + .dataLength = static_cast(mPesOutput.size()), + }; + if (DEBUG_FILTER) { + ALOGD("[Filter] assembled pes data length %d", pesEvent.dataLength); + } + + int size = mFilterEvents.size(); + mFilterEvents.resize(size + 1); + mFilterEvents[size].set(pesEvent); + mPesOutput.clear(); + } + + mFilterOutput.clear(); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::startTsFilterHandler() { + // TODO handle starting TS filter + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::startMediaFilterHandler() { + std::lock_guard lock(mFilterEventsLock); + if (mFilterOutput.empty()) { + return ::ndk::ScopedAStatus::ok(); + } + + ::ndk::ScopedAStatus result; + if (mPts) { + result = createMediaFilterEventWithIon(mFilterOutput); + if (result.isOk()) { + mFilterOutput.clear(); + } + return result; + } + + for (int i = 0; i < mFilterOutput.size(); i += 188) { + if (mPesSizeLeft == 0) { + uint32_t prefix = (mFilterOutput[i + 4] << 16) | (mFilterOutput[i + 5] << 8) | + mFilterOutput[i + 6]; + if (DEBUG_FILTER) { + ALOGD("[Filter] prefix %d", prefix); + } + if (prefix == 0x000001) { + // TODO handle mulptiple Pes filters + mPesSizeLeft = (mFilterOutput[i + 8] << 8) | mFilterOutput[i + 9]; + mPesSizeLeft += 6; + if (DEBUG_FILTER) { + ALOGD("[Filter] pes data length %d", mPesSizeLeft); + } + } else { + continue; + } + } + + int endPoint = min(184, mPesSizeLeft); + // append data and check size + vector::const_iterator first = mFilterOutput.begin() + i + 4; + vector::const_iterator last = mFilterOutput.begin() + i + 4 + endPoint; + mPesOutput.insert(mPesOutput.end(), first, last); + // size does not match then continue + mPesSizeLeft -= endPoint; + if (DEBUG_FILTER) { + ALOGD("[Filter] pes data left %d", mPesSizeLeft); + } + if (mPesSizeLeft > 0 || mAvBufferCopyCount++ < 10) { + continue; + } + + result = createMediaFilterEventWithIon(mPesOutput); + if (result.isOk()) { + return result; + } + } + + mFilterOutput.clear(); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::createMediaFilterEventWithIon(vector& output) { + if (mUsingSharedAvMem) { + if (mSharedAvMemHandle == nullptr) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + } + return createShareMemMediaEvents(output); + } + + return createIndependentMediaEvents(output); +} + +::ndk::ScopedAStatus Filter::startRecordFilterHandler() { + std::lock_guard lock(mRecordFilterOutputLock); + if (mRecordFilterOutput.empty()) { + return ::ndk::ScopedAStatus::ok(); + } + + if (mDvr == nullptr || !mDvr->writeRecordFMQ(mRecordFilterOutput)) { + ALOGD("[Filter] dvr fails to write into record FMQ."); + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + } + + DemuxFilterTsRecordEvent recordEvent; + recordEvent = { + .byteNumber = static_cast(mRecordFilterOutput.size()), + .pts = (mPts == 0) ? static_cast(time(NULL)) * 900000 : mPts, + .firstMbInSlice = 0, // random address + }; + + int size; + size = mFilterEvents.size(); + mFilterEvents.resize(size + 1); + mFilterEvents[size].set(recordEvent); + + mRecordFilterOutput.clear(); + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::startPcrFilterHandler() { + // TODO handle starting PCR filter + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::startTemiFilterHandler() { + // TODO handle starting TEMI filter + return ::ndk::ScopedAStatus::ok(); +} + +bool Filter::writeSectionsAndCreateEvent(vector& data) { + // TODO check how many sections has been read + ALOGD("[Filter] section handler"); + std::lock_guard lock(mFilterEventsLock); + if (!writeDataToFilterMQ(data)) { + return false; + } + int size = mFilterEvents.size(); + mFilterEvents.resize(size + 1); + DemuxFilterSectionEvent secEvent; + secEvent = { + // temp dump meta data + .tableId = 0, + .version = 1, + .sectionNum = 1, + .dataLength = static_cast(data.size()), + }; + mFilterEvents[size].set(secEvent); + return true; +} + +bool Filter::writeDataToFilterMQ(const std::vector& data) { + std::lock_guard lock(mWriteLock); + if (mFilterMQ->write(data.data(), data.size())) { + return true; + } + return false; +} + +void Filter::attachFilterToRecord(const std::shared_ptr dvr) { + mDvr = dvr; +} + +void Filter::detachFilterFromRecord() { + mDvr = nullptr; +} + +int Filter::createAvIonFd(int size) { + // Create an DMA-BUF fd and allocate an av fd mapped to a buffer to it. + auto buffer_allocator = std::make_unique(); + if (!buffer_allocator) { + ALOGE("[Filter] Unable to create BufferAllocator object"); + return -1; + } + int av_fd = -1; + av_fd = buffer_allocator->Alloc("system-uncached", size); + if (av_fd < 0) { + ALOGE("[Filter] Failed to create av fd %d", errno); + return -1; + } + return av_fd; +} + +uint8_t* Filter::getIonBuffer(int fd, int size) { + uint8_t* avBuf = static_cast( + mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 /*offset*/)); + if (avBuf == MAP_FAILED) { + ALOGE("[Filter] fail to allocate buffer %d", errno); + return NULL; + } + return avBuf; +} + +native_handle_t* Filter::createNativeHandle(int fd) { + native_handle_t* nativeHandle; + if (fd < 0) { + nativeHandle = native_handle_create(/*numFd*/ 0, 0); + } else { + // Create a native handle to pass the av fd via the callback event. + nativeHandle = native_handle_create(/*numFd*/ 1, 0); + } + if (nativeHandle == NULL) { + ALOGE("[Filter] Failed to create native_handle %d", errno); + return NULL; + } + if (nativeHandle->numFds > 0) { + nativeHandle->data[0] = dup(fd); + } + return nativeHandle; +} + +::ndk::ScopedAStatus Filter::createIndependentMediaEvents(vector& output) { + int av_fd = createAvIonFd(output.size()); + if (av_fd == -1) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + } + // copy the filtered data to the buffer + uint8_t* avBuffer = getIonBuffer(av_fd, output.size()); + if (avBuffer == NULL) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + } + memcpy(avBuffer, output.data(), output.size() * sizeof(uint8_t)); + + native_handle_t* nativeHandle = createNativeHandle(av_fd); + if (nativeHandle == NULL) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + } + + // Create a dataId and add a pair into the dataId2Avfd map + uint64_t dataId = mLastUsedDataId++ /*createdUID*/; + mDataId2Avfd[dataId] = dup(av_fd); + + // Create mediaEvent and send callback + int size = mFilterEvents.size(); + mFilterEvents.resize(size + 1); + + mFilterEvents[size] = DemuxFilterEvent::make(); + mFilterEvents[size].get().avMemory = + ::android::dupToAidl(nativeHandle); + mFilterEvents[size].get().dataLength = + static_cast(output.size()); + mFilterEvents[size].get().avDataId = static_cast(dataId); + if (mPts) { + mFilterEvents[size].get().pts = mPts; + mPts = 0; + } + + // Clear and log + native_handle_close(nativeHandle); + native_handle_delete(nativeHandle); + output.clear(); + mAvBufferCopyCount = 0; + if (DEBUG_FILTER) { + ALOGD("[Filter] av data length %d", static_cast(output.size())); + } + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Filter::createShareMemMediaEvents(vector& output) { + // copy the filtered data to the shared buffer + uint8_t* sharedAvBuffer = + getIonBuffer(mSharedAvMemHandle->data[0], output.size() + mSharedAvMemOffset); + if (sharedAvBuffer == NULL) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + } + memcpy(sharedAvBuffer + mSharedAvMemOffset, output.data(), output.size() * sizeof(uint8_t)); + + // Create a memory handle with numFds == 0 + native_handle_t* nativeHandle = createNativeHandle(-1); + if (nativeHandle == NULL) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + } + + // Create mediaEvent and send callback + int size = mFilterEvents.size(); + mFilterEvents.resize(size + 1); + mFilterEvents[size] = DemuxFilterEvent::make(); + mFilterEvents[size].get().avMemory = + ::android::dupToAidl(nativeHandle); + mFilterEvents[size].get().offset = + static_cast(mSharedAvMemOffset); + mFilterEvents[size].get().dataLength = + static_cast(output.size()); + if (mPts) { + mFilterEvents[size].get().pts = mPts; + mPts = 0; + } + mSharedAvMemOffset += output.size(); + + // Clear and log + native_handle_close(nativeHandle); + native_handle_delete(nativeHandle); + output.clear(); + if (DEBUG_FILTER) { + ALOGD("[Filter] shared av data length %d", static_cast(output.size())); + } + return ::ndk::ScopedAStatus::ok(); +} + +bool Filter::sameFile(int fd1, int fd2) { + struct stat stat1, stat2; + if (fstat(fd1, &stat1) < 0 || fstat(fd2, &stat2) < 0) { + return false; + } + return (stat1.st_dev == stat2.st_dev) && (stat1.st_ino == stat2.st_ino); +} + +void Filter::createMediaEvent(vector& events) { + AudioExtraMetaData audio; + events.resize(1); + + audio.adFade = 1; + audio.adPan = 2; + audio.versionTextTag = 3; + audio.adGainCenter = 4; + audio.adGainFront = 5; + audio.adGainSurround = 6; + + events[0] = DemuxFilterEvent::make(); + events[0].get().streamId = 1; + events[0].get().isPtsPresent = true; + events[0].get().dataLength = 3; + events[0].get().offset = 4; + events[0].get().isSecureMemory = true; + events[0].get().mpuSequenceNumber = 6; + events[0].get().isPesPrivateData = true; + events[0] + .get() + .extraMetaData.set(audio); + + int av_fd = createAvIonFd(BUFFER_SIZE_16M); + if (av_fd == -1) { + return; + } + + native_handle_t* nativeHandle = createNativeHandle(av_fd); + if (nativeHandle == nullptr) { + ::close(av_fd); + ALOGE("[Filter] Failed to create native_handle %d", errno); + return; + } + + // Create a dataId and add a pair into the dataId2Avfd map + uint64_t dataId = mLastUsedDataId++ /*createdUID*/; + mDataId2Avfd[dataId] = dup(av_fd); + + events[0].get().avDataId = static_cast(dataId); + events[0].get().avMemory = ::android::dupToAidl(nativeHandle); + + native_handle_close(nativeHandle); + native_handle_delete(nativeHandle); +} + +void Filter::createTsRecordEvent(vector& events) { + events.resize(2); + + DemuxPid pid; + DemuxFilterScIndexMask mask; + DemuxFilterTsRecordEvent tsRecord1; + pid.set(1); + mask.set(1); + tsRecord1.pid = pid; + tsRecord1.tsIndexMask = 1; + tsRecord1.scIndexMask = mask; + tsRecord1.byteNumber = 2; + + DemuxFilterTsRecordEvent tsRecord2; + tsRecord2.pts = 1; + tsRecord2.firstMbInSlice = 2; // random address + + events[0].set(tsRecord1); + events[1].set(tsRecord2); +} + +void Filter::createMmtpRecordEvent(vector& events) { + events.resize(2); + + DemuxFilterMmtpRecordEvent mmtpRecord1; + mmtpRecord1.scHevcIndexMask = 1; + mmtpRecord1.byteNumber = 2; + + DemuxFilterMmtpRecordEvent mmtpRecord2; + mmtpRecord2.pts = 1; + mmtpRecord2.mpuSequenceNumber = 2; + mmtpRecord2.firstMbInSlice = 3; + mmtpRecord2.tsIndexMask = 4; + + events[0].set(mmtpRecord1); + events[1].set(mmtpRecord2); +} + +void Filter::createSectionEvent(vector& events) { + events.resize(1); + + DemuxFilterSectionEvent section; + section.tableId = 1; + section.version = 2; + section.sectionNum = 3; + section.dataLength = 0; + + events[0].set(section); +} + +void Filter::createPesEvent(vector& events) { + events.resize(1); + + DemuxFilterPesEvent pes; + pes.streamId = 1; + pes.dataLength = 1; + pes.mpuSequenceNumber = 2; + + events[0].set(pes); +} + +void Filter::createDownloadEvent(vector& events) { + events.resize(1); + + DemuxFilterDownloadEvent download; + download.itemId = 1; + download.mpuSequenceNumber = 2; + download.itemFragmentIndex = 3; + download.lastItemFragmentIndex = 4; + download.dataLength = 0; + + events[0].set(download); +} + +void Filter::createIpPayloadEvent(vector& events) { + events.resize(1); + + DemuxFilterIpPayloadEvent ipPayload; + ipPayload.dataLength = 0; + + events[0].set(ipPayload); +} + +void Filter::createTemiEvent(vector& events) { + events.resize(1); + + DemuxFilterTemiEvent temi; + temi.pts = 1; + temi.descrTag = 2; + temi.descrData = {3}; + + events[0].set(temi); +} + +void Filter::createMonitorEvent(vector& events) { + events.resize(1); + + DemuxFilterMonitorEvent monitor; + monitor.set(ScramblingStatus::SCRAMBLED); + events[0].set(monitor); +} + +void Filter::createRestartEvent(vector& events) { + events.resize(1); + + events[0].set(1); +} + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/Filter.h b/tv/tuner/aidl/default/Filter.h new file mode 100644 index 0000000000..7a037e690e --- /dev/null +++ b/tv/tuner/aidl/default/Filter.h @@ -0,0 +1,242 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include +#include +#include +#include +#include +#include +#include "Demux.h" +#include "Dvr.h" +#include "Frontend.h" + +using namespace std; + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace tuner { + +using ::aidl::android::hardware::common::NativeHandle; +using ::aidl::android::hardware::common::fmq::MQDescriptor; +using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite; +using ::android::AidlMessageQueue; +using ::android::hardware::EventFlag; + +using FilterMQ = AidlMessageQueue; +const uint32_t BUFFER_SIZE_16M = 0x1000000; + +class Demux; +class Dvr; + +class Filter : public BnFilter { + public: + Filter(); + + Filter(DemuxFilterType type, int64_t filterId, uint32_t bufferSize, + const std::shared_ptr& cb, std::shared_ptr demux); + + ~Filter(); + + ::ndk::ScopedAStatus getQueueDesc( + MQDescriptor* out_queue) override; + ::ndk::ScopedAStatus close() override; + ::ndk::ScopedAStatus configure(const DemuxFilterSettings& in_settings) override; + ::ndk::ScopedAStatus configureAvStreamType(const AvStreamType& in_avStreamType) override; + ::ndk::ScopedAStatus configureIpCid(int32_t in_ipCid) override; + ::ndk::ScopedAStatus configureMonitorEvent(int32_t in_monitorEventTypes) override; + ::ndk::ScopedAStatus start() override; + ::ndk::ScopedAStatus stop() override; + ::ndk::ScopedAStatus flush() override; + ::ndk::ScopedAStatus getAvSharedHandle(NativeHandle* out_avMemory, + int64_t* _aidl_return) override; + ::ndk::ScopedAStatus getId(int32_t* _aidl_return) override; + ::ndk::ScopedAStatus getId64Bit(int64_t* _aidl_return) override; + ::ndk::ScopedAStatus releaseAvHandle(const NativeHandle& in_avMemory, + int64_t in_avDataId) override; + ::ndk::ScopedAStatus setDataSource(const std::shared_ptr& in_filter) override; + + /** + * To create a FilterMQ and its Event Flag. + * + * Return false is any of the above processes fails. + */ + bool createFilterMQ(); + uint16_t getTpid(); + void updateFilterOutput(vector data); + void updateRecordOutput(vector data); + void updatePts(uint64_t pts); + ::ndk::ScopedAStatus startFilterHandler(); + ::ndk::ScopedAStatus startRecordFilterHandler(); + void attachFilterToRecord(const std::shared_ptr dvr); + void detachFilterFromRecord(); + void freeSharedAvHandle(); + bool isMediaFilter() { return mIsMediaFilter; }; + bool isPcrFilter() { return mIsPcrFilter; }; + bool isRecordFilter() { return mIsRecordFilter; }; + + private: + // Tuner service + std::shared_ptr mDemux; + // Dvr reference once the filter is attached to any + std::shared_ptr mDvr = nullptr; + /** + * Filter callbacks used on filter events or FMQ status + */ + std::shared_ptr mCallback = nullptr; + + int64_t mFilterId; + int32_t mCid = static_cast(Constant::INVALID_IP_FILTER_CONTEXT_ID); + uint32_t mBufferSize; + DemuxFilterType mType; + bool mIsMediaFilter = false; + bool mIsPcrFilter = false; + bool mIsRecordFilter = false; + DemuxFilterSettings mFilterSettings; + + uint16_t mTpid; + std::shared_ptr mDataSource; + bool mIsDataSourceDemux = true; + vector mFilterOutput; + vector mRecordFilterOutput; + int64_t mPts = 0; + unique_ptr mFilterMQ; + bool mIsUsingFMQ = false; + EventFlag* mFilterEventsFlag; + vector mFilterEvents; + + // Thread handlers + pthread_t mFilterThread; + + // FMQ status local records + DemuxFilterStatus mFilterStatus; + /** + * If a specific filter's writing loop is still running + */ + bool mFilterThreadRunning; + bool mKeepFetchingDataFromFrontend; + + /** + * How many times a filter should write + * TODO make this dynamic/random/can take as a parameter + */ + const uint16_t SECTION_WRITE_COUNT = 10; + + bool DEBUG_FILTER = false; + + /** + * Filter handlers to handle the data filtering. + * They are also responsible to write the filtered output into the filter FMQ + * and update the filterEvent bound with the same filterId. + */ + ::ndk::ScopedAStatus startSectionFilterHandler(); + ::ndk::ScopedAStatus startPesFilterHandler(); + ::ndk::ScopedAStatus startTsFilterHandler(); + ::ndk::ScopedAStatus startMediaFilterHandler(); + ::ndk::ScopedAStatus startPcrFilterHandler(); + ::ndk::ScopedAStatus startTemiFilterHandler(); + ::ndk::ScopedAStatus startFilterLoop(); + + void deleteEventFlag(); + bool writeDataToFilterMQ(const std::vector& data); + bool readDataFromMQ(); + bool writeSectionsAndCreateEvent(vector& data); + void maySendFilterStatusCallback(); + DemuxFilterStatus checkFilterStatusChange(uint32_t availableToWrite, uint32_t availableToRead, + uint32_t highThreshold, uint32_t lowThreshold); + /** + * A dispatcher to read and dispatch input data to all the started filters. + * Each filter handler handles the data filtering/output writing/filterEvent updating. + */ + bool startFilterDispatcher(); + static void* __threadLoopFilter(void* user); + void filterThreadLoop(); + + int createAvIonFd(int size); + uint8_t* getIonBuffer(int fd, int size); + native_handle_t* createNativeHandle(int fd); + ::ndk::ScopedAStatus createMediaFilterEventWithIon(vector& output); + ::ndk::ScopedAStatus createIndependentMediaEvents(vector& output); + ::ndk::ScopedAStatus createShareMemMediaEvents(vector& output); + bool sameFile(int fd1, int fd2); + + void createMediaEvent(vector&); + void createTsRecordEvent(vector&); + void createMmtpRecordEvent(vector&); + void createSectionEvent(vector&); + void createPesEvent(vector&); + void createDownloadEvent(vector&); + void createIpPayloadEvent(vector&); + void createTemiEvent(vector&); + void createMonitorEvent(vector&); + void createRestartEvent(vector&); + + /** + * Lock to protect writes to the FMQs + */ + std::mutex mWriteLock; + /** + * Lock to protect writes to the filter event + */ + // TODO make each filter separate event lock + std::mutex mFilterEventsLock; + /** + * Lock to protect writes to the input status + */ + std::mutex mFilterStatusLock; + std::mutex mFilterThreadLock; + std::mutex mFilterOutputLock; + std::mutex mRecordFilterOutputLock; + + // temp handle single PES filter + // TODO handle mulptiple Pes filters + int mPesSizeLeft = 0; + vector mPesOutput; + + // A map from data id to ion handle + std::map mDataId2Avfd; + uint64_t mLastUsedDataId = 1; + int mAvBufferCopyCount = 0; + + // Shared A/V memory handle + native_handle_t* mSharedAvMemHandle = nullptr; + bool mUsingSharedAvMem = false; + uint32_t mSharedAvMemOffset = 0; + + uint32_t mAudioStreamType; + uint32_t mVideoStreamType; + + // Scrambling status to be monitored + uint32_t mStatuses = 0; + + bool mConfigured = false; + int mStartId = 0; + uint8_t mScramblingStatusMonitored = 0; + uint8_t mIpCidMonitored = 0; +}; + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp new file mode 100644 index 0000000000..2be13d3c0b --- /dev/null +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -0,0 +1,721 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//#define LOG_NDEBUG 0 +#define LOG_TAG "android.hardware.tv.tuner-service.example-Frontend" + +#include "Frontend.h" +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace tuner { + +Frontend::Frontend(FrontendType type, int32_t id, std::shared_ptr tuner) { + mType = type; + mId = id; + mTunerService = tuner; + // Init callback to nullptr + mCallback = nullptr; +} + +Frontend::~Frontend() {} + +::ndk::ScopedAStatus Frontend::close() { + ALOGV("%s", __FUNCTION__); + // Reset callback + mCallback = nullptr; + mIsLocked = false; + mTunerService->removeFrontend(mId); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Frontend::setCallback(const std::shared_ptr& in_callback) { + ALOGV("%s", __FUNCTION__); + if (in_callback == nullptr) { + ALOGW("[ WARN ] Set Frontend callback with nullptr"); + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + mCallback = in_callback; + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Frontend::tune(const FrontendSettings& /* in_settings */) { + ALOGV("%s", __FUNCTION__); + if (mCallback == nullptr) { + ALOGW("[ WARN ] Frontend callback is not set when tune"); + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + mTunerService->frontendStartTune(mId); + mCallback->onEvent(FrontendEventType::LOCKED); + mIsLocked = true; + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Frontend::stopTune() { + ALOGV("%s", __FUNCTION__); + + mTunerService->frontendStopTune(mId); + mIsLocked = false; + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Frontend::scan(const FrontendSettings& in_settings, FrontendScanType in_type) { + ALOGV("%s", __FUNCTION__); + FrontendScanMessage msg; + + if (mIsLocked) { + msg.set(true); + mCallback->onScanMessage(FrontendScanMessageType::END, msg); + return ::ndk::ScopedAStatus::ok(); + } + + int32_t frequency = 0; + switch (in_settings.getTag()) { + case FrontendSettings::Tag::analog: + frequency = in_settings.get().frequency; + break; + case FrontendSettings::Tag::atsc: + frequency = in_settings.get().frequency; + break; + case FrontendSettings::Tag::atsc3: + frequency = in_settings.get().frequency; + break; + case FrontendSettings::Tag::dvbs: + frequency = in_settings.get().frequency; + break; + case FrontendSettings::Tag::dvbc: + frequency = in_settings.get().frequency; + break; + case FrontendSettings::Tag::dvbt: + frequency = in_settings.get().frequency; + break; + case FrontendSettings::Tag::isdbs: + frequency = in_settings.get().frequency; + break; + case FrontendSettings::Tag::isdbs3: + frequency = in_settings.get().frequency; + break; + case FrontendSettings::Tag::isdbt: + frequency = in_settings.get().frequency; + break; + default: + break; + } + + if (in_type == FrontendScanType::SCAN_BLIND) { + frequency += 100; + } + + { + FrontendScanMessage msg; + vector frequencies = {frequency}; + msg.set(frequencies); + mCallback->onScanMessage(FrontendScanMessageType::FREQUENCY, msg); + } + + { + FrontendScanMessage msg; + msg.set(20); + mCallback->onScanMessage(FrontendScanMessageType::PROGRESS_PERCENT, msg); + } + + { + FrontendScanMessage msg; + vector symbolRates = {30}; + msg.set(symbolRates); + mCallback->onScanMessage(FrontendScanMessageType::SYMBOL_RATE, msg); + } + + if (mType == FrontendType::DVBT) { + FrontendScanMessage msg; + msg.set(FrontendDvbtHierarchy::HIERARCHY_NON_NATIVE); + mCallback->onScanMessage(FrontendScanMessageType::HIERARCHY, msg); + } + + if (mType == FrontendType::ANALOG) { + FrontendScanMessage msg; + msg.set(FrontendAnalogType::PAL); + mCallback->onScanMessage(FrontendScanMessageType::ANALOG_TYPE, msg); + } + + { + FrontendScanMessage msg; + vector plpIds = {2}; + msg.set(plpIds); + mCallback->onScanMessage(FrontendScanMessageType::PLP_IDS, msg); + } + + { + FrontendScanMessage msg; + vector groupIds = {3}; + msg.set(groupIds); + mCallback->onScanMessage(FrontendScanMessageType::GROUP_IDS, msg); + } + + { + FrontendScanMessage msg; + vector inputStreamIds = {1}; + msg.set(inputStreamIds); + mCallback->onScanMessage(FrontendScanMessageType::INPUT_STREAM_IDS, msg); + } + + switch (mType) { + case FrontendType::DVBT: { + FrontendScanMessage msg; + FrontendScanMessageStandard std; + std.set(FrontendDvbtStandard::AUTO); + msg.set(std); + mCallback->onScanMessage(FrontendScanMessageType::STANDARD, msg); + break; + } + case FrontendType::DVBS: { + FrontendScanMessage msg; + FrontendScanMessageStandard std; + std.set(FrontendDvbsStandard::AUTO); + msg.set(std); + mCallback->onScanMessage(FrontendScanMessageType::STANDARD, msg); + break; + } + case FrontendType::ANALOG: { + FrontendScanMessage msg; + FrontendScanMessageStandard std; + std.set(FrontendAnalogSifStandard::AUTO); + msg.set(std); + mCallback->onScanMessage(FrontendScanMessageType::STANDARD, msg); + break; + } + default: + break; + } + + { + FrontendScanMessage msg; + FrontendScanAtsc3PlpInfo info; + info.plpId = 1; + info.bLlsFlag = false; + vector atsc3PlpInfos = {info}; + msg.set(atsc3PlpInfos); + mCallback->onScanMessage(FrontendScanMessageType::ATSC3_PLP_INFO, msg); + } + + { + FrontendScanMessage msg; + FrontendModulation modulation; + modulation.set(FrontendDvbcModulation::MOD_16QAM); + msg.set(modulation); + mCallback->onScanMessage(FrontendScanMessageType::MODULATION, msg); + } + + { + FrontendScanMessage msg; + msg.set(true); + mCallback->onScanMessage(FrontendScanMessageType::HIGH_PRIORITY, msg); + } + + { + FrontendScanMessage msg; + msg.set(true); + mCallback->onScanMessage(FrontendScanMessageType::LOCKED, msg); + mIsLocked = true; + } + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Frontend::stopScan() { + ALOGV("%s", __FUNCTION__); + + mIsLocked = false; + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Frontend::getStatus(const std::vector& in_statusTypes, + std::vector* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + for (int i = 0; i < in_statusTypes.size(); i++) { + FrontendStatusType type = in_statusTypes[i]; + FrontendStatus status; + // assign randomly selected values for testing. + switch (type) { + case FrontendStatusType::DEMOD_LOCK: { + status.set(true); + break; + } + case FrontendStatusType::SNR: { + status.set(221); + break; + } + case FrontendStatusType::BER: { + status.set(1); + break; + } + case FrontendStatusType::PER: { + status.set(2); + break; + } + case FrontendStatusType::PRE_BER: { + status.set(3); + break; + } + case FrontendStatusType::SIGNAL_QUALITY: { + status.set(4); + break; + } + case FrontendStatusType::SIGNAL_STRENGTH: { + status.set(5); + break; + } + case FrontendStatusType::SYMBOL_RATE: { + status.set(6); + break; + } + case FrontendStatusType::FEC: { + status.set(FrontendInnerFec::FEC_2_9); // value = 1 << 7 + break; + } + case FrontendStatusType::MODULATION: { + switch (mType) { + case FrontendType::ISDBS: { + FrontendModulationStatus modulationStatus; + modulationStatus.set( + FrontendIsdbsModulation::MOD_BPSK); // value = 1 << 1 + status.set(modulationStatus); + break; + } + case FrontendType::DVBC: { + FrontendModulationStatus modulationStatus; + modulationStatus.set( + FrontendDvbcModulation::MOD_16QAM); // value = 1 << 1 + status.set(modulationStatus); + break; + } + case FrontendType::DVBS: { + FrontendModulationStatus modulationStatus; + modulationStatus.set( + FrontendDvbsModulation::MOD_QPSK); // value = 1 << 1 + status.set(modulationStatus); + break; + } + case FrontendType::ISDBS3: { + FrontendModulationStatus modulationStatus; + modulationStatus.set( + FrontendIsdbs3Modulation::MOD_BPSK); // value = 1 << 1 + status.set(modulationStatus); + break; + } + case FrontendType::ISDBT: { + FrontendModulationStatus modulationStatus; + modulationStatus.set( + FrontendIsdbtModulation::MOD_DQPSK); // value = 1 << 1 + status.set(modulationStatus); + break; + } + default: + break; + } + break; + } + case FrontendStatusType::SPECTRAL: { + status.set(FrontendSpectralInversion::NORMAL); + break; + } + case FrontendStatusType::LNB_VOLTAGE: { + status.set(LnbVoltage::VOLTAGE_5V); + break; + } + case FrontendStatusType::PLP_ID: { + status.set(101); // type uint8_t + break; + } + case FrontendStatusType::EWBS: { + status.set(false); + break; + } + case FrontendStatusType::AGC: { + status.set(7); + break; + } + case FrontendStatusType::LNA: { + status.set(false); + break; + } + case FrontendStatusType::LAYER_ERROR: { + vector v = {false, true, true}; + status.set(v); + break; + } + case FrontendStatusType::MER: { + status.set(8); + break; + } + case FrontendStatusType::FREQ_OFFSET: { + status.set(9); + break; + } + case FrontendStatusType::HIERARCHY: { + status.set(FrontendDvbtHierarchy::HIERARCHY_1_NATIVE); + break; + } + case FrontendStatusType::RF_LOCK: { + status.set(false); + break; + } + case FrontendStatusType::ATSC3_PLP_INFO: { + FrontendStatusAtsc3PlpInfo info1; + info1.plpId = 3; + info1.isLocked = false; + info1.uec = 313; + FrontendStatusAtsc3PlpInfo info2; + info2.plpId = 5; + info2.isLocked = true; + info2.uec = 515; + vector infos = {info1, info2}; + status.set(infos); + break; + } + case FrontendStatusType::MODULATIONS: { + FrontendModulation modulation; + vector modulations; + switch (mType) { + case FrontendType::ISDBS: { + modulation.set( + FrontendIsdbsModulation::MOD_BPSK); // value = 1 << 1 + modulations.push_back(modulation); + status.set(modulations); + break; + } + case FrontendType::DVBC: { + modulation.set( + FrontendDvbcModulation::MOD_16QAM); // value = 1 << 1 + modulations.push_back(modulation); + status.set(modulations); + break; + } + case FrontendType::DVBS: { + modulation.set( + FrontendDvbsModulation::MOD_QPSK); // value = 1 << 1 + modulations.push_back(modulation); + status.set(modulations); + break; + } + case FrontendType::DVBT: { + modulation.set( + FrontendDvbtConstellation::CONSTELLATION_16QAM_R); // value = 1 << + // 16 + modulations.push_back(modulation); + status.set(modulations); + break; + } + case FrontendType::ISDBS3: { + modulation.set( + FrontendIsdbs3Modulation::MOD_BPSK); // value = 1 << 1 + modulations.push_back(modulation); + status.set(modulations); + break; + } + case FrontendType::ISDBT: { + modulation.set( + FrontendIsdbtModulation::MOD_DQPSK); // value = 1 << 1 + modulations.push_back(modulation); + status.set(modulations); + break; + } + case FrontendType::ATSC: { + modulation.set( + FrontendAtscModulation::MOD_8VSB); // value = 1 << 2 + modulations.push_back(modulation); + status.set(modulations); + break; + } + case FrontendType::ATSC3: { + modulation.set( + FrontendAtsc3Modulation::MOD_QPSK); // value = 1 << 1 + modulations.push_back(modulation); + status.set(modulations); + break; + } + case FrontendType::DTMB: { + modulation.set( + FrontendDtmbModulation::CONSTELLATION_4QAM); // value = 1 << 1 + modulations.push_back(modulation); + status.set(modulations); + break; + } + default: + break; + } + break; + } + case FrontendStatusType::BERS: { + vector bers = {1}; + status.set(bers); + break; + } + case FrontendStatusType::CODERATES: { + vector rates; + rates.push_back(FrontendInnerFec::FEC_6_15); // value = 1 << 39 + status.set(rates); + break; + } + case FrontendStatusType::BANDWIDTH: { + FrontendBandwidth bandwidth; + switch (mType) { + case FrontendType::DVBC: { + bandwidth.set( + FrontendDvbcBandwidth::BANDWIDTH_6MHZ); // value = 1 << 1 + status.set(bandwidth); + break; + } + case FrontendType::DVBT: { + bandwidth.set( + FrontendDvbtBandwidth::BANDWIDTH_8MHZ); // value = 1 << 1 + status.set(bandwidth); + break; + } + case FrontendType::ISDBT: { + bandwidth.set( + FrontendIsdbtBandwidth::BANDWIDTH_8MHZ); // value = 1 << 1 + status.set(bandwidth); + break; + } + case FrontendType::ATSC3: { + bandwidth.set( + FrontendAtsc3Bandwidth::BANDWIDTH_6MHZ); // value = 1 << 1 + status.set(bandwidth); + break; + } + case FrontendType::DTMB: { + bandwidth.set( + FrontendDtmbBandwidth::BANDWIDTH_8MHZ); // value = 1 << 1 + status.set(bandwidth); + break; + } + default: + break; + } + break; + } + case FrontendStatusType::GUARD_INTERVAL: { + FrontendGuardInterval interval; + switch (mType) { + case FrontendType::DVBT: { + interval.set( + FrontendDvbtGuardInterval::INTERVAL_1_32); // value = 1 << 1 + status.set(interval); + break; + } + case FrontendType::ISDBT: { + interval.set( + FrontendDvbtGuardInterval::INTERVAL_1_32); // value = 1 << 1 + status.set(interval); + break; + } + case FrontendType::DTMB: { + interval.set( + FrontendDtmbGuardInterval::PN_420_VARIOUS); // value = 1 << 1 + status.set(interval); + break; + } + default: + break; + } + break; + } + case FrontendStatusType::TRANSMISSION_MODE: { + FrontendTransmissionMode transMode; + switch (mType) { + case FrontendType::DVBT: { + transMode.set( + FrontendDvbtTransmissionMode::MODE_16K_E); // value = 1 << 8 + status.set(transMode); + break; + } + case FrontendType::ISDBT: { + transMode.set( + FrontendIsdbtMode::MODE_1); // value = 1 << 1 + status.set(transMode); + break; + } + case FrontendType::DTMB: { + transMode.set( + FrontendDtmbTransmissionMode::C1); // value = 1 << 1 + status.set(transMode); + break; + } + default: + break; + } + break; + } + case FrontendStatusType::UEC: { + status.set(4); + break; + } + case FrontendStatusType::T2_SYSTEM_ID: { + status.set(5); + break; + } + case FrontendStatusType::INTERLEAVINGS: { + FrontendInterleaveMode interleave; + vector interleaves; + switch (mType) { + case FrontendType::DVBC: { + // value = 1 << 1 + interleave.set( + FrontendCableTimeInterleaveMode::INTERLEAVING_128_1_0); + interleaves.push_back(interleave); + status.set(interleaves); + break; + } + case FrontendType::ATSC3: { + interleave.set( + FrontendAtsc3TimeInterleaveMode::CTI); // value = 1 << 1 + interleaves.push_back(interleave); + status.set(interleaves); + break; + } + case FrontendType::DTMB: { + interleave.set( + FrontendDtmbTimeInterleaveMode::TIMER_INT_240); // value = 1 << 1 + interleaves.push_back(interleave); + status.set(interleaves); + break; + } + default: + break; + } + break; + } + case FrontendStatusType::ISDBT_SEGMENTS: { + vector segments = {2, 3}; + status.set(segments); + break; + } + case FrontendStatusType::TS_DATA_RATES: { + vector dataRates = {4, 5}; + status.set(dataRates); + break; + } + case FrontendStatusType::ROLL_OFF: { + FrontendRollOff rollOff; + switch (mType) { + case FrontendType::DVBS: { + rollOff.set( + FrontendDvbsRolloff::ROLLOFF_0_35); // value = 1 + status.set(rollOff); + break; + } + case FrontendType::ISDBS: { + rollOff.set( + FrontendIsdbsRolloff::ROLLOFF_0_35); // value = 1 + status.set(rollOff); + break; + } + case FrontendType::ISDBS3: { + rollOff.set( + FrontendIsdbs3Rolloff::ROLLOFF_0_03); // value = 1 + status.set(rollOff); + break; + } + default: + break; + } + break; + } + case FrontendStatusType::IS_MISO: { + status.set(true); + break; + } + case FrontendStatusType::IS_LINEAR: { + status.set(true); + break; + } + case FrontendStatusType::IS_SHORT_FRAMES: { + status.set(true); + break; + } + default: { + continue; + } + } + _aidl_return->push_back(status); + } + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Frontend::setLna(bool /* in_bEnable */) { + ALOGV("%s", __FUNCTION__); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Frontend::setLnb(int32_t /* in_lnbId */) { + ALOGV("%s", __FUNCTION__); + if (!supportsSatellite()) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Frontend::linkCiCam(int32_t in_ciCamId, int32_t* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + mCiCamId = in_ciCamId; + *_aidl_return = 0; + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Frontend::unlinkCiCam(int32_t /* in_ciCamId */) { + ALOGV("%s", __FUNCTION__); + + mCiCamId = -1; + + return ::ndk::ScopedAStatus::ok(); +} + +FrontendType Frontend::getFrontendType() { + return mType; +} + +int32_t Frontend::getFrontendId() { + return mId; +} + +bool Frontend::supportsSatellite() { + return mType == FrontendType::DVBS || mType == FrontendType::ISDBS || + mType == FrontendType::ISDBS3; +} + +bool Frontend::isLocked() { + return mIsLocked; +} + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h new file mode 100644 index 0000000000..f89e74d9e6 --- /dev/null +++ b/tv/tuner/aidl/default/Frontend.h @@ -0,0 +1,75 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include "Tuner.h" + +using namespace std; + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace tuner { + +class Tuner; + +class Frontend : public BnFrontend { + public: + Frontend(FrontendType type, int32_t id, std::shared_ptr tuner); + + ::ndk::ScopedAStatus setCallback( + const std::shared_ptr& in_callback) override; + ::ndk::ScopedAStatus tune(const FrontendSettings& in_settings) override; + ::ndk::ScopedAStatus stopTune() override; + ::ndk::ScopedAStatus close() override; + ::ndk::ScopedAStatus scan(const FrontendSettings& in_settings, + FrontendScanType in_type) override; + ::ndk::ScopedAStatus stopScan() override; + ::ndk::ScopedAStatus getStatus(const std::vector& in_statusTypes, + std::vector* _aidl_return) override; + ::ndk::ScopedAStatus setLnb(int32_t in_lnbId) override; + ::ndk::ScopedAStatus setLna(bool in_bEnable) override; + ::ndk::ScopedAStatus linkCiCam(int32_t in_ciCamId, int32_t* _aidl_return) override; + ::ndk::ScopedAStatus unlinkCiCam(int32_t in_ciCamId) override; + + FrontendType getFrontendType(); + int32_t getFrontendId(); + string getSourceFile(); + bool isLocked(); + + private: + virtual ~Frontend(); + bool supportsSatellite(); + std::shared_ptr mCallback; + std::shared_ptr mTunerService; + FrontendType mType = FrontendType::UNDEFINED; + int32_t mId = 0; + bool mIsLocked = false; + int32_t mCiCamId; + + std::ifstream mFrontendData; +}; + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/Lnb.cpp b/tv/tuner/aidl/default/Lnb.cpp new file mode 100644 index 0000000000..35d2da6310 --- /dev/null +++ b/tv/tuner/aidl/default/Lnb.cpp @@ -0,0 +1,81 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//#define LOG_NDEBUG 0 +#define LOG_TAG "android.hardware.tv.tuner-service.example-Lnb" + +#include "Lnb.h" +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace tuner { + +Lnb::Lnb() {} + +Lnb::Lnb(int id) { + mId = id; +} + +Lnb::~Lnb() {} + +::ndk::ScopedAStatus Lnb::setCallback(const std::shared_ptr& /* in_callback */) { + ALOGV("%s", __FUNCTION__); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Lnb::setVoltage(LnbVoltage /* in_voltage */) { + ALOGV("%s", __FUNCTION__); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Lnb::setTone(LnbTone /* in_tone */) { + ALOGV("%s", __FUNCTION__); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Lnb::setSatellitePosition(LnbPosition /* in_position */) { + ALOGV("%s", __FUNCTION__); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Lnb::sendDiseqcMessage(const std::vector& /* in_diseqcMessage */) { + ALOGV("%s", __FUNCTION__); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Lnb::close() { + ALOGV("%s", __FUNCTION__); + + return ::ndk::ScopedAStatus::ok(); +} + +int Lnb::getId() { + return mId; +} + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/Lnb.h b/tv/tuner/aidl/default/Lnb.h new file mode 100644 index 0000000000..bfe3097ddc --- /dev/null +++ b/tv/tuner/aidl/default/Lnb.h @@ -0,0 +1,53 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +using namespace std; + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace tuner { + +class Lnb : public BnLnb { + public: + Lnb(); + Lnb(int id); + + ::ndk::ScopedAStatus setCallback(const std::shared_ptr& in_callback) override; + ::ndk::ScopedAStatus setVoltage(LnbVoltage in_voltage) override; + ::ndk::ScopedAStatus setTone(LnbTone in_tone) override; + ::ndk::ScopedAStatus setSatellitePosition(LnbPosition in_position) override; + ::ndk::ScopedAStatus sendDiseqcMessage(const std::vector& in_diseqcMessage) override; + ::ndk::ScopedAStatus close() override; + + int getId(); + + private: + int mId; + virtual ~Lnb(); +}; + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/OWNERS b/tv/tuner/aidl/default/OWNERS new file mode 100644 index 0000000000..bf2b609f3e --- /dev/null +++ b/tv/tuner/aidl/default/OWNERS @@ -0,0 +1,3 @@ +hgchen@google.com +shubang@google.com +quxiangfang@google.com diff --git a/tv/tuner/aidl/default/TimeFilter.cpp b/tv/tuner/aidl/default/TimeFilter.cpp new file mode 100644 index 0000000000..4fd8d21c36 --- /dev/null +++ b/tv/tuner/aidl/default/TimeFilter.cpp @@ -0,0 +1,86 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//#define LOG_NDEBUG 0 +#define LOG_TAG "android.hardware.tv.tuner-service.example-TimeFilter" + +#include "TimeFilter.h" +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace tuner { + +TimeFilter::TimeFilter() {} + +TimeFilter::TimeFilter(std::shared_ptr demux) { + mDemux = demux; +} + +TimeFilter::~TimeFilter() {} + +::ndk::ScopedAStatus TimeFilter::setTimeStamp(int64_t in_timeStamp) { + ALOGV("%s", __FUNCTION__); + if (in_timeStamp == INVALID_TIME_STAMP) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + mTimeStamp = in_timeStamp; + mBeginTime = time(NULL); + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus TimeFilter::clearTimeStamp() { + ALOGV("%s", __FUNCTION__); + mTimeStamp = INVALID_TIME_STAMP; + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus TimeFilter::getTimeStamp(int64_t* _aidl_return) { + ALOGV("%s", __FUNCTION__); + if (mTimeStamp == INVALID_TIME_STAMP) { + *_aidl_return = mTimeStamp; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + uint64_t currentTimeStamp = mTimeStamp + difftime(time(NULL), mBeginTime) * 900000; + *_aidl_return = currentTimeStamp; + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus TimeFilter::getSourceTime(int64_t* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + *_aidl_return = 0; + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus TimeFilter::close() { + ALOGV("%s", __FUNCTION__); + mTimeStamp = INVALID_TIME_STAMP; + + return ::ndk::ScopedAStatus::ok(); +} + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/TimeFilter.h b/tv/tuner/aidl/default/TimeFilter.h new file mode 100644 index 0000000000..ff35c47d70 --- /dev/null +++ b/tv/tuner/aidl/default/TimeFilter.h @@ -0,0 +1,57 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include "Demux.h" +#include "time.h" + +using namespace std; + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace tuner { + +#define INVALID_TIME_STAMP -1 + +class Demux; + +class TimeFilter : public BnTimeFilter { + public: + TimeFilter(); + TimeFilter(std::shared_ptr demux); + ~TimeFilter(); + + ::ndk::ScopedAStatus setTimeStamp(int64_t in_timeStamp) override; + ::ndk::ScopedAStatus clearTimeStamp() override; + ::ndk::ScopedAStatus getTimeStamp(int64_t* _aidl_return) override; + ::ndk::ScopedAStatus getSourceTime(int64_t* _aidl_return) override; + ::ndk::ScopedAStatus close() override; + + private: + std::shared_ptr mDemux; + uint64_t mTimeStamp = INVALID_TIME_STAMP; + time_t mBeginTime; +}; + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp new file mode 100644 index 0000000000..dc0bd5e346 --- /dev/null +++ b/tv/tuner/aidl/default/Tuner.cpp @@ -0,0 +1,347 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//#define LOG_NDEBUG 0 +#define LOG_TAG "android.hardware.tv.tuner-service.example-Tuner" + +#include "Tuner.h" +#include +#include "Demux.h" +#include "Descrambler.h" +#include "Frontend.h" +#include "Lnb.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace tuner { + +Tuner::Tuner() { + // Static Frontends array to maintain local frontends information + // Array index matches their FrontendId in the default impl + mFrontendSize = 10; + mFrontends[0] = ndk::SharedRefBase::make(FrontendType::ISDBS, 0, ref()); + mFrontends[1] = ndk::SharedRefBase::make(FrontendType::ATSC3, 1, ref()); + mFrontends[2] = ndk::SharedRefBase::make(FrontendType::DVBC, 2, ref()); + mFrontends[3] = ndk::SharedRefBase::make(FrontendType::DVBS, 3, ref()); + mFrontends[4] = ndk::SharedRefBase::make(FrontendType::DVBT, 4, ref()); + mFrontends[5] = ndk::SharedRefBase::make(FrontendType::ISDBT, 5, ref()); + mFrontends[6] = ndk::SharedRefBase::make(FrontendType::ANALOG, 6, ref()); + mFrontends[7] = ndk::SharedRefBase::make(FrontendType::ATSC, 7, ref()); + mFrontends[8] = ndk::SharedRefBase::make(FrontendType::ISDBS3, 8, ref()); + mFrontends[9] = ndk::SharedRefBase::make(FrontendType::DTMB, 9, ref()); + + vector statusCaps; + + FrontendCapabilities capsIsdbs; + capsIsdbs.set(FrontendIsdbsCapabilities()); + mFrontendCaps[0] = capsIsdbs; + statusCaps = { + FrontendStatusType::DEMOD_LOCK, FrontendStatusType::SNR, + FrontendStatusType::FEC, FrontendStatusType::MODULATION, + FrontendStatusType::MODULATIONS, FrontendStatusType::ROLL_OFF, + }; + mFrontendStatusCaps[0] = statusCaps; + + FrontendCapabilities capsAtsc3; + capsAtsc3.set(FrontendAtsc3Capabilities()); + mFrontendCaps[1] = capsAtsc3; + statusCaps = { + FrontendStatusType::BER, + FrontendStatusType::PER, + FrontendStatusType::ATSC3_PLP_INFO, + FrontendStatusType::MODULATIONS, + FrontendStatusType::BERS, + FrontendStatusType::INTERLEAVINGS, + FrontendStatusType::BANDWIDTH, + }; + mFrontendStatusCaps[1] = statusCaps; + + FrontendCapabilities capsDvbc; + capsDvbc.set(FrontendDvbcCapabilities()); + mFrontendCaps[2] = capsDvbc; + statusCaps = { + FrontendStatusType::PRE_BER, FrontendStatusType::SIGNAL_QUALITY, + FrontendStatusType::MODULATION, FrontendStatusType::SPECTRAL, + FrontendStatusType::MODULATIONS, FrontendStatusType::CODERATES, + FrontendStatusType::INTERLEAVINGS, FrontendStatusType::BANDWIDTH, + }; + mFrontendStatusCaps[2] = statusCaps; + + FrontendCapabilities capsDvbs; + capsDvbs.set(FrontendDvbsCapabilities()); + mFrontendCaps[3] = capsDvbs; + statusCaps = { + FrontendStatusType::SIGNAL_STRENGTH, FrontendStatusType::SYMBOL_RATE, + FrontendStatusType::MODULATION, FrontendStatusType::MODULATIONS, + FrontendStatusType::ROLL_OFF, FrontendStatusType::IS_MISO, + }; + mFrontendStatusCaps[3] = statusCaps; + + FrontendCapabilities capsDvbt; + capsDvbt.set(FrontendDvbtCapabilities()); + mFrontendCaps[4] = capsDvbt; + statusCaps = { + FrontendStatusType::EWBS, + FrontendStatusType::PLP_ID, + FrontendStatusType::HIERARCHY, + FrontendStatusType::MODULATIONS, + FrontendStatusType::BANDWIDTH, + FrontendStatusType::GUARD_INTERVAL, + FrontendStatusType::TRANSMISSION_MODE, + FrontendStatusType::T2_SYSTEM_ID, + }; + mFrontendStatusCaps[4] = statusCaps; + + FrontendCapabilities capsIsdbt; + FrontendIsdbtCapabilities isdbtCaps{ + .modeCap = (int)FrontendIsdbtMode::MODE_1 | (int)FrontendIsdbtMode::MODE_2, + .bandwidthCap = (int)FrontendIsdbtBandwidth::BANDWIDTH_6MHZ, + .modulationCap = (int)FrontendIsdbtModulation::MOD_16QAM, + // ISDBT shares coderate and guard interval with DVBT + .coderateCap = (int)FrontendDvbtCoderate::CODERATE_4_5 | + (int)FrontendDvbtCoderate::CODERATE_6_7, + .guardIntervalCap = (int)FrontendDvbtGuardInterval::INTERVAL_1_128, + }; + capsIsdbt.set(isdbtCaps); + mFrontendCaps[5] = capsIsdbt; + statusCaps = { + FrontendStatusType::AGC, + FrontendStatusType::LNA, + FrontendStatusType::MODULATION, + FrontendStatusType::MODULATIONS, + FrontendStatusType::BANDWIDTH, + FrontendStatusType::GUARD_INTERVAL, + FrontendStatusType::TRANSMISSION_MODE, + FrontendStatusType::ISDBT_SEGMENTS, + }; + mFrontendStatusCaps[5] = statusCaps; + + FrontendCapabilities capsAnalog; + capsAnalog.set(FrontendAnalogCapabilities()); + mFrontendCaps[6] = capsAnalog; + statusCaps = { + FrontendStatusType::LAYER_ERROR, + FrontendStatusType::MER, + FrontendStatusType::UEC, + FrontendStatusType::TS_DATA_RATES, + }; + mFrontendStatusCaps[6] = statusCaps; + + FrontendCapabilities capsAtsc; + capsAtsc.set(FrontendAtscCapabilities()); + mFrontendCaps[7] = capsAtsc; + statusCaps = { + FrontendStatusType::FREQ_OFFSET, + FrontendStatusType::RF_LOCK, + FrontendStatusType::MODULATIONS, + FrontendStatusType::IS_LINEAR, + }; + mFrontendStatusCaps[7] = statusCaps; + + FrontendCapabilities capsIsdbs3; + capsIsdbs3.set(FrontendIsdbs3Capabilities()); + mFrontendCaps[8] = capsIsdbs3; + statusCaps = { + FrontendStatusType::DEMOD_LOCK, FrontendStatusType::MODULATION, + FrontendStatusType::MODULATIONS, FrontendStatusType::ROLL_OFF, + FrontendStatusType::IS_SHORT_FRAMES, + }; + mFrontendStatusCaps[8] = statusCaps; + + FrontendCapabilities capsDtmb; + capsDtmb.set(FrontendDtmbCapabilities()); + mFrontendCaps[9] = capsDtmb; + statusCaps = { + FrontendStatusType::MODULATIONS, FrontendStatusType::INTERLEAVINGS, + FrontendStatusType::BANDWIDTH, FrontendStatusType::GUARD_INTERVAL, + FrontendStatusType::TRANSMISSION_MODE, + }; + mFrontendStatusCaps[9] = statusCaps; + + mLnbs.resize(2); + mLnbs[0] = ndk::SharedRefBase::make(0); + mLnbs[1] = ndk::SharedRefBase::make(1); +} + +Tuner::~Tuner() {} + +::ndk::ScopedAStatus Tuner::getFrontendIds(std::vector* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + _aidl_return->resize(mFrontendSize); + for (int i = 0; i < mFrontendSize; i++) { + (*_aidl_return)[i] = mFrontends[i]->getFrontendId(); + } + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Tuner::openFrontendById(int32_t in_frontendId, + std::shared_ptr* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + if (in_frontendId >= mFrontendSize || in_frontendId < 0) { + ALOGW("[ WARN ] Frontend with id %d isn't available", in_frontendId); + *_aidl_return = nullptr; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + *_aidl_return = mFrontends[in_frontendId]; + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Tuner::openDemux(std::vector* out_demuxId, + std::shared_ptr* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + mLastUsedId += 1; + mDemuxes[mLastUsedId] = ndk::SharedRefBase::make(mLastUsedId, ref()); + + out_demuxId->push_back(mLastUsedId); + *_aidl_return = mDemuxes[mLastUsedId]; + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Tuner::getDemuxCaps(DemuxCapabilities* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + // IP filter can be an MMTP filter's data source. + _aidl_return->linkCaps = {0x00, 0x00, 0x02, 0x00, 0x00}; + // Support time filter testing + _aidl_return->bTimeFilter = true; + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Tuner::openDescrambler(std::shared_ptr* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + *_aidl_return = ndk::SharedRefBase::make(); + + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Tuner::getFrontendInfo(int32_t in_frontendId, FrontendInfo* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + if (in_frontendId >= mFrontendSize) { + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + // assign randomly selected values for testing. + *_aidl_return = { + .type = mFrontends[in_frontendId]->getFrontendType(), + .minFrequency = 139, + .maxFrequency = 1139, + .minSymbolRate = 45, + .maxSymbolRate = 1145, + .acquireRange = 30, + .exclusiveGroupId = 57, + .statusCaps = mFrontendStatusCaps[in_frontendId], + .frontendCaps = mFrontendCaps[in_frontendId], + }; + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Tuner::getLnbIds(std::vector* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + _aidl_return->resize(mLnbs.size()); + for (int i = 0; i < mLnbs.size(); i++) { + (*_aidl_return)[i] = mLnbs[i]->getId(); + } + + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Tuner::openLnbById(int32_t in_lnbId, std::shared_ptr* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + if (in_lnbId >= mLnbs.size()) { + *_aidl_return = nullptr; + return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + } + + *_aidl_return = mLnbs[in_lnbId]; + return ::ndk::ScopedAStatus::ok(); +} + +std::shared_ptr Tuner::getFrontendById(int32_t frontendId) { + ALOGV("%s", __FUNCTION__); + + return mFrontends[frontendId]; +} + +::ndk::ScopedAStatus Tuner::openLnbByName(const std::string& /* in_lnbName */, + std::vector* out_lnbId, + std::shared_ptr* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + out_lnbId->push_back(1234); + *_aidl_return = ndk::SharedRefBase::make(); + + return ::ndk::ScopedAStatus::ok(); +} + +void Tuner::setFrontendAsDemuxSource(int32_t frontendId, int32_t demuxId) { + mFrontendToDemux[frontendId] = demuxId; + if (mFrontends[frontendId] != nullptr && mFrontends[frontendId]->isLocked()) { + mDemuxes[demuxId]->startFrontendInputLoop(); + } +} + +void Tuner::removeDemux(int32_t demuxId) { + map::iterator it; + for (it = mFrontendToDemux.begin(); it != mFrontendToDemux.end(); it++) { + if (it->second == demuxId) { + it = mFrontendToDemux.erase(it); + break; + } + } + mDemuxes.erase(demuxId); +} + +void Tuner::removeFrontend(int32_t frontendId) { + mFrontendToDemux.erase(frontendId); +} + +void Tuner::frontendStopTune(int32_t frontendId) { + map::iterator it = mFrontendToDemux.find(frontendId); + int32_t demuxId; + if (it != mFrontendToDemux.end()) { + demuxId = it->second; + mDemuxes[demuxId]->stopFrontendInput(); + } +} + +void Tuner::frontendStartTune(int32_t frontendId) { + map::iterator it = mFrontendToDemux.find(frontendId); + int32_t demuxId; + if (it != mFrontendToDemux.end()) { + demuxId = it->second; + mDemuxes[demuxId]->startFrontendInputLoop(); + } +} + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/Tuner.h b/tv/tuner/aidl/default/Tuner.h new file mode 100644 index 0000000000..e69990d119 --- /dev/null +++ b/tv/tuner/aidl/default/Tuner.h @@ -0,0 +1,86 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include +#include "Demux.h" +#include "Frontend.h" +#include "Lnb.h" + +using namespace std; + +namespace aidl { +namespace android { +namespace hardware { +namespace tv { +namespace tuner { + +class Frontend; +class Demux; +class Lnb; + +class Tuner : public BnTuner { + public: + Tuner(); + virtual ~Tuner(); + + ::ndk::ScopedAStatus getFrontendIds(std::vector* _aidl_return) override; + ::ndk::ScopedAStatus openFrontendById(int32_t in_frontendId, + std::shared_ptr* _aidl_return) override; + ::ndk::ScopedAStatus openDemux(std::vector* out_demuxId, + std::shared_ptr* _aidl_return) override; + ::ndk::ScopedAStatus getDemuxCaps(DemuxCapabilities* _aidl_return) override; + ::ndk::ScopedAStatus openDescrambler(std::shared_ptr* _aidl_return) override; + ::ndk::ScopedAStatus getFrontendInfo(int32_t in_frontendId, + FrontendInfo* _aidl_return) override; + ::ndk::ScopedAStatus getLnbIds(std::vector* _aidl_return) override; + ::ndk::ScopedAStatus openLnbById(int32_t in_lnbId, + std::shared_ptr* _aidl_return) override; + ::ndk::ScopedAStatus openLnbByName(const std::string& in_lnbName, + std::vector* out_lnbId, + std::shared_ptr* _aidl_return) override; + + std::shared_ptr getFrontendById(int32_t frontendId); + void setFrontendAsDemuxSource(int32_t frontendId, int32_t demuxId); + void frontendStartTune(int32_t frontendId); + void frontendStopTune(int32_t frontendId); + void removeDemux(int32_t demuxId); + void removeFrontend(int32_t frontendId); + + private: + // Static mFrontends array to maintain local frontends information + map> mFrontends; + map mFrontendCaps; + map> mFrontendStatusCaps; + map mFrontendToDemux; + map> mDemuxes; + // To maintain how many Frontends we have + int mFrontendSize; + // The last used demux id. Initial value is -1. + // First used id will be 0. + int32_t mLastUsedId = -1; + vector> mLnbs; +}; + +} // namespace tuner +} // namespace tv +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/tv/tuner/aidl/default/service.cpp b/tv/tuner/aidl/default/service.cpp new file mode 100644 index 0000000000..649b76375d --- /dev/null +++ b/tv/tuner/aidl/default/service.cpp @@ -0,0 +1,38 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//#define LOG_NDEBUG 0 +#define LOG_TAG "android.hardware.tv.tuner-service.example" + +#include +#include +#include + +#include "Tuner.h" + +using ::aidl::android::hardware::tv::tuner::Tuner; + +int main() { + ABinderProcess_setThreadPoolMaxThreadCount(8); + std::shared_ptr tuner = ndk::SharedRefBase::make(); + + const std::string instance = std::string() + Tuner::descriptor + "/default"; + binder_status_t status = AServiceManager_addService(tuner->asBinder().get(), instance.c_str()); + CHECK(status == STATUS_OK); + + ABinderProcess_joinThreadPool(); + return EXIT_FAILURE; // should not reached +} diff --git a/tv/tuner/aidl/default/tuner-default.rc b/tv/tuner/aidl/default/tuner-default.rc new file mode 100644 index 0000000000..fa09456f29 --- /dev/null +++ b/tv/tuner/aidl/default/tuner-default.rc @@ -0,0 +1,6 @@ +service vendor.tuner-default /vendor/bin/hw/android.hardware.tv.tuner-service.example + class hal + user media + group mediadrm drmrpc + ioprio rt 4 + writepid /dev/cpuset/foreground/tasks diff --git a/tv/tuner/aidl/default/tuner-default.xml b/tv/tuner/aidl/default/tuner-default.xml new file mode 100644 index 0000000000..f0d03adcea --- /dev/null +++ b/tv/tuner/aidl/default/tuner-default.xml @@ -0,0 +1,6 @@ + + + android.hardware.tv.tuner + ITuner/default + + -- GitLab From 600a6ae73823476add81107d568f2bde1e7af6e5 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Thu, 8 Jul 2021 18:51:51 -0700 Subject: [PATCH 087/825] Add Tuner AIDL HAL VTS test cases Bug: 191825295 Test: make and run VtsHalTvTunerTargetTest Change-Id: Id7360e1b2da148db5c13ed2bdf3c866cc53db17b --- tv/tuner/aidl/TEST_MAPPING | 7 + tv/tuner/aidl/vts/OWNERS | 3 + tv/tuner/aidl/vts/functional/Android.bp | 77 ++ tv/tuner/aidl/vts/functional/AndroidTest.xml | 34 + tv/tuner/aidl/vts/functional/DemuxTests.cpp | 64 ++ tv/tuner/aidl/vts/functional/DemuxTests.h | 49 + .../aidl/vts/functional/DescramblerTests.cpp | 205 ++++ .../aidl/vts/functional/DescramblerTests.h | 106 ++ tv/tuner/aidl/vts/functional/DvrTests.cpp | 337 ++++++ tv/tuner/aidl/vts/functional/DvrTests.h | 181 +++ tv/tuner/aidl/vts/functional/FilterTests.cpp | 362 ++++++ tv/tuner/aidl/vts/functional/FilterTests.h | 156 +++ .../aidl/vts/functional/FrontendTests.cpp | 486 ++++++++ tv/tuner/aidl/vts/functional/FrontendTests.h | 138 +++ tv/tuner/aidl/vts/functional/LnbTests.cpp | 112 ++ tv/tuner/aidl/vts/functional/LnbTests.h | 71 ++ .../functional/VtsHalTvTunerTargetTest.cpp | 878 +++++++++++++++ .../vts/functional/VtsHalTvTunerTargetTest.h | 372 ++++++ .../VtsHalTvTunerTestConfigurations.h | 220 ++++ tv/tuner/config/OWNERS | 3 +- .../config/TunerTestingConfigAidlReaderV1_0.h | 1000 +++++++++++++++++ 21 files changed, 4859 insertions(+), 2 deletions(-) create mode 100644 tv/tuner/aidl/TEST_MAPPING create mode 100644 tv/tuner/aidl/vts/OWNERS create mode 100644 tv/tuner/aidl/vts/functional/Android.bp create mode 100644 tv/tuner/aidl/vts/functional/AndroidTest.xml create mode 100644 tv/tuner/aidl/vts/functional/DemuxTests.cpp create mode 100644 tv/tuner/aidl/vts/functional/DemuxTests.h create mode 100644 tv/tuner/aidl/vts/functional/DescramblerTests.cpp create mode 100644 tv/tuner/aidl/vts/functional/DescramblerTests.h create mode 100644 tv/tuner/aidl/vts/functional/DvrTests.cpp create mode 100644 tv/tuner/aidl/vts/functional/DvrTests.h create mode 100644 tv/tuner/aidl/vts/functional/FilterTests.cpp create mode 100644 tv/tuner/aidl/vts/functional/FilterTests.h create mode 100644 tv/tuner/aidl/vts/functional/FrontendTests.cpp create mode 100644 tv/tuner/aidl/vts/functional/FrontendTests.h create mode 100644 tv/tuner/aidl/vts/functional/LnbTests.cpp create mode 100644 tv/tuner/aidl/vts/functional/LnbTests.h create mode 100644 tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp create mode 100644 tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h create mode 100644 tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h create mode 100644 tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h diff --git a/tv/tuner/aidl/TEST_MAPPING b/tv/tuner/aidl/TEST_MAPPING new file mode 100644 index 0000000000..222c6edd11 --- /dev/null +++ b/tv/tuner/aidl/TEST_MAPPING @@ -0,0 +1,7 @@ +{ + "presubmit": [ + { + "name": "VtsHalTvTunerTargetTest" + } + ] +} diff --git a/tv/tuner/aidl/vts/OWNERS b/tv/tuner/aidl/vts/OWNERS new file mode 100644 index 0000000000..bf2b609f3e --- /dev/null +++ b/tv/tuner/aidl/vts/OWNERS @@ -0,0 +1,3 @@ +hgchen@google.com +shubang@google.com +quxiangfang@google.com diff --git a/tv/tuner/aidl/vts/functional/Android.bp b/tv/tuner/aidl/vts/functional/Android.bp new file mode 100644 index 0000000000..119230ee3e --- /dev/null +++ b/tv/tuner/aidl/vts/functional/Android.bp @@ -0,0 +1,77 @@ +// +// Copyright 2021 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +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: "VtsHalTvTunerTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: [ + "DemuxTests.cpp", + "DescramblerTests.cpp", + "DvrTests.cpp", + "FilterTests.cpp", + "FrontendTests.cpp", + "LnbTests.cpp", + "VtsHalTvTunerTargetTest.cpp", + ], + generated_headers: [ + "tuner_testing_dynamic_configuration_V1_0_enums", + "tuner_testing_dynamic_configuration_V1_0_parser", + ], + generated_sources: [ + "tuner_testing_dynamic_configuration_V1_0_enums", + "tuner_testing_dynamic_configuration_V1_0_parser", + ], + header_libs: ["libxsdc-utils"], + static_libs: [ + "android.hardware.cas@1.0", + "android.hardware.cas@1.1", + "android.hardware.cas@1.2", + "android.hardware.common-V2-ndk_platform", + "android.hardware.common.fmq-V1-ndk_platform", + "android.hardware.tv.tuner-V1-ndk_platform", + "libaidlcommonsupport", + "libfmq", + "libcutils", + ], + shared_libs: [ + "libbinder_ndk", + "libvndksupport", + "libxml2", + ], + data: [ + ":tuner_frontend_input_ts", + ":tuner_frontend_input_es", + ":tuner_testing_dynamic_configuration_V1_0", + ], + test_suites: [ + "general-tests", + "vts", + ], + + require_root: true, +} diff --git a/tv/tuner/aidl/vts/functional/AndroidTest.xml b/tv/tuner/aidl/vts/functional/AndroidTest.xml new file mode 100644 index 0000000000..f93ed78f01 --- /dev/null +++ b/tv/tuner/aidl/vts/functional/AndroidTest.xml @@ -0,0 +1,34 @@ + + + + diff --git a/tv/tuner/aidl/vts/functional/DemuxTests.cpp b/tv/tuner/aidl/vts/functional/DemuxTests.cpp new file mode 100644 index 0000000000..9de01e1eab --- /dev/null +++ b/tv/tuner/aidl/vts/functional/DemuxTests.cpp @@ -0,0 +1,64 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "DemuxTests.h" + +AssertionResult DemuxTests::openDemux(std::shared_ptr& demux, int32_t& demuxId) { + std::vector id; + auto status = mService->openDemux(&id, &mDemux); + if (status.isOk()) { + demux = mDemux; + demuxId = id[0]; + } + return AssertionResult(status.isOk()); +} + +AssertionResult DemuxTests::setDemuxFrontendDataSource(int32_t frontendId) { + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + auto status = mDemux->setFrontendDataSource(frontendId); + return AssertionResult(status.isOk()); +} + +AssertionResult DemuxTests::getDemuxCaps(DemuxCapabilities& demuxCaps) { + if (!mDemux) { + ALOGW("[vts] Test with openDemux first."); + return failure(); + } + auto status = mService->getDemuxCaps(&demuxCaps); + return AssertionResult(status.isOk()); +} + +AssertionResult DemuxTests::getAvSyncId(std::shared_ptr filter, int32_t& avSyncHwId) { + EXPECT_TRUE(mDemux) << "Demux is not opened yet."; + + auto status = mDemux->getAvSyncHwId(filter, &avSyncHwId); + return AssertionResult(status.isOk()); +} + +AssertionResult DemuxTests::getAvSyncTime(int32_t avSyncId) { + EXPECT_TRUE(mDemux) << "Demux is not opened yet."; + + int64_t syncTime; + auto status = mDemux->getAvSyncTime(avSyncId, &syncTime); + return AssertionResult(status.isOk()); +} + +AssertionResult DemuxTests::closeDemux() { + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + auto status = mDemux->close(); + mDemux = nullptr; + return AssertionResult(status.isOk()); +} diff --git a/tv/tuner/aidl/vts/functional/DemuxTests.h b/tv/tuner/aidl/vts/functional/DemuxTests.h new file mode 100644 index 0000000000..7698de33b3 --- /dev/null +++ b/tv/tuner/aidl/vts/functional/DemuxTests.h @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +#include +#include + +using ::testing::AssertionResult; + +using namespace aidl::android::hardware::tv::tuner; + +class DemuxTests { + public: + void setService(std::shared_ptr tuner) { mService = tuner; } + + AssertionResult openDemux(std::shared_ptr& demux, int32_t& demuxId); + AssertionResult setDemuxFrontendDataSource(int32_t frontendId); + AssertionResult getAvSyncId(std::shared_ptr filter, int32_t& avSyncHwId); + AssertionResult getAvSyncTime(int32_t avSyncId); + AssertionResult getDemuxCaps(DemuxCapabilities& demuxCaps); + AssertionResult closeDemux(); + + protected: + static AssertionResult failure() { return ::testing::AssertionFailure(); } + + static AssertionResult success() { return ::testing::AssertionSuccess(); } + + std::shared_ptr mService; + std::shared_ptr mDemux; +}; diff --git a/tv/tuner/aidl/vts/functional/DescramblerTests.cpp b/tv/tuner/aidl/vts/functional/DescramblerTests.cpp new file mode 100644 index 0000000000..e0ee39180b --- /dev/null +++ b/tv/tuner/aidl/vts/functional/DescramblerTests.cpp @@ -0,0 +1,205 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "DescramblerTests.h" + +using namespace std; + +AssertionResult DescramblerTests::createCasPlugin(int32_t caSystemId) { + auto status = mMediaCasService->isSystemIdSupported(caSystemId); + if (!status.isOk() || !status) { + ALOGW("[vts] Failed to check isSystemIdSupported."); + return failure(); + } + + mCasListener = new MediaCasListener(); + auto pluginStatus = mMediaCasService->createPluginExt(caSystemId, mCasListener); + if (!pluginStatus.isOk()) { + ALOGW("[vts] Failed to createPluginExt."); + return failure(); + } + mCas = ICas::castFrom(pluginStatus); + if (mCas == nullptr) { + ALOGW("[vts] Failed to get ICas."); + return failure(); + } + return success(); +} + +AssertionResult DescramblerTests::openCasSession(vector& sessionId, + vector& hidlPvtData) { + Status sessionStatus; + SessionIntent intent = SessionIntent::LIVE; + ScramblingMode mode = ScramblingMode::RESERVED; + auto returnVoid = + mCas->openSession_1_2(intent, mode, [&](Status status, const hidl_vec& id) { + sessionStatus = status; + sessionId = id; + }); + if (!returnVoid.isOk() || (sessionStatus != Status::OK)) { + ALOGW("[vts] Failed to open cas session."); + mCas->closeSession(sessionId); + return failure(); + } + + if (hidlPvtData.size() > 0) { + auto status = mCas->setSessionPrivateData(sessionId, hidlPvtData); + if (status != android::hardware::cas::V1_0::Status::OK) { + ALOGW("[vts] Failed to set session private data"); + mCas->closeSession(sessionId); + return failure(); + } + } + + return success(); +} + +AssertionResult DescramblerTests::getKeyToken(int32_t caSystemId, string& provisonStr, + vector& hidlPvtData, + vector& token) { + if (createCasPlugin(caSystemId) != success()) { + ALOGW("[vts] createCasPlugin failed."); + return failure(); + } + + if (provisonStr.size() > 0) { + auto returnStatus = mCas->provision(hidl_string(provisonStr)); + if (returnStatus != android::hardware::cas::V1_0::Status::OK) { + ALOGW("[vts] provision failed."); + return failure(); + } + } + + return openCasSession(token, hidlPvtData); +} + +AssertionResult DescramblerTests::openDescrambler(int32_t demuxId) { + ndk::ScopedAStatus status; + status = mService->openDescrambler(&mDescrambler); + if (!status.isOk()) { + ALOGW("[vts] openDescrambler failed."); + return failure(); + } + + status = mDescrambler->setDemuxSource(demuxId); + if (!status.isOk()) { + ALOGW("[vts] setDemuxSource failed."); + return failure(); + } + + return success(); +} + +AssertionResult DescramblerTests::setKeyToken(vector& token) { + ndk::ScopedAStatus status; + if (!mDescrambler) { + ALOGW("[vts] Descrambler is not opened yet."); + return failure(); + } + + status = mDescrambler->setKeyToken(token); + if (!status.isOk()) { + ALOGW("[vts] setKeyToken failed."); + return failure(); + } + + return success(); +} + +AssertionResult DescramblerTests::addPid(DemuxPid pid, + std::shared_ptr optionalSourceFilter) { + ndk::ScopedAStatus status; + if (!mDescrambler) { + ALOGW("[vts] Descrambler is not opened yet."); + return failure(); + } + + status = mDescrambler->addPid(pid, optionalSourceFilter); + if (!status.isOk()) { + ALOGW("[vts] addPid failed."); + return failure(); + } + + return success(); +} + +AssertionResult DescramblerTests::removePid(DemuxPid pid, + std::shared_ptr optionalSourceFilter) { + ndk::ScopedAStatus status; + if (!mDescrambler) { + ALOGW("[vts] Descrambler is not opened yet."); + return failure(); + } + + status = mDescrambler->removePid(pid, optionalSourceFilter); + if (!status.isOk()) { + ALOGW("[vts] removePid failed."); + return failure(); + } + + return success(); +} + +AssertionResult DescramblerTests::closeDescrambler() { + ndk::ScopedAStatus status; + if (!mDescrambler) { + ALOGW("[vts] Descrambler is not opened yet."); + return failure(); + } + + status = mDescrambler->close(); + mDescrambler = nullptr; + if (!status.isOk()) { + ALOGW("[vts] close Descrambler failed."); + return failure(); + } + + return success(); +} + +AssertionResult DescramblerTests::getDemuxPidFromFilterSettings(DemuxFilterType type, + const DemuxFilterSettings& settings, + DemuxPid& pid) { + switch (type.mainType) { + case DemuxFilterMainType::TS: + if (type.subType.get() == + DemuxTsFilterType::AUDIO || + type.subType.get() == + DemuxTsFilterType::VIDEO) { + pid.set(settings.get().tpid); + } else { + ALOGW("[vts] Not a media ts filter!"); + return failure(); + } + break; + case DemuxFilterMainType::MMTP: + if (type.subType.get() == + DemuxMmtpFilterType::AUDIO || + type.subType.get() == + DemuxMmtpFilterType::VIDEO) { + pid.set( + settings.get().mmtpPid); + } else { + ALOGW("[vts] Not a media mmtp filter!"); + return failure(); + } + break; + default: + ALOGW("[vts] Not a media filter!"); + return failure(); + } + return success(); +} diff --git a/tv/tuner/aidl/vts/functional/DescramblerTests.h b/tv/tuner/aidl/vts/functional/DescramblerTests.h new file mode 100644 index 0000000000..f0b769141a --- /dev/null +++ b/tv/tuner/aidl/vts/functional/DescramblerTests.h @@ -0,0 +1,106 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +using android::Condition; +using android::Mutex; +using android::sp; +using android::hardware::hidl_string; +using android::hardware::hidl_vec; +using android::hardware::Return; +using android::hardware::Void; +using android::hardware::cas::V1_2::ICas; +using android::hardware::cas::V1_2::ICasListener; +using android::hardware::cas::V1_2::IMediaCasService; +using android::hardware::cas::V1_2::ScramblingMode; +using android::hardware::cas::V1_2::SessionIntent; +using android::hardware::cas::V1_2::Status; +using android::hardware::cas::V1_2::StatusEvent; + +using ::testing::AssertionResult; + +using namespace aidl::android::hardware::tv::tuner; + +class MediaCasListener : public ICasListener { + public: + virtual Return onEvent(int32_t /*event*/, int32_t /*arg*/, + const hidl_vec& /*data*/) override { + return Void(); + } + + virtual Return onSessionEvent(const hidl_vec& /*sessionId*/, int32_t /*event*/, + int32_t /*arg*/, + const hidl_vec& /*data*/) override { + return Void(); + } + + virtual Return onStatusUpdate(StatusEvent /*event*/, int32_t /*arg*/) override { + return Void(); + } +}; + +class DescramblerTests { + public: + void setService(std::shared_ptr tuner) { mService = tuner; } + void setCasService(sp casService) { mMediaCasService = casService; } + + AssertionResult setKeyToken(std::vector& token); + AssertionResult openDescrambler(int32_t demuxId); + AssertionResult addPid(DemuxPid pid, std::shared_ptr optionalSourceFilter); + AssertionResult removePid(DemuxPid pid, std::shared_ptr optionalSourceFilter); + AssertionResult closeDescrambler(); + AssertionResult getKeyToken(int32_t caSystemId, std::string& provisonStr, + std::vector& hidlPvtData, std::vector& token); + AssertionResult getDemuxPidFromFilterSettings(DemuxFilterType type, + const DemuxFilterSettings& settings, + DemuxPid& pid); + + protected: + static AssertionResult failure() { return ::testing::AssertionFailure(); } + + static AssertionResult success() { return ::testing::AssertionSuccess(); } + + std::shared_ptr mService; + std::shared_ptr mDescrambler; + android::sp mCas; + android::sp mMediaCasService; + android::sp mCasListener; + + private: + AssertionResult openCasSession(std::vector& sessionId, + std::vector& hidlPvtData); + AssertionResult createCasPlugin(int32_t caSystemId); +}; diff --git a/tv/tuner/aidl/vts/functional/DvrTests.cpp b/tv/tuner/aidl/vts/functional/DvrTests.cpp new file mode 100644 index 0000000000..e35609977b --- /dev/null +++ b/tv/tuner/aidl/vts/functional/DvrTests.cpp @@ -0,0 +1,337 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "DvrTests.h" + +#include + +void DvrCallback::startPlaybackInputThread(string& dataInputFile, PlaybackSettings& settings, + MQDesc& playbackMQDescriptor) { + mInputDataFile = dataInputFile; + mPlaybackSettings = settings; + mPlaybackMQ = std::make_unique(playbackMQDescriptor, true /* resetPointers */); + EXPECT_TRUE(mPlaybackMQ); + pthread_create(&mPlaybackThread, NULL, __threadLoopPlayback, this); + pthread_setname_np(mPlaybackThread, "test_playback_input_loop"); +} + +void DvrCallback::stopPlaybackThread() { + mPlaybackThreadRunning = false; + mKeepWritingPlaybackFMQ = false; + + android::Mutex::Autolock autoLock(mPlaybackThreadLock); +} + +void* DvrCallback::__threadLoopPlayback(void* user) { + DvrCallback* const self = static_cast(user); + self->playbackThreadLoop(); + return 0; +} + +void DvrCallback::playbackThreadLoop() { + android::Mutex::Autolock autoLock(mPlaybackThreadLock); + mPlaybackThreadRunning = true; + + // Create the EventFlag that is used to signal the HAL impl that data have been + // written into the Playback FMQ + EventFlag* playbackMQEventFlag; + EXPECT_TRUE(EventFlag::createEventFlag(mPlaybackMQ->getEventFlagWord(), &playbackMQEventFlag) == + android::OK); + + int fd = open(mInputDataFile.c_str(), O_RDONLY | O_LARGEFILE); + int readBytes; + uint32_t regionSize = 0; + int8_t* buffer; + ALOGW("[vts] playback thread loop start %s", mInputDataFile.c_str()); + if (fd < 0) { + mPlaybackThreadRunning = false; + ALOGW("[vts] Error %s", strerror(errno)); + } + + while (mPlaybackThreadRunning) { + while (mKeepWritingPlaybackFMQ) { + int totalWrite = mPlaybackMQ->availableToWrite(); + if (totalWrite * 4 < mPlaybackMQ->getQuantumCount()) { + // Wait for the HAL implementation to read more data then write. + continue; + } + AidlMessageQueue::MemTransaction memTx; + if (!mPlaybackMQ->beginWrite(totalWrite, &memTx)) { + ALOGW("[vts] Fail to write into Playback fmq."); + mPlaybackThreadRunning = false; + break; + } + auto first = memTx.getFirstRegion(); + buffer = first.getAddress(); + regionSize = first.getLength(); + + if (regionSize > 0) { + readBytes = read(fd, buffer, regionSize); + if (readBytes <= 0) { + if (readBytes < 0) { + ALOGW("[vts] Read from %s failed.", mInputDataFile.c_str()); + } else { + ALOGW("[vts] playback input EOF."); + } + mPlaybackThreadRunning = false; + break; + } + } + if (regionSize == 0 || (readBytes == regionSize && regionSize < totalWrite)) { + auto second = memTx.getSecondRegion(); + buffer = second.getAddress(); + regionSize = second.getLength(); + int ret = read(fd, buffer, regionSize); + if (ret <= 0) { + if (ret < 0) { + ALOGW("[vts] Read from %s failed.", mInputDataFile.c_str()); + } else { + ALOGW("[vts] playback input EOF."); + } + mPlaybackThreadRunning = false; + break; + } + readBytes += ret; + } + if (!mPlaybackMQ->commitWrite(readBytes)) { + ALOGW("[vts] Failed to commit write playback fmq."); + mPlaybackThreadRunning = false; + break; + } + playbackMQEventFlag->wake(static_cast(DemuxQueueNotifyBits::DATA_READY)); + } + } + + mPlaybackThreadRunning = false; + ALOGW("[vts] Playback thread end."); + close(fd); +} + +void DvrCallback::testRecordOutput() { + android::Mutex::Autolock autoLock(mMsgLock); + while (mDataOutputBuffer.empty()) { + if (-ETIMEDOUT == mMsgCondition.waitRelative(mMsgLock, WAIT_TIMEOUT)) { + EXPECT_TRUE(false) << "record output matching pid does not output within timeout"; + stopRecordThread(); + return; + } + } + stopRecordThread(); + ALOGW("[vts] record pass and stop"); +} + +void DvrCallback::startRecordOutputThread(RecordSettings recordSettings, + MQDesc& recordMQDescriptor) { + mRecordMQ = std::make_unique(recordMQDescriptor, true /* resetPointers */); + EXPECT_TRUE(mRecordMQ); + struct RecordThreadArgs* threadArgs = + (struct RecordThreadArgs*)malloc(sizeof(struct RecordThreadArgs)); + threadArgs->user = this; + threadArgs->recordSettings = &recordSettings; + threadArgs->keepReadingRecordFMQ = &mKeepReadingRecordFMQ; + + pthread_create(&mRecordThread, NULL, __threadLoopRecord, (void*)threadArgs); + pthread_setname_np(mRecordThread, "test_record_input_loop"); +} + +void* DvrCallback::__threadLoopRecord(void* threadArgs) { + DvrCallback* const self = + static_cast(((struct RecordThreadArgs*)threadArgs)->user); + self->recordThreadLoop(((struct RecordThreadArgs*)threadArgs)->recordSettings, + ((struct RecordThreadArgs*)threadArgs)->keepReadingRecordFMQ); + return 0; +} + +void DvrCallback::recordThreadLoop(RecordSettings* /*recordSettings*/, bool* keepReadingRecordFMQ) { + ALOGD("[vts] DvrCallback record threadLoop start."); + android::Mutex::Autolock autoLock(mRecordThreadLock); + mRecordThreadRunning = true; + mKeepReadingRecordFMQ = true; + + // Create the EventFlag that is used to signal the HAL impl that data have been + // read from the Record FMQ + EventFlag* recordMQEventFlag; + EXPECT_TRUE(EventFlag::createEventFlag(mRecordMQ->getEventFlagWord(), &recordMQEventFlag) == + android::OK); + + while (mRecordThreadRunning) { + while (*keepReadingRecordFMQ) { + uint32_t efState = 0; + android::status_t status = recordMQEventFlag->wait( + static_cast(DemuxQueueNotifyBits::DATA_READY), &efState, WAIT_TIMEOUT, + true /* retry on spurious wake */); + if (status != android::OK) { + ALOGD("[vts] wait for data ready on the record FMQ"); + continue; + } + // Our current implementation filter the data and write it into the filter FMQ + // immediately after the DATA_READY from the VTS/framework + if (!readRecordFMQ()) { + ALOGD("[vts] record data failed to be filtered. Ending thread"); + mRecordThreadRunning = false; + break; + } + } + } + + mRecordThreadRunning = false; + ALOGD("[vts] record thread ended."); +} + +bool DvrCallback::readRecordFMQ() { + android::Mutex::Autolock autoLock(mMsgLock); + bool result = false; + int readSize = mRecordMQ->availableToRead(); + mDataOutputBuffer.clear(); + mDataOutputBuffer.resize(readSize); + result = mRecordMQ->read(mDataOutputBuffer.data(), readSize); + EXPECT_TRUE(result) << "can't read from Record MQ"; + mMsgCondition.signal(); + return result; +} + +void DvrCallback::stopRecordThread() { + mKeepReadingRecordFMQ = false; + mRecordThreadRunning = false; +} + +AssertionResult DvrTests::openDvrInDemux(DvrType type, int32_t bufferSize) { + ndk::ScopedAStatus status; + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + + // Create dvr callback + if (type == DvrType::PLAYBACK) { + mDvrPlaybackCallback = ndk::SharedRefBase::make(); + status = mDemux->openDvr(type, bufferSize, mDvrPlaybackCallback, &mDvrPlayback); + if (status.isOk()) { + mDvrPlaybackCallback->setDvr(mDvrPlayback); + } + } + + if (type == DvrType::RECORD) { + mDvrRecordCallback = ndk::SharedRefBase::make(); + status = mDemux->openDvr(type, bufferSize, mDvrRecordCallback, &mDvrRecord); + if (status.isOk()) { + mDvrRecordCallback->setDvr(mDvrRecord); + } + } + + return AssertionResult(status.isOk()); +} + +AssertionResult DvrTests::configDvrPlayback(DvrSettings setting) { + ndk::ScopedAStatus status = mDvrPlayback->configure(setting); + + return AssertionResult(status.isOk()); +} + +AssertionResult DvrTests::configDvrRecord(DvrSettings setting) { + ndk::ScopedAStatus status = mDvrRecord->configure(setting); + + return AssertionResult(status.isOk()); +} + +AssertionResult DvrTests::getDvrPlaybackMQDescriptor() { + ndk::ScopedAStatus status; + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + EXPECT_TRUE(mDvrPlayback) << "Test with openDvr first."; + + status = mDvrPlayback->getQueueDesc(&mDvrPlaybackMQDescriptor); + + return AssertionResult(status.isOk()); +} + +AssertionResult DvrTests::getDvrRecordMQDescriptor() { + ndk::ScopedAStatus status; + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + EXPECT_TRUE(mDvrRecord) << "Test with openDvr first."; + + status = mDvrRecord->getQueueDesc(&mDvrRecordMQDescriptor); + + return AssertionResult(status.isOk()); +} + +AssertionResult DvrTests::attachFilterToDvr(std::shared_ptr filter) { + ndk::ScopedAStatus status; + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + EXPECT_TRUE(mDvrRecord) << "Test with openDvr first."; + + status = mDvrRecord->attachFilter(filter); + + return AssertionResult(status.isOk()); +} + +AssertionResult DvrTests::detachFilterToDvr(std::shared_ptr filter) { + ndk::ScopedAStatus status; + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + EXPECT_TRUE(mDvrRecord) << "Test with openDvr first."; + + status = mDvrRecord->detachFilter(filter); + + return AssertionResult(status.isOk()); +} + +AssertionResult DvrTests::startDvrPlayback() { + ndk::ScopedAStatus status; + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + EXPECT_TRUE(mDvrPlayback) << "Test with openDvr first."; + + status = mDvrPlayback->start(); + + return AssertionResult(status.isOk()); +} + +AssertionResult DvrTests::stopDvrPlayback() { + ndk::ScopedAStatus status; + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + EXPECT_TRUE(mDvrPlayback) << "Test with openDvr first."; + + status = mDvrPlayback->stop(); + + return AssertionResult(status.isOk()); +} + +void DvrTests::closeDvrPlayback() { + ASSERT_TRUE(mDemux); + ASSERT_TRUE(mDvrPlayback); + ASSERT_TRUE(mDvrPlayback->close().isOk()); +} + +AssertionResult DvrTests::startDvrRecord() { + ndk::ScopedAStatus status; + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + EXPECT_TRUE(mDvrRecord) << "Test with openDvr first."; + + status = mDvrRecord->start(); + + return AssertionResult(status.isOk()); +} + +AssertionResult DvrTests::stopDvrRecord() { + ndk::ScopedAStatus status; + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + EXPECT_TRUE(mDvrRecord) << "Test with openDvr first."; + + status = mDvrRecord->stop(); + + return AssertionResult(status.isOk()); +} + +void DvrTests::closeDvrRecord() { + ASSERT_TRUE(mDemux); + ASSERT_TRUE(mDvrRecord); + ASSERT_TRUE(mDvrRecord->close().isOk()); +} diff --git a/tv/tuner/aidl/vts/functional/DvrTests.h b/tv/tuner/aidl/vts/functional/DvrTests.h new file mode 100644 index 0000000000..bda57b3dff --- /dev/null +++ b/tv/tuner/aidl/vts/functional/DvrTests.h @@ -0,0 +1,181 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "FilterTests.h" + +using ::aidl::android::hardware::common::fmq::MQDescriptor; +using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite; +using ::android::AidlMessageQueue; +using ::android::Condition; +using ::android::Mutex; +using ::android::hardware::EventFlag; + +using namespace aidl::android::hardware::tv::tuner; +using namespace std; + +#define WAIT_TIMEOUT 3000000000 + +class DvrCallback : public BnDvrCallback { + public: + virtual ::ndk::ScopedAStatus onRecordStatus(RecordStatus status) override { + ALOGD("[vts] record status %hhu", status); + switch (status) { + case RecordStatus::DATA_READY: + break; + case RecordStatus::LOW_WATER: + break; + case RecordStatus::HIGH_WATER: + case RecordStatus::OVERFLOW: + ALOGD("[vts] record overflow. Flushing."); + EXPECT_TRUE(mDvr) << "Dvr callback is not set with an IDvr"; + if (mDvr) { + ndk::ScopedAStatus result = mDvr->flush(); + ALOGD("[vts] Flushing result %s.", result.getMessage()); + } + break; + } + return ndk::ScopedAStatus::ok(); + } + + virtual ::ndk::ScopedAStatus onPlaybackStatus(PlaybackStatus status) override { + // android::Mutex::Autolock autoLock(mMsgLock); + ALOGD("[vts] playback status %d", status); + switch (status) { + case PlaybackStatus::SPACE_EMPTY: + case PlaybackStatus::SPACE_ALMOST_EMPTY: + ALOGD("[vts] keep playback inputing %d", status); + mKeepWritingPlaybackFMQ = true; + break; + case PlaybackStatus::SPACE_ALMOST_FULL: + case PlaybackStatus::SPACE_FULL: + ALOGD("[vts] stop playback inputing %d", status); + mKeepWritingPlaybackFMQ = false; + break; + } + return ndk::ScopedAStatus::ok(); + } + + void stopPlaybackThread(); + void testRecordOutput(); + void stopRecordThread(); + + void startPlaybackInputThread(string& dataInputFile, PlaybackSettings& settings, + MQDesc& playbackMQDescriptor); + void startRecordOutputThread(RecordSettings recordSettings, MQDesc& recordMQDescriptor); + static void* __threadLoopPlayback(void* user); + static void* __threadLoopRecord(void* threadArgs); + void playbackThreadLoop(); + void recordThreadLoop(RecordSettings* recordSetting, bool* keepWritingPlaybackFMQ); + + bool readRecordFMQ(); + + void setDvr(std::shared_ptr dvr) { mDvr = dvr; } + + private: + struct RecordThreadArgs { + DvrCallback* user; + RecordSettings* recordSettings; + bool* keepReadingRecordFMQ; + }; + // uint16_t mDataLength = 0; + std::vector mDataOutputBuffer; + + std::map> mFilterMQ; + std::unique_ptr mPlaybackMQ; + std::unique_ptr mRecordMQ; + std::map mFilterMQEventFlag; + + android::Mutex mMsgLock; + android::Mutex mPlaybackThreadLock; + android::Mutex mRecordThreadLock; + android::Condition mMsgCondition; + + bool mKeepWritingPlaybackFMQ = true; + bool mKeepReadingRecordFMQ = true; + bool mPlaybackThreadRunning; + bool mRecordThreadRunning; + pthread_t mPlaybackThread; + pthread_t mRecordThread; + string mInputDataFile; + PlaybackSettings mPlaybackSettings; + + std::shared_ptr mDvr = nullptr; + + // int mPidFilterOutputCount = 0; +}; + +class DvrTests { + public: + void setService(std::shared_ptr tuner) { mService = tuner; } + void setDemux(std::shared_ptr demux) { mDemux = demux; } + + void startPlaybackInputThread(string& dataInputFile, PlaybackSettings& settings) { + mDvrPlaybackCallback->startPlaybackInputThread(dataInputFile, settings, + mDvrPlaybackMQDescriptor); + }; + + void startRecordOutputThread(RecordSettings settings) { + mDvrRecordCallback->startRecordOutputThread(settings, mDvrRecordMQDescriptor); + }; + + void stopPlaybackThread() { mDvrPlaybackCallback->stopPlaybackThread(); } + void testRecordOutput() { mDvrRecordCallback->testRecordOutput(); } + void stopRecordThread() { mDvrRecordCallback->stopRecordThread(); } + + AssertionResult openDvrInDemux(DvrType type, int32_t bufferSize); + AssertionResult configDvrPlayback(DvrSettings setting); + AssertionResult configDvrRecord(DvrSettings setting); + AssertionResult getDvrPlaybackMQDescriptor(); + AssertionResult getDvrRecordMQDescriptor(); + AssertionResult attachFilterToDvr(std::shared_ptr filter); + AssertionResult detachFilterToDvr(std::shared_ptr filter); + AssertionResult stopDvrPlayback(); + AssertionResult startDvrPlayback(); + AssertionResult stopDvrRecord(); + AssertionResult startDvrRecord(); + void closeDvrPlayback(); + void closeDvrRecord(); + + protected: + static AssertionResult failure() { return ::testing::AssertionFailure(); } + + static AssertionResult success() { return ::testing::AssertionSuccess(); } + + std::shared_ptr mService; + std::shared_ptr mDvrPlayback; + std::shared_ptr mDvrRecord; + std::shared_ptr mDemux; + std::shared_ptr mDvrPlaybackCallback; + std::shared_ptr mDvrRecordCallback; + MQDesc mDvrPlaybackMQDescriptor; + MQDesc mDvrRecordMQDescriptor; +}; diff --git a/tv/tuner/aidl/vts/functional/FilterTests.cpp b/tv/tuner/aidl/vts/functional/FilterTests.cpp new file mode 100644 index 0000000000..381475a2a3 --- /dev/null +++ b/tv/tuner/aidl/vts/functional/FilterTests.cpp @@ -0,0 +1,362 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "FilterTests.h" + +#include + +#include +#include + +using ::aidl::android::hardware::common::NativeHandle; + +void FilterCallback::testFilterDataOutput() { + android::Mutex::Autolock autoLock(mMsgLock); + while (mPidFilterOutputCount < 1) { + if (-ETIMEDOUT == mMsgCondition.waitRelative(mMsgLock, WAIT_TIMEOUT)) { + EXPECT_TRUE(false) << "filter output matching pid does not output within timeout"; + return; + } + } + mPidFilterOutputCount = 0; + ALOGW("[vts] pass and stop"); +} + +void FilterCallback::testFilterScramblingEvent() { + android::Mutex::Autolock autoLock(mMsgLock); + while (mScramblingStatusEvent < 1) { + if (-ETIMEDOUT == mMsgCondition.waitRelative(mMsgLock, WAIT_TIMEOUT)) { + EXPECT_TRUE(false) << "scrambling event does not output within timeout"; + return; + } + } + mScramblingStatusEvent = 0; + ALOGW("[vts] pass and stop"); +} + +void FilterCallback::testFilterIpCidEvent() { + android::Mutex::Autolock autoLock(mMsgLock); + while (mIpCidEvent < 1) { + if (-ETIMEDOUT == mMsgCondition.waitRelative(mMsgLock, WAIT_TIMEOUT)) { + EXPECT_TRUE(false) << "ip cid change event does not output within timeout"; + return; + } + } + mIpCidEvent = 0; + ALOGW("[vts] pass and stop"); +} + +void FilterCallback::testStartIdAfterReconfigure() { + android::Mutex::Autolock autoLock(mMsgLock); + while (!mStartIdReceived) { + if (-ETIMEDOUT == mMsgCondition.waitRelative(mMsgLock, WAIT_TIMEOUT)) { + EXPECT_TRUE(false) << "does not receive start id within timeout"; + return; + } + } + mStartIdReceived = false; + ALOGW("[vts] pass and stop"); +} + +void FilterCallback::readFilterEventsData(const vector& events) { + ALOGW("[vts] reading filter event"); + // todo separate filter handlers + for (int i = 0; i < events.size(); i++) { + switch (events[i].getTag()) { + case DemuxFilterEvent::Tag::media: + ALOGD("[vts] Media filter event, avMemHandle numFds=%zu.", + events[i].get().avMemory.fds.size()); + dumpAvData(events[i].get()); + break; + case DemuxFilterEvent::Tag::tsRecord: + ALOGD("[vts] TS record filter event, pts=%" PRIu64 ", firstMbInSlice=%d", + events[i].get().pts, + events[i].get().firstMbInSlice); + break; + case DemuxFilterEvent::Tag::mmtpRecord: + ALOGD("[vts] MMTP record filter event, pts=%" PRIu64 + ", firstMbInSlice=%d, mpuSequenceNumber=%d, tsIndexMask=%d", + events[i].get().pts, + events[i].get().firstMbInSlice, + events[i].get().mpuSequenceNumber, + events[i].get().tsIndexMask); + break; + case DemuxFilterEvent::Tag::monitorEvent: + switch (events[i].get().getTag()) { + case DemuxFilterMonitorEvent::Tag::scramblingStatus: + mScramblingStatusEvent++; + break; + case DemuxFilterMonitorEvent::Tag::cid: + mIpCidEvent++; + break; + default: + break; + } + break; + case DemuxFilterEvent::Tag::startId: + ALOGD("[vts] Restart filter event, startId=%d", + events[i].get()); + mStartIdReceived = true; + break; + default: + break; + } + } +} + +bool FilterCallback::dumpAvData(const DemuxFilterMediaEvent& event) { + int32_t length = event.dataLength; + int32_t offset = event.offset; + int av_fd; + // read data from buffer pointed by a handle + if (event.avMemory.fds.size() == 0) { + if (mAvSharedHandle == nullptr) { + return false; + } + av_fd = mAvSharedHandle->data[0]; + } else { + av_fd = event.avMemory.fds[0].get(); + } + uint8_t* buffer = static_cast( + mmap(NULL, length + offset, PROT_READ | PROT_WRITE, MAP_SHARED, av_fd, 0)); + if (buffer == MAP_FAILED) { + ALOGE("[vts] fail to allocate av buffer, errno=%d", errno); + return false; + } + uint8_t output[length + 1]; + memcpy(output, buffer + offset, length); + // print buffer and check with golden output. + return true; +} + +AssertionResult FilterTests::openFilterInDemux(DemuxFilterType type, int32_t bufferSize) { + ndk::ScopedAStatus status; + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + + // Create demux callback + mFilterCallback = ndk::SharedRefBase::make(); + + // Add filter to the local demux + status = mDemux->openFilter(type, bufferSize, mFilterCallback, &mFilter); + + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::getNewlyOpenedFilterId_64bit(int64_t& filterId) { + ndk::ScopedAStatus status; + EXPECT_TRUE(mDemux) << "Test with openDemux first."; + EXPECT_TRUE(mFilter) << "Test with openFilterInDemux first."; + EXPECT_TRUE(mFilterCallback) << "Test with openFilterInDemux first."; + + status = mFilter->getId64Bit(&mFilterId); + if (status.isOk()) { + mFilterCallback->setFilterId(mFilterId); + mFilterCallback->setFilterInterface(mFilter); + mUsedFilterIds.insert(mUsedFilterIds.end(), mFilterId); + mFilters[mFilterId] = mFilter; + mFilterCallbacks[mFilterId] = mFilterCallback; + filterId = mFilterId; + + // Check getId() too. + int32_t filterId32Bit; + status = mFilter->getId(&filterId32Bit); + } + + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::getSharedAvMemoryHandle(int64_t filterId) { + EXPECT_TRUE(mFilters[filterId]) << "Open media filter first."; + NativeHandle avMemory; + int64_t avMemSize; + ndk::ScopedAStatus status = mFilters[filterId]->getAvSharedHandle(&avMemory, &avMemSize); + if (status.isOk()) { + mAvSharedHandle = android::dupFromAidl(avMemory); + mFilterCallbacks[mFilterId]->setSharedHandle(mAvSharedHandle); + mFilterCallbacks[mFilterId]->setMemSize(avMemSize); + } + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::releaseShareAvHandle(int64_t filterId) { + ndk::ScopedAStatus status; + EXPECT_TRUE(mFilters[filterId]) << "Open media filter first."; + EXPECT_TRUE(mAvSharedHandle) << "No shared av handle to release."; + status = mFilters[filterId]->releaseAvHandle(::android::makeToAidl(mAvSharedHandle), + 0 /*dataId*/); + native_handle_close(mAvSharedHandle); + native_handle_delete(mAvSharedHandle); + mAvSharedHandle = nullptr; + + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::configFilter(DemuxFilterSettings setting, int64_t filterId) { + ndk::ScopedAStatus status; + EXPECT_TRUE(mFilters[filterId]) << "Test with getNewlyOpenedFilterId first."; + status = mFilters[filterId]->configure(setting); + + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::configAvFilterStreamType(AvStreamType type, int64_t filterId) { + ndk::ScopedAStatus status; + EXPECT_TRUE(mFilters[filterId]) << "Test with getNewlyOpenedFilterId first."; + + status = mFilters[filterId]->configureAvStreamType(type); + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::configIpFilterCid(int32_t ipCid, int64_t filterId) { + ndk::ScopedAStatus status; + EXPECT_TRUE(mFilters[filterId]) << "Open Ip filter first."; + + status = mFilters[filterId]->configureIpCid(ipCid); + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::getFilterMQDescriptor(int64_t filterId, bool getMqDesc) { + if (!getMqDesc) { + ALOGE("[vts] Filter does not need FMQ."); + return success(); + } + ndk::ScopedAStatus status; + EXPECT_TRUE(mFilters[filterId]) << "Test with getNewlyOpenedFilterId first."; + EXPECT_TRUE(mFilterCallbacks[filterId]) << "Test with getNewlyOpenedFilterId first."; + + status = mFilters[filterId]->getQueueDesc(&mFilterMQDescriptor); + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::startFilter(int64_t filterId) { + EXPECT_TRUE(mFilters[filterId]) << "Test with getNewlyOpenedFilterId first."; + + ndk::ScopedAStatus status = mFilters[filterId]->start(); + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::stopFilter(int64_t filterId) { + EXPECT_TRUE(mFilters[filterId]) << "Test with getNewlyOpenedFilterId first."; + + ndk::ScopedAStatus status = mFilters[filterId]->stop(); + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::closeFilter(int64_t filterId) { + EXPECT_TRUE(mFilters[filterId]) << "Test with getNewlyOpenedFilterId first."; + ndk::ScopedAStatus status = mFilters[filterId]->close(); + if (status.isOk()) { + for (int i = 0; i < mUsedFilterIds.size(); i++) { + if (mUsedFilterIds[i] == filterId) { + mUsedFilterIds.erase(mUsedFilterIds.begin() + i); + break; + } + } + mFilterCallbacks.erase(filterId); + mFilters.erase(filterId); + } + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::configureMonitorEvent(int64_t filterId, int32_t monitorEventTypes) { + EXPECT_TRUE(mFilters[filterId]) << "Test with getNewlyOpenedFilterId first."; + ndk::ScopedAStatus status; + + status = mFilters[filterId]->configureMonitorEvent(monitorEventTypes); + if (monitorEventTypes & static_cast(DemuxFilterMonitorEventType::SCRAMBLING_STATUS)) { + mFilterCallbacks[filterId]->testFilterScramblingEvent(); + } + if (monitorEventTypes & static_cast(DemuxFilterMonitorEventType::IP_CID_CHANGE)) { + mFilterCallbacks[filterId]->testFilterIpCidEvent(); + } + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::startIdTest(int64_t filterId) { + EXPECT_TRUE(mFilterCallbacks[filterId]) << "Test with getNewlyOpenedFilterId first."; + mFilterCallbacks[filterId]->testStartIdAfterReconfigure(); + return AssertionResult(true); +} + +AssertionResult FilterTests::openTimeFilterInDemux() { + if (!mDemux) { + ALOGW("[vts] Test with openDemux first."); + return failure(); + } + + // Add time filter to the local demux + auto status = mDemux->openTimeFilter(&mTimeFilter); + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::setTimeStamp(int64_t timeStamp) { + if (!mTimeFilter) { + ALOGW("[vts] Test with openTimeFilterInDemux first."); + return failure(); + } + + mBeginTimeStamp = timeStamp; + return AssertionResult(mTimeFilter->setTimeStamp(timeStamp).isOk()); +} + +AssertionResult FilterTests::getTimeStamp() { + if (!mTimeFilter) { + ALOGW("[vts] Test with openTimeFilterInDemux first."); + return failure(); + } + + int64_t timeStamp; + auto status = mTimeFilter->getTimeStamp(&timeStamp); + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::setFilterDataSource(int64_t sourceFilterId, int64_t sinkFilterId) { + if (!mFilters[sourceFilterId] || !mFilters[sinkFilterId]) { + ALOGE("[vts] setFilterDataSource filter not opened."); + return failure(); + } + + auto status = mFilters[sinkFilterId]->setDataSource(mFilters[sourceFilterId]); + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::setFilterDataSourceToDemux(int64_t filterId) { + if (!mFilters[filterId]) { + ALOGE("[vts] setFilterDataSourceToDemux filter not opened."); + return failure(); + } + + auto status = mFilters[filterId]->setDataSource(nullptr); + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::clearTimeStamp() { + if (!mTimeFilter) { + ALOGW("[vts] Test with openTimeFilterInDemux first."); + return failure(); + } + + return AssertionResult(mTimeFilter->clearTimeStamp().isOk()); +} + +AssertionResult FilterTests::closeTimeFilter() { + if (!mTimeFilter) { + ALOGW("[vts] Test with openTimeFilterInDemux first."); + return failure(); + } + + return AssertionResult(mTimeFilter->close().isOk()); +} diff --git a/tv/tuner/aidl/vts/functional/FilterTests.h b/tv/tuner/aidl/vts/functional/FilterTests.h new file mode 100644 index 0000000000..91a0a4a54f --- /dev/null +++ b/tv/tuner/aidl/vts/functional/FilterTests.h @@ -0,0 +1,156 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using ::aidl::android::hardware::common::fmq::MQDescriptor; +using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite; +using ::android::AidlMessageQueue; +using ::android::Condition; +using ::android::Mutex; +using ::android::hardware::EventFlag; + +using ::testing::AssertionResult; + +using namespace aidl::android::hardware::tv::tuner; +using namespace std; + +enum FilterEventType : uint8_t { + UNDEFINED, + SECTION, + MEDIA, + PES, + RECORD, + MMTPRECORD, + DOWNLOAD, + TEMI, +}; + +using FilterMQ = AidlMessageQueue; +using MQDesc = MQDescriptor; + +#define WAIT_TIMEOUT 3000000000 + +class FilterCallback : public BnFilterCallback { + public: + virtual ::ndk::ScopedAStatus onFilterEvent(const vector& events) override { + android::Mutex::Autolock autoLock(mMsgLock); + // Temprarily we treat the first coming back filter data on the matching pid a success + // once all of the MQ are cleared, means we got all the expected output + readFilterEventsData(events); + mPidFilterOutputCount++; + mMsgCondition.signal(); + return ::ndk::ScopedAStatus::ok(); + } + + virtual ::ndk::ScopedAStatus onFilterStatus(const DemuxFilterStatus /*status*/) override { + return ::ndk::ScopedAStatus::ok(); + } + + void setFilterId(int32_t filterId) { mFilterId = filterId; } + void setFilterInterface(std::shared_ptr filter) { mFilter = filter; } + void setFilterEventType(FilterEventType type) { mFilterEventType = type; } + void setSharedHandle(native_handle_t* sharedHandle) { mAvSharedHandle = sharedHandle; } + void setMemSize(uint64_t size) { mAvSharedMemSize = size; } + + void testFilterDataOutput(); + void testFilterScramblingEvent(); + void testFilterIpCidEvent(); + void testStartIdAfterReconfigure(); + + void readFilterEventsData(const vector& events); + bool dumpAvData(const DemuxFilterMediaEvent& event); + + private: + int32_t mFilterId; + std::shared_ptr mFilter; + FilterEventType mFilterEventType; + + native_handle_t* mAvSharedHandle = nullptr; + uint64_t mAvSharedMemSize = -1; + + android::Mutex mMsgLock; + android::Mutex mFilterOutputLock; + android::Condition mMsgCondition; + + int mPidFilterOutputCount = 0; + int mScramblingStatusEvent = 0; + int mIpCidEvent = 0; + bool mStartIdReceived = false; +}; + +class FilterTests { + public: + void setService(std::shared_ptr tuner) { mService = tuner; } + void setDemux(std::shared_ptr demux) { mDemux = demux; } + std::shared_ptr getFilterById(int64_t filterId) { return mFilters[filterId]; } + + map> getFilterCallbacks() { return mFilterCallbacks; } + + AssertionResult openFilterInDemux(DemuxFilterType type, int32_t bufferSize); + AssertionResult getNewlyOpenedFilterId_64bit(int64_t& filterId); + AssertionResult getSharedAvMemoryHandle(int64_t filterId); + AssertionResult releaseShareAvHandle(int64_t filterId); + AssertionResult configFilter(DemuxFilterSettings setting, int64_t filterId); + AssertionResult configAvFilterStreamType(AvStreamType type, int64_t filterId); + AssertionResult configIpFilterCid(int32_t ipCid, int64_t filterId); + AssertionResult configureMonitorEvent(int64_t filterId, int32_t monitorEventTypes); + AssertionResult getFilterMQDescriptor(int64_t filterId, bool getMqDesc); + AssertionResult startFilter(int64_t filterId); + AssertionResult stopFilter(int64_t filterId); + AssertionResult closeFilter(int64_t filterId); + AssertionResult startIdTest(int64_t filterId); + + AssertionResult openTimeFilterInDemux(); + AssertionResult setTimeStamp(int64_t timeStamp); + AssertionResult getTimeStamp(); + AssertionResult setFilterDataSource(int64_t sourceFilterId, int64_t sinkFilterId); + AssertionResult setFilterDataSourceToDemux(int64_t filterId); + AssertionResult clearTimeStamp(); + AssertionResult closeTimeFilter(); + + protected: + static AssertionResult failure() { return ::testing::AssertionFailure(); } + + static AssertionResult success() { return ::testing::AssertionSuccess(); } + + std::shared_ptr mService; + std::shared_ptr mFilter; + std::shared_ptr mDemux; + std::shared_ptr mTimeFilter; + map> mFilters; + map> mFilterCallbacks; + + std::shared_ptr mFilterCallback; + MQDesc mFilterMQDescriptor; + vector mUsedFilterIds; + + native_handle_t* mAvSharedHandle = nullptr; + int64_t mFilterId = -1; + int64_t mBeginTimeStamp; +}; diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp new file mode 100644 index 0000000000..93b79766dc --- /dev/null +++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp @@ -0,0 +1,486 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "FrontendTests.h" + +ndk::ScopedAStatus FrontendCallback::onEvent(FrontendEventType frontendEventType) { + android::Mutex::Autolock autoLock(mMsgLock); + ALOGD("[vts] frontend event received. Type: %d", frontendEventType); + mEventReceived = true; + mMsgCondition.signal(); + switch (frontendEventType) { + case FrontendEventType::LOCKED: + mLockMsgReceived = true; + mLockMsgCondition.signal(); + break; + default: + // do nothing + break; + } + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus FrontendCallback::onScanMessage(FrontendScanMessageType type, + const FrontendScanMessage& message) { + android::Mutex::Autolock autoLock(mMsgLock); + while (!mScanMsgProcessed) { + mMsgCondition.wait(mMsgLock); + } + ALOGD("[vts] frontend scan message. Type: %d", type); + switch (message.getTag()) { + case FrontendScanMessage::modulation: + readFrontendScanMessage_Modulation(message.get()); + break; + case FrontendScanMessage::Tag::isHighPriority: + ALOGD("[vts] frontend scan message high priority: %d", + message.get()); + break; + case FrontendScanMessage::Tag::annex: + ALOGD("[vts] frontend scan message dvbc annex: %hhu", + message.get()); + break; + default: + break; + } + mScanMessageReceived = true; + mScanMsgProcessed = false; + mScanMessageType = type; + mScanMessage = message; + mMsgCondition.signal(); + return ndk::ScopedAStatus::ok(); +} + +void FrontendCallback::readFrontendScanMessage_Modulation(FrontendModulation modulation) { + switch (modulation.getTag()) { + case FrontendModulation::Tag::dvbc: + ALOGD("[vts] frontend scan message modulation dvbc: %d", + modulation.get()); + break; + case FrontendModulation::Tag::dvbs: + ALOGD("[vts] frontend scan message modulation dvbs: %d", + modulation.get()); + break; + case FrontendModulation::Tag::isdbs: + ALOGD("[vts] frontend scan message modulation isdbs: %d", + modulation.get()); + break; + case FrontendModulation::Tag::isdbs3: + ALOGD("[vts] frontend scan message modulation isdbs3: %d", + modulation.get()); + break; + case FrontendModulation::Tag::isdbt: + ALOGD("[vts] frontend scan message modulation isdbt: %d", + modulation.get()); + break; + case FrontendModulation::Tag::atsc: + ALOGD("[vts] frontend scan message modulation atsc: %d", + modulation.get()); + break; + case FrontendModulation::Tag::atsc3: + ALOGD("[vts] frontend scan message modulation atsc3: %d", + modulation.get()); + break; + case FrontendModulation::Tag::dvbt: + ALOGD("[vts] frontend scan message modulation dvbt: %d", + modulation.get()); + break; + default: + break; + } +} + +void FrontendCallback::tuneTestOnLock(std::shared_ptr& frontend, + FrontendSettings settings) { + ndk::ScopedAStatus result = frontend->tune(settings); + EXPECT_TRUE(result.isOk()); + + android::Mutex::Autolock autoLock(mMsgLock); + while (!mLockMsgReceived) { + if (-ETIMEDOUT == mLockMsgCondition.waitRelative(mMsgLock, WAIT_TIMEOUT)) { + EXPECT_TRUE(false) << "Event LOCKED not received within timeout"; + mLockMsgReceived = false; + return; + } + } + mLockMsgReceived = false; +} + +void FrontendCallback::scanTest(std::shared_ptr& frontend, FrontendConfig config, + FrontendScanType type) { + int32_t targetFrequency = getTargetFrequency(config.settings); + if (type == FrontendScanType::SCAN_BLIND) { + // reset the frequency in the scan configuration to test blind scan. The settings param of + // passed in means the real input config on the transponder connected to the DUT. + // We want the blind the test to start from lower frequency than this to check the blind + // scan implementation. + resetBlindScanStartingFrequency(config, targetFrequency - 100); + } + + ndk::ScopedAStatus result = frontend->scan(config.settings, type); + EXPECT_TRUE(result.isOk()); + + bool scanMsgLockedReceived = false; + bool targetFrequencyReceived = false; + + android::Mutex::Autolock autoLock(mMsgLock); +wait: + while (!mScanMessageReceived) { + if (-ETIMEDOUT == mMsgCondition.waitRelative(mMsgLock, WAIT_TIMEOUT)) { + EXPECT_TRUE(false) << "Scan message not received within timeout"; + mScanMessageReceived = false; + mScanMsgProcessed = true; + return; + } + } + + if (mScanMessageType != FrontendScanMessageType::END) { + if (mScanMessageType == FrontendScanMessageType::LOCKED) { + scanMsgLockedReceived = true; + result = frontend->scan(config.settings, type); + EXPECT_TRUE(result.isOk()); + } + + if (mScanMessageType == FrontendScanMessageType::FREQUENCY) { + targetFrequencyReceived = + mScanMessage.get().size() > 0 && + mScanMessage.get()[0] == targetFrequency; + } + + if (mScanMessageType == FrontendScanMessageType::PROGRESS_PERCENT) { + ALOGD("[vts] Scan in progress...[%d%%]", + mScanMessage.get()); + } + + mScanMessageReceived = false; + mScanMsgProcessed = true; + mMsgCondition.signal(); + goto wait; + } + + EXPECT_TRUE(scanMsgLockedReceived) << "Scan message LOCKED not received before END"; + EXPECT_TRUE(targetFrequencyReceived) << "frequency not received before LOCKED on blindScan"; + mScanMessageReceived = false; + mScanMsgProcessed = true; +} + +int32_t FrontendCallback::getTargetFrequency(FrontendSettings& settings) { + switch (settings.getTag()) { + case FrontendSettings::Tag::analog: + return settings.get().frequency; + case FrontendSettings::Tag::atsc: + return settings.get().frequency; + case FrontendSettings::Tag::atsc3: + return settings.get().frequency; + case FrontendSettings::Tag::dvbc: + return settings.get().frequency; + case FrontendSettings::Tag::dvbs: + return settings.get().frequency; + case FrontendSettings::Tag::dvbt: + return settings.get().frequency; + case FrontendSettings::Tag::isdbs: + return settings.get().frequency; + case FrontendSettings::Tag::isdbs3: + return settings.get().frequency; + case FrontendSettings::Tag::isdbt: + return settings.get().frequency; + default: + return 0; + } +} + +void FrontendCallback::resetBlindScanStartingFrequency(FrontendConfig& config, + int32_t resetingFreq) { + switch (config.settings.getTag()) { + case FrontendSettings::Tag::analog: + config.settings.get().frequency = resetingFreq; + break; + case FrontendSettings::Tag::atsc: + config.settings.get().frequency = resetingFreq; + break; + case FrontendSettings::Tag::atsc3: + config.settings.get().frequency = resetingFreq; + break; + case FrontendSettings::Tag::dvbc: + config.settings.get().frequency = resetingFreq; + break; + case FrontendSettings::Tag::dvbs: + config.settings.get().frequency = resetingFreq; + break; + case FrontendSettings::Tag::dvbt: + config.settings.get().frequency = resetingFreq; + break; + case FrontendSettings::Tag::isdbs: + config.settings.get().frequency = resetingFreq; + break; + case FrontendSettings::Tag::isdbs3: + config.settings.get().frequency = resetingFreq; + break; + case FrontendSettings::Tag::isdbt: + config.settings.get().frequency = resetingFreq; + break; + default: + break; + } +} + +AssertionResult FrontendTests::getFrontendIds() { + ndk::ScopedAStatus status; + status = mService->getFrontendIds(&mFeIds); + return AssertionResult(status.isOk()); +} + +AssertionResult FrontendTests::getFrontendInfo(int32_t frontendId) { + ndk::ScopedAStatus status; + status = mService->getFrontendInfo(frontendId, &mFrontendInfo); + return AssertionResult(status.isOk()); +} + +AssertionResult FrontendTests::openFrontendById(int32_t frontendId) { + ndk::ScopedAStatus status; + status = mService->openFrontendById(frontendId, &mFrontend); + return AssertionResult(status.isOk()); +} + +AssertionResult FrontendTests::setFrontendCallback() { + EXPECT_TRUE(mFrontend) << "Test with openFrontendById first."; + mFrontendCallback = ndk::SharedRefBase::make(); + auto callbackStatus = mFrontend->setCallback(mFrontendCallback); + return AssertionResult(callbackStatus.isOk()); +} + +AssertionResult FrontendTests::scanFrontend(FrontendConfig config, FrontendScanType type) { + EXPECT_TRUE(mFrontendCallback) + << "test with openFrontendById/setFrontendCallback/getFrontendInfo first."; + + EXPECT_TRUE(mFrontendInfo.type == config.type) + << "FrontendConfig does not match the frontend info of the given id."; + + mFrontendCallback->scanTest(mFrontend, config, type); + return AssertionResult(true); +} + +AssertionResult FrontendTests::stopScanFrontend() { + EXPECT_TRUE(mFrontend) << "Test with openFrontendById first."; + ndk::ScopedAStatus status; + status = mFrontend->stopScan(); + + return AssertionResult(status.isOk()); +} + +AssertionResult FrontendTests::setLnb(int32_t lnbId) { + if (!mFrontendCallback) { + ALOGW("[vts] open and set frontend callback first."); + return failure(); + } + return AssertionResult(mFrontend->setLnb(lnbId).isOk()); +} + +AssertionResult FrontendTests::linkCiCam(int32_t ciCamId) { + ndk::ScopedAStatus status; + int32_t ltsId; + status = mFrontend->linkCiCam(ciCamId, <sId); + return AssertionResult(status.isOk()); +} + +AssertionResult FrontendTests::unlinkCiCam(int32_t ciCamId) { + ndk::ScopedAStatus status = mFrontend->unlinkCiCam(ciCamId); + return AssertionResult(status.isOk()); +} + +void FrontendTests::verifyFrontendStatus(vector statusTypes, + vector expectStatuses) { + ASSERT_TRUE(mFrontend) << "Frontend is not opened yet."; + ndk::ScopedAStatus status; + vector realStatuses; + + status = mFrontend->getStatus(statusTypes, &realStatuses); + ASSERT_TRUE(status.isOk() && realStatuses.size() == statusTypes.size()); + + for (int i = 0; i < statusTypes.size(); i++) { + FrontendStatusType type = statusTypes[i]; + switch (type) { + case FrontendStatusType::MODULATIONS: { + // TODO: verify modulations + break; + } + case FrontendStatusType::BERS: { + ASSERT_TRUE(std::equal(realStatuses[i].get().begin(), + realStatuses[i].get().end(), + expectStatuses[i].get().begin())); + break; + } + case FrontendStatusType::CODERATES: { + ASSERT_TRUE(std::equal( + realStatuses[i].get().begin(), + realStatuses[i].get().end(), + expectStatuses[i].get().begin())); + break; + } + case FrontendStatusType::GUARD_INTERVAL: { + // TODO: verify interval + break; + } + case FrontendStatusType::TRANSMISSION_MODE: { + // TODO: verify tranmission mode + break; + } + case FrontendStatusType::UEC: { + ASSERT_TRUE(realStatuses[i].get() == + expectStatuses[i].get()); + break; + } + case FrontendStatusType::T2_SYSTEM_ID: { + ASSERT_TRUE(realStatuses[i].get() == + expectStatuses[i].get()); + break; + } + case FrontendStatusType::INTERLEAVINGS: { + ASSERT_TRUE(std::equal( + realStatuses[i].get().begin(), + realStatuses[i].get().end(), + expectStatuses[i].get().begin())); + break; + } + case FrontendStatusType::ISDBT_SEGMENTS: { + ASSERT_TRUE(std::equal( + realStatuses[i].get().begin(), + realStatuses[i].get().end(), + expectStatuses[i].get().begin())); + break; + } + case FrontendStatusType::TS_DATA_RATES: { + ASSERT_TRUE(std::equal( + realStatuses[i].get().begin(), + realStatuses[i].get().end(), + expectStatuses[i].get().begin())); + break; + } + case FrontendStatusType::ROLL_OFF: { + // TODO: verify roll off + break; + } + case FrontendStatusType::IS_MISO: { + ASSERT_TRUE(realStatuses[i].get() == + expectStatuses[i].get()); + break; + } + case FrontendStatusType::IS_LINEAR: { + ASSERT_TRUE(realStatuses[i].get() == + expectStatuses[i].get()); + break; + } + case FrontendStatusType::IS_SHORT_FRAMES: { + ASSERT_TRUE(realStatuses[i].get() == + expectStatuses[i].get()); + break; + } + default: { + continue; + } + } + } + ASSERT_TRUE(status.isOk()); +} + +AssertionResult FrontendTests::tuneFrontend(FrontendConfig config, bool testWithDemux) { + EXPECT_TRUE(mFrontendCallback) + << "test with openFrontendById/setFrontendCallback/getFrontendInfo first."; + + EXPECT_TRUE(mFrontendInfo.type == config.type) + << "FrontendConfig does not match the frontend info of the given id."; + + mIsSoftwareFe = config.isSoftwareFe; + if (mIsSoftwareFe && testWithDemux) { + if (getDvrTests()->openDvrInDemux(mDvrConfig.type, mDvrConfig.bufferSize) != success()) { + ALOGW("[vts] Software frontend dvr configure openDvr failed."); + return failure(); + } + if (getDvrTests()->configDvrPlayback(mDvrConfig.settings) != success()) { + ALOGW("[vts] Software frontend dvr configure Dvr playback failed."); + return failure(); + } + if (getDvrTests()->getDvrPlaybackMQDescriptor() != success()) { + ALOGW("[vts] Software frontend dvr configure get MQDesc failed."); + return failure(); + } + getDvrTests()->startPlaybackInputThread( + mDvrConfig.playbackInputFile, + mDvrConfig.settings.get()); + } + mFrontendCallback->tuneTestOnLock(mFrontend, config.settings); + return AssertionResult(true); +} + +AssertionResult FrontendTests::stopTuneFrontend(bool testWithDemux) { + EXPECT_TRUE(mFrontend) << "Test with openFrontendById first."; + ndk::ScopedAStatus status; + status = mFrontend->stopTune(); + if (mIsSoftwareFe && testWithDemux) { + getDvrTests()->stopPlaybackThread(); + getDvrTests()->closeDvrPlayback(); + } + return AssertionResult(status.isOk()); +} + +AssertionResult FrontendTests::closeFrontend() { + EXPECT_TRUE(mFrontend) << "Test with openFrontendById first."; + ndk::ScopedAStatus status; + status = mFrontend->close(); + mFrontend = nullptr; + mFrontendCallback = nullptr; + return AssertionResult(status.isOk()); +} + +void FrontendTests::getFrontendIdByType(FrontendType feType, int32_t& feId) { + ASSERT_TRUE(getFrontendIds()); + ASSERT_TRUE(mFeIds.size() > 0); + for (size_t i = 0; i < mFeIds.size(); i++) { + ASSERT_TRUE(getFrontendInfo(mFeIds[i])); + if (mFrontendInfo.type != feType) { + continue; + } + feId = mFeIds[i]; + return; + } + feId = INVALID_ID; +} + +void FrontendTests::tuneTest(FrontendConfig frontendConf) { + int32_t feId; + getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(openFrontendById(feId)); + ASSERT_TRUE(setFrontendCallback()); + if (frontendConf.canConnectToCiCam) { + ASSERT_TRUE(linkCiCam(frontendConf.ciCamId)); + ASSERT_TRUE(unlinkCiCam(frontendConf.ciCamId)); + } + ASSERT_TRUE(tuneFrontend(frontendConf, false /*testWithDemux*/)); + verifyFrontendStatus(frontendConf.tuneStatusTypes, frontendConf.expectTuneStatuses); + ASSERT_TRUE(stopTuneFrontend(false /*testWithDemux*/)); + ASSERT_TRUE(closeFrontend()); +} + +void FrontendTests::scanTest(FrontendConfig frontendConf, FrontendScanType scanType) { + int32_t feId; + getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(openFrontendById(feId)); + ASSERT_TRUE(setFrontendCallback()); + ASSERT_TRUE(scanFrontend(frontendConf, scanType)); + ASSERT_TRUE(stopScanFrontend()); + ASSERT_TRUE(closeFrontend()); +} diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.h b/tv/tuner/aidl/vts/functional/FrontendTests.h new file mode 100644 index 0000000000..b65704f64b --- /dev/null +++ b/tv/tuner/aidl/vts/functional/FrontendTests.h @@ -0,0 +1,138 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +#include +#include +#include +#include + +#include "DvrTests.h" +#include "VtsHalTvTunerTestConfigurations.h" + +#define WAIT_TIMEOUT 3000000000 +#define INVALID_ID -1 + +using android::Condition; +using android::Mutex; + +using ::testing::AssertionResult; + +using namespace aidl::android::hardware::tv::tuner; +using namespace std; + +#define INVALID_ID -1 +#define WAIT_TIMEOUT 3000000000 + +class FrontendCallback : public BnFrontendCallback { + public: + virtual ndk::ScopedAStatus onEvent(FrontendEventType frontendEventType) override; + virtual ndk::ScopedAStatus onScanMessage(FrontendScanMessageType type, + const FrontendScanMessage& message) override; + + void tuneTestOnLock(std::shared_ptr& frontend, FrontendSettings settings); + void scanTest(std::shared_ptr& frontend, FrontendConfig config, + FrontendScanType type); + + // Helper methods + int32_t getTargetFrequency(FrontendSettings& settings); + void resetBlindScanStartingFrequency(FrontendConfig& config, int32_t resetingFreq); + + private: + void readFrontendScanMessage_Modulation(FrontendModulation modulation); + + bool mEventReceived = false; + bool mScanMessageReceived = false; + bool mLockMsgReceived = false; + bool mScanMsgProcessed = true; + FrontendScanMessageType mScanMessageType; + FrontendScanMessage mScanMessage; + vector mEventMessage; + android::Mutex mMsgLock; + android::Condition mMsgCondition; + android::Condition mLockMsgCondition; +}; + +class FrontendTests { + public: + void setService(std::shared_ptr tuner) { + mService = tuner; + getDvrTests()->setService(tuner); + getDefaultSoftwareFrontendPlaybackConfig(mDvrConfig); + } + + AssertionResult getFrontendIds(); + AssertionResult getFrontendInfo(int32_t frontendId); + AssertionResult openFrontendById(int32_t frontendId); + AssertionResult setFrontendCallback(); + AssertionResult scanFrontend(FrontendConfig config, FrontendScanType type); + AssertionResult stopScanFrontend(); + AssertionResult setLnb(int32_t lnbId); + AssertionResult tuneFrontend(FrontendConfig config, bool testWithDemux); + void verifyFrontendStatus(vector statusTypes, + vector expectStatuses); + AssertionResult stopTuneFrontend(bool testWithDemux); + AssertionResult closeFrontend(); + + AssertionResult linkCiCam(int32_t ciCamId); + AssertionResult unlinkCiCam(int32_t ciCamId); + + void getFrontendIdByType(FrontendType feType, int32_t& feId); + void tuneTest(FrontendConfig frontendConf); + void scanTest(FrontendConfig frontend, FrontendScanType type); + + void setDvrTests(DvrTests* dvrTests) { mExternalDvrTests = dvrTests; } + void setDemux(std::shared_ptr demux) { getDvrTests()->setDemux(demux); } + void setSoftwareFrontendDvrConfig(DvrConfig conf) { mDvrConfig = conf; } + + protected: + static AssertionResult failure() { return ::testing::AssertionFailure(); } + static AssertionResult success() { return ::testing::AssertionSuccess(); } + + void getDefaultSoftwareFrontendPlaybackConfig(DvrConfig& dvrConfig) { + PlaybackSettings playbackSettings{ + .statusMask = 0xf, + .lowThreshold = 0x1000, + .highThreshold = 0x07fff, + .dataFormat = DataFormat::ES, + .packetSize = static_cast(188), + }; + dvrConfig.type = DvrType::PLAYBACK; + dvrConfig.playbackInputFile = "/data/local/tmp/test.es"; + dvrConfig.bufferSize = FMQ_SIZE_4M; + dvrConfig.settings.set(playbackSettings); + } + + DvrTests* getDvrTests() { + return (mExternalDvrTests != nullptr ? mExternalDvrTests : &mDvrTests); + } + + std::shared_ptr mService; + std::shared_ptr mFrontend; + FrontendInfo mFrontendInfo; + std::shared_ptr mFrontendCallback; + vector mFeIds; + + DvrTests mDvrTests; + DvrTests* mExternalDvrTests = nullptr; + bool mIsSoftwareFe = false; + DvrConfig mDvrConfig; +}; diff --git a/tv/tuner/aidl/vts/functional/LnbTests.cpp b/tv/tuner/aidl/vts/functional/LnbTests.cpp new file mode 100644 index 0000000000..d62e58a055 --- /dev/null +++ b/tv/tuner/aidl/vts/functional/LnbTests.cpp @@ -0,0 +1,112 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "LnbTests.h" + +ndk::ScopedAStatus LnbCallback::onEvent(LnbEventType lnbEventType) { + android::Mutex::Autolock autoLock(mMsgLock); + ALOGD("[vts] lnb event received. Type: %d", lnbEventType); + mEventReceived = true; + mMsgCondition.signal(); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus LnbCallback::onDiseqcMessage(const vector& diseqcMessage) { + string msg(diseqcMessage.begin(), diseqcMessage.end()); + ALOGD("[vts] onDiseqcMessage %s", msg.c_str()); + return ndk::ScopedAStatus::ok(); +} + +AssertionResult LnbTests::getLnbIds(vector& ids) { + ndk::ScopedAStatus status; + status = mService->getLnbIds(&ids); + return AssertionResult(status.isOk()); +} + +AssertionResult LnbTests::openLnbById(int32_t lnbId) { + ndk::ScopedAStatus status; + status = mService->openLnbById(lnbId, &mLnb); + return AssertionResult(status.isOk()); +} + +AssertionResult LnbTests::openLnbByName(string lnbName, int32_t& id) { + ndk::ScopedAStatus status; + vector ids; + status = mService->openLnbByName(lnbName, &ids, &mLnb); + if (status.isOk()) { + id = ids[0]; + } + return AssertionResult(status.isOk()); +} + +AssertionResult LnbTests::setLnbCallback() { + if (!mLnb) { + ALOGW("[vts] Open Lnb first"); + return failure(); + } + mLnbCallback = ndk::SharedRefBase::make(); + auto callbackStatus = mLnb->setCallback(mLnbCallback); + return AssertionResult(callbackStatus.isOk()); +} + +AssertionResult LnbTests::setVoltage(LnbVoltage voltage) { + if (!mLnb) { + ALOGW("[vts] Open Lnb first"); + return failure(); + } + ndk::ScopedAStatus status = mLnb->setVoltage(voltage); + return AssertionResult(status.isOk()); +} + +AssertionResult LnbTests::setTone(LnbTone tone) { + if (!mLnb) { + ALOGW("[vts] Open Lnb first"); + return failure(); + } + ndk::ScopedAStatus status = mLnb->setTone(tone); + return AssertionResult(status.isOk()); +} + +AssertionResult LnbTests::setSatellitePosition(LnbPosition position) { + if (!mLnb) { + ALOGW("[vts] Open Lnb first"); + return failure(); + } + ndk::ScopedAStatus status = mLnb->setSatellitePosition(position); + return AssertionResult(status.isOk()); +} + +AssertionResult LnbTests::sendDiseqcMessage(vector diseqcMsg) { + if (!mLnb) { + ALOGW("[vts] Open Lnb first"); + return failure(); + } + ndk::ScopedAStatus status = mLnb->sendDiseqcMessage(diseqcMsg); + return AssertionResult(status.isOk()); +} + +AssertionResult LnbTests::closeLnb() { + if (!mLnb) { + ALOGW("[vts] Open Lnb first"); + return failure(); + } + ndk::ScopedAStatus status = mLnb->close(); + mLnb = nullptr; + mLnbCallback = nullptr; + return AssertionResult(status.isOk()); +} diff --git a/tv/tuner/aidl/vts/functional/LnbTests.h b/tv/tuner/aidl/vts/functional/LnbTests.h new file mode 100644 index 0000000000..d6b5a259ca --- /dev/null +++ b/tv/tuner/aidl/vts/functional/LnbTests.h @@ -0,0 +1,71 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +using android::Condition; +using android::Mutex; + +using ::testing::AssertionResult; + +using namespace aidl::android::hardware::tv::tuner; +using namespace std; + +class LnbCallback : public BnLnbCallback { + public: + virtual ::ndk::ScopedAStatus onEvent(LnbEventType lnbEventType) override; + virtual ::ndk::ScopedAStatus onDiseqcMessage( + const std::vector& diseqcMessage) override; + + private: + bool mEventReceived = false; + android::Mutex mMsgLock; + android::Condition mMsgCondition; +}; + +class LnbTests { + public: + void setService(std::shared_ptr tuner) { mService = tuner; } + + AssertionResult getLnbIds(vector& ids); + AssertionResult openLnbById(int32_t lnbId); + AssertionResult openLnbByName(string lnbName, int32_t& lnbId); + AssertionResult setLnbCallback(); + AssertionResult setVoltage(LnbVoltage voltage); + AssertionResult setTone(LnbTone tone); + AssertionResult setSatellitePosition(LnbPosition position); + AssertionResult sendDiseqcMessage(vector diseqcMsg); + AssertionResult closeLnb(); + + protected: + static AssertionResult failure() { return ::testing::AssertionFailure(); } + + static AssertionResult success() { return ::testing::AssertionSuccess(); } + + std::shared_ptr mService; + std::shared_ptr mLnb; + std::shared_ptr mLnbCallback; + vector mLnbIds; +}; diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp new file mode 100644 index 0000000000..85e5c68b6a --- /dev/null +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp @@ -0,0 +1,878 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "VtsHalTvTunerTargetTest.h" + +#include +#include +#include +#include + +namespace { + +AssertionResult TunerBroadcastAidlTest::filterDataOutputTest() { + return filterDataOutputTestBase(mFilterTests); +} + +AssertionResult TunerPlaybackAidlTest::filterDataOutputTest() { + return filterDataOutputTestBase(mFilterTests); +} + +AssertionResult TunerDescramblerAidlTest::filterDataOutputTest() { + return filterDataOutputTestBase(mFilterTests); +} + +void TunerFilterAidlTest::configSingleFilterInDemuxTest(FilterConfig filterConf, + FrontendConfig frontendConf) { + int32_t feId; + int32_t demuxId; + std::shared_ptr demux; + int64_t filterId; + + mFrontendTests.getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + mFilterTests.setDemux(demux); + ASSERT_TRUE(mFilterTests.openFilterInDemux(filterConf.type, filterConf.bufferSize)); + ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(filterId)); + ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId)); + if (filterConf.type.mainType == DemuxFilterMainType::IP) { + ASSERT_TRUE(mFilterTests.configIpFilterCid(filterConf.ipCid, filterId)); + } + if (filterConf.monitorEventTypes > 0) { + ASSERT_TRUE(mFilterTests.configureMonitorEvent(filterId, filterConf.monitorEventTypes)); + } + ASSERT_TRUE(mFilterTests.getFilterMQDescriptor(filterId, filterConf.getMqDesc)); + ASSERT_TRUE(mFilterTests.startFilter(filterId)); + ASSERT_TRUE(mFilterTests.stopFilter(filterId)); + ASSERT_TRUE(mFilterTests.closeFilter(filterId)); + ASSERT_TRUE(mDemuxTests.closeDemux()); + ASSERT_TRUE(mFrontendTests.closeFrontend()); +} + +void TunerFilterAidlTest::reconfigSingleFilterInDemuxTest(FilterConfig filterConf, + FilterConfig filterReconf, + FrontendConfig frontendConf) { + int32_t feId; + int32_t demuxId; + std::shared_ptr demux; + int64_t filterId; + + mFrontendTests.getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + if (frontendConf.isSoftwareFe) { + mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[live.dvrSoftwareFeId]); + } + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + mFrontendTests.setDemux(demux); + mFilterTests.setDemux(demux); + ASSERT_TRUE(mFilterTests.openFilterInDemux(filterConf.type, filterConf.bufferSize)); + ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(filterId)); + ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId)); + ASSERT_TRUE(mFilterTests.getFilterMQDescriptor(filterId, filterConf.getMqDesc)); + ASSERT_TRUE(mFilterTests.startFilter(filterId)); + ASSERT_TRUE(mFilterTests.stopFilter(filterId)); + ASSERT_TRUE(mFilterTests.configFilter(filterReconf.settings, filterId)); + ASSERT_TRUE(mFilterTests.startFilter(filterId)); + ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/)); + ASSERT_TRUE(mFilterTests.startIdTest(filterId)); + ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/)); + ASSERT_TRUE(mFilterTests.stopFilter(filterId)); + ASSERT_TRUE(mFilterTests.closeFilter(filterId)); + ASSERT_TRUE(mDemuxTests.closeDemux()); + ASSERT_TRUE(mFrontendTests.closeFrontend()); +} + +void TunerFilterAidlTest::testTimeFilter(TimeFilterConfig filterConf) { + int32_t demuxId; + std::shared_ptr demux; + DemuxCapabilities caps; + + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + ASSERT_TRUE(mDemuxTests.getDemuxCaps(caps)); + ASSERT_TRUE(caps.bTimeFilter); + mFilterTests.setDemux(demux); + ASSERT_TRUE(mFilterTests.openTimeFilterInDemux()); + ASSERT_TRUE(mFilterTests.setTimeStamp(filterConf.timeStamp)); + ASSERT_TRUE(mFilterTests.getTimeStamp()); + ASSERT_TRUE(mFilterTests.clearTimeStamp()); + ASSERT_TRUE(mFilterTests.closeTimeFilter()); + ASSERT_TRUE(mDemuxTests.closeDemux()); +} + +void TunerBroadcastAidlTest::broadcastSingleFilterTest(FilterConfig filterConf, + FrontendConfig frontendConf) { + int32_t feId; + int32_t demuxId; + std::shared_ptr demux; + int64_t filterId; + + mFrontendTests.getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + if (mLnbId) { + ASSERT_TRUE(mFrontendTests.setLnb(*mLnbId)); + } + if (frontendConf.isSoftwareFe) { + mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[live.dvrSoftwareFeId]); + } + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + mFrontendTests.setDemux(demux); + mFilterTests.setDemux(demux); + ASSERT_TRUE(mFilterTests.openFilterInDemux(filterConf.type, filterConf.bufferSize)); + ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(filterId)); + ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId)); + ASSERT_TRUE(mFilterTests.getFilterMQDescriptor(filterId, filterConf.getMqDesc)); + ASSERT_TRUE(mFilterTests.startFilter(filterId)); + // tune test + ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/)); + ASSERT_TRUE(filterDataOutputTest()); + ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/)); + ASSERT_TRUE(mFilterTests.stopFilter(filterId)); + ASSERT_TRUE(mFilterTests.closeFilter(filterId)); + ASSERT_TRUE(mDemuxTests.closeDemux()); + ASSERT_TRUE(mFrontendTests.closeFrontend()); +} + +void TunerBroadcastAidlTest::broadcastSingleFilterTestWithLnb(FilterConfig filterConf, + FrontendConfig frontendConf, + LnbConfig lnbConf) { + if (lnbConf.name.compare(emptyHardwareId) == 0) { + vector ids; + ASSERT_TRUE(mLnbTests.getLnbIds(ids)); + ASSERT_TRUE(ids.size() > 0); + ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); + mLnbId = &ids[0]; + } else { + mLnbId = (int32_t*)malloc(sizeof(int32_t)); + ASSERT_TRUE(mLnbTests.openLnbByName(lnbConf.name, *mLnbId)); + } + ASSERT_TRUE(mLnbTests.setLnbCallback()); + ASSERT_TRUE(mLnbTests.setVoltage(lnbConf.voltage)); + ASSERT_TRUE(mLnbTests.setTone(lnbConf.tone)); + ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbConf.position)); + broadcastSingleFilterTest(filterConf, frontendConf); + ASSERT_TRUE(mLnbTests.closeLnb()); + mLnbId = nullptr; +} + +void TunerBroadcastAidlTest::mediaFilterUsingSharedMemoryTest(FilterConfig filterConf, + FrontendConfig frontendConf) { + int32_t feId; + int32_t demuxId; + std::shared_ptr demux; + int64_t filterId; + + mFrontendTests.getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + if (frontendConf.isSoftwareFe) { + mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[live.dvrSoftwareFeId]); + } + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + mFrontendTests.setDemux(demux); + mFilterTests.setDemux(demux); + ASSERT_TRUE(mFilterTests.openFilterInDemux(filterConf.type, filterConf.bufferSize)); + ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(filterId)); + ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId)); + ASSERT_TRUE(mFilterTests.getSharedAvMemoryHandle(filterId)); + ASSERT_TRUE(mFilterTests.configAvFilterStreamType(filterConf.streamType, filterId)); + ASSERT_TRUE(mFilterTests.getFilterMQDescriptor(filterId, filterConf.getMqDesc)); + ASSERT_TRUE(mFilterTests.startFilter(filterId)); + // tune test + ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/)); + ASSERT_TRUE(filterDataOutputTest()); + ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/)); + ASSERT_TRUE(mFilterTests.stopFilter(filterId)); + ASSERT_TRUE(mFilterTests.releaseShareAvHandle(filterId)); + ASSERT_TRUE(mFilterTests.closeFilter(filterId)); + ASSERT_TRUE(mDemuxTests.closeDemux()); + ASSERT_TRUE(mFrontendTests.closeFrontend()); +} + +void TunerPlaybackAidlTest::playbackSingleFilterTest(FilterConfig filterConf, DvrConfig dvrConf) { + int32_t demuxId; + std::shared_ptr demux; + int64_t filterId; + + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + mFilterTests.setDemux(demux); + mDvrTests.setDemux(demux); + ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrConf.type, dvrConf.bufferSize)); + ASSERT_TRUE(mDvrTests.configDvrPlayback(dvrConf.settings)); + ASSERT_TRUE(mDvrTests.getDvrPlaybackMQDescriptor()); + ASSERT_TRUE(mFilterTests.openFilterInDemux(filterConf.type, filterConf.bufferSize)); + ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(filterId)); + ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId)); + ASSERT_TRUE(mFilterTests.getFilterMQDescriptor(filterId, filterConf.getMqDesc)); + mDvrTests.startPlaybackInputThread(dvrConf.playbackInputFile, + dvrConf.settings.get()); + ASSERT_TRUE(mDvrTests.startDvrPlayback()); + ASSERT_TRUE(mFilterTests.startFilter(filterId)); + ASSERT_TRUE(filterDataOutputTest()); + mDvrTests.stopPlaybackThread(); + ASSERT_TRUE(mFilterTests.stopFilter(filterId)); + ASSERT_TRUE(mDvrTests.stopDvrPlayback()); + ASSERT_TRUE(mFilterTests.closeFilter(filterId)); + mDvrTests.closeDvrPlayback(); + ASSERT_TRUE(mDemuxTests.closeDemux()); +} + +void TunerRecordAidlTest::recordSingleFilterTestWithLnb(FilterConfig filterConf, + FrontendConfig frontendConf, + DvrConfig dvrConf, LnbConfig lnbConf) { + if (lnbConf.name.compare(emptyHardwareId) == 0) { + vector ids; + ASSERT_TRUE(mLnbTests.getLnbIds(ids)); + ASSERT_TRUE(ids.size() > 0); + ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); + mLnbId = &ids[0]; + } else { + mLnbId = (int32_t*)malloc(sizeof(int32_t)); + ASSERT_TRUE(mLnbTests.openLnbByName(lnbConf.name, *mLnbId)); + } + ASSERT_TRUE(mLnbTests.setLnbCallback()); + ASSERT_TRUE(mLnbTests.setVoltage(lnbConf.voltage)); + ASSERT_TRUE(mLnbTests.setTone(lnbConf.tone)); + ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbConf.position)); + for (auto msgName : lnbRecord.diseqcMsgs) { + ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgMap[msgName])); + } + recordSingleFilterTest(filterConf, frontendConf, dvrConf); + ASSERT_TRUE(mLnbTests.closeLnb()); + mLnbId = nullptr; +} + +void TunerRecordAidlTest::attachSingleFilterToRecordDvrTest(FilterConfig filterConf, + FrontendConfig frontendConf, + DvrConfig dvrConf) { + int32_t demuxId; + std::shared_ptr demux; + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + mDvrTests.setDemux(demux); + + DvrConfig dvrSourceConfig; + if (record.hasFrontendConnection) { + int32_t feId; + mFrontendTests.getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + } else { + dvrSourceConfig = dvrMap[record.dvrSourceId]; + ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrSourceConfig.type, dvrSourceConfig.bufferSize)); + ASSERT_TRUE(mDvrTests.configDvrPlayback(dvrSourceConfig.settings)); + ASSERT_TRUE(mDvrTests.getDvrPlaybackMQDescriptor()); + } + + int64_t filterId; + std::shared_ptr filter; + mFilterTests.setDemux(demux); + + ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrConf.type, dvrConf.bufferSize)); + ASSERT_TRUE(mDvrTests.configDvrRecord(dvrConf.settings)); + ASSERT_TRUE(mDvrTests.getDvrRecordMQDescriptor()); + + ASSERT_TRUE(mFilterTests.openFilterInDemux(filterConf.type, filterConf.bufferSize)); + ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(filterId)); + ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId)); + ASSERT_TRUE(mFilterTests.getFilterMQDescriptor(filterId, filterConf.getMqDesc)); + filter = mFilterTests.getFilterById(filterId); + ASSERT_TRUE(filter != nullptr); + ASSERT_TRUE(mDvrTests.attachFilterToDvr(filter)); + ASSERT_TRUE(mDvrTests.startDvrRecord()); + ASSERT_TRUE(mFilterTests.startFilter(filterId)); + ASSERT_TRUE(mFilterTests.stopFilter(filterId)); + ASSERT_TRUE(mDvrTests.stopDvrRecord()); + ASSERT_TRUE(mDvrTests.detachFilterToDvr(filter)); + ASSERT_TRUE(mFilterTests.closeFilter(filterId)); + mDvrTests.closeDvrRecord(); + ASSERT_TRUE(mDemuxTests.closeDemux()); + + if (record.hasFrontendConnection) { + ASSERT_TRUE(mFrontendTests.closeFrontend()); + } +} + +void TunerRecordAidlTest::recordSingleFilterTest(FilterConfig filterConf, + FrontendConfig frontendConf, DvrConfig dvrConf) { + int32_t demuxId; + std::shared_ptr demux; + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + mDvrTests.setDemux(demux); + + DvrConfig dvrSourceConfig; + if (record.hasFrontendConnection) { + int32_t feId; + mFrontendTests.getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + if (frontendConf.isSoftwareFe) { + mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[record.dvrSoftwareFeId]); + } + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + mFrontendTests.setDvrTests(&mDvrTests); + } else { + dvrSourceConfig = dvrMap[record.dvrSourceId]; + ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrSourceConfig.type, dvrSourceConfig.bufferSize)); + ASSERT_TRUE(mDvrTests.configDvrPlayback(dvrSourceConfig.settings)); + ASSERT_TRUE(mDvrTests.getDvrPlaybackMQDescriptor()); + } + + int64_t filterId; + std::shared_ptr filter; + mFilterTests.setDemux(demux); + ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrConf.type, dvrConf.bufferSize)); + ASSERT_TRUE(mDvrTests.configDvrRecord(dvrConf.settings)); + ASSERT_TRUE(mDvrTests.getDvrRecordMQDescriptor()); + ASSERT_TRUE(mFilterTests.openFilterInDemux(filterConf.type, filterConf.bufferSize)); + ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(filterId)); + ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId)); + ASSERT_TRUE(mFilterTests.getFilterMQDescriptor(filterId, filterConf.getMqDesc)); + filter = mFilterTests.getFilterById(filterId); + ASSERT_TRUE(filter != nullptr); + mDvrTests.startRecordOutputThread(dvrConf.settings.get()); + ASSERT_TRUE(mDvrTests.attachFilterToDvr(filter)); + ASSERT_TRUE(mDvrTests.startDvrRecord()); + ASSERT_TRUE(mFilterTests.startFilter(filterId)); + + if (record.hasFrontendConnection) { + ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/)); + } else { + // Start DVR Source + mDvrTests.startPlaybackInputThread( + dvrSourceConfig.playbackInputFile, + dvrSourceConfig.settings.get()); + ASSERT_TRUE(mDvrTests.startDvrPlayback()); + } + + mDvrTests.testRecordOutput(); + mDvrTests.stopRecordThread(); + + if (record.hasFrontendConnection) { + ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/)); + } else { + mDvrTests.stopPlaybackThread(); + ASSERT_TRUE(mDvrTests.stopDvrPlayback()); + } + + ASSERT_TRUE(mFilterTests.stopFilter(filterId)); + ASSERT_TRUE(mDvrTests.stopDvrRecord()); + ASSERT_TRUE(mDvrTests.detachFilterToDvr(filter)); + ASSERT_TRUE(mFilterTests.closeFilter(filterId)); + mDvrTests.closeDvrRecord(); + + if (record.hasFrontendConnection) { + ASSERT_TRUE(mFrontendTests.closeFrontend()); + } else { + mDvrTests.closeDvrPlayback(); + } + + ASSERT_TRUE(mDemuxTests.closeDemux()); +} + +void TunerDescramblerAidlTest::scrambledBroadcastTest(set mediaFilterConfs, + FrontendConfig frontendConf, + DescramblerConfig descConfig) { + int32_t demuxId; + std::shared_ptr demux; + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + + DvrConfig dvrSourceConfig; + if (descrambling.hasFrontendConnection) { + int32_t feId; + mFrontendTests.getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + if (frontendConf.isSoftwareFe) { + mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[descrambling.dvrSoftwareFeId]); + } + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + mFrontendTests.setDemux(demux); + } else { + dvrSourceConfig = dvrMap[descrambling.dvrSourceId]; + mDvrTests.setDemux(demux); + ASSERT_TRUE(mDvrTests.openDvrInDemux(dvrSourceConfig.type, dvrSourceConfig.bufferSize)); + ASSERT_TRUE(mDvrTests.configDvrPlayback(dvrSourceConfig.settings)); + ASSERT_TRUE(mDvrTests.getDvrPlaybackMQDescriptor()); + } + + set filterIds; + int64_t filterId; + set::iterator config; + set::iterator id; + mFilterTests.setDemux(demux); + for (config = mediaFilterConfs.begin(); config != mediaFilterConfs.end(); config++) { + ASSERT_TRUE(mFilterTests.openFilterInDemux((*config).type, (*config).bufferSize)); + ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(filterId)); + ASSERT_TRUE(mFilterTests.configFilter((*config).settings, filterId)); + filterIds.insert(filterId); + } + ASSERT_TRUE(mDescramblerTests.openDescrambler(demuxId)); + vector token; + ASSERT_TRUE(mDescramblerTests.getKeyToken(descConfig.casSystemId, descConfig.provisionStr, + descConfig.hidlPvtData, token)); + mDescramblerTests.setKeyToken(token); + vector pids; + DemuxPid pid; + for (config = mediaFilterConfs.begin(); config != mediaFilterConfs.end(); config++) { + ASSERT_TRUE(mDescramblerTests.getDemuxPidFromFilterSettings((*config).type, + (*config).settings, pid)); + pids.push_back(pid); + ASSERT_TRUE(mDescramblerTests.addPid(pid, nullptr)); + } + for (id = filterIds.begin(); id != filterIds.end(); id++) { + ASSERT_TRUE(mFilterTests.startFilter(*id)); + } + + if (descrambling.hasFrontendConnection) { + // tune test + ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/)); + } else { + // Start DVR Source + mDvrTests.startPlaybackInputThread( + dvrSourceConfig.playbackInputFile, + dvrSourceConfig.settings.get()); + ASSERT_TRUE(mDvrTests.startDvrPlayback()); + } + + ASSERT_TRUE(filterDataOutputTest()); + + if (descrambling.hasFrontendConnection) { + ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/)); + } else { + mDvrTests.stopPlaybackThread(); + ASSERT_TRUE(mDvrTests.stopDvrPlayback()); + } + + for (id = filterIds.begin(); id != filterIds.end(); id++) { + ASSERT_TRUE(mFilterTests.stopFilter(*id)); + } + for (auto pid : pids) { + ASSERT_TRUE(mDescramblerTests.removePid(pid, nullptr)); + } + ASSERT_TRUE(mDescramblerTests.closeDescrambler()); + for (id = filterIds.begin(); id != filterIds.end(); id++) { + ASSERT_TRUE(mFilterTests.closeFilter(*id)); + } + + if (descrambling.hasFrontendConnection) { + ASSERT_TRUE(mFrontendTests.closeFrontend()); + } else { + mDvrTests.closeDvrPlayback(); + } + + ASSERT_TRUE(mDemuxTests.closeDemux()); +} + +TEST_P(TunerLnbAidlTest, SendDiseqcMessageToLnb) { + description("Open and configure an Lnb with specific settings then send a diseqc msg to it."); + if (!lnbLive.support) { + return; + } + if (lnbMap[lnbLive.lnbId].name.compare(emptyHardwareId) == 0) { + vector ids; + ASSERT_TRUE(mLnbTests.getLnbIds(ids)); + ASSERT_TRUE(ids.size() > 0); + ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); + } else { + int32_t id; + ASSERT_TRUE(mLnbTests.openLnbByName(lnbMap[lnbLive.lnbId].name, id)); + } + ASSERT_TRUE(mLnbTests.setLnbCallback()); + ASSERT_TRUE(mLnbTests.setVoltage(lnbMap[lnbLive.lnbId].voltage)); + ASSERT_TRUE(mLnbTests.setTone(lnbMap[lnbLive.lnbId].tone)); + ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbMap[lnbLive.lnbId].position)); + for (auto msgName : lnbLive.diseqcMsgs) { + ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgMap[msgName])); + } + ASSERT_TRUE(mLnbTests.closeLnb()); +} + +TEST_P(TunerDemuxAidlTest, openDemux) { + description("Open and close a Demux."); + if (!live.hasFrontendConnection) { + return; + } + int32_t feId; + int32_t demuxId; + std::shared_ptr demux; + mFrontendTests.getFrontendIdByType(frontendMap[live.frontendId].type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + ASSERT_TRUE(mDemuxTests.closeDemux()); + ASSERT_TRUE(mFrontendTests.closeFrontend()); +} + +TEST_P(TunerDemuxAidlTest, getAvSyncTime) { + description("Get the A/V sync time from a PCR filter."); + if (!live.hasFrontendConnection) { + return; + } + if (live.pcrFilterId.compare(emptyHardwareId) == 0) { + return; + } + int32_t feId; + int32_t demuxId; + std::shared_ptr demux; + int64_t mediaFilterId; + int64_t pcrFilterId; + int32_t avSyncHwId; + std::shared_ptr mediaFilter; + + mFrontendTests.getFrontendIdByType(frontendMap[live.frontendId].type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + mFilterTests.setDemux(demux); + ASSERT_TRUE(mFilterTests.openFilterInDemux(filterMap[live.videoFilterId].type, + filterMap[live.videoFilterId].bufferSize)); + ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(mediaFilterId)); + ASSERT_TRUE(mFilterTests.configFilter(filterMap[live.videoFilterId].settings, mediaFilterId)); + mediaFilter = mFilterTests.getFilterById(mediaFilterId); + ASSERT_TRUE(mFilterTests.openFilterInDemux(filterMap[live.pcrFilterId].type, + filterMap[live.pcrFilterId].bufferSize)); + ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(pcrFilterId)); + ASSERT_TRUE(mFilterTests.configFilter(filterMap[live.pcrFilterId].settings, pcrFilterId)); + ASSERT_TRUE(mDemuxTests.getAvSyncId(mediaFilter, avSyncHwId)); + ASSERT_TRUE(pcrFilterId == avSyncHwId); + ASSERT_TRUE(mDemuxTests.getAvSyncTime(pcrFilterId)); + ASSERT_TRUE(mFilterTests.closeFilter(pcrFilterId)); + ASSERT_TRUE(mFilterTests.closeFilter(mediaFilterId)); + ASSERT_TRUE(mDemuxTests.closeDemux()); + ASSERT_TRUE(mFrontendTests.closeFrontend()); +} + +TEST_P(TunerFilterAidlTest, StartFilterInDemux) { + description("Open and start a filter in Demux."); + if (!live.hasFrontendConnection) { + return; + } + // TODO use parameterized tests + configSingleFilterInDemuxTest(filterMap[live.videoFilterId], frontendMap[live.frontendId]); +} + +TEST_P(TunerFilterAidlTest, ConfigIpFilterInDemuxWithCid) { + description("Open and configure an ip filter in Demux."); + // TODO use parameterized tests + if (!live.hasFrontendConnection) { + return; + } + if (live.ipFilterId.compare(emptyHardwareId) == 0) { + return; + } + configSingleFilterInDemuxTest(filterMap[live.ipFilterId], frontendMap[live.frontendId]); +} + +TEST_P(TunerFilterAidlTest, ReconfigFilterToReceiveStartId) { + description("Recofigure and restart a filter to test start id."); + if (!live.hasFrontendConnection) { + return; + } + // TODO use parameterized tests + reconfigSingleFilterInDemuxTest(filterMap[live.videoFilterId], filterMap[live.videoFilterId], + frontendMap[live.frontendId]); +} + +TEST_P(TunerFilterAidlTest, SetFilterLinkage) { + description("Pick up all the possible linkages from the demux caps and set them up."); + DemuxCapabilities caps; + int32_t demuxId; + std::shared_ptr demux; + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + ASSERT_TRUE(mDemuxTests.getDemuxCaps(caps)); + mFilterTests.setDemux(demux); + for (int i = 0; i < caps.linkCaps.size(); i++) { + uint32_t bitMask = 1; + for (int j = 0; j < FILTER_MAIN_TYPE_BIT_COUNT; j++) { + if (caps.linkCaps[i] & (bitMask << j)) { + int64_t sourceFilterId; + int64_t sinkFilterId; + ASSERT_TRUE(mFilterTests.openFilterInDemux(getLinkageFilterType(i), FMQ_SIZE_16M)); + ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(sourceFilterId)); + ASSERT_TRUE(mFilterTests.openFilterInDemux(getLinkageFilterType(j), FMQ_SIZE_16M)); + ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(sinkFilterId)); + ASSERT_TRUE(mFilterTests.setFilterDataSource(sourceFilterId, sinkFilterId)); + ASSERT_TRUE(mFilterTests.setFilterDataSourceToDemux(sinkFilterId)); + ASSERT_TRUE(mFilterTests.closeFilter(sinkFilterId)); + ASSERT_TRUE(mFilterTests.closeFilter(sourceFilterId)); + } + } + } + ASSERT_TRUE(mDemuxTests.closeDemux()); +} + +TEST_P(TunerFilterAidlTest, testTimeFilter) { + description("Open a timer filter in Demux and set time stamp."); + if (!timeFilter.support) { + return; + } + // TODO use parameterized tests + testTimeFilter(timeFilterMap[timeFilter.timeFilterId]); +} + +TEST_P(TunerPlaybackAidlTest, PlaybackDataFlowWithTsSectionFilterTest) { + description("Feed ts data from playback and configure Ts section filter to get output"); + if (!playback.support || playback.sectionFilterId.compare(emptyHardwareId) == 0) { + return; + } + playbackSingleFilterTest(filterMap[playback.sectionFilterId], dvrMap[playback.dvrId]); +} + +TEST_P(TunerPlaybackAidlTest, PlaybackDataFlowWithTsAudioFilterTest) { + description("Feed ts data from playback and configure Ts audio filter to get output"); + if (!playback.support) { + return; + } + playbackSingleFilterTest(filterMap[playback.audioFilterId], dvrMap[playback.dvrId]); +} + +TEST_P(TunerPlaybackAidlTest, PlaybackDataFlowWithTsVideoFilterTest) { + description("Feed ts data from playback and configure Ts video filter to get output"); + if (!playback.support) { + return; + } + playbackSingleFilterTest(filterMap[playback.videoFilterId], dvrMap[playback.dvrId]); +} + +TEST_P(TunerRecordAidlTest, RecordDataFlowWithTsRecordFilterTest) { + description("Feed ts data from frontend to recording and test with ts record filter"); + if (!record.support) { + return; + } + recordSingleFilterTest(filterMap[record.recordFilterId], frontendMap[record.frontendId], + dvrMap[record.dvrRecordId]); +} + +TEST_P(TunerRecordAidlTest, AttachFiltersToRecordTest) { + description("Attach a single filter to the record dvr test."); + // TODO use parameterized tests + if (!record.support) { + return; + } + attachSingleFilterToRecordDvrTest(filterMap[record.recordFilterId], + frontendMap[record.frontendId], dvrMap[record.dvrRecordId]); +} + +TEST_P(TunerRecordAidlTest, LnbRecordDataFlowWithTsRecordFilterTest) { + description("Feed ts data from Fe with Lnb to recording and test with ts record filter"); + if (!lnbRecord.support) { + return; + } + recordSingleFilterTestWithLnb(filterMap[lnbRecord.recordFilterId], + frontendMap[lnbRecord.frontendId], dvrMap[lnbRecord.dvrRecordId], + lnbMap[lnbRecord.lnbId]); +} + +TEST_P(TunerFrontendAidlTest, TuneFrontend) { + description("Tune one Frontend with specific setting and check Lock event"); + if (!live.hasFrontendConnection) { + return; + } + mFrontendTests.tuneTest(frontendMap[live.frontendId]); +} + +TEST_P(TunerFrontendAidlTest, AutoScanFrontend) { + description("Run an auto frontend scan with specific setting and check lock scanMessage"); + if (!scan.hasFrontendConnection) { + return; + } + mFrontendTests.scanTest(frontendMap[scan.frontendId], FrontendScanType::SCAN_AUTO); +} + +TEST_P(TunerFrontendAidlTest, BlindScanFrontend) { + description("Run an blind frontend scan with specific setting and check lock scanMessage"); + if (!scan.hasFrontendConnection) { + return; + } + mFrontendTests.scanTest(frontendMap[scan.frontendId], FrontendScanType::SCAN_BLIND); +} + +TEST_P(TunerFrontendAidlTest, TuneFrontendWithFrontendSettings) { + description("Tune one Frontend with setting and check Lock event"); + if (!live.hasFrontendConnection) { + return; + } + mFrontendTests.tuneTest(frontendMap[live.frontendId]); +} + +TEST_P(TunerFrontendAidlTest, BlindScanFrontendWithEndFrequency) { + description("Run an blind frontend scan with setting and check lock scanMessage"); + if (!scan.hasFrontendConnection) { + return; + } + mFrontendTests.scanTest(frontendMap[scan.frontendId], FrontendScanType::SCAN_BLIND); +} + +TEST_P(TunerFrontendAidlTest, LinkToCiCam) { + description("Test Frontend link to CiCam"); + if (!live.hasFrontendConnection) { + return; + } + if (!frontendMap[live.frontendId].canConnectToCiCam) { + return; + } + mFrontendTests.tuneTest(frontendMap[live.frontendId]); +} + +TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowVideoFilterTest) { + description("Test Video Filter functionality in Broadcast use case."); + if (!live.hasFrontendConnection) { + return; + } + broadcastSingleFilterTest(filterMap[live.videoFilterId], frontendMap[live.frontendId]); +} + +TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowAudioFilterTest) { + description("Test Audio Filter functionality in Broadcast use case."); + if (!live.hasFrontendConnection) { + return; + } + broadcastSingleFilterTest(filterMap[live.audioFilterId], frontendMap[live.frontendId]); +} + +TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowSectionFilterTest) { + description("Test Section Filter functionality in Broadcast use case."); + if (!live.hasFrontendConnection) { + return; + } + if (live.sectionFilterId.compare(emptyHardwareId) == 0) { + return; + } + broadcastSingleFilterTest(filterMap[live.sectionFilterId], frontendMap[live.frontendId]); +} + +TEST_P(TunerBroadcastAidlTest, IonBufferTest) { + description("Test the av filter data bufferring."); + if (!live.hasFrontendConnection) { + return; + } + broadcastSingleFilterTest(filterMap[live.videoFilterId], frontendMap[live.frontendId]); +} + +TEST_P(TunerBroadcastAidlTest, LnbBroadcastDataFlowVideoFilterTest) { + description("Test Video Filter functionality in Broadcast with Lnb use case."); + if (!lnbLive.support) { + return; + } + broadcastSingleFilterTestWithLnb(filterMap[lnbLive.videoFilterId], + frontendMap[lnbLive.frontendId], lnbMap[lnbLive.lnbId]); +} + +TEST_P(TunerBroadcastAidlTest, MediaFilterWithSharedMemoryHandle) { + description("Test the Media Filter with shared memory handle"); + if (!live.hasFrontendConnection) { + return; + } + mediaFilterUsingSharedMemoryTest(filterMap[live.videoFilterId], frontendMap[live.frontendId]); +} + +TEST_P(TunerDescramblerAidlTest, CreateDescrambler) { + description("Create Descrambler"); + if (!descrambling.support) { + return; + } + int32_t demuxId; + std::shared_ptr demux; + ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + + if (descrambling.hasFrontendConnection) { + int32_t feId; + mFrontendTests.getFrontendIdByType(frontendMap[descrambling.frontendId].type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); + ASSERT_TRUE(mFrontendTests.setFrontendCallback()); + ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); + } + + ASSERT_TRUE(mDescramblerTests.openDescrambler(demuxId)); + ASSERT_TRUE(mDescramblerTests.closeDescrambler()); + ASSERT_TRUE(mDemuxTests.closeDemux()); + + if (descrambling.hasFrontendConnection) { + ASSERT_TRUE(mFrontendTests.closeFrontend()); + } +} + +TEST_P(TunerDescramblerAidlTest, ScrambledBroadcastDataFlowMediaFiltersTest) { + description("Test ts audio filter in scrambled broadcast use case"); + if (!descrambling.support) { + return; + } + set filterConfs; + filterConfs.insert(static_cast(filterMap[descrambling.audioFilterId])); + filterConfs.insert(static_cast(filterMap[descrambling.videoFilterId])); + scrambledBroadcastTest(filterConfs, frontendMap[descrambling.frontendId], + descramblerMap[descrambling.descramblerId]); +} + +INSTANTIATE_TEST_SUITE_P(PerInstance, TunerBroadcastAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(ITuner::descriptor)), + android::PrintInstanceNameToString); + +INSTANTIATE_TEST_SUITE_P(PerInstance, TunerFrontendAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(ITuner::descriptor)), + android::PrintInstanceNameToString); + +INSTANTIATE_TEST_SUITE_P(PerInstance, TunerFilterAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(ITuner::descriptor)), + android::PrintInstanceNameToString); + +INSTANTIATE_TEST_SUITE_P(PerInstance, TunerRecordAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(ITuner::descriptor)), + android::PrintInstanceNameToString); + +INSTANTIATE_TEST_SUITE_P(PerInstance, TunerLnbAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(ITuner::descriptor)), + android::PrintInstanceNameToString); + +INSTANTIATE_TEST_SUITE_P(PerInstance, TunerDemuxAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(ITuner::descriptor)), + android::PrintInstanceNameToString); + +INSTANTIATE_TEST_SUITE_P(PerInstance, TunerPlaybackAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(ITuner::descriptor)), + android::PrintInstanceNameToString); + +INSTANTIATE_TEST_SUITE_P(PerInstance, TunerDescramblerAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(ITuner::descriptor)), + android::PrintInstanceNameToString); + +} // namespace + +// Start thread pool to receive callbacks from AIDL service. +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + ABinderProcess_setThreadPoolMaxThreadCount(1); + ABinderProcess_startThreadPool(); + return RUN_ALL_TESTS(); +} diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h new file mode 100644 index 0000000000..e5cee76a3f --- /dev/null +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h @@ -0,0 +1,372 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "DemuxTests.h" +#include "DescramblerTests.h" +#include "DvrTests.h" +#include "FrontendTests.h" +#include "LnbTests.h" + +using android::sp; + +namespace { + +bool initConfiguration() { + TunerTestingConfigAidlReader1_0::setConfigFilePath(configFilePath); + if (!TunerTestingConfigAidlReader1_0::checkConfigFileExists()) { + return false; + } + initFrontendConfig(); + initFilterConfig(); + initDvrConfig(); + connectHardwaresToTestCases(); + if (!validateConnections()) { + ALOGW("[vts] failed to validate connections."); + return false; + } + return true; +} + +static AssertionResult success() { + return ::testing::AssertionSuccess(); +} + +AssertionResult filterDataOutputTestBase(FilterTests& tests) { + // Data Verify Module + std::map>::iterator it; + std::map> filterCallbacks = tests.getFilterCallbacks(); + for (it = filterCallbacks.begin(); it != filterCallbacks.end(); it++) { + it->second->testFilterDataOutput(); + } + return success(); +} + +class TunerLnbAidlTest : public testing::TestWithParam { + public: + virtual void SetUp() override { + if (AServiceManager_isDeclared(GetParam().c_str())) { + ::ndk::SpAIBinder binder(AServiceManager_waitForService(GetParam().c_str())); + mService = ITuner::fromBinder(binder); + } else { + mService = nullptr; + } + ASSERT_NE(mService, nullptr); + ASSERT_TRUE(initConfiguration()); + + mLnbTests.setService(mService); + } + + protected: + static void description(const std::string& description) { + RecordProperty("description", description); + } + + std::shared_ptr mService; + LnbTests mLnbTests; +}; + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TunerLnbAidlTest); + +class TunerDemuxAidlTest : public testing::TestWithParam { + public: + virtual void SetUp() override { + if (AServiceManager_isDeclared(GetParam().c_str())) { + ::ndk::SpAIBinder binder(AServiceManager_waitForService(GetParam().c_str())); + mService = ITuner::fromBinder(binder); + } else { + mService = nullptr; + } + ASSERT_NE(mService, nullptr); + ASSERT_TRUE(initConfiguration()); + + mFrontendTests.setService(mService); + mDemuxTests.setService(mService); + mFilterTests.setService(mService); + } + + protected: + static void description(const std::string& description) { + RecordProperty("description", description); + } + + std::shared_ptr mService; + FrontendTests mFrontendTests; + DemuxTests mDemuxTests; + FilterTests mFilterTests; +}; + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TunerDemuxAidlTest); + +class TunerFilterAidlTest : public testing::TestWithParam { + public: + virtual void SetUp() override { + if (AServiceManager_isDeclared(GetParam().c_str())) { + ::ndk::SpAIBinder binder(AServiceManager_waitForService(GetParam().c_str())); + mService = ITuner::fromBinder(binder); + } else { + mService = nullptr; + } + ASSERT_NE(mService, nullptr); + initConfiguration(); + + mFrontendTests.setService(mService); + mDemuxTests.setService(mService); + mFilterTests.setService(mService); + } + + protected: + static void description(const std::string& description) { + RecordProperty("description", description); + } + + void configSingleFilterInDemuxTest(FilterConfig filterConf, FrontendConfig frontendConf); + void reconfigSingleFilterInDemuxTest(FilterConfig filterConf, FilterConfig filterReconf, + FrontendConfig frontendConf); + void testTimeFilter(TimeFilterConfig filterConf); + + DemuxFilterType getLinkageFilterType(int bit) { + DemuxFilterType type; + type.mainType = static_cast(1 << bit); + switch (type.mainType) { + case DemuxFilterMainType::TS: + type.subType.set( + DemuxTsFilterType::UNDEFINED); + break; + case DemuxFilterMainType::MMTP: + type.subType.set( + DemuxMmtpFilterType::UNDEFINED); + break; + case DemuxFilterMainType::IP: + type.subType.set( + DemuxIpFilterType::UNDEFINED); + break; + case DemuxFilterMainType::TLV: + type.subType.set( + DemuxTlvFilterType::UNDEFINED); + break; + case DemuxFilterMainType::ALP: + type.subType.set( + DemuxAlpFilterType::UNDEFINED); + break; + default: + break; + } + return type; + } + std::shared_ptr mService; + FrontendTests mFrontendTests; + DemuxTests mDemuxTests; + FilterTests mFilterTests; +}; + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TunerFilterAidlTest); + +class TunerPlaybackAidlTest : public testing::TestWithParam { + public: + virtual void SetUp() override { + if (AServiceManager_isDeclared(GetParam().c_str())) { + ::ndk::SpAIBinder binder(AServiceManager_waitForService(GetParam().c_str())); + mService = ITuner::fromBinder(binder); + } else { + mService = nullptr; + } + ASSERT_NE(mService, nullptr); + ASSERT_TRUE(initConfiguration()); + + mFrontendTests.setService(mService); + mDemuxTests.setService(mService); + mFilterTests.setService(mService); + mDvrTests.setService(mService); + } + + protected: + static void description(const std::string& description) { + RecordProperty("description", description); + } + + std::shared_ptr mService; + FrontendTests mFrontendTests; + DemuxTests mDemuxTests; + FilterTests mFilterTests; + DvrTests mDvrTests; + + AssertionResult filterDataOutputTest(); + + void playbackSingleFilterTest(FilterConfig filterConf, DvrConfig dvrConf); +}; + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TunerPlaybackAidlTest); + +class TunerRecordAidlTest : public testing::TestWithParam { + public: + virtual void SetUp() override { + if (AServiceManager_isDeclared(GetParam().c_str())) { + ::ndk::SpAIBinder binder(AServiceManager_waitForService(GetParam().c_str())); + mService = ITuner::fromBinder(binder); + } else { + mService = nullptr; + } + ASSERT_NE(mService, nullptr); + initConfiguration(); + + mFrontendTests.setService(mService); + mDemuxTests.setService(mService); + mFilterTests.setService(mService); + mDvrTests.setService(mService); + mLnbTests.setService(mService); + } + + protected: + static void description(const std::string& description) { + RecordProperty("description", description); + } + + void attachSingleFilterToRecordDvrTest(FilterConfig filterConf, FrontendConfig frontendConf, + DvrConfig dvrConf); + void recordSingleFilterTestWithLnb(FilterConfig filterConf, FrontendConfig frontendConf, + DvrConfig dvrConf, LnbConfig lnbConf); + void recordSingleFilterTest(FilterConfig filterConf, FrontendConfig frontendConf, + DvrConfig dvrConf); + + std::shared_ptr mService; + FrontendTests mFrontendTests; + DemuxTests mDemuxTests; + FilterTests mFilterTests; + DvrTests mDvrTests; + LnbTests mLnbTests; + + private: + int32_t* mLnbId = nullptr; +}; + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TunerRecordAidlTest); + +class TunerFrontendAidlTest : public testing::TestWithParam { + public: + virtual void SetUp() override { + if (AServiceManager_isDeclared(GetParam().c_str())) { + ::ndk::SpAIBinder binder(AServiceManager_waitForService(GetParam().c_str())); + mService = ITuner::fromBinder(binder); + } else { + mService = nullptr; + } + ASSERT_NE(mService, nullptr); + initConfiguration(); + + mFrontendTests.setService(mService); + } + + protected: + static void description(const std::string& description) { + RecordProperty("description", description); + } + + std::shared_ptr mService; + FrontendTests mFrontendTests; +}; + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TunerFrontendAidlTest); + +class TunerBroadcastAidlTest : public testing::TestWithParam { + public: + virtual void SetUp() override { + if (AServiceManager_isDeclared(GetParam().c_str())) { + ::ndk::SpAIBinder binder(AServiceManager_waitForService(GetParam().c_str())); + mService = ITuner::fromBinder(binder); + } else { + mService = nullptr; + } + ASSERT_NE(mService, nullptr); + initConfiguration(); + + mFrontendTests.setService(mService); + mDemuxTests.setService(mService); + mFilterTests.setService(mService); + mLnbTests.setService(mService); + mDvrTests.setService(mService); + } + + protected: + static void description(const std::string& description) { + RecordProperty("description", description); + } + + std::shared_ptr mService; + FrontendTests mFrontendTests; + DemuxTests mDemuxTests; + FilterTests mFilterTests; + LnbTests mLnbTests; + DvrTests mDvrTests; + + AssertionResult filterDataOutputTest(); + + void broadcastSingleFilterTest(FilterConfig filterConf, FrontendConfig frontendConf); + void broadcastSingleFilterTestWithLnb(FilterConfig filterConf, FrontendConfig frontendConf, + LnbConfig lnbConf); + void mediaFilterUsingSharedMemoryTest(FilterConfig filterConf, FrontendConfig frontendConf); + + private: + int32_t* mLnbId = nullptr; +}; + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TunerBroadcastAidlTest); + +class TunerDescramblerAidlTest : public testing::TestWithParam { + public: + virtual void SetUp() override { + if (AServiceManager_isDeclared(GetParam().c_str())) { + ::ndk::SpAIBinder binder(AServiceManager_waitForService(GetParam().c_str())); + mService = ITuner::fromBinder(binder); + } else { + mService = nullptr; + } + mCasService = IMediaCasService::getService(); + ASSERT_NE(mService, nullptr); + ASSERT_NE(mCasService, nullptr); + ASSERT_TRUE(initConfiguration()); + + mFrontendTests.setService(mService); + mDemuxTests.setService(mService); + mDvrTests.setService(mService); + mDescramblerTests.setService(mService); + mDescramblerTests.setCasService(mCasService); + } + + protected: + static void description(const std::string& description) { + RecordProperty("description", description); + } + + void scrambledBroadcastTest(set mediaFilterConfs, + FrontendConfig frontendConf, DescramblerConfig descConfig); + AssertionResult filterDataOutputTest(); + + std::shared_ptr mService; + android::sp mCasService; + FrontendTests mFrontendTests; + DemuxTests mDemuxTests; + FilterTests mFilterTests; + DescramblerTests mDescramblerTests; + DvrTests mDvrTests; +}; + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TunerDescramblerAidlTest); + +} // namespace diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h new file mode 100644 index 0000000000..1ddb641979 --- /dev/null +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h @@ -0,0 +1,220 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "../../../config/TunerTestingConfigAidlReaderV1_0.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; +using namespace aidl::android::hardware::tv::tuner; +using namespace android::media::tuner::testing::configuration::V1_0; + +const int32_t FMQ_SIZE_4M = 0x400000; +const int32_t FMQ_SIZE_16M = 0x1000000; + +const string configFilePath = "/vendor/etc/tuner_vts_config_1_1.xml"; + +#define FILTER_MAIN_TYPE_BIT_COUNT 5 + +// Hardware configs +static map frontendMap; +static map filterMap; +static map dvrMap; +static map lnbMap; +static map timeFilterMap; +static map> diseqcMsgMap; +static map descramblerMap; + +// Hardware and test cases connections +static LiveBroadcastHardwareConnections live; +static ScanHardwareConnections scan; +static DvrPlaybackHardwareConnections playback; +static DvrRecordHardwareConnections record; +static DescramblingHardwareConnections descrambling; +static LnbLiveHardwareConnections lnbLive; +static LnbRecordHardwareConnections lnbRecord; +static TimeFilterHardwareConnections timeFilter; + +/** Config all the frontends that would be used in the tests */ +inline void initFrontendConfig() { + // The test will use the internal default fe when default fe is connected to any data flow + // without overriding in the xml config. + string defaultFeId = "FE_DEFAULT"; + FrontendDvbtSettings dvbtSettings{ + .frequency = 578000, + .transmissionMode = FrontendDvbtTransmissionMode::AUTO, + .bandwidth = FrontendDvbtBandwidth::BANDWIDTH_8MHZ, + .isHighPriority = true, + }; + frontendMap[defaultFeId].type = FrontendType::DVBT; + frontendMap[defaultFeId].settings.set(dvbtSettings); + + vector types; + types.push_back(FrontendStatusType::UEC); + types.push_back(FrontendStatusType::IS_MISO); + + vector statuses; + FrontendStatus status; + status.set(4); + statuses.push_back(status); + status.set(true); + statuses.push_back(status); + + frontendMap[defaultFeId].tuneStatusTypes = types; + frontendMap[defaultFeId].expectTuneStatuses = statuses; + frontendMap[defaultFeId].isSoftwareFe = true; + frontendMap[defaultFeId].canConnectToCiCam = true; + frontendMap[defaultFeId].ciCamId = 0; + FrontendDvbtSettings dvbt; + dvbt.transmissionMode = FrontendDvbtTransmissionMode::MODE_8K_E; + frontendMap[defaultFeId].settings.set(dvbt); + // Read customized config + TunerTestingConfigAidlReader1_0::readFrontendConfig1_0(frontendMap); +}; + +inline void initFilterConfig() { + // The test will use the internal default filter when default filter is connected to any + // data flow without overriding in the xml config. + string defaultAudioFilterId = "FILTER_AUDIO_DEFAULT"; + string defaultVideoFilterId = "FILTER_VIDEO_DEFAULT"; + + filterMap[defaultVideoFilterId].type.mainType = DemuxFilterMainType::TS; + filterMap[defaultVideoFilterId] + .type.subType.set( + DemuxTsFilterType::VIDEO); + filterMap[defaultVideoFilterId].bufferSize = FMQ_SIZE_16M; + filterMap[defaultVideoFilterId].settings = + DemuxFilterSettings::make(); + filterMap[defaultVideoFilterId].settings.get().tpid = 256; + DemuxFilterAvSettings video; + video.isPassthrough = false; + filterMap[defaultVideoFilterId] + .settings.get() + .filterSettings.set(video); + filterMap[defaultVideoFilterId].monitorEventTypes = + static_cast(DemuxFilterMonitorEventType::SCRAMBLING_STATUS) | + static_cast(DemuxFilterMonitorEventType::IP_CID_CHANGE); + filterMap[defaultVideoFilterId].streamType.set( + VideoStreamType::MPEG1); + + filterMap[defaultAudioFilterId].type.mainType = DemuxFilterMainType::TS; + filterMap[defaultAudioFilterId] + .type.subType.set( + DemuxTsFilterType::AUDIO); + filterMap[defaultAudioFilterId].bufferSize = FMQ_SIZE_16M; + filterMap[defaultAudioFilterId].settings = + DemuxFilterSettings::make(); + filterMap[defaultAudioFilterId].settings.get().tpid = 256; + DemuxFilterAvSettings audio; + audio.isPassthrough = false; + filterMap[defaultAudioFilterId] + .settings.get() + .filterSettings.set(audio); + filterMap[defaultAudioFilterId].monitorEventTypes = + static_cast(DemuxFilterMonitorEventType::SCRAMBLING_STATUS) | + static_cast(DemuxFilterMonitorEventType::IP_CID_CHANGE); + filterMap[defaultAudioFilterId].streamType.set(AudioStreamType::MP3); + // Read customized config + TunerTestingConfigAidlReader1_0::readFilterConfig1_0(filterMap); +}; + +/** Config all the dvrs that would be used in the tests */ +inline void initDvrConfig() { + // Read customized config + TunerTestingConfigAidlReader1_0::readDvrConfig1_0(dvrMap); +}; + +/** Read the vendor configurations of which hardware to use for each test cases/data flows */ +inline void connectHardwaresToTestCases() { + TunerTestingConfigAidlReader1_0::connectLiveBroadcast(live); + TunerTestingConfigAidlReader1_0::connectScan(scan); + TunerTestingConfigAidlReader1_0::connectDvrRecord(record); +}; + +inline bool validateConnections() { + if (record.support && !record.hasFrontendConnection && + record.dvrSourceId.compare(emptyHardwareId) == 0) { + ALOGW("[vts config] Record must support either a DVR source or a Frontend source."); + return false; + } + bool feIsValid = frontendMap.find(live.frontendId) != frontendMap.end() && + frontendMap.find(scan.frontendId) != frontendMap.end(); + feIsValid &= record.support ? frontendMap.find(record.frontendId) != frontendMap.end() : true; + + if (!feIsValid) { + ALOGW("[vts config] dynamic config fe connection is invalid."); + return false; + } + + bool dvrIsValid = frontendMap[live.frontendId].isSoftwareFe + ? dvrMap.find(live.dvrSoftwareFeId) != dvrMap.end() + : true; + + if (record.support) { + if (record.hasFrontendConnection) { + if (frontendMap[record.frontendId].isSoftwareFe) { + dvrIsValid &= dvrMap.find(record.dvrSoftwareFeId) != dvrMap.end(); + } + } else { + dvrIsValid &= dvrMap.find(record.dvrSourceId) != dvrMap.end(); + } + dvrIsValid &= dvrMap.find(record.dvrRecordId) != dvrMap.end(); + } + + if (!dvrIsValid) { + ALOGW("[vts config] dynamic config dvr connection is invalid."); + return false; + } + + bool filterIsValid = filterMap.find(live.audioFilterId) != filterMap.end() && + filterMap.find(live.videoFilterId) != filterMap.end(); + filterIsValid &= + record.support ? filterMap.find(record.recordFilterId) != filterMap.end() : true; + + if (!filterIsValid) { + ALOGW("[vts config] dynamic config filter connection is invalid."); + return false; + } + + return true; +} diff --git a/tv/tuner/config/OWNERS b/tv/tuner/config/OWNERS index 1b3d095f9c..bf2b609f3e 100644 --- a/tv/tuner/config/OWNERS +++ b/tv/tuner/config/OWNERS @@ -1,4 +1,3 @@ -nchalko@google.com -amyjojo@google.com +hgchen@google.com shubang@google.com quxiangfang@google.com diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h new file mode 100644 index 0000000000..8525b4fd18 --- /dev/null +++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h @@ -0,0 +1,1000 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; +using namespace aidl::android::hardware::tv::tuner; +using namespace android::media::tuner::testing::configuration::V1_0; + +const string emptyHardwareId = ""; + +static string mConfigFilePath; + +#define PROVISION_STR \ + "{ " \ + " \"id\": 21140844, " \ + " \"name\": \"Test Title\", " \ + " \"lowercase_organization_name\": \"Android\", " \ + " \"asset_key\": { " \ + " \"encryption_key\": \"nezAr3CHFrmBR9R8Tedotw==\" " \ + " }, " \ + " \"cas_type\": 1, " \ + " \"track_types\": [ ] " \ + "} " + +struct FrontendConfig { + bool isSoftwareFe; + FrontendType type; + bool canConnectToCiCam; + int32_t ciCamId; + FrontendSettings settings; + vector tuneStatusTypes; + vector expectTuneStatuses; +}; + +struct FilterConfig { + int32_t bufferSize; + DemuxFilterType type; + DemuxFilterSettings settings; + bool getMqDesc; + AvStreamType streamType; + int32_t ipCid; + int32_t monitorEventTypes; + + bool operator<(const FilterConfig& /*c*/) const { return false; } +}; + +struct DvrConfig { + DvrType type; + int32_t bufferSize; + DvrSettings settings; + string playbackInputFile; +}; + +struct LnbConfig { + string name; + LnbVoltage voltage; + LnbTone tone; + LnbPosition position; +}; + +struct TimeFilterConfig { + int64_t timeStamp; +}; + +struct DescramblerConfig { + int32_t casSystemId; + string provisionStr; + vector hidlPvtData; +}; + +struct LiveBroadcastHardwareConnections { + bool hasFrontendConnection; + string frontendId; + string dvrSoftwareFeId; + string audioFilterId; + string videoFilterId; + string sectionFilterId; + string ipFilterId; + string pcrFilterId; + /* list string of extra filters; */ +}; + +struct ScanHardwareConnections { + bool hasFrontendConnection; + string frontendId; +}; + +struct DvrPlaybackHardwareConnections { + bool support; + string frontendId; + string dvrId; + string audioFilterId; + string videoFilterId; + string sectionFilterId; + /* list string of extra filters; */ +}; + +struct DvrRecordHardwareConnections { + bool support; + bool hasFrontendConnection; + string frontendId; + string dvrRecordId; + string dvrSoftwareFeId; + string recordFilterId; + string dvrSourceId; +}; + +struct DescramblingHardwareConnections { + bool support; + bool hasFrontendConnection; + string frontendId; + string dvrSoftwareFeId; + string audioFilterId; + string videoFilterId; + string descramblerId; + string dvrSourceId; + /* list string of extra filters; */ +}; + +struct LnbLiveHardwareConnections { + bool support; + string frontendId; + string audioFilterId; + string videoFilterId; + string lnbId; + vector diseqcMsgs; + /* list string of extra filters; */ +}; + +struct LnbRecordHardwareConnections { + bool support; + string frontendId; + string dvrRecordId; + string recordFilterId; + string lnbId; + vector diseqcMsgs; + /* list string of extra filters; */ +}; + +struct TimeFilterHardwareConnections { + bool support; + string timeFilterId; +}; + +struct TunerTestingConfigAidlReader1_0 { + public: + static void setConfigFilePath(string path) { mConfigFilePath = path; } + + static bool checkConfigFileExists() { + auto res = read(mConfigFilePath.c_str()); + if (res == nullopt) { + ALOGW("[ConfigReader] Couldn't read %s." + "Please check tuner_testing_dynamic_configuration.xsd" + "and sample_tuner_vts_config.xml for more details on how to config Tune VTS.", + mConfigFilePath.c_str()); + } + return (res != nullopt); + } + + static TunerConfiguration getTunerConfig() { return *read(mConfigFilePath.c_str()); } + + static DataFlowConfiguration getDataFlowConfiguration() { + return *getTunerConfig().getFirstDataFlowConfiguration(); + } + + static HardwareConfiguration getHardwareConfig() { + return *getTunerConfig().getFirstHardwareConfiguration(); + } + + static void readFrontendConfig1_0(map& frontendMap) { + auto hardwareConfig = getHardwareConfig(); + if (hardwareConfig.hasFrontends()) { + // TODO: b/182519645 complete the tune status config + vector types; + vector statuses; + + types.push_back(FrontendStatusType::DEMOD_LOCK); + types.push_back(FrontendStatusType::UEC); + types.push_back(FrontendStatusType::IS_MISO); + + FrontendStatus status; + status.set(true); + statuses.push_back(status); + status.set(4); + statuses.push_back(status); + status.set(true); + statuses.push_back(status); + + auto frontends = *hardwareConfig.getFirstFrontends(); + for (auto feConfig : frontends.getFrontend()) { + string id = feConfig.getId(); + if (id.compare(string("FE_DEFAULT")) == 0) { + // overrid default + frontendMap.erase(string("FE_DEFAULT")); + } + FrontendType type; + switch (feConfig.getType()) { + case FrontendTypeEnum::UNDEFINED: + type = FrontendType::UNDEFINED; + break; + // TODO: b/182519645 finish all other frontend settings + case FrontendTypeEnum::ANALOG: + type = FrontendType::ANALOG; + break; + case FrontendTypeEnum::ATSC: + type = FrontendType::ATSC; + break; + case FrontendTypeEnum::ATSC3: + type = FrontendType::ATSC3; + break; + case FrontendTypeEnum::DVBC: + type = FrontendType::DVBC; + break; + case FrontendTypeEnum::DVBS: + type = FrontendType::DVBS; + frontendMap[id].settings.set( + readDvbsFrontendSettings(feConfig)); + break; + case FrontendTypeEnum::DVBT: { + type = FrontendType::DVBT; + frontendMap[id].settings.set( + readDvbtFrontendSettings(feConfig)); + break; + } + case FrontendTypeEnum::ISDBS: + type = FrontendType::ISDBS; + break; + case FrontendTypeEnum::ISDBS3: + type = FrontendType::ISDBS3; + break; + case FrontendTypeEnum::ISDBT: + type = FrontendType::ISDBT; + break; + case FrontendTypeEnum::DTMB: + type = FrontendType::DTMB; + break; + case FrontendTypeEnum::UNKNOWN: + ALOGW("[ConfigReader] invalid frontend type"); + return; + default: + ALOGW("[ConfigReader] fe already handled in 1_0 reader."); + break; + } + frontendMap[id].type = type; + frontendMap[id].isSoftwareFe = feConfig.getIsSoftwareFrontend(); + // TODO: b/182519645 complete the tune status config + frontendMap[id].tuneStatusTypes = types; + frontendMap[id].expectTuneStatuses = statuses; + getCiCamInfo(feConfig, frontendMap[id].canConnectToCiCam, frontendMap[id].ciCamId); + } + } + } + + static void readFilterConfig1_0(map& filterMap) { + auto hardwareConfig = getHardwareConfig(); + if (hardwareConfig.hasFilters()) { + auto filters = *hardwareConfig.getFirstFilters(); + for (auto filterConfig : filters.getFilter()) { + string id = filterConfig.getId(); + if (id.compare(string("FILTER_AUDIO_DEFAULT")) == 0) { + // overrid default + filterMap.erase(string("FILTER_AUDIO_DEFAULT")); + } + if (id.compare(string("FILTER_VIDEO_DEFAULT")) == 0) { + // overrid default + filterMap.erase(string("FILTER_VIDEO_DEFAULT")); + } + + DemuxFilterType type; + DemuxFilterSettings settings; + if (!readFilterTypeAndSettings(filterConfig, type, settings)) { + ALOGW("[ConfigReader] invalid filter type"); + return; + } + filterMap[id].type = type; + filterMap[id].bufferSize = filterConfig.getBufferSize(); + filterMap[id].getMqDesc = filterConfig.getUseFMQ(); + filterMap[id].settings = settings; + + if (filterConfig.hasMonitorEventTypes()) { + filterMap[id].monitorEventTypes = (uint32_t)filterConfig.getMonitorEventTypes(); + } + if (filterConfig.hasAvFilterSettings_optional()) { + auto av = filterConfig.getFirstAvFilterSettings_optional(); + if (av->hasAudioStreamType_optional()) { + filterMap[id].streamType.set( + static_cast(av->getAudioStreamType_optional())); + } + if (av->hasVideoStreamType_optional()) { + filterMap[id].streamType.set( + static_cast(av->getVideoStreamType_optional())); + } + } + if (filterConfig.hasIpFilterConfig_optional()) { + auto ip = filterConfig.getFirstIpFilterConfig_optional(); + if (ip->hasIpCid()) { + filterMap[id].ipCid = ip->getIpCid(); + } + } + } + } + } + + static void readDvrConfig1_0(map& dvrMap) { + auto hardwareConfig = getHardwareConfig(); + if (hardwareConfig.hasDvrs()) { + auto dvrs = *hardwareConfig.getFirstDvrs(); + for (auto dvrConfig : dvrs.getDvr()) { + string id = dvrConfig.getId(); + DvrType type; + switch (dvrConfig.getType()) { + case DvrTypeEnum::PLAYBACK: + type = DvrType::PLAYBACK; + dvrMap[id].settings.set( + readPlaybackSettings(dvrConfig)); + break; + case DvrTypeEnum::RECORD: + type = DvrType::RECORD; + dvrMap[id].settings.set( + readRecordSettings(dvrConfig)); + break; + case DvrTypeEnum::UNKNOWN: + ALOGW("[ConfigReader] invalid DVR type"); + return; + } + dvrMap[id].type = type; + dvrMap[id].bufferSize = static_cast(dvrConfig.getBufferSize()); + if (dvrConfig.hasInputFilePath()) { + dvrMap[id].playbackInputFile = dvrConfig.getInputFilePath(); + } + } + } + } + + static void readLnbConfig1_0(map& lnbMap) { + auto hardwareConfig = getHardwareConfig(); + if (hardwareConfig.hasLnbs()) { + auto lnbs = *hardwareConfig.getFirstLnbs(); + for (auto lnbConfig : lnbs.getLnb()) { + string id = lnbConfig.getId(); + if (lnbConfig.hasName()) { + lnbMap[id].name = lnbConfig.getName(); + } else { + lnbMap[id].name = emptyHardwareId; + } + lnbMap[id].voltage = static_cast(lnbConfig.getVoltage()); + lnbMap[id].tone = static_cast(lnbConfig.getTone()); + lnbMap[id].position = static_cast(lnbConfig.getPosition()); + } + } + } + + static void readDescramblerConfig1_0(map& descramblerMap) { + auto hardwareConfig = getHardwareConfig(); + if (hardwareConfig.hasDescramblers()) { + auto descramblers = *hardwareConfig.getFirstDescramblers(); + for (auto descramblerConfig : descramblers.getDescrambler()) { + string id = descramblerConfig.getId(); + descramblerMap[id].casSystemId = + static_cast(descramblerConfig.getCasSystemId()); + if (descramblerConfig.hasProvisionStr()) { + descramblerMap[id].provisionStr = descramblerConfig.getProvisionStr(); + } else { + descramblerMap[id].provisionStr = PROVISION_STR; + } + if (descramblerConfig.hasSesstionPrivatData()) { + auto privateData = descramblerConfig.getSesstionPrivatData(); + int size = privateData.size(); + descramblerMap[id].hidlPvtData.resize(size); + memcpy(descramblerMap[id].hidlPvtData.data(), privateData.data(), size); + } else { + descramblerMap[id].hidlPvtData.resize(256); + } + } + } + } + + static void readDiseqcMessages(map>& diseqcMsgMap) { + auto hardwareConfig = getHardwareConfig(); + if (hardwareConfig.hasDiseqcMessages()) { + auto msgs = *hardwareConfig.getFirstDiseqcMessages(); + for (auto msgConfig : msgs.getDiseqcMessage()) { + string name = msgConfig.getMsgName(); + for (uint8_t atom : msgConfig.getMsgBody()) { + diseqcMsgMap[name].push_back(atom); + } + } + } + } + + static void readTimeFilterConfig1_0(map& timeFilterMap) { + auto hardwareConfig = getHardwareConfig(); + if (hardwareConfig.hasTimeFilters()) { + auto timeFilters = *hardwareConfig.getFirstTimeFilters(); + for (auto timeFilterConfig : timeFilters.getTimeFilter()) { + string id = timeFilterConfig.getId(); + timeFilterMap[id].timeStamp = + static_cast(timeFilterConfig.getTimeStamp()); + } + } + } + + static void connectLiveBroadcast(LiveBroadcastHardwareConnections& live) { + auto dataFlow = getDataFlowConfiguration(); + if (dataFlow.hasClearLiveBroadcast()) { + live.hasFrontendConnection = true; + } else { + live.hasFrontendConnection = false; + return; + } + auto liveConfig = *dataFlow.getFirstClearLiveBroadcast(); + live.frontendId = liveConfig.getFrontendConnection(); + + live.audioFilterId = liveConfig.getAudioFilterConnection(); + live.videoFilterId = liveConfig.getVideoFilterConnection(); + if (liveConfig.hasPcrFilterConnection()) { + live.pcrFilterId = liveConfig.getPcrFilterConnection(); + } else { + live.pcrFilterId = emptyHardwareId; + } + if (liveConfig.hasSectionFilterConnection()) { + live.sectionFilterId = liveConfig.getSectionFilterConnection(); + } else { + live.sectionFilterId = emptyHardwareId; + } + if (liveConfig.hasDvrSoftwareFeConnection()) { + live.dvrSoftwareFeId = liveConfig.getDvrSoftwareFeConnection(); + } + if (liveConfig.hasIpFilterConnection()) { + live.ipFilterId = liveConfig.getIpFilterConnection(); + } else { + live.ipFilterId = emptyHardwareId; + } + } + + static void connectScan(ScanHardwareConnections& scan) { + auto dataFlow = getDataFlowConfiguration(); + if (dataFlow.hasScan()) { + scan.hasFrontendConnection = true; + } else { + scan.hasFrontendConnection = false; + return; + } + auto scanConfig = *dataFlow.getFirstScan(); + scan.frontendId = scanConfig.getFrontendConnection(); + } + + static void connectDvrPlayback(DvrPlaybackHardwareConnections& playback) { + auto dataFlow = getDataFlowConfiguration(); + if (dataFlow.hasDvrPlayback()) { + playback.support = true; + } else { + playback.support = false; + return; + } + auto playbackConfig = *dataFlow.getFirstDvrPlayback(); + playback.dvrId = playbackConfig.getDvrConnection(); + playback.audioFilterId = playbackConfig.getAudioFilterConnection(); + playback.videoFilterId = playbackConfig.getVideoFilterConnection(); + if (playbackConfig.hasSectionFilterConnection()) { + playback.sectionFilterId = playbackConfig.getSectionFilterConnection(); + } else { + playback.sectionFilterId = emptyHardwareId; + } + } + + static void connectDvrRecord(DvrRecordHardwareConnections& record) { + auto dataFlow = getDataFlowConfiguration(); + if (dataFlow.hasDvrRecord()) { + record.support = true; + } else { + record.support = false; + return; + } + auto recordConfig = *dataFlow.getFirstDvrRecord(); + record.recordFilterId = recordConfig.getRecordFilterConnection(); + record.dvrRecordId = recordConfig.getDvrRecordConnection(); + if (recordConfig.hasDvrSoftwareFeConnection()) { + record.dvrSoftwareFeId = recordConfig.getDvrSoftwareFeConnection(); + } + if (recordConfig.getHasFrontendConnection()) { + record.hasFrontendConnection = true; + record.dvrSourceId = emptyHardwareId; + record.frontendId = recordConfig.getFrontendConnection(); + } else { + record.hasFrontendConnection = false; + record.dvrSourceId = recordConfig.getDvrSourceConnection(); + } + } + + static void connectDescrambling(DescramblingHardwareConnections& descrambling) { + auto dataFlow = getDataFlowConfiguration(); + if (dataFlow.hasDescrambling()) { + descrambling.support = true; + } else { + descrambling.support = false; + return; + } + auto descConfig = *dataFlow.getFirstDescrambling(); + descrambling.descramblerId = descConfig.getDescramblerConnection(); + descrambling.audioFilterId = descConfig.getAudioFilterConnection(); + descrambling.videoFilterId = descConfig.getVideoFilterConnection(); + if (descConfig.hasDvrSoftwareFeConnection()) { + descrambling.dvrSoftwareFeId = descConfig.getDvrSoftwareFeConnection(); + } + if (descConfig.getHasFrontendConnection()) { + descrambling.hasFrontendConnection = true; + descrambling.dvrSourceId = emptyHardwareId; + descrambling.frontendId = descConfig.getFrontendConnection(); + } else { + descrambling.hasFrontendConnection = false; + descrambling.dvrSourceId = descConfig.getDvrSourceConnection(); + } + } + + static void connectLnbLive(LnbLiveHardwareConnections& lnbLive) { + auto dataFlow = getDataFlowConfiguration(); + if (dataFlow.hasLnbLive()) { + lnbLive.support = true; + } else { + lnbLive.support = false; + return; + } + auto lnbLiveConfig = *dataFlow.getFirstLnbLive(); + lnbLive.frontendId = lnbLiveConfig.getFrontendConnection(); + lnbLive.audioFilterId = lnbLiveConfig.getAudioFilterConnection(); + lnbLive.videoFilterId = lnbLiveConfig.getVideoFilterConnection(); + lnbLive.lnbId = lnbLiveConfig.getLnbConnection(); + if (lnbLiveConfig.hasDiseqcMsgSender()) { + for (auto msgName : lnbLiveConfig.getDiseqcMsgSender()) { + lnbLive.diseqcMsgs.push_back(msgName); + } + } + } + + static void connectLnbRecord(LnbRecordHardwareConnections& lnbRecord) { + auto dataFlow = getDataFlowConfiguration(); + if (dataFlow.hasLnbRecord()) { + lnbRecord.support = true; + } else { + lnbRecord.support = false; + return; + } + auto lnbRecordConfig = *dataFlow.getFirstLnbRecord(); + lnbRecord.frontendId = lnbRecordConfig.getFrontendConnection(); + lnbRecord.recordFilterId = lnbRecordConfig.getRecordFilterConnection(); + lnbRecord.dvrRecordId = lnbRecordConfig.getDvrRecordConnection(); + lnbRecord.lnbId = lnbRecordConfig.getLnbConnection(); + if (lnbRecordConfig.hasDiseqcMsgSender()) { + for (auto msgName : lnbRecordConfig.getDiseqcMsgSender()) { + lnbRecord.diseqcMsgs.push_back(msgName); + } + } + } + + static void connectTimeFilter(TimeFilterHardwareConnections& timeFilter) { + auto dataFlow = getDataFlowConfiguration(); + if (dataFlow.hasTimeFilter()) { + timeFilter.support = true; + } else { + timeFilter.support = false; + return; + } + auto timeFilterConfig = *dataFlow.getFirstTimeFilter(); + timeFilter.timeFilterId = timeFilterConfig.getTimeFilterConnection(); + } + + private: + static FrontendDvbtSettings readDvbtFrontendSettings(Frontend feConfig) { + ALOGW("[ConfigReader] fe type is dvbt"); + FrontendDvbtSettings dvbtSettings{ + .frequency = (int32_t)feConfig.getFrequency(), + }; + if (!feConfig.hasDvbtFrontendSettings_optional()) { + ALOGW("[ConfigReader] no more dvbt settings"); + return dvbtSettings; + } + auto dvbt = feConfig.getFirstDvbtFrontendSettings_optional(); + uint32_t trans = static_cast(dvbt->getTransmissionMode()); + dvbtSettings.transmissionMode = static_cast(trans); + dvbtSettings.bandwidth = static_cast(dvbt->getBandwidth()); + dvbtSettings.isHighPriority = dvbt->getIsHighPriority(); + dvbtSettings.hierarchy = static_cast(dvbt->getHierarchy()); + dvbtSettings.hpCoderate = static_cast(dvbt->getHpCoderate()); + dvbtSettings.lpCoderate = static_cast(dvbt->getLpCoderate()); + dvbtSettings.guardInterval = + static_cast(dvbt->getGuardInterval()); + dvbtSettings.standard = static_cast(dvbt->getStandard()); + dvbtSettings.isMiso = dvbt->getIsMiso(); + dvbtSettings.plpMode = static_cast(dvbt->getPlpMode()); + dvbtSettings.plpId = dvbt->getPlpId(); + dvbtSettings.plpGroupId = dvbt->getPlpGroupId(); + if (dvbt->hasConstellation()) { + dvbtSettings.constellation = + static_cast(dvbt->getConstellation()); + } + return dvbtSettings; + } + + static FrontendDvbsSettings readDvbsFrontendSettings(Frontend feConfig) { + ALOGW("[ConfigReader] fe type is dvbs"); + FrontendDvbsSettings dvbsSettings{ + .frequency = (int32_t)feConfig.getFrequency(), + }; + if (!feConfig.hasDvbsFrontendSettings_optional()) { + ALOGW("[ConfigReader] no more dvbs settings"); + return dvbsSettings; + } + dvbsSettings.symbolRate = static_cast( + feConfig.getFirstDvbsFrontendSettings_optional()->getSymbolRate()); + dvbsSettings.inputStreamId = static_cast( + feConfig.getFirstDvbsFrontendSettings_optional()->getInputStreamId()); + auto dvbs = feConfig.getFirstDvbsFrontendSettings_optional(); + if (dvbs->hasScanType()) { + dvbsSettings.scanType = static_cast(dvbs->getScanType()); + } + if (dvbs->hasIsDiseqcRxMessage()) { + dvbsSettings.isDiseqcRxMessage = dvbs->getIsDiseqcRxMessage(); + } + return dvbsSettings; + } + + static bool readFilterTypeAndSettings(Filter filterConfig, DemuxFilterType& type, + DemuxFilterSettings& settings) { + auto mainType = filterConfig.getMainType(); + auto subType = filterConfig.getSubType(); + + switch (mainType) { + case FilterMainTypeEnum::TS: { + ALOGW("[ConfigReader] filter main type is ts"); + type.mainType = DemuxFilterMainType::TS; + DemuxTsFilterSettings ts; + bool isTsSet = false; + switch (subType) { + case FilterSubTypeEnum::UNDEFINED: + type.subType.set( + DemuxTsFilterType::UNDEFINED); + break; + case FilterSubTypeEnum::SECTION: + type.subType.set( + DemuxTsFilterType::SECTION); + ts.filterSettings.set( + readSectionFilterSettings(filterConfig)); + isTsSet = true; + break; + case FilterSubTypeEnum::PES: + // TODO: b/182519645 support all the filter settings + type.subType.set( + DemuxTsFilterType::PES); + break; + case FilterSubTypeEnum::TS: + type.subType.set( + DemuxTsFilterType::TS); + ts.filterSettings.set( + true); + isTsSet = true; + break; + case FilterSubTypeEnum::PCR: + type.subType.set( + DemuxTsFilterType::PCR); + ts.filterSettings.set( + true); + isTsSet = true; + break; + case FilterSubTypeEnum::TEMI: + type.subType.set( + DemuxTsFilterType::TEMI); + ts.filterSettings.set( + true); + isTsSet = true; + break; + case FilterSubTypeEnum::AUDIO: + type.subType.set( + DemuxTsFilterType::AUDIO); + ts.filterSettings.set( + readAvFilterSettings(filterConfig)); + isTsSet = true; + break; + case FilterSubTypeEnum::VIDEO: + type.subType.set( + DemuxTsFilterType::VIDEO); + ts.filterSettings.set( + readAvFilterSettings(filterConfig)); + isTsSet = true; + break; + case FilterSubTypeEnum::RECORD: + type.subType.set( + DemuxTsFilterType::RECORD); + ts.filterSettings.set( + readRecordFilterSettings(filterConfig)); + isTsSet = true; + break; + default: + ALOGW("[ConfigReader] ts subtype is not supported"); + return false; + } + if (filterConfig.hasPid()) { + ts.tpid = static_cast(filterConfig.getPid()); + isTsSet = true; + } + if (isTsSet) { + settings.set(ts); + } + break; + } + case FilterMainTypeEnum::MMTP: { + ALOGW("[ConfigReader] filter main type is mmtp"); + type.mainType = DemuxFilterMainType::MMTP; + DemuxMmtpFilterSettings mmtp; + bool isMmtpSet = false; + switch (subType) { + case FilterSubTypeEnum::UNDEFINED: + type.subType.set( + DemuxMmtpFilterType::UNDEFINED); + break; + case FilterSubTypeEnum::SECTION: + type.subType.set( + DemuxMmtpFilterType::SECTION); + mmtp.filterSettings + .set( + readSectionFilterSettings(filterConfig)); + isMmtpSet = true; + break; + case FilterSubTypeEnum::PES: + type.subType.set( + DemuxMmtpFilterType::PES); + // TODO: b/182519645 support all the filter settings + break; + case FilterSubTypeEnum::MMTP: + type.subType.set( + DemuxMmtpFilterType::MMTP); + mmtp.filterSettings.set( + true); + isMmtpSet = true; + break; + case FilterSubTypeEnum::AUDIO: + type.subType.set( + DemuxMmtpFilterType::AUDIO); + mmtp.filterSettings.set( + readAvFilterSettings(filterConfig)); + isMmtpSet = true; + break; + case FilterSubTypeEnum::VIDEO: + type.subType.set( + DemuxMmtpFilterType::VIDEO); + mmtp.filterSettings.set( + readAvFilterSettings(filterConfig)); + isMmtpSet = true; + break; + case FilterSubTypeEnum::RECORD: + type.subType.set( + DemuxMmtpFilterType::RECORD); + mmtp.filterSettings.set( + readRecordFilterSettings(filterConfig)); + isMmtpSet = true; + break; + case FilterSubTypeEnum::DOWNLOAD: + type.subType.set( + DemuxMmtpFilterType::DOWNLOAD); + // TODO: b/182519645 support all the filter settings + break; + default: + ALOGW("[ConfigReader] mmtp subtype is not supported"); + return false; + } + if (filterConfig.hasPid()) { + mmtp.mmtpPid = static_cast(filterConfig.getPid()); + isMmtpSet = true; + } + if (isMmtpSet) { + settings.set(mmtp); + } + break; + } + case FilterMainTypeEnum::IP: { + ALOGW("[ConfigReader] filter main type is ip"); + type.mainType = DemuxFilterMainType::IP; + DemuxIpFilterSettings ip; + switch (subType) { + case FilterSubTypeEnum::UNDEFINED: + type.subType.set( + DemuxIpFilterType::UNDEFINED); + break; + case FilterSubTypeEnum::SECTION: + type.subType.set( + DemuxIpFilterType::SECTION); + ip.filterSettings.set( + readSectionFilterSettings(filterConfig)); + settings.set(ip); + break; + case FilterSubTypeEnum::NTP: + type.subType.set( + DemuxIpFilterType::NTP); + ip.filterSettings.set( + true); + settings.set(ip); + break; + case FilterSubTypeEnum::IP: { + ip.ipAddr = readIpAddress(filterConfig), + ip.filterSettings + .set( + readPassthroughSettings(filterConfig)); + settings.set(ip); + break; + } + case FilterSubTypeEnum::IP_PAYLOAD: + type.subType.set( + DemuxIpFilterType::IP_PAYLOAD); + ip.filterSettings.set( + true); + settings.set(ip); + break; + case FilterSubTypeEnum::PAYLOAD_THROUGH: + type.subType.set( + DemuxIpFilterType::PAYLOAD_THROUGH); + ip.filterSettings.set( + true); + settings.set(ip); + break; + default: + ALOGW("[ConfigReader] mmtp subtype is not supported"); + return false; + } + break; + } + default: + // TODO: b/182519645 support all the filter configs + ALOGW("[ConfigReader] filter main type is not supported in dynamic config"); + return false; + } + return true; + } + + static DemuxIpAddress readIpAddress(Filter filterConfig) { + DemuxIpAddress ipAddress; + vector data; + if (!filterConfig.hasIpFilterConfig_optional()) { + return ipAddress; + } + auto ipFilterConfig = filterConfig.getFirstIpFilterConfig_optional(); + if (ipFilterConfig->hasSrcPort()) { + ipAddress.srcPort = ipFilterConfig->getSrcPort(); + } + if (ipFilterConfig->hasDestPort()) { + ipAddress.dstPort = ipFilterConfig->getDestPort(); + } + if (ipFilterConfig->getFirstSrcIpAddress()->getIsIpV4()) { + data.resize(4); + memcpy(data.data(), ipFilterConfig->getFirstSrcIpAddress()->getIp().data(), 4); + ipAddress.srcIpAddress.set(data); + } else { + data.resize(6); + memcpy(data.data(), ipFilterConfig->getFirstSrcIpAddress()->getIp().data(), 6); + ipAddress.srcIpAddress.set(data); + } + if (ipFilterConfig->getFirstDestIpAddress()->getIsIpV4()) { + data.resize(4); + memcpy(data.data(), ipFilterConfig->getFirstDestIpAddress()->getIp().data(), 4); + ipAddress.dstIpAddress.set(data); + } else { + data.resize(6); + memcpy(data.data(), ipFilterConfig->getFirstDestIpAddress()->getIp().data(), 6); + ipAddress.dstIpAddress.set(data); + } + return ipAddress; + } + + static bool readPassthroughSettings(Filter filterConfig) { + if (!filterConfig.hasIpFilterConfig_optional()) { + return false; + } + auto ipFilterConfig = filterConfig.getFirstIpFilterConfig_optional(); + if (ipFilterConfig->hasDataPassthrough()) { + return ipFilterConfig->getDataPassthrough(); + } + return false; + } + + static DemuxFilterSectionSettings readSectionFilterSettings(Filter filterConfig) { + DemuxFilterSectionSettings settings; + if (!filterConfig.hasSectionFilterSettings_optional()) { + return settings; + } + auto section = filterConfig.getFirstSectionFilterSettings_optional(); + settings.isCheckCrc = section->getIsCheckCrc(); + settings.isRepeat = section->getIsRepeat(); + settings.isRaw = section->getIsRaw(); + return settings; + } + + static DemuxFilterAvSettings readAvFilterSettings(Filter filterConfig) { + DemuxFilterAvSettings settings; + if (!filterConfig.hasAvFilterSettings_optional()) { + return settings; + } + auto av = filterConfig.getFirstAvFilterSettings_optional(); + settings.isPassthrough = av->getIsPassthrough(); + return settings; + } + + static DemuxFilterRecordSettings readRecordFilterSettings(Filter filterConfig) { + DemuxFilterRecordSettings settings; + if (!filterConfig.hasRecordFilterSettings_optional()) { + return settings; + } + auto record = filterConfig.getFirstRecordFilterSettings_optional(); + settings.tsIndexMask = record->getTsIndexMask(); + settings.scIndexType = static_cast(record->getScIndexType()); + return settings; + } + + static PlaybackSettings readPlaybackSettings(Dvr dvrConfig) { + ALOGW("[ConfigReader] dvr type is playback"); + PlaybackSettings playbackSettings{ + .statusMask = static_cast(dvrConfig.getStatusMask()), + .lowThreshold = static_cast(dvrConfig.getLowThreshold()), + .highThreshold = static_cast(dvrConfig.getHighThreshold()), + .dataFormat = static_cast(dvrConfig.getDataFormat()), + .packetSize = static_cast(dvrConfig.getPacketSize()), + }; + return playbackSettings; + } + + static RecordSettings readRecordSettings(Dvr dvrConfig) { + ALOGW("[ConfigReader] dvr type is record"); + RecordSettings recordSettings{ + .statusMask = static_cast(dvrConfig.getStatusMask()), + .lowThreshold = static_cast(dvrConfig.getLowThreshold()), + .highThreshold = static_cast(dvrConfig.getHighThreshold()), + .dataFormat = static_cast(dvrConfig.getDataFormat()), + .packetSize = static_cast(dvrConfig.getPacketSize()), + }; + return recordSettings; + } + + static void getCiCamInfo(Frontend feConfig, bool& canConnectToCiCam, int32_t& ciCamId) { + if (!feConfig.hasConnectToCicamId()) { + canConnectToCiCam = false; + ciCamId = -1; + } + canConnectToCiCam = true; + ciCamId = static_cast(feConfig.getConnectToCicamId()); + } +}; -- GitLab From 612dbf6fb6c51b03b404577601a2b23b32fe6e9e Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 2 Jul 2021 18:11:08 -0700 Subject: [PATCH 088/825] Create default VehicleService. Create default VehicleService to use the default VHAL implementation. The original default VehicleService is now renamed to emulator-service. Test: Presubmit. Bug: 192276902 Change-Id: I4ef4c3d68a0d3f7c7e0742fe7d4477cdb0a89c76 --- automotive/vehicle/2.0/default/Android.bp | 8 +++--- .../vehicle/2.0/default/VehicleService.cpp | 28 +++++++++---------- ...automotive.vehicle@2.0-default-service.rc} | 2 +- ...utomotive.vehicle@2.0-default-service.xml} | 0 4 files changed, 19 insertions(+), 19 deletions(-) rename automotive/vehicle/2.0/default/{android.hardware.automotive.vehicle@2.0-service.rc => android.hardware.automotive.vehicle@2.0-default-service.rc} (77%) rename automotive/vehicle/2.0/default/{android.hardware.automotive.vehicle@2.0-service.xml => android.hardware.automotive.vehicle@2.0-default-service.xml} (100%) diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp index 2c3422e82d..bd9e9b6049 100644 --- a/automotive/vehicle/2.0/default/Android.bp +++ b/automotive/vehicle/2.0/default/Android.bp @@ -223,12 +223,12 @@ cc_test { } cc_binary { - name: "android.hardware.automotive.vehicle@2.0-service", + name: "android.hardware.automotive.vehicle@2.0-default-service", defaults: ["vhal_v2_0_target_defaults"], vintf_fragments: [ - "android.hardware.automotive.vehicle@2.0-service.xml", + "android.hardware.automotive.vehicle@2.0-default-service.xml", ], - init_rc: ["android.hardware.automotive.vehicle@2.0-service.rc"], + init_rc: ["android.hardware.automotive.vehicle@2.0-default-service.rc"], vendor: true, relative_install_path: "hw", srcs: ["VehicleService.cpp"], @@ -240,7 +240,7 @@ cc_binary { static_libs: [ "android.hardware.automotive.vehicle@2.0-manager-lib", "android.hardware.automotive.vehicle@2.0-libproto-native", - "android.hardware.automotive.vehicle@2.0-emulator-impl-lib", + "android.hardware.automotive.vehicle@2.0-default-impl-lib", ], } diff --git a/automotive/vehicle/2.0/default/VehicleService.cpp b/automotive/vehicle/2.0/default/VehicleService.cpp index fae6e43377..12e15f9db3 100644 --- a/automotive/vehicle/2.0/default/VehicleService.cpp +++ b/automotive/vehicle/2.0/default/VehicleService.cpp @@ -14,40 +14,40 @@ * limitations under the License. */ -#define LOG_TAG "automotive.vehicle@2.0-service" +#define LOG_TAG "automotive.vehicle@2.0-default-service" #include #include #include -#include -#include +#include +#include #include -using namespace android; -using namespace android::hardware; -using namespace android::hardware::automotive::vehicle::V2_0; +using ::android::hardware::automotive::vehicle::V2_0::VehicleHalManager; +using ::android::hardware::automotive::vehicle::V2_0::VehiclePropertyStore; +using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVehicleConnector; +using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVehicleHal; int main(int /* argc */, char* /* argv */ []) { auto store = std::make_unique(); - auto connector = std::make_unique(); - auto hal = std::make_unique(store.get(), connector.get()); - auto emulator = connector->getEmulator(); + auto connector = std::make_unique(); + auto hal = std::make_unique(store.get(), connector.get()); auto service = std::make_unique(hal.get()); connector->setValuePool(hal->getValuePool()); - configureRpcThreadpool(4, true /* callerWillJoin */); + android::hardware::configureRpcThreadpool(4, true /* callerWillJoin */); ALOGI("Registering as service..."); - status_t status = service->registerAsService(); + android::status_t status = service->registerAsService(); - if (status != OK) { + if (status != android::OK) { ALOGE("Unable to register vehicle service (%d)", status); return 1; } ALOGI("Ready"); - joinRpcThreadpool(); + android::hardware::joinRpcThreadpool(); - return 1; + return 0; } diff --git a/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-service.rc b/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-default-service.rc similarity index 77% rename from automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-service.rc rename to automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-default-service.rc index 44f9134714..8279af71c9 100644 --- a/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-service.rc +++ b/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-default-service.rc @@ -1,4 +1,4 @@ -service vendor.vehicle-hal-2.0 /vendor/bin/hw/android.hardware.automotive.vehicle@2.0-service +service vendor.vehicle-hal-2.0 /vendor/bin/hw/android.hardware.automotive.vehicle@2.0-default-service class early_hal user vehicle_network group system inet diff --git a/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-service.xml b/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-default-service.xml similarity index 100% rename from automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-service.xml rename to automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-default-service.xml -- GitLab From 920960002fec35cf069008cf5f4b57cff88f8142 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 2 Jul 2021 19:48:15 -0700 Subject: [PATCH 089/825] Support debug setValue. Test: atest android.hardware.automotive.vehicle@2.0-default-impl-unit-tests Bug: 193565753 Change-Id: I603f9fb986b2b131d05a23fb1cc1517f99c5bf0a --- .../vhal_v2_0/DefaultVehicleHalServer.cpp | 96 ++++++++++++- .../impl/vhal_v2_0/DefaultVehicleHalServer.h | 16 ++- .../vhal_v2_0/tests/DefaultVhalImpl_test.cpp | 130 +++++++++++++++++- 3 files changed, 234 insertions(+), 8 deletions(-) diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp index 0aaa4c1fc6..2facc4b5bc 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp @@ -370,10 +370,11 @@ IVehicleServer::DumpResult DefaultVehicleHalServer::onDump( return result; } - return debug(options); + return debugCommand(options); } -IVehicleServer::DumpResult DefaultVehicleHalServer::debug(const std::vector& options) { +IVehicleServer::DumpResult DefaultVehicleHalServer::debugCommand( + const std::vector& options) { DumpResult result; // This is a debug command for the HAL, caller should not continue to dump state. result.callerShouldDumpState = false; @@ -389,7 +390,9 @@ IVehicleServer::DumpResult DefaultVehicleHalServer::debug(const std::vector& options) { DumpResult result; // This is a debug command for the HAL, caller should not continue to dump state. @@ -597,6 +609,80 @@ void DefaultVehicleHalServer::overrideProperties(const char* overrideDir) { } } +IVehicleServer::DumpResult DefaultVehicleHalServer::setValueCommand( + const std::vector& options) { + DumpResult result; + // This is a debug command for the HAL, caller should not continue to dump state. + result.callerShouldDumpState = false; + // --debughal --set* [propID(int32)] [value] [timestamp(int64)] + // [areaId(int32)(optional)] + if (options.size() != 5 && options.size() != 6) { + result.buffer += + "incorrect argument count, need 5 or 6 arguments for --setint or --setfloat or " + "--setbool\n"; + result.buffer += getHelpInfo(); + return result; + } + std::unique_ptr updatedPropValue; + int32_t propId; + int32_t intValue; + float floatValue; + int64_t timestamp; + int32_t areaId = 0; + if (options[1] == "--setint") { + updatedPropValue = std::move(createVehiclePropValue(VehiclePropertyType::INT32, 1)); + if (!android::base::ParseInt(options[3], &intValue)) { + result.buffer += "failed to parse value as int: \"" + options[3] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + updatedPropValue->value.int32Values[0] = intValue; + } else if (options[1] == "--setbool") { + updatedPropValue = std::move(createVehiclePropValue(VehiclePropertyType::BOOLEAN, 1)); + if (options[3] == "true" || options[3] == "True") { + updatedPropValue->value.int32Values[0] = 1; + } else if (options[3] == "false" || options[3] == "False") { + updatedPropValue->value.int32Values[0] = 0; + } else { + result.buffer += "failed to parse value as bool, only accepts true/false: \"" + + options[3] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + } else { + updatedPropValue = std::move(createVehiclePropValue(VehiclePropertyType::FLOAT, 1)); + if (!android::base::ParseFloat(options[3], &floatValue)) { + result.buffer += "failed to parse value as float: \"" + options[3] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + updatedPropValue->value.floatValues[0] = floatValue; + } + if (!android::base::ParseInt(options[2], &propId)) { + result.buffer += "failed to parse propID as int: \"" + options[2] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + updatedPropValue->prop = propId; + if (!android::base::ParseInt(options[4], ×tamp)) { + result.buffer += "failed to parse timestamp as int: \"" + options[4] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + updatedPropValue->timestamp = timestamp; + if (options.size() == 6) { + if (!android::base::ParseInt(options[5], &areaId)) { + result.buffer += "failed to parse areaID as int: \"" + options[5] + "\"\n"; + result.buffer += getHelpInfo(); + return result; + } + } + updatedPropValue->areaId = areaId; + + onPropertyValueFromCar(*updatedPropValue, /*updateStatus=*/true); + return result; +} + } // namespace impl } // namespace V2_0 diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h index 5858325758..87548465aa 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.h @@ -45,6 +45,9 @@ class DefaultVehicleHalServer : public IVehicleServer { StatusCode onSetProperty(const VehiclePropValue& value, bool updateStatus) override; + // Dump/debug the Default VHAL server. If options is empty, the internal information for the + // server would be dumped. Otherwise, the options would be treated as debug commands and sent + // to debug function to handle the commands. DumpResult onDump(const std::vector& options) override; // Set the Property Value Pool used in this server @@ -67,16 +70,25 @@ class DefaultVehicleHalServer : public IVehicleServer { void storePropInitialValue(const ConfigDeclaration& config); - DumpResult debug(const std::vector& options); + // Handles debug commands. The first option must be "--debughal" otherwise the command would be + // ignored. The second option specifies the operations to execute. Different operations require + // different input options, for detail, see the helpInfo printed by getHelpInfo(). + DumpResult debugCommand(const std::vector& options); + // Gets help info. Contains the usage for different debug commands. std::string getHelpInfo(); - DumpResult genFakeData(const std::vector& options); // If "persist.vendor.vhal_init_value_override" is true, try to override the properties default // values according to JSON files in 'overrideDir'. Would be called in constructor using // VENDOR_OVERRIDE_DIR as overrideDir. void maybeOverrideProperties(const char* overrideDir); + // Handles "--genfakedata" debug command. + DumpResult genFakeDataCommand(const std::vector& options); + + // Handles "--setint" or "--setfloat" or "--setbool" debug command. + DumpResult setValueCommand(const std::vector& options); + protected: GeneratorHub mGeneratorHub{ [this](const VehiclePropValue& value) { return onFakeValueGenerated(value); }}; 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 2268df80a0..e3c8dd6c79 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 @@ -71,6 +71,8 @@ using ::android::hardware::automotive::vehicle::V2_0::VehiclePropValuePool; using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVehicleConnector; using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVehicleHal; using ::android::hardware::automotive::vehicle::V2_0::impl::DefaultVhalImplTestHelper; +using ::android::hardware::automotive::vehicle::V2_0::impl::DOOR_1_LEFT; +using ::android::hardware::automotive::vehicle::V2_0::impl::DOOR_1_RIGHT; using ::android::hardware::automotive::vehicle::V2_0::impl::HVAC_ALL; using ::android::hardware::automotive::vehicle::V2_0::impl::HVAC_LEFT; using ::android::hardware::automotive::vehicle::V2_0::impl::HVAC_RIGHT; @@ -661,7 +663,28 @@ std::vector GenInvalidOptions() { "failed to parse keyCode as int: \"0.1\""}, {"genfakedata_keypress_invalid_display", {"--debughal", "--genfakedata", "--keypress", "1", "0.1"}, - "failed to parse display as int: \"0.1\""}}; + "failed to parse display as int: \"0.1\""}, + {"setint_no_args", {"--debughal", "--setint"}, "incorrect argument count"}, + {"setint_invalid_prop_id", + {"--debughal", "--setint", "abcd", "0", "0", "0"}, + "failed to parse propID as int: \"abcd\""}, + {"setint_invalid_value", + {"--debughal", "--setint", "0", "1.1", "0", "0"}, + "failed to parse value as int: \"1.1\""}, + {"setint_invalid_timestamp", + {"--debughal", "--setint", "0", "0", "1.1", "0"}, + "failed to parse timestamp as int: \"1.1\""}, + {"setint_invalid_areaId", + {"--debughal", "--setint", "0", "0", "0", "1.1"}, + "failed to parse areaID as int: \"1.1\""}, + {"setbool_no_args", {"--debughal", "--setbool"}, "incorrect argument count"}, + {"setbool_invalid_value", + {"--debughal", "--setbool", "0", "1", "0", "0"}, + "failed to parse value as bool"}, + {"setfloat_no_args", {"--debughal", "--setfloat"}, "incorrect argument count"}, + {"setfloat_invalid_value", + {"--debughal", "--setfloat", "0", "abcd", "0", "0"}, + "failed to parse value as float: \"abcd\""}}; } INSTANTIATE_TEST_SUITE_P( @@ -1263,4 +1286,109 @@ TEST_F(DefaultVhalImplTest, testInitialUserInfo) { EXPECT_EQ(0, events[0]->value.int32Values[3]); } +TEST_F(DefaultVhalImplTest, testDebugSetInt) { + hidl_vec options = {"--debughal", "--setint", + getPropIdString(VehicleProperty::INFO_MODEL_YEAR), "2022", + "1000"}; + hidl_handle fd = {}; + int memfd = createMemfd(&fd); + // Clear existing events. + mEventQueue.flush(); + + EXPECT_FALSE(mHal->dump(fd, options)); + + lseek(memfd, 0, SEEK_SET); + char buf[10240] = {}; + // The dumped info should be empty. + read(memfd, buf, sizeof(buf)); + EXPECT_STREQ("", buf); + + auto events = mEventQueue.flush(); + 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; + value.prop = toInt(VehicleProperty::INFO_MODEL_YEAR); + auto gotValue = mHal->get(value, &status); + ASSERT_EQ(StatusCode::OK, status); + ASSERT_EQ((size_t)1, gotValue->value.int32Values.size()); + EXPECT_EQ(2022, gotValue->value.int32Values[0]); +} + +TEST_F(DefaultVhalImplTest, testDebugSetBool) { + char doorLeft[100]; + snprintf(doorLeft, sizeof(doorLeft), "%d", DOOR_1_LEFT); + hidl_vec options = { + "--debughal", "--setbool", getPropIdString(VehicleProperty::DOOR_LOCK), + "false", "1000", doorLeft}; + hidl_handle fd = {}; + int memfd = createMemfd(&fd); + // Clear existing events. + mEventQueue.flush(); + + EXPECT_FALSE(mHal->dump(fd, options)); + + lseek(memfd, 0, SEEK_SET); + char buf[10240] = {}; + // The dumped info should be empty. + read(memfd, buf, sizeof(buf)); + EXPECT_STREQ("", buf); + + auto events = mEventQueue.flush(); + 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; + value.prop = toInt(VehicleProperty::DOOR_LOCK); + value.areaId = DOOR_1_LEFT; + auto gotValue = mHal->get(value, &status); + ASSERT_EQ(StatusCode::OK, status); + ASSERT_EQ((size_t)1, gotValue->value.int32Values.size()); + EXPECT_EQ(0, gotValue->value.int32Values[0]); + + value.areaId = DOOR_1_RIGHT; + gotValue = mHal->get(value, &status); + ASSERT_EQ(StatusCode::OK, status); + ASSERT_EQ((size_t)1, gotValue->value.int32Values.size()); + EXPECT_EQ(1, gotValue->value.int32Values[0]); +} + +TEST_F(DefaultVhalImplTest, testDebugSetFloat) { + hidl_vec options = {"--debughal", "--setfloat", + getPropIdString(VehicleProperty::INFO_FUEL_CAPACITY), "10.5", + "1000"}; + hidl_handle fd = {}; + int memfd = createMemfd(&fd); + // Clear existing events. + mEventQueue.flush(); + + EXPECT_FALSE(mHal->dump(fd, options)); + + lseek(memfd, 0, SEEK_SET); + char buf[10240] = {}; + // The dumped info should be empty. + read(memfd, buf, sizeof(buf)); + EXPECT_STREQ("", buf); + + auto events = mEventQueue.flush(); + 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; + value.prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY); + auto gotValue = mHal->get(value, &status); + ASSERT_EQ(StatusCode::OK, status); + ASSERT_EQ((size_t)1, gotValue->value.floatValues.size()); + EXPECT_EQ(10.5, gotValue->value.floatValues[0]); +} + } // namespace -- GitLab From 36588116b941a97be6875307c66b67745ea4869c Mon Sep 17 00:00:00 2001 From: Kai Date: Tue, 27 Jul 2021 17:15:09 -0700 Subject: [PATCH 090/825] Add FAN_DIRECTION for assistant's test case Add more FAN_DIRECTION in google VHAL for testing Bug: 192508890 Test: adb shell dumpsys cmd get-property-value 356582673 Change-Id: I6d2bbf04477b0f80d40cd5999c648d5163de86ac --- .../vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h | 8 ++++++-- .../vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) 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 899428e75e..7945ae4d5c 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 @@ -476,8 +476,12 @@ const ConfigDeclaration kVehicleProperties[]{ .changeMode = VehiclePropertyChangeMode::STATIC, .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, .initialValue = {.int32Values = {FAN_DIRECTION_FACE, FAN_DIRECTION_FLOOR, - FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR}}}, - + FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR, + FAN_DIRECTION_DEFROST, + FAN_DIRECTION_FACE | FAN_DIRECTION_DEFROST, + FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST, + FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST | + FAN_DIRECTION_FACE}}}, {.config = {.prop = toInt(VehicleProperty::HVAC_SEAT_VENTILATION), .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h index d5f6a1841e..0880125b8e 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h @@ -37,6 +37,7 @@ constexpr int WINDOW_2_RIGHT = (int)VehicleAreaWindow::ROW_2_RIGHT; constexpr int WINDOW_ROOF_TOP_1 = (int)VehicleAreaWindow::ROOF_TOP_1; constexpr int FAN_DIRECTION_FACE = (int)VehicleHvacFanDirection::FACE; constexpr int FAN_DIRECTION_FLOOR = (int)VehicleHvacFanDirection::FLOOR; +constexpr int FAN_DIRECTION_DEFROST = (int)VehicleHvacFanDirection::DEFROST; constexpr int OBD2_LIVE_FRAME = (int)VehicleProperty::OBD2_LIVE_FRAME; constexpr int OBD2_FREEZE_FRAME = (int)VehicleProperty::OBD2_FREEZE_FRAME; constexpr int OBD2_FREEZE_FRAME_INFO = (int)VehicleProperty::OBD2_FREEZE_FRAME_INFO; -- GitLab From 84d45ee9925ce6e9c62b335ac679cd6e686b0ced Mon Sep 17 00:00:00 2001 From: Hongguang Date: Wed, 28 Jul 2021 18:01:16 -0700 Subject: [PATCH 091/825] Add Tuner AIDL error codes to align with HIDL. Aidl will return these error codes as service specific errors in EX_SERVICE_SPECIFIC. Bug: 191825295 Test: make and run VtsHalTvTunerTargetTest Change-Id: Ib27300229e30f40bd779188083f1db309dec89e4 --- .../android/hardware/tv/tuner/Result.aidl | 45 +++++++++++++++++++ .../android/hardware/tv/tuner/Result.aidl | 34 ++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Result.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/Result.aidl diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Result.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Result.aidl new file mode 100644 index 0000000000..4e22f678c8 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Result.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum Result { + SUCCESS = 0, + UNAVAILABLE = 1, + NOT_INITIALIZED = 2, + INVALID_STATE = 3, + INVALID_ARGUMENT = 4, + OUT_OF_MEMORY = 5, + UNKNOWN_ERROR = 6, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/Result.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/Result.aidl new file mode 100644 index 0000000000..f19bf3beb2 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/Result.aidl @@ -0,0 +1,34 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * Tuner error codes. Aidl will return these error codes as service specific + * errors in EX_SERVICE_SPECIFIC. + * @hide + */ +@VintfStability +@Backing(type="int") +enum Result { + SUCCESS, + UNAVAILABLE, + NOT_INITIALIZED, + INVALID_STATE, + INVALID_ARGUMENT, + OUT_OF_MEMORY, + UNKNOWN_ERROR, +} -- GitLab From e423acd4b5841b739a62dd2cf0a553075b781695 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Tue, 27 Jul 2021 16:56:47 -0700 Subject: [PATCH 092/825] Update tuner default AIDL HAL. *) Use tuner AIDL HAL return values. *) Replace mTunerService with mTuner to avoid confusing. *) Merge other HIDL HAL changes. *) ag/15371813, ag/15371814 and ag/15371815. Bug: 191825295 Test: make and run VtsHalTvTunerTargetTest Change-Id: Ibbf94c4fc36c3bda94a7e0f3e0697c83ac414d0e --- tv/tuner/aidl/default/Demux.cpp | 57 +++++++++++++++++---------- tv/tuner/aidl/default/Demux.h | 2 +- tv/tuner/aidl/default/Descrambler.cpp | 4 +- tv/tuner/aidl/default/Dvr.cpp | 39 +++++++++--------- tv/tuner/aidl/default/Dvr.h | 14 ++----- tv/tuner/aidl/default/Filter.cpp | 52 ++++++++++++++++-------- tv/tuner/aidl/default/Frontend.cpp | 23 ++++++----- tv/tuner/aidl/default/Frontend.h | 2 +- tv/tuner/aidl/default/TimeFilter.cpp | 10 +++-- tv/tuner/aidl/default/Tuner.cpp | 13 ++++-- 10 files changed, 129 insertions(+), 87 deletions(-) diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp index 15022ee9ac..d5a653b3e6 100644 --- a/tv/tuner/aidl/default/Demux.cpp +++ b/tv/tuner/aidl/default/Demux.cpp @@ -18,6 +18,7 @@ #define LOG_TAG "android.hardware.tv.tuner-service.example-Demux" #include +#include #include #include "Demux.h" @@ -32,7 +33,7 @@ namespace tuner { Demux::Demux(int32_t demuxId, std::shared_ptr tuner) { mDemuxId = demuxId; - mTunerService = tuner; + mTuner = tuner; } Demux::~Demux() { @@ -43,17 +44,18 @@ Demux::~Demux() { ::ndk::ScopedAStatus Demux::setFrontendDataSource(int32_t in_frontendId) { ALOGV("%s", __FUNCTION__); - if (mTunerService == nullptr) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_NO_INIT); + if (mTuner == nullptr) { + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::NOT_INITIALIZED)); } - mFrontend = mTunerService->getFrontendById(in_frontendId); - + mFrontend = mTuner->getFrontendById(in_frontendId); if (mFrontend == nullptr) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); } - mTunerService->setFrontendAsDemuxSource(in_frontendId, mDemuxId); + mTuner->setFrontendAsDemuxSource(in_frontendId, mDemuxId); return ::ndk::ScopedAStatus::ok(); } @@ -69,14 +71,16 @@ Demux::~Demux() { if (in_cb == nullptr) { ALOGW("[Demux] callback can't be null"); *_aidl_return = nullptr; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } std::shared_ptr filter = ndk::SharedRefBase::make(in_type, filterId, in_bufferSize, in_cb, ref()); if (!filter->createFilterMQ()) { *_aidl_return = nullptr; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); } mFilters[filterId] = filter; @@ -95,7 +99,8 @@ Demux::~Demux() { if (!result) { *_aidl_return = nullptr; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } *_aidl_return = filter; @@ -122,13 +127,15 @@ Demux::~Demux() { if (!status.isOk()) { ALOGE("[Demux] Can't get filter Id."); *_aidl_return = -1; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); } if (!mFilters[id]->isMediaFilter()) { ALOGE("[Demux] Given filter is not a media filter."); *_aidl_return = -1; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); } if (!mPcrFilterIds.empty()) { @@ -139,7 +146,8 @@ Demux::~Demux() { ALOGE("[Demux] No PCR filter opened."); *_aidl_return = -1; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); } ::ndk::ScopedAStatus Demux::getAvSyncTime(int32_t in_avSyncHwId, int64_t* _aidl_return) { @@ -147,11 +155,13 @@ Demux::~Demux() { if (mPcrFilterIds.empty()) { *_aidl_return = -1; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); } if (in_avSyncHwId != *mPcrFilterIds.begin()) { *_aidl_return = -1; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } *_aidl_return = -1; @@ -169,7 +179,7 @@ Demux::~Demux() { mRecordFilterIds.clear(); mFilters.clear(); mLastUsedFilterId = -1; - mTunerService->removeDemux(mDemuxId); + mTuner->removeDemux(mDemuxId); mFrontendInputThreadRunning = false; std::lock_guard lock(mFrontendInputThreadLock); @@ -184,7 +194,8 @@ Demux::~Demux() { if (in_cb == nullptr) { ALOGW("[Demux] DVR callback can't be null"); *_aidl_return = nullptr; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } set::iterator it; @@ -195,7 +206,8 @@ Demux::~Demux() { if (!mDvrPlayback->createDvrMQ()) { mDvrPlayback = nullptr; *_aidl_return = mDvrPlayback; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); } for (it = mPlaybackFilterIds.begin(); it != mPlaybackFilterIds.end(); it++) { @@ -203,7 +215,8 @@ Demux::~Demux() { ALOGE("[Demux] Can't get filter info for DVR playback"); mDvrPlayback = nullptr; *_aidl_return = mDvrPlayback; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); } } @@ -214,14 +227,16 @@ Demux::~Demux() { if (!mDvrRecord->createDvrMQ()) { mDvrRecord = nullptr; *_aidl_return = mDvrRecord; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); } *_aidl_return = mDvrRecord; return ::ndk::ScopedAStatus::ok(); default: *_aidl_return = nullptr; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } } diff --git a/tv/tuner/aidl/default/Demux.h b/tv/tuner/aidl/default/Demux.h index 9f96d0f1bc..4d9b7fe911 100644 --- a/tv/tuner/aidl/default/Demux.h +++ b/tv/tuner/aidl/default/Demux.h @@ -95,7 +95,7 @@ class Demux : public BnDemux { private: // Tuner service - std::shared_ptr mTunerService; + std::shared_ptr mTuner; // Frontend source std::shared_ptr mFrontend; diff --git a/tv/tuner/aidl/default/Descrambler.cpp b/tv/tuner/aidl/default/Descrambler.cpp index 8af3a92830..586db73d1d 100644 --- a/tv/tuner/aidl/default/Descrambler.cpp +++ b/tv/tuner/aidl/default/Descrambler.cpp @@ -18,6 +18,7 @@ #define LOG_TAG "android.hardware.tv.tuner-service.example-Descrambler" #include +#include #include #include "Descrambler.h" @@ -37,7 +38,8 @@ Descrambler::~Descrambler() {} if (mDemuxSet) { ALOGW("[ WARN ] Descrambler has already been set with a demux id %" PRIu32, mSourceDemuxId); - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); } mDemuxSet = true; mSourceDemuxId = in_demuxId; diff --git a/tv/tuner/aidl/default/Dvr.cpp b/tv/tuner/aidl/default/Dvr.cpp index a042dc3590..51cb1e0d7b 100644 --- a/tv/tuner/aidl/default/Dvr.cpp +++ b/tv/tuner/aidl/default/Dvr.cpp @@ -18,6 +18,7 @@ #define LOG_TAG "android.hardware.tv.tuner-service.example-Dvr" #include +#include #include #include "Dvr.h" @@ -39,8 +40,8 @@ Dvr::Dvr(DvrType type, uint32_t bufferSize, const std::shared_ptr& } Dvr::~Dvr() { - mDvrThreadRunning = false; - lock_guard lock(mDvrThreadLock); + // make sure thread has joined + close(); } ::ndk::ScopedAStatus Dvr::getQueueDesc(MQDescriptor* out_queue) { @@ -70,7 +71,8 @@ Dvr::~Dvr() { } if (!mDemux->attachRecordFilter(filterId)) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } return ::ndk::ScopedAStatus::ok(); @@ -86,7 +88,8 @@ Dvr::~Dvr() { } if (!mDemux->detachRecordFilter(filterId)) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } return ::ndk::ScopedAStatus::ok(); @@ -99,17 +102,18 @@ Dvr::~Dvr() { } if (!mCallback) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_NO_INIT); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::NOT_INITIALIZED)); } if (!mDvrConfigured) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); } if (mType == DvrType::PLAYBACK) { mDvrThreadRunning = true; - pthread_create(&mDvrThread, NULL, __threadLoopPlayback, this); - pthread_setname_np(mDvrThread, "playback_waiting_loop"); + mDvrThread = std::thread(&Dvr::playbackThreadLoop, this); } else if (mType == DvrType::RECORD) { mRecordStatus = RecordStatus::DATA_READY; mDemux->setIsRecording(mType == DvrType::RECORD); @@ -124,9 +128,11 @@ Dvr::~Dvr() { ALOGV("%s", __FUNCTION__); mDvrThreadRunning = false; - lock_guard lock(mDvrThreadLock); - - mIsRecordStarted = false; + if (mDvrThread.joinable()) { + mDvrThread.join(); + } + // thread should always be joinable if it is running, + // so it should be safe to assume recording stopped. mDemux->setIsRecording(false); return ::ndk::ScopedAStatus::ok(); @@ -143,8 +149,8 @@ Dvr::~Dvr() { ::ndk::ScopedAStatus Dvr::close() { ALOGV("%s", __FUNCTION__); - mDvrThreadRunning = false; - lock_guard lock(mDvrThreadLock); + stop(); + return ::ndk::ScopedAStatus::ok(); } @@ -171,15 +177,8 @@ EventFlag* Dvr::getDvrEventFlag() { return mDvrEventFlag; } -void* Dvr::__threadLoopPlayback(void* user) { - Dvr* const self = static_cast(user); - self->playbackThreadLoop(); - return 0; -} - void Dvr::playbackThreadLoop() { ALOGD("[Dvr] playback threadLoop start."); - lock_guard lock(mDvrThreadLock); while (mDvrThreadRunning) { uint32_t efState = 0; diff --git a/tv/tuner/aidl/default/Dvr.h b/tv/tuner/aidl/default/Dvr.h index fb22a2ee1f..68933aed70 100644 --- a/tv/tuner/aidl/default/Dvr.h +++ b/tv/tuner/aidl/default/Dvr.h @@ -21,7 +21,9 @@ #include #include +#include #include +#include #include "Demux.h" #include "Frontend.h" #include "Tuner.h" @@ -107,10 +109,7 @@ class Dvr : public BnDvr { * Each filter handler handles the data filtering/output writing/filterEvent updating. */ void startTpidFilter(vector data); - static void* __threadLoopPlayback(void* user); - static void* __threadLoopRecord(void* user); void playbackThreadLoop(); - void recordThreadLoop(); unique_ptr mDvrMQ; EventFlag* mDvrEventFlag; @@ -121,7 +120,7 @@ class Dvr : public BnDvr { DvrSettings mDvrSettings; // Thread handlers - pthread_t mDvrThread; + std::thread mDvrThread; // FMQ status local records PlaybackStatus mPlaybackStatus; @@ -129,7 +128,7 @@ class Dvr : public BnDvr { /** * If a specific filter's writing loop is still running */ - bool mDvrThreadRunning; + std::atomic mDvrThreadRunning; bool mKeepFetchingDataFromFrontend; /** * Lock to protect writes to the FMQs @@ -140,13 +139,8 @@ class Dvr : public BnDvr { */ std::mutex mPlaybackStatusLock; std::mutex mRecordStatusLock; - std::mutex mDvrThreadLock; const bool DEBUG_DVR = false; - - // Booleans to check if recording is running. - // Recording is ready when both of the following are set to true. - bool mIsRecordStarted = false; }; } // namespace tuner diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp index 18c1f00608..dd9bee3967 100644 --- a/tv/tuner/aidl/default/Filter.cpp +++ b/tv/tuner/aidl/default/Filter.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -214,7 +215,8 @@ Filter::~Filter() { } if (mDataId2Avfd.find(in_avDataId) == mDataId2Avfd.end()) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } ::close(mDataId2Avfd[in_avDataId]); @@ -233,7 +235,8 @@ Filter::~Filter() { ALOGV("%s", __FUNCTION__); if (mType.mainType != DemuxFilterMainType::IP) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); } mCid = in_ipCid; @@ -244,7 +247,8 @@ Filter::~Filter() { ALOGV("%s", __FUNCTION__); if (!mIsMediaFilter) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); } if (mSharedAvMemHandle != nullptr) { @@ -256,14 +260,16 @@ Filter::~Filter() { int av_fd = createAvIonFd(BUFFER_SIZE_16M); if (av_fd < 0) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_NO_MEMORY); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::OUT_OF_MEMORY)); } mSharedAvMemHandle = createNativeHandle(av_fd); if (mSharedAvMemHandle == nullptr) { ::close(av_fd); *_aidl_return = 0; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); } ::close(av_fd); mUsingSharedAvMem = true; @@ -277,7 +283,8 @@ Filter::~Filter() { ALOGV("%s", __FUNCTION__); if (!mIsMediaFilter) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNAVAILABLE)); } switch (in_avStreamType.getTag()) { @@ -319,7 +326,8 @@ Filter::~Filter() { events[0].set(monitorEvent); mCallback->onFilterEvent(events); } else { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); } } } @@ -337,7 +345,8 @@ Filter::~Filter() { events[0].set(monitorEvent); mCallback->onFilterEvent(events); } else { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); } } } @@ -579,7 +588,8 @@ void Filter::updateRecordOutput(vector data) { } if (!writeSectionsAndCreateEvent(mFilterOutput)) { ALOGD("[Filter] filter %" PRIu64 " fails to write into FMQ. Ending thread", mFilterId); - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); } mFilterOutput.clear(); @@ -629,7 +639,8 @@ void Filter::updateRecordOutput(vector data) { if (!writeDataToFilterMQ(mPesOutput)) { ALOGD("[Filter] pes data write failed"); mFilterOutput.clear(); - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } maySendFilterStatusCallback(); DemuxFilterPesEvent pesEvent; @@ -720,7 +731,8 @@ void Filter::updateRecordOutput(vector data) { ::ndk::ScopedAStatus Filter::createMediaFilterEventWithIon(vector& output) { if (mUsingSharedAvMem) { if (mSharedAvMemHandle == nullptr) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); } return createShareMemMediaEvents(output); } @@ -736,7 +748,8 @@ void Filter::updateRecordOutput(vector data) { if (mDvr == nullptr || !mDvr->writeRecordFMQ(mRecordFilterOutput)) { ALOGD("[Filter] dvr fails to write into record FMQ."); - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); } DemuxFilterTsRecordEvent recordEvent; @@ -849,18 +862,21 @@ native_handle_t* Filter::createNativeHandle(int fd) { ::ndk::ScopedAStatus Filter::createIndependentMediaEvents(vector& output) { int av_fd = createAvIonFd(output.size()); if (av_fd == -1) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); } // copy the filtered data to the buffer uint8_t* avBuffer = getIonBuffer(av_fd, output.size()); if (avBuffer == NULL) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); } memcpy(avBuffer, output.data(), output.size() * sizeof(uint8_t)); native_handle_t* nativeHandle = createNativeHandle(av_fd); if (nativeHandle == NULL) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); } // Create a dataId and add a pair into the dataId2Avfd map @@ -898,14 +914,16 @@ native_handle_t* Filter::createNativeHandle(int fd) { uint8_t* sharedAvBuffer = getIonBuffer(mSharedAvMemHandle->data[0], output.size() + mSharedAvMemOffset); if (sharedAvBuffer == NULL) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); } memcpy(sharedAvBuffer + mSharedAvMemOffset, output.data(), output.size() * sizeof(uint8_t)); // Create a memory handle with numFds == 0 native_handle_t* nativeHandle = createNativeHandle(-1); if (nativeHandle == NULL) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_UNKNOWN_ERROR); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); } // Create mediaEvent and send callback diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index 2be13d3c0b..7f7b989657 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -17,9 +17,11 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "android.hardware.tv.tuner-service.example-Frontend" -#include "Frontend.h" +#include #include +#include "Frontend.h" + namespace aidl { namespace android { namespace hardware { @@ -29,7 +31,7 @@ namespace tuner { Frontend::Frontend(FrontendType type, int32_t id, std::shared_ptr tuner) { mType = type; mId = id; - mTunerService = tuner; + mTuner = tuner; // Init callback to nullptr mCallback = nullptr; } @@ -41,7 +43,7 @@ Frontend::~Frontend() {} // Reset callback mCallback = nullptr; mIsLocked = false; - mTunerService->removeFrontend(mId); + mTuner->removeFrontend(mId); return ::ndk::ScopedAStatus::ok(); } @@ -50,7 +52,8 @@ Frontend::~Frontend() {} ALOGV("%s", __FUNCTION__); if (in_callback == nullptr) { ALOGW("[ WARN ] Set Frontend callback with nullptr"); - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } mCallback = in_callback; @@ -61,10 +64,11 @@ Frontend::~Frontend() {} ALOGV("%s", __FUNCTION__); if (mCallback == nullptr) { ALOGW("[ WARN ] Frontend callback is not set when tune"); - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); } - mTunerService->frontendStartTune(mId); + mTuner->frontendStartTune(mId); mCallback->onEvent(FrontendEventType::LOCKED); mIsLocked = true; @@ -74,7 +78,7 @@ Frontend::~Frontend() {} ::ndk::ScopedAStatus Frontend::stopTune() { ALOGV("%s", __FUNCTION__); - mTunerService->frontendStopTune(mId); + mTuner->frontendStopTune(mId); mIsLocked = false; return ::ndk::ScopedAStatus::ok(); @@ -82,9 +86,9 @@ Frontend::~Frontend() {} ::ndk::ScopedAStatus Frontend::scan(const FrontendSettings& in_settings, FrontendScanType in_type) { ALOGV("%s", __FUNCTION__); - FrontendScanMessage msg; if (mIsLocked) { + FrontendScanMessage msg; msg.set(true); mCallback->onScanMessage(FrontendScanMessageType::END, msg); return ::ndk::ScopedAStatus::ok(); @@ -675,7 +679,8 @@ Frontend::~Frontend() {} ::ndk::ScopedAStatus Frontend::setLnb(int32_t /* in_lnbId */) { ALOGV("%s", __FUNCTION__); if (!supportsSatellite()) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); } return ::ndk::ScopedAStatus::ok(); } diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h index f89e74d9e6..3c602cff8f 100644 --- a/tv/tuner/aidl/default/Frontend.h +++ b/tv/tuner/aidl/default/Frontend.h @@ -59,7 +59,7 @@ class Frontend : public BnFrontend { virtual ~Frontend(); bool supportsSatellite(); std::shared_ptr mCallback; - std::shared_ptr mTunerService; + std::shared_ptr mTuner; FrontendType mType = FrontendType::UNDEFINED; int32_t mId = 0; bool mIsLocked = false; diff --git a/tv/tuner/aidl/default/TimeFilter.cpp b/tv/tuner/aidl/default/TimeFilter.cpp index 4fd8d21c36..dde7be34ca 100644 --- a/tv/tuner/aidl/default/TimeFilter.cpp +++ b/tv/tuner/aidl/default/TimeFilter.cpp @@ -17,9 +17,11 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "android.hardware.tv.tuner-service.example-TimeFilter" -#include "TimeFilter.h" +#include #include +#include "TimeFilter.h" + namespace aidl { namespace android { namespace hardware { @@ -37,7 +39,8 @@ TimeFilter::~TimeFilter() {} ::ndk::ScopedAStatus TimeFilter::setTimeStamp(int64_t in_timeStamp) { ALOGV("%s", __FUNCTION__); if (in_timeStamp == INVALID_TIME_STAMP) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } mTimeStamp = in_timeStamp; mBeginTime = time(NULL); @@ -56,7 +59,8 @@ TimeFilter::~TimeFilter() {} ALOGV("%s", __FUNCTION__); if (mTimeStamp == INVALID_TIME_STAMP) { *_aidl_return = mTimeStamp; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } uint64_t currentTimeStamp = mTimeStamp + difftime(time(NULL), mBeginTime) * 900000; diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp index dc0bd5e346..8335ffacce 100644 --- a/tv/tuner/aidl/default/Tuner.cpp +++ b/tv/tuner/aidl/default/Tuner.cpp @@ -17,12 +17,14 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "android.hardware.tv.tuner-service.example-Tuner" -#include "Tuner.h" +#include #include + #include "Demux.h" #include "Descrambler.h" #include "Frontend.h" #include "Lnb.h" +#include "Tuner.h" namespace aidl { namespace android { @@ -198,7 +200,8 @@ Tuner::~Tuner() {} if (in_frontendId >= mFrontendSize || in_frontendId < 0) { ALOGW("[ WARN ] Frontend with id %d isn't available", in_frontendId); *_aidl_return = nullptr; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } *_aidl_return = mFrontends[in_frontendId]; @@ -241,7 +244,8 @@ Tuner::~Tuner() {} ALOGV("%s", __FUNCTION__); if (in_frontendId >= mFrontendSize) { - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } // assign randomly selected values for testing. @@ -276,7 +280,8 @@ Tuner::~Tuner() {} if (in_lnbId >= mLnbs.size()) { *_aidl_return = nullptr; - return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); } *_aidl_return = mLnbs[in_lnbId]; -- GitLab From 4b77373e3774ba917164d5d140cd2cdb658fafc2 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Thu, 29 Jul 2021 18:42:13 -0700 Subject: [PATCH 093/825] Generate fmq java-source. Add @hide to adil to avoid API export in framework. Bug: 194739778 Test: make and use fmq java-source in framework Change-Id: Ie1f7e8f9a36a1f09258581d484843f372f56e03e --- common/fmq/aidl/Android.bp | 1 + common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/.hash | 1 + .../1/android/hardware/common/fmq/GrantorDescriptor.aidl | 1 + .../1/android/hardware/common/fmq/MQDescriptor.aidl | 1 + .../1/android/hardware/common/fmq/SynchronizedReadWrite.aidl | 1 + .../1/android/hardware/common/fmq/UnsynchronizedWrite.aidl | 1 + .../current/android/hardware/common/fmq/GrantorDescriptor.aidl | 1 + .../current/android/hardware/common/fmq/MQDescriptor.aidl | 1 + .../android/hardware/common/fmq/SynchronizedReadWrite.aidl | 1 + .../current/android/hardware/common/fmq/UnsynchronizedWrite.aidl | 1 + .../fmq/aidl/android/hardware/common/fmq/GrantorDescriptor.aidl | 1 + common/fmq/aidl/android/hardware/common/fmq/MQDescriptor.aidl | 1 + .../aidl/android/hardware/common/fmq/SynchronizedReadWrite.aidl | 1 + .../aidl/android/hardware/common/fmq/UnsynchronizedWrite.aidl | 1 + 14 files changed, 14 insertions(+) diff --git a/common/fmq/aidl/Android.bp b/common/fmq/aidl/Android.bp index 4b38241e03..3c414e7876 100644 --- a/common/fmq/aidl/Android.bp +++ b/common/fmq/aidl/Android.bp @@ -25,6 +25,7 @@ aidl_interface { backend: { java: { sdk_version: "module_current", + srcs_available: true, }, cpp: { enabled: false, diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/.hash b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/.hash index da122e601c..b88c5fcacb 100644 --- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/.hash +++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/.hash @@ -1 +1,2 @@ 12cf0ce8614557cc0efe73bdf011f5193f7a8653 +6a780550f6e6965d6969fd7964c3ca81b6b0ccdf diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/GrantorDescriptor.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/GrantorDescriptor.aidl index cf7048bc02..0430c6e65c 100644 --- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/GrantorDescriptor.aidl +++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/GrantorDescriptor.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.common.fmq; +/* @hide */ @VintfStability parcelable GrantorDescriptor { int fdIndex; diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/MQDescriptor.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/MQDescriptor.aidl index add4b64cf1..ab3af0f5d0 100644 --- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/MQDescriptor.aidl +++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/MQDescriptor.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.common.fmq; +/* @hide */ @VintfStability parcelable MQDescriptor { android.hardware.common.fmq.GrantorDescriptor[] grantors; diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/SynchronizedReadWrite.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/SynchronizedReadWrite.aidl index 12c61bab2e..72bab1c6e2 100644 --- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/SynchronizedReadWrite.aidl +++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/SynchronizedReadWrite.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.common.fmq; +/* @hide */ @VintfStability enum SynchronizedReadWrite { EMPTY = 0, diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/UnsynchronizedWrite.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/UnsynchronizedWrite.aidl index f99528d398..f3086881cb 100644 --- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/UnsynchronizedWrite.aidl +++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/1/android/hardware/common/fmq/UnsynchronizedWrite.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.common.fmq; +/* @hide */ @VintfStability enum UnsynchronizedWrite { EMPTY = 0, diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/GrantorDescriptor.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/GrantorDescriptor.aidl index cf7048bc02..0430c6e65c 100644 --- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/GrantorDescriptor.aidl +++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/GrantorDescriptor.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.common.fmq; +/* @hide */ @VintfStability parcelable GrantorDescriptor { int fdIndex; diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/MQDescriptor.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/MQDescriptor.aidl index add4b64cf1..ab3af0f5d0 100644 --- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/MQDescriptor.aidl +++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/MQDescriptor.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.common.fmq; +/* @hide */ @VintfStability parcelable MQDescriptor { android.hardware.common.fmq.GrantorDescriptor[] grantors; diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/SynchronizedReadWrite.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/SynchronizedReadWrite.aidl index 12c61bab2e..72bab1c6e2 100644 --- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/SynchronizedReadWrite.aidl +++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/SynchronizedReadWrite.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.common.fmq; +/* @hide */ @VintfStability enum SynchronizedReadWrite { EMPTY = 0, diff --git a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/UnsynchronizedWrite.aidl b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/UnsynchronizedWrite.aidl index f99528d398..f3086881cb 100644 --- a/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/UnsynchronizedWrite.aidl +++ b/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/android/hardware/common/fmq/UnsynchronizedWrite.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.common.fmq; +/* @hide */ @VintfStability enum UnsynchronizedWrite { EMPTY = 0, diff --git a/common/fmq/aidl/android/hardware/common/fmq/GrantorDescriptor.aidl b/common/fmq/aidl/android/hardware/common/fmq/GrantorDescriptor.aidl index 672415e65a..c6ca470e91 100644 --- a/common/fmq/aidl/android/hardware/common/fmq/GrantorDescriptor.aidl +++ b/common/fmq/aidl/android/hardware/common/fmq/GrantorDescriptor.aidl @@ -18,6 +18,7 @@ package android.hardware.common.fmq; /* * Included in MQDescriptor, for use with libfmq. + * @hide */ @VintfStability parcelable GrantorDescriptor { diff --git a/common/fmq/aidl/android/hardware/common/fmq/MQDescriptor.aidl b/common/fmq/aidl/android/hardware/common/fmq/MQDescriptor.aidl index 46622f00a9..f2fcb313b7 100644 --- a/common/fmq/aidl/android/hardware/common/fmq/MQDescriptor.aidl +++ b/common/fmq/aidl/android/hardware/common/fmq/MQDescriptor.aidl @@ -26,6 +26,7 @@ import android.hardware.common.fmq.GrantorDescriptor; * T - is used to specify the type of the payload * Flavor - is used to specify the type of the queue using * android.hardware.common.SynchronizedReadWrite or UnsynchronizedWrite + * @hide */ @VintfStability parcelable MQDescriptor { diff --git a/common/fmq/aidl/android/hardware/common/fmq/SynchronizedReadWrite.aidl b/common/fmq/aidl/android/hardware/common/fmq/SynchronizedReadWrite.aidl index 8c334423e0..8b1d0a1177 100644 --- a/common/fmq/aidl/android/hardware/common/fmq/SynchronizedReadWrite.aidl +++ b/common/fmq/aidl/android/hardware/common/fmq/SynchronizedReadWrite.aidl @@ -20,6 +20,7 @@ package android.hardware.common.fmq; * For use with android.hardware.common.MQDescriptor to specify which type of * queue to use. SynchronizedReadWrite is single reader, single writer, with no * overflow. All messages written need to be read. + * @hide */ @VintfStability enum SynchronizedReadWrite { diff --git a/common/fmq/aidl/android/hardware/common/fmq/UnsynchronizedWrite.aidl b/common/fmq/aidl/android/hardware/common/fmq/UnsynchronizedWrite.aidl index 24c4cce74c..5fe48c88d3 100644 --- a/common/fmq/aidl/android/hardware/common/fmq/UnsynchronizedWrite.aidl +++ b/common/fmq/aidl/android/hardware/common/fmq/UnsynchronizedWrite.aidl @@ -20,6 +20,7 @@ package android.hardware.common.fmq; * For use with android.hardware.common.MQDescriptor to specify which type of * queue to use. UnsynchronizedWrite is single writer, multiple reader, with * overflow. If messages are not read fast enough, they can be overwritten. + * @hide */ @VintfStability enum UnsynchronizedWrite { -- GitLab From 92545ca0131f251abab703dc6835d75a7675adde Mon Sep 17 00:00:00 2001 From: Hongguang Date: Mon, 2 Aug 2021 11:56:55 -0700 Subject: [PATCH 094/825] Generate face HAL java-source Bug: 194739778 Test: make and CTS cases in b/194739778 Change-Id: Iaf3cd972402017b4606fc494e4fe02acdca99767 --- biometrics/face/aidl/Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/biometrics/face/aidl/Android.bp b/biometrics/face/aidl/Android.bp index 27496fb322..3f53fc8cdf 100644 --- a/biometrics/face/aidl/Android.bp +++ b/biometrics/face/aidl/Android.bp @@ -22,6 +22,7 @@ aidl_interface { backend: { java: { platform_apis: true, + srcs_available: true, }, cpp: { enabled: false, -- GitLab From e24a0dce53f96b6f369cb851337cec2807c9440d Mon Sep 17 00:00:00 2001 From: Hongguang Date: Mon, 2 Aug 2021 21:53:43 -0700 Subject: [PATCH 095/825] Update tuner AIDL HAL. *) Remove unused FrontendDtmbCapabilities from ITuner. *) DemuxFilterTypeDemuxFilterSubType -> DemuxFilterSubType. Bug: 191825295 Test: make and run VtsHalTvTunerTargetTest Change-Id: I79cb58d3eff559d381a6cf13711250330d2066b1 --- ...terTypeDemuxFilterSubType.aidl => DemuxFilterSubType.aidl} | 2 +- .../current/android/hardware/tv/tuner/DemuxFilterType.aidl | 2 +- ...terTypeDemuxFilterSubType.aidl => DemuxFilterSubType.aidl} | 3 ++- tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterType.aidl | 4 ++-- tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl | 1 - 5 files changed, 6 insertions(+), 6 deletions(-) rename tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/{DemuxFilterTypeDemuxFilterSubType.aidl => DemuxFilterSubType.aidl} (98%) rename tv/tuner/aidl/android/hardware/tv/tuner/{DemuxFilterTypeDemuxFilterSubType.aidl => DemuxFilterSubType.aidl} (94%) diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSubType.aidl similarity index 98% rename from tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl rename to tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSubType.aidl index 2aa3a89665..2e2a774535 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSubType.aidl @@ -34,7 +34,7 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability -union DemuxFilterTypeDemuxFilterSubType { +union DemuxFilterSubType { android.hardware.tv.tuner.DemuxTsFilterType tsFilterType = android.hardware.tv.tuner.DemuxTsFilterType.UNDEFINED; android.hardware.tv.tuner.DemuxMmtpFilterType mmtpFilterType; android.hardware.tv.tuner.DemuxIpFilterType ipFilterType; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterType.aidl index 14f9202105..b2f499d65d 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterType.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterType.aidl @@ -36,5 +36,5 @@ package android.hardware.tv.tuner; @VintfStability parcelable DemuxFilterType { android.hardware.tv.tuner.DemuxFilterMainType mainType = android.hardware.tv.tuner.DemuxFilterMainType.UNDEFINED; - android.hardware.tv.tuner.DemuxFilterTypeDemuxFilterSubType subType; + android.hardware.tv.tuner.DemuxFilterSubType subType; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSubType.aidl similarity index 94% rename from tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl rename to tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSubType.aidl index cf1a59cc0d..3dfc0ae158 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterTypeDemuxFilterSubType.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSubType.aidl @@ -23,10 +23,11 @@ import android.hardware.tv.tuner.DemuxTlvFilterType; import android.hardware.tv.tuner.DemuxTsFilterType; /** + * The different Demux Filter Sub Types. * @hide */ @VintfStability -union DemuxFilterTypeDemuxFilterSubType { +union DemuxFilterSubType { DemuxTsFilterType tsFilterType = DemuxTsFilterType.UNDEFINED; DemuxMmtpFilterType mmtpFilterType; diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterType.aidl index 38348b64a5..f5eda6053e 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterType.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterType.aidl @@ -17,7 +17,7 @@ package android.hardware.tv.tuner; import android.hardware.tv.tuner.DemuxFilterMainType; -import android.hardware.tv.tuner.DemuxFilterTypeDemuxFilterSubType; +import android.hardware.tv.tuner.DemuxFilterSubType; /** * Demux Filter Type. @@ -27,5 +27,5 @@ import android.hardware.tv.tuner.DemuxFilterTypeDemuxFilterSubType; parcelable DemuxFilterType { DemuxFilterMainType mainType = DemuxFilterMainType.UNDEFINED; - DemuxFilterTypeDemuxFilterSubType subType; + DemuxFilterSubType subType; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl index f8810827e7..ab8b0b81a9 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl @@ -22,7 +22,6 @@ import android.hardware.tv.tuner.IDemux; import android.hardware.tv.tuner.IDescrambler; import android.hardware.tv.tuner.IFrontend; import android.hardware.tv.tuner.ILnb; -import android.hardware.tv.tuner.FrontendDtmbCapabilities; /** * Top level interface to manage Frontend, Demux and Decrambler hardware -- GitLab From ce1e30d578e43a0016017bb1ea162acb715525f8 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Mon, 2 Aug 2021 21:55:44 -0700 Subject: [PATCH 096/825] Update tuner default implementation and VTS. *) DemuxFilterTypeDemuxFilterSubType -> DemuxFilterSubType. Bug: 191825295 Test: make and run VtsHalTvTunerTargetTest Change-Id: I9069ff91d35b58ee1db4297f888ef241cdfbc135 --- tv/tuner/aidl/default/Filter.cpp | 16 +++---- .../aidl/vts/functional/DescramblerTests.cpp | 8 ++-- .../vts/functional/VtsHalTvTunerTargetTest.h | 10 ++--- .../VtsHalTvTunerTestConfigurations.h | 10 ++--- .../config/TunerTestingConfigAidlReaderV1_0.h | 44 +++++++++---------- 5 files changed, 43 insertions(+), 45 deletions(-) diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp index dd9bee3967..6c4b28cee1 100644 --- a/tv/tuner/aidl/default/Filter.cpp +++ b/tv/tuner/aidl/default/Filter.cpp @@ -46,29 +46,29 @@ Filter::Filter(DemuxFilterType type, int64_t filterId, uint32_t bufferSize, switch (mType.mainType) { case DemuxFilterMainType::TS: - if (mType.subType.get() == + if (mType.subType.get() == DemuxTsFilterType::AUDIO || - mType.subType.get() == + mType.subType.get() == DemuxTsFilterType::VIDEO) { mIsMediaFilter = true; } - if (mType.subType.get() == + if (mType.subType.get() == DemuxTsFilterType::PCR) { mIsPcrFilter = true; } - if (mType.subType.get() == + if (mType.subType.get() == DemuxTsFilterType::RECORD) { mIsRecordFilter = true; } break; case DemuxFilterMainType::MMTP: - if (mType.subType.get() == + if (mType.subType.get() == DemuxMmtpFilterType::AUDIO || - mType.subType.get() == + mType.subType.get() == DemuxMmtpFilterType::VIDEO) { mIsMediaFilter = true; } - if (mType.subType.get() == + if (mType.subType.get() == DemuxMmtpFilterType::RECORD) { mIsRecordFilter = true; } @@ -538,7 +538,7 @@ void Filter::updateRecordOutput(vector data) { std::lock_guard lock(mFilterOutputLock); switch (mType.mainType) { case DemuxFilterMainType::TS: - switch (mType.subType.get()) { + switch (mType.subType.get()) { case DemuxTsFilterType::UNDEFINED: break; case DemuxTsFilterType::SECTION: diff --git a/tv/tuner/aidl/vts/functional/DescramblerTests.cpp b/tv/tuner/aidl/vts/functional/DescramblerTests.cpp index e0ee39180b..157fa0479e 100644 --- a/tv/tuner/aidl/vts/functional/DescramblerTests.cpp +++ b/tv/tuner/aidl/vts/functional/DescramblerTests.cpp @@ -175,9 +175,9 @@ AssertionResult DescramblerTests::getDemuxPidFromFilterSettings(DemuxFilterType DemuxPid& pid) { switch (type.mainType) { case DemuxFilterMainType::TS: - if (type.subType.get() == + if (type.subType.get() == DemuxTsFilterType::AUDIO || - type.subType.get() == + type.subType.get() == DemuxTsFilterType::VIDEO) { pid.set(settings.get().tpid); } else { @@ -186,9 +186,9 @@ AssertionResult DescramblerTests::getDemuxPidFromFilterSettings(DemuxFilterType } break; case DemuxFilterMainType::MMTP: - if (type.subType.get() == + if (type.subType.get() == DemuxMmtpFilterType::AUDIO || - type.subType.get() == + type.subType.get() == DemuxMmtpFilterType::VIDEO) { pid.set( settings.get().mmtpPid); diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h index e5cee76a3f..13c5a801a5 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h @@ -146,23 +146,23 @@ class TunerFilterAidlTest : public testing::TestWithParam { type.mainType = static_cast(1 << bit); switch (type.mainType) { case DemuxFilterMainType::TS: - type.subType.set( + type.subType.set( DemuxTsFilterType::UNDEFINED); break; case DemuxFilterMainType::MMTP: - type.subType.set( + type.subType.set( DemuxMmtpFilterType::UNDEFINED); break; case DemuxFilterMainType::IP: - type.subType.set( + type.subType.set( DemuxIpFilterType::UNDEFINED); break; case DemuxFilterMainType::TLV: - type.subType.set( + type.subType.set( DemuxTlvFilterType::UNDEFINED); break; case DemuxFilterMainType::ALP: - type.subType.set( + type.subType.set( DemuxAlpFilterType::UNDEFINED); break; default: diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h index 1ddb641979..b4fb54f5a0 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h @@ -119,9 +119,8 @@ inline void initFilterConfig() { string defaultVideoFilterId = "FILTER_VIDEO_DEFAULT"; filterMap[defaultVideoFilterId].type.mainType = DemuxFilterMainType::TS; - filterMap[defaultVideoFilterId] - .type.subType.set( - DemuxTsFilterType::VIDEO); + filterMap[defaultVideoFilterId].type.subType.set( + DemuxTsFilterType::VIDEO); filterMap[defaultVideoFilterId].bufferSize = FMQ_SIZE_16M; filterMap[defaultVideoFilterId].settings = DemuxFilterSettings::make(); @@ -138,9 +137,8 @@ inline void initFilterConfig() { VideoStreamType::MPEG1); filterMap[defaultAudioFilterId].type.mainType = DemuxFilterMainType::TS; - filterMap[defaultAudioFilterId] - .type.subType.set( - DemuxTsFilterType::AUDIO); + filterMap[defaultAudioFilterId].type.subType.set( + DemuxTsFilterType::AUDIO); filterMap[defaultAudioFilterId].bufferSize = FMQ_SIZE_16M; filterMap[defaultAudioFilterId].settings = DemuxFilterSettings::make(); diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h index 8525b4fd18..2d7be9e5fa 100644 --- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h +++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h @@ -689,11 +689,11 @@ struct TunerTestingConfigAidlReader1_0 { bool isTsSet = false; switch (subType) { case FilterSubTypeEnum::UNDEFINED: - type.subType.set( + type.subType.set( DemuxTsFilterType::UNDEFINED); break; case FilterSubTypeEnum::SECTION: - type.subType.set( + type.subType.set( DemuxTsFilterType::SECTION); ts.filterSettings.set( readSectionFilterSettings(filterConfig)); @@ -701,46 +701,46 @@ struct TunerTestingConfigAidlReader1_0 { break; case FilterSubTypeEnum::PES: // TODO: b/182519645 support all the filter settings - type.subType.set( + type.subType.set( DemuxTsFilterType::PES); break; case FilterSubTypeEnum::TS: - type.subType.set( + type.subType.set( DemuxTsFilterType::TS); ts.filterSettings.set( true); isTsSet = true; break; case FilterSubTypeEnum::PCR: - type.subType.set( + type.subType.set( DemuxTsFilterType::PCR); ts.filterSettings.set( true); isTsSet = true; break; case FilterSubTypeEnum::TEMI: - type.subType.set( + type.subType.set( DemuxTsFilterType::TEMI); ts.filterSettings.set( true); isTsSet = true; break; case FilterSubTypeEnum::AUDIO: - type.subType.set( + type.subType.set( DemuxTsFilterType::AUDIO); ts.filterSettings.set( readAvFilterSettings(filterConfig)); isTsSet = true; break; case FilterSubTypeEnum::VIDEO: - type.subType.set( + type.subType.set( DemuxTsFilterType::VIDEO); ts.filterSettings.set( readAvFilterSettings(filterConfig)); isTsSet = true; break; case FilterSubTypeEnum::RECORD: - type.subType.set( + type.subType.set( DemuxTsFilterType::RECORD); ts.filterSettings.set( readRecordFilterSettings(filterConfig)); @@ -766,11 +766,11 @@ struct TunerTestingConfigAidlReader1_0 { bool isMmtpSet = false; switch (subType) { case FilterSubTypeEnum::UNDEFINED: - type.subType.set( + type.subType.set( DemuxMmtpFilterType::UNDEFINED); break; case FilterSubTypeEnum::SECTION: - type.subType.set( + type.subType.set( DemuxMmtpFilterType::SECTION); mmtp.filterSettings .set( @@ -778,40 +778,40 @@ struct TunerTestingConfigAidlReader1_0 { isMmtpSet = true; break; case FilterSubTypeEnum::PES: - type.subType.set( + type.subType.set( DemuxMmtpFilterType::PES); // TODO: b/182519645 support all the filter settings break; case FilterSubTypeEnum::MMTP: - type.subType.set( + type.subType.set( DemuxMmtpFilterType::MMTP); mmtp.filterSettings.set( true); isMmtpSet = true; break; case FilterSubTypeEnum::AUDIO: - type.subType.set( + type.subType.set( DemuxMmtpFilterType::AUDIO); mmtp.filterSettings.set( readAvFilterSettings(filterConfig)); isMmtpSet = true; break; case FilterSubTypeEnum::VIDEO: - type.subType.set( + type.subType.set( DemuxMmtpFilterType::VIDEO); mmtp.filterSettings.set( readAvFilterSettings(filterConfig)); isMmtpSet = true; break; case FilterSubTypeEnum::RECORD: - type.subType.set( + type.subType.set( DemuxMmtpFilterType::RECORD); mmtp.filterSettings.set( readRecordFilterSettings(filterConfig)); isMmtpSet = true; break; case FilterSubTypeEnum::DOWNLOAD: - type.subType.set( + type.subType.set( DemuxMmtpFilterType::DOWNLOAD); // TODO: b/182519645 support all the filter settings break; @@ -834,18 +834,18 @@ struct TunerTestingConfigAidlReader1_0 { DemuxIpFilterSettings ip; switch (subType) { case FilterSubTypeEnum::UNDEFINED: - type.subType.set( + type.subType.set( DemuxIpFilterType::UNDEFINED); break; case FilterSubTypeEnum::SECTION: - type.subType.set( + type.subType.set( DemuxIpFilterType::SECTION); ip.filterSettings.set( readSectionFilterSettings(filterConfig)); settings.set(ip); break; case FilterSubTypeEnum::NTP: - type.subType.set( + type.subType.set( DemuxIpFilterType::NTP); ip.filterSettings.set( true); @@ -860,14 +860,14 @@ struct TunerTestingConfigAidlReader1_0 { break; } case FilterSubTypeEnum::IP_PAYLOAD: - type.subType.set( + type.subType.set( DemuxIpFilterType::IP_PAYLOAD); ip.filterSettings.set( true); settings.set(ip); break; case FilterSubTypeEnum::PAYLOAD_THROUGH: - type.subType.set( + type.subType.set( DemuxIpFilterType::PAYLOAD_THROUGH); ip.filterSettings.set( true); -- GitLab From fdf37fc742d0f4a3fc7b29c3ac5f435532044eb6 Mon Sep 17 00:00:00 2001 From: Lu Chen Date: Tue, 3 Aug 2021 15:54:52 -0700 Subject: [PATCH 097/825] Make a few function parameters to be reference To avoid redundant copies of input data, const reference is used. Note that there is a behavior change when calling createMediaFilterEventWithIon: the output buffer will be cleared even if the operation fails to unblock future calls. Test: vts-tradefed run vts -m VtsHalTvTunerV1_1TargetTest Change-Id: Ib26f90930d288738c5b55843e2aecde5318c3786 --- tv/tuner/1.1/default/Filter.cpp | 21 ++++++++------------- tv/tuner/1.1/default/Filter.h | 12 ++++++------ 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/tv/tuner/1.1/default/Filter.cpp b/tv/tuner/1.1/default/Filter.cpp index 7d609ea3dc..e0c785eae4 100644 --- a/tv/tuner/1.1/default/Filter.cpp +++ b/tv/tuner/1.1/default/Filter.cpp @@ -532,7 +532,7 @@ uint16_t Filter::getTpid() { return mTpid; } -void Filter::updateFilterOutput(vector data) { +void Filter::updateFilterOutput(const vector& data) { std::lock_guard lock(mFilterOutputLock); mFilterOutput.insert(mFilterOutput.end(), data.begin(), data.end()); } @@ -542,7 +542,7 @@ void Filter::updatePts(uint64_t pts) { mPts = pts; } -void Filter::updateRecordOutput(vector data) { +void Filter::updateRecordOutput(const vector& data) { std::lock_guard lock(mRecordFilterOutputLock); mRecordFilterOutput.insert(mRecordFilterOutput.end(), data.begin(), data.end()); } @@ -689,9 +689,7 @@ Result Filter::startMediaFilterHandler() { Result result; if (mPts) { result = createMediaFilterEventWithIon(mFilterOutput); - if (result == Result::SUCCESS) { - mFilterOutput.clear(); - } + mFilterOutput.clear(); return result; } @@ -729,6 +727,7 @@ Result Filter::startMediaFilterHandler() { } result = createMediaFilterEventWithIon(mPesOutput); + mPesOutput.clear(); if (result != Result::SUCCESS) { return result; } @@ -739,7 +738,7 @@ Result Filter::startMediaFilterHandler() { return Result::SUCCESS; } -Result Filter::createMediaFilterEventWithIon(vector output) { +Result Filter::createMediaFilterEventWithIon(const vector& output) { if (mUsingSharedAvMem) { if (mSharedAvMemHandle.getNativeHandle() == nullptr) { return Result::UNKNOWN_ERROR; @@ -793,7 +792,7 @@ Result Filter::startTemiFilterHandler() { return Result::SUCCESS; } -bool Filter::writeSectionsAndCreateEvent(vector data) { +bool Filter::writeSectionsAndCreateEvent(const vector& data) { // TODO check how many sections has been read ALOGD("[Filter] section handler"); std::lock_guard lock(mFilterEventLock); @@ -874,7 +873,7 @@ native_handle_t* Filter::createNativeHandle(int fd) { return nativeHandle; } -Result Filter::createIndependentMediaEvents(vector output) { +Result Filter::createIndependentMediaEvents(const vector& output) { int av_fd = createAvIonFd(output.size()); if (av_fd == -1) { return Result::UNKNOWN_ERROR; @@ -912,8 +911,6 @@ Result Filter::createIndependentMediaEvents(vector output) { mFilterEvent.events.resize(size + 1); mFilterEvent.events[size].media(mediaEvent); - // Clear and log - output.clear(); mAvBufferCopyCount = 0; ::close(av_fd); if (DEBUG_FILTER) { @@ -922,7 +919,7 @@ Result Filter::createIndependentMediaEvents(vector output) { return Result::SUCCESS; } -Result Filter::createShareMemMediaEvents(vector output) { +Result Filter::createShareMemMediaEvents(const vector& output) { // copy the filtered data to the shared buffer uint8_t* sharedAvBuffer = getIonBuffer(mSharedAvMemHandle.getNativeHandle()->data[0], output.size() + mSharedAvMemOffset); @@ -955,8 +952,6 @@ Result Filter::createShareMemMediaEvents(vector output) { mFilterEvent.events.resize(size + 1); mFilterEvent.events[size].media(mediaEvent); - // Clear and log - output.clear(); if (DEBUG_FILTER) { ALOGD("[Filter] shared av data length %d", mediaEvent.dataLength); } diff --git a/tv/tuner/1.1/default/Filter.h b/tv/tuner/1.1/default/Filter.h index 659bebf178..1ea2f513a4 100644 --- a/tv/tuner/1.1/default/Filter.h +++ b/tv/tuner/1.1/default/Filter.h @@ -93,8 +93,8 @@ class Filter : public V1_1::IFilter { */ bool createFilterMQ(); uint16_t getTpid(); - void updateFilterOutput(vector data); - void updateRecordOutput(vector data); + void updateFilterOutput(const vector& data); + void updateRecordOutput(const vector& data); void updatePts(uint64_t pts); Result startFilterHandler(); Result startRecordFilterHandler(); @@ -177,7 +177,7 @@ class Filter : public V1_1::IFilter { void deleteEventFlag(); bool writeDataToFilterMQ(const std::vector& data); bool readDataFromMQ(); - bool writeSectionsAndCreateEvent(vector data); + bool writeSectionsAndCreateEvent(const vector& data); void maySendFilterStatusCallback(); DemuxFilterStatus checkFilterStatusChange(uint32_t availableToWrite, uint32_t availableToRead, uint32_t highThreshold, uint32_t lowThreshold); @@ -193,9 +193,9 @@ class Filter : public V1_1::IFilter { int createAvIonFd(int size); uint8_t* getIonBuffer(int fd, int size); native_handle_t* createNativeHandle(int fd); - Result createMediaFilterEventWithIon(vector output); - Result createIndependentMediaEvents(vector output); - Result createShareMemMediaEvents(vector output); + Result createMediaFilterEventWithIon(const vector& output); + Result createIndependentMediaEvents(const vector& output); + Result createShareMemMediaEvents(const vector& output); bool sameFile(int fd1, int fd2); DemuxFilterEvent createMediaEvent(); -- GitLab From 3a338c6829a57a70b720a060a112d341b1cc4b9a Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 13 Jul 2021 19:22:41 -0700 Subject: [PATCH 098/825] Add DEBUG_CMD in emulator message. Add DEBUG_CMD to allow emulator to send debug commands to VHAL. This is used to replace the special debug properites. Test: None Bug: 193565753 Change-Id: I5fe8fbae05e075e74c85aa6771f14c243003bc77 --- .../impl/vhal_v2_0/proto/VehicleHalProto.proto | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/VehicleHalProto.proto b/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/VehicleHalProto.proto index 4902a5d8fb..58daca619c 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/VehicleHalProto.proto +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/VehicleHalProto.proto @@ -32,6 +32,8 @@ enum MsgType { SET_PROPERTY_CMD = 8; SET_PROPERTY_RESP = 9; SET_PROPERTY_ASYNC = 10; + DEBUG_CMD = 11; + DEBUG_RESP = 12; } enum Status { RESULT_OK = 0; @@ -98,9 +100,11 @@ message VehiclePropGet { }; message EmulatorMessage { - required MsgType msg_type = 1; - optional Status status = 2; // Only for RESP messages - repeated VehiclePropGet prop = 3; // Provided for getConfig, getProperty commands - repeated VehiclePropConfig config = 4; - repeated VehiclePropValue value = 5; + required MsgType msg_type = 1; + optional Status status = 2; // Only for RESP messages + repeated VehiclePropGet prop = 3; // Provided for getConfig, getProperty commands + repeated VehiclePropConfig config = 4; + repeated VehiclePropValue value = 5; + repeated string debug_commands = 6; // Required for debug command + optional string debug_result = 7; // Required for debug RESP messages }; -- GitLab From 5fc72a6379d5c59befb9de86ff458bc7e413004b Mon Sep 17 00:00:00 2001 From: Hongguang Date: Tue, 3 Aug 2021 14:03:59 -0700 Subject: [PATCH 099/825] Fix a typo in ISDBT Frontend. FrontendIsdbtCoderate and FrontendIsdbtGuardInterval are typedefs in HIDL HAL. The hidl2aidl tool used the original types in the parcelable while conversion. And the wrong comment on FrontendIsdbtCoderate was herited from HIDL too. Bug: 191825295 Test: atest VtsHalTvTunerTargetTest Change-Id: I44679e171b353010e9ea9cdd84b09a715459b4e7 --- .../android/hardware/tv/tuner/FrontendGuardInterval.aidl | 2 +- .../android/hardware/tv/tuner/FrontendIsdbtSettings.aidl | 4 ++-- .../android/hardware/tv/tuner/FrontendGuardInterval.aidl | 4 +++- .../hardware/tv/tuner/FrontendIsdbtCapabilities.aidl | 4 ++-- .../android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl | 2 +- .../android/hardware/tv/tuner/FrontendIsdbtSettings.aidl | 8 ++++---- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendGuardInterval.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendGuardInterval.aidl index 3d9963316d..15c738a47c 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendGuardInterval.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendGuardInterval.aidl @@ -36,6 +36,6 @@ package android.hardware.tv.tuner; @VintfStability union FrontendGuardInterval { android.hardware.tv.tuner.FrontendDvbtGuardInterval dvbt = android.hardware.tv.tuner.FrontendDvbtGuardInterval.UNDEFINED; - android.hardware.tv.tuner.FrontendDvbtGuardInterval isdbt; + android.hardware.tv.tuner.FrontendIsdbtGuardInterval isdbt; android.hardware.tv.tuner.FrontendDtmbGuardInterval dtmb; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl index 5fcdf3638d..ffd30ef61c 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl @@ -41,7 +41,7 @@ parcelable FrontendIsdbtSettings { android.hardware.tv.tuner.FrontendIsdbtModulation modulation = android.hardware.tv.tuner.FrontendIsdbtModulation.UNDEFINED; android.hardware.tv.tuner.FrontendIsdbtBandwidth bandwidth = android.hardware.tv.tuner.FrontendIsdbtBandwidth.UNDEFINED; android.hardware.tv.tuner.FrontendIsdbtMode mode = android.hardware.tv.tuner.FrontendIsdbtMode.UNDEFINED; - android.hardware.tv.tuner.FrontendDvbtCoderate coderate = android.hardware.tv.tuner.FrontendDvbtCoderate.UNDEFINED; - android.hardware.tv.tuner.FrontendDvbtGuardInterval guardInterval = android.hardware.tv.tuner.FrontendDvbtGuardInterval.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtCoderate coderate = android.hardware.tv.tuner.FrontendIsdbtCoderate.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtGuardInterval guardInterval = android.hardware.tv.tuner.FrontendIsdbtGuardInterval.UNDEFINED; int serviceAreaId; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendGuardInterval.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendGuardInterval.aidl index 38935230da..cf82921479 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendGuardInterval.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendGuardInterval.aidl @@ -18,15 +18,17 @@ package android.hardware.tv.tuner; import android.hardware.tv.tuner.FrontendDvbtGuardInterval; import android.hardware.tv.tuner.FrontendDtmbGuardInterval; +import android.hardware.tv.tuner.FrontendIsdbtGuardInterval; /** + * The different Guard Interval Types. * @hide */ @VintfStability union FrontendGuardInterval { FrontendDvbtGuardInterval dvbt = FrontendDvbtGuardInterval.UNDEFINED; - FrontendDvbtGuardInterval isdbt; + FrontendIsdbtGuardInterval isdbt; FrontendDtmbGuardInterval dtmb; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl index 148090613e..4b764ad210 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl @@ -38,12 +38,12 @@ parcelable FrontendIsdbtCapabilities { int modulationCap; /** - * Code Rates defined by FrontendDvbtCoderate. + * Code Rates defined by FrontendIsdbtCoderate. */ int coderateCap; /** - * Guard Interval Types defined by FrontendDvbtGuardInterval. + * Guard Interval Types defined by FrontendIsdbtGuardInterval. */ int guardIntervalCap; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl index 0a857b1dd9..ee229c5907 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl @@ -17,7 +17,7 @@ package android.hardware.tv.tuner; /** - * Hierarchy Type for ISDBT. + * Code Rate for ISDBT. * @hide */ @VintfStability diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl index 73d935ad9b..ffa884558c 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl @@ -16,9 +16,9 @@ package android.hardware.tv.tuner; -import android.hardware.tv.tuner.FrontendDvbtCoderate; -import android.hardware.tv.tuner.FrontendDvbtGuardInterval; import android.hardware.tv.tuner.FrontendIsdbtBandwidth; +import android.hardware.tv.tuner.FrontendIsdbtCoderate; +import android.hardware.tv.tuner.FrontendIsdbtGuardInterval; import android.hardware.tv.tuner.FrontendIsdbtMode; import android.hardware.tv.tuner.FrontendIsdbtModulation; import android.hardware.tv.tuner.FrontendSpectralInversion; @@ -47,9 +47,9 @@ parcelable FrontendIsdbtSettings { FrontendIsdbtMode mode = FrontendIsdbtMode.UNDEFINED; - FrontendDvbtCoderate coderate = FrontendDvbtCoderate.UNDEFINED; + FrontendIsdbtCoderate coderate = FrontendIsdbtCoderate.UNDEFINED; - FrontendDvbtGuardInterval guardInterval = FrontendDvbtGuardInterval.UNDEFINED; + FrontendIsdbtGuardInterval guardInterval = FrontendIsdbtGuardInterval.UNDEFINED; int serviceAreaId; } -- GitLab From e69a3b29e797473762b7c2ebd78babd71f8d0e00 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Tue, 3 Aug 2021 14:23:42 -0700 Subject: [PATCH 100/825] Update tuner AIDL default implementation. *) Fix ISDBT Frontend in the default implementation. *) Merge ag/15455889. Bug: 191825295 Test: atest VtsHalTvTunerTargetTest Change-Id: I70029cfc856aadcdfda0d3c3a1eb1a80f9674e25 --- tv/tuner/aidl/default/Filter.cpp | 4 ++-- tv/tuner/aidl/default/Filter.h | 4 ++-- tv/tuner/aidl/default/Frontend.cpp | 2 +- tv/tuner/aidl/default/Tuner.cpp | 7 +++---- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp index 6c4b28cee1..77ca2ee62b 100644 --- a/tv/tuner/aidl/default/Filter.cpp +++ b/tv/tuner/aidl/default/Filter.cpp @@ -519,7 +519,7 @@ uint16_t Filter::getTpid() { return mTpid; } -void Filter::updateFilterOutput(vector data) { +void Filter::updateFilterOutput(vector& data) { std::lock_guard lock(mFilterOutputLock); mFilterOutput.insert(mFilterOutput.end(), data.begin(), data.end()); } @@ -529,7 +529,7 @@ void Filter::updatePts(uint64_t pts) { mPts = pts; } -void Filter::updateRecordOutput(vector data) { +void Filter::updateRecordOutput(vector& data) { std::lock_guard lock(mRecordFilterOutputLock); mRecordFilterOutput.insert(mRecordFilterOutput.end(), data.begin(), data.end()); } diff --git a/tv/tuner/aidl/default/Filter.h b/tv/tuner/aidl/default/Filter.h index 7a037e690e..4bb1a7266b 100644 --- a/tv/tuner/aidl/default/Filter.h +++ b/tv/tuner/aidl/default/Filter.h @@ -83,8 +83,8 @@ class Filter : public BnFilter { */ bool createFilterMQ(); uint16_t getTpid(); - void updateFilterOutput(vector data); - void updateRecordOutput(vector data); + void updateFilterOutput(vector& data); + void updateRecordOutput(vector& data); void updatePts(uint64_t pts); ::ndk::ScopedAStatus startFilterHandler(); ::ndk::ScopedAStatus startRecordFilterHandler(); diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index 7f7b989657..438f897446 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -532,7 +532,7 @@ Frontend::~Frontend() {} } case FrontendType::ISDBT: { interval.set( - FrontendDvbtGuardInterval::INTERVAL_1_32); // value = 1 << 1 + FrontendIsdbtGuardInterval::INTERVAL_1_32); // value = 1 << 1 status.set(interval); break; } diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp index 8335ffacce..94c90a7b12 100644 --- a/tv/tuner/aidl/default/Tuner.cpp +++ b/tv/tuner/aidl/default/Tuner.cpp @@ -114,10 +114,9 @@ Tuner::Tuner() { .modeCap = (int)FrontendIsdbtMode::MODE_1 | (int)FrontendIsdbtMode::MODE_2, .bandwidthCap = (int)FrontendIsdbtBandwidth::BANDWIDTH_6MHZ, .modulationCap = (int)FrontendIsdbtModulation::MOD_16QAM, - // ISDBT shares coderate and guard interval with DVBT - .coderateCap = (int)FrontendDvbtCoderate::CODERATE_4_5 | - (int)FrontendDvbtCoderate::CODERATE_6_7, - .guardIntervalCap = (int)FrontendDvbtGuardInterval::INTERVAL_1_128, + .coderateCap = (int)FrontendIsdbtCoderate::CODERATE_4_5 | + (int)FrontendIsdbtCoderate::CODERATE_6_7, + .guardIntervalCap = (int)FrontendIsdbtGuardInterval::INTERVAL_1_128, }; capsIsdbt.set(isdbtCaps); mFrontendCaps[5] = capsIsdbt; -- GitLab From c7ef39d1302ee1db56a794e60319e03c96e87b15 Mon Sep 17 00:00:00 2001 From: Dominik Laskowski Date: Tue, 3 Aug 2021 18:28:17 -0700 Subject: [PATCH 101/825] evs: Use ui::LayerStack Bug: 182939859 Test: Build Change-Id: I8d21e3a0bea81a351fb0c48882f92eb8c784ad80 --- automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp b/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp index 8cc18822f2..e1b9729286 100644 --- a/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp +++ b/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp @@ -630,7 +630,7 @@ TEST_P(EvsHidlTest, CameraToDisplayRoundTrip) { ASSERT_GT(height, 0); android::ui::DisplayState* pState = (android::ui::DisplayState*)state.data(); - ASSERT_NE(pState->layerStack, -1); + ASSERT_NE(pState->layerStack, android::ui::INVALID_LAYER_STACK); }); // Test each reported camera -- GitLab From c426c6dbdc8db86cc35d15cca6fb2b703280e4c2 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 4 Aug 2021 12:48:07 +0900 Subject: [PATCH 102/825] Remove ndk_platform backend. Use the ndk backend. The ndk_platform backend will soon be deprecated because the ndk backend can serve the same purpose. This is to eliminate the confusion about having two variants (ndk and ndk_platform) for the same ndk backend. Bug: 161456198 Test: m Change-Id: I0652f1efe920111d79dd8c2ecd52e55dda54538f --- automotive/audiocontrol/aidl/default/Android.bp | 4 ++-- automotive/vehicle/2.0/default/Android.bp | 10 +++++----- biometrics/face/aidl/default/Android.bp | 4 ++-- biometrics/face/aidl/vts/Android.bp | 8 ++++---- biometrics/fingerprint/aidl/default/Android.bp | 4 ++-- biometrics/fingerprint/aidl/vts/Android.bp | 6 +++--- gnss/1.1/default/Android.bp | 2 +- gnss/2.0/default/Android.bp | 2 +- gnss/2.1/default/Android.bp | 2 +- gnss/aidl/default/Android.bp | 2 +- gnss/common/utils/default/Android.bp | 2 +- power/aidl/default/Android.bp | 2 +- power/aidl/vts/Android.bp | 2 +- tests/extension/vibrator/aidl/client/Android.bp | 4 ++-- tests/extension/vibrator/aidl/default/Android.bp | 4 ++-- tv/tuner/aidl/default/Android.bp | 4 ++-- tv/tuner/aidl/vts/functional/Android.bp | 6 +++--- vibrator/aidl/default/Android.bp | 4 ++-- 18 files changed, 36 insertions(+), 36 deletions(-) diff --git a/automotive/audiocontrol/aidl/default/Android.bp b/automotive/audiocontrol/aidl/default/Android.bp index 7694bdf160..1439cce606 100644 --- a/automotive/audiocontrol/aidl/default/Android.bp +++ b/automotive/audiocontrol/aidl/default/Android.bp @@ -29,8 +29,8 @@ cc_binary { vendor: true, shared_libs: [ "android.hardware.audio.common@7.0-enums", - "android.frameworks.automotive.powerpolicy-V1-ndk_platform", - "android.hardware.automotive.audiocontrol-V1-ndk_platform", + "android.frameworks.automotive.powerpolicy-V1-ndk", + "android.hardware.automotive.audiocontrol-V1-ndk", "libbase", "libbinder_ndk", "libcutils", diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp index bd9e9b6049..f96654f056 100644 --- a/automotive/vehicle/2.0/default/Android.bp +++ b/automotive/vehicle/2.0/default/Android.bp @@ -41,7 +41,7 @@ cc_defaults { defaults: ["vhal_v2_0_defaults"], shared_libs: [ "libbinder_ndk", - "android.automotive.watchdog-V2-ndk_platform", + "android.automotive.watchdog-V2-ndk", ], } @@ -177,11 +177,11 @@ cc_test { // Exclude share libraries from default because they might be missing on // some test platforms and we are using static libraries instead. exclude_shared_libs: [ - "android.automotive.watchdog-V2-ndk_platform", + "android.automotive.watchdog-V2-ndk", "android.hardware.automotive.vehicle@2.0", ], static_libs: [ - "android.automotive.watchdog-V2-ndk_platform", + "android.automotive.watchdog-V2-ndk", "android.hardware.automotive.vehicle@2.0", ], header_libs: ["libbase_headers"], @@ -206,11 +206,11 @@ cc_test { // Exclude share libraries from default because they might be missing on // some test platforms and we are using static libraries instead. exclude_shared_libs: [ - "android.automotive.watchdog-V2-ndk_platform", + "android.automotive.watchdog-V2-ndk", "android.hardware.automotive.vehicle@2.0", ], whole_static_libs: [ - "android.automotive.watchdog-V2-ndk_platform", + "android.automotive.watchdog-V2-ndk", "android.hardware.automotive.vehicle@2.0", "android.hardware.automotive.vehicle@2.0-default-impl-lib", "android.hardware.automotive.vehicle@2.0-libproto-native", diff --git a/biometrics/face/aidl/default/Android.bp b/biometrics/face/aidl/default/Android.bp index d72411e6e2..509231859d 100644 --- a/biometrics/face/aidl/default/Android.bp +++ b/biometrics/face/aidl/default/Android.bp @@ -16,8 +16,8 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.biometrics.face-V1-ndk_platform", - "android.hardware.biometrics.common-V1-ndk_platform", + "android.hardware.biometrics.face-V1-ndk", + "android.hardware.biometrics.common-V1-ndk", ], srcs: [ "main.cpp", diff --git a/biometrics/face/aidl/vts/Android.bp b/biometrics/face/aidl/vts/Android.bp index 99c8c99488..09ec4d06e3 100644 --- a/biometrics/face/aidl/vts/Android.bp +++ b/biometrics/face/aidl/vts/Android.bp @@ -15,10 +15,10 @@ cc_test { ], srcs: ["VtsHalBiometricsFaceTargetTest.cpp"], static_libs: [ - "android.hardware.biometrics.common-V1-ndk_platform", - "android.hardware.biometrics.face-V1-ndk_platform", - "android.hardware.common-V2-ndk_platform", - "android.hardware.keymaster-V3-ndk_platform", + "android.hardware.biometrics.common-V1-ndk", + "android.hardware.biometrics.face-V1-ndk", + "android.hardware.common-V2-ndk", + "android.hardware.keymaster-V3-ndk", ], shared_libs: [ "libbinder_ndk", diff --git a/biometrics/fingerprint/aidl/default/Android.bp b/biometrics/fingerprint/aidl/default/Android.bp index 80e6e02cf1..08fe4b04b7 100644 --- a/biometrics/fingerprint/aidl/default/Android.bp +++ b/biometrics/fingerprint/aidl/default/Android.bp @@ -24,8 +24,8 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.biometrics.fingerprint-V1-ndk_platform", - "android.hardware.biometrics.common-V1-ndk_platform", + "android.hardware.biometrics.fingerprint-V1-ndk", + "android.hardware.biometrics.common-V1-ndk", ], } diff --git a/biometrics/fingerprint/aidl/vts/Android.bp b/biometrics/fingerprint/aidl/vts/Android.bp index 5539548856..30d5624144 100644 --- a/biometrics/fingerprint/aidl/vts/Android.bp +++ b/biometrics/fingerprint/aidl/vts/Android.bp @@ -15,9 +15,9 @@ cc_test { ], srcs: ["VtsHalBiometricsFingerprintTargetTest.cpp"], static_libs: [ - "android.hardware.biometrics.common-V1-ndk_platform", - "android.hardware.biometrics.fingerprint-V1-ndk_platform", - "android.hardware.keymaster-V3-ndk_platform", + "android.hardware.biometrics.common-V1-ndk", + "android.hardware.biometrics.fingerprint-V1-ndk", + "android.hardware.keymaster-V3-ndk", ], shared_libs: [ "libbinder_ndk", diff --git a/gnss/1.1/default/Android.bp b/gnss/1.1/default/Android.bp index ab87990ed1..3c9c29a7d6 100644 --- a/gnss/1.1/default/Android.bp +++ b/gnss/1.1/default/Android.bp @@ -27,7 +27,7 @@ cc_binary { "android.hardware.gnss@2.0", "android.hardware.gnss@1.1", "android.hardware.gnss@1.0", - "android.hardware.gnss-V1-ndk_platform", + "android.hardware.gnss-V1-ndk", ], static_libs: [ "android.hardware.gnss@common-default-lib", diff --git a/gnss/2.0/default/Android.bp b/gnss/2.0/default/Android.bp index 8ae9f956c4..695246ad53 100644 --- a/gnss/2.0/default/Android.bp +++ b/gnss/2.0/default/Android.bp @@ -50,7 +50,7 @@ cc_binary { "android.hardware.gnss@2.0", "android.hardware.gnss@1.1", "android.hardware.gnss@1.0", - "android.hardware.gnss-V1-ndk_platform", + "android.hardware.gnss-V1-ndk", ], static_libs: [ "android.hardware.gnss@common-default-lib", diff --git a/gnss/2.1/default/Android.bp b/gnss/2.1/default/Android.bp index 609f59e60f..c46c73545c 100644 --- a/gnss/2.1/default/Android.bp +++ b/gnss/2.1/default/Android.bp @@ -44,7 +44,7 @@ cc_binary { "android.hardware.gnss@1.0", "android.hardware.gnss@1.1", "android.hardware.gnss@2.0", - "android.hardware.gnss-V1-ndk_platform", + "android.hardware.gnss-V1-ndk", ], static_libs: [ "android.hardware.gnss@common-default-lib", diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index 4cc2b6e251..c028dd764e 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -52,7 +52,7 @@ cc_binary { "android.hardware.gnss.measurement_corrections@1.1", "android.hardware.gnss.measurement_corrections@1.0", "android.hardware.gnss.visibility_control@1.0", - "android.hardware.gnss-V1-ndk_platform", + "android.hardware.gnss-V1-ndk", ], srcs: [ "Gnss.cpp", diff --git a/gnss/common/utils/default/Android.bp b/gnss/common/utils/default/Android.bp index f9225c24d0..ac94cc1bc0 100644 --- a/gnss/common/utils/default/Android.bp +++ b/gnss/common/utils/default/Android.bp @@ -53,6 +53,6 @@ cc_library_static { "android.hardware.gnss@2.1", "android.hardware.gnss.measurement_corrections@1.1", "android.hardware.gnss.measurement_corrections@1.0", - "android.hardware.gnss-V1-ndk_platform", + "android.hardware.gnss-V1-ndk", ], } diff --git a/power/aidl/default/Android.bp b/power/aidl/default/Android.bp index c0ba9a079c..e10d329cd5 100644 --- a/power/aidl/default/Android.bp +++ b/power/aidl/default/Android.bp @@ -30,7 +30,7 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.power-V2-ndk_platform", + "android.hardware.power-V2-ndk", ], srcs: [ "main.cpp", diff --git a/power/aidl/vts/Android.bp b/power/aidl/vts/Android.bp index 3036b8202d..eccd872716 100644 --- a/power/aidl/vts/Android.bp +++ b/power/aidl/vts/Android.bp @@ -32,7 +32,7 @@ cc_test { "libbinder_ndk", ], static_libs: [ - "android.hardware.power-V2-ndk_platform", + "android.hardware.power-V2-ndk", ], test_suites: [ "vts", diff --git a/tests/extension/vibrator/aidl/client/Android.bp b/tests/extension/vibrator/aidl/client/Android.bp index afab263b82..284ac7459b 100644 --- a/tests/extension/vibrator/aidl/client/Android.bp +++ b/tests/extension/vibrator/aidl/client/Android.bp @@ -27,7 +27,7 @@ cc_test { "android.hardware.tests.extension.vibrator-V1-cpp", "libbinder_ndk", - "android.hardware.vibrator-V2-ndk_platform", - "android.hardware.tests.extension.vibrator-V1-ndk_platform", + "android.hardware.vibrator-V2-ndk", + "android.hardware.tests.extension.vibrator-V1-ndk", ], } diff --git a/tests/extension/vibrator/aidl/default/Android.bp b/tests/extension/vibrator/aidl/default/Android.bp index a200292330..0f3895f8de 100644 --- a/tests/extension/vibrator/aidl/default/Android.bp +++ b/tests/extension/vibrator/aidl/default/Android.bp @@ -28,7 +28,7 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.vibrator-V2-ndk_platform", - "android.hardware.tests.extension.vibrator-V2-ndk_platform", + "android.hardware.vibrator-V2-ndk", + "android.hardware.tests.extension.vibrator-V2-ndk", ], } diff --git a/tv/tuner/aidl/default/Android.bp b/tv/tuner/aidl/default/Android.bp index ba4af445e6..cb8f87b61e 100644 --- a/tv/tuner/aidl/default/Android.bp +++ b/tv/tuner/aidl/default/Android.bp @@ -29,8 +29,8 @@ cc_binary { "libaidlcommonsupport", ], shared_libs: [ - "android.hardware.common.fmq-V1-ndk_platform", - "android.hardware.tv.tuner-V1-ndk_platform", + "android.hardware.common.fmq-V1-ndk", + "android.hardware.tv.tuner-V1-ndk", "libbase", "libbinder_ndk", "libcutils", diff --git a/tv/tuner/aidl/vts/functional/Android.bp b/tv/tuner/aidl/vts/functional/Android.bp index 119230ee3e..e5fb1e6b22 100644 --- a/tv/tuner/aidl/vts/functional/Android.bp +++ b/tv/tuner/aidl/vts/functional/Android.bp @@ -51,9 +51,9 @@ cc_test { "android.hardware.cas@1.0", "android.hardware.cas@1.1", "android.hardware.cas@1.2", - "android.hardware.common-V2-ndk_platform", - "android.hardware.common.fmq-V1-ndk_platform", - "android.hardware.tv.tuner-V1-ndk_platform", + "android.hardware.common-V2-ndk", + "android.hardware.common.fmq-V1-ndk", + "android.hardware.tv.tuner-V1-ndk", "libaidlcommonsupport", "libfmq", "libcutils", diff --git a/vibrator/aidl/default/Android.bp b/vibrator/aidl/default/Android.bp index d463f51511..5a65e759f0 100644 --- a/vibrator/aidl/default/Android.bp +++ b/vibrator/aidl/default/Android.bp @@ -13,7 +13,7 @@ cc_library_static { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.vibrator-V2-ndk_platform", + "android.hardware.vibrator-V2-ndk", ], export_include_dirs: ["include"], srcs: [ @@ -35,7 +35,7 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.vibrator-V2-ndk_platform", + "android.hardware.vibrator-V2-ndk", ], static_libs: [ "libvibratorexampleimpl", -- GitLab From 278bb563bc3ba98d115483a16b37ed0b701c2405 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Wed, 4 Aug 2021 14:49:17 -0700 Subject: [PATCH 103/825] Cast packetSize to uint8_t before using. packetSize is int8_t on AIDL HAL, but packet size may be longer than 128, which will cause a HAL crash. Bug: 191825295 Test: atest android.media.tv.tuner.cts Test: atest VtsHalTvTunerTargetTest Change-Id: I9ee52d3cacab40e69f5f01dbe51c397fa09bfea0 --- tv/tuner/aidl/default/Dvr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tv/tuner/aidl/default/Dvr.cpp b/tv/tuner/aidl/default/Dvr.cpp index 51cb1e0d7b..9eadb8ce19 100644 --- a/tv/tuner/aidl/default/Dvr.cpp +++ b/tv/tuner/aidl/default/Dvr.cpp @@ -253,7 +253,8 @@ PlaybackStatus Dvr::checkPlaybackStatusChange(uint32_t availableToWrite, uint32_ bool Dvr::readPlaybackFMQ(bool isVirtualFrontend, bool isRecording) { // Read playback data from the input FMQ int size = mDvrMQ->availableToRead(); - int playbackPacketSize = mDvrSettings.get().packetSize; + uint8_t playbackPacketSize = + static_cast(mDvrSettings.get().packetSize); vector dataOutputBuffer; dataOutputBuffer.resize(playbackPacketSize); // Dispatch the packet to the PID matching filter output buffer -- GitLab From 5e9d9cde8e3f836b84c38ec675a7ae0db4dd895c Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 16 Jul 2021 18:11:39 -0700 Subject: [PATCH 104/825] Remove debug properties. After migrating all existing usage of debug properties, we no longer need them. Test: Local build. Bug: 193565753 Change-Id: I6d94ebf527ee0fbb3041cdf949f7c61f81488752 --- .../default/impl/vhal_v2_0/DefaultConfig.h | 40 ------ .../impl/vhal_v2_0/DefaultVehicleHal.cpp | 12 -- .../vhal_v2_0/DefaultVehicleHalServer.cpp | 121 ------------------ .../default/impl/vhal_v2_0/PropertyUtils.h | 90 ------------- .../vhal_v2_0/tests/DefaultVhalImpl_test.cpp | 2 +- 5 files changed, 1 insertion(+), 264 deletions(-) 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 0173a42c5a..11dc6eb11b 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 @@ -633,46 +633,6 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.floatValues = {101.0f}}}, - { - .config = - { - .prop = kGenerateFakeDataControllingProperty, - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {1, 0, 0, 2, 0, 0, 0, 0, 0}, - }, - }, - - { - .config = - { - .prop = kSetIntPropertyFromVehicleForTest, - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {0, 0, 0, 2, 1, 0, 0, 0, 0}, - }, - }, - - { - .config = - { - .prop = kSetFloatPropertyFromVehicleForTest, - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {0, 0, 1, 0, 1, 0, 1, 0, 0}, - }, - }, - - { - .config = - { - .prop = kSetBooleanPropertyFromVehicleForTest, - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {0, 1, 1, 0, 1, 0, 0, 0, 0}, - }, - }, - { .config = {.prop = kMixedTypePropertyForTest, .access = VehiclePropertyAccess::READ_WRITE, 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 25a698b9fc..7bc7198959 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 @@ -63,13 +63,6 @@ VehicleHal::VehiclePropValuePtr addTimestamp(VehicleHal::VehiclePropValuePtr v) } return v; } - -bool isDebugProperty(int propId) { - return (propId == kGenerateFakeDataControllingProperty || - propId == kSetIntPropertyFromVehicleForTest || - propId == kSetFloatPropertyFromVehicleForTest || - propId == kSetBooleanPropertyFromVehicleForTest); -} } // namespace VehicleHal::VehiclePropValuePtr DefaultVehicleHal::createVhalHeartBeatProp() { @@ -394,11 +387,6 @@ StatusCode DefaultVehicleHal::set(const VehiclePropValue& propValue) { // now, just returns OK; otherwise, hal clients crash with property not supported. return StatusCode::OK; } - if (isDebugProperty(propValue.prop)) { - // These are special debug properties and do not need a config or check. - // TODO(shanyu): Remove this after we remove debug properties. - return mVehicleClient->setProperty(propValue, /*updateStatus=*/false); - } int32_t property = propValue.prop; const VehiclePropConfig* config = mPropStore->getConfigOrNull(property); diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp index 2facc4b5bc..4704917286 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHalServer.cpp @@ -130,95 +130,6 @@ std::vector DefaultVehicleHalServer::onGetAllPropertyConfig() return mServerSidePropStore.getAllConfigs(); } -StatusCode DefaultVehicleHalServer::handleGenerateFakeDataRequest(const VehiclePropValue& request) { - constexpr bool updateStatus = true; - - LOG(INFO) << __func__; - const auto& v = request.value; - if (!v.int32Values.size()) { - LOG(ERROR) << __func__ << ": expected at least \"command\" field in int32Values"; - return StatusCode::INVALID_ARG; - } - - FakeDataCommand command = static_cast(v.int32Values[0]); - - switch (command) { - case FakeDataCommand::StartLinear: { - LOG(INFO) << __func__ << ", FakeDataCommand::StartLinear"; - if (v.int32Values.size() < 2) { - LOG(ERROR) << __func__ << ": expected property ID in int32Values"; - return StatusCode::INVALID_ARG; - } - if (!v.int64Values.size()) { - LOG(ERROR) << __func__ << ": interval is not provided in int64Values"; - return StatusCode::INVALID_ARG; - } - if (v.floatValues.size() < 3) { - LOG(ERROR) << __func__ << ": expected at least 3 elements in floatValues, got: " - << v.floatValues.size(); - return StatusCode::INVALID_ARG; - } - int32_t cookie = v.int32Values[1]; - getGeneratorHub()->registerGenerator( - cookie, std::make_unique(request)); - break; - } - case FakeDataCommand::StartJson: { - LOG(INFO) << __func__ << ", FakeDataCommand::StartJson"; - if (v.stringValue.empty()) { - LOG(ERROR) << __func__ << ": path to JSON file is missing"; - return StatusCode::INVALID_ARG; - } - int32_t cookie = std::hash()(v.stringValue); - auto generator = std::make_unique(request); - if (!generator->hasNext()) { - LOG(ERROR) << __func__ << ": invalid JSON file, no events"; - return StatusCode::INVALID_ARG; - } - getGeneratorHub()->registerGenerator(cookie, std::move(generator)); - break; - } - case FakeDataCommand::StopLinear: { - LOG(INFO) << __func__ << ", FakeDataCommand::StopLinear"; - if (v.int32Values.size() < 2) { - LOG(ERROR) << __func__ << ": expected property ID in int32Values"; - return StatusCode::INVALID_ARG; - } - int32_t cookie = v.int32Values[1]; - getGeneratorHub()->unregisterGenerator(cookie); - break; - } - case FakeDataCommand::StopJson: { - LOG(INFO) << __func__ << ", FakeDataCommand::StopJson"; - if (v.stringValue.empty()) { - LOG(ERROR) << __func__ << ": path to JSON file is missing"; - return StatusCode::INVALID_ARG; - } - int32_t cookie = std::hash()(v.stringValue); - getGeneratorHub()->unregisterGenerator(cookie); - break; - } - case FakeDataCommand::KeyPress: { - LOG(INFO) << __func__ << ", FakeDataCommand::KeyPress"; - int32_t keyCode = request.value.int32Values[2]; - int32_t display = request.value.int32Values[3]; - // Send back to HAL - onPropertyValueFromCar( - *createHwInputKeyProp(VehicleHwKeyInputAction::ACTION_DOWN, keyCode, display), - updateStatus); - onPropertyValueFromCar( - *createHwInputKeyProp(VehicleHwKeyInputAction::ACTION_UP, keyCode, display), - updateStatus); - break; - } - default: { - LOG(ERROR) << __func__ << ": unexpected command: " << toInt(command); - return StatusCode::INVALID_ARG; - } - } - return StatusCode::OK; -} - DefaultVehicleHalServer::VehiclePropValuePtr DefaultVehicleHalServer::createApPowerStateReq( VehicleApPowerStateReq state, int32_t param) { auto req = getValuePool()->obtain(VehiclePropertyType::INT32_VEC, 2); @@ -250,38 +161,6 @@ StatusCode DefaultVehicleHalServer::onSetProperty(const VehiclePropValue& value, // Some properties need to be treated non-trivially switch (value.prop) { - case kGenerateFakeDataControllingProperty: - return handleGenerateFakeDataRequest(value); - - // set the value from vehicle side, used in end to end test. - case kSetIntPropertyFromVehicleForTest: { - auto updatedPropValue = createVehiclePropValue(VehiclePropertyType::INT32, 1); - updatedPropValue->prop = value.value.int32Values[0]; - updatedPropValue->value.int32Values[0] = value.value.int32Values[1]; - updatedPropValue->timestamp = value.value.int64Values[0]; - updatedPropValue->areaId = value.areaId; - onPropertyValueFromCar(*updatedPropValue, updateStatus); - return StatusCode::OK; - } - case kSetFloatPropertyFromVehicleForTest: { - auto updatedPropValue = createVehiclePropValue(VehiclePropertyType::FLOAT, 1); - updatedPropValue->prop = value.value.int32Values[0]; - updatedPropValue->value.floatValues[0] = value.value.floatValues[0]; - updatedPropValue->timestamp = value.value.int64Values[0]; - updatedPropValue->areaId = value.areaId; - onPropertyValueFromCar(*updatedPropValue, updateStatus); - return StatusCode::OK; - } - case kSetBooleanPropertyFromVehicleForTest: { - auto updatedPropValue = createVehiclePropValue(VehiclePropertyType::BOOLEAN, 1); - updatedPropValue->prop = value.value.int32Values[1]; - updatedPropValue->value.int32Values[0] = value.value.int32Values[0]; - updatedPropValue->timestamp = value.value.int64Values[0]; - updatedPropValue->areaId = value.areaId; - onPropertyValueFromCar(*updatedPropValue, updateStatus); - return StatusCode::OK; - } - case AP_POWER_STATE_REPORT: switch (value.value.int32Values[0]) { case toInt(VehicleApPowerStateReport::DEEP_SLEEP_EXIT): diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h index 0880125b8e..ec43e8db5d 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h @@ -72,35 +72,6 @@ constexpr int WHEEL_FRONT_RIGHT = (int)VehicleAreaWheel::RIGHT_FRONT; constexpr int WHEEL_REAR_LEFT = (int)VehicleAreaWheel::LEFT_REAR; constexpr int WHEEL_REAR_RIGHT = (int)VehicleAreaWheel::RIGHT_REAR; -/** - * This property is used for test purpose to generate fake events. Here is the test package that - * is referencing this property definition: packages/services/Car/tests/vehiclehal_test - */ -const int32_t kGenerateFakeDataControllingProperty = - 0x0666 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; - -/** - * This property is used for test purpose to set properties' value from vehicle. - * For example: Mocking hard button press triggering a HVAC fan speed change. - * Android set kSetPropertyFromVehicleForTest with an array of integer {HVAC_FAN_SPEED, value of - * fan speed} and a long value indicates the timestamp of the events . - * It only works with integer type properties. - */ -const int32_t kSetIntPropertyFromVehicleForTest = - 0x1112 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; -/** - * This property is used for test purpose to set properties' value from vehicle. - * It only works with float type properties. - */ -const int32_t kSetFloatPropertyFromVehicleForTest = - 0x1113 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; -/** - * This property is used for test purpose to set properties' value from vehicle. - * It only works with boolean type properties. - */ -const int32_t kSetBooleanPropertyFromVehicleForTest = - 0x1114 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; - /** * This property is used for test purpose. End to end tests use this property to test set and get * method for MIXED type properties. @@ -129,67 +100,6 @@ constexpr int32_t VENDOR_CLUSTER_NAVIGATION_STATE = toVendor(VehicleProperty::CLUSTER_NAVIGATION_STATE); #endif // ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING -/** - * FakeDataCommand enum defines the supported command type for kGenerateFakeDataControllingProperty. - * All those commands can be send independently with each other. And each will override the one sent - * previously. - * - * The controlling property has the following format: - * - * int32Values[0] - command enum defined in FakeDataCommand - * - * The format of the arguments is defined for each command type as below: - */ -enum class FakeDataCommand : int32_t { - /** - * Starts linear fake data generation. Caller must provide additional data: - * int32Values[1] - vehicle property to which command applies - * int64Values[0] - periodic interval in nanoseconds - * floatValues[0] - initial value - * floatValues[1] - dispersion defines the min/max value relative to initial value, where - * max = initial_value + dispersion, min = initial_value - dispersion. - * Dispersion should be non-negative, otherwise the behavior is undefined. - * floatValues[2] - increment, with every timer tick the value will be incremented by this - * amount. When reaching to max value, the current value will be set to - * min. It should be non-negative, otherwise the behavior is undefined. - */ - StartLinear = 0, - - /** Stops linear fake data generation that was triggered by StartLinear commands. - * int32Values[1] - vehicle property to which command applies. VHAL will stop the - * corresponding linear generation for that property. - */ - StopLinear = 1, - - /** - * Starts JSON-based fake data generation. It iterates through JSON-encoded VHAL events from a - * file and inject them to VHAL. The iteration can be repeated multiple times or infinitely. - * Caller must provide additional data: - * int32Values[1] - number of iterations. If it is not provided or -1. The iteration will be - * repeated infinite times. - * stringValue - path to the fake values JSON file - */ - StartJson = 2, - - /** - * Stops JSON-based fake data generation. As multiple JSON-based generation can happen at the - * same time. Caller must provide the path of fake value JSON file to stop the corresponding - * generation: - * stringValue - path to the fake values JSON file - */ - StopJson = 3, - - /** - * Injects key press event (HAL incorporates UP/DOWN acction and triggers 2 HAL events for every - * key-press). We set the enum with high number to leave space for future start/stop commands. - * Caller must provide the following data: - * int32Values[2] - Android key code - * int32Values[3] - target display (0 - for main display, 1 - for instrument cluster, see - * VehicleDisplay) - */ - KeyPress = 100, -}; - const int32_t kHvacPowerProperties[] = { toInt(VehicleProperty::HVAC_FAN_SPEED), toInt(VehicleProperty::HVAC_FAN_DIRECTION), 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 e3c8dd6c79..0233bddb88 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 @@ -141,7 +141,7 @@ class DefaultVhalImplTest : public ::testing::Test { TEST_F(DefaultVhalImplTest, testListProperties) { std::vector configs = mHal->listProperties(); - EXPECT_EQ((size_t)121, configs.size()); + EXPECT_EQ((size_t)117, configs.size()); } TEST_F(DefaultVhalImplTest, testGetDefaultPropertyFloat) { -- GitLab From 50899fb2696d2bb98a4807a237e124f566293f57 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Thu, 5 Aug 2021 22:51:58 -0700 Subject: [PATCH 105/825] Fix tuner example crash. Bug: 195717690 Fix: 195717690 Test: atest VtsHalTvTunerTargetTest Change-Id: Ie1ac0f12f9802ac55f1e35ff8dc7c0c34ccce086 --- tv/tuner/aidl/default/Demux.cpp | 11 +++++------ tv/tuner/aidl/default/Demux.h | 4 ++-- tv/tuner/aidl/default/Dvr.cpp | 3 +-- tv/tuner/aidl/default/Dvr.h | 5 ++--- tv/tuner/aidl/default/Filter.cpp | 2 +- tv/tuner/aidl/default/Filter.h | 6 +++--- tv/tuner/aidl/default/Frontend.cpp | 2 +- tv/tuner/aidl/default/Frontend.h | 4 ++-- tv/tuner/aidl/default/TimeFilter.cpp | 2 +- tv/tuner/aidl/default/TimeFilter.h | 4 ++-- tv/tuner/aidl/default/Tuner.cpp | 22 +++++++++++----------- 11 files changed, 31 insertions(+), 34 deletions(-) diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp index d5a653b3e6..bdc3849e34 100644 --- a/tv/tuner/aidl/default/Demux.cpp +++ b/tv/tuner/aidl/default/Demux.cpp @@ -31,7 +31,7 @@ namespace tuner { #define WAIT_TIMEOUT 3000000000 -Demux::Demux(int32_t demuxId, std::shared_ptr tuner) { +Demux::Demux(int32_t demuxId, Tuner* tuner) { mDemuxId = demuxId; mTuner = tuner; } @@ -76,7 +76,7 @@ Demux::~Demux() { } std::shared_ptr filter = - ndk::SharedRefBase::make(in_type, filterId, in_bufferSize, in_cb, ref()); + ndk::SharedRefBase::make(in_type, filterId, in_bufferSize, in_cb, this); if (!filter->createFilterMQ()) { *_aidl_return = nullptr; return ::ndk::ScopedAStatus::fromServiceSpecificError( @@ -110,7 +110,7 @@ Demux::~Demux() { ::ndk::ScopedAStatus Demux::openTimeFilter(std::shared_ptr* _aidl_return) { ALOGV("%s", __FUNCTION__); - mTimeFilter = ndk::SharedRefBase::make(ref()); + mTimeFilter = ndk::SharedRefBase::make(this); *_aidl_return = mTimeFilter; return ::ndk::ScopedAStatus::ok(); @@ -201,8 +201,7 @@ Demux::~Demux() { set::iterator it; switch (in_type) { case DvrType::PLAYBACK: - mDvrPlayback = - ndk::SharedRefBase::make(in_type, in_bufferSize, in_cb, ref()); + mDvrPlayback = ndk::SharedRefBase::make(in_type, in_bufferSize, in_cb, this); if (!mDvrPlayback->createDvrMQ()) { mDvrPlayback = nullptr; *_aidl_return = mDvrPlayback; @@ -223,7 +222,7 @@ Demux::~Demux() { *_aidl_return = mDvrPlayback; return ::ndk::ScopedAStatus::ok(); case DvrType::RECORD: - mDvrRecord = ndk::SharedRefBase::make(in_type, in_bufferSize, in_cb, ref()); + mDvrRecord = ndk::SharedRefBase::make(in_type, in_bufferSize, in_cb, this); if (!mDvrRecord->createDvrMQ()) { mDvrRecord = nullptr; *_aidl_return = mDvrRecord; diff --git a/tv/tuner/aidl/default/Demux.h b/tv/tuner/aidl/default/Demux.h index 4d9b7fe911..4cfcaab2ac 100644 --- a/tv/tuner/aidl/default/Demux.h +++ b/tv/tuner/aidl/default/Demux.h @@ -50,7 +50,7 @@ class Tuner; class Demux : public BnDemux { public: - Demux(int32_t demuxId, std::shared_ptr tuner); + Demux(int32_t demuxId, Tuner* tuner); ~Demux(); ::ndk::ScopedAStatus setFrontendDataSource(int32_t in_frontendId) override; @@ -95,7 +95,7 @@ class Demux : public BnDemux { private: // Tuner service - std::shared_ptr mTuner; + Tuner* mTuner; // Frontend source std::shared_ptr mFrontend; diff --git a/tv/tuner/aidl/default/Dvr.cpp b/tv/tuner/aidl/default/Dvr.cpp index 9eadb8ce19..7c9c44c76f 100644 --- a/tv/tuner/aidl/default/Dvr.cpp +++ b/tv/tuner/aidl/default/Dvr.cpp @@ -31,8 +31,7 @@ namespace tuner { #define WAIT_TIMEOUT 3000000000 -Dvr::Dvr(DvrType type, uint32_t bufferSize, const std::shared_ptr& cb, - std::shared_ptr demux) { +Dvr::Dvr(DvrType type, uint32_t bufferSize, const std::shared_ptr& cb, Demux* demux) { mType = type; mBufferSize = bufferSize; mCallback = cb; diff --git a/tv/tuner/aidl/default/Dvr.h b/tv/tuner/aidl/default/Dvr.h index 68933aed70..2e964495e3 100644 --- a/tv/tuner/aidl/default/Dvr.h +++ b/tv/tuner/aidl/default/Dvr.h @@ -57,8 +57,7 @@ class Tuner; class Dvr : public BnDvr { public: - Dvr(DvrType type, uint32_t bufferSize, const std::shared_ptr& cb, - std::shared_ptr demux); + Dvr(DvrType type, uint32_t bufferSize, const std::shared_ptr& cb, Demux* demux); ~Dvr(); ::ndk::ScopedAStatus getQueueDesc( @@ -88,7 +87,7 @@ class Dvr : public BnDvr { private: // Demux service - std::shared_ptr mDemux; + Demux* mDemux; DvrType mType; uint32_t mBufferSize; diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp index 77ca2ee62b..681eb04409 100644 --- a/tv/tuner/aidl/default/Filter.cpp +++ b/tv/tuner/aidl/default/Filter.cpp @@ -37,7 +37,7 @@ namespace tuner { Filter::Filter() {} Filter::Filter(DemuxFilterType type, int64_t filterId, uint32_t bufferSize, - const std::shared_ptr& cb, std::shared_ptr demux) { + const std::shared_ptr& cb, Demux* demux) { mType = type; mFilterId = filterId; mBufferSize = bufferSize; diff --git a/tv/tuner/aidl/default/Filter.h b/tv/tuner/aidl/default/Filter.h index 4bb1a7266b..1dbba453e5 100644 --- a/tv/tuner/aidl/default/Filter.h +++ b/tv/tuner/aidl/default/Filter.h @@ -54,7 +54,7 @@ class Filter : public BnFilter { Filter(); Filter(DemuxFilterType type, int64_t filterId, uint32_t bufferSize, - const std::shared_ptr& cb, std::shared_ptr demux); + const std::shared_ptr& cb, Demux* demux); ~Filter(); @@ -96,8 +96,8 @@ class Filter : public BnFilter { bool isRecordFilter() { return mIsRecordFilter; }; private: - // Tuner service - std::shared_ptr mDemux; + // Demux service + Demux* mDemux; // Dvr reference once the filter is attached to any std::shared_ptr mDvr = nullptr; /** diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index 438f897446..78d8279b9b 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -28,7 +28,7 @@ namespace hardware { namespace tv { namespace tuner { -Frontend::Frontend(FrontendType type, int32_t id, std::shared_ptr tuner) { +Frontend::Frontend(FrontendType type, int32_t id, Tuner* tuner) { mType = type; mId = id; mTuner = tuner; diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h index 3c602cff8f..a98cc92f6d 100644 --- a/tv/tuner/aidl/default/Frontend.h +++ b/tv/tuner/aidl/default/Frontend.h @@ -33,7 +33,7 @@ class Tuner; class Frontend : public BnFrontend { public: - Frontend(FrontendType type, int32_t id, std::shared_ptr tuner); + Frontend(FrontendType type, int32_t id, Tuner* tuner); ::ndk::ScopedAStatus setCallback( const std::shared_ptr& in_callback) override; @@ -59,7 +59,7 @@ class Frontend : public BnFrontend { virtual ~Frontend(); bool supportsSatellite(); std::shared_ptr mCallback; - std::shared_ptr mTuner; + Tuner* mTuner; FrontendType mType = FrontendType::UNDEFINED; int32_t mId = 0; bool mIsLocked = false; diff --git a/tv/tuner/aidl/default/TimeFilter.cpp b/tv/tuner/aidl/default/TimeFilter.cpp index dde7be34ca..3b1edd2ba1 100644 --- a/tv/tuner/aidl/default/TimeFilter.cpp +++ b/tv/tuner/aidl/default/TimeFilter.cpp @@ -30,7 +30,7 @@ namespace tuner { TimeFilter::TimeFilter() {} -TimeFilter::TimeFilter(std::shared_ptr demux) { +TimeFilter::TimeFilter(Demux* demux) { mDemux = demux; } diff --git a/tv/tuner/aidl/default/TimeFilter.h b/tv/tuner/aidl/default/TimeFilter.h index ff35c47d70..44e941c18b 100644 --- a/tv/tuner/aidl/default/TimeFilter.h +++ b/tv/tuner/aidl/default/TimeFilter.h @@ -35,7 +35,7 @@ class Demux; class TimeFilter : public BnTimeFilter { public: TimeFilter(); - TimeFilter(std::shared_ptr demux); + TimeFilter(Demux* demux); ~TimeFilter(); ::ndk::ScopedAStatus setTimeStamp(int64_t in_timeStamp) override; @@ -45,7 +45,7 @@ class TimeFilter : public BnTimeFilter { ::ndk::ScopedAStatus close() override; private: - std::shared_ptr mDemux; + Demux* mDemux; uint64_t mTimeStamp = INVALID_TIME_STAMP; time_t mBeginTime; }; diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp index 94c90a7b12..7e49660130 100644 --- a/tv/tuner/aidl/default/Tuner.cpp +++ b/tv/tuner/aidl/default/Tuner.cpp @@ -36,16 +36,16 @@ Tuner::Tuner() { // Static Frontends array to maintain local frontends information // Array index matches their FrontendId in the default impl mFrontendSize = 10; - mFrontends[0] = ndk::SharedRefBase::make(FrontendType::ISDBS, 0, ref()); - mFrontends[1] = ndk::SharedRefBase::make(FrontendType::ATSC3, 1, ref()); - mFrontends[2] = ndk::SharedRefBase::make(FrontendType::DVBC, 2, ref()); - mFrontends[3] = ndk::SharedRefBase::make(FrontendType::DVBS, 3, ref()); - mFrontends[4] = ndk::SharedRefBase::make(FrontendType::DVBT, 4, ref()); - mFrontends[5] = ndk::SharedRefBase::make(FrontendType::ISDBT, 5, ref()); - mFrontends[6] = ndk::SharedRefBase::make(FrontendType::ANALOG, 6, ref()); - mFrontends[7] = ndk::SharedRefBase::make(FrontendType::ATSC, 7, ref()); - mFrontends[8] = ndk::SharedRefBase::make(FrontendType::ISDBS3, 8, ref()); - mFrontends[9] = ndk::SharedRefBase::make(FrontendType::DTMB, 9, ref()); + mFrontends[0] = ndk::SharedRefBase::make(FrontendType::ISDBS, 0, this); + mFrontends[1] = ndk::SharedRefBase::make(FrontendType::ATSC3, 1, this); + mFrontends[2] = ndk::SharedRefBase::make(FrontendType::DVBC, 2, this); + mFrontends[3] = ndk::SharedRefBase::make(FrontendType::DVBS, 3, this); + mFrontends[4] = ndk::SharedRefBase::make(FrontendType::DVBT, 4, this); + mFrontends[5] = ndk::SharedRefBase::make(FrontendType::ISDBT, 5, this); + mFrontends[6] = ndk::SharedRefBase::make(FrontendType::ANALOG, 6, this); + mFrontends[7] = ndk::SharedRefBase::make(FrontendType::ATSC, 7, this); + mFrontends[8] = ndk::SharedRefBase::make(FrontendType::ISDBS3, 8, this); + mFrontends[9] = ndk::SharedRefBase::make(FrontendType::DTMB, 9, this); vector statusCaps; @@ -212,7 +212,7 @@ Tuner::~Tuner() {} ALOGV("%s", __FUNCTION__); mLastUsedId += 1; - mDemuxes[mLastUsedId] = ndk::SharedRefBase::make(mLastUsedId, ref()); + mDemuxes[mLastUsedId] = ndk::SharedRefBase::make(mLastUsedId, this); out_demuxId->push_back(mLastUsedId); *_aidl_return = mDemuxes[mLastUsedId]; -- GitLab From ff2c6b0d85facde86d4ffdeed903d7f96d9b2d11 Mon Sep 17 00:00:00 2001 From: Hongguang Chen Date: Sat, 7 Aug 2021 00:12:26 +0000 Subject: [PATCH 106/825] Add init() to avoid crash when creating ref in constructor. This reverts commit 50899fb2696d2bb98a4807a237e124f566293f57. Bug: 195717690 Fix: 195717690 Test: atest VtsHalTvTunerTargetTest Change-Id: Icae435f1166e6cf2e2f235979e3d1d37d182d517 --- tv/tuner/aidl/default/Demux.cpp | 14 ++++++++------ tv/tuner/aidl/default/Demux.h | 4 ++-- tv/tuner/aidl/default/Dvr.cpp | 3 ++- tv/tuner/aidl/default/Dvr.h | 5 +++-- tv/tuner/aidl/default/Filter.cpp | 2 +- tv/tuner/aidl/default/Filter.h | 4 ++-- tv/tuner/aidl/default/Frontend.cpp | 2 +- tv/tuner/aidl/default/Frontend.h | 4 ++-- tv/tuner/aidl/default/TimeFilter.cpp | 2 +- tv/tuner/aidl/default/TimeFilter.h | 4 ++-- tv/tuner/aidl/default/Tuner.cpp | 26 ++++++++++++++------------ tv/tuner/aidl/default/Tuner.h | 1 + tv/tuner/aidl/default/service.cpp | 1 + 13 files changed, 40 insertions(+), 32 deletions(-) diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp index bdc3849e34..3937c6ab25 100644 --- a/tv/tuner/aidl/default/Demux.cpp +++ b/tv/tuner/aidl/default/Demux.cpp @@ -31,7 +31,7 @@ namespace tuner { #define WAIT_TIMEOUT 3000000000 -Demux::Demux(int32_t demuxId, Tuner* tuner) { +Demux::Demux(int32_t demuxId, std::shared_ptr tuner) { mDemuxId = demuxId; mTuner = tuner; } @@ -75,8 +75,8 @@ Demux::~Demux() { static_cast(Result::INVALID_ARGUMENT)); } - std::shared_ptr filter = - ndk::SharedRefBase::make(in_type, filterId, in_bufferSize, in_cb, this); + std::shared_ptr filter = ndk::SharedRefBase::make( + in_type, filterId, in_bufferSize, in_cb, this->ref()); if (!filter->createFilterMQ()) { *_aidl_return = nullptr; return ::ndk::ScopedAStatus::fromServiceSpecificError( @@ -110,7 +110,7 @@ Demux::~Demux() { ::ndk::ScopedAStatus Demux::openTimeFilter(std::shared_ptr* _aidl_return) { ALOGV("%s", __FUNCTION__); - mTimeFilter = ndk::SharedRefBase::make(this); + mTimeFilter = ndk::SharedRefBase::make(this->ref()); *_aidl_return = mTimeFilter; return ::ndk::ScopedAStatus::ok(); @@ -201,7 +201,8 @@ Demux::~Demux() { set::iterator it; switch (in_type) { case DvrType::PLAYBACK: - mDvrPlayback = ndk::SharedRefBase::make(in_type, in_bufferSize, in_cb, this); + mDvrPlayback = ndk::SharedRefBase::make(in_type, in_bufferSize, in_cb, + this->ref()); if (!mDvrPlayback->createDvrMQ()) { mDvrPlayback = nullptr; *_aidl_return = mDvrPlayback; @@ -222,7 +223,8 @@ Demux::~Demux() { *_aidl_return = mDvrPlayback; return ::ndk::ScopedAStatus::ok(); case DvrType::RECORD: - mDvrRecord = ndk::SharedRefBase::make(in_type, in_bufferSize, in_cb, this); + mDvrRecord = ndk::SharedRefBase::make(in_type, in_bufferSize, in_cb, + this->ref()); if (!mDvrRecord->createDvrMQ()) { mDvrRecord = nullptr; *_aidl_return = mDvrRecord; diff --git a/tv/tuner/aidl/default/Demux.h b/tv/tuner/aidl/default/Demux.h index 4cfcaab2ac..4d9b7fe911 100644 --- a/tv/tuner/aidl/default/Demux.h +++ b/tv/tuner/aidl/default/Demux.h @@ -50,7 +50,7 @@ class Tuner; class Demux : public BnDemux { public: - Demux(int32_t demuxId, Tuner* tuner); + Demux(int32_t demuxId, std::shared_ptr tuner); ~Demux(); ::ndk::ScopedAStatus setFrontendDataSource(int32_t in_frontendId) override; @@ -95,7 +95,7 @@ class Demux : public BnDemux { private: // Tuner service - Tuner* mTuner; + std::shared_ptr mTuner; // Frontend source std::shared_ptr mFrontend; diff --git a/tv/tuner/aidl/default/Dvr.cpp b/tv/tuner/aidl/default/Dvr.cpp index 7c9c44c76f..9eadb8ce19 100644 --- a/tv/tuner/aidl/default/Dvr.cpp +++ b/tv/tuner/aidl/default/Dvr.cpp @@ -31,7 +31,8 @@ namespace tuner { #define WAIT_TIMEOUT 3000000000 -Dvr::Dvr(DvrType type, uint32_t bufferSize, const std::shared_ptr& cb, Demux* demux) { +Dvr::Dvr(DvrType type, uint32_t bufferSize, const std::shared_ptr& cb, + std::shared_ptr demux) { mType = type; mBufferSize = bufferSize; mCallback = cb; diff --git a/tv/tuner/aidl/default/Dvr.h b/tv/tuner/aidl/default/Dvr.h index 2e964495e3..68933aed70 100644 --- a/tv/tuner/aidl/default/Dvr.h +++ b/tv/tuner/aidl/default/Dvr.h @@ -57,7 +57,8 @@ class Tuner; class Dvr : public BnDvr { public: - Dvr(DvrType type, uint32_t bufferSize, const std::shared_ptr& cb, Demux* demux); + Dvr(DvrType type, uint32_t bufferSize, const std::shared_ptr& cb, + std::shared_ptr demux); ~Dvr(); ::ndk::ScopedAStatus getQueueDesc( @@ -87,7 +88,7 @@ class Dvr : public BnDvr { private: // Demux service - Demux* mDemux; + std::shared_ptr mDemux; DvrType mType; uint32_t mBufferSize; diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp index 681eb04409..77ca2ee62b 100644 --- a/tv/tuner/aidl/default/Filter.cpp +++ b/tv/tuner/aidl/default/Filter.cpp @@ -37,7 +37,7 @@ namespace tuner { Filter::Filter() {} Filter::Filter(DemuxFilterType type, int64_t filterId, uint32_t bufferSize, - const std::shared_ptr& cb, Demux* demux) { + const std::shared_ptr& cb, std::shared_ptr demux) { mType = type; mFilterId = filterId; mBufferSize = bufferSize; diff --git a/tv/tuner/aidl/default/Filter.h b/tv/tuner/aidl/default/Filter.h index 1dbba453e5..30eb24bda8 100644 --- a/tv/tuner/aidl/default/Filter.h +++ b/tv/tuner/aidl/default/Filter.h @@ -54,7 +54,7 @@ class Filter : public BnFilter { Filter(); Filter(DemuxFilterType type, int64_t filterId, uint32_t bufferSize, - const std::shared_ptr& cb, Demux* demux); + const std::shared_ptr& cb, std::shared_ptr demux); ~Filter(); @@ -97,7 +97,7 @@ class Filter : public BnFilter { private: // Demux service - Demux* mDemux; + std::shared_ptr mDemux; // Dvr reference once the filter is attached to any std::shared_ptr mDvr = nullptr; /** diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index 78d8279b9b..438f897446 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -28,7 +28,7 @@ namespace hardware { namespace tv { namespace tuner { -Frontend::Frontend(FrontendType type, int32_t id, Tuner* tuner) { +Frontend::Frontend(FrontendType type, int32_t id, std::shared_ptr tuner) { mType = type; mId = id; mTuner = tuner; diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h index a98cc92f6d..3c602cff8f 100644 --- a/tv/tuner/aidl/default/Frontend.h +++ b/tv/tuner/aidl/default/Frontend.h @@ -33,7 +33,7 @@ class Tuner; class Frontend : public BnFrontend { public: - Frontend(FrontendType type, int32_t id, Tuner* tuner); + Frontend(FrontendType type, int32_t id, std::shared_ptr tuner); ::ndk::ScopedAStatus setCallback( const std::shared_ptr& in_callback) override; @@ -59,7 +59,7 @@ class Frontend : public BnFrontend { virtual ~Frontend(); bool supportsSatellite(); std::shared_ptr mCallback; - Tuner* mTuner; + std::shared_ptr mTuner; FrontendType mType = FrontendType::UNDEFINED; int32_t mId = 0; bool mIsLocked = false; diff --git a/tv/tuner/aidl/default/TimeFilter.cpp b/tv/tuner/aidl/default/TimeFilter.cpp index 3b1edd2ba1..dde7be34ca 100644 --- a/tv/tuner/aidl/default/TimeFilter.cpp +++ b/tv/tuner/aidl/default/TimeFilter.cpp @@ -30,7 +30,7 @@ namespace tuner { TimeFilter::TimeFilter() {} -TimeFilter::TimeFilter(Demux* demux) { +TimeFilter::TimeFilter(std::shared_ptr demux) { mDemux = demux; } diff --git a/tv/tuner/aidl/default/TimeFilter.h b/tv/tuner/aidl/default/TimeFilter.h index 44e941c18b..ff35c47d70 100644 --- a/tv/tuner/aidl/default/TimeFilter.h +++ b/tv/tuner/aidl/default/TimeFilter.h @@ -35,7 +35,7 @@ class Demux; class TimeFilter : public BnTimeFilter { public: TimeFilter(); - TimeFilter(Demux* demux); + TimeFilter(std::shared_ptr demux); ~TimeFilter(); ::ndk::ScopedAStatus setTimeStamp(int64_t in_timeStamp) override; @@ -45,7 +45,7 @@ class TimeFilter : public BnTimeFilter { ::ndk::ScopedAStatus close() override; private: - Demux* mDemux; + std::shared_ptr mDemux; uint64_t mTimeStamp = INVALID_TIME_STAMP; time_t mBeginTime; }; diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp index 7e49660130..678be54dbe 100644 --- a/tv/tuner/aidl/default/Tuner.cpp +++ b/tv/tuner/aidl/default/Tuner.cpp @@ -32,20 +32,22 @@ namespace hardware { namespace tv { namespace tuner { -Tuner::Tuner() { +Tuner::Tuner() {} + +void Tuner::init() { // Static Frontends array to maintain local frontends information // Array index matches their FrontendId in the default impl mFrontendSize = 10; - mFrontends[0] = ndk::SharedRefBase::make(FrontendType::ISDBS, 0, this); - mFrontends[1] = ndk::SharedRefBase::make(FrontendType::ATSC3, 1, this); - mFrontends[2] = ndk::SharedRefBase::make(FrontendType::DVBC, 2, this); - mFrontends[3] = ndk::SharedRefBase::make(FrontendType::DVBS, 3, this); - mFrontends[4] = ndk::SharedRefBase::make(FrontendType::DVBT, 4, this); - mFrontends[5] = ndk::SharedRefBase::make(FrontendType::ISDBT, 5, this); - mFrontends[6] = ndk::SharedRefBase::make(FrontendType::ANALOG, 6, this); - mFrontends[7] = ndk::SharedRefBase::make(FrontendType::ATSC, 7, this); - mFrontends[8] = ndk::SharedRefBase::make(FrontendType::ISDBS3, 8, this); - mFrontends[9] = ndk::SharedRefBase::make(FrontendType::DTMB, 9, this); + mFrontends[0] = ndk::SharedRefBase::make(FrontendType::ISDBS, 0, this->ref()); + mFrontends[1] = ndk::SharedRefBase::make(FrontendType::ATSC3, 1, this->ref()); + mFrontends[2] = ndk::SharedRefBase::make(FrontendType::DVBC, 2, this->ref()); + mFrontends[3] = ndk::SharedRefBase::make(FrontendType::DVBS, 3, this->ref()); + mFrontends[4] = ndk::SharedRefBase::make(FrontendType::DVBT, 4, this->ref()); + mFrontends[5] = ndk::SharedRefBase::make(FrontendType::ISDBT, 5, this->ref()); + mFrontends[6] = ndk::SharedRefBase::make(FrontendType::ANALOG, 6, this->ref()); + mFrontends[7] = ndk::SharedRefBase::make(FrontendType::ATSC, 7, this->ref()); + mFrontends[8] = ndk::SharedRefBase::make(FrontendType::ISDBS3, 8, this->ref()); + mFrontends[9] = ndk::SharedRefBase::make(FrontendType::DTMB, 9, this->ref()); vector statusCaps; @@ -212,7 +214,7 @@ Tuner::~Tuner() {} ALOGV("%s", __FUNCTION__); mLastUsedId += 1; - mDemuxes[mLastUsedId] = ndk::SharedRefBase::make(mLastUsedId, this); + mDemuxes[mLastUsedId] = ndk::SharedRefBase::make(mLastUsedId, this->ref()); out_demuxId->push_back(mLastUsedId); *_aidl_return = mDemuxes[mLastUsedId]; diff --git a/tv/tuner/aidl/default/Tuner.h b/tv/tuner/aidl/default/Tuner.h index e69990d119..7af7ab8d53 100644 --- a/tv/tuner/aidl/default/Tuner.h +++ b/tv/tuner/aidl/default/Tuner.h @@ -63,6 +63,7 @@ class Tuner : public BnTuner { void frontendStopTune(int32_t frontendId); void removeDemux(int32_t demuxId); void removeFrontend(int32_t frontendId); + void init(); private: // Static mFrontends array to maintain local frontends information diff --git a/tv/tuner/aidl/default/service.cpp b/tv/tuner/aidl/default/service.cpp index 649b76375d..ac8d779c28 100644 --- a/tv/tuner/aidl/default/service.cpp +++ b/tv/tuner/aidl/default/service.cpp @@ -28,6 +28,7 @@ using ::aidl::android::hardware::tv::tuner::Tuner; int main() { ABinderProcess_setThreadPoolMaxThreadCount(8); std::shared_ptr tuner = ndk::SharedRefBase::make(); + tuner->init(); const std::string instance = std::string() + Tuner::descriptor + "/default"; binder_status_t status = AServiceManager_addService(tuner->asBinder().get(), instance.c_str()); -- GitLab From 3b68169c6b8622e4c587537758541a4885696500 Mon Sep 17 00:00:00 2001 From: Yuchen He Date: Tue, 10 Aug 2021 22:59:47 +0000 Subject: [PATCH 107/825] Update initial mock data to fix CTS/GTS Test result: http://ab/I58400009976737381 Bug: 190757198 Test: atest com.google.android.location.gts.gnss.GnssMeasurementValuesTest#testListenForGnssMeasurements android.location.cts.gnss.GnssMeasurementValuesTest#testListenForGnssMeasurements on raw measurement data injected cuttlefish Change-Id: I32be5399129b05fa408ee6a9aa3e218cd588de3a --- gnss/common/utils/default/Utils.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gnss/common/utils/default/Utils.cpp b/gnss/common/utils/default/Utils.cpp index d136448ed9..51a2f6e613 100644 --- a/gnss/common/utils/default/Utils.cpp +++ b/gnss/common/utils/default/Utils.cpp @@ -196,13 +196,13 @@ GnssData Utils::getMockMeasurement(const bool enableCorrVecOutputs) { GnssClock clock = {.gnssClockFlags = GnssClock::HAS_FULL_BIAS | GnssClock::HAS_BIAS | GnssClock::HAS_BIAS_UNCERTAINTY | GnssClock::HAS_DRIFT | GnssClock::HAS_DRIFT_UNCERTAINTY, - .timeNs = 35854545000000, - .fullBiasNs = -234621900521857520, - .biasNs = 0.2352389998626708984, - .biasUncertaintyNs = 274.989972114563, - .driftNsps = -124.3742360, - .driftUncertaintyNsps = 239.6234285828, - .hwClockDiscontinuityCount = 999}; + .timeNs = 2713545000000, + .fullBiasNs = -1226701900521857520, + .biasNs = 0.59689998626708984, + .biasUncertaintyNs = 47514.989972114563, + .driftNsps = -51.757811607455452, + .driftUncertaintyNsps = 310.64968328491528, + .hwClockDiscontinuityCount = 1}; ElapsedRealtime timestamp = { .flags = ElapsedRealtime::HAS_TIMESTAMP_NS | ElapsedRealtime::HAS_TIME_UNCERTAINTY_NS, -- GitLab From ef861b7654b2847e8b2fc941db46637a34339993 Mon Sep 17 00:00:00 2001 From: sreenivasaiah Date: Wed, 23 Jun 2021 10:19:10 +0530 Subject: [PATCH 108/825] HAL implementation for UWB HAL Bug: 195308730 Test: Compiles Change-Id: Idae467bc435394a840cdec7dce30d0016c790a21 --- .../compatibility_matrix.current.xml | 8 +++ uwb/aidl/Android.bp | 27 ++++++++ .../current/android/hardware/uwb/IUwb.aidl | 43 ++++++++++++ .../hardware/uwb/IUwbClientCallback.aidl | 41 ++++++++++++ .../android/hardware/uwb/UwbEvent.aidl | 43 ++++++++++++ .../android/hardware/uwb/UwbStatus.aidl | 44 +++++++++++++ uwb/aidl/android/hardware/uwb/IUwb.aidl | 65 +++++++++++++++++++ .../hardware/uwb/IUwbClientCallback.aidl | 45 +++++++++++++ uwb/aidl/android/hardware/uwb/UwbEvent.aidl | 35 ++++++++++ uwb/aidl/android/hardware/uwb/UwbStatus.aidl | 29 +++++++++ 10 files changed, 380 insertions(+) create mode 100755 uwb/aidl/Android.bp create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwb.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbClientCallback.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/UwbEvent.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/UwbStatus.aidl create mode 100755 uwb/aidl/android/hardware/uwb/IUwb.aidl create mode 100755 uwb/aidl/android/hardware/uwb/IUwbClientCallback.aidl create mode 100755 uwb/aidl/android/hardware/uwb/UwbEvent.aidl create mode 100755 uwb/aidl/android/hardware/uwb/UwbStatus.aidl diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 7620d36669..72cb2bcf69 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -655,6 +655,14 @@ default + + android.hardware.uwb + 1 + + IUwb + default + + android.hardware.wifi.hostapd 1.0-3 diff --git a/uwb/aidl/Android.bp b/uwb/aidl/Android.bp new file mode 100755 index 0000000000..e3b081bea1 --- /dev/null +++ b/uwb/aidl/Android.bp @@ -0,0 +1,27 @@ +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"], +} + +// TODO(b/195992901): Add VTS tests. +// TODO(b/195992658): Add cuttlefish implementation. +aidl_interface { + name: "android.hardware.uwb", + vendor_available: true, + srcs: ["android/hardware/uwb/*.aidl"], + stability: "vintf", + backend: { + java: { + sdk_version: "module_current", + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwb.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwb.aidl new file mode 100644 index 0000000000..229ef7c7db --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwb.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.uwb; +@VintfStability +interface IUwb { + void close(); + void coreInit(); + void open(in android.hardware.uwb.IUwbClientCallback clientCallback); + int write(in byte[] data); +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbClientCallback.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbClientCallback.aidl new file mode 100644 index 0000000000..aac8e966bd --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbClientCallback.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.uwb; +@VintfStability +interface IUwbClientCallback { + oneway void onUciMessage(in byte[] data); + oneway void onHalEvent(in android.hardware.uwb.UwbEvent event, in android.hardware.uwb.UwbStatus status); +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/UwbEvent.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/UwbEvent.aidl new file mode 100644 index 0000000000..6b30d8c6ed --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/UwbEvent.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.uwb; +@Backing(type="int") @VintfStability +enum UwbEvent { + OPEN_CPLT = 0, + CLOSE_CPLT = 1, + POST_INIT_CPLT = 2, + ERROR = 3, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/UwbStatus.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/UwbStatus.aidl new file mode 100644 index 0000000000..88d766a7fa --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/UwbStatus.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.uwb; +@Backing(type="int") @VintfStability +enum UwbStatus { + OK = 0, + FAILED = 1, + ERR_TRANSPORT = 2, + ERR_CMD_TIMEOUT = 3, + REFUSED = 4, +} diff --git a/uwb/aidl/android/hardware/uwb/IUwb.aidl b/uwb/aidl/android/hardware/uwb/IUwb.aidl new file mode 100755 index 0000000000..5d888bc63b --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/IUwb.aidl @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.uwb; + +import android.hardware.uwb.IUwbClientCallback; +import android.hardware.uwb.UwbStatus; + +/** + * HAL Interface for UWB (Ultrawideband) subsystem. + * https://en.wikipedia.org/wiki/Ultra-wideband. + */ +@VintfStability +interface IUwb { + /** + * Close the UWB Subsystem. Should free all resources. + * + */ + void close(); + + /** + * Perform UWB Subsystem initialization by applying all vendor configuration. + * + */ + void coreInit(); + + /** + * Performs the UWB HAL initialization and power on UWB Subsystem. If open completes + * successfully, then UWB Subsystem is ready to accept UCI message through write() API + * + * @param clientCallback Client callback instance. + */ + void open(in IUwbClientCallback clientCallback); + + /** + * Write the UCI message to the UWB Subsystem. + * The UCI message format is as per UCI protocol and it is + * defined in "FiRa Consortium - UCI Generic Specification_v1.0" specification at FiRa + * consortium. + * WIP doc link: https://groups.firaconsortium.org/wg/Technical/document/folder/127. + * TODO(b/196004116): Link to the published specification. + * + * This method may queue writes and return immediately, or it may block until data is written. + * Implementation must guarantee that writes are executed in order. + * + * @param data UCI packet to write. + * @return number of bytes written to the UWB Subsystem + */ + int write(in byte[] data); +} diff --git a/uwb/aidl/android/hardware/uwb/IUwbClientCallback.aidl b/uwb/aidl/android/hardware/uwb/IUwbClientCallback.aidl new file mode 100755 index 0000000000..32c36a86c0 --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/IUwbClientCallback.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.uwb; + +import android.hardware.uwb.UwbEvent; +import android.hardware.uwb.UwbStatus; + +@VintfStability +oneway interface IUwbClientCallback { + /** + * The callback passed in from the UWB stack that the HAL + * can use to pass incomming data to the stack. + * + * WIP doc link: https://groups.firaconsortium.org/wg/Technical/document/folder/127. + * TODO(b/196004116): Link to the published specification. + * + * @param data UCI packet sent. + */ + void onUciMessage(in byte[] data); + + /** + * The callback passed in from the UWB stack that the HAL + * can use to pass events back to the stack. + * + * @param event Asynchronous event type. + * @param status Associated status. + */ + void onHalEvent(in UwbEvent event, in UwbStatus status); +} diff --git a/uwb/aidl/android/hardware/uwb/UwbEvent.aidl b/uwb/aidl/android/hardware/uwb/UwbEvent.aidl new file mode 100755 index 0000000000..3457836b8c --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/UwbEvent.aidl @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.uwb; + +/** + * Asynchronous events sent from the UWB subsystem. + */ +@VintfStability +@Backing(type="int") +enum UwbEvent { + /** Open request processing completed. */ + OPEN_CPLT = 0, + /** Close request processing completed. */ + CLOSE_CPLT = 1, + /** Post initialization processing completed. */ + POST_INIT_CPLT = 2, + /** Fatal error encountered. */ + ERROR = 3, +} diff --git a/uwb/aidl/android/hardware/uwb/UwbStatus.aidl b/uwb/aidl/android/hardware/uwb/UwbStatus.aidl new file mode 100755 index 0000000000..d568c5b86e --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/UwbStatus.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.uwb; + +@VintfStability +@Backing(type="int") +enum UwbStatus { + OK = 0, + FAILED = 1, + ERR_TRANSPORT = 2, + ERR_CMD_TIMEOUT = 3, + REFUSED = 4, +} -- GitLab From b3fd970108021ef457aaa3d1e4d67940931f6cf0 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 11 Aug 2021 15:16:40 -0700 Subject: [PATCH 109/825] uwb: Allow uwb apex to include HAL Bug: 188911079 Test: Compiles Change-Id: I70d0d02f7b6d09f0e86ca392fef3d7876de4f0d8 --- uwb/aidl/Android.bp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/uwb/aidl/Android.bp b/uwb/aidl/Android.bp index e3b081bea1..6cf51886be 100755 --- a/uwb/aidl/Android.bp +++ b/uwb/aidl/Android.bp @@ -22,6 +22,10 @@ aidl_interface { vndk: { enabled: true, }, + apex_available: [ + "com.android.uwb", + ], + min_sdk_version: "current", }, }, } -- GitLab From 58f71e79cbd228db2e7c29e3400db4d2680d71cd Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 3 Aug 2021 16:49:40 -0700 Subject: [PATCH 110/825] Rename EmulatedUserHal to FakeUserHal. EmulatedUserHal is a library that allows setting and getting fake user HAL properties, and has nothing to do with emulator. So we rename it to FakeUserHal to be clearer. Test: Local build. Bug: 194340549 Change-Id: I29bf3ceb9e4cacb0a1da96699bd4ba843cab883d --- automotive/vehicle/2.0/default/Android.bp | 2 +- .../impl/vhal_v2_0/DefaultVehicleHal.cpp | 20 ++++++------- .../impl/vhal_v2_0/DefaultVehicleHal.h | 4 +-- .../default/impl/vhal_v2_0/userhal/Android.bp | 4 +-- .../{EmulatedUserHal.cpp => FakeUserHal.cpp} | 28 +++++++++---------- .../{EmulatedUserHal.h => FakeUserHal.h} | 12 ++++---- 6 files changed, 35 insertions(+), 35 deletions(-) rename automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/{EmulatedUserHal.cpp => FakeUserHal.cpp} (93%) rename automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/include/{EmulatedUserHal.h => FakeUserHal.h} (94%) diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp index f96654f056..3cf41dc932 100644 --- a/automotive/vehicle/2.0/default/Android.bp +++ b/automotive/vehicle/2.0/default/Android.bp @@ -97,7 +97,7 @@ cc_library_static { local_include_dirs: ["common/include/vhal_v2_0"], export_include_dirs: ["impl"], whole_static_libs: [ - "android.hardware.automotive.vehicle@2.0-emulated-user-hal-lib", + "android.hardware.automotive.vehicle@2.0-fake-user-hal-lib", "android.hardware.automotive.vehicle@2.0-manager-lib", ], shared_libs: [ 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 7bc7198959..318e9ddade 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 @@ -86,7 +86,7 @@ VehicleHal::VehiclePropValuePtr DefaultVehicleHal::getUserHalProp( const VehiclePropValue& requestedPropValue, StatusCode* outStatus) { auto propId = requestedPropValue.prop; ALOGI("get(): getting value for prop %d from User HAL", propId); - const auto& ret = mEmulatedUserHal.onGetProperty(requestedPropValue); + const auto& ret = mFakeUserHal.onGetProperty(requestedPropValue); VehicleHal::VehiclePropValuePtr v = nullptr; if (!ret.ok()) { ALOGE("get(): User HAL returned error: %s", ret.error().message().c_str()); @@ -110,7 +110,7 @@ VehicleHal::VehiclePropValuePtr DefaultVehicleHal::get(const VehiclePropValue& r auto propId = requestedPropValue.prop; ALOGV("get(%d)", propId); - if (mEmulatedUserHal.isSupported(propId)) { + if (mFakeUserHal.isSupported(propId)) { return getUserHalProp(requestedPropValue, outStatus); } @@ -155,8 +155,8 @@ bool DefaultVehicleHal::dump(const hidl_handle& fd, const hidl_vec& if (options.size() > 0) { if (options[0] == "--help") { std::string buffer; - buffer += "Emulated user hal usage:\n"; - buffer += mEmulatedUserHal.showDumpHelp(); + buffer += "Fake user hal usage:\n"; + buffer += mFakeUserHal.showDumpHelp(); buffer += "\n"; buffer += "VHAL server debug usage:\n"; buffer += "--debughal: send debug command to VHAL server, see '--debughal --help'\n"; @@ -164,15 +164,15 @@ bool DefaultVehicleHal::dump(const hidl_handle& fd, const hidl_vec& dprintf(nativeFd, "%s", buffer.c_str()); return false; } else if (options[0] == kUserHalDumpOption) { - dprintf(nativeFd, "%s", mEmulatedUserHal.dump("").c_str()); + dprintf(nativeFd, "%s", mFakeUserHal.dump("").c_str()); return false; } } else { - // No options, dump the emulated user hal state first and then send command to VHAL server + // No options, dump the fake user hal state first and then send command to VHAL server // to dump its state. std::string buffer; - buffer += "Emulator user hal state:\n"; - buffer += mEmulatedUserHal.dump(" "); + buffer += "Fake user hal state:\n"; + buffer += mFakeUserHal.dump(" "); buffer += "\n"; dprintf(nativeFd, "%s", buffer.c_str()); } @@ -338,7 +338,7 @@ StatusCode DefaultVehicleHal::checkValueRange(const VehiclePropValue& value, StatusCode DefaultVehicleHal::setUserHalProp(const VehiclePropValue& propValue) { ALOGI("onSetProperty(): property %d will be handled by UserHal", propValue.prop); - const auto& ret = mEmulatedUserHal.onSetProperty(propValue); + const auto& ret = mFakeUserHal.onSetProperty(propValue); if (!ret.ok()) { ALOGE("onSetProperty(): HAL returned error: %s", ret.error().message().c_str()); return StatusCode(ret.error().code()); @@ -360,7 +360,7 @@ StatusCode DefaultVehicleHal::set(const VehiclePropValue& propValue) { return StatusCode::INVALID_ARG; } - if (mEmulatedUserHal.isSupported(propValue.prop)) { + if (mFakeUserHal.isSupported(propValue.prop)) { return setUserHalProp(propValue); } diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h index 7cd7ac2a38..4d3036e5e1 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.h @@ -21,7 +21,7 @@ #include #include -#include "EmulatedUserHal.h" +#include "FakeUserHal.h" #include "VehicleHalClient.h" namespace android { @@ -56,7 +56,7 @@ class DefaultVehicleHal : public VehicleHal { VehiclePropertyStore* mPropStore; RecurrentTimer mRecurrentTimer; VehicleHalClient* mVehicleClient; - EmulatedUserHal mEmulatedUserHal; + FakeUserHal mFakeUserHal; // The callback that would be called when a property value is updated. This function could // be extended to handle specific property update event. diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/Android.bp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/Android.bp index 0058d33a6a..bb28fdf390 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/Android.bp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/Android.bp @@ -14,10 +14,10 @@ // Library used to emulate User HAL behavior through lshal debug requests. cc_library { - name: "android.hardware.automotive.vehicle@2.0-emulated-user-hal-lib", + name: "android.hardware.automotive.vehicle@2.0-fake-user-hal-lib", vendor: true, defaults: ["vhal_v2_0_target_defaults"], - srcs: ["EmulatedUserHal.cpp"], + srcs: ["FakeUserHal.cpp"], shared_libs: [ "libbase", "libutils", diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/EmulatedUserHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/FakeUserHal.cpp similarity index 93% rename from automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/EmulatedUserHal.cpp rename to automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/FakeUserHal.cpp index 55dc01a4e6..e9ebcc640e 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/EmulatedUserHal.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/FakeUserHal.cpp @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#define LOG_TAG "EmulatedUserHal" +#define LOG_TAG "FakeUserHal" #include #include #include "UserHalHelper.h" -#include "EmulatedUserHal.h" +#include "FakeUserHal.h" namespace android { namespace hardware { @@ -60,7 +60,7 @@ Result getSwitchUserMessageType(const VehiclePropValue& v } // namespace -bool EmulatedUserHal::isSupported(int32_t prop) { +bool FakeUserHal::isSupported(int32_t prop) { switch (prop) { case INITIAL_USER_INFO: case SWITCH_USER: @@ -73,7 +73,7 @@ bool EmulatedUserHal::isSupported(int32_t prop) { } } -Result> EmulatedUserHal::onSetProperty( +Result> FakeUserHal::onSetProperty( const VehiclePropValue& value) { ALOGV("onSetProperty(): %s", toString(value).c_str()); @@ -95,7 +95,7 @@ Result> EmulatedUserHal::onSetProperty( } } -Result> EmulatedUserHal::onGetProperty( +Result> FakeUserHal::onGetProperty( const VehiclePropValue& value) { ALOGV("onGetProperty(%s)", toString(value).c_str()); switch (value.prop) { @@ -113,7 +113,7 @@ Result> EmulatedUserHal::onGetProperty( } } -Result> EmulatedUserHal::onGetUserIdentificationAssociation( +Result> FakeUserHal::onGetUserIdentificationAssociation( const VehiclePropValue& value) { if (mSetUserIdentificationAssociationResponseFromCmd == nullptr) { return defaultUserIdentificationAssociation(value); @@ -132,7 +132,7 @@ Result> EmulatedUserHal::onGetUserIdentificati return newValue; } -Result> EmulatedUserHal::onSetInitialUserInfoResponse( +Result> FakeUserHal::onSetInitialUserInfoResponse( const VehiclePropValue& value) { auto requestId = getRequestId(value); if (!requestId.ok()) { @@ -164,7 +164,7 @@ Result> EmulatedUserHal::onSetInitialUserInfoR return updatedValue; } -Result> EmulatedUserHal::onSetSwitchUserResponse( +Result> FakeUserHal::onSetSwitchUserResponse( const VehiclePropValue& value) { auto requestId = getRequestId(value); if (!requestId.ok()) { @@ -217,7 +217,7 @@ Result> EmulatedUserHal::onSetSwitchUserRespon return updatedValue; } -Result> EmulatedUserHal::onSetCreateUserResponse( +Result> FakeUserHal::onSetCreateUserResponse( const VehiclePropValue& value) { auto requestId = getRequestId(value); if (!requestId.ok()) { @@ -248,7 +248,7 @@ Result> EmulatedUserHal::onSetCreateUserRespon return updatedValue; } -Result> EmulatedUserHal::onSetUserIdentificationAssociation( +Result> FakeUserHal::onSetUserIdentificationAssociation( const VehiclePropValue& value) { auto requestId = getRequestId(value); if (!requestId.ok()) { @@ -277,14 +277,14 @@ Result> EmulatedUserHal::onSetUserIdentificati return defaultUserIdentificationAssociation(value); } -Result> EmulatedUserHal::defaultUserIdentificationAssociation( +Result> FakeUserHal::defaultUserIdentificationAssociation( const VehiclePropValue& request) { // TODO(b/159498909): return a response with NOT_ASSOCIATED_ANY_USER for all requested types ALOGE("no lshal response for %s; replying with NOT_AVAILABLE", toString(request).c_str()); return Error(static_cast(StatusCode::NOT_AVAILABLE)) << "not set by lshal"; } -Result> EmulatedUserHal::sendUserHalResponse( +Result> FakeUserHal::sendUserHalResponse( std::unique_ptr response, int32_t requestId) { switch (response->areaId) { case 1: @@ -311,11 +311,11 @@ Result> EmulatedUserHal::sendUserHalResponse( return response; } -std::string EmulatedUserHal::showDumpHelp() { +std::string FakeUserHal::showDumpHelp() { return fmt::format("{}: dumps state used for user management\n", kUserHalDumpOption); } -std::string EmulatedUserHal::dump(std::string indent) { +std::string FakeUserHal::dump(std::string indent) { std::string info; if (mInitialUserResponseFromCmd != nullptr) { info += fmt::format("{}InitialUserInfo response: {}\n", indent.c_str(), diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/include/EmulatedUserHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/include/FakeUserHal.h similarity index 94% rename from automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/include/EmulatedUserHal.h rename to automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/include/FakeUserHal.h index 46f6d0f2dc..122aee8eb1 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/include/EmulatedUserHal.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/include/FakeUserHal.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef android_hardware_automotive_vehicle_V2_0_impl_EmulatedUserHal_H_ -#define android_hardware_automotive_vehicle_V2_0_impl_EmulatedUserHal_H_ +#ifndef android_hardware_automotive_vehicle_V2_0_impl_FakeUserHal_H_ +#define android_hardware_automotive_vehicle_V2_0_impl_FakeUserHal_H_ #include #include @@ -35,11 +35,11 @@ constexpr char kUserHalDumpOption[] = "--user-hal"; /** * Class used to emulate a real User HAL behavior through lshal debug requests. */ -class EmulatedUserHal { +class FakeUserHal { public: - EmulatedUserHal() {} + FakeUserHal() {} - ~EmulatedUserHal() = default; + ~FakeUserHal() = default; /** * Checks if the emulator can handle the property. @@ -149,4 +149,4 @@ class EmulatedUserHal { } // namespace hardware } // namespace android -#endif // android_hardware_automotive_vehicle_V2_0_impl_EmulatedUserHal_H_ +#endif // android_hardware_automotive_vehicle_V2_0_impl_FakeUserHal_H_ -- GitLab From 4d1fe81bee2a1ef01b1a14638484a2d7528afcc3 Mon Sep 17 00:00:00 2001 From: Kai Date: Thu, 5 Aug 2021 14:02:33 -0700 Subject: [PATCH 111/825] Add placeholder properties for emulator Add some placeholder properties in google VHAL. Developers who use the aae emulator can use them in developing new features without implementing a real property. Bug: 193460353 Test: build aae emulator, use adb lshal to change property values Change-Id: I6131a4892495c4c1e1c73e078572a666a33f984e --- .../default/impl/vhal_v2_0/DefaultConfig.h | 36 +++++++++++++++++++ .../default/impl/vhal_v2_0/PropertyUtils.h | 13 +++++++ .../vhal_v2_0/tests/DefaultVhalImpl_test.cpp | 2 +- 3 files changed, 50 insertions(+), 1 deletion(-) 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 11dc6eb11b..e76a91aab4 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 @@ -1061,6 +1061,42 @@ const ConfigDeclaration kVehicleProperties[]{ .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, + { + .config = + { + .prop = PLACEHOLDER_PROPERTY_INT, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0}}, + }, + { + .config = + { + .prop = PLACEHOLDER_PROPERTY_FLOAT, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.floatValues = {0.0f}}, + }, + { + .config = + { + .prop = PLACEHOLDER_PROPERTY_BOOLEAN, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0 /* false */}}, + }, + { + .config = + { + .prop = PLACEHOLDER_PROPERTY_STRING, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.stringValue = {"Test"}}, + }, #ifdef ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING // Vendor propetry for E2E ClusterHomeService testing. { diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h index ec43e8db5d..f58e09a67d 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/PropertyUtils.h @@ -100,6 +100,19 @@ constexpr int32_t VENDOR_CLUSTER_NAVIGATION_STATE = toVendor(VehicleProperty::CLUSTER_NAVIGATION_STATE); #endif // ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING +/** + * These properties are placeholder properties for developers to test new features without + * implementing a real property. + */ +constexpr int32_t PLACEHOLDER_PROPERTY_INT = + 0x2a11 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::INT32; +constexpr int32_t PLACEHOLDER_PROPERTY_FLOAT = + 0x2a11 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::FLOAT; +constexpr int32_t PLACEHOLDER_PROPERTY_BOOLEAN = + 0x2a11 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::BOOLEAN; +constexpr int32_t PLACEHOLDER_PROPERTY_STRING = + 0x2a11 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::STRING; + const int32_t kHvacPowerProperties[] = { toInt(VehicleProperty::HVAC_FAN_SPEED), toInt(VehicleProperty::HVAC_FAN_DIRECTION), 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 0233bddb88..e3c8dd6c79 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 @@ -141,7 +141,7 @@ class DefaultVhalImplTest : public ::testing::Test { TEST_F(DefaultVhalImplTest, testListProperties) { std::vector configs = mHal->listProperties(); - EXPECT_EQ((size_t)117, configs.size()); + EXPECT_EQ((size_t)121, configs.size()); } TEST_F(DefaultVhalImplTest, testGetDefaultPropertyFloat) { -- GitLab From f79355756ffda549fef3d4e10b32e798bd8cfbff Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Thu, 12 Aug 2021 17:40:47 -0700 Subject: [PATCH 112/825] [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces Added SPDX-license-identifier-Apache-2.0 to: automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/Android.bp automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: I07633391fdf6298dadd9bde70e7fc12cee2bb646 --- .../vehicle/2.0/default/impl/vhal_v2_0/tests/Android.bp | 9 +++++++++ .../2.0/default/impl/vhal_v2_0/userhal/Android.bp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/Android.bp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/Android.bp index a7d5440b39..a0bcc6cb34 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/Android.bp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/Android.bp @@ -12,6 +12,15 @@ // 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"], +} + filegroup { name: "vhal_test_json", srcs: ["prop.json"], diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/Android.bp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/Android.bp index bb28fdf390..ad125275aa 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/Android.bp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/userhal/Android.bp @@ -13,6 +13,15 @@ // limitations under the License. // Library used to emulate User HAL behavior through lshal debug requests. +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_library { name: "android.hardware.automotive.vehicle@2.0-fake-user-hal-lib", vendor: true, -- GitLab From fe0f98eb06b820139b5ecdd548d88833253e133a Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Thu, 12 Aug 2021 14:43:39 -0700 Subject: [PATCH 113/825] Refactors VtsHalContexthubUtils.h Separates files that does/doesn't depend on HIDL. Bug: 194285834 Test: Compile Change-Id: I02e406f13b8459c80904454564ef34a143aa7075 --- .../VtsHalContexthubV1_0TargetTest.cpp | 3 +- .../VtsHalContexthubV1_1TargetTest.cpp | 3 +- .../VtsHalContexthubV1_2TargetTest.cpp | 3 +- .../common/vts/VtsHalContexthubUtils.cpp | 2 +- .../common/vts/VtsHalContexthubUtilsCommon.h | 68 +++++++++++++++++++ ...hubUtils.h => VtsHalContexthubUtilsHidl.h} | 40 ++--------- 6 files changed, 79 insertions(+), 40 deletions(-) create mode 100644 contexthub/common/vts/VtsHalContexthubUtilsCommon.h rename contexthub/common/vts/{VtsHalContexthubUtils.h => VtsHalContexthubUtilsHidl.h} (61%) diff --git a/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp b/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp index 356ad97327..b3173ef2b9 100644 --- a/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp +++ b/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp @@ -18,7 +18,8 @@ #include "ContexthubCallbackBase.h" #include "ContexthubHidlTestBase.h" -#include "VtsHalContexthubUtils.h" +#include "VtsHalContexthubUtilsCommon.h" +#include "VtsHalContexthubUtilsHidl.h" #include #include diff --git a/contexthub/1.1/vts/functional/VtsHalContexthubV1_1TargetTest.cpp b/contexthub/1.1/vts/functional/VtsHalContexthubV1_1TargetTest.cpp index acf4be0c45..0589fd8150 100644 --- a/contexthub/1.1/vts/functional/VtsHalContexthubV1_1TargetTest.cpp +++ b/contexthub/1.1/vts/functional/VtsHalContexthubV1_1TargetTest.cpp @@ -18,7 +18,8 @@ #include "ContexthubCallbackBase.h" #include "ContexthubHidlTestBase.h" -#include "VtsHalContexthubUtils.h" +#include "VtsHalContexthubUtilsCommon.h" +#include "VtsHalContexthubUtilsHidl.h" #include #include diff --git a/contexthub/1.2/vts/functional/VtsHalContexthubV1_2TargetTest.cpp b/contexthub/1.2/vts/functional/VtsHalContexthubV1_2TargetTest.cpp index 9ee40ede01..f1f980795e 100644 --- a/contexthub/1.2/vts/functional/VtsHalContexthubV1_2TargetTest.cpp +++ b/contexthub/1.2/vts/functional/VtsHalContexthubV1_2TargetTest.cpp @@ -18,7 +18,8 @@ #include "ContexthubCallbackBase.h" #include "ContexthubHidlTestBase.h" -#include "VtsHalContexthubUtils.h" +#include "VtsHalContexthubUtilsCommon.h" +#include "VtsHalContexthubUtilsHidl.h" #include #include diff --git a/contexthub/common/vts/VtsHalContexthubUtils.cpp b/contexthub/common/vts/VtsHalContexthubUtils.cpp index 5033b416c9..d98232583b 100644 --- a/contexthub/common/vts/VtsHalContexthubUtils.cpp +++ b/contexthub/common/vts/VtsHalContexthubUtils.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "VtsHalContexthubUtils.h" +#include "VtsHalContexthubUtilsHidl.h" #include #include diff --git a/contexthub/common/vts/VtsHalContexthubUtilsCommon.h b/contexthub/common/vts/VtsHalContexthubUtilsCommon.h new file mode 100644 index 0000000000..8b04e3f04f --- /dev/null +++ b/contexthub/common/vts/VtsHalContexthubUtilsCommon.h @@ -0,0 +1,68 @@ +/* + * 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. + */ + +/** + * Utils file for any Context Hub VTS code (i.e. not specific to e.g. HIDL). + */ + +#pragma once + +#include +#include + +namespace android { +namespace hardware { +namespace contexthub { +namespace vts_utils { + +// App ID with vendor "GoogT" (Google Testing), app identifier 0x555555. This +// app ID is reserved and must never appear in the list of loaded apps. +constexpr uint64_t kNonExistentAppId = 0x476f6f6754555555; + +// Helper that does explicit conversion of an enum class to its underlying/base +// type. Useful for stream output of enum values. +template +inline constexpr typename std::underlying_type::type asBaseType(EnumType value) { + return static_cast::type>(value); +} + +// Wait for a callback to occur (signaled by the given future) up to the +// provided timeout. If the future is invalid or the callback does not come +// within the given time, returns false. +template +bool waitForCallback(std::future future, ReturnType* result, + std::chrono::milliseconds timeout = std::chrono::seconds(5)) { + auto expiration = std::chrono::system_clock::now() + timeout; + + EXPECT_NE(result, nullptr); + EXPECT_TRUE(future.valid()); + if (result != nullptr && future.valid()) { + std::future_status status = future.wait_until(expiration); + EXPECT_NE(status, std::future_status::timeout) << "Timed out waiting for callback"; + + if (status == std::future_status::ready) { + *result = future.get(); + return true; + } + } + + return false; +} + +} // namespace vts_utils +} // namespace contexthub +} // namespace hardware +} // namespace android diff --git a/contexthub/common/vts/VtsHalContexthubUtils.h b/contexthub/common/vts/VtsHalContexthubUtilsHidl.h similarity index 61% rename from contexthub/common/vts/VtsHalContexthubUtils.h rename to contexthub/common/vts/VtsHalContexthubUtilsHidl.h index dff1865f4c..c79afc85cf 100644 --- a/contexthub/common/vts/VtsHalContexthubUtils.h +++ b/contexthub/common/vts/VtsHalContexthubUtilsHidl.h @@ -13,6 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +/** + * Utils file for HIDL related VTS code. + */ #pragma once #include @@ -21,8 +25,6 @@ #include #include -#include -#include #include namespace android { @@ -30,20 +32,9 @@ namespace hardware { namespace contexthub { namespace vts_utils { -// App ID with vendor "GoogT" (Google Testing), app identifier 0x555555. This -// app ID is reserved and must never appear in the list of loaded apps. -constexpr uint64_t kNonExistentAppId = 0x476f6f6754555555; - #define ASSERT_OK(result) ASSERT_EQ(result, ::android::hardware::contexthub::V1_0::Result::OK) #define EXPECT_OK(result) EXPECT_EQ(result, ::android::hardware::contexthub::V1_0::Result::OK) -// Helper that does explicit conversion of an enum class to its underlying/base -// type. Useful for stream output of enum values. -template -inline constexpr typename std::underlying_type::type asBaseType(EnumType value) { - return static_cast::type>(value); -} - // Synchronously queries IContexthub::getHubs() and returns the result hidl_vec getHubsSync(V1_0::IContexthub* hubApi); @@ -68,29 +59,6 @@ static std::vector> getHalAndHubIdList() { return parameters; } -// Wait for a callback to occur (signaled by the given future) up to the -// provided timeout. If the future is invalid or the callback does not come -// within the given time, returns false. -template -bool waitForCallback(std::future future, ReturnType* result, - std::chrono::milliseconds timeout = std::chrono::seconds(5)) { - auto expiration = std::chrono::system_clock::now() + timeout; - - EXPECT_NE(result, nullptr); - EXPECT_TRUE(future.valid()); - if (result != nullptr && future.valid()) { - std::future_status status = future.wait_until(expiration); - EXPECT_NE(status, std::future_status::timeout) << "Timed out waiting for callback"; - - if (status == std::future_status::ready) { - *result = future.get(); - return true; - } - } - - return false; -} - } // namespace vts_utils } // namespace contexthub } // namespace hardware -- GitLab From 22122b30143c940a691101a8da85f96c2d5cf03c Mon Sep 17 00:00:00 2001 From: Hongguang Date: Thu, 5 Aug 2021 19:01:08 -0700 Subject: [PATCH 114/825] Adjust some tuner aidl types size to align with frameworks. Bug: 195693712 Test: atest VtsHalTvTunerTargetTest Change-Id: Ia558614759928579bda7dd8e88f5e3fb538bf412 --- .../android/hardware/tv/tuner/AudioExtraMetaData.aidl | 2 +- .../hardware/tv/tuner/DemuxAlpFilterSettings.aidl | 2 +- .../android/hardware/tv/tuner/DemuxCapabilities.aidl | 2 +- .../hardware/tv/tuner/DemuxFilterDownloadEvent.aidl | 2 +- .../hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl | 2 +- .../hardware/tv/tuner/DemuxFilterMediaEvent.aidl | 6 +++--- .../hardware/tv/tuner/DemuxFilterPesDataSettings.aidl | 2 +- .../android/hardware/tv/tuner/DemuxFilterPesEvent.aidl | 4 ++-- .../hardware/tv/tuner/DemuxFilterSectionEvent.aidl | 8 ++++---- .../DemuxFilterSectionSettingsConditionTableInfo.aidl | 4 ++-- .../android/hardware/tv/tuner/DemuxIpAddress.aidl | 4 ++-- .../hardware/tv/tuner/DemuxMmtpFilterSettings.aidl | 2 +- .../current/android/hardware/tv/tuner/DemuxPid.aidl | 4 ++-- .../hardware/tv/tuner/DemuxTlvFilterSettings.aidl | 2 +- .../hardware/tv/tuner/DemuxTsFilterSettings.aidl | 2 +- .../hardware/tv/tuner/FrontendAnalogSettings.aidl | 4 ++-- .../hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl | 2 +- .../hardware/tv/tuner/FrontendAtsc3Settings.aidl | 4 ++-- .../hardware/tv/tuner/FrontendAtscSettings.aidl | 4 ++-- .../hardware/tv/tuner/FrontendDtmbSettings.aidl | 4 ++-- .../hardware/tv/tuner/FrontendDvbcSettings.aidl | 4 ++-- .../hardware/tv/tuner/FrontendDvbsSettings.aidl | 4 ++-- .../hardware/tv/tuner/FrontendDvbtSettings.aidl | 8 ++++---- .../android/hardware/tv/tuner/FrontendInfo.aidl | 6 +++--- .../hardware/tv/tuner/FrontendIsdbs3Settings.aidl | 6 +++--- .../hardware/tv/tuner/FrontendIsdbsSettings.aidl | 6 +++--- .../hardware/tv/tuner/FrontendIsdbtSettings.aidl | 4 ++-- .../hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl | 2 +- .../android/hardware/tv/tuner/FrontendScanMessage.aidl | 10 +++++----- .../android/hardware/tv/tuner/FrontendStatus.aidl | 10 +++++----- .../hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl | 2 +- .../android/hardware/tv/tuner/PlaybackSettings.aidl | 6 +++--- .../android/hardware/tv/tuner/RecordSettings.aidl | 6 +++--- .../android/hardware/tv/tuner/AudioExtraMetaData.aidl | 2 +- .../hardware/tv/tuner/DemuxAlpFilterSettings.aidl | 2 +- .../android/hardware/tv/tuner/DemuxCapabilities.aidl | 2 +- .../hardware/tv/tuner/DemuxFilterDownloadEvent.aidl | 2 +- .../hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl | 2 +- .../hardware/tv/tuner/DemuxFilterMediaEvent.aidl | 6 +++--- .../hardware/tv/tuner/DemuxFilterPesDataSettings.aidl | 2 +- .../android/hardware/tv/tuner/DemuxFilterPesEvent.aidl | 4 ++-- .../hardware/tv/tuner/DemuxFilterSectionEvent.aidl | 8 ++++---- .../DemuxFilterSectionSettingsConditionTableInfo.aidl | 4 ++-- .../aidl/android/hardware/tv/tuner/DemuxIpAddress.aidl | 4 ++-- .../hardware/tv/tuner/DemuxMmtpFilterSettings.aidl | 2 +- tv/tuner/aidl/android/hardware/tv/tuner/DemuxPid.aidl | 4 ++-- .../hardware/tv/tuner/DemuxTlvFilterSettings.aidl | 2 +- .../hardware/tv/tuner/DemuxTsFilterSettings.aidl | 2 +- .../hardware/tv/tuner/FrontendAnalogSettings.aidl | 4 ++-- .../hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl | 2 +- .../hardware/tv/tuner/FrontendAtsc3Settings.aidl | 4 ++-- .../hardware/tv/tuner/FrontendAtscSettings.aidl | 4 ++-- .../hardware/tv/tuner/FrontendDtmbSettings.aidl | 4 ++-- .../hardware/tv/tuner/FrontendDvbcSettings.aidl | 4 ++-- .../hardware/tv/tuner/FrontendDvbsSettings.aidl | 4 ++-- .../hardware/tv/tuner/FrontendDvbtSettings.aidl | 8 ++++---- .../aidl/android/hardware/tv/tuner/FrontendInfo.aidl | 6 +++--- .../hardware/tv/tuner/FrontendIsdbs3Settings.aidl | 6 +++--- .../hardware/tv/tuner/FrontendIsdbsSettings.aidl | 6 +++--- .../hardware/tv/tuner/FrontendIsdbtSettings.aidl | 4 ++-- .../hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl | 2 +- .../android/hardware/tv/tuner/FrontendScanMessage.aidl | 10 +++++----- .../aidl/android/hardware/tv/tuner/FrontendStatus.aidl | 10 +++++----- .../hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl | 2 +- .../android/hardware/tv/tuner/PlaybackSettings.aidl | 6 +++--- .../aidl/android/hardware/tv/tuner/RecordSettings.aidl | 6 +++--- 66 files changed, 140 insertions(+), 140 deletions(-) diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioExtraMetaData.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioExtraMetaData.aidl index 20c6e5f35e..9db960926b 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioExtraMetaData.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioExtraMetaData.aidl @@ -37,7 +37,7 @@ package android.hardware.tv.tuner; parcelable AudioExtraMetaData { byte adFade; byte adPan; - byte versionTextTag; + char versionTextTag; byte adGainCenter; byte adGainFront; byte adGainSurround; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl index ee8db8fa28..91a04a436c 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl @@ -35,7 +35,7 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable DemuxAlpFilterSettings { - byte packetType; + int packetType; android.hardware.tv.tuner.DemuxAlpLengthType lengthType = android.hardware.tv.tuner.DemuxAlpLengthType.UNDEFINED; android.hardware.tv.tuner.DemuxAlpFilterSettingsFilterSettings filterSettings; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxCapabilities.aidl index 729b797376..49afb94b6b 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxCapabilities.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxCapabilities.aidl @@ -44,7 +44,7 @@ parcelable DemuxCapabilities { int numVideoFilter; int numPesFilter; int numPcrFilter; - int numBytesInSectionFilter; + long numBytesInSectionFilter; int filterCaps; int[] linkCaps; boolean bTimeFilter; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl index a9e7b7c676..b51e633840 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl @@ -39,5 +39,5 @@ parcelable DemuxFilterDownloadEvent { int mpuSequenceNumber; int itemFragmentIndex; int lastItemFragmentIndex; - char dataLength; + int dataLength; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl index 0d20f8e50f..9134df35c2 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl @@ -35,5 +35,5 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable DemuxFilterIpPayloadEvent { - char dataLength; + int dataLength; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl index 351a3406db..a463d68035 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl @@ -35,11 +35,11 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable DemuxFilterMediaEvent { - char streamId; + int streamId; boolean isPtsPresent; long pts; - int dataLength; - int offset; + long dataLength; + long offset; android.hardware.common.NativeHandle avMemory; boolean isSecureMemory; long avDataId; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl index ac7f8a59cb..2420142149 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl @@ -35,6 +35,6 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable DemuxFilterPesDataSettings { - char streamId; + int streamId; boolean isRaw; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl index a4593b4255..3ddd5e0a35 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl @@ -35,7 +35,7 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable DemuxFilterPesEvent { - char streamId; - char dataLength; + int streamId; + int dataLength; int mpuSequenceNumber; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl index 114d1ebc0a..01b8a775e8 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl @@ -35,8 +35,8 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable DemuxFilterSectionEvent { - char tableId; - char version; - char sectionNum; - char dataLength; + int tableId; + int version; + int sectionNum; + int dataLength; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl index be25137bbb..82d30cbf7e 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl @@ -35,6 +35,6 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable DemuxFilterSectionSettingsConditionTableInfo { - char tableId; - char version; + int tableId; + int version; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpAddress.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpAddress.aidl index 935476a80d..a044a19d7e 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpAddress.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxIpAddress.aidl @@ -37,6 +37,6 @@ package android.hardware.tv.tuner; parcelable DemuxIpAddress { android.hardware.tv.tuner.DemuxIpAddressIpAddress srcIpAddress; android.hardware.tv.tuner.DemuxIpAddressIpAddress dstIpAddress; - char srcPort; - char dstPort; + int srcPort; + int dstPort; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl index b0fad65eb7..b22c564cf9 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl @@ -35,6 +35,6 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable DemuxMmtpFilterSettings { - char mmtpPid; + int mmtpPid; android.hardware.tv.tuner.DemuxMmtpFilterSettingsFilterSettings filterSettings; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxPid.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxPid.aidl index 0a29f93887..c452f35b36 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxPid.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxPid.aidl @@ -35,6 +35,6 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability union DemuxPid { - char tPid; - char mmtpPid; + int tPid; + int mmtpPid; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl index dd949800d8..ddb61cea79 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl @@ -35,7 +35,7 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable DemuxTlvFilterSettings { - byte packetType; + int packetType; boolean isCompressedIpPacket; android.hardware.tv.tuner.DemuxTlvFilterSettingsFilterSettings filterSettings; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl index 131cab02bc..d8d424f193 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl @@ -35,6 +35,6 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable DemuxTsFilterSettings { - char tpid; + int tpid; android.hardware.tv.tuner.DemuxTsFilterSettingsFilterSettings filterSettings; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogSettings.aidl index efb91ca5a4..33e934739c 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAnalogSettings.aidl @@ -35,8 +35,8 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable FrontendAnalogSettings { - int frequency; - int endFrequency; + long frequency; + long endFrequency; android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; android.hardware.tv.tuner.FrontendAnalogType type = android.hardware.tv.tuner.FrontendAnalogType.UNDEFINED; android.hardware.tv.tuner.FrontendAnalogAftFlag aftFlag = android.hardware.tv.tuner.FrontendAnalogAftFlag.UNDEFINED; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl index b569c21da1..6301f96c61 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl @@ -35,7 +35,7 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable FrontendAtsc3PlpSettings { - byte plpId; + int plpId; android.hardware.tv.tuner.FrontendAtsc3Modulation modulation = android.hardware.tv.tuner.FrontendAtsc3Modulation.UNDEFINED; android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode interleaveMode = android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode.UNDEFINED; android.hardware.tv.tuner.FrontendAtsc3CodeRate codeRate = android.hardware.tv.tuner.FrontendAtsc3CodeRate.UNDEFINED; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl index bd96d14502..3cbb0d0337 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl @@ -35,8 +35,8 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable FrontendAtsc3Settings { - int frequency; - int endFrequency; + long frequency; + long endFrequency; android.hardware.tv.tuner.FrontendAtsc3Bandwidth bandwidth = android.hardware.tv.tuner.FrontendAtsc3Bandwidth.UNDEFINED; android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; android.hardware.tv.tuner.FrontendAtsc3DemodOutputFormat demodOutputFormat = android.hardware.tv.tuner.FrontendAtsc3DemodOutputFormat.UNDEFINED; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscSettings.aidl index 5ccdb85195..9121c12d5d 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendAtscSettings.aidl @@ -35,8 +35,8 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable FrontendAtscSettings { - int frequency; - int endFrequency; + long frequency; + long endFrequency; android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; android.hardware.tv.tuner.FrontendAtscModulation modulation = android.hardware.tv.tuner.FrontendAtscModulation.UNDEFINED; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbSettings.aidl index 9a2e341b2a..5f9b775db1 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDtmbSettings.aidl @@ -35,8 +35,8 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable FrontendDtmbSettings { - int frequency; - int endFrequency; + long frequency; + long endFrequency; android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; android.hardware.tv.tuner.FrontendDtmbTransmissionMode transmissionMode = android.hardware.tv.tuner.FrontendDtmbTransmissionMode.UNDEFINED; android.hardware.tv.tuner.FrontendDtmbBandwidth bandwidth = android.hardware.tv.tuner.FrontendDtmbBandwidth.UNDEFINED; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcSettings.aidl index 55f04029f2..6b2caedf83 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbcSettings.aidl @@ -35,8 +35,8 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable FrontendDvbcSettings { - int frequency; - int endFrequency; + long frequency; + long endFrequency; android.hardware.tv.tuner.FrontendDvbcModulation modulation = android.hardware.tv.tuner.FrontendDvbcModulation.UNDEFINED; android.hardware.tv.tuner.FrontendInnerFec fec = android.hardware.tv.tuner.FrontendInnerFec.FEC_UNDEFINED; int symbolRate; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsSettings.aidl index 8a8c76f7f6..dab8888b65 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbsSettings.aidl @@ -35,8 +35,8 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable FrontendDvbsSettings { - int frequency; - int endFrequency; + long frequency; + long endFrequency; android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; android.hardware.tv.tuner.FrontendDvbsModulation modulation = android.hardware.tv.tuner.FrontendDvbsModulation.UNDEFINED; android.hardware.tv.tuner.FrontendDvbsCodeRate coderate; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtSettings.aidl index cc64549a47..ec1277aa99 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendDvbtSettings.aidl @@ -35,8 +35,8 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable FrontendDvbtSettings { - int frequency; - int endFrequency; + long frequency; + long endFrequency; android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; android.hardware.tv.tuner.FrontendDvbtTransmissionMode transmissionMode = android.hardware.tv.tuner.FrontendDvbtTransmissionMode.UNDEFINED; android.hardware.tv.tuner.FrontendDvbtBandwidth bandwidth = android.hardware.tv.tuner.FrontendDvbtBandwidth.UNDEFINED; @@ -49,6 +49,6 @@ parcelable FrontendDvbtSettings { android.hardware.tv.tuner.FrontendDvbtStandard standard = android.hardware.tv.tuner.FrontendDvbtStandard.UNDEFINED; boolean isMiso; android.hardware.tv.tuner.FrontendDvbtPlpMode plpMode = android.hardware.tv.tuner.FrontendDvbtPlpMode.UNDEFINED; - byte plpId; - byte plpGroupId; + int plpId; + int plpGroupId; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInfo.aidl index 2f8e6e5bd0..d5bdd58505 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInfo.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendInfo.aidl @@ -36,11 +36,11 @@ package android.hardware.tv.tuner; @VintfStability parcelable FrontendInfo { android.hardware.tv.tuner.FrontendType type = android.hardware.tv.tuner.FrontendType.UNDEFINED; - int minFrequency; - int maxFrequency; + long minFrequency; + long maxFrequency; int minSymbolRate; int maxSymbolRate; - int acquireRange; + long acquireRange; int exclusiveGroupId; android.hardware.tv.tuner.FrontendStatusType[] statusCaps; android.hardware.tv.tuner.FrontendCapabilities frontendCaps; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl index b96bf32f2a..8c491d6fa2 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl @@ -35,9 +35,9 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable FrontendIsdbs3Settings { - int frequency; - int endFrequency; - char streamId; + long frequency; + long endFrequency; + int streamId; android.hardware.tv.tuner.FrontendIsdbsStreamIdType streamIdType = android.hardware.tv.tuner.FrontendIsdbsStreamIdType.UNDEFINED; android.hardware.tv.tuner.FrontendIsdbs3Modulation modulation = android.hardware.tv.tuner.FrontendIsdbs3Modulation.UNDEFINED; android.hardware.tv.tuner.FrontendIsdbs3Coderate coderate = android.hardware.tv.tuner.FrontendIsdbs3Coderate.UNDEFINED; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl index 0b48ac5a3d..324fb6feb4 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl @@ -35,9 +35,9 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable FrontendIsdbsSettings { - int frequency; - int endFrequency; - char streamId; + long frequency; + long endFrequency; + int streamId; android.hardware.tv.tuner.FrontendIsdbsStreamIdType streamIdType = android.hardware.tv.tuner.FrontendIsdbsStreamIdType.UNDEFINED; android.hardware.tv.tuner.FrontendIsdbsModulation modulation = android.hardware.tv.tuner.FrontendIsdbsModulation.UNDEFINED; android.hardware.tv.tuner.FrontendIsdbsCoderate coderate = android.hardware.tv.tuner.FrontendIsdbsCoderate.UNDEFINED; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl index ffd30ef61c..62490970ed 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl @@ -35,8 +35,8 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable FrontendIsdbtSettings { - int frequency; - int endFrequency; + long frequency; + long endFrequency; android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; android.hardware.tv.tuner.FrontendIsdbtModulation modulation = android.hardware.tv.tuner.FrontendIsdbtModulation.UNDEFINED; android.hardware.tv.tuner.FrontendIsdbtBandwidth bandwidth = android.hardware.tv.tuner.FrontendIsdbtBandwidth.UNDEFINED; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl index 4e217ef8f3..56ef3e3d13 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl @@ -35,6 +35,6 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable FrontendScanAtsc3PlpInfo { - byte plpId; + int plpId; boolean bLlsFlag; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl index 882bdadf83..2c6cc00edb 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl @@ -37,14 +37,14 @@ package android.hardware.tv.tuner; union FrontendScanMessage { boolean isLocked; boolean isEnd; - byte progressPercent; - int[] frequencies; + int progressPercent; + long[] frequencies; int[] symbolRates; android.hardware.tv.tuner.FrontendDvbtHierarchy hierarchy; android.hardware.tv.tuner.FrontendAnalogType analogType; - byte[] plpIds; - byte[] groupIds; - char[] inputStreamIds; + int[] plpIds; + int[] groupIds; + int[] inputStreamIds; android.hardware.tv.tuner.FrontendScanMessageStandard std; android.hardware.tv.tuner.FrontendScanAtsc3PlpInfo[] atsc3PlpInfos; android.hardware.tv.tuner.FrontendModulation modulation; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl index 114b72f940..6296cfce71 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl @@ -47,13 +47,13 @@ union FrontendStatus { android.hardware.tv.tuner.FrontendModulationStatus modulationStatus; android.hardware.tv.tuner.FrontendSpectralInversion inversion; android.hardware.tv.tuner.LnbVoltage lnbVoltage; - byte plpId; + int plpId; boolean isEWBS; - byte agc; + int agc; boolean isLnaOn; boolean[] isLayerError; int mer; - int freqOffset; + long freqOffset; android.hardware.tv.tuner.FrontendDvbtHierarchy hierarchy; boolean isRfLocked; android.hardware.tv.tuner.FrontendStatusAtsc3PlpInfo[] plpInfo; @@ -64,9 +64,9 @@ union FrontendStatus { android.hardware.tv.tuner.FrontendGuardInterval interval; android.hardware.tv.tuner.FrontendTransmissionMode transmissionMode; int uec; - char systemId; + int systemId; android.hardware.tv.tuner.FrontendInterleaveMode[] interleaving; - byte[] isdbtSegment; + int[] isdbtSegment; int[] tsDataRate; android.hardware.tv.tuner.FrontendRollOff rollOff; boolean isMiso; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl index 9cd1b8a8f9..8f65925236 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl @@ -35,7 +35,7 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable FrontendStatusAtsc3PlpInfo { - byte plpId; + int plpId; boolean isLocked; int uec; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/PlaybackSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/PlaybackSettings.aidl index ff459e227f..e0dd5db071 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/PlaybackSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/PlaybackSettings.aidl @@ -36,8 +36,8 @@ package android.hardware.tv.tuner; @VintfStability parcelable PlaybackSettings { int statusMask; - int lowThreshold; - int highThreshold; + long lowThreshold; + long highThreshold; android.hardware.tv.tuner.DataFormat dataFormat = android.hardware.tv.tuner.DataFormat.UNDEFINED; - byte packetSize; + long packetSize; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/RecordSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/RecordSettings.aidl index 447de9871d..de693cd2d2 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/RecordSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/RecordSettings.aidl @@ -36,8 +36,8 @@ package android.hardware.tv.tuner; @VintfStability parcelable RecordSettings { int statusMask; - int lowThreshold; - int highThreshold; + long lowThreshold; + long highThreshold; android.hardware.tv.tuner.DataFormat dataFormat = android.hardware.tv.tuner.DataFormat.UNDEFINED; - byte packetSize; + long packetSize; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AudioExtraMetaData.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AudioExtraMetaData.aidl index b5adb7ddd0..ea2ef4f0e9 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/AudioExtraMetaData.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/AudioExtraMetaData.aidl @@ -27,7 +27,7 @@ parcelable AudioExtraMetaData { byte adPan; - byte versionTextTag; + char versionTextTag; byte adGainCenter; diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl index 397002d932..95bcf65888 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl @@ -33,7 +33,7 @@ parcelable DemuxAlpFilterSettings { * 6: Packet Type Extension * 8: MPEG-2 Transport Stream */ - byte packetType; + int packetType; DemuxAlpLengthType lengthType = DemuxAlpLengthType.UNDEFINED; diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxCapabilities.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxCapabilities.aidl index 49fa08d17d..6d61c97052 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxCapabilities.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxCapabilities.aidl @@ -70,7 +70,7 @@ parcelable DemuxCapabilities { /** * The maximum number of bytes is supported in the mask of Section Filter. */ - int numBytesInSectionFilter; + long numBytesInSectionFilter; /** * Filter Main Types defined by DemuxFilterMainType. The DemuxFilterMainTypes diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl index d59dd2eed4..cf88928886 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl @@ -39,5 +39,5 @@ parcelable DemuxFilterDownloadEvent { /** * Data size in bytes of filtered data */ - char dataLength; + int dataLength; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl index 0619b4543f..4d6c6e2217 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl @@ -25,5 +25,5 @@ parcelable DemuxFilterIpPayloadEvent { /** * Data size in bytes of IP data */ - char dataLength; + int dataLength; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl index 754708c635..ec7bbf1aa7 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl @@ -26,7 +26,7 @@ import android.hardware.tv.tuner.DemuxFilterMediaEventExtraMetaData; */ @VintfStability parcelable DemuxFilterMediaEvent { - char streamId; + int streamId; /** * true if PTS is present in PES header. @@ -42,13 +42,13 @@ parcelable DemuxFilterMediaEvent { /** * Data size in bytes of audio or video frame */ - int dataLength; + long dataLength; /** * The offset in the memory block which is shared among multiple * MediaEvents. */ - int offset; + long offset; /** * A handle associated to the memory where audio or video data stays. diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl index 9780f40ad2..56fbbfc6ab 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl @@ -22,7 +22,7 @@ package android.hardware.tv.tuner; */ @VintfStability parcelable DemuxFilterPesDataSettings { - char streamId; + int streamId; /** * true if the filter send onFilterStatus instead of onFilterEvent. diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl index 2b24cd9046..0767c02155 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl @@ -22,12 +22,12 @@ package android.hardware.tv.tuner; */ @VintfStability parcelable DemuxFilterPesEvent { - char streamId; + int streamId; /** * Data size in bytes of PES data */ - char dataLength; + int dataLength; /** * MPU sequence number of filtered data (only for MMTP) diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl index 1a327f30a7..d6663168d8 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl @@ -25,20 +25,20 @@ parcelable DemuxFilterSectionEvent { /** * Table ID of filtered data */ - char tableId; + int tableId; /** * Version number of filtered data */ - char version; + int version; /** * Section number of filtered data */ - char sectionNum; + int sectionNum; /** * Data size in bytes of filtered data */ - char dataLength; + int dataLength; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl index c76d84caf2..898b9cc0cc 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl @@ -25,10 +25,10 @@ parcelable DemuxFilterSectionSettingsConditionTableInfo { /** * Table ID for Section Filter */ - char tableId; + int tableId; /** * Version number for Section Filter */ - char version; + int version; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpAddress.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpAddress.aidl index 9c704a3e6e..c088cdcc9b 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpAddress.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxIpAddress.aidl @@ -31,10 +31,10 @@ parcelable DemuxIpAddress { /** * 0 is invalid. should be ignored. */ - char srcPort; + int srcPort; /** * 0 is invalid. should be ignored. */ - char dstPort; + int dstPort; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl index 3759ce0810..8093d63bad 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl @@ -24,7 +24,7 @@ import android.hardware.tv.tuner.DemuxMmtpFilterSettingsFilterSettings; */ @VintfStability parcelable DemuxMmtpFilterSettings { - char mmtpPid; + int mmtpPid; DemuxMmtpFilterSettingsFilterSettings filterSettings; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxPid.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxPid.aidl index a76d208017..75134541d2 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxPid.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxPid.aidl @@ -25,10 +25,10 @@ union DemuxPid { /** * Packet ID is used to specify packets in transport stream. */ - char tPid; + int tPid; /** * Packet ID is used to specify packets in MMTP. */ - char mmtpPid; + int mmtpPid; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl index fd1289df00..7a215e77af 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl @@ -32,7 +32,7 @@ parcelable DemuxTlvFilterSettings { * 0xFE: Signaling packet * 0xFF: NULL packet */ - byte packetType; + int packetType; /** * true if the filtered data is commpressed ip packet diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl index 1345831dc6..0fc40d6f76 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl @@ -27,7 +27,7 @@ parcelable DemuxTsFilterSettings { /** * Packet ID is used to specify packets in transport stream. */ - char tpid; + int tpid; DemuxTsFilterSettingsFilterSettings filterSettings; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogSettings.aidl index 926929f82f..0a3646d188 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAnalogSettings.aidl @@ -30,12 +30,12 @@ parcelable FrontendAnalogSettings { /** * Signal frequency in Hertz */ - int frequency; + long frequency; /** * Signal end frequency in Hertz used by scan */ - int endFrequency; + long endFrequency; FrontendSpectralInversion inversion = FrontendSpectralInversion.UNDEFINED; diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl index 5678dd39fc..b7e2295187 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl @@ -27,7 +27,7 @@ import android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode; */ @VintfStability parcelable FrontendAtsc3PlpSettings { - byte plpId; + int plpId; FrontendAtsc3Modulation modulation = FrontendAtsc3Modulation.UNDEFINED; diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl index dc1e52038b..981adc565f 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl @@ -30,12 +30,12 @@ parcelable FrontendAtsc3Settings { /** * Signal frequency in Hertz */ - int frequency; + long frequency; /** * Signal end frequency in Hertz used by scan */ - int endFrequency; + long endFrequency; /** * Bandwidth of tuning band. diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscSettings.aidl index 1279b1494f..f9d267efd4 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendAtscSettings.aidl @@ -28,12 +28,12 @@ parcelable FrontendAtscSettings { /** * Signal frequency in Hertz */ - int frequency; + long frequency; /** * Signal end frequency in Hertz used by scan */ - int endFrequency; + long endFrequency; FrontendSpectralInversion inversion = FrontendSpectralInversion.UNDEFINED; diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbSettings.aidl index ccac650d84..095d0b5fc2 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDtmbSettings.aidl @@ -33,12 +33,12 @@ parcelable FrontendDtmbSettings { /** * Signal frequency in Hertz */ - int frequency; + long frequency; /** * Signal end frequency in Hertz used by scan */ - int endFrequency; + long endFrequency; FrontendSpectralInversion inversion = FrontendSpectralInversion.UNDEFINED; diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcSettings.aidl index d18d373d6d..51be57f9df 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbcSettings.aidl @@ -33,12 +33,12 @@ parcelable FrontendDvbcSettings { /** * Signal frequency in Hertz */ - int frequency; + long frequency; /** * Signal end frequency in Hertz used by scan */ - int endFrequency; + long endFrequency; FrontendDvbcModulation modulation = FrontendDvbcModulation.UNDEFINED; diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsSettings.aidl index d285ac1791..785046b53c 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbsSettings.aidl @@ -34,12 +34,12 @@ parcelable FrontendDvbsSettings { /** * Signal frequency in Hertz */ - int frequency; + long frequency; /** * Signal end frequency in Hertz used by scan */ - int endFrequency; + long endFrequency; FrontendSpectralInversion inversion = FrontendSpectralInversion.UNDEFINED; diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtSettings.aidl index 4af0d10294..238f071904 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendDvbtSettings.aidl @@ -35,12 +35,12 @@ parcelable FrontendDvbtSettings { /** * Signal frequency in Hertz */ - int frequency; + long frequency; /** * Signal end frequency in Hertz used by scan */ - int endFrequency; + long endFrequency; FrontendSpectralInversion inversion = FrontendSpectralInversion.UNDEFINED; @@ -75,10 +75,10 @@ parcelable FrontendDvbtSettings { /** * Physical Layer Pipe (PLP) Id */ - byte plpId; + int plpId; /** * Group Id for Physical Layer Pipe (PLP) */ - byte plpGroupId; + int plpGroupId; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendInfo.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendInfo.aidl index 9f178db5a4..6168fc105a 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendInfo.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendInfo.aidl @@ -31,12 +31,12 @@ parcelable FrontendInfo { /** * Frequency in Hertz */ - int minFrequency; + long minFrequency; /** * Frequency in Hertz */ - int maxFrequency; + long maxFrequency; /** * Minimum symbols per second @@ -51,7 +51,7 @@ parcelable FrontendInfo { /** * Range in Hertz */ - int acquireRange; + long acquireRange; /** * Frontends are assigned with the same exclusiveGroupId if they can't diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl index a7c85ac153..9b38a59c6f 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl @@ -30,14 +30,14 @@ parcelable FrontendIsdbs3Settings { /** * Signal frequency in Hertz */ - int frequency; + long frequency; /** * Signal end frequency in Hertz used by scan */ - int endFrequency; + long endFrequency; - char streamId; + int streamId; FrontendIsdbsStreamIdType streamIdType = FrontendIsdbsStreamIdType.UNDEFINED; diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl index dde3002434..d5b90b746e 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl @@ -30,14 +30,14 @@ parcelable FrontendIsdbsSettings { /** * Signal frequency in Hertz */ - int frequency; + long frequency; /** * Signal end frequency in Hertz used by scan */ - int endFrequency; + long endFrequency; - char streamId; + int streamId; FrontendIsdbsStreamIdType streamIdType = FrontendIsdbsStreamIdType.UNDEFINED; diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl index ffa884558c..08f6130b1a 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl @@ -32,12 +32,12 @@ parcelable FrontendIsdbtSettings { /** * Signal frequency in Hertz */ - int frequency; + long frequency; /** * Signal end frequency in Hertz used by scan */ - int endFrequency; + long endFrequency; FrontendSpectralInversion inversion = FrontendSpectralInversion.UNDEFINED; diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl index 1fe2b1ff2c..ac0c287f4b 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl @@ -22,7 +22,7 @@ package android.hardware.tv.tuner; */ @VintfStability parcelable FrontendScanAtsc3PlpInfo { - byte plpId; + int plpId; boolean bLlsFlag; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl index d89e9b1c36..19c6766235 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl @@ -36,12 +36,12 @@ union FrontendScanMessage { /** * scan progress percent (0..100) */ - byte progressPercent; + int progressPercent; /** * Signal frequencies in Hertz */ - int[] frequencies; + long[] frequencies; /** * Symbols per second @@ -52,11 +52,11 @@ union FrontendScanMessage { FrontendAnalogType analogType; - byte[] plpIds; + int[] plpIds; - byte[] groupIds; + int[] groupIds; - char[] inputStreamIds; + int[] inputStreamIds; FrontendScanMessageStandard std; diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl index b9f73add65..ddbd0f857a 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl @@ -83,14 +83,14 @@ union FrontendStatus { LnbVoltage lnbVoltage; - byte plpId; + int plpId; boolean isEWBS; /** * AGC value is normalized from 0 to 255. */ - byte agc; + int agc; boolean isLnaOn; @@ -104,7 +104,7 @@ union FrontendStatus { /** * Frequency difference in Hertz. */ - int freqOffset; + long freqOffset; FrontendDvbtHierarchy hierarchy; @@ -154,7 +154,7 @@ union FrontendStatus { /** * The current DVB-T2 system id status. */ - char systemId; + int systemId; /** * Frontend Interleaving Modes. @@ -164,7 +164,7 @@ union FrontendStatus { /** * Segments in ISDB-T Specification of all the channels. */ - byte[] isdbtSegment; + int[] isdbtSegment; /** * Transport Stream Data Rate in BPS of the current channel. diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl index c10a08c00f..6b44bc0d20 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl @@ -25,7 +25,7 @@ parcelable FrontendStatusAtsc3PlpInfo { /** * PLP Id value. */ - byte plpId; + int plpId; /** * Demod Lock/Unlock status of this particular PLP. diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/PlaybackSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/PlaybackSettings.aidl index 47d3db6545..fc5cf63a0d 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/PlaybackSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/PlaybackSettings.aidl @@ -34,13 +34,13 @@ parcelable PlaybackSettings { * Unused space size in bytes in the playback. The HAL uses it to trigger * InputStatus::SPACE_ALMOST_EMPTY. */ - int lowThreshold; + long lowThreshold; /** * Unused space size in bytes in the playback. The HAL uses it to trigger * InputStatus::SPACE_ALMOST_FULL. */ - int highThreshold; + long highThreshold; /** * The data format in the playback. @@ -50,5 +50,5 @@ parcelable PlaybackSettings { /** * The packet size in bytes in the playback. */ - byte packetSize; + long packetSize; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/RecordSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/RecordSettings.aidl index 94370d6974..ac851c656b 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/RecordSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/RecordSettings.aidl @@ -34,13 +34,13 @@ parcelable RecordSettings { * Unconsumed data size in bytes in the record. The HAL uses it to trigger * OutputStatus::LOW_WATER. */ - int lowThreshold; + long lowThreshold; /** * Unconsumed data size in bytes in the record. The HAL uses it to trigger * OutputStatus::High_WATER. */ - int highThreshold; + long highThreshold; /** * The data format in the record. @@ -50,5 +50,5 @@ parcelable RecordSettings { /** * The packet size in bytes in the record. */ - byte packetSize; + long packetSize; } -- GitLab From 11da2cb5f79a096a966d7f72a3e549f568a7081f Mon Sep 17 00:00:00 2001 From: Hongguang Date: Thu, 5 Aug 2021 19:05:12 -0700 Subject: [PATCH 115/825] Adjust tuner default implementation and VTS types size. Bug: 195693712 Test: atest VtsHalTvTunerTargetTest Test: atest android.media.tv.tuner.cts Change-Id: Ie9d20c74b05ecc10333ca883fe38d26d78f33949 --- tv/tuner/aidl/default/Dvr.cpp | 9 ++-- tv/tuner/aidl/default/Dvr.h | 4 +- tv/tuner/aidl/default/Filter.cpp | 13 +++--- tv/tuner/aidl/default/Filter.h | 2 +- tv/tuner/aidl/default/Frontend.cpp | 14 +++---- tv/tuner/aidl/vts/functional/FilterTests.cpp | 4 +- .../aidl/vts/functional/FrontendTests.cpp | 6 +-- tv/tuner/aidl/vts/functional/FrontendTests.h | 6 +-- .../config/TunerTestingConfigAidlReaderV1_0.h | 41 +++++++++++-------- 9 files changed, 51 insertions(+), 48 deletions(-) diff --git a/tv/tuner/aidl/default/Dvr.cpp b/tv/tuner/aidl/default/Dvr.cpp index 9eadb8ce19..4f34b8e2c8 100644 --- a/tv/tuner/aidl/default/Dvr.cpp +++ b/tv/tuner/aidl/default/Dvr.cpp @@ -237,7 +237,7 @@ void Dvr::maySendPlaybackStatusCallback() { } PlaybackStatus Dvr::checkPlaybackStatusChange(uint32_t availableToWrite, uint32_t availableToRead, - uint32_t highThreshold, uint32_t lowThreshold) { + int64_t highThreshold, int64_t lowThreshold) { if (availableToWrite == 0) { return PlaybackStatus::SPACE_FULL; } else if (availableToRead > highThreshold) { @@ -252,9 +252,8 @@ PlaybackStatus Dvr::checkPlaybackStatusChange(uint32_t availableToWrite, uint32_ bool Dvr::readPlaybackFMQ(bool isVirtualFrontend, bool isRecording) { // Read playback data from the input FMQ - int size = mDvrMQ->availableToRead(); - uint8_t playbackPacketSize = - static_cast(mDvrSettings.get().packetSize); + size_t size = mDvrMQ->availableToRead(); + int64_t playbackPacketSize = mDvrSettings.get().packetSize; vector dataOutputBuffer; dataOutputBuffer.resize(playbackPacketSize); // Dispatch the packet to the PID matching filter output buffer @@ -461,7 +460,7 @@ void Dvr::maySendRecordStatusCallback() { } RecordStatus Dvr::checkRecordStatusChange(uint32_t availableToWrite, uint32_t availableToRead, - uint32_t highThreshold, uint32_t lowThreshold) { + int64_t highThreshold, int64_t lowThreshold) { if (availableToWrite == 0) { return RecordStatus::OVERFLOW; } else if (availableToRead > highThreshold) { diff --git a/tv/tuner/aidl/default/Dvr.h b/tv/tuner/aidl/default/Dvr.h index 68933aed70..586f885f85 100644 --- a/tv/tuner/aidl/default/Dvr.h +++ b/tv/tuner/aidl/default/Dvr.h @@ -101,9 +101,9 @@ class Dvr : public BnDvr { void maySendPlaybackStatusCallback(); void maySendRecordStatusCallback(); PlaybackStatus checkPlaybackStatusChange(uint32_t availableToWrite, uint32_t availableToRead, - uint32_t highThreshold, uint32_t lowThreshold); + int64_t highThreshold, int64_t lowThreshold); RecordStatus checkRecordStatusChange(uint32_t availableToWrite, uint32_t availableToRead, - uint32_t highThreshold, uint32_t lowThreshold); + int64_t highThreshold, int64_t lowThreshold); /** * A dispatcher to read and dispatch input data to all the started filters. * Each filter handler handles the data filtering/output writing/filterEvent updating. diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp index 77ca2ee62b..9755e39b67 100644 --- a/tv/tuner/aidl/default/Filter.cpp +++ b/tv/tuner/aidl/default/Filter.cpp @@ -646,8 +646,8 @@ void Filter::updateRecordOutput(vector& data) { DemuxFilterPesEvent pesEvent; pesEvent = { // temp dump meta data - .streamId = static_cast(mPesOutput[3]), - .dataLength = static_cast(mPesOutput.size()), + .streamId = static_cast(mPesOutput[3]), + .dataLength = static_cast(mPesOutput.size()), }; if (DEBUG_FILTER) { ALOGD("[Filter] assembled pes data length %d", pesEvent.dataLength); @@ -793,7 +793,7 @@ bool Filter::writeSectionsAndCreateEvent(vector& data) { .tableId = 0, .version = 1, .sectionNum = 1, - .dataLength = static_cast(data.size()), + .dataLength = static_cast(data.size()), }; mFilterEvents[size].set(secEvent); return true; @@ -891,7 +891,7 @@ native_handle_t* Filter::createNativeHandle(int fd) { mFilterEvents[size].get().avMemory = ::android::dupToAidl(nativeHandle); mFilterEvents[size].get().dataLength = - static_cast(output.size()); + static_cast(output.size()); mFilterEvents[size].get().avDataId = static_cast(dataId); if (mPts) { mFilterEvents[size].get().pts = mPts; @@ -932,10 +932,9 @@ native_handle_t* Filter::createNativeHandle(int fd) { mFilterEvents[size] = DemuxFilterEvent::make(); mFilterEvents[size].get().avMemory = ::android::dupToAidl(nativeHandle); - mFilterEvents[size].get().offset = - static_cast(mSharedAvMemOffset); + mFilterEvents[size].get().offset = mSharedAvMemOffset; mFilterEvents[size].get().dataLength = - static_cast(output.size()); + static_cast(output.size()); if (mPts) { mFilterEvents[size].get().pts = mPts; mPts = 0; diff --git a/tv/tuner/aidl/default/Filter.h b/tv/tuner/aidl/default/Filter.h index 30eb24bda8..3f40256c58 100644 --- a/tv/tuner/aidl/default/Filter.h +++ b/tv/tuner/aidl/default/Filter.h @@ -221,7 +221,7 @@ class Filter : public BnFilter { // Shared A/V memory handle native_handle_t* mSharedAvMemHandle = nullptr; bool mUsingSharedAvMem = false; - uint32_t mSharedAvMemOffset = 0; + int64_t mSharedAvMemOffset = 0; uint32_t mAudioStreamType; uint32_t mVideoStreamType; diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index 438f897446..660d0bbc34 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -94,7 +94,7 @@ Frontend::~Frontend() {} return ::ndk::ScopedAStatus::ok(); } - int32_t frequency = 0; + int64_t frequency = 0; switch (in_settings.getTag()) { case FrontendSettings::Tag::analog: frequency = in_settings.get().frequency; @@ -133,7 +133,7 @@ Frontend::~Frontend() {} { FrontendScanMessage msg; - vector frequencies = {frequency}; + vector frequencies = {frequency}; msg.set(frequencies); mCallback->onScanMessage(FrontendScanMessageType::FREQUENCY, msg); } @@ -165,21 +165,21 @@ Frontend::~Frontend() {} { FrontendScanMessage msg; - vector plpIds = {2}; + vector plpIds = {2}; msg.set(plpIds); mCallback->onScanMessage(FrontendScanMessageType::PLP_IDS, msg); } { FrontendScanMessage msg; - vector groupIds = {3}; + vector groupIds = {3}; msg.set(groupIds); mCallback->onScanMessage(FrontendScanMessageType::GROUP_IDS, msg); } { FrontendScanMessage msg; - vector inputStreamIds = {1}; + vector inputStreamIds = {1}; msg.set(inputStreamIds); mCallback->onScanMessage(FrontendScanMessageType::INPUT_STREAM_IDS, msg); } @@ -350,7 +350,7 @@ Frontend::~Frontend() {} break; } case FrontendStatusType::PLP_ID: { - status.set(101); // type uint8_t + status.set(101); break; } case FrontendStatusType::EWBS: { @@ -613,7 +613,7 @@ Frontend::~Frontend() {} break; } case FrontendStatusType::ISDBT_SEGMENTS: { - vector segments = {2, 3}; + vector segments = {2, 3}; status.set(segments); break; } diff --git a/tv/tuner/aidl/vts/functional/FilterTests.cpp b/tv/tuner/aidl/vts/functional/FilterTests.cpp index 381475a2a3..c53adb26b9 100644 --- a/tv/tuner/aidl/vts/functional/FilterTests.cpp +++ b/tv/tuner/aidl/vts/functional/FilterTests.cpp @@ -118,8 +118,8 @@ void FilterCallback::readFilterEventsData(const vector& events } bool FilterCallback::dumpAvData(const DemuxFilterMediaEvent& event) { - int32_t length = event.dataLength; - int32_t offset = event.offset; + int64_t length = event.dataLength; + int64_t offset = event.offset; int av_fd; // read data from buffer pointed by a handle if (event.avMemory.fds.size() == 0) { diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp index 93b79766dc..7dce4fb4ff 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp +++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp @@ -120,7 +120,7 @@ void FrontendCallback::tuneTestOnLock(std::shared_ptr& frontend, void FrontendCallback::scanTest(std::shared_ptr& frontend, FrontendConfig config, FrontendScanType type) { - int32_t targetFrequency = getTargetFrequency(config.settings); + int64_t targetFrequency = getTargetFrequency(config.settings); if (type == FrontendScanType::SCAN_BLIND) { // reset the frequency in the scan configuration to test blind scan. The settings param of // passed in means the real input config on the transponder connected to the DUT. @@ -176,7 +176,7 @@ wait: mScanMsgProcessed = true; } -int32_t FrontendCallback::getTargetFrequency(FrontendSettings& settings) { +int64_t FrontendCallback::getTargetFrequency(FrontendSettings& settings) { switch (settings.getTag()) { case FrontendSettings::Tag::analog: return settings.get().frequency; @@ -202,7 +202,7 @@ int32_t FrontendCallback::getTargetFrequency(FrontendSettings& settings) { } void FrontendCallback::resetBlindScanStartingFrequency(FrontendConfig& config, - int32_t resetingFreq) { + int64_t resetingFreq) { switch (config.settings.getTag()) { case FrontendSettings::Tag::analog: config.settings.get().frequency = resetingFreq; diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.h b/tv/tuner/aidl/vts/functional/FrontendTests.h index b65704f64b..e5a9cd3553 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.h +++ b/tv/tuner/aidl/vts/functional/FrontendTests.h @@ -53,8 +53,8 @@ class FrontendCallback : public BnFrontendCallback { FrontendScanType type); // Helper methods - int32_t getTargetFrequency(FrontendSettings& settings); - void resetBlindScanStartingFrequency(FrontendConfig& config, int32_t resetingFreq); + int64_t getTargetFrequency(FrontendSettings& settings); + void resetBlindScanStartingFrequency(FrontendConfig& config, int64_t resetingFreq); private: void readFrontendScanMessage_Modulation(FrontendModulation modulation); @@ -113,7 +113,7 @@ class FrontendTests { .lowThreshold = 0x1000, .highThreshold = 0x07fff, .dataFormat = DataFormat::ES, - .packetSize = static_cast(188), + .packetSize = static_cast(188), }; dvrConfig.type = DvrType::PLAYBACK; dvrConfig.playbackInputFile = "/data/local/tmp/test.es"; diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h index 2d7be9e5fa..b411011ba8 100644 --- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h +++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h @@ -334,7 +334,7 @@ struct TunerTestingConfigAidlReader1_0 { filterMap[id].settings = settings; if (filterConfig.hasMonitorEventTypes()) { - filterMap[id].monitorEventTypes = (uint32_t)filterConfig.getMonitorEventTypes(); + filterMap[id].monitorEventTypes = (int32_t)filterConfig.getMonitorEventTypes(); } if (filterConfig.hasAvFilterSettings_optional()) { auto av = filterConfig.getFirstAvFilterSettings_optional(); @@ -380,7 +380,7 @@ struct TunerTestingConfigAidlReader1_0 { return; } dvrMap[id].type = type; - dvrMap[id].bufferSize = static_cast(dvrConfig.getBufferSize()); + dvrMap[id].bufferSize = static_cast(dvrConfig.getBufferSize()); if (dvrConfig.hasInputFilePath()) { dvrMap[id].playbackInputFile = dvrConfig.getInputFilePath(); } @@ -413,7 +413,7 @@ struct TunerTestingConfigAidlReader1_0 { for (auto descramblerConfig : descramblers.getDescrambler()) { string id = descramblerConfig.getId(); descramblerMap[id].casSystemId = - static_cast(descramblerConfig.getCasSystemId()); + static_cast(descramblerConfig.getCasSystemId()); if (descramblerConfig.hasProvisionStr()) { descramblerMap[id].provisionStr = descramblerConfig.getProvisionStr(); } else { @@ -450,8 +450,7 @@ struct TunerTestingConfigAidlReader1_0 { auto timeFilters = *hardwareConfig.getFirstTimeFilters(); for (auto timeFilterConfig : timeFilters.getTimeFilter()) { string id = timeFilterConfig.getId(); - timeFilterMap[id].timeStamp = - static_cast(timeFilterConfig.getTimeStamp()); + timeFilterMap[id].timeStamp = static_cast(timeFilterConfig.getTimeStamp()); } } } @@ -625,14 +624,17 @@ struct TunerTestingConfigAidlReader1_0 { static FrontendDvbtSettings readDvbtFrontendSettings(Frontend feConfig) { ALOGW("[ConfigReader] fe type is dvbt"); FrontendDvbtSettings dvbtSettings{ - .frequency = (int32_t)feConfig.getFrequency(), + .frequency = (int64_t)feConfig.getFrequency(), }; + if (feConfig.hasEndFrequency()) { + dvbtSettings.endFrequency = (int64_t)feConfig.getEndFrequency(); + } if (!feConfig.hasDvbtFrontendSettings_optional()) { ALOGW("[ConfigReader] no more dvbt settings"); return dvbtSettings; } auto dvbt = feConfig.getFirstDvbtFrontendSettings_optional(); - uint32_t trans = static_cast(dvbt->getTransmissionMode()); + int32_t trans = static_cast(dvbt->getTransmissionMode()); dvbtSettings.transmissionMode = static_cast(trans); dvbtSettings.bandwidth = static_cast(dvbt->getBandwidth()); dvbtSettings.isHighPriority = dvbt->getIsHighPriority(); @@ -656,15 +658,18 @@ struct TunerTestingConfigAidlReader1_0 { static FrontendDvbsSettings readDvbsFrontendSettings(Frontend feConfig) { ALOGW("[ConfigReader] fe type is dvbs"); FrontendDvbsSettings dvbsSettings{ - .frequency = (int32_t)feConfig.getFrequency(), + .frequency = (int64_t)feConfig.getFrequency(), }; + if (feConfig.hasEndFrequency()) { + dvbsSettings.endFrequency = (int64_t)feConfig.getEndFrequency(); + } if (!feConfig.hasDvbsFrontendSettings_optional()) { ALOGW("[ConfigReader] no more dvbs settings"); return dvbsSettings; } - dvbsSettings.symbolRate = static_cast( + dvbsSettings.symbolRate = static_cast( feConfig.getFirstDvbsFrontendSettings_optional()->getSymbolRate()); - dvbsSettings.inputStreamId = static_cast( + dvbsSettings.inputStreamId = static_cast( feConfig.getFirstDvbsFrontendSettings_optional()->getInputStreamId()); auto dvbs = feConfig.getFirstDvbsFrontendSettings_optional(); if (dvbs->hasScanType()) { @@ -968,11 +973,11 @@ struct TunerTestingConfigAidlReader1_0 { static PlaybackSettings readPlaybackSettings(Dvr dvrConfig) { ALOGW("[ConfigReader] dvr type is playback"); PlaybackSettings playbackSettings{ - .statusMask = static_cast(dvrConfig.getStatusMask()), - .lowThreshold = static_cast(dvrConfig.getLowThreshold()), - .highThreshold = static_cast(dvrConfig.getHighThreshold()), + .statusMask = static_cast(dvrConfig.getStatusMask()), + .lowThreshold = static_cast(dvrConfig.getLowThreshold()), + .highThreshold = static_cast(dvrConfig.getHighThreshold()), .dataFormat = static_cast(dvrConfig.getDataFormat()), - .packetSize = static_cast(dvrConfig.getPacketSize()), + .packetSize = static_cast(dvrConfig.getPacketSize()), }; return playbackSettings; } @@ -980,11 +985,11 @@ struct TunerTestingConfigAidlReader1_0 { static RecordSettings readRecordSettings(Dvr dvrConfig) { ALOGW("[ConfigReader] dvr type is record"); RecordSettings recordSettings{ - .statusMask = static_cast(dvrConfig.getStatusMask()), - .lowThreshold = static_cast(dvrConfig.getLowThreshold()), - .highThreshold = static_cast(dvrConfig.getHighThreshold()), + .statusMask = static_cast(dvrConfig.getStatusMask()), + .lowThreshold = static_cast(dvrConfig.getLowThreshold()), + .highThreshold = static_cast(dvrConfig.getHighThreshold()), .dataFormat = static_cast(dvrConfig.getDataFormat()), - .packetSize = static_cast(dvrConfig.getPacketSize()), + .packetSize = static_cast(dvrConfig.getPacketSize()), }; return recordSettings; } -- GitLab From a56868b854e4f7bb6b7c45a4f4e3d4daf294a820 Mon Sep 17 00:00:00 2001 From: Sally Qi Date: Tue, 17 Aug 2021 17:11:30 -0700 Subject: [PATCH 116/825] Fix Vts drawLayers function for async renderengine change Bug: 180657548 Test: this Change-Id: I8980d843599fe8b8195f6a1b8540b5d13528ac4b --- graphics/composer/2.2/utils/vts/RenderEngineVts.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp index f78dda2689..fe59a9d82a 100644 --- a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp +++ b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp @@ -60,7 +60,6 @@ void TestRenderEngine::initGraphicBuffer(uint32_t width, uint32_t height, uint32 void TestRenderEngine::drawLayers() { base::unique_fd bufferFence; - base::unique_fd readyFence; std::vector compositionLayerPointers; compositionLayerPointers.reserve(mCompositionLayers.size()); @@ -71,8 +70,10 @@ void TestRenderEngine::drawLayers() { }); auto texture = std::make_shared( mGraphicBuffer, *mRenderEngine, renderengine::ExternalTexture::Usage::WRITEABLE); - mRenderEngine->drawLayers(mDisplaySettings, compositionLayerPointers, texture, true, - std::move(bufferFence), &readyFence); + auto [status, readyFence] = mRenderEngine + ->drawLayers(mDisplaySettings, compositionLayerPointers, + texture, true, std::move(bufferFence)) + .get(); int fd = readyFence.release(); if (fd != -1) { ASSERT_EQ(0, sync_wait(fd, -1)); -- GitLab From dda604440bd546c041106624c37dda4569420b9d Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Wed, 18 Aug 2021 08:49:49 -0700 Subject: [PATCH 117/825] Undefine NAN after including it in Looper.h Looper.h needs to include the header for unordered_map, which itself includes math.h, which defines the macro NAN. Some HALs use enums called NAN, which causes a build error if the NAN macro is defined. We need to undef NAN in these cases after including Looper.h. Bug: 195020232 Test: presubmit: checkbuild Change-Id: I63bba8ea809a12571ddc88cd1d20f2adeedf0b30 --- wifi/1.5/default/wifi.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wifi/1.5/default/wifi.h b/wifi/1.5/default/wifi.h index 840bdfd927..c94ef3f4cf 100644 --- a/wifi/1.5/default/wifi.h +++ b/wifi/1.5/default/wifi.h @@ -17,11 +17,15 @@ #ifndef WIFI_H_ #define WIFI_H_ -#include +// HACK: NAN is a macro defined in math.h, which can be included in various +// headers. This wifi HAL uses an enum called NAN, which does not compile when +// the macro is defined. Undefine NAN to work around it. +#undef NAN +#include #include -#include #include +#include #include "hidl_callback_util.h" #include "wifi_chip.h" -- GitLab From a257b78f60ff288ea5b9b3b16f854001b8d852d6 Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Wed, 4 Aug 2021 10:40:29 -0700 Subject: [PATCH 118/825] Creates Context Hub AIDL Bug: 194285834 Test: TreeHugger Change-Id: Icc1e126816e2f8a11a9ef964d6889955d7827180 --- .../compatibility_matrix.current.xml | 7 + contexthub/aidl/Android.bp | 28 ++++ .../hardware/contexthub/AsyncEventType.aidl | 38 +++++ .../hardware/contexthub/ContextHubInfo.aidl | 48 ++++++ .../contexthub/ContextHubMessage.aidl | 42 +++++ .../hardware/contexthub/IContextHub.aidl | 46 ++++++ .../contexthub/IContextHubCallback.aidl | 41 +++++ .../hardware/contexthub/NanoappBinary.aidl | 46 ++++++ .../hardware/contexthub/NanoappInfo.aidl | 41 +++++ .../android/hardware/contexthub/Setting.aidl | 42 +++++ .../hardware/contexthub/AsyncEventType.aidl | 24 +++ .../hardware/contexthub/ContextHubInfo.aidl | 64 ++++++++ .../contexthub/ContextHubMessage.aidl | 49 ++++++ .../hardware/contexthub/IContextHub.aidl | 154 ++++++++++++++++++ .../contexthub/IContextHubCallback.aidl | 77 +++++++++ .../hardware/contexthub/NanoappBinary.aidl | 55 +++++++ .../hardware/contexthub/NanoappInfo.aidl | 42 +++++ .../android/hardware/contexthub/Setting.aidl | 42 +++++ contexthub/aidl/default/Android.bp | 59 +++++++ contexthub/aidl/default/ContextHub.cpp | 83 ++++++++++ contexthub/aidl/default/contexthub-default.rc | 4 + .../aidl/default/contexthub-default.xml | 7 + .../include/contexthub-impl/ContextHub.h | 49 ++++++ contexthub/aidl/default/main.cpp | 36 ++++ 24 files changed, 1124 insertions(+) create mode 100644 contexthub/aidl/Android.bp create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/AsyncEventType.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubInfo.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubMessage.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappInfo.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl create mode 100644 contexthub/aidl/android/hardware/contexthub/AsyncEventType.aidl create mode 100644 contexthub/aidl/android/hardware/contexthub/ContextHubInfo.aidl create mode 100644 contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl create mode 100644 contexthub/aidl/android/hardware/contexthub/IContextHub.aidl create mode 100644 contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl create mode 100644 contexthub/aidl/android/hardware/contexthub/NanoappBinary.aidl create mode 100644 contexthub/aidl/android/hardware/contexthub/NanoappInfo.aidl create mode 100644 contexthub/aidl/android/hardware/contexthub/Setting.aidl create mode 100644 contexthub/aidl/default/Android.bp create mode 100644 contexthub/aidl/default/ContextHub.cpp create mode 100644 contexthub/aidl/default/contexthub-default.rc create mode 100644 contexthub/aidl/default/contexthub-default.xml create mode 100644 contexthub/aidl/default/include/contexthub-impl/ContextHub.h create mode 100644 contexthub/aidl/default/main.cpp diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 72cb2bcf69..62067bf0a1 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -194,6 +194,13 @@ default + + android.hardware.contexthub + + IContextHub + default + + android.hardware.contexthub 1.2 diff --git a/contexthub/aidl/Android.bp b/contexthub/aidl/Android.bp new file mode 100644 index 0000000000..2086508e67 --- /dev/null +++ b/contexthub/aidl/Android.bp @@ -0,0 +1,28 @@ +// Copyright 2021 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +aidl_interface { + name: "android.hardware.contexthub", + vendor_available: true, + srcs: ["android/hardware/contexthub/*.aidl"], + stability: "vintf", + backend: { + java: { + sdk_version: "module_current", + }, + ndk: { + apps_enabled: false, + }, + }, +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/AsyncEventType.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/AsyncEventType.aidl new file mode 100644 index 0000000000..8e0ff89c12 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/AsyncEventType.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 -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="int") @VintfStability +enum AsyncEventType { + RESTARTED = 1, +} 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 new file mode 100644 index 0000000000..e5735566e7 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubInfo.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 -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 ContextHubInfo { + String name; + String vendor; + String toolchain; + int id; + float peakMips; + int maxSupportedMessageLengthBytes; + long chrePlatformId; + byte chreApiMajorVersion; + byte chreApiMinorVersion; + char chrePatchVersion; + String[] supportedPermissions; +} 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 new file mode 100644 index 0000000000..e38c251928 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubMessage.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 -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 ContextHubMessage { + long nanoappId; + char hostEndPoint; + int messageType; + byte[] messageBody; + String[] permissions; +} 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 new file mode 100644 index 0000000000..cb31c84078 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 +interface IContextHub { + List getContextHubs(); + boolean loadNanoapp(in int contextHubId, in android.hardware.contexthub.NanoappBinary appBinary, in int transactionId); + boolean unloadNanoapp(in int contextHubId, in long appId, in int transactionId); + boolean disableNanoapp(in int contextHubId, in long appId, in int transactionId); + boolean enableNanoapp(in int contextHubId, in long appId, in int transactionId); + void onSettingChanged(in android.hardware.contexthub.Setting setting, in boolean enabled); + boolean queryNanoapps(in int contextHubId); + boolean registerCallback(in int contextHubId, in android.hardware.contexthub.IContextHubCallback cb); + boolean sendMessageToHub(in int contextHubId, in android.hardware.contexthub.ContextHubMessage message); +} 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 new file mode 100644 index 0000000000..f81f7cfdee --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.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 -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 +interface IContextHubCallback { + void handleNanoappInfo(in android.hardware.contexthub.NanoappInfo[] appInfo); + void handleContextHubMessage(in android.hardware.contexthub.ContextHubMessage msg, in String[] msgContentPerms); + void handleContextHubAsyncEvent(in android.hardware.contexthub.AsyncEventType evt); + void handleTransactionResult(in int transactionId, in boolean success); +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl new file mode 100644 index 0000000000..d53b28f943 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappBinary.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 NanoappBinary { + long nanoappId; + int nanoappVersion; + int flags; + byte targetChreApiMajorVersion; + byte targetChreApiMinorVersion; + byte[] customBinary; + const int FLAG_SIGNED = 1; + const int FLAG_ENCRYPTED = 2; + const int FLAG_TCM_CAPABLE = 4; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappInfo.aidl new file mode 100644 index 0000000000..ea7825aad2 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappInfo.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 -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 NanoappInfo { + long nanoappId; + int nanoappVersion; + boolean enabled; + String[] permissions; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl new file mode 100644 index 0000000000..41bc9ae881 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.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 -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 Setting { + LOCATION = 1, + WIFI_MAIN = 2, + WIFI_SCANNING = 3, + AIRPLANE_MODE = 4, + MICROPHONE = 5, +} diff --git a/contexthub/aidl/android/hardware/contexthub/AsyncEventType.aidl b/contexthub/aidl/android/hardware/contexthub/AsyncEventType.aidl new file mode 100644 index 0000000000..d884c9c501 --- /dev/null +++ b/contexthub/aidl/android/hardware/contexthub/AsyncEventType.aidl @@ -0,0 +1,24 @@ +/* + * 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. + */ + +package android.hardware.contexthub; + +@VintfStability +@Backing(type="int") +enum AsyncEventType { + /** An event where the Context Hub has restarted (e.g. due to a crash). */ + RESTARTED = 1, +} diff --git a/contexthub/aidl/android/hardware/contexthub/ContextHubInfo.aidl b/contexthub/aidl/android/hardware/contexthub/ContextHubInfo.aidl new file mode 100644 index 0000000000..c0fa702f0b --- /dev/null +++ b/contexthub/aidl/android/hardware/contexthub/ContextHubInfo.aidl @@ -0,0 +1,64 @@ +/* + * 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. + */ + +package android.hardware.contexthub; + +@VintfStability +parcelable ContextHubInfo { + /** Descriptive name of the Context Hub */ + String name; + + /** The vendor e.g. "Google" */ + String vendor; + + /** Toolchain that describes the binary architecture eg: "gcc ARM" */ + String toolchain; + + /** A unique ID for this Context Hub */ + int id; + + /** Peak MIPs this platform can deliver */ + float peakMips; + + /** The maximum length in bytes of the message that can be sent to the Context Hub. */ + int maxSupportedMessageLengthBytes; + + /** + * Machine-readable CHRE platform ID, returned to nanoapps in the CHRE API + * function call chreGetPlatformId(). This field pairs with + * chreApiMajorVersion, chreApiMinorVersion, and chrePatchVersion to fully + * specify the CHRE implementation version. See also the CHRE API header + * file chre/version.h. + */ + long chrePlatformId; + + /** + * The version of the CHRE implementation returned to nanoApps in the CHRE + * API function call chreGetVersion(). The major and minor version specify + * the implemented version of the CHRE API, while the patch version + * describes the implementation version within the scope of the platform + * ID. See also the CHRE API header file chre/version.h. + */ + byte chreApiMajorVersion; + byte chreApiMinorVersion; + char chrePatchVersion; + + /** + * A list of Android permissions this Context Hub support for nanoapps to enforce host endpoints + * are granted in order to communicate with them. + */ + String[] supportedPermissions; +} diff --git a/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl b/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl new file mode 100644 index 0000000000..867da2f9c0 --- /dev/null +++ b/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl @@ -0,0 +1,49 @@ +/* + * 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. + */ + +package android.hardware.contexthub; + +@VintfStability +parcelable ContextHubMessage { + /** The unique identifier of the nanoapp. */ + long nanoappId; + + /** + * The identifier of the host client that is sending/receiving this message. + * + * There are two reserved values of the host endpoint that has a specific meaning: + * 1) BROADCAST = 0xFFFF: see CHRE_HOST_ENDPOINT_BROADCAST in + * system/chre/chre_api/include/chre_api/chre/event.h for details. + * 2) UNSPECIFIED = 0xFFFE: see CHRE_HOST_ENDPOINT_UNSPECIFIED in + * system/chre/chre_api/include/chre_api/chre/event.h for details. + */ + char hostEndPoint; + + /** The type of this message */ + int messageType; + + /** The payload containing the message */ + byte[] messageBody; + + /** + * The list of Android permissions held by the sending nanoapp at the time + * the message was sent. + * + * The framework MUST drop messages to host apps that don't have a superset + * of the permissions that the sending nanoapp is using. + */ + String[] permissions; +} diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl new file mode 100644 index 0000000000..e820cbf764 --- /dev/null +++ b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl @@ -0,0 +1,154 @@ +/* + * 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. + */ + +package android.hardware.contexthub; + +import android.hardware.contexthub.ContextHubInfo; +import android.hardware.contexthub.ContextHubMessage; +import android.hardware.contexthub.IContextHubCallback; +import android.hardware.contexthub.NanoappBinary; +import android.hardware.contexthub.Setting; + +@VintfStability +interface IContextHub { + /** + * Enumerates all available Context Hubs. + * + * @return A list of ContextHubInfo describing all Context Hubs. + */ + List getContextHubs(); + + /** + * Loads a nanoapp, and invokes the nanoapp's initialization "start()" entrypoint. + * + * The return value of this method only indicates that the request has been accepted. + * If true is returned, the Context Hub must handle an asynchronous result using the + * the handleTransactionResult() callback. + * + * Depending on the implementation, nanoapp loaded via this API may or may + * not persist across reboots of the hub. If they do persist, the + * implementation must initially place nanoapp in the disabled state upon a + * reboot, and not start them until a call is made to enableNanoapp(). In + * this case, the app must also be unloaded upon a factory reset of the + * device. + * + * Loading a nanoapp must not take more than 30 seconds. + * + * @param contextHubId The identifier of the Context Hub + * @param appBinary The nanoapp binary with header + * @param transactionId The transaction ID associated with this request + * + * @return The return code + */ + boolean loadNanoapp(in int contextHubId, in NanoappBinary appBinary, in int transactionId); + + /** + * Invokes the nanoapp's deinitialization "end()" entrypoint, and unloads the nanoapp. + * + * The return value of this method only indicates that the request has been accepted. + * If true is returned, the Context Hub must handle an asynchronous result using the + * the handleTransactionResult() callback. + * + * Unloading a nanoapp must not take more than 5 seconds. + * + * @param contextHubId The identifier of the Context Hub + * @param appId The unique ID of the nanoapp + * @param transactionId The transaction ID associated with this request + * + * @return The return code + */ + boolean unloadNanoapp(in int contextHubId, in long appId, in int transactionId); + + /** + * Disables a nanoapp by invoking the nanoapp's "end()" entrypoint, but does not unload the + * nanoapp. + * + * The return value of this method only indicates that the request has been accepted. + * If true is returned, the Context Hub must handle an asynchronous result using the + * the handleTransactionResult() callback. + * + * Disabling a nanoapp must not take more than 5 seconds. + * + * @param contextHubId The identifier of the Context Hub + * @param appId The unique ID of the nanoapp + * @param transactionId The transaction ID associated with this request + * + * @return The return code + */ + boolean disableNanoapp(in int contextHubId, in long appId, in int transactionId); + + /** + * Enables a nanoapp by invoking the nanoapp's initialization "start()" entrypoint. + * + * The return value of this method only indicates that the request has been accepted. + * If true is returned, the Context Hub must handle an asynchronous result using the + * the handleTransactionResult() callback. + * + * Enabling a nanoapp must not take more than 5 seconds. + * + * @param contextHubId The identifier of the Context Hub + * @param appId appIdentifier returned by the HAL + * @param message message to be sent + * + * @return true on success + */ + boolean enableNanoapp(in int contextHubId, in long appId, in int transactionId); + + /** + * Notification sent by the framework to indicate that the user has changed a setting. + * + * @param setting User setting that has been modified + * @param enabled true if the setting has been enabled, false otherwise + */ + void onSettingChanged(in Setting setting, in boolean enabled); + + /** + * Queries for a list of loaded nanoapps on a Context Hub. + * + * If this method succeeds, the result of the query must be delivered through the + * handleNanoappInfo() callback. + * + * @param contextHubId The identifier of the Context Hub + * + * @return true on success + */ + boolean queryNanoapps(in int contextHubId); + + /** + * 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. + * + * A call to this function when a callback has already been registered must override the + * previous registration. + * + * @param contextHubId The identifier of the Context Hub + * @param callback an implementation of the IContextHubCallbacks + * + * @return true on success + * + */ + boolean registerCallback(in int contextHubId, in IContextHubCallback cb); + + /** + * Sends a message targeted to a nanoapp to the Context Hub. + * + * @param contextHubId The identifier of the Context Hub + * @param message The message to be sent + * + * @return true on success + */ + boolean sendMessageToHub(in int contextHubId, in ContextHubMessage message); +} diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl new file mode 100644 index 0000000000..e385d48c55 --- /dev/null +++ b/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl @@ -0,0 +1,77 @@ +/* + * 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. + */ + +package android.hardware.contexthub; + +import android.hardware.contexthub.AsyncEventType; +import android.hardware.contexthub.ContextHubMessage; +import android.hardware.contexthub.NanoappInfo; + +@VintfStability +interface IContextHubCallback { + /** + * This callback is passed by the Contexthub service to the HAL + * implementation to allow the HAL to send information about the + * currently loaded and active nanoapps on the hub. + * + * @param appInfo vector of HubAppinfo structure for each nanoApp + * on the hub that can be enabled, disabled and + * unloaded by the service. Any nanoApps that cannot + * be controlled by the service must not be reported. + * All nanoApps that can be controlled by the service + * must be reported. + */ + void handleNanoappInfo(in NanoappInfo[] appInfo); + + /** + * This callback is passed by the Contexthub service to the HAL + * implementation to allow the HAL to send asynchronous messages back + * to the service and registered clients of the ContextHub service. + * + * @param msg message that should be delivered to host app + * clients + * @param msgContentPerms list of Android permissions that cover the + * contents of the message being sent from the app. + * This is different from the permissions stored + * inside of ContextHubMsg in that these must be a + * subset of those permissions and are meant to + * assist in properly attributing the message + * contents when delivering to a ContextHub service + * client. + */ + void handleContextHubMessage(in ContextHubMessage msg, in String[] msgContentPerms); + + /** + * This callback is passed by the Contexthub service to the HAL + * implementation to allow the HAL to send an asynchronous event + * to the ContextHub service. + * + * @param evt event being sent from the contexthub + * + */ + void handleContextHubAsyncEvent(in AsyncEventType evt); + + /** + * This callback is passed by the Contexthub service to the HAL + * implementation to allow the HAL to send the response for a + * transaction. + * + * @param transactionId The ID of the transaction associated with this callback + * @param success true if the transaction succeeded, false otherwise + * + */ + void handleTransactionResult(in int transactionId, in boolean success); +} diff --git a/contexthub/aidl/android/hardware/contexthub/NanoappBinary.aidl b/contexthub/aidl/android/hardware/contexthub/NanoappBinary.aidl new file mode 100644 index 0000000000..c677ca63e8 --- /dev/null +++ b/contexthub/aidl/android/hardware/contexthub/NanoappBinary.aidl @@ -0,0 +1,55 @@ +/* + * 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. + */ + +package android.hardware.contexthub; + +@VintfStability +parcelable NanoappBinary { + /** Indicates that the nanoapp is securely signed (e.g. for production) */ + const int FLAG_SIGNED = 1 << 0; + const int FLAG_ENCRYPTED = 1 << 1; + /** Indicates that the nanoapp can run on a Context Hub's TCM memory region */ + const int FLAG_TCM_CAPABLE = 1 << 2; + + /** + * The unique identifier of the nanoapp for the entire system. See chreNanoappInfo in + * system/chre/chre_api/include/chre_api/chre/event.h for the convention for choosing + * this ID. + */ + long nanoappId; + + /** The version of the nanoapp. */ + int nanoappVersion; + + /** The nanoapp flags, comprised of the bitmasks defined in FLAG_* constants above. */ + int flags; + + /** + * The version of the CHRE API that this nanoapp was compiled against. See + * the CHRE API header file chre/version.h for more information. The hub + * implementation must use this to confirm compatibility before loading + * this nanoapp. + */ + byte targetChreApiMajorVersion; + byte targetChreApiMinorVersion; + + /** + * Implementation-specific binary nanoapp data. This does not include the + * common nanoapp header that contains the app ID, etc., as this data is + * explicitly passed through the other fields in this struct. + */ + byte[] customBinary; +} diff --git a/contexthub/aidl/android/hardware/contexthub/NanoappInfo.aidl b/contexthub/aidl/android/hardware/contexthub/NanoappInfo.aidl new file mode 100644 index 0000000000..9991dc8fff --- /dev/null +++ b/contexthub/aidl/android/hardware/contexthub/NanoappInfo.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. + */ + +package android.hardware.contexthub; + +@VintfStability +parcelable NanoappInfo { + /** The unique identifier of the nanoapp. */ + long nanoappId; + + /** The version of the nanoapp */ + int nanoappVersion; + + /** True if this nanoapp is in a running state, false otherwise */ + boolean enabled; + + /** + * The list of Android permissions used by this nanoapp. This list MUST + * correspond to the permissions required for an equivalent Android app to + * sample similar signals through the Android framework. + * + * For example, if a nanoapp used location-based signals, the permissions + * list MUST contains android.permission.ACCESS_FINE_LOCATION and + * android.permission.ACCESS_BACKGROUND_LOCATION. If it were to also use + * audio data, it would require adding android.permission.RECORD_AUDIO to + * this list. + */ + String[] permissions; +} diff --git a/contexthub/aidl/android/hardware/contexthub/Setting.aidl b/contexthub/aidl/android/hardware/contexthub/Setting.aidl new file mode 100644 index 0000000000..f2e55dbeb7 --- /dev/null +++ b/contexthub/aidl/android/hardware/contexthub/Setting.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. + */ + +package android.hardware.contexthub; + +/** + * Used to indicate the type of user setting that has changed. + */ +@VintfStability +@Backing(type="byte") +enum Setting { + LOCATION = 1, + /** + * The main WiFi toggle in the Android settings for WiFi connectivity. + */ + WIFI_MAIN, + /** + * The "Wi-Fi scanning" setting for location scans. + */ + WIFI_SCANNING, + AIRPLANE_MODE, + /** + * Indicates if the microphone access is available for CHRE. Microphone + * access is disabled if the user has turned off the microphone as a + * privacy setting, in which case audio data cannot be used and propagated + * by CHRE. + */ + MICROPHONE, +} diff --git a/contexthub/aidl/default/Android.bp b/contexthub/aidl/default/Android.bp new file mode 100644 index 0000000000..269057a2a2 --- /dev/null +++ b/contexthub/aidl/default/Android.bp @@ -0,0 +1,59 @@ +/* + * 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. + */ + +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_library_static { + name: "libcontexthubexampleimpl", + vendor: true, + shared_libs: [ + "libbase", + "libbinder_ndk", + "android.hardware.contexthub-V1-ndk", + ], + export_include_dirs: ["include"], + srcs: [ + "ContextHub.cpp", + ], + visibility: [ + ":__subpackages__", + "//hardware/interfaces/tests/extension/contexthub:__subpackages__", + ], +} + +cc_binary { + name: "android.hardware.contexthub-service.example", + relative_install_path: "hw", + init_rc: ["contexthub-default.rc"], + vintf_fragments: ["contexthub-default.xml"], + vendor: true, + shared_libs: [ + "libbase", + "libbinder_ndk", + "android.hardware.contexthub-V1-ndk", + ], + static_libs: [ + "libcontexthubexampleimpl", + ], + srcs: ["main.cpp"], +} diff --git a/contexthub/aidl/default/ContextHub.cpp b/contexthub/aidl/default/ContextHub.cpp new file mode 100644 index 0000000000..1b5660832b --- /dev/null +++ b/contexthub/aidl/default/ContextHub.cpp @@ -0,0 +1,83 @@ +/* + * 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 "contexthub-impl/ContextHub.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace contexthub { + +// TODO(b/194285834): Implement AIDL HAL + +::ndk::ScopedAStatus ContextHub::getContextHubs( + std::vector* /* out_contextHubInfos */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus ContextHub::loadNanoapp(int32_t /* in_contextHubId */, + const NanoappBinary& /* in_appBinary */, + int32_t /* in_transactionId */, + bool* /* _aidl_return */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus ContextHub::unloadNanoapp(int32_t /* in_contextHubId */, + int64_t /* in_appId */, + int32_t /* in_transactionId */, + bool* /* _aidl_return */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus ContextHub::disableNanoapp(int32_t /* in_contextHubId */, + int64_t /* in_appId */, + int32_t /* in_transactionId */, + bool* /* _aidl_return */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus ContextHub::enableNanoapp(int32_t /* in_contextHubId */, + int64_t /* in_appId */, + int32_t /* in_transactionId */, + bool* /* _aidl_return */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus ContextHub::onSettingChanged(Setting /* in_setting */, bool /*in_enabled */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus ContextHub::queryNanoapps(int32_t /* in_contextHubId */, + bool* /* _aidl_return */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus ContextHub::registerCallback( + int32_t /* in_contextHubId */, const std::shared_ptr& /* in_cb */, + bool* /* _aidl_return */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus ContextHub::sendMessageToHub(int32_t /* in_contextHubId */, + const ContextHubMessage& /* in_message */, + bool* /* _aidl_return */) { + return ndk::ScopedAStatus::ok(); +} + +} // namespace contexthub +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/contexthub/aidl/default/contexthub-default.rc b/contexthub/aidl/default/contexthub-default.rc new file mode 100644 index 0000000000..a6a6d2a19f --- /dev/null +++ b/contexthub/aidl/default/contexthub-default.rc @@ -0,0 +1,4 @@ +service vendor.contexthub-default /vendor/bin/hw/android.hardware.contexthub-service.example + class hal + user context_hub + group context_hub diff --git a/contexthub/aidl/default/contexthub-default.xml b/contexthub/aidl/default/contexthub-default.xml new file mode 100644 index 0000000000..e383c50ca0 --- /dev/null +++ b/contexthub/aidl/default/contexthub-default.xml @@ -0,0 +1,7 @@ + + + android.hardware.contexthub + 1 + IContextHub/default + + diff --git a/contexthub/aidl/default/include/contexthub-impl/ContextHub.h b/contexthub/aidl/default/include/contexthub-impl/ContextHub.h new file mode 100644 index 0000000000..980cee5cd3 --- /dev/null +++ b/contexthub/aidl/default/include/contexthub-impl/ContextHub.h @@ -0,0 +1,49 @@ +/* + * 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 + +namespace aidl { +namespace android { +namespace hardware { +namespace contexthub { + +class ContextHub : public BnContextHub { + ::ndk::ScopedAStatus getContextHubs(std::vector* out_contextHubInfos) override; + ::ndk::ScopedAStatus loadNanoapp(int32_t in_contextHubId, const NanoappBinary& in_appBinary, + int32_t in_transactionId, bool* _aidl_return) override; + ::ndk::ScopedAStatus unloadNanoapp(int32_t in_contextHubId, int64_t in_appId, + int32_t in_transactionId, bool* _aidl_return) override; + ::ndk::ScopedAStatus disableNanoapp(int32_t in_contextHubId, int64_t in_appId, + int32_t in_transactionId, bool* _aidl_return) override; + ::ndk::ScopedAStatus enableNanoapp(int32_t in_contextHubId, int64_t in_appId, + int32_t in_transactionId, bool* _aidl_return) override; + ::ndk::ScopedAStatus onSettingChanged(Setting in_setting, bool in_enabled) override; + ::ndk::ScopedAStatus queryNanoapps(int32_t in_contextHubId, bool* _aidl_return) override; + ::ndk::ScopedAStatus registerCallback(int32_t in_contextHubId, + const std::shared_ptr& in_cb, + bool* _aidl_return) override; + ::ndk::ScopedAStatus sendMessageToHub(int32_t in_contextHubId, + const ContextHubMessage& in_message, + bool* _aidl_return) override; +}; + +} // namespace contexthub +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/contexthub/aidl/default/main.cpp b/contexthub/aidl/default/main.cpp new file mode 100644 index 0000000000..dc9035f084 --- /dev/null +++ b/contexthub/aidl/default/main.cpp @@ -0,0 +1,36 @@ +/* + * 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 "contexthub-impl/ContextHub.h" + +#include +#include +#include + +using aidl::android::hardware::contexthub::ContextHub; + +int main() { + ABinderProcess_setThreadPoolMaxThreadCount(0); + + // Make a default contexthub service + auto vib = ndk::SharedRefBase::make(); + const std::string vibName = std::string() + ContextHub::descriptor + "/default"; + binder_status_t status = AServiceManager_addService(vib->asBinder().get(), vibName.c_str()); + CHECK(status == STATUS_OK); + + ABinderProcess_joinThreadPool(); + return EXIT_FAILURE; // should not reach +} -- GitLab From e9f41f1fff96b666103a9d4293898bae7563b880 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Fri, 20 Aug 2021 17:09:13 -0700 Subject: [PATCH 119/825] Move common audio AIDL types to audio.media.audio.common Since tests depend statically on libaudiofoundation, they also need to depend on the generated interfaces code, which contains vtables for interface classes. Update 'sthal_cli_3' test app. Bug: 188932434 Test: m HalAudioV6_0GeneratorTest Test: m sthal_cli_3 Change-Id: Ifb8f81d02764f7710ce207603aa6fe2d20123e89 --- .../all-versions/vts/functional/Android.bp | 5 ++++ .../hardware/soundtrigger3/cli/SthalCli.java | 24 ++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/audio/core/all-versions/vts/functional/Android.bp b/audio/core/all-versions/vts/functional/Android.bp index 9f4a2952c6..7c25c2307f 100644 --- a/audio/core/all-versions/vts/functional/Android.bp +++ b/audio/core/all-versions/vts/functional/Android.bp @@ -58,6 +58,7 @@ cc_test { "libmedia_helper", "android.hardware.audio@2.0", "android.hardware.audio.common@2.0", + "android.media.audio.common.types-V1-cpp", ], cflags: [ "-DMAJOR_VERSION=2", @@ -84,6 +85,7 @@ cc_test { "libmedia_helper", "android.hardware.audio@4.0", "android.hardware.audio.common@4.0", + "android.media.audio.common.types-V1-cpp", ], cflags: [ "-DMAJOR_VERSION=4", @@ -110,6 +112,7 @@ cc_test { "libmedia_helper", "android.hardware.audio@5.0", "android.hardware.audio.common@5.0", + "android.media.audio.common.types-V1-cpp", ], cflags: [ "-DMAJOR_VERSION=5", @@ -137,6 +140,7 @@ cc_test { "libmedia_helper", "android.hardware.audio@6.0", "android.hardware.audio.common@6.0", + "android.media.audio.common.types-V1-cpp", ], cflags: [ "-DMAJOR_VERSION=6", @@ -200,6 +204,7 @@ cc_test { static_libs: [ "android.hardware.audio@6.0", "android.hardware.audio.common@6.0", + "android.media.audio.common.types-V1-cpp", "libaudiofoundation", "libaudiopolicycomponents", "libmedia_helper", 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 d3e1aa7eaa..b4778784ec 100644 --- a/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java +++ b/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java @@ -19,7 +19,11 @@ import android.annotation.NonNull; import android.hardware.soundtrigger3.ISoundTriggerHw; import android.hardware.soundtrigger3.ISoundTriggerHwCallback; import android.hardware.soundtrigger3.ISoundTriggerHwGlobalCallback; +import android.media.audio.common.AudioChannelLayout; import android.media.audio.common.AudioConfig; +import android.media.audio.common.AudioFormatDescription; +import android.media.audio.common.AudioFormatType; +import android.media.audio.common.PcmType; import android.media.soundtrigger.ConfidenceLevel; import android.media.soundtrigger.ModelParameterRange; import android.media.soundtrigger.PhraseRecognitionEvent; @@ -36,7 +40,6 @@ import android.os.ParcelFileDescriptor; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemProperties; - import java.util.Scanner; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -196,9 +199,7 @@ public class SthalCli { event.type = SoundModelType.GENERIC; event.status = status; event.captureAvailable = true; - event.audioConfig.channelMask = 16; - event.audioConfig.format = 1; - event.audioConfig.sampleRateHz = 16000; + event.audioConfig = createConfig(); try { model.callback.recognitionCallback(modelHandle, event); } catch (RemoteException e) { @@ -216,10 +217,7 @@ public class SthalCli { event.common.type = SoundModelType.KEYPHRASE; event.common.status = status; event.common.captureAvailable = true; - event.common.audioConfig = new AudioConfig(); - event.common.audioConfig.channelMask = 16; - event.common.audioConfig.format = 1; - event.common.audioConfig.sampleRateHz = 16000; + event.common.audioConfig = createConfig(); if (model.phraseModel.phrases.length > 0) { PhraseRecognitionExtra extra = new PhraseRecognitionExtra(); extra.id = model.phraseModel.phrases[0].id; @@ -250,6 +248,16 @@ public class SthalCli { } } + private AudioConfig createConfig() { + AudioConfig config = new AudioConfig(); + config.channelMask = AudioChannelLayout.layoutMask(AudioChannelLayout.LAYOUT_MONO); + config.format = new AudioFormatDescription(); + config.format.type = AudioFormatType.PCM; + config.format.pcm = PcmType.INT_16_BIT; + config.sampleRateHz = 16000; + return config; + } + @Override public void registerGlobalCallback(ISoundTriggerHwGlobalCallback callback) { System.out.println("registerGlobalCallback()"); -- GitLab From 1aac7fa45c69ef13f93f3f79f28c5c6424b22e99 Mon Sep 17 00:00:00 2001 From: Yuchen He Date: Mon, 23 Aug 2021 16:40:24 +0000 Subject: [PATCH 120/825] Report default location when location is not available in /dev/gnss0 Test: atest VtsHalGnssTargetTest Bug: 197579774 Change-Id: I08e761d6023df2954d8a265b4af3e5b5d0aec09c --- gnss/common/utils/default/include/v2_1/GnssTemplate.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/gnss/common/utils/default/include/v2_1/GnssTemplate.h b/gnss/common/utils/default/include/v2_1/GnssTemplate.h index 4e07af9853..b834a1f0c2 100644 --- a/gnss/common/utils/default/include/v2_1/GnssTemplate.h +++ b/gnss/common/utils/default/include/v2_1/GnssTemplate.h @@ -191,14 +191,8 @@ Return GnssTemplate::start() { this->reportSvStatus(svStatus); auto currentLocation = getLocationFromHW(); notePowerConsumption(); - if (mGnssFd != -1) { - // Only report location if the return from hardware is valid - // note that we can not merge these two "if" together, if didn't - // get location from hardware, we shouldn't report location, not - // report the "default" one. - if (currentLocation != nullptr) { - this->reportLocation(*currentLocation); - } + if (currentLocation != nullptr) { + this->reportLocation(*currentLocation); } else { if (sGnssCallback_2_1 != nullptr || sGnssCallback_2_0 != nullptr) { const auto location = Utils::getMockLocationV2_0(); -- GitLab From a040b1f5a7ab3ed1c8fbb3c7ff3bdffda0359a5b Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 24 Aug 2021 09:31:16 -0700 Subject: [PATCH 121/825] uwb(hal): Refactor HAL to support multiple UWB chips Changes: 1. Move existing IUwb interface to IUwbChip. 2. Rename |write| to |sendUciMessage| Bug: 197638976 Test: Compiles Change-Id: Ie152bf54029fdf4584b45ad81a5fdb8ae09b41d4 --- .../current/android/hardware/uwb/IUwb.aidl | 6 +- .../android/hardware/uwb/IUwbChip.aidl | 45 ++++++++++++ uwb/aidl/android/hardware/uwb/IUwb.aidl | 37 ++-------- uwb/aidl/android/hardware/uwb/IUwbChip.aidl | 72 +++++++++++++++++++ .../hardware/uwb/IUwbClientCallback.aidl | 3 +- 5 files changed, 127 insertions(+), 36 deletions(-) create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl create mode 100755 uwb/aidl/android/hardware/uwb/IUwbChip.aidl diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwb.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwb.aidl index 229ef7c7db..9553ffc26d 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwb.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwb.aidl @@ -36,8 +36,6 @@ package android.hardware.uwb; @VintfStability interface IUwb { - void close(); - void coreInit(); - void open(in android.hardware.uwb.IUwbClientCallback clientCallback); - int write(in byte[] data); + List getChips(); + android.hardware.uwb.IUwbChip getChip(String name); } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl new file mode 100644 index 0000000000..7074753c91 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.uwb; +@VintfStability +interface IUwbChip { + String getName(); + void open(in android.hardware.uwb.IUwbClientCallback clientCallback); + void close(); + void coreInit(); + int getSupportedVendorUciVersion(); + int sendUciMessage(in byte[] data); +} diff --git a/uwb/aidl/android/hardware/uwb/IUwb.aidl b/uwb/aidl/android/hardware/uwb/IUwb.aidl index 5d888bc63b..fda726c24b 100755 --- a/uwb/aidl/android/hardware/uwb/IUwb.aidl +++ b/uwb/aidl/android/hardware/uwb/IUwb.aidl @@ -18,8 +18,7 @@ package android.hardware.uwb; -import android.hardware.uwb.IUwbClientCallback; -import android.hardware.uwb.UwbStatus; +import android.hardware.uwb.IUwbChip; /** * HAL Interface for UWB (Ultrawideband) subsystem. @@ -28,38 +27,14 @@ import android.hardware.uwb.UwbStatus; @VintfStability interface IUwb { /** - * Close the UWB Subsystem. Should free all resources. - * - */ - void close(); - - /** - * Perform UWB Subsystem initialization by applying all vendor configuration. - * + * Returns list of IUwbChip instance names representing each UWB chip on the device. */ - void coreInit(); + List getChips(); /** - * Performs the UWB HAL initialization and power on UWB Subsystem. If open completes - * successfully, then UWB Subsystem is ready to accept UCI message through write() API - * - * @param clientCallback Client callback instance. - */ - void open(in IUwbClientCallback clientCallback); - - /** - * Write the UCI message to the UWB Subsystem. - * The UCI message format is as per UCI protocol and it is - * defined in "FiRa Consortium - UCI Generic Specification_v1.0" specification at FiRa - * consortium. - * WIP doc link: https://groups.firaconsortium.org/wg/Technical/document/folder/127. - * TODO(b/196004116): Link to the published specification. - * - * This method may queue writes and return immediately, or it may block until data is written. - * Implementation must guarantee that writes are executed in order. + * Returns IUwbChip instance corresponding to the name. * - * @param data UCI packet to write. - * @return number of bytes written to the UWB Subsystem + * @param Unique identifier of the chip. */ - int write(in byte[] data); + IUwbChip getChip(String name); } diff --git a/uwb/aidl/android/hardware/uwb/IUwbChip.aidl b/uwb/aidl/android/hardware/uwb/IUwbChip.aidl new file mode 100755 index 0000000000..5f1a59e92a --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/IUwbChip.aidl @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.uwb; + +import android.hardware.uwb.IUwbClientCallback; +import android.hardware.uwb.UwbStatus; + +/** + * Controls a UWB chip on the device. On some devices, there could be multiple UWB chips. + */ +@VintfStability +interface IUwbChip { + /** + * Get unique idenitifer for the chip. + */ + String getName(); + + /** + * Performs the UWB HAL initialization and power on UWB Subsystem. If open completes + * successfully, then UWB Subsystem is ready to accept UCI message through write() API + * + * @param clientCallback Client callback instance. + */ + void open(in IUwbClientCallback clientCallback); + + /** + * Close the UWB Subsystem. Should free all resources. + */ + void close(); + + /** + * Perform UWB Subsystem initialization by applying all vendor configuration. + */ + void coreInit(); + + /** + * Supported version of vendor UCI specification. + */ + int getSupportedVendorUciVersion(); + + /** + * Write the UCI message to the UWB Subsystem. + * The UCI message format is as per UCI protocol and it is + * defined in "FiRa Consortium - UCI Generic Specification_v1.0" specification at FiRa + * consortium. + * WIP doc link: https://groups.firaconsortium.org/wg/Technical/document/folder/127. + * TODO(b/196004116): Link to the published specification. + * + * This method may queue writes and return immediately, or it may block until data is written. + * Implementation must guarantee that writes are executed in order. + * + * @param data UCI packet to write. + * @return number of bytes written to the UWB Subsystem + */ + int sendUciMessage(in byte[] data); +} diff --git a/uwb/aidl/android/hardware/uwb/IUwbClientCallback.aidl b/uwb/aidl/android/hardware/uwb/IUwbClientCallback.aidl index 32c36a86c0..75853cd97c 100755 --- a/uwb/aidl/android/hardware/uwb/IUwbClientCallback.aidl +++ b/uwb/aidl/android/hardware/uwb/IUwbClientCallback.aidl @@ -25,7 +25,8 @@ import android.hardware.uwb.UwbStatus; oneway interface IUwbClientCallback { /** * The callback passed in from the UWB stack that the HAL - * can use to pass incomming data to the stack. + * can use to pass incoming data to the stack. These include UCI + * responses and notifications from the UWB subsystem. * * WIP doc link: https://groups.firaconsortium.org/wg/Technical/document/folder/127. * TODO(b/196004116): Link to the published specification. -- GitLab From b82cecec272715ccf00863cc6ea3970ba1635022 Mon Sep 17 00:00:00 2001 From: ziyiw Date: Tue, 24 Aug 2021 17:57:51 +0000 Subject: [PATCH 122/825] Added rust stubs for HAL. Test: mmm hardware/interfaces/uwb Bug: 197341298 Change-Id: I6c08d7e5536c537709f07b618326f9c336c02b55 --- uwb/aidl/Android.bp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/uwb/aidl/Android.bp b/uwb/aidl/Android.bp index 6cf51886be..989815e675 100755 --- a/uwb/aidl/Android.bp +++ b/uwb/aidl/Android.bp @@ -23,9 +23,16 @@ aidl_interface { enabled: true, }, apex_available: [ - "com.android.uwb", + "com.android.uwb", ], min_sdk_version: "current", }, + rust: { + enabled: true, + apex_available: [ + "//apex_available:platform", + "com.android.uwb", + ], + }, }, } -- GitLab From b5db1dd1461d13c6f6e1987c3d249cde9f0b17f2 Mon Sep 17 00:00:00 2001 From: Ytai Ben-Tsvi Date: Tue, 24 Aug 2021 14:43:15 -0700 Subject: [PATCH 123/825] Create a soundtrigger v2.3 CLI mock This is ported from the v2.4 CLI in preparation for v2.4's deprecation. Bug: 181996624 Test: Manual invocation and verification. Change-Id: I77c6a12b77b11d74359bcc0792a5a4c70032c7ce --- soundtrigger/2.3/cli/Android.bp | 17 + soundtrigger/2.3/cli/OWNERS | 1 + .../soundtrigger/V2_3/cli/SthalCli.java | 344 ++++++++++++++++++ soundtrigger/2.3/cli/sthal_cli_2.3 | 7 + 4 files changed, 369 insertions(+) create mode 100644 soundtrigger/2.3/cli/Android.bp create mode 100644 soundtrigger/2.3/cli/OWNERS create mode 100644 soundtrigger/2.3/cli/java/android/hardware/soundtrigger/V2_3/cli/SthalCli.java create mode 100644 soundtrigger/2.3/cli/sthal_cli_2.3 diff --git a/soundtrigger/2.3/cli/Android.bp b/soundtrigger/2.3/cli/Android.bp new file mode 100644 index 0000000000..27d7b301eb --- /dev/null +++ b/soundtrigger/2.3/cli/Android.bp @@ -0,0 +1,17 @@ +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"], +} + +java_binary { + name: "sthal_cli_2.3", + wrapper: "sthal_cli_2.3", + srcs: ["java/**/*.java"], + static_libs: [ + "android.hardware.soundtrigger-V2.3-java", + ], +} diff --git a/soundtrigger/2.3/cli/OWNERS b/soundtrigger/2.3/cli/OWNERS new file mode 100644 index 0000000000..4fd27f3451 --- /dev/null +++ b/soundtrigger/2.3/cli/OWNERS @@ -0,0 +1 @@ +include platform/frameworks/base:/services/core/java/com/android/server/soundtrigger_middleware/OWNERS diff --git a/soundtrigger/2.3/cli/java/android/hardware/soundtrigger/V2_3/cli/SthalCli.java b/soundtrigger/2.3/cli/java/android/hardware/soundtrigger/V2_3/cli/SthalCli.java new file mode 100644 index 0000000000..68b04f4d5f --- /dev/null +++ b/soundtrigger/2.3/cli/java/android/hardware/soundtrigger/V2_3/cli/SthalCli.java @@ -0,0 +1,344 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.soundtrigger.V2_3.cli; + +import android.hardware.soundtrigger.V2_0.PhraseRecognitionExtra; +import android.hardware.soundtrigger.V2_0.RecognitionMode; +import android.hardware.soundtrigger.V2_0.SoundModelType; +import android.hardware.soundtrigger.V2_3.OptionalModelParameterRange; +import android.hardware.soundtrigger.V2_3.ISoundTriggerHw; +import android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback; +import android.os.HidlMemoryUtil; +import android.os.HwBinder; +import android.os.RemoteException; +import android.os.SystemProperties; + +import java.util.Scanner; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +/** + * This is a quick-and-dirty sound trigger HAL console mock. + * + * It would only work on userdebug builds. + * + * When this app is started, it will initially: + * - Register a ISoundTriggerHw HAL with an instance name "mock". + * - Set a sysprop that tells SoundTriggerMiddlewareService to try to connect to the mock instance + * rather than the default one. + * - Reboot the real (default) HAL. + * + * In response to that, SoundTriggerMiddlewareService is going to connect to the mock HAL and resume + * normal operation. + * + * Our mock HAL will print to stdout every call it receives as well as expose a basic set of + * operations for sending event callbacks to the client. This allows us to simulate the frameworks + * behavior in response to different HAL behaviors. + */ +public class SthalCli { + private static SoundTriggerImpl mService; + private static final Scanner mScanner = new Scanner(System.in); + + public static void main(String[] args) { + try { + System.out.println("Registering mock STHAL"); + HwBinder.setTrebleTestingOverride(true); + mService = new SoundTriggerImpl(); + mService.registerAsService("mock"); + + System.out.println("Rebooting STHAL"); + SystemProperties.set("debug.soundtrigger_middleware.use_mock_hal", "2"); + SystemProperties.set("sys.audio.restart.hal", "1"); + + while (processCommand()) ; + } catch (Exception e) { + e.printStackTrace(); + } finally { + cleanup(); + } + } + + private static void cleanup() { + System.out.println("Cleaning up."); + SystemProperties.set("debug.soundtrigger_middleware.use_mock_hal", null); + HwBinder.setTrebleTestingOverride(false); + } + + private static boolean processCommand() { + String line = mScanner.nextLine(); + String[] tokens = line.split("\\s+"); + if (tokens.length < 1) { + return false; + } + switch (tokens[0]) { + case "q": + return false; + + case "r": + mService.sendRecognitionEvent(Integer.parseInt(tokens[1]), + Integer.parseInt(tokens[2])); + return true; + + case "p": + mService.sendPhraseRecognitionEvent(Integer.parseInt(tokens[1]), + Integer.parseInt(tokens[2])); + return true; + + case "d": + mService.dumpModels(); + return true; + + case "h": + System.out.print("Available commands:\n" + "h - help\n" + "q - quit\n" + + "r - send recognitionEvent\n" + + "p - send phraseRecognitionEvent\n" + + "d - dump models\n"); + + default: + return true; + } + } + + private static class SoundTriggerImpl extends ISoundTriggerHw.Stub { + static class Model { + final ISoundTriggerHwCallback callback; + final SoundModel model; + final PhraseSoundModel phraseModel; + public android.hardware.soundtrigger.V2_3.RecognitionConfig config = null; + + Model(ISoundTriggerHwCallback callback, SoundModel model) { + this.callback = callback; + this.model = model; + this.phraseModel = null; + } + + Model(ISoundTriggerHwCallback callback, PhraseSoundModel model) { + this.callback = callback; + this.model = null; + this.phraseModel = model; + } + } + + private final ConcurrentMap mLoadedModels = new ConcurrentHashMap<>(); + private int mHandleCounter = 1; + + public void dumpModels() { + mLoadedModels.forEach((handle, model) -> { + System.out.println("+++ Model " + handle); + System.out.println(" config = " + model.config); + android.hardware.soundtrigger.V2_3.RecognitionConfig recognitionConfig = + model.config; + if (recognitionConfig != null) { + System.out.println(" ACTIVE recognitionConfig = " + recognitionConfig); + } else { + System.out.println(" INACTIVE"); + } + }); + } + + public void sendRecognitionEvent(int modelHandle, int status) { + Model model = mLoadedModels.get(modelHandle); + if (model != null && model.config != null) { + android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback.RecognitionEvent event = + new android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback.RecognitionEvent(); + event.header.model = modelHandle; + event.header.type = SoundModelType.GENERIC; + event.header.status = status; + event.header.captureSession = model.config.base.header.captureHandle; + event.header.captureAvailable = true; + event.header.audioConfig.channelMask = 16; + event.header.audioConfig.format = 1; + event.header.audioConfig.sampleRateHz = 16000; + event.data = HidlMemoryUtil.byteArrayToHidlMemory(new byte[0]); + try { + model.callback.recognitionCallback_2_1(event, 0); + } catch (RemoteException e) { + e.printStackTrace(); + } + model.config = null; + } + } + + public void sendPhraseRecognitionEvent(int modelHandle, int status) { + Model model = mLoadedModels.get(modelHandle); + if (model != null && model.config != null) { + android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback.PhraseRecognitionEvent + event = + new android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback.PhraseRecognitionEvent(); + event.common.header.model = modelHandle; + event.common.header.type = SoundModelType.KEYPHRASE; + event.common.header.status = status; + event.common.header.captureSession = model.config.base.header.captureHandle; + event.common.header.captureAvailable = true; + event.common.header.audioConfig.channelMask = 16; + event.common.header.audioConfig.format = 1; + event.common.header.audioConfig.sampleRateHz = 16000; + event.common.data = HidlMemoryUtil.byteArrayToHidlMemory(new byte[0]); + if (!model.phraseModel.phrases.isEmpty()) { + PhraseRecognitionExtra extra = new PhraseRecognitionExtra(); + extra.id = model.phraseModel.phrases.get(0).id; + extra.confidenceLevel = 100; + extra.recognitionModes = model.phraseModel.phrases.get(0).recognitionModes; + event.phraseExtras.add(extra); + } + try { + model.callback.phraseRecognitionCallback_2_1(event, 0); + } catch (RemoteException e) { + e.printStackTrace(); + } + model.config = null; + } + } + + @Override + public void loadSoundModel_2_1(SoundModel soundModel, + android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback callback, int cookie, + loadSoundModel_2_1Callback _hidl_cb) { + int handle = mHandleCounter++; + System.out.printf("loadSoundModel_2_1(soundModel=%s) -> %d%n", soundModel, handle); + mLoadedModels.put(handle, new Model(callback, soundModel)); + _hidl_cb.onValues(0, handle); + } + + @Override + public void loadPhraseSoundModel_2_1(PhraseSoundModel soundModel, + android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback callback, int cookie, + loadPhraseSoundModel_2_1Callback _hidl_cb) { + int handle = mHandleCounter++; + System.out.printf("loadPhraseSoundModel_2_1(soundModel=%s) -> %d%n", soundModel, + handle); + mLoadedModels.put(handle, new Model(callback, soundModel)); + _hidl_cb.onValues(0, handle); + } + + @Override + public int startRecognition_2_3(int modelHandle, + android.hardware.soundtrigger.V2_3.RecognitionConfig config) { + System.out.printf("startRecognition_2_3(modelHandle=%d)%n", modelHandle); + Model model = mLoadedModels.get(modelHandle); + if (model != null) { + model.config = config; + } + return 0; + } + + @Override + public void getProperties_2_3(getProperties_2_3Callback _hidl_cb) { + System.out.println("getProperties_2_3()"); + android.hardware.soundtrigger.V2_3.Properties properties = + new android.hardware.soundtrigger.V2_3.Properties(); + properties.base.implementor = "Android"; + properties.base.description = "Mock STHAL"; + properties.base.maxSoundModels = 2; + properties.base.maxKeyPhrases = 1; + properties.base.recognitionModes = + RecognitionMode.VOICE_TRIGGER | RecognitionMode.GENERIC_TRIGGER; + _hidl_cb.onValues(0, properties); + } + + @Override + public void queryParameter(int modelHandle, int modelParam, + queryParameterCallback _hidl_cb) { + _hidl_cb.onValues(0, new OptionalModelParameterRange()); + } + + @Override + public int getModelState(int modelHandle) { + System.out.printf("getModelState(modelHandle=%d)%n", modelHandle); + return 0; + } + + @Override + public int unloadSoundModel(int modelHandle) { + System.out.printf("unloadSoundModel(modelHandle=%d)%n", modelHandle); + return 0; + } + + @Override + public int stopRecognition(int modelHandle) { + System.out.printf("stopRecognition(modelHandle=%d)%n", modelHandle); + Model model = mLoadedModels.get(modelHandle); + if (model != null) { + model.config = null; + } + return 0; + } + + @Override + public void debug(android.os.NativeHandle fd, java.util.ArrayList options) { + if (!options.isEmpty()) { + switch (options.get(0)) { + case "reboot": + System.out.println("Received a reboot request. Exiting."); + cleanup(); + System.exit(1); + } + } + } + + //////////////////////////////////////////////////////////////////////////////////////////// + // Everything below is not implemented and not expected to be called. + + @Override + public int setParameter(int modelHandle, int modelParam, int value) { + throw new UnsupportedOperationException(); + } + + @Override + public void getParameter(int modelHandle, int modelParam, getParameterCallback _hidl_cb) { + throw new UnsupportedOperationException(); + } + + @Override + public int startRecognition_2_1(int modelHandle, RecognitionConfig config, + android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback callback, int cookie) { + throw new UnsupportedOperationException(); + } + + @Override + public void getProperties(getPropertiesCallback _hidl_cb) { + throw new UnsupportedOperationException(); + } + + @Override + public void loadSoundModel( + android.hardware.soundtrigger.V2_0.ISoundTriggerHw.SoundModel soundModel, + android.hardware.soundtrigger.V2_0.ISoundTriggerHwCallback callback, int cookie, + loadSoundModelCallback _hidl_cb) { + throw new UnsupportedOperationException(); + } + + @Override + public void loadPhraseSoundModel( + android.hardware.soundtrigger.V2_0.ISoundTriggerHw.PhraseSoundModel soundModel, + android.hardware.soundtrigger.V2_0.ISoundTriggerHwCallback callback, int cookie, + loadPhraseSoundModelCallback _hidl_cb) { + throw new UnsupportedOperationException(); + } + + @Override + public int startRecognition(int modelHandle, + android.hardware.soundtrigger.V2_0.ISoundTriggerHw.RecognitionConfig config, + android.hardware.soundtrigger.V2_0.ISoundTriggerHwCallback callback, int cookie) { + throw new UnsupportedOperationException(); + } + + @Override + public int stopAllRecognitions() { + throw new UnsupportedOperationException(); + } + } +} diff --git a/soundtrigger/2.3/cli/sthal_cli_2.3 b/soundtrigger/2.3/cli/sthal_cli_2.3 new file mode 100644 index 0000000000..78e9f9b52e --- /dev/null +++ b/soundtrigger/2.3/cli/sthal_cli_2.3 @@ -0,0 +1,7 @@ +#!/system/bin/sh +# Script to start "sthal_cli_2.3" on the device +# +base=/system +export CLASSPATH=$base/framework/sthal_cli_2.3.jar +exec app_process $base/bin android.hardware.soundtrigger.V2_3.cli.SthalCli "$@" + -- GitLab From 3f1c392d7e3567a42c45c9cc81b8902c45d37cb0 Mon Sep 17 00:00:00 2001 From: Ytai Ben-Tsvi Date: Tue, 24 Aug 2021 15:47:13 -0700 Subject: [PATCH 124/825] Remove STHAL 2.4 This version was only created as an intermediate version for development and was never intended for release. STHAL 3 (AIDL) has feature-parity with this one and is intended for release. Bug: 181996624 Test: Manual verification of soundtrigger use-cases. Change-Id: Ic490bbd0501ec593d741cf612f8fd995b7bb9c4e --- .../compatibility_matrix.current.xml | 2 +- soundtrigger/2.4/Android.bp | 30 -- soundtrigger/2.4/ISoundTriggerHw.hal | 190 --------- soundtrigger/2.4/ISoundTriggerHwCallback.hal | 34 -- .../2.4/ISoundTriggerHwGlobalCallback.hal | 32 -- soundtrigger/2.4/cli/Android.bp | 17 - soundtrigger/2.4/cli/OWNERS | 1 - .../soundtrigger/V2_4/cli/SthalCli.java | 401 ------------------ soundtrigger/2.4/cli/sthal_cli_2.4 | 7 - soundtrigger/2.4/vts/functional/Android.bp | 41 -- .../VtsHalSoundtriggerV2_4TargetTest.cpp | 84 ---- 11 files changed, 1 insertion(+), 838 deletions(-) delete mode 100644 soundtrigger/2.4/Android.bp delete mode 100644 soundtrigger/2.4/ISoundTriggerHw.hal delete mode 100644 soundtrigger/2.4/ISoundTriggerHwCallback.hal delete mode 100644 soundtrigger/2.4/ISoundTriggerHwGlobalCallback.hal delete mode 100644 soundtrigger/2.4/cli/Android.bp delete mode 100644 soundtrigger/2.4/cli/OWNERS delete mode 100644 soundtrigger/2.4/cli/java/android/hardware/soundtrigger/V2_4/cli/SthalCli.java delete mode 100644 soundtrigger/2.4/cli/sthal_cli_2.4 delete mode 100644 soundtrigger/2.4/vts/functional/Android.bp delete mode 100644 soundtrigger/2.4/vts/functional/VtsHalSoundtriggerV2_4TargetTest.cpp diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 62067bf0a1..f03008a4e4 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -536,7 +536,7 @@ android.hardware.soundtrigger - 2.3-4 + 2.3 ISoundTriggerHw default diff --git a/soundtrigger/2.4/Android.bp b/soundtrigger/2.4/Android.bp deleted file mode 100644 index 44befc3892..0000000000 --- a/soundtrigger/2.4/Android.bp +++ /dev/null @@ -1,30 +0,0 @@ -// This file is autogenerated by hidl-gen -Landroidbp. - -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"], -} - -hidl_interface { - name: "android.hardware.soundtrigger@2.4", - root: "android.hardware", - srcs: [ - "ISoundTriggerHw.hal", - "ISoundTriggerHwCallback.hal", - "ISoundTriggerHwGlobalCallback.hal", - ], - interfaces: [ - "android.hardware.audio.common@2.0", - "android.hardware.soundtrigger@2.0", - "android.hardware.soundtrigger@2.1", - "android.hardware.soundtrigger@2.2", - "android.hardware.soundtrigger@2.3", - "android.hidl.base@1.0", - "android.hidl.safe_union@1.0", - ], - gen_java: true, -} diff --git a/soundtrigger/2.4/ISoundTriggerHw.hal b/soundtrigger/2.4/ISoundTriggerHw.hal deleted file mode 100644 index fd393036d8..0000000000 --- a/soundtrigger/2.4/ISoundTriggerHw.hal +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.soundtrigger@2.4; - -import @2.0::SoundModelHandle; -import @2.1::ISoundTriggerHw.SoundModel; -import @2.1::ISoundTriggerHw.PhraseSoundModel; -import @2.3::ISoundTriggerHw; -import @2.3::RecognitionConfig; -import ISoundTriggerHwCallback; -import ISoundTriggerHwGlobalCallback; - -/** - * SoundTrigger HAL interface. Used for hardware recognition of hotwords - * and other sounds. - * - * Important notes about the threading model: - * ========================================== - * Both this interface and the corresponding callback interface use a synchronized calling - * convention. This model comes with some advantages, but also with some risks of deadlocks if the - * implementation does not handle this correctly. Please consider the following: - * - After stopRecognition() returns no more recognition events for that model may be sent. This - * implies that any queues holding such events must be flushed before the call returns and that - * may imply that callback from the HAL to the client are done while stopRecognition() is blocked. - * This is OK, and supported by the framework. - * - Similarly, the same relationship applies between unloadModel() and subsequent callbacks to - * modelUnloaded(). - * - Other than these two cases, calls into the HAL *MAY NOT* block on callbacks from the HAL, or - * else deadlock conditions may result, which may be handled by rebooting of the HAL process and - * cause service outages. - * - * Similarly, it is expected that a single call to startRecognition() generates at most one event - * (the model automatically becomes stopped when the event occurs, until explicitly started again) - * and that after a modelUnloaded() event no more events would be sent regarding the model. - * Note that a getModelState() call may generate a recognition event, but this event DOES NOT modify - * the model state - the model remains started. - * - * The HAL is expected to correctly handle a stopRecognition() call even after it sent an event - * indicating that recognition is stopped and an unloadModel() call even after it sent an event - * indicating that it has been unloaded. This is required in order to prevent race conditions - * between these calls. This also implies that model handles should generally not be reused until - * explicitly unloaded. To avoid the rare possibility of running out of handles, the framework will - * call unloadModel() on models that have been preemptively unloaded by the HAL. - * - * Due to the asynchronous nature of recognition events and preemptive model unloading, the HAL must - * correctly handle requests that would have been valid before an event has been delivered, but - * became moot as result of the event. Namely: - * - stopRecognition() may be called on a model that has already delivered an event and became - * inactive as a result. The HAL must return a successful return code in this case. - * - Furthermore, if a model is preemptively unloaded after it triggers (typically, this would - * happen when it is first aborted and immediately preemptively unloaded), stopRecognition() may - * be called on it. The HAL must return a successful return code in this case. - * - startRecognition() may be called on a model that has been preemptively unloaded. In this case, - * the HAL must return -EBUSY to indicate that the operation is temporarily unsuccessful. - * - unloadSoundModel() may be called on a model that has been preemptively unloaded. The HAL must - * return a successful return code in this case. - * - * Important notes about resource constraints and concurrency - * ========================================================= - * Up until this version, the framework would enforce concurrency constraints expressed by the - * Properties presented by the soundtrigger instance. These include constraints on the maximum - * amount of models that can be loaded at the same time and on running recognition while capturing - * from the microphone. - * This version changes the approach for how these constraints are modeled, both offering the HAL - * implementation more flexibility and simplifying the framework's job in enforcing these - * limitations. Note that there is no change for how the framework behaves with earlier versions, - * everything described below only applies to this version and onward. - * The way this is achieved is as following: - * - The framework will no longer enforce constraints on concurrent loading of models, as expressed - * in the Properties.maxSoundModels field (this property is merely a hint at this point and may be - * deprecated in the future. - * - The framework will no longer enforce constraints on concurrency of audio recording and - * soundtrigger operation, as expressed in the Properties.concurrentCapture field (this property - * is merely a hint at this point and may be deprecated in the future). - * - The framework will no longer enforce constraints on concurrent loading of models, as expressed - * in the Properties (these properties are merely hints at this point and may be deprecated in the - * future. - * - The HAL implementation is free to reject starting of any model at any time by having the - * respective start*() method return -EBUSY. - * - The HAL implementation is free to reject loading of any model at any time by having the - * respective load*() method return -EBUSY. - * - The HAL implementation is free to preemptively stop a previously started model at its own - * discretion (for example, if a higher priority use-case which cannot coexist with detection - * has been requested). The HAL must notify the framework of the preemption by sending a - * recognition event with an `ABORT` status. The implementation must NOT attempt to restart the - * recognition automatically when conditions change. - * - The HAL implementation is free to preemptively unload a previously loaded model at its own - * discretion (for example, if a higher-priority model is being loaded and the two cannot - * coexist). When doing so, it must first abort the detection if active (as per above) and then - * notify the framework of the unload using the newly added modelUnloaded callback. - * - When conditions change, such that a model that couldn't previously load or start or that had - * previously been preemptively stopped or unloaded, the HAL must notify the framework via the - * newly added tryAgain() callback. This callback is not a guarantee that any operation would now - * succeed, but merely a hint that retrying something that had previously failed, now MAY succeed. - * Until this callback arrives, the framework may assume that any operation that had previously - * failed or aborted would still fail if retried, so the implementation should not forget to - * deliver it. There are no guarantees regarding how the framework may respond to this event and - * the order in which it may choose to reload/restart its models. Typically, as result of this - * event the framework will make a single attempt per model to bring this model to its desired - * state (loaded, started). - */ -interface ISoundTriggerHw extends @2.3::ISoundTriggerHw { - /** - * This will get called at most once per every attachment to the service. - * - * All events not tied to a specific model should go through this callback. - */ - registerGlobalCallback(ISoundTriggerHwGlobalCallback callback); - - /** - * Load a sound model. Once loaded, recognition of this model can be - * started and stopped. - * The implementation returns a unique handle used by other functions - * (unloadSoundModel(), startRecognition*(), etc... - * - * Must have the exact same semantics as loadSoundModel from ISoundTriggerHw@2.3 except that the - * return values have changed and that there is no cookie provided (the implementation may pass - * any value to the callback, as it is ignored). - * - * @param soundModel A SoundModel structure describing the sound model - * to load. - * @param callback The callback interface on which the soundModelCallback*() - * method must be called upon completion and modelUnloaded() upon preempted unload. - * @return retval Operation completion status: 0 in case of success, - * -EBUSY in case the operation is temporarily unavailable (but possible in general). - * @return modelHandle A unique handle assigned by the HAL for use by the - * framework when controlling activity for this sound model. - */ - loadSoundModel_2_4(SoundModel soundModel, ISoundTriggerHwCallback callback) - generates (int32_t retval, SoundModelHandle modelHandle); - - /** - * Load a key phrase sound model. Once loaded, recognition of this model can - * be started and stopped. Only one active recognition per model at a time. - * The SoundTrigger service must handle concurrent recognition requests by - * different users/applications on the same model. - * The implementation returns a unique handle used by other functions - * (unloadSoundModel(), startRecognition*(), etc... - * - * Must have the exact same semantics as loadPhraseSoundModel from ISoundTriggerHw@2.3 except - * that the return values have changed and that there is no cookie provided (the implementation - * may pass any value to the callback, as it is ignored). - * - * @param soundModel A PhraseSoundModel structure describing the sound model - * to load. - * @param callback The callback interface on which the soundModelCallback*() - * method must be called upon completion and modelUnloaded() upon preempted unload. - * @return retval Operation completion status: 0 in case of success, - * -EBUSY in case the operation is temporarily unavailable (but possible in general). - * @return modelHandle A unique handle assigned by the HAL for use by the - * framework when controlling activity for this sound model. - */ - loadPhraseSoundModel_2_4(PhraseSoundModel soundModel, ISoundTriggerHwCallback callback) - generates (int32_t retval, SoundModelHandle modelHandle); - - /** - * Start recognition on a given model. Only one recognition active - * at a time per model. Once recognition succeeds or fails, the callback - * associated with the model handle is called. - * - * Must have the exact same semantics as startRecognition from ISoundTriggerHw@2.3 except that - * there are different expectations of the return value and that there is no cookie provided - * (the implementation may pass any value to the callback, as it is ignored). - * - * @param modelHandle the handle of the sound model to use for recognition - * @param config A RecognitionConfig structure containing attributes of the - * recognition to perform - * @param callback The callback interface on which the recognitionCallback() - * method must be called upon recognition. - * @return retval Operation completion status: 0 in case of success, - * -EBUSY in case the operation is temporarily unavailable (but possible in general), or in - * case model has been preemtively unloaded. - */ - startRecognition_2_4(SoundModelHandle modelHandle, RecognitionConfig config) - generates (int32_t retval); -}; diff --git a/soundtrigger/2.4/ISoundTriggerHwCallback.hal b/soundtrigger/2.4/ISoundTriggerHwCallback.hal deleted file mode 100644 index 594deb09d3..0000000000 --- a/soundtrigger/2.4/ISoundTriggerHwCallback.hal +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.soundtrigger@2.4; - -import @2.0::SoundModelHandle; -import @2.1::ISoundTriggerHwCallback; - -/** - * SoundTrigger HAL per-model Callback interface. - */ -interface ISoundTriggerHwCallback extends @2.1::ISoundTriggerHwCallback { - /** - * Callback method called by the HAL when a model has been unloaded at the HAL implementation's - * discretion. Only a stopped model may be unloaded. - * This event is NOT sent as part of an unload sequence initiated by the client. - * - * @param model The model handle. - */ - modelUnloaded(SoundModelHandle model); -}; diff --git a/soundtrigger/2.4/ISoundTriggerHwGlobalCallback.hal b/soundtrigger/2.4/ISoundTriggerHwGlobalCallback.hal deleted file mode 100644 index 2f1a977a12..0000000000 --- a/soundtrigger/2.4/ISoundTriggerHwGlobalCallback.hal +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.soundtrigger@2.4; - -/** - * SoundTrigger HAL callback interface for events not associated with a particular model. - */ -interface ISoundTriggerHwGlobalCallback { - /** - * Callback method called by the HAL whenever internal conditions have been made available, such - * that a call that would previously have failed with an -EBUSY status may now succeed. - * There is no guarantee that any call would succeed following this event. It is merely a hint - * to the client that it may retry. - * Conversely, any call that have failed previously with -EBUSY is guaranteed to fail again if - * retried, until this callback is delivered. - */ - onResourcesAvailable(); -}; diff --git a/soundtrigger/2.4/cli/Android.bp b/soundtrigger/2.4/cli/Android.bp deleted file mode 100644 index 8d0979bed7..0000000000 --- a/soundtrigger/2.4/cli/Android.bp +++ /dev/null @@ -1,17 +0,0 @@ -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"], -} - -java_binary { - name: "sthal_cli_2.4", - wrapper: "sthal_cli_2.4", - srcs: ["java/**/*.java"], - static_libs: [ - "android.hardware.soundtrigger-V2.4-java", - ], -} diff --git a/soundtrigger/2.4/cli/OWNERS b/soundtrigger/2.4/cli/OWNERS deleted file mode 100644 index e21b66ecb3..0000000000 --- a/soundtrigger/2.4/cli/OWNERS +++ /dev/null @@ -1 +0,0 @@ -include /media/java/android/media/soundtrigger_middleware/OWNERS diff --git a/soundtrigger/2.4/cli/java/android/hardware/soundtrigger/V2_4/cli/SthalCli.java b/soundtrigger/2.4/cli/java/android/hardware/soundtrigger/V2_4/cli/SthalCli.java deleted file mode 100644 index 4931105137..0000000000 --- a/soundtrigger/2.4/cli/java/android/hardware/soundtrigger/V2_4/cli/SthalCli.java +++ /dev/null @@ -1,401 +0,0 @@ -/* - * Copyright 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package android.hardware.soundtrigger.V2_4.cli; - -import android.hardware.soundtrigger.V2_0.PhraseRecognitionExtra; -import android.hardware.soundtrigger.V2_0.RecognitionMode; -import android.hardware.soundtrigger.V2_0.SoundModelType; -import android.hardware.soundtrigger.V2_3.OptionalModelParameterRange; -import android.hardware.soundtrigger.V2_4.ISoundTriggerHw; -import android.hardware.soundtrigger.V2_4.ISoundTriggerHwCallback; -import android.hardware.soundtrigger.V2_4.ISoundTriggerHwGlobalCallback; -import android.os.HidlMemoryUtil; -import android.os.HwBinder; -import android.os.RemoteException; -import android.os.SystemProperties; - -import java.util.Scanner; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; - -/** - * This is a quick-and-dirty sound trigger HAL console mock. - * - * It would only work on userdebug builds. - * - * When this app is started, it will initially: - * - Register a ISoundTriggerHw HAL with an instance name "mock". - * - Set a sysprop that tells SoundTriggerMiddlewareService to try to connect to the mock instance - * rather than the default one. - * - Reboot the real (default) HAL. - * - * In response to that, SoundTriggerMiddlewareService is going to connect to the mock HAL and resume - * normal operation. - * - * Our mock HAL will print to stdout every call it receives as well as expose a basic set of - * operations for sending event callbacks to the client. This allows us to simulate the frameworks - * behavior in response to different HAL behaviors. - */ -public class SthalCli { - private static SoundTriggerImpl mService; - private static final Scanner scanner = new Scanner(System.in); - - public static void main(String[] args) { - try { - System.out.println("Registering mock STHAL"); - HwBinder.setTrebleTestingOverride(true); - mService = new SoundTriggerImpl(); - mService.registerAsService("mock"); - - System.out.println("Rebooting STHAL"); - SystemProperties.set("debug.soundtrigger_middleware.use_mock_hal", "2"); - SystemProperties.set("sys.audio.restart.hal", "1"); - - while (processCommand()) ; - } catch (Exception e) { - e.printStackTrace(); - } finally { - cleanup(); - } - } - - private static void cleanup() { - System.out.println("Cleaning up."); - SystemProperties.set("debug.soundtrigger_middleware.use_mock_hal", null); - HwBinder.setTrebleTestingOverride(false); - } - - private static boolean processCommand() { - String line = scanner.nextLine(); - String[] tokens = line.split("\\s+"); - if (tokens.length < 1) { - return false; - } - switch (tokens[0]) { - case "q": - return false; - - case "a": - mService.sendOnResourcesAvailable(); - return true; - - case "u": - mService.sendModelUnloaded(Integer.parseInt(tokens[1])); - return true; - - case "r": - mService.sendRecognitionEvent(Integer.parseInt(tokens[1]), - Integer.parseInt(tokens[2])); - return true; - - case "p": - mService.sendPhraseRecognitionEvent(Integer.parseInt(tokens[1]), - Integer.parseInt(tokens[2])); - return true; - - case "d": - mService.dumpModels(); - return true; - - case "h": - System.out.print("Available commands:\n" + "h - help\n" + "q - quit\n" - + "a - send onResourcesAvailable event\n" - + "u - send modelUnloaded event\n" - + "r - send recognitionEvent\n" - + "p - send phraseRecognitionEvent\n" - + "d - dump models\n"); - - default: - return true; - } - } - - private static class SoundTriggerImpl extends ISoundTriggerHw.Stub { - static class Model { - final ISoundTriggerHwCallback callback; - final SoundModel model; - final PhraseSoundModel phraseModel; - public android.hardware.soundtrigger.V2_3.RecognitionConfig config = null; - - Model(ISoundTriggerHwCallback callback, SoundModel model) { - this.callback = callback; - this.model = model; - this.phraseModel = null; - } - - Model(ISoundTriggerHwCallback callback, PhraseSoundModel model) { - this.callback = callback; - this.model = null; - this.phraseModel = model; - } - } - - private ISoundTriggerHwGlobalCallback mGlobalCallback; - private final ConcurrentMap mLoadedModels = new ConcurrentHashMap<>(); - private int mHandleCounter = 1; - - public void dumpModels() { - mLoadedModels.forEach((handle, model) -> { - System.out.println("+++ Model " + handle); - System.out.println(" config = " + model.config); - android.hardware.soundtrigger.V2_3.RecognitionConfig recognitionConfig = - model.config; - if (recognitionConfig != null) { - System.out.println(" ACTIVE recognitionConfig = " + recognitionConfig); - } else { - System.out.println(" INACTIVE"); - } - }); - } - - public void sendOnResourcesAvailable() { - if (mGlobalCallback != null) { - try { - mGlobalCallback.onResourcesAvailable(); - } catch (RemoteException e) { - e.printStackTrace(); - } - } - } - - public void sendRecognitionEvent(int modelHandle, int status) { - Model model = mLoadedModels.get(modelHandle); - if (model != null && model.config != null) { - android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback.RecognitionEvent event = - new android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback.RecognitionEvent(); - event.header.model = modelHandle; - event.header.type = SoundModelType.GENERIC; - event.header.status = status; - event.header.captureSession = model.config.base.header.captureHandle; - event.header.captureAvailable = true; - event.header.audioConfig.channelMask = 16; - event.header.audioConfig.format = 1; - event.header.audioConfig.sampleRateHz = 16000; - event.data = HidlMemoryUtil.byteArrayToHidlMemory(new byte[0]); - try { - model.callback.recognitionCallback_2_1(event, 0); - } catch (RemoteException e) { - e.printStackTrace(); - } - model.config = null; - } - } - - public void sendPhraseRecognitionEvent(int modelHandle, int status) { - Model model = mLoadedModels.get(modelHandle); - if (model != null && model.config != null) { - android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback.PhraseRecognitionEvent - event = - new android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback.PhraseRecognitionEvent(); - event.common.header.model = modelHandle; - event.common.header.type = SoundModelType.KEYPHRASE; - event.common.header.status = status; - event.common.header.captureSession = model.config.base.header.captureHandle; - event.common.header.captureAvailable = true; - event.common.header.audioConfig.channelMask = 16; - event.common.header.audioConfig.format = 1; - event.common.header.audioConfig.sampleRateHz = 16000; - event.common.data = HidlMemoryUtil.byteArrayToHidlMemory(new byte[0]); - if (!model.phraseModel.phrases.isEmpty()) { - PhraseRecognitionExtra extra = new PhraseRecognitionExtra(); - extra.id = model.phraseModel.phrases.get(0).id; - extra.confidenceLevel = 100; - extra.recognitionModes = model.phraseModel.phrases.get(0).recognitionModes; - event.phraseExtras.add(extra); - } - try { - model.callback.phraseRecognitionCallback_2_1(event, 0); - } catch (RemoteException e) { - e.printStackTrace(); - } - model.config = null; - } - } - - public void sendModelUnloaded(int modelHandle) { - Model model = mLoadedModels.remove(modelHandle); - if (model != null) { - try { - model.callback.modelUnloaded(modelHandle); - } catch (RemoteException e) { - e.printStackTrace(); - } - } - } - - @Override - public void registerGlobalCallback(ISoundTriggerHwGlobalCallback callback) { - System.out.println("registerGlobalCallback()"); - mGlobalCallback = callback; - } - - @Override - public void loadSoundModel_2_4(SoundModel soundModel, ISoundTriggerHwCallback callback, - loadSoundModel_2_4Callback _hidl_cb) { - int handle = mHandleCounter++; - System.out.printf("loadSoundModel_2_4(soundModel=%s) -> %d%n", soundModel, handle); - mLoadedModels.put(handle, new Model(callback, soundModel)); - _hidl_cb.onValues(0, handle); - } - - @Override - public void loadPhraseSoundModel_2_4(PhraseSoundModel soundModel, - ISoundTriggerHwCallback callback, loadPhraseSoundModel_2_4Callback _hidl_cb) { - int handle = mHandleCounter++; - System.out.printf("loadPhraseSoundModel_2_4(soundModel=%s) -> %d%n", soundModel, - handle); - mLoadedModels.put(handle, new Model(callback, soundModel)); - _hidl_cb.onValues(0, handle); - } - - @Override - public int startRecognition_2_4(int modelHandle, - android.hardware.soundtrigger.V2_3.RecognitionConfig config) { - System.out.printf("startRecognition_2_4(modelHandle=%d)%n", modelHandle); - Model model = mLoadedModels.get(modelHandle); - if (model != null) { - model.config = config; - } - return 0; - } - - @Override - public void getProperties_2_3(getProperties_2_3Callback _hidl_cb) { - System.out.println("getProperties_2_3()"); - android.hardware.soundtrigger.V2_3.Properties properties = - new android.hardware.soundtrigger.V2_3.Properties(); - properties.base.implementor = "Android"; - properties.base.description = "Mock STHAL"; - properties.base.maxSoundModels = 2; - properties.base.maxKeyPhrases = 1; - properties.base.recognitionModes = - RecognitionMode.VOICE_TRIGGER | RecognitionMode.GENERIC_TRIGGER; - _hidl_cb.onValues(0, properties); - } - - @Override - public void queryParameter(int modelHandle, int modelParam, - queryParameterCallback _hidl_cb) { - _hidl_cb.onValues(0, new OptionalModelParameterRange()); - } - - @Override - public int getModelState(int modelHandle) { - System.out.printf("getModelState(modelHandle=%d)%n", modelHandle); - return 0; - } - - @Override - public int unloadSoundModel(int modelHandle) { - System.out.printf("unloadSoundModel(modelHandle=%d)%n", modelHandle); - return 0; - } - - @Override - public int stopRecognition(int modelHandle) { - System.out.printf("stopRecognition(modelHandle=%d)%n", modelHandle); - Model model = mLoadedModels.get(modelHandle); - if (model != null) { - model.config = null; - } - return 0; - } - - @Override - public void debug(android.os.NativeHandle fd, java.util.ArrayList options) { - if (!options.isEmpty()) { - switch (options.get(0)) { - case "reboot": - System.out.println("Received a reboot request. Exiting."); - cleanup(); - System.exit(1); - } - } - } - - //////////////////////////////////////////////////////////////////////////////////////////// - // Everything below is not implemented and not expected to be called. - - @Override - public int startRecognition_2_3(int modelHandle, - android.hardware.soundtrigger.V2_3.RecognitionConfig config) { - throw new UnsupportedOperationException(); - } - - @Override - public int setParameter(int modelHandle, int modelParam, int value) { - throw new UnsupportedOperationException(); - } - - @Override - public void getParameter(int modelHandle, int modelParam, getParameterCallback _hidl_cb) { - throw new UnsupportedOperationException(); - } - - @Override - public void loadSoundModel_2_1(SoundModel soundModel, - android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback callback, int cookie, - loadSoundModel_2_1Callback _hidl_cb) { - throw new UnsupportedOperationException(); - } - - @Override - public void loadPhraseSoundModel_2_1(PhraseSoundModel soundModel, - android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback callback, int cookie, - loadPhraseSoundModel_2_1Callback _hidl_cb) { - throw new UnsupportedOperationException(); - } - - @Override - public int startRecognition_2_1(int modelHandle, RecognitionConfig config, - android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback callback, int cookie) { - throw new UnsupportedOperationException(); - } - - @Override - public void getProperties(getPropertiesCallback _hidl_cb) { - throw new UnsupportedOperationException(); - } - - @Override - public void loadSoundModel( - android.hardware.soundtrigger.V2_0.ISoundTriggerHw.SoundModel soundModel, - android.hardware.soundtrigger.V2_0.ISoundTriggerHwCallback callback, int cookie, - loadSoundModelCallback _hidl_cb) { - throw new UnsupportedOperationException(); - } - - @Override - public void loadPhraseSoundModel( - android.hardware.soundtrigger.V2_0.ISoundTriggerHw.PhraseSoundModel soundModel, - android.hardware.soundtrigger.V2_0.ISoundTriggerHwCallback callback, int cookie, - loadPhraseSoundModelCallback _hidl_cb) { - throw new UnsupportedOperationException(); - } - - @Override - public int startRecognition(int modelHandle, - android.hardware.soundtrigger.V2_0.ISoundTriggerHw.RecognitionConfig config, - android.hardware.soundtrigger.V2_0.ISoundTriggerHwCallback callback, int cookie) { - throw new UnsupportedOperationException(); - } - - @Override - public int stopAllRecognitions() { - throw new UnsupportedOperationException(); - } - } -} diff --git a/soundtrigger/2.4/cli/sthal_cli_2.4 b/soundtrigger/2.4/cli/sthal_cli_2.4 deleted file mode 100644 index 08014643ff..0000000000 --- a/soundtrigger/2.4/cli/sthal_cli_2.4 +++ /dev/null @@ -1,7 +0,0 @@ -#!/system/bin/sh -# Script to start "sthal_cli_2.4" on the device -# -base=/system -export CLASSPATH=$base/framework/sthal_cli_2.4.jar -exec app_process $base/bin android.hardware.soundtrigger.V2_4.cli.SthalCli "$@" - diff --git a/soundtrigger/2.4/vts/functional/Android.bp b/soundtrigger/2.4/vts/functional/Android.bp deleted file mode 100644 index 4b7ae91f37..0000000000 --- a/soundtrigger/2.4/vts/functional/Android.bp +++ /dev/null @@ -1,41 +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. -// - -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: "VtsHalSoundtriggerV2_4TargetTest", - defaults: ["VtsHalTargetTestDefaults"], - srcs: ["VtsHalSoundtriggerV2_4TargetTest.cpp"], - static_libs: [ - "android.hardware.soundtrigger@2.0", - "android.hardware.soundtrigger@2.1", - "android.hardware.soundtrigger@2.2", - "android.hardware.soundtrigger@2.3", - "android.hardware.soundtrigger@2.4", - ], - test_suites: [ - "general-tests", - "vts", - ], -} diff --git a/soundtrigger/2.4/vts/functional/VtsHalSoundtriggerV2_4TargetTest.cpp b/soundtrigger/2.4/vts/functional/VtsHalSoundtriggerV2_4TargetTest.cpp deleted file mode 100644 index 13d70058e1..0000000000 --- a/soundtrigger/2.4/vts/functional/VtsHalSoundtriggerV2_4TargetTest.cpp +++ /dev/null @@ -1,84 +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. - */ - -#define LOG_TAG "SoundTriggerHidlHalTest" - -#include -#include -#include -#include -#include -#include -#include - -using ::android::sp; -using ::android::hardware::Return; -using ::android::hardware::Status; -using ::android::hardware::soundtrigger::V2_4::ISoundTriggerHw; -using ::android::hardware::soundtrigger::V2_4::ISoundTriggerHwGlobalCallback; - -/** - * Test class holding the instance of the SoundTriggerHW service to test. - * The passed parameter is the registered name of the implementing service - * supplied by INSTANTIATE_TEST_SUITE_P() call. - */ -class SoundTriggerHidlTest : public testing::TestWithParam { -public: - void SetUp() override { - mSoundtrigger = ISoundTriggerHw::getService(GetParam()); - - ASSERT_NE(mSoundtrigger, nullptr); - LOG(INFO) << "Test is remote " << mSoundtrigger->isRemote(); - } - -protected: - sp mSoundtrigger; -}; - -/** - * Empty test is in place to ensure service is initialized. - * Due to the nature of SoundTrigger HAL providing an interface for - * proprietary or vendor specific implementations, limited testing on - * individual APIs is possible. - */ -TEST_P(SoundTriggerHidlTest, ServiceIsInstantiated) {} - -class GlobalCallback : public ISoundTriggerHwGlobalCallback { - Return onResourcesAvailable() override { - return Status::ok(); - } -}; - -/** - * Test ISoundTriggerHw::registerGlobalCallback method - * - * Verifies that: - * - the implementation implements the method - * - the method returns no error - */ -TEST_P(SoundTriggerHidlTest, RegisterGlobalCallback) { - Return hidlReturn; - sp callback = new GlobalCallback(); - hidlReturn = mSoundtrigger->registerGlobalCallback(callback); - EXPECT_TRUE(hidlReturn.isOk()); -} - -GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SoundTriggerHidlTest); - -INSTANTIATE_TEST_SUITE_P( - PerInstance, SoundTriggerHidlTest, - testing::ValuesIn(android::hardware::getAllHalInstanceNames(ISoundTriggerHw::descriptor)), - android::hardware::PrintInstanceNameToString); -- GitLab From 43a6ce023fde016b6afc8ec7f78a7905463f6e2f Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Wed, 25 Aug 2021 21:26:15 +0000 Subject: [PATCH 125/825] Follow-up after ag/15645323 Make 'createConfig' a static function. Fix OWNERS file to point to the correct location. Bug: 188932434 Test: m sthal_cli_3 Change-Id: I7a35096acb71a246691f9bb9ddf41660f3e7cf8f --- soundtrigger/aidl/cli/OWNERS | 2 +- .../hardware/soundtrigger3/cli/SthalCli.java | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/soundtrigger/aidl/cli/OWNERS b/soundtrigger/aidl/cli/OWNERS index e21b66ecb3..9f87c4cdb5 100644 --- a/soundtrigger/aidl/cli/OWNERS +++ b/soundtrigger/aidl/cli/OWNERS @@ -1 +1 @@ -include /media/java/android/media/soundtrigger_middleware/OWNERS +include platform/frameworks/base:/media/aidl/android/media/soundtrigger_middleware/OWNERS 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 b4778784ec..2922e8369b 100644 --- a/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java +++ b/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java @@ -248,16 +248,6 @@ public class SthalCli { } } - private AudioConfig createConfig() { - AudioConfig config = new AudioConfig(); - config.channelMask = AudioChannelLayout.layoutMask(AudioChannelLayout.LAYOUT_MONO); - config.format = new AudioFormatDescription(); - config.format.type = AudioFormatType.PCM; - config.format.pcm = PcmType.INT_16_BIT; - config.sampleRateHz = 16000; - return config; - } - @Override public void registerGlobalCallback(ISoundTriggerHwGlobalCallback callback) { System.out.println("registerGlobalCallback()"); @@ -355,5 +345,15 @@ public class SthalCli { public int getParameter(int modelHandle, int modelParam) { throw new IllegalArgumentException(); } + + private static AudioConfig createConfig() { + AudioConfig config = new AudioConfig(); + config.channelMask = AudioChannelLayout.layoutMask(AudioChannelLayout.LAYOUT_MONO); + config.format = new AudioFormatDescription(); + config.format.type = AudioFormatType.PCM; + config.format.pcm = PcmType.INT_16_BIT; + config.sampleRateHz = 16000; + return config; + } } } -- GitLab From bf33bcb35ccc0272f870a41e3924e817b34ad842 Mon Sep 17 00:00:00 2001 From: Valentin Iftime Date: Wed, 4 Aug 2021 18:36:27 +0200 Subject: [PATCH 126/825] Enable mute test pattern for external cameras Add ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR as an available test pattern for ExternalCameraDevice (v3.4). Bug: 182204067 Test: Connect an USB camera. Enable camera privacy toggle. Apps using the camera should get a black preview Change-Id: Ie0d4d5b3f555eb9e1b1fc255b612668736daeaa4 --- .../3.4/default/ExternalCameraDevice.cpp | 4 +- .../default/ExternalCameraDeviceSession.cpp | 50 +++++++++++++++++-- .../ExternalCameraDeviceSession.h | 3 ++ 3 files changed, 50 insertions(+), 7 deletions(-) diff --git a/camera/device/3.4/default/ExternalCameraDevice.cpp b/camera/device/3.4/default/ExternalCameraDevice.cpp index 677b496324..311c688a2c 100644 --- a/camera/device/3.4/default/ExternalCameraDevice.cpp +++ b/camera/device/3.4/default/ExternalCameraDevice.cpp @@ -413,8 +413,8 @@ status_t ExternalCameraDevice::initDefaultCharsKeys( const uint8_t croppingType = ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY; UPDATE(ANDROID_SCALER_CROPPING_TYPE, &croppingType, 1); - const int32_t testPatternModes[] = { - ANDROID_SENSOR_TEST_PATTERN_MODE_OFF}; + const int32_t testPatternModes[] = {ANDROID_SENSOR_TEST_PATTERN_MODE_OFF, + ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR}; UPDATE(ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES, testPatternModes, ARRAY_SIZE(testPatternModes)); diff --git a/camera/device/3.4/default/ExternalCameraDeviceSession.cpp b/camera/device/3.4/default/ExternalCameraDeviceSession.cpp index 5f8674219c..ca7186b18d 100644 --- a/camera/device/3.4/default/ExternalCameraDeviceSession.cpp +++ b/camera/device/3.4/default/ExternalCameraDeviceSession.cpp @@ -1462,14 +1462,50 @@ bool ExternalCameraDeviceSession::OutputThread::threadLoop() { return onDeviceError("%s: V4L2 buffer map failed", __FUNCTION__); } + // Process camera mute state + auto testPatternMode = req->setting.find(ANDROID_SENSOR_TEST_PATTERN_MODE); + if (testPatternMode.count == 1) { + if (mCameraMuted != (testPatternMode.data.u8[0] != ANDROID_SENSOR_TEST_PATTERN_MODE_OFF)) { + mCameraMuted = !mCameraMuted; + // Get solid color for test pattern, if any was set + if (testPatternMode.data.u8[0] == ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR) { + auto entry = req->setting.find(ANDROID_SENSOR_TEST_PATTERN_DATA); + if (entry.count == 4) { + // Update the mute frame if the pattern color has changed + if (memcmp(entry.data.i32, mTestPatternData, sizeof(mTestPatternData)) != 0) { + memcpy(mTestPatternData, entry.data.i32, sizeof(mTestPatternData)); + // Fill the mute frame with the solid color, use only 8 MSB of RGGB as RGB + for (int i = 0; i < mMuteTestPatternFrame.size(); i += 3) { + mMuteTestPatternFrame[i] = entry.data.i32[0] >> 24; + mMuteTestPatternFrame[i + 1] = entry.data.i32[1] >> 24; + mMuteTestPatternFrame[i + 2] = entry.data.i32[3] >> 24; + } + } + } + } + } + } + // TODO: in some special case maybe we can decode jpg directly to gralloc output? if (req->frameIn->mFourcc == V4L2_PIX_FMT_MJPEG) { ATRACE_BEGIN("MJPGtoI420"); - int res = libyuv::MJPGToI420( - inData, inDataSize, static_cast(mYu12FrameLayout.y), mYu12FrameLayout.yStride, - static_cast(mYu12FrameLayout.cb), mYu12FrameLayout.cStride, - static_cast(mYu12FrameLayout.cr), mYu12FrameLayout.cStride, - mYu12Frame->mWidth, mYu12Frame->mHeight, mYu12Frame->mWidth, mYu12Frame->mHeight); + int res = 0; + if (mCameraMuted) { + res = libyuv::ConvertToI420( + mMuteTestPatternFrame.data(), mMuteTestPatternFrame.size(), + static_cast(mYu12FrameLayout.y), mYu12FrameLayout.yStride, + static_cast(mYu12FrameLayout.cb), mYu12FrameLayout.cStride, + static_cast(mYu12FrameLayout.cr), mYu12FrameLayout.cStride, 0, 0, + mYu12Frame->mWidth, mYu12Frame->mHeight, mYu12Frame->mWidth, + mYu12Frame->mHeight, libyuv::kRotate0, libyuv::FOURCC_RAW); + } else { + res = libyuv::MJPGToI420( + inData, inDataSize, static_cast(mYu12FrameLayout.y), + mYu12FrameLayout.yStride, static_cast(mYu12FrameLayout.cb), + mYu12FrameLayout.cStride, static_cast(mYu12FrameLayout.cr), + mYu12FrameLayout.cStride, mYu12Frame->mWidth, mYu12Frame->mHeight, + mYu12Frame->mWidth, mYu12Frame->mHeight); + } ATRACE_END(); if (res != 0) { @@ -1670,6 +1706,9 @@ Status ExternalCameraDeviceSession::OutputThread::allocateIntermediateBuffers( } } + // Allocate mute test pattern frame + mMuteTestPatternFrame.resize(mYu12Frame->mWidth * mYu12Frame->mHeight * 3); + mBlobBufferSize = blobBufferSize; return Status::OK; } @@ -1679,6 +1718,7 @@ void ExternalCameraDeviceSession::OutputThread::clearIntermediateBuffers() { mYu12Frame.clear(); mYu12ThumbFrame.clear(); mIntermediateBuffers.clear(); + mMuteTestPatternFrame.clear(); mBlobBufferSize = 0; } diff --git a/camera/device/3.4/default/include/ext_device_v3_4_impl/ExternalCameraDeviceSession.h b/camera/device/3.4/default/include/ext_device_v3_4_impl/ExternalCameraDeviceSession.h index 180f0c155a..184c16e591 100644 --- a/camera/device/3.4/default/include/ext_device_v3_4_impl/ExternalCameraDeviceSession.h +++ b/camera/device/3.4/default/include/ext_device_v3_4_impl/ExternalCameraDeviceSession.h @@ -181,6 +181,9 @@ struct ExternalCameraDeviceSession : public virtual RefBase, std::unordered_map, SizeHasher> mScaledYu12Frames; YCbCrLayout mYu12FrameLayout; YCbCrLayout mYu12ThumbFrameLayout; + std::vector mMuteTestPatternFrame; + uint32_t mTestPatternData[4] = {0, 0, 0, 0}; + bool mCameraMuted = false; uint32_t mBlobBufferSize = 0; // 0 -> HAL derive buffer size, else: use given size std::string mExifMake; -- GitLab From 901aa7b75446685b64910780f6614d663a460753 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Thu, 26 Aug 2021 12:20:56 -0700 Subject: [PATCH 127/825] Refine tuner aidl hal threads. Bug: 197763854 Test: VtsHalTvTunerTargetTest Test: atest android.media.tv.tuner.cts Test: sampletunertvinput Change-Id: Id707438178ed93731919f0155cab805436147f86 --- tv/tuner/aidl/default/Demux.cpp | 21 +++----- tv/tuner/aidl/default/Demux.h | 15 +++--- tv/tuner/aidl/default/Dvr.h | 2 +- tv/tuner/aidl/default/Filter.cpp | 24 ++++----- tv/tuner/aidl/default/Filter.h | 9 ++-- tv/tuner/aidl/vts/functional/DvrTests.cpp | 60 +++++++++-------------- tv/tuner/aidl/vts/functional/DvrTests.h | 18 +++---- 7 files changed, 64 insertions(+), 85 deletions(-) diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp index 3937c6ab25..8e83d063ce 100644 --- a/tv/tuner/aidl/default/Demux.cpp +++ b/tv/tuner/aidl/default/Demux.cpp @@ -37,8 +37,7 @@ Demux::Demux(int32_t demuxId, std::shared_ptr tuner) { } Demux::~Demux() { - mFrontendInputThreadRunning = false; - std::lock_guard lock(mFrontendInputThreadLock); + close(); } ::ndk::ScopedAStatus Demux::setFrontendDataSource(int32_t in_frontendId) { @@ -171,6 +170,8 @@ Demux::~Demux() { ::ndk::ScopedAStatus Demux::close() { ALOGV("%s", __FUNCTION__); + stopFrontendInput(); + set::iterator it; for (it = mPlaybackFilterIds.begin(); it != mPlaybackFilterIds.end(); it++) { mDvrPlayback->removePlaybackFilter(*it); @@ -180,8 +181,6 @@ Demux::~Demux() { mFilters.clear(); mLastUsedFilterId = -1; mTuner->removeDemux(mDemuxId); - mFrontendInputThreadRunning = false; - std::lock_guard lock(mFrontendInputThreadLock); return ::ndk::ScopedAStatus::ok(); } @@ -345,14 +344,7 @@ uint16_t Demux::getFilterTpid(int64_t filterId) { void Demux::startFrontendInputLoop() { mFrontendInputThreadRunning = true; - pthread_create(&mFrontendInputThread, NULL, __threadLoopFrontend, this); - pthread_setname_np(mFrontendInputThread, "frontend_input_thread"); -} - -void* Demux::__threadLoopFrontend(void* user) { - Demux* const self = static_cast(user); - self->frontendInputThreadLoop(); - return 0; + mFrontendInputThread = std::thread(&Demux::frontendInputThreadLoop, this); } void Demux::frontendInputThreadLoop() { @@ -360,7 +352,6 @@ void Demux::frontendInputThreadLoop() { return; } - std::lock_guard lock(mFrontendInputThreadLock); if (!mDvrPlayback) { ALOGW("[Demux] No software Frontend input configured. Ending Frontend thread loop."); mFrontendInputThreadRunning = false; @@ -402,7 +393,9 @@ void Demux::stopFrontendInput() { ALOGD("[Demux] stop frontend on demux"); mKeepFetchingDataFromFrontend = false; mFrontendInputThreadRunning = false; - std::lock_guard lock(mFrontendInputThreadLock); + if (mFrontendInputThread.joinable()) { + mFrontendInputThread.join(); + } } void Demux::setIsRecording(bool isRecording) { diff --git a/tv/tuner/aidl/default/Demux.h b/tv/tuner/aidl/default/Demux.h index 4d9b7fe911..1b789bd5d0 100644 --- a/tv/tuner/aidl/default/Demux.h +++ b/tv/tuner/aidl/default/Demux.h @@ -20,7 +20,10 @@ #include #include +#include #include +#include + #include "Dvr.h" #include "Filter.h" #include "Frontend.h" @@ -155,12 +158,14 @@ class Demux : public BnDemux { std::shared_ptr mDvrRecord; // Thread handlers - pthread_t mFrontendInputThread; + std::thread mFrontendInputThread; + /** * If a specific filter's writing loop is still running */ - bool mFrontendInputThreadRunning; - bool mKeepFetchingDataFromFrontend; + std::atomic mFrontendInputThreadRunning; + std::atomic mKeepFetchingDataFromFrontend; + /** * If the dvr recording is running. */ @@ -169,10 +174,6 @@ class Demux : public BnDemux { * Lock to protect writes to the FMQs */ std::mutex mWriteLock; - /** - * Lock to protect writes to the input status - */ - std::mutex mFrontendInputThreadLock; // temp handle single PES filter // TODO handle mulptiple Pes filters diff --git a/tv/tuner/aidl/default/Dvr.h b/tv/tuner/aidl/default/Dvr.h index 586f885f85..ad8728e54b 100644 --- a/tv/tuner/aidl/default/Dvr.h +++ b/tv/tuner/aidl/default/Dvr.h @@ -129,7 +129,7 @@ class Dvr : public BnDvr { * If a specific filter's writing loop is still running */ std::atomic mDvrThreadRunning; - bool mKeepFetchingDataFromFrontend; + /** * Lock to protect writes to the FMQs */ diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp index 9755e39b67..bf89d12407 100644 --- a/tv/tuner/aidl/default/Filter.cpp +++ b/tv/tuner/aidl/default/Filter.cpp @@ -85,8 +85,7 @@ Filter::Filter(DemuxFilterType type, int64_t filterId, uint32_t bufferSize, } Filter::~Filter() { - mFilterThreadRunning = false; - std::lock_guard lock(mFilterThreadLock); + close(); } ::ndk::ScopedAStatus Filter::getId64Bit(int64_t* _aidl_return) { @@ -187,8 +186,12 @@ Filter::~Filter() { ::ndk::ScopedAStatus Filter::stop() { ALOGV("%s", __FUNCTION__); + mFilterThreadRunning = false; - std::lock_guard lock(mFilterThreadLock); + if (mFilterThread.joinable()) { + mFilterThread.join(); + } + return ::ndk::ScopedAStatus::ok(); } @@ -226,8 +229,8 @@ Filter::~Filter() { ::ndk::ScopedAStatus Filter::close() { ALOGV("%s", __FUNCTION__); - mFilterThreadRunning = false; - std::lock_guard lock(mFilterThreadLock); + stop(); + return mDemux->removeFilter(mFilterId); } @@ -376,22 +379,15 @@ bool Filter::createFilterMQ() { } ::ndk::ScopedAStatus Filter::startFilterLoop() { - pthread_create(&mFilterThread, NULL, __threadLoopFilter, this); - pthread_setname_np(mFilterThread, "filter_waiting_loop"); + mFilterThread = std::thread(&Filter::filterThreadLoop, this); return ::ndk::ScopedAStatus::ok(); } -void* Filter::__threadLoopFilter(void* user) { - Filter* const self = static_cast(user); - self->filterThreadLoop(); - return 0; -} - void Filter::filterThreadLoop() { if (!mFilterThreadRunning) { return; } - std::lock_guard lock(mFilterThreadLock); + ALOGD("[Filter] filter %" PRIu64 " threadLoop start.", mFilterId); // For the first time of filter output, implementation needs to send the filter diff --git a/tv/tuner/aidl/default/Filter.h b/tv/tuner/aidl/default/Filter.h index 3f40256c58..2ca25afb3c 100644 --- a/tv/tuner/aidl/default/Filter.h +++ b/tv/tuner/aidl/default/Filter.h @@ -24,7 +24,10 @@ #include #include #include +#include #include +#include + #include "Demux.h" #include "Dvr.h" #include "Frontend.h" @@ -126,15 +129,14 @@ class Filter : public BnFilter { vector mFilterEvents; // Thread handlers - pthread_t mFilterThread; + std::thread mFilterThread; // FMQ status local records DemuxFilterStatus mFilterStatus; /** * If a specific filter's writing loop is still running */ - bool mFilterThreadRunning; - bool mKeepFetchingDataFromFrontend; + std::atomic mFilterThreadRunning; /** * How many times a filter should write @@ -204,7 +206,6 @@ class Filter : public BnFilter { * Lock to protect writes to the input status */ std::mutex mFilterStatusLock; - std::mutex mFilterThreadLock; std::mutex mFilterOutputLock; std::mutex mRecordFilterOutputLock; diff --git a/tv/tuner/aidl/vts/functional/DvrTests.cpp b/tv/tuner/aidl/vts/functional/DvrTests.cpp index e35609977b..a9c3b51063 100644 --- a/tv/tuner/aidl/vts/functional/DvrTests.cpp +++ b/tv/tuner/aidl/vts/functional/DvrTests.cpp @@ -24,26 +24,22 @@ void DvrCallback::startPlaybackInputThread(string& dataInputFile, PlaybackSettin mPlaybackSettings = settings; mPlaybackMQ = std::make_unique(playbackMQDescriptor, true /* resetPointers */); EXPECT_TRUE(mPlaybackMQ); - pthread_create(&mPlaybackThread, NULL, __threadLoopPlayback, this); - pthread_setname_np(mPlaybackThread, "test_playback_input_loop"); + + mPlaybackThread = std::thread(&DvrCallback::playbackThreadLoop, this); } void DvrCallback::stopPlaybackThread() { mPlaybackThreadRunning = false; mKeepWritingPlaybackFMQ = false; - android::Mutex::Autolock autoLock(mPlaybackThreadLock); -} - -void* DvrCallback::__threadLoopPlayback(void* user) { - DvrCallback* const self = static_cast(user); - self->playbackThreadLoop(); - return 0; + if (mPlaybackThread.joinable()) { + mPlaybackThread.join(); + } } void DvrCallback::playbackThreadLoop() { - android::Mutex::Autolock autoLock(mPlaybackThreadLock); mPlaybackThreadRunning = true; + mKeepWritingPlaybackFMQ = true; // Create the EventFlag that is used to signal the HAL impl that data have been // written into the Playback FMQ @@ -121,43 +117,31 @@ void DvrCallback::playbackThreadLoop() { } void DvrCallback::testRecordOutput() { - android::Mutex::Autolock autoLock(mMsgLock); - while (mDataOutputBuffer.empty()) { - if (-ETIMEDOUT == mMsgCondition.waitRelative(mMsgLock, WAIT_TIMEOUT)) { - EXPECT_TRUE(false) << "record output matching pid does not output within timeout"; - stopRecordThread(); - return; + bool passed = true; + { + android::Mutex::Autolock autoLock(mMsgLock); + while (mDataOutputBuffer.empty()) { + if (-ETIMEDOUT == mMsgCondition.waitRelative(mMsgLock, WAIT_TIMEOUT)) { + EXPECT_TRUE(false) << "record output matching pid does not output within timeout"; + passed = false; + break; + } } } stopRecordThread(); - ALOGW("[vts] record pass and stop"); + if (passed) ALOGW("[vts] record pass and stop"); } -void DvrCallback::startRecordOutputThread(RecordSettings recordSettings, +void DvrCallback::startRecordOutputThread(RecordSettings /* recordSettings */, MQDesc& recordMQDescriptor) { mRecordMQ = std::make_unique(recordMQDescriptor, true /* resetPointers */); EXPECT_TRUE(mRecordMQ); - struct RecordThreadArgs* threadArgs = - (struct RecordThreadArgs*)malloc(sizeof(struct RecordThreadArgs)); - threadArgs->user = this; - threadArgs->recordSettings = &recordSettings; - threadArgs->keepReadingRecordFMQ = &mKeepReadingRecordFMQ; - - pthread_create(&mRecordThread, NULL, __threadLoopRecord, (void*)threadArgs); - pthread_setname_np(mRecordThread, "test_record_input_loop"); -} -void* DvrCallback::__threadLoopRecord(void* threadArgs) { - DvrCallback* const self = - static_cast(((struct RecordThreadArgs*)threadArgs)->user); - self->recordThreadLoop(((struct RecordThreadArgs*)threadArgs)->recordSettings, - ((struct RecordThreadArgs*)threadArgs)->keepReadingRecordFMQ); - return 0; + mRecordThread = std::thread(&DvrCallback::recordThreadLoop, this); } -void DvrCallback::recordThreadLoop(RecordSettings* /*recordSettings*/, bool* keepReadingRecordFMQ) { +void DvrCallback::recordThreadLoop() { ALOGD("[vts] DvrCallback record threadLoop start."); - android::Mutex::Autolock autoLock(mRecordThreadLock); mRecordThreadRunning = true; mKeepReadingRecordFMQ = true; @@ -168,7 +152,7 @@ void DvrCallback::recordThreadLoop(RecordSettings* /*recordSettings*/, bool* kee android::OK); while (mRecordThreadRunning) { - while (*keepReadingRecordFMQ) { + while (mKeepReadingRecordFMQ) { uint32_t efState = 0; android::status_t status = recordMQEventFlag->wait( static_cast(DemuxQueueNotifyBits::DATA_READY), &efState, WAIT_TIMEOUT, @@ -206,6 +190,10 @@ bool DvrCallback::readRecordFMQ() { void DvrCallback::stopRecordThread() { mKeepReadingRecordFMQ = false; mRecordThreadRunning = false; + + if (mRecordThread.joinable()) { + mRecordThread.join(); + } } AssertionResult DvrTests::openDvrInDemux(DvrType type, int32_t bufferSize) { diff --git a/tv/tuner/aidl/vts/functional/DvrTests.h b/tv/tuner/aidl/vts/functional/DvrTests.h index bda57b3dff..6662637d54 100644 --- a/tv/tuner/aidl/vts/functional/DvrTests.h +++ b/tv/tuner/aidl/vts/functional/DvrTests.h @@ -22,9 +22,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -94,7 +96,7 @@ class DvrCallback : public BnDvrCallback { static void* __threadLoopPlayback(void* user); static void* __threadLoopRecord(void* threadArgs); void playbackThreadLoop(); - void recordThreadLoop(RecordSettings* recordSetting, bool* keepWritingPlaybackFMQ); + void recordThreadLoop(); bool readRecordFMQ(); @@ -115,16 +117,14 @@ class DvrCallback : public BnDvrCallback { std::map mFilterMQEventFlag; android::Mutex mMsgLock; - android::Mutex mPlaybackThreadLock; - android::Mutex mRecordThreadLock; android::Condition mMsgCondition; - bool mKeepWritingPlaybackFMQ = true; - bool mKeepReadingRecordFMQ = true; - bool mPlaybackThreadRunning; - bool mRecordThreadRunning; - pthread_t mPlaybackThread; - pthread_t mRecordThread; + std::atomic mKeepWritingPlaybackFMQ = true; + std::atomic mKeepReadingRecordFMQ = true; + std::atomic mPlaybackThreadRunning; + std::atomic mRecordThreadRunning; + std::thread mPlaybackThread; + std::thread mRecordThread; string mInputDataFile; PlaybackSettings mPlaybackSettings; -- GitLab From ef24c7a10dff0e20048d59026013b507cf0fcbfb Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Thu, 26 Aug 2021 16:13:41 -0700 Subject: [PATCH 128/825] Implement deleteAidingData and simulate TTFF Bug: 197671205 Test: atest GnssLocationRateChangeTest Test: atest GnssMeasurementWhenNoLocationTest Change-Id: I9b6a196a1acc24ecb30b0706b4eceba08dad90e9 --- .../utils/default/include/v2_1/GnssTemplate.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gnss/common/utils/default/include/v2_1/GnssTemplate.h b/gnss/common/utils/default/include/v2_1/GnssTemplate.h index 4e07af9853..daa72814f0 100644 --- a/gnss/common/utils/default/include/v2_1/GnssTemplate.h +++ b/gnss/common/utils/default/include/v2_1/GnssTemplate.h @@ -45,6 +45,7 @@ namespace android::hardware::gnss::common::implementation { constexpr int INPUT_BUFFER_SIZE = 128; constexpr char CMD_GET_LOCATION[] = "CMD_GET_LOCATION"; constexpr char GNSS_PATH[] = "/dev/gnss0"; +constexpr int TTFF_MILLIS = 2200; template struct GnssTemplate : public T_IGnss { @@ -130,6 +131,7 @@ struct GnssTemplate : public T_IGnss { std::atomic mHardwareModeChecked; std::atomic mGnssFd; std::thread mThread; + std::atomic mFirstFixReceived; mutable std::mutex mMutex; virtual hidl_vec filterBlocklistedSatellitesV2_1( @@ -151,7 +153,8 @@ GnssTemplate::GnssTemplate() : mMinIntervalMs(1000), mGnssConfiguration{new V2_1::implementation::GnssConfiguration()}, mHardwareModeChecked(false), - mGnssFd(-1) {} + mGnssFd(-1), + mFirstFixReceived(false) {} template GnssTemplate::~GnssTemplate() { @@ -186,6 +189,12 @@ Return GnssTemplate::start() { mIsActive = true; this->reportGnssStatusValue(V1_0::IGnssCallback::GnssStatusValue::SESSION_BEGIN); mThread = std::thread([this]() { + auto svStatus = filterBlocklistedSatellitesV2_1(Utils::getMockSvInfoListV2_1()); + this->reportSvStatus(svStatus); + if (!mFirstFixReceived) { + std::this_thread::sleep_for(std::chrono::milliseconds(TTFF_MILLIS)); + mFirstFixReceived = true; + } while (mIsActive == true) { auto svStatus = filterBlocklistedSatellitesV2_1(Utils::getMockSvInfoListV2_1()); this->reportSvStatus(svStatus); @@ -294,7 +303,7 @@ Return GnssTemplate::injectLocation(double, double, float) { template Return GnssTemplate::deleteAidingData(V1_0::IGnss::GnssAidingData) { - // TODO implement + mFirstFixReceived = false; return Void(); } -- GitLab From 80c3cc61cb455d2c26e6ab406769623d05e111a5 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 27 Aug 2021 12:55:02 -0700 Subject: [PATCH 129/825] uwb: Default HAL implementation Skeletal implementation of UWB HAL which will be used for cuttlefish/reference implementation in the future. Bug: 195992658 Test: Manual verification of HAL booting up and handling HAL API calls. Change-Id: I894b7aef893ff2ed4f287f72471326b5211245c3 --- uwb/aidl/Android.bp | 1 + uwb/aidl/default/Android.bp | 35 ++++++++++++++++++++ uwb/aidl/default/OWNERS | 2 ++ uwb/aidl/default/service.cpp | 42 +++++++++++++++++++++++ uwb/aidl/default/uwb-service.rc | 3 ++ uwb/aidl/default/uwb-service.xml | 10 ++++++ uwb/aidl/default/uwb.cpp | 55 ++++++++++++++++++++++++++++++ uwb/aidl/default/uwb.h | 49 +++++++++++++++++++++++++++ uwb/aidl/default/uwb_chip.cpp | 57 ++++++++++++++++++++++++++++++++ uwb/aidl/default/uwb_chip.h | 52 +++++++++++++++++++++++++++++ 10 files changed, 306 insertions(+) create mode 100644 uwb/aidl/default/Android.bp create mode 100644 uwb/aidl/default/OWNERS create mode 100644 uwb/aidl/default/service.cpp create mode 100644 uwb/aidl/default/uwb-service.rc create mode 100644 uwb/aidl/default/uwb-service.xml create mode 100644 uwb/aidl/default/uwb.cpp create mode 100644 uwb/aidl/default/uwb.h create mode 100644 uwb/aidl/default/uwb_chip.cpp create mode 100644 uwb/aidl/default/uwb_chip.h diff --git a/uwb/aidl/Android.bp b/uwb/aidl/Android.bp index 989815e675..5d217537ab 100755 --- a/uwb/aidl/Android.bp +++ b/uwb/aidl/Android.bp @@ -23,6 +23,7 @@ aidl_interface { enabled: true, }, apex_available: [ + "//apex_available:platform", "com.android.uwb", ], min_sdk_version: "current", diff --git a/uwb/aidl/default/Android.bp b/uwb/aidl/default/Android.bp new file mode 100644 index 0000000000..8c2b60e37d --- /dev/null +++ b/uwb/aidl/default/Android.bp @@ -0,0 +1,35 @@ +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.uwb-service", + relative_install_path: "hw", + init_rc: ["uwb-service.rc"], + vintf_fragments: ["uwb-service.xml"], + vendor: true, + cflags: [ + "-Wall", + "-Wextra", + "-g", + ], + shared_libs: [ + "liblog", + "libbinder_ndk", + ], + static_libs: [ + "libbase", + "libutils", + "android.hardware.uwb-V1-ndk", + ], + srcs: [ + "service.cpp", + "uwb.cpp", + "uwb_chip.cpp", + ], +} diff --git a/uwb/aidl/default/OWNERS b/uwb/aidl/default/OWNERS new file mode 100644 index 0000000000..c4ad4164e1 --- /dev/null +++ b/uwb/aidl/default/OWNERS @@ -0,0 +1,2 @@ +# Bug component: 1042770 +include platform/packages/modules/Uwb:/OWNERS diff --git a/uwb/aidl/default/service.cpp b/uwb/aidl/default/service.cpp new file mode 100644 index 0000000000..007637f5d1 --- /dev/null +++ b/uwb/aidl/default/service.cpp @@ -0,0 +1,42 @@ +/* + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include "uwb.h" + +using ::aidl::android::hardware::uwb::IUwb; +using ::android::sp; +using ::android::base::InitLogging; +using ::android::base::StderrLogger; +using ::android::hardware::uwb::impl::Uwb; + +int main(int /*argc*/, char* argv[]) { + InitLogging(argv, StderrLogger); + LOG(INFO) << "UWB HAL starting up"; + + ABinderProcess_setThreadPoolMaxThreadCount(0); + std::shared_ptr uwb = ndk::SharedRefBase::make(); + const std::string instance = std::string() + IUwb::descriptor + "/default"; + binder_status_t status = AServiceManager_addService(uwb->asBinder().get(), instance.c_str()); + CHECK(status == STATUS_OK); + + ABinderProcess_joinThreadPool(); + return EXIT_FAILURE; // should not reach +} diff --git a/uwb/aidl/default/uwb-service.rc b/uwb/aidl/default/uwb-service.rc new file mode 100644 index 0000000000..e2c3825d35 --- /dev/null +++ b/uwb/aidl/default/uwb-service.rc @@ -0,0 +1,3 @@ +service vendor.uwb_hal /vendor/bin/hw/android.hardware.uwb-service + class hal + user uwb diff --git a/uwb/aidl/default/uwb-service.xml b/uwb/aidl/default/uwb-service.xml new file mode 100644 index 0000000000..013d9debc3 --- /dev/null +++ b/uwb/aidl/default/uwb-service.xml @@ -0,0 +1,10 @@ + + + android.hardware.uwb + 1 + + IUwb + default + + + diff --git a/uwb/aidl/default/uwb.cpp b/uwb/aidl/default/uwb.cpp new file mode 100644 index 0000000000..1e2ef4e0a4 --- /dev/null +++ b/uwb/aidl/default/uwb.cpp @@ -0,0 +1,55 @@ +/* + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +#include "uwb.h" + +namespace { +static constexpr char kDefaultChipName[] = "default"; + +} // namespace + +namespace android { +namespace hardware { +namespace uwb { +namespace impl { +using namespace ::aidl::android::hardware::uwb; + +// The default implementation of the HAL assumes 1 chip on the device. +Uwb::Uwb() : chips_({{kDefaultChipName, ndk::SharedRefBase::make(kDefaultChipName)}}) {} + +Uwb::~Uwb() {} + +::ndk::ScopedAStatus Uwb::getChips(std::vector* names) { + for (const auto& chip : chips_) { + names->push_back(chip.first); + } + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Uwb::getChip(const std::string& name, std::shared_ptr* chip) { + const auto chip_found = chips_.find(name); + if (chip_found == chips_.end()) { + LOG(ERROR) << "Unknown chip name" << name; + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } + *chip = chip_found->second; + return ndk::ScopedAStatus::ok(); +} +} // namespace impl +} // namespace uwb +} // namespace hardware +} // namespace android diff --git a/uwb/aidl/default/uwb.h b/uwb/aidl/default/uwb.h new file mode 100644 index 0000000000..ec51fd8a5c --- /dev/null +++ b/uwb/aidl/default/uwb.h @@ -0,0 +1,49 @@ +/* + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef ANDROID_HARDWARE_UWB_UWB +#define ANDROID_HARDWARE_UWB_UWB + +#include +#include + +#include +#include + +#include "uwb_chip.h" + +namespace android { +namespace hardware { +namespace uwb { +namespace impl { +using namespace ::aidl::android::hardware::uwb; +// Default implementation mean't to be used on simulator targets. +class Uwb : public BnUwb { + public: + Uwb(); + virtual ~Uwb(); + + ::ndk::ScopedAStatus getChips(std::vector* names) override; + ::ndk::ScopedAStatus getChip(const std::string& name, std::shared_ptr* chip) override; + + private: + std::map> chips_; +}; +} // namespace impl +} // namespace uwb +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_UWB_UWB \ No newline at end of file diff --git a/uwb/aidl/default/uwb_chip.cpp b/uwb/aidl/default/uwb_chip.cpp new file mode 100644 index 0000000000..727bcf133a --- /dev/null +++ b/uwb/aidl/default/uwb_chip.cpp @@ -0,0 +1,57 @@ +/* + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "uwb.h" + +namespace android { +namespace hardware { +namespace uwb { +namespace impl { +using namespace ::aidl::android::hardware::uwb; + +UwbChip::UwbChip(const std::string& name) : name_(name) {} +UwbChip::~UwbChip() {} + +::ndk::ScopedAStatus UwbChip::getName(std::string* name) { + *name = name_; + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus UwbChip::open( + const std::shared_ptr& /* clientCallback */) { + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); +} + +::ndk::ScopedAStatus UwbChip::close() { + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); +} + +::ndk::ScopedAStatus UwbChip::coreInit() { + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); +} + +::ndk::ScopedAStatus UwbChip::getSupportedVendorUciVersion(int32_t* /* version */) { + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); +} + +::ndk::ScopedAStatus UwbChip::sendUciMessage(const std::vector& /* data */, + int32_t* /* bytes_written */) { + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); +} +} // namespace impl +} // namespace uwb +} // namespace hardware +} // namespace android diff --git a/uwb/aidl/default/uwb_chip.h b/uwb/aidl/default/uwb_chip.h new file mode 100644 index 0000000000..5d3f55cff8 --- /dev/null +++ b/uwb/aidl/default/uwb_chip.h @@ -0,0 +1,52 @@ +/* + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_HARDWARE_UWB_UWBCHIP +#define ANDROID_HARDWARE_UWB_UWBCHIP + +#include + +#include +#include + +namespace android { +namespace hardware { +namespace uwb { +namespace impl { +using namespace ::aidl::android::hardware::uwb; +// Default implementation mean't to be used on simulator targets. +class UwbChip : public BnUwbChip { + public: + UwbChip(const std::string& name); + virtual ~UwbChip(); + + ::ndk::ScopedAStatus getName(std::string* name) override; + ::ndk::ScopedAStatus open(const std::shared_ptr& clientCallback) override; + ::ndk::ScopedAStatus close() override; + ::ndk::ScopedAStatus coreInit() override; + ::ndk::ScopedAStatus getSupportedVendorUciVersion(int32_t* version) override; + ::ndk::ScopedAStatus sendUciMessage(const std::vector& data, + int32_t* bytes_written) override; + + private: + std::string name_; +}; +} // namespace impl +} // namespace uwb +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_UWB_UWBCHIP -- GitLab From d73352eab924fab1ed76442eff81f7138d8408cf Mon Sep 17 00:00:00 2001 From: Pierre Couillaud Date: Fri, 20 Aug 2021 12:15:26 +0100 Subject: [PATCH 130/825] Fix closure of record thread Bug: 197763854 Fix: 197763854 Change-Id: I8c3e843ddac6ad77aecaca7c91f0884204145ee6 --- tv/tuner/1.0/vts/functional/DvrTests.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tv/tuner/1.0/vts/functional/DvrTests.cpp b/tv/tuner/1.0/vts/functional/DvrTests.cpp index ba211894f7..599abfb0b9 100644 --- a/tv/tuner/1.0/vts/functional/DvrTests.cpp +++ b/tv/tuner/1.0/vts/functional/DvrTests.cpp @@ -204,6 +204,7 @@ bool DvrCallback::readRecordFMQ() { void DvrCallback::stopRecordThread() { mKeepReadingRecordFMQ = false; mRecordThreadRunning = false; + android::Mutex::Autolock autoLock(mRecordThreadLock); } AssertionResult DvrTests::openDvrInDemux(DvrType type, uint32_t bufferSize) { -- GitLab From 6dcf4f5c53b295e8943034c4b7d3c7a5cae818be Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Tue, 31 Aug 2021 17:45:13 -0700 Subject: [PATCH 131/825] Update use of a.m.a.c.AudioConfig in sthal_cli_3 Bug: 188932434 Test: m sthal_cli_3 Change-Id: Ifcc94ecfa7aa9d9a5292f45a35083c4681223529 --- .../android/hardware/soundtrigger3/cli/SthalCli.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 2922e8369b..0fd1dda73d 100644 --- a/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java +++ b/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java @@ -21,6 +21,7 @@ import android.hardware.soundtrigger3.ISoundTriggerHwCallback; import android.hardware.soundtrigger3.ISoundTriggerHwGlobalCallback; import android.media.audio.common.AudioChannelLayout; import android.media.audio.common.AudioConfig; +import android.media.audio.common.AudioConfigBase; import android.media.audio.common.AudioFormatDescription; import android.media.audio.common.AudioFormatType; import android.media.audio.common.PcmType; @@ -348,11 +349,12 @@ public class SthalCli { private static AudioConfig createConfig() { AudioConfig config = new AudioConfig(); - config.channelMask = AudioChannelLayout.layoutMask(AudioChannelLayout.LAYOUT_MONO); - config.format = new AudioFormatDescription(); - config.format.type = AudioFormatType.PCM; - config.format.pcm = PcmType.INT_16_BIT; - config.sampleRateHz = 16000; + config.base = new AudioConfigBase(); + config.base.channelMask = AudioChannelLayout.layoutMask(AudioChannelLayout.LAYOUT_MONO); + config.base.format = new AudioFormatDescription(); + config.base.format.type = AudioFormatType.PCM; + config.base.format.pcm = PcmType.INT_16_BIT; + config.base.sampleRate = 16000; return config; } } -- GitLab From 4e5a846681de866b736b8c8bee37600a30ff9636 Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Mon, 14 Jun 2021 11:26:00 -0700 Subject: [PATCH 132/825] Create IRadio AIDL Create IRadio AIDL from HIDL versions 1.0-1.6 using the hidl2aidl tool. This is just a skeleton implementation to allow 1.7 APIs to be added to the AIDL interface. Changes to the API surface and modularization to come after this change is merged. Test: build Bug: 198331182 Change-Id: Ice71b7c159b98de8b36124f379167fb579a4ea2f --- .../compatibility_matrix.current.xml | 10 + radio/aidl/Android.bp | 54 + .../android/hardware/radio/AccessNetwork.aidl | 44 + .../hardware/radio/ActivityStatsInfo.aidl | 41 + .../hardware/radio/AddressProperty.aidl | 39 + .../android/hardware/radio/ApnAuthType.aidl | 41 + .../android/hardware/radio/ApnTypes.aidl | 51 + .../android/hardware/radio/AppState.aidl | 43 + .../android/hardware/radio/AppStatus.aidl | 45 + .../android/hardware/radio/AppType.aidl | 43 + .../android/hardware/radio/AudioQuality.aidl | 47 + .../android/hardware/radio/BarringInfo.aidl | 40 + .../radio/BarringInfoBarringType.aidl | 40 + .../BarringInfoBarringTypeSpecificInfo.aidl | 39 + ...nfoBarringTypeSpecificInfoConditional.aidl | 40 + .../radio/BarringInfoServiceType.aidl | 79 + .../current/android/hardware/radio/Call.aidl | 52 + .../hardware/radio/CallForwardInfo.aidl | 43 + .../hardware/radio/CallForwardInfoStatus.aidl | 42 + .../hardware/radio/CallPresentation.aidl | 41 + .../android/hardware/radio/CallState.aidl | 43 + .../hardware/radio/CardPowerState.aidl | 40 + .../android/hardware/radio/CardState.aidl | 41 + .../android/hardware/radio/CardStatus.aidl | 47 + .../android/hardware/radio/Carrier.aidl | 41 + .../hardware/radio/CarrierMatchType.aidl | 42 + .../hardware/radio/CarrierRestrictions.aidl | 39 + .../CarrierRestrictionsWithPriority.aidl | 40 + .../radio/CdmaBroadcastSmsConfigInfo.aidl | 40 + .../hardware/radio/CdmaCallWaiting.aidl | 43 + .../radio/CdmaCallWaitingNumberPlan.aidl | 43 + .../CdmaCallWaitingNumberPresentation.aidl | 40 + .../radio/CdmaCallWaitingNumberType.aidl | 42 + .../hardware/radio/CdmaDisplayInfoRecord.aidl | 38 + .../hardware/radio/CdmaInfoRecName.aidl | 48 + .../hardware/radio/CdmaInformationRecord.aidl | 45 + .../radio/CdmaInformationRecords.aidl | 38 + .../radio/CdmaLineControlInfoRecord.aidl | 41 + .../hardware/radio/CdmaNumberInfoRecord.aidl | 42 + .../radio/CdmaOtaProvisionStatus.aidl | 49 + .../CdmaRedirectingNumberInfoRecord.aidl | 39 + .../hardware/radio/CdmaRedirectingReason.aidl | 44 + .../hardware/radio/CdmaRoamingType.aidl | 40 + .../hardware/radio/CdmaSignalInfoRecord.aidl | 41 + .../hardware/radio/CdmaSignalStrength.aidl | 39 + .../android/hardware/radio/CdmaSmsAck.aidl | 39 + .../hardware/radio/CdmaSmsAddress.aidl | 42 + .../hardware/radio/CdmaSmsDigitMode.aidl | 39 + .../hardware/radio/CdmaSmsErrorClass.aidl | 39 + .../hardware/radio/CdmaSmsMessage.aidl | 43 + .../hardware/radio/CdmaSmsNumberMode.aidl | 39 + .../hardware/radio/CdmaSmsNumberPlan.aidl | 53 + .../hardware/radio/CdmaSmsNumberType.aidl | 45 + .../hardware/radio/CdmaSmsSubaddress.aidl | 40 + .../hardware/radio/CdmaSmsSubaddressType.aidl | 39 + .../hardware/radio/CdmaSmsWriteArgs.aidl | 39 + .../radio/CdmaSmsWriteArgsStatus.aidl | 41 + .../radio/CdmaSubscriptionSource.aidl | 39 + .../radio/CdmaT53AudioControlInfoRecord.aidl | 39 + .../hardware/radio/CdmaT53ClirInfoRecord.aidl | 38 + .../android/hardware/radio/CellConfigLte.aidl | 38 + .../hardware/radio/CellConnectionStatus.aidl | 40 + .../android/hardware/radio/CellIdentity.aidl | 44 + .../hardware/radio/CellIdentityCdma.aidl | 43 + .../hardware/radio/CellIdentityGsm.aidl | 45 + .../hardware/radio/CellIdentityLte.aidl | 48 + .../hardware/radio/CellIdentityNr.aidl | 46 + .../radio/CellIdentityOperatorNames.aidl | 39 + .../hardware/radio/CellIdentityTdscdma.aidl | 46 + .../hardware/radio/CellIdentityWcdma.aidl | 46 + .../android/hardware/radio/CellInfo.aidl | 40 + .../android/hardware/radio/CellInfoCdma.aidl | 40 + .../CellInfoCellInfoRatSpecificInfo.aidl | 43 + .../android/hardware/radio/CellInfoGsm.aidl | 39 + .../android/hardware/radio/CellInfoInfo.aidl | 43 + .../android/hardware/radio/CellInfoLte.aidl | 39 + .../android/hardware/radio/CellInfoNr.aidl | 39 + .../hardware/radio/CellInfoTdscdma.aidl | 39 + .../android/hardware/radio/CellInfoType.aidl | 43 + .../android/hardware/radio/CellInfoWcdma.aidl | 39 + .../android/hardware/radio/CfData.aidl | 38 + .../android/hardware/radio/ClipStatus.aidl | 40 + .../current/android/hardware/radio/Clir.aidl | 40 + .../radio/ClosedSubscriberGroupInfo.aidl | 40 + .../hardware/radio/DataCallFailCause.aidl | 377 + .../hardware/radio/DataConnActiveStatus.aidl | 40 + .../android/hardware/radio/DataProfileId.aidl | 44 + .../hardware/radio/DataProfileInfo.aidl | 55 + .../hardware/radio/DataProfileInfoType.aidl | 40 + .../hardware/radio/DataRegStateResult.aidl | 44 + .../radio/DataRegStateResultVopsInfo.aidl | 39 + .../hardware/radio/DataRequestReason.aidl | 40 + .../hardware/radio/DataThrottlingAction.aidl | 41 + .../hardware/radio/DeviceStateType.aidl | 40 + .../current/android/hardware/radio/Dial.aidl | 40 + .../android/hardware/radio/Domain.aidl | 39 + .../android/hardware/radio/EmcIndicator.aidl | 41 + .../hardware/radio/EmergencyCallRouting.aidl | 40 + .../hardware/radio/EmergencyNumber.aidl | 43 + .../hardware/radio/EmergencyNumberSource.aidl | 41 + .../radio/EmergencyServiceCategory.aidl | 45 + .../android/hardware/radio/EmfIndicator.aidl | 41 + .../android/hardware/radio/EpsQos.aidl | 40 + .../android/hardware/radio/EutranBands.aidl | 97 + .../hardware/radio/EvdoSignalStrength.aidl | 40 + .../hardware/radio/FrequencyRange.aidl | 41 + .../android/hardware/radio/GeranBands.aidl | 51 + .../radio/GsmBroadcastSmsConfigInfo.aidl | 42 + .../hardware/radio/GsmSignalStrength.aidl | 40 + .../android/hardware/radio/GsmSmsMessage.aidl | 39 + .../hardware/radio/HandoverFailureMode.aidl | 41 + .../hardware/radio/HardwareConfig.aidl | 42 + .../hardware/radio/HardwareConfigModem.aidl | 42 + .../hardware/radio/HardwareConfigSim.aidl | 38 + .../hardware/radio/HardwareConfigState.aidl | 40 + .../hardware/radio/HardwareConfigType.aidl | 39 + .../android/hardware/radio/IRadio.aidl | 200 + .../hardware/radio/IRadioIndication.aidl | 94 + .../hardware/radio/IRadioResponse.aidl | 199 + .../current/android/hardware/radio/ISap.aidl | 46 + .../android/hardware/radio/ISapCallback.aidl | 48 + .../current/android/hardware/radio/IccIo.aidl | 46 + .../android/hardware/radio/IccIoResult.aidl | 40 + .../android/hardware/radio/ImsSmsMessage.aidl | 42 + .../hardware/radio/ImsiEncryptionInfo.aidl | 43 + .../IncrementalResultsPeriodicityRange.aidl | 39 + .../hardware/radio/IndicationFilter.aidl | 46 + .../hardware/radio/KeepaliveRequest.aidl | 44 + .../hardware/radio/KeepaliveStatus.aidl | 39 + .../hardware/radio/KeepaliveStatusCode.aidl | 40 + .../android/hardware/radio/KeepaliveType.aidl | 39 + .../hardware/radio/LastCallFailCause.aidl | 133 + .../hardware/radio/LastCallFailCauseInfo.aidl | 39 + .../android/hardware/radio/LceDataInfo.aidl | 40 + .../android/hardware/radio/LceStatus.aidl | 40 + .../android/hardware/radio/LceStatusInfo.aidl | 39 + .../android/hardware/radio/LinkAddress.aidl | 41 + .../hardware/radio/LinkCapacityEstimate.aidl | 41 + .../hardware/radio/LteSignalStrength.aidl | 44 + .../android/hardware/radio/LteVopsInfo.aidl | 39 + .../hardware/radio/MaxSearchTimeRange.aidl | 39 + .../android/hardware/radio/MaybePort.aidl | 39 + .../android/hardware/radio/MvnoType.aidl | 41 + .../hardware/radio/NeighboringCell.aidl | 39 + .../hardware/radio/NetworkScanRequest.aidl | 44 + .../hardware/radio/NetworkScanResult.aidl | 40 + .../android/hardware/radio/NgranBands.aidl | 90 + .../radio/NrDualConnectivityState.aidl | 40 + .../android/hardware/radio/NrIndicators.aidl | 40 + .../current/android/hardware/radio/NrQos.aidl | 42 + .../hardware/radio/NrSignalStrength.aidl | 45 + .../android/hardware/radio/NrVopsInfo.aidl | 40 + .../android/hardware/radio/NvItem.aidl | 78 + .../android/hardware/radio/NvWriteItem.aidl | 39 + .../android/hardware/radio/OperatorInfo.aidl | 41 + .../hardware/radio/OperatorStatus.aidl | 41 + .../hardware/radio/OptionalCsgInfo.aidl | 39 + .../android/hardware/radio/OptionalDnn.aidl | 39 + .../hardware/radio/OptionalOsAppId.aidl | 39 + .../radio/OptionalPdpProtocolType.aidl | 39 + .../hardware/radio/OptionalSliceInfo.aidl | 39 + .../hardware/radio/OptionalSscMode.aidl | 39 + .../radio/OptionalTrafficDescriptor.aidl | 39 + .../android/hardware/radio/OsAppId.aidl | 38 + .../android/hardware/radio/P2Constant.aidl | 38 + .../hardware/radio/PbReceivedStatus.aidl | 41 + .../android/hardware/radio/PcoDataInfo.aidl | 41 + .../hardware/radio/PdpProtocolType.aidl | 44 + .../android/hardware/radio/PersoSubstate.aidl | 72 + .../hardware/radio/PhoneRestrictedState.aidl | 42 + .../hardware/radio/PhonebookCapacity.aidl | 47 + .../hardware/radio/PhonebookRecordInfo.aidl | 42 + .../hardware/radio/PhysicalChannelConfig.aidl | 46 + .../radio/PhysicalChannelConfigBand.aidl | 42 + .../android/hardware/radio/PinState.aidl | 43 + .../android/hardware/radio/PortRange.aidl | 39 + .../hardware/radio/PreferredNetworkType.aidl | 60 + .../android/hardware/radio/PrlIndicator.aidl | 40 + .../android/hardware/radio/PublicKeyType.aidl | 39 + .../current/android/hardware/radio/Qos.aidl | 40 + .../android/hardware/radio/QosBandwidth.aidl | 39 + .../android/hardware/radio/QosFilter.aidl | 47 + .../hardware/radio/QosFilterDirection.aidl | 40 + .../hardware/radio/QosFilterIpsecSpi.aidl | 39 + .../radio/QosFilterIpv6FlowLabel.aidl | 39 + .../radio/QosFilterTypeOfService.aidl | 39 + .../hardware/radio/QosFlowIdRange.aidl | 39 + .../android/hardware/radio/QosPortRange.aidl | 39 + .../android/hardware/radio/QosProtocol.aidl | 42 + .../android/hardware/radio/QosSession.aidl | 40 + .../hardware/radio/RadioAccessFamily.aidl | 57 + .../hardware/radio/RadioAccessNetworks.aidl | 43 + .../hardware/radio/RadioAccessSpecifier.aidl | 40 + .../radio/RadioAccessSpecifierBands.aidl | 42 + .../android/hardware/radio/RadioBandMode.aidl | 56 + .../hardware/radio/RadioCapability.aidl | 42 + .../hardware/radio/RadioCapabilityPhase.aidl | 42 + .../hardware/radio/RadioCapabilityStatus.aidl | 40 + .../hardware/radio/RadioCdmaSmsConst.aidl | 52 + .../android/hardware/radio/RadioConst.aidl | 51 + .../android/hardware/radio/RadioError.aidl | 126 + .../hardware/radio/RadioFrequencyInfo.aidl | 40 + .../hardware/radio/RadioIndicationType.aidl | 39 + .../hardware/radio/RadioResponseInfo.aidl | 40 + .../radio/RadioResponseInfoModem.aidl | 41 + .../hardware/radio/RadioResponseType.aidl | 40 + .../android/hardware/radio/RadioState.aidl | 40 + .../hardware/radio/RadioTechnology.aidl | 58 + .../hardware/radio/RadioTechnologyFamily.aidl | 39 + .../android/hardware/radio/RegState.aidl | 47 + .../hardware/radio/RegStateResult.aidl | 43 + ...ateResultAccessTechnologySpecificInfo.aidl | 42 + ...ySpecificInfoCdma2000RegistrationInfo.aidl | 41 + ...ogySpecificInfoEutranRegistrationInfo.aidl | 39 + .../hardware/radio/RegistrationFailCause.aidl | 89 + .../android/hardware/radio/ResetNvType.aidl | 40 + .../hardware/radio/RestrictedState.aidl | 42 + .../radio/RouteSelectionDescriptor.aidl | 42 + .../android/hardware/radio/SapApduType.aidl | 39 + .../android/hardware/radio/SapConnectRsp.aidl | 42 + .../hardware/radio/SapDisconnectType.aidl | 39 + .../android/hardware/radio/SapResultCode.aidl | 45 + .../android/hardware/radio/SapStatus.aidl | 43 + .../hardware/radio/SapTransferProtocol.aidl | 39 + .../hardware/radio/ScanIntervalRange.aidl | 39 + .../android/hardware/radio/ScanStatus.aidl | 39 + .../android/hardware/radio/ScanType.aidl | 39 + .../android/hardware/radio/SelectUiccSub.aidl | 41 + .../android/hardware/radio/SendSmsResult.aidl | 40 + .../hardware/radio/SetupDataCallResult.aidl | 55 + .../hardware/radio/SignalMeasurementType.aidl | 45 + .../hardware/radio/SignalStrength.aidl | 44 + .../hardware/radio/SignalThresholdInfo.aidl | 42 + .../android/hardware/radio/SimApdu.aidl | 44 + .../hardware/radio/SimLockMultiSimPolicy.aidl | 39 + .../hardware/radio/SimRefreshResult.aidl | 40 + .../hardware/radio/SimRefreshType.aidl | 40 + .../android/hardware/radio/SliceInfo.aidl | 42 + .../hardware/radio/SliceServiceType.aidl | 41 + .../android/hardware/radio/SliceStatus.aidl | 43 + .../android/hardware/radio/SlicingConfig.aidl | 39 + .../radio/SmsAcknowledgeFailCause.aidl | 39 + .../android/hardware/radio/SmsWriteArgs.aidl | 40 + .../hardware/radio/SmsWriteArgsStatus.aidl | 41 + .../android/hardware/radio/SrvccState.aidl | 41 + .../android/hardware/radio/SsInfoData.aidl | 38 + .../android/hardware/radio/SsRequestType.aidl | 42 + .../android/hardware/radio/SsServiceType.aidl | 56 + .../hardware/radio/SsTeleserviceType.aidl | 43 + .../android/hardware/radio/SscMode.aidl | 40 + .../hardware/radio/StkCcUnsolSsResult.aidl | 44 + .../hardware/radio/SubscriptionType.aidl | 40 + .../hardware/radio/SuppServiceClass.aidl | 47 + .../hardware/radio/SuppSvcNotification.aidl | 42 + .../hardware/radio/TdscdmaSignalStrength.aidl | 40 + .../android/hardware/radio/TimeStampType.aidl | 42 + .../hardware/radio/TrafficDescriptor.aidl | 39 + .../android/hardware/radio/TtyMode.aidl | 41 + .../hardware/radio/UiccSubActStatus.aidl | 39 + .../android/hardware/radio/UrspRule.aidl | 40 + .../android/hardware/radio/UssdModeType.aidl | 43 + .../android/hardware/radio/UtranBands.aidl | 63 + .../android/hardware/radio/UusDcs.aidl | 42 + .../android/hardware/radio/UusInfo.aidl | 40 + .../android/hardware/radio/UusType.aidl | 44 + .../hardware/radio/VoiceRegStateResult.aidl | 45 + .../android/hardware/radio/VopsIndicator.aidl | 40 + .../hardware/radio/WcdmaSignalStrength.aidl | 41 + .../android/hardware/radio/AccessNetwork.aidl | 51 + .../hardware/radio/ActivityStatsInfo.aidl | 44 + .../hardware/radio/AddressProperty.aidl | 31 + .../android/hardware/radio/ApnAuthType.aidl | 38 + .../aidl/android/hardware/radio/ApnTypes.aidl | 81 + .../aidl/android/hardware/radio/AppState.aidl | 37 + .../android/hardware/radio/AppStatus.aidl | 43 + .../aidl/android/hardware/radio/AppType.aidl | 28 + .../android/hardware/radio/AudioQuality.aidl | 66 + .../android/hardware/radio/BarringInfo.aidl | 42 + .../radio/BarringInfoBarringType.aidl | 34 + .../BarringInfoBarringTypeSpecificInfo.aidl | 31 + ...nfoBarringTypeSpecificInfoConditional.aidl | 41 + .../radio/BarringInfoServiceType.aidl | 100 + radio/aidl/android/hardware/radio/Call.aidl | 75 + .../hardware/radio/CallForwardInfo.aidl | 49 + .../hardware/radio/CallForwardInfoStatus.aidl | 27 + .../hardware/radio/CallPresentation.aidl | 26 + .../android/hardware/radio/CallState.aidl | 40 + .../hardware/radio/CardPowerState.aidl | 25 + .../android/hardware/radio/CardState.aidl | 37 + .../android/hardware/radio/CardStatus.aidl | 71 + .../aidl/android/hardware/radio/Carrier.aidl | 31 + .../hardware/radio/CarrierMatchType.aidl | 42 + .../hardware/radio/CarrierRestrictions.aidl | 33 + .../CarrierRestrictionsWithPriority.aidl | 42 + .../radio/CdmaBroadcastSmsConfigInfo.aidl | 35 + .../hardware/radio/CdmaCallWaiting.aidl | 44 + .../radio/CdmaCallWaitingNumberPlan.aidl | 28 + .../CdmaCallWaitingNumberPresentation.aidl | 25 + .../radio/CdmaCallWaitingNumberType.aidl | 27 + .../hardware/radio/CdmaDisplayInfoRecord.aidl | 32 + .../hardware/radio/CdmaInfoRecName.aidl | 36 + .../hardware/radio/CdmaInformationRecord.aidl | 63 + .../radio/CdmaInformationRecords.aidl | 27 + .../radio/CdmaLineControlInfoRecord.aidl | 28 + .../hardware/radio/CdmaNumberInfoRecord.aidl | 34 + .../radio/CdmaOtaProvisionStatus.aidl | 34 + .../CdmaRedirectingNumberInfoRecord.aidl | 29 + .../hardware/radio/CdmaRedirectingReason.aidl | 32 + .../hardware/radio/CdmaRoamingType.aidl | 25 + .../hardware/radio/CdmaSignalInfoRecord.aidl | 40 + .../hardware/radio/CdmaSignalStrength.aidl | 31 + .../android/hardware/radio/CdmaSmsAck.aidl | 29 + .../hardware/radio/CdmaSmsAddress.aidl | 53 + .../hardware/radio/CdmaSmsDigitMode.aidl | 27 + .../hardware/radio/CdmaSmsErrorClass.aidl | 24 + .../hardware/radio/CdmaSmsMessage.aidl | 33 + .../hardware/radio/CdmaSmsNumberMode.aidl | 24 + .../hardware/radio/CdmaSmsNumberPlan.aidl | 47 + .../hardware/radio/CdmaSmsNumberType.aidl | 43 + .../hardware/radio/CdmaSmsSubaddress.aidl | 32 + .../hardware/radio/CdmaSmsSubaddressType.aidl | 30 + .../hardware/radio/CdmaSmsWriteArgs.aidl | 29 + .../radio/CdmaSmsWriteArgsStatus.aidl | 26 + .../radio/CdmaSubscriptionSource.aidl | 24 + .../radio/CdmaT53AudioControlInfoRecord.aidl | 26 + .../hardware/radio/CdmaT53ClirInfoRecord.aidl | 25 + .../android/hardware/radio/CellConfigLte.aidl | 31 + .../hardware/radio/CellConnectionStatus.aidl | 34 + .../android/hardware/radio/CellIdentity.aidl | 38 + .../hardware/radio/CellIdentityCdma.aidl | 48 + .../hardware/radio/CellIdentityGsm.aidl | 52 + .../hardware/radio/CellIdentityLte.aidl | 66 + .../hardware/radio/CellIdentityNr.aidl | 67 + .../radio/CellIdentityOperatorNames.aidl | 29 + .../hardware/radio/CellIdentityTdscdma.aidl | 57 + .../hardware/radio/CellIdentityWcdma.aidl | 57 + .../aidl/android/hardware/radio/CellInfo.aidl | 33 + .../android/hardware/radio/CellInfoCdma.aidl | 28 + .../CellInfoCellInfoRatSpecificInfo.aidl | 40 + .../android/hardware/radio/CellInfoGsm.aidl | 26 + .../android/hardware/radio/CellInfoInfo.aidl | 34 + .../android/hardware/radio/CellInfoLte.aidl | 26 + .../android/hardware/radio/CellInfoNr.aidl | 26 + .../hardware/radio/CellInfoTdscdma.aidl | 26 + .../android/hardware/radio/CellInfoType.aidl | 28 + .../android/hardware/radio/CellInfoWcdma.aidl | 26 + radio/aidl/android/hardware/radio/CfData.aidl | 28 + .../android/hardware/radio/ClipStatus.aidl | 34 + radio/aidl/android/hardware/radio/Clir.aidl | 34 + .../radio/ClosedSubscriberGroupInfo.aidl | 41 + .../hardware/radio/DataCallFailCause.aidl | 1303 +++ .../hardware/radio/DataConnActiveStatus.aidl | 37 + .../android/hardware/radio/DataProfileId.aidl | 32 + .../hardware/radio/DataProfileInfo.aidl | 103 + .../hardware/radio/DataProfileInfoType.aidl | 25 + .../hardware/radio/DataRegStateResult.aidl | 63 + .../radio/DataRegStateResultVopsInfo.aidl | 28 + .../hardware/radio/DataRequestReason.aidl | 35 + .../hardware/radio/DataThrottlingAction.aidl | 40 + .../hardware/radio/DeviceStateType.aidl | 37 + radio/aidl/android/hardware/radio/Dial.aidl | 30 + radio/aidl/android/hardware/radio/Domain.aidl | 30 + .../android/hardware/radio/EmcIndicator.aidl | 41 + .../hardware/radio/EmergencyCallRouting.aidl | 38 + .../hardware/radio/EmergencyNumber.aidl | 73 + .../hardware/radio/EmergencyNumberSource.aidl | 44 + .../radio/EmergencyServiceCategory.aidl | 55 + .../android/hardware/radio/EmfIndicator.aidl | 41 + radio/aidl/android/hardware/radio/EpsQos.aidl | 34 + .../android/hardware/radio/EutranBands.aidl | 85 + .../hardware/radio/EvdoSignalStrength.aidl | 36 + .../hardware/radio/FrequencyRange.aidl | 41 + .../android/hardware/radio/GeranBands.aidl | 36 + .../radio/GsmBroadcastSmsConfigInfo.aidl | 53 + .../hardware/radio/GsmSignalStrength.aidl | 33 + .../android/hardware/radio/GsmSmsMessage.aidl | 31 + .../hardware/radio/HandoverFailureMode.aidl | 44 + .../hardware/radio/HardwareConfig.aidl | 42 + .../hardware/radio/HardwareConfigModem.aidl | 29 + .../hardware/radio/HardwareConfigSim.aidl | 25 + .../hardware/radio/HardwareConfigState.aidl | 25 + .../hardware/radio/HardwareConfigType.aidl | 24 + radio/aidl/android/hardware/radio/IRadio.aidl | 2073 +++++ .../hardware/radio/IRadioIndication.aidl | 632 ++ .../hardware/radio/IRadioResponse.aidl | 3055 +++++++ radio/aidl/android/hardware/radio/ISap.aidl | 95 + .../android/hardware/radio/ISapCallback.aidl | 152 + radio/aidl/android/hardware/radio/IccIo.aidl | 55 + .../android/hardware/radio/IccIoResult.aidl | 28 + .../android/hardware/radio/ImsSmsMessage.aidl | 45 + .../hardware/radio/ImsiEncryptionInfo.aidl | 57 + .../IncrementalResultsPeriodicityRange.aidl | 27 + .../hardware/radio/IndicationFilter.aidl | 69 + .../hardware/radio/KeepaliveRequest.aidl | 54 + .../hardware/radio/KeepaliveStatus.aidl | 31 + .../hardware/radio/KeepaliveStatusCode.aidl | 35 + .../android/hardware/radio/KeepaliveType.aidl | 30 + .../hardware/radio/LastCallFailCause.aidl | 177 + .../hardware/radio/LastCallFailCauseInfo.aidl | 25 + .../android/hardware/radio/LceDataInfo.aidl | 34 + .../android/hardware/radio/LceStatus.aidl | 25 + .../android/hardware/radio/LceStatusInfo.aidl | 28 + .../android/hardware/radio/LinkAddress.aidl | 51 + .../hardware/radio/LinkCapacityEstimate.aidl | 53 + .../hardware/radio/LteSignalStrength.aidl | 59 + .../android/hardware/radio/LteVopsInfo.aidl | 42 + .../hardware/radio/MaxSearchTimeRange.aidl | 27 + .../android/hardware/radio/MaybePort.aidl | 28 + .../aidl/android/hardware/radio/MvnoType.aidl | 38 + .../hardware/radio/NeighboringCell.aidl | 30 + .../hardware/radio/NetworkScanRequest.aidl | 60 + .../hardware/radio/NetworkScanResult.aidl | 37 + .../android/hardware/radio/NgranBands.aidl | 84 + .../radio/NrDualConnectivityState.aidl | 40 + .../android/hardware/radio/NrIndicators.aidl | 43 + radio/aidl/android/hardware/radio/NrQos.aidl | 40 + .../hardware/radio/NrSignalStrength.aidl | 73 + .../android/hardware/radio/NrVopsInfo.aidl | 54 + radio/aidl/android/hardware/radio/NvItem.aidl | 191 + .../android/hardware/radio/NvWriteItem.aidl | 25 + .../android/hardware/radio/OperatorInfo.aidl | 36 + .../hardware/radio/OperatorStatus.aidl | 26 + .../hardware/radio/OptionalCsgInfo.aidl | 31 + .../android/hardware/radio/OptionalDnn.aidl | 27 + .../hardware/radio/OptionalOsAppId.aidl | 28 + .../radio/OptionalPdpProtocolType.aidl | 28 + .../hardware/radio/OptionalSliceInfo.aidl | 28 + .../hardware/radio/OptionalSscMode.aidl | 28 + .../radio/OptionalTrafficDescriptor.aidl | 28 + .../aidl/android/hardware/radio/OsAppId.aidl | 29 + .../android/hardware/radio/P2Constant.aidl | 26 + .../hardware/radio/PbReceivedStatus.aidl | 44 + .../android/hardware/radio/PcoDataInfo.aidl | 39 + .../hardware/radio/PdpProtocolType.aidl | 53 + .../android/hardware/radio/PersoSubstate.aidl | 98 + .../hardware/radio/PhoneRestrictedState.aidl | 42 + .../hardware/radio/PhonebookCapacity.aidl | 61 + .../hardware/radio/PhonebookRecordInfo.aidl | 45 + .../hardware/radio/PhysicalChannelConfig.aidl | 68 + .../radio/PhysicalChannelConfigBand.aidl | 43 + .../aidl/android/hardware/radio/PinState.aidl | 28 + .../android/hardware/radio/PortRange.aidl | 28 + .../hardware/radio/PreferredNetworkType.aidl | 114 + .../android/hardware/radio/PrlIndicator.aidl | 25 + .../android/hardware/radio/PublicKeyType.aidl | 33 + radio/aidl/android/hardware/radio/Qos.aidl | 30 + .../android/hardware/radio/QosBandwidth.aidl | 29 + .../android/hardware/radio/QosFilter.aidl | 69 + .../hardware/radio/QosFilterDirection.aidl | 25 + .../hardware/radio/QosFilterIpsecSpi.aidl | 23 + .../radio/QosFilterIpv6FlowLabel.aidl | 23 + .../radio/QosFilterTypeOfService.aidl | 23 + .../hardware/radio/QosFlowIdRange.aidl | 27 + .../android/hardware/radio/QosPortRange.aidl | 27 + .../android/hardware/radio/QosProtocol.aidl | 45 + .../android/hardware/radio/QosSession.aidl | 39 + .../hardware/radio/RadioAccessFamily.aidl | 47 + .../hardware/radio/RadioAccessNetworks.aidl | 43 + .../hardware/radio/RadioAccessSpecifier.aidl | 37 + .../radio/RadioAccessSpecifierBands.aidl | 43 + .../android/hardware/radio/RadioBandMode.aidl | 98 + .../hardware/radio/RadioCapability.aidl | 40 + .../hardware/radio/RadioCapabilityPhase.aidl | 47 + .../hardware/radio/RadioCapabilityStatus.aidl | 36 + .../hardware/radio/RadioCdmaSmsConst.aidl | 37 + .../android/hardware/radio/RadioConst.aidl | 36 + .../android/hardware/radio/RadioError.aidl | 299 + .../hardware/radio/RadioFrequencyInfo.aidl | 32 + .../hardware/radio/RadioIndicationType.aidl | 24 + .../hardware/radio/RadioResponseInfo.aidl | 36 + .../radio/RadioResponseInfoModem.aidl | 40 + .../hardware/radio/RadioResponseType.aidl | 25 + .../android/hardware/radio/RadioState.aidl | 34 + .../hardware/radio/RadioTechnology.aidl | 52 + .../hardware/radio/RadioTechnologyFamily.aidl | 30 + .../aidl/android/hardware/radio/RegState.aidl | 67 + .../hardware/radio/RegStateResult.aidl | 60 + ...ateResultAccessTechnologySpecificInfo.aidl | 38 + ...ySpecificInfoCdma2000RegistrationInfo.aidl | 44 + ...ogySpecificInfoEutranRegistrationInfo.aidl | 35 + .../hardware/radio/RegistrationFailCause.aidl | 189 + .../android/hardware/radio/ResetNvType.aidl | 34 + .../hardware/radio/RestrictedState.aidl | 27 + .../radio/RouteSelectionDescriptor.aidl | 46 + .../android/hardware/radio/SapApduType.aidl | 24 + .../android/hardware/radio/SapConnectRsp.aidl | 27 + .../hardware/radio/SapDisconnectType.aidl | 24 + .../android/hardware/radio/SapResultCode.aidl | 30 + .../android/hardware/radio/SapStatus.aidl | 28 + .../hardware/radio/SapTransferProtocol.aidl | 24 + .../hardware/radio/ScanIntervalRange.aidl | 27 + .../android/hardware/radio/ScanStatus.aidl | 30 + .../aidl/android/hardware/radio/ScanType.aidl | 30 + .../android/hardware/radio/SelectUiccSub.aidl | 31 + .../android/hardware/radio/SendSmsResult.aidl | 35 + .../hardware/radio/SetupDataCallResult.aidl | 117 + .../hardware/radio/SignalMeasurementType.aidl | 83 + .../hardware/radio/SignalStrength.aidl | 64 + .../hardware/radio/SignalThresholdInfo.aidl | 51 + .../aidl/android/hardware/radio/SimApdu.aidl | 51 + .../hardware/radio/SimLockMultiSimPolicy.aidl | 32 + .../hardware/radio/SimRefreshResult.aidl | 35 + .../hardware/radio/SimRefreshType.aidl | 34 + .../android/hardware/radio/SliceInfo.aidl | 53 + .../hardware/radio/SliceServiceType.aidl | 41 + .../android/hardware/radio/SliceStatus.aidl | 43 + .../android/hardware/radio/SlicingConfig.aidl | 35 + .../radio/SmsAcknowledgeFailCause.aidl | 24 + .../android/hardware/radio/SmsWriteArgs.aidl | 37 + .../hardware/radio/SmsWriteArgsStatus.aidl | 26 + .../android/hardware/radio/SrvccState.aidl | 26 + .../android/hardware/radio/SsInfoData.aidl | 28 + .../android/hardware/radio/SsRequestType.aidl | 27 + .../android/hardware/radio/SsServiceType.aidl | 41 + .../hardware/radio/SsTeleserviceType.aidl | 28 + .../aidl/android/hardware/radio/SscMode.aidl | 28 + .../hardware/radio/StkCcUnsolSsResult.aidl | 44 + .../hardware/radio/SubscriptionType.aidl | 25 + .../hardware/radio/SuppServiceClass.aidl | 32 + .../hardware/radio/SuppSvcNotification.aidl | 43 + .../hardware/radio/TdscdmaSignalStrength.aidl | 36 + .../android/hardware/radio/TimeStampType.aidl | 27 + .../hardware/radio/TrafficDescriptor.aidl | 37 + .../android/hardware/radio/Translate.java | 2520 ++++++ .../aidl/android/hardware/radio/TtyMode.aidl | 32 + .../hardware/radio/UiccSubActStatus.aidl | 24 + .../aidl/android/hardware/radio/UrspRule.aidl | 40 + .../android/hardware/radio/UssdModeType.aidl | 46 + .../android/hardware/radio/UtranBands.aidl | 54 + radio/aidl/android/hardware/radio/UusDcs.aidl | 47 + .../aidl/android/hardware/radio/UusInfo.aidl | 39 + .../aidl/android/hardware/radio/UusType.aidl | 32 + .../hardware/radio/VoiceRegStateResult.aidl | 94 + .../android/hardware/radio/VopsIndicator.aidl | 37 + .../hardware/radio/WcdmaSignalStrength.aidl | 39 + .../android/hardware/radio/translate-ndk.cpp | 7404 +++++++++++++++++ .../android/hardware/radio/translate-ndk.h | 699 ++ 537 files changed, 41293 insertions(+) create mode 100644 radio/aidl/Android.bp create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ActivityStatsInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AddressProperty.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ApnAuthType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ApnTypes.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AudioQuality.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoServiceType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Call.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfoStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallPresentation.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardPowerState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Carrier.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierMatchType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictions.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictionsWithPriority.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaBroadcastSmsConfigInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaiting.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaDisplayInfoRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInfoRecName.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInformationRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInformationRecords.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaLineControlInfoRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaNumberInfoRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaOtaProvisionStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingReason.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRoamingType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSignalInfoRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAck.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAddress.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsDigitMode.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsErrorClass.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsMessage.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberMode.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberPlan.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddress.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddressType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgs.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSubscriptionSource.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaT53AudioControlInfoRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaT53ClirInfoRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellConfigLte.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellConnectionStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentity.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityCdma.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityGsm.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityLte.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityNr.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityOperatorNames.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityTdscdma.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityWcdma.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoCdma.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoCellInfoRatSpecificInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoGsm.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoLte.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoNr.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoTdscdma.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoWcdma.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CfData.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ClipStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Clir.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ClosedSubscriberGroupInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataCallFailCause.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataConnActiveStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileId.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfoType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResultVopsInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRequestReason.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataThrottlingAction.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DeviceStateType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Dial.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Domain.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmcIndicator.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyCallRouting.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumber.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumberSource.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyServiceCategory.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmfIndicator.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EpsQos.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EutranBands.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EvdoSignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/FrequencyRange.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GeranBands.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GsmBroadcastSmsConfigInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GsmSignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GsmSmsMessage.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HandoverFailureMode.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfig.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigModem.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigSim.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadio.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadioIndication.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadioResponse.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ISap.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ISapCallback.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IccIo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IccIoResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ImsSmsMessage.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ImsiEncryptionInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IndicationFilter.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveRequest.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatusCode.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LastCallFailCause.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LastCallFailCauseInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceDataInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatusInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LinkAddress.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LinkCapacityEstimate.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LteSignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LteVopsInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaxSearchTimeRange.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaybePort.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MvnoType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NeighboringCell.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanRequest.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NgranBands.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrDualConnectivityState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrIndicators.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrQos.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrSignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrVopsInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NvItem.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NvWriteItem.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalCsgInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalDnn.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalOsAppId.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalPdpProtocolType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSliceInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSscMode.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalTrafficDescriptor.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OsAppId.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/P2Constant.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PbReceivedStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PcoDataInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PdpProtocolType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PersoSubstate.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhoneRestrictedState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhonebookCapacity.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhonebookRecordInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhysicalChannelConfig.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhysicalChannelConfigBand.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PinState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PortRange.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PreferredNetworkType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PrlIndicator.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PublicKeyType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Qos.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosBandwidth.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilter.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterDirection.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterIpsecSpi.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterIpv6FlowLabel.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterTypeOfService.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFlowIdRange.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosPortRange.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosProtocol.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosSession.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessNetworks.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessSpecifier.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessSpecifierBands.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioBandMode.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapability.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityPhase.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCdmaSmsConst.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioFrequencyInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfoModem.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegistrationFailCause.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ResetNvType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RestrictedState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RouteSelectionDescriptor.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapApduType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapConnectRsp.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapDisconnectType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapResultCode.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapTransferProtocol.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanIntervalRange.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SelectUiccSub.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SendSmsResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SetupDataCallResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalMeasurementType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalThresholdInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimApdu.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimLockMultiSimPolicy.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceServiceType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SlicingConfig.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsAcknowledgeFailCause.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgs.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgsStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SrvccState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsInfoData.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsRequestType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsServiceType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsTeleserviceType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SscMode.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/StkCcUnsolSsResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SubscriptionType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SuppServiceClass.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SuppSvcNotification.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TdscdmaSignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TimeStampType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TrafficDescriptor.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TtyMode.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UiccSubActStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UrspRule.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UssdModeType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UtranBands.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusDcs.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/VoiceRegStateResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/VopsIndicator.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/WcdmaSignalStrength.aidl create mode 100644 radio/aidl/android/hardware/radio/AccessNetwork.aidl create mode 100644 radio/aidl/android/hardware/radio/ActivityStatsInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/AddressProperty.aidl create mode 100644 radio/aidl/android/hardware/radio/ApnAuthType.aidl create mode 100644 radio/aidl/android/hardware/radio/ApnTypes.aidl create mode 100644 radio/aidl/android/hardware/radio/AppState.aidl create mode 100644 radio/aidl/android/hardware/radio/AppStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/AppType.aidl create mode 100644 radio/aidl/android/hardware/radio/AudioQuality.aidl create mode 100644 radio/aidl/android/hardware/radio/BarringInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/BarringInfoBarringType.aidl create mode 100644 radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.aidl create mode 100644 radio/aidl/android/hardware/radio/BarringInfoServiceType.aidl create mode 100644 radio/aidl/android/hardware/radio/Call.aidl create mode 100644 radio/aidl/android/hardware/radio/CallForwardInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/CallForwardInfoStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/CallPresentation.aidl create mode 100644 radio/aidl/android/hardware/radio/CallState.aidl create mode 100644 radio/aidl/android/hardware/radio/CardPowerState.aidl create mode 100644 radio/aidl/android/hardware/radio/CardState.aidl create mode 100644 radio/aidl/android/hardware/radio/CardStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/Carrier.aidl create mode 100644 radio/aidl/android/hardware/radio/CarrierMatchType.aidl create mode 100644 radio/aidl/android/hardware/radio/CarrierRestrictions.aidl create mode 100644 radio/aidl/android/hardware/radio/CarrierRestrictionsWithPriority.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaBroadcastSmsConfigInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaCallWaiting.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaCallWaitingNumberType.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaDisplayInfoRecord.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaInfoRecName.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaInformationRecord.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaInformationRecords.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaLineControlInfoRecord.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaNumberInfoRecord.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaOtaProvisionStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaRedirectingReason.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaRoamingType.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSignalInfoRecord.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSignalStrength.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSmsAck.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSmsAddress.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSmsDigitMode.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSmsErrorClass.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSmsMessage.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSmsNumberMode.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSmsNumberPlan.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSmsNumberType.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSmsSubaddress.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSmsSubaddressType.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSmsWriteArgs.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaSubscriptionSource.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaT53AudioControlInfoRecord.aidl create mode 100644 radio/aidl/android/hardware/radio/CdmaT53ClirInfoRecord.aidl create mode 100644 radio/aidl/android/hardware/radio/CellConfigLte.aidl create mode 100644 radio/aidl/android/hardware/radio/CellConnectionStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/CellIdentity.aidl create mode 100644 radio/aidl/android/hardware/radio/CellIdentityCdma.aidl create mode 100644 radio/aidl/android/hardware/radio/CellIdentityGsm.aidl create mode 100644 radio/aidl/android/hardware/radio/CellIdentityLte.aidl create mode 100644 radio/aidl/android/hardware/radio/CellIdentityNr.aidl create mode 100644 radio/aidl/android/hardware/radio/CellIdentityOperatorNames.aidl create mode 100644 radio/aidl/android/hardware/radio/CellIdentityTdscdma.aidl create mode 100644 radio/aidl/android/hardware/radio/CellIdentityWcdma.aidl create mode 100644 radio/aidl/android/hardware/radio/CellInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/CellInfoCdma.aidl create mode 100644 radio/aidl/android/hardware/radio/CellInfoCellInfoRatSpecificInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/CellInfoGsm.aidl create mode 100644 radio/aidl/android/hardware/radio/CellInfoInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/CellInfoLte.aidl create mode 100644 radio/aidl/android/hardware/radio/CellInfoNr.aidl create mode 100644 radio/aidl/android/hardware/radio/CellInfoTdscdma.aidl create mode 100644 radio/aidl/android/hardware/radio/CellInfoType.aidl create mode 100644 radio/aidl/android/hardware/radio/CellInfoWcdma.aidl create mode 100644 radio/aidl/android/hardware/radio/CfData.aidl create mode 100644 radio/aidl/android/hardware/radio/ClipStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/Clir.aidl create mode 100644 radio/aidl/android/hardware/radio/ClosedSubscriberGroupInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/DataCallFailCause.aidl create mode 100644 radio/aidl/android/hardware/radio/DataConnActiveStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/DataProfileId.aidl create mode 100644 radio/aidl/android/hardware/radio/DataProfileInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/DataProfileInfoType.aidl create mode 100644 radio/aidl/android/hardware/radio/DataRegStateResult.aidl create mode 100644 radio/aidl/android/hardware/radio/DataRegStateResultVopsInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/DataRequestReason.aidl create mode 100644 radio/aidl/android/hardware/radio/DataThrottlingAction.aidl create mode 100644 radio/aidl/android/hardware/radio/DeviceStateType.aidl create mode 100644 radio/aidl/android/hardware/radio/Dial.aidl create mode 100644 radio/aidl/android/hardware/radio/Domain.aidl create mode 100644 radio/aidl/android/hardware/radio/EmcIndicator.aidl create mode 100644 radio/aidl/android/hardware/radio/EmergencyCallRouting.aidl create mode 100644 radio/aidl/android/hardware/radio/EmergencyNumber.aidl create mode 100644 radio/aidl/android/hardware/radio/EmergencyNumberSource.aidl create mode 100644 radio/aidl/android/hardware/radio/EmergencyServiceCategory.aidl create mode 100644 radio/aidl/android/hardware/radio/EmfIndicator.aidl create mode 100644 radio/aidl/android/hardware/radio/EpsQos.aidl create mode 100644 radio/aidl/android/hardware/radio/EutranBands.aidl create mode 100644 radio/aidl/android/hardware/radio/EvdoSignalStrength.aidl create mode 100644 radio/aidl/android/hardware/radio/FrequencyRange.aidl create mode 100644 radio/aidl/android/hardware/radio/GeranBands.aidl create mode 100644 radio/aidl/android/hardware/radio/GsmBroadcastSmsConfigInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/GsmSignalStrength.aidl create mode 100644 radio/aidl/android/hardware/radio/GsmSmsMessage.aidl create mode 100644 radio/aidl/android/hardware/radio/HandoverFailureMode.aidl create mode 100644 radio/aidl/android/hardware/radio/HardwareConfig.aidl create mode 100644 radio/aidl/android/hardware/radio/HardwareConfigModem.aidl create mode 100644 radio/aidl/android/hardware/radio/HardwareConfigSim.aidl create mode 100644 radio/aidl/android/hardware/radio/HardwareConfigState.aidl create mode 100644 radio/aidl/android/hardware/radio/HardwareConfigType.aidl create mode 100644 radio/aidl/android/hardware/radio/IRadio.aidl create mode 100644 radio/aidl/android/hardware/radio/IRadioIndication.aidl create mode 100644 radio/aidl/android/hardware/radio/IRadioResponse.aidl create mode 100644 radio/aidl/android/hardware/radio/ISap.aidl create mode 100644 radio/aidl/android/hardware/radio/ISapCallback.aidl create mode 100644 radio/aidl/android/hardware/radio/IccIo.aidl create mode 100644 radio/aidl/android/hardware/radio/IccIoResult.aidl create mode 100644 radio/aidl/android/hardware/radio/ImsSmsMessage.aidl create mode 100644 radio/aidl/android/hardware/radio/ImsiEncryptionInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl create mode 100644 radio/aidl/android/hardware/radio/IndicationFilter.aidl create mode 100644 radio/aidl/android/hardware/radio/KeepaliveRequest.aidl create mode 100644 radio/aidl/android/hardware/radio/KeepaliveStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/KeepaliveStatusCode.aidl create mode 100644 radio/aidl/android/hardware/radio/KeepaliveType.aidl create mode 100644 radio/aidl/android/hardware/radio/LastCallFailCause.aidl create mode 100644 radio/aidl/android/hardware/radio/LastCallFailCauseInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/LceDataInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/LceStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/LceStatusInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/LinkAddress.aidl create mode 100644 radio/aidl/android/hardware/radio/LinkCapacityEstimate.aidl create mode 100644 radio/aidl/android/hardware/radio/LteSignalStrength.aidl create mode 100644 radio/aidl/android/hardware/radio/LteVopsInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/MaxSearchTimeRange.aidl create mode 100644 radio/aidl/android/hardware/radio/MaybePort.aidl create mode 100644 radio/aidl/android/hardware/radio/MvnoType.aidl create mode 100644 radio/aidl/android/hardware/radio/NeighboringCell.aidl create mode 100644 radio/aidl/android/hardware/radio/NetworkScanRequest.aidl create mode 100644 radio/aidl/android/hardware/radio/NetworkScanResult.aidl create mode 100644 radio/aidl/android/hardware/radio/NgranBands.aidl create mode 100644 radio/aidl/android/hardware/radio/NrDualConnectivityState.aidl create mode 100644 radio/aidl/android/hardware/radio/NrIndicators.aidl create mode 100644 radio/aidl/android/hardware/radio/NrQos.aidl create mode 100644 radio/aidl/android/hardware/radio/NrSignalStrength.aidl create mode 100644 radio/aidl/android/hardware/radio/NrVopsInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/NvItem.aidl create mode 100644 radio/aidl/android/hardware/radio/NvWriteItem.aidl create mode 100644 radio/aidl/android/hardware/radio/OperatorInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/OperatorStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/OptionalCsgInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/OptionalDnn.aidl create mode 100644 radio/aidl/android/hardware/radio/OptionalOsAppId.aidl create mode 100644 radio/aidl/android/hardware/radio/OptionalPdpProtocolType.aidl create mode 100644 radio/aidl/android/hardware/radio/OptionalSliceInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/OptionalSscMode.aidl create mode 100644 radio/aidl/android/hardware/radio/OptionalTrafficDescriptor.aidl create mode 100644 radio/aidl/android/hardware/radio/OsAppId.aidl create mode 100644 radio/aidl/android/hardware/radio/P2Constant.aidl create mode 100644 radio/aidl/android/hardware/radio/PbReceivedStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/PcoDataInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/PdpProtocolType.aidl create mode 100644 radio/aidl/android/hardware/radio/PersoSubstate.aidl create mode 100644 radio/aidl/android/hardware/radio/PhoneRestrictedState.aidl create mode 100644 radio/aidl/android/hardware/radio/PhonebookCapacity.aidl create mode 100644 radio/aidl/android/hardware/radio/PhonebookRecordInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/PhysicalChannelConfig.aidl create mode 100644 radio/aidl/android/hardware/radio/PhysicalChannelConfigBand.aidl create mode 100644 radio/aidl/android/hardware/radio/PinState.aidl create mode 100644 radio/aidl/android/hardware/radio/PortRange.aidl create mode 100644 radio/aidl/android/hardware/radio/PreferredNetworkType.aidl create mode 100644 radio/aidl/android/hardware/radio/PrlIndicator.aidl create mode 100644 radio/aidl/android/hardware/radio/PublicKeyType.aidl create mode 100644 radio/aidl/android/hardware/radio/Qos.aidl create mode 100644 radio/aidl/android/hardware/radio/QosBandwidth.aidl create mode 100644 radio/aidl/android/hardware/radio/QosFilter.aidl create mode 100644 radio/aidl/android/hardware/radio/QosFilterDirection.aidl create mode 100644 radio/aidl/android/hardware/radio/QosFilterIpsecSpi.aidl create mode 100644 radio/aidl/android/hardware/radio/QosFilterIpv6FlowLabel.aidl create mode 100644 radio/aidl/android/hardware/radio/QosFilterTypeOfService.aidl create mode 100644 radio/aidl/android/hardware/radio/QosFlowIdRange.aidl create mode 100644 radio/aidl/android/hardware/radio/QosPortRange.aidl create mode 100644 radio/aidl/android/hardware/radio/QosProtocol.aidl create mode 100644 radio/aidl/android/hardware/radio/QosSession.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioAccessFamily.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioAccessNetworks.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioAccessSpecifier.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioAccessSpecifierBands.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioBandMode.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioCapability.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioCapabilityPhase.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioCapabilityStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioCdmaSmsConst.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioConst.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioError.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioFrequencyInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioIndicationType.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioResponseInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioResponseType.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioState.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioTechnology.aidl create mode 100644 radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl create mode 100644 radio/aidl/android/hardware/radio/RegState.aidl create mode 100644 radio/aidl/android/hardware/radio/RegStateResult.aidl create mode 100644 radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/RegistrationFailCause.aidl create mode 100644 radio/aidl/android/hardware/radio/ResetNvType.aidl create mode 100644 radio/aidl/android/hardware/radio/RestrictedState.aidl create mode 100644 radio/aidl/android/hardware/radio/RouteSelectionDescriptor.aidl create mode 100644 radio/aidl/android/hardware/radio/SapApduType.aidl create mode 100644 radio/aidl/android/hardware/radio/SapConnectRsp.aidl create mode 100644 radio/aidl/android/hardware/radio/SapDisconnectType.aidl create mode 100644 radio/aidl/android/hardware/radio/SapResultCode.aidl create mode 100644 radio/aidl/android/hardware/radio/SapStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/SapTransferProtocol.aidl create mode 100644 radio/aidl/android/hardware/radio/ScanIntervalRange.aidl create mode 100644 radio/aidl/android/hardware/radio/ScanStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/ScanType.aidl create mode 100644 radio/aidl/android/hardware/radio/SelectUiccSub.aidl create mode 100644 radio/aidl/android/hardware/radio/SendSmsResult.aidl create mode 100644 radio/aidl/android/hardware/radio/SetupDataCallResult.aidl create mode 100644 radio/aidl/android/hardware/radio/SignalMeasurementType.aidl create mode 100644 radio/aidl/android/hardware/radio/SignalStrength.aidl create mode 100644 radio/aidl/android/hardware/radio/SignalThresholdInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/SimApdu.aidl create mode 100644 radio/aidl/android/hardware/radio/SimLockMultiSimPolicy.aidl create mode 100644 radio/aidl/android/hardware/radio/SimRefreshResult.aidl create mode 100644 radio/aidl/android/hardware/radio/SimRefreshType.aidl create mode 100644 radio/aidl/android/hardware/radio/SliceInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/SliceServiceType.aidl create mode 100644 radio/aidl/android/hardware/radio/SliceStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/SlicingConfig.aidl create mode 100644 radio/aidl/android/hardware/radio/SmsAcknowledgeFailCause.aidl create mode 100644 radio/aidl/android/hardware/radio/SmsWriteArgs.aidl create mode 100644 radio/aidl/android/hardware/radio/SmsWriteArgsStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/SrvccState.aidl create mode 100644 radio/aidl/android/hardware/radio/SsInfoData.aidl create mode 100644 radio/aidl/android/hardware/radio/SsRequestType.aidl create mode 100644 radio/aidl/android/hardware/radio/SsServiceType.aidl create mode 100644 radio/aidl/android/hardware/radio/SsTeleserviceType.aidl create mode 100644 radio/aidl/android/hardware/radio/SscMode.aidl create mode 100644 radio/aidl/android/hardware/radio/StkCcUnsolSsResult.aidl create mode 100644 radio/aidl/android/hardware/radio/SubscriptionType.aidl create mode 100644 radio/aidl/android/hardware/radio/SuppServiceClass.aidl create mode 100644 radio/aidl/android/hardware/radio/SuppSvcNotification.aidl create mode 100644 radio/aidl/android/hardware/radio/TdscdmaSignalStrength.aidl create mode 100644 radio/aidl/android/hardware/radio/TimeStampType.aidl create mode 100644 radio/aidl/android/hardware/radio/TrafficDescriptor.aidl create mode 100644 radio/aidl/android/hardware/radio/Translate.java create mode 100644 radio/aidl/android/hardware/radio/TtyMode.aidl create mode 100644 radio/aidl/android/hardware/radio/UiccSubActStatus.aidl create mode 100644 radio/aidl/android/hardware/radio/UrspRule.aidl create mode 100644 radio/aidl/android/hardware/radio/UssdModeType.aidl create mode 100644 radio/aidl/android/hardware/radio/UtranBands.aidl create mode 100644 radio/aidl/android/hardware/radio/UusDcs.aidl create mode 100644 radio/aidl/android/hardware/radio/UusInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/UusType.aidl create mode 100644 radio/aidl/android/hardware/radio/VoiceRegStateResult.aidl create mode 100644 radio/aidl/android/hardware/radio/VopsIndicator.aidl create mode 100644 radio/aidl/android/hardware/radio/WcdmaSignalStrength.aidl create mode 100644 radio/aidl/android/hardware/radio/translate-ndk.cpp create mode 100644 radio/aidl/include/android/hardware/radio/translate-ndk.h diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index f03008a4e4..9eaa847b99 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -446,6 +446,16 @@ default + + android.hardware.radio + 1 + + IRadio + slot1 + slot2 + slot3 + + android.hardware.radio 1.6 diff --git a/radio/aidl/Android.bp b/radio/aidl/Android.bp new file mode 100644 index 0000000000..29d7a58471 --- /dev/null +++ b/radio/aidl/Android.bp @@ -0,0 +1,54 @@ +aidl_interface { + name: "android.hardware.radio", + vendor_available: true, + srcs: ["android/hardware/radio/*.aidl"], + stability: "vintf", + backend: { + cpp: { + enabled: false, + }, + java: { + sdk_version: "module_current", + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, +} + +cc_library { + name: "android.hardware.radio-translate-ndk", + vendor_available: true, + srcs: ["android/hardware/radio/translate-ndk.cpp"], + shared_libs: [ + "libbinder_ndk", + "libhidlbase", + "android.hardware.radio-V1-ndk_platform", + "android.hardware.radio@1.0", + "android.hardware.radio@1.1", + "android.hardware.radio@1.2", + "android.hardware.radio@1.3", + "android.hardware.radio@1.4", + "android.hardware.radio@1.5", + "android.hardware.radio@1.6", + ], + export_include_dirs: ["include"], +} + +java_library { + name: "android.hardware.radio-translate-java", + srcs: ["android/hardware/radio/Translate.java"], + libs: [ + "android.hardware.radio-V1-java", + "android.hardware.radio-V1.0-java", + "android.hardware.radio-V1.1-java", + "android.hardware.radio-V1.2-java", + "android.hardware.radio-V1.3-java", + "android.hardware.radio-V1.4-java", + "android.hardware.radio-V1.5-java", + "android.hardware.radio-V1.6-java", + ], + sdk_version: "module_current", +} 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 new file mode 100644 index 0000000000..0327d6c19d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.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 -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; +@Backing(type="int") @VintfStability +enum AccessNetwork { + UNKNOWN = 0, + GERAN = 1, + UTRAN = 2, + EUTRAN = 3, + CDMA2000 = 4, + IWLAN = 5, + NGRAN = 6, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ActivityStatsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ActivityStatsInfo.aidl new file mode 100644 index 0000000000..f9ef742549 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ActivityStatsInfo.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 -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; +@VintfStability +parcelable ActivityStatsInfo { + int sleepModeTimeMs; + int idleModeTimeMs; + int[] txmModetimeMs; + int rxModeTimeMs; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AddressProperty.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AddressProperty.aidl new file mode 100644 index 0000000000..dd6e79a1c1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AddressProperty.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 -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; +@Backing(type="int") @VintfStability +enum AddressProperty { + NONE = 0, + DEPRECATED = 32, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ApnAuthType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ApnAuthType.aidl new file mode 100644 index 0000000000..bae7d1f261 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ApnAuthType.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 -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; +@Backing(type="int") @VintfStability +enum ApnAuthType { + NO_PAP_NO_CHAP = 0, + PAP_NO_CHAP = 1, + NO_PAP_CHAP = 2, + PAP_CHAP = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ApnTypes.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ApnTypes.aidl new file mode 100644 index 0000000000..0829fa619f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ApnTypes.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum ApnTypes { + NONE = 0, + DEFAULT = 1, + MMS = 2, + SUPL = 4, + DUN = 8, + HIPRI = 16, + FOTA = 32, + IMS = 64, + CBS = 128, + IA = 256, + EMERGENCY = 512, + ALL = 1023, + MCX = 1024, + XCAP = 2048, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppState.aidl new file mode 100644 index 0000000000..59e2bd43ce --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppState.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 -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; +@Backing(type="int") @VintfStability +enum AppState { + UNKNOWN = 0, + DETECTED = 1, + PIN = 2, + PUK = 3, + SUBSCRIPTION_PERSO = 4, + READY = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppStatus.aidl new file mode 100644 index 0000000000..c9abe3263c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppStatus.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 -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; +@VintfStability +parcelable AppStatus { + android.hardware.radio.AppType appType; + android.hardware.radio.AppState appState; + android.hardware.radio.PersoSubstate persoSubstate; + String aidPtr; + String appLabelPtr; + int pin1Replaced; + android.hardware.radio.PinState pin1; + android.hardware.radio.PinState pin2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppType.aidl new file mode 100644 index 0000000000..adbbe9f002 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppType.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 -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; +@Backing(type="int") @VintfStability +enum AppType { + UNKNOWN = 0, + SIM = 1, + USIM = 2, + RUIM = 3, + CSIM = 4, + ISIM = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AudioQuality.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AudioQuality.aidl new file mode 100644 index 0000000000..a596969147 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AudioQuality.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 -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; +@Backing(type="int") @VintfStability +enum AudioQuality { + UNSPECIFIED = 0, + AMR = 1, + AMR_WB = 2, + GSM_EFR = 3, + GSM_FR = 4, + GSM_HR = 5, + EVRC = 6, + EVRC_B = 7, + EVRC_WB = 8, + EVRC_NW = 9, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfo.aidl new file mode 100644 index 0000000000..ac0b4aa6da --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfo.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 -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; +@VintfStability +parcelable BarringInfo { + android.hardware.radio.BarringInfoServiceType serviceType; + android.hardware.radio.BarringInfoBarringType barringType; + android.hardware.radio.BarringInfoBarringTypeSpecificInfo barringTypeSpecificInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringType.aidl new file mode 100644 index 0000000000..6b8006ebaa --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringType.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 -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; +@Backing(type="int") @VintfStability +enum BarringInfoBarringType { + NONE = 0, + CONDITIONAL = 1, + UNCONDITIONAL = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.aidl new file mode 100644 index 0000000000..c2ba1d2e2d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.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 -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; +@VintfStability +union BarringInfoBarringTypeSpecificInfo { + boolean noinit; + android.hardware.radio.BarringInfoBarringTypeSpecificInfoConditional conditional; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.aidl new file mode 100644 index 0000000000..8c079e2e3a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.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 -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; +@VintfStability +parcelable BarringInfoBarringTypeSpecificInfoConditional { + int factor; + int timeSeconds; + boolean isBarred; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoServiceType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoServiceType.aidl new file mode 100644 index 0000000000..faea9b9ab8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoServiceType.aidl @@ -0,0 +1,79 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum BarringInfoServiceType { + CS_SERVICE = 0, + PS_SERVICE = 1, + CS_VOICE = 2, + MO_SIGNALLING = 3, + MO_DATA = 4, + CS_FALLBACK = 5, + MMTEL_VOICE = 6, + MMTEL_VIDEO = 7, + EMERGENCY = 8, + SMS = 9, + OPERATOR_1 = 1001, + OPERATOR_2 = 1002, + OPERATOR_3 = 1003, + OPERATOR_4 = 1004, + OPERATOR_5 = 1005, + OPERATOR_6 = 1006, + OPERATOR_7 = 1007, + OPERATOR_8 = 1008, + OPERATOR_9 = 1009, + OPERATOR_10 = 1010, + OPERATOR_11 = 1011, + OPERATOR_12 = 1012, + OPERATOR_13 = 1013, + OPERATOR_14 = 1014, + OPERATOR_15 = 1015, + OPERATOR_16 = 1016, + OPERATOR_17 = 1017, + OPERATOR_18 = 1018, + OPERATOR_19 = 1019, + OPERATOR_20 = 1020, + OPERATOR_21 = 1021, + OPERATOR_22 = 1022, + OPERATOR_23 = 1023, + OPERATOR_24 = 1024, + OPERATOR_25 = 1025, + OPERATOR_26 = 1026, + OPERATOR_27 = 1027, + OPERATOR_28 = 1028, + OPERATOR_29 = 1029, + OPERATOR_30 = 1030, + OPERATOR_31 = 1031, + OPERATOR_32 = 1032, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Call.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Call.aidl new file mode 100644 index 0000000000..36e1ae31e5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Call.aidl @@ -0,0 +1,52 @@ +/* + * 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 -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; +@VintfStability +parcelable Call { + android.hardware.radio.CallState state; + int index; + int toa; + boolean isMpty; + boolean isMT; + byte als; + boolean isVoice; + boolean isVoicePrivacy; + String number; + android.hardware.radio.CallPresentation numberPresentation; + String name; + android.hardware.radio.CallPresentation namePresentation; + android.hardware.radio.UusInfo[] uusInfo; + android.hardware.radio.AudioQuality audioQuality; + String forwardedNumber; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfo.aidl new file mode 100644 index 0000000000..bcfa90fcdc --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfo.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 -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; +@VintfStability +parcelable CallForwardInfo { + android.hardware.radio.CallForwardInfoStatus status; + int reason; + int serviceClass; + int toa; + String number; + int timeSeconds; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfoStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfoStatus.aidl new file mode 100644 index 0000000000..5ac129a0ee --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfoStatus.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 -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; +@Backing(type="int") @VintfStability +enum CallForwardInfoStatus { + DISABLE = 0, + ENABLE = 1, + INTERROGATE = 2, + REGISTRATION = 3, + ERASURE = 4, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallPresentation.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallPresentation.aidl new file mode 100644 index 0000000000..c32cd08201 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallPresentation.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 -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; +@Backing(type="int") @VintfStability +enum CallPresentation { + ALLOWED = 0, + RESTRICTED = 1, + UNKNOWN = 2, + PAYPHONE = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallState.aidl new file mode 100644 index 0000000000..375ca2c5af --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallState.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 -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; +@Backing(type="int") @VintfStability +enum CallState { + ACTIVE = 0, + HOLDING = 1, + DIALING = 2, + ALERTING = 3, + INCOMING = 4, + WAITING = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardPowerState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardPowerState.aidl new file mode 100644 index 0000000000..1a3b4c6295 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardPowerState.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 -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; +@Backing(type="int") @VintfStability +enum CardPowerState { + POWER_DOWN = 0, + POWER_UP = 1, + POWER_UP_PASS_THROUGH = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardState.aidl new file mode 100644 index 0000000000..d200b9757f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardState.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 -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; +@Backing(type="int") @VintfStability +enum CardState { + ABSENT = 0, + PRESENT = 1, + ERROR = 2, + RESTRICTED = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardStatus.aidl new file mode 100644 index 0000000000..e11bb21b5d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardStatus.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 -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; +@VintfStability +parcelable CardStatus { + android.hardware.radio.CardState cardState; + android.hardware.radio.PinState universalPinState; + int gsmUmtsSubscriptionAppIndex; + int cdmaSubscriptionAppIndex; + int imsSubscriptionAppIndex; + android.hardware.radio.AppStatus[] applications; + int physicalSlotId; + String atr; + String iccid; + String eid; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Carrier.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Carrier.aidl new file mode 100644 index 0000000000..bbf777f94a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Carrier.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 -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; +@VintfStability +parcelable Carrier { + String mcc; + String mnc; + android.hardware.radio.CarrierMatchType matchType; + String matchData; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierMatchType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierMatchType.aidl new file mode 100644 index 0000000000..c3596cde1a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierMatchType.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 -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; +@Backing(type="int") @VintfStability +enum CarrierMatchType { + ALL = 0, + SPN = 1, + IMSI_PREFIX = 2, + GID1 = 3, + GID2 = 4, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictions.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictions.aidl new file mode 100644 index 0000000000..f8cafb58a2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictions.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 -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; +@VintfStability +parcelable CarrierRestrictions { + android.hardware.radio.Carrier[] allowedCarriers; + android.hardware.radio.Carrier[] excludedCarriers; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictionsWithPriority.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictionsWithPriority.aidl new file mode 100644 index 0000000000..1f06980416 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictionsWithPriority.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 -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; +@VintfStability +parcelable CarrierRestrictionsWithPriority { + android.hardware.radio.Carrier[] allowedCarriers; + android.hardware.radio.Carrier[] excludedCarriers; + boolean allowedCarriersPrioritized; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaBroadcastSmsConfigInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaBroadcastSmsConfigInfo.aidl new file mode 100644 index 0000000000..73c7faeeab --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaBroadcastSmsConfigInfo.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 -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; +@VintfStability +parcelable CdmaBroadcastSmsConfigInfo { + int serviceCategory; + int language; + boolean selected; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaiting.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaiting.aidl new file mode 100644 index 0000000000..564433fc9c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaiting.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 -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; +@VintfStability +parcelable CdmaCallWaiting { + String number; + android.hardware.radio.CdmaCallWaitingNumberPresentation numberPresentation; + String name; + android.hardware.radio.CdmaSignalInfoRecord signalInfoRecord; + android.hardware.radio.CdmaCallWaitingNumberType numberType; + android.hardware.radio.CdmaCallWaitingNumberPlan numberPlan; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl new file mode 100644 index 0000000000..6dcd594c09 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPlan.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 -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; +@Backing(type="int") @VintfStability +enum CdmaCallWaitingNumberPlan { + UNKNOWN = 0, + ISDN = 1, + DATA = 3, + TELEX = 4, + NATIONAL = 8, + PRIVATE = 9, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl new file mode 100644 index 0000000000..22eaf6bedd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPresentation.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 -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; +@Backing(type="int") @VintfStability +enum CdmaCallWaitingNumberPresentation { + ALLOWED = 0, + RESTRICTED = 1, + UNKNOWN = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberType.aidl new file mode 100644 index 0000000000..47401083c1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberType.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 -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; +@Backing(type="int") @VintfStability +enum CdmaCallWaitingNumberType { + UNKNOWN = 0, + INTERNATIONAL = 1, + NATIONAL = 2, + NETWORK_SPECIFIC = 3, + SUBSCRIBER = 4, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaDisplayInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaDisplayInfoRecord.aidl new file mode 100644 index 0000000000..11f082f1b0 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaDisplayInfoRecord.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 -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; +@VintfStability +parcelable CdmaDisplayInfoRecord { + String alphaBuf; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInfoRecName.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInfoRecName.aidl new file mode 100644 index 0000000000..182dcc0cca --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInfoRecName.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 -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; +@Backing(type="int") @VintfStability +enum CdmaInfoRecName { + DISPLAY = 0, + CALLED_PARTY_NUMBER = 1, + CALLING_PARTY_NUMBER = 2, + CONNECTED_NUMBER = 3, + SIGNAL = 4, + REDIRECTING_NUMBER = 5, + LINE_CONTROL = 6, + EXTENDED_DISPLAY = 7, + T53_CLIR = 8, + T53_RELEASE = 9, + T53_AUDIO_CONTROL = 10, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInformationRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInformationRecord.aidl new file mode 100644 index 0000000000..844a1bf86d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInformationRecord.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 -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; +@VintfStability +parcelable CdmaInformationRecord { + android.hardware.radio.CdmaInfoRecName name; + android.hardware.radio.CdmaDisplayInfoRecord[] display; + android.hardware.radio.CdmaNumberInfoRecord[] number; + android.hardware.radio.CdmaSignalInfoRecord[] signal; + android.hardware.radio.CdmaRedirectingNumberInfoRecord[] redir; + android.hardware.radio.CdmaLineControlInfoRecord[] lineCtrl; + android.hardware.radio.CdmaT53ClirInfoRecord[] clir; + android.hardware.radio.CdmaT53AudioControlInfoRecord[] audioCtrl; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInformationRecords.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInformationRecords.aidl new file mode 100644 index 0000000000..88a433148b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInformationRecords.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 -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; +@VintfStability +parcelable CdmaInformationRecords { + android.hardware.radio.CdmaInformationRecord[] infoRec; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaLineControlInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaLineControlInfoRecord.aidl new file mode 100644 index 0000000000..48180a7717 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaLineControlInfoRecord.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 -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; +@VintfStability +parcelable CdmaLineControlInfoRecord { + byte lineCtrlPolarityIncluded; + byte lineCtrlToggle; + byte lineCtrlReverse; + byte lineCtrlPowerDenial; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaNumberInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaNumberInfoRecord.aidl new file mode 100644 index 0000000000..86376a7034 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaNumberInfoRecord.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 -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; +@VintfStability +parcelable CdmaNumberInfoRecord { + String number; + byte numberType; + byte numberPlan; + byte pi; + byte si; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaOtaProvisionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaOtaProvisionStatus.aidl new file mode 100644 index 0000000000..7cd88ac9cd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaOtaProvisionStatus.aidl @@ -0,0 +1,49 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum CdmaOtaProvisionStatus { + SPL_UNLOCKED = 0, + SPC_RETRIES_EXCEEDED = 1, + A_KEY_EXCHANGED = 2, + SSD_UPDATED = 3, + NAM_DOWNLOADED = 4, + MDN_DOWNLOADED = 5, + IMSI_DOWNLOADED = 6, + PRL_DOWNLOADED = 7, + COMMITTED = 8, + OTAPA_STARTED = 9, + OTAPA_STOPPED = 10, + OTAPA_ABORTED = 11, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl new file mode 100644 index 0000000000..44b799323c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingNumberInfoRecord.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 -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; +@VintfStability +parcelable CdmaRedirectingNumberInfoRecord { + android.hardware.radio.CdmaNumberInfoRecord redirectingNumber; + android.hardware.radio.CdmaRedirectingReason redirectingReason; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingReason.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingReason.aidl new file mode 100644 index 0000000000..e109c5b146 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingReason.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 -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; +@Backing(type="int") @VintfStability +enum CdmaRedirectingReason { + UNKNOWN = 0, + CALL_FORWARDING_BUSY = 1, + CALL_FORWARDING_NO_REPLY = 2, + CALLED_DTE_OUT_OF_ORDER = 9, + CALL_FORWARDING_BY_THE_CALLED_DTE = 10, + CALL_FORWARDING_UNCONDITIONAL = 15, + RESERVED = 16, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRoamingType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRoamingType.aidl new file mode 100644 index 0000000000..09a59a0c35 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRoamingType.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 -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; +@Backing(type="int") @VintfStability +enum CdmaRoamingType { + HOME_NETWORK = 0, + AFFILIATED_ROAM = 1, + ANY_ROAM = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSignalInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSignalInfoRecord.aidl new file mode 100644 index 0000000000..efb396af56 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSignalInfoRecord.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 -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; +@VintfStability +parcelable CdmaSignalInfoRecord { + boolean isPresent; + byte signalType; + byte alertPitch; + byte signal; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSignalStrength.aidl new file mode 100644 index 0000000000..29391838f4 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSignalStrength.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 -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; +@VintfStability +parcelable CdmaSignalStrength { + int dbm; + int ecio; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAck.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAck.aidl new file mode 100644 index 0000000000..0ef4331777 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAck.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 -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; +@VintfStability +parcelable CdmaSmsAck { + android.hardware.radio.CdmaSmsErrorClass errorClass; + int smsCauseCode; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAddress.aidl new file mode 100644 index 0000000000..a37f1e75e2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAddress.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 -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; +@VintfStability +parcelable CdmaSmsAddress { + android.hardware.radio.CdmaSmsDigitMode digitMode; + android.hardware.radio.CdmaSmsNumberMode numberMode; + android.hardware.radio.CdmaSmsNumberType numberType; + android.hardware.radio.CdmaSmsNumberPlan numberPlan; + byte[] digits; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsDigitMode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsDigitMode.aidl new file mode 100644 index 0000000000..7c7783057e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsDigitMode.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 -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; +@Backing(type="int") @VintfStability +enum CdmaSmsDigitMode { + FOUR_BIT = 0, + EIGHT_BIT = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsErrorClass.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsErrorClass.aidl new file mode 100644 index 0000000000..3ad5c1a3f3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsErrorClass.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 -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; +@Backing(type="int") @VintfStability +enum CdmaSmsErrorClass { + NO_ERROR = 0, + ERROR = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsMessage.aidl new file mode 100644 index 0000000000..c419bada63 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsMessage.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 -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; +@VintfStability +parcelable CdmaSmsMessage { + int teleserviceId; + boolean isServicePresent; + int serviceCategory; + android.hardware.radio.CdmaSmsAddress address; + android.hardware.radio.CdmaSmsSubaddress subAddress; + byte[] bearerData; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberMode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberMode.aidl new file mode 100644 index 0000000000..31d49d4373 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberMode.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 -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; +@Backing(type="int") @VintfStability +enum CdmaSmsNumberMode { + NOT_DATA_NETWORK = 0, + DATA_NETWORK = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberPlan.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberPlan.aidl new file mode 100644 index 0000000000..fcbd1cc637 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberPlan.aidl @@ -0,0 +1,53 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum CdmaSmsNumberPlan { + UNKNOWN = 0, + TELEPHONY = 1, + RESERVED_2 = 2, + DATA = 3, + TELEX = 4, + RESERVED_5 = 5, + RESERVED_6 = 6, + RESERVED_7 = 7, + RESERVED_8 = 8, + PRIVATE = 9, + RESERVED_10 = 10, + RESERVED_11 = 11, + RESERVED_12 = 12, + RESERVED_13 = 13, + RESERVED_14 = 14, + RESERVED_15 = 15, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberType.aidl new file mode 100644 index 0000000000..ca14dbc91f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberType.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 -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; +@Backing(type="int") @VintfStability +enum CdmaSmsNumberType { + UNKNOWN = 0, + INTERNATIONAL_OR_DATA_IP = 1, + NATIONAL_OR_INTERNET_MAIL = 2, + NETWORK = 3, + SUBSCRIBER = 4, + ALPHANUMERIC = 5, + ABBREVIATED = 6, + RESERVED_7 = 7, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddress.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddress.aidl new file mode 100644 index 0000000000..a0155daae1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddress.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 -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; +@VintfStability +parcelable CdmaSmsSubaddress { + android.hardware.radio.CdmaSmsSubaddressType subaddressType; + boolean odd; + byte[] digits; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddressType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddressType.aidl new file mode 100644 index 0000000000..a4db5ec6e1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddressType.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 -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; +@Backing(type="int") @VintfStability +enum CdmaSmsSubaddressType { + NSAP = 0, + USER_SPECIFIED = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgs.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgs.aidl new file mode 100644 index 0000000000..3202314f34 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgs.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 -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; +@VintfStability +parcelable CdmaSmsWriteArgs { + android.hardware.radio.CdmaSmsWriteArgsStatus status; + android.hardware.radio.CdmaSmsMessage message; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl new file mode 100644 index 0000000000..4bad261e2b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgsStatus.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 -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; +@Backing(type="int") @VintfStability +enum CdmaSmsWriteArgsStatus { + REC_UNREAD = 0, + REC_READ = 1, + STO_UNSENT = 2, + STO_SENT = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSubscriptionSource.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSubscriptionSource.aidl new file mode 100644 index 0000000000..11e8a2466e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSubscriptionSource.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 -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; +@Backing(type="int") @VintfStability +enum CdmaSubscriptionSource { + RUIM_SIM = 0, + NV = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaT53AudioControlInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaT53AudioControlInfoRecord.aidl new file mode 100644 index 0000000000..9285eb79f1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaT53AudioControlInfoRecord.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 -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; +@VintfStability +parcelable CdmaT53AudioControlInfoRecord { + byte upLink; + byte downLink; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaT53ClirInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaT53ClirInfoRecord.aidl new file mode 100644 index 0000000000..ff4d3c3da5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaT53ClirInfoRecord.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 -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; +@VintfStability +parcelable CdmaT53ClirInfoRecord { + byte cause; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellConfigLte.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellConfigLte.aidl new file mode 100644 index 0000000000..184af1cb04 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellConfigLte.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 -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; +@VintfStability +parcelable CellConfigLte { + boolean isEndcAvailable; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellConnectionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellConnectionStatus.aidl new file mode 100644 index 0000000000..96f8368a7a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellConnectionStatus.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 -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; +@Backing(type="int") @VintfStability +enum CellConnectionStatus { + NONE = 0, + PRIMARY_SERVING = 1, + SECONDARY_SERVING = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentity.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentity.aidl new file mode 100644 index 0000000000..aa37fdfa71 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentity.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 -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; +@VintfStability +union CellIdentity { + boolean noinit; + android.hardware.radio.CellIdentityGsm gsm; + android.hardware.radio.CellIdentityWcdma wcdma; + android.hardware.radio.CellIdentityTdscdma tdscdma; + android.hardware.radio.CellIdentityCdma cdma; + android.hardware.radio.CellIdentityLte lte; + android.hardware.radio.CellIdentityNr nr; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityCdma.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityCdma.aidl new file mode 100644 index 0000000000..d24b91d213 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityCdma.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 -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; +@VintfStability +parcelable CellIdentityCdma { + int networkId; + int systemId; + int baseStationId; + int longitude; + int latitude; + android.hardware.radio.CellIdentityOperatorNames operatorNames; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityGsm.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityGsm.aidl new file mode 100644 index 0000000000..4ee2148798 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityGsm.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 -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; +@VintfStability +parcelable CellIdentityGsm { + String mcc; + String mnc; + int lac; + int cid; + int arfcn; + byte bsic; + android.hardware.radio.CellIdentityOperatorNames operatorNames; + String[] additionalPlmns; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityLte.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityLte.aidl new file mode 100644 index 0000000000..5a8c272080 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityLte.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 -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; +@VintfStability +parcelable CellIdentityLte { + String mcc; + String mnc; + int ci; + int pci; + int tac; + int earfcn; + android.hardware.radio.CellIdentityOperatorNames operatorNames; + int bandwidth; + String[] additionalPlmns; + android.hardware.radio.OptionalCsgInfo optionalCsgInfo; + android.hardware.radio.EutranBands[] bands; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityNr.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityNr.aidl new file mode 100644 index 0000000000..60a24d7e38 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityNr.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +parcelable CellIdentityNr { + String mcc; + String mnc; + long nci; + int pci; + int tac; + int nrarfcn; + android.hardware.radio.CellIdentityOperatorNames operatorNames; + String[] additionalPlmns; + android.hardware.radio.NgranBands[] bands; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityOperatorNames.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityOperatorNames.aidl new file mode 100644 index 0000000000..161797f3f8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityOperatorNames.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 -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; +@VintfStability +parcelable CellIdentityOperatorNames { + String alphaLong; + String alphaShort; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityTdscdma.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityTdscdma.aidl new file mode 100644 index 0000000000..35e1f5d0b6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityTdscdma.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +parcelable CellIdentityTdscdma { + String mcc; + String mnc; + int lac; + int cid; + int cpid; + int uarfcn; + android.hardware.radio.CellIdentityOperatorNames operatorNames; + String[] additionalPlmns; + android.hardware.radio.OptionalCsgInfo optionalCsgInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityWcdma.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityWcdma.aidl new file mode 100644 index 0000000000..7bcc4d5d1c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityWcdma.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +parcelable CellIdentityWcdma { + String mcc; + String mnc; + int lac; + int cid; + int psc; + int uarfcn; + android.hardware.radio.CellIdentityOperatorNames operatorNames; + String[] additionalPlmns; + android.hardware.radio.OptionalCsgInfo optionalCsgInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfo.aidl new file mode 100644 index 0000000000..20ea3cb18a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfo.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 -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; +@VintfStability +parcelable CellInfo { + boolean registered; + android.hardware.radio.CellConnectionStatus connectionStatus; + android.hardware.radio.CellInfoCellInfoRatSpecificInfo ratSpecificInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoCdma.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoCdma.aidl new file mode 100644 index 0000000000..dd940c2fa7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoCdma.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 -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; +@VintfStability +parcelable CellInfoCdma { + android.hardware.radio.CellIdentityCdma cellIdentityCdma; + android.hardware.radio.CdmaSignalStrength signalStrengthCdma; + android.hardware.radio.EvdoSignalStrength signalStrengthEvdo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoCellInfoRatSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoCellInfoRatSpecificInfo.aidl new file mode 100644 index 0000000000..7084e5e2ad --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoCellInfoRatSpecificInfo.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 -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; +@VintfStability +union CellInfoCellInfoRatSpecificInfo { + android.hardware.radio.CellInfoGsm gsm; + android.hardware.radio.CellInfoWcdma wcdma; + android.hardware.radio.CellInfoTdscdma tdscdma; + android.hardware.radio.CellInfoLte lte; + android.hardware.radio.CellInfoNr nr; + android.hardware.radio.CellInfoCdma cdma; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoGsm.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoGsm.aidl new file mode 100644 index 0000000000..fda976c6b3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoGsm.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 -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; +@VintfStability +parcelable CellInfoGsm { + android.hardware.radio.CellIdentityGsm cellIdentityGsm; + android.hardware.radio.GsmSignalStrength signalStrengthGsm; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoInfo.aidl new file mode 100644 index 0000000000..9c2255520d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoInfo.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 -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; +@VintfStability +union CellInfoInfo { + android.hardware.radio.CellInfoGsm gsm; + android.hardware.radio.CellInfoCdma cdma; + android.hardware.radio.CellInfoWcdma wcdma; + android.hardware.radio.CellInfoTdscdma tdscdma; + android.hardware.radio.CellInfoLte lte; + android.hardware.radio.CellInfoNr nr; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoLte.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoLte.aidl new file mode 100644 index 0000000000..9976feb52a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoLte.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 -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; +@VintfStability +parcelable CellInfoLte { + android.hardware.radio.CellIdentityLte cellIdentityLte; + android.hardware.radio.LteSignalStrength signalStrengthLte; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoNr.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoNr.aidl new file mode 100644 index 0000000000..7883692b55 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoNr.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 -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; +@VintfStability +parcelable CellInfoNr { + android.hardware.radio.CellIdentityNr cellIdentityNr; + android.hardware.radio.NrSignalStrength signalStrengthNr; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoTdscdma.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoTdscdma.aidl new file mode 100644 index 0000000000..4fbe5b61e6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoTdscdma.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 -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; +@VintfStability +parcelable CellInfoTdscdma { + android.hardware.radio.CellIdentityTdscdma cellIdentityTdscdma; + android.hardware.radio.TdscdmaSignalStrength signalStrengthTdscdma; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoType.aidl new file mode 100644 index 0000000000..cb92ed9fd4 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoType.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 -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; +@Backing(type="int") @VintfStability +enum CellInfoType { + NONE = 0, + GSM = 1, + CDMA = 2, + LTE = 3, + WCDMA = 4, + TD_SCDMA = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoWcdma.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoWcdma.aidl new file mode 100644 index 0000000000..88ca975ba6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellInfoWcdma.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 -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; +@VintfStability +parcelable CellInfoWcdma { + android.hardware.radio.CellIdentityWcdma cellIdentityWcdma; + android.hardware.radio.WcdmaSignalStrength signalStrengthWcdma; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CfData.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CfData.aidl new file mode 100644 index 0000000000..6a2b0269e5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CfData.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 -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; +@VintfStability +parcelable CfData { + android.hardware.radio.CallForwardInfo[] cfInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ClipStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ClipStatus.aidl new file mode 100644 index 0000000000..36a15100b9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ClipStatus.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 -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; +@Backing(type="int") @VintfStability +enum ClipStatus { + CLIP_PROVISIONED = 0, + CLIP_UNPROVISIONED = 1, + UNKNOWN = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Clir.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Clir.aidl new file mode 100644 index 0000000000..97ba4ed2df --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Clir.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 -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; +@Backing(type="int") @VintfStability +enum Clir { + DEFAULT = 0, + INVOCATION = 1, + SUPPRESSION = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ClosedSubscriberGroupInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ClosedSubscriberGroupInfo.aidl new file mode 100644 index 0000000000..0c10ca4622 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ClosedSubscriberGroupInfo.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 -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; +@VintfStability +parcelable ClosedSubscriberGroupInfo { + boolean csgIndication; + String homeNodebName; + int csgIdentity; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataCallFailCause.aidl new file mode 100644 index 0000000000..df895f825c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataCallFailCause.aidl @@ -0,0 +1,377 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum DataCallFailCause { + NONE = 0, + OPERATOR_BARRED = 8, + NAS_SIGNALLING = 14, + INSUFFICIENT_RESOURCES = 26, + MISSING_UNKNOWN_APN = 27, + UNKNOWN_PDP_ADDRESS_TYPE = 28, + USER_AUTHENTICATION = 29, + ACTIVATION_REJECT_GGSN = 30, + ACTIVATION_REJECT_UNSPECIFIED = 31, + SERVICE_OPTION_NOT_SUPPORTED = 32, + SERVICE_OPTION_NOT_SUBSCRIBED = 33, + SERVICE_OPTION_OUT_OF_ORDER = 34, + NSAPI_IN_USE = 35, + REGULAR_DEACTIVATION = 36, + QOS_NOT_ACCEPTED = 37, + NETWORK_FAILURE = 38, + UMTS_REACTIVATION_REQ = 39, + FEATURE_NOT_SUPP = 40, + TFT_SEMANTIC_ERROR = 41, + TFT_SYTAX_ERROR = 42, + UNKNOWN_PDP_CONTEXT = 43, + FILTER_SEMANTIC_ERROR = 44, + FILTER_SYTAX_ERROR = 45, + PDP_WITHOUT_ACTIVE_TFT = 46, + ONLY_IPV4_ALLOWED = 50, + ONLY_IPV6_ALLOWED = 51, + ONLY_SINGLE_BEARER_ALLOWED = 52, + ESM_INFO_NOT_RECEIVED = 53, + PDN_CONN_DOES_NOT_EXIST = 54, + MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 55, + MAX_ACTIVE_PDP_CONTEXT_REACHED = 65, + UNSUPPORTED_APN_IN_CURRENT_PLMN = 66, + INVALID_TRANSACTION_ID = 81, + MESSAGE_INCORRECT_SEMANTIC = 95, + INVALID_MANDATORY_INFO = 96, + MESSAGE_TYPE_UNSUPPORTED = 97, + MSG_TYPE_NONCOMPATIBLE_STATE = 98, + UNKNOWN_INFO_ELEMENT = 99, + CONDITIONAL_IE_ERROR = 100, + MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 101, + PROTOCOL_ERRORS = 111, + APN_TYPE_CONFLICT = 112, + INVALID_PCSCF_ADDR = 113, + INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 114, + EMM_ACCESS_BARRED = 115, + EMERGENCY_IFACE_ONLY = 116, + IFACE_MISMATCH = 117, + COMPANION_IFACE_IN_USE = 118, + IP_ADDRESS_MISMATCH = 119, + IFACE_AND_POL_FAMILY_MISMATCH = 120, + EMM_ACCESS_BARRED_INFINITE_RETRY = 121, + AUTH_FAILURE_ON_EMERGENCY_CALL = 122, + OEM_DCFAILCAUSE_1 = 4097, + OEM_DCFAILCAUSE_2 = 4098, + OEM_DCFAILCAUSE_3 = 4099, + OEM_DCFAILCAUSE_4 = 4100, + OEM_DCFAILCAUSE_5 = 4101, + OEM_DCFAILCAUSE_6 = 4102, + OEM_DCFAILCAUSE_7 = 4103, + OEM_DCFAILCAUSE_8 = 4104, + OEM_DCFAILCAUSE_9 = 4105, + OEM_DCFAILCAUSE_10 = 4106, + OEM_DCFAILCAUSE_11 = 4107, + OEM_DCFAILCAUSE_12 = 4108, + OEM_DCFAILCAUSE_13 = 4109, + OEM_DCFAILCAUSE_14 = 4110, + OEM_DCFAILCAUSE_15 = 4111, + VOICE_REGISTRATION_FAIL = -1, + DATA_REGISTRATION_FAIL = -2, + SIGNAL_LOST = -3, + PREF_RADIO_TECH_CHANGED = -4, + RADIO_POWER_OFF = -5, + TETHERED_CALL_ACTIVE = -6, + ERROR_UNSPECIFIED = 65535, + LLC_SNDCP = 25, + ACTIVATION_REJECTED_BCM_VIOLATION = 48, + COLLISION_WITH_NETWORK_INITIATED_REQUEST = 56, + ONLY_IPV4V6_ALLOWED = 57, + ONLY_NON_IP_ALLOWED = 58, + UNSUPPORTED_QCI_VALUE = 59, + BEARER_HANDLING_NOT_SUPPORTED = 60, + INVALID_DNS_ADDR = 123, + INVALID_PCSCF_OR_DNS_ADDRESS = 124, + CALL_PREEMPT_BY_EMERGENCY_APN = 127, + UE_INITIATED_DETACH_OR_DISCONNECT = 128, + MIP_FA_REASON_UNSPECIFIED = 2000, + MIP_FA_ADMIN_PROHIBITED = 2001, + MIP_FA_INSUFFICIENT_RESOURCES = 2002, + MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE = 2003, + MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE = 2004, + MIP_FA_REQUESTED_LIFETIME_TOO_LONG = 2005, + MIP_FA_MALFORMED_REQUEST = 2006, + MIP_FA_MALFORMED_REPLY = 2007, + MIP_FA_ENCAPSULATION_UNAVAILABLE = 2008, + MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE = 2009, + MIP_FA_REVERSE_TUNNEL_UNAVAILABLE = 2010, + MIP_FA_REVERSE_TUNNEL_IS_MANDATORY = 2011, + MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED = 2012, + MIP_FA_MISSING_NAI = 2013, + MIP_FA_MISSING_HOME_AGENT = 2014, + MIP_FA_MISSING_HOME_ADDRESS = 2015, + MIP_FA_UNKNOWN_CHALLENGE = 2016, + MIP_FA_MISSING_CHALLENGE = 2017, + MIP_FA_STALE_CHALLENGE = 2018, + MIP_HA_REASON_UNSPECIFIED = 2019, + MIP_HA_ADMIN_PROHIBITED = 2020, + MIP_HA_INSUFFICIENT_RESOURCES = 2021, + MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE = 2022, + MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE = 2023, + MIP_HA_REGISTRATION_ID_MISMATCH = 2024, + MIP_HA_MALFORMED_REQUEST = 2025, + MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS = 2026, + MIP_HA_REVERSE_TUNNEL_UNAVAILABLE = 2027, + MIP_HA_REVERSE_TUNNEL_IS_MANDATORY = 2028, + MIP_HA_ENCAPSULATION_UNAVAILABLE = 2029, + CLOSE_IN_PROGRESS = 2030, + NETWORK_INITIATED_TERMINATION = 2031, + MODEM_APP_PREEMPTED = 2032, + PDN_IPV4_CALL_DISALLOWED = 2033, + PDN_IPV4_CALL_THROTTLED = 2034, + PDN_IPV6_CALL_DISALLOWED = 2035, + PDN_IPV6_CALL_THROTTLED = 2036, + MODEM_RESTART = 2037, + PDP_PPP_NOT_SUPPORTED = 2038, + UNPREFERRED_RAT = 2039, + PHYSICAL_LINK_CLOSE_IN_PROGRESS = 2040, + APN_PENDING_HANDOVER = 2041, + PROFILE_BEARER_INCOMPATIBLE = 2042, + SIM_CARD_CHANGED = 2043, + LOW_POWER_MODE_OR_POWERING_DOWN = 2044, + APN_DISABLED = 2045, + MAX_PPP_INACTIVITY_TIMER_EXPIRED = 2046, + IPV6_ADDRESS_TRANSFER_FAILED = 2047, + TRAT_SWAP_FAILED = 2048, + EHRPD_TO_HRPD_FALLBACK = 2049, + MIP_CONFIG_FAILURE = 2050, + PDN_INACTIVITY_TIMER_EXPIRED = 2051, + MAX_IPV4_CONNECTIONS = 2052, + MAX_IPV6_CONNECTIONS = 2053, + APN_MISMATCH = 2054, + IP_VERSION_MISMATCH = 2055, + DUN_CALL_DISALLOWED = 2056, + INTERNAL_EPC_NONEPC_TRANSITION = 2057, + INTERFACE_IN_USE = 2058, + APN_DISALLOWED_ON_ROAMING = 2059, + APN_PARAMETERS_CHANGED = 2060, + NULL_APN_DISALLOWED = 2061, + THERMAL_MITIGATION = 2062, + DATA_SETTINGS_DISABLED = 2063, + DATA_ROAMING_SETTINGS_DISABLED = 2064, + DDS_SWITCHED = 2065, + FORBIDDEN_APN_NAME = 2066, + DDS_SWITCH_IN_PROGRESS = 2067, + CALL_DISALLOWED_IN_ROAMING = 2068, + NON_IP_NOT_SUPPORTED = 2069, + PDN_NON_IP_CALL_THROTTLED = 2070, + PDN_NON_IP_CALL_DISALLOWED = 2071, + CDMA_LOCK = 2072, + CDMA_INTERCEPT = 2073, + CDMA_REORDER = 2074, + CDMA_RELEASE_DUE_TO_SO_REJECTION = 2075, + CDMA_INCOMING_CALL = 2076, + CDMA_ALERT_STOP = 2077, + CHANNEL_ACQUISITION_FAILURE = 2078, + MAX_ACCESS_PROBE = 2079, + CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION = 2080, + NO_RESPONSE_FROM_BASE_STATION = 2081, + REJECTED_BY_BASE_STATION = 2082, + CONCURRENT_SERVICES_INCOMPATIBLE = 2083, + NO_CDMA_SERVICE = 2084, + RUIM_NOT_PRESENT = 2085, + CDMA_RETRY_ORDER = 2086, + ACCESS_BLOCK = 2087, + ACCESS_BLOCK_ALL = 2088, + IS707B_MAX_ACCESS_PROBES = 2089, + THERMAL_EMERGENCY = 2090, + CONCURRENT_SERVICES_NOT_ALLOWED = 2091, + INCOMING_CALL_REJECTED = 2092, + NO_SERVICE_ON_GATEWAY = 2093, + NO_GPRS_CONTEXT = 2094, + ILLEGAL_MS = 2095, + ILLEGAL_ME = 2096, + GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 2097, + GPRS_SERVICES_NOT_ALLOWED = 2098, + MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK = 2099, + IMPLICITLY_DETACHED = 2100, + PLMN_NOT_ALLOWED = 2101, + LOCATION_AREA_NOT_ALLOWED = 2102, + GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = 2103, + PDP_DUPLICATE = 2104, + UE_RAT_CHANGE = 2105, + CONGESTION = 2106, + NO_PDP_CONTEXT_ACTIVATED = 2107, + ACCESS_CLASS_DSAC_REJECTION = 2108, + PDP_ACTIVATE_MAX_RETRY_FAILED = 2109, + RADIO_ACCESS_BEARER_FAILURE = 2110, + ESM_UNKNOWN_EPS_BEARER_CONTEXT = 2111, + DRB_RELEASED_BY_RRC = 2112, + CONNECTION_RELEASED = 2113, + EMM_DETACHED = 2114, + EMM_ATTACH_FAILED = 2115, + EMM_ATTACH_STARTED = 2116, + LTE_NAS_SERVICE_REQUEST_FAILED = 2117, + DUPLICATE_BEARER_ID = 2118, + ESM_COLLISION_SCENARIOS = 2119, + ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK = 2120, + ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER = 2121, + ESM_BAD_OTA_MESSAGE = 2122, + ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL = 2123, + ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT = 2124, + DS_EXPLICIT_DEACTIVATION = 2125, + ESM_LOCAL_CAUSE_NONE = 2126, + LTE_THROTTLING_NOT_REQUIRED = 2127, + ACCESS_CONTROL_LIST_CHECK_FAILURE = 2128, + SERVICE_NOT_ALLOWED_ON_PLMN = 2129, + EMM_T3417_EXPIRED = 2130, + EMM_T3417_EXT_EXPIRED = 2131, + RRC_UPLINK_DATA_TRANSMISSION_FAILURE = 2132, + RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER = 2133, + RRC_UPLINK_CONNECTION_RELEASE = 2134, + RRC_UPLINK_RADIO_LINK_FAILURE = 2135, + RRC_UPLINK_ERROR_REQUEST_FROM_NAS = 2136, + RRC_CONNECTION_ACCESS_STRATUM_FAILURE = 2137, + RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS = 2138, + RRC_CONNECTION_ACCESS_BARRED = 2139, + RRC_CONNECTION_CELL_RESELECTION = 2140, + RRC_CONNECTION_CONFIG_FAILURE = 2141, + RRC_CONNECTION_TIMER_EXPIRED = 2142, + RRC_CONNECTION_LINK_FAILURE = 2143, + RRC_CONNECTION_CELL_NOT_CAMPED = 2144, + RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE = 2145, + RRC_CONNECTION_REJECT_BY_NETWORK = 2146, + RRC_CONNECTION_NORMAL_RELEASE = 2147, + RRC_CONNECTION_RADIO_LINK_FAILURE = 2148, + RRC_CONNECTION_REESTABLISHMENT_FAILURE = 2149, + RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER = 2150, + RRC_CONNECTION_ABORT_REQUEST = 2151, + RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR = 2152, + NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH = 2153, + NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH = 2154, + ESM_PROCEDURE_TIME_OUT = 2155, + INVALID_CONNECTION_ID = 2156, + MAXIMIUM_NSAPIS_EXCEEDED = 2157, + INVALID_PRIMARY_NSAPI = 2158, + CANNOT_ENCODE_OTA_MESSAGE = 2159, + RADIO_ACCESS_BEARER_SETUP_FAILURE = 2160, + PDP_ESTABLISH_TIMEOUT_EXPIRED = 2161, + PDP_MODIFY_TIMEOUT_EXPIRED = 2162, + PDP_INACTIVE_TIMEOUT_EXPIRED = 2163, + PDP_LOWERLAYER_ERROR = 2164, + PDP_MODIFY_COLLISION = 2165, + MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 2166, + NAS_REQUEST_REJECTED_BY_NETWORK = 2167, + RRC_CONNECTION_INVALID_REQUEST = 2168, + RRC_CONNECTION_TRACKING_AREA_ID_CHANGED = 2169, + RRC_CONNECTION_RF_UNAVAILABLE = 2170, + RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE = 2171, + RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE = 2172, + RRC_CONNECTION_ABORTED_AFTER_HANDOVER = 2173, + RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE = 2174, + RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE = 2175, + IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER = 2176, + IMEI_NOT_ACCEPTED = 2177, + EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = 2178, + EPS_SERVICES_NOT_ALLOWED_IN_PLMN = 2179, + MSC_TEMPORARILY_NOT_REACHABLE = 2180, + CS_DOMAIN_NOT_AVAILABLE = 2181, + ESM_FAILURE = 2182, + MAC_FAILURE = 2183, + SYNCHRONIZATION_FAILURE = 2184, + UE_SECURITY_CAPABILITIES_MISMATCH = 2185, + SECURITY_MODE_REJECTED = 2186, + UNACCEPTABLE_NON_EPS_AUTHENTICATION = 2187, + CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED = 2188, + NO_EPS_BEARER_CONTEXT_ACTIVATED = 2189, + INVALID_EMM_STATE = 2190, + NAS_LAYER_FAILURE = 2191, + MULTIPLE_PDP_CALL_NOT_ALLOWED = 2192, + EMBMS_NOT_ENABLED = 2193, + IRAT_HANDOVER_FAILED = 2194, + EMBMS_REGULAR_DEACTIVATION = 2195, + TEST_LOOPBACK_REGULAR_DEACTIVATION = 2196, + LOWER_LAYER_REGISTRATION_FAILURE = 2197, + DATA_PLAN_EXPIRED = 2198, + UMTS_HANDOVER_TO_IWLAN = 2199, + EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY = 2200, + EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE = 2201, + EVDO_HDR_CHANGED = 2202, + EVDO_HDR_EXITED = 2203, + EVDO_HDR_NO_SESSION = 2204, + EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL = 2205, + EVDO_HDR_CONNECTION_SETUP_TIMEOUT = 2206, + FAILED_TO_ACQUIRE_COLOCATED_HDR = 2207, + OTASP_COMMIT_IN_PROGRESS = 2208, + NO_HYBRID_HDR_SERVICE = 2209, + HDR_NO_LOCK_GRANTED = 2210, + DBM_OR_SMS_IN_PROGRESS = 2211, + HDR_FADE = 2212, + HDR_ACCESS_FAILURE = 2213, + UNSUPPORTED_1X_PREV = 2214, + LOCAL_END = 2215, + NO_SERVICE = 2216, + FADE = 2217, + NORMAL_RELEASE = 2218, + ACCESS_ATTEMPT_ALREADY_IN_PROGRESS = 2219, + REDIRECTION_OR_HANDOFF_IN_PROGRESS = 2220, + EMERGENCY_MODE = 2221, + PHONE_IN_USE = 2222, + INVALID_MODE = 2223, + INVALID_SIM_STATE = 2224, + NO_COLLOCATED_HDR = 2225, + UE_IS_ENTERING_POWERSAVE_MODE = 2226, + DUAL_SWITCH = 2227, + PPP_TIMEOUT = 2228, + PPP_AUTH_FAILURE = 2229, + PPP_OPTION_MISMATCH = 2230, + PPP_PAP_FAILURE = 2231, + PPP_CHAP_FAILURE = 2232, + PPP_CLOSE_IN_PROGRESS = 2233, + LIMITED_TO_IPV4 = 2234, + LIMITED_TO_IPV6 = 2235, + VSNCP_TIMEOUT = 2236, + VSNCP_GEN_ERROR = 2237, + VSNCP_APN_UNAUTHORIZED = 2238, + VSNCP_PDN_LIMIT_EXCEEDED = 2239, + VSNCP_NO_PDN_GATEWAY_ADDRESS = 2240, + VSNCP_PDN_GATEWAY_UNREACHABLE = 2241, + VSNCP_PDN_GATEWAY_REJECT = 2242, + VSNCP_INSUFFICIENT_PARAMETERS = 2243, + VSNCP_RESOURCE_UNAVAILABLE = 2244, + VSNCP_ADMINISTRATIVELY_PROHIBITED = 2245, + VSNCP_PDN_ID_IN_USE = 2246, + VSNCP_SUBSCRIBER_LIMITATION = 2247, + VSNCP_PDN_EXISTS_FOR_THIS_APN = 2248, + VSNCP_RECONNECT_NOT_ALLOWED = 2249, + IPV6_PREFIX_UNAVAILABLE = 2250, + HANDOFF_PREFERENCE_CHANGED = 2251, + SLICE_REJECTED = 2252, + MATCH_ALL_RULE_NOT_ALLOWED = 2253, + ALL_MATCHING_RULES_FAILED = 2254, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataConnActiveStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataConnActiveStatus.aidl new file mode 100644 index 0000000000..0d11390aef --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataConnActiveStatus.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 -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; +@Backing(type="int") @VintfStability +enum DataConnActiveStatus { + INACTIVE = 0, + DORMANT = 1, + ACTIVE = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileId.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileId.aidl new file mode 100644 index 0000000000..2c86c0fc49 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileId.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 -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; +@Backing(type="int") @VintfStability +enum DataProfileId { + DEFAULT = 0, + TETHERED = 1, + IMS = 2, + FOTA = 3, + CBS = 4, + OEM_BASE = 1000, + INVALID = -1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfo.aidl new file mode 100644 index 0000000000..d9d0487e5a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfo.aidl @@ -0,0 +1,55 @@ +/* + * 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 -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; +@VintfStability +parcelable DataProfileInfo { + android.hardware.radio.DataProfileId profileId; + String apn; + android.hardware.radio.PdpProtocolType protocol; + android.hardware.radio.PdpProtocolType roamingProtocol; + android.hardware.radio.ApnAuthType authType; + String user; + String password; + android.hardware.radio.DataProfileInfoType type; + int maxConnsTime; + int maxConns; + int waitTime; + boolean enabled; + android.hardware.radio.ApnTypes supportedApnTypesBitmap; + android.hardware.radio.RadioAccessFamily bearerBitmap; + int mtuV4; + int mtuV6; + boolean preferred; + boolean persistent; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfoType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfoType.aidl new file mode 100644 index 0000000000..a559de0829 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfoType.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 -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; +@Backing(type="int") @VintfStability +enum DataProfileInfoType { + COMMON = 0, + THREE_GPP = 1, + THREE_GPP2 = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResult.aidl new file mode 100644 index 0000000000..303035f620 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResult.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 -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; +@VintfStability +parcelable DataRegStateResult { + android.hardware.radio.RegState regState; + int rat; + int reasonDataDenied; + int maxDataCalls; + android.hardware.radio.CellIdentity cellIdentity; + android.hardware.radio.DataRegStateResultVopsInfo vopsInfo; + android.hardware.radio.NrIndicators nrIndicators; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResultVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResultVopsInfo.aidl new file mode 100644 index 0000000000..2ce646e386 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResultVopsInfo.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 -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; +@VintfStability +union DataRegStateResultVopsInfo { + boolean noinit; + android.hardware.radio.LteVopsInfo lteVopsInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRequestReason.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRequestReason.aidl new file mode 100644 index 0000000000..1dd0e08ca9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRequestReason.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 -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; +@Backing(type="int") @VintfStability +enum DataRequestReason { + NORMAL = 1, + SHUTDOWN = 2, + HANDOVER = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataThrottlingAction.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataThrottlingAction.aidl new file mode 100644 index 0000000000..70aaa0f4af --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataThrottlingAction.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 -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; +@Backing(type="byte") @VintfStability +enum DataThrottlingAction { + NO_DATA_THROTTLING = 0, + THROTTLE_SECONDARY_CARRIER = 1, + THROTTLE_ANCHOR_CARRIER = 2, + HOLD = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DeviceStateType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DeviceStateType.aidl new file mode 100644 index 0000000000..2d3cea8bba --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DeviceStateType.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 -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; +@Backing(type="int") @VintfStability +enum DeviceStateType { + POWER_SAVE_MODE = 0, + CHARGING_STATE = 1, + LOW_DATA_EXPECTED = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Dial.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Dial.aidl new file mode 100644 index 0000000000..f8edf48d44 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Dial.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 -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; +@VintfStability +parcelable Dial { + String address; + android.hardware.radio.Clir clir; + android.hardware.radio.UusInfo[] uusInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Domain.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Domain.aidl new file mode 100644 index 0000000000..062af35c27 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Domain.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 -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; +@Backing(type="int") @VintfStability +enum Domain { + CS = 1, + PS = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmcIndicator.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmcIndicator.aidl new file mode 100644 index 0000000000..846084b401 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmcIndicator.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 -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; +@Backing(type="byte") @VintfStability +enum EmcIndicator { + EMC_NOT_SUPPORTED = 0, + EMC_NR_CONNECTED_TO_5GCN = 1, + EMC_EUTRA_CONNECTED_TO_5GCN = 2, + EMC_BOTH_NR_EUTRA_CONNECTED_TO_5GCN = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyCallRouting.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyCallRouting.aidl new file mode 100644 index 0000000000..95f5a46059 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyCallRouting.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 -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; +@Backing(type="int") @VintfStability +enum EmergencyCallRouting { + UNKNOWN = 0, + EMERGENCY = 1, + NORMAL = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumber.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumber.aidl new file mode 100644 index 0000000000..7aa4cd8f9e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumber.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 -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; +@VintfStability +parcelable EmergencyNumber { + String number; + String mcc; + String mnc; + android.hardware.radio.EmergencyServiceCategory categories; + String[] urns; + android.hardware.radio.EmergencyNumberSource sources; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumberSource.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumberSource.aidl new file mode 100644 index 0000000000..1424bfa6ea --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumberSource.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 -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; +@Backing(type="int") @VintfStability +enum EmergencyNumberSource { + NETWORK_SIGNALING = 1, + SIM = 2, + MODEM_CONFIG = 4, + DEFAULT = 8, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyServiceCategory.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyServiceCategory.aidl new file mode 100644 index 0000000000..0341572f10 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyServiceCategory.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 -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; +@Backing(type="int") @VintfStability +enum EmergencyServiceCategory { + UNSPECIFIED = 0, + POLICE = 1, + AMBULANCE = 2, + FIRE_BRIGADE = 4, + MARINE_GUARD = 8, + MOUNTAIN_RESCUE = 16, + MIEC = 32, + AIEC = 64, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmfIndicator.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmfIndicator.aidl new file mode 100644 index 0000000000..21100f2a12 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmfIndicator.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 -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; +@Backing(type="byte") @VintfStability +enum EmfIndicator { + EMF_NOT_SUPPORTED = 0, + EMF_NR_CONNECTED_TO_5GCN = 1, + EMF_EUTRA_CONNECTED_TO_5GCN = 2, + EMF_BOTH_NR_EUTRA_CONNECTED_TO_5GCN = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EpsQos.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EpsQos.aidl new file mode 100644 index 0000000000..8eb3fdaa25 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EpsQos.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 -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; +@VintfStability +parcelable EpsQos { + int qci; + android.hardware.radio.QosBandwidth downlink; + android.hardware.radio.QosBandwidth uplink; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EutranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EutranBands.aidl new file mode 100644 index 0000000000..1449865474 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EutranBands.aidl @@ -0,0 +1,97 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum EutranBands { + BAND_1 = 1, + BAND_2 = 2, + BAND_3 = 3, + BAND_4 = 4, + BAND_5 = 5, + BAND_6 = 6, + BAND_7 = 7, + BAND_8 = 8, + BAND_9 = 9, + BAND_10 = 10, + BAND_11 = 11, + BAND_12 = 12, + BAND_13 = 13, + BAND_14 = 14, + BAND_17 = 17, + BAND_18 = 18, + BAND_19 = 19, + BAND_20 = 20, + BAND_21 = 21, + BAND_22 = 22, + BAND_23 = 23, + BAND_24 = 24, + BAND_25 = 25, + BAND_26 = 26, + BAND_27 = 27, + BAND_28 = 28, + BAND_30 = 30, + BAND_31 = 31, + BAND_33 = 33, + BAND_34 = 34, + BAND_35 = 35, + BAND_36 = 36, + BAND_37 = 37, + BAND_38 = 38, + BAND_39 = 39, + BAND_40 = 40, + BAND_41 = 41, + BAND_42 = 42, + BAND_43 = 43, + BAND_44 = 44, + BAND_45 = 45, + BAND_46 = 46, + BAND_47 = 47, + BAND_48 = 48, + BAND_65 = 65, + BAND_66 = 66, + BAND_68 = 68, + BAND_70 = 70, + BAND_49 = 49, + BAND_50 = 50, + BAND_51 = 51, + BAND_52 = 52, + BAND_53 = 53, + BAND_71 = 71, + BAND_72 = 72, + BAND_73 = 73, + BAND_74 = 74, + BAND_85 = 85, + BAND_87 = 87, + BAND_88 = 88, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EvdoSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EvdoSignalStrength.aidl new file mode 100644 index 0000000000..148dfa093c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EvdoSignalStrength.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 -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; +@VintfStability +parcelable EvdoSignalStrength { + int dbm; + int ecio; + int signalNoiseRatio; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/FrequencyRange.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/FrequencyRange.aidl new file mode 100644 index 0000000000..243b54e4d1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/FrequencyRange.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 -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; +@Backing(type="int") @VintfStability +enum FrequencyRange { + LOW = 1, + MID = 2, + HIGH = 3, + MMWAVE = 4, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GeranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GeranBands.aidl new file mode 100644 index 0000000000..0efe023429 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GeranBands.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum GeranBands { + BAND_T380 = 1, + BAND_T410 = 2, + BAND_450 = 3, + BAND_480 = 4, + BAND_710 = 5, + BAND_750 = 6, + BAND_T810 = 7, + BAND_850 = 8, + BAND_P900 = 9, + BAND_E900 = 10, + BAND_R900 = 11, + BAND_DCS1800 = 12, + BAND_PCS1900 = 13, + BAND_ER900 = 14, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GsmBroadcastSmsConfigInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GsmBroadcastSmsConfigInfo.aidl new file mode 100644 index 0000000000..e74845e250 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GsmBroadcastSmsConfigInfo.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 -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; +@VintfStability +parcelable GsmBroadcastSmsConfigInfo { + int fromServiceId; + int toServiceId; + int fromCodeScheme; + int toCodeScheme; + boolean selected; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GsmSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GsmSignalStrength.aidl new file mode 100644 index 0000000000..5d3a6e1a32 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GsmSignalStrength.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 -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; +@VintfStability +parcelable GsmSignalStrength { + int signalStrength; + int bitErrorRate; + int timingAdvance; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GsmSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GsmSmsMessage.aidl new file mode 100644 index 0000000000..1b00b0f099 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/GsmSmsMessage.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 -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; +@VintfStability +parcelable GsmSmsMessage { + String smscPdu; + String pdu; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HandoverFailureMode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HandoverFailureMode.aidl new file mode 100644 index 0000000000..661b7b771a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HandoverFailureMode.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 -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; +@Backing(type="byte") @VintfStability +enum HandoverFailureMode { + LEGACY = 0, + DO_FALLBACK = 1, + NO_FALLBACK_RETRY_HANDOVER = 2, + NO_FALLBACK_RETRY_SETUP_NORMAL = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfig.aidl new file mode 100644 index 0000000000..4a5c1076bc --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfig.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 -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; +@VintfStability +parcelable HardwareConfig { + android.hardware.radio.HardwareConfigType type; + String uuid; + android.hardware.radio.HardwareConfigState state; + android.hardware.radio.HardwareConfigModem[] modem; + android.hardware.radio.HardwareConfigSim[] sim; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigModem.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigModem.aidl new file mode 100644 index 0000000000..08e12e6f25 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigModem.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 -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; +@VintfStability +parcelable HardwareConfigModem { + int rilModel; + int rat; + int maxVoice; + int maxData; + int maxStandby; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigSim.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigSim.aidl new file mode 100644 index 0000000000..8df23b4bcc --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigSim.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 -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; +@VintfStability +parcelable HardwareConfigSim { + String modemUuid; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigState.aidl new file mode 100644 index 0000000000..672fe47462 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigState.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 -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; +@Backing(type="int") @VintfStability +enum HardwareConfigState { + ENABLED = 0, + STANDBY = 1, + DISABLED = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigType.aidl new file mode 100644 index 0000000000..a152282dc9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigType.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 -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; +@Backing(type="int") @VintfStability +enum HardwareConfigType { + MODEM = 0, + SIM = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadio.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadio.aidl new file mode 100644 index 0000000000..5a7b251271 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadio.aidl @@ -0,0 +1,200 @@ +/* + * 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 -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; +@VintfStability +interface IRadio { + oneway void acceptCall(in int serial); + oneway void acknowledgeIncomingGsmSmsWithPdu(in int serial, in boolean success, in String ackPdu); + oneway void acknowledgeLastIncomingCdmaSms(in int serial, in android.hardware.radio.CdmaSmsAck smsAck); + oneway void acknowledgeLastIncomingGsmSms(in int serial, in boolean success, in android.hardware.radio.SmsAcknowledgeFailCause cause); + oneway void allocatePduSessionId(in int serial); + oneway void areUiccApplicationsEnabled(in int serial); + oneway void cancelHandover(in int serial, in int callId); + oneway void cancelPendingUssd(in int serial); + oneway void changeIccPin2ForApp(in int serial, in String oldPin2, in String newPin2, in String aid); + oneway void changeIccPinForApp(in int serial, in String oldPin, in String newPin, in String aid); + oneway void conference(in int serial); + oneway void deactivateDataCall(in int serial, in int cid, in android.hardware.radio.DataRequestReason reason); + oneway void deleteSmsOnRuim(in int serial, in int index); + oneway void deleteSmsOnSim(in int serial, in int index); + oneway void dial(in int serial, in android.hardware.radio.Dial dialInfo); + oneway void emergencyDial(in int serial, in android.hardware.radio.Dial dialInfo, in android.hardware.radio.EmergencyServiceCategory categories, in String[] urns, in android.hardware.radio.EmergencyCallRouting routing, in boolean hasKnownUserIntentEmergency, in boolean isTesting); + oneway void enableModem(in int serial, in boolean on); + oneway void enableUiccApplications(in int serial, in boolean enable); + oneway void exitEmergencyCallbackMode(in int serial); + oneway void explicitCallTransfer(in int serial); + oneway void getAllowedCarriers(in int serial); + oneway void getAllowedNetworkTypesBitmap(in int serial); + oneway void getAvailableBandModes(in int serial); + oneway void getAvailableNetworks(in int serial); + oneway void getBarringInfo(in int serial); + oneway void getBasebandVersion(in int serial); + oneway void getCDMASubscription(in int serial); + oneway void getCallForwardStatus(in int serial, in android.hardware.radio.CallForwardInfo callInfo); + oneway void getCallWaiting(in int serial, in int serviceClass); + oneway void getCdmaBroadcastConfig(in int serial); + oneway void getCdmaRoamingPreference(in int serial); + oneway void getCdmaSubscriptionSource(in int serial); + oneway void getCellInfoList(in int serial); + oneway void getClip(in int serial); + oneway void getClir(in int serial); + oneway void getCurrentCalls(in int serial); + oneway void getDataCallList(in int serial); + oneway void getDataRegistrationState(in int serial); + oneway void getDeviceIdentity(in int serial); + oneway void getFacilityLockForApp(in int serial, in String facility, in String password, in int serviceClass, in String appId); + oneway void getGsmBroadcastConfig(in int serial); + oneway void getHardwareConfig(in int serial); + oneway void getIccCardStatus(in int serial); + oneway void getImsRegistrationState(in int serial); + oneway void getImsiForApp(in int serial, in String aid); + oneway void getLastCallFailCause(in int serial); + oneway void getModemActivityInfo(in int serial); + oneway void getModemStackStatus(in int serial); + oneway void getMute(in int serial); + oneway void getNeighboringCids(in int serial); + oneway void getNetworkSelectionMode(in int serial); + oneway void getOperator(in int serial); + oneway void getPreferredNetworkType(in int serial); + oneway void getPreferredNetworkTypeBitmap(in int serial); + oneway void getPreferredVoicePrivacy(in int serial); + oneway void getRadioCapability(in int serial); + oneway void getSignalStrength(in int serial); + oneway void getSimPhonebookCapacity(in int serial); + oneway void getSimPhonebookRecords(in int serial); + oneway void getSlicingConfig(in int serial); + oneway void getSmscAddress(in int serial); + oneway void getSystemSelectionChannels(in int serial); + oneway void getTTYMode(in int serial); + oneway void getVoiceRadioTechnology(in int serial); + oneway void getVoiceRegistrationState(in int serial); + oneway void handleStkCallSetupRequestFromSim(in int serial, in boolean accept); + oneway void hangup(in int serial, in int gsmIndex); + oneway void hangupForegroundResumeBackground(in int serial); + oneway void hangupWaitingOrBackground(in int serial); + oneway void iccCloseLogicalChannel(in int serial, in int channelId); + oneway void iccIOForApp(in int serial, in android.hardware.radio.IccIo iccIo); + oneway void iccOpenLogicalChannel(in int serial, in String aid, in int p2); + oneway void iccTransmitApduBasicChannel(in int serial, in android.hardware.radio.SimApdu message); + oneway void iccTransmitApduLogicalChannel(in int serial, in android.hardware.radio.SimApdu message); + oneway void isNrDualConnectivityEnabled(in int serial); + oneway void nvReadItem(in int serial, in android.hardware.radio.NvItem itemId); + oneway void nvResetConfig(in int serial, in android.hardware.radio.ResetNvType resetType); + oneway void nvWriteCdmaPrl(in int serial, in byte[] prl); + oneway void nvWriteItem(in int serial, in android.hardware.radio.NvWriteItem item); + oneway void pullLceData(in int serial); + oneway void rejectCall(in int serial); + oneway void releasePduSessionId(in int serial, in int id); + oneway void reportSmsMemoryStatus(in int serial, in boolean available); + oneway void reportStkServiceIsRunning(in int serial); + oneway void requestIccSimAuthentication(in int serial, in int authContext, in String authData, in String aid); + oneway void requestIsimAuthentication(in int serial, in String challenge); + oneway void requestShutdown(in int serial); + oneway void responseAcknowledgement(); + oneway void sendBurstDtmf(in int serial, in String dtmf, in int on, in int off); + oneway void sendCDMAFeatureCode(in int serial, in String featureCode); + oneway void sendCdmaSms(in int serial, in android.hardware.radio.CdmaSmsMessage sms); + oneway void sendCdmaSmsExpectMore(in int serial, in android.hardware.radio.CdmaSmsMessage sms); + oneway void sendDeviceState(in int serial, in android.hardware.radio.DeviceStateType deviceStateType, in boolean state); + oneway void sendDtmf(in int serial, in String s); + oneway void sendEnvelope(in int serial, in String command); + oneway void sendEnvelopeWithStatus(in int serial, in String contents); + oneway void sendImsSms(in int serial, in android.hardware.radio.ImsSmsMessage message); + oneway void sendSMSExpectMore(in int serial, in android.hardware.radio.GsmSmsMessage message); + oneway void sendSms(in int serial, in android.hardware.radio.GsmSmsMessage message); + oneway void sendSmsExpectMore(in int serial, in android.hardware.radio.GsmSmsMessage message); + oneway void sendTerminalResponseToSim(in int serial, in String commandResponse); + oneway void sendUssd(in int serial, in String ussd); + oneway void separateConnection(in int serial, in int gsmIndex); + oneway void setAllowedCarriers(in int serial, in android.hardware.radio.CarrierRestrictionsWithPriority carriers, in android.hardware.radio.SimLockMultiSimPolicy multiSimPolicy); + oneway void setAllowedNetworkTypesBitmap(in int serial, in android.hardware.radio.RadioAccessFamily networkTypeBitmap); + oneway void setBandMode(in int serial, in android.hardware.radio.RadioBandMode mode); + oneway void setBarringPassword(in int serial, in String facility, in String oldPassword, in String newPassword); + oneway void setCallForward(in int serial, in android.hardware.radio.CallForwardInfo callInfo); + oneway void setCallWaiting(in int serial, in boolean enable, in int serviceClass); + oneway void setCarrierInfoForImsiEncryption(in int serial, in android.hardware.radio.ImsiEncryptionInfo imsiEncryptionInfo); + oneway void setCdmaBroadcastActivation(in int serial, in boolean activate); + oneway void setCdmaBroadcastConfig(in int serial, in android.hardware.radio.CdmaBroadcastSmsConfigInfo[] configInfo); + oneway void setCdmaRoamingPreference(in int serial, in android.hardware.radio.CdmaRoamingType type); + oneway void setCdmaSubscriptionSource(in int serial, in android.hardware.radio.CdmaSubscriptionSource cdmaSub); + oneway void setCellInfoListRate(in int serial, in int rate); + oneway void setClir(in int serial, in int status); + oneway void setDataAllowed(in int serial, in boolean allow); + oneway void setDataProfile(in int serial, in android.hardware.radio.DataProfileInfo[] profiles); + oneway void setDataThrottling(in int serial, in android.hardware.radio.DataThrottlingAction dataThrottlingAction, in long completionDurationMillis); + oneway void setFacilityLockForApp(in int serial, in String facility, in boolean lockState, in String password, in int serviceClass, in String appId); + oneway void setGsmBroadcastActivation(in int serial, in boolean activate); + oneway void setGsmBroadcastConfig(in int serial, in android.hardware.radio.GsmBroadcastSmsConfigInfo[] configInfo); + oneway void setIndicationFilter(in int serial, in android.hardware.radio.IndicationFilter indicationFilter); + oneway void setInitialAttachApn(in int serial, in android.hardware.radio.DataProfileInfo dataProfileInfo); + oneway void setLinkCapacityReportingCriteria(in int serial, in int hysteresisMs, in int hysteresisDlKbps, in int hysteresisUlKbps, in int[] thresholdsDownlinkKbps, in int[] thresholdsUplinkKbps, in android.hardware.radio.AccessNetwork accessNetwork); + oneway void setLocationUpdates(in int serial, in boolean enable); + oneway void setMute(in int serial, in boolean enable); + oneway void setNetworkSelectionModeAutomatic(in int serial); + oneway void setNetworkSelectionModeManual(in int serial, in String operatorNumeric, in android.hardware.radio.RadioAccessNetworks ran); + oneway void setNrDualConnectivityState(in int serial, in android.hardware.radio.NrDualConnectivityState nrDualConnectivityState); + oneway void setPreferredNetworkType(in int serial, in android.hardware.radio.PreferredNetworkType nwType); + oneway void setPreferredNetworkTypeBitmap(in int serial, in android.hardware.radio.RadioAccessFamily networkTypeBitmap); + oneway void setPreferredVoicePrivacy(in int serial, in boolean enable); + oneway void setRadioCapability(in int serial, in android.hardware.radio.RadioCapability rc); + oneway void setRadioPower(in int serial, in boolean powerOn, in boolean forEmergencyCall, in boolean preferredForEmergencyCall); + void setResponseFunctions(in android.hardware.radio.IRadioResponse radioResponse, in android.hardware.radio.IRadioIndication radioIndication); + oneway void setSignalStrengthReportingCriteria(in int serial, in android.hardware.radio.SignalThresholdInfo signalThresholdInfo, in android.hardware.radio.AccessNetwork accessNetwork); + oneway void setSimCardPower(in int serial, in android.hardware.radio.CardPowerState powerUp); + oneway void setSmscAddress(in int serial, in String smsc); + oneway void setSuppServiceNotifications(in int serial, in boolean enable); + oneway void setSystemSelectionChannels(in int serial, in boolean specifyChannels, in android.hardware.radio.RadioAccessSpecifier[] specifiers); + oneway void setTTYMode(in int serial, in android.hardware.radio.TtyMode mode); + oneway void setUiccSubscription(in int serial, in android.hardware.radio.SelectUiccSub uiccSub); + oneway void setupDataCall(in int serial, in android.hardware.radio.AccessNetwork accessNetwork, in android.hardware.radio.DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in android.hardware.radio.DataRequestReason reason, in android.hardware.radio.LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in android.hardware.radio.OptionalSliceInfo sliceInfo, in android.hardware.radio.OptionalTrafficDescriptor trafficDescriptor, in boolean matchAllRuleAllowed); + oneway void startDtmf(in int serial, in String s); + oneway void startHandover(in int serial, in int callId); + oneway void startKeepalive(in int serial, in android.hardware.radio.KeepaliveRequest keepalive); + oneway void startLceService(in int serial, in int reportInterval, in boolean pullMode); + oneway void startNetworkScan(in int serial, in android.hardware.radio.NetworkScanRequest request); + oneway void stopDtmf(in int serial); + oneway void stopKeepalive(in int serial, in int sessionHandle); + oneway void stopLceService(in int serial); + oneway void stopNetworkScan(in int serial); + oneway void supplyIccPin2ForApp(in int serial, in String pin2, in String aid); + oneway void supplyIccPinForApp(in int serial, in String pin, in String aid); + oneway void supplyIccPuk2ForApp(in int serial, in String puk2, in String pin2, in String aid); + oneway void supplyIccPukForApp(in int serial, in String puk, in String pin, in String aid); + oneway void supplyNetworkDepersonalization(in int serial, in String netPin); + oneway void supplySimDepersonalization(in int serial, in android.hardware.radio.PersoSubstate persoType, in String controlKey); + oneway void switchWaitingOrHoldingAndActive(in int serial); + oneway void updateSimPhonebookRecords(in int serial, in android.hardware.radio.PhonebookRecordInfo recordInfo); + oneway void writeSmsToRuim(in int serial, in android.hardware.radio.CdmaSmsWriteArgs cdmaSms); + oneway void writeSmsToSim(in int serial, in android.hardware.radio.SmsWriteArgs smsWriteArgs); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadioIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadioIndication.aidl new file mode 100644 index 0000000000..48e9e3ec3e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadioIndication.aidl @@ -0,0 +1,94 @@ +/* + * 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 -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; +@VintfStability +interface IRadioIndication { + oneway void barringInfoChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.CellIdentity cellIdentity, in android.hardware.radio.BarringInfo[] barringInfos); + oneway void callRing(in android.hardware.radio.RadioIndicationType type, in boolean isGsm, in android.hardware.radio.CdmaSignalInfoRecord record); + oneway void callStateChanged(in android.hardware.radio.RadioIndicationType type); + oneway void carrierInfoForImsiEncryption(in android.hardware.radio.RadioIndicationType info); + oneway void cdmaCallWaiting(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.CdmaCallWaiting callWaitingRecord); + oneway void cdmaInfoRec(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.CdmaInformationRecords records); + oneway void cdmaNewSms(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.CdmaSmsMessage msg); + oneway void cdmaOtaProvisionStatus(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.CdmaOtaProvisionStatus status); + oneway void cdmaPrlChanged(in android.hardware.radio.RadioIndicationType type, in int version); + oneway void cdmaRuimSmsStorageFull(in android.hardware.radio.RadioIndicationType type); + oneway void cdmaSubscriptionSourceChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.CdmaSubscriptionSource cdmaSource); + oneway void cellInfoList(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.CellInfo[] records); + oneway void currentEmergencyNumberList(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.EmergencyNumber[] emergencyNumberList); + oneway void currentLinkCapacityEstimate(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.LinkCapacityEstimate lce); + oneway void currentPhysicalChannelConfigs(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.PhysicalChannelConfig[] configs); + oneway void currentSignalStrength(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.SignalStrength signalStrength); + oneway void dataCallListChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.SetupDataCallResult[] dcList); + oneway void enterEmergencyCallbackMode(in android.hardware.radio.RadioIndicationType type); + oneway void exitEmergencyCallbackMode(in android.hardware.radio.RadioIndicationType type); + oneway void hardwareConfigChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.HardwareConfig[] configs); + oneway void imsNetworkStateChanged(in android.hardware.radio.RadioIndicationType type); + oneway void indicateRingbackTone(in android.hardware.radio.RadioIndicationType type, in boolean start); + oneway void keepaliveStatus(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.KeepaliveStatus status); + oneway void lceData(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.LceDataInfo lce); + oneway void modemReset(in android.hardware.radio.RadioIndicationType type, in String reason); + oneway void networkScanResult(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.NetworkScanResult result); + oneway void networkStateChanged(in android.hardware.radio.RadioIndicationType type); + oneway void newBroadcastSms(in android.hardware.radio.RadioIndicationType type, in byte[] data); + oneway void newSms(in android.hardware.radio.RadioIndicationType type, in byte[] pdu); + oneway void newSmsOnSim(in android.hardware.radio.RadioIndicationType type, in int recordNumber); + oneway void newSmsStatusReport(in android.hardware.radio.RadioIndicationType type, in byte[] pdu); + oneway void nitzTimeReceived(in android.hardware.radio.RadioIndicationType type, in String nitzTime, in long receivedTime); + oneway void onSupplementaryServiceIndication(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.StkCcUnsolSsResult ss); + oneway void onUssd(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.UssdModeType modeType, in String msg); + oneway void pcoData(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.PcoDataInfo pco); + oneway void radioCapabilityIndication(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.RadioCapability rc); + oneway void radioStateChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.RadioState radioState); + oneway void registrationFailed(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.CellIdentity cellIdentity, in String chosenPlmn, in android.hardware.radio.Domain domain, in int causeCode, in int additionalCauseCode); + oneway void resendIncallMute(in android.hardware.radio.RadioIndicationType type); + oneway void restrictedStateChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.PhoneRestrictedState state); + oneway void rilConnected(in android.hardware.radio.RadioIndicationType type); + oneway void simPhonebookChanged(in android.hardware.radio.RadioIndicationType type); + oneway void simPhonebookRecordsReceived(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.PbReceivedStatus status, in android.hardware.radio.PhonebookRecordInfo[] records); + oneway void simRefresh(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.SimRefreshResult refreshResult); + oneway void simSmsStorageFull(in android.hardware.radio.RadioIndicationType type); + oneway void simStatusChanged(in android.hardware.radio.RadioIndicationType type); + oneway void srvccStateNotify(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.SrvccState state); + oneway void stkCallControlAlphaNotify(in android.hardware.radio.RadioIndicationType type, in String alpha); + oneway void stkCallSetup(in android.hardware.radio.RadioIndicationType type, in long timeout); + oneway void stkEventNotify(in android.hardware.radio.RadioIndicationType type, in String cmd); + oneway void stkProactiveCommand(in android.hardware.radio.RadioIndicationType type, in String cmd); + oneway void stkSessionEnd(in android.hardware.radio.RadioIndicationType type); + oneway void subscriptionStatusChanged(in android.hardware.radio.RadioIndicationType type, in boolean activate); + oneway void suppSvcNotify(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.SuppSvcNotification suppSvc); + oneway void uiccApplicationsEnablementChanged(in android.hardware.radio.RadioIndicationType type, in boolean enabled); + oneway void unthrottleApn(in android.hardware.radio.RadioIndicationType type, in String apn); + oneway void voiceRadioTechChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.RadioTechnology rat); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadioResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadioResponse.aidl new file mode 100644 index 0000000000..9137b973ba --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadioResponse.aidl @@ -0,0 +1,199 @@ +/* + * 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 -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; +@VintfStability +interface IRadioResponse { + oneway void acceptCallResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void acknowledgeIncomingGsmSmsWithPduResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void acknowledgeLastIncomingCdmaSmsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void acknowledgeLastIncomingGsmSmsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void acknowledgeRequest(in int serial); + oneway void allocatePduSessionIdResponse(in android.hardware.radio.RadioResponseInfo info, in int id); + oneway void areUiccApplicationsEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean enabled); + oneway void cancelHandoverResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void cancelPendingUssdResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void changeIccPin2ForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void changeIccPinForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void conferenceResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void deactivateDataCallResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void deleteSmsOnRuimResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void deleteSmsOnSimResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void dialResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void emergencyDialResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void enableModemResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void enableUiccApplicationsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void exitEmergencyCallbackModeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void explicitCallTransferResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getAllowedCarriersResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.CarrierRestrictionsWithPriority carriers, in android.hardware.radio.SimLockMultiSimPolicy multiSimPolicy); + oneway void getAllowedNetworkTypesBitmapResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.RadioAccessFamily networkTypeBitmap); + oneway void getAvailableBandModesResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.RadioBandMode[] bandModes); + oneway void getAvailableNetworksResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.OperatorInfo[] networkInfos); + oneway void getBarringInfoResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.CellIdentity cellIdentity, in android.hardware.radio.BarringInfo[] barringInfos); + oneway void getBasebandVersionResponse(in android.hardware.radio.RadioResponseInfo info, in String version); + oneway void getCDMASubscriptionResponse(in android.hardware.radio.RadioResponseInfo info, in String mdn, in String hSid, in String hNid, in String min, in String prl); + oneway void getCallForwardStatusResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.CallForwardInfo[] callForwardInfos); + oneway void getCallWaitingResponse(in android.hardware.radio.RadioResponseInfo info, in boolean enable, in int serviceClass); + oneway void getCdmaBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.CdmaBroadcastSmsConfigInfo[] configs); + oneway void getCdmaRoamingPreferenceResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.CdmaRoamingType type); + oneway void getCdmaSubscriptionSourceResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.CdmaSubscriptionSource source); + oneway void getCellInfoListResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.CellInfo[] cellInfo); + oneway void getClipResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.ClipStatus status); + oneway void getClirResponse(in android.hardware.radio.RadioResponseInfo info, in int n, in int m); + oneway void getCurrentCallsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.Call[] calls); + oneway void getDataCallListResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.SetupDataCallResult[] dcResponse); + oneway void getDataRegistrationStateResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.RegStateResult dataRegResponse); + oneway void getDeviceIdentityResponse(in android.hardware.radio.RadioResponseInfo info, in String imei, in String imeisv, in String esn, in String meid); + oneway void getFacilityLockForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int response); + oneway void getGsmBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.GsmBroadcastSmsConfigInfo[] configs); + oneway void getHardwareConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.HardwareConfig[] config); + oneway void getIMSIForAppResponse(in android.hardware.radio.RadioResponseInfo info, in String imsi); + oneway void getIccCardStatusResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.CardStatus cardStatus); + oneway void getImsRegistrationStateResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isRegistered, in android.hardware.radio.RadioTechnologyFamily ratFamily); + oneway void getLastCallFailCauseResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.LastCallFailCauseInfo failCauseinfo); + oneway void getModemActivityInfoResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.ActivityStatsInfo activityInfo); + oneway void getModemStackStatusResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isEnabled); + oneway void getMuteResponse(in android.hardware.radio.RadioResponseInfo info, in boolean enable); + oneway void getNeighboringCidsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.NeighboringCell[] cells); + oneway void getNetworkSelectionModeResponse(in android.hardware.radio.RadioResponseInfo info, in boolean manual); + oneway void getOperatorResponse(in android.hardware.radio.RadioResponseInfo info, in String longName, in String shortName, in String numeric); + oneway void getPreferredNetworkTypeBitmapResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.RadioAccessFamily networkTypeBitmap); + oneway void getPreferredNetworkTypeResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.PreferredNetworkType nwType); + oneway void getPreferredVoicePrivacyResponse(in android.hardware.radio.RadioResponseInfo info, in boolean enable); + oneway void getRadioCapabilityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.RadioCapability rc); + oneway void getSignalStrengthResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.SignalStrength signalStrength); + oneway void getSimPhonebookCapacityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.PhonebookCapacity capacity); + oneway void getSimPhonebookRecordsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getSlicingConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.SlicingConfig slicingConfig); + oneway void getSmscAddressResponse(in android.hardware.radio.RadioResponseInfo info, in String smsc); + oneway void getSystemSelectionChannelsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.RadioAccessSpecifier[] specifiers); + oneway void getTTYModeResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.TtyMode mode); + oneway void getVoiceRadioTechnologyResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.RadioTechnology rat); + oneway void getVoiceRegistrationStateResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.RegStateResult voiceRegResponse); + oneway void handleStkCallSetupRequestFromSimResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void hangupConnectionResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void hangupForegroundResumeBackgroundResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void hangupWaitingOrBackgroundResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void iccCloseLogicalChannelResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void iccIOForAppResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.IccIoResult iccIo); + oneway void iccOpenLogicalChannelResponse(in android.hardware.radio.RadioResponseInfo info, in int channelId, in byte[] selectResponse); + oneway void iccTransmitApduBasicChannelResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.IccIoResult result); + oneway void iccTransmitApduLogicalChannelResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.IccIoResult result); + oneway void isNrDualConnectivityEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isEnabled); + oneway void nvReadItemResponse(in android.hardware.radio.RadioResponseInfo info, in String result); + oneway void nvResetConfigResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void nvWriteCdmaPrlResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void nvWriteItemResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void pullLceDataResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.LceDataInfo lceInfo); + oneway void rejectCallResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void releasePduSessionIdResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void reportSmsMemoryStatusResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void reportStkServiceIsRunningResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void requestIccSimAuthenticationResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.IccIoResult result); + oneway void requestIsimAuthenticationResponse(in android.hardware.radio.RadioResponseInfo info, in String response); + oneway void requestShutdownResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendBurstDtmfResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendCDMAFeatureCodeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendCdmaSmsExpectMoreResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.SendSmsResult sms); + oneway void sendCdmaSmsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.SendSmsResult sms); + oneway void sendDeviceStateResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendDtmfResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendEnvelopeResponse(in android.hardware.radio.RadioResponseInfo info, in String commandResponse); + oneway void sendEnvelopeWithStatusResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.IccIoResult iccIo); + oneway void sendImsSmsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.SendSmsResult sms); + oneway void sendSMSExpectMoreResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.SendSmsResult sms); + oneway void sendSmsExpectMoreResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.SendSmsResult sms); + oneway void sendSmsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.SendSmsResult sms); + oneway void sendTerminalResponseToSimResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendUssdResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void separateConnectionResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setAllowedCarriersResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setAllowedNetworkTypesBitmapResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setBandModeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setBarringPasswordResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCallForwardResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCallWaitingResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCarrierInfoForImsiEncryptionResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCdmaBroadcastActivationResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCdmaBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCdmaRoamingPreferenceResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCdmaSubscriptionSourceResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCellInfoListRateResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setClirResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setDataAllowedResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setDataProfileResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setDataThrottlingResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setFacilityLockForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int retry); + oneway void setGsmBroadcastActivationResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setGsmBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setIndicationFilterResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setInitialAttachApnResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setLinkCapacityReportingCriteriaResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setLocationUpdatesResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setMuteResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setNetworkSelectionModeAutomaticResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setNetworkSelectionModeManualResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setNrDualConnectivityStateResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setPreferredNetworkTypeBitmapResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setPreferredNetworkTypeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setPreferredVoicePrivacyResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setRadioCapabilityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.RadioCapability rc); + oneway void setRadioPowerResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSignalStrengthReportingCriteriaResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSimCardPowerResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSmscAddressResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSuppServiceNotificationsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSystemSelectionChannelsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setTTYModeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setUiccSubscriptionResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setupDataCallResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.SetupDataCallResult dcResponse); + oneway void startDtmfResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void startHandoverResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void startKeepaliveResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.KeepaliveStatus status); + oneway void startLceServiceResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.LceStatusInfo statusInfo); + oneway void startNetworkScanResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void stopDtmfResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void stopKeepaliveResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void stopLceServiceResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.LceStatusInfo statusInfo); + oneway void stopNetworkScanResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void supplyIccPin2ForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void supplyIccPinForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void supplyIccPuk2ForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void supplyIccPukForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void supplyNetworkDepersonalizationResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void supplySimDepersonalizationResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.PersoSubstate persoType, in int remainingRetries); + oneway void switchWaitingOrHoldingAndActiveResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void updateSimPhonebookRecordsResponse(in android.hardware.radio.RadioResponseInfo info, in int updatedRecordIndex); + oneway void writeSmsToRuimResponse(in android.hardware.radio.RadioResponseInfo info, in int index); + oneway void writeSmsToSimResponse(in android.hardware.radio.RadioResponseInfo info, in int index); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ISap.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ISap.aidl new file mode 100644 index 0000000000..fa0426442a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ISap.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +interface ISap { + oneway void apduReq(in int token, in android.hardware.radio.SapApduType type, in byte[] command); + oneway void connectReq(in int token, in int maxMsgSize); + oneway void disconnectReq(in int token); + oneway void powerReq(in int token, in boolean state); + oneway void resetSimReq(in int token); + void setCallback(in android.hardware.radio.ISapCallback sapCallback); + oneway void setTransferProtocolReq(in int token, in android.hardware.radio.SapTransferProtocol transferProtocol); + oneway void transferAtrReq(in int token); + oneway void transferCardReaderStatusReq(in int token); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ISapCallback.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ISapCallback.aidl new file mode 100644 index 0000000000..5ae0392c29 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ISapCallback.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 -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; +@VintfStability +interface ISapCallback { + oneway void apduResponse(in int token, in android.hardware.radio.SapResultCode resultCode, in byte[] apduRsp); + oneway void connectResponse(in int token, in android.hardware.radio.SapConnectRsp sapConnectRsp, in int maxMsgSize); + oneway void disconnectIndication(in int token, in android.hardware.radio.SapDisconnectType disconnectType); + oneway void disconnectResponse(in int token); + oneway void errorResponse(in int token); + oneway void powerResponse(in int token, in android.hardware.radio.SapResultCode resultCode); + oneway void resetSimResponse(in int token, in android.hardware.radio.SapResultCode resultCode); + oneway void statusIndication(in int token, in android.hardware.radio.SapStatus status); + oneway void transferAtrResponse(in int token, in android.hardware.radio.SapResultCode resultCode, in byte[] atr); + oneway void transferCardReaderStatusResponse(in int token, in android.hardware.radio.SapResultCode resultCode, in int cardReaderStatus); + oneway void transferProtocolResponse(in int token, in android.hardware.radio.SapResultCode resultCode); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IccIo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IccIo.aidl new file mode 100644 index 0000000000..1bea23a438 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IccIo.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +parcelable IccIo { + int command; + int fileId; + String path; + int p1; + int p2; + int p3; + String data; + String pin2; + String aid; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IccIoResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IccIoResult.aidl new file mode 100644 index 0000000000..50b1e9e68f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IccIoResult.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 -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; +@VintfStability +parcelable IccIoResult { + int sw1; + int sw2; + String simResponse; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ImsSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ImsSmsMessage.aidl new file mode 100644 index 0000000000..b5ffcc6474 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ImsSmsMessage.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 -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; +@VintfStability +parcelable ImsSmsMessage { + android.hardware.radio.RadioTechnologyFamily tech; + boolean retry; + int messageRef; + android.hardware.radio.CdmaSmsMessage[] cdmaMessage; + android.hardware.radio.GsmSmsMessage[] gsmMessage; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ImsiEncryptionInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ImsiEncryptionInfo.aidl new file mode 100644 index 0000000000..c89c3a0f7a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ImsiEncryptionInfo.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 -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; +@VintfStability +parcelable ImsiEncryptionInfo { + String mcc; + String mnc; + byte[] carrierKey; + String keyIdentifier; + long expirationTime; + android.hardware.radio.PublicKeyType keyType; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl new file mode 100644 index 0000000000..ad3441f445 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IncrementalResultsPeriodicityRange.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 -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; +@Backing(type="int") @VintfStability +enum IncrementalResultsPeriodicityRange { + MIN = 1, + MAX = 10, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IndicationFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IndicationFilter.aidl new file mode 100644 index 0000000000..629af68d64 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IndicationFilter.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum IndicationFilter { + NONE = 0, + ALL = -1, + SIGNAL_STRENGTH = 1, + FULL_NETWORK_STATE = 2, + DATA_CALL_DORMANCY_CHANGED = 4, + LINK_CAPACITY_ESTIMATE = 8, + PHYSICAL_CHANNEL_CONFIG = 16, + REGISTRATION_FAILURE = 32, + BARRING_INFO = 64, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveRequest.aidl new file mode 100644 index 0000000000..1f23a6927f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveRequest.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 -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; +@VintfStability +parcelable KeepaliveRequest { + android.hardware.radio.KeepaliveType type; + byte[] sourceAddress; + int sourcePort; + byte[] destinationAddress; + int destinationPort; + int maxKeepaliveIntervalMillis; + int cid; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatus.aidl new file mode 100644 index 0000000000..8729b69e39 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatus.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 -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; +@VintfStability +parcelable KeepaliveStatus { + int sessionHandle; + android.hardware.radio.KeepaliveStatusCode code; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatusCode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatusCode.aidl new file mode 100644 index 0000000000..8ad5dc5dba --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatusCode.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 -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; +@Backing(type="int") @VintfStability +enum KeepaliveStatusCode { + ACTIVE = 0, + INACTIVE = 1, + PENDING = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveType.aidl new file mode 100644 index 0000000000..f0dd5216fb --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveType.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 -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; +@Backing(type="int") @VintfStability +enum KeepaliveType { + NATT_IPV4 = 0, + NATT_IPV6 = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LastCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LastCallFailCause.aidl new file mode 100644 index 0000000000..024f7ead24 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LastCallFailCause.aidl @@ -0,0 +1,133 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum LastCallFailCause { + UNOBTAINABLE_NUMBER = 1, + NO_ROUTE_TO_DESTINATION = 3, + CHANNEL_UNACCEPTABLE = 6, + OPERATOR_DETERMINED_BARRING = 8, + NORMAL = 16, + BUSY = 17, + NO_USER_RESPONDING = 18, + NO_ANSWER_FROM_USER = 19, + CALL_REJECTED = 21, + NUMBER_CHANGED = 22, + PREEMPTION = 25, + DESTINATION_OUT_OF_ORDER = 27, + INVALID_NUMBER_FORMAT = 28, + FACILITY_REJECTED = 29, + RESP_TO_STATUS_ENQUIRY = 30, + NORMAL_UNSPECIFIED = 31, + CONGESTION = 34, + NETWORK_OUT_OF_ORDER = 38, + TEMPORARY_FAILURE = 41, + SWITCHING_EQUIPMENT_CONGESTION = 42, + ACCESS_INFORMATION_DISCARDED = 43, + REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE = 44, + RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 47, + QOS_UNAVAILABLE = 49, + REQUESTED_FACILITY_NOT_SUBSCRIBED = 50, + INCOMING_CALLS_BARRED_WITHIN_CUG = 55, + BEARER_CAPABILITY_NOT_AUTHORIZED = 57, + BEARER_CAPABILITY_UNAVAILABLE = 58, + SERVICE_OPTION_NOT_AVAILABLE = 63, + BEARER_SERVICE_NOT_IMPLEMENTED = 65, + ACM_LIMIT_EXCEEDED = 68, + REQUESTED_FACILITY_NOT_IMPLEMENTED = 69, + ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 70, + SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79, + INVALID_TRANSACTION_IDENTIFIER = 81, + USER_NOT_MEMBER_OF_CUG = 87, + INCOMPATIBLE_DESTINATION = 88, + INVALID_TRANSIT_NW_SELECTION = 91, + SEMANTICALLY_INCORRECT_MESSAGE = 95, + INVALID_MANDATORY_INFORMATION = 96, + MESSAGE_TYPE_NON_IMPLEMENTED = 97, + MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98, + INFORMATION_ELEMENT_NON_EXISTENT = 99, + CONDITIONAL_IE_ERROR = 100, + MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101, + RECOVERY_ON_TIMER_EXPIRED = 102, + PROTOCOL_ERROR_UNSPECIFIED = 111, + INTERWORKING_UNSPECIFIED = 127, + CALL_BARRED = 240, + FDN_BLOCKED = 241, + IMSI_UNKNOWN_IN_VLR = 242, + IMEI_NOT_ACCEPTED = 243, + DIAL_MODIFIED_TO_USSD = 244, + DIAL_MODIFIED_TO_SS = 245, + DIAL_MODIFIED_TO_DIAL = 246, + RADIO_OFF = 247, + OUT_OF_SERVICE = 248, + NO_VALID_SIM = 249, + RADIO_INTERNAL_ERROR = 250, + NETWORK_RESP_TIMEOUT = 251, + NETWORK_REJECT = 252, + RADIO_ACCESS_FAILURE = 253, + RADIO_LINK_FAILURE = 254, + RADIO_LINK_LOST = 255, + RADIO_UPLINK_FAILURE = 256, + RADIO_SETUP_FAILURE = 257, + RADIO_RELEASE_NORMAL = 258, + RADIO_RELEASE_ABNORMAL = 259, + ACCESS_CLASS_BLOCKED = 260, + NETWORK_DETACH = 261, + CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000, + CDMA_DROP = 1001, + CDMA_INTERCEPT = 1002, + CDMA_REORDER = 1003, + CDMA_SO_REJECT = 1004, + CDMA_RETRY_ORDER = 1005, + CDMA_ACCESS_FAILURE = 1006, + CDMA_PREEMPTED = 1007, + CDMA_NOT_EMERGENCY = 1008, + CDMA_ACCESS_BLOCKED = 1009, + OEM_CAUSE_1 = 61441, + OEM_CAUSE_2 = 61442, + OEM_CAUSE_3 = 61443, + OEM_CAUSE_4 = 61444, + OEM_CAUSE_5 = 61445, + OEM_CAUSE_6 = 61446, + OEM_CAUSE_7 = 61447, + OEM_CAUSE_8 = 61448, + OEM_CAUSE_9 = 61449, + OEM_CAUSE_10 = 61450, + OEM_CAUSE_11 = 61451, + OEM_CAUSE_12 = 61452, + OEM_CAUSE_13 = 61453, + OEM_CAUSE_14 = 61454, + OEM_CAUSE_15 = 61455, + ERROR_UNSPECIFIED = 65535, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LastCallFailCauseInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LastCallFailCauseInfo.aidl new file mode 100644 index 0000000000..43ef0cd01b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LastCallFailCauseInfo.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 -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; +@VintfStability +parcelable LastCallFailCauseInfo { + android.hardware.radio.LastCallFailCause causeCode; + String vendorCause; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceDataInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceDataInfo.aidl new file mode 100644 index 0000000000..64c63674c6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceDataInfo.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 -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; +@VintfStability +parcelable LceDataInfo { + int lastHopCapacityKbps; + byte confidenceLevel; + boolean lceSuspended; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatus.aidl new file mode 100644 index 0000000000..2542cc7de9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatus.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 -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; +@Backing(type="int") @VintfStability +enum LceStatus { + NOT_SUPPORTED = 0, + STOPPED = 1, + ACTIVE = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatusInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatusInfo.aidl new file mode 100644 index 0000000000..29f5ab60f2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatusInfo.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 -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; +@VintfStability +parcelable LceStatusInfo { + android.hardware.radio.LceStatus lceStatus; + byte actualIntervalMs; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LinkAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LinkAddress.aidl new file mode 100644 index 0000000000..b64daf9de1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LinkAddress.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 -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; +@VintfStability +parcelable LinkAddress { + String address; + android.hardware.radio.AddressProperty properties; + long deprecationTime; + long expirationTime; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LinkCapacityEstimate.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LinkCapacityEstimate.aidl new file mode 100644 index 0000000000..d2a5c83a3c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LinkCapacityEstimate.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 -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; +@VintfStability +parcelable LinkCapacityEstimate { + int downlinkCapacityKbps; + int uplinkCapacityKbps; + int secondaryDownlinkCapacityKbps; + int secondaryUplinkCapacityKbps; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LteSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LteSignalStrength.aidl new file mode 100644 index 0000000000..28840bccef --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LteSignalStrength.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 -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; +@VintfStability +parcelable LteSignalStrength { + int signalStrength; + int rsrp; + int rsrq; + int rssnr; + int cqi; + int timingAdvance; + int cqiTableIndex; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LteVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LteVopsInfo.aidl new file mode 100644 index 0000000000..b28c415c3e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LteVopsInfo.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 -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; +@VintfStability +parcelable LteVopsInfo { + boolean isVopsSupported; + boolean isEmcBearerSupported; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaxSearchTimeRange.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaxSearchTimeRange.aidl new file mode 100644 index 0000000000..88cdf5fe18 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaxSearchTimeRange.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 -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; +@Backing(type="int") @VintfStability +enum MaxSearchTimeRange { + MIN = 60, + MAX = 3600, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaybePort.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaybePort.aidl new file mode 100644 index 0000000000..f556c7f8a3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaybePort.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 -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; +@VintfStability +union MaybePort { + boolean noinit; + android.hardware.radio.PortRange range; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MvnoType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MvnoType.aidl new file mode 100644 index 0000000000..8be23b6607 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MvnoType.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 -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; +@Backing(type="int") @VintfStability +enum MvnoType { + NONE = 0, + IMSI = 1, + GID = 2, + SPN = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NeighboringCell.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NeighboringCell.aidl new file mode 100644 index 0000000000..89d7818fe8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NeighboringCell.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 -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; +@VintfStability +parcelable NeighboringCell { + String cid; + int rssi; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanRequest.aidl new file mode 100644 index 0000000000..4e6f6139b1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanRequest.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 -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; +@VintfStability +parcelable NetworkScanRequest { + android.hardware.radio.ScanType type; + int interval; + android.hardware.radio.RadioAccessSpecifier[] specifiers; + int maxSearchTime; + boolean incrementalResults; + int incrementalResultsPeriodicity; + String[] mccMncs; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanResult.aidl new file mode 100644 index 0000000000..86543e3e1b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanResult.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 -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; +@VintfStability +parcelable NetworkScanResult { + android.hardware.radio.ScanStatus status; + android.hardware.radio.RadioError error; + android.hardware.radio.CellInfo[] networkInfos; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NgranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NgranBands.aidl new file mode 100644 index 0000000000..14db49b1ec --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NgranBands.aidl @@ -0,0 +1,90 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum NgranBands { + BAND_1 = 1, + BAND_2 = 2, + BAND_3 = 3, + BAND_5 = 5, + BAND_7 = 7, + BAND_8 = 8, + BAND_12 = 12, + BAND_14 = 14, + BAND_18 = 18, + BAND_20 = 20, + BAND_25 = 25, + BAND_26 = 26, + BAND_28 = 28, + BAND_29 = 29, + BAND_30 = 30, + BAND_34 = 34, + BAND_38 = 38, + BAND_39 = 39, + BAND_40 = 40, + BAND_41 = 41, + BAND_46 = 46, + BAND_48 = 48, + BAND_50 = 50, + BAND_51 = 51, + BAND_53 = 53, + BAND_65 = 65, + BAND_66 = 66, + BAND_70 = 70, + BAND_71 = 71, + BAND_74 = 74, + BAND_75 = 75, + BAND_76 = 76, + BAND_77 = 77, + BAND_78 = 78, + BAND_79 = 79, + BAND_80 = 80, + BAND_81 = 81, + BAND_82 = 82, + BAND_83 = 83, + BAND_84 = 84, + BAND_86 = 86, + BAND_89 = 89, + BAND_90 = 90, + BAND_91 = 91, + BAND_92 = 92, + BAND_93 = 93, + BAND_94 = 94, + BAND_95 = 95, + BAND_96 = 96, + BAND_257 = 257, + BAND_258 = 258, + BAND_260 = 260, + BAND_261 = 261, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrDualConnectivityState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrDualConnectivityState.aidl new file mode 100644 index 0000000000..c3fb9f2fd8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrDualConnectivityState.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 -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; +@Backing(type="byte") @VintfStability +enum NrDualConnectivityState { + ENABLE = 1, + DISABLE = 2, + DISABLE_IMMEDIATE = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrIndicators.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrIndicators.aidl new file mode 100644 index 0000000000..81dc51c36e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrIndicators.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 -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; +@VintfStability +parcelable NrIndicators { + boolean isEndcAvailable; + boolean isDcNrRestricted; + boolean isNrAvailable; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrQos.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrQos.aidl new file mode 100644 index 0000000000..6cb8f33704 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrQos.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 -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; +@VintfStability +parcelable NrQos { + int fiveQi; + android.hardware.radio.QosBandwidth downlink; + android.hardware.radio.QosBandwidth uplink; + byte qfi; + char averagingWindowMs; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrSignalStrength.aidl new file mode 100644 index 0000000000..daf6a418ff --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrSignalStrength.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 -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; +@VintfStability +parcelable NrSignalStrength { + int ssRsrp; + int ssRsrq; + int ssSinr; + int csiRsrp; + int csiRsrq; + int csiSinr; + int csiCqiTableIndex; + byte[] csiCqiReport; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrVopsInfo.aidl new file mode 100644 index 0000000000..b737aaf414 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrVopsInfo.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 -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; +@VintfStability +parcelable NrVopsInfo { + android.hardware.radio.VopsIndicator vopsSupported; + android.hardware.radio.EmcIndicator emcSupported; + android.hardware.radio.EmfIndicator emfSupported; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NvItem.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NvItem.aidl new file mode 100644 index 0000000000..d7706c5dc2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NvItem.aidl @@ -0,0 +1,78 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum NvItem { + CDMA_MEID = 1, + CDMA_MIN = 2, + CDMA_MDN = 3, + CDMA_ACCOLC = 4, + DEVICE_MSL = 11, + RTN_RECONDITIONED_STATUS = 12, + RTN_ACTIVATION_DATE = 13, + RTN_LIFE_TIMER = 14, + RTN_LIFE_CALLS = 15, + RTN_LIFE_DATA_TX = 16, + RTN_LIFE_DATA_RX = 17, + OMADM_HFA_LEVEL = 18, + MIP_PROFILE_NAI = 31, + MIP_PROFILE_HOME_ADDRESS = 32, + MIP_PROFILE_AAA_AUTH = 33, + MIP_PROFILE_HA_AUTH = 34, + MIP_PROFILE_PRI_HA_ADDR = 35, + MIP_PROFILE_SEC_HA_ADDR = 36, + MIP_PROFILE_REV_TUN_PREF = 37, + MIP_PROFILE_HA_SPI = 38, + MIP_PROFILE_AAA_SPI = 39, + MIP_PROFILE_MN_HA_SS = 40, + MIP_PROFILE_MN_AAA_SS = 41, + CDMA_PRL_VERSION = 51, + CDMA_BC10 = 52, + CDMA_BC14 = 53, + CDMA_SO68 = 54, + CDMA_SO73_COP0 = 55, + CDMA_SO73_COP1TO7 = 56, + CDMA_1X_ADVANCED_ENABLED = 57, + CDMA_EHRPD_ENABLED = 58, + CDMA_EHRPD_FORCED = 59, + LTE_BAND_ENABLE_25 = 71, + LTE_BAND_ENABLE_26 = 72, + LTE_BAND_ENABLE_41 = 73, + LTE_SCAN_PRIORITY_25 = 74, + LTE_SCAN_PRIORITY_26 = 75, + LTE_SCAN_PRIORITY_41 = 76, + LTE_HIDDEN_BAND_PRIORITY_25 = 77, + LTE_HIDDEN_BAND_PRIORITY_26 = 78, + LTE_HIDDEN_BAND_PRIORITY_41 = 79, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NvWriteItem.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NvWriteItem.aidl new file mode 100644 index 0000000000..9e60db6a28 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NvWriteItem.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 -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; +@VintfStability +parcelable NvWriteItem { + android.hardware.radio.NvItem itemId; + String value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorInfo.aidl new file mode 100644 index 0000000000..2f29c022f7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorInfo.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 -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; +@VintfStability +parcelable OperatorInfo { + String alphaLong; + String alphaShort; + String operatorNumeric; + android.hardware.radio.OperatorStatus status; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorStatus.aidl new file mode 100644 index 0000000000..4ef10caada --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorStatus.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 -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; +@Backing(type="int") @VintfStability +enum OperatorStatus { + UNKNOWN = 0, + AVAILABLE = 1, + CURRENT = 2, + FORBIDDEN = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalCsgInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalCsgInfo.aidl new file mode 100644 index 0000000000..6866dcaf94 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalCsgInfo.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 -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; +@VintfStability +union OptionalCsgInfo { + boolean noinit; + android.hardware.radio.ClosedSubscriberGroupInfo csgInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalDnn.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalDnn.aidl new file mode 100644 index 0000000000..88582dea50 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalDnn.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 -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; +@VintfStability +union OptionalDnn { + boolean noinit; + String value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalOsAppId.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalOsAppId.aidl new file mode 100644 index 0000000000..40bfa41026 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalOsAppId.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 -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; +@VintfStability +union OptionalOsAppId { + boolean noinit; + android.hardware.radio.OsAppId value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalPdpProtocolType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalPdpProtocolType.aidl new file mode 100644 index 0000000000..5b4964f0c8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalPdpProtocolType.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 -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; +@VintfStability +union OptionalPdpProtocolType { + boolean noinit; + android.hardware.radio.PdpProtocolType value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSliceInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSliceInfo.aidl new file mode 100644 index 0000000000..d640aac680 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSliceInfo.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 -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; +@VintfStability +union OptionalSliceInfo { + boolean noinit; + android.hardware.radio.SliceInfo value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSscMode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSscMode.aidl new file mode 100644 index 0000000000..047261524d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSscMode.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 -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; +@VintfStability +union OptionalSscMode { + boolean noinit; + android.hardware.radio.SscMode value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalTrafficDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalTrafficDescriptor.aidl new file mode 100644 index 0000000000..6b575255f8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalTrafficDescriptor.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 -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; +@VintfStability +union OptionalTrafficDescriptor { + boolean noinit; + android.hardware.radio.TrafficDescriptor value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OsAppId.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OsAppId.aidl new file mode 100644 index 0000000000..bc112296e9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OsAppId.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 -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; +@VintfStability +parcelable OsAppId { + byte[] osAppId; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/P2Constant.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/P2Constant.aidl new file mode 100644 index 0000000000..eb8b442c98 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/P2Constant.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 -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; +@Backing(type="int") @VintfStability +enum P2Constant { + NO_P2 = -1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PbReceivedStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PbReceivedStatus.aidl new file mode 100644 index 0000000000..dd95ad5127 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PbReceivedStatus.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 -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; +@Backing(type="byte") @VintfStability +enum PbReceivedStatus { + PB_RECEIVED_OK = 1, + PB_RECEIVED_ERROR = 2, + PB_RECEIVED_ABORT = 3, + PB_RECEIVED_FINAL = 4, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PcoDataInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PcoDataInfo.aidl new file mode 100644 index 0000000000..828b08c610 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PcoDataInfo.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 -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; +@VintfStability +parcelable PcoDataInfo { + int cid; + String bearerProto; + int pcoId; + byte[] contents; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PdpProtocolType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PdpProtocolType.aidl new file mode 100644 index 0000000000..980d3afc39 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PdpProtocolType.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 -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; +@Backing(type="int") @VintfStability +enum PdpProtocolType { + UNKNOWN = -1, + IP = 0, + IPV6 = 1, + IPV4V6 = 2, + PPP = 3, + NON_IP = 4, + UNSTRUCTURED = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PersoSubstate.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PersoSubstate.aidl new file mode 100644 index 0000000000..35b75c63dd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PersoSubstate.aidl @@ -0,0 +1,72 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum PersoSubstate { + UNKNOWN = 0, + IN_PROGRESS = 1, + READY = 2, + SIM_NETWORK = 3, + SIM_NETWORK_SUBSET = 4, + SIM_CORPORATE = 5, + SIM_SERVICE_PROVIDER = 6, + SIM_SIM = 7, + SIM_NETWORK_PUK = 8, + SIM_NETWORK_SUBSET_PUK = 9, + SIM_CORPORATE_PUK = 10, + SIM_SERVICE_PROVIDER_PUK = 11, + SIM_SIM_PUK = 12, + RUIM_NETWORK1 = 13, + RUIM_NETWORK2 = 14, + RUIM_HRPD = 15, + RUIM_CORPORATE = 16, + RUIM_SERVICE_PROVIDER = 17, + RUIM_RUIM = 18, + RUIM_NETWORK1_PUK = 19, + RUIM_NETWORK2_PUK = 20, + RUIM_HRPD_PUK = 21, + RUIM_CORPORATE_PUK = 22, + RUIM_SERVICE_PROVIDER_PUK = 23, + RUIM_RUIM_PUK = 24, + SIM_SPN = 25, + SIM_SPN_PUK = 26, + SIM_SP_EHPLMN = 27, + SIM_SP_EHPLMN_PUK = 28, + SIM_ICCID = 29, + SIM_ICCID_PUK = 30, + SIM_IMPI = 31, + SIM_IMPI_PUK = 32, + SIM_NS_SP = 33, + SIM_NS_SP_PUK = 34, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhoneRestrictedState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhoneRestrictedState.aidl new file mode 100644 index 0000000000..7a4982f5ea --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhoneRestrictedState.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 -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; +@Backing(type="int") @VintfStability +enum PhoneRestrictedState { + NONE = 0, + CS_EMERGENCY = 1, + CS_NORMAL = 2, + CS_ALL = 4, + PS_ALL = 16, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhonebookCapacity.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhonebookCapacity.aidl new file mode 100644 index 0000000000..8d2623bbb5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhonebookCapacity.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 -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; +@VintfStability +parcelable PhonebookCapacity { + int maxAdnRecords; + int usedAdnRecords; + int maxEmailRecords; + int usedEmailRecords; + int maxAdditionalNumberRecords; + int usedAdditionalNumberRecords; + int maxNameLen; + int maxNumberLen; + int maxEmailLen; + int maxAdditionalNumberLen; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhonebookRecordInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhonebookRecordInfo.aidl new file mode 100644 index 0000000000..02a166e18c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhonebookRecordInfo.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 -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; +@VintfStability +parcelable PhonebookRecordInfo { + int recordId; + String name; + String number; + String[] emails; + String[] additionalNumbers; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhysicalChannelConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhysicalChannelConfig.aidl new file mode 100644 index 0000000000..91c4a96a1f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhysicalChannelConfig.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +parcelable PhysicalChannelConfig { + android.hardware.radio.CellConnectionStatus status; + android.hardware.radio.RadioTechnology rat; + int downlinkChannelNumber; + int uplinkChannelNumber; + int cellBandwidthDownlinkKhz; + int cellBandwidthUplinkKhz; + int[] contextIds; + int physicalCellId; + android.hardware.radio.PhysicalChannelConfigBand band; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhysicalChannelConfigBand.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhysicalChannelConfigBand.aidl new file mode 100644 index 0000000000..1953083771 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PhysicalChannelConfigBand.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 -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; +@VintfStability +union PhysicalChannelConfigBand { + boolean noinit; + android.hardware.radio.GeranBands geranBand; + android.hardware.radio.UtranBands utranBand; + android.hardware.radio.EutranBands eutranBand; + android.hardware.radio.NgranBands ngranBand; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PinState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PinState.aidl new file mode 100644 index 0000000000..3b65179748 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PinState.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 -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; +@Backing(type="int") @VintfStability +enum PinState { + UNKNOWN = 0, + ENABLED_NOT_VERIFIED = 1, + ENABLED_VERIFIED = 2, + DISABLED = 3, + ENABLED_BLOCKED = 4, + ENABLED_PERM_BLOCKED = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PortRange.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PortRange.aidl new file mode 100644 index 0000000000..9e4d2720f8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PortRange.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 -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; +@VintfStability +parcelable PortRange { + int start; + int end; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PreferredNetworkType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PreferredNetworkType.aidl new file mode 100644 index 0000000000..7615dff86f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PreferredNetworkType.aidl @@ -0,0 +1,60 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum PreferredNetworkType { + GSM_WCDMA = 0, + GSM_ONLY = 1, + WCDMA = 2, + GSM_WCDMA_AUTO = 3, + CDMA_EVDO_AUTO = 4, + CDMA_ONLY = 5, + EVDO_ONLY = 6, + GSM_WCDMA_CDMA_EVDO_AUTO = 7, + LTE_CDMA_EVDO = 8, + LTE_GSM_WCDMA = 9, + LTE_CMDA_EVDO_GSM_WCDMA = 10, + LTE_ONLY = 11, + LTE_WCDMA = 12, + TD_SCDMA_ONLY = 13, + TD_SCDMA_WCDMA = 14, + TD_SCDMA_LTE = 15, + TD_SCDMA_GSM = 16, + TD_SCDMA_GSM_LTE = 17, + TD_SCDMA_GSM_WCDMA = 18, + TD_SCDMA_WCDMA_LTE = 19, + TD_SCDMA_GSM_WCDMA_LTE = 20, + TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO = 21, + TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA = 22, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PrlIndicator.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PrlIndicator.aidl new file mode 100644 index 0000000000..b596d305b4 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PrlIndicator.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 -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; +@Backing(type="int") @VintfStability +enum PrlIndicator { + NOT_REGISTERED = -1, + NOT_IN_PRL = 0, + IN_PRL = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PublicKeyType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PublicKeyType.aidl new file mode 100644 index 0000000000..68d96e86ed --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PublicKeyType.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 -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; +@Backing(type="byte") @VintfStability +enum PublicKeyType { + EPDG = 1, + WLAN = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Qos.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Qos.aidl new file mode 100644 index 0000000000..d69853fa2b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Qos.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 -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; +@VintfStability +union Qos { + boolean noinit; + android.hardware.radio.EpsQos eps; + android.hardware.radio.NrQos nr; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosBandwidth.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosBandwidth.aidl new file mode 100644 index 0000000000..95622bc31e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosBandwidth.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 -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; +@VintfStability +parcelable QosBandwidth { + int maxBitrateKbps; + int guaranteedBitrateKbps; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilter.aidl new file mode 100644 index 0000000000..3376c6626b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilter.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 -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; +@VintfStability +parcelable QosFilter { + String[] localAddresses; + String[] remoteAddresses; + android.hardware.radio.MaybePort localPort; + android.hardware.radio.MaybePort remotePort; + android.hardware.radio.QosProtocol protocol; + android.hardware.radio.QosFilterTypeOfService tos; + android.hardware.radio.QosFilterIpv6FlowLabel flowLabel; + android.hardware.radio.QosFilterIpsecSpi spi; + android.hardware.radio.QosFilterDirection direction; + int precedence; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterDirection.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterDirection.aidl new file mode 100644 index 0000000000..efb9c504cf --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterDirection.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 -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; +@Backing(type="byte") @VintfStability +enum QosFilterDirection { + DOWNLINK = 0, + UPLINK = 1, + BIDIRECTIONAL = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterIpsecSpi.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterIpsecSpi.aidl new file mode 100644 index 0000000000..695b7352a2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterIpsecSpi.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 -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; +@VintfStability +union QosFilterIpsecSpi { + boolean noinit; + int value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterIpv6FlowLabel.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterIpv6FlowLabel.aidl new file mode 100644 index 0000000000..5b9c82c188 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterIpv6FlowLabel.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 -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; +@VintfStability +union QosFilterIpv6FlowLabel { + boolean noinit; + int value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterTypeOfService.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterTypeOfService.aidl new file mode 100644 index 0000000000..c7c0331afc --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterTypeOfService.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 -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; +@VintfStability +union QosFilterTypeOfService { + boolean noinit; + byte value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFlowIdRange.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFlowIdRange.aidl new file mode 100644 index 0000000000..95468e0074 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFlowIdRange.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 -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; +@Backing(type="byte") @VintfStability +enum QosFlowIdRange { + MIN = 1, + MAX = 63, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosPortRange.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosPortRange.aidl new file mode 100644 index 0000000000..7171c7ebd5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosPortRange.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 -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; +@Backing(type="int") @VintfStability +enum QosPortRange { + MIN = 20, + MAX = 65535, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosProtocol.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosProtocol.aidl new file mode 100644 index 0000000000..cb68f04418 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosProtocol.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 -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; +@Backing(type="byte") @VintfStability +enum QosProtocol { + UNSPECIFIED = -1, + TCP = 6, + UDP = 17, + ESP = 50, + AH = 51, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosSession.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosSession.aidl new file mode 100644 index 0000000000..8f1b913fb2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosSession.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 -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; +@VintfStability +parcelable QosSession { + int qosSessionId; + android.hardware.radio.Qos qos; + android.hardware.radio.QosFilter[] qosFilters; +} 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 new file mode 100644 index 0000000000..10a956e4d8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.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 -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; +@Backing(type="int") @VintfStability +enum RadioAccessFamily { + UNKNOWN = 1, + GPRS = 2, + EDGE = 4, + UMTS = 8, + IS95A = 16, + IS95B = 32, + ONE_X_RTT = 64, + EVDO_0 = 128, + EVDO_A = 256, + HSDPA = 512, + HSUPA = 1024, + HSPA = 2048, + EVDO_B = 4096, + EHRPD = 8192, + LTE = 16384, + HSPAP = 32768, + GSM = 65536, + TD_SCDMA = 131072, + LTE_CA = 524288, + NR = 1048576, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessNetworks.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessNetworks.aidl new file mode 100644 index 0000000000..67f5e8a246 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessNetworks.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 -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; +@Backing(type="int") @VintfStability +enum RadioAccessNetworks { + UNKNOWN = 0, + GERAN = 1, + UTRAN = 2, + EUTRAN = 3, + NGRAN = 4, + CDMA2000 = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessSpecifier.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessSpecifier.aidl new file mode 100644 index 0000000000..b47ee2d49c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessSpecifier.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 -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; +@VintfStability +parcelable RadioAccessSpecifier { + android.hardware.radio.RadioAccessNetworks radioAccessNetwork; + android.hardware.radio.RadioAccessSpecifierBands bands; + int[] channels; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessSpecifierBands.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessSpecifierBands.aidl new file mode 100644 index 0000000000..9d0a99733c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessSpecifierBands.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 -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; +@VintfStability +union RadioAccessSpecifierBands { + boolean noinit; + android.hardware.radio.GeranBands[] geranBands; + android.hardware.radio.UtranBands[] utranBands; + android.hardware.radio.EutranBands[] eutranBands; + android.hardware.radio.NgranBands[] ngranBands; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioBandMode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioBandMode.aidl new file mode 100644 index 0000000000..973ca524b1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioBandMode.aidl @@ -0,0 +1,56 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum RadioBandMode { + BAND_MODE_UNSPECIFIED = 0, + BAND_MODE_EURO = 1, + BAND_MODE_USA = 2, + BAND_MODE_JPN = 3, + BAND_MODE_AUS = 4, + BAND_MODE_AUS_2 = 5, + BAND_MODE_CELL_800 = 6, + BAND_MODE_PCS = 7, + BAND_MODE_JTACS = 8, + BAND_MODE_KOREA_PCS = 9, + BAND_MODE_5_450M = 10, + BAND_MODE_IMT2000 = 11, + BAND_MODE_7_700M_2 = 12, + BAND_MODE_8_1800M = 13, + BAND_MODE_9_900M = 14, + BAND_MODE_10_800M_2 = 15, + BAND_MODE_EURO_PAMR_400M = 16, + BAND_MODE_AWS = 17, + BAND_MODE_USA_2500M = 18, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapability.aidl new file mode 100644 index 0000000000..99c1a41363 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapability.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 -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; +@VintfStability +parcelable RadioCapability { + int session; + android.hardware.radio.RadioCapabilityPhase phase; + android.hardware.radio.RadioAccessFamily raf; + String logicalModemUuid; + android.hardware.radio.RadioCapabilityStatus status; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityPhase.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityPhase.aidl new file mode 100644 index 0000000000..7a4b9adac2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityPhase.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 -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; +@Backing(type="int") @VintfStability +enum RadioCapabilityPhase { + CONFIGURED = 0, + START = 1, + APPLY = 2, + UNSOL_RSP = 3, + FINISH = 4, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityStatus.aidl new file mode 100644 index 0000000000..72e0bd53f2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityStatus.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 -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; +@Backing(type="int") @VintfStability +enum RadioCapabilityStatus { + NONE = 0, + SUCCESS = 1, + FAIL = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCdmaSmsConst.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCdmaSmsConst.aidl new file mode 100644 index 0000000000..7e5c471841 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCdmaSmsConst.aidl @@ -0,0 +1,52 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum RadioCdmaSmsConst { + ADDRESS_MAX = 36, + SUBADDRESS_MAX = 36, + BEARER_DATA_MAX = 255, + UDH_MAX_SND_SIZE = 128, + UDH_EO_DATA_SEGMENT_MAX = 131, + MAX_UD_HEADERS = 7, + USER_DATA_MAX = 229, + UDH_LARGE_PIC_SIZE = 128, + UDH_SMALL_PIC_SIZE = 32, + UDH_VAR_PIC_SIZE = 134, + UDH_ANIM_NUM_BITMAPS = 4, + UDH_LARGE_BITMAP_SIZE = 32, + UDH_SMALL_BITMAP_SIZE = 8, + UDH_OTHER_SIZE = 226, + IP_ADDRESS_SIZE = 4, +} 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 new file mode 100644 index 0000000000..d37f13bf0f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum RadioConst { + CDMA_ALPHA_INFO_BUFFER_LENGTH = 64, + CDMA_NUMBER_INFO_BUFFER_LENGTH = 81, + MAX_RILDS = 3, + MAX_SOCKET_NAME_LENGTH = 6, + MAX_CLIENT_ID_LENGTH = 2, + MAX_DEBUG_SOCKET_NAME_LENGTH = 12, + MAX_QEMU_PIPE_NAME_LENGTH = 11, + MAX_UUID_LENGTH = 64, + CARD_MAX_APPS = 8, + CDMA_MAX_NUMBER_OF_INFO_RECS = 10, + SS_INFO_MAX = 4, + NUM_SERVICE_CLASSES = 7, + NUM_TX_POWER_LEVELS = 5, + RADIO_ACCESS_SPECIFIER_MAX_SIZE = 8, +} 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 new file mode 100644 index 0000000000..3ef67bccdb --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl @@ -0,0 +1,126 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum RadioError { + NONE = 0, + RADIO_NOT_AVAILABLE = 1, + GENERIC_FAILURE = 2, + PASSWORD_INCORRECT = 3, + SIM_PIN2 = 4, + SIM_PUK2 = 5, + REQUEST_NOT_SUPPORTED = 6, + CANCELLED = 7, + OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, + OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9, + SMS_SEND_FAIL_RETRY = 10, + SIM_ABSENT = 11, + SUBSCRIPTION_NOT_AVAILABLE = 12, + MODE_NOT_SUPPORTED = 13, + FDN_CHECK_FAILURE = 14, + ILLEGAL_SIM_OR_ME = 15, + MISSING_RESOURCE = 16, + NO_SUCH_ELEMENT = 17, + DIAL_MODIFIED_TO_USSD = 18, + DIAL_MODIFIED_TO_SS = 19, + DIAL_MODIFIED_TO_DIAL = 20, + USSD_MODIFIED_TO_DIAL = 21, + USSD_MODIFIED_TO_SS = 22, + USSD_MODIFIED_TO_USSD = 23, + SS_MODIFIED_TO_DIAL = 24, + SS_MODIFIED_TO_USSD = 25, + SUBSCRIPTION_NOT_SUPPORTED = 26, + SS_MODIFIED_TO_SS = 27, + LCE_NOT_SUPPORTED = 36, + NO_MEMORY = 37, + INTERNAL_ERR = 38, + SYSTEM_ERR = 39, + MODEM_ERR = 40, + INVALID_STATE = 41, + NO_RESOURCES = 42, + SIM_ERR = 43, + INVALID_ARGUMENTS = 44, + INVALID_SIM_STATE = 45, + INVALID_MODEM_STATE = 46, + INVALID_CALL_ID = 47, + NO_SMS_TO_ACK = 48, + NETWORK_ERR = 49, + REQUEST_RATE_LIMITED = 50, + SIM_BUSY = 51, + SIM_FULL = 52, + NETWORK_REJECT = 53, + OPERATION_NOT_ALLOWED = 54, + EMPTY_RECORD = 55, + INVALID_SMS_FORMAT = 56, + ENCODING_ERR = 57, + INVALID_SMSC_ADDRESS = 58, + NO_SUCH_ENTRY = 59, + NETWORK_NOT_READY = 60, + NOT_PROVISIONED = 61, + NO_SUBSCRIPTION = 62, + NO_NETWORK_FOUND = 63, + DEVICE_IN_USE = 64, + ABORTED = 65, + INVALID_RESPONSE = 66, + OEM_ERROR_1 = 501, + OEM_ERROR_2 = 502, + OEM_ERROR_3 = 503, + OEM_ERROR_4 = 504, + OEM_ERROR_5 = 505, + OEM_ERROR_6 = 506, + OEM_ERROR_7 = 507, + OEM_ERROR_8 = 508, + OEM_ERROR_9 = 509, + OEM_ERROR_10 = 510, + OEM_ERROR_11 = 511, + OEM_ERROR_12 = 512, + OEM_ERROR_13 = 513, + OEM_ERROR_14 = 514, + OEM_ERROR_15 = 515, + OEM_ERROR_16 = 516, + OEM_ERROR_17 = 517, + OEM_ERROR_18 = 518, + OEM_ERROR_19 = 519, + OEM_ERROR_20 = 520, + OEM_ERROR_21 = 521, + OEM_ERROR_22 = 522, + OEM_ERROR_23 = 523, + OEM_ERROR_24 = 524, + OEM_ERROR_25 = 525, + SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED = 67, + ACCESS_BARRED = 68, + BLOCKED_DUE_TO_CALL = 69, + RF_HARDWARE_ISSUE = 70, + NO_RF_CALIBRATION_INFO = 71, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioFrequencyInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioFrequencyInfo.aidl new file mode 100644 index 0000000000..6c0704585e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioFrequencyInfo.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 -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; +@VintfStability +union RadioFrequencyInfo { + boolean noinit; + android.hardware.radio.FrequencyRange range; + int channelNumber; +} 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 new file mode 100644 index 0000000000..fc5d4dfc04 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.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 -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; +@Backing(type="int") @VintfStability +enum RadioIndicationType { + UNSOLICITED = 0, + UNSOLICITED_ACK_EXP = 1, +} 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 new file mode 100644 index 0000000000..08c30232f5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfo.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 -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; +@VintfStability +parcelable RadioResponseInfo { + android.hardware.radio.RadioResponseType type; + int serial; + android.hardware.radio.RadioError error; +} 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 new file mode 100644 index 0000000000..cbc4ab9759 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfoModem.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 -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; +@VintfStability +parcelable RadioResponseInfoModem { + android.hardware.radio.RadioResponseType type; + int serial; + android.hardware.radio.RadioError error; + boolean isEnabled; +} 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 new file mode 100644 index 0000000000..cf24183016 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.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 -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; +@Backing(type="int") @VintfStability +enum RadioResponseType { + SOLICITED = 0, + SOLICITED_ACK = 1, + SOLICITED_ACK_EXP = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioState.aidl new file mode 100644 index 0000000000..3dad483679 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioState.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 -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; +@Backing(type="int") @VintfStability +enum RadioState { + OFF = 0, + UNAVAILABLE = 1, + ON = 10, +} 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 new file mode 100644 index 0000000000..d0ca9b5cf5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl @@ -0,0 +1,58 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum RadioTechnology { + UNKNOWN = 0, + GPRS = 1, + EDGE = 2, + UMTS = 3, + IS95A = 4, + IS95B = 5, + ONE_X_RTT = 6, + EVDO_0 = 7, + EVDO_A = 8, + HSDPA = 9, + HSUPA = 10, + HSPA = 11, + EVDO_B = 12, + EHRPD = 13, + LTE = 14, + HSPAP = 15, + GSM = 16, + TD_SCDMA = 17, + IWLAN = 18, + LTE_CA = 19, + NR = 20, +} 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 new file mode 100644 index 0000000000..c11cd1cac6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.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 -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; +@Backing(type="int") @VintfStability +enum RadioTechnologyFamily { + THREE_GPP = 0, + THREE_GPP2 = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegState.aidl new file mode 100644 index 0000000000..049ded1c1d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegState.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 -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; +@Backing(type="int") @VintfStability +enum RegState { + NOT_REG_MT_NOT_SEARCHING_OP = 0, + REG_HOME = 1, + NOT_REG_MT_SEARCHING_OP = 2, + REG_DENIED = 3, + UNKNOWN = 4, + REG_ROAMING = 5, + NOT_REG_MT_NOT_SEARCHING_OP_EM = 10, + NOT_REG_MT_SEARCHING_OP_EM = 12, + REG_DENIED_EM = 13, + UNKNOWN_EM = 14, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResult.aidl new file mode 100644 index 0000000000..78c5c2d30f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResult.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 -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; +@VintfStability +parcelable RegStateResult { + android.hardware.radio.RegState regState; + android.hardware.radio.RadioTechnology rat; + android.hardware.radio.RegistrationFailCause reasonForDenial; + android.hardware.radio.CellIdentity cellIdentity; + String registeredPlmn; + android.hardware.radio.RegStateResultAccessTechnologySpecificInfo accessTechnologySpecificInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.aidl new file mode 100644 index 0000000000..6ce6398498 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.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 -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; +@VintfStability +union RegStateResultAccessTechnologySpecificInfo { + boolean noinit; + android.hardware.radio.RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo cdmaInfo; + android.hardware.radio.RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo eutranInfo; + android.hardware.radio.NrVopsInfo ngranNrVopsInfo; + boolean geranDtmSupported; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.aidl new file mode 100644 index 0000000000..a56a791c7a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.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 -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; +@VintfStability +parcelable RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo { + boolean cssSupported; + int roamingIndicator; + android.hardware.radio.PrlIndicator systemIsInPrl; + int defaultRoamingIndicator; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl new file mode 100644 index 0000000000..ed422eb967 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.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 -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; +@VintfStability +parcelable RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo { + android.hardware.radio.LteVopsInfo lteVopsInfo; + android.hardware.radio.NrIndicators nrIndicators; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegistrationFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegistrationFailCause.aidl new file mode 100644 index 0000000000..c5529b6ddb --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegistrationFailCause.aidl @@ -0,0 +1,89 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum RegistrationFailCause { + NONE = 0, + IMSI_UNKNOWN_IN_HLR = 2, + ILLEGAL_MS = 3, + IMSI_UNKNOWN_IN_VLR = 4, + IMEI_NOT_ACCEPTED = 5, + ILLEGAL_ME = 6, + GPRS_SERVICES_NOT_ALLOWED = 7, + GPRS_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 8, + MS_IDENTITY_CANNOT_BE_DERIVED_BY_NETWORK = 9, + IMPLICITLY_DETACHED = 10, + PLMN_NOT_ALLOWED = 11, + LOCATION_AREA_NOT_ALLOWED = 12, + ROAMING_NOT_ALLOWED = 13, + GPRS_SERVICES_NOT_ALLOWED_IN_PLMN = 14, + NO_SUITABLE_CELLS = 15, + MSC_TEMPORARILY_NOT_REACHABLE = 15, + NETWORK_FAILURE = 17, + MAC_FAILURE = 20, + SYNC_FAILURE = 21, + CONGESTION = 22, + GSM_AUTHENTICATION_UNACCEPTABLE = 23, + NOT_AUTHORIZED_FOR_THIS_CSG = 25, + SMS_PROVIDED_BY_GPRS_IN_ROUTING_AREA = 26, + SERVICE_OPTION_NOT_SUPPORTED = 32, + SERVICE_OPTION_NOT_SUBSCRIBED = 33, + SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER = 34, + CALL_CANNOT_BE_IDENTIFIED = 38, + NO_PDP_CONTEXT_ACTIVATED = 40, + RETRY_UPON_ENTRY_INTO_NEW_CELL_1 = 48, + RETRY_UPON_ENTRY_INTO_NEW_CELL_2 = 49, + RETRY_UPON_ENTRY_INTO_NEW_CELL_3 = 50, + RETRY_UPON_ENTRY_INTO_NEW_CELL_4 = 51, + RETRY_UPON_ENTRY_INTO_NEW_CELL_5 = 52, + RETRY_UPON_ENTRY_INTO_NEW_CELL_6 = 53, + RETRY_UPON_ENTRY_INTO_NEW_CELL_7 = 54, + RETRY_UPON_ENTRY_INTO_NEW_CELL_8 = 55, + RETRY_UPON_ENTRY_INTO_NEW_CELL_9 = 56, + RETRY_UPON_ENTRY_INTO_NEW_CELL_10 = 57, + RETRY_UPON_ENTRY_INTO_NEW_CELL_11 = 58, + RETRY_UPON_ENTRY_INTO_NEW_CELL_12 = 59, + RETRY_UPON_ENTRY_INTO_NEW_CELL_13 = 60, + RETRY_UPON_ENTRY_INTO_NEW_CELL_14 = 61, + RETRY_UPON_ENTRY_INTO_NEW_CELL_15 = 62, + RETRY_UPON_ENTRY_INTO_NEW_CELL_16 = 63, + SEMANTICALLY_INCORRECT_MESSAGE = 95, + INVALID_MANDATORY_INFORMATION = 96, + MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED = 97, + MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98, + INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED = 99, + CONDITIONAL_IE_ERROR = 100, + MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101, + PROTOCOL_ERROR_UNSPECIFIED = 111, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ResetNvType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ResetNvType.aidl new file mode 100644 index 0000000000..3852a7719e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ResetNvType.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 -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; +@Backing(type="int") @VintfStability +enum ResetNvType { + RELOAD = 0, + ERASE = 1, + FACTORY_RESET = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RestrictedState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RestrictedState.aidl new file mode 100644 index 0000000000..dc83ba57af --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RestrictedState.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 -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; +@Backing(type="int") @VintfStability +enum RestrictedState { + NONE = 0, + CS_EMERGENCY = 1, + CS_NORMAL = 2, + CS_ALL = 4, + PS_ALL = 16, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RouteSelectionDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RouteSelectionDescriptor.aidl new file mode 100644 index 0000000000..689ee2ff97 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RouteSelectionDescriptor.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 -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; +@VintfStability +parcelable RouteSelectionDescriptor { + byte precedence; + android.hardware.radio.OptionalPdpProtocolType sessionType; + android.hardware.radio.OptionalSscMode sscMode; + android.hardware.radio.SliceInfo[] sliceInfo; + String[] dnn; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapApduType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapApduType.aidl new file mode 100644 index 0000000000..9bfb725bfa --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapApduType.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 -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; +@Backing(type="int") @VintfStability +enum SapApduType { + APDU = 0, + APDU7816 = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapConnectRsp.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapConnectRsp.aidl new file mode 100644 index 0000000000..7e4d246765 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapConnectRsp.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 -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; +@Backing(type="int") @VintfStability +enum SapConnectRsp { + SUCCESS = 0, + CONNECT_FAILURE = 1, + MSG_SIZE_TOO_LARGE = 2, + MSG_SIZE_TOO_SMALL = 3, + CONNECT_OK_CALL_ONGOING = 4, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapDisconnectType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapDisconnectType.aidl new file mode 100644 index 0000000000..e0d8eb2481 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapDisconnectType.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 -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; +@Backing(type="int") @VintfStability +enum SapDisconnectType { + GRACEFUL = 0, + IMMEDIATE = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapResultCode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapResultCode.aidl new file mode 100644 index 0000000000..0c6c5139dd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapResultCode.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 -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; +@Backing(type="int") @VintfStability +enum SapResultCode { + SUCCESS = 0, + GENERIC_FAILURE = 1, + CARD_NOT_ACCESSSIBLE = 2, + CARD_ALREADY_POWERED_OFF = 3, + CARD_REMOVED = 4, + CARD_ALREADY_POWERED_ON = 5, + DATA_NOT_AVAILABLE = 6, + NOT_SUPPORTED = 7, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapStatus.aidl new file mode 100644 index 0000000000..715c5074a5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapStatus.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 -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; +@Backing(type="int") @VintfStability +enum SapStatus { + UNKNOWN_ERROR = 0, + CARD_RESET = 1, + CARD_NOT_ACCESSIBLE = 2, + CARD_REMOVED = 3, + CARD_INSERTED = 4, + RECOVERED = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapTransferProtocol.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapTransferProtocol.aidl new file mode 100644 index 0000000000..6eadbb7737 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SapTransferProtocol.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 -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; +@Backing(type="int") @VintfStability +enum SapTransferProtocol { + T0 = 0, + T1 = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanIntervalRange.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanIntervalRange.aidl new file mode 100644 index 0000000000..3e6539b8f9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanIntervalRange.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 -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; +@Backing(type="int") @VintfStability +enum ScanIntervalRange { + MIN = 5, + MAX = 300, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanStatus.aidl new file mode 100644 index 0000000000..f8810b6690 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanStatus.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 -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; +@Backing(type="int") @VintfStability +enum ScanStatus { + PARTIAL = 1, + COMPLETE = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanType.aidl new file mode 100644 index 0000000000..7d51ce25f1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanType.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 -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; +@Backing(type="int") @VintfStability +enum ScanType { + ONE_SHOT = 0, + PERIODIC = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SelectUiccSub.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SelectUiccSub.aidl new file mode 100644 index 0000000000..a285f64891 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SelectUiccSub.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 -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; +@VintfStability +parcelable SelectUiccSub { + int slot; + int appIndex; + android.hardware.radio.SubscriptionType subType; + android.hardware.radio.UiccSubActStatus actStatus; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SendSmsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SendSmsResult.aidl new file mode 100644 index 0000000000..7063db5a3a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SendSmsResult.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 -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; +@VintfStability +parcelable SendSmsResult { + int messageRef; + String ackPDU; + int errorCode; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SetupDataCallResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SetupDataCallResult.aidl new file mode 100644 index 0000000000..ae4493d50e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SetupDataCallResult.aidl @@ -0,0 +1,55 @@ +/* + * 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 -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; +@VintfStability +parcelable SetupDataCallResult { + android.hardware.radio.DataCallFailCause cause; + long suggestedRetryTime; + int cid; + android.hardware.radio.DataConnActiveStatus active; + android.hardware.radio.PdpProtocolType type; + String ifname; + android.hardware.radio.LinkAddress[] addresses; + String[] dnses; + String[] gateways; + String[] pcscf; + int mtuV4; + int mtuV6; + android.hardware.radio.Qos defaultQos; + android.hardware.radio.QosSession[] qosSessions; + android.hardware.radio.HandoverFailureMode handoverFailureMode; + int pduSessionId; + android.hardware.radio.OptionalSliceInfo sliceInfo; + android.hardware.radio.TrafficDescriptor[] trafficDescriptors; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalMeasurementType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalMeasurementType.aidl new file mode 100644 index 0000000000..7f864e5b32 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalMeasurementType.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 -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; +@Backing(type="int") @VintfStability +enum SignalMeasurementType { + RSSI = 1, + RSCP = 2, + RSRP = 3, + RSRQ = 4, + RSSNR = 5, + SSRSRP = 6, + SSRSRQ = 7, + SSSINR = 8, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalStrength.aidl new file mode 100644 index 0000000000..7c7eade8a3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalStrength.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 -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; +@VintfStability +parcelable SignalStrength { + android.hardware.radio.GsmSignalStrength gsm; + android.hardware.radio.CdmaSignalStrength cdma; + android.hardware.radio.EvdoSignalStrength evdo; + android.hardware.radio.LteSignalStrength lte; + android.hardware.radio.TdscdmaSignalStrength tdscdma; + android.hardware.radio.WcdmaSignalStrength wcdma; + android.hardware.radio.NrSignalStrength nr; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalThresholdInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalThresholdInfo.aidl new file mode 100644 index 0000000000..f519d69b5b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalThresholdInfo.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 -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; +@VintfStability +parcelable SignalThresholdInfo { + android.hardware.radio.SignalMeasurementType signalMeasurement; + int hysteresisMs; + int hysteresisDb; + int[] thresholds; + boolean isEnabled; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimApdu.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimApdu.aidl new file mode 100644 index 0000000000..511031aec7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimApdu.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 -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; +@VintfStability +parcelable SimApdu { + int sessionId; + int cla; + int instruction; + int p1; + int p2; + int p3; + String data; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimLockMultiSimPolicy.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimLockMultiSimPolicy.aidl new file mode 100644 index 0000000000..ad967940fd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimLockMultiSimPolicy.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 -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; +@Backing(type="int") @VintfStability +enum SimLockMultiSimPolicy { + NO_MULTISIM_POLICY = 0, + ONE_VALID_SIM_MUST_BE_PRESENT = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshResult.aidl new file mode 100644 index 0000000000..720c8a20fc --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshResult.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 -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; +@VintfStability +parcelable SimRefreshResult { + android.hardware.radio.SimRefreshType type; + int efId; + String aid; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshType.aidl new file mode 100644 index 0000000000..b114ec7c92 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshType.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 -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; +@Backing(type="int") @VintfStability +enum SimRefreshType { + SIM_FILE_UPDATE = 0, + SIM_INIT = 1, + SIM_RESET = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceInfo.aidl new file mode 100644 index 0000000000..8b363801ce --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceInfo.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 -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; +@VintfStability +parcelable SliceInfo { + android.hardware.radio.SliceServiceType sst; + int sliceDifferentiator; + android.hardware.radio.SliceServiceType mappedHplmnSst; + int mappedHplmnSD; + android.hardware.radio.SliceStatus status; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceServiceType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceServiceType.aidl new file mode 100644 index 0000000000..d0a9f58d80 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceServiceType.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 -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; +@Backing(type="byte") @VintfStability +enum SliceServiceType { + NONE = 0, + EMBB = 1, + URLLC = 2, + MIOT = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceStatus.aidl new file mode 100644 index 0000000000..3fa1ee6b15 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceStatus.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 -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; +@Backing(type="byte") @VintfStability +enum SliceStatus { + UNKNOWN = 0, + CONFIGURED = 1, + ALLOWED = 2, + REJECTED_NOT_AVAILABLE_IN_PLMN = 3, + REJECTED_NOT_AVAILABLE_IN_REG_AREA = 4, + DEFAULT_CONFIGURED = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SlicingConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SlicingConfig.aidl new file mode 100644 index 0000000000..9d3633836c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SlicingConfig.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 -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; +@VintfStability +parcelable SlicingConfig { + android.hardware.radio.UrspRule[] urspRules; + android.hardware.radio.SliceInfo[] sliceInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsAcknowledgeFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsAcknowledgeFailCause.aidl new file mode 100644 index 0000000000..c5b13b934a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsAcknowledgeFailCause.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 -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; +@Backing(type="int") @VintfStability +enum SmsAcknowledgeFailCause { + MEMORY_CAPACITY_EXCEEDED = 211, + UNSPECIFIED_ERROR = 255, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgs.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgs.aidl new file mode 100644 index 0000000000..6b0d9bf3bd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgs.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 -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; +@VintfStability +parcelable SmsWriteArgs { + android.hardware.radio.SmsWriteArgsStatus status; + String pdu; + String smsc; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgsStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgsStatus.aidl new file mode 100644 index 0000000000..31a3f42e77 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgsStatus.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 -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; +@Backing(type="int") @VintfStability +enum SmsWriteArgsStatus { + REC_UNREAD = 0, + REC_READ = 1, + STO_UNSENT = 2, + STO_SENT = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SrvccState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SrvccState.aidl new file mode 100644 index 0000000000..d4a941763c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SrvccState.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 -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; +@Backing(type="int") @VintfStability +enum SrvccState { + HANDOVER_STARTED = 0, + HANDOVER_COMPLETED = 1, + HANDOVER_FAILED = 2, + HANDOVER_CANCELED = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsInfoData.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsInfoData.aidl new file mode 100644 index 0000000000..10b4c3d81a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsInfoData.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 -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; +@VintfStability +parcelable SsInfoData { + int[] ssInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsRequestType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsRequestType.aidl new file mode 100644 index 0000000000..75ad9bb2c5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsRequestType.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 -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; +@Backing(type="int") @VintfStability +enum SsRequestType { + ACTIVATION = 0, + DEACTIVATION = 1, + INTERROGATION = 2, + REGISTRATION = 3, + ERASURE = 4, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsServiceType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsServiceType.aidl new file mode 100644 index 0000000000..c3506b10c6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsServiceType.aidl @@ -0,0 +1,56 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum SsServiceType { + CFU = 0, + CF_BUSY = 1, + CF_NO_REPLY = 2, + CF_NOT_REACHABLE = 3, + CF_ALL = 4, + CF_ALL_CONDITIONAL = 5, + CLIP = 6, + CLIR = 7, + COLP = 8, + COLR = 9, + WAIT = 10, + BAOC = 11, + BAOIC = 12, + BAOIC_EXC_HOME = 13, + BAIC = 14, + BAIC_ROAMING = 15, + ALL_BARRING = 16, + OUTGOING_BARRING = 17, + INCOMING_BARRING = 18, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsTeleserviceType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsTeleserviceType.aidl new file mode 100644 index 0000000000..f06014cd50 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsTeleserviceType.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 -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; +@Backing(type="int") @VintfStability +enum SsTeleserviceType { + ALL_TELE_AND_BEARER_SERVICES = 0, + ALL_TELESEVICES = 1, + TELEPHONY = 2, + ALL_DATA_TELESERVICES = 3, + SMS_SERVICES = 4, + ALL_TELESERVICES_EXCEPT_SMS = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SscMode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SscMode.aidl new file mode 100644 index 0000000000..e2c3e09492 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SscMode.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 -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; +@Backing(type="byte") @VintfStability +enum SscMode { + MODE_1 = 1, + MODE_2 = 2, + MODE_3 = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/StkCcUnsolSsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/StkCcUnsolSsResult.aidl new file mode 100644 index 0000000000..1e4f95b69d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/StkCcUnsolSsResult.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 -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; +@VintfStability +parcelable StkCcUnsolSsResult { + android.hardware.radio.SsServiceType serviceType; + android.hardware.radio.SsRequestType requestType; + android.hardware.radio.SsTeleserviceType teleserviceType; + android.hardware.radio.SuppServiceClass serviceClass; + android.hardware.radio.RadioError result; + android.hardware.radio.SsInfoData[] ssInfo; + android.hardware.radio.CfData[] cfData; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SubscriptionType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SubscriptionType.aidl new file mode 100644 index 0000000000..f469f2faef --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SubscriptionType.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 -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; +@Backing(type="int") @VintfStability +enum SubscriptionType { + SUBSCRIPTION_1 = 0, + SUBSCRIPTION_2 = 1, + SUBSCRIPTION_3 = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SuppServiceClass.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SuppServiceClass.aidl new file mode 100644 index 0000000000..e59f40b1df --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SuppServiceClass.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 -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; +@Backing(type="int") @VintfStability +enum SuppServiceClass { + NONE = 0, + VOICE = 1, + DATA = 2, + FAX = 4, + SMS = 8, + DATA_SYNC = 16, + DATA_ASYNC = 32, + PACKET = 64, + PAD = 128, + MAX = 128, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SuppSvcNotification.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SuppSvcNotification.aidl new file mode 100644 index 0000000000..c098e245fc --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SuppSvcNotification.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 -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; +@VintfStability +parcelable SuppSvcNotification { + boolean isMT; + int code; + int index; + int type; + String number; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TdscdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TdscdmaSignalStrength.aidl new file mode 100644 index 0000000000..a2ba211d3f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TdscdmaSignalStrength.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 -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; +@VintfStability +parcelable TdscdmaSignalStrength { + int signalStrength; + int bitErrorRate; + int rscp; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TimeStampType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TimeStampType.aidl new file mode 100644 index 0000000000..ae70522aa7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TimeStampType.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 -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; +@Backing(type="int") @VintfStability +enum TimeStampType { + UNKNOWN = 0, + ANTENNA = 1, + MODEM = 2, + OEM_RIL = 3, + JAVA_RIL = 4, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TrafficDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TrafficDescriptor.aidl new file mode 100644 index 0000000000..9f46848d44 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TrafficDescriptor.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 -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; +@VintfStability +parcelable TrafficDescriptor { + android.hardware.radio.OptionalDnn dnn; + android.hardware.radio.OptionalOsAppId osAppId; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TtyMode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TtyMode.aidl new file mode 100644 index 0000000000..cee3057c27 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TtyMode.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 -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; +@Backing(type="int") @VintfStability +enum TtyMode { + OFF = 0, + FULL = 1, + HCO = 2, + VCO = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UiccSubActStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UiccSubActStatus.aidl new file mode 100644 index 0000000000..5ec511e989 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UiccSubActStatus.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 -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; +@Backing(type="int") @VintfStability +enum UiccSubActStatus { + DEACTIVATE = 0, + ACTIVATE = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UrspRule.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UrspRule.aidl new file mode 100644 index 0000000000..ababb29539 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UrspRule.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 -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; +@VintfStability +parcelable UrspRule { + byte precedence; + android.hardware.radio.TrafficDescriptor[] trafficDescriptors; + android.hardware.radio.RouteSelectionDescriptor[] routeSelectionDescriptor; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UssdModeType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UssdModeType.aidl new file mode 100644 index 0000000000..992a55f5d0 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UssdModeType.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 -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; +@Backing(type="int") @VintfStability +enum UssdModeType { + NOTIFY = 0, + REQUEST = 1, + NW_RELEASE = 2, + LOCAL_CLIENT = 3, + NOT_SUPPORTED = 4, + NW_TIMEOUT = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UtranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UtranBands.aidl new file mode 100644 index 0000000000..32cff727ff --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UtranBands.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 -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; +@Backing(type="int") @VintfStability +enum UtranBands { + BAND_1 = 1, + BAND_2 = 2, + BAND_3 = 3, + BAND_4 = 4, + BAND_5 = 5, + BAND_6 = 6, + BAND_7 = 7, + BAND_8 = 8, + BAND_9 = 9, + BAND_10 = 10, + BAND_11 = 11, + BAND_12 = 12, + BAND_13 = 13, + BAND_14 = 14, + BAND_19 = 19, + BAND_20 = 20, + BAND_21 = 21, + BAND_22 = 22, + BAND_25 = 25, + BAND_26 = 26, + BAND_A = 101, + BAND_B = 102, + BAND_C = 103, + BAND_D = 104, + BAND_E = 105, + BAND_F = 106, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusDcs.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusDcs.aidl new file mode 100644 index 0000000000..cf1bacacb3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusDcs.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 -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; +@Backing(type="int") @VintfStability +enum UusDcs { + USP = 0, + OSIHLP = 1, + X244 = 2, + RMCF = 3, + IA5C = 4, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusInfo.aidl new file mode 100644 index 0000000000..3551fe3b70 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusInfo.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 -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; +@VintfStability +parcelable UusInfo { + android.hardware.radio.UusType uusType; + android.hardware.radio.UusDcs uusDcs; + String uusData; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusType.aidl new file mode 100644 index 0000000000..7176d400c5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusType.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 -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; +@Backing(type="int") @VintfStability +enum UusType { + TYPE1_IMPLICIT = 0, + TYPE1_REQUIRED = 1, + TYPE1_NOT_REQUIRED = 2, + TYPE2_REQUIRED = 3, + TYPE2_NOT_REQUIRED = 4, + TYPE3_REQUIRED = 5, + TYPE3_NOT_REQUIRED = 6, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/VoiceRegStateResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/VoiceRegStateResult.aidl new file mode 100644 index 0000000000..a693ff5240 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/VoiceRegStateResult.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 -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; +@VintfStability +parcelable VoiceRegStateResult { + android.hardware.radio.RegState regState; + int rat; + boolean cssSupported; + int roamingIndicator; + int systemIsInPrl; + int defaultRoamingIndicator; + int reasonForDenial; + android.hardware.radio.CellIdentity cellIdentity; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/VopsIndicator.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/VopsIndicator.aidl new file mode 100644 index 0000000000..028b71907d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/VopsIndicator.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 -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; +@Backing(type="byte") @VintfStability +enum VopsIndicator { + VOPS_NOT_SUPPORTED = 0, + VOPS_OVER_3GPP = 1, + VOPS_OVER_NON_3GPP = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/WcdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/WcdmaSignalStrength.aidl new file mode 100644 index 0000000000..764ddedfa1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/WcdmaSignalStrength.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 -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; +@VintfStability +parcelable WcdmaSignalStrength { + int signalStrength; + int bitErrorRate; + int rscp; + int ecno; +} diff --git a/radio/aidl/android/hardware/radio/AccessNetwork.aidl b/radio/aidl/android/hardware/radio/AccessNetwork.aidl new file mode 100644 index 0000000000..10b84f4948 --- /dev/null +++ b/radio/aidl/android/hardware/radio/AccessNetwork.aidl @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum AccessNetwork { + /** + * Unknown access network + */ + UNKNOWN, + /** + * GSM EDGE Radio Access Network + */ + GERAN, + /** + * Universal Terrestrial Radio Access Network + */ + UTRAN, + /** + * Evolved Universal Terrestrial Radio Access Network + */ + EUTRAN, + /** + * CDMA 2000 network + */ + CDMA2000, + /** + * Interworking Wireless LAN + */ + IWLAN, + /** + * Next-Generation Radio Access Network (NGRAN). + * Note NGRAN is only for standalone mode. Non-standalone mode uses AccessNetwork EUTRAN. + */ + NGRAN, +} diff --git a/radio/aidl/android/hardware/radio/ActivityStatsInfo.aidl b/radio/aidl/android/hardware/radio/ActivityStatsInfo.aidl new file mode 100644 index 0000000000..f1a6e0e355 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ActivityStatsInfo.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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable ActivityStatsInfo { + /** + * Total time (in ms) when modem is in a low power or sleep state + */ + int sleepModeTimeMs; + /** + * Total time (in ms) when modem is awake but neither the transmitter nor receiver are + * active/awake + */ + int idleModeTimeMs; + /** + * Each index represent total time (in ms) during which the transmitter is active/awake for a + * particular power range as shown below. + * index 0 = tx_power < 0dBm + * index 1 = 0dBm < tx_power < 5dBm + * index 2 = 5dBm < tx_power < 15dBm + * index 3 = 15dBm < tx_power < 20dBm + * index 4 = tx_power > 20dBm + */ + int[] txmModetimeMs; + /** + * Total time (in ms) for which receiver is active/awake and the transmitter is inactive + */ + int rxModeTimeMs; +} diff --git a/radio/aidl/android/hardware/radio/AddressProperty.aidl b/radio/aidl/android/hardware/radio/AddressProperty.aidl new file mode 100644 index 0000000000..dbafc17b2b --- /dev/null +++ b/radio/aidl/android/hardware/radio/AddressProperty.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * The properties of the link address. This enum reflects the definition in if_addr.h in + * Linux kernel. + */ +@VintfStability +@Backing(type="int") +enum AddressProperty { + NONE = 0, + /** + * Indicates this address is deprecated + */ + DEPRECATED = 0x20, +} diff --git a/radio/aidl/android/hardware/radio/ApnAuthType.aidl b/radio/aidl/android/hardware/radio/ApnAuthType.aidl new file mode 100644 index 0000000000..c836a31476 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ApnAuthType.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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum ApnAuthType { + /** + * PAP and CHAP is never performed. + */ + NO_PAP_NO_CHAP, + /** + * PAP may be performed; CHAP is never performed. + */ + PAP_NO_CHAP, + /** + * CHAP may be performed; PAP is never performed. + */ + NO_PAP_CHAP, + /** + * PAP / CHAP may be performed - baseband dependent. + */ + PAP_CHAP, +} diff --git a/radio/aidl/android/hardware/radio/ApnTypes.aidl b/radio/aidl/android/hardware/radio/ApnTypes.aidl new file mode 100644 index 0000000000..340301fd40 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ApnTypes.aidl @@ -0,0 +1,81 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum ApnTypes { + /** + * None + */ + NONE = 0, + /** + * APN type for default data traffic + */ + DEFAULT = 1 << 0, + /** + * APN type for MMS traffic + */ + MMS = 1 << 1, + /** + * APN type for SUPL assisted GPS + */ + SUPL = 1 << 2, + /** + * APN type for DUN traffic + */ + DUN = 1 << 3, + /** + * APN type for HiPri traffic + */ + HIPRI = 1 << 4, + /** + * APN type for FOTA + */ + FOTA = 1 << 5, + /** + * APN type for IMS + */ + IMS = 1 << 6, + /** + * APN type for CBS + */ + CBS = 1 << 7, + /** + * APN type for IA Initial Attach APN + */ + IA = 1 << 8, + /** + * APN type for Emergency PDN. This is not an IA apn, but is used for access to carrier services + * in an emergency call situation. + */ + EMERGENCY = 1 << 9, + /** + * Due to the addition of values after EMERGENCY (eg. MCX, XCAP), this value is now deprecated + * and should not be used. + */ + ALL = DEFAULT | MMS | SUPL | DUN | HIPRI | FOTA | IMS | CBS | IA | EMERGENCY, + /** + * APN type for Mission Critical Service + * Reference: 3GPP TS 22.280 V15.3.0 + */ + MCX = 1 << 10, + /** + * APN type for XCAP + */ + XCAP = 1 << 11, +} diff --git a/radio/aidl/android/hardware/radio/AppState.aidl b/radio/aidl/android/hardware/radio/AppState.aidl new file mode 100644 index 0000000000..9488282cc2 --- /dev/null +++ b/radio/aidl/android/hardware/radio/AppState.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum AppState { + UNKNOWN, + DETECTED, + /** + * If PIN1 or UPin is required + */ + PIN, + /** + * If PUK1 or Puk for Upin is required + */ + PUK, + /** + * perso_substate must be looked at when app_state is assigned to this value + */ + SUBSCRIPTION_PERSO, + READY, +} diff --git a/radio/aidl/android/hardware/radio/AppStatus.aidl b/radio/aidl/android/hardware/radio/AppStatus.aidl new file mode 100644 index 0000000000..6b6269754d --- /dev/null +++ b/radio/aidl/android/hardware/radio/AppStatus.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.AppState; +import android.hardware.radio.AppType; +import android.hardware.radio.PersoSubstate; +import android.hardware.radio.PinState; + +@VintfStability +parcelable AppStatus { + AppType appType; + AppState appState; + /** + * Applicable only if appState == SUBSCRIPTION_PERSO + */ + PersoSubstate persoSubstate; + /** + * e.g., from 0xA0, 0x00 -> 0x41, 0x30, 0x30, 0x30 + */ + String aidPtr; + String appLabelPtr; + /** + * Applicable to USIM, CSIM and ISIM + */ + int pin1Replaced; + PinState pin1; + PinState pin2; +} diff --git a/radio/aidl/android/hardware/radio/AppType.aidl b/radio/aidl/android/hardware/radio/AppType.aidl new file mode 100644 index 0000000000..8403f7dd63 --- /dev/null +++ b/radio/aidl/android/hardware/radio/AppType.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum AppType { + UNKNOWN, + SIM, + USIM, + RUIM, + CSIM, + ISIM, +} diff --git a/radio/aidl/android/hardware/radio/AudioQuality.aidl b/radio/aidl/android/hardware/radio/AudioQuality.aidl new file mode 100644 index 0000000000..bc4c2f1201 --- /dev/null +++ b/radio/aidl/android/hardware/radio/AudioQuality.aidl @@ -0,0 +1,66 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Audio codec which is used on GSM, UMTS, and CDMA. These values must be opaque to the Android + * framework. Only for display. + */ +@VintfStability +@Backing(type="int") +enum AudioQuality { + /** + * Unspecified audio codec + */ + UNSPECIFIED, + /** + * AMR (Narrowband) audio codec + */ + AMR, + /** + * AMR (Wideband) audio codec + */ + AMR_WB, + /** + * GSM Enhanced Full-Rate audio codec + */ + GSM_EFR, + /** + * GSM Full-Rate audio codec + */ + GSM_FR, + /** + * GSM Half-Rate audio codec + */ + GSM_HR, + /** + * Enhanced Variable rate codec + */ + EVRC, + /** + * Enhanced Variable rate codec revision B + */ + EVRC_B, + /** + * Enhanced Variable rate codec (Wideband) + */ + EVRC_WB, + /** + * Enhanced Variable rate codec (Narrowband) + */ + EVRC_NW, +} diff --git a/radio/aidl/android/hardware/radio/BarringInfo.aidl b/radio/aidl/android/hardware/radio/BarringInfo.aidl new file mode 100644 index 0000000000..c50fa4b5db --- /dev/null +++ b/radio/aidl/android/hardware/radio/BarringInfo.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.BarringInfoBarringType; +import android.hardware.radio.BarringInfoBarringTypeSpecificInfo; +import android.hardware.radio.BarringInfoServiceType; + +@VintfStability +parcelable BarringInfo { + /** + * Combined list of barring services for UTRAN, EUTRAN, and NGRAN. + * + * Barring information is defined in: + * -UTRAN - 3gpp 25.331 Sec 10.2.48.8.6. + * -EUTRAN - 3gpp 36.331 Sec 6.3.1 SystemInformationBlockType2 + * -NGRAN - 3gpp 38.331 Sec 6.3.2 UAC-BarringInfo and 22.261 Sec 6.22.2.[2-3] + */ + BarringInfoServiceType serviceType; + /** + * The type of barring applied to the service + */ + BarringInfoBarringType barringType; + /** + * Type-specific barring info if applicable + */ + BarringInfoBarringTypeSpecificInfo barringTypeSpecificInfo; +} diff --git a/radio/aidl/android/hardware/radio/BarringInfoBarringType.aidl b/radio/aidl/android/hardware/radio/BarringInfoBarringType.aidl new file mode 100644 index 0000000000..41f5fbb719 --- /dev/null +++ b/radio/aidl/android/hardware/radio/BarringInfoBarringType.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum BarringInfoBarringType { + /** + * Device is not barred for the given service + */ + NONE, + /** + * Device may be barred based on time and probability factors + */ + CONDITIONAL, + /* + * Device is unconditionally barred + */ + UNCONDITIONAL, +} diff --git a/radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.aidl b/radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.aidl new file mode 100644 index 0000000000..18f309dad4 --- /dev/null +++ b/radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.BarringInfoBarringTypeSpecificInfoConditional; + +@VintfStability +union BarringInfoBarringTypeSpecificInfo { + /** + * Barring type is either none or unconditional + */ + boolean noinit; + /** + * Must be included if barring is conditional + */ + BarringInfoBarringTypeSpecificInfoConditional conditional; +} diff --git a/radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.aidl b/radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.aidl new file mode 100644 index 0000000000..e3b7dfa657 --- /dev/null +++ b/radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable BarringInfoBarringTypeSpecificInfoConditional { + /** + * The barring factor as a percentage 0-100 + */ + int factor; + /** + * The number of seconds between re-evaluations of barring + */ + int timeSeconds; + /** + * Indicates whether barring is currently being applied. + * + *

True if the UE applies barring to a conditionally barred service based on the conditional + * barring parameters. + * + *

False if the service is conditionally barred but barring is not currently applied, which + * could be due to either the barring criteria not having been evaluated (if the UE has not + * attempted to use the service) or due to the criteria being evaluated and the UE being + * permitted to use the service despite conditional barring. + */ + boolean isBarred; +} diff --git a/radio/aidl/android/hardware/radio/BarringInfoServiceType.aidl b/radio/aidl/android/hardware/radio/BarringInfoServiceType.aidl new file mode 100644 index 0000000000..1fa52a06d5 --- /dev/null +++ b/radio/aidl/android/hardware/radio/BarringInfoServiceType.aidl @@ -0,0 +1,100 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum BarringInfoServiceType { + /** + * Applicable to UTRAN + * Barring for all CS services, including registration + */ + CS_SERVICE, + /** + * Barring for all PS services, including registration + */ + PS_SERVICE, + /** + * Barring for mobile-originated circuit-switched voice calls + */ + CS_VOICE, + /** + * Applicable to EUTRAN, NGRAN + * Barring for mobile-originated signalling for any purpose + */ + MO_SIGNALLING, + /** + * Barring for mobile-originated internet or other interactive data + */ + MO_DATA, + /** + * Barring for circuit-switched fallback calling + */ + CS_FALLBACK, + /** + * Barring for IMS voice calling + */ + MMTEL_VOICE, + /** + * Barring for IMS video calling + */ + MMTEL_VIDEO, + /** + * Applicable to UTRAN, EUTRAN, NGRAN + * Barring for emergency services, either CS or emergency MMTEL + */ + EMERGENCY, + /** + * Barring for short message services + */ + SMS, + /** + * Operator-specific barring codes; applicable to NGRAN + */ + OPERATOR_1 = 1001, + OPERATOR_2 = 1002, + OPERATOR_3 = 1003, + OPERATOR_4 = 1004, + OPERATOR_5 = 1005, + OPERATOR_6 = 1006, + OPERATOR_7 = 1007, + OPERATOR_8 = 1008, + OPERATOR_9 = 1009, + OPERATOR_10 = 1010, + OPERATOR_11 = 1011, + OPERATOR_12 = 1012, + OPERATOR_13 = 1013, + OPERATOR_14 = 1014, + OPERATOR_15 = 1015, + OPERATOR_16 = 1016, + OPERATOR_17 = 1017, + OPERATOR_18 = 1018, + OPERATOR_19 = 1019, + OPERATOR_20 = 1020, + OPERATOR_21 = 1021, + OPERATOR_22 = 1022, + OPERATOR_23 = 1023, + OPERATOR_24 = 1024, + OPERATOR_25 = 1025, + OPERATOR_26 = 1026, + OPERATOR_27 = 1027, + OPERATOR_28 = 1028, + OPERATOR_29 = 1029, + OPERATOR_30 = 1030, + OPERATOR_31 = 1031, + OPERATOR_32 = 1032, +} diff --git a/radio/aidl/android/hardware/radio/Call.aidl b/radio/aidl/android/hardware/radio/Call.aidl new file mode 100644 index 0000000000..38cb3d3fdc --- /dev/null +++ b/radio/aidl/android/hardware/radio/Call.aidl @@ -0,0 +1,75 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.AudioQuality; +import android.hardware.radio.CallPresentation; +import android.hardware.radio.CallState; +import android.hardware.radio.UusInfo; + +@VintfStability +parcelable Call { + CallState state; + /** + * Connection index for use with, eg, AT+CHLD + */ + int index; + /** + * Type of address, eg 145 = intl + */ + int toa; + /** + * true if is mpty call + */ + boolean isMpty; + /** + * true if call is mobile terminated + */ + boolean isMT; + /** + * ALS line indicator if availale (0 = line 1) + */ + byte als; + /** + * true if this is a voice call + */ + boolean isVoice; + /** + * true if CDMA voice privacy mode is active + */ + boolean isVoicePrivacy; + /** + * Remote party nummber + */ + String number; + CallPresentation numberPresentation; + /** + * Remote party name + */ + String name; + CallPresentation namePresentation; + /** + * Vector of User-User Signaling Information + */ + UusInfo[] uusInfo; + AudioQuality audioQuality; + /** + * Forwarded number. It can set only one forwarded number based on 3GPP rule of the CS. + * Reference: 3GPP TS 24.008 section 10.5.4.21b + */ + String forwardedNumber; +} diff --git a/radio/aidl/android/hardware/radio/CallForwardInfo.aidl b/radio/aidl/android/hardware/radio/CallForwardInfo.aidl new file mode 100644 index 0000000000..91a30555eb --- /dev/null +++ b/radio/aidl/android/hardware/radio/CallForwardInfo.aidl @@ -0,0 +1,49 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CallForwardInfoStatus; + +/** + * See also com.android.internal.telephony.gsm.CallForwardInfo + */ +@VintfStability +parcelable CallForwardInfo { + /** + * For queryCallForwardStatus() status is DISABLE (Not used by vendor code currently) + * For setCallForward() status must be DISABLE, ENABLE, INTERROGATE, REGISTRATION, ERASURE + */ + CallForwardInfoStatus status; + /** + * From TS 27.007 7.11 "reason" + */ + int reason; + /** + * From TS 27.007 +CCFC/+CLCK "class". See table for Android mapping from MMI service code. + * 0 means user doesn't input class. + */ + int serviceClass; + /** + * From TS 27.007 7.11 "type" + */ + int toa; + /** + * From TS 27.007 7.11 "number" + */ + String number; + int timeSeconds; +} diff --git a/radio/aidl/android/hardware/radio/CallForwardInfoStatus.aidl b/radio/aidl/android/hardware/radio/CallForwardInfoStatus.aidl new file mode 100644 index 0000000000..f4ae503e4c --- /dev/null +++ b/radio/aidl/android/hardware/radio/CallForwardInfoStatus.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CallForwardInfoStatus { + DISABLE, + ENABLE, + INTERROGATE, + REGISTRATION, + ERASURE, +} diff --git a/radio/aidl/android/hardware/radio/CallPresentation.aidl b/radio/aidl/android/hardware/radio/CallPresentation.aidl new file mode 100644 index 0000000000..76b5f21a2a --- /dev/null +++ b/radio/aidl/android/hardware/radio/CallPresentation.aidl @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CallPresentation { + ALLOWED, + RESTRICTED, + UNKNOWN, + PAYPHONE, +} diff --git a/radio/aidl/android/hardware/radio/CallState.aidl b/radio/aidl/android/hardware/radio/CallState.aidl new file mode 100644 index 0000000000..4b6f1ac235 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CallState.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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CallState { + ACTIVE, + HOLDING, + /** + * MO call only + */ + DIALING, + /** + * MO call only + */ + ALERTING, + /** + * MT call only + */ + INCOMING, + /** + * MT call only + */ + WAITING, +} diff --git a/radio/aidl/android/hardware/radio/CardPowerState.aidl b/radio/aidl/android/hardware/radio/CardPowerState.aidl new file mode 100644 index 0000000000..23088c9635 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CardPowerState.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CardPowerState { + POWER_DOWN, + POWER_UP, + POWER_UP_PASS_THROUGH, +} diff --git a/radio/aidl/android/hardware/radio/CardState.aidl b/radio/aidl/android/hardware/radio/CardState.aidl new file mode 100644 index 0000000000..c1bbee6b0a --- /dev/null +++ b/radio/aidl/android/hardware/radio/CardState.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CardState { + /* + * Card is physically absent from device. (Some old modems use CardState.ABSENT when the SIM + * is powered off. This is no longer correct, however the platform will still support this + * legacy behavior.) + */ + ABSENT, + /* + * Card is inserted in the device + */ + PRESENT, + ERROR, + /* + * Card is present but not usable due to carrier restrictions + */ + RESTRICTED, +} diff --git a/radio/aidl/android/hardware/radio/CardStatus.aidl b/radio/aidl/android/hardware/radio/CardStatus.aidl new file mode 100644 index 0000000000..a8df53d81c --- /dev/null +++ b/radio/aidl/android/hardware/radio/CardStatus.aidl @@ -0,0 +1,71 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.AppStatus; +import android.hardware.radio.CardState; +import android.hardware.radio.PinState; + +@VintfStability +parcelable CardStatus { + CardState cardState; + /** + * Applicable to USIM and CSIM + */ + PinState universalPinState; + /** + * Value < RadioConst:CARD_MAX_APPS, -1 if none + */ + int gsmUmtsSubscriptionAppIndex; + /** + * Value < RadioConst:CARD_MAX_APPS, -1 if none + */ + int cdmaSubscriptionAppIndex; + /** + * Value < RadioConst:CARD_MAX_APPS, -1 if none + */ + int imsSubscriptionAppIndex; + /** + * size <= RadioConst::CARD_MAX_APPS + */ + AppStatus[] applications; + int physicalSlotId; + /** + * An Answer To Reset (ATR) is a message output by a Smart Card conforming to ISO/IEC 7816 + * standards, following electrical reset of the card's chip. The ATR conveys information about + * the communication parameters proposed by the card, and the card's nature and state. + * + * This data is applicable only when cardState is CardState:PRESENT. + */ + String atr; + /** + * Integrated Circuit Card IDentifier (ICCID) is Unique Identifier of the SIM CARD. File is + * located in the SIM card at EFiccid (0x2FE2) as per ETSI 102.221. The ICCID is defined by + * the ITU-T recommendation E.118 ISO/IEC 7816. + * + * This data is applicable only when cardState is CardState:PRESENT. + */ + String iccid; + /** + * The EID is the eUICC identifier. The EID shall be stored within the ECASD and can be + * retrieved by the Device at any time using the standard GlobalPlatform GET DATA command. + * + * This data is mandatory and applicable only when cardState is CardState:PRESENT and SIM card + * supports eUICC. + */ + String eid; +} diff --git a/radio/aidl/android/hardware/radio/Carrier.aidl b/radio/aidl/android/hardware/radio/Carrier.aidl new file mode 100644 index 0000000000..be619b941b --- /dev/null +++ b/radio/aidl/android/hardware/radio/Carrier.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CarrierMatchType; + +@VintfStability +parcelable Carrier { + String mcc; + String mnc; + /** + * Specify match type for the carrier. If it’s ALL, matchData is empty string; otherwise, + * matchData is the value for the match type. + */ + CarrierMatchType matchType; + String matchData; +} diff --git a/radio/aidl/android/hardware/radio/CarrierMatchType.aidl b/radio/aidl/android/hardware/radio/CarrierMatchType.aidl new file mode 100644 index 0000000000..39b9466d69 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CarrierMatchType.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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CarrierMatchType { + /** + * Apply to all carrier with the same mcc/mnc + */ + ALL, + /** + * Use SPN and mcc/mnc to identify the carrier + */ + SPN, + /** + * Use IMSI prefix and mcc/mnc to identify the carrier + */ + IMSI_PREFIX, + /** + * Use GID1 and mcc/mnc to identify the carrier + */ + GID1, + /** + * Use GID2 and mcc/mnc to identify the carrier + */ + GID2, +} diff --git a/radio/aidl/android/hardware/radio/CarrierRestrictions.aidl b/radio/aidl/android/hardware/radio/CarrierRestrictions.aidl new file mode 100644 index 0000000000..70df637f6e --- /dev/null +++ b/radio/aidl/android/hardware/radio/CarrierRestrictions.aidl @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.Carrier; + +@VintfStability +parcelable CarrierRestrictions { + /** + * Allowed carriers + */ + 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. + */ + Carrier[] excludedCarriers; +} diff --git a/radio/aidl/android/hardware/radio/CarrierRestrictionsWithPriority.aidl b/radio/aidl/android/hardware/radio/CarrierRestrictionsWithPriority.aidl new file mode 100644 index 0000000000..057b016415 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CarrierRestrictionsWithPriority.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.Carrier; + +@VintfStability +parcelable CarrierRestrictionsWithPriority { + /** + * List of allowed carriers. + * The character '?' is used as wildcard character to match any value. + */ + Carrier[] allowedCarriers; + /** + * List of excluded carriers. + * The character '?' is used as wildcard character to match any value. + */ + Carrier[] excludedCarriers; + /** + * True means that only carriers included in the allowed list and not in the excluded list + * are permitted. 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. + * False means that all carriers are allowed except those included in the excluded list + * and not in the allowed list. + */ + boolean allowedCarriersPrioritized; +} diff --git a/radio/aidl/android/hardware/radio/CdmaBroadcastSmsConfigInfo.aidl b/radio/aidl/android/hardware/radio/CdmaBroadcastSmsConfigInfo.aidl new file mode 100644 index 0000000000..46f634558c --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaBroadcastSmsConfigInfo.aidl @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable CdmaBroadcastSmsConfigInfo { + /** + * Defines a broadcast message identifier whose value is 0x0000 - 0xFFFF as defined in + * C.R1001G 9.3.1 and 9.3.2. + */ + int serviceCategory; + /** + * Language code of broadcast message whose value is 0x00 - 0x07 as defined in C.R1001G 9.2. + */ + int language; + /** + * Selected false means message types specified in serviceCategory are not accepted, + * while true means accepted. + */ + boolean selected; +} diff --git a/radio/aidl/android/hardware/radio/CdmaCallWaiting.aidl b/radio/aidl/android/hardware/radio/CdmaCallWaiting.aidl new file mode 100644 index 0000000000..3db6ee003b --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaCallWaiting.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CdmaCallWaitingNumberPlan; +import android.hardware.radio.CdmaCallWaitingNumberPresentation; +import android.hardware.radio.CdmaCallWaitingNumberType; +import android.hardware.radio.CdmaSignalInfoRecord; + +@VintfStability +parcelable CdmaCallWaiting { + /** + * Remote party number + */ + String number; + CdmaCallWaitingNumberPresentation numberPresentation; + /** + * Remote party name + */ + String name; + CdmaSignalInfoRecord signalInfoRecord; + /** + * Required to support International Call Waiting + */ + CdmaCallWaitingNumberType numberType; + /** + * Required to support International Call Waiting + */ + CdmaCallWaitingNumberPlan numberPlan; +} diff --git a/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl b/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl new file mode 100644 index 0000000000..76d2197060 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CdmaCallWaitingNumberPlan { + UNKNOWN = 0, + ISDN = 1, + DATA = 3, + TELEX = 4, + NATIONAL = 8, + PRIVATE = 9, +} diff --git a/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl b/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl new file mode 100644 index 0000000000..f9fca965d9 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CdmaCallWaitingNumberPresentation { + ALLOWED, + RESTRICTED, + UNKNOWN, +} diff --git a/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberType.aidl b/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberType.aidl new file mode 100644 index 0000000000..9c5b8ed9ac --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberType.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CdmaCallWaitingNumberType { + UNKNOWN, + INTERNATIONAL, + NATIONAL, + NETWORK_SPECIFIC, + SUBSCRIBER, +} diff --git a/radio/aidl/android/hardware/radio/CdmaDisplayInfoRecord.aidl b/radio/aidl/android/hardware/radio/CdmaDisplayInfoRecord.aidl new file mode 100644 index 0000000000..9b11f37c6d --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaDisplayInfoRecord.aidl @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Display Info Rec as defined in C.S0005 section 3.7.5.1. Extended Display Info Rec as defined in + * C.S0005 section 3.7.5.16. Note that the Extended Display info rec contains multiple records of + * 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. + */ +@VintfStability +parcelable CdmaDisplayInfoRecord { + /** + * Max length = RadioConst:CDMA_ALPHA_INFO_BUFFER_LENGTH + */ + String alphaBuf; +} diff --git a/radio/aidl/android/hardware/radio/CdmaInfoRecName.aidl b/radio/aidl/android/hardware/radio/CdmaInfoRecName.aidl new file mode 100644 index 0000000000..63ec699a57 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaInfoRecName.aidl @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Names of the CDMA info records (C.S0005 section 3.7.5) + */ +@VintfStability +@Backing(type="int") +enum CdmaInfoRecName { + DISPLAY, + CALLED_PARTY_NUMBER, + CALLING_PARTY_NUMBER, + CONNECTED_NUMBER, + SIGNAL, + REDIRECTING_NUMBER, + LINE_CONTROL, + EXTENDED_DISPLAY, + T53_CLIR, + T53_RELEASE, + T53_AUDIO_CONTROL, +} diff --git a/radio/aidl/android/hardware/radio/CdmaInformationRecord.aidl b/radio/aidl/android/hardware/radio/CdmaInformationRecord.aidl new file mode 100644 index 0000000000..7d9cb0ac13 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaInformationRecord.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CdmaDisplayInfoRecord; +import android.hardware.radio.CdmaInfoRecName; +import android.hardware.radio.CdmaLineControlInfoRecord; +import android.hardware.radio.CdmaNumberInfoRecord; +import android.hardware.radio.CdmaRedirectingNumberInfoRecord; +import android.hardware.radio.CdmaSignalInfoRecord; +import android.hardware.radio.CdmaT53AudioControlInfoRecord; +import android.hardware.radio.CdmaT53ClirInfoRecord; + +@VintfStability +parcelable CdmaInformationRecord { + /** + * Based on CdmaInfoRecName, only one of the below vectors must have size = 1. + * All other vectors must have size 0. + */ + CdmaInfoRecName name; + /** + * Display and extended display info rec + */ + CdmaDisplayInfoRecord[] display; + /** + * Called party number, calling party number, connected number info rec + */ + CdmaNumberInfoRecord[] number; + /** + * Signal info rec + */ + CdmaSignalInfoRecord[] signal; + /** + * Redirecting number info rec + */ + CdmaRedirectingNumberInfoRecord[] redir; + /** + * Line control info rec + */ + CdmaLineControlInfoRecord[] lineCtrl; + /** + * T53 CLIR info rec + */ + CdmaT53ClirInfoRecord[] clir; + /** + * T53 Audio Control info rec + */ + CdmaT53AudioControlInfoRecord[] audioCtrl; +} diff --git a/radio/aidl/android/hardware/radio/CdmaInformationRecords.aidl b/radio/aidl/android/hardware/radio/CdmaInformationRecords.aidl new file mode 100644 index 0000000000..dcf0ed20ac --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaInformationRecords.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CdmaInformationRecord; + +@VintfStability +parcelable CdmaInformationRecords { + /** + * Max length = RadioConst:CDMA_MAX_NUMBER_OF_INFO_RECS + */ + CdmaInformationRecord[] infoRec; +} diff --git a/radio/aidl/android/hardware/radio/CdmaLineControlInfoRecord.aidl b/radio/aidl/android/hardware/radio/CdmaLineControlInfoRecord.aidl new file mode 100644 index 0000000000..a6178afd52 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaLineControlInfoRecord.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Line Control Information Record as defined in C.S0005 section 3.7.5.15 + */ +@VintfStability +parcelable CdmaLineControlInfoRecord { + byte lineCtrlPolarityIncluded; + byte lineCtrlToggle; + byte lineCtrlReverse; + byte lineCtrlPowerDenial; +} diff --git a/radio/aidl/android/hardware/radio/CdmaNumberInfoRecord.aidl b/radio/aidl/android/hardware/radio/CdmaNumberInfoRecord.aidl new file mode 100644 index 0000000000..06e8317bd0 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaNumberInfoRecord.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * 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 + */ +@VintfStability +parcelable CdmaNumberInfoRecord { + /** + * Max length = RADIO_CDMA_NUMBER_INFO_BUFFER_LENGTH + */ + String number; + byte numberType; + byte numberPlan; + byte pi; + byte si; +} diff --git a/radio/aidl/android/hardware/radio/CdmaOtaProvisionStatus.aidl b/radio/aidl/android/hardware/radio/CdmaOtaProvisionStatus.aidl new file mode 100644 index 0000000000..0cb43141f6 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaOtaProvisionStatus.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CdmaOtaProvisionStatus { + SPL_UNLOCKED, + SPC_RETRIES_EXCEEDED, + A_KEY_EXCHANGED, + SSD_UPDATED, + NAM_DOWNLOADED, + MDN_DOWNLOADED, + IMSI_DOWNLOADED, + PRL_DOWNLOADED, + COMMITTED, + OTAPA_STARTED, + OTAPA_STOPPED, + OTAPA_ABORTED, +} diff --git a/radio/aidl/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl b/radio/aidl/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl new file mode 100644 index 0000000000..d15621a5b5 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CdmaNumberInfoRecord; +import android.hardware.radio.CdmaRedirectingReason; + +@VintfStability +parcelable CdmaRedirectingNumberInfoRecord { + CdmaNumberInfoRecord redirectingNumber; + /** + * Set to UNKNOWN if not included. + */ + CdmaRedirectingReason redirectingReason; +} diff --git a/radio/aidl/android/hardware/radio/CdmaRedirectingReason.aidl b/radio/aidl/android/hardware/radio/CdmaRedirectingReason.aidl new file mode 100644 index 0000000000..c86b9b2265 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaRedirectingReason.aidl @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 + */ +@VintfStability +@Backing(type="int") +enum CdmaRedirectingReason { + UNKNOWN = 0, + CALL_FORWARDING_BUSY = 1, + CALL_FORWARDING_NO_REPLY = 2, + CALLED_DTE_OUT_OF_ORDER = 9, + CALL_FORWARDING_BY_THE_CALLED_DTE = 10, + CALL_FORWARDING_UNCONDITIONAL = 15, + RESERVED, +} diff --git a/radio/aidl/android/hardware/radio/CdmaRoamingType.aidl b/radio/aidl/android/hardware/radio/CdmaRoamingType.aidl new file mode 100644 index 0000000000..df09e0337c --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaRoamingType.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CdmaRoamingType { + HOME_NETWORK, + AFFILIATED_ROAM, + ANY_ROAM, +} diff --git a/radio/aidl/android/hardware/radio/CdmaSignalInfoRecord.aidl b/radio/aidl/android/hardware/radio/CdmaSignalInfoRecord.aidl new file mode 100644 index 0000000000..36ecb1813d --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSignalInfoRecord.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. + */ + +package android.hardware.radio; + +/** + * CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 + */ +@VintfStability +parcelable CdmaSignalInfoRecord { + /** + * True if signal information record is present + */ + boolean isPresent; + /** + * Defined in 3.7.5.5-1 + */ + byte signalType; + /** + * Defined in 3.7.5.5-2 + */ + byte alertPitch; + /** + * Defined in 3.7.5.5-3, 3.7.5.5-4 or 3.7.5.5-5 + */ + byte signal; +} diff --git a/radio/aidl/android/hardware/radio/CdmaSignalStrength.aidl b/radio/aidl/android/hardware/radio/CdmaSignalStrength.aidl new file mode 100644 index 0000000000..e6c2fb5e2f --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSignalStrength.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable CdmaSignalStrength { + /** + * This value is the actual RSSI value multiplied by -1. Example: If the actual RSSI is -75, + * then this response value will be 75. INT_MAX means invalid/unreported. + */ + int dbm; + /** + * This value is the actual Ec/Io multiplied by -10. Example: If the actual Ec/Io is -12.5 dB, + * then this response value will be 125. INT_MAX means invalid/unreported. + */ + int ecio; +} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsAck.aidl b/radio/aidl/android/hardware/radio/CdmaSmsAck.aidl new file mode 100644 index 0000000000..b412b704d5 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSmsAck.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CdmaSmsErrorClass; + +@VintfStability +parcelable CdmaSmsAck { + CdmaSmsErrorClass errorClass; + /** + * SMS cause code as defined in N.S00005, 6.5.2.125. + * Currently, only 35 (resource shortage) and 39 (other terminal problem) are reported. + */ + int smsCauseCode; +} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsAddress.aidl b/radio/aidl/android/hardware/radio/CdmaSmsAddress.aidl new file mode 100644 index 0000000000..83e883925e --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSmsAddress.aidl @@ -0,0 +1,53 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CdmaSmsDigitMode; +import android.hardware.radio.CdmaSmsNumberMode; +import android.hardware.radio.CdmaSmsNumberPlan; +import android.hardware.radio.CdmaSmsNumberType; + +@VintfStability +parcelable CdmaSmsAddress { + /** + * CdmaSmsDigitMode is of two types : 4 bit and 8 bit. + * For 4-bit type, only "digits" field defined below in this struct is used. + */ + CdmaSmsDigitMode digitMode; + /** + * Used only when digitMode is 8-bit. + */ + CdmaSmsNumberMode numberMode; + /** + * Used only when digitMode is 8-bit. To specify an international address, use the following: + * digitMode = CdmaSmsDigitMode:EIGHT_BIT: + * numberMode = CdmaSmsNumberMode:NOT_DATA_NETWORK + * numberType = CdmaSmsNumberType:INTERNATIONAL_OR_DATA_IP + * numberPlan = CdmaSmsNumberPlan:TELEPHONY + * numberOfDigits = number of digits + * digits = ASCII digits, e.g. '1', '2', '3', '4', and '5' + */ + CdmaSmsNumberType numberType; + /** + * Used only when digitMode is 8-bit. + */ + CdmaSmsNumberPlan numberPlan; + /** + * Each byte in this array represents a 4 bit or 8-bit digit of address data. + */ + byte[] digits; +} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsDigitMode.aidl b/radio/aidl/android/hardware/radio/CdmaSmsDigitMode.aidl new file mode 100644 index 0000000000..662311dd06 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSmsDigitMode.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CdmaSmsDigitMode { + /** + * DTMF digits + */ + FOUR_BIT, + EIGHT_BIT, +} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsErrorClass.aidl b/radio/aidl/android/hardware/radio/CdmaSmsErrorClass.aidl new file mode 100644 index 0000000000..ec8c74edcc --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSmsErrorClass.aidl @@ -0,0 +1,24 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CdmaSmsErrorClass { + NO_ERROR, + ERROR, +} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsMessage.aidl b/radio/aidl/android/hardware/radio/CdmaSmsMessage.aidl new file mode 100644 index 0000000000..f38cc5b5ea --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSmsMessage.aidl @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CdmaSmsAddress; +import android.hardware.radio.CdmaSmsSubaddress; + +@VintfStability +parcelable CdmaSmsMessage { + int teleserviceId; + boolean isServicePresent; + int serviceCategory; + CdmaSmsAddress address; + CdmaSmsSubaddress subAddress; + /** + * 3GPP2 C.S0015-B, v2.0 + */ + byte[] bearerData; +} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsNumberMode.aidl b/radio/aidl/android/hardware/radio/CdmaSmsNumberMode.aidl new file mode 100644 index 0000000000..e1e96dd9f2 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSmsNumberMode.aidl @@ -0,0 +1,24 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CdmaSmsNumberMode { + NOT_DATA_NETWORK, + DATA_NETWORK, +} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsNumberPlan.aidl b/radio/aidl/android/hardware/radio/CdmaSmsNumberPlan.aidl new file mode 100644 index 0000000000..23dea9be9d --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSmsNumberPlan.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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CdmaSmsNumberPlan { + UNKNOWN, + /** + * CCITT E.164 and E.163, including ISDN plan + */ + TELEPHONY, + RESERVED_2, + /** + * CCITT X.121 + */ + DATA, + /** + * CCITT F.69 + */ + TELEX, + RESERVED_5, + RESERVED_6, + RESERVED_7, + RESERVED_8, + PRIVATE, + RESERVED_10, + RESERVED_11, + RESERVED_12, + RESERVED_13, + RESERVED_14, + RESERVED_15, +} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsNumberType.aidl b/radio/aidl/android/hardware/radio/CdmaSmsNumberType.aidl new file mode 100644 index 0000000000..e439d1fe7b --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSmsNumberType.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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CdmaSmsNumberType { + UNKNOWN, + /** + * INTERNATIONAL is used when number mode is not data network address. DATA_IP is used when the + * number mode is data network address. + */ + INTERNATIONAL_OR_DATA_IP, + /** + * NATIONAL is used when the number mode is not data netework address. INTERNET_MAIL is used + * when the number mode is data network address. For INTERNET_MAIL, in the address data + * "digits", each byte contains an ASCII character. Examples are: "x@y.com,a@b.com" + * Ref TIA/EIA-637A 3.4.3.3 + */ + NATIONAL_OR_INTERNET_MAIL, + NETWORK, + SUBSCRIBER, + /** + * GSM SMS: address value is GSM 7-bit chars + */ + ALPHANUMERIC, + ABBREVIATED, + RESERVED_7, +} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsSubaddress.aidl b/radio/aidl/android/hardware/radio/CdmaSmsSubaddress.aidl new file mode 100644 index 0000000000..4a84c792be --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSmsSubaddress.aidl @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CdmaSmsSubaddressType; + +@VintfStability +parcelable CdmaSmsSubaddress { + CdmaSmsSubaddressType subaddressType; + /** + * True means the last byte's lower 4 bits must be ignored + */ + boolean odd; + /** + * Each byte represents an 8-bit digit of subaddress data + */ + byte[] digits; +} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsSubaddressType.aidl b/radio/aidl/android/hardware/radio/CdmaSmsSubaddressType.aidl new file mode 100644 index 0000000000..60aa37bd8a --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSmsSubaddressType.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CdmaSmsSubaddressType { + /** + * CCITT X.213 or ISO 8348 AD2 + */ + NSAP, + /** + * e.g. X.25 + */ + USER_SPECIFIED, +} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsWriteArgs.aidl b/radio/aidl/android/hardware/radio/CdmaSmsWriteArgs.aidl new file mode 100644 index 0000000000..f613e392b6 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSmsWriteArgs.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CdmaSmsMessage; +import android.hardware.radio.CdmaSmsWriteArgsStatus; + +@VintfStability +parcelable CdmaSmsWriteArgs { + /** + * Status of message. See TS 27.005 3.1 + */ + CdmaSmsWriteArgsStatus status; + CdmaSmsMessage message; +} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl b/radio/aidl/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl new file mode 100644 index 0000000000..009e8a913f --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CdmaSmsWriteArgsStatus { + REC_UNREAD, + REC_READ, + STO_UNSENT, + STO_SENT, +} diff --git a/radio/aidl/android/hardware/radio/CdmaSubscriptionSource.aidl b/radio/aidl/android/hardware/radio/CdmaSubscriptionSource.aidl new file mode 100644 index 0000000000..b83e81a227 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaSubscriptionSource.aidl @@ -0,0 +1,24 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CdmaSubscriptionSource { + RUIM_SIM, + NV, +} diff --git a/radio/aidl/android/hardware/radio/CdmaT53AudioControlInfoRecord.aidl b/radio/aidl/android/hardware/radio/CdmaT53AudioControlInfoRecord.aidl new file mode 100644 index 0000000000..715a2f7b2c --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaT53AudioControlInfoRecord.aidl @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * T53 Audio Control Information Record + */ +@VintfStability +parcelable CdmaT53AudioControlInfoRecord { + byte upLink; + byte downLink; +} diff --git a/radio/aidl/android/hardware/radio/CdmaT53ClirInfoRecord.aidl b/radio/aidl/android/hardware/radio/CdmaT53ClirInfoRecord.aidl new file mode 100644 index 0000000000..636d40c48a --- /dev/null +++ b/radio/aidl/android/hardware/radio/CdmaT53ClirInfoRecord.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * T53 CLIR Information Record + */ +@VintfStability +parcelable CdmaT53ClirInfoRecord { + byte cause; +} diff --git a/radio/aidl/android/hardware/radio/CellConfigLte.aidl b/radio/aidl/android/hardware/radio/CellConfigLte.aidl new file mode 100644 index 0000000000..56a1a10c1d --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellConfigLte.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Contains the configuration of the LTE cell tower. + */ +@VintfStability +parcelable CellConfigLte { + /** + * Indicates that if E-UTRA-NR Dual Connectivity (EN-DC) is supported by the LTE cell. + * True if the plmn-InfoList-r15 is present in SIB2 and at least one bit in this list is true, + * otherwise this value should be false. + * Reference: 3GPP TS 36.331 v15.2.2 6.3.1 System information blocks. + */ + boolean isEndcAvailable; +} diff --git a/radio/aidl/android/hardware/radio/CellConnectionStatus.aidl b/radio/aidl/android/hardware/radio/CellConnectionStatus.aidl new file mode 100644 index 0000000000..faa9b28635 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellConnectionStatus.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CellConnectionStatus { + /** + * Cell is not a serving cell. + */ + NONE, + /** + * UE has connection to cell for signalling and possibly data (3GPP 36.331, 25.331). + */ + PRIMARY_SERVING, + /** + * UE has connection to cell for data (3GPP 36.331, 25.331). + */ + SECONDARY_SERVING, +} diff --git a/radio/aidl/android/hardware/radio/CellIdentity.aidl b/radio/aidl/android/hardware/radio/CellIdentity.aidl new file mode 100644 index 0000000000..abfcc9d11f --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellIdentity.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentityCdma; +import android.hardware.radio.CellIdentityGsm; +import android.hardware.radio.CellIdentityLte; +import android.hardware.radio.CellIdentityNr; +import android.hardware.radio.CellIdentityTdscdma; +import android.hardware.radio.CellIdentityWcdma; + +/** + * A union representing the CellIdentity of a single cell. + */ +@VintfStability +union CellIdentity { + boolean noinit; + CellIdentityGsm gsm; + CellIdentityWcdma wcdma; + CellIdentityTdscdma tdscdma; + CellIdentityCdma cdma; + CellIdentityLte lte; + CellIdentityNr nr; +} diff --git a/radio/aidl/android/hardware/radio/CellIdentityCdma.aidl b/radio/aidl/android/hardware/radio/CellIdentityCdma.aidl new file mode 100644 index 0000000000..56867e982b --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellIdentityCdma.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentityOperatorNames; + +@VintfStability +parcelable CellIdentityCdma { + /** + * Network Id 0..65535, INT_MAX if unknown + */ + int networkId; + /** + * CDMA System Id 0..32767, INT_MAX if unknown + */ + int systemId; + /** + * Base Station Id 0..65535, INT_MAX if unknown + */ + int baseStationId; + /** + * Longitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0. It is represented in + * units of 0.25 seconds and ranges from -2592000 to 2592000, both values inclusive + * (corresponding to a range of -180 to +180 degrees). INT_MAX if unknown + */ + int longitude; + /** + * Latitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0. It is represented in + * units of 0.25 seconds and ranges from -1296000 to 1296000, both values inclusive + * (corresponding to a range of -90 to +90 degrees). INT_MAX if unknown + */ + int latitude; + CellIdentityOperatorNames operatorNames; +} diff --git a/radio/aidl/android/hardware/radio/CellIdentityGsm.aidl b/radio/aidl/android/hardware/radio/CellIdentityGsm.aidl new file mode 100644 index 0000000000..f1c5042fe8 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellIdentityGsm.aidl @@ -0,0 +1,52 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentityOperatorNames; + +@VintfStability +parcelable CellIdentityGsm { + /** + * 3-digit Mobile Country Code, 0..999, empty string if unknown + */ + String mcc; + /** + * 2 or 3-digit Mobile Network Code, 0..999, empty string if unknown + */ + String mnc; + /** + * 16-bit Location Area Code, 0..65535, INT_MAX if unknown + */ + int lac; + /** + * 16-bit GSM Cell Identity described in TS 27.007, 0..65535, INT_MAX if unknown + */ + int cid; + /** + * 16-bit GSM Absolute RF channel number; this value must be valid + */ + int arfcn; + /** + * 6-bit Base Station Identity Code, 0xFF if unknown + */ + byte bsic; + CellIdentityOperatorNames operatorNames; + /** + * Additional PLMN-IDs beyond the primary PLMN broadcast for this cell + */ + String[] additionalPlmns; +} diff --git a/radio/aidl/android/hardware/radio/CellIdentityLte.aidl b/radio/aidl/android/hardware/radio/CellIdentityLte.aidl new file mode 100644 index 0000000000..f7f8fef663 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellIdentityLte.aidl @@ -0,0 +1,66 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentityOperatorNames; +import android.hardware.radio.EutranBands; +import android.hardware.radio.OptionalCsgInfo; + +@VintfStability +parcelable CellIdentityLte { + /** + * 3-digit Mobile Country Code, 0..999, empty string if unknown + */ + String mcc; + /** + * 2 or 3-digit Mobile Network Code, 0..999, empty string if unknown + */ + String mnc; + /** + * 28-bit Cell Identity described in TS TS 27.007, INT_MAX if unknown + */ + int ci; + /** + * Physical cell id 0..503; this value must be valid + */ + int pci; + /** + * 16-bit tracking area code, INT_MAX if unknown + */ + int tac; + /** + * 18-bit LTE Absolute RF Channel Number; this value must be valid + */ + int earfcn; + CellIdentityOperatorNames operatorNames; + /** + * Cell bandwidth, in kHz. + */ + int bandwidth; + /** + * Additional PLMN-IDs beyond the primary PLMN broadcast for this cell + */ + String[] additionalPlmns; + /** + * Information about any closed subscriber group ID for this cell + */ + OptionalCsgInfo optionalCsgInfo; + /** + * Bands used by the cell. + */ + EutranBands[] bands; +} diff --git a/radio/aidl/android/hardware/radio/CellIdentityNr.aidl b/radio/aidl/android/hardware/radio/CellIdentityNr.aidl new file mode 100644 index 0000000000..6879c63faa --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellIdentityNr.aidl @@ -0,0 +1,67 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentityOperatorNames; +import android.hardware.radio.NgranBands; + +/** + * 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. + */ +@VintfStability +parcelable CellIdentityNr { + /** + * 3-digit Mobile Country Code, in range[0, 999]; This value must be valid for registered or + * camped cells; INT_MAX means invalid/unreported. + */ + String mcc; + /** + * 2 or 3-digit Mobile Network Code, in range [0, 999], This value must be valid for + * registered or camped cells; INT_MAX means invalid/unreported. + */ + String mnc; + /** + * NR Cell Identity in range [0, 68719476735] (36 bits) described in 3GPP TS 38.331, which + * unambiguously identifies a cell within a PLMN. This value must be valid for registered or + * camped cells; LONG_MAX (2^63-1) means invalid/unreported. + */ + long nci; + /** + * Physical cell id in range [0, 1007] described in 3GPP TS 38.331. This value must be valid. + */ + int pci; + /** + * 16-bit tracking area code, INT_MAX means invalid/unreported. + */ + int tac; + /** + * NR Absolute Radio Frequency Channel Number, in range [0, 3279165]. + * Reference: 3GPP TS 38.101-1 and 3GPP TS 38.101-2 section 5.4.2.1. + * This value must be valid. + */ + int nrarfcn; + CellIdentityOperatorNames operatorNames; + /** + * Additional PLMN-IDs beyond the primary PLMN broadcast for this cell + */ + String[] additionalPlmns; + /** + * Bands used by the cell. + */ + NgranBands[] bands; +} diff --git a/radio/aidl/android/hardware/radio/CellIdentityOperatorNames.aidl b/radio/aidl/android/hardware/radio/CellIdentityOperatorNames.aidl new file mode 100644 index 0000000000..dea9929f73 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellIdentityOperatorNames.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable CellIdentityOperatorNames { + /** + * Long alpha operator name string or enhanced operator name string. + */ + String alphaLong; + /** + * Short alpha operator name string or enhanced operator name string. + */ + String alphaShort; +} diff --git a/radio/aidl/android/hardware/radio/CellIdentityTdscdma.aidl b/radio/aidl/android/hardware/radio/CellIdentityTdscdma.aidl new file mode 100644 index 0000000000..8268bba14a --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellIdentityTdscdma.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentityOperatorNames; +import android.hardware.radio.OptionalCsgInfo; + +@VintfStability +parcelable CellIdentityTdscdma { + /** + * 3-digit Mobile Country Code, 0..999, empty string if unknown. + */ + String mcc; + /** + * 2 or 3-digit Mobile Network Code, 0..999, empty string if unknown. + */ + String mnc; + /** + * 16-bit Location Area Code, 0..65535, INT_MAX if unknown. + */ + int lac; + /** + * 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown. + */ + int cid; + /** + * 8-bit Cell Parameters ID described in TS 25.331, 0..127, INT_MAX if unknown. + */ + int cpid; + /** + * 16-bit UMTS Absolute RF Channel Number defined in TS 25.102 5.4.4; this value must be valid. + */ + int uarfcn; + CellIdentityOperatorNames operatorNames; + /** + * Additional PLMN-IDs beyond the primary PLMN broadcast for this cell. + */ + String[] additionalPlmns; + /** + * Information about any closed subscriber group ID for this cell. + */ + OptionalCsgInfo optionalCsgInfo; +} diff --git a/radio/aidl/android/hardware/radio/CellIdentityWcdma.aidl b/radio/aidl/android/hardware/radio/CellIdentityWcdma.aidl new file mode 100644 index 0000000000..667c15b65c --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellIdentityWcdma.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentityOperatorNames; +import android.hardware.radio.OptionalCsgInfo; + +@VintfStability +parcelable CellIdentityWcdma { + /** + * 3-digit Mobile Country Code, 0..999, empty string if unknown. + */ + String mcc; + /** + * 2 or 3-digit Mobile Network Code, 0..999, empty string if unknown. + */ + String mnc; + /** + * 16-bit Location Area Code, 0..65535, INT_MAX if unknown. + */ + int lac; + /** + * 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown. + */ + int cid; + /** + * 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511; this value must be valid. + */ + int psc; + /** + * 16-bit UMTS Absolute RF Channel Number; this value must be valid. + */ + int uarfcn; + CellIdentityOperatorNames operatorNames; + /** + * Additional PLMN-IDs beyond the primary PLMN broadcast for this cell. + */ + String[] additionalPlmns; + /** + * Information about any closed subscriber group ID for this cell. + */ + OptionalCsgInfo optionalCsgInfo; +} diff --git a/radio/aidl/android/hardware/radio/CellInfo.aidl b/radio/aidl/android/hardware/radio/CellInfo.aidl new file mode 100644 index 0000000000..fe4f330611 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellInfo.aidl @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellConnectionStatus; +import android.hardware.radio.CellInfoCellInfoRatSpecificInfo; + +@VintfStability +parcelable CellInfo { + /** + * True if this cell is registered false if not registered. + */ + boolean registered; + /** + * Connection status for the cell. + */ + CellConnectionStatus connectionStatus; + CellInfoCellInfoRatSpecificInfo ratSpecificInfo; +} diff --git a/radio/aidl/android/hardware/radio/CellInfoCdma.aidl b/radio/aidl/android/hardware/radio/CellInfoCdma.aidl new file mode 100644 index 0000000000..27a35d1247 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellInfoCdma.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CdmaSignalStrength; +import android.hardware.radio.CellIdentityCdma; +import android.hardware.radio.EvdoSignalStrength; + +@VintfStability +parcelable CellInfoCdma { + CellIdentityCdma cellIdentityCdma; + CdmaSignalStrength signalStrengthCdma; + EvdoSignalStrength signalStrengthEvdo; +} diff --git a/radio/aidl/android/hardware/radio/CellInfoCellInfoRatSpecificInfo.aidl b/radio/aidl/android/hardware/radio/CellInfoCellInfoRatSpecificInfo.aidl new file mode 100644 index 0000000000..cdd33863de --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellInfoCellInfoRatSpecificInfo.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellInfoCdma; +import android.hardware.radio.CellInfoGsm; +import android.hardware.radio.CellInfoLte; +import android.hardware.radio.CellInfoNr; +import android.hardware.radio.CellInfoTdscdma; +import android.hardware.radio.CellInfoWcdma; + +@VintfStability +union CellInfoCellInfoRatSpecificInfo { + /** + * 3gpp CellInfo types. + */ + CellInfoGsm gsm; + CellInfoWcdma wcdma; + CellInfoTdscdma tdscdma; + CellInfoLte lte; + CellInfoNr nr; + /** + * 3gpp2 CellInfo types; + */ + CellInfoCdma cdma; +} diff --git a/radio/aidl/android/hardware/radio/CellInfoGsm.aidl b/radio/aidl/android/hardware/radio/CellInfoGsm.aidl new file mode 100644 index 0000000000..16ba8574ef --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellInfoGsm.aidl @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentityGsm; +import android.hardware.radio.GsmSignalStrength; + +@VintfStability +parcelable CellInfoGsm { + CellIdentityGsm cellIdentityGsm; + GsmSignalStrength signalStrengthGsm; +} diff --git a/radio/aidl/android/hardware/radio/CellInfoInfo.aidl b/radio/aidl/android/hardware/radio/CellInfoInfo.aidl new file mode 100644 index 0000000000..4d5e12d4cd --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellInfoInfo.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellInfoCdma; +import android.hardware.radio.CellInfoGsm; +import android.hardware.radio.CellInfoLte; +import android.hardware.radio.CellInfoNr; +import android.hardware.radio.CellInfoTdscdma; +import android.hardware.radio.CellInfoWcdma; + +@VintfStability +union CellInfoInfo { + CellInfoGsm gsm; + CellInfoCdma cdma; + CellInfoWcdma wcdma; + CellInfoTdscdma tdscdma; + CellInfoLte lte; + CellInfoNr nr; +} diff --git a/radio/aidl/android/hardware/radio/CellInfoLte.aidl b/radio/aidl/android/hardware/radio/CellInfoLte.aidl new file mode 100644 index 0000000000..d3389c1564 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellInfoLte.aidl @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentityLte; +import android.hardware.radio.LteSignalStrength; + +@VintfStability +parcelable CellInfoLte { + CellIdentityLte cellIdentityLte; + LteSignalStrength signalStrengthLte; +} diff --git a/radio/aidl/android/hardware/radio/CellInfoNr.aidl b/radio/aidl/android/hardware/radio/CellInfoNr.aidl new file mode 100644 index 0000000000..b1f311f113 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellInfoNr.aidl @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentityNr; +import android.hardware.radio.NrSignalStrength; + +@VintfStability +parcelable CellInfoNr { + CellIdentityNr cellIdentityNr; + NrSignalStrength signalStrengthNr; +} diff --git a/radio/aidl/android/hardware/radio/CellInfoTdscdma.aidl b/radio/aidl/android/hardware/radio/CellInfoTdscdma.aidl new file mode 100644 index 0000000000..b7d09bc07b --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellInfoTdscdma.aidl @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentityTdscdma; +import android.hardware.radio.TdscdmaSignalStrength; + +@VintfStability +parcelable CellInfoTdscdma { + CellIdentityTdscdma cellIdentityTdscdma; + TdscdmaSignalStrength signalStrengthTdscdma; +} diff --git a/radio/aidl/android/hardware/radio/CellInfoType.aidl b/radio/aidl/android/hardware/radio/CellInfoType.aidl new file mode 100644 index 0000000000..8e5e8c92d3 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellInfoType.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum CellInfoType { + NONE, + GSM, + CDMA, + LTE, + WCDMA, + TD_SCDMA, +} diff --git a/radio/aidl/android/hardware/radio/CellInfoWcdma.aidl b/radio/aidl/android/hardware/radio/CellInfoWcdma.aidl new file mode 100644 index 0000000000..03b086367a --- /dev/null +++ b/radio/aidl/android/hardware/radio/CellInfoWcdma.aidl @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentityWcdma; +import android.hardware.radio.WcdmaSignalStrength; + +@VintfStability +parcelable CellInfoWcdma { + CellIdentityWcdma cellIdentityWcdma; + WcdmaSignalStrength signalStrengthWcdma; +} diff --git a/radio/aidl/android/hardware/radio/CfData.aidl b/radio/aidl/android/hardware/radio/CfData.aidl new file mode 100644 index 0000000000..c6a91b9807 --- /dev/null +++ b/radio/aidl/android/hardware/radio/CfData.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CallForwardInfo; + +@VintfStability +parcelable CfData { + /** + * This is the response data for SS request to query call forward status. + * See getCallForwardStatus(). Max size = RadioConst:NUM_SERVICE_CLASSES. + */ + CallForwardInfo[] cfInfo; +} diff --git a/radio/aidl/android/hardware/radio/ClipStatus.aidl b/radio/aidl/android/hardware/radio/ClipStatus.aidl new file mode 100644 index 0000000000..c75c609092 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ClipStatus.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum ClipStatus { + /** + * CLIP provisioned + */ + CLIP_PROVISIONED, + /** + * CLIP not provisioned + */ + CLIP_UNPROVISIONED, + /** + * Unknown, e.g. no networks etc + */ + UNKNOWN, +} diff --git a/radio/aidl/android/hardware/radio/Clir.aidl b/radio/aidl/android/hardware/radio/Clir.aidl new file mode 100644 index 0000000000..a13ff9da3e --- /dev/null +++ b/radio/aidl/android/hardware/radio/Clir.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum Clir { + /** + * Use subscription default value + */ + DEFAULT, + /** + * Restrict CLI presentation + */ + INVOCATION, + /** + * Allow CLI presentation + */ + SUPPRESSION, +} diff --git a/radio/aidl/android/hardware/radio/ClosedSubscriberGroupInfo.aidl b/radio/aidl/android/hardware/radio/ClosedSubscriberGroupInfo.aidl new file mode 100644 index 0000000000..7c6fb7a5fe --- /dev/null +++ b/radio/aidl/android/hardware/radio/ClosedSubscriberGroupInfo.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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable ClosedSubscriberGroupInfo { + /** + * Indicates whether the cell is restricted to only CSG members. A cell not broadcasting the + * CSG Indication but reporting CSG information is considered a Hybrid Cell. + * Refer to the "csg-Indication" field in 3GPP TS 36.331 section 6.2.2 + * SystemInformationBlockType1. + * Also refer to "CSG Indicator" in 3GPP TS 25.331 section 10.2.48.8.1 and TS 25.304. + */ + boolean csgIndication; + /** + * The human-readable name of the closed subscriber group operating this cell. + * Refer to "hnb-Name" in TS 36.331 section 6.2.2 SystemInformationBlockType9. + * Also refer to "HNB Name" in 3GPP TS25.331 section 10.2.48.8.23 and TS 23.003 section 4.8. + */ + String homeNodebName; + /** + * The identity of the closed subscriber group that the cell belongs to. + * Refer to "CSG-Identity" in TS 36.336 section 6.3.4. + * Also refer to "CSG Identity" in 3GPP TS 25.331 section 10.3.2.8 and TS 23.003 section 4.7. + */ + int csgIdentity; +} diff --git a/radio/aidl/android/hardware/radio/DataCallFailCause.aidl b/radio/aidl/android/hardware/radio/DataCallFailCause.aidl new file mode 100644 index 0000000000..021988b221 --- /dev/null +++ b/radio/aidl/android/hardware/radio/DataCallFailCause.aidl @@ -0,0 +1,1303 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum DataCallFailCause { + /** + * An integer cause code defined in TS 24.008 section 6.1.3.1.3 or TS 24.301 Release 8+ Annex B. + * If the implementation does not have access to the exact cause codes, then it must return one + * of the following values, as the UI layer needs to distinguish these cases for error + * notification and potential retries. + */ + NONE = 0, + /** + * No retry + */ + OPERATOR_BARRED = 0x08, + /** + * PDP_FAIL_LLC_SNDCP = 0x19 + */ + NAS_SIGNALLING = 0x0E, + INSUFFICIENT_RESOURCES = 0x1A, + /** + * No retry + */ + MISSING_UNKNOWN_APN = 0x1B, + /** + * No retry + */ + UNKNOWN_PDP_ADDRESS_TYPE = 0x1C, + /** + * No retry + */ + USER_AUTHENTICATION = 0x1D, + /** + * No retry + */ + ACTIVATION_REJECT_GGSN = 0x1E, + ACTIVATION_REJECT_UNSPECIFIED = 0x1F, + /** + * No retry + */ + SERVICE_OPTION_NOT_SUPPORTED = 0x20, + /** + * No retry + */ + SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, + SERVICE_OPTION_OUT_OF_ORDER = 0x22, + /** + * No retry + */ + NSAPI_IN_USE = 0x23, + /** + * Possibly restart radio, based on framework config + */ + REGULAR_DEACTIVATION = 0x24, + QOS_NOT_ACCEPTED = 0x25, + NETWORK_FAILURE = 0x26, + UMTS_REACTIVATION_REQ = 0x27, + FEATURE_NOT_SUPP = 0x28, + TFT_SEMANTIC_ERROR = 0x29, + TFT_SYTAX_ERROR = 0x2A, + UNKNOWN_PDP_CONTEXT = 0x2B, + FILTER_SEMANTIC_ERROR = 0x2C, + FILTER_SYTAX_ERROR = 0x2D, + PDP_WITHOUT_ACTIVE_TFT = 0x2E, + /** + * No retry + */ + ONLY_IPV4_ALLOWED = 0x32, + /** + * No retry + */ + ONLY_IPV6_ALLOWED = 0x33, + ONLY_SINGLE_BEARER_ALLOWED = 0x34, + ESM_INFO_NOT_RECEIVED = 0x35, + PDN_CONN_DOES_NOT_EXIST = 0x36, + MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 0x37, + MAX_ACTIVE_PDP_CONTEXT_REACHED = 0x41, + UNSUPPORTED_APN_IN_CURRENT_PLMN = 0x42, + INVALID_TRANSACTION_ID = 0x51, + MESSAGE_INCORRECT_SEMANTIC = 0x5F, + INVALID_MANDATORY_INFO = 0x60, + MESSAGE_TYPE_UNSUPPORTED = 0x61, + MSG_TYPE_NONCOMPATIBLE_STATE = 0x62, + UNKNOWN_INFO_ELEMENT = 0x63, + CONDITIONAL_IE_ERROR = 0x64, + MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 0x65, + /** + * No retry + */ + PROTOCOL_ERRORS = 0x6F, + APN_TYPE_CONFLICT = 0x70, + INVALID_PCSCF_ADDR = 0x71, + INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 0x72, + EMM_ACCESS_BARRED = 0x73, + EMERGENCY_IFACE_ONLY = 0x74, + IFACE_MISMATCH = 0x75, + COMPANION_IFACE_IN_USE = 0x76, + IP_ADDRESS_MISMATCH = 0x77, + IFACE_AND_POL_FAMILY_MISMATCH = 0x78, + EMM_ACCESS_BARRED_INFINITE_RETRY = 0x79, + AUTH_FAILURE_ON_EMERGENCY_CALL = 0x7A, + OEM_DCFAILCAUSE_1 = 0x1001, + OEM_DCFAILCAUSE_2 = 0x1002, + OEM_DCFAILCAUSE_3 = 0x1003, + OEM_DCFAILCAUSE_4 = 0x1004, + OEM_DCFAILCAUSE_5 = 0x1005, + OEM_DCFAILCAUSE_6 = 0x1006, + OEM_DCFAILCAUSE_7 = 0x1007, + OEM_DCFAILCAUSE_8 = 0x1008, + OEM_DCFAILCAUSE_9 = 0x1009, + OEM_DCFAILCAUSE_10 = 0x100A, + OEM_DCFAILCAUSE_11 = 0x100B, + OEM_DCFAILCAUSE_12 = 0x100C, + OEM_DCFAILCAUSE_13 = 0x100D, + OEM_DCFAILCAUSE_14 = 0x100E, + OEM_DCFAILCAUSE_15 = 0x100F, + /** + * Not mentioned in the specification + */ + VOICE_REGISTRATION_FAIL = -1, + /** + * Not mentioned in the specification + */ + DATA_REGISTRATION_FAIL = -2, + /** + * Network/modem disonnect + */ + SIGNAL_LOST = -3, + /** + * Preferred technology has changed, must retry with parameters appropriate for new technology + */ + PREF_RADIO_TECH_CHANGED = -4, + /** + * Data call was disconnected because radio was resetting, powered off - no retry + */ + RADIO_POWER_OFF = -5, + /** + * Data call was disconnected by modem because tethered mode was up on same APN/data profile + * No retry until tethered call is off + */ + TETHERED_CALL_ACTIVE = -6, + ERROR_UNSPECIFIED = 0xffff, + /** + * Network cannot provide the requested service and PDP context is deactivated because of LLC + * or SNDCP failure. + */ + LLC_SNDCP = 0x19, + /** + * UE requested to modify QoS parameters or the bearer control mode, which is not compatible + * with the selected bearer control mode. + */ + ACTIVATION_REJECTED_BCM_VIOLATION = 0x30, + /** + * Network has already initiated the activation, modification, or deactivation of bearer + * resources that was requested by the UE. + */ + COLLISION_WITH_NETWORK_INITIATED_REQUEST = 0x38, + /** + * Network supports IPv4v6 PDP type only. Non-IP type is not allowed. In LTE mode of operation, + * this is a PDN throttling cause code, meaning the UE may throttle further requests to the + * same APN. + */ + ONLY_IPV4V6_ALLOWED = 0x39, + /** + * Network supports non-IP PDP type only. IPv4, IPv6 and IPv4v6 is not allowed. In LTE mode of + * operation, this is a PDN throttling cause code, meaning the UE can throttle further requests + * to the same APN. + */ + ONLY_NON_IP_ALLOWED = 0x3A, + /** + * QCI (QoS Class Identifier) indicated in the UE request cannot be supported. + */ + UNSUPPORTED_QCI_VALUE = 0x3B, + /** + * Procedure requested by the UE was rejected because the bearer handling is not supported. + */ + BEARER_HANDLING_NOT_SUPPORTED = 0x3C, + /** + * Not receiving a DNS address that was mandatory. + */ + INVALID_DNS_ADDR = 0x7B, + /** + * Not receiving either a PCSCF or a DNS address, one of them being mandatory. + */ + INVALID_PCSCF_OR_DNS_ADDRESS = 0x7C, + /** + * Emergency call bring up on a different ePDG. + */ + CALL_PREEMPT_BY_EMERGENCY_APN = 0x7F, + /** + * UE performs a detach or disconnect PDN action based on TE requirements. + */ + UE_INITIATED_DETACH_OR_DISCONNECT = 0x80, + /** + * Reason unspecified for foreign agent rejected MIP (Mobile IP) registration. + */ + MIP_FA_REASON_UNSPECIFIED = 0x7D0, + /** + * Foreign agent administratively prohibited MIP (Mobile IP) registration. + */ + MIP_FA_ADMIN_PROHIBITED = 0x7D1, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of insufficient resources. + */ + MIP_FA_INSUFFICIENT_RESOURCES = 0x7D2, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of MN-AAA authenticator was + * wrong. + */ + MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE = 0x7D3, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of home agent authentication + * failure. + */ + MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE = 0x7D4, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of requested lifetime was too + * long. + */ + MIP_FA_REQUESTED_LIFETIME_TOO_LONG = 0x7D5, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of malformed request. + */ + MIP_FA_MALFORMED_REQUEST = 0x7D6, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of malformed reply. + */ + MIP_FA_MALFORMED_REPLY = 0x7D7, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of requested encapsulation was + * unavailable. + */ + MIP_FA_ENCAPSULATION_UNAVAILABLE = 0x7D8, + /** + * Foreign agent rejected MIP (Mobile IP) registration of VJ Header Compression was unavailable. + */ + MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE = 0x7D9, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of reverse tunnel was + * unavailable. + */ + MIP_FA_REVERSE_TUNNEL_UNAVAILABLE = 0x7DA, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of reverse tunnel was mandatory + * but not requested by device. + */ + MIP_FA_REVERSE_TUNNEL_IS_MANDATORY = 0x7DB, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of delivery style was not + * supported. + */ + MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED = 0x7DC, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of missing NAI (Network Access + * Identifier). + */ + MIP_FA_MISSING_NAI = 0x7DD, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of missing Home Agent. + */ + MIP_FA_MISSING_HOME_AGENT = 0x7DE, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of missing Home Address. + */ + MIP_FA_MISSING_HOME_ADDRESS = 0x7DF, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of unknown challenge. + */ + MIP_FA_UNKNOWN_CHALLENGE = 0x7E0, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of missing challenge. + */ + MIP_FA_MISSING_CHALLENGE = 0x7E1, + /** + * Foreign agent rejected MIP (Mobile IP) registration because of stale challenge. + */ + MIP_FA_STALE_CHALLENGE = 0x7E2, + /** + * Reason unspecified for home agent rejected MIP (Mobile IP) registration. + */ + MIP_HA_REASON_UNSPECIFIED = 0x7E3, + /** + * Home agent administratively prohibited MIP (Mobile IP) registration. + */ + MIP_HA_ADMIN_PROHIBITED = 0x7E4, + /** + * Home agent rejected MIP (Mobile IP) registration because of insufficient resources. + */ + MIP_HA_INSUFFICIENT_RESOURCES = 0x7E5, + /** + * Home agent rejected MIP (Mobile IP) registration because of MN-HA authenticator was wrong. + */ + MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE = 0x7E6, + /** + * Home agent rejected MIP (Mobile IP) registration because of foreign agent authentication + * failure. + */ + MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE = 0x7E7, + /** + * Home agent rejected MIP (Mobile IP) registration because of registration id mismatch. + */ + MIP_HA_REGISTRATION_ID_MISMATCH = 0x7E8, + /** + * Home agent rejected MIP (Mobile IP) registration because of malformed request. + */ + MIP_HA_MALFORMED_REQUEST = 0x7E9, + /** + * Home agent rejected MIP (Mobile IP) registration because of unknown home agent address. + */ + MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS = 0x7EA, + /** + * Home agent rejected MIP (Mobile IP) registration because of reverse tunnel was unavailable. + */ + MIP_HA_REVERSE_TUNNEL_UNAVAILABLE = 0x7EB, + /** + * Home agent rejected MIP (Mobile IP) registration because of reverse tunnel is mandatory but + * not requested by device. + */ + MIP_HA_REVERSE_TUNNEL_IS_MANDATORY = 0x7EC, + /** + * Home agent rejected MIP (Mobile IP) registration because of encapsulation unavailable. + */ + MIP_HA_ENCAPSULATION_UNAVAILABLE = 0x7ED, + /** + * Tearing down is in progress. + */ + CLOSE_IN_PROGRESS = 0x7EE, + /** + * Brought down by the network. + */ + NETWORK_INITIATED_TERMINATION = 0x7EF, + /** + * Another application in modem preempts the data call. + */ + MODEM_APP_PREEMPTED = 0x7F0, + /** + * IPV4 PDN is in throttled state due to network providing only IPV6 address during the previous + * VSNCP bringup (subs_limited_to_v6). + */ + PDN_IPV4_CALL_DISALLOWED = 0x7F1, + /** + * IPV4 PDN is in throttled state due to previous VSNCP bringup failure(s). + */ + PDN_IPV4_CALL_THROTTLED = 0x7F2, + /** + * IPV6 PDN is in throttled state due to network providing only IPV4 address during the previous + * VSNCP bringup (subs_limited_to_v4). + */ + PDN_IPV6_CALL_DISALLOWED = 0x7F3, + /** + * IPV6 PDN is in throttled state due to previous VSNCP bringup failure(s). + */ + PDN_IPV6_CALL_THROTTLED = 0x7F4, + /** + * Modem restart. + */ + MODEM_RESTART = 0x7F5, + /** + * PDP PPP calls are not supported. + */ + PDP_PPP_NOT_SUPPORTED = 0x7F6, + /** + * RAT on which the data call is attempted/connected is no longer the preferred RAT. + */ + UNPREFERRED_RAT = 0x7F7, + /** + * Physical link is in the process of cleanup. + */ + PHYSICAL_LINK_CLOSE_IN_PROGRESS = 0x7F8, + /** + * Interface bring up is attempted for an APN that is yet to be handed over to target RAT. + */ + APN_PENDING_HANDOVER = 0x7F9, + /** + * APN bearer type in the profile does not match preferred network mode. + */ + PROFILE_BEARER_INCOMPATIBLE = 0x7FA, + /** + * Card was refreshed or removed. + */ + SIM_CARD_CHANGED = 0x7FB, + /** + * Device is going into lower power mode or powering down. + */ + LOW_POWER_MODE_OR_POWERING_DOWN = 0x7FC, + /** + * APN has been disabled. + */ + APN_DISABLED = 0x7FD, + /** + * Maximum PPP inactivity timer expired. + */ + MAX_PPP_INACTIVITY_TIMER_EXPIRED = 0x7FE, + /** + * IPv6 address transfer failed. + */ + IPV6_ADDRESS_TRANSFER_FAILED = 0x7FF, + /** + * Target RAT swap failed. + */ + TRAT_SWAP_FAILED = 0x800, + /** + * Device falls back from eHRPD to HRPD. + */ + EHRPD_TO_HRPD_FALLBACK = 0x801, + /** + * UE is in MIP-only configuration but the MIP configuration fails on call bring up due to + * incorrect provisioning. + */ + MIP_CONFIG_FAILURE = 0x802, + /** + * PDN inactivity timer expired due to no data transmission in a configurable duration of time. + */ + PDN_INACTIVITY_TIMER_EXPIRED = 0x803, + /** + * IPv4 data call bring up is rejected because the UE already maintains the allotted maximum + * number of IPv4 data connections. + */ + MAX_IPV4_CONNECTIONS = 0x804, + /** + * IPv6 data call bring up is rejected because the UE already maintains the allotted maximum + * number of IPv6 data connections. + */ + MAX_IPV6_CONNECTIONS = 0x805, + /** + * New PDN bring up is rejected during interface selection because the UE has already allotted + * the available interfaces for other PDNs. + */ + APN_MISMATCH = 0x806, + /** + * New call bring up is rejected since the existing data call IP type doesn't match the + * requested IP. + */ + IP_VERSION_MISMATCH = 0x807, + /** + * Dial up networking (DUN) call bring up is rejected since UE is in eHRPD RAT. + */ + DUN_CALL_DISALLOWED = 0x808, + /** + * Rejected/Brought down since UE is transition between EPC and NONEPC RAT. + */ + INTERNAL_EPC_NONEPC_TRANSITION = 0x809, + /** + * The current interface is being in use. + */ + INTERFACE_IN_USE = 0x80A, + /** + * PDN connection to the APN is disallowed on the roaming network. + */ + APN_DISALLOWED_ON_ROAMING = 0x80B, + /** + * APN-related parameters are changed. + */ + APN_PARAMETERS_CHANGED = 0x80C, + /** + * PDN is attempted to be brought up with NULL APN but NULL APN is not supported. + */ + NULL_APN_DISALLOWED = 0x80D, + /** + * Thermal level increases and causes calls to be torn down when normal mode of operation is + * not allowed. + */ + THERMAL_MITIGATION = 0x80E, + /** + * PDN Connection to a given APN is disallowed because data is disabled from the device user + * interface settings. + */ + DATA_SETTINGS_DISABLED = 0x80F, + /** + * PDN Connection to a given APN is disallowed because data roaming is disabled from the device + * user interface settings and the UE is roaming. + */ + DATA_ROAMING_SETTINGS_DISABLED = 0x810, + /** + * DDS (Default data subscription) switch occurs. + */ + DDS_SWITCHED = 0x811, + /** + * PDN being brought up with an APN that is part of forbidden APN Name list. + */ + FORBIDDEN_APN_NAME = 0x812, + /** + * Default data subscription switch is in progress. + */ + DDS_SWITCH_IN_PROGRESS = 0x813, + /** + * Roaming is disallowed during call bring up. + */ + CALL_DISALLOWED_IN_ROAMING = 0x814, + /** + * UE is unable to bring up a non-IP data call because the device is not camped on a NB1 cell. + */ + NON_IP_NOT_SUPPORTED = 0x815, + /** + * Non-IP PDN is in throttled state due to previous VSNCP bringup failure(s). + */ + PDN_NON_IP_CALL_THROTTLED = 0x816, + /** + * Non-IP PDN is in disallowed state due to the network providing only an IP address. + */ + PDN_NON_IP_CALL_DISALLOWED = 0x817, + /** + * Device in CDMA locked state. + */ + CDMA_LOCK = 0x818, + /** + * Received an intercept order from the base station. + */ + CDMA_INTERCEPT = 0x819, + /** + * Receiving a reorder from the base station. + */ + CDMA_REORDER = 0x81A, + /** + * Receiving a release from the base station with a SO (Service Option) Reject reason. + */ + CDMA_RELEASE_DUE_TO_SO_REJECTION = 0x81B, + /** + * Receiving an incoming call from the base station. + */ + CDMA_INCOMING_CALL = 0x81C, + /** + * Received an alert stop from the base station due to incoming only. + */ + CDMA_ALERT_STOP = 0x81D, + /** + * Channel acquisition failures. This indicates that device has failed acquiring all the + * channels in the PRL. + */ + CHANNEL_ACQUISITION_FAILURE = 0x81E, + /** + * Maximum access probes transmitted. + */ + MAX_ACCESS_PROBE = 0x81F, + /** + * Concurrent service is not supported by base station. + */ + CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION = 0x820, + /** + * There was no response received from the base station. + */ + NO_RESPONSE_FROM_BASE_STATION = 0x821, + /** + * The base station rejecting the call. + */ + REJECTED_BY_BASE_STATION = 0x822, + /** + * The concurrent services requested were not compatible. + */ + CONCURRENT_SERVICES_INCOMPATIBLE = 0x823, + /** + * Device does not have CDMA service. + */ + NO_CDMA_SERVICE = 0x824, + /** + * RUIM not being present. + */ + RUIM_NOT_PRESENT = 0x825, + /** + * Receiving a retry order from the base station. + */ + CDMA_RETRY_ORDER = 0x826, + /** + * Access blocked by the base station. + */ + ACCESS_BLOCK = 0x827, + /** + * Access blocked by the base station for all mobile devices. + */ + ACCESS_BLOCK_ALL = 0x828, + /** + * Maximum access probes for the IS-707B call. + */ + IS707B_MAX_ACCESS_PROBES = 0x829, + /** + * Put device in thermal emergency. + */ + THERMAL_EMERGENCY = 0x82A, + /** + * In favor of a voice call or SMS when concurrent voice and data are not supported. + */ + CONCURRENT_SERVICES_NOT_ALLOWED = 0x82B, + /** + * The other clients rejected incoming call. + */ + INCOMING_CALL_REJECTED = 0x82C, + /** + * No service on the gateway. + */ + NO_SERVICE_ON_GATEWAY = 0x82D, + /** + * GPRS context is not available. + */ + NO_GPRS_CONTEXT = 0x82E, + /** + * Network refuses service to the MS because either an identity of the MS is not acceptable to + * the network or the MS does not pass the authentication check. + */ + ILLEGAL_MS = 0x82F, + /** + * ME could not be authenticated and the ME used is not acceptable to the network. + */ + ILLEGAL_ME = 0x830, + /** + * Not allowed to operate either GPRS or non-GPRS services. + */ + GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 0x831, + /** + * MS is not allowed to operate GPRS services. + */ + GPRS_SERVICES_NOT_ALLOWED = 0x832, + /** + * No matching identity or context could be found in the network. + */ + MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK = 0x833, + /** + * Mobile reachable timer has expired, or the GMM context data related to the subscription does + * not exist in the SGSN. + */ + IMPLICITLY_DETACHED = 0x834, + /** + * UE requests GPRS service, or the network initiates a detach request in a PLMN which does not + * offer roaming for GPRS services to that MS. + */ + PLMN_NOT_ALLOWED = 0x835, + /** + * MS requests service, or the network initiates a detach request, in a location area where the + * HPLMN determines that the MS, by subscription, is not allowed to operate. + */ + LOCATION_AREA_NOT_ALLOWED = 0x836, + /** + * UE requests GPRS service or the network initiates a detach request in a PLMN that does not + * offer roaming for GPRS services. + */ + GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = 0x837, + /** + * PDP context already exists. + */ + PDP_DUPLICATE = 0x838, + /** + * RAT change on the UE. + */ + UE_RAT_CHANGE = 0x839, + /** + * Network cannot serve a request from the MS due to congestion. + */ + CONGESTION = 0x83A, + /** + * MS requests an establishment of the radio access bearers for all active PDP contexts by + * sending a service request message indicating data to the network, but the SGSN does not have + * any active PDP context. + */ + NO_PDP_CONTEXT_ACTIVATED = 0x83B, + /** + * Access class blocking restrictions for the current camped cell. + */ + ACCESS_CLASS_DSAC_REJECTION = 0x83C, + /** + * SM attempts PDP activation for a maximum of four attempts. + */ + PDP_ACTIVATE_MAX_RETRY_FAILED = 0x83D, + /** + * Radio access bearer failure. + */ + RADIO_ACCESS_BEARER_FAILURE = 0x83E, + /** + * Invalid EPS bearer identity in the request. + */ + ESM_UNKNOWN_EPS_BEARER_CONTEXT = 0x83F, + /** + * Data radio bearer is released by the RRC. + */ + DRB_RELEASED_BY_RRC = 0x840, + /** + * Indicate the connection was released. + */ + CONNECTION_RELEASED = 0x841, + /** + * UE is detached. + */ + EMM_DETACHED = 0x842, + /** + * Attach procedure is rejected by the network. + */ + EMM_ATTACH_FAILED = 0x843, + /** + * Attach procedure is started for EMC purposes. + */ + EMM_ATTACH_STARTED = 0x844, + /** + * Service request procedure failure. + */ + LTE_NAS_SERVICE_REQUEST_FAILED = 0x845, + /** + * Active dedicated bearer was requested using the same default bearer ID. + */ + DUPLICATE_BEARER_ID = 0x846, + /** + * Collision scenarios for the UE and network-initiated procedures. + */ + ESM_COLLISION_SCENARIOS = 0x847, + /** + * Bearer must be deactivated to synchronize with the network. + */ + ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK = 0x848, + /** + * Active dedicated bearer was requested for an existing default bearer. + */ + ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER = 0x849, + /** + * Bad OTA message is received from the network. + */ + ESM_BAD_OTA_MESSAGE = 0x84A, + /** + * Download server rejected the call. + */ + ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL = 0x84B, + /** + * PDN was disconnected by the downlaod server due to IRAT. + */ + ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT = 0x84C, + /** + * Dedicated bearer will be deactivated regardless of the network response. + */ + DS_EXPLICIT_DEACTIVATION = 0x84D, + /** + * No specific local cause is mentioned, usually a valid OTA cause. + */ + ESM_LOCAL_CAUSE_NONE = 0x84E, + /** + * Throttling is not needed for this service request failure. + */ + LTE_THROTTLING_NOT_REQUIRED = 0x84F, + /** + * Access control list check failure at the lower layer. + */ + ACCESS_CONTROL_LIST_CHECK_FAILURE = 0x850, + /** + * Service is not allowed on the requested PLMN. + */ + SERVICE_NOT_ALLOWED_ON_PLMN = 0x851, + /** + * T3417 timer expiration of the service request procedure. + */ + EMM_T3417_EXPIRED = 0x852, + /** + * Extended service request fails due to expiration of the T3417 EXT timer. + */ + EMM_T3417_EXT_EXPIRED = 0x853, + /** + * Transmission failure of radio resource control (RRC) uplink data. + */ + RRC_UPLINK_DATA_TRANSMISSION_FAILURE = 0x854, + /** + * Radio resource control (RRC) uplink data delivery failed due to a handover. + */ + RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER = 0x855, + /** + * Radio resource control (RRC) uplink data delivery failed due to a connection release. + */ + RRC_UPLINK_CONNECTION_RELEASE = 0x856, + /** + * Radio resource control (RRC) uplink data delivery failed due to a radio link failure. + */ + RRC_UPLINK_RADIO_LINK_FAILURE = 0x857, + /** + * Radio resource control (RRC) is not connected but the non-access stratum (NAS) sends an + * uplink data request. + */ + RRC_UPLINK_ERROR_REQUEST_FROM_NAS = 0x858, + /** + * Radio resource control (RRC) connection failure at access stratum. + */ + RRC_CONNECTION_ACCESS_STRATUM_FAILURE = 0x859, + /** + * Radio resource control (RRC) connection establishment is aborted due to another procedure. + */ + RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS = 0x85A, + /** + * Radio resource control (RRC) connection establishment failed due to access barrred. + */ + RRC_CONNECTION_ACCESS_BARRED = 0x85B, + /** + * Radio resource control (RRC) connection establishment failed due to cell reselection at + * access stratum. + */ + RRC_CONNECTION_CELL_RESELECTION = 0x85C, + /** + * Connection establishment failed due to configuration failure at the radio resource control + * (RRC). + */ + RRC_CONNECTION_CONFIG_FAILURE = 0x85D, + /** + * Radio resource control (RRC) connection could not be established in the time limit. + */ + RRC_CONNECTION_TIMER_EXPIRED = 0x85E, + /** + * Connection establishment failed due to a link failure at the radio resource control (RRC). + */ + RRC_CONNECTION_LINK_FAILURE = 0x85F, + /** + * Connection establishment failed as the radio resource control (RRC) is not camped on any + * cell. + */ + RRC_CONNECTION_CELL_NOT_CAMPED = 0x860, + /** + * Connection establishment failed due to a service interval failure at the radio resource + * control (RRC). + */ + RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE = 0x861, + /** + * Radio resource control (RRC) connection establishment failed due to the network rejecting the + * UE connection request. + */ + RRC_CONNECTION_REJECT_BY_NETWORK = 0x862, + /** + * Normal radio resource control (RRC) connection release. + */ + RRC_CONNECTION_NORMAL_RELEASE = 0x863, + /** + * Radio resource control (RRC) connection release failed due to radio link failure conditions. + */ + RRC_CONNECTION_RADIO_LINK_FAILURE = 0x864, + /** + * Radio resource control (RRC) connection re-establishment failure. + */ + RRC_CONNECTION_REESTABLISHMENT_FAILURE = 0x865, + /** + * UE is out of service during the call register. + */ + RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER = 0x866, + /** + * Connection has been released by the radio resource control (RRC) due to an abort request. + */ + RRC_CONNECTION_ABORT_REQUEST = 0x867, + /** + * Radio resource control (RRC) connection released due to a system information block read + * error. + */ + RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR = 0x868, + /** + * Network-initiated detach with reattach. + */ + NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH = 0x869, + /** + * Network-initiated detach without reattach. + */ + NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH = 0x86A, + /** + * ESM procedure maximum attempt timeout failure. + */ + ESM_PROCEDURE_TIME_OUT = 0x86B, + /** + * No PDP exists with the given connection ID while modifying or deactivating or activation for + * an already active PDP. + */ + INVALID_CONNECTION_ID = 0x86C, + /** + * Maximum NSAPIs have been exceeded during PDP activation. + */ + MAXIMIUM_NSAPIS_EXCEEDED = 0x86D, + /** + * Primary context for NSAPI does not exist. + */ + INVALID_PRIMARY_NSAPI = 0x86E, + /** + * Unable to encode the OTA message for MT PDP or deactivate PDP. + */ + CANNOT_ENCODE_OTA_MESSAGE = 0x86F, + /** + * Radio access bearer is not established by the lower layers during activation, modification, + * or deactivation. + */ + RADIO_ACCESS_BEARER_SETUP_FAILURE = 0x870, + /** + * Expiration of the PDP establish timer with a maximum of five retries. + */ + PDP_ESTABLISH_TIMEOUT_EXPIRED = 0x871, + /** + * Expiration of the PDP modify timer with a maximum of four retries. + */ + PDP_MODIFY_TIMEOUT_EXPIRED = 0x872, + /** + * Expiration of the PDP deactivate timer with a maximum of four retries. + */ + PDP_INACTIVE_TIMEOUT_EXPIRED = 0x873, + /** + * PDP activation failed due to RRC_ABORT or a forbidden PLMN. + */ + PDP_LOWERLAYER_ERROR = 0x874, + /** + * MO PDP modify collision when the MT PDP is already in progress. + */ + PDP_MODIFY_COLLISION = 0x875, + /** + * Maximum size of the L2 message was exceeded. + */ + MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 0x876, + /** + * Non-access stratum (NAS) request was rejected by the network. + */ + NAS_REQUEST_REJECTED_BY_NETWORK = 0x877, + /** + * Radio resource control (RRC) connection establishment failure due to an error in the request + * message. + */ + RRC_CONNECTION_INVALID_REQUEST = 0x878, + /** + * Radio resource control (RRC) connection establishment failure due to a change in the tracking + * area ID. + */ + RRC_CONNECTION_TRACKING_AREA_ID_CHANGED = 0x879, + /** + * Radio resource control (RRC) connection establishment failure due to the RF was unavailable. + */ + RRC_CONNECTION_RF_UNAVAILABLE = 0x87A, + /** + * Radio resource control (RRC) connection was aborted before deactivating the LTE stack due to + * a successful LTE to WCDMA/GSM/TD-SCDMA IRAT change. + */ + RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE = 0x87B, + /** + * If the UE has an LTE radio link failure before security is established, the radio resource + * control (RRC) connection must be released and the UE must return to idle. + */ + RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE = 0x87C, + /** + * Radio resource control (RRC) connection was aborted by the non-access stratum (NAS) after an + * IRAT to LTE IRAT handover. + */ + RRC_CONNECTION_ABORTED_AFTER_HANDOVER = 0x87D, + /** + * Radio resource control (RRC) connection was aborted before deactivating the LTE stack after a + * successful LTE to GSM/EDGE IRAT cell change order procedure. + */ + RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE = 0x87E, + /** + * Radio resource control (RRC) connection was aborted in the middle of a LTE to GSM IRAT cell + * change order procedure. + */ + RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE = 0x87F, + /** + * IMSI present in the UE is unknown in the home subscriber server. + */ + IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER = 0x880, + /** + * IMEI of the UE is not accepted by the network. + */ + IMEI_NOT_ACCEPTED = 0x881, + /** + * EPS and non-EPS services are not allowed by the network. + */ + EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = 0x882, + /** + * EPS services are not allowed in the PLMN. + */ + EPS_SERVICES_NOT_ALLOWED_IN_PLMN = 0x883, + /** + * Mobile switching center is temporarily unreachable. + */ + MSC_TEMPORARILY_NOT_REACHABLE = 0x884, + /** + * CS domain is not available. + */ + CS_DOMAIN_NOT_AVAILABLE = 0x885, + /** + * ESM level failure. + */ + ESM_FAILURE = 0x886, + /** + * MAC level failure. + */ + MAC_FAILURE = 0x887, + /** + * Synchronization failure. + */ + SYNCHRONIZATION_FAILURE = 0x888, + /** + * UE security capabilities mismatch. + */ + UE_SECURITY_CAPABILITIES_MISMATCH = 0x889, + /** + * Unspecified security mode reject. + */ + SECURITY_MODE_REJECTED = 0x88A, + /** + * Unacceptable non-EPS authentication. + */ + UNACCEPTABLE_NON_EPS_AUTHENTICATION = 0x88B, + /** + * CS fallback call establishment is not allowed. + */ + CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED = 0x88C, + /** + * No EPS bearer context was activated. + */ + NO_EPS_BEARER_CONTEXT_ACTIVATED = 0x88D, + /** + * Invalid EMM state. + */ + INVALID_EMM_STATE = 0x88E, + /** + * Non-Access Spectrum layer failure. + */ + NAS_LAYER_FAILURE = 0x88F, + /** + * Multiple PDP call feature is disabled. + */ + MULTIPLE_PDP_CALL_NOT_ALLOWED = 0x890, + /** + * Data call has been brought down because EMBMS is not enabled at the RRC layer. + */ + EMBMS_NOT_ENABLED = 0x891, + /** + * Data call was unsuccessfully transferred during the IRAT handover. + */ + IRAT_HANDOVER_FAILED = 0x892, + /** + * EMBMS data call has been successfully brought down. + */ + EMBMS_REGULAR_DEACTIVATION = 0x893, + /** + * Test loop-back data call has been successfully brought down. + */ + TEST_LOOPBACK_REGULAR_DEACTIVATION = 0x894, + /** + * Lower layer registration failure. + */ + LOWER_LAYER_REGISTRATION_FAILURE = 0x895, + /** + * Network initiates a detach on LTE with error cause "data plan has been replenished or has + * expired". + */ + DATA_PLAN_EXPIRED = 0x896, + /** + * UMTS interface is brought down due to handover from UMTS to iWLAN. + */ + UMTS_HANDOVER_TO_IWLAN = 0x897, + /** + * Received a connection deny due to general or network busy on EVDO network. + */ + EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY = 0x898, + /** + * Received a connection deny due to billing or authentication failure on EVDO network. + */ + EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE = 0x899, + /** + * HDR system has been changed due to redirection or the PRL was not preferred. + */ + EVDO_HDR_CHANGED = 0x89A, + /** + * Device exited HDR due to redirection or the PRL was not preferred. + */ + EVDO_HDR_EXITED = 0x89B, + /** + * Device does not have an HDR session. + */ + EVDO_HDR_NO_SESSION = 0x89C, + /** + * It is ending an HDR call origination in favor of a GPS fix. + */ + EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL = 0x89D, + /** + * Connection setup on the HDR system was time out. + */ + EVDO_HDR_CONNECTION_SETUP_TIMEOUT = 0x89E, + /** + * Device failed to acquire a co-located HDR for origination. + */ + FAILED_TO_ACQUIRE_COLOCATED_HDR = 0x89F, + /** + * OTASP commit is in progress. + */ + OTASP_COMMIT_IN_PROGRESS = 0x8A0, + /** + * Device has no hybrid HDR service. + */ + NO_HYBRID_HDR_SERVICE = 0x8A1, + /** + * HDR module could not be obtained because of the RF locked. + */ + HDR_NO_LOCK_GRANTED = 0x8A2, + /** + * DBM or SMS is in progress. + */ + DBM_OR_SMS_IN_PROGRESS = 0x8A3, + /** + * HDR module released the call due to fade. + */ + HDR_FADE = 0x8A4, + /** + * HDR system access failure. + */ + HDR_ACCESS_FAILURE = 0x8A5, + /** + * P_rev supported by 1 base station is less than 6, which is not supported for a 1X data call. + * The UE must be in the footprint of BS which has p_rev >= 6 to support this SO33 call. + */ + UNSUPPORTED_1X_PREV = 0x8A6, + /** + * Client ended the data call. + */ + LOCAL_END = 0x8A7, + /** + * Device has no service. + */ + NO_SERVICE = 0x8A8, + /** + * Device lost the system due to fade. + */ + FADE = 0x8A9, + /** + * Receiving a release from the base station with no reason. + */ + NORMAL_RELEASE = 0x8AA, + /** + * Access attempt is already in progress. + */ + ACCESS_ATTEMPT_ALREADY_IN_PROGRESS = 0x8AB, + /** + * Device is in the process of redirecting or handing off to a different target system. + */ + REDIRECTION_OR_HANDOFF_IN_PROGRESS = 0x8AC, + /** + * Device is operating in Emergency mode. + */ + EMERGENCY_MODE = 0x8AD, + /** + * Device is in use (e.g., voice call). + */ + PHONE_IN_USE = 0x8AE, + /** + * Device operational mode is different from the mode requested in the traffic channel bring up. + */ + INVALID_MODE = 0x8AF, + /** + * SIM was marked by the network as invalid for the circuit and/or packet service domain. + */ + INVALID_SIM_STATE = 0x8B0, + /** + * There is no co-located HDR. + */ + NO_COLLOCATED_HDR = 0x8B1, + /** + * UE is entering power save mode. + */ + UE_IS_ENTERING_POWERSAVE_MODE = 0x8B2, + /** + * Dual switch from single standby to dual standby is in progress. + */ + DUAL_SWITCH = 0x8B3, + /** + * Data call bring up fails in the PPP setup due to a timeout. (e.g., an LCP conf ack was not + * received from the network) + */ + PPP_TIMEOUT = 0x8B4, + /** + * Data call bring up fails in the PPP setup due to an authorization failure. + * (e.g., authorization is required, but not negotiated with the network during an LCP phase) + */ + PPP_AUTH_FAILURE = 0x8B5, + /** + * Data call bring up fails in the PPP setup due to an option mismatch. + */ + PPP_OPTION_MISMATCH = 0x8B6, + /** + * Data call bring up fails in the PPP setup due to a PAP failure. + */ + PPP_PAP_FAILURE = 0x8B7, + /** + * Data call bring up fails in the PPP setup due to a CHAP failure. + */ + PPP_CHAP_FAILURE = 0x8B8, + /** + * Data call bring up fails in the PPP setup because the PPP is in the process of cleaning the + * previous PPP session. + */ + PPP_CLOSE_IN_PROGRESS = 0x8B9, + /** + * IPv6 interface bring up fails because the network provided only the IPv4 address for the + * upcoming PDN permanent client can reattempt a IPv6 call bring up after the IPv4 interface is + * also brought down. However, there is no guarantee that the network will provide a IPv6 + * address. + */ + LIMITED_TO_IPV4 = 0x8BA, + /** + * IPv4 interface bring up fails because the network provided only the IPv6 address for the + * upcoming PDN permanent client can reattempt a IPv4 call bring up after the IPv6 interface is + * also brought down. However there is no guarantee that the network will provide a IPv4 + * address. + */ + LIMITED_TO_IPV6 = 0x8BB, + /** + * Data call bring up fails in the VSNCP phase due to a VSNCP timeout error. + */ + VSNCP_TIMEOUT = 0x8BC, + /** + * Data call bring up fails in the VSNCP phase due to a general error. It's used when there is + * no other specific error code available to report the failure. + */ + VSNCP_GEN_ERROR = 0x8BD, + /** + * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP + * configuration request because the requested APN is unauthorized. + */ + VSNCP_APN_UNAUTHORIZED = 0x8BE, + /** + * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP + * configuration request because the PDN limit has been exceeded. + */ + VSNCP_PDN_LIMIT_EXCEEDED = 0x8BF, + /** + * Data call bring up fails in the VSNCP phase due to the network rejected the VSNCP + * configuration request due to no PDN gateway address. + */ + VSNCP_NO_PDN_GATEWAY_ADDRESS = 0x8C0, + /** + * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP + * configuration request because the PDN gateway is unreachable. + */ + VSNCP_PDN_GATEWAY_UNREACHABLE = 0x8C1, + /** + * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP + * configuration request due to a PDN gateway reject. + */ + VSNCP_PDN_GATEWAY_REJECT = 0x8C2, + /** + * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP + * configuration request with the reason of insufficient parameter. + */ + VSNCP_INSUFFICIENT_PARAMETERS = 0x8C3, + /** + * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP + * configuration request with the reason of resource unavailable. + */ + VSNCP_RESOURCE_UNAVAILABLE = 0x8C4, + /** + * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP + * configuration request with the reason of administratively prohibited at the HSGW. + */ + VSNCP_ADMINISTRATIVELY_PROHIBITED = 0x8C5, + /** + * Data call bring up fails in the VSNCP phase due to a network rejection of PDN ID in use, or + * all existing PDNs are brought down with this end reason because one of the PDN bring up was + * rejected by the network with the reason of PDN ID in use. + */ + VSNCP_PDN_ID_IN_USE = 0x8C6, + /** + * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP + * configuration request for the reason of subscriber limitation. + */ + VSNCP_SUBSCRIBER_LIMITATION = 0x8C7, + /** + * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP + * configuration request because the PDN exists for this APN. + */ + VSNCP_PDN_EXISTS_FOR_THIS_APN = 0x8C8, + /** + * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP + * configuration request with reconnect to this PDN not allowed, or an active data call is + * terminated by the network because reconnection to this PDN is not allowed. Upon receiving + * this error code from the network, the modem infinitely throttles the PDN until the next power + * cycle. + */ + VSNCP_RECONNECT_NOT_ALLOWED = 0x8C9, + /** + * Device failure to obtain the prefix from the network. + */ + IPV6_PREFIX_UNAVAILABLE = 0x8CA, + /** + * System preference change back to SRAT during handoff + */ + HANDOFF_PREFERENCE_CHANGED = 0x8CB, + /** + * Data call fail due to the slice not being allowed for the data call. + */ + SLICE_REJECTED = 0x8CC, + /** + * No matching rule available for the request, and match-all rule is not allowed for it. + */ + MATCH_ALL_RULE_NOT_ALLOWED = 0x8CD, + /** + * If connection failed for all matching URSP rules. + */ + ALL_MATCHING_RULES_FAILED = 0x8CE, +} diff --git a/radio/aidl/android/hardware/radio/DataConnActiveStatus.aidl b/radio/aidl/android/hardware/radio/DataConnActiveStatus.aidl new file mode 100644 index 0000000000..1e837275d0 --- /dev/null +++ b/radio/aidl/android/hardware/radio/DataConnActiveStatus.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Data connection active status + */ +@VintfStability +@Backing(type="int") +enum DataConnActiveStatus { + /** + * Indicates the data connection is inactive. + */ + INACTIVE, + /** + * Indicates the data connection is active with physical link dormant. + */ + DORMANT, + /** + * Indicates the data connection is active with physical link up. + */ + ACTIVE, +} diff --git a/radio/aidl/android/hardware/radio/DataProfileId.aidl b/radio/aidl/android/hardware/radio/DataProfileId.aidl new file mode 100644 index 0000000000..f173f1f1e4 --- /dev/null +++ b/radio/aidl/android/hardware/radio/DataProfileId.aidl @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum DataProfileId { + DEFAULT = 0, + TETHERED = 1, + IMS = 2, + FOTA = 3, + CBS = 4, + /** + * Start of OEM-specific profiles + */ + OEM_BASE = 1000, + INVALID = 0xFFFFFFFF, +} diff --git a/radio/aidl/android/hardware/radio/DataProfileInfo.aidl b/radio/aidl/android/hardware/radio/DataProfileInfo.aidl new file mode 100644 index 0000000000..5e2d4d20b9 --- /dev/null +++ b/radio/aidl/android/hardware/radio/DataProfileInfo.aidl @@ -0,0 +1,103 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.ApnAuthType; +import android.hardware.radio.ApnTypes; +import android.hardware.radio.DataProfileId; +import android.hardware.radio.DataProfileInfoType; +import android.hardware.radio.PdpProtocolType; +import android.hardware.radio.RadioAccessFamily; + +@VintfStability +parcelable DataProfileInfo { + /** + * ID of the data profile. + */ + DataProfileId profileId; + /** + * The APN name. + */ + String apn; + /** + * PDP_type values. + */ + PdpProtocolType protocol; + /** + * PDP_type values used on roaming network. + */ + PdpProtocolType roamingProtocol; + /** + * APN authentication type. + */ + ApnAuthType authType; + /** + * The username for APN, or empty string. + */ + String user; + /** + * The password for APN, or empty string. + */ + String password; + /** + * Data profile technology type. + */ + DataProfileInfoType type; + /** + * The period in seconds to limit the maximum connections. + */ + int maxConnsTime; + /** + * The maximum connections during maxConnsTime. + */ + int maxConns; + /** + * The required wait time in seconds after a successful UE initiated disconnect of a given PDN + * connection before the device can send a new PDN connection request for that given PDN. + */ + int waitTime; + /** + * True to enable the profile, false to disable. + */ + boolean enabled; + /** + * Supported APN types bitmap. See ApnTypes for the value of each bit. + */ + ApnTypes supportedApnTypesBitmap; + /** + * The bearer bitmap. See RadioAccessFamily for the value of each bit. + */ + RadioAccessFamily bearerBitmap; + /** + * Maximum transmission unit (MTU) size in bytes for IPv4. + */ + int mtuV4; + /** + * Maximum transmission unit (MTU) size in bytes for IPv6. + */ + int mtuV6; + /** + * True if this data profile was used to bring up the last default (i.e internet) data + * connection successfully. + */ + boolean preferred; + /** + * If true, modem must persist this data profile and profileId must not be set to + * DataProfileId.INVALID. If the same data profile exists, this data profile must overwrite it. + */ + boolean persistent; +} diff --git a/radio/aidl/android/hardware/radio/DataProfileInfoType.aidl b/radio/aidl/android/hardware/radio/DataProfileInfoType.aidl new file mode 100644 index 0000000000..df46ef39fe --- /dev/null +++ b/radio/aidl/android/hardware/radio/DataProfileInfoType.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum DataProfileInfoType { + COMMON, + THREE_GPP, + THREE_GPP2, +} diff --git a/radio/aidl/android/hardware/radio/DataRegStateResult.aidl b/radio/aidl/android/hardware/radio/DataRegStateResult.aidl new file mode 100644 index 0000000000..53a3e52e85 --- /dev/null +++ b/radio/aidl/android/hardware/radio/DataRegStateResult.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentity; +import android.hardware.radio.DataRegStateResultVopsInfo; +import android.hardware.radio.NrIndicators; +import android.hardware.radio.RegState; + +@VintfStability +parcelable DataRegStateResult { + /** + * Valid reg states are NOT_REG_MT_NOT_SEARCHING_OP, REG_HOME, NOT_REG_MT_SEARCHING_OP, + * REG_DENIED, UNKNOWN, REG_ROAMING defined in RegState + */ + RegState regState; + /** + * Indicates the available data radio technology, valid values as defined by RadioTechnology. + */ + int rat; + /** + * If registration state is 3 (Registration denied) this is an enumerated reason why + * registration was denied. See 3GPP TS 24.008, Annex G.6 "Additional cause codes for GMM". + * 7 == GPRS services not allowed + * 8 == GPRS services and non-GPRS services not allowed + * 9 == MS identity cannot be derived by the network + * 10 == Implicitly detached + * 14 == GPRS services not allowed in this PLMN + * 16 == MSC temporarily not reachable + * 40 == No PDP context activated + */ + int reasonDataDenied; + /** + * The maximum number of simultaneous Data Calls must be established using setupDataCall(). + */ + int maxDataCalls; + CellIdentity cellIdentity; + /** + * Network capabilities for voice over PS services. This info is valid only on LTE network and + * must be present when device is camped on LTE. vopsInfo must be empty when device is camped + * only on 2G/3G. + */ + DataRegStateResultVopsInfo vopsInfo; + /** + * The parameters of NR 5G Non-Standalone. This value is only valid on E-UTRAN, otherwise + * must be empty. + */ + NrIndicators nrIndicators; +} diff --git a/radio/aidl/android/hardware/radio/DataRegStateResultVopsInfo.aidl b/radio/aidl/android/hardware/radio/DataRegStateResultVopsInfo.aidl new file mode 100644 index 0000000000..885d5b2395 --- /dev/null +++ b/radio/aidl/android/hardware/radio/DataRegStateResultVopsInfo.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.LteVopsInfo; + +@VintfStability +union DataRegStateResultVopsInfo { + boolean noinit; + /** + * LTE network capability + */ + LteVopsInfo lteVopsInfo; +} diff --git a/radio/aidl/android/hardware/radio/DataRequestReason.aidl b/radio/aidl/android/hardware/radio/DataRequestReason.aidl new file mode 100644 index 0000000000..74afdcb328 --- /dev/null +++ b/radio/aidl/android/hardware/radio/DataRequestReason.aidl @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum DataRequestReason { + /** + * The reason of the data request is normal + */ + NORMAL = 1, + /** + * The reason of the data request is device shutdown + */ + SHUTDOWN = 2, + /** + * The reason of the data request is IWLAN data handover to another transport + * (e.g. from cellular to wifi or vise versa) + */ + HANDOVER = 3, +} diff --git a/radio/aidl/android/hardware/radio/DataThrottlingAction.aidl b/radio/aidl/android/hardware/radio/DataThrottlingAction.aidl new file mode 100644 index 0000000000..1a49762374 --- /dev/null +++ b/radio/aidl/android/hardware/radio/DataThrottlingAction.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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="byte") +enum DataThrottlingAction { + /* + * Clear all existing data throttling. + */ + NO_DATA_THROTTLING, + /** + * Enact secondary carrier data throttling and remove any existing data throttling on + * anchor carrier. + */ + THROTTLE_SECONDARY_CARRIER, + /** + * Enact anchor carrier data throttling and disable data on secondary carrier if currently + * enabled. + */ + THROTTLE_ANCHOR_CARRIER, + /** + * Immediately hold on to current level of throttling. + */ + HOLD, +} diff --git a/radio/aidl/android/hardware/radio/DeviceStateType.aidl b/radio/aidl/android/hardware/radio/DeviceStateType.aidl new file mode 100644 index 0000000000..e622486293 --- /dev/null +++ b/radio/aidl/android/hardware/radio/DeviceStateType.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum DeviceStateType { + /** + * Device power save mode (provided by PowerManager). True indicates the device is in + * power save mode. + */ + POWER_SAVE_MODE, + /** + * Device charging state (provided by BatteryManager). True indicates the device is charging. + */ + CHARGING_STATE, + /** + * Low data expected mode. True indicates low data traffic is expected, for example, when the + * device is idle (e.g. not doing tethering in the background). Note this doesn't mean no data + * is expected. + */ + LOW_DATA_EXPECTED, +} diff --git a/radio/aidl/android/hardware/radio/Dial.aidl b/radio/aidl/android/hardware/radio/Dial.aidl new file mode 100644 index 0000000000..90568158ed --- /dev/null +++ b/radio/aidl/android/hardware/radio/Dial.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.Clir; +import android.hardware.radio.UusInfo; + +@VintfStability +parcelable Dial { + String address; + Clir clir; + /** + * Vector of User-User Signaling Information + */ + UusInfo[] uusInfo; +} diff --git a/radio/aidl/android/hardware/radio/Domain.aidl b/radio/aidl/android/hardware/radio/Domain.aidl new file mode 100644 index 0000000000..f5e5261310 --- /dev/null +++ b/radio/aidl/android/hardware/radio/Domain.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum Domain { + /** + * Circuit-switched + */ + CS = 1 << 0, + /** + * Packet-switched + */ + PS = 1 << 1, +} diff --git a/radio/aidl/android/hardware/radio/EmcIndicator.aidl b/radio/aidl/android/hardware/radio/EmcIndicator.aidl new file mode 100644 index 0000000000..6f0b19fdba --- /dev/null +++ b/radio/aidl/android/hardware/radio/EmcIndicator.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. + */ + +package android.hardware.radio; + +/** + * Defines the values for emergency service indicator of NR as per 3gpp spec 24.501 sec 9.10.3.5 + */ +@VintfStability +@Backing(type="byte") +enum EmcIndicator { + /** + * Emergency services not supported + */ + EMC_NOT_SUPPORTED, + /** + * Emergency services supported in NR connected to 5GCN only + */ + EMC_NR_CONNECTED_TO_5GCN, + /** + * Emergency services supported in E-UTRA connected to 5GCN only + */ + EMC_EUTRA_CONNECTED_TO_5GCN, + /** + * Emergency services supported in NR connected to 5GCN and E-UTRA connected to 5GCN + */ + EMC_BOTH_NR_EUTRA_CONNECTED_TO_5GCN, +} diff --git a/radio/aidl/android/hardware/radio/EmergencyCallRouting.aidl b/radio/aidl/android/hardware/radio/EmergencyCallRouting.aidl new file mode 100644 index 0000000000..a915ee69ce --- /dev/null +++ b/radio/aidl/android/hardware/radio/EmergencyCallRouting.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. + */ + +package android.hardware.radio; + +/** + * Indicates how the implementation should handle the emergency call if it is required by Android. + */ +@VintfStability +@Backing(type="int") +enum EmergencyCallRouting { + /** + * Indicates Android does not require how to handle the corresponding emergency call; it is + * decided by implementation. + */ + UNKNOWN, + /** + * Indicates the implementation must handle the call through emergency routing. + */ + EMERGENCY, + /** + * Indicates the implementation must handle the call through normal call routing. + */ + NORMAL, +} diff --git a/radio/aidl/android/hardware/radio/EmergencyNumber.aidl b/radio/aidl/android/hardware/radio/EmergencyNumber.aidl new file mode 100644 index 0000000000..ee425f87a1 --- /dev/null +++ b/radio/aidl/android/hardware/radio/EmergencyNumber.aidl @@ -0,0 +1,73 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.EmergencyNumberSource; +import android.hardware.radio.EmergencyServiceCategory; + +/** + * Emergency number contains information of number, one or more service category(s), zero or more + * emergency uniform resource names, mobile country code (mcc), mobile network country (mnc) and + * source(s) that indicate where it comes from. + * + * If the emergency number is associated with country, field ‘mcc’ must be provided, otherwise + * field ‘mcc’ must be an empty string. If the emergency number is associated with network operator, + * field ‘mcc’ and 'mnc' must be provided, otherwise field ‘mnc’ must be an empty string. If the + * emergency number is specified with emergency service category(s), field 'categories' must be + * provided, otherwise field 'categories' must be EmergencyServiceCategories::UNSPECIFIED. If the + * emergency number is specified with emergency uniform resource names (URN), field 'urns' must be + * provided, otherwise field 'urns' must be an empty list. + * + * A unique EmergencyNumber has a unique combination of ‘number’, ‘mcc’, 'mnc', 'categories' and + * 'urns' fields. Multiple EmergencyNumberSource should be merged into one 'sources' field via + * bitwise-OR combination for the same EmergencyNumber. + * + * Reference: 3gpp 22.101, Section 10 - Emergency Calls; + * 3gpp 23.167, Section 6 - Functional description; + * 3gpp 24.503, Section 5.1.6.8.1 - General; + * RFC 5031 + */ +@VintfStability +parcelable EmergencyNumber { + /** + * The emergency number. The character in the number string should only be the dial pad + * character('0'-'9', '*', or '#'). For example: 911. + */ + String number; + /** + * 3-digit Mobile Country Code, 0..999. Empty string if not applicable. + */ + String mcc; + /** + * 2 or 3-digit Mobile Network Code, 0..999. Empty string if not applicable. + */ + String mnc; + /** + * The bitfield of EmergencyServiceCategory(s). See EmergencyServiceCategory for the value of + * each bit. + */ + EmergencyServiceCategory categories; + /** + * The list of emergency Uniform Resource Names (URN). + */ + String[] urns; + /** + * The bitfield of EmergencyNumberSource(s). See EmergencyNumberSource for the value of + * each bit. + */ + EmergencyNumberSource sources; +} diff --git a/radio/aidl/android/hardware/radio/EmergencyNumberSource.aidl b/radio/aidl/android/hardware/radio/EmergencyNumberSource.aidl new file mode 100644 index 0000000000..c2d6547d64 --- /dev/null +++ b/radio/aidl/android/hardware/radio/EmergencyNumberSource.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. + */ + +package android.hardware.radio; + +/** + * The source to tell where the corresponding EmergencyNumber comes from. + * Reference: 3gpp 22.101, Section 10 - Emergency Calls + */ +@VintfStability +@Backing(type="int") +enum EmergencyNumberSource { + /** + * Indicates the number is from the network signal. + */ + NETWORK_SIGNALING = 1 << 0, + /** + * Indicates the number is from the sim card. + */ + SIM = 1 << 1, + /** + * Indicates the number is from the modem config. + */ + MODEM_CONFIG = 1 << 2, + /** + * Indicates the number is available as default. Per the reference, 112, 911 must always be + * available; additionally, 000, 08, 110, 999, 118 and 119 must be available when sim is not + * present. + */ + DEFAULT = 1 << 3, +} diff --git a/radio/aidl/android/hardware/radio/EmergencyServiceCategory.aidl b/radio/aidl/android/hardware/radio/EmergencyServiceCategory.aidl new file mode 100644 index 0000000000..30d34ab210 --- /dev/null +++ b/radio/aidl/android/hardware/radio/EmergencyServiceCategory.aidl @@ -0,0 +1,55 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Defining Emergency Service Category as follows: + * - General emergency call, all categories; + * - Police; + * - Ambulance; + * - Fire Brigade; + * - Marine Guard; + * - Mountain Rescue; + * - Manually Initiated eCall (MIeC); + * - Automatically Initiated eCall (AIeC); + * + * Category UNSPECIFIED (General emergency call, all categories) indicates that no specific + * services are associated with this emergency number. + * + * Reference: 3gpp 22.101, Section 10 - Emergency Calls + */ +@VintfStability +@Backing(type="int") +enum EmergencyServiceCategory { + /** + * General emergency call, all categories + */ + UNSPECIFIED = 0, + POLICE = 1 << 0, + AMBULANCE = 1 << 1, + FIRE_BRIGADE = 1 << 2, + MARINE_GUARD = 1 << 3, + MOUNTAIN_RESCUE = 1 << 4, + /** + * Manually Initiated eCall (MIeC) + */ + MIEC = 1 << 5, + /** + * Automatically Initiated eCall (AIeC) + */ + AIEC = 1 << 6, +} diff --git a/radio/aidl/android/hardware/radio/EmfIndicator.aidl b/radio/aidl/android/hardware/radio/EmfIndicator.aidl new file mode 100644 index 0000000000..226e6844fc --- /dev/null +++ b/radio/aidl/android/hardware/radio/EmfIndicator.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. + */ + +package android.hardware.radio; + +/** + * Defines the values for emergency service fallback indicator of NR as per TS 24.501 sec 9.10.3.5. + */ +@VintfStability +@Backing(type="byte") +enum EmfIndicator { + /** + * Emergency services fallback not supported + */ + EMF_NOT_SUPPORTED, + /** + * Emergency services fallback supported in NR connected to 5GCN only + */ + EMF_NR_CONNECTED_TO_5GCN, + /** + * Emergency services fallback supported in E-UTRA connected to 5GCN only + */ + EMF_EUTRA_CONNECTED_TO_5GCN, + /** + * Emergency services fallback supported in NR connected to 5GCN and E-UTRA connected to 5GCN. + */ + EMF_BOTH_NR_EUTRA_CONNECTED_TO_5GCN, +} diff --git a/radio/aidl/android/hardware/radio/EpsQos.aidl b/radio/aidl/android/hardware/radio/EpsQos.aidl new file mode 100644 index 0000000000..ee4cbdd6c2 --- /dev/null +++ b/radio/aidl/android/hardware/radio/EpsQos.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.QosBandwidth; + +/** + * LTE/EPS Quality of Service parameters as per 3gpp spec 24.301 sec 9.9.4.3. + */ +@VintfStability +parcelable EpsQos { + /** + * Quality of Service Class Identifier (QCI), see 3GPP TS 23.203 and 29.212. + * The allowed values are standard values(1-9, 65-68, 69-70, 75, 79-80, 82-85) + * defined in the spec and operator specific values in the range 128-254. + */ + int qci; + QosBandwidth downlink; + QosBandwidth uplink; +} diff --git a/radio/aidl/android/hardware/radio/EutranBands.aidl b/radio/aidl/android/hardware/radio/EutranBands.aidl new file mode 100644 index 0000000000..59fe6c4036 --- /dev/null +++ b/radio/aidl/android/hardware/radio/EutranBands.aidl @@ -0,0 +1,85 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * EUTRAN bands up to V16.4.0 + */ +@VintfStability +@Backing(type="int") +enum EutranBands { + BAND_1 = 1, + BAND_2 = 2, + BAND_3 = 3, + BAND_4 = 4, + BAND_5 = 5, + BAND_6 = 6, + BAND_7 = 7, + BAND_8 = 8, + BAND_9 = 9, + BAND_10 = 10, + BAND_11 = 11, + BAND_12 = 12, + BAND_13 = 13, + BAND_14 = 14, + BAND_17 = 17, + BAND_18 = 18, + BAND_19 = 19, + BAND_20 = 20, + BAND_21 = 21, + BAND_22 = 22, + BAND_23 = 23, + BAND_24 = 24, + BAND_25 = 25, + BAND_26 = 26, + BAND_27 = 27, + BAND_28 = 28, + BAND_30 = 30, + BAND_31 = 31, + BAND_33 = 33, + BAND_34 = 34, + BAND_35 = 35, + BAND_36 = 36, + BAND_37 = 37, + BAND_38 = 38, + BAND_39 = 39, + BAND_40 = 40, + BAND_41 = 41, + BAND_42 = 42, + BAND_43 = 43, + BAND_44 = 44, + BAND_45 = 45, + BAND_46 = 46, + BAND_47 = 47, + BAND_48 = 48, + BAND_65 = 65, + BAND_66 = 66, + BAND_68 = 68, + BAND_70 = 70, + BAND_49 = 49, + BAND_50 = 50, + BAND_51 = 51, + BAND_52 = 52, + BAND_53 = 53, + BAND_71 = 71, + BAND_72 = 72, + BAND_73 = 73, + BAND_74 = 74, + BAND_85 = 85, + BAND_87 = 87, + BAND_88 = 88, +} diff --git a/radio/aidl/android/hardware/radio/EvdoSignalStrength.aidl b/radio/aidl/android/hardware/radio/EvdoSignalStrength.aidl new file mode 100644 index 0000000000..ff631f311b --- /dev/null +++ b/radio/aidl/android/hardware/radio/EvdoSignalStrength.aidl @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable EvdoSignalStrength { + /** + * This value is the actual RSSI value multiplied by -1. Example: If the actual RSSI is -75, + * then this response value will be 75; INT_MAX means invalid/unreported. + */ + int dbm; + /** + * This value is the actual Ec/Io multiplied by -10. Example: If the actual Ec/Io is -12.5 dB, + * then this response value will be 125; INT_MAX means invalid/unreported. + */ + int ecio; + /** + * Valid values are 0-8. 8 is the highest signal to noise ratio; INT_MAX means + * invalid/unreported. + */ + int signalNoiseRatio; +} diff --git a/radio/aidl/android/hardware/radio/FrequencyRange.aidl b/radio/aidl/android/hardware/radio/FrequencyRange.aidl new file mode 100644 index 0000000000..09ec3bc1a7 --- /dev/null +++ b/radio/aidl/android/hardware/radio/FrequencyRange.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. + */ + +package android.hardware.radio; + +/** + * Mapping the frequency to a rough range. + */ +@VintfStability +@Backing(type="int") +enum FrequencyRange { + /** + * Indicates the frequency range is below 1GHz. + */ + LOW = 1, + /** + * Indicates the frequency range is between 1GHz and 3GHz. + */ + MID = 2, + /** + * Indicates the frequency range is between 3GHz and 6GHz. + */ + HIGH = 3, + /** + * Indicates the frequency range is above 6GHz (millimeter wave frequency). + */ + MMWAVE = 4, +} diff --git a/radio/aidl/android/hardware/radio/GeranBands.aidl b/radio/aidl/android/hardware/radio/GeranBands.aidl new file mode 100644 index 0000000000..d3a7598570 --- /dev/null +++ b/radio/aidl/android/hardware/radio/GeranBands.aidl @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum GeranBands { + BAND_T380 = 1, + BAND_T410 = 2, + BAND_450 = 3, + BAND_480 = 4, + BAND_710 = 5, + BAND_750 = 6, + BAND_T810 = 7, + BAND_850 = 8, + BAND_P900 = 9, + BAND_E900 = 10, + BAND_R900 = 11, + BAND_DCS1800 = 12, + BAND_PCS1900 = 13, + BAND_ER900 = 14, +} diff --git a/radio/aidl/android/hardware/radio/GsmBroadcastSmsConfigInfo.aidl b/radio/aidl/android/hardware/radio/GsmBroadcastSmsConfigInfo.aidl new file mode 100644 index 0000000000..9b08ad9b6a --- /dev/null +++ b/radio/aidl/android/hardware/radio/GsmBroadcastSmsConfigInfo.aidl @@ -0,0 +1,53 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Which types of Cell Broadcast Message (CBM) are to be received by the ME + */ +@VintfStability +parcelable GsmBroadcastSmsConfigInfo { + /** + * Beginning of the range of CBM message identifiers whose value is 0x0000 - 0xFFFF as defined + * in TS 23.041 9.4.1.2.2 for GMS and 9.4.4.2.2 for UMTS. + * All other values must be treated as empty CBM message ID. + */ + int fromServiceId; + /** + * End of the range of CBM message identifiers whose value is 0x0000 - 0xFFFF as defined in + * TS 23.041 9.4.1.2.2 for GMS and 9.4.4.2.2 for UMTS. + * All other values must be treated as empty CBM message ID. + */ + int toServiceId; + /** + * Beginning of the range of CBM data coding schemes whose value is 0x00 - 0xFF as defined in + * TS 23.041 9.4.1.2.3 for GMS and 9.4.4.2.3 for UMTS. + * All other values must be treated as empty CBM data coding scheme. + */ + int fromCodeScheme; + /** + * End of the range of CBM data coding schemes whose value is 0x00 - 0xFF as defined in + * TS 23.041 9.4.1.2.3 for GMS and 9.4.4.2.3 for UMTS. + * All other values must be treated as empty CBM data coding scheme. + */ + int toCodeScheme; + /** + * False means message types specified in + * and are not accepted, while true means accepted. + */ + boolean selected; +} diff --git a/radio/aidl/android/hardware/radio/GsmSignalStrength.aidl b/radio/aidl/android/hardware/radio/GsmSignalStrength.aidl new file mode 100644 index 0000000000..65f853a1f7 --- /dev/null +++ b/radio/aidl/android/hardware/radio/GsmSignalStrength.aidl @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable GsmSignalStrength { + /** + * Valid values are (0-61, 99) as defined in TS 27.007 8.69; INT_MAX means invalid/unreported. + */ + int signalStrength; + /** + * Bit error rate (0-7, 99) as defined in TS 27.007 8.5; INT_MAX means invalid/unreported. + */ + int bitErrorRate; + /** + * Timing advance in bit periods. 1 bit period = 48/13 us. INT_MAX means invalid/unreported. + */ + int timingAdvance; +} diff --git a/radio/aidl/android/hardware/radio/GsmSmsMessage.aidl b/radio/aidl/android/hardware/radio/GsmSmsMessage.aidl new file mode 100644 index 0000000000..248b4be6a4 --- /dev/null +++ b/radio/aidl/android/hardware/radio/GsmSmsMessage.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable GsmSmsMessage { + /** + * SMSC address in GSM BCD format prefixed by a length byte (as expected by TS 27.005) + * or empty string for default SMSC + */ + String smscPdu; + /** + * SMS in PDU format as an ASCII hex string less the SMSC address. + * TP-Layer-Length is be "strlen(pdu)/2 + */ + String pdu; +} diff --git a/radio/aidl/android/hardware/radio/HandoverFailureMode.aidl b/radio/aidl/android/hardware/radio/HandoverFailureMode.aidl new file mode 100644 index 0000000000..f6918a8bd6 --- /dev/null +++ b/radio/aidl/android/hardware/radio/HandoverFailureMode.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. + */ + +package android.hardware.radio; + +/** + * The allowed failure modes on an IWLAN handover failure. + */ +@VintfStability +@Backing(type="byte") +enum HandoverFailureMode { + /** + * On data handover failure, fallback to the source data transport when the fail cause is due + * to a hand off preference change. + */ + LEGACY, + /** + * On data handover failure, fallback to the source data transport. + */ + DO_FALLBACK, + /** + * On data handover failure, retry the handover instead of falling back to the source data + * transport. + */ + NO_FALLBACK_RETRY_HANDOVER, + /** + * On data handover failure, setup a new data connection by sending a normal request to the + * underlying data service. + */ + NO_FALLBACK_RETRY_SETUP_NORMAL, +} diff --git a/radio/aidl/android/hardware/radio/HardwareConfig.aidl b/radio/aidl/android/hardware/radio/HardwareConfig.aidl new file mode 100644 index 0000000000..d3902afcce --- /dev/null +++ b/radio/aidl/android/hardware/radio/HardwareConfig.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.HardwareConfigModem; +import android.hardware.radio.HardwareConfigSim; +import android.hardware.radio.HardwareConfigState; +import android.hardware.radio.HardwareConfigType; + +@VintfStability +parcelable HardwareConfig { + HardwareConfigType type; + /** + * RadioConst:MAX_UUID_LENGTH is max length of the string + */ + String uuid; + HardwareConfigState state; + /** + * Valid only if type is Modem and size = 1 else must be empty. Only one of modem or sim must + * have size = 1 based on the HardwareConfigType, and the other must have size = 0. + */ + HardwareConfigModem[] modem; + /** + * Valid only if type is SIM and size = 1 else must be empty. Only one of modem or sim must + * have size = 1 based on the HardwareConfigType, and the other must have size = 0. + */ + HardwareConfigSim[] sim; +} diff --git a/radio/aidl/android/hardware/radio/HardwareConfigModem.aidl b/radio/aidl/android/hardware/radio/HardwareConfigModem.aidl new file mode 100644 index 0000000000..ef348d6699 --- /dev/null +++ b/radio/aidl/android/hardware/radio/HardwareConfigModem.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable HardwareConfigModem { + int rilModel; + /** + * bitset - ref. RadioTechnology. + */ + int rat; + int maxVoice; + int maxData; + int maxStandby; +} diff --git a/radio/aidl/android/hardware/radio/HardwareConfigSim.aidl b/radio/aidl/android/hardware/radio/HardwareConfigSim.aidl new file mode 100644 index 0000000000..85055de7c4 --- /dev/null +++ b/radio/aidl/android/hardware/radio/HardwareConfigSim.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable HardwareConfigSim { + /** + * RadioConst:MAX_UUID_LENGTH is max length of the string + */ + String modemUuid; +} diff --git a/radio/aidl/android/hardware/radio/HardwareConfigState.aidl b/radio/aidl/android/hardware/radio/HardwareConfigState.aidl new file mode 100644 index 0000000000..05c806d52a --- /dev/null +++ b/radio/aidl/android/hardware/radio/HardwareConfigState.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum HardwareConfigState { + ENABLED, + STANDBY, + DISABLED, +} diff --git a/radio/aidl/android/hardware/radio/HardwareConfigType.aidl b/radio/aidl/android/hardware/radio/HardwareConfigType.aidl new file mode 100644 index 0000000000..5605c2b802 --- /dev/null +++ b/radio/aidl/android/hardware/radio/HardwareConfigType.aidl @@ -0,0 +1,24 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum HardwareConfigType { + MODEM, + SIM, +} diff --git a/radio/aidl/android/hardware/radio/IRadio.aidl b/radio/aidl/android/hardware/radio/IRadio.aidl new file mode 100644 index 0000000000..352cbfbaa8 --- /dev/null +++ b/radio/aidl/android/hardware/radio/IRadio.aidl @@ -0,0 +1,2073 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.AccessNetwork; +import android.hardware.radio.CallForwardInfo; +import android.hardware.radio.CardPowerState; +import android.hardware.radio.CarrierRestrictions; +import android.hardware.radio.CarrierRestrictionsWithPriority; +import android.hardware.radio.CdmaBroadcastSmsConfigInfo; +import android.hardware.radio.CdmaRoamingType; +import android.hardware.radio.CdmaSmsAck; +import android.hardware.radio.CdmaSmsMessage; +import android.hardware.radio.CdmaSmsWriteArgs; +import android.hardware.radio.CdmaSubscriptionSource; +import android.hardware.radio.DataProfileInfo; +import android.hardware.radio.DataRequestReason; +import android.hardware.radio.DataThrottlingAction; +import android.hardware.radio.DeviceStateType; +import android.hardware.radio.Dial; +import android.hardware.radio.EmergencyCallRouting; +import android.hardware.radio.EmergencyServiceCategory; +import android.hardware.radio.GsmBroadcastSmsConfigInfo; +import android.hardware.radio.GsmSmsMessage; +import android.hardware.radio.IRadioIndication; +import android.hardware.radio.IRadioResponse; +import android.hardware.radio.IccIo; +import android.hardware.radio.ImsSmsMessage; +import android.hardware.radio.ImsiEncryptionInfo; +import android.hardware.radio.IndicationFilter; +import android.hardware.radio.KeepaliveRequest; +import android.hardware.radio.LinkAddress; +import android.hardware.radio.NetworkScanRequest; +import android.hardware.radio.NrDualConnectivityState; +import android.hardware.radio.NvItem; +import android.hardware.radio.NvWriteItem; +import android.hardware.radio.OptionalSliceInfo; +import android.hardware.radio.OptionalTrafficDescriptor; +import android.hardware.radio.PersoSubstate; +import android.hardware.radio.PhonebookRecordInfo; +import android.hardware.radio.PreferredNetworkType; +import android.hardware.radio.RadioAccessFamily; +import android.hardware.radio.RadioAccessNetworks; +import android.hardware.radio.RadioAccessSpecifier; +import android.hardware.radio.RadioBandMode; +import android.hardware.radio.RadioCapability; +import android.hardware.radio.RadioTechnology; +import android.hardware.radio.ResetNvType; +import android.hardware.radio.SelectUiccSub; +import android.hardware.radio.SignalThresholdInfo; +import android.hardware.radio.SimApdu; +import android.hardware.radio.SimLockMultiSimPolicy; +import android.hardware.radio.SmsAcknowledgeFailCause; +import android.hardware.radio.SmsWriteArgs; +import android.hardware.radio.TtyMode; + +/** + * This interface is used by telephony and telecom to talk to cellular radio. + * 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 IRadioResponse and IRadioIndication. + */ +@VintfStability +interface IRadio { + /** + * Answer incoming call. Must not be called for WAITING calls. + * switchWaitingOrHoldingAndActive() must be used in this case instead + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.acceptCallResponse() + */ + oneway void acceptCall(in int serial); + + /** + * Acknowledge successful or failed receipt of SMS previously indicated via unsol + * responseNewSms(), including acknowledgement TPDU to send as the RP-User-Data element of the + * RP-ACK or RP-ERROR PDU. + * + * @param serial Serial number of request. + * @param success true on successful receipt (send RP-ACK) + * false on failed receipt (send RP-ERROR) + * @param ackPdu acknowledgement TPDU in hexadecimal format + * + * Response callback is IRadioResponse.acknowledgeIncomingGsmSmsWithPduResponse() + */ + oneway void acknowledgeIncomingGsmSmsWithPdu( + in int serial, in boolean success, in String ackPdu); + + /** + * Acknowledge the success or failure in the receipt of SMS previously indicated + * via responseCdmaNewSms() + * + * @param serial Serial number of request. + * @param smsAck Cdma Sms ack to be sent described by CdmaSmsAck in types.hal + * + * Response callback is IRadioResponse.acknowledgeLastIncomingCdmaSmsResponse() + */ + oneway void acknowledgeLastIncomingCdmaSms(in int serial, in CdmaSmsAck smsAck); + + /** + * Acknowledge successful or failed receipt of SMS previously indicated via unsolResponseNewSms + * + * @param serial Serial number of request. + * @param success is true on successful receipt + * (basically, AT+CNMA=1 from TS 27.005 is 0 on failed receipt + * (basically, AT+CNMA=2 from TS 27.005) + * @param cause: if success is false, this contains the failure cause as defined + * in TS 23.040, 9.2.3.22. + * + * Response function is IRadioResponse.acknowledgeLastIncomingGsmSmsResponse() + */ + oneway void acknowledgeLastIncomingGsmSms( + in int serial, in boolean success, in SmsAcknowledgeFailCause cause); + + /** + * Reserves an unallocated pdu session id from the pool of ids. The allocated id is returned + * in the response. When the id is no longer needed, call releasePduSessionId to return it to + * the pool. + * + * Reference: 3GPP TS 24.007 section 11.2.3.1b + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.allocatePduSessionIdResponse() + */ + oneway void allocatePduSessionId(in int serial); + + /** + * Whether uiccApplications are enabled, or disabled. + * By default uiccApplications must be enabled, unless enableUiccApplications() with enable + * being false is called. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.areUiccApplicationsEnabledResponse() + */ + oneway void areUiccApplicationsEnabled(in int serial); + + /** + * Indicates that a handover was cancelled after a call to IRadio::startHandover. + * Since the handover was unsuccessful, the modem retains ownership over any of the resources + * being transferred and is still responsible for releasing them. + * + * @param serial Serial number of request. + * @param id callId The identifier of the data call which is provided in SetupDataCallResult + * + * Response function is IRadioResponse.cancelHandoverResponse() + */ + oneway void cancelHandover(in int serial, in int callId); + + /** + * Cancel the current USSD session if one exists. + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.cancelPendingUssdResponse() + */ + oneway void cancelPendingUssd(in int serial); + + /** + * Supplies old ICC PIN2 and new PIN2. + * + * @param serial Serial number of request. + * @param oldPin2 Old pin2 value + * @param newPin2 New pin2 value + * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value. + * + * Response function is IRadioResponse.changeIccPin2ForAppResponse() + */ + oneway void changeIccPin2ForApp( + in int serial, in String oldPin2, in String newPin2, in String aid); + + /** + * Supplies old ICC PIN and new PIN. + * + * @param serial Serial number of request. + * @param oldPin Old pin value + * @param newPin New pin value + * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value. + * + * Response function is IRadioResponse.changeIccPinForAppResponse() + */ + oneway void changeIccPinForApp( + in int serial, in String oldPin, in String newPin, in String aid); + + /** + * Conference holding and active (like AT+CHLD=3) + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.conferenceResponse() + */ + oneway void conference(in int serial); + + /** + * Deactivate packet data connection and remove from the data call list. An + * unsolDataCallListChanged() must be sent when data connection is deactivated. + * + * @param serial Serial number of request. + * @param cid Data call id. + * @param reason The request reason. Must be normal, handover, or shutdown. + * + * Response function is IRadioResponse.deactivateDataCallResponse() + */ + oneway void deactivateDataCall(in int serial, in int cid, in DataRequestReason reason); + + /** + * Deletes a CDMA SMS message from RUIM memory. + * + * @param serial Serial number of request. + * @param index record index of the message to delete + * + * Response callback is IRadioResponse.deleteSmsOnRuimResponse() + */ + oneway void deleteSmsOnRuim(in int serial, in int index); + + /** + * Deletes a SMS message from SIM memory. + * + * @param serial Serial number of request. + * @param index Record index of the message to delete. + * + * Response function is IRadioResponse.deleteSmsOnSimResponse() + */ + oneway void deleteSmsOnSim(in int serial, in int index); + + /** + * Initiate voice call. This method is never used for supplementary service codes. + * + * @param serial Serial number of request. + * @param dialInfo Dial struct + * + * Response function is IRadioResponse.dialResponse() + */ + oneway void dial(in int serial, in Dial dialInfo); + + /** + * Initiate emergency voice call, with zero or more emergency service category(s), zero or + * more emergency Uniform Resource Names (URN), and routing information for handling the call. + * Android uses this request to make its emergency call instead of using @1.0::IRadio.dial + * if the 'address' in the 'dialInfo' field is identified as an emergency number by Android. + * + * In multi-sim scenario, if the emergency number is from a specific subscription, this radio + * request can still be sent out on the other subscription as long as routing is set to + * @1.4::EmergencyNumberRouting#EMERGENCY. This radio request will not be sent on an inactive + * (PIN/PUK locked) subscription unless both subscriptions are PIN/PUK locked. In this case, + * the request will be sent on the primary subscription. + * + * Some countries or carriers require some emergency numbers that must be handled with normal + * call routing if possible or emergency routing. 1) if the 'routing' field is specified as + * @1.4::EmergencyNumberRouting#NORMAL, the implementation must try the full radio service to + * use normal call routing to handle the call; if service cannot support normal routing, the + * implementation must use emergency routing to handle the call. 2) if 'routing' is specified + * as @1.4::EmergencyNumberRouting#EMERGENCY, the implementation must use emergency routing to + * handle the call. 3) if 'routing' is specified as @1.4::EmergencyNumberRouting#UNKNOWN, + * Android does not know how to handle the call. + * + * If the dialed emergency number does not have a specified emergency service category, the + * 'categories' field is set to @1.4::EmergencyServiceCategory#UNSPECIFIED; if the dialed + * emergency number does not have specified emergency Uniform Resource Names, the 'urns' field + * is set to an empty list. If the underlying technology used to request emergency services + * does not support the emergency service category or emergency uniform resource names, the + * field 'categories' or 'urns' may be ignored. + * + * In the scenarios that the 'address' in the 'dialInfo' field has other functions besides the + * emergency number function, if the 'hasKnownUserIntentEmergency' field is true, the user's + * intent for this dial request is emergency call, and the modem must treat this as an actual + * emergency dial; if the 'hasKnownUserIntentEmergency' field is false, Android does not know + * user's intent for this call. + * + * If 'isTesting' is true, this request is for testing purpose, and must not be sent to a real + * emergency service; otherwise it's for a real emergency call request. + * + * Reference: 3gpp 22.101, Section 10 - Emergency Calls; + * 3gpp 23.167, Section 6 - Functional description; + * 3gpp 24.503, Section 5.1.6.8.1 - General; + * RFC 5031 + * + * @param serial Serial number of request. + * @param dialInfo the same @1.0::Dial information used by @1.0::IRadio.dial. + * @param categories bitfield<@1.4::EmergencyServiceCategory> the Emergency Service Category(s) + * of the call. + * @param urns the emergency Uniform Resource Names (URN) + * @param routing @1.4::EmergencyCallRouting the emergency call routing information. + * @param hasKnownUserIntentEmergency Flag indicating if user's intent for the emergency call + * is known. + * @param isTesting Flag indicating if this request is for testing purpose. + * + * Response function is IRadioResponse.emergencyDialResponse() + */ + oneway void emergencyDial(in int serial, in Dial dialInfo, + in EmergencyServiceCategory categories, in String[] urns, + in EmergencyCallRouting routing, in boolean hasKnownUserIntentEmergency, + in boolean isTesting); + + /** + * Toggle logical modem on/off. This is similar to @1.0::IRadio.setRadioPower(), however that + * does not enforce that radio power is toggled only for the corresponding radio and certain + * vendor implementations do it for all radios. This new API should affect only the modem for + * which it is called. A modem stack must be on/active only when both setRadioPower() and + * enableModem() are set to on for it. + * + * SIM must be read if available even if modem is off/inactive. + * + * @param serial Serial number of request. + * @param on True to turn on the logical modem, otherwise turn it off. + * + * Response function is IRadioResponse.enableModemResponse() + */ + oneway void enableModem(in int serial, in boolean on); + + /** + * Enable or disable UiccApplications on the SIM. If disabled: + * - Modem will not register on any network. + * - SIM must be PRESENT, and the IccId of the SIM must still be accessible. + * - The corresponding modem stack is still functional, e.g. able to make emergency calls or + * do network scan. + * By default if this API is not called, the uiccApplications must be enabled automatically. + * It must work for both single SIM and DSDS cases for UX consistency. + * The preference is per SIM, and must be remembered over power cycle, modem reboot, or SIM + * insertion / unplug. + * + * @param serial Serial number of request. + * @param enable true if to enable uiccApplications, false to disable. + * + * Response callback is IRadioResponse.enableUiccApplicationsResponse() + */ + oneway void enableUiccApplications(in int serial, in boolean enable); + + /** + * Request the radio's system selection module to exit emergency callback mode. Radio must not + * respond with SUCCESS until the modem has completely exited from Emergency Callback Mode. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.exitEmergencyCallbackModeResponse() + */ + oneway void exitEmergencyCallbackMode(in int serial); + + /** + * Connects the two calls and disconnects the subscriber from both calls. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.explicitCallTransferResponse() + */ + oneway void explicitCallTransfer(in int serial); + + /** + * Get carrier restrictions. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getAllowedCarriersResponse_1_4() + */ + oneway void getAllowedCarriers(in int serial); + + /** + * Requests bitmap representing the currently allowed network types. + * getPreferredNetworkType, getPreferredNetworkTypesBitmap will not be called anymore + * except for IRadio v1.5 or older devices. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getAllowedNetworkTypesBitmapResponse() + */ + oneway void getAllowedNetworkTypesBitmap(in int serial); + + /** + * Get the list of band modes supported by RF. + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getAvailableBandModesResponse() + */ + oneway void getAvailableBandModes(in int serial); + + /** + * Scans for available networks + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getAvailableNetworksResponse() + */ + oneway void getAvailableNetworks(in int serial); + + /** + * Get all the barring info for the current camped cell applicable to the current user. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getBarringInfoResponse() + */ + oneway void getBarringInfo(in int serial); + + /** + * Return string value indicating baseband version, eg response from AT+CGMR + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getBasebandVersionResponse() + */ + oneway void getBasebandVersion(in int serial); + + /** + * Request the device MDN / H_SID / H_NID. The request is only allowed when CDMA subscription + * is available. When CDMA subscription is changed, application layer must re-issue the request + * to update the subscription information. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getCDMASubscriptionResponse() + */ + oneway void getCDMASubscription(in int serial); + + /** + * Request call forward status. + * + * @param serial Serial number of request. + * @param callInfo CallForwardInfo + * + * Response function is IRadioResponse.getCallForwardStatusResponse() + */ + oneway void getCallForwardStatus(in int serial, in CallForwardInfo callInfo); + + /** + * Query current call waiting state + * + * @param serial Serial number of request. + * @param serviceClass Service class is the TS 27.007 service class to query + * + * Response function is IRadioResponse.getCallWaitingResponse() + */ + oneway void getCallWaiting(in int serial, in int serviceClass); + + /** + * Request the setting of CDMA Broadcast SMS config + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getCdmaBroadcastConfigResponse() + */ + oneway void getCdmaBroadcastConfig(in int serial); + + /** + * Request the actual setting of the roaming preferences in CDMA in the modem + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getCdmaRoamingPreferenceResponse() + */ + oneway void getCdmaRoamingPreference(in int serial); + + /** + * Request to query the location where the CDMA subscription shall be retrieved. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getCdmaSubscriptionSourceResponse() + */ + oneway void getCdmaSubscriptionSource(in int serial); + + /** + * Request all of the current cell information known to the radio. The radio + * must return list of all current cells, including the neighboring cells. If for a particular + * cell information isn't known then the appropriate unknown value will be returned. + * This does not cause or change the rate of unsolicited cellInfoList(). + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getCellInfoListResponse() + */ + oneway void getCellInfoList(in int serial); + + /** + * Queries the status of the CLIP supplementary service (for MMI code "*#30#") + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getClipResponse() + */ + oneway void getClip(in int serial); + + /** + * Gets current CLIR status + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getClirResponse() + */ + oneway void getClir(in int serial); + + /** + * Requests current call list + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getCurrentCallsResponse_1_6() + */ + oneway void getCurrentCalls(in int serial); + + /** + * Returns the data call list. An entry is added when a setupDataCall() is issued and removed + * on a deactivateDataCall(). The list is emptied when setRadioPower() off/on issued or when + * the vendor HAL or modem crashes. + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getDataCallListResponse_1_6() + */ + oneway void getDataCallList(in int serial); + + /** + * Request current data registration state. + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getDataRegistrationStateResponse_1_6() + */ + oneway void getDataRegistrationState(in int serial); + + /** + * Request the device ESN / MEID / IMEI / IMEISV. The request is always allowed and contains + * GSM and CDMA device identity. When CDMA subscription is changed the ESN/MEID changes. + * The application layer must re-issue the request to update the device identity in this case. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getDeviceIdentityResponse() + */ + oneway void getDeviceIdentity(in int serial); + + /** + * Query the status of a facility lock state + * + * @param serial Serial number of request. + * @param facility is the facility string code from TS 27.007 7.4 + * (eg "AO" for BAOC, "SC" for SIM lock) + * @param password is the password, or "" if not required + * @param serviceClass is the TS 27.007 service class bit vector of services to query + * @param appId is AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value. + * This is only applicable in the case of Fixed Dialing Numbers (FDN) requests. + * + * Response function is IRadioResponse.getFacilityLockForAppResponse() + */ + oneway void getFacilityLockForApp(in int serial, in String facility, in String password, + in int serviceClass, in String appId); + + /** + * Request the setting of GSM/WCDMA Cell Broadcast SMS config. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getGsmBroadcastConfigResponse() + */ + oneway void getGsmBroadcastConfig(in int serial); + + /** + * Request all of the current hardware (modem and sim) associated with Radio. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getHardwareConfigResponse() + */ + oneway void getHardwareConfig(in int serial); + + /** + * Requests status of the ICC card + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getIccCardStatusResponse() + * + */ + oneway void getIccCardStatus(in int serial); + + /** + * Request current IMS registration state + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getImsRegistrationStateResponse() + */ + oneway void getImsRegistrationState(in int serial); + + /** + * Get the SIM IMSI. Only valid when radio state is "RADIO_STATE_ON" + * + * @param serial Serial number of request. + * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value. + * + * Response function is IRadioResponse.getImsiForAppResponse() + * + */ + oneway void getImsiForApp(in int serial, in String aid); + + /** + * Requests the failure cause code for the most recently terminated call. + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getLastCallFailCauseResponse() + * + */ + oneway void getLastCallFailCause(in int serial); + + /** + * Get modem activity information for power consumption estimation. Request clear-on-read + * statistics information that is used for estimating the per-millisecond power consumption + * of the cellular modem. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getModemActivityInfoResponse() + */ + oneway void getModemActivityInfo(in int serial); + + /** + * Request status of logical modem. It returns isEnabled=true if the logical modem is on. + * This method is the getter method for enableModem. + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getModemStackStatusResponse() + */ + oneway void getModemStackStatus(in int serial); + + /** + * Queries the current state of the uplink mute setting + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getMuteResponse() + */ + oneway void getMute(in int serial); + + /** + * Request neighboring cell id in GSM network + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getNeighboringCidsResponse() + */ + oneway void getNeighboringCids(in int serial); + + /** + * Query current network selection mode + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getNetworkSelectionModeResponse() + */ + oneway void getNetworkSelectionMode(in int serial); + + /** + * Request current operator ONS or EONS + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getOperatorResponse() + */ + oneway void getOperator(in int serial); + + /** + * Query the preferred network type (CS/PS domain, RAT, and operation mode) + * for searching and registering + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getPreferredNetworkTypeResponse() + */ + oneway void getPreferredNetworkType(in int serial); + + /** + * Query the preferred network type bitmap. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getPreferredNetworkTypeBitmapResponse() + */ + oneway void getPreferredNetworkTypeBitmap(in int serial); + + /** + * Request the setting of preferred voice privacy mode. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getPreferredVoicePrivacyResponse() + */ + oneway void getPreferredVoicePrivacy(in int serial); + + /** + * Used to get phone radio capability. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getRadioCapabilityResponse() + */ + oneway void getRadioCapability(in int serial); + + /** + * Requests current signal strength and associated information. Must succeed if radio is on. + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getSignalStrengthResponse_1_6() + */ + oneway void getSignalStrength(in int serial); + + /** + * Get the phone book capacity + * + * @param serial Serial number of request. + * + * Response function is defined from IRadioResponse.getSimPhonebookCapacityResponse() + */ + oneway void getSimPhonebookCapacity(in int serial); + + /** + * Get the local and global phonebook records from the SIM card. + * This should be called again after a simPhonebookChanged notification is received. + * The phonebook records are received via IRadioIndication.simPhonebookRecordsReceived() + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getSimPhonebookRecordsResponse() + */ + oneway void getSimPhonebookRecords(in int serial); + + /** + * Request to get the current slicing configuration including URSP rules and NSSAIs + * (configured, allowed and rejected). URSP stands for UE route selection policy and is defined + * in 3GPP TS 24.526 Section 4.2. An NSSAI is a collection of network slices. Each network slice + * is identified by an S-NSSAI and is represented by the struct SliceInfo. NSSAI and S-NSSAI + * are defined in 3GPP TS 24.501. + * + * Response function is IRadioResponse.getSlicingConfigResponse() + */ + oneway void getSlicingConfig(in int serial); + + /** + * Get the default Short Message Service Center address on the device. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getSmscAddressResponse() + */ + oneway void getSmscAddress(in int serial); + + /** + * Get which bands the modem's background scan is acting on. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getSystemSelectionChannelsResponse() + */ + oneway void getSystemSelectionChannels(in int serial); + + /** + * Request the setting of TTY mode + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getTTYModeResponse() + */ + oneway void getTTYMode(in int serial); + + /** + * Query the radio technology type (3GPP/3GPP2) used for voice. Query is valid only + * when radio state is not RADIO_STATE_UNAVAILABLE + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getVoiceRadioTechnologyResponse() + */ + oneway void getVoiceRadioTechnology(in int serial); + + /** + * Request current voice registration state. + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getVoiceRegistrationStateResponse() + */ + oneway void getVoiceRegistrationState(in int serial); + + /** + * When STK application gets stkCallSetup(), the call actually has been initialized by the + * mobile device already. (We could see the call has been in the 'call list'). STK application + * needs to accept/reject the call according to user operations. + * + * @param serial Serial number of request. + * @param accept true = accept the call setup, false = reject the call setup + * + * Response callback is IRadioResponse.handleStkCallSetupRequestFromSimResponse() + */ + oneway void handleStkCallSetupRequestFromSim(in int serial, in boolean accept); + + /** + * Hang up a specific line (like AT+CHLD=1x). After this HANGUP request returns, Radio must + * show the connection is NOT active anymore in next getCurrentCalls() query. + * + * @param serial Serial number of request. + * @param gsmIndex Connection index (value of 'x' in CHLD above) + * + * Response function is IRadioResponse.hangupResponse() + */ + oneway void hangup(in int serial, in int gsmIndex); + + /** + * Hang up waiting or held (like AT+CHLD=1). After this HANGUP request returns, Radio must show + * the connection is NOT active anymore in next getCurrentCalls() query. + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.hangupForegroundResumeBackgroundResponse() + */ + oneway void hangupForegroundResumeBackground(in int serial); + + /** + * Hang up waiting or held (like AT+CHLD=0). After this HANGUP request returns, Radio must show + * the connection is NOT active anymore in next getCurrentCalls() query. + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.hangupWaitingOrBackgroundResponse() + */ + oneway void hangupWaitingOrBackground(in int serial); + + /** + * Close a previously opened logical channel. This command reflects TS 27.007 + * "close logical channel" operation (+CCHC). + * + * @param serial Serial number of request. + * @param channelId session id of the logical channel (+CCHC). + * + * Response callback is IRadioResponse.iccCloseLogicalChannelResponse() + */ + oneway void iccCloseLogicalChannel(in int serial, in int channelId); + + /** + * Request ICC I/O operation. This is similar to the TS 27.007 "restricted SIM" operation where + * it assumes all of the EF selection must be done by the callee. Arguments and responses that + * are unused for certain values of "command" must be ignored or set to empty string. + * Note that IccIo has a "PIN2" field which may be empty string, or may specify a PIN2 for + * operations that require a PIN2 (eg updating FDN records). + * + * @param serial Serial number of request. + * @param iccIo IccIo + * + * Response function is IRadioResponse.iccIOForAppResponse() + */ + oneway void iccIOForApp(in int serial, in IccIo iccIo); + + /** + * Open a new logical channel and select the given application. This command + * reflects TS 27.007 "open logical channel" operation (+CCHO). + * + * @param serial Serial number of request. + * @param aid AID value, See ETSI 102.221 and 101.220. + * @param p2 P2 value, described in ISO 7816-4. Ignore if equal to P2Constant:NO_P2 + * + * Response callback is IRadioResponse.iccOpenLogicalChannelResponse() + */ + oneway void iccOpenLogicalChannel(in int serial, in String aid, in int p2); + + /** + * Request APDU exchange on the basic channel. This command reflects TS 27.007 + * "generic SIM access" operation (+CSIM). The modem must ensure proper function of GSM/CDMA, + * and filter commands appropriately. It must filter channel management and SELECT by DF + * name commands. "sessionid" field must be ignored. + * + * @param serial Serial number of request. + * @param message SimApdu as defined in types.hal to be sent + * + * Response callback is IRadioResponse.iccTransmitApduBasicChannelResponse() + */ + oneway void iccTransmitApduBasicChannel(in int serial, in SimApdu message); + + /** + * Exchange APDUs with a UICC over a previously opened logical channel. This command reflects + * TS 27.007 "generic logical channel access" operation (+CGLA). The modem must filter channel + * management and SELECT by DF name commands. + * + * @param serial Serial number of request. + * @param message SimApdu as defined in types.hal to be sent + * + * Response callback is IRadioResponse.iccTransmitApduLogicalChannelResponse() + */ + oneway void iccTransmitApduLogicalChannel(in int serial, in SimApdu message); + + /** + * Is E-UTRA-NR Dual Connectivity enabled + * + * @param serial Serial number of request. + * Response callback is IRadioResponse.isNrDualConnectivityEnabledResponse() + */ + oneway void isNrDualConnectivityEnabled(in int serial); + + /** + * Read one of the radio NV items. + * This is used for device configuration by some CDMA operators. + * + * @param serial Serial number of request. + * @param itemId NvItem is radio NV item as defined in types.hal + * + * Response callback is IRadioResponse.nvReadItemResponse() + */ + oneway void nvReadItem(in int serial, in NvItem itemId); + + /** + * Reset the radio NV configuration to the factory state. + * This is used for device configuration by some CDMA operators. + * + * @param serial Serial number of request. + * @param resetType ResetNvType as defined in types.hal + * + * Response callback is IRadioResponse.nvResetConfigResponse() + */ + oneway void nvResetConfig(in int serial, in ResetNvType resetType); + + /** + * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage. + * This is used for device configuration by some CDMA operators. + * + * @param serial Serial number of request. + * @param prl PRL as a byte array + * + * Response callback is IRadioResponse.nvWriteCdmaPrlResponse() + */ + oneway void nvWriteCdmaPrl(in int serial, in byte[] prl); + + /** + * Write one of the radio NV items. + * This is used for device configuration by some CDMA operators. + * + * @param serial Serial number of request. + * @param item NvWriteItem as defined in types.hal + * + * Response callback is IRadioResponse.nvWriteItemResponse() + */ + oneway void nvWriteItem(in int serial, in NvWriteItem item); + + /** + * Pull LCE service for capacity information. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.pullLceDataResponse() which may return + * RadioError:REQUEST_NOT_SUPPORTED if @1.2::IRadio or higher is supported. + * + * DEPRECATED in @1.2 or higher which use the always-on LCE that relies on indications. + */ + oneway void pullLceData(in int serial); + + /** + * Send UDUB (user determined user busy) to ringing or waiting call answer) + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.rejectCallResponse() + */ + oneway void rejectCall(in int serial); + + /** + * Releases a pdu session id that was previously allocated using allocatePduSessionId. + * Reference: 3GPP TS 24.007 section 11.2.3.1b + * + * @param serial Serial number of request. + * @param id Pdu session id to release. + * + * Response function is IRadioResponse.releasePduSessionIdResponse() + */ + oneway void releasePduSessionId(in int serial, in int id); + + /** + * Indicates whether there is storage available for new SMS messages. + * + * @param serial Serial number of request. + * @param available true if memory is available for storing new messages, + * false if memory capacity is exceeded + * + * Response callback is IRadioResponse.reportSmsMemoryStatusResponse() + */ + oneway void reportSmsMemoryStatus(in int serial, in boolean available); + + /** + * Indicates that the StkService is running and is ready to receive unsolicited stk commands. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.reportStkServiceIsRunningResponse() + */ + oneway void reportStkServiceIsRunning(in int serial); + + /** + * Returns the response of SIM Authentication through Radio challenge request. + * + * @param serial Serial number of request. + * @param authContext P2 value of authentication command, see P2 parameter in + * 3GPP TS 31.102 7.1.2 + * @param authData the challenge string in Base64 format, see 3GPP TS 31.102 7.1.2 + * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value + * + * Response callback is IRadioResponse.requestIccSimAuthenticationResponse() + */ + oneway void requestIccSimAuthentication( + in int serial, in int authContext, in String authData, in String aid); + + /** + * Request the ISIM application on the UICC to perform AKA challenge/response algorithm + * for IMS authentication + * + * @param serial Serial number of request. + * @param challenge challenge string in Base64 format + * + * Response callback is IRadioResponse.requestIsimAuthenticationResponse() + */ + oneway void requestIsimAuthentication(in int serial, in String challenge); + + /** + * Device is shutting down. All further commands are ignored and RADIO_NOT_AVAILABLE + * must be returned. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.requestShutdownResponse() + */ + oneway void requestShutdown(in int serial); + + /** + * 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(). + */ + oneway void responseAcknowledgement(); + + /** + * Send DTMF string + * + * @param serial Serial number of request. + * @param dtmf DTMF string + * @param on DTMF ON length in milliseconds, or 0 to use default + * @param off is the DTMF OFF length in milliseconds, or 0 to use default + * + * Response callback is IRadioResponse.sendBurstDtmfResponse() + */ + oneway void sendBurstDtmf(in int serial, in String dtmf, in int on, in int off); + + /** + * Send FLASH command + * + * @param serial Serial number of request. + * @param featureCode String associated with Flash command + * + * Response callback is IRadioResponse.sendCDMAFeatureCodeResponse() + */ + oneway void sendCDMAFeatureCode(in int serial, in String featureCode); + + /** + * Send a CDMA SMS message + * + * @param serial Serial number of request. + * @param sms Cdma Sms to be sent described by CdmaSmsMessage in types.hal + * + * Response callback is IRadioResponse.sendCdmaSmsResponse() + */ + oneway void sendCdmaSms(in int serial, in CdmaSmsMessage sms); + + /** + * Send an SMS message. Identical to sendCdmaSms, except that more messages are expected to be + * sent soon. + * + * @param serial Serial number of request. + * @param sms Cdma Sms to be sent described by CdmaSmsMessage in types.hal + * + * Response callback is IRadioResponse.sendCdmaSMSExpectMoreResponse() + */ + oneway void sendCdmaSmsExpectMore(in int serial, in CdmaSmsMessage sms); + + /** + * Send the updated device state. This is providing the device state information for the modem + * to perform power saving strategies. + * + * @param serial Serial number of request. + * @param deviceStateType The updated device state type. + * @param state The updated state. See the definition of state at DeviceStateType. + * + * Response callback is IRadioResponse.sendDeviceStateResponse() + */ + oneway void sendDeviceState( + in int serial, in DeviceStateType deviceStateType, in boolean state); + + /** + * Send a DTMF tone. If the implementation is currently playing a tone requested via + * startDtmf(), that tone must be cancelled and the new tone must be played instead. + * + * @param serial Serial number of request. + * @param s string with single char having one of 12 values: 0-9, *, # + * + * Response function is IRadioResponse.sendDtmfResponse() + */ + oneway void sendDtmf(in int serial, in String s); + + /** + * Requests to send a SAT/USAT envelope command to SIM. + * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111 + * + * @param serial Serial number of request. + * @param command SAT/USAT command in hexadecimal format string starting with command tag + * + * Response function is IRadioResponse.sendEnvelopeResponse() + */ + oneway void sendEnvelope(in int serial, in String command); + + /** + * Requests to send a SAT/USAT envelope command to SIM. The SAT/USAT envelope command refers to + * 3GPP TS 11.14 and 3GPP TS 31.111. This request has one difference from sendEnvelope(): + * The SW1 and SW2 status bytes from the UICC response are returned along with the response + * data, using the same structure as iccIOForApp(). The implementation must perform normal + * processing of a '91XX' response in SW1/SW2 to retrieve the pending proactive command and + * send it as an unsolicited response, as sendEnvelope() does. + * + * @param serial Serial number of request. + * @param contents SAT/USAT command in hexadecimal format starting with command tag + * + * Response callback is IRadioResponse.sendEnvelopeWithStatusResponse() + */ + oneway void sendEnvelopeWithStatus(in int serial, in String contents); + + /** + * Send a SMS message over IMS. Based on the return error, caller decides to resend if sending + * sms fails. SMS_SEND_FAIL_RETRY means retry, and other errors means no retry. + * In case of retry, data is encoded based on Voice Technology available. + * + * @param serial Serial number of request. + * @param message ImsSmsMessage as defined in types.hal to be sent + * + * Response callback is IRadioResponse.sendImsSmsResponse() + */ + oneway void sendImsSms(in int serial, in ImsSmsMessage message); + + /** + * Send an SMS message. Identical to sendSms, except that more messages are expected to be sent + * soon. If possible, keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command). + * Based on the returned error, caller decides to resend if sending sms fails. + * RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) and + * RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500) + * + * @param serial Serial number of request. + * @param message GsmSmsMessage as defined in types.hal + * + * Response function is IRadioResponse.sendSMSExpectMoreResponse() + * + * DEPRECATED in @1.6 or higher which uses sendSmsExpectMore(). + */ + oneway void sendSMSExpectMore(in int serial, in GsmSmsMessage message); + + /** + * Send an SMS message. Based on the returned error, caller decides to resend if sending sms + * fails. RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) and + * RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500) + * + * @param serial Serial number of request. + * @param message GsmSmsMessage as defined in types.hal + * + * Response function is IRadioResponse.sendSmsResponse() + */ + oneway void sendSms(in int serial, in GsmSmsMessage message); + + /** + * Send an SMS message. Identical to sendSms, except that more messages are expected to be sent + * soon. If possible, keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command). + * Based on the return error, caller decides to resend if sending sms fails. + * RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) and + * RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500) + * + * @param serial Serial number of request. + * @param message GsmSmsMessage as defined in types.hal + * + * Response function is IRadioResponse.sendSmsExpectMoreResponse() + */ + oneway void sendSmsExpectMore(in int serial, in GsmSmsMessage message); + + /** + * Requests to send a terminal response to SIM for a received proactive command + * + * @param serial Serial number of request. + * @param commandResponse SAT/USAT response in hexadecimal format string starting with + * first byte of response data + * + * Response function is IRadioResponse.sendTerminalResponseResponseToSim() + */ + oneway void sendTerminalResponseToSim(in int serial, in String commandResponse); + + /** + * Send a USSD message. If a USSD session already exists, the message must be sent in the + * context of that session. Otherwise, a new session must be created. The network reply must be + * reported via unsolOnUssd. + * + * Only one USSD session must exist at a time, and the session is assumed to exist until: + * a) The android system invokes cancelUssd() + * b) The implementation sends a unsolOnUssd() with a type code of + * "0" (USSD-Notify/no further action) or "2" (session terminated) + * + * @param serial Serial number of request. + * @param ussd string containing the USSD request in UTF-8 format + * + * Response function is IRadioResponse.sendUssdResponse() + * + * See also requestCancelUssd, unsolOnUssd + */ + oneway void sendUssd(in int serial, in String ussd); + + /** + * Separate a party from a multiparty call placing the multiparty call (less the specified + * party) on hold and leaving the specified party as the only other member of the current + * (active) call. Like AT+CHLD=2x. + * + * See TS 22.084 1.3.8.2 (iii) + * TS 22.030 6.5.5 "Entering "2X followed by send" + * TS 27.007 "AT+CHLD=2x" + * + * @param serial Serial number of request. + * @param gsmIndex contains Connection index (value of 'x' in CHLD above) + * + * Response function is IRadioResponse.separateConnectionResponse() + */ + oneway void separateConnection(in int serial, in int gsmIndex); + + /** + * Set carrier restrictions. Expected modem behavior: + * If never receives this command: + * - Must allow all carriers + * Receives this command: + * - Only allow carriers specified in carriers. The restriction persists across power cycles + * and FDR. If a present SIM is allowed, modem must not reload the SIM. If a present SIM is + * *not* allowed, modem must detach from the registered network and only keep emergency + * service, and notify Android SIM refresh reset with new SIM state being + * CardState:RESTRICTED. Emergency service must be enabled. + * + * @param serial Serial number of request. + * @param carriers CarrierRestrictionsWithPriority consisting allowed and excluded carriers + * as defined in types.hal + * @param multiSimPolicy Policy to be used for devices with multiple SIMs. + * + * Response callback is IRadioResponse.setAllowedCarriersResponse() + */ + oneway void setAllowedCarriers(in int serial, in CarrierRestrictionsWithPriority carriers, + in SimLockMultiSimPolicy multiSimPolicy); + + /** + * Requests to set the network type for searching and registering. Instruct the radio to + * *only* accept the types of network provided. setPreferredNetworkTypesBitmap and + * setPreferredNetworkType will not be called anymore except for IRadio v1.5 or older devices. + * In case of an emergency call, the modem is authorized to bypass this restriction. + * + * @param serial Serial number of request. + * @param networkTypeBitmap a 32-bit bearer bitmap of RadioAccessFamily + * + * Response callback is IRadioResponse.setAllowedNetworkTypesBitmapResponse() + */ + oneway void setAllowedNetworkTypesBitmap(in int serial, in RadioAccessFamily networkTypeBitmap); + + /** + * Assign a specified band for RF configuration. + * + * @param serial Serial number of request. + * @param mode RadioBandMode defined in types.hal + * + * Response function is IRadioResponse.setBandModeResponse() + */ + oneway void setBandMode(in int serial, in RadioBandMode mode); + + /** + * Change call barring facility password + * + * @param serial Serial number of request. + * @param facility facility string code from TS 27.007 7.4 (eg "AO" for BAOC) + * @param oldPassword old password + * @param newPassword new password + * + * Response function is IRadioResponse.setBarringPasswordResponse() + */ + oneway void setBarringPassword( + in int serial, in String facility, in String oldPassword, in String newPassword); + + /** + * Configure call forward rule + * + * @param serial Serial number of request. + * @param callInfo CallForwardInfo + * + * Response function is IRadioResponse.setCallForwardResponse() + */ + oneway void setCallForward(in int serial, in CallForwardInfo callInfo); + + /** + * Configure current call waiting state + * + * @param serial Serial number of request. + * @param enable is false for "disabled" and true for "enabled" + * @param serviceClass is the TS 27.007 service class bit vector of services to modify + * + * Response function is IRadioResponse.setCallWaitingResponse() + */ + oneway void setCallWaiting(in int serial, in boolean enable, in int serviceClass); + + /** + * Provide Carrier specific information to the modem that must be used to encrypt the IMSI and + * IMPI. Sent by the framework during boot, carrier switch and everytime the framework receives + * a new certificate. + * + * @param serial Serial number of request. + * @param imsiEncryptionInfo ImsiEncryptionInfo as defined in types.hal. + * + * Response callback is IRadioResponse.setCarrierInfoForImsiEncryptionResponse() + */ + oneway void setCarrierInfoForImsiEncryption( + in int serial, in ImsiEncryptionInfo imsiEncryptionInfo); + + /** + * Enable or disable the reception of CDMA Cell Broadcast SMS + * + * @param serial Serial number of request. + * @param activate indicates to activate or turn off the reception of CDMA + * Cell Broadcast SMS. true = activate, false = turn off + * + * Response callback is IRadioResponse.setCdmaBroadcastActivationResponse() + */ + oneway void setCdmaBroadcastActivation(in int serial, in boolean activate); + + /** + * Set CDMA Broadcast SMS config + * + * @param serial Serial number of request. + * @param configInfo CDMA Broadcast SMS config to be set. + * + * Response callback is IRadioResponse.setCdmaBroadcastConfigResponse() + */ + oneway void setCdmaBroadcastConfig(in int serial, in CdmaBroadcastSmsConfigInfo[] configInfo); + + /** + * Request to set the roaming preferences in CDMA + * + * @param serial Serial number of request. + * @param type CdmaRoamingType defined in types.hal + * + * Response callback is IRadioResponse.setCdmaRoamingPreferenceResponse() + */ + oneway void setCdmaRoamingPreference(in int serial, in CdmaRoamingType type); + + /** + * Request to set the location where the CDMA subscription shall be retrieved + * + * @param serial Serial number of request. + * @param cdmaSub CdmaSubscriptionSource + * + * Response callback is IRadioResponse.setCdmaSubscriptionSourceResponse() + */ + oneway void setCdmaSubscriptionSource(in int serial, in CdmaSubscriptionSource cdmaSub); + + /** + * Sets the minimum time between when unsolicited cellInfoList() must be invoked. + * A value of 0, means invoke cellInfoList() when any of the reported information changes. + * Setting the value to INT_MAX(0x7fffffff) means never issue a unsolicited cellInfoList(). + * + * @param serial Serial number of request. + * @param rate minimum time in milliseconds to indicate time between unsolicited cellInfoList() + * + * Response callback is IRadioResponse.setCellInfoListRateResponse() + */ + oneway void setCellInfoListRate(in int serial, in int rate); + + /** + * Set current CLIR status + * + * @param serial Serial number of request. + * @param status "n" parameter from TS 27.007 7.7 + * + * Response function is IRadioResponse.setClirResponse() + */ + oneway void setClir(in int serial, in int status); + + /** + * Tells the modem whether data calls are allowed or not + * + * @param serial Serial number of request. + * @param allow true to allow data calls, false to disallow data calls + * + * Response callback is IRadioResponse.setDataAllowedResponse() + */ + oneway void setDataAllowed(in int serial, in boolean allow); + + /** + * Send data profiles of the current carrier to the modem. + * + * @param serial Serial number of request. + * @param profiles Array of DataProfileInfo to set. + * + * Response callback is IRadioResponse.setDataProfileResponse() + */ + oneway void setDataProfile(in int serial, in DataProfileInfo[] profiles); + + /** + * Control data throttling at modem. + * - DataThrottlingAction:NO_DATA_THROTTLING should clear any existing data throttling within + * the requested completion window. + * - DataThrottlingAction:THROTTLE_SECONDARY_CARRIER: Remove any existing throttling on anchor + * carrier and achieve maximum data throttling on secondary carrier within the requested + * completion window. + * - DataThrottlingAction:THROTTLE_ANCHOR_CARRIER: disable secondary carrier and achieve maximum + * data throttling on anchor carrier by requested completion window. + * - DataThrottlingAction:HOLD: Immediately hold on to current level of throttling. + * + * @param serial Serial number of request. + * @param dataThrottlingAction DataThrottlingAction as defined in types.hal + * @param completionDurationMillis window, in milliseconds, in which the requested throttling + * action has to be achieved. This must be 0 when dataThrottlingAction is + * DataThrottlingAction:HOLD. + * + * Response function is IRadioResponse.setDataThrottlingResponse() + */ + oneway void setDataThrottling(in int serial, in DataThrottlingAction dataThrottlingAction, + in long completionDurationMillis); + + /** + * Enable/disable one facility lock + * + * @param serial Serial number of request. + * @param facility is the facility string code from TS 27.007 7.4 (eg "AO" for BAOC) + * @param lockState false for "unlock" and true for "lock" + * @param password is the password + * @param serviceClass is string representation of decimal TS 27.007 service class bit vector. + * Eg, the string "1" means "set this facility for voice services" + * @param appId is AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value. + * This is only applicable in the case of Fixed Dialing Numbers (FDN) requests. + * + * Response function is IRadioResponse.setFacilityLockForAppResponse() + */ + oneway void setFacilityLockForApp(in int serial, in String facility, in boolean lockState, + in String password, in int serviceClass, in String appId); + + /** + * Enable or disable the reception of GSM/WCDMA Cell Broadcast SMS + * + * @param serial Serial number of request. + * @param activate indicates to activate or turn off the reception of GSM/WCDMA + * Cell Broadcast SMS. true = activate, false = turn off + * + * Response callback is IRadioResponse.setGsmBroadcastActivationResponse() + */ + oneway void setGsmBroadcastActivation(in int serial, in boolean activate); + + /** + * Set GSM/WCDMA Cell Broadcast SMS config + * + * @param serial Serial number of request. + * @param configInfo Setting of GSM/WCDMA Cell broadcast config + * + * Response callback is IRadioResponse.setGsmBroadcastConfigResponse() + */ + oneway void setGsmBroadcastConfig(in int serial, in GsmBroadcastSmsConfigInfo[] configInfo); + + /** + * Sets the indication filter. Prevents the reporting of specified unsolicited indications from + * the radio. This is used for power saving in instances when those indications are not needed. + * If unset, defaults to IndicationFilter:ALL. + * + * @param serial Serial number of request. + * @param indicationFilter 32-bit bitmap of IndicationFilter. Bits set to 1 indicate the + * indications are enabled. See IndicationFilter for the definition of each bit. + * + * Response callback is IRadioResponse.setIndicationFilterResponse() + */ + oneway void setIndicationFilter(in int serial, in IndicationFilter indicationFilter); + + /** + * Set an APN to initial attach network. + * + * @param serial Serial number of request. + * @param dataProfileInfo data profile containing APN settings + * + * Response callback is IRadioResponse.setInitialAttachApnResponse() + */ + oneway void setInitialAttachApn(in int serial, in DataProfileInfo dataProfileInfo); + + /** + * Sets the link capacity reporting criteria. The resulting reporting criteria are the AND of + * all the supplied criteria. Note that reporting criteria must be individually set for each + * RAN. If unset, reporting criteria for that RAN are implementation-defined. + * + * Response callback is IRadioResponse.setLinkCapacityReportingCriteriaResponse(). + * + * @param serial Serial number of request. + * @param hysteresisMs A hysteresis time in milliseconds to prevent flapping. A value of 0 + * disables hysteresis. + * @param hysteresisDlKbps An interval in kbps defining the required magnitude change between DL + * reports. hysteresisDlKbps must be smaller than the smallest threshold delta. A value + * of 0 disables hysteresis. + * @param hysteresisUlKbps An interval in kbps defining the required magnitude change between UL + * reports. hysteresisUlKbps must be smaller than the smallest threshold delta. A value + * of 0 disables hysteresis. + * @param thresholdsDownlinkKbps A vector of trigger thresholds in kbps for downlink reports. A + * vector size of 0 disables the use of DL thresholds for reporting. + * @param thresholdsUplinkKbps A vector of trigger thresholds in kbps for uplink reports. A + * vector size of 0 disables the use of UL thresholds for reporting. + * @param accessNetwork The type of network for which to apply these thresholds. + */ + oneway void setLinkCapacityReportingCriteria(in int serial, in int hysteresisMs, + in int hysteresisDlKbps, in int hysteresisUlKbps, in int[] thresholdsDownlinkKbps, + in int[] thresholdsUplinkKbps, in AccessNetwork accessNetwork); + + /** + * Enables/disables network state change notifications due to changes in LAC and/or CID (for + * GSM) or BID/SID/NID/latitude/longitude (for CDMA). Basically +CREG=2 vs. +CREG=1 (TS 27.007). + * The Radio implementation must default to "updates enabled" when the screen is on and + * "updates disabled" when the screen is off. + * + * @param serial Serial number of request. + * @param enable true=updates enabled (+CREG=2), false=updates disabled (+CREG=1) + * + * Response callback is IRadioResponse.setLocationUpdatesResponse() + */ + oneway void setLocationUpdates(in int serial, in boolean enable); + + /** + * Turn on or off uplink (microphone) mute. Must only be sent while voice call is active. + * Must always be reset to "disable mute" when a new voice call is initiated + * + * @param serial Serial number of request. + * @param enable true for "enable mute" and false for "disable mute" + * + * Response function is IRadioResponse.setMuteResponse() + */ + oneway void setMute(in int serial, in boolean enable); + + /** + * Specify that the network must be selected automatically. + * This request must not respond until the new operator is selected and registered. + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.setNetworkSelectionModeAutomaticResponse() + */ + oneway void setNetworkSelectionModeAutomatic(in int serial); + + /** + * Manually select a specified network. This request must not respond until the new operator is + * selected and registered. Per TS 23.122, the RAN is just the initial suggested value. + * If registration fails, the RAN is not available afterwards, or the RAN is not within the + * network types specified by IRadio::setPreferredNetworkTypeBitmap, then the modem will need to + * select the next best RAN for network registration. + * + * @param serial Serial number of request. + * @param operatorNumeric String specifying MCCMNC of network to select (eg "310170"). + * @param ran Initial suggested radio access network type. If value is UNKNOWN, the modem + * will select the next best RAN for network registration. + * + * Response function is IRadioResponse.setNetworkSelectionModeManualResponse() + */ + oneway void setNetworkSelectionModeManual( + in int serial, in String operatorNumeric, in RadioAccessNetworks ran); + + /** + * Enable or disable E-UTRA-NR dual connectivity. If disabled then UE will not connect + * to secondary carrier. + * + * @param serial Serial number of request. + * @param nrDualConnectivityState expected NR dual connectivity state. + * 1: Enable NR dual connectivity {NrDualConnectivityState:ENABLE} + * 2: Disable NR dual connectivity {NrDualConnectivityState:DISABLE} + * 3: Disable NR dual connectivity and force secondary cell to be released + * {NrDualConnectivityState:DISABLE_IMMEDIATE} + * + * Response callback is IRadioResponse.setNRDualConnectivityStateResponse() + */ + oneway void setNrDualConnectivityState( + in int serial, in NrDualConnectivityState nrDualConnectivityState); + + /** + * Requests to set the preferred network type for searching and registering + * (CS/PS domain, RAT, and operation mode) + * + * @param serial Serial number of request. + * @param nwType PreferredNetworkType defined in types.hal + * + * Response callback is IRadioResponse.setPreferredNetworkTypeResponse() + */ + oneway void setPreferredNetworkType(in int serial, in PreferredNetworkType nwType); + + /** + * Requests to set the preferred network type for searching and registering. + * + * @param serial Serial number of request. + * @param networkTypeBitmap a 32-bit bitmap of RadioAccessFamily. + * + * Response callback is IRadioResponse.setPreferredNetworkTypeBitmapResponse() + */ + oneway void setPreferredNetworkTypeBitmap( + in int serial, in RadioAccessFamily networkTypeBitmap); + + /** + * Request to set the preferred voice privacy mode used in voice scrambling. + * + * @param serial Serial number of request. + * @param enable false for Standard Privacy Mode (Public Long Code Mask) + * true for Enhanced Privacy Mode (Private Long Code Mask) + * + * Response callback is IRadioResponse.setPreferredVoicePrivacyResponse() + */ + oneway void setPreferredVoicePrivacy(in int serial, in boolean enable); + + /** + * Used to set the phones radio capability. Be VERY careful using this request as it may cause + * some vendor modems to reset. Because of the possible modem reset any radio commands after + * this one may not be processed. + * + * @param serial Serial number of request. + * @param rc RadioCapability structure to be set + * + * Response callback is IRadioResponse.setRadioCapabilityResponse() + */ + oneway void setRadioCapability(in int serial, in RadioCapability rc); + + /** + * Toggle radio on and off (for "airplane" mode). If the radio is turned off/on the radio modem + * subsystem is expected return to an initialized state. For instance, any voice and data calls + * must be terminated and all associated lists emptied. + * When setting radio power on to exit from airplane mode to place an emergency call on this + * logical modem, powerOn, forEmergencyCall and preferredForEmergencyCall must be true. In + * this case, this modem is optimized to scan only emergency call bands, until: + * 1) Emergency call is completed; or + * 2) Another setRadioPower_1_5 is issued with forEmergencyCall being false or + * preferredForEmergencyCall being false; or + * 3) Timeout after 30 seconds if dial or emergencyDial is not called. + * Once one of these conditions is reached, the modem should move into normal operation. + * + * @param serial Serial number of request. + * @param powerOn To turn on radio -> on = true, to turn off radio -> on = false. + * @param forEmergencyCall To indication to radio if this request is due to emergency call. + * No effect if powerOn is false. + * @param preferredForEmergencyCall indicate whether the following emergency call will be sent + * on this modem or not. No effect if forEmergencyCall is false, or powerOn is false. + * + * Response callback is IRadioConfigResponse.setRadioPowerResponse. + */ + oneway void setRadioPower(in int serial, in boolean powerOn, in boolean forEmergencyCall, + in boolean preferredForEmergencyCall); + + /** + * Set response functions for radio requests & radio indications. + * + * @param radioResponse Object containing response functions + * @param radioIndication Object containing radio indications + */ + void setResponseFunctions(in IRadioResponse radioResponse, in IRadioIndication radioIndication); + + /** + * Sets the signal strength reporting criteria. The resulting reporting rules are the AND of all + * the supplied criteria. For each RAN the hysteresisDb and thresholds apply to only the + * following measured quantities: + * -GERAN - RSSI + * -CDMA2000 - RSSI + * -UTRAN - RSCP + * -EUTRAN - RSRP/RSRQ/RSSNR + * -NGRAN - SSRSRP/SSRSRQ/SSSINR + * Note that reporting criteria must be individually set for each RAN. For each RAN, if none of + * reporting criteria of any measurement is set enabled (see SignalThresholdInfo.isEnabled), + * the reporting criteria for this RAN is implementation-defined. For each RAN, if any reporting + * criteria of any measure is set enabled, the reporting criteria of the other measures in this + * RAN are set disabled (see SignalThresholdInfo.isEnabled) until they are set enabled. + * + * @param serial Serial number of request. + * @param signalThresholdInfo Signal threshold info including the threshold values, + * hysteresisDb, hysteresisMs and isEnabled. See SignalThresholdInfo for details. + * @param accessNetwork The type of network for which to apply these thresholds. + * + * Response callback is IRadioResponse.setSignalStrengthReportingCriteriaResponse() + */ + oneway void setSignalStrengthReportingCriteria(in int serial, + in SignalThresholdInfo signalThresholdInfo, in AccessNetwork accessNetwork); + + /** + * Set SIM card power state. Request is used to power off or power on the card. It should not + * generate a CardState.CARDSTATE_ABSENT indication, since the SIM is still physically inserted. + * When SIM card is in POWER_UP_PASS_THROUGH, the modem does not send any command to it (for + * example SELECT of MF, or TERMINAL CAPABILITY), and the SIM card is controlled completely by + * Telephony sending APDUs directly. The SIM card state must be RIL_CARDSTATE_PRESENT and the + * number of card apps will be 0. No new error code is generated. Emergency calls are supported + * in the same way as if the SIM card is absent. Pass-through mode is valid only for the + * specific card session where it is activated, and normal behavior occurs at the next SIM + * initialization, unless POWER_UP_PASS_THROUGH is requested again. + * The device is required to power down the SIM card before it can switch the mode between + * POWER_UP and POWER_UP_PASS_THROUGH. At device power up, the SIM interface is powered up + * automatically. Each subsequent request to this method is processed only after the completion + * of the previous one. + * When the SIM is in POWER_DOWN, the modem should send an empty vector of AppStatus in + * CardStatus.applications. If a SIM in the POWER_DOWN state is removed and a new SIM is + * inserted, the new SIM should be in POWER_UP mode by default. If the device is turned off or + * restarted while the SIM is in POWER_DOWN, then the SIM should turn on normally in POWER_UP + * mode when the device turns back on. + * + * @param serial Serial number of request + * @param powerUp POWER_DOWN if powering down the SIM card + * POWER_UP if powering up the SIM card + * POWER_UP_PASS_THROUGH if powering up the SIM card in pass through mode + * + * Response callback is IRadioResponse.setSimCardPowerResponse(). + */ + oneway void setSimCardPower(in int serial, in CardPowerState powerUp); + + /** + * Set the default Short Message Service Center address on the device. + * + * @param serial Serial number of request. + * @param smsc Short Message Service Center address to set + * + * Response callback is IRadioResponse.setSmscAddressResponse() + */ + oneway void setSmscAddress(in int serial, in String smsc); + + /** + * Enables/disables supplementary service related notifications from the network. + * Notifications are reported via unsolSuppSvcNotification(). + * + * @param serial Serial number of request. + * @param enable true = notifications enabled, false = notifications disabled. + * + * Response function is IRadioResponse.setSuppServiceNotificationsResponse() + */ + oneway void setSuppServiceNotifications(in int serial, in boolean enable); + + /** + * Specify which bands modem's background scan must act on. If specifyChannels is true, it only + * scans bands specified in specifiers. If specifyChannels is false, it scans all bands. For + * example, CBRS is only on LTE band 48. By specifying this band, modem saves more power. + * + * @param serial Serial number of request. + * @param specifyChannels whether to scan bands defined in specifiers. + * @param specifiers which bands to scan. Only used if specifyChannels is true. + * + * Response callback is IRadioResponse.setSystemSelectionChannelsResponse() + */ + oneway void setSystemSelectionChannels( + in int serial, in boolean specifyChannels, in RadioAccessSpecifier[] specifiers); + + /** + * Request to set the TTY mode + * + * @param serial Serial number of request. + * @param mode TtyMode + * + * Response callback is IRadioResponse.setTTYModeResponse() + */ + oneway void setTTYMode(in int serial, in TtyMode mode); + + /** + * Selection/de-selection of a subscription from a SIM card + * + * @param serial Serial number of request. + * @param uiccSub SelectUiccSub as defined in types.hal + * + * Response callback is IRadioResponse.setUiccSubscriptionResponse() + */ + oneway void setUiccSubscription(in int serial, in SelectUiccSub uiccSub); + + /** + * Setup a packet data connection. If DataCallResponse.status returns DataCallFailCause:NONE, + * the data connection must be added to data calls and a unsolDataCallListChanged() must be + * sent. The call remains until removed by subsequent unsolDataCallIstChanged(). It may be lost + * due to many factors, including deactivateDataCall() being issued, the radio powered off, + * reception lost or even transient factors like congestion. This data call list is returned by + * getDataCallList() and dataCallListChanged(). + * The Radio is expected to: + * - Create one data call context. + * - Create and configure a dedicated interface for the context. + * - The interface must be point to point. + * - The interface is configured with one or more addresses and is capable of sending and + * receiving packets. The format is IP address with optional "/" prefix length (The format is + * defined in RFC-4291 section 2.3). For example, "192.0.1.3", "192.0.1.11/16", or + * "2001:db8::1/64". Typically one IPv4 or one IPv6 or one of each. If the prefix length is + * absent, then the addresses are assumed to be point to point with IPv4 with prefix length 32 + * or IPv6 with prefix length 128. + * - Must not modify routing configuration related to this interface; routing management is + * exclusively within the purview of the Android OS. + * - Support simultaneous data call contexts up to DataRegStateResult.maxDataCalls specified in + * the response of getDataRegistrationState. + * + * @param serial Serial number of request. + * @param accessNetwork The access network to setup the data call. If the data connection cannot + * be established on the specified access network then this should respond with an error. + * @param dataProfileInfo Data profile info. + * @param roamingAllowed Indicates whether or not data roaming is allowed by the user. + * @param reason The request reason. Must be DataRequestReason:NORMAL or + * DataRequestReason:HANDOVER. + * @param addresses If the reason is DataRequestReason:HANDOVER, this indicates the list of link + * addresses of the existing data connection. This parameter must be ignored unless + * reason is DataRequestReason:HANDOVER. + * @param dnses If the reason is DataRequestReason:HANDOVER, this indicates the list of DNS + * addresses of the existing data connection. The format is defined in RFC-4291 section + * 2.2. For example, "192.0.1.3" or "2001:db8::1". This parameter must be ignored unless + * reason is DataRequestReason:HANDOVER. + * @param pduSessionId The pdu session id to be used for this data call. A value of 0 means no + * pdu session id was attached to this call. Reference: 3GPP TS 24.007 section 11.2.3.1b + * @param sliceInfo SliceInfo to be used for the data connection when a handover occurs from + * EPDG to 5G. It is valid only when accessNetwork is AccessNetwork:NGRAN. If the slice + * passed from EPDG is rejected, then the data failure cause must be + * DataCallFailCause:SLICE_REJECTED. + * @param trafficDescriptor TrafficDescriptor for which data connection needs to be established. + * It is used for URSP traffic matching as described in TS 24.526 Section 4.2.2. + * It includes an optional DNN which, if present, must be used for traffic matching -- + * it does not specify the end point to be used for the data call. The end point is + * specified by DataProfileInfo.apn; DataProfileInfo.apn must be used as the end point if + * one is not specified through URSP rules. + * @param matchAllRuleAllowed bool to indicate if using default match-all URSP rule for this + * request is allowed. If false, this request must not use the match-all URSP rule and if + * a non-match-all rule is not found (or if URSP rules are not available) it should + * return failure with cause DataCallFailCause:MATCH_ALL_RULE_NOT_ALLOWED. This is needed + * as some requests need to have a hard failure if the intention cannot be met, for + * example, a zero-rating slice. + * + * Response function is IRadioResponse.setupDataCallResponse() + */ + oneway void setupDataCall(in int serial, in AccessNetwork accessNetwork, + in DataProfileInfo dataProfileInfo, in boolean roamingAllowed, + in DataRequestReason reason, in LinkAddress[] addresses, in String[] dnses, + in int pduSessionId, in OptionalSliceInfo sliceInfo, + in OptionalTrafficDescriptor trafficDescriptor, in boolean matchAllRuleAllowed); + + /** + * Start playing a DTMF tone. Continue playing DTMF tone until stopDtmf is received. If a + * startDtmf() is received while a tone is currently playing, it must cancel the previous tone + * and play the new one. + * + * @param serial Serial number of request. + * @param s string having a single character with one of 12 values: 0-9,*,# + * + * Response function is IRadioResponse.startDtmfResponse() + */ + oneway void startDtmf(in int serial, in String s); + + /** + * Indicates that a handover to the IWLAN transport has begun. Any resources being transferred + * to the IWLAN transport cannot be released while a handover is underway. For example, if a + * pdu session id needs to be transferred to IWLAN, then the modem should not release the id + * while the handover is in progress. If a handover was unsuccessful, then the framework calls + * IRadio::cancelHandover. The modem retains ownership over any of the resources being + * transferred to IWLAN. If a handover was successful, the framework calls + * IRadio::deactivateDataCall with reason HANDOVER. The IWLAN transport now owns the transferred + * resources and is responsible for releasing them. + * + * @param serial Serial number of request. + * @param id callId The identifier of the data call which is provided in SetupDataCallResult + * + * Response function is IRadioResponse.startHandoverResponse() + */ + oneway void startHandover(in int serial, in int callId); + + /** + * Start a Keepalive session (for IPsec) + * + * @param serial Serial number of request. + * @param keepalive A request structure containing all necessary info to describe a keepalive + * + * Response function is IRadioResponse.startKeepaliveResponse() + */ + oneway void startKeepalive(in int serial, in KeepaliveRequest keepalive); + + /** + * Start Link Capacity Estimate (LCE) service if supported by the radio. + * + * @param serial Serial number of request. + * @param reportInterval desired reporting interval (ms). + * @param pullMode LCE service mode. true: PULL; false: PUSH. + * + * Response callback is IRadioResponse.startLceServiceResponse() + * + * DEPRECATED in @1.2 or higher which use the always-on LCE that relies on indications. + */ + oneway void startLceService(in int serial, in int reportInterval, in boolean pullMode); + + /** + * Starts a network scan. + * + * @param serial Serial number of request. + * @param request Defines the radio networks/bands/channels which need to be scanned. + * + * Response function is IRadioResponse.startNetworkScanResponse() + */ + oneway void startNetworkScan(in int serial, in NetworkScanRequest request); + + /** + * Stop playing a currently playing DTMF tone. + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.stopDtmfResponse() + */ + oneway void stopDtmf(in int serial); + + /** + * Stop an ongoing Keepalive session (for IPsec) + * + * @param serial Serial number of request. + * @param sessionHandle The handle that was provided by IRadioResponse.startKeepaliveResponse + * + * Response function is IRadioResponse.stopKeepaliveResponse() + */ + oneway void stopKeepalive(in int serial, in int sessionHandle); + + /** + * Stop Link Capacity Estimate (LCE) service, the STOP operation must be idempotent for the + * radio modem. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.stopLceServiceResponse() + * + * DEPRECATED in @1.2 or higher which use the always-on LCE that relies on indications. + */ + oneway void stopLceService(in int serial); + + /** + * Stops ongoing network scan + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.stopNetworkScanResponse() + */ + oneway void stopNetworkScan(in int serial); + + /** + * Supplies ICC PIN2. Only called following operation where SIM_PIN2 was returned as a failure + * from a previous operation. + * + * @param serial Serial number of request. + * @param pin2 PIN2 value + * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value. + * + * Response function is IRadioResponse.supplyIccPin2ForAppResponse() + */ + oneway void supplyIccPin2ForApp(in int serial, in String pin2, in String aid); + + /** + * Supplies ICC PIN. Only called if CardStatus has AppState.PIN state + * + * @param serial Serial number of request. + * @param pin PIN value + * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value. + * + * Response function is IRadioResponse.supplyIccPinForAppResponse() + */ + oneway void supplyIccPinForApp(in int serial, in String pin, in String aid); + + /** + * Supplies ICC PUK2 and new PIN2. + * + * @param serial Serial number of request. + * @param puk2 PUK2 value + * @param pin2 New PIN2 value + * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value. + * + * Response function is IRadioResponse.supplyIccPuk2ForAppResponse() + */ + oneway void supplyIccPuk2ForApp(in int serial, in String puk2, in String pin2, in String aid); + + /** + * Supplies ICC PUK and new PIN. + * + * @param serial Serial number of request. + * @param puk PUK value + * @param pin New PIN value + * @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value. + * + * Response function is IRadioResponse.supplyIccPukForAppResponse() + */ + oneway void supplyIccPukForApp(in int serial, in String puk, in String pin, in String aid); + + /** + * Requests that network personalization be deactivated + * + * @param serial Serial number of request. + * @param netPin Network depersonlization code + * + * Response function is IRadioResponse.supplyNetworkDepersonalizationResponse() + */ + oneway void supplyNetworkDepersonalization(in int serial, in String netPin); + + /** + * Request that deactivates one category of device personalization. Device personalization + * generally binds the device so it can only be used on one carrier or even one carrier subnet + * (See TS 22.022). When the user has gained the rights to unbind the device (at the end of a + * contract period or other event), the controlKey will be delivered to either the user for + * manual entry or to a carrier app on the device for automatic entry. + * + * @param serial Serial number of request. + * @param persoType SIM personalization type. + * @param controlKey the unlock code for removing persoType personalization from this device + * + * Response function is IRadioResponse.supplySimDepersonalizationResponse() + */ + oneway void supplySimDepersonalization( + in int serial, in PersoSubstate persoType, in String controlKey); + + /** + * Switch waiting or holding call and active call (like AT+CHLD=2). + * Call transitions must happen as shown below. + * BEFORE AFTER + * Call 1 Call 2 Call 1 Call 2 + * ACTIVE HOLDING HOLDING ACTIVE + * ACTIVE WAITING HOLDING ACTIVE + * HOLDING WAITING HOLDING ACTIVE + * ACTIVE IDLE HOLDING IDLE + * IDLE IDLE IDLE IDLE + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.switchWaitingOrHoldingAndActiveResponse() + */ + oneway void switchWaitingOrHoldingAndActive(in int serial); + + /** + * Insert, delete or update a phonebook record on the SIM card. If the index of recordInfo is 0, + * the phonebook record will be added to global or local phonebook, and global phonebook has + * higher priority than local phonebook. If the fields in the recordInfo are all empty except + * for the index, the phonebook record specified by the index will be deleted. The indication + * simPhonebookChanged will be called after every successful call of updateSimPhonebookRecords. + * + * @param serial Serial number of request. + * @param recordInfo Details of the record to insert, delete or update. + * + * Response callback is IRadioResponse.updateSimPhonebookRecordsResponse() + */ + oneway void updateSimPhonebookRecords(in int serial, in PhonebookRecordInfo recordInfo); + + /** + * Stores a CDMA SMS message to RUIM memory. + * + * @param serial Serial number of request. + * @param cdmaSms CDMA message as defined by CdmaSmsWriteArgs in types.hal + * + * Response callback is IRadioResponse.writeSmsToRuimResponse() + */ + oneway void writeSmsToRuim(in int serial, in CdmaSmsWriteArgs cdmaSms); + + /** + * Stores a SMS message to SIM memory. + * + * @param serial Serial number of request. + * @param smsWriteArgs SmsWriteArgs defined in types.hal + * + * Response function is IRadioResponse.writeSmsToSimResponse() + */ + oneway void writeSmsToSim(in int serial, in SmsWriteArgs smsWriteArgs); +} diff --git a/radio/aidl/android/hardware/radio/IRadioIndication.aidl b/radio/aidl/android/hardware/radio/IRadioIndication.aidl new file mode 100644 index 0000000000..054a53ef98 --- /dev/null +++ b/radio/aidl/android/hardware/radio/IRadioIndication.aidl @@ -0,0 +1,632 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.BarringInfo; +import android.hardware.radio.CdmaCallWaiting; +import android.hardware.radio.CdmaInformationRecords; +import android.hardware.radio.CdmaOtaProvisionStatus; +import android.hardware.radio.CdmaSignalInfoRecord; +import android.hardware.radio.CdmaSmsMessage; +import android.hardware.radio.CdmaSubscriptionSource; +import android.hardware.radio.CellIdentity; +import android.hardware.radio.CellInfo; +import android.hardware.radio.Domain; +import android.hardware.radio.EmergencyNumber; +import android.hardware.radio.HardwareConfig; +import android.hardware.radio.KeepaliveStatus; +import android.hardware.radio.LceDataInfo; +import android.hardware.radio.LinkCapacityEstimate; +import android.hardware.radio.NetworkScanResult; +import android.hardware.radio.PbReceivedStatus; +import android.hardware.radio.PcoDataInfo; +import android.hardware.radio.PhoneRestrictedState; +import android.hardware.radio.PhonebookRecordInfo; +import android.hardware.radio.PhysicalChannelConfig; +import android.hardware.radio.RadioCapability; +import android.hardware.radio.RadioIndicationType; +import android.hardware.radio.RadioState; +import android.hardware.radio.RadioTechnology; +import android.hardware.radio.SetupDataCallResult; +import android.hardware.radio.SignalStrength; +import android.hardware.radio.SimRefreshResult; +import android.hardware.radio.SrvccState; +import android.hardware.radio.StkCcUnsolSsResult; +import android.hardware.radio.SuppSvcNotification; +import android.hardware.radio.UssdModeType; + +/** + * Interface declaring unsolicited radio indications. + */ +@VintfStability +interface IRadioIndication { + /** + * Indicate barring information for the user’s access category / access class and PLMN. + * + *

Provide information about the barring status of the cell for the user. The information + * provided should describe all barring configurations that are applicable to the current user, + * even if the user is not currently barred (due to conditional barring). This informs Android + * of likely future (statistical) barring for specific services. + * + *

This indication should be sent whenever the cell’s barring config changes for the current + * user, or if the user’s conditional barring status changes due to re-evaluation of the + * barring conditions. Barring status will likely change when the device camps for service, + * when PLMN selection is completed, when the device attempts to access a conditionally barred + * service, and when the System Information including barring info for a camped cell is updated. + */ + oneway void barringInfoChanged(in RadioIndicationType type, in CellIdentity cellIdentity, + in BarringInfo[] barringInfos); + + /** + * Ring indication for an incoming call (eg, RING or CRING event). There must be at least one + * callRing() at the beginning of a call and sending multiple is optional. If the system + * property ro.telephony.call_ring.multiple is false then the upper layers must generate the + * multiple events internally. Otherwise the vendor code must generate multiple callRing() if + * ro.telephony.call_ring.multiple is true or if it is absent. + * The rate of these events is controlled by ro.telephony.call_ring.delay and has a default + * value of 3000 (3 seconds) if absent. + * + * @param type Type of radio indication + * @param isGsm true for GSM & false for CDMA + * @param record Cdma Signal Information + */ + oneway void callRing( + in RadioIndicationType type, in boolean isGsm, in CdmaSignalInfoRecord record); + + /** + * Indicates when call state has changed. Callee must invoke IRadio.getCurrentCalls(). Must be + * invoked on, for example, "RING", "BUSY", "NO CARRIER", and also call state transitions + * (DIALING->ALERTING ALERTING->ACTIVE). Redundent or extraneous invocations are tolerated. + * + * @param type Type of radio indication + */ + oneway void callStateChanged(in RadioIndicationType type); + + /** + * Indicates that the modem requires the Carrier info for IMSI/IMPI encryption. This might + * happen when the modem restarts or for some reason it's cache has been invalidated. + * + * @param type Type of radio indication + */ + oneway void carrierInfoForImsiEncryption(in RadioIndicationType info); + + /** + * Indicates when CDMA radio receives a call waiting indication. + * + * @param type Type of radio indication + * @param callWaitingRecord Cdma CallWaiting information + */ + oneway void cdmaCallWaiting(in RadioIndicationType type, in CdmaCallWaiting callWaitingRecord); + + /** + * Indicates when CDMA radio receives one or more info recs. + * + * @param type Type of radio indication + * @param records New Cdma Information + */ + oneway void cdmaInfoRec(in RadioIndicationType type, in CdmaInformationRecords records); + + /** + * Indicates when new CDMA SMS is received. Callee must subsequently confirm the receipt of the + * SMS with acknowledgeLastIncomingCdmaSms(). Server must not send cdmaNewSms() messages until + * acknowledgeLastIncomingCdmaSms() has been received. + * + * @param type Type of radio indication + * @param msg Cdma Sms Message + */ + oneway void cdmaNewSms(in RadioIndicationType type, in CdmaSmsMessage msg); + + /** + * Indicates when CDMA radio receives an update of the progress of an OTASP/OTAPA call. + * + * @param type Type of radio indication + * @param status Cdma OTA provision status + */ + oneway void cdmaOtaProvisionStatus( + in RadioIndicationType type, in CdmaOtaProvisionStatus status); + + /** + * Indicates when PRL (preferred roaming list) changes. + * + * @param type Type of radio indication + * @param version PRL version after PRL changes + */ + oneway void cdmaPrlChanged(in RadioIndicationType type, in int version); + + /** + * Indicates that SMS storage on the RUIM is full. Messages cannot be saved on the RUIM until + * space is freed. + * + * @param type Type of radio indication + */ + oneway void cdmaRuimSmsStorageFull(in RadioIndicationType type); + + /** + * Indicates when CDMA subscription source changed. + * + * @param type Type of radio indication + * @param cdmaSource New Cdma SubscriptionSource + */ + oneway void cdmaSubscriptionSourceChanged( + in RadioIndicationType type, in CdmaSubscriptionSource cdmaSource); + + /** + * Report all of the current cell information known to the radio. + * + * @param type Type of radio indication + * @param records Current cell information + */ + oneway void cellInfoList(in RadioIndicationType type, in CellInfo[] records); + + /** + * Report the current list of emergency numbers. Each emergency number in the emergency number + * list contains a dialing number, zero or more service category(s), zero or more emergency + * uniform resource names, mobile country code, mobile network code, and source(s) that indicate + * where it comes from. + * Radio must report all the valid emergency numbers with known mobile country code, mobile + * network code, emergency service categories, and emergency uniform resource names from all + * available sources including network signaling, sim, modem/oem configuration, and default + * configuration (112 and 911 must be always available; additionally, 000, 08, 110, 999, 118 + * and 119 must be available when sim is not present). Radio shall not report emergency numbers + * that are invalid in the current locale. The reported emergency number list must not have + * duplicate EmergencyNumber entries. Please refer the documentation of EmergencyNumber to + * construct each emergency number to report. + * Radio must report the complete list of emergency numbers whenever the emergency numbers in + * the list are changed or whenever the client and the radio server are connected. + * + * Reference: 3gpp 22.101, Section 10 - Emergency Calls; + * 3gpp 24.008, Section 9.2.13.4 - Emergency Number List + * + * @param type Type of radio indication + * @param emergencyNumberList Current list of emergency numbers known to radio. + */ + oneway void currentEmergencyNumberList( + in RadioIndicationType type, in EmergencyNumber[] emergencyNumberList); + + /** + * Indicates current link capacity estimate. This indication is sent whenever the reporting + * criteria, as set by IRadio.setLinkCapacityReportingCriteria, are met and the indication is + * not suppressed by IRadio.setIndicationFilter(). + * + * @param type Type of radio indication + * @param lce LinkCapacityEstimate + */ + oneway void currentLinkCapacityEstimate( + in RadioIndicationType type, in LinkCapacityEstimate lce); + + /** + * Indicates physical channel configurations. An empty configs list shall be returned when the + * radio is in idle mode (i.e. RRC idle). + * + * @param type Type of radio indication + * @param configs Vector of PhysicalChannelConfigs + */ + oneway void currentPhysicalChannelConfigs( + in RadioIndicationType type, in PhysicalChannelConfig[] configs); + + /** + * Indicates current signal strength of the radio. + * + * @param type Type of radio indication + * @param signalStrength SignalStrength information + */ + oneway void currentSignalStrength( + in RadioIndicationType type, in SignalStrength signalStrength); + + /** + * Indicates data call contexts have changed. + * + * @param type Type of radio indication + * @param dcList Array of SetupDataCallResult identical to that returned by + * IRadio.getDataCallList(). It is the complete list of current data contexts including + * new contexts that have been activated. A data call is only removed from this list + * when any of the below conditions is matched: + * - The framework sends a IRadio.deactivateDataCall(). + * - The radio is powered off/on. + * - Unsolicited disconnect from either modem or network side. + */ + oneway void dataCallListChanged(in RadioIndicationType type, in SetupDataCallResult[] dcList); + + /** + * Indicates that the radio system selection module has autonomously entered emergency + * callback mode. + * + * @param type Type of radio indication + */ + oneway void enterEmergencyCallbackMode(in RadioIndicationType type); + + /** + * Indicates when Emergency Callback Mode Ends. Indicates that the radio system selection module + * has proactively exited emergency callback mode. + * + * @param type Type of radio indication + */ + oneway void exitEmergencyCallbackMode(in RadioIndicationType type); + + /** + * Indicates when the hardware configuration associated with the RILd changes. + * + * @param type Type of radio indication + * @param configs Array of hardware configs + */ + oneway void hardwareConfigChanged(in RadioIndicationType type, in HardwareConfig[] configs); + + /** + * Indicates when IMS registration state has changed. To get IMS registration state and IMS SMS + * format, callee needs to invoke getImsRegistrationState(). + * + * @param type Type of radio indication + */ + oneway void imsNetworkStateChanged(in RadioIndicationType type); + + /** + * Indicates that nework doesn't have in-band information, need to play out-band tone. + * + * @param type Type of radio indication + * @param start true = start play ringback tone, false = stop playing ringback tone + */ + oneway void indicateRingbackTone(in RadioIndicationType type, in boolean start); + + /** + * Indicates a status update for a particular Keepalive session. This must include a handle for + * a previous session and should include a status update regarding the state of a keepalive. + * Unsolicited keepalive status reports should never be PENDING as unsolicited status should + * only be sent when known. + * + * @param type Type of radio indication + * @param status Status information for a Keepalive session + */ + oneway void keepaliveStatus(in RadioIndicationType type, in KeepaliveStatus status); + + /** + * Indicates when there is an incoming Link Capacity Estimate (LCE) info report. + * + * @param type Type of radio indication + * @param lce LceData information + * + * DEPRECATED in @1.2 and above, use IRadioIndication.currentLinkCapacityEstimate() instead. + */ + oneway void lceData(in RadioIndicationType type, in LceDataInfo lce); + + /** + * Indicates when there is a modem reset. + * When modem restarts, one of the following radio state transitions must happen + * 1) RadioState:ON->RadioState:UNAVAILABLE->RadioState:ON or + * 2) RadioState:OFF->RadioState:UNAVAILABLE->RadioState:OFF + * This message must be sent either just before the Radio State changes to + * RadioState:UNAVAILABLE or just after but must never be sent after the Radio State changes + * from RadioState:UNAVAILABLE to RadioState:ON/RadioState:OFF again. It must NOT be sent after + * the Radio state changes to RadioState:ON/RadioState:OFF after the modem restart as that may + * be interpreted as a second modem reset by the framework. + * + * @param type Type of radio indication + * @param reason the reason for the reset. It may be a crash signature if the restart was due to + * a crash or some string such as "user-initiated restart" or "AT command initiated + * restart" that explains the cause of the modem restart + */ + oneway void modemReset(in RadioIndicationType type, in String reason); + + /** + * Incremental network scan results. + * + * @param type Type of radio indication + * @param result the result of the network scan + */ + oneway void networkScanResult(in RadioIndicationType type, in NetworkScanResult result); + + /** + * Indicates when voice or data network state changed. Callee must invoke + * IRadio.getVoiceRegistrationState(), IRadio.getDataRegistrationState(), and + * IRadio.getOperator() + * + * @param type Type of radio indication + */ + oneway void networkStateChanged(in RadioIndicationType type); + + /** + * Indicates when new Broadcast SMS is received + * + * @param type Type of radio indication + * @param data If received from GSM network, "data" is byte array of 88 bytes which indicates + * each page of a CBS Message sent to the MS by the BTS as coded in 3GPP 23.041 Section + * 9.4.1.2. If received from UMTS network, "data" is byte array of 90 up to 1252 bytes + * which contain between 1 and 15 CBS Message pages sent as one packet to the MS by the + * BTS as coded in 3GPP 23.041 Section 9.4.2.2 + */ + oneway void newBroadcastSms(in RadioIndicationType type, in byte[] data); + + /** + * Indicates when new SMS is received. Callee must subsequently confirm the receipt of the SMS + * with a acknowledgeLastIncomingGsmSms(). Server must not send newSms() or newSmsStatusReport() + * messages until an acknowledgeLastIncomingGsmSms() has been received. + * + * @param type Type of radio indication + * @param pdu PDU of SMS-DELIVER represented as byte array. + * The PDU starts with the SMSC address per TS 27.005 (+CMT:) + */ + oneway void newSms(in RadioIndicationType type, in byte[] pdu); + + /** + * Indicates when new SMS has been stored on SIM card + * + * @param type Type of radio indication + * @param recordNumber Record number on the sim + */ + oneway void newSmsOnSim(in RadioIndicationType type, in int recordNumber); + + /** + * Indicates when new SMS Status Report is received. Callee must subsequently confirm the + * receipt of the SMS with a acknowledgeLastIncomingGsmSms(). Server must not send newSms() or + * newSmsStatusReport() messages until an acknowledgeLastIncomingGsmSms() has been received + * + * @param type Type of radio indication + * @param pdu PDU of SMS-STATUS-REPORT represented as byte array. + * The PDU starts with the SMSC address per TS 27.005 (+CMT:) + */ + oneway void newSmsStatusReport(in RadioIndicationType type, in byte[] pdu); + + /** + * Indicates when radio has received a NITZ time message. + * + * @param type Type of radio indication + * @param nitzTime NITZ time string in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt" + * @param receivedTime milliseconds since boot that the NITZ time was received + */ + oneway void nitzTimeReceived( + in RadioIndicationType type, in String nitzTime, in long receivedTime); + + /** + * Indicates when Supplementary service(SS) response is received when DIAL/USSD/SS is changed to + * SS by call control. + * + * @param type Type of radio indication + */ + oneway void onSupplementaryServiceIndication( + in RadioIndicationType type, in StkCcUnsolSsResult ss); + + /** + * Indicates when a new USSD message is received. The USSD session is assumed to persist if the + * type code is REQUEST, otherwise the current session (if any) is assumed to have terminated. + * + * @param type Type of radio indication + * @param modeType USSD type code + * @param msg Message string in UTF-8, if applicable + */ + oneway void onUssd(in RadioIndicationType type, in UssdModeType modeType, in String msg); + + /** + * Indicates when there is new Carrier PCO data received for a data call. Ideally only new data + * must be forwarded, though this is not required. Multiple boxes of carrier PCO data for a + * given call must result in a series of pcoData() calls. + * + * @param type Type of radio indication + * @param pco New PcoData + */ + oneway void pcoData(in RadioIndicationType type, in PcoDataInfo pco); + + /** + * Sent when setRadioCapability() completes. Returns the phone radio capability exactly as + * getRadioCapability() and must be the same set as sent by setRadioCapability(). + * + * @param type Type of radio indication + * @param rc Current radio capability + */ + oneway void radioCapabilityIndication(in RadioIndicationType type, in RadioCapability rc); + + /** + * Indicates when radio state changes. + * + * @param type Type of radio indication + * @param radioState Current radio state + */ + oneway void radioStateChanged(in RadioIndicationType type, in RadioState radioState); + + /** + * Report that Registration or a Location/Routing/Tracking Area update has failed. + * + *

Indicate whenever a registration procedure, including a location, routing, or tracking + * area update fails. This includes procedures that do not necessarily result in a change of + * the modem's registration status. If the modem's registration status changes, that is + * reflected in the onNetworkStateChanged() and subsequent get{Voice/Data}RegistrationState(). + * + * @param cellIdentity the CellIdentity, which must include the globally unique identifier for + * the cell (for example, all components of the CGI or ECGI). + * @param chosenPlmn a 5 or 6 digit alphanumeric PLMN (MCC|MNC) among those broadcast by the + * cell that was chosen for the failed registration attempt. + * @param domain Domain::CS, Domain::PS, or both in case of a combined procedure. + * @param causeCode the primary failure cause code of the procedure. + * For GSM/UMTS (MM), values are in TS 24.008 Sec 10.5.95 + * For GSM/UMTS (GMM), values are in TS 24.008 Sec 10.5.147 + * For LTE (EMM), cause codes are TS 24.301 Sec 9.9.3.9 + * For NR (5GMM), cause codes are TS 24.501 Sec 9.11.3.2 + * MAX_INT if this value is unused. + * @param additionalCauseCode the cause code of any secondary/combined procedure if appropriate. + * For UMTS, if a combined attach succeeds for PS only, then the GMM cause code shall be + * included as an additionalCauseCode. + * For LTE (ESM), cause codes are in TS 24.301 9.9.4.4 + * MAX_INT if this value is unused. + */ + oneway void registrationFailed(in RadioIndicationType type, in CellIdentity cellIdentity, + in String chosenPlmn, in Domain domain, in int causeCode, in int additionalCauseCode); + + /** + * Indicates that framework/application must reset the uplink mute state. + * + * @param type Type of radio indication + */ + oneway void resendIncallMute(in RadioIndicationType type); + + /** + * Indicates a restricted state change (eg, for Domain Specific Access Control). + * Radio must send this msg after radio off/on cycle no matter it is changed or not. + * + * @param type Type of radio indication + * @param state Bitmask of restricted state as defined by PhoneRestrictedState + */ + oneway void restrictedStateChanged(in RadioIndicationType type, in PhoneRestrictedState state); + + /** + * Indicates the ril connects and returns the version + * + * @param type Type of radio indication + */ + oneway void rilConnected(in RadioIndicationType type); + + /** + * Indicates whether SIM phonebook is changed. This indication is sent whenever the SIM + * phonebook is changed, including SIM is inserted or removed and updated by + * IRadio.updateSimPhonebookRecords. + * + * @param type Type of radio indication + */ + oneway void simPhonebookChanged(in RadioIndicationType type); + + /** + * Indicates the content of all the used records in the SIM phonebook. This indication is + * associated with the API getSimPhonebookRecords and might be received more than once that is + * replying on the record count. + * + * @param type Type of radio indication + * @param status Status of PbReceivedStatus + * @param records Vector of PhonebookRecordInfo + */ + oneway void simPhonebookRecordsReceived(in RadioIndicationType type, in PbReceivedStatus status, + in PhonebookRecordInfo[] records); + + /** + * Indicates that file(s) on the SIM have been updated, or the SIM has been reinitialized. + * If the SIM state changes as a result of the SIM refresh (eg, SIM_READY -> + * SIM_LOCKED_OR_ABSENT), simStatusChanged() must be sent. + * + * @param type Type of radio indication + * @param refreshResult Result of sim refresh + */ + oneway void simRefresh(in RadioIndicationType type, in SimRefreshResult refreshResult); + + /** + * Indicates that SMS storage on the SIM is full. Sent when the network attempts to deliver a + * new SMS message. Messages cannot be saved on the SIM until space is freed. In particular, + * incoming Class 2 messages must not be stored. + * + * @param type Type of radio indication + */ + oneway void simSmsStorageFull(in RadioIndicationType type); + + /** + * Indicates that SIM state changes. Callee must invoke getIccCardStatus(). + * + * @param type Type of radio indication + */ + oneway void simStatusChanged(in RadioIndicationType type); + + /** + * Indicates when Single Radio Voice Call Continuity (SRVCC) progress state has changed. + * + * @param type Type of radio indication + * @param state New Srvcc State + */ + oneway void srvccStateNotify(in RadioIndicationType type, in SrvccState state); + + /** + * Indicates when there is an ALPHA from UICC during Call Control. + * + * @param type Type of radio indication + * @param alpha ALPHA string from UICC in UTF-8 format + */ + oneway void stkCallControlAlphaNotify(in RadioIndicationType type, in String alpha); + + /** + * Indicates when SIM wants application to setup a voice call. + * + * @param type Type of radio indication + * @param timeout Timeout value in millisec for setting up voice call + */ + oneway void stkCallSetup(in RadioIndicationType type, in long timeout); + + /** + * Indicates when SIM notifies applcations some event happens. + * + * @param type Type of radio indication + * @param cmd SAT/USAT commands or responses sent by ME to SIM or commands handled by ME, + * represented as byte array starting with first byte of response data for command tag. + * Refer to TS 102.223 section 9.4 for command types + */ + oneway void stkEventNotify(in RadioIndicationType type, in String cmd); + + /** + * Indicates when SIM issue a STK proactive command to applications + * + * @param type Type of radio indication + * @param cmd SAT/USAT proactive represented as byte array starting with command tag. + * Refer to TS 102.223 section 9.4 for command types + */ + oneway void stkProactiveCommand(in RadioIndicationType type, in String cmd); + + /** + * Indicates when STK session is terminated by SIM. + * + * @param type Type of radio indication + */ + oneway void stkSessionEnd(in RadioIndicationType type); + + /** + * Indicated when there is a change in subscription status. + * This event must be sent in the following scenarios + * - subscription readiness at modem, which was selected by telephony layer + * - when subscription is deactivated by modem due to UICC card removal + * - when network invalidates the subscription i.e. attach reject due to authentication reject + * + * @param type Type of radio indication + * @param activate false for subscription deactivated, true for subscription activated + */ + oneway void subscriptionStatusChanged(in RadioIndicationType type, in boolean activate); + + /** + * Reports supplementary service related notification from the network. + * + * @param type Type of radio indication + * @param suppSvc SuppSvcNotification as defined in types.hal + */ + oneway void suppSvcNotify(in RadioIndicationType type, in SuppSvcNotification suppSvc); + + /** + * Report change of whether uiccApplications are enabled, or disabled. + * + * @param type Type of radio indication + * @param enabled whether uiccApplications are enabled, or disabled + */ + oneway void uiccApplicationsEnablementChanged(in RadioIndicationType type, in boolean enabled); + + /** + * The modem can explicitly set SetupDataCallResult::suggestedRetryTime after a failure in + * IRadio.SetupDataCall. During that time, no new calls are allowed to IRadio.SetupDataCall that + * use the same APN. When IRadioIndication.unthrottleApn is sent, AOSP will no longer throttle + * calls to IRadio.SetupDataCall for the given APN. + * + * @param type Type of radio indication + * @param apn Apn to unthrottle + */ + oneway void unthrottleApn(in RadioIndicationType type, in String apn); + + /** + * Indicates that voice technology has changed. Responds with new rat. + * + * @param type Type of radio indication + * @param rat Current new voice rat + */ + oneway void voiceRadioTechChanged(in RadioIndicationType type, in RadioTechnology rat); +} diff --git a/radio/aidl/android/hardware/radio/IRadioResponse.aidl b/radio/aidl/android/hardware/radio/IRadioResponse.aidl new file mode 100644 index 0000000000..9ae6495aa5 --- /dev/null +++ b/radio/aidl/android/hardware/radio/IRadioResponse.aidl @@ -0,0 +1,3055 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.ActivityStatsInfo; +import android.hardware.radio.BarringInfo; +import android.hardware.radio.Call; +import android.hardware.radio.CallForwardInfo; +import android.hardware.radio.CardStatus; +import android.hardware.radio.CarrierRestrictions; +import android.hardware.radio.CarrierRestrictionsWithPriority; +import android.hardware.radio.CdmaBroadcastSmsConfigInfo; +import android.hardware.radio.CdmaRoamingType; +import android.hardware.radio.CdmaSubscriptionSource; +import android.hardware.radio.CellIdentity; +import android.hardware.radio.CellInfo; +import android.hardware.radio.ClipStatus; +import android.hardware.radio.DataRegStateResult; +import android.hardware.radio.GsmBroadcastSmsConfigInfo; +import android.hardware.radio.HardwareConfig; +import android.hardware.radio.IccIoResult; +import android.hardware.radio.KeepaliveStatus; +import android.hardware.radio.LastCallFailCauseInfo; +import android.hardware.radio.LceDataInfo; +import android.hardware.radio.LceStatusInfo; +import android.hardware.radio.NeighboringCell; +import android.hardware.radio.OperatorInfo; +import android.hardware.radio.PersoSubstate; +import android.hardware.radio.PhonebookCapacity; +import android.hardware.radio.PreferredNetworkType; +import android.hardware.radio.RadioAccessFamily; +import android.hardware.radio.RadioAccessSpecifier; +import android.hardware.radio.RadioBandMode; +import android.hardware.radio.RadioCapability; +import android.hardware.radio.RadioResponseInfo; +import android.hardware.radio.RadioTechnology; +import android.hardware.radio.RadioTechnologyFamily; +import android.hardware.radio.RegStateResult; +import android.hardware.radio.SendSmsResult; +import android.hardware.radio.SetupDataCallResult; +import android.hardware.radio.SignalStrength; +import android.hardware.radio.SimLockMultiSimPolicy; +import android.hardware.radio.SlicingConfig; +import android.hardware.radio.TtyMode; +import android.hardware.radio.VoiceRegStateResult; + +/** + * Interface declaring response functions to solicited radio requests. + */ +@VintfStability +interface IRadioResponse { + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_CALL_ID + * RadioError:INVALID_ARGUMENTS + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void acceptCallResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void acknowledgeIncomingGsmSmsWithPduResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_SMS_TO_ACK + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:REQUEST_RATE_LIMITED + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:NETWORK_NOT_READY + * RadioError:INVALID_MODEM_STATE + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void acknowledgeLastIncomingCdmaSmsResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void acknowledgeLastIncomingGsmSmsResponse(in RadioResponseInfo info); + + /** + * Acknowledge the receipt of radio request sent to the vendor. This must be sent only for + * radio request which take long time to respond. For more details, refer + * https://source.android.com/devices/tech/connect/ril.html + * + * @param serial Serial no. of the request whose acknowledgement is sent. + */ + oneway void acknowledgeRequest(in int serial); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param id The allocated id. On an error, this is set to 0. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_RESOURCES- Indicates that no pdu session ids are available + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void allocatePduSessionIdResponse(in RadioResponseInfo info, in int id); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param enabled whether Uicc applications are enabled. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:SIM_ABSENT + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + */ + oneway void areUiccApplicationsEnabledResponse(in RadioResponseInfo info, in boolean enabled); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param dcResponse Attributes of data call + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_RESOURCES + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_CALL_ID + */ + oneway void cancelHandoverResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SIM_BUSY + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:INVALID_STATE + * RadioError:INVALID_ARGUMENTS + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void cancelPendingUssdResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:PASSWORD_INCORRECT (old PIN2 is invalid) + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_SIM_STATE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:SIM_PUK2 + */ + oneway void changeIccPin2ForAppResponse(in RadioResponseInfo info, in int remainingRetries); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:PASSWORD_INCORRECT + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_SIM_STATE + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void changeIccPinForAppResponse(in RadioResponseInfo info, in int remainingRetries); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_STATE + * RadioError:INVALID_CALL_ID + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:INVALID_ARGUMENTS + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void conferenceResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:REQUEST_NOT_SUPPORTED may be returned when HAL 1.2 or higher is supported. + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_CALL_ID + * RadioError:INVALID_STATE + * RadioError:INVALID_ARGUMENTS + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + */ + oneway void deactivateDataCallResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:NO_SUCH_ENTRY + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:SIM_ABSENT + */ + oneway void deleteSmsOnRuimResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SIM_FULL + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:NO_SUCH_ENTRY + * RadioError:INTERNAL_ERR + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + * RadioError:SIM_ABSENT + */ + oneway void deleteSmsOnSimResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:DIAL_MODIFIED_TO_USSD + * RadioError:DIAL_MODIFIED_TO_SS + * RadioError:DIAL_MODIFIED_TO_DIAL + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:INVALID_STATE + * RadioError:NO_RESOURCES + * RadioError:INTERNAL_ERR + * RadioError:FDN_CHECK_FAILURE + * RadioError:MODEM_ERR + * RadioError:NO_SUBSCRIPTION + * RadioError:NO_NETWORK_FOUND + * RadioError:INVALID_CALL_ID + * RadioError:DEVICE_IN_USE + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:ABORTED + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:CANCELLED + */ + oneway void dialResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:DIAL_MODIFIED_TO_USSD + * RadioError:DIAL_MODIFIED_TO_SS + * RadioError:DIAL_MODIFIED_TO_DIAL + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + * RadioError:INTERNAL_ERR + * RadioError:FDN_CHECK_FAILURE + * RadioError:MODEM_ERR + * RadioError:NO_SUBSCRIPTION + * RadioError:NO_NETWORK_FOUND + * RadioError:INVALID_CALL_ID + * RadioError:DEVICE_IN_USE + * RadioError:ABORTED + * RadioError:INVALID_MODEM_STATE + */ + oneway void emergencyDialResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:MODEM_ERR + * RadioError:INVALID_STATE: this is for the case that the API is called in a single-sim + * mode, or when there is only one modem available, as this API should only + * be called in multi sim status. + */ + oneway void enableModemResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:SIM_ABSENT + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:BUSY + */ + oneway void enableUiccApplicationsResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:OPERATION_NO_ALLOWED + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + */ + oneway void exitEmergencyCallbackModeResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_STATE + * RadioError:NO_RESOURCES + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_CALL_ID + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void explicitCallTransferResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param carriers Carrier restriction information. + * @param multiSimPolicy Policy used for devices with multiple SIM cards. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void getAllowedCarriersResponse(in RadioResponseInfo info, + in CarrierRestrictionsWithPriority carriers, in SimLockMultiSimPolicy multiSimPolicy); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param networkTypeBitmap a 32-bit bitmap of RadioAccessFamily. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:MODE_NOT_SUPPORTED + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + */ + oneway void getAllowedNetworkTypesBitmapResponse( + in RadioResponseInfo info, in RadioAccessFamily networkTypeBitmap); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param bandModes List of RadioBandMode listing supported modes + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getAvailableBandModesResponse( + in RadioResponseInfo info, in RadioBandMode[] bandModes); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param networkInfos List of network operator information as OperatorInfos defined in + * types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:ABORTED + * RadioError:DEVICE_IN_USE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:CANCELLED + * RadioError:NO_RESOURCES + * RadioError:INTERNAL_ERR + */ + oneway void getAvailableNetworksResponse( + in RadioResponseInfo info, in OperatorInfo[] networkInfos); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param cellIdentity CellIdentity for the barring infos. + * @param barringInfos a vector of barring info for all barring service types + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:MODEM_ERR + */ + oneway void getBarringInfoResponse( + in RadioResponseInfo info, in CellIdentity cellIdentity, in BarringInfo[] barringInfos); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param version string containing version string for log reporting + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:EMPTY_RECORD + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:NOT_PROVISIONED + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getBasebandVersionResponse(in RadioResponseInfo info, in String version); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param mdn MDN if CDMA subscription is available + * @param hSid is a comma separated list of H_SID (Home SID) if CDMA subscription is available, + * in decimal format + * @param hNid is a comma separated list of H_NID (Home NID) if CDMA subscription is available, + * in decimal format + * @param min MIN (10 digits, MIN2+MIN1) if CDMA subscription is available + * @param prl PRL version if CDMA subscription is available + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SUBSCRIPTION_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:NOT_PROVISIONED + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + */ + oneway void getCDMASubscriptionResponse(in RadioResponseInfo info, in String mdn, + in String hSid, in String hNid, in String min, in String prl); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param callForwardInfos points to a vector of CallForwardInfo, one for each distinct + * registered phone number. For example, if data is forwarded to +18005551212 and voice + * is forwarded to +18005559999, then two separate CallForwardInfo's must be returned. + * However, if both data and voice are forwarded to +18005551212, then a single + * CallForwardInfo must be returned with the service class set to "data + voice = 3". + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SS_MODIFIED_TO_DIAL + * RadioError:SS_MODIFIED_TO_USSD + * RadioError:SS_MODIFIED_TO_SS + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:FDN_CHECK_FAILURE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:SYSTEM_ERR + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getCallForwardStatusResponse( + in RadioResponseInfo info, in CallForwardInfo[] callForwardInfos); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param enable If current call waiting state is disabled, enable = false else true + * @param serviceClass If enable, then callWaitingResp[1] must follow, with the TS 27.007 + * service class bit vector of services for which call waiting is enabled. For example, + * if callWaitingResp[0] is 1 and callWaitingResp[1] is 3, then call waiting is enabled + * for data and voice and disabled for everything else. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SS_MODIFIED_TO_DIAL + * RadioError:SS_MODIFIED_TO_USSD + * RadioError:SS_MODIFIED_TO_SS + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:FDN_CHECK_FAILURE + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getCallWaitingResponse( + in RadioResponseInfo info, in boolean enable, in int serviceClass); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param configs Vector of CDMA Broadcast SMS configs. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:REQUEST_RATE_LIMITED + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:NO_RESOURCES + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + */ + oneway void getCdmaBroadcastConfigResponse( + in RadioResponseInfo info, in CdmaBroadcastSmsConfigInfo[] configs); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param type CdmaRoamingType defined in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + */ + oneway void getCdmaRoamingPreferenceResponse( + in RadioResponseInfo info, in CdmaRoamingType type); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param source CDMA subscription source + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SUBSCRIPTION_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:SIM_ABSENT + */ + oneway void getCdmaSubscriptionSourceResponse( + in RadioResponseInfo info, in CdmaSubscriptionSource source); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param cellInfo List of current cell information known to radio + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + */ + oneway void getCellInfoListResponse(in RadioResponseInfo info, in CellInfo[] cellInfo); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param status indicates CLIP status + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:FDN_CHECK_FAILURE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getClipResponse(in RadioResponseInfo info, in ClipStatus status); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param n is "n" parameter from TS 27.007 7.7 + * @param m is "m" parameter from TS 27.007 7.7 + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SS_MODIFIED_TO_DIAL + * RadioError:SS_MODIFIED_TO_USSD + * RadioError:SS_MODIFIED_TO_SS + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:FDN_CHECK_FAILURE + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getClirResponse(in RadioResponseInfo info, in int n, in int m); + + /** + * @param info Response info struct containing respontype, serial no. and error + * @param calls Current call list + * + * Valid errors returned: + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getCurrentCallsResponse(in RadioResponseInfo info, in Call[] calls); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param dcResponse List of SetupDataCallResult as defined in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:SIM_ABSENT + */ + oneway void getDataCallListResponse( + in RadioResponseInfo info, in SetupDataCallResult[] dcResponse); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param dataRegResponse Current Data registration response as defined by RegStateResult in + * types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NOT_PROVISIONED + */ + oneway void getDataRegistrationStateResponse( + in RadioResponseInfo info, in RegStateResult dataRegResponse); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param imei IMEI if GSM subscription is available + * @param imeisv IMEISV if GSM subscription is available + * @param esn ESN if CDMA subscription is available + * @param meid MEID if CDMA subscription is available + * + * If a empty string value is returned for any of the device id, it means that there was error + * accessing the device. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:NOT_PROVISIONED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void getDeviceIdentityResponse(in RadioResponseInfo info, in String imei, + in String imeisv, in String esn, in String meid); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param response 0 is the TS 27.007 service class bit vector of services for which the + * specified barring facility is active. "0" means "disabled for all" + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SS_MODIFIED_TO_DIAL + * RadioError:SS_MODIFIED_TO_USSD + * RadioError:SS_MODIFIED_TO_SS + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:FDN_CHECK_FAILURE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getFacilityLockForAppResponse(in RadioResponseInfo info, in int response); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param configs Vector of GSM/WCDMA Cell broadcast configs + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:REQUEST_RATE_LIMITED + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:NO_RESOURCES + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + */ + oneway void getGsmBroadcastConfigResponse( + in RadioResponseInfo info, in GsmBroadcastSmsConfigInfo[] configs); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param config Array of HardwareConfig of the radio. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void getHardwareConfigResponse(in RadioResponseInfo info, in HardwareConfig[] config); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param imsi String containing the IMSI + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_SIM_STATE + * RadioError:SIM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void getIMSIForAppResponse(in RadioResponseInfo info, in String imsi); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param cardStatus ICC card status as defined by CardStatus in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_RESOURCES + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void getIccCardStatusResponse(in RadioResponseInfo info, in CardStatus cardStatus); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param isRegistered false = not registered, true = registered + * @param ratFamily RadioTechnologyFamily as defined in types.hal. This value is valid only if + * isRegistered is true. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void getImsRegistrationStateResponse( + in RadioResponseInfo info, in boolean isRegistered, in RadioTechnologyFamily ratFamily); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param failCauseInfo Contains LastCallFailCause and vendor cause code. + * + * The vendor cause code must be used for debugging purpose only. The implementation must return + * one of the values of LastCallFailCause as mentioned below. + * GSM failure reasons codes for the cause codes defined in TS 24.008 Annex H where possible. + * CDMA failure reasons codes for the possible call failure scenarios described in the + * "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard. + * Any of the following reason codes if the call is failed or dropped due to reason mentioned + * with in the braces. + * LastCallFailCause:RADIO_OFF (Radio is OFF) + * LastCallFailCause:OUT_OF_SERVICE (No cell coverage) + * LastCallFailCause:NO_VALID_SIM (No valid SIM) + * LastCallFailCause:RADIO_INTERNAL_ERROR (Modem hit unexpected error scenario) + * LastCallFailCause:NETWORK_RESP_TIMEOUT (No response from network) + * LastCallFailCause:NETWORK_REJECT (Explicit network reject) + * LastCallFailCause:RADIO_ACCESS_FAILURE (RRC connection failure. Eg.RACH) + * LastCallFailCause:RADIO_LINK_FAILURE (Radio Link Failure) + * LastCallFailCause:RADIO_LINK_LOST (Radio link lost due to poor coverage) + * LastCallFailCause:RADIO_UPLINK_FAILURE (Radio uplink failure) + * LastCallFailCause:RADIO_SETUP_FAILURE (RRC connection setup failure) + * LastCallFailCause:RADIO_RELEASE_NORMAL (RRC connection release, normal) + * LastCallFailCause:RADIO_RELEASE_ABNORMAL (RRC connection release, abnormal) + * LastCallFailCause:ACCESS_CLASS_BLOCKED (Access class barring) + * LastCallFailCause:NETWORK_DETACH (Explicit network detach) + * OEM causes (LastCallFailCause:OEM_CAUSE_XX) must be used for debug purpose only + * + * If the implementation does not have access to the exact cause codes, then it must return one + * of the values listed in LastCallFailCause, as the UI layer needs to distinguish these cases + * for tone generation or error notification. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:NO_MEMORY + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:INTERNAL_ERR + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getLastCallFailCauseResponse( + in RadioResponseInfo info, in LastCallFailCauseInfo failCauseinfo); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param activityInfo modem activity information + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:NOT_PROVISIONED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void getModemActivityInfoResponse( + in RadioResponseInfo info, in ActivityStatsInfo activityInfo); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:MODEM_ERR + */ + oneway void getModemStackStatusResponse(in RadioResponseInfo info, in boolean isEnabled); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param enable true for "mute enabled" and false for "mute disabled" + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SS_MODIFIED_TO_DIAL + * RadioError:SS_MODIFIED_TO_USSD + * RadioError:SS_MODIFIED_TO_SS + * RadioError:NO_MEMORY + * RadioError:REQUEST_RATE_LIMITED + * RadioError:INVALID_ARGUMENTS + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getMuteResponse(in RadioResponseInfo info, in boolean enable); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param cells Vector of neighboring radio cell + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:NO_NETWORK_FOUND + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getNeighboringCidsResponse(in RadioResponseInfo info, in NeighboringCell[] cells); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param selection false for automatic selection, true for manual selection + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getNetworkSelectionModeResponse(in RadioResponseInfo info, in boolean manual); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param longName is long alpha ONS or EONS or empty string if unregistered + * @param shortName is short alpha ONS or EONS or empty string if unregistered + * @param numeric is 5 or 6 digit numeric code (MCC + MNC) or empty string if unregistered + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getOperatorResponse( + in RadioResponseInfo info, in String longName, in String shortName, in String numeric); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param networkTypeBitmap a 32-bit bitmap of RadioAccessFamily. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + */ + oneway void getPreferredNetworkTypeBitmapResponse( + in RadioResponseInfo info, in RadioAccessFamily networkTypeBitmap); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param nwType RadioPreferredNetworkType defined in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getPreferredNetworkTypeResponse( + in RadioResponseInfo info, in PreferredNetworkType nwType); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param enable false for Standard Privacy Mode (Public Long Code Mask) + * true for Enhanced Privacy Mode (Private Long Code Mask) + * + * Valid errors: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getPreferredVoicePrivacyResponse(in RadioResponseInfo info, in boolean enable); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param rc Radio capability as defined by RadioCapability in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:INVALID_STATE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getRadioCapabilityResponse(in RadioResponseInfo info, in RadioCapability rc); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param signalStrength Current signal strength + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + */ + oneway void getSignalStrengthResponse( + in RadioResponseInfo info, in SignalStrength signalStrength); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param capacity Response capacity enum indicating response processing status + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_SIM_STATE + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * REQUEST_NOT_SUPPORTED may only be returned on devices that don't support this API, + * indicated by the HAL capability CAPABILITY_SIM_PHONEBOOK_IN_MODEM. + */ + oneway void getSimPhonebookCapacityResponse( + in RadioResponseInfo info, in PhonebookCapacity capacity); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_SIM_STATE + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * REQUEST_NOT_SUPPORTED may only be returned on devices that don't support this API, + * indicated by the HAL capability CAPABILITY_SIM_PHONEBOOK_IN_MODEM. + */ + oneway void getSimPhonebookRecordsResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param slicingConfig Current slicing configuration + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:MODEM_ERR + */ + oneway void getSlicingConfigResponse(in RadioResponseInfo info, in SlicingConfig slicingConfig); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param smsc Short Message Service Center address on the device + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_RATE_LIMITED + * RadioError:MODEM_ERR + * RadioError:INVALID_MODEM_STATE + * RadioError:NOT_PROVISIONED + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + */ + oneway void getSmscAddressResponse(in RadioResponseInfo info, in String smsc); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param specifiers List of RadioAccessSpecifiers that are scanned. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + */ + oneway void getSystemSelectionChannelsResponse( + in RadioResponseInfo info, in RadioAccessSpecifier[] specifiers); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param mode TtyMode + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void getTTYModeResponse(in RadioResponseInfo info, in TtyMode mode); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param rat Current voice RAT + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void getVoiceRadioTechnologyResponse(in RadioResponseInfo info, in RadioTechnology rat); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param voiceRegResponse Current Voice registration response as defined by RegStateResult + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + */ + oneway void getVoiceRegistrationStateResponse( + in RadioResponseInfo info, in RegStateResult voiceRegResponse); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:SIM_ABSENT + */ + oneway void handleStkCallSetupRequestFromSimResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:INVALID_STATE + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_CALL_ID + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void hangupConnectionResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_CALL_ID + * RadioError:NO_RESOURCES + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:INVALID_ARGUMENTS + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void hangupForegroundResumeBackgroundResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_CALL_ID + * RadioError:NO_RESOURCES + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:INVALID_ARGUMENTS + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:CANCELLED + */ + oneway void hangupWaitingOrBackgroundResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void iccCloseLogicalChannelResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param iccIo ICC io operation response as defined by IccIoResult in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SIM_PIN2 + * RadioError:SIM_PUK2 + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_SIM_STATE + * RadioError:SIM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void iccIOForAppResponse(in RadioResponseInfo info, in IccIoResult iccIo); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param channelId session id of the logical channel. + * @param selectResponse Contains the select response for the open channel command with one + * byte per integer + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:MISSING_RESOURCE + * RadioError:NO_SUCH_ELEMENT + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ERR + * RadioError:INVALID_SIM_STATE + * RadioError:MISSING_RESOURCE + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void iccOpenLogicalChannelResponse( + in RadioResponseInfo info, in int channelId, in byte[] selectResponse); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param result IccIoResult as defined in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void iccTransmitApduBasicChannelResponse( + in RadioResponseInfo info, in IccIoResult result); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param result IccIoResult as defined in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void iccTransmitApduLogicalChannelResponse( + in RadioResponseInfo info, in IccIoResult result); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param isEnabled Indicates whether NR dual connectivity is enabled or not, True if enabled + * else false. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void isNrDualConnectivityEnabledResponse( + in RadioResponseInfo info, in boolean isEnabled); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param result string containing the contents of the NV item + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void nvReadItemResponse(in RadioResponseInfo info, in String result); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void nvResetConfigResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void nvWriteCdmaPrlResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void nvWriteItemResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param lceInfo LceDataInfo indicating LCE data + * + * Valid errors returned: + * RadioError:REQUEST_NOT_SUPPORTED may be returned when HAL 1.2 or higher is supported. + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:LCE_NOT_SUPPORTED + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + */ + oneway void pullLceDataResponse(in RadioResponseInfo info, in LceDataInfo lceInfo); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:INVALID_STATE + * RadioError:NO_RESOURCES + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_CALL_ID + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:INVALID_ARGUMENTS + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void rejectCallResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_RESOURCES + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void releasePduSessionIdResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_RATE_LIMITED + * RadioError:MODEM_ERR + * RadioError:INVALID_STATE + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + */ + oneway void reportSmsMemoryStatusResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void reportStkServiceIsRunningResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param result IccIoResult as defined in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + * RadioError:SIM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void requestIccSimAuthenticationResponse( + in RadioResponseInfo info, in IccIoResult result); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param response response string of the challenge/response algo for ISIM auth in base64 format + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + * RadioError:INVALID_ARGUMENTS + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:SIM_ABSENT + */ + oneway void requestIsimAuthenticationResponse(in RadioResponseInfo info, in String response); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void requestShutdownResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INVALID_CALL_ID + * RadioError:INVALID_STATE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + * RadioError:OPERATION_NOT_ALLOWED + */ + oneway void sendBurstDtmfResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INVALID_CALL_ID + * RadioError:INVALID_STATE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:OPERATION_NOT_ALLOWED + */ + oneway void sendCDMAFeatureCodeResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param sms Response to sms sent as defined by SendSmsResult in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SMS_SEND_FAIL_RETRY + * RadioError:NETWORK_REJECT + * RadioError:INVALID_STATE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:REQUEST_RATE_LIMITED + * RadioError:INVALID_SMS_FORMAT + * RadioError:SYSTEM_ERR + * RadioError:FDN_CHECK_FAILURE + * RadioError:ENCODING_ERR + * RadioError:INVALID_SMSC_ADDRESS + * RadioError:MODEM_ERR + * RadioError:NETWORK_ERR + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NETWORK_NOT_READY + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + * RadioError:SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED + * RadioError:ACCESS_BARRED + * RadioError:BLOCKED_DUE_TO_CALL + */ + oneway void sendCdmaSmsExpectMoreResponse(in RadioResponseInfo info, in SendSmsResult sms); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param sms Sms result struct as defined by SendSmsResult in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:SMS_SEND_FAIL_RETRY + * RadioError:NETWORK_REJECT + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:REQUEST_RATE_LIMITED + * RadioError:INVALID_SMS_FORMAT + * RadioError:SYSTEM_ERR + * RadioError:FDN_CHECK_FAILURE + * RadioError:MODEM_ERR + * RadioError:NETWORK_ERR + * RadioError:ENCODING_ERR + * RadioError:INVALID_SMSC_ADDRESS + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:ENCODING_ERR + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + * RadioError:SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED + * RadioError:ACCESS_BARRED + * RadioError:BLOCKED_DUE_TO_CALL + */ + oneway void sendCdmaSmsResponse(in RadioResponseInfo info, in SendSmsResult sms); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void sendDeviceStateResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:INVALID_CALL_ID + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + */ + oneway void sendDtmfResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param commandResponse SAT/USAT response in hexadecimal format string starting with first + * byte of response + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SIM_BUSY + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:SIM_ABSENT + */ + oneway void sendEnvelopeResponse(in RadioResponseInfo info, in String commandResponse); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param iccIo IccIoResult as defined in types.hal corresponding to ICC IO response + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SIM_BUSY + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:SIM_ABSENT + */ + oneway void sendEnvelopeWithStatusResponse(in RadioResponseInfo info, in IccIoResult iccIo); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param sms Response to sms sent as defined by SendSmsResult in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SMS_SEND_FAIL_RETRY + * RadioError:FDN_CHECK_FAILURE + * RadioError:NETWORK_REJECT + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:INVALID_SMS_FORMAT + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_RATE_LIMITED + * RadioError:MODEM_ERR + * RadioError:NETWORK_ERR + * RadioError:ENCODING_ERR + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NETWORK_NOT_READY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void sendImsSmsResponse(in RadioResponseInfo info, in SendSmsResult sms); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param sms Response to sms sent as defined by SendSmsResult in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SMS_SEND_FAIL_RETRY + * RadioError:NETWORK_REJECT + * RadioError:INVALID_STATE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:REQUEST_RATE_LIMITED + * RadioError:INVALID_SMS_FORMAT + * RadioError:SYSTEM_ERR + * RadioError:FDN_CHECK_FAILURE + * RadioError:ENCODING_ERR + * RadioError:INVALID_SMSC_ADDRESS + * RadioError:MODEM_ERR + * RadioError:NETWORK_ERR + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NETWORK_NOT_READY + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + */ + oneway void sendSMSExpectMoreResponse(in RadioResponseInfo info, in SendSmsResult sms); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param sms Response to sms sent as defined by SendSmsResult in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SMS_SEND_FAIL_RETRY + * RadioError:NETWORK_REJECT + * RadioError:INVALID_STATE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:REQUEST_RATE_LIMITED + * RadioError:INVALID_SMS_FORMAT + * RadioError:SYSTEM_ERR + * RadioError:FDN_CHECK_FAILURE + * RadioError:ENCODING_ERR + * RadioError:INVALID_SMSC_ADDRESS + * RadioError:MODEM_ERR + * RadioError:NETWORK_ERR + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NETWORK_NOT_READY + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + * RadioError:ACCESS_BARRED + * RadioError:BLOCKED_DUE_TO_CALL + */ + oneway void sendSmsExpectMoreResponse(in RadioResponseInfo info, in SendSmsResult sms); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param sms Response to sms sent as defined by SendSmsResult in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SMS_SEND_FAIL_RETRY + * RadioError:NETWORK_REJECT + * RadioError:INVALID_STATE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:REQUEST_RATE_LIMITED + * RadioError:INVALID_SMS_FORMAT + * RadioError:SYSTEM_ERR + * RadioError:ENCODING_ERR + * RadioError:INVALID_SMSC_ADDRESS + * RadioError:MODEM_ERR + * RadioError:NETWORK_ERR + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NETWORK_NOT_READY + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + * RadioError:ACCESS_BARRED + * RadioError:BLOCKED_DUE_TO_CALL + */ + oneway void sendSmsResponse(in RadioResponseInfo info, in SendSmsResult sms); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:SIM_ABSENT + */ + oneway void sendTerminalResponseToSimResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:FDN_CHECK_FAILURE + * RadioError:USSD_MODIFIED_TO_DIAL + * RadioError:USSD_MODIFIED_TO_SS + * RadioError:USSD_MODIFIED_TO_USSD + * RadioError:SIM_BUSY + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:ABORTED + * RadioError:SYSTEM_ERR + * RadioError:INVALID_STATE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void sendUssdResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_STATE + * RadioError:NO_RESOURCES + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:SYSTEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_CALL_ID + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:CANCELLED + */ + oneway void separateConnectionResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void setAllowedCarriersResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:MODE_NOT_SUPPORTED + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + */ + oneway void setAllowedNetworkTypesBitmapResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void setBandModeResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SS_MODIFIED_TO_DIAL + * RadioError:SS_MODIFIED_TO_USSD + * RadioError:SS_MODIFIED_TO_SS + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:FDN_CHECK_FAILURE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void setBarringPasswordResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SS_MODIFIED_TO_DIAL + * RadioError:SS_MODIFIED_TO_USSD + * RadioError:SS_MODIFIED_TO_SS + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_STATE + * RadioError:FDN_CHECK_FAILURE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void setCallForwardResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SS_MODIFIED_TO_DIAL + * RadioError:SS_MODIFIED_TO_USSD + * RadioError:SS_MODIFIED_TO_SS + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_STATE + * RadioError:FDN_CHECK_FAILURE + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void setCallWaitingResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:RIL_E_SUCCESS + * RadioError:RIL_E_RADIO_NOT_AVAILABLE + * RadioError:SIM_ABSENT + * RadioError:RIL_E_REQUEST_NOT_SUPPORTED + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_INTERNAL_FAILURE + */ + oneway void setCarrierInfoForImsiEncryptionResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:REQUEST_RATE_LIMITED + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + */ + oneway void setCdmaBroadcastActivationResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:REQUEST_RATE_LIMITED + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + */ + oneway void setCdmaBroadcastConfigResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + */ + oneway void setCdmaRoamingPreferenceResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SIM_ABSENT + * RadioError:SUBSCRIPTION_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void setCdmaSubscriptionSourceResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void setCellInfoListRateResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:INVALID_ARGUMENTS + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SS_MODIFIED_TO_DIAL + * RadioError:SS_MODIFIED_TO_USSD + * RadioError:SS_MODIFIED_TO_SS + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void setClirResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:DEVICE_IN_USE + * RadioError:INVALID_MODEM_STATE + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void setDataAllowedResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SUBSCRIPTION_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:SIM_ABSENT + */ + oneway void setDataProfileResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:MODEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void setDataThrottlingResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param retry 0 is the number of retries remaining, or -1 if unknown + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SS_MODIFIED_TO_DIAL + * RadioError:SS_MODIFIED_TO_USSD + * RadioError:SS_MODIFIED_TO_SS + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_STATE + * RadioError:FDN_CHECK_FAILURE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void setFacilityLockForAppResponse(in RadioResponseInfo info, in int retry); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:REQUEST_RATE_LIMITED + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + */ + oneway void setGsmBroadcastActivationResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:REQUEST_RATE_LIMITED + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + */ + oneway void setGsmBroadcastConfigResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:INVALID_ARGUMENTS + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + */ + oneway void setIndicationFilterResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SUBSCRIPTION_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:NOT_PROVISIONED + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void setInitialAttachApnResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:INVALID_ARGUMENTS + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + */ + oneway void setLinkCapacityReportingCriteriaResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + */ + oneway void setLocationUpdatesResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:REQUEST_RATE_LIMITED + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void setMuteResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:ILLEGAL_SIM_OR_ME + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * + * Returns RadioError:ILLEGAL_SIM_OR_ME when the failure is permanent and + * no retries needed, such as illegal SIM or ME. + */ + oneway void setNetworkSelectionModeAutomaticResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:ILLEGAL_SIM_OR_ME + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * + * Returns RadioError:ILLEGAL_SIM_OR_ME when the failure is permanent and + * no retries needed, such as illegal SIM or ME. + */ + oneway void setNetworkSelectionModeManualResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_STATE + */ + oneway void setNrDualConnectivityStateResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:MODE_NOT_SUPPORTED + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + */ + oneway void setPreferredNetworkTypeBitmapResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:MODE_NOT_SUPPORTED + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void setPreferredNetworkTypeResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_CALL_ID + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void setPreferredVoicePrivacyResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param rc Radio capability as defined by RadioCapability in types.hal used to + * feedback return status + * + * Valid errors returned: + * RadioError:NONE means a unsol radioCapability() will be sent within 30 seconds. + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:INVALID_STATE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void setRadioCapabilityResponse(in RadioResponseInfo info, in RadioCapability rc); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:RF_HARDWARE_ISSUE + * RadioError:NO_RF_CALIBRATION_INFO + */ + oneway void setRadioPowerResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:INVALID_ARGUMENTS + * RadioError:RADIO_NOT_AVAILABLE + */ + oneway void setSignalStrengthReportingCriteriaResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:SIM_ERR (indicates a timeout or other issue making the SIM unresponsive) + */ + oneway void setSimCardPowerResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_SMS_FORMAT + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_RATE_LIMITED + * RadioError:MODEM_ERR + * RadioError:NO_RESOURCES + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + */ + oneway void setSmscAddressResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:SIM_BUSY + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + */ + oneway void setSuppServiceNotificationsResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + */ + oneway void setSystemSelectionChannelsResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void setTTYModeResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SUBSCRIPTION_NOT_SUPPORTED + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void setUiccSubscriptionResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param dcResponse SetupDataCallResult defined in types.hal + * + * Valid errors returned: + * 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. + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:OP_NOT_ALLOWED_BEFORE_REG_TO_NW + * RadioError:OP_NOT_ALLOWED_DURING_VOICE_CALL + * RadioError:INVALID_ARGUMENTS + * RadioError:INTERNAL_ERR + * RadioError:NO_RESOURCES if the vendor is unable handle due to resources are full. + * RadioError:SIM_ABSENT + */ + oneway void setupDataCallResponse(in RadioResponseInfo info, in SetupDataCallResult dcResponse); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + * RadioError:NO_MEMORY + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_CALL_ID + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + */ + oneway void startDtmfResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NO_RESOURCES + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_CALL_ID + */ + oneway void startHandoverResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param status Status object containing a new handle and a current status. The status returned + * here may be PENDING to indicate that the radio has not yet processed the keepalive + * request. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:NO_RESOURCES + * RadioError:INVALID_ARGUMENTS + */ + oneway void startKeepaliveResponse(in RadioResponseInfo info, in KeepaliveStatus status); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param statusInfo LceStatusInfo indicating LCE status + * + * Valid errors returned: + * RadioError:REQUEST_NOT_SUPPORTED may be returned when HAL 1.2 or higher is supported. + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:LCE_NOT_SUPPORTED + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void startLceServiceResponse(in RadioResponseInfo info, in LceStatusInfo statusInfo); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:DEVICE_IN_USE + * RadioError:INTERNAL_ERR + * RadioError:MODEM_ERR + * RadioError:INVALID_ARGUMENTS + */ + oneway void startNetworkScanResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + * RadioError:NO_MEMORY + * RadioError:INVALID_ARGUMENTS + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_CALL_ID + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + */ + oneway void stopDtmfResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:INVALID_ARGUMENTS + */ + oneway void stopKeepaliveResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param statusInfo LceStatusInfo indicating LCE status + * + * Valid errors returned: + * RadioError:REQUEST_NOT_SUPPORTED may be returned when HAL 1.2 or higher is supported. + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:LCE_NOT_SUPPORTED + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:SIM_ABSENT + */ + oneway void stopLceServiceResponse(in RadioResponseInfo info, in LceStatusInfo statusInfo); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:INTERNAL_ERR + * RadioError:MODEM_ERR + */ + oneway void stopNetworkScanResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:PASSWORD_INCORRECT + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_SIM_STATE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:SIM_PUK2 + */ + oneway void supplyIccPin2ForAppResponse(in RadioResponseInfo info, in int remainingRetries); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:PASSWORD_INCORRECT + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_SIM_STATE + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void supplyIccPinForAppResponse(in RadioResponseInfo info, in int remainingRetries); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:PASSWORD_INCORRECT (PUK is invalid) + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_SIM_STATE + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void supplyIccPuk2ForAppResponse(in RadioResponseInfo info, in int remainingRetries); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:PASSWORD_INCORRECT (PUK is invalid) + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_SIM_STATE + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void supplyIccPukForAppResponse(in RadioResponseInfo info, in int remainingRetries); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param remainingRetries Number of retries remaining, must be equal to -1 if unknown. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:PASSWORD_INCORRECT (code is invalid) + * RadioError:NO_MEMORY + * RadioError:INVALID_SIM_STATE + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:SIM_ABSENT + */ + oneway void supplyNetworkDepersonalizationResponse( + in RadioResponseInfo info, in int remainingRetries); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param persoType SIM Personalisation type + * @param remainingRetries postiive values indicates number of retries remaining, must be equal + * to -1 if number of retries is infinite. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:PASSWORD_INCORRECT (code is invalid) + * RadioError:NO_MEMORY + * RadioError:INVALID_SIM_STATE + * RadioError:INTERNAL_ERR + * RadioError:SYSTEM_ERR + * RadioError:MODEM_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_RESOURCES + * RadioError:REQUEST_NOT_SUPPORTED + */ + oneway void supplySimDepersonalizationResponse( + in RadioResponseInfo info, in PersoSubstate persoType, in int remainingRetries); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE (radio resetting) + * RadioError:INVALID_STATE + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:INVALID_STATE + * RadioError:INVALID_CALL_ID + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:INVALID_ARGUMENTS + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + oneway void switchWaitingOrHoldingAndActiveResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param updatedRecordIndex The index of the updated or inserted record in the phonebook and + * the minimum value is 1 + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_SIM_STATE + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:SIM_ERR + * RadioError:NO_SUCH_ENTRY + * RadioError:NO_RESOURCES + * REQUEST_NOT_SUPPORTED may only be returned on devices that don't support this API, + * indicated by the HAL capability CAPABILITY_SIM_PHONEBOOK_IN_MODEM. + */ + oneway void updateSimPhonebookRecordsResponse( + in RadioResponseInfo info, in int updatedRecordIndex); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param index record index where the cmda sms message is stored + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_SMS_FORMAT + * RadioError:SIM_FULL + * RadioError:INTERNAL_ERR + * RadioError:MODEM_ERR + * RadioError:ENCODING_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:INVALID_MODEM_STATE + * RadioError:INVALID_SMSC_ADDRESS + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + * RadioError:SIM_ABSENT + */ + oneway void writeSmsToRuimResponse(in RadioResponseInfo info, in int index); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param index record index where the message is stored + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SIM_FULL + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_SMS_FORMAT + * RadioError:INTERNAL_ERR + * RadioError:MODEM_ERR + * RadioError:ENCODING_ERR + * RadioError:NO_MEMORY + * RadioError:NO_RESOURCES + * RadioError:INVALID_MODEM_STATE + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:INVALID_SMSC_ADDRESS + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:CANCELLED + * RadioError:INVALID_MODEM_STATE + * RadioError:SIM_ABSENT + */ + oneway void writeSmsToSimResponse(in RadioResponseInfo info, in int index); +} diff --git a/radio/aidl/android/hardware/radio/ISap.aidl b/radio/aidl/android/hardware/radio/ISap.aidl new file mode 100644 index 0000000000..55950fd26e --- /dev/null +++ b/radio/aidl/android/hardware/radio/ISap.aidl @@ -0,0 +1,95 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.ISapCallback; +import android.hardware.radio.SapApduType; +import android.hardware.radio.SapTransferProtocol; + +/** + * Empty top level interface. + */ +@VintfStability +interface ISap { + /** + * TRANSFER_APDU_REQ from SAP 1.1 spec 5.1.6 + * + * @param token Id to match req-resp. Resp must include same token. + * @param type APDU command type + * @param command CommandAPDU/CommandAPDU7816 parameter depending on type + */ + oneway void apduReq(in int token, in SapApduType type, in byte[] command); + + /** + * CONNECT_REQ from SAP 1.1 spec 5.1.1 + * + * @param token Id to match req-resp. Resp must include same token. + * @param maxMsgSize MaxMsgSize to be used for SIM Access Profile connection + */ + oneway void connectReq(in int token, in int maxMsgSize); + + /** + * DISCONNECT_REQ from SAP 1.1 spec 5.1.3 + * + * @param token Id to match req-resp. Resp must include same token. + */ + oneway void disconnectReq(in int token); + + /** + * POWER_SIM_OFF_REQ and POWER_SIM_ON_REQ from SAP 1.1 spec 5.1.10 + 5.1.12 + * + * @param token Id to match req-resp. Resp must include same token. + * @param state true for on, false for off + */ + oneway void powerReq(in int token, in boolean state); + + /** + * RESET_SIM_REQ from SAP 1.1 spec 5.1.14 + * + * @param token Id to match req-resp. Resp must include same token. + */ + oneway void resetSimReq(in int token); + + /** + * Set callback that has response and unsolicited indication functions + * + * @param sapCallback Object containing response and unosolicited indication callbacks + */ + void setCallback(in ISapCallback sapCallback); + + /** + * SET_TRANSPORT_PROTOCOL_REQ from SAP 1.1 spec 5.1.20 + * + * @param token Id to match req-resp. Resp must include same token. + * @param transferProtocol Transport Protocol + */ + oneway void setTransferProtocolReq(in int token, in SapTransferProtocol transferProtocol); + + /** + * TRANSFER_ATR_REQ from SAP 1.1 spec 5.1.8 + * + * @param token Id to match req-resp. Resp must include same token. + */ + oneway void transferAtrReq(in int token); + + /** + * TRANSFER_CARD_READER_STATUS_REQ from SAP 1.1 spec 5.1.17 + * + * @param token Id to match req-resp. Resp must include same token. + */ + oneway void transferCardReaderStatusReq(in int token); +} diff --git a/radio/aidl/android/hardware/radio/ISapCallback.aidl b/radio/aidl/android/hardware/radio/ISapCallback.aidl new file mode 100644 index 0000000000..e7a4bac705 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ISapCallback.aidl @@ -0,0 +1,152 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.SapConnectRsp; +import android.hardware.radio.SapDisconnectType; +import android.hardware.radio.SapResultCode; +import android.hardware.radio.SapStatus; + +@VintfStability +interface ISapCallback { + /** + * TRANSFER_APDU_RESP from SAP 1.1 spec 5.1.7 + * + * @param token 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:SUCCESS, + * SapResultCode:GENERIC_FAILURE, + * SapResultCode:CARD_NOT_ACCESSSIBLE, + * SapResultCode:CARD_ALREADY_POWERED_OFF, + * SapResultCode:CARD_REMOVED + * @param apduRsp APDU Response. Valid only if command was processed correctly and no error + * occurred. + */ + oneway void apduResponse(in int token, in SapResultCode resultCode, in byte[] apduRsp); + + /** + * CONNECT_RESP from SAP 1.1 spec 5.1.2 + * + * @param token Id to match req-resp. Value must match the one in req. + * @param sapConnectRsp Connection Status + * @param maxMsgSize MaxMsgSize supported by server if request cannot be fulfilled. + * Valid only if connectResponse is SapConnectResponse:MSG_SIZE_TOO_LARGE. + */ + oneway void connectResponse(in int token, in SapConnectRsp sapConnectRsp, in int maxMsgSize); + + /** + * DISCONNECT_IND from SAP 1.1 spec 5.1.5 + * + * @param token Id to match req-resp. Value must match the one in req. + * @param disconnectType Disconnect Type to indicate if shutdown is graceful or immediate + */ + oneway void disconnectIndication(in int token, in SapDisconnectType disconnectType); + + /** + * DISCONNECT_RESP from SAP 1.1 spec 5.1.4 + * + * @param token Id to match req-resp. Value must match the one in req. + */ + oneway void disconnectResponse(in int token); + + /** + * ERROR_RESP from SAP 1.1 spec 5.1.19 + * + * @param token Id to match req-resp. Value must match the one in req. + */ + oneway void errorResponse(in int token); + + /** + * POWER_SIM_OFF_RESP and POWER_SIM_ON_RESP from SAP 1.1 spec 5.1.11 + 5.1.13 + * + * @param token 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:SUCCESS, + * SapResultCode:GENERIC_FAILURE, + * SapResultCode:CARD_NOT_ACCESSSIBLE, (possible only for power on req) + * SapResultCode:CARD_ALREADY_POWERED_OFF, (possible only for power off req) + * SapResultCode:CARD_REMOVED, + * SapResultCode:CARD_ALREADY_POWERED_ON (possible only for power on req) + */ + oneway void powerResponse(in int token, in SapResultCode resultCode); + + /** + * RESET_SIM_RESP from SAP 1.1 spec 5.1.15 + * + * @param token 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:SUCCESS, + * SapResultCode:GENERIC_FAILURE, + * SapResultCode:CARD_NOT_ACCESSSIBLE, + * SapResultCode:CARD_ALREADY_POWERED_OFF, + * SapResultCode:CARD_REMOVED + */ + oneway void resetSimResponse(in int token, in SapResultCode resultCode); + + /** + * STATUS_IND from SAP 1.1 spec 5.1.16 + * + * @param token Id to match req-resp. Value must match the one in req. + * @param status Parameter to indicate reason for the status change. + */ + oneway void statusIndication(in int token, in SapStatus status); + + /** + * TRANSFER_ATR_RESP from SAP 1.1 spec 5.1.9 + * + * @param token 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:SUCCESS, + * SapResultCode:GENERIC_FAILURE, + * SapResultCode:CARD_ALREADY_POWERED_OFF, + * SapResultCode:CARD_REMOVED, + * SapResultCode:DATA_NOT_AVAILABLE + * @param atr Answer to Reset from the subscription module. Included only if no error occurred, + * otherwise empty. + */ + oneway void transferAtrResponse(in int token, in SapResultCode resultCode, in byte[] atr); + + /** + * TRANSFER_CARD_READER_STATUS_REQ from SAP 1.1 spec 5.1.18 + * + * @param token 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:SUCCESS, + * SapResultCode:GENERIC_FAILURE + * SapResultCode:DATA_NOT_AVAILABLE + * @param cardReaderStatus Card Reader Status coded as described in 3GPP TS 11.14 Section 12.33 + * and TS 31.111 Section 8.33 + */ + oneway void transferCardReaderStatusResponse( + in int token, in SapResultCode resultCode, in int cardReaderStatus); + + /** + * SET_TRANSPORT_PROTOCOL_RESP from SAP 1.1 spec 5.1.21 + * + * @param token 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:SUCCESS + * SapResultCode:NOT_SUPPORTED + */ + oneway void transferProtocolResponse(in int token, in SapResultCode resultCode); +} diff --git a/radio/aidl/android/hardware/radio/IccIo.aidl b/radio/aidl/android/hardware/radio/IccIo.aidl new file mode 100644 index 0000000000..7441758507 --- /dev/null +++ b/radio/aidl/android/hardware/radio/IccIo.aidl @@ -0,0 +1,55 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable IccIo { + /** + * One of the commands listed for TS 27.007 +CRSM + */ + int command; + /** + * EF ID + */ + int fileId; + /** + * "pathid" from TS 27.007 +CRSM command. Path is in hex ASCII format eg "7f205f70" + * Path must always be provided. + */ + String path; + /** + * Value of p1 defined as per 3GPP TS 51.011 + */ + int p1; + /** + * Value of p2 defined as per 3GPP TS 51.011 + */ + int p2; + /** + * Value of p3 defined as per 3GPP TS 51.011 + */ + int p3; + /** + * Information to be written to the SIM + */ + String data; + String pin2; + /** + * AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value. + */ + String aid; +} diff --git a/radio/aidl/android/hardware/radio/IccIoResult.aidl b/radio/aidl/android/hardware/radio/IccIoResult.aidl new file mode 100644 index 0000000000..94377b4072 --- /dev/null +++ b/radio/aidl/android/hardware/radio/IccIoResult.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable IccIoResult { + int sw1; + int sw2; + /** + * In hex string format ([a-fA-F0-9]*), except for SIM_AUTHENTICATION response for which it is + * in Base64 format, see 3GPP TS 31.102 7.1.2 + */ + String simResponse; +} diff --git a/radio/aidl/android/hardware/radio/ImsSmsMessage.aidl b/radio/aidl/android/hardware/radio/ImsSmsMessage.aidl new file mode 100644 index 0000000000..3b4efe68fd --- /dev/null +++ b/radio/aidl/android/hardware/radio/ImsSmsMessage.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CdmaSmsMessage; +import android.hardware.radio.GsmSmsMessage; +import android.hardware.radio.RadioTechnologyFamily; + +@VintfStability +parcelable ImsSmsMessage { + RadioTechnologyFamily tech; + /** + * Retry if true + */ + boolean retry; + /** + * Valid field if retry is set to true. + * Contains messageRef from SendSmsResult struct corresponding to failed MO SMS. + */ + int messageRef; + /** + * Valid field if tech is 3GPP2 and size = 1 else must be empty. Only one of cdmaMessage and + * gsmMessage must be of size 1 based on the RadioTechnologyFamily and the other must be size 0. + */ + CdmaSmsMessage[] cdmaMessage; + /** + * Valid field if tech is 3GPP and size = 1 else must be empty. Only one of cdmaMessage and + * gsmMessage must be of size 1 based on the RadioTechnologyFamily and the other must be size 0. + */ + GsmSmsMessage[] gsmMessage; +} diff --git a/radio/aidl/android/hardware/radio/ImsiEncryptionInfo.aidl b/radio/aidl/android/hardware/radio/ImsiEncryptionInfo.aidl new file mode 100644 index 0000000000..dbb0a9e2ed --- /dev/null +++ b/radio/aidl/android/hardware/radio/ImsiEncryptionInfo.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.PublicKeyType; + +/** + * Carrier specific Information sent by the carrier, which will be used to encrypt IMSI and IMPI. + */ +@VintfStability +parcelable ImsiEncryptionInfo { + /** + * MCC of the Carrier. + */ + String mcc; + /** + * MNC of the Carrier. + */ + String mnc; + /** + * Carrier specific key to be used for encryption. It must be opaque to the framework. + * This is the byte-stream representation of the key. This is an external encoded form for the + * key used when a standard representation of the key is needed outside the Java Virtual + * Machine, as when transmitting the key to some other party. The key is encoded according to a + * standard format (such as X.509 SubjectPublicKeyInfo or PKCS#8), and is returned using the + * getEncoded method as defined on the java.security.Key interface. + */ + byte[] carrierKey; + /** + * This is an opaque value we're given by the carrier and is returned to the carrier. + * This is used by the server to help it locate the private key to decrypt the + * permanent identity. + */ + String keyIdentifier; + /** + * Date-time in UTC when the key will expire. + */ + long expirationTime; + /** + * Public key type. + */ + PublicKeyType keyType; +} diff --git a/radio/aidl/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl b/radio/aidl/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl new file mode 100644 index 0000000000..4a863a7121 --- /dev/null +++ b/radio/aidl/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Values are in seconds. + */ +@VintfStability +@Backing(type="int") +enum IncrementalResultsPeriodicityRange { + MIN = 1, + MAX = 10, +} diff --git a/radio/aidl/android/hardware/radio/IndicationFilter.aidl b/radio/aidl/android/hardware/radio/IndicationFilter.aidl new file mode 100644 index 0000000000..826c8c1c57 --- /dev/null +++ b/radio/aidl/android/hardware/radio/IndicationFilter.aidl @@ -0,0 +1,69 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum IndicationFilter { + NONE = 0, + ALL = ~0, + /** + * When this bit is set, modem must send the signal strength update through + * IRadioIndication.currentSignalStrength() when all criteria specified by + * IRadio.setSignalStrengthReportingCriteria() are met. + */ + SIGNAL_STRENGTH = 1 << 0, + /** + * When this bit is set, modem must invoke IRadioIndication.networkStateChanged() when any field + * in VoiceRegStateResult or DataRegStateResult changes. When this bit is not set, modem must + * suppress IRadioIndication.networkStateChanged() when there are only changes from + * insignificant fields. Modem must invoke IRadioIndication.networkStateChanged() when + * significant fields are updated regardless of whether this bit is set. + * + * The following fields are considered significant: VoiceRegStateResult.regState, + * VoiceRegStateResult.rat, DataRegStateResult.regState, DataRegStateResult.rat. + */ + FULL_NETWORK_STATE = 1 << 1, + /** + * When this bit is set, modem must send IRadioIndication.dataCallListChanged() whenever any + * field in ITypes.SetupDataCallResult changes. When this bit is not set, modem must suppress + * the indication when the only changed field is 'active' (for data dormancy). For all other + * field changes, the modem must send IRadioIndication.dataCallListChanged() regardless of + * whether this bit is set. + */ + DATA_CALL_DORMANCY_CHANGED = 1 << 2, + /** + * When this bit is set, modem must send the link capacity update through + * IRadioIndication.currentLinkCapacityEstimate() when all criteria specified by + * IRadio.setLinkCapacityReportingCriteria() are met. + */ + LINK_CAPACITY_ESTIMATE = 1 << 3, + /** + * When this bit is set, the modem must send the physical channel configuration update through + * IRadioIndication.currentPhysicalChannelConfigs() when the configuration has changed. It is + * recommended that this be reported whenever link capacity or signal strength is reported. + */ + PHYSICAL_CHANNEL_CONFIG = 1 << 4, + /** + * Control the unsolicited sending of registration failure reports via onRegistrationFailed + */ + REGISTRATION_FAILURE = 1 << 5, + /** + * Control the unsolicited sending of barring info updates via onBarringInfo + */ + BARRING_INFO = 1 << 6, +} diff --git a/radio/aidl/android/hardware/radio/KeepaliveRequest.aidl b/radio/aidl/android/hardware/radio/KeepaliveRequest.aidl new file mode 100644 index 0000000000..ef594ade53 --- /dev/null +++ b/radio/aidl/android/hardware/radio/KeepaliveRequest.aidl @@ -0,0 +1,54 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.KeepaliveType; + +@VintfStability +parcelable KeepaliveRequest { + /** + * The format of the keepalive packet + */ + KeepaliveType type; + /** + * Source address with type = family, in network byte order + */ + byte[] sourceAddress; + /** + * Source port if relevant for the given type + * INT_MAX: 0x7FFFFFFF denotes that the field is unused + */ + int sourcePort; + /** + * Destination address with type = family, in network byte order + */ + byte[] destinationAddress; + /** + * Destination if relevant for the given type + * INT_MAX: 0x7FFFFFFF denotes that the field is unused + */ + int destinationPort; + /** + * The max interval between packets, in milliseconds + */ + int maxKeepaliveIntervalMillis; + /** + * Context ID, returned in setupDataCallResponse that uniquely identifies the data call to which + * this keepalive must applied. + */ + int cid; +} diff --git a/radio/aidl/android/hardware/radio/KeepaliveStatus.aidl b/radio/aidl/android/hardware/radio/KeepaliveStatus.aidl new file mode 100644 index 0000000000..911cdae07a --- /dev/null +++ b/radio/aidl/android/hardware/radio/KeepaliveStatus.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.KeepaliveStatusCode; + +@VintfStability +parcelable KeepaliveStatus { + /** + * The sessionHandle provided by the API + */ + int sessionHandle; + /** + * Status for the given keepalive + */ + KeepaliveStatusCode code; +} diff --git a/radio/aidl/android/hardware/radio/KeepaliveStatusCode.aidl b/radio/aidl/android/hardware/radio/KeepaliveStatusCode.aidl new file mode 100644 index 0000000000..ed4b32777d --- /dev/null +++ b/radio/aidl/android/hardware/radio/KeepaliveStatusCode.aidl @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum KeepaliveStatusCode { + /** + * Keepalive is currently active + */ + ACTIVE, + /** + * Keepalive is inactive, which indicates an error + */ + INACTIVE, + /** + * Requested keepalive has not yet been processed by the modem. + * Only allowed in a RESPONSE message to a REQUEST + */ + PENDING, +} diff --git a/radio/aidl/android/hardware/radio/KeepaliveType.aidl b/radio/aidl/android/hardware/radio/KeepaliveType.aidl new file mode 100644 index 0000000000..86b1509f29 --- /dev/null +++ b/radio/aidl/android/hardware/radio/KeepaliveType.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum KeepaliveType { + /** + * Keepalive specified by RFC 3948 Sec. 2.3 using IPv4 + */ + NATT_IPV4, + /** + * Keepalive specified by RFC 3948 Sec. 2.3 using IPv6 + */ + NATT_IPV6, +} diff --git a/radio/aidl/android/hardware/radio/LastCallFailCause.aidl b/radio/aidl/android/hardware/radio/LastCallFailCause.aidl new file mode 100644 index 0000000000..e5a5145fa4 --- /dev/null +++ b/radio/aidl/android/hardware/radio/LastCallFailCause.aidl @@ -0,0 +1,177 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum LastCallFailCause { + UNOBTAINABLE_NUMBER = 1, + NO_ROUTE_TO_DESTINATION = 3, + CHANNEL_UNACCEPTABLE = 6, + OPERATOR_DETERMINED_BARRING = 8, + NORMAL = 16, + BUSY = 17, + NO_USER_RESPONDING = 18, + NO_ANSWER_FROM_USER = 19, + CALL_REJECTED = 21, + NUMBER_CHANGED = 22, + PREEMPTION = 25, + DESTINATION_OUT_OF_ORDER = 27, + INVALID_NUMBER_FORMAT = 28, + FACILITY_REJECTED = 29, + RESP_TO_STATUS_ENQUIRY = 30, + NORMAL_UNSPECIFIED = 31, + CONGESTION = 34, + NETWORK_OUT_OF_ORDER = 38, + TEMPORARY_FAILURE = 41, + SWITCHING_EQUIPMENT_CONGESTION = 42, + ACCESS_INFORMATION_DISCARDED = 43, + REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE = 44, + RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 47, + QOS_UNAVAILABLE = 49, + REQUESTED_FACILITY_NOT_SUBSCRIBED = 50, + INCOMING_CALLS_BARRED_WITHIN_CUG = 55, + BEARER_CAPABILITY_NOT_AUTHORIZED = 57, + BEARER_CAPABILITY_UNAVAILABLE = 58, + SERVICE_OPTION_NOT_AVAILABLE = 63, + BEARER_SERVICE_NOT_IMPLEMENTED = 65, + ACM_LIMIT_EXCEEDED = 68, + REQUESTED_FACILITY_NOT_IMPLEMENTED = 69, + ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 70, + SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79, + INVALID_TRANSACTION_IDENTIFIER = 81, + USER_NOT_MEMBER_OF_CUG = 87, + INCOMPATIBLE_DESTINATION = 88, + INVALID_TRANSIT_NW_SELECTION = 91, + SEMANTICALLY_INCORRECT_MESSAGE = 95, + INVALID_MANDATORY_INFORMATION = 96, + MESSAGE_TYPE_NON_IMPLEMENTED = 97, + MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98, + INFORMATION_ELEMENT_NON_EXISTENT = 99, + CONDITIONAL_IE_ERROR = 100, + MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101, + RECOVERY_ON_TIMER_EXPIRED = 102, + PROTOCOL_ERROR_UNSPECIFIED = 111, + INTERWORKING_UNSPECIFIED = 127, + CALL_BARRED = 240, + FDN_BLOCKED = 241, + IMSI_UNKNOWN_IN_VLR = 242, + IMEI_NOT_ACCEPTED = 243, + /** + * STK Call Control + */ + DIAL_MODIFIED_TO_USSD = 244, + DIAL_MODIFIED_TO_SS = 245, + DIAL_MODIFIED_TO_DIAL = 246, + /** + * Radio is off + */ + RADIO_OFF = 247, + /** + * No cellular coverage + */ + OUT_OF_SERVICE = 248, + /** + * No valid SIM is present + */ + NO_VALID_SIM = 249, + /** + * Internal error at modem + */ + RADIO_INTERNAL_ERROR = 250, + /** + * No response from network + */ + NETWORK_RESP_TIMEOUT = 251, + /** + * Explicit network reject + */ + NETWORK_REJECT = 252, + /** + * RRC connection failure. Eg.RACH + */ + RADIO_ACCESS_FAILURE = 253, + /** + * Radio link failure + */ + RADIO_LINK_FAILURE = 254, + /** + * Radio link lost due to poor coverage + */ + RADIO_LINK_LOST = 255, + /** + * Radio uplink failure + */ + RADIO_UPLINK_FAILURE = 256, + /** + * RRC connection setup failure + */ + RADIO_SETUP_FAILURE = 257, + /** + * RRC connection release, normal + */ + RADIO_RELEASE_NORMAL = 258, + /** + * RRC connection release, abnormal + */ + RADIO_RELEASE_ABNORMAL = 259, + /** + * Access class barring + */ + ACCESS_CLASS_BLOCKED = 260, + /** + * Explicit network detach + */ + NETWORK_DETACH = 261, + CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000, + CDMA_DROP = 1001, + CDMA_INTERCEPT = 1002, + CDMA_REORDER = 1003, + CDMA_SO_REJECT = 1004, + CDMA_RETRY_ORDER = 1005, + CDMA_ACCESS_FAILURE = 1006, + CDMA_PREEMPTED = 1007, + /** + * For non-emergency number dialed during emergency callback mode + */ + CDMA_NOT_EMERGENCY = 1008, + CDMA_ACCESS_BLOCKED = 1009, + /** + * OEM specific error codes. Used to distinguish error from + * CALL_FAIL_ERROR_UNSPECIFIED and help assist debugging + */ + OEM_CAUSE_1 = 0xf001, + OEM_CAUSE_2 = 0xf002, + OEM_CAUSE_3 = 0xf003, + OEM_CAUSE_4 = 0xf004, + OEM_CAUSE_5 = 0xf005, + OEM_CAUSE_6 = 0xf006, + OEM_CAUSE_7 = 0xf007, + OEM_CAUSE_8 = 0xf008, + OEM_CAUSE_9 = 0xf009, + OEM_CAUSE_10 = 0xf00a, + OEM_CAUSE_11 = 0xf00b, + OEM_CAUSE_12 = 0xf00c, + OEM_CAUSE_13 = 0xf00d, + OEM_CAUSE_14 = 0xf00e, + OEM_CAUSE_15 = 0xf00f, + /** + * This error will be deprecated soon, vendor code must make sure to map error code to specific + * error + */ + ERROR_UNSPECIFIED = 0xffff, +} diff --git a/radio/aidl/android/hardware/radio/LastCallFailCauseInfo.aidl b/radio/aidl/android/hardware/radio/LastCallFailCauseInfo.aidl new file mode 100644 index 0000000000..6866e99d91 --- /dev/null +++ b/radio/aidl/android/hardware/radio/LastCallFailCauseInfo.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.LastCallFailCause; + +@VintfStability +parcelable LastCallFailCauseInfo { + LastCallFailCause causeCode; + String vendorCause; +} diff --git a/radio/aidl/android/hardware/radio/LceDataInfo.aidl b/radio/aidl/android/hardware/radio/LceDataInfo.aidl new file mode 100644 index 0000000000..68521b559b --- /dev/null +++ b/radio/aidl/android/hardware/radio/LceDataInfo.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable LceDataInfo { + /** + * Last-hop cellular capacity: kilobits/second. + */ + int lastHopCapacityKbps; + /** + * Capacity estimate confidence: 0-100. + */ + byte confidenceLevel; + /** + * Whether the LCE report is going to be suspended (e.g., radio moves to inactive state or + * network type changes). + */ + boolean lceSuspended; +} diff --git a/radio/aidl/android/hardware/radio/LceStatus.aidl b/radio/aidl/android/hardware/radio/LceStatus.aidl new file mode 100644 index 0000000000..0d3a27e420 --- /dev/null +++ b/radio/aidl/android/hardware/radio/LceStatus.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum LceStatus { + NOT_SUPPORTED, + STOPPED, + ACTIVE, +} diff --git a/radio/aidl/android/hardware/radio/LceStatusInfo.aidl b/radio/aidl/android/hardware/radio/LceStatusInfo.aidl new file mode 100644 index 0000000000..e2b35e1a64 --- /dev/null +++ b/radio/aidl/android/hardware/radio/LceStatusInfo.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.LceStatus; + +@VintfStability +parcelable LceStatusInfo { + LceStatus lceStatus; + /** + * Actual LCE reporting interval, meaningful only if LceStatus = ACTIVE. + */ + byte actualIntervalMs; +} diff --git a/radio/aidl/android/hardware/radio/LinkAddress.aidl b/radio/aidl/android/hardware/radio/LinkAddress.aidl new file mode 100644 index 0000000000..6fc12c777d --- /dev/null +++ b/radio/aidl/android/hardware/radio/LinkAddress.aidl @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.AddressProperty; + +/** + * Describes a data link address for mobile data connection. + */ +@VintfStability +parcelable LinkAddress { + /** + * The format is IP address with optional "/" prefix length (The format is defined in RFC-4291 + * section 2.3). For example, "192.0.1.3", "192.0.1.11/16", or "2001:db8::1/64". Typically one + * IPv4 or one IPv6 or one of each. If the prefix length is absent, then the addresses are + * assumed to be point to point with IPv4 with prefix length 32 or IPv6 with prefix length 128. + */ + String address; + /** + * The properties of the link address + */ + AddressProperty properties; + /** + * The time, as reported by SystemClock.elapsedRealtime(), when this link address will be or + * was deprecated. -1 indicates this information is not available. At the time existing + * connections can still use this address until it expires, but new connections should use the + * new address. LONG_MAX(0x7FFFFFFFFFFFFFFF) indicates this link address will never be + * deprecated. + */ + long deprecationTime; + /** + * The time, as reported by SystemClock.elapsedRealtime(), when this link address will expire + * and be removed from the interface. -1 indicates this information is not available. + * LONG_MAX(0x7FFFFFFFFFFFFFFF) indicates this link address will never expire. + */ + long expirationTime; +} diff --git a/radio/aidl/android/hardware/radio/LinkCapacityEstimate.aidl b/radio/aidl/android/hardware/radio/LinkCapacityEstimate.aidl new file mode 100644 index 0000000000..78ddee2f8f --- /dev/null +++ b/radio/aidl/android/hardware/radio/LinkCapacityEstimate.aidl @@ -0,0 +1,53 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable LinkCapacityEstimate { + /** + * Estimated downlink capacity in kbps. In case of a dual connected network, this includes + * capacity of both primary and secondary. This bandwidth estimate shall be the estimated + * maximum sustainable link bandwidth (as would be measured at the Upper PDCP or SNDCP SAP). + * If the DL Aggregate Maximum Bit Rate is known, this value shall not exceed the DL-AMBR for + * the Internet PDN connection. This must be filled with 0 if network is not connected. + */ + int downlinkCapacityKbps; + /** + * Estimated uplink capacity in kbps. In case of a dual connected network, this includes + * capacity of both primary and secondary. This bandwidth estimate shall be the estimated + * maximum sustainable link bandwidth (as would be measured at the Upper PDCP or SNDCP SAP). + * If the UL Aggregate Maximum Bit Rate is known, this value shall not exceed the UL-AMBR for + * the Internet PDN connection. This must be filled with 0 if network is not connected. + */ + int uplinkCapacityKbps; + /** + * Estimated downlink capacity of secondary carrier in a dual connected NR mode in kbps. This + * bandwidth estimate shall be the estimated maximum sustainable link bandwidth (as would be + * measured at the Upper PDCP or SNDCP SAP). This is valid only in if device is connected to + * both primary and secodary in dual connected mode. This must be filled with 0 if secondary is + * not connected or if modem does not support this feature. + */ + int secondaryDownlinkCapacityKbps; + /** + * Estimated uplink capacity secondary carrier in a dual connected NR mode in kbps. This + * bandwidth estimate shall be the estimated maximum sustainable link bandwidth (as would be + * measured at the Upper PDCP or SNDCP SAP). This is valid only in if device is connected to + * both primary and secodary in dual connected mode.This must be filled with 0 if secondary is + * not connected or if modem does not support this feature. + */ + int secondaryUplinkCapacityKbps; +} diff --git a/radio/aidl/android/hardware/radio/LteSignalStrength.aidl b/radio/aidl/android/hardware/radio/LteSignalStrength.aidl new file mode 100644 index 0000000000..699925d419 --- /dev/null +++ b/radio/aidl/android/hardware/radio/LteSignalStrength.aidl @@ -0,0 +1,59 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable LteSignalStrength { + /** + * Valid values are (0-31, 99) as defined in TS 27.007 8.5; INT_MAX means invalid/unreported. + */ + int signalStrength; + /** + * The current Reference Signal Receive Power in dBm multiplied by -1. Range: 44 to 140 dBm; + * INT_MAX: 0x7FFFFFFF denotes invalid/unreported value. Reference: 3GPP TS 36.133 9.1.4 + */ + int rsrp; + /** + * The current Reference Signal Receive Quality in dB multiplied by -1. Range: 20 to 3 dB; + * INT_MAX: 0x7FFFFFFF denotes invalid/unreported value. Reference: 3GPP TS 36.133 9.1.7 + */ + int rsrq; + /** + * The current reference signal signal-to-noise ratio in 0.1 dB units. + * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB). + * INT_MAX: 0x7FFFFFFF denotes invalid/unreported value. Reference: 3GPP TS 36.101 8.1.1 + */ + int rssnr; + /** + * The current Channel Quality Indicator. Range: 0 to 15. + * INT_MAX: 0x7FFFFFFF denotes invalid/unreported value. Reference: 3GPP TS 36.101 9.2, 9.3, A.4 + */ + int cqi; + /** + * Timing advance in micro seconds for a one way trip from cell to device. Approximate distance + * is calculated using 300m/us * timingAdvance. Range: 0 to 1282 inclusive. + * INT_MAX: 0x7FFFFFFF denotes invalid/unreported value. Reference: 3GPP 36.213 section 4.2.3 + */ + int timingAdvance; + /** + * CSI channel quality indicator (CQI) table index. There are multiple CQI tables. + * The definition of CQI in each table is different. + * Reference: 3GPP TS 136.213 section 7.2.3. + * Range [1, 6], INT_MAX means invalid/unreported. + */ + int cqiTableIndex; +} diff --git a/radio/aidl/android/hardware/radio/LteVopsInfo.aidl b/radio/aidl/android/hardware/radio/LteVopsInfo.aidl new file mode 100644 index 0000000000..b487a8f20d --- /dev/null +++ b/radio/aidl/android/hardware/radio/LteVopsInfo.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. + */ + +package android.hardware.radio; + +/** + * Type to define the LTE specific network capabilities for voice over PS including emergency and + * normal voice calls. + */ +@VintfStability +parcelable LteVopsInfo { + /** + * This indicates if camped network support VoLTE services. This information is received from + * LTE network during LTE NAS registration procedure through LTE ATTACH ACCEPT/TAU ACCEPT. + * Refer 3GPP 24.301 EPS network feature support -> IMS VoPS + */ + boolean isVopsSupported; + /** + * This indicates if camped network support VoLTE emergency bearers. This information is + * received from LTE network through two sources: + * a. During LTE NAS registration procedure through LTE ATTACH ACCEPT/TAU ACCEPT. Refer + * 3GPP 24.301 EPS network feature support -> EMC BS + * b. In case device is not registered on network. Refer 3GPP 25.331 LTE RRC + * SIB1 : ims-EmergencySupport-r9 + * If device is registered on LTE, then this field indicates (a). + * In case of limited service on LTE this field indicates (b). + */ + boolean isEmcBearerSupported; +} diff --git a/radio/aidl/android/hardware/radio/MaxSearchTimeRange.aidl b/radio/aidl/android/hardware/radio/MaxSearchTimeRange.aidl new file mode 100644 index 0000000000..babbd3cc47 --- /dev/null +++ b/radio/aidl/android/hardware/radio/MaxSearchTimeRange.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Values are in seconds. + */ +@VintfStability +@Backing(type="int") +enum MaxSearchTimeRange { + MIN = 60, + MAX = 3600, +} diff --git a/radio/aidl/android/hardware/radio/MaybePort.aidl b/radio/aidl/android/hardware/radio/MaybePort.aidl new file mode 100644 index 0000000000..169f90f794 --- /dev/null +++ b/radio/aidl/android/hardware/radio/MaybePort.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.PortRange; + +/** + * Port is optional, contains either single port or range of ports + */ +@VintfStability +union MaybePort { + boolean noinit; + PortRange range; +} diff --git a/radio/aidl/android/hardware/radio/MvnoType.aidl b/radio/aidl/android/hardware/radio/MvnoType.aidl new file mode 100644 index 0000000000..0f0df6256b --- /dev/null +++ b/radio/aidl/android/hardware/radio/MvnoType.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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum MvnoType { + /** + * None + */ + NONE, + /** + * The matching data is based on IMSI. + */ + IMSI, + /** + * The matching data is based on group id. + */ + GID, + /** + * The matching data is based service provider name. + */ + SPN, +} diff --git a/radio/aidl/android/hardware/radio/NeighboringCell.aidl b/radio/aidl/android/hardware/radio/NeighboringCell.aidl new file mode 100644 index 0000000000..b48a2d4e51 --- /dev/null +++ b/radio/aidl/android/hardware/radio/NeighboringCell.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable NeighboringCell { + /** + * Combination of LAC and cell ID in 32 bits in GSM. Upper 16 bits is LAC and lower 16 bits is + * CID (as described in TS 27.005). + */ + String cid; + /** + * Received RSSI in GSM, level index of CPICH Received Signal Code Power in UMTS + */ + int rssi; +} diff --git a/radio/aidl/android/hardware/radio/NetworkScanRequest.aidl b/radio/aidl/android/hardware/radio/NetworkScanRequest.aidl new file mode 100644 index 0000000000..7659b89ae5 --- /dev/null +++ b/radio/aidl/android/hardware/radio/NetworkScanRequest.aidl @@ -0,0 +1,60 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.RadioAccessSpecifier; +import android.hardware.radio.ScanType; + +@VintfStability +parcelable NetworkScanRequest { + ScanType type; + /** + * Time interval in seconds between the completion of one scan and the start of a subsequent + * scan. Implementations may ignore this field unless the 'type' is 'PERIODIC'. + * Range: ScanIntervalRange:MIN to ScanIntervalRange:MAX. + */ + int interval; + /** + * Networks with bands/channels to scan. + * Maximum length of the vector is RadioConst:RADIO_ACCESS_SPECIFIER_MAX_SIZE. + */ + RadioAccessSpecifier[] specifiers; + /** + * Maximum duration of the periodic search (in seconds). If the search lasts maxSearchTime, it + * must be terminated. Range: MaxSearchTimeRange:MIN to MaxSearchTimeRange:MAX + */ + int maxSearchTime; + /** + * Whether the modem must report incremental results of the network scan to the client. + * FALSE – Incremental results must not be reported. + * TRUE – Incremental must be reported. + */ + boolean incrementalResults; + /** + * Indicates the periodicity with which the modem must report incremental results to the client + * (in seconds). Implementations may ignore this value if the incremental results are not + * requested. This value must be less than or equal to maxSearchTime. + * Range: IncrementalResultsPeriodicityRange:MIN to IncrementalResultsPeriodicityRange:MAX + */ + int incrementalResultsPeriodicity; + /** + * Describes the List of PLMN ids (MCC-MNC). If any PLMN of this list is found, search must end + * at that point and results with all PLMN found until that point should be sent as response. + * If the list is not sent, search to be completed until end and all PLMNs found to be reported. + */ + String[] mccMncs; +} diff --git a/radio/aidl/android/hardware/radio/NetworkScanResult.aidl b/radio/aidl/android/hardware/radio/NetworkScanResult.aidl new file mode 100644 index 0000000000..c542a4753b --- /dev/null +++ b/radio/aidl/android/hardware/radio/NetworkScanResult.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellInfo; +import android.hardware.radio.RadioError; +import android.hardware.radio.ScanStatus; + +@VintfStability +parcelable NetworkScanResult { + /** + * The status of the scan. + */ + ScanStatus status; + /** + * The error code of the incremental result. + */ + RadioError error; + /** + * List of network information as CellInfo. + */ + CellInfo[] networkInfos; +} diff --git a/radio/aidl/android/hardware/radio/NgranBands.aidl b/radio/aidl/android/hardware/radio/NgranBands.aidl new file mode 100644 index 0000000000..7887011c77 --- /dev/null +++ b/radio/aidl/android/hardware/radio/NgranBands.aidl @@ -0,0 +1,84 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * NGRAN bands up to V16.5.0 + */ +@VintfStability +@Backing(type="int") +enum NgranBands { + /** + * 3GPP TS 38.101-1, Table 5.2-1: FR1 bands + */ + BAND_1 = 1, + BAND_2 = 2, + BAND_3 = 3, + BAND_5 = 5, + BAND_7 = 7, + BAND_8 = 8, + BAND_12 = 12, + BAND_14 = 14, + BAND_18 = 18, + BAND_20 = 20, + BAND_25 = 25, + BAND_26 = 26, + BAND_28 = 28, + BAND_29 = 29, + BAND_30 = 30, + BAND_34 = 34, + BAND_38 = 38, + BAND_39 = 39, + BAND_40 = 40, + BAND_41 = 41, + BAND_46 = 46, + BAND_48 = 48, + BAND_50 = 50, + BAND_51 = 51, + BAND_53 = 53, + BAND_65 = 65, + BAND_66 = 66, + BAND_70 = 70, + BAND_71 = 71, + BAND_74 = 74, + BAND_75 = 75, + BAND_76 = 76, + BAND_77 = 77, + BAND_78 = 78, + BAND_79 = 79, + BAND_80 = 80, + BAND_81 = 81, + BAND_82 = 82, + BAND_83 = 83, + BAND_84 = 84, + BAND_86 = 86, + BAND_89 = 89, + BAND_90 = 90, + BAND_91 = 91, + BAND_92 = 92, + BAND_93 = 93, + BAND_94 = 94, + BAND_95 = 95, + BAND_96 = 96, + /** + * 3GPP TS 38.101-2, Table 5.2-1: FR2 bands + */ + BAND_257 = 257, + BAND_258 = 258, + BAND_260 = 260, + BAND_261 = 261, +} diff --git a/radio/aidl/android/hardware/radio/NrDualConnectivityState.aidl b/radio/aidl/android/hardware/radio/NrDualConnectivityState.aidl new file mode 100644 index 0000000000..52bd048469 --- /dev/null +++ b/radio/aidl/android/hardware/radio/NrDualConnectivityState.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. + */ + +package android.hardware.radio; + +/** + * NR Dual connectivity state + */ +@VintfStability +@Backing(type="byte") +enum NrDualConnectivityState { + /** + * Enable NR dual connectivity. Enabled state does not mean dual connectivity is active. + * It means device is allowed to connect to both primary and secondary. + */ + ENABLE = 1, + /** + * Disable NR dual connectivity. Disabled state does not mean secondary cell is released. + * Modem will release it only if current bearer is released to avoid radio link failure. + */ + DISABLE = 2, + /** + * Disable NR dual connectivity and force secondary cell to be released if dual connectivity + * was active. This may result in radio link failure. + */ + DISABLE_IMMEDIATE = 3, +} diff --git a/radio/aidl/android/hardware/radio/NrIndicators.aidl b/radio/aidl/android/hardware/radio/NrIndicators.aidl new file mode 100644 index 0000000000..2a1dfece78 --- /dev/null +++ b/radio/aidl/android/hardware/radio/NrIndicators.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. + */ + +package android.hardware.radio; + +/** + * The parameters of NR 5G Non-Standalone. + */ +@VintfStability +parcelable NrIndicators { + /** + * Indicates that if E-UTRA-NR Dual Connectivity (EN-DC) is supported by the primary serving + * cell. True the primary serving cell is LTE cell and the plmn-InfoList-r15 is present in SIB2 + * and at least one bit in this list is true, otherwise this value should be false. + * Reference: 3GPP TS 36.331 v15.2.2 6.3.1 System information blocks. + */ + boolean isEndcAvailable; + /** + * True if use of dual connectivity with NR is restricted. + * Reference: 3GPP TS 24.301 v15.03 section 9.3.3.12A. + */ + boolean isDcNrRestricted; + /** + * True if the bit N is in the PLMN-InfoList-r15 is true and the selected PLMN is present in + * plmn-IdentityList at position N. + * Reference: 3GPP TS 36.331 v15.2.2 section 6.3.1 PLMN-InfoList-r15. + * 3GPP TS 36.331 v15.2.2 section 6.2.2 SystemInformationBlockType1 message. + */ + boolean isNrAvailable; +} diff --git a/radio/aidl/android/hardware/radio/NrQos.aidl b/radio/aidl/android/hardware/radio/NrQos.aidl new file mode 100644 index 0000000000..3d0278c073 --- /dev/null +++ b/radio/aidl/android/hardware/radio/NrQos.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.QosBandwidth; + +/** + * 5G Quality of Service parameters as per 3gpp spec 24.501 sec 9.11.4.12 + */ +@VintfStability +parcelable NrQos { + /** + * 5G QOS Identifier (5QI), see 3GPP TS 24.501 and 23.501. The allowed values are standard + * values (1-9, 65-68, 69-70, 75, 79-80, 82-85) defined in the spec and operator specific values + * in the range 128-254. + */ + int fiveQi; + QosBandwidth downlink; + QosBandwidth uplink; + /** + * QOS flow identifier of the QOS flow description in the range + * (QosFlowIdRange::MIN, QosFlowIdRange::MAX) + */ + byte qfi; + char averagingWindowMs; +} diff --git a/radio/aidl/android/hardware/radio/NrSignalStrength.aidl b/radio/aidl/android/hardware/radio/NrSignalStrength.aidl new file mode 100644 index 0000000000..40c6c3ebe0 --- /dev/null +++ b/radio/aidl/android/hardware/radio/NrSignalStrength.aidl @@ -0,0 +1,73 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable NrSignalStrength { + /** + * SS reference signal received power, multiplied by -1. + * Reference: 3GPP TS 38.215. + * Range [44, 140], INT_MAX means invalid/unreported. + */ + int ssRsrp; + /** + * SS reference signal received quality, multiplied by -1. + * Reference: 3GPP TS 38.215, 3GPP TS 38.133 section 10. + * Range [-20 dB, 43 dB], INT_MAX means invalid/unreported. + */ + int ssRsrq; + /** + * SS signal-to-noise and interference ratio. + * Reference: 3GPP TS 38.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1. + * Range [-23, 40], INT_MAX means invalid/unreported. + */ + int ssSinr; + /** + * CSI reference signal received power, multiplied by -1. + * Reference: 3GPP TS 38.215. + * Range [44, 140], INT_MAX means invalid/unreported. + */ + int csiRsrp; + /** + * CSI reference signal received quality, multiplied by -1. + * Reference: 3GPP TS 38.215. + * Range [3, 20], INT_MAX means invalid/unreported. + */ + int csiRsrq; + /** + * CSI signal-to-noise and interference ratio. + * Reference: 3GPP TS 138.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1. + * Range [-23, 40], INT_MAX means invalid/unreported. + */ + int csiSinr; + /** + * CSI channel quality indicator (CQI) table index. There are multiple CQI tables. + * The definition of CQI in each table is different. + * Reference: 3GPP TS 138.214 section 5.2.2.1. + * Range [1, 3], INT_MAX means invalid/unreported. + */ + int csiCqiTableIndex; + /** + * CSI channel quality indicator (CQI) for all subbands. If the CQI report is for the entire + * wideband, a single CQI index is provided. If the CQI report is for all subbands, one CQI + * index is provided for each subband, in ascending order of subband index. If CQI is not + * available, the CQI report is empty. + * Reference: 3GPP TS 138.214 section 5.2.2.1. + * Range [0, 15], 0xFF means invalid/unreported. + */ + byte[] csiCqiReport; +} diff --git a/radio/aidl/android/hardware/radio/NrVopsInfo.aidl b/radio/aidl/android/hardware/radio/NrVopsInfo.aidl new file mode 100644 index 0000000000..4d80f32962 --- /dev/null +++ b/radio/aidl/android/hardware/radio/NrVopsInfo.aidl @@ -0,0 +1,54 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.EmcIndicator; +import android.hardware.radio.EmfIndicator; +import android.hardware.radio.VopsIndicator; + +/** + * Type to define the NR specific network capabilities for voice over PS including emergency and + * normal voice calls. + */ +@VintfStability +parcelable NrVopsInfo { + /** + * This indicates if the camped network supports VoNR services, and what kind of services + * it supports. This information is received from NR network during NR NAS registration + * procedure through NR REGISTRATION ACCEPT. + * Refer 3GPP 24.501 EPS 5GS network feature support -> IMS VoPS + */ + VopsIndicator vopsSupported; + /** + * This indicates if the camped network supports VoNR emergency service. This information + * is received from NR network through two sources: + * a. During NR NAS registration procedure through NR REGISTRATION ACCEPT. + * Refer 3GPP 24.501 EPS 5GS network feature support -> EMC + * b. In case the device is not registered on the network. + * Refer 3GPP 38.331 SIB1 : ims-EmergencySupport + * If device is registered on NR, then this field indicates whether the cell + * supports IMS emergency bearer services for UEs in limited service mode. + */ + EmcIndicator emcSupported; + /** + * This indicates if the camped network supports VoNR emergency service fallback. This + * information is received from NR network during NR NAS registration procedure through + * NR REGISTRATION ACCEPT. + * Refer 3GPP 24.501 EPS 5GS network feature support -> EMF + */ + EmfIndicator emfSupported; +} diff --git a/radio/aidl/android/hardware/radio/NvItem.aidl b/radio/aidl/android/hardware/radio/NvItem.aidl new file mode 100644 index 0000000000..0d4f79f150 --- /dev/null +++ b/radio/aidl/android/hardware/radio/NvItem.aidl @@ -0,0 +1,191 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum NvItem { + /** + * CDMA radio and account information (items 1-10) + * CDMA MEID (hex) + */ + CDMA_MEID = 1, + /** + * CDMA MIN (MSID) + */ + CDMA_MIN = 2, + /** + * CDMA MDN + */ + CDMA_MDN = 3, + /** + * CDMA access overload control + */ + CDMA_ACCOLC = 4, + /** + * Carrier device provisioning (items 11-30) + * Device MSL + */ + DEVICE_MSL = 11, + /** + * RTN reconditioned status + */ + RTN_RECONDITIONED_STATUS = 12, + /** + * RTN activation date + */ + RTN_ACTIVATION_DATE = 13, + /** + * RTN life timer + */ + RTN_LIFE_TIMER = 14, + /** + * RTN life calls + */ + RTN_LIFE_CALLS = 15, + /** + * RTN life data TX + */ + RTN_LIFE_DATA_TX = 16, + /** + * RTN life data RX + */ + RTN_LIFE_DATA_RX = 17, + /** + * HFA in progress + */ + OMADM_HFA_LEVEL = 18, + /** + * Mobile IP profile information (items 31-50) + * NAI realm + */ + MIP_PROFILE_NAI = 31, + /** + * MIP home address + */ + MIP_PROFILE_HOME_ADDRESS = 32, + /** + * AAA auth + */ + MIP_PROFILE_AAA_AUTH = 33, + /** + * HA auth + */ + MIP_PROFILE_HA_AUTH = 34, + /** + * Primary HA address + */ + MIP_PROFILE_PRI_HA_ADDR = 35, + /** + * Secondary HA address + */ + MIP_PROFILE_SEC_HA_ADDR = 36, + /** + * Reverse TUN preference + */ + MIP_PROFILE_REV_TUN_PREF = 37, + /** + * HA SPI + */ + MIP_PROFILE_HA_SPI = 38, + /** + * AAA SPI + */ + MIP_PROFILE_AAA_SPI = 39, + /** + * HA shared secret + */ + MIP_PROFILE_MN_HA_SS = 40, + /** + * AAA shared secret + */ + MIP_PROFILE_MN_AAA_SS = 41, + /** + * CDMA network and band config (items 51-70) + * CDMA PRL version + */ + CDMA_PRL_VERSION = 51, + /** + * CDMA band class 10 + */ + CDMA_BC10 = 52, + /** + * CDMA band class 14 + */ + CDMA_BC14 = 53, + /** + * CDMA SO68 + */ + CDMA_SO68 = 54, + /** + * CDMA SO73 COP0 + */ + CDMA_SO73_COP0 = 55, + /** + * CDMA SO73 COP1-7 + */ + CDMA_SO73_COP1TO7 = 56, + /** + * CDMA 1X Advanced enabled + */ + CDMA_1X_ADVANCED_ENABLED = 57, + /** + * CDMA eHRPD enabled + */ + CDMA_EHRPD_ENABLED = 58, + /** + * CDMA eHRPD forced + */ + CDMA_EHRPD_FORCED = 59, + /** + * LTE network and band config (items 71-90) + * LTE band 25 enabled + */ + LTE_BAND_ENABLE_25 = 71, + /** + * LTE band 26 enabled + */ + LTE_BAND_ENABLE_26 = 72, + /** + * LTE band 41 enabled + */ + LTE_BAND_ENABLE_41 = 73, + /** + * LTE band 25 scan priority + */ + LTE_SCAN_PRIORITY_25 = 74, + /** + * LTE band 26 scan priority + */ + LTE_SCAN_PRIORITY_26 = 75, + /** + * LTE band 41 scan priority + */ + LTE_SCAN_PRIORITY_41 = 76, + /** + * LTE hidden band 25 priority + */ + LTE_HIDDEN_BAND_PRIORITY_25 = 77, + /** + * LTE hidden band 26 priority + */ + LTE_HIDDEN_BAND_PRIORITY_26 = 78, + /** + * LTE hidden band 41 priority + */ + LTE_HIDDEN_BAND_PRIORITY_41 = 79, +} diff --git a/radio/aidl/android/hardware/radio/NvWriteItem.aidl b/radio/aidl/android/hardware/radio/NvWriteItem.aidl new file mode 100644 index 0000000000..f3061612b4 --- /dev/null +++ b/radio/aidl/android/hardware/radio/NvWriteItem.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.NvItem; + +@VintfStability +parcelable NvWriteItem { + NvItem itemId; + String value; +} diff --git a/radio/aidl/android/hardware/radio/OperatorInfo.aidl b/radio/aidl/android/hardware/radio/OperatorInfo.aidl new file mode 100644 index 0000000000..4475ff5506 --- /dev/null +++ b/radio/aidl/android/hardware/radio/OperatorInfo.aidl @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.OperatorStatus; + +@VintfStability +parcelable OperatorInfo { + /** + * Long alpha ONS or EONS + */ + String alphaLong; + /** + * Short alpha ONS or EONS + */ + String alphaShort; + /** + * 5 or 6 digit numeric code (MCC + MNC) + */ + String operatorNumeric; + OperatorStatus status; +} diff --git a/radio/aidl/android/hardware/radio/OperatorStatus.aidl b/radio/aidl/android/hardware/radio/OperatorStatus.aidl new file mode 100644 index 0000000000..fcc31eca2f --- /dev/null +++ b/radio/aidl/android/hardware/radio/OperatorStatus.aidl @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum OperatorStatus { + UNKNOWN, + AVAILABLE, + CURRENT, + FORBIDDEN, +} diff --git a/radio/aidl/android/hardware/radio/OptionalCsgInfo.aidl b/radio/aidl/android/hardware/radio/OptionalCsgInfo.aidl new file mode 100644 index 0000000000..f7856933a7 --- /dev/null +++ b/radio/aidl/android/hardware/radio/OptionalCsgInfo.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.ClosedSubscriberGroupInfo; + +@VintfStability +union OptionalCsgInfo { + /** + * If no CSG info is provided by the cell, then this structure shall be present. + */ + boolean noinit; + /** + * If CSG info is provided by the cell, this structure shall be present. + */ + ClosedSubscriberGroupInfo csgInfo; +} diff --git a/radio/aidl/android/hardware/radio/OptionalDnn.aidl b/radio/aidl/android/hardware/radio/OptionalDnn.aidl new file mode 100644 index 0000000000..1c38a7103c --- /dev/null +++ b/radio/aidl/android/hardware/radio/OptionalDnn.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * This safe_union represents an optional DNN. DNN stands for Data Network Name and represents + * an APN as defined in 3GPP TS 23.003. + */ +@VintfStability +union OptionalDnn { + boolean noinit; + String value; +} diff --git a/radio/aidl/android/hardware/radio/OptionalOsAppId.aidl b/radio/aidl/android/hardware/radio/OptionalOsAppId.aidl new file mode 100644 index 0000000000..4614601af6 --- /dev/null +++ b/radio/aidl/android/hardware/radio/OptionalOsAppId.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.OsAppId; + +/** + * This safe_union represents an optional OsAppId. + */ +@VintfStability +union OptionalOsAppId { + boolean noinit; + OsAppId value; +} diff --git a/radio/aidl/android/hardware/radio/OptionalPdpProtocolType.aidl b/radio/aidl/android/hardware/radio/OptionalPdpProtocolType.aidl new file mode 100644 index 0000000000..7e51b83756 --- /dev/null +++ b/radio/aidl/android/hardware/radio/OptionalPdpProtocolType.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.PdpProtocolType; + +/** + * This safe_union represents an optional PdpProtocolType. + */ +@VintfStability +union OptionalPdpProtocolType { + boolean noinit; + PdpProtocolType value; +} diff --git a/radio/aidl/android/hardware/radio/OptionalSliceInfo.aidl b/radio/aidl/android/hardware/radio/OptionalSliceInfo.aidl new file mode 100644 index 0000000000..cfc309c49f --- /dev/null +++ b/radio/aidl/android/hardware/radio/OptionalSliceInfo.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.SliceInfo; + +/** + * This safe_union represents an optional slice info. + */ +@VintfStability +union OptionalSliceInfo { + boolean noinit; + SliceInfo value; +} diff --git a/radio/aidl/android/hardware/radio/OptionalSscMode.aidl b/radio/aidl/android/hardware/radio/OptionalSscMode.aidl new file mode 100644 index 0000000000..22933b93b3 --- /dev/null +++ b/radio/aidl/android/hardware/radio/OptionalSscMode.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.SscMode; + +/** + * This safe_union represents an optional SscMode. + */ +@VintfStability +union OptionalSscMode { + boolean noinit; + SscMode value; +} diff --git a/radio/aidl/android/hardware/radio/OptionalTrafficDescriptor.aidl b/radio/aidl/android/hardware/radio/OptionalTrafficDescriptor.aidl new file mode 100644 index 0000000000..b524cb3a77 --- /dev/null +++ b/radio/aidl/android/hardware/radio/OptionalTrafficDescriptor.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.TrafficDescriptor; + +/** + * This safe_union represents an optional TrafficDescriptor. + */ +@VintfStability +union OptionalTrafficDescriptor { + boolean noinit; + TrafficDescriptor value; +} diff --git a/radio/aidl/android/hardware/radio/OsAppId.aidl b/radio/aidl/android/hardware/radio/OsAppId.aidl new file mode 100644 index 0000000000..57dfc80168 --- /dev/null +++ b/radio/aidl/android/hardware/radio/OsAppId.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * This struct represents the OsId + OsAppId as defined in TS 24.526 Section 5.2 + */ +@VintfStability +parcelable OsAppId { + /** + * Byte array representing OsId + OsAppId. The minimum length of the array is 18 and maximum + * length is 272 (16 bytes for OsId + 1 byte for OsAppId length + up to 255 bytes for OsAppId). + */ + byte[] osAppId; +} diff --git a/radio/aidl/android/hardware/radio/P2Constant.aidl b/radio/aidl/android/hardware/radio/P2Constant.aidl new file mode 100644 index 0000000000..d40a44645a --- /dev/null +++ b/radio/aidl/android/hardware/radio/P2Constant.aidl @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum P2Constant { + /** + * No P2 value is provided + */ + NO_P2 = -1, +} diff --git a/radio/aidl/android/hardware/radio/PbReceivedStatus.aidl b/radio/aidl/android/hardware/radio/PbReceivedStatus.aidl new file mode 100644 index 0000000000..44ed4d95e5 --- /dev/null +++ b/radio/aidl/android/hardware/radio/PbReceivedStatus.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. + */ + +package android.hardware.radio; + +/** + * Enum representing the status of the received PB indication. + */ +@VintfStability +@Backing(type="byte") +enum PbReceivedStatus { + /** + * Indicates that retrieval is fine. + */ + PB_RECEIVED_OK = 1, + /** + * Indicates that an error happened. In general, the process can't be restored soon. + */ + PB_RECEIVED_ERROR = 2, + /** + * Indicates that the process is interrupted. In this case, the modem might need resources and + * interrupt the current process, or it is timed out to receive all indications, and client can + * retry soon. + */ + PB_RECEIVED_ABORT = 3, + /** + * Indicates that the whole process is finished with a full chunk of phonebook data, meaning + * this is the last indication with the remaining data. + */ + PB_RECEIVED_FINAL = 4, +} diff --git a/radio/aidl/android/hardware/radio/PcoDataInfo.aidl b/radio/aidl/android/hardware/radio/PcoDataInfo.aidl new file mode 100644 index 0000000000..7b600e6622 --- /dev/null +++ b/radio/aidl/android/hardware/radio/PcoDataInfo.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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable PcoDataInfo { + /** + * Context ID, uniquely identifies this call + */ + int cid; + /** + * One of the PDP_type values in TS 27.007 section 10.1.1. For example, "IP", "IPV6", "IPV4V6" + */ + String bearerProto; + /** + * The protocol ID for this box. Note that only IDs from FF00H - FFFFH are accepted. + * If more than one is included from the network, multiple calls must be made to send + * all of them. + */ + int pcoId; + /** + * Carrier-defined content. It is binary, opaque and loosely defined in LTE Layer 3 spec 24.008 + */ + byte[] contents; +} diff --git a/radio/aidl/android/hardware/radio/PdpProtocolType.aidl b/radio/aidl/android/hardware/radio/PdpProtocolType.aidl new file mode 100644 index 0000000000..e74b1e3da2 --- /dev/null +++ b/radio/aidl/android/hardware/radio/PdpProtocolType.aidl @@ -0,0 +1,53 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Specifies the type of packet data protocol which is defined in TS 27.007 section 10.1.1. + */ +@VintfStability +@Backing(type="int") +enum PdpProtocolType { + /** + * Unknown protocol + */ + UNKNOWN = -1, + /** + * Internet protocol + */ + IP = 0, + /** + * Internet protocol, version 6 + */ + IPV6 = 1, + /** + * Virtual PDP type introduced to handle dual IP stack UE capability. + */ + IPV4V6 = 2, + /** + * Point to point protocol + */ + PPP = 3, + /** + * Transfer of Non-IP data to external packet data network + */ + NON_IP = 4, + /** + * Transfer of Unstructured data to the Data Network via N6 + */ + UNSTRUCTURED = 5, +} diff --git a/radio/aidl/android/hardware/radio/PersoSubstate.aidl b/radio/aidl/android/hardware/radio/PersoSubstate.aidl new file mode 100644 index 0000000000..93b2af53c4 --- /dev/null +++ b/radio/aidl/android/hardware/radio/PersoSubstate.aidl @@ -0,0 +1,98 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Additional personalization categories in addition to those specified in 3GPP TS 22.022 and + * 3GPP2 C.S0068-0. + */ +@VintfStability +@Backing(type="int") +enum PersoSubstate { + /** + * Initial state + */ + UNKNOWN, + /** + * In between each lock transition + */ + IN_PROGRESS, + /** + * When either SIM or RUIM Perso is finished since each app must only have 1 active perso + * involved. + */ + READY, + SIM_NETWORK, + SIM_NETWORK_SUBSET, + SIM_CORPORATE, + SIM_SERVICE_PROVIDER, + SIM_SIM, + /** + * The corresponding perso lock is blocked + */ + SIM_NETWORK_PUK, + SIM_NETWORK_SUBSET_PUK, + SIM_CORPORATE_PUK, + SIM_SERVICE_PROVIDER_PUK, + SIM_SIM_PUK, + RUIM_NETWORK1, + RUIM_NETWORK2, + RUIM_HRPD, + RUIM_CORPORATE, + RUIM_SERVICE_PROVIDER, + RUIM_RUIM, + /** + * The corresponding perso lock is blocked + */ + RUIM_NETWORK1_PUK, + RUIM_NETWORK2_PUK, + RUIM_HRPD_PUK, + RUIM_CORPORATE_PUK, + RUIM_SERVICE_PROVIDER_PUK, + RUIM_RUIM_PUK, + /** + * The device is personalized using the content of the Service Provider Name (SPN) in the SIM + * card. + */ + SIM_SPN, + SIM_SPN_PUK, + /** + * Service Provider and Equivalent Home PLMN. The device is personalized using both the content + * of the GID1 (equivalent to service provider personalization) and the content of the + * Equivalent Home PLMN (EHPLMN) in the SIM card. If the GID1 in the SIM is absent, then just + * the content of the Equivalent Home PLMN is matched. + */ + SIM_SP_EHPLMN, + SIM_SP_EHPLMN_PUK, + /** + * Device is personalized using the first digits of the ICCID of the SIM card. + */ + SIM_ICCID, + SIM_ICCID_PUK, + /** + * Device is personalized using the content of the IMPI in the ISIM. + */ + SIM_IMPI, + SIM_IMPI_PUK, + /** + * Network Subset and Service Provider. Device is personalized using both the content of GID1 + * (equivalent to service provider personalization) and the first digits of the IMSI (equivalent + * to network subset personalization). + */ + SIM_NS_SP, + SIM_NS_SP_PUK, +} diff --git a/radio/aidl/android/hardware/radio/PhoneRestrictedState.aidl b/radio/aidl/android/hardware/radio/PhoneRestrictedState.aidl new file mode 100644 index 0000000000..5f5f1b8a39 --- /dev/null +++ b/radio/aidl/android/hardware/radio/PhoneRestrictedState.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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum PhoneRestrictedState { + /** + * No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. + */ + NONE = 0x00, + /** + * Block emergency call due to restriction. But allow all normal voice/SMS/USSD/SS/AV64. + */ + CS_EMERGENCY = 0x01, + /** + * Block all normal voice/SMS/USSD/SS/AV64 due to restriction. Only Emergency call allowed. + */ + CS_NORMAL = 0x02, + /** + * Block all voice/SMS/USSD/SS/AV64 including emergency call due to restriction. + */ + CS_ALL = 0x04, + /** + * Block packet data access due to restriction. + */ + PS_ALL = 0x10, +} diff --git a/radio/aidl/android/hardware/radio/PhonebookCapacity.aidl b/radio/aidl/android/hardware/radio/PhonebookCapacity.aidl new file mode 100644 index 0000000000..c14141114b --- /dev/null +++ b/radio/aidl/android/hardware/radio/PhonebookCapacity.aidl @@ -0,0 +1,61 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable PhonebookCapacity { + /** + * Maximum number of ADN records possible in the SIM phonebook. Needs to be non-negative. + */ + int maxAdnRecords; + /** + * Used ADN records in the SIM phonebook. Needs to be non-negative. + */ + int usedAdnRecords; + /** + * Maximum email records possible in the SIM phonebook. Needs to be non-negative. + */ + int maxEmailRecords; + /** + * Used email records in the SIM phonebook. Needs to be non-negative. + */ + int usedEmailRecords; + /** + * Maximum additional number records possible in the SIM phonebook. Needs to be non-negative. + */ + int maxAdditionalNumberRecords; + /** + * Used additional number records in the SIM phonebook. Needs to be non-negative. + */ + int usedAdditionalNumberRecords; + /** + * Maximum name length possible in the SIM phonebook. Needs to be non-negative. + */ + int maxNameLen; + /** + * Maximum number length possible in the SIM phonebook. Needs to be non-negative. + */ + int maxNumberLen; + /** + * Maximum email length possible in the SIM phonebook. Needs to be non-negative. + */ + int maxEmailLen; + /** + * Maximum additional number length possible in the SIM phonebook. Needs to be non-negative. + */ + int maxAdditionalNumberLen; +} diff --git a/radio/aidl/android/hardware/radio/PhonebookRecordInfo.aidl b/radio/aidl/android/hardware/radio/PhonebookRecordInfo.aidl new file mode 100644 index 0000000000..eb0c880d26 --- /dev/null +++ b/radio/aidl/android/hardware/radio/PhonebookRecordInfo.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. + */ + +package android.hardware.radio; + +/** + * 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. + */ +@VintfStability +parcelable PhonebookRecordInfo { + /** + * Record index. 0 is used to insert a record + */ + int recordId; + /** + * Alpha identifier, empty string if no value + */ + String name; + /** + * Dialling number, empty string if no value + */ + String number; + /** + * Email addresses + */ + String[] emails; + /** + * Additional numbers + */ + String[] additionalNumbers; +} diff --git a/radio/aidl/android/hardware/radio/PhysicalChannelConfig.aidl b/radio/aidl/android/hardware/radio/PhysicalChannelConfig.aidl new file mode 100644 index 0000000000..05b31e5dbf --- /dev/null +++ b/radio/aidl/android/hardware/radio/PhysicalChannelConfig.aidl @@ -0,0 +1,68 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellConnectionStatus; +import android.hardware.radio.PhysicalChannelConfigBand; +import android.hardware.radio.RadioTechnology; + +@VintfStability +parcelable PhysicalChannelConfig { + /** + * Connection status for cell. Valid values are PRIMARY_SERVING and SECONDARY_SERVING + */ + CellConnectionStatus status; + /** + * The radio technology for this physical channel + */ + RadioTechnology rat; + /** + * Downlink Absolute Radio Frequency Channel Number + */ + int downlinkChannelNumber; + /** + * Uplink Absolute Radio Frequency Channel Number + */ + int uplinkChannelNumber; + /** + * Downlink cell bandwidth, in kHz + */ + int cellBandwidthDownlinkKhz; + /** + * Uplink cell bandwidth, in kHz + */ + int cellBandwidthUplinkKhz; + /** + * A list of data calls mapped to this physical channel. The context id must match the cid of + * SetupDataCallResult. An empty list means the physical channel has no data call mapped to it. + */ + int[] contextIds; + /** + * The physical cell identifier for this cell. + * In UTRAN, this value is primary scrambling code. The range is [0, 511]. + * Reference: 3GPP TS 25.213 section 5.2.2. + * In EUTRAN, this value is physical layer cell identity. The range is [0, 503]. + * Reference: 3GPP TS 36.211 section 6.11. + * In NGRAN, this value is physical layer cell identity. The range is [0, 1007]. + * Reference: 3GPP TS 38.211 section 7.4.2.1. + */ + int physicalCellId; + /** + * The frequency band to scan. + */ + PhysicalChannelConfigBand band; +} diff --git a/radio/aidl/android/hardware/radio/PhysicalChannelConfigBand.aidl b/radio/aidl/android/hardware/radio/PhysicalChannelConfigBand.aidl new file mode 100644 index 0000000000..953b1c4b28 --- /dev/null +++ b/radio/aidl/android/hardware/radio/PhysicalChannelConfigBand.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.EutranBands; +import android.hardware.radio.GeranBands; +import android.hardware.radio.NgranBands; +import android.hardware.radio.UtranBands; + +@VintfStability +union PhysicalChannelConfigBand { + boolean noinit; + /** + * Valid only if radioAccessNetwork = GERAN. + */ + GeranBands geranBand; + /** + * Valid only if radioAccessNetwork = UTRAN. + */ + UtranBands utranBand; + /** + * Valid only if radioAccessNetwork = EUTRAN. + */ + EutranBands eutranBand; + /** + * Valid only if radioAccessNetwork = NGRAN. + */ + NgranBands ngranBand; +} diff --git a/radio/aidl/android/hardware/radio/PinState.aidl b/radio/aidl/android/hardware/radio/PinState.aidl new file mode 100644 index 0000000000..cb42ff232b --- /dev/null +++ b/radio/aidl/android/hardware/radio/PinState.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum PinState { + UNKNOWN, + ENABLED_NOT_VERIFIED, + ENABLED_VERIFIED, + DISABLED, + ENABLED_BLOCKED, + ENABLED_PERM_BLOCKED, +} diff --git a/radio/aidl/android/hardware/radio/PortRange.aidl b/radio/aidl/android/hardware/radio/PortRange.aidl new file mode 100644 index 0000000000..932d54a304 --- /dev/null +++ b/radio/aidl/android/hardware/radio/PortRange.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Defines range of ports. start and end are the first and last port numbers (inclusive) in the + * range. Both start and end are in QosPortRange.MIN to QosPortRange.MAX range. A single port shall + * be represented by the same start and end value. + */ +@VintfStability +parcelable PortRange { + int start; + int end; +} diff --git a/radio/aidl/android/hardware/radio/PreferredNetworkType.aidl b/radio/aidl/android/hardware/radio/PreferredNetworkType.aidl new file mode 100644 index 0000000000..7ca38c6a79 --- /dev/null +++ b/radio/aidl/android/hardware/radio/PreferredNetworkType.aidl @@ -0,0 +1,114 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum PreferredNetworkType { + /** + * GSM/WCDMA (WCDMA preferred) + */ + GSM_WCDMA, + /** + * GSM only + */ + GSM_ONLY, + /** + * WCDMA + */ + WCDMA, + /** + * GSM/WCDMA (auto mode, according to PRL) + */ + GSM_WCDMA_AUTO, + /** + * CDMA and EvDo (auto mode, according to PRL) + */ + CDMA_EVDO_AUTO, + /** + * CDMA only + */ + CDMA_ONLY, + /** + * EvDo only + */ + EVDO_ONLY, + /** + * GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL) + */ + GSM_WCDMA_CDMA_EVDO_AUTO, + /** + * LTE, CDMA and EvDo + */ + LTE_CDMA_EVDO, + /** + * LTE, GSM/WCDMA + */ + LTE_GSM_WCDMA, + /** + * LTE, CDMA, EvDo, GSM/WCDMA + */ + LTE_CMDA_EVDO_GSM_WCDMA, + /** + * LTE only + */ + LTE_ONLY, + /** + * LTE/WCDMA only + */ + LTE_WCDMA, + /** + * TD-SCDMA only + */ + TD_SCDMA_ONLY, + /** + * TD-SCDMA and WCDMA + */ + TD_SCDMA_WCDMA, + /** + * TD-SCDMA and LTE + */ + TD_SCDMA_LTE, + /** + * TD-SCDMA and GSM + */ + TD_SCDMA_GSM, + /** + * TD-SCDMA,GSM and LTE + */ + TD_SCDMA_GSM_LTE, + /** + * TD-SCDMA, GSM/WCDMA + */ + TD_SCDMA_GSM_WCDMA, + /** + * TD-SCDMA, WCDMA and LTE + */ + TD_SCDMA_WCDMA_LTE, + /** + * TD-SCDMA, GSM/WCDMA and LTE + */ + TD_SCDMA_GSM_WCDMA_LTE, + /** + * TD-SCDMA, GSM/WCDMA, CDMA and EvDo + */ + TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO, + /** + * TD-SCDMA, LTE, CDMA, EvDo GSM/WCDMA + */ + TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA, +} diff --git a/radio/aidl/android/hardware/radio/PrlIndicator.aidl b/radio/aidl/android/hardware/radio/PrlIndicator.aidl new file mode 100644 index 0000000000..acd870e116 --- /dev/null +++ b/radio/aidl/android/hardware/radio/PrlIndicator.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum PrlIndicator { + NOT_REGISTERED = -1, + NOT_IN_PRL = 0, + IN_PRL = 1, +} diff --git a/radio/aidl/android/hardware/radio/PublicKeyType.aidl b/radio/aidl/android/hardware/radio/PublicKeyType.aidl new file mode 100644 index 0000000000..c1babc4356 --- /dev/null +++ b/radio/aidl/android/hardware/radio/PublicKeyType.aidl @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Public key type from carrier certificate. + */ +@VintfStability +@Backing(type="byte") +enum PublicKeyType { + /** + * Key type to be used for ePDG + */ + EPDG = 1, + /** + * Key type to be used for WLAN + */ + WLAN = 2, +} diff --git a/radio/aidl/android/hardware/radio/Qos.aidl b/radio/aidl/android/hardware/radio/Qos.aidl new file mode 100644 index 0000000000..0f84ad1406 --- /dev/null +++ b/radio/aidl/android/hardware/radio/Qos.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.EpsQos; +import android.hardware.radio.NrQos; + +/** + * EPS or NR QOS parameters + */ +@VintfStability +union Qos { + boolean noinit; + EpsQos eps; + NrQos nr; +} diff --git a/radio/aidl/android/hardware/radio/QosBandwidth.aidl b/radio/aidl/android/hardware/radio/QosBandwidth.aidl new file mode 100644 index 0000000000..344b796ed9 --- /dev/null +++ b/radio/aidl/android/hardware/radio/QosBandwidth.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable QosBandwidth { + /** + * Maximum bit rate possible on the bearer + */ + int maxBitrateKbps; + /** + * Minimum bit rate that is guaranteed to be provided by the network + */ + int guaranteedBitrateKbps; +} diff --git a/radio/aidl/android/hardware/radio/QosFilter.aidl b/radio/aidl/android/hardware/radio/QosFilter.aidl new file mode 100644 index 0000000000..717944a8fa --- /dev/null +++ b/radio/aidl/android/hardware/radio/QosFilter.aidl @@ -0,0 +1,69 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.MaybePort; +import android.hardware.radio.QosFilterDirection; +import android.hardware.radio.QosFilterIpsecSpi; +import android.hardware.radio.QosFilterIpv6FlowLabel; +import android.hardware.radio.QosFilterTypeOfService; +import android.hardware.radio.QosProtocol; + +/** + * See 3gpp 24.008 10.5.6.12 and 3gpp 24.501 9.11.4.13 + */ +@VintfStability +parcelable QosFilter { + /** + * Local and remote IP addresses, typically one IPv4 or one IPv6 or one of each. Addresses could + * be with optional "/" prefix length, e.g.,"192.0.1.3" or "192.0.1.11/16 2001:db8::1/64". + * If the prefix length is absent the addresses are assumed to be point to point with IPv4 + * having a prefix length of 32 and IPv6 128. + */ + String[] localAddresses; + String[] remoteAddresses; + /** + * Local and remote port/ranges + */ + MaybePort localPort; + MaybePort remotePort; + /** + * QoS protocol + */ + QosProtocol protocol; + /** + * Type of service value or mask as defined in RFC 1349 + */ + QosFilterTypeOfService tos; + /** + * IPv6 flow label as defined in RFC 6437 + */ + QosFilterIpv6FlowLabel flowLabel; + /** + * IPSec security parameter index + */ + QosFilterIpsecSpi spi; + /** + * Filter direction + */ + QosFilterDirection direction; + /** + * Specifies the order in which the filter needs to be matched. A lower numerical (positive) + * value has a higher precedence. Set -1 when unspecified. + */ + int precedence; +} diff --git a/radio/aidl/android/hardware/radio/QosFilterDirection.aidl b/radio/aidl/android/hardware/radio/QosFilterDirection.aidl new file mode 100644 index 0000000000..7693c8cf2c --- /dev/null +++ b/radio/aidl/android/hardware/radio/QosFilterDirection.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="byte") +enum QosFilterDirection { + DOWNLINK, + UPLINK, + BIDIRECTIONAL, +} diff --git a/radio/aidl/android/hardware/radio/QosFilterIpsecSpi.aidl b/radio/aidl/android/hardware/radio/QosFilterIpsecSpi.aidl new file mode 100644 index 0000000000..e213402bc1 --- /dev/null +++ b/radio/aidl/android/hardware/radio/QosFilterIpsecSpi.aidl @@ -0,0 +1,23 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +union QosFilterIpsecSpi { + boolean noinit; + int value; +} diff --git a/radio/aidl/android/hardware/radio/QosFilterIpv6FlowLabel.aidl b/radio/aidl/android/hardware/radio/QosFilterIpv6FlowLabel.aidl new file mode 100644 index 0000000000..d5c5a6c830 --- /dev/null +++ b/radio/aidl/android/hardware/radio/QosFilterIpv6FlowLabel.aidl @@ -0,0 +1,23 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +union QosFilterIpv6FlowLabel { + boolean noinit; + int value; +} diff --git a/radio/aidl/android/hardware/radio/QosFilterTypeOfService.aidl b/radio/aidl/android/hardware/radio/QosFilterTypeOfService.aidl new file mode 100644 index 0000000000..b91323cb43 --- /dev/null +++ b/radio/aidl/android/hardware/radio/QosFilterTypeOfService.aidl @@ -0,0 +1,23 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +union QosFilterTypeOfService { + boolean noinit; + byte value; +} diff --git a/radio/aidl/android/hardware/radio/QosFlowIdRange.aidl b/radio/aidl/android/hardware/radio/QosFlowIdRange.aidl new file mode 100644 index 0000000000..df2398b193 --- /dev/null +++ b/radio/aidl/android/hardware/radio/QosFlowIdRange.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Allowed values for 5G QOS flow identifier + */ +@VintfStability +@Backing(type="byte") +enum QosFlowIdRange { + MIN = 1, + MAX = 63, +} diff --git a/radio/aidl/android/hardware/radio/QosPortRange.aidl b/radio/aidl/android/hardware/radio/QosPortRange.aidl new file mode 100644 index 0000000000..f3df19f956 --- /dev/null +++ b/radio/aidl/android/hardware/radio/QosPortRange.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Allowed port numbers + */ +@VintfStability +@Backing(type="int") +enum QosPortRange { + MIN = 20, + MAX = 65535, +} diff --git a/radio/aidl/android/hardware/radio/QosProtocol.aidl b/radio/aidl/android/hardware/radio/QosProtocol.aidl new file mode 100644 index 0000000000..05cd670b18 --- /dev/null +++ b/radio/aidl/android/hardware/radio/QosProtocol.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. + */ + +package android.hardware.radio; + +/** + * Next header protocol numbers defined by IANA, RFC 5237 + */ +@VintfStability +@Backing(type="byte") +enum QosProtocol { + /** + * No protocol specified + */ + UNSPECIFIED = -1, + /** + * Transmission Control Protocol + */ + TCP = 6, + /** + * User Datagram Protocol + */ + UDP = 17, + /** + * Encapsulating Security Payload Protocol + */ + ESP = 50, + /** + * Authentication Header + */ + AH = 51, +} diff --git a/radio/aidl/android/hardware/radio/QosSession.aidl b/radio/aidl/android/hardware/radio/QosSession.aidl new file mode 100644 index 0000000000..2620ac5af1 --- /dev/null +++ b/radio/aidl/android/hardware/radio/QosSession.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.Qos; +import android.hardware.radio.QosFilter; + +/** + * QOS session associated with a dedicated bearer + */ +@VintfStability +parcelable QosSession { + /** + * Unique ID of the QoS session within the data call + */ + int qosSessionId; + /** + * QOS attributes + */ + Qos qos; + /** + * List of QOS filters associated with this session + */ + QosFilter[] qosFilters; +} diff --git a/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl b/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl new file mode 100644 index 0000000000..719837dd56 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioAccessFamily.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.RadioTechnology; + +@VintfStability +@Backing(type="int") +enum RadioAccessFamily { + UNKNOWN = 1 << RadioTechnology.UNKNOWN, + GPRS = 1 << RadioTechnology.GPRS, + EDGE = 1 << RadioTechnology.EDGE, + UMTS = 1 << RadioTechnology.UMTS, + IS95A = 1 << RadioTechnology.IS95A, + IS95B = 1 << RadioTechnology.IS95B, + ONE_X_RTT = 1 << RadioTechnology.ONE_X_RTT, + EVDO_0 = 1 << RadioTechnology.EVDO_0, + EVDO_A = 1 << RadioTechnology.EVDO_A, + HSDPA = 1 << RadioTechnology.HSDPA, + HSUPA = 1 << RadioTechnology.HSUPA, + HSPA = 1 << RadioTechnology.HSPA, + EVDO_B = 1 << RadioTechnology.EVDO_B, + EHRPD = 1 << RadioTechnology.EHRPD, + LTE = 1 << RadioTechnology.LTE, + HSPAP = 1 << RadioTechnology.HSPAP, + GSM = 1 << RadioTechnology.GSM, + TD_SCDMA = 1 << RadioTechnology.TD_SCDMA, + LTE_CA = 1 << RadioTechnology.LTE_CA, + /** + * 5G NR. This is only use in 5G Standalone mode. + */ + NR = 1 << RadioTechnology.NR, +} diff --git a/radio/aidl/android/hardware/radio/RadioAccessNetworks.aidl b/radio/aidl/android/hardware/radio/RadioAccessNetworks.aidl new file mode 100644 index 0000000000..3757233f24 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioAccessNetworks.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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum RadioAccessNetworks { + UNKNOWN, + /** + * GSM EDGE Radio Access Network + */ + GERAN, + /** + * Universal Terrestrial Radio Access Network + */ + UTRAN, + /** + * Evolved Universal Terrestrial Radio Access Network + */ + EUTRAN, + /** + * Next Generation Radio Access Network + */ + NGRAN, + /** + * CDMA 2000 Network + */ + CDMA2000, +} diff --git a/radio/aidl/android/hardware/radio/RadioAccessSpecifier.aidl b/radio/aidl/android/hardware/radio/RadioAccessSpecifier.aidl new file mode 100644 index 0000000000..889124a728 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioAccessSpecifier.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.RadioAccessNetworks; +import android.hardware.radio.RadioAccessSpecifierBands; + +@VintfStability +parcelable RadioAccessSpecifier { + /** + * The type of network to scan. + */ + RadioAccessNetworks radioAccessNetwork; + /** + * The frequency bands to scan. Maximum length of the vector is 8. + */ + RadioAccessSpecifierBands bands; + /** + * The radio channels to scan as defined in 3GPP TS 25.101 and 36.101. + * Maximum length of the vector is 32. + */ + int[] channels; +} diff --git a/radio/aidl/android/hardware/radio/RadioAccessSpecifierBands.aidl b/radio/aidl/android/hardware/radio/RadioAccessSpecifierBands.aidl new file mode 100644 index 0000000000..dde46262dc --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioAccessSpecifierBands.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.EutranBands; +import android.hardware.radio.GeranBands; +import android.hardware.radio.NgranBands; +import android.hardware.radio.UtranBands; + +@VintfStability +union RadioAccessSpecifierBands { + boolean noinit; + /** + * Valid only if radioAccessNetwork = GERAN. + */ + GeranBands[] geranBands; + /** + * Valid only if radioAccessNetwork = UTRAN. + */ + UtranBands[] utranBands; + /** + * Valid only if radioAccessNetwork = EUTRAN. + */ + EutranBands[] eutranBands; + /** + * Valid only if radioAccessNetwork = NGRAN. + */ + NgranBands[] ngranBands; +} diff --git a/radio/aidl/android/hardware/radio/RadioBandMode.aidl b/radio/aidl/android/hardware/radio/RadioBandMode.aidl new file mode 100644 index 0000000000..e6064c4dad --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioBandMode.aidl @@ -0,0 +1,98 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum RadioBandMode { + /** + * "Unspecified" (selected by baseband automatically) + */ + BAND_MODE_UNSPECIFIED, + /** + * "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000) + */ + BAND_MODE_EURO, + /** + * "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900) + */ + BAND_MODE_USA, + /** + * "JPN band" (WCDMA-800 / WCDMA-IMT-2000) + */ + BAND_MODE_JPN, + /** + * "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000) + */ + BAND_MODE_AUS, + /** + * "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850) + */ + BAND_MODE_AUS_2, + /** + * "Cellular" (800-MHz Band) + */ + BAND_MODE_CELL_800, + /** + * "PCS" (1900-MHz Band) + */ + BAND_MODE_PCS, + /** + * "Band Class 3" (JTACS Band) + */ + BAND_MODE_JTACS, + /** + * "Band Class 4" (Korean PCS Band) + */ + BAND_MODE_KOREA_PCS, + /** + * "Band Class 5" (450-MHz Band) + */ + BAND_MODE_5_450M, + /** + * "Band Class 6" (2-GMHz IMT2000 Band) + */ + BAND_MODE_IMT2000, + /** + * "Band Class 7" (Upper 700-MHz Band) + */ + BAND_MODE_7_700M_2, + /** + * "Band Class 8" (1800-MHz Band) + */ + BAND_MODE_8_1800M, + /** + * "Band Class 9" (900-MHz Band) + */ + BAND_MODE_9_900M, + /** + * "Band Class 10" (Secondary 800-MHz Band) + */ + BAND_MODE_10_800M_2, + /** + * "Band Class 11" (400-MHz European PAMR Band) + */ + BAND_MODE_EURO_PAMR_400M, + /** + * "Band Class 15" (AWS Band) + */ + BAND_MODE_AWS, + /** + * "Band Class 16" (US 2.5-GHz Band) + */ + BAND_MODE_USA_2500M, +} diff --git a/radio/aidl/android/hardware/radio/RadioCapability.aidl b/radio/aidl/android/hardware/radio/RadioCapability.aidl new file mode 100644 index 0000000000..d911b6facf --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioCapability.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.RadioAccessFamily; +import android.hardware.radio.RadioCapabilityPhase; +import android.hardware.radio.RadioCapabilityStatus; + +@VintfStability +parcelable RadioCapability { + /** + * Unique session value defined by framework returned in all "responses/unslo". + */ + int session; + RadioCapabilityPhase phase; + /** + * 32-bit bitmap of RadioAccessFamily. + */ + RadioAccessFamily raf; + /** + * A UUID typically "com.xxxx.lmX" where X is the logical modem. + * RadioConst:MAX_UUID_LENGTH is the max length. + */ + String logicalModemUuid; + RadioCapabilityStatus status; +} diff --git a/radio/aidl/android/hardware/radio/RadioCapabilityPhase.aidl b/radio/aidl/android/hardware/radio/RadioCapabilityPhase.aidl new file mode 100644 index 0000000000..a586300565 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioCapabilityPhase.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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum RadioCapabilityPhase { + /** + * Logical Modem's (LM) initial value and value after FINISH completes + */ + CONFIGURED, + /** + * START is sent before APPLY and indicates that an APPLY is forthcoming with these same + * parameters. + */ + START, + /** + * APPLY is sent after all LM's receive START and returned RadioCapability.status = 0. + * If any START's fail, hal implementation must not send APPLY. + */ + APPLY, + /** + * UNSOL_RSP is sent with unsolicited radioCapability() + */ + UNSOL_RSP, + /** + * FINISH is sent after all commands have completed. If an error occurs in any previous command, + * the RadioAccessFamily and logicalModemUuid fields must be the prior configuration thus + * restoring the configuration to the previous value. An error returned by FINISH will generally + * be ignored or may cause that LM to be removed from service. + */ + FINISH, +} diff --git a/radio/aidl/android/hardware/radio/RadioCapabilityStatus.aidl b/radio/aidl/android/hardware/radio/RadioCapabilityStatus.aidl new file mode 100644 index 0000000000..5b90f38ea5 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioCapabilityStatus.aidl @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum RadioCapabilityStatus { + /** + * This parameter has no meaning with RadioCapabilityPhase:START, RadioCapabilityPhase:APPLY + */ + NONE, + /** + * Tell modem the action transaction of set radio capability was successful with + * RadioCapabilityPhase:FINISH + */ + SUCCESS, + /** + * Tell modem the action transaction of set radio capability failed with + * RadioCapabilityPhase:FINISH + */ + FAIL, +} diff --git a/radio/aidl/android/hardware/radio/RadioCdmaSmsConst.aidl b/radio/aidl/android/hardware/radio/RadioCdmaSmsConst.aidl new file mode 100644 index 0000000000..f480077e3f --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioCdmaSmsConst.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum RadioCdmaSmsConst { + ADDRESS_MAX = 36, + SUBADDRESS_MAX = 36, + BEARER_DATA_MAX = 255, + UDH_MAX_SND_SIZE = 128, + UDH_EO_DATA_SEGMENT_MAX = 131, + MAX_UD_HEADERS = 7, + USER_DATA_MAX = 229, + UDH_LARGE_PIC_SIZE = 128, + UDH_SMALL_PIC_SIZE = 32, + UDH_VAR_PIC_SIZE = 134, + UDH_ANIM_NUM_BITMAPS = 4, + UDH_LARGE_BITMAP_SIZE = 32, + UDH_SMALL_BITMAP_SIZE = 8, + UDH_OTHER_SIZE = 226, + IP_ADDRESS_SIZE = 4, +} diff --git a/radio/aidl/android/hardware/radio/RadioConst.aidl b/radio/aidl/android/hardware/radio/RadioConst.aidl new file mode 100644 index 0000000000..815b3b95e8 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioConst.aidl @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum RadioConst { + CDMA_ALPHA_INFO_BUFFER_LENGTH = 64, + CDMA_NUMBER_INFO_BUFFER_LENGTH = 81, + MAX_RILDS = 3, + MAX_SOCKET_NAME_LENGTH = 6, + MAX_CLIENT_ID_LENGTH = 2, + MAX_DEBUG_SOCKET_NAME_LENGTH = 12, + MAX_QEMU_PIPE_NAME_LENGTH = 11, + MAX_UUID_LENGTH = 64, + CARD_MAX_APPS = 8, + CDMA_MAX_NUMBER_OF_INFO_RECS = 10, + SS_INFO_MAX = 4, + NUM_SERVICE_CLASSES = 7, + NUM_TX_POWER_LEVELS = 5, + RADIO_ACCESS_SPECIFIER_MAX_SIZE = 8, +} diff --git a/radio/aidl/android/hardware/radio/RadioError.aidl b/radio/aidl/android/hardware/radio/RadioError.aidl new file mode 100644 index 0000000000..a708d2bd9c --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioError.aidl @@ -0,0 +1,299 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum RadioError { + /** + * Success + */ + NONE = 0, + /** + * If radio did not start or is resetting + */ + RADIO_NOT_AVAILABLE = 1, + GENERIC_FAILURE = 2, + /** + * For PIN/PIN2 methods only + */ + PASSWORD_INCORRECT = 3, + /** + * Operation requires SIM PIN2 to be entered + */ + SIM_PIN2 = 4, + /** + * Operation requires SIM PUK2 to be entered + */ + SIM_PUK2 = 5, + REQUEST_NOT_SUPPORTED = 6, + CANCELLED = 7, + /** + * Data ops are not allowed during voice call on a Class C GPRS device + */ + OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, + /** + * Data ops are not allowed before device registers in network + */ + OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9, + /** + * Fail to send SMS and need to retry + */ + SMS_SEND_FAIL_RETRY = 10, + /** + * Fail to set the location where CDMA subscription shall be retrieved because of SIM or + * RUIM card absent + */ + SIM_ABSENT = 11, + /** + * Fail to find CDMA subscription from specified location + */ + SUBSCRIPTION_NOT_AVAILABLE = 12, + /** + * HW does not support preferred network type + */ + MODE_NOT_SUPPORTED = 13, + /** + * Command failed becausee recipient is not on FDN list + */ + FDN_CHECK_FAILURE = 14, + /** + * Network selection failed due to illegal SIM or ME + */ + ILLEGAL_SIM_OR_ME = 15, + /** + * No logical channel available + */ + MISSING_RESOURCE = 16, + /** + * Application not found on SIM + */ + NO_SUCH_ELEMENT = 17, + /** + * DIAL request modified to USSD + */ + DIAL_MODIFIED_TO_USSD = 18, + /** + * DIAL request modified to SS + */ + DIAL_MODIFIED_TO_SS = 19, + /** + * DIAL request modified to DIAL with different data + */ + DIAL_MODIFIED_TO_DIAL = 20, + /** + * USSD request modified to DIAL + */ + USSD_MODIFIED_TO_DIAL = 21, + /** + * USSD request modified to SS + */ + USSD_MODIFIED_TO_SS = 22, + /** + * USSD request modified to different USSD request + */ + USSD_MODIFIED_TO_USSD = 23, + /** + * SS request modified to DIAL + */ + SS_MODIFIED_TO_DIAL = 24, + /** + * SS request modified to USSD + */ + SS_MODIFIED_TO_USSD = 25, + /** + * Subscription not supported by RIL + */ + SUBSCRIPTION_NOT_SUPPORTED = 26, + /** + * SS request modified to different SS request + */ + SS_MODIFIED_TO_SS = 27, + /** + * LCE service not supported(36 in RILConstants.java) + */ + LCE_NOT_SUPPORTED = 36, + /** + * Not sufficieent memory to process the request + */ + NO_MEMORY = 37, + /** + * Modem hit unexpected error scenario while handling this request + */ + INTERNAL_ERR = 38, + /** + * Hit platform or system error + */ + SYSTEM_ERR = 39, + /** + * Vendor RIL got unexpected or incorrect response from modem for this request + */ + MODEM_ERR = 40, + /** + * Unexpected request for the current state + */ + INVALID_STATE = 41, + /** + * Not sufficient resource to process the request + */ + NO_RESOURCES = 42, + /** + * Received error from SIM card + */ + SIM_ERR = 43, + /** + * Received invalid arguments in request + */ + INVALID_ARGUMENTS = 44, + /** + * Cannot process the request in current SIM state + */ + INVALID_SIM_STATE = 45, + /** + * Cannot process the request in current modem state + */ + INVALID_MODEM_STATE = 46, + /** + * Received invalid call ID in request + */ + INVALID_CALL_ID = 47, + /** + * ACK received when there is no SMS to ack + */ + NO_SMS_TO_ACK = 48, + /** + * Received error from network + */ + NETWORK_ERR = 49, + /** + * Operation denied due to overly-frequent requests + */ + REQUEST_RATE_LIMITED = 50, + /** + * SIM is busy + */ + SIM_BUSY = 51, + /** + * The target EF is full + */ + SIM_FULL = 52, + /** + * Request is rejected by network + */ + NETWORK_REJECT = 53, + /** + * Not allowed the request not + */ + OPERATION_NOT_ALLOWED = 54, + /** + * The request record is empty + */ + EMPTY_RECORD = 55, + /** + * Invalid SMS format + */ + INVALID_SMS_FORMAT = 56, + /** + * Message not encoded properly + */ + ENCODING_ERR = 57, + /** + * SMSC addrss specified is invalid + */ + INVALID_SMSC_ADDRESS = 58, + /** + * No such entry present to perform the request + */ + NO_SUCH_ENTRY = 59, + /** + * Network is not ready to perform the request + */ + NETWORK_NOT_READY = 60, + /** + * Device does not have this value provisioned + */ + NOT_PROVISIONED = 61, + /** + * Device does not have subscription + */ + NO_SUBSCRIPTION = 62, + /** + * Network cannot be found + */ + NO_NETWORK_FOUND = 63, + /** + * Operation cannot be performed because the device is currently in use + */ + DEVICE_IN_USE = 64, + /** + * Operation aborted + */ + ABORTED = 65, + /** + * Response from vendor had invalid data + */ + INVALID_RESPONSE = 66, + OEM_ERROR_1 = 501, + OEM_ERROR_2 = 502, + OEM_ERROR_3 = 503, + OEM_ERROR_4 = 504, + OEM_ERROR_5 = 505, + OEM_ERROR_6 = 506, + OEM_ERROR_7 = 507, + OEM_ERROR_8 = 508, + OEM_ERROR_9 = 509, + OEM_ERROR_10 = 510, + OEM_ERROR_11 = 511, + OEM_ERROR_12 = 512, + OEM_ERROR_13 = 513, + OEM_ERROR_14 = 514, + OEM_ERROR_15 = 515, + OEM_ERROR_16 = 516, + OEM_ERROR_17 = 517, + OEM_ERROR_18 = 518, + OEM_ERROR_19 = 519, + OEM_ERROR_20 = 520, + OEM_ERROR_21 = 521, + OEM_ERROR_22 = 522, + OEM_ERROR_23 = 523, + OEM_ERROR_24 = 524, + OEM_ERROR_25 = 525, + /** + * 1X voice and SMS are not allowed simulteneously. + */ + SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED = 67, + /** + * Access is barred. + */ + ACCESS_BARRED = 68, + /** + * SMS is blocked due to call control, e.g., resource unavailable + * in the SMR entity. + */ + BLOCKED_DUE_TO_CALL = 69, + /** + * Returned from setRadioPowerResponse when detecting RF HW issues. Some RF Front-End (RFFE) + * components like antenna are considered critical for modem to provide telephony service. + * This RadioError is used when modem detect such RFFE problem. + */ + RF_HARDWARE_ISSUE = 70, + /** + * Returned from setRadioPowerResponse when detecting no RF calibration issue. + * Unlike RF_HARDWARE_ISSUE, this is a SW problem and no HW repair is needed. + */ + NO_RF_CALIBRATION_INFO = 71, +} diff --git a/radio/aidl/android/hardware/radio/RadioFrequencyInfo.aidl b/radio/aidl/android/hardware/radio/RadioFrequencyInfo.aidl new file mode 100644 index 0000000000..e5aa9fb187 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioFrequencyInfo.aidl @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.FrequencyRange; + +@VintfStability +union RadioFrequencyInfo { + boolean noinit; + /** + * A rough frequency range. + */ + FrequencyRange range; + /** + * The Absolute Radio Frequency Channel Number. + */ + int channelNumber; +} diff --git a/radio/aidl/android/hardware/radio/RadioIndicationType.aidl b/radio/aidl/android/hardware/radio/RadioIndicationType.aidl new file mode 100644 index 0000000000..aa5215f439 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioIndicationType.aidl @@ -0,0 +1,24 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum RadioIndicationType { + UNSOLICITED, + UNSOLICITED_ACK_EXP, +} diff --git a/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl b/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl new file mode 100644 index 0000000000..d81c49c83e --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.RadioError; +import android.hardware.radio.RadioResponseType; + +@VintfStability +parcelable RadioResponseInfo { + /** + * Response type + */ + RadioResponseType type; + /** + * Serial number of the request + */ + int serial; + /** + * Response error + */ + RadioError error; +} diff --git a/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl b/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl new file mode 100644 index 0000000000..8c7b94c1a4 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioResponseInfoModem.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.RadioError; +import android.hardware.radio.RadioResponseType; + +@VintfStability +parcelable RadioResponseInfoModem { + /** + * Response type + */ + RadioResponseType type; + /** + * Serial number of the request + */ + int serial; + /** + * Response error + */ + RadioError error; + /** + * Whether the modem is enabled or not + */ + boolean isEnabled; +} diff --git a/radio/aidl/android/hardware/radio/RadioResponseType.aidl b/radio/aidl/android/hardware/radio/RadioResponseType.aidl new file mode 100644 index 0000000000..882c759eb1 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioResponseType.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum RadioResponseType { + SOLICITED, + SOLICITED_ACK, + SOLICITED_ACK_EXP, +} diff --git a/radio/aidl/android/hardware/radio/RadioState.aidl b/radio/aidl/android/hardware/radio/RadioState.aidl new file mode 100644 index 0000000000..1915870316 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioState.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum RadioState { + /** + * Radio explicitly powered off (eg CFUN=0) + */ + OFF = 0, + /** + * Radio unavailable (eg, resetting or not booted) + */ + UNAVAILABLE = 1, + /** + * Radio is on + */ + ON = 10, +} diff --git a/radio/aidl/android/hardware/radio/RadioTechnology.aidl b/radio/aidl/android/hardware/radio/RadioTechnology.aidl new file mode 100644 index 0000000000..d439866f2f --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioTechnology.aidl @@ -0,0 +1,52 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum RadioTechnology { + UNKNOWN, + GPRS, + EDGE, + UMTS, + IS95A, + IS95B, + ONE_X_RTT, + EVDO_0, + EVDO_A, + HSDPA, + HSUPA, + HSPA, + EVDO_B, + EHRPD, + LTE, + /** + * HSPA+ + */ + HSPAP, + /** + * Only supports voice + */ + GSM, + TD_SCDMA, + IWLAN, + LTE_CA, + /** + * 5G NR. This is only used in 5G Standalone mode. + */ + NR, +} diff --git a/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl b/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl new file mode 100644 index 0000000000..37a1df238b --- /dev/null +++ b/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum RadioTechnologyFamily { + /** + * 3GPP Technologies - GSM, WCDMA + */ + THREE_GPP, + /** + * 3GPP2 Technologies - CDMA + */ + THREE_GPP2, +} diff --git a/radio/aidl/android/hardware/radio/RegState.aidl b/radio/aidl/android/hardware/radio/RegState.aidl new file mode 100644 index 0000000000..91fd239868 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RegState.aidl @@ -0,0 +1,67 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * 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". + */ +@VintfStability +@Backing(type="int") +enum RegState { + /** + * Not registered, MT is not currently searching for a new operator to register + */ + NOT_REG_MT_NOT_SEARCHING_OP = 0, + /** + * Registered, home network + */ + REG_HOME = 1, + /** + * Not registered, but MT is currently searching for a new operator to register + */ + NOT_REG_MT_SEARCHING_OP = 2, + /** + * Registration denied + */ + REG_DENIED = 3, + /** + * Unknown + */ + UNKNOWN = 4, + /** + * Registered, roaming + */ + REG_ROAMING = 5, + /** + * Same as NOT_REG_MT_NOT_SEARCHING_OP but indicates that emergency calls are enabled + */ + NOT_REG_MT_NOT_SEARCHING_OP_EM = 10, + /** + * Same as NOT_REG_MT_SEARCHING_OP but indicatees that emergency calls are enabled + */ + NOT_REG_MT_SEARCHING_OP_EM = 12, + /** + * Same as REG_DENIED but indicates that emergency calls are enabled + */ + REG_DENIED_EM = 13, + /** + * Same as UNKNOWN but indicates that emergency calls are enabled + */ + UNKNOWN_EM = 14, +} diff --git a/radio/aidl/android/hardware/radio/RegStateResult.aidl b/radio/aidl/android/hardware/radio/RegStateResult.aidl new file mode 100644 index 0000000000..4bc55c40c2 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RegStateResult.aidl @@ -0,0 +1,60 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentity; +import android.hardware.radio.RadioTechnology; +import android.hardware.radio.RegState; +import android.hardware.radio.RegStateResultAccessTechnologySpecificInfo; +import android.hardware.radio.RegistrationFailCause; + +@VintfStability +parcelable RegStateResult { + /** + * Registration state. If the RAT is indicated as a GERAN, UTRAN, or CDMA2000 technology, this + * value reports registration in the Circuit-switched domain. If the RAT is indicated as an + * EUTRAN, NGRAN, or another technology that does not support circuit-switched services, this + * value reports registration in the Packet-switched domain. + */ + RegState regState; + /** + * Indicates the available voice radio technology, valid values as defined by RadioTechnology, + * except LTE_CA, which is no longer a valid value on 1.5 or above. When the device is on + * carrier aggregation, vendor RIL service should properly report multiple PhysicalChannelConfig + * elements through IRadio::currentPhysicalChannelConfigs. + */ + RadioTechnology rat; + /** + * Cause code reported by the network in case registration fails. This will be a mobility + * management cause code defined for MM, GMM, MME or equivalent as appropriate for the RAT. + */ + RegistrationFailCause reasonForDenial; + /** + * CellIdentity + */ + CellIdentity cellIdentity; + /** + * The most-recent PLMN-ID upon which the UE registered (or attempted to register if a failure + * is reported in the reasonForDenial field). This PLMN shall be in standard format consisting + * of a 3 digit MCC concatenated with a 2 or 3 digit MNC. + */ + String registeredPlmn; + /** + * Access-technology-specific registration information, such as for CDMA2000. + */ + RegStateResultAccessTechnologySpecificInfo accessTechnologySpecificInfo; +} diff --git a/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.aidl b/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.aidl new file mode 100644 index 0000000000..b22e413dd7 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.NrVopsInfo; +import android.hardware.radio.RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo; +import android.hardware.radio.RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo; + +@VintfStability +union RegStateResultAccessTechnologySpecificInfo { + boolean noinit; + RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo cdmaInfo; + RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo eutranInfo; + /** + * Network capabilities for voice over PS services. This info is valid only on NR network and + * must be present when the device is camped on NR. VopsInfo must be empty when the device is + * not camped on NR. + */ + NrVopsInfo ngranNrVopsInfo; + /** + * True if the dual transfer mode is supported. Refer to 3GPP TS 44.108 section 3.4.25.3 + */ + boolean geranDtmSupported; +} diff --git a/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.aidl b/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.aidl new file mode 100644 index 0000000000..14f68ec025 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.PrlIndicator; + +@VintfStability +parcelable RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo { + /** + * Concurrent services support indicator. if registered on a CDMA system. + * false - Concurrent services not supported, + * true - Concurrent services supported + */ + boolean cssSupported; + /** + * TSB-58 Roaming Indicator if registered on a CDMA or EVDO system or -1 if not. + * Valid values are 0-255. + */ + int roamingIndicator; + /** + * Indicates whether the current system is in the PRL if registered on a CDMA or EVDO system + * or -1 if not. 0=not in the PRL, 1=in the PRL. + */ + PrlIndicator systemIsInPrl; + /** + * Default Roaming Indicator from the PRL if registered on a CDMA or EVDO system or -1 if not. + * Valid values are 0-255. + */ + int defaultRoamingIndicator; +} diff --git a/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl b/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl new file mode 100644 index 0000000000..5b942f4aa4 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.LteVopsInfo; +import android.hardware.radio.NrIndicators; + +@VintfStability +parcelable RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo { + /** + * Network capabilities for voice over PS services. This info is valid only on LTE network and + * must be present when device is camped on LTE. VopsInfo must be empty when device is camped + * only on 2G/3G. + */ + LteVopsInfo lteVopsInfo; + /** + * The parameters of NR 5G Non-Standalone. This value is only valid on E-UTRAN, otherwise must + * be empty. + */ + NrIndicators nrIndicators; +} diff --git a/radio/aidl/android/hardware/radio/RegistrationFailCause.aidl b/radio/aidl/android/hardware/radio/RegistrationFailCause.aidl new file mode 100644 index 0000000000..d9c7f23a3a --- /dev/null +++ b/radio/aidl/android/hardware/radio/RegistrationFailCause.aidl @@ -0,0 +1,189 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * 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. + */ +@VintfStability +@Backing(type="int") +enum RegistrationFailCause { + /** + * 0 - None + */ + NONE = 0, + /** + * 2 - IMSI unknown in HLR + */ + IMSI_UNKNOWN_IN_HLR = 2, + /** + * 3 - Illegal MS + */ + ILLEGAL_MS = 3, + /** + * 4 - Illegal ME + */ + IMSI_UNKNOWN_IN_VLR = 4, + /** + * 5 - PLMN not allowed + */ + IMEI_NOT_ACCEPTED = 5, + /** + * 6 - Location area not allowed + */ + ILLEGAL_ME = 6, + /** + * 7 - Roaming not allowed + */ + GPRS_SERVICES_NOT_ALLOWED = 7, + /** + * 8 - No Suitable Cells in this Location Area + */ + GPRS_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 8, + /** + * 9 - Network failure + */ + MS_IDENTITY_CANNOT_BE_DERIVED_BY_NETWORK = 9, + /** + * 10 - Persistent location update reject + */ + IMPLICITLY_DETACHED = 10, + /** + * 11 - PLMN not allowed + */ + PLMN_NOT_ALLOWED = 11, + /** + * 12 - Location area not allowed + */ + LOCATION_AREA_NOT_ALLOWED = 12, + /** + * 13 - Roaming not allowed in this Location Area + */ + ROAMING_NOT_ALLOWED = 13, + /** + * 14 - GPRS Services not allowed in this PLMN + */ + GPRS_SERVICES_NOT_ALLOWED_IN_PLMN = 14, + /** + * 15 - No Suitable Cells in this Location Area + */ + NO_SUITABLE_CELLS = 15, + /** + * 16 - MSC temporarily not reachable + */ + MSC_TEMPORARILY_NOT_REACHABLE = 15, + /** + * 17 - Network Failure + */ + NETWORK_FAILURE = 17, + /** + * 20 - MAC Failure + */ + MAC_FAILURE = 20, + /** + * 21 - Sync Failure + */ + SYNC_FAILURE = 21, + /** + * 22 - Congestion + */ + CONGESTION = 22, + /** + * 23 - GSM Authentication unacceptable + */ + GSM_AUTHENTICATION_UNACCEPTABLE = 23, + /** + * 25 - Not Authorized for this CSG + */ + NOT_AUTHORIZED_FOR_THIS_CSG = 25, + /** + * 28 SMS provided via GPRS in this routing area + */ + SMS_PROVIDED_BY_GPRS_IN_ROUTING_AREA, + /** + * 32 - Service option not supported + */ + SERVICE_OPTION_NOT_SUPPORTED = 32, + /** + * 33 - Requested service option not subscribed + */ + SERVICE_OPTION_NOT_SUBSCRIBED = 33, + /** + * 34 - Service option temporarily out of order + */ + SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER = 34, + /** + * 38 - Call cannot be identified + */ + CALL_CANNOT_BE_IDENTIFIED = 38, + /** + * 40 No PDP context activated + */ + NO_PDP_CONTEXT_ACTIVATED = 40, + /** + * 48-63 - Retry upon entry into a new cell + */ + RETRY_UPON_ENTRY_INTO_NEW_CELL_1 = 48, + RETRY_UPON_ENTRY_INTO_NEW_CELL_2 = 49, + RETRY_UPON_ENTRY_INTO_NEW_CELL_3 = 50, + RETRY_UPON_ENTRY_INTO_NEW_CELL_4 = 51, + RETRY_UPON_ENTRY_INTO_NEW_CELL_5 = 52, + RETRY_UPON_ENTRY_INTO_NEW_CELL_6 = 53, + RETRY_UPON_ENTRY_INTO_NEW_CELL_7 = 54, + RETRY_UPON_ENTRY_INTO_NEW_CELL_8 = 55, + RETRY_UPON_ENTRY_INTO_NEW_CELL_9 = 56, + RETRY_UPON_ENTRY_INTO_NEW_CELL_10 = 57, + RETRY_UPON_ENTRY_INTO_NEW_CELL_11 = 58, + RETRY_UPON_ENTRY_INTO_NEW_CELL_12 = 59, + RETRY_UPON_ENTRY_INTO_NEW_CELL_13 = 60, + RETRY_UPON_ENTRY_INTO_NEW_CELL_14 = 61, + RETRY_UPON_ENTRY_INTO_NEW_CELL_15 = 62, + RETRY_UPON_ENTRY_INTO_NEW_CELL_16 = 63, + /** + * 95 - Semantically incorrect message + */ + SEMANTICALLY_INCORRECT_MESSAGE = 95, + /** + * 96 - Invalid mandatory information + */ + INVALID_MANDATORY_INFORMATION = 96, + /** + * 97 - Message type non-existent or not implemented + */ + MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED = 97, + /** + * 98 - Message type not compatible with protocol state + */ + MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98, + /** + * 99 - Information element non-existent or not implemented + */ + INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED = 99, + /** + * 100 - Conditional IE error + */ + CONDITIONAL_IE_ERROR = 100, + /** + * 101 - Message not compatible with protocol state + */ + MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101, + /** + * 111 - Protocol error, unspecified + */ + PROTOCOL_ERROR_UNSPECIFIED = 111, +} diff --git a/radio/aidl/android/hardware/radio/ResetNvType.aidl b/radio/aidl/android/hardware/radio/ResetNvType.aidl new file mode 100644 index 0000000000..59c74da9f8 --- /dev/null +++ b/radio/aidl/android/hardware/radio/ResetNvType.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum ResetNvType { + /** + * Reload all NV items + */ + RELOAD, + /** + * Erase NV reset (SCRTN) + */ + ERASE, + /** + * Factory reset (RTN) + */ + FACTORY_RESET, +} diff --git a/radio/aidl/android/hardware/radio/RestrictedState.aidl b/radio/aidl/android/hardware/radio/RestrictedState.aidl new file mode 100644 index 0000000000..1cf8be27f0 --- /dev/null +++ b/radio/aidl/android/hardware/radio/RestrictedState.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum RestrictedState { + NONE = 0x00, + CS_EMERGENCY = 0x01, + CS_NORMAL = 0x02, + CS_ALL = 0x04, + PS_ALL = 0x10, +} diff --git a/radio/aidl/android/hardware/radio/RouteSelectionDescriptor.aidl b/radio/aidl/android/hardware/radio/RouteSelectionDescriptor.aidl new file mode 100644 index 0000000000..14591a0ddb --- /dev/null +++ b/radio/aidl/android/hardware/radio/RouteSelectionDescriptor.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.OptionalPdpProtocolType; +import android.hardware.radio.OptionalSscMode; +import android.hardware.radio.SliceInfo; + +/** + * This struct represents a single route selection descriptor as defined in 3GPP TS 24.526. + */ +@VintfStability +parcelable RouteSelectionDescriptor { + /** + * Precedence value in the range of 0 to 255. Higher value has lower precedence. + */ + byte precedence; + /** + * Valid values are IP, IPV6 and IPV4V6. + */ + OptionalPdpProtocolType sessionType; + OptionalSscMode sscMode; + /** + * There can be 0 or more SliceInfo specified in a route descriptor. + */ + SliceInfo[] sliceInfo; + /** + * DNN stands for Data Network Name and represents an APN as defined in 3GPP TS 23.003. + * There can be 0 or more DNNs specified in a route descriptor. + */ + String[] dnn; +} diff --git a/radio/aidl/android/hardware/radio/SapApduType.aidl b/radio/aidl/android/hardware/radio/SapApduType.aidl new file mode 100644 index 0000000000..f697e58aad --- /dev/null +++ b/radio/aidl/android/hardware/radio/SapApduType.aidl @@ -0,0 +1,24 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SapApduType { + APDU, + APDU7816, +} diff --git a/radio/aidl/android/hardware/radio/SapConnectRsp.aidl b/radio/aidl/android/hardware/radio/SapConnectRsp.aidl new file mode 100644 index 0000000000..d2046d21ef --- /dev/null +++ b/radio/aidl/android/hardware/radio/SapConnectRsp.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SapConnectRsp { + SUCCESS, + CONNECT_FAILURE, + MSG_SIZE_TOO_LARGE, + MSG_SIZE_TOO_SMALL, + CONNECT_OK_CALL_ONGOING, +} diff --git a/radio/aidl/android/hardware/radio/SapDisconnectType.aidl b/radio/aidl/android/hardware/radio/SapDisconnectType.aidl new file mode 100644 index 0000000000..30a04bde46 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SapDisconnectType.aidl @@ -0,0 +1,24 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SapDisconnectType { + GRACEFUL, + IMMEDIATE, +} diff --git a/radio/aidl/android/hardware/radio/SapResultCode.aidl b/radio/aidl/android/hardware/radio/SapResultCode.aidl new file mode 100644 index 0000000000..db87374ce9 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SapResultCode.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SapResultCode { + SUCCESS, + GENERIC_FAILURE, + CARD_NOT_ACCESSSIBLE, + CARD_ALREADY_POWERED_OFF, + CARD_REMOVED, + CARD_ALREADY_POWERED_ON, + DATA_NOT_AVAILABLE, + NOT_SUPPORTED, +} diff --git a/radio/aidl/android/hardware/radio/SapStatus.aidl b/radio/aidl/android/hardware/radio/SapStatus.aidl new file mode 100644 index 0000000000..0a6b4a757a --- /dev/null +++ b/radio/aidl/android/hardware/radio/SapStatus.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SapStatus { + UNKNOWN_ERROR, + CARD_RESET, + CARD_NOT_ACCESSIBLE, + CARD_REMOVED, + CARD_INSERTED, + RECOVERED, +} diff --git a/radio/aidl/android/hardware/radio/SapTransferProtocol.aidl b/radio/aidl/android/hardware/radio/SapTransferProtocol.aidl new file mode 100644 index 0000000000..7f385de00d --- /dev/null +++ b/radio/aidl/android/hardware/radio/SapTransferProtocol.aidl @@ -0,0 +1,24 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SapTransferProtocol { + T0, + T1, +} diff --git a/radio/aidl/android/hardware/radio/ScanIntervalRange.aidl b/radio/aidl/android/hardware/radio/ScanIntervalRange.aidl new file mode 100644 index 0000000000..7ea4d123eb --- /dev/null +++ b/radio/aidl/android/hardware/radio/ScanIntervalRange.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Values are in seconds + */ +@VintfStability +@Backing(type="int") +enum ScanIntervalRange { + MIN = 5, + MAX = 300, +} diff --git a/radio/aidl/android/hardware/radio/ScanStatus.aidl b/radio/aidl/android/hardware/radio/ScanStatus.aidl new file mode 100644 index 0000000000..c9c436e36a --- /dev/null +++ b/radio/aidl/android/hardware/radio/ScanStatus.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum ScanStatus { + /** + * The result contains a part of the scan results + */ + PARTIAL = 1, + /** + * The result contains the last part of the scan results + */ + COMPLETE = 2, +} diff --git a/radio/aidl/android/hardware/radio/ScanType.aidl b/radio/aidl/android/hardware/radio/ScanType.aidl new file mode 100644 index 0000000000..66ed451fff --- /dev/null +++ b/radio/aidl/android/hardware/radio/ScanType.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum ScanType { + /** + * Performs the scan only once + */ + ONE_SHOT, + /** + * Performs the scan periodically until cancelled + */ + PERIODIC, +} diff --git a/radio/aidl/android/hardware/radio/SelectUiccSub.aidl b/radio/aidl/android/hardware/radio/SelectUiccSub.aidl new file mode 100644 index 0000000000..4db5e662b8 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SelectUiccSub.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.SubscriptionType; +import android.hardware.radio.UiccSubActStatus; + +@VintfStability +parcelable SelectUiccSub { + int slot; + /** + * Array subscriptor from applications[RadioConst:CARD_MAX_APPS] in getIccCardStatus() + */ + int appIndex; + SubscriptionType subType; + UiccSubActStatus actStatus; +} diff --git a/radio/aidl/android/hardware/radio/SendSmsResult.aidl b/radio/aidl/android/hardware/radio/SendSmsResult.aidl new file mode 100644 index 0000000000..31865637ee --- /dev/null +++ b/radio/aidl/android/hardware/radio/SendSmsResult.aidl @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable SendSmsResult { + /** + * TP-Message-Reference for GSM, and BearerData MessageId for CDMA. + * See 3GPP2 C.S0015-B, v2.0, table 4.5-1 + */ + int messageRef; + /** + * Ack PDU or empty string if n/a + */ + String ackPDU; + /** + * See 3GPP 27.005, 3.2.5 for GSM/UMTS, 3GPP2 N.S0005 (IS-41C) Table 171 for CDMA. + * -1 if unknown or not applicable. + */ + int errorCode; +} diff --git a/radio/aidl/android/hardware/radio/SetupDataCallResult.aidl b/radio/aidl/android/hardware/radio/SetupDataCallResult.aidl new file mode 100644 index 0000000000..5fc017cba8 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SetupDataCallResult.aidl @@ -0,0 +1,117 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.DataCallFailCause; +import android.hardware.radio.DataConnActiveStatus; +import android.hardware.radio.HandoverFailureMode; +import android.hardware.radio.LinkAddress; +import android.hardware.radio.OptionalSliceInfo; +import android.hardware.radio.PdpProtocolType; +import android.hardware.radio.Qos; +import android.hardware.radio.QosSession; +import android.hardware.radio.TrafficDescriptor; + +@VintfStability +parcelable SetupDataCallResult { + /** + * Data call fail cause. DataCallFailCause.NONE if no error. + */ + DataCallFailCause cause; + /** + * If cause is not DataCallFailCause.NONE, this field indicates the network suggested data + * retry back-off time in milliseconds. Negative value indicates network does not give any + * suggestion. 0 indicates retry should be performed immediately. 0x7fffffffffffffff indicates + * the device should not retry data setup anymore. During this time, no calls to + * IRadio.setupDataCall for this APN will be made unless IRadioIndication.unthrottleApn is sent + * with the same APN. + */ + long suggestedRetryTime; + /** + * Context ID, uniquely identifies this data connection. + */ + int cid; + /** + * Data connection active status. + */ + DataConnActiveStatus active; + /** + * PDP protocol type. If cause is DataCallFailCause.ONLY_SINGLE_BEARER_ALLOWED, this is the + * protocol type supported, such as "IP" or "IPV6". + */ + PdpProtocolType type; + /** + * The network interface name. + */ + String ifname; + /** + * List of link address. + */ + LinkAddress[] addresses; + /** + * List of DNS server addresses, e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". Empty if no dns + * server addresses returned. + */ + String[] dnses; + /** + * List of default gateway addresses, e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". + * When empty, the addresses represent point to point connections. + */ + String[] gateways; + /** + * List of P-CSCF (Proxy Call State Control Function) addresses via PCO (Protocol Configuration + * Option), e.g., "2001:db8::1 2001:db8::2 2001:db8::3". Empty if not IMS client. + */ + String[] pcscf; + /** + * MTU received from network for IPv4. + * Value <= 0 means network has either not sent a value or sent an invalid value. + */ + int mtuV4; + /** + * MTU received from network for IPv6. + * Value <= 0 means network has either not sent a value or sent an invalid value. + */ + int mtuV6; + /** + * Default bearer QoS. Applicable to LTE and NR + */ + Qos defaultQos; + /** + * Active QOS sessions of the dedicated bearers. Applicable to PDNs that support dedicated + * bearers. + */ + QosSession[] qosSessions; + /** + * Specifies the fallback mode on an IWLAN handover failure. + */ + HandoverFailureMode handoverFailureMode; + /** + * The allocated pdu session id for this data call. A value of 0 means no pdu session id was + * attached to this call. Reference: 3GPP TS 24.007 section 11.2.3.1b. + */ + int pduSessionId; + /** + * Slice used for this data call. It is valid only when this data call is on AccessNetwork:NGRAN + */ + OptionalSliceInfo sliceInfo; + /** + * TrafficDescriptors for which this data call must be used. It only includes the TDs for which + * a data call has been requested so far; it is not an exhaustive list. + */ + TrafficDescriptor[] trafficDescriptors; +} diff --git a/radio/aidl/android/hardware/radio/SignalMeasurementType.aidl b/radio/aidl/android/hardware/radio/SignalMeasurementType.aidl new file mode 100644 index 0000000000..d92ae91ae1 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SignalMeasurementType.aidl @@ -0,0 +1,83 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Defining signal strength type. + */ +@VintfStability +@Backing(type="int") +enum SignalMeasurementType { + /** + * Received Signal Strength Indication. + * Range: -113 dBm and -51 dBm + * Used RAN: GERAN, CDMA2000 + * Reference: 3GPP TS 27.007 section 8.5. + */ + RSSI = 1, + /** + * Received Signal Code Power. + * Range: -120 dBm to -25 dBm; + * Used RAN: UTRAN + * Reference: 3GPP TS 25.123, section 9.1.1.1 + */ + RSCP = 2, + /** + * Reference Signal Received Power. + * Range: -140 dBm to -44 dBm; + * Used RAN: EUTRAN + * Reference: 3GPP TS 36.133 9.1.4 + */ + RSRP = 3, + /** + * Reference Signal Received Quality + * Range: -34 dB to 3 dB; + * Used RAN: EUTRAN + * Reference: 3GPP TS 36.133 v12.6.0 section 9.1.7 + */ + RSRQ = 4, + /** + * Reference Signal Signal to Noise Ratio + * Range: -20 dB to 30 dB; + * Used RAN: EUTRAN + * Note: This field is optional; how to support it can be decided by the corresponding vendor. + * Though the response code is not enforced, vendor's implementation must ensure this interface + * does not crash. + */ + RSSNR = 5, + /** + * 5G SS reference signal received power. + * Range: -140 dBm to -44 dBm. + * Used RAN: NGRAN + * Reference: 3GPP TS 38.215. + */ + SSRSRP = 6, + /** + * 5G SS reference signal received quality. + * Range: -43 dB to 20 dB. + * Used RAN: NGRAN + * Reference: 3GPP TS 38.215, 3GPP TS 38.133 section 10 + */ + SSRSRQ = 7, + /** + * 5G SS signal-to-noise and interference ratio. + * Range: -23 dB to 40 dB + * Used RAN: NGRAN + * Reference: 3GPP TS 38.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1. + */ + SSSINR = 8, +} diff --git a/radio/aidl/android/hardware/radio/SignalStrength.aidl b/radio/aidl/android/hardware/radio/SignalStrength.aidl new file mode 100644 index 0000000000..0ffdaa34cc --- /dev/null +++ b/radio/aidl/android/hardware/radio/SignalStrength.aidl @@ -0,0 +1,64 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CdmaSignalStrength; +import android.hardware.radio.EvdoSignalStrength; +import android.hardware.radio.GsmSignalStrength; +import android.hardware.radio.LteSignalStrength; +import android.hardware.radio.NrSignalStrength; +import android.hardware.radio.TdscdmaSignalStrength; +import android.hardware.radio.WcdmaSignalStrength; + +@VintfStability +parcelable SignalStrength { + /** + * If GSM measurements are provided, this structure must contain valid measurements; otherwise + * all fields should be set to INT_MAX to mark them as invalid. + */ + GsmSignalStrength gsm; + /** + * If CDMA measurements are provided, this structure must contain valid measurements; otherwise + * all fields should be set to INT_MAX to mark them as invalid. + */ + CdmaSignalStrength cdma; + /** + * If EvDO measurements are provided, this structure must contain valid measurements; otherwise + * all fields should be set to INT_MAX to mark them as invalid. + */ + EvdoSignalStrength evdo; + /** + * If LTE measurements are provided, this structure must contain valid measurements; otherwise + * all fields should be set to INT_MAX to mark them as invalid. + */ + LteSignalStrength lte; + /** + * If TD-SCDMA measurements are provided, this structure must contain valid measurements; + * otherwise all fields should be set to INT_MAX to mark them as invalid. + */ + TdscdmaSignalStrength tdscdma; + /** + * If WCDMA measurements are provided, this structure must contain valid measurements; otherwise + * all fields should be set to INT_MAX to mark them as invalid. + */ + WcdmaSignalStrength wcdma; + /** + * If NR 5G measurements are provided, this structure must contain valid measurements; otherwise + * all fields should be set to INT_MAX to mark them as invalid. + */ + NrSignalStrength nr; +} diff --git a/radio/aidl/android/hardware/radio/SignalThresholdInfo.aidl b/radio/aidl/android/hardware/radio/SignalThresholdInfo.aidl new file mode 100644 index 0000000000..9274b42f6b --- /dev/null +++ b/radio/aidl/android/hardware/radio/SignalThresholdInfo.aidl @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.SignalMeasurementType; + +/** + * Contains the threshold values of each signal measurement type. + */ +@VintfStability +parcelable SignalThresholdInfo { + /** + * Signal Measurement Type + */ + SignalMeasurementType signalMeasurement; + /** + * A hysteresis time in milliseconds to prevent flapping. A value of 0 disables hysteresis. + */ + int hysteresisMs; + /** + * An interval in dB defining the required magnitude change between reports. This must be + * smaller than the smallest threshold delta. An interval value of 0 disables hysteresis. + */ + int hysteresisDb; + /** + * List of threshold values. Range and unit must reference specific SignalMeasurementType. + * The threshold values for which to apply criteria. A vector size of 0 disables the use of + * thresholds for reporting. + */ + int[] thresholds; + /** + * Indicates whether the reporting criteria of the corresponding measurement is enabled + * (true) or disabled (false). If enabled, modem must trigger the report based on the criteria. + * If disabled, modem must not trigger the report based on the criteria. + */ + boolean isEnabled; +} diff --git a/radio/aidl/android/hardware/radio/SimApdu.aidl b/radio/aidl/android/hardware/radio/SimApdu.aidl new file mode 100644 index 0000000000..65dae4c72e --- /dev/null +++ b/radio/aidl/android/hardware/radio/SimApdu.aidl @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable SimApdu { + /** + * "sessionid" from TS 27.007 +CGLA command. Must be ignored for +CSIM command. + */ + int sessionId; + /** + * Used to derive the APDU ("command" and "length" values in TS 27.007 +CSIM and +CGLA commands) + */ + int cla; + /** + * Used to derive the APDU ("command" and "length" values in TS 27.007 +CSIM and +CGLA commands) + */ + int instruction; + /** + * Used to derive the APDU ("command" and "length" values in TS 27.007 +CSIM and +CGLA commands) + */ + int p1; + /** + * Used to derive the APDU ("command" and "length" values in TS 27.007 +CSIM and +CGLA commands) + */ + int p2; + /** + * Used to derive the APDU ("command" and "length" values in TS 27.007 +CSIM and +CGLA commands) + * A negative P3 implies a 4 byte APDU. + */ + int p3; + /** + * Used to derive the APDU ("command" and "length" values in TS 27.007 +CSIM and +CGLA commands) + * In hex string format ([a-fA-F0-9]*) + */ + String data; +} diff --git a/radio/aidl/android/hardware/radio/SimLockMultiSimPolicy.aidl b/radio/aidl/android/hardware/radio/SimLockMultiSimPolicy.aidl new file mode 100644 index 0000000000..89e13fd27b --- /dev/null +++ b/radio/aidl/android/hardware/radio/SimLockMultiSimPolicy.aidl @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +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, +} diff --git a/radio/aidl/android/hardware/radio/SimRefreshResult.aidl b/radio/aidl/android/hardware/radio/SimRefreshResult.aidl new file mode 100644 index 0000000000..f4808886a7 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SimRefreshResult.aidl @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.SimRefreshType; + +@VintfStability +parcelable SimRefreshResult { + SimRefreshType type; + /** + * EFID of the updated file if the result is SIM_FILE_UPDATE or 0 for any other result. + */ + int efId; + /** + * AID(application ID) of the card application. See ETSI 102.221 8.1 and 101.220 4. + * For SIM_FILE_UPDATE result it must be set to AID of application in which updated EF resides + * or it must be empty string if EF is outside of an application. For SIM_INIT result this field + * is set to AID of application that caused REFRESH. For SIM_RESET result it is empty string. + */ + String aid; +} diff --git a/radio/aidl/android/hardware/radio/SimRefreshType.aidl b/radio/aidl/android/hardware/radio/SimRefreshType.aidl new file mode 100644 index 0000000000..996cdceb96 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SimRefreshType.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SimRefreshType { + /** + * A file on SIM has been updated. + */ + SIM_FILE_UPDATE, + /** + * SIM initialized. All files should be re-read. + */ + SIM_INIT, + /** + * SIM reset. SIM power required, SIM may be locked and all files must be re-read. + */ + SIM_RESET, +} diff --git a/radio/aidl/android/hardware/radio/SliceInfo.aidl b/radio/aidl/android/hardware/radio/SliceInfo.aidl new file mode 100644 index 0000000000..91b00677b5 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SliceInfo.aidl @@ -0,0 +1,53 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.SliceServiceType; +import android.hardware.radio.SliceStatus; + +/** + * This struct represents a S-NSSAI as defined in 3GPP TS 24.501. + */ +@VintfStability +parcelable SliceInfo { + /** + * The type of service provided by the slice. See: 3GPP TS 24.501 Section 9.11.2.8. + */ + SliceServiceType sst; + /** + * Slice differentiator is the identifier of a slice that has SliceServiceType as SST. A value + * of -1 indicates that there is no corresponding SliceInfo of the HPLMN. + * See: 3GPP TS 24.501 Section 9.11.2.8. + */ + int sliceDifferentiator; + /** + * This SST corresponds to a SliceInfo (S-NSSAI) of the HPLMN; the SST is mapped to this value. + * See: 3GPP TS 24.501 Section 9.11.2.8. + */ + SliceServiceType mappedHplmnSst; + /** + * Present only if both sliceDifferentiator and mappedHplmnSst are also present. This SD + * corresponds to a SliceInfo (S-NSSAI) of the HPLMN; sliceDifferentiator is mapped to this + * value. A value of -1 indicates that there is no corresponding SliceInfo of the HPLMN. + * See: 3GPP TS 24.501 Section 9.11.2.8. + */ + int mappedHplmnSD; + /** + * Field to indicate the current status of the slice. + */ + SliceStatus status; +} diff --git a/radio/aidl/android/hardware/radio/SliceServiceType.aidl b/radio/aidl/android/hardware/radio/SliceServiceType.aidl new file mode 100644 index 0000000000..624dfb1050 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SliceServiceType.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. + */ + +package android.hardware.radio; + +/** + * Slice/Service Type as defined in 3GPP TS 23.501. + */ +@VintfStability +@Backing(type="byte") +enum SliceServiceType { + /* + * Not specified + */ + NONE, + /* + * Slice suitable for the handling of 5G enhanced Mobile Broadband + */ + EMBB, + /** + * Slice suitable for the handling of ultra-reliable low latency communications + */ + URLLC, + /* + * Slice suitable for the handling of massive IoT + */ + MIOT, +} diff --git a/radio/aidl/android/hardware/radio/SliceStatus.aidl b/radio/aidl/android/hardware/radio/SliceStatus.aidl new file mode 100644 index 0000000000..076e23b269 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SliceStatus.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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="byte") +enum SliceStatus { + UNKNOWN, + /** + * Configured but not allowed or rejected yet + */ + CONFIGURED, + /** + * Allowed to be used + */ + ALLOWED, + /** + * Rejected because not available in PLMN + */ + REJECTED_NOT_AVAILABLE_IN_PLMN, + /** + * Rejected because not available in reg area + */ + REJECTED_NOT_AVAILABLE_IN_REG_AREA, + /** + * Considered valid when configured/allowed slices are not available + */ + DEFAULT_CONFIGURED, +} diff --git a/radio/aidl/android/hardware/radio/SlicingConfig.aidl b/radio/aidl/android/hardware/radio/SlicingConfig.aidl new file mode 100644 index 0000000000..d8d0885142 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SlicingConfig.aidl @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.SliceInfo; +import android.hardware.radio.UrspRule; + +/** + * This struct represents the current slicing configuration. + */ +@VintfStability +parcelable SlicingConfig { + /** + * This vector contains the current URSP rules. Empty vector indicates no rules are configured. + */ + UrspRule[] urspRules; + /** + * List of all slices. + */ + SliceInfo[] sliceInfo; +} diff --git a/radio/aidl/android/hardware/radio/SmsAcknowledgeFailCause.aidl b/radio/aidl/android/hardware/radio/SmsAcknowledgeFailCause.aidl new file mode 100644 index 0000000000..265a10918d --- /dev/null +++ b/radio/aidl/android/hardware/radio/SmsAcknowledgeFailCause.aidl @@ -0,0 +1,24 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SmsAcknowledgeFailCause { + MEMORY_CAPACITY_EXCEEDED = 0xD3, + UNSPECIFIED_ERROR = 0XFF, +} diff --git a/radio/aidl/android/hardware/radio/SmsWriteArgs.aidl b/radio/aidl/android/hardware/radio/SmsWriteArgs.aidl new file mode 100644 index 0000000000..f7a3fd49e2 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SmsWriteArgs.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.SmsWriteArgsStatus; + +@VintfStability +parcelable SmsWriteArgs { + /** + * Status of message. See TS 27.005 3.1. + */ + SmsWriteArgsStatus status; + /** + * PDU of message to write, as an ASCII hex string less the SMSC address, the TP-layer length + * is strlen(pdu)/2. + */ + String pdu; + /** + * SMSC address in GSM BCD format prefixed by a length byte (as expected by TS 27.005) + * or NULL for default SMSC. + */ + String smsc; +} diff --git a/radio/aidl/android/hardware/radio/SmsWriteArgsStatus.aidl b/radio/aidl/android/hardware/radio/SmsWriteArgsStatus.aidl new file mode 100644 index 0000000000..095c71eff6 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SmsWriteArgsStatus.aidl @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SmsWriteArgsStatus { + REC_UNREAD, + REC_READ, + STO_UNSENT, + STO_SENT, +} diff --git a/radio/aidl/android/hardware/radio/SrvccState.aidl b/radio/aidl/android/hardware/radio/SrvccState.aidl new file mode 100644 index 0000000000..d4283149f9 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SrvccState.aidl @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SrvccState { + HANDOVER_STARTED, + HANDOVER_COMPLETED, + HANDOVER_FAILED, + HANDOVER_CANCELED, +} diff --git a/radio/aidl/android/hardware/radio/SsInfoData.aidl b/radio/aidl/android/hardware/radio/SsInfoData.aidl new file mode 100644 index 0000000000..6ee3da0597 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SsInfoData.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable SsInfoData { + /** + * This is the response data for all of the SS GET/SET Radio requests. + * E.g. IRadio.getClir() returns two ints, so first two values of ssInfo[] will be used for + * response if serviceType is SS_CLIR and requestType is SS_INTERROGATION. + * Max size = RadioConst:SS_INFO_MAX + */ + int[] ssInfo; +} diff --git a/radio/aidl/android/hardware/radio/SsRequestType.aidl b/radio/aidl/android/hardware/radio/SsRequestType.aidl new file mode 100644 index 0000000000..f3decbefa6 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SsRequestType.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SsRequestType { + ACTIVATION, + DEACTIVATION, + INTERROGATION, + REGISTRATION, + ERASURE, +} diff --git a/radio/aidl/android/hardware/radio/SsServiceType.aidl b/radio/aidl/android/hardware/radio/SsServiceType.aidl new file mode 100644 index 0000000000..eb344f45be --- /dev/null +++ b/radio/aidl/android/hardware/radio/SsServiceType.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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SsServiceType { + CFU, + CF_BUSY, + CF_NO_REPLY, + CF_NOT_REACHABLE, + CF_ALL, + CF_ALL_CONDITIONAL, + CLIP, + CLIR, + COLP, + COLR, + WAIT, + BAOC, + BAOIC, + BAOIC_EXC_HOME, + BAIC, + BAIC_ROAMING, + ALL_BARRING, + OUTGOING_BARRING, + INCOMING_BARRING, +} diff --git a/radio/aidl/android/hardware/radio/SsTeleserviceType.aidl b/radio/aidl/android/hardware/radio/SsTeleserviceType.aidl new file mode 100644 index 0000000000..c11bbfa05d --- /dev/null +++ b/radio/aidl/android/hardware/radio/SsTeleserviceType.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SsTeleserviceType { + ALL_TELE_AND_BEARER_SERVICES, + ALL_TELESEVICES, + TELEPHONY, + ALL_DATA_TELESERVICES, + SMS_SERVICES, + ALL_TELESERVICES_EXCEPT_SMS, +} diff --git a/radio/aidl/android/hardware/radio/SscMode.aidl b/radio/aidl/android/hardware/radio/SscMode.aidl new file mode 100644 index 0000000000..8722048019 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SscMode.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Enum representing session and service continuity mode as defined in 3GPP TS 23.501. + */ +@VintfStability +@Backing(type="byte") +enum SscMode { + MODE_1 = 1, + MODE_2 = 2, + MODE_3 = 3, +} diff --git a/radio/aidl/android/hardware/radio/StkCcUnsolSsResult.aidl b/radio/aidl/android/hardware/radio/StkCcUnsolSsResult.aidl new file mode 100644 index 0000000000..0895f9885b --- /dev/null +++ b/radio/aidl/android/hardware/radio/StkCcUnsolSsResult.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CfData; +import android.hardware.radio.RadioError; +import android.hardware.radio.SsInfoData; +import android.hardware.radio.SsRequestType; +import android.hardware.radio.SsServiceType; +import android.hardware.radio.SsTeleserviceType; +import android.hardware.radio.SuppServiceClass; + +@VintfStability +parcelable StkCcUnsolSsResult { + SsServiceType serviceType; + SsRequestType requestType; + SsTeleserviceType teleserviceType; + SuppServiceClass serviceClass; + RadioError result; + /** + * Valid only for all SsServiceType except SsServiceType:CF_* else empty. + * Only one of ssInfo and cfData may contain values and the other must be empty. + */ + SsInfoData[] ssInfo; + /** + * Valid for SsServiceType:CF_* else empty + * Only one of ssInfo and cfData may contain values and the other must be empty. + */ + CfData[] cfData; +} diff --git a/radio/aidl/android/hardware/radio/SubscriptionType.aidl b/radio/aidl/android/hardware/radio/SubscriptionType.aidl new file mode 100644 index 0000000000..47c54f77a6 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SubscriptionType.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SubscriptionType { + SUBSCRIPTION_1, + SUBSCRIPTION_2, + SUBSCRIPTION_3, +} diff --git a/radio/aidl/android/hardware/radio/SuppServiceClass.aidl b/radio/aidl/android/hardware/radio/SuppServiceClass.aidl new file mode 100644 index 0000000000..79e73ceffd --- /dev/null +++ b/radio/aidl/android/hardware/radio/SuppServiceClass.aidl @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum SuppServiceClass { + NONE = 0, + VOICE = 1 << 0, + DATA = 1 << 1, + FAX = 1 << 2, + SMS = 1 << 3, + DATA_SYNC = 1 << 4, + DATA_ASYNC = 1 << 5, + PACKET = 1 << 6, + PAD = 1 << 7, + MAX = 1 << 7, +} diff --git a/radio/aidl/android/hardware/radio/SuppSvcNotification.aidl b/radio/aidl/android/hardware/radio/SuppSvcNotification.aidl new file mode 100644 index 0000000000..b41292b170 --- /dev/null +++ b/radio/aidl/android/hardware/radio/SuppSvcNotification.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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable SuppSvcNotification { + /** + * Notification type + * false = MO intermediate result code + * true = MT unsolicited result code + */ + boolean isMT; + /** + * Result code. See 27.007 7.17. + */ + int code; + /** + * CUG index. See 27.007 7.17. + */ + int index; + /** + * "type" from 27.007 7.17 (MT only). + */ + int type; + /** + * "number" from 27.007 7.17. MT only, may be empty string. + */ + String number; +} diff --git a/radio/aidl/android/hardware/radio/TdscdmaSignalStrength.aidl b/radio/aidl/android/hardware/radio/TdscdmaSignalStrength.aidl new file mode 100644 index 0000000000..baed68a17b --- /dev/null +++ b/radio/aidl/android/hardware/radio/TdscdmaSignalStrength.aidl @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable TdscdmaSignalStrength { + /** + * UTRA carrier RSSI as defined in TS 25.225 5.1.4. Valid values are (0-31, 99) as defined in + * TS 27.007 8.5. INT_MAX denotes that the value is invalid/unreported. + */ + int signalStrength; + /** + * Transport Channel BER as defined in TS 25.225 5.2.5. Valid values are (0-7, 99) as defined in + * TS 27.007 8.5. INT_MAX denotes that the value is invalid/unreported. + */ + int bitErrorRate; + /** + * P-CCPCH RSCP as defined in TS 25.225 5.1.1. Valid values are (0-96, 255) as defined in + * TS 27.007 8.69. INT_MAX denotes that the value is invalid/unreported. + */ + int rscp; +} diff --git a/radio/aidl/android/hardware/radio/TimeStampType.aidl b/radio/aidl/android/hardware/radio/TimeStampType.aidl new file mode 100644 index 0000000000..f76a032e16 --- /dev/null +++ b/radio/aidl/android/hardware/radio/TimeStampType.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum TimeStampType { + UNKNOWN, + ANTENNA, + MODEM, + OEM_RIL, + JAVA_RIL, +} diff --git a/radio/aidl/android/hardware/radio/TrafficDescriptor.aidl b/radio/aidl/android/hardware/radio/TrafficDescriptor.aidl new file mode 100644 index 0000000000..4c41e8c89b --- /dev/null +++ b/radio/aidl/android/hardware/radio/TrafficDescriptor.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.OptionalDnn; +import android.hardware.radio.OptionalOsAppId; + +/** + * 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. + */ +@VintfStability +parcelable TrafficDescriptor { + /** + * DNN stands for Data Network Name and represents an APN as defined in 3GPP TS 23.003. + */ + OptionalDnn dnn; + /** + * Indicates the OsId + OsAppId (used as category in Android). + */ + OptionalOsAppId osAppId; +} diff --git a/radio/aidl/android/hardware/radio/Translate.java b/radio/aidl/android/hardware/radio/Translate.java new file mode 100644 index 0000000000..a5d32b4e98 --- /dev/null +++ b/radio/aidl/android/hardware/radio/Translate.java @@ -0,0 +1,2520 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import java.util.List; + +public class Translate { + static public android.hardware.radio.IccIo h2aTranslate(android.hardware.radio.V1_0.IccIo in) { + android.hardware.radio.IccIo out = new android.hardware.radio.IccIo(); + out.command = in.command; + out.fileId = in.fileId; + out.path = in.path; + out.p1 = in.p1; + out.p2 = in.p2; + out.p3 = in.p3; + out.data = in.data; + out.pin2 = in.pin2; + out.aid = in.aid; + return out; + } + + static public android.hardware.radio.NeighboringCell h2aTranslate( + android.hardware.radio.V1_0.NeighboringCell in) { + android.hardware.radio.NeighboringCell out = new android.hardware.radio.NeighboringCell(); + out.cid = in.cid; + out.rssi = in.rssi; + return out; + } + + static public android.hardware.radio.UusInfo h2aTranslate( + android.hardware.radio.V1_0.UusInfo in) { + android.hardware.radio.UusInfo out = new android.hardware.radio.UusInfo(); + out.uusType = in.uusType; + out.uusDcs = in.uusDcs; + out.uusData = in.uusData; + return out; + } + + static public android.hardware.radio.Dial h2aTranslate(android.hardware.radio.V1_0.Dial in) { + android.hardware.radio.Dial out = new android.hardware.radio.Dial(); + out.address = in.address; + out.clir = in.clir; + if (in.uusInfo != null) { + out.uusInfo = new android.hardware.radio.UusInfo[in.uusInfo.size()]; + for (int i = 0; i < in.uusInfo.size(); i++) { + out.uusInfo[i] = h2aTranslate(in.uusInfo.get(i)); + } + } + return out; + } + + static public android.hardware.radio.LastCallFailCauseInfo h2aTranslate( + android.hardware.radio.V1_0.LastCallFailCauseInfo in) { + android.hardware.radio.LastCallFailCauseInfo out = + new android.hardware.radio.LastCallFailCauseInfo(); + out.causeCode = in.causeCode; + out.vendorCause = in.vendorCause; + return out; + } + + static public android.hardware.radio.GsmSignalStrength h2aTranslate( + android.hardware.radio.V1_0.GsmSignalStrength in) { + android.hardware.radio.GsmSignalStrength out = + new android.hardware.radio.GsmSignalStrength(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.signalStrength > 2147483647 || in.signalStrength < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.signalStrength"); + } + out.signalStrength = in.signalStrength; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.bitErrorRate > 2147483647 || in.bitErrorRate < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.bitErrorRate"); + } + out.bitErrorRate = in.bitErrorRate; + out.timingAdvance = in.timingAdvance; + return out; + } + + static public android.hardware.radio.CdmaSignalStrength h2aTranslate( + android.hardware.radio.V1_0.CdmaSignalStrength in) { + android.hardware.radio.CdmaSignalStrength out = + new android.hardware.radio.CdmaSignalStrength(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.dbm > 2147483647 || in.dbm < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.dbm"); + } + out.dbm = in.dbm; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.ecio > 2147483647 || in.ecio < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.ecio"); + } + out.ecio = in.ecio; + return out; + } + + static public android.hardware.radio.EvdoSignalStrength h2aTranslate( + android.hardware.radio.V1_0.EvdoSignalStrength in) { + android.hardware.radio.EvdoSignalStrength out = + new android.hardware.radio.EvdoSignalStrength(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.dbm > 2147483647 || in.dbm < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.dbm"); + } + out.dbm = in.dbm; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.ecio > 2147483647 || in.ecio < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.ecio"); + } + out.ecio = in.ecio; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.signalNoiseRatio > 2147483647 || in.signalNoiseRatio < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.signalNoiseRatio"); + } + out.signalNoiseRatio = in.signalNoiseRatio; + return out; + } + + static public android.hardware.radio.SendSmsResult h2aTranslate( + android.hardware.radio.V1_0.SendSmsResult in) { + android.hardware.radio.SendSmsResult out = new android.hardware.radio.SendSmsResult(); + out.messageRef = in.messageRef; + out.ackPDU = in.ackPDU; + out.errorCode = in.errorCode; + return out; + } + + static public android.hardware.radio.IccIoResult h2aTranslate( + android.hardware.radio.V1_0.IccIoResult in) { + android.hardware.radio.IccIoResult out = new android.hardware.radio.IccIoResult(); + out.sw1 = in.sw1; + out.sw2 = in.sw2; + out.simResponse = in.simResponse; + return out; + } + + static public android.hardware.radio.CallForwardInfo h2aTranslate( + android.hardware.radio.V1_0.CallForwardInfo in) { + android.hardware.radio.CallForwardInfo out = new android.hardware.radio.CallForwardInfo(); + out.status = in.status; + out.reason = in.reason; + out.serviceClass = in.serviceClass; + out.toa = in.toa; + out.number = in.number; + out.timeSeconds = in.timeSeconds; + return out; + } + + static public android.hardware.radio.OperatorInfo h2aTranslate( + android.hardware.radio.V1_0.OperatorInfo in) { + android.hardware.radio.OperatorInfo out = new android.hardware.radio.OperatorInfo(); + out.alphaLong = in.alphaLong; + out.alphaShort = in.alphaShort; + out.operatorNumeric = in.operatorNumeric; + out.status = in.status; + return out; + } + + static public android.hardware.radio.SmsWriteArgs h2aTranslate( + android.hardware.radio.V1_0.SmsWriteArgs in) { + android.hardware.radio.SmsWriteArgs out = new android.hardware.radio.SmsWriteArgs(); + out.status = in.status; + out.pdu = in.pdu; + out.smsc = in.smsc; + return out; + } + + static public android.hardware.radio.CdmaSmsAddress h2aTranslate( + android.hardware.radio.V1_0.CdmaSmsAddress in) { + android.hardware.radio.CdmaSmsAddress out = new android.hardware.radio.CdmaSmsAddress(); + out.digitMode = in.digitMode; + out.numberMode = in.numberMode; + out.numberType = in.numberType; + out.numberPlan = in.numberPlan; + if (in.digits != null) { + out.digits = new byte[in.digits.size()]; + for (int i = 0; i < in.digits.size(); i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it + // doesn't suit your needs. + if (in.digits.get(i) > 127 || in.digits.get(i) < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.digits.get(i)"); + } + out.digits[i] = in.digits.get(i); + } + } + return out; + } + + static public android.hardware.radio.CdmaSmsSubaddress h2aTranslate( + android.hardware.radio.V1_0.CdmaSmsSubaddress in) { + android.hardware.radio.CdmaSmsSubaddress out = + new android.hardware.radio.CdmaSmsSubaddress(); + out.subaddressType = in.subaddressType; + out.odd = in.odd; + if (in.digits != null) { + out.digits = new byte[in.digits.size()]; + for (int i = 0; i < in.digits.size(); i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it + // doesn't suit your needs. + if (in.digits.get(i) > 127 || in.digits.get(i) < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.digits.get(i)"); + } + out.digits[i] = in.digits.get(i); + } + } + return out; + } + + static public android.hardware.radio.CdmaSmsMessage h2aTranslate( + android.hardware.radio.V1_0.CdmaSmsMessage in) { + android.hardware.radio.CdmaSmsMessage out = new android.hardware.radio.CdmaSmsMessage(); + out.teleserviceId = in.teleserviceId; + out.isServicePresent = in.isServicePresent; + out.serviceCategory = in.serviceCategory; + out.address = h2aTranslate(in.address); + out.subAddress = h2aTranslate(in.subAddress); + if (in.bearerData != null) { + out.bearerData = new byte[in.bearerData.size()]; + for (int i = 0; i < in.bearerData.size(); i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it + // doesn't suit your needs. + if (in.bearerData.get(i) > 127 || in.bearerData.get(i) < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.bearerData.get(i)"); + } + out.bearerData[i] = in.bearerData.get(i); + } + } + return out; + } + + static public android.hardware.radio.CdmaSmsAck h2aTranslate( + android.hardware.radio.V1_0.CdmaSmsAck in) { + android.hardware.radio.CdmaSmsAck out = new android.hardware.radio.CdmaSmsAck(); + out.errorClass = in.errorClass; + out.smsCauseCode = in.smsCauseCode; + return out; + } + + static public android.hardware.radio.CdmaBroadcastSmsConfigInfo h2aTranslate( + android.hardware.radio.V1_0.CdmaBroadcastSmsConfigInfo in) { + android.hardware.radio.CdmaBroadcastSmsConfigInfo out = + new android.hardware.radio.CdmaBroadcastSmsConfigInfo(); + out.serviceCategory = in.serviceCategory; + out.language = in.language; + out.selected = in.selected; + return out; + } + + static public android.hardware.radio.CdmaSmsWriteArgs h2aTranslate( + android.hardware.radio.V1_0.CdmaSmsWriteArgs in) { + android.hardware.radio.CdmaSmsWriteArgs out = new android.hardware.radio.CdmaSmsWriteArgs(); + out.status = in.status; + out.message = h2aTranslate(in.message); + return out; + } + + static public android.hardware.radio.GsmBroadcastSmsConfigInfo h2aTranslate( + android.hardware.radio.V1_0.GsmBroadcastSmsConfigInfo in) { + android.hardware.radio.GsmBroadcastSmsConfigInfo out = + new android.hardware.radio.GsmBroadcastSmsConfigInfo(); + out.fromServiceId = in.fromServiceId; + out.toServiceId = in.toServiceId; + out.fromCodeScheme = in.fromCodeScheme; + out.toCodeScheme = in.toCodeScheme; + out.selected = in.selected; + return out; + } + + static public android.hardware.radio.GsmSmsMessage h2aTranslate( + android.hardware.radio.V1_0.GsmSmsMessage in) { + android.hardware.radio.GsmSmsMessage out = new android.hardware.radio.GsmSmsMessage(); + out.smscPdu = in.smscPdu; + out.pdu = in.pdu; + return out; + } + + static public android.hardware.radio.ImsSmsMessage h2aTranslate( + android.hardware.radio.V1_0.ImsSmsMessage in) { + android.hardware.radio.ImsSmsMessage out = new android.hardware.radio.ImsSmsMessage(); + out.tech = in.tech; + out.retry = in.retry; + out.messageRef = in.messageRef; + if (in.cdmaMessage != null) { + out.cdmaMessage = new android.hardware.radio.CdmaSmsMessage[in.cdmaMessage.size()]; + for (int i = 0; i < in.cdmaMessage.size(); i++) { + out.cdmaMessage[i] = h2aTranslate(in.cdmaMessage.get(i)); + } + } + if (in.gsmMessage != null) { + out.gsmMessage = new android.hardware.radio.GsmSmsMessage[in.gsmMessage.size()]; + for (int i = 0; i < in.gsmMessage.size(); i++) { + out.gsmMessage[i] = h2aTranslate(in.gsmMessage.get(i)); + } + } + return out; + } + + static public android.hardware.radio.SimApdu h2aTranslate( + android.hardware.radio.V1_0.SimApdu in) { + android.hardware.radio.SimApdu out = new android.hardware.radio.SimApdu(); + out.sessionId = in.sessionId; + out.cla = in.cla; + out.instruction = in.instruction; + out.p1 = in.p1; + out.p2 = in.p2; + out.p3 = in.p3; + out.data = in.data; + return out; + } + + static public android.hardware.radio.NvWriteItem h2aTranslate( + android.hardware.radio.V1_0.NvWriteItem in) { + android.hardware.radio.NvWriteItem out = new android.hardware.radio.NvWriteItem(); + out.itemId = in.itemId; + out.value = in.value; + return out; + } + + static public android.hardware.radio.SelectUiccSub h2aTranslate( + android.hardware.radio.V1_0.SelectUiccSub in) { + android.hardware.radio.SelectUiccSub out = new android.hardware.radio.SelectUiccSub(); + out.slot = in.slot; + out.appIndex = in.appIndex; + out.subType = in.subType; + out.actStatus = in.actStatus; + return out; + } + + static public android.hardware.radio.HardwareConfigModem h2aTranslate( + android.hardware.radio.V1_0.HardwareConfigModem in) { + android.hardware.radio.HardwareConfigModem out = + new android.hardware.radio.HardwareConfigModem(); + out.rilModel = in.rilModel; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.rat > 2147483647 || in.rat < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.rat"); + } + out.rat = in.rat; + out.maxVoice = in.maxVoice; + out.maxData = in.maxData; + out.maxStandby = in.maxStandby; + return out; + } + + static public android.hardware.radio.HardwareConfigSim h2aTranslate( + android.hardware.radio.V1_0.HardwareConfigSim in) { + android.hardware.radio.HardwareConfigSim out = + new android.hardware.radio.HardwareConfigSim(); + out.modemUuid = in.modemUuid; + return out; + } + + static public android.hardware.radio.HardwareConfig h2aTranslate( + android.hardware.radio.V1_0.HardwareConfig in) { + android.hardware.radio.HardwareConfig out = new android.hardware.radio.HardwareConfig(); + out.type = in.type; + out.uuid = in.uuid; + out.state = in.state; + if (in.modem != null) { + out.modem = new android.hardware.radio.HardwareConfigModem[in.modem.size()]; + for (int i = 0; i < in.modem.size(); i++) { + out.modem[i] = h2aTranslate(in.modem.get(i)); + } + } + if (in.sim != null) { + out.sim = new android.hardware.radio.HardwareConfigSim[in.sim.size()]; + for (int i = 0; i < in.sim.size(); i++) { + out.sim[i] = h2aTranslate(in.sim.get(i)); + } + } + return out; + } + + static public android.hardware.radio.LceStatusInfo h2aTranslate( + android.hardware.radio.V1_0.LceStatusInfo in) { + android.hardware.radio.LceStatusInfo out = new android.hardware.radio.LceStatusInfo(); + out.lceStatus = in.lceStatus; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.actualIntervalMs > 127 || in.actualIntervalMs < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.actualIntervalMs"); + } + out.actualIntervalMs = in.actualIntervalMs; + return out; + } + + static public android.hardware.radio.LceDataInfo h2aTranslate( + android.hardware.radio.V1_0.LceDataInfo in) { + android.hardware.radio.LceDataInfo out = new android.hardware.radio.LceDataInfo(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.lastHopCapacityKbps > 2147483647 || in.lastHopCapacityKbps < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.lastHopCapacityKbps"); + } + out.lastHopCapacityKbps = in.lastHopCapacityKbps; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.confidenceLevel > 127 || in.confidenceLevel < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.confidenceLevel"); + } + out.confidenceLevel = in.confidenceLevel; + out.lceSuspended = in.lceSuspended; + return out; + } + + static public android.hardware.radio.ActivityStatsInfo h2aTranslate( + android.hardware.radio.V1_0.ActivityStatsInfo in) { + android.hardware.radio.ActivityStatsInfo out = + new android.hardware.radio.ActivityStatsInfo(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.sleepModeTimeMs > 2147483647 || in.sleepModeTimeMs < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.sleepModeTimeMs"); + } + out.sleepModeTimeMs = in.sleepModeTimeMs; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.idleModeTimeMs > 2147483647 || in.idleModeTimeMs < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.idleModeTimeMs"); + } + out.idleModeTimeMs = in.idleModeTimeMs; + if (in.txmModetimeMs != null) { + out.txmModetimeMs = new int[in.txmModetimeMs.length]; + for (int i = 0; i < in.txmModetimeMs.length; i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it + // doesn't suit your needs. + if (in.txmModetimeMs[i] > 2147483647 || in.txmModetimeMs[i] < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.txmModetimeMs[i]"); + } + out.txmModetimeMs[i] = in.txmModetimeMs[i]; + } + } + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.rxModeTimeMs > 2147483647 || in.rxModeTimeMs < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.rxModeTimeMs"); + } + out.rxModeTimeMs = in.rxModeTimeMs; + return out; + } + + static public android.hardware.radio.Carrier h2aTranslate( + android.hardware.radio.V1_0.Carrier in) { + android.hardware.radio.Carrier out = new android.hardware.radio.Carrier(); + out.mcc = in.mcc; + out.mnc = in.mnc; + out.matchType = in.matchType; + out.matchData = in.matchData; + return out; + } + + static public android.hardware.radio.CarrierRestrictions h2aTranslate( + android.hardware.radio.V1_0.CarrierRestrictions in) { + android.hardware.radio.CarrierRestrictions out = + new android.hardware.radio.CarrierRestrictions(); + if (in.allowedCarriers != null) { + out.allowedCarriers = new android.hardware.radio.Carrier[in.allowedCarriers.size()]; + for (int i = 0; i < in.allowedCarriers.size(); i++) { + out.allowedCarriers[i] = h2aTranslate(in.allowedCarriers.get(i)); + } + } + if (in.excludedCarriers != null) { + out.excludedCarriers = new android.hardware.radio.Carrier[in.excludedCarriers.size()]; + for (int i = 0; i < in.excludedCarriers.size(); i++) { + out.excludedCarriers[i] = h2aTranslate(in.excludedCarriers.get(i)); + } + } + return out; + } + + static public android.hardware.radio.SuppSvcNotification h2aTranslate( + android.hardware.radio.V1_0.SuppSvcNotification in) { + android.hardware.radio.SuppSvcNotification out = + new android.hardware.radio.SuppSvcNotification(); + out.isMT = in.isMT; + out.code = in.code; + out.index = in.index; + out.type = in.type; + out.number = in.number; + return out; + } + + static public android.hardware.radio.SimRefreshResult h2aTranslate( + android.hardware.radio.V1_0.SimRefreshResult in) { + android.hardware.radio.SimRefreshResult out = new android.hardware.radio.SimRefreshResult(); + out.type = in.type; + out.efId = in.efId; + out.aid = in.aid; + return out; + } + + static public android.hardware.radio.CdmaSignalInfoRecord h2aTranslate( + android.hardware.radio.V1_0.CdmaSignalInfoRecord in) { + android.hardware.radio.CdmaSignalInfoRecord out = + new android.hardware.radio.CdmaSignalInfoRecord(); + out.isPresent = in.isPresent; + out.signalType = in.signalType; + out.alertPitch = in.alertPitch; + out.signal = in.signal; + return out; + } + + static public android.hardware.radio.CdmaCallWaiting h2aTranslate( + android.hardware.radio.V1_0.CdmaCallWaiting in) { + android.hardware.radio.CdmaCallWaiting out = new android.hardware.radio.CdmaCallWaiting(); + out.number = in.number; + out.numberPresentation = in.numberPresentation; + out.name = in.name; + out.signalInfoRecord = h2aTranslate(in.signalInfoRecord); + out.numberType = in.numberType; + out.numberPlan = in.numberPlan; + return out; + } + + static public android.hardware.radio.CdmaDisplayInfoRecord h2aTranslate( + android.hardware.radio.V1_0.CdmaDisplayInfoRecord in) { + android.hardware.radio.CdmaDisplayInfoRecord out = + new android.hardware.radio.CdmaDisplayInfoRecord(); + out.alphaBuf = in.alphaBuf; + return out; + } + + static public android.hardware.radio.CdmaNumberInfoRecord h2aTranslate( + android.hardware.radio.V1_0.CdmaNumberInfoRecord in) { + android.hardware.radio.CdmaNumberInfoRecord out = + new android.hardware.radio.CdmaNumberInfoRecord(); + out.number = in.number; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.numberType > 127 || in.numberType < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.numberType"); + } + out.numberType = in.numberType; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.numberPlan > 127 || in.numberPlan < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.numberPlan"); + } + out.numberPlan = in.numberPlan; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.pi > 127 || in.pi < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.pi"); + } + out.pi = in.pi; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.si > 127 || in.si < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.si"); + } + out.si = in.si; + return out; + } + + static public android.hardware.radio.CdmaRedirectingNumberInfoRecord h2aTranslate( + android.hardware.radio.V1_0.CdmaRedirectingNumberInfoRecord in) { + android.hardware.radio.CdmaRedirectingNumberInfoRecord out = + new android.hardware.radio.CdmaRedirectingNumberInfoRecord(); + out.redirectingNumber = h2aTranslate(in.redirectingNumber); + out.redirectingReason = in.redirectingReason; + return out; + } + + static public android.hardware.radio.CdmaLineControlInfoRecord h2aTranslate( + android.hardware.radio.V1_0.CdmaLineControlInfoRecord in) { + android.hardware.radio.CdmaLineControlInfoRecord out = + new android.hardware.radio.CdmaLineControlInfoRecord(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.lineCtrlPolarityIncluded > 127 || in.lineCtrlPolarityIncluded < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.lineCtrlPolarityIncluded"); + } + out.lineCtrlPolarityIncluded = in.lineCtrlPolarityIncluded; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.lineCtrlToggle > 127 || in.lineCtrlToggle < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.lineCtrlToggle"); + } + out.lineCtrlToggle = in.lineCtrlToggle; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.lineCtrlReverse > 127 || in.lineCtrlReverse < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.lineCtrlReverse"); + } + out.lineCtrlReverse = in.lineCtrlReverse; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.lineCtrlPowerDenial > 127 || in.lineCtrlPowerDenial < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.lineCtrlPowerDenial"); + } + out.lineCtrlPowerDenial = in.lineCtrlPowerDenial; + return out; + } + + static public android.hardware.radio.CdmaT53ClirInfoRecord h2aTranslate( + android.hardware.radio.V1_0.CdmaT53ClirInfoRecord in) { + android.hardware.radio.CdmaT53ClirInfoRecord out = + new android.hardware.radio.CdmaT53ClirInfoRecord(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.cause > 127 || in.cause < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.cause"); + } + out.cause = in.cause; + return out; + } + + static public android.hardware.radio.CdmaT53AudioControlInfoRecord h2aTranslate( + android.hardware.radio.V1_0.CdmaT53AudioControlInfoRecord in) { + android.hardware.radio.CdmaT53AudioControlInfoRecord out = + new android.hardware.radio.CdmaT53AudioControlInfoRecord(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.upLink > 127 || in.upLink < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.upLink"); + } + out.upLink = in.upLink; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.downLink > 127 || in.downLink < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.downLink"); + } + out.downLink = in.downLink; + return out; + } + + static public android.hardware.radio.CdmaInformationRecord h2aTranslate( + android.hardware.radio.V1_0.CdmaInformationRecord in) { + android.hardware.radio.CdmaInformationRecord out = + new android.hardware.radio.CdmaInformationRecord(); + out.name = in.name; + if (in.display != null) { + out.display = new android.hardware.radio.CdmaDisplayInfoRecord[in.display.size()]; + for (int i = 0; i < in.display.size(); i++) { + out.display[i] = h2aTranslate(in.display.get(i)); + } + } + if (in.number != null) { + out.number = new android.hardware.radio.CdmaNumberInfoRecord[in.number.size()]; + for (int i = 0; i < in.number.size(); i++) { + out.number[i] = h2aTranslate(in.number.get(i)); + } + } + if (in.signal != null) { + out.signal = new android.hardware.radio.CdmaSignalInfoRecord[in.signal.size()]; + for (int i = 0; i < in.signal.size(); i++) { + out.signal[i] = h2aTranslate(in.signal.get(i)); + } + } + if (in.redir != null) { + out.redir = new android.hardware.radio.CdmaRedirectingNumberInfoRecord[in.redir.size()]; + for (int i = 0; i < in.redir.size(); i++) { + out.redir[i] = h2aTranslate(in.redir.get(i)); + } + } + if (in.lineCtrl != null) { + out.lineCtrl = new android.hardware.radio.CdmaLineControlInfoRecord[in.lineCtrl.size()]; + for (int i = 0; i < in.lineCtrl.size(); i++) { + out.lineCtrl[i] = h2aTranslate(in.lineCtrl.get(i)); + } + } + if (in.clir != null) { + out.clir = new android.hardware.radio.CdmaT53ClirInfoRecord[in.clir.size()]; + for (int i = 0; i < in.clir.size(); i++) { + out.clir[i] = h2aTranslate(in.clir.get(i)); + } + } + if (in.audioCtrl != null) { + out.audioCtrl = + new android.hardware.radio.CdmaT53AudioControlInfoRecord[in.audioCtrl.size()]; + for (int i = 0; i < in.audioCtrl.size(); i++) { + out.audioCtrl[i] = h2aTranslate(in.audioCtrl.get(i)); + } + } + return out; + } + + static public android.hardware.radio.CdmaInformationRecords h2aTranslate( + android.hardware.radio.V1_0.CdmaInformationRecords in) { + android.hardware.radio.CdmaInformationRecords out = + new android.hardware.radio.CdmaInformationRecords(); + if (in.infoRec != null) { + out.infoRec = new android.hardware.radio.CdmaInformationRecord[in.infoRec.size()]; + for (int i = 0; i < in.infoRec.size(); i++) { + out.infoRec[i] = h2aTranslate(in.infoRec.get(i)); + } + } + return out; + } + + static public android.hardware.radio.CfData h2aTranslate( + android.hardware.radio.V1_0.CfData in) { + android.hardware.radio.CfData out = new android.hardware.radio.CfData(); + if (in.cfInfo != null) { + out.cfInfo = new android.hardware.radio.CallForwardInfo[in.cfInfo.size()]; + for (int i = 0; i < in.cfInfo.size(); i++) { + out.cfInfo[i] = h2aTranslate(in.cfInfo.get(i)); + } + } + return out; + } + + static public android.hardware.radio.SsInfoData h2aTranslate( + android.hardware.radio.V1_0.SsInfoData in) { + android.hardware.radio.SsInfoData out = new android.hardware.radio.SsInfoData(); + if (in.ssInfo != null) { + out.ssInfo = new int[in.ssInfo.size()]; + for (int i = 0; i < in.ssInfo.size(); i++) { + out.ssInfo[i] = in.ssInfo.get(i); + } + } + return out; + } + + static public android.hardware.radio.StkCcUnsolSsResult h2aTranslate( + android.hardware.radio.V1_0.StkCcUnsolSsResult in) { + android.hardware.radio.StkCcUnsolSsResult out = + new android.hardware.radio.StkCcUnsolSsResult(); + out.serviceType = in.serviceType; + out.requestType = in.requestType; + out.teleserviceType = in.teleserviceType; + out.serviceClass = in.serviceClass; + out.result = in.result; + if (in.ssInfo != null) { + out.ssInfo = new android.hardware.radio.SsInfoData[in.ssInfo.size()]; + for (int i = 0; i < in.ssInfo.size(); i++) { + out.ssInfo[i] = h2aTranslate(in.ssInfo.get(i)); + } + } + if (in.cfData != null) { + out.cfData = new android.hardware.radio.CfData[in.cfData.size()]; + for (int i = 0; i < in.cfData.size(); i++) { + out.cfData[i] = h2aTranslate(in.cfData.get(i)); + } + } + return out; + } + + static public android.hardware.radio.PcoDataInfo h2aTranslate( + android.hardware.radio.V1_0.PcoDataInfo in) { + android.hardware.radio.PcoDataInfo out = new android.hardware.radio.PcoDataInfo(); + out.cid = in.cid; + out.bearerProto = in.bearerProto; + out.pcoId = in.pcoId; + if (in.contents != null) { + out.contents = new byte[in.contents.size()]; + for (int i = 0; i < in.contents.size(); i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it + // doesn't suit your needs. + if (in.contents.get(i) > 127 || in.contents.get(i) < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.contents.get(i)"); + } + out.contents[i] = in.contents.get(i); + } + } + return out; + } + + static public android.hardware.radio.KeepaliveRequest h2aTranslate( + android.hardware.radio.V1_1.KeepaliveRequest in) { + android.hardware.radio.KeepaliveRequest out = new android.hardware.radio.KeepaliveRequest(); + out.type = in.type; + if (in.sourceAddress != null) { + out.sourceAddress = new byte[in.sourceAddress.size()]; + for (int i = 0; i < in.sourceAddress.size(); i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it + // doesn't suit your needs. + if (in.sourceAddress.get(i) > 127 || in.sourceAddress.get(i) < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.sourceAddress.get(i)"); + } + out.sourceAddress[i] = in.sourceAddress.get(i); + } + } + out.sourcePort = in.sourcePort; + if (in.destinationAddress != null) { + out.destinationAddress = new byte[in.destinationAddress.size()]; + for (int i = 0; i < in.destinationAddress.size(); i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it + // doesn't suit your needs. + if (in.destinationAddress.get(i) > 127 || in.destinationAddress.get(i) < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.destinationAddress.get(i)"); + } + out.destinationAddress[i] = in.destinationAddress.get(i); + } + } + out.destinationPort = in.destinationPort; + out.maxKeepaliveIntervalMillis = in.maxKeepaliveIntervalMillis; + out.cid = in.cid; + return out; + } + + static public android.hardware.radio.KeepaliveStatus h2aTranslate( + android.hardware.radio.V1_1.KeepaliveStatus in) { + android.hardware.radio.KeepaliveStatus out = new android.hardware.radio.KeepaliveStatus(); + out.sessionHandle = in.sessionHandle; + out.code = in.code; + return out; + } + + static public android.hardware.radio.CellIdentityOperatorNames h2aTranslate( + android.hardware.radio.V1_2.CellIdentityOperatorNames in) { + android.hardware.radio.CellIdentityOperatorNames out = + new android.hardware.radio.CellIdentityOperatorNames(); + out.alphaLong = in.alphaLong; + out.alphaShort = in.alphaShort; + return out; + } + + static public android.hardware.radio.CellIdentityCdma h2aTranslate( + android.hardware.radio.V1_2.CellIdentityCdma in) { + android.hardware.radio.CellIdentityCdma out = new android.hardware.radio.CellIdentityCdma(); + out.networkId = in.base.networkId; + out.systemId = in.base.systemId; + out.baseStationId = in.base.baseStationId; + out.longitude = in.base.longitude; + out.latitude = in.base.latitude; + out.operatorNames = h2aTranslate(in.operatorNames); + return out; + } + + static public android.hardware.radio.CellInfoCdma h2aTranslate( + android.hardware.radio.V1_2.CellInfoCdma in) { + android.hardware.radio.CellInfoCdma out = new android.hardware.radio.CellInfoCdma(); + out.cellIdentityCdma = h2aTranslate(in.cellIdentityCdma); + out.signalStrengthCdma = h2aTranslate(in.signalStrengthCdma); + out.signalStrengthEvdo = h2aTranslate(in.signalStrengthEvdo); + return out; + } + + static public android.hardware.radio.WcdmaSignalStrength h2aTranslate( + android.hardware.radio.V1_2.WcdmaSignalStrength in) { + android.hardware.radio.WcdmaSignalStrength out = + new android.hardware.radio.WcdmaSignalStrength(); + out.signalStrength = in.base.signalStrength; + out.bitErrorRate = in.base.bitErrorRate; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.rscp > 2147483647 || in.rscp < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.rscp"); + } + out.rscp = in.rscp; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.ecno > 2147483647 || in.ecno < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.ecno"); + } + out.ecno = in.ecno; + return out; + } + + static public android.hardware.radio.TdscdmaSignalStrength h2aTranslate( + android.hardware.radio.V1_2.TdscdmaSignalStrength in) { + android.hardware.radio.TdscdmaSignalStrength out = + new android.hardware.radio.TdscdmaSignalStrength(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.signalStrength > 2147483647 || in.signalStrength < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.signalStrength"); + } + out.signalStrength = in.signalStrength; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.bitErrorRate > 2147483647 || in.bitErrorRate < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.bitErrorRate"); + } + out.bitErrorRate = in.bitErrorRate; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.rscp > 2147483647 || in.rscp < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.rscp"); + } + out.rscp = in.rscp; + return out; + } + + static public android.hardware.radio.VoiceRegStateResult h2aTranslate( + android.hardware.radio.V1_2.VoiceRegStateResult in) { + android.hardware.radio.VoiceRegStateResult out = + new android.hardware.radio.VoiceRegStateResult(); + out.regState = in.regState; + out.rat = in.rat; + out.cssSupported = in.cssSupported; + out.roamingIndicator = in.roamingIndicator; + out.systemIsInPrl = in.systemIsInPrl; + out.defaultRoamingIndicator = in.defaultRoamingIndicator; + out.reasonForDenial = in.reasonForDenial; + // FIXME Unknown type: android.hardware.radio@1.2::CellIdentity + // That type's package needs to be converted separately and the corresponding translate + // function should be added here. + return out; + } + + static public android.hardware.radio.RadioResponseInfoModem h2aTranslate( + android.hardware.radio.V1_3.RadioResponseInfoModem in) { + android.hardware.radio.RadioResponseInfoModem out = + new android.hardware.radio.RadioResponseInfoModem(); + out.type = in.type; + out.serial = in.serial; + out.error = in.error; + out.isEnabled = in.isEnabled; + return out; + } + + static public android.hardware.radio.EmergencyNumber h2aTranslate( + android.hardware.radio.V1_4.EmergencyNumber in) { + android.hardware.radio.EmergencyNumber out = new android.hardware.radio.EmergencyNumber(); + out.number = in.number; + out.mcc = in.mcc; + out.mnc = in.mnc; + out.categories = in.categories; + if (in.urns != null) { + out.urns = new String[in.urns.size()]; + for (int i = 0; i < in.urns.size(); i++) { + out.urns[i] = in.urns.get(i); + } + } + out.sources = in.sources; + return out; + } + + static public android.hardware.radio.RadioFrequencyInfo h2aTranslate( + android.hardware.radio.V1_4.RadioFrequencyInfo in) { + android.hardware.radio.RadioFrequencyInfo out = + new android.hardware.radio.RadioFrequencyInfo(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_4.RadioFrequencyInfo.hidl_discriminator.range: + out.setRange(in.range()); + break; + case android.hardware.radio.V1_4.RadioFrequencyInfo.hidl_discriminator.channelNumber: + out.setChannelNumber(in.channelNumber()); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.LteVopsInfo h2aTranslate( + android.hardware.radio.V1_4.LteVopsInfo in) { + android.hardware.radio.LteVopsInfo out = new android.hardware.radio.LteVopsInfo(); + out.isVopsSupported = in.isVopsSupported; + out.isEmcBearerSupported = in.isEmcBearerSupported; + return out; + } + + static public android.hardware.radio.NrIndicators h2aTranslate( + android.hardware.radio.V1_4.NrIndicators in) { + android.hardware.radio.NrIndicators out = new android.hardware.radio.NrIndicators(); + out.isEndcAvailable = in.isEndcAvailable; + out.isDcNrRestricted = in.isDcNrRestricted; + out.isNrAvailable = in.isNrAvailable; + return out; + } + + static public android.hardware.radio.DataRegStateResult h2aTranslate( + android.hardware.radio.V1_4.DataRegStateResult in) { + android.hardware.radio.DataRegStateResult out = + new android.hardware.radio.DataRegStateResult(); + out.regState = in.base.regState; + out.rat = in.base.rat; + out.reasonDataDenied = in.base.reasonDataDenied; + out.maxDataCalls = in.base.maxDataCalls; + // FIXME Unknown type: android.hardware.radio@1.2::CellIdentity + // That type's package needs to be converted separately and the corresponding translate + // function should be added here. + out.vopsInfo = h2aTranslate(in.vopsInfo); + out.nrIndicators = h2aTranslate(in.nrIndicators); + return out; + } + + static public android.hardware.radio.DataRegStateResultVopsInfo h2aTranslate( + android.hardware.radio.V1_4.DataRegStateResult.VopsInfo in) { + android.hardware.radio.DataRegStateResultVopsInfo out = + new android.hardware.radio.DataRegStateResultVopsInfo(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_4.DataRegStateResult.VopsInfo.hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_4.DataRegStateResult.VopsInfo.hidl_discriminator + .lteVopsInfo: + out.setLteVopsInfo(h2aTranslate(in.lteVopsInfo())); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.CellConfigLte h2aTranslate( + android.hardware.radio.V1_4.CellConfigLte in) { + android.hardware.radio.CellConfigLte out = new android.hardware.radio.CellConfigLte(); + out.isEndcAvailable = in.isEndcAvailable; + return out; + } + + static public android.hardware.radio.CellInfoInfo h2aTranslate( + android.hardware.radio.V1_4.CellInfo.Info in) { + android.hardware.radio.CellInfoInfo out = new android.hardware.radio.CellInfoInfo(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_4.CellInfo.Info.hidl_discriminator.gsm: + // FIXME Unknown type: android.hardware.radio@1.2::CellInfoGsm + // That type's package needs to be converted separately and the corresponding + // translate function should be added here. + break; + case android.hardware.radio.V1_4.CellInfo.Info.hidl_discriminator.cdma: + out.setCdma(h2aTranslate(in.cdma())); + break; + case android.hardware.radio.V1_4.CellInfo.Info.hidl_discriminator.wcdma: + // FIXME Unknown type: android.hardware.radio@1.2::CellInfoWcdma + // That type's package needs to be converted separately and the corresponding + // translate function should be added here. + break; + case android.hardware.radio.V1_4.CellInfo.Info.hidl_discriminator.tdscdma: + // FIXME Unknown type: android.hardware.radio@1.2::CellInfoTdscdma + // That type's package needs to be converted separately and the corresponding + // translate function should be added here. + break; + case android.hardware.radio.V1_4.CellInfo.Info.hidl_discriminator.lte: + // FIXME Unknown type: android.hardware.radio@1.4::CellInfoLte + // That type's package needs to be converted separately and the corresponding + // translate function should be added here. + break; + case android.hardware.radio.V1_4.CellInfo.Info.hidl_discriminator.nr: + // FIXME Unknown type: android.hardware.radio@1.4::CellInfoNr + // That type's package needs to be converted separately and the corresponding + // translate function should be added here. + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.RadioCapability h2aTranslate( + android.hardware.radio.V1_4.RadioCapability in) { + android.hardware.radio.RadioCapability out = new android.hardware.radio.RadioCapability(); + out.session = in.session; + out.phase = in.phase; + out.raf = in.raf; + out.logicalModemUuid = in.logicalModemUuid; + out.status = in.status; + return out; + } + + static public android.hardware.radio.CarrierRestrictionsWithPriority h2aTranslate( + android.hardware.radio.V1_4.CarrierRestrictionsWithPriority in) { + android.hardware.radio.CarrierRestrictionsWithPriority out = + new android.hardware.radio.CarrierRestrictionsWithPriority(); + if (in.allowedCarriers != null) { + out.allowedCarriers = new android.hardware.radio.Carrier[in.allowedCarriers.size()]; + for (int i = 0; i < in.allowedCarriers.size(); i++) { + out.allowedCarriers[i] = h2aTranslate(in.allowedCarriers.get(i)); + } + } + if (in.excludedCarriers != null) { + out.excludedCarriers = new android.hardware.radio.Carrier[in.excludedCarriers.size()]; + for (int i = 0; i < in.excludedCarriers.size(); i++) { + out.excludedCarriers[i] = h2aTranslate(in.excludedCarriers.get(i)); + } + } + out.allowedCarriersPrioritized = in.allowedCarriersPrioritized; + return out; + } + + static public android.hardware.radio.RadioAccessSpecifier h2aTranslate( + android.hardware.radio.V1_5.RadioAccessSpecifier in) { + android.hardware.radio.RadioAccessSpecifier out = + new android.hardware.radio.RadioAccessSpecifier(); + out.radioAccessNetwork = in.radioAccessNetwork; + out.bands = h2aTranslate(in.bands); + if (in.channels != null) { + out.channels = new int[in.channels.size()]; + for (int i = 0; i < in.channels.size(); i++) { + out.channels[i] = in.channels.get(i); + } + } + return out; + } + + static public android.hardware.radio.RadioAccessSpecifierBands h2aTranslate( + android.hardware.radio.V1_5.RadioAccessSpecifier.Bands in) { + android.hardware.radio.RadioAccessSpecifierBands out = + new android.hardware.radio.RadioAccessSpecifierBands(); + List bands; + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_5.RadioAccessSpecifier.Bands.hidl_discriminator + .geranBands: + bands = in.geranBands(); + if (bands != null) { + int[] geranBands = new int[bands.size()]; + for (int i = 0; i < bands.size(); i++) { + geranBands[i] = bands.get(i); + } + out.geranBands(geranBands); + } + break; + case android.hardware.radio.V1_5.RadioAccessSpecifier.Bands.hidl_discriminator + .utranBands: + bands = in.utranBands(); + if (bands != null) { + int[] utranBands = new int[bands.size()]; + for (int i = 0; i < bands.size(); i++) { + utranBands[i] = bands.get(i); + } + out.utranBands(utranBands); + } + break; + case android.hardware.radio.V1_5.RadioAccessSpecifier.Bands.hidl_discriminator + .eutranBands: + bands = in.eutranBands(); + if (bands != null) { + int[] eutranBands = new int[bands.size()]; + for (int i = 0; i < bands.size(); i++) { + eutranBands[i] = bands.get(i); + } + out.eutranBands(eutranBands); + } + break; + case android.hardware.radio.V1_5.RadioAccessSpecifier.Bands.hidl_discriminator + .ngranBands: + bands = in.ngranBands(); + if (bands != null) { + int[] ngranBands = new int[bands.size()]; + for (int i = 0; i < bands.size(); i++) { + ngranBands[i] = bands.get(i); + } + out.ngranBands(ngranBands); + } + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.SignalThresholdInfo h2aTranslate( + android.hardware.radio.V1_5.SignalThresholdInfo in) { + android.hardware.radio.SignalThresholdInfo out = + new android.hardware.radio.SignalThresholdInfo(); + out.signalMeasurement = in.signalMeasurement; + out.hysteresisMs = in.hysteresisMs; + out.hysteresisDb = in.hysteresisDb; + if (in.thresholds != null) { + out.thresholds = new int[in.thresholds.size()]; + for (int i = 0; i < in.thresholds.size(); i++) { + out.thresholds[i] = in.thresholds.get(i); + } + } + out.isEnabled = in.isEnabled; + return out; + } + + static public android.hardware.radio.NetworkScanRequest h2aTranslate( + android.hardware.radio.V1_5.NetworkScanRequest in) { + android.hardware.radio.NetworkScanRequest out = + new android.hardware.radio.NetworkScanRequest(); + out.type = in.type; + out.interval = in.interval; + if (in.specifiers != null) { + out.specifiers = new android.hardware.radio.RadioAccessSpecifier[in.specifiers.size()]; + for (int i = 0; i < in.specifiers.size(); i++) { + out.specifiers[i] = h2aTranslate(in.specifiers.get(i)); + } + } + out.maxSearchTime = in.maxSearchTime; + out.incrementalResults = in.incrementalResults; + out.incrementalResultsPeriodicity = in.incrementalResultsPeriodicity; + if (in.mccMncs != null) { + out.mccMncs = new String[in.mccMncs.size()]; + for (int i = 0; i < in.mccMncs.size(); i++) { + out.mccMncs[i] = in.mccMncs.get(i); + } + } + return out; + } + + static public android.hardware.radio.DataProfileInfo h2aTranslate( + android.hardware.radio.V1_5.DataProfileInfo in) { + android.hardware.radio.DataProfileInfo out = new android.hardware.radio.DataProfileInfo(); + out.profileId = in.profileId; + out.apn = in.apn; + out.protocol = in.protocol; + out.roamingProtocol = in.roamingProtocol; + out.authType = in.authType; + out.user = in.user; + out.password = in.password; + out.type = in.type; + out.maxConnsTime = in.maxConnsTime; + out.maxConns = in.maxConns; + out.waitTime = in.waitTime; + out.enabled = in.enabled; + out.supportedApnTypesBitmap = in.supportedApnTypesBitmap; + out.bearerBitmap = in.bearerBitmap; + out.mtuV4 = in.mtuV4; + out.mtuV6 = in.mtuV6; + out.preferred = in.preferred; + out.persistent = in.persistent; + return out; + } + + static public android.hardware.radio.LinkAddress h2aTranslate( + android.hardware.radio.V1_5.LinkAddress in) { + android.hardware.radio.LinkAddress out = new android.hardware.radio.LinkAddress(); + out.address = in.address; + out.properties = in.properties; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.deprecationTime > 9223372036854775807L || in.deprecationTime < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.deprecationTime"); + } + out.deprecationTime = in.deprecationTime; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.expirationTime > 9223372036854775807L || in.expirationTime < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.expirationTime"); + } + out.expirationTime = in.expirationTime; + return out; + } + + static public android.hardware.radio.ClosedSubscriberGroupInfo h2aTranslate( + android.hardware.radio.V1_5.ClosedSubscriberGroupInfo in) { + android.hardware.radio.ClosedSubscriberGroupInfo out = + new android.hardware.radio.ClosedSubscriberGroupInfo(); + out.csgIndication = in.csgIndication; + out.homeNodebName = in.homeNodebName; + out.csgIdentity = in.csgIdentity; + return out; + } + + static public android.hardware.radio.OptionalCsgInfo h2aTranslate( + android.hardware.radio.V1_5.OptionalCsgInfo in) { + android.hardware.radio.OptionalCsgInfo out = new android.hardware.radio.OptionalCsgInfo(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_5.OptionalCsgInfo.hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_5.OptionalCsgInfo.hidl_discriminator.csgInfo: + out.setCsgInfo(h2aTranslate(in.csgInfo())); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.CellIdentityGsm h2aTranslate( + android.hardware.radio.V1_5.CellIdentityGsm in) { + android.hardware.radio.CellIdentityGsm out = new android.hardware.radio.CellIdentityGsm(); + out.mcc = in.base.base.mcc; + out.mnc = in.base.base.mnc; + out.lac = in.base.base.lac; + out.cid = in.base.base.cid; + out.arfcn = in.base.base.arfcn; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.base.base.bsic > 127 || in.base.base.bsic < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.base.base.bsic"); + } + out.bsic = in.base.base.bsic; + out.operatorNames = h2aTranslate(in.base.operatorNames); + if (in.additionalPlmns != null) { + out.additionalPlmns = new String[in.additionalPlmns.size()]; + for (int i = 0; i < in.additionalPlmns.size(); i++) { + out.additionalPlmns[i] = in.additionalPlmns.get(i); + } + } + return out; + } + + static public android.hardware.radio.CellIdentityWcdma h2aTranslate( + android.hardware.radio.V1_5.CellIdentityWcdma in) { + android.hardware.radio.CellIdentityWcdma out = + new android.hardware.radio.CellIdentityWcdma(); + out.mcc = in.base.base.mcc; + out.mnc = in.base.base.mnc; + out.lac = in.base.base.lac; + out.cid = in.base.base.cid; + out.psc = in.base.base.psc; + out.uarfcn = in.base.base.uarfcn; + out.operatorNames = h2aTranslate(in.base.operatorNames); + if (in.additionalPlmns != null) { + out.additionalPlmns = new String[in.additionalPlmns.size()]; + for (int i = 0; i < in.additionalPlmns.size(); i++) { + out.additionalPlmns[i] = in.additionalPlmns.get(i); + } + } + out.optionalCsgInfo = h2aTranslate(in.optionalCsgInfo); + return out; + } + + static public android.hardware.radio.CellIdentityTdscdma h2aTranslate( + android.hardware.radio.V1_5.CellIdentityTdscdma in) { + android.hardware.radio.CellIdentityTdscdma out = + new android.hardware.radio.CellIdentityTdscdma(); + out.mcc = in.base.base.mcc; + out.mnc = in.base.base.mnc; + out.lac = in.base.base.lac; + out.cid = in.base.base.cid; + out.cpid = in.base.base.cpid; + out.uarfcn = in.base.uarfcn; + out.operatorNames = h2aTranslate(in.base.operatorNames); + if (in.additionalPlmns != null) { + out.additionalPlmns = new String[in.additionalPlmns.size()]; + for (int i = 0; i < in.additionalPlmns.size(); i++) { + out.additionalPlmns[i] = in.additionalPlmns.get(i); + } + } + out.optionalCsgInfo = h2aTranslate(in.optionalCsgInfo); + return out; + } + + static public android.hardware.radio.CellIdentityLte h2aTranslate( + android.hardware.radio.V1_5.CellIdentityLte in) { + android.hardware.radio.CellIdentityLte out = new android.hardware.radio.CellIdentityLte(); + out.mcc = in.base.base.mcc; + out.mnc = in.base.base.mnc; + out.ci = in.base.base.ci; + out.pci = in.base.base.pci; + out.tac = in.base.base.tac; + out.earfcn = in.base.base.earfcn; + out.operatorNames = h2aTranslate(in.base.operatorNames); + out.bandwidth = in.base.bandwidth; + if (in.additionalPlmns != null) { + out.additionalPlmns = new String[in.additionalPlmns.size()]; + for (int i = 0; i < in.additionalPlmns.size(); i++) { + out.additionalPlmns[i] = in.additionalPlmns.get(i); + } + } + out.optionalCsgInfo = h2aTranslate(in.optionalCsgInfo); + if (in.bands != null) { + out.bands = new int[in.bands.size()]; + for (int i = 0; i < in.bands.size(); i++) { + out.bands[i] = in.bands.get(i); + } + } + return out; + } + + static public android.hardware.radio.CellIdentityNr h2aTranslate( + android.hardware.radio.V1_5.CellIdentityNr in) { + android.hardware.radio.CellIdentityNr out = new android.hardware.radio.CellIdentityNr(); + out.mcc = in.base.mcc; + out.mnc = in.base.mnc; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.base.nci > 9223372036854775807L || in.base.nci < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.base.nci"); + } + out.nci = in.base.nci; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.base.pci > 2147483647 || in.base.pci < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.base.pci"); + } + out.pci = in.base.pci; + out.tac = in.base.tac; + out.nrarfcn = in.base.nrarfcn; + out.operatorNames = h2aTranslate(in.base.operatorNames); + if (in.additionalPlmns != null) { + out.additionalPlmns = new String[in.additionalPlmns.size()]; + for (int i = 0; i < in.additionalPlmns.size(); i++) { + out.additionalPlmns[i] = in.additionalPlmns.get(i); + } + } + if (in.bands != null) { + out.bands = new int[in.bands.size()]; + for (int i = 0; i < in.bands.size(); i++) { + out.bands[i] = in.bands.get(i); + } + } + return out; + } + + static public android.hardware.radio.CellInfoGsm h2aTranslate( + android.hardware.radio.V1_5.CellInfoGsm in) { + android.hardware.radio.CellInfoGsm out = new android.hardware.radio.CellInfoGsm(); + out.cellIdentityGsm = h2aTranslate(in.cellIdentityGsm); + out.signalStrengthGsm = h2aTranslate(in.signalStrengthGsm); + return out; + } + + static public android.hardware.radio.CellInfoWcdma h2aTranslate( + android.hardware.radio.V1_5.CellInfoWcdma in) { + android.hardware.radio.CellInfoWcdma out = new android.hardware.radio.CellInfoWcdma(); + out.cellIdentityWcdma = h2aTranslate(in.cellIdentityWcdma); + out.signalStrengthWcdma = h2aTranslate(in.signalStrengthWcdma); + return out; + } + + static public android.hardware.radio.CellInfoTdscdma h2aTranslate( + android.hardware.radio.V1_5.CellInfoTdscdma in) { + android.hardware.radio.CellInfoTdscdma out = new android.hardware.radio.CellInfoTdscdma(); + out.cellIdentityTdscdma = h2aTranslate(in.cellIdentityTdscdma); + out.signalStrengthTdscdma = h2aTranslate(in.signalStrengthTdscdma); + return out; + } + + static public android.hardware.radio.CellIdentity h2aTranslate( + android.hardware.radio.V1_5.CellIdentity in) { + android.hardware.radio.CellIdentity out = new android.hardware.radio.CellIdentity(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.gsm: + out.setGsm(h2aTranslate(in.gsm())); + break; + case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.wcdma: + out.setWcdma(h2aTranslate(in.wcdma())); + break; + case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.tdscdma: + out.setTdscdma(h2aTranslate(in.tdscdma())); + break; + case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.cdma: + out.setCdma(h2aTranslate(in.cdma())); + break; + case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.lte: + out.setLte(h2aTranslate(in.lte())); + break; + case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.nr: + out.setNr(h2aTranslate(in.nr())); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.BarringInfo h2aTranslate( + android.hardware.radio.V1_5.BarringInfo in) { + android.hardware.radio.BarringInfo out = new android.hardware.radio.BarringInfo(); + out.serviceType = in.serviceType; + out.barringType = in.barringType; + out.barringTypeSpecificInfo = h2aTranslate(in.barringTypeSpecificInfo); + return out; + } + + static public android.hardware.radio.BarringInfoBarringTypeSpecificInfoConditional h2aTranslate( + android.hardware.radio.V1_5.BarringInfo.BarringTypeSpecificInfo.Conditional in) { + android.hardware.radio.BarringInfoBarringTypeSpecificInfoConditional out = + new android.hardware.radio.BarringInfoBarringTypeSpecificInfoConditional(); + out.factor = in.factor; + out.timeSeconds = in.timeSeconds; + out.isBarred = in.isBarred; + return out; + } + + static public android.hardware.radio.BarringInfoBarringTypeSpecificInfo h2aTranslate( + android.hardware.radio.V1_5.BarringInfo.BarringTypeSpecificInfo in) { + android.hardware.radio.BarringInfoBarringTypeSpecificInfo out = + new android.hardware.radio.BarringInfoBarringTypeSpecificInfo(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_5.BarringInfo.BarringTypeSpecificInfo.hidl_discriminator + .noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_5.BarringInfo.BarringTypeSpecificInfo.hidl_discriminator + .conditional: + out.setConditional(h2aTranslate(in.conditional())); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio + .RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo + h2aTranslate(android.hardware.radio.V1_5.RegStateResult.AccessTechnologySpecificInfo + .Cdma2000RegistrationInfo in) { + android.hardware.radio + .RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo out = + new android.hardware.radio + .RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo(); + out.cssSupported = in.cssSupported; + out.roamingIndicator = in.roamingIndicator; + out.systemIsInPrl = in.systemIsInPrl; + out.defaultRoamingIndicator = in.defaultRoamingIndicator; + return out; + } + + static public android.hardware.radio + .RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo + h2aTranslate(android.hardware.radio.V1_5.RegStateResult.AccessTechnologySpecificInfo + .EutranRegistrationInfo in) { + android.hardware.radio + .RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo out = + new android.hardware.radio + .RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo(); + out.lteVopsInfo = h2aTranslate(in.lteVopsInfo); + out.nrIndicators = h2aTranslate(in.nrIndicators); + return out; + } + + static public android.hardware.radio.AppStatus h2aTranslate( + android.hardware.radio.V1_5.AppStatus in) { + android.hardware.radio.AppStatus out = new android.hardware.radio.AppStatus(); + out.appType = in.base.appType; + out.appState = in.base.appState; + out.persoSubstate = in.persoSubstate; + out.aidPtr = in.base.aidPtr; + out.appLabelPtr = in.base.appLabelPtr; + out.pin1Replaced = in.base.pin1Replaced; + out.pin1 = in.base.pin1; + out.pin2 = in.base.pin2; + return out; + } + + static public android.hardware.radio.CardStatus h2aTranslate( + android.hardware.radio.V1_5.CardStatus in) { + android.hardware.radio.CardStatus out = new android.hardware.radio.CardStatus(); + out.cardState = in.base.base.base.cardState; + out.universalPinState = in.base.base.base.universalPinState; + out.gsmUmtsSubscriptionAppIndex = in.base.base.base.gsmUmtsSubscriptionAppIndex; + out.cdmaSubscriptionAppIndex = in.base.base.base.cdmaSubscriptionAppIndex; + out.imsSubscriptionAppIndex = in.base.base.base.imsSubscriptionAppIndex; + if (in.applications != null) { + out.applications = new android.hardware.radio.AppStatus[in.applications.size()]; + for (int i = 0; i < in.applications.size(); i++) { + out.applications[i] = h2aTranslate(in.applications.get(i)); + } + } + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.base.base.physicalSlotId > 2147483647 || in.base.base.physicalSlotId < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.base.base.physicalSlotId"); + } + out.physicalSlotId = in.base.base.physicalSlotId; + out.atr = in.base.base.atr; + out.iccid = in.base.base.iccid; + out.eid = in.base.eid; + return out; + } + + static public android.hardware.radio.QosBandwidth h2aTranslate( + android.hardware.radio.V1_6.QosBandwidth in) { + android.hardware.radio.QosBandwidth out = new android.hardware.radio.QosBandwidth(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.maxBitrateKbps > 2147483647 || in.maxBitrateKbps < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.maxBitrateKbps"); + } + out.maxBitrateKbps = in.maxBitrateKbps; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.guaranteedBitrateKbps > 2147483647 || in.guaranteedBitrateKbps < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.guaranteedBitrateKbps"); + } + out.guaranteedBitrateKbps = in.guaranteedBitrateKbps; + return out; + } + + static public android.hardware.radio.EpsQos h2aTranslate( + android.hardware.radio.V1_6.EpsQos in) { + android.hardware.radio.EpsQos out = new android.hardware.radio.EpsQos(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.qci < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.qci"); + } + out.qci = (char) in.qci; + out.downlink = h2aTranslate(in.downlink); + out.uplink = h2aTranslate(in.uplink); + return out; + } + + static public android.hardware.radio.NrQos h2aTranslate(android.hardware.radio.V1_6.NrQos in) { + android.hardware.radio.NrQos out = new android.hardware.radio.NrQos(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.fiveQi < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.fiveQi"); + } + out.fiveQi = (char) in.fiveQi; + out.downlink = h2aTranslate(in.downlink); + out.uplink = h2aTranslate(in.uplink); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.qfi > 127 || in.qfi < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.qfi"); + } + out.qfi = in.qfi; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.averagingWindowMs < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.averagingWindowMs"); + } + out.averagingWindowMs = (char) in.averagingWindowMs; + return out; + } + + static public android.hardware.radio.Qos h2aTranslate(android.hardware.radio.V1_6.Qos in) { + android.hardware.radio.Qos out = new android.hardware.radio.Qos(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_6.Qos.hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_6.Qos.hidl_discriminator.eps: + out.setEps(h2aTranslate(in.eps())); + break; + case android.hardware.radio.V1_6.Qos.hidl_discriminator.nr: + out.setNr(h2aTranslate(in.nr())); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.RadioResponseInfo h2aTranslate( + android.hardware.radio.V1_6.RadioResponseInfo in) { + android.hardware.radio.RadioResponseInfo out = + new android.hardware.radio.RadioResponseInfo(); + out.type = in.type; + out.serial = in.serial; + out.error = in.error; + return out; + } + + static public android.hardware.radio.PortRange h2aTranslate( + android.hardware.radio.V1_6.PortRange in) { + android.hardware.radio.PortRange out = new android.hardware.radio.PortRange(); + out.start = in.start; + out.end = in.end; + return out; + } + + static public android.hardware.radio.MaybePort h2aTranslate( + android.hardware.radio.V1_6.MaybePort in) { + android.hardware.radio.MaybePort out = new android.hardware.radio.MaybePort(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_6.MaybePort.hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_6.MaybePort.hidl_discriminator.range: + out.setRange(h2aTranslate(in.range())); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.QosFilter h2aTranslate( + android.hardware.radio.V1_6.QosFilter in) { + android.hardware.radio.QosFilter out = new android.hardware.radio.QosFilter(); + if (in.localAddresses != null) { + out.localAddresses = new String[in.localAddresses.size()]; + for (int i = 0; i < in.localAddresses.size(); i++) { + out.localAddresses[i] = in.localAddresses.get(i); + } + } + if (in.remoteAddresses != null) { + out.remoteAddresses = new String[in.remoteAddresses.size()]; + for (int i = 0; i < in.remoteAddresses.size(); i++) { + out.remoteAddresses[i] = in.remoteAddresses.get(i); + } + } + out.localPort = h2aTranslate(in.localPort); + out.remotePort = h2aTranslate(in.remotePort); + out.protocol = in.protocol; + out.tos = h2aTranslate(in.tos); + out.flowLabel = h2aTranslate(in.flowLabel); + out.spi = h2aTranslate(in.spi); + out.direction = in.direction; + out.precedence = in.precedence; + return out; + } + + static public android.hardware.radio.QosFilterTypeOfService h2aTranslate( + android.hardware.radio.V1_6.QosFilter.TypeOfService in) { + android.hardware.radio.QosFilterTypeOfService out = + new android.hardware.radio.QosFilterTypeOfService(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_6.QosFilter.TypeOfService.hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_6.QosFilter.TypeOfService.hidl_discriminator.value: + // FIXME This requires conversion between signed and unsigned. Change this if it + // doesn't suit your needs. + if (in.value() > 127 || in.value() < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.value()"); + } + out.setValue(in.value()); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.QosFilterIpv6FlowLabel h2aTranslate( + android.hardware.radio.V1_6.QosFilter.Ipv6FlowLabel in) { + android.hardware.radio.QosFilterIpv6FlowLabel out = + new android.hardware.radio.QosFilterIpv6FlowLabel(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_6.QosFilter.Ipv6FlowLabel.hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_6.QosFilter.Ipv6FlowLabel.hidl_discriminator.value: + // FIXME This requires conversion between signed and unsigned. Change this if it + // doesn't suit your needs. + if (in.value() > 2147483647 || in.value() < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.value()"); + } + out.setValue(in.value()); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.QosFilterIpsecSpi h2aTranslate( + android.hardware.radio.V1_6.QosFilter.IpsecSpi in) { + android.hardware.radio.QosFilterIpsecSpi out = + new android.hardware.radio.QosFilterIpsecSpi(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_6.QosFilter.IpsecSpi.hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_6.QosFilter.IpsecSpi.hidl_discriminator.value: + // FIXME This requires conversion between signed and unsigned. Change this if it + // doesn't suit your needs. + if (in.value() > 2147483647 || in.value() < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.value()"); + } + out.setValue(in.value()); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.QosSession h2aTranslate( + android.hardware.radio.V1_6.QosSession in) { + android.hardware.radio.QosSession out = new android.hardware.radio.QosSession(); + out.qosSessionId = in.qosSessionId; + out.qos = h2aTranslate(in.qos); + if (in.qosFilters != null) { + out.qosFilters = new android.hardware.radio.QosFilter[in.qosFilters.size()]; + for (int i = 0; i < in.qosFilters.size(); i++) { + out.qosFilters[i] = h2aTranslate(in.qosFilters.get(i)); + } + } + return out; + } + + static public android.hardware.radio.SetupDataCallResult h2aTranslate( + android.hardware.radio.V1_6.SetupDataCallResult in) { + android.hardware.radio.SetupDataCallResult out = + new android.hardware.radio.SetupDataCallResult(); + out.cause = in.cause; + out.suggestedRetryTime = in.suggestedRetryTime; + out.cid = in.cid; + out.active = in.active; + out.type = in.type; + out.ifname = in.ifname; + if (in.addresses != null) { + out.addresses = new android.hardware.radio.LinkAddress[in.addresses.size()]; + for (int i = 0; i < in.addresses.size(); i++) { + out.addresses[i] = h2aTranslate(in.addresses.get(i)); + } + } + if (in.dnses != null) { + out.dnses = new String[in.dnses.size()]; + for (int i = 0; i < in.dnses.size(); i++) { + out.dnses[i] = in.dnses.get(i); + } + } + if (in.gateways != null) { + out.gateways = new String[in.gateways.size()]; + for (int i = 0; i < in.gateways.size(); i++) { + out.gateways[i] = in.gateways.get(i); + } + } + if (in.pcscf != null) { + out.pcscf = new String[in.pcscf.size()]; + for (int i = 0; i < in.pcscf.size(); i++) { + out.pcscf[i] = in.pcscf.get(i); + } + } + out.mtuV4 = in.mtuV4; + out.mtuV6 = in.mtuV6; + out.defaultQos = h2aTranslate(in.defaultQos); + if (in.qosSessions != null) { + out.qosSessions = new android.hardware.radio.QosSession[in.qosSessions.size()]; + for (int i = 0; i < in.qosSessions.size(); i++) { + out.qosSessions[i] = h2aTranslate(in.qosSessions.get(i)); + } + } + out.handoverFailureMode = in.handoverFailureMode; + out.pduSessionId = in.pduSessionId; + out.sliceInfo = h2aTranslate(in.sliceInfo); + if (in.trafficDescriptors != null) { + out.trafficDescriptors = + new android.hardware.radio.TrafficDescriptor[in.trafficDescriptors.size()]; + for (int i = 0; i < in.trafficDescriptors.size(); i++) { + out.trafficDescriptors[i] = h2aTranslate(in.trafficDescriptors.get(i)); + } + } + return out; + } + + static public android.hardware.radio.LinkCapacityEstimate h2aTranslate( + android.hardware.radio.V1_6.LinkCapacityEstimate in) { + android.hardware.radio.LinkCapacityEstimate out = + new android.hardware.radio.LinkCapacityEstimate(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.downlinkCapacityKbps > 2147483647 || in.downlinkCapacityKbps < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.downlinkCapacityKbps"); + } + out.downlinkCapacityKbps = in.downlinkCapacityKbps; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.uplinkCapacityKbps > 2147483647 || in.uplinkCapacityKbps < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.uplinkCapacityKbps"); + } + out.uplinkCapacityKbps = in.uplinkCapacityKbps; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.secondaryDownlinkCapacityKbps > 2147483647 || in.secondaryDownlinkCapacityKbps < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.secondaryDownlinkCapacityKbps"); + } + out.secondaryDownlinkCapacityKbps = in.secondaryDownlinkCapacityKbps; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.secondaryUplinkCapacityKbps > 2147483647 || in.secondaryUplinkCapacityKbps < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.secondaryUplinkCapacityKbps"); + } + out.secondaryUplinkCapacityKbps = in.secondaryUplinkCapacityKbps; + return out; + } + + static public android.hardware.radio.NrVopsInfo h2aTranslate( + android.hardware.radio.V1_6.NrVopsInfo in) { + android.hardware.radio.NrVopsInfo out = new android.hardware.radio.NrVopsInfo(); + out.vopsSupported = in.vopsSupported; + out.emcSupported = in.emcSupported; + out.emfSupported = in.emfSupported; + return out; + } + + static public android.hardware.radio.LteSignalStrength h2aTranslate( + android.hardware.radio.V1_6.LteSignalStrength in) { + android.hardware.radio.LteSignalStrength out = + new android.hardware.radio.LteSignalStrength(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.base.signalStrength > 2147483647 || in.base.signalStrength < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.base.signalStrength"); + } + out.signalStrength = in.base.signalStrength; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.base.rsrp > 2147483647 || in.base.rsrp < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.base.rsrp"); + } + out.rsrp = in.base.rsrp; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.base.rsrq > 2147483647 || in.base.rsrq < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.base.rsrq"); + } + out.rsrq = in.base.rsrq; + out.rssnr = in.base.rssnr; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.base.cqi > 2147483647 || in.base.cqi < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.base.cqi"); + } + out.cqi = in.base.cqi; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.base.timingAdvance > 2147483647 || in.base.timingAdvance < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.base.timingAdvance"); + } + out.timingAdvance = in.base.timingAdvance; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.cqiTableIndex > 2147483647 || in.cqiTableIndex < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.cqiTableIndex"); + } + out.cqiTableIndex = in.cqiTableIndex; + return out; + } + + static public android.hardware.radio.NrSignalStrength h2aTranslate( + android.hardware.radio.V1_6.NrSignalStrength in) { + android.hardware.radio.NrSignalStrength out = new android.hardware.radio.NrSignalStrength(); + out.ssRsrp = in.base.ssRsrp; + out.ssRsrq = in.base.ssRsrq; + out.ssSinr = in.base.ssSinr; + out.csiRsrp = in.base.csiRsrp; + out.csiRsrq = in.base.csiRsrq; + out.csiSinr = in.base.csiSinr; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.csiCqiTableIndex > 2147483647 || in.csiCqiTableIndex < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.csiCqiTableIndex"); + } + out.csiCqiTableIndex = in.csiCqiTableIndex; + if (in.csiCqiReport != null) { + out.csiCqiReport = new byte[in.csiCqiReport.size()]; + for (int i = 0; i < in.csiCqiReport.size(); i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it + // doesn't suit your needs. + if (in.csiCqiReport.get(i) > 127 || in.csiCqiReport.get(i) < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.csiCqiReport.get(i)"); + } + out.csiCqiReport[i] = in.csiCqiReport.get(i); + } + } + return out; + } + + static public android.hardware.radio.SignalStrength h2aTranslate( + android.hardware.radio.V1_6.SignalStrength in) { + android.hardware.radio.SignalStrength out = new android.hardware.radio.SignalStrength(); + out.gsm = h2aTranslate(in.gsm); + out.cdma = h2aTranslate(in.cdma); + out.evdo = h2aTranslate(in.evdo); + out.lte = h2aTranslate(in.lte); + out.tdscdma = h2aTranslate(in.tdscdma); + out.wcdma = h2aTranslate(in.wcdma); + out.nr = h2aTranslate(in.nr); + return out; + } + + static public android.hardware.radio.CellInfoLte h2aTranslate( + android.hardware.radio.V1_6.CellInfoLte in) { + android.hardware.radio.CellInfoLte out = new android.hardware.radio.CellInfoLte(); + out.cellIdentityLte = h2aTranslate(in.cellIdentityLte); + out.signalStrengthLte = h2aTranslate(in.signalStrengthLte); + return out; + } + + static public android.hardware.radio.CellInfoNr h2aTranslate( + android.hardware.radio.V1_6.CellInfoNr in) { + android.hardware.radio.CellInfoNr out = new android.hardware.radio.CellInfoNr(); + out.cellIdentityNr = h2aTranslate(in.cellIdentityNr); + out.signalStrengthNr = h2aTranslate(in.signalStrengthNr); + return out; + } + + static public android.hardware.radio.CellInfo h2aTranslate( + android.hardware.radio.V1_6.CellInfo in) { + android.hardware.radio.CellInfo out = new android.hardware.radio.CellInfo(); + out.registered = in.registered; + out.connectionStatus = in.connectionStatus; + out.ratSpecificInfo = h2aTranslate(in.ratSpecificInfo); + return out; + } + + static public android.hardware.radio.CellInfoCellInfoRatSpecificInfo h2aTranslate( + android.hardware.radio.V1_6.CellInfo.CellInfoRatSpecificInfo in) { + android.hardware.radio.CellInfoCellInfoRatSpecificInfo out = + new android.hardware.radio.CellInfoCellInfoRatSpecificInfo(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_6.CellInfo.CellInfoRatSpecificInfo.hidl_discriminator + .gsm: + out.setGsm(h2aTranslate(in.gsm())); + break; + case android.hardware.radio.V1_6.CellInfo.CellInfoRatSpecificInfo.hidl_discriminator + .wcdma: + out.setWcdma(h2aTranslate(in.wcdma())); + break; + case android.hardware.radio.V1_6.CellInfo.CellInfoRatSpecificInfo.hidl_discriminator + .tdscdma: + out.setTdscdma(h2aTranslate(in.tdscdma())); + break; + case android.hardware.radio.V1_6.CellInfo.CellInfoRatSpecificInfo.hidl_discriminator + .lte: + out.setLte(h2aTranslate(in.lte())); + break; + case android.hardware.radio.V1_6.CellInfo.CellInfoRatSpecificInfo.hidl_discriminator.nr: + out.setNr(h2aTranslate(in.nr())); + break; + case android.hardware.radio.V1_6.CellInfo.CellInfoRatSpecificInfo.hidl_discriminator + .cdma: + out.setCdma(h2aTranslate(in.cdma())); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.NetworkScanResult h2aTranslate( + android.hardware.radio.V1_6.NetworkScanResult in) { + android.hardware.radio.NetworkScanResult out = + new android.hardware.radio.NetworkScanResult(); + out.status = in.status; + out.error = in.error; + if (in.networkInfos != null) { + out.networkInfos = new android.hardware.radio.CellInfo[in.networkInfos.size()]; + for (int i = 0; i < in.networkInfos.size(); i++) { + out.networkInfos[i] = h2aTranslate(in.networkInfos.get(i)); + } + } + return out; + } + + static public android.hardware.radio.RegStateResult h2aTranslate( + android.hardware.radio.V1_6.RegStateResult in) { + android.hardware.radio.RegStateResult out = new android.hardware.radio.RegStateResult(); + out.regState = in.regState; + out.rat = in.rat; + out.reasonForDenial = in.reasonForDenial; + out.cellIdentity = h2aTranslate(in.cellIdentity); + out.registeredPlmn = in.registeredPlmn; + out.accessTechnologySpecificInfo = h2aTranslate(in.accessTechnologySpecificInfo); + return out; + } + + static public android.hardware.radio.RegStateResultAccessTechnologySpecificInfo h2aTranslate( + android.hardware.radio.V1_6.RegStateResult.AccessTechnologySpecificInfo in) { + android.hardware.radio.RegStateResultAccessTechnologySpecificInfo out = + new android.hardware.radio.RegStateResultAccessTechnologySpecificInfo(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_6.RegStateResult.AccessTechnologySpecificInfo + .hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_6.RegStateResult.AccessTechnologySpecificInfo + .hidl_discriminator.cdmaInfo: + out.setCdmaInfo(h2aTranslate(in.cdmaInfo())); + break; + case android.hardware.radio.V1_6.RegStateResult.AccessTechnologySpecificInfo + .hidl_discriminator.eutranInfo: + out.setEutranInfo(h2aTranslate(in.eutranInfo())); + break; + case android.hardware.radio.V1_6.RegStateResult.AccessTechnologySpecificInfo + .hidl_discriminator.ngranNrVopsInfo: + out.setNgranNrVopsInfo(h2aTranslate(in.ngranNrVopsInfo())); + break; + case android.hardware.radio.V1_6.RegStateResult.AccessTechnologySpecificInfo + .hidl_discriminator.geranDtmSupported: + out.setGeranDtmSupported(in.geranDtmSupported()); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.Call h2aTranslate(android.hardware.radio.V1_6.Call in) { + android.hardware.radio.Call out = new android.hardware.radio.Call(); + out.state = in.base.base.state; + out.index = in.base.base.index; + out.toa = in.base.base.toa; + out.isMpty = in.base.base.isMpty; + out.isMT = in.base.base.isMT; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.base.base.als > 127 || in.base.base.als < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.base.base.als"); + } + out.als = in.base.base.als; + out.isVoice = in.base.base.isVoice; + out.isVoicePrivacy = in.base.base.isVoicePrivacy; + out.number = in.base.base.number; + out.numberPresentation = in.base.base.numberPresentation; + out.name = in.base.base.name; + out.namePresentation = in.base.base.namePresentation; + if (in.base.base.uusInfo != null) { + out.uusInfo = new android.hardware.radio.UusInfo[in.base.base.uusInfo.size()]; + for (int i = 0; i < in.base.base.uusInfo.size(); i++) { + out.uusInfo[i] = h2aTranslate(in.base.base.uusInfo.get(i)); + } + } + out.audioQuality = in.base.audioQuality; + out.forwardedNumber = in.forwardedNumber; + return out; + } + + static public android.hardware.radio.PhysicalChannelConfig h2aTranslate( + android.hardware.radio.V1_6.PhysicalChannelConfig in) { + android.hardware.radio.PhysicalChannelConfig out = + new android.hardware.radio.PhysicalChannelConfig(); + out.status = in.status; + out.rat = in.rat; + out.downlinkChannelNumber = in.downlinkChannelNumber; + out.uplinkChannelNumber = in.uplinkChannelNumber; + out.cellBandwidthDownlinkKhz = in.cellBandwidthDownlinkKhz; + out.cellBandwidthUplinkKhz = in.cellBandwidthUplinkKhz; + if (in.contextIds != null) { + out.contextIds = new int[in.contextIds.size()]; + for (int i = 0; i < in.contextIds.size(); i++) { + out.contextIds[i] = in.contextIds.get(i); + } + } + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.physicalCellId > 2147483647 || in.physicalCellId < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.physicalCellId"); + } + out.physicalCellId = in.physicalCellId; + out.band = h2aTranslate(in.band); + return out; + } + + static public android.hardware.radio.PhysicalChannelConfigBand h2aTranslate( + android.hardware.radio.V1_6.PhysicalChannelConfig.Band in) { + android.hardware.radio.PhysicalChannelConfigBand out = + new android.hardware.radio.PhysicalChannelConfigBand(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_6.PhysicalChannelConfig.Band.hidl_discriminator + .geranBand: + out.setGeranBand(in.geranBand()); + break; + case android.hardware.radio.V1_6.PhysicalChannelConfig.Band.hidl_discriminator + .utranBand: + out.setUtranBand(in.utranBand()); + break; + case android.hardware.radio.V1_6.PhysicalChannelConfig.Band.hidl_discriminator + .eutranBand: + out.setEutranBand(in.eutranBand()); + break; + case android.hardware.radio.V1_6.PhysicalChannelConfig.Band.hidl_discriminator + .ngranBand: + out.setNgranBand(in.ngranBand()); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.OptionalSliceInfo h2aTranslate( + android.hardware.radio.V1_6.OptionalSliceInfo in) { + android.hardware.radio.OptionalSliceInfo out = + new android.hardware.radio.OptionalSliceInfo(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_6.OptionalSliceInfo.hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_6.OptionalSliceInfo.hidl_discriminator.value: + out.setValue(h2aTranslate(in.value())); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.SliceInfo h2aTranslate( + android.hardware.radio.V1_6.SliceInfo in) { + android.hardware.radio.SliceInfo out = new android.hardware.radio.SliceInfo(); + out.sst = in.sst; + out.sliceDifferentiator = in.sliceDifferentiator; + out.mappedHplmnSst = in.mappedHplmnSst; + out.mappedHplmnSD = in.mappedHplmnSD; + out.status = in.status; + return out; + } + + static public android.hardware.radio.OptionalDnn h2aTranslate( + android.hardware.radio.V1_6.OptionalDnn in) { + android.hardware.radio.OptionalDnn out = new android.hardware.radio.OptionalDnn(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_6.OptionalDnn.hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_6.OptionalDnn.hidl_discriminator.value: + out.setValue(in.value()); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.OptionalOsAppId h2aTranslate( + android.hardware.radio.V1_6.OptionalOsAppId in) { + android.hardware.radio.OptionalOsAppId out = new android.hardware.radio.OptionalOsAppId(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_6.OptionalOsAppId.hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_6.OptionalOsAppId.hidl_discriminator.value: + out.setValue(h2aTranslate(in.value())); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.OptionalTrafficDescriptor h2aTranslate( + android.hardware.radio.V1_6.OptionalTrafficDescriptor in) { + android.hardware.radio.OptionalTrafficDescriptor out = + new android.hardware.radio.OptionalTrafficDescriptor(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_6.OptionalTrafficDescriptor.hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_6.OptionalTrafficDescriptor.hidl_discriminator.value: + out.setValue(h2aTranslate(in.value())); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.TrafficDescriptor h2aTranslate( + android.hardware.radio.V1_6.TrafficDescriptor in) { + android.hardware.radio.TrafficDescriptor out = + new android.hardware.radio.TrafficDescriptor(); + out.dnn = h2aTranslate(in.dnn); + out.osAppId = h2aTranslate(in.osAppId); + return out; + } + + static public android.hardware.radio.OsAppId h2aTranslate( + android.hardware.radio.V1_6.OsAppId in) { + android.hardware.radio.OsAppId out = new android.hardware.radio.OsAppId(); + if (in.osAppId != null) { + out.osAppId = new byte[in.osAppId.size()]; + for (int i = 0; i < in.osAppId.size(); i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it + // doesn't suit your needs. + if (in.osAppId.get(i) > 127 || in.osAppId.get(i) < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.osAppId.get(i)"); + } + out.osAppId[i] = in.osAppId.get(i); + } + } + return out; + } + + static public android.hardware.radio.SlicingConfig h2aTranslate( + android.hardware.radio.V1_6.SlicingConfig in) { + android.hardware.radio.SlicingConfig out = new android.hardware.radio.SlicingConfig(); + if (in.urspRules != null) { + out.urspRules = new android.hardware.radio.UrspRule[in.urspRules.size()]; + for (int i = 0; i < in.urspRules.size(); i++) { + out.urspRules[i] = h2aTranslate(in.urspRules.get(i)); + } + } + if (in.sliceInfo != null) { + out.sliceInfo = new android.hardware.radio.SliceInfo[in.sliceInfo.size()]; + for (int i = 0; i < in.sliceInfo.size(); i++) { + out.sliceInfo[i] = h2aTranslate(in.sliceInfo.get(i)); + } + } + return out; + } + + static public android.hardware.radio.UrspRule h2aTranslate( + android.hardware.radio.V1_6.UrspRule in) { + android.hardware.radio.UrspRule out = new android.hardware.radio.UrspRule(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.precedence > 127 || in.precedence < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.precedence"); + } + out.precedence = in.precedence; + if (in.trafficDescriptors != null) { + out.trafficDescriptors = + new android.hardware.radio.TrafficDescriptor[in.trafficDescriptors.size()]; + for (int i = 0; i < in.trafficDescriptors.size(); i++) { + out.trafficDescriptors[i] = h2aTranslate(in.trafficDescriptors.get(i)); + } + } + if (in.routeSelectionDescriptor != null) { + out.routeSelectionDescriptor = + new android.hardware.radio + .RouteSelectionDescriptor[in.routeSelectionDescriptor.size()]; + for (int i = 0; i < in.routeSelectionDescriptor.size(); i++) { + out.routeSelectionDescriptor[i] = h2aTranslate(in.routeSelectionDescriptor.get(i)); + } + } + return out; + } + + static public android.hardware.radio.RouteSelectionDescriptor h2aTranslate( + android.hardware.radio.V1_6.RouteSelectionDescriptor in) { + android.hardware.radio.RouteSelectionDescriptor out = + new android.hardware.radio.RouteSelectionDescriptor(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.precedence > 127 || in.precedence < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.precedence"); + } + out.precedence = in.precedence; + out.sessionType = h2aTranslate(in.sessionType); + out.sscMode = h2aTranslate(in.sscMode); + if (in.sliceInfo != null) { + out.sliceInfo = new android.hardware.radio.SliceInfo[in.sliceInfo.size()]; + for (int i = 0; i < in.sliceInfo.size(); i++) { + out.sliceInfo[i] = h2aTranslate(in.sliceInfo.get(i)); + } + } + if (in.dnn != null) { + out.dnn = new String[in.dnn.size()]; + for (int i = 0; i < in.dnn.size(); i++) { + out.dnn[i] = in.dnn.get(i); + } + } + return out; + } + + static public android.hardware.radio.OptionalPdpProtocolType h2aTranslate( + android.hardware.radio.V1_6.OptionalPdpProtocolType in) { + android.hardware.radio.OptionalPdpProtocolType out = + new android.hardware.radio.OptionalPdpProtocolType(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_6.OptionalPdpProtocolType.hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_6.OptionalPdpProtocolType.hidl_discriminator.value: + out.setValue(in.value()); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.OptionalSscMode h2aTranslate( + android.hardware.radio.V1_6.OptionalSscMode in) { + android.hardware.radio.OptionalSscMode out = new android.hardware.radio.OptionalSscMode(); + switch (in.getDiscriminator()) { + case android.hardware.radio.V1_6.OptionalSscMode.hidl_discriminator.noinit: + // Nothing to translate for Monostate. + break; + case android.hardware.radio.V1_6.OptionalSscMode.hidl_discriminator.value: + out.setValue(in.value()); + break; + default: + throw new RuntimeException( + "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); + } + return out; + } + + static public android.hardware.radio.ImsiEncryptionInfo h2aTranslate( + android.hardware.radio.V1_6.ImsiEncryptionInfo in) { + android.hardware.radio.ImsiEncryptionInfo out = + new android.hardware.radio.ImsiEncryptionInfo(); + out.mcc = in.base.mcc; + out.mnc = in.base.mnc; + if (in.base.carrierKey != null) { + out.carrierKey = new byte[in.base.carrierKey.size()]; + for (int i = 0; i < in.base.carrierKey.size(); i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it + // doesn't suit your needs. + if (in.base.carrierKey.get(i) > 127 || in.base.carrierKey.get(i) < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.base.carrierKey.get(i)"); + } + out.carrierKey[i] = in.base.carrierKey.get(i); + } + } + out.keyIdentifier = in.base.keyIdentifier; + out.expirationTime = in.base.expirationTime; + out.keyType = in.keyType; + return out; + } + + static public android.hardware.radio.PhonebookRecordInfo h2aTranslate( + android.hardware.radio.V1_6.PhonebookRecordInfo in) { + android.hardware.radio.PhonebookRecordInfo out = + new android.hardware.radio.PhonebookRecordInfo(); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.recordId > 2147483647 || in.recordId < 0) { + throw new RuntimeException( + "Unsafe conversion between signed and unsigned scalars for field: in.recordId"); + } + out.recordId = in.recordId; + out.name = in.name; + out.number = in.number; + if (in.emails != null) { + out.emails = new String[in.emails.size()]; + for (int i = 0; i < in.emails.size(); i++) { + out.emails[i] = in.emails.get(i); + } + } + if (in.additionalNumbers != null) { + out.additionalNumbers = new String[in.additionalNumbers.size()]; + for (int i = 0; i < in.additionalNumbers.size(); i++) { + out.additionalNumbers[i] = in.additionalNumbers.get(i); + } + } + return out; + } + + static public android.hardware.radio.PhonebookCapacity h2aTranslate( + android.hardware.radio.V1_6.PhonebookCapacity in) { + android.hardware.radio.PhonebookCapacity out = + new android.hardware.radio.PhonebookCapacity(); + out.maxAdnRecords = in.maxAdnRecords; + out.usedAdnRecords = in.usedAdnRecords; + out.maxEmailRecords = in.maxEmailRecords; + out.usedEmailRecords = in.usedEmailRecords; + out.maxAdditionalNumberRecords = in.maxAdditionalNumberRecords; + out.usedAdditionalNumberRecords = in.usedAdditionalNumberRecords; + out.maxNameLen = in.maxNameLen; + out.maxNumberLen = in.maxNumberLen; + out.maxEmailLen = in.maxEmailLen; + out.maxAdditionalNumberLen = in.maxAdditionalNumberLen; + return out; + } +} diff --git a/radio/aidl/android/hardware/radio/TtyMode.aidl b/radio/aidl/android/hardware/radio/TtyMode.aidl new file mode 100644 index 0000000000..344ba67734 --- /dev/null +++ b/radio/aidl/android/hardware/radio/TtyMode.aidl @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum TtyMode { + OFF, + FULL, + /** + * Hearing carryover + */ + HCO, + /** + * Voice carryover + */ + VCO, +} diff --git a/radio/aidl/android/hardware/radio/UiccSubActStatus.aidl b/radio/aidl/android/hardware/radio/UiccSubActStatus.aidl new file mode 100644 index 0000000000..b2bb03ecef --- /dev/null +++ b/radio/aidl/android/hardware/radio/UiccSubActStatus.aidl @@ -0,0 +1,24 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum UiccSubActStatus { + DEACTIVATE, + ACTIVATE, +} diff --git a/radio/aidl/android/hardware/radio/UrspRule.aidl b/radio/aidl/android/hardware/radio/UrspRule.aidl new file mode 100644 index 0000000000..244bcb13bc --- /dev/null +++ b/radio/aidl/android/hardware/radio/UrspRule.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.RouteSelectionDescriptor; +import android.hardware.radio.TrafficDescriptor; + +/** + * This struct represents a single URSP rule as defined in 3GPP TS 24.526. + */ +@VintfStability +parcelable UrspRule { + /** + * Precedence value in the range of 0 to 255. Higher value has lower precedence. + */ + byte precedence; + /** + * Used as a matcher for network requests. + */ + TrafficDescriptor[] trafficDescriptors; + /** + * List of routes (connection parameters) that must be used for requests matching a + * trafficDescriptor. + */ + RouteSelectionDescriptor[] routeSelectionDescriptor; +} diff --git a/radio/aidl/android/hardware/radio/UssdModeType.aidl b/radio/aidl/android/hardware/radio/UssdModeType.aidl new file mode 100644 index 0000000000..187130c48c --- /dev/null +++ b/radio/aidl/android/hardware/radio/UssdModeType.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ + +package android.hardware.radio; + +@VintfStability +@Backing(type="int") +enum UssdModeType { + /** + * USSD-Notify + */ + NOTIFY, + /** + * USSD-Request + */ + REQUEST, + /** + * Session terminated by network + */ + NW_RELEASE, + /** + * Other local client (eg, SIM Toolkit) has responded + */ + LOCAL_CLIENT, + /** + * Operation not supported + */ + NOT_SUPPORTED, + /** + * Network timeout + */ + NW_TIMEOUT, +} diff --git a/radio/aidl/android/hardware/radio/UtranBands.aidl b/radio/aidl/android/hardware/radio/UtranBands.aidl new file mode 100644 index 0000000000..8a22ed75b3 --- /dev/null +++ b/radio/aidl/android/hardware/radio/UtranBands.aidl @@ -0,0 +1,54 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * UTRAN bands up to V15.0.0 + */ +@VintfStability +@Backing(type="int") +enum UtranBands { + BAND_1 = 1, + BAND_2 = 2, + BAND_3 = 3, + BAND_4 = 4, + BAND_5 = 5, + BAND_6 = 6, + BAND_7 = 7, + BAND_8 = 8, + BAND_9 = 9, + BAND_10 = 10, + BAND_11 = 11, + BAND_12 = 12, + BAND_13 = 13, + BAND_14 = 14, + BAND_19 = 19, + BAND_20 = 20, + BAND_21 = 21, + BAND_22 = 22, + BAND_25 = 25, + BAND_26 = 26, + /** + * TD-SCDMA bands. 3GPP TS 25.102, Table 5.2: Frequency bands + */ + BAND_A = 101, + BAND_B = 102, + BAND_C = 103, + BAND_D = 104, + BAND_E = 105, + BAND_F = 106, +} diff --git a/radio/aidl/android/hardware/radio/UusDcs.aidl b/radio/aidl/android/hardware/radio/UusDcs.aidl new file mode 100644 index 0000000000..b157e47a7d --- /dev/null +++ b/radio/aidl/android/hardware/radio/UusDcs.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. + */ + +package android.hardware.radio; + +/** + * User-to-User Signaling Information data coding schemes. Possible values for Octet 3 (Protocol + * Discriminator field) in the UUIE. The values have been specified in section 10.5.4.25 of + * 3GPP TS 24.008 + */ +@VintfStability +@Backing(type="int") +enum UusDcs { + /** + * User specified protocol + */ + USP, + /** + * OSI higher layer protocol + */ + OSIHLP, + /** + * X.244 + */ + X244, + /** + * Reserved for system management + */ + RMCF, + /** + * IA5 characters + */ + IA5C, +} diff --git a/radio/aidl/android/hardware/radio/UusInfo.aidl b/radio/aidl/android/hardware/radio/UusInfo.aidl new file mode 100644 index 0000000000..b766b0dc61 --- /dev/null +++ b/radio/aidl/android/hardware/radio/UusInfo.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. + */ + +package android.hardware.radio; + +import android.hardware.radio.UusDcs; +import android.hardware.radio.UusType; + +/** + * User-to-User Signaling Information defined in 3GPP 23.087 v8.0 + */ +@VintfStability +parcelable UusInfo { + /** + * UUS type + */ + UusType uusType; + /** + * UUS data coding scheme + */ + UusDcs uusDcs; + /** + * UUS data + */ + String uusData; +} diff --git a/radio/aidl/android/hardware/radio/UusType.aidl b/radio/aidl/android/hardware/radio/UusType.aidl new file mode 100644 index 0000000000..af86c9780e --- /dev/null +++ b/radio/aidl/android/hardware/radio/UusType.aidl @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0 + */ +@VintfStability +@Backing(type="int") +enum UusType { + TYPE1_IMPLICIT, + TYPE1_REQUIRED, + TYPE1_NOT_REQUIRED, + TYPE2_REQUIRED, + TYPE2_NOT_REQUIRED, + TYPE3_REQUIRED, + TYPE3_NOT_REQUIRED, +} diff --git a/radio/aidl/android/hardware/radio/VoiceRegStateResult.aidl b/radio/aidl/android/hardware/radio/VoiceRegStateResult.aidl new file mode 100644 index 0000000000..897c663621 --- /dev/null +++ b/radio/aidl/android/hardware/radio/VoiceRegStateResult.aidl @@ -0,0 +1,94 @@ +/* + * 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. + */ + +package android.hardware.radio; + +import android.hardware.radio.CellIdentity; +import android.hardware.radio.RegState; + +@VintfStability +parcelable VoiceRegStateResult { + /** + * Valid reg states are NOT_REG_MT_NOT_SEARCHING_OP, REG_HOME, NOT_REG_MT_SEARCHING_OP, + * REG_DENIED, UNKNOWN, REG_ROAMING defined in RegState. + */ + RegState regState; + /** + * Indicates the available voice radio technology, valid values as defined by RadioTechnology. + */ + int rat; + /** + * Concurrent services support indicator, if registered on a CDMA system. + * false - Concurrent services not supported, + * true - Concurrent services supported + */ + boolean cssSupported; + /** + * TSB-58 Roaming Indicator if registered on a CDMA or EVDO system or -1 if not. + * Valid values are 0-255. + */ + int roamingIndicator; + /** + * Indicates whether the current system is in the PRL if registered on a CDMA or EVDO system + * or -1 if not. 0=not in the PRL, 1=in the PRL + */ + int systemIsInPrl; + /** + * Default Roaming Indicator from the PRL if registered on a CDMA or EVDO system or -1 if not. + * Valid values are 0-255. + */ + int defaultRoamingIndicator; + /** + * Reason for denial if registration state is REG_DENIED. This is an enumerated reason why + * registration was denied. See 3GPP TS 24.008, 10.5.3.6 and Annex G. + * 0 - General + * 1 - Authentication Failure + * 2 - IMSI unknown in HLR + * 3 - Illegal MS + * 4 - Illegal ME + * 5 - PLMN not allowed + * 6 - Location area not allowed + * 7 - Roaming not allowed + * 8 - No Suitable Cells in this Location Area + * 9 - Network failure + * 10 - Persistent location update reject + * 11 - PLMN not allowed + * 12 - Location area not allowed + * 13 - Roaming not allowed in this Location Area + * 15 - No Suitable Cells in this Location Area + * 17 - Network Failure + * 20 - MAC Failure + * 21 - Sync Failure + * 22 - Congestion + * 23 - GSM Authentication unacceptable + * 25 - Not Authorized for this CSG + * 32 - Service option not supported + * 33 - Requested service option not subscribed + * 34 - Service option temporarily out of order + * 38 - Call cannot be identified + * 48-63 - Retry upon entry into a new cell + * 95 - Semantically incorrect message + * 96 - Invalid mandatory information + * 97 - Message type non-existent or not implemented + * 98 - Message type not compatible with protocol state + * 99 - Information element non-existent or not implemented + * 100 - Conditional IE error + * 101 - Message not compatible with protocol state + * 111 - Protocol error, unspecified + */ + int reasonForDenial; + CellIdentity cellIdentity; +} diff --git a/radio/aidl/android/hardware/radio/VopsIndicator.aidl b/radio/aidl/android/hardware/radio/VopsIndicator.aidl new file mode 100644 index 0000000000..0533be9393 --- /dev/null +++ b/radio/aidl/android/hardware/radio/VopsIndicator.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.radio; + +/** + * Defines the values for VoPS indicator of NR as per 3gpp spec 24.501 sec 9.10.3.5 + */ +@VintfStability +@Backing(type="byte") +enum VopsIndicator { + /** + * IMS voice over PS session not supported + */ + VOPS_NOT_SUPPORTED, + /** + * IMS voice over PS session supported over 3GPP access + */ + VOPS_OVER_3GPP, + /** + * IMS voice over PS session supported over non-3GPP access + */ + VOPS_OVER_NON_3GPP, +} diff --git a/radio/aidl/android/hardware/radio/WcdmaSignalStrength.aidl b/radio/aidl/android/hardware/radio/WcdmaSignalStrength.aidl new file mode 100644 index 0000000000..95a3455e4c --- /dev/null +++ b/radio/aidl/android/hardware/radio/WcdmaSignalStrength.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. + */ + +package android.hardware.radio; + +@VintfStability +parcelable WcdmaSignalStrength { + /** + * Valid values are (0-31, 99) as defined in TS 27.007 8.5; INT_MAX means unreported. + */ + int signalStrength; + /** + * Bit error rate (0-7, 99) as defined in TS 27.007 8.5; INT_MAX means invalid/unreported. + */ + int bitErrorRate; + /** + * CPICH RSCP as defined in TS 25.215 5.1.1. Valid values are (0-96, 255) as defined in + * TS 27.007 8.69. INT_MAX denotes that the value is invalid/unreported. + */ + int rscp; + /** + * Ec/No value as defined in TS 25.215 5.1.5. Valid values are (0-49, 255) as defined in + * TS 27.007 8.69. INT_MAX denotes that the value is invalid/unreported. + */ + int ecno; +} diff --git a/radio/aidl/android/hardware/radio/translate-ndk.cpp b/radio/aidl/android/hardware/radio/translate-ndk.cpp new file mode 100644 index 0000000000..0492aded9d --- /dev/null +++ b/radio/aidl/android/hardware/radio/translate-ndk.cpp @@ -0,0 +1,7404 @@ +/* + * 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/hardware/radio/translate-ndk.h" + +namespace android::h2a { + +static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::ADDRESS_MAX == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::ADDRESS_MAX)); +static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::SUBADDRESS_MAX == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::SUBADDRESS_MAX)); +static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::BEARER_DATA_MAX == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::BEARER_DATA_MAX)); +static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_MAX_SND_SIZE == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_MAX_SND_SIZE)); +static_assert( + aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_EO_DATA_SEGMENT_MAX == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_EO_DATA_SEGMENT_MAX)); +static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::MAX_UD_HEADERS == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::MAX_UD_HEADERS)); +static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::USER_DATA_MAX == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::USER_DATA_MAX)); +static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_LARGE_PIC_SIZE == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_LARGE_PIC_SIZE)); +static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_SMALL_PIC_SIZE == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_SMALL_PIC_SIZE)); +static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_VAR_PIC_SIZE == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_VAR_PIC_SIZE)); +static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_ANIM_NUM_BITMAPS == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_ANIM_NUM_BITMAPS)); +static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_LARGE_BITMAP_SIZE == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_LARGE_BITMAP_SIZE)); +static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_SMALL_BITMAP_SIZE == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_SMALL_BITMAP_SIZE)); +static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_OTHER_SIZE == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_OTHER_SIZE)); +static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::IP_ADDRESS_SIZE == + static_cast( + ::android::hardware::radio::V1_0::RadioCdmaSmsConst::IP_ADDRESS_SIZE)); + +static_assert(aidl::android::hardware::radio::RadioResponseType::SOLICITED == + static_cast( + ::android::hardware::radio::V1_0::RadioResponseType::SOLICITED)); +static_assert(aidl::android::hardware::radio::RadioResponseType::SOLICITED_ACK == + static_cast( + ::android::hardware::radio::V1_0::RadioResponseType::SOLICITED_ACK)); +static_assert(aidl::android::hardware::radio::RadioResponseType::SOLICITED_ACK_EXP == + static_cast( + ::android::hardware::radio::V1_0::RadioResponseType::SOLICITED_ACK_EXP)); + +static_assert(aidl::android::hardware::radio::RadioIndicationType::UNSOLICITED == + static_cast( + ::android::hardware::radio::V1_0::RadioIndicationType::UNSOLICITED)); +static_assert(aidl::android::hardware::radio::RadioIndicationType::UNSOLICITED_ACK_EXP == + static_cast( + ::android::hardware::radio::V1_0::RadioIndicationType::UNSOLICITED_ACK_EXP)); + +static_assert(aidl::android::hardware::radio::RestrictedState::NONE == + static_cast( + ::android::hardware::radio::V1_0::RestrictedState::NONE)); +static_assert(aidl::android::hardware::radio::RestrictedState::CS_EMERGENCY == + static_cast( + ::android::hardware::radio::V1_0::RestrictedState::CS_EMERGENCY)); +static_assert(aidl::android::hardware::radio::RestrictedState::CS_NORMAL == + static_cast( + ::android::hardware::radio::V1_0::RestrictedState::CS_NORMAL)); +static_assert(aidl::android::hardware::radio::RestrictedState::CS_ALL == + static_cast( + ::android::hardware::radio::V1_0::RestrictedState::CS_ALL)); +static_assert(aidl::android::hardware::radio::RestrictedState::PS_ALL == + static_cast( + ::android::hardware::radio::V1_0::RestrictedState::PS_ALL)); + +static_assert(aidl::android::hardware::radio::CardState::ABSENT == + static_cast( + ::android::hardware::radio::V1_0::CardState::ABSENT)); +static_assert(aidl::android::hardware::radio::CardState::PRESENT == + static_cast( + ::android::hardware::radio::V1_0::CardState::PRESENT)); +static_assert(aidl::android::hardware::radio::CardState::ERROR == + static_cast( + ::android::hardware::radio::V1_0::CardState::ERROR)); +static_assert(aidl::android::hardware::radio::CardState::RESTRICTED == + static_cast( + ::android::hardware::radio::V1_0::CardState::RESTRICTED)); + +static_assert(aidl::android::hardware::radio::PinState::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_0::PinState::UNKNOWN)); +static_assert(aidl::android::hardware::radio::PinState::ENABLED_NOT_VERIFIED == + static_cast( + ::android::hardware::radio::V1_0::PinState::ENABLED_NOT_VERIFIED)); +static_assert(aidl::android::hardware::radio::PinState::ENABLED_VERIFIED == + static_cast( + ::android::hardware::radio::V1_0::PinState::ENABLED_VERIFIED)); +static_assert(aidl::android::hardware::radio::PinState::DISABLED == + static_cast( + ::android::hardware::radio::V1_0::PinState::DISABLED)); +static_assert(aidl::android::hardware::radio::PinState::ENABLED_BLOCKED == + static_cast( + ::android::hardware::radio::V1_0::PinState::ENABLED_BLOCKED)); +static_assert(aidl::android::hardware::radio::PinState::ENABLED_PERM_BLOCKED == + static_cast( + ::android::hardware::radio::V1_0::PinState::ENABLED_PERM_BLOCKED)); + +static_assert(aidl::android::hardware::radio::AppType::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_0::AppType::UNKNOWN)); +static_assert(aidl::android::hardware::radio::AppType::SIM == + static_cast( + ::android::hardware::radio::V1_0::AppType::SIM)); +static_assert(aidl::android::hardware::radio::AppType::USIM == + static_cast( + ::android::hardware::radio::V1_0::AppType::USIM)); +static_assert(aidl::android::hardware::radio::AppType::RUIM == + static_cast( + ::android::hardware::radio::V1_0::AppType::RUIM)); +static_assert(aidl::android::hardware::radio::AppType::CSIM == + static_cast( + ::android::hardware::radio::V1_0::AppType::CSIM)); +static_assert(aidl::android::hardware::radio::AppType::ISIM == + static_cast( + ::android::hardware::radio::V1_0::AppType::ISIM)); + +static_assert(aidl::android::hardware::radio::AppState::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_0::AppState::UNKNOWN)); +static_assert(aidl::android::hardware::radio::AppState::DETECTED == + static_cast( + ::android::hardware::radio::V1_0::AppState::DETECTED)); +static_assert(aidl::android::hardware::radio::AppState::PIN == + static_cast( + ::android::hardware::radio::V1_0::AppState::PIN)); +static_assert(aidl::android::hardware::radio::AppState::PUK == + static_cast( + ::android::hardware::radio::V1_0::AppState::PUK)); +static_assert(aidl::android::hardware::radio::AppState::SUBSCRIPTION_PERSO == + static_cast( + ::android::hardware::radio::V1_0::AppState::SUBSCRIPTION_PERSO)); +static_assert(aidl::android::hardware::radio::AppState::READY == + static_cast( + ::android::hardware::radio::V1_0::AppState::READY)); + +static_assert(aidl::android::hardware::radio::RadioState::OFF == + static_cast( + ::android::hardware::radio::V1_0::RadioState::OFF)); +static_assert(aidl::android::hardware::radio::RadioState::UNAVAILABLE == + static_cast( + ::android::hardware::radio::V1_0::RadioState::UNAVAILABLE)); +static_assert(aidl::android::hardware::radio::RadioState::ON == + static_cast( + ::android::hardware::radio::V1_0::RadioState::ON)); + +static_assert(aidl::android::hardware::radio::SapConnectRsp::SUCCESS == + static_cast( + ::android::hardware::radio::V1_0::SapConnectRsp::SUCCESS)); +static_assert(aidl::android::hardware::radio::SapConnectRsp::CONNECT_FAILURE == + static_cast( + ::android::hardware::radio::V1_0::SapConnectRsp::CONNECT_FAILURE)); +static_assert(aidl::android::hardware::radio::SapConnectRsp::MSG_SIZE_TOO_LARGE == + static_cast( + ::android::hardware::radio::V1_0::SapConnectRsp::MSG_SIZE_TOO_LARGE)); +static_assert(aidl::android::hardware::radio::SapConnectRsp::MSG_SIZE_TOO_SMALL == + static_cast( + ::android::hardware::radio::V1_0::SapConnectRsp::MSG_SIZE_TOO_SMALL)); +static_assert(aidl::android::hardware::radio::SapConnectRsp::CONNECT_OK_CALL_ONGOING == + static_cast( + ::android::hardware::radio::V1_0::SapConnectRsp::CONNECT_OK_CALL_ONGOING)); + +static_assert(aidl::android::hardware::radio::SapDisconnectType::GRACEFUL == + static_cast( + ::android::hardware::radio::V1_0::SapDisconnectType::GRACEFUL)); +static_assert(aidl::android::hardware::radio::SapDisconnectType::IMMEDIATE == + static_cast( + ::android::hardware::radio::V1_0::SapDisconnectType::IMMEDIATE)); + +static_assert(aidl::android::hardware::radio::SapApduType::APDU == + static_cast( + ::android::hardware::radio::V1_0::SapApduType::APDU)); +static_assert(aidl::android::hardware::radio::SapApduType::APDU7816 == + static_cast( + ::android::hardware::radio::V1_0::SapApduType::APDU7816)); + +static_assert(aidl::android::hardware::radio::SapResultCode::SUCCESS == + static_cast( + ::android::hardware::radio::V1_0::SapResultCode::SUCCESS)); +static_assert(aidl::android::hardware::radio::SapResultCode::GENERIC_FAILURE == + static_cast( + ::android::hardware::radio::V1_0::SapResultCode::GENERIC_FAILURE)); +static_assert(aidl::android::hardware::radio::SapResultCode::CARD_NOT_ACCESSSIBLE == + static_cast( + ::android::hardware::radio::V1_0::SapResultCode::CARD_NOT_ACCESSSIBLE)); +static_assert(aidl::android::hardware::radio::SapResultCode::CARD_ALREADY_POWERED_OFF == + static_cast( + ::android::hardware::radio::V1_0::SapResultCode::CARD_ALREADY_POWERED_OFF)); +static_assert(aidl::android::hardware::radio::SapResultCode::CARD_REMOVED == + static_cast( + ::android::hardware::radio::V1_0::SapResultCode::CARD_REMOVED)); +static_assert(aidl::android::hardware::radio::SapResultCode::CARD_ALREADY_POWERED_ON == + static_cast( + ::android::hardware::radio::V1_0::SapResultCode::CARD_ALREADY_POWERED_ON)); +static_assert(aidl::android::hardware::radio::SapResultCode::DATA_NOT_AVAILABLE == + static_cast( + ::android::hardware::radio::V1_0::SapResultCode::DATA_NOT_AVAILABLE)); +static_assert(aidl::android::hardware::radio::SapResultCode::NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_0::SapResultCode::NOT_SUPPORTED)); + +static_assert(aidl::android::hardware::radio::SapStatus::UNKNOWN_ERROR == + static_cast( + ::android::hardware::radio::V1_0::SapStatus::UNKNOWN_ERROR)); +static_assert(aidl::android::hardware::radio::SapStatus::CARD_RESET == + static_cast( + ::android::hardware::radio::V1_0::SapStatus::CARD_RESET)); +static_assert(aidl::android::hardware::radio::SapStatus::CARD_NOT_ACCESSIBLE == + static_cast( + ::android::hardware::radio::V1_0::SapStatus::CARD_NOT_ACCESSIBLE)); +static_assert(aidl::android::hardware::radio::SapStatus::CARD_REMOVED == + static_cast( + ::android::hardware::radio::V1_0::SapStatus::CARD_REMOVED)); +static_assert(aidl::android::hardware::radio::SapStatus::CARD_INSERTED == + static_cast( + ::android::hardware::radio::V1_0::SapStatus::CARD_INSERTED)); +static_assert(aidl::android::hardware::radio::SapStatus::RECOVERED == + static_cast( + ::android::hardware::radio::V1_0::SapStatus::RECOVERED)); + +static_assert(aidl::android::hardware::radio::SapTransferProtocol::T0 == + static_cast( + ::android::hardware::radio::V1_0::SapTransferProtocol::T0)); +static_assert(aidl::android::hardware::radio::SapTransferProtocol::T1 == + static_cast( + ::android::hardware::radio::V1_0::SapTransferProtocol::T1)); + +static_assert(aidl::android::hardware::radio::CallState::ACTIVE == + static_cast( + ::android::hardware::radio::V1_0::CallState::ACTIVE)); +static_assert(aidl::android::hardware::radio::CallState::HOLDING == + static_cast( + ::android::hardware::radio::V1_0::CallState::HOLDING)); +static_assert(aidl::android::hardware::radio::CallState::DIALING == + static_cast( + ::android::hardware::radio::V1_0::CallState::DIALING)); +static_assert(aidl::android::hardware::radio::CallState::ALERTING == + static_cast( + ::android::hardware::radio::V1_0::CallState::ALERTING)); +static_assert(aidl::android::hardware::radio::CallState::INCOMING == + static_cast( + ::android::hardware::radio::V1_0::CallState::INCOMING)); +static_assert(aidl::android::hardware::radio::CallState::WAITING == + static_cast( + ::android::hardware::radio::V1_0::CallState::WAITING)); + +static_assert(aidl::android::hardware::radio::UusType::TYPE1_IMPLICIT == + static_cast( + ::android::hardware::radio::V1_0::UusType::TYPE1_IMPLICIT)); +static_assert(aidl::android::hardware::radio::UusType::TYPE1_REQUIRED == + static_cast( + ::android::hardware::radio::V1_0::UusType::TYPE1_REQUIRED)); +static_assert(aidl::android::hardware::radio::UusType::TYPE1_NOT_REQUIRED == + static_cast( + ::android::hardware::radio::V1_0::UusType::TYPE1_NOT_REQUIRED)); +static_assert(aidl::android::hardware::radio::UusType::TYPE2_REQUIRED == + static_cast( + ::android::hardware::radio::V1_0::UusType::TYPE2_REQUIRED)); +static_assert(aidl::android::hardware::radio::UusType::TYPE2_NOT_REQUIRED == + static_cast( + ::android::hardware::radio::V1_0::UusType::TYPE2_NOT_REQUIRED)); +static_assert(aidl::android::hardware::radio::UusType::TYPE3_REQUIRED == + static_cast( + ::android::hardware::radio::V1_0::UusType::TYPE3_REQUIRED)); +static_assert(aidl::android::hardware::radio::UusType::TYPE3_NOT_REQUIRED == + static_cast( + ::android::hardware::radio::V1_0::UusType::TYPE3_NOT_REQUIRED)); + +static_assert(aidl::android::hardware::radio::UusDcs::USP == + static_cast( + ::android::hardware::radio::V1_0::UusDcs::USP)); +static_assert(aidl::android::hardware::radio::UusDcs::OSIHLP == + static_cast( + ::android::hardware::radio::V1_0::UusDcs::OSIHLP)); +static_assert(aidl::android::hardware::radio::UusDcs::X244 == + static_cast( + ::android::hardware::radio::V1_0::UusDcs::X244)); +static_assert(aidl::android::hardware::radio::UusDcs::RMCF == + static_cast( + ::android::hardware::radio::V1_0::UusDcs::RMCF)); +static_assert(aidl::android::hardware::radio::UusDcs::IA5C == + static_cast( + ::android::hardware::radio::V1_0::UusDcs::IA5C)); + +static_assert(aidl::android::hardware::radio::CallPresentation::ALLOWED == + static_cast( + ::android::hardware::radio::V1_0::CallPresentation::ALLOWED)); +static_assert(aidl::android::hardware::radio::CallPresentation::RESTRICTED == + static_cast( + ::android::hardware::radio::V1_0::CallPresentation::RESTRICTED)); +static_assert(aidl::android::hardware::radio::CallPresentation::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_0::CallPresentation::UNKNOWN)); +static_assert(aidl::android::hardware::radio::CallPresentation::PAYPHONE == + static_cast( + ::android::hardware::radio::V1_0::CallPresentation::PAYPHONE)); + +static_assert(aidl::android::hardware::radio::Clir::DEFAULT == + static_cast( + ::android::hardware::radio::V1_0::Clir::DEFAULT)); +static_assert(aidl::android::hardware::radio::Clir::INVOCATION == + static_cast( + ::android::hardware::radio::V1_0::Clir::INVOCATION)); +static_assert(aidl::android::hardware::radio::Clir::SUPPRESSION == + static_cast( + ::android::hardware::radio::V1_0::Clir::SUPPRESSION)); + +static_assert(aidl::android::hardware::radio::LastCallFailCause::UNOBTAINABLE_NUMBER == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::UNOBTAINABLE_NUMBER)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::NO_ROUTE_TO_DESTINATION == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::NO_ROUTE_TO_DESTINATION)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CHANNEL_UNACCEPTABLE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::CHANNEL_UNACCEPTABLE)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::OPERATOR_DETERMINED_BARRING == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OPERATOR_DETERMINED_BARRING)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::NORMAL == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::NORMAL)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::BUSY == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::BUSY)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::NO_USER_RESPONDING == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::NO_USER_RESPONDING)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::NO_ANSWER_FROM_USER == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::NO_ANSWER_FROM_USER)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CALL_REJECTED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::CALL_REJECTED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::NUMBER_CHANGED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::NUMBER_CHANGED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::PREEMPTION == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::PREEMPTION)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::DESTINATION_OUT_OF_ORDER == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::DESTINATION_OUT_OF_ORDER)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::INVALID_NUMBER_FORMAT == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::INVALID_NUMBER_FORMAT)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::FACILITY_REJECTED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::FACILITY_REJECTED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::RESP_TO_STATUS_ENQUIRY == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::RESP_TO_STATUS_ENQUIRY)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::NORMAL_UNSPECIFIED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::NORMAL_UNSPECIFIED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CONGESTION == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::CONGESTION)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::NETWORK_OUT_OF_ORDER == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::NETWORK_OUT_OF_ORDER)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::TEMPORARY_FAILURE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::TEMPORARY_FAILURE)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::SWITCHING_EQUIPMENT_CONGESTION == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + SWITCHING_EQUIPMENT_CONGESTION)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::ACCESS_INFORMATION_DISCARDED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::ACCESS_INFORMATION_DISCARDED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause:: + REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::RESOURCES_UNAVAILABLE_OR_UNSPECIFIED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + RESOURCES_UNAVAILABLE_OR_UNSPECIFIED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::QOS_UNAVAILABLE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::QOS_UNAVAILABLE)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::REQUESTED_FACILITY_NOT_SUBSCRIBED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + REQUESTED_FACILITY_NOT_SUBSCRIBED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::INCOMING_CALLS_BARRED_WITHIN_CUG == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + INCOMING_CALLS_BARRED_WITHIN_CUG)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::BEARER_CAPABILITY_NOT_AUTHORIZED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + BEARER_CAPABILITY_NOT_AUTHORIZED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::BEARER_CAPABILITY_UNAVAILABLE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + BEARER_CAPABILITY_UNAVAILABLE)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::SERVICE_OPTION_NOT_AVAILABLE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::SERVICE_OPTION_NOT_AVAILABLE)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::BEARER_SERVICE_NOT_IMPLEMENTED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + BEARER_SERVICE_NOT_IMPLEMENTED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::ACM_LIMIT_EXCEEDED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::ACM_LIMIT_EXCEEDED)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::REQUESTED_FACILITY_NOT_IMPLEMENTED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + REQUESTED_FACILITY_NOT_IMPLEMENTED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause:: + ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::SERVICE_OR_OPTION_NOT_IMPLEMENTED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + SERVICE_OR_OPTION_NOT_IMPLEMENTED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::INVALID_TRANSACTION_IDENTIFIER == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + INVALID_TRANSACTION_IDENTIFIER)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::USER_NOT_MEMBER_OF_CUG == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::USER_NOT_MEMBER_OF_CUG)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::INCOMPATIBLE_DESTINATION == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::INCOMPATIBLE_DESTINATION)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::INVALID_TRANSIT_NW_SELECTION == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::INVALID_TRANSIT_NW_SELECTION)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::SEMANTICALLY_INCORRECT_MESSAGE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + SEMANTICALLY_INCORRECT_MESSAGE)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::INVALID_MANDATORY_INFORMATION == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + INVALID_MANDATORY_INFORMATION)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::MESSAGE_TYPE_NON_IMPLEMENTED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::MESSAGE_TYPE_NON_IMPLEMENTED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause:: + MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::INFORMATION_ELEMENT_NON_EXISTENT == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + INFORMATION_ELEMENT_NON_EXISTENT)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CONDITIONAL_IE_ERROR == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::CONDITIONAL_IE_ERROR)); +static_assert(aidl::android::hardware::radio::LastCallFailCause:: + MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::RECOVERY_ON_TIMER_EXPIRED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::RECOVERY_ON_TIMER_EXPIRED)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::PROTOCOL_ERROR_UNSPECIFIED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::PROTOCOL_ERROR_UNSPECIFIED)); +static_assert( + aidl::android::hardware::radio::LastCallFailCause::INTERWORKING_UNSPECIFIED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::INTERWORKING_UNSPECIFIED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CALL_BARRED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::CALL_BARRED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::FDN_BLOCKED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::FDN_BLOCKED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::IMSI_UNKNOWN_IN_VLR == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::IMSI_UNKNOWN_IN_VLR)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::IMEI_NOT_ACCEPTED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::IMEI_NOT_ACCEPTED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::DIAL_MODIFIED_TO_USSD == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::DIAL_MODIFIED_TO_USSD)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::DIAL_MODIFIED_TO_SS == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::DIAL_MODIFIED_TO_SS)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::DIAL_MODIFIED_TO_DIAL == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::DIAL_MODIFIED_TO_DIAL)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_OFF == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_OFF)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OUT_OF_SERVICE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OUT_OF_SERVICE)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::NO_VALID_SIM == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::NO_VALID_SIM)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_INTERNAL_ERROR == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_INTERNAL_ERROR)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::NETWORK_RESP_TIMEOUT == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::NETWORK_RESP_TIMEOUT)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::NETWORK_REJECT == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::NETWORK_REJECT)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_ACCESS_FAILURE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_ACCESS_FAILURE)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_LINK_FAILURE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_LINK_FAILURE)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_LINK_LOST == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_LINK_LOST)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_UPLINK_FAILURE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_UPLINK_FAILURE)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_SETUP_FAILURE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_SETUP_FAILURE)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_RELEASE_NORMAL == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_RELEASE_NORMAL)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_RELEASE_ABNORMAL == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_RELEASE_ABNORMAL)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::ACCESS_CLASS_BLOCKED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::ACCESS_CLASS_BLOCKED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::NETWORK_DETACH == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::NETWORK_DETACH)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_LOCKED_UNTIL_POWER_CYCLE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause:: + CDMA_LOCKED_UNTIL_POWER_CYCLE)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_DROP == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_DROP)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_INTERCEPT == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_INTERCEPT)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_REORDER == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_REORDER)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_SO_REJECT == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_SO_REJECT)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_RETRY_ORDER == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_RETRY_ORDER)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_ACCESS_FAILURE == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_ACCESS_FAILURE)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_PREEMPTED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_PREEMPTED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_NOT_EMERGENCY == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_NOT_EMERGENCY)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_ACCESS_BLOCKED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_ACCESS_BLOCKED)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_1 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_1)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_2 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_2)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_3 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_3)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_4 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_4)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_5 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_5)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_6 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_6)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_7 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_7)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_8 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_8)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_9 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_9)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_10 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_10)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_11 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_11)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_12 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_12)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_13 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_13)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_14 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_14)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_15 == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_15)); +static_assert(aidl::android::hardware::radio::LastCallFailCause::ERROR_UNSPECIFIED == + static_cast( + ::android::hardware::radio::V1_0::LastCallFailCause::ERROR_UNSPECIFIED)); + +static_assert(aidl::android::hardware::radio::HardwareConfigType::MODEM == + static_cast( + ::android::hardware::radio::V1_0::HardwareConfigType::MODEM)); +static_assert(aidl::android::hardware::radio::HardwareConfigType::SIM == + static_cast( + ::android::hardware::radio::V1_0::HardwareConfigType::SIM)); + +static_assert(aidl::android::hardware::radio::RegState::NOT_REG_MT_NOT_SEARCHING_OP == + static_cast( + ::android::hardware::radio::V1_0::RegState::NOT_REG_MT_NOT_SEARCHING_OP)); +static_assert(aidl::android::hardware::radio::RegState::REG_HOME == + static_cast( + ::android::hardware::radio::V1_0::RegState::REG_HOME)); +static_assert(aidl::android::hardware::radio::RegState::NOT_REG_MT_SEARCHING_OP == + static_cast( + ::android::hardware::radio::V1_0::RegState::NOT_REG_MT_SEARCHING_OP)); +static_assert(aidl::android::hardware::radio::RegState::REG_DENIED == + static_cast( + ::android::hardware::radio::V1_0::RegState::REG_DENIED)); +static_assert(aidl::android::hardware::radio::RegState::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_0::RegState::UNKNOWN)); +static_assert(aidl::android::hardware::radio::RegState::REG_ROAMING == + static_cast( + ::android::hardware::radio::V1_0::RegState::REG_ROAMING)); +static_assert(aidl::android::hardware::radio::RegState::NOT_REG_MT_NOT_SEARCHING_OP_EM == + static_cast( + ::android::hardware::radio::V1_0::RegState::NOT_REG_MT_NOT_SEARCHING_OP_EM)); +static_assert(aidl::android::hardware::radio::RegState::NOT_REG_MT_SEARCHING_OP_EM == + static_cast( + ::android::hardware::radio::V1_0::RegState::NOT_REG_MT_SEARCHING_OP_EM)); +static_assert(aidl::android::hardware::radio::RegState::REG_DENIED_EM == + static_cast( + ::android::hardware::radio::V1_0::RegState::REG_DENIED_EM)); +static_assert(aidl::android::hardware::radio::RegState::UNKNOWN_EM == + static_cast( + ::android::hardware::radio::V1_0::RegState::UNKNOWN_EM)); + +static_assert(aidl::android::hardware::radio::DataProfileId::DEFAULT == + static_cast( + ::android::hardware::radio::V1_0::DataProfileId::DEFAULT)); +static_assert(aidl::android::hardware::radio::DataProfileId::TETHERED == + static_cast( + ::android::hardware::radio::V1_0::DataProfileId::TETHERED)); +static_assert(aidl::android::hardware::radio::DataProfileId::IMS == + static_cast( + ::android::hardware::radio::V1_0::DataProfileId::IMS)); +static_assert(aidl::android::hardware::radio::DataProfileId::FOTA == + static_cast( + ::android::hardware::radio::V1_0::DataProfileId::FOTA)); +static_assert(aidl::android::hardware::radio::DataProfileId::CBS == + static_cast( + ::android::hardware::radio::V1_0::DataProfileId::CBS)); +static_assert(aidl::android::hardware::radio::DataProfileId::OEM_BASE == + static_cast( + ::android::hardware::radio::V1_0::DataProfileId::OEM_BASE)); +static_assert(aidl::android::hardware::radio::DataProfileId::INVALID == + static_cast( + ::android::hardware::radio::V1_0::DataProfileId::INVALID)); + +static_assert(aidl::android::hardware::radio::SmsAcknowledgeFailCause::MEMORY_CAPACITY_EXCEEDED == + static_cast( + ::android::hardware::radio::V1_0::SmsAcknowledgeFailCause:: + MEMORY_CAPACITY_EXCEEDED)); +static_assert( + aidl::android::hardware::radio::SmsAcknowledgeFailCause::UNSPECIFIED_ERROR == + static_cast( + ::android::hardware::radio::V1_0::SmsAcknowledgeFailCause::UNSPECIFIED_ERROR)); + +static_assert(aidl::android::hardware::radio::CallForwardInfoStatus::DISABLE == + static_cast( + ::android::hardware::radio::V1_0::CallForwardInfoStatus::DISABLE)); +static_assert(aidl::android::hardware::radio::CallForwardInfoStatus::ENABLE == + static_cast( + ::android::hardware::radio::V1_0::CallForwardInfoStatus::ENABLE)); +static_assert(aidl::android::hardware::radio::CallForwardInfoStatus::INTERROGATE == + static_cast( + ::android::hardware::radio::V1_0::CallForwardInfoStatus::INTERROGATE)); +static_assert(aidl::android::hardware::radio::CallForwardInfoStatus::REGISTRATION == + static_cast( + ::android::hardware::radio::V1_0::CallForwardInfoStatus::REGISTRATION)); +static_assert(aidl::android::hardware::radio::CallForwardInfoStatus::ERASURE == + static_cast( + ::android::hardware::radio::V1_0::CallForwardInfoStatus::ERASURE)); + +static_assert(aidl::android::hardware::radio::ClipStatus::CLIP_PROVISIONED == + static_cast( + ::android::hardware::radio::V1_0::ClipStatus::CLIP_PROVISIONED)); +static_assert(aidl::android::hardware::radio::ClipStatus::CLIP_UNPROVISIONED == + static_cast( + ::android::hardware::radio::V1_0::ClipStatus::CLIP_UNPROVISIONED)); +static_assert(aidl::android::hardware::radio::ClipStatus::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_0::ClipStatus::UNKNOWN)); + +static_assert(aidl::android::hardware::radio::SmsWriteArgsStatus::REC_UNREAD == + static_cast( + ::android::hardware::radio::V1_0::SmsWriteArgsStatus::REC_UNREAD)); +static_assert(aidl::android::hardware::radio::SmsWriteArgsStatus::REC_READ == + static_cast( + ::android::hardware::radio::V1_0::SmsWriteArgsStatus::REC_READ)); +static_assert(aidl::android::hardware::radio::SmsWriteArgsStatus::STO_UNSENT == + static_cast( + ::android::hardware::radio::V1_0::SmsWriteArgsStatus::STO_UNSENT)); +static_assert(aidl::android::hardware::radio::SmsWriteArgsStatus::STO_SENT == + static_cast( + ::android::hardware::radio::V1_0::SmsWriteArgsStatus::STO_SENT)); + +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_UNSPECIFIED == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_UNSPECIFIED)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_EURO == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_EURO)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_USA == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_USA)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_JPN == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_JPN)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_AUS == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_AUS)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_AUS_2 == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_AUS_2)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_CELL_800 == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_CELL_800)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_PCS == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_PCS)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_JTACS == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_JTACS)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_KOREA_PCS == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_KOREA_PCS)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_5_450M == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_5_450M)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_IMT2000 == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_IMT2000)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_7_700M_2 == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_7_700M_2)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_8_1800M == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_8_1800M)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_9_900M == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_9_900M)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_10_800M_2 == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_10_800M_2)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_EURO_PAMR_400M == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_EURO_PAMR_400M)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_AWS == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_AWS)); +static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_USA_2500M == + static_cast( + ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_USA_2500M)); + +static_assert(aidl::android::hardware::radio::OperatorStatus::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_0::OperatorStatus::UNKNOWN)); +static_assert(aidl::android::hardware::radio::OperatorStatus::AVAILABLE == + static_cast( + ::android::hardware::radio::V1_0::OperatorStatus::AVAILABLE)); +static_assert(aidl::android::hardware::radio::OperatorStatus::CURRENT == + static_cast( + ::android::hardware::radio::V1_0::OperatorStatus::CURRENT)); +static_assert(aidl::android::hardware::radio::OperatorStatus::FORBIDDEN == + static_cast( + ::android::hardware::radio::V1_0::OperatorStatus::FORBIDDEN)); + +static_assert(aidl::android::hardware::radio::PreferredNetworkType::GSM_WCDMA == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::GSM_WCDMA)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::GSM_ONLY == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::GSM_ONLY)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::WCDMA == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::WCDMA)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::GSM_WCDMA_AUTO == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::GSM_WCDMA_AUTO)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::CDMA_EVDO_AUTO == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::CDMA_EVDO_AUTO)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::CDMA_ONLY == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::CDMA_ONLY)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::EVDO_ONLY == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::EVDO_ONLY)); +static_assert( + aidl::android::hardware::radio::PreferredNetworkType::GSM_WCDMA_CDMA_EVDO_AUTO == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::GSM_WCDMA_CDMA_EVDO_AUTO)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::LTE_CDMA_EVDO == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::LTE_CDMA_EVDO)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::LTE_GSM_WCDMA == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::LTE_GSM_WCDMA)); +static_assert( + aidl::android::hardware::radio::PreferredNetworkType::LTE_CMDA_EVDO_GSM_WCDMA == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::LTE_CMDA_EVDO_GSM_WCDMA)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::LTE_ONLY == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::LTE_ONLY)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::LTE_WCDMA == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::LTE_WCDMA)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_ONLY == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_ONLY)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_WCDMA == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_WCDMA)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_LTE == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_LTE)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_GSM == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_GSM)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_GSM_LTE == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_GSM_LTE)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_GSM_WCDMA == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_GSM_WCDMA)); +static_assert(aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_WCDMA_LTE == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_WCDMA_LTE)); +static_assert( + aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_GSM_WCDMA_LTE == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_GSM_WCDMA_LTE)); +static_assert( + aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType:: + TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO)); +static_assert( + aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA == + static_cast( + ::android::hardware::radio::V1_0::PreferredNetworkType:: + TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA)); + +static_assert(aidl::android::hardware::radio::CdmaSubscriptionSource::RUIM_SIM == + static_cast( + ::android::hardware::radio::V1_0::CdmaSubscriptionSource::RUIM_SIM)); +static_assert(aidl::android::hardware::radio::CdmaSubscriptionSource::NV == + static_cast( + ::android::hardware::radio::V1_0::CdmaSubscriptionSource::NV)); + +static_assert(aidl::android::hardware::radio::CdmaRoamingType::HOME_NETWORK == + static_cast( + ::android::hardware::radio::V1_0::CdmaRoamingType::HOME_NETWORK)); +static_assert(aidl::android::hardware::radio::CdmaRoamingType::AFFILIATED_ROAM == + static_cast( + ::android::hardware::radio::V1_0::CdmaRoamingType::AFFILIATED_ROAM)); +static_assert(aidl::android::hardware::radio::CdmaRoamingType::ANY_ROAM == + static_cast( + ::android::hardware::radio::V1_0::CdmaRoamingType::ANY_ROAM)); + +static_assert(aidl::android::hardware::radio::TtyMode::OFF == + static_cast( + ::android::hardware::radio::V1_0::TtyMode::OFF)); +static_assert(aidl::android::hardware::radio::TtyMode::FULL == + static_cast( + ::android::hardware::radio::V1_0::TtyMode::FULL)); +static_assert(aidl::android::hardware::radio::TtyMode::HCO == + static_cast( + ::android::hardware::radio::V1_0::TtyMode::HCO)); +static_assert(aidl::android::hardware::radio::TtyMode::VCO == + static_cast( + ::android::hardware::radio::V1_0::TtyMode::VCO)); + +static_assert(aidl::android::hardware::radio::NvItem::CDMA_MEID == + static_cast( + ::android::hardware::radio::V1_0::NvItem::CDMA_MEID)); +static_assert(aidl::android::hardware::radio::NvItem::CDMA_MIN == + static_cast( + ::android::hardware::radio::V1_0::NvItem::CDMA_MIN)); +static_assert(aidl::android::hardware::radio::NvItem::CDMA_MDN == + static_cast( + ::android::hardware::radio::V1_0::NvItem::CDMA_MDN)); +static_assert(aidl::android::hardware::radio::NvItem::CDMA_ACCOLC == + static_cast( + ::android::hardware::radio::V1_0::NvItem::CDMA_ACCOLC)); +static_assert(aidl::android::hardware::radio::NvItem::DEVICE_MSL == + static_cast( + ::android::hardware::radio::V1_0::NvItem::DEVICE_MSL)); +static_assert(aidl::android::hardware::radio::NvItem::RTN_RECONDITIONED_STATUS == + static_cast( + ::android::hardware::radio::V1_0::NvItem::RTN_RECONDITIONED_STATUS)); +static_assert(aidl::android::hardware::radio::NvItem::RTN_ACTIVATION_DATE == + static_cast( + ::android::hardware::radio::V1_0::NvItem::RTN_ACTIVATION_DATE)); +static_assert(aidl::android::hardware::radio::NvItem::RTN_LIFE_TIMER == + static_cast( + ::android::hardware::radio::V1_0::NvItem::RTN_LIFE_TIMER)); +static_assert(aidl::android::hardware::radio::NvItem::RTN_LIFE_CALLS == + static_cast( + ::android::hardware::radio::V1_0::NvItem::RTN_LIFE_CALLS)); +static_assert(aidl::android::hardware::radio::NvItem::RTN_LIFE_DATA_TX == + static_cast( + ::android::hardware::radio::V1_0::NvItem::RTN_LIFE_DATA_TX)); +static_assert(aidl::android::hardware::radio::NvItem::RTN_LIFE_DATA_RX == + static_cast( + ::android::hardware::radio::V1_0::NvItem::RTN_LIFE_DATA_RX)); +static_assert(aidl::android::hardware::radio::NvItem::OMADM_HFA_LEVEL == + static_cast( + ::android::hardware::radio::V1_0::NvItem::OMADM_HFA_LEVEL)); +static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_NAI == + static_cast( + ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_NAI)); +static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_HOME_ADDRESS == + static_cast( + ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_HOME_ADDRESS)); +static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_AAA_AUTH == + static_cast( + ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_AAA_AUTH)); +static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_HA_AUTH == + static_cast( + ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_HA_AUTH)); +static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_PRI_HA_ADDR == + static_cast( + ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_PRI_HA_ADDR)); +static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_SEC_HA_ADDR == + static_cast( + ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_SEC_HA_ADDR)); +static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_REV_TUN_PREF == + static_cast( + ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_REV_TUN_PREF)); +static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_HA_SPI == + static_cast( + ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_HA_SPI)); +static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_AAA_SPI == + static_cast( + ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_AAA_SPI)); +static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_MN_HA_SS == + static_cast( + ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_MN_HA_SS)); +static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_MN_AAA_SS == + static_cast( + ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_MN_AAA_SS)); +static_assert(aidl::android::hardware::radio::NvItem::CDMA_PRL_VERSION == + static_cast( + ::android::hardware::radio::V1_0::NvItem::CDMA_PRL_VERSION)); +static_assert(aidl::android::hardware::radio::NvItem::CDMA_BC10 == + static_cast( + ::android::hardware::radio::V1_0::NvItem::CDMA_BC10)); +static_assert(aidl::android::hardware::radio::NvItem::CDMA_BC14 == + static_cast( + ::android::hardware::radio::V1_0::NvItem::CDMA_BC14)); +static_assert(aidl::android::hardware::radio::NvItem::CDMA_SO68 == + static_cast( + ::android::hardware::radio::V1_0::NvItem::CDMA_SO68)); +static_assert(aidl::android::hardware::radio::NvItem::CDMA_SO73_COP0 == + static_cast( + ::android::hardware::radio::V1_0::NvItem::CDMA_SO73_COP0)); +static_assert(aidl::android::hardware::radio::NvItem::CDMA_SO73_COP1TO7 == + static_cast( + ::android::hardware::radio::V1_0::NvItem::CDMA_SO73_COP1TO7)); +static_assert(aidl::android::hardware::radio::NvItem::CDMA_1X_ADVANCED_ENABLED == + static_cast( + ::android::hardware::radio::V1_0::NvItem::CDMA_1X_ADVANCED_ENABLED)); +static_assert(aidl::android::hardware::radio::NvItem::CDMA_EHRPD_ENABLED == + static_cast( + ::android::hardware::radio::V1_0::NvItem::CDMA_EHRPD_ENABLED)); +static_assert(aidl::android::hardware::radio::NvItem::CDMA_EHRPD_FORCED == + static_cast( + ::android::hardware::radio::V1_0::NvItem::CDMA_EHRPD_FORCED)); +static_assert(aidl::android::hardware::radio::NvItem::LTE_BAND_ENABLE_25 == + static_cast( + ::android::hardware::radio::V1_0::NvItem::LTE_BAND_ENABLE_25)); +static_assert(aidl::android::hardware::radio::NvItem::LTE_BAND_ENABLE_26 == + static_cast( + ::android::hardware::radio::V1_0::NvItem::LTE_BAND_ENABLE_26)); +static_assert(aidl::android::hardware::radio::NvItem::LTE_BAND_ENABLE_41 == + static_cast( + ::android::hardware::radio::V1_0::NvItem::LTE_BAND_ENABLE_41)); +static_assert(aidl::android::hardware::radio::NvItem::LTE_SCAN_PRIORITY_25 == + static_cast( + ::android::hardware::radio::V1_0::NvItem::LTE_SCAN_PRIORITY_25)); +static_assert(aidl::android::hardware::radio::NvItem::LTE_SCAN_PRIORITY_26 == + static_cast( + ::android::hardware::radio::V1_0::NvItem::LTE_SCAN_PRIORITY_26)); +static_assert(aidl::android::hardware::radio::NvItem::LTE_SCAN_PRIORITY_41 == + static_cast( + ::android::hardware::radio::V1_0::NvItem::LTE_SCAN_PRIORITY_41)); +static_assert(aidl::android::hardware::radio::NvItem::LTE_HIDDEN_BAND_PRIORITY_25 == + static_cast( + ::android::hardware::radio::V1_0::NvItem::LTE_HIDDEN_BAND_PRIORITY_25)); +static_assert(aidl::android::hardware::radio::NvItem::LTE_HIDDEN_BAND_PRIORITY_26 == + static_cast( + ::android::hardware::radio::V1_0::NvItem::LTE_HIDDEN_BAND_PRIORITY_26)); +static_assert(aidl::android::hardware::radio::NvItem::LTE_HIDDEN_BAND_PRIORITY_41 == + static_cast( + ::android::hardware::radio::V1_0::NvItem::LTE_HIDDEN_BAND_PRIORITY_41)); + +static_assert(aidl::android::hardware::radio::ResetNvType::RELOAD == + static_cast( + ::android::hardware::radio::V1_0::ResetNvType::RELOAD)); +static_assert(aidl::android::hardware::radio::ResetNvType::ERASE == + static_cast( + ::android::hardware::radio::V1_0::ResetNvType::ERASE)); +static_assert(aidl::android::hardware::radio::ResetNvType::FACTORY_RESET == + static_cast( + ::android::hardware::radio::V1_0::ResetNvType::FACTORY_RESET)); + +static_assert(aidl::android::hardware::radio::HardwareConfigState::ENABLED == + static_cast( + ::android::hardware::radio::V1_0::HardwareConfigState::ENABLED)); +static_assert(aidl::android::hardware::radio::HardwareConfigState::STANDBY == + static_cast( + ::android::hardware::radio::V1_0::HardwareConfigState::STANDBY)); +static_assert(aidl::android::hardware::radio::HardwareConfigState::DISABLED == + static_cast( + ::android::hardware::radio::V1_0::HardwareConfigState::DISABLED)); + +static_assert(aidl::android::hardware::radio::LceStatus::NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_0::LceStatus::NOT_SUPPORTED)); +static_assert(aidl::android::hardware::radio::LceStatus::STOPPED == + static_cast( + ::android::hardware::radio::V1_0::LceStatus::STOPPED)); +static_assert(aidl::android::hardware::radio::LceStatus::ACTIVE == + static_cast( + ::android::hardware::radio::V1_0::LceStatus::ACTIVE)); + +static_assert(aidl::android::hardware::radio::CarrierMatchType::ALL == + static_cast( + ::android::hardware::radio::V1_0::CarrierMatchType::ALL)); +static_assert(aidl::android::hardware::radio::CarrierMatchType::SPN == + static_cast( + ::android::hardware::radio::V1_0::CarrierMatchType::SPN)); +static_assert(aidl::android::hardware::radio::CarrierMatchType::IMSI_PREFIX == + static_cast( + ::android::hardware::radio::V1_0::CarrierMatchType::IMSI_PREFIX)); +static_assert(aidl::android::hardware::radio::CarrierMatchType::GID1 == + static_cast( + ::android::hardware::radio::V1_0::CarrierMatchType::GID1)); +static_assert(aidl::android::hardware::radio::CarrierMatchType::GID2 == + static_cast( + ::android::hardware::radio::V1_0::CarrierMatchType::GID2)); + +static_assert(aidl::android::hardware::radio::CdmaSmsDigitMode::FOUR_BIT == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsDigitMode::FOUR_BIT)); +static_assert(aidl::android::hardware::radio::CdmaSmsDigitMode::EIGHT_BIT == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsDigitMode::EIGHT_BIT)); + +static_assert(aidl::android::hardware::radio::CdmaSmsNumberMode::NOT_DATA_NETWORK == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberMode::NOT_DATA_NETWORK)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberMode::DATA_NETWORK == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberMode::DATA_NETWORK)); + +static_assert(aidl::android::hardware::radio::CdmaSmsNumberType::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberType::UNKNOWN)); +static_assert( + aidl::android::hardware::radio::CdmaSmsNumberType::INTERNATIONAL_OR_DATA_IP == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberType::INTERNATIONAL_OR_DATA_IP)); +static_assert( + aidl::android::hardware::radio::CdmaSmsNumberType::NATIONAL_OR_INTERNET_MAIL == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberType::NATIONAL_OR_INTERNET_MAIL)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberType::NETWORK == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberType::NETWORK)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberType::SUBSCRIBER == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberType::SUBSCRIBER)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberType::ALPHANUMERIC == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberType::ALPHANUMERIC)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberType::ABBREVIATED == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberType::ABBREVIATED)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberType::RESERVED_7 == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberType::RESERVED_7)); + +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::UNKNOWN)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::TELEPHONY == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::TELEPHONY)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_2 == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_2)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::DATA == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::DATA)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::TELEX == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::TELEX)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_5 == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_5)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_6 == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_6)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_7 == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_7)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_8 == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_8)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::PRIVATE == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::PRIVATE)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_10 == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_10)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_11 == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_11)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_12 == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_12)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_13 == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_13)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_14 == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_14)); +static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_15 == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_15)); + +static_assert(aidl::android::hardware::radio::CdmaSmsSubaddressType::NSAP == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsSubaddressType::NSAP)); +static_assert(aidl::android::hardware::radio::CdmaSmsSubaddressType::USER_SPECIFIED == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsSubaddressType::USER_SPECIFIED)); + +static_assert(aidl::android::hardware::radio::CdmaSmsErrorClass::NO_ERROR == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsErrorClass::NO_ERROR)); +static_assert(aidl::android::hardware::radio::CdmaSmsErrorClass::ERROR == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsErrorClass::ERROR)); + +static_assert(aidl::android::hardware::radio::CdmaSmsWriteArgsStatus::REC_UNREAD == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsWriteArgsStatus::REC_UNREAD)); +static_assert(aidl::android::hardware::radio::CdmaSmsWriteArgsStatus::REC_READ == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsWriteArgsStatus::REC_READ)); +static_assert(aidl::android::hardware::radio::CdmaSmsWriteArgsStatus::STO_UNSENT == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsWriteArgsStatus::STO_UNSENT)); +static_assert(aidl::android::hardware::radio::CdmaSmsWriteArgsStatus::STO_SENT == + static_cast( + ::android::hardware::radio::V1_0::CdmaSmsWriteArgsStatus::STO_SENT)); + +static_assert(aidl::android::hardware::radio::CellInfoType::NONE == + static_cast( + ::android::hardware::radio::V1_0::CellInfoType::NONE)); +static_assert(aidl::android::hardware::radio::CellInfoType::GSM == + static_cast( + ::android::hardware::radio::V1_0::CellInfoType::GSM)); +static_assert(aidl::android::hardware::radio::CellInfoType::CDMA == + static_cast( + ::android::hardware::radio::V1_0::CellInfoType::CDMA)); +static_assert(aidl::android::hardware::radio::CellInfoType::LTE == + static_cast( + ::android::hardware::radio::V1_0::CellInfoType::LTE)); +static_assert(aidl::android::hardware::radio::CellInfoType::WCDMA == + static_cast( + ::android::hardware::radio::V1_0::CellInfoType::WCDMA)); +static_assert(aidl::android::hardware::radio::CellInfoType::TD_SCDMA == + static_cast( + ::android::hardware::radio::V1_0::CellInfoType::TD_SCDMA)); + +static_assert(aidl::android::hardware::radio::TimeStampType::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_0::TimeStampType::UNKNOWN)); +static_assert(aidl::android::hardware::radio::TimeStampType::ANTENNA == + static_cast( + ::android::hardware::radio::V1_0::TimeStampType::ANTENNA)); +static_assert(aidl::android::hardware::radio::TimeStampType::MODEM == + static_cast( + ::android::hardware::radio::V1_0::TimeStampType::MODEM)); +static_assert(aidl::android::hardware::radio::TimeStampType::OEM_RIL == + static_cast( + ::android::hardware::radio::V1_0::TimeStampType::OEM_RIL)); +static_assert(aidl::android::hardware::radio::TimeStampType::JAVA_RIL == + static_cast( + ::android::hardware::radio::V1_0::TimeStampType::JAVA_RIL)); + +static_assert(aidl::android::hardware::radio::ApnAuthType::NO_PAP_NO_CHAP == + static_cast( + ::android::hardware::radio::V1_0::ApnAuthType::NO_PAP_NO_CHAP)); +static_assert(aidl::android::hardware::radio::ApnAuthType::PAP_NO_CHAP == + static_cast( + ::android::hardware::radio::V1_0::ApnAuthType::PAP_NO_CHAP)); +static_assert(aidl::android::hardware::radio::ApnAuthType::NO_PAP_CHAP == + static_cast( + ::android::hardware::radio::V1_0::ApnAuthType::NO_PAP_CHAP)); +static_assert(aidl::android::hardware::radio::ApnAuthType::PAP_CHAP == + static_cast( + ::android::hardware::radio::V1_0::ApnAuthType::PAP_CHAP)); + +static_assert(aidl::android::hardware::radio::RadioTechnologyFamily::THREE_GPP == + static_cast( + ::android::hardware::radio::V1_0::RadioTechnologyFamily::THREE_GPP)); +static_assert(aidl::android::hardware::radio::RadioTechnologyFamily::THREE_GPP2 == + static_cast( + ::android::hardware::radio::V1_0::RadioTechnologyFamily::THREE_GPP2)); + +static_assert(aidl::android::hardware::radio::RadioCapabilityPhase::CONFIGURED == + static_cast( + ::android::hardware::radio::V1_0::RadioCapabilityPhase::CONFIGURED)); +static_assert(aidl::android::hardware::radio::RadioCapabilityPhase::START == + static_cast( + ::android::hardware::radio::V1_0::RadioCapabilityPhase::START)); +static_assert(aidl::android::hardware::radio::RadioCapabilityPhase::APPLY == + static_cast( + ::android::hardware::radio::V1_0::RadioCapabilityPhase::APPLY)); +static_assert(aidl::android::hardware::radio::RadioCapabilityPhase::UNSOL_RSP == + static_cast( + ::android::hardware::radio::V1_0::RadioCapabilityPhase::UNSOL_RSP)); +static_assert(aidl::android::hardware::radio::RadioCapabilityPhase::FINISH == + static_cast( + ::android::hardware::radio::V1_0::RadioCapabilityPhase::FINISH)); + +static_assert(aidl::android::hardware::radio::RadioCapabilityStatus::NONE == + static_cast( + ::android::hardware::radio::V1_0::RadioCapabilityStatus::NONE)); +static_assert(aidl::android::hardware::radio::RadioCapabilityStatus::SUCCESS == + static_cast( + ::android::hardware::radio::V1_0::RadioCapabilityStatus::SUCCESS)); +static_assert(aidl::android::hardware::radio::RadioCapabilityStatus::FAIL == + static_cast( + ::android::hardware::radio::V1_0::RadioCapabilityStatus::FAIL)); + +static_assert(aidl::android::hardware::radio::UssdModeType::NOTIFY == + static_cast( + ::android::hardware::radio::V1_0::UssdModeType::NOTIFY)); +static_assert(aidl::android::hardware::radio::UssdModeType::REQUEST == + static_cast( + ::android::hardware::radio::V1_0::UssdModeType::REQUEST)); +static_assert(aidl::android::hardware::radio::UssdModeType::NW_RELEASE == + static_cast( + ::android::hardware::radio::V1_0::UssdModeType::NW_RELEASE)); +static_assert(aidl::android::hardware::radio::UssdModeType::LOCAL_CLIENT == + static_cast( + ::android::hardware::radio::V1_0::UssdModeType::LOCAL_CLIENT)); +static_assert(aidl::android::hardware::radio::UssdModeType::NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_0::UssdModeType::NOT_SUPPORTED)); +static_assert(aidl::android::hardware::radio::UssdModeType::NW_TIMEOUT == + static_cast( + ::android::hardware::radio::V1_0::UssdModeType::NW_TIMEOUT)); + +static_assert(aidl::android::hardware::radio::SimRefreshType::SIM_FILE_UPDATE == + static_cast( + ::android::hardware::radio::V1_0::SimRefreshType::SIM_FILE_UPDATE)); +static_assert(aidl::android::hardware::radio::SimRefreshType::SIM_INIT == + static_cast( + ::android::hardware::radio::V1_0::SimRefreshType::SIM_INIT)); +static_assert(aidl::android::hardware::radio::SimRefreshType::SIM_RESET == + static_cast( + ::android::hardware::radio::V1_0::SimRefreshType::SIM_RESET)); + +static_assert(aidl::android::hardware::radio::SrvccState::HANDOVER_STARTED == + static_cast( + ::android::hardware::radio::V1_0::SrvccState::HANDOVER_STARTED)); +static_assert(aidl::android::hardware::radio::SrvccState::HANDOVER_COMPLETED == + static_cast( + ::android::hardware::radio::V1_0::SrvccState::HANDOVER_COMPLETED)); +static_assert(aidl::android::hardware::radio::SrvccState::HANDOVER_FAILED == + static_cast( + ::android::hardware::radio::V1_0::SrvccState::HANDOVER_FAILED)); +static_assert(aidl::android::hardware::radio::SrvccState::HANDOVER_CANCELED == + static_cast( + ::android::hardware::radio::V1_0::SrvccState::HANDOVER_CANCELED)); + +static_assert(aidl::android::hardware::radio::UiccSubActStatus::DEACTIVATE == + static_cast( + ::android::hardware::radio::V1_0::UiccSubActStatus::DEACTIVATE)); +static_assert(aidl::android::hardware::radio::UiccSubActStatus::ACTIVATE == + static_cast( + ::android::hardware::radio::V1_0::UiccSubActStatus::ACTIVATE)); + +static_assert(aidl::android::hardware::radio::SubscriptionType::SUBSCRIPTION_1 == + static_cast( + ::android::hardware::radio::V1_0::SubscriptionType::SUBSCRIPTION_1)); +static_assert(aidl::android::hardware::radio::SubscriptionType::SUBSCRIPTION_2 == + static_cast( + ::android::hardware::radio::V1_0::SubscriptionType::SUBSCRIPTION_2)); +static_assert(aidl::android::hardware::radio::SubscriptionType::SUBSCRIPTION_3 == + static_cast( + ::android::hardware::radio::V1_0::SubscriptionType::SUBSCRIPTION_3)); + +static_assert(aidl::android::hardware::radio::DataProfileInfoType::COMMON == + static_cast( + ::android::hardware::radio::V1_0::DataProfileInfoType::COMMON)); +static_assert(aidl::android::hardware::radio::DataProfileInfoType::THREE_GPP == + static_cast( + ::android::hardware::radio::V1_0::DataProfileInfoType::THREE_GPP)); +static_assert(aidl::android::hardware::radio::DataProfileInfoType::THREE_GPP2 == + static_cast( + ::android::hardware::radio::V1_0::DataProfileInfoType::THREE_GPP2)); + +static_assert(aidl::android::hardware::radio::PhoneRestrictedState::NONE == + static_cast( + ::android::hardware::radio::V1_0::PhoneRestrictedState::NONE)); +static_assert(aidl::android::hardware::radio::PhoneRestrictedState::CS_EMERGENCY == + static_cast( + ::android::hardware::radio::V1_0::PhoneRestrictedState::CS_EMERGENCY)); +static_assert(aidl::android::hardware::radio::PhoneRestrictedState::CS_NORMAL == + static_cast( + ::android::hardware::radio::V1_0::PhoneRestrictedState::CS_NORMAL)); +static_assert(aidl::android::hardware::radio::PhoneRestrictedState::CS_ALL == + static_cast( + ::android::hardware::radio::V1_0::PhoneRestrictedState::CS_ALL)); +static_assert(aidl::android::hardware::radio::PhoneRestrictedState::PS_ALL == + static_cast( + ::android::hardware::radio::V1_0::PhoneRestrictedState::PS_ALL)); + +static_assert( + aidl::android::hardware::radio::CdmaCallWaitingNumberPresentation::ALLOWED == + static_cast( + ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPresentation::ALLOWED)); +static_assert( + aidl::android::hardware::radio::CdmaCallWaitingNumberPresentation::RESTRICTED == + static_cast( + ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPresentation::RESTRICTED)); +static_assert( + aidl::android::hardware::radio::CdmaCallWaitingNumberPresentation::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPresentation::UNKNOWN)); + +static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberType::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_0::CdmaCallWaitingNumberType::UNKNOWN)); +static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberType::INTERNATIONAL == + static_cast( + ::android::hardware::radio::V1_0::CdmaCallWaitingNumberType::INTERNATIONAL)); +static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberType::NATIONAL == + static_cast( + ::android::hardware::radio::V1_0::CdmaCallWaitingNumberType::NATIONAL)); +static_assert( + aidl::android::hardware::radio::CdmaCallWaitingNumberType::NETWORK_SPECIFIC == + static_cast( + ::android::hardware::radio::V1_0::CdmaCallWaitingNumberType::NETWORK_SPECIFIC)); +static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberType::SUBSCRIBER == + static_cast( + ::android::hardware::radio::V1_0::CdmaCallWaitingNumberType::SUBSCRIBER)); + +static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberPlan::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPlan::UNKNOWN)); +static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberPlan::ISDN == + static_cast( + ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPlan::ISDN)); +static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberPlan::DATA == + static_cast( + ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPlan::DATA)); +static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberPlan::TELEX == + static_cast( + ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPlan::TELEX)); +static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberPlan::NATIONAL == + static_cast( + ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPlan::NATIONAL)); +static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberPlan::PRIVATE == + static_cast( + ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPlan::PRIVATE)); + +static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::SPL_UNLOCKED == + static_cast( + ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::SPL_UNLOCKED)); +static_assert( + aidl::android::hardware::radio::CdmaOtaProvisionStatus::SPC_RETRIES_EXCEEDED == + static_cast( + ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::SPC_RETRIES_EXCEEDED)); +static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::A_KEY_EXCHANGED == + static_cast( + ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::A_KEY_EXCHANGED)); +static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::SSD_UPDATED == + static_cast( + ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::SSD_UPDATED)); +static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::NAM_DOWNLOADED == + static_cast( + ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::NAM_DOWNLOADED)); +static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::MDN_DOWNLOADED == + static_cast( + ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::MDN_DOWNLOADED)); +static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::IMSI_DOWNLOADED == + static_cast( + ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::IMSI_DOWNLOADED)); +static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::PRL_DOWNLOADED == + static_cast( + ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::PRL_DOWNLOADED)); +static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::COMMITTED == + static_cast( + ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::COMMITTED)); +static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::OTAPA_STARTED == + static_cast( + ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::OTAPA_STARTED)); +static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::OTAPA_STOPPED == + static_cast( + ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::OTAPA_STOPPED)); +static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::OTAPA_ABORTED == + static_cast( + ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::OTAPA_ABORTED)); + +static_assert(aidl::android::hardware::radio::CdmaInfoRecName::DISPLAY == + static_cast( + ::android::hardware::radio::V1_0::CdmaInfoRecName::DISPLAY)); +static_assert(aidl::android::hardware::radio::CdmaInfoRecName::CALLED_PARTY_NUMBER == + static_cast( + ::android::hardware::radio::V1_0::CdmaInfoRecName::CALLED_PARTY_NUMBER)); +static_assert(aidl::android::hardware::radio::CdmaInfoRecName::CALLING_PARTY_NUMBER == + static_cast( + ::android::hardware::radio::V1_0::CdmaInfoRecName::CALLING_PARTY_NUMBER)); +static_assert(aidl::android::hardware::radio::CdmaInfoRecName::CONNECTED_NUMBER == + static_cast( + ::android::hardware::radio::V1_0::CdmaInfoRecName::CONNECTED_NUMBER)); +static_assert(aidl::android::hardware::radio::CdmaInfoRecName::SIGNAL == + static_cast( + ::android::hardware::radio::V1_0::CdmaInfoRecName::SIGNAL)); +static_assert(aidl::android::hardware::radio::CdmaInfoRecName::REDIRECTING_NUMBER == + static_cast( + ::android::hardware::radio::V1_0::CdmaInfoRecName::REDIRECTING_NUMBER)); +static_assert(aidl::android::hardware::radio::CdmaInfoRecName::LINE_CONTROL == + static_cast( + ::android::hardware::radio::V1_0::CdmaInfoRecName::LINE_CONTROL)); +static_assert(aidl::android::hardware::radio::CdmaInfoRecName::EXTENDED_DISPLAY == + static_cast( + ::android::hardware::radio::V1_0::CdmaInfoRecName::EXTENDED_DISPLAY)); +static_assert(aidl::android::hardware::radio::CdmaInfoRecName::T53_CLIR == + static_cast( + ::android::hardware::radio::V1_0::CdmaInfoRecName::T53_CLIR)); +static_assert(aidl::android::hardware::radio::CdmaInfoRecName::T53_RELEASE == + static_cast( + ::android::hardware::radio::V1_0::CdmaInfoRecName::T53_RELEASE)); +static_assert(aidl::android::hardware::radio::CdmaInfoRecName::T53_AUDIO_CONTROL == + static_cast( + ::android::hardware::radio::V1_0::CdmaInfoRecName::T53_AUDIO_CONTROL)); + +static_assert(aidl::android::hardware::radio::CdmaRedirectingReason::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_0::CdmaRedirectingReason::UNKNOWN)); +static_assert( + aidl::android::hardware::radio::CdmaRedirectingReason::CALL_FORWARDING_BUSY == + static_cast( + ::android::hardware::radio::V1_0::CdmaRedirectingReason::CALL_FORWARDING_BUSY)); +static_assert( + aidl::android::hardware::radio::CdmaRedirectingReason::CALL_FORWARDING_NO_REPLY == + static_cast( + ::android::hardware::radio::V1_0::CdmaRedirectingReason::CALL_FORWARDING_NO_REPLY)); +static_assert( + aidl::android::hardware::radio::CdmaRedirectingReason::CALLED_DTE_OUT_OF_ORDER == + static_cast( + ::android::hardware::radio::V1_0::CdmaRedirectingReason::CALLED_DTE_OUT_OF_ORDER)); +static_assert( + aidl::android::hardware::radio::CdmaRedirectingReason::CALL_FORWARDING_BY_THE_CALLED_DTE == + static_cast( + ::android::hardware::radio::V1_0::CdmaRedirectingReason:: + CALL_FORWARDING_BY_THE_CALLED_DTE)); +static_assert( + aidl::android::hardware::radio::CdmaRedirectingReason::CALL_FORWARDING_UNCONDITIONAL == + static_cast( + ::android::hardware::radio::V1_0::CdmaRedirectingReason:: + CALL_FORWARDING_UNCONDITIONAL)); +static_assert(aidl::android::hardware::radio::CdmaRedirectingReason::RESERVED == + static_cast( + ::android::hardware::radio::V1_0::CdmaRedirectingReason::RESERVED)); + +static_assert(aidl::android::hardware::radio::SsServiceType::CFU == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::CFU)); +static_assert(aidl::android::hardware::radio::SsServiceType::CF_BUSY == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::CF_BUSY)); +static_assert(aidl::android::hardware::radio::SsServiceType::CF_NO_REPLY == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::CF_NO_REPLY)); +static_assert(aidl::android::hardware::radio::SsServiceType::CF_NOT_REACHABLE == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::CF_NOT_REACHABLE)); +static_assert(aidl::android::hardware::radio::SsServiceType::CF_ALL == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::CF_ALL)); +static_assert(aidl::android::hardware::radio::SsServiceType::CF_ALL_CONDITIONAL == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::CF_ALL_CONDITIONAL)); +static_assert(aidl::android::hardware::radio::SsServiceType::CLIP == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::CLIP)); +static_assert(aidl::android::hardware::radio::SsServiceType::CLIR == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::CLIR)); +static_assert(aidl::android::hardware::radio::SsServiceType::COLP == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::COLP)); +static_assert(aidl::android::hardware::radio::SsServiceType::COLR == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::COLR)); +static_assert(aidl::android::hardware::radio::SsServiceType::WAIT == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::WAIT)); +static_assert(aidl::android::hardware::radio::SsServiceType::BAOC == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::BAOC)); +static_assert(aidl::android::hardware::radio::SsServiceType::BAOIC == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::BAOIC)); +static_assert(aidl::android::hardware::radio::SsServiceType::BAOIC_EXC_HOME == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::BAOIC_EXC_HOME)); +static_assert(aidl::android::hardware::radio::SsServiceType::BAIC == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::BAIC)); +static_assert(aidl::android::hardware::radio::SsServiceType::BAIC_ROAMING == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::BAIC_ROAMING)); +static_assert(aidl::android::hardware::radio::SsServiceType::ALL_BARRING == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::ALL_BARRING)); +static_assert(aidl::android::hardware::radio::SsServiceType::OUTGOING_BARRING == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::OUTGOING_BARRING)); +static_assert(aidl::android::hardware::radio::SsServiceType::INCOMING_BARRING == + static_cast( + ::android::hardware::radio::V1_0::SsServiceType::INCOMING_BARRING)); + +static_assert(aidl::android::hardware::radio::SsRequestType::ACTIVATION == + static_cast( + ::android::hardware::radio::V1_0::SsRequestType::ACTIVATION)); +static_assert(aidl::android::hardware::radio::SsRequestType::DEACTIVATION == + static_cast( + ::android::hardware::radio::V1_0::SsRequestType::DEACTIVATION)); +static_assert(aidl::android::hardware::radio::SsRequestType::INTERROGATION == + static_cast( + ::android::hardware::radio::V1_0::SsRequestType::INTERROGATION)); +static_assert(aidl::android::hardware::radio::SsRequestType::REGISTRATION == + static_cast( + ::android::hardware::radio::V1_0::SsRequestType::REGISTRATION)); +static_assert(aidl::android::hardware::radio::SsRequestType::ERASURE == + static_cast( + ::android::hardware::radio::V1_0::SsRequestType::ERASURE)); + +static_assert( + aidl::android::hardware::radio::SsTeleserviceType::ALL_TELE_AND_BEARER_SERVICES == + static_cast( + ::android::hardware::radio::V1_0::SsTeleserviceType::ALL_TELE_AND_BEARER_SERVICES)); +static_assert(aidl::android::hardware::radio::SsTeleserviceType::ALL_TELESEVICES == + static_cast( + ::android::hardware::radio::V1_0::SsTeleserviceType::ALL_TELESEVICES)); +static_assert(aidl::android::hardware::radio::SsTeleserviceType::TELEPHONY == + static_cast( + ::android::hardware::radio::V1_0::SsTeleserviceType::TELEPHONY)); +static_assert(aidl::android::hardware::radio::SsTeleserviceType::ALL_DATA_TELESERVICES == + static_cast( + ::android::hardware::radio::V1_0::SsTeleserviceType::ALL_DATA_TELESERVICES)); +static_assert(aidl::android::hardware::radio::SsTeleserviceType::SMS_SERVICES == + static_cast( + ::android::hardware::radio::V1_0::SsTeleserviceType::SMS_SERVICES)); +static_assert( + aidl::android::hardware::radio::SsTeleserviceType::ALL_TELESERVICES_EXCEPT_SMS == + static_cast( + ::android::hardware::radio::V1_0::SsTeleserviceType::ALL_TELESERVICES_EXCEPT_SMS)); + +static_assert(aidl::android::hardware::radio::SuppServiceClass::NONE == + static_cast( + ::android::hardware::radio::V1_0::SuppServiceClass::NONE)); +static_assert(aidl::android::hardware::radio::SuppServiceClass::VOICE == + static_cast( + ::android::hardware::radio::V1_0::SuppServiceClass::VOICE)); +static_assert(aidl::android::hardware::radio::SuppServiceClass::DATA == + static_cast( + ::android::hardware::radio::V1_0::SuppServiceClass::DATA)); +static_assert(aidl::android::hardware::radio::SuppServiceClass::FAX == + static_cast( + ::android::hardware::radio::V1_0::SuppServiceClass::FAX)); +static_assert(aidl::android::hardware::radio::SuppServiceClass::SMS == + static_cast( + ::android::hardware::radio::V1_0::SuppServiceClass::SMS)); +static_assert(aidl::android::hardware::radio::SuppServiceClass::DATA_SYNC == + static_cast( + ::android::hardware::radio::V1_0::SuppServiceClass::DATA_SYNC)); +static_assert(aidl::android::hardware::radio::SuppServiceClass::DATA_ASYNC == + static_cast( + ::android::hardware::radio::V1_0::SuppServiceClass::DATA_ASYNC)); +static_assert(aidl::android::hardware::radio::SuppServiceClass::PACKET == + static_cast( + ::android::hardware::radio::V1_0::SuppServiceClass::PACKET)); +static_assert(aidl::android::hardware::radio::SuppServiceClass::PAD == + static_cast( + ::android::hardware::radio::V1_0::SuppServiceClass::PAD)); +static_assert(aidl::android::hardware::radio::SuppServiceClass::MAX == + static_cast( + ::android::hardware::radio::V1_0::SuppServiceClass::MAX)); + +static_assert(aidl::android::hardware::radio::MvnoType::NONE == + static_cast( + ::android::hardware::radio::V1_0::MvnoType::NONE)); +static_assert(aidl::android::hardware::radio::MvnoType::IMSI == + static_cast( + ::android::hardware::radio::V1_0::MvnoType::IMSI)); +static_assert(aidl::android::hardware::radio::MvnoType::GID == + static_cast( + ::android::hardware::radio::V1_0::MvnoType::GID)); +static_assert(aidl::android::hardware::radio::MvnoType::SPN == + static_cast( + ::android::hardware::radio::V1_0::MvnoType::SPN)); + +static_assert(aidl::android::hardware::radio::DeviceStateType::POWER_SAVE_MODE == + static_cast( + ::android::hardware::radio::V1_0::DeviceStateType::POWER_SAVE_MODE)); +static_assert(aidl::android::hardware::radio::DeviceStateType::CHARGING_STATE == + static_cast( + ::android::hardware::radio::V1_0::DeviceStateType::CHARGING_STATE)); +static_assert(aidl::android::hardware::radio::DeviceStateType::LOW_DATA_EXPECTED == + static_cast( + ::android::hardware::radio::V1_0::DeviceStateType::LOW_DATA_EXPECTED)); + +static_assert(aidl::android::hardware::radio::P2Constant::NO_P2 == + static_cast( + ::android::hardware::radio::V1_0::P2Constant::NO_P2)); + +static_assert(aidl::android::hardware::radio::CardPowerState::POWER_DOWN == + static_cast( + ::android::hardware::radio::V1_1::CardPowerState::POWER_DOWN)); +static_assert(aidl::android::hardware::radio::CardPowerState::POWER_UP == + static_cast( + ::android::hardware::radio::V1_1::CardPowerState::POWER_UP)); +static_assert(aidl::android::hardware::radio::CardPowerState::POWER_UP_PASS_THROUGH == + static_cast( + ::android::hardware::radio::V1_1::CardPowerState::POWER_UP_PASS_THROUGH)); + +static_assert(aidl::android::hardware::radio::GeranBands::BAND_T380 == + static_cast( + ::android::hardware::radio::V1_1::GeranBands::BAND_T380)); +static_assert(aidl::android::hardware::radio::GeranBands::BAND_T410 == + static_cast( + ::android::hardware::radio::V1_1::GeranBands::BAND_T410)); +static_assert(aidl::android::hardware::radio::GeranBands::BAND_450 == + static_cast( + ::android::hardware::radio::V1_1::GeranBands::BAND_450)); +static_assert(aidl::android::hardware::radio::GeranBands::BAND_480 == + static_cast( + ::android::hardware::radio::V1_1::GeranBands::BAND_480)); +static_assert(aidl::android::hardware::radio::GeranBands::BAND_710 == + static_cast( + ::android::hardware::radio::V1_1::GeranBands::BAND_710)); +static_assert(aidl::android::hardware::radio::GeranBands::BAND_750 == + static_cast( + ::android::hardware::radio::V1_1::GeranBands::BAND_750)); +static_assert(aidl::android::hardware::radio::GeranBands::BAND_T810 == + static_cast( + ::android::hardware::radio::V1_1::GeranBands::BAND_T810)); +static_assert(aidl::android::hardware::radio::GeranBands::BAND_850 == + static_cast( + ::android::hardware::radio::V1_1::GeranBands::BAND_850)); +static_assert(aidl::android::hardware::radio::GeranBands::BAND_P900 == + static_cast( + ::android::hardware::radio::V1_1::GeranBands::BAND_P900)); +static_assert(aidl::android::hardware::radio::GeranBands::BAND_E900 == + static_cast( + ::android::hardware::radio::V1_1::GeranBands::BAND_E900)); +static_assert(aidl::android::hardware::radio::GeranBands::BAND_R900 == + static_cast( + ::android::hardware::radio::V1_1::GeranBands::BAND_R900)); +static_assert(aidl::android::hardware::radio::GeranBands::BAND_DCS1800 == + static_cast( + ::android::hardware::radio::V1_1::GeranBands::BAND_DCS1800)); +static_assert(aidl::android::hardware::radio::GeranBands::BAND_PCS1900 == + static_cast( + ::android::hardware::radio::V1_1::GeranBands::BAND_PCS1900)); +static_assert(aidl::android::hardware::radio::GeranBands::BAND_ER900 == + static_cast( + ::android::hardware::radio::V1_1::GeranBands::BAND_ER900)); + +static_assert(aidl::android::hardware::radio::ScanType::ONE_SHOT == + static_cast( + ::android::hardware::radio::V1_1::ScanType::ONE_SHOT)); +static_assert(aidl::android::hardware::radio::ScanType::PERIODIC == + static_cast( + ::android::hardware::radio::V1_1::ScanType::PERIODIC)); + +static_assert(aidl::android::hardware::radio::ScanStatus::PARTIAL == + static_cast( + ::android::hardware::radio::V1_1::ScanStatus::PARTIAL)); +static_assert(aidl::android::hardware::radio::ScanStatus::COMPLETE == + static_cast( + ::android::hardware::radio::V1_1::ScanStatus::COMPLETE)); + +static_assert(aidl::android::hardware::radio::KeepaliveType::NATT_IPV4 == + static_cast( + ::android::hardware::radio::V1_1::KeepaliveType::NATT_IPV4)); +static_assert(aidl::android::hardware::radio::KeepaliveType::NATT_IPV6 == + static_cast( + ::android::hardware::radio::V1_1::KeepaliveType::NATT_IPV6)); + +static_assert(aidl::android::hardware::radio::KeepaliveStatusCode::ACTIVE == + static_cast( + ::android::hardware::radio::V1_1::KeepaliveStatusCode::ACTIVE)); +static_assert(aidl::android::hardware::radio::KeepaliveStatusCode::INACTIVE == + static_cast( + ::android::hardware::radio::V1_1::KeepaliveStatusCode::INACTIVE)); +static_assert(aidl::android::hardware::radio::KeepaliveStatusCode::PENDING == + static_cast( + ::android::hardware::radio::V1_1::KeepaliveStatusCode::PENDING)); + +static_assert(aidl::android::hardware::radio::RadioConst::CDMA_ALPHA_INFO_BUFFER_LENGTH == + static_cast( + ::android::hardware::radio::V1_2::RadioConst::CDMA_ALPHA_INFO_BUFFER_LENGTH)); +static_assert( + aidl::android::hardware::radio::RadioConst::CDMA_NUMBER_INFO_BUFFER_LENGTH == + static_cast( + ::android::hardware::radio::V1_2::RadioConst::CDMA_NUMBER_INFO_BUFFER_LENGTH)); +static_assert(aidl::android::hardware::radio::RadioConst::MAX_RILDS == + static_cast( + ::android::hardware::radio::V1_2::RadioConst::MAX_RILDS)); +static_assert(aidl::android::hardware::radio::RadioConst::MAX_SOCKET_NAME_LENGTH == + static_cast( + ::android::hardware::radio::V1_2::RadioConst::MAX_SOCKET_NAME_LENGTH)); +static_assert(aidl::android::hardware::radio::RadioConst::MAX_CLIENT_ID_LENGTH == + static_cast( + ::android::hardware::radio::V1_2::RadioConst::MAX_CLIENT_ID_LENGTH)); +static_assert(aidl::android::hardware::radio::RadioConst::MAX_DEBUG_SOCKET_NAME_LENGTH == + static_cast( + ::android::hardware::radio::V1_2::RadioConst::MAX_DEBUG_SOCKET_NAME_LENGTH)); +static_assert(aidl::android::hardware::radio::RadioConst::MAX_QEMU_PIPE_NAME_LENGTH == + static_cast( + ::android::hardware::radio::V1_2::RadioConst::MAX_QEMU_PIPE_NAME_LENGTH)); +static_assert(aidl::android::hardware::radio::RadioConst::MAX_UUID_LENGTH == + static_cast( + ::android::hardware::radio::V1_2::RadioConst::MAX_UUID_LENGTH)); +static_assert(aidl::android::hardware::radio::RadioConst::CARD_MAX_APPS == + static_cast( + ::android::hardware::radio::V1_2::RadioConst::CARD_MAX_APPS)); +static_assert(aidl::android::hardware::radio::RadioConst::CDMA_MAX_NUMBER_OF_INFO_RECS == + static_cast( + ::android::hardware::radio::V1_2::RadioConst::CDMA_MAX_NUMBER_OF_INFO_RECS)); +static_assert(aidl::android::hardware::radio::RadioConst::SS_INFO_MAX == + static_cast( + ::android::hardware::radio::V1_2::RadioConst::SS_INFO_MAX)); +static_assert(aidl::android::hardware::radio::RadioConst::NUM_SERVICE_CLASSES == + static_cast( + ::android::hardware::radio::V1_2::RadioConst::NUM_SERVICE_CLASSES)); +static_assert(aidl::android::hardware::radio::RadioConst::NUM_TX_POWER_LEVELS == + static_cast( + ::android::hardware::radio::V1_2::RadioConst::NUM_TX_POWER_LEVELS)); +static_assert( + aidl::android::hardware::radio::RadioConst::RADIO_ACCESS_SPECIFIER_MAX_SIZE == + static_cast( + ::android::hardware::radio::V1_2::RadioConst::RADIO_ACCESS_SPECIFIER_MAX_SIZE)); + +static_assert(aidl::android::hardware::radio::ScanIntervalRange::MIN == + static_cast( + ::android::hardware::radio::V1_2::ScanIntervalRange::MIN)); +static_assert(aidl::android::hardware::radio::ScanIntervalRange::MAX == + static_cast( + ::android::hardware::radio::V1_2::ScanIntervalRange::MAX)); + +static_assert(aidl::android::hardware::radio::MaxSearchTimeRange::MIN == + static_cast( + ::android::hardware::radio::V1_2::MaxSearchTimeRange::MIN)); +static_assert(aidl::android::hardware::radio::MaxSearchTimeRange::MAX == + static_cast( + ::android::hardware::radio::V1_2::MaxSearchTimeRange::MAX)); + +static_assert(aidl::android::hardware::radio::IncrementalResultsPeriodicityRange::MIN == + static_cast( + ::android::hardware::radio::V1_2::IncrementalResultsPeriodicityRange::MIN)); +static_assert(aidl::android::hardware::radio::IncrementalResultsPeriodicityRange::MAX == + static_cast( + ::android::hardware::radio::V1_2::IncrementalResultsPeriodicityRange::MAX)); + +static_assert(aidl::android::hardware::radio::CellConnectionStatus::NONE == + static_cast( + ::android::hardware::radio::V1_2::CellConnectionStatus::NONE)); +static_assert(aidl::android::hardware::radio::CellConnectionStatus::PRIMARY_SERVING == + static_cast( + ::android::hardware::radio::V1_2::CellConnectionStatus::PRIMARY_SERVING)); +static_assert(aidl::android::hardware::radio::CellConnectionStatus::SECONDARY_SERVING == + static_cast( + ::android::hardware::radio::V1_2::CellConnectionStatus::SECONDARY_SERVING)); + +static_assert(aidl::android::hardware::radio::AudioQuality::UNSPECIFIED == + static_cast( + ::android::hardware::radio::V1_2::AudioQuality::UNSPECIFIED)); +static_assert(aidl::android::hardware::radio::AudioQuality::AMR == + static_cast( + ::android::hardware::radio::V1_2::AudioQuality::AMR)); +static_assert(aidl::android::hardware::radio::AudioQuality::AMR_WB == + static_cast( + ::android::hardware::radio::V1_2::AudioQuality::AMR_WB)); +static_assert(aidl::android::hardware::radio::AudioQuality::GSM_EFR == + static_cast( + ::android::hardware::radio::V1_2::AudioQuality::GSM_EFR)); +static_assert(aidl::android::hardware::radio::AudioQuality::GSM_FR == + static_cast( + ::android::hardware::radio::V1_2::AudioQuality::GSM_FR)); +static_assert(aidl::android::hardware::radio::AudioQuality::GSM_HR == + static_cast( + ::android::hardware::radio::V1_2::AudioQuality::GSM_HR)); +static_assert(aidl::android::hardware::radio::AudioQuality::EVRC == + static_cast( + ::android::hardware::radio::V1_2::AudioQuality::EVRC)); +static_assert(aidl::android::hardware::radio::AudioQuality::EVRC_B == + static_cast( + ::android::hardware::radio::V1_2::AudioQuality::EVRC_B)); +static_assert(aidl::android::hardware::radio::AudioQuality::EVRC_WB == + static_cast( + ::android::hardware::radio::V1_2::AudioQuality::EVRC_WB)); +static_assert(aidl::android::hardware::radio::AudioQuality::EVRC_NW == + static_cast( + ::android::hardware::radio::V1_2::AudioQuality::EVRC_NW)); + +static_assert(aidl::android::hardware::radio::DataRequestReason::NORMAL == + static_cast( + ::android::hardware::radio::V1_2::DataRequestReason::NORMAL)); +static_assert(aidl::android::hardware::radio::DataRequestReason::SHUTDOWN == + static_cast( + ::android::hardware::radio::V1_2::DataRequestReason::SHUTDOWN)); +static_assert(aidl::android::hardware::radio::DataRequestReason::HANDOVER == + static_cast( + ::android::hardware::radio::V1_2::DataRequestReason::HANDOVER)); + +static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::UNSPECIFIED == + static_cast( + ::android::hardware::radio::V1_4::EmergencyServiceCategory::UNSPECIFIED)); +static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::POLICE == + static_cast( + ::android::hardware::radio::V1_4::EmergencyServiceCategory::POLICE)); +static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::AMBULANCE == + static_cast( + ::android::hardware::radio::V1_4::EmergencyServiceCategory::AMBULANCE)); +static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::FIRE_BRIGADE == + static_cast( + ::android::hardware::radio::V1_4::EmergencyServiceCategory::FIRE_BRIGADE)); +static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::MARINE_GUARD == + static_cast( + ::android::hardware::radio::V1_4::EmergencyServiceCategory::MARINE_GUARD)); +static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::MOUNTAIN_RESCUE == + static_cast( + ::android::hardware::radio::V1_4::EmergencyServiceCategory::MOUNTAIN_RESCUE)); +static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::MIEC == + static_cast( + ::android::hardware::radio::V1_4::EmergencyServiceCategory::MIEC)); +static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::AIEC == + static_cast( + ::android::hardware::radio::V1_4::EmergencyServiceCategory::AIEC)); + +static_assert(aidl::android::hardware::radio::EmergencyNumberSource::NETWORK_SIGNALING == + static_cast( + ::android::hardware::radio::V1_4::EmergencyNumberSource::NETWORK_SIGNALING)); +static_assert(aidl::android::hardware::radio::EmergencyNumberSource::SIM == + static_cast( + ::android::hardware::radio::V1_4::EmergencyNumberSource::SIM)); +static_assert(aidl::android::hardware::radio::EmergencyNumberSource::MODEM_CONFIG == + static_cast( + ::android::hardware::radio::V1_4::EmergencyNumberSource::MODEM_CONFIG)); +static_assert(aidl::android::hardware::radio::EmergencyNumberSource::DEFAULT == + static_cast( + ::android::hardware::radio::V1_4::EmergencyNumberSource::DEFAULT)); + +static_assert(aidl::android::hardware::radio::EmergencyCallRouting::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_4::EmergencyCallRouting::UNKNOWN)); +static_assert(aidl::android::hardware::radio::EmergencyCallRouting::EMERGENCY == + static_cast( + ::android::hardware::radio::V1_4::EmergencyCallRouting::EMERGENCY)); +static_assert(aidl::android::hardware::radio::EmergencyCallRouting::NORMAL == + static_cast( + ::android::hardware::radio::V1_4::EmergencyCallRouting::NORMAL)); + +static_assert(aidl::android::hardware::radio::RadioTechnology::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::UNKNOWN)); +static_assert(aidl::android::hardware::radio::RadioTechnology::GPRS == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::GPRS)); +static_assert(aidl::android::hardware::radio::RadioTechnology::EDGE == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::EDGE)); +static_assert(aidl::android::hardware::radio::RadioTechnology::UMTS == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::UMTS)); +static_assert(aidl::android::hardware::radio::RadioTechnology::IS95A == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::IS95A)); +static_assert(aidl::android::hardware::radio::RadioTechnology::IS95B == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::IS95B)); +static_assert(aidl::android::hardware::radio::RadioTechnology::ONE_X_RTT == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::ONE_X_RTT)); +static_assert(aidl::android::hardware::radio::RadioTechnology::EVDO_0 == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::EVDO_0)); +static_assert(aidl::android::hardware::radio::RadioTechnology::EVDO_A == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::EVDO_A)); +static_assert(aidl::android::hardware::radio::RadioTechnology::HSDPA == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::HSDPA)); +static_assert(aidl::android::hardware::radio::RadioTechnology::HSUPA == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::HSUPA)); +static_assert(aidl::android::hardware::radio::RadioTechnology::HSPA == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::HSPA)); +static_assert(aidl::android::hardware::radio::RadioTechnology::EVDO_B == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::EVDO_B)); +static_assert(aidl::android::hardware::radio::RadioTechnology::EHRPD == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::EHRPD)); +static_assert(aidl::android::hardware::radio::RadioTechnology::LTE == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::LTE)); +static_assert(aidl::android::hardware::radio::RadioTechnology::HSPAP == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::HSPAP)); +static_assert(aidl::android::hardware::radio::RadioTechnology::GSM == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::GSM)); +static_assert(aidl::android::hardware::radio::RadioTechnology::TD_SCDMA == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::TD_SCDMA)); +static_assert(aidl::android::hardware::radio::RadioTechnology::IWLAN == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::IWLAN)); +static_assert(aidl::android::hardware::radio::RadioTechnology::LTE_CA == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::LTE_CA)); +static_assert(aidl::android::hardware::radio::RadioTechnology::NR == + static_cast( + ::android::hardware::radio::V1_4::RadioTechnology::NR)); + +static_assert(aidl::android::hardware::radio::RadioAccessFamily::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::UNKNOWN)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::GPRS == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::GPRS)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::EDGE == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::EDGE)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::UMTS == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::UMTS)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::IS95A == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::IS95A)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::IS95B == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::IS95B)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::ONE_X_RTT == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::ONE_X_RTT)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::EVDO_0 == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::EVDO_0)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::EVDO_A == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::EVDO_A)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::HSDPA == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::HSDPA)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::HSUPA == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::HSUPA)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::HSPA == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::HSPA)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::EVDO_B == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::EVDO_B)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::EHRPD == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::EHRPD)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::LTE == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::LTE)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::HSPAP == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::HSPAP)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::GSM == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::GSM)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::TD_SCDMA == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::TD_SCDMA)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::LTE_CA == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::LTE_CA)); +static_assert(aidl::android::hardware::radio::RadioAccessFamily::NR == + static_cast( + ::android::hardware::radio::V1_4::RadioAccessFamily::NR)); + +static_assert(aidl::android::hardware::radio::FrequencyRange::LOW == + static_cast( + ::android::hardware::radio::V1_4::FrequencyRange::LOW)); +static_assert(aidl::android::hardware::radio::FrequencyRange::MID == + static_cast( + ::android::hardware::radio::V1_4::FrequencyRange::MID)); +static_assert(aidl::android::hardware::radio::FrequencyRange::HIGH == + static_cast( + ::android::hardware::radio::V1_4::FrequencyRange::HIGH)); +static_assert(aidl::android::hardware::radio::FrequencyRange::MMWAVE == + static_cast( + ::android::hardware::radio::V1_4::FrequencyRange::MMWAVE)); + +static_assert(aidl::android::hardware::radio::DataConnActiveStatus::INACTIVE == + static_cast( + ::android::hardware::radio::V1_4::DataConnActiveStatus::INACTIVE)); +static_assert(aidl::android::hardware::radio::DataConnActiveStatus::DORMANT == + static_cast( + ::android::hardware::radio::V1_4::DataConnActiveStatus::DORMANT)); +static_assert(aidl::android::hardware::radio::DataConnActiveStatus::ACTIVE == + static_cast( + ::android::hardware::radio::V1_4::DataConnActiveStatus::ACTIVE)); + +static_assert(aidl::android::hardware::radio::PdpProtocolType::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_4::PdpProtocolType::UNKNOWN)); +static_assert(aidl::android::hardware::radio::PdpProtocolType::IP == + static_cast( + ::android::hardware::radio::V1_4::PdpProtocolType::IP)); +static_assert(aidl::android::hardware::radio::PdpProtocolType::IPV6 == + static_cast( + ::android::hardware::radio::V1_4::PdpProtocolType::IPV6)); +static_assert(aidl::android::hardware::radio::PdpProtocolType::IPV4V6 == + static_cast( + ::android::hardware::radio::V1_4::PdpProtocolType::IPV4V6)); +static_assert(aidl::android::hardware::radio::PdpProtocolType::PPP == + static_cast( + ::android::hardware::radio::V1_4::PdpProtocolType::PPP)); +static_assert(aidl::android::hardware::radio::PdpProtocolType::NON_IP == + static_cast( + ::android::hardware::radio::V1_4::PdpProtocolType::NON_IP)); +static_assert(aidl::android::hardware::radio::PdpProtocolType::UNSTRUCTURED == + static_cast( + ::android::hardware::radio::V1_4::PdpProtocolType::UNSTRUCTURED)); + +static_assert(aidl::android::hardware::radio::AccessNetwork::GERAN == + static_cast( + ::android::hardware::radio::V1_5::AccessNetwork::GERAN)); +static_assert(aidl::android::hardware::radio::AccessNetwork::UTRAN == + static_cast( + ::android::hardware::radio::V1_5::AccessNetwork::UTRAN)); +static_assert(aidl::android::hardware::radio::AccessNetwork::EUTRAN == + static_cast( + ::android::hardware::radio::V1_5::AccessNetwork::EUTRAN)); +static_assert(aidl::android::hardware::radio::AccessNetwork::CDMA2000 == + static_cast( + ::android::hardware::radio::V1_5::AccessNetwork::CDMA2000)); +static_assert(aidl::android::hardware::radio::AccessNetwork::IWLAN == + static_cast( + ::android::hardware::radio::V1_5::AccessNetwork::IWLAN)); +static_assert(aidl::android::hardware::radio::AccessNetwork::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_5::AccessNetwork::UNKNOWN)); +static_assert(aidl::android::hardware::radio::AccessNetwork::NGRAN == + static_cast( + ::android::hardware::radio::V1_5::AccessNetwork::NGRAN)); + +static_assert(aidl::android::hardware::radio::SignalMeasurementType::RSSI == + static_cast( + ::android::hardware::radio::V1_5::SignalMeasurementType::RSSI)); +static_assert(aidl::android::hardware::radio::SignalMeasurementType::RSCP == + static_cast( + ::android::hardware::radio::V1_5::SignalMeasurementType::RSCP)); +static_assert(aidl::android::hardware::radio::SignalMeasurementType::RSRP == + static_cast( + ::android::hardware::radio::V1_5::SignalMeasurementType::RSRP)); +static_assert(aidl::android::hardware::radio::SignalMeasurementType::RSRQ == + static_cast( + ::android::hardware::radio::V1_5::SignalMeasurementType::RSRQ)); +static_assert(aidl::android::hardware::radio::SignalMeasurementType::RSSNR == + static_cast( + ::android::hardware::radio::V1_5::SignalMeasurementType::RSSNR)); +static_assert(aidl::android::hardware::radio::SignalMeasurementType::SSRSRP == + static_cast( + ::android::hardware::radio::V1_5::SignalMeasurementType::SSRSRP)); +static_assert(aidl::android::hardware::radio::SignalMeasurementType::SSRSRQ == + static_cast( + ::android::hardware::radio::V1_5::SignalMeasurementType::SSRSRQ)); +static_assert(aidl::android::hardware::radio::SignalMeasurementType::SSSINR == + static_cast( + ::android::hardware::radio::V1_5::SignalMeasurementType::SSSINR)); + +static_assert(aidl::android::hardware::radio::SimLockMultiSimPolicy::NO_MULTISIM_POLICY == + static_cast( + ::android::hardware::radio::V1_4::SimLockMultiSimPolicy::NO_MULTISIM_POLICY)); +static_assert( + aidl::android::hardware::radio::SimLockMultiSimPolicy::ONE_VALID_SIM_MUST_BE_PRESENT == + static_cast( + ::android::hardware::radio::V1_4::SimLockMultiSimPolicy:: + ONE_VALID_SIM_MUST_BE_PRESENT)); + +static_assert(aidl::android::hardware::radio::RadioAccessNetworks::GERAN == + static_cast( + ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN)); +static_assert(aidl::android::hardware::radio::RadioAccessNetworks::UTRAN == + static_cast( + ::android::hardware::radio::V1_5::RadioAccessNetworks::UTRAN)); +static_assert(aidl::android::hardware::radio::RadioAccessNetworks::EUTRAN == + static_cast( + ::android::hardware::radio::V1_5::RadioAccessNetworks::EUTRAN)); +static_assert(aidl::android::hardware::radio::RadioAccessNetworks::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_5::RadioAccessNetworks::UNKNOWN)); +static_assert(aidl::android::hardware::radio::RadioAccessNetworks::NGRAN == + static_cast( + ::android::hardware::radio::V1_5::RadioAccessNetworks::NGRAN)); +static_assert(aidl::android::hardware::radio::RadioAccessNetworks::CDMA2000 == + static_cast( + ::android::hardware::radio::V1_5::RadioAccessNetworks::CDMA2000)); + +static_assert(aidl::android::hardware::radio::UtranBands::BAND_1 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_1)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_2 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_2)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_3 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_3)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_4 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_4)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_5 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_5)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_6 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_6)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_7 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_7)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_8 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_8)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_9 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_9)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_10 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_10)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_11 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_11)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_12 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_12)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_13 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_13)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_14 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_14)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_19 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_19)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_20 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_20)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_21 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_21)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_22 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_22)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_25 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_25)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_26 == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_26)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_A == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_A)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_B == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_B)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_C == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_C)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_D == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_D)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_E == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_E)); +static_assert(aidl::android::hardware::radio::UtranBands::BAND_F == + static_cast( + ::android::hardware::radio::V1_5::UtranBands::BAND_F)); + +static_assert(aidl::android::hardware::radio::EutranBands::BAND_1 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_1)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_2 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_2)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_3 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_3)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_4 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_4)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_5 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_5)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_6 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_6)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_7 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_7)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_8 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_8)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_9 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_9)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_10 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_10)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_11 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_11)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_12 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_12)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_13 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_13)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_14 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_14)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_17 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_17)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_18 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_18)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_19 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_19)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_20 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_20)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_21 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_21)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_22 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_22)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_23 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_23)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_24 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_24)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_25 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_25)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_26 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_26)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_27 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_27)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_28 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_28)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_30 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_30)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_31 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_31)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_33 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_33)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_34 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_34)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_35 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_35)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_36 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_36)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_37 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_37)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_38 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_38)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_39 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_39)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_40 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_40)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_41 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_41)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_42 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_42)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_43 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_43)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_44 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_44)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_45 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_45)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_46 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_46)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_47 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_47)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_48 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_48)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_65 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_65)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_66 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_66)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_68 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_68)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_70 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_70)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_49 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_49)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_50 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_50)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_51 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_51)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_52 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_52)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_53 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_53)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_71 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_71)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_72 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_72)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_73 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_73)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_74 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_74)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_85 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_85)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_87 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_87)); +static_assert(aidl::android::hardware::radio::EutranBands::BAND_88 == + static_cast( + ::android::hardware::radio::V1_5::EutranBands::BAND_88)); + +static_assert(aidl::android::hardware::radio::ApnTypes::NONE == + static_cast( + ::android::hardware::radio::V1_5::ApnTypes::NONE)); +static_assert(aidl::android::hardware::radio::ApnTypes::DEFAULT == + static_cast( + ::android::hardware::radio::V1_5::ApnTypes::DEFAULT)); +static_assert(aidl::android::hardware::radio::ApnTypes::MMS == + static_cast( + ::android::hardware::radio::V1_5::ApnTypes::MMS)); +static_assert(aidl::android::hardware::radio::ApnTypes::SUPL == + static_cast( + ::android::hardware::radio::V1_5::ApnTypes::SUPL)); +static_assert(aidl::android::hardware::radio::ApnTypes::DUN == + static_cast( + ::android::hardware::radio::V1_5::ApnTypes::DUN)); +static_assert(aidl::android::hardware::radio::ApnTypes::HIPRI == + static_cast( + ::android::hardware::radio::V1_5::ApnTypes::HIPRI)); +static_assert(aidl::android::hardware::radio::ApnTypes::FOTA == + static_cast( + ::android::hardware::radio::V1_5::ApnTypes::FOTA)); +static_assert(aidl::android::hardware::radio::ApnTypes::IMS == + static_cast( + ::android::hardware::radio::V1_5::ApnTypes::IMS)); +static_assert(aidl::android::hardware::radio::ApnTypes::CBS == + static_cast( + ::android::hardware::radio::V1_5::ApnTypes::CBS)); +static_assert(aidl::android::hardware::radio::ApnTypes::IA == + static_cast( + ::android::hardware::radio::V1_5::ApnTypes::IA)); +static_assert(aidl::android::hardware::radio::ApnTypes::EMERGENCY == + static_cast( + ::android::hardware::radio::V1_5::ApnTypes::EMERGENCY)); +static_assert(aidl::android::hardware::radio::ApnTypes::ALL == + static_cast( + ::android::hardware::radio::V1_5::ApnTypes::ALL)); +static_assert(aidl::android::hardware::radio::ApnTypes::MCX == + static_cast( + ::android::hardware::radio::V1_5::ApnTypes::MCX)); +static_assert(aidl::android::hardware::radio::ApnTypes::XCAP == + static_cast( + ::android::hardware::radio::V1_5::ApnTypes::XCAP)); + +static_assert(aidl::android::hardware::radio::AddressProperty::NONE == + static_cast( + ::android::hardware::radio::V1_5::AddressProperty::NONE)); +static_assert(aidl::android::hardware::radio::AddressProperty::DEPRECATED == + static_cast( + ::android::hardware::radio::V1_5::AddressProperty::DEPRECATED)); + +static_assert(aidl::android::hardware::radio::Domain::CS == + static_cast( + ::android::hardware::radio::V1_5::Domain::CS)); +static_assert(aidl::android::hardware::radio::Domain::PS == + static_cast( + ::android::hardware::radio::V1_5::Domain::PS)); + +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::CS_SERVICE == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::CS_SERVICE)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::PS_SERVICE == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::PS_SERVICE)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::CS_VOICE == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::CS_VOICE)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::MO_SIGNALLING == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::MO_SIGNALLING)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::MO_DATA == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::MO_DATA)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::CS_FALLBACK == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::CS_FALLBACK)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::MMTEL_VOICE == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::MMTEL_VOICE)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::MMTEL_VIDEO == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::MMTEL_VIDEO)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::EMERGENCY == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::EMERGENCY)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::SMS == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::SMS)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_1 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_1)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_2 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_2)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_3 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_3)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_4 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_4)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_5 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_5)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_6 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_6)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_7 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_7)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_8 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_8)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_9 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_9)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_10 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_10)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_11 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_11)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_12 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_12)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_13 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_13)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_14 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_14)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_15 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_15)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_16 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_16)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_17 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_17)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_18 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_18)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_19 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_19)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_20 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_20)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_21 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_21)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_22 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_22)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_23 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_23)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_24 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_24)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_25 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_25)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_26 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_26)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_27 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_27)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_28 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_28)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_29 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_29)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_30 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_30)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_31 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_31)); +static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_32 == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_32)); + +static_assert(aidl::android::hardware::radio::BarringInfoBarringType::NONE == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::BarringType::NONE)); +static_assert(aidl::android::hardware::radio::BarringInfoBarringType::CONDITIONAL == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::BarringType::CONDITIONAL)); +static_assert(aidl::android::hardware::radio::BarringInfoBarringType::UNCONDITIONAL == + static_cast( + ::android::hardware::radio::V1_5::BarringInfo::BarringType::UNCONDITIONAL)); + +static_assert(aidl::android::hardware::radio::IndicationFilter::NONE == + static_cast( + ::android::hardware::radio::V1_5::IndicationFilter::NONE)); +static_assert(aidl::android::hardware::radio::IndicationFilter::ALL == + static_cast( + ::android::hardware::radio::V1_5::IndicationFilter::ALL)); +static_assert(aidl::android::hardware::radio::IndicationFilter::SIGNAL_STRENGTH == + static_cast( + ::android::hardware::radio::V1_5::IndicationFilter::SIGNAL_STRENGTH)); +static_assert(aidl::android::hardware::radio::IndicationFilter::FULL_NETWORK_STATE == + static_cast( + ::android::hardware::radio::V1_5::IndicationFilter::FULL_NETWORK_STATE)); +static_assert( + aidl::android::hardware::radio::IndicationFilter::DATA_CALL_DORMANCY_CHANGED == + static_cast( + ::android::hardware::radio::V1_5::IndicationFilter::DATA_CALL_DORMANCY_CHANGED)); +static_assert(aidl::android::hardware::radio::IndicationFilter::LINK_CAPACITY_ESTIMATE == + static_cast( + ::android::hardware::radio::V1_5::IndicationFilter::LINK_CAPACITY_ESTIMATE)); +static_assert(aidl::android::hardware::radio::IndicationFilter::PHYSICAL_CHANNEL_CONFIG == + static_cast( + ::android::hardware::radio::V1_5::IndicationFilter::PHYSICAL_CHANNEL_CONFIG)); +static_assert(aidl::android::hardware::radio::IndicationFilter::REGISTRATION_FAILURE == + static_cast( + ::android::hardware::radio::V1_5::IndicationFilter::REGISTRATION_FAILURE)); +static_assert(aidl::android::hardware::radio::IndicationFilter::BARRING_INFO == + static_cast( + ::android::hardware::radio::V1_5::IndicationFilter::BARRING_INFO)); + +static_assert(aidl::android::hardware::radio::RegistrationFailCause::NONE == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::NONE)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::IMSI_UNKNOWN_IN_HLR == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::IMSI_UNKNOWN_IN_HLR)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::ILLEGAL_MS == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::ILLEGAL_MS)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::IMSI_UNKNOWN_IN_VLR == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::IMSI_UNKNOWN_IN_VLR)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::IMEI_NOT_ACCEPTED == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::IMEI_NOT_ACCEPTED)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::ILLEGAL_ME == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::ILLEGAL_ME)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::GPRS_SERVICES_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + GPRS_SERVICES_NOT_ALLOWED)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause:: + GPRS_AND_NON_GPRS_SERVICES_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + GPRS_AND_NON_GPRS_SERVICES_NOT_ALLOWED)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause:: + MS_IDENTITY_CANNOT_BE_DERIVED_BY_NETWORK == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + MS_IDENTITY_CANNOT_BE_DERIVED_BY_NETWORK)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::IMPLICITLY_DETACHED == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::IMPLICITLY_DETACHED)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::PLMN_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::PLMN_NOT_ALLOWED)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::LOCATION_AREA_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + LOCATION_AREA_NOT_ALLOWED)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::ROAMING_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::ROAMING_NOT_ALLOWED)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::GPRS_SERVICES_NOT_ALLOWED_IN_PLMN == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + GPRS_SERVICES_NOT_ALLOWED_IN_PLMN)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::NO_SUITABLE_CELLS == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::NO_SUITABLE_CELLS)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::MSC_TEMPORARILY_NOT_REACHABLE == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + MSC_TEMPORARILY_NOT_REACHABLE)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::NETWORK_FAILURE == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::NETWORK_FAILURE)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::MAC_FAILURE == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::MAC_FAILURE)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::SYNC_FAILURE == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::SYNC_FAILURE)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::CONGESTION == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::CONGESTION)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::GSM_AUTHENTICATION_UNACCEPTABLE == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + GSM_AUTHENTICATION_UNACCEPTABLE)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::NOT_AUTHORIZED_FOR_THIS_CSG == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + NOT_AUTHORIZED_FOR_THIS_CSG)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause:: + SMS_PROVIDED_BY_GPRS_IN_ROUTING_AREA == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + SMS_PROVIDED_BY_GPRS_IN_ROUTING_AREA)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::SERVICE_OPTION_NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + SERVICE_OPTION_NOT_SUPPORTED)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::SERVICE_OPTION_NOT_SUBSCRIBED == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + SERVICE_OPTION_NOT_SUBSCRIBED)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause:: + SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::CALL_CANNOT_BE_IDENTIFIED == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + CALL_CANNOT_BE_IDENTIFIED)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::NO_PDP_CONTEXT_ACTIVATED == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::NO_PDP_CONTEXT_ACTIVATED)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_1 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_1)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_2 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_2)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_3 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_3)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_4 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_4)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_5 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_5)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_6 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_6)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_7 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_7)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_8 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_8)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_9 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_9)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_10 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_10)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_11 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_11)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_12 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_12)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_13 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_13)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_14 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_14)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_15 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_15)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_16 == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + RETRY_UPON_ENTRY_INTO_NEW_CELL_16)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::SEMANTICALLY_INCORRECT_MESSAGE == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + SEMANTICALLY_INCORRECT_MESSAGE)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::INVALID_MANDATORY_INFORMATION == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + INVALID_MANDATORY_INFORMATION)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause:: + MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause:: + MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause:: + INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED)); +static_assert( + aidl::android::hardware::radio::RegistrationFailCause::CONDITIONAL_IE_ERROR == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause::CONDITIONAL_IE_ERROR)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause:: + MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE)); +static_assert(aidl::android::hardware::radio::RegistrationFailCause::PROTOCOL_ERROR_UNSPECIFIED == + static_cast( + ::android::hardware::radio::V1_5::RegistrationFailCause:: + PROTOCOL_ERROR_UNSPECIFIED)); + +static_assert(aidl::android::hardware::radio::PrlIndicator::NOT_REGISTERED == + static_cast( + ::android::hardware::radio::V1_5::PrlIndicator::NOT_REGISTERED)); +static_assert(aidl::android::hardware::radio::PrlIndicator::NOT_IN_PRL == + static_cast( + ::android::hardware::radio::V1_5::PrlIndicator::NOT_IN_PRL)); +static_assert(aidl::android::hardware::radio::PrlIndicator::IN_PRL == + static_cast( + ::android::hardware::radio::V1_5::PrlIndicator::IN_PRL)); + +static_assert(aidl::android::hardware::radio::PersoSubstate::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::UNKNOWN)); +static_assert(aidl::android::hardware::radio::PersoSubstate::IN_PROGRESS == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::IN_PROGRESS)); +static_assert(aidl::android::hardware::radio::PersoSubstate::READY == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::READY)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_NETWORK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_NETWORK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_NETWORK_SUBSET == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_NETWORK_SUBSET)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_CORPORATE == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_CORPORATE)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SERVICE_PROVIDER == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_SERVICE_PROVIDER)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SIM == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_SIM)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_NETWORK_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_NETWORK_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_NETWORK_SUBSET_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_NETWORK_SUBSET_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_CORPORATE_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_CORPORATE_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SERVICE_PROVIDER_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_SERVICE_PROVIDER_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SIM_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_SIM_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_NETWORK1 == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::RUIM_NETWORK1)); +static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_NETWORK2 == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::RUIM_NETWORK2)); +static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_HRPD == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::RUIM_HRPD)); +static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_CORPORATE == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::RUIM_CORPORATE)); +static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_SERVICE_PROVIDER == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::RUIM_SERVICE_PROVIDER)); +static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_RUIM == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::RUIM_RUIM)); +static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_NETWORK1_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::RUIM_NETWORK1_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_NETWORK2_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::RUIM_NETWORK2_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_HRPD_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::RUIM_HRPD_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_CORPORATE_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::RUIM_CORPORATE_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_SERVICE_PROVIDER_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::RUIM_SERVICE_PROVIDER_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_RUIM_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::RUIM_RUIM_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SPN == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_SPN)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SPN_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_SPN_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SP_EHPLMN == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_SP_EHPLMN)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SP_EHPLMN_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_SP_EHPLMN_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_ICCID == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_ICCID)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_ICCID_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_ICCID_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_IMPI == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_IMPI)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_IMPI_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_IMPI_PUK)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_NS_SP == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_NS_SP)); +static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_NS_SP_PUK == + static_cast( + ::android::hardware::radio::V1_5::PersoSubstate::SIM_NS_SP_PUK)); + +static_assert(aidl::android::hardware::radio::QosFlowIdRange::MIN == + static_cast( + ::android::hardware::radio::V1_6::QosFlowIdRange::MIN)); +static_assert(aidl::android::hardware::radio::QosFlowIdRange::MAX == + static_cast( + ::android::hardware::radio::V1_6::QosFlowIdRange::MAX)); + +static_assert(aidl::android::hardware::radio::QosProtocol::UNSPECIFIED == + static_cast( + ::android::hardware::radio::V1_6::QosProtocol::UNSPECIFIED)); +static_assert(aidl::android::hardware::radio::QosProtocol::TCP == + static_cast( + ::android::hardware::radio::V1_6::QosProtocol::TCP)); +static_assert(aidl::android::hardware::radio::QosProtocol::UDP == + static_cast( + ::android::hardware::radio::V1_6::QosProtocol::UDP)); +static_assert(aidl::android::hardware::radio::QosProtocol::ESP == + static_cast( + ::android::hardware::radio::V1_6::QosProtocol::ESP)); +static_assert(aidl::android::hardware::radio::QosProtocol::AH == + static_cast( + ::android::hardware::radio::V1_6::QosProtocol::AH)); + +static_assert(aidl::android::hardware::radio::QosFilterDirection::DOWNLINK == + static_cast( + ::android::hardware::radio::V1_6::QosFilterDirection::DOWNLINK)); +static_assert(aidl::android::hardware::radio::QosFilterDirection::UPLINK == + static_cast( + ::android::hardware::radio::V1_6::QosFilterDirection::UPLINK)); +static_assert(aidl::android::hardware::radio::QosFilterDirection::BIDIRECTIONAL == + static_cast( + ::android::hardware::radio::V1_6::QosFilterDirection::BIDIRECTIONAL)); + +static_assert(aidl::android::hardware::radio::QosPortRange::MIN == + static_cast( + ::android::hardware::radio::V1_6::QosPortRange::MIN)); +static_assert(aidl::android::hardware::radio::QosPortRange::MAX == + static_cast( + ::android::hardware::radio::V1_6::QosPortRange::MAX)); + +static_assert(aidl::android::hardware::radio::RadioError::NONE == + static_cast( + ::android::hardware::radio::V1_6::RadioError::NONE)); +static_assert(aidl::android::hardware::radio::RadioError::RADIO_NOT_AVAILABLE == + static_cast( + ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE)); +static_assert(aidl::android::hardware::radio::RadioError::GENERIC_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::RadioError::GENERIC_FAILURE)); +static_assert(aidl::android::hardware::radio::RadioError::PASSWORD_INCORRECT == + static_cast( + ::android::hardware::radio::V1_6::RadioError::PASSWORD_INCORRECT)); +static_assert(aidl::android::hardware::radio::RadioError::SIM_PIN2 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::SIM_PIN2)); +static_assert(aidl::android::hardware::radio::RadioError::SIM_PUK2 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::SIM_PUK2)); +static_assert(aidl::android::hardware::radio::RadioError::REQUEST_NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED)); +static_assert(aidl::android::hardware::radio::RadioError::CANCELLED == + static_cast( + ::android::hardware::radio::V1_6::RadioError::CANCELLED)); +static_assert( + aidl::android::hardware::radio::RadioError::OP_NOT_ALLOWED_DURING_VOICE_CALL == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_DURING_VOICE_CALL)); +static_assert( + aidl::android::hardware::radio::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW)); +static_assert(aidl::android::hardware::radio::RadioError::SMS_SEND_FAIL_RETRY == + static_cast( + ::android::hardware::radio::V1_6::RadioError::SMS_SEND_FAIL_RETRY)); +static_assert(aidl::android::hardware::radio::RadioError::SIM_ABSENT == + static_cast( + ::android::hardware::radio::V1_6::RadioError::SIM_ABSENT)); +static_assert(aidl::android::hardware::radio::RadioError::SUBSCRIPTION_NOT_AVAILABLE == + static_cast( + ::android::hardware::radio::V1_6::RadioError::SUBSCRIPTION_NOT_AVAILABLE)); +static_assert(aidl::android::hardware::radio::RadioError::MODE_NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_6::RadioError::MODE_NOT_SUPPORTED)); +static_assert(aidl::android::hardware::radio::RadioError::FDN_CHECK_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::RadioError::FDN_CHECK_FAILURE)); +static_assert(aidl::android::hardware::radio::RadioError::ILLEGAL_SIM_OR_ME == + static_cast( + ::android::hardware::radio::V1_6::RadioError::ILLEGAL_SIM_OR_ME)); +static_assert(aidl::android::hardware::radio::RadioError::MISSING_RESOURCE == + static_cast( + ::android::hardware::radio::V1_6::RadioError::MISSING_RESOURCE)); +static_assert(aidl::android::hardware::radio::RadioError::NO_SUCH_ELEMENT == + static_cast( + ::android::hardware::radio::V1_6::RadioError::NO_SUCH_ELEMENT)); +static_assert(aidl::android::hardware::radio::RadioError::DIAL_MODIFIED_TO_USSD == + static_cast( + ::android::hardware::radio::V1_6::RadioError::DIAL_MODIFIED_TO_USSD)); +static_assert(aidl::android::hardware::radio::RadioError::DIAL_MODIFIED_TO_SS == + static_cast( + ::android::hardware::radio::V1_6::RadioError::DIAL_MODIFIED_TO_SS)); +static_assert(aidl::android::hardware::radio::RadioError::DIAL_MODIFIED_TO_DIAL == + static_cast( + ::android::hardware::radio::V1_6::RadioError::DIAL_MODIFIED_TO_DIAL)); +static_assert(aidl::android::hardware::radio::RadioError::USSD_MODIFIED_TO_DIAL == + static_cast( + ::android::hardware::radio::V1_6::RadioError::USSD_MODIFIED_TO_DIAL)); +static_assert(aidl::android::hardware::radio::RadioError::USSD_MODIFIED_TO_SS == + static_cast( + ::android::hardware::radio::V1_6::RadioError::USSD_MODIFIED_TO_SS)); +static_assert(aidl::android::hardware::radio::RadioError::USSD_MODIFIED_TO_USSD == + static_cast( + ::android::hardware::radio::V1_6::RadioError::USSD_MODIFIED_TO_USSD)); +static_assert(aidl::android::hardware::radio::RadioError::SS_MODIFIED_TO_DIAL == + static_cast( + ::android::hardware::radio::V1_6::RadioError::SS_MODIFIED_TO_DIAL)); +static_assert(aidl::android::hardware::radio::RadioError::SS_MODIFIED_TO_USSD == + static_cast( + ::android::hardware::radio::V1_6::RadioError::SS_MODIFIED_TO_USSD)); +static_assert(aidl::android::hardware::radio::RadioError::SUBSCRIPTION_NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_6::RadioError::SUBSCRIPTION_NOT_SUPPORTED)); +static_assert(aidl::android::hardware::radio::RadioError::SS_MODIFIED_TO_SS == + static_cast( + ::android::hardware::radio::V1_6::RadioError::SS_MODIFIED_TO_SS)); +static_assert(aidl::android::hardware::radio::RadioError::LCE_NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_6::RadioError::LCE_NOT_SUPPORTED)); +static_assert(aidl::android::hardware::radio::RadioError::NO_MEMORY == + static_cast( + ::android::hardware::radio::V1_6::RadioError::NO_MEMORY)); +static_assert(aidl::android::hardware::radio::RadioError::INTERNAL_ERR == + static_cast( + ::android::hardware::radio::V1_6::RadioError::INTERNAL_ERR)); +static_assert(aidl::android::hardware::radio::RadioError::SYSTEM_ERR == + static_cast( + ::android::hardware::radio::V1_6::RadioError::SYSTEM_ERR)); +static_assert(aidl::android::hardware::radio::RadioError::MODEM_ERR == + static_cast( + ::android::hardware::radio::V1_6::RadioError::MODEM_ERR)); +static_assert(aidl::android::hardware::radio::RadioError::INVALID_STATE == + static_cast( + ::android::hardware::radio::V1_6::RadioError::INVALID_STATE)); +static_assert(aidl::android::hardware::radio::RadioError::NO_RESOURCES == + static_cast( + ::android::hardware::radio::V1_6::RadioError::NO_RESOURCES)); +static_assert(aidl::android::hardware::radio::RadioError::SIM_ERR == + static_cast( + ::android::hardware::radio::V1_6::RadioError::SIM_ERR)); +static_assert(aidl::android::hardware::radio::RadioError::INVALID_ARGUMENTS == + static_cast( + ::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS)); +static_assert(aidl::android::hardware::radio::RadioError::INVALID_SIM_STATE == + static_cast( + ::android::hardware::radio::V1_6::RadioError::INVALID_SIM_STATE)); +static_assert(aidl::android::hardware::radio::RadioError::INVALID_MODEM_STATE == + static_cast( + ::android::hardware::radio::V1_6::RadioError::INVALID_MODEM_STATE)); +static_assert(aidl::android::hardware::radio::RadioError::INVALID_CALL_ID == + static_cast( + ::android::hardware::radio::V1_6::RadioError::INVALID_CALL_ID)); +static_assert(aidl::android::hardware::radio::RadioError::NO_SMS_TO_ACK == + static_cast( + ::android::hardware::radio::V1_6::RadioError::NO_SMS_TO_ACK)); +static_assert(aidl::android::hardware::radio::RadioError::NETWORK_ERR == + static_cast( + ::android::hardware::radio::V1_6::RadioError::NETWORK_ERR)); +static_assert(aidl::android::hardware::radio::RadioError::REQUEST_RATE_LIMITED == + static_cast( + ::android::hardware::radio::V1_6::RadioError::REQUEST_RATE_LIMITED)); +static_assert(aidl::android::hardware::radio::RadioError::SIM_BUSY == + static_cast( + ::android::hardware::radio::V1_6::RadioError::SIM_BUSY)); +static_assert(aidl::android::hardware::radio::RadioError::SIM_FULL == + static_cast( + ::android::hardware::radio::V1_6::RadioError::SIM_FULL)); +static_assert(aidl::android::hardware::radio::RadioError::NETWORK_REJECT == + static_cast( + ::android::hardware::radio::V1_6::RadioError::NETWORK_REJECT)); +static_assert(aidl::android::hardware::radio::RadioError::OPERATION_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OPERATION_NOT_ALLOWED)); +static_assert(aidl::android::hardware::radio::RadioError::EMPTY_RECORD == + static_cast( + ::android::hardware::radio::V1_6::RadioError::EMPTY_RECORD)); +static_assert(aidl::android::hardware::radio::RadioError::INVALID_SMS_FORMAT == + static_cast( + ::android::hardware::radio::V1_6::RadioError::INVALID_SMS_FORMAT)); +static_assert(aidl::android::hardware::radio::RadioError::ENCODING_ERR == + static_cast( + ::android::hardware::radio::V1_6::RadioError::ENCODING_ERR)); +static_assert(aidl::android::hardware::radio::RadioError::INVALID_SMSC_ADDRESS == + static_cast( + ::android::hardware::radio::V1_6::RadioError::INVALID_SMSC_ADDRESS)); +static_assert(aidl::android::hardware::radio::RadioError::NO_SUCH_ENTRY == + static_cast( + ::android::hardware::radio::V1_6::RadioError::NO_SUCH_ENTRY)); +static_assert(aidl::android::hardware::radio::RadioError::NETWORK_NOT_READY == + static_cast( + ::android::hardware::radio::V1_6::RadioError::NETWORK_NOT_READY)); +static_assert(aidl::android::hardware::radio::RadioError::NOT_PROVISIONED == + static_cast( + ::android::hardware::radio::V1_6::RadioError::NOT_PROVISIONED)); +static_assert(aidl::android::hardware::radio::RadioError::NO_SUBSCRIPTION == + static_cast( + ::android::hardware::radio::V1_6::RadioError::NO_SUBSCRIPTION)); +static_assert(aidl::android::hardware::radio::RadioError::NO_NETWORK_FOUND == + static_cast( + ::android::hardware::radio::V1_6::RadioError::NO_NETWORK_FOUND)); +static_assert(aidl::android::hardware::radio::RadioError::DEVICE_IN_USE == + static_cast( + ::android::hardware::radio::V1_6::RadioError::DEVICE_IN_USE)); +static_assert(aidl::android::hardware::radio::RadioError::ABORTED == + static_cast( + ::android::hardware::radio::V1_6::RadioError::ABORTED)); +static_assert(aidl::android::hardware::radio::RadioError::INVALID_RESPONSE == + static_cast( + ::android::hardware::radio::V1_6::RadioError::INVALID_RESPONSE)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_1 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_1)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_2 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_2)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_3 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_3)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_4 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_4)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_5 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_5)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_6 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_6)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_7 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_7)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_8 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_8)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_9 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_9)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_10 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_10)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_11 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_11)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_12 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_12)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_13 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_13)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_14 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_14)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_15 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_15)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_16 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_16)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_17 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_17)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_18 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_18)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_19 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_19)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_20 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_20)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_21 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_21)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_22 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_22)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_23 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_23)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_24 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_24)); +static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_25 == + static_cast( + ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_25)); +static_assert(aidl::android::hardware::radio::RadioError::SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::RadioError:: + SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED)); +static_assert(aidl::android::hardware::radio::RadioError::ACCESS_BARRED == + static_cast( + ::android::hardware::radio::V1_6::RadioError::ACCESS_BARRED)); +static_assert(aidl::android::hardware::radio::RadioError::BLOCKED_DUE_TO_CALL == + static_cast( + ::android::hardware::radio::V1_6::RadioError::BLOCKED_DUE_TO_CALL)); +static_assert(aidl::android::hardware::radio::RadioError::RF_HARDWARE_ISSUE == + static_cast( + ::android::hardware::radio::V1_6::RadioError::RF_HARDWARE_ISSUE)); +static_assert(aidl::android::hardware::radio::RadioError::NO_RF_CALIBRATION_INFO == + static_cast( + ::android::hardware::radio::V1_6::RadioError::NO_RF_CALIBRATION_INFO)); + +static_assert(aidl::android::hardware::radio::HandoverFailureMode::LEGACY == + static_cast( + ::android::hardware::radio::V1_6::HandoverFailureMode::LEGACY)); +static_assert(aidl::android::hardware::radio::HandoverFailureMode::DO_FALLBACK == + static_cast( + ::android::hardware::radio::V1_6::HandoverFailureMode::DO_FALLBACK)); +static_assert( + aidl::android::hardware::radio::HandoverFailureMode::NO_FALLBACK_RETRY_HANDOVER == + static_cast( + ::android::hardware::radio::V1_6::HandoverFailureMode::NO_FALLBACK_RETRY_HANDOVER)); +static_assert(aidl::android::hardware::radio::HandoverFailureMode::NO_FALLBACK_RETRY_SETUP_NORMAL == + static_cast( + ::android::hardware::radio::V1_6::HandoverFailureMode:: + NO_FALLBACK_RETRY_SETUP_NORMAL)); + +static_assert(aidl::android::hardware::radio::NrDualConnectivityState::ENABLE == + static_cast( + ::android::hardware::radio::V1_6::NrDualConnectivityState::ENABLE)); +static_assert(aidl::android::hardware::radio::NrDualConnectivityState::DISABLE == + static_cast( + ::android::hardware::radio::V1_6::NrDualConnectivityState::DISABLE)); +static_assert( + aidl::android::hardware::radio::NrDualConnectivityState::DISABLE_IMMEDIATE == + static_cast( + ::android::hardware::radio::V1_6::NrDualConnectivityState::DISABLE_IMMEDIATE)); + +static_assert(aidl::android::hardware::radio::DataThrottlingAction::NO_DATA_THROTTLING == + static_cast( + ::android::hardware::radio::V1_6::DataThrottlingAction::NO_DATA_THROTTLING)); +static_assert(aidl::android::hardware::radio::DataThrottlingAction::THROTTLE_SECONDARY_CARRIER == + static_cast( + ::android::hardware::radio::V1_6::DataThrottlingAction:: + THROTTLE_SECONDARY_CARRIER)); +static_assert( + aidl::android::hardware::radio::DataThrottlingAction::THROTTLE_ANCHOR_CARRIER == + static_cast( + ::android::hardware::radio::V1_6::DataThrottlingAction::THROTTLE_ANCHOR_CARRIER)); +static_assert(aidl::android::hardware::radio::DataThrottlingAction::HOLD == + static_cast( + ::android::hardware::radio::V1_6::DataThrottlingAction::HOLD)); + +static_assert(aidl::android::hardware::radio::VopsIndicator::VOPS_NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_6::VopsIndicator::VOPS_NOT_SUPPORTED)); +static_assert(aidl::android::hardware::radio::VopsIndicator::VOPS_OVER_3GPP == + static_cast( + ::android::hardware::radio::V1_6::VopsIndicator::VOPS_OVER_3GPP)); +static_assert(aidl::android::hardware::radio::VopsIndicator::VOPS_OVER_NON_3GPP == + static_cast( + ::android::hardware::radio::V1_6::VopsIndicator::VOPS_OVER_NON_3GPP)); + +static_assert(aidl::android::hardware::radio::EmcIndicator::EMC_NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_6::EmcIndicator::EMC_NOT_SUPPORTED)); +static_assert(aidl::android::hardware::radio::EmcIndicator::EMC_NR_CONNECTED_TO_5GCN == + static_cast( + ::android::hardware::radio::V1_6::EmcIndicator::EMC_NR_CONNECTED_TO_5GCN)); +static_assert(aidl::android::hardware::radio::EmcIndicator::EMC_EUTRA_CONNECTED_TO_5GCN == + static_cast( + ::android::hardware::radio::V1_6::EmcIndicator::EMC_EUTRA_CONNECTED_TO_5GCN)); +static_assert(aidl::android::hardware::radio::EmcIndicator::EMC_BOTH_NR_EUTRA_CONNECTED_TO_5GCN == + static_cast( + ::android::hardware::radio::V1_6::EmcIndicator:: + EMC_BOTH_NR_EUTRA_CONNECTED_TO_5GCN)); + +static_assert(aidl::android::hardware::radio::EmfIndicator::EMF_NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_6::EmfIndicator::EMF_NOT_SUPPORTED)); +static_assert(aidl::android::hardware::radio::EmfIndicator::EMF_NR_CONNECTED_TO_5GCN == + static_cast( + ::android::hardware::radio::V1_6::EmfIndicator::EMF_NR_CONNECTED_TO_5GCN)); +static_assert(aidl::android::hardware::radio::EmfIndicator::EMF_EUTRA_CONNECTED_TO_5GCN == + static_cast( + ::android::hardware::radio::V1_6::EmfIndicator::EMF_EUTRA_CONNECTED_TO_5GCN)); +static_assert(aidl::android::hardware::radio::EmfIndicator::EMF_BOTH_NR_EUTRA_CONNECTED_TO_5GCN == + static_cast( + ::android::hardware::radio::V1_6::EmfIndicator:: + EMF_BOTH_NR_EUTRA_CONNECTED_TO_5GCN)); + +static_assert(aidl::android::hardware::radio::NgranBands::BAND_1 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_1)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_2 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_2)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_3 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_3)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_5 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_5)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_7 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_7)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_8 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_8)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_12 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_12)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_14 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_14)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_18 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_18)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_20 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_20)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_25 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_25)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_28 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_28)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_29 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_29)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_30 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_30)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_34 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_34)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_38 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_38)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_39 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_39)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_40 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_40)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_41 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_41)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_48 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_48)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_50 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_50)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_51 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_51)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_65 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_65)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_66 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_66)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_70 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_70)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_71 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_71)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_74 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_74)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_75 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_75)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_76 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_76)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_77 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_77)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_78 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_78)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_79 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_79)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_80 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_80)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_81 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_81)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_82 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_82)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_83 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_83)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_84 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_84)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_86 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_86)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_89 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_89)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_90 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_90)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_91 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_91)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_92 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_92)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_93 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_93)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_94 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_94)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_95 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_95)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_257 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_257)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_258 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_258)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_260 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_260)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_261 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_261)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_26 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_26)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_46 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_46)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_53 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_53)); +static_assert(aidl::android::hardware::radio::NgranBands::BAND_96 == + static_cast( + ::android::hardware::radio::V1_6::NgranBands::BAND_96)); + +static_assert(aidl::android::hardware::radio::SliceServiceType::NONE == + static_cast( + ::android::hardware::radio::V1_6::SliceServiceType::NONE)); +static_assert(aidl::android::hardware::radio::SliceServiceType::EMBB == + static_cast( + ::android::hardware::radio::V1_6::SliceServiceType::EMBB)); +static_assert(aidl::android::hardware::radio::SliceServiceType::URLLC == + static_cast( + ::android::hardware::radio::V1_6::SliceServiceType::URLLC)); +static_assert(aidl::android::hardware::radio::SliceServiceType::MIOT == + static_cast( + ::android::hardware::radio::V1_6::SliceServiceType::MIOT)); + +static_assert(aidl::android::hardware::radio::DataCallFailCause::NONE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NONE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OPERATOR_BARRED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OPERATOR_BARRED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NAS_SIGNALLING == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NAS_SIGNALLING)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::INSUFFICIENT_RESOURCES == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::INSUFFICIENT_RESOURCES)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MISSING_UNKNOWN_APN == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MISSING_UKNOWN_APN)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::UNKNOWN_PDP_ADDRESS_TYPE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::UNKNOWN_PDP_ADDRESS_TYPE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::USER_AUTHENTICATION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::USER_AUTHENTICATION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ACTIVATION_REJECT_GGSN == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ACTIVATION_REJECT_GGSN)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ACTIVATION_REJECT_UNSPECIFIED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + ACTIVATION_REJECT_UNSPECIFIED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::SERVICE_OPTION_NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::SERVICE_OPTION_NOT_SUPPORTED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::SERVICE_OPTION_NOT_SUBSCRIBED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + SERVICE_OPTION_NOT_SUBSCRIBED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::SERVICE_OPTION_OUT_OF_ORDER == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::SERVICE_OPTION_OUT_OF_ORDER)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NSAPI_IN_USE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NSAPI_IN_USE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::REGULAR_DEACTIVATION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::REGULAR_DEACTIVATION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::QOS_NOT_ACCEPTED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::QOS_NOT_ACCEPTED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NETWORK_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NETWORK_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::UMTS_REACTIVATION_REQ == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::UMTS_REACTIVATION_REQ)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::FEATURE_NOT_SUPP == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::FEATURE_NOT_SUPP)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::TFT_SEMANTIC_ERROR == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::TFT_SEMANTIC_ERROR)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::TFT_SYTAX_ERROR == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::TFT_SYTAX_ERROR)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::UNKNOWN_PDP_CONTEXT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::UNKNOWN_PDP_CONTEXT)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::FILTER_SEMANTIC_ERROR == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::FILTER_SEMANTIC_ERROR)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::FILTER_SYTAX_ERROR == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::FILTER_SYTAX_ERROR)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PDP_WITHOUT_ACTIVE_TFT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDP_WITHOUT_ACTIVE_TFT)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ONLY_IPV4_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ONLY_IPV4_ALLOWED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ONLY_IPV6_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ONLY_IPV6_ALLOWED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::ONLY_SINGLE_BEARER_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ONLY_SINGLE_BEARER_ALLOWED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ESM_INFO_NOT_RECEIVED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ESM_INFO_NOT_RECEIVED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::PDN_CONN_DOES_NOT_EXIST == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDN_CONN_DOES_NOT_EXIST)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MAX_ACTIVE_PDP_CONTEXT_REACHED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MAX_ACTIVE_PDP_CONTEXT_REACHED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::UNSUPPORTED_APN_IN_CURRENT_PLMN == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + UNSUPPORTED_APN_IN_CURRENT_PLMN)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_TRANSACTION_ID == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_TRANSACTION_ID)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MESSAGE_INCORRECT_SEMANTIC == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MESSAGE_INCORRECT_SEMANTIC)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_MANDATORY_INFO == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_MANDATORY_INFO)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MESSAGE_TYPE_UNSUPPORTED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MESSAGE_TYPE_UNSUPPORTED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MSG_TYPE_NONCOMPATIBLE_STATE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MSG_TYPE_NONCOMPATIBLE_STATE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::UNKNOWN_INFO_ELEMENT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::UNKNOWN_INFO_ELEMENT)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::CONDITIONAL_IE_ERROR == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::CONDITIONAL_IE_ERROR)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PROTOCOL_ERRORS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PROTOCOL_ERRORS)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::APN_TYPE_CONFLICT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::APN_TYPE_CONFLICT)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_PCSCF_ADDR == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_PCSCF_ADDR)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EMM_ACCESS_BARRED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::EMM_ACCESS_BARRED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EMERGENCY_IFACE_ONLY == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::EMERGENCY_IFACE_ONLY)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::IFACE_MISMATCH == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::IFACE_MISMATCH)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::COMPANION_IFACE_IN_USE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::COMPANION_IFACE_IN_USE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::IP_ADDRESS_MISMATCH == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::IP_ADDRESS_MISMATCH)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::IFACE_AND_POL_FAMILY_MISMATCH == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + IFACE_AND_POL_FAMILY_MISMATCH)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EMM_ACCESS_BARRED_INFINITE_RETRY == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + EMM_ACCESS_BARRED_INFINITE_RETRY)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::AUTH_FAILURE_ON_EMERGENCY_CALL == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + AUTH_FAILURE_ON_EMERGENCY_CALL)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_1 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_1)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_2 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_2)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_3 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_3)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_4 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_4)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_5 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_5)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_6 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_6)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_7 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_7)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_8 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_8)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_9 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_9)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_10 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_10)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_11 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_11)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_12 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_12)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_13 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_13)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_14 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_14)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_15 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_15)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::VOICE_REGISTRATION_FAIL == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::VOICE_REGISTRATION_FAIL)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::DATA_REGISTRATION_FAIL == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::DATA_REGISTRATION_FAIL)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::SIGNAL_LOST == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::SIGNAL_LOST)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::PREF_RADIO_TECH_CHANGED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PREF_RADIO_TECH_CHANGED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::RADIO_POWER_OFF == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::RADIO_POWER_OFF)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::TETHERED_CALL_ACTIVE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::TETHERED_CALL_ACTIVE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ERROR_UNSPECIFIED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ERROR_UNSPECIFIED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::LLC_SNDCP == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::LLC_SNDCP)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::ACTIVATION_REJECTED_BCM_VIOLATION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + ACTIVATION_REJECTED_BCM_VIOLATION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + COLLISION_WITH_NETWORK_INITIATED_REQUEST == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + COLLISION_WITH_NETWORK_INITIATED_REQUEST)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ONLY_IPV4V6_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ONLY_IPV4V6_ALLOWED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ONLY_NON_IP_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ONLY_NON_IP_ALLOWED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::UNSUPPORTED_QCI_VALUE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::UNSUPPORTED_QCI_VALUE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::BEARER_HANDLING_NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + BEARER_HANDLING_NOT_SUPPORTED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_DNS_ADDR == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_DNS_ADDR)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::INVALID_PCSCF_OR_DNS_ADDRESS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_PCSCF_OR_DNS_ADDRESS)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::CALL_PREEMPT_BY_EMERGENCY_APN == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + CALL_PREEMPT_BY_EMERGENCY_APN)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::UE_INITIATED_DETACH_OR_DISCONNECT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + UE_INITIATED_DETACH_OR_DISCONNECT)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_FA_REASON_UNSPECIFIED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_REASON_UNSPECIFIED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_FA_ADMIN_PROHIBITED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_ADMIN_PROHIBITED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_FA_INSUFFICIENT_RESOURCES == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_FA_INSUFFICIENT_RESOURCES)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_FA_REQUESTED_LIFETIME_TOO_LONG == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_FA_REQUESTED_LIFETIME_TOO_LONG)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_FA_MALFORMED_REQUEST == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_MALFORMED_REQUEST)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_FA_MALFORMED_REPLY == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_MALFORMED_REPLY)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_FA_ENCAPSULATION_UNAVAILABLE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_FA_ENCAPSULATION_UNAVAILABLE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_FA_REVERSE_TUNNEL_UNAVAILABLE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_FA_REVERSE_TUNNEL_UNAVAILABLE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_FA_REVERSE_TUNNEL_IS_MANDATORY == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_FA_REVERSE_TUNNEL_IS_MANDATORY)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_FA_MISSING_NAI == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_MISSING_NAI)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_FA_MISSING_HOME_AGENT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_MISSING_HOME_AGENT)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_FA_MISSING_HOME_ADDRESS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_MISSING_HOME_ADDRESS)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_FA_UNKNOWN_CHALLENGE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_UNKNOWN_CHALLENGE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_FA_MISSING_CHALLENGE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_MISSING_CHALLENGE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_FA_STALE_CHALLENGE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_STALE_CHALLENGE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_HA_REASON_UNSPECIFIED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MIP_HA_REASON_UNSPECIFIED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_HA_ADMIN_PROHIBITED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MIP_HA_ADMIN_PROHIBITED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_HA_INSUFFICIENT_RESOURCES == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_HA_INSUFFICIENT_RESOURCES)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_HA_REGISTRATION_ID_MISMATCH == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_HA_REGISTRATION_ID_MISMATCH)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_HA_MALFORMED_REQUEST == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MIP_HA_MALFORMED_REQUEST)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_HA_REVERSE_TUNNEL_UNAVAILABLE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_HA_REVERSE_TUNNEL_UNAVAILABLE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MIP_HA_REVERSE_TUNNEL_IS_MANDATORY == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_HA_REVERSE_TUNNEL_IS_MANDATORY)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_HA_ENCAPSULATION_UNAVAILABLE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MIP_HA_ENCAPSULATION_UNAVAILABLE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::CLOSE_IN_PROGRESS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::CLOSE_IN_PROGRESS)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NETWORK_INITIATED_TERMINATION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + NETWORK_INITIATED_TERMINATION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MODEM_APP_PREEMPTED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MODEM_APP_PREEMPTED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::PDN_IPV4_CALL_DISALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDN_IPV4_CALL_DISALLOWED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::PDN_IPV4_CALL_THROTTLED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDN_IPV4_CALL_THROTTLED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::PDN_IPV6_CALL_DISALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDN_IPV6_CALL_DISALLOWED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::PDN_IPV6_CALL_THROTTLED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDN_IPV6_CALL_THROTTLED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MODEM_RESTART == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MODEM_RESTART)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PDP_PPP_NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDP_PPP_NOT_SUPPORTED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::UNPREFERRED_RAT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::UNPREFERRED_RAT)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PHYSICAL_LINK_CLOSE_IN_PROGRESS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + PHYSICAL_LINK_CLOSE_IN_PROGRESS)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::APN_PENDING_HANDOVER == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::APN_PENDING_HANDOVER)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::PROFILE_BEARER_INCOMPATIBLE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PROFILE_BEARER_INCOMPATIBLE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::SIM_CARD_CHANGED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::SIM_CARD_CHANGED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::LOW_POWER_MODE_OR_POWERING_DOWN == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + LOW_POWER_MODE_OR_POWERING_DOWN)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::APN_DISABLED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::APN_DISABLED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MAX_PPP_INACTIVITY_TIMER_EXPIRED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MAX_PPP_INACTIVITY_TIMER_EXPIRED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::IPV6_ADDRESS_TRANSFER_FAILED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::IPV6_ADDRESS_TRANSFER_FAILED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::TRAT_SWAP_FAILED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::TRAT_SWAP_FAILED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EHRPD_TO_HRPD_FALLBACK == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::EHRPD_TO_HRPD_FALLBACK)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_CONFIG_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MIP_CONFIG_FAILURE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::PDN_INACTIVITY_TIMER_EXPIRED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDN_INACTIVITY_TIMER_EXPIRED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MAX_IPV4_CONNECTIONS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MAX_IPV4_CONNECTIONS)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MAX_IPV6_CONNECTIONS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MAX_IPV6_CONNECTIONS)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::APN_MISMATCH == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::APN_MISMATCH)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::IP_VERSION_MISMATCH == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::IP_VERSION_MISMATCH)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::DUN_CALL_DISALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::DUN_CALL_DISALLOWED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::INTERNAL_EPC_NONEPC_TRANSITION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + INTERNAL_EPC_NONEPC_TRANSITION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::INTERFACE_IN_USE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::INTERFACE_IN_USE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::APN_DISALLOWED_ON_ROAMING == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::APN_DISALLOWED_ON_ROAMING)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::APN_PARAMETERS_CHANGED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::APN_PARAMETERS_CHANGED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NULL_APN_DISALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NULL_APN_DISALLOWED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::THERMAL_MITIGATION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::THERMAL_MITIGATION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::DATA_SETTINGS_DISABLED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::DATA_SETTINGS_DISABLED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::DATA_ROAMING_SETTINGS_DISABLED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + DATA_ROAMING_SETTINGS_DISABLED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::DDS_SWITCHED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::DDS_SWITCHED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::FORBIDDEN_APN_NAME == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::FORBIDDEN_APN_NAME)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::DDS_SWITCH_IN_PROGRESS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::DDS_SWITCH_IN_PROGRESS)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::CALL_DISALLOWED_IN_ROAMING == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::CALL_DISALLOWED_IN_ROAMING)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NON_IP_NOT_SUPPORTED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NON_IP_NOT_SUPPORTED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::PDN_NON_IP_CALL_THROTTLED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDN_NON_IP_CALL_THROTTLED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::PDN_NON_IP_CALL_DISALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDN_NON_IP_CALL_DISALLOWED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::CDMA_LOCK == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::CDMA_LOCK)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::CDMA_INTERCEPT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::CDMA_INTERCEPT)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::CDMA_REORDER == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::CDMA_REORDER)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::CDMA_RELEASE_DUE_TO_SO_REJECTION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + CDMA_RELEASE_DUE_TO_SO_REJECTION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::CDMA_INCOMING_CALL == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::CDMA_INCOMING_CALL)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::CDMA_ALERT_STOP == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::CDMA_ALERT_STOP)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::CHANNEL_ACQUISITION_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::CHANNEL_ACQUISITION_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MAX_ACCESS_PROBE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MAX_ACCESS_PROBE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_RESPONSE_FROM_BASE_STATION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + NO_RESPONSE_FROM_BASE_STATION)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::REJECTED_BY_BASE_STATION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::REJECTED_BY_BASE_STATION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::CONCURRENT_SERVICES_INCOMPATIBLE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + CONCURRENT_SERVICES_INCOMPATIBLE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_CDMA_SERVICE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NO_CDMA_SERVICE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::RUIM_NOT_PRESENT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::RUIM_NOT_PRESENT)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::CDMA_RETRY_ORDER == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::CDMA_RETRY_ORDER)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ACCESS_BLOCK == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ACCESS_BLOCK)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ACCESS_BLOCK_ALL == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ACCESS_BLOCK_ALL)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::IS707B_MAX_ACCESS_PROBES == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::IS707B_MAX_ACCESS_PROBES)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::THERMAL_EMERGENCY == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::THERMAL_EMERGENCY)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::CONCURRENT_SERVICES_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + CONCURRENT_SERVICES_NOT_ALLOWED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::INCOMING_CALL_REJECTED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::INCOMING_CALL_REJECTED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_SERVICE_ON_GATEWAY == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NO_SERVICE_ON_GATEWAY)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_GPRS_CONTEXT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NO_GPRS_CONTEXT)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ILLEGAL_MS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ILLEGAL_MS)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ILLEGAL_ME == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ILLEGAL_ME)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::GPRS_SERVICES_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::GPRS_SERVICES_NOT_ALLOWED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::IMPLICITLY_DETACHED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::IMPLICITLY_DETACHED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PLMN_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PLMN_NOT_ALLOWED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::LOCATION_AREA_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::LOCATION_AREA_NOT_ALLOWED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PDP_DUPLICATE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDP_DUPLICATE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::UE_RAT_CHANGE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::UE_RAT_CHANGE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::CONGESTION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::CONGESTION)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::NO_PDP_CONTEXT_ACTIVATED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NO_PDP_CONTEXT_ACTIVATED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::ACCESS_CLASS_DSAC_REJECTION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ACCESS_CLASS_DSAC_REJECTION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PDP_ACTIVATE_MAX_RETRY_FAILED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + PDP_ACTIVATE_MAX_RETRY_FAILED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::RADIO_ACCESS_BEARER_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::RADIO_ACCESS_BEARER_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ESM_UNKNOWN_EPS_BEARER_CONTEXT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + ESM_UNKNOWN_EPS_BEARER_CONTEXT)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::DRB_RELEASED_BY_RRC == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::DRB_RELEASED_BY_RRC)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::CONNECTION_RELEASED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::CONNECTION_RELEASED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EMM_DETACHED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::EMM_DETACHED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EMM_ATTACH_FAILED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::EMM_ATTACH_FAILED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EMM_ATTACH_STARTED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::EMM_ATTACH_STARTED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::LTE_NAS_SERVICE_REQUEST_FAILED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + LTE_NAS_SERVICE_REQUEST_FAILED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::DUPLICATE_BEARER_ID == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::DUPLICATE_BEARER_ID)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::ESM_COLLISION_SCENARIOS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ESM_COLLISION_SCENARIOS)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ESM_BAD_OTA_MESSAGE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ESM_BAD_OTA_MESSAGE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::DS_EXPLICIT_DEACTIVATION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::DS_EXPLICIT_DEACTIVATION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ESM_LOCAL_CAUSE_NONE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ESM_LOCAL_CAUSE_NONE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::LTE_THROTTLING_NOT_REQUIRED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::LTE_THROTTLING_NOT_REQUIRED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::ACCESS_CONTROL_LIST_CHECK_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + ACCESS_CONTROL_LIST_CHECK_FAILURE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::SERVICE_NOT_ALLOWED_ON_PLMN == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::SERVICE_NOT_ALLOWED_ON_PLMN)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EMM_T3417_EXPIRED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::EMM_T3417_EXPIRED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EMM_T3417_EXT_EXPIRED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::EMM_T3417_EXT_EXPIRED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::RRC_UPLINK_DATA_TRANSMISSION_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_UPLINK_DATA_TRANSMISSION_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_UPLINK_CONNECTION_RELEASE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_UPLINK_CONNECTION_RELEASE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_UPLINK_RADIO_LINK_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_UPLINK_RADIO_LINK_FAILURE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::RRC_UPLINK_ERROR_REQUEST_FROM_NAS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_UPLINK_ERROR_REQUEST_FROM_NAS)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_ACCESS_STRATUM_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_ACCESS_STRATUM_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_ACCESS_BARRED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::RRC_CONNECTION_ACCESS_BARRED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_CELL_RESELECTION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_CELL_RESELECTION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_CONFIG_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_CONFIG_FAILURE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_TIMER_EXPIRED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::RRC_CONNECTION_TIMER_EXPIRED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_LINK_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::RRC_CONNECTION_LINK_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_CELL_NOT_CAMPED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_CELL_NOT_CAMPED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_REJECT_BY_NETWORK == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_REJECT_BY_NETWORK)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_NORMAL_RELEASE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_NORMAL_RELEASE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_RADIO_LINK_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_RADIO_LINK_FAILURE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_REESTABLISHMENT_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_REESTABLISHMENT_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_ABORT_REQUEST == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::RRC_CONNECTION_ABORT_REQUEST)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ESM_PROCEDURE_TIME_OUT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ESM_PROCEDURE_TIME_OUT)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_CONNECTION_ID == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_CONNECTION_ID)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MAXIMIUM_NSAPIS_EXCEEDED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MAXIMIUM_NSAPIS_EXCEEDED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_PRIMARY_NSAPI == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_PRIMARY_NSAPI)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::CANNOT_ENCODE_OTA_MESSAGE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::CANNOT_ENCODE_OTA_MESSAGE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::RADIO_ACCESS_BEARER_SETUP_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RADIO_ACCESS_BEARER_SETUP_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PDP_ESTABLISH_TIMEOUT_EXPIRED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + PDP_ESTABLISH_TIMEOUT_EXPIRED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::PDP_MODIFY_TIMEOUT_EXPIRED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDP_MODIFY_TIMEOUT_EXPIRED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::PDP_INACTIVE_TIMEOUT_EXPIRED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDP_INACTIVE_TIMEOUT_EXPIRED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PDP_LOWERLAYER_ERROR == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDP_LOWERLAYER_ERROR)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PDP_MODIFY_COLLISION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PDP_MODIFY_COLLISION)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NAS_REQUEST_REJECTED_BY_NETWORK == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + NAS_REQUEST_REJECTED_BY_NETWORK)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_INVALID_REQUEST == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_INVALID_REQUEST)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + RRC_CONNECTION_TRACKING_AREA_ID_CHANGED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_TRACKING_AREA_ID_CHANGED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_RF_UNAVAILABLE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_RF_UNAVAILABLE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_ABORTED_AFTER_HANDOVER == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_ABORTED_AFTER_HANDOVER)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::IMEI_NOT_ACCEPTED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::IMEI_NOT_ACCEPTED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EPS_SERVICES_NOT_ALLOWED_IN_PLMN == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + EPS_SERVICES_NOT_ALLOWED_IN_PLMN)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MSC_TEMPORARILY_NOT_REACHABLE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MSC_TEMPORARILY_NOT_REACHABLE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::CS_DOMAIN_NOT_AVAILABLE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::CS_DOMAIN_NOT_AVAILABLE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::ESM_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ESM_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MAC_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MAC_FAILURE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::SYNCHRONIZATION_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::SYNCHRONIZATION_FAILURE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::UE_SECURITY_CAPABILITIES_MISMATCH == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + UE_SECURITY_CAPABILITIES_MISMATCH)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::SECURITY_MODE_REJECTED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::SECURITY_MODE_REJECTED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::UNACCEPTABLE_NON_EPS_AUTHENTICATION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + UNACCEPTABLE_NON_EPS_AUTHENTICATION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_EPS_BEARER_CONTEXT_ACTIVATED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + NO_EPS_BEARER_CONTEXT_ACTIVATED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_EMM_STATE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_EMM_STATE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NAS_LAYER_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NAS_LAYER_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::MULTIPLE_PDP_CALL_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + MULTIPLE_PDP_CALL_NOT_ALLOWED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EMBMS_NOT_ENABLED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::EMBMS_NOT_ENABLED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::IRAT_HANDOVER_FAILED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::IRAT_HANDOVER_FAILED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::EMBMS_REGULAR_DEACTIVATION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::EMBMS_REGULAR_DEACTIVATION)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::TEST_LOOPBACK_REGULAR_DEACTIVATION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + TEST_LOOPBACK_REGULAR_DEACTIVATION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::LOWER_LAYER_REGISTRATION_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + LOWER_LAYER_REGISTRATION_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::DATA_PLAN_EXPIRED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::DATA_PLAN_EXPIRED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::UMTS_HANDOVER_TO_IWLAN == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::UMTS_HANDOVER_TO_IWLAN)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY)); +static_assert(aidl::android::hardware::radio::DataCallFailCause:: + EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EVDO_HDR_CHANGED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::EVDO_HDR_CHANGED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EVDO_HDR_EXITED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::EVDO_HDR_EXITED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EVDO_HDR_NO_SESSION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::EVDO_HDR_NO_SESSION)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::EVDO_HDR_CONNECTION_SETUP_TIMEOUT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + EVDO_HDR_CONNECTION_SETUP_TIMEOUT)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::FAILED_TO_ACQUIRE_COLOCATED_HDR == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + FAILED_TO_ACQUIRE_COLOCATED_HDR)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::OTASP_COMMIT_IN_PROGRESS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::OTASP_COMMIT_IN_PROGRESS)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_HYBRID_HDR_SERVICE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NO_HYBRID_HDR_SERVICE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::HDR_NO_LOCK_GRANTED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::HDR_NO_LOCK_GRANTED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::DBM_OR_SMS_IN_PROGRESS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::DBM_OR_SMS_IN_PROGRESS)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::HDR_FADE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::HDR_FADE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::HDR_ACCESS_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::HDR_ACCESS_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::UNSUPPORTED_1X_PREV == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::UNSUPPORTED_1X_PREV)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::LOCAL_END == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::LOCAL_END)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_SERVICE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NO_SERVICE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::FADE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::FADE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NORMAL_RELEASE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NORMAL_RELEASE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::ACCESS_ATTEMPT_ALREADY_IN_PROGRESS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + ACCESS_ATTEMPT_ALREADY_IN_PROGRESS)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::REDIRECTION_OR_HANDOFF_IN_PROGRESS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + REDIRECTION_OR_HANDOFF_IN_PROGRESS)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::EMERGENCY_MODE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::EMERGENCY_MODE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PHONE_IN_USE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PHONE_IN_USE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_MODE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_MODE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_SIM_STATE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_SIM_STATE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_COLLOCATED_HDR == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::NO_COLLOCATED_HDR)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::UE_IS_ENTERING_POWERSAVE_MODE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + UE_IS_ENTERING_POWERSAVE_MODE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::DUAL_SWITCH == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::DUAL_SWITCH)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PPP_TIMEOUT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PPP_TIMEOUT)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PPP_AUTH_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PPP_AUTH_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PPP_OPTION_MISMATCH == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PPP_OPTION_MISMATCH)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PPP_PAP_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PPP_PAP_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PPP_CHAP_FAILURE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PPP_CHAP_FAILURE)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::PPP_CLOSE_IN_PROGRESS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::PPP_CLOSE_IN_PROGRESS)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::LIMITED_TO_IPV4 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::LIMITED_TO_IPV4)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::LIMITED_TO_IPV6 == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::LIMITED_TO_IPV6)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::VSNCP_TIMEOUT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_TIMEOUT)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::VSNCP_GEN_ERROR == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_GEN_ERROR)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::VSNCP_APN_UNAUTHORIZED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_APN_UNATHORIZED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::VSNCP_PDN_LIMIT_EXCEEDED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_PDN_LIMIT_EXCEEDED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::VSNCP_NO_PDN_GATEWAY_ADDRESS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_NO_PDN_GATEWAY_ADDRESS)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::VSNCP_PDN_GATEWAY_UNREACHABLE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + VSNCP_PDN_GATEWAY_UNREACHABLE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::VSNCP_PDN_GATEWAY_REJECT == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_PDN_GATEWAY_REJECT)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::VSNCP_INSUFFICIENT_PARAMETERS == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + VSNCP_INSUFFICIENT_PARAMETERS)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::VSNCP_RESOURCE_UNAVAILABLE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_RESOURCE_UNAVAILABLE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::VSNCP_ADMINISTRATIVELY_PROHIBITED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + VSNCP_ADMINISTRATIVELY_PROHIBITED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::VSNCP_PDN_ID_IN_USE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_PDN_ID_IN_USE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::VSNCP_SUBSCRIBER_LIMITATION == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_SUBSCRIBER_LIMITATION)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::VSNCP_PDN_EXISTS_FOR_THIS_APN == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause:: + VSNCP_PDN_EXISTS_FOR_THIS_APN)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::VSNCP_RECONNECT_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_RECONNECT_NOT_ALLOWED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::IPV6_PREFIX_UNAVAILABLE == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::IPV6_PREFIX_UNAVAILABLE)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::HANDOFF_PREFERENCE_CHANGED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::HANDOFF_PREFERENCE_CHANGED)); +static_assert(aidl::android::hardware::radio::DataCallFailCause::SLICE_REJECTED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::SLICE_REJECTED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::MATCH_ALL_RULE_NOT_ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::MATCH_ALL_RULE_NOT_ALLOWED)); +static_assert( + aidl::android::hardware::radio::DataCallFailCause::ALL_MATCHING_RULES_FAILED == + static_cast( + ::android::hardware::radio::V1_6::DataCallFailCause::ALL_MATCHING_RULES_FAILED)); + +static_assert(aidl::android::hardware::radio::SliceStatus::UNKNOWN == + static_cast( + ::android::hardware::radio::V1_6::SliceStatus::UNKNOWN)); +static_assert(aidl::android::hardware::radio::SliceStatus::CONFIGURED == + static_cast( + ::android::hardware::radio::V1_6::SliceStatus::CONFIGURED)); +static_assert(aidl::android::hardware::radio::SliceStatus::ALLOWED == + static_cast( + ::android::hardware::radio::V1_6::SliceStatus::ALLOWED)); +static_assert( + aidl::android::hardware::radio::SliceStatus::REJECTED_NOT_AVAILABLE_IN_PLMN == + static_cast( + ::android::hardware::radio::V1_6::SliceStatus::REJECTED_NOT_AVAILABLE_IN_PLMN)); +static_assert( + aidl::android::hardware::radio::SliceStatus::REJECTED_NOT_AVAILABLE_IN_REG_AREA == + static_cast( + ::android::hardware::radio::V1_6::SliceStatus::REJECTED_NOT_AVAILABLE_IN_REG_AREA)); +static_assert(aidl::android::hardware::radio::SliceStatus::DEFAULT_CONFIGURED == + static_cast( + ::android::hardware::radio::V1_6::SliceStatus::DEFAULT_CONFIGURED)); + +static_assert(aidl::android::hardware::radio::SscMode::MODE_1 == + static_cast( + ::android::hardware::radio::V1_6::SscMode::MODE_1)); +static_assert(aidl::android::hardware::radio::SscMode::MODE_2 == + static_cast( + ::android::hardware::radio::V1_6::SscMode::MODE_2)); +static_assert(aidl::android::hardware::radio::SscMode::MODE_3 == + static_cast( + ::android::hardware::radio::V1_6::SscMode::MODE_3)); + +static_assert(aidl::android::hardware::radio::PublicKeyType::EPDG == + static_cast( + ::android::hardware::radio::V1_6::PublicKeyType::EPDG)); +static_assert(aidl::android::hardware::radio::PublicKeyType::WLAN == + static_cast( + ::android::hardware::radio::V1_6::PublicKeyType::WLAN)); + +static_assert(aidl::android::hardware::radio::PbReceivedStatus::PB_RECEIVED_OK == + static_cast( + ::android::hardware::radio::V1_6::PbReceivedStatus::PB_RECEIVED_OK)); +static_assert(aidl::android::hardware::radio::PbReceivedStatus::PB_RECEIVED_ERROR == + static_cast( + ::android::hardware::radio::V1_6::PbReceivedStatus::PB_RECEIVED_ERROR)); +static_assert(aidl::android::hardware::radio::PbReceivedStatus::PB_RECEIVED_ABORT == + static_cast( + ::android::hardware::radio::V1_6::PbReceivedStatus::PB_RECEIVED_ABORT)); +static_assert(aidl::android::hardware::radio::PbReceivedStatus::PB_RECEIVED_FINAL == + static_cast( + ::android::hardware::radio::V1_6::PbReceivedStatus::PB_RECEIVED_FINAL)); + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::IccIo& in, + aidl::android::hardware::radio::IccIo* out) { + out->command = static_cast(in.command); + out->fileId = static_cast(in.fileId); + out->path = in.path; + out->p1 = static_cast(in.p1); + out->p2 = static_cast(in.p2); + out->p3 = static_cast(in.p3); + out->data = in.data; + out->pin2 = in.pin2; + out->aid = in.aid; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::NeighboringCell& in, + aidl::android::hardware::radio::NeighboringCell* out) { + out->cid = in.cid; + out->rssi = static_cast(in.rssi); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::UusInfo& in, + aidl::android::hardware::radio::UusInfo* out) { + out->uusType = static_cast(in.uusType); + out->uusDcs = static_cast(in.uusDcs); + out->uusData = in.uusData; + return true; +} + +__attribute__((warn_unused_result)) bool translate(const ::android::hardware::radio::V1_0::Dial& in, + aidl::android::hardware::radio::Dial* out) { + out->address = in.address; + out->clir = static_cast(in.clir); + { + size_t size = in.uusInfo.size(); + aidl::android::hardware::radio::UusInfo uusInfo; + for (size_t i = 0; i < size; i++) { + if (!translate(in.uusInfo[i], &uusInfo)) return false; + out->uusInfo.push_back(uusInfo); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::LastCallFailCauseInfo& in, + aidl::android::hardware::radio::LastCallFailCauseInfo* out) { + out->causeCode = static_cast(in.causeCode); + out->vendorCause = in.vendorCause; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::GsmSignalStrength& in, + aidl::android::hardware::radio::GsmSignalStrength* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.signalStrength > std::numeric_limits::max() || in.signalStrength < 0) { + return false; + } + out->signalStrength = static_cast(in.signalStrength); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.bitErrorRate > std::numeric_limits::max() || in.bitErrorRate < 0) { + return false; + } + out->bitErrorRate = static_cast(in.bitErrorRate); + out->timingAdvance = static_cast(in.timingAdvance); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaSignalStrength& in, + aidl::android::hardware::radio::CdmaSignalStrength* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.dbm > std::numeric_limits::max() || in.dbm < 0) { + return false; + } + out->dbm = static_cast(in.dbm); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.ecio > std::numeric_limits::max() || in.ecio < 0) { + return false; + } + out->ecio = static_cast(in.ecio); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::EvdoSignalStrength& in, + aidl::android::hardware::radio::EvdoSignalStrength* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.dbm > std::numeric_limits::max() || in.dbm < 0) { + return false; + } + out->dbm = static_cast(in.dbm); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.ecio > std::numeric_limits::max() || in.ecio < 0) { + return false; + } + out->ecio = static_cast(in.ecio); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.signalNoiseRatio > std::numeric_limits::max() || in.signalNoiseRatio < 0) { + return false; + } + out->signalNoiseRatio = static_cast(in.signalNoiseRatio); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::SendSmsResult& in, + aidl::android::hardware::radio::SendSmsResult* out) { + out->messageRef = static_cast(in.messageRef); + out->ackPDU = in.ackPDU; + out->errorCode = static_cast(in.errorCode); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::IccIoResult& in, + aidl::android::hardware::radio::IccIoResult* out) { + out->sw1 = static_cast(in.sw1); + out->sw2 = static_cast(in.sw2); + out->simResponse = in.simResponse; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CallForwardInfo& in, + aidl::android::hardware::radio::CallForwardInfo* out) { + out->status = static_cast(in.status); + out->reason = static_cast(in.reason); + out->serviceClass = static_cast(in.serviceClass); + out->toa = static_cast(in.toa); + out->number = in.number; + out->timeSeconds = static_cast(in.timeSeconds); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::OperatorInfo& in, + aidl::android::hardware::radio::OperatorInfo* out) { + out->alphaLong = in.alphaLong; + out->alphaShort = in.alphaShort; + out->operatorNumeric = in.operatorNumeric; + out->status = static_cast(in.status); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::SmsWriteArgs& in, + aidl::android::hardware::radio::SmsWriteArgs* out) { + out->status = static_cast(in.status); + out->pdu = in.pdu; + out->smsc = in.smsc; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaSmsAddress& in, + aidl::android::hardware::radio::CdmaSmsAddress* out) { + out->digitMode = static_cast(in.digitMode); + out->numberMode = static_cast(in.numberMode); + out->numberType = static_cast(in.numberType); + out->numberPlan = static_cast(in.numberPlan); + { + size_t size = in.digits.size(); + for (size_t i = 0; i < size; i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.digits[i] > std::numeric_limits::max() || in.digits[i] < 0) { + return false; + } + out->digits.push_back(static_cast(in.digits[i])); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaSmsSubaddress& in, + aidl::android::hardware::radio::CdmaSmsSubaddress* out) { + out->subaddressType = + static_cast(in.subaddressType); + out->odd = static_cast(in.odd); + { + size_t size = in.digits.size(); + for (size_t i = 0; i < size; i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.digits[i] > std::numeric_limits::max() || in.digits[i] < 0) { + return false; + } + out->digits.push_back(static_cast(in.digits[i])); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaSmsMessage& in, + aidl::android::hardware::radio::CdmaSmsMessage* out) { + out->teleserviceId = static_cast(in.teleserviceId); + out->isServicePresent = static_cast(in.isServicePresent); + out->serviceCategory = static_cast(in.serviceCategory); + if (!translate(in.address, &out->address)) return false; + if (!translate(in.subAddress, &out->subAddress)) return false; + { + size_t size = in.bearerData.size(); + for (size_t i = 0; i < size; i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.bearerData[i] > std::numeric_limits::max() || in.bearerData[i] < 0) { + return false; + } + out->bearerData.push_back(static_cast(in.bearerData[i])); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaSmsAck& in, + aidl::android::hardware::radio::CdmaSmsAck* out) { + out->errorClass = static_cast(in.errorClass); + out->smsCauseCode = static_cast(in.smsCauseCode); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaBroadcastSmsConfigInfo& in, + aidl::android::hardware::radio::CdmaBroadcastSmsConfigInfo* out) { + out->serviceCategory = static_cast(in.serviceCategory); + out->language = static_cast(in.language); + out->selected = static_cast(in.selected); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaSmsWriteArgs& in, + aidl::android::hardware::radio::CdmaSmsWriteArgs* out) { + out->status = static_cast(in.status); + if (!translate(in.message, &out->message)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::GsmBroadcastSmsConfigInfo& in, + aidl::android::hardware::radio::GsmBroadcastSmsConfigInfo* out) { + out->fromServiceId = static_cast(in.fromServiceId); + out->toServiceId = static_cast(in.toServiceId); + out->fromCodeScheme = static_cast(in.fromCodeScheme); + out->toCodeScheme = static_cast(in.toCodeScheme); + out->selected = static_cast(in.selected); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::GsmSmsMessage& in, + aidl::android::hardware::radio::GsmSmsMessage* out) { + out->smscPdu = in.smscPdu; + out->pdu = in.pdu; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::ImsSmsMessage& in, + aidl::android::hardware::radio::ImsSmsMessage* out) { + out->tech = static_cast(in.tech); + out->retry = static_cast(in.retry); + out->messageRef = static_cast(in.messageRef); + { + size_t size = in.cdmaMessage.size(); + aidl::android::hardware::radio::CdmaSmsMessage cdmaMessage; + for (size_t i = 0; i < size; i++) { + if (!translate(in.cdmaMessage[i], &cdmaMessage)) return false; + out->cdmaMessage.push_back(cdmaMessage); + } + } + { + size_t size = in.gsmMessage.size(); + aidl::android::hardware::radio::GsmSmsMessage gsmMessage; + for (size_t i = 0; i < size; i++) { + if (!translate(in.gsmMessage[i], &gsmMessage)) return false; + out->gsmMessage.push_back(gsmMessage); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::SimApdu& in, + aidl::android::hardware::radio::SimApdu* out) { + out->sessionId = static_cast(in.sessionId); + out->cla = static_cast(in.cla); + out->instruction = static_cast(in.instruction); + out->p1 = static_cast(in.p1); + out->p2 = static_cast(in.p2); + out->p3 = static_cast(in.p3); + out->data = in.data; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::NvWriteItem& in, + aidl::android::hardware::radio::NvWriteItem* out) { + out->itemId = static_cast(in.itemId); + out->value = in.value; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::SelectUiccSub& in, + aidl::android::hardware::radio::SelectUiccSub* out) { + out->slot = static_cast(in.slot); + out->appIndex = static_cast(in.appIndex); + out->subType = static_cast(in.subType); + out->actStatus = static_cast(in.actStatus); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::HardwareConfigModem& in, + aidl::android::hardware::radio::HardwareConfigModem* out) { + out->rilModel = static_cast(in.rilModel); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.rat > std::numeric_limits::max() || in.rat < 0) { + return false; + } + out->rat = static_cast(in.rat); + out->maxVoice = static_cast(in.maxVoice); + out->maxData = static_cast(in.maxData); + out->maxStandby = static_cast(in.maxStandby); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::HardwareConfigSim& in, + aidl::android::hardware::radio::HardwareConfigSim* out) { + out->modemUuid = in.modemUuid; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::HardwareConfig& in, + aidl::android::hardware::radio::HardwareConfig* out) { + out->type = static_cast(in.type); + out->uuid = in.uuid; + out->state = static_cast(in.state); + { + size_t size = in.modem.size(); + aidl::android::hardware::radio::HardwareConfigModem modem; + for (size_t i = 0; i < size; i++) { + if (!translate(in.modem[i], &modem)) return false; + out->modem.push_back(modem); + } + } + { + size_t size = in.sim.size(); + aidl::android::hardware::radio::HardwareConfigSim sim; + for (size_t i = 0; i < size; i++) { + if (!translate(in.sim[i], &sim)) return false; + out->sim.push_back(sim); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::LceStatusInfo& in, + aidl::android::hardware::radio::LceStatusInfo* out) { + out->lceStatus = static_cast(in.lceStatus); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.actualIntervalMs > std::numeric_limits::max() || in.actualIntervalMs < 0) { + return false; + } + out->actualIntervalMs = static_cast(in.actualIntervalMs); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::LceDataInfo& in, + aidl::android::hardware::radio::LceDataInfo* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.lastHopCapacityKbps > std::numeric_limits::max() || + in.lastHopCapacityKbps < 0) { + return false; + } + out->lastHopCapacityKbps = static_cast(in.lastHopCapacityKbps); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.confidenceLevel > std::numeric_limits::max() || in.confidenceLevel < 0) { + return false; + } + out->confidenceLevel = static_cast(in.confidenceLevel); + out->lceSuspended = static_cast(in.lceSuspended); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::ActivityStatsInfo& in, + aidl::android::hardware::radio::ActivityStatsInfo* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.sleepModeTimeMs > std::numeric_limits::max() || in.sleepModeTimeMs < 0) { + return false; + } + out->sleepModeTimeMs = static_cast(in.sleepModeTimeMs); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.idleModeTimeMs > std::numeric_limits::max() || in.idleModeTimeMs < 0) { + return false; + } + out->idleModeTimeMs = static_cast(in.idleModeTimeMs); + { + size_t size = sizeof(in.txmModetimeMs) / sizeof(in.txmModetimeMs[0]); + for (size_t i = 0; i < size; i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.txmModetimeMs[i] > std::numeric_limits::max() || + in.txmModetimeMs[i] < 0) { + return false; + } + out->txmModetimeMs.push_back(static_cast(in.txmModetimeMs[i])); + } + } + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.rxModeTimeMs > std::numeric_limits::max() || in.rxModeTimeMs < 0) { + return false; + } + out->rxModeTimeMs = static_cast(in.rxModeTimeMs); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::Carrier& in, + aidl::android::hardware::radio::Carrier* out) { + out->mcc = in.mcc; + out->mnc = in.mnc; + out->matchType = static_cast(in.matchType); + out->matchData = in.matchData; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CarrierRestrictions& in, + aidl::android::hardware::radio::CarrierRestrictions* out) { + { + size_t size = in.allowedCarriers.size(); + aidl::android::hardware::radio::Carrier allowedCarriers; + for (size_t i = 0; i < size; i++) { + if (!translate(in.allowedCarriers[i], &allowedCarriers)) return false; + out->allowedCarriers.push_back(allowedCarriers); + } + } + { + size_t size = in.excludedCarriers.size(); + aidl::android::hardware::radio::Carrier excludedCarriers; + for (size_t i = 0; i < size; i++) { + if (!translate(in.excludedCarriers[i], &excludedCarriers)) return false; + out->excludedCarriers.push_back(excludedCarriers); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::SuppSvcNotification& in, + aidl::android::hardware::radio::SuppSvcNotification* out) { + out->isMT = static_cast(in.isMT); + out->code = static_cast(in.code); + out->index = static_cast(in.index); + out->type = static_cast(in.type); + out->number = in.number; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::SimRefreshResult& in, + aidl::android::hardware::radio::SimRefreshResult* out) { + out->type = static_cast(in.type); + out->efId = static_cast(in.efId); + out->aid = in.aid; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaSignalInfoRecord& in, + aidl::android::hardware::radio::CdmaSignalInfoRecord* out) { + out->isPresent = static_cast(in.isPresent); + out->signalType = static_cast(in.signalType); + out->alertPitch = static_cast(in.alertPitch); + out->signal = static_cast(in.signal); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaCallWaiting& in, + aidl::android::hardware::radio::CdmaCallWaiting* out) { + out->number = in.number; + out->numberPresentation = + static_cast( + in.numberPresentation); + out->name = in.name; + if (!translate(in.signalInfoRecord, &out->signalInfoRecord)) return false; + out->numberType = + static_cast(in.numberType); + out->numberPlan = + static_cast(in.numberPlan); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaDisplayInfoRecord& in, + aidl::android::hardware::radio::CdmaDisplayInfoRecord* out) { + out->alphaBuf = in.alphaBuf; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaNumberInfoRecord& in, + aidl::android::hardware::radio::CdmaNumberInfoRecord* out) { + out->number = in.number; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.numberType > std::numeric_limits::max() || in.numberType < 0) { + return false; + } + out->numberType = static_cast(in.numberType); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.numberPlan > std::numeric_limits::max() || in.numberPlan < 0) { + return false; + } + out->numberPlan = static_cast(in.numberPlan); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.pi > std::numeric_limits::max() || in.pi < 0) { + return false; + } + out->pi = static_cast(in.pi); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.si > std::numeric_limits::max() || in.si < 0) { + return false; + } + out->si = static_cast(in.si); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaRedirectingNumberInfoRecord& in, + aidl::android::hardware::radio::CdmaRedirectingNumberInfoRecord* out) { + if (!translate(in.redirectingNumber, &out->redirectingNumber)) return false; + out->redirectingReason = static_cast( + in.redirectingReason); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaLineControlInfoRecord& in, + aidl::android::hardware::radio::CdmaLineControlInfoRecord* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.lineCtrlPolarityIncluded > std::numeric_limits::max() || + in.lineCtrlPolarityIncluded < 0) { + return false; + } + out->lineCtrlPolarityIncluded = static_cast(in.lineCtrlPolarityIncluded); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.lineCtrlToggle > std::numeric_limits::max() || in.lineCtrlToggle < 0) { + return false; + } + out->lineCtrlToggle = static_cast(in.lineCtrlToggle); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.lineCtrlReverse > std::numeric_limits::max() || in.lineCtrlReverse < 0) { + return false; + } + out->lineCtrlReverse = static_cast(in.lineCtrlReverse); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.lineCtrlPowerDenial > std::numeric_limits::max() || in.lineCtrlPowerDenial < 0) { + return false; + } + out->lineCtrlPowerDenial = static_cast(in.lineCtrlPowerDenial); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaT53ClirInfoRecord& in, + aidl::android::hardware::radio::CdmaT53ClirInfoRecord* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.cause > std::numeric_limits::max() || in.cause < 0) { + return false; + } + out->cause = static_cast(in.cause); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaT53AudioControlInfoRecord& in, + aidl::android::hardware::radio::CdmaT53AudioControlInfoRecord* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.upLink > std::numeric_limits::max() || in.upLink < 0) { + return false; + } + out->upLink = static_cast(in.upLink); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.downLink > std::numeric_limits::max() || in.downLink < 0) { + return false; + } + out->downLink = static_cast(in.downLink); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaInformationRecord& in, + aidl::android::hardware::radio::CdmaInformationRecord* out) { + out->name = static_cast(in.name); + { + size_t size = in.display.size(); + aidl::android::hardware::radio::CdmaDisplayInfoRecord display; + for (size_t i = 0; i < size; i++) { + if (!translate(in.display[i], &display)) return false; + out->display.push_back(display); + } + } + { + size_t size = in.number.size(); + aidl::android::hardware::radio::CdmaNumberInfoRecord number; + for (size_t i = 0; i < size; i++) { + if (!translate(in.number[i], &number)) return false; + out->number.push_back(number); + } + } + { + size_t size = in.signal.size(); + aidl::android::hardware::radio::CdmaSignalInfoRecord signal; + for (size_t i = 0; i < size; i++) { + if (!translate(in.signal[i], &signal)) return false; + out->signal.push_back(signal); + } + } + { + size_t size = in.redir.size(); + aidl::android::hardware::radio::CdmaRedirectingNumberInfoRecord redir; + for (size_t i = 0; i < size; i++) { + if (!translate(in.redir[i], &redir)) return false; + out->redir.push_back(redir); + } + } + { + size_t size = in.lineCtrl.size(); + aidl::android::hardware::radio::CdmaLineControlInfoRecord lineCtrl; + for (size_t i = 0; i < size; i++) { + if (!translate(in.lineCtrl[i], &lineCtrl)) return false; + out->lineCtrl.push_back(lineCtrl); + } + } + { + size_t size = in.clir.size(); + aidl::android::hardware::radio::CdmaT53ClirInfoRecord clir; + for (size_t i = 0; i < size; i++) { + if (!translate(in.clir[i], &clir)) return false; + out->clir.push_back(clir); + } + } + { + size_t size = in.audioCtrl.size(); + aidl::android::hardware::radio::CdmaT53AudioControlInfoRecord audioCtrl; + for (size_t i = 0; i < size; i++) { + if (!translate(in.audioCtrl[i], &audioCtrl)) return false; + out->audioCtrl.push_back(audioCtrl); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaInformationRecords& in, + aidl::android::hardware::radio::CdmaInformationRecords* out) { + { + size_t size = in.infoRec.size(); + aidl::android::hardware::radio::CdmaInformationRecord infoRec; + for (size_t i = 0; i < size; i++) { + if (!translate(in.infoRec[i], &infoRec)) return false; + out->infoRec.push_back(infoRec); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CfData& in, + aidl::android::hardware::radio::CfData* out) { + { + size_t size = in.cfInfo.size(); + aidl::android::hardware::radio::CallForwardInfo cfInfo; + for (size_t i = 0; i < size; i++) { + if (!translate(in.cfInfo[i], &cfInfo)) return false; + out->cfInfo.push_back(cfInfo); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::SsInfoData& in, + aidl::android::hardware::radio::SsInfoData* out) { + { + size_t size = in.ssInfo.size(); + for (size_t i = 0; i < size; i++) { + out->ssInfo.push_back(static_cast(in.ssInfo[i])); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::StkCcUnsolSsResult& in, + aidl::android::hardware::radio::StkCcUnsolSsResult* out) { + out->serviceType = static_cast(in.serviceType); + out->requestType = static_cast(in.requestType); + out->teleserviceType = + static_cast(in.teleserviceType); + out->serviceClass = + static_cast(in.serviceClass); + out->result = static_cast(in.result); + { + size_t size = in.ssInfo.size(); + aidl::android::hardware::radio::SsInfoData ssInfo; + for (size_t i = 0; i < size; i++) { + if (!translate(in.ssInfo[i], &ssInfo)) return false; + out->ssInfo.push_back(ssInfo); + } + } + { + size_t size = in.cfData.size(); + aidl::android::hardware::radio::CfData cfData; + for (size_t i = 0; i < size; i++) { + if (!translate(in.cfData[i], &cfData)) return false; + out->cfData.push_back(cfData); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::PcoDataInfo& in, + aidl::android::hardware::radio::PcoDataInfo* out) { + out->cid = static_cast(in.cid); + out->bearerProto = in.bearerProto; + out->pcoId = static_cast(in.pcoId); + { + size_t size = in.contents.size(); + for (size_t i = 0; i < size; i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.contents[i] > std::numeric_limits::max() || in.contents[i] < 0) { + return false; + } + out->contents.push_back(static_cast(in.contents[i])); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_1::KeepaliveRequest& in, + aidl::android::hardware::radio::KeepaliveRequest* out) { + out->type = static_cast(in.type); + { + size_t size = in.sourceAddress.size(); + for (size_t i = 0; i < size; i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.sourceAddress[i] > std::numeric_limits::max() || + in.sourceAddress[i] < 0) { + return false; + } + out->sourceAddress.push_back(static_cast(in.sourceAddress[i])); + } + } + out->sourcePort = static_cast(in.sourcePort); + { + size_t size = in.destinationAddress.size(); + for (size_t i = 0; i < size; i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.destinationAddress[i] > std::numeric_limits::max() || + in.destinationAddress[i] < 0) { + return false; + } + out->destinationAddress.push_back(static_cast(in.destinationAddress[i])); + } + } + out->destinationPort = static_cast(in.destinationPort); + out->maxKeepaliveIntervalMillis = static_cast(in.maxKeepaliveIntervalMillis); + out->cid = static_cast(in.cid); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_1::KeepaliveStatus& in, + aidl::android::hardware::radio::KeepaliveStatus* out) { + out->sessionHandle = static_cast(in.sessionHandle); + out->code = static_cast(in.code); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_2::CellIdentityOperatorNames& in, + aidl::android::hardware::radio::CellIdentityOperatorNames* out) { + out->alphaLong = in.alphaLong; + out->alphaShort = in.alphaShort; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_2::CellIdentityCdma& in, + aidl::android::hardware::radio::CellIdentityCdma* out) { + out->networkId = static_cast(in.base.networkId); + out->systemId = static_cast(in.base.systemId); + out->baseStationId = static_cast(in.base.baseStationId); + out->longitude = static_cast(in.base.longitude); + out->latitude = static_cast(in.base.latitude); + if (!translate(in.operatorNames, &out->operatorNames)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_2::CellInfoCdma& in, + aidl::android::hardware::radio::CellInfoCdma* out) { + if (!translate(in.cellIdentityCdma, &out->cellIdentityCdma)) return false; + if (!translate(in.signalStrengthCdma, &out->signalStrengthCdma)) return false; + if (!translate(in.signalStrengthEvdo, &out->signalStrengthEvdo)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_2::WcdmaSignalStrength& in, + aidl::android::hardware::radio::WcdmaSignalStrength* out) { + out->signalStrength = static_cast(in.base.signalStrength); + out->bitErrorRate = static_cast(in.base.bitErrorRate); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.rscp > std::numeric_limits::max() || in.rscp < 0) { + return false; + } + out->rscp = static_cast(in.rscp); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.ecno > std::numeric_limits::max() || in.ecno < 0) { + return false; + } + out->ecno = static_cast(in.ecno); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_2::TdscdmaSignalStrength& in, + aidl::android::hardware::radio::TdscdmaSignalStrength* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.signalStrength > std::numeric_limits::max() || in.signalStrength < 0) { + return false; + } + out->signalStrength = static_cast(in.signalStrength); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.bitErrorRate > std::numeric_limits::max() || in.bitErrorRate < 0) { + return false; + } + out->bitErrorRate = static_cast(in.bitErrorRate); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.rscp > std::numeric_limits::max() || in.rscp < 0) { + return false; + } + out->rscp = static_cast(in.rscp); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_2::VoiceRegStateResult& in, + aidl::android::hardware::radio::VoiceRegStateResult* out) { + out->regState = static_cast(in.regState); + out->rat = static_cast(in.rat); + out->cssSupported = static_cast(in.cssSupported); + out->roamingIndicator = static_cast(in.roamingIndicator); + out->systemIsInPrl = static_cast(in.systemIsInPrl); + out->defaultRoamingIndicator = static_cast(in.defaultRoamingIndicator); + out->reasonForDenial = static_cast(in.reasonForDenial); + // FIXME Unknown type: android.hardware.radio@1.2::CellIdentity + // That type's package needs to be converted separately and the corresponding translate function + // should be added here. + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_3::RadioResponseInfoModem& in, + aidl::android::hardware::radio::RadioResponseInfoModem* out) { + out->type = static_cast(in.type); + out->serial = static_cast(in.serial); + out->error = static_cast(in.error); + out->isEnabled = static_cast(in.isEnabled); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::EmergencyNumber& in, + aidl::android::hardware::radio::EmergencyNumber* out) { + out->number = in.number; + out->mcc = in.mcc; + out->mnc = in.mnc; + out->categories = + static_cast(in.categories); + { + size_t size = in.urns.size(); + for (size_t i = 0; i < size; i++) { + out->urns.push_back(in.urns[i]); + } + } + out->sources = static_cast(in.sources); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::RadioFrequencyInfo& in, + aidl::android::hardware::radio::RadioFrequencyInfo* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_4::RadioFrequencyInfo::hidl_discriminator::range: + *out = static_cast(in.range()); + break; + case ::android::hardware::radio::V1_4::RadioFrequencyInfo::hidl_discriminator:: + channelNumber: + *out = static_cast(in.channelNumber()); + break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::LteVopsInfo& in, + aidl::android::hardware::radio::LteVopsInfo* out) { + out->isVopsSupported = static_cast(in.isVopsSupported); + out->isEmcBearerSupported = static_cast(in.isEmcBearerSupported); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::NrIndicators& in, + aidl::android::hardware::radio::NrIndicators* out) { + out->isEndcAvailable = static_cast(in.isEndcAvailable); + out->isDcNrRestricted = static_cast(in.isDcNrRestricted); + out->isNrAvailable = static_cast(in.isNrAvailable); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::DataRegStateResult& in, + aidl::android::hardware::radio::DataRegStateResult* out) { + out->regState = static_cast(in.base.regState); + out->rat = static_cast(in.base.rat); + out->reasonDataDenied = static_cast(in.base.reasonDataDenied); + out->maxDataCalls = static_cast(in.base.maxDataCalls); + // FIXME Unknown type: android.hardware.radio@1.2::CellIdentity + // That type's package needs to be converted separately and the corresponding translate function + // should be added here. + if (!translate(in.vopsInfo, &out->vopsInfo)) return false; + if (!translate(in.nrIndicators, &out->nrIndicators)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::DataRegStateResult::VopsInfo& in, + aidl::android::hardware::radio::DataRegStateResultVopsInfo* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_4::DataRegStateResult::VopsInfo::hidl_discriminator:: + noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_4::DataRegStateResult::VopsInfo::hidl_discriminator:: + lteVopsInfo: { + aidl::android::hardware::radio::LteVopsInfo lteVopsInfo; + if (!translate(in.lteVopsInfo(), <eVopsInfo)) return false; + out->set( + lteVopsInfo); + } break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::CellConfigLte& in, + aidl::android::hardware::radio::CellConfigLte* out) { + out->isEndcAvailable = static_cast(in.isEndcAvailable); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::CellInfo::Info& in, + aidl::android::hardware::radio::CellInfoInfo* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_4::CellInfo::Info::hidl_discriminator::gsm: + // FIXME Unknown type: android.hardware.radio@1.2::CellInfoGsm + // That type's package needs to be converted separately and the corresponding translate + // function should be added here. + break; + case ::android::hardware::radio::V1_4::CellInfo::Info::hidl_discriminator::cdma: { + aidl::android::hardware::radio::CellInfoCdma cdma; + if (!translate(in.cdma(), &cdma)) return false; + out->set(cdma); + } break; + case ::android::hardware::radio::V1_4::CellInfo::Info::hidl_discriminator::wcdma: + // FIXME Unknown type: android.hardware.radio@1.2::CellInfoWcdma + // That type's package needs to be converted separately and the corresponding translate + // function should be added here. + break; + case ::android::hardware::radio::V1_4::CellInfo::Info::hidl_discriminator::tdscdma: + // FIXME Unknown type: android.hardware.radio@1.2::CellInfoTdscdma + // That type's package needs to be converted separately and the corresponding translate + // function should be added here. + break; + case ::android::hardware::radio::V1_4::CellInfo::Info::hidl_discriminator::lte: + // FIXME Unknown type: android.hardware.radio@1.4::CellInfoLte + // That type's package needs to be converted separately and the corresponding translate + // function should be added here. + break; + case ::android::hardware::radio::V1_4::CellInfo::Info::hidl_discriminator::nr: + // FIXME Unknown type: android.hardware.radio@1.4::CellInfoNr + // That type's package needs to be converted separately and the corresponding translate + // function should be added here. + break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::RadioCapability& in, + aidl::android::hardware::radio::RadioCapability* out) { + out->session = static_cast(in.session); + out->phase = static_cast(in.phase); + out->raf = static_cast(in.raf); + out->logicalModemUuid = in.logicalModemUuid; + out->status = static_cast(in.status); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::CarrierRestrictionsWithPriority& in, + aidl::android::hardware::radio::CarrierRestrictionsWithPriority* out) { + { + size_t size = in.allowedCarriers.size(); + aidl::android::hardware::radio::Carrier allowedCarriers; + for (size_t i = 0; i < size; i++) { + if (!translate(in.allowedCarriers[i], &allowedCarriers)) return false; + out->allowedCarriers.push_back(allowedCarriers); + } + } + { + size_t size = in.excludedCarriers.size(); + aidl::android::hardware::radio::Carrier excludedCarriers; + for (size_t i = 0; i < size; i++) { + if (!translate(in.excludedCarriers[i], &excludedCarriers)) return false; + out->excludedCarriers.push_back(excludedCarriers); + } + } + out->allowedCarriersPrioritized = static_cast(in.allowedCarriersPrioritized); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::RadioAccessSpecifier& in, + aidl::android::hardware::radio::RadioAccessSpecifier* out) { + out->radioAccessNetwork = + static_cast(in.radioAccessNetwork); + if (!translate(in.bands, &out->bands)) return false; + { + size_t size = in.channels.size(); + for (size_t i = 0; i < size; i++) { + out->channels.push_back(static_cast(in.channels[i])); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands& in, + aidl::android::hardware::radio::RadioAccessSpecifierBands* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands::hidl_discriminator:: + geranBands: { + ::android::hardware::hidl_vec<::android::hardware::radio::V1_1::GeranBands> geranBands = + in.geranBands(); + size_t size = geranBands.size(); + for (size_t i = 0; i < size; i++) { + out->get() + .push_back(static_cast( + geranBands[i])); + } + } break; + case ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands::hidl_discriminator:: + utranBands: { + ::android::hardware::hidl_vec<::android::hardware::radio::V1_5::UtranBands> utranBands = + in.utranBands(); + size_t size = utranBands.size(); + for (size_t i = 0; i < size; i++) { + out->get() + .push_back(static_cast( + utranBands[i])); + } + } break; + case ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands::hidl_discriminator:: + eutranBands: { + ::android::hardware::hidl_vec<::android::hardware::radio::V1_5::EutranBands> + eutranBands = in.eutranBands(); + size_t size = eutranBands.size(); + for (size_t i = 0; i < size; i++) { + out->get() + .push_back(static_cast( + eutranBands[i])); + } + } break; + case ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands::hidl_discriminator:: + ngranBands: { + ::android::hardware::hidl_vec<::android::hardware::radio::V1_5::NgranBands> ngranBands = + in.ngranBands(); + size_t size = ngranBands.size(); + for (size_t i = 0; i < size; i++) { + out->get() + .push_back(static_cast( + ngranBands[i])); + } + } break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::SignalThresholdInfo& in, + aidl::android::hardware::radio::SignalThresholdInfo* out) { + out->signalMeasurement = static_cast( + in.signalMeasurement); + out->hysteresisMs = static_cast(in.hysteresisMs); + out->hysteresisDb = static_cast(in.hysteresisDb); + { + size_t size = in.thresholds.size(); + for (size_t i = 0; i < size; i++) { + out->thresholds.push_back(static_cast(in.thresholds[i])); + } + } + out->isEnabled = static_cast(in.isEnabled); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::NetworkScanRequest& in, + aidl::android::hardware::radio::NetworkScanRequest* out) { + out->type = static_cast(in.type); + out->interval = static_cast(in.interval); + { + size_t size = in.specifiers.size(); + aidl::android::hardware::radio::RadioAccessSpecifier specifiers; + for (size_t i = 0; i < size; i++) { + if (!translate(in.specifiers[i], &specifiers)) return false; + out->specifiers.push_back(specifiers); + } + } + out->maxSearchTime = static_cast(in.maxSearchTime); + out->incrementalResults = static_cast(in.incrementalResults); + out->incrementalResultsPeriodicity = static_cast(in.incrementalResultsPeriodicity); + { + size_t size = in.mccMncs.size(); + for (size_t i = 0; i < size; i++) { + out->mccMncs.push_back(in.mccMncs[i]); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::DataProfileInfo& in, + aidl::android::hardware::radio::DataProfileInfo* out) { + out->profileId = static_cast(in.profileId); + out->apn = in.apn; + out->protocol = static_cast(in.protocol); + out->roamingProtocol = + static_cast(in.roamingProtocol); + out->authType = static_cast(in.authType); + out->user = in.user; + out->password = in.password; + out->type = static_cast(in.type); + out->maxConnsTime = static_cast(in.maxConnsTime); + out->maxConns = static_cast(in.maxConns); + out->waitTime = static_cast(in.waitTime); + out->enabled = static_cast(in.enabled); + out->supportedApnTypesBitmap = + static_cast(in.supportedApnTypesBitmap); + out->bearerBitmap = + static_cast(in.bearerBitmap); + out->mtuV4 = static_cast(in.mtuV4); + out->mtuV6 = static_cast(in.mtuV6); + out->preferred = static_cast(in.preferred); + out->persistent = static_cast(in.persistent); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::LinkAddress& in, + aidl::android::hardware::radio::LinkAddress* out) { + out->address = in.address; + out->properties = static_cast(in.properties); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.deprecationTime > std::numeric_limits::max() || in.deprecationTime < 0) { + return false; + } + out->deprecationTime = static_cast(in.deprecationTime); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.expirationTime > std::numeric_limits::max() || in.expirationTime < 0) { + return false; + } + out->expirationTime = static_cast(in.expirationTime); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::ClosedSubscriberGroupInfo& in, + aidl::android::hardware::radio::ClosedSubscriberGroupInfo* out) { + out->csgIndication = static_cast(in.csgIndication); + out->homeNodebName = in.homeNodebName; + out->csgIdentity = static_cast(in.csgIdentity); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::OptionalCsgInfo& in, + aidl::android::hardware::radio::OptionalCsgInfo* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_5::OptionalCsgInfo::hidl_discriminator::noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_5::OptionalCsgInfo::hidl_discriminator::csgInfo: { + aidl::android::hardware::radio::ClosedSubscriberGroupInfo csgInfo; + if (!translate(in.csgInfo(), &csgInfo)) return false; + out->set(csgInfo); + } break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellIdentityGsm& in, + aidl::android::hardware::radio::CellIdentityGsm* out) { + out->mcc = in.base.base.mcc; + out->mnc = in.base.base.mnc; + out->lac = static_cast(in.base.base.lac); + out->cid = static_cast(in.base.base.cid); + out->arfcn = static_cast(in.base.base.arfcn); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.base.base.bsic > std::numeric_limits::max() || in.base.base.bsic < 0) { + return false; + } + out->bsic = static_cast(in.base.base.bsic); + if (!translate(in.base.operatorNames, &out->operatorNames)) return false; + { + size_t size = in.additionalPlmns.size(); + for (size_t i = 0; i < size; i++) { + out->additionalPlmns.push_back(in.additionalPlmns[i]); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellIdentityWcdma& in, + aidl::android::hardware::radio::CellIdentityWcdma* out) { + out->mcc = in.base.base.mcc; + out->mnc = in.base.base.mnc; + out->lac = static_cast(in.base.base.lac); + out->cid = static_cast(in.base.base.cid); + out->psc = static_cast(in.base.base.psc); + out->uarfcn = static_cast(in.base.base.uarfcn); + if (!translate(in.base.operatorNames, &out->operatorNames)) return false; + { + size_t size = in.additionalPlmns.size(); + for (size_t i = 0; i < size; i++) { + out->additionalPlmns.push_back(in.additionalPlmns[i]); + } + } + if (!translate(in.optionalCsgInfo, &out->optionalCsgInfo)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellIdentityTdscdma& in, + aidl::android::hardware::radio::CellIdentityTdscdma* out) { + out->mcc = in.base.base.mcc; + out->mnc = in.base.base.mnc; + out->lac = static_cast(in.base.base.lac); + out->cid = static_cast(in.base.base.cid); + out->cpid = static_cast(in.base.base.cpid); + out->uarfcn = static_cast(in.base.uarfcn); + if (!translate(in.base.operatorNames, &out->operatorNames)) return false; + { + size_t size = in.additionalPlmns.size(); + for (size_t i = 0; i < size; i++) { + out->additionalPlmns.push_back(in.additionalPlmns[i]); + } + } + if (!translate(in.optionalCsgInfo, &out->optionalCsgInfo)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellIdentityLte& in, + aidl::android::hardware::radio::CellIdentityLte* out) { + out->mcc = in.base.base.mcc; + out->mnc = in.base.base.mnc; + out->ci = static_cast(in.base.base.ci); + out->pci = static_cast(in.base.base.pci); + out->tac = static_cast(in.base.base.tac); + out->earfcn = static_cast(in.base.base.earfcn); + if (!translate(in.base.operatorNames, &out->operatorNames)) return false; + out->bandwidth = static_cast(in.base.bandwidth); + { + size_t size = in.additionalPlmns.size(); + for (size_t i = 0; i < size; i++) { + out->additionalPlmns.push_back(in.additionalPlmns[i]); + } + } + if (!translate(in.optionalCsgInfo, &out->optionalCsgInfo)) return false; + { + size_t size = in.bands.size(); + for (size_t i = 0; i < size; i++) { + out->bands.push_back( + static_cast(in.bands[i])); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellIdentityNr& in, + aidl::android::hardware::radio::CellIdentityNr* out) { + out->mcc = in.base.mcc; + out->mnc = in.base.mnc; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.base.nci > std::numeric_limits::max() || in.base.nci < 0) { + return false; + } + out->nci = static_cast(in.base.nci); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.base.pci > std::numeric_limits::max() || in.base.pci < 0) { + return false; + } + out->pci = static_cast(in.base.pci); + out->tac = static_cast(in.base.tac); + out->nrarfcn = static_cast(in.base.nrarfcn); + if (!translate(in.base.operatorNames, &out->operatorNames)) return false; + { + size_t size = in.additionalPlmns.size(); + for (size_t i = 0; i < size; i++) { + out->additionalPlmns.push_back(in.additionalPlmns[i]); + } + } + { + size_t size = in.bands.size(); + for (size_t i = 0; i < size; i++) { + out->bands.push_back( + static_cast(in.bands[i])); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellInfoGsm& in, + aidl::android::hardware::radio::CellInfoGsm* out) { + if (!translate(in.cellIdentityGsm, &out->cellIdentityGsm)) return false; + if (!translate(in.signalStrengthGsm, &out->signalStrengthGsm)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellInfoWcdma& in, + aidl::android::hardware::radio::CellInfoWcdma* out) { + if (!translate(in.cellIdentityWcdma, &out->cellIdentityWcdma)) return false; + if (!translate(in.signalStrengthWcdma, &out->signalStrengthWcdma)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellInfoTdscdma& in, + aidl::android::hardware::radio::CellInfoTdscdma* out) { + if (!translate(in.cellIdentityTdscdma, &out->cellIdentityTdscdma)) return false; + if (!translate(in.signalStrengthTdscdma, &out->signalStrengthTdscdma)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellIdentity& in, + aidl::android::hardware::radio::CellIdentity* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_5::CellIdentity::hidl_discriminator::noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_5::CellIdentity::hidl_discriminator::gsm: { + aidl::android::hardware::radio::CellIdentityGsm gsm; + if (!translate(in.gsm(), &gsm)) return false; + out->set(gsm); + } break; + case ::android::hardware::radio::V1_5::CellIdentity::hidl_discriminator::wcdma: { + aidl::android::hardware::radio::CellIdentityWcdma wcdma; + if (!translate(in.wcdma(), &wcdma)) return false; + out->set(wcdma); + } break; + case ::android::hardware::radio::V1_5::CellIdentity::hidl_discriminator::tdscdma: { + aidl::android::hardware::radio::CellIdentityTdscdma tdscdma; + if (!translate(in.tdscdma(), &tdscdma)) return false; + out->set(tdscdma); + } break; + case ::android::hardware::radio::V1_5::CellIdentity::hidl_discriminator::cdma: { + aidl::android::hardware::radio::CellIdentityCdma cdma; + if (!translate(in.cdma(), &cdma)) return false; + out->set(cdma); + } break; + case ::android::hardware::radio::V1_5::CellIdentity::hidl_discriminator::lte: { + aidl::android::hardware::radio::CellIdentityLte lte; + if (!translate(in.lte(), <e)) return false; + out->set(lte); + } break; + case ::android::hardware::radio::V1_5::CellIdentity::hidl_discriminator::nr: { + aidl::android::hardware::radio::CellIdentityNr nr; + if (!translate(in.nr(), &nr)) return false; + out->set(nr); + } break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::BarringInfo& in, + aidl::android::hardware::radio::BarringInfo* out) { + out->serviceType = + static_cast(in.serviceType); + out->barringType = + static_cast(in.barringType); + if (!translate(in.barringTypeSpecificInfo, &out->barringTypeSpecificInfo)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::BarringInfo::BarringTypeSpecificInfo::Conditional& + in, + aidl::android::hardware::radio::BarringInfoBarringTypeSpecificInfoConditional* out) { + out->factor = static_cast(in.factor); + out->timeSeconds = static_cast(in.timeSeconds); + out->isBarred = static_cast(in.isBarred); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::BarringInfo::BarringTypeSpecificInfo& in, + aidl::android::hardware::radio::BarringInfoBarringTypeSpecificInfo* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_5::BarringInfo::BarringTypeSpecificInfo:: + hidl_discriminator::noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_5::BarringInfo::BarringTypeSpecificInfo:: + hidl_discriminator::conditional: { + aidl::android::hardware::radio::BarringInfoBarringTypeSpecificInfoConditional + conditional; + if (!translate(in.conditional(), &conditional)) return false; + out->set(conditional); + } break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::RegStateResult::AccessTechnologySpecificInfo:: + Cdma2000RegistrationInfo& in, + aidl::android::hardware::radio:: + RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo* out) { + out->cssSupported = static_cast(in.cssSupported); + out->roamingIndicator = static_cast(in.roamingIndicator); + out->systemIsInPrl = + static_cast(in.systemIsInPrl); + out->defaultRoamingIndicator = static_cast(in.defaultRoamingIndicator); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::RegStateResult::AccessTechnologySpecificInfo:: + EutranRegistrationInfo& in, + aidl::android::hardware::radio:: + RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo* out) { + if (!translate(in.lteVopsInfo, &out->lteVopsInfo)) return false; + if (!translate(in.nrIndicators, &out->nrIndicators)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::AppStatus& in, + aidl::android::hardware::radio::AppStatus* out) { + out->appType = static_cast(in.base.appType); + out->appState = static_cast(in.base.appState); + out->persoSubstate = + static_cast(in.persoSubstate); + out->aidPtr = in.base.aidPtr; + out->appLabelPtr = in.base.appLabelPtr; + out->pin1Replaced = static_cast(in.base.pin1Replaced); + out->pin1 = static_cast(in.base.pin1); + out->pin2 = static_cast(in.base.pin2); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CardStatus& in, + aidl::android::hardware::radio::CardStatus* out) { + out->cardState = + static_cast(in.base.base.base.cardState); + out->universalPinState = static_cast( + in.base.base.base.universalPinState); + out->gsmUmtsSubscriptionAppIndex = + static_cast(in.base.base.base.gsmUmtsSubscriptionAppIndex); + out->cdmaSubscriptionAppIndex = + static_cast(in.base.base.base.cdmaSubscriptionAppIndex); + out->imsSubscriptionAppIndex = static_cast(in.base.base.base.imsSubscriptionAppIndex); + { + size_t size = in.applications.size(); + aidl::android::hardware::radio::AppStatus applications; + for (size_t i = 0; i < size; i++) { + if (!translate(in.applications[i], &applications)) return false; + out->applications.push_back(applications); + } + } + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.base.base.physicalSlotId > std::numeric_limits::max() || + in.base.base.physicalSlotId < 0) { + return false; + } + out->physicalSlotId = static_cast(in.base.base.physicalSlotId); + out->atr = in.base.base.atr; + out->iccid = in.base.base.iccid; + out->eid = in.base.eid; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::QosBandwidth& in, + aidl::android::hardware::radio::QosBandwidth* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.maxBitrateKbps > std::numeric_limits::max() || in.maxBitrateKbps < 0) { + return false; + } + out->maxBitrateKbps = static_cast(in.maxBitrateKbps); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.guaranteedBitrateKbps > std::numeric_limits::max() || + in.guaranteedBitrateKbps < 0) { + return false; + } + out->guaranteedBitrateKbps = static_cast(in.guaranteedBitrateKbps); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::EpsQos& in, + aidl::android::hardware::radio::EpsQos* out) { + out->qci = static_cast(in.qci); + if (!translate(in.downlink, &out->downlink)) return false; + if (!translate(in.uplink, &out->uplink)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::NrQos& in, + aidl::android::hardware::radio::NrQos* out) { + out->fiveQi = static_cast(in.fiveQi); + if (!translate(in.downlink, &out->downlink)) return false; + if (!translate(in.uplink, &out->uplink)) return false; + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.qfi > std::numeric_limits::max() || in.qfi < 0) { + return false; + } + out->qfi = static_cast(in.qfi); + out->averagingWindowMs = static_cast(in.averagingWindowMs); + return true; +} + +__attribute__((warn_unused_result)) bool translate(const ::android::hardware::radio::V1_6::Qos& in, + aidl::android::hardware::radio::Qos* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_6::Qos::hidl_discriminator::noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_6::Qos::hidl_discriminator::eps: { + aidl::android::hardware::radio::EpsQos eps; + if (!translate(in.eps(), &eps)) return false; + out->set(eps); + } break; + case ::android::hardware::radio::V1_6::Qos::hidl_discriminator::nr: { + aidl::android::hardware::radio::NrQos nr; + if (!translate(in.nr(), &nr)) return false; + out->set(nr); + } break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::RadioResponseInfo& in, + aidl::android::hardware::radio::RadioResponseInfo* out) { + out->type = static_cast(in.type); + out->serial = static_cast(in.serial); + out->error = static_cast(in.error); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::PortRange& in, + aidl::android::hardware::radio::PortRange* out) { + out->start = static_cast(in.start); + out->end = static_cast(in.end); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::MaybePort& in, + aidl::android::hardware::radio::MaybePort* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_6::MaybePort::hidl_discriminator::noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_6::MaybePort::hidl_discriminator::range: { + aidl::android::hardware::radio::PortRange range; + if (!translate(in.range(), &range)) return false; + out->set(range); + } break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::QosFilter& in, + aidl::android::hardware::radio::QosFilter* out) { + { + size_t size = in.localAddresses.size(); + for (size_t i = 0; i < size; i++) { + out->localAddresses.push_back(in.localAddresses[i]); + } + } + { + size_t size = in.remoteAddresses.size(); + for (size_t i = 0; i < size; i++) { + out->remoteAddresses.push_back(in.remoteAddresses[i]); + } + } + if (!translate(in.localPort, &out->localPort)) return false; + if (!translate(in.remotePort, &out->remotePort)) return false; + out->protocol = static_cast(in.protocol); + if (!translate(in.tos, &out->tos)) return false; + if (!translate(in.flowLabel, &out->flowLabel)) return false; + if (!translate(in.spi, &out->spi)) return false; + out->direction = static_cast(in.direction); + out->precedence = static_cast(in.precedence); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::QosFilter::TypeOfService& in, + aidl::android::hardware::radio::QosFilterTypeOfService* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_6::QosFilter::TypeOfService::hidl_discriminator::noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_6::QosFilter::TypeOfService::hidl_discriminator::value: + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.value() > std::numeric_limits::max() || in.value() < 0) { + return false; + } + *out = static_cast(in.value()); + break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::QosFilter::Ipv6FlowLabel& in, + aidl::android::hardware::radio::QosFilterIpv6FlowLabel* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_6::QosFilter::Ipv6FlowLabel::hidl_discriminator::noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_6::QosFilter::Ipv6FlowLabel::hidl_discriminator::value: + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.value() > std::numeric_limits::max() || in.value() < 0) { + return false; + } + *out = static_cast(in.value()); + break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::QosFilter::IpsecSpi& in, + aidl::android::hardware::radio::QosFilterIpsecSpi* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_6::QosFilter::IpsecSpi::hidl_discriminator::noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_6::QosFilter::IpsecSpi::hidl_discriminator::value: + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.value() > std::numeric_limits::max() || in.value() < 0) { + return false; + } + *out = static_cast(in.value()); + break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::QosSession& in, + aidl::android::hardware::radio::QosSession* out) { + out->qosSessionId = static_cast(in.qosSessionId); + if (!translate(in.qos, &out->qos)) return false; + { + size_t size = in.qosFilters.size(); + aidl::android::hardware::radio::QosFilter qosFilters; + for (size_t i = 0; i < size; i++) { + if (!translate(in.qosFilters[i], &qosFilters)) return false; + out->qosFilters.push_back(qosFilters); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::SetupDataCallResult& in, + aidl::android::hardware::radio::SetupDataCallResult* out) { + out->cause = static_cast(in.cause); + out->suggestedRetryTime = static_cast(in.suggestedRetryTime); + out->cid = static_cast(in.cid); + out->active = static_cast(in.active); + out->type = static_cast(in.type); + out->ifname = in.ifname; + { + size_t size = in.addresses.size(); + aidl::android::hardware::radio::LinkAddress addresses; + for (size_t i = 0; i < size; i++) { + if (!translate(in.addresses[i], &addresses)) return false; + out->addresses.push_back(addresses); + } + } + { + size_t size = in.dnses.size(); + for (size_t i = 0; i < size; i++) { + out->dnses.push_back(in.dnses[i]); + } + } + { + size_t size = in.gateways.size(); + for (size_t i = 0; i < size; i++) { + out->gateways.push_back(in.gateways[i]); + } + } + { + size_t size = in.pcscf.size(); + for (size_t i = 0; i < size; i++) { + out->pcscf.push_back(in.pcscf[i]); + } + } + out->mtuV4 = static_cast(in.mtuV4); + out->mtuV6 = static_cast(in.mtuV6); + if (!translate(in.defaultQos, &out->defaultQos)) return false; + { + size_t size = in.qosSessions.size(); + aidl::android::hardware::radio::QosSession qosSessions; + for (size_t i = 0; i < size; i++) { + if (!translate(in.qosSessions[i], &qosSessions)) return false; + out->qosSessions.push_back(qosSessions); + } + } + out->handoverFailureMode = static_cast( + in.handoverFailureMode); + out->pduSessionId = static_cast(in.pduSessionId); + if (!translate(in.sliceInfo, &out->sliceInfo)) return false; + { + size_t size = in.trafficDescriptors.size(); + aidl::android::hardware::radio::TrafficDescriptor trafficDescriptors; + for (size_t i = 0; i < size; i++) { + if (!translate(in.trafficDescriptors[i], &trafficDescriptors)) return false; + out->trafficDescriptors.push_back(trafficDescriptors); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::LinkCapacityEstimate& in, + aidl::android::hardware::radio::LinkCapacityEstimate* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.downlinkCapacityKbps > std::numeric_limits::max() || + in.downlinkCapacityKbps < 0) { + return false; + } + out->downlinkCapacityKbps = static_cast(in.downlinkCapacityKbps); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.uplinkCapacityKbps > std::numeric_limits::max() || in.uplinkCapacityKbps < 0) { + return false; + } + out->uplinkCapacityKbps = static_cast(in.uplinkCapacityKbps); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.secondaryDownlinkCapacityKbps > std::numeric_limits::max() || + in.secondaryDownlinkCapacityKbps < 0) { + return false; + } + out->secondaryDownlinkCapacityKbps = static_cast(in.secondaryDownlinkCapacityKbps); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.secondaryUplinkCapacityKbps > std::numeric_limits::max() || + in.secondaryUplinkCapacityKbps < 0) { + return false; + } + out->secondaryUplinkCapacityKbps = static_cast(in.secondaryUplinkCapacityKbps); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::NrVopsInfo& in, + aidl::android::hardware::radio::NrVopsInfo* out) { + out->vopsSupported = + static_cast(in.vopsSupported); + out->emcSupported = static_cast(in.emcSupported); + out->emfSupported = static_cast(in.emfSupported); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::LteSignalStrength& in, + aidl::android::hardware::radio::LteSignalStrength* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.base.signalStrength > std::numeric_limits::max() || + in.base.signalStrength < 0) { + return false; + } + out->signalStrength = static_cast(in.base.signalStrength); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.base.rsrp > std::numeric_limits::max() || in.base.rsrp < 0) { + return false; + } + out->rsrp = static_cast(in.base.rsrp); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.base.rsrq > std::numeric_limits::max() || in.base.rsrq < 0) { + return false; + } + out->rsrq = static_cast(in.base.rsrq); + out->rssnr = static_cast(in.base.rssnr); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.base.cqi > std::numeric_limits::max() || in.base.cqi < 0) { + return false; + } + out->cqi = static_cast(in.base.cqi); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.base.timingAdvance > std::numeric_limits::max() || in.base.timingAdvance < 0) { + return false; + } + out->timingAdvance = static_cast(in.base.timingAdvance); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.cqiTableIndex > std::numeric_limits::max() || in.cqiTableIndex < 0) { + return false; + } + out->cqiTableIndex = static_cast(in.cqiTableIndex); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::NrSignalStrength& in, + aidl::android::hardware::radio::NrSignalStrength* out) { + out->ssRsrp = static_cast(in.base.ssRsrp); + out->ssRsrq = static_cast(in.base.ssRsrq); + out->ssSinr = static_cast(in.base.ssSinr); + out->csiRsrp = static_cast(in.base.csiRsrp); + out->csiRsrq = static_cast(in.base.csiRsrq); + out->csiSinr = static_cast(in.base.csiSinr); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.csiCqiTableIndex > std::numeric_limits::max() || in.csiCqiTableIndex < 0) { + return false; + } + out->csiCqiTableIndex = static_cast(in.csiCqiTableIndex); + { + size_t size = in.csiCqiReport.size(); + for (size_t i = 0; i < size; i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.csiCqiReport[i] > std::numeric_limits::max() || in.csiCqiReport[i] < 0) { + return false; + } + out->csiCqiReport.push_back(static_cast(in.csiCqiReport[i])); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::SignalStrength& in, + aidl::android::hardware::radio::SignalStrength* out) { + if (!translate(in.gsm, &out->gsm)) return false; + if (!translate(in.cdma, &out->cdma)) return false; + if (!translate(in.evdo, &out->evdo)) return false; + if (!translate(in.lte, &out->lte)) return false; + if (!translate(in.tdscdma, &out->tdscdma)) return false; + if (!translate(in.wcdma, &out->wcdma)) return false; + if (!translate(in.nr, &out->nr)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::CellInfoLte& in, + aidl::android::hardware::radio::CellInfoLte* out) { + if (!translate(in.cellIdentityLte, &out->cellIdentityLte)) return false; + if (!translate(in.signalStrengthLte, &out->signalStrengthLte)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::CellInfoNr& in, + aidl::android::hardware::radio::CellInfoNr* out) { + if (!translate(in.cellIdentityNr, &out->cellIdentityNr)) return false; + if (!translate(in.signalStrengthNr, &out->signalStrengthNr)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::CellInfo& in, + aidl::android::hardware::radio::CellInfo* out) { + out->registered = static_cast(in.registered); + out->connectionStatus = + static_cast(in.connectionStatus); + if (!translate(in.ratSpecificInfo, &out->ratSpecificInfo)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo& in, + aidl::android::hardware::radio::CellInfoCellInfoRatSpecificInfo* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo:: + hidl_discriminator::gsm: { + aidl::android::hardware::radio::CellInfoGsm gsm; + if (!translate(in.gsm(), &gsm)) return false; + out->set(gsm); + } break; + case ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo:: + hidl_discriminator::wcdma: { + aidl::android::hardware::radio::CellInfoWcdma wcdma; + if (!translate(in.wcdma(), &wcdma)) return false; + out->set(wcdma); + } break; + case ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo:: + hidl_discriminator::tdscdma: { + aidl::android::hardware::radio::CellInfoTdscdma tdscdma; + if (!translate(in.tdscdma(), &tdscdma)) return false; + out->set( + tdscdma); + } break; + case ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo:: + hidl_discriminator::lte: { + aidl::android::hardware::radio::CellInfoLte lte; + if (!translate(in.lte(), <e)) return false; + out->set(lte); + } break; + case ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo:: + hidl_discriminator::nr: { + aidl::android::hardware::radio::CellInfoNr nr; + if (!translate(in.nr(), &nr)) return false; + out->set(nr); + } break; + case ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo:: + hidl_discriminator::cdma: { + aidl::android::hardware::radio::CellInfoCdma cdma; + if (!translate(in.cdma(), &cdma)) return false; + out->set(cdma); + } break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::NetworkScanResult& in, + aidl::android::hardware::radio::NetworkScanResult* out) { + out->status = static_cast(in.status); + out->error = static_cast(in.error); + { + size_t size = in.networkInfos.size(); + aidl::android::hardware::radio::CellInfo networkInfos; + for (size_t i = 0; i < size; i++) { + if (!translate(in.networkInfos[i], &networkInfos)) return false; + out->networkInfos.push_back(networkInfos); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::RegStateResult& in, + aidl::android::hardware::radio::RegStateResult* out) { + out->regState = static_cast(in.regState); + out->rat = static_cast(in.rat); + out->reasonForDenial = + static_cast(in.reasonForDenial); + if (!translate(in.cellIdentity, &out->cellIdentity)) return false; + out->registeredPlmn = in.registeredPlmn; + if (!translate(in.accessTechnologySpecificInfo, &out->accessTechnologySpecificInfo)) + return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::RegStateResult::AccessTechnologySpecificInfo& in, + aidl::android::hardware::radio::RegStateResultAccessTechnologySpecificInfo* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_6::RegStateResult::AccessTechnologySpecificInfo:: + hidl_discriminator::noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_6::RegStateResult::AccessTechnologySpecificInfo:: + hidl_discriminator::cdmaInfo: { + aidl::android::hardware::radio:: + RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo cdmaInfo; + if (!translate(in.cdmaInfo(), &cdmaInfo)) return false; + out->set(cdmaInfo); + } break; + case ::android::hardware::radio::V1_6::RegStateResult::AccessTechnologySpecificInfo:: + hidl_discriminator::eutranInfo: { + aidl::android::hardware::radio:: + RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo eutranInfo; + if (!translate(in.eutranInfo(), &eutranInfo)) return false; + out->set(eutranInfo); + } break; + case ::android::hardware::radio::V1_6::RegStateResult::AccessTechnologySpecificInfo:: + hidl_discriminator::ngranNrVopsInfo: { + aidl::android::hardware::radio::NrVopsInfo ngranNrVopsInfo; + if (!translate(in.ngranNrVopsInfo(), &ngranNrVopsInfo)) return false; + out->set(ngranNrVopsInfo); + } break; + case ::android::hardware::radio::V1_6::RegStateResult::AccessTechnologySpecificInfo:: + hidl_discriminator::geranDtmSupported: + out->set(static_cast(in.geranDtmSupported())); + break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate(const ::android::hardware::radio::V1_6::Call& in, + aidl::android::hardware::radio::Call* out) { + out->state = static_cast(in.base.base.state); + out->index = static_cast(in.base.base.index); + out->toa = static_cast(in.base.base.toa); + out->isMpty = static_cast(in.base.base.isMpty); + out->isMT = static_cast(in.base.base.isMT); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.base.base.als > std::numeric_limits::max() || in.base.base.als < 0) { + return false; + } + out->als = static_cast(in.base.base.als); + out->isVoice = static_cast(in.base.base.isVoice); + out->isVoicePrivacy = static_cast(in.base.base.isVoicePrivacy); + out->number = in.base.base.number; + out->numberPresentation = static_cast( + in.base.base.numberPresentation); + out->name = in.base.base.name; + out->namePresentation = static_cast( + in.base.base.namePresentation); + { + size_t size = in.base.base.uusInfo.size(); + aidl::android::hardware::radio::UusInfo uusInfo; + for (size_t i = 0; i < size; i++) { + if (!translate(in.base.base.uusInfo[i], &uusInfo)) return false; + out->uusInfo.push_back(uusInfo); + } + } + out->audioQuality = + static_cast(in.base.audioQuality); + out->forwardedNumber = in.forwardedNumber; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::PhysicalChannelConfig& in, + aidl::android::hardware::radio::PhysicalChannelConfig* out) { + out->status = static_cast(in.status); + out->rat = static_cast(in.rat); + out->downlinkChannelNumber = static_cast(in.downlinkChannelNumber); + out->uplinkChannelNumber = static_cast(in.uplinkChannelNumber); + out->cellBandwidthDownlinkKhz = static_cast(in.cellBandwidthDownlinkKhz); + out->cellBandwidthUplinkKhz = static_cast(in.cellBandwidthUplinkKhz); + { + size_t size = in.contextIds.size(); + for (size_t i = 0; i < size; i++) { + out->contextIds.push_back(static_cast(in.contextIds[i])); + } + } + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.physicalCellId > std::numeric_limits::max() || in.physicalCellId < 0) { + return false; + } + out->physicalCellId = static_cast(in.physicalCellId); + if (!translate(in.band, &out->band)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::PhysicalChannelConfig::Band& in, + aidl::android::hardware::radio::PhysicalChannelConfigBand* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_6::PhysicalChannelConfig::Band::hidl_discriminator:: + geranBand: + *out = static_cast(in.geranBand()); + break; + case ::android::hardware::radio::V1_6::PhysicalChannelConfig::Band::hidl_discriminator:: + utranBand: + *out = static_cast(in.utranBand()); + break; + case ::android::hardware::radio::V1_6::PhysicalChannelConfig::Band::hidl_discriminator:: + eutranBand: + *out = static_cast(in.eutranBand()); + break; + case ::android::hardware::radio::V1_6::PhysicalChannelConfig::Band::hidl_discriminator:: + ngranBand: + *out = static_cast(in.ngranBand()); + break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::OptionalSliceInfo& in, + aidl::android::hardware::radio::OptionalSliceInfo* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_6::OptionalSliceInfo::hidl_discriminator::noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_6::OptionalSliceInfo::hidl_discriminator::value: { + aidl::android::hardware::radio::SliceInfo value; + if (!translate(in.value(), &value)) return false; + out->set(value); + } break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::SliceInfo& in, + aidl::android::hardware::radio::SliceInfo* out) { + out->sst = static_cast(in.sst); + out->sliceDifferentiator = static_cast(in.sliceDifferentiator); + out->mappedHplmnSst = + static_cast(in.mappedHplmnSst); + out->mappedHplmnSD = static_cast(in.mappedHplmnSD); + out->status = static_cast(in.status); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::OptionalDnn& in, + aidl::android::hardware::radio::OptionalDnn* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_6::OptionalDnn::hidl_discriminator::noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_6::OptionalDnn::hidl_discriminator::value: + *out = in.value(); + break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::OptionalOsAppId& in, + aidl::android::hardware::radio::OptionalOsAppId* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_6::OptionalOsAppId::hidl_discriminator::noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_6::OptionalOsAppId::hidl_discriminator::value: { + aidl::android::hardware::radio::OsAppId value; + if (!translate(in.value(), &value)) return false; + out->set(value); + } break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::OptionalTrafficDescriptor& in, + aidl::android::hardware::radio::OptionalTrafficDescriptor* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_6::OptionalTrafficDescriptor::hidl_discriminator:: + noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_6::OptionalTrafficDescriptor::hidl_discriminator:: + value: { + aidl::android::hardware::radio::TrafficDescriptor value; + if (!translate(in.value(), &value)) return false; + out->set(value); + } break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::TrafficDescriptor& in, + aidl::android::hardware::radio::TrafficDescriptor* out) { + if (!translate(in.dnn, &out->dnn)) return false; + if (!translate(in.osAppId, &out->osAppId)) return false; + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::OsAppId& in, + aidl::android::hardware::radio::OsAppId* out) { + { + size_t size = in.osAppId.size(); + for (size_t i = 0; i < size; i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.osAppId[i] > std::numeric_limits::max() || in.osAppId[i] < 0) { + return false; + } + out->osAppId.push_back(static_cast(in.osAppId[i])); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::SlicingConfig& in, + aidl::android::hardware::radio::SlicingConfig* out) { + { + size_t size = in.urspRules.size(); + aidl::android::hardware::radio::UrspRule urspRules; + for (size_t i = 0; i < size; i++) { + if (!translate(in.urspRules[i], &urspRules)) return false; + out->urspRules.push_back(urspRules); + } + } + { + size_t size = in.sliceInfo.size(); + aidl::android::hardware::radio::SliceInfo sliceInfo; + for (size_t i = 0; i < size; i++) { + if (!translate(in.sliceInfo[i], &sliceInfo)) return false; + out->sliceInfo.push_back(sliceInfo); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::UrspRule& in, + aidl::android::hardware::radio::UrspRule* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.precedence > std::numeric_limits::max() || in.precedence < 0) { + return false; + } + out->precedence = static_cast(in.precedence); + { + size_t size = in.trafficDescriptors.size(); + aidl::android::hardware::radio::TrafficDescriptor trafficDescriptors; + for (size_t i = 0; i < size; i++) { + if (!translate(in.trafficDescriptors[i], &trafficDescriptors)) return false; + out->trafficDescriptors.push_back(trafficDescriptors); + } + } + { + size_t size = in.routeSelectionDescriptor.size(); + aidl::android::hardware::radio::RouteSelectionDescriptor routeSelectionDescriptor; + for (size_t i = 0; i < size; i++) { + if (!translate(in.routeSelectionDescriptor[i], &routeSelectionDescriptor)) return false; + out->routeSelectionDescriptor.push_back(routeSelectionDescriptor); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::RouteSelectionDescriptor& in, + aidl::android::hardware::radio::RouteSelectionDescriptor* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.precedence > std::numeric_limits::max() || in.precedence < 0) { + return false; + } + out->precedence = static_cast(in.precedence); + if (!translate(in.sessionType, &out->sessionType)) return false; + if (!translate(in.sscMode, &out->sscMode)) return false; + { + size_t size = in.sliceInfo.size(); + aidl::android::hardware::radio::SliceInfo sliceInfo; + for (size_t i = 0; i < size; i++) { + if (!translate(in.sliceInfo[i], &sliceInfo)) return false; + out->sliceInfo.push_back(sliceInfo); + } + } + { + size_t size = in.dnn.size(); + for (size_t i = 0; i < size; i++) { + out->dnn.push_back(in.dnn[i]); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::OptionalPdpProtocolType& in, + aidl::android::hardware::radio::OptionalPdpProtocolType* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_6::OptionalPdpProtocolType::hidl_discriminator::noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_6::OptionalPdpProtocolType::hidl_discriminator::value: + *out = static_cast(in.value()); + break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::OptionalSscMode& in, + aidl::android::hardware::radio::OptionalSscMode* out) { + switch (in.getDiscriminator()) { + case ::android::hardware::radio::V1_6::OptionalSscMode::hidl_discriminator::noinit: + // Nothing to translate for Monostate. + break; + case ::android::hardware::radio::V1_6::OptionalSscMode::hidl_discriminator::value: + *out = static_cast(in.value()); + break; + default: + return false; + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::ImsiEncryptionInfo& in, + aidl::android::hardware::radio::ImsiEncryptionInfo* out) { + out->mcc = in.base.mcc; + out->mnc = in.base.mnc; + { + size_t size = in.base.carrierKey.size(); + for (size_t i = 0; i < size; i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.base.carrierKey[i] > std::numeric_limits::max() || + in.base.carrierKey[i] < 0) { + return false; + } + out->carrierKey.push_back(static_cast(in.base.carrierKey[i])); + } + } + out->keyIdentifier = in.base.keyIdentifier; + out->expirationTime = static_cast(in.base.expirationTime); + out->keyType = static_cast(in.keyType); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::PhonebookRecordInfo& in, + aidl::android::hardware::radio::PhonebookRecordInfo* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.recordId > std::numeric_limits::max() || in.recordId < 0) { + return false; + } + out->recordId = static_cast(in.recordId); + out->name = in.name; + out->number = in.number; + { + size_t size = in.emails.size(); + for (size_t i = 0; i < size; i++) { + out->emails.push_back(in.emails[i]); + } + } + { + size_t size = in.additionalNumbers.size(); + for (size_t i = 0; i < size; i++) { + out->additionalNumbers.push_back(in.additionalNumbers[i]); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::PhonebookCapacity& in, + aidl::android::hardware::radio::PhonebookCapacity* out) { + out->maxAdnRecords = static_cast(in.maxAdnRecords); + out->usedAdnRecords = static_cast(in.usedAdnRecords); + out->maxEmailRecords = static_cast(in.maxEmailRecords); + out->usedEmailRecords = static_cast(in.usedEmailRecords); + out->maxAdditionalNumberRecords = static_cast(in.maxAdditionalNumberRecords); + out->usedAdditionalNumberRecords = static_cast(in.usedAdditionalNumberRecords); + out->maxNameLen = static_cast(in.maxNameLen); + out->maxNumberLen = static_cast(in.maxNumberLen); + out->maxEmailLen = static_cast(in.maxEmailLen); + out->maxAdditionalNumberLen = static_cast(in.maxAdditionalNumberLen); + return true; +} + +} // namespace android::h2a diff --git a/radio/aidl/include/android/hardware/radio/translate-ndk.h b/radio/aidl/include/android/hardware/radio/translate-ndk.h new file mode 100644 index 0000000000..b13602905f --- /dev/null +++ b/radio/aidl/include/android/hardware/radio/translate-ndk.h @@ -0,0 +1,699 @@ +/* + * 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 +#include "aidl/android/hardware/radio/AccessNetwork.h" +#include "aidl/android/hardware/radio/ActivityStatsInfo.h" +#include "aidl/android/hardware/radio/AddressProperty.h" +#include "aidl/android/hardware/radio/ApnAuthType.h" +#include "aidl/android/hardware/radio/ApnTypes.h" +#include "aidl/android/hardware/radio/AppState.h" +#include "aidl/android/hardware/radio/AppStatus.h" +#include "aidl/android/hardware/radio/AppType.h" +#include "aidl/android/hardware/radio/AudioQuality.h" +#include "aidl/android/hardware/radio/BarringInfo.h" +#include "aidl/android/hardware/radio/BarringInfoBarringType.h" +#include "aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.h" +#include "aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.h" +#include "aidl/android/hardware/radio/BarringInfoServiceType.h" +#include "aidl/android/hardware/radio/Call.h" +#include "aidl/android/hardware/radio/CallForwardInfo.h" +#include "aidl/android/hardware/radio/CallForwardInfoStatus.h" +#include "aidl/android/hardware/radio/CallPresentation.h" +#include "aidl/android/hardware/radio/CallState.h" +#include "aidl/android/hardware/radio/CardPowerState.h" +#include "aidl/android/hardware/radio/CardState.h" +#include "aidl/android/hardware/radio/CardStatus.h" +#include "aidl/android/hardware/radio/Carrier.h" +#include "aidl/android/hardware/radio/CarrierMatchType.h" +#include "aidl/android/hardware/radio/CarrierRestrictions.h" +#include "aidl/android/hardware/radio/CarrierRestrictionsWithPriority.h" +#include "aidl/android/hardware/radio/CdmaBroadcastSmsConfigInfo.h" +#include "aidl/android/hardware/radio/CdmaCallWaiting.h" +#include "aidl/android/hardware/radio/CdmaCallWaitingNumberPlan.h" +#include "aidl/android/hardware/radio/CdmaCallWaitingNumberPresentation.h" +#include "aidl/android/hardware/radio/CdmaCallWaitingNumberType.h" +#include "aidl/android/hardware/radio/CdmaDisplayInfoRecord.h" +#include "aidl/android/hardware/radio/CdmaInfoRecName.h" +#include "aidl/android/hardware/radio/CdmaInformationRecord.h" +#include "aidl/android/hardware/radio/CdmaInformationRecords.h" +#include "aidl/android/hardware/radio/CdmaLineControlInfoRecord.h" +#include "aidl/android/hardware/radio/CdmaNumberInfoRecord.h" +#include "aidl/android/hardware/radio/CdmaOtaProvisionStatus.h" +#include "aidl/android/hardware/radio/CdmaRedirectingNumberInfoRecord.h" +#include "aidl/android/hardware/radio/CdmaRedirectingReason.h" +#include "aidl/android/hardware/radio/CdmaRoamingType.h" +#include "aidl/android/hardware/radio/CdmaSignalInfoRecord.h" +#include "aidl/android/hardware/radio/CdmaSignalStrength.h" +#include "aidl/android/hardware/radio/CdmaSmsAck.h" +#include "aidl/android/hardware/radio/CdmaSmsAddress.h" +#include "aidl/android/hardware/radio/CdmaSmsDigitMode.h" +#include "aidl/android/hardware/radio/CdmaSmsErrorClass.h" +#include "aidl/android/hardware/radio/CdmaSmsMessage.h" +#include "aidl/android/hardware/radio/CdmaSmsNumberMode.h" +#include "aidl/android/hardware/radio/CdmaSmsNumberPlan.h" +#include "aidl/android/hardware/radio/CdmaSmsNumberType.h" +#include "aidl/android/hardware/radio/CdmaSmsSubaddress.h" +#include "aidl/android/hardware/radio/CdmaSmsSubaddressType.h" +#include "aidl/android/hardware/radio/CdmaSmsWriteArgs.h" +#include "aidl/android/hardware/radio/CdmaSmsWriteArgsStatus.h" +#include "aidl/android/hardware/radio/CdmaSubscriptionSource.h" +#include "aidl/android/hardware/radio/CdmaT53AudioControlInfoRecord.h" +#include "aidl/android/hardware/radio/CdmaT53ClirInfoRecord.h" +#include "aidl/android/hardware/radio/CellConfigLte.h" +#include "aidl/android/hardware/radio/CellConnectionStatus.h" +#include "aidl/android/hardware/radio/CellIdentity.h" +#include "aidl/android/hardware/radio/CellIdentityCdma.h" +#include "aidl/android/hardware/radio/CellIdentityGsm.h" +#include "aidl/android/hardware/radio/CellIdentityLte.h" +#include "aidl/android/hardware/radio/CellIdentityNr.h" +#include "aidl/android/hardware/radio/CellIdentityOperatorNames.h" +#include "aidl/android/hardware/radio/CellIdentityTdscdma.h" +#include "aidl/android/hardware/radio/CellIdentityWcdma.h" +#include "aidl/android/hardware/radio/CellInfo.h" +#include "aidl/android/hardware/radio/CellInfoCdma.h" +#include "aidl/android/hardware/radio/CellInfoCellInfoRatSpecificInfo.h" +#include "aidl/android/hardware/radio/CellInfoGsm.h" +#include "aidl/android/hardware/radio/CellInfoInfo.h" +#include "aidl/android/hardware/radio/CellInfoLte.h" +#include "aidl/android/hardware/radio/CellInfoNr.h" +#include "aidl/android/hardware/radio/CellInfoTdscdma.h" +#include "aidl/android/hardware/radio/CellInfoType.h" +#include "aidl/android/hardware/radio/CellInfoWcdma.h" +#include "aidl/android/hardware/radio/CfData.h" +#include "aidl/android/hardware/radio/ClipStatus.h" +#include "aidl/android/hardware/radio/Clir.h" +#include "aidl/android/hardware/radio/ClosedSubscriberGroupInfo.h" +#include "aidl/android/hardware/radio/DataCallFailCause.h" +#include "aidl/android/hardware/radio/DataConnActiveStatus.h" +#include "aidl/android/hardware/radio/DataProfileId.h" +#include "aidl/android/hardware/radio/DataProfileInfo.h" +#include "aidl/android/hardware/radio/DataProfileInfoType.h" +#include "aidl/android/hardware/radio/DataRegStateResult.h" +#include "aidl/android/hardware/radio/DataRegStateResultVopsInfo.h" +#include "aidl/android/hardware/radio/DataRequestReason.h" +#include "aidl/android/hardware/radio/DataThrottlingAction.h" +#include "aidl/android/hardware/radio/DeviceStateType.h" +#include "aidl/android/hardware/radio/Dial.h" +#include "aidl/android/hardware/radio/Domain.h" +#include "aidl/android/hardware/radio/EmcIndicator.h" +#include "aidl/android/hardware/radio/EmergencyCallRouting.h" +#include "aidl/android/hardware/radio/EmergencyNumber.h" +#include "aidl/android/hardware/radio/EmergencyNumberSource.h" +#include "aidl/android/hardware/radio/EmergencyServiceCategory.h" +#include "aidl/android/hardware/radio/EmfIndicator.h" +#include "aidl/android/hardware/radio/EpsQos.h" +#include "aidl/android/hardware/radio/EutranBands.h" +#include "aidl/android/hardware/radio/EvdoSignalStrength.h" +#include "aidl/android/hardware/radio/FrequencyRange.h" +#include "aidl/android/hardware/radio/GeranBands.h" +#include "aidl/android/hardware/radio/GsmBroadcastSmsConfigInfo.h" +#include "aidl/android/hardware/radio/GsmSignalStrength.h" +#include "aidl/android/hardware/radio/GsmSmsMessage.h" +#include "aidl/android/hardware/radio/HandoverFailureMode.h" +#include "aidl/android/hardware/radio/HardwareConfig.h" +#include "aidl/android/hardware/radio/HardwareConfigModem.h" +#include "aidl/android/hardware/radio/HardwareConfigSim.h" +#include "aidl/android/hardware/radio/HardwareConfigState.h" +#include "aidl/android/hardware/radio/HardwareConfigType.h" +#include "aidl/android/hardware/radio/IccIo.h" +#include "aidl/android/hardware/radio/IccIoResult.h" +#include "aidl/android/hardware/radio/ImsSmsMessage.h" +#include "aidl/android/hardware/radio/ImsiEncryptionInfo.h" +#include "aidl/android/hardware/radio/IncrementalResultsPeriodicityRange.h" +#include "aidl/android/hardware/radio/IndicationFilter.h" +#include "aidl/android/hardware/radio/KeepaliveRequest.h" +#include "aidl/android/hardware/radio/KeepaliveStatus.h" +#include "aidl/android/hardware/radio/KeepaliveStatusCode.h" +#include "aidl/android/hardware/radio/KeepaliveType.h" +#include "aidl/android/hardware/radio/LastCallFailCause.h" +#include "aidl/android/hardware/radio/LastCallFailCauseInfo.h" +#include "aidl/android/hardware/radio/LceDataInfo.h" +#include "aidl/android/hardware/radio/LceStatus.h" +#include "aidl/android/hardware/radio/LceStatusInfo.h" +#include "aidl/android/hardware/radio/LinkAddress.h" +#include "aidl/android/hardware/radio/LinkCapacityEstimate.h" +#include "aidl/android/hardware/radio/LteSignalStrength.h" +#include "aidl/android/hardware/radio/LteVopsInfo.h" +#include "aidl/android/hardware/radio/MaxSearchTimeRange.h" +#include "aidl/android/hardware/radio/MaybePort.h" +#include "aidl/android/hardware/radio/MvnoType.h" +#include "aidl/android/hardware/radio/NeighboringCell.h" +#include "aidl/android/hardware/radio/NetworkScanRequest.h" +#include "aidl/android/hardware/radio/NetworkScanResult.h" +#include "aidl/android/hardware/radio/NgranBands.h" +#include "aidl/android/hardware/radio/NrDualConnectivityState.h" +#include "aidl/android/hardware/radio/NrIndicators.h" +#include "aidl/android/hardware/radio/NrQos.h" +#include "aidl/android/hardware/radio/NrSignalStrength.h" +#include "aidl/android/hardware/radio/NrVopsInfo.h" +#include "aidl/android/hardware/radio/NvItem.h" +#include "aidl/android/hardware/radio/NvWriteItem.h" +#include "aidl/android/hardware/radio/OperatorInfo.h" +#include "aidl/android/hardware/radio/OperatorStatus.h" +#include "aidl/android/hardware/radio/OptionalCsgInfo.h" +#include "aidl/android/hardware/radio/OptionalDnn.h" +#include "aidl/android/hardware/radio/OptionalOsAppId.h" +#include "aidl/android/hardware/radio/OptionalPdpProtocolType.h" +#include "aidl/android/hardware/radio/OptionalSliceInfo.h" +#include "aidl/android/hardware/radio/OptionalSscMode.h" +#include "aidl/android/hardware/radio/OptionalTrafficDescriptor.h" +#include "aidl/android/hardware/radio/OsAppId.h" +#include "aidl/android/hardware/radio/P2Constant.h" +#include "aidl/android/hardware/radio/PbReceivedStatus.h" +#include "aidl/android/hardware/radio/PcoDataInfo.h" +#include "aidl/android/hardware/radio/PdpProtocolType.h" +#include "aidl/android/hardware/radio/PersoSubstate.h" +#include "aidl/android/hardware/radio/PhoneRestrictedState.h" +#include "aidl/android/hardware/radio/PhonebookCapacity.h" +#include "aidl/android/hardware/radio/PhonebookRecordInfo.h" +#include "aidl/android/hardware/radio/PhysicalChannelConfig.h" +#include "aidl/android/hardware/radio/PhysicalChannelConfigBand.h" +#include "aidl/android/hardware/radio/PinState.h" +#include "aidl/android/hardware/radio/PortRange.h" +#include "aidl/android/hardware/radio/PreferredNetworkType.h" +#include "aidl/android/hardware/radio/PrlIndicator.h" +#include "aidl/android/hardware/radio/PublicKeyType.h" +#include "aidl/android/hardware/radio/Qos.h" +#include "aidl/android/hardware/radio/QosBandwidth.h" +#include "aidl/android/hardware/radio/QosFilter.h" +#include "aidl/android/hardware/radio/QosFilterDirection.h" +#include "aidl/android/hardware/radio/QosFilterIpsecSpi.h" +#include "aidl/android/hardware/radio/QosFilterIpv6FlowLabel.h" +#include "aidl/android/hardware/radio/QosFilterTypeOfService.h" +#include "aidl/android/hardware/radio/QosFlowIdRange.h" +#include "aidl/android/hardware/radio/QosPortRange.h" +#include "aidl/android/hardware/radio/QosProtocol.h" +#include "aidl/android/hardware/radio/QosSession.h" +#include "aidl/android/hardware/radio/RadioAccessFamily.h" +#include "aidl/android/hardware/radio/RadioAccessNetworks.h" +#include "aidl/android/hardware/radio/RadioAccessSpecifier.h" +#include "aidl/android/hardware/radio/RadioAccessSpecifierBands.h" +#include "aidl/android/hardware/radio/RadioBandMode.h" +#include "aidl/android/hardware/radio/RadioCapability.h" +#include "aidl/android/hardware/radio/RadioCapabilityPhase.h" +#include "aidl/android/hardware/radio/RadioCapabilityStatus.h" +#include "aidl/android/hardware/radio/RadioCdmaSmsConst.h" +#include "aidl/android/hardware/radio/RadioConst.h" +#include "aidl/android/hardware/radio/RadioError.h" +#include "aidl/android/hardware/radio/RadioFrequencyInfo.h" +#include "aidl/android/hardware/radio/RadioIndicationType.h" +#include "aidl/android/hardware/radio/RadioResponseInfo.h" +#include "aidl/android/hardware/radio/RadioResponseInfoModem.h" +#include "aidl/android/hardware/radio/RadioResponseType.h" +#include "aidl/android/hardware/radio/RadioState.h" +#include "aidl/android/hardware/radio/RadioTechnology.h" +#include "aidl/android/hardware/radio/RadioTechnologyFamily.h" +#include "aidl/android/hardware/radio/RegState.h" +#include "aidl/android/hardware/radio/RegStateResult.h" +#include "aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.h" +#include "aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.h" +#include "aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.h" +#include "aidl/android/hardware/radio/RegistrationFailCause.h" +#include "aidl/android/hardware/radio/ResetNvType.h" +#include "aidl/android/hardware/radio/RestrictedState.h" +#include "aidl/android/hardware/radio/RouteSelectionDescriptor.h" +#include "aidl/android/hardware/radio/SapApduType.h" +#include "aidl/android/hardware/radio/SapConnectRsp.h" +#include "aidl/android/hardware/radio/SapDisconnectType.h" +#include "aidl/android/hardware/radio/SapResultCode.h" +#include "aidl/android/hardware/radio/SapStatus.h" +#include "aidl/android/hardware/radio/SapTransferProtocol.h" +#include "aidl/android/hardware/radio/ScanIntervalRange.h" +#include "aidl/android/hardware/radio/ScanStatus.h" +#include "aidl/android/hardware/radio/ScanType.h" +#include "aidl/android/hardware/radio/SelectUiccSub.h" +#include "aidl/android/hardware/radio/SendSmsResult.h" +#include "aidl/android/hardware/radio/SetupDataCallResult.h" +#include "aidl/android/hardware/radio/SignalMeasurementType.h" +#include "aidl/android/hardware/radio/SignalStrength.h" +#include "aidl/android/hardware/radio/SignalThresholdInfo.h" +#include "aidl/android/hardware/radio/SimApdu.h" +#include "aidl/android/hardware/radio/SimLockMultiSimPolicy.h" +#include "aidl/android/hardware/radio/SimRefreshResult.h" +#include "aidl/android/hardware/radio/SimRefreshType.h" +#include "aidl/android/hardware/radio/SliceInfo.h" +#include "aidl/android/hardware/radio/SliceServiceType.h" +#include "aidl/android/hardware/radio/SliceStatus.h" +#include "aidl/android/hardware/radio/SlicingConfig.h" +#include "aidl/android/hardware/radio/SmsAcknowledgeFailCause.h" +#include "aidl/android/hardware/radio/SmsWriteArgs.h" +#include "aidl/android/hardware/radio/SmsWriteArgsStatus.h" +#include "aidl/android/hardware/radio/SrvccState.h" +#include "aidl/android/hardware/radio/SsInfoData.h" +#include "aidl/android/hardware/radio/SsRequestType.h" +#include "aidl/android/hardware/radio/SsServiceType.h" +#include "aidl/android/hardware/radio/SsTeleserviceType.h" +#include "aidl/android/hardware/radio/SscMode.h" +#include "aidl/android/hardware/radio/StkCcUnsolSsResult.h" +#include "aidl/android/hardware/radio/SubscriptionType.h" +#include "aidl/android/hardware/radio/SuppServiceClass.h" +#include "aidl/android/hardware/radio/SuppSvcNotification.h" +#include "aidl/android/hardware/radio/TdscdmaSignalStrength.h" +#include "aidl/android/hardware/radio/TimeStampType.h" +#include "aidl/android/hardware/radio/TrafficDescriptor.h" +#include "aidl/android/hardware/radio/TtyMode.h" +#include "aidl/android/hardware/radio/UiccSubActStatus.h" +#include "aidl/android/hardware/radio/UrspRule.h" +#include "aidl/android/hardware/radio/UssdModeType.h" +#include "aidl/android/hardware/radio/UtranBands.h" +#include "aidl/android/hardware/radio/UusDcs.h" +#include "aidl/android/hardware/radio/UusInfo.h" +#include "aidl/android/hardware/radio/UusType.h" +#include "aidl/android/hardware/radio/VoiceRegStateResult.h" +#include "aidl/android/hardware/radio/VopsIndicator.h" +#include "aidl/android/hardware/radio/WcdmaSignalStrength.h" +#include "android/hardware/radio/1.0/types.h" +#include "android/hardware/radio/1.1/types.h" +#include "android/hardware/radio/1.2/types.h" +#include "android/hardware/radio/1.3/types.h" +#include "android/hardware/radio/1.4/types.h" +#include "android/hardware/radio/1.5/types.h" +#include "android/hardware/radio/1.6/types.h" + +namespace android::h2a { + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::IccIo& in, + aidl::android::hardware::radio::IccIo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::NeighboringCell& in, + aidl::android::hardware::radio::NeighboringCell* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::UusInfo& in, + aidl::android::hardware::radio::UusInfo* out); +__attribute__((warn_unused_result)) bool translate(const ::android::hardware::radio::V1_0::Dial& in, + aidl::android::hardware::radio::Dial* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::LastCallFailCauseInfo& in, + aidl::android::hardware::radio::LastCallFailCauseInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::GsmSignalStrength& in, + aidl::android::hardware::radio::GsmSignalStrength* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaSignalStrength& in, + aidl::android::hardware::radio::CdmaSignalStrength* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::EvdoSignalStrength& in, + aidl::android::hardware::radio::EvdoSignalStrength* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::SendSmsResult& in, + aidl::android::hardware::radio::SendSmsResult* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::IccIoResult& in, + aidl::android::hardware::radio::IccIoResult* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CallForwardInfo& in, + aidl::android::hardware::radio::CallForwardInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::OperatorInfo& in, + aidl::android::hardware::radio::OperatorInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::SmsWriteArgs& in, + aidl::android::hardware::radio::SmsWriteArgs* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaSmsAddress& in, + aidl::android::hardware::radio::CdmaSmsAddress* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaSmsSubaddress& in, + aidl::android::hardware::radio::CdmaSmsSubaddress* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaSmsMessage& in, + aidl::android::hardware::radio::CdmaSmsMessage* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaSmsAck& in, + aidl::android::hardware::radio::CdmaSmsAck* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaBroadcastSmsConfigInfo& in, + aidl::android::hardware::radio::CdmaBroadcastSmsConfigInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaSmsWriteArgs& in, + aidl::android::hardware::radio::CdmaSmsWriteArgs* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::GsmBroadcastSmsConfigInfo& in, + aidl::android::hardware::radio::GsmBroadcastSmsConfigInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::GsmSmsMessage& in, + aidl::android::hardware::radio::GsmSmsMessage* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::ImsSmsMessage& in, + aidl::android::hardware::radio::ImsSmsMessage* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::SimApdu& in, + aidl::android::hardware::radio::SimApdu* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::NvWriteItem& in, + aidl::android::hardware::radio::NvWriteItem* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::SelectUiccSub& in, + aidl::android::hardware::radio::SelectUiccSub* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::HardwareConfigModem& in, + aidl::android::hardware::radio::HardwareConfigModem* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::HardwareConfigSim& in, + aidl::android::hardware::radio::HardwareConfigSim* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::HardwareConfig& in, + aidl::android::hardware::radio::HardwareConfig* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::LceStatusInfo& in, + aidl::android::hardware::radio::LceStatusInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::LceDataInfo& in, + aidl::android::hardware::radio::LceDataInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::ActivityStatsInfo& in, + aidl::android::hardware::radio::ActivityStatsInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::Carrier& in, + aidl::android::hardware::radio::Carrier* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CarrierRestrictions& in, + aidl::android::hardware::radio::CarrierRestrictions* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::SuppSvcNotification& in, + aidl::android::hardware::radio::SuppSvcNotification* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::SimRefreshResult& in, + aidl::android::hardware::radio::SimRefreshResult* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaSignalInfoRecord& in, + aidl::android::hardware::radio::CdmaSignalInfoRecord* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaCallWaiting& in, + aidl::android::hardware::radio::CdmaCallWaiting* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaDisplayInfoRecord& in, + aidl::android::hardware::radio::CdmaDisplayInfoRecord* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaNumberInfoRecord& in, + aidl::android::hardware::radio::CdmaNumberInfoRecord* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaRedirectingNumberInfoRecord& in, + aidl::android::hardware::radio::CdmaRedirectingNumberInfoRecord* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaLineControlInfoRecord& in, + aidl::android::hardware::radio::CdmaLineControlInfoRecord* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaT53ClirInfoRecord& in, + aidl::android::hardware::radio::CdmaT53ClirInfoRecord* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaT53AudioControlInfoRecord& in, + aidl::android::hardware::radio::CdmaT53AudioControlInfoRecord* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaInformationRecord& in, + aidl::android::hardware::radio::CdmaInformationRecord* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CdmaInformationRecords& in, + aidl::android::hardware::radio::CdmaInformationRecords* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::CfData& in, + aidl::android::hardware::radio::CfData* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::SsInfoData& in, + aidl::android::hardware::radio::SsInfoData* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::StkCcUnsolSsResult& in, + aidl::android::hardware::radio::StkCcUnsolSsResult* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_0::PcoDataInfo& in, + aidl::android::hardware::radio::PcoDataInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_1::KeepaliveRequest& in, + aidl::android::hardware::radio::KeepaliveRequest* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_1::KeepaliveStatus& in, + aidl::android::hardware::radio::KeepaliveStatus* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_2::CellIdentityOperatorNames& in, + aidl::android::hardware::radio::CellIdentityOperatorNames* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_2::CellIdentityCdma& in, + aidl::android::hardware::radio::CellIdentityCdma* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_2::CellInfoCdma& in, + aidl::android::hardware::radio::CellInfoCdma* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_2::WcdmaSignalStrength& in, + aidl::android::hardware::radio::WcdmaSignalStrength* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_2::TdscdmaSignalStrength& in, + aidl::android::hardware::radio::TdscdmaSignalStrength* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_2::VoiceRegStateResult& in, + aidl::android::hardware::radio::VoiceRegStateResult* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_3::RadioResponseInfoModem& in, + aidl::android::hardware::radio::RadioResponseInfoModem* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::EmergencyNumber& in, + aidl::android::hardware::radio::EmergencyNumber* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::RadioFrequencyInfo& in, + aidl::android::hardware::radio::RadioFrequencyInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::LteVopsInfo& in, + aidl::android::hardware::radio::LteVopsInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::NrIndicators& in, + aidl::android::hardware::radio::NrIndicators* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::DataRegStateResult& in, + aidl::android::hardware::radio::DataRegStateResult* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::DataRegStateResult::VopsInfo& in, + aidl::android::hardware::radio::DataRegStateResultVopsInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::CellConfigLte& in, + aidl::android::hardware::radio::CellConfigLte* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::CellInfo::Info& in, + aidl::android::hardware::radio::CellInfoInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::RadioCapability& in, + aidl::android::hardware::radio::RadioCapability* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_4::CarrierRestrictionsWithPriority& in, + aidl::android::hardware::radio::CarrierRestrictionsWithPriority* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::RadioAccessSpecifier& in, + aidl::android::hardware::radio::RadioAccessSpecifier* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands& in, + aidl::android::hardware::radio::RadioAccessSpecifierBands* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::SignalThresholdInfo& in, + aidl::android::hardware::radio::SignalThresholdInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::NetworkScanRequest& in, + aidl::android::hardware::radio::NetworkScanRequest* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::DataProfileInfo& in, + aidl::android::hardware::radio::DataProfileInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::LinkAddress& in, + aidl::android::hardware::radio::LinkAddress* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::ClosedSubscriberGroupInfo& in, + aidl::android::hardware::radio::ClosedSubscriberGroupInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::OptionalCsgInfo& in, + aidl::android::hardware::radio::OptionalCsgInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellIdentityGsm& in, + aidl::android::hardware::radio::CellIdentityGsm* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellIdentityWcdma& in, + aidl::android::hardware::radio::CellIdentityWcdma* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellIdentityTdscdma& in, + aidl::android::hardware::radio::CellIdentityTdscdma* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellIdentityLte& in, + aidl::android::hardware::radio::CellIdentityLte* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellIdentityNr& in, + aidl::android::hardware::radio::CellIdentityNr* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellInfoGsm& in, + aidl::android::hardware::radio::CellInfoGsm* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellInfoWcdma& in, + aidl::android::hardware::radio::CellInfoWcdma* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellInfoTdscdma& in, + aidl::android::hardware::radio::CellInfoTdscdma* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CellIdentity& in, + aidl::android::hardware::radio::CellIdentity* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::BarringInfo& in, + aidl::android::hardware::radio::BarringInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::BarringInfo::BarringTypeSpecificInfo::Conditional& + in, + aidl::android::hardware::radio::BarringInfoBarringTypeSpecificInfoConditional* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::BarringInfo::BarringTypeSpecificInfo& in, + aidl::android::hardware::radio::BarringInfoBarringTypeSpecificInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::RegStateResult::AccessTechnologySpecificInfo:: + Cdma2000RegistrationInfo& in, + aidl::android::hardware::radio:: + RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::RegStateResult::AccessTechnologySpecificInfo:: + EutranRegistrationInfo& in, + aidl::android::hardware::radio:: + RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::AppStatus& in, + aidl::android::hardware::radio::AppStatus* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_5::CardStatus& in, + aidl::android::hardware::radio::CardStatus* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::QosBandwidth& in, + aidl::android::hardware::radio::QosBandwidth* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::EpsQos& in, + aidl::android::hardware::radio::EpsQos* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::NrQos& in, + aidl::android::hardware::radio::NrQos* out); +__attribute__((warn_unused_result)) bool translate(const ::android::hardware::radio::V1_6::Qos& in, + aidl::android::hardware::radio::Qos* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::RadioResponseInfo& in, + aidl::android::hardware::radio::RadioResponseInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::PortRange& in, + aidl::android::hardware::radio::PortRange* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::MaybePort& in, + aidl::android::hardware::radio::MaybePort* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::QosFilter& in, + aidl::android::hardware::radio::QosFilter* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::QosFilter::TypeOfService& in, + aidl::android::hardware::radio::QosFilterTypeOfService* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::QosFilter::Ipv6FlowLabel& in, + aidl::android::hardware::radio::QosFilterIpv6FlowLabel* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::QosFilter::IpsecSpi& in, + aidl::android::hardware::radio::QosFilterIpsecSpi* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::QosSession& in, + aidl::android::hardware::radio::QosSession* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::SetupDataCallResult& in, + aidl::android::hardware::radio::SetupDataCallResult* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::LinkCapacityEstimate& in, + aidl::android::hardware::radio::LinkCapacityEstimate* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::NrVopsInfo& in, + aidl::android::hardware::radio::NrVopsInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::LteSignalStrength& in, + aidl::android::hardware::radio::LteSignalStrength* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::NrSignalStrength& in, + aidl::android::hardware::radio::NrSignalStrength* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::SignalStrength& in, + aidl::android::hardware::radio::SignalStrength* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::CellInfoLte& in, + aidl::android::hardware::radio::CellInfoLte* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::CellInfoNr& in, + aidl::android::hardware::radio::CellInfoNr* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::CellInfo& in, + aidl::android::hardware::radio::CellInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo& in, + aidl::android::hardware::radio::CellInfoCellInfoRatSpecificInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::NetworkScanResult& in, + aidl::android::hardware::radio::NetworkScanResult* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::RegStateResult& in, + aidl::android::hardware::radio::RegStateResult* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::RegStateResult::AccessTechnologySpecificInfo& in, + aidl::android::hardware::radio::RegStateResultAccessTechnologySpecificInfo* out); +__attribute__((warn_unused_result)) bool translate(const ::android::hardware::radio::V1_6::Call& in, + aidl::android::hardware::radio::Call* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::PhysicalChannelConfig& in, + aidl::android::hardware::radio::PhysicalChannelConfig* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::PhysicalChannelConfig::Band& in, + aidl::android::hardware::radio::PhysicalChannelConfigBand* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::OptionalSliceInfo& in, + aidl::android::hardware::radio::OptionalSliceInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::SliceInfo& in, + aidl::android::hardware::radio::SliceInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::OptionalDnn& in, + aidl::android::hardware::radio::OptionalDnn* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::OptionalOsAppId& in, + aidl::android::hardware::radio::OptionalOsAppId* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::OptionalTrafficDescriptor& in, + aidl::android::hardware::radio::OptionalTrafficDescriptor* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::TrafficDescriptor& in, + aidl::android::hardware::radio::TrafficDescriptor* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::OsAppId& in, + aidl::android::hardware::radio::OsAppId* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::SlicingConfig& in, + aidl::android::hardware::radio::SlicingConfig* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::UrspRule& in, + aidl::android::hardware::radio::UrspRule* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::RouteSelectionDescriptor& in, + aidl::android::hardware::radio::RouteSelectionDescriptor* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::OptionalPdpProtocolType& in, + aidl::android::hardware::radio::OptionalPdpProtocolType* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::OptionalSscMode& in, + aidl::android::hardware::radio::OptionalSscMode* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::ImsiEncryptionInfo& in, + aidl::android::hardware::radio::ImsiEncryptionInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::PhonebookRecordInfo& in, + aidl::android::hardware::radio::PhonebookRecordInfo* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::radio::V1_6::PhonebookCapacity& in, + aidl::android::hardware::radio::PhonebookCapacity* out); + +} // namespace android::h2a -- GitLab From 1c9032daed03c64d9478a02a72209dab2af132cf Mon Sep 17 00:00:00 2001 From: Yuchen He Date: Thu, 12 Aug 2021 21:40:26 +0000 Subject: [PATCH 133/825] Add raw measurement parser Test: manual test (data cross verified with GnssLogger app) Bug: 190757198 Change-Id: I8d57826c6aa2a9d1a09b4847aadfda8c9160b36f --- gnss/common/utils/default/Android.bp | 2 + .../default/GnssRawMeasurementParser.cpp | 305 ++++++++++++++++++ gnss/common/utils/default/ParseUtils.cpp | 127 ++++++++ .../include/GnssRawMeasurementParser.h | 56 ++++ .../common/utils/default/include/ParseUtils.h | 46 +++ 5 files changed, 536 insertions(+) create mode 100644 gnss/common/utils/default/GnssRawMeasurementParser.cpp create mode 100644 gnss/common/utils/default/ParseUtils.cpp create mode 100644 gnss/common/utils/default/include/GnssRawMeasurementParser.h create mode 100644 gnss/common/utils/default/include/ParseUtils.h diff --git a/gnss/common/utils/default/Android.bp b/gnss/common/utils/default/Android.bp index ac94cc1bc0..fd3d939e7b 100644 --- a/gnss/common/utils/default/Android.bp +++ b/gnss/common/utils/default/Android.bp @@ -42,6 +42,8 @@ cc_library_static { "Utils.cpp", "NmeaFixInfo.cpp", "GnssReplayUtils.cpp", + "ParseUtils.cpp", + "GnssRawMeasurementParser.cpp", ], export_include_dirs: ["include"], shared_libs: [ diff --git a/gnss/common/utils/default/GnssRawMeasurementParser.cpp b/gnss/common/utils/default/GnssRawMeasurementParser.cpp new file mode 100644 index 0000000000..c066229ae9 --- /dev/null +++ b/gnss/common/utils/default/GnssRawMeasurementParser.cpp @@ -0,0 +1,305 @@ +/* + * 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 "GnssRawMeasurementParser.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace common { + +using aidl::android::hardware::gnss::ElapsedRealtime; +using aidl::android::hardware::gnss::GnssClock; +using aidl::android::hardware::gnss::GnssConstellationType; +using aidl::android::hardware::gnss::GnssData; +using aidl::android::hardware::gnss::GnssMeasurement; +using aidl::android::hardware::gnss::GnssMultipathIndicator; +using aidl::android::hardware::gnss::GnssSignalType; + +using ParseUtils = ::android::hardware::gnss::common::ParseUtils; + +std::unordered_map GnssRawMeasurementParser::getColumnIdNameMappingFromHeader( + const std::string& header) { + std::vector columnNames; + std::unordered_map columnNameIdMapping; + std::string s = header; + // Trim left spaces + s.erase(s.begin(), + std::find_if(s.begin(), s.end(), [](unsigned char ch) { return !std::isspace(ch); })); + // Trim right spaces + s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char ch) { return !std::isspace(ch); }) + .base(), + s.end()); + // Remove comment symbol, start from `Raw`. + s = s.substr(s.find("Raw")); + + ParseUtils::splitStr(s, COMMA_SEPARATOR, columnNames); + int columnId = 0; + for (auto& name : columnNames) { + columnNameIdMapping[name] = columnId++; + } + + return columnNameIdMapping; +} + +int GnssRawMeasurementParser::getClockFlags( + const std::vector& rawMeasurementRecordValues, + const std::unordered_map& columnNameIdMapping) { + int clockFlags = 0; + if (!rawMeasurementRecordValues[columnNameIdMapping.at("LeapSecond")].empty()) { + clockFlags |= GnssClock::HAS_LEAP_SECOND; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("FullBiasNanos")].empty()) { + clockFlags |= GnssClock::HAS_FULL_BIAS; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("BiasNanos")].empty()) { + clockFlags |= GnssClock::HAS_BIAS; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("BiasUncertaintyNanos")].empty()) { + clockFlags |= GnssClock::HAS_BIAS_UNCERTAINTY; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("DriftNanosPerSecond")].empty()) { + clockFlags |= GnssClock::HAS_DRIFT; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("DriftUncertaintyNanosPerSecond")] + .empty()) { + clockFlags |= GnssClock::HAS_DRIFT_UNCERTAINTY; + } + return clockFlags; +} + +int GnssRawMeasurementParser::getElapsedRealtimeFlags( + const std::vector& rawMeasurementRecordValues, + const std::unordered_map& columnNameIdMapping) { + int elapsedRealtimeFlags = ElapsedRealtime::HAS_TIMESTAMP_NS; + if (!rawMeasurementRecordValues[columnNameIdMapping.at("TimeUncertaintyNanos")].empty()) { + elapsedRealtimeFlags |= ElapsedRealtime::HAS_TIME_UNCERTAINTY_NS; + } + return elapsedRealtimeFlags; +} + +int GnssRawMeasurementParser::getRawMeasurementFlags( + const std::vector& rawMeasurementRecordValues, + const std::unordered_map& columnNameIdMapping) { + int rawMeasurementFlags = 0; + if (!rawMeasurementRecordValues[columnNameIdMapping.at("SnrInDb")].empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_SNR; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("CarrierFrequencyHz")].empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_CARRIER_FREQUENCY; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("CarrierCycles")].empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_CARRIER_CYCLES; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("CarrierPhase")].empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_CARRIER_PHASE; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("CarrierPhaseUncertainty")].empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_CARRIER_PHASE_UNCERTAINTY; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("AgcDb")].empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_AUTOMATIC_GAIN_CONTROL; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("FullInterSignalBiasNanos")].empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_FULL_ISB; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("FullInterSignalBiasUncertaintyNanos")] + .empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_FULL_ISB_UNCERTAINTY; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at("SatelliteInterSignalBiasNanos")] + .empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_SATELLITE_ISB; + } + if (!rawMeasurementRecordValues[columnNameIdMapping.at( + "SatelliteInterSignalBiasUncertaintyNanos")] + .empty()) { + rawMeasurementFlags |= GnssMeasurement::HAS_SATELLITE_ISB_UNCERTAINTY; + } + // HAS_SATELLITE_PVT and HAS_CORRELATION_VECTOR fields currently not in rawmeasurement + // output, need add them later. + return rawMeasurementFlags; +} + +GnssConstellationType GnssRawMeasurementParser::getGnssConstellationType(int constellationType) { + GnssConstellationType gnssConstellationType = + aidl::android::hardware::gnss::GnssConstellationType::UNKNOWN; + + switch (constellationType) { + case 1: + gnssConstellationType = aidl::android::hardware::gnss::GnssConstellationType::GPS; + break; + case 2: + gnssConstellationType = aidl::android::hardware::gnss::GnssConstellationType::SBAS; + break; + case 3: + gnssConstellationType = aidl::android::hardware::gnss::GnssConstellationType::GLONASS; + break; + case 4: + gnssConstellationType = aidl::android::hardware::gnss::GnssConstellationType::QZSS; + break; + case 5: + gnssConstellationType = aidl::android::hardware::gnss::GnssConstellationType::BEIDOU; + break; + case 6: + gnssConstellationType = aidl::android::hardware::gnss::GnssConstellationType::GALILEO; + break; + default: + gnssConstellationType = aidl::android::hardware::gnss::GnssConstellationType::UNKNOWN; + } + + return gnssConstellationType; +} + +std::unique_ptr GnssRawMeasurementParser::getMeasurementFromStrs( + std::string& rawMeasurementStr) { + /* + * Raw,utcTimeMillis,TimeNanos,LeapSecond,TimeUncertaintyNanos,FullBiasNanos,BiasNanos, + * BiasUncertaintyNanos,DriftNanosPerSecond,DriftUncertaintyNanosPerSecond, + * HardwareClockDiscontinuityCount,Svid,TimeOffsetNanos,State,ReceivedSvTimeNanos, + * ReceivedSvTimeUncertaintyNanos,Cn0DbHz,PseudorangeRateMetersPerSecond, + * PseudorangeRateUncertaintyMetersPerSecond,AccumulatedDeltaRangeState, + * AccumulatedDeltaRangeMeters,AccumulatedDeltaRangeUncertaintyMeters,CarrierFrequencyHz, + * CarrierCycles,CarrierPhase,CarrierPhaseUncertainty,MultipathIndicator,SnrInDb, + * ConstellationType,AgcDb,BasebandCn0DbHz,FullInterSignalBiasNanos, + * FullInterSignalBiasUncertaintyNanos,SatelliteInterSignalBiasNanos, + * SatelliteInterSignalBiasUncertaintyNanos,CodeType,ChipsetElapsedRealtimeNanos + */ + ALOGD("Parsing %zu bytes rawMeasurementStr.", rawMeasurementStr.size()); + if (rawMeasurementStr.empty()) { + return nullptr; + } + std::vector rawMeasurementStrRecords; + ParseUtils::splitStr(rawMeasurementStr, LINE_SEPARATOR, rawMeasurementStrRecords); + if (rawMeasurementStrRecords.size() <= 1) { + ALOGE("Raw GNSS Measurements parser failed. (No records) "); + return nullptr; + } + + // Get the column name mapping from the header. + std::unordered_map columnNameIdMapping = + getColumnIdNameMappingFromHeader(rawMeasurementStrRecords[0]); + + if (columnNameIdMapping.size() < 37 || !ParseUtils::isValidHeader(columnNameIdMapping)) { + ALOGE("Raw GNSS Measurements parser failed. (No header or missing columns.) "); + return nullptr; + } + + // Set GnssClock from 1st record. + std::size_t pointer = 1; + std::vector firstRecordValues; + ParseUtils::splitStr(rawMeasurementStrRecords[pointer], COMMA_SEPARATOR, firstRecordValues); + GnssClock clock = { + .gnssClockFlags = getClockFlags(firstRecordValues, columnNameIdMapping), + .timeNs = ParseUtils::tryParseLongLong( + firstRecordValues[columnNameIdMapping.at("TimeNanos")], 0), + .fullBiasNs = ParseUtils::tryParseLongLong( + firstRecordValues[columnNameIdMapping.at("FullBiasNanos")], 0), + .biasNs = ParseUtils::tryParseDouble( + firstRecordValues[columnNameIdMapping.at("BiasNanos")], 0), + .biasUncertaintyNs = ParseUtils::tryParseDouble( + firstRecordValues[columnNameIdMapping.at("BiasUncertaintyNanos")], 0), + .driftNsps = ParseUtils::tryParseDouble( + firstRecordValues[columnNameIdMapping.at("DriftNanosPerSecond")], 0), + .driftUncertaintyNsps = ParseUtils::tryParseDouble( + firstRecordValues[columnNameIdMapping.at("DriftNanosPerSecond")], 0), + .hwClockDiscontinuityCount = ParseUtils::tryParseInt( + firstRecordValues[columnNameIdMapping.at("HardwareClockDiscontinuityCount")], + 0)}; + + ElapsedRealtime timestamp = { + .flags = getElapsedRealtimeFlags(firstRecordValues, columnNameIdMapping), + .timestampNs = ParseUtils::tryParseLongLong( + firstRecordValues[columnNameIdMapping.at("ChipsetElapsedRealtimeNanos")]), + .timeUncertaintyNs = ParseUtils::tryParseDouble( + firstRecordValues[columnNameIdMapping.at("TimeUncertaintyNanos")], 0)}; + + std::vector measurementsVec; + for (pointer = 1; pointer < rawMeasurementStrRecords.size(); pointer++) { + std::vector rawMeasurementValues; + std::string line = rawMeasurementStrRecords[pointer]; + ParseUtils::splitStr(line, COMMA_SEPARATOR, rawMeasurementValues); + GnssSignalType signalType = { + .constellation = getGnssConstellationType(ParseUtils::tryParseInt( + rawMeasurementValues[columnNameIdMapping.at("ConstellationType")], 0)), + .carrierFrequencyHz = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at("CarrierFrequencyHz")], 0), + .codeType = rawMeasurementValues[columnNameIdMapping.at("CodeType")], + }; + GnssMeasurement measurement = { + .flags = getRawMeasurementFlags(rawMeasurementValues, columnNameIdMapping), + .svid = ParseUtils::tryParseInt( + rawMeasurementValues[columnNameIdMapping.at("Svid")], 0), + .signalType = signalType, + .receivedSvTimeInNs = ParseUtils::tryParseLongLong( + rawMeasurementValues[columnNameIdMapping.at("ReceivedSvTimeNanos")], 0), + .receivedSvTimeUncertaintyInNs = + ParseUtils::tryParseLongLong(rawMeasurementValues[columnNameIdMapping.at( + "ReceivedSvTimeUncertaintyNanos")], + 0), + .antennaCN0DbHz = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at("Cn0DbHz")], 0), + .basebandCN0DbHz = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at("BasebandCn0DbHz")], 0), + .agcLevelDb = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at("AgcDb")], 0), + .pseudorangeRateMps = + ParseUtils::tryParseDouble(rawMeasurementValues[columnNameIdMapping.at( + "PseudorangeRateMetersPerSecond")], + 0), + .pseudorangeRateUncertaintyMps = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at( + "PseudorangeRateUncertaintyMetersPerSecond")], + 0), + .accumulatedDeltaRangeState = ParseUtils::tryParseInt( + rawMeasurementValues[columnNameIdMapping.at("AccumulatedDeltaRangeState")], + 0), + .accumulatedDeltaRangeM = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at("AccumulatedDeltaRangeMeters")], + 0), + .accumulatedDeltaRangeUncertaintyM = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at( + "AccumulatedDeltaRangeUncertaintyMeters")], + 0), + .multipathIndicator = GnssMultipathIndicator::UNKNOWN, // Not in GnssLogger yet. + .state = ParseUtils::tryParseInt( + rawMeasurementValues[columnNameIdMapping.at("State")], 0), + .fullInterSignalBiasNs = ParseUtils::tryParseDouble(rawMeasurementValues[31], 0), + .fullInterSignalBiasUncertaintyNs = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at("FullInterSignalBiasNanos")], + 0), + .satelliteInterSignalBiasNs = + ParseUtils::tryParseDouble(rawMeasurementValues[columnNameIdMapping.at( + "SatelliteInterSignalBiasNanos")], + 0), + .satelliteInterSignalBiasUncertaintyNs = ParseUtils::tryParseDouble( + rawMeasurementValues[columnNameIdMapping.at( + "SatelliteInterSignalBiasUncertaintyNanos")], + 0), + .satellitePvt = {}, + .correlationVectors = {}}; + measurementsVec.push_back(measurement); + } + + GnssData gnssData = { + .measurements = measurementsVec, .clock = clock, .elapsedRealtime = timestamp}; + return std::make_unique(gnssData); +} + +} // namespace common +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/gnss/common/utils/default/ParseUtils.cpp b/gnss/common/utils/default/ParseUtils.cpp new file mode 100644 index 0000000000..648edf7ecd --- /dev/null +++ b/gnss/common/utils/default/ParseUtils.cpp @@ -0,0 +1,127 @@ +/* + * 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 +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace common { + +int ParseUtils::tryParseInt(const std::string& s, int defaultVal) { + if (s.empty()) { + return defaultVal; + } else { + return std::stoi(s); + } +} + +float ParseUtils::tryParsefloat(const std::string& s, float defaultVal) { + if (s.empty()) { + return defaultVal; + } else { + return std::stof(s); + } +} + +double ParseUtils::tryParseDouble(const std::string& s, double defaultVal) { + if (s.empty()) { + return defaultVal; + } else { + return std::stod(s); + } +} + +long ParseUtils::tryParseLong(const std::string& s, long defaultVal) { + if (s.empty()) { + return defaultVal; + } else { + return std::stol(s); + } +} + +long long ParseUtils::tryParseLongLong(const std::string& s, long long defaultVal) { + if (s.empty()) { + return defaultVal; + } else { + return std::stoll(s); + } +} + +void ParseUtils::splitStr(const std::string& line, const char& delimiter, + std::vector& out) { + std::istringstream iss(line); + std::string item; + while (std::getline(iss, item, delimiter)) { + out.push_back(item); + } +} + +bool ParseUtils::isValidHeader(const std::unordered_map& columnNameIdMapping) { + std::vector requiredHeaderColumns = {"Raw", + "utcTimeMillis", + "TimeNanos", + "LeapSecond", + "TimeUncertaintyNanos", + "FullBiasNanos", + "BiasNanos", + "BiasUncertaintyNanos", + "DriftNanosPerSecond", + "DriftUncertaintyNanosPerSecond", + "HardwareClockDiscontinuityCount", + "Svid", + "TimeOffsetNanos", + "State", + "ReceivedSvTimeNanos", + "ReceivedSvTimeUncertaintyNanos", + "Cn0DbHz", + "PseudorangeRateMetersPerSecond", + "PseudorangeRateUncertaintyMetersPerSecond", + "AccumulatedDeltaRangeState", + "AccumulatedDeltaRangeMeters", + "AccumulatedDeltaRangeUncertaintyMeters", + "CarrierFrequencyHz", + "CarrierCycles", + "CarrierPhase", + "CarrierPhaseUncertainty", + "MultipathIndicator", + "SnrInDb", + "ConstellationType", + "AgcDb", + "BasebandCn0DbHz", + "FullInterSignalBiasNanos", + "FullInterSignalBiasUncertaintyNanos", + "SatelliteInterSignalBiasNanos", + "SatelliteInterSignalBiasUncertaintyNanos", + "CodeType", + "ChipsetElapsedRealtimeNanos"}; + + for (const auto& columnName : requiredHeaderColumns) { + if (columnNameIdMapping.find(columnName) == columnNameIdMapping.end()) { + ALOGE("Missing column %s in header.", columnName.c_str()); + return false; + } + } + + return true; +} + +} // namespace common +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/gnss/common/utils/default/include/GnssRawMeasurementParser.h b/gnss/common/utils/default/include/GnssRawMeasurementParser.h new file mode 100644 index 0000000000..7d6b4efdd1 --- /dev/null +++ b/gnss/common/utils/default/include/GnssRawMeasurementParser.h @@ -0,0 +1,56 @@ +/* + * 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_gnss_common_default_GnssRawMeasurementParser_H_ +#define android_hardware_gnss_common_default_GnssRawMeasurementParser_H_ + +#include +#include +#include +#include +#include + +#include "Constants.h" +#include "ParseUtils.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace common { + +struct GnssRawMeasurementParser { + static std::unique_ptr getMeasurementFromStrs( + std::string& rawMeasurementStr); + static int getClockFlags(const std::vector& rawMeasurementRecordValues, + const std::unordered_map& columnNameIdMapping); + static int getElapsedRealtimeFlags( + const std::vector& rawMeasurementRecordValues, + const std::unordered_map& columnNameIdMapping); + static int getRawMeasurementFlags( + const std::vector& rawMeasurementRecordValues, + const std::unordered_map& columnNameIdMapping); + static std::unordered_map getColumnIdNameMappingFromHeader( + const std::string& header); + static aidl::android::hardware::gnss::GnssConstellationType getGnssConstellationType( + int constellationType); +}; + +} // namespace common +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // android_hardware_gnss_common_default_GnssRawMeasurementParser_H_ \ No newline at end of file diff --git a/gnss/common/utils/default/include/ParseUtils.h b/gnss/common/utils/default/include/ParseUtils.h new file mode 100644 index 0000000000..3a5631342e --- /dev/null +++ b/gnss/common/utils/default/include/ParseUtils.h @@ -0,0 +1,46 @@ +/* + * 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_gnss_common_default_ParseUtils_H_ +#define android_hardware_gnss_common_default_ParseUtils_H_ + +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace common { + +struct ParseUtils { + static int tryParseInt(const std::string& s, int defaultVal = 0); + static float tryParsefloat(const std::string& s, float defaultVal = 0.0); + static double tryParseDouble(const std::string& s, double defaultVal = 0.0); + static long tryParseLong(const std::string& s, long defaultVal = 0); + static long long tryParseLongLong(const std::string& s, long long defaultVal = 0); + static void splitStr(const std::string& line, const char& delimiter, + std::vector& out); + static bool isValidHeader(const std::unordered_map& columnNameIdMapping); +}; + +} // namespace common +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // android_hardware_gnss_common_default_ParseUtils_H_ \ No newline at end of file -- GitLab From 3cbf5f3291299b5b4c8fc71d4ace4260dc5db4be Mon Sep 17 00:00:00 2001 From: Yuchen He Date: Mon, 30 Aug 2021 22:20:30 +0000 Subject: [PATCH 134/825] Read GNSS measurement from device file when available Test: atest CtsLocationGnssTestCases GtsLocationTestCases on CF Bug: 190757198 Change-Id: Ic03d56a5df6b99f7b20c5840e7091ead138316b1 --- .../aidl/default/GnssMeasurementInterface.cpp | 18 ++-- gnss/common/utils/default/Android.bp | 7 +- .../common/utils/default/DeviceFileReader.cpp | 97 +++++++++++++++++++ gnss/common/utils/default/GnssReplayUtils.cpp | 41 +------- .../utils/default/include/DeviceFileReader.h | 53 ++++++++++ .../utils/default/include/v2_1/GnssTemplate.h | 17 +--- 6 files changed, 171 insertions(+), 62 deletions(-) create mode 100644 gnss/common/utils/default/DeviceFileReader.cpp create mode 100644 gnss/common/utils/default/include/DeviceFileReader.h diff --git a/gnss/aidl/default/GnssMeasurementInterface.cpp b/gnss/aidl/default/GnssMeasurementInterface.cpp index 0e489c59e4..9e4f7c7f25 100644 --- a/gnss/aidl/default/GnssMeasurementInterface.cpp +++ b/gnss/aidl/default/GnssMeasurementInterface.cpp @@ -19,6 +19,8 @@ #include "GnssMeasurementInterface.h" #include #include +#include "DeviceFileReader.h" +#include "GnssRawMeasurementParser.h" #include "GnssReplayUtils.h" #include "Utils.h" @@ -26,6 +28,8 @@ namespace aidl::android::hardware::gnss { using Utils = ::android::hardware::gnss::common::Utils; using ReplayUtils = ::android::hardware::gnss::common::ReplayUtils; +using GnssRawMeasurementParser = ::android::hardware::gnss::common::GnssRawMeasurementParser; +using DeviceFileReader = ::android::hardware::gnss::common::DeviceFileReader; std::shared_ptr GnssMeasurementInterface::sCallback = nullptr; @@ -68,15 +72,15 @@ void GnssMeasurementInterface::start(const bool enableCorrVecOutputs) { std::string rawMeasurementStr = ""; if (ReplayUtils::hasGnssDeviceFile() && ReplayUtils::isGnssRawMeasurement( - rawMeasurementStr = ReplayUtils::getDataFromDeviceFile( - std::string( - ::android::hardware::gnss::common::CMD_GET_RAWMEASUREMENT), - mMinIntervalMillis))) { - // TODO: implement rawMeasurementStr parser and report measurement. + rawMeasurementStr = + DeviceFileReader::Instance().getGnssRawMeasurementData())) { ALOGD("rawMeasurementStr(size: %zu) from device file: %s", rawMeasurementStr.size(), rawMeasurementStr.c_str()); - auto measurement = Utils::getMockMeasurement(enableCorrVecOutputs); - this->reportMeasurement(measurement); + auto measurement = + GnssRawMeasurementParser::getMeasurementFromStrs(rawMeasurementStr); + if (measurement != nullptr) { + this->reportMeasurement(*measurement); + } } else { auto measurement = Utils::getMockMeasurement(enableCorrVecOutputs); this->reportMeasurement(measurement); diff --git a/gnss/common/utils/default/Android.bp b/gnss/common/utils/default/Android.bp index fd3d939e7b..5294409321 100644 --- a/gnss/common/utils/default/Android.bp +++ b/gnss/common/utils/default/Android.bp @@ -38,12 +38,13 @@ cc_library_static { "v2_1/GnssDebug.cpp", "v2_1/GnssMeasurement.cpp", "v2_1/GnssMeasurementCorrections.cpp", + "DeviceFileReader.cpp", + "GnssRawMeasurementParser.cpp", + "GnssReplayUtils.cpp", "MockLocation.cpp", - "Utils.cpp", "NmeaFixInfo.cpp", - "GnssReplayUtils.cpp", "ParseUtils.cpp", - "GnssRawMeasurementParser.cpp", + "Utils.cpp", ], export_include_dirs: ["include"], shared_libs: [ diff --git a/gnss/common/utils/default/DeviceFileReader.cpp b/gnss/common/utils/default/DeviceFileReader.cpp new file mode 100644 index 0000000000..7d4fb04339 --- /dev/null +++ b/gnss/common/utils/default/DeviceFileReader.cpp @@ -0,0 +1,97 @@ +/* + * 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 "DeviceFileReader.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace common { + +void DeviceFileReader::getDataFromDeviceFile(const std::string& command, int mMinIntervalMs) { + char inputBuffer[INPUT_BUFFER_SIZE]; + int mGnssFd = open(ReplayUtils::getGnssPath().c_str(), + O_RDWR | O_NONBLOCK); + + if (mGnssFd == -1) { + return; + } + + int bytes_write = write(mGnssFd, command.c_str(), command.size()); + if (bytes_write <= 0) { + close(mGnssFd); + return; + } + + struct epoll_event ev, events[1]; + ev.data.fd = mGnssFd; + ev.events = EPOLLIN; + int epoll_fd = epoll_create1(0); + epoll_ctl(epoll_fd, EPOLL_CTL_ADD, mGnssFd, &ev); + int bytes_read = -1; + std::string inputStr = ""; + int epoll_ret = epoll_wait(epoll_fd, events, 1, mMinIntervalMs); + + if (epoll_ret == -1) { + close(mGnssFd); + return; + } + while (true) { + memset(inputBuffer, 0, INPUT_BUFFER_SIZE); + bytes_read = read(mGnssFd, &inputBuffer, INPUT_BUFFER_SIZE); + if (bytes_read <= 0) { + break; + } + s_buffer_ += std::string(inputBuffer, bytes_read); + } + close(mGnssFd); + + // Trim end of file mark(\n\n\n\n). + auto pos = s_buffer_.find("\n\n\n\n"); + if (pos != std::string::npos) { + inputStr = s_buffer_.substr(0, pos); + s_buffer_ = s_buffer_.substr(pos + 4); + } else { + return; + } + + // Cache the injected data. + if (ReplayUtils::isGnssRawMeasurement(inputStr)) { + data_[CMD_GET_RAWMEASUREMENT] = inputStr; + } else if (ReplayUtils::isNMEA(inputStr)) { + data_[CMD_GET_LOCATION] = inputStr; + } +} + +std::string DeviceFileReader::getLocationData() { + std::unique_lock lock(mMutex); + getDataFromDeviceFile(CMD_GET_LOCATION, 20); + return data_[CMD_GET_LOCATION]; +} + +std::string DeviceFileReader::getGnssRawMeasurementData() { + std::unique_lock lock(mMutex); + getDataFromDeviceFile(CMD_GET_RAWMEASUREMENT, 20); + return data_[CMD_GET_RAWMEASUREMENT]; +} + +DeviceFileReader::DeviceFileReader() {} + +DeviceFileReader::~DeviceFileReader() {} + +} // namespace common +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/gnss/common/utils/default/GnssReplayUtils.cpp b/gnss/common/utils/default/GnssReplayUtils.cpp index fc4c477ae8..e3f4ff82a0 100644 --- a/gnss/common/utils/default/GnssReplayUtils.cpp +++ b/gnss/common/utils/default/GnssReplayUtils.cpp @@ -40,45 +40,8 @@ bool ReplayUtils::isGnssRawMeasurement(const std::string& inputStr) { } bool ReplayUtils::isNMEA(const std::string& inputStr) { - return !inputStr.empty() && - (inputStr.rfind("$GPRMC,", 0) == 0 || inputStr.rfind("$GPRMA,", 0) == 0); -} - -std::string ReplayUtils::getDataFromDeviceFile(const std::string& command, int mMinIntervalMs) { - char inputBuffer[INPUT_BUFFER_SIZE]; - int mGnssFd = open(getGnssPath().c_str(), O_RDWR | O_NONBLOCK); - - if (mGnssFd == -1) { - return ""; - } - - int bytes_write = write(mGnssFd, command.c_str(), command.size()); - if (bytes_write <= 0) { - return ""; - } - - struct epoll_event ev, events[1]; - ev.data.fd = mGnssFd; - ev.events = EPOLLIN; - int epoll_fd = epoll_create1(0); - epoll_ctl(epoll_fd, EPOLL_CTL_ADD, mGnssFd, &ev); - int bytes_read = -1; - std::string inputStr = ""; - int epoll_ret = epoll_wait(epoll_fd, events, 1, mMinIntervalMs); - - if (epoll_ret == -1) { - return ""; - } - while (true) { - memset(inputBuffer, 0, INPUT_BUFFER_SIZE); - bytes_read = read(mGnssFd, &inputBuffer, INPUT_BUFFER_SIZE); - if (bytes_read <= 0) { - break; - } - inputStr += std::string(inputBuffer, bytes_read); - } - - return inputStr; + return !inputStr.empty() && (inputStr.find("$GPRMC,", 0) != std::string::npos || + inputStr.find("$GPRMA,", 0) != std::string::npos); } } // namespace common diff --git a/gnss/common/utils/default/include/DeviceFileReader.h b/gnss/common/utils/default/include/DeviceFileReader.h new file mode 100644 index 0000000000..c2a5c5f59b --- /dev/null +++ b/gnss/common/utils/default/include/DeviceFileReader.h @@ -0,0 +1,53 @@ + +/* + * 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_gnss_common_default_DeviceFileReader_H_ +#define android_hardware_gnss_common_default_DeviceFileReader_H_ + +#include +#include +#include +#include +#include "Constants.h" +#include "GnssReplayUtils.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace common { +class DeviceFileReader { + public: + static DeviceFileReader& Instance() { + static DeviceFileReader reader; + return reader; + } + std::string getLocationData(); + std::string getGnssRawMeasurementData(); + void getDataFromDeviceFile(const std::string& command, int mMinIntervalMs); + + private: + DeviceFileReader(); + ~DeviceFileReader(); + std::unordered_map data_; + std::string s_buffer_; + std::mutex mMutex; +}; +} // namespace common +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // android_hardware_gnss_common_default_DeviceFileReader_H_ \ No newline at end of file diff --git a/gnss/common/utils/default/include/v2_1/GnssTemplate.h b/gnss/common/utils/default/include/v2_1/GnssTemplate.h index 6f0ced1dc5..19b1b453b3 100644 --- a/gnss/common/utils/default/include/v2_1/GnssTemplate.h +++ b/gnss/common/utils/default/include/v2_1/GnssTemplate.h @@ -30,6 +30,7 @@ #include +#include "DeviceFileReader.h" #include "GnssAntennaInfo.h" #include "GnssConfiguration.h" #include "GnssDebug.h" @@ -163,19 +164,9 @@ GnssTemplate::~GnssTemplate() { template std::unique_ptr GnssTemplate::getLocationFromHW() { - if (!mHardwareModeChecked) { - // default using /dev/gnss0 - std::string gnss_dev_path = ReplayUtils::getGnssPath(); - - mGnssFd = open(gnss_dev_path.c_str(), O_RDWR | O_NONBLOCK); - if (mGnssFd == -1) { - ALOGW("Failed to open %s errno: %d", gnss_dev_path.c_str(), errno); - } - mHardwareModeChecked = true; - } - - std::string inputStr = ::android::hardware::gnss::common::ReplayUtils::getDataFromDeviceFile( - CMD_GET_LOCATION, mMinIntervalMs); + mHardwareModeChecked = true; + std::string inputStr = + ::android::hardware::gnss::common::DeviceFileReader::Instance().getLocationData(); return NmeaFixInfo::getLocationFromInputStr(inputStr); } -- GitLab From 4e916c3da583c8c7b7de1ab133cec2c22e2d14de Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Thu, 12 Aug 2021 12:47:03 -0700 Subject: [PATCH 135/825] Adds VTS test for Context Hub AIDL Bug: 194285834 Test: Run test on device with Context Hub AIDL and verify pass Change-Id: I1b38c4071ceaf30da77ad29b3b564bafe76ab2b8 --- contexthub/aidl/vts/Android.bp | 33 ++ contexthub/aidl/vts/OWNERS | 1 + .../vts/VtsAidlHalContextHubTargetTest.cpp | 332 ++++++++++++++++++ 3 files changed, 366 insertions(+) create mode 100644 contexthub/aidl/vts/Android.bp create mode 100644 contexthub/aidl/vts/OWNERS create mode 100644 contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp diff --git a/contexthub/aidl/vts/Android.bp b/contexthub/aidl/vts/Android.bp new file mode 100644 index 0000000000..c4268c4509 --- /dev/null +++ b/contexthub/aidl/vts/Android.bp @@ -0,0 +1,33 @@ +// Copyright 2021 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +cc_test { + name: "VtsAidlHalContextHubTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: ["VtsAidlHalContextHubTargetTest.cpp"], + shared_libs: [ + "libbinder", + ], + static_libs: [ + "android.hardware.contexthub-V1-cpp", + "VtsHalContexthubUtils", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/contexthub/aidl/vts/OWNERS b/contexthub/aidl/vts/OWNERS new file mode 100644 index 0000000000..150818d5bb --- /dev/null +++ b/contexthub/aidl/vts/OWNERS @@ -0,0 +1 @@ +file:/contexthub/common/vts/OWNERS diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp new file mode 100644 index 0000000000..3601f13a25 --- /dev/null +++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp @@ -0,0 +1,332 @@ +/* + * 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 +#include + +#include "VtsHalContexthubUtilsCommon.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using ::android::ProcessState; +using ::android::sp; +using ::android::String16; +using ::android::binder::Status; +using ::android::hardware::contexthub::AsyncEventType; +using ::android::hardware::contexthub::ContextHubInfo; +using ::android::hardware::contexthub::ContextHubMessage; +using ::android::hardware::contexthub::IContextHub; +using ::android::hardware::contexthub::IContextHubCallbackDefault; +using ::android::hardware::contexthub::NanoappBinary; +using ::android::hardware::contexthub::NanoappInfo; +using ::android::hardware::contexthub::Setting; +using ::android::hardware::contexthub::vts_utils::kNonExistentAppId; +using ::android::hardware::contexthub::vts_utils::waitForCallback; + +class ContextHubAidl : public testing::TestWithParam> { + public: + virtual void SetUp() override { + contextHub = android::waitForDeclaredService( + String16(std::get<0>(GetParam()).c_str())); + ASSERT_NE(contextHub, nullptr); + } + + uint32_t getHubId() { return std::get<1>(GetParam()); } + + void testSettingChanged(Setting setting); + + sp contextHub; +}; + +TEST_P(ContextHubAidl, TestGetHubs) { + std::vector hubs; + ASSERT_TRUE(contextHub->getContextHubs(&hubs).isOk()); + + ALOGD("System reports %zu hubs", hubs.size()); + + for (const ContextHubInfo& hub : hubs) { + ALOGD("Checking hub ID %" PRIu32, hub.id); + + EXPECT_GT(hub.name.size(), 0); + EXPECT_GT(hub.vendor.size(), 0); + EXPECT_GT(hub.toolchain.size(), 0); + EXPECT_GT(hub.peakMips, 0); + EXPECT_GT(hub.chrePlatformId, 0); + EXPECT_GT(hub.chreApiMajorVersion, 0); + EXPECT_GT(hub.chreApiMinorVersion, 0); + EXPECT_GT(hub.chrePatchVersion, 0); + + // Minimum 128 byte MTU as required by CHRE API v1.0 + EXPECT_GE(hub.maxSupportedMessageLengthBytes, UINT32_C(128)); + } +} + +TEST_P(ContextHubAidl, TestRegisterCallback) { + bool success; + ASSERT_TRUE(contextHub->registerCallback(getHubId(), new IContextHubCallbackDefault(), &success) + .isOk()); + ASSERT_TRUE(success); +} + +TEST_P(ContextHubAidl, TestRegisterNullCallback) { + bool success; + ASSERT_TRUE(contextHub->registerCallback(getHubId(), nullptr, &success).isOk()); +} + +// Helper callback that puts the async appInfo callback data into a promise +class QueryAppsCallback : public android::hardware::contexthub::BnContextHubCallback { + public: + Status handleNanoappInfo(const std::vector& appInfo) override { + ALOGD("Got app info callback with %zu apps", appInfo.size()); + promise.set_value(appInfo); + return Status::ok(); + } + + Status handleContextHubMessage(const ContextHubMessage& /* msg */, + const std::vector& /* msgContentPerms */) override { + return Status::ok(); + } + + Status handleContextHubAsyncEvent(AsyncEventType /* evt */) override { return Status::ok(); } + + Status handleTransactionResult(int32_t /* transactionId */, bool /* success */) override { + return Status::ok(); + } + + std::promise> promise; +}; + +// Calls queryApps() and checks the returned metadata +TEST_P(ContextHubAidl, TestQueryApps) { + sp cb = sp::make(); + bool success; + ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb, &success).isOk()); + ASSERT_TRUE(success); + + ASSERT_TRUE(contextHub->queryNanoapps(getHubId(), &success).isOk()); + ASSERT_TRUE(success); + + std::vector appInfoList; + ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &appInfoList)); + for (const NanoappInfo& appInfo : appInfoList) { + EXPECT_NE(appInfo.nanoappId, UINT64_C(0)); + EXPECT_NE(appInfo.nanoappId, kNonExistentAppId); + } +} + +// Helper callback that puts the TransactionResult for the expectedTransactionId into a +// promise +class TransactionResultCallback : public android::hardware::contexthub::BnContextHubCallback { + public: + Status handleNanoappInfo(const std::vector& /* appInfo */) override { + return Status::ok(); + } + + Status handleContextHubMessage(const ContextHubMessage& /* msg */, + const std::vector& /* msgContentPerms */) override { + return Status::ok(); + } + + Status handleContextHubAsyncEvent(AsyncEventType /* evt */) override { return Status::ok(); } + + Status handleTransactionResult(int32_t transactionId, bool success) override { + ALOGD("Got transaction result callback for transactionId %" PRIu32 " (expecting %" PRIu32 + ") with success %d", + transactionId, expectedTransactionId, success); + if (transactionId == expectedTransactionId) { + promise.set_value(success); + } + return Status::ok(); + } + + uint32_t expectedTransactionId = 0; + std::promise promise; +}; + +// Parameterized fixture that sets the callback to TransactionResultCallback +class ContextHubTransactionTest : public ContextHubAidl { + public: + virtual void SetUp() override { + ContextHubAidl::SetUp(); + bool success; + ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb, &success).isOk()); + ASSERT_TRUE(success); + } + + sp cb = sp::make(); +}; + +TEST_P(ContextHubTransactionTest, TestSendMessageToNonExistentNanoapp) { + ContextHubMessage message; + message.nanoappId = kNonExistentAppId; + message.messageType = 1; + message.messageBody.resize(4); + std::fill(message.messageBody.begin(), message.messageBody.end(), 0); + + ALOGD("Sending message to non-existent nanoapp"); + bool success; + ASSERT_TRUE(contextHub->sendMessageToHub(getHubId(), message, &success).isOk()); + ASSERT_TRUE(success); +} + +TEST_P(ContextHubTransactionTest, TestLoadEmptyNanoapp) { + cb->expectedTransactionId = 0123; + NanoappBinary emptyApp; + + emptyApp.nanoappId = kNonExistentAppId; + emptyApp.nanoappVersion = 1; + emptyApp.flags = 0; + emptyApp.targetChreApiMajorVersion = 1; + emptyApp.targetChreApiMinorVersion = 0; + + ALOGD("Loading empty nanoapp"); + bool success; + ASSERT_TRUE(contextHub->loadNanoapp(getHubId(), emptyApp, cb->expectedTransactionId, &success) + .isOk()); + if (success) { + bool transactionSuccess; + ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &transactionSuccess)); + ASSERT_FALSE(transactionSuccess); + } +} + +TEST_P(ContextHubTransactionTest, TestUnloadNonexistentNanoapp) { + cb->expectedTransactionId = 1234; + + ALOGD("Unloading nonexistent nanoapp"); + bool success; + ASSERT_TRUE(contextHub + ->unloadNanoapp(getHubId(), kNonExistentAppId, cb->expectedTransactionId, + &success) + .isOk()); + if (success) { + bool transactionSuccess; + ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &transactionSuccess)); + ASSERT_FALSE(transactionSuccess); + } +} + +TEST_P(ContextHubTransactionTest, TestEnableNonexistentNanoapp) { + cb->expectedTransactionId = 2345; + + ALOGD("Enabling nonexistent nanoapp"); + bool success; + ASSERT_TRUE(contextHub + ->enableNanoapp(getHubId(), kNonExistentAppId, cb->expectedTransactionId, + &success) + .isOk()); + if (success) { + bool transactionSuccess; + ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &transactionSuccess)); + ASSERT_FALSE(transactionSuccess); + } +} + +TEST_P(ContextHubTransactionTest, TestDisableNonexistentNanoapp) { + cb->expectedTransactionId = 3456; + + ALOGD("Disabling nonexistent nanoapp"); + bool success; + ASSERT_TRUE(contextHub + ->disableNanoapp(getHubId(), kNonExistentAppId, cb->expectedTransactionId, + &success) + .isOk()); + if (success) { + bool transactionSuccess; + ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &transactionSuccess)); + ASSERT_FALSE(transactionSuccess); + } +} + +void ContextHubAidl::testSettingChanged(Setting setting) { + // In VTS, we only test that sending the values doesn't cause things to blow up - GTS tests + // verify the expected E2E behavior in CHRE + bool success; + ASSERT_TRUE(contextHub->registerCallback(getHubId(), new IContextHubCallbackDefault(), &success) + .isOk()); + ASSERT_TRUE(success); + + ASSERT_TRUE(contextHub->onSettingChanged(setting, true /* enabled */).isOk()); + ASSERT_TRUE(contextHub->onSettingChanged(setting, false /* enabled */).isOk()); + + ASSERT_TRUE(contextHub->registerCallback(getHubId(), nullptr, &success).isOk()); + ASSERT_TRUE(success); +} + +TEST_P(ContextHubAidl, TestOnLocationSettingChanged) { + testSettingChanged(Setting::LOCATION); +} + +TEST_P(ContextHubAidl, TestOnWifiMainSettingChanged) { + testSettingChanged(Setting::WIFI_MAIN); +} + +TEST_P(ContextHubAidl, TestOnWifiScanningSettingChanged) { + testSettingChanged(Setting::WIFI_SCANNING); +} + +TEST_P(ContextHubAidl, TestOnAirplaneModeSettingChanged) { + testSettingChanged(Setting::AIRPLANE_MODE); +} + +TEST_P(ContextHubAidl, TestOnMicrophoneSettingChanged) { + testSettingChanged(Setting::MICROPHONE); +} + +std::vector> generateContextHubMapping() { + std::vector> tuples; + auto contextHubAidlNames = android::getAidlHalInstanceNames(IContextHub::descriptor); + std::vector contextHubInfos; + + for (int i = 0; i < contextHubAidlNames.size(); i++) { + auto contextHubName = contextHubAidlNames[i].c_str(); + auto contextHub = android::waitForDeclaredService(String16(contextHubName)); + if (contextHub->getContextHubs(&contextHubInfos).isOk()) { + for (auto& info : contextHubInfos) { + tuples.push_back(std::make_tuple(contextHubName, info.id)); + } + } + } + + return tuples; +} + +std::string PrintGeneratedTest(const testing::TestParamInfo& info) { + return std::string("CONTEXT_HUB_ID_") + std::to_string(std::get<1>(info.param)); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ContextHubAidl); +INSTANTIATE_TEST_SUITE_P(ContextHub, ContextHubAidl, testing::ValuesIn(generateContextHubMapping()), + PrintGeneratedTest); + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ContextHubTransactionTest); +INSTANTIATE_TEST_SUITE_P(ContextHub, ContextHubTransactionTest, + testing::ValuesIn(generateContextHubMapping()), PrintGeneratedTest); + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + ProcessState::self()->setThreadPoolMaxThreadCount(1); + ProcessState::self()->startThreadPool(); + return RUN_ALL_TESTS(); +} -- GitLab From 3fd11c9dbb9c0a84c69a269b03bd4afa1ce9bd3d Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Wed, 8 Sep 2021 16:42:01 -0700 Subject: [PATCH 136/825] API changes for IRadio AIDL conversion Consider feedback from aosp/1628999 and API changes mentioned in the design document. Bug: 198331182 Test: build Change-Id: I27da6dbec5f2d65873cbb84d363eebc8d57b116d --- radio/aidl/Android.bp | 3 - ...aidl => AccessTechnologySpecificInfo.aidl} | 7 +- .../hardware/radio/AddressProperty.aidl | 39 - .../android/hardware/radio/AppState.aidl | 43 - .../android/hardware/radio/AppStatus.aidl | 18 +- .../android/hardware/radio/AppType.aidl | 43 - .../android/hardware/radio/BarringInfo.aidl | 51 +- .../radio/BarringInfoBarringType.aidl | 40 - .../radio/BarringInfoServiceType.aidl | 79 - ...onal.aidl => BarringTypeSpecificInfo.aidl} | 2 +- .../current/android/hardware/radio/Call.aidl | 16 +- .../hardware/radio/CallForwardInfo.aidl | 7 +- .../hardware/radio/CallForwardInfoStatus.aidl | 42 - .../hardware/radio/CallPresentation.aidl | 41 - .../android/hardware/radio/CallState.aidl | 43 - .../android/hardware/radio/CardState.aidl | 41 - .../android/hardware/radio/CardStatus.aidl | 6 +- .../android/hardware/radio/Carrier.aidl | 7 +- .../hardware/radio/CarrierMatchType.aidl | 42 - .../hardware/radio/CarrierRestrictions.aidl | 2 + .../CarrierRestrictionsWithPriority.aidl | 40 - ...nfo.aidl => Cdma2000RegistrationInfo.aidl} | 7 +- .../hardware/radio/CdmaCallWaiting.aidl | 20 +- .../radio/CdmaCallWaitingNumberPlan.aidl | 43 - .../CdmaCallWaitingNumberPresentation.aidl | 40 - .../radio/CdmaCallWaitingNumberType.aidl | 42 - .../hardware/radio/CdmaInfoRecName.aidl | 48 - .../hardware/radio/CdmaInformationRecord.aidl | 13 +- .../CdmaRedirectingNumberInfoRecord.aidl | 9 +- .../hardware/radio/CdmaRedirectingReason.aidl | 44 - .../android/hardware/radio/CdmaSmsAck.aidl | 2 +- .../hardware/radio/CdmaSmsAddress.aidl | 34 +- .../hardware/radio/CdmaSmsDigitMode.aidl | 39 - .../hardware/radio/CdmaSmsErrorClass.aidl | 39 - .../hardware/radio/CdmaSmsNumberMode.aidl | 39 - .../hardware/radio/CdmaSmsNumberPlan.aidl | 53 - .../hardware/radio/CdmaSmsNumberType.aidl | 45 - .../hardware/radio/CdmaSmsSubaddress.aidl | 4 +- .../hardware/radio/CdmaSmsSubaddressType.aidl | 39 - .../hardware/radio/CdmaSmsWriteArgs.aidl | 6 +- .../radio/CdmaSmsWriteArgsStatus.aidl | 41 - .../hardware/radio/CellIdentityLte.aidl | 2 +- .../hardware/radio/CellIdentityTdscdma.aidl | 2 +- .../hardware/radio/CellIdentityWcdma.aidl | 2 +- .../current/android/hardware/radio/Clir.aidl | 40 - .../hardware/radio/DataConnActiveStatus.aidl | 40 - .../android/hardware/radio/DataProfileId.aidl | 44 - .../hardware/radio/DataProfileInfo.aidl | 14 +- .../hardware/radio/DataProfileInfoType.aidl | 40 - .../hardware/radio/DataRegStateResult.aidl | 2 +- .../radio/DataRegStateResultVopsInfo.aidl | 39 - .../current/android/hardware/radio/Dial.aidl | 5 +- .../android/hardware/radio/EmcIndicator.aidl | 41 - .../hardware/radio/EmergencyNumber.aidl | 6 +- .../hardware/radio/EmergencyNumberSource.aidl | 41 - .../android/hardware/radio/EmfIndicator.aidl | 41 - ...nInfo.aidl => EutranRegistrationInfo.aidl} | 2 +- .../hardware/radio/FrequencyRange.aidl | 41 - .../hardware/radio/HandoverFailureMode.aidl | 41 - .../hardware/radio/HardwareConfig.aidl | 9 +- .../hardware/radio/HardwareConfigState.aidl | 40 - .../hardware/radio/HardwareConfigType.aidl | 39 - .../android/hardware/radio/IRadio.aidl | 10 +- .../hardware/radio/IRadioResponse.aidl | 2 +- .../current/android/hardware/radio/ISap.aidl | 2 +- .../hardware/radio/ImsiEncryptionInfo.aidl | 4 +- .../IncrementalResultsPeriodicityRange.aidl | 39 - .../hardware/radio/KeepaliveRequest.aidl | 4 +- .../hardware/radio/KeepaliveStatus.aidl | 5 +- .../hardware/radio/KeepaliveStatusCode.aidl | 40 - .../android/hardware/radio/KeepaliveType.aidl | 39 - .../android/hardware/radio/LceStatus.aidl | 40 - .../android/hardware/radio/LceStatusInfo.aidl | 5 +- .../android/hardware/radio/LinkAddress.aidl | 4 +- .../hardware/radio/MaxSearchTimeRange.aidl | 39 - .../android/hardware/radio/MaybePort.aidl | 39 - .../android/hardware/radio/MvnoType.aidl | 41 - .../hardware/radio/NetworkScanRequest.aidl | 10 +- .../hardware/radio/NetworkScanResult.aidl | 4 +- .../current/android/hardware/radio/NrQos.aidl | 2 + .../android/hardware/radio/NrVopsInfo.aidl | 17 +- .../android/hardware/radio/OperatorInfo.aidl | 6 +- .../hardware/radio/OperatorStatus.aidl | 41 - .../hardware/radio/OptionalCsgInfo.aidl | 39 - .../android/hardware/radio/OptionalDnn.aidl | 39 - .../hardware/radio/OptionalOsAppId.aidl | 39 - .../radio/OptionalPdpProtocolType.aidl | 39 - .../hardware/radio/OptionalSliceInfo.aidl | 39 - .../hardware/radio/OptionalSscMode.aidl | 39 - .../radio/OptionalTrafficDescriptor.aidl | 39 - .../android/hardware/radio/P2Constant.aidl | 38 - .../android/hardware/radio/PortRange.aidl | 2 + .../android/hardware/radio/PrlIndicator.aidl | 40 - .../android/hardware/radio/PublicKeyType.aidl | 39 - .../android/hardware/radio/QosFilter.aidl | 16 +- .../hardware/radio/QosFilterDirection.aidl | 40 - .../hardware/radio/QosFlowIdRange.aidl | 39 - .../android/hardware/radio/QosPortRange.aidl | 39 - .../android/hardware/radio/QosProtocol.aidl | 42 - .../hardware/radio/RadioCapability.aidl | 12 +- .../hardware/radio/RadioCapabilityPhase.aidl | 42 - .../hardware/radio/RadioCapabilityStatus.aidl | 40 - .../hardware/radio/RadioCdmaSmsConst.aidl | 52 - .../android/hardware/radio/RadioConst.aidl | 1 + .../hardware/radio/RadioFrequencyInfo.aidl | 6 +- .../hardware/radio/RegStateResult.aidl | 2 +- ...ateResultAccessTechnologySpecificInfo.aidl | 42 - .../hardware/radio/RestrictedState.aidl | 42 - .../radio/RouteSelectionDescriptor.aidl | 8 +- .../hardware/radio/ScanIntervalRange.aidl | 39 - .../android/hardware/radio/ScanStatus.aidl | 39 - .../android/hardware/radio/ScanType.aidl | 39 - .../android/hardware/radio/SelectUiccSub.aidl | 9 +- .../hardware/radio/SetupDataCallResult.aidl | 13 +- .../hardware/radio/SignalMeasurementType.aidl | 45 - .../hardware/radio/SignalThresholdInfo.aidl | 10 +- .../hardware/radio/SimRefreshResult.aidl | 5 +- .../hardware/radio/SimRefreshType.aidl | 40 - .../android/hardware/radio/SliceInfo.aidl | 16 +- .../hardware/radio/SliceServiceType.aidl | 41 - .../android/hardware/radio/SliceStatus.aidl | 43 - .../android/hardware/radio/SmsWriteArgs.aidl | 6 +- .../hardware/radio/SmsWriteArgsStatus.aidl | 41 - .../android/hardware/radio/SsRequestType.aidl | 42 - .../android/hardware/radio/SsServiceType.aidl | 56 - .../hardware/radio/SsTeleserviceType.aidl | 43 - .../android/hardware/radio/SscMode.aidl | 40 - .../hardware/radio/StkCcUnsolSsResult.aidl | 48 +- .../hardware/radio/SubscriptionType.aidl | 40 - .../hardware/radio/SuppServiceClass.aidl | 47 - .../android/hardware/radio/TimeStampType.aidl | 42 - .../hardware/radio/TrafficDescriptor.aidl | 4 +- .../hardware/radio/UiccSubActStatus.aidl | 39 - .../android/hardware/radio/UrspRule.aidl | 2 +- .../android/hardware/radio/UusDcs.aidl | 42 - .../android/hardware/radio/UusInfo.aidl | 16 +- .../android/hardware/radio/UusType.aidl | 44 - .../android/hardware/radio/VopsIndicator.aidl | 40 - ...aidl => AccessTechnologySpecificInfo.aidl} | 10 +- .../hardware/radio/AddressProperty.aidl | 31 - .../aidl/android/hardware/radio/AppState.aidl | 37 - .../android/hardware/radio/AppStatus.aidl | 37 +- .../aidl/android/hardware/radio/AppType.aidl | 28 - .../android/hardware/radio/BarringInfo.aidl | 103 +- .../radio/BarringInfoBarringType.aidl | 34 - .../BarringInfoBarringTypeSpecificInfo.aidl | 31 - .../radio/BarringInfoServiceType.aidl | 100 - ...onal.aidl => BarringTypeSpecificInfo.aidl} | 2 +- radio/aidl/android/hardware/radio/Call.aidl | 41 +- .../hardware/radio/CallForwardInfo.aidl | 11 +- .../hardware/radio/CallForwardInfoStatus.aidl | 27 - .../hardware/radio/CallPresentation.aidl | 26 - .../android/hardware/radio/CallState.aidl | 40 - .../android/hardware/radio/CardState.aidl | 37 - .../android/hardware/radio/CardStatus.aidl | 22 +- .../aidl/android/hardware/radio/Carrier.aidl | 26 +- .../hardware/radio/CarrierMatchType.aidl | 42 - .../hardware/radio/CarrierRestrictions.aidl | 14 + .../CarrierRestrictionsWithPriority.aidl | 42 - ...nfo.aidl => Cdma2000RegistrationInfo.aidl} | 10 +- .../hardware/radio/CdmaCallWaiting.aidl | 31 +- .../radio/CdmaCallWaitingNumberPlan.aidl | 28 - .../CdmaCallWaitingNumberPresentation.aidl | 25 - .../radio/CdmaCallWaitingNumberType.aidl | 27 - .../hardware/radio/CdmaInfoRecName.aidl | 36 - .../hardware/radio/CdmaInformationRecord.aidl | 19 +- .../CdmaRedirectingNumberInfoRecord.aidl | 15 +- .../hardware/radio/CdmaRedirectingReason.aidl | 32 - .../android/hardware/radio/CdmaSmsAck.aidl | 4 +- .../hardware/radio/CdmaSmsAddress.aidl | 79 +- .../hardware/radio/CdmaSmsDigitMode.aidl | 27 - .../hardware/radio/CdmaSmsErrorClass.aidl | 24 - .../hardware/radio/CdmaSmsNumberMode.aidl | 24 - .../hardware/radio/CdmaSmsNumberPlan.aidl | 47 - .../hardware/radio/CdmaSmsNumberType.aidl | 43 - .../hardware/radio/CdmaSmsSubaddress.aidl | 16 +- .../hardware/radio/CdmaSmsSubaddressType.aidl | 30 - .../hardware/radio/CdmaSmsWriteArgs.aidl | 9 +- .../radio/CdmaSmsWriteArgsStatus.aidl | 26 - .../hardware/radio/CellIdentityLte.aidl | 4 +- .../hardware/radio/CellIdentityTdscdma.aidl | 4 +- .../hardware/radio/CellIdentityWcdma.aidl | 4 +- radio/aidl/android/hardware/radio/Clir.aidl | 34 - .../hardware/radio/DataConnActiveStatus.aidl | 37 - .../android/hardware/radio/DataProfileId.aidl | 32 - .../hardware/radio/DataProfileInfo.aidl | 23 +- .../hardware/radio/DataProfileInfoType.aidl | 25 - .../hardware/radio/DataRegStateResult.aidl | 4 +- .../radio/DataRegStateResultVopsInfo.aidl | 28 - radio/aidl/android/hardware/radio/Dial.aidl | 19 +- .../android/hardware/radio/EmcIndicator.aidl | 41 - .../hardware/radio/EmergencyNumber.aidl | 27 +- .../hardware/radio/EmergencyNumberSource.aidl | 44 - .../android/hardware/radio/EmfIndicator.aidl | 41 - ...nInfo.aidl => EutranRegistrationInfo.aidl} | 2 +- .../hardware/radio/FrequencyRange.aidl | 41 - .../hardware/radio/HandoverFailureMode.aidl | 44 - .../hardware/radio/HardwareConfig.aidl | 19 +- .../hardware/radio/HardwareConfigModem.aidl | 21 +- .../hardware/radio/HardwareConfigState.aidl | 25 - .../hardware/radio/HardwareConfigType.aidl | 24 - radio/aidl/android/hardware/radio/IRadio.aidl | 449 +- .../hardware/radio/IRadioIndication.aidl | 122 +- .../hardware/radio/IRadioResponse.aidl | 348 +- radio/aidl/android/hardware/radio/ISap.aidl | 18 +- .../android/hardware/radio/ISapCallback.aidl | 24 +- .../hardware/radio/ImsiEncryptionInfo.aidl | 16 +- .../IncrementalResultsPeriodicityRange.aidl | 27 - .../hardware/radio/KeepaliveRequest.aidl | 14 +- .../hardware/radio/KeepaliveStatus.aidl | 23 +- .../hardware/radio/KeepaliveStatusCode.aidl | 35 - .../android/hardware/radio/KeepaliveType.aidl | 30 - .../android/hardware/radio/LceStatus.aidl | 25 - .../android/hardware/radio/LceStatusInfo.aidl | 11 +- .../android/hardware/radio/LinkAddress.aidl | 12 +- .../hardware/radio/MaxSearchTimeRange.aidl | 27 - .../android/hardware/radio/MaybePort.aidl | 28 - .../aidl/android/hardware/radio/MvnoType.aidl | 38 - .../hardware/radio/NetworkScanRequest.aidl | 30 +- .../hardware/radio/NetworkScanResult.aidl | 13 +- radio/aidl/android/hardware/radio/NrQos.aidl | 5 +- .../android/hardware/radio/NrVopsInfo.aidl | 60 +- .../android/hardware/radio/OperatorInfo.aidl | 12 +- .../hardware/radio/OperatorStatus.aidl | 26 - .../hardware/radio/OptionalCsgInfo.aidl | 31 - .../android/hardware/radio/OptionalDnn.aidl | 27 - .../hardware/radio/OptionalOsAppId.aidl | 28 - .../radio/OptionalPdpProtocolType.aidl | 28 - .../hardware/radio/OptionalSliceInfo.aidl | 28 - .../hardware/radio/OptionalSscMode.aidl | 28 - .../radio/OptionalTrafficDescriptor.aidl | 28 - .../android/hardware/radio/P2Constant.aidl | 26 - .../android/hardware/radio/PortRange.aidl | 5 +- .../android/hardware/radio/PrlIndicator.aidl | 25 - .../android/hardware/radio/PublicKeyType.aidl | 33 - .../android/hardware/radio/QosFilter.aidl | 46 +- .../hardware/radio/QosFilterDirection.aidl | 25 - .../hardware/radio/QosFlowIdRange.aidl | 27 - .../android/hardware/radio/QosPortRange.aidl | 27 - .../android/hardware/radio/QosProtocol.aidl | 45 - .../hardware/radio/RadioCapability.aidl | 52 +- .../hardware/radio/RadioCapabilityPhase.aidl | 47 - .../hardware/radio/RadioCapabilityStatus.aidl | 36 - .../hardware/radio/RadioCdmaSmsConst.aidl | 37 - .../android/hardware/radio/RadioConst.aidl | 4 + .../hardware/radio/RadioFrequencyInfo.aidl | 22 +- .../hardware/radio/RegStateResult.aidl | 4 +- .../hardware/radio/RestrictedState.aidl | 27 - .../radio/RouteSelectionDescriptor.aidl | 18 +- .../hardware/radio/ScanIntervalRange.aidl | 27 - .../android/hardware/radio/ScanStatus.aidl | 30 - .../aidl/android/hardware/radio/ScanType.aidl | 30 - .../android/hardware/radio/SelectUiccSub.aidl | 20 +- .../hardware/radio/SetupDataCallResult.aidl | 45 +- .../hardware/radio/SignalMeasurementType.aidl | 83 - .../hardware/radio/SignalThresholdInfo.aidl | 64 +- .../hardware/radio/SimRefreshResult.aidl | 20 +- .../hardware/radio/SimRefreshType.aidl | 34 - .../android/hardware/radio/SliceInfo.aidl | 51 +- .../hardware/radio/SliceServiceType.aidl | 41 - .../android/hardware/radio/SliceStatus.aidl | 43 - .../android/hardware/radio/SmsWriteArgs.aidl | 10 +- .../hardware/radio/SmsWriteArgsStatus.aidl | 26 - .../android/hardware/radio/SsRequestType.aidl | 27 - .../android/hardware/radio/SsServiceType.aidl | 41 - .../hardware/radio/SsTeleserviceType.aidl | 28 - .../aidl/android/hardware/radio/SscMode.aidl | 28 - .../hardware/radio/StkCcUnsolSsResult.aidl | 68 +- .../hardware/radio/SubscriptionType.aidl | 25 - .../hardware/radio/SuppServiceClass.aidl | 32 - .../android/hardware/radio/TimeStampType.aidl | 27 - .../hardware/radio/TrafficDescriptor.aidl | 7 +- .../android/hardware/radio/Translate.java | 2520 ------ .../hardware/radio/UiccSubActStatus.aidl | 24 - .../aidl/android/hardware/radio/UrspRule.aidl | 2 +- radio/aidl/android/hardware/radio/UusDcs.aidl | 47 - .../aidl/android/hardware/radio/UusInfo.aidl | 44 +- .../aidl/android/hardware/radio/UusType.aidl | 32 - .../android/hardware/radio/VopsIndicator.aidl | 37 - .../android/hardware/radio/translate-ndk.cpp | 7404 ----------------- .../android/hardware/radio/translate-ndk.h | 699 -- 281 files changed, 1912 insertions(+), 17526 deletions(-) rename radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/{BarringInfoBarringTypeSpecificInfo.aidl => AccessTechnologySpecificInfo.aidl} (88%) delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AddressProperty.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppState.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoServiceType.aidl rename radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/{BarringInfoBarringTypeSpecificInfoConditional.aidl => BarringTypeSpecificInfo.aidl} (96%) delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfoStatus.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallPresentation.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallState.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardState.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierMatchType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictionsWithPriority.aidl rename radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/{RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.aidl => Cdma2000RegistrationInfo.aidl} (90%) delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInfoRecName.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingReason.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsDigitMode.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsErrorClass.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberMode.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberPlan.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddressType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Clir.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataConnActiveStatus.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileId.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfoType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResultVopsInfo.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmcIndicator.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumberSource.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmfIndicator.aidl rename radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/{RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl => EutranRegistrationInfo.aidl} (95%) delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/FrequencyRange.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HandoverFailureMode.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigState.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatusCode.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatus.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaxSearchTimeRange.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaybePort.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MvnoType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorStatus.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalCsgInfo.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalDnn.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalOsAppId.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalPdpProtocolType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSliceInfo.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSscMode.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalTrafficDescriptor.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/P2Constant.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PrlIndicator.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PublicKeyType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterDirection.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFlowIdRange.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosPortRange.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosProtocol.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityPhase.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityStatus.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCdmaSmsConst.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RestrictedState.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanIntervalRange.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanStatus.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalMeasurementType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceServiceType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceStatus.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgsStatus.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsRequestType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsServiceType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsTeleserviceType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SscMode.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SubscriptionType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SuppServiceClass.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TimeStampType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UiccSubActStatus.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusDcs.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusType.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/VopsIndicator.aidl rename radio/aidl/android/hardware/radio/{RegStateResultAccessTechnologySpecificInfo.aidl => AccessTechnologySpecificInfo.aidl} (73%) delete mode 100644 radio/aidl/android/hardware/radio/AddressProperty.aidl delete mode 100644 radio/aidl/android/hardware/radio/AppState.aidl delete mode 100644 radio/aidl/android/hardware/radio/AppType.aidl delete mode 100644 radio/aidl/android/hardware/radio/BarringInfoBarringType.aidl delete mode 100644 radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.aidl delete mode 100644 radio/aidl/android/hardware/radio/BarringInfoServiceType.aidl rename radio/aidl/android/hardware/radio/{BarringInfoBarringTypeSpecificInfoConditional.aidl => BarringTypeSpecificInfo.aidl} (96%) delete mode 100644 radio/aidl/android/hardware/radio/CallForwardInfoStatus.aidl delete mode 100644 radio/aidl/android/hardware/radio/CallPresentation.aidl delete mode 100644 radio/aidl/android/hardware/radio/CallState.aidl delete mode 100644 radio/aidl/android/hardware/radio/CardState.aidl delete mode 100644 radio/aidl/android/hardware/radio/CarrierMatchType.aidl delete mode 100644 radio/aidl/android/hardware/radio/CarrierRestrictionsWithPriority.aidl rename radio/aidl/android/hardware/radio/{RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.aidl => Cdma2000RegistrationInfo.aidl} (85%) delete mode 100644 radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl delete mode 100644 radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl delete mode 100644 radio/aidl/android/hardware/radio/CdmaCallWaitingNumberType.aidl delete mode 100644 radio/aidl/android/hardware/radio/CdmaInfoRecName.aidl delete mode 100644 radio/aidl/android/hardware/radio/CdmaRedirectingReason.aidl delete mode 100644 radio/aidl/android/hardware/radio/CdmaSmsDigitMode.aidl delete mode 100644 radio/aidl/android/hardware/radio/CdmaSmsErrorClass.aidl delete mode 100644 radio/aidl/android/hardware/radio/CdmaSmsNumberMode.aidl delete mode 100644 radio/aidl/android/hardware/radio/CdmaSmsNumberPlan.aidl delete mode 100644 radio/aidl/android/hardware/radio/CdmaSmsNumberType.aidl delete mode 100644 radio/aidl/android/hardware/radio/CdmaSmsSubaddressType.aidl delete mode 100644 radio/aidl/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl delete mode 100644 radio/aidl/android/hardware/radio/Clir.aidl delete mode 100644 radio/aidl/android/hardware/radio/DataConnActiveStatus.aidl delete mode 100644 radio/aidl/android/hardware/radio/DataProfileId.aidl delete mode 100644 radio/aidl/android/hardware/radio/DataProfileInfoType.aidl delete mode 100644 radio/aidl/android/hardware/radio/DataRegStateResultVopsInfo.aidl delete mode 100644 radio/aidl/android/hardware/radio/EmcIndicator.aidl delete mode 100644 radio/aidl/android/hardware/radio/EmergencyNumberSource.aidl delete mode 100644 radio/aidl/android/hardware/radio/EmfIndicator.aidl rename radio/aidl/android/hardware/radio/{RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl => EutranRegistrationInfo.aidl} (93%) delete mode 100644 radio/aidl/android/hardware/radio/FrequencyRange.aidl delete mode 100644 radio/aidl/android/hardware/radio/HandoverFailureMode.aidl delete mode 100644 radio/aidl/android/hardware/radio/HardwareConfigState.aidl delete mode 100644 radio/aidl/android/hardware/radio/HardwareConfigType.aidl delete mode 100644 radio/aidl/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl delete mode 100644 radio/aidl/android/hardware/radio/KeepaliveStatusCode.aidl delete mode 100644 radio/aidl/android/hardware/radio/KeepaliveType.aidl delete mode 100644 radio/aidl/android/hardware/radio/LceStatus.aidl delete mode 100644 radio/aidl/android/hardware/radio/MaxSearchTimeRange.aidl delete mode 100644 radio/aidl/android/hardware/radio/MaybePort.aidl delete mode 100644 radio/aidl/android/hardware/radio/MvnoType.aidl delete mode 100644 radio/aidl/android/hardware/radio/OperatorStatus.aidl delete mode 100644 radio/aidl/android/hardware/radio/OptionalCsgInfo.aidl delete mode 100644 radio/aidl/android/hardware/radio/OptionalDnn.aidl delete mode 100644 radio/aidl/android/hardware/radio/OptionalOsAppId.aidl delete mode 100644 radio/aidl/android/hardware/radio/OptionalPdpProtocolType.aidl delete mode 100644 radio/aidl/android/hardware/radio/OptionalSliceInfo.aidl delete mode 100644 radio/aidl/android/hardware/radio/OptionalSscMode.aidl delete mode 100644 radio/aidl/android/hardware/radio/OptionalTrafficDescriptor.aidl delete mode 100644 radio/aidl/android/hardware/radio/P2Constant.aidl delete mode 100644 radio/aidl/android/hardware/radio/PrlIndicator.aidl delete mode 100644 radio/aidl/android/hardware/radio/PublicKeyType.aidl delete mode 100644 radio/aidl/android/hardware/radio/QosFilterDirection.aidl delete mode 100644 radio/aidl/android/hardware/radio/QosFlowIdRange.aidl delete mode 100644 radio/aidl/android/hardware/radio/QosPortRange.aidl delete mode 100644 radio/aidl/android/hardware/radio/QosProtocol.aidl delete mode 100644 radio/aidl/android/hardware/radio/RadioCapabilityPhase.aidl delete mode 100644 radio/aidl/android/hardware/radio/RadioCapabilityStatus.aidl delete mode 100644 radio/aidl/android/hardware/radio/RadioCdmaSmsConst.aidl delete mode 100644 radio/aidl/android/hardware/radio/RestrictedState.aidl delete mode 100644 radio/aidl/android/hardware/radio/ScanIntervalRange.aidl delete mode 100644 radio/aidl/android/hardware/radio/ScanStatus.aidl delete mode 100644 radio/aidl/android/hardware/radio/ScanType.aidl delete mode 100644 radio/aidl/android/hardware/radio/SignalMeasurementType.aidl delete mode 100644 radio/aidl/android/hardware/radio/SimRefreshType.aidl delete mode 100644 radio/aidl/android/hardware/radio/SliceServiceType.aidl delete mode 100644 radio/aidl/android/hardware/radio/SliceStatus.aidl delete mode 100644 radio/aidl/android/hardware/radio/SmsWriteArgsStatus.aidl delete mode 100644 radio/aidl/android/hardware/radio/SsRequestType.aidl delete mode 100644 radio/aidl/android/hardware/radio/SsServiceType.aidl delete mode 100644 radio/aidl/android/hardware/radio/SsTeleserviceType.aidl delete mode 100644 radio/aidl/android/hardware/radio/SscMode.aidl delete mode 100644 radio/aidl/android/hardware/radio/SubscriptionType.aidl delete mode 100644 radio/aidl/android/hardware/radio/SuppServiceClass.aidl delete mode 100644 radio/aidl/android/hardware/radio/TimeStampType.aidl delete mode 100644 radio/aidl/android/hardware/radio/Translate.java delete mode 100644 radio/aidl/android/hardware/radio/UiccSubActStatus.aidl delete mode 100644 radio/aidl/android/hardware/radio/UusDcs.aidl delete mode 100644 radio/aidl/android/hardware/radio/UusType.aidl delete mode 100644 radio/aidl/android/hardware/radio/VopsIndicator.aidl delete mode 100644 radio/aidl/android/hardware/radio/translate-ndk.cpp delete mode 100644 radio/aidl/include/android/hardware/radio/translate-ndk.h diff --git a/radio/aidl/Android.bp b/radio/aidl/Android.bp index 29d7a58471..998c8ea135 100644 --- a/radio/aidl/Android.bp +++ b/radio/aidl/Android.bp @@ -21,7 +21,6 @@ aidl_interface { cc_library { name: "android.hardware.radio-translate-ndk", vendor_available: true, - srcs: ["android/hardware/radio/translate-ndk.cpp"], shared_libs: [ "libbinder_ndk", "libhidlbase", @@ -34,12 +33,10 @@ cc_library { "android.hardware.radio@1.5", "android.hardware.radio@1.6", ], - export_include_dirs: ["include"], } java_library { name: "android.hardware.radio-translate-java", - srcs: ["android/hardware/radio/Translate.java"], libs: [ "android.hardware.radio-V1-java", "android.hardware.radio-V1.0-java", diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessTechnologySpecificInfo.aidl similarity index 88% rename from radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.aidl rename to radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessTechnologySpecificInfo.aidl index c2ba1d2e2d..988f118d43 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessTechnologySpecificInfo.aidl @@ -33,7 +33,10 @@ package android.hardware.radio; @VintfStability -union BarringInfoBarringTypeSpecificInfo { +union AccessTechnologySpecificInfo { boolean noinit; - android.hardware.radio.BarringInfoBarringTypeSpecificInfoConditional conditional; + android.hardware.radio.Cdma2000RegistrationInfo cdmaInfo; + android.hardware.radio.EutranRegistrationInfo eutranInfo; + android.hardware.radio.NrVopsInfo ngranNrVopsInfo; + boolean geranDtmSupported; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AddressProperty.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AddressProperty.aidl deleted file mode 100644 index dd6e79a1c1..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AddressProperty.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum AddressProperty { - NONE = 0, - DEPRECATED = 32, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppState.aidl deleted file mode 100644 index 59e2bd43ce..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppState.aidl +++ /dev/null @@ -1,43 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum AppState { - UNKNOWN = 0, - DETECTED = 1, - PIN = 2, - PUK = 3, - SUBSCRIPTION_PERSO = 4, - READY = 5, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppStatus.aidl index c9abe3263c..ea2cd3a08e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppStatus.aidl @@ -34,12 +34,24 @@ package android.hardware.radio; @VintfStability parcelable AppStatus { - android.hardware.radio.AppType appType; - android.hardware.radio.AppState appState; + int appType; + int appState; android.hardware.radio.PersoSubstate persoSubstate; String aidPtr; String appLabelPtr; - int pin1Replaced; + boolean pin1Replaced; android.hardware.radio.PinState pin1; android.hardware.radio.PinState pin2; + const int APP_STATE_UNKNOWN = 0; + const int APP_STATE_DETECTED = 1; + const int APP_STATE_PIN = 2; + const int APP_STATE_PUK = 3; + const int APP_STATE_SUBSCRIPTION_PERSO = 4; + const int APP_STATE_READY = 5; + const int APP_TYPE_UNKNOWN = 0; + const int APP_TYPE_SIM = 1; + const int APP_TYPE_USIM = 2; + const int APP_TYPE_RUIM = 3; + const int APP_TYPE_CSIM = 4; + const int APP_TYPE_ISIM = 5; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppType.aidl deleted file mode 100644 index adbbe9f002..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AppType.aidl +++ /dev/null @@ -1,43 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum AppType { - UNKNOWN = 0, - SIM = 1, - USIM = 2, - RUIM = 3, - CSIM = 4, - ISIM = 5, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfo.aidl index ac0b4aa6da..1623764df1 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfo.aidl @@ -34,7 +34,52 @@ package android.hardware.radio; @VintfStability parcelable BarringInfo { - android.hardware.radio.BarringInfoServiceType serviceType; - android.hardware.radio.BarringInfoBarringType barringType; - android.hardware.radio.BarringInfoBarringTypeSpecificInfo barringTypeSpecificInfo; + int serviceType; + int barringType; + @nullable android.hardware.radio.BarringTypeSpecificInfo barringTypeSpecificInfo; + const int BARRING_TYPE_NONE = 0; + const int BARRING_TYPE_CONDITIONAL = 1; + const int BARRING_TYPE_UNCONDITIONAL = 2; + const int SERVICE_TYPE_CS_SERVICE = 0; + const int SERVICE_TYPE_PS_SERVICE = 1; + const int SERVICE_TYPE_CS_VOICE = 2; + const int SERVICE_TYPE_MO_SIGNALLING = 3; + const int SERVICE_TYPE_MO_DATA = 4; + const int SERVICE_TYPE_CS_FALLBACK = 5; + const int SERVICE_TYPE_MMTEL_VOICE = 6; + const int SERVICE_TYPE_MMTEL_VIDEO = 7; + const int SERVICE_TYPE_EMERGENCY = 8; + const int SERVICE_TYPE_SMS = 9; + const int SERVICE_TYPE_OPERATOR_1 = 1001; + const int SERVICE_TYPE_OPERATOR_2 = 1002; + const int SERVICE_TYPE_OPERATOR_3 = 1003; + const int SERVICE_TYPE_OPERATOR_4 = 1004; + const int SERVICE_TYPE_OPERATOR_5 = 1005; + const int SERVICE_TYPE_OPERATOR_6 = 1006; + const int SERVICE_TYPE_OPERATOR_7 = 1007; + const int SERVICE_TYPE_OPERATOR_8 = 1008; + const int SERVICE_TYPE_OPERATOR_9 = 1009; + const int SERVICE_TYPE_OPERATOR_10 = 1010; + const int SERVICE_TYPE_OPERATOR_11 = 1011; + const int SERVICE_TYPE_OPERATOR_12 = 1012; + const int SERVICE_TYPE_OPERATOR_13 = 1013; + const int SERVICE_TYPE_OPERATOR_14 = 1014; + const int SERVICE_TYPE_OPERATOR_15 = 1015; + const int SERVICE_TYPE_OPERATOR_16 = 1016; + const int SERVICE_TYPE_OPERATOR_17 = 1017; + const int SERVICE_TYPE_OPERATOR_18 = 1018; + const int SERVICE_TYPE_OPERATOR_19 = 1019; + const int SERVICE_TYPE_OPERATOR_20 = 1020; + const int SERVICE_TYPE_OPERATOR_21 = 1021; + const int SERVICE_TYPE_OPERATOR_22 = 1022; + const int SERVICE_TYPE_OPERATOR_23 = 1023; + const int SERVICE_TYPE_OPERATOR_24 = 1024; + const int SERVICE_TYPE_OPERATOR_25 = 1025; + const int SERVICE_TYPE_OPERATOR_26 = 1026; + const int SERVICE_TYPE_OPERATOR_27 = 1027; + const int SERVICE_TYPE_OPERATOR_28 = 1028; + const int SERVICE_TYPE_OPERATOR_29 = 1029; + const int SERVICE_TYPE_OPERATOR_30 = 1030; + const int SERVICE_TYPE_OPERATOR_31 = 1031; + const int SERVICE_TYPE_OPERATOR_32 = 1032; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringType.aidl deleted file mode 100644 index 6b8006ebaa..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringType.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum BarringInfoBarringType { - NONE = 0, - CONDITIONAL = 1, - UNCONDITIONAL = 2, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoServiceType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoServiceType.aidl deleted file mode 100644 index faea9b9ab8..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoServiceType.aidl +++ /dev/null @@ -1,79 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum BarringInfoServiceType { - CS_SERVICE = 0, - PS_SERVICE = 1, - CS_VOICE = 2, - MO_SIGNALLING = 3, - MO_DATA = 4, - CS_FALLBACK = 5, - MMTEL_VOICE = 6, - MMTEL_VIDEO = 7, - EMERGENCY = 8, - SMS = 9, - OPERATOR_1 = 1001, - OPERATOR_2 = 1002, - OPERATOR_3 = 1003, - OPERATOR_4 = 1004, - OPERATOR_5 = 1005, - OPERATOR_6 = 1006, - OPERATOR_7 = 1007, - OPERATOR_8 = 1008, - OPERATOR_9 = 1009, - OPERATOR_10 = 1010, - OPERATOR_11 = 1011, - OPERATOR_12 = 1012, - OPERATOR_13 = 1013, - OPERATOR_14 = 1014, - OPERATOR_15 = 1015, - OPERATOR_16 = 1016, - OPERATOR_17 = 1017, - OPERATOR_18 = 1018, - OPERATOR_19 = 1019, - OPERATOR_20 = 1020, - OPERATOR_21 = 1021, - OPERATOR_22 = 1022, - OPERATOR_23 = 1023, - OPERATOR_24 = 1024, - OPERATOR_25 = 1025, - OPERATOR_26 = 1026, - OPERATOR_27 = 1027, - OPERATOR_28 = 1028, - OPERATOR_29 = 1029, - OPERATOR_30 = 1030, - OPERATOR_31 = 1031, - OPERATOR_32 = 1032, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringTypeSpecificInfo.aidl similarity index 96% rename from radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.aidl rename to radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringTypeSpecificInfo.aidl index 8c079e2e3a..98b46c99e3 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/BarringTypeSpecificInfo.aidl @@ -33,7 +33,7 @@ package android.hardware.radio; @VintfStability -parcelable BarringInfoBarringTypeSpecificInfoConditional { +parcelable BarringTypeSpecificInfo { int factor; int timeSeconds; boolean isBarred; diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Call.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Call.aidl index 36e1ae31e5..b4a3cc7557 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Call.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Call.aidl @@ -34,7 +34,7 @@ package android.hardware.radio; @VintfStability parcelable Call { - android.hardware.radio.CallState state; + int state; int index; int toa; boolean isMpty; @@ -43,10 +43,20 @@ parcelable Call { boolean isVoice; boolean isVoicePrivacy; String number; - android.hardware.radio.CallPresentation numberPresentation; + int numberPresentation; String name; - android.hardware.radio.CallPresentation namePresentation; + int namePresentation; android.hardware.radio.UusInfo[] uusInfo; android.hardware.radio.AudioQuality audioQuality; String forwardedNumber; + const int PRESENTATION_ALLOWED = 0; + const int PRESENTATION_RESTRICTED = 1; + const int PRESENTATION_UNKNOWN = 2; + const int PRESENTATION_PAYPHONE = 3; + const int STATE_ACTIVE = 0; + const int STATE_HOLDING = 1; + const int STATE_DIALING = 2; + const int STATE_ALERTING = 3; + const int STATE_INCOMING = 4; + const int STATE_WAITING = 5; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfo.aidl index bcfa90fcdc..0b79272721 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfo.aidl @@ -34,10 +34,15 @@ package android.hardware.radio; @VintfStability parcelable CallForwardInfo { - android.hardware.radio.CallForwardInfoStatus status; + int status; int reason; int serviceClass; int toa; String number; int timeSeconds; + const int STATUS_DISABLE = 0; + const int STATUS_ENABLE = 1; + const int STATUS_INTERROGATE = 2; + const int STATUS_REGISTRATION = 3; + const int STATUS_ERASURE = 4; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfoStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfoStatus.aidl deleted file mode 100644 index 5ac129a0ee..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallForwardInfoStatus.aidl +++ /dev/null @@ -1,42 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CallForwardInfoStatus { - DISABLE = 0, - ENABLE = 1, - INTERROGATE = 2, - REGISTRATION = 3, - ERASURE = 4, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallPresentation.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallPresentation.aidl deleted file mode 100644 index c32cd08201..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallPresentation.aidl +++ /dev/null @@ -1,41 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CallPresentation { - ALLOWED = 0, - RESTRICTED = 1, - UNKNOWN = 2, - PAYPHONE = 3, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallState.aidl deleted file mode 100644 index 375ca2c5af..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CallState.aidl +++ /dev/null @@ -1,43 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CallState { - ACTIVE = 0, - HOLDING = 1, - DIALING = 2, - ALERTING = 3, - INCOMING = 4, - WAITING = 5, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardState.aidl deleted file mode 100644 index d200b9757f..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardState.aidl +++ /dev/null @@ -1,41 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CardState { - ABSENT = 0, - PRESENT = 1, - ERROR = 2, - RESTRICTED = 3, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardStatus.aidl index e11bb21b5d..e7a666f903 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CardStatus.aidl @@ -34,7 +34,7 @@ package android.hardware.radio; @VintfStability parcelable CardStatus { - android.hardware.radio.CardState cardState; + int cardState; android.hardware.radio.PinState universalPinState; int gsmUmtsSubscriptionAppIndex; int cdmaSubscriptionAppIndex; @@ -44,4 +44,8 @@ parcelable CardStatus { String atr; String iccid; String eid; + const int STATE_ABSENT = 0; + const int STATE_PRESENT = 1; + const int STATE_ERROR = 2; + const int STATE_RESTRICTED = 3; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Carrier.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Carrier.aidl index bbf777f94a..46d5dca2ff 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Carrier.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Carrier.aidl @@ -36,6 +36,11 @@ package android.hardware.radio; parcelable Carrier { String mcc; String mnc; - android.hardware.radio.CarrierMatchType matchType; + int matchType; String matchData; + const int MATCH_TYPE_ALL = 0; + const int MATCH_TYPE_SPN = 1; + const int MATCH_TYPE_IMSI_PREFIX = 2; + const int MATCH_TYPE_GID1 = 3; + const int MATCH_TYPE_GID2 = 4; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierMatchType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierMatchType.aidl deleted file mode 100644 index c3596cde1a..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierMatchType.aidl +++ /dev/null @@ -1,42 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CarrierMatchType { - ALL = 0, - SPN = 1, - IMSI_PREFIX = 2, - GID1 = 3, - GID2 = 4, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictions.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictions.aidl index f8cafb58a2..f7c7a5a436 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictions.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictions.aidl @@ -36,4 +36,6 @@ package android.hardware.radio; parcelable CarrierRestrictions { android.hardware.radio.Carrier[] allowedCarriers; android.hardware.radio.Carrier[] excludedCarriers; + boolean priority; + boolean allowedCarriersPrioritized; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictionsWithPriority.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictionsWithPriority.aidl deleted file mode 100644 index 1f06980416..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CarrierRestrictionsWithPriority.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@VintfStability -parcelable CarrierRestrictionsWithPriority { - android.hardware.radio.Carrier[] allowedCarriers; - android.hardware.radio.Carrier[] excludedCarriers; - boolean allowedCarriersPrioritized; -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Cdma2000RegistrationInfo.aidl similarity index 90% rename from radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.aidl rename to radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Cdma2000RegistrationInfo.aidl index a56a791c7a..6e4d7b63f8 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Cdma2000RegistrationInfo.aidl @@ -33,9 +33,12 @@ package android.hardware.radio; @VintfStability -parcelable RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo { +parcelable Cdma2000RegistrationInfo { boolean cssSupported; int roamingIndicator; - android.hardware.radio.PrlIndicator systemIsInPrl; + int systemIsInPrl; int defaultRoamingIndicator; + const int PRL_INDICATOR_NOT_REGISTERED = -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/current/android/hardware/radio/CdmaCallWaiting.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaiting.aidl index 564433fc9c..b4866919cd 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaiting.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaiting.aidl @@ -35,9 +35,23 @@ package android.hardware.radio; @VintfStability parcelable CdmaCallWaiting { String number; - android.hardware.radio.CdmaCallWaitingNumberPresentation numberPresentation; + int numberPresentation; String name; android.hardware.radio.CdmaSignalInfoRecord signalInfoRecord; - android.hardware.radio.CdmaCallWaitingNumberType numberType; - android.hardware.radio.CdmaCallWaitingNumberPlan numberPlan; + int numberType; + int numberPlan; + const int NUMBER_PLAN_UNKNOWN = 0; + const int NUMBER_PLAN_ISDN = 1; + const int NUMBER_PLAN_DATA = 3; + const int NUMBER_PLAN_TELEX = 4; + const int NUMBER_PLAN_NATIONAL = 8; + const int NUMBER_PLAN_PRIVATE = 9; + const int NUMBER_PRESENTATION_ALLOWED = 0; + const int NUMBER_PRESENTATION_RESTRICTED = 1; + const int NUMBER_PRESENTATION_UNKNOWN = 2; + const int NUMBER_TYPE_UNKNOWN = 0; + const int NUMBER_TYPE_INTERNATIONAL = 1; + const int NUMBER_TYPE_NATIONAL = 2; + const int NUMBER_TYPE_NETWORK_SPECIFIC = 3; + const int NUMBER_TYPE_SUBSCRIBER = 4; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl deleted file mode 100644 index 6dcd594c09..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl +++ /dev/null @@ -1,43 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CdmaCallWaitingNumberPlan { - UNKNOWN = 0, - ISDN = 1, - DATA = 3, - TELEX = 4, - NATIONAL = 8, - PRIVATE = 9, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl deleted file mode 100644 index 22eaf6bedd..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CdmaCallWaitingNumberPresentation { - ALLOWED = 0, - RESTRICTED = 1, - UNKNOWN = 2, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberType.aidl deleted file mode 100644 index 47401083c1..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaCallWaitingNumberType.aidl +++ /dev/null @@ -1,42 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CdmaCallWaitingNumberType { - UNKNOWN = 0, - INTERNATIONAL = 1, - NATIONAL = 2, - NETWORK_SPECIFIC = 3, - SUBSCRIBER = 4, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInfoRecName.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInfoRecName.aidl deleted file mode 100644 index 182dcc0cca..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInfoRecName.aidl +++ /dev/null @@ -1,48 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CdmaInfoRecName { - DISPLAY = 0, - CALLED_PARTY_NUMBER = 1, - CALLING_PARTY_NUMBER = 2, - CONNECTED_NUMBER = 3, - SIGNAL = 4, - REDIRECTING_NUMBER = 5, - LINE_CONTROL = 6, - EXTENDED_DISPLAY = 7, - T53_CLIR = 8, - T53_RELEASE = 9, - T53_AUDIO_CONTROL = 10, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInformationRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInformationRecord.aidl index 844a1bf86d..c2f2df273b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInformationRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaInformationRecord.aidl @@ -34,7 +34,7 @@ package android.hardware.radio; @VintfStability parcelable CdmaInformationRecord { - android.hardware.radio.CdmaInfoRecName name; + int name; android.hardware.radio.CdmaDisplayInfoRecord[] display; android.hardware.radio.CdmaNumberInfoRecord[] number; android.hardware.radio.CdmaSignalInfoRecord[] signal; @@ -42,4 +42,15 @@ parcelable CdmaInformationRecord { android.hardware.radio.CdmaLineControlInfoRecord[] lineCtrl; android.hardware.radio.CdmaT53ClirInfoRecord[] clir; android.hardware.radio.CdmaT53AudioControlInfoRecord[] audioCtrl; + const int NAME_DISPLAY = 0; + const int NAME_CALLED_PARTY_NUMBER = 1; + const int NAME_CALLING_PARTY_NUMBER = 2; + const int NAME_CONNECTED_NUMBER = 3; + const int NAME_SIGNAL = 4; + const int NAME_REDIRECTING_NUMBER = 5; + const int NAME_LINE_CONTROL = 6; + const int NAME_EXTENDED_DISPLAY = 7; + const int NAME_T53_CLIR = 8; + const int NAME_T53_RELEASE = 9; + const int NAME_T53_AUDIO_CONTROL = 10; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl index 44b799323c..9713f80d75 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl @@ -35,5 +35,12 @@ package android.hardware.radio; @VintfStability parcelable CdmaRedirectingNumberInfoRecord { android.hardware.radio.CdmaNumberInfoRecord redirectingNumber; - android.hardware.radio.CdmaRedirectingReason redirectingReason; + int redirectingReason; + const int REDIRECTING_REASON_UNKNOWN = 0; + const int REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1; + const int REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2; + const int REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9; + const int REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10; + const int REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15; + const int REDIRECTING_REASON_RESERVED = 16; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingReason.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingReason.aidl deleted file mode 100644 index e109c5b146..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaRedirectingReason.aidl +++ /dev/null @@ -1,44 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CdmaRedirectingReason { - UNKNOWN = 0, - CALL_FORWARDING_BUSY = 1, - CALL_FORWARDING_NO_REPLY = 2, - CALLED_DTE_OUT_OF_ORDER = 9, - CALL_FORWARDING_BY_THE_CALLED_DTE = 10, - CALL_FORWARDING_UNCONDITIONAL = 15, - RESERVED = 16, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAck.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAck.aidl index 0ef4331777..8dfa1da348 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAck.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAck.aidl @@ -34,6 +34,6 @@ package android.hardware.radio; @VintfStability parcelable CdmaSmsAck { - android.hardware.radio.CdmaSmsErrorClass errorClass; + boolean errorClass; int smsCauseCode; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAddress.aidl index a37f1e75e2..a24c701468 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAddress.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsAddress.aidl @@ -34,9 +34,35 @@ package android.hardware.radio; @VintfStability parcelable CdmaSmsAddress { - android.hardware.radio.CdmaSmsDigitMode digitMode; - android.hardware.radio.CdmaSmsNumberMode numberMode; - android.hardware.radio.CdmaSmsNumberType numberType; - android.hardware.radio.CdmaSmsNumberPlan numberPlan; + int digitMode; + boolean isNumberModeDataNetwork; + int numberType; + int numberPlan; byte[] digits; + const int DIGIT_MODE_FOUR_BIT = 0; + const int DIGIT_MODE_EIGHT_BIT = 1; + const int NUMBER_PLAN_UNKNOWN = 0; + const int NUMBER_PLAN_TELEPHONY = 1; + const int NUMBER_PLAN_RESERVED_2 = 2; + const int NUMBER_PLAN_DATA = 3; + const int NUMBER_PLAN_TELEX = 4; + const int NUMBER_PLAN_RESERVED_5 = 5; + const int NUMBER_PLAN_RESERVED_6 = 6; + const int NUMBER_PLAN_RESERVED_7 = 7; + const int NUMBER_PLAN_RESERVED_8 = 8; + const int NUMBER_PLAN_PRIVATE = 9; + const int NUMBER_PLAN_RESERVED_10 = 10; + const int NUMBER_PLAN_RESERVED_11 = 11; + const int NUMBER_PLAN_RESERVED_12 = 12; + const int NUMBER_PLAN_RESERVED_13 = 13; + const int NUMBER_PLAN_RESERVED_14 = 14; + const int NUMBER_PLAN_RESERVED_15 = 15; + const int NUMBER_TYPE_UNKNOWN = 0; + const int NUMBER_TYPE_INTERNATIONAL_OR_DATA_IP = 1; + const int NUMBER_TYPE_NATIONAL_OR_INTERNET_MAIL = 2; + const int NUMBER_TYPE_NETWORK = 3; + const int NUMBER_TYPE_SUBSCRIBER = 4; + const int NUMBER_TYPE_ALPHANUMERIC = 5; + const int NUMBER_TYPE_ABBREVIATED = 6; + const int NUMBER_TYPE_RESERVED_7 = 7; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsDigitMode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsDigitMode.aidl deleted file mode 100644 index 7c7783057e..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsDigitMode.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CdmaSmsDigitMode { - FOUR_BIT = 0, - EIGHT_BIT = 1, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsErrorClass.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsErrorClass.aidl deleted file mode 100644 index 3ad5c1a3f3..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsErrorClass.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CdmaSmsErrorClass { - NO_ERROR = 0, - ERROR = 1, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberMode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberMode.aidl deleted file mode 100644 index 31d49d4373..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberMode.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CdmaSmsNumberMode { - NOT_DATA_NETWORK = 0, - DATA_NETWORK = 1, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberPlan.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberPlan.aidl deleted file mode 100644 index fcbd1cc637..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberPlan.aidl +++ /dev/null @@ -1,53 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CdmaSmsNumberPlan { - UNKNOWN = 0, - TELEPHONY = 1, - RESERVED_2 = 2, - DATA = 3, - TELEX = 4, - RESERVED_5 = 5, - RESERVED_6 = 6, - RESERVED_7 = 7, - RESERVED_8 = 8, - PRIVATE = 9, - RESERVED_10 = 10, - RESERVED_11 = 11, - RESERVED_12 = 12, - RESERVED_13 = 13, - RESERVED_14 = 14, - RESERVED_15 = 15, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberType.aidl deleted file mode 100644 index ca14dbc91f..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsNumberType.aidl +++ /dev/null @@ -1,45 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CdmaSmsNumberType { - UNKNOWN = 0, - INTERNATIONAL_OR_DATA_IP = 1, - NATIONAL_OR_INTERNET_MAIL = 2, - NETWORK = 3, - SUBSCRIBER = 4, - ALPHANUMERIC = 5, - ABBREVIATED = 6, - RESERVED_7 = 7, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddress.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddress.aidl index a0155daae1..0cf3e58c46 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddress.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddress.aidl @@ -34,7 +34,9 @@ package android.hardware.radio; @VintfStability parcelable CdmaSmsSubaddress { - android.hardware.radio.CdmaSmsSubaddressType subaddressType; + int subaddressType; boolean odd; byte[] digits; + const int SUBADDRESS_TYPE_NSAP = 0; + const int SUBADDRESS_TYPE_USER_SPECIFIED = 1; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddressType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddressType.aidl deleted file mode 100644 index a4db5ec6e1..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsSubaddressType.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CdmaSmsSubaddressType { - NSAP = 0, - USER_SPECIFIED = 1, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgs.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgs.aidl index 3202314f34..e2fd8fdc1a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgs.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgs.aidl @@ -34,6 +34,10 @@ package android.hardware.radio; @VintfStability parcelable CdmaSmsWriteArgs { - android.hardware.radio.CdmaSmsWriteArgsStatus status; + int status; android.hardware.radio.CdmaSmsMessage message; + const int STATUS_REC_UNREAD = 0; + const int STATUS_REC_READ = 1; + const int STATUS_STO_UNSENT = 2; + const int STATUS_STO_SENT = 3; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl deleted file mode 100644 index 4bad261e2b..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl +++ /dev/null @@ -1,41 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum CdmaSmsWriteArgsStatus { - REC_UNREAD = 0, - REC_READ = 1, - STO_UNSENT = 2, - STO_SENT = 3, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityLte.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityLte.aidl index 5a8c272080..4f7c90b6a4 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityLte.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityLte.aidl @@ -43,6 +43,6 @@ parcelable CellIdentityLte { android.hardware.radio.CellIdentityOperatorNames operatorNames; int bandwidth; String[] additionalPlmns; - android.hardware.radio.OptionalCsgInfo optionalCsgInfo; + @nullable android.hardware.radio.ClosedSubscriberGroupInfo csgInfo; android.hardware.radio.EutranBands[] bands; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityTdscdma.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityTdscdma.aidl index 35e1f5d0b6..7cc13b54a9 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityTdscdma.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityTdscdma.aidl @@ -42,5 +42,5 @@ parcelable CellIdentityTdscdma { int uarfcn; android.hardware.radio.CellIdentityOperatorNames operatorNames; String[] additionalPlmns; - android.hardware.radio.OptionalCsgInfo optionalCsgInfo; + @nullable android.hardware.radio.ClosedSubscriberGroupInfo csgInfo; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityWcdma.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityWcdma.aidl index 7bcc4d5d1c..c43a8ad601 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityWcdma.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/CellIdentityWcdma.aidl @@ -42,5 +42,5 @@ parcelable CellIdentityWcdma { int uarfcn; android.hardware.radio.CellIdentityOperatorNames operatorNames; String[] additionalPlmns; - android.hardware.radio.OptionalCsgInfo optionalCsgInfo; + @nullable android.hardware.radio.ClosedSubscriberGroupInfo csgInfo; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Clir.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Clir.aidl deleted file mode 100644 index 97ba4ed2df..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Clir.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum Clir { - DEFAULT = 0, - INVOCATION = 1, - SUPPRESSION = 2, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataConnActiveStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataConnActiveStatus.aidl deleted file mode 100644 index 0d11390aef..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataConnActiveStatus.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum DataConnActiveStatus { - INACTIVE = 0, - DORMANT = 1, - ACTIVE = 2, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileId.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileId.aidl deleted file mode 100644 index 2c86c0fc49..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileId.aidl +++ /dev/null @@ -1,44 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum DataProfileId { - DEFAULT = 0, - TETHERED = 1, - IMS = 2, - FOTA = 3, - CBS = 4, - OEM_BASE = 1000, - INVALID = -1, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfo.aidl index d9d0487e5a..b8bba274dd 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfo.aidl @@ -34,14 +34,14 @@ package android.hardware.radio; @VintfStability parcelable DataProfileInfo { - android.hardware.radio.DataProfileId profileId; + int profileId; String apn; android.hardware.radio.PdpProtocolType protocol; android.hardware.radio.PdpProtocolType roamingProtocol; android.hardware.radio.ApnAuthType authType; String user; String password; - android.hardware.radio.DataProfileInfoType type; + int type; int maxConnsTime; int maxConns; int waitTime; @@ -52,4 +52,14 @@ parcelable DataProfileInfo { int mtuV6; boolean preferred; boolean persistent; + const int ID_DEFAULT = 0; + const int ID_TETHERED = 1; + const int ID_IMS = 2; + const int ID_FOTA = 3; + const int ID_CBS = 4; + const int ID_OEM_BASE = 1000; + const int ID_INVALID = -1; + const int TYPE_COMMON = 0; + const int TYPE_THREE_GPP = 1; + const int TYPE_THREE_GPP2 = 2; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfoType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfoType.aidl deleted file mode 100644 index a559de0829..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataProfileInfoType.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum DataProfileInfoType { - COMMON = 0, - THREE_GPP = 1, - THREE_GPP2 = 2, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResult.aidl index 303035f620..8eac451b50 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResult.aidl @@ -39,6 +39,6 @@ parcelable DataRegStateResult { int reasonDataDenied; int maxDataCalls; android.hardware.radio.CellIdentity cellIdentity; - android.hardware.radio.DataRegStateResultVopsInfo vopsInfo; + @nullable android.hardware.radio.LteVopsInfo lteVopsInfo; android.hardware.radio.NrIndicators nrIndicators; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResultVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResultVopsInfo.aidl deleted file mode 100644 index 2ce646e386..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/DataRegStateResultVopsInfo.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@VintfStability -union DataRegStateResultVopsInfo { - boolean noinit; - android.hardware.radio.LteVopsInfo lteVopsInfo; -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Dial.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Dial.aidl index f8edf48d44..cc9fc783ce 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Dial.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/Dial.aidl @@ -35,6 +35,9 @@ package android.hardware.radio; @VintfStability parcelable Dial { String address; - android.hardware.radio.Clir clir; + int clir; android.hardware.radio.UusInfo[] uusInfo; + const int CLIR_DEFAULT = 0; + const int CLIR_INVOCATION = 1; + const int CLIR_SUPPRESSION = 2; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmcIndicator.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmcIndicator.aidl deleted file mode 100644 index 846084b401..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmcIndicator.aidl +++ /dev/null @@ -1,41 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="byte") @VintfStability -enum EmcIndicator { - EMC_NOT_SUPPORTED = 0, - EMC_NR_CONNECTED_TO_5GCN = 1, - EMC_EUTRA_CONNECTED_TO_5GCN = 2, - EMC_BOTH_NR_EUTRA_CONNECTED_TO_5GCN = 3, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumber.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumber.aidl index 7aa4cd8f9e..1de62467f7 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumber.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumber.aidl @@ -39,5 +39,9 @@ parcelable EmergencyNumber { String mnc; android.hardware.radio.EmergencyServiceCategory categories; String[] urns; - android.hardware.radio.EmergencyNumberSource sources; + int sources; + const int SOURCE_NETWORK_SIGNALING = 1; + const int SOURCE_SIM = 2; + const int SOURCE_MODEM_CONFIG = 4; + const int SOURCE_DEFAULT = 8; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumberSource.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumberSource.aidl deleted file mode 100644 index 1424bfa6ea..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmergencyNumberSource.aidl +++ /dev/null @@ -1,41 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum EmergencyNumberSource { - NETWORK_SIGNALING = 1, - SIM = 2, - MODEM_CONFIG = 4, - DEFAULT = 8, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmfIndicator.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmfIndicator.aidl deleted file mode 100644 index 21100f2a12..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EmfIndicator.aidl +++ /dev/null @@ -1,41 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="byte") @VintfStability -enum EmfIndicator { - EMF_NOT_SUPPORTED = 0, - EMF_NR_CONNECTED_TO_5GCN = 1, - EMF_EUTRA_CONNECTED_TO_5GCN = 2, - EMF_BOTH_NR_EUTRA_CONNECTED_TO_5GCN = 3, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EutranRegistrationInfo.aidl similarity index 95% rename from radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl rename to radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EutranRegistrationInfo.aidl index ed422eb967..0ab883334f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/EutranRegistrationInfo.aidl @@ -33,7 +33,7 @@ package android.hardware.radio; @VintfStability -parcelable RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo { +parcelable EutranRegistrationInfo { android.hardware.radio.LteVopsInfo lteVopsInfo; android.hardware.radio.NrIndicators nrIndicators; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/FrequencyRange.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/FrequencyRange.aidl deleted file mode 100644 index 243b54e4d1..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/FrequencyRange.aidl +++ /dev/null @@ -1,41 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum FrequencyRange { - LOW = 1, - MID = 2, - HIGH = 3, - MMWAVE = 4, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HandoverFailureMode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HandoverFailureMode.aidl deleted file mode 100644 index 661b7b771a..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HandoverFailureMode.aidl +++ /dev/null @@ -1,41 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="byte") @VintfStability -enum HandoverFailureMode { - LEGACY = 0, - DO_FALLBACK = 1, - NO_FALLBACK_RETRY_HANDOVER = 2, - NO_FALLBACK_RETRY_SETUP_NORMAL = 3, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfig.aidl index 4a5c1076bc..60ab5112fa 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfig.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfig.aidl @@ -34,9 +34,14 @@ package android.hardware.radio; @VintfStability parcelable HardwareConfig { - android.hardware.radio.HardwareConfigType type; + int type; String uuid; - android.hardware.radio.HardwareConfigState state; + int state; android.hardware.radio.HardwareConfigModem[] modem; android.hardware.radio.HardwareConfigSim[] sim; + const int STATE_ENABLED = 0; + const int STATE_STANDBY = 1; + const int STATE_DISABLED = 2; + const int TYPE_MODEM = 0; + const int TYPE_SIM = 1; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigState.aidl deleted file mode 100644 index 672fe47462..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigState.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum HardwareConfigState { - ENABLED = 0, - STANDBY = 1, - DISABLED = 2, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigType.aidl deleted file mode 100644 index a152282dc9..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/HardwareConfigType.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum HardwareConfigType { - MODEM = 0, - SIM = 1, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadio.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadio.aidl index 5a7b251271..0bcbd55435 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadio.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadio.aidl @@ -113,7 +113,6 @@ interface IRadio { oneway void nvResetConfig(in int serial, in android.hardware.radio.ResetNvType resetType); oneway void nvWriteCdmaPrl(in int serial, in byte[] prl); oneway void nvWriteItem(in int serial, in android.hardware.radio.NvWriteItem item); - oneway void pullLceData(in int serial); oneway void rejectCall(in int serial); oneway void releasePduSessionId(in int serial, in int id); oneway void reportSmsMemoryStatus(in int serial, in boolean available); @@ -131,13 +130,12 @@ interface IRadio { oneway void sendEnvelope(in int serial, in String command); oneway void sendEnvelopeWithStatus(in int serial, in String contents); oneway void sendImsSms(in int serial, in android.hardware.radio.ImsSmsMessage message); - oneway void sendSMSExpectMore(in int serial, in android.hardware.radio.GsmSmsMessage message); oneway void sendSms(in int serial, in android.hardware.radio.GsmSmsMessage message); oneway void sendSmsExpectMore(in int serial, in android.hardware.radio.GsmSmsMessage message); oneway void sendTerminalResponseToSim(in int serial, in String commandResponse); oneway void sendUssd(in int serial, in String ussd); oneway void separateConnection(in int serial, in int gsmIndex); - oneway void setAllowedCarriers(in int serial, in android.hardware.radio.CarrierRestrictionsWithPriority carriers, in android.hardware.radio.SimLockMultiSimPolicy multiSimPolicy); + oneway void setAllowedCarriers(in int serial, in android.hardware.radio.CarrierRestrictions carriers, in android.hardware.radio.SimLockMultiSimPolicy multiSimPolicy); oneway void setAllowedNetworkTypesBitmap(in int serial, in android.hardware.radio.RadioAccessFamily networkTypeBitmap); oneway void setBandMode(in int serial, in android.hardware.radio.RadioBandMode mode); oneway void setBarringPassword(in int serial, in String facility, in String oldPassword, in String newPassword); @@ -169,7 +167,7 @@ interface IRadio { oneway void setPreferredVoicePrivacy(in int serial, in boolean enable); oneway void setRadioCapability(in int serial, in android.hardware.radio.RadioCapability rc); oneway void setRadioPower(in int serial, in boolean powerOn, in boolean forEmergencyCall, in boolean preferredForEmergencyCall); - void setResponseFunctions(in android.hardware.radio.IRadioResponse radioResponse, in android.hardware.radio.IRadioIndication radioIndication); + oneway void setResponseFunctions(in android.hardware.radio.IRadioResponse radioResponse, in android.hardware.radio.IRadioIndication radioIndication); oneway void setSignalStrengthReportingCriteria(in int serial, in android.hardware.radio.SignalThresholdInfo signalThresholdInfo, in android.hardware.radio.AccessNetwork accessNetwork); oneway void setSimCardPower(in int serial, in android.hardware.radio.CardPowerState powerUp); oneway void setSmscAddress(in int serial, in String smsc); @@ -177,15 +175,13 @@ interface IRadio { oneway void setSystemSelectionChannels(in int serial, in boolean specifyChannels, in android.hardware.radio.RadioAccessSpecifier[] specifiers); oneway void setTTYMode(in int serial, in android.hardware.radio.TtyMode mode); oneway void setUiccSubscription(in int serial, in android.hardware.radio.SelectUiccSub uiccSub); - oneway void setupDataCall(in int serial, in android.hardware.radio.AccessNetwork accessNetwork, in android.hardware.radio.DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in android.hardware.radio.DataRequestReason reason, in android.hardware.radio.LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in android.hardware.radio.OptionalSliceInfo sliceInfo, in android.hardware.radio.OptionalTrafficDescriptor trafficDescriptor, in boolean matchAllRuleAllowed); + oneway void setupDataCall(in int serial, in android.hardware.radio.AccessNetwork accessNetwork, in android.hardware.radio.DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in android.hardware.radio.DataRequestReason reason, in android.hardware.radio.LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in @nullable android.hardware.radio.SliceInfo sliceInfo, in @nullable android.hardware.radio.TrafficDescriptor trafficDescriptor, in boolean matchAllRuleAllowed); oneway void startDtmf(in int serial, in String s); oneway void startHandover(in int serial, in int callId); oneway void startKeepalive(in int serial, in android.hardware.radio.KeepaliveRequest keepalive); - oneway void startLceService(in int serial, in int reportInterval, in boolean pullMode); oneway void startNetworkScan(in int serial, in android.hardware.radio.NetworkScanRequest request); oneway void stopDtmf(in int serial); oneway void stopKeepalive(in int serial, in int sessionHandle); - oneway void stopLceService(in int serial); oneway void stopNetworkScan(in int serial); oneway void supplyIccPin2ForApp(in int serial, in String pin2, in String aid); oneway void supplyIccPinForApp(in int serial, in String pin, in String aid); diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadioResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadioResponse.aidl index 9137b973ba..0d18cf8aaa 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadioResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IRadioResponse.aidl @@ -55,7 +55,7 @@ interface IRadioResponse { oneway void enableUiccApplicationsResponse(in android.hardware.radio.RadioResponseInfo info); oneway void exitEmergencyCallbackModeResponse(in android.hardware.radio.RadioResponseInfo info); oneway void explicitCallTransferResponse(in android.hardware.radio.RadioResponseInfo info); - oneway void getAllowedCarriersResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.CarrierRestrictionsWithPriority carriers, in android.hardware.radio.SimLockMultiSimPolicy multiSimPolicy); + oneway void getAllowedCarriersResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.CarrierRestrictions carriers, in android.hardware.radio.SimLockMultiSimPolicy multiSimPolicy); oneway void getAllowedNetworkTypesBitmapResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.RadioAccessFamily networkTypeBitmap); oneway void getAvailableBandModesResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.RadioBandMode[] bandModes); oneway void getAvailableNetworksResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.OperatorInfo[] networkInfos); diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ISap.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ISap.aidl index fa0426442a..2a111c681c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ISap.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ISap.aidl @@ -39,7 +39,7 @@ interface ISap { oneway void disconnectReq(in int token); oneway void powerReq(in int token, in boolean state); oneway void resetSimReq(in int token); - void setCallback(in android.hardware.radio.ISapCallback sapCallback); + oneway void setCallback(in android.hardware.radio.ISapCallback sapCallback); oneway void setTransferProtocolReq(in int token, in android.hardware.radio.SapTransferProtocol transferProtocol); oneway void transferAtrReq(in int token); oneway void transferCardReaderStatusReq(in int token); diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ImsiEncryptionInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ImsiEncryptionInfo.aidl index c89c3a0f7a..fb85eca34a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ImsiEncryptionInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ImsiEncryptionInfo.aidl @@ -39,5 +39,7 @@ parcelable ImsiEncryptionInfo { byte[] carrierKey; String keyIdentifier; long expirationTime; - android.hardware.radio.PublicKeyType keyType; + byte keyType; + const byte PUBLIC_KEY_TYPE_EPDG = 1; + const byte PUBLIC_KEY_TYPE_WLAN = 2; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl deleted file mode 100644 index ad3441f445..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum IncrementalResultsPeriodicityRange { - MIN = 1, - MAX = 10, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveRequest.aidl index 1f23a6927f..1aeeb55e82 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveRequest.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveRequest.aidl @@ -34,11 +34,13 @@ package android.hardware.radio; @VintfStability parcelable KeepaliveRequest { - android.hardware.radio.KeepaliveType type; + int type; byte[] sourceAddress; int sourcePort; byte[] destinationAddress; int destinationPort; int maxKeepaliveIntervalMillis; int cid; + const int TYPE_NATT_IPV4 = 0; + const int TYPE_NATT_IPV6 = 1; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatus.aidl index 8729b69e39..3c7a73609f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatus.aidl @@ -35,5 +35,8 @@ package android.hardware.radio; @VintfStability parcelable KeepaliveStatus { int sessionHandle; - android.hardware.radio.KeepaliveStatusCode code; + int code; + const int CODE_ACTIVE = 0; + const int CODE_INACTIVE = 1; + const int CODE_PENDING = 2; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatusCode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatusCode.aidl deleted file mode 100644 index 8ad5dc5dba..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveStatusCode.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum KeepaliveStatusCode { - ACTIVE = 0, - INACTIVE = 1, - PENDING = 2, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveType.aidl deleted file mode 100644 index f0dd5216fb..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/KeepaliveType.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum KeepaliveType { - NATT_IPV4 = 0, - NATT_IPV6 = 1, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatus.aidl deleted file mode 100644 index 2542cc7de9..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatus.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum LceStatus { - NOT_SUPPORTED = 0, - STOPPED = 1, - ACTIVE = 2, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatusInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatusInfo.aidl index 29f5ab60f2..74166c384b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatusInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LceStatusInfo.aidl @@ -34,6 +34,9 @@ package android.hardware.radio; @VintfStability parcelable LceStatusInfo { - android.hardware.radio.LceStatus lceStatus; + int lceStatus; byte actualIntervalMs; + const int LCE_STATUS_NOT_SUPPORTED = 0; + const int LCE_STATUS_STOPPED = 1; + const int LCE_STATUS_ACTIVE = 2; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LinkAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LinkAddress.aidl index b64daf9de1..bdeb9b8a3a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LinkAddress.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/LinkAddress.aidl @@ -35,7 +35,9 @@ package android.hardware.radio; @VintfStability parcelable LinkAddress { String address; - android.hardware.radio.AddressProperty properties; + int addressProperties; long deprecationTime; long expirationTime; + const int ADDRESS_PROPERTY_NONE = 0; + const int ADDRESS_PROPERTY_DEPRECATED = 32; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaxSearchTimeRange.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaxSearchTimeRange.aidl deleted file mode 100644 index 88cdf5fe18..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaxSearchTimeRange.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum MaxSearchTimeRange { - MIN = 60, - MAX = 3600, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaybePort.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaybePort.aidl deleted file mode 100644 index f556c7f8a3..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MaybePort.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@VintfStability -union MaybePort { - boolean noinit; - android.hardware.radio.PortRange range; -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MvnoType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MvnoType.aidl deleted file mode 100644 index 8be23b6607..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/MvnoType.aidl +++ /dev/null @@ -1,41 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum MvnoType { - NONE = 0, - IMSI = 1, - GID = 2, - SPN = 3, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanRequest.aidl index 4e6f6139b1..992ac48321 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanRequest.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanRequest.aidl @@ -34,11 +34,19 @@ package android.hardware.radio; @VintfStability parcelable NetworkScanRequest { - android.hardware.radio.ScanType type; + int type; int interval; android.hardware.radio.RadioAccessSpecifier[] specifiers; int maxSearchTime; boolean incrementalResults; int incrementalResultsPeriodicity; String[] mccMncs; + const int INCREMENTAL_RESULTS_PREIODICITY_RANGE_MIN = 1; + const int INCREMENTAL_RESULTS_PREIODICITY_RANGE_MAX = 10; + const int MAX_SEARCH_TIME_RANGE_MIN = 60; + const int MAX_SEARCH_TIME_RANGE_MAX = 3600; + const int SCAN_INTERVAL_RANGE_MIN = 5; + const int SCAN_INTERVAL_RANGE_MAX = 300; + const int SCAN_TYPE_ONE_SHOT = 0; + const int SCAN_TYPE_PERIODIC = 1; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanResult.aidl index 86543e3e1b..670c17317d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NetworkScanResult.aidl @@ -34,7 +34,9 @@ package android.hardware.radio; @VintfStability parcelable NetworkScanResult { - android.hardware.radio.ScanStatus status; + int status; android.hardware.radio.RadioError error; android.hardware.radio.CellInfo[] networkInfos; + const int SCAN_STATUS_PARTIAL = 1; + const int SCAN_STATUS_COMPLETE = 2; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrQos.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrQos.aidl index 6cb8f33704..a40dda8969 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrQos.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrQos.aidl @@ -39,4 +39,6 @@ parcelable NrQos { android.hardware.radio.QosBandwidth uplink; byte qfi; char averagingWindowMs; + const byte FLOW_ID_RANGE_MIN = 1; + const byte FLOW_ID_RANGE_MAX = 63; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrVopsInfo.aidl index b737aaf414..52abce6791 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrVopsInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/NrVopsInfo.aidl @@ -34,7 +34,18 @@ package android.hardware.radio; @VintfStability parcelable NrVopsInfo { - android.hardware.radio.VopsIndicator vopsSupported; - android.hardware.radio.EmcIndicator emcSupported; - android.hardware.radio.EmfIndicator emfSupported; + byte vopsSupported; + byte emcSupported; + byte emfSupported; + const byte EMC_INDICATOR_NOT_SUPPORTED = 0; + const byte EMC_INDICATOR_NR_CONNECTED_TO_5GCN = 1; + const byte EMC_INDICATOR_EUTRA_CONNECTED_TO_5GCN = 2; + const byte EMC_INDICATOR_BOTH_NR_EUTRA_CONNECTED_TO_5GCN = 3; + const byte EMF_INDICATOR_NOT_SUPPORTED = 0; + const byte EMF_INDICATOR_NR_CONNECTED_TO_5GCN = 1; + const byte EMF_INDICATOR_EUTRA_CONNECTED_TO_5GCN = 2; + const byte EMF_INDICATOR_BOTH_NR_EUTRA_CONNECTED_TO_5GCN = 3; + const byte VOPS_INDICATOR_VOPS_NOT_SUPPORTED = 0; + const byte VOPS_INDICATOR_VOPS_OVER_3GPP = 1; + const byte VOPS_INDICATOR_VOPS_OVER_NON_3GPP = 2; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorInfo.aidl index 2f29c022f7..bb90f1210d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorInfo.aidl @@ -37,5 +37,9 @@ parcelable OperatorInfo { String alphaLong; String alphaShort; String operatorNumeric; - android.hardware.radio.OperatorStatus status; + int status; + const int STATUS_UNKNOWN = 0; + const int STATUS_AVAILABLE = 1; + const int STATUS_CURRENT = 2; + const int STATUS_FORBIDDEN = 3; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorStatus.aidl deleted file mode 100644 index 4ef10caada..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OperatorStatus.aidl +++ /dev/null @@ -1,41 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum OperatorStatus { - UNKNOWN = 0, - AVAILABLE = 1, - CURRENT = 2, - FORBIDDEN = 3, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalCsgInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalCsgInfo.aidl deleted file mode 100644 index 6866dcaf94..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalCsgInfo.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@VintfStability -union OptionalCsgInfo { - boolean noinit; - android.hardware.radio.ClosedSubscriberGroupInfo csgInfo; -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalDnn.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalDnn.aidl deleted file mode 100644 index 88582dea50..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalDnn.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@VintfStability -union OptionalDnn { - boolean noinit; - String value; -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalOsAppId.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalOsAppId.aidl deleted file mode 100644 index 40bfa41026..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalOsAppId.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@VintfStability -union OptionalOsAppId { - boolean noinit; - android.hardware.radio.OsAppId value; -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalPdpProtocolType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalPdpProtocolType.aidl deleted file mode 100644 index 5b4964f0c8..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalPdpProtocolType.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@VintfStability -union OptionalPdpProtocolType { - boolean noinit; - android.hardware.radio.PdpProtocolType value; -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSliceInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSliceInfo.aidl deleted file mode 100644 index d640aac680..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSliceInfo.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@VintfStability -union OptionalSliceInfo { - boolean noinit; - android.hardware.radio.SliceInfo value; -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSscMode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSscMode.aidl deleted file mode 100644 index 047261524d..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalSscMode.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@VintfStability -union OptionalSscMode { - boolean noinit; - android.hardware.radio.SscMode value; -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalTrafficDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalTrafficDescriptor.aidl deleted file mode 100644 index 6b575255f8..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/OptionalTrafficDescriptor.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@VintfStability -union OptionalTrafficDescriptor { - boolean noinit; - android.hardware.radio.TrafficDescriptor value; -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/P2Constant.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/P2Constant.aidl deleted file mode 100644 index eb8b442c98..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/P2Constant.aidl +++ /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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum P2Constant { - NO_P2 = -1, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PortRange.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PortRange.aidl index 9e4d2720f8..8e02ff3d72 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PortRange.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PortRange.aidl @@ -36,4 +36,6 @@ package android.hardware.radio; parcelable PortRange { int start; int end; + const int PORT_RANGE_MIN = 20; + const int PORT_RANGE_MAX = 65535; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PrlIndicator.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PrlIndicator.aidl deleted file mode 100644 index b596d305b4..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PrlIndicator.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum PrlIndicator { - NOT_REGISTERED = -1, - NOT_IN_PRL = 0, - IN_PRL = 1, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PublicKeyType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PublicKeyType.aidl deleted file mode 100644 index 68d96e86ed..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/PublicKeyType.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="byte") @VintfStability -enum PublicKeyType { - EPDG = 1, - WLAN = 2, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilter.aidl index 3376c6626b..a568506e90 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilter.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilter.aidl @@ -36,12 +36,20 @@ package android.hardware.radio; parcelable QosFilter { String[] localAddresses; String[] remoteAddresses; - android.hardware.radio.MaybePort localPort; - android.hardware.radio.MaybePort remotePort; - android.hardware.radio.QosProtocol protocol; + @nullable android.hardware.radio.PortRange localPort; + @nullable android.hardware.radio.PortRange remotePort; + byte protocol; android.hardware.radio.QosFilterTypeOfService tos; android.hardware.radio.QosFilterIpv6FlowLabel flowLabel; android.hardware.radio.QosFilterIpsecSpi spi; - android.hardware.radio.QosFilterDirection direction; + byte direction; int precedence; + const byte DIRECTION_DOWNLINK = 0; + const byte DIRECTION_UPLINK = 1; + const byte DIRECTION_BIDIRECTIONAL = 2; + const byte PROTOCOL_UNSPECIFIED = -1; + const byte PROTOCOL_TCP = 6; + const byte PROTOCOL_UDP = 17; + const byte PROTOCOL_ESP = 50; + const byte PROTOCOL_AH = 51; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterDirection.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterDirection.aidl deleted file mode 100644 index efb9c504cf..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFilterDirection.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="byte") @VintfStability -enum QosFilterDirection { - DOWNLINK = 0, - UPLINK = 1, - BIDIRECTIONAL = 2, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFlowIdRange.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFlowIdRange.aidl deleted file mode 100644 index 95468e0074..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosFlowIdRange.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="byte") @VintfStability -enum QosFlowIdRange { - MIN = 1, - MAX = 63, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosPortRange.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosPortRange.aidl deleted file mode 100644 index 7171c7ebd5..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosPortRange.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum QosPortRange { - MIN = 20, - MAX = 65535, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosProtocol.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosProtocol.aidl deleted file mode 100644 index cb68f04418..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/QosProtocol.aidl +++ /dev/null @@ -1,42 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="byte") @VintfStability -enum QosProtocol { - UNSPECIFIED = -1, - TCP = 6, - UDP = 17, - ESP = 50, - AH = 51, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapability.aidl index 99c1a41363..ca1e389a11 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapability.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapability.aidl @@ -35,8 +35,16 @@ package android.hardware.radio; @VintfStability parcelable RadioCapability { int session; - android.hardware.radio.RadioCapabilityPhase phase; + int phase; android.hardware.radio.RadioAccessFamily raf; String logicalModemUuid; - android.hardware.radio.RadioCapabilityStatus status; + int status; + const int PHASE_CONFIGURED = 0; + const int PHASE_START = 1; + const int PHASE_APPLY = 2; + const int PHASE_UNSOL_RSP = 3; + const int PHASE_FINISH = 4; + const int STATUS_NONE = 0; + const int STATUS_SUCCESS = 1; + const int STATUS_FAIL = 2; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityPhase.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityPhase.aidl deleted file mode 100644 index 7a4b9adac2..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityPhase.aidl +++ /dev/null @@ -1,42 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum RadioCapabilityPhase { - CONFIGURED = 0, - START = 1, - APPLY = 2, - UNSOL_RSP = 3, - FINISH = 4, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityStatus.aidl deleted file mode 100644 index 72e0bd53f2..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCapabilityStatus.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum RadioCapabilityStatus { - NONE = 0, - SUCCESS = 1, - FAIL = 2, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCdmaSmsConst.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCdmaSmsConst.aidl deleted file mode 100644 index 7e5c471841..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioCdmaSmsConst.aidl +++ /dev/null @@ -1,52 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum RadioCdmaSmsConst { - ADDRESS_MAX = 36, - SUBADDRESS_MAX = 36, - BEARER_DATA_MAX = 255, - UDH_MAX_SND_SIZE = 128, - UDH_EO_DATA_SEGMENT_MAX = 131, - MAX_UD_HEADERS = 7, - USER_DATA_MAX = 229, - UDH_LARGE_PIC_SIZE = 128, - UDH_SMALL_PIC_SIZE = 32, - UDH_VAR_PIC_SIZE = 134, - UDH_ANIM_NUM_BITMAPS = 4, - UDH_LARGE_BITMAP_SIZE = 32, - UDH_SMALL_BITMAP_SIZE = 8, - UDH_OTHER_SIZE = 226, - IP_ADDRESS_SIZE = 4, -} 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 d37f13bf0f..d111a0d086 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 @@ -48,4 +48,5 @@ enum RadioConst { NUM_SERVICE_CLASSES = 7, NUM_TX_POWER_LEVELS = 5, RADIO_ACCESS_SPECIFIER_MAX_SIZE = 8, + P2_CONSTANT_NO_P2 = -1, } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioFrequencyInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioFrequencyInfo.aidl index 6c0704585e..cd0f6c2e13 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioFrequencyInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioFrequencyInfo.aidl @@ -35,6 +35,10 @@ package android.hardware.radio; @VintfStability union RadioFrequencyInfo { boolean noinit; - android.hardware.radio.FrequencyRange range; + int range; int channelNumber; + const int FREQUENCY_RANGE_LOW = 1; + const int FREQUENCY_RANGE_MID = 2; + const int FREQUENCY_RANGE_HIGH = 3; + const int FREQUENCY_RANGE_MMWAVE = 4; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResult.aidl index 78c5c2d30f..e5b5aa5b71 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResult.aidl @@ -39,5 +39,5 @@ parcelable RegStateResult { android.hardware.radio.RegistrationFailCause reasonForDenial; android.hardware.radio.CellIdentity cellIdentity; String registeredPlmn; - android.hardware.radio.RegStateResultAccessTechnologySpecificInfo accessTechnologySpecificInfo; + android.hardware.radio.AccessTechnologySpecificInfo accessTechnologySpecificInfo; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.aidl deleted file mode 100644 index 6ce6398498..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.aidl +++ /dev/null @@ -1,42 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@VintfStability -union RegStateResultAccessTechnologySpecificInfo { - boolean noinit; - android.hardware.radio.RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo cdmaInfo; - android.hardware.radio.RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo eutranInfo; - android.hardware.radio.NrVopsInfo ngranNrVopsInfo; - boolean geranDtmSupported; -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RestrictedState.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RestrictedState.aidl deleted file mode 100644 index dc83ba57af..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RestrictedState.aidl +++ /dev/null @@ -1,42 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum RestrictedState { - NONE = 0, - CS_EMERGENCY = 1, - CS_NORMAL = 2, - CS_ALL = 4, - PS_ALL = 16, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RouteSelectionDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RouteSelectionDescriptor.aidl index 689ee2ff97..233b8b5c0a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RouteSelectionDescriptor.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RouteSelectionDescriptor.aidl @@ -35,8 +35,12 @@ package android.hardware.radio; @VintfStability parcelable RouteSelectionDescriptor { byte precedence; - android.hardware.radio.OptionalPdpProtocolType sessionType; - android.hardware.radio.OptionalSscMode sscMode; + android.hardware.radio.PdpProtocolType sessionType; + byte sscMode; android.hardware.radio.SliceInfo[] sliceInfo; String[] dnn; + const byte SSC_MODE_UNKNOWN = -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/current/android/hardware/radio/ScanIntervalRange.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanIntervalRange.aidl deleted file mode 100644 index 3e6539b8f9..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanIntervalRange.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum ScanIntervalRange { - MIN = 5, - MAX = 300, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanStatus.aidl deleted file mode 100644 index f8810b6690..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanStatus.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum ScanStatus { - PARTIAL = 1, - COMPLETE = 2, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanType.aidl deleted file mode 100644 index 7d51ce25f1..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/ScanType.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum ScanType { - ONE_SHOT = 0, - PERIODIC = 1, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SelectUiccSub.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SelectUiccSub.aidl index a285f64891..b7acc66a85 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SelectUiccSub.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SelectUiccSub.aidl @@ -36,6 +36,11 @@ package android.hardware.radio; parcelable SelectUiccSub { int slot; int appIndex; - android.hardware.radio.SubscriptionType subType; - android.hardware.radio.UiccSubActStatus actStatus; + int subType; + int actStatus; + const int SUBSCRIPTION_TYPE_1 = 0; + const int SUBSCRIPTION_TYPE_2 = 1; + const int SUBSCRIPTION_TYPE_3 = 2; + const int ACT_STATUS_DEACTIVATE = 0; + const int ACT_STATUS_ACTIVATE = 1; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SetupDataCallResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SetupDataCallResult.aidl index ae4493d50e..edf7a8a012 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SetupDataCallResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SetupDataCallResult.aidl @@ -37,7 +37,7 @@ parcelable SetupDataCallResult { android.hardware.radio.DataCallFailCause cause; long suggestedRetryTime; int cid; - android.hardware.radio.DataConnActiveStatus active; + int active; android.hardware.radio.PdpProtocolType type; String ifname; android.hardware.radio.LinkAddress[] addresses; @@ -48,8 +48,15 @@ parcelable SetupDataCallResult { int mtuV6; android.hardware.radio.Qos defaultQos; android.hardware.radio.QosSession[] qosSessions; - android.hardware.radio.HandoverFailureMode handoverFailureMode; + byte handoverFailureMode; int pduSessionId; - android.hardware.radio.OptionalSliceInfo sliceInfo; + @nullable android.hardware.radio.SliceInfo sliceInfo; android.hardware.radio.TrafficDescriptor[] trafficDescriptors; + const int DATA_CONNECTION_STATUS_INACTIVE = 0; + const int DATA_CONNECTION_STATUS_DORMANT = 1; + const int DATA_CONNECTION_STATUS_ACTIVE = 2; + const byte HANDOVER_FAILURE_MODE_LEGACY = 0; + const byte HANDOVER_FAILURE_MODE_DO_FALLBACK = 1; + const byte HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_HANDOVER = 2; + const byte HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 3; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalMeasurementType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalMeasurementType.aidl deleted file mode 100644 index 7f864e5b32..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalMeasurementType.aidl +++ /dev/null @@ -1,45 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum SignalMeasurementType { - RSSI = 1, - RSCP = 2, - RSRP = 3, - RSRQ = 4, - RSSNR = 5, - SSRSRP = 6, - SSRSRQ = 7, - SSSINR = 8, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalThresholdInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalThresholdInfo.aidl index f519d69b5b..381984eff9 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalThresholdInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SignalThresholdInfo.aidl @@ -34,9 +34,17 @@ package android.hardware.radio; @VintfStability parcelable SignalThresholdInfo { - android.hardware.radio.SignalMeasurementType signalMeasurement; + int signalMeasurement; int hysteresisMs; int hysteresisDb; int[] thresholds; boolean isEnabled; + const int SIGNAL_MEASUREMENT_TYPE_RSSI = 1; + const int SIGNAL_MEASUREMENT_TYPE_RSCP = 2; + const int SIGNAL_MEASUREMENT_TYPE_RSRP = 3; + const int SIGNAL_MEASUREMENT_TYPE_RSRQ = 4; + const int SIGNAL_MEASUREMENT_TYPE_RSSNR = 5; + const int SIGNAL_MEASUREMENT_TYPE_SSRSRP = 6; + const int SIGNAL_MEASUREMENT_TYPE_SSRSRQ = 7; + const int SIGNAL_MEASUREMENT_TYPE_SSSINR = 8; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshResult.aidl index 720c8a20fc..ce870c54a5 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshResult.aidl @@ -34,7 +34,10 @@ package android.hardware.radio; @VintfStability parcelable SimRefreshResult { - android.hardware.radio.SimRefreshType type; + int type; int efId; String aid; + const int TYPE_SIM_FILE_UPDATE = 0; + const int TYPE_SIM_INIT = 1; + const int TYPE_SIM_RESET = 2; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshType.aidl deleted file mode 100644 index b114ec7c92..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SimRefreshType.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum SimRefreshType { - SIM_FILE_UPDATE = 0, - SIM_INIT = 1, - SIM_RESET = 2, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceInfo.aidl index 8b363801ce..f49ff3b82b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceInfo.aidl @@ -34,9 +34,19 @@ package android.hardware.radio; @VintfStability parcelable SliceInfo { - android.hardware.radio.SliceServiceType sst; + byte sliceServiceType; int sliceDifferentiator; - android.hardware.radio.SliceServiceType mappedHplmnSst; + byte mappedHplmnSst; int mappedHplmnSD; - android.hardware.radio.SliceStatus status; + byte status; + const byte SERVICE_TYPE_NONE = 0; + const byte SERVICE_TYPE_EMBB = 1; + const byte SERVICE_TYPE_URLLC = 2; + const byte SERVICE_TYPE_MIOT = 3; + const byte STATUS_UNKNOWN = 0; + const byte STATUS_CONFIGURED = 1; + const byte STATUS_ALLOWED = 2; + const byte STATUS_REJECTED_NOT_AVAILABLE_IN_PLMN = 3; + const byte STATUS_REJECTED_NOT_AVAILABLE_IN_REG_AREA = 4; + const byte STATUS_DEFAULT_CONFIGURED = 5; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceServiceType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceServiceType.aidl deleted file mode 100644 index d0a9f58d80..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceServiceType.aidl +++ /dev/null @@ -1,41 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="byte") @VintfStability -enum SliceServiceType { - NONE = 0, - EMBB = 1, - URLLC = 2, - MIOT = 3, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceStatus.aidl deleted file mode 100644 index 3fa1ee6b15..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SliceStatus.aidl +++ /dev/null @@ -1,43 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="byte") @VintfStability -enum SliceStatus { - UNKNOWN = 0, - CONFIGURED = 1, - ALLOWED = 2, - REJECTED_NOT_AVAILABLE_IN_PLMN = 3, - REJECTED_NOT_AVAILABLE_IN_REG_AREA = 4, - DEFAULT_CONFIGURED = 5, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgs.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgs.aidl index 6b0d9bf3bd..a42339dc45 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgs.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgs.aidl @@ -34,7 +34,11 @@ package android.hardware.radio; @VintfStability parcelable SmsWriteArgs { - android.hardware.radio.SmsWriteArgsStatus status; + int status; String pdu; String smsc; + const int STATUS_REC_UNREAD = 0; + const int STATUS_REC_READ = 1; + const int STATUS_STO_UNSENT = 2; + const int STATUS_STO_SENT = 3; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgsStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgsStatus.aidl deleted file mode 100644 index 31a3f42e77..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SmsWriteArgsStatus.aidl +++ /dev/null @@ -1,41 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum SmsWriteArgsStatus { - REC_UNREAD = 0, - REC_READ = 1, - STO_UNSENT = 2, - STO_SENT = 3, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsRequestType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsRequestType.aidl deleted file mode 100644 index 75ad9bb2c5..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsRequestType.aidl +++ /dev/null @@ -1,42 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum SsRequestType { - ACTIVATION = 0, - DEACTIVATION = 1, - INTERROGATION = 2, - REGISTRATION = 3, - ERASURE = 4, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsServiceType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsServiceType.aidl deleted file mode 100644 index c3506b10c6..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsServiceType.aidl +++ /dev/null @@ -1,56 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum SsServiceType { - CFU = 0, - CF_BUSY = 1, - CF_NO_REPLY = 2, - CF_NOT_REACHABLE = 3, - CF_ALL = 4, - CF_ALL_CONDITIONAL = 5, - CLIP = 6, - CLIR = 7, - COLP = 8, - COLR = 9, - WAIT = 10, - BAOC = 11, - BAOIC = 12, - BAOIC_EXC_HOME = 13, - BAIC = 14, - BAIC_ROAMING = 15, - ALL_BARRING = 16, - OUTGOING_BARRING = 17, - INCOMING_BARRING = 18, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsTeleserviceType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsTeleserviceType.aidl deleted file mode 100644 index f06014cd50..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SsTeleserviceType.aidl +++ /dev/null @@ -1,43 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum SsTeleserviceType { - ALL_TELE_AND_BEARER_SERVICES = 0, - ALL_TELESEVICES = 1, - TELEPHONY = 2, - ALL_DATA_TELESERVICES = 3, - SMS_SERVICES = 4, - ALL_TELESERVICES_EXCEPT_SMS = 5, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SscMode.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SscMode.aidl deleted file mode 100644 index e2c3e09492..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SscMode.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="byte") @VintfStability -enum SscMode { - MODE_1 = 1, - MODE_2 = 2, - MODE_3 = 3, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/StkCcUnsolSsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/StkCcUnsolSsResult.aidl index 1e4f95b69d..31c2494017 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/StkCcUnsolSsResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/StkCcUnsolSsResult.aidl @@ -34,11 +34,51 @@ package android.hardware.radio; @VintfStability parcelable StkCcUnsolSsResult { - android.hardware.radio.SsServiceType serviceType; - android.hardware.radio.SsRequestType requestType; - android.hardware.radio.SsTeleserviceType teleserviceType; - android.hardware.radio.SuppServiceClass serviceClass; + int serviceType; + int requestType; + int teleserviceType; + int serviceClass; android.hardware.radio.RadioError result; android.hardware.radio.SsInfoData[] ssInfo; android.hardware.radio.CfData[] cfData; + const int REQUEST_TYPE_ACTIVATION = 0; + const int REQUEST_TYPE_DEACTIVATION = 1; + const int REQUEST_TYPE_INTERROGATION = 2; + const int REQUEST_TYPE_REGISTRATION = 3; + const int REQUEST_TYPE_ERASURE = 4; + const int SERVICE_TYPE_CFU = 0; + const int SERVICE_TYPE_CF_BUSY = 1; + const int SERVICE_TYPE_CF_NO_REPLY = 2; + const int SERVICE_TYPE_CF_NOT_REACHABLE = 3; + const int SERVICE_TYPE_CF_ALL = 4; + const int SERVICE_TYPE_CF_ALL_CONDITIONAL = 5; + const int SERVICE_TYPE_CLIP = 6; + const int SERVICE_TYPE_CLIR = 7; + const int SERVICE_TYPE_COLP = 8; + const int SERVICE_TYPE_COLR = 9; + const int SERVICE_TYPE_WAIT = 10; + const int SERVICE_TYPE_BAOC = 11; + const int SERVICE_TYPE_BAOIC = 12; + const int SERVICE_TYPE_BAOIC_EXC_HOME = 13; + const int SERVICE_TYPE_BAIC = 14; + const int SERVICE_TYPE_BAIC_ROAMING = 15; + const int SERVICE_TYPE_ALL_BARRING = 16; + const int SERVICE_TYPE_OUTGOING_BARRING = 17; + const int SERVICE_TYPE_INCOMING_BARRING = 18; + const int TELESERVICE_TYPE_ALL_TELE_AND_BEARER_SERVICES = 0; + const int TELESERVICE_TYPE_ALL_TELESEVICES = 1; + const int TELESERVICE_TYPE_TELEPHONY = 2; + const int TELESERVICE_TYPE_ALL_DATA_TELESERVICES = 3; + 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; + const int SUPP_SERVICE_CLASS_DATA = 2; + const int SUPP_SERVICE_CLASS_FAX = 4; + const int SUPP_SERVICE_CLASS_SMS = 8; + const int SUPP_SERVICE_CLASS_DATA_SYNC = 16; + const int SUPP_SERVICE_CLASS_DATA_ASYNC = 32; + const int SUPP_SERVICE_CLASS_PACKET = 64; + const int SUPP_SERVICE_CLASS_PAD = 128; + const int SUPP_SERVICE_CLASS_MAX = 128; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SubscriptionType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SubscriptionType.aidl deleted file mode 100644 index f469f2faef..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SubscriptionType.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum SubscriptionType { - SUBSCRIPTION_1 = 0, - SUBSCRIPTION_2 = 1, - SUBSCRIPTION_3 = 2, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SuppServiceClass.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SuppServiceClass.aidl deleted file mode 100644 index e59f40b1df..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/SuppServiceClass.aidl +++ /dev/null @@ -1,47 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum SuppServiceClass { - NONE = 0, - VOICE = 1, - DATA = 2, - FAX = 4, - SMS = 8, - DATA_SYNC = 16, - DATA_ASYNC = 32, - PACKET = 64, - PAD = 128, - MAX = 128, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TimeStampType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TimeStampType.aidl deleted file mode 100644 index ae70522aa7..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TimeStampType.aidl +++ /dev/null @@ -1,42 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum TimeStampType { - UNKNOWN = 0, - ANTENNA = 1, - MODEM = 2, - OEM_RIL = 3, - JAVA_RIL = 4, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TrafficDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TrafficDescriptor.aidl index 9f46848d44..7dabe99a7c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TrafficDescriptor.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/TrafficDescriptor.aidl @@ -34,6 +34,6 @@ package android.hardware.radio; @VintfStability parcelable TrafficDescriptor { - android.hardware.radio.OptionalDnn dnn; - android.hardware.radio.OptionalOsAppId osAppId; + @nullable String dnn; + @nullable android.hardware.radio.OsAppId osAppId; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UiccSubActStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UiccSubActStatus.aidl deleted file mode 100644 index 5ec511e989..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UiccSubActStatus.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum UiccSubActStatus { - DEACTIVATE = 0, - ACTIVATE = 1, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UrspRule.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UrspRule.aidl index ababb29539..30c851c7f3 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UrspRule.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UrspRule.aidl @@ -34,7 +34,7 @@ package android.hardware.radio; @VintfStability parcelable UrspRule { - byte precedence; + int precedence; android.hardware.radio.TrafficDescriptor[] trafficDescriptors; android.hardware.radio.RouteSelectionDescriptor[] routeSelectionDescriptor; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusDcs.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusDcs.aidl deleted file mode 100644 index cf1bacacb3..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusDcs.aidl +++ /dev/null @@ -1,42 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum UusDcs { - USP = 0, - OSIHLP = 1, - X244 = 2, - RMCF = 3, - IA5C = 4, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusInfo.aidl index 3551fe3b70..5b7190e99e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusInfo.aidl @@ -34,7 +34,19 @@ package android.hardware.radio; @VintfStability parcelable UusInfo { - android.hardware.radio.UusType uusType; - android.hardware.radio.UusDcs uusDcs; + int uusType; + int uusDcs; String uusData; + const int UUS_DCS_USP = 0; + const int UUS_DCS_OSIHLP = 1; + const int UUS_DCS_X244 = 2; + const int UUS_DCS_RMCF = 3; + const int UUS_DCS_IA5C = 4; + const int UUS_TYPE_TYPE1_IMPLICIT = 0; + const int UUS_TYPE_TYPE1_REQUIRED = 1; + const int UUS_TYPE_TYPE1_NOT_REQUIRED = 2; + const int UUS_TYPE_TYPE2_REQUIRED = 3; + const int UUS_TYPE_TYPE2_NOT_REQUIRED = 4; + const int UUS_TYPE_TYPE3_REQUIRED = 5; + const int UUS_TYPE_TYPE3_NOT_REQUIRED = 6; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusType.aidl deleted file mode 100644 index 7176d400c5..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/UusType.aidl +++ /dev/null @@ -1,44 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="int") @VintfStability -enum UusType { - TYPE1_IMPLICIT = 0, - TYPE1_REQUIRED = 1, - TYPE1_NOT_REQUIRED = 2, - TYPE2_REQUIRED = 3, - TYPE2_NOT_REQUIRED = 4, - TYPE3_REQUIRED = 5, - TYPE3_NOT_REQUIRED = 6, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/VopsIndicator.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/VopsIndicator.aidl deleted file mode 100644 index 028b71907d..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/VopsIndicator.aidl +++ /dev/null @@ -1,40 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio; -@Backing(type="byte") @VintfStability -enum VopsIndicator { - VOPS_NOT_SUPPORTED = 0, - VOPS_OVER_3GPP = 1, - VOPS_OVER_NON_3GPP = 2, -} diff --git a/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.aidl b/radio/aidl/android/hardware/radio/AccessTechnologySpecificInfo.aidl similarity index 73% rename from radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.aidl rename to radio/aidl/android/hardware/radio/AccessTechnologySpecificInfo.aidl index b22e413dd7..6f0640c63c 100644 --- a/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.aidl +++ b/radio/aidl/android/hardware/radio/AccessTechnologySpecificInfo.aidl @@ -16,15 +16,15 @@ package android.hardware.radio; +import android.hardware.radio.Cdma2000RegistrationInfo; +import android.hardware.radio.EutranRegistrationInfo; import android.hardware.radio.NrVopsInfo; -import android.hardware.radio.RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo; -import android.hardware.radio.RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo; @VintfStability -union RegStateResultAccessTechnologySpecificInfo { +union AccessTechnologySpecificInfo { boolean noinit; - RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo cdmaInfo; - RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo eutranInfo; + Cdma2000RegistrationInfo cdmaInfo; + EutranRegistrationInfo eutranInfo; /** * Network capabilities for voice over PS services. This info is valid only on NR network and * must be present when the device is camped on NR. VopsInfo must be empty when the device is diff --git a/radio/aidl/android/hardware/radio/AddressProperty.aidl b/radio/aidl/android/hardware/radio/AddressProperty.aidl deleted file mode 100644 index dbafc17b2b..0000000000 --- a/radio/aidl/android/hardware/radio/AddressProperty.aidl +++ /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. - */ - -package android.hardware.radio; - -/** - * The properties of the link address. This enum reflects the definition in if_addr.h in - * Linux kernel. - */ -@VintfStability -@Backing(type="int") -enum AddressProperty { - NONE = 0, - /** - * Indicates this address is deprecated - */ - DEPRECATED = 0x20, -} diff --git a/radio/aidl/android/hardware/radio/AppState.aidl b/radio/aidl/android/hardware/radio/AppState.aidl deleted file mode 100644 index 9488282cc2..0000000000 --- a/radio/aidl/android/hardware/radio/AppState.aidl +++ /dev/null @@ -1,37 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum AppState { - UNKNOWN, - DETECTED, - /** - * If PIN1 or UPin is required - */ - PIN, - /** - * If PUK1 or Puk for Upin is required - */ - PUK, - /** - * perso_substate must be looked at when app_state is assigned to this value - */ - SUBSCRIPTION_PERSO, - READY, -} diff --git a/radio/aidl/android/hardware/radio/AppStatus.aidl b/radio/aidl/android/hardware/radio/AppStatus.aidl index 6b6269754d..6fd17e42c0 100644 --- a/radio/aidl/android/hardware/radio/AppStatus.aidl +++ b/radio/aidl/android/hardware/radio/AppStatus.aidl @@ -16,15 +16,42 @@ package android.hardware.radio; -import android.hardware.radio.AppState; -import android.hardware.radio.AppType; import android.hardware.radio.PersoSubstate; import android.hardware.radio.PinState; @VintfStability parcelable AppStatus { - AppType appType; - AppState appState; + const int APP_STATE_UNKNOWN = 0; + const int APP_STATE_DETECTED = 1; + /** + * If PIN1 or UPin is required + */ + const int APP_STATE_PIN = 2; + /** + * If PUK1 or Puk for Upin is required + */ + const int APP_STATE_PUK = 3; + /** + * perso_substate must be looked at when app_state is assigned to this value + */ + const int APP_STATE_SUBSCRIPTION_PERSO = 4; + const int APP_STATE_READY = 5; + + const int APP_TYPE_UNKNOWN = 0; + const int APP_TYPE_SIM = 1; + const int APP_TYPE_USIM = 2; + const int APP_TYPE_RUIM = 3; + const int APP_TYPE_CSIM = 4; + const int APP_TYPE_ISIM = 5; + + /** + * Values are APP_TYPE_ + */ + int appType; + /** + * Values are APP_STATE_ + */ + int appState; /** * Applicable only if appState == SUBSCRIPTION_PERSO */ @@ -37,7 +64,7 @@ parcelable AppStatus { /** * Applicable to USIM, CSIM and ISIM */ - int pin1Replaced; + boolean pin1Replaced; PinState pin1; PinState pin2; } diff --git a/radio/aidl/android/hardware/radio/AppType.aidl b/radio/aidl/android/hardware/radio/AppType.aidl deleted file mode 100644 index 8403f7dd63..0000000000 --- a/radio/aidl/android/hardware/radio/AppType.aidl +++ /dev/null @@ -1,28 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum AppType { - UNKNOWN, - SIM, - USIM, - RUIM, - CSIM, - ISIM, -} diff --git a/radio/aidl/android/hardware/radio/BarringInfo.aidl b/radio/aidl/android/hardware/radio/BarringInfo.aidl index c50fa4b5db..2bffa2e67c 100644 --- a/radio/aidl/android/hardware/radio/BarringInfo.aidl +++ b/radio/aidl/android/hardware/radio/BarringInfo.aidl @@ -16,12 +16,101 @@ package android.hardware.radio; -import android.hardware.radio.BarringInfoBarringType; -import android.hardware.radio.BarringInfoBarringTypeSpecificInfo; -import android.hardware.radio.BarringInfoServiceType; +import android.hardware.radio.BarringTypeSpecificInfo; @VintfStability parcelable BarringInfo { + /** + * Device is not barred for the given service + */ + const int BARRING_TYPE_NONE = 0; + /** + * Device may be barred based on time and probability factors + */ + const int BARRING_TYPE_CONDITIONAL = 1; + /* + * Device is unconditionally barred + */ + const int BARRING_TYPE_UNCONDITIONAL = 2; + + /** + * Applicable to UTRAN + * Barring for all CS services, including registration + */ + const int SERVICE_TYPE_CS_SERVICE = 0; + /** + * Barring for all PS services, including registration + */ + const int SERVICE_TYPE_PS_SERVICE = 1; + /** + * Barring for mobile-originated circuit-switched voice calls + */ + const int SERVICE_TYPE_CS_VOICE = 2; + /** + * Applicable to EUTRAN, NGRAN + * Barring for mobile-originated signalling for any purpose + */ + const int SERVICE_TYPE_MO_SIGNALLING = 3; + /** + * Barring for mobile-originated internet or other interactive data + */ + const int SERVICE_TYPE_MO_DATA = 4; + /** + * Barring for circuit-switched fallback calling + */ + const int SERVICE_TYPE_CS_FALLBACK = 5; + /** + * Barring for IMS voice calling + */ + const int SERVICE_TYPE_MMTEL_VOICE = 6; + /** + * Barring for IMS video calling + */ + const int SERVICE_TYPE_MMTEL_VIDEO = 7; + /** + * Applicable to UTRAN, EUTRAN, NGRAN + * Barring for emergency services, either CS or emergency MMTEL + */ + const int SERVICE_TYPE_EMERGENCY = 8; + /** + * Barring for short message services + */ + const int SERVICE_TYPE_SMS = 9; + /** + * Operator-specific barring codes; applicable to NGRAN + */ + const int SERVICE_TYPE_OPERATOR_1 = 1001; + const int SERVICE_TYPE_OPERATOR_2 = 1002; + const int SERVICE_TYPE_OPERATOR_3 = 1003; + const int SERVICE_TYPE_OPERATOR_4 = 1004; + const int SERVICE_TYPE_OPERATOR_5 = 1005; + const int SERVICE_TYPE_OPERATOR_6 = 1006; + const int SERVICE_TYPE_OPERATOR_7 = 1007; + const int SERVICE_TYPE_OPERATOR_8 = 1008; + const int SERVICE_TYPE_OPERATOR_9 = 1009; + const int SERVICE_TYPE_OPERATOR_10 = 1010; + const int SERVICE_TYPE_OPERATOR_11 = 1011; + const int SERVICE_TYPE_OPERATOR_12 = 1012; + const int SERVICE_TYPE_OPERATOR_13 = 1013; + const int SERVICE_TYPE_OPERATOR_14 = 1014; + const int SERVICE_TYPE_OPERATOR_15 = 1015; + const int SERVICE_TYPE_OPERATOR_16 = 1016; + const int SERVICE_TYPE_OPERATOR_17 = 1017; + const int SERVICE_TYPE_OPERATOR_18 = 1018; + const int SERVICE_TYPE_OPERATOR_19 = 1019; + const int SERVICE_TYPE_OPERATOR_20 = 1020; + const int SERVICE_TYPE_OPERATOR_21 = 1021; + const int SERVICE_TYPE_OPERATOR_22 = 1022; + const int SERVICE_TYPE_OPERATOR_23 = 1023; + const int SERVICE_TYPE_OPERATOR_24 = 1024; + const int SERVICE_TYPE_OPERATOR_25 = 1025; + const int SERVICE_TYPE_OPERATOR_26 = 1026; + const int SERVICE_TYPE_OPERATOR_27 = 1027; + const int SERVICE_TYPE_OPERATOR_28 = 1028; + const int SERVICE_TYPE_OPERATOR_29 = 1029; + const int SERVICE_TYPE_OPERATOR_30 = 1030; + const int SERVICE_TYPE_OPERATOR_31 = 1031; + const int SERVICE_TYPE_OPERATOR_32 = 1032; /** * Combined list of barring services for UTRAN, EUTRAN, and NGRAN. * @@ -29,14 +118,16 @@ parcelable BarringInfo { * -UTRAN - 3gpp 25.331 Sec 10.2.48.8.6. * -EUTRAN - 3gpp 36.331 Sec 6.3.1 SystemInformationBlockType2 * -NGRAN - 3gpp 38.331 Sec 6.3.2 UAC-BarringInfo and 22.261 Sec 6.22.2.[2-3] + * Values are SERVICE_TYPE_ */ - BarringInfoServiceType serviceType; + int serviceType; /** * The type of barring applied to the service + * Values are BARRING_TYPE_ */ - BarringInfoBarringType barringType; + int barringType; /** * Type-specific barring info if applicable */ - BarringInfoBarringTypeSpecificInfo barringTypeSpecificInfo; + @nullable BarringTypeSpecificInfo barringTypeSpecificInfo; } diff --git a/radio/aidl/android/hardware/radio/BarringInfoBarringType.aidl b/radio/aidl/android/hardware/radio/BarringInfoBarringType.aidl deleted file mode 100644 index 41f5fbb719..0000000000 --- a/radio/aidl/android/hardware/radio/BarringInfoBarringType.aidl +++ /dev/null @@ -1,34 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum BarringInfoBarringType { - /** - * Device is not barred for the given service - */ - NONE, - /** - * Device may be barred based on time and probability factors - */ - CONDITIONAL, - /* - * Device is unconditionally barred - */ - UNCONDITIONAL, -} diff --git a/radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.aidl b/radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.aidl deleted file mode 100644 index 18f309dad4..0000000000 --- a/radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.aidl +++ /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. - */ - -package android.hardware.radio; - -import android.hardware.radio.BarringInfoBarringTypeSpecificInfoConditional; - -@VintfStability -union BarringInfoBarringTypeSpecificInfo { - /** - * Barring type is either none or unconditional - */ - boolean noinit; - /** - * Must be included if barring is conditional - */ - BarringInfoBarringTypeSpecificInfoConditional conditional; -} diff --git a/radio/aidl/android/hardware/radio/BarringInfoServiceType.aidl b/radio/aidl/android/hardware/radio/BarringInfoServiceType.aidl deleted file mode 100644 index 1fa52a06d5..0000000000 --- a/radio/aidl/android/hardware/radio/BarringInfoServiceType.aidl +++ /dev/null @@ -1,100 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum BarringInfoServiceType { - /** - * Applicable to UTRAN - * Barring for all CS services, including registration - */ - CS_SERVICE, - /** - * Barring for all PS services, including registration - */ - PS_SERVICE, - /** - * Barring for mobile-originated circuit-switched voice calls - */ - CS_VOICE, - /** - * Applicable to EUTRAN, NGRAN - * Barring for mobile-originated signalling for any purpose - */ - MO_SIGNALLING, - /** - * Barring for mobile-originated internet or other interactive data - */ - MO_DATA, - /** - * Barring for circuit-switched fallback calling - */ - CS_FALLBACK, - /** - * Barring for IMS voice calling - */ - MMTEL_VOICE, - /** - * Barring for IMS video calling - */ - MMTEL_VIDEO, - /** - * Applicable to UTRAN, EUTRAN, NGRAN - * Barring for emergency services, either CS or emergency MMTEL - */ - EMERGENCY, - /** - * Barring for short message services - */ - SMS, - /** - * Operator-specific barring codes; applicable to NGRAN - */ - OPERATOR_1 = 1001, - OPERATOR_2 = 1002, - OPERATOR_3 = 1003, - OPERATOR_4 = 1004, - OPERATOR_5 = 1005, - OPERATOR_6 = 1006, - OPERATOR_7 = 1007, - OPERATOR_8 = 1008, - OPERATOR_9 = 1009, - OPERATOR_10 = 1010, - OPERATOR_11 = 1011, - OPERATOR_12 = 1012, - OPERATOR_13 = 1013, - OPERATOR_14 = 1014, - OPERATOR_15 = 1015, - OPERATOR_16 = 1016, - OPERATOR_17 = 1017, - OPERATOR_18 = 1018, - OPERATOR_19 = 1019, - OPERATOR_20 = 1020, - OPERATOR_21 = 1021, - OPERATOR_22 = 1022, - OPERATOR_23 = 1023, - OPERATOR_24 = 1024, - OPERATOR_25 = 1025, - OPERATOR_26 = 1026, - OPERATOR_27 = 1027, - OPERATOR_28 = 1028, - OPERATOR_29 = 1029, - OPERATOR_30 = 1030, - OPERATOR_31 = 1031, - OPERATOR_32 = 1032, -} diff --git a/radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.aidl b/radio/aidl/android/hardware/radio/BarringTypeSpecificInfo.aidl similarity index 96% rename from radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.aidl rename to radio/aidl/android/hardware/radio/BarringTypeSpecificInfo.aidl index e3b7dfa657..c3b892b479 100644 --- a/radio/aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.aidl +++ b/radio/aidl/android/hardware/radio/BarringTypeSpecificInfo.aidl @@ -17,7 +17,7 @@ package android.hardware.radio; @VintfStability -parcelable BarringInfoBarringTypeSpecificInfoConditional { +parcelable BarringTypeSpecificInfo { /** * The barring factor as a percentage 0-100 */ diff --git a/radio/aidl/android/hardware/radio/Call.aidl b/radio/aidl/android/hardware/radio/Call.aidl index 38cb3d3fdc..467a5b9514 100644 --- a/radio/aidl/android/hardware/radio/Call.aidl +++ b/radio/aidl/android/hardware/radio/Call.aidl @@ -17,13 +17,38 @@ package android.hardware.radio; import android.hardware.radio.AudioQuality; -import android.hardware.radio.CallPresentation; -import android.hardware.radio.CallState; import android.hardware.radio.UusInfo; @VintfStability parcelable Call { - CallState state; + const int PRESENTATION_ALLOWED = 0; + const int PRESENTATION_RESTRICTED = 1; + const int PRESENTATION_UNKNOWN = 2; + const int PRESENTATION_PAYPHONE = 3; + + const int STATE_ACTIVE = 0; + const int STATE_HOLDING = 1; + /** + * MO call only + */ + const int STATE_DIALING = 2; + /** + * MO call only + */ + const int STATE_ALERTING = 3; + /** + * MT call only + */ + const int STATE_INCOMING = 4; + /** + * MT call only + */ + const int STATE_WAITING = 5; + + /** + * Values are STATE_ + */ + int state; /** * Connection index for use with, eg, AT+CHLD */ @@ -56,12 +81,18 @@ parcelable Call { * Remote party nummber */ String number; - CallPresentation numberPresentation; + /** + * Values are PRESENTATION_ + */ + int numberPresentation; /** * Remote party name */ String name; - CallPresentation namePresentation; + /** + * Values are PRESENTATION_ + */ + int namePresentation; /** * Vector of User-User Signaling Information */ diff --git a/radio/aidl/android/hardware/radio/CallForwardInfo.aidl b/radio/aidl/android/hardware/radio/CallForwardInfo.aidl index 91a30555eb..18356318f0 100644 --- a/radio/aidl/android/hardware/radio/CallForwardInfo.aidl +++ b/radio/aidl/android/hardware/radio/CallForwardInfo.aidl @@ -16,18 +16,23 @@ package android.hardware.radio; -import android.hardware.radio.CallForwardInfoStatus; - /** * See also com.android.internal.telephony.gsm.CallForwardInfo */ @VintfStability parcelable CallForwardInfo { + const int STATUS_DISABLE = 0; + const int STATUS_ENABLE = 1; + const int STATUS_INTERROGATE = 2; + const int STATUS_REGISTRATION = 3; + const int STATUS_ERASURE = 4; + /** * For queryCallForwardStatus() status is DISABLE (Not used by vendor code currently) * For setCallForward() status must be DISABLE, ENABLE, INTERROGATE, REGISTRATION, ERASURE + * Values are STATUS_ */ - CallForwardInfoStatus status; + int status; /** * From TS 27.007 7.11 "reason" */ diff --git a/radio/aidl/android/hardware/radio/CallForwardInfoStatus.aidl b/radio/aidl/android/hardware/radio/CallForwardInfoStatus.aidl deleted file mode 100644 index f4ae503e4c..0000000000 --- a/radio/aidl/android/hardware/radio/CallForwardInfoStatus.aidl +++ /dev/null @@ -1,27 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CallForwardInfoStatus { - DISABLE, - ENABLE, - INTERROGATE, - REGISTRATION, - ERASURE, -} diff --git a/radio/aidl/android/hardware/radio/CallPresentation.aidl b/radio/aidl/android/hardware/radio/CallPresentation.aidl deleted file mode 100644 index 76b5f21a2a..0000000000 --- a/radio/aidl/android/hardware/radio/CallPresentation.aidl +++ /dev/null @@ -1,26 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CallPresentation { - ALLOWED, - RESTRICTED, - UNKNOWN, - PAYPHONE, -} diff --git a/radio/aidl/android/hardware/radio/CallState.aidl b/radio/aidl/android/hardware/radio/CallState.aidl deleted file mode 100644 index 4b6f1ac235..0000000000 --- a/radio/aidl/android/hardware/radio/CallState.aidl +++ /dev/null @@ -1,40 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CallState { - ACTIVE, - HOLDING, - /** - * MO call only - */ - DIALING, - /** - * MO call only - */ - ALERTING, - /** - * MT call only - */ - INCOMING, - /** - * MT call only - */ - WAITING, -} diff --git a/radio/aidl/android/hardware/radio/CardState.aidl b/radio/aidl/android/hardware/radio/CardState.aidl deleted file mode 100644 index c1bbee6b0a..0000000000 --- a/radio/aidl/android/hardware/radio/CardState.aidl +++ /dev/null @@ -1,37 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CardState { - /* - * Card is physically absent from device. (Some old modems use CardState.ABSENT when the SIM - * is powered off. This is no longer correct, however the platform will still support this - * legacy behavior.) - */ - ABSENT, - /* - * Card is inserted in the device - */ - PRESENT, - ERROR, - /* - * Card is present but not usable due to carrier restrictions - */ - RESTRICTED, -} diff --git a/radio/aidl/android/hardware/radio/CardStatus.aidl b/radio/aidl/android/hardware/radio/CardStatus.aidl index a8df53d81c..a6a287d707 100644 --- a/radio/aidl/android/hardware/radio/CardStatus.aidl +++ b/radio/aidl/android/hardware/radio/CardStatus.aidl @@ -17,12 +17,30 @@ package android.hardware.radio; import android.hardware.radio.AppStatus; -import android.hardware.radio.CardState; import android.hardware.radio.PinState; @VintfStability parcelable CardStatus { - CardState cardState; + /* + * Card is physically absent from device. (Some old modems use CardState.ABSENT when the SIM + * is powered off. This is no longer correct, however the platform will still support this + * legacy behavior.) + */ + const int STATE_ABSENT = 0; + /* + * Card is inserted in the device + */ + const int STATE_PRESENT = 1; + const int STATE_ERROR = 2; + /* + * Card is present but not usable due to carrier restrictions + */ + const int STATE_RESTRICTED = 3; + + /** + * Values are STATE_ + */ + int cardState; /** * Applicable to USIM and CSIM */ diff --git a/radio/aidl/android/hardware/radio/Carrier.aidl b/radio/aidl/android/hardware/radio/Carrier.aidl index be619b941b..cde9b5ff0d 100644 --- a/radio/aidl/android/hardware/radio/Carrier.aidl +++ b/radio/aidl/android/hardware/radio/Carrier.aidl @@ -16,16 +16,36 @@ package android.hardware.radio; -import android.hardware.radio.CarrierMatchType; - @VintfStability parcelable Carrier { + /** + * Apply to all carrier with the same mcc/mnc + */ + const int MATCH_TYPE_ALL = 0; + /** + * Use SPN and mcc/mnc to identify the carrier + */ + const int MATCH_TYPE_SPN = 1; + /** + * Use IMSI prefix and mcc/mnc to identify the carrier + */ + const int MATCH_TYPE_IMSI_PREFIX = 2; + /** + * Use GID1 and mcc/mnc to identify the carrier + */ + const int MATCH_TYPE_GID1 = 3; + /** + * Use GID2 and mcc/mnc to identify the carrier + */ + const int MATCH_TYPE_GID2 = 4; + String mcc; String mnc; /** * Specify match type for the carrier. If it’s ALL, matchData is empty string; otherwise, * matchData is the value for the match type. + * Values are MATCH_TYPE_ */ - CarrierMatchType matchType; + int matchType; String matchData; } diff --git a/radio/aidl/android/hardware/radio/CarrierMatchType.aidl b/radio/aidl/android/hardware/radio/CarrierMatchType.aidl deleted file mode 100644 index 39b9466d69..0000000000 --- a/radio/aidl/android/hardware/radio/CarrierMatchType.aidl +++ /dev/null @@ -1,42 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CarrierMatchType { - /** - * Apply to all carrier with the same mcc/mnc - */ - ALL, - /** - * Use SPN and mcc/mnc to identify the carrier - */ - SPN, - /** - * Use IMSI prefix and mcc/mnc to identify the carrier - */ - IMSI_PREFIX, - /** - * Use GID1 and mcc/mnc to identify the carrier - */ - GID1, - /** - * Use GID2 and mcc/mnc to identify the carrier - */ - GID2, -} diff --git a/radio/aidl/android/hardware/radio/CarrierRestrictions.aidl b/radio/aidl/android/hardware/radio/CarrierRestrictions.aidl index 70df637f6e..5e1f8155e2 100644 --- a/radio/aidl/android/hardware/radio/CarrierRestrictions.aidl +++ b/radio/aidl/android/hardware/radio/CarrierRestrictions.aidl @@ -30,4 +30,18 @@ parcelable CarrierRestrictions { * is ABCD, all carriers with the same mcc/mnc are allowed. */ Carrier[] excludedCarriers; + /** + * Whether this is a carrier restriction with priority or not. + * If this is false, allowedCarriersPrioritized is not applicable. + */ + boolean priority; + /** + * True means that only carriers included in the allowed list and not in the excluded list + * are permitted. 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. + * False means that all carriers are allowed except those included in the excluded list + * and not in the allowed list. + */ + boolean allowedCarriersPrioritized; } diff --git a/radio/aidl/android/hardware/radio/CarrierRestrictionsWithPriority.aidl b/radio/aidl/android/hardware/radio/CarrierRestrictionsWithPriority.aidl deleted file mode 100644 index 057b016415..0000000000 --- a/radio/aidl/android/hardware/radio/CarrierRestrictionsWithPriority.aidl +++ /dev/null @@ -1,42 +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. - */ - -package android.hardware.radio; - -import android.hardware.radio.Carrier; - -@VintfStability -parcelable CarrierRestrictionsWithPriority { - /** - * List of allowed carriers. - * The character '?' is used as wildcard character to match any value. - */ - Carrier[] allowedCarriers; - /** - * List of excluded carriers. - * The character '?' is used as wildcard character to match any value. - */ - Carrier[] excludedCarriers; - /** - * True means that only carriers included in the allowed list and not in the excluded list - * are permitted. 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. - * False means that all carriers are allowed except those included in the excluded list - * and not in the allowed list. - */ - boolean allowedCarriersPrioritized; -} diff --git a/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.aidl b/radio/aidl/android/hardware/radio/Cdma2000RegistrationInfo.aidl similarity index 85% rename from radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.aidl rename to radio/aidl/android/hardware/radio/Cdma2000RegistrationInfo.aidl index 14f68ec025..b9f3b66c54 100644 --- a/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.aidl +++ b/radio/aidl/android/hardware/radio/Cdma2000RegistrationInfo.aidl @@ -16,10 +16,11 @@ package android.hardware.radio; -import android.hardware.radio.PrlIndicator; - @VintfStability -parcelable RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo { +parcelable Cdma2000RegistrationInfo { + const int PRL_INDICATOR_NOT_REGISTERED = -1; + const int PRL_INDICATOR_NOT_IN_PRL = 0; + const int PRL_INDICATOR_IN_PRL = 1; /** * Concurrent services support indicator. if registered on a CDMA system. * false - Concurrent services not supported, @@ -34,8 +35,9 @@ parcelable RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo { /** * Indicates whether the current system is in the PRL if registered on a CDMA or EVDO system * or -1 if not. 0=not in the PRL, 1=in the PRL. + * Values are PRL_INDICATOR_ */ - PrlIndicator systemIsInPrl; + int systemIsInPrl; /** * Default Roaming Indicator from the PRL if registered on a CDMA or EVDO system or -1 if not. * Valid values are 0-255. diff --git a/radio/aidl/android/hardware/radio/CdmaCallWaiting.aidl b/radio/aidl/android/hardware/radio/CdmaCallWaiting.aidl index 3db6ee003b..b08ba7f125 100644 --- a/radio/aidl/android/hardware/radio/CdmaCallWaiting.aidl +++ b/radio/aidl/android/hardware/radio/CdmaCallWaiting.aidl @@ -16,18 +16,35 @@ package android.hardware.radio; -import android.hardware.radio.CdmaCallWaitingNumberPlan; -import android.hardware.radio.CdmaCallWaitingNumberPresentation; -import android.hardware.radio.CdmaCallWaitingNumberType; import android.hardware.radio.CdmaSignalInfoRecord; @VintfStability parcelable CdmaCallWaiting { + const int NUMBER_PLAN_UNKNOWN = 0; + const int NUMBER_PLAN_ISDN = 1; + const int NUMBER_PLAN_DATA = 3; + const int NUMBER_PLAN_TELEX = 4; + const int NUMBER_PLAN_NATIONAL = 8; + const int NUMBER_PLAN_PRIVATE = 9; + + const int NUMBER_PRESENTATION_ALLOWED = 0; + const int NUMBER_PRESENTATION_RESTRICTED = 1; + const int NUMBER_PRESENTATION_UNKNOWN = 2; + + const int NUMBER_TYPE_UNKNOWN = 0; + const int NUMBER_TYPE_INTERNATIONAL = 1; + const int NUMBER_TYPE_NATIONAL = 2; + const int NUMBER_TYPE_NETWORK_SPECIFIC = 3; + const int NUMBER_TYPE_SUBSCRIBER = 4; + /** * Remote party number */ String number; - CdmaCallWaitingNumberPresentation numberPresentation; + /** + * Values are NUMBER_PRESENTATION_ + */ + int numberPresentation; /** * Remote party name */ @@ -35,10 +52,12 @@ parcelable CdmaCallWaiting { CdmaSignalInfoRecord signalInfoRecord; /** * Required to support International Call Waiting + * Values are NUMBER_TYPE_ */ - CdmaCallWaitingNumberType numberType; + int numberType; /** * Required to support International Call Waiting + * Values are NUMBER_PLAN_ */ - CdmaCallWaitingNumberPlan numberPlan; + int numberPlan; } diff --git a/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl b/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl deleted file mode 100644 index 76d2197060..0000000000 --- a/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPlan.aidl +++ /dev/null @@ -1,28 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CdmaCallWaitingNumberPlan { - UNKNOWN = 0, - ISDN = 1, - DATA = 3, - TELEX = 4, - NATIONAL = 8, - PRIVATE = 9, -} diff --git a/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl b/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl deleted file mode 100644 index f9fca965d9..0000000000 --- a/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberPresentation.aidl +++ /dev/null @@ -1,25 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CdmaCallWaitingNumberPresentation { - ALLOWED, - RESTRICTED, - UNKNOWN, -} diff --git a/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberType.aidl b/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberType.aidl deleted file mode 100644 index 9c5b8ed9ac..0000000000 --- a/radio/aidl/android/hardware/radio/CdmaCallWaitingNumberType.aidl +++ /dev/null @@ -1,27 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CdmaCallWaitingNumberType { - UNKNOWN, - INTERNATIONAL, - NATIONAL, - NETWORK_SPECIFIC, - SUBSCRIBER, -} diff --git a/radio/aidl/android/hardware/radio/CdmaInfoRecName.aidl b/radio/aidl/android/hardware/radio/CdmaInfoRecName.aidl deleted file mode 100644 index 63ec699a57..0000000000 --- a/radio/aidl/android/hardware/radio/CdmaInfoRecName.aidl +++ /dev/null @@ -1,36 +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. - */ - -package android.hardware.radio; - -/** - * Names of the CDMA info records (C.S0005 section 3.7.5) - */ -@VintfStability -@Backing(type="int") -enum CdmaInfoRecName { - DISPLAY, - CALLED_PARTY_NUMBER, - CALLING_PARTY_NUMBER, - CONNECTED_NUMBER, - SIGNAL, - REDIRECTING_NUMBER, - LINE_CONTROL, - EXTENDED_DISPLAY, - T53_CLIR, - T53_RELEASE, - T53_AUDIO_CONTROL, -} diff --git a/radio/aidl/android/hardware/radio/CdmaInformationRecord.aidl b/radio/aidl/android/hardware/radio/CdmaInformationRecord.aidl index 7d9cb0ac13..20eabffb96 100644 --- a/radio/aidl/android/hardware/radio/CdmaInformationRecord.aidl +++ b/radio/aidl/android/hardware/radio/CdmaInformationRecord.aidl @@ -17,7 +17,6 @@ package android.hardware.radio; import android.hardware.radio.CdmaDisplayInfoRecord; -import android.hardware.radio.CdmaInfoRecName; import android.hardware.radio.CdmaLineControlInfoRecord; import android.hardware.radio.CdmaNumberInfoRecord; import android.hardware.radio.CdmaRedirectingNumberInfoRecord; @@ -27,11 +26,27 @@ import android.hardware.radio.CdmaT53ClirInfoRecord; @VintfStability parcelable CdmaInformationRecord { + /** + * Names of the CDMA info records (C.S0005 section 3.7.5) + */ + const int NAME_DISPLAY = 0; + const int NAME_CALLED_PARTY_NUMBER = 1; + const int NAME_CALLING_PARTY_NUMBER = 2; + const int NAME_CONNECTED_NUMBER = 3; + const int NAME_SIGNAL = 4; + const int NAME_REDIRECTING_NUMBER = 5; + const int NAME_LINE_CONTROL = 6; + const int NAME_EXTENDED_DISPLAY = 7; + const int NAME_T53_CLIR = 8; + const int NAME_T53_RELEASE = 9; + const int NAME_T53_AUDIO_CONTROL = 10; + /** * Based on CdmaInfoRecName, only one of the below vectors must have size = 1. * All other vectors must have size 0. + * Values are NAME_ */ - CdmaInfoRecName name; + int name; /** * Display and extended display info rec */ diff --git a/radio/aidl/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl b/radio/aidl/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl index d15621a5b5..7ba272b8a6 100644 --- a/radio/aidl/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/CdmaRedirectingNumberInfoRecord.aidl @@ -17,13 +17,24 @@ package android.hardware.radio; import android.hardware.radio.CdmaNumberInfoRecord; -import android.hardware.radio.CdmaRedirectingReason; @VintfStability parcelable CdmaRedirectingNumberInfoRecord { + /** + * Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 + */ + const int REDIRECTING_REASON_UNKNOWN = 0; + const int REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1; + const int REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2; + const int REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9; + const int REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10; + const int REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15; + const int REDIRECTING_REASON_RESERVED = 16; + CdmaNumberInfoRecord redirectingNumber; /** * Set to UNKNOWN if not included. + * Values are REDIRECTING_REASON_ */ - CdmaRedirectingReason redirectingReason; + int redirectingReason; } diff --git a/radio/aidl/android/hardware/radio/CdmaRedirectingReason.aidl b/radio/aidl/android/hardware/radio/CdmaRedirectingReason.aidl deleted file mode 100644 index c86b9b2265..0000000000 --- a/radio/aidl/android/hardware/radio/CdmaRedirectingReason.aidl +++ /dev/null @@ -1,32 +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. - */ - -package android.hardware.radio; - -/** - * Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 - */ -@VintfStability -@Backing(type="int") -enum CdmaRedirectingReason { - UNKNOWN = 0, - CALL_FORWARDING_BUSY = 1, - CALL_FORWARDING_NO_REPLY = 2, - CALLED_DTE_OUT_OF_ORDER = 9, - CALL_FORWARDING_BY_THE_CALLED_DTE = 10, - CALL_FORWARDING_UNCONDITIONAL = 15, - RESERVED, -} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsAck.aidl b/radio/aidl/android/hardware/radio/CdmaSmsAck.aidl index b412b704d5..b1e85ff2ed 100644 --- a/radio/aidl/android/hardware/radio/CdmaSmsAck.aidl +++ b/radio/aidl/android/hardware/radio/CdmaSmsAck.aidl @@ -16,11 +16,9 @@ package android.hardware.radio; -import android.hardware.radio.CdmaSmsErrorClass; - @VintfStability parcelable CdmaSmsAck { - CdmaSmsErrorClass errorClass; + boolean errorClass; /** * SMS cause code as defined in N.S00005, 6.5.2.125. * Currently, only 35 (resource shortage) and 39 (other terminal problem) are reported. diff --git a/radio/aidl/android/hardware/radio/CdmaSmsAddress.aidl b/radio/aidl/android/hardware/radio/CdmaSmsAddress.aidl index 83e883925e..d449ccfc33 100644 --- a/radio/aidl/android/hardware/radio/CdmaSmsAddress.aidl +++ b/radio/aidl/android/hardware/radio/CdmaSmsAddress.aidl @@ -16,36 +16,87 @@ package android.hardware.radio; -import android.hardware.radio.CdmaSmsDigitMode; -import android.hardware.radio.CdmaSmsNumberMode; -import android.hardware.radio.CdmaSmsNumberPlan; -import android.hardware.radio.CdmaSmsNumberType; - @VintfStability parcelable CdmaSmsAddress { + /** + * DTMF digits + */ + const int DIGIT_MODE_FOUR_BIT = 0; + const int DIGIT_MODE_EIGHT_BIT = 1; + + const int NUMBER_PLAN_UNKNOWN = 0; + /** + * CCITT E.164 and E.163, including ISDN plan + */ + const int NUMBER_PLAN_TELEPHONY = 1; + const int NUMBER_PLAN_RESERVED_2 = 2; + /** + * CCITT X.121 + */ + const int NUMBER_PLAN_DATA = 3; + /** + * CCITT F.69 + */ + const int NUMBER_PLAN_TELEX = 4; + const int NUMBER_PLAN_RESERVED_5 = 5; + const int NUMBER_PLAN_RESERVED_6 = 6; + const int NUMBER_PLAN_RESERVED_7 = 7; + const int NUMBER_PLAN_RESERVED_8 = 8; + const int NUMBER_PLAN_PRIVATE = 9; + const int NUMBER_PLAN_RESERVED_10 = 10; + const int NUMBER_PLAN_RESERVED_11 = 11; + const int NUMBER_PLAN_RESERVED_12 = 12; + const int NUMBER_PLAN_RESERVED_13 = 13; + const int NUMBER_PLAN_RESERVED_14 = 14; + const int NUMBER_PLAN_RESERVED_15 = 15; + + const int NUMBER_TYPE_UNKNOWN = 0; + /** + * INTERNATIONAL is used when number mode is not data network address. DATA_IP is used when the + * number mode is data network address. + */ + const int NUMBER_TYPE_INTERNATIONAL_OR_DATA_IP = 1; + /** + * NATIONAL is used when the number mode is not data netework address. INTERNET_MAIL is used + * when the number mode is data network address. For INTERNET_MAIL, in the address data + * "digits", each byte contains an ASCII character. Examples are: "x@y.com,a@b.com" + * Ref TIA/EIA-637A 3.4.3.3 + */ + const int NUMBER_TYPE_NATIONAL_OR_INTERNET_MAIL = 2; + const int NUMBER_TYPE_NETWORK = 3; + const int NUMBER_TYPE_SUBSCRIBER = 4; + /** + * GSM SMS: address value is GSM 7-bit chars + */ + const int NUMBER_TYPE_ALPHANUMERIC = 5; + const int NUMBER_TYPE_ABBREVIATED = 6; + const int NUMBER_TYPE_RESERVED_7 = 7; + /** * CdmaSmsDigitMode is of two types : 4 bit and 8 bit. * For 4-bit type, only "digits" field defined below in this struct is used. + * Values are DIGIT_MODE_ */ - CdmaSmsDigitMode digitMode; + int digitMode; /** * Used only when digitMode is 8-bit. */ - CdmaSmsNumberMode numberMode; + boolean isNumberModeDataNetwork; /** * Used only when digitMode is 8-bit. To specify an international address, use the following: - * digitMode = CdmaSmsDigitMode:EIGHT_BIT: - * numberMode = CdmaSmsNumberMode:NOT_DATA_NETWORK - * numberType = CdmaSmsNumberType:INTERNATIONAL_OR_DATA_IP - * numberPlan = CdmaSmsNumberPlan:TELEPHONY - * numberOfDigits = number of digits + * digitMode = EIGHT_BIT + * isNumberModeDataNetwork = true + * numberType = INTERNATIONAL_OR_DATA_IP + * numberPlan = TELEPHONY * digits = ASCII digits, e.g. '1', '2', '3', '4', and '5' + * Values are NUMBER_TYPE_ */ - CdmaSmsNumberType numberType; + int numberType; /** * Used only when digitMode is 8-bit. + * Values are NUMBER_PLAN_ */ - CdmaSmsNumberPlan numberPlan; + int numberPlan; /** * Each byte in this array represents a 4 bit or 8-bit digit of address data. */ diff --git a/radio/aidl/android/hardware/radio/CdmaSmsDigitMode.aidl b/radio/aidl/android/hardware/radio/CdmaSmsDigitMode.aidl deleted file mode 100644 index 662311dd06..0000000000 --- a/radio/aidl/android/hardware/radio/CdmaSmsDigitMode.aidl +++ /dev/null @@ -1,27 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CdmaSmsDigitMode { - /** - * DTMF digits - */ - FOUR_BIT, - EIGHT_BIT, -} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsErrorClass.aidl b/radio/aidl/android/hardware/radio/CdmaSmsErrorClass.aidl deleted file mode 100644 index ec8c74edcc..0000000000 --- a/radio/aidl/android/hardware/radio/CdmaSmsErrorClass.aidl +++ /dev/null @@ -1,24 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CdmaSmsErrorClass { - NO_ERROR, - ERROR, -} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsNumberMode.aidl b/radio/aidl/android/hardware/radio/CdmaSmsNumberMode.aidl deleted file mode 100644 index e1e96dd9f2..0000000000 --- a/radio/aidl/android/hardware/radio/CdmaSmsNumberMode.aidl +++ /dev/null @@ -1,24 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CdmaSmsNumberMode { - NOT_DATA_NETWORK, - DATA_NETWORK, -} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsNumberPlan.aidl b/radio/aidl/android/hardware/radio/CdmaSmsNumberPlan.aidl deleted file mode 100644 index 23dea9be9d..0000000000 --- a/radio/aidl/android/hardware/radio/CdmaSmsNumberPlan.aidl +++ /dev/null @@ -1,47 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CdmaSmsNumberPlan { - UNKNOWN, - /** - * CCITT E.164 and E.163, including ISDN plan - */ - TELEPHONY, - RESERVED_2, - /** - * CCITT X.121 - */ - DATA, - /** - * CCITT F.69 - */ - TELEX, - RESERVED_5, - RESERVED_6, - RESERVED_7, - RESERVED_8, - PRIVATE, - RESERVED_10, - RESERVED_11, - RESERVED_12, - RESERVED_13, - RESERVED_14, - RESERVED_15, -} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsNumberType.aidl b/radio/aidl/android/hardware/radio/CdmaSmsNumberType.aidl deleted file mode 100644 index e439d1fe7b..0000000000 --- a/radio/aidl/android/hardware/radio/CdmaSmsNumberType.aidl +++ /dev/null @@ -1,43 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CdmaSmsNumberType { - UNKNOWN, - /** - * INTERNATIONAL is used when number mode is not data network address. DATA_IP is used when the - * number mode is data network address. - */ - INTERNATIONAL_OR_DATA_IP, - /** - * NATIONAL is used when the number mode is not data netework address. INTERNET_MAIL is used - * when the number mode is data network address. For INTERNET_MAIL, in the address data - * "digits", each byte contains an ASCII character. Examples are: "x@y.com,a@b.com" - * Ref TIA/EIA-637A 3.4.3.3 - */ - NATIONAL_OR_INTERNET_MAIL, - NETWORK, - SUBSCRIBER, - /** - * GSM SMS: address value is GSM 7-bit chars - */ - ALPHANUMERIC, - ABBREVIATED, - RESERVED_7, -} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsSubaddress.aidl b/radio/aidl/android/hardware/radio/CdmaSmsSubaddress.aidl index 4a84c792be..e5d749408b 100644 --- a/radio/aidl/android/hardware/radio/CdmaSmsSubaddress.aidl +++ b/radio/aidl/android/hardware/radio/CdmaSmsSubaddress.aidl @@ -16,11 +16,21 @@ package android.hardware.radio; -import android.hardware.radio.CdmaSmsSubaddressType; - @VintfStability parcelable CdmaSmsSubaddress { - CdmaSmsSubaddressType subaddressType; + /** + * CCITT X.213 or ISO 8348 AD2 + */ + const int SUBADDRESS_TYPE_NSAP = 0; + /** + * e.g. X.25 + */ + const int SUBADDRESS_TYPE_USER_SPECIFIED = 1; + + /** + * Values are SUBADDRESS_TYPE_ + */ + int subaddressType; /** * True means the last byte's lower 4 bits must be ignored */ diff --git a/radio/aidl/android/hardware/radio/CdmaSmsSubaddressType.aidl b/radio/aidl/android/hardware/radio/CdmaSmsSubaddressType.aidl deleted file mode 100644 index 60aa37bd8a..0000000000 --- a/radio/aidl/android/hardware/radio/CdmaSmsSubaddressType.aidl +++ /dev/null @@ -1,30 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CdmaSmsSubaddressType { - /** - * CCITT X.213 or ISO 8348 AD2 - */ - NSAP, - /** - * e.g. X.25 - */ - USER_SPECIFIED, -} diff --git a/radio/aidl/android/hardware/radio/CdmaSmsWriteArgs.aidl b/radio/aidl/android/hardware/radio/CdmaSmsWriteArgs.aidl index f613e392b6..57896f4ef0 100644 --- a/radio/aidl/android/hardware/radio/CdmaSmsWriteArgs.aidl +++ b/radio/aidl/android/hardware/radio/CdmaSmsWriteArgs.aidl @@ -17,13 +17,18 @@ package android.hardware.radio; import android.hardware.radio.CdmaSmsMessage; -import android.hardware.radio.CdmaSmsWriteArgsStatus; @VintfStability parcelable CdmaSmsWriteArgs { + const int STATUS_REC_UNREAD = 0; + const int STATUS_REC_READ = 1; + const int STATUS_STO_UNSENT = 2; + const int STATUS_STO_SENT = 3; + /** * Status of message. See TS 27.005 3.1 + * Values are STATUS_ */ - CdmaSmsWriteArgsStatus status; + int status; CdmaSmsMessage message; } diff --git a/radio/aidl/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl b/radio/aidl/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl deleted file mode 100644 index 009e8a913f..0000000000 --- a/radio/aidl/android/hardware/radio/CdmaSmsWriteArgsStatus.aidl +++ /dev/null @@ -1,26 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum CdmaSmsWriteArgsStatus { - REC_UNREAD, - REC_READ, - STO_UNSENT, - STO_SENT, -} diff --git a/radio/aidl/android/hardware/radio/CellIdentityLte.aidl b/radio/aidl/android/hardware/radio/CellIdentityLte.aidl index f7f8fef663..1a261a648f 100644 --- a/radio/aidl/android/hardware/radio/CellIdentityLte.aidl +++ b/radio/aidl/android/hardware/radio/CellIdentityLte.aidl @@ -17,8 +17,8 @@ package android.hardware.radio; import android.hardware.radio.CellIdentityOperatorNames; +import android.hardware.radio.ClosedSubscriberGroupInfo; import android.hardware.radio.EutranBands; -import android.hardware.radio.OptionalCsgInfo; @VintfStability parcelable CellIdentityLte { @@ -58,7 +58,7 @@ parcelable CellIdentityLte { /** * Information about any closed subscriber group ID for this cell */ - OptionalCsgInfo optionalCsgInfo; + @nullable ClosedSubscriberGroupInfo csgInfo; /** * Bands used by the cell. */ diff --git a/radio/aidl/android/hardware/radio/CellIdentityTdscdma.aidl b/radio/aidl/android/hardware/radio/CellIdentityTdscdma.aidl index 8268bba14a..8232245833 100644 --- a/radio/aidl/android/hardware/radio/CellIdentityTdscdma.aidl +++ b/radio/aidl/android/hardware/radio/CellIdentityTdscdma.aidl @@ -17,7 +17,7 @@ package android.hardware.radio; import android.hardware.radio.CellIdentityOperatorNames; -import android.hardware.radio.OptionalCsgInfo; +import android.hardware.radio.ClosedSubscriberGroupInfo; @VintfStability parcelable CellIdentityTdscdma { @@ -53,5 +53,5 @@ parcelable CellIdentityTdscdma { /** * Information about any closed subscriber group ID for this cell. */ - OptionalCsgInfo optionalCsgInfo; + @nullable ClosedSubscriberGroupInfo csgInfo; } diff --git a/radio/aidl/android/hardware/radio/CellIdentityWcdma.aidl b/radio/aidl/android/hardware/radio/CellIdentityWcdma.aidl index 667c15b65c..3432747943 100644 --- a/radio/aidl/android/hardware/radio/CellIdentityWcdma.aidl +++ b/radio/aidl/android/hardware/radio/CellIdentityWcdma.aidl @@ -17,7 +17,7 @@ package android.hardware.radio; import android.hardware.radio.CellIdentityOperatorNames; -import android.hardware.radio.OptionalCsgInfo; +import android.hardware.radio.ClosedSubscriberGroupInfo; @VintfStability parcelable CellIdentityWcdma { @@ -53,5 +53,5 @@ parcelable CellIdentityWcdma { /** * Information about any closed subscriber group ID for this cell. */ - OptionalCsgInfo optionalCsgInfo; + @nullable ClosedSubscriberGroupInfo csgInfo; } diff --git a/radio/aidl/android/hardware/radio/Clir.aidl b/radio/aidl/android/hardware/radio/Clir.aidl deleted file mode 100644 index a13ff9da3e..0000000000 --- a/radio/aidl/android/hardware/radio/Clir.aidl +++ /dev/null @@ -1,34 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum Clir { - /** - * Use subscription default value - */ - DEFAULT, - /** - * Restrict CLI presentation - */ - INVOCATION, - /** - * Allow CLI presentation - */ - SUPPRESSION, -} diff --git a/radio/aidl/android/hardware/radio/DataConnActiveStatus.aidl b/radio/aidl/android/hardware/radio/DataConnActiveStatus.aidl deleted file mode 100644 index 1e837275d0..0000000000 --- a/radio/aidl/android/hardware/radio/DataConnActiveStatus.aidl +++ /dev/null @@ -1,37 +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. - */ - -package android.hardware.radio; - -/** - * Data connection active status - */ -@VintfStability -@Backing(type="int") -enum DataConnActiveStatus { - /** - * Indicates the data connection is inactive. - */ - INACTIVE, - /** - * Indicates the data connection is active with physical link dormant. - */ - DORMANT, - /** - * Indicates the data connection is active with physical link up. - */ - ACTIVE, -} diff --git a/radio/aidl/android/hardware/radio/DataProfileId.aidl b/radio/aidl/android/hardware/radio/DataProfileId.aidl deleted file mode 100644 index f173f1f1e4..0000000000 --- a/radio/aidl/android/hardware/radio/DataProfileId.aidl +++ /dev/null @@ -1,32 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum DataProfileId { - DEFAULT = 0, - TETHERED = 1, - IMS = 2, - FOTA = 3, - CBS = 4, - /** - * Start of OEM-specific profiles - */ - OEM_BASE = 1000, - INVALID = 0xFFFFFFFF, -} diff --git a/radio/aidl/android/hardware/radio/DataProfileInfo.aidl b/radio/aidl/android/hardware/radio/DataProfileInfo.aidl index 5e2d4d20b9..2f7bbb19e0 100644 --- a/radio/aidl/android/hardware/radio/DataProfileInfo.aidl +++ b/radio/aidl/android/hardware/radio/DataProfileInfo.aidl @@ -18,17 +18,31 @@ package android.hardware.radio; import android.hardware.radio.ApnAuthType; import android.hardware.radio.ApnTypes; -import android.hardware.radio.DataProfileId; -import android.hardware.radio.DataProfileInfoType; import android.hardware.radio.PdpProtocolType; import android.hardware.radio.RadioAccessFamily; @VintfStability parcelable DataProfileInfo { + const int ID_DEFAULT = 0; + const int ID_TETHERED = 1; + const int ID_IMS = 2; + const int ID_FOTA = 3; + const int ID_CBS = 4; + /** + * Start of OEM-specific profiles + */ + const int ID_OEM_BASE = 1000; + const int ID_INVALID = 0xFFFFFFFF; + + const int TYPE_COMMON = 0; + const int TYPE_THREE_GPP = 1; + const int TYPE_THREE_GPP2 = 2; + /** * ID of the data profile. + * Values are ID_ */ - DataProfileId profileId; + int profileId; /** * The APN name. */ @@ -55,8 +69,9 @@ parcelable DataProfileInfo { String password; /** * Data profile technology type. + * Values are TYPE_ */ - DataProfileInfoType type; + int type; /** * The period in seconds to limit the maximum connections. */ diff --git a/radio/aidl/android/hardware/radio/DataProfileInfoType.aidl b/radio/aidl/android/hardware/radio/DataProfileInfoType.aidl deleted file mode 100644 index df46ef39fe..0000000000 --- a/radio/aidl/android/hardware/radio/DataProfileInfoType.aidl +++ /dev/null @@ -1,25 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum DataProfileInfoType { - COMMON, - THREE_GPP, - THREE_GPP2, -} diff --git a/radio/aidl/android/hardware/radio/DataRegStateResult.aidl b/radio/aidl/android/hardware/radio/DataRegStateResult.aidl index 53a3e52e85..dcc39c8032 100644 --- a/radio/aidl/android/hardware/radio/DataRegStateResult.aidl +++ b/radio/aidl/android/hardware/radio/DataRegStateResult.aidl @@ -17,7 +17,7 @@ package android.hardware.radio; import android.hardware.radio.CellIdentity; -import android.hardware.radio.DataRegStateResultVopsInfo; +import android.hardware.radio.LteVopsInfo; import android.hardware.radio.NrIndicators; import android.hardware.radio.RegState; @@ -54,7 +54,7 @@ parcelable DataRegStateResult { * must be present when device is camped on LTE. vopsInfo must be empty when device is camped * only on 2G/3G. */ - DataRegStateResultVopsInfo vopsInfo; + @nullable LteVopsInfo lteVopsInfo; /** * The parameters of NR 5G Non-Standalone. This value is only valid on E-UTRAN, otherwise * must be empty. diff --git a/radio/aidl/android/hardware/radio/DataRegStateResultVopsInfo.aidl b/radio/aidl/android/hardware/radio/DataRegStateResultVopsInfo.aidl deleted file mode 100644 index 885d5b2395..0000000000 --- a/radio/aidl/android/hardware/radio/DataRegStateResultVopsInfo.aidl +++ /dev/null @@ -1,28 +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. - */ - -package android.hardware.radio; - -import android.hardware.radio.LteVopsInfo; - -@VintfStability -union DataRegStateResultVopsInfo { - boolean noinit; - /** - * LTE network capability - */ - LteVopsInfo lteVopsInfo; -} diff --git a/radio/aidl/android/hardware/radio/Dial.aidl b/radio/aidl/android/hardware/radio/Dial.aidl index 90568158ed..f4097ff696 100644 --- a/radio/aidl/android/hardware/radio/Dial.aidl +++ b/radio/aidl/android/hardware/radio/Dial.aidl @@ -16,13 +16,28 @@ package android.hardware.radio; -import android.hardware.radio.Clir; import android.hardware.radio.UusInfo; @VintfStability parcelable Dial { + /** + * Use subscription default value + */ + const int CLIR_DEFAULT = 0; + /** + * Restrict CLI presentation + */ + const int CLIR_INVOCATION = 1; + /** + * Allow CLI presentation + */ + const int CLIR_SUPPRESSION = 2; + String address; - Clir clir; + /** + * Values are CLIR_ + */ + int clir; /** * Vector of User-User Signaling Information */ diff --git a/radio/aidl/android/hardware/radio/EmcIndicator.aidl b/radio/aidl/android/hardware/radio/EmcIndicator.aidl deleted file mode 100644 index 6f0b19fdba..0000000000 --- a/radio/aidl/android/hardware/radio/EmcIndicator.aidl +++ /dev/null @@ -1,41 +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. - */ - -package android.hardware.radio; - -/** - * Defines the values for emergency service indicator of NR as per 3gpp spec 24.501 sec 9.10.3.5 - */ -@VintfStability -@Backing(type="byte") -enum EmcIndicator { - /** - * Emergency services not supported - */ - EMC_NOT_SUPPORTED, - /** - * Emergency services supported in NR connected to 5GCN only - */ - EMC_NR_CONNECTED_TO_5GCN, - /** - * Emergency services supported in E-UTRA connected to 5GCN only - */ - EMC_EUTRA_CONNECTED_TO_5GCN, - /** - * Emergency services supported in NR connected to 5GCN and E-UTRA connected to 5GCN - */ - EMC_BOTH_NR_EUTRA_CONNECTED_TO_5GCN, -} diff --git a/radio/aidl/android/hardware/radio/EmergencyNumber.aidl b/radio/aidl/android/hardware/radio/EmergencyNumber.aidl index ee425f87a1..152be90fdf 100644 --- a/radio/aidl/android/hardware/radio/EmergencyNumber.aidl +++ b/radio/aidl/android/hardware/radio/EmergencyNumber.aidl @@ -16,7 +16,6 @@ package android.hardware.radio; -import android.hardware.radio.EmergencyNumberSource; import android.hardware.radio.EmergencyServiceCategory; /** @@ -43,6 +42,25 @@ import android.hardware.radio.EmergencyServiceCategory; */ @VintfStability parcelable EmergencyNumber { + /** + * Indicates the number is from the network signal. + */ + const int SOURCE_NETWORK_SIGNALING = 1 << 0; + /** + * Indicates the number is from the sim card. + */ + const int SOURCE_SIM = 1 << 1; + /** + * Indicates the number is from the modem config. + */ + const int SOURCE_MODEM_CONFIG = 1 << 2; + /** + * Indicates the number is available as default. Per the reference, 112, 911 must always be + * available; additionally, 000, 08, 110, 999, 118 and 119 must be available when sim is not + * present. + */ + const int SOURCE_DEFAULT = 1 << 3; + /** * The emergency number. The character in the number string should only be the dial pad * character('0'-'9', '*', or '#'). For example: 911. @@ -66,8 +84,9 @@ parcelable EmergencyNumber { */ String[] urns; /** - * The bitfield of EmergencyNumberSource(s). See EmergencyNumberSource for the value of - * each bit. + * The bitfield of EmergencyNumberSource(s) to tell where the EmergencyNumber comes from. + * Reference: 3gpp 22.101, Section 10 - Emergency Calls + * Values are SOURCE_ */ - EmergencyNumberSource sources; + int sources; } diff --git a/radio/aidl/android/hardware/radio/EmergencyNumberSource.aidl b/radio/aidl/android/hardware/radio/EmergencyNumberSource.aidl deleted file mode 100644 index c2d6547d64..0000000000 --- a/radio/aidl/android/hardware/radio/EmergencyNumberSource.aidl +++ /dev/null @@ -1,44 +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. - */ - -package android.hardware.radio; - -/** - * The source to tell where the corresponding EmergencyNumber comes from. - * Reference: 3gpp 22.101, Section 10 - Emergency Calls - */ -@VintfStability -@Backing(type="int") -enum EmergencyNumberSource { - /** - * Indicates the number is from the network signal. - */ - NETWORK_SIGNALING = 1 << 0, - /** - * Indicates the number is from the sim card. - */ - SIM = 1 << 1, - /** - * Indicates the number is from the modem config. - */ - MODEM_CONFIG = 1 << 2, - /** - * Indicates the number is available as default. Per the reference, 112, 911 must always be - * available; additionally, 000, 08, 110, 999, 118 and 119 must be available when sim is not - * present. - */ - DEFAULT = 1 << 3, -} diff --git a/radio/aidl/android/hardware/radio/EmfIndicator.aidl b/radio/aidl/android/hardware/radio/EmfIndicator.aidl deleted file mode 100644 index 226e6844fc..0000000000 --- a/radio/aidl/android/hardware/radio/EmfIndicator.aidl +++ /dev/null @@ -1,41 +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. - */ - -package android.hardware.radio; - -/** - * Defines the values for emergency service fallback indicator of NR as per TS 24.501 sec 9.10.3.5. - */ -@VintfStability -@Backing(type="byte") -enum EmfIndicator { - /** - * Emergency services fallback not supported - */ - EMF_NOT_SUPPORTED, - /** - * Emergency services fallback supported in NR connected to 5GCN only - */ - EMF_NR_CONNECTED_TO_5GCN, - /** - * Emergency services fallback supported in E-UTRA connected to 5GCN only - */ - EMF_EUTRA_CONNECTED_TO_5GCN, - /** - * Emergency services fallback supported in NR connected to 5GCN and E-UTRA connected to 5GCN. - */ - EMF_BOTH_NR_EUTRA_CONNECTED_TO_5GCN, -} diff --git a/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl b/radio/aidl/android/hardware/radio/EutranRegistrationInfo.aidl similarity index 93% rename from radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl rename to radio/aidl/android/hardware/radio/EutranRegistrationInfo.aidl index 5b942f4aa4..0f8f949b9d 100644 --- a/radio/aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.aidl +++ b/radio/aidl/android/hardware/radio/EutranRegistrationInfo.aidl @@ -20,7 +20,7 @@ import android.hardware.radio.LteVopsInfo; import android.hardware.radio.NrIndicators; @VintfStability -parcelable RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo { +parcelable EutranRegistrationInfo { /** * Network capabilities for voice over PS services. This info is valid only on LTE network and * must be present when device is camped on LTE. VopsInfo must be empty when device is camped diff --git a/radio/aidl/android/hardware/radio/FrequencyRange.aidl b/radio/aidl/android/hardware/radio/FrequencyRange.aidl deleted file mode 100644 index 09ec3bc1a7..0000000000 --- a/radio/aidl/android/hardware/radio/FrequencyRange.aidl +++ /dev/null @@ -1,41 +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. - */ - -package android.hardware.radio; - -/** - * Mapping the frequency to a rough range. - */ -@VintfStability -@Backing(type="int") -enum FrequencyRange { - /** - * Indicates the frequency range is below 1GHz. - */ - LOW = 1, - /** - * Indicates the frequency range is between 1GHz and 3GHz. - */ - MID = 2, - /** - * Indicates the frequency range is between 3GHz and 6GHz. - */ - HIGH = 3, - /** - * Indicates the frequency range is above 6GHz (millimeter wave frequency). - */ - MMWAVE = 4, -} diff --git a/radio/aidl/android/hardware/radio/HandoverFailureMode.aidl b/radio/aidl/android/hardware/radio/HandoverFailureMode.aidl deleted file mode 100644 index f6918a8bd6..0000000000 --- a/radio/aidl/android/hardware/radio/HandoverFailureMode.aidl +++ /dev/null @@ -1,44 +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. - */ - -package android.hardware.radio; - -/** - * The allowed failure modes on an IWLAN handover failure. - */ -@VintfStability -@Backing(type="byte") -enum HandoverFailureMode { - /** - * On data handover failure, fallback to the source data transport when the fail cause is due - * to a hand off preference change. - */ - LEGACY, - /** - * On data handover failure, fallback to the source data transport. - */ - DO_FALLBACK, - /** - * On data handover failure, retry the handover instead of falling back to the source data - * transport. - */ - NO_FALLBACK_RETRY_HANDOVER, - /** - * On data handover failure, setup a new data connection by sending a normal request to the - * underlying data service. - */ - NO_FALLBACK_RETRY_SETUP_NORMAL, -} diff --git a/radio/aidl/android/hardware/radio/HardwareConfig.aidl b/radio/aidl/android/hardware/radio/HardwareConfig.aidl index d3902afcce..59850ad22e 100644 --- a/radio/aidl/android/hardware/radio/HardwareConfig.aidl +++ b/radio/aidl/android/hardware/radio/HardwareConfig.aidl @@ -18,17 +18,28 @@ package android.hardware.radio; import android.hardware.radio.HardwareConfigModem; import android.hardware.radio.HardwareConfigSim; -import android.hardware.radio.HardwareConfigState; -import android.hardware.radio.HardwareConfigType; @VintfStability parcelable HardwareConfig { - HardwareConfigType type; + const int STATE_ENABLED = 0; + const int STATE_STANDBY = 1; + const int STATE_DISABLED = 2; + + const int TYPE_MODEM = 0; + const int TYPE_SIM = 1; + + /** + * Values are TYPE_ + */ + int type; /** * RadioConst:MAX_UUID_LENGTH is max length of the string */ String uuid; - HardwareConfigState state; + /** + * Values are STATE_ + */ + int state; /** * Valid only if type is Modem and size = 1 else must be empty. Only one of modem or sim must * have size = 1 based on the HardwareConfigType, and the other must have size = 0. diff --git a/radio/aidl/android/hardware/radio/HardwareConfigModem.aidl b/radio/aidl/android/hardware/radio/HardwareConfigModem.aidl index ef348d6699..8e3bc473f8 100644 --- a/radio/aidl/android/hardware/radio/HardwareConfigModem.aidl +++ b/radio/aidl/android/hardware/radio/HardwareConfigModem.aidl @@ -18,12 +18,31 @@ package android.hardware.radio; @VintfStability parcelable HardwareConfigModem { + /** + * RIL attachment model. Values are: + * 0: single + * 1: multiple + * If single, there is a one-to-one relationship between a modem hardware and a ril daemon. + * If multiple, there is a one-to-many relationship between a modem hardware and several + * simultaneous ril daemons. + */ int rilModel; /** - * bitset - ref. RadioTechnology. + * Bitset value, based on RadioTechnology. */ int rat; + /** + * Maximum number of concurrent active voice calls. + */ int maxVoice; + /** + * Maximum number of concurrent active data calls. + */ int maxData; + /** + * Maximum number of concurrent standby connections. This is not necessarily an equal sum of the + * maxVoice and maxData (or a derivative of it) since it really depends on the modem capability, + * hence it is left for the hardware to define. + */ int maxStandby; } diff --git a/radio/aidl/android/hardware/radio/HardwareConfigState.aidl b/radio/aidl/android/hardware/radio/HardwareConfigState.aidl deleted file mode 100644 index 05c806d52a..0000000000 --- a/radio/aidl/android/hardware/radio/HardwareConfigState.aidl +++ /dev/null @@ -1,25 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum HardwareConfigState { - ENABLED, - STANDBY, - DISABLED, -} diff --git a/radio/aidl/android/hardware/radio/HardwareConfigType.aidl b/radio/aidl/android/hardware/radio/HardwareConfigType.aidl deleted file mode 100644 index 5605c2b802..0000000000 --- a/radio/aidl/android/hardware/radio/HardwareConfigType.aidl +++ /dev/null @@ -1,24 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum HardwareConfigType { - MODEM, - SIM, -} diff --git a/radio/aidl/android/hardware/radio/IRadio.aidl b/radio/aidl/android/hardware/radio/IRadio.aidl index 352cbfbaa8..ebf3c9b565 100644 --- a/radio/aidl/android/hardware/radio/IRadio.aidl +++ b/radio/aidl/android/hardware/radio/IRadio.aidl @@ -20,7 +20,6 @@ import android.hardware.radio.AccessNetwork; import android.hardware.radio.CallForwardInfo; import android.hardware.radio.CardPowerState; import android.hardware.radio.CarrierRestrictions; -import android.hardware.radio.CarrierRestrictionsWithPriority; import android.hardware.radio.CdmaBroadcastSmsConfigInfo; import android.hardware.radio.CdmaRoamingType; import android.hardware.radio.CdmaSmsAck; @@ -48,8 +47,6 @@ import android.hardware.radio.NetworkScanRequest; import android.hardware.radio.NrDualConnectivityState; import android.hardware.radio.NvItem; import android.hardware.radio.NvWriteItem; -import android.hardware.radio.OptionalSliceInfo; -import android.hardware.radio.OptionalTrafficDescriptor; import android.hardware.radio.PersoSubstate; import android.hardware.radio.PhonebookRecordInfo; import android.hardware.radio.PreferredNetworkType; @@ -64,8 +61,10 @@ import android.hardware.radio.SelectUiccSub; import android.hardware.radio.SignalThresholdInfo; import android.hardware.radio.SimApdu; import android.hardware.radio.SimLockMultiSimPolicy; +import android.hardware.radio.SliceInfo; import android.hardware.radio.SmsAcknowledgeFailCause; import android.hardware.radio.SmsWriteArgs; +import android.hardware.radio.TrafficDescriptor; import android.hardware.radio.TtyMode; /** @@ -77,7 +76,7 @@ import android.hardware.radio.TtyMode; * setResponseFunctions must work with IRadioResponse and IRadioIndication. */ @VintfStability -interface IRadio { +oneway interface IRadio { /** * Answer incoming call. Must not be called for WAITING calls. * switchWaitingOrHoldingAndActive() must be used in this case instead @@ -86,7 +85,7 @@ interface IRadio { * * Response function is IRadioResponse.acceptCallResponse() */ - oneway void acceptCall(in int serial); + void acceptCall(in int serial); /** * Acknowledge successful or failed receipt of SMS previously indicated via unsol @@ -100,8 +99,7 @@ interface IRadio { * * Response callback is IRadioResponse.acknowledgeIncomingGsmSmsWithPduResponse() */ - oneway void acknowledgeIncomingGsmSmsWithPdu( - in int serial, in boolean success, in String ackPdu); + void acknowledgeIncomingGsmSmsWithPdu(in int serial, in boolean success, in String ackPdu); /** * Acknowledge the success or failure in the receipt of SMS previously indicated @@ -112,7 +110,7 @@ interface IRadio { * * Response callback is IRadioResponse.acknowledgeLastIncomingCdmaSmsResponse() */ - oneway void acknowledgeLastIncomingCdmaSms(in int serial, in CdmaSmsAck smsAck); + void acknowledgeLastIncomingCdmaSms(in int serial, in CdmaSmsAck smsAck); /** * Acknowledge successful or failed receipt of SMS previously indicated via unsolResponseNewSms @@ -126,7 +124,7 @@ interface IRadio { * * Response function is IRadioResponse.acknowledgeLastIncomingGsmSmsResponse() */ - oneway void acknowledgeLastIncomingGsmSms( + void acknowledgeLastIncomingGsmSms( in int serial, in boolean success, in SmsAcknowledgeFailCause cause); /** @@ -140,7 +138,7 @@ interface IRadio { * * Response function is IRadioResponse.allocatePduSessionIdResponse() */ - oneway void allocatePduSessionId(in int serial); + void allocatePduSessionId(in int serial); /** * Whether uiccApplications are enabled, or disabled. @@ -151,7 +149,7 @@ interface IRadio { * * Response callback is IRadioResponse.areUiccApplicationsEnabledResponse() */ - oneway void areUiccApplicationsEnabled(in int serial); + void areUiccApplicationsEnabled(in int serial); /** * Indicates that a handover was cancelled after a call to IRadio::startHandover. @@ -163,7 +161,7 @@ interface IRadio { * * Response function is IRadioResponse.cancelHandoverResponse() */ - oneway void cancelHandover(in int serial, in int callId); + void cancelHandover(in int serial, in int callId); /** * Cancel the current USSD session if one exists. @@ -172,7 +170,7 @@ interface IRadio { * * Response function is IRadioResponse.cancelPendingUssdResponse() */ - oneway void cancelPendingUssd(in int serial); + void cancelPendingUssd(in int serial); /** * Supplies old ICC PIN2 and new PIN2. @@ -184,8 +182,7 @@ interface IRadio { * * Response function is IRadioResponse.changeIccPin2ForAppResponse() */ - oneway void changeIccPin2ForApp( - in int serial, in String oldPin2, in String newPin2, in String aid); + void changeIccPin2ForApp(in int serial, in String oldPin2, in String newPin2, in String aid); /** * Supplies old ICC PIN and new PIN. @@ -197,8 +194,7 @@ interface IRadio { * * Response function is IRadioResponse.changeIccPinForAppResponse() */ - oneway void changeIccPinForApp( - in int serial, in String oldPin, in String newPin, in String aid); + void changeIccPinForApp(in int serial, in String oldPin, in String newPin, in String aid); /** * Conference holding and active (like AT+CHLD=3) @@ -207,7 +203,7 @@ interface IRadio { * * Response function is IRadioResponse.conferenceResponse() */ - oneway void conference(in int serial); + void conference(in int serial); /** * Deactivate packet data connection and remove from the data call list. An @@ -219,7 +215,7 @@ interface IRadio { * * Response function is IRadioResponse.deactivateDataCallResponse() */ - oneway void deactivateDataCall(in int serial, in int cid, in DataRequestReason reason); + void deactivateDataCall(in int serial, in int cid, in DataRequestReason reason); /** * Deletes a CDMA SMS message from RUIM memory. @@ -229,7 +225,7 @@ interface IRadio { * * Response callback is IRadioResponse.deleteSmsOnRuimResponse() */ - oneway void deleteSmsOnRuim(in int serial, in int index); + void deleteSmsOnRuim(in int serial, in int index); /** * Deletes a SMS message from SIM memory. @@ -239,7 +235,7 @@ interface IRadio { * * Response function is IRadioResponse.deleteSmsOnSimResponse() */ - oneway void deleteSmsOnSim(in int serial, in int index); + void deleteSmsOnSim(in int serial, in int index); /** * Initiate voice call. This method is never used for supplementary service codes. @@ -249,35 +245,35 @@ interface IRadio { * * Response function is IRadioResponse.dialResponse() */ - oneway void dial(in int serial, in Dial dialInfo); + void dial(in int serial, in Dial dialInfo); /** * Initiate emergency voice call, with zero or more emergency service category(s), zero or * more emergency Uniform Resource Names (URN), and routing information for handling the call. - * Android uses this request to make its emergency call instead of using @1.0::IRadio.dial - * if the 'address' in the 'dialInfo' field is identified as an emergency number by Android. + * Android uses this request to make its emergency call instead of using IRadio.dial if the + * 'address' in the 'dialInfo' field is identified as an emergency number by Android. * * In multi-sim scenario, if the emergency number is from a specific subscription, this radio * request can still be sent out on the other subscription as long as routing is set to - * @1.4::EmergencyNumberRouting#EMERGENCY. This radio request will not be sent on an inactive + * EmergencyNumberRouting#EMERGENCY. This radio request will not be sent on an inactive * (PIN/PUK locked) subscription unless both subscriptions are PIN/PUK locked. In this case, * the request will be sent on the primary subscription. * * Some countries or carriers require some emergency numbers that must be handled with normal * call routing if possible or emergency routing. 1) if the 'routing' field is specified as - * @1.4::EmergencyNumberRouting#NORMAL, the implementation must try the full radio service to - * use normal call routing to handle the call; if service cannot support normal routing, the + * EmergencyNumberRouting#NORMAL, the implementation must try the full radio service to use + * normal call routing to handle the call; if service cannot support normal routing, the * implementation must use emergency routing to handle the call. 2) if 'routing' is specified - * as @1.4::EmergencyNumberRouting#EMERGENCY, the implementation must use emergency routing to - * handle the call. 3) if 'routing' is specified as @1.4::EmergencyNumberRouting#UNKNOWN, - * Android does not know how to handle the call. + * as EmergencyNumberRouting#EMERGENCY, the implementation must use emergency routing to handle + * the call. 3) if 'routing' is specified as EmergencyNumberRouting#UNKNOWN, Android does not + * know how to handle the call. * * If the dialed emergency number does not have a specified emergency service category, the - * 'categories' field is set to @1.4::EmergencyServiceCategory#UNSPECIFIED; if the dialed - * emergency number does not have specified emergency Uniform Resource Names, the 'urns' field - * is set to an empty list. If the underlying technology used to request emergency services - * does not support the emergency service category or emergency uniform resource names, the - * field 'categories' or 'urns' may be ignored. + * 'categories' field is set to EmergencyServiceCategory#UNSPECIFIED; if the dialed emergency + * number does not have specified emergency Uniform Resource Names, the 'urns' field is set to + * an empty list. If the underlying technology used to request emergency services does not + * support the emergency service category or emergency uniform resource names, the field + * 'categories' or 'urns' may be ignored. * * In the scenarios that the 'address' in the 'dialInfo' field has other functions besides the * emergency number function, if the 'hasKnownUserIntentEmergency' field is true, the user's @@ -294,24 +290,23 @@ interface IRadio { * RFC 5031 * * @param serial Serial number of request. - * @param dialInfo the same @1.0::Dial information used by @1.0::IRadio.dial. - * @param categories bitfield<@1.4::EmergencyServiceCategory> the Emergency Service Category(s) + * @param dialInfo the same Dial information used by IRadio.dial. + * @param categories bitfield the Emergency Service Category(s) * of the call. * @param urns the emergency Uniform Resource Names (URN) - * @param routing @1.4::EmergencyCallRouting the emergency call routing information. + * @param routing EmergencyCallRouting the emergency call routing information. * @param hasKnownUserIntentEmergency Flag indicating if user's intent for the emergency call * is known. * @param isTesting Flag indicating if this request is for testing purpose. * * Response function is IRadioResponse.emergencyDialResponse() */ - oneway void emergencyDial(in int serial, in Dial dialInfo, - in EmergencyServiceCategory categories, in String[] urns, - in EmergencyCallRouting routing, in boolean hasKnownUserIntentEmergency, - in boolean isTesting); + void emergencyDial(in int serial, in Dial dialInfo, in EmergencyServiceCategory categories, + in String[] urns, in EmergencyCallRouting routing, + in boolean hasKnownUserIntentEmergency, in boolean isTesting); /** - * Toggle logical modem on/off. This is similar to @1.0::IRadio.setRadioPower(), however that + * Toggle logical modem on/off. This is similar to IRadio.setRadioPower(), however that * does not enforce that radio power is toggled only for the corresponding radio and certain * vendor implementations do it for all radios. This new API should affect only the modem for * which it is called. A modem stack must be on/active only when both setRadioPower() and @@ -324,7 +319,7 @@ interface IRadio { * * Response function is IRadioResponse.enableModemResponse() */ - oneway void enableModem(in int serial, in boolean on); + void enableModem(in int serial, in boolean on); /** * Enable or disable UiccApplications on the SIM. If disabled: @@ -342,7 +337,7 @@ interface IRadio { * * Response callback is IRadioResponse.enableUiccApplicationsResponse() */ - oneway void enableUiccApplications(in int serial, in boolean enable); + void enableUiccApplications(in int serial, in boolean enable); /** * Request the radio's system selection module to exit emergency callback mode. Radio must not @@ -352,7 +347,7 @@ interface IRadio { * * Response callback is IRadioResponse.exitEmergencyCallbackModeResponse() */ - oneway void exitEmergencyCallbackMode(in int serial); + void exitEmergencyCallbackMode(in int serial); /** * Connects the two calls and disconnects the subscriber from both calls. @@ -361,16 +356,16 @@ interface IRadio { * * Response callback is IRadioResponse.explicitCallTransferResponse() */ - oneway void explicitCallTransfer(in int serial); + void explicitCallTransfer(in int serial); /** * Get carrier restrictions. * * @param serial Serial number of request. * - * Response callback is IRadioResponse.getAllowedCarriersResponse_1_4() + * Response callback is IRadioResponse.getAllowedCarriersResponse() */ - oneway void getAllowedCarriers(in int serial); + void getAllowedCarriers(in int serial); /** * Requests bitmap representing the currently allowed network types. @@ -381,7 +376,7 @@ interface IRadio { * * Response callback is IRadioResponse.getAllowedNetworkTypesBitmapResponse() */ - oneway void getAllowedNetworkTypesBitmap(in int serial); + void getAllowedNetworkTypesBitmap(in int serial); /** * Get the list of band modes supported by RF. @@ -390,7 +385,7 @@ interface IRadio { * * Response function is IRadioResponse.getAvailableBandModesResponse() */ - oneway void getAvailableBandModes(in int serial); + void getAvailableBandModes(in int serial); /** * Scans for available networks @@ -399,7 +394,7 @@ interface IRadio { * * Response function is IRadioResponse.getAvailableNetworksResponse() */ - oneway void getAvailableNetworks(in int serial); + void getAvailableNetworks(in int serial); /** * Get all the barring info for the current camped cell applicable to the current user. @@ -408,7 +403,7 @@ interface IRadio { * * Response callback is IRadioResponse.getBarringInfoResponse() */ - oneway void getBarringInfo(in int serial); + void getBarringInfo(in int serial); /** * Return string value indicating baseband version, eg response from AT+CGMR @@ -417,7 +412,7 @@ interface IRadio { * * Response function is IRadioResponse.getBasebandVersionResponse() */ - oneway void getBasebandVersion(in int serial); + void getBasebandVersion(in int serial); /** * Request the device MDN / H_SID / H_NID. The request is only allowed when CDMA subscription @@ -428,7 +423,7 @@ interface IRadio { * * Response callback is IRadioResponse.getCDMASubscriptionResponse() */ - oneway void getCDMASubscription(in int serial); + void getCDMASubscription(in int serial); /** * Request call forward status. @@ -438,7 +433,7 @@ interface IRadio { * * Response function is IRadioResponse.getCallForwardStatusResponse() */ - oneway void getCallForwardStatus(in int serial, in CallForwardInfo callInfo); + void getCallForwardStatus(in int serial, in CallForwardInfo callInfo); /** * Query current call waiting state @@ -448,7 +443,7 @@ interface IRadio { * * Response function is IRadioResponse.getCallWaitingResponse() */ - oneway void getCallWaiting(in int serial, in int serviceClass); + void getCallWaiting(in int serial, in int serviceClass); /** * Request the setting of CDMA Broadcast SMS config @@ -457,7 +452,7 @@ interface IRadio { * * Response callback is IRadioResponse.getCdmaBroadcastConfigResponse() */ - oneway void getCdmaBroadcastConfig(in int serial); + void getCdmaBroadcastConfig(in int serial); /** * Request the actual setting of the roaming preferences in CDMA in the modem @@ -466,7 +461,7 @@ interface IRadio { * * Response callback is IRadioResponse.getCdmaRoamingPreferenceResponse() */ - oneway void getCdmaRoamingPreference(in int serial); + void getCdmaRoamingPreference(in int serial); /** * Request to query the location where the CDMA subscription shall be retrieved. @@ -475,19 +470,19 @@ interface IRadio { * * Response callback is IRadioResponse.getCdmaSubscriptionSourceResponse() */ - oneway void getCdmaSubscriptionSource(in int serial); + void getCdmaSubscriptionSource(in int serial); /** - * Request all of the current cell information known to the radio. The radio - * must return list of all current cells, including the neighboring cells. If for a particular - * cell information isn't known then the appropriate unknown value will be returned. + * Request all of the current cell information known to the radio. The radio must return a list + * of all current cells, including the neighboring cells. If for a particular cell information + * isn't known then the appropriate unknown value will be returned. * This does not cause or change the rate of unsolicited cellInfoList(). * * @param serial Serial number of request. * * Response callback is IRadioResponse.getCellInfoListResponse() */ - oneway void getCellInfoList(in int serial); + void getCellInfoList(in int serial); /** * Queries the status of the CLIP supplementary service (for MMI code "*#30#") @@ -496,7 +491,7 @@ interface IRadio { * * Response function is IRadioResponse.getClipResponse() */ - oneway void getClip(in int serial); + void getClip(in int serial); /** * Gets current CLIR status @@ -505,16 +500,16 @@ interface IRadio { * * Response function is IRadioResponse.getClirResponse() */ - oneway void getClir(in int serial); + void getClir(in int serial); /** * Requests current call list * * @param serial Serial number of request. * - * Response function is IRadioResponse.getCurrentCallsResponse_1_6() + * Response function is IRadioResponse.getCurrentCallsResponse() */ - oneway void getCurrentCalls(in int serial); + void getCurrentCalls(in int serial); /** * Returns the data call list. An entry is added when a setupDataCall() is issued and removed @@ -523,18 +518,18 @@ interface IRadio { * * @param serial Serial number of request. * - * Response function is IRadioResponse.getDataCallListResponse_1_6() + * Response function is IRadioResponse.getDataCallListResponse() */ - oneway void getDataCallList(in int serial); + void getDataCallList(in int serial); /** * Request current data registration state. * * @param serial Serial number of request. * - * Response function is IRadioResponse.getDataRegistrationStateResponse_1_6() + * Response function is IRadioResponse.getDataRegistrationStateResponse() */ - oneway void getDataRegistrationState(in int serial); + void getDataRegistrationState(in int serial); /** * Request the device ESN / MEID / IMEI / IMEISV. The request is always allowed and contains @@ -545,7 +540,7 @@ interface IRadio { * * Response callback is IRadioResponse.getDeviceIdentityResponse() */ - oneway void getDeviceIdentity(in int serial); + void getDeviceIdentity(in int serial); /** * Query the status of a facility lock state @@ -560,7 +555,7 @@ interface IRadio { * * Response function is IRadioResponse.getFacilityLockForAppResponse() */ - oneway void getFacilityLockForApp(in int serial, in String facility, in String password, + void getFacilityLockForApp(in int serial, in String facility, in String password, in int serviceClass, in String appId); /** @@ -570,7 +565,7 @@ interface IRadio { * * Response callback is IRadioResponse.getGsmBroadcastConfigResponse() */ - oneway void getGsmBroadcastConfig(in int serial); + void getGsmBroadcastConfig(in int serial); /** * Request all of the current hardware (modem and sim) associated with Radio. @@ -579,7 +574,7 @@ interface IRadio { * * Response callback is IRadioResponse.getHardwareConfigResponse() */ - oneway void getHardwareConfig(in int serial); + void getHardwareConfig(in int serial); /** * Requests status of the ICC card @@ -589,7 +584,7 @@ interface IRadio { * Response function is IRadioResponse.getIccCardStatusResponse() * */ - oneway void getIccCardStatus(in int serial); + void getIccCardStatus(in int serial); /** * Request current IMS registration state @@ -598,7 +593,7 @@ interface IRadio { * * Response callback is IRadioResponse.getImsRegistrationStateResponse() */ - oneway void getImsRegistrationState(in int serial); + void getImsRegistrationState(in int serial); /** * Get the SIM IMSI. Only valid when radio state is "RADIO_STATE_ON" @@ -609,7 +604,7 @@ interface IRadio { * Response function is IRadioResponse.getImsiForAppResponse() * */ - oneway void getImsiForApp(in int serial, in String aid); + void getImsiForApp(in int serial, in String aid); /** * Requests the failure cause code for the most recently terminated call. @@ -619,7 +614,7 @@ interface IRadio { * Response function is IRadioResponse.getLastCallFailCauseResponse() * */ - oneway void getLastCallFailCause(in int serial); + void getLastCallFailCause(in int serial); /** * Get modem activity information for power consumption estimation. Request clear-on-read @@ -630,7 +625,7 @@ interface IRadio { * * Response callback is IRadioResponse.getModemActivityInfoResponse() */ - oneway void getModemActivityInfo(in int serial); + void getModemActivityInfo(in int serial); /** * Request status of logical modem. It returns isEnabled=true if the logical modem is on. @@ -640,7 +635,7 @@ interface IRadio { * * Response function is IRadioResponse.getModemStackStatusResponse() */ - oneway void getModemStackStatus(in int serial); + void getModemStackStatus(in int serial); /** * Queries the current state of the uplink mute setting @@ -649,7 +644,7 @@ interface IRadio { * * Response function is IRadioResponse.getMuteResponse() */ - oneway void getMute(in int serial); + void getMute(in int serial); /** * Request neighboring cell id in GSM network @@ -658,7 +653,7 @@ interface IRadio { * * Response callback is IRadioResponse.getNeighboringCidsResponse() */ - oneway void getNeighboringCids(in int serial); + void getNeighboringCids(in int serial); /** * Query current network selection mode @@ -667,7 +662,7 @@ interface IRadio { * * Response function is IRadioResponse.getNetworkSelectionModeResponse() */ - oneway void getNetworkSelectionMode(in int serial); + void getNetworkSelectionMode(in int serial); /** * Request current operator ONS or EONS @@ -676,7 +671,7 @@ interface IRadio { * * Response function is IRadioResponse.getOperatorResponse() */ - oneway void getOperator(in int serial); + void getOperator(in int serial); /** * Query the preferred network type (CS/PS domain, RAT, and operation mode) @@ -686,7 +681,7 @@ interface IRadio { * * Response callback is IRadioResponse.getPreferredNetworkTypeResponse() */ - oneway void getPreferredNetworkType(in int serial); + void getPreferredNetworkType(in int serial); /** * Query the preferred network type bitmap. @@ -695,7 +690,7 @@ interface IRadio { * * Response callback is IRadioResponse.getPreferredNetworkTypeBitmapResponse() */ - oneway void getPreferredNetworkTypeBitmap(in int serial); + void getPreferredNetworkTypeBitmap(in int serial); /** * Request the setting of preferred voice privacy mode. @@ -704,7 +699,7 @@ interface IRadio { * * Response callback is IRadioResponse.getPreferredVoicePrivacyResponse() */ - oneway void getPreferredVoicePrivacy(in int serial); + void getPreferredVoicePrivacy(in int serial); /** * Used to get phone radio capability. @@ -713,16 +708,16 @@ interface IRadio { * * Response callback is IRadioResponse.getRadioCapabilityResponse() */ - oneway void getRadioCapability(in int serial); + void getRadioCapability(in int serial); /** * Requests current signal strength and associated information. Must succeed if radio is on. * * @param serial Serial number of request. * - * Response function is IRadioResponse.getSignalStrengthResponse_1_6() + * Response function is IRadioResponse.getSignalStrengthResponse() */ - oneway void getSignalStrength(in int serial); + void getSignalStrength(in int serial); /** * Get the phone book capacity @@ -731,7 +726,7 @@ interface IRadio { * * Response function is defined from IRadioResponse.getSimPhonebookCapacityResponse() */ - oneway void getSimPhonebookCapacity(in int serial); + void getSimPhonebookCapacity(in int serial); /** * Get the local and global phonebook records from the SIM card. @@ -742,7 +737,7 @@ interface IRadio { * * Response callback is IRadioResponse.getSimPhonebookRecordsResponse() */ - oneway void getSimPhonebookRecords(in int serial); + void getSimPhonebookRecords(in int serial); /** * Request to get the current slicing configuration including URSP rules and NSSAIs @@ -753,7 +748,7 @@ interface IRadio { * * Response function is IRadioResponse.getSlicingConfigResponse() */ - oneway void getSlicingConfig(in int serial); + void getSlicingConfig(in int serial); /** * Get the default Short Message Service Center address on the device. @@ -762,7 +757,7 @@ interface IRadio { * * Response callback is IRadioResponse.getSmscAddressResponse() */ - oneway void getSmscAddress(in int serial); + void getSmscAddress(in int serial); /** * Get which bands the modem's background scan is acting on. @@ -771,7 +766,7 @@ interface IRadio { * * Response callback is IRadioResponse.getSystemSelectionChannelsResponse() */ - oneway void getSystemSelectionChannels(in int serial); + void getSystemSelectionChannels(in int serial); /** * Request the setting of TTY mode @@ -780,7 +775,7 @@ interface IRadio { * * Response callback is IRadioResponse.getTTYModeResponse() */ - oneway void getTTYMode(in int serial); + void getTTYMode(in int serial); /** * Query the radio technology type (3GPP/3GPP2) used for voice. Query is valid only @@ -790,7 +785,7 @@ interface IRadio { * * Response callback is IRadioResponse.getVoiceRadioTechnologyResponse() */ - oneway void getVoiceRadioTechnology(in int serial); + void getVoiceRadioTechnology(in int serial); /** * Request current voice registration state. @@ -799,7 +794,7 @@ interface IRadio { * * Response function is IRadioResponse.getVoiceRegistrationStateResponse() */ - oneway void getVoiceRegistrationState(in int serial); + void getVoiceRegistrationState(in int serial); /** * When STK application gets stkCallSetup(), the call actually has been initialized by the @@ -811,7 +806,7 @@ interface IRadio { * * Response callback is IRadioResponse.handleStkCallSetupRequestFromSimResponse() */ - oneway void handleStkCallSetupRequestFromSim(in int serial, in boolean accept); + void handleStkCallSetupRequestFromSim(in int serial, in boolean accept); /** * Hang up a specific line (like AT+CHLD=1x). After this HANGUP request returns, Radio must @@ -822,7 +817,7 @@ interface IRadio { * * Response function is IRadioResponse.hangupResponse() */ - oneway void hangup(in int serial, in int gsmIndex); + void hangup(in int serial, in int gsmIndex); /** * Hang up waiting or held (like AT+CHLD=1). After this HANGUP request returns, Radio must show @@ -832,7 +827,7 @@ interface IRadio { * * Response function is IRadioResponse.hangupForegroundResumeBackgroundResponse() */ - oneway void hangupForegroundResumeBackground(in int serial); + void hangupForegroundResumeBackground(in int serial); /** * Hang up waiting or held (like AT+CHLD=0). After this HANGUP request returns, Radio must show @@ -842,7 +837,7 @@ interface IRadio { * * Response function is IRadioResponse.hangupWaitingOrBackgroundResponse() */ - oneway void hangupWaitingOrBackground(in int serial); + void hangupWaitingOrBackground(in int serial); /** * Close a previously opened logical channel. This command reflects TS 27.007 @@ -853,7 +848,7 @@ interface IRadio { * * Response callback is IRadioResponse.iccCloseLogicalChannelResponse() */ - oneway void iccCloseLogicalChannel(in int serial, in int channelId); + void iccCloseLogicalChannel(in int serial, in int channelId); /** * Request ICC I/O operation. This is similar to the TS 27.007 "restricted SIM" operation where @@ -867,7 +862,7 @@ interface IRadio { * * Response function is IRadioResponse.iccIOForAppResponse() */ - oneway void iccIOForApp(in int serial, in IccIo iccIo); + void iccIOForApp(in int serial, in IccIo iccIo); /** * Open a new logical channel and select the given application. This command @@ -875,11 +870,11 @@ interface IRadio { * * @param serial Serial number of request. * @param aid AID value, See ETSI 102.221 and 101.220. - * @param p2 P2 value, described in ISO 7816-4. Ignore if equal to P2Constant:NO_P2 + * @param p2 P2 value, described in ISO 7816-4. Ignore if equal to RadioConst:P2_CONSTANT_NO_P2 * * Response callback is IRadioResponse.iccOpenLogicalChannelResponse() */ - oneway void iccOpenLogicalChannel(in int serial, in String aid, in int p2); + void iccOpenLogicalChannel(in int serial, in String aid, in int p2); /** * Request APDU exchange on the basic channel. This command reflects TS 27.007 @@ -892,7 +887,7 @@ interface IRadio { * * Response callback is IRadioResponse.iccTransmitApduBasicChannelResponse() */ - oneway void iccTransmitApduBasicChannel(in int serial, in SimApdu message); + void iccTransmitApduBasicChannel(in int serial, in SimApdu message); /** * Exchange APDUs with a UICC over a previously opened logical channel. This command reflects @@ -904,7 +899,7 @@ interface IRadio { * * Response callback is IRadioResponse.iccTransmitApduLogicalChannelResponse() */ - oneway void iccTransmitApduLogicalChannel(in int serial, in SimApdu message); + void iccTransmitApduLogicalChannel(in int serial, in SimApdu message); /** * Is E-UTRA-NR Dual Connectivity enabled @@ -912,7 +907,7 @@ interface IRadio { * @param serial Serial number of request. * Response callback is IRadioResponse.isNrDualConnectivityEnabledResponse() */ - oneway void isNrDualConnectivityEnabled(in int serial); + void isNrDualConnectivityEnabled(in int serial); /** * Read one of the radio NV items. @@ -923,7 +918,7 @@ interface IRadio { * * Response callback is IRadioResponse.nvReadItemResponse() */ - oneway void nvReadItem(in int serial, in NvItem itemId); + void nvReadItem(in int serial, in NvItem itemId); /** * Reset the radio NV configuration to the factory state. @@ -934,7 +929,7 @@ interface IRadio { * * Response callback is IRadioResponse.nvResetConfigResponse() */ - oneway void nvResetConfig(in int serial, in ResetNvType resetType); + void nvResetConfig(in int serial, in ResetNvType resetType); /** * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage. @@ -945,7 +940,7 @@ interface IRadio { * * Response callback is IRadioResponse.nvWriteCdmaPrlResponse() */ - oneway void nvWriteCdmaPrl(in int serial, in byte[] prl); + void nvWriteCdmaPrl(in int serial, in byte[] prl); /** * Write one of the radio NV items. @@ -956,19 +951,7 @@ interface IRadio { * * Response callback is IRadioResponse.nvWriteItemResponse() */ - oneway void nvWriteItem(in int serial, in NvWriteItem item); - - /** - * Pull LCE service for capacity information. - * - * @param serial Serial number of request. - * - * Response callback is IRadioResponse.pullLceDataResponse() which may return - * RadioError:REQUEST_NOT_SUPPORTED if @1.2::IRadio or higher is supported. - * - * DEPRECATED in @1.2 or higher which use the always-on LCE that relies on indications. - */ - oneway void pullLceData(in int serial); + void nvWriteItem(in int serial, in NvWriteItem item); /** * Send UDUB (user determined user busy) to ringing or waiting call answer) @@ -977,7 +960,7 @@ interface IRadio { * * Response function is IRadioResponse.rejectCallResponse() */ - oneway void rejectCall(in int serial); + void rejectCall(in int serial); /** * Releases a pdu session id that was previously allocated using allocatePduSessionId. @@ -988,7 +971,7 @@ interface IRadio { * * Response function is IRadioResponse.releasePduSessionIdResponse() */ - oneway void releasePduSessionId(in int serial, in int id); + void releasePduSessionId(in int serial, in int id); /** * Indicates whether there is storage available for new SMS messages. @@ -999,7 +982,7 @@ interface IRadio { * * Response callback is IRadioResponse.reportSmsMemoryStatusResponse() */ - oneway void reportSmsMemoryStatus(in int serial, in boolean available); + void reportSmsMemoryStatus(in int serial, in boolean available); /** * Indicates that the StkService is running and is ready to receive unsolicited stk commands. @@ -1008,7 +991,7 @@ interface IRadio { * * Response callback is IRadioResponse.reportStkServiceIsRunningResponse() */ - oneway void reportStkServiceIsRunning(in int serial); + void reportStkServiceIsRunning(in int serial); /** * Returns the response of SIM Authentication through Radio challenge request. @@ -1021,7 +1004,7 @@ interface IRadio { * * Response callback is IRadioResponse.requestIccSimAuthenticationResponse() */ - oneway void requestIccSimAuthentication( + void requestIccSimAuthentication( in int serial, in int authContext, in String authData, in String aid); /** @@ -1033,7 +1016,7 @@ interface IRadio { * * Response callback is IRadioResponse.requestIsimAuthenticationResponse() */ - oneway void requestIsimAuthentication(in int serial, in String challenge); + void requestIsimAuthentication(in int serial, in String challenge); /** * Device is shutting down. All further commands are ignored and RADIO_NOT_AVAILABLE @@ -1043,14 +1026,14 @@ interface IRadio { * * Response callback is IRadioResponse.requestShutdownResponse() */ - oneway void requestShutdown(in int serial); + void requestShutdown(in int serial); /** * 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(). */ - oneway void responseAcknowledgement(); + void responseAcknowledgement(); /** * Send DTMF string @@ -1062,7 +1045,7 @@ interface IRadio { * * Response callback is IRadioResponse.sendBurstDtmfResponse() */ - oneway void sendBurstDtmf(in int serial, in String dtmf, in int on, in int off); + void sendBurstDtmf(in int serial, in String dtmf, in int on, in int off); /** * Send FLASH command @@ -1072,7 +1055,7 @@ interface IRadio { * * Response callback is IRadioResponse.sendCDMAFeatureCodeResponse() */ - oneway void sendCDMAFeatureCode(in int serial, in String featureCode); + void sendCDMAFeatureCode(in int serial, in String featureCode); /** * Send a CDMA SMS message @@ -1082,7 +1065,7 @@ interface IRadio { * * Response callback is IRadioResponse.sendCdmaSmsResponse() */ - oneway void sendCdmaSms(in int serial, in CdmaSmsMessage sms); + void sendCdmaSms(in int serial, in CdmaSmsMessage sms); /** * Send an SMS message. Identical to sendCdmaSms, except that more messages are expected to be @@ -1093,7 +1076,7 @@ interface IRadio { * * Response callback is IRadioResponse.sendCdmaSMSExpectMoreResponse() */ - oneway void sendCdmaSmsExpectMore(in int serial, in CdmaSmsMessage sms); + void sendCdmaSmsExpectMore(in int serial, in CdmaSmsMessage sms); /** * Send the updated device state. This is providing the device state information for the modem @@ -1105,8 +1088,7 @@ interface IRadio { * * Response callback is IRadioResponse.sendDeviceStateResponse() */ - oneway void sendDeviceState( - in int serial, in DeviceStateType deviceStateType, in boolean state); + void sendDeviceState(in int serial, in DeviceStateType deviceStateType, in boolean state); /** * Send a DTMF tone. If the implementation is currently playing a tone requested via @@ -1117,7 +1099,7 @@ interface IRadio { * * Response function is IRadioResponse.sendDtmfResponse() */ - oneway void sendDtmf(in int serial, in String s); + void sendDtmf(in int serial, in String s); /** * Requests to send a SAT/USAT envelope command to SIM. @@ -1128,7 +1110,7 @@ interface IRadio { * * Response function is IRadioResponse.sendEnvelopeResponse() */ - oneway void sendEnvelope(in int serial, in String command); + void sendEnvelope(in int serial, in String command); /** * Requests to send a SAT/USAT envelope command to SIM. The SAT/USAT envelope command refers to @@ -1143,7 +1125,7 @@ interface IRadio { * * Response callback is IRadioResponse.sendEnvelopeWithStatusResponse() */ - oneway void sendEnvelopeWithStatus(in int serial, in String contents); + void sendEnvelopeWithStatus(in int serial, in String contents); /** * Send a SMS message over IMS. Based on the return error, caller decides to resend if sending @@ -1155,23 +1137,7 @@ interface IRadio { * * Response callback is IRadioResponse.sendImsSmsResponse() */ - oneway void sendImsSms(in int serial, in ImsSmsMessage message); - - /** - * Send an SMS message. Identical to sendSms, except that more messages are expected to be sent - * soon. If possible, keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command). - * Based on the returned error, caller decides to resend if sending sms fails. - * RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) and - * RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500) - * - * @param serial Serial number of request. - * @param message GsmSmsMessage as defined in types.hal - * - * Response function is IRadioResponse.sendSMSExpectMoreResponse() - * - * DEPRECATED in @1.6 or higher which uses sendSmsExpectMore(). - */ - oneway void sendSMSExpectMore(in int serial, in GsmSmsMessage message); + void sendImsSms(in int serial, in ImsSmsMessage message); /** * Send an SMS message. Based on the returned error, caller decides to resend if sending sms @@ -1183,7 +1149,7 @@ interface IRadio { * * Response function is IRadioResponse.sendSmsResponse() */ - oneway void sendSms(in int serial, in GsmSmsMessage message); + void sendSms(in int serial, in GsmSmsMessage message); /** * Send an SMS message. Identical to sendSms, except that more messages are expected to be sent @@ -1197,7 +1163,7 @@ interface IRadio { * * Response function is IRadioResponse.sendSmsExpectMoreResponse() */ - oneway void sendSmsExpectMore(in int serial, in GsmSmsMessage message); + void sendSmsExpectMore(in int serial, in GsmSmsMessage message); /** * Requests to send a terminal response to SIM for a received proactive command @@ -1208,7 +1174,7 @@ interface IRadio { * * Response function is IRadioResponse.sendTerminalResponseResponseToSim() */ - oneway void sendTerminalResponseToSim(in int serial, in String commandResponse); + void sendTerminalResponseToSim(in int serial, in String commandResponse); /** * Send a USSD message. If a USSD session already exists, the message must be sent in the @@ -1227,7 +1193,7 @@ interface IRadio { * * See also requestCancelUssd, unsolOnUssd */ - oneway void sendUssd(in int serial, in String ussd); + void sendUssd(in int serial, in String ussd); /** * Separate a party from a multiparty call placing the multiparty call (less the specified @@ -1243,7 +1209,7 @@ interface IRadio { * * Response function is IRadioResponse.separateConnectionResponse() */ - oneway void separateConnection(in int serial, in int gsmIndex); + void separateConnection(in int serial, in int gsmIndex); /** * Set carrier restrictions. Expected modem behavior: @@ -1257,13 +1223,12 @@ interface IRadio { * CardState:RESTRICTED. Emergency service must be enabled. * * @param serial Serial number of request. - * @param carriers CarrierRestrictionsWithPriority consisting allowed and excluded carriers - * as defined in types.hal + * @param carriers CarrierRestrictions consisting allowed and excluded carriers * @param multiSimPolicy Policy to be used for devices with multiple SIMs. * * Response callback is IRadioResponse.setAllowedCarriersResponse() */ - oneway void setAllowedCarriers(in int serial, in CarrierRestrictionsWithPriority carriers, + void setAllowedCarriers(in int serial, in CarrierRestrictions carriers, in SimLockMultiSimPolicy multiSimPolicy); /** @@ -1277,7 +1242,7 @@ interface IRadio { * * Response callback is IRadioResponse.setAllowedNetworkTypesBitmapResponse() */ - oneway void setAllowedNetworkTypesBitmap(in int serial, in RadioAccessFamily networkTypeBitmap); + void setAllowedNetworkTypesBitmap(in int serial, in RadioAccessFamily networkTypeBitmap); /** * Assign a specified band for RF configuration. @@ -1287,7 +1252,7 @@ interface IRadio { * * Response function is IRadioResponse.setBandModeResponse() */ - oneway void setBandMode(in int serial, in RadioBandMode mode); + void setBandMode(in int serial, in RadioBandMode mode); /** * Change call barring facility password @@ -1299,7 +1264,7 @@ interface IRadio { * * Response function is IRadioResponse.setBarringPasswordResponse() */ - oneway void setBarringPassword( + void setBarringPassword( in int serial, in String facility, in String oldPassword, in String newPassword); /** @@ -1310,7 +1275,7 @@ interface IRadio { * * Response function is IRadioResponse.setCallForwardResponse() */ - oneway void setCallForward(in int serial, in CallForwardInfo callInfo); + void setCallForward(in int serial, in CallForwardInfo callInfo); /** * Configure current call waiting state @@ -1321,7 +1286,7 @@ interface IRadio { * * Response function is IRadioResponse.setCallWaitingResponse() */ - oneway void setCallWaiting(in int serial, in boolean enable, in int serviceClass); + void setCallWaiting(in int serial, in boolean enable, in int serviceClass); /** * Provide Carrier specific information to the modem that must be used to encrypt the IMSI and @@ -1333,8 +1298,7 @@ interface IRadio { * * Response callback is IRadioResponse.setCarrierInfoForImsiEncryptionResponse() */ - oneway void setCarrierInfoForImsiEncryption( - in int serial, in ImsiEncryptionInfo imsiEncryptionInfo); + void setCarrierInfoForImsiEncryption(in int serial, in ImsiEncryptionInfo imsiEncryptionInfo); /** * Enable or disable the reception of CDMA Cell Broadcast SMS @@ -1345,7 +1309,7 @@ interface IRadio { * * Response callback is IRadioResponse.setCdmaBroadcastActivationResponse() */ - oneway void setCdmaBroadcastActivation(in int serial, in boolean activate); + void setCdmaBroadcastActivation(in int serial, in boolean activate); /** * Set CDMA Broadcast SMS config @@ -1355,7 +1319,7 @@ interface IRadio { * * Response callback is IRadioResponse.setCdmaBroadcastConfigResponse() */ - oneway void setCdmaBroadcastConfig(in int serial, in CdmaBroadcastSmsConfigInfo[] configInfo); + void setCdmaBroadcastConfig(in int serial, in CdmaBroadcastSmsConfigInfo[] configInfo); /** * Request to set the roaming preferences in CDMA @@ -1365,7 +1329,7 @@ interface IRadio { * * Response callback is IRadioResponse.setCdmaRoamingPreferenceResponse() */ - oneway void setCdmaRoamingPreference(in int serial, in CdmaRoamingType type); + void setCdmaRoamingPreference(in int serial, in CdmaRoamingType type); /** * Request to set the location where the CDMA subscription shall be retrieved @@ -1375,7 +1339,7 @@ interface IRadio { * * Response callback is IRadioResponse.setCdmaSubscriptionSourceResponse() */ - oneway void setCdmaSubscriptionSource(in int serial, in CdmaSubscriptionSource cdmaSub); + void setCdmaSubscriptionSource(in int serial, in CdmaSubscriptionSource cdmaSub); /** * Sets the minimum time between when unsolicited cellInfoList() must be invoked. @@ -1387,7 +1351,7 @@ interface IRadio { * * Response callback is IRadioResponse.setCellInfoListRateResponse() */ - oneway void setCellInfoListRate(in int serial, in int rate); + void setCellInfoListRate(in int serial, in int rate); /** * Set current CLIR status @@ -1397,7 +1361,7 @@ interface IRadio { * * Response function is IRadioResponse.setClirResponse() */ - oneway void setClir(in int serial, in int status); + void setClir(in int serial, in int status); /** * Tells the modem whether data calls are allowed or not @@ -1407,7 +1371,7 @@ interface IRadio { * * Response callback is IRadioResponse.setDataAllowedResponse() */ - oneway void setDataAllowed(in int serial, in boolean allow); + void setDataAllowed(in int serial, in boolean allow); /** * Send data profiles of the current carrier to the modem. @@ -1417,7 +1381,7 @@ interface IRadio { * * Response callback is IRadioResponse.setDataProfileResponse() */ - oneway void setDataProfile(in int serial, in DataProfileInfo[] profiles); + void setDataProfile(in int serial, in DataProfileInfo[] profiles); /** * Control data throttling at modem. @@ -1438,7 +1402,7 @@ interface IRadio { * * Response function is IRadioResponse.setDataThrottlingResponse() */ - oneway void setDataThrottling(in int serial, in DataThrottlingAction dataThrottlingAction, + void setDataThrottling(in int serial, in DataThrottlingAction dataThrottlingAction, in long completionDurationMillis); /** @@ -1455,7 +1419,7 @@ interface IRadio { * * Response function is IRadioResponse.setFacilityLockForAppResponse() */ - oneway void setFacilityLockForApp(in int serial, in String facility, in boolean lockState, + void setFacilityLockForApp(in int serial, in String facility, in boolean lockState, in String password, in int serviceClass, in String appId); /** @@ -1467,7 +1431,7 @@ interface IRadio { * * Response callback is IRadioResponse.setGsmBroadcastActivationResponse() */ - oneway void setGsmBroadcastActivation(in int serial, in boolean activate); + void setGsmBroadcastActivation(in int serial, in boolean activate); /** * Set GSM/WCDMA Cell Broadcast SMS config @@ -1477,7 +1441,7 @@ interface IRadio { * * Response callback is IRadioResponse.setGsmBroadcastConfigResponse() */ - oneway void setGsmBroadcastConfig(in int serial, in GsmBroadcastSmsConfigInfo[] configInfo); + void setGsmBroadcastConfig(in int serial, in GsmBroadcastSmsConfigInfo[] configInfo); /** * Sets the indication filter. Prevents the reporting of specified unsolicited indications from @@ -1490,7 +1454,7 @@ interface IRadio { * * Response callback is IRadioResponse.setIndicationFilterResponse() */ - oneway void setIndicationFilter(in int serial, in IndicationFilter indicationFilter); + void setIndicationFilter(in int serial, in IndicationFilter indicationFilter); /** * Set an APN to initial attach network. @@ -1500,7 +1464,7 @@ interface IRadio { * * Response callback is IRadioResponse.setInitialAttachApnResponse() */ - oneway void setInitialAttachApn(in int serial, in DataProfileInfo dataProfileInfo); + void setInitialAttachApn(in int serial, in DataProfileInfo dataProfileInfo); /** * Sets the link capacity reporting criteria. The resulting reporting criteria are the AND of @@ -1524,7 +1488,7 @@ interface IRadio { * vector size of 0 disables the use of UL thresholds for reporting. * @param accessNetwork The type of network for which to apply these thresholds. */ - oneway void setLinkCapacityReportingCriteria(in int serial, in int hysteresisMs, + void setLinkCapacityReportingCriteria(in int serial, in int hysteresisMs, in int hysteresisDlKbps, in int hysteresisUlKbps, in int[] thresholdsDownlinkKbps, in int[] thresholdsUplinkKbps, in AccessNetwork accessNetwork); @@ -1539,7 +1503,7 @@ interface IRadio { * * Response callback is IRadioResponse.setLocationUpdatesResponse() */ - oneway void setLocationUpdates(in int serial, in boolean enable); + void setLocationUpdates(in int serial, in boolean enable); /** * Turn on or off uplink (microphone) mute. Must only be sent while voice call is active. @@ -1550,7 +1514,7 @@ interface IRadio { * * Response function is IRadioResponse.setMuteResponse() */ - oneway void setMute(in int serial, in boolean enable); + void setMute(in int serial, in boolean enable); /** * Specify that the network must be selected automatically. @@ -1560,7 +1524,7 @@ interface IRadio { * * Response function is IRadioResponse.setNetworkSelectionModeAutomaticResponse() */ - oneway void setNetworkSelectionModeAutomatic(in int serial); + void setNetworkSelectionModeAutomatic(in int serial); /** * Manually select a specified network. This request must not respond until the new operator is @@ -1576,7 +1540,7 @@ interface IRadio { * * Response function is IRadioResponse.setNetworkSelectionModeManualResponse() */ - oneway void setNetworkSelectionModeManual( + void setNetworkSelectionModeManual( in int serial, in String operatorNumeric, in RadioAccessNetworks ran); /** @@ -1592,7 +1556,7 @@ interface IRadio { * * Response callback is IRadioResponse.setNRDualConnectivityStateResponse() */ - oneway void setNrDualConnectivityState( + void setNrDualConnectivityState( in int serial, in NrDualConnectivityState nrDualConnectivityState); /** @@ -1604,7 +1568,7 @@ interface IRadio { * * Response callback is IRadioResponse.setPreferredNetworkTypeResponse() */ - oneway void setPreferredNetworkType(in int serial, in PreferredNetworkType nwType); + void setPreferredNetworkType(in int serial, in PreferredNetworkType nwType); /** * Requests to set the preferred network type for searching and registering. @@ -1614,8 +1578,7 @@ interface IRadio { * * Response callback is IRadioResponse.setPreferredNetworkTypeBitmapResponse() */ - oneway void setPreferredNetworkTypeBitmap( - in int serial, in RadioAccessFamily networkTypeBitmap); + void setPreferredNetworkTypeBitmap(in int serial, in RadioAccessFamily networkTypeBitmap); /** * Request to set the preferred voice privacy mode used in voice scrambling. @@ -1626,7 +1589,7 @@ interface IRadio { * * Response callback is IRadioResponse.setPreferredVoicePrivacyResponse() */ - oneway void setPreferredVoicePrivacy(in int serial, in boolean enable); + void setPreferredVoicePrivacy(in int serial, in boolean enable); /** * Used to set the phones radio capability. Be VERY careful using this request as it may cause @@ -1638,7 +1601,7 @@ interface IRadio { * * Response callback is IRadioResponse.setRadioCapabilityResponse() */ - oneway void setRadioCapability(in int serial, in RadioCapability rc); + void setRadioCapability(in int serial, in RadioCapability rc); /** * Toggle radio on and off (for "airplane" mode). If the radio is turned off/on the radio modem @@ -1648,7 +1611,7 @@ interface IRadio { * logical modem, powerOn, forEmergencyCall and preferredForEmergencyCall must be true. In * this case, this modem is optimized to scan only emergency call bands, until: * 1) Emergency call is completed; or - * 2) Another setRadioPower_1_5 is issued with forEmergencyCall being false or + * 2) Another setRadioPower is issued with forEmergencyCall being false or * preferredForEmergencyCall being false; or * 3) Timeout after 30 seconds if dial or emergencyDial is not called. * Once one of these conditions is reached, the modem should move into normal operation. @@ -1662,7 +1625,7 @@ interface IRadio { * * Response callback is IRadioConfigResponse.setRadioPowerResponse. */ - oneway void setRadioPower(in int serial, in boolean powerOn, in boolean forEmergencyCall, + void setRadioPower(in int serial, in boolean powerOn, in boolean forEmergencyCall, in boolean preferredForEmergencyCall); /** @@ -1695,7 +1658,7 @@ interface IRadio { * * Response callback is IRadioResponse.setSignalStrengthReportingCriteriaResponse() */ - oneway void setSignalStrengthReportingCriteria(in int serial, + void setSignalStrengthReportingCriteria(in int serial, in SignalThresholdInfo signalThresholdInfo, in AccessNetwork accessNetwork); /** @@ -1725,7 +1688,7 @@ interface IRadio { * * Response callback is IRadioResponse.setSimCardPowerResponse(). */ - oneway void setSimCardPower(in int serial, in CardPowerState powerUp); + void setSimCardPower(in int serial, in CardPowerState powerUp); /** * Set the default Short Message Service Center address on the device. @@ -1735,7 +1698,7 @@ interface IRadio { * * Response callback is IRadioResponse.setSmscAddressResponse() */ - oneway void setSmscAddress(in int serial, in String smsc); + void setSmscAddress(in int serial, in String smsc); /** * Enables/disables supplementary service related notifications from the network. @@ -1746,7 +1709,7 @@ interface IRadio { * * Response function is IRadioResponse.setSuppServiceNotificationsResponse() */ - oneway void setSuppServiceNotifications(in int serial, in boolean enable); + void setSuppServiceNotifications(in int serial, in boolean enable); /** * Specify which bands modem's background scan must act on. If specifyChannels is true, it only @@ -1759,7 +1722,7 @@ interface IRadio { * * Response callback is IRadioResponse.setSystemSelectionChannelsResponse() */ - oneway void setSystemSelectionChannels( + void setSystemSelectionChannels( in int serial, in boolean specifyChannels, in RadioAccessSpecifier[] specifiers); /** @@ -1770,7 +1733,7 @@ interface IRadio { * * Response callback is IRadioResponse.setTTYModeResponse() */ - oneway void setTTYMode(in int serial, in TtyMode mode); + void setTTYMode(in int serial, in TtyMode mode); /** * Selection/de-selection of a subscription from a SIM card @@ -1780,7 +1743,7 @@ interface IRadio { * * Response callback is IRadioResponse.setUiccSubscriptionResponse() */ - oneway void setUiccSubscription(in int serial, in SelectUiccSub uiccSub); + void setUiccSubscription(in int serial, in SelectUiccSub uiccSub); /** * Setup a packet data connection. If DataCallResponse.status returns DataCallFailCause:NONE, @@ -1839,11 +1802,12 @@ interface IRadio { * * Response function is IRadioResponse.setupDataCallResponse() */ - oneway void setupDataCall(in int serial, in AccessNetwork accessNetwork, + void setupDataCall(in int serial, in AccessNetwork accessNetwork, in DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in DataRequestReason reason, in LinkAddress[] addresses, in String[] dnses, - in int pduSessionId, in OptionalSliceInfo sliceInfo, - in OptionalTrafficDescriptor trafficDescriptor, in boolean matchAllRuleAllowed); + in int pduSessionId, in @nullable SliceInfo sliceInfo, + in @nullable TrafficDescriptor trafficDescriptor, + in boolean matchAllRuleAllowed); /** * Start playing a DTMF tone. Continue playing DTMF tone until stopDtmf is received. If a @@ -1855,7 +1819,7 @@ interface IRadio { * * Response function is IRadioResponse.startDtmfResponse() */ - oneway void startDtmf(in int serial, in String s); + void startDtmf(in int serial, in String s); /** * Indicates that a handover to the IWLAN transport has begun. Any resources being transferred @@ -1872,7 +1836,7 @@ interface IRadio { * * Response function is IRadioResponse.startHandoverResponse() */ - oneway void startHandover(in int serial, in int callId); + void startHandover(in int serial, in int callId); /** * Start a Keepalive session (for IPsec) @@ -1882,20 +1846,7 @@ interface IRadio { * * Response function is IRadioResponse.startKeepaliveResponse() */ - oneway void startKeepalive(in int serial, in KeepaliveRequest keepalive); - - /** - * Start Link Capacity Estimate (LCE) service if supported by the radio. - * - * @param serial Serial number of request. - * @param reportInterval desired reporting interval (ms). - * @param pullMode LCE service mode. true: PULL; false: PUSH. - * - * Response callback is IRadioResponse.startLceServiceResponse() - * - * DEPRECATED in @1.2 or higher which use the always-on LCE that relies on indications. - */ - oneway void startLceService(in int serial, in int reportInterval, in boolean pullMode); + void startKeepalive(in int serial, in KeepaliveRequest keepalive); /** * Starts a network scan. @@ -1905,7 +1856,7 @@ interface IRadio { * * Response function is IRadioResponse.startNetworkScanResponse() */ - oneway void startNetworkScan(in int serial, in NetworkScanRequest request); + void startNetworkScan(in int serial, in NetworkScanRequest request); /** * Stop playing a currently playing DTMF tone. @@ -1914,7 +1865,7 @@ interface IRadio { * * Response function is IRadioResponse.stopDtmfResponse() */ - oneway void stopDtmf(in int serial); + void stopDtmf(in int serial); /** * Stop an ongoing Keepalive session (for IPsec) @@ -1924,19 +1875,7 @@ interface IRadio { * * Response function is IRadioResponse.stopKeepaliveResponse() */ - oneway void stopKeepalive(in int serial, in int sessionHandle); - - /** - * Stop Link Capacity Estimate (LCE) service, the STOP operation must be idempotent for the - * radio modem. - * - * @param serial Serial number of request. - * - * Response callback is IRadioResponse.stopLceServiceResponse() - * - * DEPRECATED in @1.2 or higher which use the always-on LCE that relies on indications. - */ - oneway void stopLceService(in int serial); + void stopKeepalive(in int serial, in int sessionHandle); /** * Stops ongoing network scan @@ -1945,7 +1884,7 @@ interface IRadio { * * Response function is IRadioResponse.stopNetworkScanResponse() */ - oneway void stopNetworkScan(in int serial); + void stopNetworkScan(in int serial); /** * Supplies ICC PIN2. Only called following operation where SIM_PIN2 was returned as a failure @@ -1957,7 +1896,7 @@ interface IRadio { * * Response function is IRadioResponse.supplyIccPin2ForAppResponse() */ - oneway void supplyIccPin2ForApp(in int serial, in String pin2, in String aid); + void supplyIccPin2ForApp(in int serial, in String pin2, in String aid); /** * Supplies ICC PIN. Only called if CardStatus has AppState.PIN state @@ -1968,7 +1907,7 @@ interface IRadio { * * Response function is IRadioResponse.supplyIccPinForAppResponse() */ - oneway void supplyIccPinForApp(in int serial, in String pin, in String aid); + void supplyIccPinForApp(in int serial, in String pin, in String aid); /** * Supplies ICC PUK2 and new PIN2. @@ -1980,7 +1919,7 @@ interface IRadio { * * Response function is IRadioResponse.supplyIccPuk2ForAppResponse() */ - oneway void supplyIccPuk2ForApp(in int serial, in String puk2, in String pin2, in String aid); + void supplyIccPuk2ForApp(in int serial, in String puk2, in String pin2, in String aid); /** * Supplies ICC PUK and new PIN. @@ -1992,7 +1931,7 @@ interface IRadio { * * Response function is IRadioResponse.supplyIccPukForAppResponse() */ - oneway void supplyIccPukForApp(in int serial, in String puk, in String pin, in String aid); + void supplyIccPukForApp(in int serial, in String puk, in String pin, in String aid); /** * Requests that network personalization be deactivated @@ -2002,7 +1941,7 @@ interface IRadio { * * Response function is IRadioResponse.supplyNetworkDepersonalizationResponse() */ - oneway void supplyNetworkDepersonalization(in int serial, in String netPin); + void supplyNetworkDepersonalization(in int serial, in String netPin); /** * Request that deactivates one category of device personalization. Device personalization @@ -2017,7 +1956,7 @@ interface IRadio { * * Response function is IRadioResponse.supplySimDepersonalizationResponse() */ - oneway void supplySimDepersonalization( + void supplySimDepersonalization( in int serial, in PersoSubstate persoType, in String controlKey); /** @@ -2035,7 +1974,7 @@ interface IRadio { * * Response function is IRadioResponse.switchWaitingOrHoldingAndActiveResponse() */ - oneway void switchWaitingOrHoldingAndActive(in int serial); + void switchWaitingOrHoldingAndActive(in int serial); /** * Insert, delete or update a phonebook record on the SIM card. If the index of recordInfo is 0, @@ -2049,7 +1988,7 @@ interface IRadio { * * Response callback is IRadioResponse.updateSimPhonebookRecordsResponse() */ - oneway void updateSimPhonebookRecords(in int serial, in PhonebookRecordInfo recordInfo); + void updateSimPhonebookRecords(in int serial, in PhonebookRecordInfo recordInfo); /** * Stores a CDMA SMS message to RUIM memory. @@ -2059,7 +1998,7 @@ interface IRadio { * * Response callback is IRadioResponse.writeSmsToRuimResponse() */ - oneway void writeSmsToRuim(in int serial, in CdmaSmsWriteArgs cdmaSms); + void writeSmsToRuim(in int serial, in CdmaSmsWriteArgs cdmaSms); /** * Stores a SMS message to SIM memory. @@ -2069,5 +2008,5 @@ interface IRadio { * * Response function is IRadioResponse.writeSmsToSimResponse() */ - oneway void writeSmsToSim(in int serial, in SmsWriteArgs smsWriteArgs); + void writeSmsToSim(in int serial, in SmsWriteArgs smsWriteArgs); } diff --git a/radio/aidl/android/hardware/radio/IRadioIndication.aidl b/radio/aidl/android/hardware/radio/IRadioIndication.aidl index 054a53ef98..ec6addecb0 100644 --- a/radio/aidl/android/hardware/radio/IRadioIndication.aidl +++ b/radio/aidl/android/hardware/radio/IRadioIndication.aidl @@ -53,7 +53,7 @@ import android.hardware.radio.UssdModeType; * Interface declaring unsolicited radio indications. */ @VintfStability -interface IRadioIndication { +oneway interface IRadioIndication { /** * Indicate barring information for the user’s access category / access class and PLMN. * @@ -68,7 +68,7 @@ interface IRadioIndication { * when PLMN selection is completed, when the device attempts to access a conditionally barred * service, and when the System Information including barring info for a camped cell is updated. */ - oneway void barringInfoChanged(in RadioIndicationType type, in CellIdentity cellIdentity, + void barringInfoChanged(in RadioIndicationType type, in CellIdentity cellIdentity, in BarringInfo[] barringInfos); /** @@ -84,8 +84,7 @@ interface IRadioIndication { * @param isGsm true for GSM & false for CDMA * @param record Cdma Signal Information */ - oneway void callRing( - in RadioIndicationType type, in boolean isGsm, in CdmaSignalInfoRecord record); + void callRing(in RadioIndicationType type, in boolean isGsm, in CdmaSignalInfoRecord record); /** * Indicates when call state has changed. Callee must invoke IRadio.getCurrentCalls(). Must be @@ -94,7 +93,7 @@ interface IRadioIndication { * * @param type Type of radio indication */ - oneway void callStateChanged(in RadioIndicationType type); + void callStateChanged(in RadioIndicationType type); /** * Indicates that the modem requires the Carrier info for IMSI/IMPI encryption. This might @@ -102,7 +101,7 @@ interface IRadioIndication { * * @param type Type of radio indication */ - oneway void carrierInfoForImsiEncryption(in RadioIndicationType info); + void carrierInfoForImsiEncryption(in RadioIndicationType info); /** * Indicates when CDMA radio receives a call waiting indication. @@ -110,7 +109,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param callWaitingRecord Cdma CallWaiting information */ - oneway void cdmaCallWaiting(in RadioIndicationType type, in CdmaCallWaiting callWaitingRecord); + void cdmaCallWaiting(in RadioIndicationType type, in CdmaCallWaiting callWaitingRecord); /** * Indicates when CDMA radio receives one or more info recs. @@ -118,7 +117,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param records New Cdma Information */ - oneway void cdmaInfoRec(in RadioIndicationType type, in CdmaInformationRecords records); + void cdmaInfoRec(in RadioIndicationType type, in CdmaInformationRecords records); /** * Indicates when new CDMA SMS is received. Callee must subsequently confirm the receipt of the @@ -128,7 +127,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param msg Cdma Sms Message */ - oneway void cdmaNewSms(in RadioIndicationType type, in CdmaSmsMessage msg); + void cdmaNewSms(in RadioIndicationType type, in CdmaSmsMessage msg); /** * Indicates when CDMA radio receives an update of the progress of an OTASP/OTAPA call. @@ -136,8 +135,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param status Cdma OTA provision status */ - oneway void cdmaOtaProvisionStatus( - in RadioIndicationType type, in CdmaOtaProvisionStatus status); + void cdmaOtaProvisionStatus(in RadioIndicationType type, in CdmaOtaProvisionStatus status); /** * Indicates when PRL (preferred roaming list) changes. @@ -145,7 +143,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param version PRL version after PRL changes */ - oneway void cdmaPrlChanged(in RadioIndicationType type, in int version); + void cdmaPrlChanged(in RadioIndicationType type, in int version); /** * Indicates that SMS storage on the RUIM is full. Messages cannot be saved on the RUIM until @@ -153,7 +151,7 @@ interface IRadioIndication { * * @param type Type of radio indication */ - oneway void cdmaRuimSmsStorageFull(in RadioIndicationType type); + void cdmaRuimSmsStorageFull(in RadioIndicationType type); /** * Indicates when CDMA subscription source changed. @@ -161,7 +159,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param cdmaSource New Cdma SubscriptionSource */ - oneway void cdmaSubscriptionSourceChanged( + void cdmaSubscriptionSourceChanged( in RadioIndicationType type, in CdmaSubscriptionSource cdmaSource); /** @@ -170,7 +168,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param records Current cell information */ - oneway void cellInfoList(in RadioIndicationType type, in CellInfo[] records); + void cellInfoList(in RadioIndicationType type, in CellInfo[] records); /** * Report the current list of emergency numbers. Each emergency number in the emergency number @@ -194,7 +192,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param emergencyNumberList Current list of emergency numbers known to radio. */ - oneway void currentEmergencyNumberList( + void currentEmergencyNumberList( in RadioIndicationType type, in EmergencyNumber[] emergencyNumberList); /** @@ -205,8 +203,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param lce LinkCapacityEstimate */ - oneway void currentLinkCapacityEstimate( - in RadioIndicationType type, in LinkCapacityEstimate lce); + void currentLinkCapacityEstimate(in RadioIndicationType type, in LinkCapacityEstimate lce); /** * Indicates physical channel configurations. An empty configs list shall be returned when the @@ -215,7 +212,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param configs Vector of PhysicalChannelConfigs */ - oneway void currentPhysicalChannelConfigs( + void currentPhysicalChannelConfigs( in RadioIndicationType type, in PhysicalChannelConfig[] configs); /** @@ -224,8 +221,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param signalStrength SignalStrength information */ - oneway void currentSignalStrength( - in RadioIndicationType type, in SignalStrength signalStrength); + void currentSignalStrength(in RadioIndicationType type, in SignalStrength signalStrength); /** * Indicates data call contexts have changed. @@ -239,7 +235,7 @@ interface IRadioIndication { * - The radio is powered off/on. * - Unsolicited disconnect from either modem or network side. */ - oneway void dataCallListChanged(in RadioIndicationType type, in SetupDataCallResult[] dcList); + void dataCallListChanged(in RadioIndicationType type, in SetupDataCallResult[] dcList); /** * Indicates that the radio system selection module has autonomously entered emergency @@ -247,7 +243,7 @@ interface IRadioIndication { * * @param type Type of radio indication */ - oneway void enterEmergencyCallbackMode(in RadioIndicationType type); + void enterEmergencyCallbackMode(in RadioIndicationType type); /** * Indicates when Emergency Callback Mode Ends. Indicates that the radio system selection module @@ -255,7 +251,7 @@ interface IRadioIndication { * * @param type Type of radio indication */ - oneway void exitEmergencyCallbackMode(in RadioIndicationType type); + void exitEmergencyCallbackMode(in RadioIndicationType type); /** * Indicates when the hardware configuration associated with the RILd changes. @@ -263,7 +259,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param configs Array of hardware configs */ - oneway void hardwareConfigChanged(in RadioIndicationType type, in HardwareConfig[] configs); + void hardwareConfigChanged(in RadioIndicationType type, in HardwareConfig[] configs); /** * Indicates when IMS registration state has changed. To get IMS registration state and IMS SMS @@ -271,7 +267,7 @@ interface IRadioIndication { * * @param type Type of radio indication */ - oneway void imsNetworkStateChanged(in RadioIndicationType type); + void imsNetworkStateChanged(in RadioIndicationType type); /** * Indicates that nework doesn't have in-band information, need to play out-band tone. @@ -279,7 +275,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param start true = start play ringback tone, false = stop playing ringback tone */ - oneway void indicateRingbackTone(in RadioIndicationType type, in boolean start); + void indicateRingbackTone(in RadioIndicationType type, in boolean start); /** * Indicates a status update for a particular Keepalive session. This must include a handle for @@ -290,7 +286,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param status Status information for a Keepalive session */ - oneway void keepaliveStatus(in RadioIndicationType type, in KeepaliveStatus status); + void keepaliveStatus(in RadioIndicationType type, in KeepaliveStatus status); /** * Indicates when there is an incoming Link Capacity Estimate (LCE) info report. @@ -300,7 +296,7 @@ interface IRadioIndication { * * DEPRECATED in @1.2 and above, use IRadioIndication.currentLinkCapacityEstimate() instead. */ - oneway void lceData(in RadioIndicationType type, in LceDataInfo lce); + void lceData(in RadioIndicationType type, in LceDataInfo lce); /** * Indicates when there is a modem reset. @@ -318,7 +314,7 @@ interface IRadioIndication { * a crash or some string such as "user-initiated restart" or "AT command initiated * restart" that explains the cause of the modem restart */ - oneway void modemReset(in RadioIndicationType type, in String reason); + void modemReset(in RadioIndicationType type, in String reason); /** * Incremental network scan results. @@ -326,7 +322,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param result the result of the network scan */ - oneway void networkScanResult(in RadioIndicationType type, in NetworkScanResult result); + void networkScanResult(in RadioIndicationType type, in NetworkScanResult result); /** * Indicates when voice or data network state changed. Callee must invoke @@ -335,7 +331,7 @@ interface IRadioIndication { * * @param type Type of radio indication */ - oneway void networkStateChanged(in RadioIndicationType type); + void networkStateChanged(in RadioIndicationType type); /** * Indicates when new Broadcast SMS is received @@ -347,7 +343,7 @@ interface IRadioIndication { * which contain between 1 and 15 CBS Message pages sent as one packet to the MS by the * BTS as coded in 3GPP 23.041 Section 9.4.2.2 */ - oneway void newBroadcastSms(in RadioIndicationType type, in byte[] data); + void newBroadcastSms(in RadioIndicationType type, in byte[] data); /** * Indicates when new SMS is received. Callee must subsequently confirm the receipt of the SMS @@ -358,7 +354,7 @@ interface IRadioIndication { * @param pdu PDU of SMS-DELIVER represented as byte array. * The PDU starts with the SMSC address per TS 27.005 (+CMT:) */ - oneway void newSms(in RadioIndicationType type, in byte[] pdu); + void newSms(in RadioIndicationType type, in byte[] pdu); /** * Indicates when new SMS has been stored on SIM card @@ -366,7 +362,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param recordNumber Record number on the sim */ - oneway void newSmsOnSim(in RadioIndicationType type, in int recordNumber); + void newSmsOnSim(in RadioIndicationType type, in int recordNumber); /** * Indicates when new SMS Status Report is received. Callee must subsequently confirm the @@ -377,7 +373,7 @@ interface IRadioIndication { * @param pdu PDU of SMS-STATUS-REPORT represented as byte array. * The PDU starts with the SMSC address per TS 27.005 (+CMT:) */ - oneway void newSmsStatusReport(in RadioIndicationType type, in byte[] pdu); + void newSmsStatusReport(in RadioIndicationType type, in byte[] pdu); /** * Indicates when radio has received a NITZ time message. @@ -386,8 +382,7 @@ interface IRadioIndication { * @param nitzTime NITZ time string in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt" * @param receivedTime milliseconds since boot that the NITZ time was received */ - oneway void nitzTimeReceived( - in RadioIndicationType type, in String nitzTime, in long receivedTime); + void nitzTimeReceived(in RadioIndicationType type, in String nitzTime, in long receivedTime); /** * Indicates when Supplementary service(SS) response is received when DIAL/USSD/SS is changed to @@ -395,8 +390,7 @@ interface IRadioIndication { * * @param type Type of radio indication */ - oneway void onSupplementaryServiceIndication( - in RadioIndicationType type, in StkCcUnsolSsResult ss); + void onSupplementaryServiceIndication(in RadioIndicationType type, in StkCcUnsolSsResult ss); /** * Indicates when a new USSD message is received. The USSD session is assumed to persist if the @@ -406,7 +400,7 @@ interface IRadioIndication { * @param modeType USSD type code * @param msg Message string in UTF-8, if applicable */ - oneway void onUssd(in RadioIndicationType type, in UssdModeType modeType, in String msg); + void onUssd(in RadioIndicationType type, in UssdModeType modeType, in String msg); /** * Indicates when there is new Carrier PCO data received for a data call. Ideally only new data @@ -416,7 +410,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param pco New PcoData */ - oneway void pcoData(in RadioIndicationType type, in PcoDataInfo pco); + void pcoData(in RadioIndicationType type, in PcoDataInfo pco); /** * Sent when setRadioCapability() completes. Returns the phone radio capability exactly as @@ -425,7 +419,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param rc Current radio capability */ - oneway void radioCapabilityIndication(in RadioIndicationType type, in RadioCapability rc); + void radioCapabilityIndication(in RadioIndicationType type, in RadioCapability rc); /** * Indicates when radio state changes. @@ -433,7 +427,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param radioState Current radio state */ - oneway void radioStateChanged(in RadioIndicationType type, in RadioState radioState); + void radioStateChanged(in RadioIndicationType type, in RadioState radioState); /** * Report that Registration or a Location/Routing/Tracking Area update has failed. @@ -460,7 +454,7 @@ interface IRadioIndication { * For LTE (ESM), cause codes are in TS 24.301 9.9.4.4 * MAX_INT if this value is unused. */ - oneway void registrationFailed(in RadioIndicationType type, in CellIdentity cellIdentity, + void registrationFailed(in RadioIndicationType type, in CellIdentity cellIdentity, in String chosenPlmn, in Domain domain, in int causeCode, in int additionalCauseCode); /** @@ -468,7 +462,7 @@ interface IRadioIndication { * * @param type Type of radio indication */ - oneway void resendIncallMute(in RadioIndicationType type); + void resendIncallMute(in RadioIndicationType type); /** * Indicates a restricted state change (eg, for Domain Specific Access Control). @@ -477,14 +471,14 @@ interface IRadioIndication { * @param type Type of radio indication * @param state Bitmask of restricted state as defined by PhoneRestrictedState */ - oneway void restrictedStateChanged(in RadioIndicationType type, in PhoneRestrictedState state); + void restrictedStateChanged(in RadioIndicationType type, in PhoneRestrictedState state); /** * Indicates the ril connects and returns the version * * @param type Type of radio indication */ - oneway void rilConnected(in RadioIndicationType type); + void rilConnected(in RadioIndicationType type); /** * Indicates whether SIM phonebook is changed. This indication is sent whenever the SIM @@ -493,7 +487,7 @@ interface IRadioIndication { * * @param type Type of radio indication */ - oneway void simPhonebookChanged(in RadioIndicationType type); + void simPhonebookChanged(in RadioIndicationType type); /** * Indicates the content of all the used records in the SIM phonebook. This indication is @@ -504,7 +498,7 @@ interface IRadioIndication { * @param status Status of PbReceivedStatus * @param records Vector of PhonebookRecordInfo */ - oneway void simPhonebookRecordsReceived(in RadioIndicationType type, in PbReceivedStatus status, + void simPhonebookRecordsReceived(in RadioIndicationType type, in PbReceivedStatus status, in PhonebookRecordInfo[] records); /** @@ -515,7 +509,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param refreshResult Result of sim refresh */ - oneway void simRefresh(in RadioIndicationType type, in SimRefreshResult refreshResult); + void simRefresh(in RadioIndicationType type, in SimRefreshResult refreshResult); /** * Indicates that SMS storage on the SIM is full. Sent when the network attempts to deliver a @@ -524,14 +518,14 @@ interface IRadioIndication { * * @param type Type of radio indication */ - oneway void simSmsStorageFull(in RadioIndicationType type); + void simSmsStorageFull(in RadioIndicationType type); /** * Indicates that SIM state changes. Callee must invoke getIccCardStatus(). * * @param type Type of radio indication */ - oneway void simStatusChanged(in RadioIndicationType type); + void simStatusChanged(in RadioIndicationType type); /** * Indicates when Single Radio Voice Call Continuity (SRVCC) progress state has changed. @@ -539,7 +533,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param state New Srvcc State */ - oneway void srvccStateNotify(in RadioIndicationType type, in SrvccState state); + void srvccStateNotify(in RadioIndicationType type, in SrvccState state); /** * Indicates when there is an ALPHA from UICC during Call Control. @@ -547,7 +541,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param alpha ALPHA string from UICC in UTF-8 format */ - oneway void stkCallControlAlphaNotify(in RadioIndicationType type, in String alpha); + void stkCallControlAlphaNotify(in RadioIndicationType type, in String alpha); /** * Indicates when SIM wants application to setup a voice call. @@ -555,7 +549,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param timeout Timeout value in millisec for setting up voice call */ - oneway void stkCallSetup(in RadioIndicationType type, in long timeout); + void stkCallSetup(in RadioIndicationType type, in long timeout); /** * Indicates when SIM notifies applcations some event happens. @@ -565,7 +559,7 @@ interface IRadioIndication { * represented as byte array starting with first byte of response data for command tag. * Refer to TS 102.223 section 9.4 for command types */ - oneway void stkEventNotify(in RadioIndicationType type, in String cmd); + void stkEventNotify(in RadioIndicationType type, in String cmd); /** * Indicates when SIM issue a STK proactive command to applications @@ -574,14 +568,14 @@ interface IRadioIndication { * @param cmd SAT/USAT proactive represented as byte array starting with command tag. * Refer to TS 102.223 section 9.4 for command types */ - oneway void stkProactiveCommand(in RadioIndicationType type, in String cmd); + void stkProactiveCommand(in RadioIndicationType type, in String cmd); /** * Indicates when STK session is terminated by SIM. * * @param type Type of radio indication */ - oneway void stkSessionEnd(in RadioIndicationType type); + void stkSessionEnd(in RadioIndicationType type); /** * Indicated when there is a change in subscription status. @@ -593,7 +587,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param activate false for subscription deactivated, true for subscription activated */ - oneway void subscriptionStatusChanged(in RadioIndicationType type, in boolean activate); + void subscriptionStatusChanged(in RadioIndicationType type, in boolean activate); /** * Reports supplementary service related notification from the network. @@ -601,7 +595,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param suppSvc SuppSvcNotification as defined in types.hal */ - oneway void suppSvcNotify(in RadioIndicationType type, in SuppSvcNotification suppSvc); + void suppSvcNotify(in RadioIndicationType type, in SuppSvcNotification suppSvc); /** * Report change of whether uiccApplications are enabled, or disabled. @@ -609,7 +603,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param enabled whether uiccApplications are enabled, or disabled */ - oneway void uiccApplicationsEnablementChanged(in RadioIndicationType type, in boolean enabled); + void uiccApplicationsEnablementChanged(in RadioIndicationType type, in boolean enabled); /** * The modem can explicitly set SetupDataCallResult::suggestedRetryTime after a failure in @@ -620,7 +614,7 @@ interface IRadioIndication { * @param type Type of radio indication * @param apn Apn to unthrottle */ - oneway void unthrottleApn(in RadioIndicationType type, in String apn); + void unthrottleApn(in RadioIndicationType type, in String apn); /** * Indicates that voice technology has changed. Responds with new rat. @@ -628,5 +622,5 @@ interface IRadioIndication { * @param type Type of radio indication * @param rat Current new voice rat */ - oneway void voiceRadioTechChanged(in RadioIndicationType type, in RadioTechnology rat); + void voiceRadioTechChanged(in RadioIndicationType type, in RadioTechnology rat); } diff --git a/radio/aidl/android/hardware/radio/IRadioResponse.aidl b/radio/aidl/android/hardware/radio/IRadioResponse.aidl index 9ae6495aa5..4447bb121d 100644 --- a/radio/aidl/android/hardware/radio/IRadioResponse.aidl +++ b/radio/aidl/android/hardware/radio/IRadioResponse.aidl @@ -22,7 +22,6 @@ import android.hardware.radio.Call; import android.hardware.radio.CallForwardInfo; import android.hardware.radio.CardStatus; import android.hardware.radio.CarrierRestrictions; -import android.hardware.radio.CarrierRestrictionsWithPriority; import android.hardware.radio.CdmaBroadcastSmsConfigInfo; import android.hardware.radio.CdmaRoamingType; import android.hardware.radio.CdmaSubscriptionSource; @@ -62,7 +61,7 @@ import android.hardware.radio.VoiceRegStateResult; * Interface declaring response functions to solicited radio requests. */ @VintfStability -interface IRadioResponse { +oneway interface IRadioResponse { /** * @param info Response info struct containing response type, serial no. and error * @@ -81,7 +80,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void acceptCallResponse(in RadioResponseInfo info); + void acceptCallResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -95,7 +94,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void acknowledgeIncomingGsmSmsWithPduResponse(in RadioResponseInfo info); + void acknowledgeIncomingGsmSmsWithPduResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -118,7 +117,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void acknowledgeLastIncomingCdmaSmsResponse(in RadioResponseInfo info); + void acknowledgeLastIncomingCdmaSmsResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -132,7 +131,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void acknowledgeLastIncomingGsmSmsResponse(in RadioResponseInfo info); + void acknowledgeLastIncomingGsmSmsResponse(in RadioResponseInfo info); /** * Acknowledge the receipt of radio request sent to the vendor. This must be sent only for @@ -141,7 +140,7 @@ interface IRadioResponse { * * @param serial Serial no. of the request whose acknowledgement is sent. */ - oneway void acknowledgeRequest(in int serial); + void acknowledgeRequest(in int serial); /** * @param info Response info struct containing response type, serial no. and error @@ -154,7 +153,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES- Indicates that no pdu session ids are available * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void allocatePduSessionIdResponse(in RadioResponseInfo info, in int id); + void allocatePduSessionIdResponse(in RadioResponseInfo info, in int id); /** * @param info Response info struct containing response type, serial no. and error @@ -166,7 +165,7 @@ interface IRadioResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:INTERNAL_ERR */ - oneway void areUiccApplicationsEnabledResponse(in RadioResponseInfo info, in boolean enabled); + void areUiccApplicationsEnabledResponse(in RadioResponseInfo info, in boolean enabled); /** * @param info Response info struct containing response type, serial no. and error @@ -180,7 +179,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_CALL_ID */ - oneway void cancelHandoverResponse(in RadioResponseInfo info); + void cancelHandoverResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -201,7 +200,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void cancelPendingUssdResponse(in RadioResponseInfo info); + void cancelPendingUssdResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -220,7 +219,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_PUK2 */ - oneway void changeIccPin2ForAppResponse(in RadioResponseInfo info, in int remainingRetries); + void changeIccPin2ForAppResponse(in RadioResponseInfo info, in int remainingRetries); /** * @param info Response info struct containing response type, serial no. and error @@ -238,7 +237,7 @@ interface IRadioResponse { * RadioError:INVALID_SIM_STATE * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void changeIccPinForAppResponse(in RadioResponseInfo info, in int remainingRetries); + void changeIccPinForAppResponse(in RadioResponseInfo info, in int remainingRetries); /** * @param info Response info struct containing response type, serial no. and error @@ -259,7 +258,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void conferenceResponse(in RadioResponseInfo info); + void conferenceResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -277,7 +276,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:SIM_ABSENT */ - oneway void deactivateDataCallResponse(in RadioResponseInfo info); + void deactivateDataCallResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -299,7 +298,7 @@ interface IRadioResponse { * RadioError:OPERATION_NOT_ALLOWED * RadioError:SIM_ABSENT */ - oneway void deleteSmsOnRuimResponse(in RadioResponseInfo info); + void deleteSmsOnRuimResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -321,7 +320,7 @@ interface IRadioResponse { * RadioError:INVALID_MODEM_STATE * RadioError:SIM_ABSENT */ - oneway void deleteSmsOnSimResponse(in RadioResponseInfo info); + void deleteSmsOnSimResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -350,7 +349,7 @@ interface IRadioResponse { * RadioError:INVALID_MODEM_STATE * RadioError:CANCELLED */ - oneway void dialResponse(in RadioResponseInfo info); + void dialResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -373,7 +372,7 @@ interface IRadioResponse { * RadioError:ABORTED * RadioError:INVALID_MODEM_STATE */ - oneway void emergencyDialResponse(in RadioResponseInfo info); + void emergencyDialResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -386,7 +385,7 @@ interface IRadioResponse { * mode, or when there is only one modem available, as this API should only * be called in multi sim status. */ - oneway void enableModemResponse(in RadioResponseInfo info); + void enableModemResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -398,7 +397,7 @@ interface IRadioResponse { * RadioError:INTERNAL_ERR * RadioError:BUSY */ - oneway void enableUiccApplicationsResponse(in RadioResponseInfo info); + void enableUiccApplicationsResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -417,7 +416,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:SIM_ABSENT */ - oneway void exitEmergencyCallbackModeResponse(in RadioResponseInfo info); + void exitEmergencyCallbackModeResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -439,7 +438,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void explicitCallTransferResponse(in RadioResponseInfo info); + void explicitCallTransferResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -451,8 +450,8 @@ interface IRadioResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void getAllowedCarriersResponse(in RadioResponseInfo info, - in CarrierRestrictionsWithPriority carriers, in SimLockMultiSimPolicy multiSimPolicy); + void getAllowedCarriersResponse(in RadioResponseInfo info, in CarrierRestrictions carriers, + in SimLockMultiSimPolicy multiSimPolicy); /** * @param info Response info struct containing response type, serial no. and error @@ -469,7 +468,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES */ - oneway void getAllowedNetworkTypesBitmapResponse( + void getAllowedNetworkTypesBitmapResponse( in RadioResponseInfo info, in RadioAccessFamily networkTypeBitmap); /** @@ -488,8 +487,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getAvailableBandModesResponse( - in RadioResponseInfo info, in RadioBandMode[] bandModes); + void getAvailableBandModesResponse(in RadioResponseInfo info, in RadioBandMode[] bandModes); /** * @param info Response info struct containing response type, serial no. and error @@ -510,8 +508,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:INTERNAL_ERR */ - oneway void getAvailableNetworksResponse( - in RadioResponseInfo info, in OperatorInfo[] networkInfos); + void getAvailableNetworksResponse(in RadioResponseInfo info, in OperatorInfo[] networkInfos); /** * @param info Response info struct containing response type, serial no. and error @@ -524,7 +521,7 @@ interface IRadioResponse { * RadioError:INTERNAL_ERR * RadioError:MODEM_ERR */ - oneway void getBarringInfoResponse( + void getBarringInfoResponse( in RadioResponseInfo info, in CellIdentity cellIdentity, in BarringInfo[] barringInfos); /** @@ -544,7 +541,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getBasebandVersionResponse(in RadioResponseInfo info, in String version); + void getBasebandVersionResponse(in RadioResponseInfo info, in String version); /** * @param info Response info struct containing response type, serial no. and error @@ -571,8 +568,8 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:SIM_ABSENT */ - oneway void getCDMASubscriptionResponse(in RadioResponseInfo info, in String mdn, - in String hSid, in String hNid, in String min, in String prl); + void getCDMASubscriptionResponse(in RadioResponseInfo info, in String mdn, in String hSid, + in String hNid, in String min, in String prl); /** * @param info Response info struct containing response type, serial no. and error @@ -599,7 +596,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getCallForwardStatusResponse( + void getCallForwardStatusResponse( in RadioResponseInfo info, in CallForwardInfo[] callForwardInfos); /** @@ -627,8 +624,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getCallWaitingResponse( - in RadioResponseInfo info, in boolean enable, in int serviceClass); + void getCallWaitingResponse(in RadioResponseInfo info, in boolean enable, in int serviceClass); /** * @param info Response info struct containing response type, serial no. and error @@ -650,7 +646,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE */ - oneway void getCdmaBroadcastConfigResponse( + void getCdmaBroadcastConfigResponse( in RadioResponseInfo info, in CdmaBroadcastSmsConfigInfo[] configs); /** @@ -670,8 +666,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:SIM_ABSENT */ - oneway void getCdmaRoamingPreferenceResponse( - in RadioResponseInfo info, in CdmaRoamingType type); + void getCdmaRoamingPreferenceResponse(in RadioResponseInfo info, in CdmaRoamingType type); /** * @param info Response info struct containing response type, serial no. and error @@ -688,7 +683,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ - oneway void getCdmaSubscriptionSourceResponse( + void getCdmaSubscriptionSourceResponse( in RadioResponseInfo info, in CdmaSubscriptionSource source); /** @@ -700,7 +695,7 @@ interface IRadioResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:INTERNAL_ERR */ - oneway void getCellInfoListResponse(in RadioResponseInfo info, in CellInfo[] cellInfo); + void getCellInfoListResponse(in RadioResponseInfo info, in CellInfo[] cellInfo); /** * @param info Response info struct containing response type, serial no. and error @@ -719,7 +714,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getClipResponse(in RadioResponseInfo info, in ClipStatus status); + void getClipResponse(in RadioResponseInfo info, in ClipStatus status); /** * @param info Response info struct containing response type, serial no. and error @@ -742,7 +737,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getClirResponse(in RadioResponseInfo info, in int n, in int m); + void getClirResponse(in RadioResponseInfo info, in int n, in int m); /** * @param info Response info struct containing respontype, serial no. and error @@ -757,7 +752,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getCurrentCallsResponse(in RadioResponseInfo info, in Call[] calls); + void getCurrentCallsResponse(in RadioResponseInfo info, in Call[] calls); /** * @param info Response info struct containing response type, serial no. and error @@ -769,8 +764,7 @@ interface IRadioResponse { * RadioError:INTERNAL_ERR * RadioError:SIM_ABSENT */ - oneway void getDataCallListResponse( - in RadioResponseInfo info, in SetupDataCallResult[] dcResponse); + void getDataCallListResponse(in RadioResponseInfo info, in SetupDataCallResult[] dcResponse); /** * @param info Response info struct containing response type, serial no. and error @@ -783,7 +777,7 @@ interface IRadioResponse { * RadioError:INTERNAL_ERR * RadioError:NOT_PROVISIONED */ - oneway void getDataRegistrationStateResponse( + void getDataRegistrationStateResponse( in RadioResponseInfo info, in RegStateResult dataRegResponse); /** @@ -809,8 +803,8 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void getDeviceIdentityResponse(in RadioResponseInfo info, in String imei, - in String imeisv, in String esn, in String meid); + void getDeviceIdentityResponse(in RadioResponseInfo info, in String imei, in String imeisv, + in String esn, in String meid); /** * @param info Response info struct containing response type, serial no. and error @@ -833,7 +827,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getFacilityLockForAppResponse(in RadioResponseInfo info, in int response); + void getFacilityLockForAppResponse(in RadioResponseInfo info, in int response); /** * @param info Response info struct containing response type, serial no. and error @@ -855,7 +849,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE */ - oneway void getGsmBroadcastConfigResponse( + void getGsmBroadcastConfigResponse( in RadioResponseInfo info, in GsmBroadcastSmsConfigInfo[] configs); /** @@ -867,7 +861,7 @@ interface IRadioResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void getHardwareConfigResponse(in RadioResponseInfo info, in HardwareConfig[] config); + void getHardwareConfigResponse(in RadioResponseInfo info, in HardwareConfig[] config); /** * @param info Response info struct containing response type, serial no. and error @@ -884,7 +878,7 @@ interface IRadioResponse { * RadioError:SIM_ERR * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void getIMSIForAppResponse(in RadioResponseInfo info, in String imsi); + void getIMSIForAppResponse(in RadioResponseInfo info, in String imsi); /** * @param info Response info struct containing response type, serial no. and error @@ -897,7 +891,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void getIccCardStatusResponse(in RadioResponseInfo info, in CardStatus cardStatus); + void getIccCardStatusResponse(in RadioResponseInfo info, in CardStatus cardStatus); /** * @param info Response info struct containing response type, serial no. and error @@ -915,7 +909,7 @@ interface IRadioResponse { * RadioError:INVALID_MODEM_STATE * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void getImsRegistrationStateResponse( + void getImsRegistrationStateResponse( in RadioResponseInfo info, in boolean isRegistered, in RadioTechnologyFamily ratFamily); /** @@ -963,7 +957,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getLastCallFailCauseResponse( + void getLastCallFailCauseResponse( in RadioResponseInfo info, in LastCallFailCauseInfo failCauseinfo); /** @@ -982,8 +976,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void getModemActivityInfoResponse( - in RadioResponseInfo info, in ActivityStatsInfo activityInfo); + void getModemActivityInfoResponse(in RadioResponseInfo info, in ActivityStatsInfo activityInfo); /** * @param info Response info struct containing response type, serial no. and error @@ -993,7 +986,7 @@ interface IRadioResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:MODEM_ERR */ - oneway void getModemStackStatusResponse(in RadioResponseInfo info, in boolean isEnabled); + void getModemStackStatusResponse(in RadioResponseInfo info, in boolean isEnabled); /** * @param info Response info struct containing response type, serial no. and error @@ -1014,7 +1007,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getMuteResponse(in RadioResponseInfo info, in boolean enable); + void getMuteResponse(in RadioResponseInfo info, in boolean enable); /** * @param info Response info struct containing response type, serial no. and error @@ -1033,7 +1026,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getNeighboringCidsResponse(in RadioResponseInfo info, in NeighboringCell[] cells); + void getNeighboringCidsResponse(in RadioResponseInfo info, in NeighboringCell[] cells); /** * @param info Response info struct containing response type, serial no. and error @@ -1051,7 +1044,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getNetworkSelectionModeResponse(in RadioResponseInfo info, in boolean manual); + void getNetworkSelectionModeResponse(in RadioResponseInfo info, in boolean manual); /** * @param info Response info struct containing response type, serial no. and error @@ -1069,7 +1062,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getOperatorResponse( + void getOperatorResponse( in RadioResponseInfo info, in String longName, in String shortName, in String numeric); /** @@ -1085,7 +1078,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES */ - oneway void getPreferredNetworkTypeBitmapResponse( + void getPreferredNetworkTypeBitmapResponse( in RadioResponseInfo info, in RadioAccessFamily networkTypeBitmap); /** @@ -1104,8 +1097,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getPreferredNetworkTypeResponse( - in RadioResponseInfo info, in PreferredNetworkType nwType); + void getPreferredNetworkTypeResponse(in RadioResponseInfo info, in PreferredNetworkType nwType); /** * @param info Response info struct containing response type, serial no. and error @@ -1124,7 +1116,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getPreferredVoicePrivacyResponse(in RadioResponseInfo info, in boolean enable); + void getPreferredVoicePrivacyResponse(in RadioResponseInfo info, in boolean enable); /** * @param info Response info struct containing response type, serial no. and error @@ -1141,7 +1133,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getRadioCapabilityResponse(in RadioResponseInfo info, in RadioCapability rc); + void getRadioCapabilityResponse(in RadioResponseInfo info, in RadioCapability rc); /** * @param info Response info struct containing response type, serial no. and error @@ -1152,8 +1144,7 @@ interface IRadioResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:INTERNAL_ERR */ - oneway void getSignalStrengthResponse( - in RadioResponseInfo info, in SignalStrength signalStrength); + void getSignalStrengthResponse(in RadioResponseInfo info, in SignalStrength signalStrength); /** * @param info Response info struct containing response type, serial no. and error @@ -1170,8 +1161,7 @@ interface IRadioResponse { * REQUEST_NOT_SUPPORTED may only be returned on devices that don't support this API, * indicated by the HAL capability CAPABILITY_SIM_PHONEBOOK_IN_MODEM. */ - oneway void getSimPhonebookCapacityResponse( - in RadioResponseInfo info, in PhonebookCapacity capacity); + void getSimPhonebookCapacityResponse(in RadioResponseInfo info, in PhonebookCapacity capacity); /** * @param info Response info struct containing response type, serial no. and error @@ -1187,7 +1177,7 @@ interface IRadioResponse { * REQUEST_NOT_SUPPORTED may only be returned on devices that don't support this API, * indicated by the HAL capability CAPABILITY_SIM_PHONEBOOK_IN_MODEM. */ - oneway void getSimPhonebookRecordsResponse(in RadioResponseInfo info); + void getSimPhonebookRecordsResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1199,7 +1189,7 @@ interface IRadioResponse { * RadioError:INTERNAL_ERR * RadioError:MODEM_ERR */ - oneway void getSlicingConfigResponse(in RadioResponseInfo info, in SlicingConfig slicingConfig); + void getSlicingConfigResponse(in RadioResponseInfo info, in SlicingConfig slicingConfig); /** * @param info Response info struct containing response type, serial no. and error @@ -1222,7 +1212,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:SIM_ABSENT */ - oneway void getSmscAddressResponse(in RadioResponseInfo info, in String smsc); + void getSmscAddressResponse(in RadioResponseInfo info, in String smsc); /** * @param info Response info struct containing response type, serial no. and error @@ -1234,7 +1224,7 @@ interface IRadioResponse { * RadioError:INTERNAL_ERR * RadioError:INVALID_ARGUMENTS */ - oneway void getSystemSelectionChannelsResponse( + void getSystemSelectionChannelsResponse( in RadioResponseInfo info, in RadioAccessSpecifier[] specifiers); /** @@ -1253,7 +1243,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void getTTYModeResponse(in RadioResponseInfo info, in TtyMode mode); + void getTTYModeResponse(in RadioResponseInfo info, in TtyMode mode); /** * @param info Response info struct containing response type, serial no. and error @@ -1268,7 +1258,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void getVoiceRadioTechnologyResponse(in RadioResponseInfo info, in RadioTechnology rat); + void getVoiceRadioTechnologyResponse(in RadioResponseInfo info, in RadioTechnology rat); /** * @param info Response info struct containing response type, serial no. and error @@ -1279,7 +1269,7 @@ interface IRadioResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:INTERNAL_ERR */ - oneway void getVoiceRegistrationStateResponse( + void getVoiceRegistrationStateResponse( in RadioResponseInfo info, in RegStateResult voiceRegResponse); /** @@ -1298,7 +1288,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ - oneway void handleStkCallSetupRequestFromSimResponse(in RadioResponseInfo info); + void handleStkCallSetupRequestFromSimResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1316,7 +1306,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void hangupConnectionResponse(in RadioResponseInfo info); + void hangupConnectionResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1337,7 +1327,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void hangupForegroundResumeBackgroundResponse(in RadioResponseInfo info); + void hangupForegroundResumeBackgroundResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1357,7 +1347,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:CANCELLED */ - oneway void hangupWaitingOrBackgroundResponse(in RadioResponseInfo info); + void hangupWaitingOrBackgroundResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1371,7 +1361,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void iccCloseLogicalChannelResponse(in RadioResponseInfo info); + void iccCloseLogicalChannelResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1390,7 +1380,7 @@ interface IRadioResponse { * RadioError:SIM_ERR * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void iccIOForAppResponse(in RadioResponseInfo info, in IccIoResult iccIo); + void iccIOForAppResponse(in RadioResponseInfo info, in IccIoResult iccIo); /** * @param info Response info struct containing response type, serial no. and error @@ -1412,7 +1402,7 @@ interface IRadioResponse { * RadioError:MISSING_RESOURCE * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void iccOpenLogicalChannelResponse( + void iccOpenLogicalChannelResponse( in RadioResponseInfo info, in int channelId, in byte[] selectResponse); /** @@ -1428,8 +1418,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void iccTransmitApduBasicChannelResponse( - in RadioResponseInfo info, in IccIoResult result); + void iccTransmitApduBasicChannelResponse(in RadioResponseInfo info, in IccIoResult result); /** * @param info Response info struct containing response type, serial no. and error @@ -1444,8 +1433,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void iccTransmitApduLogicalChannelResponse( - in RadioResponseInfo info, in IccIoResult result); + void iccTransmitApduLogicalChannelResponse(in RadioResponseInfo info, in IccIoResult result); /** * @param info Response info struct containing response type, serial no. and error @@ -1458,8 +1446,7 @@ interface IRadioResponse { * RadioError:INTERNAL_ERR * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void isNrDualConnectivityEnabledResponse( - in RadioResponseInfo info, in boolean isEnabled); + void isNrDualConnectivityEnabledResponse(in RadioResponseInfo info, in boolean isEnabled); /** * @param info Response info struct containing response type, serial no. and error @@ -1470,7 +1457,7 @@ interface IRadioResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void nvReadItemResponse(in RadioResponseInfo info, in String result); + void nvReadItemResponse(in RadioResponseInfo info, in String result); /** * @param info Response info struct containing response type, serial no. and error @@ -1480,7 +1467,7 @@ interface IRadioResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void nvResetConfigResponse(in RadioResponseInfo info); + void nvResetConfigResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1490,7 +1477,7 @@ interface IRadioResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void nvWriteCdmaPrlResponse(in RadioResponseInfo info); + void nvWriteCdmaPrlResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1500,7 +1487,7 @@ interface IRadioResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void nvWriteItemResponse(in RadioResponseInfo info); + void nvWriteItemResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1517,7 +1504,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:SIM_ABSENT */ - oneway void pullLceDataResponse(in RadioResponseInfo info, in LceDataInfo lceInfo); + void pullLceDataResponse(in RadioResponseInfo info, in LceDataInfo lceInfo); /** * @param info Response info struct containing response type, serial no. and error @@ -1539,7 +1526,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void rejectCallResponse(in RadioResponseInfo info); + void rejectCallResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1551,7 +1538,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void releasePduSessionIdResponse(in RadioResponseInfo info); + void releasePduSessionIdResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1571,7 +1558,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:SIM_ABSENT */ - oneway void reportSmsMemoryStatusResponse(in RadioResponseInfo info); + void reportSmsMemoryStatusResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1585,7 +1572,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void reportStkServiceIsRunningResponse(in RadioResponseInfo info); + void reportStkServiceIsRunningResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1603,8 +1590,7 @@ interface IRadioResponse { * RadioError:INVALID_ARGUMENTS * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void requestIccSimAuthenticationResponse( - in RadioResponseInfo info, in IccIoResult result); + void requestIccSimAuthenticationResponse(in RadioResponseInfo info, in IccIoResult result); /** * @param info Response info struct containing response type, serial no. and error @@ -1622,7 +1608,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ - oneway void requestIsimAuthenticationResponse(in RadioResponseInfo info, in String response); + void requestIsimAuthenticationResponse(in RadioResponseInfo info, in String response); /** * @param info Response info struct containing response type, serial no. and error @@ -1638,7 +1624,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void requestShutdownResponse(in RadioResponseInfo info); + void requestShutdownResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1659,7 +1645,7 @@ interface IRadioResponse { * RadioError:INVALID_MODEM_STATE * RadioError:OPERATION_NOT_ALLOWED */ - oneway void sendBurstDtmfResponse(in RadioResponseInfo info); + void sendBurstDtmfResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1680,7 +1666,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:OPERATION_NOT_ALLOWED */ - oneway void sendCDMAFeatureCodeResponse(in RadioResponseInfo info); + void sendCDMAFeatureCodeResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1714,7 +1700,7 @@ interface IRadioResponse { * RadioError:ACCESS_BARRED * RadioError:BLOCKED_DUE_TO_CALL */ - oneway void sendCdmaSmsExpectMoreResponse(in RadioResponseInfo info, in SendSmsResult sms); + void sendCdmaSmsExpectMoreResponse(in RadioResponseInfo info, in SendSmsResult sms); /** * @param info Response info struct containing response type, serial no. and error @@ -1748,7 +1734,7 @@ interface IRadioResponse { * RadioError:ACCESS_BARRED * RadioError:BLOCKED_DUE_TO_CALL */ - oneway void sendCdmaSmsResponse(in RadioResponseInfo info, in SendSmsResult sms); + void sendCdmaSmsResponse(in RadioResponseInfo info, in SendSmsResult sms); /** * @param info Response info struct containing response type, serial no. and error @@ -1764,7 +1750,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void sendDeviceStateResponse(in RadioResponseInfo info); + void sendDeviceStateResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1783,7 +1769,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE */ - oneway void sendDtmfResponse(in RadioResponseInfo info); + void sendDtmfResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1804,7 +1790,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ - oneway void sendEnvelopeResponse(in RadioResponseInfo info, in String commandResponse); + void sendEnvelopeResponse(in RadioResponseInfo info, in String commandResponse); /** * @param info Response info struct containing response type, serial no. and error @@ -1822,7 +1808,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ - oneway void sendEnvelopeWithStatusResponse(in RadioResponseInfo info, in IccIoResult iccIo); + void sendEnvelopeWithStatusResponse(in RadioResponseInfo info, in IccIoResult iccIo); /** * @param info Response info struct containing response type, serial no. and error @@ -1850,7 +1836,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void sendImsSmsResponse(in RadioResponseInfo info, in SendSmsResult sms); + void sendImsSmsResponse(in RadioResponseInfo info, in SendSmsResult sms); /** * @param info Response info struct containing response type, serial no. and error @@ -1881,7 +1867,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:SIM_ABSENT */ - oneway void sendSMSExpectMoreResponse(in RadioResponseInfo info, in SendSmsResult sms); + void sendSMSExpectMoreResponse(in RadioResponseInfo info, in SendSmsResult sms); /** * @param info Response info struct containing response type, serial no. and error @@ -1914,7 +1900,7 @@ interface IRadioResponse { * RadioError:ACCESS_BARRED * RadioError:BLOCKED_DUE_TO_CALL */ - oneway void sendSmsExpectMoreResponse(in RadioResponseInfo info, in SendSmsResult sms); + void sendSmsExpectMoreResponse(in RadioResponseInfo info, in SendSmsResult sms); /** * @param info Response info struct containing response type, serial no. and error @@ -1946,7 +1932,7 @@ interface IRadioResponse { * RadioError:ACCESS_BARRED * RadioError:BLOCKED_DUE_TO_CALL */ - oneway void sendSmsResponse(in RadioResponseInfo info, in SendSmsResult sms); + void sendSmsResponse(in RadioResponseInfo info, in SendSmsResult sms); /** * @param info Response info struct containing response type, serial no. and error @@ -1964,7 +1950,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ - oneway void sendTerminalResponseToSimResponse(in RadioResponseInfo info); + void sendTerminalResponseToSimResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -1990,7 +1976,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void sendUssdResponse(in RadioResponseInfo info); + void sendUssdResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2011,7 +1997,7 @@ interface IRadioResponse { * RadioError:INVALID_MODEM_STATE * RadioError:CANCELLED */ - oneway void separateConnectionResponse(in RadioResponseInfo info); + void separateConnectionResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2022,7 +2008,7 @@ interface IRadioResponse { * RadioError:INVALID_ARGUMENTS * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void setAllowedCarriersResponse(in RadioResponseInfo info); + void setAllowedCarriersResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2038,7 +2024,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES */ - oneway void setAllowedNetworkTypesBitmapResponse(in RadioResponseInfo info); + void setAllowedNetworkTypesBitmapResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2056,7 +2042,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void setBandModeResponse(in RadioResponseInfo info); + void setBandModeResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2077,7 +2063,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void setBarringPasswordResponse(in RadioResponseInfo info); + void setBarringPasswordResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2100,7 +2086,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void setCallForwardResponse(in RadioResponseInfo info); + void setCallForwardResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2123,7 +2109,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void setCallWaitingResponse(in RadioResponseInfo info); + void setCallWaitingResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2136,7 +2122,7 @@ interface IRadioResponse { * RadioError:INVALID_ARGUMENTS * RadioError:MODEM_INTERNAL_FAILURE */ - oneway void setCarrierInfoForImsiEncryptionResponse(in RadioResponseInfo info); + void setCarrierInfoForImsiEncryptionResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2157,7 +2143,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE */ - oneway void setCdmaBroadcastActivationResponse(in RadioResponseInfo info); + void setCdmaBroadcastActivationResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2177,7 +2163,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE */ - oneway void setCdmaBroadcastConfigResponse(in RadioResponseInfo info); + void setCdmaBroadcastConfigResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2196,7 +2182,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:SIM_ABSENT */ - oneway void setCdmaRoamingPreferenceResponse(in RadioResponseInfo info); + void setCdmaRoamingPreferenceResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2212,7 +2198,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void setCdmaSubscriptionSourceResponse(in RadioResponseInfo info); + void setCdmaSubscriptionSourceResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2228,7 +2214,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void setCellInfoListRateResponse(in RadioResponseInfo info); + void setCellInfoListRateResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2247,7 +2233,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void setClirResponse(in RadioResponseInfo info); + void setClirResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2266,7 +2252,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void setDataAllowedResponse(in RadioResponseInfo info); + void setDataAllowedResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2282,7 +2268,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ - oneway void setDataProfileResponse(in RadioResponseInfo info); + void setDataProfileResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2294,7 +2280,7 @@ interface IRadioResponse { * RadioError:INVALID_ARGUMENTS * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void setDataThrottlingResponse(in RadioResponseInfo info); + void setDataThrottlingResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2318,7 +2304,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void setFacilityLockForAppResponse(in RadioResponseInfo info, in int retry); + void setFacilityLockForAppResponse(in RadioResponseInfo info, in int retry); /** * @param info Response info struct containing response type, serial no. and error @@ -2339,7 +2325,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE */ - oneway void setGsmBroadcastActivationResponse(in RadioResponseInfo info); + void setGsmBroadcastActivationResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2359,7 +2345,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE */ - oneway void setGsmBroadcastConfigResponse(in RadioResponseInfo info); + void setGsmBroadcastConfigResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2371,7 +2357,7 @@ interface IRadioResponse { * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR */ - oneway void setIndicationFilterResponse(in RadioResponseInfo info); + void setIndicationFilterResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2390,7 +2376,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void setInitialAttachApnResponse(in RadioResponseInfo info); + void setInitialAttachApnResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2401,7 +2387,7 @@ interface IRadioResponse { * RadioError:RADIO_NOT_AVAILABLE * RadioError:INTERNAL_ERR */ - oneway void setLinkCapacityReportingCriteriaResponse(in RadioResponseInfo info); + void setLinkCapacityReportingCriteriaResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2419,7 +2405,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:SIM_ABSENT */ - oneway void setLocationUpdatesResponse(in RadioResponseInfo info); + void setLocationUpdatesResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2436,7 +2422,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void setMuteResponse(in RadioResponseInfo info); + void setMuteResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2458,7 +2444,7 @@ interface IRadioResponse { * Returns RadioError:ILLEGAL_SIM_OR_ME when the failure is permanent and * no retries needed, such as illegal SIM or ME. */ - oneway void setNetworkSelectionModeAutomaticResponse(in RadioResponseInfo info); + void setNetworkSelectionModeAutomaticResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2481,7 +2467,7 @@ interface IRadioResponse { * Returns RadioError:ILLEGAL_SIM_OR_ME when the failure is permanent and * no retries needed, such as illegal SIM or ME. */ - oneway void setNetworkSelectionModeManualResponse(in RadioResponseInfo info); + void setNetworkSelectionModeManualResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2493,7 +2479,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_STATE */ - oneway void setNrDualConnectivityStateResponse(in RadioResponseInfo info); + void setNrDualConnectivityStateResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2509,7 +2495,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES */ - oneway void setPreferredNetworkTypeBitmapResponse(in RadioResponseInfo info); + void setPreferredNetworkTypeBitmapResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2528,7 +2514,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void setPreferredNetworkTypeResponse(in RadioResponseInfo info); + void setPreferredNetworkTypeResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2546,7 +2532,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void setPreferredVoicePrivacyResponse(in RadioResponseInfo info); + void setPreferredVoicePrivacyResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2567,7 +2553,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void setRadioCapabilityResponse(in RadioResponseInfo info, in RadioCapability rc); + void setRadioCapabilityResponse(in RadioResponseInfo info, in RadioCapability rc); /** * @param info Response info struct containing response type, serial no. and error @@ -2579,7 +2565,7 @@ interface IRadioResponse { * RadioError:RF_HARDWARE_ISSUE * RadioError:NO_RF_CALIBRATION_INFO */ - oneway void setRadioPowerResponse(in RadioResponseInfo info); + void setRadioPowerResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2589,7 +2575,7 @@ interface IRadioResponse { * RadioError:INVALID_ARGUMENTS * RadioError:RADIO_NOT_AVAILABLE */ - oneway void setSignalStrengthReportingCriteriaResponse(in RadioResponseInfo info); + void setSignalStrengthReportingCriteriaResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2600,7 +2586,7 @@ interface IRadioResponse { * RadioError:INVALID_ARGUMENTS * RadioError:SIM_ERR (indicates a timeout or other issue making the SIM unresponsive) */ - oneway void setSimCardPowerResponse(in RadioResponseInfo info); + void setSimCardPowerResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2622,7 +2608,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:SIM_ABSENT */ - oneway void setSmscAddressResponse(in RadioResponseInfo info); + void setSmscAddressResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2641,7 +2627,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:SIM_ABSENT */ - oneway void setSuppServiceNotificationsResponse(in RadioResponseInfo info); + void setSuppServiceNotificationsResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2652,7 +2638,7 @@ interface IRadioResponse { * RadioError:INTERNAL_ERR * RadioError:INVALID_ARGUMENTS */ - oneway void setSystemSelectionChannelsResponse(in RadioResponseInfo info); + void setSystemSelectionChannelsResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2669,7 +2655,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void setTTYModeResponse(in RadioResponseInfo info); + void setTTYModeResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2687,7 +2673,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void setUiccSubscriptionResponse(in RadioResponseInfo info); + void setUiccSubscriptionResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2705,7 +2691,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES if the vendor is unable handle due to resources are full. * RadioError:SIM_ABSENT */ - oneway void setupDataCallResponse(in RadioResponseInfo info, in SetupDataCallResult dcResponse); + void setupDataCallResponse(in RadioResponseInfo info, in SetupDataCallResult dcResponse); /** * @param info Response info struct containing response type, serial no. and error @@ -2725,7 +2711,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE */ - oneway void startDtmfResponse(in RadioResponseInfo info); + void startDtmfResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2738,7 +2724,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_CALL_ID */ - oneway void startHandoverResponse(in RadioResponseInfo info); + void startHandoverResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2751,7 +2737,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:INVALID_ARGUMENTS */ - oneway void startKeepaliveResponse(in RadioResponseInfo info, in KeepaliveStatus status); + void startKeepaliveResponse(in RadioResponseInfo info, in KeepaliveStatus status); /** * @param info Response info struct containing response type, serial no. and error @@ -2767,7 +2753,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void startLceServiceResponse(in RadioResponseInfo info, in LceStatusInfo statusInfo); + void startLceServiceResponse(in RadioResponseInfo info, in LceStatusInfo statusInfo); /** * @param info Response info struct containing response type, serial no. and error @@ -2780,7 +2766,7 @@ interface IRadioResponse { * RadioError:MODEM_ERR * RadioError:INVALID_ARGUMENTS */ - oneway void startNetworkScanResponse(in RadioResponseInfo info); + void startNetworkScanResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2800,7 +2786,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:INVALID_MODEM_STATE */ - oneway void stopDtmfResponse(in RadioResponseInfo info); + void stopDtmfResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2809,7 +2795,7 @@ interface IRadioResponse { * RadioError:NONE * RadioError:INVALID_ARGUMENTS */ - oneway void stopKeepaliveResponse(in RadioResponseInfo info); + void stopKeepaliveResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2826,7 +2812,7 @@ interface IRadioResponse { * RadioError:CANCELLED * RadioError:SIM_ABSENT */ - oneway void stopLceServiceResponse(in RadioResponseInfo info, in LceStatusInfo statusInfo); + void stopLceServiceResponse(in RadioResponseInfo info, in LceStatusInfo statusInfo); /** * @param info Response info struct containing response type, serial no. and error @@ -2836,7 +2822,7 @@ interface IRadioResponse { * RadioError:INTERNAL_ERR * RadioError:MODEM_ERR */ - oneway void stopNetworkScanResponse(in RadioResponseInfo info); + void stopNetworkScanResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2855,7 +2841,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_PUK2 */ - oneway void supplyIccPin2ForAppResponse(in RadioResponseInfo info, in int remainingRetries); + void supplyIccPin2ForAppResponse(in RadioResponseInfo info, in int remainingRetries); /** * @param info Response info struct containing response type, serial no. and error @@ -2873,7 +2859,7 @@ interface IRadioResponse { * RadioError:INVALID_SIM_STATE * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void supplyIccPinForAppResponse(in RadioResponseInfo info, in int remainingRetries); + void supplyIccPinForAppResponse(in RadioResponseInfo info, in int remainingRetries); /** * @param info Response info struct containing response type, serial no. and error @@ -2891,7 +2877,7 @@ interface IRadioResponse { * RadioError:INVALID_SIM_STATE * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void supplyIccPuk2ForAppResponse(in RadioResponseInfo info, in int remainingRetries); + void supplyIccPuk2ForAppResponse(in RadioResponseInfo info, in int remainingRetries); /** * @param info Response info struct containing response type, serial no. and error @@ -2909,7 +2895,7 @@ interface IRadioResponse { * RadioError:INVALID_SIM_STATE * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void supplyIccPukForAppResponse(in RadioResponseInfo info, in int remainingRetries); + void supplyIccPukForAppResponse(in RadioResponseInfo info, in int remainingRetries); /** * @param info Response info struct containing response type, serial no. and error @@ -2930,8 +2916,7 @@ interface IRadioResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:SIM_ABSENT */ - oneway void supplyNetworkDepersonalizationResponse( - in RadioResponseInfo info, in int remainingRetries); + void supplyNetworkDepersonalizationResponse(in RadioResponseInfo info, in int remainingRetries); /** * @param info Response info struct containing response type, serial no. and error @@ -2952,7 +2937,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:REQUEST_NOT_SUPPORTED */ - oneway void supplySimDepersonalizationResponse( + void supplySimDepersonalizationResponse( in RadioResponseInfo info, in PersoSubstate persoType, in int remainingRetries); /** @@ -2975,7 +2960,7 @@ interface IRadioResponse { * RadioError:NO_RESOURCES * RadioError:CANCELLED */ - oneway void switchWaitingOrHoldingAndActiveResponse(in RadioResponseInfo info); + void switchWaitingOrHoldingAndActiveResponse(in RadioResponseInfo info); /** * @param info Response info struct containing response type, serial no. and error @@ -2996,8 +2981,7 @@ interface IRadioResponse { * REQUEST_NOT_SUPPORTED may only be returned on devices that don't support this API, * indicated by the HAL capability CAPABILITY_SIM_PHONEBOOK_IN_MODEM. */ - oneway void updateSimPhonebookRecordsResponse( - in RadioResponseInfo info, in int updatedRecordIndex); + void updateSimPhonebookRecordsResponse(in RadioResponseInfo info, in int updatedRecordIndex); /** * @param info Response info struct containing response type, serial no. and error @@ -3024,7 +3008,7 @@ interface IRadioResponse { * RadioError:INVALID_MODEM_STATE * RadioError:SIM_ABSENT */ - oneway void writeSmsToRuimResponse(in RadioResponseInfo info, in int index); + void writeSmsToRuimResponse(in RadioResponseInfo info, in int index); /** * @param info Response info struct containing response type, serial no. and error @@ -3051,5 +3035,5 @@ interface IRadioResponse { * RadioError:INVALID_MODEM_STATE * RadioError:SIM_ABSENT */ - oneway void writeSmsToSimResponse(in RadioResponseInfo info, in int index); + void writeSmsToSimResponse(in RadioResponseInfo info, in int index); } diff --git a/radio/aidl/android/hardware/radio/ISap.aidl b/radio/aidl/android/hardware/radio/ISap.aidl index 55950fd26e..1ca4fe7c12 100644 --- a/radio/aidl/android/hardware/radio/ISap.aidl +++ b/radio/aidl/android/hardware/radio/ISap.aidl @@ -24,7 +24,7 @@ import android.hardware.radio.SapTransferProtocol; * Empty top level interface. */ @VintfStability -interface ISap { +oneway interface ISap { /** * TRANSFER_APDU_REQ from SAP 1.1 spec 5.1.6 * @@ -32,7 +32,7 @@ interface ISap { * @param type APDU command type * @param command CommandAPDU/CommandAPDU7816 parameter depending on type */ - oneway void apduReq(in int token, in SapApduType type, in byte[] command); + void apduReq(in int token, in SapApduType type, in byte[] command); /** * CONNECT_REQ from SAP 1.1 spec 5.1.1 @@ -40,14 +40,14 @@ interface ISap { * @param token Id to match req-resp. Resp must include same token. * @param maxMsgSize MaxMsgSize to be used for SIM Access Profile connection */ - oneway void connectReq(in int token, in int maxMsgSize); + void connectReq(in int token, in int maxMsgSize); /** * DISCONNECT_REQ from SAP 1.1 spec 5.1.3 * * @param token Id to match req-resp. Resp must include same token. */ - oneway void disconnectReq(in int token); + void disconnectReq(in int token); /** * POWER_SIM_OFF_REQ and POWER_SIM_ON_REQ from SAP 1.1 spec 5.1.10 + 5.1.12 @@ -55,14 +55,14 @@ interface ISap { * @param token Id to match req-resp. Resp must include same token. * @param state true for on, false for off */ - oneway void powerReq(in int token, in boolean state); + void powerReq(in int token, in boolean state); /** * RESET_SIM_REQ from SAP 1.1 spec 5.1.14 * * @param token Id to match req-resp. Resp must include same token. */ - oneway void resetSimReq(in int token); + void resetSimReq(in int token); /** * Set callback that has response and unsolicited indication functions @@ -77,19 +77,19 @@ interface ISap { * @param token Id to match req-resp. Resp must include same token. * @param transferProtocol Transport Protocol */ - oneway void setTransferProtocolReq(in int token, in SapTransferProtocol transferProtocol); + void setTransferProtocolReq(in int token, in SapTransferProtocol transferProtocol); /** * TRANSFER_ATR_REQ from SAP 1.1 spec 5.1.8 * * @param token Id to match req-resp. Resp must include same token. */ - oneway void transferAtrReq(in int token); + void transferAtrReq(in int token); /** * TRANSFER_CARD_READER_STATUS_REQ from SAP 1.1 spec 5.1.17 * * @param token Id to match req-resp. Resp must include same token. */ - oneway void transferCardReaderStatusReq(in int token); + void transferCardReaderStatusReq(in int token); } diff --git a/radio/aidl/android/hardware/radio/ISapCallback.aidl b/radio/aidl/android/hardware/radio/ISapCallback.aidl index e7a4bac705..00e543b4f3 100644 --- a/radio/aidl/android/hardware/radio/ISapCallback.aidl +++ b/radio/aidl/android/hardware/radio/ISapCallback.aidl @@ -22,7 +22,7 @@ import android.hardware.radio.SapResultCode; import android.hardware.radio.SapStatus; @VintfStability -interface ISapCallback { +oneway interface ISapCallback { /** * TRANSFER_APDU_RESP from SAP 1.1 spec 5.1.7 * @@ -37,7 +37,7 @@ interface ISapCallback { * @param apduRsp APDU Response. Valid only if command was processed correctly and no error * occurred. */ - oneway void apduResponse(in int token, in SapResultCode resultCode, in byte[] apduRsp); + void apduResponse(in int token, in SapResultCode resultCode, in byte[] apduRsp); /** * CONNECT_RESP from SAP 1.1 spec 5.1.2 @@ -47,7 +47,7 @@ interface ISapCallback { * @param maxMsgSize MaxMsgSize supported by server if request cannot be fulfilled. * Valid only if connectResponse is SapConnectResponse:MSG_SIZE_TOO_LARGE. */ - oneway void connectResponse(in int token, in SapConnectRsp sapConnectRsp, in int maxMsgSize); + void connectResponse(in int token, in SapConnectRsp sapConnectRsp, in int maxMsgSize); /** * DISCONNECT_IND from SAP 1.1 spec 5.1.5 @@ -55,21 +55,21 @@ interface ISapCallback { * @param token Id to match req-resp. Value must match the one in req. * @param disconnectType Disconnect Type to indicate if shutdown is graceful or immediate */ - oneway void disconnectIndication(in int token, in SapDisconnectType disconnectType); + void disconnectIndication(in int token, in SapDisconnectType disconnectType); /** * DISCONNECT_RESP from SAP 1.1 spec 5.1.4 * * @param token Id to match req-resp. Value must match the one in req. */ - oneway void disconnectResponse(in int token); + void disconnectResponse(in int token); /** * ERROR_RESP from SAP 1.1 spec 5.1.19 * * @param token Id to match req-resp. Value must match the one in req. */ - oneway void errorResponse(in int token); + void errorResponse(in int token); /** * POWER_SIM_OFF_RESP and POWER_SIM_ON_RESP from SAP 1.1 spec 5.1.11 + 5.1.13 @@ -84,7 +84,7 @@ interface ISapCallback { * SapResultCode:CARD_REMOVED, * SapResultCode:CARD_ALREADY_POWERED_ON (possible only for power on req) */ - oneway void powerResponse(in int token, in SapResultCode resultCode); + void powerResponse(in int token, in SapResultCode resultCode); /** * RESET_SIM_RESP from SAP 1.1 spec 5.1.15 @@ -98,7 +98,7 @@ interface ISapCallback { * SapResultCode:CARD_ALREADY_POWERED_OFF, * SapResultCode:CARD_REMOVED */ - oneway void resetSimResponse(in int token, in SapResultCode resultCode); + void resetSimResponse(in int token, in SapResultCode resultCode); /** * STATUS_IND from SAP 1.1 spec 5.1.16 @@ -106,7 +106,7 @@ interface ISapCallback { * @param token Id to match req-resp. Value must match the one in req. * @param status Parameter to indicate reason for the status change. */ - oneway void statusIndication(in int token, in SapStatus status); + void statusIndication(in int token, in SapStatus status); /** * TRANSFER_ATR_RESP from SAP 1.1 spec 5.1.9 @@ -122,7 +122,7 @@ interface ISapCallback { * @param atr Answer to Reset from the subscription module. Included only if no error occurred, * otherwise empty. */ - oneway void transferAtrResponse(in int token, in SapResultCode resultCode, in byte[] atr); + void transferAtrResponse(in int token, in SapResultCode resultCode, in byte[] atr); /** * TRANSFER_CARD_READER_STATUS_REQ from SAP 1.1 spec 5.1.18 @@ -136,7 +136,7 @@ interface ISapCallback { * @param cardReaderStatus Card Reader Status coded as described in 3GPP TS 11.14 Section 12.33 * and TS 31.111 Section 8.33 */ - oneway void transferCardReaderStatusResponse( + void transferCardReaderStatusResponse( in int token, in SapResultCode resultCode, in int cardReaderStatus); /** @@ -148,5 +148,5 @@ interface ISapCallback { * SapResultCode:SUCCESS * SapResultCode:NOT_SUPPORTED */ - oneway void transferProtocolResponse(in int token, in SapResultCode resultCode); + void transferProtocolResponse(in int token, in SapResultCode resultCode); } diff --git a/radio/aidl/android/hardware/radio/ImsiEncryptionInfo.aidl b/radio/aidl/android/hardware/radio/ImsiEncryptionInfo.aidl index dbb0a9e2ed..3429beb7e8 100644 --- a/radio/aidl/android/hardware/radio/ImsiEncryptionInfo.aidl +++ b/radio/aidl/android/hardware/radio/ImsiEncryptionInfo.aidl @@ -16,13 +16,20 @@ package android.hardware.radio; -import android.hardware.radio.PublicKeyType; - /** * Carrier specific Information sent by the carrier, which will be used to encrypt IMSI and IMPI. */ @VintfStability parcelable ImsiEncryptionInfo { + /** + * Key type to be used for ePDG + */ + const byte PUBLIC_KEY_TYPE_EPDG = 1; + /** + * Key type to be used for WLAN + */ + const byte PUBLIC_KEY_TYPE_WLAN = 2; + /** * MCC of the Carrier. */ @@ -51,7 +58,8 @@ parcelable ImsiEncryptionInfo { */ long expirationTime; /** - * Public key type. + * Public key type from carrier certificate. + * Values are PUBLIC_KEY_TYPE_ */ - PublicKeyType keyType; + byte keyType; } diff --git a/radio/aidl/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl b/radio/aidl/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl deleted file mode 100644 index 4a863a7121..0000000000 --- a/radio/aidl/android/hardware/radio/IncrementalResultsPeriodicityRange.aidl +++ /dev/null @@ -1,27 +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. - */ - -package android.hardware.radio; - -/** - * Values are in seconds. - */ -@VintfStability -@Backing(type="int") -enum IncrementalResultsPeriodicityRange { - MIN = 1, - MAX = 10, -} diff --git a/radio/aidl/android/hardware/radio/KeepaliveRequest.aidl b/radio/aidl/android/hardware/radio/KeepaliveRequest.aidl index ef594ade53..1433b96397 100644 --- a/radio/aidl/android/hardware/radio/KeepaliveRequest.aidl +++ b/radio/aidl/android/hardware/radio/KeepaliveRequest.aidl @@ -16,14 +16,22 @@ package android.hardware.radio; -import android.hardware.radio.KeepaliveType; - @VintfStability parcelable KeepaliveRequest { + /** + * Keepalive specified by RFC 3948 Sec. 2.3 using IPv4 + */ + const int TYPE_NATT_IPV4 = 0; + /** + * Keepalive specified by RFC 3948 Sec. 2.3 using IPv6 + */ + const int TYPE_NATT_IPV6 = 1; + /** * The format of the keepalive packet + * Values are TYPE_ */ - KeepaliveType type; + int type; /** * Source address with type = family, in network byte order */ diff --git a/radio/aidl/android/hardware/radio/KeepaliveStatus.aidl b/radio/aidl/android/hardware/radio/KeepaliveStatus.aidl index 911cdae07a..0cf6767929 100644 --- a/radio/aidl/android/hardware/radio/KeepaliveStatus.aidl +++ b/radio/aidl/android/hardware/radio/KeepaliveStatus.aidl @@ -16,16 +16,29 @@ package android.hardware.radio; -import android.hardware.radio.KeepaliveStatusCode; - @VintfStability parcelable KeepaliveStatus { /** - * The sessionHandle provided by the API + * Keepalive is currently active. + */ + const int CODE_ACTIVE = 0; + /** + * Keepalive is inactive, which indicates an error. + */ + const int CODE_INACTIVE = 1; + /** + * Requested keepalive has not yet been processed by the modem. + * Only allowed in a RESPONSE message to a REQUEST. + */ + const int CODE_PENDING = 2; + + /** + * The sessionHandle provided by the API. */ int sessionHandle; /** - * Status for the given keepalive + * Status for the given keepalive. + * Values are CODE_ */ - KeepaliveStatusCode code; + int code; } diff --git a/radio/aidl/android/hardware/radio/KeepaliveStatusCode.aidl b/radio/aidl/android/hardware/radio/KeepaliveStatusCode.aidl deleted file mode 100644 index ed4b32777d..0000000000 --- a/radio/aidl/android/hardware/radio/KeepaliveStatusCode.aidl +++ /dev/null @@ -1,35 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum KeepaliveStatusCode { - /** - * Keepalive is currently active - */ - ACTIVE, - /** - * Keepalive is inactive, which indicates an error - */ - INACTIVE, - /** - * Requested keepalive has not yet been processed by the modem. - * Only allowed in a RESPONSE message to a REQUEST - */ - PENDING, -} diff --git a/radio/aidl/android/hardware/radio/KeepaliveType.aidl b/radio/aidl/android/hardware/radio/KeepaliveType.aidl deleted file mode 100644 index 86b1509f29..0000000000 --- a/radio/aidl/android/hardware/radio/KeepaliveType.aidl +++ /dev/null @@ -1,30 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum KeepaliveType { - /** - * Keepalive specified by RFC 3948 Sec. 2.3 using IPv4 - */ - NATT_IPV4, - /** - * Keepalive specified by RFC 3948 Sec. 2.3 using IPv6 - */ - NATT_IPV6, -} diff --git a/radio/aidl/android/hardware/radio/LceStatus.aidl b/radio/aidl/android/hardware/radio/LceStatus.aidl deleted file mode 100644 index 0d3a27e420..0000000000 --- a/radio/aidl/android/hardware/radio/LceStatus.aidl +++ /dev/null @@ -1,25 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum LceStatus { - NOT_SUPPORTED, - STOPPED, - ACTIVE, -} diff --git a/radio/aidl/android/hardware/radio/LceStatusInfo.aidl b/radio/aidl/android/hardware/radio/LceStatusInfo.aidl index e2b35e1a64..d663d38597 100644 --- a/radio/aidl/android/hardware/radio/LceStatusInfo.aidl +++ b/radio/aidl/android/hardware/radio/LceStatusInfo.aidl @@ -16,11 +16,16 @@ package android.hardware.radio; -import android.hardware.radio.LceStatus; - @VintfStability parcelable LceStatusInfo { - LceStatus lceStatus; + const int LCE_STATUS_NOT_SUPPORTED = 0; + const int LCE_STATUS_STOPPED = 1; + const int LCE_STATUS_ACTIVE = 2; + + /** + * Values are LCE_STATUS_ + */ + int lceStatus; /** * Actual LCE reporting interval, meaningful only if LceStatus = ACTIVE. */ diff --git a/radio/aidl/android/hardware/radio/LinkAddress.aidl b/radio/aidl/android/hardware/radio/LinkAddress.aidl index 6fc12c777d..0c18e271cc 100644 --- a/radio/aidl/android/hardware/radio/LinkAddress.aidl +++ b/radio/aidl/android/hardware/radio/LinkAddress.aidl @@ -16,13 +16,16 @@ package android.hardware.radio; -import android.hardware.radio.AddressProperty; - /** * Describes a data link address for mobile data connection. */ @VintfStability parcelable LinkAddress { + const int ADDRESS_PROPERTY_NONE = 0; + /** + * Indicates this address is deprecated + */ + const int ADDRESS_PROPERTY_DEPRECATED = 0x20; /** * The format is IP address with optional "/" prefix length (The format is defined in RFC-4291 * section 2.3). For example, "192.0.1.3", "192.0.1.11/16", or "2001:db8::1/64". Typically one @@ -31,9 +34,10 @@ parcelable LinkAddress { */ String address; /** - * The properties of the link address + * The properties of the link address, as defined in if_addr.h in the Linux kernel. + * Values are ADDRESS_PROPERTY_ */ - AddressProperty properties; + int addressProperties; /** * The time, as reported by SystemClock.elapsedRealtime(), when this link address will be or * was deprecated. -1 indicates this information is not available. At the time existing diff --git a/radio/aidl/android/hardware/radio/MaxSearchTimeRange.aidl b/radio/aidl/android/hardware/radio/MaxSearchTimeRange.aidl deleted file mode 100644 index babbd3cc47..0000000000 --- a/radio/aidl/android/hardware/radio/MaxSearchTimeRange.aidl +++ /dev/null @@ -1,27 +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. - */ - -package android.hardware.radio; - -/** - * Values are in seconds. - */ -@VintfStability -@Backing(type="int") -enum MaxSearchTimeRange { - MIN = 60, - MAX = 3600, -} diff --git a/radio/aidl/android/hardware/radio/MaybePort.aidl b/radio/aidl/android/hardware/radio/MaybePort.aidl deleted file mode 100644 index 169f90f794..0000000000 --- a/radio/aidl/android/hardware/radio/MaybePort.aidl +++ /dev/null @@ -1,28 +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. - */ - -package android.hardware.radio; - -import android.hardware.radio.PortRange; - -/** - * Port is optional, contains either single port or range of ports - */ -@VintfStability -union MaybePort { - boolean noinit; - PortRange range; -} diff --git a/radio/aidl/android/hardware/radio/MvnoType.aidl b/radio/aidl/android/hardware/radio/MvnoType.aidl deleted file mode 100644 index 0f0df6256b..0000000000 --- a/radio/aidl/android/hardware/radio/MvnoType.aidl +++ /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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum MvnoType { - /** - * None - */ - NONE, - /** - * The matching data is based on IMSI. - */ - IMSI, - /** - * The matching data is based on group id. - */ - GID, - /** - * The matching data is based service provider name. - */ - SPN, -} diff --git a/radio/aidl/android/hardware/radio/NetworkScanRequest.aidl b/radio/aidl/android/hardware/radio/NetworkScanRequest.aidl index 7659b89ae5..d495a9de58 100644 --- a/radio/aidl/android/hardware/radio/NetworkScanRequest.aidl +++ b/radio/aidl/android/hardware/radio/NetworkScanRequest.aidl @@ -17,15 +17,35 @@ package android.hardware.radio; import android.hardware.radio.RadioAccessSpecifier; -import android.hardware.radio.ScanType; @VintfStability parcelable NetworkScanRequest { - ScanType type; + const int INCREMENTAL_RESULTS_PREIODICITY_RANGE_MIN = 1; + const int INCREMENTAL_RESULTS_PREIODICITY_RANGE_MAX = 10; + + const int MAX_SEARCH_TIME_RANGE_MIN = 60; + const int MAX_SEARCH_TIME_RANGE_MAX = 3600; + + const int SCAN_INTERVAL_RANGE_MIN = 5; + const int SCAN_INTERVAL_RANGE_MAX = 300; + + /** + * Performs the scan only once + */ + const int SCAN_TYPE_ONE_SHOT = 0; + /** + * Performs the scan periodically until cancelled + */ + const int SCAN_TYPE_PERIODIC = 1; + + /** + * Values are SCAN_TYPE_ + */ + int type; /** * Time interval in seconds between the completion of one scan and the start of a subsequent * scan. Implementations may ignore this field unless the 'type' is 'PERIODIC'. - * Range: ScanIntervalRange:MIN to ScanIntervalRange:MAX. + * Range: SCAN_INTERVAL_RANGE_MIN to SCAN_INTERVAL_RANGE_MAX. */ int interval; /** @@ -35,7 +55,7 @@ parcelable NetworkScanRequest { RadioAccessSpecifier[] specifiers; /** * Maximum duration of the periodic search (in seconds). If the search lasts maxSearchTime, it - * must be terminated. Range: MaxSearchTimeRange:MIN to MaxSearchTimeRange:MAX + * must be terminated. Range: MAX_SEARCH_TIME_RANGE_MIN to MAX_SEARCH_TIME_RANGE_MAX */ int maxSearchTime; /** @@ -48,7 +68,7 @@ parcelable NetworkScanRequest { * Indicates the periodicity with which the modem must report incremental results to the client * (in seconds). Implementations may ignore this value if the incremental results are not * requested. This value must be less than or equal to maxSearchTime. - * Range: IncrementalResultsPeriodicityRange:MIN to IncrementalResultsPeriodicityRange:MAX + * Range: INCREMENTAL_RESULTS_PREIODICITY_RANGE_MIN to INCREMENTAL_RESULTS_PREIODICITY_RANGE_MAX */ int incrementalResultsPeriodicity; /** diff --git a/radio/aidl/android/hardware/radio/NetworkScanResult.aidl b/radio/aidl/android/hardware/radio/NetworkScanResult.aidl index c542a4753b..dd71d11627 100644 --- a/radio/aidl/android/hardware/radio/NetworkScanResult.aidl +++ b/radio/aidl/android/hardware/radio/NetworkScanResult.aidl @@ -18,14 +18,23 @@ package android.hardware.radio; import android.hardware.radio.CellInfo; import android.hardware.radio.RadioError; -import android.hardware.radio.ScanStatus; @VintfStability parcelable NetworkScanResult { + /** + * The result contains a part of the scan results. + */ + const int SCAN_STATUS_PARTIAL = 1; + /** + * The result contains the last part of the scan results. + */ + const int SCAN_STATUS_COMPLETE = 2; + /** * The status of the scan. + * Values are SCAN_STATUS_ */ - ScanStatus status; + int status; /** * The error code of the incremental result. */ diff --git a/radio/aidl/android/hardware/radio/NrQos.aidl b/radio/aidl/android/hardware/radio/NrQos.aidl index 3d0278c073..d791eefe80 100644 --- a/radio/aidl/android/hardware/radio/NrQos.aidl +++ b/radio/aidl/android/hardware/radio/NrQos.aidl @@ -23,6 +23,9 @@ import android.hardware.radio.QosBandwidth; */ @VintfStability parcelable NrQos { + const byte FLOW_ID_RANGE_MIN = 1; + const byte FLOW_ID_RANGE_MAX = 63; + /** * 5G QOS Identifier (5QI), see 3GPP TS 24.501 and 23.501. The allowed values are standard * values (1-9, 65-68, 69-70, 75, 79-80, 82-85) defined in the spec and operator specific values @@ -33,7 +36,7 @@ parcelable NrQos { QosBandwidth uplink; /** * QOS flow identifier of the QOS flow description in the range - * (QosFlowIdRange::MIN, QosFlowIdRange::MAX) + * (FLOW_ID_RANGE_MIN, FLOW_ID_RANGE_MAX) */ byte qfi; char averagingWindowMs; diff --git a/radio/aidl/android/hardware/radio/NrVopsInfo.aidl b/radio/aidl/android/hardware/radio/NrVopsInfo.aidl index 4d80f32962..0d01aaba3f 100644 --- a/radio/aidl/android/hardware/radio/NrVopsInfo.aidl +++ b/radio/aidl/android/hardware/radio/NrVopsInfo.aidl @@ -16,23 +16,67 @@ package android.hardware.radio; -import android.hardware.radio.EmcIndicator; -import android.hardware.radio.EmfIndicator; -import android.hardware.radio.VopsIndicator; - /** * Type to define the NR specific network capabilities for voice over PS including emergency and * normal voice calls. */ @VintfStability parcelable NrVopsInfo { + /** + * Emergency services not supported + */ + const byte EMC_INDICATOR_NOT_SUPPORTED = 0; + /** + * Emergency services supported in NR connected to 5GCN only + */ + const byte EMC_INDICATOR_NR_CONNECTED_TO_5GCN = 1; + /** + * Emergency services supported in E-UTRA connected to 5GCN only + */ + const byte EMC_INDICATOR_EUTRA_CONNECTED_TO_5GCN = 2; + /** + * Emergency services supported in NR connected to 5GCN and E-UTRA connected to 5GCN + */ + const byte EMC_INDICATOR_BOTH_NR_EUTRA_CONNECTED_TO_5GCN = 3; + + /** + * Emergency services fallback not supported + */ + const byte EMF_INDICATOR_NOT_SUPPORTED = 0; + /** + * Emergency services fallback supported in NR connected to 5GCN only + */ + const byte EMF_INDICATOR_NR_CONNECTED_TO_5GCN = 1; + /** + * Emergency services fallback supported in E-UTRA connected to 5GCN only + */ + const byte EMF_INDICATOR_EUTRA_CONNECTED_TO_5GCN = 2; + /** + * Emergency services fallback supported in NR connected to 5GCN and E-UTRA connected to 5GCN. + */ + const byte EMF_INDICATOR_BOTH_NR_EUTRA_CONNECTED_TO_5GCN = 3; + + /** + * IMS voice over PS session not supported + */ + const byte VOPS_INDICATOR_VOPS_NOT_SUPPORTED = 0; + /** + * IMS voice over PS session supported over 3GPP access + */ + const byte VOPS_INDICATOR_VOPS_OVER_3GPP = 1; + /** + * IMS voice over PS session supported over non-3GPP access + */ + const byte VOPS_INDICATOR_VOPS_OVER_NON_3GPP = 2; + /** * This indicates if the camped network supports VoNR services, and what kind of services * it supports. This information is received from NR network during NR NAS registration * procedure through NR REGISTRATION ACCEPT. * Refer 3GPP 24.501 EPS 5GS network feature support -> IMS VoPS + * Values are VOPS_INDICATOR */ - VopsIndicator vopsSupported; + byte vopsSupported; /** * This indicates if the camped network supports VoNR emergency service. This information * is received from NR network through two sources: @@ -42,13 +86,15 @@ parcelable NrVopsInfo { * Refer 3GPP 38.331 SIB1 : ims-EmergencySupport * If device is registered on NR, then this field indicates whether the cell * supports IMS emergency bearer services for UEs in limited service mode. + * Values are EMC_INDICATOR_ */ - EmcIndicator emcSupported; + byte emcSupported; /** * This indicates if the camped network supports VoNR emergency service fallback. This * information is received from NR network during NR NAS registration procedure through * NR REGISTRATION ACCEPT. * Refer 3GPP 24.501 EPS 5GS network feature support -> EMF + * Values are EMF_INDICATOR_ from TS 24.501 sec 9.10.3.5. */ - EmfIndicator emfSupported; + byte emfSupported; } diff --git a/radio/aidl/android/hardware/radio/OperatorInfo.aidl b/radio/aidl/android/hardware/radio/OperatorInfo.aidl index 4475ff5506..e0234fca8a 100644 --- a/radio/aidl/android/hardware/radio/OperatorInfo.aidl +++ b/radio/aidl/android/hardware/radio/OperatorInfo.aidl @@ -16,10 +16,13 @@ package android.hardware.radio; -import android.hardware.radio.OperatorStatus; - @VintfStability parcelable OperatorInfo { + const int STATUS_UNKNOWN = 0; + const int STATUS_AVAILABLE = 1; + const int STATUS_CURRENT = 2; + const int STATUS_FORBIDDEN = 3; + /** * Long alpha ONS or EONS */ @@ -32,5 +35,8 @@ parcelable OperatorInfo { * 5 or 6 digit numeric code (MCC + MNC) */ String operatorNumeric; - OperatorStatus status; + /** + * Values are STATUS_ + */ + int status; } diff --git a/radio/aidl/android/hardware/radio/OperatorStatus.aidl b/radio/aidl/android/hardware/radio/OperatorStatus.aidl deleted file mode 100644 index fcc31eca2f..0000000000 --- a/radio/aidl/android/hardware/radio/OperatorStatus.aidl +++ /dev/null @@ -1,26 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum OperatorStatus { - UNKNOWN, - AVAILABLE, - CURRENT, - FORBIDDEN, -} diff --git a/radio/aidl/android/hardware/radio/OptionalCsgInfo.aidl b/radio/aidl/android/hardware/radio/OptionalCsgInfo.aidl deleted file mode 100644 index f7856933a7..0000000000 --- a/radio/aidl/android/hardware/radio/OptionalCsgInfo.aidl +++ /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. - */ - -package android.hardware.radio; - -import android.hardware.radio.ClosedSubscriberGroupInfo; - -@VintfStability -union OptionalCsgInfo { - /** - * If no CSG info is provided by the cell, then this structure shall be present. - */ - boolean noinit; - /** - * If CSG info is provided by the cell, this structure shall be present. - */ - ClosedSubscriberGroupInfo csgInfo; -} diff --git a/radio/aidl/android/hardware/radio/OptionalDnn.aidl b/radio/aidl/android/hardware/radio/OptionalDnn.aidl deleted file mode 100644 index 1c38a7103c..0000000000 --- a/radio/aidl/android/hardware/radio/OptionalDnn.aidl +++ /dev/null @@ -1,27 +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. - */ - -package android.hardware.radio; - -/** - * This safe_union represents an optional DNN. DNN stands for Data Network Name and represents - * an APN as defined in 3GPP TS 23.003. - */ -@VintfStability -union OptionalDnn { - boolean noinit; - String value; -} diff --git a/radio/aidl/android/hardware/radio/OptionalOsAppId.aidl b/radio/aidl/android/hardware/radio/OptionalOsAppId.aidl deleted file mode 100644 index 4614601af6..0000000000 --- a/radio/aidl/android/hardware/radio/OptionalOsAppId.aidl +++ /dev/null @@ -1,28 +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. - */ - -package android.hardware.radio; - -import android.hardware.radio.OsAppId; - -/** - * This safe_union represents an optional OsAppId. - */ -@VintfStability -union OptionalOsAppId { - boolean noinit; - OsAppId value; -} diff --git a/radio/aidl/android/hardware/radio/OptionalPdpProtocolType.aidl b/radio/aidl/android/hardware/radio/OptionalPdpProtocolType.aidl deleted file mode 100644 index 7e51b83756..0000000000 --- a/radio/aidl/android/hardware/radio/OptionalPdpProtocolType.aidl +++ /dev/null @@ -1,28 +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. - */ - -package android.hardware.radio; - -import android.hardware.radio.PdpProtocolType; - -/** - * This safe_union represents an optional PdpProtocolType. - */ -@VintfStability -union OptionalPdpProtocolType { - boolean noinit; - PdpProtocolType value; -} diff --git a/radio/aidl/android/hardware/radio/OptionalSliceInfo.aidl b/radio/aidl/android/hardware/radio/OptionalSliceInfo.aidl deleted file mode 100644 index cfc309c49f..0000000000 --- a/radio/aidl/android/hardware/radio/OptionalSliceInfo.aidl +++ /dev/null @@ -1,28 +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. - */ - -package android.hardware.radio; - -import android.hardware.radio.SliceInfo; - -/** - * This safe_union represents an optional slice info. - */ -@VintfStability -union OptionalSliceInfo { - boolean noinit; - SliceInfo value; -} diff --git a/radio/aidl/android/hardware/radio/OptionalSscMode.aidl b/radio/aidl/android/hardware/radio/OptionalSscMode.aidl deleted file mode 100644 index 22933b93b3..0000000000 --- a/radio/aidl/android/hardware/radio/OptionalSscMode.aidl +++ /dev/null @@ -1,28 +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. - */ - -package android.hardware.radio; - -import android.hardware.radio.SscMode; - -/** - * This safe_union represents an optional SscMode. - */ -@VintfStability -union OptionalSscMode { - boolean noinit; - SscMode value; -} diff --git a/radio/aidl/android/hardware/radio/OptionalTrafficDescriptor.aidl b/radio/aidl/android/hardware/radio/OptionalTrafficDescriptor.aidl deleted file mode 100644 index b524cb3a77..0000000000 --- a/radio/aidl/android/hardware/radio/OptionalTrafficDescriptor.aidl +++ /dev/null @@ -1,28 +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. - */ - -package android.hardware.radio; - -import android.hardware.radio.TrafficDescriptor; - -/** - * This safe_union represents an optional TrafficDescriptor. - */ -@VintfStability -union OptionalTrafficDescriptor { - boolean noinit; - TrafficDescriptor value; -} diff --git a/radio/aidl/android/hardware/radio/P2Constant.aidl b/radio/aidl/android/hardware/radio/P2Constant.aidl deleted file mode 100644 index d40a44645a..0000000000 --- a/radio/aidl/android/hardware/radio/P2Constant.aidl +++ /dev/null @@ -1,26 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum P2Constant { - /** - * No P2 value is provided - */ - NO_P2 = -1, -} diff --git a/radio/aidl/android/hardware/radio/PortRange.aidl b/radio/aidl/android/hardware/radio/PortRange.aidl index 932d54a304..2b67e0eb2a 100644 --- a/radio/aidl/android/hardware/radio/PortRange.aidl +++ b/radio/aidl/android/hardware/radio/PortRange.aidl @@ -18,11 +18,14 @@ package android.hardware.radio; /** * Defines range of ports. start and end are the first and last port numbers (inclusive) in the - * range. Both start and end are in QosPortRange.MIN to QosPortRange.MAX range. A single port shall + * 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. */ @VintfStability parcelable PortRange { + const int PORT_RANGE_MIN = 20; + const int PORT_RANGE_MAX = 65535; + int start; int end; } diff --git a/radio/aidl/android/hardware/radio/PrlIndicator.aidl b/radio/aidl/android/hardware/radio/PrlIndicator.aidl deleted file mode 100644 index acd870e116..0000000000 --- a/radio/aidl/android/hardware/radio/PrlIndicator.aidl +++ /dev/null @@ -1,25 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum PrlIndicator { - NOT_REGISTERED = -1, - NOT_IN_PRL = 0, - IN_PRL = 1, -} diff --git a/radio/aidl/android/hardware/radio/PublicKeyType.aidl b/radio/aidl/android/hardware/radio/PublicKeyType.aidl deleted file mode 100644 index c1babc4356..0000000000 --- a/radio/aidl/android/hardware/radio/PublicKeyType.aidl +++ /dev/null @@ -1,33 +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. - */ - -package android.hardware.radio; - -/** - * Public key type from carrier certificate. - */ -@VintfStability -@Backing(type="byte") -enum PublicKeyType { - /** - * Key type to be used for ePDG - */ - EPDG = 1, - /** - * Key type to be used for WLAN - */ - WLAN = 2, -} diff --git a/radio/aidl/android/hardware/radio/QosFilter.aidl b/radio/aidl/android/hardware/radio/QosFilter.aidl index 717944a8fa..8b126490b2 100644 --- a/radio/aidl/android/hardware/radio/QosFilter.aidl +++ b/radio/aidl/android/hardware/radio/QosFilter.aidl @@ -16,18 +16,41 @@ package android.hardware.radio; -import android.hardware.radio.MaybePort; -import android.hardware.radio.QosFilterDirection; +import android.hardware.radio.PortRange; import android.hardware.radio.QosFilterIpsecSpi; import android.hardware.radio.QosFilterIpv6FlowLabel; import android.hardware.radio.QosFilterTypeOfService; -import android.hardware.radio.QosProtocol; /** * See 3gpp 24.008 10.5.6.12 and 3gpp 24.501 9.11.4.13 */ @VintfStability parcelable QosFilter { + const byte DIRECTION_DOWNLINK = 0; + const byte DIRECTION_UPLINK = 1; + const byte DIRECTION_BIDIRECTIONAL = 2; + + /** + * No protocol specified + */ + const byte PROTOCOL_UNSPECIFIED = -1; + /** + * Transmission Control Protocol + */ + const byte PROTOCOL_TCP = 6; + /** + * User Datagram Protocol + */ + const byte PROTOCOL_UDP = 17; + /** + * Encapsulating Security Payload Protocol + */ + const byte PROTOCOL_ESP = 50; + /** + * Authentication Header + */ + const byte PROTOCOL_AH = 51; + /** * Local and remote IP addresses, typically one IPv4 or one IPv6 or one of each. Addresses could * be with optional "/" prefix length, e.g.,"192.0.1.3" or "192.0.1.11/16 2001:db8::1/64". @@ -37,14 +60,18 @@ parcelable QosFilter { String[] localAddresses; String[] remoteAddresses; /** - * Local and remote port/ranges + * Local port/range + */ + @nullable PortRange localPort; + /** + * Remote port/range */ - MaybePort localPort; - MaybePort remotePort; + @nullable PortRange remotePort; /** - * QoS protocol + * Next header QoS protocol numbers defined by IANA, RFC 5237 + * Values are PROTOCOL_ */ - QosProtocol protocol; + byte protocol; /** * Type of service value or mask as defined in RFC 1349 */ @@ -59,8 +86,9 @@ parcelable QosFilter { QosFilterIpsecSpi spi; /** * Filter direction + * Values are DIRECTION_ */ - QosFilterDirection direction; + byte direction; /** * Specifies the order in which the filter needs to be matched. A lower numerical (positive) * value has a higher precedence. Set -1 when unspecified. diff --git a/radio/aidl/android/hardware/radio/QosFilterDirection.aidl b/radio/aidl/android/hardware/radio/QosFilterDirection.aidl deleted file mode 100644 index 7693c8cf2c..0000000000 --- a/radio/aidl/android/hardware/radio/QosFilterDirection.aidl +++ /dev/null @@ -1,25 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="byte") -enum QosFilterDirection { - DOWNLINK, - UPLINK, - BIDIRECTIONAL, -} diff --git a/radio/aidl/android/hardware/radio/QosFlowIdRange.aidl b/radio/aidl/android/hardware/radio/QosFlowIdRange.aidl deleted file mode 100644 index df2398b193..0000000000 --- a/radio/aidl/android/hardware/radio/QosFlowIdRange.aidl +++ /dev/null @@ -1,27 +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. - */ - -package android.hardware.radio; - -/** - * Allowed values for 5G QOS flow identifier - */ -@VintfStability -@Backing(type="byte") -enum QosFlowIdRange { - MIN = 1, - MAX = 63, -} diff --git a/radio/aidl/android/hardware/radio/QosPortRange.aidl b/radio/aidl/android/hardware/radio/QosPortRange.aidl deleted file mode 100644 index f3df19f956..0000000000 --- a/radio/aidl/android/hardware/radio/QosPortRange.aidl +++ /dev/null @@ -1,27 +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. - */ - -package android.hardware.radio; - -/** - * Allowed port numbers - */ -@VintfStability -@Backing(type="int") -enum QosPortRange { - MIN = 20, - MAX = 65535, -} diff --git a/radio/aidl/android/hardware/radio/QosProtocol.aidl b/radio/aidl/android/hardware/radio/QosProtocol.aidl deleted file mode 100644 index 05cd670b18..0000000000 --- a/radio/aidl/android/hardware/radio/QosProtocol.aidl +++ /dev/null @@ -1,45 +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. - */ - -package android.hardware.radio; - -/** - * Next header protocol numbers defined by IANA, RFC 5237 - */ -@VintfStability -@Backing(type="byte") -enum QosProtocol { - /** - * No protocol specified - */ - UNSPECIFIED = -1, - /** - * Transmission Control Protocol - */ - TCP = 6, - /** - * User Datagram Protocol - */ - UDP = 17, - /** - * Encapsulating Security Payload Protocol - */ - ESP = 50, - /** - * Authentication Header - */ - AH = 51, -} diff --git a/radio/aidl/android/hardware/radio/RadioCapability.aidl b/radio/aidl/android/hardware/radio/RadioCapability.aidl index d911b6facf..a94e96abce 100644 --- a/radio/aidl/android/hardware/radio/RadioCapability.aidl +++ b/radio/aidl/android/hardware/radio/RadioCapability.aidl @@ -17,16 +17,57 @@ package android.hardware.radio; import android.hardware.radio.RadioAccessFamily; -import android.hardware.radio.RadioCapabilityPhase; -import android.hardware.radio.RadioCapabilityStatus; @VintfStability parcelable RadioCapability { + /** + * Logical Modem's (LM) initial value and value after PHASE_FINISH completes. + */ + const int PHASE_CONFIGURED = 0; + /** + * PHASE_START is sent before PHASE_APPLY and indicates that an APPLY is forthcoming with these + * same parameters. + */ + const int PHASE_START = 1; + /** + * PHASE_APPLY is sent after all LM's receive PHASE_START and returned + * RadioCapability.status = 0. + * If any PHASE_START's fail, hal implementation must not send PHASE_APPLY. + */ + const int PHASE_APPLY = 2; + /** + * PHASE_UNSOL_RSP is sent with unsolicited radioCapability(). + */ + const int PHASE_UNSOL_RSP = 3; + /** + * PHASE_FINISH is sent after all commands have completed. If an error occurs in any previous + * command, the RadioAccessFamily and logicalModemUuid fields must be the prior configuration + * thus restoring the configuration to the previous value. An error returned by PHASE_FINISH + * will generally be ignored or may cause that LM to be removed from service. + */ + const int PHASE_FINISH = 4; + + /** + * This parameter has no meaning with PHASE_START, PHASE_APPLY. + */ + const int STATUS_NONE = 0; + /** + * Tell modem the action transaction of set radio capability was successful with PHASE_FINISH. + */ + const int STATUS_SUCCESS = 1; + /** + * Tell modem the action transaction of set radio capability failed with PHASE_FINISH. + */ + const int STATUS_FAIL = 2; + /** * Unique session value defined by framework returned in all "responses/unslo". */ int session; - RadioCapabilityPhase phase; + /** + * Values are PHASE_ + */ + int phase; /** * 32-bit bitmap of RadioAccessFamily. */ @@ -36,5 +77,8 @@ parcelable RadioCapability { * RadioConst:MAX_UUID_LENGTH is the max length. */ String logicalModemUuid; - RadioCapabilityStatus status; + /** + * Values are STATUS_ + */ + int status; } diff --git a/radio/aidl/android/hardware/radio/RadioCapabilityPhase.aidl b/radio/aidl/android/hardware/radio/RadioCapabilityPhase.aidl deleted file mode 100644 index a586300565..0000000000 --- a/radio/aidl/android/hardware/radio/RadioCapabilityPhase.aidl +++ /dev/null @@ -1,47 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum RadioCapabilityPhase { - /** - * Logical Modem's (LM) initial value and value after FINISH completes - */ - CONFIGURED, - /** - * START is sent before APPLY and indicates that an APPLY is forthcoming with these same - * parameters. - */ - START, - /** - * APPLY is sent after all LM's receive START and returned RadioCapability.status = 0. - * If any START's fail, hal implementation must not send APPLY. - */ - APPLY, - /** - * UNSOL_RSP is sent with unsolicited radioCapability() - */ - UNSOL_RSP, - /** - * FINISH is sent after all commands have completed. If an error occurs in any previous command, - * the RadioAccessFamily and logicalModemUuid fields must be the prior configuration thus - * restoring the configuration to the previous value. An error returned by FINISH will generally - * be ignored or may cause that LM to be removed from service. - */ - FINISH, -} diff --git a/radio/aidl/android/hardware/radio/RadioCapabilityStatus.aidl b/radio/aidl/android/hardware/radio/RadioCapabilityStatus.aidl deleted file mode 100644 index 5b90f38ea5..0000000000 --- a/radio/aidl/android/hardware/radio/RadioCapabilityStatus.aidl +++ /dev/null @@ -1,36 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum RadioCapabilityStatus { - /** - * This parameter has no meaning with RadioCapabilityPhase:START, RadioCapabilityPhase:APPLY - */ - NONE, - /** - * Tell modem the action transaction of set radio capability was successful with - * RadioCapabilityPhase:FINISH - */ - SUCCESS, - /** - * Tell modem the action transaction of set radio capability failed with - * RadioCapabilityPhase:FINISH - */ - FAIL, -} diff --git a/radio/aidl/android/hardware/radio/RadioCdmaSmsConst.aidl b/radio/aidl/android/hardware/radio/RadioCdmaSmsConst.aidl deleted file mode 100644 index f480077e3f..0000000000 --- a/radio/aidl/android/hardware/radio/RadioCdmaSmsConst.aidl +++ /dev/null @@ -1,37 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum RadioCdmaSmsConst { - ADDRESS_MAX = 36, - SUBADDRESS_MAX = 36, - BEARER_DATA_MAX = 255, - UDH_MAX_SND_SIZE = 128, - UDH_EO_DATA_SEGMENT_MAX = 131, - MAX_UD_HEADERS = 7, - USER_DATA_MAX = 229, - UDH_LARGE_PIC_SIZE = 128, - UDH_SMALL_PIC_SIZE = 32, - UDH_VAR_PIC_SIZE = 134, - UDH_ANIM_NUM_BITMAPS = 4, - UDH_LARGE_BITMAP_SIZE = 32, - UDH_SMALL_BITMAP_SIZE = 8, - UDH_OTHER_SIZE = 226, - IP_ADDRESS_SIZE = 4, -} diff --git a/radio/aidl/android/hardware/radio/RadioConst.aidl b/radio/aidl/android/hardware/radio/RadioConst.aidl index 815b3b95e8..2e1bcf04df 100644 --- a/radio/aidl/android/hardware/radio/RadioConst.aidl +++ b/radio/aidl/android/hardware/radio/RadioConst.aidl @@ -33,4 +33,8 @@ enum RadioConst { NUM_SERVICE_CLASSES = 7, NUM_TX_POWER_LEVELS = 5, RADIO_ACCESS_SPECIFIER_MAX_SIZE = 8, + /** + * No P2 value is provided + */ + P2_CONSTANT_NO_P2 = -1, } diff --git a/radio/aidl/android/hardware/radio/RadioFrequencyInfo.aidl b/radio/aidl/android/hardware/radio/RadioFrequencyInfo.aidl index e5aa9fb187..140d65af46 100644 --- a/radio/aidl/android/hardware/radio/RadioFrequencyInfo.aidl +++ b/radio/aidl/android/hardware/radio/RadioFrequencyInfo.aidl @@ -16,15 +16,31 @@ package android.hardware.radio; -import android.hardware.radio.FrequencyRange; - @VintfStability union RadioFrequencyInfo { + /** + * Indicates the frequency range is below 1GHz. + */ + const int FREQUENCY_RANGE_LOW = 1; + /** + * Indicates the frequency range is between 1GHz and 3GHz. + */ + const int FREQUENCY_RANGE_MID = 2; + /** + * Indicates the frequency range is between 3GHz and 6GHz. + */ + const int FREQUENCY_RANGE_HIGH = 3; + /** + * Indicates the frequency range is above 6GHz (millimeter wave frequency). + */ + const int FREQUENCY_RANGE_MMWAVE = 4; + boolean noinit; /** * A rough frequency range. + * Values are FREQUENCY_RANGE_ */ - FrequencyRange range; + int range; /** * The Absolute Radio Frequency Channel Number. */ diff --git a/radio/aidl/android/hardware/radio/RegStateResult.aidl b/radio/aidl/android/hardware/radio/RegStateResult.aidl index 4bc55c40c2..615392c011 100644 --- a/radio/aidl/android/hardware/radio/RegStateResult.aidl +++ b/radio/aidl/android/hardware/radio/RegStateResult.aidl @@ -16,10 +16,10 @@ package android.hardware.radio; +import android.hardware.radio.AccessTechnologySpecificInfo; import android.hardware.radio.CellIdentity; import android.hardware.radio.RadioTechnology; import android.hardware.radio.RegState; -import android.hardware.radio.RegStateResultAccessTechnologySpecificInfo; import android.hardware.radio.RegistrationFailCause; @VintfStability @@ -56,5 +56,5 @@ parcelable RegStateResult { /** * Access-technology-specific registration information, such as for CDMA2000. */ - RegStateResultAccessTechnologySpecificInfo accessTechnologySpecificInfo; + AccessTechnologySpecificInfo accessTechnologySpecificInfo; } diff --git a/radio/aidl/android/hardware/radio/RestrictedState.aidl b/radio/aidl/android/hardware/radio/RestrictedState.aidl deleted file mode 100644 index 1cf8be27f0..0000000000 --- a/radio/aidl/android/hardware/radio/RestrictedState.aidl +++ /dev/null @@ -1,27 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum RestrictedState { - NONE = 0x00, - CS_EMERGENCY = 0x01, - CS_NORMAL = 0x02, - CS_ALL = 0x04, - PS_ALL = 0x10, -} diff --git a/radio/aidl/android/hardware/radio/RouteSelectionDescriptor.aidl b/radio/aidl/android/hardware/radio/RouteSelectionDescriptor.aidl index 14591a0ddb..a1b482bcdd 100644 --- a/radio/aidl/android/hardware/radio/RouteSelectionDescriptor.aidl +++ b/radio/aidl/android/hardware/radio/RouteSelectionDescriptor.aidl @@ -16,8 +16,7 @@ package android.hardware.radio; -import android.hardware.radio.OptionalPdpProtocolType; -import android.hardware.radio.OptionalSscMode; +import android.hardware.radio.PdpProtocolType; import android.hardware.radio.SliceInfo; /** @@ -25,15 +24,24 @@ import android.hardware.radio.SliceInfo; */ @VintfStability parcelable RouteSelectionDescriptor { + const byte SSC_MODE_UNKNOWN = -1; + const byte SSC_MODE_1 = 1; + const byte SSC_MODE_2 = 2; + const byte SSC_MODE_3 = 3; + /** * Precedence value in the range of 0 to 255. Higher value has lower precedence. */ byte precedence; /** - * Valid values are IP, IPV6 and IPV4V6. + * Valid values are IP, IPV6, IPV4V6, and UNKNOWN. + */ + PdpProtocolType sessionType; + /** + * Session and service continuity mode as defined in 3GPP TS 23.501. + * Valid values are SSC_MODE_ */ - OptionalPdpProtocolType sessionType; - OptionalSscMode sscMode; + byte sscMode; /** * There can be 0 or more SliceInfo specified in a route descriptor. */ diff --git a/radio/aidl/android/hardware/radio/ScanIntervalRange.aidl b/radio/aidl/android/hardware/radio/ScanIntervalRange.aidl deleted file mode 100644 index 7ea4d123eb..0000000000 --- a/radio/aidl/android/hardware/radio/ScanIntervalRange.aidl +++ /dev/null @@ -1,27 +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. - */ - -package android.hardware.radio; - -/** - * Values are in seconds - */ -@VintfStability -@Backing(type="int") -enum ScanIntervalRange { - MIN = 5, - MAX = 300, -} diff --git a/radio/aidl/android/hardware/radio/ScanStatus.aidl b/radio/aidl/android/hardware/radio/ScanStatus.aidl deleted file mode 100644 index c9c436e36a..0000000000 --- a/radio/aidl/android/hardware/radio/ScanStatus.aidl +++ /dev/null @@ -1,30 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum ScanStatus { - /** - * The result contains a part of the scan results - */ - PARTIAL = 1, - /** - * The result contains the last part of the scan results - */ - COMPLETE = 2, -} diff --git a/radio/aidl/android/hardware/radio/ScanType.aidl b/radio/aidl/android/hardware/radio/ScanType.aidl deleted file mode 100644 index 66ed451fff..0000000000 --- a/radio/aidl/android/hardware/radio/ScanType.aidl +++ /dev/null @@ -1,30 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum ScanType { - /** - * Performs the scan only once - */ - ONE_SHOT, - /** - * Performs the scan periodically until cancelled - */ - PERIODIC, -} diff --git a/radio/aidl/android/hardware/radio/SelectUiccSub.aidl b/radio/aidl/android/hardware/radio/SelectUiccSub.aidl index 4db5e662b8..f762e9f953 100644 --- a/radio/aidl/android/hardware/radio/SelectUiccSub.aidl +++ b/radio/aidl/android/hardware/radio/SelectUiccSub.aidl @@ -16,16 +16,26 @@ package android.hardware.radio; -import android.hardware.radio.SubscriptionType; -import android.hardware.radio.UiccSubActStatus; - @VintfStability parcelable SelectUiccSub { + const int SUBSCRIPTION_TYPE_1 = 0; + const int SUBSCRIPTION_TYPE_2 = 1; + const int SUBSCRIPTION_TYPE_3 = 2; + + const int ACT_STATUS_DEACTIVATE = 0; + const int ACT_STATUS_ACTIVATE = 1; + int slot; /** * Array subscriptor from applications[RadioConst:CARD_MAX_APPS] in getIccCardStatus() */ int appIndex; - SubscriptionType subType; - UiccSubActStatus actStatus; + /** + * Values are SUBSCRIPTION_TYPE_ + */ + int subType; + /** + * Values are ACT_STATUS_ + */ + int actStatus; } diff --git a/radio/aidl/android/hardware/radio/SetupDataCallResult.aidl b/radio/aidl/android/hardware/radio/SetupDataCallResult.aidl index 5fc017cba8..0fae8b0d83 100644 --- a/radio/aidl/android/hardware/radio/SetupDataCallResult.aidl +++ b/radio/aidl/android/hardware/radio/SetupDataCallResult.aidl @@ -17,17 +17,48 @@ package android.hardware.radio; import android.hardware.radio.DataCallFailCause; -import android.hardware.radio.DataConnActiveStatus; -import android.hardware.radio.HandoverFailureMode; import android.hardware.radio.LinkAddress; -import android.hardware.radio.OptionalSliceInfo; import android.hardware.radio.PdpProtocolType; import android.hardware.radio.Qos; import android.hardware.radio.QosSession; +import android.hardware.radio.SliceInfo; import android.hardware.radio.TrafficDescriptor; @VintfStability parcelable SetupDataCallResult { + /** + * Indicates the data connection is inactive. + */ + const int DATA_CONNECTION_STATUS_INACTIVE = 0; + /** + * Indicates the data connection is active with physical link dormant. + */ + const int DATA_CONNECTION_STATUS_DORMANT = 1; + /** + * Indicates the data connection is active with physical link up. + */ + const int DATA_CONNECTION_STATUS_ACTIVE = 2; + + /** + * On data handover failure, fallback to the source data transport when the fail cause is due + * to a hand off preference change. + */ + const byte HANDOVER_FAILURE_MODE_LEGACY = 0; + /** + * On data handover failure, fallback to the source data transport. + */ + const byte HANDOVER_FAILURE_MODE_DO_FALLBACK = 1; + /** + * On data handover failure, retry the handover instead of falling back to the source data + * transport. + */ + const byte HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_HANDOVER = 2; + /** + * On data handover failure, setup a new data connection by sending a normal request to the + * underlying data service. + */ + const byte HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 3; + /** * Data call fail cause. DataCallFailCause.NONE if no error. */ @@ -47,8 +78,9 @@ parcelable SetupDataCallResult { int cid; /** * Data connection active status. + * Values are DATA_CONNECTION_STATUS_ */ - DataConnActiveStatus active; + int active; /** * PDP protocol type. If cause is DataCallFailCause.ONLY_SINGLE_BEARER_ALLOWED, this is the * protocol type supported, such as "IP" or "IPV6". @@ -98,8 +130,9 @@ parcelable SetupDataCallResult { QosSession[] qosSessions; /** * Specifies the fallback mode on an IWLAN handover failure. + * Values are HANDOVER_FAILURE_MODE_ */ - HandoverFailureMode handoverFailureMode; + byte handoverFailureMode; /** * The allocated pdu session id for this data call. A value of 0 means no pdu session id was * attached to this call. Reference: 3GPP TS 24.007 section 11.2.3.1b. @@ -108,7 +141,7 @@ parcelable SetupDataCallResult { /** * Slice used for this data call. It is valid only when this data call is on AccessNetwork:NGRAN */ - OptionalSliceInfo sliceInfo; + @nullable SliceInfo sliceInfo; /** * TrafficDescriptors for which this data call must be used. It only includes the TDs for which * a data call has been requested so far; it is not an exhaustive list. diff --git a/radio/aidl/android/hardware/radio/SignalMeasurementType.aidl b/radio/aidl/android/hardware/radio/SignalMeasurementType.aidl deleted file mode 100644 index d92ae91ae1..0000000000 --- a/radio/aidl/android/hardware/radio/SignalMeasurementType.aidl +++ /dev/null @@ -1,83 +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. - */ - -package android.hardware.radio; - -/** - * Defining signal strength type. - */ -@VintfStability -@Backing(type="int") -enum SignalMeasurementType { - /** - * Received Signal Strength Indication. - * Range: -113 dBm and -51 dBm - * Used RAN: GERAN, CDMA2000 - * Reference: 3GPP TS 27.007 section 8.5. - */ - RSSI = 1, - /** - * Received Signal Code Power. - * Range: -120 dBm to -25 dBm; - * Used RAN: UTRAN - * Reference: 3GPP TS 25.123, section 9.1.1.1 - */ - RSCP = 2, - /** - * Reference Signal Received Power. - * Range: -140 dBm to -44 dBm; - * Used RAN: EUTRAN - * Reference: 3GPP TS 36.133 9.1.4 - */ - RSRP = 3, - /** - * Reference Signal Received Quality - * Range: -34 dB to 3 dB; - * Used RAN: EUTRAN - * Reference: 3GPP TS 36.133 v12.6.0 section 9.1.7 - */ - RSRQ = 4, - /** - * Reference Signal Signal to Noise Ratio - * Range: -20 dB to 30 dB; - * Used RAN: EUTRAN - * Note: This field is optional; how to support it can be decided by the corresponding vendor. - * Though the response code is not enforced, vendor's implementation must ensure this interface - * does not crash. - */ - RSSNR = 5, - /** - * 5G SS reference signal received power. - * Range: -140 dBm to -44 dBm. - * Used RAN: NGRAN - * Reference: 3GPP TS 38.215. - */ - SSRSRP = 6, - /** - * 5G SS reference signal received quality. - * Range: -43 dB to 20 dB. - * Used RAN: NGRAN - * Reference: 3GPP TS 38.215, 3GPP TS 38.133 section 10 - */ - SSRSRQ = 7, - /** - * 5G SS signal-to-noise and interference ratio. - * Range: -23 dB to 40 dB - * Used RAN: NGRAN - * Reference: 3GPP TS 38.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1. - */ - SSSINR = 8, -} diff --git a/radio/aidl/android/hardware/radio/SignalThresholdInfo.aidl b/radio/aidl/android/hardware/radio/SignalThresholdInfo.aidl index 9274b42f6b..0d818b4e19 100644 --- a/radio/aidl/android/hardware/radio/SignalThresholdInfo.aidl +++ b/radio/aidl/android/hardware/radio/SignalThresholdInfo.aidl @@ -16,17 +16,75 @@ package android.hardware.radio; -import android.hardware.radio.SignalMeasurementType; - /** * Contains the threshold values of each signal measurement type. */ @VintfStability parcelable SignalThresholdInfo { + /** + * Received Signal Strength Indication. + * Range: -113 dBm and -51 dBm + * Used RAN: GERAN, CDMA2000 + * Reference: 3GPP TS 27.007 section 8.5. + */ + const int SIGNAL_MEASUREMENT_TYPE_RSSI = 1; + /** + * Received Signal Code Power. + * Range: -120 dBm to -25 dBm; + * Used RAN: UTRAN + * Reference: 3GPP TS 25.123, section 9.1.1.1 + */ + const int SIGNAL_MEASUREMENT_TYPE_RSCP = 2; + /** + * Reference Signal Received Power. + * Range: -140 dBm to -44 dBm; + * Used RAN: EUTRAN + * Reference: 3GPP TS 36.133 9.1.4 + */ + const int SIGNAL_MEASUREMENT_TYPE_RSRP = 3; + /** + * Reference Signal Received Quality + * Range: -34 dB to 3 dB; + * Used RAN: EUTRAN + * Reference: 3GPP TS 36.133 v12.6.0 section 9.1.7 + */ + const int SIGNAL_MEASUREMENT_TYPE_RSRQ = 4; + /** + * Reference Signal Signal to Noise Ratio + * Range: -20 dB to 30 dB; + * Used RAN: EUTRAN + * Note: This field is optional; how to support it can be decided by the corresponding vendor. + * Though the response code is not enforced, vendor's implementation must ensure this interface + * does not crash. + */ + const int SIGNAL_MEASUREMENT_TYPE_RSSNR = 5; + /** + * 5G SS reference signal received power. + * Range: -140 dBm to -44 dBm. + * Used RAN: NGRAN + * Reference: 3GPP TS 38.215. + */ + const int SIGNAL_MEASUREMENT_TYPE_SSRSRP = 6; + /** + * 5G SS reference signal received quality. + * Range: -43 dB to 20 dB. + * Used RAN: NGRAN + * Reference: 3GPP TS 38.215, 3GPP TS 38.133 section 10 + */ + const int SIGNAL_MEASUREMENT_TYPE_SSRSRQ = 7; + /** + * 5G SS signal-to-noise and interference ratio. + * Range: -23 dB to 40 dB + * Used RAN: NGRAN + * Reference: 3GPP TS 38.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1. + */ + const int SIGNAL_MEASUREMENT_TYPE_SSSINR = 8; + /** * Signal Measurement Type + * Values are SIGNAL_MEASUREMENT_TYPE_ */ - SignalMeasurementType signalMeasurement; + int signalMeasurement; /** * A hysteresis time in milliseconds to prevent flapping. A value of 0 disables hysteresis. */ diff --git a/radio/aidl/android/hardware/radio/SimRefreshResult.aidl b/radio/aidl/android/hardware/radio/SimRefreshResult.aidl index f4808886a7..9e38fff6b0 100644 --- a/radio/aidl/android/hardware/radio/SimRefreshResult.aidl +++ b/radio/aidl/android/hardware/radio/SimRefreshResult.aidl @@ -16,11 +16,25 @@ package android.hardware.radio; -import android.hardware.radio.SimRefreshType; - @VintfStability parcelable SimRefreshResult { - SimRefreshType type; + /** + * A file on SIM has been updated. + */ + const int TYPE_SIM_FILE_UPDATE = 0; + /** + * SIM initialized. All files should be re-read. + */ + const int TYPE_SIM_INIT = 1; + /** + * SIM reset. SIM power required, SIM may be locked and all files must be re-read. + */ + const int TYPE_SIM_RESET = 2; + + /** + * Values are TYPE_SIM_ + */ + int type; /** * EFID of the updated file if the result is SIM_FILE_UPDATE or 0 for any other result. */ diff --git a/radio/aidl/android/hardware/radio/SimRefreshType.aidl b/radio/aidl/android/hardware/radio/SimRefreshType.aidl deleted file mode 100644 index 996cdceb96..0000000000 --- a/radio/aidl/android/hardware/radio/SimRefreshType.aidl +++ /dev/null @@ -1,34 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum SimRefreshType { - /** - * A file on SIM has been updated. - */ - SIM_FILE_UPDATE, - /** - * SIM initialized. All files should be re-read. - */ - SIM_INIT, - /** - * SIM reset. SIM power required, SIM may be locked and all files must be re-read. - */ - SIM_RESET, -} diff --git a/radio/aidl/android/hardware/radio/SliceInfo.aidl b/radio/aidl/android/hardware/radio/SliceInfo.aidl index 91b00677b5..e5b435461d 100644 --- a/radio/aidl/android/hardware/radio/SliceInfo.aidl +++ b/radio/aidl/android/hardware/radio/SliceInfo.aidl @@ -16,18 +16,55 @@ package android.hardware.radio; -import android.hardware.radio.SliceServiceType; -import android.hardware.radio.SliceStatus; - /** * This struct represents a S-NSSAI as defined in 3GPP TS 24.501. */ @VintfStability parcelable SliceInfo { + /* + * Not specified + */ + const byte SERVICE_TYPE_NONE = 0; + /* + * Slice suitable for the handling of 5G enhanced Mobile Broadband + */ + const byte SERVICE_TYPE_EMBB = 1; + /** + * Slice suitable for the handling of ultra-reliable low latency communications + */ + const byte SERVICE_TYPE_URLLC = 2; + /* + * Slice suitable for the handling of massive IoT + */ + const byte SERVICE_TYPE_MIOT = 3; + + const byte STATUS_UNKNOWN = 0; + /** + * Configured but not allowed or rejected yet + */ + const byte STATUS_CONFIGURED = 1; + /** + * Allowed to be used + */ + const byte STATUS_ALLOWED = 2; + /** + * Rejected because not available in PLMN + */ + const byte STATUS_REJECTED_NOT_AVAILABLE_IN_PLMN = 3; + /** + * Rejected because not available in reg area + */ + const byte STATUS_REJECTED_NOT_AVAILABLE_IN_REG_AREA = 4; + /** + * Considered valid when configured/allowed slices are not available + */ + const byte STATUS_DEFAULT_CONFIGURED = 5; + /** * The type of service provided by the slice. See: 3GPP TS 24.501 Section 9.11.2.8. + * Values are SERVICE_TYPE_ */ - SliceServiceType sst; + byte sliceServiceType; /** * Slice differentiator is the identifier of a slice that has SliceServiceType as SST. A value * of -1 indicates that there is no corresponding SliceInfo of the HPLMN. @@ -37,8 +74,9 @@ parcelable SliceInfo { /** * This SST corresponds to a SliceInfo (S-NSSAI) of the HPLMN; the SST is mapped to this value. * See: 3GPP TS 24.501 Section 9.11.2.8. + * Values are SERVICE_TYPE_ */ - SliceServiceType mappedHplmnSst; + byte mappedHplmnSst; /** * Present only if both sliceDifferentiator and mappedHplmnSst are also present. This SD * corresponds to a SliceInfo (S-NSSAI) of the HPLMN; sliceDifferentiator is mapped to this @@ -48,6 +86,7 @@ parcelable SliceInfo { int mappedHplmnSD; /** * Field to indicate the current status of the slice. + * Values are STATUS_ */ - SliceStatus status; + byte status; } diff --git a/radio/aidl/android/hardware/radio/SliceServiceType.aidl b/radio/aidl/android/hardware/radio/SliceServiceType.aidl deleted file mode 100644 index 624dfb1050..0000000000 --- a/radio/aidl/android/hardware/radio/SliceServiceType.aidl +++ /dev/null @@ -1,41 +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. - */ - -package android.hardware.radio; - -/** - * Slice/Service Type as defined in 3GPP TS 23.501. - */ -@VintfStability -@Backing(type="byte") -enum SliceServiceType { - /* - * Not specified - */ - NONE, - /* - * Slice suitable for the handling of 5G enhanced Mobile Broadband - */ - EMBB, - /** - * Slice suitable for the handling of ultra-reliable low latency communications - */ - URLLC, - /* - * Slice suitable for the handling of massive IoT - */ - MIOT, -} diff --git a/radio/aidl/android/hardware/radio/SliceStatus.aidl b/radio/aidl/android/hardware/radio/SliceStatus.aidl deleted file mode 100644 index 076e23b269..0000000000 --- a/radio/aidl/android/hardware/radio/SliceStatus.aidl +++ /dev/null @@ -1,43 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="byte") -enum SliceStatus { - UNKNOWN, - /** - * Configured but not allowed or rejected yet - */ - CONFIGURED, - /** - * Allowed to be used - */ - ALLOWED, - /** - * Rejected because not available in PLMN - */ - REJECTED_NOT_AVAILABLE_IN_PLMN, - /** - * Rejected because not available in reg area - */ - REJECTED_NOT_AVAILABLE_IN_REG_AREA, - /** - * Considered valid when configured/allowed slices are not available - */ - DEFAULT_CONFIGURED, -} diff --git a/radio/aidl/android/hardware/radio/SmsWriteArgs.aidl b/radio/aidl/android/hardware/radio/SmsWriteArgs.aidl index f7a3fd49e2..7258e0aeef 100644 --- a/radio/aidl/android/hardware/radio/SmsWriteArgs.aidl +++ b/radio/aidl/android/hardware/radio/SmsWriteArgs.aidl @@ -16,14 +16,18 @@ package android.hardware.radio; -import android.hardware.radio.SmsWriteArgsStatus; - @VintfStability parcelable SmsWriteArgs { + const int STATUS_REC_UNREAD = 0; + const int STATUS_REC_READ = 1; + const int STATUS_STO_UNSENT = 2; + const int STATUS_STO_SENT = 3; + /** * Status of message. See TS 27.005 3.1. + * Values are STATUS_ */ - SmsWriteArgsStatus status; + int status; /** * PDU of message to write, as an ASCII hex string less the SMSC address, the TP-layer length * is strlen(pdu)/2. diff --git a/radio/aidl/android/hardware/radio/SmsWriteArgsStatus.aidl b/radio/aidl/android/hardware/radio/SmsWriteArgsStatus.aidl deleted file mode 100644 index 095c71eff6..0000000000 --- a/radio/aidl/android/hardware/radio/SmsWriteArgsStatus.aidl +++ /dev/null @@ -1,26 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum SmsWriteArgsStatus { - REC_UNREAD, - REC_READ, - STO_UNSENT, - STO_SENT, -} diff --git a/radio/aidl/android/hardware/radio/SsRequestType.aidl b/radio/aidl/android/hardware/radio/SsRequestType.aidl deleted file mode 100644 index f3decbefa6..0000000000 --- a/radio/aidl/android/hardware/radio/SsRequestType.aidl +++ /dev/null @@ -1,27 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum SsRequestType { - ACTIVATION, - DEACTIVATION, - INTERROGATION, - REGISTRATION, - ERASURE, -} diff --git a/radio/aidl/android/hardware/radio/SsServiceType.aidl b/radio/aidl/android/hardware/radio/SsServiceType.aidl deleted file mode 100644 index eb344f45be..0000000000 --- a/radio/aidl/android/hardware/radio/SsServiceType.aidl +++ /dev/null @@ -1,41 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum SsServiceType { - CFU, - CF_BUSY, - CF_NO_REPLY, - CF_NOT_REACHABLE, - CF_ALL, - CF_ALL_CONDITIONAL, - CLIP, - CLIR, - COLP, - COLR, - WAIT, - BAOC, - BAOIC, - BAOIC_EXC_HOME, - BAIC, - BAIC_ROAMING, - ALL_BARRING, - OUTGOING_BARRING, - INCOMING_BARRING, -} diff --git a/radio/aidl/android/hardware/radio/SsTeleserviceType.aidl b/radio/aidl/android/hardware/radio/SsTeleserviceType.aidl deleted file mode 100644 index c11bbfa05d..0000000000 --- a/radio/aidl/android/hardware/radio/SsTeleserviceType.aidl +++ /dev/null @@ -1,28 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum SsTeleserviceType { - ALL_TELE_AND_BEARER_SERVICES, - ALL_TELESEVICES, - TELEPHONY, - ALL_DATA_TELESERVICES, - SMS_SERVICES, - ALL_TELESERVICES_EXCEPT_SMS, -} diff --git a/radio/aidl/android/hardware/radio/SscMode.aidl b/radio/aidl/android/hardware/radio/SscMode.aidl deleted file mode 100644 index 8722048019..0000000000 --- a/radio/aidl/android/hardware/radio/SscMode.aidl +++ /dev/null @@ -1,28 +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. - */ - -package android.hardware.radio; - -/** - * Enum representing session and service continuity mode as defined in 3GPP TS 23.501. - */ -@VintfStability -@Backing(type="byte") -enum SscMode { - MODE_1 = 1, - MODE_2 = 2, - MODE_3 = 3, -} diff --git a/radio/aidl/android/hardware/radio/StkCcUnsolSsResult.aidl b/radio/aidl/android/hardware/radio/StkCcUnsolSsResult.aidl index 0895f9885b..d73f68751b 100644 --- a/radio/aidl/android/hardware/radio/StkCcUnsolSsResult.aidl +++ b/radio/aidl/android/hardware/radio/StkCcUnsolSsResult.aidl @@ -19,17 +19,69 @@ package android.hardware.radio; import android.hardware.radio.CfData; import android.hardware.radio.RadioError; import android.hardware.radio.SsInfoData; -import android.hardware.radio.SsRequestType; -import android.hardware.radio.SsServiceType; -import android.hardware.radio.SsTeleserviceType; -import android.hardware.radio.SuppServiceClass; @VintfStability parcelable StkCcUnsolSsResult { - SsServiceType serviceType; - SsRequestType requestType; - SsTeleserviceType teleserviceType; - SuppServiceClass serviceClass; + const int REQUEST_TYPE_ACTIVATION = 0; + const int REQUEST_TYPE_DEACTIVATION = 1; + const int REQUEST_TYPE_INTERROGATION = 2; + const int REQUEST_TYPE_REGISTRATION = 3; + const int REQUEST_TYPE_ERASURE = 4; + + const int SERVICE_TYPE_CFU = 0; + const int SERVICE_TYPE_CF_BUSY = 1; + const int SERVICE_TYPE_CF_NO_REPLY = 2; + const int SERVICE_TYPE_CF_NOT_REACHABLE = 3; + const int SERVICE_TYPE_CF_ALL = 4; + const int SERVICE_TYPE_CF_ALL_CONDITIONAL = 5; + const int SERVICE_TYPE_CLIP = 6; + const int SERVICE_TYPE_CLIR = 7; + const int SERVICE_TYPE_COLP = 8; + const int SERVICE_TYPE_COLR = 9; + const int SERVICE_TYPE_WAIT = 10; + const int SERVICE_TYPE_BAOC = 11; + const int SERVICE_TYPE_BAOIC = 12; + const int SERVICE_TYPE_BAOIC_EXC_HOME = 13; + const int SERVICE_TYPE_BAIC = 14; + const int SERVICE_TYPE_BAIC_ROAMING = 15; + const int SERVICE_TYPE_ALL_BARRING = 16; + const int SERVICE_TYPE_OUTGOING_BARRING = 17; + const int SERVICE_TYPE_INCOMING_BARRING = 18; + + const int TELESERVICE_TYPE_ALL_TELE_AND_BEARER_SERVICES = 0; + const int TELESERVICE_TYPE_ALL_TELESEVICES = 1; + const int TELESERVICE_TYPE_TELEPHONY = 2; + const int TELESERVICE_TYPE_ALL_DATA_TELESERVICES = 3; + 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; + + /** + * Values are SERVICE_TYPE_ + */ + int serviceType; + /** + * Values are REQUEST_TYPE_ + */ + int requestType; + /** + * Values are TELESERVICE_TYPE_ + */ + int teleserviceType; + /** + * Values are a bitfield of SUPP_SERVICE_CLASS_ + */ + int serviceClass; RadioError result; /** * Valid only for all SsServiceType except SsServiceType:CF_* else empty. diff --git a/radio/aidl/android/hardware/radio/SubscriptionType.aidl b/radio/aidl/android/hardware/radio/SubscriptionType.aidl deleted file mode 100644 index 47c54f77a6..0000000000 --- a/radio/aidl/android/hardware/radio/SubscriptionType.aidl +++ /dev/null @@ -1,25 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum SubscriptionType { - SUBSCRIPTION_1, - SUBSCRIPTION_2, - SUBSCRIPTION_3, -} diff --git a/radio/aidl/android/hardware/radio/SuppServiceClass.aidl b/radio/aidl/android/hardware/radio/SuppServiceClass.aidl deleted file mode 100644 index 79e73ceffd..0000000000 --- a/radio/aidl/android/hardware/radio/SuppServiceClass.aidl +++ /dev/null @@ -1,32 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum SuppServiceClass { - NONE = 0, - VOICE = 1 << 0, - DATA = 1 << 1, - FAX = 1 << 2, - SMS = 1 << 3, - DATA_SYNC = 1 << 4, - DATA_ASYNC = 1 << 5, - PACKET = 1 << 6, - PAD = 1 << 7, - MAX = 1 << 7, -} diff --git a/radio/aidl/android/hardware/radio/TimeStampType.aidl b/radio/aidl/android/hardware/radio/TimeStampType.aidl deleted file mode 100644 index f76a032e16..0000000000 --- a/radio/aidl/android/hardware/radio/TimeStampType.aidl +++ /dev/null @@ -1,27 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum TimeStampType { - UNKNOWN, - ANTENNA, - MODEM, - OEM_RIL, - JAVA_RIL, -} diff --git a/radio/aidl/android/hardware/radio/TrafficDescriptor.aidl b/radio/aidl/android/hardware/radio/TrafficDescriptor.aidl index 4c41e8c89b..2580a4c069 100644 --- a/radio/aidl/android/hardware/radio/TrafficDescriptor.aidl +++ b/radio/aidl/android/hardware/radio/TrafficDescriptor.aidl @@ -16,8 +16,7 @@ package android.hardware.radio; -import android.hardware.radio.OptionalDnn; -import android.hardware.radio.OptionalOsAppId; +import android.hardware.radio.OsAppId; /** * This struct represents a traffic descriptor. A valid struct must have at least one of the @@ -29,9 +28,9 @@ parcelable TrafficDescriptor { /** * DNN stands for Data Network Name and represents an APN as defined in 3GPP TS 23.003. */ - OptionalDnn dnn; + @nullable String dnn; /** * Indicates the OsId + OsAppId (used as category in Android). */ - OptionalOsAppId osAppId; + @nullable OsAppId osAppId; } diff --git a/radio/aidl/android/hardware/radio/Translate.java b/radio/aidl/android/hardware/radio/Translate.java deleted file mode 100644 index a5d32b4e98..0000000000 --- a/radio/aidl/android/hardware/radio/Translate.java +++ /dev/null @@ -1,2520 +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. - */ - -package android.hardware.radio; - -import java.util.List; - -public class Translate { - static public android.hardware.radio.IccIo h2aTranslate(android.hardware.radio.V1_0.IccIo in) { - android.hardware.radio.IccIo out = new android.hardware.radio.IccIo(); - out.command = in.command; - out.fileId = in.fileId; - out.path = in.path; - out.p1 = in.p1; - out.p2 = in.p2; - out.p3 = in.p3; - out.data = in.data; - out.pin2 = in.pin2; - out.aid = in.aid; - return out; - } - - static public android.hardware.radio.NeighboringCell h2aTranslate( - android.hardware.radio.V1_0.NeighboringCell in) { - android.hardware.radio.NeighboringCell out = new android.hardware.radio.NeighboringCell(); - out.cid = in.cid; - out.rssi = in.rssi; - return out; - } - - static public android.hardware.radio.UusInfo h2aTranslate( - android.hardware.radio.V1_0.UusInfo in) { - android.hardware.radio.UusInfo out = new android.hardware.radio.UusInfo(); - out.uusType = in.uusType; - out.uusDcs = in.uusDcs; - out.uusData = in.uusData; - return out; - } - - static public android.hardware.radio.Dial h2aTranslate(android.hardware.radio.V1_0.Dial in) { - android.hardware.radio.Dial out = new android.hardware.radio.Dial(); - out.address = in.address; - out.clir = in.clir; - if (in.uusInfo != null) { - out.uusInfo = new android.hardware.radio.UusInfo[in.uusInfo.size()]; - for (int i = 0; i < in.uusInfo.size(); i++) { - out.uusInfo[i] = h2aTranslate(in.uusInfo.get(i)); - } - } - return out; - } - - static public android.hardware.radio.LastCallFailCauseInfo h2aTranslate( - android.hardware.radio.V1_0.LastCallFailCauseInfo in) { - android.hardware.radio.LastCallFailCauseInfo out = - new android.hardware.radio.LastCallFailCauseInfo(); - out.causeCode = in.causeCode; - out.vendorCause = in.vendorCause; - return out; - } - - static public android.hardware.radio.GsmSignalStrength h2aTranslate( - android.hardware.radio.V1_0.GsmSignalStrength in) { - android.hardware.radio.GsmSignalStrength out = - new android.hardware.radio.GsmSignalStrength(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.signalStrength > 2147483647 || in.signalStrength < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.signalStrength"); - } - out.signalStrength = in.signalStrength; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.bitErrorRate > 2147483647 || in.bitErrorRate < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.bitErrorRate"); - } - out.bitErrorRate = in.bitErrorRate; - out.timingAdvance = in.timingAdvance; - return out; - } - - static public android.hardware.radio.CdmaSignalStrength h2aTranslate( - android.hardware.radio.V1_0.CdmaSignalStrength in) { - android.hardware.radio.CdmaSignalStrength out = - new android.hardware.radio.CdmaSignalStrength(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.dbm > 2147483647 || in.dbm < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.dbm"); - } - out.dbm = in.dbm; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.ecio > 2147483647 || in.ecio < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.ecio"); - } - out.ecio = in.ecio; - return out; - } - - static public android.hardware.radio.EvdoSignalStrength h2aTranslate( - android.hardware.radio.V1_0.EvdoSignalStrength in) { - android.hardware.radio.EvdoSignalStrength out = - new android.hardware.radio.EvdoSignalStrength(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.dbm > 2147483647 || in.dbm < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.dbm"); - } - out.dbm = in.dbm; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.ecio > 2147483647 || in.ecio < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.ecio"); - } - out.ecio = in.ecio; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.signalNoiseRatio > 2147483647 || in.signalNoiseRatio < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.signalNoiseRatio"); - } - out.signalNoiseRatio = in.signalNoiseRatio; - return out; - } - - static public android.hardware.radio.SendSmsResult h2aTranslate( - android.hardware.radio.V1_0.SendSmsResult in) { - android.hardware.radio.SendSmsResult out = new android.hardware.radio.SendSmsResult(); - out.messageRef = in.messageRef; - out.ackPDU = in.ackPDU; - out.errorCode = in.errorCode; - return out; - } - - static public android.hardware.radio.IccIoResult h2aTranslate( - android.hardware.radio.V1_0.IccIoResult in) { - android.hardware.radio.IccIoResult out = new android.hardware.radio.IccIoResult(); - out.sw1 = in.sw1; - out.sw2 = in.sw2; - out.simResponse = in.simResponse; - return out; - } - - static public android.hardware.radio.CallForwardInfo h2aTranslate( - android.hardware.radio.V1_0.CallForwardInfo in) { - android.hardware.radio.CallForwardInfo out = new android.hardware.radio.CallForwardInfo(); - out.status = in.status; - out.reason = in.reason; - out.serviceClass = in.serviceClass; - out.toa = in.toa; - out.number = in.number; - out.timeSeconds = in.timeSeconds; - return out; - } - - static public android.hardware.radio.OperatorInfo h2aTranslate( - android.hardware.radio.V1_0.OperatorInfo in) { - android.hardware.radio.OperatorInfo out = new android.hardware.radio.OperatorInfo(); - out.alphaLong = in.alphaLong; - out.alphaShort = in.alphaShort; - out.operatorNumeric = in.operatorNumeric; - out.status = in.status; - return out; - } - - static public android.hardware.radio.SmsWriteArgs h2aTranslate( - android.hardware.radio.V1_0.SmsWriteArgs in) { - android.hardware.radio.SmsWriteArgs out = new android.hardware.radio.SmsWriteArgs(); - out.status = in.status; - out.pdu = in.pdu; - out.smsc = in.smsc; - return out; - } - - static public android.hardware.radio.CdmaSmsAddress h2aTranslate( - android.hardware.radio.V1_0.CdmaSmsAddress in) { - android.hardware.radio.CdmaSmsAddress out = new android.hardware.radio.CdmaSmsAddress(); - out.digitMode = in.digitMode; - out.numberMode = in.numberMode; - out.numberType = in.numberType; - out.numberPlan = in.numberPlan; - if (in.digits != null) { - out.digits = new byte[in.digits.size()]; - for (int i = 0; i < in.digits.size(); i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it - // doesn't suit your needs. - if (in.digits.get(i) > 127 || in.digits.get(i) < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.digits.get(i)"); - } - out.digits[i] = in.digits.get(i); - } - } - return out; - } - - static public android.hardware.radio.CdmaSmsSubaddress h2aTranslate( - android.hardware.radio.V1_0.CdmaSmsSubaddress in) { - android.hardware.radio.CdmaSmsSubaddress out = - new android.hardware.radio.CdmaSmsSubaddress(); - out.subaddressType = in.subaddressType; - out.odd = in.odd; - if (in.digits != null) { - out.digits = new byte[in.digits.size()]; - for (int i = 0; i < in.digits.size(); i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it - // doesn't suit your needs. - if (in.digits.get(i) > 127 || in.digits.get(i) < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.digits.get(i)"); - } - out.digits[i] = in.digits.get(i); - } - } - return out; - } - - static public android.hardware.radio.CdmaSmsMessage h2aTranslate( - android.hardware.radio.V1_0.CdmaSmsMessage in) { - android.hardware.radio.CdmaSmsMessage out = new android.hardware.radio.CdmaSmsMessage(); - out.teleserviceId = in.teleserviceId; - out.isServicePresent = in.isServicePresent; - out.serviceCategory = in.serviceCategory; - out.address = h2aTranslate(in.address); - out.subAddress = h2aTranslate(in.subAddress); - if (in.bearerData != null) { - out.bearerData = new byte[in.bearerData.size()]; - for (int i = 0; i < in.bearerData.size(); i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it - // doesn't suit your needs. - if (in.bearerData.get(i) > 127 || in.bearerData.get(i) < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.bearerData.get(i)"); - } - out.bearerData[i] = in.bearerData.get(i); - } - } - return out; - } - - static public android.hardware.radio.CdmaSmsAck h2aTranslate( - android.hardware.radio.V1_0.CdmaSmsAck in) { - android.hardware.radio.CdmaSmsAck out = new android.hardware.radio.CdmaSmsAck(); - out.errorClass = in.errorClass; - out.smsCauseCode = in.smsCauseCode; - return out; - } - - static public android.hardware.radio.CdmaBroadcastSmsConfigInfo h2aTranslate( - android.hardware.radio.V1_0.CdmaBroadcastSmsConfigInfo in) { - android.hardware.radio.CdmaBroadcastSmsConfigInfo out = - new android.hardware.radio.CdmaBroadcastSmsConfigInfo(); - out.serviceCategory = in.serviceCategory; - out.language = in.language; - out.selected = in.selected; - return out; - } - - static public android.hardware.radio.CdmaSmsWriteArgs h2aTranslate( - android.hardware.radio.V1_0.CdmaSmsWriteArgs in) { - android.hardware.radio.CdmaSmsWriteArgs out = new android.hardware.radio.CdmaSmsWriteArgs(); - out.status = in.status; - out.message = h2aTranslate(in.message); - return out; - } - - static public android.hardware.radio.GsmBroadcastSmsConfigInfo h2aTranslate( - android.hardware.radio.V1_0.GsmBroadcastSmsConfigInfo in) { - android.hardware.radio.GsmBroadcastSmsConfigInfo out = - new android.hardware.radio.GsmBroadcastSmsConfigInfo(); - out.fromServiceId = in.fromServiceId; - out.toServiceId = in.toServiceId; - out.fromCodeScheme = in.fromCodeScheme; - out.toCodeScheme = in.toCodeScheme; - out.selected = in.selected; - return out; - } - - static public android.hardware.radio.GsmSmsMessage h2aTranslate( - android.hardware.radio.V1_0.GsmSmsMessage in) { - android.hardware.radio.GsmSmsMessage out = new android.hardware.radio.GsmSmsMessage(); - out.smscPdu = in.smscPdu; - out.pdu = in.pdu; - return out; - } - - static public android.hardware.radio.ImsSmsMessage h2aTranslate( - android.hardware.radio.V1_0.ImsSmsMessage in) { - android.hardware.radio.ImsSmsMessage out = new android.hardware.radio.ImsSmsMessage(); - out.tech = in.tech; - out.retry = in.retry; - out.messageRef = in.messageRef; - if (in.cdmaMessage != null) { - out.cdmaMessage = new android.hardware.radio.CdmaSmsMessage[in.cdmaMessage.size()]; - for (int i = 0; i < in.cdmaMessage.size(); i++) { - out.cdmaMessage[i] = h2aTranslate(in.cdmaMessage.get(i)); - } - } - if (in.gsmMessage != null) { - out.gsmMessage = new android.hardware.radio.GsmSmsMessage[in.gsmMessage.size()]; - for (int i = 0; i < in.gsmMessage.size(); i++) { - out.gsmMessage[i] = h2aTranslate(in.gsmMessage.get(i)); - } - } - return out; - } - - static public android.hardware.radio.SimApdu h2aTranslate( - android.hardware.radio.V1_0.SimApdu in) { - android.hardware.radio.SimApdu out = new android.hardware.radio.SimApdu(); - out.sessionId = in.sessionId; - out.cla = in.cla; - out.instruction = in.instruction; - out.p1 = in.p1; - out.p2 = in.p2; - out.p3 = in.p3; - out.data = in.data; - return out; - } - - static public android.hardware.radio.NvWriteItem h2aTranslate( - android.hardware.radio.V1_0.NvWriteItem in) { - android.hardware.radio.NvWriteItem out = new android.hardware.radio.NvWriteItem(); - out.itemId = in.itemId; - out.value = in.value; - return out; - } - - static public android.hardware.radio.SelectUiccSub h2aTranslate( - android.hardware.radio.V1_0.SelectUiccSub in) { - android.hardware.radio.SelectUiccSub out = new android.hardware.radio.SelectUiccSub(); - out.slot = in.slot; - out.appIndex = in.appIndex; - out.subType = in.subType; - out.actStatus = in.actStatus; - return out; - } - - static public android.hardware.radio.HardwareConfigModem h2aTranslate( - android.hardware.radio.V1_0.HardwareConfigModem in) { - android.hardware.radio.HardwareConfigModem out = - new android.hardware.radio.HardwareConfigModem(); - out.rilModel = in.rilModel; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.rat > 2147483647 || in.rat < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.rat"); - } - out.rat = in.rat; - out.maxVoice = in.maxVoice; - out.maxData = in.maxData; - out.maxStandby = in.maxStandby; - return out; - } - - static public android.hardware.radio.HardwareConfigSim h2aTranslate( - android.hardware.radio.V1_0.HardwareConfigSim in) { - android.hardware.radio.HardwareConfigSim out = - new android.hardware.radio.HardwareConfigSim(); - out.modemUuid = in.modemUuid; - return out; - } - - static public android.hardware.radio.HardwareConfig h2aTranslate( - android.hardware.radio.V1_0.HardwareConfig in) { - android.hardware.radio.HardwareConfig out = new android.hardware.radio.HardwareConfig(); - out.type = in.type; - out.uuid = in.uuid; - out.state = in.state; - if (in.modem != null) { - out.modem = new android.hardware.radio.HardwareConfigModem[in.modem.size()]; - for (int i = 0; i < in.modem.size(); i++) { - out.modem[i] = h2aTranslate(in.modem.get(i)); - } - } - if (in.sim != null) { - out.sim = new android.hardware.radio.HardwareConfigSim[in.sim.size()]; - for (int i = 0; i < in.sim.size(); i++) { - out.sim[i] = h2aTranslate(in.sim.get(i)); - } - } - return out; - } - - static public android.hardware.radio.LceStatusInfo h2aTranslate( - android.hardware.radio.V1_0.LceStatusInfo in) { - android.hardware.radio.LceStatusInfo out = new android.hardware.radio.LceStatusInfo(); - out.lceStatus = in.lceStatus; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.actualIntervalMs > 127 || in.actualIntervalMs < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.actualIntervalMs"); - } - out.actualIntervalMs = in.actualIntervalMs; - return out; - } - - static public android.hardware.radio.LceDataInfo h2aTranslate( - android.hardware.radio.V1_0.LceDataInfo in) { - android.hardware.radio.LceDataInfo out = new android.hardware.radio.LceDataInfo(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.lastHopCapacityKbps > 2147483647 || in.lastHopCapacityKbps < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.lastHopCapacityKbps"); - } - out.lastHopCapacityKbps = in.lastHopCapacityKbps; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.confidenceLevel > 127 || in.confidenceLevel < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.confidenceLevel"); - } - out.confidenceLevel = in.confidenceLevel; - out.lceSuspended = in.lceSuspended; - return out; - } - - static public android.hardware.radio.ActivityStatsInfo h2aTranslate( - android.hardware.radio.V1_0.ActivityStatsInfo in) { - android.hardware.radio.ActivityStatsInfo out = - new android.hardware.radio.ActivityStatsInfo(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.sleepModeTimeMs > 2147483647 || in.sleepModeTimeMs < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.sleepModeTimeMs"); - } - out.sleepModeTimeMs = in.sleepModeTimeMs; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.idleModeTimeMs > 2147483647 || in.idleModeTimeMs < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.idleModeTimeMs"); - } - out.idleModeTimeMs = in.idleModeTimeMs; - if (in.txmModetimeMs != null) { - out.txmModetimeMs = new int[in.txmModetimeMs.length]; - for (int i = 0; i < in.txmModetimeMs.length; i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it - // doesn't suit your needs. - if (in.txmModetimeMs[i] > 2147483647 || in.txmModetimeMs[i] < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.txmModetimeMs[i]"); - } - out.txmModetimeMs[i] = in.txmModetimeMs[i]; - } - } - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.rxModeTimeMs > 2147483647 || in.rxModeTimeMs < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.rxModeTimeMs"); - } - out.rxModeTimeMs = in.rxModeTimeMs; - return out; - } - - static public android.hardware.radio.Carrier h2aTranslate( - android.hardware.radio.V1_0.Carrier in) { - android.hardware.radio.Carrier out = new android.hardware.radio.Carrier(); - out.mcc = in.mcc; - out.mnc = in.mnc; - out.matchType = in.matchType; - out.matchData = in.matchData; - return out; - } - - static public android.hardware.radio.CarrierRestrictions h2aTranslate( - android.hardware.radio.V1_0.CarrierRestrictions in) { - android.hardware.radio.CarrierRestrictions out = - new android.hardware.radio.CarrierRestrictions(); - if (in.allowedCarriers != null) { - out.allowedCarriers = new android.hardware.radio.Carrier[in.allowedCarriers.size()]; - for (int i = 0; i < in.allowedCarriers.size(); i++) { - out.allowedCarriers[i] = h2aTranslate(in.allowedCarriers.get(i)); - } - } - if (in.excludedCarriers != null) { - out.excludedCarriers = new android.hardware.radio.Carrier[in.excludedCarriers.size()]; - for (int i = 0; i < in.excludedCarriers.size(); i++) { - out.excludedCarriers[i] = h2aTranslate(in.excludedCarriers.get(i)); - } - } - return out; - } - - static public android.hardware.radio.SuppSvcNotification h2aTranslate( - android.hardware.radio.V1_0.SuppSvcNotification in) { - android.hardware.radio.SuppSvcNotification out = - new android.hardware.radio.SuppSvcNotification(); - out.isMT = in.isMT; - out.code = in.code; - out.index = in.index; - out.type = in.type; - out.number = in.number; - return out; - } - - static public android.hardware.radio.SimRefreshResult h2aTranslate( - android.hardware.radio.V1_0.SimRefreshResult in) { - android.hardware.radio.SimRefreshResult out = new android.hardware.radio.SimRefreshResult(); - out.type = in.type; - out.efId = in.efId; - out.aid = in.aid; - return out; - } - - static public android.hardware.radio.CdmaSignalInfoRecord h2aTranslate( - android.hardware.radio.V1_0.CdmaSignalInfoRecord in) { - android.hardware.radio.CdmaSignalInfoRecord out = - new android.hardware.radio.CdmaSignalInfoRecord(); - out.isPresent = in.isPresent; - out.signalType = in.signalType; - out.alertPitch = in.alertPitch; - out.signal = in.signal; - return out; - } - - static public android.hardware.radio.CdmaCallWaiting h2aTranslate( - android.hardware.radio.V1_0.CdmaCallWaiting in) { - android.hardware.radio.CdmaCallWaiting out = new android.hardware.radio.CdmaCallWaiting(); - out.number = in.number; - out.numberPresentation = in.numberPresentation; - out.name = in.name; - out.signalInfoRecord = h2aTranslate(in.signalInfoRecord); - out.numberType = in.numberType; - out.numberPlan = in.numberPlan; - return out; - } - - static public android.hardware.radio.CdmaDisplayInfoRecord h2aTranslate( - android.hardware.radio.V1_0.CdmaDisplayInfoRecord in) { - android.hardware.radio.CdmaDisplayInfoRecord out = - new android.hardware.radio.CdmaDisplayInfoRecord(); - out.alphaBuf = in.alphaBuf; - return out; - } - - static public android.hardware.radio.CdmaNumberInfoRecord h2aTranslate( - android.hardware.radio.V1_0.CdmaNumberInfoRecord in) { - android.hardware.radio.CdmaNumberInfoRecord out = - new android.hardware.radio.CdmaNumberInfoRecord(); - out.number = in.number; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.numberType > 127 || in.numberType < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.numberType"); - } - out.numberType = in.numberType; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.numberPlan > 127 || in.numberPlan < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.numberPlan"); - } - out.numberPlan = in.numberPlan; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.pi > 127 || in.pi < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.pi"); - } - out.pi = in.pi; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.si > 127 || in.si < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.si"); - } - out.si = in.si; - return out; - } - - static public android.hardware.radio.CdmaRedirectingNumberInfoRecord h2aTranslate( - android.hardware.radio.V1_0.CdmaRedirectingNumberInfoRecord in) { - android.hardware.radio.CdmaRedirectingNumberInfoRecord out = - new android.hardware.radio.CdmaRedirectingNumberInfoRecord(); - out.redirectingNumber = h2aTranslate(in.redirectingNumber); - out.redirectingReason = in.redirectingReason; - return out; - } - - static public android.hardware.radio.CdmaLineControlInfoRecord h2aTranslate( - android.hardware.radio.V1_0.CdmaLineControlInfoRecord in) { - android.hardware.radio.CdmaLineControlInfoRecord out = - new android.hardware.radio.CdmaLineControlInfoRecord(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.lineCtrlPolarityIncluded > 127 || in.lineCtrlPolarityIncluded < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.lineCtrlPolarityIncluded"); - } - out.lineCtrlPolarityIncluded = in.lineCtrlPolarityIncluded; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.lineCtrlToggle > 127 || in.lineCtrlToggle < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.lineCtrlToggle"); - } - out.lineCtrlToggle = in.lineCtrlToggle; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.lineCtrlReverse > 127 || in.lineCtrlReverse < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.lineCtrlReverse"); - } - out.lineCtrlReverse = in.lineCtrlReverse; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.lineCtrlPowerDenial > 127 || in.lineCtrlPowerDenial < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.lineCtrlPowerDenial"); - } - out.lineCtrlPowerDenial = in.lineCtrlPowerDenial; - return out; - } - - static public android.hardware.radio.CdmaT53ClirInfoRecord h2aTranslate( - android.hardware.radio.V1_0.CdmaT53ClirInfoRecord in) { - android.hardware.radio.CdmaT53ClirInfoRecord out = - new android.hardware.radio.CdmaT53ClirInfoRecord(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.cause > 127 || in.cause < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.cause"); - } - out.cause = in.cause; - return out; - } - - static public android.hardware.radio.CdmaT53AudioControlInfoRecord h2aTranslate( - android.hardware.radio.V1_0.CdmaT53AudioControlInfoRecord in) { - android.hardware.radio.CdmaT53AudioControlInfoRecord out = - new android.hardware.radio.CdmaT53AudioControlInfoRecord(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.upLink > 127 || in.upLink < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.upLink"); - } - out.upLink = in.upLink; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.downLink > 127 || in.downLink < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.downLink"); - } - out.downLink = in.downLink; - return out; - } - - static public android.hardware.radio.CdmaInformationRecord h2aTranslate( - android.hardware.radio.V1_0.CdmaInformationRecord in) { - android.hardware.radio.CdmaInformationRecord out = - new android.hardware.radio.CdmaInformationRecord(); - out.name = in.name; - if (in.display != null) { - out.display = new android.hardware.radio.CdmaDisplayInfoRecord[in.display.size()]; - for (int i = 0; i < in.display.size(); i++) { - out.display[i] = h2aTranslate(in.display.get(i)); - } - } - if (in.number != null) { - out.number = new android.hardware.radio.CdmaNumberInfoRecord[in.number.size()]; - for (int i = 0; i < in.number.size(); i++) { - out.number[i] = h2aTranslate(in.number.get(i)); - } - } - if (in.signal != null) { - out.signal = new android.hardware.radio.CdmaSignalInfoRecord[in.signal.size()]; - for (int i = 0; i < in.signal.size(); i++) { - out.signal[i] = h2aTranslate(in.signal.get(i)); - } - } - if (in.redir != null) { - out.redir = new android.hardware.radio.CdmaRedirectingNumberInfoRecord[in.redir.size()]; - for (int i = 0; i < in.redir.size(); i++) { - out.redir[i] = h2aTranslate(in.redir.get(i)); - } - } - if (in.lineCtrl != null) { - out.lineCtrl = new android.hardware.radio.CdmaLineControlInfoRecord[in.lineCtrl.size()]; - for (int i = 0; i < in.lineCtrl.size(); i++) { - out.lineCtrl[i] = h2aTranslate(in.lineCtrl.get(i)); - } - } - if (in.clir != null) { - out.clir = new android.hardware.radio.CdmaT53ClirInfoRecord[in.clir.size()]; - for (int i = 0; i < in.clir.size(); i++) { - out.clir[i] = h2aTranslate(in.clir.get(i)); - } - } - if (in.audioCtrl != null) { - out.audioCtrl = - new android.hardware.radio.CdmaT53AudioControlInfoRecord[in.audioCtrl.size()]; - for (int i = 0; i < in.audioCtrl.size(); i++) { - out.audioCtrl[i] = h2aTranslate(in.audioCtrl.get(i)); - } - } - return out; - } - - static public android.hardware.radio.CdmaInformationRecords h2aTranslate( - android.hardware.radio.V1_0.CdmaInformationRecords in) { - android.hardware.radio.CdmaInformationRecords out = - new android.hardware.radio.CdmaInformationRecords(); - if (in.infoRec != null) { - out.infoRec = new android.hardware.radio.CdmaInformationRecord[in.infoRec.size()]; - for (int i = 0; i < in.infoRec.size(); i++) { - out.infoRec[i] = h2aTranslate(in.infoRec.get(i)); - } - } - return out; - } - - static public android.hardware.radio.CfData h2aTranslate( - android.hardware.radio.V1_0.CfData in) { - android.hardware.radio.CfData out = new android.hardware.radio.CfData(); - if (in.cfInfo != null) { - out.cfInfo = new android.hardware.radio.CallForwardInfo[in.cfInfo.size()]; - for (int i = 0; i < in.cfInfo.size(); i++) { - out.cfInfo[i] = h2aTranslate(in.cfInfo.get(i)); - } - } - return out; - } - - static public android.hardware.radio.SsInfoData h2aTranslate( - android.hardware.radio.V1_0.SsInfoData in) { - android.hardware.radio.SsInfoData out = new android.hardware.radio.SsInfoData(); - if (in.ssInfo != null) { - out.ssInfo = new int[in.ssInfo.size()]; - for (int i = 0; i < in.ssInfo.size(); i++) { - out.ssInfo[i] = in.ssInfo.get(i); - } - } - return out; - } - - static public android.hardware.radio.StkCcUnsolSsResult h2aTranslate( - android.hardware.radio.V1_0.StkCcUnsolSsResult in) { - android.hardware.radio.StkCcUnsolSsResult out = - new android.hardware.radio.StkCcUnsolSsResult(); - out.serviceType = in.serviceType; - out.requestType = in.requestType; - out.teleserviceType = in.teleserviceType; - out.serviceClass = in.serviceClass; - out.result = in.result; - if (in.ssInfo != null) { - out.ssInfo = new android.hardware.radio.SsInfoData[in.ssInfo.size()]; - for (int i = 0; i < in.ssInfo.size(); i++) { - out.ssInfo[i] = h2aTranslate(in.ssInfo.get(i)); - } - } - if (in.cfData != null) { - out.cfData = new android.hardware.radio.CfData[in.cfData.size()]; - for (int i = 0; i < in.cfData.size(); i++) { - out.cfData[i] = h2aTranslate(in.cfData.get(i)); - } - } - return out; - } - - static public android.hardware.radio.PcoDataInfo h2aTranslate( - android.hardware.radio.V1_0.PcoDataInfo in) { - android.hardware.radio.PcoDataInfo out = new android.hardware.radio.PcoDataInfo(); - out.cid = in.cid; - out.bearerProto = in.bearerProto; - out.pcoId = in.pcoId; - if (in.contents != null) { - out.contents = new byte[in.contents.size()]; - for (int i = 0; i < in.contents.size(); i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it - // doesn't suit your needs. - if (in.contents.get(i) > 127 || in.contents.get(i) < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.contents.get(i)"); - } - out.contents[i] = in.contents.get(i); - } - } - return out; - } - - static public android.hardware.radio.KeepaliveRequest h2aTranslate( - android.hardware.radio.V1_1.KeepaliveRequest in) { - android.hardware.radio.KeepaliveRequest out = new android.hardware.radio.KeepaliveRequest(); - out.type = in.type; - if (in.sourceAddress != null) { - out.sourceAddress = new byte[in.sourceAddress.size()]; - for (int i = 0; i < in.sourceAddress.size(); i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it - // doesn't suit your needs. - if (in.sourceAddress.get(i) > 127 || in.sourceAddress.get(i) < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.sourceAddress.get(i)"); - } - out.sourceAddress[i] = in.sourceAddress.get(i); - } - } - out.sourcePort = in.sourcePort; - if (in.destinationAddress != null) { - out.destinationAddress = new byte[in.destinationAddress.size()]; - for (int i = 0; i < in.destinationAddress.size(); i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it - // doesn't suit your needs. - if (in.destinationAddress.get(i) > 127 || in.destinationAddress.get(i) < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.destinationAddress.get(i)"); - } - out.destinationAddress[i] = in.destinationAddress.get(i); - } - } - out.destinationPort = in.destinationPort; - out.maxKeepaliveIntervalMillis = in.maxKeepaliveIntervalMillis; - out.cid = in.cid; - return out; - } - - static public android.hardware.radio.KeepaliveStatus h2aTranslate( - android.hardware.radio.V1_1.KeepaliveStatus in) { - android.hardware.radio.KeepaliveStatus out = new android.hardware.radio.KeepaliveStatus(); - out.sessionHandle = in.sessionHandle; - out.code = in.code; - return out; - } - - static public android.hardware.radio.CellIdentityOperatorNames h2aTranslate( - android.hardware.radio.V1_2.CellIdentityOperatorNames in) { - android.hardware.radio.CellIdentityOperatorNames out = - new android.hardware.radio.CellIdentityOperatorNames(); - out.alphaLong = in.alphaLong; - out.alphaShort = in.alphaShort; - return out; - } - - static public android.hardware.radio.CellIdentityCdma h2aTranslate( - android.hardware.radio.V1_2.CellIdentityCdma in) { - android.hardware.radio.CellIdentityCdma out = new android.hardware.radio.CellIdentityCdma(); - out.networkId = in.base.networkId; - out.systemId = in.base.systemId; - out.baseStationId = in.base.baseStationId; - out.longitude = in.base.longitude; - out.latitude = in.base.latitude; - out.operatorNames = h2aTranslate(in.operatorNames); - return out; - } - - static public android.hardware.radio.CellInfoCdma h2aTranslate( - android.hardware.radio.V1_2.CellInfoCdma in) { - android.hardware.radio.CellInfoCdma out = new android.hardware.radio.CellInfoCdma(); - out.cellIdentityCdma = h2aTranslate(in.cellIdentityCdma); - out.signalStrengthCdma = h2aTranslate(in.signalStrengthCdma); - out.signalStrengthEvdo = h2aTranslate(in.signalStrengthEvdo); - return out; - } - - static public android.hardware.radio.WcdmaSignalStrength h2aTranslate( - android.hardware.radio.V1_2.WcdmaSignalStrength in) { - android.hardware.radio.WcdmaSignalStrength out = - new android.hardware.radio.WcdmaSignalStrength(); - out.signalStrength = in.base.signalStrength; - out.bitErrorRate = in.base.bitErrorRate; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.rscp > 2147483647 || in.rscp < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.rscp"); - } - out.rscp = in.rscp; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.ecno > 2147483647 || in.ecno < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.ecno"); - } - out.ecno = in.ecno; - return out; - } - - static public android.hardware.radio.TdscdmaSignalStrength h2aTranslate( - android.hardware.radio.V1_2.TdscdmaSignalStrength in) { - android.hardware.radio.TdscdmaSignalStrength out = - new android.hardware.radio.TdscdmaSignalStrength(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.signalStrength > 2147483647 || in.signalStrength < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.signalStrength"); - } - out.signalStrength = in.signalStrength; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.bitErrorRate > 2147483647 || in.bitErrorRate < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.bitErrorRate"); - } - out.bitErrorRate = in.bitErrorRate; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.rscp > 2147483647 || in.rscp < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.rscp"); - } - out.rscp = in.rscp; - return out; - } - - static public android.hardware.radio.VoiceRegStateResult h2aTranslate( - android.hardware.radio.V1_2.VoiceRegStateResult in) { - android.hardware.radio.VoiceRegStateResult out = - new android.hardware.radio.VoiceRegStateResult(); - out.regState = in.regState; - out.rat = in.rat; - out.cssSupported = in.cssSupported; - out.roamingIndicator = in.roamingIndicator; - out.systemIsInPrl = in.systemIsInPrl; - out.defaultRoamingIndicator = in.defaultRoamingIndicator; - out.reasonForDenial = in.reasonForDenial; - // FIXME Unknown type: android.hardware.radio@1.2::CellIdentity - // That type's package needs to be converted separately and the corresponding translate - // function should be added here. - return out; - } - - static public android.hardware.radio.RadioResponseInfoModem h2aTranslate( - android.hardware.radio.V1_3.RadioResponseInfoModem in) { - android.hardware.radio.RadioResponseInfoModem out = - new android.hardware.radio.RadioResponseInfoModem(); - out.type = in.type; - out.serial = in.serial; - out.error = in.error; - out.isEnabled = in.isEnabled; - return out; - } - - static public android.hardware.radio.EmergencyNumber h2aTranslate( - android.hardware.radio.V1_4.EmergencyNumber in) { - android.hardware.radio.EmergencyNumber out = new android.hardware.radio.EmergencyNumber(); - out.number = in.number; - out.mcc = in.mcc; - out.mnc = in.mnc; - out.categories = in.categories; - if (in.urns != null) { - out.urns = new String[in.urns.size()]; - for (int i = 0; i < in.urns.size(); i++) { - out.urns[i] = in.urns.get(i); - } - } - out.sources = in.sources; - return out; - } - - static public android.hardware.radio.RadioFrequencyInfo h2aTranslate( - android.hardware.radio.V1_4.RadioFrequencyInfo in) { - android.hardware.radio.RadioFrequencyInfo out = - new android.hardware.radio.RadioFrequencyInfo(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_4.RadioFrequencyInfo.hidl_discriminator.range: - out.setRange(in.range()); - break; - case android.hardware.radio.V1_4.RadioFrequencyInfo.hidl_discriminator.channelNumber: - out.setChannelNumber(in.channelNumber()); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.LteVopsInfo h2aTranslate( - android.hardware.radio.V1_4.LteVopsInfo in) { - android.hardware.radio.LteVopsInfo out = new android.hardware.radio.LteVopsInfo(); - out.isVopsSupported = in.isVopsSupported; - out.isEmcBearerSupported = in.isEmcBearerSupported; - return out; - } - - static public android.hardware.radio.NrIndicators h2aTranslate( - android.hardware.radio.V1_4.NrIndicators in) { - android.hardware.radio.NrIndicators out = new android.hardware.radio.NrIndicators(); - out.isEndcAvailable = in.isEndcAvailable; - out.isDcNrRestricted = in.isDcNrRestricted; - out.isNrAvailable = in.isNrAvailable; - return out; - } - - static public android.hardware.radio.DataRegStateResult h2aTranslate( - android.hardware.radio.V1_4.DataRegStateResult in) { - android.hardware.radio.DataRegStateResult out = - new android.hardware.radio.DataRegStateResult(); - out.regState = in.base.regState; - out.rat = in.base.rat; - out.reasonDataDenied = in.base.reasonDataDenied; - out.maxDataCalls = in.base.maxDataCalls; - // FIXME Unknown type: android.hardware.radio@1.2::CellIdentity - // That type's package needs to be converted separately and the corresponding translate - // function should be added here. - out.vopsInfo = h2aTranslate(in.vopsInfo); - out.nrIndicators = h2aTranslate(in.nrIndicators); - return out; - } - - static public android.hardware.radio.DataRegStateResultVopsInfo h2aTranslate( - android.hardware.radio.V1_4.DataRegStateResult.VopsInfo in) { - android.hardware.radio.DataRegStateResultVopsInfo out = - new android.hardware.radio.DataRegStateResultVopsInfo(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_4.DataRegStateResult.VopsInfo.hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_4.DataRegStateResult.VopsInfo.hidl_discriminator - .lteVopsInfo: - out.setLteVopsInfo(h2aTranslate(in.lteVopsInfo())); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.CellConfigLte h2aTranslate( - android.hardware.radio.V1_4.CellConfigLte in) { - android.hardware.radio.CellConfigLte out = new android.hardware.radio.CellConfigLte(); - out.isEndcAvailable = in.isEndcAvailable; - return out; - } - - static public android.hardware.radio.CellInfoInfo h2aTranslate( - android.hardware.radio.V1_4.CellInfo.Info in) { - android.hardware.radio.CellInfoInfo out = new android.hardware.radio.CellInfoInfo(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_4.CellInfo.Info.hidl_discriminator.gsm: - // FIXME Unknown type: android.hardware.radio@1.2::CellInfoGsm - // That type's package needs to be converted separately and the corresponding - // translate function should be added here. - break; - case android.hardware.radio.V1_4.CellInfo.Info.hidl_discriminator.cdma: - out.setCdma(h2aTranslate(in.cdma())); - break; - case android.hardware.radio.V1_4.CellInfo.Info.hidl_discriminator.wcdma: - // FIXME Unknown type: android.hardware.radio@1.2::CellInfoWcdma - // That type's package needs to be converted separately and the corresponding - // translate function should be added here. - break; - case android.hardware.radio.V1_4.CellInfo.Info.hidl_discriminator.tdscdma: - // FIXME Unknown type: android.hardware.radio@1.2::CellInfoTdscdma - // That type's package needs to be converted separately and the corresponding - // translate function should be added here. - break; - case android.hardware.radio.V1_4.CellInfo.Info.hidl_discriminator.lte: - // FIXME Unknown type: android.hardware.radio@1.4::CellInfoLte - // That type's package needs to be converted separately and the corresponding - // translate function should be added here. - break; - case android.hardware.radio.V1_4.CellInfo.Info.hidl_discriminator.nr: - // FIXME Unknown type: android.hardware.radio@1.4::CellInfoNr - // That type's package needs to be converted separately and the corresponding - // translate function should be added here. - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.RadioCapability h2aTranslate( - android.hardware.radio.V1_4.RadioCapability in) { - android.hardware.radio.RadioCapability out = new android.hardware.radio.RadioCapability(); - out.session = in.session; - out.phase = in.phase; - out.raf = in.raf; - out.logicalModemUuid = in.logicalModemUuid; - out.status = in.status; - return out; - } - - static public android.hardware.radio.CarrierRestrictionsWithPriority h2aTranslate( - android.hardware.radio.V1_4.CarrierRestrictionsWithPriority in) { - android.hardware.radio.CarrierRestrictionsWithPriority out = - new android.hardware.radio.CarrierRestrictionsWithPriority(); - if (in.allowedCarriers != null) { - out.allowedCarriers = new android.hardware.radio.Carrier[in.allowedCarriers.size()]; - for (int i = 0; i < in.allowedCarriers.size(); i++) { - out.allowedCarriers[i] = h2aTranslate(in.allowedCarriers.get(i)); - } - } - if (in.excludedCarriers != null) { - out.excludedCarriers = new android.hardware.radio.Carrier[in.excludedCarriers.size()]; - for (int i = 0; i < in.excludedCarriers.size(); i++) { - out.excludedCarriers[i] = h2aTranslate(in.excludedCarriers.get(i)); - } - } - out.allowedCarriersPrioritized = in.allowedCarriersPrioritized; - return out; - } - - static public android.hardware.radio.RadioAccessSpecifier h2aTranslate( - android.hardware.radio.V1_5.RadioAccessSpecifier in) { - android.hardware.radio.RadioAccessSpecifier out = - new android.hardware.radio.RadioAccessSpecifier(); - out.radioAccessNetwork = in.radioAccessNetwork; - out.bands = h2aTranslate(in.bands); - if (in.channels != null) { - out.channels = new int[in.channels.size()]; - for (int i = 0; i < in.channels.size(); i++) { - out.channels[i] = in.channels.get(i); - } - } - return out; - } - - static public android.hardware.radio.RadioAccessSpecifierBands h2aTranslate( - android.hardware.radio.V1_5.RadioAccessSpecifier.Bands in) { - android.hardware.radio.RadioAccessSpecifierBands out = - new android.hardware.radio.RadioAccessSpecifierBands(); - List bands; - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_5.RadioAccessSpecifier.Bands.hidl_discriminator - .geranBands: - bands = in.geranBands(); - if (bands != null) { - int[] geranBands = new int[bands.size()]; - for (int i = 0; i < bands.size(); i++) { - geranBands[i] = bands.get(i); - } - out.geranBands(geranBands); - } - break; - case android.hardware.radio.V1_5.RadioAccessSpecifier.Bands.hidl_discriminator - .utranBands: - bands = in.utranBands(); - if (bands != null) { - int[] utranBands = new int[bands.size()]; - for (int i = 0; i < bands.size(); i++) { - utranBands[i] = bands.get(i); - } - out.utranBands(utranBands); - } - break; - case android.hardware.radio.V1_5.RadioAccessSpecifier.Bands.hidl_discriminator - .eutranBands: - bands = in.eutranBands(); - if (bands != null) { - int[] eutranBands = new int[bands.size()]; - for (int i = 0; i < bands.size(); i++) { - eutranBands[i] = bands.get(i); - } - out.eutranBands(eutranBands); - } - break; - case android.hardware.radio.V1_5.RadioAccessSpecifier.Bands.hidl_discriminator - .ngranBands: - bands = in.ngranBands(); - if (bands != null) { - int[] ngranBands = new int[bands.size()]; - for (int i = 0; i < bands.size(); i++) { - ngranBands[i] = bands.get(i); - } - out.ngranBands(ngranBands); - } - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.SignalThresholdInfo h2aTranslate( - android.hardware.radio.V1_5.SignalThresholdInfo in) { - android.hardware.radio.SignalThresholdInfo out = - new android.hardware.radio.SignalThresholdInfo(); - out.signalMeasurement = in.signalMeasurement; - out.hysteresisMs = in.hysteresisMs; - out.hysteresisDb = in.hysteresisDb; - if (in.thresholds != null) { - out.thresholds = new int[in.thresholds.size()]; - for (int i = 0; i < in.thresholds.size(); i++) { - out.thresholds[i] = in.thresholds.get(i); - } - } - out.isEnabled = in.isEnabled; - return out; - } - - static public android.hardware.radio.NetworkScanRequest h2aTranslate( - android.hardware.radio.V1_5.NetworkScanRequest in) { - android.hardware.radio.NetworkScanRequest out = - new android.hardware.radio.NetworkScanRequest(); - out.type = in.type; - out.interval = in.interval; - if (in.specifiers != null) { - out.specifiers = new android.hardware.radio.RadioAccessSpecifier[in.specifiers.size()]; - for (int i = 0; i < in.specifiers.size(); i++) { - out.specifiers[i] = h2aTranslate(in.specifiers.get(i)); - } - } - out.maxSearchTime = in.maxSearchTime; - out.incrementalResults = in.incrementalResults; - out.incrementalResultsPeriodicity = in.incrementalResultsPeriodicity; - if (in.mccMncs != null) { - out.mccMncs = new String[in.mccMncs.size()]; - for (int i = 0; i < in.mccMncs.size(); i++) { - out.mccMncs[i] = in.mccMncs.get(i); - } - } - return out; - } - - static public android.hardware.radio.DataProfileInfo h2aTranslate( - android.hardware.radio.V1_5.DataProfileInfo in) { - android.hardware.radio.DataProfileInfo out = new android.hardware.radio.DataProfileInfo(); - out.profileId = in.profileId; - out.apn = in.apn; - out.protocol = in.protocol; - out.roamingProtocol = in.roamingProtocol; - out.authType = in.authType; - out.user = in.user; - out.password = in.password; - out.type = in.type; - out.maxConnsTime = in.maxConnsTime; - out.maxConns = in.maxConns; - out.waitTime = in.waitTime; - out.enabled = in.enabled; - out.supportedApnTypesBitmap = in.supportedApnTypesBitmap; - out.bearerBitmap = in.bearerBitmap; - out.mtuV4 = in.mtuV4; - out.mtuV6 = in.mtuV6; - out.preferred = in.preferred; - out.persistent = in.persistent; - return out; - } - - static public android.hardware.radio.LinkAddress h2aTranslate( - android.hardware.radio.V1_5.LinkAddress in) { - android.hardware.radio.LinkAddress out = new android.hardware.radio.LinkAddress(); - out.address = in.address; - out.properties = in.properties; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.deprecationTime > 9223372036854775807L || in.deprecationTime < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.deprecationTime"); - } - out.deprecationTime = in.deprecationTime; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.expirationTime > 9223372036854775807L || in.expirationTime < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.expirationTime"); - } - out.expirationTime = in.expirationTime; - return out; - } - - static public android.hardware.radio.ClosedSubscriberGroupInfo h2aTranslate( - android.hardware.radio.V1_5.ClosedSubscriberGroupInfo in) { - android.hardware.radio.ClosedSubscriberGroupInfo out = - new android.hardware.radio.ClosedSubscriberGroupInfo(); - out.csgIndication = in.csgIndication; - out.homeNodebName = in.homeNodebName; - out.csgIdentity = in.csgIdentity; - return out; - } - - static public android.hardware.radio.OptionalCsgInfo h2aTranslate( - android.hardware.radio.V1_5.OptionalCsgInfo in) { - android.hardware.radio.OptionalCsgInfo out = new android.hardware.radio.OptionalCsgInfo(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_5.OptionalCsgInfo.hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_5.OptionalCsgInfo.hidl_discriminator.csgInfo: - out.setCsgInfo(h2aTranslate(in.csgInfo())); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.CellIdentityGsm h2aTranslate( - android.hardware.radio.V1_5.CellIdentityGsm in) { - android.hardware.radio.CellIdentityGsm out = new android.hardware.radio.CellIdentityGsm(); - out.mcc = in.base.base.mcc; - out.mnc = in.base.base.mnc; - out.lac = in.base.base.lac; - out.cid = in.base.base.cid; - out.arfcn = in.base.base.arfcn; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.base.base.bsic > 127 || in.base.base.bsic < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.base.base.bsic"); - } - out.bsic = in.base.base.bsic; - out.operatorNames = h2aTranslate(in.base.operatorNames); - if (in.additionalPlmns != null) { - out.additionalPlmns = new String[in.additionalPlmns.size()]; - for (int i = 0; i < in.additionalPlmns.size(); i++) { - out.additionalPlmns[i] = in.additionalPlmns.get(i); - } - } - return out; - } - - static public android.hardware.radio.CellIdentityWcdma h2aTranslate( - android.hardware.radio.V1_5.CellIdentityWcdma in) { - android.hardware.radio.CellIdentityWcdma out = - new android.hardware.radio.CellIdentityWcdma(); - out.mcc = in.base.base.mcc; - out.mnc = in.base.base.mnc; - out.lac = in.base.base.lac; - out.cid = in.base.base.cid; - out.psc = in.base.base.psc; - out.uarfcn = in.base.base.uarfcn; - out.operatorNames = h2aTranslate(in.base.operatorNames); - if (in.additionalPlmns != null) { - out.additionalPlmns = new String[in.additionalPlmns.size()]; - for (int i = 0; i < in.additionalPlmns.size(); i++) { - out.additionalPlmns[i] = in.additionalPlmns.get(i); - } - } - out.optionalCsgInfo = h2aTranslate(in.optionalCsgInfo); - return out; - } - - static public android.hardware.radio.CellIdentityTdscdma h2aTranslate( - android.hardware.radio.V1_5.CellIdentityTdscdma in) { - android.hardware.radio.CellIdentityTdscdma out = - new android.hardware.radio.CellIdentityTdscdma(); - out.mcc = in.base.base.mcc; - out.mnc = in.base.base.mnc; - out.lac = in.base.base.lac; - out.cid = in.base.base.cid; - out.cpid = in.base.base.cpid; - out.uarfcn = in.base.uarfcn; - out.operatorNames = h2aTranslate(in.base.operatorNames); - if (in.additionalPlmns != null) { - out.additionalPlmns = new String[in.additionalPlmns.size()]; - for (int i = 0; i < in.additionalPlmns.size(); i++) { - out.additionalPlmns[i] = in.additionalPlmns.get(i); - } - } - out.optionalCsgInfo = h2aTranslate(in.optionalCsgInfo); - return out; - } - - static public android.hardware.radio.CellIdentityLte h2aTranslate( - android.hardware.radio.V1_5.CellIdentityLte in) { - android.hardware.radio.CellIdentityLte out = new android.hardware.radio.CellIdentityLte(); - out.mcc = in.base.base.mcc; - out.mnc = in.base.base.mnc; - out.ci = in.base.base.ci; - out.pci = in.base.base.pci; - out.tac = in.base.base.tac; - out.earfcn = in.base.base.earfcn; - out.operatorNames = h2aTranslate(in.base.operatorNames); - out.bandwidth = in.base.bandwidth; - if (in.additionalPlmns != null) { - out.additionalPlmns = new String[in.additionalPlmns.size()]; - for (int i = 0; i < in.additionalPlmns.size(); i++) { - out.additionalPlmns[i] = in.additionalPlmns.get(i); - } - } - out.optionalCsgInfo = h2aTranslate(in.optionalCsgInfo); - if (in.bands != null) { - out.bands = new int[in.bands.size()]; - for (int i = 0; i < in.bands.size(); i++) { - out.bands[i] = in.bands.get(i); - } - } - return out; - } - - static public android.hardware.radio.CellIdentityNr h2aTranslate( - android.hardware.radio.V1_5.CellIdentityNr in) { - android.hardware.radio.CellIdentityNr out = new android.hardware.radio.CellIdentityNr(); - out.mcc = in.base.mcc; - out.mnc = in.base.mnc; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.base.nci > 9223372036854775807L || in.base.nci < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.base.nci"); - } - out.nci = in.base.nci; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.base.pci > 2147483647 || in.base.pci < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.base.pci"); - } - out.pci = in.base.pci; - out.tac = in.base.tac; - out.nrarfcn = in.base.nrarfcn; - out.operatorNames = h2aTranslate(in.base.operatorNames); - if (in.additionalPlmns != null) { - out.additionalPlmns = new String[in.additionalPlmns.size()]; - for (int i = 0; i < in.additionalPlmns.size(); i++) { - out.additionalPlmns[i] = in.additionalPlmns.get(i); - } - } - if (in.bands != null) { - out.bands = new int[in.bands.size()]; - for (int i = 0; i < in.bands.size(); i++) { - out.bands[i] = in.bands.get(i); - } - } - return out; - } - - static public android.hardware.radio.CellInfoGsm h2aTranslate( - android.hardware.radio.V1_5.CellInfoGsm in) { - android.hardware.radio.CellInfoGsm out = new android.hardware.radio.CellInfoGsm(); - out.cellIdentityGsm = h2aTranslate(in.cellIdentityGsm); - out.signalStrengthGsm = h2aTranslate(in.signalStrengthGsm); - return out; - } - - static public android.hardware.radio.CellInfoWcdma h2aTranslate( - android.hardware.radio.V1_5.CellInfoWcdma in) { - android.hardware.radio.CellInfoWcdma out = new android.hardware.radio.CellInfoWcdma(); - out.cellIdentityWcdma = h2aTranslate(in.cellIdentityWcdma); - out.signalStrengthWcdma = h2aTranslate(in.signalStrengthWcdma); - return out; - } - - static public android.hardware.radio.CellInfoTdscdma h2aTranslate( - android.hardware.radio.V1_5.CellInfoTdscdma in) { - android.hardware.radio.CellInfoTdscdma out = new android.hardware.radio.CellInfoTdscdma(); - out.cellIdentityTdscdma = h2aTranslate(in.cellIdentityTdscdma); - out.signalStrengthTdscdma = h2aTranslate(in.signalStrengthTdscdma); - return out; - } - - static public android.hardware.radio.CellIdentity h2aTranslate( - android.hardware.radio.V1_5.CellIdentity in) { - android.hardware.radio.CellIdentity out = new android.hardware.radio.CellIdentity(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.gsm: - out.setGsm(h2aTranslate(in.gsm())); - break; - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.wcdma: - out.setWcdma(h2aTranslate(in.wcdma())); - break; - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.tdscdma: - out.setTdscdma(h2aTranslate(in.tdscdma())); - break; - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.cdma: - out.setCdma(h2aTranslate(in.cdma())); - break; - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.lte: - out.setLte(h2aTranslate(in.lte())); - break; - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.nr: - out.setNr(h2aTranslate(in.nr())); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.BarringInfo h2aTranslate( - android.hardware.radio.V1_5.BarringInfo in) { - android.hardware.radio.BarringInfo out = new android.hardware.radio.BarringInfo(); - out.serviceType = in.serviceType; - out.barringType = in.barringType; - out.barringTypeSpecificInfo = h2aTranslate(in.barringTypeSpecificInfo); - return out; - } - - static public android.hardware.radio.BarringInfoBarringTypeSpecificInfoConditional h2aTranslate( - android.hardware.radio.V1_5.BarringInfo.BarringTypeSpecificInfo.Conditional in) { - android.hardware.radio.BarringInfoBarringTypeSpecificInfoConditional out = - new android.hardware.radio.BarringInfoBarringTypeSpecificInfoConditional(); - out.factor = in.factor; - out.timeSeconds = in.timeSeconds; - out.isBarred = in.isBarred; - return out; - } - - static public android.hardware.radio.BarringInfoBarringTypeSpecificInfo h2aTranslate( - android.hardware.radio.V1_5.BarringInfo.BarringTypeSpecificInfo in) { - android.hardware.radio.BarringInfoBarringTypeSpecificInfo out = - new android.hardware.radio.BarringInfoBarringTypeSpecificInfo(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_5.BarringInfo.BarringTypeSpecificInfo.hidl_discriminator - .noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_5.BarringInfo.BarringTypeSpecificInfo.hidl_discriminator - .conditional: - out.setConditional(h2aTranslate(in.conditional())); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio - .RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo - h2aTranslate(android.hardware.radio.V1_5.RegStateResult.AccessTechnologySpecificInfo - .Cdma2000RegistrationInfo in) { - android.hardware.radio - .RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo out = - new android.hardware.radio - .RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo(); - out.cssSupported = in.cssSupported; - out.roamingIndicator = in.roamingIndicator; - out.systemIsInPrl = in.systemIsInPrl; - out.defaultRoamingIndicator = in.defaultRoamingIndicator; - return out; - } - - static public android.hardware.radio - .RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo - h2aTranslate(android.hardware.radio.V1_5.RegStateResult.AccessTechnologySpecificInfo - .EutranRegistrationInfo in) { - android.hardware.radio - .RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo out = - new android.hardware.radio - .RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo(); - out.lteVopsInfo = h2aTranslate(in.lteVopsInfo); - out.nrIndicators = h2aTranslate(in.nrIndicators); - return out; - } - - static public android.hardware.radio.AppStatus h2aTranslate( - android.hardware.radio.V1_5.AppStatus in) { - android.hardware.radio.AppStatus out = new android.hardware.radio.AppStatus(); - out.appType = in.base.appType; - out.appState = in.base.appState; - out.persoSubstate = in.persoSubstate; - out.aidPtr = in.base.aidPtr; - out.appLabelPtr = in.base.appLabelPtr; - out.pin1Replaced = in.base.pin1Replaced; - out.pin1 = in.base.pin1; - out.pin2 = in.base.pin2; - return out; - } - - static public android.hardware.radio.CardStatus h2aTranslate( - android.hardware.radio.V1_5.CardStatus in) { - android.hardware.radio.CardStatus out = new android.hardware.radio.CardStatus(); - out.cardState = in.base.base.base.cardState; - out.universalPinState = in.base.base.base.universalPinState; - out.gsmUmtsSubscriptionAppIndex = in.base.base.base.gsmUmtsSubscriptionAppIndex; - out.cdmaSubscriptionAppIndex = in.base.base.base.cdmaSubscriptionAppIndex; - out.imsSubscriptionAppIndex = in.base.base.base.imsSubscriptionAppIndex; - if (in.applications != null) { - out.applications = new android.hardware.radio.AppStatus[in.applications.size()]; - for (int i = 0; i < in.applications.size(); i++) { - out.applications[i] = h2aTranslate(in.applications.get(i)); - } - } - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.base.base.physicalSlotId > 2147483647 || in.base.base.physicalSlotId < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.base.base.physicalSlotId"); - } - out.physicalSlotId = in.base.base.physicalSlotId; - out.atr = in.base.base.atr; - out.iccid = in.base.base.iccid; - out.eid = in.base.eid; - return out; - } - - static public android.hardware.radio.QosBandwidth h2aTranslate( - android.hardware.radio.V1_6.QosBandwidth in) { - android.hardware.radio.QosBandwidth out = new android.hardware.radio.QosBandwidth(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.maxBitrateKbps > 2147483647 || in.maxBitrateKbps < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.maxBitrateKbps"); - } - out.maxBitrateKbps = in.maxBitrateKbps; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.guaranteedBitrateKbps > 2147483647 || in.guaranteedBitrateKbps < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.guaranteedBitrateKbps"); - } - out.guaranteedBitrateKbps = in.guaranteedBitrateKbps; - return out; - } - - static public android.hardware.radio.EpsQos h2aTranslate( - android.hardware.radio.V1_6.EpsQos in) { - android.hardware.radio.EpsQos out = new android.hardware.radio.EpsQos(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.qci < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.qci"); - } - out.qci = (char) in.qci; - out.downlink = h2aTranslate(in.downlink); - out.uplink = h2aTranslate(in.uplink); - return out; - } - - static public android.hardware.radio.NrQos h2aTranslate(android.hardware.radio.V1_6.NrQos in) { - android.hardware.radio.NrQos out = new android.hardware.radio.NrQos(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.fiveQi < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.fiveQi"); - } - out.fiveQi = (char) in.fiveQi; - out.downlink = h2aTranslate(in.downlink); - out.uplink = h2aTranslate(in.uplink); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.qfi > 127 || in.qfi < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.qfi"); - } - out.qfi = in.qfi; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.averagingWindowMs < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.averagingWindowMs"); - } - out.averagingWindowMs = (char) in.averagingWindowMs; - return out; - } - - static public android.hardware.radio.Qos h2aTranslate(android.hardware.radio.V1_6.Qos in) { - android.hardware.radio.Qos out = new android.hardware.radio.Qos(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_6.Qos.hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_6.Qos.hidl_discriminator.eps: - out.setEps(h2aTranslate(in.eps())); - break; - case android.hardware.radio.V1_6.Qos.hidl_discriminator.nr: - out.setNr(h2aTranslate(in.nr())); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.RadioResponseInfo h2aTranslate( - android.hardware.radio.V1_6.RadioResponseInfo in) { - android.hardware.radio.RadioResponseInfo out = - new android.hardware.radio.RadioResponseInfo(); - out.type = in.type; - out.serial = in.serial; - out.error = in.error; - return out; - } - - static public android.hardware.radio.PortRange h2aTranslate( - android.hardware.radio.V1_6.PortRange in) { - android.hardware.radio.PortRange out = new android.hardware.radio.PortRange(); - out.start = in.start; - out.end = in.end; - return out; - } - - static public android.hardware.radio.MaybePort h2aTranslate( - android.hardware.radio.V1_6.MaybePort in) { - android.hardware.radio.MaybePort out = new android.hardware.radio.MaybePort(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_6.MaybePort.hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_6.MaybePort.hidl_discriminator.range: - out.setRange(h2aTranslate(in.range())); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.QosFilter h2aTranslate( - android.hardware.radio.V1_6.QosFilter in) { - android.hardware.radio.QosFilter out = new android.hardware.radio.QosFilter(); - if (in.localAddresses != null) { - out.localAddresses = new String[in.localAddresses.size()]; - for (int i = 0; i < in.localAddresses.size(); i++) { - out.localAddresses[i] = in.localAddresses.get(i); - } - } - if (in.remoteAddresses != null) { - out.remoteAddresses = new String[in.remoteAddresses.size()]; - for (int i = 0; i < in.remoteAddresses.size(); i++) { - out.remoteAddresses[i] = in.remoteAddresses.get(i); - } - } - out.localPort = h2aTranslate(in.localPort); - out.remotePort = h2aTranslate(in.remotePort); - out.protocol = in.protocol; - out.tos = h2aTranslate(in.tos); - out.flowLabel = h2aTranslate(in.flowLabel); - out.spi = h2aTranslate(in.spi); - out.direction = in.direction; - out.precedence = in.precedence; - return out; - } - - static public android.hardware.radio.QosFilterTypeOfService h2aTranslate( - android.hardware.radio.V1_6.QosFilter.TypeOfService in) { - android.hardware.radio.QosFilterTypeOfService out = - new android.hardware.radio.QosFilterTypeOfService(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_6.QosFilter.TypeOfService.hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_6.QosFilter.TypeOfService.hidl_discriminator.value: - // FIXME This requires conversion between signed and unsigned. Change this if it - // doesn't suit your needs. - if (in.value() > 127 || in.value() < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.value()"); - } - out.setValue(in.value()); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.QosFilterIpv6FlowLabel h2aTranslate( - android.hardware.radio.V1_6.QosFilter.Ipv6FlowLabel in) { - android.hardware.radio.QosFilterIpv6FlowLabel out = - new android.hardware.radio.QosFilterIpv6FlowLabel(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_6.QosFilter.Ipv6FlowLabel.hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_6.QosFilter.Ipv6FlowLabel.hidl_discriminator.value: - // FIXME This requires conversion between signed and unsigned. Change this if it - // doesn't suit your needs. - if (in.value() > 2147483647 || in.value() < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.value()"); - } - out.setValue(in.value()); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.QosFilterIpsecSpi h2aTranslate( - android.hardware.radio.V1_6.QosFilter.IpsecSpi in) { - android.hardware.radio.QosFilterIpsecSpi out = - new android.hardware.radio.QosFilterIpsecSpi(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_6.QosFilter.IpsecSpi.hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_6.QosFilter.IpsecSpi.hidl_discriminator.value: - // FIXME This requires conversion between signed and unsigned. Change this if it - // doesn't suit your needs. - if (in.value() > 2147483647 || in.value() < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.value()"); - } - out.setValue(in.value()); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.QosSession h2aTranslate( - android.hardware.radio.V1_6.QosSession in) { - android.hardware.radio.QosSession out = new android.hardware.radio.QosSession(); - out.qosSessionId = in.qosSessionId; - out.qos = h2aTranslate(in.qos); - if (in.qosFilters != null) { - out.qosFilters = new android.hardware.radio.QosFilter[in.qosFilters.size()]; - for (int i = 0; i < in.qosFilters.size(); i++) { - out.qosFilters[i] = h2aTranslate(in.qosFilters.get(i)); - } - } - return out; - } - - static public android.hardware.radio.SetupDataCallResult h2aTranslate( - android.hardware.radio.V1_6.SetupDataCallResult in) { - android.hardware.radio.SetupDataCallResult out = - new android.hardware.radio.SetupDataCallResult(); - out.cause = in.cause; - out.suggestedRetryTime = in.suggestedRetryTime; - out.cid = in.cid; - out.active = in.active; - out.type = in.type; - out.ifname = in.ifname; - if (in.addresses != null) { - out.addresses = new android.hardware.radio.LinkAddress[in.addresses.size()]; - for (int i = 0; i < in.addresses.size(); i++) { - out.addresses[i] = h2aTranslate(in.addresses.get(i)); - } - } - if (in.dnses != null) { - out.dnses = new String[in.dnses.size()]; - for (int i = 0; i < in.dnses.size(); i++) { - out.dnses[i] = in.dnses.get(i); - } - } - if (in.gateways != null) { - out.gateways = new String[in.gateways.size()]; - for (int i = 0; i < in.gateways.size(); i++) { - out.gateways[i] = in.gateways.get(i); - } - } - if (in.pcscf != null) { - out.pcscf = new String[in.pcscf.size()]; - for (int i = 0; i < in.pcscf.size(); i++) { - out.pcscf[i] = in.pcscf.get(i); - } - } - out.mtuV4 = in.mtuV4; - out.mtuV6 = in.mtuV6; - out.defaultQos = h2aTranslate(in.defaultQos); - if (in.qosSessions != null) { - out.qosSessions = new android.hardware.radio.QosSession[in.qosSessions.size()]; - for (int i = 0; i < in.qosSessions.size(); i++) { - out.qosSessions[i] = h2aTranslate(in.qosSessions.get(i)); - } - } - out.handoverFailureMode = in.handoverFailureMode; - out.pduSessionId = in.pduSessionId; - out.sliceInfo = h2aTranslate(in.sliceInfo); - if (in.trafficDescriptors != null) { - out.trafficDescriptors = - new android.hardware.radio.TrafficDescriptor[in.trafficDescriptors.size()]; - for (int i = 0; i < in.trafficDescriptors.size(); i++) { - out.trafficDescriptors[i] = h2aTranslate(in.trafficDescriptors.get(i)); - } - } - return out; - } - - static public android.hardware.radio.LinkCapacityEstimate h2aTranslate( - android.hardware.radio.V1_6.LinkCapacityEstimate in) { - android.hardware.radio.LinkCapacityEstimate out = - new android.hardware.radio.LinkCapacityEstimate(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.downlinkCapacityKbps > 2147483647 || in.downlinkCapacityKbps < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.downlinkCapacityKbps"); - } - out.downlinkCapacityKbps = in.downlinkCapacityKbps; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.uplinkCapacityKbps > 2147483647 || in.uplinkCapacityKbps < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.uplinkCapacityKbps"); - } - out.uplinkCapacityKbps = in.uplinkCapacityKbps; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.secondaryDownlinkCapacityKbps > 2147483647 || in.secondaryDownlinkCapacityKbps < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.secondaryDownlinkCapacityKbps"); - } - out.secondaryDownlinkCapacityKbps = in.secondaryDownlinkCapacityKbps; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.secondaryUplinkCapacityKbps > 2147483647 || in.secondaryUplinkCapacityKbps < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.secondaryUplinkCapacityKbps"); - } - out.secondaryUplinkCapacityKbps = in.secondaryUplinkCapacityKbps; - return out; - } - - static public android.hardware.radio.NrVopsInfo h2aTranslate( - android.hardware.radio.V1_6.NrVopsInfo in) { - android.hardware.radio.NrVopsInfo out = new android.hardware.radio.NrVopsInfo(); - out.vopsSupported = in.vopsSupported; - out.emcSupported = in.emcSupported; - out.emfSupported = in.emfSupported; - return out; - } - - static public android.hardware.radio.LteSignalStrength h2aTranslate( - android.hardware.radio.V1_6.LteSignalStrength in) { - android.hardware.radio.LteSignalStrength out = - new android.hardware.radio.LteSignalStrength(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.base.signalStrength > 2147483647 || in.base.signalStrength < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.base.signalStrength"); - } - out.signalStrength = in.base.signalStrength; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.base.rsrp > 2147483647 || in.base.rsrp < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.base.rsrp"); - } - out.rsrp = in.base.rsrp; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.base.rsrq > 2147483647 || in.base.rsrq < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.base.rsrq"); - } - out.rsrq = in.base.rsrq; - out.rssnr = in.base.rssnr; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.base.cqi > 2147483647 || in.base.cqi < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.base.cqi"); - } - out.cqi = in.base.cqi; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.base.timingAdvance > 2147483647 || in.base.timingAdvance < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.base.timingAdvance"); - } - out.timingAdvance = in.base.timingAdvance; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.cqiTableIndex > 2147483647 || in.cqiTableIndex < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.cqiTableIndex"); - } - out.cqiTableIndex = in.cqiTableIndex; - return out; - } - - static public android.hardware.radio.NrSignalStrength h2aTranslate( - android.hardware.radio.V1_6.NrSignalStrength in) { - android.hardware.radio.NrSignalStrength out = new android.hardware.radio.NrSignalStrength(); - out.ssRsrp = in.base.ssRsrp; - out.ssRsrq = in.base.ssRsrq; - out.ssSinr = in.base.ssSinr; - out.csiRsrp = in.base.csiRsrp; - out.csiRsrq = in.base.csiRsrq; - out.csiSinr = in.base.csiSinr; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.csiCqiTableIndex > 2147483647 || in.csiCqiTableIndex < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.csiCqiTableIndex"); - } - out.csiCqiTableIndex = in.csiCqiTableIndex; - if (in.csiCqiReport != null) { - out.csiCqiReport = new byte[in.csiCqiReport.size()]; - for (int i = 0; i < in.csiCqiReport.size(); i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it - // doesn't suit your needs. - if (in.csiCqiReport.get(i) > 127 || in.csiCqiReport.get(i) < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.csiCqiReport.get(i)"); - } - out.csiCqiReport[i] = in.csiCqiReport.get(i); - } - } - return out; - } - - static public android.hardware.radio.SignalStrength h2aTranslate( - android.hardware.radio.V1_6.SignalStrength in) { - android.hardware.radio.SignalStrength out = new android.hardware.radio.SignalStrength(); - out.gsm = h2aTranslate(in.gsm); - out.cdma = h2aTranslate(in.cdma); - out.evdo = h2aTranslate(in.evdo); - out.lte = h2aTranslate(in.lte); - out.tdscdma = h2aTranslate(in.tdscdma); - out.wcdma = h2aTranslate(in.wcdma); - out.nr = h2aTranslate(in.nr); - return out; - } - - static public android.hardware.radio.CellInfoLte h2aTranslate( - android.hardware.radio.V1_6.CellInfoLte in) { - android.hardware.radio.CellInfoLte out = new android.hardware.radio.CellInfoLte(); - out.cellIdentityLte = h2aTranslate(in.cellIdentityLte); - out.signalStrengthLte = h2aTranslate(in.signalStrengthLte); - return out; - } - - static public android.hardware.radio.CellInfoNr h2aTranslate( - android.hardware.radio.V1_6.CellInfoNr in) { - android.hardware.radio.CellInfoNr out = new android.hardware.radio.CellInfoNr(); - out.cellIdentityNr = h2aTranslate(in.cellIdentityNr); - out.signalStrengthNr = h2aTranslate(in.signalStrengthNr); - return out; - } - - static public android.hardware.radio.CellInfo h2aTranslate( - android.hardware.radio.V1_6.CellInfo in) { - android.hardware.radio.CellInfo out = new android.hardware.radio.CellInfo(); - out.registered = in.registered; - out.connectionStatus = in.connectionStatus; - out.ratSpecificInfo = h2aTranslate(in.ratSpecificInfo); - return out; - } - - static public android.hardware.radio.CellInfoCellInfoRatSpecificInfo h2aTranslate( - android.hardware.radio.V1_6.CellInfo.CellInfoRatSpecificInfo in) { - android.hardware.radio.CellInfoCellInfoRatSpecificInfo out = - new android.hardware.radio.CellInfoCellInfoRatSpecificInfo(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_6.CellInfo.CellInfoRatSpecificInfo.hidl_discriminator - .gsm: - out.setGsm(h2aTranslate(in.gsm())); - break; - case android.hardware.radio.V1_6.CellInfo.CellInfoRatSpecificInfo.hidl_discriminator - .wcdma: - out.setWcdma(h2aTranslate(in.wcdma())); - break; - case android.hardware.radio.V1_6.CellInfo.CellInfoRatSpecificInfo.hidl_discriminator - .tdscdma: - out.setTdscdma(h2aTranslate(in.tdscdma())); - break; - case android.hardware.radio.V1_6.CellInfo.CellInfoRatSpecificInfo.hidl_discriminator - .lte: - out.setLte(h2aTranslate(in.lte())); - break; - case android.hardware.radio.V1_6.CellInfo.CellInfoRatSpecificInfo.hidl_discriminator.nr: - out.setNr(h2aTranslate(in.nr())); - break; - case android.hardware.radio.V1_6.CellInfo.CellInfoRatSpecificInfo.hidl_discriminator - .cdma: - out.setCdma(h2aTranslate(in.cdma())); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.NetworkScanResult h2aTranslate( - android.hardware.radio.V1_6.NetworkScanResult in) { - android.hardware.radio.NetworkScanResult out = - new android.hardware.radio.NetworkScanResult(); - out.status = in.status; - out.error = in.error; - if (in.networkInfos != null) { - out.networkInfos = new android.hardware.radio.CellInfo[in.networkInfos.size()]; - for (int i = 0; i < in.networkInfos.size(); i++) { - out.networkInfos[i] = h2aTranslate(in.networkInfos.get(i)); - } - } - return out; - } - - static public android.hardware.radio.RegStateResult h2aTranslate( - android.hardware.radio.V1_6.RegStateResult in) { - android.hardware.radio.RegStateResult out = new android.hardware.radio.RegStateResult(); - out.regState = in.regState; - out.rat = in.rat; - out.reasonForDenial = in.reasonForDenial; - out.cellIdentity = h2aTranslate(in.cellIdentity); - out.registeredPlmn = in.registeredPlmn; - out.accessTechnologySpecificInfo = h2aTranslate(in.accessTechnologySpecificInfo); - return out; - } - - static public android.hardware.radio.RegStateResultAccessTechnologySpecificInfo h2aTranslate( - android.hardware.radio.V1_6.RegStateResult.AccessTechnologySpecificInfo in) { - android.hardware.radio.RegStateResultAccessTechnologySpecificInfo out = - new android.hardware.radio.RegStateResultAccessTechnologySpecificInfo(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_6.RegStateResult.AccessTechnologySpecificInfo - .hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_6.RegStateResult.AccessTechnologySpecificInfo - .hidl_discriminator.cdmaInfo: - out.setCdmaInfo(h2aTranslate(in.cdmaInfo())); - break; - case android.hardware.radio.V1_6.RegStateResult.AccessTechnologySpecificInfo - .hidl_discriminator.eutranInfo: - out.setEutranInfo(h2aTranslate(in.eutranInfo())); - break; - case android.hardware.radio.V1_6.RegStateResult.AccessTechnologySpecificInfo - .hidl_discriminator.ngranNrVopsInfo: - out.setNgranNrVopsInfo(h2aTranslate(in.ngranNrVopsInfo())); - break; - case android.hardware.radio.V1_6.RegStateResult.AccessTechnologySpecificInfo - .hidl_discriminator.geranDtmSupported: - out.setGeranDtmSupported(in.geranDtmSupported()); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.Call h2aTranslate(android.hardware.radio.V1_6.Call in) { - android.hardware.radio.Call out = new android.hardware.radio.Call(); - out.state = in.base.base.state; - out.index = in.base.base.index; - out.toa = in.base.base.toa; - out.isMpty = in.base.base.isMpty; - out.isMT = in.base.base.isMT; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.base.base.als > 127 || in.base.base.als < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.base.base.als"); - } - out.als = in.base.base.als; - out.isVoice = in.base.base.isVoice; - out.isVoicePrivacy = in.base.base.isVoicePrivacy; - out.number = in.base.base.number; - out.numberPresentation = in.base.base.numberPresentation; - out.name = in.base.base.name; - out.namePresentation = in.base.base.namePresentation; - if (in.base.base.uusInfo != null) { - out.uusInfo = new android.hardware.radio.UusInfo[in.base.base.uusInfo.size()]; - for (int i = 0; i < in.base.base.uusInfo.size(); i++) { - out.uusInfo[i] = h2aTranslate(in.base.base.uusInfo.get(i)); - } - } - out.audioQuality = in.base.audioQuality; - out.forwardedNumber = in.forwardedNumber; - return out; - } - - static public android.hardware.radio.PhysicalChannelConfig h2aTranslate( - android.hardware.radio.V1_6.PhysicalChannelConfig in) { - android.hardware.radio.PhysicalChannelConfig out = - new android.hardware.radio.PhysicalChannelConfig(); - out.status = in.status; - out.rat = in.rat; - out.downlinkChannelNumber = in.downlinkChannelNumber; - out.uplinkChannelNumber = in.uplinkChannelNumber; - out.cellBandwidthDownlinkKhz = in.cellBandwidthDownlinkKhz; - out.cellBandwidthUplinkKhz = in.cellBandwidthUplinkKhz; - if (in.contextIds != null) { - out.contextIds = new int[in.contextIds.size()]; - for (int i = 0; i < in.contextIds.size(); i++) { - out.contextIds[i] = in.contextIds.get(i); - } - } - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.physicalCellId > 2147483647 || in.physicalCellId < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.physicalCellId"); - } - out.physicalCellId = in.physicalCellId; - out.band = h2aTranslate(in.band); - return out; - } - - static public android.hardware.radio.PhysicalChannelConfigBand h2aTranslate( - android.hardware.radio.V1_6.PhysicalChannelConfig.Band in) { - android.hardware.radio.PhysicalChannelConfigBand out = - new android.hardware.radio.PhysicalChannelConfigBand(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_6.PhysicalChannelConfig.Band.hidl_discriminator - .geranBand: - out.setGeranBand(in.geranBand()); - break; - case android.hardware.radio.V1_6.PhysicalChannelConfig.Band.hidl_discriminator - .utranBand: - out.setUtranBand(in.utranBand()); - break; - case android.hardware.radio.V1_6.PhysicalChannelConfig.Band.hidl_discriminator - .eutranBand: - out.setEutranBand(in.eutranBand()); - break; - case android.hardware.radio.V1_6.PhysicalChannelConfig.Band.hidl_discriminator - .ngranBand: - out.setNgranBand(in.ngranBand()); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.OptionalSliceInfo h2aTranslate( - android.hardware.radio.V1_6.OptionalSliceInfo in) { - android.hardware.radio.OptionalSliceInfo out = - new android.hardware.radio.OptionalSliceInfo(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_6.OptionalSliceInfo.hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_6.OptionalSliceInfo.hidl_discriminator.value: - out.setValue(h2aTranslate(in.value())); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.SliceInfo h2aTranslate( - android.hardware.radio.V1_6.SliceInfo in) { - android.hardware.radio.SliceInfo out = new android.hardware.radio.SliceInfo(); - out.sst = in.sst; - out.sliceDifferentiator = in.sliceDifferentiator; - out.mappedHplmnSst = in.mappedHplmnSst; - out.mappedHplmnSD = in.mappedHplmnSD; - out.status = in.status; - return out; - } - - static public android.hardware.radio.OptionalDnn h2aTranslate( - android.hardware.radio.V1_6.OptionalDnn in) { - android.hardware.radio.OptionalDnn out = new android.hardware.radio.OptionalDnn(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_6.OptionalDnn.hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_6.OptionalDnn.hidl_discriminator.value: - out.setValue(in.value()); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.OptionalOsAppId h2aTranslate( - android.hardware.radio.V1_6.OptionalOsAppId in) { - android.hardware.radio.OptionalOsAppId out = new android.hardware.radio.OptionalOsAppId(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_6.OptionalOsAppId.hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_6.OptionalOsAppId.hidl_discriminator.value: - out.setValue(h2aTranslate(in.value())); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.OptionalTrafficDescriptor h2aTranslate( - android.hardware.radio.V1_6.OptionalTrafficDescriptor in) { - android.hardware.radio.OptionalTrafficDescriptor out = - new android.hardware.radio.OptionalTrafficDescriptor(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_6.OptionalTrafficDescriptor.hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_6.OptionalTrafficDescriptor.hidl_discriminator.value: - out.setValue(h2aTranslate(in.value())); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.TrafficDescriptor h2aTranslate( - android.hardware.radio.V1_6.TrafficDescriptor in) { - android.hardware.radio.TrafficDescriptor out = - new android.hardware.radio.TrafficDescriptor(); - out.dnn = h2aTranslate(in.dnn); - out.osAppId = h2aTranslate(in.osAppId); - return out; - } - - static public android.hardware.radio.OsAppId h2aTranslate( - android.hardware.radio.V1_6.OsAppId in) { - android.hardware.radio.OsAppId out = new android.hardware.radio.OsAppId(); - if (in.osAppId != null) { - out.osAppId = new byte[in.osAppId.size()]; - for (int i = 0; i < in.osAppId.size(); i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it - // doesn't suit your needs. - if (in.osAppId.get(i) > 127 || in.osAppId.get(i) < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.osAppId.get(i)"); - } - out.osAppId[i] = in.osAppId.get(i); - } - } - return out; - } - - static public android.hardware.radio.SlicingConfig h2aTranslate( - android.hardware.radio.V1_6.SlicingConfig in) { - android.hardware.radio.SlicingConfig out = new android.hardware.radio.SlicingConfig(); - if (in.urspRules != null) { - out.urspRules = new android.hardware.radio.UrspRule[in.urspRules.size()]; - for (int i = 0; i < in.urspRules.size(); i++) { - out.urspRules[i] = h2aTranslate(in.urspRules.get(i)); - } - } - if (in.sliceInfo != null) { - out.sliceInfo = new android.hardware.radio.SliceInfo[in.sliceInfo.size()]; - for (int i = 0; i < in.sliceInfo.size(); i++) { - out.sliceInfo[i] = h2aTranslate(in.sliceInfo.get(i)); - } - } - return out; - } - - static public android.hardware.radio.UrspRule h2aTranslate( - android.hardware.radio.V1_6.UrspRule in) { - android.hardware.radio.UrspRule out = new android.hardware.radio.UrspRule(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.precedence > 127 || in.precedence < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.precedence"); - } - out.precedence = in.precedence; - if (in.trafficDescriptors != null) { - out.trafficDescriptors = - new android.hardware.radio.TrafficDescriptor[in.trafficDescriptors.size()]; - for (int i = 0; i < in.trafficDescriptors.size(); i++) { - out.trafficDescriptors[i] = h2aTranslate(in.trafficDescriptors.get(i)); - } - } - if (in.routeSelectionDescriptor != null) { - out.routeSelectionDescriptor = - new android.hardware.radio - .RouteSelectionDescriptor[in.routeSelectionDescriptor.size()]; - for (int i = 0; i < in.routeSelectionDescriptor.size(); i++) { - out.routeSelectionDescriptor[i] = h2aTranslate(in.routeSelectionDescriptor.get(i)); - } - } - return out; - } - - static public android.hardware.radio.RouteSelectionDescriptor h2aTranslate( - android.hardware.radio.V1_6.RouteSelectionDescriptor in) { - android.hardware.radio.RouteSelectionDescriptor out = - new android.hardware.radio.RouteSelectionDescriptor(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.precedence > 127 || in.precedence < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.precedence"); - } - out.precedence = in.precedence; - out.sessionType = h2aTranslate(in.sessionType); - out.sscMode = h2aTranslate(in.sscMode); - if (in.sliceInfo != null) { - out.sliceInfo = new android.hardware.radio.SliceInfo[in.sliceInfo.size()]; - for (int i = 0; i < in.sliceInfo.size(); i++) { - out.sliceInfo[i] = h2aTranslate(in.sliceInfo.get(i)); - } - } - if (in.dnn != null) { - out.dnn = new String[in.dnn.size()]; - for (int i = 0; i < in.dnn.size(); i++) { - out.dnn[i] = in.dnn.get(i); - } - } - return out; - } - - static public android.hardware.radio.OptionalPdpProtocolType h2aTranslate( - android.hardware.radio.V1_6.OptionalPdpProtocolType in) { - android.hardware.radio.OptionalPdpProtocolType out = - new android.hardware.radio.OptionalPdpProtocolType(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_6.OptionalPdpProtocolType.hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_6.OptionalPdpProtocolType.hidl_discriminator.value: - out.setValue(in.value()); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.OptionalSscMode h2aTranslate( - android.hardware.radio.V1_6.OptionalSscMode in) { - android.hardware.radio.OptionalSscMode out = new android.hardware.radio.OptionalSscMode(); - switch (in.getDiscriminator()) { - case android.hardware.radio.V1_6.OptionalSscMode.hidl_discriminator.noinit: - // Nothing to translate for Monostate. - break; - case android.hardware.radio.V1_6.OptionalSscMode.hidl_discriminator.value: - out.setValue(in.value()); - break; - default: - throw new RuntimeException( - "Unknown discriminator value: " + Integer.toString(in.getDiscriminator())); - } - return out; - } - - static public android.hardware.radio.ImsiEncryptionInfo h2aTranslate( - android.hardware.radio.V1_6.ImsiEncryptionInfo in) { - android.hardware.radio.ImsiEncryptionInfo out = - new android.hardware.radio.ImsiEncryptionInfo(); - out.mcc = in.base.mcc; - out.mnc = in.base.mnc; - if (in.base.carrierKey != null) { - out.carrierKey = new byte[in.base.carrierKey.size()]; - for (int i = 0; i < in.base.carrierKey.size(); i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it - // doesn't suit your needs. - if (in.base.carrierKey.get(i) > 127 || in.base.carrierKey.get(i) < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.base.carrierKey.get(i)"); - } - out.carrierKey[i] = in.base.carrierKey.get(i); - } - } - out.keyIdentifier = in.base.keyIdentifier; - out.expirationTime = in.base.expirationTime; - out.keyType = in.keyType; - return out; - } - - static public android.hardware.radio.PhonebookRecordInfo h2aTranslate( - android.hardware.radio.V1_6.PhonebookRecordInfo in) { - android.hardware.radio.PhonebookRecordInfo out = - new android.hardware.radio.PhonebookRecordInfo(); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.recordId > 2147483647 || in.recordId < 0) { - throw new RuntimeException( - "Unsafe conversion between signed and unsigned scalars for field: in.recordId"); - } - out.recordId = in.recordId; - out.name = in.name; - out.number = in.number; - if (in.emails != null) { - out.emails = new String[in.emails.size()]; - for (int i = 0; i < in.emails.size(); i++) { - out.emails[i] = in.emails.get(i); - } - } - if (in.additionalNumbers != null) { - out.additionalNumbers = new String[in.additionalNumbers.size()]; - for (int i = 0; i < in.additionalNumbers.size(); i++) { - out.additionalNumbers[i] = in.additionalNumbers.get(i); - } - } - return out; - } - - static public android.hardware.radio.PhonebookCapacity h2aTranslate( - android.hardware.radio.V1_6.PhonebookCapacity in) { - android.hardware.radio.PhonebookCapacity out = - new android.hardware.radio.PhonebookCapacity(); - out.maxAdnRecords = in.maxAdnRecords; - out.usedAdnRecords = in.usedAdnRecords; - out.maxEmailRecords = in.maxEmailRecords; - out.usedEmailRecords = in.usedEmailRecords; - out.maxAdditionalNumberRecords = in.maxAdditionalNumberRecords; - out.usedAdditionalNumberRecords = in.usedAdditionalNumberRecords; - out.maxNameLen = in.maxNameLen; - out.maxNumberLen = in.maxNumberLen; - out.maxEmailLen = in.maxEmailLen; - out.maxAdditionalNumberLen = in.maxAdditionalNumberLen; - return out; - } -} diff --git a/radio/aidl/android/hardware/radio/UiccSubActStatus.aidl b/radio/aidl/android/hardware/radio/UiccSubActStatus.aidl deleted file mode 100644 index b2bb03ecef..0000000000 --- a/radio/aidl/android/hardware/radio/UiccSubActStatus.aidl +++ /dev/null @@ -1,24 +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. - */ - -package android.hardware.radio; - -@VintfStability -@Backing(type="int") -enum UiccSubActStatus { - DEACTIVATE, - ACTIVATE, -} diff --git a/radio/aidl/android/hardware/radio/UrspRule.aidl b/radio/aidl/android/hardware/radio/UrspRule.aidl index 244bcb13bc..67d797a1bb 100644 --- a/radio/aidl/android/hardware/radio/UrspRule.aidl +++ b/radio/aidl/android/hardware/radio/UrspRule.aidl @@ -27,7 +27,7 @@ parcelable UrspRule { /** * Precedence value in the range of 0 to 255. Higher value has lower precedence. */ - byte precedence; + int precedence; /** * Used as a matcher for network requests. */ diff --git a/radio/aidl/android/hardware/radio/UusDcs.aidl b/radio/aidl/android/hardware/radio/UusDcs.aidl deleted file mode 100644 index b157e47a7d..0000000000 --- a/radio/aidl/android/hardware/radio/UusDcs.aidl +++ /dev/null @@ -1,47 +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. - */ - -package android.hardware.radio; - -/** - * User-to-User Signaling Information data coding schemes. Possible values for Octet 3 (Protocol - * Discriminator field) in the UUIE. The values have been specified in section 10.5.4.25 of - * 3GPP TS 24.008 - */ -@VintfStability -@Backing(type="int") -enum UusDcs { - /** - * User specified protocol - */ - USP, - /** - * OSI higher layer protocol - */ - OSIHLP, - /** - * X.244 - */ - X244, - /** - * Reserved for system management - */ - RMCF, - /** - * IA5 characters - */ - IA5C, -} diff --git a/radio/aidl/android/hardware/radio/UusInfo.aidl b/radio/aidl/android/hardware/radio/UusInfo.aidl index b766b0dc61..c96c626f7a 100644 --- a/radio/aidl/android/hardware/radio/UusInfo.aidl +++ b/radio/aidl/android/hardware/radio/UusInfo.aidl @@ -16,22 +16,52 @@ package android.hardware.radio; -import android.hardware.radio.UusDcs; -import android.hardware.radio.UusType; - /** * User-to-User Signaling Information defined in 3GPP 23.087 v8.0 */ @VintfStability parcelable UusInfo { /** - * UUS type + * User specified protocol + */ + const int UUS_DCS_USP = 0; + /** + * OSI higher layer protocol + */ + const int UUS_DCS_OSIHLP = 1; + /** + * X.244 + */ + const int UUS_DCS_X244 = 2; + /** + * Reserved for system management + */ + const int UUS_DCS_RMCF = 3; + /** + * IA5 characters + */ + const int UUS_DCS_IA5C = 4; + + const int UUS_TYPE_TYPE1_IMPLICIT = 0; + const int UUS_TYPE_TYPE1_REQUIRED = 1; + const int UUS_TYPE_TYPE1_NOT_REQUIRED = 2; + const int UUS_TYPE_TYPE2_REQUIRED = 3; + const int UUS_TYPE_TYPE2_NOT_REQUIRED = 4; + const int UUS_TYPE_TYPE3_REQUIRED = 5; + const int UUS_TYPE_TYPE3_NOT_REQUIRED = 6; + + /** + * User-to-User Signaling Information activation types derived from 3GPP 23.087 v8.0 + * Values are UUS_TYPE_ */ - UusType uusType; + int uusType; /** - * UUS data coding scheme + * User-to-User Signaling Information data coding schemes. Possible values for Octet 3 (Protocol + * Discriminator field) in the UUIE. The values have been specified in section 10.5.4.25 of + * 3GPP TS 24.008 + * Values are UUS_DCS_ */ - UusDcs uusDcs; + int uusDcs; /** * UUS data */ diff --git a/radio/aidl/android/hardware/radio/UusType.aidl b/radio/aidl/android/hardware/radio/UusType.aidl deleted file mode 100644 index af86c9780e..0000000000 --- a/radio/aidl/android/hardware/radio/UusType.aidl +++ /dev/null @@ -1,32 +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. - */ - -package android.hardware.radio; - -/** - * User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0 - */ -@VintfStability -@Backing(type="int") -enum UusType { - TYPE1_IMPLICIT, - TYPE1_REQUIRED, - TYPE1_NOT_REQUIRED, - TYPE2_REQUIRED, - TYPE2_NOT_REQUIRED, - TYPE3_REQUIRED, - TYPE3_NOT_REQUIRED, -} diff --git a/radio/aidl/android/hardware/radio/VopsIndicator.aidl b/radio/aidl/android/hardware/radio/VopsIndicator.aidl deleted file mode 100644 index 0533be9393..0000000000 --- a/radio/aidl/android/hardware/radio/VopsIndicator.aidl +++ /dev/null @@ -1,37 +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. - */ - -package android.hardware.radio; - -/** - * Defines the values for VoPS indicator of NR as per 3gpp spec 24.501 sec 9.10.3.5 - */ -@VintfStability -@Backing(type="byte") -enum VopsIndicator { - /** - * IMS voice over PS session not supported - */ - VOPS_NOT_SUPPORTED, - /** - * IMS voice over PS session supported over 3GPP access - */ - VOPS_OVER_3GPP, - /** - * IMS voice over PS session supported over non-3GPP access - */ - VOPS_OVER_NON_3GPP, -} diff --git a/radio/aidl/android/hardware/radio/translate-ndk.cpp b/radio/aidl/android/hardware/radio/translate-ndk.cpp deleted file mode 100644 index 0492aded9d..0000000000 --- a/radio/aidl/android/hardware/radio/translate-ndk.cpp +++ /dev/null @@ -1,7404 +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/hardware/radio/translate-ndk.h" - -namespace android::h2a { - -static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::ADDRESS_MAX == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::ADDRESS_MAX)); -static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::SUBADDRESS_MAX == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::SUBADDRESS_MAX)); -static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::BEARER_DATA_MAX == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::BEARER_DATA_MAX)); -static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_MAX_SND_SIZE == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_MAX_SND_SIZE)); -static_assert( - aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_EO_DATA_SEGMENT_MAX == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_EO_DATA_SEGMENT_MAX)); -static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::MAX_UD_HEADERS == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::MAX_UD_HEADERS)); -static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::USER_DATA_MAX == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::USER_DATA_MAX)); -static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_LARGE_PIC_SIZE == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_LARGE_PIC_SIZE)); -static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_SMALL_PIC_SIZE == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_SMALL_PIC_SIZE)); -static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_VAR_PIC_SIZE == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_VAR_PIC_SIZE)); -static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_ANIM_NUM_BITMAPS == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_ANIM_NUM_BITMAPS)); -static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_LARGE_BITMAP_SIZE == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_LARGE_BITMAP_SIZE)); -static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_SMALL_BITMAP_SIZE == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_SMALL_BITMAP_SIZE)); -static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::UDH_OTHER_SIZE == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::UDH_OTHER_SIZE)); -static_assert(aidl::android::hardware::radio::RadioCdmaSmsConst::IP_ADDRESS_SIZE == - static_cast( - ::android::hardware::radio::V1_0::RadioCdmaSmsConst::IP_ADDRESS_SIZE)); - -static_assert(aidl::android::hardware::radio::RadioResponseType::SOLICITED == - static_cast( - ::android::hardware::radio::V1_0::RadioResponseType::SOLICITED)); -static_assert(aidl::android::hardware::radio::RadioResponseType::SOLICITED_ACK == - static_cast( - ::android::hardware::radio::V1_0::RadioResponseType::SOLICITED_ACK)); -static_assert(aidl::android::hardware::radio::RadioResponseType::SOLICITED_ACK_EXP == - static_cast( - ::android::hardware::radio::V1_0::RadioResponseType::SOLICITED_ACK_EXP)); - -static_assert(aidl::android::hardware::radio::RadioIndicationType::UNSOLICITED == - static_cast( - ::android::hardware::radio::V1_0::RadioIndicationType::UNSOLICITED)); -static_assert(aidl::android::hardware::radio::RadioIndicationType::UNSOLICITED_ACK_EXP == - static_cast( - ::android::hardware::radio::V1_0::RadioIndicationType::UNSOLICITED_ACK_EXP)); - -static_assert(aidl::android::hardware::radio::RestrictedState::NONE == - static_cast( - ::android::hardware::radio::V1_0::RestrictedState::NONE)); -static_assert(aidl::android::hardware::radio::RestrictedState::CS_EMERGENCY == - static_cast( - ::android::hardware::radio::V1_0::RestrictedState::CS_EMERGENCY)); -static_assert(aidl::android::hardware::radio::RestrictedState::CS_NORMAL == - static_cast( - ::android::hardware::radio::V1_0::RestrictedState::CS_NORMAL)); -static_assert(aidl::android::hardware::radio::RestrictedState::CS_ALL == - static_cast( - ::android::hardware::radio::V1_0::RestrictedState::CS_ALL)); -static_assert(aidl::android::hardware::radio::RestrictedState::PS_ALL == - static_cast( - ::android::hardware::radio::V1_0::RestrictedState::PS_ALL)); - -static_assert(aidl::android::hardware::radio::CardState::ABSENT == - static_cast( - ::android::hardware::radio::V1_0::CardState::ABSENT)); -static_assert(aidl::android::hardware::radio::CardState::PRESENT == - static_cast( - ::android::hardware::radio::V1_0::CardState::PRESENT)); -static_assert(aidl::android::hardware::radio::CardState::ERROR == - static_cast( - ::android::hardware::radio::V1_0::CardState::ERROR)); -static_assert(aidl::android::hardware::radio::CardState::RESTRICTED == - static_cast( - ::android::hardware::radio::V1_0::CardState::RESTRICTED)); - -static_assert(aidl::android::hardware::radio::PinState::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_0::PinState::UNKNOWN)); -static_assert(aidl::android::hardware::radio::PinState::ENABLED_NOT_VERIFIED == - static_cast( - ::android::hardware::radio::V1_0::PinState::ENABLED_NOT_VERIFIED)); -static_assert(aidl::android::hardware::radio::PinState::ENABLED_VERIFIED == - static_cast( - ::android::hardware::radio::V1_0::PinState::ENABLED_VERIFIED)); -static_assert(aidl::android::hardware::radio::PinState::DISABLED == - static_cast( - ::android::hardware::radio::V1_0::PinState::DISABLED)); -static_assert(aidl::android::hardware::radio::PinState::ENABLED_BLOCKED == - static_cast( - ::android::hardware::radio::V1_0::PinState::ENABLED_BLOCKED)); -static_assert(aidl::android::hardware::radio::PinState::ENABLED_PERM_BLOCKED == - static_cast( - ::android::hardware::radio::V1_0::PinState::ENABLED_PERM_BLOCKED)); - -static_assert(aidl::android::hardware::radio::AppType::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_0::AppType::UNKNOWN)); -static_assert(aidl::android::hardware::radio::AppType::SIM == - static_cast( - ::android::hardware::radio::V1_0::AppType::SIM)); -static_assert(aidl::android::hardware::radio::AppType::USIM == - static_cast( - ::android::hardware::radio::V1_0::AppType::USIM)); -static_assert(aidl::android::hardware::radio::AppType::RUIM == - static_cast( - ::android::hardware::radio::V1_0::AppType::RUIM)); -static_assert(aidl::android::hardware::radio::AppType::CSIM == - static_cast( - ::android::hardware::radio::V1_0::AppType::CSIM)); -static_assert(aidl::android::hardware::radio::AppType::ISIM == - static_cast( - ::android::hardware::radio::V1_0::AppType::ISIM)); - -static_assert(aidl::android::hardware::radio::AppState::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_0::AppState::UNKNOWN)); -static_assert(aidl::android::hardware::radio::AppState::DETECTED == - static_cast( - ::android::hardware::radio::V1_0::AppState::DETECTED)); -static_assert(aidl::android::hardware::radio::AppState::PIN == - static_cast( - ::android::hardware::radio::V1_0::AppState::PIN)); -static_assert(aidl::android::hardware::radio::AppState::PUK == - static_cast( - ::android::hardware::radio::V1_0::AppState::PUK)); -static_assert(aidl::android::hardware::radio::AppState::SUBSCRIPTION_PERSO == - static_cast( - ::android::hardware::radio::V1_0::AppState::SUBSCRIPTION_PERSO)); -static_assert(aidl::android::hardware::radio::AppState::READY == - static_cast( - ::android::hardware::radio::V1_0::AppState::READY)); - -static_assert(aidl::android::hardware::radio::RadioState::OFF == - static_cast( - ::android::hardware::radio::V1_0::RadioState::OFF)); -static_assert(aidl::android::hardware::radio::RadioState::UNAVAILABLE == - static_cast( - ::android::hardware::radio::V1_0::RadioState::UNAVAILABLE)); -static_assert(aidl::android::hardware::radio::RadioState::ON == - static_cast( - ::android::hardware::radio::V1_0::RadioState::ON)); - -static_assert(aidl::android::hardware::radio::SapConnectRsp::SUCCESS == - static_cast( - ::android::hardware::radio::V1_0::SapConnectRsp::SUCCESS)); -static_assert(aidl::android::hardware::radio::SapConnectRsp::CONNECT_FAILURE == - static_cast( - ::android::hardware::radio::V1_0::SapConnectRsp::CONNECT_FAILURE)); -static_assert(aidl::android::hardware::radio::SapConnectRsp::MSG_SIZE_TOO_LARGE == - static_cast( - ::android::hardware::radio::V1_0::SapConnectRsp::MSG_SIZE_TOO_LARGE)); -static_assert(aidl::android::hardware::radio::SapConnectRsp::MSG_SIZE_TOO_SMALL == - static_cast( - ::android::hardware::radio::V1_0::SapConnectRsp::MSG_SIZE_TOO_SMALL)); -static_assert(aidl::android::hardware::radio::SapConnectRsp::CONNECT_OK_CALL_ONGOING == - static_cast( - ::android::hardware::radio::V1_0::SapConnectRsp::CONNECT_OK_CALL_ONGOING)); - -static_assert(aidl::android::hardware::radio::SapDisconnectType::GRACEFUL == - static_cast( - ::android::hardware::radio::V1_0::SapDisconnectType::GRACEFUL)); -static_assert(aidl::android::hardware::radio::SapDisconnectType::IMMEDIATE == - static_cast( - ::android::hardware::radio::V1_0::SapDisconnectType::IMMEDIATE)); - -static_assert(aidl::android::hardware::radio::SapApduType::APDU == - static_cast( - ::android::hardware::radio::V1_0::SapApduType::APDU)); -static_assert(aidl::android::hardware::radio::SapApduType::APDU7816 == - static_cast( - ::android::hardware::radio::V1_0::SapApduType::APDU7816)); - -static_assert(aidl::android::hardware::radio::SapResultCode::SUCCESS == - static_cast( - ::android::hardware::radio::V1_0::SapResultCode::SUCCESS)); -static_assert(aidl::android::hardware::radio::SapResultCode::GENERIC_FAILURE == - static_cast( - ::android::hardware::radio::V1_0::SapResultCode::GENERIC_FAILURE)); -static_assert(aidl::android::hardware::radio::SapResultCode::CARD_NOT_ACCESSSIBLE == - static_cast( - ::android::hardware::radio::V1_0::SapResultCode::CARD_NOT_ACCESSSIBLE)); -static_assert(aidl::android::hardware::radio::SapResultCode::CARD_ALREADY_POWERED_OFF == - static_cast( - ::android::hardware::radio::V1_0::SapResultCode::CARD_ALREADY_POWERED_OFF)); -static_assert(aidl::android::hardware::radio::SapResultCode::CARD_REMOVED == - static_cast( - ::android::hardware::radio::V1_0::SapResultCode::CARD_REMOVED)); -static_assert(aidl::android::hardware::radio::SapResultCode::CARD_ALREADY_POWERED_ON == - static_cast( - ::android::hardware::radio::V1_0::SapResultCode::CARD_ALREADY_POWERED_ON)); -static_assert(aidl::android::hardware::radio::SapResultCode::DATA_NOT_AVAILABLE == - static_cast( - ::android::hardware::radio::V1_0::SapResultCode::DATA_NOT_AVAILABLE)); -static_assert(aidl::android::hardware::radio::SapResultCode::NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_0::SapResultCode::NOT_SUPPORTED)); - -static_assert(aidl::android::hardware::radio::SapStatus::UNKNOWN_ERROR == - static_cast( - ::android::hardware::radio::V1_0::SapStatus::UNKNOWN_ERROR)); -static_assert(aidl::android::hardware::radio::SapStatus::CARD_RESET == - static_cast( - ::android::hardware::radio::V1_0::SapStatus::CARD_RESET)); -static_assert(aidl::android::hardware::radio::SapStatus::CARD_NOT_ACCESSIBLE == - static_cast( - ::android::hardware::radio::V1_0::SapStatus::CARD_NOT_ACCESSIBLE)); -static_assert(aidl::android::hardware::radio::SapStatus::CARD_REMOVED == - static_cast( - ::android::hardware::radio::V1_0::SapStatus::CARD_REMOVED)); -static_assert(aidl::android::hardware::radio::SapStatus::CARD_INSERTED == - static_cast( - ::android::hardware::radio::V1_0::SapStatus::CARD_INSERTED)); -static_assert(aidl::android::hardware::radio::SapStatus::RECOVERED == - static_cast( - ::android::hardware::radio::V1_0::SapStatus::RECOVERED)); - -static_assert(aidl::android::hardware::radio::SapTransferProtocol::T0 == - static_cast( - ::android::hardware::radio::V1_0::SapTransferProtocol::T0)); -static_assert(aidl::android::hardware::radio::SapTransferProtocol::T1 == - static_cast( - ::android::hardware::radio::V1_0::SapTransferProtocol::T1)); - -static_assert(aidl::android::hardware::radio::CallState::ACTIVE == - static_cast( - ::android::hardware::radio::V1_0::CallState::ACTIVE)); -static_assert(aidl::android::hardware::radio::CallState::HOLDING == - static_cast( - ::android::hardware::radio::V1_0::CallState::HOLDING)); -static_assert(aidl::android::hardware::radio::CallState::DIALING == - static_cast( - ::android::hardware::radio::V1_0::CallState::DIALING)); -static_assert(aidl::android::hardware::radio::CallState::ALERTING == - static_cast( - ::android::hardware::radio::V1_0::CallState::ALERTING)); -static_assert(aidl::android::hardware::radio::CallState::INCOMING == - static_cast( - ::android::hardware::radio::V1_0::CallState::INCOMING)); -static_assert(aidl::android::hardware::radio::CallState::WAITING == - static_cast( - ::android::hardware::radio::V1_0::CallState::WAITING)); - -static_assert(aidl::android::hardware::radio::UusType::TYPE1_IMPLICIT == - static_cast( - ::android::hardware::radio::V1_0::UusType::TYPE1_IMPLICIT)); -static_assert(aidl::android::hardware::radio::UusType::TYPE1_REQUIRED == - static_cast( - ::android::hardware::radio::V1_0::UusType::TYPE1_REQUIRED)); -static_assert(aidl::android::hardware::radio::UusType::TYPE1_NOT_REQUIRED == - static_cast( - ::android::hardware::radio::V1_0::UusType::TYPE1_NOT_REQUIRED)); -static_assert(aidl::android::hardware::radio::UusType::TYPE2_REQUIRED == - static_cast( - ::android::hardware::radio::V1_0::UusType::TYPE2_REQUIRED)); -static_assert(aidl::android::hardware::radio::UusType::TYPE2_NOT_REQUIRED == - static_cast( - ::android::hardware::radio::V1_0::UusType::TYPE2_NOT_REQUIRED)); -static_assert(aidl::android::hardware::radio::UusType::TYPE3_REQUIRED == - static_cast( - ::android::hardware::radio::V1_0::UusType::TYPE3_REQUIRED)); -static_assert(aidl::android::hardware::radio::UusType::TYPE3_NOT_REQUIRED == - static_cast( - ::android::hardware::radio::V1_0::UusType::TYPE3_NOT_REQUIRED)); - -static_assert(aidl::android::hardware::radio::UusDcs::USP == - static_cast( - ::android::hardware::radio::V1_0::UusDcs::USP)); -static_assert(aidl::android::hardware::radio::UusDcs::OSIHLP == - static_cast( - ::android::hardware::radio::V1_0::UusDcs::OSIHLP)); -static_assert(aidl::android::hardware::radio::UusDcs::X244 == - static_cast( - ::android::hardware::radio::V1_0::UusDcs::X244)); -static_assert(aidl::android::hardware::radio::UusDcs::RMCF == - static_cast( - ::android::hardware::radio::V1_0::UusDcs::RMCF)); -static_assert(aidl::android::hardware::radio::UusDcs::IA5C == - static_cast( - ::android::hardware::radio::V1_0::UusDcs::IA5C)); - -static_assert(aidl::android::hardware::radio::CallPresentation::ALLOWED == - static_cast( - ::android::hardware::radio::V1_0::CallPresentation::ALLOWED)); -static_assert(aidl::android::hardware::radio::CallPresentation::RESTRICTED == - static_cast( - ::android::hardware::radio::V1_0::CallPresentation::RESTRICTED)); -static_assert(aidl::android::hardware::radio::CallPresentation::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_0::CallPresentation::UNKNOWN)); -static_assert(aidl::android::hardware::radio::CallPresentation::PAYPHONE == - static_cast( - ::android::hardware::radio::V1_0::CallPresentation::PAYPHONE)); - -static_assert(aidl::android::hardware::radio::Clir::DEFAULT == - static_cast( - ::android::hardware::radio::V1_0::Clir::DEFAULT)); -static_assert(aidl::android::hardware::radio::Clir::INVOCATION == - static_cast( - ::android::hardware::radio::V1_0::Clir::INVOCATION)); -static_assert(aidl::android::hardware::radio::Clir::SUPPRESSION == - static_cast( - ::android::hardware::radio::V1_0::Clir::SUPPRESSION)); - -static_assert(aidl::android::hardware::radio::LastCallFailCause::UNOBTAINABLE_NUMBER == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::UNOBTAINABLE_NUMBER)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::NO_ROUTE_TO_DESTINATION == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::NO_ROUTE_TO_DESTINATION)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CHANNEL_UNACCEPTABLE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::CHANNEL_UNACCEPTABLE)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::OPERATOR_DETERMINED_BARRING == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OPERATOR_DETERMINED_BARRING)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::NORMAL == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::NORMAL)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::BUSY == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::BUSY)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::NO_USER_RESPONDING == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::NO_USER_RESPONDING)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::NO_ANSWER_FROM_USER == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::NO_ANSWER_FROM_USER)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CALL_REJECTED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::CALL_REJECTED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::NUMBER_CHANGED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::NUMBER_CHANGED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::PREEMPTION == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::PREEMPTION)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::DESTINATION_OUT_OF_ORDER == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::DESTINATION_OUT_OF_ORDER)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::INVALID_NUMBER_FORMAT == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::INVALID_NUMBER_FORMAT)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::FACILITY_REJECTED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::FACILITY_REJECTED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::RESP_TO_STATUS_ENQUIRY == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::RESP_TO_STATUS_ENQUIRY)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::NORMAL_UNSPECIFIED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::NORMAL_UNSPECIFIED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CONGESTION == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::CONGESTION)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::NETWORK_OUT_OF_ORDER == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::NETWORK_OUT_OF_ORDER)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::TEMPORARY_FAILURE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::TEMPORARY_FAILURE)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::SWITCHING_EQUIPMENT_CONGESTION == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - SWITCHING_EQUIPMENT_CONGESTION)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::ACCESS_INFORMATION_DISCARDED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::ACCESS_INFORMATION_DISCARDED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause:: - REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::RESOURCES_UNAVAILABLE_OR_UNSPECIFIED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - RESOURCES_UNAVAILABLE_OR_UNSPECIFIED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::QOS_UNAVAILABLE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::QOS_UNAVAILABLE)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::REQUESTED_FACILITY_NOT_SUBSCRIBED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - REQUESTED_FACILITY_NOT_SUBSCRIBED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::INCOMING_CALLS_BARRED_WITHIN_CUG == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - INCOMING_CALLS_BARRED_WITHIN_CUG)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::BEARER_CAPABILITY_NOT_AUTHORIZED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - BEARER_CAPABILITY_NOT_AUTHORIZED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::BEARER_CAPABILITY_UNAVAILABLE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - BEARER_CAPABILITY_UNAVAILABLE)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::SERVICE_OPTION_NOT_AVAILABLE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::SERVICE_OPTION_NOT_AVAILABLE)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::BEARER_SERVICE_NOT_IMPLEMENTED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - BEARER_SERVICE_NOT_IMPLEMENTED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::ACM_LIMIT_EXCEEDED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::ACM_LIMIT_EXCEEDED)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::REQUESTED_FACILITY_NOT_IMPLEMENTED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - REQUESTED_FACILITY_NOT_IMPLEMENTED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause:: - ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::SERVICE_OR_OPTION_NOT_IMPLEMENTED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - SERVICE_OR_OPTION_NOT_IMPLEMENTED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::INVALID_TRANSACTION_IDENTIFIER == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - INVALID_TRANSACTION_IDENTIFIER)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::USER_NOT_MEMBER_OF_CUG == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::USER_NOT_MEMBER_OF_CUG)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::INCOMPATIBLE_DESTINATION == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::INCOMPATIBLE_DESTINATION)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::INVALID_TRANSIT_NW_SELECTION == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::INVALID_TRANSIT_NW_SELECTION)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::SEMANTICALLY_INCORRECT_MESSAGE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - SEMANTICALLY_INCORRECT_MESSAGE)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::INVALID_MANDATORY_INFORMATION == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - INVALID_MANDATORY_INFORMATION)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::MESSAGE_TYPE_NON_IMPLEMENTED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::MESSAGE_TYPE_NON_IMPLEMENTED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause:: - MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::INFORMATION_ELEMENT_NON_EXISTENT == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - INFORMATION_ELEMENT_NON_EXISTENT)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CONDITIONAL_IE_ERROR == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::CONDITIONAL_IE_ERROR)); -static_assert(aidl::android::hardware::radio::LastCallFailCause:: - MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::RECOVERY_ON_TIMER_EXPIRED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::RECOVERY_ON_TIMER_EXPIRED)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::PROTOCOL_ERROR_UNSPECIFIED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::PROTOCOL_ERROR_UNSPECIFIED)); -static_assert( - aidl::android::hardware::radio::LastCallFailCause::INTERWORKING_UNSPECIFIED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::INTERWORKING_UNSPECIFIED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CALL_BARRED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::CALL_BARRED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::FDN_BLOCKED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::FDN_BLOCKED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::IMSI_UNKNOWN_IN_VLR == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::IMSI_UNKNOWN_IN_VLR)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::IMEI_NOT_ACCEPTED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::IMEI_NOT_ACCEPTED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::DIAL_MODIFIED_TO_USSD == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::DIAL_MODIFIED_TO_USSD)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::DIAL_MODIFIED_TO_SS == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::DIAL_MODIFIED_TO_SS)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::DIAL_MODIFIED_TO_DIAL == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::DIAL_MODIFIED_TO_DIAL)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_OFF == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_OFF)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OUT_OF_SERVICE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OUT_OF_SERVICE)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::NO_VALID_SIM == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::NO_VALID_SIM)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_INTERNAL_ERROR == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_INTERNAL_ERROR)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::NETWORK_RESP_TIMEOUT == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::NETWORK_RESP_TIMEOUT)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::NETWORK_REJECT == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::NETWORK_REJECT)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_ACCESS_FAILURE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_ACCESS_FAILURE)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_LINK_FAILURE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_LINK_FAILURE)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_LINK_LOST == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_LINK_LOST)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_UPLINK_FAILURE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_UPLINK_FAILURE)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_SETUP_FAILURE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_SETUP_FAILURE)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_RELEASE_NORMAL == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_RELEASE_NORMAL)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::RADIO_RELEASE_ABNORMAL == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::RADIO_RELEASE_ABNORMAL)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::ACCESS_CLASS_BLOCKED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::ACCESS_CLASS_BLOCKED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::NETWORK_DETACH == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::NETWORK_DETACH)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_LOCKED_UNTIL_POWER_CYCLE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause:: - CDMA_LOCKED_UNTIL_POWER_CYCLE)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_DROP == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_DROP)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_INTERCEPT == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_INTERCEPT)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_REORDER == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_REORDER)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_SO_REJECT == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_SO_REJECT)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_RETRY_ORDER == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_RETRY_ORDER)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_ACCESS_FAILURE == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_ACCESS_FAILURE)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_PREEMPTED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_PREEMPTED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_NOT_EMERGENCY == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_NOT_EMERGENCY)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::CDMA_ACCESS_BLOCKED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::CDMA_ACCESS_BLOCKED)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_1 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_1)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_2 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_2)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_3 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_3)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_4 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_4)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_5 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_5)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_6 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_6)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_7 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_7)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_8 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_8)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_9 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_9)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_10 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_10)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_11 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_11)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_12 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_12)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_13 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_13)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_14 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_14)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::OEM_CAUSE_15 == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::OEM_CAUSE_15)); -static_assert(aidl::android::hardware::radio::LastCallFailCause::ERROR_UNSPECIFIED == - static_cast( - ::android::hardware::radio::V1_0::LastCallFailCause::ERROR_UNSPECIFIED)); - -static_assert(aidl::android::hardware::radio::HardwareConfigType::MODEM == - static_cast( - ::android::hardware::radio::V1_0::HardwareConfigType::MODEM)); -static_assert(aidl::android::hardware::radio::HardwareConfigType::SIM == - static_cast( - ::android::hardware::radio::V1_0::HardwareConfigType::SIM)); - -static_assert(aidl::android::hardware::radio::RegState::NOT_REG_MT_NOT_SEARCHING_OP == - static_cast( - ::android::hardware::radio::V1_0::RegState::NOT_REG_MT_NOT_SEARCHING_OP)); -static_assert(aidl::android::hardware::radio::RegState::REG_HOME == - static_cast( - ::android::hardware::radio::V1_0::RegState::REG_HOME)); -static_assert(aidl::android::hardware::radio::RegState::NOT_REG_MT_SEARCHING_OP == - static_cast( - ::android::hardware::radio::V1_0::RegState::NOT_REG_MT_SEARCHING_OP)); -static_assert(aidl::android::hardware::radio::RegState::REG_DENIED == - static_cast( - ::android::hardware::radio::V1_0::RegState::REG_DENIED)); -static_assert(aidl::android::hardware::radio::RegState::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_0::RegState::UNKNOWN)); -static_assert(aidl::android::hardware::radio::RegState::REG_ROAMING == - static_cast( - ::android::hardware::radio::V1_0::RegState::REG_ROAMING)); -static_assert(aidl::android::hardware::radio::RegState::NOT_REG_MT_NOT_SEARCHING_OP_EM == - static_cast( - ::android::hardware::radio::V1_0::RegState::NOT_REG_MT_NOT_SEARCHING_OP_EM)); -static_assert(aidl::android::hardware::radio::RegState::NOT_REG_MT_SEARCHING_OP_EM == - static_cast( - ::android::hardware::radio::V1_0::RegState::NOT_REG_MT_SEARCHING_OP_EM)); -static_assert(aidl::android::hardware::radio::RegState::REG_DENIED_EM == - static_cast( - ::android::hardware::radio::V1_0::RegState::REG_DENIED_EM)); -static_assert(aidl::android::hardware::radio::RegState::UNKNOWN_EM == - static_cast( - ::android::hardware::radio::V1_0::RegState::UNKNOWN_EM)); - -static_assert(aidl::android::hardware::radio::DataProfileId::DEFAULT == - static_cast( - ::android::hardware::radio::V1_0::DataProfileId::DEFAULT)); -static_assert(aidl::android::hardware::radio::DataProfileId::TETHERED == - static_cast( - ::android::hardware::radio::V1_0::DataProfileId::TETHERED)); -static_assert(aidl::android::hardware::radio::DataProfileId::IMS == - static_cast( - ::android::hardware::radio::V1_0::DataProfileId::IMS)); -static_assert(aidl::android::hardware::radio::DataProfileId::FOTA == - static_cast( - ::android::hardware::radio::V1_0::DataProfileId::FOTA)); -static_assert(aidl::android::hardware::radio::DataProfileId::CBS == - static_cast( - ::android::hardware::radio::V1_0::DataProfileId::CBS)); -static_assert(aidl::android::hardware::radio::DataProfileId::OEM_BASE == - static_cast( - ::android::hardware::radio::V1_0::DataProfileId::OEM_BASE)); -static_assert(aidl::android::hardware::radio::DataProfileId::INVALID == - static_cast( - ::android::hardware::radio::V1_0::DataProfileId::INVALID)); - -static_assert(aidl::android::hardware::radio::SmsAcknowledgeFailCause::MEMORY_CAPACITY_EXCEEDED == - static_cast( - ::android::hardware::radio::V1_0::SmsAcknowledgeFailCause:: - MEMORY_CAPACITY_EXCEEDED)); -static_assert( - aidl::android::hardware::radio::SmsAcknowledgeFailCause::UNSPECIFIED_ERROR == - static_cast( - ::android::hardware::radio::V1_0::SmsAcknowledgeFailCause::UNSPECIFIED_ERROR)); - -static_assert(aidl::android::hardware::radio::CallForwardInfoStatus::DISABLE == - static_cast( - ::android::hardware::radio::V1_0::CallForwardInfoStatus::DISABLE)); -static_assert(aidl::android::hardware::radio::CallForwardInfoStatus::ENABLE == - static_cast( - ::android::hardware::radio::V1_0::CallForwardInfoStatus::ENABLE)); -static_assert(aidl::android::hardware::radio::CallForwardInfoStatus::INTERROGATE == - static_cast( - ::android::hardware::radio::V1_0::CallForwardInfoStatus::INTERROGATE)); -static_assert(aidl::android::hardware::radio::CallForwardInfoStatus::REGISTRATION == - static_cast( - ::android::hardware::radio::V1_0::CallForwardInfoStatus::REGISTRATION)); -static_assert(aidl::android::hardware::radio::CallForwardInfoStatus::ERASURE == - static_cast( - ::android::hardware::radio::V1_0::CallForwardInfoStatus::ERASURE)); - -static_assert(aidl::android::hardware::radio::ClipStatus::CLIP_PROVISIONED == - static_cast( - ::android::hardware::radio::V1_0::ClipStatus::CLIP_PROVISIONED)); -static_assert(aidl::android::hardware::radio::ClipStatus::CLIP_UNPROVISIONED == - static_cast( - ::android::hardware::radio::V1_0::ClipStatus::CLIP_UNPROVISIONED)); -static_assert(aidl::android::hardware::radio::ClipStatus::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_0::ClipStatus::UNKNOWN)); - -static_assert(aidl::android::hardware::radio::SmsWriteArgsStatus::REC_UNREAD == - static_cast( - ::android::hardware::radio::V1_0::SmsWriteArgsStatus::REC_UNREAD)); -static_assert(aidl::android::hardware::radio::SmsWriteArgsStatus::REC_READ == - static_cast( - ::android::hardware::radio::V1_0::SmsWriteArgsStatus::REC_READ)); -static_assert(aidl::android::hardware::radio::SmsWriteArgsStatus::STO_UNSENT == - static_cast( - ::android::hardware::radio::V1_0::SmsWriteArgsStatus::STO_UNSENT)); -static_assert(aidl::android::hardware::radio::SmsWriteArgsStatus::STO_SENT == - static_cast( - ::android::hardware::radio::V1_0::SmsWriteArgsStatus::STO_SENT)); - -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_UNSPECIFIED == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_UNSPECIFIED)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_EURO == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_EURO)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_USA == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_USA)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_JPN == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_JPN)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_AUS == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_AUS)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_AUS_2 == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_AUS_2)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_CELL_800 == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_CELL_800)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_PCS == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_PCS)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_JTACS == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_JTACS)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_KOREA_PCS == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_KOREA_PCS)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_5_450M == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_5_450M)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_IMT2000 == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_IMT2000)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_7_700M_2 == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_7_700M_2)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_8_1800M == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_8_1800M)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_9_900M == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_9_900M)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_10_800M_2 == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_10_800M_2)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_EURO_PAMR_400M == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_EURO_PAMR_400M)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_AWS == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_AWS)); -static_assert(aidl::android::hardware::radio::RadioBandMode::BAND_MODE_USA_2500M == - static_cast( - ::android::hardware::radio::V1_0::RadioBandMode::BAND_MODE_USA_2500M)); - -static_assert(aidl::android::hardware::radio::OperatorStatus::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_0::OperatorStatus::UNKNOWN)); -static_assert(aidl::android::hardware::radio::OperatorStatus::AVAILABLE == - static_cast( - ::android::hardware::radio::V1_0::OperatorStatus::AVAILABLE)); -static_assert(aidl::android::hardware::radio::OperatorStatus::CURRENT == - static_cast( - ::android::hardware::radio::V1_0::OperatorStatus::CURRENT)); -static_assert(aidl::android::hardware::radio::OperatorStatus::FORBIDDEN == - static_cast( - ::android::hardware::radio::V1_0::OperatorStatus::FORBIDDEN)); - -static_assert(aidl::android::hardware::radio::PreferredNetworkType::GSM_WCDMA == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::GSM_WCDMA)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::GSM_ONLY == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::GSM_ONLY)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::WCDMA == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::WCDMA)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::GSM_WCDMA_AUTO == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::GSM_WCDMA_AUTO)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::CDMA_EVDO_AUTO == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::CDMA_EVDO_AUTO)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::CDMA_ONLY == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::CDMA_ONLY)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::EVDO_ONLY == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::EVDO_ONLY)); -static_assert( - aidl::android::hardware::radio::PreferredNetworkType::GSM_WCDMA_CDMA_EVDO_AUTO == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::GSM_WCDMA_CDMA_EVDO_AUTO)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::LTE_CDMA_EVDO == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::LTE_CDMA_EVDO)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::LTE_GSM_WCDMA == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::LTE_GSM_WCDMA)); -static_assert( - aidl::android::hardware::radio::PreferredNetworkType::LTE_CMDA_EVDO_GSM_WCDMA == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::LTE_CMDA_EVDO_GSM_WCDMA)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::LTE_ONLY == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::LTE_ONLY)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::LTE_WCDMA == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::LTE_WCDMA)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_ONLY == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_ONLY)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_WCDMA == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_WCDMA)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_LTE == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_LTE)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_GSM == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_GSM)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_GSM_LTE == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_GSM_LTE)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_GSM_WCDMA == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_GSM_WCDMA)); -static_assert(aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_WCDMA_LTE == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_WCDMA_LTE)); -static_assert( - aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_GSM_WCDMA_LTE == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType::TD_SCDMA_GSM_WCDMA_LTE)); -static_assert( - aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType:: - TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO)); -static_assert( - aidl::android::hardware::radio::PreferredNetworkType::TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA == - static_cast( - ::android::hardware::radio::V1_0::PreferredNetworkType:: - TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA)); - -static_assert(aidl::android::hardware::radio::CdmaSubscriptionSource::RUIM_SIM == - static_cast( - ::android::hardware::radio::V1_0::CdmaSubscriptionSource::RUIM_SIM)); -static_assert(aidl::android::hardware::radio::CdmaSubscriptionSource::NV == - static_cast( - ::android::hardware::radio::V1_0::CdmaSubscriptionSource::NV)); - -static_assert(aidl::android::hardware::radio::CdmaRoamingType::HOME_NETWORK == - static_cast( - ::android::hardware::radio::V1_0::CdmaRoamingType::HOME_NETWORK)); -static_assert(aidl::android::hardware::radio::CdmaRoamingType::AFFILIATED_ROAM == - static_cast( - ::android::hardware::radio::V1_0::CdmaRoamingType::AFFILIATED_ROAM)); -static_assert(aidl::android::hardware::radio::CdmaRoamingType::ANY_ROAM == - static_cast( - ::android::hardware::radio::V1_0::CdmaRoamingType::ANY_ROAM)); - -static_assert(aidl::android::hardware::radio::TtyMode::OFF == - static_cast( - ::android::hardware::radio::V1_0::TtyMode::OFF)); -static_assert(aidl::android::hardware::radio::TtyMode::FULL == - static_cast( - ::android::hardware::radio::V1_0::TtyMode::FULL)); -static_assert(aidl::android::hardware::radio::TtyMode::HCO == - static_cast( - ::android::hardware::radio::V1_0::TtyMode::HCO)); -static_assert(aidl::android::hardware::radio::TtyMode::VCO == - static_cast( - ::android::hardware::radio::V1_0::TtyMode::VCO)); - -static_assert(aidl::android::hardware::radio::NvItem::CDMA_MEID == - static_cast( - ::android::hardware::radio::V1_0::NvItem::CDMA_MEID)); -static_assert(aidl::android::hardware::radio::NvItem::CDMA_MIN == - static_cast( - ::android::hardware::radio::V1_0::NvItem::CDMA_MIN)); -static_assert(aidl::android::hardware::radio::NvItem::CDMA_MDN == - static_cast( - ::android::hardware::radio::V1_0::NvItem::CDMA_MDN)); -static_assert(aidl::android::hardware::radio::NvItem::CDMA_ACCOLC == - static_cast( - ::android::hardware::radio::V1_0::NvItem::CDMA_ACCOLC)); -static_assert(aidl::android::hardware::radio::NvItem::DEVICE_MSL == - static_cast( - ::android::hardware::radio::V1_0::NvItem::DEVICE_MSL)); -static_assert(aidl::android::hardware::radio::NvItem::RTN_RECONDITIONED_STATUS == - static_cast( - ::android::hardware::radio::V1_0::NvItem::RTN_RECONDITIONED_STATUS)); -static_assert(aidl::android::hardware::radio::NvItem::RTN_ACTIVATION_DATE == - static_cast( - ::android::hardware::radio::V1_0::NvItem::RTN_ACTIVATION_DATE)); -static_assert(aidl::android::hardware::radio::NvItem::RTN_LIFE_TIMER == - static_cast( - ::android::hardware::radio::V1_0::NvItem::RTN_LIFE_TIMER)); -static_assert(aidl::android::hardware::radio::NvItem::RTN_LIFE_CALLS == - static_cast( - ::android::hardware::radio::V1_0::NvItem::RTN_LIFE_CALLS)); -static_assert(aidl::android::hardware::radio::NvItem::RTN_LIFE_DATA_TX == - static_cast( - ::android::hardware::radio::V1_0::NvItem::RTN_LIFE_DATA_TX)); -static_assert(aidl::android::hardware::radio::NvItem::RTN_LIFE_DATA_RX == - static_cast( - ::android::hardware::radio::V1_0::NvItem::RTN_LIFE_DATA_RX)); -static_assert(aidl::android::hardware::radio::NvItem::OMADM_HFA_LEVEL == - static_cast( - ::android::hardware::radio::V1_0::NvItem::OMADM_HFA_LEVEL)); -static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_NAI == - static_cast( - ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_NAI)); -static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_HOME_ADDRESS == - static_cast( - ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_HOME_ADDRESS)); -static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_AAA_AUTH == - static_cast( - ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_AAA_AUTH)); -static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_HA_AUTH == - static_cast( - ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_HA_AUTH)); -static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_PRI_HA_ADDR == - static_cast( - ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_PRI_HA_ADDR)); -static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_SEC_HA_ADDR == - static_cast( - ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_SEC_HA_ADDR)); -static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_REV_TUN_PREF == - static_cast( - ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_REV_TUN_PREF)); -static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_HA_SPI == - static_cast( - ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_HA_SPI)); -static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_AAA_SPI == - static_cast( - ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_AAA_SPI)); -static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_MN_HA_SS == - static_cast( - ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_MN_HA_SS)); -static_assert(aidl::android::hardware::radio::NvItem::MIP_PROFILE_MN_AAA_SS == - static_cast( - ::android::hardware::radio::V1_0::NvItem::MIP_PROFILE_MN_AAA_SS)); -static_assert(aidl::android::hardware::radio::NvItem::CDMA_PRL_VERSION == - static_cast( - ::android::hardware::radio::V1_0::NvItem::CDMA_PRL_VERSION)); -static_assert(aidl::android::hardware::radio::NvItem::CDMA_BC10 == - static_cast( - ::android::hardware::radio::V1_0::NvItem::CDMA_BC10)); -static_assert(aidl::android::hardware::radio::NvItem::CDMA_BC14 == - static_cast( - ::android::hardware::radio::V1_0::NvItem::CDMA_BC14)); -static_assert(aidl::android::hardware::radio::NvItem::CDMA_SO68 == - static_cast( - ::android::hardware::radio::V1_0::NvItem::CDMA_SO68)); -static_assert(aidl::android::hardware::radio::NvItem::CDMA_SO73_COP0 == - static_cast( - ::android::hardware::radio::V1_0::NvItem::CDMA_SO73_COP0)); -static_assert(aidl::android::hardware::radio::NvItem::CDMA_SO73_COP1TO7 == - static_cast( - ::android::hardware::radio::V1_0::NvItem::CDMA_SO73_COP1TO7)); -static_assert(aidl::android::hardware::radio::NvItem::CDMA_1X_ADVANCED_ENABLED == - static_cast( - ::android::hardware::radio::V1_0::NvItem::CDMA_1X_ADVANCED_ENABLED)); -static_assert(aidl::android::hardware::radio::NvItem::CDMA_EHRPD_ENABLED == - static_cast( - ::android::hardware::radio::V1_0::NvItem::CDMA_EHRPD_ENABLED)); -static_assert(aidl::android::hardware::radio::NvItem::CDMA_EHRPD_FORCED == - static_cast( - ::android::hardware::radio::V1_0::NvItem::CDMA_EHRPD_FORCED)); -static_assert(aidl::android::hardware::radio::NvItem::LTE_BAND_ENABLE_25 == - static_cast( - ::android::hardware::radio::V1_0::NvItem::LTE_BAND_ENABLE_25)); -static_assert(aidl::android::hardware::radio::NvItem::LTE_BAND_ENABLE_26 == - static_cast( - ::android::hardware::radio::V1_0::NvItem::LTE_BAND_ENABLE_26)); -static_assert(aidl::android::hardware::radio::NvItem::LTE_BAND_ENABLE_41 == - static_cast( - ::android::hardware::radio::V1_0::NvItem::LTE_BAND_ENABLE_41)); -static_assert(aidl::android::hardware::radio::NvItem::LTE_SCAN_PRIORITY_25 == - static_cast( - ::android::hardware::radio::V1_0::NvItem::LTE_SCAN_PRIORITY_25)); -static_assert(aidl::android::hardware::radio::NvItem::LTE_SCAN_PRIORITY_26 == - static_cast( - ::android::hardware::radio::V1_0::NvItem::LTE_SCAN_PRIORITY_26)); -static_assert(aidl::android::hardware::radio::NvItem::LTE_SCAN_PRIORITY_41 == - static_cast( - ::android::hardware::radio::V1_0::NvItem::LTE_SCAN_PRIORITY_41)); -static_assert(aidl::android::hardware::radio::NvItem::LTE_HIDDEN_BAND_PRIORITY_25 == - static_cast( - ::android::hardware::radio::V1_0::NvItem::LTE_HIDDEN_BAND_PRIORITY_25)); -static_assert(aidl::android::hardware::radio::NvItem::LTE_HIDDEN_BAND_PRIORITY_26 == - static_cast( - ::android::hardware::radio::V1_0::NvItem::LTE_HIDDEN_BAND_PRIORITY_26)); -static_assert(aidl::android::hardware::radio::NvItem::LTE_HIDDEN_BAND_PRIORITY_41 == - static_cast( - ::android::hardware::radio::V1_0::NvItem::LTE_HIDDEN_BAND_PRIORITY_41)); - -static_assert(aidl::android::hardware::radio::ResetNvType::RELOAD == - static_cast( - ::android::hardware::radio::V1_0::ResetNvType::RELOAD)); -static_assert(aidl::android::hardware::radio::ResetNvType::ERASE == - static_cast( - ::android::hardware::radio::V1_0::ResetNvType::ERASE)); -static_assert(aidl::android::hardware::radio::ResetNvType::FACTORY_RESET == - static_cast( - ::android::hardware::radio::V1_0::ResetNvType::FACTORY_RESET)); - -static_assert(aidl::android::hardware::radio::HardwareConfigState::ENABLED == - static_cast( - ::android::hardware::radio::V1_0::HardwareConfigState::ENABLED)); -static_assert(aidl::android::hardware::radio::HardwareConfigState::STANDBY == - static_cast( - ::android::hardware::radio::V1_0::HardwareConfigState::STANDBY)); -static_assert(aidl::android::hardware::radio::HardwareConfigState::DISABLED == - static_cast( - ::android::hardware::radio::V1_0::HardwareConfigState::DISABLED)); - -static_assert(aidl::android::hardware::radio::LceStatus::NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_0::LceStatus::NOT_SUPPORTED)); -static_assert(aidl::android::hardware::radio::LceStatus::STOPPED == - static_cast( - ::android::hardware::radio::V1_0::LceStatus::STOPPED)); -static_assert(aidl::android::hardware::radio::LceStatus::ACTIVE == - static_cast( - ::android::hardware::radio::V1_0::LceStatus::ACTIVE)); - -static_assert(aidl::android::hardware::radio::CarrierMatchType::ALL == - static_cast( - ::android::hardware::radio::V1_0::CarrierMatchType::ALL)); -static_assert(aidl::android::hardware::radio::CarrierMatchType::SPN == - static_cast( - ::android::hardware::radio::V1_0::CarrierMatchType::SPN)); -static_assert(aidl::android::hardware::radio::CarrierMatchType::IMSI_PREFIX == - static_cast( - ::android::hardware::radio::V1_0::CarrierMatchType::IMSI_PREFIX)); -static_assert(aidl::android::hardware::radio::CarrierMatchType::GID1 == - static_cast( - ::android::hardware::radio::V1_0::CarrierMatchType::GID1)); -static_assert(aidl::android::hardware::radio::CarrierMatchType::GID2 == - static_cast( - ::android::hardware::radio::V1_0::CarrierMatchType::GID2)); - -static_assert(aidl::android::hardware::radio::CdmaSmsDigitMode::FOUR_BIT == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsDigitMode::FOUR_BIT)); -static_assert(aidl::android::hardware::radio::CdmaSmsDigitMode::EIGHT_BIT == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsDigitMode::EIGHT_BIT)); - -static_assert(aidl::android::hardware::radio::CdmaSmsNumberMode::NOT_DATA_NETWORK == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberMode::NOT_DATA_NETWORK)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberMode::DATA_NETWORK == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberMode::DATA_NETWORK)); - -static_assert(aidl::android::hardware::radio::CdmaSmsNumberType::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberType::UNKNOWN)); -static_assert( - aidl::android::hardware::radio::CdmaSmsNumberType::INTERNATIONAL_OR_DATA_IP == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberType::INTERNATIONAL_OR_DATA_IP)); -static_assert( - aidl::android::hardware::radio::CdmaSmsNumberType::NATIONAL_OR_INTERNET_MAIL == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberType::NATIONAL_OR_INTERNET_MAIL)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberType::NETWORK == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberType::NETWORK)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberType::SUBSCRIBER == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberType::SUBSCRIBER)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberType::ALPHANUMERIC == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberType::ALPHANUMERIC)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberType::ABBREVIATED == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberType::ABBREVIATED)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberType::RESERVED_7 == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberType::RESERVED_7)); - -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::UNKNOWN)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::TELEPHONY == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::TELEPHONY)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_2 == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_2)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::DATA == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::DATA)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::TELEX == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::TELEX)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_5 == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_5)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_6 == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_6)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_7 == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_7)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_8 == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_8)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::PRIVATE == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::PRIVATE)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_10 == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_10)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_11 == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_11)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_12 == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_12)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_13 == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_13)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_14 == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_14)); -static_assert(aidl::android::hardware::radio::CdmaSmsNumberPlan::RESERVED_15 == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsNumberPlan::RESERVED_15)); - -static_assert(aidl::android::hardware::radio::CdmaSmsSubaddressType::NSAP == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsSubaddressType::NSAP)); -static_assert(aidl::android::hardware::radio::CdmaSmsSubaddressType::USER_SPECIFIED == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsSubaddressType::USER_SPECIFIED)); - -static_assert(aidl::android::hardware::radio::CdmaSmsErrorClass::NO_ERROR == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsErrorClass::NO_ERROR)); -static_assert(aidl::android::hardware::radio::CdmaSmsErrorClass::ERROR == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsErrorClass::ERROR)); - -static_assert(aidl::android::hardware::radio::CdmaSmsWriteArgsStatus::REC_UNREAD == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsWriteArgsStatus::REC_UNREAD)); -static_assert(aidl::android::hardware::radio::CdmaSmsWriteArgsStatus::REC_READ == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsWriteArgsStatus::REC_READ)); -static_assert(aidl::android::hardware::radio::CdmaSmsWriteArgsStatus::STO_UNSENT == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsWriteArgsStatus::STO_UNSENT)); -static_assert(aidl::android::hardware::radio::CdmaSmsWriteArgsStatus::STO_SENT == - static_cast( - ::android::hardware::radio::V1_0::CdmaSmsWriteArgsStatus::STO_SENT)); - -static_assert(aidl::android::hardware::radio::CellInfoType::NONE == - static_cast( - ::android::hardware::radio::V1_0::CellInfoType::NONE)); -static_assert(aidl::android::hardware::radio::CellInfoType::GSM == - static_cast( - ::android::hardware::radio::V1_0::CellInfoType::GSM)); -static_assert(aidl::android::hardware::radio::CellInfoType::CDMA == - static_cast( - ::android::hardware::radio::V1_0::CellInfoType::CDMA)); -static_assert(aidl::android::hardware::radio::CellInfoType::LTE == - static_cast( - ::android::hardware::radio::V1_0::CellInfoType::LTE)); -static_assert(aidl::android::hardware::radio::CellInfoType::WCDMA == - static_cast( - ::android::hardware::radio::V1_0::CellInfoType::WCDMA)); -static_assert(aidl::android::hardware::radio::CellInfoType::TD_SCDMA == - static_cast( - ::android::hardware::radio::V1_0::CellInfoType::TD_SCDMA)); - -static_assert(aidl::android::hardware::radio::TimeStampType::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_0::TimeStampType::UNKNOWN)); -static_assert(aidl::android::hardware::radio::TimeStampType::ANTENNA == - static_cast( - ::android::hardware::radio::V1_0::TimeStampType::ANTENNA)); -static_assert(aidl::android::hardware::radio::TimeStampType::MODEM == - static_cast( - ::android::hardware::radio::V1_0::TimeStampType::MODEM)); -static_assert(aidl::android::hardware::radio::TimeStampType::OEM_RIL == - static_cast( - ::android::hardware::radio::V1_0::TimeStampType::OEM_RIL)); -static_assert(aidl::android::hardware::radio::TimeStampType::JAVA_RIL == - static_cast( - ::android::hardware::radio::V1_0::TimeStampType::JAVA_RIL)); - -static_assert(aidl::android::hardware::radio::ApnAuthType::NO_PAP_NO_CHAP == - static_cast( - ::android::hardware::radio::V1_0::ApnAuthType::NO_PAP_NO_CHAP)); -static_assert(aidl::android::hardware::radio::ApnAuthType::PAP_NO_CHAP == - static_cast( - ::android::hardware::radio::V1_0::ApnAuthType::PAP_NO_CHAP)); -static_assert(aidl::android::hardware::radio::ApnAuthType::NO_PAP_CHAP == - static_cast( - ::android::hardware::radio::V1_0::ApnAuthType::NO_PAP_CHAP)); -static_assert(aidl::android::hardware::radio::ApnAuthType::PAP_CHAP == - static_cast( - ::android::hardware::radio::V1_0::ApnAuthType::PAP_CHAP)); - -static_assert(aidl::android::hardware::radio::RadioTechnologyFamily::THREE_GPP == - static_cast( - ::android::hardware::radio::V1_0::RadioTechnologyFamily::THREE_GPP)); -static_assert(aidl::android::hardware::radio::RadioTechnologyFamily::THREE_GPP2 == - static_cast( - ::android::hardware::radio::V1_0::RadioTechnologyFamily::THREE_GPP2)); - -static_assert(aidl::android::hardware::radio::RadioCapabilityPhase::CONFIGURED == - static_cast( - ::android::hardware::radio::V1_0::RadioCapabilityPhase::CONFIGURED)); -static_assert(aidl::android::hardware::radio::RadioCapabilityPhase::START == - static_cast( - ::android::hardware::radio::V1_0::RadioCapabilityPhase::START)); -static_assert(aidl::android::hardware::radio::RadioCapabilityPhase::APPLY == - static_cast( - ::android::hardware::radio::V1_0::RadioCapabilityPhase::APPLY)); -static_assert(aidl::android::hardware::radio::RadioCapabilityPhase::UNSOL_RSP == - static_cast( - ::android::hardware::radio::V1_0::RadioCapabilityPhase::UNSOL_RSP)); -static_assert(aidl::android::hardware::radio::RadioCapabilityPhase::FINISH == - static_cast( - ::android::hardware::radio::V1_0::RadioCapabilityPhase::FINISH)); - -static_assert(aidl::android::hardware::radio::RadioCapabilityStatus::NONE == - static_cast( - ::android::hardware::radio::V1_0::RadioCapabilityStatus::NONE)); -static_assert(aidl::android::hardware::radio::RadioCapabilityStatus::SUCCESS == - static_cast( - ::android::hardware::radio::V1_0::RadioCapabilityStatus::SUCCESS)); -static_assert(aidl::android::hardware::radio::RadioCapabilityStatus::FAIL == - static_cast( - ::android::hardware::radio::V1_0::RadioCapabilityStatus::FAIL)); - -static_assert(aidl::android::hardware::radio::UssdModeType::NOTIFY == - static_cast( - ::android::hardware::radio::V1_0::UssdModeType::NOTIFY)); -static_assert(aidl::android::hardware::radio::UssdModeType::REQUEST == - static_cast( - ::android::hardware::radio::V1_0::UssdModeType::REQUEST)); -static_assert(aidl::android::hardware::radio::UssdModeType::NW_RELEASE == - static_cast( - ::android::hardware::radio::V1_0::UssdModeType::NW_RELEASE)); -static_assert(aidl::android::hardware::radio::UssdModeType::LOCAL_CLIENT == - static_cast( - ::android::hardware::radio::V1_0::UssdModeType::LOCAL_CLIENT)); -static_assert(aidl::android::hardware::radio::UssdModeType::NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_0::UssdModeType::NOT_SUPPORTED)); -static_assert(aidl::android::hardware::radio::UssdModeType::NW_TIMEOUT == - static_cast( - ::android::hardware::radio::V1_0::UssdModeType::NW_TIMEOUT)); - -static_assert(aidl::android::hardware::radio::SimRefreshType::SIM_FILE_UPDATE == - static_cast( - ::android::hardware::radio::V1_0::SimRefreshType::SIM_FILE_UPDATE)); -static_assert(aidl::android::hardware::radio::SimRefreshType::SIM_INIT == - static_cast( - ::android::hardware::radio::V1_0::SimRefreshType::SIM_INIT)); -static_assert(aidl::android::hardware::radio::SimRefreshType::SIM_RESET == - static_cast( - ::android::hardware::radio::V1_0::SimRefreshType::SIM_RESET)); - -static_assert(aidl::android::hardware::radio::SrvccState::HANDOVER_STARTED == - static_cast( - ::android::hardware::radio::V1_0::SrvccState::HANDOVER_STARTED)); -static_assert(aidl::android::hardware::radio::SrvccState::HANDOVER_COMPLETED == - static_cast( - ::android::hardware::radio::V1_0::SrvccState::HANDOVER_COMPLETED)); -static_assert(aidl::android::hardware::radio::SrvccState::HANDOVER_FAILED == - static_cast( - ::android::hardware::radio::V1_0::SrvccState::HANDOVER_FAILED)); -static_assert(aidl::android::hardware::radio::SrvccState::HANDOVER_CANCELED == - static_cast( - ::android::hardware::radio::V1_0::SrvccState::HANDOVER_CANCELED)); - -static_assert(aidl::android::hardware::radio::UiccSubActStatus::DEACTIVATE == - static_cast( - ::android::hardware::radio::V1_0::UiccSubActStatus::DEACTIVATE)); -static_assert(aidl::android::hardware::radio::UiccSubActStatus::ACTIVATE == - static_cast( - ::android::hardware::radio::V1_0::UiccSubActStatus::ACTIVATE)); - -static_assert(aidl::android::hardware::radio::SubscriptionType::SUBSCRIPTION_1 == - static_cast( - ::android::hardware::radio::V1_0::SubscriptionType::SUBSCRIPTION_1)); -static_assert(aidl::android::hardware::radio::SubscriptionType::SUBSCRIPTION_2 == - static_cast( - ::android::hardware::radio::V1_0::SubscriptionType::SUBSCRIPTION_2)); -static_assert(aidl::android::hardware::radio::SubscriptionType::SUBSCRIPTION_3 == - static_cast( - ::android::hardware::radio::V1_0::SubscriptionType::SUBSCRIPTION_3)); - -static_assert(aidl::android::hardware::radio::DataProfileInfoType::COMMON == - static_cast( - ::android::hardware::radio::V1_0::DataProfileInfoType::COMMON)); -static_assert(aidl::android::hardware::radio::DataProfileInfoType::THREE_GPP == - static_cast( - ::android::hardware::radio::V1_0::DataProfileInfoType::THREE_GPP)); -static_assert(aidl::android::hardware::radio::DataProfileInfoType::THREE_GPP2 == - static_cast( - ::android::hardware::radio::V1_0::DataProfileInfoType::THREE_GPP2)); - -static_assert(aidl::android::hardware::radio::PhoneRestrictedState::NONE == - static_cast( - ::android::hardware::radio::V1_0::PhoneRestrictedState::NONE)); -static_assert(aidl::android::hardware::radio::PhoneRestrictedState::CS_EMERGENCY == - static_cast( - ::android::hardware::radio::V1_0::PhoneRestrictedState::CS_EMERGENCY)); -static_assert(aidl::android::hardware::radio::PhoneRestrictedState::CS_NORMAL == - static_cast( - ::android::hardware::radio::V1_0::PhoneRestrictedState::CS_NORMAL)); -static_assert(aidl::android::hardware::radio::PhoneRestrictedState::CS_ALL == - static_cast( - ::android::hardware::radio::V1_0::PhoneRestrictedState::CS_ALL)); -static_assert(aidl::android::hardware::radio::PhoneRestrictedState::PS_ALL == - static_cast( - ::android::hardware::radio::V1_0::PhoneRestrictedState::PS_ALL)); - -static_assert( - aidl::android::hardware::radio::CdmaCallWaitingNumberPresentation::ALLOWED == - static_cast( - ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPresentation::ALLOWED)); -static_assert( - aidl::android::hardware::radio::CdmaCallWaitingNumberPresentation::RESTRICTED == - static_cast( - ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPresentation::RESTRICTED)); -static_assert( - aidl::android::hardware::radio::CdmaCallWaitingNumberPresentation::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPresentation::UNKNOWN)); - -static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberType::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_0::CdmaCallWaitingNumberType::UNKNOWN)); -static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberType::INTERNATIONAL == - static_cast( - ::android::hardware::radio::V1_0::CdmaCallWaitingNumberType::INTERNATIONAL)); -static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberType::NATIONAL == - static_cast( - ::android::hardware::radio::V1_0::CdmaCallWaitingNumberType::NATIONAL)); -static_assert( - aidl::android::hardware::radio::CdmaCallWaitingNumberType::NETWORK_SPECIFIC == - static_cast( - ::android::hardware::radio::V1_0::CdmaCallWaitingNumberType::NETWORK_SPECIFIC)); -static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberType::SUBSCRIBER == - static_cast( - ::android::hardware::radio::V1_0::CdmaCallWaitingNumberType::SUBSCRIBER)); - -static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberPlan::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPlan::UNKNOWN)); -static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberPlan::ISDN == - static_cast( - ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPlan::ISDN)); -static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberPlan::DATA == - static_cast( - ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPlan::DATA)); -static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberPlan::TELEX == - static_cast( - ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPlan::TELEX)); -static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberPlan::NATIONAL == - static_cast( - ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPlan::NATIONAL)); -static_assert(aidl::android::hardware::radio::CdmaCallWaitingNumberPlan::PRIVATE == - static_cast( - ::android::hardware::radio::V1_0::CdmaCallWaitingNumberPlan::PRIVATE)); - -static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::SPL_UNLOCKED == - static_cast( - ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::SPL_UNLOCKED)); -static_assert( - aidl::android::hardware::radio::CdmaOtaProvisionStatus::SPC_RETRIES_EXCEEDED == - static_cast( - ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::SPC_RETRIES_EXCEEDED)); -static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::A_KEY_EXCHANGED == - static_cast( - ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::A_KEY_EXCHANGED)); -static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::SSD_UPDATED == - static_cast( - ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::SSD_UPDATED)); -static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::NAM_DOWNLOADED == - static_cast( - ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::NAM_DOWNLOADED)); -static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::MDN_DOWNLOADED == - static_cast( - ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::MDN_DOWNLOADED)); -static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::IMSI_DOWNLOADED == - static_cast( - ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::IMSI_DOWNLOADED)); -static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::PRL_DOWNLOADED == - static_cast( - ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::PRL_DOWNLOADED)); -static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::COMMITTED == - static_cast( - ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::COMMITTED)); -static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::OTAPA_STARTED == - static_cast( - ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::OTAPA_STARTED)); -static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::OTAPA_STOPPED == - static_cast( - ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::OTAPA_STOPPED)); -static_assert(aidl::android::hardware::radio::CdmaOtaProvisionStatus::OTAPA_ABORTED == - static_cast( - ::android::hardware::radio::V1_0::CdmaOtaProvisionStatus::OTAPA_ABORTED)); - -static_assert(aidl::android::hardware::radio::CdmaInfoRecName::DISPLAY == - static_cast( - ::android::hardware::radio::V1_0::CdmaInfoRecName::DISPLAY)); -static_assert(aidl::android::hardware::radio::CdmaInfoRecName::CALLED_PARTY_NUMBER == - static_cast( - ::android::hardware::radio::V1_0::CdmaInfoRecName::CALLED_PARTY_NUMBER)); -static_assert(aidl::android::hardware::radio::CdmaInfoRecName::CALLING_PARTY_NUMBER == - static_cast( - ::android::hardware::radio::V1_0::CdmaInfoRecName::CALLING_PARTY_NUMBER)); -static_assert(aidl::android::hardware::radio::CdmaInfoRecName::CONNECTED_NUMBER == - static_cast( - ::android::hardware::radio::V1_0::CdmaInfoRecName::CONNECTED_NUMBER)); -static_assert(aidl::android::hardware::radio::CdmaInfoRecName::SIGNAL == - static_cast( - ::android::hardware::radio::V1_0::CdmaInfoRecName::SIGNAL)); -static_assert(aidl::android::hardware::radio::CdmaInfoRecName::REDIRECTING_NUMBER == - static_cast( - ::android::hardware::radio::V1_0::CdmaInfoRecName::REDIRECTING_NUMBER)); -static_assert(aidl::android::hardware::radio::CdmaInfoRecName::LINE_CONTROL == - static_cast( - ::android::hardware::radio::V1_0::CdmaInfoRecName::LINE_CONTROL)); -static_assert(aidl::android::hardware::radio::CdmaInfoRecName::EXTENDED_DISPLAY == - static_cast( - ::android::hardware::radio::V1_0::CdmaInfoRecName::EXTENDED_DISPLAY)); -static_assert(aidl::android::hardware::radio::CdmaInfoRecName::T53_CLIR == - static_cast( - ::android::hardware::radio::V1_0::CdmaInfoRecName::T53_CLIR)); -static_assert(aidl::android::hardware::radio::CdmaInfoRecName::T53_RELEASE == - static_cast( - ::android::hardware::radio::V1_0::CdmaInfoRecName::T53_RELEASE)); -static_assert(aidl::android::hardware::radio::CdmaInfoRecName::T53_AUDIO_CONTROL == - static_cast( - ::android::hardware::radio::V1_0::CdmaInfoRecName::T53_AUDIO_CONTROL)); - -static_assert(aidl::android::hardware::radio::CdmaRedirectingReason::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_0::CdmaRedirectingReason::UNKNOWN)); -static_assert( - aidl::android::hardware::radio::CdmaRedirectingReason::CALL_FORWARDING_BUSY == - static_cast( - ::android::hardware::radio::V1_0::CdmaRedirectingReason::CALL_FORWARDING_BUSY)); -static_assert( - aidl::android::hardware::radio::CdmaRedirectingReason::CALL_FORWARDING_NO_REPLY == - static_cast( - ::android::hardware::radio::V1_0::CdmaRedirectingReason::CALL_FORWARDING_NO_REPLY)); -static_assert( - aidl::android::hardware::radio::CdmaRedirectingReason::CALLED_DTE_OUT_OF_ORDER == - static_cast( - ::android::hardware::radio::V1_0::CdmaRedirectingReason::CALLED_DTE_OUT_OF_ORDER)); -static_assert( - aidl::android::hardware::radio::CdmaRedirectingReason::CALL_FORWARDING_BY_THE_CALLED_DTE == - static_cast( - ::android::hardware::radio::V1_0::CdmaRedirectingReason:: - CALL_FORWARDING_BY_THE_CALLED_DTE)); -static_assert( - aidl::android::hardware::radio::CdmaRedirectingReason::CALL_FORWARDING_UNCONDITIONAL == - static_cast( - ::android::hardware::radio::V1_0::CdmaRedirectingReason:: - CALL_FORWARDING_UNCONDITIONAL)); -static_assert(aidl::android::hardware::radio::CdmaRedirectingReason::RESERVED == - static_cast( - ::android::hardware::radio::V1_0::CdmaRedirectingReason::RESERVED)); - -static_assert(aidl::android::hardware::radio::SsServiceType::CFU == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::CFU)); -static_assert(aidl::android::hardware::radio::SsServiceType::CF_BUSY == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::CF_BUSY)); -static_assert(aidl::android::hardware::radio::SsServiceType::CF_NO_REPLY == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::CF_NO_REPLY)); -static_assert(aidl::android::hardware::radio::SsServiceType::CF_NOT_REACHABLE == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::CF_NOT_REACHABLE)); -static_assert(aidl::android::hardware::radio::SsServiceType::CF_ALL == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::CF_ALL)); -static_assert(aidl::android::hardware::radio::SsServiceType::CF_ALL_CONDITIONAL == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::CF_ALL_CONDITIONAL)); -static_assert(aidl::android::hardware::radio::SsServiceType::CLIP == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::CLIP)); -static_assert(aidl::android::hardware::radio::SsServiceType::CLIR == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::CLIR)); -static_assert(aidl::android::hardware::radio::SsServiceType::COLP == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::COLP)); -static_assert(aidl::android::hardware::radio::SsServiceType::COLR == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::COLR)); -static_assert(aidl::android::hardware::radio::SsServiceType::WAIT == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::WAIT)); -static_assert(aidl::android::hardware::radio::SsServiceType::BAOC == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::BAOC)); -static_assert(aidl::android::hardware::radio::SsServiceType::BAOIC == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::BAOIC)); -static_assert(aidl::android::hardware::radio::SsServiceType::BAOIC_EXC_HOME == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::BAOIC_EXC_HOME)); -static_assert(aidl::android::hardware::radio::SsServiceType::BAIC == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::BAIC)); -static_assert(aidl::android::hardware::radio::SsServiceType::BAIC_ROAMING == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::BAIC_ROAMING)); -static_assert(aidl::android::hardware::radio::SsServiceType::ALL_BARRING == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::ALL_BARRING)); -static_assert(aidl::android::hardware::radio::SsServiceType::OUTGOING_BARRING == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::OUTGOING_BARRING)); -static_assert(aidl::android::hardware::radio::SsServiceType::INCOMING_BARRING == - static_cast( - ::android::hardware::radio::V1_0::SsServiceType::INCOMING_BARRING)); - -static_assert(aidl::android::hardware::radio::SsRequestType::ACTIVATION == - static_cast( - ::android::hardware::radio::V1_0::SsRequestType::ACTIVATION)); -static_assert(aidl::android::hardware::radio::SsRequestType::DEACTIVATION == - static_cast( - ::android::hardware::radio::V1_0::SsRequestType::DEACTIVATION)); -static_assert(aidl::android::hardware::radio::SsRequestType::INTERROGATION == - static_cast( - ::android::hardware::radio::V1_0::SsRequestType::INTERROGATION)); -static_assert(aidl::android::hardware::radio::SsRequestType::REGISTRATION == - static_cast( - ::android::hardware::radio::V1_0::SsRequestType::REGISTRATION)); -static_assert(aidl::android::hardware::radio::SsRequestType::ERASURE == - static_cast( - ::android::hardware::radio::V1_0::SsRequestType::ERASURE)); - -static_assert( - aidl::android::hardware::radio::SsTeleserviceType::ALL_TELE_AND_BEARER_SERVICES == - static_cast( - ::android::hardware::radio::V1_0::SsTeleserviceType::ALL_TELE_AND_BEARER_SERVICES)); -static_assert(aidl::android::hardware::radio::SsTeleserviceType::ALL_TELESEVICES == - static_cast( - ::android::hardware::radio::V1_0::SsTeleserviceType::ALL_TELESEVICES)); -static_assert(aidl::android::hardware::radio::SsTeleserviceType::TELEPHONY == - static_cast( - ::android::hardware::radio::V1_0::SsTeleserviceType::TELEPHONY)); -static_assert(aidl::android::hardware::radio::SsTeleserviceType::ALL_DATA_TELESERVICES == - static_cast( - ::android::hardware::radio::V1_0::SsTeleserviceType::ALL_DATA_TELESERVICES)); -static_assert(aidl::android::hardware::radio::SsTeleserviceType::SMS_SERVICES == - static_cast( - ::android::hardware::radio::V1_0::SsTeleserviceType::SMS_SERVICES)); -static_assert( - aidl::android::hardware::radio::SsTeleserviceType::ALL_TELESERVICES_EXCEPT_SMS == - static_cast( - ::android::hardware::radio::V1_0::SsTeleserviceType::ALL_TELESERVICES_EXCEPT_SMS)); - -static_assert(aidl::android::hardware::radio::SuppServiceClass::NONE == - static_cast( - ::android::hardware::radio::V1_0::SuppServiceClass::NONE)); -static_assert(aidl::android::hardware::radio::SuppServiceClass::VOICE == - static_cast( - ::android::hardware::radio::V1_0::SuppServiceClass::VOICE)); -static_assert(aidl::android::hardware::radio::SuppServiceClass::DATA == - static_cast( - ::android::hardware::radio::V1_0::SuppServiceClass::DATA)); -static_assert(aidl::android::hardware::radio::SuppServiceClass::FAX == - static_cast( - ::android::hardware::radio::V1_0::SuppServiceClass::FAX)); -static_assert(aidl::android::hardware::radio::SuppServiceClass::SMS == - static_cast( - ::android::hardware::radio::V1_0::SuppServiceClass::SMS)); -static_assert(aidl::android::hardware::radio::SuppServiceClass::DATA_SYNC == - static_cast( - ::android::hardware::radio::V1_0::SuppServiceClass::DATA_SYNC)); -static_assert(aidl::android::hardware::radio::SuppServiceClass::DATA_ASYNC == - static_cast( - ::android::hardware::radio::V1_0::SuppServiceClass::DATA_ASYNC)); -static_assert(aidl::android::hardware::radio::SuppServiceClass::PACKET == - static_cast( - ::android::hardware::radio::V1_0::SuppServiceClass::PACKET)); -static_assert(aidl::android::hardware::radio::SuppServiceClass::PAD == - static_cast( - ::android::hardware::radio::V1_0::SuppServiceClass::PAD)); -static_assert(aidl::android::hardware::radio::SuppServiceClass::MAX == - static_cast( - ::android::hardware::radio::V1_0::SuppServiceClass::MAX)); - -static_assert(aidl::android::hardware::radio::MvnoType::NONE == - static_cast( - ::android::hardware::radio::V1_0::MvnoType::NONE)); -static_assert(aidl::android::hardware::radio::MvnoType::IMSI == - static_cast( - ::android::hardware::radio::V1_0::MvnoType::IMSI)); -static_assert(aidl::android::hardware::radio::MvnoType::GID == - static_cast( - ::android::hardware::radio::V1_0::MvnoType::GID)); -static_assert(aidl::android::hardware::radio::MvnoType::SPN == - static_cast( - ::android::hardware::radio::V1_0::MvnoType::SPN)); - -static_assert(aidl::android::hardware::radio::DeviceStateType::POWER_SAVE_MODE == - static_cast( - ::android::hardware::radio::V1_0::DeviceStateType::POWER_SAVE_MODE)); -static_assert(aidl::android::hardware::radio::DeviceStateType::CHARGING_STATE == - static_cast( - ::android::hardware::radio::V1_0::DeviceStateType::CHARGING_STATE)); -static_assert(aidl::android::hardware::radio::DeviceStateType::LOW_DATA_EXPECTED == - static_cast( - ::android::hardware::radio::V1_0::DeviceStateType::LOW_DATA_EXPECTED)); - -static_assert(aidl::android::hardware::radio::P2Constant::NO_P2 == - static_cast( - ::android::hardware::radio::V1_0::P2Constant::NO_P2)); - -static_assert(aidl::android::hardware::radio::CardPowerState::POWER_DOWN == - static_cast( - ::android::hardware::radio::V1_1::CardPowerState::POWER_DOWN)); -static_assert(aidl::android::hardware::radio::CardPowerState::POWER_UP == - static_cast( - ::android::hardware::radio::V1_1::CardPowerState::POWER_UP)); -static_assert(aidl::android::hardware::radio::CardPowerState::POWER_UP_PASS_THROUGH == - static_cast( - ::android::hardware::radio::V1_1::CardPowerState::POWER_UP_PASS_THROUGH)); - -static_assert(aidl::android::hardware::radio::GeranBands::BAND_T380 == - static_cast( - ::android::hardware::radio::V1_1::GeranBands::BAND_T380)); -static_assert(aidl::android::hardware::radio::GeranBands::BAND_T410 == - static_cast( - ::android::hardware::radio::V1_1::GeranBands::BAND_T410)); -static_assert(aidl::android::hardware::radio::GeranBands::BAND_450 == - static_cast( - ::android::hardware::radio::V1_1::GeranBands::BAND_450)); -static_assert(aidl::android::hardware::radio::GeranBands::BAND_480 == - static_cast( - ::android::hardware::radio::V1_1::GeranBands::BAND_480)); -static_assert(aidl::android::hardware::radio::GeranBands::BAND_710 == - static_cast( - ::android::hardware::radio::V1_1::GeranBands::BAND_710)); -static_assert(aidl::android::hardware::radio::GeranBands::BAND_750 == - static_cast( - ::android::hardware::radio::V1_1::GeranBands::BAND_750)); -static_assert(aidl::android::hardware::radio::GeranBands::BAND_T810 == - static_cast( - ::android::hardware::radio::V1_1::GeranBands::BAND_T810)); -static_assert(aidl::android::hardware::radio::GeranBands::BAND_850 == - static_cast( - ::android::hardware::radio::V1_1::GeranBands::BAND_850)); -static_assert(aidl::android::hardware::radio::GeranBands::BAND_P900 == - static_cast( - ::android::hardware::radio::V1_1::GeranBands::BAND_P900)); -static_assert(aidl::android::hardware::radio::GeranBands::BAND_E900 == - static_cast( - ::android::hardware::radio::V1_1::GeranBands::BAND_E900)); -static_assert(aidl::android::hardware::radio::GeranBands::BAND_R900 == - static_cast( - ::android::hardware::radio::V1_1::GeranBands::BAND_R900)); -static_assert(aidl::android::hardware::radio::GeranBands::BAND_DCS1800 == - static_cast( - ::android::hardware::radio::V1_1::GeranBands::BAND_DCS1800)); -static_assert(aidl::android::hardware::radio::GeranBands::BAND_PCS1900 == - static_cast( - ::android::hardware::radio::V1_1::GeranBands::BAND_PCS1900)); -static_assert(aidl::android::hardware::radio::GeranBands::BAND_ER900 == - static_cast( - ::android::hardware::radio::V1_1::GeranBands::BAND_ER900)); - -static_assert(aidl::android::hardware::radio::ScanType::ONE_SHOT == - static_cast( - ::android::hardware::radio::V1_1::ScanType::ONE_SHOT)); -static_assert(aidl::android::hardware::radio::ScanType::PERIODIC == - static_cast( - ::android::hardware::radio::V1_1::ScanType::PERIODIC)); - -static_assert(aidl::android::hardware::radio::ScanStatus::PARTIAL == - static_cast( - ::android::hardware::radio::V1_1::ScanStatus::PARTIAL)); -static_assert(aidl::android::hardware::radio::ScanStatus::COMPLETE == - static_cast( - ::android::hardware::radio::V1_1::ScanStatus::COMPLETE)); - -static_assert(aidl::android::hardware::radio::KeepaliveType::NATT_IPV4 == - static_cast( - ::android::hardware::radio::V1_1::KeepaliveType::NATT_IPV4)); -static_assert(aidl::android::hardware::radio::KeepaliveType::NATT_IPV6 == - static_cast( - ::android::hardware::radio::V1_1::KeepaliveType::NATT_IPV6)); - -static_assert(aidl::android::hardware::radio::KeepaliveStatusCode::ACTIVE == - static_cast( - ::android::hardware::radio::V1_1::KeepaliveStatusCode::ACTIVE)); -static_assert(aidl::android::hardware::radio::KeepaliveStatusCode::INACTIVE == - static_cast( - ::android::hardware::radio::V1_1::KeepaliveStatusCode::INACTIVE)); -static_assert(aidl::android::hardware::radio::KeepaliveStatusCode::PENDING == - static_cast( - ::android::hardware::radio::V1_1::KeepaliveStatusCode::PENDING)); - -static_assert(aidl::android::hardware::radio::RadioConst::CDMA_ALPHA_INFO_BUFFER_LENGTH == - static_cast( - ::android::hardware::radio::V1_2::RadioConst::CDMA_ALPHA_INFO_BUFFER_LENGTH)); -static_assert( - aidl::android::hardware::radio::RadioConst::CDMA_NUMBER_INFO_BUFFER_LENGTH == - static_cast( - ::android::hardware::radio::V1_2::RadioConst::CDMA_NUMBER_INFO_BUFFER_LENGTH)); -static_assert(aidl::android::hardware::radio::RadioConst::MAX_RILDS == - static_cast( - ::android::hardware::radio::V1_2::RadioConst::MAX_RILDS)); -static_assert(aidl::android::hardware::radio::RadioConst::MAX_SOCKET_NAME_LENGTH == - static_cast( - ::android::hardware::radio::V1_2::RadioConst::MAX_SOCKET_NAME_LENGTH)); -static_assert(aidl::android::hardware::radio::RadioConst::MAX_CLIENT_ID_LENGTH == - static_cast( - ::android::hardware::radio::V1_2::RadioConst::MAX_CLIENT_ID_LENGTH)); -static_assert(aidl::android::hardware::radio::RadioConst::MAX_DEBUG_SOCKET_NAME_LENGTH == - static_cast( - ::android::hardware::radio::V1_2::RadioConst::MAX_DEBUG_SOCKET_NAME_LENGTH)); -static_assert(aidl::android::hardware::radio::RadioConst::MAX_QEMU_PIPE_NAME_LENGTH == - static_cast( - ::android::hardware::radio::V1_2::RadioConst::MAX_QEMU_PIPE_NAME_LENGTH)); -static_assert(aidl::android::hardware::radio::RadioConst::MAX_UUID_LENGTH == - static_cast( - ::android::hardware::radio::V1_2::RadioConst::MAX_UUID_LENGTH)); -static_assert(aidl::android::hardware::radio::RadioConst::CARD_MAX_APPS == - static_cast( - ::android::hardware::radio::V1_2::RadioConst::CARD_MAX_APPS)); -static_assert(aidl::android::hardware::radio::RadioConst::CDMA_MAX_NUMBER_OF_INFO_RECS == - static_cast( - ::android::hardware::radio::V1_2::RadioConst::CDMA_MAX_NUMBER_OF_INFO_RECS)); -static_assert(aidl::android::hardware::radio::RadioConst::SS_INFO_MAX == - static_cast( - ::android::hardware::radio::V1_2::RadioConst::SS_INFO_MAX)); -static_assert(aidl::android::hardware::radio::RadioConst::NUM_SERVICE_CLASSES == - static_cast( - ::android::hardware::radio::V1_2::RadioConst::NUM_SERVICE_CLASSES)); -static_assert(aidl::android::hardware::radio::RadioConst::NUM_TX_POWER_LEVELS == - static_cast( - ::android::hardware::radio::V1_2::RadioConst::NUM_TX_POWER_LEVELS)); -static_assert( - aidl::android::hardware::radio::RadioConst::RADIO_ACCESS_SPECIFIER_MAX_SIZE == - static_cast( - ::android::hardware::radio::V1_2::RadioConst::RADIO_ACCESS_SPECIFIER_MAX_SIZE)); - -static_assert(aidl::android::hardware::radio::ScanIntervalRange::MIN == - static_cast( - ::android::hardware::radio::V1_2::ScanIntervalRange::MIN)); -static_assert(aidl::android::hardware::radio::ScanIntervalRange::MAX == - static_cast( - ::android::hardware::radio::V1_2::ScanIntervalRange::MAX)); - -static_assert(aidl::android::hardware::radio::MaxSearchTimeRange::MIN == - static_cast( - ::android::hardware::radio::V1_2::MaxSearchTimeRange::MIN)); -static_assert(aidl::android::hardware::radio::MaxSearchTimeRange::MAX == - static_cast( - ::android::hardware::radio::V1_2::MaxSearchTimeRange::MAX)); - -static_assert(aidl::android::hardware::radio::IncrementalResultsPeriodicityRange::MIN == - static_cast( - ::android::hardware::radio::V1_2::IncrementalResultsPeriodicityRange::MIN)); -static_assert(aidl::android::hardware::radio::IncrementalResultsPeriodicityRange::MAX == - static_cast( - ::android::hardware::radio::V1_2::IncrementalResultsPeriodicityRange::MAX)); - -static_assert(aidl::android::hardware::radio::CellConnectionStatus::NONE == - static_cast( - ::android::hardware::radio::V1_2::CellConnectionStatus::NONE)); -static_assert(aidl::android::hardware::radio::CellConnectionStatus::PRIMARY_SERVING == - static_cast( - ::android::hardware::radio::V1_2::CellConnectionStatus::PRIMARY_SERVING)); -static_assert(aidl::android::hardware::radio::CellConnectionStatus::SECONDARY_SERVING == - static_cast( - ::android::hardware::radio::V1_2::CellConnectionStatus::SECONDARY_SERVING)); - -static_assert(aidl::android::hardware::radio::AudioQuality::UNSPECIFIED == - static_cast( - ::android::hardware::radio::V1_2::AudioQuality::UNSPECIFIED)); -static_assert(aidl::android::hardware::radio::AudioQuality::AMR == - static_cast( - ::android::hardware::radio::V1_2::AudioQuality::AMR)); -static_assert(aidl::android::hardware::radio::AudioQuality::AMR_WB == - static_cast( - ::android::hardware::radio::V1_2::AudioQuality::AMR_WB)); -static_assert(aidl::android::hardware::radio::AudioQuality::GSM_EFR == - static_cast( - ::android::hardware::radio::V1_2::AudioQuality::GSM_EFR)); -static_assert(aidl::android::hardware::radio::AudioQuality::GSM_FR == - static_cast( - ::android::hardware::radio::V1_2::AudioQuality::GSM_FR)); -static_assert(aidl::android::hardware::radio::AudioQuality::GSM_HR == - static_cast( - ::android::hardware::radio::V1_2::AudioQuality::GSM_HR)); -static_assert(aidl::android::hardware::radio::AudioQuality::EVRC == - static_cast( - ::android::hardware::radio::V1_2::AudioQuality::EVRC)); -static_assert(aidl::android::hardware::radio::AudioQuality::EVRC_B == - static_cast( - ::android::hardware::radio::V1_2::AudioQuality::EVRC_B)); -static_assert(aidl::android::hardware::radio::AudioQuality::EVRC_WB == - static_cast( - ::android::hardware::radio::V1_2::AudioQuality::EVRC_WB)); -static_assert(aidl::android::hardware::radio::AudioQuality::EVRC_NW == - static_cast( - ::android::hardware::radio::V1_2::AudioQuality::EVRC_NW)); - -static_assert(aidl::android::hardware::radio::DataRequestReason::NORMAL == - static_cast( - ::android::hardware::radio::V1_2::DataRequestReason::NORMAL)); -static_assert(aidl::android::hardware::radio::DataRequestReason::SHUTDOWN == - static_cast( - ::android::hardware::radio::V1_2::DataRequestReason::SHUTDOWN)); -static_assert(aidl::android::hardware::radio::DataRequestReason::HANDOVER == - static_cast( - ::android::hardware::radio::V1_2::DataRequestReason::HANDOVER)); - -static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::UNSPECIFIED == - static_cast( - ::android::hardware::radio::V1_4::EmergencyServiceCategory::UNSPECIFIED)); -static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::POLICE == - static_cast( - ::android::hardware::radio::V1_4::EmergencyServiceCategory::POLICE)); -static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::AMBULANCE == - static_cast( - ::android::hardware::radio::V1_4::EmergencyServiceCategory::AMBULANCE)); -static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::FIRE_BRIGADE == - static_cast( - ::android::hardware::radio::V1_4::EmergencyServiceCategory::FIRE_BRIGADE)); -static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::MARINE_GUARD == - static_cast( - ::android::hardware::radio::V1_4::EmergencyServiceCategory::MARINE_GUARD)); -static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::MOUNTAIN_RESCUE == - static_cast( - ::android::hardware::radio::V1_4::EmergencyServiceCategory::MOUNTAIN_RESCUE)); -static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::MIEC == - static_cast( - ::android::hardware::radio::V1_4::EmergencyServiceCategory::MIEC)); -static_assert(aidl::android::hardware::radio::EmergencyServiceCategory::AIEC == - static_cast( - ::android::hardware::radio::V1_4::EmergencyServiceCategory::AIEC)); - -static_assert(aidl::android::hardware::radio::EmergencyNumberSource::NETWORK_SIGNALING == - static_cast( - ::android::hardware::radio::V1_4::EmergencyNumberSource::NETWORK_SIGNALING)); -static_assert(aidl::android::hardware::radio::EmergencyNumberSource::SIM == - static_cast( - ::android::hardware::radio::V1_4::EmergencyNumberSource::SIM)); -static_assert(aidl::android::hardware::radio::EmergencyNumberSource::MODEM_CONFIG == - static_cast( - ::android::hardware::radio::V1_4::EmergencyNumberSource::MODEM_CONFIG)); -static_assert(aidl::android::hardware::radio::EmergencyNumberSource::DEFAULT == - static_cast( - ::android::hardware::radio::V1_4::EmergencyNumberSource::DEFAULT)); - -static_assert(aidl::android::hardware::radio::EmergencyCallRouting::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_4::EmergencyCallRouting::UNKNOWN)); -static_assert(aidl::android::hardware::radio::EmergencyCallRouting::EMERGENCY == - static_cast( - ::android::hardware::radio::V1_4::EmergencyCallRouting::EMERGENCY)); -static_assert(aidl::android::hardware::radio::EmergencyCallRouting::NORMAL == - static_cast( - ::android::hardware::radio::V1_4::EmergencyCallRouting::NORMAL)); - -static_assert(aidl::android::hardware::radio::RadioTechnology::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::UNKNOWN)); -static_assert(aidl::android::hardware::radio::RadioTechnology::GPRS == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::GPRS)); -static_assert(aidl::android::hardware::radio::RadioTechnology::EDGE == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::EDGE)); -static_assert(aidl::android::hardware::radio::RadioTechnology::UMTS == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::UMTS)); -static_assert(aidl::android::hardware::radio::RadioTechnology::IS95A == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::IS95A)); -static_assert(aidl::android::hardware::radio::RadioTechnology::IS95B == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::IS95B)); -static_assert(aidl::android::hardware::radio::RadioTechnology::ONE_X_RTT == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::ONE_X_RTT)); -static_assert(aidl::android::hardware::radio::RadioTechnology::EVDO_0 == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::EVDO_0)); -static_assert(aidl::android::hardware::radio::RadioTechnology::EVDO_A == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::EVDO_A)); -static_assert(aidl::android::hardware::radio::RadioTechnology::HSDPA == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::HSDPA)); -static_assert(aidl::android::hardware::radio::RadioTechnology::HSUPA == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::HSUPA)); -static_assert(aidl::android::hardware::radio::RadioTechnology::HSPA == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::HSPA)); -static_assert(aidl::android::hardware::radio::RadioTechnology::EVDO_B == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::EVDO_B)); -static_assert(aidl::android::hardware::radio::RadioTechnology::EHRPD == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::EHRPD)); -static_assert(aidl::android::hardware::radio::RadioTechnology::LTE == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::LTE)); -static_assert(aidl::android::hardware::radio::RadioTechnology::HSPAP == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::HSPAP)); -static_assert(aidl::android::hardware::radio::RadioTechnology::GSM == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::GSM)); -static_assert(aidl::android::hardware::radio::RadioTechnology::TD_SCDMA == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::TD_SCDMA)); -static_assert(aidl::android::hardware::radio::RadioTechnology::IWLAN == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::IWLAN)); -static_assert(aidl::android::hardware::radio::RadioTechnology::LTE_CA == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::LTE_CA)); -static_assert(aidl::android::hardware::radio::RadioTechnology::NR == - static_cast( - ::android::hardware::radio::V1_4::RadioTechnology::NR)); - -static_assert(aidl::android::hardware::radio::RadioAccessFamily::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::UNKNOWN)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::GPRS == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::GPRS)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::EDGE == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::EDGE)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::UMTS == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::UMTS)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::IS95A == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::IS95A)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::IS95B == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::IS95B)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::ONE_X_RTT == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::ONE_X_RTT)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::EVDO_0 == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::EVDO_0)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::EVDO_A == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::EVDO_A)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::HSDPA == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::HSDPA)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::HSUPA == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::HSUPA)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::HSPA == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::HSPA)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::EVDO_B == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::EVDO_B)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::EHRPD == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::EHRPD)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::LTE == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::LTE)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::HSPAP == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::HSPAP)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::GSM == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::GSM)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::TD_SCDMA == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::TD_SCDMA)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::LTE_CA == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::LTE_CA)); -static_assert(aidl::android::hardware::radio::RadioAccessFamily::NR == - static_cast( - ::android::hardware::radio::V1_4::RadioAccessFamily::NR)); - -static_assert(aidl::android::hardware::radio::FrequencyRange::LOW == - static_cast( - ::android::hardware::radio::V1_4::FrequencyRange::LOW)); -static_assert(aidl::android::hardware::radio::FrequencyRange::MID == - static_cast( - ::android::hardware::radio::V1_4::FrequencyRange::MID)); -static_assert(aidl::android::hardware::radio::FrequencyRange::HIGH == - static_cast( - ::android::hardware::radio::V1_4::FrequencyRange::HIGH)); -static_assert(aidl::android::hardware::radio::FrequencyRange::MMWAVE == - static_cast( - ::android::hardware::radio::V1_4::FrequencyRange::MMWAVE)); - -static_assert(aidl::android::hardware::radio::DataConnActiveStatus::INACTIVE == - static_cast( - ::android::hardware::radio::V1_4::DataConnActiveStatus::INACTIVE)); -static_assert(aidl::android::hardware::radio::DataConnActiveStatus::DORMANT == - static_cast( - ::android::hardware::radio::V1_4::DataConnActiveStatus::DORMANT)); -static_assert(aidl::android::hardware::radio::DataConnActiveStatus::ACTIVE == - static_cast( - ::android::hardware::radio::V1_4::DataConnActiveStatus::ACTIVE)); - -static_assert(aidl::android::hardware::radio::PdpProtocolType::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_4::PdpProtocolType::UNKNOWN)); -static_assert(aidl::android::hardware::radio::PdpProtocolType::IP == - static_cast( - ::android::hardware::radio::V1_4::PdpProtocolType::IP)); -static_assert(aidl::android::hardware::radio::PdpProtocolType::IPV6 == - static_cast( - ::android::hardware::radio::V1_4::PdpProtocolType::IPV6)); -static_assert(aidl::android::hardware::radio::PdpProtocolType::IPV4V6 == - static_cast( - ::android::hardware::radio::V1_4::PdpProtocolType::IPV4V6)); -static_assert(aidl::android::hardware::radio::PdpProtocolType::PPP == - static_cast( - ::android::hardware::radio::V1_4::PdpProtocolType::PPP)); -static_assert(aidl::android::hardware::radio::PdpProtocolType::NON_IP == - static_cast( - ::android::hardware::radio::V1_4::PdpProtocolType::NON_IP)); -static_assert(aidl::android::hardware::radio::PdpProtocolType::UNSTRUCTURED == - static_cast( - ::android::hardware::radio::V1_4::PdpProtocolType::UNSTRUCTURED)); - -static_assert(aidl::android::hardware::radio::AccessNetwork::GERAN == - static_cast( - ::android::hardware::radio::V1_5::AccessNetwork::GERAN)); -static_assert(aidl::android::hardware::radio::AccessNetwork::UTRAN == - static_cast( - ::android::hardware::radio::V1_5::AccessNetwork::UTRAN)); -static_assert(aidl::android::hardware::radio::AccessNetwork::EUTRAN == - static_cast( - ::android::hardware::radio::V1_5::AccessNetwork::EUTRAN)); -static_assert(aidl::android::hardware::radio::AccessNetwork::CDMA2000 == - static_cast( - ::android::hardware::radio::V1_5::AccessNetwork::CDMA2000)); -static_assert(aidl::android::hardware::radio::AccessNetwork::IWLAN == - static_cast( - ::android::hardware::radio::V1_5::AccessNetwork::IWLAN)); -static_assert(aidl::android::hardware::radio::AccessNetwork::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_5::AccessNetwork::UNKNOWN)); -static_assert(aidl::android::hardware::radio::AccessNetwork::NGRAN == - static_cast( - ::android::hardware::radio::V1_5::AccessNetwork::NGRAN)); - -static_assert(aidl::android::hardware::radio::SignalMeasurementType::RSSI == - static_cast( - ::android::hardware::radio::V1_5::SignalMeasurementType::RSSI)); -static_assert(aidl::android::hardware::radio::SignalMeasurementType::RSCP == - static_cast( - ::android::hardware::radio::V1_5::SignalMeasurementType::RSCP)); -static_assert(aidl::android::hardware::radio::SignalMeasurementType::RSRP == - static_cast( - ::android::hardware::radio::V1_5::SignalMeasurementType::RSRP)); -static_assert(aidl::android::hardware::radio::SignalMeasurementType::RSRQ == - static_cast( - ::android::hardware::radio::V1_5::SignalMeasurementType::RSRQ)); -static_assert(aidl::android::hardware::radio::SignalMeasurementType::RSSNR == - static_cast( - ::android::hardware::radio::V1_5::SignalMeasurementType::RSSNR)); -static_assert(aidl::android::hardware::radio::SignalMeasurementType::SSRSRP == - static_cast( - ::android::hardware::radio::V1_5::SignalMeasurementType::SSRSRP)); -static_assert(aidl::android::hardware::radio::SignalMeasurementType::SSRSRQ == - static_cast( - ::android::hardware::radio::V1_5::SignalMeasurementType::SSRSRQ)); -static_assert(aidl::android::hardware::radio::SignalMeasurementType::SSSINR == - static_cast( - ::android::hardware::radio::V1_5::SignalMeasurementType::SSSINR)); - -static_assert(aidl::android::hardware::radio::SimLockMultiSimPolicy::NO_MULTISIM_POLICY == - static_cast( - ::android::hardware::radio::V1_4::SimLockMultiSimPolicy::NO_MULTISIM_POLICY)); -static_assert( - aidl::android::hardware::radio::SimLockMultiSimPolicy::ONE_VALID_SIM_MUST_BE_PRESENT == - static_cast( - ::android::hardware::radio::V1_4::SimLockMultiSimPolicy:: - ONE_VALID_SIM_MUST_BE_PRESENT)); - -static_assert(aidl::android::hardware::radio::RadioAccessNetworks::GERAN == - static_cast( - ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN)); -static_assert(aidl::android::hardware::radio::RadioAccessNetworks::UTRAN == - static_cast( - ::android::hardware::radio::V1_5::RadioAccessNetworks::UTRAN)); -static_assert(aidl::android::hardware::radio::RadioAccessNetworks::EUTRAN == - static_cast( - ::android::hardware::radio::V1_5::RadioAccessNetworks::EUTRAN)); -static_assert(aidl::android::hardware::radio::RadioAccessNetworks::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_5::RadioAccessNetworks::UNKNOWN)); -static_assert(aidl::android::hardware::radio::RadioAccessNetworks::NGRAN == - static_cast( - ::android::hardware::radio::V1_5::RadioAccessNetworks::NGRAN)); -static_assert(aidl::android::hardware::radio::RadioAccessNetworks::CDMA2000 == - static_cast( - ::android::hardware::radio::V1_5::RadioAccessNetworks::CDMA2000)); - -static_assert(aidl::android::hardware::radio::UtranBands::BAND_1 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_1)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_2 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_2)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_3 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_3)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_4 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_4)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_5 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_5)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_6 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_6)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_7 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_7)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_8 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_8)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_9 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_9)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_10 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_10)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_11 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_11)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_12 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_12)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_13 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_13)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_14 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_14)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_19 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_19)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_20 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_20)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_21 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_21)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_22 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_22)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_25 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_25)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_26 == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_26)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_A == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_A)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_B == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_B)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_C == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_C)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_D == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_D)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_E == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_E)); -static_assert(aidl::android::hardware::radio::UtranBands::BAND_F == - static_cast( - ::android::hardware::radio::V1_5::UtranBands::BAND_F)); - -static_assert(aidl::android::hardware::radio::EutranBands::BAND_1 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_1)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_2 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_2)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_3 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_3)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_4 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_4)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_5 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_5)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_6 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_6)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_7 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_7)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_8 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_8)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_9 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_9)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_10 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_10)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_11 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_11)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_12 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_12)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_13 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_13)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_14 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_14)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_17 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_17)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_18 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_18)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_19 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_19)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_20 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_20)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_21 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_21)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_22 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_22)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_23 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_23)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_24 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_24)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_25 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_25)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_26 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_26)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_27 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_27)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_28 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_28)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_30 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_30)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_31 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_31)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_33 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_33)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_34 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_34)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_35 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_35)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_36 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_36)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_37 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_37)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_38 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_38)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_39 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_39)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_40 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_40)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_41 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_41)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_42 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_42)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_43 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_43)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_44 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_44)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_45 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_45)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_46 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_46)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_47 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_47)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_48 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_48)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_65 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_65)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_66 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_66)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_68 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_68)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_70 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_70)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_49 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_49)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_50 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_50)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_51 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_51)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_52 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_52)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_53 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_53)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_71 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_71)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_72 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_72)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_73 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_73)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_74 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_74)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_85 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_85)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_87 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_87)); -static_assert(aidl::android::hardware::radio::EutranBands::BAND_88 == - static_cast( - ::android::hardware::radio::V1_5::EutranBands::BAND_88)); - -static_assert(aidl::android::hardware::radio::ApnTypes::NONE == - static_cast( - ::android::hardware::radio::V1_5::ApnTypes::NONE)); -static_assert(aidl::android::hardware::radio::ApnTypes::DEFAULT == - static_cast( - ::android::hardware::radio::V1_5::ApnTypes::DEFAULT)); -static_assert(aidl::android::hardware::radio::ApnTypes::MMS == - static_cast( - ::android::hardware::radio::V1_5::ApnTypes::MMS)); -static_assert(aidl::android::hardware::radio::ApnTypes::SUPL == - static_cast( - ::android::hardware::radio::V1_5::ApnTypes::SUPL)); -static_assert(aidl::android::hardware::radio::ApnTypes::DUN == - static_cast( - ::android::hardware::radio::V1_5::ApnTypes::DUN)); -static_assert(aidl::android::hardware::radio::ApnTypes::HIPRI == - static_cast( - ::android::hardware::radio::V1_5::ApnTypes::HIPRI)); -static_assert(aidl::android::hardware::radio::ApnTypes::FOTA == - static_cast( - ::android::hardware::radio::V1_5::ApnTypes::FOTA)); -static_assert(aidl::android::hardware::radio::ApnTypes::IMS == - static_cast( - ::android::hardware::radio::V1_5::ApnTypes::IMS)); -static_assert(aidl::android::hardware::radio::ApnTypes::CBS == - static_cast( - ::android::hardware::radio::V1_5::ApnTypes::CBS)); -static_assert(aidl::android::hardware::radio::ApnTypes::IA == - static_cast( - ::android::hardware::radio::V1_5::ApnTypes::IA)); -static_assert(aidl::android::hardware::radio::ApnTypes::EMERGENCY == - static_cast( - ::android::hardware::radio::V1_5::ApnTypes::EMERGENCY)); -static_assert(aidl::android::hardware::radio::ApnTypes::ALL == - static_cast( - ::android::hardware::radio::V1_5::ApnTypes::ALL)); -static_assert(aidl::android::hardware::radio::ApnTypes::MCX == - static_cast( - ::android::hardware::radio::V1_5::ApnTypes::MCX)); -static_assert(aidl::android::hardware::radio::ApnTypes::XCAP == - static_cast( - ::android::hardware::radio::V1_5::ApnTypes::XCAP)); - -static_assert(aidl::android::hardware::radio::AddressProperty::NONE == - static_cast( - ::android::hardware::radio::V1_5::AddressProperty::NONE)); -static_assert(aidl::android::hardware::radio::AddressProperty::DEPRECATED == - static_cast( - ::android::hardware::radio::V1_5::AddressProperty::DEPRECATED)); - -static_assert(aidl::android::hardware::radio::Domain::CS == - static_cast( - ::android::hardware::radio::V1_5::Domain::CS)); -static_assert(aidl::android::hardware::radio::Domain::PS == - static_cast( - ::android::hardware::radio::V1_5::Domain::PS)); - -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::CS_SERVICE == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::CS_SERVICE)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::PS_SERVICE == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::PS_SERVICE)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::CS_VOICE == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::CS_VOICE)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::MO_SIGNALLING == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::MO_SIGNALLING)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::MO_DATA == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::MO_DATA)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::CS_FALLBACK == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::CS_FALLBACK)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::MMTEL_VOICE == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::MMTEL_VOICE)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::MMTEL_VIDEO == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::MMTEL_VIDEO)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::EMERGENCY == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::EMERGENCY)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::SMS == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::SMS)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_1 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_1)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_2 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_2)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_3 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_3)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_4 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_4)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_5 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_5)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_6 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_6)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_7 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_7)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_8 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_8)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_9 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_9)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_10 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_10)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_11 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_11)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_12 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_12)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_13 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_13)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_14 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_14)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_15 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_15)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_16 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_16)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_17 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_17)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_18 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_18)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_19 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_19)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_20 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_20)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_21 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_21)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_22 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_22)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_23 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_23)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_24 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_24)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_25 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_25)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_26 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_26)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_27 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_27)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_28 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_28)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_29 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_29)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_30 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_30)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_31 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_31)); -static_assert(aidl::android::hardware::radio::BarringInfoServiceType::OPERATOR_32 == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::ServiceType::OPERATOR_32)); - -static_assert(aidl::android::hardware::radio::BarringInfoBarringType::NONE == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::BarringType::NONE)); -static_assert(aidl::android::hardware::radio::BarringInfoBarringType::CONDITIONAL == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::BarringType::CONDITIONAL)); -static_assert(aidl::android::hardware::radio::BarringInfoBarringType::UNCONDITIONAL == - static_cast( - ::android::hardware::radio::V1_5::BarringInfo::BarringType::UNCONDITIONAL)); - -static_assert(aidl::android::hardware::radio::IndicationFilter::NONE == - static_cast( - ::android::hardware::radio::V1_5::IndicationFilter::NONE)); -static_assert(aidl::android::hardware::radio::IndicationFilter::ALL == - static_cast( - ::android::hardware::radio::V1_5::IndicationFilter::ALL)); -static_assert(aidl::android::hardware::radio::IndicationFilter::SIGNAL_STRENGTH == - static_cast( - ::android::hardware::radio::V1_5::IndicationFilter::SIGNAL_STRENGTH)); -static_assert(aidl::android::hardware::radio::IndicationFilter::FULL_NETWORK_STATE == - static_cast( - ::android::hardware::radio::V1_5::IndicationFilter::FULL_NETWORK_STATE)); -static_assert( - aidl::android::hardware::radio::IndicationFilter::DATA_CALL_DORMANCY_CHANGED == - static_cast( - ::android::hardware::radio::V1_5::IndicationFilter::DATA_CALL_DORMANCY_CHANGED)); -static_assert(aidl::android::hardware::radio::IndicationFilter::LINK_CAPACITY_ESTIMATE == - static_cast( - ::android::hardware::radio::V1_5::IndicationFilter::LINK_CAPACITY_ESTIMATE)); -static_assert(aidl::android::hardware::radio::IndicationFilter::PHYSICAL_CHANNEL_CONFIG == - static_cast( - ::android::hardware::radio::V1_5::IndicationFilter::PHYSICAL_CHANNEL_CONFIG)); -static_assert(aidl::android::hardware::radio::IndicationFilter::REGISTRATION_FAILURE == - static_cast( - ::android::hardware::radio::V1_5::IndicationFilter::REGISTRATION_FAILURE)); -static_assert(aidl::android::hardware::radio::IndicationFilter::BARRING_INFO == - static_cast( - ::android::hardware::radio::V1_5::IndicationFilter::BARRING_INFO)); - -static_assert(aidl::android::hardware::radio::RegistrationFailCause::NONE == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::NONE)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::IMSI_UNKNOWN_IN_HLR == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::IMSI_UNKNOWN_IN_HLR)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::ILLEGAL_MS == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::ILLEGAL_MS)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::IMSI_UNKNOWN_IN_VLR == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::IMSI_UNKNOWN_IN_VLR)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::IMEI_NOT_ACCEPTED == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::IMEI_NOT_ACCEPTED)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::ILLEGAL_ME == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::ILLEGAL_ME)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::GPRS_SERVICES_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - GPRS_SERVICES_NOT_ALLOWED)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause:: - GPRS_AND_NON_GPRS_SERVICES_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - GPRS_AND_NON_GPRS_SERVICES_NOT_ALLOWED)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause:: - MS_IDENTITY_CANNOT_BE_DERIVED_BY_NETWORK == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - MS_IDENTITY_CANNOT_BE_DERIVED_BY_NETWORK)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::IMPLICITLY_DETACHED == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::IMPLICITLY_DETACHED)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::PLMN_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::PLMN_NOT_ALLOWED)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::LOCATION_AREA_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - LOCATION_AREA_NOT_ALLOWED)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::ROAMING_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::ROAMING_NOT_ALLOWED)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::GPRS_SERVICES_NOT_ALLOWED_IN_PLMN == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - GPRS_SERVICES_NOT_ALLOWED_IN_PLMN)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::NO_SUITABLE_CELLS == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::NO_SUITABLE_CELLS)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::MSC_TEMPORARILY_NOT_REACHABLE == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - MSC_TEMPORARILY_NOT_REACHABLE)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::NETWORK_FAILURE == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::NETWORK_FAILURE)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::MAC_FAILURE == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::MAC_FAILURE)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::SYNC_FAILURE == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::SYNC_FAILURE)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::CONGESTION == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::CONGESTION)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::GSM_AUTHENTICATION_UNACCEPTABLE == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - GSM_AUTHENTICATION_UNACCEPTABLE)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::NOT_AUTHORIZED_FOR_THIS_CSG == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - NOT_AUTHORIZED_FOR_THIS_CSG)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause:: - SMS_PROVIDED_BY_GPRS_IN_ROUTING_AREA == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - SMS_PROVIDED_BY_GPRS_IN_ROUTING_AREA)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::SERVICE_OPTION_NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - SERVICE_OPTION_NOT_SUPPORTED)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::SERVICE_OPTION_NOT_SUBSCRIBED == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - SERVICE_OPTION_NOT_SUBSCRIBED)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause:: - SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::CALL_CANNOT_BE_IDENTIFIED == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - CALL_CANNOT_BE_IDENTIFIED)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::NO_PDP_CONTEXT_ACTIVATED == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::NO_PDP_CONTEXT_ACTIVATED)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_1 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_1)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_2 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_2)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_3 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_3)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_4 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_4)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_5 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_5)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_6 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_6)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_7 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_7)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_8 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_8)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_9 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_9)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_10 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_10)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_11 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_11)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_12 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_12)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_13 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_13)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_14 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_14)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_15 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_15)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::RETRY_UPON_ENTRY_INTO_NEW_CELL_16 == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - RETRY_UPON_ENTRY_INTO_NEW_CELL_16)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::SEMANTICALLY_INCORRECT_MESSAGE == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - SEMANTICALLY_INCORRECT_MESSAGE)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::INVALID_MANDATORY_INFORMATION == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - INVALID_MANDATORY_INFORMATION)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause:: - MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause:: - MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause:: - INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED)); -static_assert( - aidl::android::hardware::radio::RegistrationFailCause::CONDITIONAL_IE_ERROR == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause::CONDITIONAL_IE_ERROR)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause:: - MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE)); -static_assert(aidl::android::hardware::radio::RegistrationFailCause::PROTOCOL_ERROR_UNSPECIFIED == - static_cast( - ::android::hardware::radio::V1_5::RegistrationFailCause:: - PROTOCOL_ERROR_UNSPECIFIED)); - -static_assert(aidl::android::hardware::radio::PrlIndicator::NOT_REGISTERED == - static_cast( - ::android::hardware::radio::V1_5::PrlIndicator::NOT_REGISTERED)); -static_assert(aidl::android::hardware::radio::PrlIndicator::NOT_IN_PRL == - static_cast( - ::android::hardware::radio::V1_5::PrlIndicator::NOT_IN_PRL)); -static_assert(aidl::android::hardware::radio::PrlIndicator::IN_PRL == - static_cast( - ::android::hardware::radio::V1_5::PrlIndicator::IN_PRL)); - -static_assert(aidl::android::hardware::radio::PersoSubstate::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::UNKNOWN)); -static_assert(aidl::android::hardware::radio::PersoSubstate::IN_PROGRESS == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::IN_PROGRESS)); -static_assert(aidl::android::hardware::radio::PersoSubstate::READY == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::READY)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_NETWORK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_NETWORK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_NETWORK_SUBSET == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_NETWORK_SUBSET)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_CORPORATE == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_CORPORATE)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SERVICE_PROVIDER == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_SERVICE_PROVIDER)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SIM == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_SIM)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_NETWORK_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_NETWORK_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_NETWORK_SUBSET_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_NETWORK_SUBSET_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_CORPORATE_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_CORPORATE_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SERVICE_PROVIDER_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_SERVICE_PROVIDER_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SIM_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_SIM_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_NETWORK1 == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::RUIM_NETWORK1)); -static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_NETWORK2 == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::RUIM_NETWORK2)); -static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_HRPD == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::RUIM_HRPD)); -static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_CORPORATE == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::RUIM_CORPORATE)); -static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_SERVICE_PROVIDER == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::RUIM_SERVICE_PROVIDER)); -static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_RUIM == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::RUIM_RUIM)); -static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_NETWORK1_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::RUIM_NETWORK1_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_NETWORK2_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::RUIM_NETWORK2_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_HRPD_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::RUIM_HRPD_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_CORPORATE_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::RUIM_CORPORATE_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_SERVICE_PROVIDER_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::RUIM_SERVICE_PROVIDER_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::RUIM_RUIM_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::RUIM_RUIM_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SPN == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_SPN)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SPN_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_SPN_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SP_EHPLMN == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_SP_EHPLMN)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_SP_EHPLMN_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_SP_EHPLMN_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_ICCID == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_ICCID)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_ICCID_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_ICCID_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_IMPI == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_IMPI)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_IMPI_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_IMPI_PUK)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_NS_SP == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_NS_SP)); -static_assert(aidl::android::hardware::radio::PersoSubstate::SIM_NS_SP_PUK == - static_cast( - ::android::hardware::radio::V1_5::PersoSubstate::SIM_NS_SP_PUK)); - -static_assert(aidl::android::hardware::radio::QosFlowIdRange::MIN == - static_cast( - ::android::hardware::radio::V1_6::QosFlowIdRange::MIN)); -static_assert(aidl::android::hardware::radio::QosFlowIdRange::MAX == - static_cast( - ::android::hardware::radio::V1_6::QosFlowIdRange::MAX)); - -static_assert(aidl::android::hardware::radio::QosProtocol::UNSPECIFIED == - static_cast( - ::android::hardware::radio::V1_6::QosProtocol::UNSPECIFIED)); -static_assert(aidl::android::hardware::radio::QosProtocol::TCP == - static_cast( - ::android::hardware::radio::V1_6::QosProtocol::TCP)); -static_assert(aidl::android::hardware::radio::QosProtocol::UDP == - static_cast( - ::android::hardware::radio::V1_6::QosProtocol::UDP)); -static_assert(aidl::android::hardware::radio::QosProtocol::ESP == - static_cast( - ::android::hardware::radio::V1_6::QosProtocol::ESP)); -static_assert(aidl::android::hardware::radio::QosProtocol::AH == - static_cast( - ::android::hardware::radio::V1_6::QosProtocol::AH)); - -static_assert(aidl::android::hardware::radio::QosFilterDirection::DOWNLINK == - static_cast( - ::android::hardware::radio::V1_6::QosFilterDirection::DOWNLINK)); -static_assert(aidl::android::hardware::radio::QosFilterDirection::UPLINK == - static_cast( - ::android::hardware::radio::V1_6::QosFilterDirection::UPLINK)); -static_assert(aidl::android::hardware::radio::QosFilterDirection::BIDIRECTIONAL == - static_cast( - ::android::hardware::radio::V1_6::QosFilterDirection::BIDIRECTIONAL)); - -static_assert(aidl::android::hardware::radio::QosPortRange::MIN == - static_cast( - ::android::hardware::radio::V1_6::QosPortRange::MIN)); -static_assert(aidl::android::hardware::radio::QosPortRange::MAX == - static_cast( - ::android::hardware::radio::V1_6::QosPortRange::MAX)); - -static_assert(aidl::android::hardware::radio::RadioError::NONE == - static_cast( - ::android::hardware::radio::V1_6::RadioError::NONE)); -static_assert(aidl::android::hardware::radio::RadioError::RADIO_NOT_AVAILABLE == - static_cast( - ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE)); -static_assert(aidl::android::hardware::radio::RadioError::GENERIC_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::RadioError::GENERIC_FAILURE)); -static_assert(aidl::android::hardware::radio::RadioError::PASSWORD_INCORRECT == - static_cast( - ::android::hardware::radio::V1_6::RadioError::PASSWORD_INCORRECT)); -static_assert(aidl::android::hardware::radio::RadioError::SIM_PIN2 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::SIM_PIN2)); -static_assert(aidl::android::hardware::radio::RadioError::SIM_PUK2 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::SIM_PUK2)); -static_assert(aidl::android::hardware::radio::RadioError::REQUEST_NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED)); -static_assert(aidl::android::hardware::radio::RadioError::CANCELLED == - static_cast( - ::android::hardware::radio::V1_6::RadioError::CANCELLED)); -static_assert( - aidl::android::hardware::radio::RadioError::OP_NOT_ALLOWED_DURING_VOICE_CALL == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_DURING_VOICE_CALL)); -static_assert( - aidl::android::hardware::radio::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW)); -static_assert(aidl::android::hardware::radio::RadioError::SMS_SEND_FAIL_RETRY == - static_cast( - ::android::hardware::radio::V1_6::RadioError::SMS_SEND_FAIL_RETRY)); -static_assert(aidl::android::hardware::radio::RadioError::SIM_ABSENT == - static_cast( - ::android::hardware::radio::V1_6::RadioError::SIM_ABSENT)); -static_assert(aidl::android::hardware::radio::RadioError::SUBSCRIPTION_NOT_AVAILABLE == - static_cast( - ::android::hardware::radio::V1_6::RadioError::SUBSCRIPTION_NOT_AVAILABLE)); -static_assert(aidl::android::hardware::radio::RadioError::MODE_NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_6::RadioError::MODE_NOT_SUPPORTED)); -static_assert(aidl::android::hardware::radio::RadioError::FDN_CHECK_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::RadioError::FDN_CHECK_FAILURE)); -static_assert(aidl::android::hardware::radio::RadioError::ILLEGAL_SIM_OR_ME == - static_cast( - ::android::hardware::radio::V1_6::RadioError::ILLEGAL_SIM_OR_ME)); -static_assert(aidl::android::hardware::radio::RadioError::MISSING_RESOURCE == - static_cast( - ::android::hardware::radio::V1_6::RadioError::MISSING_RESOURCE)); -static_assert(aidl::android::hardware::radio::RadioError::NO_SUCH_ELEMENT == - static_cast( - ::android::hardware::radio::V1_6::RadioError::NO_SUCH_ELEMENT)); -static_assert(aidl::android::hardware::radio::RadioError::DIAL_MODIFIED_TO_USSD == - static_cast( - ::android::hardware::radio::V1_6::RadioError::DIAL_MODIFIED_TO_USSD)); -static_assert(aidl::android::hardware::radio::RadioError::DIAL_MODIFIED_TO_SS == - static_cast( - ::android::hardware::radio::V1_6::RadioError::DIAL_MODIFIED_TO_SS)); -static_assert(aidl::android::hardware::radio::RadioError::DIAL_MODIFIED_TO_DIAL == - static_cast( - ::android::hardware::radio::V1_6::RadioError::DIAL_MODIFIED_TO_DIAL)); -static_assert(aidl::android::hardware::radio::RadioError::USSD_MODIFIED_TO_DIAL == - static_cast( - ::android::hardware::radio::V1_6::RadioError::USSD_MODIFIED_TO_DIAL)); -static_assert(aidl::android::hardware::radio::RadioError::USSD_MODIFIED_TO_SS == - static_cast( - ::android::hardware::radio::V1_6::RadioError::USSD_MODIFIED_TO_SS)); -static_assert(aidl::android::hardware::radio::RadioError::USSD_MODIFIED_TO_USSD == - static_cast( - ::android::hardware::radio::V1_6::RadioError::USSD_MODIFIED_TO_USSD)); -static_assert(aidl::android::hardware::radio::RadioError::SS_MODIFIED_TO_DIAL == - static_cast( - ::android::hardware::radio::V1_6::RadioError::SS_MODIFIED_TO_DIAL)); -static_assert(aidl::android::hardware::radio::RadioError::SS_MODIFIED_TO_USSD == - static_cast( - ::android::hardware::radio::V1_6::RadioError::SS_MODIFIED_TO_USSD)); -static_assert(aidl::android::hardware::radio::RadioError::SUBSCRIPTION_NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_6::RadioError::SUBSCRIPTION_NOT_SUPPORTED)); -static_assert(aidl::android::hardware::radio::RadioError::SS_MODIFIED_TO_SS == - static_cast( - ::android::hardware::radio::V1_6::RadioError::SS_MODIFIED_TO_SS)); -static_assert(aidl::android::hardware::radio::RadioError::LCE_NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_6::RadioError::LCE_NOT_SUPPORTED)); -static_assert(aidl::android::hardware::radio::RadioError::NO_MEMORY == - static_cast( - ::android::hardware::radio::V1_6::RadioError::NO_MEMORY)); -static_assert(aidl::android::hardware::radio::RadioError::INTERNAL_ERR == - static_cast( - ::android::hardware::radio::V1_6::RadioError::INTERNAL_ERR)); -static_assert(aidl::android::hardware::radio::RadioError::SYSTEM_ERR == - static_cast( - ::android::hardware::radio::V1_6::RadioError::SYSTEM_ERR)); -static_assert(aidl::android::hardware::radio::RadioError::MODEM_ERR == - static_cast( - ::android::hardware::radio::V1_6::RadioError::MODEM_ERR)); -static_assert(aidl::android::hardware::radio::RadioError::INVALID_STATE == - static_cast( - ::android::hardware::radio::V1_6::RadioError::INVALID_STATE)); -static_assert(aidl::android::hardware::radio::RadioError::NO_RESOURCES == - static_cast( - ::android::hardware::radio::V1_6::RadioError::NO_RESOURCES)); -static_assert(aidl::android::hardware::radio::RadioError::SIM_ERR == - static_cast( - ::android::hardware::radio::V1_6::RadioError::SIM_ERR)); -static_assert(aidl::android::hardware::radio::RadioError::INVALID_ARGUMENTS == - static_cast( - ::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS)); -static_assert(aidl::android::hardware::radio::RadioError::INVALID_SIM_STATE == - static_cast( - ::android::hardware::radio::V1_6::RadioError::INVALID_SIM_STATE)); -static_assert(aidl::android::hardware::radio::RadioError::INVALID_MODEM_STATE == - static_cast( - ::android::hardware::radio::V1_6::RadioError::INVALID_MODEM_STATE)); -static_assert(aidl::android::hardware::radio::RadioError::INVALID_CALL_ID == - static_cast( - ::android::hardware::radio::V1_6::RadioError::INVALID_CALL_ID)); -static_assert(aidl::android::hardware::radio::RadioError::NO_SMS_TO_ACK == - static_cast( - ::android::hardware::radio::V1_6::RadioError::NO_SMS_TO_ACK)); -static_assert(aidl::android::hardware::radio::RadioError::NETWORK_ERR == - static_cast( - ::android::hardware::radio::V1_6::RadioError::NETWORK_ERR)); -static_assert(aidl::android::hardware::radio::RadioError::REQUEST_RATE_LIMITED == - static_cast( - ::android::hardware::radio::V1_6::RadioError::REQUEST_RATE_LIMITED)); -static_assert(aidl::android::hardware::radio::RadioError::SIM_BUSY == - static_cast( - ::android::hardware::radio::V1_6::RadioError::SIM_BUSY)); -static_assert(aidl::android::hardware::radio::RadioError::SIM_FULL == - static_cast( - ::android::hardware::radio::V1_6::RadioError::SIM_FULL)); -static_assert(aidl::android::hardware::radio::RadioError::NETWORK_REJECT == - static_cast( - ::android::hardware::radio::V1_6::RadioError::NETWORK_REJECT)); -static_assert(aidl::android::hardware::radio::RadioError::OPERATION_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OPERATION_NOT_ALLOWED)); -static_assert(aidl::android::hardware::radio::RadioError::EMPTY_RECORD == - static_cast( - ::android::hardware::radio::V1_6::RadioError::EMPTY_RECORD)); -static_assert(aidl::android::hardware::radio::RadioError::INVALID_SMS_FORMAT == - static_cast( - ::android::hardware::radio::V1_6::RadioError::INVALID_SMS_FORMAT)); -static_assert(aidl::android::hardware::radio::RadioError::ENCODING_ERR == - static_cast( - ::android::hardware::radio::V1_6::RadioError::ENCODING_ERR)); -static_assert(aidl::android::hardware::radio::RadioError::INVALID_SMSC_ADDRESS == - static_cast( - ::android::hardware::radio::V1_6::RadioError::INVALID_SMSC_ADDRESS)); -static_assert(aidl::android::hardware::radio::RadioError::NO_SUCH_ENTRY == - static_cast( - ::android::hardware::radio::V1_6::RadioError::NO_SUCH_ENTRY)); -static_assert(aidl::android::hardware::radio::RadioError::NETWORK_NOT_READY == - static_cast( - ::android::hardware::radio::V1_6::RadioError::NETWORK_NOT_READY)); -static_assert(aidl::android::hardware::radio::RadioError::NOT_PROVISIONED == - static_cast( - ::android::hardware::radio::V1_6::RadioError::NOT_PROVISIONED)); -static_assert(aidl::android::hardware::radio::RadioError::NO_SUBSCRIPTION == - static_cast( - ::android::hardware::radio::V1_6::RadioError::NO_SUBSCRIPTION)); -static_assert(aidl::android::hardware::radio::RadioError::NO_NETWORK_FOUND == - static_cast( - ::android::hardware::radio::V1_6::RadioError::NO_NETWORK_FOUND)); -static_assert(aidl::android::hardware::radio::RadioError::DEVICE_IN_USE == - static_cast( - ::android::hardware::radio::V1_6::RadioError::DEVICE_IN_USE)); -static_assert(aidl::android::hardware::radio::RadioError::ABORTED == - static_cast( - ::android::hardware::radio::V1_6::RadioError::ABORTED)); -static_assert(aidl::android::hardware::radio::RadioError::INVALID_RESPONSE == - static_cast( - ::android::hardware::radio::V1_6::RadioError::INVALID_RESPONSE)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_1 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_1)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_2 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_2)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_3 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_3)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_4 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_4)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_5 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_5)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_6 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_6)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_7 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_7)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_8 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_8)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_9 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_9)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_10 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_10)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_11 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_11)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_12 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_12)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_13 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_13)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_14 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_14)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_15 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_15)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_16 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_16)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_17 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_17)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_18 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_18)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_19 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_19)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_20 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_20)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_21 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_21)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_22 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_22)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_23 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_23)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_24 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_24)); -static_assert(aidl::android::hardware::radio::RadioError::OEM_ERROR_25 == - static_cast( - ::android::hardware::radio::V1_6::RadioError::OEM_ERROR_25)); -static_assert(aidl::android::hardware::radio::RadioError::SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::RadioError:: - SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED)); -static_assert(aidl::android::hardware::radio::RadioError::ACCESS_BARRED == - static_cast( - ::android::hardware::radio::V1_6::RadioError::ACCESS_BARRED)); -static_assert(aidl::android::hardware::radio::RadioError::BLOCKED_DUE_TO_CALL == - static_cast( - ::android::hardware::radio::V1_6::RadioError::BLOCKED_DUE_TO_CALL)); -static_assert(aidl::android::hardware::radio::RadioError::RF_HARDWARE_ISSUE == - static_cast( - ::android::hardware::radio::V1_6::RadioError::RF_HARDWARE_ISSUE)); -static_assert(aidl::android::hardware::radio::RadioError::NO_RF_CALIBRATION_INFO == - static_cast( - ::android::hardware::radio::V1_6::RadioError::NO_RF_CALIBRATION_INFO)); - -static_assert(aidl::android::hardware::radio::HandoverFailureMode::LEGACY == - static_cast( - ::android::hardware::radio::V1_6::HandoverFailureMode::LEGACY)); -static_assert(aidl::android::hardware::radio::HandoverFailureMode::DO_FALLBACK == - static_cast( - ::android::hardware::radio::V1_6::HandoverFailureMode::DO_FALLBACK)); -static_assert( - aidl::android::hardware::radio::HandoverFailureMode::NO_FALLBACK_RETRY_HANDOVER == - static_cast( - ::android::hardware::radio::V1_6::HandoverFailureMode::NO_FALLBACK_RETRY_HANDOVER)); -static_assert(aidl::android::hardware::radio::HandoverFailureMode::NO_FALLBACK_RETRY_SETUP_NORMAL == - static_cast( - ::android::hardware::radio::V1_6::HandoverFailureMode:: - NO_FALLBACK_RETRY_SETUP_NORMAL)); - -static_assert(aidl::android::hardware::radio::NrDualConnectivityState::ENABLE == - static_cast( - ::android::hardware::radio::V1_6::NrDualConnectivityState::ENABLE)); -static_assert(aidl::android::hardware::radio::NrDualConnectivityState::DISABLE == - static_cast( - ::android::hardware::radio::V1_6::NrDualConnectivityState::DISABLE)); -static_assert( - aidl::android::hardware::radio::NrDualConnectivityState::DISABLE_IMMEDIATE == - static_cast( - ::android::hardware::radio::V1_6::NrDualConnectivityState::DISABLE_IMMEDIATE)); - -static_assert(aidl::android::hardware::radio::DataThrottlingAction::NO_DATA_THROTTLING == - static_cast( - ::android::hardware::radio::V1_6::DataThrottlingAction::NO_DATA_THROTTLING)); -static_assert(aidl::android::hardware::radio::DataThrottlingAction::THROTTLE_SECONDARY_CARRIER == - static_cast( - ::android::hardware::radio::V1_6::DataThrottlingAction:: - THROTTLE_SECONDARY_CARRIER)); -static_assert( - aidl::android::hardware::radio::DataThrottlingAction::THROTTLE_ANCHOR_CARRIER == - static_cast( - ::android::hardware::radio::V1_6::DataThrottlingAction::THROTTLE_ANCHOR_CARRIER)); -static_assert(aidl::android::hardware::radio::DataThrottlingAction::HOLD == - static_cast( - ::android::hardware::radio::V1_6::DataThrottlingAction::HOLD)); - -static_assert(aidl::android::hardware::radio::VopsIndicator::VOPS_NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_6::VopsIndicator::VOPS_NOT_SUPPORTED)); -static_assert(aidl::android::hardware::radio::VopsIndicator::VOPS_OVER_3GPP == - static_cast( - ::android::hardware::radio::V1_6::VopsIndicator::VOPS_OVER_3GPP)); -static_assert(aidl::android::hardware::radio::VopsIndicator::VOPS_OVER_NON_3GPP == - static_cast( - ::android::hardware::radio::V1_6::VopsIndicator::VOPS_OVER_NON_3GPP)); - -static_assert(aidl::android::hardware::radio::EmcIndicator::EMC_NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_6::EmcIndicator::EMC_NOT_SUPPORTED)); -static_assert(aidl::android::hardware::radio::EmcIndicator::EMC_NR_CONNECTED_TO_5GCN == - static_cast( - ::android::hardware::radio::V1_6::EmcIndicator::EMC_NR_CONNECTED_TO_5GCN)); -static_assert(aidl::android::hardware::radio::EmcIndicator::EMC_EUTRA_CONNECTED_TO_5GCN == - static_cast( - ::android::hardware::radio::V1_6::EmcIndicator::EMC_EUTRA_CONNECTED_TO_5GCN)); -static_assert(aidl::android::hardware::radio::EmcIndicator::EMC_BOTH_NR_EUTRA_CONNECTED_TO_5GCN == - static_cast( - ::android::hardware::radio::V1_6::EmcIndicator:: - EMC_BOTH_NR_EUTRA_CONNECTED_TO_5GCN)); - -static_assert(aidl::android::hardware::radio::EmfIndicator::EMF_NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_6::EmfIndicator::EMF_NOT_SUPPORTED)); -static_assert(aidl::android::hardware::radio::EmfIndicator::EMF_NR_CONNECTED_TO_5GCN == - static_cast( - ::android::hardware::radio::V1_6::EmfIndicator::EMF_NR_CONNECTED_TO_5GCN)); -static_assert(aidl::android::hardware::radio::EmfIndicator::EMF_EUTRA_CONNECTED_TO_5GCN == - static_cast( - ::android::hardware::radio::V1_6::EmfIndicator::EMF_EUTRA_CONNECTED_TO_5GCN)); -static_assert(aidl::android::hardware::radio::EmfIndicator::EMF_BOTH_NR_EUTRA_CONNECTED_TO_5GCN == - static_cast( - ::android::hardware::radio::V1_6::EmfIndicator:: - EMF_BOTH_NR_EUTRA_CONNECTED_TO_5GCN)); - -static_assert(aidl::android::hardware::radio::NgranBands::BAND_1 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_1)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_2 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_2)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_3 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_3)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_5 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_5)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_7 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_7)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_8 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_8)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_12 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_12)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_14 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_14)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_18 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_18)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_20 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_20)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_25 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_25)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_28 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_28)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_29 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_29)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_30 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_30)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_34 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_34)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_38 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_38)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_39 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_39)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_40 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_40)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_41 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_41)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_48 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_48)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_50 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_50)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_51 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_51)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_65 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_65)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_66 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_66)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_70 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_70)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_71 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_71)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_74 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_74)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_75 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_75)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_76 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_76)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_77 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_77)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_78 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_78)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_79 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_79)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_80 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_80)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_81 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_81)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_82 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_82)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_83 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_83)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_84 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_84)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_86 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_86)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_89 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_89)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_90 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_90)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_91 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_91)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_92 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_92)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_93 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_93)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_94 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_94)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_95 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_95)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_257 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_257)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_258 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_258)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_260 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_260)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_261 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_261)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_26 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_26)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_46 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_46)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_53 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_53)); -static_assert(aidl::android::hardware::radio::NgranBands::BAND_96 == - static_cast( - ::android::hardware::radio::V1_6::NgranBands::BAND_96)); - -static_assert(aidl::android::hardware::radio::SliceServiceType::NONE == - static_cast( - ::android::hardware::radio::V1_6::SliceServiceType::NONE)); -static_assert(aidl::android::hardware::radio::SliceServiceType::EMBB == - static_cast( - ::android::hardware::radio::V1_6::SliceServiceType::EMBB)); -static_assert(aidl::android::hardware::radio::SliceServiceType::URLLC == - static_cast( - ::android::hardware::radio::V1_6::SliceServiceType::URLLC)); -static_assert(aidl::android::hardware::radio::SliceServiceType::MIOT == - static_cast( - ::android::hardware::radio::V1_6::SliceServiceType::MIOT)); - -static_assert(aidl::android::hardware::radio::DataCallFailCause::NONE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NONE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OPERATOR_BARRED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OPERATOR_BARRED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NAS_SIGNALLING == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NAS_SIGNALLING)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::INSUFFICIENT_RESOURCES == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::INSUFFICIENT_RESOURCES)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MISSING_UNKNOWN_APN == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MISSING_UKNOWN_APN)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::UNKNOWN_PDP_ADDRESS_TYPE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::UNKNOWN_PDP_ADDRESS_TYPE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::USER_AUTHENTICATION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::USER_AUTHENTICATION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ACTIVATION_REJECT_GGSN == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ACTIVATION_REJECT_GGSN)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ACTIVATION_REJECT_UNSPECIFIED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - ACTIVATION_REJECT_UNSPECIFIED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::SERVICE_OPTION_NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::SERVICE_OPTION_NOT_SUPPORTED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::SERVICE_OPTION_NOT_SUBSCRIBED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - SERVICE_OPTION_NOT_SUBSCRIBED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::SERVICE_OPTION_OUT_OF_ORDER == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::SERVICE_OPTION_OUT_OF_ORDER)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NSAPI_IN_USE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NSAPI_IN_USE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::REGULAR_DEACTIVATION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::REGULAR_DEACTIVATION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::QOS_NOT_ACCEPTED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::QOS_NOT_ACCEPTED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NETWORK_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NETWORK_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::UMTS_REACTIVATION_REQ == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::UMTS_REACTIVATION_REQ)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::FEATURE_NOT_SUPP == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::FEATURE_NOT_SUPP)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::TFT_SEMANTIC_ERROR == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::TFT_SEMANTIC_ERROR)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::TFT_SYTAX_ERROR == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::TFT_SYTAX_ERROR)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::UNKNOWN_PDP_CONTEXT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::UNKNOWN_PDP_CONTEXT)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::FILTER_SEMANTIC_ERROR == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::FILTER_SEMANTIC_ERROR)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::FILTER_SYTAX_ERROR == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::FILTER_SYTAX_ERROR)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PDP_WITHOUT_ACTIVE_TFT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDP_WITHOUT_ACTIVE_TFT)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ONLY_IPV4_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ONLY_IPV4_ALLOWED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ONLY_IPV6_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ONLY_IPV6_ALLOWED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::ONLY_SINGLE_BEARER_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ONLY_SINGLE_BEARER_ALLOWED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ESM_INFO_NOT_RECEIVED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ESM_INFO_NOT_RECEIVED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::PDN_CONN_DOES_NOT_EXIST == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDN_CONN_DOES_NOT_EXIST)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MAX_ACTIVE_PDP_CONTEXT_REACHED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MAX_ACTIVE_PDP_CONTEXT_REACHED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::UNSUPPORTED_APN_IN_CURRENT_PLMN == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - UNSUPPORTED_APN_IN_CURRENT_PLMN)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_TRANSACTION_ID == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_TRANSACTION_ID)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MESSAGE_INCORRECT_SEMANTIC == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MESSAGE_INCORRECT_SEMANTIC)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_MANDATORY_INFO == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_MANDATORY_INFO)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MESSAGE_TYPE_UNSUPPORTED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MESSAGE_TYPE_UNSUPPORTED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MSG_TYPE_NONCOMPATIBLE_STATE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MSG_TYPE_NONCOMPATIBLE_STATE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::UNKNOWN_INFO_ELEMENT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::UNKNOWN_INFO_ELEMENT)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::CONDITIONAL_IE_ERROR == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::CONDITIONAL_IE_ERROR)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PROTOCOL_ERRORS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PROTOCOL_ERRORS)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::APN_TYPE_CONFLICT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::APN_TYPE_CONFLICT)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_PCSCF_ADDR == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_PCSCF_ADDR)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EMM_ACCESS_BARRED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::EMM_ACCESS_BARRED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EMERGENCY_IFACE_ONLY == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::EMERGENCY_IFACE_ONLY)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::IFACE_MISMATCH == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::IFACE_MISMATCH)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::COMPANION_IFACE_IN_USE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::COMPANION_IFACE_IN_USE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::IP_ADDRESS_MISMATCH == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::IP_ADDRESS_MISMATCH)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::IFACE_AND_POL_FAMILY_MISMATCH == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - IFACE_AND_POL_FAMILY_MISMATCH)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EMM_ACCESS_BARRED_INFINITE_RETRY == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - EMM_ACCESS_BARRED_INFINITE_RETRY)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::AUTH_FAILURE_ON_EMERGENCY_CALL == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - AUTH_FAILURE_ON_EMERGENCY_CALL)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_1 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_1)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_2 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_2)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_3 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_3)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_4 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_4)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_5 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_5)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_6 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_6)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_7 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_7)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_8 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_8)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_9 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_9)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_10 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_10)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_11 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_11)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_12 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_12)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_13 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_13)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_14 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_14)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::OEM_DCFAILCAUSE_15 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OEM_DCFAILCAUSE_15)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::VOICE_REGISTRATION_FAIL == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::VOICE_REGISTRATION_FAIL)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::DATA_REGISTRATION_FAIL == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::DATA_REGISTRATION_FAIL)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::SIGNAL_LOST == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::SIGNAL_LOST)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::PREF_RADIO_TECH_CHANGED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PREF_RADIO_TECH_CHANGED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::RADIO_POWER_OFF == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::RADIO_POWER_OFF)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::TETHERED_CALL_ACTIVE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::TETHERED_CALL_ACTIVE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ERROR_UNSPECIFIED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ERROR_UNSPECIFIED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::LLC_SNDCP == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::LLC_SNDCP)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::ACTIVATION_REJECTED_BCM_VIOLATION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - ACTIVATION_REJECTED_BCM_VIOLATION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - COLLISION_WITH_NETWORK_INITIATED_REQUEST == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - COLLISION_WITH_NETWORK_INITIATED_REQUEST)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ONLY_IPV4V6_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ONLY_IPV4V6_ALLOWED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ONLY_NON_IP_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ONLY_NON_IP_ALLOWED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::UNSUPPORTED_QCI_VALUE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::UNSUPPORTED_QCI_VALUE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::BEARER_HANDLING_NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - BEARER_HANDLING_NOT_SUPPORTED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_DNS_ADDR == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_DNS_ADDR)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::INVALID_PCSCF_OR_DNS_ADDRESS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_PCSCF_OR_DNS_ADDRESS)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::CALL_PREEMPT_BY_EMERGENCY_APN == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - CALL_PREEMPT_BY_EMERGENCY_APN)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::UE_INITIATED_DETACH_OR_DISCONNECT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - UE_INITIATED_DETACH_OR_DISCONNECT)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_FA_REASON_UNSPECIFIED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_REASON_UNSPECIFIED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_FA_ADMIN_PROHIBITED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_ADMIN_PROHIBITED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_FA_INSUFFICIENT_RESOURCES == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_FA_INSUFFICIENT_RESOURCES)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_FA_REQUESTED_LIFETIME_TOO_LONG == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_FA_REQUESTED_LIFETIME_TOO_LONG)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_FA_MALFORMED_REQUEST == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_MALFORMED_REQUEST)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_FA_MALFORMED_REPLY == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_MALFORMED_REPLY)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_FA_ENCAPSULATION_UNAVAILABLE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_FA_ENCAPSULATION_UNAVAILABLE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_FA_REVERSE_TUNNEL_UNAVAILABLE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_FA_REVERSE_TUNNEL_UNAVAILABLE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_FA_REVERSE_TUNNEL_IS_MANDATORY == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_FA_REVERSE_TUNNEL_IS_MANDATORY)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_FA_MISSING_NAI == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_MISSING_NAI)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_FA_MISSING_HOME_AGENT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_MISSING_HOME_AGENT)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_FA_MISSING_HOME_ADDRESS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_MISSING_HOME_ADDRESS)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_FA_UNKNOWN_CHALLENGE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_UNKNOWN_CHALLENGE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_FA_MISSING_CHALLENGE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_MISSING_CHALLENGE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_FA_STALE_CHALLENGE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MIP_FA_STALE_CHALLENGE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_HA_REASON_UNSPECIFIED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MIP_HA_REASON_UNSPECIFIED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_HA_ADMIN_PROHIBITED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MIP_HA_ADMIN_PROHIBITED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_HA_INSUFFICIENT_RESOURCES == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_HA_INSUFFICIENT_RESOURCES)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_HA_REGISTRATION_ID_MISMATCH == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_HA_REGISTRATION_ID_MISMATCH)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_HA_MALFORMED_REQUEST == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MIP_HA_MALFORMED_REQUEST)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_HA_REVERSE_TUNNEL_UNAVAILABLE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_HA_REVERSE_TUNNEL_UNAVAILABLE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MIP_HA_REVERSE_TUNNEL_IS_MANDATORY == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_HA_REVERSE_TUNNEL_IS_MANDATORY)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_HA_ENCAPSULATION_UNAVAILABLE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MIP_HA_ENCAPSULATION_UNAVAILABLE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::CLOSE_IN_PROGRESS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::CLOSE_IN_PROGRESS)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NETWORK_INITIATED_TERMINATION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - NETWORK_INITIATED_TERMINATION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MODEM_APP_PREEMPTED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MODEM_APP_PREEMPTED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::PDN_IPV4_CALL_DISALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDN_IPV4_CALL_DISALLOWED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::PDN_IPV4_CALL_THROTTLED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDN_IPV4_CALL_THROTTLED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::PDN_IPV6_CALL_DISALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDN_IPV6_CALL_DISALLOWED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::PDN_IPV6_CALL_THROTTLED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDN_IPV6_CALL_THROTTLED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MODEM_RESTART == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MODEM_RESTART)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PDP_PPP_NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDP_PPP_NOT_SUPPORTED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::UNPREFERRED_RAT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::UNPREFERRED_RAT)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PHYSICAL_LINK_CLOSE_IN_PROGRESS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - PHYSICAL_LINK_CLOSE_IN_PROGRESS)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::APN_PENDING_HANDOVER == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::APN_PENDING_HANDOVER)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::PROFILE_BEARER_INCOMPATIBLE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PROFILE_BEARER_INCOMPATIBLE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::SIM_CARD_CHANGED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::SIM_CARD_CHANGED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::LOW_POWER_MODE_OR_POWERING_DOWN == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - LOW_POWER_MODE_OR_POWERING_DOWN)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::APN_DISABLED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::APN_DISABLED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MAX_PPP_INACTIVITY_TIMER_EXPIRED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MAX_PPP_INACTIVITY_TIMER_EXPIRED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::IPV6_ADDRESS_TRANSFER_FAILED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::IPV6_ADDRESS_TRANSFER_FAILED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::TRAT_SWAP_FAILED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::TRAT_SWAP_FAILED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EHRPD_TO_HRPD_FALLBACK == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::EHRPD_TO_HRPD_FALLBACK)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MIP_CONFIG_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MIP_CONFIG_FAILURE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::PDN_INACTIVITY_TIMER_EXPIRED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDN_INACTIVITY_TIMER_EXPIRED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MAX_IPV4_CONNECTIONS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MAX_IPV4_CONNECTIONS)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MAX_IPV6_CONNECTIONS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MAX_IPV6_CONNECTIONS)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::APN_MISMATCH == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::APN_MISMATCH)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::IP_VERSION_MISMATCH == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::IP_VERSION_MISMATCH)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::DUN_CALL_DISALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::DUN_CALL_DISALLOWED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::INTERNAL_EPC_NONEPC_TRANSITION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - INTERNAL_EPC_NONEPC_TRANSITION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::INTERFACE_IN_USE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::INTERFACE_IN_USE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::APN_DISALLOWED_ON_ROAMING == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::APN_DISALLOWED_ON_ROAMING)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::APN_PARAMETERS_CHANGED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::APN_PARAMETERS_CHANGED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NULL_APN_DISALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NULL_APN_DISALLOWED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::THERMAL_MITIGATION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::THERMAL_MITIGATION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::DATA_SETTINGS_DISABLED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::DATA_SETTINGS_DISABLED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::DATA_ROAMING_SETTINGS_DISABLED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - DATA_ROAMING_SETTINGS_DISABLED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::DDS_SWITCHED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::DDS_SWITCHED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::FORBIDDEN_APN_NAME == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::FORBIDDEN_APN_NAME)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::DDS_SWITCH_IN_PROGRESS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::DDS_SWITCH_IN_PROGRESS)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::CALL_DISALLOWED_IN_ROAMING == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::CALL_DISALLOWED_IN_ROAMING)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NON_IP_NOT_SUPPORTED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NON_IP_NOT_SUPPORTED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::PDN_NON_IP_CALL_THROTTLED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDN_NON_IP_CALL_THROTTLED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::PDN_NON_IP_CALL_DISALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDN_NON_IP_CALL_DISALLOWED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::CDMA_LOCK == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::CDMA_LOCK)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::CDMA_INTERCEPT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::CDMA_INTERCEPT)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::CDMA_REORDER == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::CDMA_REORDER)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::CDMA_RELEASE_DUE_TO_SO_REJECTION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - CDMA_RELEASE_DUE_TO_SO_REJECTION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::CDMA_INCOMING_CALL == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::CDMA_INCOMING_CALL)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::CDMA_ALERT_STOP == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::CDMA_ALERT_STOP)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::CHANNEL_ACQUISITION_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::CHANNEL_ACQUISITION_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MAX_ACCESS_PROBE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MAX_ACCESS_PROBE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_RESPONSE_FROM_BASE_STATION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - NO_RESPONSE_FROM_BASE_STATION)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::REJECTED_BY_BASE_STATION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::REJECTED_BY_BASE_STATION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::CONCURRENT_SERVICES_INCOMPATIBLE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - CONCURRENT_SERVICES_INCOMPATIBLE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_CDMA_SERVICE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NO_CDMA_SERVICE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::RUIM_NOT_PRESENT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::RUIM_NOT_PRESENT)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::CDMA_RETRY_ORDER == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::CDMA_RETRY_ORDER)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ACCESS_BLOCK == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ACCESS_BLOCK)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ACCESS_BLOCK_ALL == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ACCESS_BLOCK_ALL)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::IS707B_MAX_ACCESS_PROBES == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::IS707B_MAX_ACCESS_PROBES)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::THERMAL_EMERGENCY == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::THERMAL_EMERGENCY)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::CONCURRENT_SERVICES_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - CONCURRENT_SERVICES_NOT_ALLOWED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::INCOMING_CALL_REJECTED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::INCOMING_CALL_REJECTED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_SERVICE_ON_GATEWAY == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NO_SERVICE_ON_GATEWAY)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_GPRS_CONTEXT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NO_GPRS_CONTEXT)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ILLEGAL_MS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ILLEGAL_MS)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ILLEGAL_ME == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ILLEGAL_ME)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::GPRS_SERVICES_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::GPRS_SERVICES_NOT_ALLOWED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::IMPLICITLY_DETACHED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::IMPLICITLY_DETACHED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PLMN_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PLMN_NOT_ALLOWED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::LOCATION_AREA_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::LOCATION_AREA_NOT_ALLOWED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PDP_DUPLICATE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDP_DUPLICATE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::UE_RAT_CHANGE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::UE_RAT_CHANGE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::CONGESTION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::CONGESTION)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::NO_PDP_CONTEXT_ACTIVATED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NO_PDP_CONTEXT_ACTIVATED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::ACCESS_CLASS_DSAC_REJECTION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ACCESS_CLASS_DSAC_REJECTION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PDP_ACTIVATE_MAX_RETRY_FAILED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - PDP_ACTIVATE_MAX_RETRY_FAILED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::RADIO_ACCESS_BEARER_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::RADIO_ACCESS_BEARER_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ESM_UNKNOWN_EPS_BEARER_CONTEXT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - ESM_UNKNOWN_EPS_BEARER_CONTEXT)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::DRB_RELEASED_BY_RRC == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::DRB_RELEASED_BY_RRC)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::CONNECTION_RELEASED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::CONNECTION_RELEASED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EMM_DETACHED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::EMM_DETACHED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EMM_ATTACH_FAILED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::EMM_ATTACH_FAILED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EMM_ATTACH_STARTED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::EMM_ATTACH_STARTED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::LTE_NAS_SERVICE_REQUEST_FAILED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - LTE_NAS_SERVICE_REQUEST_FAILED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::DUPLICATE_BEARER_ID == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::DUPLICATE_BEARER_ID)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::ESM_COLLISION_SCENARIOS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ESM_COLLISION_SCENARIOS)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ESM_BAD_OTA_MESSAGE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ESM_BAD_OTA_MESSAGE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::DS_EXPLICIT_DEACTIVATION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::DS_EXPLICIT_DEACTIVATION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ESM_LOCAL_CAUSE_NONE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ESM_LOCAL_CAUSE_NONE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::LTE_THROTTLING_NOT_REQUIRED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::LTE_THROTTLING_NOT_REQUIRED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::ACCESS_CONTROL_LIST_CHECK_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - ACCESS_CONTROL_LIST_CHECK_FAILURE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::SERVICE_NOT_ALLOWED_ON_PLMN == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::SERVICE_NOT_ALLOWED_ON_PLMN)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EMM_T3417_EXPIRED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::EMM_T3417_EXPIRED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EMM_T3417_EXT_EXPIRED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::EMM_T3417_EXT_EXPIRED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::RRC_UPLINK_DATA_TRANSMISSION_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_UPLINK_DATA_TRANSMISSION_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_UPLINK_CONNECTION_RELEASE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_UPLINK_CONNECTION_RELEASE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_UPLINK_RADIO_LINK_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_UPLINK_RADIO_LINK_FAILURE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::RRC_UPLINK_ERROR_REQUEST_FROM_NAS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_UPLINK_ERROR_REQUEST_FROM_NAS)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_ACCESS_STRATUM_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_ACCESS_STRATUM_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_ACCESS_BARRED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::RRC_CONNECTION_ACCESS_BARRED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_CELL_RESELECTION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_CELL_RESELECTION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_CONFIG_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_CONFIG_FAILURE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_TIMER_EXPIRED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::RRC_CONNECTION_TIMER_EXPIRED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_LINK_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::RRC_CONNECTION_LINK_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_CELL_NOT_CAMPED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_CELL_NOT_CAMPED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_REJECT_BY_NETWORK == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_REJECT_BY_NETWORK)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_NORMAL_RELEASE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_NORMAL_RELEASE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_RADIO_LINK_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_RADIO_LINK_FAILURE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_REESTABLISHMENT_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_REESTABLISHMENT_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_ABORT_REQUEST == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::RRC_CONNECTION_ABORT_REQUEST)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ESM_PROCEDURE_TIME_OUT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ESM_PROCEDURE_TIME_OUT)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_CONNECTION_ID == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_CONNECTION_ID)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MAXIMIUM_NSAPIS_EXCEEDED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MAXIMIUM_NSAPIS_EXCEEDED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_PRIMARY_NSAPI == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_PRIMARY_NSAPI)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::CANNOT_ENCODE_OTA_MESSAGE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::CANNOT_ENCODE_OTA_MESSAGE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::RADIO_ACCESS_BEARER_SETUP_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RADIO_ACCESS_BEARER_SETUP_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PDP_ESTABLISH_TIMEOUT_EXPIRED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - PDP_ESTABLISH_TIMEOUT_EXPIRED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::PDP_MODIFY_TIMEOUT_EXPIRED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDP_MODIFY_TIMEOUT_EXPIRED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::PDP_INACTIVE_TIMEOUT_EXPIRED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDP_INACTIVE_TIMEOUT_EXPIRED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PDP_LOWERLAYER_ERROR == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDP_LOWERLAYER_ERROR)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PDP_MODIFY_COLLISION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PDP_MODIFY_COLLISION)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NAS_REQUEST_REJECTED_BY_NETWORK == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - NAS_REQUEST_REJECTED_BY_NETWORK)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_INVALID_REQUEST == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_INVALID_REQUEST)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - RRC_CONNECTION_TRACKING_AREA_ID_CHANGED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_TRACKING_AREA_ID_CHANGED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_RF_UNAVAILABLE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_RF_UNAVAILABLE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::RRC_CONNECTION_ABORTED_AFTER_HANDOVER == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_ABORTED_AFTER_HANDOVER)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::IMEI_NOT_ACCEPTED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::IMEI_NOT_ACCEPTED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EPS_SERVICES_NOT_ALLOWED_IN_PLMN == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - EPS_SERVICES_NOT_ALLOWED_IN_PLMN)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MSC_TEMPORARILY_NOT_REACHABLE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MSC_TEMPORARILY_NOT_REACHABLE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::CS_DOMAIN_NOT_AVAILABLE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::CS_DOMAIN_NOT_AVAILABLE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::ESM_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ESM_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MAC_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MAC_FAILURE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::SYNCHRONIZATION_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::SYNCHRONIZATION_FAILURE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::UE_SECURITY_CAPABILITIES_MISMATCH == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - UE_SECURITY_CAPABILITIES_MISMATCH)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::SECURITY_MODE_REJECTED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::SECURITY_MODE_REJECTED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::UNACCEPTABLE_NON_EPS_AUTHENTICATION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - UNACCEPTABLE_NON_EPS_AUTHENTICATION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_EPS_BEARER_CONTEXT_ACTIVATED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - NO_EPS_BEARER_CONTEXT_ACTIVATED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_EMM_STATE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_EMM_STATE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NAS_LAYER_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NAS_LAYER_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::MULTIPLE_PDP_CALL_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - MULTIPLE_PDP_CALL_NOT_ALLOWED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EMBMS_NOT_ENABLED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::EMBMS_NOT_ENABLED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::IRAT_HANDOVER_FAILED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::IRAT_HANDOVER_FAILED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::EMBMS_REGULAR_DEACTIVATION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::EMBMS_REGULAR_DEACTIVATION)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::TEST_LOOPBACK_REGULAR_DEACTIVATION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - TEST_LOOPBACK_REGULAR_DEACTIVATION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::LOWER_LAYER_REGISTRATION_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - LOWER_LAYER_REGISTRATION_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::DATA_PLAN_EXPIRED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::DATA_PLAN_EXPIRED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::UMTS_HANDOVER_TO_IWLAN == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::UMTS_HANDOVER_TO_IWLAN)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY)); -static_assert(aidl::android::hardware::radio::DataCallFailCause:: - EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EVDO_HDR_CHANGED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::EVDO_HDR_CHANGED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EVDO_HDR_EXITED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::EVDO_HDR_EXITED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EVDO_HDR_NO_SESSION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::EVDO_HDR_NO_SESSION)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::EVDO_HDR_CONNECTION_SETUP_TIMEOUT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - EVDO_HDR_CONNECTION_SETUP_TIMEOUT)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::FAILED_TO_ACQUIRE_COLOCATED_HDR == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - FAILED_TO_ACQUIRE_COLOCATED_HDR)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::OTASP_COMMIT_IN_PROGRESS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::OTASP_COMMIT_IN_PROGRESS)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_HYBRID_HDR_SERVICE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NO_HYBRID_HDR_SERVICE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::HDR_NO_LOCK_GRANTED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::HDR_NO_LOCK_GRANTED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::DBM_OR_SMS_IN_PROGRESS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::DBM_OR_SMS_IN_PROGRESS)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::HDR_FADE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::HDR_FADE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::HDR_ACCESS_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::HDR_ACCESS_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::UNSUPPORTED_1X_PREV == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::UNSUPPORTED_1X_PREV)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::LOCAL_END == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::LOCAL_END)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_SERVICE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NO_SERVICE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::FADE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::FADE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NORMAL_RELEASE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NORMAL_RELEASE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::ACCESS_ATTEMPT_ALREADY_IN_PROGRESS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - ACCESS_ATTEMPT_ALREADY_IN_PROGRESS)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::REDIRECTION_OR_HANDOFF_IN_PROGRESS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - REDIRECTION_OR_HANDOFF_IN_PROGRESS)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::EMERGENCY_MODE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::EMERGENCY_MODE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PHONE_IN_USE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PHONE_IN_USE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_MODE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_MODE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::INVALID_SIM_STATE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::INVALID_SIM_STATE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::NO_COLLOCATED_HDR == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::NO_COLLOCATED_HDR)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::UE_IS_ENTERING_POWERSAVE_MODE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - UE_IS_ENTERING_POWERSAVE_MODE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::DUAL_SWITCH == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::DUAL_SWITCH)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PPP_TIMEOUT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PPP_TIMEOUT)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PPP_AUTH_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PPP_AUTH_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PPP_OPTION_MISMATCH == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PPP_OPTION_MISMATCH)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PPP_PAP_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PPP_PAP_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PPP_CHAP_FAILURE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PPP_CHAP_FAILURE)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::PPP_CLOSE_IN_PROGRESS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::PPP_CLOSE_IN_PROGRESS)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::LIMITED_TO_IPV4 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::LIMITED_TO_IPV4)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::LIMITED_TO_IPV6 == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::LIMITED_TO_IPV6)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::VSNCP_TIMEOUT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_TIMEOUT)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::VSNCP_GEN_ERROR == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_GEN_ERROR)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::VSNCP_APN_UNAUTHORIZED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_APN_UNATHORIZED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::VSNCP_PDN_LIMIT_EXCEEDED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_PDN_LIMIT_EXCEEDED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::VSNCP_NO_PDN_GATEWAY_ADDRESS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_NO_PDN_GATEWAY_ADDRESS)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::VSNCP_PDN_GATEWAY_UNREACHABLE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - VSNCP_PDN_GATEWAY_UNREACHABLE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::VSNCP_PDN_GATEWAY_REJECT == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_PDN_GATEWAY_REJECT)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::VSNCP_INSUFFICIENT_PARAMETERS == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - VSNCP_INSUFFICIENT_PARAMETERS)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::VSNCP_RESOURCE_UNAVAILABLE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_RESOURCE_UNAVAILABLE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::VSNCP_ADMINISTRATIVELY_PROHIBITED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - VSNCP_ADMINISTRATIVELY_PROHIBITED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::VSNCP_PDN_ID_IN_USE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_PDN_ID_IN_USE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::VSNCP_SUBSCRIBER_LIMITATION == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_SUBSCRIBER_LIMITATION)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::VSNCP_PDN_EXISTS_FOR_THIS_APN == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause:: - VSNCP_PDN_EXISTS_FOR_THIS_APN)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::VSNCP_RECONNECT_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::VSNCP_RECONNECT_NOT_ALLOWED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::IPV6_PREFIX_UNAVAILABLE == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::IPV6_PREFIX_UNAVAILABLE)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::HANDOFF_PREFERENCE_CHANGED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::HANDOFF_PREFERENCE_CHANGED)); -static_assert(aidl::android::hardware::radio::DataCallFailCause::SLICE_REJECTED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::SLICE_REJECTED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::MATCH_ALL_RULE_NOT_ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::MATCH_ALL_RULE_NOT_ALLOWED)); -static_assert( - aidl::android::hardware::radio::DataCallFailCause::ALL_MATCHING_RULES_FAILED == - static_cast( - ::android::hardware::radio::V1_6::DataCallFailCause::ALL_MATCHING_RULES_FAILED)); - -static_assert(aidl::android::hardware::radio::SliceStatus::UNKNOWN == - static_cast( - ::android::hardware::radio::V1_6::SliceStatus::UNKNOWN)); -static_assert(aidl::android::hardware::radio::SliceStatus::CONFIGURED == - static_cast( - ::android::hardware::radio::V1_6::SliceStatus::CONFIGURED)); -static_assert(aidl::android::hardware::radio::SliceStatus::ALLOWED == - static_cast( - ::android::hardware::radio::V1_6::SliceStatus::ALLOWED)); -static_assert( - aidl::android::hardware::radio::SliceStatus::REJECTED_NOT_AVAILABLE_IN_PLMN == - static_cast( - ::android::hardware::radio::V1_6::SliceStatus::REJECTED_NOT_AVAILABLE_IN_PLMN)); -static_assert( - aidl::android::hardware::radio::SliceStatus::REJECTED_NOT_AVAILABLE_IN_REG_AREA == - static_cast( - ::android::hardware::radio::V1_6::SliceStatus::REJECTED_NOT_AVAILABLE_IN_REG_AREA)); -static_assert(aidl::android::hardware::radio::SliceStatus::DEFAULT_CONFIGURED == - static_cast( - ::android::hardware::radio::V1_6::SliceStatus::DEFAULT_CONFIGURED)); - -static_assert(aidl::android::hardware::radio::SscMode::MODE_1 == - static_cast( - ::android::hardware::radio::V1_6::SscMode::MODE_1)); -static_assert(aidl::android::hardware::radio::SscMode::MODE_2 == - static_cast( - ::android::hardware::radio::V1_6::SscMode::MODE_2)); -static_assert(aidl::android::hardware::radio::SscMode::MODE_3 == - static_cast( - ::android::hardware::radio::V1_6::SscMode::MODE_3)); - -static_assert(aidl::android::hardware::radio::PublicKeyType::EPDG == - static_cast( - ::android::hardware::radio::V1_6::PublicKeyType::EPDG)); -static_assert(aidl::android::hardware::radio::PublicKeyType::WLAN == - static_cast( - ::android::hardware::radio::V1_6::PublicKeyType::WLAN)); - -static_assert(aidl::android::hardware::radio::PbReceivedStatus::PB_RECEIVED_OK == - static_cast( - ::android::hardware::radio::V1_6::PbReceivedStatus::PB_RECEIVED_OK)); -static_assert(aidl::android::hardware::radio::PbReceivedStatus::PB_RECEIVED_ERROR == - static_cast( - ::android::hardware::radio::V1_6::PbReceivedStatus::PB_RECEIVED_ERROR)); -static_assert(aidl::android::hardware::radio::PbReceivedStatus::PB_RECEIVED_ABORT == - static_cast( - ::android::hardware::radio::V1_6::PbReceivedStatus::PB_RECEIVED_ABORT)); -static_assert(aidl::android::hardware::radio::PbReceivedStatus::PB_RECEIVED_FINAL == - static_cast( - ::android::hardware::radio::V1_6::PbReceivedStatus::PB_RECEIVED_FINAL)); - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::IccIo& in, - aidl::android::hardware::radio::IccIo* out) { - out->command = static_cast(in.command); - out->fileId = static_cast(in.fileId); - out->path = in.path; - out->p1 = static_cast(in.p1); - out->p2 = static_cast(in.p2); - out->p3 = static_cast(in.p3); - out->data = in.data; - out->pin2 = in.pin2; - out->aid = in.aid; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::NeighboringCell& in, - aidl::android::hardware::radio::NeighboringCell* out) { - out->cid = in.cid; - out->rssi = static_cast(in.rssi); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::UusInfo& in, - aidl::android::hardware::radio::UusInfo* out) { - out->uusType = static_cast(in.uusType); - out->uusDcs = static_cast(in.uusDcs); - out->uusData = in.uusData; - return true; -} - -__attribute__((warn_unused_result)) bool translate(const ::android::hardware::radio::V1_0::Dial& in, - aidl::android::hardware::radio::Dial* out) { - out->address = in.address; - out->clir = static_cast(in.clir); - { - size_t size = in.uusInfo.size(); - aidl::android::hardware::radio::UusInfo uusInfo; - for (size_t i = 0; i < size; i++) { - if (!translate(in.uusInfo[i], &uusInfo)) return false; - out->uusInfo.push_back(uusInfo); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::LastCallFailCauseInfo& in, - aidl::android::hardware::radio::LastCallFailCauseInfo* out) { - out->causeCode = static_cast(in.causeCode); - out->vendorCause = in.vendorCause; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::GsmSignalStrength& in, - aidl::android::hardware::radio::GsmSignalStrength* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.signalStrength > std::numeric_limits::max() || in.signalStrength < 0) { - return false; - } - out->signalStrength = static_cast(in.signalStrength); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.bitErrorRate > std::numeric_limits::max() || in.bitErrorRate < 0) { - return false; - } - out->bitErrorRate = static_cast(in.bitErrorRate); - out->timingAdvance = static_cast(in.timingAdvance); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaSignalStrength& in, - aidl::android::hardware::radio::CdmaSignalStrength* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.dbm > std::numeric_limits::max() || in.dbm < 0) { - return false; - } - out->dbm = static_cast(in.dbm); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.ecio > std::numeric_limits::max() || in.ecio < 0) { - return false; - } - out->ecio = static_cast(in.ecio); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::EvdoSignalStrength& in, - aidl::android::hardware::radio::EvdoSignalStrength* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.dbm > std::numeric_limits::max() || in.dbm < 0) { - return false; - } - out->dbm = static_cast(in.dbm); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.ecio > std::numeric_limits::max() || in.ecio < 0) { - return false; - } - out->ecio = static_cast(in.ecio); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.signalNoiseRatio > std::numeric_limits::max() || in.signalNoiseRatio < 0) { - return false; - } - out->signalNoiseRatio = static_cast(in.signalNoiseRatio); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::SendSmsResult& in, - aidl::android::hardware::radio::SendSmsResult* out) { - out->messageRef = static_cast(in.messageRef); - out->ackPDU = in.ackPDU; - out->errorCode = static_cast(in.errorCode); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::IccIoResult& in, - aidl::android::hardware::radio::IccIoResult* out) { - out->sw1 = static_cast(in.sw1); - out->sw2 = static_cast(in.sw2); - out->simResponse = in.simResponse; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CallForwardInfo& in, - aidl::android::hardware::radio::CallForwardInfo* out) { - out->status = static_cast(in.status); - out->reason = static_cast(in.reason); - out->serviceClass = static_cast(in.serviceClass); - out->toa = static_cast(in.toa); - out->number = in.number; - out->timeSeconds = static_cast(in.timeSeconds); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::OperatorInfo& in, - aidl::android::hardware::radio::OperatorInfo* out) { - out->alphaLong = in.alphaLong; - out->alphaShort = in.alphaShort; - out->operatorNumeric = in.operatorNumeric; - out->status = static_cast(in.status); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::SmsWriteArgs& in, - aidl::android::hardware::radio::SmsWriteArgs* out) { - out->status = static_cast(in.status); - out->pdu = in.pdu; - out->smsc = in.smsc; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaSmsAddress& in, - aidl::android::hardware::radio::CdmaSmsAddress* out) { - out->digitMode = static_cast(in.digitMode); - out->numberMode = static_cast(in.numberMode); - out->numberType = static_cast(in.numberType); - out->numberPlan = static_cast(in.numberPlan); - { - size_t size = in.digits.size(); - for (size_t i = 0; i < size; i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.digits[i] > std::numeric_limits::max() || in.digits[i] < 0) { - return false; - } - out->digits.push_back(static_cast(in.digits[i])); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaSmsSubaddress& in, - aidl::android::hardware::radio::CdmaSmsSubaddress* out) { - out->subaddressType = - static_cast(in.subaddressType); - out->odd = static_cast(in.odd); - { - size_t size = in.digits.size(); - for (size_t i = 0; i < size; i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.digits[i] > std::numeric_limits::max() || in.digits[i] < 0) { - return false; - } - out->digits.push_back(static_cast(in.digits[i])); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaSmsMessage& in, - aidl::android::hardware::radio::CdmaSmsMessage* out) { - out->teleserviceId = static_cast(in.teleserviceId); - out->isServicePresent = static_cast(in.isServicePresent); - out->serviceCategory = static_cast(in.serviceCategory); - if (!translate(in.address, &out->address)) return false; - if (!translate(in.subAddress, &out->subAddress)) return false; - { - size_t size = in.bearerData.size(); - for (size_t i = 0; i < size; i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.bearerData[i] > std::numeric_limits::max() || in.bearerData[i] < 0) { - return false; - } - out->bearerData.push_back(static_cast(in.bearerData[i])); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaSmsAck& in, - aidl::android::hardware::radio::CdmaSmsAck* out) { - out->errorClass = static_cast(in.errorClass); - out->smsCauseCode = static_cast(in.smsCauseCode); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaBroadcastSmsConfigInfo& in, - aidl::android::hardware::radio::CdmaBroadcastSmsConfigInfo* out) { - out->serviceCategory = static_cast(in.serviceCategory); - out->language = static_cast(in.language); - out->selected = static_cast(in.selected); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaSmsWriteArgs& in, - aidl::android::hardware::radio::CdmaSmsWriteArgs* out) { - out->status = static_cast(in.status); - if (!translate(in.message, &out->message)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::GsmBroadcastSmsConfigInfo& in, - aidl::android::hardware::radio::GsmBroadcastSmsConfigInfo* out) { - out->fromServiceId = static_cast(in.fromServiceId); - out->toServiceId = static_cast(in.toServiceId); - out->fromCodeScheme = static_cast(in.fromCodeScheme); - out->toCodeScheme = static_cast(in.toCodeScheme); - out->selected = static_cast(in.selected); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::GsmSmsMessage& in, - aidl::android::hardware::radio::GsmSmsMessage* out) { - out->smscPdu = in.smscPdu; - out->pdu = in.pdu; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::ImsSmsMessage& in, - aidl::android::hardware::radio::ImsSmsMessage* out) { - out->tech = static_cast(in.tech); - out->retry = static_cast(in.retry); - out->messageRef = static_cast(in.messageRef); - { - size_t size = in.cdmaMessage.size(); - aidl::android::hardware::radio::CdmaSmsMessage cdmaMessage; - for (size_t i = 0; i < size; i++) { - if (!translate(in.cdmaMessage[i], &cdmaMessage)) return false; - out->cdmaMessage.push_back(cdmaMessage); - } - } - { - size_t size = in.gsmMessage.size(); - aidl::android::hardware::radio::GsmSmsMessage gsmMessage; - for (size_t i = 0; i < size; i++) { - if (!translate(in.gsmMessage[i], &gsmMessage)) return false; - out->gsmMessage.push_back(gsmMessage); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::SimApdu& in, - aidl::android::hardware::radio::SimApdu* out) { - out->sessionId = static_cast(in.sessionId); - out->cla = static_cast(in.cla); - out->instruction = static_cast(in.instruction); - out->p1 = static_cast(in.p1); - out->p2 = static_cast(in.p2); - out->p3 = static_cast(in.p3); - out->data = in.data; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::NvWriteItem& in, - aidl::android::hardware::radio::NvWriteItem* out) { - out->itemId = static_cast(in.itemId); - out->value = in.value; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::SelectUiccSub& in, - aidl::android::hardware::radio::SelectUiccSub* out) { - out->slot = static_cast(in.slot); - out->appIndex = static_cast(in.appIndex); - out->subType = static_cast(in.subType); - out->actStatus = static_cast(in.actStatus); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::HardwareConfigModem& in, - aidl::android::hardware::radio::HardwareConfigModem* out) { - out->rilModel = static_cast(in.rilModel); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.rat > std::numeric_limits::max() || in.rat < 0) { - return false; - } - out->rat = static_cast(in.rat); - out->maxVoice = static_cast(in.maxVoice); - out->maxData = static_cast(in.maxData); - out->maxStandby = static_cast(in.maxStandby); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::HardwareConfigSim& in, - aidl::android::hardware::radio::HardwareConfigSim* out) { - out->modemUuid = in.modemUuid; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::HardwareConfig& in, - aidl::android::hardware::radio::HardwareConfig* out) { - out->type = static_cast(in.type); - out->uuid = in.uuid; - out->state = static_cast(in.state); - { - size_t size = in.modem.size(); - aidl::android::hardware::radio::HardwareConfigModem modem; - for (size_t i = 0; i < size; i++) { - if (!translate(in.modem[i], &modem)) return false; - out->modem.push_back(modem); - } - } - { - size_t size = in.sim.size(); - aidl::android::hardware::radio::HardwareConfigSim sim; - for (size_t i = 0; i < size; i++) { - if (!translate(in.sim[i], &sim)) return false; - out->sim.push_back(sim); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::LceStatusInfo& in, - aidl::android::hardware::radio::LceStatusInfo* out) { - out->lceStatus = static_cast(in.lceStatus); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.actualIntervalMs > std::numeric_limits::max() || in.actualIntervalMs < 0) { - return false; - } - out->actualIntervalMs = static_cast(in.actualIntervalMs); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::LceDataInfo& in, - aidl::android::hardware::radio::LceDataInfo* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.lastHopCapacityKbps > std::numeric_limits::max() || - in.lastHopCapacityKbps < 0) { - return false; - } - out->lastHopCapacityKbps = static_cast(in.lastHopCapacityKbps); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.confidenceLevel > std::numeric_limits::max() || in.confidenceLevel < 0) { - return false; - } - out->confidenceLevel = static_cast(in.confidenceLevel); - out->lceSuspended = static_cast(in.lceSuspended); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::ActivityStatsInfo& in, - aidl::android::hardware::radio::ActivityStatsInfo* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.sleepModeTimeMs > std::numeric_limits::max() || in.sleepModeTimeMs < 0) { - return false; - } - out->sleepModeTimeMs = static_cast(in.sleepModeTimeMs); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.idleModeTimeMs > std::numeric_limits::max() || in.idleModeTimeMs < 0) { - return false; - } - out->idleModeTimeMs = static_cast(in.idleModeTimeMs); - { - size_t size = sizeof(in.txmModetimeMs) / sizeof(in.txmModetimeMs[0]); - for (size_t i = 0; i < size; i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.txmModetimeMs[i] > std::numeric_limits::max() || - in.txmModetimeMs[i] < 0) { - return false; - } - out->txmModetimeMs.push_back(static_cast(in.txmModetimeMs[i])); - } - } - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.rxModeTimeMs > std::numeric_limits::max() || in.rxModeTimeMs < 0) { - return false; - } - out->rxModeTimeMs = static_cast(in.rxModeTimeMs); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::Carrier& in, - aidl::android::hardware::radio::Carrier* out) { - out->mcc = in.mcc; - out->mnc = in.mnc; - out->matchType = static_cast(in.matchType); - out->matchData = in.matchData; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CarrierRestrictions& in, - aidl::android::hardware::radio::CarrierRestrictions* out) { - { - size_t size = in.allowedCarriers.size(); - aidl::android::hardware::radio::Carrier allowedCarriers; - for (size_t i = 0; i < size; i++) { - if (!translate(in.allowedCarriers[i], &allowedCarriers)) return false; - out->allowedCarriers.push_back(allowedCarriers); - } - } - { - size_t size = in.excludedCarriers.size(); - aidl::android::hardware::radio::Carrier excludedCarriers; - for (size_t i = 0; i < size; i++) { - if (!translate(in.excludedCarriers[i], &excludedCarriers)) return false; - out->excludedCarriers.push_back(excludedCarriers); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::SuppSvcNotification& in, - aidl::android::hardware::radio::SuppSvcNotification* out) { - out->isMT = static_cast(in.isMT); - out->code = static_cast(in.code); - out->index = static_cast(in.index); - out->type = static_cast(in.type); - out->number = in.number; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::SimRefreshResult& in, - aidl::android::hardware::radio::SimRefreshResult* out) { - out->type = static_cast(in.type); - out->efId = static_cast(in.efId); - out->aid = in.aid; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaSignalInfoRecord& in, - aidl::android::hardware::radio::CdmaSignalInfoRecord* out) { - out->isPresent = static_cast(in.isPresent); - out->signalType = static_cast(in.signalType); - out->alertPitch = static_cast(in.alertPitch); - out->signal = static_cast(in.signal); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaCallWaiting& in, - aidl::android::hardware::radio::CdmaCallWaiting* out) { - out->number = in.number; - out->numberPresentation = - static_cast( - in.numberPresentation); - out->name = in.name; - if (!translate(in.signalInfoRecord, &out->signalInfoRecord)) return false; - out->numberType = - static_cast(in.numberType); - out->numberPlan = - static_cast(in.numberPlan); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaDisplayInfoRecord& in, - aidl::android::hardware::radio::CdmaDisplayInfoRecord* out) { - out->alphaBuf = in.alphaBuf; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaNumberInfoRecord& in, - aidl::android::hardware::radio::CdmaNumberInfoRecord* out) { - out->number = in.number; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.numberType > std::numeric_limits::max() || in.numberType < 0) { - return false; - } - out->numberType = static_cast(in.numberType); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.numberPlan > std::numeric_limits::max() || in.numberPlan < 0) { - return false; - } - out->numberPlan = static_cast(in.numberPlan); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.pi > std::numeric_limits::max() || in.pi < 0) { - return false; - } - out->pi = static_cast(in.pi); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.si > std::numeric_limits::max() || in.si < 0) { - return false; - } - out->si = static_cast(in.si); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaRedirectingNumberInfoRecord& in, - aidl::android::hardware::radio::CdmaRedirectingNumberInfoRecord* out) { - if (!translate(in.redirectingNumber, &out->redirectingNumber)) return false; - out->redirectingReason = static_cast( - in.redirectingReason); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaLineControlInfoRecord& in, - aidl::android::hardware::radio::CdmaLineControlInfoRecord* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.lineCtrlPolarityIncluded > std::numeric_limits::max() || - in.lineCtrlPolarityIncluded < 0) { - return false; - } - out->lineCtrlPolarityIncluded = static_cast(in.lineCtrlPolarityIncluded); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.lineCtrlToggle > std::numeric_limits::max() || in.lineCtrlToggle < 0) { - return false; - } - out->lineCtrlToggle = static_cast(in.lineCtrlToggle); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.lineCtrlReverse > std::numeric_limits::max() || in.lineCtrlReverse < 0) { - return false; - } - out->lineCtrlReverse = static_cast(in.lineCtrlReverse); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.lineCtrlPowerDenial > std::numeric_limits::max() || in.lineCtrlPowerDenial < 0) { - return false; - } - out->lineCtrlPowerDenial = static_cast(in.lineCtrlPowerDenial); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaT53ClirInfoRecord& in, - aidl::android::hardware::radio::CdmaT53ClirInfoRecord* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.cause > std::numeric_limits::max() || in.cause < 0) { - return false; - } - out->cause = static_cast(in.cause); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaT53AudioControlInfoRecord& in, - aidl::android::hardware::radio::CdmaT53AudioControlInfoRecord* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.upLink > std::numeric_limits::max() || in.upLink < 0) { - return false; - } - out->upLink = static_cast(in.upLink); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.downLink > std::numeric_limits::max() || in.downLink < 0) { - return false; - } - out->downLink = static_cast(in.downLink); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaInformationRecord& in, - aidl::android::hardware::radio::CdmaInformationRecord* out) { - out->name = static_cast(in.name); - { - size_t size = in.display.size(); - aidl::android::hardware::radio::CdmaDisplayInfoRecord display; - for (size_t i = 0; i < size; i++) { - if (!translate(in.display[i], &display)) return false; - out->display.push_back(display); - } - } - { - size_t size = in.number.size(); - aidl::android::hardware::radio::CdmaNumberInfoRecord number; - for (size_t i = 0; i < size; i++) { - if (!translate(in.number[i], &number)) return false; - out->number.push_back(number); - } - } - { - size_t size = in.signal.size(); - aidl::android::hardware::radio::CdmaSignalInfoRecord signal; - for (size_t i = 0; i < size; i++) { - if (!translate(in.signal[i], &signal)) return false; - out->signal.push_back(signal); - } - } - { - size_t size = in.redir.size(); - aidl::android::hardware::radio::CdmaRedirectingNumberInfoRecord redir; - for (size_t i = 0; i < size; i++) { - if (!translate(in.redir[i], &redir)) return false; - out->redir.push_back(redir); - } - } - { - size_t size = in.lineCtrl.size(); - aidl::android::hardware::radio::CdmaLineControlInfoRecord lineCtrl; - for (size_t i = 0; i < size; i++) { - if (!translate(in.lineCtrl[i], &lineCtrl)) return false; - out->lineCtrl.push_back(lineCtrl); - } - } - { - size_t size = in.clir.size(); - aidl::android::hardware::radio::CdmaT53ClirInfoRecord clir; - for (size_t i = 0; i < size; i++) { - if (!translate(in.clir[i], &clir)) return false; - out->clir.push_back(clir); - } - } - { - size_t size = in.audioCtrl.size(); - aidl::android::hardware::radio::CdmaT53AudioControlInfoRecord audioCtrl; - for (size_t i = 0; i < size; i++) { - if (!translate(in.audioCtrl[i], &audioCtrl)) return false; - out->audioCtrl.push_back(audioCtrl); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaInformationRecords& in, - aidl::android::hardware::radio::CdmaInformationRecords* out) { - { - size_t size = in.infoRec.size(); - aidl::android::hardware::radio::CdmaInformationRecord infoRec; - for (size_t i = 0; i < size; i++) { - if (!translate(in.infoRec[i], &infoRec)) return false; - out->infoRec.push_back(infoRec); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CfData& in, - aidl::android::hardware::radio::CfData* out) { - { - size_t size = in.cfInfo.size(); - aidl::android::hardware::radio::CallForwardInfo cfInfo; - for (size_t i = 0; i < size; i++) { - if (!translate(in.cfInfo[i], &cfInfo)) return false; - out->cfInfo.push_back(cfInfo); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::SsInfoData& in, - aidl::android::hardware::radio::SsInfoData* out) { - { - size_t size = in.ssInfo.size(); - for (size_t i = 0; i < size; i++) { - out->ssInfo.push_back(static_cast(in.ssInfo[i])); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::StkCcUnsolSsResult& in, - aidl::android::hardware::radio::StkCcUnsolSsResult* out) { - out->serviceType = static_cast(in.serviceType); - out->requestType = static_cast(in.requestType); - out->teleserviceType = - static_cast(in.teleserviceType); - out->serviceClass = - static_cast(in.serviceClass); - out->result = static_cast(in.result); - { - size_t size = in.ssInfo.size(); - aidl::android::hardware::radio::SsInfoData ssInfo; - for (size_t i = 0; i < size; i++) { - if (!translate(in.ssInfo[i], &ssInfo)) return false; - out->ssInfo.push_back(ssInfo); - } - } - { - size_t size = in.cfData.size(); - aidl::android::hardware::radio::CfData cfData; - for (size_t i = 0; i < size; i++) { - if (!translate(in.cfData[i], &cfData)) return false; - out->cfData.push_back(cfData); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::PcoDataInfo& in, - aidl::android::hardware::radio::PcoDataInfo* out) { - out->cid = static_cast(in.cid); - out->bearerProto = in.bearerProto; - out->pcoId = static_cast(in.pcoId); - { - size_t size = in.contents.size(); - for (size_t i = 0; i < size; i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.contents[i] > std::numeric_limits::max() || in.contents[i] < 0) { - return false; - } - out->contents.push_back(static_cast(in.contents[i])); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_1::KeepaliveRequest& in, - aidl::android::hardware::radio::KeepaliveRequest* out) { - out->type = static_cast(in.type); - { - size_t size = in.sourceAddress.size(); - for (size_t i = 0; i < size; i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.sourceAddress[i] > std::numeric_limits::max() || - in.sourceAddress[i] < 0) { - return false; - } - out->sourceAddress.push_back(static_cast(in.sourceAddress[i])); - } - } - out->sourcePort = static_cast(in.sourcePort); - { - size_t size = in.destinationAddress.size(); - for (size_t i = 0; i < size; i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.destinationAddress[i] > std::numeric_limits::max() || - in.destinationAddress[i] < 0) { - return false; - } - out->destinationAddress.push_back(static_cast(in.destinationAddress[i])); - } - } - out->destinationPort = static_cast(in.destinationPort); - out->maxKeepaliveIntervalMillis = static_cast(in.maxKeepaliveIntervalMillis); - out->cid = static_cast(in.cid); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_1::KeepaliveStatus& in, - aidl::android::hardware::radio::KeepaliveStatus* out) { - out->sessionHandle = static_cast(in.sessionHandle); - out->code = static_cast(in.code); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_2::CellIdentityOperatorNames& in, - aidl::android::hardware::radio::CellIdentityOperatorNames* out) { - out->alphaLong = in.alphaLong; - out->alphaShort = in.alphaShort; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_2::CellIdentityCdma& in, - aidl::android::hardware::radio::CellIdentityCdma* out) { - out->networkId = static_cast(in.base.networkId); - out->systemId = static_cast(in.base.systemId); - out->baseStationId = static_cast(in.base.baseStationId); - out->longitude = static_cast(in.base.longitude); - out->latitude = static_cast(in.base.latitude); - if (!translate(in.operatorNames, &out->operatorNames)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_2::CellInfoCdma& in, - aidl::android::hardware::radio::CellInfoCdma* out) { - if (!translate(in.cellIdentityCdma, &out->cellIdentityCdma)) return false; - if (!translate(in.signalStrengthCdma, &out->signalStrengthCdma)) return false; - if (!translate(in.signalStrengthEvdo, &out->signalStrengthEvdo)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_2::WcdmaSignalStrength& in, - aidl::android::hardware::radio::WcdmaSignalStrength* out) { - out->signalStrength = static_cast(in.base.signalStrength); - out->bitErrorRate = static_cast(in.base.bitErrorRate); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.rscp > std::numeric_limits::max() || in.rscp < 0) { - return false; - } - out->rscp = static_cast(in.rscp); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.ecno > std::numeric_limits::max() || in.ecno < 0) { - return false; - } - out->ecno = static_cast(in.ecno); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_2::TdscdmaSignalStrength& in, - aidl::android::hardware::radio::TdscdmaSignalStrength* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.signalStrength > std::numeric_limits::max() || in.signalStrength < 0) { - return false; - } - out->signalStrength = static_cast(in.signalStrength); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.bitErrorRate > std::numeric_limits::max() || in.bitErrorRate < 0) { - return false; - } - out->bitErrorRate = static_cast(in.bitErrorRate); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.rscp > std::numeric_limits::max() || in.rscp < 0) { - return false; - } - out->rscp = static_cast(in.rscp); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_2::VoiceRegStateResult& in, - aidl::android::hardware::radio::VoiceRegStateResult* out) { - out->regState = static_cast(in.regState); - out->rat = static_cast(in.rat); - out->cssSupported = static_cast(in.cssSupported); - out->roamingIndicator = static_cast(in.roamingIndicator); - out->systemIsInPrl = static_cast(in.systemIsInPrl); - out->defaultRoamingIndicator = static_cast(in.defaultRoamingIndicator); - out->reasonForDenial = static_cast(in.reasonForDenial); - // FIXME Unknown type: android.hardware.radio@1.2::CellIdentity - // That type's package needs to be converted separately and the corresponding translate function - // should be added here. - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_3::RadioResponseInfoModem& in, - aidl::android::hardware::radio::RadioResponseInfoModem* out) { - out->type = static_cast(in.type); - out->serial = static_cast(in.serial); - out->error = static_cast(in.error); - out->isEnabled = static_cast(in.isEnabled); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::EmergencyNumber& in, - aidl::android::hardware::radio::EmergencyNumber* out) { - out->number = in.number; - out->mcc = in.mcc; - out->mnc = in.mnc; - out->categories = - static_cast(in.categories); - { - size_t size = in.urns.size(); - for (size_t i = 0; i < size; i++) { - out->urns.push_back(in.urns[i]); - } - } - out->sources = static_cast(in.sources); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::RadioFrequencyInfo& in, - aidl::android::hardware::radio::RadioFrequencyInfo* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_4::RadioFrequencyInfo::hidl_discriminator::range: - *out = static_cast(in.range()); - break; - case ::android::hardware::radio::V1_4::RadioFrequencyInfo::hidl_discriminator:: - channelNumber: - *out = static_cast(in.channelNumber()); - break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::LteVopsInfo& in, - aidl::android::hardware::radio::LteVopsInfo* out) { - out->isVopsSupported = static_cast(in.isVopsSupported); - out->isEmcBearerSupported = static_cast(in.isEmcBearerSupported); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::NrIndicators& in, - aidl::android::hardware::radio::NrIndicators* out) { - out->isEndcAvailable = static_cast(in.isEndcAvailable); - out->isDcNrRestricted = static_cast(in.isDcNrRestricted); - out->isNrAvailable = static_cast(in.isNrAvailable); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::DataRegStateResult& in, - aidl::android::hardware::radio::DataRegStateResult* out) { - out->regState = static_cast(in.base.regState); - out->rat = static_cast(in.base.rat); - out->reasonDataDenied = static_cast(in.base.reasonDataDenied); - out->maxDataCalls = static_cast(in.base.maxDataCalls); - // FIXME Unknown type: android.hardware.radio@1.2::CellIdentity - // That type's package needs to be converted separately and the corresponding translate function - // should be added here. - if (!translate(in.vopsInfo, &out->vopsInfo)) return false; - if (!translate(in.nrIndicators, &out->nrIndicators)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::DataRegStateResult::VopsInfo& in, - aidl::android::hardware::radio::DataRegStateResultVopsInfo* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_4::DataRegStateResult::VopsInfo::hidl_discriminator:: - noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_4::DataRegStateResult::VopsInfo::hidl_discriminator:: - lteVopsInfo: { - aidl::android::hardware::radio::LteVopsInfo lteVopsInfo; - if (!translate(in.lteVopsInfo(), <eVopsInfo)) return false; - out->set( - lteVopsInfo); - } break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::CellConfigLte& in, - aidl::android::hardware::radio::CellConfigLte* out) { - out->isEndcAvailable = static_cast(in.isEndcAvailable); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::CellInfo::Info& in, - aidl::android::hardware::radio::CellInfoInfo* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_4::CellInfo::Info::hidl_discriminator::gsm: - // FIXME Unknown type: android.hardware.radio@1.2::CellInfoGsm - // That type's package needs to be converted separately and the corresponding translate - // function should be added here. - break; - case ::android::hardware::radio::V1_4::CellInfo::Info::hidl_discriminator::cdma: { - aidl::android::hardware::radio::CellInfoCdma cdma; - if (!translate(in.cdma(), &cdma)) return false; - out->set(cdma); - } break; - case ::android::hardware::radio::V1_4::CellInfo::Info::hidl_discriminator::wcdma: - // FIXME Unknown type: android.hardware.radio@1.2::CellInfoWcdma - // That type's package needs to be converted separately and the corresponding translate - // function should be added here. - break; - case ::android::hardware::radio::V1_4::CellInfo::Info::hidl_discriminator::tdscdma: - // FIXME Unknown type: android.hardware.radio@1.2::CellInfoTdscdma - // That type's package needs to be converted separately and the corresponding translate - // function should be added here. - break; - case ::android::hardware::radio::V1_4::CellInfo::Info::hidl_discriminator::lte: - // FIXME Unknown type: android.hardware.radio@1.4::CellInfoLte - // That type's package needs to be converted separately and the corresponding translate - // function should be added here. - break; - case ::android::hardware::radio::V1_4::CellInfo::Info::hidl_discriminator::nr: - // FIXME Unknown type: android.hardware.radio@1.4::CellInfoNr - // That type's package needs to be converted separately and the corresponding translate - // function should be added here. - break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::RadioCapability& in, - aidl::android::hardware::radio::RadioCapability* out) { - out->session = static_cast(in.session); - out->phase = static_cast(in.phase); - out->raf = static_cast(in.raf); - out->logicalModemUuid = in.logicalModemUuid; - out->status = static_cast(in.status); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::CarrierRestrictionsWithPriority& in, - aidl::android::hardware::radio::CarrierRestrictionsWithPriority* out) { - { - size_t size = in.allowedCarriers.size(); - aidl::android::hardware::radio::Carrier allowedCarriers; - for (size_t i = 0; i < size; i++) { - if (!translate(in.allowedCarriers[i], &allowedCarriers)) return false; - out->allowedCarriers.push_back(allowedCarriers); - } - } - { - size_t size = in.excludedCarriers.size(); - aidl::android::hardware::radio::Carrier excludedCarriers; - for (size_t i = 0; i < size; i++) { - if (!translate(in.excludedCarriers[i], &excludedCarriers)) return false; - out->excludedCarriers.push_back(excludedCarriers); - } - } - out->allowedCarriersPrioritized = static_cast(in.allowedCarriersPrioritized); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::RadioAccessSpecifier& in, - aidl::android::hardware::radio::RadioAccessSpecifier* out) { - out->radioAccessNetwork = - static_cast(in.radioAccessNetwork); - if (!translate(in.bands, &out->bands)) return false; - { - size_t size = in.channels.size(); - for (size_t i = 0; i < size; i++) { - out->channels.push_back(static_cast(in.channels[i])); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands& in, - aidl::android::hardware::radio::RadioAccessSpecifierBands* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands::hidl_discriminator:: - geranBands: { - ::android::hardware::hidl_vec<::android::hardware::radio::V1_1::GeranBands> geranBands = - in.geranBands(); - size_t size = geranBands.size(); - for (size_t i = 0; i < size; i++) { - out->get() - .push_back(static_cast( - geranBands[i])); - } - } break; - case ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands::hidl_discriminator:: - utranBands: { - ::android::hardware::hidl_vec<::android::hardware::radio::V1_5::UtranBands> utranBands = - in.utranBands(); - size_t size = utranBands.size(); - for (size_t i = 0; i < size; i++) { - out->get() - .push_back(static_cast( - utranBands[i])); - } - } break; - case ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands::hidl_discriminator:: - eutranBands: { - ::android::hardware::hidl_vec<::android::hardware::radio::V1_5::EutranBands> - eutranBands = in.eutranBands(); - size_t size = eutranBands.size(); - for (size_t i = 0; i < size; i++) { - out->get() - .push_back(static_cast( - eutranBands[i])); - } - } break; - case ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands::hidl_discriminator:: - ngranBands: { - ::android::hardware::hidl_vec<::android::hardware::radio::V1_5::NgranBands> ngranBands = - in.ngranBands(); - size_t size = ngranBands.size(); - for (size_t i = 0; i < size; i++) { - out->get() - .push_back(static_cast( - ngranBands[i])); - } - } break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::SignalThresholdInfo& in, - aidl::android::hardware::radio::SignalThresholdInfo* out) { - out->signalMeasurement = static_cast( - in.signalMeasurement); - out->hysteresisMs = static_cast(in.hysteresisMs); - out->hysteresisDb = static_cast(in.hysteresisDb); - { - size_t size = in.thresholds.size(); - for (size_t i = 0; i < size; i++) { - out->thresholds.push_back(static_cast(in.thresholds[i])); - } - } - out->isEnabled = static_cast(in.isEnabled); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::NetworkScanRequest& in, - aidl::android::hardware::radio::NetworkScanRequest* out) { - out->type = static_cast(in.type); - out->interval = static_cast(in.interval); - { - size_t size = in.specifiers.size(); - aidl::android::hardware::radio::RadioAccessSpecifier specifiers; - for (size_t i = 0; i < size; i++) { - if (!translate(in.specifiers[i], &specifiers)) return false; - out->specifiers.push_back(specifiers); - } - } - out->maxSearchTime = static_cast(in.maxSearchTime); - out->incrementalResults = static_cast(in.incrementalResults); - out->incrementalResultsPeriodicity = static_cast(in.incrementalResultsPeriodicity); - { - size_t size = in.mccMncs.size(); - for (size_t i = 0; i < size; i++) { - out->mccMncs.push_back(in.mccMncs[i]); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::DataProfileInfo& in, - aidl::android::hardware::radio::DataProfileInfo* out) { - out->profileId = static_cast(in.profileId); - out->apn = in.apn; - out->protocol = static_cast(in.protocol); - out->roamingProtocol = - static_cast(in.roamingProtocol); - out->authType = static_cast(in.authType); - out->user = in.user; - out->password = in.password; - out->type = static_cast(in.type); - out->maxConnsTime = static_cast(in.maxConnsTime); - out->maxConns = static_cast(in.maxConns); - out->waitTime = static_cast(in.waitTime); - out->enabled = static_cast(in.enabled); - out->supportedApnTypesBitmap = - static_cast(in.supportedApnTypesBitmap); - out->bearerBitmap = - static_cast(in.bearerBitmap); - out->mtuV4 = static_cast(in.mtuV4); - out->mtuV6 = static_cast(in.mtuV6); - out->preferred = static_cast(in.preferred); - out->persistent = static_cast(in.persistent); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::LinkAddress& in, - aidl::android::hardware::radio::LinkAddress* out) { - out->address = in.address; - out->properties = static_cast(in.properties); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.deprecationTime > std::numeric_limits::max() || in.deprecationTime < 0) { - return false; - } - out->deprecationTime = static_cast(in.deprecationTime); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.expirationTime > std::numeric_limits::max() || in.expirationTime < 0) { - return false; - } - out->expirationTime = static_cast(in.expirationTime); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::ClosedSubscriberGroupInfo& in, - aidl::android::hardware::radio::ClosedSubscriberGroupInfo* out) { - out->csgIndication = static_cast(in.csgIndication); - out->homeNodebName = in.homeNodebName; - out->csgIdentity = static_cast(in.csgIdentity); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::OptionalCsgInfo& in, - aidl::android::hardware::radio::OptionalCsgInfo* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_5::OptionalCsgInfo::hidl_discriminator::noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_5::OptionalCsgInfo::hidl_discriminator::csgInfo: { - aidl::android::hardware::radio::ClosedSubscriberGroupInfo csgInfo; - if (!translate(in.csgInfo(), &csgInfo)) return false; - out->set(csgInfo); - } break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellIdentityGsm& in, - aidl::android::hardware::radio::CellIdentityGsm* out) { - out->mcc = in.base.base.mcc; - out->mnc = in.base.base.mnc; - out->lac = static_cast(in.base.base.lac); - out->cid = static_cast(in.base.base.cid); - out->arfcn = static_cast(in.base.base.arfcn); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.base.base.bsic > std::numeric_limits::max() || in.base.base.bsic < 0) { - return false; - } - out->bsic = static_cast(in.base.base.bsic); - if (!translate(in.base.operatorNames, &out->operatorNames)) return false; - { - size_t size = in.additionalPlmns.size(); - for (size_t i = 0; i < size; i++) { - out->additionalPlmns.push_back(in.additionalPlmns[i]); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellIdentityWcdma& in, - aidl::android::hardware::radio::CellIdentityWcdma* out) { - out->mcc = in.base.base.mcc; - out->mnc = in.base.base.mnc; - out->lac = static_cast(in.base.base.lac); - out->cid = static_cast(in.base.base.cid); - out->psc = static_cast(in.base.base.psc); - out->uarfcn = static_cast(in.base.base.uarfcn); - if (!translate(in.base.operatorNames, &out->operatorNames)) return false; - { - size_t size = in.additionalPlmns.size(); - for (size_t i = 0; i < size; i++) { - out->additionalPlmns.push_back(in.additionalPlmns[i]); - } - } - if (!translate(in.optionalCsgInfo, &out->optionalCsgInfo)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellIdentityTdscdma& in, - aidl::android::hardware::radio::CellIdentityTdscdma* out) { - out->mcc = in.base.base.mcc; - out->mnc = in.base.base.mnc; - out->lac = static_cast(in.base.base.lac); - out->cid = static_cast(in.base.base.cid); - out->cpid = static_cast(in.base.base.cpid); - out->uarfcn = static_cast(in.base.uarfcn); - if (!translate(in.base.operatorNames, &out->operatorNames)) return false; - { - size_t size = in.additionalPlmns.size(); - for (size_t i = 0; i < size; i++) { - out->additionalPlmns.push_back(in.additionalPlmns[i]); - } - } - if (!translate(in.optionalCsgInfo, &out->optionalCsgInfo)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellIdentityLte& in, - aidl::android::hardware::radio::CellIdentityLte* out) { - out->mcc = in.base.base.mcc; - out->mnc = in.base.base.mnc; - out->ci = static_cast(in.base.base.ci); - out->pci = static_cast(in.base.base.pci); - out->tac = static_cast(in.base.base.tac); - out->earfcn = static_cast(in.base.base.earfcn); - if (!translate(in.base.operatorNames, &out->operatorNames)) return false; - out->bandwidth = static_cast(in.base.bandwidth); - { - size_t size = in.additionalPlmns.size(); - for (size_t i = 0; i < size; i++) { - out->additionalPlmns.push_back(in.additionalPlmns[i]); - } - } - if (!translate(in.optionalCsgInfo, &out->optionalCsgInfo)) return false; - { - size_t size = in.bands.size(); - for (size_t i = 0; i < size; i++) { - out->bands.push_back( - static_cast(in.bands[i])); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellIdentityNr& in, - aidl::android::hardware::radio::CellIdentityNr* out) { - out->mcc = in.base.mcc; - out->mnc = in.base.mnc; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.base.nci > std::numeric_limits::max() || in.base.nci < 0) { - return false; - } - out->nci = static_cast(in.base.nci); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.base.pci > std::numeric_limits::max() || in.base.pci < 0) { - return false; - } - out->pci = static_cast(in.base.pci); - out->tac = static_cast(in.base.tac); - out->nrarfcn = static_cast(in.base.nrarfcn); - if (!translate(in.base.operatorNames, &out->operatorNames)) return false; - { - size_t size = in.additionalPlmns.size(); - for (size_t i = 0; i < size; i++) { - out->additionalPlmns.push_back(in.additionalPlmns[i]); - } - } - { - size_t size = in.bands.size(); - for (size_t i = 0; i < size; i++) { - out->bands.push_back( - static_cast(in.bands[i])); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellInfoGsm& in, - aidl::android::hardware::radio::CellInfoGsm* out) { - if (!translate(in.cellIdentityGsm, &out->cellIdentityGsm)) return false; - if (!translate(in.signalStrengthGsm, &out->signalStrengthGsm)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellInfoWcdma& in, - aidl::android::hardware::radio::CellInfoWcdma* out) { - if (!translate(in.cellIdentityWcdma, &out->cellIdentityWcdma)) return false; - if (!translate(in.signalStrengthWcdma, &out->signalStrengthWcdma)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellInfoTdscdma& in, - aidl::android::hardware::radio::CellInfoTdscdma* out) { - if (!translate(in.cellIdentityTdscdma, &out->cellIdentityTdscdma)) return false; - if (!translate(in.signalStrengthTdscdma, &out->signalStrengthTdscdma)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellIdentity& in, - aidl::android::hardware::radio::CellIdentity* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_5::CellIdentity::hidl_discriminator::noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_5::CellIdentity::hidl_discriminator::gsm: { - aidl::android::hardware::radio::CellIdentityGsm gsm; - if (!translate(in.gsm(), &gsm)) return false; - out->set(gsm); - } break; - case ::android::hardware::radio::V1_5::CellIdentity::hidl_discriminator::wcdma: { - aidl::android::hardware::radio::CellIdentityWcdma wcdma; - if (!translate(in.wcdma(), &wcdma)) return false; - out->set(wcdma); - } break; - case ::android::hardware::radio::V1_5::CellIdentity::hidl_discriminator::tdscdma: { - aidl::android::hardware::radio::CellIdentityTdscdma tdscdma; - if (!translate(in.tdscdma(), &tdscdma)) return false; - out->set(tdscdma); - } break; - case ::android::hardware::radio::V1_5::CellIdentity::hidl_discriminator::cdma: { - aidl::android::hardware::radio::CellIdentityCdma cdma; - if (!translate(in.cdma(), &cdma)) return false; - out->set(cdma); - } break; - case ::android::hardware::radio::V1_5::CellIdentity::hidl_discriminator::lte: { - aidl::android::hardware::radio::CellIdentityLte lte; - if (!translate(in.lte(), <e)) return false; - out->set(lte); - } break; - case ::android::hardware::radio::V1_5::CellIdentity::hidl_discriminator::nr: { - aidl::android::hardware::radio::CellIdentityNr nr; - if (!translate(in.nr(), &nr)) return false; - out->set(nr); - } break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::BarringInfo& in, - aidl::android::hardware::radio::BarringInfo* out) { - out->serviceType = - static_cast(in.serviceType); - out->barringType = - static_cast(in.barringType); - if (!translate(in.barringTypeSpecificInfo, &out->barringTypeSpecificInfo)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::BarringInfo::BarringTypeSpecificInfo::Conditional& - in, - aidl::android::hardware::radio::BarringInfoBarringTypeSpecificInfoConditional* out) { - out->factor = static_cast(in.factor); - out->timeSeconds = static_cast(in.timeSeconds); - out->isBarred = static_cast(in.isBarred); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::BarringInfo::BarringTypeSpecificInfo& in, - aidl::android::hardware::radio::BarringInfoBarringTypeSpecificInfo* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_5::BarringInfo::BarringTypeSpecificInfo:: - hidl_discriminator::noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_5::BarringInfo::BarringTypeSpecificInfo:: - hidl_discriminator::conditional: { - aidl::android::hardware::radio::BarringInfoBarringTypeSpecificInfoConditional - conditional; - if (!translate(in.conditional(), &conditional)) return false; - out->set(conditional); - } break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::RegStateResult::AccessTechnologySpecificInfo:: - Cdma2000RegistrationInfo& in, - aidl::android::hardware::radio:: - RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo* out) { - out->cssSupported = static_cast(in.cssSupported); - out->roamingIndicator = static_cast(in.roamingIndicator); - out->systemIsInPrl = - static_cast(in.systemIsInPrl); - out->defaultRoamingIndicator = static_cast(in.defaultRoamingIndicator); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::RegStateResult::AccessTechnologySpecificInfo:: - EutranRegistrationInfo& in, - aidl::android::hardware::radio:: - RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo* out) { - if (!translate(in.lteVopsInfo, &out->lteVopsInfo)) return false; - if (!translate(in.nrIndicators, &out->nrIndicators)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::AppStatus& in, - aidl::android::hardware::radio::AppStatus* out) { - out->appType = static_cast(in.base.appType); - out->appState = static_cast(in.base.appState); - out->persoSubstate = - static_cast(in.persoSubstate); - out->aidPtr = in.base.aidPtr; - out->appLabelPtr = in.base.appLabelPtr; - out->pin1Replaced = static_cast(in.base.pin1Replaced); - out->pin1 = static_cast(in.base.pin1); - out->pin2 = static_cast(in.base.pin2); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CardStatus& in, - aidl::android::hardware::radio::CardStatus* out) { - out->cardState = - static_cast(in.base.base.base.cardState); - out->universalPinState = static_cast( - in.base.base.base.universalPinState); - out->gsmUmtsSubscriptionAppIndex = - static_cast(in.base.base.base.gsmUmtsSubscriptionAppIndex); - out->cdmaSubscriptionAppIndex = - static_cast(in.base.base.base.cdmaSubscriptionAppIndex); - out->imsSubscriptionAppIndex = static_cast(in.base.base.base.imsSubscriptionAppIndex); - { - size_t size = in.applications.size(); - aidl::android::hardware::radio::AppStatus applications; - for (size_t i = 0; i < size; i++) { - if (!translate(in.applications[i], &applications)) return false; - out->applications.push_back(applications); - } - } - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.base.base.physicalSlotId > std::numeric_limits::max() || - in.base.base.physicalSlotId < 0) { - return false; - } - out->physicalSlotId = static_cast(in.base.base.physicalSlotId); - out->atr = in.base.base.atr; - out->iccid = in.base.base.iccid; - out->eid = in.base.eid; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::QosBandwidth& in, - aidl::android::hardware::radio::QosBandwidth* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.maxBitrateKbps > std::numeric_limits::max() || in.maxBitrateKbps < 0) { - return false; - } - out->maxBitrateKbps = static_cast(in.maxBitrateKbps); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.guaranteedBitrateKbps > std::numeric_limits::max() || - in.guaranteedBitrateKbps < 0) { - return false; - } - out->guaranteedBitrateKbps = static_cast(in.guaranteedBitrateKbps); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::EpsQos& in, - aidl::android::hardware::radio::EpsQos* out) { - out->qci = static_cast(in.qci); - if (!translate(in.downlink, &out->downlink)) return false; - if (!translate(in.uplink, &out->uplink)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::NrQos& in, - aidl::android::hardware::radio::NrQos* out) { - out->fiveQi = static_cast(in.fiveQi); - if (!translate(in.downlink, &out->downlink)) return false; - if (!translate(in.uplink, &out->uplink)) return false; - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.qfi > std::numeric_limits::max() || in.qfi < 0) { - return false; - } - out->qfi = static_cast(in.qfi); - out->averagingWindowMs = static_cast(in.averagingWindowMs); - return true; -} - -__attribute__((warn_unused_result)) bool translate(const ::android::hardware::radio::V1_6::Qos& in, - aidl::android::hardware::radio::Qos* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_6::Qos::hidl_discriminator::noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_6::Qos::hidl_discriminator::eps: { - aidl::android::hardware::radio::EpsQos eps; - if (!translate(in.eps(), &eps)) return false; - out->set(eps); - } break; - case ::android::hardware::radio::V1_6::Qos::hidl_discriminator::nr: { - aidl::android::hardware::radio::NrQos nr; - if (!translate(in.nr(), &nr)) return false; - out->set(nr); - } break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::RadioResponseInfo& in, - aidl::android::hardware::radio::RadioResponseInfo* out) { - out->type = static_cast(in.type); - out->serial = static_cast(in.serial); - out->error = static_cast(in.error); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::PortRange& in, - aidl::android::hardware::radio::PortRange* out) { - out->start = static_cast(in.start); - out->end = static_cast(in.end); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::MaybePort& in, - aidl::android::hardware::radio::MaybePort* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_6::MaybePort::hidl_discriminator::noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_6::MaybePort::hidl_discriminator::range: { - aidl::android::hardware::radio::PortRange range; - if (!translate(in.range(), &range)) return false; - out->set(range); - } break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::QosFilter& in, - aidl::android::hardware::radio::QosFilter* out) { - { - size_t size = in.localAddresses.size(); - for (size_t i = 0; i < size; i++) { - out->localAddresses.push_back(in.localAddresses[i]); - } - } - { - size_t size = in.remoteAddresses.size(); - for (size_t i = 0; i < size; i++) { - out->remoteAddresses.push_back(in.remoteAddresses[i]); - } - } - if (!translate(in.localPort, &out->localPort)) return false; - if (!translate(in.remotePort, &out->remotePort)) return false; - out->protocol = static_cast(in.protocol); - if (!translate(in.tos, &out->tos)) return false; - if (!translate(in.flowLabel, &out->flowLabel)) return false; - if (!translate(in.spi, &out->spi)) return false; - out->direction = static_cast(in.direction); - out->precedence = static_cast(in.precedence); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::QosFilter::TypeOfService& in, - aidl::android::hardware::radio::QosFilterTypeOfService* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_6::QosFilter::TypeOfService::hidl_discriminator::noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_6::QosFilter::TypeOfService::hidl_discriminator::value: - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.value() > std::numeric_limits::max() || in.value() < 0) { - return false; - } - *out = static_cast(in.value()); - break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::QosFilter::Ipv6FlowLabel& in, - aidl::android::hardware::radio::QosFilterIpv6FlowLabel* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_6::QosFilter::Ipv6FlowLabel::hidl_discriminator::noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_6::QosFilter::Ipv6FlowLabel::hidl_discriminator::value: - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.value() > std::numeric_limits::max() || in.value() < 0) { - return false; - } - *out = static_cast(in.value()); - break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::QosFilter::IpsecSpi& in, - aidl::android::hardware::radio::QosFilterIpsecSpi* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_6::QosFilter::IpsecSpi::hidl_discriminator::noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_6::QosFilter::IpsecSpi::hidl_discriminator::value: - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.value() > std::numeric_limits::max() || in.value() < 0) { - return false; - } - *out = static_cast(in.value()); - break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::QosSession& in, - aidl::android::hardware::radio::QosSession* out) { - out->qosSessionId = static_cast(in.qosSessionId); - if (!translate(in.qos, &out->qos)) return false; - { - size_t size = in.qosFilters.size(); - aidl::android::hardware::radio::QosFilter qosFilters; - for (size_t i = 0; i < size; i++) { - if (!translate(in.qosFilters[i], &qosFilters)) return false; - out->qosFilters.push_back(qosFilters); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::SetupDataCallResult& in, - aidl::android::hardware::radio::SetupDataCallResult* out) { - out->cause = static_cast(in.cause); - out->suggestedRetryTime = static_cast(in.suggestedRetryTime); - out->cid = static_cast(in.cid); - out->active = static_cast(in.active); - out->type = static_cast(in.type); - out->ifname = in.ifname; - { - size_t size = in.addresses.size(); - aidl::android::hardware::radio::LinkAddress addresses; - for (size_t i = 0; i < size; i++) { - if (!translate(in.addresses[i], &addresses)) return false; - out->addresses.push_back(addresses); - } - } - { - size_t size = in.dnses.size(); - for (size_t i = 0; i < size; i++) { - out->dnses.push_back(in.dnses[i]); - } - } - { - size_t size = in.gateways.size(); - for (size_t i = 0; i < size; i++) { - out->gateways.push_back(in.gateways[i]); - } - } - { - size_t size = in.pcscf.size(); - for (size_t i = 0; i < size; i++) { - out->pcscf.push_back(in.pcscf[i]); - } - } - out->mtuV4 = static_cast(in.mtuV4); - out->mtuV6 = static_cast(in.mtuV6); - if (!translate(in.defaultQos, &out->defaultQos)) return false; - { - size_t size = in.qosSessions.size(); - aidl::android::hardware::radio::QosSession qosSessions; - for (size_t i = 0; i < size; i++) { - if (!translate(in.qosSessions[i], &qosSessions)) return false; - out->qosSessions.push_back(qosSessions); - } - } - out->handoverFailureMode = static_cast( - in.handoverFailureMode); - out->pduSessionId = static_cast(in.pduSessionId); - if (!translate(in.sliceInfo, &out->sliceInfo)) return false; - { - size_t size = in.trafficDescriptors.size(); - aidl::android::hardware::radio::TrafficDescriptor trafficDescriptors; - for (size_t i = 0; i < size; i++) { - if (!translate(in.trafficDescriptors[i], &trafficDescriptors)) return false; - out->trafficDescriptors.push_back(trafficDescriptors); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::LinkCapacityEstimate& in, - aidl::android::hardware::radio::LinkCapacityEstimate* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.downlinkCapacityKbps > std::numeric_limits::max() || - in.downlinkCapacityKbps < 0) { - return false; - } - out->downlinkCapacityKbps = static_cast(in.downlinkCapacityKbps); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.uplinkCapacityKbps > std::numeric_limits::max() || in.uplinkCapacityKbps < 0) { - return false; - } - out->uplinkCapacityKbps = static_cast(in.uplinkCapacityKbps); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.secondaryDownlinkCapacityKbps > std::numeric_limits::max() || - in.secondaryDownlinkCapacityKbps < 0) { - return false; - } - out->secondaryDownlinkCapacityKbps = static_cast(in.secondaryDownlinkCapacityKbps); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.secondaryUplinkCapacityKbps > std::numeric_limits::max() || - in.secondaryUplinkCapacityKbps < 0) { - return false; - } - out->secondaryUplinkCapacityKbps = static_cast(in.secondaryUplinkCapacityKbps); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::NrVopsInfo& in, - aidl::android::hardware::radio::NrVopsInfo* out) { - out->vopsSupported = - static_cast(in.vopsSupported); - out->emcSupported = static_cast(in.emcSupported); - out->emfSupported = static_cast(in.emfSupported); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::LteSignalStrength& in, - aidl::android::hardware::radio::LteSignalStrength* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.base.signalStrength > std::numeric_limits::max() || - in.base.signalStrength < 0) { - return false; - } - out->signalStrength = static_cast(in.base.signalStrength); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.base.rsrp > std::numeric_limits::max() || in.base.rsrp < 0) { - return false; - } - out->rsrp = static_cast(in.base.rsrp); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.base.rsrq > std::numeric_limits::max() || in.base.rsrq < 0) { - return false; - } - out->rsrq = static_cast(in.base.rsrq); - out->rssnr = static_cast(in.base.rssnr); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.base.cqi > std::numeric_limits::max() || in.base.cqi < 0) { - return false; - } - out->cqi = static_cast(in.base.cqi); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.base.timingAdvance > std::numeric_limits::max() || in.base.timingAdvance < 0) { - return false; - } - out->timingAdvance = static_cast(in.base.timingAdvance); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.cqiTableIndex > std::numeric_limits::max() || in.cqiTableIndex < 0) { - return false; - } - out->cqiTableIndex = static_cast(in.cqiTableIndex); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::NrSignalStrength& in, - aidl::android::hardware::radio::NrSignalStrength* out) { - out->ssRsrp = static_cast(in.base.ssRsrp); - out->ssRsrq = static_cast(in.base.ssRsrq); - out->ssSinr = static_cast(in.base.ssSinr); - out->csiRsrp = static_cast(in.base.csiRsrp); - out->csiRsrq = static_cast(in.base.csiRsrq); - out->csiSinr = static_cast(in.base.csiSinr); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.csiCqiTableIndex > std::numeric_limits::max() || in.csiCqiTableIndex < 0) { - return false; - } - out->csiCqiTableIndex = static_cast(in.csiCqiTableIndex); - { - size_t size = in.csiCqiReport.size(); - for (size_t i = 0; i < size; i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.csiCqiReport[i] > std::numeric_limits::max() || in.csiCqiReport[i] < 0) { - return false; - } - out->csiCqiReport.push_back(static_cast(in.csiCqiReport[i])); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::SignalStrength& in, - aidl::android::hardware::radio::SignalStrength* out) { - if (!translate(in.gsm, &out->gsm)) return false; - if (!translate(in.cdma, &out->cdma)) return false; - if (!translate(in.evdo, &out->evdo)) return false; - if (!translate(in.lte, &out->lte)) return false; - if (!translate(in.tdscdma, &out->tdscdma)) return false; - if (!translate(in.wcdma, &out->wcdma)) return false; - if (!translate(in.nr, &out->nr)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::CellInfoLte& in, - aidl::android::hardware::radio::CellInfoLte* out) { - if (!translate(in.cellIdentityLte, &out->cellIdentityLte)) return false; - if (!translate(in.signalStrengthLte, &out->signalStrengthLte)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::CellInfoNr& in, - aidl::android::hardware::radio::CellInfoNr* out) { - if (!translate(in.cellIdentityNr, &out->cellIdentityNr)) return false; - if (!translate(in.signalStrengthNr, &out->signalStrengthNr)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::CellInfo& in, - aidl::android::hardware::radio::CellInfo* out) { - out->registered = static_cast(in.registered); - out->connectionStatus = - static_cast(in.connectionStatus); - if (!translate(in.ratSpecificInfo, &out->ratSpecificInfo)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo& in, - aidl::android::hardware::radio::CellInfoCellInfoRatSpecificInfo* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo:: - hidl_discriminator::gsm: { - aidl::android::hardware::radio::CellInfoGsm gsm; - if (!translate(in.gsm(), &gsm)) return false; - out->set(gsm); - } break; - case ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo:: - hidl_discriminator::wcdma: { - aidl::android::hardware::radio::CellInfoWcdma wcdma; - if (!translate(in.wcdma(), &wcdma)) return false; - out->set(wcdma); - } break; - case ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo:: - hidl_discriminator::tdscdma: { - aidl::android::hardware::radio::CellInfoTdscdma tdscdma; - if (!translate(in.tdscdma(), &tdscdma)) return false; - out->set( - tdscdma); - } break; - case ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo:: - hidl_discriminator::lte: { - aidl::android::hardware::radio::CellInfoLte lte; - if (!translate(in.lte(), <e)) return false; - out->set(lte); - } break; - case ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo:: - hidl_discriminator::nr: { - aidl::android::hardware::radio::CellInfoNr nr; - if (!translate(in.nr(), &nr)) return false; - out->set(nr); - } break; - case ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo:: - hidl_discriminator::cdma: { - aidl::android::hardware::radio::CellInfoCdma cdma; - if (!translate(in.cdma(), &cdma)) return false; - out->set(cdma); - } break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::NetworkScanResult& in, - aidl::android::hardware::radio::NetworkScanResult* out) { - out->status = static_cast(in.status); - out->error = static_cast(in.error); - { - size_t size = in.networkInfos.size(); - aidl::android::hardware::radio::CellInfo networkInfos; - for (size_t i = 0; i < size; i++) { - if (!translate(in.networkInfos[i], &networkInfos)) return false; - out->networkInfos.push_back(networkInfos); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::RegStateResult& in, - aidl::android::hardware::radio::RegStateResult* out) { - out->regState = static_cast(in.regState); - out->rat = static_cast(in.rat); - out->reasonForDenial = - static_cast(in.reasonForDenial); - if (!translate(in.cellIdentity, &out->cellIdentity)) return false; - out->registeredPlmn = in.registeredPlmn; - if (!translate(in.accessTechnologySpecificInfo, &out->accessTechnologySpecificInfo)) - return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::RegStateResult::AccessTechnologySpecificInfo& in, - aidl::android::hardware::radio::RegStateResultAccessTechnologySpecificInfo* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_6::RegStateResult::AccessTechnologySpecificInfo:: - hidl_discriminator::noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_6::RegStateResult::AccessTechnologySpecificInfo:: - hidl_discriminator::cdmaInfo: { - aidl::android::hardware::radio:: - RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo cdmaInfo; - if (!translate(in.cdmaInfo(), &cdmaInfo)) return false; - out->set(cdmaInfo); - } break; - case ::android::hardware::radio::V1_6::RegStateResult::AccessTechnologySpecificInfo:: - hidl_discriminator::eutranInfo: { - aidl::android::hardware::radio:: - RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo eutranInfo; - if (!translate(in.eutranInfo(), &eutranInfo)) return false; - out->set(eutranInfo); - } break; - case ::android::hardware::radio::V1_6::RegStateResult::AccessTechnologySpecificInfo:: - hidl_discriminator::ngranNrVopsInfo: { - aidl::android::hardware::radio::NrVopsInfo ngranNrVopsInfo; - if (!translate(in.ngranNrVopsInfo(), &ngranNrVopsInfo)) return false; - out->set(ngranNrVopsInfo); - } break; - case ::android::hardware::radio::V1_6::RegStateResult::AccessTechnologySpecificInfo:: - hidl_discriminator::geranDtmSupported: - out->set(static_cast(in.geranDtmSupported())); - break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate(const ::android::hardware::radio::V1_6::Call& in, - aidl::android::hardware::radio::Call* out) { - out->state = static_cast(in.base.base.state); - out->index = static_cast(in.base.base.index); - out->toa = static_cast(in.base.base.toa); - out->isMpty = static_cast(in.base.base.isMpty); - out->isMT = static_cast(in.base.base.isMT); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.base.base.als > std::numeric_limits::max() || in.base.base.als < 0) { - return false; - } - out->als = static_cast(in.base.base.als); - out->isVoice = static_cast(in.base.base.isVoice); - out->isVoicePrivacy = static_cast(in.base.base.isVoicePrivacy); - out->number = in.base.base.number; - out->numberPresentation = static_cast( - in.base.base.numberPresentation); - out->name = in.base.base.name; - out->namePresentation = static_cast( - in.base.base.namePresentation); - { - size_t size = in.base.base.uusInfo.size(); - aidl::android::hardware::radio::UusInfo uusInfo; - for (size_t i = 0; i < size; i++) { - if (!translate(in.base.base.uusInfo[i], &uusInfo)) return false; - out->uusInfo.push_back(uusInfo); - } - } - out->audioQuality = - static_cast(in.base.audioQuality); - out->forwardedNumber = in.forwardedNumber; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::PhysicalChannelConfig& in, - aidl::android::hardware::radio::PhysicalChannelConfig* out) { - out->status = static_cast(in.status); - out->rat = static_cast(in.rat); - out->downlinkChannelNumber = static_cast(in.downlinkChannelNumber); - out->uplinkChannelNumber = static_cast(in.uplinkChannelNumber); - out->cellBandwidthDownlinkKhz = static_cast(in.cellBandwidthDownlinkKhz); - out->cellBandwidthUplinkKhz = static_cast(in.cellBandwidthUplinkKhz); - { - size_t size = in.contextIds.size(); - for (size_t i = 0; i < size; i++) { - out->contextIds.push_back(static_cast(in.contextIds[i])); - } - } - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.physicalCellId > std::numeric_limits::max() || in.physicalCellId < 0) { - return false; - } - out->physicalCellId = static_cast(in.physicalCellId); - if (!translate(in.band, &out->band)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::PhysicalChannelConfig::Band& in, - aidl::android::hardware::radio::PhysicalChannelConfigBand* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_6::PhysicalChannelConfig::Band::hidl_discriminator:: - geranBand: - *out = static_cast(in.geranBand()); - break; - case ::android::hardware::radio::V1_6::PhysicalChannelConfig::Band::hidl_discriminator:: - utranBand: - *out = static_cast(in.utranBand()); - break; - case ::android::hardware::radio::V1_6::PhysicalChannelConfig::Band::hidl_discriminator:: - eutranBand: - *out = static_cast(in.eutranBand()); - break; - case ::android::hardware::radio::V1_6::PhysicalChannelConfig::Band::hidl_discriminator:: - ngranBand: - *out = static_cast(in.ngranBand()); - break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::OptionalSliceInfo& in, - aidl::android::hardware::radio::OptionalSliceInfo* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_6::OptionalSliceInfo::hidl_discriminator::noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_6::OptionalSliceInfo::hidl_discriminator::value: { - aidl::android::hardware::radio::SliceInfo value; - if (!translate(in.value(), &value)) return false; - out->set(value); - } break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::SliceInfo& in, - aidl::android::hardware::radio::SliceInfo* out) { - out->sst = static_cast(in.sst); - out->sliceDifferentiator = static_cast(in.sliceDifferentiator); - out->mappedHplmnSst = - static_cast(in.mappedHplmnSst); - out->mappedHplmnSD = static_cast(in.mappedHplmnSD); - out->status = static_cast(in.status); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::OptionalDnn& in, - aidl::android::hardware::radio::OptionalDnn* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_6::OptionalDnn::hidl_discriminator::noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_6::OptionalDnn::hidl_discriminator::value: - *out = in.value(); - break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::OptionalOsAppId& in, - aidl::android::hardware::radio::OptionalOsAppId* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_6::OptionalOsAppId::hidl_discriminator::noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_6::OptionalOsAppId::hidl_discriminator::value: { - aidl::android::hardware::radio::OsAppId value; - if (!translate(in.value(), &value)) return false; - out->set(value); - } break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::OptionalTrafficDescriptor& in, - aidl::android::hardware::radio::OptionalTrafficDescriptor* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_6::OptionalTrafficDescriptor::hidl_discriminator:: - noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_6::OptionalTrafficDescriptor::hidl_discriminator:: - value: { - aidl::android::hardware::radio::TrafficDescriptor value; - if (!translate(in.value(), &value)) return false; - out->set(value); - } break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::TrafficDescriptor& in, - aidl::android::hardware::radio::TrafficDescriptor* out) { - if (!translate(in.dnn, &out->dnn)) return false; - if (!translate(in.osAppId, &out->osAppId)) return false; - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::OsAppId& in, - aidl::android::hardware::radio::OsAppId* out) { - { - size_t size = in.osAppId.size(); - for (size_t i = 0; i < size; i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.osAppId[i] > std::numeric_limits::max() || in.osAppId[i] < 0) { - return false; - } - out->osAppId.push_back(static_cast(in.osAppId[i])); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::SlicingConfig& in, - aidl::android::hardware::radio::SlicingConfig* out) { - { - size_t size = in.urspRules.size(); - aidl::android::hardware::radio::UrspRule urspRules; - for (size_t i = 0; i < size; i++) { - if (!translate(in.urspRules[i], &urspRules)) return false; - out->urspRules.push_back(urspRules); - } - } - { - size_t size = in.sliceInfo.size(); - aidl::android::hardware::radio::SliceInfo sliceInfo; - for (size_t i = 0; i < size; i++) { - if (!translate(in.sliceInfo[i], &sliceInfo)) return false; - out->sliceInfo.push_back(sliceInfo); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::UrspRule& in, - aidl::android::hardware::radio::UrspRule* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.precedence > std::numeric_limits::max() || in.precedence < 0) { - return false; - } - out->precedence = static_cast(in.precedence); - { - size_t size = in.trafficDescriptors.size(); - aidl::android::hardware::radio::TrafficDescriptor trafficDescriptors; - for (size_t i = 0; i < size; i++) { - if (!translate(in.trafficDescriptors[i], &trafficDescriptors)) return false; - out->trafficDescriptors.push_back(trafficDescriptors); - } - } - { - size_t size = in.routeSelectionDescriptor.size(); - aidl::android::hardware::radio::RouteSelectionDescriptor routeSelectionDescriptor; - for (size_t i = 0; i < size; i++) { - if (!translate(in.routeSelectionDescriptor[i], &routeSelectionDescriptor)) return false; - out->routeSelectionDescriptor.push_back(routeSelectionDescriptor); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::RouteSelectionDescriptor& in, - aidl::android::hardware::radio::RouteSelectionDescriptor* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.precedence > std::numeric_limits::max() || in.precedence < 0) { - return false; - } - out->precedence = static_cast(in.precedence); - if (!translate(in.sessionType, &out->sessionType)) return false; - if (!translate(in.sscMode, &out->sscMode)) return false; - { - size_t size = in.sliceInfo.size(); - aidl::android::hardware::radio::SliceInfo sliceInfo; - for (size_t i = 0; i < size; i++) { - if (!translate(in.sliceInfo[i], &sliceInfo)) return false; - out->sliceInfo.push_back(sliceInfo); - } - } - { - size_t size = in.dnn.size(); - for (size_t i = 0; i < size; i++) { - out->dnn.push_back(in.dnn[i]); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::OptionalPdpProtocolType& in, - aidl::android::hardware::radio::OptionalPdpProtocolType* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_6::OptionalPdpProtocolType::hidl_discriminator::noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_6::OptionalPdpProtocolType::hidl_discriminator::value: - *out = static_cast(in.value()); - break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::OptionalSscMode& in, - aidl::android::hardware::radio::OptionalSscMode* out) { - switch (in.getDiscriminator()) { - case ::android::hardware::radio::V1_6::OptionalSscMode::hidl_discriminator::noinit: - // Nothing to translate for Monostate. - break; - case ::android::hardware::radio::V1_6::OptionalSscMode::hidl_discriminator::value: - *out = static_cast(in.value()); - break; - default: - return false; - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::ImsiEncryptionInfo& in, - aidl::android::hardware::radio::ImsiEncryptionInfo* out) { - out->mcc = in.base.mcc; - out->mnc = in.base.mnc; - { - size_t size = in.base.carrierKey.size(); - for (size_t i = 0; i < size; i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.base.carrierKey[i] > std::numeric_limits::max() || - in.base.carrierKey[i] < 0) { - return false; - } - out->carrierKey.push_back(static_cast(in.base.carrierKey[i])); - } - } - out->keyIdentifier = in.base.keyIdentifier; - out->expirationTime = static_cast(in.base.expirationTime); - out->keyType = static_cast(in.keyType); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::PhonebookRecordInfo& in, - aidl::android::hardware::radio::PhonebookRecordInfo* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.recordId > std::numeric_limits::max() || in.recordId < 0) { - return false; - } - out->recordId = static_cast(in.recordId); - out->name = in.name; - out->number = in.number; - { - size_t size = in.emails.size(); - for (size_t i = 0; i < size; i++) { - out->emails.push_back(in.emails[i]); - } - } - { - size_t size = in.additionalNumbers.size(); - for (size_t i = 0; i < size; i++) { - out->additionalNumbers.push_back(in.additionalNumbers[i]); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::PhonebookCapacity& in, - aidl::android::hardware::radio::PhonebookCapacity* out) { - out->maxAdnRecords = static_cast(in.maxAdnRecords); - out->usedAdnRecords = static_cast(in.usedAdnRecords); - out->maxEmailRecords = static_cast(in.maxEmailRecords); - out->usedEmailRecords = static_cast(in.usedEmailRecords); - out->maxAdditionalNumberRecords = static_cast(in.maxAdditionalNumberRecords); - out->usedAdditionalNumberRecords = static_cast(in.usedAdditionalNumberRecords); - out->maxNameLen = static_cast(in.maxNameLen); - out->maxNumberLen = static_cast(in.maxNumberLen); - out->maxEmailLen = static_cast(in.maxEmailLen); - out->maxAdditionalNumberLen = static_cast(in.maxAdditionalNumberLen); - return true; -} - -} // namespace android::h2a diff --git a/radio/aidl/include/android/hardware/radio/translate-ndk.h b/radio/aidl/include/android/hardware/radio/translate-ndk.h deleted file mode 100644 index b13602905f..0000000000 --- a/radio/aidl/include/android/hardware/radio/translate-ndk.h +++ /dev/null @@ -1,699 +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 -#include "aidl/android/hardware/radio/AccessNetwork.h" -#include "aidl/android/hardware/radio/ActivityStatsInfo.h" -#include "aidl/android/hardware/radio/AddressProperty.h" -#include "aidl/android/hardware/radio/ApnAuthType.h" -#include "aidl/android/hardware/radio/ApnTypes.h" -#include "aidl/android/hardware/radio/AppState.h" -#include "aidl/android/hardware/radio/AppStatus.h" -#include "aidl/android/hardware/radio/AppType.h" -#include "aidl/android/hardware/radio/AudioQuality.h" -#include "aidl/android/hardware/radio/BarringInfo.h" -#include "aidl/android/hardware/radio/BarringInfoBarringType.h" -#include "aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfo.h" -#include "aidl/android/hardware/radio/BarringInfoBarringTypeSpecificInfoConditional.h" -#include "aidl/android/hardware/radio/BarringInfoServiceType.h" -#include "aidl/android/hardware/radio/Call.h" -#include "aidl/android/hardware/radio/CallForwardInfo.h" -#include "aidl/android/hardware/radio/CallForwardInfoStatus.h" -#include "aidl/android/hardware/radio/CallPresentation.h" -#include "aidl/android/hardware/radio/CallState.h" -#include "aidl/android/hardware/radio/CardPowerState.h" -#include "aidl/android/hardware/radio/CardState.h" -#include "aidl/android/hardware/radio/CardStatus.h" -#include "aidl/android/hardware/radio/Carrier.h" -#include "aidl/android/hardware/radio/CarrierMatchType.h" -#include "aidl/android/hardware/radio/CarrierRestrictions.h" -#include "aidl/android/hardware/radio/CarrierRestrictionsWithPriority.h" -#include "aidl/android/hardware/radio/CdmaBroadcastSmsConfigInfo.h" -#include "aidl/android/hardware/radio/CdmaCallWaiting.h" -#include "aidl/android/hardware/radio/CdmaCallWaitingNumberPlan.h" -#include "aidl/android/hardware/radio/CdmaCallWaitingNumberPresentation.h" -#include "aidl/android/hardware/radio/CdmaCallWaitingNumberType.h" -#include "aidl/android/hardware/radio/CdmaDisplayInfoRecord.h" -#include "aidl/android/hardware/radio/CdmaInfoRecName.h" -#include "aidl/android/hardware/radio/CdmaInformationRecord.h" -#include "aidl/android/hardware/radio/CdmaInformationRecords.h" -#include "aidl/android/hardware/radio/CdmaLineControlInfoRecord.h" -#include "aidl/android/hardware/radio/CdmaNumberInfoRecord.h" -#include "aidl/android/hardware/radio/CdmaOtaProvisionStatus.h" -#include "aidl/android/hardware/radio/CdmaRedirectingNumberInfoRecord.h" -#include "aidl/android/hardware/radio/CdmaRedirectingReason.h" -#include "aidl/android/hardware/radio/CdmaRoamingType.h" -#include "aidl/android/hardware/radio/CdmaSignalInfoRecord.h" -#include "aidl/android/hardware/radio/CdmaSignalStrength.h" -#include "aidl/android/hardware/radio/CdmaSmsAck.h" -#include "aidl/android/hardware/radio/CdmaSmsAddress.h" -#include "aidl/android/hardware/radio/CdmaSmsDigitMode.h" -#include "aidl/android/hardware/radio/CdmaSmsErrorClass.h" -#include "aidl/android/hardware/radio/CdmaSmsMessage.h" -#include "aidl/android/hardware/radio/CdmaSmsNumberMode.h" -#include "aidl/android/hardware/radio/CdmaSmsNumberPlan.h" -#include "aidl/android/hardware/radio/CdmaSmsNumberType.h" -#include "aidl/android/hardware/radio/CdmaSmsSubaddress.h" -#include "aidl/android/hardware/radio/CdmaSmsSubaddressType.h" -#include "aidl/android/hardware/radio/CdmaSmsWriteArgs.h" -#include "aidl/android/hardware/radio/CdmaSmsWriteArgsStatus.h" -#include "aidl/android/hardware/radio/CdmaSubscriptionSource.h" -#include "aidl/android/hardware/radio/CdmaT53AudioControlInfoRecord.h" -#include "aidl/android/hardware/radio/CdmaT53ClirInfoRecord.h" -#include "aidl/android/hardware/radio/CellConfigLte.h" -#include "aidl/android/hardware/radio/CellConnectionStatus.h" -#include "aidl/android/hardware/radio/CellIdentity.h" -#include "aidl/android/hardware/radio/CellIdentityCdma.h" -#include "aidl/android/hardware/radio/CellIdentityGsm.h" -#include "aidl/android/hardware/radio/CellIdentityLte.h" -#include "aidl/android/hardware/radio/CellIdentityNr.h" -#include "aidl/android/hardware/radio/CellIdentityOperatorNames.h" -#include "aidl/android/hardware/radio/CellIdentityTdscdma.h" -#include "aidl/android/hardware/radio/CellIdentityWcdma.h" -#include "aidl/android/hardware/radio/CellInfo.h" -#include "aidl/android/hardware/radio/CellInfoCdma.h" -#include "aidl/android/hardware/radio/CellInfoCellInfoRatSpecificInfo.h" -#include "aidl/android/hardware/radio/CellInfoGsm.h" -#include "aidl/android/hardware/radio/CellInfoInfo.h" -#include "aidl/android/hardware/radio/CellInfoLte.h" -#include "aidl/android/hardware/radio/CellInfoNr.h" -#include "aidl/android/hardware/radio/CellInfoTdscdma.h" -#include "aidl/android/hardware/radio/CellInfoType.h" -#include "aidl/android/hardware/radio/CellInfoWcdma.h" -#include "aidl/android/hardware/radio/CfData.h" -#include "aidl/android/hardware/radio/ClipStatus.h" -#include "aidl/android/hardware/radio/Clir.h" -#include "aidl/android/hardware/radio/ClosedSubscriberGroupInfo.h" -#include "aidl/android/hardware/radio/DataCallFailCause.h" -#include "aidl/android/hardware/radio/DataConnActiveStatus.h" -#include "aidl/android/hardware/radio/DataProfileId.h" -#include "aidl/android/hardware/radio/DataProfileInfo.h" -#include "aidl/android/hardware/radio/DataProfileInfoType.h" -#include "aidl/android/hardware/radio/DataRegStateResult.h" -#include "aidl/android/hardware/radio/DataRegStateResultVopsInfo.h" -#include "aidl/android/hardware/radio/DataRequestReason.h" -#include "aidl/android/hardware/radio/DataThrottlingAction.h" -#include "aidl/android/hardware/radio/DeviceStateType.h" -#include "aidl/android/hardware/radio/Dial.h" -#include "aidl/android/hardware/radio/Domain.h" -#include "aidl/android/hardware/radio/EmcIndicator.h" -#include "aidl/android/hardware/radio/EmergencyCallRouting.h" -#include "aidl/android/hardware/radio/EmergencyNumber.h" -#include "aidl/android/hardware/radio/EmergencyNumberSource.h" -#include "aidl/android/hardware/radio/EmergencyServiceCategory.h" -#include "aidl/android/hardware/radio/EmfIndicator.h" -#include "aidl/android/hardware/radio/EpsQos.h" -#include "aidl/android/hardware/radio/EutranBands.h" -#include "aidl/android/hardware/radio/EvdoSignalStrength.h" -#include "aidl/android/hardware/radio/FrequencyRange.h" -#include "aidl/android/hardware/radio/GeranBands.h" -#include "aidl/android/hardware/radio/GsmBroadcastSmsConfigInfo.h" -#include "aidl/android/hardware/radio/GsmSignalStrength.h" -#include "aidl/android/hardware/radio/GsmSmsMessage.h" -#include "aidl/android/hardware/radio/HandoverFailureMode.h" -#include "aidl/android/hardware/radio/HardwareConfig.h" -#include "aidl/android/hardware/radio/HardwareConfigModem.h" -#include "aidl/android/hardware/radio/HardwareConfigSim.h" -#include "aidl/android/hardware/radio/HardwareConfigState.h" -#include "aidl/android/hardware/radio/HardwareConfigType.h" -#include "aidl/android/hardware/radio/IccIo.h" -#include "aidl/android/hardware/radio/IccIoResult.h" -#include "aidl/android/hardware/radio/ImsSmsMessage.h" -#include "aidl/android/hardware/radio/ImsiEncryptionInfo.h" -#include "aidl/android/hardware/radio/IncrementalResultsPeriodicityRange.h" -#include "aidl/android/hardware/radio/IndicationFilter.h" -#include "aidl/android/hardware/radio/KeepaliveRequest.h" -#include "aidl/android/hardware/radio/KeepaliveStatus.h" -#include "aidl/android/hardware/radio/KeepaliveStatusCode.h" -#include "aidl/android/hardware/radio/KeepaliveType.h" -#include "aidl/android/hardware/radio/LastCallFailCause.h" -#include "aidl/android/hardware/radio/LastCallFailCauseInfo.h" -#include "aidl/android/hardware/radio/LceDataInfo.h" -#include "aidl/android/hardware/radio/LceStatus.h" -#include "aidl/android/hardware/radio/LceStatusInfo.h" -#include "aidl/android/hardware/radio/LinkAddress.h" -#include "aidl/android/hardware/radio/LinkCapacityEstimate.h" -#include "aidl/android/hardware/radio/LteSignalStrength.h" -#include "aidl/android/hardware/radio/LteVopsInfo.h" -#include "aidl/android/hardware/radio/MaxSearchTimeRange.h" -#include "aidl/android/hardware/radio/MaybePort.h" -#include "aidl/android/hardware/radio/MvnoType.h" -#include "aidl/android/hardware/radio/NeighboringCell.h" -#include "aidl/android/hardware/radio/NetworkScanRequest.h" -#include "aidl/android/hardware/radio/NetworkScanResult.h" -#include "aidl/android/hardware/radio/NgranBands.h" -#include "aidl/android/hardware/radio/NrDualConnectivityState.h" -#include "aidl/android/hardware/radio/NrIndicators.h" -#include "aidl/android/hardware/radio/NrQos.h" -#include "aidl/android/hardware/radio/NrSignalStrength.h" -#include "aidl/android/hardware/radio/NrVopsInfo.h" -#include "aidl/android/hardware/radio/NvItem.h" -#include "aidl/android/hardware/radio/NvWriteItem.h" -#include "aidl/android/hardware/radio/OperatorInfo.h" -#include "aidl/android/hardware/radio/OperatorStatus.h" -#include "aidl/android/hardware/radio/OptionalCsgInfo.h" -#include "aidl/android/hardware/radio/OptionalDnn.h" -#include "aidl/android/hardware/radio/OptionalOsAppId.h" -#include "aidl/android/hardware/radio/OptionalPdpProtocolType.h" -#include "aidl/android/hardware/radio/OptionalSliceInfo.h" -#include "aidl/android/hardware/radio/OptionalSscMode.h" -#include "aidl/android/hardware/radio/OptionalTrafficDescriptor.h" -#include "aidl/android/hardware/radio/OsAppId.h" -#include "aidl/android/hardware/radio/P2Constant.h" -#include "aidl/android/hardware/radio/PbReceivedStatus.h" -#include "aidl/android/hardware/radio/PcoDataInfo.h" -#include "aidl/android/hardware/radio/PdpProtocolType.h" -#include "aidl/android/hardware/radio/PersoSubstate.h" -#include "aidl/android/hardware/radio/PhoneRestrictedState.h" -#include "aidl/android/hardware/radio/PhonebookCapacity.h" -#include "aidl/android/hardware/radio/PhonebookRecordInfo.h" -#include "aidl/android/hardware/radio/PhysicalChannelConfig.h" -#include "aidl/android/hardware/radio/PhysicalChannelConfigBand.h" -#include "aidl/android/hardware/radio/PinState.h" -#include "aidl/android/hardware/radio/PortRange.h" -#include "aidl/android/hardware/radio/PreferredNetworkType.h" -#include "aidl/android/hardware/radio/PrlIndicator.h" -#include "aidl/android/hardware/radio/PublicKeyType.h" -#include "aidl/android/hardware/radio/Qos.h" -#include "aidl/android/hardware/radio/QosBandwidth.h" -#include "aidl/android/hardware/radio/QosFilter.h" -#include "aidl/android/hardware/radio/QosFilterDirection.h" -#include "aidl/android/hardware/radio/QosFilterIpsecSpi.h" -#include "aidl/android/hardware/radio/QosFilterIpv6FlowLabel.h" -#include "aidl/android/hardware/radio/QosFilterTypeOfService.h" -#include "aidl/android/hardware/radio/QosFlowIdRange.h" -#include "aidl/android/hardware/radio/QosPortRange.h" -#include "aidl/android/hardware/radio/QosProtocol.h" -#include "aidl/android/hardware/radio/QosSession.h" -#include "aidl/android/hardware/radio/RadioAccessFamily.h" -#include "aidl/android/hardware/radio/RadioAccessNetworks.h" -#include "aidl/android/hardware/radio/RadioAccessSpecifier.h" -#include "aidl/android/hardware/radio/RadioAccessSpecifierBands.h" -#include "aidl/android/hardware/radio/RadioBandMode.h" -#include "aidl/android/hardware/radio/RadioCapability.h" -#include "aidl/android/hardware/radio/RadioCapabilityPhase.h" -#include "aidl/android/hardware/radio/RadioCapabilityStatus.h" -#include "aidl/android/hardware/radio/RadioCdmaSmsConst.h" -#include "aidl/android/hardware/radio/RadioConst.h" -#include "aidl/android/hardware/radio/RadioError.h" -#include "aidl/android/hardware/radio/RadioFrequencyInfo.h" -#include "aidl/android/hardware/radio/RadioIndicationType.h" -#include "aidl/android/hardware/radio/RadioResponseInfo.h" -#include "aidl/android/hardware/radio/RadioResponseInfoModem.h" -#include "aidl/android/hardware/radio/RadioResponseType.h" -#include "aidl/android/hardware/radio/RadioState.h" -#include "aidl/android/hardware/radio/RadioTechnology.h" -#include "aidl/android/hardware/radio/RadioTechnologyFamily.h" -#include "aidl/android/hardware/radio/RegState.h" -#include "aidl/android/hardware/radio/RegStateResult.h" -#include "aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfo.h" -#include "aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo.h" -#include "aidl/android/hardware/radio/RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo.h" -#include "aidl/android/hardware/radio/RegistrationFailCause.h" -#include "aidl/android/hardware/radio/ResetNvType.h" -#include "aidl/android/hardware/radio/RestrictedState.h" -#include "aidl/android/hardware/radio/RouteSelectionDescriptor.h" -#include "aidl/android/hardware/radio/SapApduType.h" -#include "aidl/android/hardware/radio/SapConnectRsp.h" -#include "aidl/android/hardware/radio/SapDisconnectType.h" -#include "aidl/android/hardware/radio/SapResultCode.h" -#include "aidl/android/hardware/radio/SapStatus.h" -#include "aidl/android/hardware/radio/SapTransferProtocol.h" -#include "aidl/android/hardware/radio/ScanIntervalRange.h" -#include "aidl/android/hardware/radio/ScanStatus.h" -#include "aidl/android/hardware/radio/ScanType.h" -#include "aidl/android/hardware/radio/SelectUiccSub.h" -#include "aidl/android/hardware/radio/SendSmsResult.h" -#include "aidl/android/hardware/radio/SetupDataCallResult.h" -#include "aidl/android/hardware/radio/SignalMeasurementType.h" -#include "aidl/android/hardware/radio/SignalStrength.h" -#include "aidl/android/hardware/radio/SignalThresholdInfo.h" -#include "aidl/android/hardware/radio/SimApdu.h" -#include "aidl/android/hardware/radio/SimLockMultiSimPolicy.h" -#include "aidl/android/hardware/radio/SimRefreshResult.h" -#include "aidl/android/hardware/radio/SimRefreshType.h" -#include "aidl/android/hardware/radio/SliceInfo.h" -#include "aidl/android/hardware/radio/SliceServiceType.h" -#include "aidl/android/hardware/radio/SliceStatus.h" -#include "aidl/android/hardware/radio/SlicingConfig.h" -#include "aidl/android/hardware/radio/SmsAcknowledgeFailCause.h" -#include "aidl/android/hardware/radio/SmsWriteArgs.h" -#include "aidl/android/hardware/radio/SmsWriteArgsStatus.h" -#include "aidl/android/hardware/radio/SrvccState.h" -#include "aidl/android/hardware/radio/SsInfoData.h" -#include "aidl/android/hardware/radio/SsRequestType.h" -#include "aidl/android/hardware/radio/SsServiceType.h" -#include "aidl/android/hardware/radio/SsTeleserviceType.h" -#include "aidl/android/hardware/radio/SscMode.h" -#include "aidl/android/hardware/radio/StkCcUnsolSsResult.h" -#include "aidl/android/hardware/radio/SubscriptionType.h" -#include "aidl/android/hardware/radio/SuppServiceClass.h" -#include "aidl/android/hardware/radio/SuppSvcNotification.h" -#include "aidl/android/hardware/radio/TdscdmaSignalStrength.h" -#include "aidl/android/hardware/radio/TimeStampType.h" -#include "aidl/android/hardware/radio/TrafficDescriptor.h" -#include "aidl/android/hardware/radio/TtyMode.h" -#include "aidl/android/hardware/radio/UiccSubActStatus.h" -#include "aidl/android/hardware/radio/UrspRule.h" -#include "aidl/android/hardware/radio/UssdModeType.h" -#include "aidl/android/hardware/radio/UtranBands.h" -#include "aidl/android/hardware/radio/UusDcs.h" -#include "aidl/android/hardware/radio/UusInfo.h" -#include "aidl/android/hardware/radio/UusType.h" -#include "aidl/android/hardware/radio/VoiceRegStateResult.h" -#include "aidl/android/hardware/radio/VopsIndicator.h" -#include "aidl/android/hardware/radio/WcdmaSignalStrength.h" -#include "android/hardware/radio/1.0/types.h" -#include "android/hardware/radio/1.1/types.h" -#include "android/hardware/radio/1.2/types.h" -#include "android/hardware/radio/1.3/types.h" -#include "android/hardware/radio/1.4/types.h" -#include "android/hardware/radio/1.5/types.h" -#include "android/hardware/radio/1.6/types.h" - -namespace android::h2a { - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::IccIo& in, - aidl::android::hardware::radio::IccIo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::NeighboringCell& in, - aidl::android::hardware::radio::NeighboringCell* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::UusInfo& in, - aidl::android::hardware::radio::UusInfo* out); -__attribute__((warn_unused_result)) bool translate(const ::android::hardware::radio::V1_0::Dial& in, - aidl::android::hardware::radio::Dial* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::LastCallFailCauseInfo& in, - aidl::android::hardware::radio::LastCallFailCauseInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::GsmSignalStrength& in, - aidl::android::hardware::radio::GsmSignalStrength* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaSignalStrength& in, - aidl::android::hardware::radio::CdmaSignalStrength* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::EvdoSignalStrength& in, - aidl::android::hardware::radio::EvdoSignalStrength* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::SendSmsResult& in, - aidl::android::hardware::radio::SendSmsResult* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::IccIoResult& in, - aidl::android::hardware::radio::IccIoResult* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CallForwardInfo& in, - aidl::android::hardware::radio::CallForwardInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::OperatorInfo& in, - aidl::android::hardware::radio::OperatorInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::SmsWriteArgs& in, - aidl::android::hardware::radio::SmsWriteArgs* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaSmsAddress& in, - aidl::android::hardware::radio::CdmaSmsAddress* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaSmsSubaddress& in, - aidl::android::hardware::radio::CdmaSmsSubaddress* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaSmsMessage& in, - aidl::android::hardware::radio::CdmaSmsMessage* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaSmsAck& in, - aidl::android::hardware::radio::CdmaSmsAck* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaBroadcastSmsConfigInfo& in, - aidl::android::hardware::radio::CdmaBroadcastSmsConfigInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaSmsWriteArgs& in, - aidl::android::hardware::radio::CdmaSmsWriteArgs* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::GsmBroadcastSmsConfigInfo& in, - aidl::android::hardware::radio::GsmBroadcastSmsConfigInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::GsmSmsMessage& in, - aidl::android::hardware::radio::GsmSmsMessage* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::ImsSmsMessage& in, - aidl::android::hardware::radio::ImsSmsMessage* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::SimApdu& in, - aidl::android::hardware::radio::SimApdu* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::NvWriteItem& in, - aidl::android::hardware::radio::NvWriteItem* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::SelectUiccSub& in, - aidl::android::hardware::radio::SelectUiccSub* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::HardwareConfigModem& in, - aidl::android::hardware::radio::HardwareConfigModem* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::HardwareConfigSim& in, - aidl::android::hardware::radio::HardwareConfigSim* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::HardwareConfig& in, - aidl::android::hardware::radio::HardwareConfig* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::LceStatusInfo& in, - aidl::android::hardware::radio::LceStatusInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::LceDataInfo& in, - aidl::android::hardware::radio::LceDataInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::ActivityStatsInfo& in, - aidl::android::hardware::radio::ActivityStatsInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::Carrier& in, - aidl::android::hardware::radio::Carrier* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CarrierRestrictions& in, - aidl::android::hardware::radio::CarrierRestrictions* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::SuppSvcNotification& in, - aidl::android::hardware::radio::SuppSvcNotification* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::SimRefreshResult& in, - aidl::android::hardware::radio::SimRefreshResult* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaSignalInfoRecord& in, - aidl::android::hardware::radio::CdmaSignalInfoRecord* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaCallWaiting& in, - aidl::android::hardware::radio::CdmaCallWaiting* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaDisplayInfoRecord& in, - aidl::android::hardware::radio::CdmaDisplayInfoRecord* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaNumberInfoRecord& in, - aidl::android::hardware::radio::CdmaNumberInfoRecord* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaRedirectingNumberInfoRecord& in, - aidl::android::hardware::radio::CdmaRedirectingNumberInfoRecord* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaLineControlInfoRecord& in, - aidl::android::hardware::radio::CdmaLineControlInfoRecord* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaT53ClirInfoRecord& in, - aidl::android::hardware::radio::CdmaT53ClirInfoRecord* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaT53AudioControlInfoRecord& in, - aidl::android::hardware::radio::CdmaT53AudioControlInfoRecord* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaInformationRecord& in, - aidl::android::hardware::radio::CdmaInformationRecord* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CdmaInformationRecords& in, - aidl::android::hardware::radio::CdmaInformationRecords* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::CfData& in, - aidl::android::hardware::radio::CfData* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::SsInfoData& in, - aidl::android::hardware::radio::SsInfoData* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::StkCcUnsolSsResult& in, - aidl::android::hardware::radio::StkCcUnsolSsResult* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_0::PcoDataInfo& in, - aidl::android::hardware::radio::PcoDataInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_1::KeepaliveRequest& in, - aidl::android::hardware::radio::KeepaliveRequest* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_1::KeepaliveStatus& in, - aidl::android::hardware::radio::KeepaliveStatus* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_2::CellIdentityOperatorNames& in, - aidl::android::hardware::radio::CellIdentityOperatorNames* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_2::CellIdentityCdma& in, - aidl::android::hardware::radio::CellIdentityCdma* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_2::CellInfoCdma& in, - aidl::android::hardware::radio::CellInfoCdma* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_2::WcdmaSignalStrength& in, - aidl::android::hardware::radio::WcdmaSignalStrength* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_2::TdscdmaSignalStrength& in, - aidl::android::hardware::radio::TdscdmaSignalStrength* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_2::VoiceRegStateResult& in, - aidl::android::hardware::radio::VoiceRegStateResult* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_3::RadioResponseInfoModem& in, - aidl::android::hardware::radio::RadioResponseInfoModem* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::EmergencyNumber& in, - aidl::android::hardware::radio::EmergencyNumber* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::RadioFrequencyInfo& in, - aidl::android::hardware::radio::RadioFrequencyInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::LteVopsInfo& in, - aidl::android::hardware::radio::LteVopsInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::NrIndicators& in, - aidl::android::hardware::radio::NrIndicators* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::DataRegStateResult& in, - aidl::android::hardware::radio::DataRegStateResult* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::DataRegStateResult::VopsInfo& in, - aidl::android::hardware::radio::DataRegStateResultVopsInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::CellConfigLte& in, - aidl::android::hardware::radio::CellConfigLte* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::CellInfo::Info& in, - aidl::android::hardware::radio::CellInfoInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::RadioCapability& in, - aidl::android::hardware::radio::RadioCapability* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_4::CarrierRestrictionsWithPriority& in, - aidl::android::hardware::radio::CarrierRestrictionsWithPriority* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::RadioAccessSpecifier& in, - aidl::android::hardware::radio::RadioAccessSpecifier* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands& in, - aidl::android::hardware::radio::RadioAccessSpecifierBands* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::SignalThresholdInfo& in, - aidl::android::hardware::radio::SignalThresholdInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::NetworkScanRequest& in, - aidl::android::hardware::radio::NetworkScanRequest* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::DataProfileInfo& in, - aidl::android::hardware::radio::DataProfileInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::LinkAddress& in, - aidl::android::hardware::radio::LinkAddress* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::ClosedSubscriberGroupInfo& in, - aidl::android::hardware::radio::ClosedSubscriberGroupInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::OptionalCsgInfo& in, - aidl::android::hardware::radio::OptionalCsgInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellIdentityGsm& in, - aidl::android::hardware::radio::CellIdentityGsm* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellIdentityWcdma& in, - aidl::android::hardware::radio::CellIdentityWcdma* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellIdentityTdscdma& in, - aidl::android::hardware::radio::CellIdentityTdscdma* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellIdentityLte& in, - aidl::android::hardware::radio::CellIdentityLte* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellIdentityNr& in, - aidl::android::hardware::radio::CellIdentityNr* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellInfoGsm& in, - aidl::android::hardware::radio::CellInfoGsm* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellInfoWcdma& in, - aidl::android::hardware::radio::CellInfoWcdma* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellInfoTdscdma& in, - aidl::android::hardware::radio::CellInfoTdscdma* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CellIdentity& in, - aidl::android::hardware::radio::CellIdentity* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::BarringInfo& in, - aidl::android::hardware::radio::BarringInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::BarringInfo::BarringTypeSpecificInfo::Conditional& - in, - aidl::android::hardware::radio::BarringInfoBarringTypeSpecificInfoConditional* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::BarringInfo::BarringTypeSpecificInfo& in, - aidl::android::hardware::radio::BarringInfoBarringTypeSpecificInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::RegStateResult::AccessTechnologySpecificInfo:: - Cdma2000RegistrationInfo& in, - aidl::android::hardware::radio:: - RegStateResultAccessTechnologySpecificInfoCdma2000RegistrationInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::RegStateResult::AccessTechnologySpecificInfo:: - EutranRegistrationInfo& in, - aidl::android::hardware::radio:: - RegStateResultAccessTechnologySpecificInfoEutranRegistrationInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::AppStatus& in, - aidl::android::hardware::radio::AppStatus* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_5::CardStatus& in, - aidl::android::hardware::radio::CardStatus* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::QosBandwidth& in, - aidl::android::hardware::radio::QosBandwidth* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::EpsQos& in, - aidl::android::hardware::radio::EpsQos* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::NrQos& in, - aidl::android::hardware::radio::NrQos* out); -__attribute__((warn_unused_result)) bool translate(const ::android::hardware::radio::V1_6::Qos& in, - aidl::android::hardware::radio::Qos* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::RadioResponseInfo& in, - aidl::android::hardware::radio::RadioResponseInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::PortRange& in, - aidl::android::hardware::radio::PortRange* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::MaybePort& in, - aidl::android::hardware::radio::MaybePort* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::QosFilter& in, - aidl::android::hardware::radio::QosFilter* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::QosFilter::TypeOfService& in, - aidl::android::hardware::radio::QosFilterTypeOfService* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::QosFilter::Ipv6FlowLabel& in, - aidl::android::hardware::radio::QosFilterIpv6FlowLabel* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::QosFilter::IpsecSpi& in, - aidl::android::hardware::radio::QosFilterIpsecSpi* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::QosSession& in, - aidl::android::hardware::radio::QosSession* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::SetupDataCallResult& in, - aidl::android::hardware::radio::SetupDataCallResult* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::LinkCapacityEstimate& in, - aidl::android::hardware::radio::LinkCapacityEstimate* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::NrVopsInfo& in, - aidl::android::hardware::radio::NrVopsInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::LteSignalStrength& in, - aidl::android::hardware::radio::LteSignalStrength* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::NrSignalStrength& in, - aidl::android::hardware::radio::NrSignalStrength* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::SignalStrength& in, - aidl::android::hardware::radio::SignalStrength* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::CellInfoLte& in, - aidl::android::hardware::radio::CellInfoLte* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::CellInfoNr& in, - aidl::android::hardware::radio::CellInfoNr* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::CellInfo& in, - aidl::android::hardware::radio::CellInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::CellInfo::CellInfoRatSpecificInfo& in, - aidl::android::hardware::radio::CellInfoCellInfoRatSpecificInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::NetworkScanResult& in, - aidl::android::hardware::radio::NetworkScanResult* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::RegStateResult& in, - aidl::android::hardware::radio::RegStateResult* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::RegStateResult::AccessTechnologySpecificInfo& in, - aidl::android::hardware::radio::RegStateResultAccessTechnologySpecificInfo* out); -__attribute__((warn_unused_result)) bool translate(const ::android::hardware::radio::V1_6::Call& in, - aidl::android::hardware::radio::Call* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::PhysicalChannelConfig& in, - aidl::android::hardware::radio::PhysicalChannelConfig* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::PhysicalChannelConfig::Band& in, - aidl::android::hardware::radio::PhysicalChannelConfigBand* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::OptionalSliceInfo& in, - aidl::android::hardware::radio::OptionalSliceInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::SliceInfo& in, - aidl::android::hardware::radio::SliceInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::OptionalDnn& in, - aidl::android::hardware::radio::OptionalDnn* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::OptionalOsAppId& in, - aidl::android::hardware::radio::OptionalOsAppId* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::OptionalTrafficDescriptor& in, - aidl::android::hardware::radio::OptionalTrafficDescriptor* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::TrafficDescriptor& in, - aidl::android::hardware::radio::TrafficDescriptor* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::OsAppId& in, - aidl::android::hardware::radio::OsAppId* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::SlicingConfig& in, - aidl::android::hardware::radio::SlicingConfig* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::UrspRule& in, - aidl::android::hardware::radio::UrspRule* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::RouteSelectionDescriptor& in, - aidl::android::hardware::radio::RouteSelectionDescriptor* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::OptionalPdpProtocolType& in, - aidl::android::hardware::radio::OptionalPdpProtocolType* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::OptionalSscMode& in, - aidl::android::hardware::radio::OptionalSscMode* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::ImsiEncryptionInfo& in, - aidl::android::hardware::radio::ImsiEncryptionInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::PhonebookRecordInfo& in, - aidl::android::hardware::radio::PhonebookRecordInfo* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::radio::V1_6::PhonebookCapacity& in, - aidl::android::hardware::radio::PhonebookCapacity* out); - -} // namespace android::h2a -- GitLab From 59393a9ce7790bf42d0368d394339a8bbb17efb9 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 2 Sep 2021 12:14:25 -0700 Subject: [PATCH 137/825] Define IVehicle AIDL interface. Define IVehicle AIDL interface according to new interface design doc. Test: Local build Bug: 198664004 Change-Id: Ic757f969ccce6d9dcffc6e7cd19f55f86a41f435 --- automotive/vehicle/aidl/Android.bp | 5 +- .../automotive/vehicle/CreateUserRequest.aidl | 41 ++++ .../vehicle/CreateUserResponse.aidl | 40 ++++ .../automotive/vehicle/CreateUserStatus.aidl | 39 ++++ .../automotive/vehicle/CustomInputType.aidl | 47 ++++ .../vehicle/DiagnosticFloatSensorIndex.aidl | 108 +++++++++ .../vehicle/DiagnosticIntegerSensorIndex.aidl | 69 ++++++ .../ElectronicTollCollectionCardStatus.aidl | 41 ++++ .../ElectronicTollCollectionCardType.aidl | 40 ++++ .../automotive/vehicle/EvConnectorType.aidl | 50 ++++ .../vehicle/EvsServiceRequestIndex.aidl | 39 ++++ .../automotive/vehicle/EvsServiceState.aidl | 39 ++++ .../automotive/vehicle/EvsServiceType.aidl | 39 ++++ .../hardware/automotive/vehicle/FuelType.aidl | 50 ++++ .../automotive/vehicle/GetValueRequests.aidl | 40 ++++ .../automotive/vehicle/GetValueResult.aidl | 40 ++++ .../automotive/vehicle/GetValueResults.aidl | 39 ++++ .../hardware/automotive/vehicle/IVehicle.aidl | 46 ++++ .../automotive/vehicle/IVehicleCallback.aidl | 41 ++++ .../vehicle/InitialUserInfoRequest.aidl | 40 ++++ .../vehicle/InitialUserInfoRequestType.aidl | 42 ++++ .../vehicle/InitialUserInfoResponse.aidl | 42 ++++ .../InitialUserInfoResponseAction.aidl | 40 ++++ .../vehicle/Obd2CommonIgnitionMonitors.aidl | 43 ++++ .../Obd2CompressionIgnitionMonitors.aidl | 55 +++++ .../vehicle/Obd2FuelSystemStatus.aidl | 42 ++++ .../automotive/vehicle/Obd2FuelType.aidl | 61 +++++ .../vehicle/Obd2IgnitionMonitorKind.aidl | 39 ++++ .../vehicle/Obd2SecondaryAirStatus.aidl | 41 ++++ .../vehicle/Obd2SparkIgnitionMonitors.aidl | 59 +++++ .../automotive/vehicle/PortLocationType.aidl | 44 ++++ .../vehicle/ProcessTerminationReason.aidl | 40 ++++ .../automotive/vehicle/RawPropValues.aidl | 42 ++++ .../automotive/vehicle/RemoveUserRequest.aidl | 40 ++++ .../automotive/vehicle/RotaryInputType.aidl | 39 ++++ .../automotive/vehicle/SetValueRequest.aidl | 39 ++++ .../automotive/vehicle/SetValueRequests.aidl | 39 ++++ .../automotive/vehicle/SetValueResult.aidl | 39 ++++ .../automotive/vehicle/SetValueResults.aidl | 39 ++++ .../automotive/vehicle/StatusCode.aidl | 43 ++++ .../automotive/vehicle/SubscribeOptions.aidl | 40 ++++ .../vehicle/SwitchUserMessageType.aidl | 43 ++++ .../automotive/vehicle/SwitchUserRequest.aidl | 41 ++++ .../vehicle/SwitchUserResponse.aidl | 41 ++++ .../automotive/vehicle/SwitchUserStatus.aidl | 39 ++++ .../automotive/vehicle/UserFlags.aidl | 44 ++++ .../UserIdentificationAssociation.aidl | 39 ++++ ...UserIdentificationAssociationSetValue.aidl | 41 ++++ .../UserIdentificationAssociationType.aidl | 43 ++++ .../UserIdentificationAssociationValue.aidl | 41 ++++ .../vehicle/UserIdentificationGetRequest.aidl | 41 ++++ .../vehicle/UserIdentificationResponse.aidl | 41 ++++ .../UserIdentificationSetAssociation.aidl | 39 ++++ .../vehicle/UserIdentificationSetRequest.aidl | 41 ++++ .../hardware/automotive/vehicle/UserInfo.aidl | 39 ++++ .../automotive/vehicle/UsersInfo.aidl | 40 ++++ .../VehicleApPowerStateConfigFlag.aidl | 39 ++++ .../vehicle/VehicleApPowerStateReport.aidl | 45 ++++ .../vehicle/VehicleApPowerStateReq.aidl | 41 ++++ .../vehicle/VehicleApPowerStateReqIndex.aidl | 39 ++++ .../VehicleApPowerStateShutdownParam.aidl | 41 ++++ .../automotive/vehicle/VehicleArea.aidl | 44 ++++ .../automotive/vehicle/VehicleAreaConfig.aidl | 44 ++++ .../automotive/vehicle/VehicleAreaDoor.aidl | 45 ++++ .../automotive/vehicle/VehicleAreaMirror.aidl | 40 ++++ .../automotive/vehicle/VehicleAreaSeat.aidl | 46 ++++ .../automotive/vehicle/VehicleAreaWheel.aidl | 42 ++++ .../automotive/vehicle/VehicleAreaWindow.aidl | 47 ++++ .../automotive/vehicle/VehicleDisplay.aidl | 39 ++++ .../automotive/vehicle/VehicleGear.aidl | 51 +++++ .../vehicle/VehicleHvacFanDirection.aidl | 43 ++++ .../vehicle/VehicleHwKeyInputAction.aidl | 39 ++++ .../vehicle/VehicleIgnitionState.aidl | 43 ++++ .../automotive/vehicle/VehicleLightState.aidl | 40 ++++ .../vehicle/VehicleLightSwitch.aidl | 41 ++++ .../automotive/vehicle/VehicleOilLevel.aidl | 42 ++++ .../automotive/vehicle/VehiclePropConfig.aidl | 45 ++++ .../vehicle/VehiclePropConfigs.aidl | 39 ++++ .../automotive/vehicle/VehiclePropError.aidl | 40 ++++ .../automotive/vehicle/VehiclePropErrors.aidl | 39 ++++ .../automotive/vehicle/VehiclePropValue.aidl | 42 ++++ .../automotive/vehicle/VehiclePropValues.aidl | 40 ++++ .../automotive/vehicle/VehicleProperty.aidl | 196 ++++++++++++++++ .../vehicle/VehiclePropertyAccess.aidl | 41 ++++ .../vehicle/VehiclePropertyChangeMode.aidl | 40 ++++ .../vehicle/VehiclePropertyGroup.aidl | 40 ++++ .../vehicle/VehiclePropertyStatus.aidl | 40 ++++ .../vehicle/VehiclePropertyType.aidl | 48 ++++ .../vehicle/VehicleSeatOccupancyState.aidl | 40 ++++ .../automotive/vehicle/VehicleTurnSignal.aidl | 40 ++++ .../automotive/vehicle/VehicleUnit.aidl | 69 ++++++ .../vehicle/VehicleVendorPermission.aidl | 75 ++++++ ...msAvailabilityStateIntegerValuesIndex.aidl | 41 ++++ .../VmsBaseMessageIntegerValuesIndex.aidl | 38 ++++ .../automotive/vehicle/VmsMessageType.aidl | 54 +++++ ...LayerAndPublisherIdIntegerValuesIndex.aidl | 42 ++++ ...VmsMessageWithLayerIntegerValuesIndex.aidl | 41 ++++ .../VmsOfferingMessageIntegerValuesIndex.aidl | 41 ++++ ...ublisherInformationIntegerValuesIndex.aidl | 39 ++++ ...StartSessionMessageIntegerValuesIndex.aidl | 40 ++++ ...sSubscriptionsStateIntegerValuesIndex.aidl | 42 ++++ .../automotive/vehicle/CreateUserRequest.aidl | 2 +- .../vehicle/CreateUserResponse.aidl | 4 +- .../automotive/vehicle/CreateUserStatus.aidl | 2 +- .../automotive/vehicle/CustomInputType.aidl | 2 +- .../vehicle/DiagnosticFloatSensorIndex.aidl | 2 +- .../vehicle/DiagnosticIntegerSensorIndex.aidl | 2 +- .../ElectronicTollCollectionCardStatus.aidl | 2 +- .../ElectronicTollCollectionCardType.aidl | 2 +- .../automotive/vehicle/EvConnectorType.aidl | 2 +- .../vehicle/EvsServiceRequestIndex.aidl | 2 +- .../automotive/vehicle/EvsServiceState.aidl | 2 +- .../automotive/vehicle/EvsServiceType.aidl | 2 +- .../hardware/automotive/vehicle/FuelType.aidl | 2 +- .../automotive/vehicle/GetValueRequests.aidl | 35 +++ .../automotive/vehicle/GetValueResult.aidl | 32 +++ .../automotive/vehicle/GetValueResults.aidl | 30 +++ .../hardware/automotive/vehicle/IVehicle.aidl | 215 +++++++++++++----- .../automotive/vehicle/IVehicleCallback.aidl | 87 +++++-- .../vehicle/InitialUserInfoRequest.aidl | 4 +- .../vehicle/InitialUserInfoRequestType.aidl | 3 +- .../vehicle/InitialUserInfoResponse.aidl | 4 +- .../InitialUserInfoResponseAction.aidl | 2 +- .../vehicle/Obd2CommonIgnitionMonitors.aidl | 2 +- .../Obd2CompressionIgnitionMonitors.aidl | 2 +- .../vehicle/Obd2FuelSystemStatus.aidl | 2 +- .../automotive/vehicle/Obd2FuelType.aidl | 2 +- .../vehicle/Obd2IgnitionMonitorKind.aidl | 2 +- .../vehicle/Obd2SecondaryAirStatus.aidl | 2 +- .../vehicle/Obd2SparkIgnitionMonitors.aidl | 2 +- .../automotive/vehicle/PortLocationType.aidl | 2 +- .../vehicle/ProcessTerminationReason.aidl | 2 +- ...pValueRawValue.aidl => RawPropValues.aidl} | 28 +-- .../automotive/vehicle/RemoveUserRequest.aidl | 2 +- .../automotive/vehicle/RotaryInputType.aidl | 2 +- .../automotive/vehicle/SetValueRequest.aidl | 29 +++ .../automotive/vehicle/SetValueRequests.aidl | 30 +++ .../automotive/vehicle/SetValueResult.aidl | 27 +++ .../automotive/vehicle/SetValueResults.aidl | 30 +++ .../automotive/vehicle/StatusCode.aidl | 2 +- .../automotive/vehicle/SubscribeFlags.aidl | 43 ---- .../automotive/vehicle/SubscribeOptions.aidl | 13 +- .../vehicle/SwitchUserMessageType.aidl | 3 +- .../automotive/vehicle/SwitchUserRequest.aidl | 4 +- .../vehicle/SwitchUserResponse.aidl | 6 +- .../automotive/vehicle/SwitchUserStatus.aidl | 2 +- .../automotive/vehicle/UserFlags.aidl | 2 +- .../UserIdentificationAssociation.aidl | 2 +- ...UserIdentificationAssociationSetValue.aidl | 2 +- .../UserIdentificationAssociationType.aidl | 2 +- .../UserIdentificationAssociationValue.aidl | 2 +- .../vehicle/UserIdentificationGetRequest.aidl | 2 +- .../vehicle/UserIdentificationResponse.aidl | 2 +- .../UserIdentificationSetAssociation.aidl | 2 +- .../vehicle/UserIdentificationSetRequest.aidl | 2 +- .../hardware/automotive/vehicle/UserInfo.aidl | 2 +- .../automotive/vehicle/UsersInfo.aidl | 2 +- .../VehicleApPowerStateConfigFlag.aidl | 2 +- .../vehicle/VehicleApPowerStateReport.aidl | 2 +- .../vehicle/VehicleApPowerStateReq.aidl | 2 +- .../vehicle/VehicleApPowerStateReqIndex.aidl | 2 +- .../VehicleApPowerStateShutdownParam.aidl | 2 +- .../automotive/vehicle/VehicleArea.aidl | 2 +- .../automotive/vehicle/VehicleAreaConfig.aidl | 2 +- .../automotive/vehicle/VehicleAreaDoor.aidl | 2 +- .../automotive/vehicle/VehicleAreaMirror.aidl | 2 +- .../automotive/vehicle/VehicleAreaSeat.aidl | 2 +- .../automotive/vehicle/VehicleAreaWheel.aidl | 2 +- .../automotive/vehicle/VehicleAreaWindow.aidl | 2 +- .../automotive/vehicle/VehicleDisplay.aidl | 2 +- .../automotive/vehicle/VehicleGear.aidl | 2 +- .../vehicle/VehicleHvacFanDirection.aidl | 2 +- .../vehicle/VehicleHwKeyInputAction.aidl | 2 +- .../vehicle/VehicleIgnitionState.aidl | 2 +- .../automotive/vehicle/VehicleLightState.aidl | 2 +- .../vehicle/VehicleLightSwitch.aidl | 2 +- .../automotive/vehicle/VehicleOilLevel.aidl | 2 +- .../automotive/vehicle/VehiclePropConfig.aidl | 2 +- .../vehicle/VehiclePropConfigs.aidl | 31 +++ .../automotive/vehicle/VehiclePropError.aidl | 29 +++ .../automotive/vehicle/VehiclePropErrors.aidl | 29 +++ .../automotive/vehicle/VehiclePropValue.aidl | 26 +-- .../automotive/vehicle/VehiclePropValues.aidl | 35 +++ .../automotive/vehicle/VehicleProperty.aidl | 2 +- .../vehicle/VehiclePropertyAccess.aidl | 2 +- .../vehicle/VehiclePropertyChangeMode.aidl | 2 +- .../vehicle/VehiclePropertyGroup.aidl | 2 +- .../vehicle/VehiclePropertyStatus.aidl | 2 +- .../vehicle/VehiclePropertyType.aidl | 2 +- .../vehicle/VehicleSeatOccupancyState.aidl | 2 +- .../automotive/vehicle/VehicleTurnSignal.aidl | 2 +- .../automotive/vehicle/VehicleUnit.aidl | 2 +- .../vehicle/VehicleVendorPermission.aidl | 2 +- ...msAvailabilityStateIntegerValuesIndex.aidl | 2 +- .../VmsBaseMessageIntegerValuesIndex.aidl | 2 +- .../automotive/vehicle/VmsMessageType.aidl | 2 +- ...LayerAndPublisherIdIntegerValuesIndex.aidl | 2 +- ...VmsMessageWithLayerIntegerValuesIndex.aidl | 2 +- .../VmsOfferingMessageIntegerValuesIndex.aidl | 2 +- ...ublisherInformationIntegerValuesIndex.aidl | 2 +- ...StartSessionMessageIntegerValuesIndex.aidl | 2 +- ...sSubscriptionsStateIntegerValuesIndex.aidl | 2 +- 202 files changed, 5183 insertions(+), 265 deletions(-) create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserStatus.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CustomInputType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvConnectorType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceState.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/FuelType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueRequests.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueResult.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueResults.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/IVehicle.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/IVehicleCallback.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/PortLocationType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RawPropValues.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RotaryInputType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueRequests.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueResult.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueResults.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/StatusCode.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SubscribeOptions.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserStatus.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserFlags.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserInfo.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UsersInfo.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleArea.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleDisplay.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleGear.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightState.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleOilLevel.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropConfig.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropError.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropErrors.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropValue.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropValues.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequests.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResult.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResults.aidl rename automotive/vehicle/aidl/android/hardware/automotive/vehicle/{VehiclePropValueRawValue.aidl => RawPropValues.aidl} (65%) create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequest.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequests.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResult.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResults.aidl delete mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeFlags.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropError.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropErrors.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValues.aidl diff --git a/automotive/vehicle/aidl/Android.bp b/automotive/vehicle/aidl/Android.bp index 477f8ed3e6..ca8afb08b9 100644 --- a/automotive/vehicle/aidl/Android.bp +++ b/automotive/vehicle/aidl/Android.bp @@ -27,11 +27,10 @@ aidl_interface { srcs: [ "android/hardware/automotive/vehicle/**/*.aidl", ], - // TODO(b/148703287) Make it stable with new APIs - unstable: true, + stability: "vintf", backend: { cpp: { - enabled: true, + enabled: false, }, java: { sdk_version: "module_current", diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl new file mode 100644 index 0000000000..54c65bae44 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserRequest.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 -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; +@VintfStability +parcelable CreateUserRequest { + int requestId; + android.hardware.automotive.vehicle.UserInfo newUserInfo; + @utf8InCpp String newUserName; + android.hardware.automotive.vehicle.UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl new file mode 100644 index 0000000000..6126f99759 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserResponse.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 -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; +@VintfStability +parcelable CreateUserResponse { + int requestId; + android.hardware.automotive.vehicle.CreateUserStatus status = android.hardware.automotive.vehicle.CreateUserStatus.SUCCESS; + @utf8InCpp String errorMessage; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserStatus.aidl new file mode 100644 index 0000000000..4c3b751656 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserStatus.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 -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 CreateUserStatus { + SUCCESS = 1, + FAILURE = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CustomInputType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CustomInputType.aidl new file mode 100644 index 0000000000..4decb6985d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CustomInputType.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 -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 CustomInputType { + CUSTOM_EVENT_F1 = 1001, + CUSTOM_EVENT_F2 = 1002, + CUSTOM_EVENT_F3 = 1003, + CUSTOM_EVENT_F4 = 1004, + CUSTOM_EVENT_F5 = 1005, + CUSTOM_EVENT_F6 = 1006, + CUSTOM_EVENT_F7 = 1007, + CUSTOM_EVENT_F8 = 1008, + CUSTOM_EVENT_F9 = 1009, + CUSTOM_EVENT_F10 = 1010, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl new file mode 100644 index 0000000000..9704704eab --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl @@ -0,0 +1,108 @@ +/* + * 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 -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 DiagnosticFloatSensorIndex { + CALCULATED_ENGINE_LOAD = 0, + ENGINE_COOLANT_TEMPERATURE = 1, + SHORT_TERM_FUEL_TRIM_BANK1 = 2, + LONG_TERM_FUEL_TRIM_BANK1 = 3, + SHORT_TERM_FUEL_TRIM_BANK2 = 4, + LONG_TERM_FUEL_TRIM_BANK2 = 5, + FUEL_PRESSURE = 6, + INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 7, + ENGINE_RPM = 8, + VEHICLE_SPEED = 9, + TIMING_ADVANCE = 10, + MAF_AIR_FLOW_RATE = 11, + THROTTLE_POSITION = 12, + OXYGEN_SENSOR1_VOLTAGE = 13, + OXYGEN_SENSOR1_SHORT_TERM_FUEL_TRIM = 14, + OXYGEN_SENSOR1_FUEL_AIR_EQUIVALENCE_RATIO = 15, + OXYGEN_SENSOR2_VOLTAGE = 16, + OXYGEN_SENSOR2_SHORT_TERM_FUEL_TRIM = 17, + OXYGEN_SENSOR2_FUEL_AIR_EQUIVALENCE_RATIO = 18, + OXYGEN_SENSOR3_VOLTAGE = 19, + OXYGEN_SENSOR3_SHORT_TERM_FUEL_TRIM = 20, + OXYGEN_SENSOR3_FUEL_AIR_EQUIVALENCE_RATIO = 21, + OXYGEN_SENSOR4_VOLTAGE = 22, + OXYGEN_SENSOR4_SHORT_TERM_FUEL_TRIM = 23, + OXYGEN_SENSOR4_FUEL_AIR_EQUIVALENCE_RATIO = 24, + OXYGEN_SENSOR5_VOLTAGE = 25, + OXYGEN_SENSOR5_SHORT_TERM_FUEL_TRIM = 26, + OXYGEN_SENSOR5_FUEL_AIR_EQUIVALENCE_RATIO = 27, + OXYGEN_SENSOR6_VOLTAGE = 28, + OXYGEN_SENSOR6_SHORT_TERM_FUEL_TRIM = 29, + OXYGEN_SENSOR6_FUEL_AIR_EQUIVALENCE_RATIO = 30, + OXYGEN_SENSOR7_VOLTAGE = 31, + OXYGEN_SENSOR7_SHORT_TERM_FUEL_TRIM = 32, + OXYGEN_SENSOR7_FUEL_AIR_EQUIVALENCE_RATIO = 33, + OXYGEN_SENSOR8_VOLTAGE = 34, + OXYGEN_SENSOR8_SHORT_TERM_FUEL_TRIM = 35, + OXYGEN_SENSOR8_FUEL_AIR_EQUIVALENCE_RATIO = 36, + FUEL_RAIL_PRESSURE = 37, + FUEL_RAIL_GAUGE_PRESSURE = 38, + COMMANDED_EXHAUST_GAS_RECIRCULATION = 39, + EXHAUST_GAS_RECIRCULATION_ERROR = 40, + COMMANDED_EVAPORATIVE_PURGE = 41, + FUEL_TANK_LEVEL_INPUT = 42, + EVAPORATION_SYSTEM_VAPOR_PRESSURE = 43, + CATALYST_TEMPERATURE_BANK1_SENSOR1 = 44, + CATALYST_TEMPERATURE_BANK2_SENSOR1 = 45, + CATALYST_TEMPERATURE_BANK1_SENSOR2 = 46, + CATALYST_TEMPERATURE_BANK2_SENSOR2 = 47, + ABSOLUTE_LOAD_VALUE = 48, + FUEL_AIR_COMMANDED_EQUIVALENCE_RATIO = 49, + RELATIVE_THROTTLE_POSITION = 50, + ABSOLUTE_THROTTLE_POSITION_B = 51, + ABSOLUTE_THROTTLE_POSITION_C = 52, + ACCELERATOR_PEDAL_POSITION_D = 53, + ACCELERATOR_PEDAL_POSITION_E = 54, + ACCELERATOR_PEDAL_POSITION_F = 55, + COMMANDED_THROTTLE_ACTUATOR = 56, + ETHANOL_FUEL_PERCENTAGE = 57, + ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE = 58, + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 59, + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 60, + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 61, + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 62, + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 63, + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 64, + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 65, + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 66, + RELATIVE_ACCELERATOR_PEDAL_POSITION = 67, + HYBRID_BATTERY_PACK_REMAINING_LIFE = 68, + FUEL_INJECTION_TIMING = 69, + ENGINE_FUEL_RATE = 70, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl new file mode 100644 index 0000000000..b3f13d4263 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl @@ -0,0 +1,69 @@ +/* + * 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 -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 DiagnosticIntegerSensorIndex { + FUEL_SYSTEM_STATUS = 0, + MALFUNCTION_INDICATOR_LIGHT_ON = 1, + IGNITION_MONITORS_SUPPORTED = 2, + IGNITION_SPECIFIC_MONITORS = 3, + INTAKE_AIR_TEMPERATURE = 4, + COMMANDED_SECONDARY_AIR_STATUS = 5, + NUM_OXYGEN_SENSORS_PRESENT = 6, + RUNTIME_SINCE_ENGINE_START = 7, + DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON = 8, + WARMUPS_SINCE_CODES_CLEARED = 9, + DISTANCE_TRAVELED_SINCE_CODES_CLEARED = 10, + ABSOLUTE_BAROMETRIC_PRESSURE = 11, + CONTROL_MODULE_VOLTAGE = 12, + AMBIENT_AIR_TEMPERATURE = 13, + TIME_WITH_MALFUNCTION_LIGHT_ON = 14, + TIME_SINCE_TROUBLE_CODES_CLEARED = 15, + MAX_FUEL_AIR_EQUIVALENCE_RATIO = 16, + MAX_OXYGEN_SENSOR_VOLTAGE = 17, + MAX_OXYGEN_SENSOR_CURRENT = 18, + MAX_INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 19, + MAX_AIR_FLOW_RATE_FROM_MASS_AIR_FLOW_SENSOR = 20, + FUEL_TYPE = 21, + FUEL_RAIL_ABSOLUTE_PRESSURE = 22, + ENGINE_OIL_TEMPERATURE = 23, + DRIVER_DEMAND_PERCENT_TORQUE = 24, + ENGINE_ACTUAL_PERCENT_TORQUE = 25, + ENGINE_REFERENCE_PERCENT_TORQUE = 26, + ENGINE_PERCENT_TORQUE_DATA_IDLE = 27, + ENGINE_PERCENT_TORQUE_DATA_POINT1 = 28, + ENGINE_PERCENT_TORQUE_DATA_POINT2 = 29, + ENGINE_PERCENT_TORQUE_DATA_POINT3 = 30, + ENGINE_PERCENT_TORQUE_DATA_POINT4 = 31, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl new file mode 100644 index 0000000000..9772aeeba0 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.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 -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 ElectronicTollCollectionCardStatus { + UNKNOWN = 0, + ELECTRONIC_TOLL_COLLECTION_CARD_VALID = 1, + ELECTRONIC_TOLL_COLLECTION_CARD_INVALID = 2, + ELECTRONIC_TOLL_COLLECTION_CARD_NOT_INSERTED = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl new file mode 100644 index 0000000000..22cf2c388b --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.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 -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 ElectronicTollCollectionCardType { + UNKNOWN = 0, + JP_ELECTRONIC_TOLL_COLLECTION_CARD = 1, + JP_ELECTRONIC_TOLL_COLLECTION_CARD_V2 = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvConnectorType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvConnectorType.aidl new file mode 100644 index 0000000000..b469578e77 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvConnectorType.aidl @@ -0,0 +1,50 @@ +/* + * 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 -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 EvConnectorType { + UNKNOWN = 0, + IEC_TYPE_1_AC = 1, + IEC_TYPE_2_AC = 2, + IEC_TYPE_3_AC = 3, + IEC_TYPE_4_DC = 4, + IEC_TYPE_1_CCS_DC = 5, + IEC_TYPE_2_CCS_DC = 6, + TESLA_ROADSTER = 7, + TESLA_HPWC = 8, + TESLA_SUPERCHARGER = 9, + GBT_AC = 10, + GBT_DC = 11, + OTHER = 101, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl new file mode 100644 index 0000000000..2fdb9b5a8d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceRequestIndex.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 -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 EvsServiceRequestIndex { + TYPE = 0, + STATE = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceState.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceState.aidl new file mode 100644 index 0000000000..df81ee7d27 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceState.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 -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 EvsServiceState { + OFF = 0, + ON = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceType.aidl new file mode 100644 index 0000000000..1363a64cca --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvsServiceType.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 -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 EvsServiceType { + REARVIEW = 0, + SURROUNDVIEW = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/FuelType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/FuelType.aidl new file mode 100644 index 0000000000..14bb61b7af --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/FuelType.aidl @@ -0,0 +1,50 @@ +/* + * 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 -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 FuelType { + FUEL_TYPE_UNKNOWN = 0, + FUEL_TYPE_UNLEADED = 1, + FUEL_TYPE_LEADED = 2, + FUEL_TYPE_DIESEL_1 = 3, + FUEL_TYPE_DIESEL_2 = 4, + FUEL_TYPE_BIODIESEL = 5, + FUEL_TYPE_E85 = 6, + FUEL_TYPE_LPG = 7, + FUEL_TYPE_CNG = 8, + FUEL_TYPE_LNG = 9, + FUEL_TYPE_ELECTRIC = 10, + FUEL_TYPE_HYDROGEN = 11, + FUEL_TYPE_OTHER = 12, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueRequests.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueRequests.aidl new file mode 100644 index 0000000000..c263a9d22c --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueRequests.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 -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; +@VintfStability +parcelable GetValueRequests { + android.hardware.automotive.vehicle.VehiclePropValue[] payloads; + long[] requestId; + @nullable ParcelFileDescriptor sharedMemoryFd; +} 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 new file mode 100644 index 0000000000..60c46e45a0 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueResult.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 -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; +@VintfStability +parcelable GetValueResult { + long requestId; + android.hardware.automotive.vehicle.StatusCode status = android.hardware.automotive.vehicle.StatusCode.OK; + @nullable android.hardware.automotive.vehicle.VehiclePropValue prop; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueResults.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueResults.aidl new file mode 100644 index 0000000000..778ba8e0b5 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueResults.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 -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; +@VintfStability +parcelable GetValueResults { + android.hardware.automotive.vehicle.GetValueResult[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/IVehicle.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/IVehicle.aidl new file mode 100644 index 0000000000..b5f62aa3bf --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/IVehicle.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +interface IVehicle { + android.hardware.automotive.vehicle.VehiclePropConfigs getAllPropConfigs(); + android.hardware.automotive.vehicle.VehiclePropConfigs getPropConfigs(in int[] props); + void getValues(android.hardware.automotive.vehicle.IVehicleCallback callback, in android.hardware.automotive.vehicle.GetValueRequests requests); + void setValues(android.hardware.automotive.vehicle.IVehicleCallback callback, in android.hardware.automotive.vehicle.SetValueRequests requests); + void subscribe(in android.hardware.automotive.vehicle.IVehicleCallback callback, in android.hardware.automotive.vehicle.SubscribeOptions[] options, int maxSharedMemoryFileCount); + void unsubscribe(in android.hardware.automotive.vehicle.IVehicleCallback callback, in int[] propIds); + void returnSharedMemory(in android.hardware.automotive.vehicle.IVehicleCallback callback, long sharedMemoryId); + const long INVALID_MEMORY_ID = 0; + const int MAX_SHARED_MEMORY_FILES_PER_CLIENT = 3; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/IVehicleCallback.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/IVehicleCallback.aidl new file mode 100644 index 0000000000..2c5a333dde --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/IVehicleCallback.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 -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; +@VintfStability +interface IVehicleCallback { + oneway void onGetValues(in android.hardware.automotive.vehicle.GetValueResults responses); + oneway void onSetValues(in android.hardware.automotive.vehicle.SetValueResults responses); + oneway void onPropertyEvent(in android.hardware.automotive.vehicle.VehiclePropValues propValues, int sharedMemoryFileCount); + oneway void onPropertySetError(in android.hardware.automotive.vehicle.VehiclePropErrors errors); +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl new file mode 100644 index 0000000000..c2c25009e4 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.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 -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; +@VintfStability +parcelable InitialUserInfoRequest { + int requestId; + android.hardware.automotive.vehicle.InitialUserInfoRequestType requestType = android.hardware.automotive.vehicle.InitialUserInfoRequestType.UNKNOWN; + android.hardware.automotive.vehicle.UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl new file mode 100644 index 0000000000..51260fa7b0 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequestType.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 -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 InitialUserInfoRequestType { + UNKNOWN = 0, + FIRST_BOOT = 1, + FIRST_BOOT_AFTER_OTA = 2, + COLD_BOOT = 3, + RESUME = 4, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl new file mode 100644 index 0000000000..ffb1781aba --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.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 -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; +@VintfStability +parcelable InitialUserInfoResponse { + int requestId; + android.hardware.automotive.vehicle.InitialUserInfoResponseAction action = android.hardware.automotive.vehicle.InitialUserInfoResponseAction.DEFAULT; + android.hardware.automotive.vehicle.UserInfo userToSwitchOrCreate; + @utf8InCpp String userLocales; + @utf8InCpp String userNameToCreate; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl new file mode 100644 index 0000000000..d654b5c23e --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.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 -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 InitialUserInfoResponseAction { + DEFAULT = 0, + SWITCH = 1, + CREATE = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl new file mode 100644 index 0000000000..73d4a143b7 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.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 -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 Obd2CommonIgnitionMonitors { + COMPONENTS_AVAILABLE = 1, + COMPONENTS_INCOMPLETE = 2, + FUEL_SYSTEM_AVAILABLE = 4, + FUEL_SYSTEM_INCOMPLETE = 8, + MISFIRE_AVAILABLE = 16, + MISFIRE_INCOMPLETE = 32, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl new file mode 100644 index 0000000000..01104c1baf --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl @@ -0,0 +1,55 @@ +/* + * 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 -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 Obd2CompressionIgnitionMonitors { + COMPONENTS_AVAILABLE = 1, + COMPONENTS_INCOMPLETE = 2, + FUEL_SYSTEM_AVAILABLE = 4, + FUEL_SYSTEM_INCOMPLETE = 8, + MISFIRE_AVAILABLE = 16, + MISFIRE_INCOMPLETE = 32, + EGR_OR_VVT_AVAILABLE = 64, + EGR_OR_VVT_INCOMPLETE = 128, + PM_FILTER_AVAILABLE = 256, + PM_FILTER_INCOMPLETE = 512, + EXHAUST_GAS_SENSOR_AVAILABLE = 1024, + EXHAUST_GAS_SENSOR_INCOMPLETE = 2048, + BOOST_PRESSURE_AVAILABLE = 4096, + BOOST_PRESSURE_INCOMPLETE = 8192, + NOx_SCR_AVAILABLE = 16384, + NOx_SCR_INCOMPLETE = 32768, + NMHC_CATALYST_AVAILABLE = 65536, + NMHC_CATALYST_INCOMPLETE = 131072, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl new file mode 100644 index 0000000000..9d588ead1c --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.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 -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 Obd2FuelSystemStatus { + OPEN_INSUFFICIENT_ENGINE_TEMPERATURE = 1, + CLOSED_LOOP = 2, + OPEN_ENGINE_LOAD_OR_DECELERATION = 4, + OPEN_SYSTEM_FAILURE = 8, + CLOSED_LOOP_BUT_FEEDBACK_FAULT = 16, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelType.aidl new file mode 100644 index 0000000000..3ab3920d04 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2FuelType.aidl @@ -0,0 +1,61 @@ +/* + * 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 -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 Obd2FuelType { + NOT_AVAILABLE = 0, + GASOLINE = 1, + METHANOL = 2, + ETHANOL = 3, + DIESEL = 4, + LPG = 5, + CNG = 6, + PROPANE = 7, + ELECTRIC = 8, + BIFUEL_RUNNING_GASOLINE = 9, + BIFUEL_RUNNING_METHANOL = 10, + BIFUEL_RUNNING_ETHANOL = 11, + BIFUEL_RUNNING_LPG = 12, + BIFUEL_RUNNING_CNG = 13, + BIFUEL_RUNNING_PROPANE = 14, + BIFUEL_RUNNING_ELECTRIC = 15, + BIFUEL_RUNNING_ELECTRIC_AND_COMBUSTION = 16, + HYBRID_GASOLINE = 17, + HYBRID_ETHANOL = 18, + HYBRID_DIESEL = 19, + HYBRID_ELECTRIC = 20, + HYBRID_RUNNING_ELECTRIC_AND_COMBUSTION = 21, + HYBRID_REGENERATIVE = 22, + BIFUEL_RUNNING_DIESEL = 23, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl new file mode 100644 index 0000000000..ec8f1c2e57 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.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 -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 Obd2IgnitionMonitorKind { + SPARK = 0, + COMPRESSION = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl new file mode 100644 index 0000000000..7f445bf564 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.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 -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 Obd2SecondaryAirStatus { + UPSTREAM = 1, + DOWNSTREAM_OF_CATALYCIC_CONVERTER = 2, + FROM_OUTSIDE_OR_OFF = 4, + PUMP_ON_FOR_DIAGNOSTICS = 8, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl new file mode 100644 index 0000000000..badc29c454 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl @@ -0,0 +1,59 @@ +/* + * 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 -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 Obd2SparkIgnitionMonitors { + COMPONENTS_AVAILABLE = 1, + COMPONENTS_INCOMPLETE = 2, + FUEL_SYSTEM_AVAILABLE = 4, + FUEL_SYSTEM_INCOMPLETE = 8, + MISFIRE_AVAILABLE = 16, + MISFIRE_INCOMPLETE = 32, + EGR_AVAILABLE = 64, + EGR_INCOMPLETE = 128, + OXYGEN_SENSOR_HEATER_AVAILABLE = 256, + OXYGEN_SENSOR_HEATER_INCOMPLETE = 512, + OXYGEN_SENSOR_AVAILABLE = 1024, + OXYGEN_SENSOR_INCOMPLETE = 2048, + AC_REFRIGERANT_AVAILABLE = 4096, + AC_REFRIGERANT_INCOMPLETE = 8192, + SECONDARY_AIR_SYSTEM_AVAILABLE = 16384, + SECONDARY_AIR_SYSTEM_INCOMPLETE = 32768, + EVAPORATIVE_SYSTEM_AVAILABLE = 65536, + EVAPORATIVE_SYSTEM_INCOMPLETE = 131072, + HEATED_CATALYST_AVAILABLE = 262144, + HEATED_CATALYST_INCOMPLETE = 524288, + CATALYST_AVAILABLE = 1048576, + CATALYST_INCOMPLETE = 2097152, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/PortLocationType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/PortLocationType.aidl new file mode 100644 index 0000000000..b831c7ebd9 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/PortLocationType.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 -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 PortLocationType { + UNKNOWN = 0, + FRONT_LEFT = 1, + FRONT_RIGHT = 2, + REAR_RIGHT = 3, + REAR_LEFT = 4, + FRONT = 5, + REAR = 6, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl new file mode 100644 index 0000000000..f2838ad818 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/ProcessTerminationReason.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 -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 ProcessTerminationReason { + NOT_RESPONDING = 1, + IO_OVERUSE = 2, + MEMORY_OVERUSE = 3, +} 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 new file mode 100644 index 0000000000..e553d602a0 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RawPropValues.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 -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; +@VintfStability +parcelable RawPropValues { + int[] int32Values = {}; + float[] floatValues; + long[] int64Values; + byte[] byteValues; + @utf8InCpp String stringValue; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl new file mode 100644 index 0000000000..68613092c5 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RemoveUserRequest.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 -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; +@VintfStability +parcelable RemoveUserRequest { + int requestId; + android.hardware.automotive.vehicle.UserInfo removedUserInfo; + android.hardware.automotive.vehicle.UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RotaryInputType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RotaryInputType.aidl new file mode 100644 index 0000000000..ff90034711 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RotaryInputType.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 -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 RotaryInputType { + ROTARY_INPUT_TYPE_SYSTEM_NAVIGATION = 0, + ROTARY_INPUT_TYPE_AUDIO_VOLUME = 1, +} 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 new file mode 100644 index 0000000000..82e75510f1 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueRequest.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 -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; +@VintfStability +parcelable SetValueRequest { + android.hardware.automotive.vehicle.VehiclePropValue value; + long requestId; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueRequests.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueRequests.aidl new file mode 100644 index 0000000000..ea9ac9a0af --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueRequests.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 -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; +@VintfStability +parcelable SetValueRequests { + android.hardware.automotive.vehicle.SetValueRequest[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} 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 new file mode 100644 index 0000000000..6c25bc864c --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueResult.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 -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; +@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/SetValueResults.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueResults.aidl new file mode 100644 index 0000000000..65ff8f0ed9 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueResults.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 -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; +@VintfStability +parcelable SetValueResults { + android.hardware.automotive.vehicle.SetValueResult[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/StatusCode.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/StatusCode.aidl new file mode 100644 index 0000000000..9b724126af --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/StatusCode.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 -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 StatusCode { + OK = 0, + TRY_AGAIN = 1, + INVALID_ARG = 2, + NOT_AVAILABLE = 3, + ACCESS_DENIED = 4, + INTERNAL_ERROR = 5, +} 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 new file mode 100644 index 0000000000..dcefd0964e --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SubscribeOptions.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 -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; +@VintfStability +parcelable SubscribeOptions { + int propId; + int[] areaIds; + float sampleRate; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl new file mode 100644 index 0000000000..a3e59f128d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserMessageType.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 -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 SwitchUserMessageType { + UNKNOWN = 0, + LEGACY_ANDROID_SWITCH = 1, + ANDROID_SWITCH = 2, + VEHICLE_RESPONSE = 3, + VEHICLE_REQUEST = 4, + ANDROID_POST_SWITCH = 5, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl new file mode 100644 index 0000000000..bb18e02177 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserRequest.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 -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; +@VintfStability +parcelable SwitchUserRequest { + int requestId; + android.hardware.automotive.vehicle.SwitchUserMessageType messageType = android.hardware.automotive.vehicle.SwitchUserMessageType.UNKNOWN; + android.hardware.automotive.vehicle.UserInfo targetUser; + android.hardware.automotive.vehicle.UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl new file mode 100644 index 0000000000..efc1911046 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserResponse.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 -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; +@VintfStability +parcelable SwitchUserResponse { + int requestId; + android.hardware.automotive.vehicle.SwitchUserMessageType messageType = android.hardware.automotive.vehicle.SwitchUserMessageType.UNKNOWN; + android.hardware.automotive.vehicle.SwitchUserStatus status = android.hardware.automotive.vehicle.SwitchUserStatus.SUCCESS; + @utf8InCpp String errorMessage; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserStatus.aidl new file mode 100644 index 0000000000..c7be9ec949 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserStatus.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 -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 SwitchUserStatus { + SUCCESS = 1, + FAILURE = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserFlags.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserFlags.aidl new file mode 100644 index 0000000000..2b872abcdc --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserFlags.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 -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 UserFlags { + NONE = 0, + SYSTEM = 1, + GUEST = 2, + EPHEMERAL = 4, + ADMIN = 8, + DISABLED = 16, + PROFILE = 32, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl new file mode 100644 index 0000000000..a0f987957a --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.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 -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; +@VintfStability +parcelable UserIdentificationAssociation { + android.hardware.automotive.vehicle.UserIdentificationAssociationType type = android.hardware.automotive.vehicle.UserIdentificationAssociationType.INVALID; + android.hardware.automotive.vehicle.UserIdentificationAssociationValue value = android.hardware.automotive.vehicle.UserIdentificationAssociationValue.UNKNOWN; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl new file mode 100644 index 0000000000..1fd9ee8c31 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.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 -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 UserIdentificationAssociationSetValue { + INVALID = 0, + ASSOCIATE_CURRENT_USER = 1, + DISASSOCIATE_CURRENT_USER = 2, + DISASSOCIATE_ALL_USERS = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl new file mode 100644 index 0000000000..6498375b0f --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationType.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 -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 UserIdentificationAssociationType { + INVALID = 0, + KEY_FOB = 1, + CUSTOM_1 = 101, + CUSTOM_2 = 102, + CUSTOM_3 = 103, + CUSTOM_4 = 104, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl new file mode 100644 index 0000000000..d5e01691fa --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.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 -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 UserIdentificationAssociationValue { + UNKNOWN = 1, + ASSOCIATED_CURRENT_USER = 2, + ASSOCIATED_ANOTHER_USER = 3, + NOT_ASSOCIATED_ANY_USER = 4, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl new file mode 100644 index 0000000000..744030e744 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.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 -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; +@VintfStability +parcelable UserIdentificationGetRequest { + int requestId; + android.hardware.automotive.vehicle.UserInfo userInfo; + int numberAssociationTypes; + android.hardware.automotive.vehicle.UserIdentificationAssociationType[] associationTypes; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl new file mode 100644 index 0000000000..b47b0033b9 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationResponse.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 -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; +@VintfStability +parcelable UserIdentificationResponse { + int requestId; + int numberAssociation; + android.hardware.automotive.vehicle.UserIdentificationAssociation[] associations; + @utf8InCpp String errorMessage; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl new file mode 100644 index 0000000000..5297349294 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.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 -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; +@VintfStability +parcelable UserIdentificationSetAssociation { + android.hardware.automotive.vehicle.UserIdentificationAssociationType type = android.hardware.automotive.vehicle.UserIdentificationAssociationType.INVALID; + android.hardware.automotive.vehicle.UserIdentificationAssociationSetValue value = android.hardware.automotive.vehicle.UserIdentificationAssociationSetValue.INVALID; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl new file mode 100644 index 0000000000..725040d19f --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.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 -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; +@VintfStability +parcelable UserIdentificationSetRequest { + int requestId; + android.hardware.automotive.vehicle.UserInfo userInfo; + int numberAssociations; + android.hardware.automotive.vehicle.UserIdentificationSetAssociation[] associations; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserInfo.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserInfo.aidl new file mode 100644 index 0000000000..b9cf8948eb --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserInfo.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 -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; +@VintfStability +parcelable UserInfo { + int userId = 0; + android.hardware.automotive.vehicle.UserFlags flags = android.hardware.automotive.vehicle.UserFlags.NONE; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UsersInfo.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UsersInfo.aidl new file mode 100644 index 0000000000..723431698b --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UsersInfo.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 -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; +@VintfStability +parcelable UsersInfo { + android.hardware.automotive.vehicle.UserInfo currentUser; + int numberUsers; + android.hardware.automotive.vehicle.UserInfo[] existingUsers; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl new file mode 100644 index 0000000000..472b23b551 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.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 -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 VehicleApPowerStateConfigFlag { + ENABLE_DEEP_SLEEP_FLAG = 1, + CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl new file mode 100644 index 0000000000..1ca3b503c9 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.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 -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 VehicleApPowerStateReport { + WAIT_FOR_VHAL = 1, + DEEP_SLEEP_ENTRY = 2, + DEEP_SLEEP_EXIT = 3, + SHUTDOWN_POSTPONE = 4, + SHUTDOWN_START = 5, + ON = 6, + SHUTDOWN_PREPARE = 7, + SHUTDOWN_CANCELLED = 8, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl new file mode 100644 index 0000000000..8b94d31598 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReq.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 -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 VehicleApPowerStateReq { + ON = 0, + SHUTDOWN_PREPARE = 1, + CANCEL_SHUTDOWN = 2, + FINISHED = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl new file mode 100644 index 0000000000..f995c73ee5 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.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 -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 VehicleApPowerStateReqIndex { + STATE = 0, + ADDITIONAL = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl new file mode 100644 index 0000000000..3e0f4e845a --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.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 -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 VehicleApPowerStateShutdownParam { + SHUTDOWN_IMMEDIATELY = 1, + CAN_SLEEP = 2, + SHUTDOWN_ONLY = 3, + SLEEP_IMMEDIATELY = 4, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleArea.aidl new file mode 100644 index 0000000000..4f8b917256 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleArea.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 -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 VehicleArea { + GLOBAL = 16777216, + WINDOW = 50331648, + MIRROR = 67108864, + SEAT = 83886080, + DOOR = 100663296, + WHEEL = 117440512, + MASK = 251658240, +} 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 new file mode 100644 index 0000000000..7a42ec8017 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaConfig.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 -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; +@VintfStability +parcelable VehicleAreaConfig { + int areaId; + int minInt32Value; + int maxInt32Value; + long minInt64Value; + long maxInt64Value; + float minFloatValue; + float maxFloatValue; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl new file mode 100644 index 0000000000..11139f9a3a --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaDoor.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 -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 VehicleAreaDoor { + ROW_1_LEFT = 1, + ROW_1_RIGHT = 4, + ROW_2_LEFT = 16, + ROW_2_RIGHT = 64, + ROW_3_LEFT = 256, + ROW_3_RIGHT = 1024, + HOOD = 268435456, + REAR = 536870912, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl new file mode 100644 index 0000000000..c1e2fbd6ff --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaMirror.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 -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 VehicleAreaMirror { + DRIVER_LEFT = 1, + DRIVER_RIGHT = 2, + DRIVER_CENTER = 4, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl new file mode 100644 index 0000000000..e76de324d3 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 VehicleAreaSeat { + ROW_1_LEFT = 1, + ROW_1_CENTER = 2, + ROW_1_RIGHT = 4, + ROW_2_LEFT = 16, + ROW_2_CENTER = 32, + ROW_2_RIGHT = 64, + ROW_3_LEFT = 256, + ROW_3_CENTER = 512, + ROW_3_RIGHT = 1024, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl new file mode 100644 index 0000000000..9e834340b1 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWheel.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 -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 VehicleAreaWheel { + UNKNOWN = 0, + LEFT_FRONT = 1, + RIGHT_FRONT = 2, + LEFT_REAR = 4, + RIGHT_REAR = 8, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl new file mode 100644 index 0000000000..6ec26fe261 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaWindow.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 -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 VehicleAreaWindow { + FRONT_WINDSHIELD = 1, + REAR_WINDSHIELD = 2, + ROW_1_LEFT = 16, + ROW_1_RIGHT = 64, + ROW_2_LEFT = 256, + ROW_2_RIGHT = 1024, + ROW_3_LEFT = 4096, + ROW_3_RIGHT = 16384, + ROOF_TOP_1 = 65536, + ROOF_TOP_2 = 131072, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleDisplay.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleDisplay.aidl new file mode 100644 index 0000000000..5aeafa4676 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleDisplay.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 -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 VehicleDisplay { + MAIN = 0, + INSTRUMENT_CLUSTER = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleGear.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleGear.aidl new file mode 100644 index 0000000000..db4760d7a3 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleGear.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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 VehicleGear { + GEAR_UNKNOWN = 0, + GEAR_NEUTRAL = 1, + GEAR_REVERSE = 2, + GEAR_PARK = 4, + GEAR_DRIVE = 8, + GEAR_1 = 16, + GEAR_2 = 32, + GEAR_3 = 64, + GEAR_4 = 128, + GEAR_5 = 256, + GEAR_6 = 512, + GEAR_7 = 1024, + GEAR_8 = 2048, + GEAR_9 = 4096, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl new file mode 100644 index 0000000000..a85751f94f --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHvacFanDirection.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 -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 VehicleHvacFanDirection { + UNKNOWN = 0, + FACE = 1, + FLOOR = 2, + FACE_AND_FLOOR = 3, + DEFROST = 4, + DEFROST_AND_FLOOR = 6, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl new file mode 100644 index 0000000000..c4ac002067 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.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 -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 VehicleHwKeyInputAction { + ACTION_DOWN = 0, + ACTION_UP = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl new file mode 100644 index 0000000000..09d5423edc --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleIgnitionState.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 -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 VehicleIgnitionState { + UNDEFINED = 0, + LOCK = 1, + OFF = 2, + ACC = 3, + ON = 4, + START = 5, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightState.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightState.aidl new file mode 100644 index 0000000000..d569851407 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightState.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 -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 VehicleLightState { + OFF = 0, + ON = 1, + DAYTIME_RUNNING = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl new file mode 100644 index 0000000000..0d3c636b16 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleLightSwitch.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 -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 VehicleLightSwitch { + OFF = 0, + ON = 1, + DAYTIME_RUNNING = 2, + AUTOMATIC = 256, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleOilLevel.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleOilLevel.aidl new file mode 100644 index 0000000000..f2eb5aa913 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleOilLevel.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 -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 VehicleOilLevel { + CRITICALLY_LOW = 0, + LOW = 1, + NORMAL = 2, + HIGH = 3, + ERROR = 4, +} 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 new file mode 100644 index 0000000000..16ba6dba7e --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropConfig.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 -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; +@VintfStability +parcelable VehiclePropConfig { + int prop; + android.hardware.automotive.vehicle.VehiclePropertyAccess access = android.hardware.automotive.vehicle.VehiclePropertyAccess.NONE; + android.hardware.automotive.vehicle.VehiclePropertyChangeMode changeMode = android.hardware.automotive.vehicle.VehiclePropertyChangeMode.STATIC; + android.hardware.automotive.vehicle.VehicleAreaConfig[] areaConfigs; + int[] configArray; + @utf8InCpp String configString; + float minSampleRate; + float maxSampleRate; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl new file mode 100644 index 0000000000..e5d146da7d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropConfigs.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 -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; +@VintfStability +parcelable VehiclePropConfigs { + android.hardware.automotive.vehicle.VehiclePropConfig[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} 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 new file mode 100644 index 0000000000..8b2e1041ef --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropError.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 -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; +@VintfStability +parcelable VehiclePropError { + int propId; + int areaId; + android.hardware.automotive.vehicle.StatusCode errorCode = android.hardware.automotive.vehicle.StatusCode.OK; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropErrors.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropErrors.aidl new file mode 100644 index 0000000000..6303d3a634 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropErrors.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 -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; +@VintfStability +parcelable VehiclePropErrors { + android.hardware.automotive.vehicle.VehiclePropError[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} 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 new file mode 100644 index 0000000000..fc1ae531d1 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropValue.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 -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; +@VintfStability +parcelable VehiclePropValue { + long timestamp; + int areaId; + int prop; + android.hardware.automotive.vehicle.VehiclePropertyStatus status = android.hardware.automotive.vehicle.VehiclePropertyStatus.AVAILABLE; + android.hardware.automotive.vehicle.RawPropValues value; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropValues.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropValues.aidl new file mode 100644 index 0000000000..da8c60b6bf --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropValues.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 -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; +@VintfStability +parcelable VehiclePropValues { + android.hardware.automotive.vehicle.VehiclePropValue[] payloads; + long sharedMemoryId; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl new file mode 100644 index 0000000000..4af3e5b40e --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -0,0 +1,196 @@ +/* + * 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 -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 VehicleProperty { + INVALID = 0, + INFO_VIN = 286261504, + INFO_MAKE = 286261505, + INFO_MODEL = 286261506, + INFO_MODEL_YEAR = 289407235, + INFO_FUEL_CAPACITY = 291504388, + INFO_FUEL_TYPE = 289472773, + INFO_EV_BATTERY_CAPACITY = 291504390, + INFO_EV_CONNECTOR_TYPE = 289472775, + INFO_FUEL_DOOR_LOCATION = 289407240, + INFO_EV_PORT_LOCATION = 289407241, + INFO_DRIVER_SEAT = 356516106, + INFO_EXTERIOR_DIMENSIONS = 289472779, + INFO_MULTI_EV_PORT_LOCATIONS = 289472780, + PERF_ODOMETER = 291504644, + PERF_VEHICLE_SPEED = 291504647, + PERF_VEHICLE_SPEED_DISPLAY = 291504648, + PERF_STEERING_ANGLE = 291504649, + PERF_REAR_STEERING_ANGLE = 291504656, + ENGINE_COOLANT_TEMP = 291504897, + ENGINE_OIL_LEVEL = 289407747, + ENGINE_OIL_TEMP = 291504900, + ENGINE_RPM = 291504901, + WHEEL_TICK = 290521862, + FUEL_LEVEL = 291504903, + FUEL_DOOR_OPEN = 287310600, + EV_BATTERY_LEVEL = 291504905, + EV_CHARGE_PORT_OPEN = 287310602, + EV_CHARGE_PORT_CONNECTED = 287310603, + EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = 291504908, + RANGE_REMAINING = 291504904, + TIRE_PRESSURE = 392168201, + CRITICALLY_LOW_TIRE_PRESSURE = 392168202, + GEAR_SELECTION = 289408000, + CURRENT_GEAR = 289408001, + PARKING_BRAKE_ON = 287310850, + PARKING_BRAKE_AUTO_APPLY = 287310851, + FUEL_LEVEL_LOW = 287310853, + NIGHT_MODE = 287310855, + TURN_SIGNAL_STATE = 289408008, + IGNITION_STATE = 289408009, + ABS_ACTIVE = 287310858, + TRACTION_CONTROL_ACTIVE = 287310859, + HVAC_FAN_SPEED = 356517120, + HVAC_FAN_DIRECTION = 356517121, + HVAC_TEMPERATURE_CURRENT = 358614274, + HVAC_TEMPERATURE_SET = 358614275, + HVAC_DEFROSTER = 320865540, + HVAC_AC_ON = 354419973, + HVAC_MAX_AC_ON = 354419974, + HVAC_MAX_DEFROST_ON = 354419975, + HVAC_RECIRC_ON = 354419976, + HVAC_DUAL_ON = 354419977, + HVAC_AUTO_ON = 354419978, + HVAC_SEAT_TEMPERATURE = 356517131, + HVAC_SIDE_MIRROR_HEAT = 339739916, + HVAC_STEERING_WHEEL_HEAT = 289408269, + HVAC_TEMPERATURE_DISPLAY_UNITS = 289408270, + HVAC_ACTUAL_FAN_SPEED_RPM = 356517135, + HVAC_POWER_ON = 354419984, + HVAC_FAN_DIRECTION_AVAILABLE = 356582673, + HVAC_AUTO_RECIRC_ON = 354419986, + HVAC_SEAT_VENTILATION = 356517139, + HVAC_ELECTRIC_DEFROSTER_ON = 320865556, + HVAC_TEMPERATURE_VALUE_SUGGESTION = 291570965, + DISTANCE_DISPLAY_UNITS = 289408512, + FUEL_VOLUME_DISPLAY_UNITS = 289408513, + TIRE_PRESSURE_DISPLAY_UNITS = 289408514, + EV_BATTERY_DISPLAY_UNITS = 289408515, + FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = 287311364, + VEHICLE_SPEED_DISPLAY_UNITS = 289408517, + EPOCH_TIME = 290457094, + STORAGE_ENCRYPTION_BINDING_SEED = 292554247, + ENV_OUTSIDE_TEMPERATURE = 291505923, + AP_POWER_STATE_REQ = 289475072, + AP_POWER_STATE_REPORT = 289475073, + AP_POWER_BOOTUP_REASON = 289409538, + DISPLAY_BRIGHTNESS = 289409539, + HW_KEY_INPUT = 289475088, + HW_ROTARY_INPUT = 289475104, + HW_CUSTOM_INPUT = 289475120, + DOOR_POS = 373295872, + DOOR_MOVE = 373295873, + DOOR_LOCK = 371198722, + MIRROR_Z_POS = 339741504, + MIRROR_Z_MOVE = 339741505, + MIRROR_Y_POS = 339741506, + MIRROR_Y_MOVE = 339741507, + MIRROR_LOCK = 287312708, + MIRROR_FOLD = 287312709, + SEAT_MEMORY_SELECT = 356518784, + SEAT_MEMORY_SET = 356518785, + SEAT_BELT_BUCKLED = 354421634, + SEAT_BELT_HEIGHT_POS = 356518787, + SEAT_BELT_HEIGHT_MOVE = 356518788, + SEAT_FORE_AFT_POS = 356518789, + SEAT_FORE_AFT_MOVE = 356518790, + SEAT_BACKREST_ANGLE_1_POS = 356518791, + SEAT_BACKREST_ANGLE_1_MOVE = 356518792, + SEAT_BACKREST_ANGLE_2_POS = 356518793, + SEAT_BACKREST_ANGLE_2_MOVE = 356518794, + SEAT_HEIGHT_POS = 356518795, + SEAT_HEIGHT_MOVE = 356518796, + SEAT_DEPTH_POS = 356518797, + SEAT_DEPTH_MOVE = 356518798, + SEAT_TILT_POS = 356518799, + SEAT_TILT_MOVE = 356518800, + SEAT_LUMBAR_FORE_AFT_POS = 356518801, + SEAT_LUMBAR_FORE_AFT_MOVE = 356518802, + SEAT_LUMBAR_SIDE_SUPPORT_POS = 356518803, + SEAT_LUMBAR_SIDE_SUPPORT_MOVE = 356518804, + SEAT_HEADREST_HEIGHT_POS = 289409941, + SEAT_HEADREST_HEIGHT_MOVE = 356518806, + SEAT_HEADREST_ANGLE_POS = 356518807, + SEAT_HEADREST_ANGLE_MOVE = 356518808, + SEAT_HEADREST_FORE_AFT_POS = 356518809, + SEAT_HEADREST_FORE_AFT_MOVE = 356518810, + SEAT_OCCUPANCY = 356518832, + WINDOW_POS = 322964416, + WINDOW_MOVE = 322964417, + WINDOW_LOCK = 320867268, + VEHICLE_MAP_SERVICE = 299895808, + OBD2_LIVE_FRAME = 299896064, + OBD2_FREEZE_FRAME = 299896065, + OBD2_FREEZE_FRAME_INFO = 299896066, + OBD2_FREEZE_FRAME_CLEAR = 299896067, + HEADLIGHTS_STATE = 289410560, + HIGH_BEAM_LIGHTS_STATE = 289410561, + FOG_LIGHTS_STATE = 289410562, + HAZARD_LIGHTS_STATE = 289410563, + HEADLIGHTS_SWITCH = 289410576, + HIGH_BEAM_LIGHTS_SWITCH = 289410577, + FOG_LIGHTS_SWITCH = 289410578, + HAZARD_LIGHTS_SWITCH = 289410579, + CABIN_LIGHTS_STATE = 289410817, + CABIN_LIGHTS_SWITCH = 289410818, + READING_LIGHTS_STATE = 356519683, + READING_LIGHTS_SWITCH = 356519684, + SUPPORT_CUSTOMIZE_VENDOR_PERMISSION = 287313669, + DISABLED_OPTIONAL_FEATURES = 286265094, + INITIAL_USER_INFO = 299896583, + SWITCH_USER = 299896584, + CREATE_USER = 299896585, + REMOVE_USER = 299896586, + USER_IDENTIFICATION_ASSOCIATION = 299896587, + EVS_SERVICE_REQUEST = 289476368, + POWER_POLICY_REQ = 286265121, + POWER_POLICY_GROUP_REQ = 286265122, + CURRENT_POWER_POLICY = 286265123, + WATCHDOG_ALIVE = 290459441, + WATCHDOG_TERMINATED_PROCESS = 299896626, + VHAL_HEARTBEAT = 290459443, + CLUSTER_SWITCH_UI = 289410868, + CLUSTER_DISPLAY_STATE = 289476405, + CLUSTER_REPORT_STATE = 299896630, + CLUSTER_REQUEST_DISPLAY = 289410871, + CLUSTER_NAVIGATION_STATE = 292556600, + ELECTRONIC_TOLL_COLLECTION_CARD_TYPE = 289410873, + ELECTRONIC_TOLL_COLLECTION_CARD_STATUS = 289410874, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl new file mode 100644 index 0000000000..ec9587f60c --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyAccess.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 -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 VehiclePropertyAccess { + NONE = 0, + READ = 1, + WRITE = 2, + READ_WRITE = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl new file mode 100644 index 0000000000..5455fdd5ca --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.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 -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 VehiclePropertyChangeMode { + STATIC = 0, + ON_CHANGE = 1, + CONTINUOUS = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl new file mode 100644 index 0000000000..0c049c4814 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.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 -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 VehiclePropertyGroup { + SYSTEM = 268435456, + VENDOR = 536870912, + MASK = -268435456, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl new file mode 100644 index 0000000000..6d0e041ff6 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.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 -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 VehiclePropertyStatus { + AVAILABLE = 0, + UNAVAILABLE = 1, + ERROR = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyType.aidl new file mode 100644 index 0000000000..da6d2c2168 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyType.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 -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 VehiclePropertyType { + STRING = 1048576, + BOOLEAN = 2097152, + INT32 = 4194304, + INT32_VEC = 4259840, + INT64 = 5242880, + INT64_VEC = 5308416, + FLOAT = 6291456, + FLOAT_VEC = 6356992, + BYTES = 7340032, + MIXED = 14680064, + MASK = 16711680, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl new file mode 100644 index 0000000000..3e870e8925 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.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 -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 VehicleSeatOccupancyState { + UNKNOWN = 0, + VACANT = 1, + OCCUPIED = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl new file mode 100644 index 0000000000..78c17959b4 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleTurnSignal.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 -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 VehicleTurnSignal { + NONE = 0, + RIGHT = 1, + LEFT = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl new file mode 100644 index 0000000000..034dec540b --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl @@ -0,0 +1,69 @@ +/* + * 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 -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 VehicleUnit { + SHOULD_NOT_USE = 0, + METER_PER_SEC = 1, + RPM = 2, + HERTZ = 3, + PERCENTILE = 16, + MILLIMETER = 32, + METER = 33, + KILOMETER = 35, + MILE = 36, + CELSIUS = 48, + FAHRENHEIT = 49, + KELVIN = 50, + MILLILITER = 64, + LITER = 65, + GALLON = 66, + US_GALLON = 66, + IMPERIAL_GALLON = 67, + NANO_SECS = 80, + SECS = 83, + YEAR = 89, + WATT_HOUR = 96, + MILLIAMPERE = 97, + MILLIVOLT = 98, + MILLIWATTS = 99, + AMPERE_HOURS = 100, + KILOWATT_HOUR = 101, + KILOPASCAL = 112, + PSI = 113, + BAR = 114, + DEGREES = 128, + MILES_PER_HOUR = 144, + KILOMETERS_PER_HOUR = 145, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl new file mode 100644 index 0000000000..58524f3c66 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl @@ -0,0 +1,75 @@ +/* + * 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 -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 VehicleVendorPermission { + PERMISSION_DEFAULT = 0, + PERMISSION_SET_VENDOR_CATEGORY_WINDOW = 1, + PERMISSION_GET_VENDOR_CATEGORY_WINDOW = 2, + PERMISSION_SET_VENDOR_CATEGORY_DOOR = 3, + PERMISSION_GET_VENDOR_CATEGORY_DOOR = 4, + PERMISSION_SET_VENDOR_CATEGORY_SEAT = 5, + PERMISSION_GET_VENDOR_CATEGORY_SEAT = 6, + PERMISSION_SET_VENDOR_CATEGORY_MIRROR = 7, + PERMISSION_GET_VENDOR_CATEGORY_MIRROR = 8, + PERMISSION_SET_VENDOR_CATEGORY_INFO = 9, + PERMISSION_GET_VENDOR_CATEGORY_INFO = 10, + PERMISSION_SET_VENDOR_CATEGORY_ENGINE = 11, + PERMISSION_GET_VENDOR_CATEGORY_ENGINE = 12, + PERMISSION_SET_VENDOR_CATEGORY_HVAC = 13, + PERMISSION_GET_VENDOR_CATEGORY_HVAC = 14, + PERMISSION_SET_VENDOR_CATEGORY_LIGHT = 15, + PERMISSION_GET_VENDOR_CATEGORY_LIGHT = 16, + PERMISSION_SET_VENDOR_CATEGORY_1 = 65536, + PERMISSION_GET_VENDOR_CATEGORY_1 = 69632, + PERMISSION_SET_VENDOR_CATEGORY_2 = 131072, + PERMISSION_GET_VENDOR_CATEGORY_2 = 135168, + PERMISSION_SET_VENDOR_CATEGORY_3 = 196608, + PERMISSION_GET_VENDOR_CATEGORY_3 = 200704, + PERMISSION_SET_VENDOR_CATEGORY_4 = 262144, + PERMISSION_GET_VENDOR_CATEGORY_4 = 266240, + PERMISSION_SET_VENDOR_CATEGORY_5 = 327680, + PERMISSION_GET_VENDOR_CATEGORY_5 = 331776, + PERMISSION_SET_VENDOR_CATEGORY_6 = 393216, + PERMISSION_GET_VENDOR_CATEGORY_6 = 397312, + PERMISSION_SET_VENDOR_CATEGORY_7 = 458752, + PERMISSION_GET_VENDOR_CATEGORY_7 = 462848, + PERMISSION_SET_VENDOR_CATEGORY_8 = 524288, + PERMISSION_GET_VENDOR_CATEGORY_8 = 528384, + PERMISSION_SET_VENDOR_CATEGORY_9 = 589824, + PERMISSION_GET_VENDOR_CATEGORY_9 = 593920, + PERMISSION_SET_VENDOR_CATEGORY_10 = 655360, + PERMISSION_GET_VENDOR_CATEGORY_10 = 659456, + PERMISSION_NOT_ACCESSIBLE = -268435456, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl new file mode 100644 index 0000000000..0dcfbc4a5d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.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 -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 VmsAvailabilityStateIntegerValuesIndex { + MESSAGE_TYPE = 0, + SEQUENCE_NUMBER = 1, + NUMBER_OF_ASSOCIATED_LAYERS = 2, + LAYERS_START = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl new file mode 100644 index 0000000000..45514d081a --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.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 -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 VmsBaseMessageIntegerValuesIndex { + MESSAGE_TYPE = 0, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageType.aidl new file mode 100644 index 0000000000..1248c069ce --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageType.aidl @@ -0,0 +1,54 @@ +/* + * 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 -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 VmsMessageType { + SUBSCRIBE = 1, + SUBSCRIBE_TO_PUBLISHER = 2, + UNSUBSCRIBE = 3, + UNSUBSCRIBE_TO_PUBLISHER = 4, + OFFERING = 5, + AVAILABILITY_REQUEST = 6, + SUBSCRIPTIONS_REQUEST = 7, + AVAILABILITY_RESPONSE = 8, + AVAILABILITY_CHANGE = 9, + SUBSCRIPTIONS_RESPONSE = 10, + SUBSCRIPTIONS_CHANGE = 11, + DATA = 12, + PUBLISHER_ID_REQUEST = 13, + PUBLISHER_ID_RESPONSE = 14, + PUBLISHER_INFORMATION_REQUEST = 15, + PUBLISHER_INFORMATION_RESPONSE = 16, + START_SESSION = 17, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl new file mode 100644 index 0000000000..8b0e3a5ef2 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.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 -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 VmsMessageWithLayerAndPublisherIdIntegerValuesIndex { + MESSAGE_TYPE = 0, + LAYER_TYPE = 1, + LAYER_SUBTYPE = 2, + LAYER_VERSION = 3, + PUBLISHER_ID = 4, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl new file mode 100644 index 0000000000..65dd4ae395 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.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 -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 VmsMessageWithLayerIntegerValuesIndex { + MESSAGE_TYPE = 0, + LAYER_TYPE = 1, + LAYER_SUBTYPE = 2, + LAYER_VERSION = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl new file mode 100644 index 0000000000..fc2a9c1844 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.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 -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 VmsOfferingMessageIntegerValuesIndex { + MESSAGE_TYPE = 0, + PUBLISHER_ID = 1, + NUMBER_OF_OFFERS = 2, + OFFERING_START = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl new file mode 100644 index 0000000000..a9b017fdb1 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.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 -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 VmsPublisherInformationIntegerValuesIndex { + MESSAGE_TYPE = 0, + PUBLISHER_ID = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl new file mode 100644 index 0000000000..d942bc8392 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.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 -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 VmsStartSessionMessageIntegerValuesIndex { + MESSAGE_TYPE = 0, + SERVICE_ID = 1, + CLIENT_ID = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl new file mode 100644 index 0000000000..796d7f722c --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.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 -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 VmsSubscriptionsStateIntegerValuesIndex { + MESSAGE_TYPE = 0, + SEQUENCE_NUMBER = 1, + NUMBER_OF_LAYERS = 2, + NUMBER_OF_ASSOCIATED_LAYERS = 3, + SUBSCRIPTIONS_START = 4, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl index 95537dc368..1f7c9cc95f 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl @@ -25,7 +25,7 @@ import android.hardware.automotive.vehicle.UsersInfo; * NOTE: this struct is not used in the HAL properties directly, it must be converted to * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ -// @VintfStability +@VintfStability parcelable CreateUserRequest { /** * Arbitrary id used to map the response to the request. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl index 0588052ef4..d011366834 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl @@ -24,7 +24,7 @@ import android.hardware.automotive.vehicle.CreateUserStatus; * NOTE: this struct is not used in the HAL properties directly, it must be converted to * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ -// @VintfStability +@VintfStability parcelable CreateUserResponse { /** * Id of the request being responded. @@ -33,7 +33,7 @@ parcelable CreateUserResponse { /** * Status of the request. */ - CreateUserStatus status; + CreateUserStatus status = CreateUserStatus.SUCCESS; /** * HAL-specific error message. * diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserStatus.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserStatus.aidl index f841ff6578..5c8c5f0e76 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserStatus.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserStatus.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Status of the response to a CreateUserRequest. */ -// @VintfStability +@VintfStability @Backing(type="int") enum CreateUserStatus { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl index 1335eea669..10dbfd061e 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Input code values for HW_CUSTOM_INPUT. */ -// @VintfStability +@VintfStability @Backing(type="int") enum CustomInputType { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl index 017589fe6e..8b0c471d72 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl @@ -23,7 +23,7 @@ package android.hardware.automotive.vehicle; * While these values do not directly map to SAE J1979 PIDs, an equivalence is listed next * to each one to aid implementors. */ -// @VintfStability +@VintfStability @Backing(type="int") enum DiagnosticFloatSensorIndex { CALCULATED_ENGINE_LOAD = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl index 86c8a459c4..321b7ffdbc 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl @@ -25,7 +25,7 @@ package android.hardware.automotive.vehicle; * While these values do not directly map to SAE J1979 PIDs, an equivalence is listed next * to each one to aid implementors. */ -// @VintfStability +@VintfStability @Backing(type="int") enum DiagnosticIntegerSensorIndex { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl index cb55ffa10b..94209ba150 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Used by ELECTRONIC_TOLL_COLLECTION_CARD_STATUS. */ -// @VintfStability +@VintfStability @Backing(type="int") enum ElectronicTollCollectionCardStatus { UNKNOWN = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl index 78254fb30f..46c5f4839b 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Used by ELECTRONIC_TOLL_COLLECTION_CARD_TYPE. */ -// @VintfStability +@VintfStability @Backing(type="int") enum ElectronicTollCollectionCardType { UNKNOWN = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvConnectorType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvConnectorType.aidl index fc95bb0f10..6e77f5376c 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvConnectorType.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvConnectorType.aidl @@ -20,7 +20,7 @@ package android.hardware.automotive.vehicle; * Used by INFO_EV_CONNECTOR_TYPE to enumerate the type of connectors * available to charge the vehicle. */ -// @VintfStability +@VintfStability @Backing(type="int") enum EvConnectorType { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl index 6853ccd570..d27e032ba4 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Index in int32VAlues for VehicleProperty#EVS_SERVICE_REQUEST property. */ -// @VintfStability +@VintfStability @Backing(type="int") enum EvsServiceRequestIndex { TYPE = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceState.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceState.aidl index e351949f71..ee5cd2b047 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceState.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceState.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Used by EVS_SERVICE_REQUEST to enumerate the service's state. */ -// @VintfStability +@VintfStability @Backing(type="int") enum EvsServiceState { OFF = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceType.aidl index 4ca241a308..6c621f79ad 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceType.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvsServiceType.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Used by EVS_SERVICE_REQUEST to enumerate the service's type. */ -// @VintfStability +@VintfStability @Backing(type="int") enum EvsServiceType { REARVIEW = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/FuelType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/FuelType.aidl index 131ac148ee..98b1fa58a5 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/FuelType.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/FuelType.aidl @@ -20,7 +20,7 @@ package android.hardware.automotive.vehicle; * Used by INFO_FUEL_TYPE to enumerate the type of fuels this vehicle uses. * Consistent with projection protocol. */ -// @VintfStability +@VintfStability @Backing(type="int") enum FuelType { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequests.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequests.aidl new file mode 100644 index 0000000000..149799e3fc --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequests.aidl @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VehiclePropValue; +import android.os.ParcelFileDescriptor; + +@VintfStability +parcelable GetValueRequests { + // The list of properties to get if they fit the binder memory limitation. + VehiclePropValue[] payloads; + // A list of request IDs, one for each VehiclePropValue. For every client, + // the request ID must start with 1 and monotonically increase for every + // VehiclePropValue in GetValueRequests. If it hits LONG_MAX (very + // unlikely), it must loop back to 0. + long[] requestId; + // Shared memory file to store requests if they exceed binder memory + // limitation. Created by client, readable only at VHAL during the call. + // Caller could close it after the call. + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResult.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResult.aidl new file mode 100644 index 0000000000..b099a858b3 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResult.aidl @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.StatusCode; +import android.hardware.automotive.vehicle.VehiclePropValue; + +@VintfStability +parcelable GetValueResult { + // The ID for the request this response is for. + long requestId; + // The status for the getValue operation. If this is not OK, the getValue + // fails and prop should be ignored. + StatusCode status = StatusCode.OK; + // Contains the property value if status is OK. Must be null if status is + // not OK. + @nullable VehiclePropValue prop; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResults.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResults.aidl new file mode 100644 index 0000000000..919e6441a2 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResults.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.GetValueResult; +import android.os.ParcelFileDescriptor; + +@VintfStability +parcelable GetValueResults { + // The list of responses if they fit the binder memory limitation. + GetValueResult[] payloads; + // Shared memory file to store responses if they exceed binder memory + // limitation. Created by VHAL, readable only for the client. + // The client must close it after reading. + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl index acb840995e..a9479636fe 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl @@ -16,100 +16,197 @@ package android.hardware.automotive.vehicle; +import android.hardware.automotive.vehicle.GetValueRequests; import android.hardware.automotive.vehicle.IVehicleCallback; -import android.hardware.automotive.vehicle.StatusCode; +import android.hardware.automotive.vehicle.SetValueRequests; import android.hardware.automotive.vehicle.SubscribeOptions; -import android.hardware.automotive.vehicle.VehiclePropConfig; -import android.hardware.automotive.vehicle.VehiclePropValue; +import android.hardware.automotive.vehicle.VehiclePropConfigs; -// @VintfStability +// Vehicle HAL interface. +@VintfStability interface IVehicle { - // Adding return type to method instead of out param String s since there is only one return - // value. + /* An invalid memory ID. */ + const long INVALID_MEMORY_ID = 0; + /* Maximum number of shared memory files for every subscription client. */ + const int MAX_SHARED_MEMORY_FILES_PER_CLIENT = 3; + /** - * Print out debugging state for the vehicle hal. - * - * The text must be in ASCII encoding only. + * Returns a list of all property configurations supported by this vehicle + * HAL. * - * Performance requirements: + * @return A parcelable object that either contains a list of configs if + * they fit the binder memory limitation or a shared memory file that + * contains the configs. Must be parsed using + * {@code android-automotive-large-parcelable} library. + */ + VehiclePropConfigs getAllPropConfigs(); + + /** + * Returns a list of property configurations for given properties. * - * The HAL must return from this call in less than 10ms. This call must avoid - * deadlocks, as it may be called at any point of operation. Any synchronization - * primitives used (such as mutex locks or semaphores) must be acquired - * with a timeout. + * If one of the requested VehicleProperty wasn't found it must return + * {@link StatusCode#INVALID_ARG}, otherwise a list of vehicle property + * configurations with {@link StatusCode#OK}. * + * @param props A list of property IDs to get configurations for. + * @return A parcelable object that either contains a list of configs if + * they fit the binder memory limitation or a shared memory file that + * contains the configs. Must be parsed using + * {@code android-automotive-large-parcelable} library. */ - String debugDump(); + VehiclePropConfigs getPropConfigs(in int[] props); /** - * Get a vehicle property value. + * Get vehicle property values asynchronously. + * + * The {@link IVehicleCallback#onGetValues} method will be called when + * values are fetched. The method might be called multiple times, and each + * time with a subset of properties that have been fetched. E.g., if you + * request properties [A, B, C], the callback might be called twice with + * [A, C] and with [B]. Caller should not expect any order for + * {@link IVehicleCallback#onGetValues}. * - * For VehiclePropertyChangeMode::STATIC properties, this method must always - * return the same value always. - * For VehiclePropertyChangeMode::ON_CHANGE properties, it must return the - * latest available value. + * If this method returns error, it means we fail to get all the properties. + * If this method returns OK, there are still chances we fail to get some + * properties, which are indicated by {@link GetValueResult#status}. * - * Some properties like RADIO_PRESET requires to pass additional data in - * GET request in VehiclePropValue object. + * For {@link VehiclePropertyChangeMode#STATIC} properties, this method must + * always return the same value. + * For {@link VehiclePropertyChangeMode#ON_CHANGE} properties, it must + * return the latest available value. For cachable properties, the value + * within cache would be returned without talking with the actual car bus. + * + * Some properties like {@code RADIO_PRESET} requires to pass additional + * data in {@link VehiclePropValue} object. * * If there is no data available yet, which can happen during initial stage, - * this call must return immediately with an error code of - * StatusCode::TRY_AGAIN. - */ - StatusCode get(in VehiclePropValue requestedPropValue, out VehiclePropValue propValue); - - // Adding return type to method instead of out param VehiclePropConfig[] propConfigs since there - // is only one return value. - /** - * Returns a list of all property configurations supported by this vehicle - * HAL. - */ - VehiclePropConfig[] getAllPropConfigs(); - - /** - * Returns a list of property configurations for given properties. + * {@link GetValueResult#status} contains {@link StatusCode#TRY_AGAIN}. + * + * Caller must pass a unique RequestID for each request, if any of the + * given request ID is duplicate with one of the pending request ID, this + * function must return {@link StatusCode#INVALID_ARG}. + * + * To prevent confusion, duplicate properties (same property ID and same + * area ID) are not allowed in a single call. This function must return + * {@link StatusCode#INVALID_ARG} for duplicate properties. * - * If requested VehicleProperty wasn't found it must return - * StatusCode::INVALID_ARG, otherwise a list of vehicle property - * configurations with StatusCode::OK + * @param callback A callback interface, whose 'onGetValues' would be called + * after the value is fetched. Caller should use + * {@code android-automotive-large-parcelable} library to parse the + * returned {@link GetValueResult} object. + * @param requests An object that contains either a list of requested + * properties or a shared memory file that contains the properties. The + * object must be parsed using helper libraries on sender and receiver. */ - StatusCode getPropConfigs(in int[] props, out VehiclePropConfig[] propConfigs); + void getValues(IVehicleCallback callback, in GetValueRequests requests); - // Adding return type to method instead of out param StatusCode status since there is only one - // return value. /** - * Set a vehicle property value. + * Set vehicle property values. + * + * The {@link IVehicleCallback#onSetValues} function would be called after + * the values set request are sent through vehicle bus or are failed to set. + * If the bus protocol supports confirmation, the callback would be called + * after getting the confirmation. + * + * For some vehicle bus such as CAN bus where confirmation is not supported, + * OnSetValues does not necessarily mean the value changes would be + * reflected in {@link #getValues} immediately. + * + * If the output status contains error, it means we fail to set all the + * properties. If we failed to set some of the values, they would be + * reflected as non OK {@link SetValueResult#status}. + * + * The order each property in the request is set is not guaranteed. If + * caller needs to make sure certain order in setting values, caller should + * set one value, wait for its callback and then set the other value. * * Timestamp of data must be ignored for set operation. * - * Setting some properties require having initial state available. If initial - * data is not available yet this call must return StatusCode::TRY_AGAIN. - * For a property with separate power control this call must return - * StatusCode::NOT_AVAILABLE error if property is not powered on. + * Setting some properties requires having initial state available. If + * initial data is not available yet, the {@link SetValueResult#status} + * must be {@link StatusCode#TRY_AGAIN}. For a property with separate power + * control the {@link SetValueResult#status} must be + * {@link StatusCode#NOT_AVAILABLE} if property is not powered + * on. + * + * Caller must pass a unique RequestID for each request, if any of the + * given request ID is duplicate with one of the pending request ID, this + * function must return {@link StatusCode#INVALID_ARG}. + * + * To prevent confusion, duplicate properties (same property ID and same + * area ID) are not allowed in a single call. This function must return + * {@link StatusCode#INVALID_ARG} for duplicate properties. + * + * @param callback The callback, whose 'onSetValues' would be called after + * set value request is sent to bus. + * @param requests An object that contains a list of {@link SetValueRequest} + * or a shared memory file that stores the list of requests if they + * exceed binder memory limitation, must be parsed using helper libraries + * on sender and receiver. */ - StatusCode set(in VehiclePropValue propValue); + void setValues(IVehicleCallback callback, in SetValueRequests requests); - // Adding return type to method instead of out param StatusCode status since there is only one - // return value. /** * Subscribes to property events. * * Clients must be able to subscribe to multiple properties at a time * depending on data provided in options argument. * - * @param listener This client must be called on appropriate event. + * For one callback, the is only one subscription for one property. + * A new subscription with a different sample rate would override the old + * subscription. One property could be subscribed multiple times for + * different callbacks. + * + * @param callback The subscription callbacks. + * {@link IVehicleCallback#onPropertyEvent} would be called when a new + * property event arrives. + * {@link IVehicleCallback#onPropertySetError} would be called when a + * property set request failed asynchronously. This is usually caused by + * a property set failure message sent from the vehicle bus. * @param options List of options to subscribe. SubscribeOption contains - * information such as property Id, area Id, sample rate, etc. + * information such as property Id, area Id, sample rate, etc. + * @param maxSharedMemoryFileCount The maximum number of shared memory files + * allocated for in VHAL for this subscription. When a memory file is + * handled back to the client, it cannot be used by VHAL to deliver + * another event until the buffer is returned to VHAL by calling + * returnSharedMemory. A larger maxSharedMemoryFileCount means a better + * performance while handling large bursts of data, but also means larger + * memory footprint. If you don't expect events arriving very frequently, + * a recommended value is 2. A value of 0 means for each new property, + * a new shared memory file would be created and no shared memory file + * would ever be reused. This should only be configured for infrequent + * events or devices with limited memory. This value must be >=0 and + * < {@link MAX_SHARED_MEMORY_FILES_PER_CLIENT}. */ - StatusCode subscribe(in IVehicleCallback callback, in SubscribeOptions[] options); + void subscribe(in IVehicleCallback callback, in SubscribeOptions[] options, + int maxSharedMemoryFileCount); - // Adding return type to method instead of out param StatusCode status since there is only one - // return value. /** * Unsubscribes from property events. * - * If this client wasn't subscribed to the given property, this method - * must return StatusCode::INVALID_ARG. + * If 'callback' is not valid or 'propIds' were not subscribed for this + * 'callback', this method must return {@link StatusCode#INVALID_ARG}. + * + * @param callback The callback used in the previous subscription. + * @param propIds The IDs for the properties to unsubscribe. + */ + void unsubscribe(in IVehicleCallback callback, in int[] propIds); + + /** + * Return a shared memory file back to VHAL for recycle. + * + * This must be called after a shared memory file returned by + * {@link IVehicleCallback#onPropertyEvent} is no longer in-use by the + * client. This is usually called at the end of 'onPropertyEvent'. + * + * If the 'callback' is not valid or 'sharedMemoryId' does not match any + * SharedMemoryId in 'VehiclePropValues' passed to + * {@link IVehicleCallback#onPropertyEvent}, this method must return + * {@link StatusCode#INVALID_ARG}. + * + * @param callback The callback used in subscription. + * @param sharedMemoryId The ID returned by 'onPropertyEvent' representing + * the used shared memory file to return. */ - StatusCode unsubscribe(in IVehicleCallback callback, in int propId); + void returnSharedMemory(in IVehicleCallback callback, long sharedMemoryId); } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicleCallback.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicleCallback.aidl index 1b5a1e2027..2b50321b42 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicleCallback.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicleCallback.aidl @@ -16,45 +16,84 @@ package android.hardware.automotive.vehicle; +import android.hardware.automotive.vehicle.GetValueResults; +import android.hardware.automotive.vehicle.SetValueResults; import android.hardware.automotive.vehicle.StatusCode; -import android.hardware.automotive.vehicle.VehiclePropValue; +import android.hardware.automotive.vehicle.VehiclePropErrors; +import android.hardware.automotive.vehicle.VehiclePropValues; -// @VintfStability +@VintfStability interface IVehicleCallback { /** - * Event callback happens whenever a variable that the API user has - * subscribed to needs to be reported. This may be based purely on - * threshold and frequency (a regular subscription, see subscribe call's - * arguments) or when the IVehicle#set method was called and the actual - * change needs to be reported. + * Callback for {@link IVehicle#getValues} function. + * + * Called when some of the values to fetch are ready. This might be called + * once or multiple times for one 'getValues' request. Each callback + * contains part of the requested values. It is guaranteed that all the + * requested values would be returned in one of the callbacks, but the order + * each values are ready is not guaranteed. * - * These callbacks are chunked. + * @param responses An object either contains a list of + * {@link GetValueResult} if they fits the binder memory limitation or a + * shared memory file that contains responses. Each + * {@link GetValueResult} either contains the property value or contains + * an error happened while getting the value. * - * @param values that has been updated. + * {@link GetValueResult} also contains a requestId which indicates which + * request this response is for. The responses object should be parsed by + * {@code android-automotive-large-parcelable} library. */ - oneway void onPropertyEvent(in VehiclePropValue[] propValues); + oneway void onGetValues(in GetValueResults responses); /** - * This method gets called if the client was subscribed to a property using - * SubscribeFlags::EVENTS_FROM_ANDROID flag and IVehicle#set(...) method was called. + * Callback for {@link IVehicle#setValues} function. * - * These events must be delivered to subscriber immediately without any - * batching. + * Called when VHAL have finished handling some of the property set request. + * This might be called once or multiple times for one 'setValues' requests. + * Each callback contains part of the requested values. It is guaranteed + * that all the set value statuses would be returned in one of the + * callbacks, but the order each values are set is not guaranteed. + * + * @param responses A list of {@link SetValueResult}. Each SetValueResult + * contains a status indicating the status for setting the specific + * property. The requestId indicates which request the response is for. + */ + oneway void onSetValues(in SetValueResults responses); + + /** + * Event callback happens whenever one or more variables that the API user + * has subscribed to need to be reported. This may be based purely on + * threshold and frequency (a regular subscription, see subscribe call's + * arguments) or when the {@link IVehicle#setValues} method was called and + * the actual change needs to be reported. * - * @param value Value that was set by a client. + * @param propValues The updated property values wrapped in an object. + * If the properties fit within binder limitation, they would be in + * {@code propValues.payloads}, otherwise, they would be in a shared + * memory file {@code propValues.sharedMemoryFd}. + * The shared memory file is created by VHAL and must be returned to + * VHAL using {@link IVehicle#returnSharedMemory} after use. There are + * limited number of memory files created for each subscription, if + * the client doesn't return the shared memory, the client might not get + * event in the future. + * @param sharedMemoryFileCount Number of shared memory file allocated for + * this subscription. This value could be used to tweak + * {@code maxSharedMemoryFileCount} in {@link IVehicle#subscribe}. For + * example, if you usually see sharedMemoryFileCount being the + * maxSharedMemoryFileCount you set, this means you might need to + * increase maxSharedMemoryFileCount. */ - oneway void onPropertySet(in VehiclePropValue propValue); + oneway void onPropertyEvent(in VehiclePropValues propValues, int sharedMemoryFileCount); /** * Set property value is usually asynchronous operation. Thus even if - * client received StatusCode::OK from the IVehicle::set(...) this - * doesn't guarantee that the value was successfully propagated to the - * vehicle network. If such rare event occurs this method must be called. + * client received {@link StatusCode#OK} from {@link IVehicle#setValues}, or + * received {@link StatusCode#OK} in {@link #onSetValues}, this doesn't + * guarantee that the value was successfully propagated to the vehicle + * network. If such rare event occurs this method must be called. * - * @param errorCode - any value from StatusCode enum. - * @param property - a property where error has happened. - * @param areaId - bitmask that specifies in which areas the problem has - * occurred, must be 0 for global properties + * @param errors A list of property set errors. If the VHAL implementation + * does not batch the errors, this may only contain one error. */ - oneway void onPropertySetError(in StatusCode errorCode, in int propId, in int areaId); + oneway void onPropertySetError(in VehiclePropErrors errors); } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl index 12746ce993..7879d44f06 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl @@ -25,7 +25,7 @@ import android.hardware.automotive.vehicle.UsersInfo; * NOTE: this struct is not used in the HAL properties directly, it must be converted to * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ -// @VintfStability +@VintfStability parcelable InitialUserInfoRequest { /** * Arbitrary id used to map the HAL response to the request. @@ -34,7 +34,7 @@ parcelable InitialUserInfoRequest { /** * Type of request. */ - InitialUserInfoRequestType requestType; + InitialUserInfoRequestType requestType = InitialUserInfoRequestType.UNKNOWN; /** * Information about the current state of the Android system. */ diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl index 12fec24475..829a63ad20 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl @@ -19,9 +19,10 @@ package android.hardware.automotive.vehicle; /** * Defines when a INITIAL_USER_INFO request was made. */ -// @VintfStability +@VintfStability @Backing(type="int") enum InitialUserInfoRequestType { + UNKNOWN = 0, /** * At the first time Android was booted (or after a factory reset). */ diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl index 34d9062618..8be0c69431 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl @@ -25,7 +25,7 @@ import android.hardware.automotive.vehicle.UserInfo; * NOTE: this struct is not used in the HAL properties directly, it must be converted to * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ -// @VintfStability +@VintfStability parcelable InitialUserInfoResponse { /** * Id of the request being responded. @@ -34,7 +34,7 @@ parcelable InitialUserInfoResponse { /** * which action the Android system should take. */ - InitialUserInfoResponseAction action; + InitialUserInfoResponseAction action = InitialUserInfoResponseAction.DEFAULT; /** * Information about the user that should be switched to or created. */ diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl index e35fa9ab03..9a0741e414 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Defines which action the Android system should take in an INITIAL_USER_INFO request. */ -// @VintfStability +@VintfStability @Backing(type="int") enum InitialUserInfoResponseAction { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl index 775d53112a..c1bba8ee8c 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl @@ -20,7 +20,7 @@ package android.hardware.automotive.vehicle; * Ignition monitors common to both SPARK and COMPRESSION. * These values come from the SAE J1979 standard. */ -// @VintfStability +@VintfStability @Backing(type="int") enum Obd2CommonIgnitionMonitors { COMPONENTS_AVAILABLE = 0x1 << 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl index ab444e16e0..ccb49aa1b5 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl @@ -22,7 +22,7 @@ import android.hardware.automotive.vehicle.Obd2CommonIgnitionMonitors; * Ignition monitors only available for COMPRESSION vehicles. * These values come from the SAE J1979 standard. */ -// @VintfStability +@VintfStability @Backing(type="int") enum Obd2CompressionIgnitionMonitors { COMPONENTS_AVAILABLE = 0x1 << 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl index 9b4ce8f976..8266ee2c98 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl @@ -20,7 +20,7 @@ package android.hardware.automotive.vehicle; * The status of the vehicle's fuel system. * These values come from the SAE J1979 standard. */ -// @VintfStability +@VintfStability @Backing(type="int") enum Obd2FuelSystemStatus { OPEN_INSUFFICIENT_ENGINE_TEMPERATURE = 1, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelType.aidl index 1428f2c05a..c7b4f7773c 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelType.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2FuelType.aidl @@ -20,7 +20,7 @@ package android.hardware.automotive.vehicle; * The fuel type(s) supported by a vehicle. * These values come from the SAE J1979 standard. */ -// @VintfStability +@VintfStability @Backing(type="int") enum Obd2FuelType { NOT_AVAILABLE = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl index 477b38d358..7399f7bb97 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Defines which ignition monitors are available to be read. */ -// @VintfStability +@VintfStability @Backing(type="int") enum Obd2IgnitionMonitorKind { SPARK = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl index f257164066..06748caea0 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl @@ -20,7 +20,7 @@ package android.hardware.automotive.vehicle; * The status of the vehicle's secondary air system. * These values come from the SAE J1979 standard. */ -// @VintfStability +@VintfStability @Backing(type="int") enum Obd2SecondaryAirStatus { UPSTREAM = 1, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl index 75504df675..d814b5edfc 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl @@ -22,7 +22,7 @@ import android.hardware.automotive.vehicle.Obd2CommonIgnitionMonitors; * Ignition monitors available for SPARK vehicles. * These values come from the SAE J1979 standard. */ -// @VintfStability +@VintfStability @Backing(type="int") enum Obd2SparkIgnitionMonitors { COMPONENTS_AVAILABLE = 0x1 << 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/PortLocationType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/PortLocationType.aidl index 260dd42ee4..ce26e1c3f0 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/PortLocationType.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/PortLocationType.aidl @@ -20,7 +20,7 @@ package android.hardware.automotive.vehicle; * Used by INFO_FUEL_DOOR_LOCATION/INFO_CHARGE_PORT_LOCATION to enumerate fuel door or * ev port location. */ -// @VintfStability +@VintfStability @Backing(type="int") enum PortLocationType { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl index e54a08b3be..4dec772897 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl @@ -20,7 +20,7 @@ package android.hardware.automotive.vehicle; * The reason why a process is terminated by car watchdog. * This is used with WATCHDOG_TERMINATED_PROCESS property. */ -// @VintfStability +@VintfStability @Backing(type="int") enum ProcessTerminationReason { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValueRawValue.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl similarity index 65% rename from automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValueRawValue.aidl rename to automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl index 325b7f0efa..5d8febd196 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValueRawValue.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl @@ -16,32 +16,26 @@ package android.hardware.automotive.vehicle; -/** - * Contains value for a single property. Depending on property data type of - * this property (VehiclePropetyType) one field of this structure must be filled in. - */ -// @VintfStability -parcelable VehiclePropValueRawValue { +@VintfStability +parcelable RawPropValues { /** * This is used for properties of types VehiclePropertyType#INT * and VehiclePropertyType#INT_VEC */ - int[] int32Values; + int[] int32Values = {}; + /** * This is used for properties of types VehiclePropertyType#FLOAT * and VehiclePropertyType#FLOAT_VEC */ float[] floatValues; - /** - * This is used for properties of type VehiclePropertyType#INT64 - */ + + /** This is used for properties of type VehiclePropertyType#INT64 */ long[] int64Values; - /** - * This is used for properties of type VehiclePropertyType#BYTES - */ - byte[] bytes; - /** - * This is used for properties of type VehiclePropertyType#STRING - */ + + /** This is used for properties of type VehiclePropertyType#BYTES */ + byte[] byteValues; + + /** This is used for properties of type VehiclePropertyType#STRING */ @utf8InCpp String stringValue; } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl index 79a8c598dc..1a3d4dd096 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl @@ -25,7 +25,7 @@ import android.hardware.automotive.vehicle.UsersInfo; * NOTE: this struct is not used in the HAL properties directly, it must be converted to * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ -// @VintfStability +@VintfStability parcelable RemoveUserRequest { /** * Arbitrary id used to map the response to the request. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RotaryInputType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RotaryInputType.aidl index eca703a9c2..5f08ed7d03 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RotaryInputType.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RotaryInputType.aidl @@ -20,7 +20,7 @@ package android.hardware.automotive.vehicle; * A rotary control which can rotate without limits. These controls use HW_ROTARY_INPUT to report * relative clockwise or counterclockwise motion. They have no absolute position. */ -// @VintfStability +@VintfStability @Backing(type="int") enum RotaryInputType { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequest.aidl new file mode 100644 index 0000000000..1771c631e7 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequest.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VehiclePropValue; + +@VintfStability +parcelable SetValueRequest { + // The value to set. + VehiclePropValue value; + // A unique request ID. For every client, the request ID must start with 1 + // and monotonically increase for every SetValueRequest. If it hits + // LONG_MAX (very unlikely), it must loop back to 0. + long requestId; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequests.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequests.aidl new file mode 100644 index 0000000000..5d6ad85766 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequests.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.SetValueRequest; +import android.os.ParcelFileDescriptor; + +@VintfStability +parcelable SetValueRequests { + // The list of request if they fit the binder memory limitation. + SetValueRequest[] payloads; + // Shared memory file to store requests if they exceed binder memory + // limitation. Created by client, readable only at VHAL during the call. + // Caller could close it after the call. + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResult.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResult.aidl new file mode 100644 index 0000000000..a468f3be0c --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResult.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.StatusCode; + +@VintfStability +parcelable SetValueResult { + // The ID for the request this response is for. + long requestId; + // The status for the setValue operation. + StatusCode status = StatusCode.OK; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResults.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResults.aidl new file mode 100644 index 0000000000..6df9de053b --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResults.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.SetValueResult; +import android.os.ParcelFileDescriptor; + +@VintfStability +parcelable SetValueResults { + // The list of responses if they fit the binder memory limitation. + SetValueResult[] payloads; + // Shared memory file to store responses if they exceed binder memory + // limitation. Created by VHAL, readable only for the client. + // The client must close it after reading. + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl index 9b29229757..23019cada8 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Error codes used in vehicle HAL interface. */ -// @VintfStability +@VintfStability @Backing(type="int") enum StatusCode { OK = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeFlags.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeFlags.aidl deleted file mode 100644 index d997990d1d..0000000000 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeFlags.aidl +++ /dev/null @@ -1,43 +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. - */ - -package android.hardware.automotive.vehicle; - -// @VintfStability -@Backing(type="int") -enum SubscribeFlags { - UNDEFINED = 0x0, - - /** - * Subscribe to event that was originated in vehicle HAL - * (most likely this event came from the vehicle itself). - */ - EVENTS_FROM_CAR = 0x1, - - /** - * Use this flag to subscribe on events when IVehicle#set(...) was called by - * vehicle HAL's client (e.g. Car Service). - */ - EVENTS_FROM_ANDROID = 0x2, - - /** - * Property event for this property should be passed through shared memory with only this - * property's data included. This can be helpful for reducing memory copy in upper layer - * for data with bigger payload. If payload size is small, VHAL can send this through non-shared - * memory path instead. - */ - EXCLUSIVE_SHARED_MEMORY = 0x4, -} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl index 0769f286cb..bc7d84a3a2 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl @@ -16,16 +16,18 @@ package android.hardware.automotive.vehicle; -import android.hardware.automotive.vehicle.SubscribeFlags; - /** * Encapsulates information about subscription to vehicle property events. */ -// @VintfStability +@VintfStability parcelable SubscribeOptions { /** Property to subscribe */ int propId; - + /** + * Optional areas to subscribe for this property, if empty, would subscribe + * to all areas configured for this property. + */ + int[] areaIds; /** * Sample rate in Hz. * @@ -36,7 +38,4 @@ parcelable SubscribeOptions { * This value indicates how many updates per second client wants to receive. */ float sampleRate; - - /** Flags that indicate to which event sources to listen. */ - SubscribeFlags flags; } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl index c0b5d68be1..f6ace54b7c 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl @@ -21,9 +21,10 @@ package android.hardware.automotive.vehicle; * * The meaning of each constant is explained in that property. */ -// @VintfStability +@VintfStability @Backing(type="int") enum SwitchUserMessageType { + UNKNOWN = 0, LEGACY_ANDROID_SWITCH = 1, ANDROID_SWITCH = 2, VEHICLE_RESPONSE = 3, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl index 9a324f417a..10858a4e74 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl @@ -26,7 +26,7 @@ import android.hardware.automotive.vehicle.UsersInfo; * NOTE: this struct is not used in the HAL properties directly, it must be converted to * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ -// @VintfStability +@VintfStability parcelable SwitchUserRequest { /** * Arbitrary id used to map the response to the request. @@ -35,7 +35,7 @@ parcelable SwitchUserRequest { /** * Type of message. */ - SwitchUserMessageType messageType; + SwitchUserMessageType messageType = SwitchUserMessageType.UNKNOWN; /** * Information about the Android user being switched to. * diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl index 175859d4dd..d5d44e56fa 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl @@ -25,7 +25,7 @@ import android.hardware.automotive.vehicle.SwitchUserStatus; * NOTE: this struct is not used in the HAL properties directly, it must be converted to * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ -// @VintfStability +@VintfStability parcelable SwitchUserResponse { /** * Id of the request being responded. @@ -34,11 +34,11 @@ parcelable SwitchUserResponse { /** * Type of message. */ - SwitchUserMessageType messageType; + SwitchUserMessageType messageType = SwitchUserMessageType.UNKNOWN; /** * Status of the request. */ - SwitchUserStatus status; + SwitchUserStatus status = SwitchUserStatus.SUCCESS; /** * HAL-specific error message. * diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserStatus.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserStatus.aidl index 11dc5f291d..a84d1ce57a 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserStatus.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserStatus.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Status of the response to a SwitchUserRequest. */ -// @VintfStability +@VintfStability @Backing(type="int") enum SwitchUserStatus { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserFlags.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserFlags.aidl index 8daa0c1c09..caa62dfa82 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserFlags.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserFlags.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Flags used to define the characteristics of an Android user. */ -// @VintfStability +@VintfStability @Backing(type="int") enum UserFlags { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl index 9531bb39ca..cdd11bfe2d 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl @@ -22,7 +22,7 @@ import android.hardware.automotive.vehicle.UserIdentificationAssociationValue; /** * Helper struct used when getting a user/identification association type. */ -// @VintfStability +@VintfStability parcelable UserIdentificationAssociation { UserIdentificationAssociationType type = UserIdentificationAssociationType.INVALID; UserIdentificationAssociationValue value = UserIdentificationAssociationValue.UNKNOWN; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl index 5be7f99c8e..eceb30fd0e 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Used to set a UserIdentificationAssociationType with an Android user. */ -// @VintfStability +@VintfStability @Backing(type="int") enum UserIdentificationAssociationSetValue { INVALID = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl index 141aca883c..4b21b5a1a8 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl @@ -21,7 +21,7 @@ package android.hardware.automotive.vehicle; * * See USER_IDENTIFICATION_ASSOCIATION for more details and example. */ -// @VintfStability +@VintfStability @Backing(type="int") enum UserIdentificationAssociationType { INVALID = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl index c11ad2a41e..28dad0d3a7 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Whether a UserIdentificationAssociationType is associate with an Android user. */ -// @VintfStability +@VintfStability @Backing(type="int") enum UserIdentificationAssociationValue { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl index cb4b8cf60e..58620efa59 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl @@ -25,7 +25,7 @@ import android.hardware.automotive.vehicle.UserInfo; * NOTE: this struct is not used in the HAL properties directly, it must be converted to * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ -// @VintfStability +@VintfStability parcelable UserIdentificationGetRequest { /** * Id of the request being responded. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl index e8eb3a36c2..06341c7f7d 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl @@ -24,7 +24,7 @@ import android.hardware.automotive.vehicle.UserIdentificationAssociation; * NOTE: this struct is not used in the HAL properties directly, it must be converted to * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ -// @VintfStability +@VintfStability parcelable UserIdentificationResponse { /** * Id of the request being responded. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl index 392ae995aa..fe5017fcc8 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl @@ -22,7 +22,7 @@ import android.hardware.automotive.vehicle.UserIdentificationAssociationType; /** * Helper struct used when setting a user/identification association type. */ -// @VintfStability +@VintfStability parcelable UserIdentificationSetAssociation { UserIdentificationAssociationType type = UserIdentificationAssociationType.INVALID; UserIdentificationAssociationSetValue value = UserIdentificationAssociationSetValue.INVALID; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl index dafb1d1436..13f36773e5 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl @@ -24,7 +24,7 @@ import android.hardware.automotive.vehicle.UserInfo; * NOTE: this struct is not used in the HAL properties directly, it must be converted to * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ -// @VintfStability +@VintfStability parcelable UserIdentificationSetRequest { /** * Id of the request being responded. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl index 0a84308c75..e96fa37743 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl @@ -21,7 +21,7 @@ import android.hardware.automotive.vehicle.UserFlags; /** * Information about a specific Android user. */ -// @VintfStability +@VintfStability parcelable UserInfo { int userId = 0; UserFlags flags = UserFlags.NONE; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl index 28b3f95679..77468b1e0c 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl @@ -25,7 +25,7 @@ import android.hardware.automotive.vehicle.UserInfo; * in turn are converted to a VehiclePropValue.RawValue through libraries provided by the default * Vehicle HAL implementation. */ -// @VintfStability +@VintfStability parcelable UsersInfo { /** * The current foreground user. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl index 9e593c5f26..7cb5db3d4d 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleApPowerStateConfigFlag { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl index b6cc70d34d..f1d741f5a1 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleApPowerStateReport { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl index 06bc073287..82f98d8a48 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleApPowerStateReq { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl index a3d6c7f812..aa556b081c 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Index in int32Values for VehicleProperty#AP_POWER_STATE_REQ property. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleApPowerStateReqIndex { STATE = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl index f4ab08052d..7b682b5efa 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleApPowerStateShutdownParam { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleArea.aidl index 53b85ebdde..dab03496cb 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleArea.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleArea.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleArea { GLOBAL = 0x01000000, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl index 0a688c0edc..b33dcbc509 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability parcelable VehicleAreaConfig { /** * Area id is ignored for VehiclePropertyGroup:GLOBAL properties. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl index c85b171c00..b729b8b838 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleAreaDoor { ROW_1_LEFT = 0x00000001, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl index daecf0b612..e1fd03b904 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleAreaMirror { DRIVER_LEFT = 0x00000001, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl index 9d16c8678c..89d50ea183 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Various Seats in the car. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleAreaSeat { ROW_1_LEFT = 0x0001, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl index 0e5b995531..89f73cb656 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleAreaWheel { UNKNOWN = 0x0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl index bab0a3f802..e1e8e85c20 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Various windshields/windows in the car. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleAreaWindow { FRONT_WINDSHIELD = 0x00000001, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleDisplay.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleDisplay.aidl index a7531c4965..1759a90e51 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleDisplay.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleDisplay.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleDisplay { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleGear.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleGear.aidl index 8b08ff8079..40e492eca6 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleGear.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleGear.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Various gears which can be selected by user and chosen in system. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleGear { GEAR_UNKNOWN = 0x0000, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl index 19676790c6..fa5d711ef3 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Bit flags for fan direction */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleHvacFanDirection { UNKNOWN = 0x0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl index 2dfd070eaa..93e42a0a88 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleHwKeyInputAction { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl index cf9db976b8..4de97f6639 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleIgnitionState { UNDEFINED = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightState.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightState.aidl index bfe9163dc7..ede20b7967 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightState.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightState.aidl @@ -22,7 +22,7 @@ package android.hardware.automotive.vehicle; * Most XXX_LIGHTS_STATE properties will only report ON and OFF states. Only * the HEADLIGHTS_STATE property will report DAYTIME_RUNNING. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleLightState { OFF = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl index 061f85d714..247e731206 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl @@ -23,7 +23,7 @@ package android.hardware.automotive.vehicle; * selects. The switch setting may be decoupled from the state reported if the * user selects AUTOMATIC. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleLightSwitch { OFF = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleOilLevel.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleOilLevel.aidl index 8ea629321b..bf3c858c55 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleOilLevel.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleOilLevel.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleOilLevel { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl index 3b4e10a1ff..5e0dbecdb4 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl @@ -20,7 +20,7 @@ import android.hardware.automotive.vehicle.VehicleAreaConfig; import android.hardware.automotive.vehicle.VehiclePropertyAccess; import android.hardware.automotive.vehicle.VehiclePropertyChangeMode; -// @VintfStability +@VintfStability parcelable VehiclePropConfig { /** Property identifier */ int prop; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl new file mode 100644 index 0000000000..98abdefbd5 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VehiclePropConfig; +import android.os.ParcelFileDescriptor; + +@VintfStability +parcelable VehiclePropConfigs { + // The list of vehicle property configs if they fit the binder memory + // limitation. + VehiclePropConfig[] payloads; + // Shared memory file to store configs if they exceed binder memory + // limitation. Created by VHAL, readable only at client. Client could keep + // the fd opened or keep the FD mapped to access configs. + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropError.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropError.aidl new file mode 100644 index 0000000000..1608977c27 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropError.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.StatusCode; + +@VintfStability +parcelable VehiclePropError { + // Property ID. + int propId; + // Area ID. + int areaId; + // The error associated with this property. + StatusCode errorCode = StatusCode.OK; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropErrors.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropErrors.aidl new file mode 100644 index 0000000000..6a77d356d6 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropErrors.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VehiclePropError; +import android.os.ParcelFileDescriptor; + +@VintfStability +parcelable VehiclePropErrors { + // List of property set errors if they fit binder memory limitation. + VehiclePropError[] payloads; + // Shared memory file to store payloads if they exceed binder memory + // limitation. + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl index 4d403f93be..37dac59a21 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl @@ -16,6 +16,7 @@ package android.hardware.automotive.vehicle; +import android.hardware.automotive.vehicle.RawPropValues; import android.hardware.automotive.vehicle.VehiclePropertyStatus; /** @@ -23,7 +24,7 @@ import android.hardware.automotive.vehicle.VehiclePropertyStatus; * is used across various API calls to set values, get values or to register for * events. */ -// @VintfStability +@VintfStability parcelable VehiclePropValue { /** Time is elapsed nanoseconds since boot */ long timestamp; @@ -38,26 +39,7 @@ parcelable VehiclePropValue { int prop; /** Status of the property */ - VehiclePropertyStatus status; + VehiclePropertyStatus status = VehiclePropertyStatus.AVAILABLE; - /** - * This is used for properties of types VehiclePropertyType#INT - * and VehiclePropertyType#INT_VEC - */ - int[] int32Values; - - /** - * This is used for properties of types VehiclePropertyType#FLOAT - * and VehiclePropertyType#FLOAT_VEC - */ - float[] floatValues; - - /** This is used for properties of type VehiclePropertyType#INT64 */ - long[] int64Values; - - /** This is used for properties of type VehiclePropertyType#BYTES */ - byte[] byteValues; - - /** This is used for properties of type VehiclePropertyType#STRING */ - @utf8InCpp String stringValue; + RawPropValues value; } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValues.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValues.aidl new file mode 100644 index 0000000000..1944f8e321 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValues.aidl @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +import android.hardware.automotive.vehicle.VehiclePropValue; +import android.os.ParcelFileDescriptor; + +@VintfStability +parcelable VehiclePropValues { + // The list of vehicle properties if they fit the binder memory limitation. + VehiclePropValue[] payloads; + // An unique ID associated with this sharedMemoryFd file. + // Must be INVALID_MEMORY_ID if shared memory file is not used. If shared + // memory file is used, This ID must be sent back to the server using + // returnSharedMemory after this object has been used. + long sharedMemoryId; + // Shared memory file to store props if they exceed binder memory + // limitation. Created by VHAL, readable only at client. Client must close + // it after use and call returnSharedMemory. + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl index a3a4b3d62f..65a22dbbde 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -36,7 +36,7 @@ import android.hardware.automotive.vehicle.VehiclePropertyType; * Properties set to values out of range must be ignored and no action taken * in response to such ill formed requests. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleProperty { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl index 055f96f2cc..76e38e3893 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl @@ -22,7 +22,7 @@ package android.hardware.automotive.vehicle; * commands and also to ensure that set() or events commands are in sync with * the expected output. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehiclePropertyAccess { NONE = 0x00, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl index 2628730179..57228db5d5 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * This describes how value of property can change. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehiclePropertyChangeMode { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl index 529a46da6f..a2cbdec5e8 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability @Backing(type="int") enum VehiclePropertyGroup { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl index 6dea0d1e2b..400e256697 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Property status is a dynamic value that may change based on the vehicle state. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehiclePropertyStatus { /** Property is available and behaving normally */ diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyType.aidl index 4591e9293a..62d26de3c3 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyType.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyType.aidl @@ -21,7 +21,7 @@ package android.hardware.automotive.vehicle; * * Used to create property ID in VehicleProperty enum. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehiclePropertyType { STRING = 0x00100000, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl index a17c9f0a86..3a08a51492 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Used by seat occupancy to enumerate the current occupancy state of the seat. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleSeatOccupancyState { UNKNOWN = 0, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl index cec86db73c..f0f46ad137 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl @@ -16,7 +16,7 @@ package android.hardware.automotive.vehicle; -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleTurnSignal { NONE = 0x00, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl index 3fc69de766..9c3f8f9852 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Units used for int or float type with no attached enum types. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleUnit { SHOULD_NOT_USE = 0x000, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl index 46a66e129a..29ad170817 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl @@ -19,7 +19,7 @@ package android.hardware.automotive.vehicle; /** * Used by SUPPORT_CUSTOMIZE_VENDOR_PERMISSION to indicate the permission of vendor properties. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VehicleVendorPermission { PERMISSION_DEFAULT = 0x00000000, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl index 74e944ddb7..def7c280cc 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl @@ -31,7 +31,7 @@ import android.hardware.automotive.vehicle.VmsBaseMessageIntegerValuesIndex; * - Number of publisher IDs (N) * - N x publisher ID */ -// @VintfStability +@VintfStability @Backing(type="int") enum VmsAvailabilityStateIntegerValuesIndex { /* diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl index a3a2e18759..a82ce0b211 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl @@ -21,7 +21,7 @@ package android.hardware.automotive.vehicle; * Messages with no parameters such as VmsMessageType.AVAILABILITY_REQUEST, * VmsMessageType.SUBSCRIPTIONS_REQUEST and VmsMessageType.DATA are also based on this enum. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VmsBaseMessageIntegerValuesIndex { /* diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageType.aidl index bdffde7a6f..6f03e37413 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageType.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageType.aidl @@ -21,7 +21,7 @@ package android.hardware.automotive.vehicle; * integer in the vehicle property integers array and determines how the rest of * the message is decoded. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VmsMessageType { /** diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl index 594ddbc303..c3a189cf46 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl @@ -23,7 +23,7 @@ import android.hardware.automotive.vehicle.VmsMessageWithLayerIntegerValuesIndex * VmsMessageType.SUBSCRIBE_TO_PUBLISHER, VmsMessageType.UNSUBSCRIBE_TO_PUBLISHER messages and * VmsMessageType.DATA . */ -// @VintfStability +@VintfStability @Backing(type="int") enum VmsMessageWithLayerAndPublisherIdIntegerValuesIndex { /* diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl index e3a6126502..b209bf6bdb 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl @@ -25,7 +25,7 @@ import android.hardware.automotive.vehicle.VmsBaseMessageIntegerValuesIndex; * The layer type is defined in the VMS protocol, and the subtype and version are * controlled by the implementer of the publisher. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VmsMessageWithLayerIntegerValuesIndex { /* diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl index 9dc7a58736..91c3297a37 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl @@ -30,7 +30,7 @@ import android.hardware.automotive.vehicle.VmsBaseMessageIntegerValuesIndex; * - Number of dependencies (N) * - N x (Layer type, Layer subtype, Layer version) */ -// @VintfStability +@VintfStability @Backing(type="int") enum VmsOfferingMessageIntegerValuesIndex { /* diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl index 32049ccb0b..79bbe50aff 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl @@ -23,7 +23,7 @@ import android.hardware.automotive.vehicle.VmsBaseMessageIntegerValuesIndex; * Subscribers can request the publisher information for a publisher ID they received in other * messages. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VmsPublisherInformationIntegerValuesIndex { /* diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl index 95f2d6d597..313ed8936f 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl @@ -35,7 +35,7 @@ import android.hardware.automotive.vehicle.VmsBaseMessageIntegerValuesIndex; * Any VMS messages received between initiation and completion of the handshake * must be discarded. */ -// @VintfStability +@VintfStability @Backing(type="int") enum VmsStartSessionMessageIntegerValuesIndex { /* diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl index 87d59e5471..cd03535a9a 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl @@ -36,7 +36,7 @@ import android.hardware.automotive.vehicle.VmsBaseMessageIntegerValuesIndex; * - Number of publisher IDs (N) * - N x publisher ID */ -// @VintfStability +@VintfStability @Backing(type="int") enum VmsSubscriptionsStateIntegerValuesIndex { /* -- GitLab From e0a9bb21d6308ad2b20ea3540188cb6417da6a54 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Mon, 13 Sep 2021 16:08:07 -0700 Subject: [PATCH 138/825] [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces Added SPDX-license-identifier-Apache-2.0 to: contexthub/aidl/Android.bp contexthub/aidl/vts/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Change-Id: I15a1336ba7f45039e0146f29f834f2b55c0def42 --- contexthub/aidl/Android.bp | 9 +++++++++ contexthub/aidl/vts/Android.bp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/contexthub/aidl/Android.bp b/contexthub/aidl/Android.bp index 2086508e67..e9143b5256 100644 --- a/contexthub/aidl/Android.bp +++ b/contexthub/aidl/Android.bp @@ -12,6 +12,15 @@ // 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.contexthub", vendor_available: true, diff --git a/contexthub/aidl/vts/Android.bp b/contexthub/aidl/vts/Android.bp index c4268c4509..673eac0b93 100644 --- a/contexthub/aidl/vts/Android.bp +++ b/contexthub/aidl/vts/Android.bp @@ -12,6 +12,15 @@ // 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: "VtsAidlHalContextHubTargetTest", defaults: [ -- GitLab From 9de3fb07ce91f3e5227498aa0b7670b989bce5fb Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 13 Sep 2021 17:28:00 -0700 Subject: [PATCH 139/825] Migrate VehicleObjectPool Test: atest VehicleHalVehicleUtilsTest Bug: 199337732 Change-Id: I93772c401dc077f1fbab79e302336494039308d1 --- .../utils/common/include/VehicleObjectPool.h | 294 ++++++++++++++ .../impl/utils/common/include/VehicleUtils.h | 99 +++++ .../utils/common/src/VehicleObjectPool.cpp | 165 ++++++++ .../common/test/VehicleObjectPoolTest.cpp | 381 ++++++++++++++++++ .../utils/common/test/VehicleUtilsTest.cpp | 125 ++++++ 5 files changed, 1064 insertions(+) create mode 100644 automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h create mode 100644 automotive/vehicle/aidl/impl/utils/common/src/VehicleObjectPool.cpp create mode 100644 automotive/vehicle/aidl/impl/utils/common/test/VehicleObjectPoolTest.cpp diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h new file mode 100644 index 0000000000..61e475aee9 --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h @@ -0,0 +1,294 @@ +/* + * 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_include_VehicleObjectPool_H_ +#define android_hardware_automotive_vehicle_utils_include_VehicleObjectPool_H_ + +#include +#include +#include +#include + +#include + +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +// Handy metric mostly for unit tests and debug. +#define INC_METRIC_IF_DEBUG(val) PoolStats::instance()->val++; + +struct PoolStats { + std::atomic Obtained{0}; + std::atomic Created{0}; + std::atomic Recycled{0}; + std::atomic Deleted{0}; + + static PoolStats* instance() { + static PoolStats inst; + return &inst; + } +}; + +template +struct Deleter { + using OnDeleteFunc = std::function; + + explicit Deleter(const OnDeleteFunc& f) : mOnDelete(f){}; + + Deleter() = default; + Deleter(const Deleter&) = default; + + void operator()(T* o) { mOnDelete(o); } + + private: + OnDeleteFunc mOnDelete; +}; + +// This is std::unique_ptr<> with custom delete operation that typically moves the pointer it holds +// back to ObjectPool. +template +using recyclable_ptr = typename std::unique_ptr>; + +// Generic abstract object pool class. Users of this class must implement {@Code createObject}. +// +// This class is thread-safe. Concurrent calls to {@Code obtain} from multiple threads is OK, also +// client can obtain an object in one thread and then move ownership to another thread. +template +class ObjectPool { + public: + using GetSizeFunc = std::function; + + ObjectPool(size_t maxPoolObjectsSize, GetSizeFunc getSizeFunc) + : mMaxPoolObjectsSize(maxPoolObjectsSize), mGetSizeFunc(getSizeFunc){}; + virtual ~ObjectPool() = default; + + virtual recyclable_ptr obtain() { + std::lock_guard lock(mLock); + INC_METRIC_IF_DEBUG(Obtained) + if (mObjects.empty()) { + INC_METRIC_IF_DEBUG(Created) + return wrap(createObject()); + } + + auto o = wrap(mObjects.front().release()); + mObjects.pop_front(); + mPoolObjectsSize -= mGetSizeFunc(*o); + return o; + } + + ObjectPool& operator=(const ObjectPool&) = delete; + ObjectPool(const ObjectPool&) = delete; + + protected: + virtual T* createObject() = 0; + + virtual void recycle(T* o) { + std::lock_guard lock(mLock); + size_t objectSize = mGetSizeFunc(*o); + + if (objectSize > mMaxPoolObjectsSize || + mPoolObjectsSize > mMaxPoolObjectsSize - objectSize) { + INC_METRIC_IF_DEBUG(Deleted) + + // We have no space left in the pool. + delete o; + return; + } + + INC_METRIC_IF_DEBUG(Recycled) + + mObjects.push_back(std::unique_ptr{o}); + mPoolObjectsSize += objectSize; + } + + const size_t mMaxPoolObjectsSize; + + private: + const Deleter& getDeleter() { + if (!mDeleter.get()) { + Deleter* d = + new Deleter(std::bind(&ObjectPool::recycle, this, std::placeholders::_1)); + mDeleter.reset(d); + } + return *mDeleter.get(); + } + + recyclable_ptr wrap(T* raw) { return recyclable_ptr{raw, getDeleter()}; } + + mutable std::mutex mLock; + std::deque> mObjects GUARDED_BY(mLock); + std::unique_ptr> mDeleter; + size_t mPoolObjectsSize GUARDED_BY(mLock); + GetSizeFunc mGetSizeFunc; +}; + +#undef INC_METRIC_IF_DEBUG + +// This class provides a pool of recyclable VehiclePropertyValue objects. +// +// It has only one overloaded public method - obtain(...), users must call this method when new +// object is needed with given VehiclePropertyType and vector size (for vector properties). This +// method returns a recyclable smart pointer to VehiclePropertyValue, essentially this is a +// std::unique_ptr with custom delete function, so recyclable object has only one owner and +// developers can safely pass it around. Once this object goes out of scope, it will be returned to +// the object pool. +// +// Some objects are not recyclable: strings and vector data types with vector +// length > maxRecyclableVectorSize (provided in the constructor). These objects will be deleted +// immediately once the go out of scope. There's no synchronization penalty for these objects since +// we do not store them in the pool. +// +// This class is thread-safe. Users can obtain an object in one thread and pass it to another. +// +// Sample usage: +// +// VehiclePropValuePool pool; +// auto v = pool.obtain(VehiclePropertyType::INT32); +// v->propId = VehicleProperty::HVAC_FAN_SPEED; +// v->areaId = VehicleAreaSeat::ROW_1_LEFT; +// v->timestamp = elapsedRealtimeNano(); +// v->value->int32Values[0] = 42; +class VehiclePropValuePool { + public: + using RecyclableType = + recyclable_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>; + + // Creates VehiclePropValuePool + // + // @param maxRecyclableVectorSize - vector value types (e.g. VehiclePropertyType::INT32_VEC) + // with size equal or less to this value will be stored in the pool. If users tries to obtain + // value with vector size greater than maxRecyclableVectorSize, user will receive a regular + // unique pointer instead of a recyclable pointer. The object would not be recycled once it + // goes out of scope, but would be deleted. + // @param maxPoolObjectsSize - The approximate upper bound of memory each internal recycling + // pool could take. We have 4 different type pools, each with 4 different vector size, so + // approximately this pool would at-most take 4 * 4 * 10240 = 160k memory. + VehiclePropValuePool(size_t maxRecyclableVectorSize = 4, size_t maxPoolObjectsSize = 10240) + : mMaxRecyclableVectorSize(maxRecyclableVectorSize), + mMaxPoolObjectsSize(maxPoolObjectsSize){}; + + // Obtain a recyclable VehiclePropertyValue object from the pool for the given type. If the + // given type is not MIXED or STRING, the internal value vector size would be set to 1. + // If the given type is MIXED or STRING, all the internal vector sizes would be initialized to + // 0. + RecyclableType obtain(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type); + + // Obtain a recyclable VehiclePropertyValue object from the pool for the given type. If the + // given type is *_VEC or BYTES, the internal value vector size would be set to vectorSize. If + // the given type is BOOLEAN, INT32, FLOAT, or INT64, the internal value vector size would be + // set to 1. If the given type is MIXED or STRING, all the internal value vector sizes would be + // set to 0. vectorSize must be larger than 0. + RecyclableType obtain(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, + size_t vectorSize); + // Obtain a recyclable VehicePropertyValue object that is a copy of src. If src does not contain + // any value or the src property type is not valid, this function would return an empty + // VehiclePropValue. + RecyclableType obtain( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& src); + // Obtain a recyclable boolean object. + RecyclableType obtainBoolean(bool value); + // Obtain a recyclable int32 object. + RecyclableType obtainInt32(int32_t value); + // Obtain a recyclable int64 object. + RecyclableType obtainInt64(int64_t value); + // Obtain a recyclable float object. + RecyclableType obtainFloat(float value); + // Obtain a recyclable float object. + RecyclableType obtainString(const char* cstr); + // Obtain a recyclable mixed object. + RecyclableType obtainComplex(); + + VehiclePropValuePool(VehiclePropValuePool&) = delete; + VehiclePropValuePool& operator=(VehiclePropValuePool&) = delete; + + private: + static inline bool isSingleValueType( + ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) { + return type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType:: + BOOLEAN || + type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32 || + type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64 || + type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT; + } + + static inline bool isComplexType( + ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) { + return type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED || + type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING; + } + + bool isDisposable(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, + size_t vectorSize) const { + return vectorSize > mMaxRecyclableVectorSize || isComplexType(type); + } + + RecyclableType obtainDisposable( + ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType valueType, + size_t vectorSize) const; + RecyclableType obtainRecyclable( + ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, + size_t vectorSize); + + class InternalPool + : public ObjectPool<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> { + public: + InternalPool(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, + size_t vectorSize, size_t maxPoolObjectsSize, + ObjectPool::GetSizeFunc getSizeFunc) + : ObjectPool(maxPoolObjectsSize, getSizeFunc), + mPropType(type), + mVectorSize(vectorSize) {} + + protected: + ::aidl::android::hardware::automotive::vehicle::VehiclePropValue* createObject() override; + void recycle(::aidl::android::hardware::automotive::vehicle::VehiclePropValue* o) override; + + private: + bool check(::aidl::android::hardware::automotive::vehicle::RawPropValues* v); + + template + bool check(std::vector* vec, bool isVectorType) { + return vec->size() == (isVectorType ? mVectorSize : 0); + } + + private: + ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType mPropType; + size_t mVectorSize; + }; + const Deleter<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> + mDisposableDeleter{ + [](::aidl::android::hardware::automotive::vehicle::VehiclePropValue* v) { + delete v; + }}; + + mutable std::mutex mLock; + const size_t mMaxRecyclableVectorSize; + const size_t mMaxPoolObjectsSize; + // A map with 'property_type' | 'value_vector_size' as key and a recyclable object pool as + // value. We would create a recyclable pool for each property type and vector size combination. + std::map> mValueTypePools GUARDED_BY(mLock); +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_utils_include_VehicleObjectPool_H_ diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h index c4bf1d34e5..b02aaf7dc4 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h @@ -18,6 +18,7 @@ #define android_hardware_automotive_vehicle_aidl_impl_utils_common_include_VehicleUtils_H_ #include +#include namespace android { namespace hardware { @@ -81,6 +82,104 @@ inline const ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* return nullptr; } +inline std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> +createVehiclePropValueVec(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, + size_t vecSize) { + auto val = std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>( + new ::aidl::android::hardware::automotive::vehicle::VehiclePropValue); + switch (type) { + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32: + [[fallthrough]]; + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BOOLEAN: + vecSize = 1; + [[fallthrough]]; + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32_VEC: + val->value.int32Values.resize(vecSize); + break; + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT: + vecSize = 1; + [[fallthrough]]; + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT_VEC: + val->value.floatValues.resize(vecSize); + break; + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64: + vecSize = 1; + [[fallthrough]]; + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64_VEC: + val->value.int64Values.resize(vecSize); + break; + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BYTES: + val->value.byteValues.resize(vecSize); + break; + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING: + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED: + break; // Valid, but nothing to do. + default: + ALOGE("createVehiclePropValue: unknown type: %d", toInt(type)); + val.reset(nullptr); + } + return val; +} + +inline std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> +createVehiclePropValue(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) { + return createVehiclePropValueVec(type, 1); +} + +inline size_t getVehicleRawValueVectorSize( + const ::aidl::android::hardware::automotive::vehicle::RawPropValues& value, + ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) { + switch (type) { + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32: // fall + // through + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType:: + BOOLEAN: // fall through + return std::min(value.int32Values.size(), static_cast(1)); + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT: + return std::min(value.floatValues.size(), static_cast(1)); + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64: + return std::min(value.int64Values.size(), static_cast(1)); + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32_VEC: + return value.int32Values.size(); + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT_VEC: + return value.floatValues.size(); + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64_VEC: + return value.int64Values.size(); + case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BYTES: + return value.byteValues.size(); + default: + ALOGE("getVehicleRawValueVectorSize: unknown type: %d", toInt(type)); + return 0; + } +} + +inline void copyVehicleRawValue( + ::aidl::android::hardware::automotive::vehicle::RawPropValues* dest, + const ::aidl::android::hardware::automotive::vehicle::RawPropValues& src) { + dest->int32Values = src.int32Values; + dest->floatValues = src.floatValues; + dest->int64Values = src.int64Values; + dest->byteValues = src.byteValues; + dest->stringValue = src.stringValue; +} + +// getVehiclePropValueSize returns approximately how much memory 'value' would take. This should +// only be used in a limited-size memory pool to set an upper bound for memory consumption. +inline size_t getVehiclePropValueSize( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& prop) { + size_t size = 0; + size += sizeof(prop.timestamp); + size += sizeof(prop.areaId); + size += sizeof(prop.prop); + size += sizeof(prop.status); + size += prop.value.int32Values.size() * sizeof(int32_t); + size += prop.value.int64Values.size() * sizeof(int64_t); + size += prop.value.floatValues.size() * sizeof(float); + size += prop.value.byteValues.size() * sizeof(uint8_t); + size += prop.value.stringValue.size(); + return size; +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/utils/common/src/VehicleObjectPool.cpp b/automotive/vehicle/aidl/impl/utils/common/src/VehicleObjectPool.cpp new file mode 100644 index 0000000000..0ff58f79bd --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/common/src/VehicleObjectPool.cpp @@ -0,0 +1,165 @@ +/* + * 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. + */ + +#define LOG_TAG "VehicleObjectPool" + +#include + +#include + +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +using ::aidl::android::hardware::automotive::vehicle::RawPropValues; +using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; + +VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtain(VehiclePropertyType type) { + if (isComplexType(type)) { + return obtain(type, 0); + } + return obtain(type, 1); +} + +VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtain(VehiclePropertyType type, + size_t vectorSize) { + if (isSingleValueType(type)) { + vectorSize = 1; + } else if (isComplexType(type)) { + vectorSize = 0; + } + return isDisposable(type, vectorSize) ? obtainDisposable(type, vectorSize) + : obtainRecyclable(type, vectorSize); +} + +VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtain(const VehiclePropValue& src) { + VehiclePropertyType type = getPropType(src.prop); + size_t vectorSize = getVehicleRawValueVectorSize(src.value, type); + if (vectorSize == 0 && !isComplexType(type)) { + ALOGW("empty vehicle prop value, contains no content"); + // Return any empty VehiclePropValue. + return RecyclableType{new VehiclePropValue, mDisposableDeleter}; + } + + auto dest = obtain(type, vectorSize); + + dest->prop = src.prop; + dest->areaId = src.areaId; + dest->status = src.status; + dest->timestamp = src.timestamp; + copyVehicleRawValue(&dest->value, src.value); + + return dest; +} + +VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainInt32(int32_t value) { + auto val = obtain(VehiclePropertyType::INT32); + val->value.int32Values[0] = value; + return val; +} + +VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainInt64(int64_t value) { + auto val = obtain(VehiclePropertyType::INT64); + val->value.int64Values[0] = value; + return val; +} + +VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainFloat(float value) { + auto val = obtain(VehiclePropertyType::FLOAT); + val->value.floatValues[0] = value; + return val; +} + +VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainString(const char* cstr) { + auto val = obtain(VehiclePropertyType::STRING); + val->value.stringValue = cstr; + return val; +} + +VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainComplex() { + return obtain(VehiclePropertyType::MIXED); +} + +VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainRecyclable( + VehiclePropertyType type, size_t vectorSize) { + std::lock_guard lock(mLock); + assert(vectorSize > 0); + + // VehiclePropertyType is not overlapping with vectorSize. + int32_t key = static_cast(type) | static_cast(vectorSize); + auto it = mValueTypePools.find(key); + + if (it == mValueTypePools.end()) { + auto newPool(std::make_unique(type, vectorSize, mMaxPoolObjectsSize, + getVehiclePropValueSize)); + it = mValueTypePools.emplace(key, std::move(newPool)).first; + } + return it->second->obtain(); +} + +VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainBoolean(bool value) { + return obtainInt32(value); +} + +VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtainDisposable( + VehiclePropertyType valueType, size_t vectorSize) const { + return RecyclableType{createVehiclePropValueVec(valueType, vectorSize).release(), + mDisposableDeleter}; +} + +void VehiclePropValuePool::InternalPool::recycle(VehiclePropValue* o) { + if (o == nullptr) { + ALOGE("Attempt to recycle nullptr"); + return; + } + + if (!check(&o->value)) { + ALOGE("Discarding value for prop 0x%x because it contains " + "data that is not consistent with this pool. " + "Expected type: %d, vector size: %zu", + o->prop, toInt(mPropType), mVectorSize); + delete o; + } else { + ObjectPool::recycle(o); + } +} + +bool VehiclePropValuePool::InternalPool::check(RawPropValues* v) { + return check(&v->int32Values, (VehiclePropertyType::INT32 == mPropType || + VehiclePropertyType::INT32_VEC == mPropType || + VehiclePropertyType::BOOLEAN == mPropType)) && + check(&v->floatValues, (VehiclePropertyType::FLOAT == mPropType || + VehiclePropertyType::FLOAT_VEC == mPropType)) && + check(&v->int64Values, (VehiclePropertyType::INT64 == mPropType || + VehiclePropertyType::INT64_VEC == mPropType)) && + check(&v->byteValues, VehiclePropertyType::BYTES == mPropType) && + v->stringValue.size() == 0; +} + +VehiclePropValue* VehiclePropValuePool::InternalPool::createObject() { + return createVehiclePropValueVec(mPropType, mVectorSize).release(); +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehicleObjectPoolTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehicleObjectPoolTest.cpp new file mode 100644 index 0000000000..a62532c911 --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/common/test/VehicleObjectPoolTest.cpp @@ -0,0 +1,381 @@ +/* + * 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 + +#include + +#include + +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +namespace { + +using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; + +struct TestPropertyTypeInfo { + VehiclePropertyType type; + bool recyclable; + size_t vecSize; +}; + +std::vector getAllPropertyTypes() { + return { + { + .type = VehiclePropertyType::INT32, + .recyclable = true, + .vecSize = 1, + }, + { + .type = VehiclePropertyType::INT64, + .recyclable = true, + .vecSize = 1, + }, + { + .type = VehiclePropertyType::FLOAT, + .recyclable = true, + .vecSize = 1, + }, + { + .type = VehiclePropertyType::INT32_VEC, + .recyclable = true, + .vecSize = 4, + }, + { + .type = VehiclePropertyType::INT64_VEC, + .recyclable = true, + .vecSize = 4, + }, + { + .type = VehiclePropertyType::FLOAT_VEC, + .recyclable = true, + .vecSize = 4, + }, + { + .type = VehiclePropertyType::BYTES, + .recyclable = true, + .vecSize = 4, + }, + { + .type = VehiclePropertyType::INT32_VEC, + .recyclable = false, + .vecSize = 5, + }, + { + .type = VehiclePropertyType::INT64_VEC, + .recyclable = false, + .vecSize = 5, + }, + { + .type = VehiclePropertyType::FLOAT_VEC, + .recyclable = false, + .vecSize = 5, + }, + { + .type = VehiclePropertyType::BYTES, + .recyclable = false, + .vecSize = 5, + }, + { + .type = VehiclePropertyType::STRING, + .recyclable = false, + .vecSize = 0, + }, + { + .type = VehiclePropertyType::MIXED, + .recyclable = false, + .vecSize = 0, + }, + }; +} + +} // namespace + +class VehicleObjectPoolTest : public ::testing::Test { + protected: + void SetUp() override { + mStats = PoolStats::instance(); + resetStats(); + mValuePool.reset(new VehiclePropValuePool); + } + + void TearDown() override { + // At the end, all created objects should be either recycled or deleted. + ASSERT_EQ(mStats->Obtained, mStats->Recycled + mStats->Deleted); + // Some objects could be recycled multiple times. + ASSERT_LE(mStats->Created, mStats->Recycled + mStats->Deleted); + } + + PoolStats* mStats; + std::unique_ptr mValuePool; + + private: + void resetStats() { + mStats->Obtained = 0; + mStats->Created = 0; + mStats->Recycled = 0; + mStats->Deleted = 0; + } +}; + +class VehiclePropertyTypesTest : public VehicleObjectPoolTest, + public testing::WithParamInterface {}; + +TEST_P(VehiclePropertyTypesTest, testRecycle) { + auto info = GetParam(); + if (!info.recyclable) { + GTEST_SKIP(); + } + + auto value = mValuePool->obtain(info.type, info.vecSize); + void* raw = value.get(); + value.reset(); + // At this point, value should be recycled and the only object in the pool. + ASSERT_EQ(mValuePool->obtain(info.type, info.vecSize).get(), raw); + + ASSERT_EQ(mStats->Obtained, 2u); + ASSERT_EQ(mStats->Created, 1u); +} + +TEST_P(VehiclePropertyTypesTest, testNotRecyclable) { + auto info = GetParam(); + if (info.recyclable) { + GTEST_SKIP(); + } + + auto value = mValuePool->obtain(info.type, info.vecSize); + + ASSERT_EQ(mStats->Obtained, 0u) << "Non recyclable object should not be obtained from the pool"; + ASSERT_EQ(mStats->Created, 0u) << "Non recyclable object should not be created from the pool"; +} + +INSTANTIATE_TEST_SUITE_P(AllPropertyTypes, VehiclePropertyTypesTest, + ::testing::ValuesIn(getAllPropertyTypes())); + +TEST_F(VehicleObjectPoolTest, testObtainNewObject) { + auto value = mValuePool->obtain(VehiclePropertyType::INT32); + void* raw = value.get(); + value.reset(); + // At this point, value should be recycled and the only object in the pool. + ASSERT_EQ(mValuePool->obtain(VehiclePropertyType::INT32).get(), raw); + // Obtaining value of another type - should return a new object + ASSERT_NE(mValuePool->obtain(VehiclePropertyType::FLOAT).get(), raw); + + ASSERT_EQ(mStats->Obtained, 3u); + ASSERT_EQ(mStats->Created, 2u); +} + +TEST_F(VehicleObjectPoolTest, testObtainStrings) { + mValuePool->obtain(VehiclePropertyType::STRING); + auto stringProp = mValuePool->obtain(VehiclePropertyType::STRING); + stringProp->value.stringValue = "Hello"; + void* raw = stringProp.get(); + stringProp.reset(); // delete the pointer + + auto newStringProp = mValuePool->obtain(VehiclePropertyType::STRING); + + ASSERT_EQ(newStringProp->value.stringValue.size(), 0u); + ASSERT_NE(mValuePool->obtain(VehiclePropertyType::STRING).get(), raw); + ASSERT_EQ(mStats->Obtained, 0u); +} + +TEST_F(VehicleObjectPoolTest, testObtainBoolean) { + auto prop = mValuePool->obtainBoolean(true); + + ASSERT_NE(prop, nullptr); + ASSERT_EQ(*prop, (VehiclePropValue{ + .value = {.int32Values = {1}}, + })); +} + +TEST_F(VehicleObjectPoolTest, testObtainInt32) { + auto prop = mValuePool->obtainInt32(1234); + + ASSERT_NE(prop, nullptr); + ASSERT_EQ(*prop, (VehiclePropValue{ + .value = {.int32Values = {1234}}, + })); +} + +TEST_F(VehicleObjectPoolTest, testObtainInt64) { + auto prop = mValuePool->obtainInt64(1234); + + ASSERT_NE(prop, nullptr); + ASSERT_EQ(*prop, (VehiclePropValue{ + .value = {.int64Values = {1234}}, + })); +} + +TEST_F(VehicleObjectPoolTest, testObtainFloat) { + auto prop = mValuePool->obtainFloat(1.234); + + ASSERT_NE(prop, nullptr); + ASSERT_EQ(*prop, (VehiclePropValue{ + .value = {.floatValues = {1.234}}, + })); +} + +TEST_F(VehicleObjectPoolTest, testObtainString) { + auto prop = mValuePool->obtainString("test"); + + ASSERT_NE(prop, nullptr); + ASSERT_EQ(*prop, (VehiclePropValue{ + .value = {.stringValue = "test"}, + })); +} + +TEST_F(VehicleObjectPoolTest, testObtainComplex) { + auto prop = mValuePool->obtainComplex(); + + ASSERT_NE(prop, nullptr); + ASSERT_EQ(*prop, VehiclePropValue{}); +} + +TEST_F(VehicleObjectPoolTest, testObtainCopyInt32Values) { + VehiclePropValue prop{ + // INT32_VEC property. + .prop = toInt(VehicleProperty::INFO_FUEL_TYPE), + .areaId = 2, + .timestamp = 3, + .value = {.int32Values = {1, 2, 3, 4}}, + }; + auto gotValue = mValuePool->obtain(prop); + + ASSERT_NE(gotValue, nullptr); + ASSERT_EQ(*gotValue, prop); +} + +TEST_F(VehicleObjectPoolTest, testObtainCopyInt64Values) { + VehiclePropValue prop{ + // INT64_VEC property. + .prop = toInt(VehicleProperty::WHEEL_TICK), + .areaId = 2, + .timestamp = 3, + .value = {.int64Values = {1, 2, 3, 4}}, + }; + auto gotValue = mValuePool->obtain(prop); + + ASSERT_NE(gotValue, nullptr); + ASSERT_EQ(*gotValue, prop); +} + +TEST_F(VehicleObjectPoolTest, testObtainCopyFloatValues) { + VehiclePropValue prop{ + // FLOAT_VEC property. + .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION), + .areaId = 2, + .timestamp = 3, + .value = {.floatValues = {1, 2, 3, 4}}, + }; + auto gotValue = mValuePool->obtain(prop); + + ASSERT_NE(gotValue, nullptr); + ASSERT_EQ(*gotValue, prop); +} + +TEST_F(VehicleObjectPoolTest, testObtainCopyString) { + VehiclePropValue prop{ + // STRING property. + .prop = toInt(VehicleProperty::INFO_VIN), + .areaId = 2, + .timestamp = 3, + .value = {.stringValue = "test"}, + }; + auto gotValue = mValuePool->obtain(prop); + + ASSERT_NE(gotValue, nullptr); + ASSERT_EQ(*gotValue, prop); +} + +TEST_F(VehicleObjectPoolTest, testObtainCopyMixed) { + VehiclePropValue prop{ + // MIxed property. + .prop = toInt(VehicleProperty::VEHICLE_MAP_SERVICE), + .areaId = 2, + .timestamp = 3, + .value = + { + .int32Values = {1, 2, 3}, + .floatValues = {4.0, 5.0}, + .stringValue = "test", + }, + }; + auto gotValue = mValuePool->obtain(prop); + + ASSERT_NE(gotValue, nullptr); + ASSERT_EQ(*gotValue, prop); +} + +TEST_F(VehicleObjectPoolTest, testMultithreaded) { + // In this test we have T threads that concurrently in C cycles + // obtain and release O VehiclePropValue objects of FLOAT / INT32 types. + + const int T = 2; + const int C = 500; + const int O = 100; + + auto poolPtr = mValuePool.get(); + + std::vector threads; + for (int i = 0; i < T; i++) { + threads.push_back(std::thread([&poolPtr]() { + for (int j = 0; j < C; j++) { + std::vector> vec; + for (int k = 0; k < O; k++) { + vec.push_back(poolPtr->obtain(k % 2 == 0 ? VehiclePropertyType::FLOAT + : VehiclePropertyType::INT32)); + } + } + })); + } + + for (auto& t : threads) { + t.join(); + } + + ASSERT_EQ(mStats->Obtained, static_cast(T * C * O)); + ASSERT_EQ(mStats->Recycled + mStats->Deleted, static_cast(T * C * O)); + // Created less than obtained in one cycle. + ASSERT_LE(mStats->Created, static_cast(T * O)); +} + +TEST_F(VehicleObjectPoolTest, testMemoryLimitation) { + std::vector> vec; + for (size_t i = 0; i < 10000; i++) { + vec.push_back(mValuePool->obtain(VehiclePropertyType::INT32)); + } + // We have too many values, not all of them would be recycled, some of them will be deleted. + vec.clear(); + + ASSERT_EQ(mStats->Obtained, 10000u); + ASSERT_EQ(mStats->Created, 10000u); + ASSERT_GT(mStats->Deleted, 0u) << "expect some values to be deleted, not recycled if too many " + "values are in the pool"; +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp index c09b06d749..7ad3d3122d 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp @@ -16,7 +16,9 @@ #include #include + #include +#include namespace android { namespace hardware { @@ -122,6 +124,129 @@ TEST(VehicleUtilsTest, testGetAreaConfigNonGlobalNull) { ASSERT_EQ(gotConfig, nullptr); } +TEST(VehicleUtilsTest, testCreateVehiclePropValueInt32) { + std::unique_ptr value = createVehiclePropValue(VehiclePropertyType::INT32); + + ASSERT_NE(value, nullptr); + ASSERT_EQ(1u, value->value.int32Values.size()); +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueInt32Vec) { + std::unique_ptr value = + createVehiclePropValue(VehiclePropertyType::INT32_VEC); + + ASSERT_NE(value, nullptr); + ASSERT_EQ(1u, value->value.int32Values.size()); +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueInt64) { + std::unique_ptr value = createVehiclePropValue(VehiclePropertyType::INT64); + + ASSERT_NE(value, nullptr); + ASSERT_EQ(1u, value->value.int64Values.size()); +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueInt64Vec) { + std::unique_ptr value = + createVehiclePropValue(VehiclePropertyType::INT64_VEC); + + ASSERT_NE(value, nullptr); + ASSERT_EQ(1u, value->value.int64Values.size()); +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueFloat) { + std::unique_ptr value = createVehiclePropValue(VehiclePropertyType::FLOAT); + + ASSERT_NE(value, nullptr); + ASSERT_EQ(1u, value->value.floatValues.size()); +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueFloatVec) { + std::unique_ptr value = + createVehiclePropValue(VehiclePropertyType::FLOAT_VEC); + + ASSERT_NE(value, nullptr); + ASSERT_EQ(1u, value->value.floatValues.size()); +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueBytes) { + std::unique_ptr value = createVehiclePropValue(VehiclePropertyType::BYTES); + + ASSERT_NE(value, nullptr); + ASSERT_EQ(1u, value->value.byteValues.size()); +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueString) { + std::unique_ptr value = createVehiclePropValue(VehiclePropertyType::STRING); + + ASSERT_NE(value, nullptr); +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueMixed) { + std::unique_ptr value = createVehiclePropValue(VehiclePropertyType::MIXED); + + ASSERT_NE(value, nullptr); +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueVecInt32) { + std::unique_ptr value = + createVehiclePropValueVec(VehiclePropertyType::INT32, /*vecSize=*/2); + + ASSERT_NE(value, nullptr); + ASSERT_EQ(1u, value->value.int32Values.size()) + << "vector size should always be 1 for single value type"; +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueIntVec32Vec) { + std::unique_ptr value = + createVehiclePropValueVec(VehiclePropertyType::INT32_VEC, /*vecSize=*/2); + + ASSERT_NE(value, nullptr); + ASSERT_EQ(2u, value->value.int32Values.size()); +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueVecInt64) { + std::unique_ptr value = + createVehiclePropValueVec(VehiclePropertyType::INT64, /*vecSize=*/2); + + ASSERT_NE(value, nullptr); + ASSERT_EQ(1u, value->value.int64Values.size()) + << "vector size should always be 1 for single value type"; +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueIntVec64Vec) { + std::unique_ptr value = + createVehiclePropValueVec(VehiclePropertyType::INT64_VEC, /*vecSize=*/2); + + ASSERT_NE(value, nullptr); + ASSERT_EQ(2u, value->value.int64Values.size()); +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueVecFloat) { + std::unique_ptr value = + createVehiclePropValueVec(VehiclePropertyType::FLOAT, /*vecSize=*/2); + + ASSERT_NE(value, nullptr); + ASSERT_EQ(1u, value->value.floatValues.size()) + << "vector size should always be 1 for single value type"; +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueFloVecatVec) { + std::unique_ptr value = + createVehiclePropValueVec(VehiclePropertyType::FLOAT_VEC, /*vecSize=*/2); + + ASSERT_NE(value, nullptr); + ASSERT_EQ(2u, value->value.floatValues.size()); +} + +TEST(VehicleUtilsTest, testCreateVehiclePropValueVecBytes) { + std::unique_ptr value = + createVehiclePropValueVec(VehiclePropertyType::BYTES, /*vecSize=*/2); + + ASSERT_NE(value, nullptr); + ASSERT_EQ(2u, value->value.byteValues.size()); +} + } // namespace vehicle } // namespace automotive } // namespace hardware -- GitLab From 249760a473167eda1755adf3c29a95583e75ac20 Mon Sep 17 00:00:00 2001 From: "henry-th.yeh" Date: Thu, 12 Nov 2020 15:06:44 +0800 Subject: [PATCH 140/825] Fix VtsHalWifiSupplicantV1_3TargetTest fail Remove disable_framework option to pass the stopWifiFramework procedure. Bug: 173081502 Bug: 199444489 Test: Build VTS Test: run vts -m VtsHalWifiSupplicantV1_3TargetTest -t PerInstance/SupplicantStaIfaceHidlTest#RegisterC allback_1_3/default_default_0 --abi armeabi-v7a Change-Id: I6813905b6c804c1c93ea59db9d8c255c2f7c45d9 --- wifi/supplicant/1.3/vts/functional/Android.bp | 1 - 1 file changed, 1 deletion(-) diff --git a/wifi/supplicant/1.3/vts/functional/Android.bp b/wifi/supplicant/1.3/vts/functional/Android.bp index ec25de2a43..4b563367c9 100644 --- a/wifi/supplicant/1.3/vts/functional/Android.bp +++ b/wifi/supplicant/1.3/vts/functional/Android.bp @@ -74,5 +74,4 @@ cc_test { "general-tests", "vts", ], - disable_framework: true, } -- GitLab From c1839c6e38c9dfe8b4b2a615b8f273d00b1f11d0 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 4 Nov 2020 09:31:02 -0800 Subject: [PATCH 141/825] vts(wifi): Stop wifi fully instead of stopping framework Stopping entire framework can cause other essential services to be stopped. When wifi is stopped, it does not interact with any of the wifi HAL's. Bug: 168278011 Bug: 199444489 Test: atest --iterations 10 VtsHalWifiSupplicantP2pV1_0TargetTest VtsHalWifiSupplicantP2pV1_1TargetTest VtsHalWifiSupplicantP2pV1_2TargetTest VtsHalWifiSupplicantP2pV1_3TargetTest Change-Id: Ia93e78cf4c147e42dd3d68e24a582c0c1af15899 --- .../vts/functional/supplicant_hidl_test.cpp | 13 +++++--- .../functional/supplicant_hidl_test_utils.cpp | 32 +++++++++++++++++++ .../functional/supplicant_hidl_test_utils.h | 16 ++++++---- 3 files changed, 49 insertions(+), 12 deletions(-) diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp index ac39a24fa4..eabbf1b141 100644 --- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp +++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp @@ -38,12 +38,15 @@ class SupplicantHidlTest : public ::testing::TestWithParam> { public: virtual void SetUp() override { + // Stop Wi-Fi + ASSERT_TRUE(stopWifiFramework()); // stop & wait for wifi to shutdown. + wifi_instance_name_ = std::get<0>(GetParam()); supplicant_instance_name_ = std::get<1>(GetParam()); + std::system("/system/bin/start"); + ASSERT_TRUE(waitForFrameworkReady()); isP2pOn_ = testing::deviceSupportsFeature("android.hardware.wifi.direct"); - // Stop Framework - std::system("/system/bin/stop"); stopSupplicant(wifi_instance_name_); startSupplicantAndWaitForHidlService(wifi_instance_name_, supplicant_instance_name_); @@ -53,8 +56,8 @@ class SupplicantHidlTest virtual void TearDown() override { stopSupplicant(wifi_instance_name_); - // Start Framework - std::system("/system/bin/start"); + // Start Wi-Fi + startWifiFramework(); } protected: @@ -220,4 +223,4 @@ INSTANTIATE_TEST_CASE_P( android::hardware::getAllHalInstanceNames(IWifi::descriptor)), testing::ValuesIn(android::hardware::getAllHalInstanceNames( ISupplicant::descriptor))), - android::hardware::PrintInstanceTupleNameToString<>); \ No newline at end of file + android::hardware::PrintInstanceTupleNameToString<>); diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp index be6aad9583..8cb7e22f0e 100644 --- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp +++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp @@ -48,6 +48,26 @@ using ::android::wifi_system::InterfaceTool; using ::android::wifi_system::SupplicantManager; namespace { +bool waitForSupplicantState(bool is_running) { + SupplicantManager supplicant_manager; + int count = 50; /* wait at most 5 seconds for completion */ + while (count-- > 0) { + if (supplicant_manager.IsSupplicantRunning() == is_running) { + return true; + } + usleep(100000); + } + LOG(ERROR) << "Supplicant not " << is_running ? "running" : "stopped"; + return false; +} + +// Helper function to wait for supplicant to be started by framework on wifi +// enable. +bool waitForSupplicantStart() { return waitForSupplicantState(true); } + +// Helper function to wait for supplicant to be stopped by framework on wifi +// disable. +bool waitForSupplicantStop() { return waitForSupplicantState(false); } // Helper function to initialize the driver and firmware to STA mode // using the vendor HAL HIDL interface. @@ -118,6 +138,18 @@ std::string getP2pIfaceName() { } } // namespace +bool startWifiFramework() { + std::system("svc wifi enable"); + std::system("cmd wifi set-scan-always-available enabled"); + return waitForSupplicantStart(); // wait for wifi to start. +} + +bool stopWifiFramework() { + std::system("svc wifi disable"); + std::system("cmd wifi set-scan-always-available disabled"); + return waitForSupplicantStop(); // wait for wifi to shutdown. +} + void stopSupplicant() { stopSupplicant(""); } void stopSupplicant(const std::string& wifi_instance_name) { diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h index 33945ccb19..22cea8c14c 100644 --- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h +++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h @@ -29,9 +29,11 @@ #include "wifi_hidl_test_utils.h" +// Used to start the android wifi framework after every test. +bool startWifiFramework(); + // Used to stop the android wifi framework before every test. -void stopWifiFramework(const std::string& wifi_instance_name); -void startWifiFramework(const std::string& wifi_instance_name); +bool stopWifiFramework(); void stopSupplicant(const std::string& wifi_instance_name); // Used to configure the chip, driver and start wpa_supplicant before every @@ -70,16 +72,16 @@ class SupplicantHidlTestBase : public ::testing::TestWithParam> { public: virtual void SetUp() override { + // Stop Wi-Fi + ASSERT_TRUE(stopWifiFramework()); // stop & wait for wifi to shutdown. + // should always be v1.0 wifi wifi_v1_0_instance_name_ = std::get<0>(GetParam()); supplicant_instance_name_ = std::get<1>(GetParam()); std::system("/system/bin/start"); ASSERT_TRUE(waitForFrameworkReady()); - isP2pOn_ = testing::deviceSupportsFeature("android.hardware.wifi.direct"); - // Stop Framework - std::system("/system/bin/stop"); stopSupplicant(wifi_v1_0_instance_name_); startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_, supplicant_instance_name_); @@ -88,8 +90,8 @@ class SupplicantHidlTestBase virtual void TearDown() override { stopSupplicant(wifi_v1_0_instance_name_); - // Start Framework - std::system("/system/bin/start"); + // Start Wi-Fi + startWifiFramework(); } protected: -- GitLab From ce2e1e20e0a152aebdff51a69b08e4ca984a745e Mon Sep 17 00:00:00 2001 From: Serik Beketayev Date: Tue, 7 Sep 2021 16:00:32 -0700 Subject: [PATCH 142/825] [IRadioConfig] Generating AIDL definitions Generated IRadioConfig.aidl and dependencies using tool hidl2aidl. Bug: 198331805 Test: m android.hardware.radio.config Change-Id: I231f9b2eff50e7a0558dd79e85613b626c7cfb52 --- .../compatibility_matrix.current.xml | 8 + radio/config/aidl/Android.bp | 55 +++++++ .../hardware/radio/config/IRadioConfig.aidl | 53 +++++++ .../radio/config/IRadioConfigIndication.aidl | 38 +++++ .../radio/config/IRadioConfigResponse.aidl | 44 ++++++ .../radio/config/PhoneCapability.aidl | 41 +++++ .../hardware/radio/config/SimSlotStatus.aidl | 44 ++++++ .../hardware/radio/config/IRadioConfig.aidl | 149 ++++++++++++++++++ .../radio/config/IRadioConfigIndication.aidl | 39 +++++ .../radio/config/IRadioConfigResponse.aidl | 124 +++++++++++++++ .../radio/config/PhoneCapability.aidl | 48 ++++++ .../hardware/radio/config/SimSlotStatus.aidl | 56 +++++++ 12 files changed, 699 insertions(+) create mode 100644 radio/config/aidl/Android.bp create mode 100644 radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl create mode 100644 radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl create mode 100644 radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl create mode 100644 radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl create mode 100644 radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl create mode 100644 radio/config/aidl/android/hardware/radio/config/IRadioConfig.aidl create mode 100644 radio/config/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl create mode 100644 radio/config/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl create mode 100644 radio/config/aidl/android/hardware/radio/config/PhoneCapability.aidl create mode 100644 radio/config/aidl/android/hardware/radio/config/SimSlotStatus.aidl diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index ba15c9c629..6184be6bdf 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -485,6 +485,14 @@ default + + android.hardware.radio.config + 1 + + IRadioConfig + default + + android.hardware.radio.config 1.3 diff --git a/radio/config/aidl/Android.bp b/radio/config/aidl/Android.bp new file mode 100644 index 0000000000..801747a0a1 --- /dev/null +++ b/radio/config/aidl/Android.bp @@ -0,0 +1,55 @@ +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.radio.config", + vendor_available: true, + srcs: ["android/hardware/radio/config/*.aidl"], + stability: "vintf", + imports: ["android.hardware.radio"], + backend: { + cpp: { + enabled: false, + }, + java: { + sdk_version: "module_current", + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, +} + +cc_library { + name: "android.hardware.radio.config-translate-ndk", + vendor_available: true, + shared_libs: [ + "libbinder_ndk", + "libhidlbase", + "android.hardware.radio.config-V1-ndk_platform", + "android.hardware.radio.config@1.0", + "android.hardware.radio.config@1.1", + "android.hardware.radio.config@1.2", + "android.hardware.radio.config@1.3", + ], +} + +java_library { + name: "android.hardware.radio.config-translate-java", + libs: [ + "android.hardware.radio.config-V1-java", + "android.hardware.radio.config-V1.0-java", + "android.hardware.radio.config-V1.1-java", + "android.hardware.radio.config-V1.2-java", + "android.hardware.radio.config-V1.3-java", + ], + sdk_version: "module_current", +} diff --git a/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl b/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl new file mode 100644 index 0000000000..85106b82d0 --- /dev/null +++ b/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl @@ -0,0 +1,53 @@ +/* + * 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 interface is used by telephony and telecom to talk to cellular radio for the purpose of + * radio configuration, and it is not associated with any specific modem or slot. + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.config; +@VintfStability +interface IRadioConfig { + oneway void getHalDeviceCapabilities(in int serial); + oneway void getNumOfLiveModems(in int serial); + oneway void getPhoneCapability(in int serial); + oneway void getSimSlotsStatus(in int serial); + oneway void setNumOfLiveModems(in int serial, in byte numOfLiveModems); + oneway void setPreferredDataModem(in int serial, in byte modemId); + oneway void setResponseFunctions(in android.hardware.radio.config.IRadioConfigResponse radioConfigResponse, in android.hardware.radio.config.IRadioConfigIndication radioConfigIndication); + oneway void setSimSlotsMapping(in int serial, in int[] slotMap); +} diff --git a/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl b/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl new file mode 100644 index 0000000000..994e337c04 --- /dev/null +++ b/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.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 -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.config; +@VintfStability +interface IRadioConfigIndication { + oneway void simSlotsStatusChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.config.SimSlotStatus[] slotStatus); +} diff --git a/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl new file mode 100644 index 0000000000..038b0aeb58 --- /dev/null +++ b/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.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 -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.config; +@VintfStability +interface IRadioConfigResponse { + oneway void getHalDeviceCapabilitiesResponse(in android.hardware.radio.RadioResponseInfo info, in boolean modemReducedFeatureSet1); + oneway void getNumOfLiveModemsResponse(in android.hardware.radio.RadioResponseInfo info, in byte numOfLiveModems); + oneway void getPhoneCapabilityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.config.PhoneCapability phoneCapability); + oneway void getSimSlotsStatusResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.config.SimSlotStatus[] slotStatus); + oneway void setNumOfLiveModemsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setPreferredDataModemResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSimSlotsMappingResponse(in android.hardware.radio.RadioResponseInfo info); +} diff --git a/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl b/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl new file mode 100644 index 0000000000..c60200ce13 --- /dev/null +++ b/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.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 -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.config; +@VintfStability +parcelable PhoneCapability { + byte maxActiveData; + byte maxActiveInternetData; + boolean isInternetLingeringSupported; + byte[] logicalModemIds; +} diff --git a/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl b/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl new file mode 100644 index 0000000000..3a716cf514 --- /dev/null +++ b/radio/config/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.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 -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.config; +@VintfStability +parcelable SimSlotStatus { + boolean cardActive; + int cardState; + int slotState; + String atr; + int logicalSlotId; + String iccid; + String eid; +} diff --git a/radio/config/aidl/android/hardware/radio/config/IRadioConfig.aidl b/radio/config/aidl/android/hardware/radio/config/IRadioConfig.aidl new file mode 100644 index 0000000000..bfff16aa43 --- /dev/null +++ b/radio/config/aidl/android/hardware/radio/config/IRadioConfig.aidl @@ -0,0 +1,149 @@ +/* + * 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 interface is used by telephony and telecom to talk to cellular radio for the purpose of + * radio configuration, and it is not associated with any specific modem or slot. + * 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. + */ + +package android.hardware.radio.config; + +import android.hardware.radio.config.IRadioConfigIndication; +import android.hardware.radio.config.IRadioConfigResponse; + +@VintfStability +oneway interface IRadioConfig { + /** + * Gets the available Radio Hal capabilities on the current device. + * + * This is called once per device boot up. + * + * @param serial Serial number of request + * + * Response callback is + * IRadioConfigResponse.getHalDeviceCapabilitiesResponse() + */ + void getHalDeviceCapabilities(in int serial); + + /** + * Get the number of live modems (i.e modems that are + * enabled and actively working as part of a working telephony stack) + * + * Note: in order to get the overall number of modems available on the phone, + * refer to getPhoneCapability API + * + * @param serial Serial number of request. + * + * Response callback is IRadioConfigResponse.getNumOfLiveModemsResponse() which + * will return . + */ + void getNumOfLiveModems(in int serial); + + /** + * Request current phone capability. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getPhoneCapabilityResponse() which + * will return . + */ + void getPhoneCapability(in int serial); + + /** + * Get SIM Slot status. + * + * Request provides the slot status of all active and inactive SIM slots and whether card is + * present in the slots or not. + * + * @param serial Serial number of request. + * + * Response callback is IRadioConfigResponse.getSimSlotsStatusResponse() + */ + void getSimSlotsStatus(in int serial); + + /** + * Set modems configurations by specifying the number of live modems (i.e modems that are + * enabled and actively working as part of a working telephony stack). + * + * Example: this interface can be used to switch to single/multi sim mode by specifying + * the number of live modems as 1, 2, etc + * + * Note: by setting the number of live modems in this API, that number of modems will + * subsequently get enabled/disabled + * + * @param serial serial number of request. + * @param modemsConfig byte object including the number of live modems + * + * Response callback is IRadioResponse.setNumOfLiveModemsResponse() + */ + void setNumOfLiveModems(in int serial, in byte numOfLiveModems); + + /** + * Set preferred data modem Id. + * In a multi-SIM device, notify modem layer which logical modem will be used primarily + * for data. It helps modem with resource optimization and decisions of what data connections + * should be satisfied. + * + * @param serial Serial number of request. + * @param modem Id the logical modem ID, which should match one of modem IDs returned + * from getPhoneCapability(). + * + * Response callback is IRadioConfigResponse.setPreferredDataModemResponse() + */ + void setPreferredDataModem(in int serial, in byte modemId); + + /** + * Set response functions for radio config requests & radio config indications. + * + * @param radioConfigResponse Object containing radio config response functions + * @param radioConfigIndication Object containing radio config indications + */ + void setResponseFunctions(in IRadioConfigResponse radioConfigResponse, + in IRadioConfigIndication radioConfigIndication); + + /** + * Set SIM Slot mapping. + * + * Maps the logical slots to the physical slots. Logical slot is the slot that is seen by modem. + * Physical slot is the actual physical slot. Request maps the physical slot to logical slot. + * Logical slots that are already mapped to the requested physical slot are not impacted. + * + * Example no. of logical slots 1 and physical slots 2: + * The only logical slot (index 0) can be mapped to first physical slot (value 0) or second + * physical slot(value 1), while the other physical slot remains unmapped and inactive. + * slotMap[0] = 1 or slotMap[0] = 0 + * + * Example no. of logical slots 2 and physical slots 2: + * First logical slot (index 0) can be mapped to physical slot 1 or 2 and other logical slot + * can be mapped to other physical slot. Each logical slot must be mapped to a physical slot. + * slotMap[0] = 0 and slotMap[1] = 1 or slotMap[0] = 1 and slotMap[1] = 0 + * + * @param serial Serial number of request + * @param slotMap Logical to physical slot mapping, size == no. of radio instances. Index is + * mapping to logical slot and value to physical slot, need to provide all the slots + * mapping when sending request in case of multi slot device. + * EX: uint32_t slotMap[logical slot] = physical slot + * index 0 is the first logical_slot number of logical slots is equal to number of Radio + * instances and number of physical slots is equal to size of slotStatus in + * getSimSlotsStatusResponse + * + * Response callback is IRadioConfigResponse.setSimSlotsMappingResponse() + */ + void setSimSlotsMapping(in int serial, in int[] slotMap); +} diff --git a/radio/config/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl b/radio/config/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl new file mode 100644 index 0000000000..abf55f1f80 --- /dev/null +++ b/radio/config/aidl/android/hardware/radio/config/IRadioConfigIndication.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. + */ + +package android.hardware.radio.config; + +import android.hardware.radio.config.SimSlotStatus; + +/** + * Interface declaring unsolicited radio config indications. + */ +@VintfStability +oneway interface IRadioConfigIndication { + /** + * Indicates SIM slot status change. + * + * This indication must be sent by the modem whenever there is any slot status change, even the + * slot is inactive. For example, this indication must be triggered if a SIM card is inserted + * into an inactive slot. + * + * @param type Type of radio indication + * @param slotStatus new slot status info with size equals to the number of physical slots on + * the device + */ + void simSlotsStatusChanged( + in android.hardware.radio.RadioIndicationType type, in SimSlotStatus[] slotStatus); +} diff --git a/radio/config/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/config/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl new file mode 100644 index 0000000000..929f02df0f --- /dev/null +++ b/radio/config/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl @@ -0,0 +1,124 @@ +/* + * 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. + */ + +package android.hardware.radio.config; + +import android.hardware.radio.config.PhoneCapability; +import android.hardware.radio.config.SimSlotStatus; + +/** + * Interface declaring response functions to solicited radio config requests. + */ +@VintfStability +oneway interface IRadioConfigResponse { + /** + * @param info Response info struct containing response type, serial no. and error + * @param modemReducedFeatureSet1 True indicates that the modem does NOT support the following + * features. + * - Providing either LinkCapacityEstimate:secondaryDownlinkCapacityKbps + * or LinkCapacityEstimate:secondaryUplinkCapacityKbps when given from + * RadioIndication:currentLinkCapacityEstimate + * - Calling IRadio.setNrDualConnectivityState or querying + * IRadio.isNrDualConnectivityEnabled + * - Requesting IRadio.setDataThrottling() + * - Providing SlicingConfig through getSlicingConfig() + * - Providing PhysicalChannelConfig through + * IRadioIndication.currentPhysicalChannelConfigs_1_6() + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + */ + void getHalDeviceCapabilitiesResponse( + in android.hardware.radio.RadioResponseInfo info, in boolean modemReducedFeatureSet1); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param numOfLiveModems indicate the number of live modems i.e. modems that + * are enabled and actively working as part of a working connectivity stack + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:REQUEST_NOT_SUPPORTED + */ + void getNumOfLiveModemsResponse( + in android.hardware.radio.RadioResponseInfo info, in byte numOfLiveModems); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param phoneCapability it defines modem's capability for example + * how many logical modems it has, how many data connections it supports. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + */ + void getPhoneCapabilityResponse( + in android.hardware.radio.RadioResponseInfo info, in PhoneCapability phoneCapability); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param slotStatus Sim slot struct containing all the physical SIM slots info with size + * equal to the number of physical slots on the device + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:MODEM_ERR + */ + void getSimSlotsStatusResponse( + in android.hardware.radio.RadioResponseInfo info, in SimSlotStatus[] slotStatus); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_ARGUMENTS + */ + void setNumOfLiveModemsResponse(in android.hardware.radio.RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + */ + void setPreferredDataModemResponse(in android.hardware.radio.RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:NO_MEMORY + * RadioError:INTERNAL_ERR + * RadioError:MODEM_ERR + * RadioError:INVALID_ARGUMENTS + */ + void setSimSlotsMappingResponse(in android.hardware.radio.RadioResponseInfo info); +} diff --git a/radio/config/aidl/android/hardware/radio/config/PhoneCapability.aidl b/radio/config/aidl/android/hardware/radio/config/PhoneCapability.aidl new file mode 100644 index 0000000000..bc55e3924b --- /dev/null +++ b/radio/config/aidl/android/hardware/radio/config/PhoneCapability.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. + */ + +package android.hardware.radio.config; + +/** + * 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. + */ +@VintfStability +parcelable PhoneCapability { + /** + * maxActiveData defines how many logical modems can have + * PS attached simultaneously. For example, for L+L modem it + * should be 2. + */ + byte maxActiveData; + /** + * maxActiveData defines how many logical modems can have + * internet PDN connections simultaneously. For example, for L+L + * DSDS modem it’s 1, and for DSDA modem it’s 2. + */ + byte maxActiveInternetData; + /** + * Whether modem supports both internet PDN up so + * that we can do ping test before tearing down the + * other one. + */ + boolean isInternetLingeringSupported; + /** + * List of logical modem IDs. + */ + byte[] logicalModemIds; +} diff --git a/radio/config/aidl/android/hardware/radio/config/SimSlotStatus.aidl b/radio/config/aidl/android/hardware/radio/config/SimSlotStatus.aidl new file mode 100644 index 0000000000..f5ea8f99ef --- /dev/null +++ b/radio/config/aidl/android/hardware/radio/config/SimSlotStatus.aidl @@ -0,0 +1,56 @@ +/* + * 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. + */ + +package android.hardware.radio.config; + +@VintfStability +parcelable SimSlotStatus { + boolean cardActive; + /** + * Card state in the physical slot. Values are CardStatus.[STATE_ABSENT, STATE_PRESENT, + * STATE_ERROR, STATE_RESTRICTED]. + */ + int cardState; + /** + * Slot state Active/Inactive + */ + int slotState; + /** + * An Answer To Reset (ATR) is a message output by a Smart Card conforming to ISO/IEC 7816 + * standards, following electrical reset of the card's chip. The ATR conveys information about + * the communication parameters proposed by the card, and the card's nature and state. + * + * This data is applicable only when cardState is CardStatus.STATE_PRESENT. + */ + String atr; + int logicalSlotId; + /** + * Integrated Circuit Card IDentifier (ICCID) is Unique Identifier of the SIM CARD. File is + * located in the SIM card at EFiccid (0x2FE2) as per ETSI 102.221. The ICCID is defined by + * the ITU-T recommendation E.118 ISO/IEC 7816. + * + * This data is applicable only when cardState is CardStatus.STATE_PRESENT. + */ + String iccid; + /** + * The EID is the eUICC identifier. The EID shall be stored within the ECASD and can be + * retrieved by the Device at any time using the standard GlobalPlatform GET DATA command. + * + * This data is mandatory and applicable only when cardState is CardStatus.STATE_PRESENT and SIM + * card supports eUICC. + */ + String eid; +} -- GitLab From 00c39ebf006899e3b22a9550ab71431f5c72f073 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 9 Sep 2021 14:21:02 -0700 Subject: [PATCH 143/825] Add VehicleHal utilities. Add some utility functions to AIDL VHAL. Test: atest VehicleHalVehicleUtilsTest Bug: 199337732 Change-Id: I9e74161efecf7c66caa2f52177fbdd43cdc9d68b --- automotive/vehicle/aidl/impl/Android.bp | 36 +++++ .../vehicle/aidl/impl/utils/TEST_MAPPING | 7 + .../vehicle/aidl/impl/utils/common/Android.bp | 36 +++++ .../impl/utils/common/include/PropertyUtils.h | 120 ++++++++++++++++ .../utils/common/include/VehicleHalTypes.h | 55 ++++++++ .../impl/utils/common/include/VehicleUtils.h | 89 ++++++++++++ .../aidl/impl/utils/common/test/Android.bp | 28 ++++ .../utils/common/test/VehicleUtilsTest.cpp | 128 ++++++++++++++++++ .../vehicle/aidl/impl/utils/test/Android.bp | 25 ++++ .../utils/test/include/TestPropertyUtils.h | 89 ++++++++++++ 10 files changed, 613 insertions(+) create mode 100644 automotive/vehicle/aidl/impl/Android.bp create mode 100644 automotive/vehicle/aidl/impl/utils/TEST_MAPPING create mode 100644 automotive/vehicle/aidl/impl/utils/common/Android.bp create mode 100644 automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h create mode 100644 automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h create mode 100644 automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h create mode 100644 automotive/vehicle/aidl/impl/utils/common/test/Android.bp create mode 100644 automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp create mode 100644 automotive/vehicle/aidl/impl/utils/test/Android.bp create mode 100644 automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h diff --git a/automotive/vehicle/aidl/impl/Android.bp b/automotive/vehicle/aidl/impl/Android.bp new file mode 100644 index 0000000000..0b98c7edd0 --- /dev/null +++ b/automotive/vehicle/aidl/impl/Android.bp @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_defaults { + name: "VehicleHalDefaults", + static_libs: [ + "android.hardware.automotive.vehicle-V1-ndk_platform", + ], + shared_libs: [ + "libbase", + "liblog", + "libutils", + ], + cflags: [ + "-Wall", + "-Wextra", + "-Werror", + ], +} diff --git a/automotive/vehicle/aidl/impl/utils/TEST_MAPPING b/automotive/vehicle/aidl/impl/utils/TEST_MAPPING new file mode 100644 index 0000000000..d3d00abc62 --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/TEST_MAPPING @@ -0,0 +1,7 @@ +{ + "presubmit": [ + { + "name": "VehicleHalVehicleUtilsTest" + } + ] +} diff --git a/automotive/vehicle/aidl/impl/utils/common/Android.bp b/automotive/vehicle/aidl/impl/utils/common/Android.bp new file mode 100644 index 0000000000..001280f857 --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/common/Android.bp @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_library { + name: "VehicleHalUtils", + srcs: [ + "src/*.cpp", + ], + vendor: true, + local_include_dirs: ["include"], + export_include_dirs: ["include"], + defaults: ["VehicleHalDefaults"], +} + +cc_library_headers { + name: "VehicleHalUtilHeaders", + export_include_dirs: ["include"], + vendor: true, +} diff --git a/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h new file mode 100644 index 0000000000..441c54b5be --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h @@ -0,0 +1,120 @@ +/* + * 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_aidl_impl_utils_common_include_PropertyUtils_H_ +#define android_hardware_automotive_vehicle_aidl_impl_utils_common_include_PropertyUtils_H_ + +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +namespace propertyutils_impl { + +// These names are not part of the API since we only expose ints. +using ::aidl::android::hardware::automotive::vehicle::PortLocationType; +using ::aidl::android::hardware::automotive::vehicle::VehicleArea; +using ::aidl::android::hardware::automotive::vehicle::VehicleAreaDoor; +using ::aidl::android::hardware::automotive::vehicle::VehicleAreaSeat; +using ::aidl::android::hardware::automotive::vehicle::VehicleAreaWheel; +using ::aidl::android::hardware::automotive::vehicle::VehicleAreaWindow; +using ::aidl::android::hardware::automotive::vehicle::VehicleHvacFanDirection; +using ::aidl::android::hardware::automotive::vehicle::VehicleLightState; +using ::aidl::android::hardware::automotive::vehicle::VehicleLightSwitch; +using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; + +} // namespace propertyutils_impl + +// Some handy constants to avoid conversions from enum to int. +constexpr int ABS_ACTIVE = toInt(propertyutils_impl::VehicleProperty::ABS_ACTIVE); +constexpr int AP_POWER_STATE_REQ = toInt(propertyutils_impl::VehicleProperty::AP_POWER_STATE_REQ); +constexpr int AP_POWER_STATE_REPORT = + toInt(propertyutils_impl::VehicleProperty::AP_POWER_STATE_REPORT); +constexpr int DOOR_1_LEFT = toInt(propertyutils_impl::VehicleAreaDoor::ROW_1_LEFT); +constexpr int DOOR_1_RIGHT = toInt(propertyutils_impl::VehicleAreaDoor::ROW_1_RIGHT); +constexpr int DOOR_2_LEFT = toInt(propertyutils_impl::VehicleAreaDoor::ROW_2_LEFT); +constexpr int DOOR_2_RIGHT = toInt(propertyutils_impl::VehicleAreaDoor::ROW_2_RIGHT); +constexpr int DOOR_REAR = toInt(propertyutils_impl::VehicleAreaDoor::REAR); +constexpr int WINDOW_1_LEFT = toInt(propertyutils_impl::VehicleAreaWindow::ROW_1_LEFT); +constexpr int WINDOW_1_RIGHT = toInt(propertyutils_impl::VehicleAreaWindow::ROW_1_RIGHT); +constexpr int WINDOW_2_LEFT = toInt(propertyutils_impl::VehicleAreaWindow::ROW_2_LEFT); +constexpr int WINDOW_2_RIGHT = toInt(propertyutils_impl::VehicleAreaWindow::ROW_2_RIGHT); +constexpr int WINDOW_ROOF_TOP_1 = toInt(propertyutils_impl::VehicleAreaWindow::ROOF_TOP_1); +constexpr int FAN_DIRECTION_FACE = toInt(propertyutils_impl::VehicleHvacFanDirection::FACE); +constexpr int FAN_DIRECTION_FLOOR = toInt(propertyutils_impl::VehicleHvacFanDirection::FLOOR); +constexpr int FAN_DIRECTION_DEFROST = toInt(propertyutils_impl::VehicleHvacFanDirection::DEFROST); +constexpr int OBD2_LIVE_FRAME = toInt(propertyutils_impl::VehicleProperty::OBD2_LIVE_FRAME); +constexpr int OBD2_FREEZE_FRAME = toInt(propertyutils_impl::VehicleProperty::OBD2_FREEZE_FRAME); +constexpr int OBD2_FREEZE_FRAME_INFO = + toInt(propertyutils_impl::VehicleProperty::OBD2_FREEZE_FRAME_INFO); +constexpr int OBD2_FREEZE_FRAME_CLEAR = + toInt(propertyutils_impl::VehicleProperty::OBD2_FREEZE_FRAME_CLEAR); +constexpr int TRACTION_CONTROL_ACTIVE = + toInt(propertyutils_impl::VehicleProperty::TRACTION_CONTROL_ACTIVE); +constexpr int VEHICLE_MAP_SERVICE = toInt(propertyutils_impl::VehicleProperty::VEHICLE_MAP_SERVICE); +constexpr int WHEEL_TICK = toInt(propertyutils_impl::VehicleProperty::WHEEL_TICK); +constexpr int SEAT_1_LEFT = toInt(propertyutils_impl::VehicleAreaSeat::ROW_1_LEFT); +constexpr int SEAT_1_RIGHT = toInt(propertyutils_impl::VehicleAreaSeat::ROW_1_RIGHT); +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); +constexpr int LIGHT_STATE_ON = toInt(propertyutils_impl::VehicleLightState::ON); +constexpr int LIGHT_SWITCH_AUTO = toInt(propertyutils_impl::VehicleLightSwitch::AUTOMATIC); +constexpr int WHEEL_FRONT_LEFT = toInt(propertyutils_impl::VehicleAreaWheel::LEFT_FRONT); +constexpr int WHEEL_FRONT_RIGHT = toInt(propertyutils_impl::VehicleAreaWheel::RIGHT_FRONT); +constexpr int WHEEL_REAR_LEFT = toInt(propertyutils_impl::VehicleAreaWheel::LEFT_REAR); +constexpr int WHEEL_REAR_RIGHT = toInt(propertyutils_impl::VehicleAreaWheel::RIGHT_REAR); +constexpr int ALL_WHEELS = + WHEEL_FRONT_LEFT | WHEEL_FRONT_RIGHT | WHEEL_REAR_LEFT | WHEEL_REAR_RIGHT; +constexpr int HVAC_LEFT = SEAT_1_LEFT | SEAT_2_LEFT | SEAT_2_CENTER; +constexpr int HVAC_RIGHT = SEAT_1_RIGHT | SEAT_2_RIGHT; +constexpr int HVAC_ALL = HVAC_LEFT | HVAC_RIGHT; + +const int32_t kHvacPowerProperties[] = { + toInt(propertyutils_impl::VehicleProperty::HVAC_FAN_SPEED), + toInt(propertyutils_impl::VehicleProperty::HVAC_FAN_DIRECTION), +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_aidl_impl_utils_common_include_PropertyUtils_H_ diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h new file mode 100644 index 0000000000..a8f5ec72dc --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -0,0 +1,55 @@ +/* + * 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_aidl_impl_utils_common_include_VehicleHalTypes_H_ +#define android_hardware_automotive_vehicle_aidl_impl_utils_common_include_VehicleHalTypes_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // android_hardware_automotive_vehicle_aidl_impl_utils_common_include_VehicleHalTypes_H_ diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h new file mode 100644 index 0000000000..c4bf1d34e5 --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h @@ -0,0 +1,89 @@ +/* + * 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_aidl_impl_utils_common_include_VehicleUtils_H_ +#define android_hardware_automotive_vehicle_aidl_impl_utils_common_include_VehicleUtils_H_ + +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +// Represents all supported areas for a property. +constexpr int32_t kAllSupportedAreas = 0; + +// Returns underlying (integer) value for given enum. +template ::type> +inline constexpr U toInt(ENUM const value) { + return static_cast(value); +} + +inline constexpr ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType getPropType( + int32_t prop) { + return static_cast<::aidl::android::hardware::automotive::vehicle::VehiclePropertyType>( + prop & + toInt(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MASK)); +} + +inline constexpr ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup getPropGroup( + int32_t prop) { + return static_cast<::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup>( + prop & + toInt(::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup::MASK)); +} + +inline constexpr ::aidl::android::hardware::automotive::vehicle::VehicleArea getPropArea( + int32_t prop) { + return static_cast<::aidl::android::hardware::automotive::vehicle::VehicleArea>( + prop & toInt(::aidl::android::hardware::automotive::vehicle::VehicleArea::MASK)); +} + +inline constexpr bool isGlobalProp(int32_t prop) { + return getPropArea(prop) == ::aidl::android::hardware::automotive::vehicle::VehicleArea::GLOBAL; +} + +inline constexpr bool isSystemProp(int32_t prop) { + return ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup::SYSTEM == + getPropGroup(prop); +} + +inline const ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* getAreaConfig( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue, + const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config) { + if (config.areaConfigs.size() == 0) { + return nullptr; + } + + if (isGlobalProp(propValue.prop)) { + return &(config.areaConfigs[0]); + } + + for (const auto& c : config.areaConfigs) { + if (c.areaId == propValue.areaId) { + return &c; + } + } + return nullptr; +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_aidl_impl_utils_common_include_VehicleUtils_H_ diff --git a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp new file mode 100644 index 0000000000..40744cef8e --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_test { + name: "VehicleHalVehicleUtilsTest", + srcs: ["*.cpp"], + vendor: true, + static_libs: ["VehicleHalUtils"], + defaults: ["VehicleHalDefaults"], + test_suites: ["general-tests"], +} diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp new file mode 100644 index 0000000000..c09b06d749 --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp @@ -0,0 +1,128 @@ +/* + * 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 +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +using ::aidl::android::hardware::automotive::vehicle::VehicleArea; +using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; +using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; + +TEST(VehicleUtilsTest, testToInt) { + int areaGlobal = toInt(VehicleArea::GLOBAL); + + ASSERT_EQ(areaGlobal, 0x01000000); +} + +TEST(VehicleUtilsTest, testGetPropType) { + VehiclePropertyType type = getPropType(toInt(VehicleProperty::INFO_VIN)); + + ASSERT_EQ(type, VehiclePropertyType::STRING); +} + +TEST(VehicleUtilsTest, testGetPropGroup) { + VehiclePropertyGroup group = getPropGroup(toInt(VehicleProperty::INFO_VIN)); + + ASSERT_EQ(group, VehiclePropertyGroup::SYSTEM); +} + +TEST(VehicleUtilsTest, testGetPropArea) { + VehicleArea area = getPropArea(toInt(VehicleProperty::INFO_VIN)); + + ASSERT_EQ(area, VehicleArea::GLOBAL); +} + +TEST(VehicleUtilsTest, testIsGlobalPropTrue) { + ASSERT_TRUE(isGlobalProp(toInt(VehicleProperty::INFO_VIN))); +} + +TEST(VehicleUtilsTest, testIsGlobalPropFalse) { + ASSERT_FALSE(isGlobalProp(toInt(VehicleProperty::TIRE_PRESSURE))); +} + +TEST(VehicleUtilsTest, testIsSystemPropTrue) { + ASSERT_TRUE(isSystemProp(toInt(VehicleProperty::INFO_VIN))); +} + +TEST(VehicleUtilsTest, testIsSystemPropFalse) { + // VehiclePropertyGroup:VENDOR,VehicleArea:GLOBAL,VehiclePropertyType:STRING + int vendorProp = 0x0100 + 0x20000000 + 0x01000000 + 0x00100000; + + ASSERT_FALSE(isSystemProp(vendorProp)); +} + +TEST(VehicleUtilsTest, testGetAreaConfigGlobal) { + VehiclePropValue testPropValue{.prop = toInt(VehicleProperty::INFO_VIN)}; + VehicleAreaConfig testAreaConfig{.areaId = 0, .minInt32Value = 1}; + VehiclePropConfig testConfig{.areaConfigs = {testAreaConfig}}; + + const VehicleAreaConfig* gotConfig = getAreaConfig(testPropValue, testConfig); + + ASSERT_EQ(*gotConfig, testAreaConfig); +} + +TEST(VehicleUtilsTest, testGetAreaConfigGlobalNoAreaConfig) { + VehiclePropValue testPropValue{.prop = toInt(VehicleProperty::INFO_VIN)}; + VehiclePropConfig testConfig{}; + + const VehicleAreaConfig* gotConfig = getAreaConfig(testPropValue, testConfig); + + ASSERT_EQ(gotConfig, nullptr); +} + +TEST(VehicleUtilsTest, testGetAreaConfigNonGlobal) { + VehiclePropValue testPropValue = { + .prop = toInt(VehicleProperty::TIRE_PRESSURE), + }; + VehicleAreaConfig leftConfig{.areaId = WHEEL_FRONT_LEFT, .minInt32Value = 1}; + VehicleAreaConfig rightConfig{.areaId = WHEEL_FRONT_RIGHT, .minInt32Value = 2}; + VehiclePropConfig testConfig{.areaConfigs = {leftConfig, rightConfig}}; + + testPropValue.areaId = WHEEL_FRONT_LEFT; + const VehicleAreaConfig* gotConfig = getAreaConfig(testPropValue, testConfig); + + ASSERT_EQ(*gotConfig, leftConfig); +} + +TEST(VehicleUtilsTest, testGetAreaConfigNonGlobalNull) { + VehiclePropValue testPropValue = { + .prop = toInt(VehicleProperty::TIRE_PRESSURE), + }; + VehicleAreaConfig leftConfig{.areaId = WHEEL_FRONT_LEFT, .minInt32Value = 1}; + VehicleAreaConfig rightConfig{.areaId = WHEEL_FRONT_RIGHT, .minInt32Value = 2}; + VehiclePropConfig testConfig{.areaConfigs = {leftConfig, rightConfig}}; + + // No config for this area. + testPropValue.areaId = 0; + const VehicleAreaConfig* gotConfig = getAreaConfig(testPropValue, testConfig); + + ASSERT_EQ(gotConfig, nullptr); +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/automotive/vehicle/aidl/impl/utils/test/Android.bp new file mode 100644 index 0000000000..5859151598 --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/test/Android.bp @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_library_headers { + name: "VehicleHalTestUtilHeaders", + export_include_dirs: ["include"], + vendor: true, +} diff --git a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h new file mode 100644 index 0000000000..77cf100ac3 --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h @@ -0,0 +1,89 @@ +/* + * 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 +#include + +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::VehiclePropertyGroup; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; + +} // namespace testpropertyutils_impl + +#ifdef ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING +// 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( + ::aidl::android::hardware::automotive::vehicle::VehicleProperty::CLUSTER_SWITCH_UI); +constexpr int32_t VENDOR_CLUSTER_DISPLAY_STATE = + toVendor(::aidl::hardware::automotive::vehicle::VehicleProperty::CLUSTER_DISPLAY_STATE); +constexpr int32_t VENDOR_CLUSTER_REPORT_STATE = + toVendor(::aidl::hardware::automotive::vehicle::VehicleProperty::CLUSTER_REPORT_STATE); +constexpr int32_t VENDOR_CLUSTER_REQUEST_DISPLAY = + toVendor(::aidl::hardware::automotive::vehicle::VehicleProperty::CLUSTER_REQUEST_DISPLAY); +constexpr int32_t VENDOR_CLUSTER_NAVIGATION_STATE = + toVendor(::aidl::hardware::automotive::vehicle::VehicleProperty::CLUSTER_NAVIGATION_STATE); +#endif // ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING + +// 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 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_ -- GitLab From 81fbbea6b94842e0456b26ff749fc01d1d628df4 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 16 Sep 2021 19:44:55 -0700 Subject: [PATCH 144/825] Migrate VehiclePropertyStore. Test: atest VehicleHalVehicleUtilsTest Bug: 199337732 Change-Id: Ia18699a0115fdb004c57c0e6fb02b043ddb138b5 --- automotive/vehicle/aidl/impl/Android.bp | 1 + .../common/include/VehiclePropertyStore.h | 136 ++++++++ .../utils/common/src/VehiclePropertyStore.cpp | 231 +++++++++++++ .../aidl/impl/utils/common/test/Android.bp | 6 +- .../common/test/VehiclePropertyStoreTest.cpp | 314 ++++++++++++++++++ 5 files changed, 687 insertions(+), 1 deletion(-) create mode 100644 automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h create mode 100644 automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp create mode 100644 automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp diff --git a/automotive/vehicle/aidl/impl/Android.bp b/automotive/vehicle/aidl/impl/Android.bp index 0b98c7edd0..a97d54492e 100644 --- a/automotive/vehicle/aidl/impl/Android.bp +++ b/automotive/vehicle/aidl/impl/Android.bp @@ -32,5 +32,6 @@ cc_defaults { "-Wall", "-Wextra", "-Werror", + "-Wthread-safety", ], } diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h new file mode 100644 index 0000000000..b19ab841a8 --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h @@ -0,0 +1,136 @@ +/* + * 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_aidl_impl_utils_common_include_VehiclePropertyStore_H_ +#define android_hardware_automotive_vehicle_aidl_impl_utils_common_include_VehiclePropertyStore_H_ + +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +// Encapsulates work related to storing and accessing configuration, storing and modifying +// vehicle property values. +// +// VehiclePropertyValues stored in a sorted map thus it makes easier to get range of values, e.g. +// to get value for all areas for particular property. +// +// This class is thread-safe, however it uses blocking synchronization across all methods. +class VehiclePropertyStore { + public: + // Function that used to calculate unique token for given VehiclePropValue. + using TokenFunction = ::std::function; + + // Register the given property according to the config. A property has to be registered first + // before write/read. If tokenFunc is not nullptr, it would be used to generate a unique + // property token to act as the key the property store. Otherwise, {propertyID, areaID} would be + // used as the key. + void registerProperty( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config, + TokenFunction tokenFunc = nullptr); + + // Stores provided value. Returns true if value was written returns false if config wasn't + // registered. + ::android::base::Result writeValue( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); + + // 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); + + // Remove all the values for the property. + void removeValuesForProperty(int32_t propId); + + // Read all the stored values. + std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> readAllValues() + const; + + // Read all the values for the property. + ::android::base::Result< + std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>> + readValuesForProperty(int32_t propId) const; + + // Read the value for the requested property. + ::android::base::Result< + std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>> + readValue( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& request) const; + + // Read the value for the requested property. + ::android::base::Result< + std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>> + readValue(int32_t prop, int32_t area = 0, int64_t token = 0) const; + + // Get all property configs. + std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig> getAllConfigs() + const; + + // Get the property config for the requested property. + ::android::base::Result< + const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig*> + getConfig(int32_t propId) const; + + private: + struct RecordId { + int32_t area; + int64_t token; + + bool operator==(const RecordId& other) const; + bool operator<(const RecordId& other) const; + + std::string toString() const; + }; + + struct Record { + ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig propConfig; + TokenFunction tokenFunction; + std::map values; + }; + + mutable std::mutex mLock; + std::unordered_map mRecordsByPropId GUARDED_BY(mLock); + + const Record* getRecordLocked(int32_t propId) const; + + Record* getRecordLocked(int32_t propId); + + RecordId getRecordIdLocked( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue, + const Record& record) const; + + ::android::base::Result< + std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>> + readValueLocked(const RecordId& recId, const Record& record) const; +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_aidl_impl_utils_common_include_VehiclePropertyStore_H_ diff --git a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp new file mode 100644 index 0000000000..b660f36d65 --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp @@ -0,0 +1,231 @@ +/* + * 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. + */ + +#define LOG_TAG "VehiclePropertyStore" +#include + +#include "VehiclePropertyStore.h" + +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; +using ::android::base::Result; + +bool VehiclePropertyStore::RecordId::operator==(const VehiclePropertyStore::RecordId& other) const { + return area == other.area && token == other.token; +} + +bool VehiclePropertyStore::RecordId::operator<(const VehiclePropertyStore::RecordId& other) const { + return area < other.area || (area == other.area && token < other.token); +} + +std::string VehiclePropertyStore::RecordId::toString() const { + return ::fmt::format("RecordID{{.areaId={:d}, .token={:d}}}", area, token); +} + +const VehiclePropertyStore::Record* VehiclePropertyStore::getRecordLocked(int32_t propId) const + REQUIRES(mLock) { + auto RecordIt = mRecordsByPropId.find(propId); + return RecordIt == mRecordsByPropId.end() ? nullptr : &RecordIt->second; +} + +VehiclePropertyStore::Record* VehiclePropertyStore::getRecordLocked(int32_t propId) + REQUIRES(mLock) { + auto RecordIt = mRecordsByPropId.find(propId); + return RecordIt == mRecordsByPropId.end() ? nullptr : &RecordIt->second; +} + +VehiclePropertyStore::RecordId VehiclePropertyStore::getRecordIdLocked( + const VehiclePropValue& propValue, const VehiclePropertyStore::Record& record) const + REQUIRES(mLock) { + VehiclePropertyStore::RecordId recId{ + .area = isGlobalProp(propValue.prop) ? 0 : propValue.areaId, .token = 0}; + + if (record.tokenFunction != nullptr) { + recId.token = record.tokenFunction(propValue); + } + return recId; +} + +Result> VehiclePropertyStore::readValueLocked( + const RecordId& recId, const Record& record) const REQUIRES(mLock) { + auto it = record.values.find(recId); + if (it == record.values.end()) { + return Errorf("Record ID: {} is not found", recId.toString()); + } + return std::make_unique(it->second); +} + +void VehiclePropertyStore::registerProperty(const VehiclePropConfig& config, + VehiclePropertyStore::TokenFunction tokenFunc) { + std::lock_guard g(mLock); + + mRecordsByPropId[config.prop] = Record{ + .propConfig = config, + .tokenFunction = tokenFunc, + }; +} + +Result VehiclePropertyStore::writeValue(const VehiclePropValue& propValue) { + std::lock_guard g(mLock); + + VehiclePropertyStore::Record* record = getRecordLocked(propValue.prop); + if (record == nullptr) { + return Errorf("property: {:d} not registered", propValue.prop); + } + + if (!isGlobalProp(propValue.prop) && getAreaConfig(propValue, record->propConfig) == nullptr) { + return Errorf("no config for property: {:d} area: {:d}", propValue.prop, propValue.areaId); + } + + VehiclePropertyStore::RecordId recId = getRecordIdLocked(propValue, *record); + auto it = record->values.find(recId); + if (it == record->values.end()) { + record->values[recId] = propValue; + return {}; + } + VehiclePropValue* valueToUpdate = &(it->second); + + // propValue is outdated and drops it. + if (valueToUpdate->timestamp > propValue.timestamp) { + return Errorf("outdated timestamp: {:d}", propValue.timestamp); + } + // Update the propertyValue. + // The timestamp in propertyStore should only be updated by the server side. It indicates + // the time when the event is generated by the server. + valueToUpdate->timestamp = propValue.timestamp; + valueToUpdate->value = propValue.value; + valueToUpdate->status = propValue.status; + return {}; +} + +void VehiclePropertyStore::removeValue(const VehiclePropValue& propValue) { + std::lock_guard g(mLock); + + VehiclePropertyStore::Record* record = getRecordLocked(propValue.prop); + if (record == nullptr) { + return; + } + + VehiclePropertyStore::RecordId recId = getRecordIdLocked(propValue, *record); + if (auto it = record->values.find(recId); it != record->values.end()) { + record->values.erase(it); + } +} + +void VehiclePropertyStore::removeValuesForProperty(int32_t propId) { + std::lock_guard g(mLock); + + VehiclePropertyStore::Record* record = getRecordLocked(propId); + if (record == nullptr) { + return; + } + + record->values.clear(); +} + +std::vector VehiclePropertyStore::readAllValues() const { + std::lock_guard g(mLock); + + std::vector allValues; + + for (auto const& [_, record] : mRecordsByPropId) { + for (auto const& [_, value] : record.values) { + allValues.push_back(value); + } + } + + return allValues; +} + +Result> VehiclePropertyStore::readValuesForProperty( + int32_t propId) const { + std::lock_guard g(mLock); + + std::vector values; + + const VehiclePropertyStore::Record* record = getRecordLocked(propId); + if (record == nullptr) { + return Errorf("property: {:d} not registered", propId); + } + + for (auto const& [_, value] : record->values) { + values.push_back(value); + } + return values; +} + +Result> VehiclePropertyStore::readValue( + const VehiclePropValue& propValue) const { + std::lock_guard g(mLock); + + const VehiclePropertyStore::Record* record = getRecordLocked(propValue.prop); + if (record == nullptr) { + return Errorf("property: {:d} not registered", propValue.prop); + } + + VehiclePropertyStore::RecordId recId = getRecordIdLocked(propValue, *record); + return readValueLocked(recId, *record); +} + +Result> VehiclePropertyStore::readValue(int32_t propId, + int32_t areaId, + int64_t token) const { + std::lock_guard g(mLock); + + const VehiclePropertyStore::Record* record = getRecordLocked(propId); + if (record == nullptr) { + return Errorf("property: {:d} not registered", propId); + } + + VehiclePropertyStore::RecordId recId{.area = isGlobalProp(propId) ? 0 : areaId, .token = token}; + return readValueLocked(recId, *record); +} + +std::vector VehiclePropertyStore::getAllConfigs() const { + std::lock_guard g(mLock); + + std::vector configs; + configs.reserve(mRecordsByPropId.size()); + for (auto& [_, config] : mRecordsByPropId) { + configs.push_back(config.propConfig); + } + return configs; +} + +Result VehiclePropertyStore::getConfig(int32_t propId) const { + std::lock_guard g(mLock); + + const VehiclePropertyStore::Record* record = getRecordLocked(propId); + if (record == nullptr) { + return Errorf("property: {:d} not registered", propId); + } + + return &record->propConfig; +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp index 40744cef8e..65b0e4685c 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp +++ b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp @@ -22,7 +22,11 @@ cc_test { name: "VehicleHalVehicleUtilsTest", srcs: ["*.cpp"], vendor: true, - static_libs: ["VehicleHalUtils"], + static_libs: [ + "VehicleHalUtils", + "libgtest", + "libgmock", + ], defaults: ["VehicleHalDefaults"], test_suites: ["general-tests"], } diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp new file mode 100644 index 0000000000..8c70fea924 --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp @@ -0,0 +1,314 @@ +/* + * 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 +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +namespace { + +using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; +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::VehiclePropValue; +using ::android::base::Result; +using ::testing::ElementsAre; +using ::testing::Eq; +using ::testing::WhenSortedBy; + +constexpr int INVALID_PROP_ID = 0; + +struct PropValueCmp { + bool operator()(const VehiclePropValue& a, const VehiclePropValue& b) const { + return (a.prop < b.prop) || ((a.prop == b.prop) && (a.value < b.value)) || + ((a.prop == b.prop) && (a.value == b.value) && (a.areaId < b.areaId)); + } +} propValueCmp; + +int64_t timestampToken(const VehiclePropValue& value) { + return value.timestamp; +} + +} // namespace + +class VehiclePropertyStoreTest : public ::testing::Test { + protected: + void SetUp() override { + mConfigFuelCapacity = { + .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, + }; + VehiclePropConfig configTirePressure = { + .prop = toInt(VehicleProperty::TIRE_PRESSURE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, + .areaConfigs = {VehicleAreaConfig{.areaId = WHEEL_FRONT_LEFT}, + VehicleAreaConfig{.areaId = WHEEL_FRONT_RIGHT}, + VehicleAreaConfig{.areaId = WHEEL_REAR_LEFT}, + VehicleAreaConfig{.areaId = WHEEL_REAR_RIGHT}}, + }; + mStore.registerProperty(mConfigFuelCapacity); + mStore.registerProperty(configTirePressure); + } + + VehiclePropertyStore mStore; + VehiclePropConfig mConfigFuelCapacity; +}; + +TEST_F(VehiclePropertyStoreTest, testGetAllConfigs) { + std::vector configs = mStore.getAllConfigs(); + + ASSERT_EQ(configs.size(), static_cast(2)); +} + +TEST_F(VehiclePropertyStoreTest, testGetConfig) { + Result result = + mStore.getConfig(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); + + ASSERT_RESULT_OK(result); + ASSERT_EQ(*(result.value()), mConfigFuelCapacity); +} + +TEST_F(VehiclePropertyStoreTest, testGetConfigWithInvalidPropId) { + Result result = mStore.getConfig(INVALID_PROP_ID); + + ASSERT_FALSE(result.ok()) << "expect error when getting a config for an invalid property ID"; +} + +std::vector getTestPropValues() { + VehiclePropValue fuelCapacity = { + .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), + .value = {.floatValues = {1.0}}, + }; + + VehiclePropValue leftTirePressure = { + .prop = toInt(VehicleProperty::TIRE_PRESSURE), + .value = {.floatValues = {170.0}}, + .areaId = WHEEL_FRONT_LEFT, + }; + + VehiclePropValue rightTirePressure = { + .prop = toInt(VehicleProperty::TIRE_PRESSURE), + .value = {.floatValues = {180.0}}, + .areaId = WHEEL_FRONT_RIGHT, + }; + + return {fuelCapacity, leftTirePressure, rightTirePressure}; +} + +TEST_F(VehiclePropertyStoreTest, testWriteValueOk) { + auto values = getTestPropValues(); + + ASSERT_RESULT_OK(mStore.writeValue(values[0])); +} + +TEST_F(VehiclePropertyStoreTest, testReadAllValues) { + auto values = getTestPropValues(); + for (const auto& value : values) { + ASSERT_RESULT_OK(mStore.writeValue(value)); + } + + auto gotValues = mStore.readAllValues(); + + ASSERT_THAT(gotValues, WhenSortedBy(propValueCmp, Eq(values))); +} + +TEST_F(VehiclePropertyStoreTest, testReadValuesForPropertyOneValue) { + auto values = getTestPropValues(); + for (const auto& value : values) { + ASSERT_RESULT_OK(mStore.writeValue(value)); + } + + auto result = mStore.readValuesForProperty(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); + + ASSERT_RESULT_OK(result); + ASSERT_THAT(result.value(), ElementsAre(values[0])); +} + +TEST_F(VehiclePropertyStoreTest, testReadValuesForPropertyMultipleValues) { + auto values = getTestPropValues(); + for (const auto& value : values) { + ASSERT_RESULT_OK(mStore.writeValue(value)); + } + + auto result = mStore.readValuesForProperty(toInt(VehicleProperty::TIRE_PRESSURE)); + + ASSERT_RESULT_OK(result); + ASSERT_THAT(result.value(), WhenSortedBy(propValueCmp, ElementsAre(values[1], values[2]))); +} + +TEST_F(VehiclePropertyStoreTest, testReadValuesForPropertyError) { + auto result = mStore.readValuesForProperty(INVALID_PROP_ID); + + ASSERT_FALSE(result.ok()) << "expect error when reading values for an invalid property"; +} + +TEST_F(VehiclePropertyStoreTest, testReadValueOk) { + auto values = getTestPropValues(); + for (const auto& value : values) { + ASSERT_RESULT_OK(mStore.writeValue(value)); + } + + VehiclePropValue requestValue = { + .prop = toInt(VehicleProperty::TIRE_PRESSURE), + .areaId = WHEEL_FRONT_LEFT, + }; + + auto result = mStore.readValue(requestValue); + + ASSERT_RESULT_OK(result); + ASSERT_EQ(*(result.value()), values[1]); +} + +TEST_F(VehiclePropertyStoreTest, testReadValueByPropIdOk) { + auto values = getTestPropValues(); + for (const auto& value : values) { + ASSERT_RESULT_OK(mStore.writeValue(value)); + } + + auto result = mStore.readValue(toInt(VehicleProperty::TIRE_PRESSURE), WHEEL_FRONT_RIGHT); + + ASSERT_EQ(*(result.value()), values[2]); +} + +TEST_F(VehiclePropertyStoreTest, testReadValueError) { + auto values = getTestPropValues(); + for (const auto& value : values) { + ASSERT_RESULT_OK(mStore.writeValue(value)); + } + + auto result = mStore.readValue(toInt(VehicleProperty::TIRE_PRESSURE), WHEEL_REAR_LEFT); + + ASSERT_FALSE(result.ok()) << "expect error when reading a value that has not been written"; +} + +TEST_F(VehiclePropertyStoreTest, testWriteValueError) { + ASSERT_FALSE(mStore.writeValue({ + .prop = INVALID_PROP_ID, + .value = {.floatValues = {1.0}}, + }) + .ok()) + << "expect error when writing value for an invalid property ID"; +} + +TEST_F(VehiclePropertyStoreTest, testWriteValueNoAreaConfig) { + ASSERT_FALSE(mStore.writeValue({ + .prop = toInt(VehicleProperty::TIRE_PRESSURE), + .value = {.floatValues = {180.0}}, + // There is no config for ALL_WHEELS. + .areaId = ALL_WHEELS, + }) + .ok()) + << "expect error when writing value for an area without config"; +} + +TEST_F(VehiclePropertyStoreTest, testWriteOutdatedValue) { + ASSERT_RESULT_OK(mStore.writeValue({ + .timestamp = 1, + .prop = toInt(VehicleProperty::TIRE_PRESSURE), + .value = {.floatValues = {180.0}}, + .areaId = WHEEL_FRONT_LEFT, + })); + + // Write an older value. + ASSERT_FALSE(mStore.writeValue({ + .timestamp = 0, + .prop = toInt(VehicleProperty::TIRE_PRESSURE), + .value = {.floatValues = {180.0}}, + .areaId = WHEEL_FRONT_LEFT, + }) + .ok()) + << "expect error when writing an outdated value"; +} + +TEST_F(VehiclePropertyStoreTest, testToken) { + int propId = toInt(VehicleProperty::INFO_FUEL_CAPACITY); + VehiclePropConfig config = { + .prop = propId, + }; + + // Replace existing config. + mStore.registerProperty(config, timestampToken); + + VehiclePropValue fuelCapacityValueToken1 = { + .timestamp = 1, + .prop = propId, + .value = {.floatValues = {1.0}}, + }; + + VehiclePropValue fuelCapacityValueToken2 = { + .timestamp = 2, + .prop = propId, + .value = {.floatValues = {2.0}}, + }; + + ASSERT_RESULT_OK(mStore.writeValue(fuelCapacityValueToken1)); + ASSERT_RESULT_OK(mStore.writeValue(fuelCapacityValueToken2)); + + auto result = mStore.readValuesForProperty(propId); + + ASSERT_RESULT_OK(result); + ASSERT_EQ(result.value().size(), static_cast(2)); + + auto tokenResult = mStore.readValue(propId, /*areaId=*/0, /*token=*/2); + + ASSERT_RESULT_OK(tokenResult); + ASSERT_EQ(*(tokenResult.value()), fuelCapacityValueToken2); +} + +TEST_F(VehiclePropertyStoreTest, testRemoveValue) { + auto values = getTestPropValues(); + for (const auto& value : values) { + ASSERT_RESULT_OK(mStore.writeValue(value)); + } + + mStore.removeValue(values[0]); + + ASSERT_FALSE(mStore.readValue(values[0]).ok()) << "expect error when reading a removed value"; + + auto leftTirePressureResult = mStore.readValue(values[1]); + + ASSERT_RESULT_OK(leftTirePressureResult); + ASSERT_EQ(*(leftTirePressureResult.value()), values[1]); +} + +TEST_F(VehiclePropertyStoreTest, testRemoveValuesForProperty) { + auto values = getTestPropValues(); + for (const auto& value : values) { + ASSERT_RESULT_OK(mStore.writeValue(value)); + } + + mStore.removeValuesForProperty(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); + mStore.removeValuesForProperty(toInt(VehicleProperty::TIRE_PRESSURE)); + + auto gotValues = mStore.readAllValues(); + ASSERT_TRUE(gotValues.empty()); +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android -- GitLab From e4923de337b515ff8c08ceebb829d8b7f7ffe123 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 21 Sep 2021 16:21:54 -0700 Subject: [PATCH 145/825] Add HidlAidlCompatibilityTest. Add test to verify all properties defined in HIDL VHAL are also defined in AIDL. Test: atest VehicleHalAidlHidlCompatibilityTest Bug: b/170400618 Change-Id: I5c9e26f5eb149477c18a6b22ca8a39d8642249df --- .../{aidl/impl/utils => }/TEST_MAPPING | 3 ++ .../aidl_test/AidlHidlCompatibilityTest.cpp | 40 +++++++++++++++++++ automotive/vehicle/aidl/aidl_test/Android.bp | 37 +++++++++++++++++ 3 files changed, 80 insertions(+) rename automotive/vehicle/{aidl/impl/utils => }/TEST_MAPPING (55%) create mode 100644 automotive/vehicle/aidl/aidl_test/AidlHidlCompatibilityTest.cpp create mode 100644 automotive/vehicle/aidl/aidl_test/Android.bp diff --git a/automotive/vehicle/aidl/impl/utils/TEST_MAPPING b/automotive/vehicle/TEST_MAPPING similarity index 55% rename from automotive/vehicle/aidl/impl/utils/TEST_MAPPING rename to automotive/vehicle/TEST_MAPPING index d3d00abc62..15569f6f04 100644 --- a/automotive/vehicle/aidl/impl/utils/TEST_MAPPING +++ b/automotive/vehicle/TEST_MAPPING @@ -2,6 +2,9 @@ "presubmit": [ { "name": "VehicleHalVehicleUtilsTest" + }, + { + "name": "VehicleHalAidlHidlCompatibilityTest" } ] } diff --git a/automotive/vehicle/aidl/aidl_test/AidlHidlCompatibilityTest.cpp b/automotive/vehicle/aidl/aidl_test/AidlHidlCompatibilityTest.cpp new file mode 100644 index 0000000000..f4f3f28fda --- /dev/null +++ b/automotive/vehicle/aidl/aidl_test/AidlHidlCompatibilityTest.cpp @@ -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. + */ + +#include +#include + +#include +#include +#include +#include + +namespace hidl_vehicle = ::android::hardware::automotive::vehicle::V2_0; +namespace aidl_vehicle = ::aidl::android::hardware::automotive::vehicle; +using ::android::hardware::hidl_enum_range; +using ::ndk::enum_range; + +TEST(AidlHidlCompatibilityTest, testHidlPropertiesDefinedInAidl) { + for (const auto prop : hidl_enum_range()) { + int propInt = ::android::hardware::automotive::vehicle::toInt(prop); + auto aidlProperties = enum_range(); + + ASSERT_NE(std::find(aidlProperties.begin(), aidlProperties.end(), + static_cast(propInt)), + aidlProperties.end()) + << "property: " << propInt << " defined in HIDL, but not defined in AIDL"; + } +} diff --git a/automotive/vehicle/aidl/aidl_test/Android.bp b/automotive/vehicle/aidl/aidl_test/Android.bp new file mode 100644 index 0000000000..4337ac74e9 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_test/Android.bp @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_test { + name: "VehicleHalAidlHidlCompatibilityTest", + srcs: ["*.cpp"], + shared_libs: [ + "libbinder_ndk", + "libhidlbase", + ], + static_libs: [ + "VehicleHalUtils", + "android.hardware.automotive.vehicle@2.0", + "libgtest", + "libgmock", + ], + defaults: ["VehicleHalDefaults"], + test_suites: ["general-tests"], + vendor: true, +} -- GitLab From 90f5171cb88b8f384b731b6eaf6a7922261bcf57 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 21 Sep 2021 11:09:12 -0700 Subject: [PATCH 146/825] uwb: Add vts tests for UWB HAL No target to run the tests yet. So, just starting the VTS test suite for UWB with some simple tests. Also, modified the reference HAL implementation to emulate the startuo flow. Bug: 191175259 Test: atest VtsHalUwbTargetTest (using reference HAL on cuttlefish) Change-Id: I2f01a3fec3324e85123d1d17e1b03dd284aee7b1 --- uwb/aidl/default/uwb_chip.cpp | 25 +++- uwb/aidl/default/uwb_chip.h | 1 + uwb/aidl/vts/Android.bp | 28 ++++ uwb/aidl/vts/OWNERS | 2 + uwb/aidl/vts/VtsHalUwbTargetTest.cpp | 210 +++++++++++++++++++++++++++ 5 files changed, 258 insertions(+), 8 deletions(-) create mode 100644 uwb/aidl/vts/Android.bp create mode 100644 uwb/aidl/vts/OWNERS create mode 100644 uwb/aidl/vts/VtsHalUwbTargetTest.cpp diff --git a/uwb/aidl/default/uwb_chip.cpp b/uwb/aidl/default/uwb_chip.cpp index 727bcf133a..fe64fa7125 100644 --- a/uwb/aidl/default/uwb_chip.cpp +++ b/uwb/aidl/default/uwb_chip.cpp @@ -16,13 +16,17 @@ #include "uwb.h" +namespace { +constexpr static int kVendorUciVersion = 1; +} + namespace android { namespace hardware { namespace uwb { namespace impl { using namespace ::aidl::android::hardware::uwb; -UwbChip::UwbChip(const std::string& name) : name_(name) {} +UwbChip::UwbChip(const std::string& name) : name_(name), mClientCallback(nullptr) {} UwbChip::~UwbChip() {} ::ndk::ScopedAStatus UwbChip::getName(std::string* name) { @@ -30,25 +34,30 @@ UwbChip::~UwbChip() {} return ndk::ScopedAStatus::ok(); } -::ndk::ScopedAStatus UwbChip::open( - const std::shared_ptr& /* clientCallback */) { - return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); +::ndk::ScopedAStatus UwbChip::open(const std::shared_ptr& clientCallback) { + mClientCallback = clientCallback; + mClientCallback->onHalEvent(UwbEvent::OPEN_CPLT, UwbStatus::OK); + return ndk::ScopedAStatus::ok(); } ::ndk::ScopedAStatus UwbChip::close() { - return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); + mClientCallback->onHalEvent(UwbEvent::CLOSE_CPLT, UwbStatus::OK); + mClientCallback = nullptr; + return ndk::ScopedAStatus::ok(); } ::ndk::ScopedAStatus UwbChip::coreInit() { - return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); + return ndk::ScopedAStatus::ok(); } -::ndk::ScopedAStatus UwbChip::getSupportedVendorUciVersion(int32_t* /* version */) { - return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); +::ndk::ScopedAStatus UwbChip::getSupportedVendorUciVersion(int32_t* version) { + *version = kVendorUciVersion; + return ndk::ScopedAStatus::ok(); } ::ndk::ScopedAStatus UwbChip::sendUciMessage(const std::vector& /* data */, int32_t* /* bytes_written */) { + // TODO(b/195992658): Need emulator support for UCI stack. return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } } // namespace impl diff --git a/uwb/aidl/default/uwb_chip.h b/uwb/aidl/default/uwb_chip.h index 5d3f55cff8..ef1d5b634e 100644 --- a/uwb/aidl/default/uwb_chip.h +++ b/uwb/aidl/default/uwb_chip.h @@ -43,6 +43,7 @@ class UwbChip : public BnUwbChip { private: std::string name_; + std::shared_ptr mClientCallback; }; } // namespace impl } // namespace uwb diff --git a/uwb/aidl/vts/Android.bp b/uwb/aidl/vts/Android.bp new file mode 100644 index 0000000000..4d9f65307b --- /dev/null +++ b/uwb/aidl/vts/Android.bp @@ -0,0 +1,28 @@ +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: "VtsHalUwbTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: ["VtsHalUwbTargetTest.cpp"], + shared_libs: [ + "libbinder", + "libbinder_ndk", + ], + static_libs: [ + "android.hardware.uwb-V1-ndk", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/uwb/aidl/vts/OWNERS b/uwb/aidl/vts/OWNERS new file mode 100644 index 0000000000..c4ad4164e1 --- /dev/null +++ b/uwb/aidl/vts/OWNERS @@ -0,0 +1,2 @@ +# Bug component: 1042770 +include platform/packages/modules/Uwb:/OWNERS diff --git a/uwb/aidl/vts/VtsHalUwbTargetTest.cpp b/uwb/aidl/vts/VtsHalUwbTargetTest.cpp new file mode 100644 index 0000000000..9ac2678d3f --- /dev/null +++ b/uwb/aidl/vts/VtsHalUwbTargetTest.cpp @@ -0,0 +1,210 @@ +/* + * 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 std::shared_ptrecific language governing permissions and + * limitations under the License. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using aidl::android::hardware::uwb::BnUwbClientCallback; +using aidl::android::hardware::uwb::IUwb; +using aidl::android::hardware::uwb::IUwbChip; +using aidl::android::hardware::uwb::IUwbClientCallback; +using aidl::android::hardware::uwb::UwbEvent; +using aidl::android::hardware::uwb::UwbStatus; +using android::ProcessState; +using android::String16; +using ndk::ScopedAStatus; +using ndk::SpAIBinder; + +namespace { +constexpr static int kCallbackTimeoutMs = 250; +} // namespace + +class UwbClientCallback : public BnUwbClientCallback { + public: + UwbClientCallback(const std::function&)>& on_uci_message_cb, + const std::function& on_hal_event_cb) + : on_uci_message_cb_(on_uci_message_cb), on_hal_event_cb_(on_hal_event_cb) {} + + ScopedAStatus onUciMessage(const std::vector& data) override { + on_uci_message_cb_(data); + return ScopedAStatus::ok(); + } + + ScopedAStatus onHalEvent(UwbEvent uwb_event, UwbStatus uwb_status) override { + on_hal_event_cb_(uwb_event, uwb_status); + return ScopedAStatus::ok(); + } + + private: + std::function&)> on_uci_message_cb_; + std::function on_hal_event_cb_; +}; + +class UwbAidl : public testing::TestWithParam { + public: + virtual void SetUp() override { + iuwb_ = IUwb::fromBinder(SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); + ASSERT_NE(iuwb_, nullptr); + } + std::shared_ptr iuwb_; + + // TODO (b/197638976): We pick the first chip here. Need to fix this + // for supporting multiple chips in the future. + std::string getAnyChipName() { + std::vector chip_names; + ScopedAStatus status = iuwb_->getChips(&chip_names); + EXPECT_TRUE(status.isOk()); + EXPECT_FALSE(chip_names.empty()); + return chip_names[0]; + } + + // TODO (b/197638976): We pick the first chip here. Need to fix this + // for supporting multiple chips in the future. + std::shared_ptr getAnyChip() { + std::shared_ptr iuwb_chip; + ScopedAStatus status = iuwb_->getChip(getAnyChipName(), &iuwb_chip); + EXPECT_TRUE(status.isOk()); + EXPECT_NE(iuwb_chip, nullptr); + return iuwb_chip; + } + + std::shared_ptr getAnyChipAndOpen() { + std::promise open_cb_promise; + std::future open_cb_future{open_cb_promise.get_future()}; + std::shared_ptr callback = ndk::SharedRefBase::make( + [](auto /* data */) {}, + [&open_cb_promise](auto event, auto /* status */) { + if (event == UwbEvent::OPEN_CPLT) { + open_cb_promise.set_value(); + } + }); + std::chrono::milliseconds 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); + return iuwb_chip; + } +}; + +TEST_P(UwbAidl, GetChips) { + std::vector chip_names; + ScopedAStatus status = iuwb_->getChips(&chip_names); + EXPECT_TRUE(status.isOk()); + EXPECT_FALSE(chip_names.empty()); +} + +TEST_P(UwbAidl, GetChip) { + std::shared_ptr iuwb_chip; + ScopedAStatus status = iuwb_->getChip(getAnyChipName(), &iuwb_chip); + EXPECT_TRUE(status.isOk()); + EXPECT_NE(iuwb_chip, nullptr); +} + +TEST_P(UwbAidl, ChipOpen) { + std::promise open_cb_promise; + std::future open_cb_future{open_cb_promise.get_future()}; + std::shared_ptr callback = ndk::SharedRefBase::make( + [](auto /* data */) {}, + [&open_cb_promise](auto event, auto /* status */) { + if (event == UwbEvent::OPEN_CPLT) { + open_cb_promise.set_value(); + } + }); + std::chrono::milliseconds 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); +} + +TEST_P(UwbAidl, ChipClose) { + std::promise open_cb_promise; + std::future open_cb_future{open_cb_promise.get_future()}; + std::promise close_cb_promise; + std::future close_cb_future{close_cb_promise.get_future()}; + std::shared_ptr callback = ndk::SharedRefBase::make( + [](auto /* data */) {}, + [&open_cb_promise, &close_cb_promise](auto event, auto /* status */) { + if (event == UwbEvent::OPEN_CPLT) { + open_cb_promise.set_value(); + } + if (event == UwbEvent::CLOSE_CPLT) { + close_cb_promise.set_value(); + } + }); + std::chrono::milliseconds 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_TRUE(iuwb_chip->close().isOk()); + EXPECT_EQ(close_cb_future.wait_for(timeout), std::future_status::ready); +} + +TEST_P(UwbAidl, ChipCoreInit) { + const auto iuwb_chip = getAnyChipAndOpen(); + EXPECT_TRUE(iuwb_chip->coreInit().isOk()); +} + +TEST_P(UwbAidl, ChipGetSupportedVendorUciVersion) { + const auto iuwb_chip = getAnyChipAndOpen(); + EXPECT_TRUE(iuwb_chip->coreInit().isOk()); + + int version; + EXPECT_TRUE(iuwb_chip->getSupportedVendorUciVersion(&version).isOk()); + EXPECT_GT(version, 0); +} + +TEST_P(UwbAidl, ChipGetName) { + std::string chip_name = getAnyChipName(); + std::shared_ptr iuwb_chip; + ScopedAStatus status = iuwb_->getChip(chip_name, &iuwb_chip); + EXPECT_TRUE(status.isOk()); + EXPECT_NE(iuwb_chip, nullptr); + + std::string retrieved_chip_name; + status = iuwb_chip->getName(&retrieved_chip_name); + EXPECT_TRUE(status.isOk()); + EXPECT_EQ(retrieved_chip_name, chip_name); +} + +/** +TEST_P(UwbAidl, ChipSendUciMessage_GetDeviceInfo) { +const auto iuwb_chip = getAnyChipAndOpen(callback); +EXPECT_TRUE(iuwb_chip->coreInit(callback).isOk()); + +const std::vector +EXPECT_TRUE(iuwb_chip->sendUciMessage().isOk()); +} */ + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(UwbAidl); +INSTANTIATE_TEST_SUITE_P(Uwb, UwbAidl, + testing::ValuesIn(android::getAidlHalInstanceNames(IUwb::descriptor)), + android::PrintInstanceNameToString); + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + ProcessState::self()->setThreadPoolMaxThreadCount(1); + ProcessState::self()->startThreadPool(); + return RUN_ALL_TESTS(); +} -- GitLab From 379c33ca66f0570ec3004831dbcd441b4cdb928d Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 9 Sep 2021 18:13:07 -0700 Subject: [PATCH 147/825] Migrate VHAL default config to AIDL. Test: atest VehicleHalDefaultConfigTest Bug: 199337732 Change-Id: I9d96c82598427a597245d73a15c22eccff672250 --- automotive/vehicle/TEST_MAPPING | 7 +- .../aidl/impl/default_config/Android.bp | 31 + .../default_config/include/DefaultConfig.h | 1286 +++++++++++++++++ .../aidl/impl/default_config/test/Android.bp | 34 + .../default_config/test/DefaultConfigTest.cpp | 39 + 5 files changed, 1395 insertions(+), 2 deletions(-) create mode 100644 automotive/vehicle/aidl/impl/default_config/Android.bp create mode 100644 automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h create mode 100644 automotive/vehicle/aidl/impl/default_config/test/Android.bp create mode 100644 automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp diff --git a/automotive/vehicle/TEST_MAPPING b/automotive/vehicle/TEST_MAPPING index 15569f6f04..4820fd4b58 100644 --- a/automotive/vehicle/TEST_MAPPING +++ b/automotive/vehicle/TEST_MAPPING @@ -1,10 +1,13 @@ { "presubmit": [ { - "name": "VehicleHalVehicleUtilsTest" + "name": "VehicleHalAidlHidlCompatibilityTest" }, { - "name": "VehicleHalAidlHidlCompatibilityTest" + "name": "VehicleHalDefaultConfigTest" + }, + { + "name": "VehicleHalVehicleUtilsTest" } ] } diff --git a/automotive/vehicle/aidl/impl/default_config/Android.bp b/automotive/vehicle/aidl/impl/default_config/Android.bp new file mode 100644 index 0000000000..0feaf23a73 --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/Android.bp @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_library_headers { + name: "VehicleHalDefaultConfig", + vendor: true, + local_include_dirs: ["include"], + export_include_dirs: ["include"], + defaults: ["VehicleHalDefaults"], + static_libs: ["VehicleHalUtils"], + header_libs: ["VehicleHalTestUtilHeaders"], + export_static_lib_headers: ["VehicleHalUtils"], + export_header_lib_headers: ["VehicleHalTestUtilHeaders"], +} diff --git a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h new file mode 100644 index 0000000000..411075d93e --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h @@ -0,0 +1,1286 @@ +/* + * 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_aidl_impl_default_config_include_DefaultConfig_H_ +#define android_hardware_automotive_vehicle_aidl_impl_default_config_include_DefaultConfig_H_ + +#include +#include +#include + +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +// Types used in configs, not to be exposed as public API. +namespace defaultconfig_impl { + +using ::aidl::android::hardware::automotive::vehicle::EvConnectorType; +using ::aidl::android::hardware::automotive::vehicle::EvsServiceState; +using ::aidl::android::hardware::automotive::vehicle::EvsServiceType; +using ::aidl::android::hardware::automotive::vehicle::FuelType; +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::VehicleAreaWindow; +using ::aidl::android::hardware::automotive::vehicle::VehicleGear; +using ::aidl::android::hardware::automotive::vehicle::VehicleHvacFanDirection; +using ::aidl::android::hardware::automotive::vehicle::VehicleIgnitionState; +using ::aidl::android::hardware::automotive::vehicle::VehicleOilLevel; +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::VehicleSeatOccupancyState; +using ::aidl::android::hardware::automotive::vehicle::VehicleTurnSignal; +using ::aidl::android::hardware::automotive::vehicle::VehicleUnit; +using ::aidl::android::hardware::automotive::vehicle::VehicleVendorPermission; + +} // namespace defaultconfig_impl + +struct ConfigDeclaration { + defaultconfig_impl::VehiclePropConfig config; + + // This value will be used as an initial value for the property. If this field is specified for + // property that supports multiple areas then it will be used for all areas unless particular + // area is overridden in initialAreaValue field. + ::aidl::android::hardware::automotive::vehicle::RawPropValues initialValue; + // Use initialAreaValues if it is necessary to specify different values per each area. + std::map + initialAreaValues; +}; + +const ConfigDeclaration kVehicleProperties[]{ + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_FUEL_CAPACITY), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.floatValues = {15000.0f}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_FUEL_TYPE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.int32Values = {toInt( + defaultconfig_impl::FuelType::FUEL_TYPE_UNLEADED)}}}, + + {.config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::INFO_EV_BATTERY_CAPACITY), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.floatValues = {150000.0f}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_EV_CONNECTOR_TYPE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.int32Values = {toInt( + defaultconfig_impl::EvConnectorType::IEC_TYPE_1_AC)}}}, + + {.config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::INFO_FUEL_DOOR_LOCATION), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.int32Values = {FUEL_DOOR_REAR_LEFT}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_EV_PORT_LOCATION), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.int32Values = {CHARGE_PORT_FRONT_LEFT}}}, + + {.config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::INFO_MULTI_EV_PORT_LOCATIONS), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.int32Values = {CHARGE_PORT_FRONT_LEFT, CHARGE_PORT_REAR_LEFT}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_MAKE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.stringValue = "Toy Vehicle"}}, + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_MODEL), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.stringValue = "Speedy Model"}}, + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_MODEL_YEAR), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.int32Values = {2020}}}, + {.config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::INFO_EXTERIOR_DIMENSIONS), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.int32Values = {1776, 4950, 2008, 2140, 2984, 1665, 1667, 11800}}}, + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::PERF_VEHICLE_SPEED), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 1.0f, + .maxSampleRate = 10.0f, + }, + .initialValue = {.floatValues = {0.0f}}}, + + {.config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = + {toInt(defaultconfig_impl::VehicleUnit::METER_PER_SEC), + toInt(defaultconfig_impl::VehicleUnit::MILES_PER_HOUR), + toInt(defaultconfig_impl::VehicleUnit::KILOMETERS_PER_HOUR)}, + }, + .initialValue = {.int32Values = {toInt( + defaultconfig_impl::VehicleUnit::KILOMETERS_PER_HOUR)}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::SEAT_OCCUPANCY), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = + {defaultconfig_impl::VehicleAreaConfig{.areaId = (SEAT_1_LEFT)}, + defaultconfig_impl::VehicleAreaConfig{.areaId = (SEAT_1_RIGHT)}}, + }, + .initialAreaValues = + {{SEAT_1_LEFT, + {.int32Values = {toInt(defaultconfig_impl::VehicleSeatOccupancyState::VACANT)}}}, + {SEAT_1_RIGHT, + {.int32Values = {toInt( + defaultconfig_impl::VehicleSeatOccupancyState::VACANT)}}}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_DRIVER_SEAT), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + // this was a zoned property on an old vhal, but it is meant to be global + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = (0)}}, + }, + .initialValue = {.int32Values = {SEAT_1_LEFT}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::PERF_ODOMETER), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 1.0f, + .maxSampleRate = 10.0f, + }, + .initialValue = {.floatValues = {0.0f}}}, + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::PERF_STEERING_ANGLE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 1.0f, + .maxSampleRate = 10.0f, + }, + .initialValue = {.floatValues = {0.0f}}}, + {.config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::PERF_REAR_STEERING_ANGLE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 1.0f, + .maxSampleRate = 10.0f, + }, + .initialValue = {.floatValues = {0.0f}}}, + { + .config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::ENGINE_RPM), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 1.0f, + .maxSampleRate = 10.0f, + }, + .initialValue = {.floatValues = {0.0f}}, + }, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::FUEL_LEVEL), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 1.0f, + .maxSampleRate = 100.0f, + }, + .initialValue = {.floatValues = {15000.0f}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::FUEL_DOOR_OPEN), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::EV_BATTERY_LEVEL), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 1.0f, + .maxSampleRate = 100.0f, + }, + .initialValue = {.floatValues = {150000.0f}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::EV_CHARGE_PORT_OPEN), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0}}}, + + {.config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::EV_CHARGE_PORT_CONNECTED), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty:: + EV_BATTERY_INSTANTANEOUS_CHARGE_RATE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 1.0f, + .maxSampleRate = 10.0f, + }, + .initialValue = {.floatValues = {0.0f}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::RANGE_REMAINING), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 1.0f, + .maxSampleRate = 2.0f, + }, + .initialValue = {.floatValues = {50000.0f}}}, // units in meters + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::TIRE_PRESSURE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{ + .areaId = WHEEL_FRONT_LEFT, + .minFloatValue = 193.0f, + .maxFloatValue = 300.0f, + }, + defaultconfig_impl::VehicleAreaConfig{ + .areaId = WHEEL_FRONT_RIGHT, + .minFloatValue = 193.0f, + .maxFloatValue = 300.0f, + }, + defaultconfig_impl::VehicleAreaConfig{ + .areaId = WHEEL_REAR_LEFT, + .minFloatValue = 193.0f, + .maxFloatValue = 300.0f, + }, + defaultconfig_impl::VehicleAreaConfig{ + .areaId = WHEEL_REAR_RIGHT, + .minFloatValue = 193.0f, + .maxFloatValue = 300.0f, + }}, + .minSampleRate = 1.0f, + .maxSampleRate = 2.0f, + }, + .initialValue = {.floatValues = {200.0f}}}, // units in kPa + + {.config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + }, + .initialAreaValues = {{WHEEL_FRONT_LEFT, {.floatValues = {137.0f}}}, + {WHEEL_FRONT_RIGHT, {.floatValues = {137.0f}}}, + {WHEEL_REAR_RIGHT, {.floatValues = {137.0f}}}, + {WHEEL_REAR_LEFT, {.floatValues = {137.0f}}}}}, + + {.config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::TIRE_PRESSURE_DISPLAY_UNITS), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {toInt(defaultconfig_impl::VehicleUnit::KILOPASCAL), + toInt(defaultconfig_impl::VehicleUnit::PSI), + toInt(defaultconfig_impl::VehicleUnit::BAR)}, + }, + .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleUnit::PSI)}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::CURRENT_GEAR), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {toInt(defaultconfig_impl::VehicleGear::GEAR_PARK), + toInt(defaultconfig_impl::VehicleGear::GEAR_NEUTRAL), + toInt(defaultconfig_impl::VehicleGear::GEAR_REVERSE), + toInt(defaultconfig_impl::VehicleGear::GEAR_1), + toInt(defaultconfig_impl::VehicleGear::GEAR_2), + toInt(defaultconfig_impl::VehicleGear::GEAR_3), + toInt(defaultconfig_impl::VehicleGear::GEAR_4), + toInt(defaultconfig_impl::VehicleGear::GEAR_5)}, + }, + .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleGear::GEAR_PARK)}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::PARKING_BRAKE_ON), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {1}}}, + + {.config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::PARKING_BRAKE_AUTO_APPLY), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {1}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::FUEL_LEVEL_LOW), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::HW_KEY_INPUT), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0, 0, 0}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::HW_ROTARY_INPUT), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0, 0, 0}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::HW_CUSTOM_INPUT), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {0, 0, 0, 3, 0, 0, 0, 0, 0}, + }, + .initialValue = + { + .int32Values = {0, 0, 0}, + }}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_POWER_ON), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}, + // TODO(bryaneyler): Ideally, this is generated dynamically from + // kHvacPowerProperties. + .configArray = + {toInt(defaultconfig_impl::VehicleProperty::HVAC_FAN_SPEED), + toInt(defaultconfig_impl::VehicleProperty::HVAC_FAN_DIRECTION)}}, + .initialValue = {.int32Values = {1}}}, + + { + .config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_DEFROSTER), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = + {defaultconfig_impl::VehicleAreaConfig{ + .areaId = toInt(defaultconfig_impl::VehicleAreaWindow:: + FRONT_WINDSHIELD)}, + defaultconfig_impl::VehicleAreaConfig{ + .areaId = toInt(defaultconfig_impl::VehicleAreaWindow:: + REAR_WINDSHIELD)}}}, + .initialValue = {.int32Values = {0}} // Will be used for all areas. + }, + { + .config = {.prop = toInt( + defaultconfig_impl::VehicleProperty::HVAC_ELECTRIC_DEFROSTER_ON), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = + {defaultconfig_impl::VehicleAreaConfig{ + .areaId = toInt(defaultconfig_impl::VehicleAreaWindow:: + FRONT_WINDSHIELD)}, + defaultconfig_impl::VehicleAreaConfig{ + .areaId = toInt(defaultconfig_impl::VehicleAreaWindow:: + REAR_WINDSHIELD)}}}, + .initialValue = {.int32Values = {0}} // Will be used for all areas. + }, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_MAX_DEFROST_ON), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + .initialValue = {.int32Values = {0}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_RECIRC_ON), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + .initialValue = {.int32Values = {1}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_AUTO_RECIRC_ON), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + .initialValue = {.int32Values = {0}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_AC_ON), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + .initialValue = {.int32Values = {1}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_MAX_AC_ON), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + .initialValue = {.int32Values = {0}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_AUTO_ON), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + .initialValue = {.int32Values = {1}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_DUAL_ON), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + .initialValue = {.int32Values = {0}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_FAN_SPEED), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{ + .areaId = HVAC_ALL, .minInt32Value = 1, .maxInt32Value = 7}}}, + .initialValue = {.int32Values = {3}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_FAN_DIRECTION), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + .initialValue = {.int32Values = {toInt( + defaultconfig_impl::VehicleHvacFanDirection::FACE)}}}, + + {.config = {.prop = toInt( + defaultconfig_impl::VehicleProperty::HVAC_FAN_DIRECTION_AVAILABLE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + .initialValue = {.int32Values = {FAN_DIRECTION_FACE, FAN_DIRECTION_FLOOR, + FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR, + FAN_DIRECTION_DEFROST, + FAN_DIRECTION_FACE | FAN_DIRECTION_DEFROST, + FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST, + FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST | + FAN_DIRECTION_FACE}}}, + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_SEAT_VENTILATION), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{ + .areaId = SEAT_1_LEFT, + .minInt32Value = 0, + .maxInt32Value = 3, + }, + defaultconfig_impl::VehicleAreaConfig{ + .areaId = SEAT_1_RIGHT, + .minInt32Value = 0, + .maxInt32Value = 3, + }}}, + .initialValue = + {.int32Values = {0}}}, // 0 is off and +ve values indicate ventilation level. + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_STEERING_WHEEL_HEAT), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{ + .areaId = (0), .minInt32Value = -2, .maxInt32Value = 2}}}, + .initialValue = {.int32Values = {0}}}, // +ve values for heating and -ve for cooling + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_SEAT_TEMPERATURE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{ + .areaId = SEAT_1_LEFT, + .minInt32Value = -2, + .maxInt32Value = 2, + }, + defaultconfig_impl::VehicleAreaConfig{ + .areaId = SEAT_1_RIGHT, + .minInt32Value = -2, + .maxInt32Value = 2, + }}}, + .initialValue = {.int32Values = {0}}}, // +ve values for heating and -ve for cooling + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_TEMPERATURE_SET), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {160, 280, 5, 605, 825, 10}, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{ + .areaId = HVAC_LEFT, + .minFloatValue = 16, + .maxFloatValue = 32, + }, + defaultconfig_impl::VehicleAreaConfig{ + .areaId = HVAC_RIGHT, + .minFloatValue = 16, + .maxFloatValue = 32, + }}}, + .initialAreaValues = {{HVAC_LEFT, {.floatValues = {16}}}, + {HVAC_RIGHT, {.floatValues = {20}}}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty:: + HVAC_TEMPERATURE_VALUE_SUGGESTION), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.floatValues = {66.2f, (float)defaultconfig_impl::VehicleUnit::FAHRENHEIT, + 19.0f, 66.5f}}}, + + {.config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::ENV_OUTSIDE_TEMPERATURE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + // TODO(bryaneyler): Support ON_CHANGE as well. + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 1.0f, + .maxSampleRate = 2.0f, + }, + .initialValue = {.floatValues = {25.0f}}}, + + {.config = {.prop = toInt( + defaultconfig_impl::VehicleProperty::HVAC_TEMPERATURE_DISPLAY_UNITS), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {toInt(defaultconfig_impl::VehicleUnit::FAHRENHEIT), + toInt(defaultconfig_impl::VehicleUnit::CELSIUS)}}, + .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleUnit::FAHRENHEIT)}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::DISTANCE_DISPLAY_UNITS), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = (0)}}, + .configArray = {toInt(defaultconfig_impl::VehicleUnit::KILOMETER), + toInt(defaultconfig_impl::VehicleUnit::MILE)}, + }, + .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleUnit::MILE)}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::NIGHT_MODE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::GEAR_SELECTION), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {toInt(defaultconfig_impl::VehicleGear::GEAR_PARK), + toInt(defaultconfig_impl::VehicleGear::GEAR_NEUTRAL), + toInt(defaultconfig_impl::VehicleGear::GEAR_REVERSE), + toInt(defaultconfig_impl::VehicleGear::GEAR_DRIVE), + toInt(defaultconfig_impl::VehicleGear::GEAR_1), + toInt(defaultconfig_impl::VehicleGear::GEAR_2), + toInt(defaultconfig_impl::VehicleGear::GEAR_3), + toInt(defaultconfig_impl::VehicleGear::GEAR_4), + toInt(defaultconfig_impl::VehicleGear::GEAR_5)}, + }, + .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleGear::GEAR_PARK)}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::TURN_SIGNAL_STATE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleTurnSignal::NONE)}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::IGNITION_STATE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleIgnitionState::ON)}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::ENGINE_OIL_LEVEL), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleOilLevel::NORMAL)}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::ENGINE_OIL_TEMP), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 0.1, // 0.1 Hz, every 10 seconds + .maxSampleRate = 10, // 10 Hz, every 100 ms + }, + .initialValue = {.floatValues = {101.0f}}}, + + { + .config = {.prop = kMixedTypePropertyForTest, + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {1, 1, 0, 2, 0, 0, 1, 0, 0}}, + .initialValue = + { + .int32Values = {1 /* indicate TRUE boolean value */, 2, 3}, + .floatValues = {4.5f}, + .stringValue = "MIXED property", + }, + }, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::DOOR_LOCK), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_LEFT}, + defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_RIGHT}, + defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_LEFT}, + defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}}, + .initialAreaValues = {{DOOR_1_LEFT, {.int32Values = {1}}}, + {DOOR_1_RIGHT, {.int32Values = {1}}}, + {DOOR_2_LEFT, {.int32Values = {1}}}, + {DOOR_2_RIGHT, {.int32Values = {1}}}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::DOOR_POS), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = + {defaultconfig_impl::VehicleAreaConfig{ + .areaId = DOOR_1_LEFT, .minInt32Value = 0, .maxInt32Value = 1}, + defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_RIGHT, + .minInt32Value = 0, + .maxInt32Value = 1}, + defaultconfig_impl::VehicleAreaConfig{ + .areaId = DOOR_2_LEFT, .minInt32Value = 0, .maxInt32Value = 1}, + defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_RIGHT, + .minInt32Value = 0, + .maxInt32Value = 1}, + defaultconfig_impl::VehicleAreaConfig{ + .areaId = DOOR_REAR, .minInt32Value = 0, .maxInt32Value = 1}}}, + .initialValue = {.int32Values = {0}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::WINDOW_LOCK), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{ + .areaId = WINDOW_1_RIGHT | WINDOW_2_LEFT | WINDOW_2_RIGHT}}}, + .initialAreaValues = {{WINDOW_1_RIGHT | WINDOW_2_LEFT | WINDOW_2_RIGHT, + {.int32Values = {0}}}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::WINDOW_POS), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = WINDOW_1_LEFT, + .minInt32Value = 0, + .maxInt32Value = 10}, + defaultconfig_impl::VehicleAreaConfig{.areaId = WINDOW_1_RIGHT, + .minInt32Value = 0, + .maxInt32Value = 10}, + defaultconfig_impl::VehicleAreaConfig{.areaId = WINDOW_2_LEFT, + .minInt32Value = 0, + .maxInt32Value = 10}, + defaultconfig_impl::VehicleAreaConfig{.areaId = WINDOW_2_RIGHT, + .minInt32Value = 0, + .maxInt32Value = 10}, + defaultconfig_impl::VehicleAreaConfig{ + .areaId = WINDOW_ROOF_TOP_1, + .minInt32Value = -10, + .maxInt32Value = 10}}}, + .initialValue = {.int32Values = {0}}}, + + {.config = + { + .prop = WHEEL_TICK, + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .configArray = {ALL_WHEELS, 50000, 50000, 50000, 50000}, + .minSampleRate = 1.0f, + .maxSampleRate = 10.0f, + }, + .initialValue = {.int64Values = {0, 100000, 200000, 300000, 400000}}}, + + {.config = {.prop = ABS_ACTIVE, + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}, + .initialValue = {.int32Values = {0}}}, + + {.config = {.prop = TRACTION_CONTROL_ACTIVE, + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}, + .initialValue = {.int32Values = {0}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::AP_POWER_STATE_REQ), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {3}}, + .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleApPowerStateReq::ON), + 0}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::AP_POWER_STATE_REPORT), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}, + .initialValue = + {.int32Values = + {toInt(defaultconfig_impl::VehicleApPowerStateReport::WAIT_FOR_VHAL), + 0}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::DISPLAY_BRIGHTNESS), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.minInt32Value = 0, + .maxInt32Value = 100}}}, + .initialValue = {.int32Values = {100}}}, + + { + .config = {.prop = OBD2_LIVE_FRAME, + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {0, 0}}, + }, + + { + .config = {.prop = OBD2_FREEZE_FRAME, + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {0, 0}}, + }, + + { + .config = {.prop = OBD2_FREEZE_FRAME_INFO, + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}, + }, + + { + .config = {.prop = OBD2_FREEZE_FRAME_CLEAR, + .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {1}}, + }, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::HEADLIGHTS_STATE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::HIGH_BEAM_LIGHTS_STATE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::FOG_LIGHTS_STATE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::HAZARD_LIGHTS_STATE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::HEADLIGHTS_SWITCH), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, + + {.config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::HIGH_BEAM_LIGHTS_SWITCH), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::FOG_LIGHTS_SWITCH), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::HAZARD_LIGHTS_SWITCH), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::EVS_SERVICE_REQUEST), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {toInt(defaultconfig_impl::EvsServiceType::REARVIEW), + toInt(defaultconfig_impl::EvsServiceState::OFF)}}}, + + {.config = {.prop = VEHICLE_MAP_SERVICE, + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}}, + + // Example Vendor Extension properties for testing + {.config = {.prop = VENDOR_EXTENSION_BOOLEAN_PROPERTY, + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_LEFT}, + defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_RIGHT}, + defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_LEFT}, + defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}}, + .initialAreaValues = {{DOOR_1_LEFT, {.int32Values = {1}}}, + {DOOR_1_RIGHT, {.int32Values = {1}}}, + {DOOR_2_LEFT, {.int32Values = {0}}}, + {DOOR_2_RIGHT, {.int32Values = {0}}}}}, + + {.config = {.prop = VENDOR_EXTENSION_FLOAT_PROPERTY, + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_LEFT, + .minFloatValue = -10, + .maxFloatValue = 10}, + defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_RIGHT, + .minFloatValue = -10, + .maxFloatValue = 10}}}, + .initialAreaValues = {{HVAC_LEFT, {.floatValues = {1}}}, + {HVAC_RIGHT, {.floatValues = {2}}}}}, + + {.config = {.prop = VENDOR_EXTENSION_INT_PROPERTY, + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = + {defaultconfig_impl::VehicleAreaConfig{ + .areaId = toInt(defaultconfig_impl::VehicleAreaWindow:: + FRONT_WINDSHIELD), + .minInt32Value = -100, + .maxInt32Value = 100}, + defaultconfig_impl::VehicleAreaConfig{ + .areaId = toInt(defaultconfig_impl::VehicleAreaWindow:: + REAR_WINDSHIELD), + .minInt32Value = -100, + .maxInt32Value = 100}, + defaultconfig_impl::VehicleAreaConfig{ + .areaId = toInt( + defaultconfig_impl::VehicleAreaWindow::ROOF_TOP_1), + .minInt32Value = -100, + .maxInt32Value = 100}}}, + .initialAreaValues = {{toInt(defaultconfig_impl::VehicleAreaWindow::FRONT_WINDSHIELD), + {.int32Values = {1}}}, + {toInt(defaultconfig_impl::VehicleAreaWindow::REAR_WINDSHIELD), + {.int32Values = {0}}}, + {toInt(defaultconfig_impl::VehicleAreaWindow::ROOF_TOP_1), + {.int32Values = {-1}}}}}, + + {.config = {.prop = VENDOR_EXTENSION_STRING_PROPERTY, + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}, + .initialValue = {.stringValue = "Vendor String Property"}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty:: + ELECTRONIC_TOLL_COLLECTION_CARD_TYPE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}, + .initialValue = {.int32Values = {0}}}, + + {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty:: + ELECTRONIC_TOLL_COLLECTION_CARD_STATUS), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}, + .initialValue = {.int32Values = {0}}}, + + {.config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty:: + SUPPORT_CUSTOMIZE_VENDOR_PERMISSION), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = + {kMixedTypePropertyForTest, + toInt(defaultconfig_impl:: + VehicleVendorPermission:: + PERMISSION_GET_VENDOR_CATEGORY_INFO), + toInt(defaultconfig_impl:: + VehicleVendorPermission:: + PERMISSION_SET_VENDOR_CATEGORY_INFO), + VENDOR_EXTENSION_INT_PROPERTY, + toInt(defaultconfig_impl:: + VehicleVendorPermission:: + PERMISSION_GET_VENDOR_CATEGORY_SEAT), + toInt(defaultconfig_impl:: + VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE), + VENDOR_EXTENSION_FLOAT_PROPERTY, + toInt(defaultconfig_impl:: + VehicleVendorPermission::PERMISSION_DEFAULT), + toInt(defaultconfig_impl:: + VehicleVendorPermission::PERMISSION_DEFAULT)}, + }, + .initialValue = {.int32Values = {1}}}, + + { + .config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::INITIAL_USER_INFO), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::SWITCH_USER), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::CREATE_USER), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::REMOVE_USER), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty:: + USER_IDENTIFICATION_ASSOCIATION), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::POWER_POLICY_REQ), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty:: + POWER_POLICY_GROUP_REQ), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::CURRENT_POWER_POLICY), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::EPOCH_TIME), + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::WATCHDOG_ALIVE), + .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty:: + WATCHDOG_TERMINATED_PROCESS), + .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty::VHAL_HEARTBEAT), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::CLUSTER_SWITCH_UI), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0 /* ClusterHome */, -1 /* ClusterNone */}}, + }, + { + .config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::CLUSTER_DISPLAY_STATE), + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1, + -1, -1 /* Insets */}}, + }, + { + .config = + { + .prop = toInt( + defaultconfig_impl::VehicleProperty::CLUSTER_REPORT_STATE), + .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {0, 0, 0, 11, 0, 0, 0, 0, 16}, + }, + }, + { + .config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty:: + CLUSTER_REQUEST_DISPLAY), + .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt(defaultconfig_impl::VehicleProperty:: + CLUSTER_NAVIGATION_STATE), + .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = PLACEHOLDER_PROPERTY_INT, + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0}}, + }, + { + .config = + { + .prop = PLACEHOLDER_PROPERTY_FLOAT, + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.floatValues = {0.0f}}, + }, + { + .config = + { + .prop = PLACEHOLDER_PROPERTY_BOOLEAN, + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0 /* false */}}, + }, + { + .config = + { + .prop = PLACEHOLDER_PROPERTY_STRING, + .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.stringValue = {"Test"}}, + }, +#ifdef ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING + // Vendor propetry for E2E ClusterHomeService testing. + { + .config = + { + .prop = VENDOR_CLUSTER_SWITCH_UI, + .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = VENDOR_CLUSTER_DISPLAY_STATE, + .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = VENDOR_CLUSTER_REPORT_STATE, + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {0, 0, 0, 11, 0, 0, 0, 0, 16}, + }, + .initialValue = {.int32Values = {0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1, + -1, -1 /* Insets */, 0 /* ClusterHome */, + -1 /* ClusterNone */}}, + }, + { + .config = + { + .prop = VENDOR_CLUSTER_REQUEST_DISPLAY, + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0 /* ClusterHome */}}, + }, + { + .config = + { + .prop = VENDOR_CLUSTER_NAVIGATION_STATE, + .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .changeMode = + defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + }, + }, +#endif // ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_aidl_impl_default_config_include_DefaultConfig_H_ diff --git a/automotive/vehicle/aidl/impl/default_config/test/Android.bp b/automotive/vehicle/aidl/impl/default_config/test/Android.bp new file mode 100644 index 0000000000..7ea4ca7f51 --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/test/Android.bp @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_test { + name: "VehicleHalDefaultConfigTest", + vendor: true, + defaults: ["VehicleHalDefaults"], + srcs: ["*.cpp"], + static_libs: [ + "VehicleHalUtils", + "libgtest", + ], + header_libs: [ + "VehicleHalDefaultConfig", + ], + test_suites: ["general-tests"], +} diff --git a/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp b/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp new file mode 100644 index 0000000000..6385ac1472 --- /dev/null +++ b/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp @@ -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. + */ + +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +namespace test { + +TEST(DefaultConfigTest, loadDefaultConfigs) { + for (ConfigDeclaration config : kVehicleProperties) { + ASSERT_NE(0, config.config.prop); + } +} + +} // namespace test + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android -- GitLab From fd549c90db80f5b82fb4d4f7691b549b49f16389 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Sat, 4 Sep 2021 21:58:20 -0700 Subject: [PATCH 148/825] Add composer3 AIDL This is the initial AIDL interface based on the HIDL interface android.hardware.graphics.composer@2.4. Test: Build Bug: 198690211 Change-Id: I385ea8084f9a33c2b6dd79bb9a376692fec4a399 --- .../compatibility_matrix.current.xml | 8 + graphics/common/aidl/Android.bp | 2 +- .../hardware/graphics/common/BlendMode.aidl | 28 +- .../hardware/graphics/common/BufferUsage.aidl | 28 +- .../graphics/common/ChromaSiting.aidl | 28 +- .../graphics/common/ColorTransform.aidl | 44 + .../hardware/graphics/common/Compression.aidl | 28 +- .../hardware/graphics/common/Cta861_3.aidl | 28 +- .../hardware/graphics/common/Dataspace.aidl | 28 +- .../graphics/common/ExtendableType.aidl | 28 +- .../hardware/graphics/common/FRect.aidl | 41 + .../graphics/common/HardwareBuffer.aidl | 28 +- .../common/HardwareBufferDescription.aidl | 28 +- .../android/hardware/graphics/common/Hdr.aidl | 41 + .../hardware/graphics/common/Interlaced.aidl | 28 +- .../hardware/graphics/common/PixelFormat.aidl | 28 +- .../hardware/graphics/common/PlaneLayout.aidl | 28 +- .../graphics/common/PlaneLayoutComponent.aidl | 28 +- .../common/PlaneLayoutComponentType.aidl | 28 +- .../hardware/graphics/common/Rect.aidl | 28 +- .../hardware/graphics/common/Smpte2086.aidl | 28 +- .../graphics/common/StandardMetadataType.aidl | 28 +- .../hardware/graphics/common/Transform.aidl | 42 + .../hardware/graphics/common/XyColor.aidl | 28 +- .../graphics/common/ColorTransform.aidl | 49 ++ .../hardware/graphics/common/FRect.aidl | 28 + .../android/hardware/graphics/common/Hdr.aidl | 41 + .../hardware/graphics/common/Transform.aidl | 45 + graphics/composer/aidl/Android.bp | 60 ++ .../graphics/composer3/BlendMode.aidl | 41 + .../graphics/composer3/Capability.aidl | 41 + .../composer3/ClientTargetProperty.aidl | 39 + .../hardware/graphics/composer3/Color.aidl | 41 + .../graphics/composer3/ColorMode.aidl | 51 ++ .../hardware/graphics/composer3/Command.aidl | 75 ++ .../graphics/composer3/Composition.aidl | 43 + .../graphics/composer3/ContentType.aidl | 42 + .../graphics/composer3/DisplayAttribute.aidl | 44 + .../graphics/composer3/DisplayCapability.aidl | 43 + .../composer3/DisplayConnectionType.aidl | 39 + .../composer3/DisplayContentSample.aidl | 42 + .../DisplayContentSamplingAttributes.aidl | 40 + .../composer3/DisplayIdentification.aidl | 39 + .../graphics/composer3/DisplayRequest.aidl | 39 + .../composer3/ExecuteCommandsStatus.aidl | 40 + .../graphics/composer3/FloatColor.aidl | 41 + .../composer3/FormatColorComponent.aidl | 41 + .../graphics/composer3/HandleIndex.aidl | 39 + .../graphics/composer3/HdrCapabilities.aidl | 41 + .../graphics/composer3/IComposer.aidl | 41 + .../graphics/composer3/IComposerCallback.aidl | 42 + .../graphics/composer3/IComposerClient.aidl | 89 ++ .../composer3/LayerGenericMetadataKey.aidl | 39 + .../graphics/composer3/LayerRequest.aidl | 38 + .../graphics/composer3/PerFrameMetadata.aidl | 39 + .../composer3/PerFrameMetadataBlob.aidl | 39 + .../composer3/PerFrameMetadataKey.aidl | 50 ++ .../graphics/composer3/PowerMode.aidl | 42 + .../composer3/ReadbackBufferAttributes.aidl | 39 + .../graphics/composer3/RenderIntent.aidl | 41 + .../graphics/composer3/VirtualDisplay.aidl | 39 + .../VsyncPeriodChangeConstraints.aidl | 39 + .../composer3/VsyncPeriodChangeTimeline.aidl | 40 + .../graphics/composer3/BlendMode.aidl | 38 + .../graphics/composer3/Capability.aidl | 49 ++ .../composer3/ClientTargetProperty.aidl | 23 + .../hardware/graphics/composer3/Color.aidl | 25 + .../graphics/composer3/ColorMode.aidl | 283 ++++++ .../hardware/graphics/composer3/Command.aidl | 741 ++++++++++++++++ .../graphics/composer3/Composition.aidl | 76 ++ .../graphics/composer3/ContentType.aidl | 30 + .../graphics/composer3/DisplayAttribute.aidl | 56 ++ .../graphics/composer3/DisplayCapability.aidl | 69 ++ .../composer3/DisplayConnectionType.aidl | 30 + .../composer3/DisplayContentSample.aidl | 49 ++ .../DisplayContentSamplingAttributes.aidl | 38 + .../composer3/DisplayIdentification.aidl | 32 + .../graphics/composer3/DisplayRequest.aidl | 37 + .../composer3/ExecuteCommandsStatus.aidl | 36 + .../graphics/composer3/FloatColor.aidl | 29 + .../composer3/FormatColorComponent.aidl | 38 + .../graphics/composer3/HandleIndex.aidl | 33 + .../graphics/composer3/HdrCapabilities.aidl | 36 + .../graphics/composer3/IComposer.aidl | 54 ++ .../graphics/composer3/IComposerCallback.aidl | 89 ++ .../graphics/composer3/IComposerClient.aidl | 821 ++++++++++++++++++ .../composer3/LayerGenericMetadataKey.aidl | 31 + .../graphics/composer3/LayerRequest.aidl | 31 + .../graphics/composer3/PerFrameMetadata.aidl | 32 + .../composer3/PerFrameMetadataBlob.aidl | 33 + .../composer3/PerFrameMetadataKey.aidl | 92 ++ .../graphics/composer3/PowerMode.aidl | 68 ++ .../composer3/ReadbackBufferAttributes.aidl | 23 + .../graphics/composer3/RenderIntent.aidl | 68 ++ .../graphics/composer3/VirtualDisplay.aidl | 32 + .../VsyncPeriodChangeConstraints.aidl | 34 + .../composer3/VsyncPeriodChangeTimeline.aidl | 39 + .../graphics/composer3/translate-ndk.cpp | 612 +++++++++++++ .../graphics/composer3/translate-ndk.h | 90 ++ graphics/mapper/4.0/vts/functional/Android.bp | 2 +- neuralnetworks/aidl/Android.bp | 2 +- neuralnetworks/aidl/utils/Android.bp | 4 +- neuralnetworks/aidl/vts/functional/Android.bp | 2 +- 103 files changed, 6176 insertions(+), 114 deletions(-) create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ColorTransform.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/FRect.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl create mode 100644 graphics/common/aidl/android/hardware/graphics/common/ColorTransform.aidl create mode 100644 graphics/common/aidl/android/hardware/graphics/common/FRect.aidl create mode 100644 graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl create mode 100644 graphics/common/aidl/android/hardware/graphics/common/Transform.aidl create mode 100644 graphics/composer/aidl/Android.bp create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BlendMode.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetProperty.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Color.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorMode.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ContentType.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayAttribute.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConnectionType.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayContentSample.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayIdentification.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FloatColor.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FormatColorComponent.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HandleIndex.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HdrCapabilities.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposer.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerCallback.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadata.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataBlob.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PowerMode.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReadbackBufferAttributes.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RenderIntent.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VirtualDisplay.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetProperty.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/Color.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/ColorMode.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/ContentType.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/DisplayAttribute.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConnectionType.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/DisplayContentSample.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/DisplayIdentification.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/FloatColor.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/FormatColorComponent.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/HdrCapabilities.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/LayerRequest.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadata.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/PowerMode.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/ReadbackBufferAttributes.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/RenderIntent.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/VirtualDisplay.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp create mode 100644 graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index f03008a4e4..331eb5fb9f 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -271,6 +271,14 @@ default + + android.hardware.graphics.composer3 + 1 + + IComposer + default + + android.hardware.graphics.mapper diff --git a/graphics/common/aidl/Android.bp b/graphics/common/aidl/Android.bp index b23d4a7caf..69ee49897a 100644 --- a/graphics/common/aidl/Android.bp +++ b/graphics/common/aidl/Android.bp @@ -15,7 +15,7 @@ aidl_interface { enabled: true, support_system_process: true, }, - vndk_use_version: "2", + vndk_use_version: "3", srcs: [ "android/hardware/graphics/common/*.aidl", ], diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BlendMode.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BlendMode.aidl index deafdfad90..1c1938105e 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BlendMode.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BlendMode.aidl @@ -1,14 +1,30 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 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 58eefc4e2c..b4ef4515c7 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 @@ -1,14 +1,30 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 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 7ca4dfa531..7f0d73460a 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 @@ -1,14 +1,30 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ColorTransform.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ColorTransform.aidl new file mode 100644 index 0000000000..255a42f61e --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ColorTransform.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 -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 ColorTransform { + IDENTITY = 0, + ARBITRARY_MATRIX = 1, + VALUE_INVERSE = 2, + GRAYSCALE = 3, + CORRECT_PROTANOPIA = 4, + CORRECT_DEUTERANOPIA = 5, + CORRECT_TRITANOPIA = 6, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Compression.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Compression.aidl index 06e40a0852..5b76376a2e 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Compression.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Compression.aidl @@ -1,14 +1,30 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Cta861_3.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Cta861_3.aidl index d4af501904..fbe4b2a4d2 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Cta861_3.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Cta861_3.aidl @@ -1,14 +1,30 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 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 43d7f84d2d..3d97cff0d2 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 @@ -1,14 +1,30 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ExtendableType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ExtendableType.aidl index 6fcb794efd..3ada312a5c 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ExtendableType.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ExtendableType.aidl @@ -1,14 +1,30 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/FRect.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/FRect.aidl new file mode 100644 index 0000000000..cb8190b424 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/FRect.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 -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; +@VintfStability +parcelable FRect { + float left; + float top; + float right; + float bottom; +} 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 72222e118d..4d8f78d77c 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 @@ -1,14 +1,30 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBufferDescription.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBufferDescription.aidl index 232e0231f1..495504931d 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBufferDescription.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBufferDescription.aidl @@ -1,14 +1,30 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl new file mode 100644 index 0000000000..0320a66f56 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.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 -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 Hdr { + DOLBY_VISION = 1, + HDR10 = 2, + HLG = 3, + HDR10_PLUS = 4, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Interlaced.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Interlaced.aidl index 26674c9b1d..30b4e03c45 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Interlaced.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Interlaced.aidl @@ -1,14 +1,30 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 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 e5f04700ed..04a863be0a 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 @@ -1,14 +1,30 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayout.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayout.aidl index 8bca42feb1..75fac9f3db 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayout.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayout.aidl @@ -1,14 +1,30 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponent.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponent.aidl index f5a649cac9..20c0a0bb01 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponent.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponent.aidl @@ -1,14 +1,30 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 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 7ff8d76520..2f7d414aac 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 @@ -1,14 +1,30 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Rect.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Rect.aidl index e0ba69bcd0..eb42027f16 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Rect.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Rect.aidl @@ -1,14 +1,30 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Smpte2086.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Smpte2086.aidl index 5da36f68c0..2be31d8e99 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Smpte2086.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Smpte2086.aidl @@ -1,14 +1,30 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl index 34b53a2bba..20273501b9 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl @@ -1,14 +1,30 @@ +/** + * Copyright (c) 2019,libgralloctypes_helper The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 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 new file mode 100644 index 0000000000..5c3d4cb16f --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.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 -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 Transform { + FLIP_H = 1, + FLIP_V = 2, + ROT_90 = 4, + ROT_180 = 3, + ROT_270 = 7, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/XyColor.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/XyColor.aidl index d96d0ac130..b42de183dd 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/XyColor.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/XyColor.aidl @@ -1,14 +1,30 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/graphics/common/aidl/android/hardware/graphics/common/ColorTransform.aidl b/graphics/common/aidl/android/hardware/graphics/common/ColorTransform.aidl new file mode 100644 index 0000000000..a8784f5ee9 --- /dev/null +++ b/graphics/common/aidl/android/hardware/graphics/common/ColorTransform.aidl @@ -0,0 +1,49 @@ +/** + * 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. + */ + +package android.hardware.graphics.common; + +/** + * Color transforms that may be applied by hardware composer to the whole + * display. + */ +@VintfStability +@Backing(type="int") +enum ColorTransform { + /** Applies no transform to the output color */ + IDENTITY = 0, + + /** Applies an arbitrary transform defined by a 4x4 affine matrix */ + ARBITRARY_MATRIX = 1, + + /** + * Applies a transform that inverts the value or luminance of the color, but + * does not modify hue or saturation + */ + VALUE_INVERSE = 2, + + /** Applies a transform that maps all colors to shades of gray */ + GRAYSCALE = 3, + + /** Applies a transform which corrects for protanopic color blindness */ + CORRECT_PROTANOPIA = 4, + + /** Applies a transform which corrects for deuteranopic color blindness */ + CORRECT_DEUTERANOPIA = 5, + + /** Applies a transform which corrects for tritanopic color blindness */ + CORRECT_TRITANOPIA = 6 +} diff --git a/graphics/common/aidl/android/hardware/graphics/common/FRect.aidl b/graphics/common/aidl/android/hardware/graphics/common/FRect.aidl new file mode 100644 index 0000000000..f9f2b6003c --- /dev/null +++ b/graphics/common/aidl/android/hardware/graphics/common/FRect.aidl @@ -0,0 +1,28 @@ +/** + * 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. + */ + +package android.hardware.graphics.common; +/** + * General purpose definition of a rectangle with floating point corners. + */ + +@VintfStability +parcelable FRect { + float left; + float top; + float right; + float bottom; +} diff --git a/graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl b/graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl new file mode 100644 index 0000000000..f6d02ddf9f --- /dev/null +++ b/graphics/common/aidl/android/hardware/graphics/common/Hdr.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. + */ + +package android.hardware.graphics.common; + +/** + * Supported HDR formats. Must be kept in sync with equivalents in Display.java. + */ +@VintfStability +@Backing(type="int") +enum Hdr { + /** + * Device supports Dolby Vision HDR + */ + DOLBY_VISION = 1, + /** + * Device supports HDR10 + */ + HDR10 = 2, + /** + * Device supports hybrid log-gamma HDR + */ + HLG = 3, + /** + * Device supports HDR10+ + */ + HDR10_PLUS = 4, +} diff --git a/graphics/common/aidl/android/hardware/graphics/common/Transform.aidl b/graphics/common/aidl/android/hardware/graphics/common/Transform.aidl new file mode 100644 index 0000000000..325816c98a --- /dev/null +++ b/graphics/common/aidl/android/hardware/graphics/common/Transform.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. + */ + +package android.hardware.graphics.common; + +/** + * Transformation definitions + */ +@VintfStability +@Backing(type="int") +enum Transform { + /** + * Horizontal flip. FLIP_H/FLIP_V is applied before ROT_90. + */ + FLIP_H = 1 << 0, + + /** + * Vertical flip. FLIP_H/FLIP_V is applied before ROT_90. + */ + FLIP_V = 1 << 1, + + /** + * 90 degree clockwise rotation. FLIP_H/FLIP_V is applied before ROT_90. + */ + ROT_90 = 1 << 2, + + /** + * Commonly used combinations. + */ + ROT_180 = FLIP_H | FLIP_V, + ROT_270 = FLIP_H | FLIP_V | ROT_90, +} diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp new file mode 100644 index 0000000000..0065692826 --- /dev/null +++ b/graphics/composer/aidl/Android.bp @@ -0,0 +1,60 @@ +/** + * 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. + */ + +aidl_interface { + name: "android.hardware.graphics.composer3", + host_supported: true, + vendor_available: true, + vndk: { + enabled: true, + support_system_process: true, + }, + srcs: ["android/hardware/graphics/composer3/*.aidl"], + stability: "vintf", + imports: [ + "android.hardware.graphics.common-V3", + "android.hardware.common-V2", + "android.hardware.common.fmq-V1", + ], + backend: { + cpp: { + enabled: false, + }, + java: { + sdk_version: "module_current", + enabled: false, + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, +} + +cc_library { + name: "android.hardware.graphics.composer3-translate-ndk", + vendor_available: true, + srcs: ["android/hardware/graphics/composer3/translate-ndk.cpp"], + shared_libs: [ + "libbinder_ndk", + "libhidlbase", + "android.hardware.graphics.composer3-V1-ndk", + "android.hardware.graphics.composer@2.1", + "android.hardware.graphics.composer@2.4", + ], + export_include_dirs: ["include"], +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BlendMode.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BlendMode.aidl new file mode 100644 index 0000000000..a522d53e65 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BlendMode.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 -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 BlendMode { + INVALID = 0, + NONE = 1, + PREMULTIPLIED = 2, + COVERAGE = 3, +} 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 new file mode 100644 index 0000000000..557b3f8b77 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.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 -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 Capability { + INVALID = 0, + SIDEBAND_STREAM = 1, + SKIP_CLIENT_COLOR_TRANSFORM = 2, + PRESENT_FENCE_IS_NOT_RELIABLE = 3, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetProperty.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetProperty.aidl new file mode 100644 index 0000000000..d34d1b0ab8 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetProperty.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 -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 ClientTargetProperty { + android.hardware.graphics.common.PixelFormat pixelFormat; + android.hardware.graphics.common.Dataspace dataspace; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Color.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Color.aidl new file mode 100644 index 0000000000..7733debc9e --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Color.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 -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 Color { + byte r; + byte g; + byte b; + byte a; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorMode.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorMode.aidl new file mode 100644 index 0000000000..53852b6270 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorMode.aidl @@ -0,0 +1,51 @@ +/** + * 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 -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 ColorMode { + NATIVE = 0, + STANDARD_BT601_625 = 1, + STANDARD_BT601_625_UNADJUSTED = 2, + STANDARD_BT601_525 = 3, + STANDARD_BT601_525_UNADJUSTED = 4, + STANDARD_BT709 = 5, + DCI_P3 = 6, + SRGB = 7, + ADOBE_RGB = 8, + DISPLAY_P3 = 9, + BT2020 = 10, + BT2100_PQ = 11, + BT2100_HLG = 12, + DISPLAY_BT2020 = 13, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl new file mode 100644 index 0000000000..3b31149636 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl @@ -0,0 +1,75 @@ +/** + * 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 -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 Command { + LENGTH_MASK = 65535, + OPCODE_SHIFT = 16, + OPCODE_MASK = -65536, + SELECT_DISPLAY = 0, + SELECT_LAYER = 65536, + SET_ERROR = 16777216, + SET_CHANGED_COMPOSITION_TYPES = 16842752, + SET_DISPLAY_REQUESTS = 16908288, + SET_PRESENT_FENCE = 16973824, + SET_RELEASE_FENCES = 17039360, + SET_COLOR_TRANSFORM = 33554432, + SET_CLIENT_TARGET = 33619968, + SET_OUTPUT_BUFFER = 33685504, + VALIDATE_DISPLAY = 33751040, + ACCEPT_DISPLAY_CHANGES = 33816576, + PRESENT_DISPLAY = 33882112, + PRESENT_OR_VALIDATE_DISPLAY = 33947648, + SET_LAYER_CURSOR_POSITION = 50331648, + SET_LAYER_BUFFER = 50397184, + SET_LAYER_SURFACE_DAMAGE = 50462720, + SET_LAYER_BLEND_MODE = 67108864, + SET_LAYER_COLOR = 67174400, + SET_LAYER_COMPOSITION_TYPE = 67239936, + SET_LAYER_DATASPACE = 67305472, + SET_LAYER_DISPLAY_FRAME = 67371008, + SET_LAYER_PLANE_ALPHA = 67436544, + SET_LAYER_SIDEBAND_STREAM = 67502080, + SET_LAYER_SOURCE_CROP = 67567616, + SET_LAYER_TRANSFORM = 67633152, + SET_LAYER_VISIBLE_REGION = 67698688, + SET_LAYER_Z_ORDER = 67764224, + SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT = 67829760, + SET_LAYER_PER_FRAME_METADATA = 50528256, + SET_LAYER_FLOAT_COLOR = 67895296, + SET_LAYER_COLOR_TRANSFORM = 67960832, + SET_LAYER_PER_FRAME_METADATA_BLOBS = 50593792, + SET_CLIENT_TARGET_PROPERTY = 17104896, + SET_LAYER_GENERIC_METADATA = 68026368, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl new file mode 100644 index 0000000000..e327e8722c --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.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 -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 Composition { + INVALID = 0, + CLIENT = 1, + DEVICE = 2, + SOLID_COLOR = 3, + CURSOR = 4, + SIDEBAND = 5, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ContentType.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ContentType.aidl new file mode 100644 index 0000000000..d87b7670dd --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ContentType.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 -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 ContentType { + NONE = 0, + GRAPHICS = 1, + PHOTO = 2, + CINEMA = 3, + GAME = 4, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayAttribute.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayAttribute.aidl new file mode 100644 index 0000000000..8454c40dbe --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayAttribute.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 -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 DisplayAttribute { + INVALID = 0, + WIDTH = 1, + HEIGHT = 2, + VSYNC_PERIOD = 3, + DPI_X = 4, + DPI_Y = 5, + CONFIG_GROUP = 7, +} 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 new file mode 100644 index 0000000000..0bcd8707e9 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.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 -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 DisplayCapability { + INVALID = 0, + SKIP_CLIENT_COLOR_TRANSFORM = 1, + DOZE = 2, + BRIGHTNESS = 3, + PROTECTED_CONTENTS = 4, + AUTO_LOW_LATENCY_MODE = 5, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConnectionType.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConnectionType.aidl new file mode 100644 index 0000000000..640f82a0cd --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConnectionType.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 -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 DisplayConnectionType { + INTERNAL = 0, + EXTERNAL = 1, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayContentSample.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayContentSample.aidl new file mode 100644 index 0000000000..c62453634f --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayContentSample.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 -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 DisplayContentSample { + long frameCount; + long[] sampleComponent0; + long[] sampleComponent1; + long[] sampleComponent2; + long[] sampleComponent3; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.aidl new file mode 100644 index 0000000000..7c6542f527 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.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 -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 DisplayContentSamplingAttributes { + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.Dataspace dataspace; + android.hardware.graphics.composer3.FormatColorComponent componentMask; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayIdentification.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayIdentification.aidl new file mode 100644 index 0000000000..a0cc9b097b --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayIdentification.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 -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 DisplayIdentification { + byte port; + byte[] data; +} 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 new file mode 100644 index 0000000000..26e7d97727 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.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 -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 DisplayRequest { + FLIP_CLIENT_TARGET = 1, + WRITE_CLIENT_TARGET_TO_OUTPUT = 2, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl new file mode 100644 index 0000000000..41a1afeef2 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.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 -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 ExecuteCommandsStatus { + boolean queueChanged; + int length; + android.hardware.common.NativeHandle[] handles; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FloatColor.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FloatColor.aidl new file mode 100644 index 0000000000..faadf575d1 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FloatColor.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 -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 FloatColor { + float r; + float g; + float b; + float a; +} 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 new file mode 100644 index 0000000000..4b737de0c8 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FormatColorComponent.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 -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="byte") @VintfStability +enum FormatColorComponent { + FORMAT_COMPONENT_0 = 1, + FORMAT_COMPONENT_1 = 2, + FORMAT_COMPONENT_2 = 4, + FORMAT_COMPONENT_3 = 8, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HandleIndex.aidl new file mode 100644 index 0000000000..b87870d648 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HandleIndex.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 -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 HandleIndex { + EMPTY = -1, + CACHED = -2, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HdrCapabilities.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HdrCapabilities.aidl new file mode 100644 index 0000000000..80141d3543 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HdrCapabilities.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 -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 HdrCapabilities { + android.hardware.graphics.common.Hdr[] types; + float maxLuminance; + float maxAverageLuminance; + float minLuminance; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposer.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposer.aidl new file mode 100644 index 0000000000..9abc6083e2 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposer.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 -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 +interface IComposer { + android.hardware.graphics.composer3.IComposerClient createClient(); + String dumpDebugInfo(); + android.hardware.graphics.composer3.Capability[] getCapabilities(); + const int EX_NO_RESOURCES = 6; +} 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 new file mode 100644 index 0000000000..f82d02eeed --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerCallback.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 -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 +interface IComposerCallback { + void onHotplug(long display, boolean connected); + oneway void onRefresh(long display); + oneway void onSeamlessPossible(long display); + oneway void onVsync(long display, long timestamp, int vsyncPeriodNanos); + oneway void onVsyncPeriodTimingChanged(long display, in android.hardware.graphics.composer3.VsyncPeriodChangeTimeline updatedTimeline); +} 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 new file mode 100644 index 0000000000..531fd14111 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl @@ -0,0 +1,89 @@ +/** + * 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 -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 +interface IComposerClient { + long createLayer(long display, int bufferSlotCount); + android.hardware.graphics.composer3.VirtualDisplay createVirtualDisplay(int width, int height, android.hardware.graphics.common.PixelFormat formatHint, int outputBufferSlotCount); + void destroyLayer(long display, long layer); + void destroyVirtualDisplay(long display); + android.hardware.graphics.composer3.ExecuteCommandsStatus executeCommands(int inLength, in android.hardware.common.NativeHandle[] inHandles); + int getActiveConfig(long display); + void getClientTargetSupport(long display, int width, int height, android.hardware.graphics.common.PixelFormat format, android.hardware.graphics.common.Dataspace dataspace); + android.hardware.graphics.composer3.ColorMode[] getColorModes(long display); + float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); + int getDisplayAttribute(long display, int config, android.hardware.graphics.composer3.DisplayAttribute attribute); + boolean getDisplayBrightnessSupport(long display); + android.hardware.graphics.composer3.DisplayCapability[] getDisplayCapabilities(long display); + int[] getDisplayConfigs(long display); + android.hardware.graphics.composer3.DisplayConnectionType getDisplayConnectionType(long display); + android.hardware.graphics.composer3.DisplayIdentification getDisplayIdentificationData(long display); + String getDisplayName(long display); + int getDisplayVsyncPeriod(long display); + android.hardware.graphics.composer3.DisplayContentSample getDisplayedContentSample(long display, long maxFrames, long timestamp); + android.hardware.graphics.composer3.DisplayContentSamplingAttributes getDisplayedContentSamplingAttributes(long display); + boolean getDozeSupport(long display); + android.hardware.graphics.composer3.HdrCapabilities getHdrCapabilities(long display); + android.hardware.graphics.composer3.LayerGenericMetadataKey[] getLayerGenericMetadataKeys(); + int getMaxVirtualDisplayCount(); + android.hardware.common.fmq.MQDescriptor getOutputCommandQueue(); + android.hardware.graphics.composer3.PerFrameMetadataKey[] getPerFrameMetadataKeys(long display); + android.hardware.graphics.composer3.ReadbackBufferAttributes getReadbackBufferAttributes(long display); + ParcelFileDescriptor getReadbackBufferFence(long display); + android.hardware.graphics.composer3.RenderIntent[] getRenderIntents(long display, android.hardware.graphics.composer3.ColorMode mode); + android.hardware.graphics.composer3.ContentType[] getSupportedContentTypes(long display); + void registerCallback(in android.hardware.graphics.composer3.IComposerCallback callback); + void setActiveConfig(long display, int config); + android.hardware.graphics.composer3.VsyncPeriodChangeTimeline setActiveConfigWithConstraints(long display, int config, in android.hardware.graphics.composer3.VsyncPeriodChangeConstraints vsyncPeriodChangeConstraints); + void setAutoLowLatencyMode(long display, boolean on); + void setClientTargetSlotCount(long display, int clientTargetSlotCount); + void setColorMode(long display, android.hardware.graphics.composer3.ColorMode mode, android.hardware.graphics.composer3.RenderIntent intent); + void setContentType(long display, android.hardware.graphics.composer3.ContentType type); + void setDisplayBrightness(long display, float brightness); + void setDisplayedContentSamplingEnabled(long display, boolean enable, android.hardware.graphics.composer3.FormatColorComponent componentMask, long maxFrames); + void setInputCommandQueue(in android.hardware.common.fmq.MQDescriptor descriptor); + void setPowerMode(long display, android.hardware.graphics.composer3.PowerMode mode); + void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, in ParcelFileDescriptor releaseFence); + void setVsyncEnabled(long display, boolean enabled); + const int EX_BAD_CONFIG = 1; + const int EX_BAD_DISPLAY = 2; + const int EX_BAD_LAYER = 3; + const int EX_BAD_PARAMETER = 4; + const int EX_RESERVED = 5; + const int EX_NO_RESOURCES = 6; + const int EX_NOT_VALIDATED = 7; + const int EX_UNSUPPORTED = 8; + const int EX_SEAMLESS_NOT_ALLOWED = 9; + const int EX_SEAMLESS_NOT_POSSIBLE = 10; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl new file mode 100644 index 0000000000..73385d438c --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.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 -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 LayerGenericMetadataKey { + String name; + boolean mandatory; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl new file mode 100644 index 0000000000..cfafc50395 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.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 -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 LayerRequest { + CLEAR_CLIENT_TARGET = 1, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadata.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadata.aidl new file mode 100644 index 0000000000..cd1f351381 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadata.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 -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 PerFrameMetadata { + android.hardware.graphics.composer3.PerFrameMetadataKey key; + float value; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataBlob.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataBlob.aidl new file mode 100644 index 0000000000..c1e74d9e3d --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataBlob.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 -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 PerFrameMetadataBlob { + android.hardware.graphics.composer3.PerFrameMetadataKey key; + byte[] blob; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl new file mode 100644 index 0000000000..8722f878fe --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl @@ -0,0 +1,50 @@ +/** + * 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 -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 PerFrameMetadataKey { + DISPLAY_RED_PRIMARY_X = 0, + DISPLAY_RED_PRIMARY_Y = 1, + DISPLAY_GREEN_PRIMARY_X = 2, + DISPLAY_GREEN_PRIMARY_Y = 3, + DISPLAY_BLUE_PRIMARY_X = 4, + DISPLAY_BLUE_PRIMARY_Y = 5, + WHITE_POINT_X = 6, + WHITE_POINT_Y = 7, + MAX_LUMINANCE = 8, + MIN_LUMINANCE = 9, + MAX_CONTENT_LIGHT_LEVEL = 10, + MAX_FRAME_AVERAGE_LIGHT_LEVEL = 11, + HDR10_PLUS_SEI = 12, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PowerMode.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PowerMode.aidl new file mode 100644 index 0000000000..f587d4dfa8 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PowerMode.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 -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 PowerMode { + OFF = 0, + DOZE = 1, + DOZE_SUSPEND = 3, + ON = 2, + ON_SUSPEND = 4, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReadbackBufferAttributes.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReadbackBufferAttributes.aidl new file mode 100644 index 0000000000..bb51bdc04a --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReadbackBufferAttributes.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 -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 ReadbackBufferAttributes { + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.Dataspace dataspace; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RenderIntent.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RenderIntent.aidl new file mode 100644 index 0000000000..5670c10655 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RenderIntent.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 -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 RenderIntent { + COLORIMETRIC = 0, + ENHANCE = 1, + TONE_MAP_COLORIMETRIC = 2, + TONE_MAP_ENHANCE = 3, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VirtualDisplay.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VirtualDisplay.aidl new file mode 100644 index 0000000000..886be2e3d0 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VirtualDisplay.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 -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 VirtualDisplay { + long display; + android.hardware.graphics.common.PixelFormat format; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.aidl new file mode 100644 index 0000000000..df38c11f58 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.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 -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 VsyncPeriodChangeConstraints { + long desiredTimeNanos; + boolean seamlessRequired; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.aidl new file mode 100644 index 0000000000..9fb3999e3e --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.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 -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 VsyncPeriodChangeTimeline { + long newVsyncAppliedTimeNanos; + boolean refreshRequired; + long refreshTimeNanos; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl new file mode 100644 index 0000000000..c6fd063028 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.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. + */ + +package android.hardware.graphics.composer3; + +/** + * Blend modes, settable per layer. + */ +@VintfStability +@Backing(type="int") +enum BlendMode { + INVALID = 0, + /** + * colorOut = colorSrc + */ + NONE = 1, + /** + * colorOut = colorSrc + colorDst * (1 - alphaSrc) + */ + PREMULTIPLIED = 2, + /** + * colorOut = colorSrc * alphaSrc + colorDst * (1 - alphaSrc) + */ + COVERAGE = 3, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl new file mode 100644 index 0000000000..028b6f58d4 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl @@ -0,0 +1,49 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +/** + * Optional capabilities which may be supported by some devices. The + * particular set of supported capabilities for a given device may be + * retrieved using getCapabilities. + */ +@VintfStability +@Backing(type="int") +enum Capability { + INVALID = 0, + /** + * Specifies that the device supports sideband stream layers, for + * which buffer content updates and other synchronization will not be + * provided through the usual validate/present cycle and must be + * handled by an external implementation-defined mechanism. Only + * changes to layer state (such as position, size, etc.) need to be + * performed through the validate/present cycle. + */ + SIDEBAND_STREAM = 1, + /** + * Specifies that the device will apply a color transform even when + * either the client or the device has chosen that all layers should + * be composed by the client. This will prevent the client from + * applying the color transform during its composition step. + */ + SKIP_CLIENT_COLOR_TRANSFORM = 2, + /** + * Specifies that the present fence must not be used as an accurate + * representation of the actual present time of a frame. + */ + PRESENT_FENCE_IS_NOT_RELIABLE = 3, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetProperty.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetProperty.aidl new file mode 100644 index 0000000000..b4d5887499 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetProperty.aidl @@ -0,0 +1,23 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +parcelable ClientTargetProperty { + android.hardware.graphics.common.PixelFormat pixelFormat; + android.hardware.graphics.common.Dataspace dataspace; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Color.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Color.aidl new file mode 100644 index 0000000000..979f677379 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Color.aidl @@ -0,0 +1,25 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +parcelable Color { + byte r; + byte g; + byte b; + byte a; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ColorMode.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ColorMode.aidl new file mode 100644 index 0000000000..c13d207944 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ColorMode.aidl @@ -0,0 +1,283 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +@Backing(type="int") +enum ColorMode { + /** + * DEFAULT is the "native" gamut of the display. + * White Point: Vendor/OEM defined + * Panel Gamma: Vendor/OEM defined (typically 2.2) + * Rendering Intent: Vendor/OEM defined (typically 'enhanced') + */ + NATIVE = 0, + /** + * STANDARD_BT601_625 corresponds with display + * settings that implement the ITU-R Recommendation BT.601 + * or Rec 601. Using 625 line version + * Rendering Intent: Colorimetric + * Primaries: + * x y + * green 0.290 0.600 + * blue 0.150 0.060 + * red 0.640 0.330 + * white (D65) 0.3127 0.3290 + * + * KR = 0.299, KB = 0.114. This adjusts the luminance interpretation + * for RGB conversion from the one purely determined by the primaries + * to minimize the color shift into RGB space that uses BT.709 + * primaries. + * + * Gamma Correction (GC): + * + * if Vlinear < 0.018 + * Vnonlinear = 4.500 * Vlinear + * else + * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099 + */ + STANDARD_BT601_625 = 1, + /** + * Primaries: + * x y + * green 0.290 0.600 + * blue 0.150 0.060 + * red 0.640 0.330 + * white (D65) 0.3127 0.3290 + * + * Use the unadjusted KR = 0.222, KB = 0.071 luminance interpretation + * for RGB conversion. + * + * Gamma Correction (GC): + * + * if Vlinear < 0.018 + * Vnonlinear = 4.500 * Vlinear + * else + * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099 + */ + STANDARD_BT601_625_UNADJUSTED = 2, + /** + * Primaries: + * x y + * green 0.310 0.595 + * blue 0.155 0.070 + * red 0.630 0.340 + * white (D65) 0.3127 0.3290 + * + * KR = 0.299, KB = 0.114. This adjusts the luminance interpretation + * for RGB conversion from the one purely determined by the primaries + * to minimize the color shift into RGB space that uses BT.709 + * primaries. + * + * Gamma Correction (GC): + * + * if Vlinear < 0.018 + * Vnonlinear = 4.500 * Vlinear + * else + * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099 + */ + STANDARD_BT601_525 = 3, + /** + * Primaries: + * x y + * green 0.310 0.595 + * blue 0.155 0.070 + * red 0.630 0.340 + * white (D65) 0.3127 0.3290 + * + * Use the unadjusted KR = 0.212, KB = 0.087 luminance interpretation + * for RGB conversion (as in SMPTE 240M). + * + * Gamma Correction (GC): + * + * if Vlinear < 0.018 + * Vnonlinear = 4.500 * Vlinear + * else + * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099 + */ + STANDARD_BT601_525_UNADJUSTED = 4, + /** + * REC709 corresponds with display settings that implement + * the ITU-R Recommendation BT.709 / Rec. 709 for high-definition television. + * Rendering Intent: Colorimetric + * Primaries: + * x y + * green 0.300 0.600 + * blue 0.150 0.060 + * red 0.640 0.330 + * white (D65) 0.3127 0.3290 + * + * HDTV REC709 Inverse Gamma Correction (IGC): V represents normalized + * (with [0 to 1] range) value of R, G, or B. + * + * if Vnonlinear < 0.081 + * Vlinear = Vnonlinear / 4.5 + * else + * Vlinear = ((Vnonlinear + 0.099) / 1.099) ^ (1/0.45) + * + * HDTV REC709 Gamma Correction (GC): + * + * if Vlinear < 0.018 + * Vnonlinear = 4.5 * Vlinear + * else + * Vnonlinear = 1.099 * (Vlinear) ^ 0.45 – 0.099 + */ + STANDARD_BT709 = 5, + /** + * DCI_P3 corresponds with display settings that implement + * SMPTE EG 432-1 and SMPTE RP 431-2 + * Rendering Intent: Colorimetric + * Primaries: + * x y + * green 0.265 0.690 + * blue 0.150 0.060 + * red 0.680 0.320 + * white (D65) 0.3127 0.3290 + * + * Gamma: 2.6 + */ + DCI_P3 = 6, + /** + * SRGB corresponds with display settings that implement + * the sRGB color space. Uses the same primaries as ITU-R Recommendation + * BT.709 + * Rendering Intent: Colorimetric + * Primaries: + * x y + * green 0.300 0.600 + * blue 0.150 0.060 + * red 0.640 0.330 + * white (D65) 0.3127 0.3290 + * + * PC/Internet (sRGB) Inverse Gamma Correction (IGC): + * + * if Vnonlinear ≤ 0.03928 + * Vlinear = Vnonlinear / 12.92 + * else + * Vlinear = ((Vnonlinear + 0.055)/1.055) ^ 2.4 + * + * PC/Internet (sRGB) Gamma Correction (GC): + * + * if Vlinear ≤ 0.0031308 + * Vnonlinear = 12.92 * Vlinear + * else + * Vnonlinear = 1.055 * (Vlinear)^(1/2.4) – 0.055 + */ + SRGB = 7, + /** + * ADOBE_RGB corresponds with the RGB color space developed + * by Adobe Systems, Inc. in 1998. + * Rendering Intent: Colorimetric + * Primaries: + * x y + * green 0.210 0.710 + * blue 0.150 0.060 + * red 0.640 0.330 + * white (D65) 0.3127 0.3290 + * + * Gamma: 2.2 + */ + ADOBE_RGB = 8, + /** + * DISPLAY_P3 is a color space that uses the DCI_P3 primaries, + * the D65 white point and the SRGB transfer functions. + * Rendering Intent: Colorimetric + * Primaries: + * x y + * green 0.265 0.690 + * blue 0.150 0.060 + * red 0.680 0.320 + * white (D65) 0.3127 0.3290 + * + * PC/Internet (sRGB) Gamma Correction (GC): + * + * if Vlinear ≤ 0.0030186 + * Vnonlinear = 12.92 * Vlinear + * else + * Vnonlinear = 1.055 * (Vlinear)^(1/2.4) – 0.055 + * + * Note: In most cases sRGB transfer function will be fine. + */ + DISPLAY_P3 = 9, + /** + * BT2020 corresponds with display settings that implement the ITU-R + * Recommendation BT.2020 / Rec. 2020 for UHDTV. + * + * Primaries: + * x y + * green 0.170 0.797 + * blue 0.131 0.046 + * red 0.708 0.292 + * white (D65) 0.3127 0.3290 + * + * Inverse Gamma Correction (IGC): V represents normalized (with [0 to 1] + * range) value of R, G, or B. + * + * if Vnonlinear < b * 4.5 + * Vlinear = Vnonlinear / 4.5 + * else + * Vlinear = ((Vnonlinear + (a - 1)) / a) ^ (1/0.45) + * + * Gamma Correction (GC): + * + * if Vlinear < b + * Vnonlinear = 4.5 * Vlinear + * else + * Vnonlinear = a * Vlinear ^ 0.45 - (a - 1) + * + * where + * + * a = 1.09929682680944, b = 0.018053968510807 + * + * For practical purposes, these a/b values can be used instead + * + * a = 1.099, b = 0.018 for 10-bit display systems + * a = 1.0993, b = 0.0181 for 12-bit display systems + */ + BT2020 = 10, + /** + * BT2100_PQ and BT2100_HLG correspond with display settings that + * implement the ITU-R Recommendation BT.2100 / Rec. 2100 for HDR TV. + * + * Primaries: + * x y + * green 0.170 0.797 + * blue 0.131 0.046 + * red 0.708 0.292 + * white (D65) 0.3127 0.3290 + * + * For BT2100_PQ, the transfer function is Perceptual Quantizer (PQ). For + * BT2100_HLG, the transfer function is Hybrid Log-Gamma (HLG). + */ + BT2100_PQ = 11, + BT2100_HLG = 12, + /** + * DISPLAY_BT2020 corresponds with display settings that implement the ITU-R + * Recommendation BT.2020 / Rec. 2020 for UHDTV, but specifies an SRGB + * transfer function. + * + * Primaries: + * x y + * green 0.170 0.797 + * blue 0.131 0.046 + * red 0.708 0.292 + * white (D65) 0.3127 0.3290 + * + * Transfer Function is sRGB + */ + DISPLAY_BT2020 = 13, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl new file mode 100644 index 0000000000..5f987d0eaf --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl @@ -0,0 +1,741 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +import android.hardware.graphics.composer3.Command; + +/** + * The command interface allows composer3 to reduce binder overhead by sending + * atomic command stream in a command message queue. These commands are usually + * sent on a per frame basic and contains the information that describes how the + * display is composited. @see IComposerClient.executeCommands. + */ +@VintfStability +@Backing(type="int") +enum Command { + LENGTH_MASK = 0xffff, + OPCODE_SHIFT = 16, + OPCODE_MASK = 0xffff << OPCODE_SHIFT, + + // special commands + + /** + * SELECT_DISPLAY has this pseudo prototype + * + * selectDisplay(long display); + * + * Selects the current display implied by all other commands. + * + * @param display is the newly selected display. + */ + SELECT_DISPLAY = 0x000 << OPCODE_SHIFT, + + /** + * SELECT_LAYER has this pseudo prototype + * + * selectLayer(long layer); + * + * Selects the current layer implied by all implicit layer commands. + * + * @param layer is the newly selected layer. + */ + SELECT_LAYER = 0x001 << OPCODE_SHIFT, + + // value commands (for return values) + + /** + * SET_ERROR has this pseudo prototype + * + * setError(uint32_t location, int error); + * + * Indicates an error generated by a command. + * + * @param location is the offset of the command in the input command + * message queue. + * @param error is the error generated by the command. + */ + SET_ERROR = 0x100 << OPCODE_SHIFT, + + /** + * SET_CHANGED_COMPOSITION_TYPES has this pseudo prototype + * + * setChangedCompositionTypes(long[] layers, + * Composition[] types); + * + * Sets the layers for which the device requires a different composition + * type than had been set prior to the last call to VALIDATE_DISPLAY. The + * client must either update its state with these types and call + * ACCEPT_DISPLAY_CHANGES, or must set new types and attempt to validate + * the display again. + * + * @param layers is an array of layer handles. + * @param types is an array of composition types, each corresponding to + * an element of layers. + */ + SET_CHANGED_COMPOSITION_TYPES = 0x101 << OPCODE_SHIFT, + + /** + * SET_DISPLAY_REQUESTS has this pseudo prototype + * + * setDisplayRequests(int displayRequestMask, + * long[] layers, + * int[] layerRequestMasks); + * + * Sets the display requests and the layer requests required for the last + * validated configuration. + * + * Display requests provide information about how the client must handle + * the client target. Layer requests provide information about how the + * client must handle an individual layer. + * + * @param displayRequestMask is the display requests for the current + * validated state. + * @param layers is an array of layers which all have at least one + * request. + * @param layerRequestMasks is the requests corresponding to each element + * of layers. + */ + SET_DISPLAY_REQUESTS = 0x102 << OPCODE_SHIFT, + + /** + * SET_PRESENT_FENCE has this pseudo prototype + * + * setPresentFence(int presentFenceIndex); + * + * Sets the present fence as a result of PRESENT_DISPLAY. For physical + * displays, this fence must be signaled at the vsync when the result + * of composition of this frame starts to appear (for video-mode panels) + * or starts to transfer to panel memory (for command-mode panels). For + * virtual displays, this fence must be signaled when writes to the output + * buffer have completed and it is safe to read from it. + * + * @param presentFenceIndex is an index into outHandles array. + */ + SET_PRESENT_FENCE = 0x103 << OPCODE_SHIFT, + + /** + * SET_RELEASE_FENCES has this pseudo prototype + * + * setReleaseFences(long[] layers, + * int[] releaseFenceIndices); + * + * Sets the release fences for device layers on this display which will + * receive new buffer contents this frame. + * + * A release fence is a file descriptor referring to a sync fence object + * which must be signaled after the device has finished reading from the + * buffer presented in the prior frame. This indicates that it is safe to + * start writing to the buffer again. If a given layer's fence is not + * returned from this function, it must be assumed that the buffer + * presented on the previous frame is ready to be written. + * + * The fences returned by this function must be unique for each layer + * (even if they point to the same underlying sync object). + * + * @param layers is an array of layer handles. + * @param releaseFenceIndices are indices into outHandles array, each + * corresponding to an element of layers. + */ + SET_RELEASE_FENCES = 0x104 << OPCODE_SHIFT, + + // display commands + + /** + * SET_COLOR_TRANSFORM has this pseudo prototype + * + * setColorTransform(float[16] matrix, + * ColorTransform hint); + * + * Sets a color transform which will be applied after composition. + * + * If hint is not ColorTransform::ARBITRARY, then the device may use the + * hint to apply the desired color transform instead of using the color + * matrix directly. + * + * If the device is not capable of either using the hint or the matrix to + * apply the desired color transform, it must force all layers to client + * composition during VALIDATE_DISPLAY. + * + * If IComposer::Capability::SKIP_CLIENT_COLOR_TRANSFORM is present, then + * the client must never apply the color transform during client + * composition, even if all layers are being composed by the client. + * + * The matrix provided is an affine color transformation of the following + * form: + * + * |r.r r.g r.b 0| + * |g.r g.g g.b 0| + * |b.r b.g b.b 0| + * |Tr Tg Tb 1| + * + * This matrix must be provided in row-major form: + * + * {r.r, r.g, r.b, 0, g.r, ...}. + * + * Given a matrix of this form and an input color [R_in, G_in, B_in], the + * output color [R_out, G_out, B_out] will be: + * + * R_out = R_in * r.r + G_in * g.r + B_in * b.r + Tr + * G_out = R_in * r.g + G_in * g.g + B_in * b.g + Tg + * B_out = R_in * r.b + G_in * g.b + B_in * b.b + Tb + * + * @param matrix is a 4x4 transform matrix (16 floats) as described above. + * @param hint is a hint value which may be used instead of the given + * matrix unless it is ColorTransform::ARBITRARY. + */ + SET_COLOR_TRANSFORM = 0x200 << OPCODE_SHIFT, + + /** + * SET_CLIENT_TARGET has this pseudo prototype + * + * setClientTarget(int targetSlot, + * int targetIndex, + * int acquireFenceIndex, + * android.hardware.graphics.common.Dataspace dataspace, + * Rect[] damage); + * + * Sets the buffer handle which will receive the output of client + * composition. Layers marked as Composition::CLIENT must be composited + * into this buffer prior to the call to PRESENT_DISPLAY, and layers not + * marked as Composition::CLIENT must be composited with this buffer by + * the device. + * + * The buffer handle provided may be empty if no layers are being + * composited by the client. This must not result in an error (unless an + * invalid display handle is also provided). + * + * Also provides a file descriptor referring to an acquire sync fence + * object, which must be signaled when it is safe to read from the client + * target buffer. If it is already safe to read from this buffer, an + * empty handle may be passed instead. + * + * For more about dataspaces, see SET_LAYER_DATASPACE. + * + * The damage parameter describes a surface damage region as defined in + * the description of SET_LAYER_SURFACE_DAMAGE. + * + * Will be called before PRESENT_DISPLAY if any of the layers are marked + * as Composition::CLIENT. If no layers are so marked, then it is not + * necessary to call this function. It is not necessary to call + * validateDisplay after changing the target through this function. + * + * @param targetSlot is the client target buffer slot to use. + * @param targetIndex is an index into inHandles for the new target + * buffer. + * @param acquireFenceIndex is an index into inHandles for a sync fence + * file descriptor as described above. + * @param dataspace is the dataspace of the buffer, as described in + * setLayerDataspace. + * @param damage is the surface damage region. + * + */ + SET_CLIENT_TARGET = 0x201 << OPCODE_SHIFT, + + /** + * SET_OUTPUT_BUFFER has this pseudo prototype + * + * setOutputBuffer(int bufferSlot, + * int bufferIndex, + * int releaseFenceIndex); + * + * Sets the output buffer for a virtual display. That is, the buffer to + * which the composition result will be written. + * + * Also provides a file descriptor referring to a release sync fence + * object, which must be signaled when it is safe to write to the output + * buffer. If it is already safe to write to the output buffer, an empty + * handle may be passed instead. + * + * Must be called at least once before PRESENT_DISPLAY, but does not have + * any interaction with layer state or display validation. + * + * @param bufferSlot is the new output buffer. + * @param bufferIndex is the new output buffer. + * @param releaseFenceIndex is a sync fence file descriptor as described + * above. + */ + SET_OUTPUT_BUFFER = 0x202 << OPCODE_SHIFT, + + /** + * VALIDATE_DISPLAY has this pseudo prototype + * + * validateDisplay(); + * + * Instructs the device to inspect all of the layer state and determine if + * there are any composition type changes necessary before presenting the + * display. Permitted changes are described in the definition of + * Composition above. + */ + VALIDATE_DISPLAY = 0x203 << OPCODE_SHIFT, + + /** + * ACCEPT_DISPLAY_CHANGES has this pseudo prototype + * + * acceptDisplayChanges(); + * + * Accepts the changes required by the device from the previous + * validateDisplay call (which may be queried using + * getChangedCompositionTypes) and revalidates the display. This function + * is equivalent to requesting the changed types from + * getChangedCompositionTypes, setting those types on the corresponding + * layers, and then calling validateDisplay again. + * + * After this call it must be valid to present this display. Calling this + * after validateDisplay returns 0 changes must succeed with NONE, but + * must have no other effect. + */ + ACCEPT_DISPLAY_CHANGES = 0x204 << OPCODE_SHIFT, + + /** + * PRESENT_DISPLAY has this pseudo prototype + * + * presentDisplay(); + * + * Presents the current display contents on the screen (or in the case of + * virtual displays, into the output buffer). + * + * Prior to calling this function, the display must be successfully + * validated with validateDisplay. Note that setLayerBuffer and + * setLayerSurfaceDamage specifically do not count as layer state, so if + * there are no other changes to the layer state (or to the buffer's + * properties as described in setLayerBuffer), then it is safe to call + * this function without first validating the display. + */ + PRESENT_DISPLAY = 0x205 << OPCODE_SHIFT, + + /** + * PRESENT_OR_VALIDATE_DISPLAY has this pseudo prototype + * + * presentOrValidateDisplay(); + * + * Presents the current display contents on the screen (or in the case of + * virtual displays, into the output buffer) if validate can be skipped, + * or perform a VALIDATE_DISPLAY action instead. + */ + PRESENT_OR_VALIDATE_DISPLAY = 0x206 << OPCODE_SHIFT, + + // layer commands (VALIDATE_DISPLAY not required) + + /** + * SET_LAYER_CURSOR_POSITION has this pseudo prototype + * + * setLayerCursorPosition(int x, int y); + * + * Asynchronously sets the position of a cursor layer. + * + * Prior to validateDisplay, a layer may be marked as Composition::CURSOR. + * If validation succeeds (i.e., the device does not request a composition + * change for that layer), then once a buffer has been set for the layer + * and it has been presented, its position may be set by this function at + * any time between presentDisplay and any subsequent validateDisplay + * calls for this display. + * + * Once validateDisplay is called, this function must not be called again + * until the validate/present sequence is completed. + * + * May be called from any thread so long as it is not interleaved with the + * validate/present sequence as described above. + * + * @param layer is the layer to which the position is set. + * @param x is the new x coordinate (in pixels from the left of the + * screen). + * @param y is the new y coordinate (in pixels from the top of the + * screen). + */ + SET_LAYER_CURSOR_POSITION = 0x300 << OPCODE_SHIFT, + + /** + * SET_LAYER_BUFFER has this pseudo prototype + * + * setLayerBuffer(int bufferSlot, + * int bufferIndex, + * int acquireFenceIndex); + * + * Sets the buffer handle to be displayed for this layer. If the buffer + * properties set at allocation time (width, height, format, and usage) + * have not changed since the previous frame, it is not necessary to call + * validateDisplay before calling presentDisplay unless new state needs to + * be validated in the interim. + * + * Also provides a file descriptor referring to an acquire sync fence + * object, which must be signaled when it is safe to read from the given + * buffer. If it is already safe to read from the buffer, an empty handle + * may be passed instead. + * + * This function must return NONE and have no other effect if called for a + * layer with a composition type of Composition::SOLID_COLOR (because it + * has no buffer) or Composition::SIDEBAND or Composition::CLIENT (because + * synchronization and buffer updates for these layers are handled + * elsewhere). + * + * @param layer is the layer to which the buffer is set. + * @param bufferSlot is the buffer slot to use. + * @param bufferIndex is the buffer handle to set. + * @param acquireFenceIndex is a sync fence file descriptor as described above. + */ + SET_LAYER_BUFFER = 0x301 << OPCODE_SHIFT, + + /* + * SET_LAYER_SURFACE_DAMAGE has this pseudo prototype + * + * setLayerSurfaceDamage(Rect[] damage); + * + * Provides the region of the source buffer which has been modified since + * the last frame. This region does not need to be validated before + * calling presentDisplay. + * + * Once set through this function, the damage region remains the same + * until a subsequent call to this function. + * + * If damage is non-empty, then it may be assumed that any portion of the + * source buffer not covered by one of the rects has not been modified + * this frame. If damage is empty, then the whole source buffer must be + * treated as if it has been modified. + * + * If the layer's contents are not modified relative to the prior frame, + * damage must contain exactly one empty rect([0, 0, 0, 0]). + * + * The damage rects are relative to the pre-transformed buffer, and their + * origin is the top-left corner. They must not exceed the dimensions of + * the latched buffer. + * + * @param layer is the layer to which the damage region is set. + * @param damage is the new surface damage region. + */ + SET_LAYER_SURFACE_DAMAGE = 0x302 << OPCODE_SHIFT, + + // layer state commands (VALIDATE_DISPLAY required) + + /** + * SET_LAYER_BLEND_MODE has this pseudo prototype + * + * setLayerBlendMode(android.hardware.graphics.common.BlendMode mode) + * + * Sets the blend mode of the given layer. + * + * @param mode is the new blend mode. + */ + SET_LAYER_BLEND_MODE = 0x400 << OPCODE_SHIFT, + + /** + * SET_LAYER_COLOR has this pseudo prototype + * + * setLayerColor(Color color); + * + * Sets the color of the given layer. If the composition type of the layer + * is not Composition::SOLID_COLOR, this call must succeed and have no + * other effect. + * + * @param color is the new color. + */ + SET_LAYER_COLOR = 0x401 << OPCODE_SHIFT, + + /** + * SET_LAYER_COMPOSITION_TYPE has this pseudo prototype + * + * setLayerCompositionType(Composition type); + * + * Sets the desired composition type of the given layer. During + * validateDisplay, the device may request changes to the composition + * types of any of the layers as described in the definition of + * Composition above. + * + * @param type is the new composition type. + */ + SET_LAYER_COMPOSITION_TYPE = 0x402 << OPCODE_SHIFT, + + /** + * SET_LAYER_DATASPACE has this pseudo prototype + * + * setLayerDataspace(android.hardware.graphics.common.Dataspace dataspace); + * + * Sets the dataspace of the layer. + * + * The dataspace provides more information about how to interpret the buffer + * or solid color, such as the encoding standard and color transform. + * + * See the values of Dataspace for more information. + * + * @param dataspace is the new dataspace. + */ + SET_LAYER_DATASPACE = 0x403 << OPCODE_SHIFT, + + /** + * SET_LAYER_DISPLAY_FRAME has this pseudo prototype + * + * setLayerDisplayFrame(Rect frame); + * + * Sets the display frame (the portion of the display covered by a layer) + * of the given layer. This frame must not exceed the display dimensions. + * + * @param frame is the new display frame. + */ + SET_LAYER_DISPLAY_FRAME = 0x404 << OPCODE_SHIFT, + + /** + * SET_LAYER_PLANE_ALPHA has this pseudo prototype + * + * setLayerPlaneAlpha(float alpha); + * + * Sets an alpha value (a floating point value in the range [0.0, 1.0]) + * which will be applied to the whole layer. It can be conceptualized as a + * preprocessing step which applies the following function: + * if (blendMode == BlendMode::PREMULTIPLIED) + * out.rgb = in.rgb * planeAlpha + * out.a = in.a * planeAlpha + * + * If the device does not support this operation on a layer which is + * marked Composition::DEVICE, it must request a composition type change + * to Composition::CLIENT upon the next validateDisplay call. + * + * @param alpha is the plane alpha value to apply. + */ + SET_LAYER_PLANE_ALPHA = 0x405 << OPCODE_SHIFT, + + /** + * SET_LAYER_SIDEBAND_STREAM has this pseudo prototype + * + * setLayerSidebandStream(int streamIndex) + * + * Sets the sideband stream for this layer. If the composition type of the + * given layer is not Composition::SIDEBAND, this call must succeed and + * have no other effect. + * + * @param streamIndex is the new sideband stream. + */ + SET_LAYER_SIDEBAND_STREAM = 0x406 << OPCODE_SHIFT, + + /** + * SET_LAYER_SOURCE_CROP has this pseudo prototype + * + * setLayerSourceCrop(FRect crop); + * + * Sets the source crop (the portion of the source buffer which will fill + * the display frame) of the given layer. This crop rectangle must not + * exceed the dimensions of the latched buffer. + * + * If the device is not capable of supporting a true float source crop + * (i.e., it will truncate or round the floats to integers), it must set + * this layer to Composition::CLIENT when crop is non-integral for the + * most accurate rendering. + * + * If the device cannot support float source crops, but still wants to + * handle the layer, it must use the following code (or similar) to + * convert to an integer crop: + * intCrop.left = (int) ceilf(crop.left); + * intCrop.top = (int) ceilf(crop.top); + * intCrop.right = (int) floorf(crop.right); + * intCrop.bottom = (int) floorf(crop.bottom); + * + * @param crop is the new source crop. + */ + SET_LAYER_SOURCE_CROP = 0x407 << OPCODE_SHIFT, + + /** + * SET_LAYER_TRANSFORM has this pseudo prototype + * + * Sets the transform (rotation/flip) of the given layer. + * + * setLayerTransform(Transform transform); + * + * @param transform is the new transform. + */ + SET_LAYER_TRANSFORM = 0x408 << OPCODE_SHIFT, + + /** + * SET_LAYER_VISIBLE_REGION has this pseudo prototype + * + * setLayerVisibleRegion(Rect[] visible); + * + * Specifies the portion of the layer that is visible, including portions + * under translucent areas of other layers. The region is in screen space, + * and must not exceed the dimensions of the screen. + * + * @param visible is the new visible region, in screen space. + */ + SET_LAYER_VISIBLE_REGION = 0x409 << OPCODE_SHIFT, + + /** + * SET_LAYER_Z_ORDER has this pseudo prototype + * + * setLayerZOrder(int z); + * + * Sets the desired Z order (height) of the given layer. A layer with a + * greater Z value occludes a layer with a lesser Z value. + * + * @param z is the new Z order. + */ + SET_LAYER_Z_ORDER = 0x40a << OPCODE_SHIFT, + + /** + * SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT has this pseudo prototype + * + * setPresentOrValidateDisplayResult(int state); + * + * Sets the state of PRESENT_OR_VALIDATE_DISPLAY command. + * @param state is the state of present or validate + * 1 - Present Succeeded + * 0 - Validate succeeded + */ + SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT = 0x40b << OPCODE_SHIFT, + + /** + * SET_LAYER_PER_FRAME_METADATA has this pseudo prototype + * + * setLayerPerFrameMetadata(long display, long layer, + * PerFrameMetadata[] data); + * + * Sets the PerFrameMetadata for the display. This metadata must be used + * by the implementation to better tone map content to that display. + * + * This is a method that may be called every frame. Thus it's + * implemented using buffered transport. + * SET_LAYER_PER_FRAME_METADATA is the command used by the buffered transport + * mechanism. + */ + SET_LAYER_PER_FRAME_METADATA = 0x303 << OPCODE_SHIFT, + + /** + * SET_LAYER_FLOAT_COLOR has this pseudo prototype + * + * setLayerColor(FloatColor color); + * + * Sets the color of the given layer. If the composition type of the layer + * is not Composition::SOLID_COLOR, this call must succeed and have no + * other effect. + * + * @param color is the new color using float type. + */ + SET_LAYER_FLOAT_COLOR = 0x40c << OPCODE_SHIFT, + + /** + * SET_LAYER_COLOR_TRANSFORM has this pseudo prototype + * + * setLayerColorTransform(float[16] matrix); + * + * This command has the following binary layout in bytes: + * + * 0 - 16 * 4: matrix + * + * Sets a matrix for color transform which will be applied on this layer + * before composition. + * + * If the device is not capable of apply the matrix on this layer, it must force + * this layer to client composition during VALIDATE_DISPLAY. + * + * The matrix provided is an affine color transformation of the following + * form: + * + * |r.r r.g r.b 0| + * |g.r g.g g.b 0| + * |b.r b.g b.b 0| + * |Tr Tg Tb 1| + * + * This matrix must be provided in row-major form: + * + * {r.r, r.g, r.b, 0, g.r, ...}. + * + * Given a matrix of this form and an input color [R_in, G_in, B_in], + * the input color must first be converted to linear space + * [R_linear, G_linear, B_linear], then the output linear color + * [R_out_linear, G_out_linear, B_out_linear] will be: + * + * R_out_linear = R_linear * r.r + G_linear * g.r + B_linear * b.r + Tr + * G_out_linear = R_linear * r.g + G_linear * g.g + B_linear * b.g + Tg + * B_out_linear = R_linear * r.b + G_linear * g.b + B_linear * b.b + Tb + * + * [R_out_linear, G_out_linear, B_out_linear] must then be converted to + * gamma space: [R_out, G_out, B_out] before blending. + * + * @param matrix is a 4x4 transform matrix (16 floats) as described above. + */ + + SET_LAYER_COLOR_TRANSFORM = 0x40d << OPCODE_SHIFT, + /* + * SET_LAYER_PER_FRAME_METADATA_BLOBS has this pseudo prototype + * + * setLayerPerFrameMetadataBlobs(long display, long layer, + * PerFrameMetadataBlob[] metadata); + * + * This command sends metadata that may be used for tone-mapping the + * associated layer. The metadata structure follows a {key, blob} + * format (see the PerFrameMetadataBlob struct). All keys must be + * returned by a prior call to getPerFrameMetadataKeys and must + * be part of the list of keys associated with blob-type metadata + * (see PerFrameMetadataKey). + * + * This method may be called every frame. + */ + SET_LAYER_PER_FRAME_METADATA_BLOBS = 0x304 << OPCODE_SHIFT, + + /** + * SET_CLIENT_TARGET_PROPERTY has this pseudo prototype + * + * This command has the following binary layout in bytes: + * + * 0 - 3: clientTargetProperty.pixelFormat + * 4 - 7: clientTargetProperty.dataspace + * + * setClientTargetProperty(ClientTargetProperty clientTargetProperty); + */ + SET_CLIENT_TARGET_PROPERTY = 0x105 << OPCODE_SHIFT, + + /** + * SET_LAYER_GENERIC_METADATA has this pseudo prototype + * + * setLayerGenericMetadata(string key, bool mandatory, byte[] value); + * + * Sets a piece of generic metadata for the given layer. If this + * function is called twice with the same key but different values, the + * newer value must override the older one. Calling this function with a + * 0-length value must reset that key's metadata as if it had not been + * set. + * + * A given piece of metadata may either be mandatory or a hint + * (non-mandatory) as indicated by the second parameter. Mandatory + * metadata may affect the composition result, which is to say that it + * may cause a visible change in the final image. By contrast, hints may + * only affect the composition strategy, such as which layers are + * composited by the client, but must not cause a visible change in the + * final image. The value of the mandatory flag shall match the value + * returned from getLayerGenericMetadataKeys for the given key. + * + * Only keys which have been returned from getLayerGenericMetadataKeys() + * shall be accepted. Any other keys must result in an UNSUPPORTED error. + * + * The value passed into this function shall be the binary + * representation of a HIDL type corresponding to the given key. For + * example, a key of 'com.example.V1_3.Foo' shall be paired with a + * value of type com.example@1.3::Foo, which would be defined in a + * vendor HAL extension. + * + * This function will be encoded in the command buffer in this order: + * 1) The key length, stored as a uint32_t + * 2) The key itself, padded to a uint32_t boundary if necessary + * 3) The mandatory flag, stored as a uint32_t + * 4) The value length in bytes, stored as a uint32_t + * 5) The value itself, padded to a uint32_t boundary if necessary + * + * @param key indicates which metadata value should be set on this layer + * @param mandatory indicates whether this particular key represents + * mandatory metadata or a hint (non-mandatory metadata), as + * described above + * @param value is a binary representation of a HIDL struct + * corresponding to the key as described above + */ + SET_LAYER_GENERIC_METADATA = 0x40e << OPCODE_SHIFT, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl new file mode 100644 index 0000000000..ea22af2a68 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl @@ -0,0 +1,76 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +/** + * Possible composition types for a given layer. + */ +@VintfStability +@Backing(type="int") +enum Composition { + INVALID = 0, + /** + * The client must composite this layer into the client target buffer + * (provided to the device through setClientTarget). + * + * The device must not request any composition type changes for layers + * of this type. + */ + CLIENT = 1, + /** + * The device must handle the composition of this layer through a + * hardware overlay or other similar means. + * + * Upon validateDisplay, the device may request a change from this + * type to CLIENT. + */ + DEVICE = 2, + /** + * The device must render this layer using the color set through + * setLayerColor. If this functionality is not supported on a layer + * that the client sets to SOLID_COLOR, the device must request that + * the composition type of that layer is changed to CLIENT upon the + * next call to validateDisplay. + * + * Upon validateDisplay, the device may request a change from this + * type to CLIENT. + */ + SOLID_COLOR = 3, + /** + * Similar to DEVICE, but the position of this layer may also be set + * asynchronously through setCursorPosition. If this functionality is + * not supported on a layer that the client sets to CURSOR, the device + * must request that the composition type of that layer is changed to + * CLIENT upon the next call to validateDisplay. + * + * Upon validateDisplay, the device may request a change from this + * type to either DEVICE or CLIENT. Changing to DEVICE will prevent + * the use of setCursorPosition but still permit the device to + * composite the layer. + */ + CURSOR = 4, + /** + * The device must handle the composition of this layer, as well as + * its buffer updates and content synchronization. Only supported on + * devices which provide Capability::SIDEBAND_STREAM. + * + * Upon validateDisplay, the device may request a change from this + * type to either DEVICE or CLIENT, but it is unlikely that content + * will display correctly in these cases. + */ + SIDEBAND = 5, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ContentType.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ContentType.aidl new file mode 100644 index 0000000000..470064a0b1 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ContentType.aidl @@ -0,0 +1,30 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +@Backing(type="int") +enum ContentType { + NONE = 0, + /** + * These modes correspond to those found in the HDMI 1.4 specification. + */ + GRAPHICS = 1, + PHOTO = 2, + CINEMA = 3, + GAME = 4, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayAttribute.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayAttribute.aidl new file mode 100644 index 0000000000..bf66785091 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayAttribute.aidl @@ -0,0 +1,56 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +import android.hardware.graphics.composer3.DisplayAttribute; + +/** + * Display attributes queryable through getDisplayAttribute. + */ +@VintfStability +@Backing(type="int") +enum DisplayAttribute { + INVALID = 0, + /** + * Dimensions in pixels + */ + WIDTH = 1, + HEIGHT = 2, + /** + * Vsync period in nanoseconds + */ + VSYNC_PERIOD = 3, + /** + * Dots per thousand inches (DPI * 1000). Scaling by 1000 allows these + * numbers to be stored in an int32_t without losing too much + * precision. If the DPI for a configuration is unavailable or is + * considered unreliable, the device may return UNSUPPORTED instead. + */ + DPI_X = 4, + DPI_Y = 5, + + // 6 is reserved for legacy interfaces + + /** + * The configuration group ID (as int32_t) 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. + */ + CONFIG_GROUP = 7, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl new file mode 100644 index 0000000000..54f09c1ade --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl @@ -0,0 +1,69 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +import android.hardware.graphics.composer3.DisplayCapability; + +/** + * Required capabilities which are supported by the display. The + * particular set of supported capabilities for a given display may be + * retrieved using getDisplayCapabilities. + */ +@VintfStability +@Backing(type="int") +enum DisplayCapability { + INVALID = 0, + /** + * Indicates that the display must apply a color transform even when + * either the client or the device has chosen that all layers should + * be composed by the client. This prevents the client from applying + * the color transform during its composition step. + * If getDisplayCapabilities is supported, the global capability + * SKIP_CLIENT_COLOR_TRANSFORM is ignored. + * If getDisplayCapabilities is not supported, and the global capability + * SKIP_CLIENT_COLOR_TRANSFORM is returned by getCapabilities, + * then all displays must be treated as having + * SKIP_CLIENT_COLOR_TRANSFORM. + */ + SKIP_CLIENT_COLOR_TRANSFORM = 1, + /** + * Indicates that the display supports PowerMode::DOZE and + * PowerMode::DOZE_SUSPEND. DOZE_SUSPEND may not provide any benefit + * over DOZE (see the definition of PowerMode for more information), + * but if both DOZE and DOZE_SUSPEND are no different from + * PowerMode::ON, the device must not claim support. + * Must be returned by getDisplayCapabilities when getDozeSupport + * indicates the display supports PowerMode::DOZE and + * PowerMode::DOZE_SUSPEND. + */ + DOZE = 2, + /** + * Indicates that the display supports brightness operations. + */ + BRIGHTNESS = 3, + /** + * Indicates that the display supports protected contents. + * When returned, hardware composer must be able to accept client target + * with protected buffers. + */ + PROTECTED_CONTENTS = 4, + /** + * Indicates that both the composer HAL implementation and the given display + * support a low latency mode, such as HDMI 2.1 Auto Low Latency Mode. + */ + AUTO_LOW_LATENCY_MODE = 5, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConnectionType.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConnectionType.aidl new file mode 100644 index 0000000000..80333cb957 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConnectionType.aidl @@ -0,0 +1,30 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +@Backing(type="int") +enum DisplayConnectionType { + /** + * Display is connected through internal port, e.g. DSI, eDP. + */ + INTERNAL = 0, + /** + * Display is connected through external port, e.g. HDMI, DisplayPort. + */ + EXTERNAL = 1, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayContentSample.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayContentSample.aidl new file mode 100644 index 0000000000..9457d9962d --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayContentSample.aidl @@ -0,0 +1,49 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +/** + * Output parameters for IComposerClient.getDisplayedContentSample + */ +@VintfStability +parcelable DisplayContentSample { + /** + * The number of frames represented by this sample. + */ + long frameCount; + /** + * A histogram counting how many times a pixel of a given value was displayed + * onscreen for FORMAT_COMPONENT_0. The buckets of the histogram are evenly + * weighted, the number of buckets is device specific. eg, for RGBA_8888, + * if sampleComponent0 is {10, 6, 4, 1} this means that 10 red pixels were + * displayed onscreen in range 0x00->0x3F, 6 red pixels were displayed + * onscreen in range 0x40->0x7F, etc. + */ + long[] sampleComponent0; + /** + * The same sample definition as sampleComponent0, but for FORMAT_COMPONENT_1. + */ + long[] sampleComponent1; + /** + * The same sample definition as sampleComponent0, but for FORMAT_COMPONENT_2. + */ + long[] sampleComponent2; + /** + * The same sample definition as sampleComponent0, but for FORMAT_COMPONENT_3. + */ + long[] sampleComponent3; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.aidl new file mode 100644 index 0000000000..82f6b729c4 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.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. + */ + +package android.hardware.graphics.composer3; + +import android.hardware.graphics.composer3.FormatColorComponent; + +/** + * Output parameters for IComposerClient.getDisplayedContentSamplingAttributes + */ +@VintfStability +parcelable DisplayContentSamplingAttributes { + /** + * The format of the sampled pixels. + */ + android.hardware.graphics.common.PixelFormat format; + /** + * The dataspace of the sampled pixels. + */ + android.hardware.graphics.common.Dataspace dataspace; + /** + * The mask of which components can be sampled. + */ + FormatColorComponent componentMask; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayIdentification.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayIdentification.aidl new file mode 100644 index 0000000000..03ef8e68df --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayIdentification.aidl @@ -0,0 +1,32 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +/** + * Output parameters for IComposerClient.getDisplayIdentificationData + */ +@VintfStability +parcelable DisplayIdentification { + /** + * The connector to which the display is connected. + */ + byte port; + /** + * The EDID 1.3 blob identifying the display. + */ + byte[] data; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl new file mode 100644 index 0000000000..4b3d31a176 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl @@ -0,0 +1,37 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +/** + * Display requests returned by getDisplayRequests. + */ +@VintfStability +@Backing(type="int") +enum DisplayRequest { + /** + * Instructs the client to provide a new client target buffer, even if + * no layers are marked for client composition. + */ + FLIP_CLIENT_TARGET = 1 << 0, + /** + * Instructs the client to write the result of client composition + * directly into the virtual display output buffer. If any of the + * layers are not marked as Composition::CLIENT or the given display + * is not a virtual display, this request has no effect. + */ + WRITE_CLIENT_TARGET_TO_OUTPUT = 1 << 1, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl new file mode 100644 index 0000000000..f67c3ce75f --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl @@ -0,0 +1,36 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +/** + * Output parameters for IComposerClient.executeCommands + */ +@VintfStability +parcelable ExecuteCommandsStatus { + /** + * Indicates whether the output command message queue has changed. + */ + boolean queueChanged; + /** + * Indicates whether the output command message queue has changed. + */ + int length; + /** + * An array of handles referenced by the output commands. + */ + android.hardware.common.NativeHandle[] handles; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/FloatColor.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/FloatColor.aidl new file mode 100644 index 0000000000..a0a1d4b179 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/FloatColor.aidl @@ -0,0 +1,29 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +/** + * Color representation as a floating point number in the range [0.0 - 1.0] + */ + +@VintfStability +parcelable FloatColor { + float r; + float g; + float b; + float a; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/FormatColorComponent.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/FormatColorComponent.aidl new file mode 100644 index 0000000000..cc8f424f97 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/FormatColorComponent.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. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +@Backing(type="byte") +enum FormatColorComponent { + /* + * The first component (eg, for RGBA_8888, this is R) + */ + FORMAT_COMPONENT_0 = 1 << 0, + /* + * The second component (eg, for RGBA_8888, this is G) + */ + FORMAT_COMPONENT_1 = 1 << 1, + /* + * The third component (eg, for RGBA_8888, this is B) + */ + FORMAT_COMPONENT_2 = 1 << 2, + /* + * The fourth component (eg, for RGBA_8888, this is A) + */ + FORMAT_COMPONENT_3 = 1 << 3, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl new file mode 100644 index 0000000000..0a93c9ee36 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl @@ -0,0 +1,33 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +/** + * Special index values (always negative) for command queue commands. + */ +@VintfStability +@Backing(type="int") +enum HandleIndex { + /** + * No handle + */ + EMPTY = -1, + /** + * Use cached handle + */ + CACHED = -2, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HdrCapabilities.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/HdrCapabilities.aidl new file mode 100644 index 0000000000..3fb55baccd --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/HdrCapabilities.aidl @@ -0,0 +1,36 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; +/** + * Output parameters for IComposerClient.getHdrCapabilities + * + * @param types is an array of HDR types, may have 0 elements if the + * display is not HDR-capable. + * @param maxLuminance is the desired content maximum luminance for this + * display in cd/m^2. + * @param maxAverageLuminance - the desired content maximum frame-average + * luminance for this display in cd/m^2. + * @param minLuminance is the desired content minimum luminance for this + * display in cd/m^2. + */ +@VintfStability +parcelable HdrCapabilities { + android.hardware.graphics.common.Hdr[] types; + float maxLuminance; + float maxAverageLuminance; + float minLuminance; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl new file mode 100644 index 0000000000..a6a9f73b2a --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl @@ -0,0 +1,54 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +import android.hardware.graphics.composer3.Capability; +import android.hardware.graphics.composer3.IComposerClient; + +@VintfStability +interface IComposer { + /** + * Temporary failure due to resource contention Exception + */ + const int EX_NO_RESOURCES = 6; + + /** + * Creates a v2.4 client of the composer. Supersedes @2.3::createClient. + * + * @return is the newly created client. + * + * @exception EX_NO_RESOURCES when the client could not be created. + */ + IComposerClient createClient(); + + /** + * Retrieves implementation-defined debug information, which will be + * displayed during, for example, `dumpsys SurfaceFlinger`. + * + * @return is a string of debug information. + */ + String dumpDebugInfo(); + + /** + * Provides a list of supported capabilities (as described in the + * definition of Capability above). This list must not change after + * initialization. + * + * @return is a list of supported capabilities. + */ + Capability[] getCapabilities(); +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl new file mode 100644 index 0000000000..1709e6dff5 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl @@ -0,0 +1,89 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +import android.hardware.graphics.composer3.VsyncPeriodChangeTimeline; + +@VintfStability +interface IComposerCallback { + /** + * Notifies the client that the given display has either been connected or + * disconnected. 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 connected indicates whether the display is connected or + * disconnected. + */ + void onHotplug(long display, boolean connected); + + /** + * Notifies the client to trigger a screen refresh. This forces all layer + * state for this display to be resent, and the display to be validated + * and presented, even if there have been no changes. + * + * This refresh will occur some time after the callback is initiated, but + * not necessarily before it returns. It is safe to trigger this callback + * from other functions which call into the device. + * + * @param display is the display to refresh. + */ + oneway void onRefresh(long display); + + /** + * Notifies the client that the conditions which previously led to returning + * SEAMLESS_NOT_POSSIBLE from setActiveConfigWithConstraints have changed and now seamless may + * be possible. Client should retry calling setActiveConfigWithConstraints. + * + * @param display is a display setActiveConfigWithConstraints previously failed with + * EX_SEAMLESS_NOT_POSSIBLE. + */ + oneway void onSeamlessPossible(long display); + + /** + * Notifies the client that a vsync event has occurred. This callback must + * only be triggered when vsync is enabled for this display (through + * setVsyncEnabled). + * + * @param display is the display which has received a vsync event + * @param timestamp is the CLOCK_MONOTONIC time at which the vsync event + * occurred, in nanoseconds. + * @param vsyncPeriodNanos is the display vsync period in nanoseconds i.e. the next onVsync + * is expected to be called vsyncPeriodNanos nanoseconds after this call. + */ + oneway void onVsync(long display, long timestamp, int vsyncPeriodNanos); + + /** + * Notifies the client that the previously reported timing for vsync period change has been + * updated. This may occur if the composer missed the deadline for changing the vsync period + * or the client submitted a refresh frame too late. + * + * @param display is the display which vsync period change is in progress + * @param updatedTimeline is the new timeline for the vsync period change. + */ + oneway void onVsyncPeriodTimingChanged( + long display, in VsyncPeriodChangeTimeline updatedTimeline); +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl new file mode 100644 index 0000000000..9bde220fa4 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -0,0 +1,821 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +import android.hardware.common.fmq.MQDescriptor; +import android.hardware.common.fmq.SynchronizedReadWrite; +import android.hardware.graphics.composer3.ClientTargetProperty; +import android.hardware.graphics.composer3.ColorMode; +import android.hardware.graphics.composer3.Command; +import android.hardware.graphics.composer3.ContentType; +import android.hardware.graphics.composer3.DisplayAttribute; +import android.hardware.graphics.composer3.DisplayCapability; +import android.hardware.graphics.composer3.DisplayConnectionType; +import android.hardware.graphics.composer3.DisplayContentSample; +import android.hardware.graphics.composer3.DisplayContentSamplingAttributes; +import android.hardware.graphics.composer3.DisplayIdentification; +import android.hardware.graphics.composer3.ExecuteCommandsStatus; +import android.hardware.graphics.composer3.FormatColorComponent; +import android.hardware.graphics.composer3.HdrCapabilities; +import android.hardware.graphics.composer3.IComposerCallback; +import android.hardware.graphics.composer3.LayerGenericMetadataKey; +import android.hardware.graphics.composer3.PerFrameMetadataKey; +import android.hardware.graphics.composer3.PowerMode; +import android.hardware.graphics.composer3.ReadbackBufferAttributes; +import android.hardware.graphics.composer3.RenderIntent; +import android.hardware.graphics.composer3.VirtualDisplay; +import android.hardware.graphics.composer3.VsyncPeriodChangeConstraints; +import android.hardware.graphics.composer3.VsyncPeriodChangeTimeline; + +@VintfStability +interface IComposerClient { + /** + * Invalid Config Exception + */ + const int EX_BAD_CONFIG = 1; + + /** + * Invalid Display Exception + */ + const int EX_BAD_DISPLAY = 2; + + /** + * Invalid Layer Exception + */ + const int EX_BAD_LAYER = 3; + + /** + * Invalid width, height, etc. + */ + const int EX_BAD_PARAMETER = 4; + + /** + * Reserved for historical reasons + */ + const int EX_RESERVED = 5; + /** + * Temporary failure due to resource contention Exception + */ + const int EX_NO_RESOURCES = 6; + + /** + * validateDisplay has not been called Exception + */ + const int EX_NOT_VALIDATED = 7; + + /** + * Seamless cannot be required for configurations that don't share a + * config group Exception + */ + const int EX_UNSUPPORTED = 8; + + const int EX_SEAMLESS_NOT_ALLOWED = 9; + /** + * Seamless requirements cannot be met Exception + */ + const int EX_SEAMLESS_NOT_POSSIBLE = 10; + + /** + * Creates a new layer on the given display. + * + * @param display is the display on which to create the layer. + * @param bufferSlotCount is the number of buffer slot to be reserved. + * + * @return is the handle of the new layer. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_NO_RESOURCES when the device was unable to create a layer this + * time. + */ + long createLayer(long display, int bufferSlotCount); + + /** + * Creates a new virtual display with the given width and height. The + * format passed into this function is the default format requested by the + * consumer of the virtual display output buffers. + * + * The display must be assumed to be on from the time the first frame is + * presented until the display is destroyed. + * + * @param width is the width in pixels. + * @param height is the height in pixels. + * @param formatHint is the default output buffer format selected by + * the consumer. + * @param outputBufferSlotCount is the number of output buffer slots to be + * reserved. + * + * @return is the newly-created virtual display. + * + * @exception EX_UNSUPPORTED when the width or height is too large for the + * device to be able to create a virtual display. + * @exception EX_NO_RESOURCES when the device is unable to create a new virtual + * display at this time. + */ + VirtualDisplay createVirtualDisplay(int width, int height, + android.hardware.graphics.common.PixelFormat formatHint, int outputBufferSlotCount); + + /** + * Destroys the given layer. + * + * @param display is the display on which the layer was created. + * @param layer is the layer to destroy. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_BAD_LAYER when an invalid layer handle was passed in. + */ + void destroyLayer(long display, long layer); + + /** + * Destroys a virtual display. After this call all resources consumed by + * this display may be freed by the device and any operations performed on + * this display must fail. + * + * @param display is the virtual display to destroy. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_BAD_PARAMETER when the display handle which was passed in does + * not refer to a virtual display. + */ + void destroyVirtualDisplay(long display); + + /** + * Executes commands from the input command message queue. Return values + * generated by the input commands are written to the output command + * message queue in the form of value commands. + * + * @param inLength is the length of input commands. + * @param inHandles is an array of handles referenced by the input + * commands. + * + * @return is the status of the command. + + * @exception EX_BAD_PARAMETER when inLength is not equal to the length of + * commands in the input command message queue. + * @exception NO_RESOURCES when the output command message queue was not + * properly drained. + */ + ExecuteCommandsStatus executeCommands( + int inLength, in android.hardware.common.NativeHandle[] inHandles); + + /** + * Retrieves which display configuration is currently active. + * + * If no display configuration is currently active, this function raise + * the exception EX_BAD_CONFIG. It is the responsibility of the client to call + * setActiveConfig with a valid configuration before attempting to present + * anything on the display. + * + * @param display is the display to which the active config is queried. + * + * @return is the currently active display configuration. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_BAD_CONFIG when no configuration is currently active. + */ + int getActiveConfig(long display); + + /** + * Returns whether a client target with the given properties can be + * handled by the device. + * + * This function must return true for a client target with width and + * height equal to the active display configuration dimensions, + * PixelFormat::RGBA_8888, and Dataspace::UNKNOWN. It is not required to + * return true for any other configuration. + * + * @param display is the display to query. + * @param width is the client target width in pixels. + * @param height is the client target height in pixels. + * @param format is the client target format. + * @param dataspace is the client target dataspace, as described in + * setLayerDataspace. + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_UNSUPPORTED when the given configuration is not supported. + */ + void getClientTargetSupport(long display, int width, int height, + android.hardware.graphics.common.PixelFormat format, + android.hardware.graphics.common.Dataspace dataspace); + + /** + * Returns the color modes supported on this display. + * + * All devices must support at least ColorMode::NATIVE. + * + * @param display is the display to query. + * + * @return is an array of color modes. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + */ + ColorMode[] getColorModes(long display); + + /** + * By default, layer dataspaces are mapped to the current color mode + * colorimetrically with a few exceptions. + * + * When the layer dataspace is a legacy dataspace (see + * common@1.1::Dataspace) and the display render intent is + * RenderIntent::ENHANCE, the pixel values can go through an + * implementation-defined saturation transform before being mapped to the + * current color mode colorimetrically. + * + * Colors that are out of the gamut of the current color mode are + * hard-clipped. + * + * + * Returns the saturation matrix of the specified legacy dataspace. + * + * The saturation matrix can be used to approximate the legacy dataspace + * saturation transform. It is to be applied on linear pixel values like + * this: + * + * (in GLSL) + * linearSrgb = saturationMatrix * linearSrgb; + * + * @param dataspace must be Dataspace::SRGB_LINEAR. + * + * @return is the 4x4 column-major matrix used to approximate the + * legacy dataspace saturation operation. The last row must be + * [0.0, 0.0, 0.0, 1.0]. + * + * @exception EX_BAD_PARAMETER when an invalid dataspace was passed in. + */ + float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); + + /** + * Returns a display attribute value for a particular display + * configuration. + * + * @param display is the display to query. + * @param config is the display configuration for which to return + * attribute values. + * + * @return is the value of the attribute. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_BAD_CONFIG when config does not name a valid configuration for + * this display. + * @exception EX_BAD_PARAMETER when attribute is unrecognized. + * @exception EX_UNSUPPORTED when attribute cannot be queried for the config. + */ + int getDisplayAttribute(long display, int config, DisplayAttribute attribute); + + /** + * Use getDisplayCapabilities instead. If brightness is supported, must return + * DisplayCapability::BRIGHTNESS as one of the display capabilities via getDisplayCapabilities. + * Only use getDisplayCapabilities as the source of truth to query brightness support. + * + * Gets whether brightness operations are supported on a display. + * + * @param display The display. + * + * @return Whether brightness operations are supported on the display. + * + * @exception EX_BAD_DISPLAY when the display is invalid, or + * @exception EX_BAD_PARAMETER when the output parameter is invalid. + */ + boolean getDisplayBrightnessSupport(long display); + + /** + * Provides a list of supported capabilities (as described in the + * definition of DisplayCapability above). This list must not change after + * initialization. + * + * @return is a list of supported capabilities. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + */ + DisplayCapability[] getDisplayCapabilities(long display); + + /** + * Returns handles for all of the valid display configurations on this + * display. + * + * @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. + */ + int[] getDisplayConfigs(long display); + + /** + * Returns whether the given physical display is internal or external. + * + * @return is the connection type of the display. + * + * @exception EX_BAD_DISPLAY when the given display is invalid or virtual. + */ + DisplayConnectionType getDisplayConnectionType(long display); + + /** + * Returns the port and data that describe a physical display. The port is + * a unique number that identifies a physical connector (e.g. eDP, HDMI) + * for display output. The data blob is parsed to determine its format, + * typically EDID 1.3 as specified in VESA E-EDID Standard Release A + * Revision 1. + * + * @param display is the display to query. + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_UNSUPPORTED when identification data is unavailable. + * @return the connector to which the display is connected and the EDID 1.3 + * blob identifying the display. + */ + DisplayIdentification getDisplayIdentificationData(long display); + + /** + * Returns a human-readable version of the display's name. + * + * @return is the name of the display. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + */ + String getDisplayName(long display); + + /** + * Retrieves which vsync period the display is currently using. + * + * If no display configuration is currently active, this function must + * return BAD_CONFIG. If the vsync period is about to change due to a + * setActiveConfigWithConstraints call, this function must return the current vsync period + * until the change takes place. + * + * @param display is the display for which the vsync period is queried. + * + * @return is the current vsync period of the display. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_BAD_CONFIG when no configuration is currently active. + */ + int getDisplayVsyncPeriod(long display); + + /** + * Collects the results of display content color sampling for display. + * + * Collection of data can occur whether the sampling is in ENABLE or + * DISABLE state. + * + * @param display is the display to which the sampling is collected. + * @param maxFrames is the maximum number of frames that should be represented in the sample. + * The sample represents the most-recently posted frames. + * If maxFrames is 0, all frames are to be represented by the sample. + * @param timestamp is the timestamp after which any frames were posted that should be + * included in the sample. Timestamp is CLOCK_MONOTONIC. + * If timestamp is 0, do not filter from the sample by time. + * + * @return is the sample. + * + * @exception EX_BAD_DISPLAY when an invalid display was passed in, or + * @exception EX_UNSUPPORTED when there is no efficient way to sample, or + * @exception EX_BAD_PARAMETER when the component is not supported by the hardware. + */ + DisplayContentSample getDisplayedContentSample(long display, long maxFrames, long timestamp); + + /** + * Query for what types of color sampling the hardware supports. + * + * @param display is the display where the samples are collected. + * + * @return are the sampling attributes + * + * @exception EX_BAD_DISPLAY when an invalid display was passed in, or + * @exception EX_UNSUPPORTED when there is no efficient way to sample. + */ + DisplayContentSamplingAttributes getDisplayedContentSamplingAttributes(long display); + + /** + * Returns whether the given display supports PowerMode::DOZE and + * PowerMode::DOZE_SUSPEND. DOZE_SUSPEND may not provide any benefit over + * DOZE (see the definition of PowerMode for more information), but if + * both DOZE and DOZE_SUSPEND are no different from PowerMode::ON, the + * device must not claim support. + * + * @param display is the display to query. + * + * @return is true only when the display supports doze modes. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + */ + boolean getDozeSupport(long display); + + /** + * Returns the high dynamic range (HDR) capabilities of the given display, + * which are invariant with regard to the active configuration. + * + * Displays which are not HDR-capable must return no types. + * + * @param display is the display to query. + * + * @return are the HDR capabilities + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + */ + HdrCapabilities getHdrCapabilities(long display); + + /** + * Retrieves the set of keys that may be passed into setLayerGenericMetadata + * + * Key names must meet the following requirements: + * - Must be specified in reverse domain name notation + * - Must not start with 'com.android' or 'android' + * - Must be unique within the returned vector + * - Must correspond to a matching HIDL struct type, which defines the + * structure of its values. For example, the key 'com.example.V1-3.Foo' + * should correspond to a value of type com.example@1.3::Foo, which is + * defined in a vendor HAL extension + */ + LayerGenericMetadataKey[] getLayerGenericMetadataKeys(); + + /** + * Returns the maximum number of virtual displays supported by this device + * (which may be 0). The client must not attempt to create more than this + * many virtual displays on this device. This number must not change for + * the lifetime of the device. + * + * @return is the maximum number of virtual displays supported. + */ + int getMaxVirtualDisplayCount(); + + /** + * Gets the output command message queue. + * + * This function must only be called inside executeCommands closure. + * + * @return is the descriptor of the output command queue. + * + * @exception EX_NO_RESOURCES when failed to get the queue temporarily. + */ + MQDescriptor getOutputCommandQueue(); + + /** + * Returns the PerFrameMetadataKeys that are supported by this device. + * + * @param display is the display on which to create the layer. + * @return is the vector of PerFrameMetadataKey keys that are + * supported by this device. + * @exception EX_UNSUPPORTED if not supported on underlying HAL + */ + PerFrameMetadataKey[] getPerFrameMetadataKeys(long display); + + /** + * Returns the format which should be used when allocating a buffer for use by + * device readback as well as the dataspace in which its contents must be + * interpreted. + * + * The width and height of this buffer must be those of the currently-active + * display configuration, and the usage flags must consist of the following: + * BufferUsage::CPU_READ | BufferUsage::GPU_TEXTURE | + * BufferUsage::COMPOSER_OUTPUT + * + * The format and dataspace provided must be sufficient such that if a + * correctly-configured buffer is passed into setReadbackBuffer, filled by + * the device, and then displayed by the client as a full-screen buffer, the + * output of the display remains the same (subject to the note about protected + * content in the description of setReadbackBuffer). + * + * If the active configuration or color mode of this display has changed + * since a previous call to this function, it must be called again prior to + * setting a readback buffer such that the returned format and dataspace will + * be updated accordingly. + * + * Parameters: + * @param display - the display on which to create the layer. + * + * @return is the readback buffer attributes. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_UNSUPPORTED if not supported on underlying HAL + * + * See also: + * setReadbackBuffer + * getReadbackBufferFence + */ + ReadbackBufferAttributes getReadbackBufferAttributes(long display); + + /** + * Returns an acquire sync fence file descriptor which must signal when the + * buffer provided to setReadbackBuffer has been filled by the device and is + * safe for the client to read. + * + * If it is already safe to read from this buffer, -1 may be returned instead. + * The client takes ownership of this file descriptor and is responsible for + * closing it when it is no longer needed. + * + * This function must be called immediately after the composition cycle being + * captured into the readback buffer. The complete ordering of a readback buffer + * capture is as follows: + * + * getReadbackBufferAttributes + * // Readback buffer is allocated + * // Many frames may pass + * + * setReadbackBuffer + * validateDisplay + * presentDisplay + * getReadbackBufferFence + * // Implicitly wait on the acquire fence before accessing the buffer + * + * Parameters: + * @param display - the display on which to create the layer. + * + * @return is a sync fence file descriptor as described above; pointer + * must be non-NULL + * + * @exception EX_BAD_DISPLAY - an invalid display handle was passed in + * @exception EX_NO_RESOURCES - the readback operation was successful, but + * resulted in a different validate result than would + * have occurred without readback + * @exception EX_UNSUPPORTED - the readback operation was unsuccessful because of + * resource constraints, the presence of protected + * content, or other reasons; -1 must be returned for + * acquireFence + * + * See also: + * getReadbackBufferAttributes + * setReadbackBuffer + */ + ParcelFileDescriptor getReadbackBufferFence(long display); + + /** + * Returns the render intents supported by the specified display and color + * mode. + * + * For SDR color modes, RenderIntent::COLORIMETRIC must be supported. For + * HDR color modes, RenderIntent::TONE_MAP_COLORIMETRIC must be supported. + * + * @param display is the display to query. + * @param mode is the color mode to query. + * + * @return is an array of render intents. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_BAD_PARAMETER when an invalid color mode was passed in. + */ + RenderIntent[] getRenderIntents(long display, ColorMode mode); + + /** + * Provides a list of all the content types supported by this display (any of + * ContentType::{GRAPHICS, PHOTO, CINEMA, GAME}). This list must not change after + * initialization. + * + * Content types are introduced in HDMI 1.4 and supporting them is optional. The + * ContentType::NONE is always supported and will not be returned by this method.. + * + * @return out is a list of supported content types. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + */ + ContentType[] getSupportedContentTypes(long display); + + /** + * Provides a IComposerCallback object for the device to call. + * + * This function must be called only once. + * + * @param callback is the IComposerCallback object. + */ + void registerCallback(in IComposerCallback callback); + + /** + * Sets the active configuration for this display. Upon returning, the + * given display configuration must be active and remain so until either + * this function is called again or the display is disconnected. + * + * @param display is the display to which the active config is set. + * @param config is the new display configuration. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_BAD_CONFIG when the configuration handle passed in is not valid + * for this display. + */ + void setActiveConfig(long display, int config); + + /** + * Sets the active configuration and the refresh rate for this display. + * If the new config shares the same config group as the current config, + * only the vsync period shall change. + * Upon returning, the given display configuration, except vsync period, must be active and + * remain so until either this function is called again or the display is disconnected. + * When the display starts to refresh at the new vsync period, onVsync_2_4 callback must be + * called with the new vsync period. + * + * @param display is the display for which the active config is set. + * @param config is the new display configuration. + * @param vsyncPeriodChangeConstraints are the constraints required for changing vsync period. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_BAD_CONFIG when the configuration handle passed in is not valid + * for this display. + * @exception EX_SEAMLESS_NOT_ALLOWED when seamlessRequired was true but config provided doesn't + * share the same config group as the current config. + * @exception EX_SEAMLESS_NOT_POSSIBLE when seamlessRequired was true but the display cannot + * achieve the vsync period change without a noticeable visual artifact. When the conditions + * change and it may be possible to change the vsync period seamlessly, onSeamlessPossible + * callback must be called to indicate that caller should retry. + * + * @return is the timeline for the vsync period change. + */ + VsyncPeriodChangeTimeline setActiveConfigWithConstraints( + long display, int config, in VsyncPeriodChangeConstraints vsyncPeriodChangeConstraints); + + /** + * Requests the display to enable/disable its low latency mode. + * + * If the display is connected via HDMI 2.1, then Auto Low Latency Mode should be triggered. If + * the display is internally connected and a custom low latency mode is available, that should + * be triggered. + * + * This function should only be called if the display reports support for + * DisplayCapability::AUTO_LOW_LATENCY_MODE from getDisplayCapabilities_2_4. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_UNSUPPORTED when AUTO_LOW_LATENCY_MODE is not supported by the composer + * implementation or the given display + */ + void setAutoLowLatencyMode(long display, boolean on); + + /** + * Set the number of client target slots to be reserved. + * + * @param display is the display to which the slots are reserved. + * @param clientTargetSlotCount is the slot count for client targets. + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_NO_RESOURCES when unable to reserve the slots. + */ + void setClientTargetSlotCount(long display, int clientTargetSlotCount); + + /** + * Sets the color mode and render intent of the given display. + * + * The color mode and render intent change must take effect on next + * presentDisplay. + * + * All devices must support at least ColorMode::NATIVE and + * RenderIntent::COLORIMETRIC, and displays are assumed to be in this mode + * upon hotplug. + * + * @param display is the display to which the color mode is set. + * @param mode is the color mode to set to. + * @param intent is the render intent to set to. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_BAD_PARAMETER when mode or intent is invalid + * @exception EX_UNSUPPORTED when mode or intent is not supported on this + * display. + */ + void setColorMode(long display, ColorMode mode, RenderIntent intent); + + /** + * Instructs the connected display that the content being shown is of the given type - one of + * GRAPHICS, PHOTO, CINEMA, GAME. + * + * Content types are introduced in HDMI 1.4 and supporting them is optional. If they are + * supported, this signal should switch the display to a mode that is optimal for the given + * type of content. See HDMI 1.4 specification for more information. + * + * If the display is internally connected (not through HDMI), and such modes are available, + * this method should trigger them. + * + * This function should only be called if the display reports support for the corresponding + * content type (ContentType::{GRAPHICS, PHOTO, CINEMA, GAME}) from getSupportedContentTypes. + * ContentType::NONE is supported by default and can always be set. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_UNSUPPORTED when the given content type is not supported by the composer + * implementation or the given display + */ + void setContentType(long display, ContentType type); + + /** + * Sets the brightness of a display. + * + * Ideally, the brightness change should take effect in the next frame post (so that it can be + * aligned with color transforms). + * + * @param display + * The display whose brightness is set. + * @param brightness + * A number between 0.0f (minimum brightness) and 1.0f (maximum brightness), or -1.0 to + * turn the backlight off. + * + * @exception EX_BAD_DISPLAY when the display is invalid, or + * @exception EX_UNSUPPORTED when brightness operations are not supported, or + * @exception EX_BAD_PARAMETER when the brightness is invalid, or + * @exception EX_NO_RESOURCES when the brightness cannot be applied. + */ + void setDisplayBrightness(long display, float brightness); + + /** + * Enables or disables the collection of color content statistics + * on this display. + * + * Sampling occurs on the contents of the final composition on this display + * (i.e., the contents presented on screen). Samples should be collected after all + * color transforms have been applied. + * + * Sampling support is optional, and is set to DISABLE by default. + * On each call to ENABLE, all collected statistics must be reset. + * + * Sample data can be queried via getDisplayedContentSample(). + * + * @param display is the display to which the sampling mode is set. + * @param enabled indicates whether to enable or disable sampling. + * @param componentMask The mask of which components should be sampled. If zero, all supported + * components are to be enabled. + * @param maxFrames is the maximum number of frames that should be stored before discard. + * The sample represents the most-recently posted frames. + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in, + * @exception EX_BAD_PARAMETER when enabled was an invalid value, or + * @exception EX_NO_RESOURCES when the requested ringbuffer size via maxFrames was + * not available. + * @exception EX_UNSUPPORTED when there is no efficient way to sample. + */ + void setDisplayedContentSamplingEnabled( + long display, boolean enable, FormatColorComponent componentMask, long maxFrames); + + /** + * Sets the input command message queue. + * + * @param descriptor is the descriptor of the input command message queue. + * @exception EX_NO_RESOURCES when failed to set the queue temporarily. + */ + void setInputCommandQueue(in MQDescriptor descriptor); + + /** + * Sets the power mode of the given display. The transition must be + * complete when this function returns. It is valid to call this function + * multiple times with the same power mode. + * + * All displays must support PowerMode::ON and PowerMode::OFF. Whether a + * display supports PowerMode::DOZE or PowerMode::DOZE_SUSPEND may be + * queried using getDozeSupport. + * + * @param display is the display to which the power mode is set. + * @param mode is the new power mode. + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_BAD_PARAMETER when mode was not a valid power mode. + * @exception EX_UNSUPPORTED when mode is not supported on this display. + */ + void setPowerMode(long display, PowerMode mode); + + /** + * Sets the readback buffer to be filled with the contents of the next + * composition performed for this display (i.e., the contents present at the + * time of the next validateDisplay/presentDisplay cycle). + * + * This buffer must have been allocated as described in + * getReadbackBufferAttributes and is in the dataspace provided by the same. + * + * If there is hardware protected content on the display at the time of the next + * composition, the area of the readback buffer covered by such content must be + * completely black. Any areas of the buffer not covered by such content may + * optionally be black as well. + * + * The release fence file descriptor provided works identically to the one + * described for setOutputBuffer. + * + * This function must not be called between any call to validateDisplay and a + * subsequent call to presentDisplay. + * + * Parameters: + * @param display - the display on which to create the layer. + * @param buffer - the new readback buffer + * @param releaseFence - a sync fence file descriptor as described in setOutputBuffer + * + * @exception EX_BAD_DISPLAY - an invalid display handle was passed in + * @exception EX_BAD_PARAMETER - the new readback buffer handle was invalid + * + * See also: + * getReadbackBufferAttributes + * getReadbackBufferFence + */ + void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, + in ParcelFileDescriptor releaseFence); + + /** + * Enables or disables the vsync signal for the given display. Virtual + * displays never generate vsync callbacks, and any attempt to enable + * vsync for a virtual display though this function must succeed and have + * no other effect. + * + * @param display is the display to which the vsync mode is set. + * @param enabled indicates whether to enable or disable vsync + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_BAD_PARAMETER when enabled was an invalid value. + */ + void setVsyncEnabled(long display, boolean enabled); +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl new file mode 100644 index 0000000000..17704b8d3c --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl @@ -0,0 +1,31 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +parcelable LayerGenericMetadataKey { + /** + * Key names must comply with the requirements specified for + * getLayerGenericMetadataKeys below + */ + String name; + /** + * The mandatory flag is defined in the description of + * setLayerGenericMetadata above + */ + boolean mandatory; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerRequest.aidl new file mode 100644 index 0000000000..10de55877f --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerRequest.aidl @@ -0,0 +1,31 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +/** + * Layer requests returned from getDisplayRequests. + */ +@VintfStability +@Backing(type="int") +enum LayerRequest { + /** + * The client must clear its target with transparent pixels where + * this layer would be. The client may ignore this request if the + * layer must be blended. + */ + CLEAR_CLIENT_TARGET = 1 << 0, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadata.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadata.aidl new file mode 100644 index 0000000000..a6588a4312 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadata.aidl @@ -0,0 +1,32 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +import android.hardware.graphics.composer3.PerFrameMetadataKey; + +/** + * PerFrameMetadata + * This struct encapsulates float-valued + * metadata - key must not be in the list + * of keys representing blob-formatted metadata + * (see PerFrameMetadataKey) + */ +@VintfStability +parcelable PerFrameMetadata { + PerFrameMetadataKey key; + float value; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.aidl new file mode 100644 index 0000000000..a82773c0dc --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.aidl @@ -0,0 +1,33 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +import android.hardware.graphics.composer3.PerFrameMetadataKey; + +/** + * PerFrameMetadataBlob + * This struct encapsulates blob + * metadata - key must be one of the list of keys + * associated with blob-type metadata key + * and the blob must adhere to the format specified by + * that key (See PerFrameMetadataKey). + */ +@VintfStability +parcelable PerFrameMetadataBlob { + PerFrameMetadataKey key; + byte[] blob; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl new file mode 100644 index 0000000000..b666e6a0e0 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl @@ -0,0 +1,92 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +import android.hardware.graphics.composer3.PerFrameMetadataKey; + +/** + * PerFrameMetadataKey + * + * A set of PerFrameMetadataKey pertains specifically to blob-formatted + * metadata (as opposed to float-valued metadata). + * The list of keys that represent blobs are: + * 1. HDR10_PLUS_SEI + */ +@VintfStability +@Backing(type="int") +enum PerFrameMetadataKey { + /** + * SMPTE ST 2084:2014. + * Coordinates defined in CIE 1931 xy chromaticity space + * + * + * SMPTE ST 2084:2014 + */ + DISPLAY_RED_PRIMARY_X, + /** + * SMPTE ST 2084:2014 + */ + DISPLAY_RED_PRIMARY_Y, + /** + * SMPTE ST 2084:2014 + */ + DISPLAY_GREEN_PRIMARY_X, + /** + * SMPTE ST 2084:2014 + */ + DISPLAY_GREEN_PRIMARY_Y, + /** + * SMPTE ST 2084:2014 + */ + DISPLAY_BLUE_PRIMARY_X, + /** + * SMPTE ST 2084:2014 + */ + DISPLAY_BLUE_PRIMARY_Y, + /** + * SMPTE ST 2084:2014 + */ + WHITE_POINT_X, + /** + * SMPTE ST 2084:2014 + */ + WHITE_POINT_Y, + /** + * SMPTE ST 2084:2014. + * Units: nits + * max as defined by ST 2048: 10,000 nits + */ + MAX_LUMINANCE, + /** + * SMPTE ST 2084:2014 + */ + MIN_LUMINANCE, + /** + * CTA 861.3 + */ + MAX_CONTENT_LIGHT_LEVEL, + /** + * CTA 861.3 + */ + MAX_FRAME_AVERAGE_LIGHT_LEVEL, + /** + * HDR10+ metadata + * Specifies a metadata blob adhering to + * the ST2094-40 SEI message spec, Version 1.0 + */ + HDR10_PLUS_SEI, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/PowerMode.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PowerMode.aidl new file mode 100644 index 0000000000..2c56933e88 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PowerMode.aidl @@ -0,0 +1,68 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +import android.hardware.graphics.composer3.PowerMode; + +@VintfStability +@Backing(type="int") +enum PowerMode { + /** + * The display is fully off (blanked). + */ + OFF = 0, + /** + * These are optional low power modes. getDozeSupport may be called to + * determine whether a given display supports these modes. + * + * + * The display is turned on and configured in a low power state that + * is suitable for presenting ambient information to the user, + * possibly with lower fidelity than ON, but with greater efficiency. + */ + DOZE = 1, + /** + * The display is configured as in DOZE but may stop applying display + * updates from the client. This is effectively a hint to the device + * that drawing to the display has been suspended and that the + * device must remain on in a low power state and continue + * displaying its current contents indefinitely until the power mode + * changes. + * + * This mode may also be used as a signal to enable hardware-based + * doze functionality. In this case, the device is free to take over + * the display and manage it autonomously to implement a low power + * always-on display. + */ + DOZE_SUSPEND = 3, + /** + * The display is fully on. + */ + ON = 2, + /** + * The display is configured as in ON but may stop applying display + * updates from the client. This is effectively a hint to the device + * that drawing to the display has been suspended and that the + * device must remain on and continue displaying its current contents + * indefinitely until the power mode changes. + * + * This mode may also be used as a signal to enable hardware-based + * functionality to take over the display and manage it autonomously + * to implement a low power always-on display. + */ + ON_SUSPEND = 4, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ReadbackBufferAttributes.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ReadbackBufferAttributes.aidl new file mode 100644 index 0000000000..8241dddf82 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ReadbackBufferAttributes.aidl @@ -0,0 +1,23 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +parcelable ReadbackBufferAttributes { + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.Dataspace dataspace; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/RenderIntent.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/RenderIntent.aidl new file mode 100644 index 0000000000..043b24d341 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/RenderIntent.aidl @@ -0,0 +1,68 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +/** + * RenderIntent defines the mapping from color mode colors to display colors. + * + * A render intent must not change how it maps colors when the color mode + * changes. That is to say that when a render intent maps color C to color C', + * the fact that color C can have different pixel values in different color + * modes should not affect the mapping. + * + * RenderIntent overrides the render intents defined for individual color + * modes. It is ignored when the color mode is ColorMode::NATIVE, because + * ColorMode::NATIVE colors are already display colors. + */ +@VintfStability +@Backing(type="int") +enum RenderIntent { + /** + * Colors in the display gamut are unchanged. Colors out of the display + * gamut are hard-clipped. + * + * This implies that the display must have been calibrated unless + * ColorMode::NATIVE is the only supported color mode. + */ + COLORIMETRIC = 0, + /** + * Enhance colors that are in the display gamut. Colors out of the display + * gamut are hard-clipped. + * + * The enhancement typically picks the biggest standard color space (e.g. + * DCI-P3) that is narrower than the display gamut and stretches it to the + * display gamut. The stretching is recommended to preserve skin tones. + */ + ENHANCE = 1, + /** + * Tone map high-dynamic-range colors to the display's dynamic range. The + * dynamic range of the colors are communicated separately. After tone + * mapping, the mapping to the display gamut is as defined in + * COLORIMETRIC. + */ + TONE_MAP_COLORIMETRIC = 2, + /** + * Tone map high-dynamic-range colors to the display's dynamic range. The + * dynamic range of the colors are communicated separately. After tone + * mapping, the mapping to the display gamut is as defined in ENHANCE. + * + * The tone mapping step and the enhancing step must match + * TONE_MAP_COLORIMETRIC and ENHANCE respectively when they are also + * supported. + */ + TONE_MAP_ENHANCE = 3, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/VirtualDisplay.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/VirtualDisplay.aidl new file mode 100644 index 0000000000..8bbdfe3640 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/VirtualDisplay.aidl @@ -0,0 +1,32 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +/** + * The return value from IComposerClient.createVirtualDisplay + */ +@VintfStability +parcelable VirtualDisplay { + /** + * The newly-created virtual display. + */ + long display; + /** + * The format of the buffer the device will produce. + */ + android.hardware.graphics.common.PixelFormat format; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.aidl new file mode 100644 index 0000000000..5ae6f3d648 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.aidl @@ -0,0 +1,34 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +/** + * Constraints for changing vsync period. + */ +@VintfStability +parcelable VsyncPeriodChangeConstraints { + /** + * Time in CLOCK_MONOTONIC after which the vsync period may change + * (i.e., the vsync period must not change before this time). + */ + long desiredTimeNanos; + /** + * If true, requires that the vsync period change must happen seamlessly without + * a noticeable visual artifact. + */ + boolean seamlessRequired; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.aidl new file mode 100644 index 0000000000..13fd051084 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.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. + */ + +package android.hardware.graphics.composer3; + +/** + * Timing for a vsync period change. + */ +@VintfStability +parcelable VsyncPeriodChangeTimeline { + /** + * The time in CLOCK_MONOTONIC when the new display will start to refresh at + * the new vsync period. + */ + long newVsyncAppliedTimeNanos; + /** + * Set to true if the client is required to send a frame to be displayed before + * the change can take place. + */ + boolean refreshRequired; + /** + * The time in CLOCK_MONOTONIC when the client is expected to send the new frame. + * Should be ignored if refreshRequired is false. + */ + long refreshTimeNanos; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp new file mode 100644 index 0000000000..a593e906b8 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp @@ -0,0 +1,612 @@ +/** + * 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/hardware/graphics/composer3/translate-ndk.h" + +namespace android::h2a { + +static_assert( + aidl::android::hardware::graphics::composer3::IComposer::EX_NO_RESOURCES == + static_cast(::android::hardware::graphics::composer::V2_4::Error::NO_RESOURCES)); + +static_assert( + aidl::android::hardware::graphics::composer3::IComposerClient::EX_BAD_CONFIG == + static_cast(::android::hardware::graphics::composer::V2_4::Error::BAD_CONFIG)); +static_assert( + aidl::android::hardware::graphics::composer3::IComposerClient::EX_BAD_DISPLAY == + static_cast(::android::hardware::graphics::composer::V2_4::Error::BAD_DISPLAY)); +static_assert( + aidl::android::hardware::graphics::composer3::IComposerClient::EX_BAD_LAYER == + static_cast(::android::hardware::graphics::composer::V2_4::Error::BAD_LAYER)); +static_assert( + aidl::android::hardware::graphics::composer3::IComposerClient::EX_BAD_PARAMETER == + static_cast(::android::hardware::graphics::composer::V2_4::Error::BAD_PARAMETER)); +static_assert( + aidl::android::hardware::graphics::composer3::IComposerClient::EX_NO_RESOURCES == + static_cast(::android::hardware::graphics::composer::V2_4::Error::NO_RESOURCES)); +static_assert( + aidl::android::hardware::graphics::composer3::IComposerClient::EX_NOT_VALIDATED == + static_cast(::android::hardware::graphics::composer::V2_4::Error::NOT_VALIDATED)); +static_assert( + aidl::android::hardware::graphics::composer3::IComposerClient::EX_UNSUPPORTED == + static_cast(::android::hardware::graphics::composer::V2_4::Error::UNSUPPORTED)); +static_assert( + aidl::android::hardware::graphics::composer3::IComposerClient::EX_SEAMLESS_NOT_ALLOWED == + static_cast( + ::android::hardware::graphics::composer::V2_4::Error::SEAMLESS_NOT_ALLOWED)); +static_assert( + aidl::android::hardware::graphics::composer3::IComposerClient::EX_SEAMLESS_NOT_POSSIBLE == + static_cast( + ::android::hardware::graphics::composer::V2_4::Error::SEAMLESS_NOT_POSSIBLE)); + +static_assert( + aidl::android::hardware::graphics::composer3::Capability::INVALID == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposer::Capability::INVALID)); +static_assert(aidl::android::hardware::graphics::composer3::Capability::SIDEBAND_STREAM == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposer::Capability:: + SIDEBAND_STREAM)); +static_assert( + aidl::android::hardware::graphics::composer3::Capability::SKIP_CLIENT_COLOR_TRANSFORM == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposer::Capability:: + SKIP_CLIENT_COLOR_TRANSFORM)); +static_assert( + aidl::android::hardware::graphics::composer3::Capability::PRESENT_FENCE_IS_NOT_RELIABLE == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposer::Capability:: + PRESENT_FENCE_IS_NOT_RELIABLE)); + +static_assert(aidl::android::hardware::graphics::composer3::LayerRequest::CLEAR_CLIENT_TARGET == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient::LayerRequest:: + CLEAR_CLIENT_TARGET)); + +static_assert(aidl::android::hardware::graphics::composer3::BlendMode::INVALID == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode:: + INVALID)); +static_assert( + aidl::android::hardware::graphics::composer3::BlendMode::NONE == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode::NONE)); +static_assert(aidl::android::hardware::graphics::composer3::BlendMode::PREMULTIPLIED == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode:: + PREMULTIPLIED)); +static_assert(aidl::android::hardware::graphics::composer3::BlendMode::COVERAGE == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode:: + COVERAGE)); + +static_assert(aidl::android::hardware::graphics::composer3::Composition::INVALID == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition:: + INVALID)); +static_assert(aidl::android::hardware::graphics::composer3::Composition::CLIENT == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition:: + CLIENT)); +static_assert(aidl::android::hardware::graphics::composer3::Composition::DEVICE == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition:: + DEVICE)); +static_assert(aidl::android::hardware::graphics::composer3::Composition::SOLID_COLOR == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition:: + SOLID_COLOR)); +static_assert(aidl::android::hardware::graphics::composer3::Composition::CURSOR == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition:: + CURSOR)); +static_assert(aidl::android::hardware::graphics::composer3::Composition::SIDEBAND == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition:: + SIDEBAND)); + +static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest::FLIP_CLIENT_TARGET == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient:: + DisplayRequest::FLIP_CLIENT_TARGET)); +static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest:: + WRITE_CLIENT_TARGET_TO_OUTPUT == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient:: + DisplayRequest::WRITE_CLIENT_TARGET_TO_OUTPUT)); + +static_assert(aidl::android::hardware::graphics::composer3::HandleIndex::EMPTY == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient::HandleIndex:: + EMPTY)); +static_assert(aidl::android::hardware::graphics::composer3::HandleIndex::CACHED == + static_cast( + ::android::hardware::graphics::composer::V2_1::IComposerClient::HandleIndex:: + CACHED)); + +static_assert( + aidl::android::hardware::graphics::composer3::PowerMode::OFF == + static_cast( + ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode::OFF)); +static_assert( + aidl::android::hardware::graphics::composer3::PowerMode::DOZE == + static_cast( + ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode::DOZE)); +static_assert(aidl::android::hardware::graphics::composer3::PowerMode::DOZE_SUSPEND == + static_cast( + ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode:: + DOZE_SUSPEND)); +static_assert( + aidl::android::hardware::graphics::composer3::PowerMode::ON == + static_cast( + ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode::ON)); +static_assert(aidl::android::hardware::graphics::composer3::PowerMode::ON_SUSPEND == + static_cast( + ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode:: + ON_SUSPEND)); + +static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability::INVALID == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient:: + DisplayCapability::INVALID)); +static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability:: + SKIP_CLIENT_COLOR_TRANSFORM == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient:: + DisplayCapability::SKIP_CLIENT_COLOR_TRANSFORM)); +static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability::DOZE == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient:: + DisplayCapability::DOZE)); +static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability::BRIGHTNESS == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient:: + DisplayCapability::BRIGHTNESS)); +static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability::PROTECTED_CONTENTS == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient:: + DisplayCapability::PROTECTED_CONTENTS)); +static_assert( + aidl::android::hardware::graphics::composer3::DisplayCapability::AUTO_LOW_LATENCY_MODE == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::DisplayCapability:: + AUTO_LOW_LATENCY_MODE)); + +static_assert(aidl::android::hardware::graphics::composer3::Command::LENGTH_MASK == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + LENGTH_MASK)); +static_assert(aidl::android::hardware::graphics::composer3::Command::OPCODE_SHIFT == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + OPCODE_SHIFT)); +static_assert(aidl::android::hardware::graphics::composer3::Command::OPCODE_MASK == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + OPCODE_MASK)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SELECT_DISPLAY == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SELECT_DISPLAY)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SELECT_LAYER == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SELECT_LAYER)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_ERROR == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_ERROR)); +static_assert( + aidl::android::hardware::graphics::composer3::Command::SET_CHANGED_COMPOSITION_TYPES == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_CHANGED_COMPOSITION_TYPES)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_DISPLAY_REQUESTS == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_DISPLAY_REQUESTS)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_PRESENT_FENCE == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_PRESENT_FENCE)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_RELEASE_FENCES == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_RELEASE_FENCES)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_COLOR_TRANSFORM == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_COLOR_TRANSFORM)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_CLIENT_TARGET == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_CLIENT_TARGET)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_OUTPUT_BUFFER == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_OUTPUT_BUFFER)); +static_assert(aidl::android::hardware::graphics::composer3::Command::VALIDATE_DISPLAY == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + VALIDATE_DISPLAY)); +static_assert(aidl::android::hardware::graphics::composer3::Command::ACCEPT_DISPLAY_CHANGES == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + ACCEPT_DISPLAY_CHANGES)); +static_assert(aidl::android::hardware::graphics::composer3::Command::PRESENT_DISPLAY == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + PRESENT_DISPLAY)); +static_assert(aidl::android::hardware::graphics::composer3::Command::PRESENT_OR_VALIDATE_DISPLAY == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + PRESENT_OR_VALIDATE_DISPLAY)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_CURSOR_POSITION == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_CURSOR_POSITION)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_BUFFER == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_BUFFER)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_SURFACE_DAMAGE == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_SURFACE_DAMAGE)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_BLEND_MODE == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_BLEND_MODE)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_COLOR == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_COLOR)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_COMPOSITION_TYPE == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_COMPOSITION_TYPE)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_DATASPACE == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_DATASPACE)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_DISPLAY_FRAME == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_DISPLAY_FRAME)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_PLANE_ALPHA == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_PLANE_ALPHA)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_SIDEBAND_STREAM == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_SIDEBAND_STREAM)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_SOURCE_CROP == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_SOURCE_CROP)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_TRANSFORM == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_TRANSFORM)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_VISIBLE_REGION == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_VISIBLE_REGION)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_Z_ORDER == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_Z_ORDER)); +static_assert(aidl::android::hardware::graphics::composer3::Command:: + SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_PER_FRAME_METADATA == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_PER_FRAME_METADATA)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_FLOAT_COLOR == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_FLOAT_COLOR)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_COLOR_TRANSFORM == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_COLOR_TRANSFORM)); +static_assert( + aidl::android::hardware::graphics::composer3::Command::SET_LAYER_PER_FRAME_METADATA_BLOBS == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_PER_FRAME_METADATA_BLOBS)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_CLIENT_TARGET_PROPERTY == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_CLIENT_TARGET_PROPERTY)); +static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_GENERIC_METADATA == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: + SET_LAYER_GENERIC_METADATA)); + +static_assert(aidl::android::hardware::graphics::composer3::DisplayAttribute::INVALID == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute:: + INVALID)); +static_assert( + aidl::android::hardware::graphics::composer3::DisplayAttribute::WIDTH == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::WIDTH)); +static_assert( + aidl::android::hardware::graphics::composer3::DisplayAttribute::HEIGHT == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::HEIGHT)); +static_assert(aidl::android::hardware::graphics::composer3::DisplayAttribute::VSYNC_PERIOD == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute:: + VSYNC_PERIOD)); +static_assert( + aidl::android::hardware::graphics::composer3::DisplayAttribute::DPI_X == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::DPI_X)); +static_assert( + aidl::android::hardware::graphics::composer3::DisplayAttribute::DPI_Y == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::DPI_Y)); +static_assert(aidl::android::hardware::graphics::composer3::DisplayAttribute::CONFIG_GROUP == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute:: + CONFIG_GROUP)); + +static_assert(aidl::android::hardware::graphics::composer3::DisplayConnectionType::INTERNAL == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient:: + DisplayConnectionType::INTERNAL)); +static_assert(aidl::android::hardware::graphics::composer3::DisplayConnectionType::EXTERNAL == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient:: + DisplayConnectionType::EXTERNAL)); + +static_assert( + aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::DISPLAY_RED_PRIMARY_X == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + PerFrameMetadataKey::DISPLAY_RED_PRIMARY_X)); +static_assert( + aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::DISPLAY_RED_PRIMARY_Y == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + PerFrameMetadataKey::DISPLAY_RED_PRIMARY_Y)); +static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey:: + DISPLAY_GREEN_PRIMARY_X == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + PerFrameMetadataKey::DISPLAY_GREEN_PRIMARY_X)); +static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey:: + DISPLAY_GREEN_PRIMARY_Y == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + PerFrameMetadataKey::DISPLAY_GREEN_PRIMARY_Y)); +static_assert( + aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_X == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_X)); +static_assert( + aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_Y == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_Y)); +static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::WHITE_POINT_X == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + PerFrameMetadataKey::WHITE_POINT_X)); +static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::WHITE_POINT_Y == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + PerFrameMetadataKey::WHITE_POINT_Y)); +static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::MAX_LUMINANCE == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + PerFrameMetadataKey::MAX_LUMINANCE)); +static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::MIN_LUMINANCE == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + PerFrameMetadataKey::MIN_LUMINANCE)); +static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey:: + MAX_CONTENT_LIGHT_LEVEL == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + PerFrameMetadataKey::MAX_CONTENT_LIGHT_LEVEL)); +static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey:: + MAX_FRAME_AVERAGE_LIGHT_LEVEL == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + PerFrameMetadataKey::MAX_FRAME_AVERAGE_LIGHT_LEVEL)); +static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::HDR10_PLUS_SEI == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + PerFrameMetadataKey::HDR10_PLUS_SEI)); + +static_assert( + aidl::android::hardware::graphics::composer3::FormatColorComponent::FORMAT_COMPONENT_0 == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + FormatColorComponent::FORMAT_COMPONENT_0)); +static_assert( + aidl::android::hardware::graphics::composer3::FormatColorComponent::FORMAT_COMPONENT_1 == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + FormatColorComponent::FORMAT_COMPONENT_1)); +static_assert( + aidl::android::hardware::graphics::composer3::FormatColorComponent::FORMAT_COMPONENT_2 == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + FormatColorComponent::FORMAT_COMPONENT_2)); +static_assert( + aidl::android::hardware::graphics::composer3::FormatColorComponent::FORMAT_COMPONENT_3 == + static_cast( + ::android::hardware::graphics::composer::V2_3::IComposerClient:: + FormatColorComponent::FORMAT_COMPONENT_3)); + +static_assert( + aidl::android::hardware::graphics::composer3::ContentType::NONE == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType::NONE)); +static_assert(aidl::android::hardware::graphics::composer3::ContentType::GRAPHICS == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType:: + GRAPHICS)); +static_assert(aidl::android::hardware::graphics::composer3::ContentType::PHOTO == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType:: + PHOTO)); +static_assert(aidl::android::hardware::graphics::composer3::ContentType::CINEMA == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType:: + CINEMA)); +static_assert( + aidl::android::hardware::graphics::composer3::ContentType::GAME == + static_cast( + ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType::GAME)); + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_4::VsyncPeriodChangeTimeline& in, + aidl::android::hardware::graphics::composer3::VsyncPeriodChangeTimeline* out) { + out->newVsyncAppliedTimeNanos = static_cast(in.newVsyncAppliedTimeNanos); + out->refreshRequired = static_cast(in.refreshRequired); + out->refreshTimeNanos = static_cast(in.refreshTimeNanos); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_1::IComposerClient::Rect& in, + aidl::android::hardware::graphics::common::Rect* out) { + out->left = static_cast(in.left); + out->top = static_cast(in.top); + out->right = static_cast(in.right); + out->bottom = static_cast(in.bottom); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_1::IComposerClient::FRect& in, + aidl::android::hardware::graphics::common::FRect* out) { + out->left = static_cast(in.left); + out->top = static_cast(in.top); + out->right = static_cast(in.right); + out->bottom = static_cast(in.bottom); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_1::IComposerClient::Color& in, + aidl::android::hardware::graphics::composer3::Color* out) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.r > std::numeric_limits::max() || in.r < 0) { + return false; + } + out->r = static_cast(in.r); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.g > std::numeric_limits::max() || in.g < 0) { + return false; + } + out->g = static_cast(in.g); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.b > std::numeric_limits::max() || in.b < 0) { + return false; + } + out->b = static_cast(in.b); + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit + // your needs. + if (in.a > std::numeric_limits::max() || in.a < 0) { + return false; + } + out->a = static_cast(in.a); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_3::IComposerClient::PerFrameMetadata& in, + aidl::android::hardware::graphics::composer3::PerFrameMetadata* out) { + out->key = + static_cast(in.key); + out->value = static_cast(in.value); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_2::IComposerClient::FloatColor& in, + aidl::android::hardware::graphics::composer3::FloatColor* out) { + out->r = static_cast(in.r); + out->g = static_cast(in.g); + out->b = static_cast(in.b); + out->a = static_cast(in.a); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_3::IComposerClient::PerFrameMetadataBlob& + in, + aidl::android::hardware::graphics::composer3::PerFrameMetadataBlob* out) { + out->key = + static_cast(in.key); + { + size_t size = in.blob.size(); + for (size_t i = 0; i < size; i++) { + // FIXME This requires conversion between signed and unsigned. Change this if it doesn't + // suit your needs. + if (in.blob[i] > std::numeric_limits::max() || in.blob[i] < 0) { + return false; + } + out->blob.push_back(static_cast(in.blob[i])); + } + } + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_4::IComposerClient:: + VsyncPeriodChangeConstraints& in, + aidl::android::hardware::graphics::composer3::VsyncPeriodChangeConstraints* out) { + out->desiredTimeNanos = static_cast(in.desiredTimeNanos); + out->seamlessRequired = static_cast(in.seamlessRequired); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_4::IComposerClient::ClientTargetProperty& + in, + aidl::android::hardware::graphics::composer3::ClientTargetProperty* out) { + out->pixelFormat = + static_cast(in.pixelFormat); + out->dataspace = + static_cast(in.dataspace); + return true; +} + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_4::IComposerClient:: + LayerGenericMetadataKey& in, + aidl::android::hardware::graphics::composer3::LayerGenericMetadataKey* out) { + out->name = in.name; + out->mandatory = static_cast(in.mandatory); + return true; +} + +} // namespace android::h2a \ No newline at end of file diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h new file mode 100644 index 0000000000..c892863d0b --- /dev/null +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h @@ -0,0 +1,90 @@ +/** + * 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 +#include "aidl/android/hardware/graphics/common/FRect.h" +#include "aidl/android/hardware/graphics/common/Rect.h" +#include "aidl/android/hardware/graphics/composer3/BlendMode.h" +#include "aidl/android/hardware/graphics/composer3/Capability.h" +#include "aidl/android/hardware/graphics/composer3/ClientTargetProperty.h" +#include "aidl/android/hardware/graphics/composer3/Color.h" +#include "aidl/android/hardware/graphics/composer3/Command.h" +#include "aidl/android/hardware/graphics/composer3/Composition.h" +#include "aidl/android/hardware/graphics/composer3/ContentType.h" +#include "aidl/android/hardware/graphics/composer3/DisplayAttribute.h" +#include "aidl/android/hardware/graphics/composer3/DisplayCapability.h" +#include "aidl/android/hardware/graphics/composer3/DisplayConnectionType.h" +#include "aidl/android/hardware/graphics/composer3/DisplayRequest.h" +#include "aidl/android/hardware/graphics/composer3/FloatColor.h" +#include "aidl/android/hardware/graphics/composer3/FormatColorComponent.h" +#include "aidl/android/hardware/graphics/composer3/HandleIndex.h" +#include "aidl/android/hardware/graphics/composer3/IComposer.h" +#include "aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.h" +#include "aidl/android/hardware/graphics/composer3/LayerRequest.h" +#include "aidl/android/hardware/graphics/composer3/PerFrameMetadata.h" +#include "aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h" +#include "aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.h" +#include "aidl/android/hardware/graphics/composer3/PowerMode.h" +#include "aidl/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.h" +#include "aidl/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.h" +#include "android/hardware/graphics/composer/2.1/IComposer.h" +#include "android/hardware/graphics/composer/2.1/IComposerCallback.h" +#include "android/hardware/graphics/composer/2.1/IComposerClient.h" +#include "android/hardware/graphics/composer/2.2/IComposerClient.h" +#include "android/hardware/graphics/composer/2.3/IComposerClient.h" +#include "android/hardware/graphics/composer/2.4/IComposerClient.h" +#include "android/hardware/graphics/composer/2.4/types.h" + +namespace android::h2a { + +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_4::VsyncPeriodChangeTimeline& in, + aidl::android::hardware::graphics::composer3::VsyncPeriodChangeTimeline* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_1::IComposerClient::Rect& in, + aidl::android::hardware::graphics::common::Rect* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_1::IComposerClient::FRect& in, + aidl::android::hardware::graphics::common::FRect* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_1::IComposerClient::Color& in, + aidl::android::hardware::graphics::composer3::Color* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_3::IComposerClient::PerFrameMetadata& in, + aidl::android::hardware::graphics::composer3::PerFrameMetadata* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_2::IComposerClient::FloatColor& in, + aidl::android::hardware::graphics::composer3::FloatColor* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_3::IComposerClient::PerFrameMetadataBlob& + in, + aidl::android::hardware::graphics::composer3::PerFrameMetadataBlob* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_4::IComposerClient:: + VsyncPeriodChangeConstraints& in, + aidl::android::hardware::graphics::composer3::VsyncPeriodChangeConstraints* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_4::IComposerClient::ClientTargetProperty& + in, + aidl::android::hardware::graphics::composer3::ClientTargetProperty* out); +__attribute__((warn_unused_result)) bool translate( + const ::android::hardware::graphics::composer::V2_4::IComposerClient:: + LayerGenericMetadataKey& in, + aidl::android::hardware::graphics::composer3::LayerGenericMetadataKey* out); + +} // namespace android::h2a diff --git a/graphics/mapper/4.0/vts/functional/Android.bp b/graphics/mapper/4.0/vts/functional/Android.bp index 032bc0f741..65bc38029d 100644 --- a/graphics/mapper/4.0/vts/functional/Android.bp +++ b/graphics/mapper/4.0/vts/functional/Android.bp @@ -28,7 +28,7 @@ cc_test { defaults: ["VtsHalTargetTestDefaults"], srcs: ["VtsHalGraphicsMapperV4_0TargetTest.cpp"], static_libs: [ - "android.hardware.graphics.common-V2-ndk", + "android.hardware.graphics.common-V3-ndk", "android.hardware.graphics.mapper@4.0-vts", "libgralloctypes", "libsync", diff --git a/neuralnetworks/aidl/Android.bp b/neuralnetworks/aidl/Android.bp index 3a69936541..a31157acf1 100644 --- a/neuralnetworks/aidl/Android.bp +++ b/neuralnetworks/aidl/Android.bp @@ -17,7 +17,7 @@ aidl_interface { stability: "vintf", imports: [ "android.hardware.common-V2", - "android.hardware.graphics.common-V2", + "android.hardware.graphics.common-V3", ], backend: { java: { diff --git a/neuralnetworks/aidl/utils/Android.bp b/neuralnetworks/aidl/utils/Android.bp index 508b1eafec..3c80d75b64 100644 --- a/neuralnetworks/aidl/utils/Android.bp +++ b/neuralnetworks/aidl/utils/Android.bp @@ -31,7 +31,7 @@ cc_library_static { export_include_dirs: ["include"], cflags: ["-Wthread-safety"], static_libs: [ - "android.hardware.graphics.common-V2-ndk", + "android.hardware.graphics.common-V3-ndk", "libaidlcommonsupport", "libarect", "neuralnetworks_types", @@ -57,7 +57,7 @@ cc_test { ], static_libs: [ "android.hardware.common-V2-ndk", - "android.hardware.graphics.common-V2-ndk", + "android.hardware.graphics.common-V3-ndk", "android.hardware.neuralnetworks-V1-ndk", "libaidlcommonsupport", "libgmock", diff --git a/neuralnetworks/aidl/vts/functional/Android.bp b/neuralnetworks/aidl/vts/functional/Android.bp index 8fa9756edb..40da1fd36a 100644 --- a/neuralnetworks/aidl/vts/functional/Android.bp +++ b/neuralnetworks/aidl/vts/functional/Android.bp @@ -50,7 +50,7 @@ cc_test { ], static_libs: [ "android.hardware.common-V2-ndk", - "android.hardware.graphics.common-V2-ndk", + "android.hardware.graphics.common-V3-ndk", "android.hardware.neuralnetworks-V1-ndk", "android.hidl.allocator@1.0", "android.hidl.memory@1.0", -- GitLab From c484e5b62731d88f0c543c8878ed5c4d67949a42 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Fri, 24 Sep 2021 15:18:20 +0800 Subject: [PATCH 149/825] p2p: skip p2p test if p2p is not supported Bug: 200064365 Test: atest VtsHalWifiSupplicantP2pV1_4TargetTest Change-Id: Id35b36108a012ca1adace7c6ce87ec31813fba91 --- .../1.4/vts/functional/supplicant_p2p_iface_hidl_test.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wifi/supplicant/1.4/vts/functional/supplicant_p2p_iface_hidl_test.cpp b/wifi/supplicant/1.4/vts/functional/supplicant_p2p_iface_hidl_test.cpp index 4427c390c4..d68520ace9 100644 --- a/wifi/supplicant/1.4/vts/functional/supplicant_p2p_iface_hidl_test.cpp +++ b/wifi/supplicant/1.4/vts/functional/supplicant_p2p_iface_hidl_test.cpp @@ -49,6 +49,9 @@ class SupplicantP2pIfaceHidlTest : public SupplicantHidlTestBaseV1_4 { public: virtual void SetUp() override { SupplicantHidlTestBaseV1_4::SetUp(); + if (!isP2pOn_) { + GTEST_SKIP() << "Wi-Fi Direct is not supported, skip this test."; + } p2p_iface_ = getSupplicantP2pIface_1_4(supplicant_); ASSERT_NE(p2p_iface_.get(), nullptr); } -- GitLab From 23a84dd8d67232917c851d834621a4231348becc Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 9 Sep 2021 14:54:20 -0700 Subject: [PATCH 150/825] Add VHAL AIDL v1 service. Test: Local build. Bug: 198664004 Change-Id: Ifd8b15d85865f360f9cce7b35bc2114f4478682c --- .../utils/common/include/VehicleHalTypes.h | 1 + automotive/vehicle/aidl/impl/vhal/Android.bp | 30 +++++++ .../impl/vhal/include/DefaultVehicleHal.h | 66 ++++++++++++++++ .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 78 +++++++++++++++++++ .../aidl/impl/vhal/src/VehicleService.cpp | 51 ++++++++++++ .../aidl/impl/vhal/vhal-default-service.rc | 4 + .../aidl/impl/vhal/vhal-default-service.xml | 11 +++ 7 files changed, 241 insertions(+) create mode 100644 automotive/vehicle/aidl/impl/vhal/Android.bp create mode 100644 automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h create mode 100644 automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp create mode 100644 automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp create mode 100644 automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc create mode 100644 automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index a8f5ec72dc..99f64313b0 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp new file mode 100644 index 0000000000..0a2dc64fec --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/Android.bp @@ -0,0 +1,30 @@ +// 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. + +cc_binary { + name: "android.hardware.automotive.vehicle-aidl-default-service", + defaults: ["VehicleHalDefaults"], + local_include_dirs: ["include"], + vintf_fragments: ["vhal-default-service.xml"], + init_rc: ["vhal-default-service.rc"], + vendor: true, + relative_install_path: "hw", + srcs: ["src/*.cpp"], + static_libs: [ + "VehicleHalUtils", + ], + shared_libs: [ + "libbinder_ndk", + ], +} diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h new file mode 100644 index 0000000000..49c501e4b2 --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -0,0 +1,66 @@ +/* + * 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_aidl_impl_vhal_include_DefaultVehicleHal_H_ +#define android_hardware_automotive_vehicle_aidl_impl_vhal_include_DefaultVehicleHal_H_ + +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::vehicle::BnVehicle { + ::ndk::ScopedAStatus getAllPropConfigs( + ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs) + override; + ::ndk::ScopedAStatus getValues( + const std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>& + callback, + const ::aidl::android::hardware::automotive::vehicle::GetValueRequests& requests) + override; + ::ndk::ScopedAStatus setValues( + const std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>& + callback, + const ::aidl::android::hardware::automotive::vehicle::SetValueRequests& requests) + override; + ::ndk::ScopedAStatus getPropConfigs( + const std::vector& props, + ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs) + override; + ::ndk::ScopedAStatus subscribe( + const std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>& + callback, + const std::vector<::aidl::android::hardware::automotive::vehicle::SubscribeOptions>& + options, + int32_t maxSharedMemoryFileCount) override; + ::ndk::ScopedAStatus unsubscribe( + const std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>& + callback, + const std::vector& propIds) override; + ::ndk::ScopedAStatus returnSharedMemory( + const std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>& + callback, + int64_t sharedMemoryId) override; +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_aidl_impl_vhal_include_DefaultVehicleHal_H_ diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp new file mode 100644 index 0000000000..5a31643ba6 --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -0,0 +1,78 @@ +/* + * 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. + */ + +#define LOG_TAG "DefaultVehicleHal" + +#include + +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +using ::aidl::android::hardware::automotive::vehicle::GetValueRequests; +using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback; +using ::aidl::android::hardware::automotive::vehicle::SetValueRequests; +using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs; +using ::ndk::ScopedAStatus; + +ScopedAStatus DefaultVehicleHal::getAllPropConfigs(VehiclePropConfigs*) { + // TODO(b/200737967): implement this. + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultVehicleHal::getValues(const std::shared_ptr&, + const GetValueRequests&) { + // TODO(b/200737967): implement this. + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultVehicleHal::setValues(const std::shared_ptr&, + const SetValueRequests&) { + // TODO(b/200737967): implement this. + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultVehicleHal::getPropConfigs(const std::vector&, VehiclePropConfigs*) { + // TODO(b/200737967): implement this. + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultVehicleHal::subscribe(const std::shared_ptr&, + const std::vector&, int32_t) { + // TODO(b/200737967): implement this. + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultVehicleHal::unsubscribe(const std::shared_ptr&, + const std::vector&) { + // TODO(b/200737967): implement this. + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultVehicleHal::returnSharedMemory(const std::shared_ptr&, + int64_t) { + // TODO(b/200737967): implement this. + return ScopedAStatus::ok(); +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp b/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp new file mode 100644 index 0000000000..7c623ea837 --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp @@ -0,0 +1,51 @@ +/* + * 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. + */ + +#define LOG_TAG "VehicleService" + +#include + +#include +#include +#include + +using ::android::hardware::automotive::vehicle::DefaultVehicleHal; + +int main(int /* argc */, char* /* argv */[]) { + std::shared_ptr vhal = ndk::SharedRefBase::make(); + + ALOGI("Registering as service..."); + binder_exception_t err = AServiceManager_addService(vhal->asBinder().get(), + "android.hardware.automotive.vehicle"); + if (err != EX_NONE) { + ALOGE("failed to register android.hardware.automotive.vehicle service, exception: %d", err); + return 1; + } + + if (!ABinderProcess_setThreadPoolMaxThreadCount(4)) { + ALOGE("%s", "failed to set thread pool max thread count"); + return 1; + } + ABinderProcess_startThreadPool(); + + ALOGI("Vehicle Service Ready"); + + ABinderProcess_joinThreadPool(); + + ALOGI("Vehicle Service Exiting"); + + return 0; +} diff --git a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc new file mode 100644 index 0000000000..4c8865a16f --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc @@ -0,0 +1,4 @@ +service vendor.vehicle-hal-default /vendor/bin/hw/android.hardware.automotive.vehicle-aidl-default-service + class early_hal + user vehicle_network + group system inet diff --git a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml new file mode 100644 index 0000000000..8d237b8203 --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml @@ -0,0 +1,11 @@ + + + android.hardware.automotive.vehicle + hwbinder + 1 + + IVehicle + default + + + -- GitLab From 2f244076ff5cbca3e2a4cdb4132f0fc167e7bec9 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Mon, 27 Sep 2021 14:31:49 -0700 Subject: [PATCH 151/825] [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces Added SPDX-license-identifier-Apache-2.0 to: automotive/vehicle/aidl/impl/vhal/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Change-Id: Ic1778822784ec32904d235fe6677ef4f2711c2c4 --- automotive/vehicle/aidl/impl/vhal/Android.bp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp index 0a2dc64fec..0704107bfc 100644 --- a/automotive/vehicle/aidl/impl/vhal/Android.bp +++ b/automotive/vehicle/aidl/impl/vhal/Android.bp @@ -12,6 +12,15 @@ // 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.automotive.vehicle-aidl-default-service", defaults: ["VehicleHalDefaults"], -- GitLab From eb766523f21cbae6ead551350ccc3cbb22612589 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 27 Sep 2021 15:15:46 -0700 Subject: [PATCH 152/825] Change unit test suites to device tests. Since VHAL is not supposed to run on all devices, only auto targets, we change the test suites to device-tests. This also prevents the unit tests to be run against an incompatible version of vendor image, which causes test breakage. Bug: 201009483 Test: presubmits Change-Id: I8878ce6f8200dbc4a3247258f835e980fbaa2028 --- automotive/vehicle/aidl/aidl_test/Android.bp | 2 +- automotive/vehicle/aidl/impl/default_config/test/Android.bp | 2 +- automotive/vehicle/aidl/impl/utils/common/test/Android.bp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/automotive/vehicle/aidl/aidl_test/Android.bp b/automotive/vehicle/aidl/aidl_test/Android.bp index 4337ac74e9..5284a0a8e1 100644 --- a/automotive/vehicle/aidl/aidl_test/Android.bp +++ b/automotive/vehicle/aidl/aidl_test/Android.bp @@ -32,6 +32,6 @@ cc_test { "libgmock", ], defaults: ["VehicleHalDefaults"], - test_suites: ["general-tests"], + test_suites: ["device-tests"], vendor: true, } diff --git a/automotive/vehicle/aidl/impl/default_config/test/Android.bp b/automotive/vehicle/aidl/impl/default_config/test/Android.bp index 7ea4ca7f51..771472c8c1 100644 --- a/automotive/vehicle/aidl/impl/default_config/test/Android.bp +++ b/automotive/vehicle/aidl/impl/default_config/test/Android.bp @@ -30,5 +30,5 @@ cc_test { header_libs: [ "VehicleHalDefaultConfig", ], - test_suites: ["general-tests"], + test_suites: ["device-tests"], } diff --git a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp index 65b0e4685c..dd43712558 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp +++ b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp @@ -28,5 +28,5 @@ cc_test { "libgmock", ], defaults: ["VehicleHalDefaults"], - test_suites: ["general-tests"], + test_suites: ["device-tests"], } -- GitLab From 9073f557229f1c38a98530c850d7baf424e88bd4 Mon Sep 17 00:00:00 2001 From: Rambo Wang Date: Thu, 23 Sep 2021 16:09:59 -0700 Subject: [PATCH 153/825] Support multiple RANs in one request for setSignalStrengthReportingCriteria - Move AccessNetwork (RAN) into SignalThresholdInfo to be better organized - Support specifying multiple RANs and measurement types in one request Bug: 200055871 Test: m -j Change-Id: Ic6762e8ca488a119b1103319e7443c4342530f8c --- .../hardware/radio/network/IRadioNetwork.aidl | 2 +- .../radio/network/SignalThresholdInfo.aidl | 1 + .../hardware/radio/network/IRadioNetwork.aidl | 33 ++++++++----------- .../radio/network/SignalThresholdInfo.aidl | 20 +++++++---- 4 files changed, 29 insertions(+), 27 deletions(-) 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 8131007348..bfb806123b 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 @@ -64,7 +64,7 @@ interface IRadioNetwork { oneway void setNetworkSelectionModeManual(in int serial, in String operatorNumeric, in android.hardware.radio.AccessNetwork ran); oneway void setNrDualConnectivityState(in int serial, in android.hardware.radio.network.NrDualConnectivityState nrDualConnectivityState); oneway void setResponseFunctions(in android.hardware.radio.network.IRadioNetworkResponse radioNetworkResponse, in android.hardware.radio.network.IRadioNetworkIndication radioNetworkIndication); - oneway void setSignalStrengthReportingCriteria(in int serial, in android.hardware.radio.network.SignalThresholdInfo signalThresholdInfo, in android.hardware.radio.AccessNetwork accessNetwork); + oneway void setSignalStrengthReportingCriteria(in int serial, in android.hardware.radio.network.SignalThresholdInfo[] signalThresholdInfos); oneway void setSuppServiceNotifications(in int serial, in boolean enable); oneway void setSystemSelectionChannels(in int serial, in boolean specifyChannels, in android.hardware.radio.network.RadioAccessSpecifier[] specifiers); oneway void startNetworkScan(in int serial, in android.hardware.radio.network.NetworkScanRequest request); 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 3ea6c4e5db..159d9c1547 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 @@ -39,6 +39,7 @@ parcelable SignalThresholdInfo { int hysteresisDb; int[] thresholds; boolean isEnabled; + android.hardware.radio.AccessNetwork ran; const int SIGNAL_MEASUREMENT_TYPE_RSSI = 1; const int SIGNAL_MEASUREMENT_TYPE_RSCP = 2; const int SIGNAL_MEASUREMENT_TYPE_RSRP = 3; diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl index 0db918d8f5..ffc97f31c7 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl @@ -364,29 +364,22 @@ oneway interface IRadioNetwork { in IRadioNetworkIndication radioNetworkIndication); /** - * Sets the signal strength reporting criteria. The resulting reporting rules are the AND of all - * the supplied criteria. For each RAN the hysteresisDb and thresholds apply to only the - * following measured quantities: - * -GERAN - RSSI - * -CDMA2000 - RSSI - * -UTRAN - RSCP - * -EUTRAN - RSRP/RSRQ/RSSNR - * -NGRAN - SSRSRP/SSRSRQ/SSSINR - * Note that reporting criteria must be individually set for each RAN. For each RAN, if none of - * reporting criteria of any measurement is set enabled (see SignalThresholdInfo.isEnabled), - * the reporting criteria for this RAN is implementation-defined. For each RAN, if any reporting - * criteria of any measure is set enabled, the reporting criteria of the other measures in this - * RAN are set disabled (see SignalThresholdInfo.isEnabled) until they are set enabled. - * - * @param serial Serial number of request. - * @param signalThresholdInfo Signal threshold info including the threshold values, - * hysteresisDb, hysteresisMs and isEnabled. See SignalThresholdInfo for details. - * @param accessNetwork The type of network for which to apply these thresholds. + * Sets or clears the signal strength reporting criteria for multiple RANs in one request. + * + * The reporting criteria are set individually for each combination of RAN and measurement type. + * For each RAN type, if no reporting criteria are set, then the reporting of SignalStrength for + * that RAN is implementation-defined. If any criteria are supplied for a RAN type, then + * SignalStrength is only reported as specified by those criteria. For any RAN types not defined + * by this HAL, reporting is implementation-defined. + * + * @param serial Serial number of request. + * @param signalThresholdInfos Collection of SignalThresholdInfo specifying the reporting + * criteria. See SignalThresholdInfo for details. * * Response function is IRadioNetworkResponse.setSignalStrengthReportingCriteriaResponse() */ - void setSignalStrengthReportingCriteria(in int serial, - in SignalThresholdInfo signalThresholdInfo, in AccessNetwork accessNetwork); + void setSignalStrengthReportingCriteria( + in int serial, in SignalThresholdInfo[] signalThresholdInfos); /** * Enables/disables supplementary service related notifications from the network. diff --git a/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl b/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl index 696292dc14..584ea38222 100644 --- a/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl @@ -16,6 +16,8 @@ package android.hardware.radio.network; +import android.hardware.radio.AccessNetwork; + /** * Contains the threshold values of each signal measurement type. */ @@ -86,18 +88,20 @@ parcelable SignalThresholdInfo { */ int signalMeasurement; /** - * A hysteresis time in milliseconds to prevent flapping. A value of 0 disables hysteresis. + * A hysteresis time in milliseconds for current signal measurement type to prevent flapping. + * A value of 0 disables hysteresis. */ int hysteresisMs; /** - * An interval in dB defining the required magnitude change between reports. This must be - * smaller than the smallest threshold delta. An interval value of 0 disables hysteresis. + * An interval in dB for current signal measurement type defining the required magnitude change + * between reports. This must be smaller than the smallest threshold delta. An interval value of + * 0 disables hysteresis. */ int hysteresisDb; /** - * List of threshold values. Range and unit must reference specific SignalMeasurementType. - * The threshold values for which to apply criteria. A vector size of 0 disables the use of - * thresholds for reporting. + * List of threshold values for current signal measurement type. Range and unit must reference + * specific SignalMeasurementType. The threshold values for which to apply criteria. A vector + * size of 0 disables the use of thresholds for reporting. */ int[] thresholds; /** @@ -106,4 +110,8 @@ parcelable SignalThresholdInfo { * If disabled, modem must not trigger the report based on the criteria. */ boolean isEnabled; + /** + * The Radio Access Network for current threshold info. + */ + AccessNetwork ran; } -- GitLab From c0653a4452e34065c25442189784f205db3519b3 Mon Sep 17 00:00:00 2001 From: Tyler Trephan Date: Tue, 28 Sep 2021 18:22:04 +0000 Subject: [PATCH 154/825] Updated WHEEL_TICK configArray documentation in VHAL. It now specifies that the micrometers-per-wheel-tick values are static and approximations. Test: None Bug: 169364681 Change-Id: Ia002bdcf7c9a91d82d8f6d543d2476d227256046 --- automotive/vehicle/2.0/types.hal | 7 +++++-- current.txt | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal index b964991b9c..7c8e1f5bd8 100644 --- a/automotive/vehicle/2.0/types.hal +++ b/automotive/vehicle/2.0/types.hal @@ -487,8 +487,11 @@ enum VehicleProperty : int32_t { * int64Values[3] = rear right ticks * int64Values[4] = rear left ticks * - * configArray is used to indicate the micrometers-per-wheel-tick value and - * which wheels are supported. configArray is set as follows: + * configArray is used to indicate the micrometers-per-wheel-tick values and + * which wheels are supported. Each micrometers-per-wheel-tick value is static (i.e. will not + * update based on wheel's status) and a best approximation. For example, if a vehicle has + * multiple rim/tire size options, the micrometers-per-wheel-tick values are set to those for + * the typically expected rim/tire size. configArray is set as follows: * * configArray[0], bits [0:3] = supported wheels. Uses enum Wheel. * configArray[1] = micrometers per front left wheel tick diff --git a/current.txt b/current.txt index e1c78f60e6..907a3b38dc 100644 --- a/current.txt +++ b/current.txt @@ -899,6 +899,7 @@ c8a57364f6ad20842be14f4db284df5304f7521ca8eac6bcc1fa6c5b466fb8a6 android.hardwar 2123482b69f3b531c88023aa2a007110e130efbf4ed68ac9ce0bc55d5e82bc8b android.hardware.wifi.supplicant@1.4::ISupplicantStaNetworkCallback 0821f516e4d428bc15251969f7e19411c94d8f2ccbd99e1fc8168d8e49e38b0f android.hardware.wifi.supplicant@1.4::types 4a087a308608d146b022ebc15633de989f5f4dfe1491a83fa41763290a82e40d android.hardware.automotive.vehicle@2.0::types +70eb14415391f835fb218b43a1e25f5d6495f098f96fa2acaea70985e98e1ce8 android.hardware.automotive.vehicle@2.0::types # ABI preserving changes to HALs during Android T 62ace52d9c3ff1f60f94118557a2aaf0b953513e59dcd34d5f94ae28d4c7e780 android.hardware.fastboot@1.0::IFastboot -- GitLab From 3a75dc0cf007c487ae63cacec21fa6d39a33c050 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Mon, 27 Sep 2021 01:01:06 -0700 Subject: [PATCH 155/825] Add GnssBatching AIDL HAL (hardware/interfaces) Bug: 201253590 Test: atest VtsHalGnssTargetTest Change-Id: Ied71c609dff714de06e2792f51d54a2dbddbb9d8 --- .../compatibility_matrix.current.xml | 1 + gnss/1.1/default/Android.bp | 2 +- gnss/2.0/default/Android.bp | 2 +- gnss/2.1/default/Android.bp | 2 +- .../android/hardware/gnss/GnssLocation.aidl | 57 ++++++++ .../current/android/hardware/gnss/IGnss.aidl | 3 +- .../android/hardware/gnss/IGnssBatching.aidl | 44 ++++++ .../hardware/gnss/IGnssBatchingCallback.aidl | 38 ++++++ .../android/hardware/gnss/GnssLocation.aidl | 91 ++++++++++++ gnss/aidl/android/hardware/gnss/IGnss.aidl | 17 ++- .../android/hardware/gnss/IGnssBatching.aidl | 116 ++++++++++++++++ .../hardware/gnss/IGnssBatchingCallback.aidl | 36 +++++ gnss/aidl/default/Android.bp | 3 +- gnss/aidl/default/Gnss.cpp | 8 ++ gnss/aidl/default/Gnss.h | 3 + gnss/aidl/default/GnssBatching.cpp | 129 ++++++++++++++++++ gnss/aidl/default/GnssBatching.h | 53 +++++++ gnss/aidl/default/gnss-default.xml | 1 + gnss/aidl/vts/Android.bp | 3 +- gnss/aidl/vts/GnssBatchingCallback.cpp | 31 +++++ gnss/aidl/vts/GnssBatchingCallback.h | 36 +++++ gnss/aidl/vts/gnss_hal_test.h | 1 + gnss/aidl/vts/gnss_hal_test_cases.cpp | 26 ++++ gnss/common/utils/default/Android.bp | 2 +- gnss/common/utils/default/Utils.cpp | 25 ++++ gnss/common/utils/default/include/Utils.h | 2 + gnss/common/utils/vts/Utils.cpp | 73 +++++----- gnss/common/utils/vts/include/Utils.h | 26 +--- 28 files changed, 762 insertions(+), 69 deletions(-) create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssLocation.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatching.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatchingCallback.aidl create mode 100644 gnss/aidl/android/hardware/gnss/GnssLocation.aidl create mode 100644 gnss/aidl/android/hardware/gnss/IGnssBatching.aidl create mode 100644 gnss/aidl/android/hardware/gnss/IGnssBatchingCallback.aidl create mode 100644 gnss/aidl/default/GnssBatching.cpp create mode 100644 gnss/aidl/default/GnssBatching.h create mode 100644 gnss/aidl/vts/GnssBatchingCallback.cpp create mode 100644 gnss/aidl/vts/GnssBatchingCallback.h diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 7a49a4bda4..f0cdd1372c 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -247,6 +247,7 @@ android.hardware.gnss + 2 IGnss default diff --git a/gnss/1.1/default/Android.bp b/gnss/1.1/default/Android.bp index 3c9c29a7d6..a73182edb6 100644 --- a/gnss/1.1/default/Android.bp +++ b/gnss/1.1/default/Android.bp @@ -27,7 +27,7 @@ cc_binary { "android.hardware.gnss@2.0", "android.hardware.gnss@1.1", "android.hardware.gnss@1.0", - "android.hardware.gnss-V1-ndk", + "android.hardware.gnss-V2-ndk", ], static_libs: [ "android.hardware.gnss@common-default-lib", diff --git a/gnss/2.0/default/Android.bp b/gnss/2.0/default/Android.bp index 695246ad53..769e8ae167 100644 --- a/gnss/2.0/default/Android.bp +++ b/gnss/2.0/default/Android.bp @@ -50,7 +50,7 @@ cc_binary { "android.hardware.gnss@2.0", "android.hardware.gnss@1.1", "android.hardware.gnss@1.0", - "android.hardware.gnss-V1-ndk", + "android.hardware.gnss-V2-ndk", ], static_libs: [ "android.hardware.gnss@common-default-lib", diff --git a/gnss/2.1/default/Android.bp b/gnss/2.1/default/Android.bp index c46c73545c..2979f5c9b7 100644 --- a/gnss/2.1/default/Android.bp +++ b/gnss/2.1/default/Android.bp @@ -44,7 +44,7 @@ cc_binary { "android.hardware.gnss@1.0", "android.hardware.gnss@1.1", "android.hardware.gnss@2.0", - "android.hardware.gnss-V1-ndk", + "android.hardware.gnss-V2-ndk", ], static_libs: [ "android.hardware.gnss@common-default-lib", 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 new file mode 100644 index 0000000000..54c126c281 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssLocation.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 -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.gnss; +@VintfStability +parcelable GnssLocation { + int gnssLocationFlags; + double latitudeDegrees; + double longitudeDegrees; + double altitudeMeters; + double speedMetersPerSec; + double bearingDegrees; + double horizontalAccuracyMeters; + double verticalAccuracyMeters; + double speedAccuracyMetersPerSecond; + 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; +} 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 f93b496cdd..52276b4279 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 @@ -36,10 +36,11 @@ package android.hardware.gnss; interface IGnss { void setCallback(in android.hardware.gnss.IGnssCallback callback); void close(); - android.hardware.gnss.IGnssPsds getExtensionPsds(); + @nullable android.hardware.gnss.IGnssPsds getExtensionPsds(); android.hardware.gnss.IGnssConfiguration getExtensionGnssConfiguration(); android.hardware.gnss.IGnssMeasurementInterface getExtensionGnssMeasurement(); android.hardware.gnss.IGnssPowerIndication getExtensionGnssPowerIndication(); + @nullable android.hardware.gnss.IGnssBatching getExtensionGnssBatching(); const int ERROR_INVALID_ARGUMENT = 1; const int ERROR_ALREADY_INIT = 2; const int ERROR_GENERIC = 3; 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 new file mode 100644 index 0000000000..492edc3161 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatching.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 -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.gnss; +@VintfStability +interface IGnssBatching { + void init(in android.hardware.gnss.IGnssBatchingCallback callback); + int getBatchSize(); + void start(in long periodNanos, in int flags); + void flush(); + void stop(); + void cleanup(); + const int WAKEUP_ON_FIFO_FULL = 1; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatchingCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatchingCallback.aidl new file mode 100644 index 0000000000..427137ab26 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatchingCallback.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 -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.gnss; +@VintfStability +interface IGnssBatchingCallback { + void gnssLocationBatchCb(in android.hardware.gnss.GnssLocation[] locations); +} diff --git a/gnss/aidl/android/hardware/gnss/GnssLocation.aidl b/gnss/aidl/android/hardware/gnss/GnssLocation.aidl new file mode 100644 index 0000000000..25aea4d850 --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/GnssLocation.aidl @@ -0,0 +1,91 @@ +/* + * 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. + */ + +package android.hardware.gnss; + +import android.hardware.gnss.ElapsedRealtime; + +/** Represents a location. */ +@VintfStability +parcelable GnssLocation { + /** Bit mask to indicate GnssLocation has valid latitude and longitude. */ + const int HAS_LAT_LONG = 0x0001; + /** Bit mask to indicate GnssLocation has valid altitude. */ + const int HAS_ALTITUDE = 0x0002; + /** Bit mask to indicate GnssLocation has valid speed. */ + const int HAS_SPEED = 0x0004; + /** Bit mask to indicate GnssLocation has valid bearing. */ + const int HAS_BEARING = 0x0008; + /** Bit mask to indicate GnssLocation has valid horizontal accuracy. */ + const int HAS_HORIZONTAL_ACCURACY = 0x0010; + /** Bit mask to indicate GnssLocation has valid vertical accuracy. */ + const int HAS_VERTICAL_ACCURACY = 0x0020; + /** Bit mask to indicate GnssLocation has valid speed accuracy. */ + const int HAS_SPEED_ACCURACY = 0x0040; + /** Bit mask to indicate GnssLocation has valid bearing accuracy. */ + const int HAS_BEARING_ACCURACY = 0x0080; + + /** A bit field of flags indicating the validity of the fields in this GnssLocation. */ + int gnssLocationFlags; + + /** Represents latitude in degrees. */ + double latitudeDegrees; + + /** Represents longitude in degrees. */ + double longitudeDegrees; + + /** Represents altitude in meters above the WGS 84 reference ellipsoid. */ + double altitudeMeters; + + /** Represents speed in meters per second. */ + double speedMetersPerSec; + + /** Represents heading in degrees. */ + double bearingDegrees; + + /** + * Represents expected horizontal position accuracy, radial, in meters (68% confidence). + */ + double horizontalAccuracyMeters; + + /** + * Represents expected vertical position accuracy in meters (68% confidence). + */ + double verticalAccuracyMeters; + + /** + * Represents expected speed accuracy in meter per seconds (68% confidence). + */ + double speedAccuracyMetersPerSecond; + + /** + * Represents expected bearing accuracy in degrees (68% confidence). + */ + double bearingAccuracyDegrees; + + /** Timestamp for the location fix in milliseconds since January 1, 1970. */ + long timestampMillis; + + /** + * Timing information of the GNSS location synchronized with SystemClock.elapsedRealtimeNanos() + * clock. + * + * This clock information can be obtained from SystemClock.elapsedRealtimeNanos(), when the GNSS + * is attached straight to the AP/SOC. When it is attached to a separate module the timestamp + * needs to be estimated by syncing the notion of time via PTP or some other mechanism. + */ + ElapsedRealtime elapsedRealtime; +} diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl index f99b512c5f..b12fb825ed 100644 --- a/gnss/aidl/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl @@ -16,6 +16,7 @@ package android.hardware.gnss; +import android.hardware.gnss.IGnssBatching; import android.hardware.gnss.IGnssCallback; import android.hardware.gnss.IGnssConfiguration; import android.hardware.gnss.IGnssMeasurementInterface; @@ -27,9 +28,8 @@ import android.hardware.gnss.IGnssPsds; */ @VintfStability interface IGnss { - /** - * All GNSS Binder calls may return a ServiceSpecificException with the following error + * All GNSS binder calls may return a ServiceSpecificException with the following error * codes. */ const int ERROR_INVALID_ARGUMENT = 1; @@ -73,11 +73,9 @@ interface IGnss { /** * This method returns the IGnssPsds interface. * - * This method must return non-null. - * * @return Handle to the IGnssPsds interface. */ - IGnssPsds getExtensionPsds(); + @nullable IGnssPsds getExtensionPsds(); /** * This method returns the IGnssConfiguration interface. @@ -89,7 +87,7 @@ interface IGnss { IGnssConfiguration getExtensionGnssConfiguration(); /** - * This methods returns the IGnssMeasurementInterface interface. + * This method returns the IGnssMeasurementInterface interface. * * This method must return non-null. * @@ -105,4 +103,11 @@ interface IGnss { * @return Handle to the IGnssPowerIndication interface. */ IGnssPowerIndication getExtensionGnssPowerIndication(); + + /** + * This method returns the IGnssBatching interface. + * + * @return Handle to the IGnssBatching interface. + */ + @nullable IGnssBatching getExtensionGnssBatching(); } diff --git a/gnss/aidl/android/hardware/gnss/IGnssBatching.aidl b/gnss/aidl/android/hardware/gnss/IGnssBatching.aidl new file mode 100644 index 0000000000..0d48ee1c29 --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/IGnssBatching.aidl @@ -0,0 +1,116 @@ +/* + * 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. + */ + +package android.hardware.gnss; + +import android.hardware.gnss.IGnssBatchingCallback; + +/** + * Extended interface for GNSS Batching support. + * + * If this interface is supported, this batching request must be able to run in parallel with, or + * without, non-batched location requested by the IGnss start() & stop() - i.e. both requests must + * be handled independently, and not interfere with each other. + * + * For example, if a 1Hz continuous output is underway on the IGnssCallback, due to an IGnss start() + * operation, and then a IGnssBatching start() is called for a location every 10 seconds, the newly + * added batching request must not disrupt the 1Hz continuous location output on the IGnssCallback. + * + * As with GNSS Location outputs, source of location must be GNSS satellite measurements, optionally + * using interial and baro sensors to improve relative motion filtering. No additional absolute + * positioning information, such as WiFi derived location, may be mixed with the GNSS information. + */ +@VintfStability +interface IGnssBatching { + /** + * Bit mask indicating batching supports wake up and flush when FIFO is full. + * + * If this flag is set, the hardware implementation must wake up the application processor when + * the FIFO is full, and call IGnssBatchingCallback to return the locations. + * + * If the flag is not set, the hardware implementation must drop the oldest data when the FIFO + * is full. + */ + const int WAKEUP_ON_FIFO_FULL = 0x01; + + /** + * Open the interface and provides the callback routines to the implementation of this + * interface. + * + * @param callback Callback interface for IGnssBatching. + */ + void init(in IGnssBatchingCallback callback); + + /** + * Return the batch size (in number of GnssLocation objects) available in this hardware + * implementation. + * + * If the available size is variable, for example, based on other operations consuming memory, + * this is the minimum size guaranteed to be available for batching operations. + * + * This may, for example, be used by the client, to decide on the batching interval and whether + * the AP should be woken up or not. + * + * @return the number of location objects supported per batch + */ + int getBatchSize(); + + /** + * Start batching locations. This API is primarily used when the AP is asleep and the device can + * batch locations in the hardware. + * + * The implementation must invoke IGnssBatchingCallback, provided in init(), to return the + * location. + * + * When the buffer is full and WAKEUP_ON_FIFO_FULL is used, IGnssBatchingCallback must be called + * to return the locations. + * + * When the buffer is full and WAKEUP_ON_FIFO_FULL is not set, the oldest location object is + * dropped. In this case the AP must not be woken up. The AP would then generally be responsible + * for using flushBatchedLocation to explicitly ask for the location as needed, to avoid it + * being dropped. + * + * @param periodNanos Time interval between samples in the location batch, in nanoseconds + * @param flags A bitfield of flags (WAKEUP_ON_FIFO_FULL) indicating the batching behavior + */ + void start(in long periodNanos, in int flags); + + /** + * Retrieve all batched locations currently stored. + * + * The implementation must invoke IGnssBatchingCallback, provided in init(), to return the + * location. + * + * IGnssBatchingCallback must be called in response, even if there are no locations to flush + * (in which case the Location vector must be empty). + * + * Subsequent calls to flush must not return any of the locations returned in this call. + */ + void flush(); + + /** + * Stop batching. + */ + void stop(); + + /** + * Closes the interface. If any batch operations are in progress, they must be stopped. If any + * locations are in the hardware batch, they must be deleted (and not sent via callback.) + * + * init() may be called again, after this, if the interface is to be restored + */ + void cleanup(); +} diff --git a/gnss/aidl/android/hardware/gnss/IGnssBatchingCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssBatchingCallback.aidl new file mode 100644 index 0000000000..b1bfc5752a --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/IGnssBatchingCallback.aidl @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package android.hardware.gnss; + +import android.hardware.gnss.GnssLocation; + +/** The callback interface to report batched GNSS locations from the HAL. */ +@VintfStability +interface IGnssBatchingCallback { + /** + * Called when a batch of locations is output, by various means, including + * a flush request, as well as the buffer becoming full (if appropriate option + * is set.) + * + * All locations returned by this callback must be cleared from the hardware + * buffer, such the sequential calls of this callback do not return any + * redundant locations. (Same lat/lon, at a new time, is acceptable.) + * + * @param locations A list of GNSS Locations + */ + void gnssLocationBatchCb(in GnssLocation[] locations); +} diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index c028dd764e..892ad15a19 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -52,10 +52,11 @@ cc_binary { "android.hardware.gnss.measurement_corrections@1.1", "android.hardware.gnss.measurement_corrections@1.0", "android.hardware.gnss.visibility_control@1.0", - "android.hardware.gnss-V1-ndk", + "android.hardware.gnss-V2-ndk", ], srcs: [ "Gnss.cpp", + "GnssBatching.cpp", "GnssHidlHal.cpp", "GnssPowerIndication.cpp", "GnssPsds.cpp", diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 6061eec817..fbfa2bbd0d 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -18,6 +18,7 @@ #include "Gnss.h" #include +#include "GnssBatching.h" #include "GnssConfiguration.h" #include "GnssMeasurementInterface.h" #include "GnssPsds.h" @@ -88,4 +89,11 @@ ndk::ScopedAStatus Gnss::getExtensionGnssMeasurement( return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Gnss::getExtensionGnssBatching(std::shared_ptr* iGnssBatching) { + ALOGD("Gnss::getExtensionGnssBatching"); + + *iGnssBatching = SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index 76ebe4d126..3959ef86e0 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -17,6 +17,7 @@ #pragma once #include +#include #include #include #include @@ -37,6 +38,8 @@ class Gnss : public BnGnss { std::shared_ptr* iGnssPowerIndication) override; ndk::ScopedAStatus getExtensionGnssMeasurement( std::shared_ptr* iGnssMeasurement) override; + ndk::ScopedAStatus getExtensionGnssBatching( + std::shared_ptr* iGnssBatching) override; std::shared_ptr mGnssConfiguration; std::shared_ptr mGnssPowerIndication; diff --git a/gnss/aidl/default/GnssBatching.cpp b/gnss/aidl/default/GnssBatching.cpp new file mode 100644 index 0000000000..2444edc63b --- /dev/null +++ b/gnss/aidl/default/GnssBatching.cpp @@ -0,0 +1,129 @@ +/* + * 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. + */ + +#define LOG_TAG "GnssBatchingAidl" + +#include "GnssBatching.h" +#include +#include +#include +#include +#include "Utils.h" + +namespace aidl::android::hardware::gnss { + +using namespace ::android::hardware::gnss; + +constexpr int BATCH_SIZE = 10; + +std::shared_ptr GnssBatching::sCallback = nullptr; + +GnssBatching::GnssBatching() + : mMinIntervalMs(1000), + mWakeUpOnFifoFull(false), + mBatchedLocations(std::vector()) {} +GnssBatching::~GnssBatching() { + cleanup(); +} + +ndk::ScopedAStatus GnssBatching::init(const std::shared_ptr& callback) { + ALOGD("init"); + std::unique_lock lock(mMutex); + sCallback = callback; + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus GnssBatching::getBatchSize(int* size) { + ALOGD("getBatchingSize"); + *size = BATCH_SIZE; + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus GnssBatching::start(int64_t periodNanos, int flags) { + ALOGD("start: periodNanos=%" PRId64 ", flags=%d", periodNanos, flags); + if (mIsActive) { + ALOGW("Gnss has started. Restarting..."); + stop(); + } + + mWakeUpOnFifoFull = (flags & IGnssBatching::WAKEUP_ON_FIFO_FULL) ? true : false; + // mMinIntervalMs is not smaller than 1 sec + periodNanos = (periodNanos < 1e9) ? 1e9 : periodNanos; + mMinIntervalMs = periodNanos / 1e6; + + mIsActive = true; + mThread = std::thread([this]() { + while (mIsActive == true) { + const auto location = common::Utils::getMockLocation(); + this->batchLocation(location); + std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMs)); + } + }); + + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus GnssBatching::flush() { + ALOGD("flush"); + if (mBatchedLocations.empty()) { + return ndk::ScopedAStatus::ok(); + } + std::vector copy = std::vector(mBatchedLocations); + ndk::ScopedAStatus status; + if (sCallback != nullptr) { + sCallback->gnssLocationBatchCb(copy); + status = ndk::ScopedAStatus::ok(); + } else { + ALOGE("GnssBatchingCallback is null. flush() failed."); + status = ndk::ScopedAStatus::fromServiceSpecificError(IGnss::ERROR_GENERIC); + } + mBatchedLocations.clear(); + return status; +} + +ndk::ScopedAStatus GnssBatching::stop() { + ALOGD("stop"); + // Do not call flush() at stop() + mIsActive = false; + if (mThread.joinable()) { + mThread.join(); + } + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus GnssBatching::cleanup() { + ALOGD("cleanup"); + std::unique_lock lock(mMutex); + if (mIsActive) { + stop(); + } + flush(); + + sCallback = nullptr; + return ndk::ScopedAStatus::ok(); +} + +void GnssBatching::batchLocation(const GnssLocation& location) { + if (mBatchedLocations.size() > BATCH_SIZE) { + mBatchedLocations.erase(mBatchedLocations.begin()); + } + mBatchedLocations.push_back(location); + if (mWakeUpOnFifoFull && mBatchedLocations.size() == BATCH_SIZE) { + flush(); + } +} + +} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/GnssBatching.h b/gnss/aidl/default/GnssBatching.h new file mode 100644 index 0000000000..7cd6e85840 --- /dev/null +++ b/gnss/aidl/default/GnssBatching.h @@ -0,0 +1,53 @@ +/* + * 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 +#include +#include + +namespace aidl::android::hardware::gnss { + +struct GnssBatching : public BnGnssBatching { + public: + GnssBatching(); + ~GnssBatching(); + ndk::ScopedAStatus init(const std::shared_ptr& callback) override; + ndk::ScopedAStatus getBatchSize(int* size) override; + ndk::ScopedAStatus start(int64_t periodNanos, int flags) override; + ndk::ScopedAStatus flush() override; + ndk::ScopedAStatus stop() override; + ndk::ScopedAStatus cleanup() override; + + private: + void batchLocation(const GnssLocation&); + + // Guarded by mMutex + static std::shared_ptr sCallback; + + std::thread mThread; + std::atomic mIsActive; + std::atomic mMinIntervalMs; + std::atomic mWakeUpOnFifoFull; + + // Synchronization lock for sCallback + mutable std::mutex mMutex; + + std::vector mBatchedLocations; +}; + +} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/gnss-default.xml b/gnss/aidl/default/gnss-default.xml index 2b06cd28de..7449310933 100644 --- a/gnss/aidl/default/gnss-default.xml +++ b/gnss/aidl/default/gnss-default.xml @@ -1,6 +1,7 @@ android.hardware.gnss + 2 IGnss default diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp index 838849d535..6096d4dd9c 100644 --- a/gnss/aidl/vts/Android.bp +++ b/gnss/aidl/vts/Android.bp @@ -30,6 +30,7 @@ cc_test { srcs: [ "gnss_hal_test.cpp", "gnss_hal_test_cases.cpp", + "GnssBatchingCallback.cpp", "GnssCallbackAidl.cpp", "GnssMeasurementCallbackAidl.cpp", "GnssPowerIndicationCallback.cpp", @@ -43,7 +44,7 @@ cc_test { "libbinder", ], static_libs: [ - "android.hardware.gnss-V1-cpp", + "android.hardware.gnss-V2-cpp", "android.hardware.gnss@common-vts-lib", ], test_suites: [ diff --git a/gnss/aidl/vts/GnssBatchingCallback.cpp b/gnss/aidl/vts/GnssBatchingCallback.cpp new file mode 100644 index 0000000000..2da3b12e68 --- /dev/null +++ b/gnss/aidl/vts/GnssBatchingCallback.cpp @@ -0,0 +1,31 @@ +/* + * 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 "GnssBatchingCallback.h" +#include +#include + +android::binder::Status GnssBatchingCallback::gnssLocationBatchCb( + const std::vector& locations) { + ALOGI("Batched locations received with size=%d", (int)locations.size()); + for (const auto& location : locations) { + ALOGI("elapsedRealtime: flags = %d, timestampNs: %" PRId64 ", timeUncertaintyNs=%lf", + location.elapsedRealtime.flags, location.elapsedRealtime.timestampNs, + location.elapsedRealtime.timeUncertaintyNs); + } + batched_locations_cbq_.store(locations); + return android::binder::Status::ok(); +} diff --git a/gnss/aidl/vts/GnssBatchingCallback.h b/gnss/aidl/vts/GnssBatchingCallback.h new file mode 100644 index 0000000000..310a134a3f --- /dev/null +++ b/gnss/aidl/vts/GnssBatchingCallback.h @@ -0,0 +1,36 @@ +/* + * 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 +#include +#include "GnssCallbackEventQueue.h" + +/** Implementation for IGnssBatchingCallback. */ +class GnssBatchingCallback : public android::hardware::gnss::BnGnssBatchingCallback { + public: + GnssBatchingCallback() : batched_locations_cbq_("batched_locations") {} + ~GnssBatchingCallback() {} + + android::binder::Status gnssLocationBatchCb( + const std::vector& locations) override; + + android::hardware::gnss::common::GnssCallbackEventQueue< + std::vector> + batched_locations_cbq_; + std::vector last_batched_locations_; +}; diff --git a/gnss/aidl/vts/gnss_hal_test.h b/gnss/aidl/vts/gnss_hal_test.h index f72f7fe4e8..e3ecbed8cc 100644 --- a/gnss/aidl/vts/gnss_hal_test.h +++ b/gnss/aidl/vts/gnss_hal_test.h @@ -23,6 +23,7 @@ #include #include +#include "GnssBatchingCallback.h" #include "GnssCallbackAidl.h" #include "v2_1/gnss_hal_test_template.h" diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 0cd782ebc1..86140cc6b2 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -17,10 +17,12 @@ #define LOG_TAG "GnssHalTestCases" #include +#include #include #include #include #include +#include "GnssBatchingCallback.h" #include "GnssMeasurementCallbackAidl.h" #include "GnssPowerIndicationCallback.h" #include "gnss_hal_test.h" @@ -33,6 +35,8 @@ using android::hardware::gnss::GnssData; using android::hardware::gnss::GnssMeasurement; using android::hardware::gnss::GnssPowerStats; using android::hardware::gnss::IGnss; +using android::hardware::gnss::IGnssBatching; +using android::hardware::gnss::IGnssBatchingCallback; using android::hardware::gnss::IGnssConfiguration; using android::hardware::gnss::IGnssMeasurementCallback; using android::hardware::gnss::IGnssMeasurementInterface; @@ -749,3 +753,25 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOn) { status = gnss_configuration_hal->setBlocklist(sources); ASSERT_TRUE(status.isOk()); } + +/* + * TestGnssBatchingExtension: + * 1. Gets the IGnssBatching extension. + * 2. Initializes the interface with an IGnssBatchingCallback. + * 3. Clean up. + */ +TEST_P(GnssHalTest, TestGnssBatchingExtension) { + sp iGnssBatching; + auto status = aidl_gnss_hal_->getExtensionGnssBatching(&iGnssBatching); + if (!status.isOk() || iGnssBatching == nullptr) { + // Device doesn't support batching. Skip the test. + return; + } + + sp iGnssBatchingCallback; + status = iGnssBatching->init(iGnssBatchingCallback); + ASSERT_TRUE(status.isOk()); + + status = iGnssBatching->cleanup(); + ASSERT_TRUE(status.isOk()); +} diff --git a/gnss/common/utils/default/Android.bp b/gnss/common/utils/default/Android.bp index 5294409321..05bec882de 100644 --- a/gnss/common/utils/default/Android.bp +++ b/gnss/common/utils/default/Android.bp @@ -56,6 +56,6 @@ cc_library_static { "android.hardware.gnss@2.1", "android.hardware.gnss.measurement_corrections@1.1", "android.hardware.gnss.measurement_corrections@1.0", - "android.hardware.gnss-V1-ndk", + "android.hardware.gnss-V2-ndk", ], } diff --git a/gnss/common/utils/default/Utils.cpp b/gnss/common/utils/default/Utils.cpp index dfcf9a931e..c339e72d43 100644 --- a/gnss/common/utils/default/Utils.cpp +++ b/gnss/common/utils/default/Utils.cpp @@ -28,6 +28,7 @@ namespace common { using aidl::android::hardware::gnss::ElapsedRealtime; using aidl::android::hardware::gnss::GnssClock; using aidl::android::hardware::gnss::GnssData; +using aidl::android::hardware::gnss::GnssLocation; using aidl::android::hardware::gnss::GnssMeasurement; using aidl::android::hardware::gnss::IGnss; using aidl::android::hardware::gnss::IGnssMeasurementCallback; @@ -232,6 +233,30 @@ GnssData Utils::getMockMeasurement(const bool enableCorrVecOutputs) { return gnssData; } +GnssLocation Utils::getMockLocation() { + ElapsedRealtime elapsedRealtime = { + .flags = ElapsedRealtime::HAS_TIMESTAMP_NS | ElapsedRealtime::HAS_TIME_UNCERTAINTY_NS, + .timestampNs = ::android::elapsedRealtimeNano(), + // This is an hardcoded value indicating a 1ms of uncertainty between the two clocks. + // In an actual implementation provide an estimate of the synchronization uncertainty + // or don't set the field. + .timeUncertaintyNs = 1020400}; + GnssLocation location = {.gnssLocationFlags = 0xFF, + .latitudeDegrees = gMockLatitudeDegrees, + .longitudeDegrees = gMockLongitudeDegrees, + .altitudeMeters = gMockAltitudeMeters, + .speedMetersPerSec = gMockSpeedMetersPerSec, + .bearingDegrees = gMockBearingDegrees, + .horizontalAccuracyMeters = kMockHorizontalAccuracyMeters, + .verticalAccuracyMeters = kMockVerticalAccuracyMeters, + .speedAccuracyMetersPerSecond = kMockSpeedAccuracyMetersPerSecond, + .bearingAccuracyDegrees = kMockBearingAccuracyDegrees, + .timestampMillis = static_cast( + kMockTimestamp + ::android::elapsedRealtimeNano() / 1e6), + .elapsedRealtime = elapsedRealtime}; + return location; +} + V2_0::GnssLocation Utils::getMockLocationV2_0() { const V2_0::ElapsedRealtime timestamp = { .flags = V2_0::ElapsedRealtimeFlags::HAS_TIMESTAMP_NS | diff --git a/gnss/common/utils/default/include/Utils.h b/gnss/common/utils/default/include/Utils.h index 43772ce11a..4500ee6abf 100644 --- a/gnss/common/utils/default/include/Utils.h +++ b/gnss/common/utils/default/include/Utils.h @@ -17,6 +17,7 @@ #ifndef android_hardware_gnss_common_default_Utils_H_ #define android_hardware_gnss_common_default_Utils_H_ +#include #include #include #include @@ -34,6 +35,7 @@ struct Utils { const bool enableCorrVecOutputs); static V2_0::IGnssMeasurementCallback::GnssData getMockMeasurementV2_0(); static V2_1::IGnssMeasurementCallback::GnssData getMockMeasurementV2_1(); + static aidl::android::hardware::gnss::GnssLocation getMockLocation(); static V2_0::GnssLocation getMockLocationV2_0(); static V1_0::GnssLocation getMockLocationV1_0(); static hidl_vec getMockSvInfoListV2_1(); diff --git a/gnss/common/utils/vts/Utils.cpp b/gnss/common/utils/vts/Utils.cpp index 9c84e806f8..be22ff6e65 100644 --- a/gnss/common/utils/vts/Utils.cpp +++ b/gnss/common/utils/vts/Utils.cpp @@ -24,12 +24,10 @@ namespace hardware { namespace gnss { namespace common { -using GnssConstellationType_V1_0 = V1_0::GnssConstellationType; -using GnssConstellationType_V2_0 = V2_0::GnssConstellationType; - +using namespace measurement_corrections::V1_0; using V1_0::GnssLocationFlags; -void Utils::checkLocation(const GnssLocation& location, bool check_speed, +void Utils::checkLocation(const V1_0::GnssLocation& location, bool check_speed, bool check_more_accuracies) { EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG); EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE); @@ -96,7 +94,7 @@ void Utils::checkLocation(const GnssLocation& location, bool check_speed, EXPECT_GT(location.timestamp, 1.48e12); } -const MeasurementCorrections_1_0 Utils::getMockMeasurementCorrections() { +const MeasurementCorrections Utils::getMockMeasurementCorrections() { ReflectingPlane reflectingPlane = { .latitudeDegrees = 37.4220039, .longitudeDegrees = -122.0840991, @@ -104,12 +102,12 @@ const MeasurementCorrections_1_0 Utils::getMockMeasurementCorrections() { .azimuthDegrees = 203.0, }; - SingleSatCorrection_V1_0 singleSatCorrection1 = { + SingleSatCorrection singleSatCorrection1 = { .singleSatCorrectionFlags = GnssSingleSatCorrectionFlags::HAS_SAT_IS_LOS_PROBABILITY | GnssSingleSatCorrectionFlags::HAS_EXCESS_PATH_LENGTH | GnssSingleSatCorrectionFlags::HAS_EXCESS_PATH_LENGTH_UNC | GnssSingleSatCorrectionFlags::HAS_REFLECTING_PLANE, - .constellation = GnssConstellationType_V1_0::GPS, + .constellation = V1_0::GnssConstellationType::GPS, .svid = 12, .carrierFrequencyHz = 1.59975e+09, .probSatIsLos = 0.50001, @@ -117,11 +115,11 @@ const MeasurementCorrections_1_0 Utils::getMockMeasurementCorrections() { .excessPathLengthUncertaintyMeters = 25.5, .reflectingPlane = reflectingPlane, }; - SingleSatCorrection_V1_0 singleSatCorrection2 = { + SingleSatCorrection singleSatCorrection2 = { .singleSatCorrectionFlags = GnssSingleSatCorrectionFlags::HAS_SAT_IS_LOS_PROBABILITY | GnssSingleSatCorrectionFlags::HAS_EXCESS_PATH_LENGTH | GnssSingleSatCorrectionFlags::HAS_EXCESS_PATH_LENGTH_UNC, - .constellation = GnssConstellationType_V1_0::GPS, + .constellation = V1_0::GnssConstellationType::GPS, .svid = 9, .carrierFrequencyHz = 1.59975e+09, .probSatIsLos = 0.873, @@ -129,9 +127,9 @@ const MeasurementCorrections_1_0 Utils::getMockMeasurementCorrections() { .excessPathLengthUncertaintyMeters = 10.0, }; - hidl_vec singleSatCorrections = {singleSatCorrection1, - singleSatCorrection2}; - MeasurementCorrections_1_0 mockCorrections = { + hidl_vec singleSatCorrections = {singleSatCorrection1, + singleSatCorrection2}; + MeasurementCorrections mockCorrections = { .latitudeDegrees = 37.4219999, .longitudeDegrees = -122.0840575, .altitudeMeters = 30.60062531, @@ -143,25 +141,26 @@ const MeasurementCorrections_1_0 Utils::getMockMeasurementCorrections() { return mockCorrections; } -const MeasurementCorrections_1_1 Utils::getMockMeasurementCorrections_1_1() { - MeasurementCorrections_1_0 mockCorrections_1_0 = getMockMeasurementCorrections(); +const measurement_corrections::V1_1::MeasurementCorrections +Utils::getMockMeasurementCorrections_1_1() { + MeasurementCorrections mockCorrections_1_0 = getMockMeasurementCorrections(); - SingleSatCorrection_V1_1 singleSatCorrection1 = { + measurement_corrections::V1_1::SingleSatCorrection singleSatCorrection1 = { .v1_0 = mockCorrections_1_0.satCorrections[0], - .constellation = GnssConstellationType_V2_0::IRNSS, + .constellation = V2_0::GnssConstellationType::IRNSS, }; - SingleSatCorrection_V1_1 singleSatCorrection2 = { + measurement_corrections::V1_1::SingleSatCorrection singleSatCorrection2 = { .v1_0 = mockCorrections_1_0.satCorrections[1], - .constellation = GnssConstellationType_V2_0::IRNSS, + .constellation = V2_0::GnssConstellationType::IRNSS, }; - mockCorrections_1_0.satCorrections[0].constellation = GnssConstellationType_V1_0::UNKNOWN; - mockCorrections_1_0.satCorrections[1].constellation = GnssConstellationType_V1_0::UNKNOWN; + mockCorrections_1_0.satCorrections[0].constellation = V1_0::GnssConstellationType::UNKNOWN; + mockCorrections_1_0.satCorrections[1].constellation = V1_0::GnssConstellationType::UNKNOWN; - hidl_vec singleSatCorrections = {singleSatCorrection1, - singleSatCorrection2}; + hidl_vec singleSatCorrections = { + singleSatCorrection1, singleSatCorrection2}; - MeasurementCorrections_1_1 mockCorrections_1_1 = { + measurement_corrections::V1_1::MeasurementCorrections mockCorrections_1_1 = { .v1_0 = mockCorrections_1_0, .hasEnvironmentBearing = true, .environmentBearingDegrees = 45.0, @@ -177,22 +176,22 @@ const MeasurementCorrections_1_1 Utils::getMockMeasurementCorrections_1_1() { * GnssConstellationType_1_0 type constellation. For constellations that do not have * an equivalent value, maps to GnssConstellationType_1_0::UNKNOWN */ -GnssConstellationType_1_0 Utils::mapConstellationType(GnssConstellationType_2_0 constellation) { +V1_0::GnssConstellationType Utils::mapConstellationType(V2_0::GnssConstellationType constellation) { switch (constellation) { - case GnssConstellationType_2_0::GPS: - return GnssConstellationType_1_0::GPS; - case GnssConstellationType_2_0::SBAS: - return GnssConstellationType_1_0::SBAS; - case GnssConstellationType_2_0::GLONASS: - return GnssConstellationType_1_0::GLONASS; - case GnssConstellationType_2_0::QZSS: - return GnssConstellationType_1_0::QZSS; - case GnssConstellationType_2_0::BEIDOU: - return GnssConstellationType_1_0::BEIDOU; - case GnssConstellationType_2_0::GALILEO: - return GnssConstellationType_1_0::GALILEO; + case V2_0::GnssConstellationType::GPS: + return V1_0::GnssConstellationType::GPS; + case V2_0::GnssConstellationType::SBAS: + return V1_0::GnssConstellationType::SBAS; + case V2_0::GnssConstellationType::GLONASS: + return V1_0::GnssConstellationType::GLONASS; + case V2_0::GnssConstellationType::QZSS: + return V1_0::GnssConstellationType::QZSS; + case V2_0::GnssConstellationType::BEIDOU: + return V1_0::GnssConstellationType::BEIDOU; + case V2_0::GnssConstellationType::GALILEO: + return V1_0::GnssConstellationType::GALILEO; default: - return GnssConstellationType_1_0::UNKNOWN; + return V1_0::GnssConstellationType::UNKNOWN; } } diff --git a/gnss/common/utils/vts/include/Utils.h b/gnss/common/utils/vts/include/Utils.h index a4aad80f69..91c1167b31 100644 --- a/gnss/common/utils/vts/include/Utils.h +++ b/gnss/common/utils/vts/include/Utils.h @@ -22,33 +22,21 @@ #include #include -using GnssConstellationType_1_0 = android::hardware::gnss::V1_0::GnssConstellationType; -using GnssConstellationType_2_0 = android::hardware::gnss::V2_0::GnssConstellationType; -using GnssLocation = ::android::hardware::gnss::V1_0::GnssLocation; -using namespace android::hardware::gnss::measurement_corrections::V1_0; - -using MeasurementCorrections_1_0 = - android::hardware::gnss::measurement_corrections::V1_0::MeasurementCorrections; -using MeasurementCorrections_1_1 = - android::hardware::gnss::measurement_corrections::V1_1::MeasurementCorrections; - -using SingleSatCorrection_V1_0 = - android::hardware::gnss::measurement_corrections::V1_0::SingleSatCorrection; -using SingleSatCorrection_V1_1 = - android::hardware::gnss::measurement_corrections::V1_1::SingleSatCorrection; - namespace android { namespace hardware { namespace gnss { namespace common { struct Utils { - static void checkLocation(const GnssLocation& location, bool check_speed, + static void checkLocation(const V1_0::GnssLocation& location, bool check_speed, bool check_more_accuracies); - static const MeasurementCorrections_1_0 getMockMeasurementCorrections(); - static const MeasurementCorrections_1_1 getMockMeasurementCorrections_1_1(); + static const measurement_corrections::V1_0::MeasurementCorrections + getMockMeasurementCorrections(); + static const measurement_corrections::V1_1::MeasurementCorrections + getMockMeasurementCorrections_1_1(); - static GnssConstellationType_1_0 mapConstellationType(GnssConstellationType_2_0 constellation); + static V1_0::GnssConstellationType mapConstellationType( + V2_0::GnssConstellationType constellation); static bool isAutomotiveDevice(); }; -- GitLab From e6f9ff6c192ef82d4731c589b222adae9a50ab15 Mon Sep 17 00:00:00 2001 From: Tommy Chiu Date: Thu, 23 Sep 2021 20:09:13 +0800 Subject: [PATCH 156/825] Add EncryptionOperationsTest.AesCbcZeroInputSuccess Check if the zero input data with AES-CBC-[NONE|PKCS7] padding mode generates correct output data and length. Bug: 200553873 Test: VtsHalKeymasterV4_0TargetTest, VtsAidlKeyMintTargetTest Change-Id: I729c2bad65e9d8b194422032346e5ee3c4b0dce5 --- .../functional/keymaster_hidl_hal_test.cpp | 43 +++++++++++++++++++ .../aidl/vts/functional/KeyMintTest.cpp | 43 +++++++++++++++++++ 2 files changed, 86 insertions(+) diff --git a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp index 93fb19d23d..2c15823c0e 100644 --- a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp +++ b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp @@ -3152,6 +3152,49 @@ TEST_P(EncryptionOperationsTest, AesCbcRoundTripSuccess) { EXPECT_EQ(message, plaintext); } +/* + * EncryptionOperationsTest.AesCbcZeroInputSuccessb + * + * Verifies that keymaster generates correct output on zero-input with + * NonePadding mode + */ +TEST_P(EncryptionOperationsTest, AesCbcZeroInputSuccess) { + ASSERT_EQ(ErrorCode::OK, GenerateKey(AuthorizationSetBuilder() + .Authorization(TAG_NO_AUTH_REQUIRED) + .AesEncryptionKey(128) + .BlockMode(BlockMode::CBC) + .Padding(PaddingMode::NONE, PaddingMode::PKCS7))); + + // Zero input message + string message = ""; + for (auto padding : {PaddingMode::NONE, PaddingMode::PKCS7}) { + auto params = AuthorizationSetBuilder().BlockMode(BlockMode::CBC).Padding(padding); + AuthorizationSet out_params; + string ciphertext1 = EncryptMessage(message, params, &out_params); + HidlBuf iv1 = CopyIv(out_params); + if (padding == PaddingMode::NONE) + EXPECT_EQ(message.size(), ciphertext1.size()) << "PaddingMode: " << padding; + else + EXPECT_EQ(message.size(), ciphertext1.size() - 16) << "PaddingMode: " << padding; + + out_params.Clear(); + + string ciphertext2 = EncryptMessage(message, params, &out_params); + HidlBuf iv2 = CopyIv(out_params); + if (padding == PaddingMode::NONE) + EXPECT_EQ(message.size(), ciphertext2.size()) << "PaddingMode: " << padding; + else + EXPECT_EQ(message.size(), ciphertext2.size() - 16) << "PaddingMode: " << padding; + + // IVs should be random + EXPECT_NE(iv1, iv2) << "PaddingMode: " << padding; + + params.push_back(TAG_NONCE, iv1); + string plaintext = DecryptMessage(ciphertext1, params); + EXPECT_EQ(message, plaintext) << "PaddingMode: " << padding; + } +} + /* * EncryptionOperationsTest.AesCallerNonce * diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp index 2a0ee7fd3e..4eaa8d2c22 100644 --- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp +++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp @@ -4664,6 +4664,49 @@ TEST_P(EncryptionOperationsTest, AesCbcRoundTripSuccess) { EXPECT_EQ(message, plaintext); } +/* + * EncryptionOperationsTest.AesCbcZeroInputSuccessb + * + * Verifies that keymaster generates correct output on zero-input with + * NonePadding mode + */ +TEST_P(EncryptionOperationsTest, AesCbcZeroInputSuccess) { + ASSERT_EQ(ErrorCode::OK, GenerateKey(AuthorizationSetBuilder() + .Authorization(TAG_NO_AUTH_REQUIRED) + .AesEncryptionKey(128) + .BlockMode(BlockMode::CBC) + .Padding(PaddingMode::NONE, PaddingMode::PKCS7))); + + // Zero input message + string message = ""; + for (auto padding : {PaddingMode::NONE, PaddingMode::PKCS7}) { + auto params = AuthorizationSetBuilder().BlockMode(BlockMode::CBC).Padding(padding); + AuthorizationSet out_params; + string ciphertext1 = EncryptMessage(message, params, &out_params); + vector iv1 = CopyIv(out_params); + if (padding == PaddingMode::NONE) + EXPECT_EQ(message.size(), ciphertext1.size()) << "PaddingMode: " << padding; + else + EXPECT_EQ(message.size(), ciphertext1.size() - 16) << "PaddingMode: " << padding; + + out_params.Clear(); + + string ciphertext2 = EncryptMessage(message, params, &out_params); + vector iv2 = CopyIv(out_params); + if (padding == PaddingMode::NONE) + EXPECT_EQ(message.size(), ciphertext2.size()) << "PaddingMode: " << padding; + else + EXPECT_EQ(message.size(), ciphertext2.size() - 16) << "PaddingMode: " << padding; + + // IVs should be random + EXPECT_NE(iv1, iv2) << "PaddingMode: " << padding; + + params.push_back(TAG_NONCE, iv1); + string plaintext = DecryptMessage(ciphertext1, params); + EXPECT_EQ(message, plaintext) << "PaddingMode: " << padding; + } +} + /* * EncryptionOperationsTest.AesCallerNonce * -- GitLab From f86dae891861f3c61477df92cc9530e6e2340139 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 9 Sep 2021 17:44:18 -0700 Subject: [PATCH 157/825] Define an abstract interface to access hardware. For non-virtualized VHAL, VHAL would use a VehicleHareware implementation in the same process. For virtualized VHAL, on android side, a VehicleHardware implementation acts as the client to take with a GRPC server in another VM. That server uses a VehicleHardware implementation underneath. Test: Local build. Bug: 199453627 Change-Id: I34512fad44aa4f69832d147d2c4ef4221e53dc4f --- .../vehicle/aidl/impl/hardware/Android.bp | 33 ++++++ .../impl/hardware/include/IVehicleHardware.h | 106 ++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 automotive/vehicle/aidl/impl/hardware/Android.bp create mode 100644 automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h diff --git a/automotive/vehicle/aidl/impl/hardware/Android.bp b/automotive/vehicle/aidl/impl/hardware/Android.bp new file mode 100644 index 0000000000..edb0f29862 --- /dev/null +++ b/automotive/vehicle/aidl/impl/hardware/Android.bp @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_library_headers { + name: "IVehicleHardware", + vendor: true, + export_include_dirs: [ + "include", + ], + header_libs: [ + "VehicleHalUtilHeaders", + ], + export_header_lib_headers: [ + "VehicleHalUtilHeaders", + ], +} diff --git a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h new file mode 100644 index 0000000000..981088a34d --- /dev/null +++ b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h @@ -0,0 +1,106 @@ +/* + * 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_aidl_impl_hardware_include_IVehicleHardware_H_ +#define android_hardware_automotive_vehicle_aidl_impl_hardware_include_IVehicleHardware_H_ + +#include + +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +// A structure used to return dumped information. +struct DumpResult { + // If callerShouldDumpState is true, caller would print the information in buffer and + // continue to dump its state, otherwise would just dump the buffer and skip its own + // dumping logic. + bool callerShouldDumpState; + // The dumped information for the caller to print. + std::string buffer; +}; + +// A request type for 'setValues' or 'getValues' method. +struct VehiclePropValueRequest { + // A unique request ID set by the sender. + int requestId; + // The property to get/set. + ::aidl::android::hardware::automotive::vehicle::VehiclePropValue value; +}; + +// A structure to represent a set value error event reported from vehicle. +struct SetValueErrorEvent { + ::aidl::android::hardware::automotive::vehicle::StatusCode errorCode; + int32_t propId; + int32_t areaId; +}; + +// An abstract interface to access vehicle hardware. +// For virtualized VHAL, GrpcVehicleHardware would communicate with a VehicleHardware +// implementation in another VM through GRPC. For non-virtualzied VHAL, VHAL directly communicates +// with a VehicleHardware through this interface. +class IVehicleHardware { + public: + virtual ~IVehicleHardware() = default; + + // Get all the property configs. + virtual std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig> + getAllPropertyConfigs() const = 0; + + // Set property values asynchronously. Server could return before the property set requests + // are sent to vehicle bus or before property set confirmation is received. The callback is + // safe to be called after the function returns and is safe to be called in a different thread. + virtual ::aidl::android::hardware::automotive::vehicle::StatusCode setValues( + std::function&)>&& + callback, + const std::vector& requests) = 0; + + // Get property values asynchronously. Server could return before the property values are ready. + // The callback is safe to be called after the function returns and is safe to be called in a + // different thread. + virtual ::aidl::android::hardware::automotive::vehicle::StatusCode getValues( + std::function&)>&& + callback, + const std::vector& requests) const = 0; + + // Dump debug information in the server. + virtual DumpResult dump(const std::vector& 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. + virtual void registerOnPropertyChangeEvent( + std::function&)>&& callback) = 0; + + // Register a callback that would be called when there is a property set error event from + // vehicle. + virtual void registerOnPropertySetErrorEvent( + std::function&)>&& callback) = 0; +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_aidl_impl_hardware_include_IVehicleHardware_H_ -- GitLab From 70040729ee42a904553c1e2f20964dc2069e23c1 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Wed, 29 Sep 2021 14:54:53 -0700 Subject: [PATCH 158/825] Add HDR-related revisions to graphics types * Add standard metadata support for data described by the SMPTE 2094-10 standard. This corresponds to Dolby Vision support, and as such the metadata will use an opaque format, similar to existing support for the SMPTE 2094-40 standard. * Relax P010 definition so that arbitrary semiplanar layouts are supported. For devices implementing Gralloc 4, sufficient information is exposed from PlaneLayout that clients are able to interpret the buffer content correctly without the additional layout restrictions. Furthermore, this brings the gralloc definition in-line with the relaxed definition in android.media.ImageFormat. Bug: 196617266 Bug: 200309502 Test: builds Change-Id: I23774c81488292324de06dd4e3a8341421432a57 --- .../graphics/common/StandardMetadataType.aidl | 1 + .../hardware/graphics/common/PixelFormat.aidl | 75 ++++++++----------- .../graphics/common/StandardMetadataType.aidl | 15 +++- 3 files changed, 47 insertions(+), 44 deletions(-) diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl index 20273501b9..150215c6f1 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl @@ -56,4 +56,5 @@ enum StandardMetadataType { SMPTE2086 = 19, CTA861_3 = 20, SMPTE2094_40 = 21, + SMPTE2094_10 = 22, } diff --git a/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl b/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl index 4e0c5ef8d9..eb87f8d04f 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl @@ -25,7 +25,7 @@ enum PixelFormat { /** * This value may be used in an operation where the format is optional. */ - UNSPECIFIED = 0, + UNSPECIFIED = 0, /** * 32-bit format that has 8-bit R, G, B, and A components, in that order, * from the lowest memory address to the highest memory address. @@ -33,7 +33,7 @@ enum PixelFormat { * The component values are unsigned normalized to the range [0, 1], whose * interpretation is defined by the dataspace. */ - RGBA_8888 = 0x1, + RGBA_8888 = 0x1, /** * 32-bit format that has 8-bit R, G, B, and unused components, in that @@ -42,7 +42,7 @@ enum PixelFormat { * The component values are unsigned normalized to the range [0, 1], whose * interpretation is defined by the dataspace. */ - RGBX_8888 = 0x2, + RGBX_8888 = 0x2, /** * 24-bit format that has 8-bit R, G, and B components, in that order, @@ -51,7 +51,7 @@ enum PixelFormat { * The component values are unsigned normalized to the range [0, 1], whose * interpretation is defined by the dataspace. */ - RGB_888 = 0x3, + RGB_888 = 0x3, /** * 16-bit packed format that has 5-bit R, 6-bit G, and 5-bit B components, @@ -61,7 +61,7 @@ enum PixelFormat { * The component values are unsigned normalized to the range [0, 1], whose * interpretation is defined by the dataspace. */ - RGB_565 = 0x4, + RGB_565 = 0x4, /** * 32-bit format that has 8-bit B, G, R, and A components, in that order, @@ -70,14 +70,14 @@ enum PixelFormat { * The component values are unsigned normalized to the range [0, 1], whose * interpretation is defined by the dataspace. */ - BGRA_8888 = 0x5, + BGRA_8888 = 0x5, /** * Legacy formats deprecated in favor of YCBCR_420_888. */ - YCBCR_422_SP = 0x10, // NV16 - YCRCB_420_SP = 0x11, // NV21 - YCBCR_422_I = 0x14, // YUY2 + YCBCR_422_SP = 0x10, // NV16 + YCRCB_420_SP = 0x11, // NV21 + YCBCR_422_I = 0x14, // YUY2 /** * 64-bit format that has 16-bit R, G, B, and A components, in that order, @@ -86,7 +86,7 @@ enum PixelFormat { * The component values are signed floats, whose interpretation is defined * by the dataspace. */ - RGBA_FP16 = 0x16, + RGBA_FP16 = 0x16, /** * RAW16 is a single-channel, 16-bit, little endian format, typically @@ -129,7 +129,7 @@ enum PixelFormat { * | samples. * Other | Unsupported */ - RAW16 = 0x20, + RAW16 = 0x20, /** * BLOB is used to carry task-specific data which does not have a standard @@ -152,7 +152,7 @@ enum PixelFormat { * Dataspace::SENSOR | Sensor event data. * Other | Unsupported */ - BLOB = 0x21, + BLOB = 0x21, /** * A format indicating that the choice of format is entirely up to the @@ -168,7 +168,7 @@ enum PixelFormat { * * The interpretation of the component values is defined by the dataspace. */ - IMPLEMENTATION_DEFINED = 0x22, + IMPLEMENTATION_DEFINED = 0x22, /** * This format allows platforms to use an efficient YCbCr/YCrCb 4:2:0 @@ -185,7 +185,7 @@ enum PixelFormat { * * The interpretation of the component values is defined by the dataspace. */ - YCBCR_420_888 = 0x23, + YCBCR_420_888 = 0x23, /** * RAW_OPAQUE is a format for unprocessed raw image buffers coming from an @@ -207,7 +207,7 @@ enum PixelFormat { * Dataspace::ARBITRARY | Raw image sensor data. * Other | Unsupported */ - RAW_OPAQUE = 0x24, + RAW_OPAQUE = 0x24, /** * RAW10 is a single-channel, 10-bit per pixel, densely packed in each row, @@ -262,7 +262,7 @@ enum PixelFormat { * Dataspace::ARBITRARY | Raw image sensor data. * Other | Unsupported */ - RAW10 = 0x25, + RAW10 = 0x25, /** * RAW12 is a single-channel, 12-bit per pixel, densely packed in each row, @@ -313,7 +313,7 @@ enum PixelFormat { * Dataspace::ARBITRARY | Raw image sensor data. * Other | Unsupported */ - RAW12 = 0x26, + RAW12 = 0x26, /** 0x27 to 0x2A are reserved for flexible formats */ @@ -325,7 +325,7 @@ enum PixelFormat { * The component values are unsigned normalized to the range [0, 1], whose * interpretation is defined by the dataspace. */ - RGBA_1010102 = 0x2B, + RGBA_1010102 = 0x2B, /** * 0x100 - 0x1FF @@ -357,7 +357,7 @@ enum PixelFormat { * The component values are unsigned normalized to the range [0, 1], whose * interpretation is defined by the dataspace. */ - Y8 = 0x20203859, + Y8 = 0x20203859, /** * Y16 is a YUV planar format comprised of a WxH Y plane, with each pixel @@ -384,7 +384,7 @@ enum PixelFormat { * Dataspace::DEPTH, each pixel is a distance value measured by a depth * camera, plus an associated confidence value. */ - Y16 = 0x20363159, + Y16 = 0x20363159, /** * YV12 is a 4:2:0 YCrCb planar format comprised of a WxH Y plane followed @@ -413,7 +413,7 @@ enum PixelFormat { * The component values are unsigned normalized to the range [0, 1], whose * interpretation is defined by the dataspace. */ - YV12 = 0x32315659, // YCrCb 4:2:0 Planar + YV12 = 0x32315659, // YCrCb 4:2:0 Planar /** * 16-bit format that has a single 16-bit depth component. @@ -421,7 +421,7 @@ enum PixelFormat { * The component values are unsigned normalized to the range [0, 1], whose * interpretation is defined by the dataspace. */ - DEPTH_16 = 0x30, + DEPTH_16 = 0x30, /** * 32-bit format that has a single 24-bit depth component and, optionally, @@ -430,7 +430,7 @@ enum PixelFormat { * The component values are unsigned normalized to the range [0, 1], whose * interpretation is defined by the dataspace. */ - DEPTH_24 = 0x31, + DEPTH_24 = 0x31, /** * 32-bit format that has a 24-bit depth component and an 8-bit stencil @@ -440,7 +440,7 @@ enum PixelFormat { * whose interpretation is defined by the dataspace. The stencil values are * unsigned integers, whose interpretation is defined by the dataspace. */ - DEPTH_24_STENCIL_8 = 0x32, + DEPTH_24_STENCIL_8 = 0x32, /** * 32-bit format that has a single 32-bit depth component. @@ -448,7 +448,7 @@ enum PixelFormat { * The component values are signed floats, whose interpretation is defined * by the dataspace. */ - DEPTH_32F = 0x33, + DEPTH_32F = 0x33, /** * Two-component format that has a 32-bit depth component, an 8-bit stencil @@ -458,7 +458,7 @@ enum PixelFormat { * defined by the dataspace. The stencil bits are unsigned integers, whose * interpretation is defined by the dataspace. */ - DEPTH_32F_STENCIL_8 = 0x34, + DEPTH_32F_STENCIL_8 = 0x34, /** * 8-bit format that has a single 8-bit stencil component. @@ -466,23 +466,12 @@ enum PixelFormat { * The component values are unsigned integers, whose interpretation is * defined by the dataspace. */ - STENCIL_8 = 0x35, + STENCIL_8 = 0x35, /** * P010 is a 4:2:0 YCbCr semiplanar format comprised of a WxH Y plane - * followed immediately by a Wx(H/2) CbCr plane. Each sample is - * represented by a 16-bit little-endian value, with the lower 6 bits set - * to zero. - * - * This format assumes - * - an even height - * - a vertical stride equal to the height - * - * stride_in_bytes = stride * 2 - * y_size = stride_in_bytes * height - * cbcr_size = stride_in_bytes * (height / 2) - * cb_offset = y_size - * cr_offset = cb_offset + 2 + * followed by a Wx(H/2) CbCr plane. Each sample is represented by a 16-bit + * little-endian value, with the lower 6 bits set to zero. * * This format must be accepted by the allocator when used with the * following usage flags: @@ -499,7 +488,7 @@ enum PixelFormat { * Buffers with this format must be locked with IMapper::lockYCbCr * or with IMapper::lock. */ - YCBCR_P010 = 0x36, + YCBCR_P010 = 0x36, /** * 24-bit format that has 8-bit H, S, and V components, in that order, @@ -507,6 +496,6 @@ enum PixelFormat { * * The component values are unsigned normalized to the range [0, 1], whose * interpretation is defined by the dataspace. - */ - HSV_888 = 0x37, + */ + HSV_888 = 0x37, } diff --git a/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl b/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl index af6045e31d..7719d6e61d 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl @@ -344,7 +344,7 @@ enum StandardMetadataType { /** * Can be used to get or set dynamic HDR metadata specified by SMPTE ST 2094-40:2016. * - * This metadata is uint8_t byte array. + * This metadata is a uint8_t byte array. * * This is not used in tone mapping until it has been set for the first time. * @@ -353,4 +353,17 @@ enum StandardMetadataType { * If this is unset when encoded into a byte stream, the byte stream is empty. */ SMPTE2094_40 = 21, + + /** + * Can be used to get or set dynamic HDR metadata specified by SMPTE ST 2094-10:2016. + * + * This metadata is a uint8_t byte array. + * + * This is not used in tone mapping until it has been set for the first time. + * + * When it is encoded into a byte stream, the length of the HDR metadata byte array is written + * using 8 bytes in little endian. It is followed by the uint8_t byte array. + * If this is unset when encoded into a byte stream, the byte stream is empty. + */ + SMPTE2094_10 = 22, } -- GitLab From ef3f77f831445a75636b8dfb2ef4ca29db2d64e5 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Mon, 27 Sep 2021 17:01:07 +0800 Subject: [PATCH 159/825] wifi: extending framework restart waiting time 10s is not enough for low-end devices, extending waiting time to avoid false alarm for low-end devices. Bug: 201184673 Test: atest VtsHalWifiSupplicantP2pV1_4TargetTest Change-Id: I9baa53a462b97738e6dc471cf06c2b9230b92c1c --- .../1.0/vts/functional/supplicant_hidl_test_utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp index be6aad9583..ad292551a0 100644 --- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp +++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp @@ -285,7 +285,7 @@ bool turnOnExcessiveLogging(const sp& supplicant) { } bool waitForFrameworkReady() { - int waitCount = 10; + int waitCount = 15; do { // Check whether package service is ready or not. if (!testing::checkSubstringInCommandOutput( -- GitLab From cc4713ccdb38cc5705e3a99d367d8837edb6607c Mon Sep 17 00:00:00 2001 From: Maxim Pleshivenkov Date: Fri, 3 Sep 2021 15:42:08 -0400 Subject: [PATCH 160/825] Add constants for hibernation to VHAL Extended VHAL with constants for hibernation (suspend to disk). Bug: 188666978 Test: manual Change-Id: I11469b5e4c18ff6fa8450276188eaaa4c6cfa61a --- .../vehicle/VehicleApPowerStateConfigFlag.aidl | 1 + .../vehicle/VehicleApPowerStateReport.aidl | 2 ++ .../VehicleApPowerStateShutdownParam.aidl | 2 ++ .../vehicle/VehicleApPowerStateConfigFlag.aidl | 13 +++++++++++-- .../vehicle/VehicleApPowerStateReport.aidl | 18 ++++++++++++++++++ .../VehicleApPowerStateShutdownParam.aidl | 9 +++++++++ 6 files changed, 43 insertions(+), 2 deletions(-) diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl index 472b23b551..7e48eba788 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl @@ -36,4 +36,5 @@ package android.hardware.automotive.vehicle; enum VehicleApPowerStateConfigFlag { ENABLE_DEEP_SLEEP_FLAG = 1, CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 2, + ENABLE_HIBERNATION_FLAG = 3, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl index 1ca3b503c9..fc669ec17c 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl @@ -42,4 +42,6 @@ enum VehicleApPowerStateReport { ON = 6, SHUTDOWN_PREPARE = 7, SHUTDOWN_CANCELLED = 8, + HIBERNATION_ENTRY = 9, + HIBERNATION_EXIT = 10, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl index 3e0f4e845a..3fde1c7869 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl @@ -38,4 +38,6 @@ enum VehicleApPowerStateShutdownParam { CAN_SLEEP = 2, SHUTDOWN_ONLY = 3, SLEEP_IMMEDIATELY = 4, + HIBERNATE_IMMEDIATELY = 5, + CAN_HIBERNATE = 6, } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl index 7cb5db3d4d..4d8e2f5045 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl @@ -20,8 +20,10 @@ package android.hardware.automotive.vehicle; @Backing(type="int") enum VehicleApPowerStateConfigFlag { /** - * AP can enter deep sleep state. If not set, AP will always shutdown from - * VehicleApPowerState#SHUTDOWN_PREPARE power state. + * AP can enter deep sleep state. If not set, AP will shutdown from + * VehicleApPowerState#SHUTDOWN_PREPARE power state when deep sleep is requested + * (via VehicleApPowerStateShutdownParam#CAN_SLEEP or + * VehicleApPowerStateShutdownParam#SLEEP_IMMEDIATELY flags)/ */ ENABLE_DEEP_SLEEP_FLAG = 0x1, /** @@ -29,4 +31,11 @@ enum VehicleApPowerStateConfigFlag { * specified in VehicleApPowerSet VEHICLE_AP_POWER_SET_SHUTDOWN_READY message. */ CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 0x2, + /** + * AP can enter hibernation state. If not set, AP will shutdown from + * VehicleApPowerState#SHUTDOWN_PREPARE when hibernation is requested + * (via VehicleApPowerStateShutdownParam#CAN_HIBERNATE or + * VehicleApPowerStateShutdownParam#HIBERNATE_IMMEDIATELY flags) + */ + ENABLE_HIBERNATION_FLAG = 0x3, } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl index f1d741f5a1..e94fc76cf4 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl @@ -89,4 +89,22 @@ enum VehicleApPowerStateReport { * VehicleApPowerStateReq#SHUTDOWN_PREPARE. Other power state requests are ignored. */ SHUTDOWN_CANCELLED = 0x8, + /** + * AP is ready to hibernate. + * The AP will not send any more state reports after this. + * After reporting this state, AP will accept VehicleApPowerStateReq#FINISHED. + * Other power state requests are ignored. + * + * int32Values[1]: Time to turn AP back on, in seconds. Power controller should turn on + * AP after the specified time has elapsed, so AP can run tasks like + * update. If this value is 0, no wake up is requested. The power + * controller may not necessarily support timed wake-up. + */ + HIBERNATION_ENTRY = 0x9, + /** + * AP is exiting from hibernation state. + * After reporting this state, AP will accept VehicleApPowerStateReq#ON or + * VehicleApPowerStateReq#SHUTDOWN_PREPARE. Other power state requests are ignored. + */ + HIBERNATION_EXIT = 0xA, } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl index 7b682b5efa..a863d1423d 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl @@ -36,4 +36,13 @@ enum VehicleApPowerStateShutdownParam { * Postponing is not allowed. */ SLEEP_IMMEDIATELY = 4, + /** + * AP must hibernate (suspend to disk) immediately. Postponing is not allowed. + * Depending on the actual implementation, it may shut down immediately + */ + HIBERNATE_IMMEDIATELY = 5, + /** + * AP can enter hibernation (suspend to disk) instead of shutting down completely. + */ + CAN_HIBERNATE = 6, } -- GitLab From 3a5858a7113491ac8964528a78710412933e50fc Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 4 Nov 2020 09:31:02 -0800 Subject: [PATCH 161/825] wifi: remove disable_framework option to pass the stopWifiFramework procedure Stopping entire framework can cause other essential services to be stopped. When wifi is stopped, it does not interact with any of the wifi HAL's. Bug: 201266536 Bug: 201184673 Test: atest --iterations 10 \ VtsHalWifiSupplicantV1_0TargetTest \ VtsHalWifiSupplicantV1_1TargetTest \ VtsHalWifiSupplicantV1_2TargetTest \ VtsHalWifiSupplicantV1_3TargetTest \ VtsHalWifiSupplicantV1_4TargetTest \ VtsHalWifiSupplicantP2pV1_0TargetTest \ VtsHalWifiSupplicantP2pV1_2TargetTest \ VtsHalWifiSupplicantP2pV1_4TargetTest Change-Id: Ia4a38c2e942681f323cf76941713c429e14870cc --- wifi/supplicant/1.4/vts/functional/Android.bp | 2 -- 1 file changed, 2 deletions(-) diff --git a/wifi/supplicant/1.4/vts/functional/Android.bp b/wifi/supplicant/1.4/vts/functional/Android.bp index 8cbe04f686..57ee83073b 100644 --- a/wifi/supplicant/1.4/vts/functional/Android.bp +++ b/wifi/supplicant/1.4/vts/functional/Android.bp @@ -77,7 +77,6 @@ cc_test { "general-tests", "vts", ], - disable_framework: true, } cc_test { @@ -108,5 +107,4 @@ cc_test { "general-tests", "vts", ], - disable_framework: true, } -- GitLab From e613d20f91c7b3fb229b01e22a121570675cb5fe Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Fri, 1 Oct 2021 13:16:29 -0700 Subject: [PATCH 162/825] [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces Added SPDX-license-identifier-Apache-2.0 to: graphics/composer/aidl/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Change-Id: I985e4e04ec39538b992a692041ec491ff1ea8ede --- graphics/composer/aidl/Android.bp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp index 0065692826..5006185481 100644 --- a/graphics/composer/aidl/Android.bp +++ b/graphics/composer/aidl/Android.bp @@ -14,6 +14,15 @@ * 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.graphics.composer3", host_supported: true, -- GitLab From a2bbcd26bd6890eb04ca8760c9831d32cdffc1b1 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 9 Sep 2021 18:06:03 -0700 Subject: [PATCH 163/825] Migrate proto_message_converter to AIDL vhal. Migrate proto_message_converter to AIDL vhal. This would be used in grpc vehicleClient/vehiclServer. This CL also creates the required proto files. Test: unit tests. Bug: 199337732 Change-Id: Iac69a8c1578d4aba374ee0d9716da8b6b18ccace --- .../default_config/include/DefaultConfig.h | 1096 ++++++++--------- .../default_config/test/DefaultConfigTest.cpp | 4 +- .../utils/proto_message_converter/Android.bp | 50 + .../include/ProtoMessageConverter.h | 56 + .../src/ProtoMessageConverter.cpp | 146 +++ .../test/proto_message_converter_test.cpp | 103 ++ automotive/vehicle/aidl/impl/proto/Android.bp | 91 ++ .../automotive/vehicle/DumpResult.proto | 28 + .../automotive/vehicle/StatusCode.proto | 41 + .../vehicle/VehicleAreaConfig.proto | 39 + .../vehicle/VehiclePropConfig.proto | 53 + .../automotive/vehicle/VehiclePropValue.proto | 54 + .../vehicle/VehiclePropValueRequest.proto | 26 + .../vehicle/VehiclePropertyAccess.proto | 27 + .../vehicle/VehiclePropertyChangeMode.proto | 40 + .../vehicle/VehiclePropertyStatus.proto | 37 + .../vehicle/aidl/impl/utils/common/Android.bp | 4 +- 17 files changed, 1298 insertions(+), 597 deletions(-) create mode 100644 automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp create mode 100644 automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h create mode 100644 automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp create mode 100644 automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp create mode 100644 automotive/vehicle/aidl/impl/proto/Android.bp create mode 100644 automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/DumpResult.proto create mode 100644 automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto create mode 100644 automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto create mode 100644 automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropConfig.proto create mode 100644 automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValue.proto create mode 100644 automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValueRequest.proto create mode 100644 automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyAccess.proto create mode 100644 automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.proto create mode 100644 automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyStatus.proto diff --git a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h index 411075d93e..ebcb77a02c 100644 --- a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +++ b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h @@ -22,6 +22,7 @@ #include #include +#include namespace android { namespace hardware { @@ -35,6 +36,7 @@ using ::aidl::android::hardware::automotive::vehicle::EvConnectorType; using ::aidl::android::hardware::automotive::vehicle::EvsServiceState; using ::aidl::android::hardware::automotive::vehicle::EvsServiceType; using ::aidl::android::hardware::automotive::vehicle::FuelType; +using ::aidl::android::hardware::automotive::vehicle::RawPropValues; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq; using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; @@ -52,116 +54,107 @@ using ::aidl::android::hardware::automotive::vehicle::VehicleTurnSignal; using ::aidl::android::hardware::automotive::vehicle::VehicleUnit; using ::aidl::android::hardware::automotive::vehicle::VehicleVendorPermission; -} // namespace defaultconfig_impl - struct ConfigDeclaration { - defaultconfig_impl::VehiclePropConfig config; + VehiclePropConfig config; // This value will be used as an initial value for the property. If this field is specified for // property that supports multiple areas then it will be used for all areas unless particular // area is overridden in initialAreaValue field. - ::aidl::android::hardware::automotive::vehicle::RawPropValues initialValue; + RawPropValues initialValue; // Use initialAreaValues if it is necessary to specify different values per each area. - std::map - initialAreaValues; + std::map initialAreaValues; }; -const ConfigDeclaration kVehicleProperties[]{ +const std::vector kVehicleProperties = { {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_FUEL_CAPACITY), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, }, .initialValue = {.floatValues = {15000.0f}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_FUEL_TYPE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + .prop = toInt(VehicleProperty::INFO_FUEL_TYPE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, }, - .initialValue = {.int32Values = {toInt( - defaultconfig_impl::FuelType::FUEL_TYPE_UNLEADED)}}}, + .initialValue = {.int32Values = {toInt(FuelType::FUEL_TYPE_UNLEADED)}}}, {.config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::INFO_EV_BATTERY_CAPACITY), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + .prop = toInt(VehicleProperty::INFO_EV_BATTERY_CAPACITY), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, }, .initialValue = {.floatValues = {150000.0f}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_EV_CONNECTOR_TYPE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + .prop = toInt(VehicleProperty::INFO_EV_CONNECTOR_TYPE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, }, - .initialValue = {.int32Values = {toInt( - defaultconfig_impl::EvConnectorType::IEC_TYPE_1_AC)}}}, + .initialValue = {.int32Values = {toInt(EvConnectorType::IEC_TYPE_1_AC)}}}, {.config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::INFO_FUEL_DOOR_LOCATION), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + .prop = toInt(VehicleProperty::INFO_FUEL_DOOR_LOCATION), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, }, .initialValue = {.int32Values = {FUEL_DOOR_REAR_LEFT}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_EV_PORT_LOCATION), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + .prop = toInt(VehicleProperty::INFO_EV_PORT_LOCATION), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, }, .initialValue = {.int32Values = {CHARGE_PORT_FRONT_LEFT}}}, {.config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::INFO_MULTI_EV_PORT_LOCATIONS), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + .prop = toInt(VehicleProperty::INFO_MULTI_EV_PORT_LOCATIONS), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, }, .initialValue = {.int32Values = {CHARGE_PORT_FRONT_LEFT, CHARGE_PORT_REAR_LEFT}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_MAKE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + .prop = toInt(VehicleProperty::INFO_MAKE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, }, .initialValue = {.stringValue = "Toy Vehicle"}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_MODEL), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + .prop = toInt(VehicleProperty::INFO_MODEL), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, }, .initialValue = {.stringValue = "Speedy Model"}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_MODEL_YEAR), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + .prop = toInt(VehicleProperty::INFO_MODEL_YEAR), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, }, .initialValue = {.int32Values = {2020}}}, {.config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::INFO_EXTERIOR_DIMENSIONS), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + .prop = toInt(VehicleProperty::INFO_EXTERIOR_DIMENSIONS), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, }, .initialValue = {.int32Values = {1776, 4950, 2008, 2140, 2984, 1665, 1667, 11800}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::PERF_VEHICLE_SPEED), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, .maxSampleRate = 10.0f, }, @@ -169,68 +162,61 @@ const ConfigDeclaration kVehicleProperties[]{ {.config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .configArray = - {toInt(defaultconfig_impl::VehicleUnit::METER_PER_SEC), - toInt(defaultconfig_impl::VehicleUnit::MILES_PER_HOUR), - toInt(defaultconfig_impl::VehicleUnit::KILOMETERS_PER_HOUR)}, + .prop = toInt(VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {toInt(VehicleUnit::METER_PER_SEC), + toInt(VehicleUnit::MILES_PER_HOUR), + toInt(VehicleUnit::KILOMETERS_PER_HOUR)}, }, - .initialValue = {.int32Values = {toInt( - defaultconfig_impl::VehicleUnit::KILOMETERS_PER_HOUR)}}}, + .initialValue = {.int32Values = {toInt(VehicleUnit::KILOMETERS_PER_HOUR)}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::SEAT_OCCUPANCY), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = - {defaultconfig_impl::VehicleAreaConfig{.areaId = (SEAT_1_LEFT)}, - defaultconfig_impl::VehicleAreaConfig{.areaId = (SEAT_1_RIGHT)}}, + .prop = toInt(VehicleProperty::SEAT_OCCUPANCY), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = (SEAT_1_LEFT)}, + VehicleAreaConfig{.areaId = (SEAT_1_RIGHT)}}, }, - .initialAreaValues = - {{SEAT_1_LEFT, - {.int32Values = {toInt(defaultconfig_impl::VehicleSeatOccupancyState::VACANT)}}}, - {SEAT_1_RIGHT, - {.int32Values = {toInt( - defaultconfig_impl::VehicleSeatOccupancyState::VACANT)}}}}}, + .initialAreaValues = {{SEAT_1_LEFT, + {.int32Values = {toInt(VehicleSeatOccupancyState::VACANT)}}}, + {SEAT_1_RIGHT, + {.int32Values = {toInt(VehicleSeatOccupancyState::VACANT)}}}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::INFO_DRIVER_SEAT), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + .prop = toInt(VehicleProperty::INFO_DRIVER_SEAT), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, // this was a zoned property on an old vhal, but it is meant to be global - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = (0)}}, + .areaConfigs = {VehicleAreaConfig{.areaId = (0)}}, }, .initialValue = {.int32Values = {SEAT_1_LEFT}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::PERF_ODOMETER), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .prop = toInt(VehicleProperty::PERF_ODOMETER), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, .maxSampleRate = 10.0f, }, .initialValue = {.floatValues = {0.0f}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::PERF_STEERING_ANGLE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .prop = toInt(VehicleProperty::PERF_STEERING_ANGLE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, .maxSampleRate = 10.0f, }, .initialValue = {.floatValues = {0.0f}}}, {.config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::PERF_REAR_STEERING_ANGLE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .prop = toInt(VehicleProperty::PERF_REAR_STEERING_ANGLE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, .maxSampleRate = 10.0f, }, @@ -238,10 +224,9 @@ const ConfigDeclaration kVehicleProperties[]{ { .config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::ENGINE_RPM), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .prop = toInt(VehicleProperty::ENGINE_RPM), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, .maxSampleRate = 10.0f, }, @@ -250,9 +235,9 @@ const ConfigDeclaration kVehicleProperties[]{ {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::FUEL_LEVEL), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .prop = toInt(VehicleProperty::FUEL_LEVEL), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, .maxSampleRate = 100.0f, }, @@ -260,17 +245,17 @@ const ConfigDeclaration kVehicleProperties[]{ {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::FUEL_DOOR_OPEN), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::FUEL_DOOR_OPEN), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {0}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::EV_BATTERY_LEVEL), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .prop = toInt(VehicleProperty::EV_BATTERY_LEVEL), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, .maxSampleRate = 100.0f, }, @@ -278,27 +263,25 @@ const ConfigDeclaration kVehicleProperties[]{ {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::EV_CHARGE_PORT_OPEN), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::EV_CHARGE_PORT_OPEN), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {0}}}, {.config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::EV_CHARGE_PORT_CONNECTED), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::EV_CHARGE_PORT_CONNECTED), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {0}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty:: - EV_BATTERY_INSTANTANEOUS_CHARGE_RATE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .prop = toInt(VehicleProperty::EV_BATTERY_INSTANTANEOUS_CHARGE_RATE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, .maxSampleRate = 10.0f, }, @@ -306,9 +289,9 @@ const ConfigDeclaration kVehicleProperties[]{ {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::RANGE_REMAINING), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .prop = toInt(VehicleProperty::RANGE_REMAINING), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, .maxSampleRate = 2.0f, }, @@ -316,25 +299,25 @@ const ConfigDeclaration kVehicleProperties[]{ {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::TIRE_PRESSURE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{ + .prop = toInt(VehicleProperty::TIRE_PRESSURE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, + .areaConfigs = {VehicleAreaConfig{ .areaId = WHEEL_FRONT_LEFT, .minFloatValue = 193.0f, .maxFloatValue = 300.0f, }, - defaultconfig_impl::VehicleAreaConfig{ + VehicleAreaConfig{ .areaId = WHEEL_FRONT_RIGHT, .minFloatValue = 193.0f, .maxFloatValue = 300.0f, }, - defaultconfig_impl::VehicleAreaConfig{ + VehicleAreaConfig{ .areaId = WHEEL_REAR_LEFT, .minFloatValue = 193.0f, .maxFloatValue = 300.0f, }, - defaultconfig_impl::VehicleAreaConfig{ + VehicleAreaConfig{ .areaId = WHEEL_REAR_RIGHT, .minFloatValue = 193.0f, .maxFloatValue = 300.0f, @@ -346,10 +329,9 @@ const ConfigDeclaration kVehicleProperties[]{ {.config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, + .prop = toInt(VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, }, .initialAreaValues = {{WHEEL_FRONT_LEFT, {.floatValues = {137.0f}}}, {WHEEL_FRONT_RIGHT, {.floatValues = {137.0f}}}, @@ -358,78 +340,73 @@ const ConfigDeclaration kVehicleProperties[]{ {.config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::TIRE_PRESSURE_DISPLAY_UNITS), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {toInt(defaultconfig_impl::VehicleUnit::KILOPASCAL), - toInt(defaultconfig_impl::VehicleUnit::PSI), - toInt(defaultconfig_impl::VehicleUnit::BAR)}, + .prop = toInt(VehicleProperty::TIRE_PRESSURE_DISPLAY_UNITS), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {toInt(VehicleUnit::KILOPASCAL), toInt(VehicleUnit::PSI), + toInt(VehicleUnit::BAR)}, }, - .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleUnit::PSI)}}}, + .initialValue = {.int32Values = {toInt(VehicleUnit::PSI)}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::CURRENT_GEAR), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {toInt(defaultconfig_impl::VehicleGear::GEAR_PARK), - toInt(defaultconfig_impl::VehicleGear::GEAR_NEUTRAL), - toInt(defaultconfig_impl::VehicleGear::GEAR_REVERSE), - toInt(defaultconfig_impl::VehicleGear::GEAR_1), - toInt(defaultconfig_impl::VehicleGear::GEAR_2), - toInt(defaultconfig_impl::VehicleGear::GEAR_3), - toInt(defaultconfig_impl::VehicleGear::GEAR_4), - toInt(defaultconfig_impl::VehicleGear::GEAR_5)}, + .prop = toInt(VehicleProperty::CURRENT_GEAR), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {toInt(VehicleGear::GEAR_PARK), + toInt(VehicleGear::GEAR_NEUTRAL), + toInt(VehicleGear::GEAR_REVERSE), + toInt(VehicleGear::GEAR_1), toInt(VehicleGear::GEAR_2), + toInt(VehicleGear::GEAR_3), toInt(VehicleGear::GEAR_4), + toInt(VehicleGear::GEAR_5)}, }, - .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleGear::GEAR_PARK)}}}, + .initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::PARKING_BRAKE_ON), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::PARKING_BRAKE_ON), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {1}}}, {.config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::PARKING_BRAKE_AUTO_APPLY), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::PARKING_BRAKE_AUTO_APPLY), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {1}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::FUEL_LEVEL_LOW), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::FUEL_LEVEL_LOW), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {0}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::HW_KEY_INPUT), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::HW_KEY_INPUT), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {0, 0, 0}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::HW_ROTARY_INPUT), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::HW_ROTARY_INPUT), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {0, 0, 0}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::HW_CUSTOM_INPUT), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::HW_CUSTOM_INPUT), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {0, 0, 0, 3, 0, 0, 0, 0, 0}, }, .initialValue = @@ -437,106 +414,98 @@ const ConfigDeclaration kVehicleProperties[]{ .int32Values = {0, 0, 0}, }}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_POWER_ON), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}, + {.config = {.prop = toInt(VehicleProperty::HVAC_POWER_ON), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}, // TODO(bryaneyler): Ideally, this is generated dynamically from // kHvacPowerProperties. - .configArray = - {toInt(defaultconfig_impl::VehicleProperty::HVAC_FAN_SPEED), - toInt(defaultconfig_impl::VehicleProperty::HVAC_FAN_DIRECTION)}}, + .configArray = {toInt(VehicleProperty::HVAC_FAN_SPEED), + toInt(VehicleProperty::HVAC_FAN_DIRECTION)}}, .initialValue = {.int32Values = {1}}}, { - .config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_DEFROSTER), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .config = {.prop = toInt(VehicleProperty::HVAC_DEFROSTER), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .areaConfigs = - {defaultconfig_impl::VehicleAreaConfig{ - .areaId = toInt(defaultconfig_impl::VehicleAreaWindow:: - FRONT_WINDSHIELD)}, - defaultconfig_impl::VehicleAreaConfig{ - .areaId = toInt(defaultconfig_impl::VehicleAreaWindow:: - REAR_WINDSHIELD)}}}, + {VehicleAreaConfig{ + .areaId = toInt(VehicleAreaWindow::FRONT_WINDSHIELD)}, + VehicleAreaConfig{ + .areaId = toInt(VehicleAreaWindow::REAR_WINDSHIELD)}}}, .initialValue = {.int32Values = {0}} // Will be used for all areas. }, { - .config = {.prop = toInt( - defaultconfig_impl::VehicleProperty::HVAC_ELECTRIC_DEFROSTER_ON), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .config = {.prop = toInt(VehicleProperty::HVAC_ELECTRIC_DEFROSTER_ON), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .areaConfigs = - {defaultconfig_impl::VehicleAreaConfig{ - .areaId = toInt(defaultconfig_impl::VehicleAreaWindow:: - FRONT_WINDSHIELD)}, - defaultconfig_impl::VehicleAreaConfig{ - .areaId = toInt(defaultconfig_impl::VehicleAreaWindow:: - REAR_WINDSHIELD)}}}, + {VehicleAreaConfig{ + .areaId = toInt(VehicleAreaWindow::FRONT_WINDSHIELD)}, + VehicleAreaConfig{ + .areaId = toInt(VehicleAreaWindow::REAR_WINDSHIELD)}}}, .initialValue = {.int32Values = {0}} // Will be used for all areas. }, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_MAX_DEFROST_ON), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + {.config = {.prop = toInt(VehicleProperty::HVAC_MAX_DEFROST_ON), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, .initialValue = {.int32Values = {0}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_RECIRC_ON), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + {.config = {.prop = toInt(VehicleProperty::HVAC_RECIRC_ON), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, .initialValue = {.int32Values = {1}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_AUTO_RECIRC_ON), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_RECIRC_ON), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, .initialValue = {.int32Values = {0}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_AC_ON), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + {.config = {.prop = toInt(VehicleProperty::HVAC_AC_ON), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, .initialValue = {.int32Values = {1}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_MAX_AC_ON), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + {.config = {.prop = toInt(VehicleProperty::HVAC_MAX_AC_ON), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, .initialValue = {.int32Values = {0}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_AUTO_ON), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_ON), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, .initialValue = {.int32Values = {1}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_DUAL_ON), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + {.config = {.prop = toInt(VehicleProperty::HVAC_DUAL_ON), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, .initialValue = {.int32Values = {0}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_FAN_SPEED), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{ + {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{ .areaId = HVAC_ALL, .minInt32Value = 1, .maxInt32Value = 7}}}, .initialValue = {.int32Values = {3}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_FAN_DIRECTION), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, - .initialValue = {.int32Values = {toInt( - defaultconfig_impl::VehicleHvacFanDirection::FACE)}}}, - - {.config = {.prop = toInt( - defaultconfig_impl::VehicleProperty::HVAC_FAN_DIRECTION_AVAILABLE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::STATIC, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_ALL}}}, + {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, + .initialValue = {.int32Values = {toInt(VehicleHvacFanDirection::FACE)}}}, + + {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION_AVAILABLE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, + .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, .initialValue = {.int32Values = {FAN_DIRECTION_FACE, FAN_DIRECTION_FLOOR, FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR, FAN_DIRECTION_DEFROST, @@ -544,15 +513,15 @@ const ConfigDeclaration kVehicleProperties[]{ FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST, FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST | FAN_DIRECTION_FACE}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_SEAT_VENTILATION), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{ + {.config = {.prop = toInt(VehicleProperty::HVAC_SEAT_VENTILATION), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{ .areaId = SEAT_1_LEFT, .minInt32Value = 0, .maxInt32Value = 3, }, - defaultconfig_impl::VehicleAreaConfig{ + VehicleAreaConfig{ .areaId = SEAT_1_RIGHT, .minInt32Value = 0, .maxInt32Value = 3, @@ -560,38 +529,38 @@ const ConfigDeclaration kVehicleProperties[]{ .initialValue = {.int32Values = {0}}}, // 0 is off and +ve values indicate ventilation level. - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_STEERING_WHEEL_HEAT), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{ + {.config = {.prop = toInt(VehicleProperty::HVAC_STEERING_WHEEL_HEAT), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{ .areaId = (0), .minInt32Value = -2, .maxInt32Value = 2}}}, .initialValue = {.int32Values = {0}}}, // +ve values for heating and -ve for cooling - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_SEAT_TEMPERATURE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{ + {.config = {.prop = toInt(VehicleProperty::HVAC_SEAT_TEMPERATURE), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{ .areaId = SEAT_1_LEFT, .minInt32Value = -2, .maxInt32Value = 2, }, - defaultconfig_impl::VehicleAreaConfig{ + VehicleAreaConfig{ .areaId = SEAT_1_RIGHT, .minInt32Value = -2, .maxInt32Value = 2, }}}, .initialValue = {.int32Values = {0}}}, // +ve values for heating and -ve for cooling - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::HVAC_TEMPERATURE_SET), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + {.config = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {160, 280, 5, 605, 825, 10}, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{ + .areaConfigs = {VehicleAreaConfig{ .areaId = HVAC_LEFT, .minFloatValue = 16, .maxFloatValue = 32, }, - defaultconfig_impl::VehicleAreaConfig{ + VehicleAreaConfig{ .areaId = HVAC_RIGHT, .minFloatValue = 16, .maxFloatValue = 32, @@ -601,99 +570,90 @@ const ConfigDeclaration kVehicleProperties[]{ {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, - .initialValue = {.floatValues = {66.2f, (float)defaultconfig_impl::VehicleUnit::FAHRENHEIT, - 19.0f, 66.5f}}}, + .initialValue = {.floatValues = {66.2f, (float)VehicleUnit::FAHRENHEIT, 19.0f, 66.5f}}}, {.config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::ENV_OUTSIDE_TEMPERATURE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, + .prop = toInt(VehicleProperty::ENV_OUTSIDE_TEMPERATURE), + .access = VehiclePropertyAccess::READ, // TODO(bryaneyler): Support ON_CHANGE as well. - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, .maxSampleRate = 2.0f, }, .initialValue = {.floatValues = {25.0f}}}, - {.config = {.prop = toInt( - defaultconfig_impl::VehicleProperty::HVAC_TEMPERATURE_DISPLAY_UNITS), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {toInt(defaultconfig_impl::VehicleUnit::FAHRENHEIT), - toInt(defaultconfig_impl::VehicleUnit::CELSIUS)}}, - .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleUnit::FAHRENHEIT)}}}, + {.config = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_DISPLAY_UNITS), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {toInt(VehicleUnit::FAHRENHEIT), toInt(VehicleUnit::CELSIUS)}}, + .initialValue = {.int32Values = {toInt(VehicleUnit::FAHRENHEIT)}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::DISTANCE_DISPLAY_UNITS), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = (0)}}, - .configArray = {toInt(defaultconfig_impl::VehicleUnit::KILOMETER), - toInt(defaultconfig_impl::VehicleUnit::MILE)}, + .prop = toInt(VehicleProperty::DISTANCE_DISPLAY_UNITS), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = (0)}}, + .configArray = {toInt(VehicleUnit::KILOMETER), toInt(VehicleUnit::MILE)}, }, - .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleUnit::MILE)}}}, + .initialValue = {.int32Values = {toInt(VehicleUnit::MILE)}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::NIGHT_MODE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::NIGHT_MODE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {0}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::GEAR_SELECTION), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {toInt(defaultconfig_impl::VehicleGear::GEAR_PARK), - toInt(defaultconfig_impl::VehicleGear::GEAR_NEUTRAL), - toInt(defaultconfig_impl::VehicleGear::GEAR_REVERSE), - toInt(defaultconfig_impl::VehicleGear::GEAR_DRIVE), - toInt(defaultconfig_impl::VehicleGear::GEAR_1), - toInt(defaultconfig_impl::VehicleGear::GEAR_2), - toInt(defaultconfig_impl::VehicleGear::GEAR_3), - toInt(defaultconfig_impl::VehicleGear::GEAR_4), - toInt(defaultconfig_impl::VehicleGear::GEAR_5)}, + .prop = toInt(VehicleProperty::GEAR_SELECTION), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {toInt(VehicleGear::GEAR_PARK), + toInt(VehicleGear::GEAR_NEUTRAL), + toInt(VehicleGear::GEAR_REVERSE), + toInt(VehicleGear::GEAR_DRIVE), toInt(VehicleGear::GEAR_1), + toInt(VehicleGear::GEAR_2), toInt(VehicleGear::GEAR_3), + toInt(VehicleGear::GEAR_4), toInt(VehicleGear::GEAR_5)}, }, - .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleGear::GEAR_PARK)}}}, + .initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::TURN_SIGNAL_STATE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::TURN_SIGNAL_STATE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, - .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleTurnSignal::NONE)}}}, + .initialValue = {.int32Values = {toInt(VehicleTurnSignal::NONE)}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::IGNITION_STATE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::IGNITION_STATE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, - .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleIgnitionState::ON)}}}, + .initialValue = {.int32Values = {toInt(VehicleIgnitionState::ON)}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::ENGINE_OIL_LEVEL), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::ENGINE_OIL_LEVEL), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, - .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleOilLevel::NORMAL)}}}, + .initialValue = {.int32Values = {toInt(VehicleOilLevel::NORMAL)}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::ENGINE_OIL_TEMP), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .prop = toInt(VehicleProperty::ENGINE_OIL_TEMP), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 0.1, // 0.1 Hz, every 10 seconds .maxSampleRate = 10, // 10 Hz, every 100 ms }, @@ -701,8 +661,8 @@ const ConfigDeclaration kVehicleProperties[]{ { .config = {.prop = kMixedTypePropertyForTest, - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {1, 1, 0, 2, 0, 0, 1, 0, 0}}, .initialValue = { @@ -712,70 +672,69 @@ const ConfigDeclaration kVehicleProperties[]{ }, }, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::DOOR_LOCK), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_LEFT}, - defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_RIGHT}, - defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_LEFT}, - defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}}, + {.config = {.prop = toInt(VehicleProperty::DOOR_LOCK), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = DOOR_1_LEFT}, + VehicleAreaConfig{.areaId = DOOR_1_RIGHT}, + VehicleAreaConfig{.areaId = DOOR_2_LEFT}, + VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}}, .initialAreaValues = {{DOOR_1_LEFT, {.int32Values = {1}}}, {DOOR_1_RIGHT, {.int32Values = {1}}}, {DOOR_2_LEFT, {.int32Values = {1}}}, {DOOR_2_RIGHT, {.int32Values = {1}}}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::DOOR_POS), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + {.config = {.prop = toInt(VehicleProperty::DOOR_POS), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .areaConfigs = - {defaultconfig_impl::VehicleAreaConfig{ + {VehicleAreaConfig{ .areaId = DOOR_1_LEFT, .minInt32Value = 0, .maxInt32Value = 1}, - defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 1}, - defaultconfig_impl::VehicleAreaConfig{ + VehicleAreaConfig{.areaId = DOOR_1_RIGHT, + .minInt32Value = 0, + .maxInt32Value = 1}, + VehicleAreaConfig{ .areaId = DOOR_2_LEFT, .minInt32Value = 0, .maxInt32Value = 1}, - defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 1}, - defaultconfig_impl::VehicleAreaConfig{ + VehicleAreaConfig{.areaId = DOOR_2_RIGHT, + .minInt32Value = 0, + .maxInt32Value = 1}, + VehicleAreaConfig{ .areaId = DOOR_REAR, .minInt32Value = 0, .maxInt32Value = 1}}}, .initialValue = {.int32Values = {0}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::WINDOW_LOCK), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{ - .areaId = WINDOW_1_RIGHT | WINDOW_2_LEFT | WINDOW_2_RIGHT}}}, + {.config = {.prop = toInt(VehicleProperty::WINDOW_LOCK), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = WINDOW_1_RIGHT | WINDOW_2_LEFT | + WINDOW_2_RIGHT}}}, .initialAreaValues = {{WINDOW_1_RIGHT | WINDOW_2_LEFT | WINDOW_2_RIGHT, {.int32Values = {0}}}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::WINDOW_POS), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = WINDOW_1_LEFT, - .minInt32Value = 0, - .maxInt32Value = 10}, - defaultconfig_impl::VehicleAreaConfig{.areaId = WINDOW_1_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 10}, - defaultconfig_impl::VehicleAreaConfig{.areaId = WINDOW_2_LEFT, - .minInt32Value = 0, - .maxInt32Value = 10}, - defaultconfig_impl::VehicleAreaConfig{.areaId = WINDOW_2_RIGHT, - .minInt32Value = 0, - .maxInt32Value = 10}, - defaultconfig_impl::VehicleAreaConfig{ - .areaId = WINDOW_ROOF_TOP_1, - .minInt32Value = -10, - .maxInt32Value = 10}}}, + {.config = {.prop = toInt(VehicleProperty::WINDOW_POS), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = WINDOW_1_LEFT, + .minInt32Value = 0, + .maxInt32Value = 10}, + VehicleAreaConfig{.areaId = WINDOW_1_RIGHT, + .minInt32Value = 0, + .maxInt32Value = 10}, + VehicleAreaConfig{.areaId = WINDOW_2_LEFT, + .minInt32Value = 0, + .maxInt32Value = 10}, + VehicleAreaConfig{.areaId = WINDOW_2_RIGHT, + .minInt32Value = 0, + .maxInt32Value = 10}, + VehicleAreaConfig{.areaId = WINDOW_ROOF_TOP_1, + .minInt32Value = -10, + .maxInt32Value = 10}}}, .initialValue = {.int32Values = {0}}}, {.config = { .prop = WHEEL_TICK, - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::CONTINUOUS, + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .configArray = {ALL_WHEELS, 50000, 50000, 50000, 50000}, .minSampleRate = 1.0f, .maxSampleRate = 10.0f, @@ -783,371 +742,324 @@ const ConfigDeclaration kVehicleProperties[]{ .initialValue = {.int64Values = {0, 100000, 200000, 300000, 400000}}}, {.config = {.prop = ABS_ACTIVE, - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}, + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, .initialValue = {.int32Values = {0}}}, {.config = {.prop = TRACTION_CONTROL_ACTIVE, - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}, + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, .initialValue = {.int32Values = {0}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::AP_POWER_STATE_REQ), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {3}}, - .initialValue = {.int32Values = {toInt(defaultconfig_impl::VehicleApPowerStateReq::ON), - 0}}}, + .initialValue = {.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::AP_POWER_STATE_REPORT), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}, - .initialValue = - {.int32Values = - {toInt(defaultconfig_impl::VehicleApPowerStateReport::WAIT_FOR_VHAL), - 0}}}, - - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty::DISPLAY_BRIGHTNESS), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.minInt32Value = 0, - .maxInt32Value = 100}}}, + {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, + .initialValue = {.int32Values = {toInt(VehicleApPowerStateReport::WAIT_FOR_VHAL), 0}}}, + + {.config = {.prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.minInt32Value = 0, .maxInt32Value = 100}}}, .initialValue = {.int32Values = {100}}}, { .config = {.prop = OBD2_LIVE_FRAME, - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {0, 0}}, }, { .config = {.prop = OBD2_FREEZE_FRAME, - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {0, 0}}, }, { .config = {.prop = OBD2_FREEZE_FRAME_INFO, - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}, + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, }, { .config = {.prop = OBD2_FREEZE_FRAME_CLEAR, - .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .access = VehiclePropertyAccess::WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {1}}, }, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::HEADLIGHTS_STATE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::HEADLIGHTS_STATE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::HIGH_BEAM_LIGHTS_STATE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::HIGH_BEAM_LIGHTS_STATE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::FOG_LIGHTS_STATE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::FOG_LIGHTS_STATE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::HAZARD_LIGHTS_STATE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::HAZARD_LIGHTS_STATE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::HEADLIGHTS_SWITCH), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::HEADLIGHTS_SWITCH), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, {.config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::HIGH_BEAM_LIGHTS_SWITCH), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::HIGH_BEAM_LIGHTS_SWITCH), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::FOG_LIGHTS_SWITCH), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::FOG_LIGHTS_SWITCH), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::HAZARD_LIGHTS_SWITCH), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::HAZARD_LIGHTS_SWITCH), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::EVS_SERVICE_REQUEST), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::EVS_SERVICE_REQUEST), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, - .initialValue = {.int32Values = {toInt(defaultconfig_impl::EvsServiceType::REARVIEW), - toInt(defaultconfig_impl::EvsServiceState::OFF)}}}, + .initialValue = {.int32Values = {toInt(EvsServiceType::REARVIEW), + toInt(EvsServiceState::OFF)}}}, {.config = {.prop = VEHICLE_MAP_SERVICE, - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}}, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE}}, // Example Vendor Extension properties for testing {.config = {.prop = VENDOR_EXTENSION_BOOLEAN_PROPERTY, - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_LEFT}, - defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_1_RIGHT}, - defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_LEFT}, - defaultconfig_impl::VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}}, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = DOOR_1_LEFT}, + VehicleAreaConfig{.areaId = DOOR_1_RIGHT}, + VehicleAreaConfig{.areaId = DOOR_2_LEFT}, + VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}}, .initialAreaValues = {{DOOR_1_LEFT, {.int32Values = {1}}}, {DOOR_1_RIGHT, {.int32Values = {1}}}, {DOOR_2_LEFT, {.int32Values = {0}}}, {DOOR_2_RIGHT, {.int32Values = {0}}}}}, {.config = {.prop = VENDOR_EXTENSION_FLOAT_PROPERTY, - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = {defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_LEFT, - .minFloatValue = -10, - .maxFloatValue = 10}, - defaultconfig_impl::VehicleAreaConfig{.areaId = HVAC_RIGHT, - .minFloatValue = -10, - .maxFloatValue = 10}}}, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_LEFT, + .minFloatValue = -10, + .maxFloatValue = 10}, + VehicleAreaConfig{.areaId = HVAC_RIGHT, + .minFloatValue = -10, + .maxFloatValue = 10}}}, .initialAreaValues = {{HVAC_LEFT, {.floatValues = {1}}}, {HVAC_RIGHT, {.floatValues = {2}}}}}, {.config = {.prop = VENDOR_EXTENSION_INT_PROPERTY, - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .areaConfigs = - {defaultconfig_impl::VehicleAreaConfig{ - .areaId = toInt(defaultconfig_impl::VehicleAreaWindow:: - FRONT_WINDSHIELD), - .minInt32Value = -100, - .maxInt32Value = 100}, - defaultconfig_impl::VehicleAreaConfig{ - .areaId = toInt(defaultconfig_impl::VehicleAreaWindow:: - REAR_WINDSHIELD), - .minInt32Value = -100, - .maxInt32Value = 100}, - defaultconfig_impl::VehicleAreaConfig{ - .areaId = toInt( - defaultconfig_impl::VehicleAreaWindow::ROOF_TOP_1), - .minInt32Value = -100, - .maxInt32Value = 100}}}, - .initialAreaValues = {{toInt(defaultconfig_impl::VehicleAreaWindow::FRONT_WINDSHIELD), - {.int32Values = {1}}}, - {toInt(defaultconfig_impl::VehicleAreaWindow::REAR_WINDSHIELD), - {.int32Values = {0}}}, - {toInt(defaultconfig_impl::VehicleAreaWindow::ROOF_TOP_1), - {.int32Values = {-1}}}}}, + {VehicleAreaConfig{.areaId = toInt(VehicleAreaWindow::FRONT_WINDSHIELD), + .minInt32Value = -100, + .maxInt32Value = 100}, + VehicleAreaConfig{.areaId = toInt(VehicleAreaWindow::REAR_WINDSHIELD), + .minInt32Value = -100, + .maxInt32Value = 100}, + VehicleAreaConfig{.areaId = toInt(VehicleAreaWindow::ROOF_TOP_1), + .minInt32Value = -100, + .maxInt32Value = 100}}}, + .initialAreaValues = {{toInt(VehicleAreaWindow::FRONT_WINDSHIELD), {.int32Values = {1}}}, + {toInt(VehicleAreaWindow::REAR_WINDSHIELD), {.int32Values = {0}}}, + {toInt(VehicleAreaWindow::ROOF_TOP_1), {.int32Values = {-1}}}}}, {.config = {.prop = VENDOR_EXTENSION_STRING_PROPERTY, - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, .initialValue = {.stringValue = "Vendor String Property"}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty:: - ELECTRONIC_TOLL_COLLECTION_CARD_TYPE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}, + {.config = {.prop = toInt(VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_TYPE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, .initialValue = {.int32Values = {0}}}, - {.config = {.prop = toInt(defaultconfig_impl::VehicleProperty:: - ELECTRONIC_TOLL_COLLECTION_CARD_STATUS), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE}, + {.config = {.prop = toInt(VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_STATUS), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, .initialValue = {.int32Values = {0}}}, {.config = { - .prop = toInt(defaultconfig_impl::VehicleProperty:: - SUPPORT_CUSTOMIZE_VENDOR_PERMISSION), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, - .configArray = - {kMixedTypePropertyForTest, - toInt(defaultconfig_impl:: - VehicleVendorPermission:: - PERMISSION_GET_VENDOR_CATEGORY_INFO), - toInt(defaultconfig_impl:: - VehicleVendorPermission:: - PERMISSION_SET_VENDOR_CATEGORY_INFO), - VENDOR_EXTENSION_INT_PROPERTY, - toInt(defaultconfig_impl:: - VehicleVendorPermission:: - PERMISSION_GET_VENDOR_CATEGORY_SEAT), - toInt(defaultconfig_impl:: - VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE), - VENDOR_EXTENSION_FLOAT_PROPERTY, - toInt(defaultconfig_impl:: - VehicleVendorPermission::PERMISSION_DEFAULT), - toInt(defaultconfig_impl:: - VehicleVendorPermission::PERMISSION_DEFAULT)}, + .prop = toInt(VehicleProperty::SUPPORT_CUSTOMIZE_VENDOR_PERMISSION), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {kMixedTypePropertyForTest, + toInt(VehicleVendorPermission:: + PERMISSION_GET_VENDOR_CATEGORY_INFO), + toInt(VehicleVendorPermission:: + PERMISSION_SET_VENDOR_CATEGORY_INFO), + VENDOR_EXTENSION_INT_PROPERTY, + toInt(VehicleVendorPermission:: + PERMISSION_GET_VENDOR_CATEGORY_SEAT), + toInt(VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE), + VENDOR_EXTENSION_FLOAT_PROPERTY, + toInt(VehicleVendorPermission::PERMISSION_DEFAULT), + toInt(VehicleVendorPermission::PERMISSION_DEFAULT)}, }, .initialValue = {.int32Values = {1}}}, { .config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::INITIAL_USER_INFO), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::INITIAL_USER_INFO), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::SWITCH_USER), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::SWITCH_USER), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::CREATE_USER), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::CREATE_USER), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::REMOVE_USER), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::REMOVE_USER), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { - .prop = toInt(defaultconfig_impl::VehicleProperty:: - USER_IDENTIFICATION_ASSOCIATION), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::POWER_POLICY_REQ), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::POWER_POLICY_REQ), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { - .prop = toInt(defaultconfig_impl::VehicleProperty:: - POWER_POLICY_GROUP_REQ), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::POWER_POLICY_GROUP_REQ), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::CURRENT_POWER_POLICY), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::CURRENT_POWER_POLICY), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::EPOCH_TIME), - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::EPOCH_TIME), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::WATCHDOG_ALIVE), - .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::WATCHDOG_ALIVE), + .access = VehiclePropertyAccess::WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { - .prop = toInt(defaultconfig_impl::VehicleProperty:: - WATCHDOG_TERMINATED_PROCESS), - .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::WATCHDOG_TERMINATED_PROCESS), + .access = VehiclePropertyAccess::WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { - .prop = toInt(defaultconfig_impl::VehicleProperty::VHAL_HEARTBEAT), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::VHAL_HEARTBEAT), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::CLUSTER_SWITCH_UI), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::CLUSTER_SWITCH_UI), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {0 /* ClusterHome */, -1 /* ClusterNone */}}, }, { .config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::CLUSTER_DISPLAY_STATE), - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::CLUSTER_DISPLAY_STATE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1, -1, -1 /* Insets */}}, @@ -1155,41 +1067,34 @@ const ConfigDeclaration kVehicleProperties[]{ { .config = { - .prop = toInt( - defaultconfig_impl::VehicleProperty::CLUSTER_REPORT_STATE), - .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::CLUSTER_REPORT_STATE), + .access = VehiclePropertyAccess::WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {0, 0, 0, 11, 0, 0, 0, 0, 16}, }, }, { .config = { - .prop = toInt(defaultconfig_impl::VehicleProperty:: - CLUSTER_REQUEST_DISPLAY), - .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::CLUSTER_REQUEST_DISPLAY), + .access = VehiclePropertyAccess::WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { - .prop = toInt(defaultconfig_impl::VehicleProperty:: - CLUSTER_NAVIGATION_STATE), - .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .prop = toInt(VehicleProperty::CLUSTER_NAVIGATION_STATE), + .access = VehiclePropertyAccess::WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { .prop = PLACEHOLDER_PROPERTY_INT, - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {0}}, }, @@ -1197,9 +1102,8 @@ const ConfigDeclaration kVehicleProperties[]{ .config = { .prop = PLACEHOLDER_PROPERTY_FLOAT, - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.floatValues = {0.0f}}, }, @@ -1207,9 +1111,8 @@ const ConfigDeclaration kVehicleProperties[]{ .config = { .prop = PLACEHOLDER_PROPERTY_BOOLEAN, - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {0 /* false */}}, }, @@ -1217,9 +1120,8 @@ const ConfigDeclaration kVehicleProperties[]{ .config = { .prop = PLACEHOLDER_PROPERTY_STRING, - .access = defaultconfig_impl::VehiclePropertyAccess::READ_WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.stringValue = {"Test"}}, }, @@ -1229,27 +1131,24 @@ const ConfigDeclaration kVehicleProperties[]{ .config = { .prop = VENDOR_CLUSTER_SWITCH_UI, - .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .access = VehiclePropertyAccess::WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { .prop = VENDOR_CLUSTER_DISPLAY_STATE, - .access = defaultconfig_impl::VehiclePropertyAccess::WRITE, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .access = VehiclePropertyAccess::WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, { .config = { .prop = VENDOR_CLUSTER_REPORT_STATE, - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {0, 0, 0, 11, 0, 0, 0, 0, 16}, }, .initialValue = {.int32Values = {0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1, @@ -1260,9 +1159,8 @@ const ConfigDeclaration kVehicleProperties[]{ .config = { .prop = VENDOR_CLUSTER_REQUEST_DISPLAY, - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, .initialValue = {.int32Values = {0 /* ClusterHome */}}, }, @@ -1270,14 +1168,26 @@ const ConfigDeclaration kVehicleProperties[]{ .config = { .prop = VENDOR_CLUSTER_NAVIGATION_STATE, - .access = defaultconfig_impl::VehiclePropertyAccess::READ, - .changeMode = - defaultconfig_impl::VehiclePropertyChangeMode::ON_CHANGE, + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, #endif // ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING }; +} // namespace defaultconfig_impl + +// public namespace +namespace defaultconfig { + +typedef defaultconfig_impl::ConfigDeclaration ConfigDeclaration; + +inline constexpr const std::vector& getDefaultConfigs() { + return defaultconfig_impl::kVehicleProperties; +} + +} // namespace defaultconfig + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp b/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp index 6385ac1472..baaae75108 100644 --- a/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp +++ b/automotive/vehicle/aidl/impl/default_config/test/DefaultConfigTest.cpp @@ -22,17 +22,19 @@ namespace android { namespace hardware { namespace automotive { namespace vehicle { +namespace defaultconfig { namespace test { TEST(DefaultConfigTest, loadDefaultConfigs) { - for (ConfigDeclaration config : kVehicleProperties) { + for (ConfigDeclaration config : getDefaultConfigs()) { ASSERT_NE(0, config.config.prop); } } } // namespace test +} // namespace defaultconfig } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp new file mode 100644 index 0000000000..2b0b11f2d2 --- /dev/null +++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp @@ -0,0 +1,50 @@ +/* + * 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. + */ + +cc_library { + name: "VehicleHalProtoMessageConverter", + srcs: [ + "src/*.cpp", + ], + vendor: true, + local_include_dirs: ["include"], + export_include_dirs: ["include"], + shared_libs: ["libprotobuf-cpp-full"], + static_libs: [ + "VehicleHalProtos", + "VehicleHalUtils", + ], + defaults: ["VehicleHalDefaults"], + export_static_lib_headers: ["VehicleHalUtils"], +} + +cc_test { + name: "VehicleHalProtoMessageConverterTest", + srcs: [ + "test/*.cpp", + ], + vendor: true, + defaults: ["VehicleHalDefaults"], + shared_libs: ["libprotobuf-cpp-full"], + static_libs: [ + "VehicleHalProtoMessageConverter", + "VehicleHalProtos", + "VehicleHalUtils", + "libgtest", + ], + header_libs: ["VehicleHalDefaultConfig"], + test_suites: ["device-tests"], +} diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h new file mode 100644 index 0000000000..1c26fe868b --- /dev/null +++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h @@ -0,0 +1,56 @@ +/* + * 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_aidl_impl_grpc_utils_proto_message_converter_include_ProtoMessageConverter_H_ +#define android_hardware_automotive_vehicle_aidl_impl_grpc_utils_proto_message_converter_include_ProtoMessageConverter_H_ + +#include +#include +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace proto_msg_converter { + +// Convert AIDL VehiclePropConfig to Protobuf VehiclePropConfig. +void aidlToProto( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& inAidlConfig, + ::android::hardware::automotive::vehicle::proto::VehiclePropConfig* outProtoConfig); +// Convert Protobuf VehiclePropConfig to AIDL VehiclePropConfig. +void protoToAidl( + const ::android::hardware::automotive::vehicle::proto::VehiclePropConfig& inProtoConfig, + ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig* outAidlConfig); +// Convert AIDL VehiclePropValue to Protobuf VehiclePropValue. +void aidlToProto(const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& inAidlVal, + ::android::hardware::automotive::vehicle::proto::VehiclePropValue* outProtoVal); +// Convert Protobuf VehiclePropValue to AIDL VehiclePropValue. +void protoToAidl( + const ::android::hardware::automotive::vehicle::proto::VehiclePropValue& inProtoVal, + ::aidl::android::hardware::automotive::vehicle::VehiclePropValue* outAidlVal); + +} // namespace proto_msg_converter +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_aidl_impl_grpc_utils_proto_message_converter_include_ProtoMessageConverter_H_ 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 new file mode 100644 index 0000000000..6cbc7e523e --- /dev/null +++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp @@ -0,0 +1,146 @@ +/* + * 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. + */ + +#define LOG_TAG "ProtoMsgConverter" + +#include "ProtoMessageConverter.h" + +#include + +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace proto_msg_converter { + +namespace aidl_vehicle = ::aidl::android::hardware::automotive::vehicle; +namespace proto = ::android::hardware::automotive::vehicle::proto; + +// Copy the vector PROTO_VECNAME of protobuf class PROTO_VALUE to +// VHAL_TYPE_VALUE->VHAL_TYPE_VECNAME, every element of PROTO_VECNAME is casted by CAST. +#define CAST_COPY_PROTOBUF_VEC_TO_VHAL_TYPE(PROTO_VALUE, PROTO_VECNAME, VHAL_TYPE_VALUE, \ + VHAL_TYPE_VECNAME, CAST) \ + do { \ + (VHAL_TYPE_VALUE)->VHAL_TYPE_VECNAME.resize(PROTO_VALUE.PROTO_VECNAME##_size()); \ + size_t idx = 0; \ + for (auto& value : PROTO_VALUE.PROTO_VECNAME()) { \ + VHAL_TYPE_VALUE->VHAL_TYPE_VECNAME[idx++] = CAST(value); \ + } \ + } while (0) + +// Copying the vector PROTO_VECNAME of protobuf class PROTO_VALUE to +// VHAL_TYPE_VALUE->VHAL_TYPE_VECNAME. +#define COPY_PROTOBUF_VEC_TO_VHAL_TYPE(PROTO_VALUE, PROTO_VECNAME, VHAL_TYPE_VALUE, \ + VHAL_TYPE_VECNAME) \ + CAST_COPY_PROTOBUF_VEC_TO_VHAL_TYPE( \ + PROTO_VALUE, PROTO_VECNAME, VHAL_TYPE_VALUE, VHAL_TYPE_VECNAME, /*NO CAST*/) + +void aidlToProto(const aidl_vehicle::VehiclePropConfig& in, proto::VehiclePropConfig* out) { + out->set_prop(in.prop); + out->set_access(static_cast(toInt(in.access))); + out->set_change_mode(static_cast(toInt(in.changeMode))); + out->set_config_string(in.configString.c_str(), in.configString.size()); + out->set_min_sample_rate(in.minSampleRate); + out->set_max_sample_rate(in.maxSampleRate); + + for (auto& configElement : in.configArray) { + out->add_config_array(configElement); + } + + out->clear_area_configs(); + for (auto& areaConfig : in.areaConfigs) { + auto* protoACfg = out->add_area_configs(); + protoACfg->set_area_id(areaConfig.areaId); + 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); + } +} + +void protoToAidl(const proto::VehiclePropConfig& in, aidl_vehicle::VehiclePropConfig* out) { + out->prop = in.prop(); + out->access = static_cast(in.access()); + out->changeMode = static_cast(in.change_mode()); + out->configString = in.config_string(); + out->minSampleRate = in.min_sample_rate(); + out->maxSampleRate = in.max_sample_rate(); + + COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, config_array, out, configArray); + + auto cast_to_acfg = [](const proto::VehicleAreaConfig& protoAcfg) { + return aidl_vehicle::VehicleAreaConfig{ + .areaId = protoAcfg.area_id(), + .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(), + }; + }; + CAST_COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, area_configs, out, areaConfigs, cast_to_acfg); +} + +void aidlToProto(const aidl_vehicle::VehiclePropValue& in, proto::VehiclePropValue* out) { + out->set_prop(in.prop); + out->set_timestamp(in.timestamp); + out->set_status(static_cast(in.status)); + out->set_area_id(in.areaId); + out->set_string_value(in.value.stringValue); + out->set_byte_values(in.value.byteValues.data(), in.value.byteValues.size()); + + for (auto& int32Value : in.value.int32Values) { + out->add_int32_values(int32Value); + } + + for (auto& int64Value : in.value.int64Values) { + out->add_int64_values(int64Value); + } + + for (auto& floatValue : in.value.floatValues) { + out->add_float_values(floatValue); + } +} + +void protoToAidl(const proto::VehiclePropValue& in, aidl_vehicle::VehiclePropValue* out) { + out->prop = in.prop(); + out->timestamp = in.timestamp(); + out->status = static_cast(in.status()); + out->areaId = in.area_id(); + out->value.stringValue = in.string_value(); + for (const char& byte : in.byte_values()) { + out->value.byteValues.push_back(byte); + } + + COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, int32_values, out, value.int32Values); + COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, int64_values, out, value.int64Values); + COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, float_values, out, value.floatValues); +} + +#undef COPY_PROTOBUF_VEC_TO_VHAL_TYPE +#undef CAST_COPY_PROTOBUF_VEC_TO_VHAL_TYPE + +} // namespace proto_msg_converter +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp new file mode 100644 index 0000000000..d5f23739cb --- /dev/null +++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp @@ -0,0 +1,103 @@ +/* + * 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 + +#include +#include +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { +namespace proto_msg_converter { + +namespace { + +namespace proto = ::android::hardware::automotive::vehicle::proto; +namespace aidl_vehicle = ::aidl::android::hardware::automotive::vehicle; + +std::vector prepareTestConfigs() { + std::vector configs; + for (auto& property : defaultconfig::getDefaultConfigs()) { + configs.push_back(property.config); + } + return configs; +} + +std::vector prepareTestValues() { + std::vector values; + long timestamp = 1; + for (auto& property : defaultconfig::getDefaultConfigs()) { + values.push_back({ + .timestamp = timestamp, + .areaId = 123, + .prop = property.config.prop, + .value = property.initialValue, + .status = aidl_vehicle::VehiclePropertyStatus::ERROR, + }); + } + return values; +} + +class PropConfigConversionTest : public testing::TestWithParam {}; + +class PropValueConversionTest : public testing::TestWithParam {}; + +} // namespace + +TEST_P(PropConfigConversionTest, testConversion) { + proto::VehiclePropConfig protoCfg; + aidl_vehicle::VehiclePropConfig aidlCfg; + + aidlToProto(GetParam(), &protoCfg); + protoToAidl(protoCfg, &aidlCfg); + + EXPECT_EQ(aidlCfg, GetParam()); +} + +TEST_P(PropValueConversionTest, testConversion) { + proto::VehiclePropValue protoVal; + aidl_vehicle::VehiclePropValue aidlVal; + + aidlToProto(GetParam(), &protoVal); + protoToAidl(protoVal, &aidlVal); + + EXPECT_EQ(aidlVal, GetParam()); +} + +INSTANTIATE_TEST_SUITE_P(DefaultConfigs, PropConfigConversionTest, + ::testing::ValuesIn(prepareTestConfigs()), + [](const ::testing::TestParamInfo& info) { + return ::fmt::format("property_{:d}", info.param.prop); + }); + +INSTANTIATE_TEST_SUITE_P(TestValues, PropValueConversionTest, + ::testing::ValuesIn(prepareTestValues()), + [](const ::testing::TestParamInfo& info) { + return ::fmt::format("property_{:d}", info.param.prop); + }); + +} // namespace proto_msg_converter +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/aidl/impl/proto/Android.bp b/automotive/vehicle/aidl/impl/proto/Android.bp new file mode 100644 index 0000000000..80966df19a --- /dev/null +++ b/automotive/vehicle/aidl/impl/proto/Android.bp @@ -0,0 +1,91 @@ +/* + * 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. + */ + +filegroup { + name: "VehicleHalProtoFiles", + srcs: ["**/*.proto"], + visibility: ["//hardware/interfaces/automotive/vehicle:__subpackages__"], +} + +genrule { + name: "VehicleProtoStub_h", + tools: [ + "aprotoc", + "protoc-gen-grpc-cpp-plugin", + ], + cmd: "$(location aprotoc) -Ihardware/interfaces/automotive/vehicle/aidl/impl/proto -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)", + srcs: [ + ":VehicleHalProtoFiles", + ], + out: [ + "android/hardware/automotive/vehicle/DumpResult.pb.h", + "android/hardware/automotive/vehicle/StatusCode.pb.h", + "android/hardware/automotive/vehicle/VehicleAreaConfig.pb.h", + "android/hardware/automotive/vehicle/VehiclePropConfig.pb.h", + "android/hardware/automotive/vehicle/VehiclePropertyAccess.pb.h", + "android/hardware/automotive/vehicle/VehiclePropertyChangeMode.pb.h", + "android/hardware/automotive/vehicle/VehiclePropertyStatus.pb.h", + "android/hardware/automotive/vehicle/VehiclePropValue.pb.h", + "android/hardware/automotive/vehicle/VehiclePropValueRequest.pb.h", + ], +} + +genrule { + name: "VehicleProtoStub_cc", + tools: [ + "aprotoc", + "protoc-gen-grpc-cpp-plugin", + ], + cmd: "$(location aprotoc) -Ihardware/interfaces/automotive/vehicle/aidl/impl/proto -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)", + srcs: [ + ":VehicleHalProtoFiles", + ], + out: [ + "android/hardware/automotive/vehicle/DumpResult.pb.cc", + "android/hardware/automotive/vehicle/StatusCode.pb.cc", + "android/hardware/automotive/vehicle/VehicleAreaConfig.pb.cc", + "android/hardware/automotive/vehicle/VehiclePropConfig.pb.cc", + "android/hardware/automotive/vehicle/VehiclePropertyAccess.pb.cc", + "android/hardware/automotive/vehicle/VehiclePropertyChangeMode.pb.cc", + "android/hardware/automotive/vehicle/VehiclePropertyStatus.pb.cc", + "android/hardware/automotive/vehicle/VehiclePropValue.pb.cc", + "android/hardware/automotive/vehicle/VehiclePropValueRequest.pb.cc", + ], +} + +cc_library_static { + name: "VehicleHalProtos", + vendor: true, + host_supported: true, + include_dirs: [ + "external/protobuf/src", + ], + generated_headers: [ + "VehicleProtoStub_h", + ], + export_generated_headers: [ + "VehicleProtoStub_h", + ], + generated_sources: [ + "VehicleProtoStub_cc", + ], + shared_libs: [ + "libgrpc++_unsecure", + ], + cflags: [ + "-Wno-unused-parameter", + ], +} diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/DumpResult.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/DumpResult.proto new file mode 100644 index 0000000000..25bb7d4f77 --- /dev/null +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/DumpResult.proto @@ -0,0 +1,28 @@ +/* + * 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. + */ + +syntax = "proto3"; + +package android.hardware.automotive.vehicle.proto; + +message DumpResult { + /* If callerShouldDumpState is true, caller would print the information in buffer and + * continue to dump its state, otherwise would just dump the buffer and skip its own + * dumping logic. */ + bool caller_should_dump_state = 1; + /* The dumped information for the caller to print. */ + string buffer = 2; +} 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 new file mode 100644 index 0000000000..97cb0f88b2 --- /dev/null +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto @@ -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. + */ + +syntax = "proto3"; + +package android.hardware.automotive.vehicle.proto; + +/* Must be in sync with StatusCode.aidl. */ +enum StatusCode { + OK = 0; + + /* Try again. */ + TRY_AGAIN = 1; + + /* Invalid argument provided. */ + INVALID_ARG = 2; + + /* This code must be returned when device that associated with the vehicle + * property is not available. For example, when client tries to set HVAC + * temperature when the whole HVAC unit is turned OFF. */ + NOT_AVAILABLE = 3; + + /* Access denied */ + ACCESS_DENIED = 4; + + /* Something unexpected has happened in Vehicle HAL */ + INTERNAL_ERROR = 5; +}; 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 new file mode 100644 index 0000000000..b5b7e8070a --- /dev/null +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto @@ -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. + */ + +syntax = "proto3"; + +package android.hardware.automotive.vehicle.proto; + +/* Must be in sync with VehicleAreaConfig.aidl. */ +message VehicleAreaConfig { + /* Area id is ignored for VehiclePropertyGroup:GLOBAL properties. */ + int32 area_id = 1; + + /* If the property has @data_enum, leave the range to zero. + * + * Range will be ignored in the following cases: + * - The VehiclePropertyType is not INT32, INT64 or FLOAT. + * - Both of min value and max value are zero. */ + int32 min_int32_value = 2; + int32 max_int32_value = 3; + + int64 min_int64_value = 4; + int64 max_int64_value = 5; + + float min_float_value = 6; + float max_float_value = 7; +}; diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropConfig.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropConfig.proto new file mode 100644 index 0000000000..e230d15d06 --- /dev/null +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropConfig.proto @@ -0,0 +1,53 @@ +/* + * 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. + */ + +syntax = "proto3"; + +package android.hardware.automotive.vehicle.proto; + +import "android/hardware/automotive/vehicle/VehicleAreaConfig.proto"; +import "android/hardware/automotive/vehicle/VehiclePropertyAccess.proto"; +import "android/hardware/automotive/vehicle/VehiclePropertyChangeMode.proto"; + +/* Must be in sync with VehiclePropConfig.aidl. */ +message VehiclePropConfig { + /* Property identifier */ + int32 prop = 1; + + /* Defines if the property is read or write or both. */ + VehiclePropertyAccess access = 2; + + /* Defines the change mode of the property. */ + VehiclePropertyChangeMode change_mode = 3; + + /* Contains per-area configuration. */ + repeated VehicleAreaConfig area_configs = 4; + + /* Contains additional configuration parameters */ + repeated int32 config_array = 5; + + /* Some properties may require additional information passed over this + * string. Most properties do not need to set this. */ + bytes config_string = 6; + + /* Min sample rate in Hz. + * Must be defined for VehiclePropertyChangeMode::CONTINUOUS */ + float min_sample_rate = 7; + + /* Must be defined for VehiclePropertyChangeMode::CONTINUOUS + * Max sample rate in Hz. */ + float max_sample_rate = 8; +}; diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValue.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValue.proto new file mode 100644 index 0000000000..80c73cbb77 --- /dev/null +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValue.proto @@ -0,0 +1,54 @@ +/* + * 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. + */ + +syntax = "proto3"; + +package android.hardware.automotive.vehicle.proto; + +import "android/hardware/automotive/vehicle/VehiclePropertyStatus.proto"; + +/* Must be in sync with VehiclePropValue.aidl. */ +message VehiclePropValue { + /* Time is elapsed nanoseconds since boot */ + int64 timestamp = 1; + + /* Area type(s) for non-global property it must be one of the value from + * VehicleArea* enums or 0 for global properties. */ + int32 area_id = 2; + + /* Property identifier */ + int32 prop = 3; + + /* Status of the property */ + VehiclePropertyStatus status = 4; + + /* This is used for properties of types VehiclePropertyType#INT + * and VehiclePropertyType#INT_VEC */ + repeated int32 int32_values = 5; + + /* This is used for properties of types VehiclePropertyType#FLOAT + * and VehiclePropertyType#FLOAT_VEC */ + repeated float float_values = 6; + + /* This is used for properties of type VehiclePropertyType#INT64 */ + repeated int64 int64_values = 7; + + /* This is used for properties of type VehiclePropertyType#BYTES */ + bytes byte_values = 8; + + /* This is used for properties of type VehiclePropertyType#STRING */ + string string_value = 9; +}; diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValueRequest.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValueRequest.proto new file mode 100644 index 0000000000..b16daa8bd3 --- /dev/null +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropValueRequest.proto @@ -0,0 +1,26 @@ +/* + * 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. + */ + +syntax = "proto3"; + +package android.hardware.automotive.vehicle.proto; + +import "android/hardware/automotive/vehicle/VehiclePropValue.proto"; + +message VehiclePropValueRequest { + int32 request_id = 1; + VehiclePropValue value = 2; +}; diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyAccess.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyAccess.proto new file mode 100644 index 0000000000..55840f07d4 --- /dev/null +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyAccess.proto @@ -0,0 +1,27 @@ +/* + * 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. + */ + +syntax = "proto3"; + +package android.hardware.automotive.vehicle.proto; + +/* Must be in sync with VehiclePropertyAccess.aidl. */ +enum VehiclePropertyAccess { + NONE = 0; + READ = 1; + WRITE = 2; + READ_WRITE = 3; +}; diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.proto new file mode 100644 index 0000000000..c681e3b4c3 --- /dev/null +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.proto @@ -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. + */ + +syntax = "proto3"; + +package android.hardware.automotive.vehicle.proto; + +/* Must be in sync with VehiclePropertyChangeMode.aidl. */ +enum VehiclePropertyChangeMode { + /* Property of this type must never be changed. Subscription is not supported + * for these properties. */ + STATIC = 0; + + /* Properties of this type must report when there is a change. + * IVehicle#get call must return the current value. + * Set operation for this property is assumed to be asynchronous. When the + * property is read (using IVehicle#get) after IVehicle#set, it may still + * return old value until underlying H/W backing this property has actually + * changed the state. Once state is changed, the property must dispatch + * changed value as event. */ + ON_CHANGE = 1; + + /* Properties of this type change continuously and require a fixed rate of + * sampling to retrieve the data. Implementers may choose to send extra + * notifications on significant value changes. */ + CONTINUOUS = 2; +}; diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyStatus.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyStatus.proto new file mode 100644 index 0000000000..a44c8f03e6 --- /dev/null +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehiclePropertyStatus.proto @@ -0,0 +1,37 @@ +/* + * 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. + */ + +syntax = "proto3"; + +package android.hardware.automotive.vehicle.proto; + +/* Must be in sync with VehiclePropertyStatus.aidl. */ +enum VehiclePropertyStatus { + /* Property is available and behaving normally */ + AVAILABLE = 0; + /* A property in this state is not available for reading and writing. This + * is a transient state that depends on the availability of the underlying + * implementation (e.g. hardware or driver). It MUST NOT be used to + * represent features that this vehicle is always incapable of. A get() of + * a property in this state MAY return an undefined value, but MUST + * correctly describe its status as UNAVAILABLE A set() of a property in + * this state MAY return NOT_AVAILABLE. The HAL implementation MUST ignore + * the value of the status field when writing a property value coming from + * Android. */ + UNAVAILABLE = 1; + /* There is an error with this property. */ + ERROR = 2; +}; diff --git a/automotive/vehicle/aidl/impl/utils/common/Android.bp b/automotive/vehicle/aidl/impl/utils/common/Android.bp index 001280f857..ace505d88c 100644 --- a/automotive/vehicle/aidl/impl/utils/common/Android.bp +++ b/automotive/vehicle/aidl/impl/utils/common/Android.bp @@ -20,9 +20,7 @@ package { cc_library { name: "VehicleHalUtils", - srcs: [ - "src/*.cpp", - ], + srcs: ["src/*.cpp"], vendor: true, local_include_dirs: ["include"], export_include_dirs: ["include"], -- GitLab From 03f344fe3bb373c9499eaa8b32a849452cbe0b59 Mon Sep 17 00:00:00 2001 From: Sally Qi Date: Mon, 27 Sep 2021 18:47:01 -0700 Subject: [PATCH 164/825] Fix vts cases due to function change for async render engine. Bug: 180657548 Test: this Change-Id: I772122750c224b5439603554acaccd5c29f58530 --- .../composer/2.2/utils/vts/RenderEngineVts.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp index fe59a9d82a..2d4cc7d80e 100644 --- a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp +++ b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp @@ -61,18 +61,18 @@ void TestRenderEngine::initGraphicBuffer(uint32_t width, uint32_t height, uint32 void TestRenderEngine::drawLayers() { base::unique_fd bufferFence; - std::vector compositionLayerPointers; - compositionLayerPointers.reserve(mCompositionLayers.size()); + std::vector compositionLayers; + compositionLayers.reserve(mCompositionLayers.size()); std::transform(mCompositionLayers.begin(), mCompositionLayers.end(), - std::back_insert_iterator(compositionLayerPointers), - [](renderengine::LayerSettings& settings) -> renderengine::LayerSettings* { - return &settings; + std::back_insert_iterator(compositionLayers), + [](renderengine::LayerSettings& settings) -> renderengine::LayerSettings { + return settings; }); auto texture = std::make_shared( mGraphicBuffer, *mRenderEngine, renderengine::ExternalTexture::Usage::WRITEABLE); auto [status, readyFence] = mRenderEngine - ->drawLayers(mDisplaySettings, compositionLayerPointers, - texture, true, std::move(bufferFence)) + ->drawLayers(mDisplaySettings, compositionLayers, texture, + true, std::move(bufferFence)) .get(); int fd = readyFence.release(); if (fd != -1) { -- GitLab From 8791c7ee75826f140918c7c0141a01ace382b3b3 Mon Sep 17 00:00:00 2001 From: Keun young Park Date: Tue, 5 Oct 2021 16:11:07 -0700 Subject: [PATCH 165/825] update automotive hals for car mainline - add min_sdk_version and apex_available Bug: 192665266 Test: build Change-Id: I34be81d542e51832a4f73c0227ca544e963ab3c9 --- automotive/audiocontrol/aidl/Android.bp | 5 +++++ automotive/occupant_awareness/aidl/Android.bp | 5 +++++ automotive/vehicle/aidl/Android.bp | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/automotive/audiocontrol/aidl/Android.bp b/automotive/audiocontrol/aidl/Android.bp index 4acfd82d6a..5e69429b16 100644 --- a/automotive/audiocontrol/aidl/Android.bp +++ b/automotive/audiocontrol/aidl/Android.bp @@ -17,6 +17,11 @@ aidl_interface { backend: { java: { sdk_version: "module_current", + min_sdk_version: "31", + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], }, }, versions: ["1"], diff --git a/automotive/occupant_awareness/aidl/Android.bp b/automotive/occupant_awareness/aidl/Android.bp index 288dc6d0c0..6ddc1270eb 100644 --- a/automotive/occupant_awareness/aidl/Android.bp +++ b/automotive/occupant_awareness/aidl/Android.bp @@ -17,6 +17,11 @@ aidl_interface { backend: { java: { sdk_version: "module_current", + min_sdk_version: "31", + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], }, ndk: { vndk: { diff --git a/automotive/vehicle/aidl/Android.bp b/automotive/vehicle/aidl/Android.bp index ca8afb08b9..1ca62ac207 100644 --- a/automotive/vehicle/aidl/Android.bp +++ b/automotive/vehicle/aidl/Android.bp @@ -34,6 +34,11 @@ aidl_interface { }, java: { sdk_version: "module_current", + min_sdk_version: "31", + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], }, }, } -- GitLab From d32ae8e752910253fcc0a83c0c286f746ba5d2c6 Mon Sep 17 00:00:00 2001 From: ramindani Date: Fri, 1 Oct 2021 18:48:39 +0000 Subject: [PATCH 166/825] Setup Stable AIDL composer VTS tests. This is a setup on which I can start writing tests by creating composer client first. Test: Verified with a placeholder test that we can execute tests NOTE: Tests don't work as there is no service, so empty tests should be skipped in presubmits automatically. BUG: 201797934 Change-Id: I1b6aca6c497bf60c5a417533508e30100192625a --- .../composer3/vts/functional/Android.bp | 51 +++++++++++++++++++ .../composer3/vts/functional/AndroidTest.xml | 36 +++++++++++++ .../graphics/composer3/vts/functional/OWNERS | 9 ++++ .../VtsHalGraphicsComposer3_TargetTest.cpp | 42 +++++++++++++++ 4 files changed, 138 insertions(+) create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/AndroidTest.xml create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/OWNERS create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp new file mode 100644 index 0000000000..8a36b1d82f --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp @@ -0,0 +1,51 @@ +/** + * 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. + */ + +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: "VtsHalGraphicsComposer3_TargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: ["VtsHalGraphicsComposer3_TargetTest.cpp"], + + // TODO(b/64437680): Assume these libs are always available on the device. + shared_libs: [ + "libbinder_ndk", + "libbinder", + ], + static_libs: [ + "android.hardware.graphics.composer3-V1-ndk", + "android.hardware.graphics.common-V3-ndk", + "android.hardware.graphics.common@1.2", + "android.hardware.common-V2-ndk", + "android.hardware.common.fmq-V1-ndk", + ], + + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/AndroidTest.xml b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/AndroidTest.xml new file mode 100644 index 0000000000..3f9971beb3 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/AndroidTest.xml @@ -0,0 +1,36 @@ + + + + + diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/OWNERS b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/OWNERS new file mode 100644 index 0000000000..1bfad7d26f --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/OWNERS @@ -0,0 +1,9 @@ +# Bug component: 199413815 + +# Graphics team +adyabr@google.com +alecmouri@google.com +ramindani@google.com + +# VTS team +include platform/hardware/interfaces:/OWNERS \ No newline at end of file diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp new file mode 100644 index 0000000000..ce4eed680e --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -0,0 +1,42 @@ + +#include +#include +#include +#include +#include +#include +#include + +#pragma push_macro("LOG_TAG") +#undef LOG_TAG +#define LOG_TAG "VtsHalGraphicsComposer3_TargetTest" + +namespace aidl::android::hardware::graphics::composer3::vts { +namespace { + +class GraphicsComposerAidlTest : public ::testing::TestWithParam { + // TODO(b/201796346) setup composer client and use it to send data and generate commands. +}; + +TEST_P(GraphicsComposerAidlTest, getDisplayCapabilitiesBadDisplay) { + // TODO(b/201797681) update with actual test instead of a place holder +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, GraphicsComposerAidlTest, + testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)), + ::android::PrintInstanceNameToString); +} // namespace +} // namespace aidl::android::hardware::graphics::composer3::vts + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + + using namespace std::chrono_literals; + if (!android::base::WaitForProperty("init.svc.surfaceflinger", "stopped", 10s)) { + ALOGE("Failed to stop init.svc.surfaceflinger"); + return -1; + } + return RUN_ALL_TESTS(); +} \ No newline at end of file -- GitLab From b00e11ff6fd36e88919bcb70719105ca6a0afafa Mon Sep 17 00:00:00 2001 From: Marin Shalamanov Date: Wed, 6 Oct 2021 16:19:03 +0200 Subject: [PATCH 167/825] Update the Composer HAL docs for setContentType setContentType can be called even if it's not supported. On some devices this surves as a signal to disable on-device post processing in order to reduce latency. Bug: 202007307 Test: n/a Change-Id: I9888d48979cd2442b54054730c78cf7b4ed6aab4 --- current.txt | 1 + graphics/composer/2.4/IComposerClient.hal | 5 ++--- .../android/hardware/graphics/composer3/IComposerClient.aidl | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/current.txt b/current.txt index 21ee123576..dfc61ebe6f 100644 --- a/current.txt +++ b/current.txt @@ -903,6 +903,7 @@ c8a57364f6ad20842be14f4db284df5304f7521ca8eac6bcc1fa6c5b466fb8a6 android.hardwar # ABI preserving changes to HALs during Android T 62ace52d9c3ff1f60f94118557a2aaf0b953513e59dcd34d5f94ae28d4c7e780 android.hardware.fastboot@1.0::IFastboot +b4a59462aa7d1346ee3eaa06a8e13682462746cf1be62ed2a2bd46bf404d01b7 android.hardware.graphics.composer@2.4::IComposerClient ca62a2a95d173ed323309e5e00f653ad3cceec82a6e5e4976a249cb5aafe2515 android.hardware.neuralnetworks@1.2::types fa76bced6b1b71c40fc706c508a9011284c57f57831cd0cf5f45653ed4ea463e android.hardware.neuralnetworks@1.3::types diff --git a/graphics/composer/2.4/IComposerClient.hal b/graphics/composer/2.4/IComposerClient.hal index 1a59bbde80..e27fd6e898 100644 --- a/graphics/composer/2.4/IComposerClient.hal +++ b/graphics/composer/2.4/IComposerClient.hal @@ -307,9 +307,8 @@ interface IComposerClient extends @2.3::IComposerClient { * If the display is internally connected (not through HDMI), and such modes are available, * this method should trigger them. * - * This function should only be called if the display reports support for the corresponding - * content type (ContentType::{GRAPHICS, PHOTO, CINEMA, GAME}) from getSupportedContentTypes. - * ContentType::NONE is supported by default and can always be set. + * This function can be called for a content type even if no support for it is + * reported from getSupportedContentTypes. * * @return error is NONE upon success. Otherwise, * BAD_DISPLAY when an invalid display handle was passed in. diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 9bde220fa4..87a3a50a12 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -690,9 +690,8 @@ interface IComposerClient { * If the display is internally connected (not through HDMI), and such modes are available, * this method should trigger them. * - * This function should only be called if the display reports support for the corresponding - * content type (ContentType::{GRAPHICS, PHOTO, CINEMA, GAME}) from getSupportedContentTypes. - * ContentType::NONE is supported by default and can always be set. + * This function can be called for a content type even if no support for it is + * reported from getSupportedContentTypes. * * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. * @exception EX_UNSUPPORTED when the given content type is not supported by the composer -- GitLab From a9780260aeb5844848fca5207ce533ce034902c4 Mon Sep 17 00:00:00 2001 From: ramindani Date: Fri, 1 Oct 2021 18:48:39 +0000 Subject: [PATCH 168/825] Add two tests for Stable AIDL composer3 as a start of tests. If service exists then we can proceed with test otherwise we skip tests This should help us write all the tests until we have the service implementation. Test: atest VtsHalGraphicsComposer3_TargetTest Tests don't just work yet, we don't have service implemented yet. BUG: 202053621 Change-Id: Ia9506dada0f1b5da446d6e2086aa4534c60d5565 --- .../graphics/composer3/vts/functional/OWNERS | 3 - .../VtsHalGraphicsComposer3_TargetTest.cpp | 70 ++++++++++++++++++- 2 files changed, 67 insertions(+), 6 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/OWNERS b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/OWNERS index 1bfad7d26f..d95d98d445 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/OWNERS +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/OWNERS @@ -4,6 +4,3 @@ adyabr@google.com alecmouri@google.com ramindani@google.com - -# VTS team -include platform/hardware/interfaces:/OWNERS \ No newline at end of file diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index ce4eed680e..d892681585 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -3,6 +3,8 @@ #include #include #include +#include +#include #include #include #include @@ -11,15 +13,77 @@ #undef LOG_TAG #define LOG_TAG "VtsHalGraphicsComposer3_TargetTest" +typedef uint64_t DisplayId; + namespace aidl::android::hardware::graphics::composer3::vts { namespace { +class VtsDisplay { + public: + VtsDisplay(DisplayId displayId, int32_t displayWidth, int32_t displayHeight) + : mDisplayId(displayId), mDisplayWidth(displayWidth), mDisplayHeight(displayHeight) {} + + DisplayId get() const { return mDisplayId; } + + void setDimensions(int32_t displayWidth, int32_t displayHeight) { + mDisplayWidth = displayWidth; + mDisplayHeight = displayHeight; + } + + private: + const DisplayId mDisplayId; + int32_t mDisplayWidth; + int32_t mDisplayHeight; +}; + class GraphicsComposerAidlTest : public ::testing::TestWithParam { - // TODO(b/201796346) setup composer client and use it to send data and generate commands. + protected: + void SetUp() override { + std::string name = GetParam(); + ndk::SpAIBinder binder(AServiceManager_waitForService(name.c_str())); + ASSERT_NE(binder, nullptr); + ASSERT_NO_FATAL_FAILURE(mComposer = IComposer::fromBinder(binder)); + ASSERT_NE(mComposer, nullptr); + ASSERT_NO_FATAL_FAILURE(mComposer->createClient(&mComposerClient)); + mInvalidDisplayId = GetInvalidDisplayId(); + } + + // returns an invalid display id (one that has not been registered to a + // display. Currently assuming that a device will never have close to + // std::numeric_limit::max() displays registered while running tests + DisplayId GetInvalidDisplayId() { + uint64_t id = std::numeric_limits::max(); + while (id > 0) { + if (std::none_of(mDisplays.begin(), mDisplays.end(), + [&](const VtsDisplay& display) { return id == display.get(); })) { + return id; + } + id--; + } + + return 0; + } + + std::shared_ptr mComposer; + std::shared_ptr mComposerClient{}; + DisplayId mInvalidDisplayId; + std::vector + mDisplays; // TODO(b/202401906) populate all the displays available for test. }; TEST_P(GraphicsComposerAidlTest, getDisplayCapabilitiesBadDisplay) { - // TODO(b/201797681) update with actual test instead of a place holder + std::vector capabilities; + const auto error = mComposerClient->getDisplayCapabilities(mInvalidDisplayId, &capabilities); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} + +TEST_P(GraphicsComposerAidlTest, getDisplayCapabilities) { + for (const auto& display : mDisplays) { + std::vector capabilities; + const auto error = mComposerClient->getDisplayCapabilities(display.get(), &capabilities); + + EXPECT_NE(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + } } GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlTest); @@ -39,4 +103,4 @@ int main(int argc, char** argv) { return -1; } return RUN_ALL_TESTS(); -} \ No newline at end of file +} -- GitLab From 76ca9a880e6d49235126207c75d80410e5eac72d Mon Sep 17 00:00:00 2001 From: Hongguang Date: Wed, 6 Oct 2021 17:11:09 -0700 Subject: [PATCH 169/825] Stop current tuning before starting a new tuning. If a new tuning request comes before stop old tuning, there is race condition that the Frontend loop thread may crash while terminate(). Bug: 202335601 Fix: 202335601 Test: atest android.media.tv.tuner.cts Change-Id: Ic168b585f0a8fe36bd8eeceee3e0b4c83d5388aa --- tv/tuner/aidl/default/Demux.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp index 8e83d063ce..4385461815 100644 --- a/tv/tuner/aidl/default/Demux.cpp +++ b/tv/tuner/aidl/default/Demux.cpp @@ -343,6 +343,10 @@ uint16_t Demux::getFilterTpid(int64_t filterId) { } void Demux::startFrontendInputLoop() { + ALOGD("[Demux] start frontend on demux"); + // Stop current Frontend thread loop first, in case the user starts a new + // tuning before stopping current tuning. + stopFrontendInput(); mFrontendInputThreadRunning = true; mFrontendInputThread = std::thread(&Demux::frontendInputThreadLoop, this); } -- GitLab From 7015054851607c1b469420069088e9214c8c6b42 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Wed, 6 Oct 2021 17:49:38 -0700 Subject: [PATCH 170/825] Add gralloc VTS for SMPTE 2094-10 metadata Bug: 200309502 Test: VtsHalGraphicsMapperV4_0TargetTest Change-Id: If1f3d99b70226f609f6cdbd05a790de0fb05d006 --- .../VtsHalGraphicsMapperV4_0TargetTest.cpp | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp index e18b1faa9f..2ab9c01c5d 100644 --- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp +++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp @@ -1481,6 +1481,18 @@ TEST_P(GraphicsMapperHidlTest, GetSmpte2094_40) { }); } +/** + * Test IMapper::get(Smpte2094_10) + */ +TEST_P(GraphicsMapperHidlTest, GetSmpte2094_10) { + testGet(mDummyDescriptorInfo, gralloc4::MetadataType_Smpte2094_10, + [](const IMapper::BufferDescriptorInfo& /*info*/, const hidl_vec& vec) { + std::optional> smpte2094_10; + ASSERT_EQ(NO_ERROR, gralloc4::decodeSmpte2094_10(vec, &smpte2094_10)); + EXPECT_FALSE(smpte2094_10.has_value()); + }); +} + /** * Test IMapper::get(metadata) with a bad buffer */ @@ -1545,6 +1557,9 @@ TEST_P(GraphicsMapperHidlTest, GetMetadataBadValue) { ASSERT_EQ(Error::BAD_BUFFER, mGralloc->get(bufferHandle, gralloc4::MetadataType_Smpte2094_40, &vec)); ASSERT_EQ(0, vec.size()); + ASSERT_EQ(Error::BAD_BUFFER, + mGralloc->get(bufferHandle, gralloc4::MetadataType_Smpte2094_10, &vec)); + ASSERT_EQ(0, vec.size()); } /** @@ -1936,6 +1951,20 @@ TEST_P(GraphicsMapperHidlTest, SetSmpte2094_40) { }); } +/** + * Test IMapper::set(Smpte2094_10) + */ +TEST_P(GraphicsMapperHidlTest, SetSmpte2094_10) { + hidl_vec vec; + + testSet(mDummyDescriptorInfo, gralloc4::MetadataType_Smpte2094_10, vec, + [&](const IMapper::BufferDescriptorInfo& /*info*/, const hidl_vec& vec) { + std::optional> realSmpte2094_10; + ASSERT_EQ(NO_ERROR, gralloc4::decodeSmpte2094_10(vec, &realSmpte2094_10)); + EXPECT_FALSE(realSmpte2094_10.has_value()); + }); +} + /** * Test IMapper::set(metadata) with a bad buffer */ @@ -1977,6 +2006,8 @@ TEST_P(GraphicsMapperHidlTest, SetMetadataNullBuffer) { ASSERT_EQ(Error::BAD_BUFFER, mGralloc->set(bufferHandle, gralloc4::MetadataType_Cta861_3, vec)); ASSERT_EQ(Error::BAD_BUFFER, mGralloc->set(bufferHandle, gralloc4::MetadataType_Smpte2094_40, vec)); + ASSERT_EQ(Error::BAD_BUFFER, + mGralloc->set(bufferHandle, gralloc4::MetadataType_Smpte2094_10, vec)); } /** @@ -2481,6 +2512,24 @@ TEST_P(GraphicsMapperHidlTest, GetFromBufferDescriptorInfoSmpte2094_40) { EXPECT_FALSE(smpte2094_40.has_value()); } +/** + * Test IMapper::getFromBufferDescriptorInfo(Smpte2094_10) + */ +TEST_P(GraphicsMapperHidlTest, GetFromBufferDescriptorInfoSmpte2094_10) { + hidl_vec vec; + auto err = mGralloc->getFromBufferDescriptorInfo(mDummyDescriptorInfo, + gralloc4::MetadataType_Smpte2094_10, &vec); + if (err == Error::UNSUPPORTED) { + GTEST_SUCCEED() << "setting this metadata is unsupported"; + return; + } + ASSERT_EQ(err, Error::NONE); + + std::optional> smpte2094_10; + ASSERT_EQ(NO_ERROR, gralloc4::decodeSmpte2094_10(vec, &smpte2094_10)); + EXPECT_FALSE(smpte2094_10.has_value()); +} + /** * Test IMapper::getFromBufferDescriptorInfo(metadata) for unsupported metadata */ -- GitLab From ab35e0a3d0f2a449de03242adbf1843e79c6a664 Mon Sep 17 00:00:00 2001 From: Keun young Park Date: Thu, 7 Oct 2021 12:44:40 -0700 Subject: [PATCH 171/825] Expose HIDL HALs to car framework apex - all HALs also get //apex_available:platform as HAL should be available for platform Bug: 192665266 Test: build Change-Id: Ic6781447628761a8e8a9aa31e473dfc340af9989 --- audio/common/6.0/Android.bp | 4 ++++ automotive/audiocontrol/1.0/Android.bp | 4 ++++ automotive/audiocontrol/2.0/Android.bp | 4 ++++ automotive/vehicle/2.0/Android.bp | 4 ++++ health/1.0/Android.bp | 4 ++++ health/2.0/Android.bp | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/audio/common/6.0/Android.bp b/audio/common/6.0/Android.bp index fc54caff83..91721fc7e9 100644 --- a/audio/common/6.0/Android.bp +++ b/audio/common/6.0/Android.bp @@ -20,4 +20,8 @@ hidl_interface { ], gen_java: true, gen_java_constants: true, + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], } diff --git a/automotive/audiocontrol/1.0/Android.bp b/automotive/audiocontrol/1.0/Android.bp index 628793bfbd..53ed78b950 100644 --- a/automotive/audiocontrol/1.0/Android.bp +++ b/automotive/audiocontrol/1.0/Android.bp @@ -20,4 +20,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], } diff --git a/automotive/audiocontrol/2.0/Android.bp b/automotive/audiocontrol/2.0/Android.bp index 4d1fdbca26..413cf48e93 100644 --- a/automotive/audiocontrol/2.0/Android.bp +++ b/automotive/audiocontrol/2.0/Android.bp @@ -24,4 +24,8 @@ hidl_interface { "android.hidl.safe_union@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], } diff --git a/automotive/vehicle/2.0/Android.bp b/automotive/vehicle/2.0/Android.bp index e2164b1d9d..5c2e0ea455 100644 --- a/automotive/vehicle/2.0/Android.bp +++ b/automotive/vehicle/2.0/Android.bp @@ -21,4 +21,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], } diff --git a/health/1.0/Android.bp b/health/1.0/Android.bp index 003b106cc2..e793db692a 100644 --- a/health/1.0/Android.bp +++ b/health/1.0/Android.bp @@ -20,4 +20,8 @@ hidl_interface { ], gen_java: true, gen_java_constants: true, + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], } diff --git a/health/2.0/Android.bp b/health/2.0/Android.bp index ddd983dc50..fae25b6f23 100644 --- a/health/2.0/Android.bp +++ b/health/2.0/Android.bp @@ -22,4 +22,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], } -- GitLab From 47589e09e051bf09a5f4dada0628c6d6bf324486 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Thu, 7 Oct 2021 16:13:14 -0700 Subject: [PATCH 172/825] [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces Added SPDX-license-identifier-Apache-2.0 to: automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp automotive/vehicle/aidl/impl/proto/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Change-Id: I9c8d81e2f899026607ee182a1c7fa1853d38cdc0 --- .../impl/grpc/utils/proto_message_converter/Android.bp | 9 +++++++++ automotive/vehicle/aidl/impl/proto/Android.bp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp index 2b0b11f2d2..7670c25418 100644 --- a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp +++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp @@ -14,6 +14,15 @@ * 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_library { name: "VehicleHalProtoMessageConverter", srcs: [ diff --git a/automotive/vehicle/aidl/impl/proto/Android.bp b/automotive/vehicle/aidl/impl/proto/Android.bp index 80966df19a..709307d3e1 100644 --- a/automotive/vehicle/aidl/impl/proto/Android.bp +++ b/automotive/vehicle/aidl/impl/proto/Android.bp @@ -14,6 +14,15 @@ * 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"], +} + filegroup { name: "VehicleHalProtoFiles", srcs: ["**/*.proto"], -- GitLab From 2fa7d5217779944aa2b03cd3868e61586e678448 Mon Sep 17 00:00:00 2001 From: chenpaul Date: Wed, 6 Oct 2021 09:24:09 +0800 Subject: [PATCH 173/825] WIFI: Add log to debug onSubsystemRestart onSubsystemRestart should be triggered by wifi HAL when subsystem restart happened. Add log to debug why this callback function was not trigger at unexpected corner case. Bug: 201330066 Test: Manual test Change-Id: I160adc6006d078fcc72c1768927e87e378fd675e --- wifi/1.5/default/wifi.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wifi/1.5/default/wifi.cpp b/wifi/1.5/default/wifi.cpp index b9f20a4615..a85b242a8a 100644 --- a/wifi/1.5/default/wifi.cpp +++ b/wifi/1.5/default/wifi.cpp @@ -131,8 +131,14 @@ WifiStatus Wifi::startInternal() { WifiStatus wifi_status = createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, error); for (const auto& callback : event_cb_handler_.getCallbacks()) { + LOG(INFO) << "Attempting to invoke onSubsystemRestart " + "callback"; if (!callback->onSubsystemRestart(wifi_status).isOk()) { - LOG(ERROR) << "Failed to invoke onFailure callback"; + LOG(ERROR) + << "Failed to invoke onSubsystemRestart callback"; + } else { + LOG(INFO) << "Succeeded to invoke onSubsystemRestart " + "callback"; } } }; -- GitLab From 6e289c86d9a1f4703cdf5cebb819c372425e207d Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 7 Oct 2021 16:59:28 -0700 Subject: [PATCH 174/825] Fix CLUSTER_SWITCH_UI init value. CLUSTER_SWITCH_UI is a INT32 property that should only have one init value instead of 2. This is causing confusion in the code that uses the default value. Test: None Bug: 202448791 Change-Id: Id55f448f1dd5ee33291e30d32e6fbf868ad8fe3a --- automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h | 2 +- .../vehicle/aidl/impl/default_config/include/DefaultConfig.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 e025d1e947..cfbbbd3224 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 @@ -1036,7 +1036,7 @@ const ConfigDeclaration kVehicleProperties[]{ .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, - .initialValue = {.int32Values = {0 /* ClusterHome */, -1 /* ClusterNone */}}, + .initialValue = {.int32Values = {0 /* ClusterHome */}}, }, { .config = diff --git a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h index ebcb77a02c..12a569135a 100644 --- a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +++ b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h @@ -1052,7 +1052,7 @@ const std::vector kVehicleProperties = { .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, - .initialValue = {.int32Values = {0 /* ClusterHome */, -1 /* ClusterNone */}}, + .initialValue = {.int32Values = {0 /* ClusterHome */}}, }, { .config = -- GitLab From 4427c39c89cd0e5a4fd8e17f4f3db5b7ba9b3e5e Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Mon, 11 Oct 2021 22:31:20 +0800 Subject: [PATCH 175/825] wifi: add wifi TL to vts owners 1.0 and 1.1 do not have OWNERS files. Bug: 0 Test: N/A Change-Id: I5682f68124af9087851d8f9885ee9fe2523ee25e --- wifi/supplicant/1.0/vts/OWNERS | 2 ++ wifi/supplicant/1.1/vts/OWNERS | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 wifi/supplicant/1.0/vts/OWNERS create mode 100644 wifi/supplicant/1.1/vts/OWNERS diff --git a/wifi/supplicant/1.0/vts/OWNERS b/wifi/supplicant/1.0/vts/OWNERS new file mode 100644 index 0000000000..cf81c79892 --- /dev/null +++ b/wifi/supplicant/1.0/vts/OWNERS @@ -0,0 +1,2 @@ +arabawy@google.com +etancohen@google.com diff --git a/wifi/supplicant/1.1/vts/OWNERS b/wifi/supplicant/1.1/vts/OWNERS new file mode 100644 index 0000000000..cf81c79892 --- /dev/null +++ b/wifi/supplicant/1.1/vts/OWNERS @@ -0,0 +1,2 @@ +arabawy@google.com +etancohen@google.com -- GitLab From bc6c0e9bb6998c8caaa9dd7538de81b0f903b1dc Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 12 Oct 2021 16:36:54 +0900 Subject: [PATCH 176/825] Remove ndk_platform backend. Use the ndk backend. The ndk_platform backend will soon be deprecated because the ndk backend can serve the same purpose. This is to eliminate the confusion about having two variants (ndk and ndk_platform) for the same ndk backend. Bug: 161456198 Test: m Change-Id: Ib2af857ab464bc03c3ef04a42790ae632854577a --- automotive/vehicle/aidl/impl/Android.bp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automotive/vehicle/aidl/impl/Android.bp b/automotive/vehicle/aidl/impl/Android.bp index a97d54492e..fc3d40bdd8 100644 --- a/automotive/vehicle/aidl/impl/Android.bp +++ b/automotive/vehicle/aidl/impl/Android.bp @@ -21,7 +21,7 @@ package { cc_defaults { name: "VehicleHalDefaults", static_libs: [ - "android.hardware.automotive.vehicle-V1-ndk_platform", + "android.hardware.automotive.vehicle-V1-ndk", ], shared_libs: [ "libbase", -- GitLab From 33c0b8d83e63e2c2b900642366efcdcc29f6e6db Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 12 Oct 2021 12:43:47 +0000 Subject: [PATCH 177/825] Revert "Fix vts cases due to function change for async render en..." Revert "Second Patch for async RenderEngine" Revert "Fix vender implementation due to second patch of async R..." Revert submission 15644535-asyncRenderEngineV2 Reason for revert: Broke multiple tests Reverted Changes: I772122750:Fix vts cases due to function change for async ren... I615f2927d:Second Patch for async RenderEngine I3f47b8b67:Fix vender implementation due to second patch of a... Bug: 202803359 Bug: 202808760 Change-Id: I0313622b2d879ca3a3e63ff52458b51100748a29 --- .../composer/2.2/utils/vts/RenderEngineVts.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp index 2d4cc7d80e..fe59a9d82a 100644 --- a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp +++ b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp @@ -61,18 +61,18 @@ void TestRenderEngine::initGraphicBuffer(uint32_t width, uint32_t height, uint32 void TestRenderEngine::drawLayers() { base::unique_fd bufferFence; - std::vector compositionLayers; - compositionLayers.reserve(mCompositionLayers.size()); + std::vector compositionLayerPointers; + compositionLayerPointers.reserve(mCompositionLayers.size()); std::transform(mCompositionLayers.begin(), mCompositionLayers.end(), - std::back_insert_iterator(compositionLayers), - [](renderengine::LayerSettings& settings) -> renderengine::LayerSettings { - return settings; + std::back_insert_iterator(compositionLayerPointers), + [](renderengine::LayerSettings& settings) -> renderengine::LayerSettings* { + return &settings; }); auto texture = std::make_shared( mGraphicBuffer, *mRenderEngine, renderengine::ExternalTexture::Usage::WRITEABLE); auto [status, readyFence] = mRenderEngine - ->drawLayers(mDisplaySettings, compositionLayers, texture, - true, std::move(bufferFence)) + ->drawLayers(mDisplaySettings, compositionLayerPointers, + texture, true, std::move(bufferFence)) .get(); int fd = readyFence.release(); if (fd != -1) { -- GitLab From 10bccc3c1f8f8ece043a8da2299e5deb16c4e317 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Thu, 30 Sep 2021 16:15:59 -0700 Subject: [PATCH 178/825] Add sdr white point information to composer3 * Add layer-level SDR white point. When there are mixed HDR/SDR layers on the display, HDR layers should remain at display brightness, or whatever the HDR standard is (e.g., keep HLG content at 1000 nits), while SDR layers should be "dimmed" to the appropriate perceptual brightness. * Add SDR white point to the client composited client target buffer. When there are mixed HDR/SDR layers in client compostion, HWC must tell SurfaceFlinger the target white point of the client target buffer so that SurfaceFlinger-applied dimming may be atomically applied as a brightness mode change. Bug: 200310158 Test: builds Change-Id: Ifbfe3125ede1a4de04978c6e644a5c911c33d3b6 --- .../hardware/graphics/composer3/Command.aidl | 1 + .../graphics/composer3/IComposerClient.aidl | 2 +- .../hardware/graphics/composer3/Command.aidl | 24 ++++++++++++++++++- .../graphics/composer3/IComposerClient.aidl | 9 +++---- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl index 3b31149636..e19105d4ab 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl @@ -72,4 +72,5 @@ enum Command { SET_LAYER_PER_FRAME_METADATA_BLOBS = 50593792, SET_CLIENT_TARGET_PROPERTY = 17104896, SET_LAYER_GENERIC_METADATA = 68026368, + SET_LAYER_WHITE_POINT_NITS = 50659328, } 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 531fd14111..8824f5a80f 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 @@ -40,7 +40,7 @@ interface IComposerClient { void destroyVirtualDisplay(long display); android.hardware.graphics.composer3.ExecuteCommandsStatus executeCommands(int inLength, in android.hardware.common.NativeHandle[] inHandles); int getActiveConfig(long display); - void getClientTargetSupport(long display, int width, int height, android.hardware.graphics.common.PixelFormat format, android.hardware.graphics.common.Dataspace dataspace); + void getClientTargetSupport(long display, int width, int height, in android.hardware.graphics.composer3.ClientTargetProperty clientTargetProperty); android.hardware.graphics.composer3.ColorMode[] getColorModes(long display); float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); int getDisplayAttribute(long display, int config, android.hardware.graphics.composer3.DisplayAttribute attribute); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl index 5f987d0eaf..95c07ac354 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl @@ -689,8 +689,16 @@ enum Command { * * 0 - 3: clientTargetProperty.pixelFormat * 4 - 7: clientTargetProperty.dataspace + * 8 - 11: whitePointNits * - * setClientTargetProperty(ClientTargetProperty clientTargetProperty); + * The white point parameter describes the intended white point of the client target buffer. + * When client composition blends both HDR and SDR content, the client must composite to the + * brightness space as specified by the hardware composer. This is so that adjusting the real + * display brightness may be applied atomically with compensating the client target output. For + * instance, client-compositing a list of SDR layers requires dimming the brightness space of + * the SDR buffers when an HDR layer is simultaneously device-composited. + * + * setClientTargetProperty(ClientTargetProperty clientTargetProperty, float whitePointNits); */ SET_CLIENT_TARGET_PROPERTY = 0x105 << OPCODE_SHIFT, @@ -738,4 +746,18 @@ enum Command { * corresponding to the key as described above */ SET_LAYER_GENERIC_METADATA = 0x40e << OPCODE_SHIFT, + + /** + * SET_LAYER_WHITE_POINT_NITS has this pseudo prototype + * + * setLayerWhitePointNits(float sdrWhitePointNits); + * + * Sets the desired white point for the layer. This is intended to be used when presenting + * an SDR layer alongside HDR content. The HDR content will be presented at the display + * brightness in nits, and accordingly SDR content shall be dimmed to the desired white point + * provided. + * + * @param whitePointNits is the white point in nits. + */ + SET_LAYER_WHITE_POINT_NITS = 0x305 << OPCODE_SHIFT, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 9bde220fa4..92b99d5658 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -200,15 +200,12 @@ interface IComposerClient { * @param display is the display to query. * @param width is the client target width in pixels. * @param height is the client target height in pixels. - * @param format is the client target format. - * @param dataspace is the client target dataspace, as described in - * setLayerDataspace. + * @param clientTargetProperty is the client target format and dataspace. * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. * @exception EX_UNSUPPORTED when the given configuration is not supported. */ - void getClientTargetSupport(long display, int width, int height, - android.hardware.graphics.common.PixelFormat format, - android.hardware.graphics.common.Dataspace dataspace); + void getClientTargetSupport( + long display, int width, int height, in ClientTargetProperty clientTargetProperty); /** * Returns the color modes supported on this display. -- GitLab From 05698ff90781fbd52128ba6b4a813d3db4e4f2dd Mon Sep 17 00:00:00 2001 From: Tommy Chiu Date: Wed, 13 Oct 2021 18:37:21 +0800 Subject: [PATCH 179/825] Keymint: Update ClearOperationsTest.TooManyOperations parameter Keymint is not supposed to support public key operations. Update the parameter to reflect that. Bug: 202928979 Test: VtsAidlKeyMintTargetTest Change-Id: Id746953f5c68be6730beb3a7340e075ef28039c2 --- security/keymint/aidl/vts/functional/KeyMintTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp index 2a0ee7fd3e..9f9dc52dde 100644 --- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp +++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp @@ -6260,7 +6260,7 @@ TEST_P(ClearOperationsTest, TooManyOperations) { size_t i; for (i = 0; i < max_operations; i++) { - result = Begin(KeyPurpose::ENCRYPT, key_blob_, params, &out_params, op_handles[i]); + result = Begin(KeyPurpose::DECRYPT, key_blob_, params, &out_params, op_handles[i]); if (ErrorCode::OK != result) { break; } @@ -6268,12 +6268,12 @@ TEST_P(ClearOperationsTest, TooManyOperations) { EXPECT_EQ(ErrorCode::TOO_MANY_OPERATIONS, result); // Try again just in case there's a weird overflow bug EXPECT_EQ(ErrorCode::TOO_MANY_OPERATIONS, - Begin(KeyPurpose::ENCRYPT, key_blob_, params, &out_params)); + Begin(KeyPurpose::DECRYPT, key_blob_, params, &out_params)); for (size_t j = 0; j < i; j++) { EXPECT_EQ(ErrorCode::OK, Abort(op_handles[j])) << "Aboort failed for i = " << j << std::endl; } - EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::ENCRYPT, key_blob_, params, &out_params)); + EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::DECRYPT, key_blob_, params, &out_params)); AbortIfNeeded(); } -- GitLab From d515dbade2d02922131200d7cbfd7f1de58ce5e2 Mon Sep 17 00:00:00 2001 From: Sally Qi Date: Tue, 12 Oct 2021 18:53:23 +0000 Subject: [PATCH 180/825] Revert "Revert "Fix vts cases due to function change for async r..." Revert^2 "Second Patch for async RenderEngine" 2109270e74a18585aceffc94d1758cee47bb4175 Bug: 202843200 Bug: 202833127 Bug: 202808760 Test: this Change-Id: I504d2974d97e78431dc5d7e572e8ae70690dc34c --- .../composer/2.2/utils/vts/RenderEngineVts.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp index fe59a9d82a..2d4cc7d80e 100644 --- a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp +++ b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp @@ -61,18 +61,18 @@ void TestRenderEngine::initGraphicBuffer(uint32_t width, uint32_t height, uint32 void TestRenderEngine::drawLayers() { base::unique_fd bufferFence; - std::vector compositionLayerPointers; - compositionLayerPointers.reserve(mCompositionLayers.size()); + std::vector compositionLayers; + compositionLayers.reserve(mCompositionLayers.size()); std::transform(mCompositionLayers.begin(), mCompositionLayers.end(), - std::back_insert_iterator(compositionLayerPointers), - [](renderengine::LayerSettings& settings) -> renderengine::LayerSettings* { - return &settings; + std::back_insert_iterator(compositionLayers), + [](renderengine::LayerSettings& settings) -> renderengine::LayerSettings { + return settings; }); auto texture = std::make_shared( mGraphicBuffer, *mRenderEngine, renderengine::ExternalTexture::Usage::WRITEABLE); auto [status, readyFence] = mRenderEngine - ->drawLayers(mDisplaySettings, compositionLayerPointers, - texture, true, std::move(bufferFence)) + ->drawLayers(mDisplaySettings, compositionLayers, texture, + true, std::move(bufferFence)) .get(); int fd = readyFence.release(); if (fd != -1) { -- GitLab From 3d8595e3f91734da263f395403d2de6d65c11803 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 29 Sep 2021 15:48:33 -0700 Subject: [PATCH 181/825] Use ObjectPool objects in property store. Use object pool recyclable objects in property store API to improve code efficiency. This would reduce the number of unnecssary copy of property values. This CL also adds a upateStatus option which by default is set to false, so property from client would not override the property status. Test: atest VehicleHalVehicleUtilsTest Bug: 200737967 Change-Id: Ie96a41ee441e085e10ad1059b67c708ff7173ae0 --- automotive/vehicle/aidl/impl/Android.bp | 1 + .../common/include/VehiclePropertyStore.h | 46 ++-- .../utils/common/src/VehiclePropertyStore.cpp | 81 ++++---- .../common/test/VehiclePropertyStoreTest.cpp | 196 ++++++++++++------ 4 files changed, 208 insertions(+), 116 deletions(-) diff --git a/automotive/vehicle/aidl/impl/Android.bp b/automotive/vehicle/aidl/impl/Android.bp index fc3d40bdd8..94f590dd3e 100644 --- a/automotive/vehicle/aidl/impl/Android.bp +++ b/automotive/vehicle/aidl/impl/Android.bp @@ -22,6 +22,7 @@ cc_defaults { name: "VehicleHalDefaults", static_libs: [ "android.hardware.automotive.vehicle-V1-ndk", + "libmath", ], shared_libs: [ "libbase", diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h index b19ab841a8..ababf5e8fd 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -41,6 +42,9 @@ namespace vehicle { // This class is thread-safe, however it uses blocking synchronization across all methods. class VehiclePropertyStore { public: + explicit VehiclePropertyStore(std::shared_ptr valuePool) + : mValuePool(valuePool) {} + // Function that used to calculate unique token for given VehiclePropValue. using TokenFunction = ::std::function; @@ -53,10 +57,13 @@ class VehiclePropertyStore { const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config, TokenFunction tokenFunc = nullptr); - // Stores provided value. Returns true if value was written returns false if config wasn't - // registered. - ::android::base::Result writeValue( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); + // 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. + ::android::base::Result writeValue(VehiclePropValuePool::RecyclableType propValue, + bool updateStatus = false); // Remove a given property value from the property store. The 'propValue' would be used to // generate the key for the value to remove. @@ -67,24 +74,19 @@ class VehiclePropertyStore { void removeValuesForProperty(int32_t propId); // Read all the stored values. - std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> readAllValues() - const; + std::vector readAllValues() const; // Read all the values for the property. - ::android::base::Result< - std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>> + ::android::base::Result> readValuesForProperty(int32_t propId) const; // Read the value for the requested property. - ::android::base::Result< - std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>> - readValue( + ::android::base::Result readValue( const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& request) const; // Read the value for the requested property. - ::android::base::Result< - std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>> - readValue(int32_t prop, int32_t area = 0, int64_t token = 0) const; + ::android::base::Result readValue( + int32_t prop, int32_t area = 0, int64_t token = 0) const; // Get all property configs. std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig> getAllConfigs() @@ -100,20 +102,25 @@ class VehiclePropertyStore { int32_t area; int64_t token; + std::string toString() const; + bool operator==(const RecordId& other) const; - bool operator<(const RecordId& other) const; + }; - std::string toString() const; + struct RecordIdHash { + size_t operator()(RecordId const& recordId) const; }; struct Record { ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig propConfig; TokenFunction tokenFunction; - std::map values; + std::unordered_map values; }; mutable std::mutex mLock; std::unordered_map mRecordsByPropId GUARDED_BY(mLock); + // {@code VehiclePropValuePool} is thread-safe. + std::shared_ptr mValuePool; const Record* getRecordLocked(int32_t propId) const; @@ -123,9 +130,8 @@ class VehiclePropertyStore { const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue, const Record& record) const; - ::android::base::Result< - std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>> - readValueLocked(const RecordId& recId, const Record& record) const; + ::android::base::Result readValueLocked( + const RecordId& recId, const Record& record) const; }; } // 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 b660f36d65..2869d1d621 100644 --- a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp @@ -21,6 +21,7 @@ #include #include +#include namespace android { namespace hardware { @@ -29,6 +30,7 @@ namespace vehicle { using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::base::Result; @@ -36,14 +38,17 @@ bool VehiclePropertyStore::RecordId::operator==(const VehiclePropertyStore::Reco return area == other.area && token == other.token; } -bool VehiclePropertyStore::RecordId::operator<(const VehiclePropertyStore::RecordId& other) const { - return area < other.area || (area == other.area && token < other.token); -} - std::string VehiclePropertyStore::RecordId::toString() const { return ::fmt::format("RecordID{{.areaId={:d}, .token={:d}}}", area, token); } +size_t VehiclePropertyStore::RecordIdHash::operator()(RecordId const& recordId) const { + size_t res = 0; + hashCombine(res, recordId.area); + hashCombine(res, recordId.token); + return res; +} + const VehiclePropertyStore::Record* VehiclePropertyStore::getRecordLocked(int32_t propId) const REQUIRES(mLock) { auto RecordIt = mRecordsByPropId.find(propId); @@ -68,13 +73,13 @@ VehiclePropertyStore::RecordId VehiclePropertyStore::getRecordIdLocked( return recId; } -Result> VehiclePropertyStore::readValueLocked( +Result VehiclePropertyStore::readValueLocked( const RecordId& recId, const Record& record) const REQUIRES(mLock) { auto it = record.values.find(recId); if (it == record.values.end()) { return Errorf("Record ID: {} is not found", recId.toString()); } - return std::make_unique(it->second); + return mValuePool->obtain(*(it->second)); } void VehiclePropertyStore::registerProperty(const VehiclePropConfig& config, @@ -87,36 +92,42 @@ void VehiclePropertyStore::registerProperty(const VehiclePropConfig& config, }; } -Result VehiclePropertyStore::writeValue(const VehiclePropValue& propValue) { +Result VehiclePropertyStore::writeValue(VehiclePropValuePool::RecyclableType propValue, + bool updateStatus) { std::lock_guard g(mLock); - VehiclePropertyStore::Record* record = getRecordLocked(propValue.prop); + VehiclePropertyStore::Record* record = getRecordLocked(propValue->prop); if (record == nullptr) { - return Errorf("property: {:d} not registered", propValue.prop); + return Errorf("property: {:d} not registered", propValue->prop); } - if (!isGlobalProp(propValue.prop) && getAreaConfig(propValue, record->propConfig) == nullptr) { - return Errorf("no config for property: {:d} area: {:d}", propValue.prop, propValue.areaId); + if (!isGlobalProp(propValue->prop) && + getAreaConfig(*propValue, record->propConfig) == nullptr) { + return Errorf("no config for property: {:d} area: {:d}", propValue->prop, + propValue->areaId); } - VehiclePropertyStore::RecordId recId = getRecordIdLocked(propValue, *record); + VehiclePropertyStore::RecordId recId = getRecordIdLocked(*propValue, *record); auto it = record->values.find(recId); if (it == record->values.end()) { - record->values[recId] = propValue; + record->values[recId] = std::move(propValue); + if (!updateStatus) { + record->values[recId]->status = VehiclePropertyStatus::AVAILABLE; + } return {}; } - VehiclePropValue* valueToUpdate = &(it->second); - + const VehiclePropValue* valueToUpdate = it->second.get(); + long oldTimestamp = valueToUpdate->timestamp; + VehiclePropertyStatus oldStatus = valueToUpdate->status; // propValue is outdated and drops it. - if (valueToUpdate->timestamp > propValue.timestamp) { - return Errorf("outdated timestamp: {:d}", propValue.timestamp); - } - // Update the propertyValue. - // The timestamp in propertyStore should only be updated by the server side. It indicates - // the time when the event is generated by the server. - valueToUpdate->timestamp = propValue.timestamp; - valueToUpdate->value = propValue.value; - valueToUpdate->status = propValue.status; + if (oldTimestamp > propValue->timestamp) { + return Errorf("outdated timestamp: {:d}", propValue->timestamp); + } + record->values[recId] = std::move(propValue); + if (!updateStatus) { + record->values[recId]->status = oldStatus; + } + return {}; } @@ -145,25 +156,25 @@ void VehiclePropertyStore::removeValuesForProperty(int32_t propId) { record->values.clear(); } -std::vector VehiclePropertyStore::readAllValues() const { +std::vector VehiclePropertyStore::readAllValues() const { std::lock_guard g(mLock); - std::vector allValues; + std::vector allValues; for (auto const& [_, record] : mRecordsByPropId) { for (auto const& [_, value] : record.values) { - allValues.push_back(value); + allValues.push_back(std::move(mValuePool->obtain(*value))); } } return allValues; } -Result> VehiclePropertyStore::readValuesForProperty( - int32_t propId) const { +Result> +VehiclePropertyStore::readValuesForProperty(int32_t propId) const { std::lock_guard g(mLock); - std::vector values; + std::vector values; const VehiclePropertyStore::Record* record = getRecordLocked(propId); if (record == nullptr) { @@ -171,12 +182,12 @@ Result> VehiclePropertyStore::readValuesForPropert } for (auto const& [_, value] : record->values) { - values.push_back(value); + values.push_back(std::move(mValuePool->obtain(*value))); } return values; } -Result> VehiclePropertyStore::readValue( +Result VehiclePropertyStore::readValue( const VehiclePropValue& propValue) const { std::lock_guard g(mLock); @@ -189,9 +200,9 @@ Result> VehiclePropertyStore::readValue( return readValueLocked(recId, *record); } -Result> VehiclePropertyStore::readValue(int32_t propId, - int32_t areaId, - int64_t token) const { +Result VehiclePropertyStore::readValue(int32_t propId, + int32_t areaId, + int64_t token) const { std::lock_guard g(mLock); const VehiclePropertyStore::Record* record = getRecordLocked(propId); diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp index 8c70fea924..f1d218d2da 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp @@ -32,6 +32,8 @@ 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::VehiclePropertyStatus; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::base::Result; using ::testing::ElementsAre; @@ -51,6 +53,17 @@ int64_t timestampToken(const VehiclePropValue& value) { return value.timestamp; } +// A helper function to turn value pointer to value structure for easier comparison. +std::vector convertValuePtrsToValues( + const std::vector& values) { + std::vector returnValues; + returnValues.reserve(values.size()); + for (auto& value : values) { + returnValues.push_back(*value); + } + return returnValues; +} + } // namespace class VehiclePropertyStoreTest : public ::testing::Test { @@ -70,30 +83,33 @@ class VehiclePropertyStoreTest : public ::testing::Test { VehicleAreaConfig{.areaId = WHEEL_REAR_LEFT}, VehicleAreaConfig{.areaId = WHEEL_REAR_RIGHT}}, }; - mStore.registerProperty(mConfigFuelCapacity); - mStore.registerProperty(configTirePressure); + mValuePool = std::make_shared(); + mStore.reset(new VehiclePropertyStore(mValuePool)); + mStore->registerProperty(mConfigFuelCapacity); + mStore->registerProperty(configTirePressure); } - VehiclePropertyStore mStore; VehiclePropConfig mConfigFuelCapacity; + std::shared_ptr mValuePool; + std::unique_ptr mStore; }; TEST_F(VehiclePropertyStoreTest, testGetAllConfigs) { - std::vector configs = mStore.getAllConfigs(); + std::vector configs = mStore->getAllConfigs(); ASSERT_EQ(configs.size(), static_cast(2)); } TEST_F(VehiclePropertyStoreTest, testGetConfig) { Result result = - mStore.getConfig(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); + mStore->getConfig(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); ASSERT_RESULT_OK(result); ASSERT_EQ(*(result.value()), mConfigFuelCapacity); } TEST_F(VehiclePropertyStoreTest, testGetConfigWithInvalidPropId) { - Result result = mStore.getConfig(INVALID_PROP_ID); + Result result = mStore->getConfig(INVALID_PROP_ID); ASSERT_FALSE(result.ok()) << "expect error when getting a config for an invalid property ID"; } @@ -122,46 +138,47 @@ std::vector getTestPropValues() { TEST_F(VehiclePropertyStoreTest, testWriteValueOk) { auto values = getTestPropValues(); - ASSERT_RESULT_OK(mStore.writeValue(values[0])); + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(values[0]))); } TEST_F(VehiclePropertyStoreTest, testReadAllValues) { auto values = getTestPropValues(); for (const auto& value : values) { - ASSERT_RESULT_OK(mStore.writeValue(value)); + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(value))); } - auto gotValues = mStore.readAllValues(); + auto gotValues = mStore->readAllValues(); - ASSERT_THAT(gotValues, WhenSortedBy(propValueCmp, Eq(values))); + ASSERT_THAT(convertValuePtrsToValues(gotValues), WhenSortedBy(propValueCmp, Eq(values))); } TEST_F(VehiclePropertyStoreTest, testReadValuesForPropertyOneValue) { auto values = getTestPropValues(); for (const auto& value : values) { - ASSERT_RESULT_OK(mStore.writeValue(value)); + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(value))); } - auto result = mStore.readValuesForProperty(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); + auto result = mStore->readValuesForProperty(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); ASSERT_RESULT_OK(result); - ASSERT_THAT(result.value(), ElementsAre(values[0])); + ASSERT_THAT(convertValuePtrsToValues(result.value()), ElementsAre(values[0])); } TEST_F(VehiclePropertyStoreTest, testReadValuesForPropertyMultipleValues) { auto values = getTestPropValues(); for (const auto& value : values) { - ASSERT_RESULT_OK(mStore.writeValue(value)); + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(value))); } - auto result = mStore.readValuesForProperty(toInt(VehicleProperty::TIRE_PRESSURE)); + auto result = mStore->readValuesForProperty(toInt(VehicleProperty::TIRE_PRESSURE)); ASSERT_RESULT_OK(result); - ASSERT_THAT(result.value(), WhenSortedBy(propValueCmp, ElementsAre(values[1], values[2]))); + ASSERT_THAT(convertValuePtrsToValues(result.value()), + WhenSortedBy(propValueCmp, ElementsAre(values[1], values[2]))); } TEST_F(VehiclePropertyStoreTest, testReadValuesForPropertyError) { - auto result = mStore.readValuesForProperty(INVALID_PROP_ID); + auto result = mStore->readValuesForProperty(INVALID_PROP_ID); ASSERT_FALSE(result.ok()) << "expect error when reading values for an invalid property"; } @@ -169,7 +186,7 @@ TEST_F(VehiclePropertyStoreTest, testReadValuesForPropertyError) { TEST_F(VehiclePropertyStoreTest, testReadValueOk) { auto values = getTestPropValues(); for (const auto& value : values) { - ASSERT_RESULT_OK(mStore.writeValue(value)); + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(value))); } VehiclePropValue requestValue = { @@ -177,7 +194,7 @@ TEST_F(VehiclePropertyStoreTest, testReadValueOk) { .areaId = WHEEL_FRONT_LEFT, }; - auto result = mStore.readValue(requestValue); + auto result = mStore->readValue(requestValue); ASSERT_RESULT_OK(result); ASSERT_EQ(*(result.value()), values[1]); @@ -186,10 +203,10 @@ TEST_F(VehiclePropertyStoreTest, testReadValueOk) { TEST_F(VehiclePropertyStoreTest, testReadValueByPropIdOk) { auto values = getTestPropValues(); for (const auto& value : values) { - ASSERT_RESULT_OK(mStore.writeValue(value)); + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(value))); } - auto result = mStore.readValue(toInt(VehicleProperty::TIRE_PRESSURE), WHEEL_FRONT_RIGHT); + auto result = mStore->readValue(toInt(VehicleProperty::TIRE_PRESSURE), WHEEL_FRONT_RIGHT); ASSERT_EQ(*(result.value()), values[2]); } @@ -197,50 +214,47 @@ TEST_F(VehiclePropertyStoreTest, testReadValueByPropIdOk) { TEST_F(VehiclePropertyStoreTest, testReadValueError) { auto values = getTestPropValues(); for (const auto& value : values) { - ASSERT_RESULT_OK(mStore.writeValue(value)); + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(value))); } - auto result = mStore.readValue(toInt(VehicleProperty::TIRE_PRESSURE), WHEEL_REAR_LEFT); + auto result = mStore->readValue(toInt(VehicleProperty::TIRE_PRESSURE), WHEEL_REAR_LEFT); ASSERT_FALSE(result.ok()) << "expect error when reading a value that has not been written"; } TEST_F(VehiclePropertyStoreTest, testWriteValueError) { - ASSERT_FALSE(mStore.writeValue({ - .prop = INVALID_PROP_ID, - .value = {.floatValues = {1.0}}, - }) - .ok()) + auto v = mValuePool->obtain(VehiclePropertyType::FLOAT); + v->prop = INVALID_PROP_ID; + v->value.floatValues = {1.0}; + ASSERT_FALSE(mStore->writeValue(std::move(v)).ok()) << "expect error when writing value for an invalid property ID"; } TEST_F(VehiclePropertyStoreTest, testWriteValueNoAreaConfig) { - ASSERT_FALSE(mStore.writeValue({ - .prop = toInt(VehicleProperty::TIRE_PRESSURE), - .value = {.floatValues = {180.0}}, - // There is no config for ALL_WHEELS. - .areaId = ALL_WHEELS, - }) - .ok()) + auto v = mValuePool->obtain(VehiclePropertyType::FLOAT); + v->prop = toInt(VehicleProperty::TIRE_PRESSURE); + v->value.floatValues = {1.0}; + // There is no config for ALL_WHEELS. + v->areaId = ALL_WHEELS; + ASSERT_FALSE(mStore->writeValue(std::move(v)).ok()) << "expect error when writing value for an area without config"; } TEST_F(VehiclePropertyStoreTest, testWriteOutdatedValue) { - ASSERT_RESULT_OK(mStore.writeValue({ - .timestamp = 1, - .prop = toInt(VehicleProperty::TIRE_PRESSURE), - .value = {.floatValues = {180.0}}, - .areaId = WHEEL_FRONT_LEFT, - })); + auto v = mValuePool->obtain(VehiclePropertyType::FLOAT); + v->timestamp = 1; + v->prop = toInt(VehicleProperty::TIRE_PRESSURE); + v->value.floatValues = {180.0}; + v->areaId = WHEEL_FRONT_LEFT; + ASSERT_RESULT_OK(mStore->writeValue(std::move(v))); // Write an older value. - ASSERT_FALSE(mStore.writeValue({ - .timestamp = 0, - .prop = toInt(VehicleProperty::TIRE_PRESSURE), - .value = {.floatValues = {180.0}}, - .areaId = WHEEL_FRONT_LEFT, - }) - .ok()) + auto v2 = mValuePool->obtain(VehiclePropertyType::FLOAT); + v2->timestamp = 0; + v2->prop = toInt(VehicleProperty::TIRE_PRESSURE); + v2->value.floatValues = {180.0}; + v2->areaId = WHEEL_FRONT_LEFT; + ASSERT_FALSE(mStore->writeValue(std::move(v2)).ok()) << "expect error when writing an outdated value"; } @@ -251,7 +265,7 @@ TEST_F(VehiclePropertyStoreTest, testToken) { }; // Replace existing config. - mStore.registerProperty(config, timestampToken); + mStore->registerProperty(config, timestampToken); VehiclePropValue fuelCapacityValueToken1 = { .timestamp = 1, @@ -265,15 +279,15 @@ TEST_F(VehiclePropertyStoreTest, testToken) { .value = {.floatValues = {2.0}}, }; - ASSERT_RESULT_OK(mStore.writeValue(fuelCapacityValueToken1)); - ASSERT_RESULT_OK(mStore.writeValue(fuelCapacityValueToken2)); + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacityValueToken1))); + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacityValueToken2))); - auto result = mStore.readValuesForProperty(propId); + auto result = mStore->readValuesForProperty(propId); ASSERT_RESULT_OK(result); ASSERT_EQ(result.value().size(), static_cast(2)); - auto tokenResult = mStore.readValue(propId, /*areaId=*/0, /*token=*/2); + auto tokenResult = mStore->readValue(propId, /*areaId=*/0, /*token=*/2); ASSERT_RESULT_OK(tokenResult); ASSERT_EQ(*(tokenResult.value()), fuelCapacityValueToken2); @@ -282,14 +296,14 @@ TEST_F(VehiclePropertyStoreTest, testToken) { TEST_F(VehiclePropertyStoreTest, testRemoveValue) { auto values = getTestPropValues(); for (const auto& value : values) { - ASSERT_RESULT_OK(mStore.writeValue(value)); + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(value))); } - mStore.removeValue(values[0]); + mStore->removeValue(values[0]); - ASSERT_FALSE(mStore.readValue(values[0]).ok()) << "expect error when reading a removed value"; + ASSERT_FALSE(mStore->readValue(values[0]).ok()) << "expect error when reading a removed value"; - auto leftTirePressureResult = mStore.readValue(values[1]); + auto leftTirePressureResult = mStore->readValue(values[1]); ASSERT_RESULT_OK(leftTirePressureResult); ASSERT_EQ(*(leftTirePressureResult.value()), values[1]); @@ -298,16 +312,76 @@ TEST_F(VehiclePropertyStoreTest, testRemoveValue) { TEST_F(VehiclePropertyStoreTest, testRemoveValuesForProperty) { auto values = getTestPropValues(); for (const auto& value : values) { - ASSERT_RESULT_OK(mStore.writeValue(value)); + ASSERT_RESULT_OK(mStore->writeValue(std::move(mValuePool->obtain(value)))); } - mStore.removeValuesForProperty(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); - mStore.removeValuesForProperty(toInt(VehicleProperty::TIRE_PRESSURE)); + mStore->removeValuesForProperty(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); + mStore->removeValuesForProperty(toInt(VehicleProperty::TIRE_PRESSURE)); - auto gotValues = mStore.readAllValues(); + auto gotValues = mStore->readAllValues(); ASSERT_TRUE(gotValues.empty()); } +TEST_F(VehiclePropertyStoreTest, testWriteValueUpdateStatus) { + VehiclePropValue fuelCapacity = { + .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), + .value = {.floatValues = {1.0}}, + }; + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacity), true)); + + fuelCapacity.status = VehiclePropertyStatus::UNAVAILABLE; + + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacity), true)); + + VehiclePropValue requestValue = { + .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), + }; + + auto result = mStore->readValue(requestValue); + + ASSERT_RESULT_OK(result); + ASSERT_EQ(result.value()->status, VehiclePropertyStatus::UNAVAILABLE); +} + +TEST_F(VehiclePropertyStoreTest, testWriteValueNoUpdateStatus) { + VehiclePropValue fuelCapacity = { + .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), + .value = {.floatValues = {1.0}}, + }; + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacity), true)); + + fuelCapacity.status = VehiclePropertyStatus::UNAVAILABLE; + + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacity), false)); + + VehiclePropValue requestValue = { + .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), + }; + + auto result = mStore->readValue(requestValue); + + ASSERT_RESULT_OK(result); + ASSERT_EQ(result.value()->status, VehiclePropertyStatus::AVAILABLE); +} + +TEST_F(VehiclePropertyStoreTest, testWriteValueNoUpdateStatusForNewValue) { + VehiclePropValue fuelCapacity = { + .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), + .value = {.floatValues = {1.0}}, + .status = VehiclePropertyStatus::UNAVAILABLE, + }; + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacity), false)); + + VehiclePropValue requestValue = { + .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), + }; + + auto result = mStore->readValue(requestValue); + + ASSERT_RESULT_OK(result); + ASSERT_EQ(result.value()->status, VehiclePropertyStatus::AVAILABLE); +} + } // namespace vehicle } // namespace automotive } // namespace hardware -- GitLab From 2997151fae6e22c1459fe1e966e0bea0be16443c Mon Sep 17 00:00:00 2001 From: Long Ling Date: Tue, 12 Oct 2021 11:09:31 -0700 Subject: [PATCH 182/825] Fix comile error for pixel aidl hwc Bug: 201321174 Change-Id: Ib64dce591232e62985f72dffff22792fe908407a --- .../include/composer-resources/2.2/ComposerResources.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphics/composer/2.2/utils/resources/include/composer-resources/2.2/ComposerResources.h b/graphics/composer/2.2/utils/resources/include/composer-resources/2.2/ComposerResources.h index 33012e92c8..18a50fecd7 100644 --- a/graphics/composer/2.2/utils/resources/include/composer-resources/2.2/ComposerResources.h +++ b/graphics/composer/2.2/utils/resources/include/composer-resources/2.2/ComposerResources.h @@ -29,6 +29,8 @@ namespace composer { namespace V2_2 { namespace hal { +using V2_1::Display; +using V2_1::Error; using V2_1::hal::ComposerHandleCache; using V2_1::hal::ComposerHandleImporter; -- GitLab From f527f8f774e9caaceb9ef6ff7bbce27525f4cc37 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 12 Oct 2021 09:45:28 -0700 Subject: [PATCH 183/825] uwb(interface): Add a package for Android specific params in UCI Along with the FIRA standard defined UCI specification, Android needs to support some Android specific commands/params (uses vendor carve-outs in the specifications). Use this new package to explicitly specify these Android specific commands/params. Note: This package is not tied to main UWB HAL interface and should be updatable between dessert releases (infra changes needed to support this still needs to be figured out). Bug: 197886322 Test: Compiles Change-Id: Id8b50a84cec40f80389cef3a7bfad920a3e07446 --- .../exclude/fcm_exclude.cpp | 1 + uwb/aidl/Android.bp | 27 ++++++++++++ .../uwb/fira_android/UwbVendorGids.aidl | 38 +++++++++++++++++ ...UwbVendorSessionSetAppConfigCmdParams.aidl | 41 +++++++++++++++++++ .../uwb/fira_android/UwbVendorGids.aidl | 36 ++++++++++++++++ ...UwbVendorSessionSetAppConfigCmdParams.aidl | 37 +++++++++++++++++ .../hardware/uwb/fira_android/readme.txt | 13 ++++++ 7 files changed, 193 insertions(+) create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl create mode 100644 uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGids.aidl create mode 100644 uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl create mode 100644 uwb/aidl/android/hardware/uwb/fira_android/readme.txt diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp index d8c9170000..1def7381ef 100644 --- a/compatibility_matrices/exclude/fcm_exclude.cpp +++ b/compatibility_matrices/exclude/fcm_exclude.cpp @@ -57,6 +57,7 @@ bool ShouldCheckMissingHalsInFcm(const std::string& package) { "android.hardware.graphics.common", "android.hardware.keymaster", "android.hardware.radio", + "android.hardware.uwb.fira_android", // Fastboot HAL is only used by recovery. Recovery is owned by OEM. Framework // does not depend on this HAL, hence it is not declared in any manifests or matrices. diff --git a/uwb/aidl/Android.bp b/uwb/aidl/Android.bp index 5d217537ab..0d1ebc23f3 100755 --- a/uwb/aidl/Android.bp +++ b/uwb/aidl/Android.bp @@ -17,6 +17,7 @@ aidl_interface { backend: { java: { sdk_version: "module_current", + enabled: false, }, ndk: { vndk: { @@ -37,3 +38,29 @@ aidl_interface { }, }, } + +aidl_interface { + name: "android.hardware.uwb.fira_android", + vendor_available: true, + srcs: ["android/hardware/uwb/fira_android/*.aidl"], + stability: "vintf", + backend: { + java: { + sdk_version: "module_current", + enabled: true, + apex_available: [ + "com.android.uwb", + ], + }, + ndk: { + vndk: { + enabled: true, + }, + apex_available: [ + "//apex_available:platform", + "com.android.uwb", + ], + min_sdk_version: "current", + }, + }, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl new file mode 100644 index 0000000000..b0d88e0c94 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.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 -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.uwb.fira_android; +@Backing(type="byte") @VintfStability +enum UwbVendorGids { + ANDROID = 14, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl new file mode 100644 index 0000000000..37b7efb321 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.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 -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.uwb.fira_android; +@Backing(type="int") @VintfStability +enum UwbVendorSessionSetAppConfigCmdParams { + CCC_RANGING_PROTOCOL_VER = 163, + CCC_UWB_CONFIG_ID = 164, + CCC_PULSESHAPE_COMBO = 165, + CCC_URSK_TTL = 166, +} diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGids.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGids.aidl new file mode 100644 index 0000000000..c7bc6b051c --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGids.aidl @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package android.hardware.uwb.fira_android; + +/** + * Android specific vendor command GIDs (Group ID) should be defined here. + * + * For each vendor GID defined here, also create a corresponding AIDL file enumerating the + * OIDs (Opcode Identifier) allowed within that GID. + * For ex: VENDOR_GID_XXX = 1110b -> UwbVendorGidXXXOids.aidl + */ +@VintfStability +@Backing(type="byte") +enum UwbVendorGids { + /** + * Use values from the Proprietary Group range: 1110b – 1111b defined in Table 36 of + * UCI specification. + */ + + /** All Android specific commands/response/notification should use this GID */ + ANDROID = 0xE, +} diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl new file mode 100644 index 0000000000..850e2da490 --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.uwb.fira_android; + +/** + * Android specific vendor app params set in UCI command: + * GID: 0001b (UWB Session config Group) + * OID: 000011b (SESSION_SET_APP_CONFIG_CMD) + * + * Note: Refer to Table 34 of the UCI specification for the other params + * expected in this command. + */ +@VintfStability +@Backing(type="int") +enum UwbVendorSessionSetAppConfigCmdParams { + /** CCC params for ranging start */ + + /** Added in vendor version 0. */ + CCC_RANGING_PROTOCOL_VER = 0xA3, + CCC_UWB_CONFIG_ID = 0xA4, + CCC_PULSESHAPE_COMBO = 0xA5, + CCC_URSK_TTL = 0xA6, +} diff --git a/uwb/aidl/android/hardware/uwb/fira_android/readme.txt b/uwb/aidl/android/hardware/uwb/fira_android/readme.txt new file mode 100644 index 0000000000..6195427bb7 --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/fira_android/readme.txt @@ -0,0 +1,13 @@ +The android.hardware.uwb.fira_android package is used to add any Android specific +additions to the UCI specification defined by FIRA standards body. These +additions should be added to the vendor specific portions carved out in the UCI +specification. + +These include: + - Android specific GIDs/OIDs for commands/responses/notifications. + - Andriod specific params in an existing UCI specified command/response/notification. + +All other interactions sent/received over the HAL interface is expected to +comply with the UCI specification that can be found here: +https://groups.firaconsortium.org/wg/Technical/document/folder/127 +(TODO(b/196004116): Link to the published specification) -- GitLab From abe080d6e3574a005052962e59eb8347bc448579 Mon Sep 17 00:00:00 2001 From: Rucha Katakwar Date: Tue, 12 Oct 2021 10:21:24 -0700 Subject: [PATCH 184/825] Camera: Add torch brightness control keys. 1.FLASH_INFO_STRENGTH_MAXIMUM_LEVEL : Number of brightness levels. 2.FLASH_INFO_STRENGTH_DEFAULT_LEVEL : Default brightness level to be set via setTorchBrightnessLevel API. bug: 200174275 Change-Id: Iab35bc3cbc8c8ede0b1729f45be4b8ba1b3fed78 --- camera/metadata/3.8/types.hal | 60 +++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 camera/metadata/3.8/types.hal diff --git a/camera/metadata/3.8/types.hal b/camera/metadata/3.8/types.hal new file mode 100644 index 0000000000..dcee775c89 --- /dev/null +++ b/camera/metadata/3.8/types.hal @@ -0,0 +1,60 @@ +/* + * 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. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata@3.8; + +import android.hardware.camera.metadata@3.2; +import android.hardware.camera.metadata@3.3; +import android.hardware.camera.metadata@3.4; +import android.hardware.camera.metadata@3.5; +import android.hardware.camera.metadata@3.6; +import android.hardware.camera.metadata@3.7; + +// No new metadata sections added in this revision + +/** + * Main enumeration for defining camera metadata tags added in this revision + * + *

Partial documentation is included for each tag; for complete documentation, reference + * '/system/media/camera/docs/docs.html' in the corresponding Android source tree.

+ */ +enum CameraMetadataTag : @3.7::CameraMetadataTag { + /** android.flash.info.strengthMaximumLevel [static, int32, public] + * + *

Maximum flashlight brightness level.

+ */ + ANDROID_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL = android.hardware.camera.metadata@3.2::CameraMetadataTag:ANDROID_FLASH_INFO_END, + + /** android.flash.info.strengthDefaultLevel [static, int32, public] + * + *

Default flashlight brightness level to be set via + * {android.hardware.camera2.CameraManager#setTorchStrengthLevel}.

+ */ + ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL, + + ANDROID_FLASH_INFO_END_3_8, + +}; + +/* + * Enumeration definitions for the various entries that need them + */ -- GitLab From 5f696940c9d9a15092b8b6c1df527bddfab4d509 Mon Sep 17 00:00:00 2001 From: ramindani Date: Thu, 14 Oct 2021 16:24:18 +0000 Subject: [PATCH 185/825] Fix the conditions for the tests based on comments on ag/15968818. Check EXPECT_TRUE with status ok and Error none for valid display. and EXPECT_FALSE with status ok. If service exists then we can proceed with test otherwise tests will be skipped. Test: atest VtsHalGraphicsComposer3_TargetTest but tests don't just work yet. as we don't have service implementation. BUG: 202053621 Change-Id: Iff8f4ca1e102ad8333ca63b0722b1fbd26414d06 --- .../VtsHalGraphicsComposer3_TargetTest.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index d892681585..40dfe06eda 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -13,17 +13,15 @@ #undef LOG_TAG #define LOG_TAG "VtsHalGraphicsComposer3_TargetTest" -typedef uint64_t DisplayId; - namespace aidl::android::hardware::graphics::composer3::vts { namespace { class VtsDisplay { public: - VtsDisplay(DisplayId displayId, int32_t displayWidth, int32_t displayHeight) + VtsDisplay(uint64_t displayId, int32_t displayWidth, int32_t displayHeight) : mDisplayId(displayId), mDisplayWidth(displayWidth), mDisplayHeight(displayHeight) {} - DisplayId get() const { return mDisplayId; } + uint64_t get() const { return mDisplayId; } void setDimensions(int32_t displayWidth, int32_t displayHeight) { mDisplayWidth = displayWidth; @@ -31,7 +29,7 @@ class VtsDisplay { } private: - const DisplayId mDisplayId; + const uint64_t mDisplayId; int32_t mDisplayWidth; int32_t mDisplayHeight; }; @@ -51,7 +49,7 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { // returns an invalid display id (one that has not been registered to a // display. Currently assuming that a device will never have close to // std::numeric_limit::max() displays registered while running tests - DisplayId GetInvalidDisplayId() { + uint64_t GetInvalidDisplayId() { uint64_t id = std::numeric_limits::max(); while (id > 0) { if (std::none_of(mDisplays.begin(), mDisplays.end(), @@ -65,8 +63,8 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { } std::shared_ptr mComposer; - std::shared_ptr mComposerClient{}; - DisplayId mInvalidDisplayId; + std::shared_ptr mComposerClient; + uint64_t mInvalidDisplayId; std::vector mDisplays; // TODO(b/202401906) populate all the displays available for test. }; @@ -74,15 +72,16 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { TEST_P(GraphicsComposerAidlTest, getDisplayCapabilitiesBadDisplay) { std::vector capabilities; const auto error = mComposerClient->getDisplayCapabilities(mInvalidDisplayId, &capabilities); + + EXPECT_FALSE(error.isOk()); EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); } TEST_P(GraphicsComposerAidlTest, getDisplayCapabilities) { for (const auto& display : mDisplays) { std::vector capabilities; - const auto error = mComposerClient->getDisplayCapabilities(display.get(), &capabilities); - EXPECT_NE(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_TRUE(mComposerClient->getDisplayCapabilities(display.get(), &capabilities).isOk()); } } -- GitLab From fce46f4642fda2d17d196f409dfa540690b17e34 Mon Sep 17 00:00:00 2001 From: Veerendranath Jakkam Date: Fri, 8 Oct 2021 03:05:31 +0530 Subject: [PATCH 186/825] wifi: Avoid doing iface reset when dynamic MAC update supported Skip doing iface reset(down and up) to change MAC address if driver indicates support for WIFI_FEATURE_DYNAMIC_SET_MAC. Bug: 202424223 Test: atest VtsHalWifiV1_5TargetTest Test: Manual - Connect STA to AP and check random mac is set Change-Id: I86cf86e20893759a4e926571727943e4ee51d093 --- wifi/1.5/default/wifi_iface_util.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wifi/1.5/default/wifi_iface_util.cpp b/wifi/1.5/default/wifi_iface_util.cpp index 7bf830b875..0977026698 100644 --- a/wifi/1.5/default/wifi_iface_util.cpp +++ b/wifi/1.5/default/wifi_iface_util.cpp @@ -56,14 +56,21 @@ std::array WifiIfaceUtil::getFactoryMacAddress( bool WifiIfaceUtil::setMacAddress(const std::string& iface_name, const std::array& mac) { #ifndef WIFI_AVOID_IFACE_RESET_MAC_CHANGE - if (!iface_tool_.lock()->SetUpState(iface_name.c_str(), false)) { + legacy_hal::wifi_error legacy_status; + uint64_t legacy_feature_set; + std::tie(legacy_status, legacy_feature_set) = + legacy_hal_.lock()->getSupportedFeatureSet(iface_name); + + if (!(legacy_feature_set & WIFI_FEATURE_DYNAMIC_SET_MAC) && + !iface_tool_.lock()->SetUpState(iface_name.c_str(), false)) { LOG(ERROR) << "SetUpState(false) failed."; return false; } #endif bool success = iface_tool_.lock()->SetMacAddress(iface_name.c_str(), mac); #ifndef WIFI_AVOID_IFACE_RESET_MAC_CHANGE - if (!iface_tool_.lock()->SetUpState(iface_name.c_str(), true)) { + if (!(legacy_feature_set & WIFI_FEATURE_DYNAMIC_SET_MAC) && + !iface_tool_.lock()->SetUpState(iface_name.c_str(), true)) { LOG(ERROR) << "SetUpState(true) failed. Wait for driver ready."; // Wait for driver ready and try to set iface UP again if (legacy_hal_.lock()->waitForDriverReady() != -- GitLab From 5cd6212fee041ba716c601cc8a0d901a398a1aeb Mon Sep 17 00:00:00 2001 From: Snild Dolkow Date: Thu, 16 Sep 2021 09:41:36 +0200 Subject: [PATCH 187/825] Revert "Clarify the ComposerClient comment for CONFIG_GROUP" This reverts commit 37c5495c52f200a26ea4ac064180af7f2f8ae722. This "clarification" was in fact a change of the HAL interface, introducing a new requirement which was not present in earlier Android releases. There are devices on the market that switch seamlessly between configs that differ in resolution and DPI, and therefore have those configs in a config group. Bug: 200184776 Test: m Change-Id: I5bba1c6532f5f46da874385164a0bc0cc0435225 --- current.txt | 2 +- graphics/composer/2.4/IComposerClient.hal | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/current.txt b/current.txt index cb91843141..1dbf5ab1be 100644 --- a/current.txt +++ b/current.txt @@ -906,7 +906,7 @@ c8a57364f6ad20842be14f4db284df5304f7521ca8eac6bcc1fa6c5b466fb8a6 android.hardwar # ABI preserving changes to HALs during Android T 62ace52d9c3ff1f60f94118557a2aaf0b953513e59dcd34d5f94ae28d4c7e780 android.hardware.fastboot@1.0::IFastboot -b4a59462aa7d1346ee3eaa06a8e13682462746cf1be62ed2a2bd46bf404d01b7 android.hardware.graphics.composer@2.4::IComposerClient +f767a132ef28275294db15353f14f3876a4048770751931a77d038d4228f2cb7 android.hardware.graphics.composer@2.4::IComposerClient ca62a2a95d173ed323309e5e00f653ad3cceec82a6e5e4976a249cb5aafe2515 android.hardware.neuralnetworks@1.2::types fa76bced6b1b71c40fc706c508a9011284c57f57831cd0cf5f45653ed4ea463e android.hardware.neuralnetworks@1.3::types diff --git a/graphics/composer/2.4/IComposerClient.hal b/graphics/composer/2.4/IComposerClient.hal index e27fd6e898..476302f1bf 100644 --- a/graphics/composer/2.4/IComposerClient.hal +++ b/graphics/composer/2.4/IComposerClient.hal @@ -34,9 +34,7 @@ interface IComposerClient extends @2.3::IComposerClient { /** * The configuration group ID (as int32_t) 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. + * in some conditions via setActiveConfigWithConstraints. */ CONFIG_GROUP = 7, }; -- GitLab From a7adbcc630384053b267be3debb1e2a96c9d2233 Mon Sep 17 00:00:00 2001 From: Ian Hua Date: Wed, 15 Sep 2021 15:10:06 +0100 Subject: [PATCH 188/825] AIDL interface changes for NNAPI feature level 6. - Add BATCH_MATMUL operation - Support TENSOR_INT32 for RESHAPE operation. Also update "current" version snapshot and use android.hardware.neuralnetworks-V2-ndk since AIDL v1 has been frozen. Bug: 193012662 Bug: 200281183 Test: NeuralNetworksTest_static,VtsHalNeuralnetworksTargetTest Change-Id: Iabe45c57e2306d61055f711eda03b80b9cbe906d --- .../compatibility_matrix.current.xml | 1 + neuralnetworks/1.3/vts/functional/Android.bp | 2 +- .../neuralnetworks/OperationType.aidl | 1 + .../neuralnetworks/OperationType.aidl | 37 +++++++++++++++++++ neuralnetworks/aidl/utils/Android.bp | 4 +- neuralnetworks/aidl/vts/functional/Android.bp | 2 +- neuralnetworks/utils/common/Android.bp | 2 +- neuralnetworks/utils/service/Android.bp | 2 +- 8 files changed, 45 insertions(+), 6 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index a1f1de992b..92f9263117 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -418,6 +418,7 @@
android.hardware.neuralnetworks + 1-2 IDevice .* diff --git a/neuralnetworks/1.3/vts/functional/Android.bp b/neuralnetworks/1.3/vts/functional/Android.bp index 1382bdb785..ab0a0184be 100644 --- a/neuralnetworks/1.3/vts/functional/Android.bp +++ b/neuralnetworks/1.3/vts/functional/Android.bp @@ -66,7 +66,7 @@ cc_test { "VtsHalNeuralNetworksV1_0_utils", "VtsHalNeuralNetworksV1_2_utils", "VtsHalNeuralNetworksV1_3_utils", - "android.hardware.neuralnetworks-V1-ndk", + "android.hardware.neuralnetworks-V2-ndk", "android.hardware.neuralnetworks@1.0", "android.hardware.neuralnetworks@1.1", "android.hardware.neuralnetworks@1.2", diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl index de3b438115..425914347b 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl @@ -136,4 +136,5 @@ enum OperationType { HARD_SWISH = 99, FILL = 100, RANK = 101, + BATCH_MATMUL = 102, } diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl index 52d2d70720..d9951d58ef 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl @@ -1471,6 +1471,7 @@ enum OperationType { * * {@link OperandType::TENSOR_FLOAT32} * * {@link OperandType::TENSOR_QUANT8_ASYMM} * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since HAL version 1.3) + * * {@link OperandType::TENSOR_INT32} (since NNAPI feature level 6) * * Supported tensor rank: up to 4. * @@ -5236,4 +5237,40 @@ enum OperationType { * of the input tensor. */ RANK = 101, + + /** + * Performs multiplication of two tensors in batches. + * + * Multiplies all slices of two input tensors and arranges the individual + * results in a single output tensor of the same batch size. Each pair of + * slices in the same batch have identical {@link OperandType}. Each + * slice can optionally be adjointed (transpose and conjugate) before + * multiplication. + * + * The two input tensors and the output tensor must be 2-D or higher and + * have the same batch size. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * * {@link OperandType::TENSOR_INT32} + * + * Supported tensor rank: at least 2 and up to 4 + * + * Inputs: + * * 0: A tensor with 2-D or higher shape [..., r_x, c_x]. + * * 1: A tensor with 2-D or higher shape [..., r_y, c_y]. It has the same + * {@link OperandType} and batch size as input0. + * * 2: An optional {@link OperandType::BOOL} scalar adj_x, default + * to false. Set to true to adjoint the slices of input0. + * * 3: An optional {@link OperandType::BOOL} scalar adj_y, default + * to false. Set to true to adjoint the slices of input1. + * + * Outputs: + * * 0: A tensor with 2-D or higher shape [..., r_o, c_o], where + * r_o = c_x if adj_x else r_x + * c_o = r_y if adj_y else c_y + */ + BATCH_MATMUL = 102, } diff --git a/neuralnetworks/aidl/utils/Android.bp b/neuralnetworks/aidl/utils/Android.bp index 3c80d75b64..63cf45dd69 100644 --- a/neuralnetworks/aidl/utils/Android.bp +++ b/neuralnetworks/aidl/utils/Android.bp @@ -38,7 +38,7 @@ cc_library_static { "neuralnetworks_utils_hal_common", ], shared_libs: [ - "android.hardware.neuralnetworks-V1-ndk", + "android.hardware.neuralnetworks-V2-ndk", "libbinder_ndk", "libhidlbase", ], @@ -58,7 +58,7 @@ cc_test { static_libs: [ "android.hardware.common-V2-ndk", "android.hardware.graphics.common-V3-ndk", - "android.hardware.neuralnetworks-V1-ndk", + "android.hardware.neuralnetworks-V2-ndk", "libaidlcommonsupport", "libgmock", "libneuralnetworks_common", diff --git a/neuralnetworks/aidl/vts/functional/Android.bp b/neuralnetworks/aidl/vts/functional/Android.bp index 40da1fd36a..f3404a9cf6 100644 --- a/neuralnetworks/aidl/vts/functional/Android.bp +++ b/neuralnetworks/aidl/vts/functional/Android.bp @@ -51,7 +51,7 @@ cc_test { static_libs: [ "android.hardware.common-V2-ndk", "android.hardware.graphics.common-V3-ndk", - "android.hardware.neuralnetworks-V1-ndk", + "android.hardware.neuralnetworks-V2-ndk", "android.hidl.allocator@1.0", "android.hidl.memory@1.0", "libaidlcommonsupport", diff --git a/neuralnetworks/utils/common/Android.bp b/neuralnetworks/utils/common/Android.bp index 431885ccbf..f88e407923 100644 --- a/neuralnetworks/utils/common/Android.bp +++ b/neuralnetworks/utils/common/Android.bp @@ -35,7 +35,7 @@ cc_library_static { "neuralnetworks_types", ], shared_libs: [ - "android.hardware.neuralnetworks-V1-ndk", + "android.hardware.neuralnetworks-V2-ndk", "libhidlbase", "libbinder_ndk", ], diff --git a/neuralnetworks/utils/service/Android.bp b/neuralnetworks/utils/service/Android.bp index 653e51ad08..fbb8679508 100644 --- a/neuralnetworks/utils/service/Android.bp +++ b/neuralnetworks/utils/service/Android.bp @@ -39,7 +39,7 @@ cc_library_static { "neuralnetworks_utils_hal_common", ], shared_libs: [ - "android.hardware.neuralnetworks-V1-ndk", + "android.hardware.neuralnetworks-V2-ndk", "android.hardware.neuralnetworks@1.0", "android.hardware.neuralnetworks@1.1", "android.hardware.neuralnetworks@1.2", -- GitLab From 3910aa4b58ab893e6b2bd74151302b78ebaf0fe6 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 11 Oct 2021 16:41:32 -0700 Subject: [PATCH 189/825] Fix minor bugs about value type. Both requestId and timestamp is defined as 'long' in aidl, which is 'int64_t' in c++. Test: Presubmit Bug: 201830716 Change-Id: I8c6e50aa7a67177bb4e01ab279f62ce772d1e1a9 --- .../test/proto_message_converter_test.cpp | 2 +- .../vehicle/aidl/impl/hardware/include/IVehicleHardware.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp index d5f23739cb..c742db51f5 100644 --- a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp +++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp @@ -45,7 +45,7 @@ std::vector prepareTestConfigs() { std::vector prepareTestValues() { std::vector values; - long timestamp = 1; + int64_t timestamp = 1; for (auto& property : defaultconfig::getDefaultConfigs()) { values.push_back({ .timestamp = timestamp, diff --git a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h index 981088a34d..58531b9c9d 100644 --- a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h @@ -39,7 +39,7 @@ struct DumpResult { // A request type for 'setValues' or 'getValues' method. struct VehiclePropValueRequest { // A unique request ID set by the sender. - int requestId; + int64_t requestId; // The property to get/set. ::aidl::android::hardware::automotive::vehicle::VehiclePropValue value; }; -- GitLab From a47f2a3eb8275fb52a2ebd3ad527d6166f374b77 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Mon, 18 Oct 2021 14:16:12 -0700 Subject: [PATCH 190/825] uwb: Change readme.txt to README.md Bug: 197886322 Test: Compiles Change-Id: I30c0c6c3a0d807130f574d4d59aba89d3ffabea4 --- .../uwb/fira_android/{readme.txt => README.md} | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) rename uwb/aidl/android/hardware/uwb/fira_android/{readme.txt => README.md} (68%) diff --git a/uwb/aidl/android/hardware/uwb/fira_android/readme.txt b/uwb/aidl/android/hardware/uwb/fira_android/README.md similarity index 68% rename from uwb/aidl/android/hardware/uwb/fira_android/readme.txt rename to uwb/aidl/android/hardware/uwb/fira_android/README.md index 6195427bb7..e658d934aa 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/readme.txt +++ b/uwb/aidl/android/hardware/uwb/fira_android/README.md @@ -1,4 +1,4 @@ -The android.hardware.uwb.fira_android package is used to add any Android specific +The `android.hardware.uwb.fira_android` package is used to add any Android specific additions to the UCI specification defined by FIRA standards body. These additions should be added to the vendor specific portions carved out in the UCI specification. @@ -8,6 +8,8 @@ These include: - Andriod specific params in an existing UCI specified command/response/notification. All other interactions sent/received over the HAL interface is expected to -comply with the UCI specification that can be found here: -https://groups.firaconsortium.org/wg/Technical/document/folder/127 -(TODO(b/196004116): Link to the published specification) +comply with the UCI specification that can be found [here]( +https://groups.firaconsortium.org/wg/Technical/document/folder/127). + +TODO([b/196004116](b/196004116)): Link to the published specification. + -- GitLab From d06f050dca508b7da0fca86ecc3b733ed2c7df99 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Tue, 21 Sep 2021 16:32:07 -0700 Subject: [PATCH 191/825] Add command buffer support for AidlComposer Bug: 198190384 Test: build Change-Id: Ia28cf992b0ab06099a9ea3f871925839e92e8dc9 --- graphics/composer/aidl/Android.bp | 19 + .../graphics/composer3/command-buffer.h | 895 ++++++++++++++++++ 2 files changed, 914 insertions(+) create mode 100644 graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp index 5006185481..e33c6537e9 100644 --- a/graphics/composer/aidl/Android.bp +++ b/graphics/composer/aidl/Android.bp @@ -67,3 +67,22 @@ cc_library { ], export_include_dirs: ["include"], } + +cc_library_headers { + name: "android.hardware.graphics.composer3-command-buffer", + vendor_available: true, + shared_libs: [ + "android.hardware.graphics.composer3-V1-ndk", + "libbase", + "libfmq", + "libsync", + ], + static_libs: [ + "libaidlcommonsupport", + ], + export_shared_lib_headers: [ + "libfmq", + "libsync", + ], + export_include_dirs: ["include"], +} diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h new file mode 100644 index 0000000000..fdbb8b3dac --- /dev/null +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h @@ -0,0 +1,895 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include + +using aidl::android::hardware::graphics::common::ColorTransform; +using aidl::android::hardware::graphics::common::Dataspace; +using aidl::android::hardware::graphics::common::FRect; +using aidl::android::hardware::graphics::common::Rect; +using aidl::android::hardware::graphics::common::Transform; + +using aidl::android::hardware::graphics::composer3::BlendMode; +using aidl::android::hardware::graphics::composer3::ClientTargetProperty; +using aidl::android::hardware::graphics::composer3::Color; +using aidl::android::hardware::graphics::composer3::Command; +using aidl::android::hardware::graphics::composer3::Composition; +using aidl::android::hardware::graphics::composer3::FloatColor; +using aidl::android::hardware::graphics::composer3::HandleIndex; +using aidl::android::hardware::graphics::composer3::PerFrameMetadata; +using aidl::android::hardware::graphics::composer3::PerFrameMetadataBlob; + +using aidl::android::hardware::common::NativeHandle; +using aidl::android::hardware::common::fmq::SynchronizedReadWrite; +using android::AidlMessageQueue; +using CommandQueueType = AidlMessageQueue; +using aidl::android::hardware::common::fmq::MQDescriptor; +using DescriptorType = MQDescriptor; + +namespace aidl::android::hardware::graphics::composer3 { + +// This class helps build a command queue. Note that all sizes/lengths are in +// units of uint32_t's. +class CommandWriterBase { + public: + CommandWriterBase(uint32_t initialMaxSize) : mDataMaxSize(initialMaxSize) { + mData = std::make_unique(mDataMaxSize); + reset(); + } + + virtual ~CommandWriterBase() { reset(); } + + void reset() { + mDataWritten = 0; + mCommandEnd = 0; + + // handles in mDataHandles are owned by the caller + mDataHandles.clear(); + + // handles in mTemporaryHandles are owned by the writer + for (auto handle : mTemporaryHandles) { + native_handle_close(handle); + native_handle_delete(handle); + } + mTemporaryHandles.clear(); + } + + Command getCommand(uint32_t offset) { + uint32_t val = (offset < mDataWritten) ? mData[offset] : 0; + return static_cast(val & static_cast(Command::OPCODE_MASK)); + } + + bool writeQueue(bool* outQueueChanged, int32_t* outCommandLength, + std::vector* outCommandHandles) { + if (mDataWritten == 0) { + *outQueueChanged = false; + *outCommandLength = 0; + outCommandHandles->clear(); + return true; + } + + // After data are written to the queue, it may not be read by the + // remote reader when + // + // - the writer does not send them (because of other errors) + // - the hwbinder transaction fails + // - the reader does not read them (because of other errors) + // + // Discard the stale data here. + size_t staleDataSize = mQueue ? mQueue->availableToRead() : 0; + if (staleDataSize > 0) { + ALOGW("discarding stale data from message queue"); + CommandQueueType::MemTransaction tx; + if (mQueue->beginRead(staleDataSize, &tx)) { + mQueue->commitRead(staleDataSize); + } + } + + // write data to queue, optionally resizing it + if (mQueue && (mDataMaxSize <= mQueue->getQuantumCount())) { + if (!mQueue->write(mData.get(), mDataWritten)) { + ALOGE("failed to write commands to message queue"); + return false; + } + + *outQueueChanged = false; + } else { + auto newQueue = std::make_unique(mDataMaxSize); + if (!newQueue->isValid() || !newQueue->write(mData.get(), mDataWritten)) { + ALOGE("failed to prepare a new message queue "); + return false; + } + + mQueue = std::move(newQueue); + *outQueueChanged = true; + } + + *outCommandLength = mDataWritten; + *outCommandHandles = std::move(mDataHandles); + + return true; + } + + DescriptorType getMQDescriptor() const { + return (mQueue) ? mQueue->dupeDesc() : DescriptorType{}; + } + + static constexpr uint16_t kSelectDisplayLength = 2; + void selectDisplay(int64_t display) { + beginCommand(Command::SELECT_DISPLAY, kSelectDisplayLength); + write64(display); + endCommand(); + } + + static constexpr uint16_t kSelectLayerLength = 2; + void selectLayer(int64_t layer) { + beginCommand(Command::SELECT_LAYER, kSelectLayerLength); + write64(layer); + endCommand(); + } + + static constexpr uint16_t kSetErrorLength = 2; + void setError(uint32_t location, int32_t error) { + beginCommand(Command::SET_ERROR, kSetErrorLength); + write(location); + writeSigned(error); + endCommand(); + } + + static constexpr uint32_t kPresentOrValidateDisplayResultLength = 1; + void setPresentOrValidateResult(uint32_t state) { + beginCommand(Command::SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT, + kPresentOrValidateDisplayResultLength); + write(state); + endCommand(); + } + + void setChangedCompositionTypes(const std::vector& layers, + const std::vector& types) { + size_t totalLayers = std::min(layers.size(), types.size()); + size_t currentLayer = 0; + + while (currentLayer < totalLayers) { + size_t count = + std::min(totalLayers - currentLayer, static_cast(kMaxLength) / 3); + + beginCommand(Command::SET_CHANGED_COMPOSITION_TYPES, count * 3); + for (size_t i = 0; i < count; i++) { + write64(layers[currentLayer + i]); + writeSigned(static_cast(types[currentLayer + i])); + } + endCommand(); + + currentLayer += count; + } + } + + void setDisplayRequests(uint32_t displayRequestMask, const std::vector& layers, + const std::vector& layerRequestMasks) { + size_t totalLayers = std::min(layers.size(), layerRequestMasks.size()); + size_t currentLayer = 0; + + while (currentLayer < totalLayers) { + size_t count = + std::min(totalLayers - currentLayer, static_cast(kMaxLength - 1) / 3); + + beginCommand(Command::SET_DISPLAY_REQUESTS, 1 + count * 3); + write(displayRequestMask); + for (size_t i = 0; i < count; i++) { + write64(layers[currentLayer + i]); + write(static_cast(layerRequestMasks[currentLayer + i])); + } + endCommand(); + + currentLayer += count; + } + } + + static constexpr uint16_t kSetPresentFenceLength = 1; + void setPresentFence(int presentFence) { + beginCommand(Command::SET_PRESENT_FENCE, kSetPresentFenceLength); + writeFence(presentFence); + endCommand(); + } + + void setReleaseFences(const std::vector& layers, + const std::vector& releaseFences) { + size_t totalLayers = std::min(layers.size(), releaseFences.size()); + size_t currentLayer = 0; + + while (currentLayer < totalLayers) { + size_t count = + std::min(totalLayers - currentLayer, static_cast(kMaxLength) / 3); + + beginCommand(Command::SET_RELEASE_FENCES, count * 3); + for (size_t i = 0; i < count; i++) { + write64(layers[currentLayer + i]); + writeFence(releaseFences[currentLayer + i]); + } + endCommand(); + + currentLayer += count; + } + } + + static constexpr uint16_t kSetColorTransformLength = 17; + void setColorTransform(const float* matrix, ColorTransform hint) { + beginCommand(Command::SET_COLOR_TRANSFORM, kSetColorTransformLength); + for (int i = 0; i < 16; i++) { + writeFloat(matrix[i]); + } + writeSigned(static_cast(hint)); + endCommand(); + } + + void setClientTarget(uint32_t slot, const native_handle_t* target, int acquireFence, + Dataspace dataspace, const std::vector& damage) { + setClientTargetInternal(slot, target, acquireFence, static_cast(dataspace), + damage); + } + + static constexpr uint16_t kSetOutputBufferLength = 3; + void setOutputBuffer(uint32_t slot, const native_handle_t* buffer, int releaseFence) { + beginCommand(Command::SET_OUTPUT_BUFFER, kSetOutputBufferLength); + write(slot); + writeHandle(buffer, true); + writeFence(releaseFence); + endCommand(); + } + + static constexpr uint16_t kValidateDisplayLength = 0; + void validateDisplay() { + beginCommand(Command::VALIDATE_DISPLAY, kValidateDisplayLength); + endCommand(); + } + + static constexpr uint16_t kPresentOrValidateDisplayLength = 0; + void presentOrvalidateDisplay() { + beginCommand(Command::PRESENT_OR_VALIDATE_DISPLAY, kPresentOrValidateDisplayLength); + endCommand(); + } + + static constexpr uint16_t kAcceptDisplayChangesLength = 0; + void acceptDisplayChanges() { + beginCommand(Command::ACCEPT_DISPLAY_CHANGES, kAcceptDisplayChangesLength); + endCommand(); + } + + static constexpr uint16_t kPresentDisplayLength = 0; + void presentDisplay() { + beginCommand(Command::PRESENT_DISPLAY, kPresentDisplayLength); + endCommand(); + } + + static constexpr uint16_t kSetLayerCursorPositionLength = 2; + void setLayerCursorPosition(int32_t x, int32_t y) { + beginCommand(Command::SET_LAYER_CURSOR_POSITION, kSetLayerCursorPositionLength); + writeSigned(x); + writeSigned(y); + endCommand(); + } + + static constexpr uint16_t kSetLayerBufferLength = 3; + void setLayerBuffer(uint32_t slot, const native_handle_t* buffer, int acquireFence) { + beginCommand(Command::SET_LAYER_BUFFER, kSetLayerBufferLength); + write(slot); + writeHandle(buffer, true); + writeFence(acquireFence); + endCommand(); + } + + void setLayerSurfaceDamage(const std::vector& damage) { + bool doWrite = (damage.size() <= kMaxLength / 4); + size_t length = (doWrite) ? damage.size() * 4 : 0; + + beginCommand(Command::SET_LAYER_SURFACE_DAMAGE, length); + // When there are too many rectangles in the damage region and doWrite + // is false, we write no rectangle at all which means the entire + // layer is damaged. + if (doWrite) { + writeRegion(damage); + } + endCommand(); + } + + static constexpr uint16_t kSetLayerBlendModeLength = 1; + void setLayerBlendMode(BlendMode mode) { + beginCommand(Command::SET_LAYER_BLEND_MODE, kSetLayerBlendModeLength); + writeSigned(static_cast(mode)); + endCommand(); + } + + static constexpr uint16_t kSetLayerColorLength = 1; + void setLayerColor(Color color) { + beginCommand(Command::SET_LAYER_COLOR, kSetLayerColorLength); + writeColor(color); + endCommand(); + } + + static constexpr uint16_t kSetLayerCompositionTypeLength = 1; + void setLayerCompositionType(Composition type) { + beginCommand(Command::SET_LAYER_COMPOSITION_TYPE, kSetLayerCompositionTypeLength); + writeSigned(static_cast(type)); + endCommand(); + } + + static constexpr uint16_t kSetLayerDataspaceLength = 1; + void setLayerDataspace(Dataspace dataspace) { + setLayerDataspaceInternal(static_cast(dataspace)); + } + + static constexpr uint16_t kSetLayerDisplayFrameLength = 4; + void setLayerDisplayFrame(const Rect& frame) { + beginCommand(Command::SET_LAYER_DISPLAY_FRAME, kSetLayerDisplayFrameLength); + writeRect(frame); + endCommand(); + } + + static constexpr uint16_t kSetLayerPlaneAlphaLength = 1; + void setLayerPlaneAlpha(float alpha) { + beginCommand(Command::SET_LAYER_PLANE_ALPHA, kSetLayerPlaneAlphaLength); + writeFloat(alpha); + endCommand(); + } + + static constexpr uint16_t kSetLayerSidebandStreamLength = 1; + void setLayerSidebandStream(const native_handle_t* stream) { + beginCommand(Command::SET_LAYER_SIDEBAND_STREAM, kSetLayerSidebandStreamLength); + writeHandle(stream); + endCommand(); + } + + static constexpr uint16_t kSetLayerSourceCropLength = 4; + void setLayerSourceCrop(const FRect& crop) { + beginCommand(Command::SET_LAYER_SOURCE_CROP, kSetLayerSourceCropLength); + writeFRect(crop); + endCommand(); + } + + static constexpr uint16_t kSetLayerTransformLength = 1; + void setLayerTransform(Transform transform) { + beginCommand(Command::SET_LAYER_TRANSFORM, kSetLayerTransformLength); + writeSigned(static_cast(transform)); + endCommand(); + } + + void setLayerVisibleRegion(const std::vector& visible) { + bool doWrite = (visible.size() <= kMaxLength / 4); + size_t length = (doWrite) ? visible.size() * 4 : 0; + + beginCommand(Command::SET_LAYER_VISIBLE_REGION, length); + // When there are too many rectangles in the visible region and + // doWrite is false, we write no rectangle at all which means the + // entire layer is visible. + if (doWrite) { + writeRegion(visible); + } + endCommand(); + } + + static constexpr uint16_t kSetLayerZOrderLength = 1; + void setLayerZOrder(uint32_t z) { + beginCommand(Command::SET_LAYER_Z_ORDER, kSetLayerZOrderLength); + write(z); + endCommand(); + } + + void setLayerPerFrameMetadata(const std::vector& metadataVec) { + beginCommand(Command::SET_LAYER_PER_FRAME_METADATA, metadataVec.size() * 2); + for (const auto& metadata : metadataVec) { + writeSigned(static_cast(metadata.key)); + writeFloat(metadata.value); + } + endCommand(); + } + + static constexpr uint16_t kSetLayerColorTransformLength = 16; + void setLayerColorTransform(const float* matrix) { + beginCommand(Command::SET_LAYER_COLOR_TRANSFORM, kSetLayerColorTransformLength); + for (int i = 0; i < 16; i++) { + writeFloat(matrix[i]); + } + endCommand(); + } + + void setLayerPerFrameMetadataBlobs(const std::vector& metadata) { + // in units of uint32_t's + size_t commandLength = 0; + + if (metadata.size() > std::numeric_limits::max()) { + LOG_FATAL("too many metadata blobs - dynamic metadata size is too large"); + return; + } + + // space for numElements + commandLength += 1; + + for (auto metadataBlob : metadata) { + commandLength += 1; // key of metadata blob + commandLength += 1; // size information of metadata blob + + // metadata content size + size_t metadataSize = metadataBlob.blob.size() / sizeof(uint32_t); + commandLength += metadataSize; + commandLength += + (metadataBlob.blob.size() - (metadataSize * sizeof(uint32_t)) > 0) ? 1 : 0; + } + + if (commandLength > std::numeric_limits::max()) { + LOG_FATAL("dynamic metadata size is too large"); + return; + } + + // Blobs are written as: + // {numElements, key1, size1, blob1, key2, size2, blob2, key3, size3...} + uint16_t length = static_cast(commandLength); + beginCommand(Command::SET_LAYER_PER_FRAME_METADATA_BLOBS, length); + write(static_cast(metadata.size())); + for (auto metadataBlob : metadata) { + writeSigned(static_cast(metadataBlob.key)); + write(static_cast(metadataBlob.blob.size())); + writeBlob(static_cast(metadataBlob.blob.size()), metadataBlob.blob.data()); + } + endCommand(); + } + + static constexpr uint16_t kSetLayerFloatColorLength = 4; + void setLayerFloatColor(FloatColor color) { + beginCommand(Command::SET_LAYER_FLOAT_COLOR, kSetLayerFloatColorLength); + writeFloatColor(color); + endCommand(); + } + + static constexpr uint16_t kSetClientTargetPropertyLength = 2; + void setClientTargetProperty(const ClientTargetProperty& clientTargetProperty) { + beginCommand(Command::SET_CLIENT_TARGET_PROPERTY, kSetClientTargetPropertyLength); + writeSigned(static_cast(clientTargetProperty.pixelFormat)); + writeSigned(static_cast(clientTargetProperty.dataspace)); + endCommand(); + } + + void setLayerGenericMetadata(const std::string& key, const bool mandatory, + const std::vector& value) { + const size_t commandSize = 3 + sizeToElements(key.size()) + sizeToElements(value.size()); + if (commandSize > std::numeric_limits::max()) { + LOG_FATAL("Too much generic metadata (%zu elements)", commandSize); + return; + } + + beginCommand(Command::SET_LAYER_GENERIC_METADATA, static_cast(commandSize)); + write(key.size()); + writeBlob(key.size(), reinterpret_cast(key.c_str())); + write(mandatory); + write(value.size()); + writeBlob(value.size(), value.data()); + endCommand(); + } + + protected: + template + void beginCommand(T command, uint16_t length) { + beginCommandBase(static_cast(command), length); + } + + void setClientTargetInternal(uint32_t slot, const native_handle_t* target, int acquireFence, + int32_t dataspace, const std::vector& damage) { + bool doWrite = (damage.size() <= (kMaxLength - 4) / 4); + size_t length = 4 + ((doWrite) ? damage.size() * 4 : 0); + + beginCommand(Command::SET_CLIENT_TARGET, length); + write(slot); + writeHandle(target, true); + writeFence(acquireFence); + writeSigned(dataspace); + // When there are too many rectangles in the damage region and doWrite + // is false, we write no rectangle at all which means the entire + // client target is damaged. + if (doWrite) { + writeRegion(damage); + } + endCommand(); + } + + void setLayerDataspaceInternal(int32_t dataspace) { + beginCommand(Command::SET_LAYER_DATASPACE, kSetLayerDataspaceLength); + writeSigned(dataspace); + endCommand(); + } + + void beginCommandBase(Command command, uint16_t length) { + if (mCommandEnd) { + LOG_FATAL("endCommand was not called before command 0x%x", command); + } + + growData(1 + length); + write(static_cast(command) | length); + + mCommandEnd = mDataWritten + length; + } + + void endCommand() { + if (!mCommandEnd) { + LOG_FATAL("beginCommand was not called"); + } else if (mDataWritten > mCommandEnd) { + LOG_FATAL("too much data written"); + mDataWritten = mCommandEnd; + } else if (mDataWritten < mCommandEnd) { + LOG_FATAL("too little data written"); + while (mDataWritten < mCommandEnd) { + write(0); + } + } + + mCommandEnd = 0; + } + + void write(uint32_t val) { mData[mDataWritten++] = val; } + + void writeSigned(int32_t val) { memcpy(&mData[mDataWritten++], &val, sizeof(val)); } + + void writeFloat(float val) { memcpy(&mData[mDataWritten++], &val, sizeof(val)); } + + void write64(uint64_t val) { + uint32_t lo = static_cast(val & 0xffffffff); + uint32_t hi = static_cast(val >> 32); + write(lo); + write(hi); + } + + void writeRect(const Rect& rect) { + writeSigned(rect.left); + writeSigned(rect.top); + writeSigned(rect.right); + writeSigned(rect.bottom); + } + + void writeRegion(const std::vector& region) { + for (const auto& rect : region) { + writeRect(rect); + } + } + + void writeFRect(const FRect& rect) { + writeFloat(rect.left); + writeFloat(rect.top); + writeFloat(rect.right); + writeFloat(rect.bottom); + } + + void writeColor(const Color& color) { + write((color.r << 0) | (color.g << 8) | (color.b << 16) | (color.a << 24)); + } + + void writeFloatColor(const FloatColor& color) { + writeFloat(color.r); + writeFloat(color.g); + writeFloat(color.b); + writeFloat(color.a); + } + + void writeBlob(uint32_t length, const unsigned char* blob) { + memcpy(&mData[mDataWritten], blob, length); + uint32_t numElements = length / 4; + mDataWritten += numElements; + mDataWritten += (length - (numElements * 4) > 0) ? 1 : 0; + } + + // ownership of handle is not transferred + void writeHandle(const native_handle_t* handle, bool useCache) { + if (!handle) { + writeSigned( + static_cast((useCache) ? HandleIndex::CACHED : HandleIndex::EMPTY)); + return; + } + + mDataHandles.push_back(::android::makeToAidl(handle)); + writeSigned(mDataHandles.size() - 1); + } + + void writeHandle(const native_handle_t* handle) { writeHandle(handle, false); } + + // ownership of fence is transferred + void writeFence(int fence) { + native_handle_t* handle = nullptr; + if (fence >= 0) { + handle = getTemporaryHandle(1, 0); + if (handle) { + handle->data[0] = fence; + } else { + ALOGW("failed to get temporary handle for fence %d", fence); + sync_wait(fence, -1); + close(fence); + } + } + + writeHandle(handle); + } + + native_handle_t* getTemporaryHandle(int numFds, int numInts) { + native_handle_t* handle = native_handle_create(numFds, numInts); + if (handle) { + mTemporaryHandles.push_back(handle); + } + return handle; + } + + static constexpr uint16_t kMaxLength = std::numeric_limits::max(); + + std::unique_ptr mData; + uint32_t mDataWritten; + + private: + void growData(uint32_t grow) { + uint32_t newWritten = mDataWritten + grow; + if (newWritten < mDataWritten) { + LOG_ALWAYS_FATAL("buffer overflowed; data written %" PRIu32 ", growing by %" PRIu32, + mDataWritten, grow); + } + + if (newWritten <= mDataMaxSize) { + return; + } + + uint32_t newMaxSize = mDataMaxSize << 1; + if (newMaxSize < newWritten) { + newMaxSize = newWritten; + } + + auto newData = std::make_unique(newMaxSize); + std::copy_n(mData.get(), mDataWritten, newData.get()); + mDataMaxSize = newMaxSize; + mData = std::move(newData); + } + + uint32_t sizeToElements(uint32_t size) { return (size + 3) / 4; } + + uint32_t mDataMaxSize; + // end offset of the current command + uint32_t mCommandEnd; + + std::vector mDataHandles; + std::vector mTemporaryHandles; + + std::unique_ptr mQueue; +}; + +// This class helps parse a command queue. Note that all sizes/lengths are in +// units of uint32_t's. +class CommandReaderBase { + public: + CommandReaderBase() : mDataMaxSize(0) { reset(); } + + bool setMQDescriptor(const DescriptorType& descriptor) { + mQueue = std::make_unique(descriptor, false); + if (mQueue->isValid()) { + return true; + } else { + mQueue = nullptr; + return false; + } + } + + bool readQueue(int32_t commandLength, std::vector commandHandles) { + if (!mQueue) { + return false; + } + + auto quantumCount = mQueue->getQuantumCount(); + if (mDataMaxSize < quantumCount) { + mDataMaxSize = quantumCount; + mData = std::make_unique(mDataMaxSize); + } + + if (commandLength > mDataMaxSize || !mQueue->read(mData.get(), commandLength)) { + ALOGE("failed to read commands from message queue"); + return false; + } + + mDataSize = commandLength; + mDataRead = 0; + mCommandBegin = 0; + mCommandEnd = 0; + mDataHandles = std::move(commandHandles); + return true; + } + + void reset() { + mDataSize = 0; + mDataRead = 0; + mCommandBegin = 0; + mCommandEnd = 0; + mDataHandles.clear(); + } + + protected: + template + bool beginCommand(T* outCommand, uint16_t* outLength) { + return beginCommandBase(reinterpret_cast(outCommand), outLength); + } + + bool isEmpty() const { return (mDataRead >= mDataSize); } + + bool beginCommandBase(Command* outCommand, uint16_t* outLength) { + if (mCommandEnd) { + LOG_FATAL("endCommand was not called for last command"); + } + + constexpr uint32_t opcode_mask = static_cast(Command::OPCODE_MASK); + constexpr uint32_t length_mask = static_cast(Command::LENGTH_MASK); + + uint32_t val = read(); + *outCommand = static_cast(val & opcode_mask); + *outLength = static_cast(val & length_mask); + + if (mDataRead + *outLength > mDataSize) { + ALOGE("command 0x%x has invalid command length %" PRIu16, *outCommand, *outLength); + // undo the read() above + mDataRead--; + return false; + } + + mCommandEnd = mDataRead + *outLength; + + return true; + } + + void endCommand() { + if (!mCommandEnd) { + LOG_FATAL("beginCommand was not called"); + } else if (mDataRead > mCommandEnd) { + LOG_FATAL("too much data read"); + mDataRead = mCommandEnd; + } else if (mDataRead < mCommandEnd) { + LOG_FATAL("too little data read"); + mDataRead = mCommandEnd; + } + + mCommandBegin = mCommandEnd; + mCommandEnd = 0; + } + + uint32_t getCommandLoc() const { return mCommandBegin; } + + uint32_t read() { return mData[mDataRead++]; } + + int32_t readSigned() { + int32_t val; + memcpy(&val, &mData[mDataRead++], sizeof(val)); + return val; + } + + float readFloat() { + float val; + memcpy(&val, &mData[mDataRead++], sizeof(val)); + return val; + } + + uint64_t read64() { + uint32_t lo = read(); + uint32_t hi = read(); + return (static_cast(hi) << 32) | lo; + } + + Color readColor() { + uint32_t val = read(); + return Color{ + static_cast((val >> 0) & 0xff), + static_cast((val >> 8) & 0xff), + static_cast((val >> 16) & 0xff), + static_cast((val >> 24) & 0xff), + }; + } + + // ownership of handle is not transferred + const native_handle_t* readHandle(bool* outUseCache) { + const native_handle_t* handle = nullptr; + + int32_t index = readSigned(); + switch (index) { + case static_cast(HandleIndex::EMPTY): + *outUseCache = false; + break; + case static_cast(HandleIndex::CACHED): + *outUseCache = true; + break; + default: + if (static_cast(index) < mDataHandles.size()) { + handle = ::android::makeFromAidl(mDataHandles[index]); + } else { + ALOGE("invalid handle index %zu", static_cast(index)); + } + *outUseCache = false; + break; + } + + return handle; + } + + const native_handle_t* readHandle() { + bool useCache; + return readHandle(&useCache); + } + + // ownership of fence is transferred + int readFence() { + auto handle = readHandle(); + if (!handle || handle->numFds == 0) { + return -1; + } + + if (handle->numFds != 1) { + ALOGE("invalid fence handle with %d fds", handle->numFds); + return -1; + } + + int fd = dup(handle->data[0]); + if (fd < 0) { + ALOGW("failed to dup fence %d", handle->data[0]); + sync_wait(handle->data[0], -1); + fd = -1; + } + + return fd; + } + + std::unique_ptr mData; + uint32_t mDataRead; + + private: + std::unique_ptr mQueue; + uint32_t mDataMaxSize; + + uint32_t mDataSize; + + // begin/end offsets of the current command + uint32_t mCommandBegin; + uint32_t mCommandEnd; + + std::vector mDataHandles; +}; + +} // namespace aidl::android::hardware::graphics::composer3 -- GitLab From 832258e9315bfd50ec560b38c6381fbc180f4c28 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Thu, 14 Oct 2021 16:44:58 -0700 Subject: [PATCH 192/825] composer: remove getClientTargetSupport getClientTargetSupport is not used anyware Bug: 203093280 Test: build Change-Id: I8b48188d34c1b0c3eed02e1e5d94ff5be3413ae2 --- .../graphics/composer3/IComposerClient.aidl | 1 - .../graphics/composer3/IComposerClient.aidl | 19 ------------------- 2 files changed, 20 deletions(-) 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 8824f5a80f..5c37018910 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 @@ -40,7 +40,6 @@ interface IComposerClient { void destroyVirtualDisplay(long display); android.hardware.graphics.composer3.ExecuteCommandsStatus executeCommands(int inLength, in android.hardware.common.NativeHandle[] inHandles); int getActiveConfig(long display); - void getClientTargetSupport(long display, int width, int height, in android.hardware.graphics.composer3.ClientTargetProperty clientTargetProperty); android.hardware.graphics.composer3.ColorMode[] getColorModes(long display); float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); int getDisplayAttribute(long display, int config, android.hardware.graphics.composer3.DisplayAttribute attribute); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 20a6ffc934..2a9545dfdd 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -188,25 +188,6 @@ interface IComposerClient { */ int getActiveConfig(long display); - /** - * Returns whether a client target with the given properties can be - * handled by the device. - * - * This function must return true for a client target with width and - * height equal to the active display configuration dimensions, - * PixelFormat::RGBA_8888, and Dataspace::UNKNOWN. It is not required to - * return true for any other configuration. - * - * @param display is the display to query. - * @param width is the client target width in pixels. - * @param height is the client target height in pixels. - * @param clientTargetProperty is the client target format and dataspace. - * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. - * @exception EX_UNSUPPORTED when the given configuration is not supported. - */ - void getClientTargetSupport( - long display, int width, int height, in ClientTargetProperty clientTargetProperty); - /** * Returns the color modes supported on this display. * -- GitLab From 4e001df750535757fc782d058e4ad7f46821eb04 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Fri, 15 Oct 2021 12:26:48 -0700 Subject: [PATCH 193/825] composer: add SKIP_VALIDATE to AIDL HWC2_CAPABILITY_SKIP_VALIDATE was never defined for HIDL, and instead there was a hack to just pass the value to the client (see commit 6a05e9113ab93976fa1e7af9f41aa0af7832b56e). Test: build Bug: 198690211 Change-Id: I2b06ad792237eb99e4dfe6b5c1ef808d5de45bd7 --- .../hardware/graphics/composer3/Capability.aidl | 1 + .../hardware/graphics/composer3/Capability.aidl | 11 +++++++++++ .../hardware/graphics/composer3/translate-ndk.cpp | 3 +++ 3 files changed, 15 insertions(+) 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 557b3f8b77..9c49583fd2 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 @@ -38,4 +38,5 @@ enum Capability { SIDEBAND_STREAM = 1, SKIP_CLIENT_COLOR_TRANSFORM = 2, PRESENT_FENCE_IS_NOT_RELIABLE = 3, + SKIP_VALIDATE = 4, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl index 028b6f58d4..ea619aeaf3 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl @@ -46,4 +46,15 @@ enum Capability { * representation of the actual present time of a frame. */ PRESENT_FENCE_IS_NOT_RELIABLE = 3, + /** + * Specifies that a device is able to skip the validateDisplay call before + * receiving a call to presentDisplay. The client will always skip + * validateDisplay and try to call presentDisplay regardless of the changes + * in the properties of the layers. If the device returns anything else than + * no error, it will call validateDisplay then presentDisplay again. + * For this capability to be worthwhile the device implementation of + * presentDisplay should fail as fast as possible in the case a + * validateDisplay step is needed. + */ + SKIP_VALIDATE = 4, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp index a593e906b8..d59190d811 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp @@ -70,6 +70,9 @@ static_assert( static_cast( ::android::hardware::graphics::composer::V2_1::IComposer::Capability:: PRESENT_FENCE_IS_NOT_RELIABLE)); +// HWC2_CAPABILITY_SKIP_VALIDATE was never defined for HIDL, so we just hardcode its value +static_assert(aidl::android::hardware::graphics::composer3::Capability::SKIP_VALIDATE == + static_cast(4)); static_assert(aidl::android::hardware::graphics::composer3::LayerRequest::CLEAR_CLIENT_TARGET == static_cast( -- GitLab From 7f2822aff735e3c4f727de0759f867791db129ed Mon Sep 17 00:00:00 2001 From: Sunil Ravi Date: Fri, 15 Oct 2021 16:55:53 -0700 Subject: [PATCH 194/825] Update the p2p device interface name In some implementations P2P device interface is created under primary interface(wlan0 by default). In those implementations p2p device name is predefined in system property wifi.direct.interface. And the interface is created by supplicant with primary interface as the parent interface. The naming of p2p device interface is p2p-dev- ("p2p-dev-wlan0"). With STA+STA feature, wlan0 interface gets deleted in certain scenarios and wlan1 becomes the active interface. In such scenarios P2P fails to create the interface as parent interface wlan0 is deleted. To fix the issue update the p2p device interface from system property based on the current active wlan interface. ie First get the p2p parent interface name from p2p device interface name set in property. Check if the parent interface derived from p2p device interface name is the current active interface. If not, get the current active interface and update the name as p2p-dev- ("p2p-dev-wlan1"). This helps HIDL/supplicant to get an active wlan interface from p2p device interface name and succeed in creating the p2p interface under the active interface. Bug: 203434193 Bug: 200810773 Test: Manual - Tested STA+STA which ended up deleting wlan0 interface. Then ran p2p tests and confirmed that p2p scan and connection works. Change-Id: I522cec02a662c057e21d434f3ed98c7e7a4ca8f0 --- wifi/1.5/default/wifi_chip.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/wifi/1.5/default/wifi_chip.cpp b/wifi/1.5/default/wifi_chip.cpp index 82d794ca16..6bdff42149 100644 --- a/wifi/1.5/default/wifi_chip.cpp +++ b/wifi/1.5/default/wifi_chip.cpp @@ -28,6 +28,8 @@ #include "wifi_chip.h" #include "wifi_status_util.h" +#define P2P_MGMT_DEVICE_PREFIX "p2p-dev-" + namespace { using android::sp; using android::base::unique_fd; @@ -126,8 +128,37 @@ std::vector getPredefinedApIfaceNames(bool is_bridged) { } std::string getPredefinedP2pIfaceName() { + std::array primaryIfaceName; + char p2pParentIfname[100]; + std::string p2pDevIfName = ""; std::array buffer; property_get("wifi.direct.interface", buffer.data(), "p2p0"); + if (strncmp(buffer.data(), P2P_MGMT_DEVICE_PREFIX, + strlen(P2P_MGMT_DEVICE_PREFIX)) == 0) { + /* Get the p2p parent interface name from p2p device interface name set + * in property */ + strncpy(p2pParentIfname, buffer.data() + strlen(P2P_MGMT_DEVICE_PREFIX), + strlen(buffer.data()) - strlen(P2P_MGMT_DEVICE_PREFIX)); + if (property_get(kActiveWlanIfaceNameProperty, primaryIfaceName.data(), + nullptr) == 0) { + return buffer.data(); + } + /* Check if the parent interface derived from p2p device interface name + * is active */ + if (strncmp(p2pParentIfname, primaryIfaceName.data(), + strlen(buffer.data()) - strlen(P2P_MGMT_DEVICE_PREFIX)) != + 0) { + /* + * Update the predefined p2p device interface parent interface name + * with current active wlan interface + */ + p2pDevIfName += P2P_MGMT_DEVICE_PREFIX; + p2pDevIfName += primaryIfaceName.data(); + LOG(INFO) << "update the p2p device interface name to " + << p2pDevIfName.c_str(); + return p2pDevIfName; + } + } return buffer.data(); } -- GitLab From 282fb370ab0ebe4c96ff02bc39fc8165f2e3a9a8 Mon Sep 17 00:00:00 2001 From: Gareth Fenn Date: Mon, 27 Sep 2021 15:14:11 +0100 Subject: [PATCH 195/825] TunerHAL fixes TunerHAL expects Hz Fix stopRecordThread race Push segment000000.ts to device getFrontendIdByType() should return INVALID_ID when no FE found Bug: 201556155 Test: VtsHalTvTunerV1_{0,1}TargetTest on BCM device Change-Id: Idab6817e47f3e10f07a36a8b2fd805336b9f0e5d Signed-off-by: Pierre Couillaud --- tv/tuner/1.0/default/Frontend.cpp | 2 +- tv/tuner/1.0/default/Tuner.cpp | 4 ++-- tv/tuner/1.0/vts/functional/FrontendTests.cpp | 3 +-- .../1.0/vts/functional/VtsHalTvTunerV1_0TestConfigurations.h | 2 +- tv/tuner/1.1/default/Frontend.cpp | 2 +- tv/tuner/1.1/default/Tuner.cpp | 4 ++-- tv/tuner/1.1/vts/functional/AndroidTest.xml | 1 + tv/tuner/1.1/vts/functional/DvrTests.cpp | 1 + tv/tuner/1.1/vts/functional/FrontendTests.cpp | 3 +-- .../1.1/vts/functional/VtsHalTvTunerV1_1TestConfigurations.h | 2 +- tv/tuner/aidl/default/Frontend.cpp | 2 +- tv/tuner/aidl/default/Tuner.cpp | 4 ++-- tv/tuner/aidl/vts/functional/AndroidTest.xml | 1 + tv/tuner/aidl/vts/functional/FrontendTests.cpp | 3 +-- .../aidl/vts/functional/VtsHalTvTunerTestConfigurations.h | 2 +- tv/tuner/config/sample_tuner_vts_config_1_0.xml | 4 ++-- tv/tuner/config/sample_tuner_vts_config_1_1.xml | 4 ++-- 17 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tv/tuner/1.0/default/Frontend.cpp b/tv/tuner/1.0/default/Frontend.cpp index 6561c92caf..6e82b8b978 100644 --- a/tv/tuner/1.0/default/Frontend.cpp +++ b/tv/tuner/1.0/default/Frontend.cpp @@ -104,7 +104,7 @@ Return Frontend::scan(const FrontendSettings& settings, FrontendScanType uint32_t frequency = settings.dvbt().frequency; if (type == FrontendScanType::SCAN_BLIND) { - frequency += 100; + frequency += 100 * 1000; } msg.frequencies({frequency}); mCallback->onScanMessage(FrontendScanMessageType::FREQUENCY, msg); diff --git a/tv/tuner/1.0/default/Tuner.cpp b/tv/tuner/1.0/default/Tuner.cpp index c4f610ee23..2157bdfbd3 100644 --- a/tv/tuner/1.0/default/Tuner.cpp +++ b/tv/tuner/1.0/default/Tuner.cpp @@ -175,8 +175,8 @@ Return Tuner::getFrontendInfo(FrontendId frontendId, getFrontendInfo_cb _h // assign randomly selected values for testing. info = { .type = mFrontends[frontendId]->getFrontendType(), - .minFrequency = 139, - .maxFrequency = 1139, + .minFrequency = 139000000, + .maxFrequency = 1139000000, .minSymbolRate = 45, .maxSymbolRate = 1145, .acquireRange = 30, diff --git a/tv/tuner/1.0/vts/functional/FrontendTests.cpp b/tv/tuner/1.0/vts/functional/FrontendTests.cpp index 62ac6f7716..ba66595254 100644 --- a/tv/tuner/1.0/vts/functional/FrontendTests.cpp +++ b/tv/tuner/1.0/vts/functional/FrontendTests.cpp @@ -85,7 +85,7 @@ void FrontendCallback::scanTest(sp& frontend, FrontendConfig config, // passed in means the real input config on the transponder connected to the DUT. // We want the blind the test to start from lower frequency than this to check the blind // scan implementation. - resetBlindScanStartingFrequency(config, targetFrequency - 100); + resetBlindScanStartingFrequency(config, targetFrequency - 100 * 1000); } Result result = frontend->scan(config.settings, type); @@ -415,7 +415,6 @@ AssertionResult FrontendTests::closeFrontend() { void FrontendTests::getFrontendIdByType(FrontendType feType, uint32_t& feId) { ASSERT_TRUE(getFrontendIds()); - ASSERT_TRUE(mFeIds.size() > 0); for (size_t i = 0; i < mFeIds.size(); i++) { ASSERT_TRUE(getFrontendInfo(mFeIds[i])); if (mFrontendInfo.type != feType) { diff --git a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TestConfigurations.h b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TestConfigurations.h index 2cea181268..008879d3bd 100644 --- a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TestConfigurations.h +++ b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TestConfigurations.h @@ -68,7 +68,7 @@ inline void initFrontendConfig() { // without overriding in the xml config. string defaultFeId = "FE_DEFAULT"; FrontendDvbtSettings dvbtSettings{ - .frequency = 578000, + .frequency = 578000000, .transmissionMode = FrontendDvbtTransmissionMode::AUTO, .bandwidth = FrontendDvbtBandwidth::BANDWIDTH_8MHZ, .isHighPriority = true, diff --git a/tv/tuner/1.1/default/Frontend.cpp b/tv/tuner/1.1/default/Frontend.cpp index e3fbdadc3f..f5463a9fe1 100644 --- a/tv/tuner/1.1/default/Frontend.cpp +++ b/tv/tuner/1.1/default/Frontend.cpp @@ -128,7 +128,7 @@ Return Frontend::scan(const FrontendSettings& settings, FrontendScanType } if (type == FrontendScanType::SCAN_BLIND) { - frequency += 100; + frequency += 100 * 1000; } msg.frequencies({frequency}); diff --git a/tv/tuner/1.1/default/Tuner.cpp b/tv/tuner/1.1/default/Tuner.cpp index 1e940ba098..6d94fbd4b0 100644 --- a/tv/tuner/1.1/default/Tuner.cpp +++ b/tv/tuner/1.1/default/Tuner.cpp @@ -264,8 +264,8 @@ Return Tuner::getFrontendInfo(FrontendId frontendId, getFrontendInfo_cb _h // assign randomly selected values for testing. info = { .type = mFrontends[frontendId]->getFrontendType(), - .minFrequency = 139, - .maxFrequency = 1139, + .minFrequency = 139000000, + .maxFrequency = 1139000000, .minSymbolRate = 45, .maxSymbolRate = 1145, .acquireRange = 30, diff --git a/tv/tuner/1.1/vts/functional/AndroidTest.xml b/tv/tuner/1.1/vts/functional/AndroidTest.xml index 3e6878ce39..848cfc0957 100644 --- a/tv/tuner/1.1/vts/functional/AndroidTest.xml +++ b/tv/tuner/1.1/vts/functional/AndroidTest.xml @@ -24,6 +24,7 @@ android.hardware.neuralnetworks - 1-2 + 1-3 IDevice .* diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl index 2eff11b146..34506c8860 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl @@ -138,4 +138,6 @@ enum OperationType { RANK = 101, BATCH_MATMUL = 102, PACK = 103, + MIRROR_PAD = 104, + REVERSE = 105, } diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl index 2ec91acf30..aebe8d9c93 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl @@ -4318,6 +4318,8 @@ enum OperationType { * Supported tensor {@link OperandType}: * * {@link OperandType::TENSOR_FLOAT16} * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} (since NNAPI feature level 7) + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since NNAPI feature level 7) * * Supported tensor rank: from 1. * @@ -4326,6 +4328,9 @@ enum OperationType { * * Outputs: * * 0: The output tensor of same shape as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint can be different from inputs' scale and zeroPoint. */ RSQRT = 83, @@ -5322,4 +5327,68 @@ enum OperationType { * * 0: The packed tensor. */ PACK = 103, + + /** + * Pads a tensor with mirrored values. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * * {@link OperandType::TENSOR_INT32} + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: An n-D tensor, specifying the tensor to be padded. + * * 1: A 2-D tensor of {@link OperandType::TENSOR_INT32}, the paddings + * for each spatial dimension of the input tensor. The shape of the + * tensor must be {rank(input0), 2}. + * padding[i, 0] specifies the number of elements to be padded in the + * front of dimension i. + * padding[i, 1] specifies the number of elements to be padded after the + * end of dimension i. + * * 2: An {@link OperandType::INT32} scalar, specifying the mode. + * Options are 0:REFLECT and 1:SYMMETRIC. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. The + * output tensor has the same rank as input0, and each + * dimension of the output tensor has the same size as the + * corresponding dimension of the input tensor plus the size + * of the padding: + * output0.dimension[i] = + * padding[i, 0] + input0.dimension[i] + padding[i, 1] + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + MIRROR_PAD = 104, + + /** + * Reverses a specified dimension of a tensor. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * * {@link OperandType::TENSOR_INT32} + * + * Supported tensor rank: up to 8. + * + * Inputs: + * * 0: Input tensor of rank n. + * * 1: Axis tensor of type {@link OperandType::TENSOR_INT32} and shape [1], + * specifying which dimension of the input tensor is to be reversed. The dimension + * must be in the range [0, n). + * + * Outputs: + * * 0: The reversed tensor. + * For {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensors, + * the scales and zeroPoint must be the same as input0. + */ + REVERSE = 105, } diff --git a/neuralnetworks/aidl/utils/Android.bp b/neuralnetworks/aidl/utils/Android.bp index 1a4cd9ad3b..e3561042be 100644 --- a/neuralnetworks/aidl/utils/Android.bp +++ b/neuralnetworks/aidl/utils/Android.bp @@ -56,13 +56,21 @@ cc_library_static { } cc_library_static { - name: "neuralnetworks_utils_hal_aidl", + name: "neuralnetworks_utils_hal_aidl_v2", defaults: ["neuralnetworks_utils_hal_aidl_defaults"], shared_libs: [ "android.hardware.neuralnetworks-V2-ndk", ], } +cc_library_static { + name: "neuralnetworks_utils_hal_aidl", + defaults: ["neuralnetworks_utils_hal_aidl_defaults"], + shared_libs: [ + "android.hardware.neuralnetworks-V3-ndk", + ], +} + // A cc_defaults that includes the latest non-experimental AIDL utilities and other AIDL libraries // that are commonly used together. Modules that always depend on the latest non-experimental // AIDL features can include this cc_defaults to avoid managing dependency versions explicitly. @@ -71,7 +79,7 @@ cc_defaults { static_libs: [ "android.hardware.common-V2-ndk", "android.hardware.graphics.common-V3-ndk", - "android.hardware.neuralnetworks-V2-ndk", + "android.hardware.neuralnetworks-V3-ndk", "neuralnetworks_utils_hal_aidl", ], } diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h index b4e747e808..a27487e17c 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h @@ -36,6 +36,8 @@ constexpr std::optional aidlVersionToCanonicalVersion(int aidlVersi return nn::kVersionFeatureLevel5; case 2: return nn::kVersionFeatureLevel6; + case 3: + return nn::kVersionFeatureLevel7; default: return std::nullopt; } diff --git a/neuralnetworks/aidl/utils/test/DeviceTest.cpp b/neuralnetworks/aidl/utils/test/DeviceTest.cpp index 4e9fc469b4..0366e7dff0 100644 --- a/neuralnetworks/aidl/utils/test/DeviceTest.cpp +++ b/neuralnetworks/aidl/utils/test/DeviceTest.cpp @@ -159,6 +159,8 @@ std::string printDeviceTest(const testing::TestParamInfo& info) { return "v1"; case nn::Version::Level::FEATURE_LEVEL_6: return "v2"; + case nn::Version::Level::FEATURE_LEVEL_7: + return "v3"; default: LOG(FATAL) << "Invalid AIDL version: " << version; return "invalid"; @@ -893,7 +895,8 @@ TEST_P(DeviceTest, allocateDeadObject) { } INSTANTIATE_TEST_SUITE_P(TestDevice, DeviceTest, - ::testing::Values(nn::kVersionFeatureLevel5, nn::kVersionFeatureLevel6), + ::testing::Values(nn::kVersionFeatureLevel5, nn::kVersionFeatureLevel6, + nn::kVersionFeatureLevel7), printDeviceTest); } // namespace aidl::android::hardware::neuralnetworks::utils -- GitLab From ed9e12378d17644588a7091e36c48df170f975a8 Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Mon, 22 Nov 2021 21:35:20 +0000 Subject: [PATCH 280/825] Fix typo in HostEndpointInfo definition Package name/attribution tag should be a single String. Bug: 194287786 Test: Compile Change-Id: I6747add3254eef9f7fd0a0b291ad374096979e11 --- .../current/android/hardware/contexthub/HostEndpointInfo.aidl | 4 ++-- .../aidl/android/hardware/contexthub/HostEndpointInfo.aidl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl index 7da44821fa..e7dcbc706d 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl @@ -36,8 +36,8 @@ package android.hardware.contexthub; parcelable HostEndpointInfo { char hostEndpointId; android.hardware.contexthub.HostEndpointInfo.Type type; - @nullable String[] packageName; - @nullable String[] attributionTag; + @nullable String packageName; + @nullable String attributionTag; @Backing(type="int") @VintfStability enum Type { TYPE_FRAMEWORK = 1, diff --git a/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl b/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl index 370703f8cc..40a231d804 100644 --- a/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl +++ b/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl @@ -28,10 +28,10 @@ parcelable HostEndpointInfo { Type type; /** The (optional) package name of the host. */ - @nullable String[] packageName; + @nullable String packageName; /** The (optional) attribution tag associated with this host. */ - @nullable String[] attributionTag; + @nullable String attributionTag; @VintfStability @Backing(type="int") -- GitLab From f9dcdea9f45ead2b41ef60198670219cc2bda7b1 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 23 Nov 2021 17:09:11 -0800 Subject: [PATCH 281/825] Add Java equal and toString annotations. Add annotations so that the Java backend would generate equals and toString methods, which would be useful in our code. Test: Manual build. Bug: 205774940 Change-Id: Ib08c5f42d29c6d028abcaa1a577147d1495cf550 --- .../android/hardware/automotive/vehicle/CreateUserRequest.aidl | 2 +- .../android/hardware/automotive/vehicle/CreateUserResponse.aidl | 2 +- .../android/hardware/automotive/vehicle/GetValueRequest.aidl | 2 +- .../android/hardware/automotive/vehicle/GetValueRequests.aidl | 2 +- .../android/hardware/automotive/vehicle/GetValueResult.aidl | 2 +- .../android/hardware/automotive/vehicle/GetValueResults.aidl | 2 +- .../hardware/automotive/vehicle/InitialUserInfoRequest.aidl | 2 +- .../hardware/automotive/vehicle/InitialUserInfoResponse.aidl | 2 +- .../android/hardware/automotive/vehicle/RawPropValues.aidl | 2 +- .../android/hardware/automotive/vehicle/RemoveUserRequest.aidl | 2 +- .../android/hardware/automotive/vehicle/SetValueRequest.aidl | 2 +- .../android/hardware/automotive/vehicle/SetValueRequests.aidl | 2 +- .../android/hardware/automotive/vehicle/SetValueResult.aidl | 2 +- .../android/hardware/automotive/vehicle/SetValueResults.aidl | 2 +- .../android/hardware/automotive/vehicle/SubscribeOptions.aidl | 2 +- .../android/hardware/automotive/vehicle/SwitchUserRequest.aidl | 2 +- .../android/hardware/automotive/vehicle/SwitchUserResponse.aidl | 2 +- .../automotive/vehicle/UserIdentificationAssociation.aidl | 2 +- .../automotive/vehicle/UserIdentificationGetRequest.aidl | 2 +- .../hardware/automotive/vehicle/UserIdentificationResponse.aidl | 2 +- .../automotive/vehicle/UserIdentificationSetAssociation.aidl | 2 +- .../automotive/vehicle/UserIdentificationSetRequest.aidl | 2 +- .../current/android/hardware/automotive/vehicle/UserInfo.aidl | 2 +- .../current/android/hardware/automotive/vehicle/UsersInfo.aidl | 2 +- .../android/hardware/automotive/vehicle/VehicleAreaConfig.aidl | 2 +- .../android/hardware/automotive/vehicle/VehiclePropConfig.aidl | 2 +- .../android/hardware/automotive/vehicle/VehiclePropConfigs.aidl | 2 +- .../android/hardware/automotive/vehicle/VehiclePropError.aidl | 2 +- .../android/hardware/automotive/vehicle/VehiclePropErrors.aidl | 2 +- .../android/hardware/automotive/vehicle/VehiclePropValue.aidl | 2 +- .../android/hardware/automotive/vehicle/VehiclePropValues.aidl | 2 +- .../android/hardware/automotive/vehicle/CreateUserRequest.aidl | 1 + .../android/hardware/automotive/vehicle/CreateUserResponse.aidl | 1 + .../android/hardware/automotive/vehicle/GetValueRequest.aidl | 1 + .../android/hardware/automotive/vehicle/GetValueRequests.aidl | 1 + .../android/hardware/automotive/vehicle/GetValueResult.aidl | 1 + .../android/hardware/automotive/vehicle/GetValueResults.aidl | 1 + .../hardware/automotive/vehicle/InitialUserInfoRequest.aidl | 1 + .../hardware/automotive/vehicle/InitialUserInfoResponse.aidl | 1 + .../aidl/android/hardware/automotive/vehicle/RawPropValues.aidl | 1 + .../android/hardware/automotive/vehicle/RemoveUserRequest.aidl | 1 + .../android/hardware/automotive/vehicle/SetValueRequest.aidl | 1 + .../android/hardware/automotive/vehicle/SetValueRequests.aidl | 1 + .../android/hardware/automotive/vehicle/SetValueResult.aidl | 1 + .../android/hardware/automotive/vehicle/SetValueResults.aidl | 1 + .../android/hardware/automotive/vehicle/SubscribeOptions.aidl | 1 + .../android/hardware/automotive/vehicle/SwitchUserRequest.aidl | 1 + .../android/hardware/automotive/vehicle/SwitchUserResponse.aidl | 1 + .../automotive/vehicle/UserIdentificationAssociation.aidl | 1 + .../automotive/vehicle/UserIdentificationGetRequest.aidl | 1 + .../hardware/automotive/vehicle/UserIdentificationResponse.aidl | 1 + .../automotive/vehicle/UserIdentificationSetAssociation.aidl | 1 + .../automotive/vehicle/UserIdentificationSetRequest.aidl | 1 + .../aidl/android/hardware/automotive/vehicle/UserInfo.aidl | 1 + .../aidl/android/hardware/automotive/vehicle/UsersInfo.aidl | 1 + .../android/hardware/automotive/vehicle/VehicleAreaConfig.aidl | 1 + .../android/hardware/automotive/vehicle/VehiclePropConfig.aidl | 1 + .../android/hardware/automotive/vehicle/VehiclePropConfigs.aidl | 1 + .../android/hardware/automotive/vehicle/VehiclePropError.aidl | 1 + .../android/hardware/automotive/vehicle/VehiclePropErrors.aidl | 1 + .../android/hardware/automotive/vehicle/VehiclePropValue.aidl | 1 + .../android/hardware/automotive/vehicle/VehiclePropValues.aidl | 1 + 62 files changed, 62 insertions(+), 31 deletions(-) diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl index 54c65bae44..22c690c00f 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserRequest.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable CreateUserRequest { int requestId; android.hardware.automotive.vehicle.UserInfo newUserInfo; diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl index 6126f99759..7d0196b4e5 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/CreateUserResponse.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable CreateUserResponse { int requestId; android.hardware.automotive.vehicle.CreateUserStatus status = android.hardware.automotive.vehicle.CreateUserStatus.SUCCESS; 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 177966b031..d88cd8b076 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; -@VintfStability +@JavaDerive(equals=true, toString=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/GetValueRequests.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueRequests.aidl index 5ecf4dd863..a7df2ff24d 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueRequests.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueRequests.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable GetValueRequests { android.hardware.automotive.vehicle.GetValueRequest[] payloads; @nullable ParcelFileDescriptor sharedMemoryFd; 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 60c46e45a0..25f3575862 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; -@VintfStability +@JavaDerive(equals=true, toString=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/GetValueResults.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueResults.aidl index 778ba8e0b5..4c365b1074 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueResults.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueResults.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable GetValueResults { android.hardware.automotive.vehicle.GetValueResult[] payloads; @nullable ParcelFileDescriptor sharedMemoryFd; diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl index c2c25009e4..a4c048aadb 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable InitialUserInfoRequest { int requestId; android.hardware.automotive.vehicle.InitialUserInfoRequestType requestType = android.hardware.automotive.vehicle.InitialUserInfoRequestType.UNKNOWN; diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl index ffb1781aba..f0e161261d 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable InitialUserInfoResponse { int requestId; android.hardware.automotive.vehicle.InitialUserInfoResponseAction action = android.hardware.automotive.vehicle.InitialUserInfoResponseAction.DEFAULT; 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 e553d602a0..e7b0a137cf 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; -@VintfStability +@JavaDerive(equals=true, toString=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/RemoveUserRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl index 68613092c5..74457b9ab7 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RemoveUserRequest.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable RemoveUserRequest { int requestId; android.hardware.automotive.vehicle.UserInfo removedUserInfo; 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 d6cddb6cdc..6a65307f3c 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; -@VintfStability +@JavaDerive(equals=true, toString=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/SetValueRequests.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueRequests.aidl index ea9ac9a0af..15fd7ea8a8 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueRequests.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueRequests.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable SetValueRequests { android.hardware.automotive.vehicle.SetValueRequest[] payloads; @nullable ParcelFileDescriptor sharedMemoryFd; 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 6c25bc864c..ec5fabb0b4 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; -@VintfStability +@JavaDerive(equals=true, toString=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/SetValueResults.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueResults.aidl index 65ff8f0ed9..47f16563ce 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueResults.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueResults.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable SetValueResults { android.hardware.automotive.vehicle.SetValueResult[] payloads; @nullable ParcelFileDescriptor sharedMemoryFd; 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 dcefd0964e..91e7c1499a 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable SubscribeOptions { int propId; int[] areaIds; diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl index bb18e02177..3012b7a51d 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserRequest.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable SwitchUserRequest { int requestId; android.hardware.automotive.vehicle.SwitchUserMessageType messageType = android.hardware.automotive.vehicle.SwitchUserMessageType.UNKNOWN; diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl index efc1911046..8915d1b866 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SwitchUserResponse.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable SwitchUserResponse { int requestId; android.hardware.automotive.vehicle.SwitchUserMessageType messageType = android.hardware.automotive.vehicle.SwitchUserMessageType.UNKNOWN; diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl index a0f987957a..a540f8ead8 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable UserIdentificationAssociation { android.hardware.automotive.vehicle.UserIdentificationAssociationType type = android.hardware.automotive.vehicle.UserIdentificationAssociationType.INVALID; android.hardware.automotive.vehicle.UserIdentificationAssociationValue value = android.hardware.automotive.vehicle.UserIdentificationAssociationValue.UNKNOWN; diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl index 744030e744..fe7fd6f6bc 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable UserIdentificationGetRequest { int requestId; android.hardware.automotive.vehicle.UserInfo userInfo; diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl index b47b0033b9..3e2a2579cc 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable UserIdentificationResponse { int requestId; int numberAssociation; diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl index 5297349294..57840fb77c 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable UserIdentificationSetAssociation { android.hardware.automotive.vehicle.UserIdentificationAssociationType type = android.hardware.automotive.vehicle.UserIdentificationAssociationType.INVALID; android.hardware.automotive.vehicle.UserIdentificationAssociationSetValue value = android.hardware.automotive.vehicle.UserIdentificationAssociationSetValue.INVALID; diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl index 725040d19f..db01b515a8 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable UserIdentificationSetRequest { int requestId; android.hardware.automotive.vehicle.UserInfo userInfo; diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserInfo.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserInfo.aidl index b99272bf2a..f47d5e74bb 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserInfo.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UserInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable UserInfo { int userId = 0; int flags; diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UsersInfo.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UsersInfo.aidl index 723431698b..edcef2edfd 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UsersInfo.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/UsersInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable UsersInfo { android.hardware.automotive.vehicle.UserInfo currentUser; int numberUsers; 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 7a42ec8017..b93a11b60f 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; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable VehicleAreaConfig { int areaId; int minInt32Value; 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 16ba6dba7e..8602d2d03d 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; -@VintfStability +@JavaDerive(equals=true, toString=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/VehiclePropConfigs.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl index e5d146da7d..04c8006983 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable VehiclePropConfigs { android.hardware.automotive.vehicle.VehiclePropConfig[] payloads; @nullable ParcelFileDescriptor sharedMemoryFd; 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 8b2e1041ef..983529542f 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; -@VintfStability +@JavaDerive(equals=true, toString=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/VehiclePropErrors.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropErrors.aidl index 6303d3a634..9dcb10bc9e 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropErrors.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropErrors.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable VehiclePropErrors { android.hardware.automotive.vehicle.VehiclePropError[] payloads; @nullable ParcelFileDescriptor sharedMemoryFd; 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 fc1ae531d1..c87379fd9b 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; -@VintfStability +@JavaDerive(equals=true, toString=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/VehiclePropValues.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropValues.aidl index da8c60b6bf..e09a6b95df 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropValues.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropValues.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.automotive.vehicle; -@VintfStability +@JavaDerive(equals=true, toString=true) @VintfStability parcelable VehiclePropValues { android.hardware.automotive.vehicle.VehiclePropValue[] payloads; long sharedMemoryId; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl index 1f7c9cc95f..624e5a6d20 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserRequest.aidl @@ -26,6 +26,7 @@ import android.hardware.automotive.vehicle.UsersInfo; * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable CreateUserRequest { /** * Arbitrary id used to map the response to the request. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl index d011366834..29db442948 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CreateUserResponse.aidl @@ -25,6 +25,7 @@ import android.hardware.automotive.vehicle.CreateUserStatus; * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable CreateUserResponse { /** * Id of the request being responded. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequest.aidl index 43a89d045e..e5b3929178 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequest.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequest.aidl @@ -19,6 +19,7 @@ package android.hardware.automotive.vehicle; import android.hardware.automotive.vehicle.VehiclePropValue; @VintfStability +@JavaDerive(equals=true, toString=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/GetValueRequests.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequests.aidl index 66012331eb..3bbb88c0d3 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequests.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequests.aidl @@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.GetValueRequest; import android.os.ParcelFileDescriptor; @VintfStability +@JavaDerive(equals=true, toString=true) parcelable GetValueRequests { // A list of GetValueRequest to get if they fit the binder memory // limitation. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResult.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResult.aidl index b099a858b3..24c57579dd 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResult.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResult.aidl @@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.StatusCode; import android.hardware.automotive.vehicle.VehiclePropValue; @VintfStability +@JavaDerive(equals=true, toString=true) parcelable GetValueResult { // The ID for the request this response is for. long requestId; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResults.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResults.aidl index 919e6441a2..a8bfb2c04b 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResults.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResults.aidl @@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.GetValueResult; import android.os.ParcelFileDescriptor; @VintfStability +@JavaDerive(equals=true, toString=true) parcelable GetValueResults { // The list of responses if they fit the binder memory limitation. GetValueResult[] payloads; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl index 7879d44f06..c7ba836ab7 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl @@ -26,6 +26,7 @@ import android.hardware.automotive.vehicle.UsersInfo; * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable InitialUserInfoRequest { /** * Arbitrary id used to map the HAL response to the request. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl index 8be0c69431..4c46fcb164 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl @@ -26,6 +26,7 @@ import android.hardware.automotive.vehicle.UserInfo; * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable InitialUserInfoResponse { /** * Id of the request being responded. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl index 5d8febd196..9c6875b0b5 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl @@ -17,6 +17,7 @@ package android.hardware.automotive.vehicle; @VintfStability +@JavaDerive(equals=true, toString=true) parcelable RawPropValues { /** * This is used for properties of types VehiclePropertyType#INT diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl index 1a3d4dd096..cb61da85eb 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RemoveUserRequest.aidl @@ -26,6 +26,7 @@ import android.hardware.automotive.vehicle.UsersInfo; * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable RemoveUserRequest { /** * Arbitrary id used to map the response to the request. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequest.aidl index f2b0e271c4..625f9010e7 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequest.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequest.aidl @@ -19,6 +19,7 @@ package android.hardware.automotive.vehicle; import android.hardware.automotive.vehicle.VehiclePropValue; @VintfStability +@JavaDerive(equals=true, toString=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/SetValueRequests.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequests.aidl index 5d6ad85766..a690fa2786 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequests.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequests.aidl @@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.SetValueRequest; import android.os.ParcelFileDescriptor; @VintfStability +@JavaDerive(equals=true, toString=true) parcelable SetValueRequests { // The list of request if they fit the binder memory limitation. SetValueRequest[] payloads; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResult.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResult.aidl index a468f3be0c..b3feeaa1e1 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResult.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResult.aidl @@ -19,6 +19,7 @@ package android.hardware.automotive.vehicle; import android.hardware.automotive.vehicle.StatusCode; @VintfStability +@JavaDerive(equals=true, toString=true) parcelable SetValueResult { // The ID for the request this response is for. long requestId; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResults.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResults.aidl index 6df9de053b..9b0e505ee4 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResults.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResults.aidl @@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.SetValueResult; import android.os.ParcelFileDescriptor; @VintfStability +@JavaDerive(equals=true, toString=true) parcelable SetValueResults { // The list of responses if they fit the binder memory limitation. SetValueResult[] payloads; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl index bc7d84a3a2..e68f7e3631 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl @@ -20,6 +20,7 @@ package android.hardware.automotive.vehicle; * Encapsulates information about subscription to vehicle property events. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable SubscribeOptions { /** Property to subscribe */ int propId; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl index 10858a4e74..320632cc6a 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserRequest.aidl @@ -27,6 +27,7 @@ import android.hardware.automotive.vehicle.UsersInfo; * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable SwitchUserRequest { /** * Arbitrary id used to map the response to the request. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl index d5d44e56fa..106386dd4a 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SwitchUserResponse.aidl @@ -26,6 +26,7 @@ import android.hardware.automotive.vehicle.SwitchUserStatus; * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable SwitchUserResponse { /** * Id of the request being responded. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl index cdd11bfe2d..4af5f72eb5 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl @@ -23,6 +23,7 @@ import android.hardware.automotive.vehicle.UserIdentificationAssociationValue; * Helper struct used when getting a user/identification association type. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable UserIdentificationAssociation { UserIdentificationAssociationType type = UserIdentificationAssociationType.INVALID; UserIdentificationAssociationValue value = UserIdentificationAssociationValue.UNKNOWN; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl index 58620efa59..82580d795e 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl @@ -26,6 +26,7 @@ import android.hardware.automotive.vehicle.UserInfo; * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable UserIdentificationGetRequest { /** * Id of the request being responded. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl index 06341c7f7d..1487a70950 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl @@ -25,6 +25,7 @@ import android.hardware.automotive.vehicle.UserIdentificationAssociation; * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable UserIdentificationResponse { /** * Id of the request being responded. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl index fe5017fcc8..bfb9544be7 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl @@ -23,6 +23,7 @@ import android.hardware.automotive.vehicle.UserIdentificationAssociationType; * Helper struct used when setting a user/identification association type. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable UserIdentificationSetAssociation { UserIdentificationAssociationType type = UserIdentificationAssociationType.INVALID; UserIdentificationAssociationSetValue value = UserIdentificationAssociationSetValue.INVALID; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl index 13f36773e5..223ff08e7b 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl @@ -25,6 +25,7 @@ import android.hardware.automotive.vehicle.UserInfo; * VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable UserIdentificationSetRequest { /** * Id of the request being responded. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl index e4ecc4b1ea..20c72bd6e5 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UserInfo.aidl @@ -20,6 +20,7 @@ package android.hardware.automotive.vehicle; * Information about a specific Android user. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable UserInfo { /** * System user. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl index 77468b1e0c..ede36f778f 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/UsersInfo.aidl @@ -26,6 +26,7 @@ import android.hardware.automotive.vehicle.UserInfo; * Vehicle HAL implementation. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable UsersInfo { /** * The current foreground user. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl index b33dcbc509..b44996dc7e 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl @@ -17,6 +17,7 @@ package android.hardware.automotive.vehicle; @VintfStability +@JavaDerive(equals=true, toString=true) parcelable VehicleAreaConfig { /** * Area id is ignored for VehiclePropertyGroup:GLOBAL properties. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl index 5e0dbecdb4..1b48f0b1b6 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl @@ -21,6 +21,7 @@ import android.hardware.automotive.vehicle.VehiclePropertyAccess; import android.hardware.automotive.vehicle.VehiclePropertyChangeMode; @VintfStability +@JavaDerive(equals=true, toString=true) parcelable VehiclePropConfig { /** Property identifier */ int prop; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl index 98abdefbd5..9c2d5f7191 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl @@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.VehiclePropConfig; import android.os.ParcelFileDescriptor; @VintfStability +@JavaDerive(equals=true, toString=true) parcelable VehiclePropConfigs { // The list of vehicle property configs if they fit the binder memory // limitation. diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropError.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropError.aidl index 1608977c27..2c31c72802 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropError.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropError.aidl @@ -19,6 +19,7 @@ package android.hardware.automotive.vehicle; import android.hardware.automotive.vehicle.StatusCode; @VintfStability +@JavaDerive(equals=true, toString=true) parcelable VehiclePropError { // Property ID. int propId; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropErrors.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropErrors.aidl index 6a77d356d6..10a164d26f 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropErrors.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropErrors.aidl @@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.VehiclePropError; import android.os.ParcelFileDescriptor; @VintfStability +@JavaDerive(equals=true, toString=true) parcelable VehiclePropErrors { // List of property set errors if they fit binder memory limitation. VehiclePropError[] payloads; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl index 37dac59a21..289f2701af 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl @@ -25,6 +25,7 @@ import android.hardware.automotive.vehicle.VehiclePropertyStatus; * events. */ @VintfStability +@JavaDerive(equals=true, toString=true) parcelable VehiclePropValue { /** Time is elapsed nanoseconds since boot */ long timestamp; diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValues.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValues.aidl index 1944f8e321..df44fdbfc1 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValues.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValues.aidl @@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.VehiclePropValue; import android.os.ParcelFileDescriptor; @VintfStability +@JavaDerive(equals=true, toString=true) parcelable VehiclePropValues { // The list of vehicle properties if they fit the binder memory limitation. VehiclePropValue[] payloads; -- GitLab From 6301e8fba87e61f2f51ac223c558120465e6cb78 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Mon, 18 Oct 2021 16:53:40 -0700 Subject: [PATCH 282/825] Initial implementation of HIDL-AIDL Telephony HAL translator Bug: 203699028 Test: Boot and grep logcat against radiocompat Change-Id: I182edf3b1fa39b30818e79a68fc586f12b677d19 --- radio/aidl/compat/libradiocompat/Android.bp | 53 +++++++++ .../aidl/compat/libradiocompat/collections.h | 54 +++++++++ .../compat/libradiocompat/commonStructs.cpp | 63 +++++++++++ .../compat/libradiocompat/commonStructs.h | 34 ++++++ .../libradiocompat/config/RadioConfig.cpp | 103 ++++++++++++++++++ .../config/RadioConfigIndication.cpp | 48 ++++++++ .../config/RadioConfigIndication.h | 38 +++++++ .../config/RadioConfigResponse.cpp | 90 +++++++++++++++ .../config/RadioConfigResponse.h | 48 ++++++++ .../compat/libradiocompat/config/structs.cpp | 69 ++++++++++++ .../compat/libradiocompat/config/structs.h | 39 +++++++ radio/aidl/compat/libradiocompat/debug.h | 35 ++++++ .../include/libradiocompat/RadioConfig.h | 66 +++++++++++ radio/aidl/compat/service/Android.bp | 51 +++++++++ radio/aidl/compat/service/hidl-utils.cpp | 36 ++++++ radio/aidl/compat/service/hidl-utils.h | 30 +++++ radio/aidl/compat/service/radio-compat.rc | 4 + radio/aidl/compat/service/radio-compat.xml | 6 + radio/aidl/compat/service/service.cpp | 60 ++++++++++ 19 files changed, 927 insertions(+) create mode 100644 radio/aidl/compat/libradiocompat/Android.bp create mode 100644 radio/aidl/compat/libradiocompat/collections.h create mode 100644 radio/aidl/compat/libradiocompat/commonStructs.cpp create mode 100644 radio/aidl/compat/libradiocompat/commonStructs.h create mode 100644 radio/aidl/compat/libradiocompat/config/RadioConfig.cpp create mode 100644 radio/aidl/compat/libradiocompat/config/RadioConfigIndication.cpp create mode 100644 radio/aidl/compat/libradiocompat/config/RadioConfigIndication.h create mode 100644 radio/aidl/compat/libradiocompat/config/RadioConfigResponse.cpp create mode 100644 radio/aidl/compat/libradiocompat/config/RadioConfigResponse.h create mode 100644 radio/aidl/compat/libradiocompat/config/structs.cpp create mode 100644 radio/aidl/compat/libradiocompat/config/structs.h create mode 100644 radio/aidl/compat/libradiocompat/debug.h create mode 100644 radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h create mode 100644 radio/aidl/compat/service/Android.bp create mode 100644 radio/aidl/compat/service/hidl-utils.cpp create mode 100644 radio/aidl/compat/service/hidl-utils.h create mode 100644 radio/aidl/compat/service/radio-compat.rc create mode 100644 radio/aidl/compat/service/radio-compat.xml create mode 100644 radio/aidl/compat/service/service.cpp diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp new file mode 100644 index 0000000000..ada7c7ed98 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/Android.bp @@ -0,0 +1,53 @@ +// 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. + +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_library { + name: "android.hardware.radio-library.compat", + relative_install_path: "hw", + vendor: true, + cflags: [ + "-Wall", + "-Wextra", + //"-Wold-style-cast", // TODO(b/203699028) enable after aosp/1900880 gets merged + "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", + ], + shared_libs: [ + "android.hardware.radio.config-V1-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", + "libbase", + "libbinder_ndk", + "libhidlbase", + "libutils", + ], + srcs: [ + "commonStructs.cpp", + "config/RadioConfig.cpp", + "config/RadioConfigIndication.cpp", + "config/RadioConfigResponse.cpp", + "config/structs.cpp", + ], + export_include_dirs: ["include"], +} diff --git a/radio/aidl/compat/libradiocompat/collections.h b/radio/aidl/compat/libradiocompat/collections.h new file mode 100644 index 0000000000..9ef1351a8c --- /dev/null +++ b/radio/aidl/compat/libradiocompat/collections.h @@ -0,0 +1,54 @@ +/* + * 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 + +namespace android::hardware::radio::compat { + +/** + * Converts hidl_vec HIDL list to std::vector AIDL list. + * + * To convert values, the template uses toAidl functions for a given type T, assuming it's defined. + * + * \param inp vector to convert + */ +template +auto toAidl(const hidl_vec& inp) { + std::vector out(inp.size()); + for (size_t i = 0; i < inp.size(); i++) { + out[i] = toAidl(inp[i]); + } + return out; +} + +/** + * Converts std::vector AIDL list to hidl_vec HIDL list. + * + * To convert values, the template uses toHidl functions for a given type T, assuming it's defined. + * + * \param inp vector to convert + */ +template +auto toHidl(const std::vector& inp) { + hidl_vec out(inp.size()); + for (size_t i = 0; i < inp.size(); i++) { + out[i] = toHidl(inp[i]); + } + return out; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/commonStructs.cpp b/radio/aidl/compat/libradiocompat/commonStructs.cpp new file mode 100644 index 0000000000..e81562a89a --- /dev/null +++ b/radio/aidl/compat/libradiocompat/commonStructs.cpp @@ -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. + */ + +#include "commonStructs.h" + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio; + +V1_6::RadioResponseInfo notSupported(int32_t serial) { + return { + .type = V1_0::RadioResponseType::SOLICITED, + .serial = serial, + .error = V1_6::RadioError::REQUEST_NOT_SUPPORTED, + }; +} + +aidl::RadioIndicationType toAidl(V1_0::RadioIndicationType type) { + return aidl::RadioIndicationType(type); +} + +aidl::RadioResponseType toAidl(V1_0::RadioResponseType type) { + return aidl::RadioResponseType(type); +} + +aidl::RadioError toAidl(V1_0::RadioError err) { + return aidl::RadioError(err); +} + +aidl::RadioError toAidl(V1_6::RadioError err) { + return aidl::RadioError(err); +} + +aidl::RadioResponseInfo toAidl(const V1_0::RadioResponseInfo& info) { + return { + .type = toAidl(info.type), + .serial = info.serial, + .error = toAidl(info.error), + }; +} + +aidl::RadioResponseInfo toAidl(const V1_6::RadioResponseInfo& info) { + return { + .type = toAidl(info.type), + .serial = info.serial, + .error = toAidl(info.error), + }; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/commonStructs.h b/radio/aidl/compat/libradiocompat/commonStructs.h new file mode 100644 index 0000000000..cba307ebde --- /dev/null +++ b/radio/aidl/compat/libradiocompat/commonStructs.h @@ -0,0 +1,34 @@ +/* + * 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 +#include +#include + +namespace android::hardware::radio::compat { + +V1_6::RadioResponseInfo notSupported(int32_t serial); + +aidl::android::hardware::radio::RadioIndicationType toAidl(V1_0::RadioIndicationType type); +aidl::android::hardware::radio::RadioResponseType toAidl(V1_0::RadioResponseType type); +aidl::android::hardware::radio::RadioError toAidl(V1_0::RadioError type); +aidl::android::hardware::radio::RadioError toAidl(V1_6::RadioError type); + +aidl::android::hardware::radio::RadioResponseInfo toAidl(const V1_0::RadioResponseInfo& info); +aidl::android::hardware::radio::RadioResponseInfo toAidl(const V1_6::RadioResponseInfo& info); + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp new file mode 100644 index 0000000000..d0d6f7af28 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp @@ -0,0 +1,103 @@ +/* + * 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 + +#include "RadioConfigIndication.h" +#include "RadioConfigResponse.h" +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#define RADIO_MODULE "Config" + +namespace android::hardware::radio::compat { + +using ::ndk::ScopedAStatus; +namespace aidl = ::aidl::android::hardware::radio::config; +constexpr auto ok = &ScopedAStatus::ok; + +RadioConfig::RadioConfig(sp hidlHal) + : mHal1_1(hidlHal), mHal1_3(config::V1_3::IRadioConfig::castFrom(hidlHal)) {} + +config::V1_3::IRadioConfigResponse& RadioConfig::respond() { + CHECK(mRadioConfigResponse) << "setResponseFunctions was not called yet"; + return *mRadioConfigResponse; +} + +ScopedAStatus RadioConfig::getHalDeviceCapabilities(int32_t serial) { + LOG_CALL << serial; + if (mHal1_3) { + mHal1_3->getHalDeviceCapabilities(serial); + } else { + respond().getHalDeviceCapabilitiesResponse(notSupported(serial), false); + } + return ok(); +} + +ScopedAStatus RadioConfig::getNumOfLiveModems(int32_t serial) { + LOG_CALL << serial; + mHal1_1->getModemsConfig(serial); + return ok(); +} + +ScopedAStatus RadioConfig::getPhoneCapability(int32_t serial) { + LOG_CALL << serial; + mHal1_1->getPhoneCapability(serial); + return ok(); +} + +ScopedAStatus RadioConfig::getSimSlotsStatus(int32_t serial) { + LOG_CALL << serial; + mHal1_1->getSimSlotsStatus(serial); + return ok(); +} + +ScopedAStatus RadioConfig::setNumOfLiveModems(int32_t serial, int8_t numOfLiveModems) { + LOG_CALL << serial; + mHal1_1->setModemsConfig(serial, {static_cast(numOfLiveModems)}); + return ok(); +} + +ScopedAStatus RadioConfig::setPreferredDataModem(int32_t serial, int8_t modemId) { + LOG_CALL << serial; + mHal1_1->setPreferredDataModem(serial, modemId); + return ok(); +} + +ScopedAStatus RadioConfig::setResponseFunctions( + const std::shared_ptr& radioConfigResponse, + const std::shared_ptr& radioConfigIndication) { + LOG_CALL << radioConfigResponse << ' ' << radioConfigIndication; + + CHECK(radioConfigResponse); + CHECK(radioConfigIndication); + + mRadioConfigResponse = sp::make(radioConfigResponse); + mRadioConfigIndication = sp::make(radioConfigIndication); + mHal1_1->setResponseFunctions(mRadioConfigResponse, mRadioConfigIndication); + + return ok(); +} + +ScopedAStatus RadioConfig::setSimSlotsMapping( // + int32_t serial, const std::vector& slotMap) { + LOG_CALL << serial; + mHal1_1->setSimSlotsMapping(serial, toHidl(slotMap)); + return ok(); +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.cpp b/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.cpp new file mode 100644 index 0000000000..0320ad77ca --- /dev/null +++ b/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.cpp @@ -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. + */ + +#include "RadioConfigIndication.h" + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "ConfigIndication" + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::config; + +RadioConfigIndication::RadioConfigIndication(std::shared_ptr callback) + : mCallback(callback) {} + +Return RadioConfigIndication::simSlotsStatusChanged( + V1_0::RadioIndicationType type, const hidl_vec& slotStatus) { + LOG_CALL << type; + mCallback->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus)); + return {}; +} + +Return RadioConfigIndication::simSlotsStatusChanged_1_2( + V1_0::RadioIndicationType type, const hidl_vec& slotStatus) { + LOG_CALL << type; + mCallback->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus)); + return {}; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.h b/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.h new file mode 100644 index 0000000000..3d8d971694 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.h @@ -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. + */ +#pragma once + +#include +#include + +namespace android::hardware::radio::compat { + +class RadioConfigIndication : public config::V1_2::IRadioConfigIndication { + std::shared_ptr mCallback; + + Return simSlotsStatusChanged( + V1_0::RadioIndicationType type, + const hidl_vec& slotStatus) override; + Return simSlotsStatusChanged_1_2( + V1_0::RadioIndicationType type, + const hidl_vec& slotStatus) override; + + public: + RadioConfigIndication( + std::shared_ptr cb); +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.cpp b/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.cpp new file mode 100644 index 0000000000..7066ae46c6 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.cpp @@ -0,0 +1,90 @@ +/* + * 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 "RadioConfigResponse.h" + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "ConfigResponse" + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::config; + +RadioConfigResponse::RadioConfigResponse(std::shared_ptr callback) + : mCallback(callback) {} + +Return RadioConfigResponse::getSimSlotsStatusResponse( + const V1_0::RadioResponseInfo& info, + const hidl_vec& slotStatus) { + LOG_CALL << info.serial; + mCallback->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus)); + return {}; +}; + +Return RadioConfigResponse::getSimSlotsStatusResponse_1_2( + const V1_0::RadioResponseInfo& info, + const hidl_vec& slotStatus) { + LOG_CALL << info.serial; + mCallback->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus)); + return {}; +}; + +Return RadioConfigResponse::setSimSlotsMappingResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + mCallback->setSimSlotsMappingResponse(toAidl(info)); + return {}; +}; + +Return RadioConfigResponse::getPhoneCapabilityResponse( + const V1_0::RadioResponseInfo& info, const config::V1_1::PhoneCapability& phoneCapability) { + LOG_CALL << info.serial; + mCallback->getPhoneCapabilityResponse(toAidl(info), toAidl(phoneCapability)); + return {}; +}; + +Return RadioConfigResponse::setPreferredDataModemResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + mCallback->setPreferredDataModemResponse(toAidl(info)); + return {}; +}; + +Return RadioConfigResponse::setModemsConfigResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + mCallback->setNumOfLiveModemsResponse(toAidl(info)); + return {}; +}; + +Return RadioConfigResponse::getModemsConfigResponse( + const V1_0::RadioResponseInfo& info, const config::V1_1::ModemsConfig& modemsConfig) { + LOG_CALL << info.serial; + mCallback->getNumOfLiveModemsResponse(toAidl(info), modemsConfig.numOfLiveModems); + return {}; +}; + +Return RadioConfigResponse::getHalDeviceCapabilitiesResponse( + const V1_6::RadioResponseInfo& info, bool modemReducedFeatureSet1) { + LOG_CALL << info.serial; + mCallback->getHalDeviceCapabilitiesResponse(toAidl(info), modemReducedFeatureSet1); + return {}; +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.h b/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.h new file mode 100644 index 0000000000..1461dd2035 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.h @@ -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. + */ +#pragma once + +#include +#include + +namespace android::hardware::radio::compat { + +class RadioConfigResponse : public config::V1_3::IRadioConfigResponse { + std::shared_ptr mCallback; + + Return getSimSlotsStatusResponse( + const V1_0::RadioResponseInfo& info, + const hidl_vec& slotStatus) override; + Return setSimSlotsMappingResponse(const V1_0::RadioResponseInfo& info) override; + Return getPhoneCapabilityResponse( + const V1_0::RadioResponseInfo& info, + const config::V1_1::PhoneCapability& phoneCapability) override; + Return setPreferredDataModemResponse(const V1_0::RadioResponseInfo& info) override; + Return setModemsConfigResponse(const V1_0::RadioResponseInfo& info) override; + Return getModemsConfigResponse(const V1_0::RadioResponseInfo& info, + const config::V1_1::ModemsConfig& modemsConfig) override; + Return getSimSlotsStatusResponse_1_2( + const V1_0::RadioResponseInfo& info, + const hidl_vec& slotStatus) override; + Return getHalDeviceCapabilitiesResponse(const V1_6::RadioResponseInfo& info, + bool modemReducedFeatureSet1) override; + + public: + RadioConfigResponse( + std::shared_ptr callback); +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/config/structs.cpp b/radio/aidl/compat/libradiocompat/config/structs.cpp new file mode 100644 index 0000000000..9ba56231e2 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/config/structs.cpp @@ -0,0 +1,69 @@ +/* + * 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 "structs.h" + +#include "collections.h" + +#include + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::config; + +hidl_vec toHidl(const std::vector& slotMap) { + hidl_vec out(slotMap.size()); + for (const auto& el : slotMap) { + CHECK_GE(el.portId, 0); + CHECK_LT(static_cast(el.portId), out.size()); + out[el.portId] = el.physicalSlotId; + } + return out; +} + +aidl::SimSlotStatus toAidl(const config::V1_0::SimSlotStatus& sst) { + return toAidl({sst, ""}); +} + +aidl::SimSlotStatus toAidl(const config::V1_2::SimSlotStatus& sst) { + const aidl::SimPortInfo portInfo = { + .iccId = sst.base.iccid, + .logicalSlotId = static_cast(sst.base.logicalSlotId), + .portActive = sst.base.slotState == config::V1_0::SlotState::ACTIVE, + }; + + return { + .cardState = static_cast(sst.base.cardState), + .atr = sst.base.atr, + .eid = sst.eid, + .portInfo = {portInfo}, + }; +} + +uint8_t toAidl(const config::V1_1::ModemInfo& info) { + return info.modemId; +} + +aidl::PhoneCapability toAidl(const config::V1_1::PhoneCapability& phoneCapability) { + return { + .maxActiveData = static_cast(phoneCapability.maxActiveData), + .maxActiveInternetData = static_cast(phoneCapability.maxActiveInternetData), + .isInternetLingeringSupported = phoneCapability.isInternetLingeringSupported, + .logicalModemIds = toAidl(phoneCapability.logicalModemList), + }; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/config/structs.h b/radio/aidl/compat/libradiocompat/config/structs.h new file mode 100644 index 0000000000..b8a038588c --- /dev/null +++ b/radio/aidl/compat/libradiocompat/config/structs.h @@ -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. + */ +#pragma once + +#include +#include +#include +#include +#include + +namespace android::hardware::radio::compat { + +hidl_vec // +toHidl(const std::vector& slotMap); + +aidl::android::hardware::radio::config::SimSlotStatus // +toAidl(const config::V1_0::SimSlotStatus& sst); +aidl::android::hardware::radio::config::SimSlotStatus // +toAidl(const config::V1_2::SimSlotStatus& sst); + +uint8_t toAidl(const config::V1_1::ModemInfo& info); + +aidl::android::hardware::radio::config::PhoneCapability // +toAidl(const config::V1_1::PhoneCapability& pc); + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/debug.h b/radio/aidl/compat/libradiocompat/debug.h new file mode 100644 index 0000000000..cb773bf27d --- /dev/null +++ b/radio/aidl/compat/libradiocompat/debug.h @@ -0,0 +1,35 @@ +/* + * 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 + +namespace android::hardware::radio::compat { + +namespace debug { + +static constexpr bool kSuperVerbose = true; + +#define LOG_CALL \ + if constexpr (debug::kSuperVerbose) LOG(VERBOSE) << (RADIO_MODULE ".") << __func__ << ' ' + +} // namespace debug + +inline std::ostream& operator<<(std::ostream& os, const V1_0::RadioIndicationType& type) { + return os << static_cast(type); +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h new file mode 100644 index 0000000000..31ad207d40 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h @@ -0,0 +1,66 @@ +/* + * 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 +#include +#include +#include + +namespace android::hardware::radio::compat { + +/** + * HAL translator from HIDL IRadioConfig to AIDL IRadioConfig. + * + * This class wraps existing HIDL implementation (either a binder stub or real + * class implementing the HAL) and implements AIDL HAL. It's up to the caller to + * fetch source implementation and publish resulting HAL instance. + */ +class RadioConfig : public aidl::android::hardware::radio::config::BnRadioConfig { + sp mHal1_1; + sp mHal1_3; + + sp mRadioConfigResponse; + sp mRadioConfigIndication; + + ::ndk::ScopedAStatus getHalDeviceCapabilities(int32_t serial) override; + ::ndk::ScopedAStatus getNumOfLiveModems(int32_t serial) override; + ::ndk::ScopedAStatus getPhoneCapability(int32_t serial) override; + ::ndk::ScopedAStatus getSimSlotsStatus(int32_t serial) override; + ::ndk::ScopedAStatus setNumOfLiveModems(int32_t serial, int8_t numOfLiveModems) override; + ::ndk::ScopedAStatus setPreferredDataModem(int32_t serial, int8_t modemId) override; + ::ndk::ScopedAStatus setResponseFunctions( + const std::shared_ptr& + radioConfigResponse, + const std::shared_ptr& + radioConfigIndication) override; + ::ndk::ScopedAStatus setSimSlotsMapping( + int32_t serial, + const std::vector& slotMap) + override; + + config::V1_3::IRadioConfigResponse& respond(); + + public: + /** + * Constructs AIDL IRadioConfig instance wrapping existing HIDL IRadioConfig instance. + * + * \param hidlHal existing HIDL IRadioConfig HAL instance + */ + RadioConfig(sp hidlHal); +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/service/Android.bp b/radio/aidl/compat/service/Android.bp new file mode 100644 index 0000000000..f708b84764 --- /dev/null +++ b/radio/aidl/compat/service/Android.bp @@ -0,0 +1,51 @@ +// 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. + +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.radio-service.compat", + relative_install_path: "hw", + init_rc: ["radio-compat.rc"], + vintf_fragments: ["radio-compat.xml"], + vendor: true, + cflags: [ + "-Wall", + "-Wextra", + "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", + ], + shared_libs: [ + "android.hardware.radio-library.compat", + "android.hardware.radio.config-V1-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", + "libbase", + "libbinder_ndk", + "libhidlbase", + "libutils", + ], + srcs: [ + "hidl-utils.cpp", + "service.cpp", + ], +} diff --git a/radio/aidl/compat/service/hidl-utils.cpp b/radio/aidl/compat/service/hidl-utils.cpp new file mode 100644 index 0000000000..d8949666af --- /dev/null +++ b/radio/aidl/compat/service/hidl-utils.cpp @@ -0,0 +1,36 @@ +/* + * 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 "hidl-utils.h" + +#include + +namespace android::hardware::hidl_utils { + +class HalDeathRecipient : public hidl_death_recipient { + void serviceDied(uint64_t /* cookie */, const wp& /* who */) override { + LOG(FATAL) << "One of the linked HALs died. Restarting..."; + } +}; + +static const auto gHalDeathRecipient = sp::make(); + +void linkDeathToDeath(sp<::android::hidl::base::V1_0::IBase> hal) { + const auto linkStatus = hal->linkToDeath(gHalDeathRecipient, 0); + CHECK(linkStatus.withDefault(false)) << "Failed to link to HAL death"; +} + +} // namespace android::hardware::hidl_utils diff --git a/radio/aidl/compat/service/hidl-utils.h b/radio/aidl/compat/service/hidl-utils.h new file mode 100644 index 0000000000..3f81a9b96f --- /dev/null +++ b/radio/aidl/compat/service/hidl-utils.h @@ -0,0 +1,30 @@ +/* + * 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 + +namespace android::hardware::hidl_utils { + +/** + * Link to a given HALs death and restart the current process in such a case. + * + * \param hal HAL to which death to link + */ +void linkDeathToDeath(sp hal); + +} // namespace android::hardware::hidl_utils diff --git a/radio/aidl/compat/service/radio-compat.rc b/radio/aidl/compat/service/radio-compat.rc new file mode 100644 index 0000000000..a1598760ff --- /dev/null +++ b/radio/aidl/compat/service/radio-compat.rc @@ -0,0 +1,4 @@ +service vendor.radio-compat /vendor/bin/hw/android.hardware.radio-service.compat + class hal + user nobody + group system diff --git a/radio/aidl/compat/service/radio-compat.xml b/radio/aidl/compat/service/radio-compat.xml new file mode 100644 index 0000000000..60f8ff5d7c --- /dev/null +++ b/radio/aidl/compat/service/radio-compat.xml @@ -0,0 +1,6 @@ + + + android.hardware.radio.config + IRadioConfig/default + + diff --git a/radio/aidl/compat/service/service.cpp b/radio/aidl/compat/service/service.cpp new file mode 100644 index 0000000000..c177dd1233 --- /dev/null +++ b/radio/aidl/compat/service/service.cpp @@ -0,0 +1,60 @@ +/* + * 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 "hidl-utils.h" + +#include +#include +#include +#include + +namespace android::hardware::radio::service { + +using namespace std::string_literals; + +static std::vector> gPublishedHals; + +static void publishRadioConfig() { + auto hidlHal = config::V1_1::IRadioConfig::getService(); + CHECK(hidlHal) << "HIDL IRadioConfig not present in VINTF"; + + hidl_utils::linkDeathToDeath(hidlHal); + + auto aidlHal = ndk::SharedRefBase::make(hidlHal); + gPublishedHals.push_back(aidlHal); + const auto instance = compat::RadioConfig::descriptor + "/default"s; + const auto status = AServiceManager_addService(aidlHal->asBinder().get(), instance.c_str()); + CHECK_EQ(status, STATUS_OK); +} + +static void main() { + base::SetDefaultTag("radiocompat"); + base::SetMinimumLogSeverity(base::VERBOSE); + LOG(DEBUG) << "Radio HAL compat service starting..."; + + publishRadioConfig(); + + LOG(DEBUG) << "Radio HAL compat service is operational"; + ABinderProcess_joinThreadPool(); + LOG(FATAL) << "Radio HAL compat service has stopped"; +} + +} // namespace android::hardware::radio::service + +int main() { + android::hardware::radio::service::main(); + return EXIT_FAILURE; // should not reach +} -- GitLab From 1f16d3a315eef2e1c1ffc9fff78b194093591c86 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Mon, 25 Oct 2021 20:20:49 -0700 Subject: [PATCH 283/825] Implement RadioMessaging for AIDL-HIDL Telephony HAL translator Bug: 203699028 Test: Boot and grep logcat against radiocompat Change-Id: I10f0fc0b871fbaf26145c83211770a82af6adc61 --- radio/aidl/compat/libradiocompat/Android.bp | 15 + .../compat/libradiocompat/RadioCompatBase.cpp | 35 + .../compat/libradiocompat/RadioIndication.cpp | 344 +++++++ .../compat/libradiocompat/RadioResponse.cpp | 866 ++++++++++++++++++ radio/aidl/compat/libradiocompat/debug.h | 6 + .../include/libradiocompat/RadioCompatBase.h | 40 + .../include/libradiocompat/RadioIndication.h | 179 ++++ .../include/libradiocompat/RadioMessaging.h | 89 ++ .../include/libradiocompat/RadioResponse.h | 407 ++++++++ .../messaging/RadioIndication-messaging.cpp | 94 ++ .../messaging/RadioMessaging.cpp | 195 ++++ .../messaging/RadioResponse-messaging.cpp | 244 +++++ .../libradiocompat/messaging/structs.cpp | 172 ++++ .../compat/libradiocompat/messaging/structs.h | 57 ++ radio/aidl/compat/service/Android.bp | 8 + radio/aidl/compat/service/hidl-utils.cpp | 10 + radio/aidl/compat/service/hidl-utils.h | 50 +- radio/aidl/compat/service/radio-compat.xml | 11 + radio/aidl/compat/service/service.cpp | 38 + 19 files changed, 2859 insertions(+), 1 deletion(-) create mode 100644 radio/aidl/compat/libradiocompat/RadioCompatBase.cpp create mode 100644 radio/aidl/compat/libradiocompat/RadioIndication.cpp create mode 100644 radio/aidl/compat/libradiocompat/RadioResponse.cpp create mode 100644 radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h create mode 100644 radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h create mode 100644 radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h create mode 100644 radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h create mode 100644 radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp create mode 100644 radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp create mode 100644 radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp create mode 100644 radio/aidl/compat/libradiocompat/messaging/structs.cpp create mode 100644 radio/aidl/compat/libradiocompat/messaging/structs.h diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp index ada7c7ed98..00c1db658d 100644 --- a/radio/aidl/compat/libradiocompat/Android.bp +++ b/radio/aidl/compat/libradiocompat/Android.bp @@ -37,17 +37,32 @@ cc_library { "android.hardware.radio.config@1.1", "android.hardware.radio.config@1.2", "android.hardware.radio.config@1.3", + "android.hardware.radio.messaging-V1-ndk", + "android.hardware.radio@1.0", + "android.hardware.radio@1.1", + "android.hardware.radio@1.2", + "android.hardware.radio@1.3", + "android.hardware.radio@1.4", + "android.hardware.radio@1.5", + "android.hardware.radio@1.6", "libbase", "libbinder_ndk", "libhidlbase", "libutils", ], srcs: [ + "RadioCompatBase.cpp", + "RadioIndication.cpp", + "RadioResponse.cpp", "commonStructs.cpp", "config/RadioConfig.cpp", "config/RadioConfigIndication.cpp", "config/RadioConfigResponse.cpp", "config/structs.cpp", + "messaging/RadioIndication-messaging.cpp", + "messaging/RadioMessaging.cpp", + "messaging/RadioResponse-messaging.cpp", + "messaging/structs.cpp", ], export_include_dirs: ["include"], } diff --git a/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp b/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp new file mode 100644 index 0000000000..a9eac68d13 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp @@ -0,0 +1,35 @@ +/* + * 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 + +#include + +namespace android::hardware::radio::compat { + +RadioCompatBase::RadioCompatBase(sp hidlHal, sp radioResponse, + sp radioIndication) + : mHal1_5(hidlHal), + mHal1_6(V1_6::IRadio::castFrom(hidlHal)), + mRadioResponse(radioResponse), + mRadioIndication(radioIndication) {} + +V1_6::IRadioResponse& RadioCompatBase::respond() { + CHECK(mRadioResponse) << "This shouldn't happen (response functions are passed in constructor)"; + return *mRadioResponse; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/RadioIndication.cpp b/radio/aidl/compat/libradiocompat/RadioIndication.cpp new file mode 100644 index 0000000000..5cbb954229 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/RadioIndication.cpp @@ -0,0 +1,344 @@ +/* + * 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 + +// TODO(b/203699028): remove when fully implemented +#pragma GCC diagnostic ignored "-Wunused-parameter" + +namespace android::hardware::radio::compat { + +Return RadioIndication::radioStateChanged(V1_0::RadioIndicationType type, + V1_0::RadioState radioState) { + return {}; +} + +Return RadioIndication::callStateChanged(V1_0::RadioIndicationType type) { + return {}; +} + +Return RadioIndication::networkStateChanged(V1_0::RadioIndicationType type) { + return {}; +} + +Return RadioIndication::nitzTimeReceived(V1_0::RadioIndicationType type, + const hidl_string& nitzTime, uint64_t receivedTime) { + return {}; +} + +Return RadioIndication::currentSignalStrength(V1_0::RadioIndicationType type, + const V1_0::SignalStrength& signalStrength) { + return {}; +} + +Return RadioIndication::dataCallListChanged( + V1_0::RadioIndicationType type, const hidl_vec& dcList) { + return {}; +} + +Return RadioIndication::suppSvcNotify(V1_0::RadioIndicationType type, + const V1_0::SuppSvcNotification& suppSvc) { + return {}; +} + +Return RadioIndication::stkSessionEnd(V1_0::RadioIndicationType type) { + return {}; +} + +Return RadioIndication::stkProactiveCommand(V1_0::RadioIndicationType type, + const hidl_string& cmd) { + return {}; +} + +Return RadioIndication::stkEventNotify(V1_0::RadioIndicationType type, + const hidl_string& cmd) { + return {}; +} + +Return RadioIndication::stkCallSetup(V1_0::RadioIndicationType type, int64_t timeout) { + return {}; +} + +Return RadioIndication::simRefresh(V1_0::RadioIndicationType type, + const V1_0::SimRefreshResult& refreshResult) { + return {}; +} + +Return RadioIndication::callRing(V1_0::RadioIndicationType type, bool isGsm, + const V1_0::CdmaSignalInfoRecord& record) { + return {}; +} + +Return RadioIndication::simStatusChanged(V1_0::RadioIndicationType type) { + return {}; +} + +Return RadioIndication::restrictedStateChanged(V1_0::RadioIndicationType type, + V1_0::PhoneRestrictedState state) { + return {}; +} + +Return RadioIndication::enterEmergencyCallbackMode(V1_0::RadioIndicationType type) { + return {}; +} + +Return RadioIndication::cdmaCallWaiting(V1_0::RadioIndicationType type, + const V1_0::CdmaCallWaiting& callWaitingRecord) { + return {}; +} + +Return RadioIndication::cdmaOtaProvisionStatus(V1_0::RadioIndicationType type, + V1_0::CdmaOtaProvisionStatus status) { + return {}; +} + +Return RadioIndication::cdmaInfoRec(V1_0::RadioIndicationType type, + const V1_0::CdmaInformationRecords& records) { + return {}; +} + +Return RadioIndication::indicateRingbackTone(V1_0::RadioIndicationType type, bool start) { + return {}; +} + +Return RadioIndication::resendIncallMute(V1_0::RadioIndicationType type) { + return {}; +} + +Return RadioIndication::cdmaSubscriptionSourceChanged( + V1_0::RadioIndicationType type, V1_0::CdmaSubscriptionSource cdmaSource) { + return {}; +} + +Return RadioIndication::cdmaPrlChanged(V1_0::RadioIndicationType type, int32_t version) { + return {}; +} + +Return RadioIndication::exitEmergencyCallbackMode(V1_0::RadioIndicationType type) { + return {}; +} + +Return RadioIndication::rilConnected(V1_0::RadioIndicationType type) { + return {}; +} + +Return RadioIndication::voiceRadioTechChanged(V1_0::RadioIndicationType type, + V1_0::RadioTechnology rat) { + return {}; +} + +Return RadioIndication::cellInfoList(V1_0::RadioIndicationType type, + const hidl_vec& records) { + return {}; +} + +Return RadioIndication::imsNetworkStateChanged(V1_0::RadioIndicationType type) { + return {}; +} + +Return RadioIndication::subscriptionStatusChanged(V1_0::RadioIndicationType type, + bool activate) { + return {}; +} + +Return RadioIndication::srvccStateNotify(V1_0::RadioIndicationType type, + V1_0::SrvccState state) { + return {}; +} + +Return RadioIndication::hardwareConfigChanged(V1_0::RadioIndicationType type, + const hidl_vec& configs) { + return {}; +} + +Return RadioIndication::radioCapabilityIndication(V1_0::RadioIndicationType type, + const V1_0::RadioCapability& rc) { + return {}; +} + +Return RadioIndication::onSupplementaryServiceIndication(V1_0::RadioIndicationType type, + const V1_0::StkCcUnsolSsResult& ss) { + return {}; +} + +Return RadioIndication::stkCallControlAlphaNotify(V1_0::RadioIndicationType type, + const hidl_string& alpha) { + return {}; +} + +Return RadioIndication::lceData(V1_0::RadioIndicationType type, + const V1_0::LceDataInfo& lce) { + return {}; +} + +Return RadioIndication::pcoData(V1_0::RadioIndicationType type, + const V1_0::PcoDataInfo& pco) { + return {}; +} + +Return RadioIndication::modemReset(V1_0::RadioIndicationType type, + const hidl_string& reason) { + return {}; +} + +Return RadioIndication::carrierInfoForImsiEncryption(V1_0::RadioIndicationType info) { + return {}; +} + +Return RadioIndication::networkScanResult(V1_0::RadioIndicationType type, + const V1_1::NetworkScanResult& result) { + return {}; +} + +Return RadioIndication::keepaliveStatus(V1_0::RadioIndicationType type, + const V1_1::KeepaliveStatus& status) { + return {}; +} + +Return RadioIndication::networkScanResult_1_2(V1_0::RadioIndicationType type, + const V1_2::NetworkScanResult& result) { + return {}; +} + +Return RadioIndication::cellInfoList_1_2(V1_0::RadioIndicationType type, + const hidl_vec& records) { + return {}; +} + +Return RadioIndication::currentLinkCapacityEstimate(V1_0::RadioIndicationType type, + const V1_2::LinkCapacityEstimate& lce) { + return {}; +} + +Return RadioIndication::currentPhysicalChannelConfigs( + V1_0::RadioIndicationType type, const hidl_vec& configs) { + return {}; +} + +Return RadioIndication::currentSignalStrength_1_2( + V1_0::RadioIndicationType type, const V1_2::SignalStrength& signalStrength) { + return {}; +} + +Return RadioIndication::currentEmergencyNumberList( + V1_0::RadioIndicationType type, const hidl_vec& emergencyNumbers) { + return {}; +} + +Return RadioIndication::cellInfoList_1_4(V1_0::RadioIndicationType type, + const hidl_vec& records) { + return {}; +} + +Return RadioIndication::networkScanResult_1_4(V1_0::RadioIndicationType type, + const V1_4::NetworkScanResult& result) { + return {}; +} + +Return RadioIndication::currentPhysicalChannelConfigs_1_4( + V1_0::RadioIndicationType type, const hidl_vec& configs) { + return {}; +} + +Return RadioIndication::dataCallListChanged_1_4( + V1_0::RadioIndicationType type, const hidl_vec& dcList) { + return {}; +} + +Return RadioIndication::currentSignalStrength_1_4( + V1_0::RadioIndicationType type, const V1_4::SignalStrength& signalStrength) { + return {}; +} + +Return RadioIndication::uiccApplicationsEnablementChanged(V1_0::RadioIndicationType type, + bool enabled) { + return {}; +} + +Return RadioIndication::registrationFailed( // + V1_0::RadioIndicationType type, const V1_5::CellIdentity& cellIdentity, + const hidl_string& chosenPlmn, hidl_bitfield domain, int32_t causeCode, + int32_t additionalCauseCode) { + return {}; +} + +Return RadioIndication::barringInfoChanged(V1_0::RadioIndicationType type, + const V1_5::CellIdentity& cellIdentity, + const hidl_vec& barringInfos) { + return {}; +} + +Return RadioIndication::cellInfoList_1_5(V1_0::RadioIndicationType type, + const hidl_vec& records) { + return {}; +} + +Return RadioIndication::networkScanResult_1_5(V1_0::RadioIndicationType type, + const V1_5::NetworkScanResult& result) { + return {}; +} + +Return RadioIndication::dataCallListChanged_1_5( + V1_0::RadioIndicationType type, const hidl_vec& dcList) { + return {}; +} + +Return RadioIndication::dataCallListChanged_1_6( + V1_0::RadioIndicationType type, const hidl_vec& dcList) { + return {}; +} + +Return RadioIndication::unthrottleApn(V1_0::RadioIndicationType type, + const hidl_string& apn) { + return {}; +} + +Return RadioIndication::currentLinkCapacityEstimate_1_6( + V1_0::RadioIndicationType type, const V1_6::LinkCapacityEstimate& lce) { + return {}; +} + +Return RadioIndication::currentSignalStrength_1_6( + V1_0::RadioIndicationType type, const V1_6::SignalStrength& signalStrength) { + return {}; +} + +Return RadioIndication::cellInfoList_1_6(V1_0::RadioIndicationType type, + const hidl_vec& records) { + return {}; +} + +Return RadioIndication::networkScanResult_1_6(V1_0::RadioIndicationType type, + const V1_6::NetworkScanResult& result) { + return {}; +} + +Return RadioIndication::currentPhysicalChannelConfigs_1_6( + V1_0::RadioIndicationType type, const hidl_vec& configs) { + return {}; +} + +Return RadioIndication::simPhonebookChanged(V1_0::RadioIndicationType type) { + return {}; +} + +Return RadioIndication::simPhonebookRecordsReceived( + V1_0::RadioIndicationType type, V1_6::PbReceivedStatus status, + const hidl_vec& records) { + return {}; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/RadioResponse.cpp b/radio/aidl/compat/libradiocompat/RadioResponse.cpp new file mode 100644 index 0000000000..15002a8490 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/RadioResponse.cpp @@ -0,0 +1,866 @@ +/* + * 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 + +#include "debug.h" + +// TODO(b/203699028): remove when fully implemented +#pragma GCC diagnostic ignored "-Wunused-parameter" + +#define RADIO_MODULE "Common" + +namespace android::hardware::radio::compat { + +Return RadioResponse::acknowledgeRequest(int32_t serial) { + LOG_CALL << serial; + if (mMessagingCb) mMessagingCb->acknowledgeRequest(serial); + return {}; +} + +Return RadioResponse::getIccCardStatusResponse(const V1_0::RadioResponseInfo& info, + const V1_0::CardStatus& cardStatus) { + return {}; +} + +Return RadioResponse::supplyIccPinForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) { + return {}; +} + +Return RadioResponse::supplyIccPukForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) { + return {}; +} + +Return RadioResponse::supplyIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) { + return {}; +} + +Return RadioResponse::supplyIccPuk2ForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) { + return {}; +} + +Return RadioResponse::changeIccPinForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) { + return {}; +} + +Return RadioResponse::changeIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) { + return {}; +} + +Return RadioResponse::supplyNetworkDepersonalizationResponse( + const V1_0::RadioResponseInfo& info, int32_t remainingRetries) { + return {}; +} + +Return RadioResponse::getCurrentCallsResponse(const V1_0::RadioResponseInfo& info, + const hidl_vec& calls) { + return {}; +} + +Return RadioResponse::dialResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getIMSIForAppResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& imsi) { + return {}; +} + +Return RadioResponse::hangupConnectionResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::hangupWaitingOrBackgroundResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::hangupForegroundResumeBackgroundResponse( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::switchWaitingOrHoldingAndActiveResponse( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::conferenceResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::rejectCallResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getLastCallFailCauseResponse( + const V1_0::RadioResponseInfo& info, const V1_0::LastCallFailCauseInfo& failCauseinfo) { + return {}; +} + +Return RadioResponse::getSignalStrengthResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SignalStrength& sigStrength) { + return {}; +} + +Return RadioResponse::getVoiceRegistrationStateResponse( + const V1_0::RadioResponseInfo& info, const V1_0::VoiceRegStateResult& voiceRegResponse) { + return {}; +} + +Return RadioResponse::getDataRegistrationStateResponse( + const V1_0::RadioResponseInfo& info, const V1_0::DataRegStateResult& dataRegResponse) { + return {}; +} + +Return RadioResponse::getOperatorResponse( // + const V1_0::RadioResponseInfo& info, const hidl_string& longName, + const hidl_string& shortName, const hidl_string& numeric) { + return {}; +} + +Return RadioResponse::setRadioPowerResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::sendDtmfResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setupDataCallResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SetupDataCallResult& dcResponse) { + return {}; +} + +Return RadioResponse::iccIOForAppResponse(const V1_0::RadioResponseInfo& info, + const V1_0::IccIoResult& iccIo) { + return {}; +} + +Return RadioResponse::getClirResponse(const V1_0::RadioResponseInfo& info, int32_t n, + int32_t m) { + return {}; +} + +Return RadioResponse::setClirResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getCallForwardStatusResponse( + const V1_0::RadioResponseInfo& info, const hidl_vec& callFwdInfos) { + return {}; +} + +Return RadioResponse::setCallForwardResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getCallWaitingResponse(const V1_0::RadioResponseInfo& info, bool enable, + int32_t serviceClass) { + return {}; +} + +Return RadioResponse::setCallWaitingResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::acceptCallResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::deactivateDataCallResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t response) { + return {}; +} + +Return RadioResponse::setFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t retry) { + return {}; +} + +Return RadioResponse::setBarringPasswordResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getNetworkSelectionModeResponse(const V1_0::RadioResponseInfo& info, + bool manual) { + return {}; +} + +Return RadioResponse::setNetworkSelectionModeAutomaticResponse( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setNetworkSelectionModeManualResponse( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getAvailableNetworksResponse( + const V1_0::RadioResponseInfo& info, const hidl_vec& networkInfos) { + return {}; +} + +Return RadioResponse::startDtmfResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::stopDtmfResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getBasebandVersionResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& version) { + return {}; +} + +Return RadioResponse::separateConnectionResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setMuteResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getMuteResponse(const V1_0::RadioResponseInfo& info, bool enable) { + return {}; +} + +Return RadioResponse::getClipResponse(const V1_0::RadioResponseInfo& info, + V1_0::ClipStatus status) { + return {}; +} + +Return RadioResponse::getDataCallListResponse( + const V1_0::RadioResponseInfo& info, const hidl_vec& dcResp) { + return {}; +} + +Return RadioResponse::setSuppServiceNotificationsResponse( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setBandModeResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getAvailableBandModesResponse( + const V1_0::RadioResponseInfo& info, const hidl_vec& bandModes) { + return {}; +} + +Return RadioResponse::sendEnvelopeResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& commandResponse) { + return {}; +} + +Return RadioResponse::sendTerminalResponseToSimResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::handleStkCallSetupRequestFromSimResponse( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::explicitCallTransferResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info, + V1_0::PreferredNetworkType nwType) { + return {}; +} + +Return RadioResponse::getNeighboringCidsResponse( + const V1_0::RadioResponseInfo& info, const hidl_vec& cells) { + return {}; +} + +Return RadioResponse::setLocationUpdatesResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info, + V1_0::CdmaRoamingType type) { + return {}; +} + +Return RadioResponse::setTTYModeResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getTTYModeResponse(const V1_0::RadioResponseInfo& info, + V1_0::TtyMode mode) { + return {}; +} + +Return RadioResponse::setPreferredVoicePrivacyResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getPreferredVoicePrivacyResponse(const V1_0::RadioResponseInfo& info, + bool enable) { + return {}; +} + +Return RadioResponse::sendCDMAFeatureCodeResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::sendBurstDtmfResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getCDMASubscriptionResponse( + const V1_0::RadioResponseInfo& info, const hidl_string& mdn, const hidl_string& hSid, + const hidl_string& hNid, const hidl_string& min, const hidl_string& prl) { + return {}; +} + +Return RadioResponse::getDeviceIdentityResponse( // + const V1_0::RadioResponseInfo& info, const hidl_string& imei, const hidl_string& imeisv, + const hidl_string& esn, const hidl_string& meid) { + return {}; +} + +Return RadioResponse::exitEmergencyCallbackModeResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::reportStkServiceIsRunningResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info, + V1_0::CdmaSubscriptionSource source) { + return {}; +} + +Return RadioResponse::requestIsimAuthenticationResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& response) { + return {}; +} + +Return RadioResponse::sendEnvelopeWithStatusResponse(const V1_0::RadioResponseInfo& info, + const V1_0::IccIoResult& iccIo) { + return {}; +} + +Return RadioResponse::getVoiceRadioTechnologyResponse(const V1_0::RadioResponseInfo& info, + V1_0::RadioTechnology rat) { + return {}; +} + +Return RadioResponse::getCellInfoListResponse(const V1_0::RadioResponseInfo& info, + const hidl_vec& cellInfo) { + return {}; +} + +Return RadioResponse::setCellInfoListRateResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setInitialAttachApnResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getImsRegistrationStateResponse( // + const V1_0::RadioResponseInfo& info, bool isRegd, V1_0::RadioTechnologyFamily ratFamily) { + return {}; +} + +Return RadioResponse::iccTransmitApduBasicChannelResponse(const V1_0::RadioResponseInfo& info, + const V1_0::IccIoResult& result) { + return {}; +} + +Return RadioResponse::iccOpenLogicalChannelResponse( // + const V1_0::RadioResponseInfo& info, int32_t chanId, const hidl_vec& selectResp) { + return {}; +} + +Return RadioResponse::iccCloseLogicalChannelResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::iccTransmitApduLogicalChannelResponse( + const V1_0::RadioResponseInfo& info, const V1_0::IccIoResult& result) { + return {}; +} + +Return RadioResponse::nvReadItemResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& result) { + return {}; +} + +Return RadioResponse::nvWriteItemResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::nvWriteCdmaPrlResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::nvResetConfigResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setUiccSubscriptionResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setDataAllowedResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getHardwareConfigResponse( + const V1_0::RadioResponseInfo& info, const hidl_vec& config) { + return {}; +} + +Return RadioResponse::requestIccSimAuthenticationResponse(const V1_0::RadioResponseInfo& info, + const V1_0::IccIoResult& result) { + return {}; +} + +Return RadioResponse::setDataProfileResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::requestShutdownResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getRadioCapabilityResponse(const V1_0::RadioResponseInfo& info, + const V1_0::RadioCapability& rc) { + return {}; +} + +Return RadioResponse::setRadioCapabilityResponse(const V1_0::RadioResponseInfo& info, + const V1_0::RadioCapability& rc) { + return {}; +} + +Return RadioResponse::startLceServiceResponse(const V1_0::RadioResponseInfo& info, + const V1_0::LceStatusInfo& statusInfo) { + return {}; +} + +Return RadioResponse::stopLceServiceResponse(const V1_0::RadioResponseInfo& info, + const V1_0::LceStatusInfo& statusInfo) { + return {}; +} + +Return RadioResponse::pullLceDataResponse(const V1_0::RadioResponseInfo& info, + const V1_0::LceDataInfo& lceInfo) { + return {}; +} + +Return RadioResponse::getModemActivityInfoResponse( + const V1_0::RadioResponseInfo& info, const V1_0::ActivityStatsInfo& activityInfo) { + return {}; +} + +Return RadioResponse::setAllowedCarriersResponse(const V1_0::RadioResponseInfo& info, + int32_t numAllowed) { + return {}; +} + +Return RadioResponse::getAllowedCarriersResponse( // + const V1_0::RadioResponseInfo& info, bool allAllowed, const V1_0::CarrierRestrictions& cr) { + return {}; +} + +Return RadioResponse::sendDeviceStateResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setIndicationFilterResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setSimCardPowerResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setCarrierInfoForImsiEncryptionResponse( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setSimCardPowerResponse_1_1(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::startNetworkScanResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::stopNetworkScanResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::startKeepaliveResponse(const V1_0::RadioResponseInfo& info, + const V1_1::KeepaliveStatus& status) { + return {}; +} + +Return RadioResponse::stopKeepaliveResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getCellInfoListResponse_1_2(const V1_0::RadioResponseInfo& info, + const hidl_vec& cellInfo) { + return {}; +} + +Return RadioResponse::getIccCardStatusResponse_1_2(const V1_0::RadioResponseInfo& info, + const V1_2::CardStatus& cardStatus) { + return {}; +} + +Return RadioResponse::setSignalStrengthReportingCriteriaResponse( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setLinkCapacityReportingCriteriaResponse( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getCurrentCallsResponse_1_2(const V1_0::RadioResponseInfo& info, + const hidl_vec& calls) { + return {}; +} + +Return RadioResponse::getSignalStrengthResponse_1_2( + const V1_0::RadioResponseInfo& info, const V1_2::SignalStrength& signalStrength) { + return {}; +} + +Return RadioResponse::getVoiceRegistrationStateResponse_1_2( + const V1_0::RadioResponseInfo& info, const V1_2::VoiceRegStateResult& voiceRegResponse) { + return {}; +} + +Return RadioResponse::getDataRegistrationStateResponse_1_2( + const V1_0::RadioResponseInfo& info, const V1_2::DataRegStateResult& dataRegResponse) { + return {}; +} + +Return RadioResponse::setSystemSelectionChannelsResponse( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::enableModemResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getModemStackStatusResponse(const V1_0::RadioResponseInfo& info, + bool isEnabled) { + return {}; +} + +Return RadioResponse::emergencyDialResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::startNetworkScanResponse_1_4(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getCellInfoListResponse_1_4(const V1_0::RadioResponseInfo& info, + const hidl_vec& cellInfo) { + return {}; +} + +Return RadioResponse::getDataRegistrationStateResponse_1_4( + const V1_0::RadioResponseInfo& info, const V1_4::DataRegStateResult& dataRegResponse) { + return {}; +} + +Return RadioResponse::getIccCardStatusResponse_1_4(const V1_0::RadioResponseInfo& info, + const V1_4::CardStatus& cardStatus) { + return {}; +} + +Return RadioResponse::getPreferredNetworkTypeBitmapResponse( + const V1_0::RadioResponseInfo& info, + hidl_bitfield networkTypeBitmap) { + return {}; +} + +Return RadioResponse::setPreferredNetworkTypeBitmapResponse( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getDataCallListResponse_1_4( + const V1_0::RadioResponseInfo& info, + const hidl_vec& dcResponse) { + return {}; +} + +Return RadioResponse::setupDataCallResponse_1_4(const V1_0::RadioResponseInfo& info, + const V1_4::SetupDataCallResult& dcResponse) { + return {}; +} + +Return RadioResponse::setAllowedCarriersResponse_1_4(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getAllowedCarriersResponse_1_4( + const V1_0::RadioResponseInfo& info, const V1_4::CarrierRestrictionsWithPriority& carriers, + V1_4::SimLockMultiSimPolicy multiSimPolicy) { + return {}; +} + +Return RadioResponse::getSignalStrengthResponse_1_4( + const V1_0::RadioResponseInfo& info, const V1_4::SignalStrength& signalStrength) { + return {}; +} + +Return RadioResponse::setSignalStrengthReportingCriteriaResponse_1_5( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setLinkCapacityReportingCriteriaResponse_1_5( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::enableUiccApplicationsResponse(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::areUiccApplicationsEnabledResponse(const V1_0::RadioResponseInfo& info, + bool enabled) { + return {}; +} + +Return RadioResponse::setSystemSelectionChannelsResponse_1_5( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::startNetworkScanResponse_1_5(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setupDataCallResponse_1_5(const V1_0::RadioResponseInfo& info, + const V1_5::SetupDataCallResult& dcResponse) { + return {}; +} + +Return RadioResponse::getDataCallListResponse_1_5( + const V1_0::RadioResponseInfo& info, + const hidl_vec& dcResponse) { + return {}; +} + +Return RadioResponse::setInitialAttachApnResponse_1_5(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setDataProfileResponse_1_5(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setRadioPowerResponse_1_5(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setIndicationFilterResponse_1_5(const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getBarringInfoResponse( + const V1_0::RadioResponseInfo& info, const V1_5::CellIdentity& cellIdentity, + const hidl_vec& barringInfos) { + return {}; +} + +Return RadioResponse::getVoiceRegistrationStateResponse_1_5( + const V1_0::RadioResponseInfo& info, const V1_5::RegStateResult& voiceRegResponse) { + return {}; +} + +Return RadioResponse::getDataRegistrationStateResponse_1_5( + const V1_0::RadioResponseInfo& info, const V1_5::RegStateResult& dataRegResponse) { + return {}; +} + +Return RadioResponse::getCellInfoListResponse_1_5(const V1_0::RadioResponseInfo& info, + const hidl_vec& cellInfo) { + return {}; +} + +Return RadioResponse::setNetworkSelectionModeManualResponse_1_5( + const V1_0::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::supplySimDepersonalizationResponse(const V1_0::RadioResponseInfo& info, + V1_5::PersoSubstate persoType, + int32_t remainingRetries) { + return {}; +} + +Return RadioResponse::getIccCardStatusResponse_1_5(const V1_0::RadioResponseInfo& info, + const V1_5::CardStatus& cardStatus) { + return {}; +} + +Return RadioResponse::setRadioPowerResponse_1_6(const V1_6::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setupDataCallResponse_1_6(const V1_6::RadioResponseInfo& info, + const V1_6::SetupDataCallResult& dcResponse) { + return {}; +} + +Return RadioResponse::getDataCallListResponse_1_6( + const V1_6::RadioResponseInfo& info, + const hidl_vec& dcResponse) { + return {}; +} + +Return RadioResponse::setSimCardPowerResponse_1_6(const V1_6::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setNrDualConnectivityStateResponse( + const V1_6::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::isNrDualConnectivityEnabledResponse(const V1_6::RadioResponseInfo& info, + bool isEnabled) { + return {}; +} + +Return RadioResponse::allocatePduSessionIdResponse(const V1_6::RadioResponseInfo& info, + int32_t id) { + return {}; +} + +Return RadioResponse::releasePduSessionIdResponse(const V1_6::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::startHandoverResponse(const V1_6::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::cancelHandoverResponse(const V1_6::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::setAllowedNetworkTypesBitmapResponse( + const V1_6::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getAllowedNetworkTypesBitmapResponse( + const V1_6::RadioResponseInfo& info, + hidl_bitfield networkTypeBitmap) { + return {}; +} + +Return RadioResponse::setDataThrottlingResponse(const V1_6::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getSystemSelectionChannelsResponse( + const V1_6::RadioResponseInfo& info, + const hidl_vec& specifiers) { + return {}; +} + +Return RadioResponse::getCellInfoListResponse_1_6(const V1_6::RadioResponseInfo& info, + const hidl_vec& cellInfo) { + return {}; +} + +Return RadioResponse::getSignalStrengthResponse_1_6( + const V1_6::RadioResponseInfo& info, const V1_6::SignalStrength& signalStrength) { + return {}; +} + +Return RadioResponse::getVoiceRegistrationStateResponse_1_6( + const V1_6::RadioResponseInfo& info, const V1_6::RegStateResult& voiceRegResponse) { + return {}; +} + +Return RadioResponse::getDataRegistrationStateResponse_1_6( + const V1_6::RadioResponseInfo& info, const V1_6::RegStateResult& dataRegResponse) { + return {}; +} + +Return RadioResponse::getCurrentCallsResponse_1_6(const V1_6::RadioResponseInfo& info, + const hidl_vec& calls) { + return {}; +} + +Return RadioResponse::getSlicingConfigResponse(const V1_6::RadioResponseInfo& info, + const V1_6::SlicingConfig& slicingConfig) { + return {}; +} + +Return RadioResponse::getSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info) { + return {}; +} + +Return RadioResponse::getSimPhonebookCapacityResponse( + const V1_6::RadioResponseInfo& info, const V1_6::PhonebookCapacity& capacity) { + return {}; +} + +Return RadioResponse::updateSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info, + int32_t updatedRecordIndex) { + return {}; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/debug.h b/radio/aidl/compat/libradiocompat/debug.h index cb773bf27d..4158059f88 100644 --- a/radio/aidl/compat/libradiocompat/debug.h +++ b/radio/aidl/compat/libradiocompat/debug.h @@ -26,6 +26,12 @@ static constexpr bool kSuperVerbose = true; #define LOG_CALL \ if constexpr (debug::kSuperVerbose) LOG(VERBOSE) << (RADIO_MODULE ".") << __func__ << ' ' +#define CHECK_CB(field) \ + if (!field) { \ + LOG(WARNING) << "Callback not set"; \ + return {}; \ + } + } // namespace debug inline std::ostream& operator<<(std::ostream& os, const V1_0::RadioIndicationType& type) { diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h new file mode 100644 index 0000000000..a412c34abc --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h @@ -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. + */ +#pragma once + +#include "RadioIndication.h" +#include "RadioResponse.h" + +#include + +namespace android::hardware::radio::compat { + +class RadioCompatBase { + protected: + sp mHal1_5; + sp mHal1_6; + + sp mRadioResponse; + sp mRadioIndication; + + V1_6::IRadioResponse& respond(); + + public: + RadioCompatBase(sp hidlHal, sp radioResponse, + sp radioIndication); +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h new file mode 100644 index 0000000000..991ae0637e --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h @@ -0,0 +1,179 @@ +/* + * 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 +#include + +namespace android::hardware::radio::compat { + +class RadioIndication : public V1_6::IRadioIndication { + std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> + mMessagingCb; + + // IRadioIndication @ 1.0 + Return radioStateChanged(V1_0::RadioIndicationType type, + V1_0::RadioState radioState) override; + Return callStateChanged(V1_0::RadioIndicationType type) override; + Return networkStateChanged(V1_0::RadioIndicationType type) override; + Return newSms(V1_0::RadioIndicationType type, const hidl_vec& pdu) override; + Return newSmsStatusReport(V1_0::RadioIndicationType type, + const hidl_vec& pdu) override; + Return newSmsOnSim(V1_0::RadioIndicationType type, int32_t recordNumber) override; + Return onUssd(V1_0::RadioIndicationType type, V1_0::UssdModeType modeType, + const hidl_string& msg) override; + Return nitzTimeReceived(V1_0::RadioIndicationType type, const hidl_string& nitzTime, + uint64_t receivedTime) override; + Return currentSignalStrength(V1_0::RadioIndicationType type, + const V1_0::SignalStrength& signalStrength) override; + Return dataCallListChanged(V1_0::RadioIndicationType type, + const hidl_vec& dcList) override; + Return suppSvcNotify(V1_0::RadioIndicationType type, + const V1_0::SuppSvcNotification& suppSvc) override; + Return stkSessionEnd(V1_0::RadioIndicationType type) override; + Return stkProactiveCommand(V1_0::RadioIndicationType type, + const hidl_string& cmd) override; + Return stkEventNotify(V1_0::RadioIndicationType type, const hidl_string& cmd) override; + Return stkCallSetup(V1_0::RadioIndicationType type, int64_t timeout) override; + Return simSmsStorageFull(V1_0::RadioIndicationType type) override; + Return simRefresh(V1_0::RadioIndicationType type, + const V1_0::SimRefreshResult& refreshResult) override; + Return callRing(V1_0::RadioIndicationType type, bool isGsm, + const V1_0::CdmaSignalInfoRecord& record) override; + Return simStatusChanged(V1_0::RadioIndicationType type) override; + Return cdmaNewSms(V1_0::RadioIndicationType type, + const V1_0::CdmaSmsMessage& msg) override; + Return newBroadcastSms(V1_0::RadioIndicationType type, + const hidl_vec& data) override; + Return cdmaRuimSmsStorageFull(V1_0::RadioIndicationType type) override; + Return restrictedStateChanged(V1_0::RadioIndicationType type, + V1_0::PhoneRestrictedState state) override; + Return enterEmergencyCallbackMode(V1_0::RadioIndicationType type) override; + Return cdmaCallWaiting(V1_0::RadioIndicationType type, + const V1_0::CdmaCallWaiting& callWaitingRecord) override; + Return cdmaOtaProvisionStatus(V1_0::RadioIndicationType type, + V1_0::CdmaOtaProvisionStatus status) override; + Return cdmaInfoRec(V1_0::RadioIndicationType type, + const V1_0::CdmaInformationRecords& records) override; + Return indicateRingbackTone(V1_0::RadioIndicationType type, bool start) override; + Return resendIncallMute(V1_0::RadioIndicationType type) override; + Return cdmaSubscriptionSourceChanged(V1_0::RadioIndicationType type, + V1_0::CdmaSubscriptionSource cdmaSource) override; + Return cdmaPrlChanged(V1_0::RadioIndicationType type, int32_t version) override; + Return exitEmergencyCallbackMode(V1_0::RadioIndicationType type) override; + Return rilConnected(V1_0::RadioIndicationType type) override; + Return voiceRadioTechChanged(V1_0::RadioIndicationType type, + V1_0::RadioTechnology rat) override; + Return cellInfoList(V1_0::RadioIndicationType type, + const hidl_vec& records) override; + Return imsNetworkStateChanged(V1_0::RadioIndicationType type) override; + Return subscriptionStatusChanged(V1_0::RadioIndicationType type, bool activate) override; + Return srvccStateNotify(V1_0::RadioIndicationType type, V1_0::SrvccState state) override; + Return hardwareConfigChanged(V1_0::RadioIndicationType type, + const hidl_vec& configs) override; + Return radioCapabilityIndication(V1_0::RadioIndicationType type, + const V1_0::RadioCapability& rc) override; + Return onSupplementaryServiceIndication(V1_0::RadioIndicationType type, + const V1_0::StkCcUnsolSsResult& ss) override; + Return stkCallControlAlphaNotify(V1_0::RadioIndicationType type, + const hidl_string& alpha) override; + Return lceData(V1_0::RadioIndicationType type, const V1_0::LceDataInfo& lce) override; + Return pcoData(V1_0::RadioIndicationType type, const V1_0::PcoDataInfo& pco) override; + Return modemReset(V1_0::RadioIndicationType type, const hidl_string& reason) override; + + // IRadioIndication @ 1.1 + Return carrierInfoForImsiEncryption(V1_0::RadioIndicationType info) override; + Return networkScanResult(V1_0::RadioIndicationType type, + const V1_1::NetworkScanResult& result) override; + Return keepaliveStatus(V1_0::RadioIndicationType type, + const V1_1::KeepaliveStatus& status) override; + + // IRadioIndication @ 1.2 + Return networkScanResult_1_2(V1_0::RadioIndicationType type, + const V1_2::NetworkScanResult& result) override; + Return cellInfoList_1_2(V1_0::RadioIndicationType type, + const hidl_vec& records) override; + Return currentLinkCapacityEstimate(V1_0::RadioIndicationType type, + const V1_2::LinkCapacityEstimate& lce) override; + Return currentPhysicalChannelConfigs( + V1_0::RadioIndicationType type, + const hidl_vec& configs) override; + Return currentSignalStrength_1_2(V1_0::RadioIndicationType type, + const V1_2::SignalStrength& signalStrength) override; + + // IRadioIndication @ 1.4 + Return currentEmergencyNumberList( + V1_0::RadioIndicationType type, + const hidl_vec& emergencyNumberList) override; + Return cellInfoList_1_4(V1_0::RadioIndicationType type, + const hidl_vec& records) override; + Return networkScanResult_1_4(V1_0::RadioIndicationType type, + const V1_4::NetworkScanResult& result) override; + Return currentPhysicalChannelConfigs_1_4( + V1_0::RadioIndicationType type, + const hidl_vec& configs) override; + Return dataCallListChanged_1_4( + V1_0::RadioIndicationType type, + const hidl_vec& dcList) override; + Return currentSignalStrength_1_4(V1_0::RadioIndicationType type, + const V1_4::SignalStrength& signalStrength) override; + + // IRadioIndication @ 1.5 + Return uiccApplicationsEnablementChanged(V1_0::RadioIndicationType type, + bool enabled) override; + Return registrationFailed( // + V1_0::RadioIndicationType type, const V1_5::CellIdentity& cellIdentity, + const hidl_string& chosenPlmn, hidl_bitfield domain, int32_t causeCode, + int32_t additionalCauseCode) override; + Return barringInfoChanged( // + V1_0::RadioIndicationType type, const V1_5::CellIdentity& cellIdentity, + const hidl_vec& barringInfos) override; + Return cellInfoList_1_5(V1_0::RadioIndicationType type, + const hidl_vec& records) override; + Return networkScanResult_1_5(V1_0::RadioIndicationType type, + const V1_5::NetworkScanResult& result) override; + Return dataCallListChanged_1_5( + V1_0::RadioIndicationType type, + const hidl_vec& dcList) override; + + // IRadioIndication @ 1.6 + Return dataCallListChanged_1_6( + V1_0::RadioIndicationType type, + const hidl_vec& dcList) override; + Return unthrottleApn(V1_0::RadioIndicationType type, const hidl_string& apn) override; + Return currentLinkCapacityEstimate_1_6(V1_0::RadioIndicationType type, + const V1_6::LinkCapacityEstimate& lce) override; + Return currentSignalStrength_1_6(V1_0::RadioIndicationType type, + const V1_6::SignalStrength& signalStrength) override; + Return cellInfoList_1_6(V1_0::RadioIndicationType type, + const hidl_vec& records) override; + Return networkScanResult_1_6(V1_0::RadioIndicationType type, + const V1_6::NetworkScanResult& result) override; + Return currentPhysicalChannelConfigs_1_6( + V1_0::RadioIndicationType type, + const hidl_vec& configs) override; + Return simPhonebookChanged(V1_0::RadioIndicationType type) override; + Return simPhonebookRecordsReceived( + V1_0::RadioIndicationType type, V1_6::PbReceivedStatus status, + const hidl_vec& records) override; + + public: + void setResponseFunction( + std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> + radioMessagingIndication); +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h new file mode 100644 index 0000000000..0cd3381983 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h @@ -0,0 +1,89 @@ +/* + * 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 "RadioCompatBase.h" + +#include + +namespace android::hardware::radio::compat { + +class RadioMessaging : public RadioCompatBase, + public aidl::android::hardware::radio::messaging::BnRadioMessaging { + ::ndk::ScopedAStatus acknowledgeIncomingGsmSmsWithPdu(int32_t serial, bool success, + const std::string& ackPdu) override; + ::ndk::ScopedAStatus acknowledgeLastIncomingCdmaSms( + int32_t serial, + const ::aidl::android::hardware::radio::messaging::CdmaSmsAck& smsAck) override; + ::ndk::ScopedAStatus acknowledgeLastIncomingGsmSms( + int32_t serial, bool success, + ::aidl::android::hardware::radio::messaging::SmsAcknowledgeFailCause cause) override; + ::ndk::ScopedAStatus cancelPendingUssd(int32_t serial) override; + ::ndk::ScopedAStatus deleteSmsOnRuim(int32_t serial, int32_t index) override; + ::ndk::ScopedAStatus deleteSmsOnSim(int32_t serial, int32_t index) override; + ::ndk::ScopedAStatus getCdmaBroadcastConfig(int32_t serial) override; + ::ndk::ScopedAStatus getGsmBroadcastConfig(int32_t serial) override; + ::ndk::ScopedAStatus getSmscAddress(int32_t serial) override; + ::ndk::ScopedAStatus reportSmsMemoryStatus(int32_t serial, bool available) override; + ::ndk::ScopedAStatus responseAcknowledgement() override; + ::ndk::ScopedAStatus sendCdmaSms( + int32_t serial, + const ::aidl::android::hardware::radio::messaging::CdmaSmsMessage& sms) override; + ::ndk::ScopedAStatus sendCdmaSmsExpectMore( + int32_t serial, + const ::aidl::android::hardware::radio::messaging::CdmaSmsMessage& sms) override; + ::ndk::ScopedAStatus sendImsSms( + int32_t serial, + const ::aidl::android::hardware::radio::messaging::ImsSmsMessage& message) override; + ::ndk::ScopedAStatus sendSms( + int32_t serial, + const ::aidl::android::hardware::radio::messaging::GsmSmsMessage& message) override; + ::ndk::ScopedAStatus sendSmsExpectMore( + int32_t serial, + const ::aidl::android::hardware::radio::messaging::GsmSmsMessage& message) override; + ::ndk::ScopedAStatus sendUssd(int32_t serial, const std::string& ussd) override; + ::ndk::ScopedAStatus setCdmaBroadcastActivation(int32_t serial, bool activate) override; + ::ndk::ScopedAStatus setCdmaBroadcastConfig( + int32_t serial, + const std::vector< + ::aidl::android::hardware::radio::messaging::CdmaBroadcastSmsConfigInfo>& + configInfo) override; + ::ndk::ScopedAStatus setGsmBroadcastActivation(int32_t serial, bool activate) override; + ::ndk::ScopedAStatus setGsmBroadcastConfig( + int32_t serial, + const std::vector< + ::aidl::android::hardware::radio::messaging::GsmBroadcastSmsConfigInfo>& + configInfo) override; + ::ndk::ScopedAStatus setResponseFunctions( + const std::shared_ptr< + ::aidl::android::hardware::radio::messaging::IRadioMessagingResponse>& + radioMessagingResponse, + const std::shared_ptr< + ::aidl::android::hardware::radio::messaging::IRadioMessagingIndication>& + radioMessagingIndication) override; + ::ndk::ScopedAStatus setSmscAddress(int32_t serial, const std::string& smsc) override; + ::ndk::ScopedAStatus writeSmsToRuim( + int32_t serial, + const ::aidl::android::hardware::radio::messaging::CdmaSmsWriteArgs& cdmaSms) override; + ::ndk::ScopedAStatus writeSmsToSim( + int32_t serial, + const ::aidl::android::hardware::radio::messaging::SmsWriteArgs& smsWriteArgs) override; + + public: + using RadioCompatBase::RadioCompatBase; +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h new file mode 100644 index 0000000000..121cc45687 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h @@ -0,0 +1,407 @@ +/* + * 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 +#include + +namespace android::hardware::radio::compat { + +class RadioResponse : public V1_6::IRadioResponse { + std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> + mMessagingCb; + + // IRadioResponse @ 1.0 + Return getIccCardStatusResponse(const V1_0::RadioResponseInfo& info, + const V1_0::CardStatus& cardStatus) override; + Return supplyIccPinForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) override; + Return supplyIccPukForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) override; + Return supplyIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) override; + Return supplyIccPuk2ForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) override; + Return changeIccPinForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) override; + Return changeIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) override; + Return supplyNetworkDepersonalizationResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) override; + Return getCurrentCallsResponse(const V1_0::RadioResponseInfo& info, + const hidl_vec& calls) override; + Return dialResponse(const V1_0::RadioResponseInfo& info) override; + Return getIMSIForAppResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& imsi) override; + Return hangupConnectionResponse(const V1_0::RadioResponseInfo& info) override; + Return hangupWaitingOrBackgroundResponse(const V1_0::RadioResponseInfo& info) override; + Return hangupForegroundResumeBackgroundResponse( + const V1_0::RadioResponseInfo& info) override; + Return switchWaitingOrHoldingAndActiveResponse( + const V1_0::RadioResponseInfo& info) override; + Return conferenceResponse(const V1_0::RadioResponseInfo& info) override; + Return rejectCallResponse(const V1_0::RadioResponseInfo& info) override; + Return getLastCallFailCauseResponse( + const V1_0::RadioResponseInfo& info, + const V1_0::LastCallFailCauseInfo& failCauseinfo) override; + Return getSignalStrengthResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SignalStrength& sigStrength) override; + Return getVoiceRegistrationStateResponse( + const V1_0::RadioResponseInfo& info, + const V1_0::VoiceRegStateResult& voiceRegResponse) override; + Return getDataRegistrationStateResponse( + const V1_0::RadioResponseInfo& info, + const V1_0::DataRegStateResult& dataRegResponse) override; + Return getOperatorResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& longName, const hidl_string& shortName, + const hidl_string& numeric) override; + Return setRadioPowerResponse(const V1_0::RadioResponseInfo& info) override; + Return sendDtmfResponse(const V1_0::RadioResponseInfo& info) override; + Return sendSmsResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) override; + Return sendSMSExpectMoreResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) override; + Return setupDataCallResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SetupDataCallResult& dcResponse) override; + Return iccIOForAppResponse(const V1_0::RadioResponseInfo& info, + const V1_0::IccIoResult& iccIo) override; + Return sendUssdResponse(const V1_0::RadioResponseInfo& info) override; + Return cancelPendingUssdResponse(const V1_0::RadioResponseInfo& info) override; + Return getClirResponse(const V1_0::RadioResponseInfo& info, int32_t n, + int32_t m) override; + Return setClirResponse(const V1_0::RadioResponseInfo& info) override; + Return getCallForwardStatusResponse( + const V1_0::RadioResponseInfo& info, + const hidl_vec& callForwardInfos) override; + Return setCallForwardResponse(const V1_0::RadioResponseInfo& info) override; + Return getCallWaitingResponse(const V1_0::RadioResponseInfo& info, bool enable, + int32_t serviceClass) override; + Return setCallWaitingResponse(const V1_0::RadioResponseInfo& info) override; + Return acknowledgeLastIncomingGsmSmsResponse( + const V1_0::RadioResponseInfo& info) override; + Return acceptCallResponse(const V1_0::RadioResponseInfo& info) override; + Return deactivateDataCallResponse(const V1_0::RadioResponseInfo& info) override; + Return getFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t response) override; + Return setFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t retry) override; + Return setBarringPasswordResponse(const V1_0::RadioResponseInfo& info) override; + Return getNetworkSelectionModeResponse(const V1_0::RadioResponseInfo& info, + bool manual) override; + Return setNetworkSelectionModeAutomaticResponse( + const V1_0::RadioResponseInfo& info) override; + Return setNetworkSelectionModeManualResponse( + const V1_0::RadioResponseInfo& info) override; + Return getAvailableNetworksResponse( + const V1_0::RadioResponseInfo& info, + const hidl_vec& networkInfos) override; + Return startDtmfResponse(const V1_0::RadioResponseInfo& info) override; + Return stopDtmfResponse(const V1_0::RadioResponseInfo& info) override; + Return getBasebandVersionResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& version) override; + Return separateConnectionResponse(const V1_0::RadioResponseInfo& info) override; + Return setMuteResponse(const V1_0::RadioResponseInfo& info) override; + Return getMuteResponse(const V1_0::RadioResponseInfo& info, bool enable) override; + Return getClipResponse(const V1_0::RadioResponseInfo& info, + V1_0::ClipStatus status) override; + Return getDataCallListResponse( + const V1_0::RadioResponseInfo& info, + const hidl_vec& dcResponse) override; + Return setSuppServiceNotificationsResponse(const V1_0::RadioResponseInfo& info) override; + Return writeSmsToSimResponse(const V1_0::RadioResponseInfo& info, int32_t index) override; + Return deleteSmsOnSimResponse(const V1_0::RadioResponseInfo& info) override; + Return setBandModeResponse(const V1_0::RadioResponseInfo& info) override; + Return getAvailableBandModesResponse( + const V1_0::RadioResponseInfo& info, + const hidl_vec& bandModes) override; + Return sendEnvelopeResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& commandResponse) override; + Return sendTerminalResponseToSimResponse(const V1_0::RadioResponseInfo& info) override; + Return handleStkCallSetupRequestFromSimResponse( + const V1_0::RadioResponseInfo& info) override; + Return explicitCallTransferResponse(const V1_0::RadioResponseInfo& info) override; + Return setPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info) override; + Return getPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info, + V1_0::PreferredNetworkType nwType) override; + Return getNeighboringCidsResponse(const V1_0::RadioResponseInfo& info, + const hidl_vec& cells) override; + Return setLocationUpdatesResponse(const V1_0::RadioResponseInfo& info) override; + Return setCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info) override; + Return setCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info) override; + Return getCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info, + V1_0::CdmaRoamingType type) override; + Return setTTYModeResponse(const V1_0::RadioResponseInfo& info) override; + Return getTTYModeResponse(const V1_0::RadioResponseInfo& info, + V1_0::TtyMode mode) override; + Return setPreferredVoicePrivacyResponse(const V1_0::RadioResponseInfo& info) override; + Return getPreferredVoicePrivacyResponse(const V1_0::RadioResponseInfo& info, + bool enable) override; + Return sendCDMAFeatureCodeResponse(const V1_0::RadioResponseInfo& info) override; + Return sendBurstDtmfResponse(const V1_0::RadioResponseInfo& info) override; + Return sendCdmaSmsResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) override; + Return acknowledgeLastIncomingCdmaSmsResponse( + const V1_0::RadioResponseInfo& info) override; + Return getGsmBroadcastConfigResponse( + const V1_0::RadioResponseInfo& info, + const hidl_vec& configs) override; + Return setGsmBroadcastConfigResponse(const V1_0::RadioResponseInfo& info) override; + Return setGsmBroadcastActivationResponse(const V1_0::RadioResponseInfo& info) override; + Return getCdmaBroadcastConfigResponse( + const V1_0::RadioResponseInfo& info, + const hidl_vec& configs) override; + Return setCdmaBroadcastConfigResponse(const V1_0::RadioResponseInfo& info) override; + Return setCdmaBroadcastActivationResponse(const V1_0::RadioResponseInfo& info) override; + Return getCDMASubscriptionResponse( // + const V1_0::RadioResponseInfo& info, const hidl_string& mdn, const hidl_string& hSid, + const hidl_string& hNid, const hidl_string& min, const hidl_string& prl) override; + Return writeSmsToRuimResponse(const V1_0::RadioResponseInfo& info, + uint32_t index) override; + Return deleteSmsOnRuimResponse(const V1_0::RadioResponseInfo& info) override; + Return getDeviceIdentityResponse( // + const V1_0::RadioResponseInfo& info, const hidl_string& imei, const hidl_string& imeisv, + const hidl_string& esn, const hidl_string& meid) override; + Return exitEmergencyCallbackModeResponse(const V1_0::RadioResponseInfo& info) override; + Return getSmscAddressResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& smsc) override; + Return setSmscAddressResponse(const V1_0::RadioResponseInfo& info) override; + Return reportSmsMemoryStatusResponse(const V1_0::RadioResponseInfo& info) override; + Return reportStkServiceIsRunningResponse(const V1_0::RadioResponseInfo& info) override; + Return getCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info, + V1_0::CdmaSubscriptionSource source) override; + Return requestIsimAuthenticationResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& response) override; + Return acknowledgeIncomingGsmSmsWithPduResponse( + const V1_0::RadioResponseInfo& info) override; + Return sendEnvelopeWithStatusResponse(const V1_0::RadioResponseInfo& info, + const V1_0::IccIoResult& iccIo) override; + Return getVoiceRadioTechnologyResponse(const V1_0::RadioResponseInfo& info, + V1_0::RadioTechnology rat) override; + Return getCellInfoListResponse(const V1_0::RadioResponseInfo& info, + const hidl_vec& cellInfo) override; + Return setCellInfoListRateResponse(const V1_0::RadioResponseInfo& info) override; + Return setInitialAttachApnResponse(const V1_0::RadioResponseInfo& info) override; + Return getImsRegistrationStateResponse(const V1_0::RadioResponseInfo& info, + bool isRegistered, + V1_0::RadioTechnologyFamily ratFamily) override; + Return sendImsSmsResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) override; + Return iccTransmitApduBasicChannelResponse(const V1_0::RadioResponseInfo& info, + const V1_0::IccIoResult& result) override; + Return iccOpenLogicalChannelResponse(const V1_0::RadioResponseInfo& info, + int32_t channelId, + const hidl_vec& selectResponse) override; + Return iccCloseLogicalChannelResponse(const V1_0::RadioResponseInfo& info) override; + Return iccTransmitApduLogicalChannelResponse(const V1_0::RadioResponseInfo& info, + const V1_0::IccIoResult& result) override; + Return nvReadItemResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& result) override; + Return nvWriteItemResponse(const V1_0::RadioResponseInfo& info) override; + Return nvWriteCdmaPrlResponse(const V1_0::RadioResponseInfo& info) override; + Return nvResetConfigResponse(const V1_0::RadioResponseInfo& info) override; + Return setUiccSubscriptionResponse(const V1_0::RadioResponseInfo& info) override; + Return setDataAllowedResponse(const V1_0::RadioResponseInfo& info) override; + Return getHardwareConfigResponse(const V1_0::RadioResponseInfo& info, + const hidl_vec& config) override; + Return requestIccSimAuthenticationResponse(const V1_0::RadioResponseInfo& info, + const V1_0::IccIoResult& result) override; + Return setDataProfileResponse(const V1_0::RadioResponseInfo& info) override; + Return requestShutdownResponse(const V1_0::RadioResponseInfo& info) override; + Return getRadioCapabilityResponse(const V1_0::RadioResponseInfo& info, + const V1_0::RadioCapability& rc) override; + Return setRadioCapabilityResponse(const V1_0::RadioResponseInfo& info, + const V1_0::RadioCapability& rc) override; + Return startLceServiceResponse(const V1_0::RadioResponseInfo& info, + const V1_0::LceStatusInfo& statusInfo) override; + Return stopLceServiceResponse(const V1_0::RadioResponseInfo& info, + const V1_0::LceStatusInfo& statusInfo) override; + Return pullLceDataResponse(const V1_0::RadioResponseInfo& info, + const V1_0::LceDataInfo& lceInfo) override; + Return getModemActivityInfoResponse(const V1_0::RadioResponseInfo& info, + const V1_0::ActivityStatsInfo& activityInfo) override; + Return setAllowedCarriersResponse(const V1_0::RadioResponseInfo& info, + int32_t numAllowed) override; + Return getAllowedCarriersResponse(const V1_0::RadioResponseInfo& info, bool allAllowed, + const V1_0::CarrierRestrictions& carriers) override; + Return sendDeviceStateResponse(const V1_0::RadioResponseInfo& info) override; + Return setIndicationFilterResponse(const V1_0::RadioResponseInfo& info) override; + Return setSimCardPowerResponse(const V1_0::RadioResponseInfo& info) override; + Return acknowledgeRequest(int32_t serial) override; + + // IRadioResponse @ 1.1 + Return setCarrierInfoForImsiEncryptionResponse( + const V1_0::RadioResponseInfo& info) override; + Return setSimCardPowerResponse_1_1(const V1_0::RadioResponseInfo& info) override; + Return startNetworkScanResponse(const V1_0::RadioResponseInfo& info) override; + Return stopNetworkScanResponse(const V1_0::RadioResponseInfo& info) override; + Return startKeepaliveResponse(const V1_0::RadioResponseInfo& info, + const V1_1::KeepaliveStatus& status) override; + Return stopKeepaliveResponse(const V1_0::RadioResponseInfo& info) override; + + // IRadioResponse @ 1.2 + Return getCellInfoListResponse_1_2(const V1_0::RadioResponseInfo& info, + const hidl_vec& cellInfo) override; + Return getIccCardStatusResponse_1_2(const V1_0::RadioResponseInfo& info, + const V1_2::CardStatus& cardStatus) override; + Return setSignalStrengthReportingCriteriaResponse( + const V1_0::RadioResponseInfo& info) override; + Return setLinkCapacityReportingCriteriaResponse( + const V1_0::RadioResponseInfo& info) override; + Return getCurrentCallsResponse_1_2(const V1_0::RadioResponseInfo& info, + const hidl_vec& calls) override; + Return getSignalStrengthResponse_1_2(const V1_0::RadioResponseInfo& info, + const V1_2::SignalStrength& signalStrength) override; + Return getVoiceRegistrationStateResponse_1_2( + const V1_0::RadioResponseInfo& info, + const V1_2::VoiceRegStateResult& voiceRegResponse) override; + Return getDataRegistrationStateResponse_1_2( + const V1_0::RadioResponseInfo& info, + const V1_2::DataRegStateResult& dataRegResponse) override; + + // IRadioResponse @ 1.3 + Return setSystemSelectionChannelsResponse(const V1_0::RadioResponseInfo& info) override; + Return enableModemResponse(const V1_0::RadioResponseInfo& info) override; + Return getModemStackStatusResponse(const V1_0::RadioResponseInfo& info, + bool isEnabled) override; + + // IRadioResponse @ 1.4 + Return emergencyDialResponse(const V1_0::RadioResponseInfo& info) override; + Return startNetworkScanResponse_1_4(const V1_0::RadioResponseInfo& info) override; + Return getCellInfoListResponse_1_4(const V1_0::RadioResponseInfo& info, + const hidl_vec& cellInfo) override; + Return getDataRegistrationStateResponse_1_4( + const V1_0::RadioResponseInfo& info, + const V1_4::DataRegStateResult& dataRegResponse) override; + Return getIccCardStatusResponse_1_4(const V1_0::RadioResponseInfo& info, + const V1_4::CardStatus& cardStatus) override; + Return getPreferredNetworkTypeBitmapResponse( + const V1_0::RadioResponseInfo& info, + hidl_bitfield networkTypeBitmap) override; + Return setPreferredNetworkTypeBitmapResponse( + const V1_0::RadioResponseInfo& info) override; + Return getDataCallListResponse_1_4( + const V1_0::RadioResponseInfo& info, + const hidl_vec& dcResponse) override; + Return setupDataCallResponse_1_4(const V1_0::RadioResponseInfo& info, + const V1_4::SetupDataCallResult& dcResponse) override; + Return setAllowedCarriersResponse_1_4(const V1_0::RadioResponseInfo& info) override; + Return getAllowedCarriersResponse_1_4( + const V1_0::RadioResponseInfo& info, + const V1_4::CarrierRestrictionsWithPriority& carriers, + V1_4::SimLockMultiSimPolicy multiSimPolicy) override; + Return getSignalStrengthResponse_1_4(const V1_0::RadioResponseInfo& info, + const V1_4::SignalStrength& signalStrength) override; + + // IRadioResponse @ 1.5 + Return setSignalStrengthReportingCriteriaResponse_1_5( + const V1_0::RadioResponseInfo& info) override; + Return setLinkCapacityReportingCriteriaResponse_1_5( + const V1_0::RadioResponseInfo& info) override; + Return enableUiccApplicationsResponse(const V1_0::RadioResponseInfo& info) override; + Return areUiccApplicationsEnabledResponse(const V1_0::RadioResponseInfo& info, + bool enabled) override; + Return setSystemSelectionChannelsResponse_1_5( + const V1_0::RadioResponseInfo& info) override; + Return startNetworkScanResponse_1_5(const V1_0::RadioResponseInfo& info) override; + Return setupDataCallResponse_1_5(const V1_0::RadioResponseInfo& info, + const V1_5::SetupDataCallResult& dcResponse) override; + Return getDataCallListResponse_1_5( + const V1_0::RadioResponseInfo& info, + const hidl_vec& dcResponse) override; + Return setInitialAttachApnResponse_1_5(const V1_0::RadioResponseInfo& info) override; + Return setDataProfileResponse_1_5(const V1_0::RadioResponseInfo& info) override; + Return setRadioPowerResponse_1_5(const V1_0::RadioResponseInfo& info) override; + Return setIndicationFilterResponse_1_5(const V1_0::RadioResponseInfo& info) override; + Return getBarringInfoResponse(const V1_0::RadioResponseInfo& info, + const V1_5::CellIdentity& cellIdentity, + const hidl_vec& barringInfos) override; + Return getVoiceRegistrationStateResponse_1_5( + const V1_0::RadioResponseInfo& info, + const V1_5::RegStateResult& voiceRegResponse) override; + Return getDataRegistrationStateResponse_1_5( + const V1_0::RadioResponseInfo& info, + const V1_5::RegStateResult& dataRegResponse) override; + Return getCellInfoListResponse_1_5(const V1_0::RadioResponseInfo& info, + const hidl_vec& cellInfo) override; + Return setNetworkSelectionModeManualResponse_1_5( + const V1_0::RadioResponseInfo& info) override; + Return sendCdmaSmsExpectMoreResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) override; + Return supplySimDepersonalizationResponse(const V1_0::RadioResponseInfo& info, + V1_5::PersoSubstate persoType, + int32_t remainingRetries) override; + Return getIccCardStatusResponse_1_5(const V1_0::RadioResponseInfo& info, + const V1_5::CardStatus& cardStatus) override; + + // IRadioResponse @ 1.6 + Return setRadioPowerResponse_1_6(const V1_6::RadioResponseInfo& info) override; + Return setupDataCallResponse_1_6(const V1_6::RadioResponseInfo& info, + const V1_6::SetupDataCallResult& dcResponse) override; + Return getDataCallListResponse_1_6( + const V1_6::RadioResponseInfo& info, + const hidl_vec& dcResponse) override; + Return sendSmsResponse_1_6(const V1_6::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) override; + Return sendSmsExpectMoreResponse_1_6(const V1_6::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) override; + Return sendCdmaSmsResponse_1_6(const V1_6::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) override; + Return sendCdmaSmsExpectMoreResponse_1_6(const V1_6::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) override; + Return setSimCardPowerResponse_1_6(const V1_6::RadioResponseInfo& info) override; + Return setNrDualConnectivityStateResponse(const V1_6::RadioResponseInfo& info) override; + Return isNrDualConnectivityEnabledResponse(const V1_6::RadioResponseInfo& info, + bool isEnabled) override; + Return allocatePduSessionIdResponse(const V1_6::RadioResponseInfo& info, + int32_t id) override; + Return releasePduSessionIdResponse(const V1_6::RadioResponseInfo& info) override; + Return startHandoverResponse(const V1_6::RadioResponseInfo& info) override; + Return cancelHandoverResponse(const V1_6::RadioResponseInfo& info) override; + Return setAllowedNetworkTypesBitmapResponse(const V1_6::RadioResponseInfo& info) override; + Return getAllowedNetworkTypesBitmapResponse( + const V1_6::RadioResponseInfo& info, + hidl_bitfield networkTypeBitmap) override; + Return setDataThrottlingResponse(const V1_6::RadioResponseInfo& info) override; + Return getSystemSelectionChannelsResponse( + const V1_6::RadioResponseInfo& info, + const hidl_vec& specifiers) override; + Return getCellInfoListResponse_1_6(const V1_6::RadioResponseInfo& info, + const hidl_vec& cellInfo) override; + Return getSignalStrengthResponse_1_6(const V1_6::RadioResponseInfo& info, + const V1_6::SignalStrength& signalStrength) override; + Return getVoiceRegistrationStateResponse_1_6( + const V1_6::RadioResponseInfo& info, + const V1_6::RegStateResult& voiceRegResponse) override; + Return getDataRegistrationStateResponse_1_6( + const V1_6::RadioResponseInfo& info, + const V1_6::RegStateResult& dataRegResponse) override; + Return getCurrentCallsResponse_1_6(const V1_6::RadioResponseInfo& info, + const hidl_vec& calls) override; + Return getSlicingConfigResponse(const V1_6::RadioResponseInfo& info, + const V1_6::SlicingConfig& slicingConfig) override; + Return getSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info) override; + Return getSimPhonebookCapacityResponse(const V1_6::RadioResponseInfo& info, + const V1_6::PhonebookCapacity& capacity) override; + Return updateSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info, + int32_t updatedRecordIndex) override; + + public: + void setResponseFunction( + std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> + radioMessagingResponse); +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp new file mode 100644 index 0000000000..c7342b1146 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp @@ -0,0 +1,94 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#define RADIO_MODULE "MessagingIndication" + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::messaging; + +void RadioIndication::setResponseFunction(std::shared_ptr rmiCb) { + CHECK(rmiCb); + mMessagingCb = rmiCb; +} + +Return RadioIndication::cdmaNewSms(V1_0::RadioIndicationType type, + const V1_0::CdmaSmsMessage& msg) { + LOG_CALL << type; + CHECK_CB(mMessagingCb); + mMessagingCb->cdmaNewSms(toAidl(type), toAidl(msg)); + return {}; +} + +Return RadioIndication::cdmaRuimSmsStorageFull(V1_0::RadioIndicationType type) { + LOG_CALL << type; + CHECK_CB(mMessagingCb); + mMessagingCb->cdmaRuimSmsStorageFull(toAidl(type)); + return {}; +} + +Return RadioIndication::newBroadcastSms(V1_0::RadioIndicationType type, + const hidl_vec& data) { + LOG_CALL << type; + CHECK_CB(mMessagingCb); + mMessagingCb->newBroadcastSms(toAidl(type), data); + return {}; +} + +Return RadioIndication::newSms(V1_0::RadioIndicationType type, const hidl_vec& pdu) { + LOG_CALL << type; + CHECK_CB(mMessagingCb); + mMessagingCb->newSms(toAidl(type), pdu); + return {}; +} + +Return RadioIndication::newSmsOnSim(V1_0::RadioIndicationType type, int32_t recordNumber) { + LOG_CALL << type; + CHECK_CB(mMessagingCb); + mMessagingCb->newSmsOnSim(toAidl(type), recordNumber); + return {}; +} + +Return RadioIndication::newSmsStatusReport(V1_0::RadioIndicationType type, + const hidl_vec& pdu) { + LOG_CALL << type; + CHECK_CB(mMessagingCb); + mMessagingCb->newSmsStatusReport(toAidl(type), pdu); + return {}; +} + +Return RadioIndication::onUssd(V1_0::RadioIndicationType type, V1_0::UssdModeType modeType, + const hidl_string& msg) { + LOG_CALL << type; + CHECK_CB(mMessagingCb); + mMessagingCb->onUssd(toAidl(type), aidl::UssdModeType(modeType), msg); + return {}; +} + +Return RadioIndication::simSmsStorageFull(V1_0::RadioIndicationType type) { + LOG_CALL << type; + CHECK_CB(mMessagingCb); + mMessagingCb->simSmsStorageFull(toAidl(type)); + return {}; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp new file mode 100644 index 0000000000..c1a82b566f --- /dev/null +++ b/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp @@ -0,0 +1,195 @@ +/* + * 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 + +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "Messaging" + +namespace android::hardware::radio::compat { + +using ::ndk::ScopedAStatus; +namespace aidl = ::aidl::android::hardware::radio::messaging; +constexpr auto ok = &ScopedAStatus::ok; + +ScopedAStatus RadioMessaging::acknowledgeIncomingGsmSmsWithPdu( // + int32_t serial, bool success, const std::string& ackPdu) { + LOG_CALL << serial << ' ' << success << ' ' << ackPdu; + mHal1_5->acknowledgeIncomingGsmSmsWithPdu(serial, success, ackPdu); + return ok(); +} + +ScopedAStatus RadioMessaging::acknowledgeLastIncomingCdmaSms( // + int32_t serial, const aidl::CdmaSmsAck& smsAck) { + LOG_CALL << serial; + mHal1_5->acknowledgeLastIncomingCdmaSms(serial, toHidl(smsAck)); + return ok(); +} + +ScopedAStatus RadioMessaging::acknowledgeLastIncomingGsmSms( // + int32_t serial, bool success, aidl::SmsAcknowledgeFailCause cause) { + LOG_CALL << serial << ' ' << success; + mHal1_5->acknowledgeLastIncomingGsmSms(serial, success, V1_0::SmsAcknowledgeFailCause(cause)); + return ok(); +} + +ScopedAStatus RadioMessaging::cancelPendingUssd(int32_t serial) { + LOG_CALL << serial; + mHal1_5->cancelPendingUssd(serial); + return ok(); +} + +ScopedAStatus RadioMessaging::deleteSmsOnRuim(int32_t serial, int32_t index) { + LOG_CALL << serial << ' ' << index; + mHal1_5->deleteSmsOnRuim(serial, index); + return ok(); +} + +ScopedAStatus RadioMessaging::deleteSmsOnSim(int32_t serial, int32_t index) { + LOG_CALL << serial << ' ' << index; + mHal1_5->deleteSmsOnSim(serial, index); + return ok(); +} + +ScopedAStatus RadioMessaging::getCdmaBroadcastConfig(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getCdmaBroadcastConfig(serial); + return ok(); +} + +ScopedAStatus RadioMessaging::getGsmBroadcastConfig(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getGsmBroadcastConfig(serial); + return ok(); +} + +ScopedAStatus RadioMessaging::getSmscAddress(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getSmscAddress(serial); + return ok(); +} + +ScopedAStatus RadioMessaging::reportSmsMemoryStatus(int32_t serial, bool available) { + LOG_CALL << serial << ' ' << available; + mHal1_5->reportSmsMemoryStatus(serial, available); + return ok(); +} + +ScopedAStatus RadioMessaging::responseAcknowledgement() { + LOG_CALL; + mHal1_5->responseAcknowledgement(); + return ok(); +} + +ScopedAStatus RadioMessaging::sendCdmaSms(int32_t serial, const aidl::CdmaSmsMessage& sms) { + LOG_CALL << serial; + mHal1_5->sendCdmaSms(serial, toHidl(sms)); + return ok(); +} + +ScopedAStatus RadioMessaging::sendCdmaSmsExpectMore(int32_t serial, const aidl::CdmaSmsMessage& m) { + LOG_CALL << serial; + mHal1_5->sendCdmaSmsExpectMore(serial, toHidl(m)); + return ok(); +} + +ScopedAStatus RadioMessaging::sendImsSms(int32_t serial, const aidl::ImsSmsMessage& message) { + LOG_CALL << serial; + mHal1_5->sendImsSms(serial, toHidl(message)); + return ok(); +} + +ScopedAStatus RadioMessaging::sendSms(int32_t serial, const aidl::GsmSmsMessage& message) { + LOG_CALL << serial; + mHal1_5->sendSms(serial, toHidl(message)); + return ok(); +} + +ScopedAStatus RadioMessaging::sendSmsExpectMore(int32_t serial, const aidl::GsmSmsMessage& msg) { + LOG_CALL << serial; + mHal1_5->sendSMSExpectMore(serial, toHidl(msg)); + return ok(); +} + +ScopedAStatus RadioMessaging::sendUssd(int32_t serial, const std::string& ussd) { + LOG_CALL << serial << ' ' << ussd; + mHal1_5->sendUssd(serial, ussd); + return ok(); +} + +ScopedAStatus RadioMessaging::setCdmaBroadcastActivation(int32_t serial, bool activate) { + LOG_CALL << serial << ' ' << activate; + mHal1_5->setCdmaBroadcastActivation(serial, activate); + return ok(); +} + +ScopedAStatus RadioMessaging::setCdmaBroadcastConfig( + int32_t serial, const std::vector& cfgInfo) { + LOG_CALL << serial; + mHal1_5->setCdmaBroadcastConfig(serial, toHidl(cfgInfo)); + return ok(); +} + +ScopedAStatus RadioMessaging::setGsmBroadcastActivation(int32_t serial, bool activate) { + LOG_CALL << serial << ' ' << activate; + mHal1_5->setGsmBroadcastActivation(serial, activate); + return ok(); +} + +ScopedAStatus RadioMessaging::setGsmBroadcastConfig( + int32_t serial, const std::vector& configInfo) { + LOG_CALL << serial; + mHal1_5->setGsmBroadcastConfig(serial, toHidl(configInfo)); + return ok(); +} + +ScopedAStatus RadioMessaging::setResponseFunctions( + const std::shared_ptr& messagingResponse, + const std::shared_ptr& messagingIndication) { + LOG_CALL << messagingResponse << ' ' << messagingIndication; + + CHECK(messagingResponse); + CHECK(messagingIndication); + + mRadioResponse->setResponseFunction(messagingResponse); + mRadioIndication->setResponseFunction(messagingIndication); + + return ok(); +} + +ScopedAStatus RadioMessaging::setSmscAddress(int32_t serial, const std::string& smsc) { + LOG_CALL << serial << ' ' << smsc; + mHal1_5->setSmscAddress(serial, smsc); + return ok(); +} + +ScopedAStatus RadioMessaging::writeSmsToRuim(int32_t serial, const aidl::CdmaSmsWriteArgs& sms) { + LOG_CALL << serial; + mHal1_5->writeSmsToRuim(serial, toHidl(sms)); + return ok(); +} + +ScopedAStatus RadioMessaging::writeSmsToSim(int32_t serial, const aidl::SmsWriteArgs& smsWrArgs) { + LOG_CALL << serial; + mHal1_5->writeSmsToSim(serial, toHidl(smsWrArgs)); + return ok(); +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp new file mode 100644 index 0000000000..379e4630af --- /dev/null +++ b/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp @@ -0,0 +1,244 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "MessagingResponse" + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::messaging; + +void RadioResponse::setResponseFunction(std::shared_ptr rmrCb) { + CHECK(rmrCb); + mMessagingCb = rmrCb; +} + +Return RadioResponse::acknowledgeIncomingGsmSmsWithPduResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->acknowledgeIncomingGsmSmsWithPduResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::acknowledgeLastIncomingCdmaSmsResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->acknowledgeLastIncomingCdmaSmsResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::acknowledgeLastIncomingGsmSmsResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->acknowledgeLastIncomingGsmSmsResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::cancelPendingUssdResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->cancelPendingUssdResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::deleteSmsOnRuimResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->deleteSmsOnRuimResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::deleteSmsOnSimResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->deleteSmsOnSimResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::getCdmaBroadcastConfigResponse( + const V1_0::RadioResponseInfo& info, + const hidl_vec& configs) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->getCdmaBroadcastConfigResponse(toAidl(info), toAidl(configs)); + return {}; +} + +Return RadioResponse::getGsmBroadcastConfigResponse( + const V1_0::RadioResponseInfo& info, const hidl_vec& cfg) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->getGsmBroadcastConfigResponse(toAidl(info), toAidl(cfg)); + return {}; +} + +Return RadioResponse::getSmscAddressResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& smsc) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->getSmscAddressResponse(toAidl(info), smsc); + return {}; +} + +Return RadioResponse::reportSmsMemoryStatusResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->reportSmsMemoryStatusResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::sendCdmaSmsExpectMoreResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->sendCdmaSmsExpectMoreResponse(toAidl(info), toAidl(sms)); + return {}; +} + +Return RadioResponse::sendCdmaSmsExpectMoreResponse_1_6(const V1_6::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->sendCdmaSmsExpectMoreResponse(toAidl(info), toAidl(sms)); + return {}; +} + +Return RadioResponse::sendCdmaSmsResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->sendCdmaSmsResponse(toAidl(info), toAidl(sms)); + return {}; +} + +Return RadioResponse::sendCdmaSmsResponse_1_6(const V1_6::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->sendCdmaSmsResponse(toAidl(info), toAidl(sms)); + return {}; +} + +Return RadioResponse::sendImsSmsResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->sendImsSmsResponse(toAidl(info), toAidl(sms)); + return {}; +} + +Return RadioResponse::sendSMSExpectMoreResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->sendSmsExpectMoreResponse(toAidl(info), toAidl(sms)); + return {}; +} + +Return RadioResponse::sendSmsExpectMoreResponse_1_6(const V1_6::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->sendSmsExpectMoreResponse(toAidl(info), toAidl(sms)); + return {}; +} + +Return RadioResponse::sendSmsResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->sendSmsResponse(toAidl(info), toAidl(sms)); + return {}; +} + +Return RadioResponse::sendSmsResponse_1_6(const V1_6::RadioResponseInfo& info, + const V1_0::SendSmsResult& sms) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->sendSmsResponse(toAidl(info), toAidl(sms)); + return {}; +} + +Return RadioResponse::sendUssdResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->sendUssdResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setCdmaBroadcastActivationResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->setCdmaBroadcastActivationResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setCdmaBroadcastConfigResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->setCdmaBroadcastConfigResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setGsmBroadcastActivationResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->setGsmBroadcastActivationResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setGsmBroadcastConfigResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->setGsmBroadcastConfigResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setSmscAddressResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mMessagingCb); + mMessagingCb->setSmscAddressResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::writeSmsToRuimResponse(const V1_0::RadioResponseInfo& info, + uint32_t index) { + LOG_CALL << info.serial << ' ' << index; + CHECK_CB(mMessagingCb); + mMessagingCb->writeSmsToRuimResponse(toAidl(info), index); + return {}; +} + +Return RadioResponse::writeSmsToSimResponse(const V1_0::RadioResponseInfo& info, + int32_t index) { + LOG_CALL << info.serial << ' ' << index; + CHECK_CB(mMessagingCb); + mMessagingCb->writeSmsToSimResponse(toAidl(info), index); + return {}; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/messaging/structs.cpp b/radio/aidl/compat/libradiocompat/messaging/structs.cpp new file mode 100644 index 0000000000..90196802e1 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/messaging/structs.cpp @@ -0,0 +1,172 @@ +/* + * 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 "structs.h" + +#include "collections.h" + +#include +#include + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::messaging; + +V1_0::CdmaSmsAck toHidl(const aidl::CdmaSmsAck& smsAck) { + return { + .errorClass = (smsAck.errorClass ? V1_0::CdmaSmsErrorClass::ERROR + : V1_0::CdmaSmsErrorClass::NO_ERROR), + .smsCauseCode = smsAck.smsCauseCode, + }; +} + +static aidl::CdmaSmsAddress toAidl(const V1_0::CdmaSmsAddress& addr) { + return { + .digitMode = static_cast(addr.digitMode), + .isNumberModeDataNetwork = addr.numberMode == V1_0::CdmaSmsNumberMode::DATA_NETWORK, + .numberType = static_cast(addr.numberType), + .numberPlan = static_cast(addr.numberPlan), + .digits = addr.digits, + }; +} + +static V1_0::CdmaSmsAddress toHidl(const aidl::CdmaSmsAddress& addr) { + return { + .digitMode = V1_0::CdmaSmsDigitMode{addr.digitMode}, + .numberMode = addr.isNumberModeDataNetwork ? V1_0::CdmaSmsNumberMode::DATA_NETWORK + : V1_0::CdmaSmsNumberMode::NOT_DATA_NETWORK, + .numberType = V1_0::CdmaSmsNumberType{addr.numberType}, + .numberPlan = V1_0::CdmaSmsNumberPlan{addr.numberPlan}, + .digits = addr.digits, + }; +} + +static aidl::CdmaSmsSubaddress toAidl(const V1_0::CdmaSmsSubaddress& addr) { + return { + .subaddressType = static_cast(addr.subaddressType), + .odd = addr.odd, + .digits = addr.digits, + }; +} + +static V1_0::CdmaSmsSubaddress toHidl(const aidl::CdmaSmsSubaddress& addr) { + return { + .subaddressType = V1_0::CdmaSmsSubaddressType{addr.subaddressType}, + .odd = addr.odd, + .digits = addr.digits, + }; +} + +::aidl::android::hardware::radio::messaging::CdmaSmsMessage toAidl(const V1_0::CdmaSmsMessage& m) { + return { + .teleserviceId = m.teleserviceId, + .isServicePresent = m.isServicePresent, + .serviceCategory = m.serviceCategory, + .address = toAidl(m.address), + .subAddress = toAidl(m.subAddress), + .bearerData = m.bearerData, + }; +} + +V1_0::CdmaSmsMessage toHidl(const aidl::CdmaSmsMessage& msg) { + return { + .teleserviceId = msg.teleserviceId, + .isServicePresent = msg.isServicePresent, + .serviceCategory = msg.serviceCategory, + .address = toHidl(msg.address), + .subAddress = toHidl(msg.subAddress), + .bearerData = msg.bearerData, + }; +} + +V1_0::ImsSmsMessage toHidl(const aidl::ImsSmsMessage& msg) { + return { + .tech = V1_0::RadioTechnologyFamily{msg.tech}, + .retry = msg.retry, + .messageRef = msg.messageRef, + .cdmaMessage = toHidl(msg.cdmaMessage), + .gsmMessage = toHidl(msg.gsmMessage), + }; +} + +V1_0::GsmSmsMessage toHidl(const aidl::GsmSmsMessage& msg) { + return { + .smscPdu = msg.smscPdu, + .pdu = msg.pdu, + }; +} + +aidl::CdmaBroadcastSmsConfigInfo toAidl(const V1_0::CdmaBroadcastSmsConfigInfo& info) { + return { + .serviceCategory = info.serviceCategory, + .language = info.language, + .selected = info.selected, + }; +} + +V1_0::CdmaBroadcastSmsConfigInfo toHidl(const aidl::CdmaBroadcastSmsConfigInfo& info) { + return { + .serviceCategory = info.serviceCategory, + .language = info.language, + .selected = info.selected, + }; +} + +aidl::GsmBroadcastSmsConfigInfo toAidl(const V1_0::GsmBroadcastSmsConfigInfo& info) { + return { + .fromServiceId = info.fromServiceId, + .toServiceId = info.toServiceId, + .fromCodeScheme = info.fromCodeScheme, + .toCodeScheme = info.toCodeScheme, + .selected = info.selected, + }; +} + +V1_0::GsmBroadcastSmsConfigInfo toHidl(const aidl::GsmBroadcastSmsConfigInfo& info) { + return { + .fromServiceId = info.fromServiceId, + .toServiceId = info.toServiceId, + .fromCodeScheme = info.fromCodeScheme, + .toCodeScheme = info.toCodeScheme, + .selected = info.selected, + }; +} + +V1_0::CdmaSmsWriteArgs toHidl(const aidl::CdmaSmsWriteArgs& args) { + return { + .status = V1_0::CdmaSmsWriteArgsStatus{args.status}, + .message = toHidl(args.message), + }; +} + +V1_0::SmsWriteArgs toHidl(const aidl::SmsWriteArgs& args) { + return { + .status = V1_0::SmsWriteArgsStatus{args.status}, + .pdu = args.pdu, + .smsc = args.smsc, + }; +} + +::aidl::android::hardware::radio::messaging::SendSmsResult toAidl( + const V1_0::SendSmsResult& result) { + return { + .messageRef = result.messageRef, + .ackPDU = result.ackPDU, + .errorCode = result.errorCode, + }; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/messaging/structs.h b/radio/aidl/compat/libradiocompat/messaging/structs.h new file mode 100644 index 0000000000..afb49419f7 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/messaging/structs.h @@ -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. + */ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace android::hardware::radio::compat { + +V1_0::CdmaSmsAck toHidl(const ::aidl::android::hardware::radio::messaging::CdmaSmsAck& ack); + +::aidl::android::hardware::radio::messaging::CdmaSmsMessage toAidl(const V1_0::CdmaSmsMessage& msg); +V1_0::CdmaSmsMessage toHidl(const ::aidl::android::hardware::radio::messaging::CdmaSmsMessage& msg); + +V1_0::ImsSmsMessage toHidl(const ::aidl::android::hardware::radio::messaging::ImsSmsMessage& msg); + +V1_0::GsmSmsMessage toHidl(const ::aidl::android::hardware::radio::messaging::GsmSmsMessage& msg); + +::aidl::android::hardware::radio::messaging::CdmaBroadcastSmsConfigInfo // +toAidl(const V1_0::CdmaBroadcastSmsConfigInfo& info); +V1_0::CdmaBroadcastSmsConfigInfo // +toHidl(const ::aidl::android::hardware::radio::messaging::CdmaBroadcastSmsConfigInfo& info); + +::aidl::android::hardware::radio::messaging::GsmBroadcastSmsConfigInfo // +toAidl(const V1_0::GsmBroadcastSmsConfigInfo& info); +V1_0::GsmBroadcastSmsConfigInfo // +toHidl(const ::aidl::android::hardware::radio::messaging::GsmBroadcastSmsConfigInfo& info); + +V1_0::CdmaSmsWriteArgs // +toHidl(const ::aidl::android::hardware::radio::messaging::CdmaSmsWriteArgs& args); + +V1_0::SmsWriteArgs toHidl(const ::aidl::android::hardware::radio::messaging::SmsWriteArgs& args); + +::aidl::android::hardware::radio::messaging::SendSmsResult toAidl(const V1_0::SendSmsResult& res); + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/service/Android.bp b/radio/aidl/compat/service/Android.bp index f708b84764..82ab81f7a4 100644 --- a/radio/aidl/compat/service/Android.bp +++ b/radio/aidl/compat/service/Android.bp @@ -39,6 +39,14 @@ cc_binary { "android.hardware.radio.config@1.1", "android.hardware.radio.config@1.2", "android.hardware.radio.config@1.3", + "android.hardware.radio.messaging-V1-ndk", + "android.hardware.radio@1.0", + "android.hardware.radio@1.1", + "android.hardware.radio@1.2", + "android.hardware.radio@1.3", + "android.hardware.radio@1.4", + "android.hardware.radio@1.5", + "android.hardware.radio@1.6", "libbase", "libbinder_ndk", "libhidlbase", diff --git a/radio/aidl/compat/service/hidl-utils.cpp b/radio/aidl/compat/service/hidl-utils.cpp index d8949666af..fc0d54db9f 100644 --- a/radio/aidl/compat/service/hidl-utils.cpp +++ b/radio/aidl/compat/service/hidl-utils.cpp @@ -17,6 +17,7 @@ #include "hidl-utils.h" #include +#include namespace android::hardware::hidl_utils { @@ -33,4 +34,13 @@ void linkDeathToDeath(sp<::android::hidl::base::V1_0::IBase> hal) { CHECK(linkStatus.withDefault(false)) << "Failed to link to HAL death"; } +hidl_vec listManifestByInterface(const char* descriptor) { + auto manager = hidl::manager::V1_2::IServiceManager::getService(); + hidl_vec services; + manager->listManifestByInterface(descriptor, hidl_utils::fill(&services)); + CHECK_GT(services.size(), 0u) << "No " << descriptor + << " services in manifest (missing privileges?)" << std::endl; + return services; +} + } // namespace android::hardware::hidl_utils diff --git a/radio/aidl/compat/service/hidl-utils.h b/radio/aidl/compat/service/hidl-utils.h index 3f81a9b96f..be3386fb6e 100644 --- a/radio/aidl/compat/service/hidl-utils.h +++ b/radio/aidl/compat/service/hidl-utils.h @@ -18,13 +18,61 @@ #include +#include + namespace android::hardware::hidl_utils { /** - * Link to a given HALs death and restart the current process in such a case. + * Helper functor to fetch results from multi-return HIDL calls. + * It's meant to be used in place of _hidl_cb callbacks. * + * Please note extracting these return variables outside of the callback scope requires making + * a copy of each return variable. This may be costly for frequently called HIDL methods with + * non-negligible return object size. Please be cautious about performance when using this. + * + * Example usage: + * Result result; + * sp iface; + * hidlObject->someMethod(arg1, arg2, hidl_utils::fill(&result, &iface)).assertOk(); + * // use result and iface + */ +template +struct fill : public std::function { + /** + * Create _hidl_cb functor that copies the call arguments to specified pointers. + * + * \param args... Targets to copy the call arguments to + */ + fill(T*... args) : mTargets(args...) {} + + void operator()(const T&... args) { copy<0, T...>(args...); } + + private: + std::tuple mTargets; + + template + inline void copy(const First& first) { + *std::get(mTargets) = first; + } + + template + inline void copy(const First& first, const Rest&... rest) { + *std::get(mTargets) = first; + copy(rest...); + } +}; + +/** + * Link to a given HALs death and restart the current process in such a case. * \param hal HAL to which death to link */ void linkDeathToDeath(sp hal); +/** + * List HAL instances of a given interface. + * + * \descriptor HIDL HAL descriptor + */ +hidl_vec listManifestByInterface(const char* descriptor); + } // namespace android::hardware::hidl_utils diff --git a/radio/aidl/compat/service/radio-compat.xml b/radio/aidl/compat/service/radio-compat.xml index 60f8ff5d7c..781f2f41c8 100644 --- a/radio/aidl/compat/service/radio-compat.xml +++ b/radio/aidl/compat/service/radio-compat.xml @@ -3,4 +3,15 @@ android.hardware.radio.config IRadioConfig/default + diff --git a/radio/aidl/compat/service/service.cpp b/radio/aidl/compat/service/service.cpp index c177dd1233..4d34cf120e 100644 --- a/radio/aidl/compat/service/service.cpp +++ b/radio/aidl/compat/service/service.cpp @@ -20,6 +20,9 @@ #include #include #include +#include +#include +#include namespace android::hardware::radio::service { @@ -27,6 +30,35 @@ using namespace std::string_literals; static std::vector> gPublishedHals; +template +static void publishRadioHal(sp hidlHal, sp responseCb, + sp indicationCb, const std::string& slot) { + const auto instance = T::descriptor + "/"s + slot; + if (!AServiceManager_isDeclared(instance.c_str())) { + LOG(INFO) << instance << " is not declared in VINTF (this may be intentional)"; + return; + } + LOG(DEBUG) << "Publishing " << instance; + + auto aidlHal = ndk::SharedRefBase::make(hidlHal, responseCb, indicationCb); + gPublishedHals.push_back(aidlHal); + const auto status = AServiceManager_addService(aidlHal->asBinder().get(), instance.c_str()); + CHECK_EQ(status, STATUS_OK); +} + +static void publishRadio(std::string slot) { + auto radioHidl = V1_5::IRadio::getService(slot); + CHECK(radioHidl) << "HIDL IRadio not present in VINTF"; + + hidl_utils::linkDeathToDeath(radioHidl); + + auto responseCb = sp::make(); + auto indicationCb = sp::make(); + radioHidl->setResponseFunctions(responseCb, indicationCb).assertOk(); + + publishRadioHal(radioHidl, responseCb, indicationCb, slot); +} + static void publishRadioConfig() { auto hidlHal = config::V1_1::IRadioConfig::getService(); CHECK(hidlHal) << "HIDL IRadioConfig not present in VINTF"; @@ -47,6 +79,12 @@ static void main() { publishRadioConfig(); + const auto slots = hidl_utils::listManifestByInterface(V1_0::IRadio::descriptor); + LOG(INFO) << "Found " << slots.size() << " slot(s)"; + for (const auto& slot : slots) { + publishRadio(slot); + } + LOG(DEBUG) << "Radio HAL compat service is operational"; ABinderProcess_joinThreadPool(); LOG(FATAL) << "Radio HAL compat service has stopped"; -- GitLab From fb10e00a4f902d0cdbfa984f6e41d9f83d0a7a84 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Thu, 28 Oct 2021 13:22:47 -0700 Subject: [PATCH 284/825] Implement RadioSim for AIDL-HIDL Telephony HAL translator Bug: 203699028 Test: Boot and grep logcat against radiocompat Change-Id: I82d27049858e578522b83811a787b259e67d00a4 --- radio/aidl/compat/libradiocompat/Android.bp | 5 + .../compat/libradiocompat/RadioIndication.cpp | 52 --- .../compat/libradiocompat/RadioResponse.cpp | 204 +--------- .../compat/libradiocompat/commonStructs.cpp | 12 + .../compat/libradiocompat/commonStructs.h | 4 + .../include/libradiocompat/RadioIndication.h | 4 + .../include/libradiocompat/RadioResponse.h | 4 + .../include/libradiocompat/RadioSim.h | 107 +++++ .../sim/RadioIndication-sim.cpp | 121 ++++++ .../libradiocompat/sim/RadioResponse-sim.cpp | 366 ++++++++++++++++++ .../compat/libradiocompat/sim/RadioSim.cpp | 295 ++++++++++++++ .../compat/libradiocompat/sim/structs.cpp | 221 +++++++++++ .../aidl/compat/libradiocompat/sim/structs.h | 75 ++++ radio/aidl/compat/service/Android.bp | 1 + radio/aidl/compat/service/radio-compat.xml | 4 + radio/aidl/compat/service/service.cpp | 2 + 16 files changed, 1223 insertions(+), 254 deletions(-) create mode 100644 radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h create mode 100644 radio/aidl/compat/libradiocompat/sim/RadioIndication-sim.cpp create mode 100644 radio/aidl/compat/libradiocompat/sim/RadioResponse-sim.cpp create mode 100644 radio/aidl/compat/libradiocompat/sim/RadioSim.cpp create mode 100644 radio/aidl/compat/libradiocompat/sim/structs.cpp create mode 100644 radio/aidl/compat/libradiocompat/sim/structs.h diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp index 00c1db658d..bf2c80c824 100644 --- a/radio/aidl/compat/libradiocompat/Android.bp +++ b/radio/aidl/compat/libradiocompat/Android.bp @@ -38,6 +38,7 @@ cc_library { "android.hardware.radio.config@1.2", "android.hardware.radio.config@1.3", "android.hardware.radio.messaging-V1-ndk", + "android.hardware.radio.sim-V1-ndk", "android.hardware.radio@1.0", "android.hardware.radio@1.1", "android.hardware.radio@1.2", @@ -63,6 +64,10 @@ cc_library { "messaging/RadioMessaging.cpp", "messaging/RadioResponse-messaging.cpp", "messaging/structs.cpp", + "sim/RadioIndication-sim.cpp", + "sim/RadioResponse-sim.cpp", + "sim/RadioSim.cpp", + "sim/structs.cpp", ], export_include_dirs: ["include"], } diff --git a/radio/aidl/compat/libradiocompat/RadioIndication.cpp b/radio/aidl/compat/libradiocompat/RadioIndication.cpp index 5cbb954229..69836e2990 100644 --- a/radio/aidl/compat/libradiocompat/RadioIndication.cpp +++ b/radio/aidl/compat/libradiocompat/RadioIndication.cpp @@ -54,38 +54,15 @@ Return RadioIndication::suppSvcNotify(V1_0::RadioIndicationType type, return {}; } -Return RadioIndication::stkSessionEnd(V1_0::RadioIndicationType type) { - return {}; -} - -Return RadioIndication::stkProactiveCommand(V1_0::RadioIndicationType type, - const hidl_string& cmd) { - return {}; -} - -Return RadioIndication::stkEventNotify(V1_0::RadioIndicationType type, - const hidl_string& cmd) { - return {}; -} - Return RadioIndication::stkCallSetup(V1_0::RadioIndicationType type, int64_t timeout) { return {}; } -Return RadioIndication::simRefresh(V1_0::RadioIndicationType type, - const V1_0::SimRefreshResult& refreshResult) { - return {}; -} - Return RadioIndication::callRing(V1_0::RadioIndicationType type, bool isGsm, const V1_0::CdmaSignalInfoRecord& record) { return {}; } -Return RadioIndication::simStatusChanged(V1_0::RadioIndicationType type) { - return {}; -} - Return RadioIndication::restrictedStateChanged(V1_0::RadioIndicationType type, V1_0::PhoneRestrictedState state) { return {}; @@ -118,11 +95,6 @@ Return RadioIndication::resendIncallMute(V1_0::RadioIndicationType type) { return {}; } -Return RadioIndication::cdmaSubscriptionSourceChanged( - V1_0::RadioIndicationType type, V1_0::CdmaSubscriptionSource cdmaSource) { - return {}; -} - Return RadioIndication::cdmaPrlChanged(V1_0::RadioIndicationType type, int32_t version) { return {}; } @@ -149,11 +121,6 @@ Return RadioIndication::imsNetworkStateChanged(V1_0::RadioIndicationType t return {}; } -Return RadioIndication::subscriptionStatusChanged(V1_0::RadioIndicationType type, - bool activate) { - return {}; -} - Return RadioIndication::srvccStateNotify(V1_0::RadioIndicationType type, V1_0::SrvccState state) { return {}; @@ -194,10 +161,6 @@ Return RadioIndication::modemReset(V1_0::RadioIndicationType type, return {}; } -Return RadioIndication::carrierInfoForImsiEncryption(V1_0::RadioIndicationType info) { - return {}; -} - Return RadioIndication::networkScanResult(V1_0::RadioIndicationType type, const V1_1::NetworkScanResult& result) { return {}; @@ -263,11 +226,6 @@ Return RadioIndication::currentSignalStrength_1_4( return {}; } -Return RadioIndication::uiccApplicationsEnablementChanged(V1_0::RadioIndicationType type, - bool enabled) { - return {}; -} - Return RadioIndication::registrationFailed( // V1_0::RadioIndicationType type, const V1_5::CellIdentity& cellIdentity, const hidl_string& chosenPlmn, hidl_bitfield domain, int32_t causeCode, @@ -331,14 +289,4 @@ Return RadioIndication::currentPhysicalChannelConfigs_1_6( return {}; } -Return RadioIndication::simPhonebookChanged(V1_0::RadioIndicationType type) { - return {}; -} - -Return RadioIndication::simPhonebookRecordsReceived( - V1_0::RadioIndicationType type, V1_6::PbReceivedStatus status, - const hidl_vec& records) { - return {}; -} - } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/RadioResponse.cpp b/radio/aidl/compat/libradiocompat/RadioResponse.cpp index 15002a8490..587e497693 100644 --- a/radio/aidl/compat/libradiocompat/RadioResponse.cpp +++ b/radio/aidl/compat/libradiocompat/RadioResponse.cpp @@ -27,42 +27,9 @@ namespace android::hardware::radio::compat { Return RadioResponse::acknowledgeRequest(int32_t serial) { LOG_CALL << serial; + // TODO(b/203699028): send to correct requestor or confirm if spam is not a problem if (mMessagingCb) mMessagingCb->acknowledgeRequest(serial); - return {}; -} - -Return RadioResponse::getIccCardStatusResponse(const V1_0::RadioResponseInfo& info, - const V1_0::CardStatus& cardStatus) { - return {}; -} - -Return RadioResponse::supplyIccPinForAppResponse(const V1_0::RadioResponseInfo& info, - int32_t remainingRetries) { - return {}; -} - -Return RadioResponse::supplyIccPukForAppResponse(const V1_0::RadioResponseInfo& info, - int32_t remainingRetries) { - return {}; -} - -Return RadioResponse::supplyIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info, - int32_t remainingRetries) { - return {}; -} - -Return RadioResponse::supplyIccPuk2ForAppResponse(const V1_0::RadioResponseInfo& info, - int32_t remainingRetries) { - return {}; -} - -Return RadioResponse::changeIccPinForAppResponse(const V1_0::RadioResponseInfo& info, - int32_t remainingRetries) { - return {}; -} - -Return RadioResponse::changeIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info, - int32_t remainingRetries) { + if (mSimCb) mSimCb->acknowledgeRequest(serial); return {}; } @@ -80,11 +47,6 @@ Return RadioResponse::dialResponse(const V1_0::RadioResponseInfo& info) { return {}; } -Return RadioResponse::getIMSIForAppResponse(const V1_0::RadioResponseInfo& info, - const hidl_string& imsi) { - return {}; -} - Return RadioResponse::hangupConnectionResponse(const V1_0::RadioResponseInfo& info) { return {}; } @@ -150,11 +112,6 @@ Return RadioResponse::setupDataCallResponse(const V1_0::RadioResponseInfo& return {}; } -Return RadioResponse::iccIOForAppResponse(const V1_0::RadioResponseInfo& info, - const V1_0::IccIoResult& iccIo) { - return {}; -} - Return RadioResponse::getClirResponse(const V1_0::RadioResponseInfo& info, int32_t n, int32_t m) { return {}; @@ -190,16 +147,6 @@ Return RadioResponse::deactivateDataCallResponse(const V1_0::RadioResponse return {}; } -Return RadioResponse::getFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info, - int32_t response) { - return {}; -} - -Return RadioResponse::setFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info, - int32_t retry) { - return {}; -} - Return RadioResponse::setBarringPasswordResponse(const V1_0::RadioResponseInfo& info) { return {}; } @@ -273,15 +220,6 @@ Return RadioResponse::getAvailableBandModesResponse( return {}; } -Return RadioResponse::sendEnvelopeResponse(const V1_0::RadioResponseInfo& info, - const hidl_string& commandResponse) { - return {}; -} - -Return RadioResponse::sendTerminalResponseToSimResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::handleStkCallSetupRequestFromSimResponse( const V1_0::RadioResponseInfo& info) { return {}; @@ -309,10 +247,6 @@ Return RadioResponse::setLocationUpdatesResponse(const V1_0::RadioResponse return {}; } -Return RadioResponse::setCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::setCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info) { return {}; } @@ -348,12 +282,6 @@ Return RadioResponse::sendBurstDtmfResponse(const V1_0::RadioResponseInfo& return {}; } -Return RadioResponse::getCDMASubscriptionResponse( - const V1_0::RadioResponseInfo& info, const hidl_string& mdn, const hidl_string& hSid, - const hidl_string& hNid, const hidl_string& min, const hidl_string& prl) { - return {}; -} - Return RadioResponse::getDeviceIdentityResponse( // const V1_0::RadioResponseInfo& info, const hidl_string& imei, const hidl_string& imeisv, const hidl_string& esn, const hidl_string& meid) { @@ -364,25 +292,6 @@ Return RadioResponse::exitEmergencyCallbackModeResponse(const V1_0::RadioR return {}; } -Return RadioResponse::reportStkServiceIsRunningResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info, - V1_0::CdmaSubscriptionSource source) { - return {}; -} - -Return RadioResponse::requestIsimAuthenticationResponse(const V1_0::RadioResponseInfo& info, - const hidl_string& response) { - return {}; -} - -Return RadioResponse::sendEnvelopeWithStatusResponse(const V1_0::RadioResponseInfo& info, - const V1_0::IccIoResult& iccIo) { - return {}; -} - Return RadioResponse::getVoiceRadioTechnologyResponse(const V1_0::RadioResponseInfo& info, V1_0::RadioTechnology rat) { return {}; @@ -406,25 +315,6 @@ Return RadioResponse::getImsRegistrationStateResponse( // return {}; } -Return RadioResponse::iccTransmitApduBasicChannelResponse(const V1_0::RadioResponseInfo& info, - const V1_0::IccIoResult& result) { - return {}; -} - -Return RadioResponse::iccOpenLogicalChannelResponse( // - const V1_0::RadioResponseInfo& info, int32_t chanId, const hidl_vec& selectResp) { - return {}; -} - -Return RadioResponse::iccCloseLogicalChannelResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::iccTransmitApduLogicalChannelResponse( - const V1_0::RadioResponseInfo& info, const V1_0::IccIoResult& result) { - return {}; -} - Return RadioResponse::nvReadItemResponse(const V1_0::RadioResponseInfo& info, const hidl_string& result) { return {}; @@ -442,10 +332,6 @@ Return RadioResponse::nvResetConfigResponse(const V1_0::RadioResponseInfo& return {}; } -Return RadioResponse::setUiccSubscriptionResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::setDataAllowedResponse(const V1_0::RadioResponseInfo& info) { return {}; } @@ -455,11 +341,6 @@ Return RadioResponse::getHardwareConfigResponse( return {}; } -Return RadioResponse::requestIccSimAuthenticationResponse(const V1_0::RadioResponseInfo& info, - const V1_0::IccIoResult& result) { - return {}; -} - Return RadioResponse::setDataProfileResponse(const V1_0::RadioResponseInfo& info) { return {}; } @@ -498,16 +379,6 @@ Return RadioResponse::getModemActivityInfoResponse( return {}; } -Return RadioResponse::setAllowedCarriersResponse(const V1_0::RadioResponseInfo& info, - int32_t numAllowed) { - return {}; -} - -Return RadioResponse::getAllowedCarriersResponse( // - const V1_0::RadioResponseInfo& info, bool allAllowed, const V1_0::CarrierRestrictions& cr) { - return {}; -} - Return RadioResponse::sendDeviceStateResponse(const V1_0::RadioResponseInfo& info) { return {}; } @@ -516,19 +387,6 @@ Return RadioResponse::setIndicationFilterResponse(const V1_0::RadioRespons return {}; } -Return RadioResponse::setSimCardPowerResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::setCarrierInfoForImsiEncryptionResponse( - const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::setSimCardPowerResponse_1_1(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::startNetworkScanResponse(const V1_0::RadioResponseInfo& info) { return {}; } @@ -551,11 +409,6 @@ Return RadioResponse::getCellInfoListResponse_1_2(const V1_0::RadioRespons return {}; } -Return RadioResponse::getIccCardStatusResponse_1_2(const V1_0::RadioResponseInfo& info, - const V1_2::CardStatus& cardStatus) { - return {}; -} - Return RadioResponse::setSignalStrengthReportingCriteriaResponse( const V1_0::RadioResponseInfo& info) { return {}; @@ -618,11 +471,6 @@ Return RadioResponse::getDataRegistrationStateResponse_1_4( return {}; } -Return RadioResponse::getIccCardStatusResponse_1_4(const V1_0::RadioResponseInfo& info, - const V1_4::CardStatus& cardStatus) { - return {}; -} - Return RadioResponse::getPreferredNetworkTypeBitmapResponse( const V1_0::RadioResponseInfo& info, hidl_bitfield networkTypeBitmap) { @@ -645,16 +493,6 @@ Return RadioResponse::setupDataCallResponse_1_4(const V1_0::RadioResponseI return {}; } -Return RadioResponse::setAllowedCarriersResponse_1_4(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getAllowedCarriersResponse_1_4( - const V1_0::RadioResponseInfo& info, const V1_4::CarrierRestrictionsWithPriority& carriers, - V1_4::SimLockMultiSimPolicy multiSimPolicy) { - return {}; -} - Return RadioResponse::getSignalStrengthResponse_1_4( const V1_0::RadioResponseInfo& info, const V1_4::SignalStrength& signalStrength) { return {}; @@ -670,15 +508,6 @@ Return RadioResponse::setLinkCapacityReportingCriteriaResponse_1_5( return {}; } -Return RadioResponse::enableUiccApplicationsResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::areUiccApplicationsEnabledResponse(const V1_0::RadioResponseInfo& info, - bool enabled) { - return {}; -} - Return RadioResponse::setSystemSelectionChannelsResponse_1_5( const V1_0::RadioResponseInfo& info) { return {}; @@ -741,17 +570,6 @@ Return RadioResponse::setNetworkSelectionModeManualResponse_1_5( return {}; } -Return RadioResponse::supplySimDepersonalizationResponse(const V1_0::RadioResponseInfo& info, - V1_5::PersoSubstate persoType, - int32_t remainingRetries) { - return {}; -} - -Return RadioResponse::getIccCardStatusResponse_1_5(const V1_0::RadioResponseInfo& info, - const V1_5::CardStatus& cardStatus) { - return {}; -} - Return RadioResponse::setRadioPowerResponse_1_6(const V1_6::RadioResponseInfo& info) { return {}; } @@ -767,10 +585,6 @@ Return RadioResponse::getDataCallListResponse_1_6( return {}; } -Return RadioResponse::setSimCardPowerResponse_1_6(const V1_6::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::setNrDualConnectivityStateResponse( const V1_6::RadioResponseInfo& info) { return {}; @@ -849,18 +663,4 @@ Return RadioResponse::getSlicingConfigResponse(const V1_6::RadioResponseIn return {}; } -Return RadioResponse::getSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getSimPhonebookCapacityResponse( - const V1_6::RadioResponseInfo& info, const V1_6::PhonebookCapacity& capacity) { - return {}; -} - -Return RadioResponse::updateSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info, - int32_t updatedRecordIndex) { - return {}; -} - } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/commonStructs.cpp b/radio/aidl/compat/libradiocompat/commonStructs.cpp index e81562a89a..affd00a7ab 100644 --- a/radio/aidl/compat/libradiocompat/commonStructs.cpp +++ b/radio/aidl/compat/libradiocompat/commonStructs.cpp @@ -28,6 +28,18 @@ V1_6::RadioResponseInfo notSupported(int32_t serial) { }; } +std::string toAidl(const hidl_string& str) { + return str; +} + +hidl_string toHidl(const std::string& str) { + return str; +} + +uint8_t toAidl(int8_t v) { + return v; +} + aidl::RadioIndicationType toAidl(V1_0::RadioIndicationType type) { return aidl::RadioIndicationType(type); } diff --git a/radio/aidl/compat/libradiocompat/commonStructs.h b/radio/aidl/compat/libradiocompat/commonStructs.h index cba307ebde..9b3115d7f8 100644 --- a/radio/aidl/compat/libradiocompat/commonStructs.h +++ b/radio/aidl/compat/libradiocompat/commonStructs.h @@ -23,6 +23,10 @@ namespace android::hardware::radio::compat { V1_6::RadioResponseInfo notSupported(int32_t serial); +std::string toAidl(const hidl_string& str); +hidl_string toHidl(const std::string& str); +uint8_t toAidl(int8_t v); + aidl::android::hardware::radio::RadioIndicationType toAidl(V1_0::RadioIndicationType type); aidl::android::hardware::radio::RadioResponseType toAidl(V1_0::RadioResponseType type); aidl::android::hardware::radio::RadioError toAidl(V1_0::RadioError type); diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h index 991ae0637e..bc2b84107a 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h @@ -16,6 +16,7 @@ #pragma once #include +#include #include namespace android::hardware::radio::compat { @@ -23,6 +24,7 @@ namespace android::hardware::radio::compat { class RadioIndication : public V1_6::IRadioIndication { std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> mMessagingCb; + std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> mSimCb; // IRadioIndication @ 1.0 Return radioStateChanged(V1_0::RadioIndicationType type, @@ -174,6 +176,8 @@ class RadioIndication : public V1_6::IRadioIndication { void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> radioMessagingIndication); + void setResponseFunction( + std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> simCb); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h index 121cc45687..f87e8a6d21 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h @@ -16,6 +16,7 @@ #pragma once #include +#include #include namespace android::hardware::radio::compat { @@ -23,6 +24,7 @@ namespace android::hardware::radio::compat { class RadioResponse : public V1_6::IRadioResponse { std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> mMessagingCb; + std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> mSimCb; // IRadioResponse @ 1.0 Return getIccCardStatusResponse(const V1_0::RadioResponseInfo& info, @@ -402,6 +404,8 @@ class RadioResponse : public V1_6::IRadioResponse { void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> radioMessagingResponse); + void setResponseFunction( + std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> simCb); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h new file mode 100644 index 0000000000..a6b77fd507 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h @@ -0,0 +1,107 @@ +/* + * 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 "RadioCompatBase.h" + +#include + +namespace android::hardware::radio::compat { + +class RadioSim : public RadioCompatBase, public aidl::android::hardware::radio::sim::BnRadioSim { + ::ndk::ScopedAStatus areUiccApplicationsEnabled(int32_t serial) override; + ::ndk::ScopedAStatus changeIccPin2ForApp(int32_t serial, const std::string& oldPin2, + const std::string& newPin2, + const std::string& aid) override; + ::ndk::ScopedAStatus changeIccPinForApp(int32_t serial, const std::string& oldPin, + const std::string& newPin, + const std::string& aid) override; + ::ndk::ScopedAStatus enableUiccApplications(int32_t serial, bool enable) override; + ::ndk::ScopedAStatus getAllowedCarriers(int32_t serial) override; + ::ndk::ScopedAStatus getCdmaSubscription(int32_t serial) override; + ::ndk::ScopedAStatus getCdmaSubscriptionSource(int32_t serial) override; + ::ndk::ScopedAStatus getFacilityLockForApp(int32_t serial, const std::string& facility, + const std::string& password, int32_t serviceClass, + const std::string& appId) override; + ::ndk::ScopedAStatus getIccCardStatus(int32_t serial) override; + ::ndk::ScopedAStatus getImsiForApp(int32_t serial, const std::string& aid) override; + ::ndk::ScopedAStatus getSimPhonebookCapacity(int32_t serial) override; + ::ndk::ScopedAStatus getSimPhonebookRecords(int32_t serial) override; + ::ndk::ScopedAStatus iccCloseLogicalChannel(int32_t serial, int32_t channelId) override; + ::ndk::ScopedAStatus iccIoForApp( + int32_t serial, const ::aidl::android::hardware::radio::sim::IccIo& iccIo) override; + ::ndk::ScopedAStatus iccOpenLogicalChannel(int32_t serial, const std::string& aid, + int32_t p2) override; + ::ndk::ScopedAStatus iccTransmitApduBasicChannel( + int32_t serial, const ::aidl::android::hardware::radio::sim::SimApdu& message) override; + ::ndk::ScopedAStatus iccTransmitApduLogicalChannel( + int32_t serial, const ::aidl::android::hardware::radio::sim::SimApdu& message) override; + ::ndk::ScopedAStatus reportStkServiceIsRunning(int32_t serial) override; + ::ndk::ScopedAStatus requestIccSimAuthentication(int32_t serial, int32_t authContext, + const std::string& authData, + const std::string& aid) override; + ::ndk::ScopedAStatus responseAcknowledgement() override; + ::ndk::ScopedAStatus sendEnvelope(int32_t serial, const std::string& command) override; + ::ndk::ScopedAStatus sendEnvelopeWithStatus(int32_t serial, + const std::string& contents) override; + ::ndk::ScopedAStatus sendTerminalResponseToSim(int32_t serial, + const std::string& commandResponse) override; + ::ndk::ScopedAStatus setAllowedCarriers( + int32_t serial, + const ::aidl::android::hardware::radio::sim::CarrierRestrictions& carriers, + ::aidl::android::hardware::radio::sim::SimLockMultiSimPolicy multiSimPolicy) override; + ::ndk::ScopedAStatus setCarrierInfoForImsiEncryption( + int32_t serial, + const ::aidl::android::hardware::radio::sim::ImsiEncryptionInfo& imsiEncryptionInfo) + override; + ::ndk::ScopedAStatus setCdmaSubscriptionSource( + int32_t serial, + ::aidl::android::hardware::radio::sim::CdmaSubscriptionSource cdmaSub) override; + ::ndk::ScopedAStatus setFacilityLockForApp( // + int32_t serial, const std::string& facility, bool lockState, const std::string& passwd, + int32_t serviceClass, const std::string& appId) override; + ::ndk::ScopedAStatus setResponseFunctions( + const std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse>& + radioSimResponse, + const std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication>& + radioSimIndication) override; + ::ndk::ScopedAStatus setSimCardPower( + int32_t serial, ::aidl::android::hardware::radio::sim::CardPowerState powerUp) override; + ::ndk::ScopedAStatus setUiccSubscription( + int32_t serial, + const ::aidl::android::hardware::radio::sim::SelectUiccSub& uiccSub) override; + ::ndk::ScopedAStatus supplyIccPin2ForApp(int32_t serial, const std::string& pin2, + const std::string& aid) override; + ::ndk::ScopedAStatus supplyIccPinForApp(int32_t serial, const std::string& pin, + const std::string& aid) override; + ::ndk::ScopedAStatus supplyIccPuk2ForApp(int32_t serial, const std::string& puk2, + const std::string& pin2, + const std::string& aid) override; + ::ndk::ScopedAStatus supplyIccPukForApp(int32_t serial, const std::string& puk, + const std::string& pin, + const std::string& aid) override; + ::ndk::ScopedAStatus supplySimDepersonalization( + int32_t serial, ::aidl::android::hardware::radio::sim::PersoSubstate persoType, + const std::string& controlKey) override; + ::ndk::ScopedAStatus updateSimPhonebookRecords( + int32_t serial, + const ::aidl::android::hardware::radio::sim::PhonebookRecordInfo& recordInfo) override; + + public: + using RadioCompatBase::RadioCompatBase; +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/sim/RadioIndication-sim.cpp b/radio/aidl/compat/libradiocompat/sim/RadioIndication-sim.cpp new file mode 100644 index 0000000000..6b906c62f3 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/sim/RadioIndication-sim.cpp @@ -0,0 +1,121 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "SimIndication" + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::sim; + +void RadioIndication::setResponseFunction(std::shared_ptr simCb) { + CHECK(simCb); + mSimCb = simCb; +} + +Return RadioIndication::carrierInfoForImsiEncryption(V1_0::RadioIndicationType type) { + LOG_CALL << type; + CHECK_CB(mSimCb); + mSimCb->carrierInfoForImsiEncryption(toAidl(type)); + return {}; +} + +Return RadioIndication::cdmaSubscriptionSourceChanged( + V1_0::RadioIndicationType type, V1_0::CdmaSubscriptionSource cdmaSource) { + LOG_CALL << type; + CHECK_CB(mSimCb); + mSimCb->cdmaSubscriptionSourceChanged(toAidl(type), aidl::CdmaSubscriptionSource(cdmaSource)); + return {}; +} + +Return RadioIndication::simPhonebookChanged(V1_0::RadioIndicationType type) { + LOG_CALL << type; + CHECK_CB(mSimCb); + mSimCb->simPhonebookChanged(toAidl(type)); + return {}; +} + +Return RadioIndication::simPhonebookRecordsReceived( + V1_0::RadioIndicationType type, V1_6::PbReceivedStatus status, + const hidl_vec& rec) { + LOG_CALL << type; + CHECK_CB(mSimCb); + mSimCb->simPhonebookRecordsReceived(toAidl(type), aidl::PbReceivedStatus(status), toAidl(rec)); + return {}; +} + +Return RadioIndication::simRefresh(V1_0::RadioIndicationType type, + const V1_0::SimRefreshResult& refreshResult) { + LOG_CALL << type; + CHECK_CB(mSimCb); + mSimCb->simRefresh(toAidl(type), toAidl(refreshResult)); + return {}; +} + +Return RadioIndication::simStatusChanged(V1_0::RadioIndicationType type) { + LOG_CALL << type; + CHECK_CB(mSimCb); + mSimCb->simStatusChanged(toAidl(type)); + return {}; +} + +Return RadioIndication::stkEventNotify(V1_0::RadioIndicationType type, + const hidl_string& cmd) { + LOG_CALL << type; + CHECK_CB(mSimCb); + mSimCb->stkEventNotify(toAidl(type), cmd); + return {}; +} + +Return RadioIndication::stkProactiveCommand(V1_0::RadioIndicationType type, + const hidl_string& cmd) { + LOG_CALL << type; + CHECK_CB(mSimCb); + mSimCb->stkProactiveCommand(toAidl(type), cmd); + return {}; +} + +Return RadioIndication::stkSessionEnd(V1_0::RadioIndicationType type) { + LOG_CALL << type; + CHECK_CB(mSimCb); + mSimCb->stkSessionEnd(toAidl(type)); + return {}; +} + +Return RadioIndication::subscriptionStatusChanged(V1_0::RadioIndicationType type, + bool activate) { + LOG_CALL << type; + CHECK_CB(mSimCb); + mSimCb->subscriptionStatusChanged(toAidl(type), activate); + return {}; +} + +Return RadioIndication::uiccApplicationsEnablementChanged(V1_0::RadioIndicationType type, + bool enabled) { + LOG_CALL << type; + CHECK_CB(mSimCb); + mSimCb->uiccApplicationsEnablementChanged(toAidl(type), enabled); + return {}; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/sim/RadioResponse-sim.cpp b/radio/aidl/compat/libradiocompat/sim/RadioResponse-sim.cpp new file mode 100644 index 0000000000..2dfbc50fcd --- /dev/null +++ b/radio/aidl/compat/libradiocompat/sim/RadioResponse-sim.cpp @@ -0,0 +1,366 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "SimResponse" + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::sim; + +void RadioResponse::setResponseFunction(std::shared_ptr simCb) { + CHECK(simCb); + mSimCb = simCb; +} + +Return RadioResponse::areUiccApplicationsEnabledResponse(const V1_0::RadioResponseInfo& info, + bool enabled) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->areUiccApplicationsEnabledResponse(toAidl(info), enabled); + return {}; +} + +Return RadioResponse::changeIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->changeIccPin2ForAppResponse(toAidl(info), remainingRetries); + return {}; +} + +Return RadioResponse::changeIccPinForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->changeIccPinForAppResponse(toAidl(info), remainingRetries); + return {}; +} + +Return RadioResponse::enableUiccApplicationsResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->enableUiccApplicationsResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::getAllowedCarriersResponse( // + const V1_0::RadioResponseInfo& info, bool allAllowed, const V1_0::CarrierRestrictions& cr) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + aidl::CarrierRestrictions aidlCr = toAidl(cr); + if (allAllowed) aidlCr = {}; + mSimCb->getAllowedCarriersResponse(toAidl(info), aidlCr, {}); + return {}; +} + +Return RadioResponse::getAllowedCarriersResponse_1_4( + const V1_0::RadioResponseInfo& info, const V1_4::CarrierRestrictionsWithPriority& carriers, + V1_4::SimLockMultiSimPolicy multiSimPolicy) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->getAllowedCarriersResponse(toAidl(info), toAidl(carriers), + aidl::SimLockMultiSimPolicy(multiSimPolicy)); + return {}; +} + +Return RadioResponse::getCDMASubscriptionResponse( + const V1_0::RadioResponseInfo& info, const hidl_string& mdn, const hidl_string& hSid, + const hidl_string& hNid, const hidl_string& min, const hidl_string& prl) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->getCdmaSubscriptionResponse(toAidl(info), mdn, hSid, hNid, min, prl); + return {}; +} + +Return RadioResponse::getCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info, + V1_0::CdmaSubscriptionSource s) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->getCdmaSubscriptionSourceResponse(toAidl(info), aidl::CdmaSubscriptionSource(s)); + return {}; +} + +Return RadioResponse::getFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t response) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->getFacilityLockForAppResponse(toAidl(info), response); + return {}; +} + +Return RadioResponse::getIccCardStatusResponse(const V1_0::RadioResponseInfo& info, + const V1_0::CardStatus& cardStatus) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus)); + return {}; +} + +Return RadioResponse::getIccCardStatusResponse_1_2(const V1_0::RadioResponseInfo& info, + const V1_2::CardStatus& cardStatus) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus)); + return {}; +} + +Return RadioResponse::getIccCardStatusResponse_1_4(const V1_0::RadioResponseInfo& info, + const V1_4::CardStatus& cardStatus) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus)); + return {}; +} + +Return RadioResponse::getIccCardStatusResponse_1_5(const V1_0::RadioResponseInfo& info, + const V1_5::CardStatus& cardStatus) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus)); + return {}; +} + +Return RadioResponse::getIMSIForAppResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& imsi) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->getImsiForAppResponse(toAidl(info), imsi); + return {}; +} + +Return RadioResponse::getSimPhonebookCapacityResponse( + const V1_6::RadioResponseInfo& info, const V1_6::PhonebookCapacity& capacity) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->getSimPhonebookCapacityResponse(toAidl(info), toAidl(capacity)); + return {}; +} + +Return RadioResponse::getSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->getSimPhonebookRecordsResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::iccCloseLogicalChannelResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->iccCloseLogicalChannelResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::iccIOForAppResponse(const V1_0::RadioResponseInfo& info, + const V1_0::IccIoResult& iccIo) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->iccIoForAppResponse(toAidl(info), toAidl(iccIo)); + return {}; +} + +Return RadioResponse::iccOpenLogicalChannelResponse( // + const V1_0::RadioResponseInfo& info, int32_t chanId, const hidl_vec& selectResp) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->iccOpenLogicalChannelResponse(toAidl(info), chanId, toAidl(selectResp)); + return {}; +} + +Return RadioResponse::iccTransmitApduBasicChannelResponse(const V1_0::RadioResponseInfo& info, + const V1_0::IccIoResult& result) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->iccTransmitApduBasicChannelResponse(toAidl(info), toAidl(result)); + return {}; +} + +Return RadioResponse::iccTransmitApduLogicalChannelResponse( + const V1_0::RadioResponseInfo& info, const V1_0::IccIoResult& result) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->iccTransmitApduLogicalChannelResponse(toAidl(info), toAidl(result)); + return {}; +} + +Return RadioResponse::reportStkServiceIsRunningResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->reportStkServiceIsRunningResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::requestIccSimAuthenticationResponse(const V1_0::RadioResponseInfo& info, + const V1_0::IccIoResult& result) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->requestIccSimAuthenticationResponse(toAidl(info), toAidl(result)); + return {}; +} + +Return RadioResponse::requestIsimAuthenticationResponse(const V1_0::RadioResponseInfo& info, + const hidl_string&) { + LOG_CALL << info.serial; + LOG(ERROR) << "requestIsimAuthenticationResponse is not supposed to be called"; + return {}; +} + +Return RadioResponse::sendEnvelopeResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& commandResponse) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->sendEnvelopeResponse(toAidl(info), commandResponse); + return {}; +} + +Return RadioResponse::sendEnvelopeWithStatusResponse(const V1_0::RadioResponseInfo& info, + const V1_0::IccIoResult& iccIo) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->sendEnvelopeWithStatusResponse(toAidl(info), toAidl(iccIo)); + return {}; +} + +Return RadioResponse::sendTerminalResponseToSimResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->sendTerminalResponseToSimResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setAllowedCarriersResponse(const V1_0::RadioResponseInfo& info, + int32_t numAllowed) { + LOG_CALL << info.serial << ' ' << numAllowed; + CHECK_CB(mSimCb); + mSimCb->setAllowedCarriersResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setAllowedCarriersResponse_1_4(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->setAllowedCarriersResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setCarrierInfoForImsiEncryptionResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->setCarrierInfoForImsiEncryptionResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->setCdmaSubscriptionSourceResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t retry) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->setFacilityLockForAppResponse(toAidl(info), retry); + return {}; +} + +Return RadioResponse::setSimCardPowerResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->setSimCardPowerResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setSimCardPowerResponse_1_1(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->setSimCardPowerResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setSimCardPowerResponse_1_6(const V1_6::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->setSimCardPowerResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setUiccSubscriptionResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->setUiccSubscriptionResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::supplyIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->supplyIccPin2ForAppResponse(toAidl(info), remainingRetries); + return {}; +} + +Return RadioResponse::supplyIccPinForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->supplyIccPinForAppResponse(toAidl(info), remainingRetries); + return {}; +} + +Return RadioResponse::supplyIccPuk2ForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->supplyIccPuk2ForAppResponse(toAidl(info), remainingRetries); + return {}; +} + +Return RadioResponse::supplyIccPukForAppResponse(const V1_0::RadioResponseInfo& info, + int32_t remainingRetries) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->supplyIccPukForAppResponse(toAidl(info), remainingRetries); + return {}; +} + +Return RadioResponse::supplySimDepersonalizationResponse(const V1_0::RadioResponseInfo& info, + V1_5::PersoSubstate persoType, + int32_t rRet) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->supplySimDepersonalizationResponse(toAidl(info), aidl::PersoSubstate(persoType), rRet); + return {}; +} + +Return RadioResponse::updateSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info, + int32_t updatedRecordIndex) { + LOG_CALL << info.serial; + CHECK_CB(mSimCb); + mSimCb->updateSimPhonebookRecordsResponse(toAidl(info), updatedRecordIndex); + return {}; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp b/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp new file mode 100644 index 0000000000..ca27918024 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp @@ -0,0 +1,295 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "Sim" + +namespace android::hardware::radio::compat { + +using ::ndk::ScopedAStatus; +namespace aidl = ::aidl::android::hardware::radio::sim; +constexpr auto ok = &ScopedAStatus::ok; + +ScopedAStatus RadioSim::areUiccApplicationsEnabled(int32_t serial) { + LOG_CALL << serial; + mHal1_5->areUiccApplicationsEnabled(serial); + return ok(); +} + +ScopedAStatus RadioSim::changeIccPin2ForApp(int32_t serial, const std::string& oldPin2, + const std::string& newPin2, const std::string& aid) { + LOG_CALL << serial; + mHal1_5->changeIccPin2ForApp(serial, oldPin2, newPin2, aid); + return ok(); +} + +ScopedAStatus RadioSim::changeIccPinForApp(int32_t serial, const std::string& oldPin, + const std::string& newPin, const std::string& aid) { + LOG_CALL << serial; + mHal1_5->changeIccPinForApp(serial, oldPin, newPin, aid); + return ok(); +} + +ScopedAStatus RadioSim::enableUiccApplications(int32_t serial, bool enable) { + LOG_CALL << serial; + mHal1_5->enableUiccApplications(serial, enable); + return ok(); +} + +ScopedAStatus RadioSim::getAllowedCarriers(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getAllowedCarriers(serial); + return ok(); +} + +ScopedAStatus RadioSim::getCdmaSubscription(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getCDMASubscription(serial); + return ok(); +} + +ScopedAStatus RadioSim::getCdmaSubscriptionSource(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getCdmaSubscriptionSource(serial); + return ok(); +} + +ScopedAStatus RadioSim::getFacilityLockForApp( // + int32_t serial, const std::string& facility, const std::string& password, + int32_t serviceClass, const std::string& appId) { + LOG_CALL << serial; + mHal1_5->getFacilityLockForApp(serial, facility, password, serviceClass, appId); + return ok(); +} + +ScopedAStatus RadioSim::getIccCardStatus(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getIccCardStatus(serial); + return ok(); +} + +ScopedAStatus RadioSim::getImsiForApp(int32_t serial, const std::string& aid) { + LOG_CALL << serial; + mHal1_5->getImsiForApp(serial, aid); + return ok(); +} + +ScopedAStatus RadioSim::getSimPhonebookCapacity(int32_t serial) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->getSimPhonebookCapacity(serial); + } else { + respond().getSimPhonebookCapacityResponse(notSupported(serial), {}); + } + return ok(); +} + +ScopedAStatus RadioSim::getSimPhonebookRecords(int32_t serial) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->getSimPhonebookRecords(serial); + } else { + respond().getSimPhonebookRecordsResponse(notSupported(serial)); + } + return ok(); +} + +ScopedAStatus RadioSim::iccCloseLogicalChannel(int32_t serial, int32_t channelId) { + LOG_CALL << serial; + mHal1_5->iccCloseLogicalChannel(serial, channelId); + return ok(); +} + +ScopedAStatus RadioSim::iccIoForApp(int32_t serial, const aidl::IccIo& iccIo) { + LOG_CALL << serial; + mHal1_5->iccIOForApp(serial, toHidl(iccIo)); + return ok(); +} + +ScopedAStatus RadioSim::iccOpenLogicalChannel(int32_t serial, const std::string& aid, int32_t p2) { + LOG_CALL << serial; + mHal1_5->iccOpenLogicalChannel(serial, aid, p2); + return ok(); +} + +ScopedAStatus RadioSim::iccTransmitApduBasicChannel(int32_t serial, const aidl::SimApdu& message) { + LOG_CALL << serial; + mHal1_5->iccTransmitApduBasicChannel(serial, toHidl(message)); + return ok(); +} + +ScopedAStatus RadioSim::iccTransmitApduLogicalChannel(int32_t serial, + const aidl::SimApdu& message) { + LOG_CALL << serial; + mHal1_5->iccTransmitApduLogicalChannel(serial, toHidl(message)); + return ok(); +} + +ScopedAStatus RadioSim::reportStkServiceIsRunning(int32_t serial) { + LOG_CALL << serial; + mHal1_5->reportStkServiceIsRunning(serial); + return ok(); +} + +ScopedAStatus RadioSim::requestIccSimAuthentication( // + int32_t serial, int32_t authContext, const std::string& authData, const std::string& aid) { + LOG_CALL << serial; + mHal1_5->requestIccSimAuthentication(serial, authContext, authData, aid); + return ok(); +} + +ScopedAStatus RadioSim::responseAcknowledgement() { + LOG_CALL; + mHal1_5->responseAcknowledgement(); + return ok(); +} + +ScopedAStatus RadioSim::sendEnvelope(int32_t serial, const std::string& command) { + LOG_CALL << serial; + mHal1_5->sendEnvelope(serial, command); + return ok(); +} + +ScopedAStatus RadioSim::sendEnvelopeWithStatus(int32_t serial, const std::string& contents) { + LOG_CALL << serial; + mHal1_5->sendEnvelopeWithStatus(serial, contents); + return ok(); +} + +ScopedAStatus RadioSim::sendTerminalResponseToSim(int32_t serial, + const std::string& commandResponse) { + LOG_CALL << serial; + mHal1_5->sendTerminalResponseToSim(serial, commandResponse); + return ok(); +} + +ScopedAStatus RadioSim::setAllowedCarriers( // + int32_t serial, const aidl::CarrierRestrictions& carriers, aidl::SimLockMultiSimPolicy mp) { + LOG_CALL << serial; + mHal1_5->setAllowedCarriers_1_4(serial, toHidl(carriers), V1_4::SimLockMultiSimPolicy(mp)); + return ok(); +} + +ScopedAStatus RadioSim::setCarrierInfoForImsiEncryption( + int32_t serial, const aidl::ImsiEncryptionInfo& imsiEncryptionInfo) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->setCarrierInfoForImsiEncryption_1_6(serial, toHidl_1_6(imsiEncryptionInfo)); + } else { + mHal1_5->setCarrierInfoForImsiEncryption(serial, toHidl(imsiEncryptionInfo)); + } + return ok(); +} + +ScopedAStatus RadioSim::setCdmaSubscriptionSource(int32_t serial, + aidl::CdmaSubscriptionSource cdmaSub) { + LOG_CALL << serial; + mHal1_5->setCdmaSubscriptionSource(serial, V1_0::CdmaSubscriptionSource(cdmaSub)); + return ok(); +} + +ScopedAStatus RadioSim::setFacilityLockForApp( // + int32_t serial, const std::string& facility, bool lockState, const std::string& password, + int32_t serviceClass, const std::string& appId) { + LOG_CALL << serial; + mHal1_5->setFacilityLockForApp(serial, facility, lockState, password, serviceClass, appId); + return ok(); +} + +ScopedAStatus RadioSim::setResponseFunctions( + const std::shared_ptr& simResponse, + const std::shared_ptr& simIndication) { + LOG_CALL << simResponse << ' ' << simIndication; + + CHECK(simResponse); + CHECK(simIndication); + + mRadioResponse->setResponseFunction(simResponse); + mRadioIndication->setResponseFunction(simIndication); + + return ok(); +} + +ScopedAStatus RadioSim::setSimCardPower(int32_t serial, aidl::CardPowerState powerUp) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->setSimCardPower_1_6(serial, V1_1::CardPowerState(powerUp)); + } else { + mHal1_5->setSimCardPower_1_1(serial, V1_1::CardPowerState(powerUp)); + } + return ok(); +} + +ScopedAStatus RadioSim::setUiccSubscription(int32_t serial, const aidl::SelectUiccSub& uiccSub) { + LOG_CALL << serial; + mHal1_5->setUiccSubscription(serial, toHidl(uiccSub)); + return ok(); +} + +ScopedAStatus RadioSim::supplyIccPin2ForApp(int32_t serial, const std::string& pin2, + const std::string& aid) { + LOG_CALL << serial; + mHal1_5->supplyIccPin2ForApp(serial, pin2, aid); + return ok(); +} + +ScopedAStatus RadioSim::supplyIccPinForApp(int32_t serial, const std::string& pin, + const std::string& aid) { + LOG_CALL << serial; + mHal1_5->supplyIccPinForApp(serial, pin, aid); + return ok(); +} + +ScopedAStatus RadioSim::supplyIccPuk2ForApp(int32_t serial, const std::string& puk2, + const std::string& pin2, const std::string& aid) { + LOG_CALL << serial; + mHal1_5->supplyIccPuk2ForApp(serial, puk2, pin2, aid); + return ok(); +} + +ScopedAStatus RadioSim::supplyIccPukForApp(int32_t serial, const std::string& puk, + const std::string& pin, const std::string& aid) { + LOG_CALL << serial; + mHal1_5->supplyIccPukForApp(serial, puk, pin, aid); + return ok(); +} + +ScopedAStatus RadioSim::supplySimDepersonalization(int32_t serial, aidl::PersoSubstate pss, + const std::string& controlKey) { + LOG_CALL << serial; + mHal1_5->supplySimDepersonalization(serial, V1_5::PersoSubstate(pss), controlKey); + return ok(); +} + +ScopedAStatus RadioSim::updateSimPhonebookRecords(int32_t serial, + const aidl::PhonebookRecordInfo& recordInfo) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->updateSimPhonebookRecords(serial, toHidl(recordInfo)); + } else { + respond().updateSimPhonebookRecordsResponse(notSupported(serial), 0); + } + return ok(); +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/sim/structs.cpp b/radio/aidl/compat/libradiocompat/sim/structs.cpp new file mode 100644 index 0000000000..97a21a1e79 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/sim/structs.cpp @@ -0,0 +1,221 @@ +/* + * 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 "structs.h" + +#include "commonStructs.h" + +#include "collections.h" + +#include + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::sim; + +V1_0::IccIo toHidl(const aidl::IccIo& icc) { + return { + .command = icc.command, + .fileId = icc.fileId, + .path = icc.path, + .p1 = icc.p1, + .p2 = icc.p2, + .p3 = icc.p3, + .data = icc.data, + .pin2 = icc.pin2, + .aid = icc.aid, + }; +} + +V1_0::SimApdu toHidl(const aidl::SimApdu& apdu) { + return { + .sessionId = apdu.sessionId, + .cla = apdu.cla, + .instruction = apdu.instruction, + .p1 = apdu.p1, + .p2 = apdu.p2, + .p3 = apdu.p3, + .data = apdu.data, + }; +} + +aidl::Carrier toAidl(const V1_0::Carrier& carrier) { + return { + .mcc = carrier.mcc, + .mnc = carrier.mnc, + .matchType = static_cast(carrier.matchType), + .matchData = carrier.matchData, + }; +} + +V1_0::Carrier toHidl(const aidl::Carrier& carrier) { + return { + .mcc = carrier.mcc, + .mnc = carrier.mnc, + .matchType = V1_0::CarrierMatchType{carrier.matchType}, + .matchData = carrier.matchData, + }; +} + +aidl::CarrierRestrictions toAidl(const V1_0::CarrierRestrictions& cr) { + return { + .allowedCarriers = toAidl(cr.allowedCarriers), + .excludedCarriers = toAidl(cr.excludedCarriers), + .allowedCarriersPrioritized = true, + }; +} + +aidl::CarrierRestrictions toAidl(const V1_4::CarrierRestrictionsWithPriority& cr) { + return { + .allowedCarriers = toAidl(cr.allowedCarriers), + .excludedCarriers = toAidl(cr.excludedCarriers), + .allowedCarriersPrioritized = cr.allowedCarriersPrioritized, + }; +} + +V1_4::CarrierRestrictionsWithPriority toHidl(const aidl::CarrierRestrictions& cr) { + return { + .allowedCarriers = toHidl(cr.allowedCarriers), + .excludedCarriers = toHidl(cr.excludedCarriers), + .allowedCarriersPrioritized = cr.allowedCarriersPrioritized, + }; +} + +V1_1::ImsiEncryptionInfo toHidl(const aidl::ImsiEncryptionInfo& info) { + return { + .mcc = info.mcc, + .mnc = info.mnc, + .carrierKey = info.carrierKey, + .keyIdentifier = info.keyIdentifier, + .expirationTime = info.expirationTime, + }; +} + +V1_6::ImsiEncryptionInfo toHidl_1_6(const aidl::ImsiEncryptionInfo& info) { + return { + .base = toHidl(info), + .keyType = V1_6::PublicKeyType{info.keyType}, + }; +} + +V1_0::SelectUiccSub toHidl(const aidl::SelectUiccSub& sub) { + return { + .slot = sub.slot, + .appIndex = sub.appIndex, + .subType = {}, + .actStatus = {}, + }; +} + +aidl::PhonebookRecordInfo toAidl(const V1_6::PhonebookRecordInfo& info) { + return { + .recordId = static_cast(info.recordId), + .name = info.name, + .number = info.number, + .emails = toAidl(info.emails), + .additionalNumbers = toAidl(info.additionalNumbers), + }; +} + +V1_6::PhonebookRecordInfo toHidl(const aidl::PhonebookRecordInfo& info) { + return { + .recordId = static_cast(info.recordId), + .name = info.name, + .number = info.number, + .emails = toHidl(info.emails), + .additionalNumbers = toHidl(info.additionalNumbers), + }; +} + +aidl::SimRefreshResult toAidl(const V1_0::SimRefreshResult& res) { + return { + .type = static_cast(res.type), + .efId = res.efId, + .aid = res.aid, + }; +} + +aidl::CardStatus toAidl(const V1_0::CardStatus& status) { + return toAidl(V1_2::CardStatus{status, 0, "", ""}); +} + +aidl::CardStatus toAidl(const V1_2::CardStatus& status) { + return toAidl(V1_4::CardStatus{status, ""}); +} + +aidl::CardStatus toAidl(const V1_4::CardStatus& status) { + auto aidlStatus = toAidl(V1_5::CardStatus{status, {}}); + aidlStatus.applications = toAidl(status.base.base.applications); + return aidlStatus; +} + +aidl::CardStatus toAidl(const V1_5::CardStatus& status) { + return { + .cardState = static_cast(status.base.base.base.cardState), + .universalPinState = aidl::PinState(status.base.base.base.universalPinState), + .gsmUmtsSubscriptionAppIndex = status.base.base.base.gsmUmtsSubscriptionAppIndex, + .cdmaSubscriptionAppIndex = status.base.base.base.cdmaSubscriptionAppIndex, + .imsSubscriptionAppIndex = status.base.base.base.imsSubscriptionAppIndex, + .applications = toAidl(status.applications), + .atr = status.base.base.atr, + .iccid = status.base.base.iccid, + .eid = status.base.eid, + // TODO(b/203699028): we don't know portId here (but we can get it from RadioConfig) + .slotMap = {static_cast(status.base.base.physicalSlotId), 0}, + }; +} + +aidl::AppStatus toAidl(const V1_0::AppStatus& status) { + return toAidl({status, V1_5::PersoSubstate(status.persoSubstate)}); +} + +aidl::AppStatus toAidl(const V1_5::AppStatus& status) { + return { + .appType = static_cast(status.base.appType), + .appState = static_cast(status.base.appState), + .persoSubstate = aidl::PersoSubstate(status.persoSubstate), + .aidPtr = status.base.aidPtr, + .appLabelPtr = status.base.appLabelPtr, + .pin1Replaced = (status.base.pin1Replaced != 0), + .pin1 = aidl::PinState(status.base.pin1), + .pin2 = aidl::PinState(status.base.pin2), + }; +} + +aidl::PhonebookCapacity toAidl(const V1_6::PhonebookCapacity& c) { + return { + .maxAdnRecords = c.maxAdnRecords, + .usedAdnRecords = c.usedAdnRecords, + .maxEmailRecords = c.maxEmailRecords, + .usedEmailRecords = c.usedEmailRecords, + .maxAdditionalNumberRecords = c.maxAdditionalNumberRecords, + .usedAdditionalNumberRecords = c.usedAdditionalNumberRecords, + .maxNameLen = c.maxNameLen, + .maxNumberLen = c.maxNumberLen, + .maxEmailLen = c.maxEmailLen, + .maxAdditionalNumberLen = c.maxAdditionalNumberLen, + }; +} + +aidl::IccIoResult toAidl(const V1_0::IccIoResult& iir) { + return { + .sw1 = iir.sw1, + .sw2 = iir.sw2, + .simResponse = iir.simResponse, + }; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/sim/structs.h b/radio/aidl/compat/libradiocompat/sim/structs.h new file mode 100644 index 0000000000..54099b7ca9 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/sim/structs.h @@ -0,0 +1,75 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace android::hardware::radio::compat { + +V1_0::IccIo toHidl(const ::aidl::android::hardware::radio::sim::IccIo& icc); + +V1_0::SimApdu toHidl(const ::aidl::android::hardware::radio::sim::SimApdu& apdu); + +::aidl::android::hardware::radio::sim::Carrier toAidl(const V1_0::Carrier& carrier); +V1_0::Carrier toHidl(const ::aidl::android::hardware::radio::sim::Carrier& carrier); + +::aidl::android::hardware::radio::sim::CarrierRestrictions // +toAidl(const V1_0::CarrierRestrictions& cr); +::aidl::android::hardware::radio::sim::CarrierRestrictions // +toAidl(const V1_4::CarrierRestrictionsWithPriority& cr); +V1_4::CarrierRestrictionsWithPriority // +toHidl(const ::aidl::android::hardware::radio::sim::CarrierRestrictions& cr); + +V1_1::ImsiEncryptionInfo // +toHidl(const ::aidl::android::hardware::radio::sim::ImsiEncryptionInfo& info); +V1_6::ImsiEncryptionInfo // +toHidl_1_6(const ::aidl::android::hardware::radio::sim::ImsiEncryptionInfo& info); + +V1_0::SelectUiccSub toHidl(const ::aidl::android::hardware::radio::sim::SelectUiccSub& sub); + +::aidl::android::hardware::radio::sim::PhonebookRecordInfo // +toAidl(const V1_6::PhonebookRecordInfo& info); +V1_6::PhonebookRecordInfo // +toHidl(const ::aidl::android::hardware::radio::sim::PhonebookRecordInfo& info); + +::aidl::android::hardware::radio::sim::SimRefreshResult // +toAidl(const V1_0::SimRefreshResult& res); + +::aidl::android::hardware::radio::sim::CardStatus toAidl(const V1_0::CardStatus& status); +::aidl::android::hardware::radio::sim::CardStatus toAidl(const V1_2::CardStatus& status); +::aidl::android::hardware::radio::sim::CardStatus toAidl(const V1_4::CardStatus& status); +::aidl::android::hardware::radio::sim::CardStatus toAidl(const V1_5::CardStatus& status); + +::aidl::android::hardware::radio::sim::AppStatus toAidl(const V1_0::AppStatus& status); +::aidl::android::hardware::radio::sim::AppStatus toAidl(const V1_5::AppStatus& status); + +::aidl::android::hardware::radio::sim::PhonebookCapacity toAidl(const V1_6::PhonebookCapacity& c); + +::aidl::android::hardware::radio::sim::IccIoResult toAidl(const V1_0::IccIoResult& iir); + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/service/Android.bp b/radio/aidl/compat/service/Android.bp index 82ab81f7a4..6a1cad546c 100644 --- a/radio/aidl/compat/service/Android.bp +++ b/radio/aidl/compat/service/Android.bp @@ -40,6 +40,7 @@ cc_binary { "android.hardware.radio.config@1.2", "android.hardware.radio.config@1.3", "android.hardware.radio.messaging-V1-ndk", + "android.hardware.radio.sim-V1-ndk", "android.hardware.radio@1.0", "android.hardware.radio@1.1", "android.hardware.radio@1.2", diff --git a/radio/aidl/compat/service/radio-compat.xml b/radio/aidl/compat/service/radio-compat.xml index 781f2f41c8..2164b28b46 100644 --- a/radio/aidl/compat/service/radio-compat.xml +++ b/radio/aidl/compat/service/radio-compat.xml @@ -13,5 +13,9 @@ android.hardware.radio.messaging IRadioMessaging/slot1 + + android.hardware.radio.sim + IRadioSim/slot1 + --> diff --git a/radio/aidl/compat/service/service.cpp b/radio/aidl/compat/service/service.cpp index 4d34cf120e..e6dd03d2c9 100644 --- a/radio/aidl/compat/service/service.cpp +++ b/radio/aidl/compat/service/service.cpp @@ -23,6 +23,7 @@ #include #include #include +#include namespace android::hardware::radio::service { @@ -57,6 +58,7 @@ static void publishRadio(std::string slot) { radioHidl->setResponseFunctions(responseCb, indicationCb).assertOk(); publishRadioHal(radioHidl, responseCb, indicationCb, slot); + publishRadioHal(radioHidl, responseCb, indicationCb, slot); } static void publishRadioConfig() { -- GitLab From d2e7459b240f02aa6fa5ac63c149289e2d39ab8d Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Tue, 2 Nov 2021 12:14:52 -0700 Subject: [PATCH 285/825] Implement RadioData for AIDL-HIDL Telephony HAL translator Bug: 203699028 Test: Boot and grep logcat against radiocompat Change-Id: I5770ee4125cd9e6f118200ecee889ad785e8929f --- radio/aidl/compat/libradiocompat/Android.bp | 5 + .../compat/libradiocompat/RadioIndication.cpp | 35 --- .../compat/libradiocompat/RadioResponse.cpp | 103 +------ .../aidl/compat/libradiocompat/collections.h | 52 ++++ .../compat/libradiocompat/commonStructs.cpp | 8 + .../compat/libradiocompat/commonStructs.h | 2 + .../compat/libradiocompat/data/RadioData.cpp | 180 +++++++++++ .../data/RadioIndication-data.cpp | 90 ++++++ .../data/RadioResponse-data.cpp | 199 ++++++++++++ .../compat/libradiocompat/data/structs.cpp | 288 ++++++++++++++++++ .../aidl/compat/libradiocompat/data/structs.h | 71 +++++ .../include/libradiocompat/RadioData.h | 70 +++++ .../include/libradiocompat/RadioIndication.h | 4 + .../include/libradiocompat/RadioResponse.h | 4 + radio/aidl/compat/service/Android.bp | 1 + radio/aidl/compat/service/radio-compat.xml | 4 + radio/aidl/compat/service/service.cpp | 2 + 17 files changed, 981 insertions(+), 137 deletions(-) create mode 100644 radio/aidl/compat/libradiocompat/data/RadioData.cpp create mode 100644 radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp create mode 100644 radio/aidl/compat/libradiocompat/data/RadioResponse-data.cpp create mode 100644 radio/aidl/compat/libradiocompat/data/structs.cpp create mode 100644 radio/aidl/compat/libradiocompat/data/structs.h create mode 100644 radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp index bf2c80c824..0e6496aeb3 100644 --- a/radio/aidl/compat/libradiocompat/Android.bp +++ b/radio/aidl/compat/libradiocompat/Android.bp @@ -37,6 +37,7 @@ cc_library { "android.hardware.radio.config@1.1", "android.hardware.radio.config@1.2", "android.hardware.radio.config@1.3", + "android.hardware.radio.data-V1-ndk", "android.hardware.radio.messaging-V1-ndk", "android.hardware.radio.sim-V1-ndk", "android.hardware.radio@1.0", @@ -60,6 +61,10 @@ cc_library { "config/RadioConfigIndication.cpp", "config/RadioConfigResponse.cpp", "config/structs.cpp", + "data/RadioIndication-data.cpp", + "data/RadioResponse-data.cpp", + "data/RadioData.cpp", + "data/structs.cpp", "messaging/RadioIndication-messaging.cpp", "messaging/RadioMessaging.cpp", "messaging/RadioResponse-messaging.cpp", diff --git a/radio/aidl/compat/libradiocompat/RadioIndication.cpp b/radio/aidl/compat/libradiocompat/RadioIndication.cpp index 69836e2990..b6a7e72619 100644 --- a/radio/aidl/compat/libradiocompat/RadioIndication.cpp +++ b/radio/aidl/compat/libradiocompat/RadioIndication.cpp @@ -44,11 +44,6 @@ Return RadioIndication::currentSignalStrength(V1_0::RadioIndicationType ty return {}; } -Return RadioIndication::dataCallListChanged( - V1_0::RadioIndicationType type, const hidl_vec& dcList) { - return {}; -} - Return RadioIndication::suppSvcNotify(V1_0::RadioIndicationType type, const V1_0::SuppSvcNotification& suppSvc) { return {}; @@ -151,11 +146,6 @@ Return RadioIndication::lceData(V1_0::RadioIndicationType type, return {}; } -Return RadioIndication::pcoData(V1_0::RadioIndicationType type, - const V1_0::PcoDataInfo& pco) { - return {}; -} - Return RadioIndication::modemReset(V1_0::RadioIndicationType type, const hidl_string& reason) { return {}; @@ -166,11 +156,6 @@ Return RadioIndication::networkScanResult(V1_0::RadioIndicationType type, return {}; } -Return RadioIndication::keepaliveStatus(V1_0::RadioIndicationType type, - const V1_1::KeepaliveStatus& status) { - return {}; -} - Return RadioIndication::networkScanResult_1_2(V1_0::RadioIndicationType type, const V1_2::NetworkScanResult& result) { return {}; @@ -216,11 +201,6 @@ Return RadioIndication::currentPhysicalChannelConfigs_1_4( return {}; } -Return RadioIndication::dataCallListChanged_1_4( - V1_0::RadioIndicationType type, const hidl_vec& dcList) { - return {}; -} - Return RadioIndication::currentSignalStrength_1_4( V1_0::RadioIndicationType type, const V1_4::SignalStrength& signalStrength) { return {}; @@ -249,21 +229,6 @@ Return RadioIndication::networkScanResult_1_5(V1_0::RadioIndicationType ty return {}; } -Return RadioIndication::dataCallListChanged_1_5( - V1_0::RadioIndicationType type, const hidl_vec& dcList) { - return {}; -} - -Return RadioIndication::dataCallListChanged_1_6( - V1_0::RadioIndicationType type, const hidl_vec& dcList) { - return {}; -} - -Return RadioIndication::unthrottleApn(V1_0::RadioIndicationType type, - const hidl_string& apn) { - return {}; -} - Return RadioIndication::currentLinkCapacityEstimate_1_6( V1_0::RadioIndicationType type, const V1_6::LinkCapacityEstimate& lce) { return {}; diff --git a/radio/aidl/compat/libradiocompat/RadioResponse.cpp b/radio/aidl/compat/libradiocompat/RadioResponse.cpp index 587e497693..0a38d8cff3 100644 --- a/radio/aidl/compat/libradiocompat/RadioResponse.cpp +++ b/radio/aidl/compat/libradiocompat/RadioResponse.cpp @@ -28,6 +28,7 @@ namespace android::hardware::radio::compat { Return RadioResponse::acknowledgeRequest(int32_t serial) { LOG_CALL << serial; // TODO(b/203699028): send to correct requestor or confirm if spam is not a problem + if (mDataCb) mDataCb->acknowledgeRequest(serial); if (mMessagingCb) mMessagingCb->acknowledgeRequest(serial); if (mSimCb) mSimCb->acknowledgeRequest(serial); return {}; @@ -107,11 +108,6 @@ Return RadioResponse::sendDtmfResponse(const V1_0::RadioResponseInfo& info return {}; } -Return RadioResponse::setupDataCallResponse(const V1_0::RadioResponseInfo& info, - const V1_0::SetupDataCallResult& dcResponse) { - return {}; -} - Return RadioResponse::getClirResponse(const V1_0::RadioResponseInfo& info, int32_t n, int32_t m) { return {}; @@ -143,10 +139,6 @@ Return RadioResponse::acceptCallResponse(const V1_0::RadioResponseInfo& in return {}; } -Return RadioResponse::deactivateDataCallResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::setBarringPasswordResponse(const V1_0::RadioResponseInfo& info) { return {}; } @@ -201,11 +193,6 @@ Return RadioResponse::getClipResponse(const V1_0::RadioResponseInfo& info, return {}; } -Return RadioResponse::getDataCallListResponse( - const V1_0::RadioResponseInfo& info, const hidl_vec& dcResp) { - return {}; -} - Return RadioResponse::setSuppServiceNotificationsResponse( const V1_0::RadioResponseInfo& info) { return {}; @@ -306,10 +293,6 @@ Return RadioResponse::setCellInfoListRateResponse(const V1_0::RadioRespons return {}; } -Return RadioResponse::setInitialAttachApnResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::getImsRegistrationStateResponse( // const V1_0::RadioResponseInfo& info, bool isRegd, V1_0::RadioTechnologyFamily ratFamily) { return {}; @@ -332,19 +315,11 @@ Return RadioResponse::nvResetConfigResponse(const V1_0::RadioResponseInfo& return {}; } -Return RadioResponse::setDataAllowedResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::getHardwareConfigResponse( const V1_0::RadioResponseInfo& info, const hidl_vec& config) { return {}; } -Return RadioResponse::setDataProfileResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::requestShutdownResponse(const V1_0::RadioResponseInfo& info) { return {}; } @@ -395,15 +370,6 @@ Return RadioResponse::stopNetworkScanResponse(const V1_0::RadioResponseInf return {}; } -Return RadioResponse::startKeepaliveResponse(const V1_0::RadioResponseInfo& info, - const V1_1::KeepaliveStatus& status) { - return {}; -} - -Return RadioResponse::stopKeepaliveResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::getCellInfoListResponse_1_2(const V1_0::RadioResponseInfo& info, const hidl_vec& cellInfo) { return {}; @@ -482,17 +448,6 @@ Return RadioResponse::setPreferredNetworkTypeBitmapResponse( return {}; } -Return RadioResponse::getDataCallListResponse_1_4( - const V1_0::RadioResponseInfo& info, - const hidl_vec& dcResponse) { - return {}; -} - -Return RadioResponse::setupDataCallResponse_1_4(const V1_0::RadioResponseInfo& info, - const V1_4::SetupDataCallResult& dcResponse) { - return {}; -} - Return RadioResponse::getSignalStrengthResponse_1_4( const V1_0::RadioResponseInfo& info, const V1_4::SignalStrength& signalStrength) { return {}; @@ -517,25 +472,6 @@ Return RadioResponse::startNetworkScanResponse_1_5(const V1_0::RadioRespon return {}; } -Return RadioResponse::setupDataCallResponse_1_5(const V1_0::RadioResponseInfo& info, - const V1_5::SetupDataCallResult& dcResponse) { - return {}; -} - -Return RadioResponse::getDataCallListResponse_1_5( - const V1_0::RadioResponseInfo& info, - const hidl_vec& dcResponse) { - return {}; -} - -Return RadioResponse::setInitialAttachApnResponse_1_5(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::setDataProfileResponse_1_5(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::setRadioPowerResponse_1_5(const V1_0::RadioResponseInfo& info) { return {}; } @@ -574,17 +510,6 @@ Return RadioResponse::setRadioPowerResponse_1_6(const V1_6::RadioResponseI return {}; } -Return RadioResponse::setupDataCallResponse_1_6(const V1_6::RadioResponseInfo& info, - const V1_6::SetupDataCallResult& dcResponse) { - return {}; -} - -Return RadioResponse::getDataCallListResponse_1_6( - const V1_6::RadioResponseInfo& info, - const hidl_vec& dcResponse) { - return {}; -} - Return RadioResponse::setNrDualConnectivityStateResponse( const V1_6::RadioResponseInfo& info) { return {}; @@ -595,23 +520,6 @@ Return RadioResponse::isNrDualConnectivityEnabledResponse(const V1_6::Radi return {}; } -Return RadioResponse::allocatePduSessionIdResponse(const V1_6::RadioResponseInfo& info, - int32_t id) { - return {}; -} - -Return RadioResponse::releasePduSessionIdResponse(const V1_6::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::startHandoverResponse(const V1_6::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::cancelHandoverResponse(const V1_6::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::setAllowedNetworkTypesBitmapResponse( const V1_6::RadioResponseInfo& info) { return {}; @@ -623,10 +531,6 @@ Return RadioResponse::getAllowedNetworkTypesBitmapResponse( return {}; } -Return RadioResponse::setDataThrottlingResponse(const V1_6::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::getSystemSelectionChannelsResponse( const V1_6::RadioResponseInfo& info, const hidl_vec& specifiers) { @@ -658,9 +562,4 @@ Return RadioResponse::getCurrentCallsResponse_1_6(const V1_6::RadioRespons return {}; } -Return RadioResponse::getSlicingConfigResponse(const V1_6::RadioResponseInfo& info, - const V1_6::SlicingConfig& slicingConfig) { - return {}; -} - } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/collections.h b/radio/aidl/compat/libradiocompat/collections.h index 9ef1351a8c..e3439a75d7 100644 --- a/radio/aidl/compat/libradiocompat/collections.h +++ b/radio/aidl/compat/libradiocompat/collections.h @@ -17,6 +17,9 @@ #include +#include +#include + namespace android::hardware::radio::compat { /** @@ -51,4 +54,53 @@ auto toHidl(const std::vector& inp) { return out; } +/** + * Converts T=OptionalX HIDL value to std::optional AIDL value. + * + * To convert values, the template uses toAidl functions for a given type T.value. + */ +template +std::optional toAidl(const T& opt) { + if (opt.getDiscriminator() == T::hidl_discriminator::noinit) return std::nullopt; + return toAidl(opt.value()); +} + +/** + * Converts T=OptionalX HIDL value to std::variant AIDL value. + * + * For some reason, not every OptionalX gets generated into a std::optional. + */ +template +std::variant toAidlVariant(const T& opt) { + if (opt.getDiscriminator() == T::hidl_discriminator::noinit) return false; + return toAidl(opt.value()); +} + +/** + * Converts std::optional AIDL value to T=OptionalX HIDL value. + * + * X is inferred from toAidl(T.value) declaration. Please note that toAidl(T.value) doesn't have to + * be implemented if it's not needed for anything else than giving this hint to type system. + * + * To convert values, the template uses toHidl functions for a given type T, assuming it's defined. + * + * \param opt value to convert + */ +template +T toHidl(const std::optional& opt) { + T hidl; + if (opt.has_value()) hidl.value(toHidl(*opt)); + return hidl; +} + +/** + * Converts U AIDL bitfield value to HIDL T bitfield value. + * + * \param val value to convert + */ +template +hidl_bitfield toHidlBitfield(U val) { + return static_cast(val); +} + } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/commonStructs.cpp b/radio/aidl/compat/libradiocompat/commonStructs.cpp index affd00a7ab..c25768dc27 100644 --- a/radio/aidl/compat/libradiocompat/commonStructs.cpp +++ b/radio/aidl/compat/libradiocompat/commonStructs.cpp @@ -40,6 +40,14 @@ uint8_t toAidl(int8_t v) { return v; } +int8_t toAidl(uint8_t v) { + return v; +} + +int32_t toAidl(uint32_t v) { + return v; +} + aidl::RadioIndicationType toAidl(V1_0::RadioIndicationType type) { return aidl::RadioIndicationType(type); } diff --git a/radio/aidl/compat/libradiocompat/commonStructs.h b/radio/aidl/compat/libradiocompat/commonStructs.h index 9b3115d7f8..b8599167c9 100644 --- a/radio/aidl/compat/libradiocompat/commonStructs.h +++ b/radio/aidl/compat/libradiocompat/commonStructs.h @@ -26,6 +26,8 @@ V1_6::RadioResponseInfo notSupported(int32_t serial); std::string toAidl(const hidl_string& str); hidl_string toHidl(const std::string& str); uint8_t toAidl(int8_t v); +int8_t toAidl(uint8_t v); +int32_t toAidl(uint32_t v); aidl::android::hardware::radio::RadioIndicationType toAidl(V1_0::RadioIndicationType type); aidl::android::hardware::radio::RadioResponseType toAidl(V1_0::RadioResponseType type); diff --git a/radio/aidl/compat/libradiocompat/data/RadioData.cpp b/radio/aidl/compat/libradiocompat/data/RadioData.cpp new file mode 100644 index 0000000000..fdb127318e --- /dev/null +++ b/radio/aidl/compat/libradiocompat/data/RadioData.cpp @@ -0,0 +1,180 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "Data" + +namespace android::hardware::radio::compat { + +using ::ndk::ScopedAStatus; +namespace aidl = ::aidl::android::hardware::radio::data; +namespace aidlCommon = ::aidl::android::hardware::radio; +constexpr auto ok = &ScopedAStatus::ok; + +ScopedAStatus RadioData::allocatePduSessionId(int32_t serial) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->allocatePduSessionId(serial); + } else { + respond().allocatePduSessionIdResponse(notSupported(serial), 0); + } + return ok(); +} + +ScopedAStatus RadioData::cancelHandover(int32_t serial, int32_t callId) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->cancelHandover(serial, callId); + } else { + respond().cancelHandoverResponse(notSupported(serial)); + } + return ok(); +} + +ScopedAStatus RadioData::deactivateDataCall(int32_t serial, int32_t cid, + aidl::DataRequestReason reason) { + LOG_CALL << serial; + mHal1_5->deactivateDataCall_1_2(serial, cid, V1_2::DataRequestReason(reason)); + return ok(); +} + +ScopedAStatus RadioData::getDataCallList(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getDataCallList(serial); + return ok(); +} + +ScopedAStatus RadioData::getSlicingConfig(int32_t serial) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->getSlicingConfig(serial); + } else { + respond().getSlicingConfigResponse(notSupported(serial), {}); + } + return ok(); +} + +ScopedAStatus RadioData::releasePduSessionId(int32_t serial, int32_t id) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->releasePduSessionId(serial, id); + } else { + respond().releasePduSessionIdResponse(notSupported(serial)); + } + return ok(); +} + +ScopedAStatus RadioData::responseAcknowledgement() { + LOG_CALL; + mHal1_5->responseAcknowledgement(); + return ok(); +} + +ScopedAStatus RadioData::setDataAllowed(int32_t serial, bool allow) { + LOG_CALL << serial; + mHal1_5->setDataAllowed(serial, allow); + return ok(); +} + +ScopedAStatus RadioData::setDataProfile(int32_t serial, + const std::vector& profiles) { + LOG_CALL << serial; + mHal1_5->setDataProfile_1_5(serial, toHidl(profiles)); + return ok(); +} + +ScopedAStatus RadioData::setDataThrottling(int32_t serial, aidl::DataThrottlingAction dta, + int64_t completionDurationMs) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->setDataThrottling(serial, V1_6::DataThrottlingAction(dta), completionDurationMs); + } else { + respond().setDataThrottlingResponse(notSupported(serial)); + } + return ok(); +} + +ScopedAStatus RadioData::setInitialAttachApn(int32_t serial, const aidl::DataProfileInfo& info) { + LOG_CALL << serial; + mHal1_5->setInitialAttachApn_1_5(serial, toHidl(info)); + return ok(); +} + +ScopedAStatus RadioData::setResponseFunctions( + const std::shared_ptr& dataResponse, + const std::shared_ptr& dataIndication) { + LOG_CALL << dataResponse << ' ' << dataIndication; + + CHECK(dataResponse); + CHECK(dataIndication); + + mRadioResponse->setResponseFunction(dataResponse); + mRadioIndication->setResponseFunction(dataIndication); + + return ok(); +} + +ScopedAStatus RadioData::setupDataCall( // + int32_t serial, aidlCommon::AccessNetwork accessNetwork, + const aidl::DataProfileInfo& dataProfileInfo, bool roamingAllowed, + aidl::DataRequestReason reason, const std::vector& addresses, + const std::vector& dnses, int32_t pduSessId, + const std::optional& sliceInfo, + const std::optional& trDesc, bool matchAllRuleAllowed) { + if (mHal1_6) { + mHal1_6->setupDataCall_1_6( // + serial, V1_5::AccessNetwork(accessNetwork), toHidl(dataProfileInfo), roamingAllowed, + V1_2::DataRequestReason(reason), toHidl(addresses), toHidl(dnses), pduSessId, + toHidl(sliceInfo), + toHidl(trDesc), matchAllRuleAllowed); + } else { + mHal1_5->setupDataCall_1_5( // + serial, V1_5::AccessNetwork(accessNetwork), toHidl(dataProfileInfo), roamingAllowed, + V1_2::DataRequestReason(reason), toHidl(addresses), toHidl(dnses)); + } + return ok(); +} + +ScopedAStatus RadioData::startHandover(int32_t serial, int32_t callId) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->startHandover(serial, callId); + } else { + respond().startHandoverResponse(notSupported(serial)); + } + return ok(); +} + +ScopedAStatus RadioData::startKeepalive(int32_t serial, const aidl::KeepaliveRequest& keepalive) { + LOG_CALL << serial; + mHal1_5->startKeepalive(serial, toHidl(keepalive)); + return ok(); +} + +ScopedAStatus RadioData::stopKeepalive(int32_t serial, int32_t sessionHandle) { + LOG_CALL << serial; + mHal1_5->stopKeepalive(serial, sessionHandle); + return ok(); +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp b/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp new file mode 100644 index 0000000000..f51d1a8d37 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp @@ -0,0 +1,90 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "DataIndication" + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::data; + +void RadioIndication::setResponseFunction(std::shared_ptr dataCb) { + CHECK(dataCb); + mDataCb = dataCb; +} + +Return RadioIndication::dataCallListChanged(V1_0::RadioIndicationType type, + const hidl_vec&) { + LOG_CALL << type; + LOG(ERROR) << "IRadio HAL 1.0 not supported"; + return {}; +} + +Return RadioIndication::dataCallListChanged_1_4(V1_0::RadioIndicationType type, + const hidl_vec&) { + LOG_CALL << type; + LOG(ERROR) << "IRadio HAL 1.4 not supported"; + return {}; +} + +Return RadioIndication::dataCallListChanged_1_5( + V1_0::RadioIndicationType type, const hidl_vec& dcList) { + LOG_CALL << type; + CHECK_CB(mDataCb); + mDataCb->dataCallListChanged(toAidl(type), toAidl(dcList)); + return {}; +} + +Return RadioIndication::dataCallListChanged_1_6( + V1_0::RadioIndicationType type, const hidl_vec& dcList) { + LOG_CALL << type; + CHECK_CB(mDataCb); + mDataCb->dataCallListChanged(toAidl(type), toAidl(dcList)); + return {}; +} + +Return RadioIndication::keepaliveStatus(V1_0::RadioIndicationType type, + const V1_1::KeepaliveStatus& status) { + LOG_CALL << type; + CHECK_CB(mDataCb); + mDataCb->keepaliveStatus(toAidl(type), toAidl(status)); + return {}; +} + +Return RadioIndication::pcoData(V1_0::RadioIndicationType type, + const V1_0::PcoDataInfo& pco) { + LOG_CALL << type; + CHECK_CB(mDataCb); + mDataCb->pcoData(toAidl(type), toAidl(pco)); + return {}; +} + +Return RadioIndication::unthrottleApn(V1_0::RadioIndicationType type, + const hidl_string& apn) { + LOG_CALL << type; + CHECK_CB(mDataCb); + mDataCb->unthrottleApn(toAidl(type), apn); + return {}; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/data/RadioResponse-data.cpp b/radio/aidl/compat/libradiocompat/data/RadioResponse-data.cpp new file mode 100644 index 0000000000..171f692d41 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/data/RadioResponse-data.cpp @@ -0,0 +1,199 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "DataResponse" + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::data; + +void RadioResponse::setResponseFunction(std::shared_ptr dataCb) { + CHECK(dataCb); + mDataCb = dataCb; +} + +Return RadioResponse::allocatePduSessionIdResponse(const V1_6::RadioResponseInfo& info, + int32_t id) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->allocatePduSessionIdResponse(toAidl(info), id); + return {}; +} + +Return RadioResponse::cancelHandoverResponse(const V1_6::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->cancelHandoverResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::deactivateDataCallResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->deactivateDataCallResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::getDataCallListResponse(const V1_0::RadioResponseInfo& info, + const hidl_vec&) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.0 not supported"; + return {}; +} + +Return RadioResponse::getDataCallListResponse_1_4( + const V1_0::RadioResponseInfo& info, const hidl_vec&) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.4 not supported"; + return {}; +} + +Return RadioResponse::getDataCallListResponse_1_5( + const V1_0::RadioResponseInfo& info, + const hidl_vec& dcResponse) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->getDataCallListResponse(toAidl(info), toAidl(dcResponse)); + return {}; +} + +Return RadioResponse::getDataCallListResponse_1_6( + const V1_6::RadioResponseInfo& info, + const hidl_vec& dcResponse) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->getDataCallListResponse(toAidl(info), toAidl(dcResponse)); + return {}; +} + +Return RadioResponse::getSlicingConfigResponse(const V1_6::RadioResponseInfo& info, + const V1_6::SlicingConfig& slicingConfig) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->getSlicingConfigResponse(toAidl(info), toAidl(slicingConfig)); + return {}; +} + +Return RadioResponse::releasePduSessionIdResponse(const V1_6::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->releasePduSessionIdResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setDataAllowedResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->setDataAllowedResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setDataProfileResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->setDataProfileResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setDataProfileResponse_1_5(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->setDataProfileResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setDataThrottlingResponse(const V1_6::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->setDataThrottlingResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setInitialAttachApnResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->setInitialAttachApnResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setInitialAttachApnResponse_1_5(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->setInitialAttachApnResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setupDataCallResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SetupDataCallResult&) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.0 not supported"; + return {}; +} + +Return RadioResponse::setupDataCallResponse_1_4(const V1_0::RadioResponseInfo& info, + const V1_4::SetupDataCallResult&) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.0 not supported"; + return {}; +} + +Return RadioResponse::setupDataCallResponse_1_5(const V1_0::RadioResponseInfo& info, + const V1_5::SetupDataCallResult& dcResponse) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->setupDataCallResponse(toAidl(info), toAidl(dcResponse)); + return {}; +} + +Return RadioResponse::setupDataCallResponse_1_6(const V1_6::RadioResponseInfo& info, + const V1_6::SetupDataCallResult& dcResponse) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->setupDataCallResponse(toAidl(info), toAidl(dcResponse)); + return {}; +} + +Return RadioResponse::startHandoverResponse(const V1_6::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->startHandoverResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::startKeepaliveResponse(const V1_0::RadioResponseInfo& info, + const V1_1::KeepaliveStatus& status) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->startKeepaliveResponse(toAidl(info), toAidl(status)); + return {}; +} + +Return RadioResponse::stopKeepaliveResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mDataCb); + mDataCb->stopKeepaliveResponse(toAidl(info)); + return {}; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/data/structs.cpp b/radio/aidl/compat/libradiocompat/data/structs.cpp new file mode 100644 index 0000000000..4ff89a1491 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/data/structs.cpp @@ -0,0 +1,288 @@ +/* + * 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 "structs.h" + +#include "commonStructs.h" + +#include "collections.h" + +#include + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::data; + +V1_5::DataProfileInfo toHidl(const aidl::DataProfileInfo& info) { + return { + .profileId = V1_0::DataProfileId{info.profileId}, + .apn = info.apn, + .protocol = V1_4::PdpProtocolType{info.protocol}, + .roamingProtocol = V1_4::PdpProtocolType{info.roamingProtocol}, + .authType = V1_0::ApnAuthType{info.authType}, + .user = info.user, + .password = info.password, + .type = V1_0::DataProfileInfoType{info.type}, + .maxConnsTime = info.maxConnsTime, + .maxConns = info.maxConns, + .waitTime = info.waitTime, + .enabled = info.enabled, + .supportedApnTypesBitmap = toHidlBitfield(info.supportedApnTypesBitmap), + .bearerBitmap = toHidlBitfield(info.bearerBitmap), + .mtuV4 = info.mtuV4, + .mtuV6 = info.mtuV6, + .preferred = info.preferred, + .persistent = info.persistent, + }; +} + +V1_5::LinkAddress toHidl(const aidl::LinkAddress& addr) { + return { + .address = addr.address, + .properties = addr.addressProperties, + .deprecationTime = static_cast(addr.deprecationTime), + .expirationTime = static_cast(addr.expirationTime), + }; +} + +aidl::SliceInfo toAidl(const V1_6::SliceInfo& info) { + return { + .sliceServiceType = static_cast(info.sst), + .sliceDifferentiator = info.sliceDifferentiator, + .mappedHplmnSst = static_cast(info.mappedHplmnSst), + .mappedHplmnSd = info.mappedHplmnSD, + .status = static_cast(info.status), + }; +} + +V1_6::SliceInfo toHidl(const aidl::SliceInfo& info) { + return { + .sst = static_cast(info.sliceServiceType), + .sliceDifferentiator = info.sliceDifferentiator, + .mappedHplmnSst = static_cast(info.mappedHplmnSst), + .mappedHplmnSD = info.mappedHplmnSd, + .status = V1_6::SliceStatus{info.status}, + }; +} + +aidl::TrafficDescriptor toAidl(const V1_6::TrafficDescriptor& descr) { + return { + .dnn = toAidl(descr.dnn), + .osAppId = toAidl(descr.osAppId), + }; +} + +V1_6::TrafficDescriptor toHidl(const aidl::TrafficDescriptor& descr) { + return { + .dnn = toHidl(descr.dnn), + .osAppId = toHidl(descr.osAppId), + }; +} + +aidl::OsAppId toAidl(const V1_6::OsAppId& appId) { + return { + .osAppId = appId.osAppId, + }; +} + +V1_6::OsAppId toHidl(const aidl::OsAppId& appId) { + return { + .osAppId = appId.osAppId, + }; +} + +V1_1::KeepaliveRequest toHidl(const aidl::KeepaliveRequest& keep) { + return { + .type = V1_1::KeepaliveType{keep.type}, + .sourceAddress = keep.sourceAddress, + .sourcePort = keep.sourcePort, + .destinationAddress = keep.destinationAddress, + .destinationPort = keep.destinationPort, + .maxKeepaliveIntervalMillis = keep.maxKeepaliveIntervalMillis, + .cid = keep.cid, + }; +} + +static aidl::QosBandwidth toAidl(const V1_6::QosBandwidth& bw) { + return { + .maxBitrateKbps = static_cast(bw.maxBitrateKbps), + .guaranteedBitrateKbps = static_cast(bw.guaranteedBitrateKbps), + }; +} + +static aidl::EpsQos toAidl(const V1_6::EpsQos& qos) { + return { + .qci = qos.qci, + .downlink = toAidl(qos.downlink), + .uplink = toAidl(qos.uplink), + }; +} + +static aidl::NrQos toAidl(const V1_6::NrQos& qos) { + return { + .fiveQi = qos.fiveQi, + .downlink = toAidl(qos.downlink), + .uplink = toAidl(qos.uplink), + .qfi = static_cast(qos.qfi), + .averagingWindowMs = qos.averagingWindowMs, + }; +} + +static std::variant toAidl(const V1_6::Qos& qos) { + if (qos.getDiscriminator() == V1_6::Qos::hidl_discriminator::eps) return toAidl(qos.eps()); + if (qos.getDiscriminator() == V1_6::Qos::hidl_discriminator::nr) return toAidl(qos.nr()); + return false; +} + +aidl::SetupDataCallResult toAidl(const V1_5::SetupDataCallResult& res) { + return { + .cause = aidl::DataCallFailCause(res.cause), + .suggestedRetryTime = res.suggestedRetryTime, + .cid = res.cid, + .active = static_cast(res.active), + .type = aidl::PdpProtocolType(res.type), + .ifname = res.ifname, + .addresses = toAidl(res.addresses), + .dnses = toAidl(res.dnses), + .gateways = toAidl(res.gateways), + .pcscf = toAidl(res.pcscf), + .mtuV4 = res.mtuV4, + .mtuV6 = res.mtuV6, + }; +} + +aidl::SetupDataCallResult toAidl(const V1_6::SetupDataCallResult& res) { + return { + .cause = aidl::DataCallFailCause(res.cause), + .suggestedRetryTime = res.suggestedRetryTime, + .cid = res.cid, + .active = static_cast(res.active), + .type = aidl::PdpProtocolType(res.type), + .ifname = res.ifname, + .addresses = toAidl(res.addresses), + .dnses = toAidl(res.dnses), + .gateways = toAidl(res.gateways), + .pcscf = toAidl(res.pcscf), + .mtuV4 = res.mtuV4, + .mtuV6 = res.mtuV6, + .defaultQos = toAidl(res.defaultQos), + .qosSessions = toAidl(res.qosSessions), + .handoverFailureMode = static_cast(res.handoverFailureMode), + .pduSessionId = res.pduSessionId, + .sliceInfo = toAidl(res.sliceInfo), + .trafficDescriptors = toAidl(res.trafficDescriptors), + }; +} + +aidl::LinkAddress toAidl(const V1_5::LinkAddress& addr) { + return { + .address = addr.address, + .addressProperties = addr.properties, + .deprecationTime = static_cast(addr.deprecationTime), + .expirationTime = static_cast(addr.expirationTime), + }; +} + +aidl::QosSession toAidl(const V1_6::QosSession& sess) { + return { + .qosSessionId = sess.qosSessionId, + .qos = toAidl(sess.qos), + .qosFilters = toAidl(sess.qosFilters), + }; +} + +static aidl::PortRange toAidl(const V1_6::PortRange& range) { + return { + .start = range.start, + .end = range.end, + }; +} + +static std::optional toAidl(const V1_6::MaybePort& opt) { + if (opt.getDiscriminator() == V1_6::MaybePort::hidl_discriminator::noinit) return std::nullopt; + return toAidl(opt.range()); // can't use MaybeX template - this field is not named "value" +} + +aidl::QosFilter toAidl(const V1_6::QosFilter& filter) { + return { + .localAddresses = toAidl(filter.localAddresses), + .remoteAddresses = toAidl(filter.remoteAddresses), + .localPort = toAidl(filter.localPort), + .remotePort = toAidl(filter.remotePort), + .protocol = static_cast(filter.protocol), + .tos = toAidlVariant(filter.tos), + .flowLabel = toAidlVariant(filter.flowLabel), + .spi = toAidlVariant(filter.spi), + .direction = static_cast(filter.direction), + .precedence = filter.precedence, + }; +} + +aidl::KeepaliveStatus toAidl(const V1_1::KeepaliveStatus& status) { + return { + .sessionHandle = status.sessionHandle, + .code = static_cast(status.code), + }; +} + +aidl::PcoDataInfo toAidl(const V1_0::PcoDataInfo& info) { + return { + .cid = info.cid, + .bearerProto = info.bearerProto, + .pcoId = info.pcoId, + .contents = info.contents, + }; +} + +aidl::SlicingConfig toAidl(const V1_6::SlicingConfig& cfg) { + return { + .urspRules = toAidl(cfg.urspRules), + .sliceInfo = toAidl(cfg.sliceInfo), + }; +} + +aidl::UrspRule toAidl(const V1_6::UrspRule& rule) { + return { + .precedence = rule.precedence, + .trafficDescriptors = toAidl(rule.trafficDescriptors), + .routeSelectionDescriptor = toAidl(rule.routeSelectionDescriptor), + }; +} + +static int8_t toAidl(const V1_6::OptionalSscMode& opt) { + if (opt.getDiscriminator() == V1_6::OptionalSscMode::hidl_discriminator::noinit) { + return aidl::RouteSelectionDescriptor::SSC_MODE_UNKNOWN; + } + return static_cast(opt.value()); +} + +static aidl::PdpProtocolType toAidl(const V1_6::OptionalPdpProtocolType& opt) { + using discriminator = V1_6::OptionalPdpProtocolType::hidl_discriminator; + if (opt.getDiscriminator() == discriminator::noinit) return aidl::PdpProtocolType::UNKNOWN; + return aidl::PdpProtocolType(opt.value()); +} + +aidl::RouteSelectionDescriptor toAidl(const V1_6::RouteSelectionDescriptor& descr) { + return { + .precedence = static_cast(descr.precedence), + .sessionType = toAidl(descr.sessionType), + .sscMode = toAidl(descr.sscMode), + .sliceInfo = toAidl(descr.sliceInfo), + .dnn = toAidl(descr.dnn), + }; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/data/structs.h b/radio/aidl/compat/libradiocompat/data/structs.h new file mode 100644 index 0000000000..60fad57f51 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/data/structs.h @@ -0,0 +1,71 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace android::hardware::radio::compat { + +V1_5::DataProfileInfo toHidl(const ::aidl::android::hardware::radio::data::DataProfileInfo& info); + +V1_5::LinkAddress toHidl(const ::aidl::android::hardware::radio::data::LinkAddress& addr); + +::aidl::android::hardware::radio::data::SliceInfo toAidl(const V1_6::SliceInfo& info); +V1_6::SliceInfo toHidl(const ::aidl::android::hardware::radio::data::SliceInfo& info); + +::aidl::android::hardware::radio::data::TrafficDescriptor toAidl(const V1_6::TrafficDescriptor& td); +V1_6::TrafficDescriptor toHidl(const ::aidl::android::hardware::radio::data::TrafficDescriptor& td); + +V1_1::KeepaliveRequest toHidl(const ::aidl::android::hardware::radio::data::KeepaliveRequest& keep); + +::aidl::android::hardware::radio::data::OsAppId toAidl(const V1_6::OsAppId& appId); +V1_6::OsAppId toHidl(const ::aidl::android::hardware::radio::data::OsAppId& appId); + +::aidl::android::hardware::radio::data::SetupDataCallResult // +toAidl(const V1_5::SetupDataCallResult& res); +::aidl::android::hardware::radio::data::SetupDataCallResult // +toAidl(const V1_6::SetupDataCallResult& res); + +::aidl::android::hardware::radio::data::LinkAddress toAidl(const V1_5::LinkAddress& addr); + +::aidl::android::hardware::radio::data::QosSession toAidl(const V1_6::QosSession& session); + +::aidl::android::hardware::radio::data::QosFilter toAidl(const V1_6::QosFilter& filter); + +::aidl::android::hardware::radio::data::KeepaliveStatus toAidl(const V1_1::KeepaliveStatus& status); + +::aidl::android::hardware::radio::data::PcoDataInfo toAidl(const V1_0::PcoDataInfo& info); + +::aidl::android::hardware::radio::data::SlicingConfig toAidl(const V1_6::SlicingConfig& cfg); + +::aidl::android::hardware::radio::data::UrspRule toAidl(const V1_6::UrspRule& rule); + +::aidl::android::hardware::radio::data::RouteSelectionDescriptor // +toAidl(const V1_6::RouteSelectionDescriptor& descr); + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h new file mode 100644 index 0000000000..900a669064 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h @@ -0,0 +1,70 @@ +/* + * 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 "RadioCompatBase.h" + +#include + +namespace android::hardware::radio::compat { + +class RadioData : public RadioCompatBase, public aidl::android::hardware::radio::data::BnRadioData { + ::ndk::ScopedAStatus allocatePduSessionId(int32_t serial) override; + ::ndk::ScopedAStatus cancelHandover(int32_t serial, int32_t callId) override; + ::ndk::ScopedAStatus deactivateDataCall( + int32_t serial, int32_t cid, + ::aidl::android::hardware::radio::data::DataRequestReason reason) override; + ::ndk::ScopedAStatus getDataCallList(int32_t serial) override; + ::ndk::ScopedAStatus getSlicingConfig(int32_t serial) override; + ::ndk::ScopedAStatus releasePduSessionId(int32_t serial, int32_t id) override; + ::ndk::ScopedAStatus responseAcknowledgement() override; + ::ndk::ScopedAStatus setDataAllowed(int32_t serial, bool allow) override; + ::ndk::ScopedAStatus setDataProfile( + int32_t serial, + const std::vector<::aidl::android::hardware::radio::data::DataProfileInfo>& profiles) + override; + ::ndk::ScopedAStatus setDataThrottling( + int32_t serial, + ::aidl::android::hardware::radio::data::DataThrottlingAction dataThrottlingAction, + int64_t completionDurationMillis) override; + ::ndk::ScopedAStatus setInitialAttachApn( + int32_t serial, + const ::aidl::android::hardware::radio::data::DataProfileInfo& dpInfo) override; + ::ndk::ScopedAStatus setResponseFunctions( + const std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse>& + radioDataResponse, + const std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication>& + radioDataIndication) override; + ::ndk::ScopedAStatus setupDataCall( + int32_t serial, ::aidl::android::hardware::radio::AccessNetwork accessNetwork, + const ::aidl::android::hardware::radio::data::DataProfileInfo& dataProfileInfo, + bool roamingAllowed, ::aidl::android::hardware::radio::data::DataRequestReason reason, + const std::vector<::aidl::android::hardware::radio::data::LinkAddress>& addresses, + const std::vector& dnses, int32_t pduSessionId, + const std::optional<::aidl::android::hardware::radio::data::SliceInfo>& sliceInfo, + const std::optional<::aidl::android::hardware::radio::data::TrafficDescriptor>& trDescr, + bool matchAllRuleAllowed) override; + ::ndk::ScopedAStatus startHandover(int32_t serial, int32_t callId) override; + ::ndk::ScopedAStatus startKeepalive( + int32_t serial, + const ::aidl::android::hardware::radio::data::KeepaliveRequest& keepalive) override; + ::ndk::ScopedAStatus stopKeepalive(int32_t serial, int32_t sessionHandle) override; + + public: + using RadioCompatBase::RadioCompatBase; +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h index bc2b84107a..63142d690e 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h @@ -15,6 +15,7 @@ */ #pragma once +#include #include #include #include @@ -22,6 +23,7 @@ namespace android::hardware::radio::compat { class RadioIndication : public V1_6::IRadioIndication { + std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> mDataCb; std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> mMessagingCb; std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> mSimCb; @@ -173,6 +175,8 @@ class RadioIndication : public V1_6::IRadioIndication { const hidl_vec& records) override; public: + void setResponseFunction( + std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> dataCb); void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> radioMessagingIndication); diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h index f87e8a6d21..d06abb9624 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h @@ -15,6 +15,7 @@ */ #pragma once +#include #include #include #include @@ -22,6 +23,7 @@ namespace android::hardware::radio::compat { class RadioResponse : public V1_6::IRadioResponse { + std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> mDataCb; std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> mMessagingCb; std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> mSimCb; @@ -401,6 +403,8 @@ class RadioResponse : public V1_6::IRadioResponse { int32_t updatedRecordIndex) override; public: + void setResponseFunction( + std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> dataCb); void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> radioMessagingResponse); diff --git a/radio/aidl/compat/service/Android.bp b/radio/aidl/compat/service/Android.bp index 6a1cad546c..e97e2db73e 100644 --- a/radio/aidl/compat/service/Android.bp +++ b/radio/aidl/compat/service/Android.bp @@ -39,6 +39,7 @@ cc_binary { "android.hardware.radio.config@1.1", "android.hardware.radio.config@1.2", "android.hardware.radio.config@1.3", + "android.hardware.radio.data-V1-ndk", "android.hardware.radio.messaging-V1-ndk", "android.hardware.radio.sim-V1-ndk", "android.hardware.radio@1.0", diff --git a/radio/aidl/compat/service/radio-compat.xml b/radio/aidl/compat/service/radio-compat.xml index 2164b28b46..ac812fb91f 100644 --- a/radio/aidl/compat/service/radio-compat.xml +++ b/radio/aidl/compat/service/radio-compat.xml @@ -9,6 +9,10 @@ You can either copy the following tags to device manifest or simply uncomment them here for quick testing. + + android.hardware.radio.data + IRadioData/slot1 + android.hardware.radio.messaging IRadioMessaging/slot1 diff --git a/radio/aidl/compat/service/service.cpp b/radio/aidl/compat/service/service.cpp index e6dd03d2c9..c97b47a097 100644 --- a/radio/aidl/compat/service/service.cpp +++ b/radio/aidl/compat/service/service.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -57,6 +58,7 @@ static void publishRadio(std::string slot) { auto indicationCb = sp::make(); radioHidl->setResponseFunctions(responseCb, indicationCb).assertOk(); + publishRadioHal(radioHidl, responseCb, indicationCb, slot); publishRadioHal(radioHidl, responseCb, indicationCb, slot); publishRadioHal(radioHidl, responseCb, indicationCb, slot); } -- GitLab From 61213fead49b005f4c51bc679c5cafda30610798 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Wed, 3 Nov 2021 15:15:48 -0700 Subject: [PATCH 286/825] Implement RadioNetwork for AIDL-HIDL Telephony HAL translator Bug: 203699028 Test: Boot and grep logcat against radiocompat Change-Id: Ic44227c9e2cd38ead97d3f3dda2e028052876568 --- radio/aidl/compat/libradiocompat/Android.bp | 6 + .../compat/libradiocompat/RadioIndication.cpp | 145 ---- .../compat/libradiocompat/RadioResponse.cpp | 299 +------- .../include/libradiocompat/RadioIndication.h | 4 + .../include/libradiocompat/RadioNetwork.h | 96 +++ .../include/libradiocompat/RadioResponse.h | 4 + .../network/RadioIndication-network.cpp | 259 +++++++ .../libradiocompat/network/RadioNetwork.cpp | 281 ++++++++ .../network/RadioResponse-network.cpp | 506 +++++++++++++ .../compat/libradiocompat/network/structs.cpp | 668 ++++++++++++++++++ .../compat/libradiocompat/network/structs.h | 99 +++ .../compat/libradiocompat/network/utils.cpp | 196 +++++ .../compat/libradiocompat/network/utils.h | 25 + radio/aidl/compat/service/Android.bp | 1 + radio/aidl/compat/service/radio-compat.xml | 4 + radio/aidl/compat/service/service.cpp | 2 + 16 files changed, 2152 insertions(+), 443 deletions(-) create mode 100644 radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h create mode 100644 radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp create mode 100644 radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp create mode 100644 radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp create mode 100644 radio/aidl/compat/libradiocompat/network/structs.cpp create mode 100644 radio/aidl/compat/libradiocompat/network/structs.h create mode 100644 radio/aidl/compat/libradiocompat/network/utils.cpp create mode 100644 radio/aidl/compat/libradiocompat/network/utils.h diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp index 0e6496aeb3..fdee336f4f 100644 --- a/radio/aidl/compat/libradiocompat/Android.bp +++ b/radio/aidl/compat/libradiocompat/Android.bp @@ -39,6 +39,7 @@ cc_library { "android.hardware.radio.config@1.3", "android.hardware.radio.data-V1-ndk", "android.hardware.radio.messaging-V1-ndk", + "android.hardware.radio.network-V1-ndk", "android.hardware.radio.sim-V1-ndk", "android.hardware.radio@1.0", "android.hardware.radio@1.1", @@ -69,6 +70,11 @@ cc_library { "messaging/RadioMessaging.cpp", "messaging/RadioResponse-messaging.cpp", "messaging/structs.cpp", + "network/RadioIndication-network.cpp", + "network/RadioNetwork.cpp", + "network/RadioResponse-network.cpp", + "network/structs.cpp", + "network/utils.cpp", "sim/RadioIndication-sim.cpp", "sim/RadioResponse-sim.cpp", "sim/RadioSim.cpp", diff --git a/radio/aidl/compat/libradiocompat/RadioIndication.cpp b/radio/aidl/compat/libradiocompat/RadioIndication.cpp index b6a7e72619..90b9e752d8 100644 --- a/radio/aidl/compat/libradiocompat/RadioIndication.cpp +++ b/radio/aidl/compat/libradiocompat/RadioIndication.cpp @@ -30,25 +30,6 @@ Return RadioIndication::callStateChanged(V1_0::RadioIndicationType type) { return {}; } -Return RadioIndication::networkStateChanged(V1_0::RadioIndicationType type) { - return {}; -} - -Return RadioIndication::nitzTimeReceived(V1_0::RadioIndicationType type, - const hidl_string& nitzTime, uint64_t receivedTime) { - return {}; -} - -Return RadioIndication::currentSignalStrength(V1_0::RadioIndicationType type, - const V1_0::SignalStrength& signalStrength) { - return {}; -} - -Return RadioIndication::suppSvcNotify(V1_0::RadioIndicationType type, - const V1_0::SuppSvcNotification& suppSvc) { - return {}; -} - Return RadioIndication::stkCallSetup(V1_0::RadioIndicationType type, int64_t timeout) { return {}; } @@ -58,11 +39,6 @@ Return RadioIndication::callRing(V1_0::RadioIndicationType type, bool isGs return {}; } -Return RadioIndication::restrictedStateChanged(V1_0::RadioIndicationType type, - V1_0::PhoneRestrictedState state) { - return {}; -} - Return RadioIndication::enterEmergencyCallbackMode(V1_0::RadioIndicationType type) { return {}; } @@ -90,10 +66,6 @@ Return RadioIndication::resendIncallMute(V1_0::RadioIndicationType type) { return {}; } -Return RadioIndication::cdmaPrlChanged(V1_0::RadioIndicationType type, int32_t version) { - return {}; -} - Return RadioIndication::exitEmergencyCallbackMode(V1_0::RadioIndicationType type) { return {}; } @@ -102,20 +74,6 @@ Return RadioIndication::rilConnected(V1_0::RadioIndicationType type) { return {}; } -Return RadioIndication::voiceRadioTechChanged(V1_0::RadioIndicationType type, - V1_0::RadioTechnology rat) { - return {}; -} - -Return RadioIndication::cellInfoList(V1_0::RadioIndicationType type, - const hidl_vec& records) { - return {}; -} - -Return RadioIndication::imsNetworkStateChanged(V1_0::RadioIndicationType type) { - return {}; -} - Return RadioIndication::srvccStateNotify(V1_0::RadioIndicationType type, V1_0::SrvccState state) { return {}; @@ -141,117 +99,14 @@ Return RadioIndication::stkCallControlAlphaNotify(V1_0::RadioIndicationTyp return {}; } -Return RadioIndication::lceData(V1_0::RadioIndicationType type, - const V1_0::LceDataInfo& lce) { - return {}; -} - Return RadioIndication::modemReset(V1_0::RadioIndicationType type, const hidl_string& reason) { return {}; } -Return RadioIndication::networkScanResult(V1_0::RadioIndicationType type, - const V1_1::NetworkScanResult& result) { - return {}; -} - -Return RadioIndication::networkScanResult_1_2(V1_0::RadioIndicationType type, - const V1_2::NetworkScanResult& result) { - return {}; -} - -Return RadioIndication::cellInfoList_1_2(V1_0::RadioIndicationType type, - const hidl_vec& records) { - return {}; -} - -Return RadioIndication::currentLinkCapacityEstimate(V1_0::RadioIndicationType type, - const V1_2::LinkCapacityEstimate& lce) { - return {}; -} - -Return RadioIndication::currentPhysicalChannelConfigs( - V1_0::RadioIndicationType type, const hidl_vec& configs) { - return {}; -} - -Return RadioIndication::currentSignalStrength_1_2( - V1_0::RadioIndicationType type, const V1_2::SignalStrength& signalStrength) { - return {}; -} - Return RadioIndication::currentEmergencyNumberList( V1_0::RadioIndicationType type, const hidl_vec& emergencyNumbers) { return {}; } -Return RadioIndication::cellInfoList_1_4(V1_0::RadioIndicationType type, - const hidl_vec& records) { - return {}; -} - -Return RadioIndication::networkScanResult_1_4(V1_0::RadioIndicationType type, - const V1_4::NetworkScanResult& result) { - return {}; -} - -Return RadioIndication::currentPhysicalChannelConfigs_1_4( - V1_0::RadioIndicationType type, const hidl_vec& configs) { - return {}; -} - -Return RadioIndication::currentSignalStrength_1_4( - V1_0::RadioIndicationType type, const V1_4::SignalStrength& signalStrength) { - return {}; -} - -Return RadioIndication::registrationFailed( // - V1_0::RadioIndicationType type, const V1_5::CellIdentity& cellIdentity, - const hidl_string& chosenPlmn, hidl_bitfield domain, int32_t causeCode, - int32_t additionalCauseCode) { - return {}; -} - -Return RadioIndication::barringInfoChanged(V1_0::RadioIndicationType type, - const V1_5::CellIdentity& cellIdentity, - const hidl_vec& barringInfos) { - return {}; -} - -Return RadioIndication::cellInfoList_1_5(V1_0::RadioIndicationType type, - const hidl_vec& records) { - return {}; -} - -Return RadioIndication::networkScanResult_1_5(V1_0::RadioIndicationType type, - const V1_5::NetworkScanResult& result) { - return {}; -} - -Return RadioIndication::currentLinkCapacityEstimate_1_6( - V1_0::RadioIndicationType type, const V1_6::LinkCapacityEstimate& lce) { - return {}; -} - -Return RadioIndication::currentSignalStrength_1_6( - V1_0::RadioIndicationType type, const V1_6::SignalStrength& signalStrength) { - return {}; -} - -Return RadioIndication::cellInfoList_1_6(V1_0::RadioIndicationType type, - const hidl_vec& records) { - return {}; -} - -Return RadioIndication::networkScanResult_1_6(V1_0::RadioIndicationType type, - const V1_6::NetworkScanResult& result) { - return {}; -} - -Return RadioIndication::currentPhysicalChannelConfigs_1_6( - V1_0::RadioIndicationType type, const hidl_vec& configs) { - return {}; -} - } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/RadioResponse.cpp b/radio/aidl/compat/libradiocompat/RadioResponse.cpp index 0a38d8cff3..001330fbd9 100644 --- a/radio/aidl/compat/libradiocompat/RadioResponse.cpp +++ b/radio/aidl/compat/libradiocompat/RadioResponse.cpp @@ -30,15 +30,11 @@ Return RadioResponse::acknowledgeRequest(int32_t serial) { // TODO(b/203699028): send to correct requestor or confirm if spam is not a problem if (mDataCb) mDataCb->acknowledgeRequest(serial); if (mMessagingCb) mMessagingCb->acknowledgeRequest(serial); + if (mNetworkCb) mNetworkCb->acknowledgeRequest(serial); if (mSimCb) mSimCb->acknowledgeRequest(serial); return {}; } -Return RadioResponse::supplyNetworkDepersonalizationResponse( - const V1_0::RadioResponseInfo& info, int32_t remainingRetries) { - return {}; -} - Return RadioResponse::getCurrentCallsResponse(const V1_0::RadioResponseInfo& info, const hidl_vec& calls) { return {}; @@ -79,27 +75,6 @@ Return RadioResponse::getLastCallFailCauseResponse( return {}; } -Return RadioResponse::getSignalStrengthResponse(const V1_0::RadioResponseInfo& info, - const V1_0::SignalStrength& sigStrength) { - return {}; -} - -Return RadioResponse::getVoiceRegistrationStateResponse( - const V1_0::RadioResponseInfo& info, const V1_0::VoiceRegStateResult& voiceRegResponse) { - return {}; -} - -Return RadioResponse::getDataRegistrationStateResponse( - const V1_0::RadioResponseInfo& info, const V1_0::DataRegStateResult& dataRegResponse) { - return {}; -} - -Return RadioResponse::getOperatorResponse( // - const V1_0::RadioResponseInfo& info, const hidl_string& longName, - const hidl_string& shortName, const hidl_string& numeric) { - return {}; -} - Return RadioResponse::setRadioPowerResponse(const V1_0::RadioResponseInfo& info) { return {}; } @@ -139,30 +114,6 @@ Return RadioResponse::acceptCallResponse(const V1_0::RadioResponseInfo& in return {}; } -Return RadioResponse::setBarringPasswordResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getNetworkSelectionModeResponse(const V1_0::RadioResponseInfo& info, - bool manual) { - return {}; -} - -Return RadioResponse::setNetworkSelectionModeAutomaticResponse( - const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::setNetworkSelectionModeManualResponse( - const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getAvailableNetworksResponse( - const V1_0::RadioResponseInfo& info, const hidl_vec& networkInfos) { - return {}; -} - Return RadioResponse::startDtmfResponse(const V1_0::RadioResponseInfo& info) { return {}; } @@ -193,20 +144,6 @@ Return RadioResponse::getClipResponse(const V1_0::RadioResponseInfo& info, return {}; } -Return RadioResponse::setSuppServiceNotificationsResponse( - const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::setBandModeResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getAvailableBandModesResponse( - const V1_0::RadioResponseInfo& info, const hidl_vec& bandModes) { - return {}; -} - Return RadioResponse::handleStkCallSetupRequestFromSimResponse( const V1_0::RadioResponseInfo& info) { return {}; @@ -216,33 +153,6 @@ Return RadioResponse::explicitCallTransferResponse(const V1_0::RadioRespon return {}; } -Return RadioResponse::setPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info, - V1_0::PreferredNetworkType nwType) { - return {}; -} - -Return RadioResponse::getNeighboringCidsResponse( - const V1_0::RadioResponseInfo& info, const hidl_vec& cells) { - return {}; -} - -Return RadioResponse::setLocationUpdatesResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::setCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info, - V1_0::CdmaRoamingType type) { - return {}; -} - Return RadioResponse::setTTYModeResponse(const V1_0::RadioResponseInfo& info) { return {}; } @@ -279,25 +189,6 @@ Return RadioResponse::exitEmergencyCallbackModeResponse(const V1_0::RadioR return {}; } -Return RadioResponse::getVoiceRadioTechnologyResponse(const V1_0::RadioResponseInfo& info, - V1_0::RadioTechnology rat) { - return {}; -} - -Return RadioResponse::getCellInfoListResponse(const V1_0::RadioResponseInfo& info, - const hidl_vec& cellInfo) { - return {}; -} - -Return RadioResponse::setCellInfoListRateResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getImsRegistrationStateResponse( // - const V1_0::RadioResponseInfo& info, bool isRegd, V1_0::RadioTechnologyFamily ratFamily) { - return {}; -} - Return RadioResponse::nvReadItemResponse(const V1_0::RadioResponseInfo& info, const hidl_string& result) { return {}; @@ -334,21 +225,6 @@ Return RadioResponse::setRadioCapabilityResponse(const V1_0::RadioResponse return {}; } -Return RadioResponse::startLceServiceResponse(const V1_0::RadioResponseInfo& info, - const V1_0::LceStatusInfo& statusInfo) { - return {}; -} - -Return RadioResponse::stopLceServiceResponse(const V1_0::RadioResponseInfo& info, - const V1_0::LceStatusInfo& statusInfo) { - return {}; -} - -Return RadioResponse::pullLceDataResponse(const V1_0::RadioResponseInfo& info, - const V1_0::LceDataInfo& lceInfo) { - return {}; -} - Return RadioResponse::getModemActivityInfoResponse( const V1_0::RadioResponseInfo& info, const V1_0::ActivityStatsInfo& activityInfo) { return {}; @@ -358,58 +234,11 @@ Return RadioResponse::sendDeviceStateResponse(const V1_0::RadioResponseInf return {}; } -Return RadioResponse::setIndicationFilterResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::startNetworkScanResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::stopNetworkScanResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getCellInfoListResponse_1_2(const V1_0::RadioResponseInfo& info, - const hidl_vec& cellInfo) { - return {}; -} - -Return RadioResponse::setSignalStrengthReportingCriteriaResponse( - const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::setLinkCapacityReportingCriteriaResponse( - const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::getCurrentCallsResponse_1_2(const V1_0::RadioResponseInfo& info, const hidl_vec& calls) { return {}; } -Return RadioResponse::getSignalStrengthResponse_1_2( - const V1_0::RadioResponseInfo& info, const V1_2::SignalStrength& signalStrength) { - return {}; -} - -Return RadioResponse::getVoiceRegistrationStateResponse_1_2( - const V1_0::RadioResponseInfo& info, const V1_2::VoiceRegStateResult& voiceRegResponse) { - return {}; -} - -Return RadioResponse::getDataRegistrationStateResponse_1_2( - const V1_0::RadioResponseInfo& info, const V1_2::DataRegStateResult& dataRegResponse) { - return {}; -} - -Return RadioResponse::setSystemSelectionChannelsResponse( - const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::enableModemResponse(const V1_0::RadioResponseInfo& info) { return {}; } @@ -423,140 +252,14 @@ Return RadioResponse::emergencyDialResponse(const V1_0::RadioResponseInfo& return {}; } -Return RadioResponse::startNetworkScanResponse_1_4(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getCellInfoListResponse_1_4(const V1_0::RadioResponseInfo& info, - const hidl_vec& cellInfo) { - return {}; -} - -Return RadioResponse::getDataRegistrationStateResponse_1_4( - const V1_0::RadioResponseInfo& info, const V1_4::DataRegStateResult& dataRegResponse) { - return {}; -} - -Return RadioResponse::getPreferredNetworkTypeBitmapResponse( - const V1_0::RadioResponseInfo& info, - hidl_bitfield networkTypeBitmap) { - return {}; -} - -Return RadioResponse::setPreferredNetworkTypeBitmapResponse( - const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getSignalStrengthResponse_1_4( - const V1_0::RadioResponseInfo& info, const V1_4::SignalStrength& signalStrength) { - return {}; -} - -Return RadioResponse::setSignalStrengthReportingCriteriaResponse_1_5( - const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::setLinkCapacityReportingCriteriaResponse_1_5( - const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::setSystemSelectionChannelsResponse_1_5( - const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::startNetworkScanResponse_1_5(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::setRadioPowerResponse_1_5(const V1_0::RadioResponseInfo& info) { return {}; } -Return RadioResponse::setIndicationFilterResponse_1_5(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getBarringInfoResponse( - const V1_0::RadioResponseInfo& info, const V1_5::CellIdentity& cellIdentity, - const hidl_vec& barringInfos) { - return {}; -} - -Return RadioResponse::getVoiceRegistrationStateResponse_1_5( - const V1_0::RadioResponseInfo& info, const V1_5::RegStateResult& voiceRegResponse) { - return {}; -} - -Return RadioResponse::getDataRegistrationStateResponse_1_5( - const V1_0::RadioResponseInfo& info, const V1_5::RegStateResult& dataRegResponse) { - return {}; -} - -Return RadioResponse::getCellInfoListResponse_1_5(const V1_0::RadioResponseInfo& info, - const hidl_vec& cellInfo) { - return {}; -} - -Return RadioResponse::setNetworkSelectionModeManualResponse_1_5( - const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::setRadioPowerResponse_1_6(const V1_6::RadioResponseInfo& info) { return {}; } -Return RadioResponse::setNrDualConnectivityStateResponse( - const V1_6::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::isNrDualConnectivityEnabledResponse(const V1_6::RadioResponseInfo& info, - bool isEnabled) { - return {}; -} - -Return RadioResponse::setAllowedNetworkTypesBitmapResponse( - const V1_6::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getAllowedNetworkTypesBitmapResponse( - const V1_6::RadioResponseInfo& info, - hidl_bitfield networkTypeBitmap) { - return {}; -} - -Return RadioResponse::getSystemSelectionChannelsResponse( - const V1_6::RadioResponseInfo& info, - const hidl_vec& specifiers) { - return {}; -} - -Return RadioResponse::getCellInfoListResponse_1_6(const V1_6::RadioResponseInfo& info, - const hidl_vec& cellInfo) { - return {}; -} - -Return RadioResponse::getSignalStrengthResponse_1_6( - const V1_6::RadioResponseInfo& info, const V1_6::SignalStrength& signalStrength) { - return {}; -} - -Return RadioResponse::getVoiceRegistrationStateResponse_1_6( - const V1_6::RadioResponseInfo& info, const V1_6::RegStateResult& voiceRegResponse) { - return {}; -} - -Return RadioResponse::getDataRegistrationStateResponse_1_6( - const V1_6::RadioResponseInfo& info, const V1_6::RegStateResult& dataRegResponse) { - return {}; -} - Return RadioResponse::getCurrentCallsResponse_1_6(const V1_6::RadioResponseInfo& info, const hidl_vec& calls) { return {}; diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h index 63142d690e..c7a2629b7d 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -26,6 +27,7 @@ class RadioIndication : public V1_6::IRadioIndication { std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> mDataCb; std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> mMessagingCb; + std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkIndication> mNetworkCb; std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> mSimCb; // IRadioIndication @ 1.0 @@ -180,6 +182,8 @@ class RadioIndication : public V1_6::IRadioIndication { void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> radioMessagingIndication); + void setResponseFunction( + std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkIndication> ni); void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> simCb); }; diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h new file mode 100644 index 0000000000..c776fd1f09 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h @@ -0,0 +1,96 @@ +/* + * 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 "RadioCompatBase.h" + +#include + +namespace android::hardware::radio::compat { + +class RadioNetwork : public RadioCompatBase, + public aidl::android::hardware::radio::network::BnRadioNetwork { + ::ndk::ScopedAStatus getAllowedNetworkTypesBitmap(int32_t serial) override; + ::ndk::ScopedAStatus getAvailableBandModes(int32_t serial) override; + ::ndk::ScopedAStatus getAvailableNetworks(int32_t serial) override; + ::ndk::ScopedAStatus getBarringInfo(int32_t serial) override; + ::ndk::ScopedAStatus getCdmaRoamingPreference(int32_t serial) override; + ::ndk::ScopedAStatus getCellInfoList(int32_t serial) override; + ::ndk::ScopedAStatus getDataRegistrationState(int32_t serial) override; + ::ndk::ScopedAStatus getImsRegistrationState(int32_t serial) override; + ::ndk::ScopedAStatus getNetworkSelectionMode(int32_t serial) override; + ::ndk::ScopedAStatus getOperator(int32_t serial) override; + ::ndk::ScopedAStatus getSignalStrength(int32_t serial) override; + ::ndk::ScopedAStatus getSystemSelectionChannels(int32_t serial) override; + ::ndk::ScopedAStatus getVoiceRadioTechnology(int32_t serial) override; + ::ndk::ScopedAStatus getVoiceRegistrationState(int32_t serial) override; + ::ndk::ScopedAStatus isNrDualConnectivityEnabled(int32_t serial) override; + ::ndk::ScopedAStatus responseAcknowledgement() override; + ::ndk::ScopedAStatus setAllowedNetworkTypesBitmap( + int32_t serial, + ::aidl::android::hardware::radio::RadioAccessFamily networkTypeBitmap) override; + ::ndk::ScopedAStatus setBandMode( + int32_t serial, ::aidl::android::hardware::radio::network::RadioBandMode mode) override; + ::ndk::ScopedAStatus setBarringPassword(int32_t serial, const std::string& facility, + const std::string& oldPassword, + const std::string& newPassword) override; + ::ndk::ScopedAStatus setCdmaRoamingPreference( + int32_t serial, + ::aidl::android::hardware::radio::network::CdmaRoamingType type) override; + ::ndk::ScopedAStatus setCellInfoListRate(int32_t serial, int32_t rate) override; + ::ndk::ScopedAStatus setIndicationFilter( + int32_t serial, + ::aidl::android::hardware::radio::network::IndicationFilter indicationFilter) override; + ::ndk::ScopedAStatus setLinkCapacityReportingCriteria( + int32_t serial, int32_t hysteresisMs, int32_t hysteresisDlKbps, + int32_t hysteresisUlKbps, const std::vector& thresholdsDownlinkKbps, + const std::vector& thresholdsUplinkKbps, + ::aidl::android::hardware::radio::AccessNetwork accessNetwork) override; + ::ndk::ScopedAStatus setLocationUpdates(int32_t serial, bool enable) override; + ::ndk::ScopedAStatus setNetworkSelectionModeAutomatic(int32_t serial) override; + ::ndk::ScopedAStatus setNetworkSelectionModeManual( + int32_t serial, const std::string& operatorNumeric, + ::aidl::android::hardware::radio::AccessNetwork ran) override; + ::ndk::ScopedAStatus setNrDualConnectivityState( + int32_t serial, + ::aidl::android::hardware::radio::network::NrDualConnectivityState nrSt) override; + ::ndk::ScopedAStatus setResponseFunctions( + const std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse>& + radioNetworkResponse, + const std::shared_ptr< + ::aidl::android::hardware::radio::network::IRadioNetworkIndication>& + radioNetworkIndication) override; + ::ndk::ScopedAStatus setSignalStrengthReportingCriteria( + int32_t serial, + const std::vector<::aidl::android::hardware::radio::network::SignalThresholdInfo>& + signalThresholdInfos) override; + ::ndk::ScopedAStatus setSuppServiceNotifications(int32_t serial, bool enable) override; + ::ndk::ScopedAStatus setSystemSelectionChannels( + int32_t serial, bool specifyChannels, + const std::vector<::aidl::android::hardware::radio::network::RadioAccessSpecifier>& + specifiers) override; + ::ndk::ScopedAStatus startNetworkScan( + int32_t serial, + const ::aidl::android::hardware::radio::network::NetworkScanRequest& request) override; + ::ndk::ScopedAStatus stopNetworkScan(int32_t serial) override; + ::ndk::ScopedAStatus supplyNetworkDepersonalization(int32_t serial, + const std::string& netPin) override; + + public: + using RadioCompatBase::RadioCompatBase; +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h index d06abb9624..b87ca6e235 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -26,6 +27,7 @@ class RadioResponse : public V1_6::IRadioResponse { std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> mDataCb; std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> mMessagingCb; + std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> mNetworkCb; std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> mSimCb; // IRadioResponse @ 1.0 @@ -408,6 +410,8 @@ class RadioResponse : public V1_6::IRadioResponse { void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> radioMessagingResponse); + void setResponseFunction( + std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> nwCb); void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> simCb); }; diff --git a/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp b/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp new file mode 100644 index 0000000000..899b133bfe --- /dev/null +++ b/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp @@ -0,0 +1,259 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "NetworkIndication" + +namespace android::hardware::radio::compat { + +using ::aidl::android::hardware::radio::RadioTechnology; +namespace aidl = ::aidl::android::hardware::radio::network; + +void RadioIndication::setResponseFunction(std::shared_ptr netCb) { + CHECK(netCb); + mNetworkCb = netCb; +} + +Return RadioIndication::barringInfoChanged(V1_0::RadioIndicationType type, + const V1_5::CellIdentity& cellIdentity, + const hidl_vec& barringInfos) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->barringInfoChanged(toAidl(type), toAidl(cellIdentity), toAidl(barringInfos)); + return {}; +} + +Return RadioIndication::cdmaPrlChanged(V1_0::RadioIndicationType type, int32_t version) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->cdmaPrlChanged(toAidl(type), version); + return {}; +} + +Return RadioIndication::cellInfoList(V1_0::RadioIndicationType type, + const hidl_vec&) { + LOG_CALL << type; + LOG(ERROR) << "IRadio HAL 1.0 not supported"; + return {}; +} + +Return RadioIndication::cellInfoList_1_2(V1_0::RadioIndicationType type, + const hidl_vec&) { + LOG_CALL << type; + LOG(ERROR) << "IRadio HAL 1.2 not supported"; + return {}; +} + +Return RadioIndication::cellInfoList_1_4(V1_0::RadioIndicationType type, + const hidl_vec&) { + LOG_CALL << type; + LOG(ERROR) << "IRadio HAL 1.4 not supported"; + return {}; +} + +Return RadioIndication::cellInfoList_1_5(V1_0::RadioIndicationType type, + const hidl_vec& records) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->cellInfoList(toAidl(type), toAidl(records)); + return {}; +} + +Return RadioIndication::cellInfoList_1_6(V1_0::RadioIndicationType type, + const hidl_vec& records) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->cellInfoList(toAidl(type), toAidl(records)); + return {}; +} + +Return RadioIndication::currentLinkCapacityEstimate(V1_0::RadioIndicationType type, + const V1_2::LinkCapacityEstimate& lce) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->currentLinkCapacityEstimate(toAidl(type), toAidl(lce)); + return {}; +} + +Return RadioIndication::currentLinkCapacityEstimate_1_6( + V1_0::RadioIndicationType type, const V1_6::LinkCapacityEstimate& lce) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->currentLinkCapacityEstimate(toAidl(type), toAidl(lce)); + return {}; +} + +Return RadioIndication::currentPhysicalChannelConfigs( + V1_0::RadioIndicationType type, const hidl_vec&) { + LOG_CALL << type; + LOG(ERROR) << "IRadio HAL 1.0 not supported"; + return {}; +} + +Return RadioIndication::currentPhysicalChannelConfigs_1_4( + V1_0::RadioIndicationType type, const hidl_vec& configs) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->currentPhysicalChannelConfigs(toAidl(type), toAidl(configs)); + return {}; +} + +Return RadioIndication::currentPhysicalChannelConfigs_1_6( + V1_0::RadioIndicationType type, const hidl_vec& configs) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->currentPhysicalChannelConfigs(toAidl(type), toAidl(configs)); + return {}; +} + +Return RadioIndication::currentSignalStrength(V1_0::RadioIndicationType type, + const V1_0::SignalStrength&) { + LOG_CALL << type; + LOG(ERROR) << "IRadio HAL 1.0 not supported"; + return {}; +} + +Return RadioIndication::currentSignalStrength_1_2(V1_0::RadioIndicationType type, + const V1_2::SignalStrength&) { + LOG_CALL << type; + LOG(ERROR) << "IRadio HAL 1.2 not supported"; + return {}; +} + +Return RadioIndication::currentSignalStrength_1_4( + V1_0::RadioIndicationType type, const V1_4::SignalStrength& signalStrength) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->currentSignalStrength(toAidl(type), toAidl(signalStrength)); + return {}; +} + +Return RadioIndication::currentSignalStrength_1_6( + V1_0::RadioIndicationType type, const V1_6::SignalStrength& signalStrength) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->currentSignalStrength(toAidl(type), toAidl(signalStrength)); + return {}; +} + +Return RadioIndication::imsNetworkStateChanged(V1_0::RadioIndicationType type) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->imsNetworkStateChanged(toAidl(type)); + return {}; +} + +Return RadioIndication::networkScanResult(V1_0::RadioIndicationType type, + const V1_1::NetworkScanResult&) { + LOG_CALL << type; + LOG(ERROR) << "IRadio HAL 1.0 not supported"; + return {}; +} + +Return RadioIndication::networkScanResult_1_2(V1_0::RadioIndicationType type, + const V1_2::NetworkScanResult&) { + LOG_CALL << type; + LOG(ERROR) << "IRadio HAL 1.2 not supported"; + return {}; +} + +Return RadioIndication::networkScanResult_1_4(V1_0::RadioIndicationType type, + const V1_4::NetworkScanResult&) { + LOG_CALL << type; + LOG(ERROR) << "IRadio HAL 1.4 not supported"; + return {}; +} + +Return RadioIndication::networkScanResult_1_5(V1_0::RadioIndicationType type, + const V1_5::NetworkScanResult& result) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->networkScanResult(toAidl(type), toAidl(result)); + return {}; +} + +Return RadioIndication::networkScanResult_1_6(V1_0::RadioIndicationType type, + const V1_6::NetworkScanResult& result) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->networkScanResult(toAidl(type), toAidl(result)); + return {}; +} + +Return RadioIndication::networkStateChanged(V1_0::RadioIndicationType type) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->networkStateChanged(toAidl(type)); + return {}; +} + +Return RadioIndication::nitzTimeReceived(V1_0::RadioIndicationType type, + const hidl_string& nitzTime, uint64_t receivedTime) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->nitzTimeReceived(toAidl(type), nitzTime, receivedTime, 0); + return {}; +} + +Return RadioIndication::registrationFailed( // + V1_0::RadioIndicationType type, const V1_5::CellIdentity& cellIdentity, + const hidl_string& chosenPlmn, hidl_bitfield domain, int32_t causeCode, + int32_t additionalCauseCode) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->registrationFailed(toAidl(type), toAidl(cellIdentity), chosenPlmn, + aidl::Domain(domain), causeCode, additionalCauseCode); + return {}; +} + +Return RadioIndication::restrictedStateChanged(V1_0::RadioIndicationType type, + V1_0::PhoneRestrictedState state) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->restrictedStateChanged(toAidl(type), aidl::PhoneRestrictedState(state)); + return {}; +} + +Return RadioIndication::suppSvcNotify(V1_0::RadioIndicationType type, + const V1_0::SuppSvcNotification& suppSvc) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->suppSvcNotify(toAidl(type), toAidl(suppSvc)); + return {}; +} + +Return RadioIndication::voiceRadioTechChanged(V1_0::RadioIndicationType type, + V1_0::RadioTechnology rat) { + LOG_CALL << type; + CHECK_CB(mNetworkCb); + mNetworkCb->voiceRadioTechChanged(toAidl(type), RadioTechnology(rat)); + return {}; +} + +Return RadioIndication::lceData(V1_0::RadioIndicationType type, const V1_0::LceDataInfo&) { + LOG_CALL << type; + LOG(WARNING) << "lceData indication is deprecated"; + return {}; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp new file mode 100644 index 0000000000..af0bc4619f --- /dev/null +++ b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp @@ -0,0 +1,281 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" +#include "utils.h" + +#include "collections.h" + +#define RADIO_MODULE "Network" + +namespace android::hardware::radio::compat { + +using ::aidl::android::hardware::radio::AccessNetwork; +using ::aidl::android::hardware::radio::RadioAccessFamily; +using ::ndk::ScopedAStatus; +namespace aidl = ::aidl::android::hardware::radio::network; +constexpr auto ok = &ScopedAStatus::ok; + +ScopedAStatus RadioNetwork::getAllowedNetworkTypesBitmap(int32_t serial) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->getAllowedNetworkTypesBitmap(serial); + } else { + mHal1_5->getPreferredNetworkType(serial); + } + return ok(); +} + +ScopedAStatus RadioNetwork::getAvailableBandModes(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getAvailableBandModes(serial); + return ok(); +} + +ScopedAStatus RadioNetwork::getAvailableNetworks(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getAvailableNetworks(serial); + return ok(); +} + +ScopedAStatus RadioNetwork::getBarringInfo(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getBarringInfo(serial); + return ok(); +} + +ScopedAStatus RadioNetwork::getCdmaRoamingPreference(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getCdmaRoamingPreference(serial); + return ok(); +} + +ScopedAStatus RadioNetwork::getCellInfoList(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getCellInfoList(serial); + return ok(); +} + +ScopedAStatus RadioNetwork::getDataRegistrationState(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getDataRegistrationState(serial); + return ok(); +} + +ScopedAStatus RadioNetwork::getImsRegistrationState(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getImsRegistrationState(serial); + return ok(); +} + +ScopedAStatus RadioNetwork::getNetworkSelectionMode(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getNetworkSelectionMode(serial); + return ok(); +} + +ScopedAStatus RadioNetwork::getOperator(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getOperator(serial); + return ok(); +} + +ScopedAStatus RadioNetwork::getSignalStrength(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getSignalStrength(serial); + return ok(); +} + +ScopedAStatus RadioNetwork::getSystemSelectionChannels(int32_t serial) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->getSystemSelectionChannels(serial); + } else { + respond().getSystemSelectionChannelsResponse(notSupported(serial), {}); + } + return ok(); +} + +ScopedAStatus RadioNetwork::getVoiceRadioTechnology(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getVoiceRadioTechnology(serial); + return ok(); +} + +ScopedAStatus RadioNetwork::getVoiceRegistrationState(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getVoiceRegistrationState(serial); + return ok(); +} + +ScopedAStatus RadioNetwork::isNrDualConnectivityEnabled(int32_t serial) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->isNrDualConnectivityEnabled(serial); + } else { + respond().isNrDualConnectivityEnabledResponse(notSupported(serial), false); + } + return ok(); +} + +ScopedAStatus RadioNetwork::responseAcknowledgement() { + LOG_CALL; + mHal1_5->responseAcknowledgement(); + return ok(); +} + +ScopedAStatus RadioNetwork::setAllowedNetworkTypesBitmap(int32_t serial, RadioAccessFamily ntype) { + LOG_CALL << serial; + const auto raf = toHidlBitfield(ntype); + if (mHal1_6) { + mHal1_6->setAllowedNetworkTypesBitmap(serial, raf); + } else { + mHal1_5->setPreferredNetworkType(serial, getNetworkTypeFromRaf(raf)); + } + return ok(); +} + +ScopedAStatus RadioNetwork::setBandMode(int32_t serial, aidl::RadioBandMode mode) { + LOG_CALL << serial; + mHal1_5->setBandMode(serial, V1_0::RadioBandMode(mode)); + return ok(); +} + +ScopedAStatus RadioNetwork::setBarringPassword(int32_t serial, const std::string& facility, + const std::string& oldPw, const std::string& newPw) { + LOG_CALL << serial; + mHal1_5->setBarringPassword(serial, facility, oldPw, newPw); + return ok(); +} + +ScopedAStatus RadioNetwork::setCdmaRoamingPreference(int32_t serial, aidl::CdmaRoamingType type) { + LOG_CALL << serial; + mHal1_5->setCdmaRoamingPreference(serial, V1_0::CdmaRoamingType(type)); + return ok(); +} + +ScopedAStatus RadioNetwork::setCellInfoListRate(int32_t serial, int32_t rate) { + LOG_CALL << serial; + mHal1_5->setCellInfoListRate(serial, rate); + return ok(); +} + +ScopedAStatus RadioNetwork::setIndicationFilter(int32_t serial, aidl::IndicationFilter indFilter) { + LOG_CALL << serial; + mHal1_5->setIndicationFilter(serial, toHidlBitfield(indFilter)); + return ok(); +} + +ScopedAStatus RadioNetwork::setLinkCapacityReportingCriteria( // + int32_t serial, int32_t hysteresisMs, int32_t hysteresisDlKbps, int32_t hysteresisUlKbps, + const std::vector& thrDownlinkKbps, const std::vector& thrUplinkKbps, + AccessNetwork accessNetwork) { + LOG_CALL << serial; + mHal1_5->setLinkCapacityReportingCriteria( // + serial, hysteresisMs, hysteresisDlKbps, hysteresisUlKbps, thrDownlinkKbps, + thrUplinkKbps, V1_2::AccessNetwork(accessNetwork)); + return ok(); +} + +ScopedAStatus RadioNetwork::setLocationUpdates(int32_t serial, bool enable) { + LOG_CALL << serial; + mHal1_5->setLocationUpdates(serial, enable); + return ok(); +} + +ScopedAStatus RadioNetwork::setNetworkSelectionModeAutomatic(int32_t serial) { + LOG_CALL << serial; + mHal1_5->setNetworkSelectionModeAutomatic(serial); + return ok(); +} + +ScopedAStatus RadioNetwork::setNetworkSelectionModeManual( // + int32_t serial, const std::string& opNumeric, AccessNetwork ran) { + LOG_CALL << serial; + mHal1_5->setNetworkSelectionModeManual_1_5(serial, opNumeric, V1_5::RadioAccessNetworks(ran)); + return ok(); +} + +ScopedAStatus RadioNetwork::setNrDualConnectivityState(int32_t serial, + aidl::NrDualConnectivityState st) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->setNrDualConnectivityState(serial, V1_6::NrDualConnectivityState(st)); + } else { + respond().setNrDualConnectivityStateResponse(notSupported(serial)); + } + return ok(); +} + +ScopedAStatus RadioNetwork::setResponseFunctions( + const std::shared_ptr& networkResponse, + const std::shared_ptr& networkIndication) { + LOG_CALL << networkResponse << ' ' << networkIndication; + + CHECK(networkResponse); + CHECK(networkIndication); + + mRadioResponse->setResponseFunction(networkResponse); + mRadioIndication->setResponseFunction(networkIndication); + + return ok(); +} + +ScopedAStatus RadioNetwork::setSignalStrengthReportingCriteria( + int32_t serial, const std::vector& infos) { + LOG_CALL << serial; + // TODO(b/203699028): how about other infos? + mHal1_5->setSignalStrengthReportingCriteria_1_5(serial, toHidl(infos[0]), + V1_5::AccessNetwork(infos[0].ran)); + return ok(); +} + +ScopedAStatus RadioNetwork::setSuppServiceNotifications(int32_t serial, bool enable) { + LOG_CALL << serial; + mHal1_5->setSuppServiceNotifications(serial, enable); + return ok(); +} + +ScopedAStatus RadioNetwork::setSystemSelectionChannels( // + int32_t serial, bool specifyCh, const std::vector& specifiers) { + LOG_CALL << serial; + mHal1_5->setSystemSelectionChannels_1_5(serial, specifyCh, toHidl(specifiers)); + return ok(); +} + +ScopedAStatus RadioNetwork::startNetworkScan(int32_t serial, const aidl::NetworkScanRequest& req) { + LOG_CALL << serial; + mHal1_5->startNetworkScan_1_5(serial, toHidl(req)); + return ok(); +} + +ScopedAStatus RadioNetwork::stopNetworkScan(int32_t serial) { + LOG_CALL << serial; + mHal1_5->stopNetworkScan(serial); + return ok(); +} + +ScopedAStatus RadioNetwork::supplyNetworkDepersonalization(int32_t ser, const std::string& nPin) { + LOG_CALL << ser; + mHal1_5->supplyNetworkDepersonalization(ser, nPin); + return ok(); +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp b/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp new file mode 100644 index 0000000000..81f7775e19 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp @@ -0,0 +1,506 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" +#include "utils.h" + +#include "collections.h" + +#define RADIO_MODULE "NetworkResponse" + +namespace android::hardware::radio::compat { + +using ::aidl::android::hardware::radio::RadioAccessFamily; +using ::aidl::android::hardware::radio::RadioTechnology; +using ::aidl::android::hardware::radio::RadioTechnologyFamily; +namespace aidl = ::aidl::android::hardware::radio::network; + +void RadioResponse::setResponseFunction(std::shared_ptr netCb) { + CHECK(netCb); + mNetworkCb = netCb; +} + +Return RadioResponse::getAllowedNetworkTypesBitmapResponse( + const V1_6::RadioResponseInfo& info, + hidl_bitfield networkTypeBitmap) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getAllowedNetworkTypesBitmapResponse(toAidl(info), + RadioAccessFamily(networkTypeBitmap)); + return {}; +} + +Return RadioResponse::getPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info, + V1_0::PreferredNetworkType nwType) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getAllowedNetworkTypesBitmapResponse( // + toAidl(info), RadioAccessFamily(getRafFromNetworkType(nwType))); + return {}; +} + +Return RadioResponse::getPreferredNetworkTypeBitmapResponse( + const V1_0::RadioResponseInfo& info, hidl_bitfield) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.4 not supported"; + return {}; +} + +Return RadioResponse::getAvailableBandModesResponse( + const V1_0::RadioResponseInfo& info, const hidl_vec& bandModes) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getAvailableBandModesResponse(toAidl(info), toAidl(bandModes)); + return {}; +} + +Return RadioResponse::getAvailableNetworksResponse( + const V1_0::RadioResponseInfo& info, const hidl_vec& networkInfos) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getAvailableNetworksResponse(toAidl(info), toAidl(networkInfos)); + return {}; +} + +Return RadioResponse::getBarringInfoResponse( + const V1_0::RadioResponseInfo& info, const V1_5::CellIdentity& cellIdentity, + const hidl_vec& barringInfos) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getBarringInfoResponse(toAidl(info), toAidl(cellIdentity), toAidl(barringInfos)); + return {}; +} + +Return RadioResponse::getCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info, + V1_0::CdmaRoamingType type) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getCdmaRoamingPreferenceResponse(toAidl(info), aidl::CdmaRoamingType(type)); + return {}; +} + +Return RadioResponse::getCellInfoListResponse(const V1_0::RadioResponseInfo& info, + const hidl_vec&) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.0 not supported"; + return {}; +} + +Return RadioResponse::getCellInfoListResponse_1_2(const V1_0::RadioResponseInfo& info, + const hidl_vec&) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.2 not supported"; + return {}; +} + +Return RadioResponse::getCellInfoListResponse_1_4(const V1_0::RadioResponseInfo& info, + const hidl_vec&) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.4 not supported"; + return {}; +} + +Return RadioResponse::getCellInfoListResponse_1_5(const V1_0::RadioResponseInfo& info, + const hidl_vec& cellInfo) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getCellInfoListResponse(toAidl(info), toAidl(cellInfo)); + return {}; +} + +Return RadioResponse::getCellInfoListResponse_1_6(const V1_6::RadioResponseInfo& info, + const hidl_vec& cellInfo) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getCellInfoListResponse(toAidl(info), toAidl(cellInfo)); + return {}; +} + +Return RadioResponse::getDataRegistrationStateResponse(const V1_0::RadioResponseInfo& info, + const V1_0::DataRegStateResult&) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.0 not supported"; + return {}; +} + +Return RadioResponse::getDataRegistrationStateResponse_1_2( + const V1_0::RadioResponseInfo& info, const V1_2::DataRegStateResult&) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.2 not supported"; + return {}; +} + +Return RadioResponse::getDataRegistrationStateResponse_1_4( + const V1_0::RadioResponseInfo& info, const V1_4::DataRegStateResult&) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.4 not supported"; + return {}; +} + +Return RadioResponse::getDataRegistrationStateResponse_1_5( + const V1_0::RadioResponseInfo& info, const V1_5::RegStateResult& dataRegResponse) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getDataRegistrationStateResponse(toAidl(info), toAidl(dataRegResponse)); + return {}; +} + +Return RadioResponse::getDataRegistrationStateResponse_1_6( + const V1_6::RadioResponseInfo& info, const V1_6::RegStateResult& dataRegResponse) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getDataRegistrationStateResponse(toAidl(info), toAidl(dataRegResponse)); + return {}; +} + +Return RadioResponse::getImsRegistrationStateResponse( // + const V1_0::RadioResponseInfo& info, bool isRegd, V1_0::RadioTechnologyFamily ratFamily) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getImsRegistrationStateResponse(toAidl(info), isRegd, + RadioTechnologyFamily(ratFamily)); + return {}; +} + +Return RadioResponse::getNeighboringCidsResponse(const V1_0::RadioResponseInfo& info, + const hidl_vec&) { + LOG_CALL << info.serial; + LOG(ERROR) << "getNeighboringCidsResponse is not supposed to be called"; + return {}; +} + +Return RadioResponse::getNetworkSelectionModeResponse(const V1_0::RadioResponseInfo& info, + bool manual) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getNetworkSelectionModeResponse(toAidl(info), manual); + return {}; +} + +Return RadioResponse::getOperatorResponse( // + const V1_0::RadioResponseInfo& info, const hidl_string& longName, + const hidl_string& shortName, const hidl_string& numeric) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getOperatorResponse(toAidl(info), longName, shortName, numeric); + return {}; +} + +Return RadioResponse::getSignalStrengthResponse(const V1_0::RadioResponseInfo& info, + const V1_0::SignalStrength&) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.0 not supported"; + return {}; +} + +Return RadioResponse::getSignalStrengthResponse_1_2(const V1_0::RadioResponseInfo& info, + const V1_2::SignalStrength&) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.2 not supported"; + return {}; +} + +Return RadioResponse::getSignalStrengthResponse_1_4( + const V1_0::RadioResponseInfo& info, const V1_4::SignalStrength& signalStrength) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getSignalStrengthResponse(toAidl(info), toAidl(signalStrength)); + return {}; +} + +Return RadioResponse::getSignalStrengthResponse_1_6( + const V1_6::RadioResponseInfo& info, const V1_6::SignalStrength& signalStrength) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getSignalStrengthResponse(toAidl(info), toAidl(signalStrength)); + return {}; +} + +Return RadioResponse::getSystemSelectionChannelsResponse( + const V1_6::RadioResponseInfo& info, + const hidl_vec& specifiers) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getSystemSelectionChannelsResponse(toAidl(info), toAidl(specifiers)); + return {}; +} + +Return RadioResponse::getVoiceRadioTechnologyResponse(const V1_0::RadioResponseInfo& info, + V1_0::RadioTechnology rat) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getVoiceRadioTechnologyResponse(toAidl(info), RadioTechnology(rat)); + return {}; +} + +Return RadioResponse::getVoiceRegistrationStateResponse(const V1_0::RadioResponseInfo& info, + const V1_0::VoiceRegStateResult&) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.0 not supported"; + return {}; +} + +Return RadioResponse::getVoiceRegistrationStateResponse_1_2( + const V1_0::RadioResponseInfo& info, const V1_2::VoiceRegStateResult&) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.2 not supported"; + return {}; +} + +Return RadioResponse::getVoiceRegistrationStateResponse_1_5( + const V1_0::RadioResponseInfo& info, const V1_5::RegStateResult& voiceRegResponse) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getVoiceRegistrationStateResponse(toAidl(info), toAidl(voiceRegResponse)); + return {}; +} + +Return RadioResponse::getVoiceRegistrationStateResponse_1_6( + const V1_6::RadioResponseInfo& info, const V1_6::RegStateResult& voiceRegResponse) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->getVoiceRegistrationStateResponse(toAidl(info), toAidl(voiceRegResponse)); + return {}; +} + +Return RadioResponse::isNrDualConnectivityEnabledResponse(const V1_6::RadioResponseInfo& info, + bool isEnabled) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->isNrDualConnectivityEnabledResponse(toAidl(info), isEnabled); + return {}; +} + +Return RadioResponse::pullLceDataResponse(const V1_0::RadioResponseInfo& info, + const V1_0::LceDataInfo&) { + LOG_CALL << info.serial; + LOG(ERROR) << "pullLceDataResponse is not supposed to be called"; + return {}; +} + +Return RadioResponse::setAllowedNetworkTypesBitmapResponse(const V1_6::RadioResponseInfo& i) { + LOG_CALL << i.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setAllowedNetworkTypesBitmapResponse(toAidl(i)); + return {}; +} + +Return RadioResponse::setPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setAllowedNetworkTypesBitmapResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setPreferredNetworkTypeBitmapResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + LOG(ERROR) << "IRadio HAL 1.4 not supported"; + return {}; +} + +Return RadioResponse::setBandModeResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setBandModeResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setBarringPasswordResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setBarringPasswordResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setCdmaRoamingPreferenceResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setCellInfoListRateResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setCellInfoListRateResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setIndicationFilterResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setIndicationFilterResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setIndicationFilterResponse_1_5(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setIndicationFilterResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setLinkCapacityReportingCriteriaResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setLinkCapacityReportingCriteriaResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setLinkCapacityReportingCriteriaResponse_1_5( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setLinkCapacityReportingCriteriaResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setLocationUpdatesResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setLocationUpdatesResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setNetworkSelectionModeAutomaticResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setNetworkSelectionModeAutomaticResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setNetworkSelectionModeManualResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setNetworkSelectionModeManualResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setNetworkSelectionModeManualResponse_1_5( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setNetworkSelectionModeManualResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setNrDualConnectivityStateResponse( + const V1_6::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setNrDualConnectivityStateResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setSignalStrengthReportingCriteriaResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setSignalStrengthReportingCriteriaResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setSignalStrengthReportingCriteriaResponse_1_5( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setSignalStrengthReportingCriteriaResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setSuppServiceNotificationsResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setSuppServiceNotificationsResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setSystemSelectionChannelsResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setSystemSelectionChannelsResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setSystemSelectionChannelsResponse_1_5( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->setSystemSelectionChannelsResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::startNetworkScanResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->startNetworkScanResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::startNetworkScanResponse_1_4(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->startNetworkScanResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::startNetworkScanResponse_1_5(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->startNetworkScanResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::stopNetworkScanResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->stopNetworkScanResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::supplyNetworkDepersonalizationResponse( + const V1_0::RadioResponseInfo& info, int32_t remainingRetries) { + LOG_CALL << info.serial; + CHECK_CB(mNetworkCb); + mNetworkCb->supplyNetworkDepersonalizationResponse(toAidl(info), remainingRetries); + return {}; +} + +Return RadioResponse::startLceServiceResponse(const V1_0::RadioResponseInfo& info, + const V1_0::LceStatusInfo&) { + LOG_CALL << info.serial; + LOG(WARNING) << "startLceServiceResponse is deprecated"; + return {}; +} + +Return RadioResponse::stopLceServiceResponse(const V1_0::RadioResponseInfo& info, + const V1_0::LceStatusInfo&) { + LOG_CALL << info.serial; + LOG(WARNING) << "stopLceServiceResponse is deprecated"; + return {}; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/network/structs.cpp b/radio/aidl/compat/libradiocompat/network/structs.cpp new file mode 100644 index 0000000000..87a021f03d --- /dev/null +++ b/radio/aidl/compat/libradiocompat/network/structs.cpp @@ -0,0 +1,668 @@ +/* + * 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 "structs.h" + +#include "commonStructs.h" + +#include "collections.h" + +#include + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::network; +using ::aidl::android::hardware::radio::AccessNetwork; +using ::aidl::android::hardware::radio::RadioTechnology; + +aidl::RadioBandMode toAidl(V1_0::RadioBandMode mode) { + return aidl::RadioBandMode(mode); +} + +aidl::GeranBands toAidl(V1_1::GeranBands band) { + return aidl::GeranBands(band); +} + +V1_1::GeranBands toHidl(aidl::GeranBands band) { + return V1_1::GeranBands(band); +} + +aidl::UtranBands toAidl(V1_5::UtranBands band) { + return aidl::UtranBands(band); +} + +V1_5::UtranBands toHidl(aidl::UtranBands band) { + return V1_5::UtranBands(band); +} + +aidl::EutranBands toAidl(V1_5::EutranBands band) { + return aidl::EutranBands(band); +} + +V1_5::EutranBands toHidl(aidl::EutranBands band) { + return V1_5::EutranBands(band); +} + +aidl::NgranBands toAidl(V1_5::NgranBands band) { + return aidl::NgranBands(band); +} + +V1_5::NgranBands toHidl(aidl::NgranBands band) { + return V1_5::NgranBands(band); +} + +V1_5::SignalThresholdInfo toHidl(const aidl::SignalThresholdInfo& info) { + return { + .signalMeasurement = V1_5::SignalMeasurementType{info.signalMeasurement}, + .hysteresisMs = info.hysteresisMs, + .hysteresisDb = info.hysteresisDb, + .thresholds = info.thresholds, + .isEnabled = info.isEnabled, + }; +} + +static aidl::RadioAccessSpecifierBands toAidl(const V1_5::RadioAccessSpecifier::Bands& bands) { + using Discr = V1_5::RadioAccessSpecifier::Bands::hidl_discriminator; + const auto discr = bands.getDiscriminator(); + + if (discr == Discr::geranBands) return toAidl(bands.geranBands()); + if (discr == Discr::utranBands) return toAidl(bands.utranBands()); + if (discr == Discr::eutranBands) return toAidl(bands.eutranBands()); + if (discr == Discr::ngranBands) return toAidl(bands.ngranBands()); + + return {}; +} + +static V1_5::RadioAccessSpecifier::Bands toHidl(const aidl::RadioAccessSpecifierBands& bands) { + V1_5::RadioAccessSpecifier::Bands hidl; + using Tag = aidl::RadioAccessSpecifierBands::Tag; + + if (bands.getTag() == Tag::geranBands) hidl.geranBands(toHidl(bands.get())); + if (bands.getTag() == Tag::utranBands) hidl.utranBands(toHidl(bands.get())); + if (bands.getTag() == Tag::eutranBands) hidl.eutranBands(toHidl(bands.get())); + if (bands.getTag() == Tag::ngranBands) hidl.ngranBands(toHidl(bands.get())); + + return hidl; +} + +aidl::RadioAccessSpecifier toAidl(const V1_5::RadioAccessSpecifier& spec) { + return { + .accessNetwork = AccessNetwork(spec.radioAccessNetwork), + .bands = toAidl(spec.bands), + .channels = spec.channels, + }; +} + +V1_5::RadioAccessSpecifier toHidl(const aidl::RadioAccessSpecifier& spec) { + return { + .radioAccessNetwork = V1_5::RadioAccessNetworks{spec.accessNetwork}, + .bands = toHidl(spec.bands), + .channels = spec.channels, + }; +} + +V1_5::NetworkScanRequest toHidl(const aidl::NetworkScanRequest& req) { + return { + .type = V1_1::ScanType{req.type}, + .interval = req.interval, + .specifiers = toHidl(req.specifiers), + .maxSearchTime = req.maxSearchTime, + .incrementalResults = req.incrementalResults, + .incrementalResultsPeriodicity = req.incrementalResultsPeriodicity, + .mccMncs = toHidl(req.mccMncs), + }; +} + +static aidl::OperatorInfo toAidl(const V1_2::CellIdentityOperatorNames& names) { + return { + .alphaLong = names.alphaLong, + .alphaShort = names.alphaShort, + .operatorNumeric = "", + .status = aidl::OperatorInfo::STATUS_UNKNOWN, + }; +} + +static aidl::CellIdentityGsm toAidl(const V1_5::CellIdentityGsm& ci) { + return { + .mcc = ci.base.base.mcc, + .mnc = ci.base.base.mnc, + .lac = ci.base.base.lac, + .cid = ci.base.base.cid, + .arfcn = ci.base.base.arfcn, + .bsic = static_cast(ci.base.base.bsic), + .operatorNames = toAidl(ci.base.operatorNames), + .additionalPlmns = toAidl(ci.additionalPlmns), + }; +} + +aidl::ClosedSubscriberGroupInfo toAidl(const V1_5::ClosedSubscriberGroupInfo& info) { + return { + .csgIndication = info.csgIndication, + .homeNodebName = info.homeNodebName, + .csgIdentity = info.csgIdentity, + }; +} + +static std::optional toAidl(const V1_5::OptionalCsgInfo& opt) { + using descr = V1_5::OptionalCsgInfo::hidl_discriminator; + if (opt.getDiscriminator() == descr::noinit) return std::nullopt; + return toAidl(opt.csgInfo()); +} + +static aidl::CellIdentityWcdma toAidl(const V1_5::CellIdentityWcdma& ci) { + return { + .mcc = ci.base.base.mcc, + .mnc = ci.base.base.mnc, + .lac = ci.base.base.lac, + .cid = ci.base.base.cid, + .psc = ci.base.base.psc, + .uarfcn = ci.base.base.uarfcn, + .operatorNames = toAidl(ci.base.operatorNames), + .additionalPlmns = toAidl(ci.additionalPlmns), + .csgInfo = toAidl(ci.optionalCsgInfo), + }; +} + +static aidl::CellIdentityTdscdma toAidl(const V1_5::CellIdentityTdscdma& ci) { + return { + .mcc = ci.base.base.mcc, + .mnc = ci.base.base.mnc, + .lac = ci.base.base.lac, + .cid = ci.base.base.cid, + .cpid = ci.base.base.cpid, + .uarfcn = ci.base.uarfcn, + .operatorNames = toAidl(ci.base.operatorNames), + .additionalPlmns = toAidl(ci.additionalPlmns), + .csgInfo = toAidl(ci.optionalCsgInfo), + }; +} + +static aidl::CellIdentityCdma toAidl(const V1_2::CellIdentityCdma& ci) { + return { + .networkId = ci.base.networkId, + .systemId = ci.base.systemId, + .baseStationId = ci.base.baseStationId, + .longitude = ci.base.longitude, + .latitude = ci.base.latitude, + .operatorNames = toAidl(ci.operatorNames), + }; +} + +static aidl::CellIdentityLte toAidl(const V1_5::CellIdentityLte& ci) { + return { + .mcc = ci.base.base.mcc, + .mnc = ci.base.base.mnc, + .ci = ci.base.base.ci, + .pci = ci.base.base.pci, + .tac = ci.base.base.tac, + .earfcn = ci.base.base.earfcn, + .operatorNames = toAidl(ci.base.operatorNames), + .bandwidth = ci.base.bandwidth, + .additionalPlmns = toAidl(ci.additionalPlmns), + .csgInfo = toAidl(ci.optionalCsgInfo), + .bands = toAidl(ci.bands), + }; +} + +static aidl::CellIdentityNr toAidl(const V1_5::CellIdentityNr& ci) { + return { + .mcc = ci.base.mcc, + .mnc = ci.base.mnc, + .nci = static_cast(ci.base.nci), + .pci = static_cast(ci.base.pci), + .tac = ci.base.tac, + .nrarfcn = ci.base.nrarfcn, + .operatorNames = toAidl(ci.base.operatorNames), + .additionalPlmns = toAidl(ci.additionalPlmns), + .bands = toAidl(ci.bands), + }; +} + +aidl::CellIdentity toAidl(const V1_5::CellIdentity& ci) { + using Discr = V1_5::CellIdentity::hidl_discriminator; + const auto discr = ci.getDiscriminator(); + + if (discr == Discr::gsm) return toAidl(ci.gsm()); + if (discr == Discr::wcdma) return toAidl(ci.wcdma()); + if (discr == Discr::tdscdma) return toAidl(ci.tdscdma()); + if (discr == Discr::cdma) return toAidl(ci.cdma()); + if (discr == Discr::lte) return toAidl(ci.lte()); + if (discr == Discr::nr) return toAidl(ci.nr()); + + return {}; +} + +static std::optional // +toAidl(const V1_5::BarringInfo::BarringTypeSpecificInfo& opt) { + using discr = V1_5::BarringInfo::BarringTypeSpecificInfo::hidl_discriminator; + if (opt.getDiscriminator() == discr::noinit) return std::nullopt; + + const auto& info = opt.conditional(); + return aidl::BarringTypeSpecificInfo{ + .factor = info.factor, + .timeSeconds = info.timeSeconds, + .isBarred = info.isBarred, + }; +} + +aidl::BarringInfo toAidl(const V1_5::BarringInfo& info) { + return { + .serviceType = static_cast(info.serviceType), + .barringType = static_cast(info.barringType), + .barringTypeSpecificInfo = toAidl(info.barringTypeSpecificInfo), + }; +} + +static aidl::GsmSignalStrength toAidl(const V1_0::GsmSignalStrength& sig) { + return { + .signalStrength = static_cast(sig.signalStrength), + .bitErrorRate = static_cast(sig.bitErrorRate), + .timingAdvance = sig.timingAdvance, + }; +} + +static aidl::CellInfoGsm toAidl(const V1_5::CellInfoGsm& info) { + return { + .cellIdentityGsm = toAidl(info.cellIdentityGsm), + .signalStrengthGsm = toAidl(info.signalStrengthGsm), + }; +} + +static aidl::WcdmaSignalStrength toAidl(const V1_2::WcdmaSignalStrength& sig) { + return { + .signalStrength = sig.base.signalStrength, + .bitErrorRate = sig.base.bitErrorRate, + .rscp = static_cast(sig.rscp), + .ecno = static_cast(sig.ecno), + }; +} + +static aidl::CellInfoWcdma toAidl(const V1_5::CellInfoWcdma& info) { + return { + .cellIdentityWcdma = toAidl(info.cellIdentityWcdma), + .signalStrengthWcdma = toAidl(info.signalStrengthWcdma), + }; +} + +static aidl::TdscdmaSignalStrength toAidl(const V1_2::TdscdmaSignalStrength& sig) { + return { + .signalStrength = static_cast(sig.signalStrength), + .bitErrorRate = static_cast(sig.bitErrorRate), + .rscp = static_cast(sig.rscp), + }; +} + +static aidl::CellInfoTdscdma toAidl(const V1_5::CellInfoTdscdma& info) { + return { + .cellIdentityTdscdma = toAidl(info.cellIdentityTdscdma), + .signalStrengthTdscdma = toAidl(info.signalStrengthTdscdma), + }; +} + +static aidl::LteSignalStrength toAidl(const V1_6::LteSignalStrength& sig) { + return { + .signalStrength = static_cast(sig.base.signalStrength), + .rsrp = static_cast(sig.base.rsrp), + .rsrq = static_cast(sig.base.rsrq), + .rssnr = sig.base.rssnr, + .cqi = static_cast(sig.base.cqi), + .timingAdvance = static_cast(sig.base.timingAdvance), + .cqiTableIndex = static_cast(sig.cqiTableIndex), + }; +} + +static aidl::LteSignalStrength toAidl(const V1_0::LteSignalStrength& sig) { + return toAidl({sig, 0}); +} + +static aidl::CellInfoLte toAidl(const V1_5::CellInfoLte& info) { + return { + .cellIdentityLte = toAidl(info.cellIdentityLte), + .signalStrengthLte = toAidl(info.signalStrengthLte), + }; +} + +static aidl::CellInfoLte toAidl(const V1_6::CellInfoLte& info) { + return { + .cellIdentityLte = toAidl(info.cellIdentityLte), + .signalStrengthLte = toAidl(info.signalStrengthLte), + }; +} + +static aidl::NrSignalStrength toAidl(const V1_6::NrSignalStrength& sig) { + return { + .ssRsrp = sig.base.ssRsrp, + .ssRsrq = sig.base.ssRsrq, + .ssSinr = sig.base.ssSinr, + .csiRsrp = sig.base.csiRsrp, + .csiRsrq = sig.base.csiRsrq, + .csiSinr = sig.base.csiSinr, + .csiCqiTableIndex = static_cast(sig.csiCqiTableIndex), + .csiCqiReport = sig.csiCqiReport, + }; +} + +static aidl::NrSignalStrength toAidl(const V1_4::NrSignalStrength& sig) { + return toAidl({sig, 0, 0}); +} + +static aidl::CellInfoNr toAidl(const V1_5::CellInfoNr& info) { + return { + .cellIdentityNr = toAidl(info.cellIdentityNr), + .signalStrengthNr = toAidl(info.signalStrengthNr), + }; +} + +static aidl::CellInfoNr toAidl(const V1_6::CellInfoNr& info) { + return { + .cellIdentityNr = toAidl(info.cellIdentityNr), + .signalStrengthNr = toAidl(info.signalStrengthNr), + }; +} + +static aidl::CdmaSignalStrength toAidl(const V1_0::CdmaSignalStrength& sig) { + return { + .dbm = static_cast(sig.dbm), + .ecio = static_cast(sig.ecio), + }; +} + +static aidl::EvdoSignalStrength toAidl(const V1_0::EvdoSignalStrength& sig) { + return { + .dbm = static_cast(sig.dbm), + .ecio = static_cast(sig.ecio), + .signalNoiseRatio = static_cast(sig.signalNoiseRatio), + }; +} + +static aidl::CellInfoCdma toAidl(const V1_2::CellInfoCdma& info) { + return { + .cellIdentityCdma = toAidl(info.cellIdentityCdma), + .signalStrengthCdma = toAidl(info.signalStrengthCdma), + .signalStrengthEvdo = toAidl(info.signalStrengthEvdo), + }; +} + +static aidl::CellInfoRatSpecificInfo toAidl(const V1_5::CellInfo::CellInfoRatSpecificInfo& ci) { + using Discr = V1_5::CellInfo::CellInfoRatSpecificInfo::hidl_discriminator; + const auto discr = ci.getDiscriminator(); + + if (discr == Discr::gsm) return toAidl(ci.gsm()); + if (discr == Discr::wcdma) return toAidl(ci.wcdma()); + if (discr == Discr::tdscdma) return toAidl(ci.tdscdma()); + if (discr == Discr::lte) return toAidl(ci.lte()); + if (discr == Discr::nr) return toAidl(ci.nr()); + if (discr == Discr::cdma) return toAidl(ci.cdma()); + + return {}; +} + +static aidl::CellInfoRatSpecificInfo toAidl(const V1_6::CellInfo::CellInfoRatSpecificInfo& ci) { + using Discr = V1_6::CellInfo::CellInfoRatSpecificInfo::hidl_discriminator; + const auto discr = ci.getDiscriminator(); + + if (discr == Discr::gsm) return toAidl(ci.gsm()); + if (discr == Discr::wcdma) return toAidl(ci.wcdma()); + if (discr == Discr::tdscdma) return toAidl(ci.tdscdma()); + if (discr == Discr::lte) return toAidl(ci.lte()); + if (discr == Discr::nr) return toAidl(ci.nr()); + if (discr == Discr::cdma) return toAidl(ci.cdma()); + + return {}; +} + +aidl::CellInfo toAidl(const V1_5::CellInfo& info) { + return { + .registered = info.registered, + // ignored: timeStampType and timeStamp + .connectionStatus = aidl::CellConnectionStatus(info.connectionStatus), + .ratSpecificInfo = toAidl(info.ratSpecificInfo), + }; +} + +aidl::CellInfo toAidl(const V1_6::CellInfo& info) { + return { + .registered = info.registered, + .connectionStatus = aidl::CellConnectionStatus(info.connectionStatus), + .ratSpecificInfo = toAidl(info.ratSpecificInfo), + }; +} + +aidl::LinkCapacityEstimate toAidl(const V1_2::LinkCapacityEstimate& e) { + return { + .downlinkCapacityKbps = static_cast(e.downlinkCapacityKbps), + .uplinkCapacityKbps = static_cast(e.uplinkCapacityKbps), + }; +} + +aidl::LinkCapacityEstimate toAidl(const V1_6::LinkCapacityEstimate& e) { + return { + .downlinkCapacityKbps = static_cast(e.downlinkCapacityKbps), + .uplinkCapacityKbps = static_cast(e.uplinkCapacityKbps), + .secondaryDownlinkCapacityKbps = static_cast(e.secondaryDownlinkCapacityKbps), + .secondaryUplinkCapacityKbps = static_cast(e.secondaryUplinkCapacityKbps), + }; +} + +static aidl::PhysicalChannelConfigBand toAidl(const V1_6::PhysicalChannelConfig::Band& band) { + using Discr = V1_6::PhysicalChannelConfig::Band::hidl_discriminator; + const auto discr = band.getDiscriminator(); + + if (discr == Discr::geranBand) return aidl::GeranBands(band.geranBand()); + if (discr == Discr::utranBand) return aidl::UtranBands(band.utranBand()); + if (discr == Discr::eutranBand) return aidl::EutranBands(band.eutranBand()); + if (discr == Discr::ngranBand) return aidl::NgranBands(band.ngranBand()); + + return {}; +} + +aidl::PhysicalChannelConfig toAidl(const V1_4::PhysicalChannelConfig& cfg) { + int32_t downlinkChannelNumber = 0; + // ignored rfInfo.range + using Discr = V1_4::RadioFrequencyInfo::hidl_discriminator; + if (cfg.rfInfo.getDiscriminator() == Discr::channelNumber) { + downlinkChannelNumber = cfg.rfInfo.channelNumber(); + } + + return { + .status = aidl::CellConnectionStatus(cfg.base.status), + .rat = RadioTechnology(cfg.rat), + .downlinkChannelNumber = downlinkChannelNumber, + .cellBandwidthDownlinkKhz = cfg.base.cellBandwidthDownlink, + .contextIds = cfg.contextIds, + .physicalCellId = static_cast(cfg.physicalCellId), + }; +} + +aidl::PhysicalChannelConfig toAidl(const V1_6::PhysicalChannelConfig& cfg) { + return { + .status = aidl::CellConnectionStatus(cfg.status), + .rat = RadioTechnology(cfg.rat), + .downlinkChannelNumber = cfg.downlinkChannelNumber, + .uplinkChannelNumber = cfg.uplinkChannelNumber, + .cellBandwidthDownlinkKhz = cfg.cellBandwidthDownlinkKhz, + .cellBandwidthUplinkKhz = cfg.cellBandwidthUplinkKhz, + .contextIds = cfg.contextIds, + .physicalCellId = static_cast(cfg.physicalCellId), + .band = toAidl(cfg.band), + }; +} + +aidl::SignalStrength toAidl(const V1_4::SignalStrength& sig) { + return { + .gsm = toAidl(sig.gsm), + .cdma = toAidl(sig.cdma), + .evdo = toAidl(sig.evdo), + .lte = toAidl(sig.lte), + .tdscdma = toAidl(sig.tdscdma), + .wcdma = toAidl(sig.wcdma), + .nr = toAidl(sig.nr), + }; +} + +aidl::SignalStrength toAidl(const V1_6::SignalStrength& sig) { + return { + .gsm = toAidl(sig.gsm), + .cdma = toAidl(sig.cdma), + .evdo = toAidl(sig.evdo), + .lte = toAidl(sig.lte), + .tdscdma = toAidl(sig.tdscdma), + .wcdma = toAidl(sig.wcdma), + .nr = toAidl(sig.nr), + }; +} + +aidl::NetworkScanResult toAidl(const V1_5::NetworkScanResult& res) { + return { + .status = static_cast(res.status), + .error = toAidl(res.error), + .networkInfos = toAidl(res.networkInfos), + }; +} + +aidl::NetworkScanResult toAidl(const V1_6::NetworkScanResult& res) { + return { + .status = static_cast(res.status), + .error = toAidl(res.error), + .networkInfos = toAidl(res.networkInfos), + }; +} + +aidl::SuppSvcNotification toAidl(const V1_0::SuppSvcNotification& svc) { + return { + .isMT = svc.isMT, + .code = svc.code, + .index = svc.index, + .type = svc.type, + .number = svc.number, + }; +} + +aidl::OperatorInfo toAidl(const V1_0::OperatorInfo& info) { + return { + .alphaLong = info.alphaLong, + .alphaShort = info.alphaShort, + .operatorNumeric = info.operatorNumeric, + .status = static_cast(info.status), + }; +} + +static aidl::Cdma2000RegistrationInfo // +toAidl(const V1_5::RegStateResult::AccessTechnologySpecificInfo::Cdma2000RegistrationInfo& info) { + return { + .cssSupported = info.cssSupported, + .roamingIndicator = info.roamingIndicator, + .systemIsInPrl = static_cast(info.systemIsInPrl), + .defaultRoamingIndicator = info.defaultRoamingIndicator, + }; +} + +static aidl::LteVopsInfo toAidl(const V1_4::LteVopsInfo& info) { + return { + .isVopsSupported = info.isVopsSupported, + .isEmcBearerSupported = info.isEmcBearerSupported, + }; +} + +static aidl::NrIndicators toAidl(const V1_4::NrIndicators& info) { + return { + .isEndcAvailable = info.isEndcAvailable, + .isDcNrRestricted = info.isDcNrRestricted, + .isNrAvailable = info.isNrAvailable, + }; +} + +static aidl::EutranRegistrationInfo // +toAidl(const V1_5::RegStateResult::AccessTechnologySpecificInfo::EutranRegistrationInfo& info) { + return { + .lteVopsInfo = toAidl(info.lteVopsInfo), + .nrIndicators = toAidl(info.nrIndicators), + }; +} + +static aidl::NrVopsInfo toAidl(const V1_6::NrVopsInfo& info) { + return { + .vopsSupported = static_cast(info.vopsSupported), + .emcSupported = static_cast(info.emcSupported), + .emfSupported = static_cast(info.emfSupported), + }; +} + +static aidl::AccessTechnologySpecificInfo // +toAidl(const V1_5::RegStateResult::AccessTechnologySpecificInfo& info) { + using Discr = V1_5::RegStateResult::AccessTechnologySpecificInfo::hidl_discriminator; + const auto discr = info.getDiscriminator(); + + if (discr == Discr::cdmaInfo) return toAidl(info.cdmaInfo()); + if (discr == Discr::eutranInfo) return toAidl(info.eutranInfo()); + + return {}; +} + +static aidl::AccessTechnologySpecificInfo // +toAidl(const V1_6::RegStateResult::AccessTechnologySpecificInfo& info) { + using Discr = V1_6::RegStateResult::AccessTechnologySpecificInfo::hidl_discriminator; + const auto discr = info.getDiscriminator(); + + if (discr == Discr::cdmaInfo) return toAidl(info.cdmaInfo()); + if (discr == Discr::eutranInfo) return toAidl(info.eutranInfo()); + if (discr == Discr::ngranNrVopsInfo) return toAidl(info.ngranNrVopsInfo()); + if (discr == Discr::geranDtmSupported) { + using T = aidl::AccessTechnologySpecificInfo; + return T::make(info.geranDtmSupported()); + } + + return {}; +} + +aidl::RegStateResult toAidl(const V1_5::RegStateResult& res) { + return { + .regState = aidl::RegState(res.regState), + .rat = RadioTechnology(res.rat), + .reasonForDenial = aidl::RegistrationFailCause(res.reasonForDenial), + .cellIdentity = toAidl(res.cellIdentity), + .registeredPlmn = res.registeredPlmn, + .accessTechnologySpecificInfo = toAidl(res.accessTechnologySpecificInfo), + }; +} + +aidl::RegStateResult toAidl(const V1_6::RegStateResult& res) { + return { + .regState = aidl::RegState(res.regState), + .rat = RadioTechnology(res.rat), + .reasonForDenial = aidl::RegistrationFailCause(res.reasonForDenial), + .cellIdentity = toAidl(res.cellIdentity), + .registeredPlmn = res.registeredPlmn, + .accessTechnologySpecificInfo = toAidl(res.accessTechnologySpecificInfo), + }; +} + +aidl::NeighboringCell toAidl(const V1_0::NeighboringCell& cell) { + return { + .cid = cell.cid, + .rssi = cell.rssi, + }; +} + +aidl::LceDataInfo toAidl(const V1_0::LceDataInfo& info) { + return { + .lastHopCapacityKbps = static_cast(info.lastHopCapacityKbps), + .confidenceLevel = static_cast(info.confidenceLevel), + .lceSuspended = info.lceSuspended, + }; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/network/structs.h b/radio/aidl/compat/libradiocompat/network/structs.h new file mode 100644 index 0000000000..854cb38058 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/network/structs.h @@ -0,0 +1,99 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace android::hardware::radio::compat { + +::aidl::android::hardware::radio::network::RadioBandMode toAidl(V1_0::RadioBandMode mode); +::aidl::android::hardware::radio::network::GeranBands toAidl(V1_1::GeranBands band); +V1_1::GeranBands toHidl(::aidl::android::hardware::radio::network::GeranBands band); +::aidl::android::hardware::radio::network::UtranBands toAidl(V1_5::UtranBands band); +V1_5::UtranBands toHidl(::aidl::android::hardware::radio::network::UtranBands band); +::aidl::android::hardware::radio::network::EutranBands toAidl(V1_5::EutranBands band); +V1_5::EutranBands toHidl(::aidl::android::hardware::radio::network::EutranBands band); +::aidl::android::hardware::radio::network::NgranBands toAidl(V1_5::NgranBands band); +V1_5::NgranBands toHidl(::aidl::android::hardware::radio::network::NgranBands band); + +V1_5::SignalThresholdInfo // +toHidl(const ::aidl::android::hardware::radio::network::SignalThresholdInfo& info); + +::aidl::android::hardware::radio::network::RadioAccessSpecifier // +toAidl(const V1_5::RadioAccessSpecifier& spec); +V1_5::RadioAccessSpecifier // +toHidl(const ::aidl::android::hardware::radio::network::RadioAccessSpecifier& spec); + +V1_5::NetworkScanRequest // +toHidl(const ::aidl::android::hardware::radio::network::NetworkScanRequest& req); + +::aidl::android::hardware::radio::network::CellIdentity toAidl(const V1_5::CellIdentity& ci); + +::aidl::android::hardware::radio::network::BarringInfo toAidl(const V1_5::BarringInfo& info); + +::aidl::android::hardware::radio::network::ClosedSubscriberGroupInfo // +toAidl(const V1_5::ClosedSubscriberGroupInfo& info); + +::aidl::android::hardware::radio::network::CellInfo toAidl(const V1_5::CellInfo& info); +::aidl::android::hardware::radio::network::CellInfo toAidl(const V1_6::CellInfo& info); + +::aidl::android::hardware::radio::network::LinkCapacityEstimate // +toAidl(const V1_2::LinkCapacityEstimate& lce); +::aidl::android::hardware::radio::network::LinkCapacityEstimate // +toAidl(const V1_6::LinkCapacityEstimate& lce); + +::aidl::android::hardware::radio::network::PhysicalChannelConfig // +toAidl(const V1_4::PhysicalChannelConfig& cfg); +::aidl::android::hardware::radio::network::PhysicalChannelConfig // +toAidl(const V1_6::PhysicalChannelConfig& cfg); + +::aidl::android::hardware::radio::network::SignalStrength toAidl(const V1_4::SignalStrength& sig); +::aidl::android::hardware::radio::network::SignalStrength toAidl(const V1_6::SignalStrength& sig); + +::aidl::android::hardware::radio::network::NetworkScanResult // +toAidl(const V1_5::NetworkScanResult& res); +::aidl::android::hardware::radio::network::NetworkScanResult // +toAidl(const V1_6::NetworkScanResult& res); + +::aidl::android::hardware::radio::network::SuppSvcNotification // +toAidl(const V1_0::SuppSvcNotification& svc); + +::aidl::android::hardware::radio::network::OperatorInfo toAidl(const V1_0::OperatorInfo& info); + +::aidl::android::hardware::radio::network::RegStateResult toAidl(const V1_5::RegStateResult& res); +::aidl::android::hardware::radio::network::RegStateResult toAidl(const V1_6::RegStateResult& res); + +::aidl::android::hardware::radio::network::NeighboringCell toAidl(const V1_0::NeighboringCell& c); + +::aidl::android::hardware::radio::network::LceDataInfo toAidl(const V1_0::LceDataInfo& info); + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/network/utils.cpp b/radio/aidl/compat/libradiocompat/network/utils.cpp new file mode 100644 index 0000000000..6fe3e6e8bf --- /dev/null +++ b/radio/aidl/compat/libradiocompat/network/utils.cpp @@ -0,0 +1,196 @@ +/* + * 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 "utils.h" + +namespace android::hardware::radio::compat { + +namespace RAF { +using E = V1_4::RadioAccessFamily; +constexpr auto GSM = E::GSM | E::GPRS; +constexpr auto CDMA = E::IS95A | E::IS95B | E::ONE_X_RTT; +constexpr auto EVDO = E::EVDO_0 | E::EVDO_A | E::EVDO_B | E::EHRPD; +constexpr auto HS = E::HSUPA | E::HSDPA | E::HSPA | E::HSPAP; +constexpr auto WCDMA = HS | E::UMTS; +constexpr auto LTE = E::LTE | E::LTE_CA; +constexpr auto NR = E::NR; +} // namespace RAF + +static hidl_bitfield // +getAdjustedRaf(hidl_bitfield raf) { + if (raf & RAF::GSM) raf |= RAF::GSM; + if (raf & RAF::WCDMA) raf |= RAF::WCDMA; + if (raf & RAF::CDMA) raf |= RAF::CDMA; + if (raf & RAF::EVDO) raf |= RAF::EVDO; + if (raf & RAF::LTE) raf |= RAF::LTE; + if (raf & RAF::NR) raf |= RAF::NR; + + return raf; +} + +V1_0::PreferredNetworkType getNetworkTypeFromRaf(hidl_bitfield raf) { + raf = getAdjustedRaf(raf); + switch (raf) { + case RAF::GSM | RAF::WCDMA: + return V1_0::PreferredNetworkType::GSM_WCDMA_AUTO; + case RAF::GSM: + return V1_0::PreferredNetworkType::GSM_ONLY; + case RAF::WCDMA: + return V1_0::PreferredNetworkType::WCDMA; + case (RAF::CDMA | RAF::EVDO): + return V1_0::PreferredNetworkType::CDMA_EVDO_AUTO; + case (RAF::LTE | RAF::CDMA | RAF::EVDO): + return V1_0::PreferredNetworkType::LTE_CDMA_EVDO; + case (RAF::LTE | RAF::GSM | RAF::WCDMA): + return V1_0::PreferredNetworkType::LTE_GSM_WCDMA; + case (RAF::LTE | RAF::CDMA | RAF::EVDO | RAF::GSM | RAF::WCDMA): + return V1_0::PreferredNetworkType::LTE_CMDA_EVDO_GSM_WCDMA; // CDMA typo + case RAF::LTE: + return V1_0::PreferredNetworkType::LTE_ONLY; + case (RAF::LTE | RAF::WCDMA): + return V1_0::PreferredNetworkType::LTE_WCDMA; + case RAF::CDMA: + return V1_0::PreferredNetworkType::CDMA_ONLY; + case RAF::EVDO: + return V1_0::PreferredNetworkType::EVDO_ONLY; + case (RAF::GSM | RAF::WCDMA | RAF::CDMA | RAF::EVDO): + return V1_0::PreferredNetworkType::GSM_WCDMA_CDMA_EVDO_AUTO; + case static_cast(RAF::E::TD_SCDMA): + return V1_0::PreferredNetworkType::TD_SCDMA_ONLY; + case (RAF::E::TD_SCDMA | RAF::WCDMA): + return V1_0::PreferredNetworkType::TD_SCDMA_WCDMA; + case (RAF::LTE | RAF::E::TD_SCDMA): + return V1_0::PreferredNetworkType::TD_SCDMA_LTE; + case (RAF::E::TD_SCDMA | RAF::GSM): + return V1_0::PreferredNetworkType::TD_SCDMA_GSM; + case (RAF::LTE | RAF::E::TD_SCDMA | RAF::GSM): + return V1_0::PreferredNetworkType::TD_SCDMA_GSM_LTE; + case (RAF::E::TD_SCDMA | RAF::GSM | RAF::WCDMA): + return V1_0::PreferredNetworkType::TD_SCDMA_GSM_WCDMA; + case (RAF::LTE | RAF::E::TD_SCDMA | RAF::WCDMA): + return V1_0::PreferredNetworkType::TD_SCDMA_WCDMA_LTE; + case (RAF::LTE | RAF::E::TD_SCDMA | RAF::GSM | RAF::WCDMA): + return V1_0::PreferredNetworkType::TD_SCDMA_GSM_WCDMA_LTE; + case (RAF::E::TD_SCDMA | RAF::CDMA | RAF::EVDO | RAF::GSM | RAF::WCDMA): + return V1_0::PreferredNetworkType::TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO; + case (RAF::LTE | RAF::E::TD_SCDMA | RAF::CDMA | RAF::EVDO | RAF::GSM | RAF::WCDMA): + return V1_0::PreferredNetworkType::TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA; + case static_cast(RAF::NR): + return V1_0::PreferredNetworkType(23); // NR_ONLY + case (RAF::NR | RAF::LTE): + return V1_0::PreferredNetworkType(24); // NR_LTE + case (RAF::NR | RAF::LTE | RAF::CDMA | RAF::EVDO): + return V1_0::PreferredNetworkType(25); // NR_LTE_CDMA_EVDO + case (RAF::NR | RAF::LTE | RAF::GSM | RAF::WCDMA): + return V1_0::PreferredNetworkType(26); // NR_LTE_GSM_WCDMA + case (RAF::NR | RAF::LTE | RAF::CDMA | RAF::EVDO | RAF::GSM | RAF::WCDMA): + return V1_0::PreferredNetworkType(27); // NR_LTE_CDMA_EVDO_GSM_WCDMA + case (RAF::NR | RAF::LTE | RAF::WCDMA): + return V1_0::PreferredNetworkType(28); // NR_LTE_WCDMA + case (RAF::NR | RAF::LTE | RAF::E::TD_SCDMA): + return V1_0::PreferredNetworkType(29); // NR_LTE_TDSCDMA + case (RAF::NR | RAF::LTE | RAF::E::TD_SCDMA | RAF::GSM): + return V1_0::PreferredNetworkType(30); // NR_LTE_TDSCDMA_GSM + case (RAF::NR | RAF::LTE | RAF::E::TD_SCDMA | RAF::WCDMA): + return V1_0::PreferredNetworkType(31); // NR_LTE_TDSCDMA_WCDMA + case (RAF::NR | RAF::LTE | RAF::E::TD_SCDMA | RAF::GSM | RAF::WCDMA): + return V1_0::PreferredNetworkType(32); // NR_LTE_TDSCDMA_GSM_WCDMA + case (RAF::NR | RAF::LTE | RAF::E::TD_SCDMA | RAF::CDMA | RAF::EVDO | RAF::GSM | + RAF::WCDMA): + return V1_0::PreferredNetworkType(33); // NR_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA + default: + return V1_0::PreferredNetworkType::WCDMA; + } +} + +hidl_bitfield getRafFromNetworkType(V1_0::PreferredNetworkType type) { + switch (type) { + case V1_0::PreferredNetworkType::GSM_WCDMA_AUTO: + return RAF::GSM | RAF::WCDMA; + case V1_0::PreferredNetworkType::GSM_ONLY: + return RAF::GSM; + case V1_0::PreferredNetworkType::WCDMA: + return RAF::WCDMA; + case V1_0::PreferredNetworkType::CDMA_EVDO_AUTO: + return (RAF::CDMA | RAF::EVDO); + case V1_0::PreferredNetworkType::LTE_CDMA_EVDO: + return (RAF::LTE | RAF::CDMA | RAF::EVDO); + case V1_0::PreferredNetworkType::LTE_GSM_WCDMA: + return (RAF::LTE | RAF::GSM | RAF::WCDMA); + case V1_0::PreferredNetworkType::LTE_CMDA_EVDO_GSM_WCDMA: + return (RAF::LTE | RAF::CDMA | RAF::EVDO | RAF::GSM | RAF::WCDMA); + case V1_0::PreferredNetworkType::LTE_ONLY: + return RAF::LTE; + case V1_0::PreferredNetworkType::LTE_WCDMA: + return (RAF::LTE | RAF::WCDMA); + case V1_0::PreferredNetworkType::CDMA_ONLY: + return RAF::CDMA; + case V1_0::PreferredNetworkType::EVDO_ONLY: + return RAF::EVDO; + case V1_0::PreferredNetworkType::GSM_WCDMA_CDMA_EVDO_AUTO: + return (RAF::GSM | RAF::WCDMA | RAF::CDMA | RAF::EVDO); + case V1_0::PreferredNetworkType::TD_SCDMA_ONLY: + return static_cast(RAF::E::TD_SCDMA); + case V1_0::PreferredNetworkType::TD_SCDMA_WCDMA: + return (RAF::E::TD_SCDMA | RAF::WCDMA); + case V1_0::PreferredNetworkType::TD_SCDMA_LTE: + return (RAF::LTE | RAF::E::TD_SCDMA); + case V1_0::PreferredNetworkType::TD_SCDMA_GSM: + return (RAF::E::TD_SCDMA | RAF::GSM); + case V1_0::PreferredNetworkType::TD_SCDMA_GSM_LTE: + return (RAF::LTE | RAF::E::TD_SCDMA | RAF::GSM); + case V1_0::PreferredNetworkType::TD_SCDMA_GSM_WCDMA: + return (RAF::E::TD_SCDMA | RAF::GSM | RAF::WCDMA); + case V1_0::PreferredNetworkType::TD_SCDMA_WCDMA_LTE: + return (RAF::LTE | RAF::E::TD_SCDMA | RAF::WCDMA); + case V1_0::PreferredNetworkType::TD_SCDMA_GSM_WCDMA_LTE: + return (RAF::LTE | RAF::E::TD_SCDMA | RAF::GSM | RAF::WCDMA); + case V1_0::PreferredNetworkType::TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO: + return (RAF::E::TD_SCDMA | RAF::CDMA | RAF::EVDO | RAF::GSM | RAF::WCDMA); + case V1_0::PreferredNetworkType::TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA: + return (RAF::LTE | RAF::E::TD_SCDMA | RAF::CDMA | RAF::EVDO | RAF::GSM | RAF::WCDMA); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wswitch" + case V1_0::PreferredNetworkType(23): // NR_ONLY + return static_cast(RAF::NR); + case V1_0::PreferredNetworkType(24): // NR_LTE + return (RAF::NR | RAF::LTE); + case V1_0::PreferredNetworkType(25): // NR_LTE_CDMA_EVDO + return (RAF::NR | RAF::LTE | RAF::CDMA | RAF::EVDO); + case V1_0::PreferredNetworkType(26): // NR_LTE_GSM_WCDMA + return (RAF::NR | RAF::LTE | RAF::GSM | RAF::WCDMA); + case V1_0::PreferredNetworkType(27): // NR_LTE_CDMA_EVDO_GSM_WCDMA + return (RAF::NR | RAF::LTE | RAF::CDMA | RAF::EVDO | RAF::GSM | RAF::WCDMA); + case V1_0::PreferredNetworkType(28): // NR_LTE_WCDMA + return (RAF::NR | RAF::LTE | RAF::WCDMA); + case V1_0::PreferredNetworkType(29): // NR_LTE_TDSCDMA + return (RAF::NR | RAF::LTE | RAF::E::TD_SCDMA); + case V1_0::PreferredNetworkType(30): // NR_LTE_TDSCDMA_GSM + return (RAF::NR | RAF::LTE | RAF::E::TD_SCDMA | RAF::GSM); + case V1_0::PreferredNetworkType(31): // NR_LTE_TDSCDMA_WCDMA + return (RAF::NR | RAF::LTE | RAF::E::TD_SCDMA | RAF::WCDMA); + case V1_0::PreferredNetworkType(32): // NR_LTE_TDSCDMA_GSM_WCDMA + return (RAF::NR | RAF::LTE | RAF::E::TD_SCDMA | RAF::GSM | RAF::WCDMA); + case V1_0::PreferredNetworkType(33): // NR_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA + return (RAF::NR | RAF::LTE | RAF::E::TD_SCDMA | RAF::CDMA | RAF::EVDO | RAF::GSM | + RAF::WCDMA); +#pragma GCC diagnostic pop + default: + return {}; // unknown + } +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/network/utils.h b/radio/aidl/compat/libradiocompat/network/utils.h new file mode 100644 index 0000000000..10714beaee --- /dev/null +++ b/radio/aidl/compat/libradiocompat/network/utils.h @@ -0,0 +1,25 @@ +/* + * 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 + +namespace android::hardware::radio::compat { + +V1_0::PreferredNetworkType getNetworkTypeFromRaf(hidl_bitfield raf); +hidl_bitfield getRafFromNetworkType(V1_0::PreferredNetworkType type); + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/service/Android.bp b/radio/aidl/compat/service/Android.bp index e97e2db73e..3c543f744d 100644 --- a/radio/aidl/compat/service/Android.bp +++ b/radio/aidl/compat/service/Android.bp @@ -41,6 +41,7 @@ cc_binary { "android.hardware.radio.config@1.3", "android.hardware.radio.data-V1-ndk", "android.hardware.radio.messaging-V1-ndk", + "android.hardware.radio.network-V1-ndk", "android.hardware.radio.sim-V1-ndk", "android.hardware.radio@1.0", "android.hardware.radio@1.1", diff --git a/radio/aidl/compat/service/radio-compat.xml b/radio/aidl/compat/service/radio-compat.xml index ac812fb91f..e035cac793 100644 --- a/radio/aidl/compat/service/radio-compat.xml +++ b/radio/aidl/compat/service/radio-compat.xml @@ -17,6 +17,10 @@ android.hardware.radio.messaging IRadioMessaging/slot1 + + android.hardware.radio.network + IRadioNetwork/slot1 + android.hardware.radio.sim IRadioSim/slot1 diff --git a/radio/aidl/compat/service/service.cpp b/radio/aidl/compat/service/service.cpp index c97b47a097..82d234f8ba 100644 --- a/radio/aidl/compat/service/service.cpp +++ b/radio/aidl/compat/service/service.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -60,6 +61,7 @@ static void publishRadio(std::string slot) { publishRadioHal(radioHidl, responseCb, indicationCb, slot); publishRadioHal(radioHidl, responseCb, indicationCb, slot); + publishRadioHal(radioHidl, responseCb, indicationCb, slot); publishRadioHal(radioHidl, responseCb, indicationCb, slot); } -- GitLab From 9375f3a7e494cff9f78b7c8102c6590ff837baec Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Fri, 5 Nov 2021 10:53:55 -0700 Subject: [PATCH 287/825] Implement RadioVoice for AIDL-HIDL Telephony HAL translator Bug: 203699028 Test: Boot and grep logcat against radiocompat Change-Id: Ie2dce95ba1a468c10d92a74bfdca03d2a8d744b0 --- radio/aidl/compat/libradiocompat/Android.bp | 5 + .../compat/libradiocompat/RadioIndication.cpp | 64 ---- .../compat/libradiocompat/RadioResponse.cpp | 154 +-------- .../include/libradiocompat/RadioIndication.h | 4 + .../include/libradiocompat/RadioResponse.h | 4 + .../include/libradiocompat/RadioVoice.h | 84 +++++ .../voice/RadioIndication-voice.cpp | 142 +++++++++ .../voice/RadioResponse-voice.cpp | 294 ++++++++++++++++++ .../libradiocompat/voice/RadioVoice.cpp | 270 ++++++++++++++++ .../compat/libradiocompat/voice/structs.cpp | 223 +++++++++++++ .../compat/libradiocompat/voice/structs.h | 91 ++++++ radio/aidl/compat/service/Android.bp | 1 + radio/aidl/compat/service/radio-compat.xml | 4 + radio/aidl/compat/service/service.cpp | 2 + 14 files changed, 1125 insertions(+), 217 deletions(-) create mode 100644 radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h create mode 100644 radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp create mode 100644 radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp create mode 100644 radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp create mode 100644 radio/aidl/compat/libradiocompat/voice/structs.cpp create mode 100644 radio/aidl/compat/libradiocompat/voice/structs.h diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp index fdee336f4f..715a1c2d3b 100644 --- a/radio/aidl/compat/libradiocompat/Android.bp +++ b/radio/aidl/compat/libradiocompat/Android.bp @@ -41,6 +41,7 @@ cc_library { "android.hardware.radio.messaging-V1-ndk", "android.hardware.radio.network-V1-ndk", "android.hardware.radio.sim-V1-ndk", + "android.hardware.radio.voice-V1-ndk", "android.hardware.radio@1.0", "android.hardware.radio@1.1", "android.hardware.radio@1.2", @@ -79,6 +80,10 @@ cc_library { "sim/RadioResponse-sim.cpp", "sim/RadioSim.cpp", "sim/structs.cpp", + "voice/RadioIndication-voice.cpp", + "voice/RadioResponse-voice.cpp", + "voice/RadioVoice.cpp", + "voice/structs.cpp", ], export_include_dirs: ["include"], } diff --git a/radio/aidl/compat/libradiocompat/RadioIndication.cpp b/radio/aidl/compat/libradiocompat/RadioIndication.cpp index 90b9e752d8..df97841d16 100644 --- a/radio/aidl/compat/libradiocompat/RadioIndication.cpp +++ b/radio/aidl/compat/libradiocompat/RadioIndication.cpp @@ -26,59 +26,10 @@ Return RadioIndication::radioStateChanged(V1_0::RadioIndicationType type, return {}; } -Return RadioIndication::callStateChanged(V1_0::RadioIndicationType type) { - return {}; -} - -Return RadioIndication::stkCallSetup(V1_0::RadioIndicationType type, int64_t timeout) { - return {}; -} - -Return RadioIndication::callRing(V1_0::RadioIndicationType type, bool isGsm, - const V1_0::CdmaSignalInfoRecord& record) { - return {}; -} - -Return RadioIndication::enterEmergencyCallbackMode(V1_0::RadioIndicationType type) { - return {}; -} - -Return RadioIndication::cdmaCallWaiting(V1_0::RadioIndicationType type, - const V1_0::CdmaCallWaiting& callWaitingRecord) { - return {}; -} - -Return RadioIndication::cdmaOtaProvisionStatus(V1_0::RadioIndicationType type, - V1_0::CdmaOtaProvisionStatus status) { - return {}; -} - -Return RadioIndication::cdmaInfoRec(V1_0::RadioIndicationType type, - const V1_0::CdmaInformationRecords& records) { - return {}; -} - -Return RadioIndication::indicateRingbackTone(V1_0::RadioIndicationType type, bool start) { - return {}; -} - -Return RadioIndication::resendIncallMute(V1_0::RadioIndicationType type) { - return {}; -} - -Return RadioIndication::exitEmergencyCallbackMode(V1_0::RadioIndicationType type) { - return {}; -} - Return RadioIndication::rilConnected(V1_0::RadioIndicationType type) { return {}; } -Return RadioIndication::srvccStateNotify(V1_0::RadioIndicationType type, - V1_0::SrvccState state) { - return {}; -} - Return RadioIndication::hardwareConfigChanged(V1_0::RadioIndicationType type, const hidl_vec& configs) { return {}; @@ -89,24 +40,9 @@ Return RadioIndication::radioCapabilityIndication(V1_0::RadioIndicationTyp return {}; } -Return RadioIndication::onSupplementaryServiceIndication(V1_0::RadioIndicationType type, - const V1_0::StkCcUnsolSsResult& ss) { - return {}; -} - -Return RadioIndication::stkCallControlAlphaNotify(V1_0::RadioIndicationType type, - const hidl_string& alpha) { - return {}; -} - Return RadioIndication::modemReset(V1_0::RadioIndicationType type, const hidl_string& reason) { return {}; } -Return RadioIndication::currentEmergencyNumberList( - V1_0::RadioIndicationType type, const hidl_vec& emergencyNumbers) { - return {}; -} - } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/RadioResponse.cpp b/radio/aidl/compat/libradiocompat/RadioResponse.cpp index 001330fbd9..a39f575695 100644 --- a/radio/aidl/compat/libradiocompat/RadioResponse.cpp +++ b/radio/aidl/compat/libradiocompat/RadioResponse.cpp @@ -32,46 +32,7 @@ Return RadioResponse::acknowledgeRequest(int32_t serial) { if (mMessagingCb) mMessagingCb->acknowledgeRequest(serial); if (mNetworkCb) mNetworkCb->acknowledgeRequest(serial); if (mSimCb) mSimCb->acknowledgeRequest(serial); - return {}; -} - -Return RadioResponse::getCurrentCallsResponse(const V1_0::RadioResponseInfo& info, - const hidl_vec& calls) { - return {}; -} - -Return RadioResponse::dialResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::hangupConnectionResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::hangupWaitingOrBackgroundResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::hangupForegroundResumeBackgroundResponse( - const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::switchWaitingOrHoldingAndActiveResponse( - const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::conferenceResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::rejectCallResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getLastCallFailCauseResponse( - const V1_0::RadioResponseInfo& info, const V1_0::LastCallFailCauseInfo& failCauseinfo) { + if (mVoiceCb) mVoiceCb->acknowledgeRequest(serial); return {}; } @@ -79,116 +40,17 @@ Return RadioResponse::setRadioPowerResponse(const V1_0::RadioResponseInfo& return {}; } -Return RadioResponse::sendDtmfResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getClirResponse(const V1_0::RadioResponseInfo& info, int32_t n, - int32_t m) { - return {}; -} - -Return RadioResponse::setClirResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getCallForwardStatusResponse( - const V1_0::RadioResponseInfo& info, const hidl_vec& callFwdInfos) { - return {}; -} - -Return RadioResponse::setCallForwardResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getCallWaitingResponse(const V1_0::RadioResponseInfo& info, bool enable, - int32_t serviceClass) { - return {}; -} - -Return RadioResponse::setCallWaitingResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::acceptCallResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::startDtmfResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::stopDtmfResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::getBasebandVersionResponse(const V1_0::RadioResponseInfo& info, const hidl_string& version) { return {}; } -Return RadioResponse::separateConnectionResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::setMuteResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getMuteResponse(const V1_0::RadioResponseInfo& info, bool enable) { - return {}; -} - -Return RadioResponse::getClipResponse(const V1_0::RadioResponseInfo& info, - V1_0::ClipStatus status) { - return {}; -} - -Return RadioResponse::handleStkCallSetupRequestFromSimResponse( - const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::explicitCallTransferResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::setTTYModeResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getTTYModeResponse(const V1_0::RadioResponseInfo& info, - V1_0::TtyMode mode) { - return {}; -} - -Return RadioResponse::setPreferredVoicePrivacyResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getPreferredVoicePrivacyResponse(const V1_0::RadioResponseInfo& info, - bool enable) { - return {}; -} - -Return RadioResponse::sendCDMAFeatureCodeResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::sendBurstDtmfResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::getDeviceIdentityResponse( // const V1_0::RadioResponseInfo& info, const hidl_string& imei, const hidl_string& imeisv, const hidl_string& esn, const hidl_string& meid) { return {}; } -Return RadioResponse::exitEmergencyCallbackModeResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::nvReadItemResponse(const V1_0::RadioResponseInfo& info, const hidl_string& result) { return {}; @@ -234,11 +96,6 @@ Return RadioResponse::sendDeviceStateResponse(const V1_0::RadioResponseInf return {}; } -Return RadioResponse::getCurrentCallsResponse_1_2(const V1_0::RadioResponseInfo& info, - const hidl_vec& calls) { - return {}; -} - Return RadioResponse::enableModemResponse(const V1_0::RadioResponseInfo& info) { return {}; } @@ -248,10 +105,6 @@ Return RadioResponse::getModemStackStatusResponse(const V1_0::RadioRespons return {}; } -Return RadioResponse::emergencyDialResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - Return RadioResponse::setRadioPowerResponse_1_5(const V1_0::RadioResponseInfo& info) { return {}; } @@ -260,9 +113,4 @@ Return RadioResponse::setRadioPowerResponse_1_6(const V1_6::RadioResponseI return {}; } -Return RadioResponse::getCurrentCallsResponse_1_6(const V1_6::RadioResponseInfo& info, - const hidl_vec& calls) { - return {}; -} - } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h index c7a2629b7d..51cdccbc38 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h @@ -19,6 +19,7 @@ #include #include #include +#include #include namespace android::hardware::radio::compat { @@ -29,6 +30,7 @@ class RadioIndication : public V1_6::IRadioIndication { mMessagingCb; std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkIndication> mNetworkCb; std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> mSimCb; + std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> mVoiceCb; // IRadioIndication @ 1.0 Return radioStateChanged(V1_0::RadioIndicationType type, @@ -186,6 +188,8 @@ class RadioIndication : public V1_6::IRadioIndication { std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkIndication> ni); void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> simCb); + void setResponseFunction( + std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> voicCb); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h index b87ca6e235..826d38566c 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h @@ -19,6 +19,7 @@ #include #include #include +#include #include namespace android::hardware::radio::compat { @@ -29,6 +30,7 @@ class RadioResponse : public V1_6::IRadioResponse { mMessagingCb; std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> mNetworkCb; std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> mSimCb; + std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> mVoiceCb; // IRadioResponse @ 1.0 Return getIccCardStatusResponse(const V1_0::RadioResponseInfo& info, @@ -414,6 +416,8 @@ class RadioResponse : public V1_6::IRadioResponse { std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> nwCb); void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> simCb); + void setResponseFunction( + std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> voiceCb); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h new file mode 100644 index 0000000000..5bf93e0fb3 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h @@ -0,0 +1,84 @@ +/* + * 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 "RadioCompatBase.h" + +#include + +namespace android::hardware::radio::compat { + +class RadioVoice : public RadioCompatBase, + public aidl::android::hardware::radio::voice::BnRadioVoice { + ::ndk::ScopedAStatus acceptCall(int32_t serial) override; + ::ndk::ScopedAStatus conference(int32_t serial) override; + ::ndk::ScopedAStatus dial( + int32_t serial, const ::aidl::android::hardware::radio::voice::Dial& dialInfo) override; + ::ndk::ScopedAStatus emergencyDial( + int32_t serial, const ::aidl::android::hardware::radio::voice::Dial& dialInfo, + ::aidl::android::hardware::radio::voice::EmergencyServiceCategory categories, + const std::vector& urns, + ::aidl::android::hardware::radio::voice::EmergencyCallRouting routing, + bool hasKnownUserIntentEmergency, bool isTesting) override; + ::ndk::ScopedAStatus exitEmergencyCallbackMode(int32_t serial) override; + ::ndk::ScopedAStatus explicitCallTransfer(int32_t serial) override; + ::ndk::ScopedAStatus getCallForwardStatus( + int32_t serial, + const ::aidl::android::hardware::radio::voice::CallForwardInfo& callInfo) override; + ::ndk::ScopedAStatus getCallWaiting(int32_t serial, int32_t serviceClass) override; + ::ndk::ScopedAStatus getClip(int32_t serial) override; + ::ndk::ScopedAStatus getClir(int32_t serial) override; + ::ndk::ScopedAStatus getCurrentCalls(int32_t serial) override; + ::ndk::ScopedAStatus getLastCallFailCause(int32_t serial) override; + ::ndk::ScopedAStatus getMute(int32_t serial) override; + ::ndk::ScopedAStatus getPreferredVoicePrivacy(int32_t serial) override; + ::ndk::ScopedAStatus getTtyMode(int32_t serial) override; + ::ndk::ScopedAStatus handleStkCallSetupRequestFromSim(int32_t serial, bool accept) override; + ::ndk::ScopedAStatus hangup(int32_t serial, int32_t gsmIndex) override; + ::ndk::ScopedAStatus hangupForegroundResumeBackground(int32_t serial) override; + ::ndk::ScopedAStatus hangupWaitingOrBackground(int32_t serial) override; + ::ndk::ScopedAStatus isVoNrEnabled(int32_t serial) override; + ::ndk::ScopedAStatus rejectCall(int32_t serial) override; + ::ndk::ScopedAStatus responseAcknowledgement() override; + ::ndk::ScopedAStatus sendBurstDtmf(int32_t serial, const std::string& dtmf, int32_t on, + int32_t off) override; + ::ndk::ScopedAStatus sendCdmaFeatureCode(int32_t serial, const std::string& fcode) override; + ::ndk::ScopedAStatus sendDtmf(int32_t serial, const std::string& s) override; + ::ndk::ScopedAStatus separateConnection(int32_t serial, int32_t gsmIndex) override; + ::ndk::ScopedAStatus setCallForward( + int32_t serial, + const ::aidl::android::hardware::radio::voice::CallForwardInfo& callInfo) override; + ::ndk::ScopedAStatus setCallWaiting(int32_t serial, bool enable, int32_t serviceClass) override; + ::ndk::ScopedAStatus setClir(int32_t serial, int32_t status) override; + ::ndk::ScopedAStatus setMute(int32_t serial, bool enable) override; + ::ndk::ScopedAStatus setPreferredVoicePrivacy(int32_t serial, bool enable) override; + ::ndk::ScopedAStatus setResponseFunctions( + const std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse>& + radioVoiceResponse, + const std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication>& + radioVoiceIndication) override; + ::ndk::ScopedAStatus setTtyMode(int32_t serial, + ::aidl::android::hardware::radio::voice::TtyMode mode) override; + ::ndk::ScopedAStatus setVoNrEnabled(int32_t serial, bool enable) override; + ::ndk::ScopedAStatus startDtmf(int32_t serial, const std::string& s) override; + ::ndk::ScopedAStatus stopDtmf(int32_t serial) override; + ::ndk::ScopedAStatus switchWaitingOrHoldingAndActive(int32_t serial) override; + + public: + using RadioCompatBase::RadioCompatBase; +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp new file mode 100644 index 0000000000..6d9bda8dea --- /dev/null +++ b/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp @@ -0,0 +1,142 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "VoiceIndication" + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::voice; + +void RadioIndication::setResponseFunction(std::shared_ptr voiceCb) { + CHECK(voiceCb); + mVoiceCb = voiceCb; +} + +Return RadioIndication::callRing(V1_0::RadioIndicationType type, bool isGsm, + const V1_0::CdmaSignalInfoRecord& record) { + LOG_CALL << type; + CHECK_CB(mVoiceCb); + mVoiceCb->callRing(toAidl(type), isGsm, toAidl(record)); + return {}; +} + +Return RadioIndication::callStateChanged(V1_0::RadioIndicationType type) { + LOG_CALL << type; + CHECK_CB(mVoiceCb); + mVoiceCb->callStateChanged(toAidl(type)); + return {}; +} + +Return RadioIndication::cdmaCallWaiting(V1_0::RadioIndicationType type, + const V1_0::CdmaCallWaiting& callWaitingRecord) { + LOG_CALL << type; + CHECK_CB(mVoiceCb); + mVoiceCb->cdmaCallWaiting(toAidl(type), toAidl(callWaitingRecord)); + return {}; +} + +Return RadioIndication::cdmaInfoRec(V1_0::RadioIndicationType type, + const V1_0::CdmaInformationRecords& records) { + LOG_CALL << type; + CHECK_CB(mVoiceCb); + mVoiceCb->cdmaInfoRec(toAidl(type), toAidl(records.infoRec)); + return {}; +} + +Return RadioIndication::cdmaOtaProvisionStatus(V1_0::RadioIndicationType type, + V1_0::CdmaOtaProvisionStatus status) { + LOG_CALL << type; + CHECK_CB(mVoiceCb); + mVoiceCb->cdmaOtaProvisionStatus(toAidl(type), aidl::CdmaOtaProvisionStatus(status)); + return {}; +} + +Return RadioIndication::currentEmergencyNumberList( + V1_0::RadioIndicationType type, const hidl_vec& emergencyNumbers) { + LOG_CALL << type; + CHECK_CB(mVoiceCb); + mVoiceCb->currentEmergencyNumberList(toAidl(type), toAidl(emergencyNumbers)); + return {}; +} + +Return RadioIndication::enterEmergencyCallbackMode(V1_0::RadioIndicationType type) { + LOG_CALL << type; + CHECK_CB(mVoiceCb); + mVoiceCb->enterEmergencyCallbackMode(toAidl(type)); + return {}; +} + +Return RadioIndication::exitEmergencyCallbackMode(V1_0::RadioIndicationType type) { + LOG_CALL << type; + CHECK_CB(mVoiceCb); + mVoiceCb->exitEmergencyCallbackMode(toAidl(type)); + return {}; +} + +Return RadioIndication::indicateRingbackTone(V1_0::RadioIndicationType type, bool start) { + LOG_CALL << type; + CHECK_CB(mVoiceCb); + mVoiceCb->indicateRingbackTone(toAidl(type), start); + return {}; +} + +Return RadioIndication::onSupplementaryServiceIndication(V1_0::RadioIndicationType type, + const V1_0::StkCcUnsolSsResult& ss) { + LOG_CALL << type; + CHECK_CB(mVoiceCb); + mVoiceCb->onSupplementaryServiceIndication(toAidl(type), toAidl(ss)); + return {}; +} + +Return RadioIndication::resendIncallMute(V1_0::RadioIndicationType type) { + LOG_CALL << type; + CHECK_CB(mVoiceCb); + mVoiceCb->resendIncallMute(toAidl(type)); + return {}; +} + +Return RadioIndication::srvccStateNotify(V1_0::RadioIndicationType type, + V1_0::SrvccState state) { + LOG_CALL << type; + CHECK_CB(mVoiceCb); + mVoiceCb->srvccStateNotify(toAidl(type), aidl::SrvccState(state)); + return {}; +} + +Return RadioIndication::stkCallControlAlphaNotify(V1_0::RadioIndicationType type, + const hidl_string& alpha) { + LOG_CALL << type; + CHECK_CB(mVoiceCb); + mVoiceCb->stkCallControlAlphaNotify(toAidl(type), alpha); + return {}; +} + +Return RadioIndication::stkCallSetup(V1_0::RadioIndicationType type, int64_t timeout) { + LOG_CALL << type; + CHECK_CB(mVoiceCb); + mVoiceCb->stkCallSetup(toAidl(type), timeout); + return {}; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp new file mode 100644 index 0000000000..0a64c56be2 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp @@ -0,0 +1,294 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "VoiceResponse" + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::voice; + +void RadioResponse::setResponseFunction(std::shared_ptr voiceCb) { + CHECK(voiceCb); + mVoiceCb = voiceCb; +} + +Return RadioResponse::acceptCallResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->acceptCallResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::conferenceResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->conferenceResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::dialResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->dialResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::emergencyDialResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->emergencyDialResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::exitEmergencyCallbackModeResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->exitEmergencyCallbackModeResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::explicitCallTransferResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->explicitCallTransferResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::getCallForwardStatusResponse( + const V1_0::RadioResponseInfo& info, const hidl_vec& callFwdInfos) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->getCallForwardStatusResponse(toAidl(info), toAidl(callFwdInfos)); + return {}; +} + +Return RadioResponse::getCallWaitingResponse(const V1_0::RadioResponseInfo& info, bool enable, + int32_t serviceClass) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->getCallWaitingResponse(toAidl(info), enable, serviceClass); + return {}; +} + +Return RadioResponse::getClipResponse(const V1_0::RadioResponseInfo& info, + V1_0::ClipStatus status) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->getClipResponse(toAidl(info), aidl::ClipStatus(status)); + return {}; +} + +Return RadioResponse::getClirResponse(const V1_0::RadioResponseInfo& info, int32_t n, + int32_t m) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->getClirResponse(toAidl(info), n, m); + return {}; +} + +Return RadioResponse::getCurrentCallsResponse(const V1_0::RadioResponseInfo& info, + const hidl_vec& calls) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->getCurrentCallsResponse(toAidl(info), toAidl(calls)); + return {}; +} + +Return RadioResponse::getCurrentCallsResponse_1_2(const V1_0::RadioResponseInfo& info, + const hidl_vec& calls) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->getCurrentCallsResponse(toAidl(info), toAidl(calls)); + return {}; +} + +Return RadioResponse::getCurrentCallsResponse_1_6(const V1_6::RadioResponseInfo& info, + const hidl_vec& calls) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->getCurrentCallsResponse(toAidl(info), toAidl(calls)); + return {}; +} + +Return RadioResponse::getLastCallFailCauseResponse( + const V1_0::RadioResponseInfo& info, const V1_0::LastCallFailCauseInfo& failCauseinfo) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->getLastCallFailCauseResponse(toAidl(info), toAidl(failCauseinfo)); + return {}; +} + +Return RadioResponse::getMuteResponse(const V1_0::RadioResponseInfo& info, bool enable) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->getMuteResponse(toAidl(info), enable); + return {}; +} + +Return RadioResponse::getPreferredVoicePrivacyResponse(const V1_0::RadioResponseInfo& info, + bool enable) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->getPreferredVoicePrivacyResponse(toAidl(info), enable); + return {}; +} + +Return RadioResponse::getTTYModeResponse(const V1_0::RadioResponseInfo& info, + V1_0::TtyMode mode) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->getTtyModeResponse(toAidl(info), aidl::TtyMode(mode)); + return {}; +} + +Return RadioResponse::handleStkCallSetupRequestFromSimResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->handleStkCallSetupRequestFromSimResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::hangupConnectionResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->hangupConnectionResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::hangupForegroundResumeBackgroundResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->hangupForegroundResumeBackgroundResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::hangupWaitingOrBackgroundResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->hangupWaitingOrBackgroundResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::rejectCallResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->rejectCallResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::sendBurstDtmfResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->sendBurstDtmfResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::sendCDMAFeatureCodeResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->sendCdmaFeatureCodeResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::sendDtmfResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->sendDtmfResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::separateConnectionResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->separateConnectionResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setCallForwardResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->setCallForwardResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setCallWaitingResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->setCallWaitingResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setClirResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->setClirResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setMuteResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->setMuteResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setPreferredVoicePrivacyResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->setPreferredVoicePrivacyResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setTTYModeResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->setTtyModeResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::startDtmfResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->startDtmfResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::stopDtmfResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->stopDtmfResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::switchWaitingOrHoldingAndActiveResponse( + const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mVoiceCb); + mVoiceCb->switchWaitingOrHoldingAndActiveResponse(toAidl(info)); + return {}; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp new file mode 100644 index 0000000000..16c6b14632 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp @@ -0,0 +1,270 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "Voice" + +namespace android::hardware::radio::compat { + +using ::ndk::ScopedAStatus; +namespace aidl = ::aidl::android::hardware::radio::voice; +constexpr auto ok = &ScopedAStatus::ok; + +ScopedAStatus RadioVoice::acceptCall(int32_t serial) { + LOG_CALL << serial; + mHal1_5->acceptCall(serial); + return ok(); +} + +ScopedAStatus RadioVoice::conference(int32_t serial) { + LOG_CALL << serial; + mHal1_5->conference(serial); + return ok(); +} + +ScopedAStatus RadioVoice::dial(int32_t serial, const aidl::Dial& dialInfo) { + LOG_CALL << serial; + mHal1_5->dial(serial, toHidl(dialInfo)); + return ok(); +} + +ScopedAStatus RadioVoice::emergencyDial( // + int32_t serial, const aidl::Dial& dialInfo, aidl::EmergencyServiceCategory categories, + const std::vector& urns, aidl::EmergencyCallRouting routing, + bool hasKnownUserIntentEmerg, bool isTesting) { + LOG_CALL << serial; + mHal1_5->emergencyDial(serial, toHidl(dialInfo), + toHidlBitfield(categories), toHidl(urns), + V1_4::EmergencyCallRouting(routing), hasKnownUserIntentEmerg, isTesting); + return ok(); +} + +ScopedAStatus RadioVoice::exitEmergencyCallbackMode(int32_t serial) { + LOG_CALL << serial; + mHal1_5->exitEmergencyCallbackMode(serial); + return ok(); +} + +ScopedAStatus RadioVoice::explicitCallTransfer(int32_t serial) { + LOG_CALL << serial; + mHal1_5->explicitCallTransfer(serial); + return ok(); +} + +ScopedAStatus RadioVoice::getCallForwardStatus(int32_t serial, + const aidl::CallForwardInfo& callInfo) { + LOG_CALL << serial; + mHal1_5->getCallForwardStatus(serial, toHidl(callInfo)); + return ok(); +} + +ScopedAStatus RadioVoice::getCallWaiting(int32_t serial, int32_t serviceClass) { + LOG_CALL << serial; + mHal1_5->getCallWaiting(serial, serviceClass); + return ok(); +} + +ScopedAStatus RadioVoice::getClip(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getClip(serial); + return ok(); +} + +ScopedAStatus RadioVoice::getClir(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getClir(serial); + return ok(); +} + +ScopedAStatus RadioVoice::getCurrentCalls(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getCurrentCalls(serial); + return ok(); +} + +ScopedAStatus RadioVoice::getLastCallFailCause(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getLastCallFailCause(serial); + return ok(); +} + +ScopedAStatus RadioVoice::getMute(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getMute(serial); + return ok(); +} + +ScopedAStatus RadioVoice::getPreferredVoicePrivacy(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getPreferredVoicePrivacy(serial); + return ok(); +} + +ScopedAStatus RadioVoice::getTtyMode(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getTTYMode(serial); + return ok(); +} + +ScopedAStatus RadioVoice::handleStkCallSetupRequestFromSim(int32_t serial, bool accept) { + LOG_CALL << serial; + mHal1_5->handleStkCallSetupRequestFromSim(serial, accept); + return ok(); +} + +ScopedAStatus RadioVoice::hangup(int32_t serial, int32_t gsmIndex) { + LOG_CALL << serial; + mHal1_5->hangup(serial, gsmIndex); + return ok(); +} + +ScopedAStatus RadioVoice::hangupForegroundResumeBackground(int32_t serial) { + LOG_CALL << serial; + mHal1_5->hangupForegroundResumeBackground(serial); + return ok(); +} + +ScopedAStatus RadioVoice::hangupWaitingOrBackground(int32_t serial) { + LOG_CALL << serial; + mHal1_5->hangupWaitingOrBackground(serial); + return ok(); +} + +ScopedAStatus RadioVoice::isVoNrEnabled(int32_t serial) { + LOG_CALL << serial; + // TODO(b/203699028): can't call isVoNrEnabledResponse with 1.6 callback + return ok(); +} + +ScopedAStatus RadioVoice::rejectCall(int32_t serial) { + LOG_CALL << serial; + mHal1_5->rejectCall(serial); + return ok(); +} + +ScopedAStatus RadioVoice::responseAcknowledgement() { + LOG_CALL; + mHal1_5->responseAcknowledgement(); + return ok(); +} + +ScopedAStatus RadioVoice::sendBurstDtmf(int32_t serial, const std::string& dtmf, int32_t on, + int32_t off) { + LOG_CALL << serial; + mHal1_5->sendBurstDtmf(serial, dtmf, on, off); + return ok(); +} + +ScopedAStatus RadioVoice::sendCdmaFeatureCode(int32_t serial, const std::string& featureCode) { + LOG_CALL << serial; + mHal1_5->sendCDMAFeatureCode(serial, featureCode); + return ok(); +} + +ScopedAStatus RadioVoice::sendDtmf(int32_t serial, const std::string& s) { + LOG_CALL << serial; + mHal1_5->sendDtmf(serial, s); + return ok(); +} + +ScopedAStatus RadioVoice::separateConnection(int32_t serial, int32_t gsmIndex) { + LOG_CALL << serial; + mHal1_5->separateConnection(serial, gsmIndex); + return ok(); +} + +ScopedAStatus RadioVoice::setCallForward(int32_t serial, const aidl::CallForwardInfo& callInfo) { + LOG_CALL << serial; + mHal1_5->setCallForward(serial, toHidl(callInfo)); + return ok(); +} + +ScopedAStatus RadioVoice::setCallWaiting(int32_t serial, bool enable, int32_t serviceClass) { + LOG_CALL << serial; + mHal1_5->setCallWaiting(serial, enable, serviceClass); + return ok(); +} + +ScopedAStatus RadioVoice::setClir(int32_t serial, int32_t status) { + LOG_CALL << serial; + mHal1_5->setClir(serial, status); + return ok(); +} + +ScopedAStatus RadioVoice::setMute(int32_t serial, bool enable) { + LOG_CALL << serial; + mHal1_5->setMute(serial, enable); + return ok(); +} + +ScopedAStatus RadioVoice::setPreferredVoicePrivacy(int32_t serial, bool enable) { + LOG_CALL << serial; + mHal1_5->setPreferredVoicePrivacy(serial, enable); + return ok(); +} + +ScopedAStatus RadioVoice::setResponseFunctions( + const std::shared_ptr& voiceResponse, + const std::shared_ptr& voiceIndication) { + LOG_CALL << voiceResponse << ' ' << voiceIndication; + + CHECK(voiceResponse); + CHECK(voiceIndication); + + mRadioResponse->setResponseFunction(voiceResponse); + mRadioIndication->setResponseFunction(voiceIndication); + + return ok(); +} + +ScopedAStatus RadioVoice::setTtyMode(int32_t serial, aidl::TtyMode mode) { + LOG_CALL << serial; + mHal1_5->setTTYMode(serial, V1_0::TtyMode(mode)); + return ok(); +} + +ndk::ScopedAStatus RadioVoice::setVoNrEnabled(int32_t serial, [[maybe_unused]] bool enable) { + LOG_CALL << serial; + // TODO(b/203699028): should set `persist.radio.is_vonr_enabled_` property instead + return ok(); +} + +ScopedAStatus RadioVoice::startDtmf(int32_t serial, const std::string& s) { + LOG_CALL << serial; + mHal1_5->startDtmf(serial, s); + return ok(); +} + +ScopedAStatus RadioVoice::stopDtmf(int32_t serial) { + LOG_CALL << serial; + mHal1_5->stopDtmf(serial); + return ok(); +} + +ScopedAStatus RadioVoice::switchWaitingOrHoldingAndActive(int32_t serial) { + LOG_CALL << serial; + mHal1_5->switchWaitingOrHoldingAndActive(serial); + return ok(); +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/voice/structs.cpp b/radio/aidl/compat/libradiocompat/voice/structs.cpp new file mode 100644 index 0000000000..ae6342e5be --- /dev/null +++ b/radio/aidl/compat/libradiocompat/voice/structs.cpp @@ -0,0 +1,223 @@ +/* + * 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 "structs.h" + +#include "commonStructs.h" + +#include "collections.h" + +#include + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::voice; + +V1_0::Dial toHidl(const aidl::Dial& info) { + return { + .address = info.address, + .clir = V1_0::Clir{info.clir}, + .uusInfo = toHidl(info.uusInfo), + }; +} + +V1_0::UusInfo toHidl(const aidl::UusInfo& info) { + return { + .uusType = V1_0::UusType{info.uusType}, + .uusDcs = V1_0::UusDcs{info.uusDcs}, + .uusData = info.uusData, + }; +} + +aidl::CallForwardInfo toAidl(const V1_0::CallForwardInfo& info) { + return { + .status = static_cast(info.status), + .reason = info.reason, + .serviceClass = info.serviceClass, + .toa = info.toa, + .number = info.number, + .timeSeconds = info.timeSeconds, + }; +} + +V1_0::CallForwardInfo toHidl(const aidl::CallForwardInfo& info) { + return { + .status = V1_0::CallForwardInfoStatus{info.status}, + .reason = info.reason, + .serviceClass = info.serviceClass, + .toa = info.toa, + .number = info.number, + .timeSeconds = info.timeSeconds, + }; +} + +aidl::CdmaSignalInfoRecord toAidl(const V1_0::CdmaSignalInfoRecord& record) { + return { + .isPresent = record.isPresent, + .signalType = record.signalType, + .alertPitch = record.alertPitch, + .signal = record.signal, + }; +} + +aidl::CdmaCallWaiting toAidl(const V1_0::CdmaCallWaiting& call) { + return { + .number = call.number, + .numberPresentation = static_cast(call.numberPresentation), + .name = call.name, + .signalInfoRecord = toAidl(call.signalInfoRecord), + .numberType = static_cast(call.numberType), + .numberPlan = static_cast(call.numberPlan), + }; +} + +aidl::CdmaInformationRecord toAidl(const V1_0::CdmaInformationRecord& record) { + return { + .name = static_cast(record.name), + .display = toAidl(record.display), + .number = toAidl(record.number), + .signal = toAidl(record.signal), + .redir = toAidl(record.redir), + .lineCtrl = toAidl(record.lineCtrl), + .clir = toAidl(record.clir), + .audioCtrl = toAidl(record.audioCtrl), + }; +} + +aidl::CdmaDisplayInfoRecord toAidl(const V1_0::CdmaDisplayInfoRecord& record) { + return { + .alphaBuf = record.alphaBuf, + }; +} + +aidl::CdmaNumberInfoRecord toAidl(const V1_0::CdmaNumberInfoRecord& record) { + return { + .number = record.number, + .numberType = static_cast(record.numberType), + .numberPlan = static_cast(record.numberPlan), + .pi = static_cast(record.pi), + .si = static_cast(record.si), + }; +} + +aidl::CdmaRedirectingNumberInfoRecord toAidl(const V1_0::CdmaRedirectingNumberInfoRecord& record) { + return { + .redirectingNumber = toAidl(record.redirectingNumber), + .redirectingReason = static_cast(record.redirectingReason), + }; +} + +aidl::CdmaLineControlInfoRecord toAidl(const V1_0::CdmaLineControlInfoRecord& record) { + return { + .lineCtrlPolarityIncluded = static_cast(record.lineCtrlPolarityIncluded), + .lineCtrlToggle = static_cast(record.lineCtrlToggle), + .lineCtrlReverse = static_cast(record.lineCtrlReverse), + .lineCtrlPowerDenial = static_cast(record.lineCtrlPowerDenial), + }; +} + +aidl::CdmaT53ClirInfoRecord toAidl(const V1_0::CdmaT53ClirInfoRecord& record) { + return { + .cause = static_cast(record.cause), + }; +} + +aidl::CdmaT53AudioControlInfoRecord toAidl(const V1_0::CdmaT53AudioControlInfoRecord& record) { + return { + .upLink = static_cast(record.upLink), + .downLink = static_cast(record.downLink), + }; +} + +aidl::EmergencyNumber toAidl(const V1_4::EmergencyNumber& num) { + return { + .number = num.number, + .mcc = num.mcc, + .mnc = num.mnc, + .categories = aidl::EmergencyServiceCategory(num.categories), + .urns = toAidl(num.urns), + .sources = num.sources, + }; +} + +aidl::StkCcUnsolSsResult toAidl(const V1_0::StkCcUnsolSsResult& res) { + return { + .serviceType = static_cast(res.serviceType), + .requestType = static_cast(res.requestType), + .teleserviceType = static_cast(res.teleserviceType), + .serviceClass = res.serviceClass, + .result = toAidl(res.result), + .ssInfo = toAidl(res.ssInfo), + .cfData = toAidl(res.cfData), + }; +} + +aidl::SsInfoData toAidl(const V1_0::SsInfoData& info) { + return { + .ssInfo = info.ssInfo, + }; +} + +aidl::CfData toAidl(const V1_0::CfData& data) { + return { + .cfInfo = toAidl(data.cfInfo), + }; +} + +aidl::Call toAidl(const V1_0::Call& call) { + return toAidl(V1_2::Call{call, {}}); +} + +aidl::Call toAidl(const V1_2::Call& call) { + return toAidl(V1_6::Call{call, {}}); +} + +aidl::Call toAidl(const V1_6::Call& call) { + return { + .state = static_cast(call.base.base.state), + .index = call.base.base.index, + .toa = call.base.base.toa, + .isMpty = call.base.base.isMpty, + .isMT = call.base.base.isMT, + .als = static_cast(call.base.base.als), + .isVoice = call.base.base.isVoice, + .isVoicePrivacy = call.base.base.isVoicePrivacy, + .number = call.base.base.number, + .numberPresentation = static_cast(call.base.base.numberPresentation), + .name = call.base.base.name, + .namePresentation = static_cast(call.base.base.namePresentation), + .uusInfo = toAidl(call.base.base.uusInfo), + .audioQuality = aidl::AudioQuality(call.base.audioQuality), + .forwardedNumber = call.forwardedNumber, + }; +} + +aidl::UusInfo toAidl(const V1_0::UusInfo& info) { + return { + .uusType = static_cast(info.uusType), + .uusDcs = static_cast(info.uusDcs), + .uusData = info.uusData, + }; +} + +aidl::LastCallFailCauseInfo toAidl(const V1_0::LastCallFailCauseInfo& info) { + return { + .causeCode = aidl::LastCallFailCause(info.causeCode), + .vendorCause = info.vendorCause, + }; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/voice/structs.h b/radio/aidl/compat/libradiocompat/voice/structs.h new file mode 100644 index 0000000000..b55a089062 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/voice/structs.h @@ -0,0 +1,91 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace android::hardware::radio::compat { + +V1_0::Dial toHidl(const ::aidl::android::hardware::radio::voice::Dial& info); + +V1_0::UusInfo toHidl(const ::aidl::android::hardware::radio::voice::UusInfo& info); + +::aidl::android::hardware::radio::voice::CallForwardInfo toAidl(const V1_0::CallForwardInfo& info); +V1_0::CallForwardInfo toHidl(const ::aidl::android::hardware::radio::voice::CallForwardInfo& info); + +::aidl::android::hardware::radio::voice::CdmaSignalInfoRecord // +toAidl(const V1_0::CdmaSignalInfoRecord& record); + +::aidl::android::hardware::radio::voice::CdmaCallWaiting toAidl(const V1_0::CdmaCallWaiting& call); + +::aidl::android::hardware::radio::voice::CdmaInformationRecord // +toAidl(const V1_0::CdmaInformationRecord& record); + +::aidl::android::hardware::radio::voice::CdmaDisplayInfoRecord // +toAidl(const V1_0::CdmaDisplayInfoRecord& record); + +::aidl::android::hardware::radio::voice::CdmaNumberInfoRecord // +toAidl(const V1_0::CdmaNumberInfoRecord& record); + +::aidl::android::hardware::radio::voice::CdmaRedirectingNumberInfoRecord // +toAidl(const V1_0::CdmaRedirectingNumberInfoRecord& record); + +::aidl::android::hardware::radio::voice::CdmaLineControlInfoRecord // +toAidl(const V1_0::CdmaLineControlInfoRecord& record); + +::aidl::android::hardware::radio::voice::CdmaT53ClirInfoRecord // +toAidl(const V1_0::CdmaT53ClirInfoRecord& record); + +::aidl::android::hardware::radio::voice::CdmaT53AudioControlInfoRecord // +toAidl(const V1_0::CdmaT53AudioControlInfoRecord& record); + +::aidl::android::hardware::radio::voice::EmergencyNumber toAidl(const V1_4::EmergencyNumber& num); + +::aidl::android::hardware::radio::voice::StkCcUnsolSsResult // +toAidl(const V1_0::StkCcUnsolSsResult& res); + +::aidl::android::hardware::radio::voice::SsInfoData toAidl(const V1_0::SsInfoData& info); + +::aidl::android::hardware::radio::voice::CfData toAidl(const V1_0::CfData& data); + +::aidl::android::hardware::radio::voice::Call toAidl(const V1_0::Call& call); +::aidl::android::hardware::radio::voice::Call toAidl(const V1_2::Call& call); +::aidl::android::hardware::radio::voice::Call toAidl(const V1_6::Call& call); + +::aidl::android::hardware::radio::voice::UusInfo toAidl(const V1_0::UusInfo& info); + +::aidl::android::hardware::radio::voice::LastCallFailCauseInfo // +toAidl(const V1_0::LastCallFailCauseInfo& info); + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/service/Android.bp b/radio/aidl/compat/service/Android.bp index 3c543f744d..0536c1c1b3 100644 --- a/radio/aidl/compat/service/Android.bp +++ b/radio/aidl/compat/service/Android.bp @@ -43,6 +43,7 @@ cc_binary { "android.hardware.radio.messaging-V1-ndk", "android.hardware.radio.network-V1-ndk", "android.hardware.radio.sim-V1-ndk", + "android.hardware.radio.voice-V1-ndk", "android.hardware.radio@1.0", "android.hardware.radio@1.1", "android.hardware.radio@1.2", diff --git a/radio/aidl/compat/service/radio-compat.xml b/radio/aidl/compat/service/radio-compat.xml index e035cac793..d3f4212fcf 100644 --- a/radio/aidl/compat/service/radio-compat.xml +++ b/radio/aidl/compat/service/radio-compat.xml @@ -25,5 +25,9 @@ android.hardware.radio.sim IRadioSim/slot1 + + android.hardware.radio.voice + IRadioVoice/slot1 + --> diff --git a/radio/aidl/compat/service/service.cpp b/radio/aidl/compat/service/service.cpp index 82d234f8ba..3d60ffe129 100644 --- a/radio/aidl/compat/service/service.cpp +++ b/radio/aidl/compat/service/service.cpp @@ -26,6 +26,7 @@ #include #include #include +#include namespace android::hardware::radio::service { @@ -63,6 +64,7 @@ static void publishRadio(std::string slot) { publishRadioHal(radioHidl, responseCb, indicationCb, slot); publishRadioHal(radioHidl, responseCb, indicationCb, slot); publishRadioHal(radioHidl, responseCb, indicationCb, slot); + publishRadioHal(radioHidl, responseCb, indicationCb, slot); } static void publishRadioConfig() { -- GitLab From 535f30c8aceca7f9ba4640336d5bed0fa9aa0835 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Mon, 8 Nov 2021 16:10:28 -0800 Subject: [PATCH 288/825] Implement RadioModem for AIDL-HIDL Telephony HAL translator Bug: 203699028 Test: Boot and grep logcat against radiocompat Change-Id: I670f78af2cd7a0ce0b49dfc802fd363f47d9b6a6 --- radio/aidl/compat/libradiocompat/Android.bp | 6 +- .../compat/libradiocompat/RadioResponse.cpp | 81 +-------- .../aidl/compat/libradiocompat/collections.h | 16 ++ .../include/libradiocompat/RadioIndication.h | 4 + .../include/libradiocompat/RadioModem.h | 59 +++++++ .../include/libradiocompat/RadioResponse.h | 4 + .../RadioIndication-modem.cpp} | 45 +++-- .../libradiocompat/modem/RadioModem.cpp | 145 ++++++++++++++++ .../modem/RadioResponse-modem.cpp | 164 ++++++++++++++++++ .../compat/libradiocompat/modem/structs.cpp | 93 ++++++++++ .../compat/libradiocompat/modem/structs.h | 42 +++++ radio/aidl/compat/service/Android.bp | 1 + radio/aidl/compat/service/radio-compat.xml | 4 + radio/aidl/compat/service/service.cpp | 2 + 14 files changed, 575 insertions(+), 91 deletions(-) create mode 100644 radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h rename radio/aidl/compat/libradiocompat/{RadioIndication.cpp => modem/RadioIndication-modem.cpp} (60%) create mode 100644 radio/aidl/compat/libradiocompat/modem/RadioModem.cpp create mode 100644 radio/aidl/compat/libradiocompat/modem/RadioResponse-modem.cpp create mode 100644 radio/aidl/compat/libradiocompat/modem/structs.cpp create mode 100644 radio/aidl/compat/libradiocompat/modem/structs.h diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp index 715a1c2d3b..43d9378364 100644 --- a/radio/aidl/compat/libradiocompat/Android.bp +++ b/radio/aidl/compat/libradiocompat/Android.bp @@ -39,6 +39,7 @@ cc_library { "android.hardware.radio.config@1.3", "android.hardware.radio.data-V1-ndk", "android.hardware.radio.messaging-V1-ndk", + "android.hardware.radio.modem-V1-ndk", "android.hardware.radio.network-V1-ndk", "android.hardware.radio.sim-V1-ndk", "android.hardware.radio.voice-V1-ndk", @@ -56,7 +57,6 @@ cc_library { ], srcs: [ "RadioCompatBase.cpp", - "RadioIndication.cpp", "RadioResponse.cpp", "commonStructs.cpp", "config/RadioConfig.cpp", @@ -71,6 +71,10 @@ cc_library { "messaging/RadioMessaging.cpp", "messaging/RadioResponse-messaging.cpp", "messaging/structs.cpp", + "modem/RadioIndication-modem.cpp", + "modem/RadioResponse-modem.cpp", + "modem/RadioModem.cpp", + "modem/structs.cpp", "network/RadioIndication-network.cpp", "network/RadioNetwork.cpp", "network/RadioResponse-network.cpp", diff --git a/radio/aidl/compat/libradiocompat/RadioResponse.cpp b/radio/aidl/compat/libradiocompat/RadioResponse.cpp index a39f575695..35b0ac1d82 100644 --- a/radio/aidl/compat/libradiocompat/RadioResponse.cpp +++ b/radio/aidl/compat/libradiocompat/RadioResponse.cpp @@ -18,9 +18,6 @@ #include "debug.h" -// TODO(b/203699028): remove when fully implemented -#pragma GCC diagnostic ignored "-Wunused-parameter" - #define RADIO_MODULE "Common" namespace android::hardware::radio::compat { @@ -30,87 +27,11 @@ Return RadioResponse::acknowledgeRequest(int32_t serial) { // TODO(b/203699028): send to correct requestor or confirm if spam is not a problem if (mDataCb) mDataCb->acknowledgeRequest(serial); if (mMessagingCb) mMessagingCb->acknowledgeRequest(serial); + if (mModemCb) mModemCb->acknowledgeRequest(serial); if (mNetworkCb) mNetworkCb->acknowledgeRequest(serial); if (mSimCb) mSimCb->acknowledgeRequest(serial); if (mVoiceCb) mVoiceCb->acknowledgeRequest(serial); return {}; } -Return RadioResponse::setRadioPowerResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getBasebandVersionResponse(const V1_0::RadioResponseInfo& info, - const hidl_string& version) { - return {}; -} - -Return RadioResponse::getDeviceIdentityResponse( // - const V1_0::RadioResponseInfo& info, const hidl_string& imei, const hidl_string& imeisv, - const hidl_string& esn, const hidl_string& meid) { - return {}; -} - -Return RadioResponse::nvReadItemResponse(const V1_0::RadioResponseInfo& info, - const hidl_string& result) { - return {}; -} - -Return RadioResponse::nvWriteItemResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::nvWriteCdmaPrlResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::nvResetConfigResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getHardwareConfigResponse( - const V1_0::RadioResponseInfo& info, const hidl_vec& config) { - return {}; -} - -Return RadioResponse::requestShutdownResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getRadioCapabilityResponse(const V1_0::RadioResponseInfo& info, - const V1_0::RadioCapability& rc) { - return {}; -} - -Return RadioResponse::setRadioCapabilityResponse(const V1_0::RadioResponseInfo& info, - const V1_0::RadioCapability& rc) { - return {}; -} - -Return RadioResponse::getModemActivityInfoResponse( - const V1_0::RadioResponseInfo& info, const V1_0::ActivityStatsInfo& activityInfo) { - return {}; -} - -Return RadioResponse::sendDeviceStateResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::enableModemResponse(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::getModemStackStatusResponse(const V1_0::RadioResponseInfo& info, - bool isEnabled) { - return {}; -} - -Return RadioResponse::setRadioPowerResponse_1_5(const V1_0::RadioResponseInfo& info) { - return {}; -} - -Return RadioResponse::setRadioPowerResponse_1_6(const V1_6::RadioResponseInfo& info) { - return {}; -} - } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/collections.h b/radio/aidl/compat/libradiocompat/collections.h index e3439a75d7..082ef17d1d 100644 --- a/radio/aidl/compat/libradiocompat/collections.h +++ b/radio/aidl/compat/libradiocompat/collections.h @@ -54,6 +54,22 @@ auto toHidl(const std::vector& inp) { return out; } +/** + * Converts hidl_array HIDL list to std::vector AIDL list. + * + * To convert values, the template uses toAidl functions for a given type T, assuming it's defined. + * + * \param inp array to convert + */ +template +auto toAidl(const hidl_array& inp) { + std::vector out(N); + for (size_t i = 0; i < N; i++) { + out[i] = toAidl(inp[i]); + } + return out; +} + /** * Converts T=OptionalX HIDL value to std::optional AIDL value. * diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h index 51cdccbc38..20e09735e6 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -28,6 +29,7 @@ class RadioIndication : public V1_6::IRadioIndication { std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> mDataCb; std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> mMessagingCb; + std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemIndication> mModemCb; std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkIndication> mNetworkCb; std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> mSimCb; std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> mVoiceCb; @@ -184,6 +186,8 @@ class RadioIndication : public V1_6::IRadioIndication { void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> radioMessagingIndication); + void setResponseFunction( + std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemIndication> modmCb); void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkIndication> ni); void setResponseFunction( diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h new file mode 100644 index 0000000000..666ff472a0 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h @@ -0,0 +1,59 @@ +/* + * 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 "RadioCompatBase.h" + +#include + +namespace android::hardware::radio::compat { + +class RadioModem : public RadioCompatBase, + public aidl::android::hardware::radio::modem::BnRadioModem { + ::ndk::ScopedAStatus enableModem(int32_t serial, bool on) override; + ::ndk::ScopedAStatus getBasebandVersion(int32_t serial) override; + ::ndk::ScopedAStatus getDeviceIdentity(int32_t serial) override; + ::ndk::ScopedAStatus getHardwareConfig(int32_t serial) override; + ::ndk::ScopedAStatus getModemActivityInfo(int32_t serial) override; + ::ndk::ScopedAStatus getModemStackStatus(int32_t serial) override; + ::ndk::ScopedAStatus getRadioCapability(int32_t serial) override; + ::ndk::ScopedAStatus nvReadItem( + int32_t serial, ::aidl::android::hardware::radio::modem::NvItem itemId) override; + ::ndk::ScopedAStatus nvResetConfig( + int32_t serial, ::aidl::android::hardware::radio::modem::ResetNvType type) override; + ::ndk::ScopedAStatus nvWriteCdmaPrl(int32_t serial, const std::vector& prl) override; + ::ndk::ScopedAStatus nvWriteItem( + int32_t serial, const ::aidl::android::hardware::radio::modem::NvWriteItem& i) override; + ::ndk::ScopedAStatus requestShutdown(int32_t serial) override; + ::ndk::ScopedAStatus responseAcknowledgement() override; + ::ndk::ScopedAStatus sendDeviceState( + int32_t serial, ::aidl::android::hardware::radio::modem::DeviceStateType stateType, + bool state) override; + ::ndk::ScopedAStatus setRadioCapability( + int32_t s, const ::aidl::android::hardware::radio::modem::RadioCapability& rc) override; + ::ndk::ScopedAStatus setRadioPower(int32_t serial, bool powerOn, bool forEmergencyCall, + bool preferredForEmergencyCall) override; + ::ndk::ScopedAStatus setResponseFunctions( + const std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse>& + radioModemResponse, + const std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemIndication>& + radioModemIndication) override; + + public: + using RadioCompatBase::RadioCompatBase; +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h index 826d38566c..5db963f582 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -28,6 +29,7 @@ class RadioResponse : public V1_6::IRadioResponse { std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> mDataCb; std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> mMessagingCb; + std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> mModemCb; std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> mNetworkCb; std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> mSimCb; std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> mVoiceCb; @@ -412,6 +414,8 @@ class RadioResponse : public V1_6::IRadioResponse { void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> radioMessagingResponse); + void setResponseFunction( + std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> modemCb); void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> nwCb); void setResponseFunction( diff --git a/radio/aidl/compat/libradiocompat/RadioIndication.cpp b/radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp similarity index 60% rename from radio/aidl/compat/libradiocompat/RadioIndication.cpp rename to radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp index df97841d16..8fc4da62d5 100644 --- a/radio/aidl/compat/libradiocompat/RadioIndication.cpp +++ b/radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp @@ -16,32 +16,57 @@ #include -// TODO(b/203699028): remove when fully implemented -#pragma GCC diagnostic ignored "-Wunused-parameter" +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "ModemIndication" namespace android::hardware::radio::compat { -Return RadioIndication::radioStateChanged(V1_0::RadioIndicationType type, - V1_0::RadioState radioState) { - return {}; -} +namespace aidl = ::aidl::android::hardware::radio::modem; -Return RadioIndication::rilConnected(V1_0::RadioIndicationType type) { - return {}; +void RadioIndication::setResponseFunction(std::shared_ptr modemCb) { + CHECK(modemCb); + mModemCb = modemCb; } Return RadioIndication::hardwareConfigChanged(V1_0::RadioIndicationType type, const hidl_vec& configs) { + LOG_CALL << type; + CHECK_CB(mModemCb); + mModemCb->hardwareConfigChanged(toAidl(type), toAidl(configs)); + return {}; +} + +Return RadioIndication::modemReset(V1_0::RadioIndicationType type, const hidl_string& reasn) { + LOG_CALL << type; + CHECK_CB(mModemCb); + mModemCb->modemReset(toAidl(type), reasn); return {}; } Return RadioIndication::radioCapabilityIndication(V1_0::RadioIndicationType type, const V1_0::RadioCapability& rc) { + LOG_CALL << type; + CHECK_CB(mModemCb); + mModemCb->radioCapabilityIndication(toAidl(type), toAidl(rc)); + return {}; +} + +Return RadioIndication::radioStateChanged(V1_0::RadioIndicationType t, V1_0::RadioState st) { + LOG_CALL << t; + CHECK_CB(mModemCb); + mModemCb->radioStateChanged(toAidl(t), aidl::RadioState(st)); return {}; } -Return RadioIndication::modemReset(V1_0::RadioIndicationType type, - const hidl_string& reason) { +Return RadioIndication::rilConnected(V1_0::RadioIndicationType type) { + LOG_CALL << type; + CHECK_CB(mModemCb); + mModemCb->rilConnected(toAidl(type)); return {}; } diff --git a/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp b/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp new file mode 100644 index 0000000000..660ae9f2ed --- /dev/null +++ b/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp @@ -0,0 +1,145 @@ +/* + * 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 + +#include "debug.h" +#include "structs.h" + +#define RADIO_MODULE "Modem" + +namespace android::hardware::radio::compat { + +using ::ndk::ScopedAStatus; +namespace aidl = ::aidl::android::hardware::radio::modem; +constexpr auto ok = &ScopedAStatus::ok; + +ScopedAStatus RadioModem::enableModem(int32_t serial, bool on) { + LOG_CALL << serial; + mHal1_5->enableModem(serial, on); + return ok(); +} + +ScopedAStatus RadioModem::getBasebandVersion(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getBasebandVersion(serial); + return ok(); +} + +ScopedAStatus RadioModem::getDeviceIdentity(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getDeviceIdentity(serial); + return ok(); +} + +ScopedAStatus RadioModem::getHardwareConfig(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getHardwareConfig(serial); + return ok(); +} + +ScopedAStatus RadioModem::getModemActivityInfo(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getModemActivityInfo(serial); + return ok(); +} + +ScopedAStatus RadioModem::getModemStackStatus(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getModemStackStatus(serial); + return ok(); +} + +ScopedAStatus RadioModem::getRadioCapability(int32_t serial) { + LOG_CALL << serial; + mHal1_5->getRadioCapability(serial); + return ok(); +} + +ScopedAStatus RadioModem::nvReadItem(int32_t serial, aidl::NvItem itemId) { + LOG_CALL << serial; + mHal1_5->nvReadItem(serial, V1_0::NvItem(itemId)); + return ok(); +} + +ScopedAStatus RadioModem::nvResetConfig(int32_t serial, aidl::ResetNvType resetType) { + LOG_CALL << serial; + mHal1_5->nvResetConfig(serial, V1_0::ResetNvType(resetType)); + return ok(); +} + +ScopedAStatus RadioModem::nvWriteCdmaPrl(int32_t serial, const std::vector& prl) { + LOG_CALL << serial; + mHal1_5->nvWriteCdmaPrl(serial, prl); + return ok(); +} + +ScopedAStatus RadioModem::nvWriteItem(int32_t serial, const aidl::NvWriteItem& item) { + LOG_CALL << serial; + mHal1_5->nvWriteItem(serial, toHidl(item)); + return ok(); +} + +ScopedAStatus RadioModem::requestShutdown(int32_t serial) { + LOG_CALL << serial; + mHal1_5->requestShutdown(serial); + return ok(); +} + +ScopedAStatus RadioModem::responseAcknowledgement() { + LOG_CALL; + mHal1_5->responseAcknowledgement(); + return ok(); +} + +ScopedAStatus RadioModem::sendDeviceState(int32_t serial, aidl::DeviceStateType type, bool state) { + LOG_CALL << serial; + mHal1_5->sendDeviceState(serial, V1_0::DeviceStateType(type), state); + return ok(); +} + +ScopedAStatus RadioModem::setRadioCapability(int32_t serial, const aidl::RadioCapability& rc) { + LOG_CALL << serial; + mHal1_5->setRadioCapability(serial, toHidl(rc)); + return ok(); +} + +ScopedAStatus RadioModem::setRadioPower(int32_t serial, bool powerOn, bool forEmergencyCall, + bool preferredForEmergencyCall) { + LOG_CALL << serial; + if (mHal1_6) { + mHal1_6->setRadioPower_1_6(serial, powerOn, forEmergencyCall, preferredForEmergencyCall); + } else { + mHal1_5->setRadioPower_1_5(serial, powerOn, forEmergencyCall, preferredForEmergencyCall); + } + return ok(); +} + +ScopedAStatus RadioModem::setResponseFunctions( + const std::shared_ptr& modemResponse, + const std::shared_ptr& modemIndication) { + LOG_CALL << modemResponse << ' ' << modemIndication; + + CHECK(modemResponse); + CHECK(modemIndication); + + mRadioResponse->setResponseFunction(modemResponse); + mRadioIndication->setResponseFunction(modemIndication); + + return ok(); +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/modem/RadioResponse-modem.cpp b/radio/aidl/compat/libradiocompat/modem/RadioResponse-modem.cpp new file mode 100644 index 0000000000..300627c0f4 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/modem/RadioResponse-modem.cpp @@ -0,0 +1,164 @@ +/* + * 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 + +#include "commonStructs.h" +#include "debug.h" +#include "structs.h" + +#include "collections.h" + +#define RADIO_MODULE "ModemResponse" + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio::modem; + +void RadioResponse::setResponseFunction(std::shared_ptr modemCb) { + CHECK(modemCb); + mModemCb = modemCb; +} + +Return RadioResponse::enableModemResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->enableModemResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::getBasebandVersionResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& version) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->getBasebandVersionResponse(toAidl(info), version); + return {}; +} + +Return RadioResponse::getDeviceIdentityResponse( // + const V1_0::RadioResponseInfo& info, const hidl_string& imei, const hidl_string& imeisv, + const hidl_string& esn, const hidl_string& meid) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->getDeviceIdentityResponse(toAidl(info), imei, imeisv, esn, meid); + return {}; +} + +Return RadioResponse::getHardwareConfigResponse( + const V1_0::RadioResponseInfo& info, const hidl_vec& config) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->getHardwareConfigResponse(toAidl(info), toAidl(config)); + return {}; +} + +Return RadioResponse::getModemActivityInfoResponse( + const V1_0::RadioResponseInfo& info, const V1_0::ActivityStatsInfo& activityInfo) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->getModemActivityInfoResponse(toAidl(info), toAidl(activityInfo)); + return {}; +} + +Return RadioResponse::getModemStackStatusResponse(const V1_0::RadioResponseInfo& info, + bool isEnabled) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->getModemStackStatusResponse(toAidl(info), isEnabled); + return {}; +} + +Return RadioResponse::getRadioCapabilityResponse(const V1_0::RadioResponseInfo& info, + const V1_0::RadioCapability& rc) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->getRadioCapabilityResponse(toAidl(info), toAidl(rc)); + return {}; +} + +Return RadioResponse::nvReadItemResponse(const V1_0::RadioResponseInfo& info, + const hidl_string& result) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->nvReadItemResponse(toAidl(info), result); + return {}; +} + +Return RadioResponse::nvResetConfigResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->nvResetConfigResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::nvWriteCdmaPrlResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->nvWriteCdmaPrlResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::nvWriteItemResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->nvWriteItemResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::requestShutdownResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->requestShutdownResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::sendDeviceStateResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->sendDeviceStateResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setRadioCapabilityResponse(const V1_0::RadioResponseInfo& info, + const V1_0::RadioCapability& rc) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->setRadioCapabilityResponse(toAidl(info), toAidl(rc)); + return {}; +} + +Return RadioResponse::setRadioPowerResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->setRadioPowerResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setRadioPowerResponse_1_5(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->setRadioPowerResponse(toAidl(info)); + return {}; +} + +Return RadioResponse::setRadioPowerResponse_1_6(const V1_6::RadioResponseInfo& info) { + LOG_CALL << info.serial; + CHECK_CB(mModemCb); + mModemCb->setRadioPowerResponse(toAidl(info)); + return {}; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/modem/structs.cpp b/radio/aidl/compat/libradiocompat/modem/structs.cpp new file mode 100644 index 0000000000..c1cd64cf61 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/modem/structs.cpp @@ -0,0 +1,93 @@ +/* + * 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 "structs.h" + +#include "commonStructs.h" + +#include "collections.h" + +#include + +namespace android::hardware::radio::compat { + +using ::aidl::android::hardware::radio::RadioAccessFamily; +using ::aidl::android::hardware::radio::RadioTechnology; +namespace aidl = ::aidl::android::hardware::radio::modem; + +V1_0::NvWriteItem toHidl(const aidl::NvWriteItem& item) { + return { + .itemId = V1_0::NvItem{item.itemId}, + .value = item.value, + }; +} + +aidl::RadioCapability toAidl(const V1_0::RadioCapability& capa) { + return { + .session = capa.session, + .phase = static_cast(capa.phase), + .raf = RadioAccessFamily(capa.raf), + .logicalModemUuid = capa.logicalModemUuid, + .status = static_cast(capa.status), + }; +} + +V1_0::RadioCapability toHidl(const aidl::RadioCapability& capa) { + return { + .session = capa.session, + .phase = V1_0::RadioCapabilityPhase{capa.phase}, + .raf = toHidlBitfield(capa.raf), + .logicalModemUuid = capa.logicalModemUuid, + .status = V1_0::RadioCapabilityStatus{capa.status}, + }; +} + +aidl::HardwareConfig toAidl(const V1_0::HardwareConfig& config) { + return { + .type = static_cast(config.type), + .uuid = config.uuid, + .state = static_cast(config.state), + .modem = toAidl(config.modem), + .sim = toAidl(config.sim), + }; +} + +aidl::HardwareConfigModem toAidl(const V1_0::HardwareConfigModem& modem) { + return { + .rilModel = modem.rilModel, + .rat = RadioTechnology(modem.rat), + .maxVoiceCalls = modem.maxVoice, + .maxDataCalls = modem.maxData, + .maxStandby = modem.maxStandby, + }; +} + +aidl::HardwareConfigSim toAidl(const V1_0::HardwareConfigSim& sim) { + return { + .modemUuid = sim.modemUuid, + }; +} + +aidl::ActivityStatsInfo toAidl(const V1_0::ActivityStatsInfo& info) { + return { + .sleepModeTimeMs = static_cast(info.sleepModeTimeMs), + .idleModeTimeMs = static_cast(info.idleModeTimeMs), + .txmModetimeMs = toAidl(info.txmModetimeMs), + .rxModeTimeMs = static_cast(info.rxModeTimeMs), + }; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/modem/structs.h b/radio/aidl/compat/libradiocompat/modem/structs.h new file mode 100644 index 0000000000..3ac1edbfcc --- /dev/null +++ b/radio/aidl/compat/libradiocompat/modem/structs.h @@ -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. + */ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +namespace android::hardware::radio::compat { + +V1_0::NvWriteItem toHidl(const ::aidl::android::hardware::radio::modem::NvWriteItem& item); + +::aidl::android::hardware::radio::modem::RadioCapability toAidl(const V1_0::RadioCapability& capa); +V1_0::RadioCapability toHidl(const ::aidl::android::hardware::radio::modem::RadioCapability& capa); + +::aidl::android::hardware::radio::modem::HardwareConfig toAidl(const V1_0::HardwareConfig& config); + +::aidl::android::hardware::radio::modem::HardwareConfigModem // +toAidl(const V1_0::HardwareConfigModem& modem); + +::aidl::android::hardware::radio::modem::HardwareConfigSim toAidl(const V1_0::HardwareConfigSim& s); + +::aidl::android::hardware::radio::modem::ActivityStatsInfo toAidl(const V1_0::ActivityStatsInfo& i); + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/service/Android.bp b/radio/aidl/compat/service/Android.bp index 0536c1c1b3..52eb71ff14 100644 --- a/radio/aidl/compat/service/Android.bp +++ b/radio/aidl/compat/service/Android.bp @@ -41,6 +41,7 @@ cc_binary { "android.hardware.radio.config@1.3", "android.hardware.radio.data-V1-ndk", "android.hardware.radio.messaging-V1-ndk", + "android.hardware.radio.modem-V1-ndk", "android.hardware.radio.network-V1-ndk", "android.hardware.radio.sim-V1-ndk", "android.hardware.radio.voice-V1-ndk", diff --git a/radio/aidl/compat/service/radio-compat.xml b/radio/aidl/compat/service/radio-compat.xml index d3f4212fcf..a7089e6984 100644 --- a/radio/aidl/compat/service/radio-compat.xml +++ b/radio/aidl/compat/service/radio-compat.xml @@ -17,6 +17,10 @@ android.hardware.radio.messaging IRadioMessaging/slot1 + + android.hardware.radio.modem + IRadioModem/slot1 + android.hardware.radio.network IRadioNetwork/slot1 diff --git a/radio/aidl/compat/service/service.cpp b/radio/aidl/compat/service/service.cpp index 3d60ffe129..2a67569452 100644 --- a/radio/aidl/compat/service/service.cpp +++ b/radio/aidl/compat/service/service.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -62,6 +63,7 @@ static void publishRadio(std::string slot) { publishRadioHal(radioHidl, responseCb, indicationCb, slot); publishRadioHal(radioHidl, responseCb, indicationCb, slot); + publishRadioHal(radioHidl, responseCb, indicationCb, slot); publishRadioHal(radioHidl, responseCb, indicationCb, slot); publishRadioHal(radioHidl, responseCb, indicationCb, slot); publishRadioHal(radioHidl, responseCb, indicationCb, slot); -- GitLab From 10cf736cef8b143224add0ba56f7c7f914710c34 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Sun, 3 Oct 2021 22:32:04 -0700 Subject: [PATCH 289/825] Add GnssNavigationMessage AIDL HAL (hardware/interfaces) Bug: 201253590 Test: atest VtsHalGnssTargetTest Change-Id: I3a12b69c2d03293d07c977eefdc6995323cb802b --- .../current/android/hardware/gnss/IGnss.aidl | 1 + .../gnss/IGnssNavigationMessageCallback.aidl | 68 +++++ .../gnss/IGnssNavigationMessageInterface.aidl | 39 +++ gnss/aidl/android/hardware/gnss/IGnss.aidl | 8 + .../gnss/IGnssNavigationMessageCallback.aidl | 240 ++++++++++++++++++ .../gnss/IGnssNavigationMessageInterface.aidl | 46 ++++ gnss/aidl/default/Android.bp | 1 + gnss/aidl/default/Gnss.cpp | 9 + gnss/aidl/default/Gnss.h | 2 + .../GnssNavigationMessageInterface.cpp | 94 +++++++ .../default/GnssNavigationMessageInterface.h | 48 ++++ gnss/aidl/vts/Android.bp | 1 + .../vts/GnssNavigationMessageCallback.cpp | 28 ++ gnss/aidl/vts/GnssNavigationMessageCallback.h | 31 +++ gnss/aidl/vts/gnss_hal_test_cases.cpp | 13 + .../utils/default/include/v2_1/GnssTemplate.h | 2 +- 16 files changed, 630 insertions(+), 1 deletion(-) create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageInterface.aidl create mode 100644 gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl create mode 100644 gnss/aidl/android/hardware/gnss/IGnssNavigationMessageInterface.aidl create mode 100644 gnss/aidl/default/GnssNavigationMessageInterface.cpp create mode 100644 gnss/aidl/default/GnssNavigationMessageInterface.h create mode 100644 gnss/aidl/vts/GnssNavigationMessageCallback.cpp create mode 100644 gnss/aidl/vts/GnssNavigationMessageCallback.h 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 a3cd8ae553..9bd04a0eeb 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 @@ -42,6 +42,7 @@ interface IGnss { android.hardware.gnss.IGnssPowerIndication getExtensionGnssPowerIndication(); @nullable android.hardware.gnss.IGnssBatching getExtensionGnssBatching(); @nullable android.hardware.gnss.IGnssGeofence getExtensionGnssGeofence(); + @nullable android.hardware.gnss.IGnssNavigationMessageInterface getExtensionGnssNavigationMessage(); const int ERROR_INVALID_ARGUMENT = 1; const int ERROR_ALREADY_INIT = 2; const int ERROR_GENERIC = 3; 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 new file mode 100644 index 0000000000..d513c15a85 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl @@ -0,0 +1,68 @@ +/* + * 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 -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.gnss; +@VintfStability +interface IGnssNavigationMessageCallback { + void gnssNavigationMessageCb(in android.hardware.gnss.IGnssNavigationMessageCallback.GnssNavigationMessage message); + @VintfStability + parcelable GnssNavigationMessage { + int svid; + android.hardware.gnss.IGnssNavigationMessageCallback.GnssNavigationMessage.GnssNavigationMessageType type; + int status; + int messageId; + int submessageId; + byte[] data; + const int STATUS_PARITY_PASSED = 1; + const int STATUS_PARITY_REBUILT = 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, + } + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageInterface.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageInterface.aidl new file mode 100644 index 0000000000..196e9b9334 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageInterface.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 -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.gnss; +@VintfStability +interface IGnssNavigationMessageInterface { + void setCallback(in android.hardware.gnss.IGnssNavigationMessageCallback callback); + void close(); +} diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl index e019d3597a..42cc496e7d 100644 --- a/gnss/aidl/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl @@ -21,6 +21,7 @@ import android.hardware.gnss.IGnssCallback; import android.hardware.gnss.IGnssConfiguration; import android.hardware.gnss.IGnssGeofence; import android.hardware.gnss.IGnssMeasurementInterface; +import android.hardware.gnss.IGnssNavigationMessageInterface; import android.hardware.gnss.IGnssPowerIndication; import android.hardware.gnss.IGnssPsds; @@ -118,4 +119,11 @@ interface IGnss { * @return Handle to the IGnssGeofence interface. */ @nullable IGnssGeofence getExtensionGnssGeofence(); + + /** + * This method returns the IGnssNavigationMessageInterface. + * + * @return Handle to the IGnssNavigationMessageInterface. + */ + @nullable IGnssNavigationMessageInterface getExtensionGnssNavigationMessage(); } diff --git a/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl new file mode 100644 index 0000000000..0fdfaf81b2 --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl @@ -0,0 +1,240 @@ +/* + * 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. + */ + +package android.hardware.gnss; + +/** Represents a GNSS navigation message (or a fragment of it). */ +@VintfStability +interface IGnssNavigationMessageCallback { + /** + * Represents a reading of GNSS measurements. For devices launched in Android Q or newer, it is + * mandatory that these be provided, on request, when the GNSS receiver is searching/tracking + * signals. + * + * - Reporting of GNSS constellation measurements is mandatory. + * - Reporting of all tracked constellations are encouraged. + */ + @VintfStability + parcelable GnssNavigationMessage { + /** + * Status of Navigation Message + * + * When a message is received properly without any parity error in its + * navigation words, the status must be set to PARITY_PASSED. + * + * If a message is received with words that failed a parity check, but the GNSS + * receiver has corrected those words, the status must be set to PARITY_REBUILT. + * + * Do not send any navigation message that contains words with parity errors + * that cannot be corrected. + */ + const int STATUS_PARITY_PASSED = (1 << 0); + const int STATUS_PARITY_REBUILT = (1 << 1); + const int STATUS_UNKNOWN = 0; + + /** + * Enumeration of available values to indicate the GNSS Navigation message + * types. + * + * For convenience, first byte is the GnssConstellationType on which that signal + * is typically transmitted. + */ + @VintfStability + @Backing(type="int") + enum GnssNavigationMessageType { + UNKNOWN = 0, + + /** GPS L1 C/A message contained in the structure. */ + GPS_L1CA = 0x0101, + + /** GPS L2-CNAV message contained in the structure. */ + GPS_L2CNAV = 0x0102, + + /** GPS L5-CNAV message contained in the structure. */ + GPS_L5CNAV = 0x0103, + + /* SBAS message contained in the structure. */ + SBS = 0x0201, + + /** GPS CNAV-2 message contained in the structure. */ + GPS_CNAV2 = 0x0104, + + /** Glonass L1 CA message contained in the structure. */ + GLO_L1CA = 0x0301, + + /** QZSS L1 C/A message contained in the structure. */ + QZS_L1CA = 0x0401, + + /** Beidou D1 message contained in the structure. */ + BDS_D1 = 0x0501, + + /** Beidou D2 message contained in the structure. */ + BDS_D2 = 0x0502, + + /** Beidou CNAV1 message contained in the structure. */ + BDS_CNAV1 = 0x0503, + + /** Beidou CNAV2 message contained in the structure. */ + BDS_CNAV2 = 0x0504, + + /** Galileo I/NAV message contained in the structure. */ + GAL_I = 0x0601, + + /** Galileo F/NAV message contained in the structure. */ + GAL_F = 0x0602, + + /** IRNSS L5 C/A message contained in the structure. */ + IRN_L5CA = 0x0701, + } + + /** + * Satellite vehicle ID number, as defined in GnssSvInfo::svid + * + * This is a mandatory value. + */ + int svid; + + /** + * The type of message contained in the structure. + * + * This is a mandatory value. + */ + GnssNavigationMessageType type; + + /** + * The status of the received navigation message. + * + * It is a bitfield of constants with prefix "STATUS_" defined in this structure. + * + * No need to send any navigation message that contains words with parity + * errors that cannot be corrected. + */ + int status; + + /** + * Message identifier. It provides an index so the complete Navigation + * Message can be assembled. + * + * - For GNSS L1 C/A subframe 4 and 5, this value corresponds to the 'frame + * id' of the navigation message, in the range of 1-25 (Subframe 1, 2, 3 + * does not contain a 'frame id' and this value can be set to -1.) + * + * - For Glonass L1 C/A, this refers to the frame ID, in the range of 1-5. + * + * - For BeiDou D1, this refers to the frame number in the range of 1-24 + * + * - For Beidou D2, this refers to the frame number, in the range of 1-120 + * + * - For Galileo F/NAV nominal frame structure, this refers to the subframe + * number, in the range of 1-12 + * + * - For Galileo I/NAV nominal frame structure, this refers to the subframe + * number in the range of 1-24 + * + * - For SBAS and Beidou CNAV2, this is unused and can be set to -1. + * + * - For QZSS L1 C/A subframe 4 and 5, this value corresponds to the 'frame id' of the + * navigation message, in the range of 1-25. (Subframe 1, 2, 3 does not contain a 'frame + * id' and this value can be set to -1.) + * + * - 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 + * 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; + + /** + * Sub-message identifier. If required by the message 'type', this value contains a + * sub-index within the current message (or frame) that is being transmitted. + * + * - For GNSS L1 C/A, BeiDou D1 & BeiDou D2, the submessage id corresponds to the subframe + * number of the navigation message, in the range of 1-5. + * + * - For Glonass L1 C/A, this refers to the String number, in the range from 1-15. + * + * - For Galileo F/NAV, this refers to the page type in the range 1-6. + * + * - For Galileo I/NAV, this refers to the word type in the range 0-10+. A value of 0 is + * only allowed if the Satellite is transmiting a Spare Word. + * + * - For Galileo in particular, the type information embedded within the data bits may be + * even more useful in interpretation, than the nominal page and word types provided in + * this field. + * + * - For SBAS, the submessage id corresponds to the message type, in the range 1-63. + * + * - For Beidou CNAV1, the submessage id corresponds to the subframe number of the + * navigation message, in the range of 1-3. + * + * - 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. + */ + int submessageId; + + /** + * 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 + * 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. + * The standard followed is 1995 SPS Signal specification. + * + * - For Glonass L1 C/A, each string contains 85 data bits, including the + * checksum. These bits must fit into 11 bytes, with MSB first (skip + * B86-B88), covering a time period of 2 seconds. + * The standard followed is Glonass Interface Control Document Edition 5.1. + * + * - For Galileo F/NAV, each word consists of 238-bit (sync & tail symbols + * excluded). Each word must fit into 30-bytes, with MSB first (skip + * B239, B240), covering a time period of 10 seconds. The standard + * followed is European GNSS(Galileo) Signal in Space Interface + * Control Document Issue 1.2. + * + * - For Galileo I/NAV, each page contains 2 page parts, even and odd, with + * a total of 2x114 = 228 bits, (sync & tail excluded) that must fit + * into 29 bytes, with MSB first (skip B229-B232). The standard followed + * is same as above. + * + * - For SBAS, each block consists of 250 data bits, that should be fit into 32 bytes. MSB + * first (skip B251-B256). + * + * - For Beidou CNAV1, subframe #1 consists of 14 data bits, that should be fit into 2 + * bytes. MSB first (skip B15-B16). subframe #2 consists of 600 bits that should be fit + * into 75 bytes. subframe #3 consists of 264 data bits that should be fit into 33 bytes. + * + * - For Beidou CNAV2, each subframe consists of 288 data bits, that should be fit into 36 + * bytes. + * + * 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.) + */ + byte[] data; + } + + /** + * The callback to report an available fragment of a GNSS navigation messages + * from the HAL. + * + * @param message - The GNSS navigation submessage/subframe representation. + */ + void gnssNavigationMessageCb(in GnssNavigationMessage message); +} diff --git a/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageInterface.aidl b/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageInterface.aidl new file mode 100644 index 0000000000..e2f57c3582 --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageInterface.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ + +package android.hardware.gnss; + +import android.hardware.gnss.IGnssNavigationMessageCallback; + +/** + * Extended interface for GNSS navigation message reporting support. + */ +@VintfStability +interface IGnssNavigationMessageInterface { + /** + * Initializes the interface and registers the callback routines with the HAL. + * + * After a successful call to 'setCallback' the HAL must begin to provide updates as + * they become available. + * + * @param callback handle to IGnssNavigationMessageCallack interface. + */ + void setCallback(in IGnssNavigationMessageCallback callback); + + /** + * Stops updates from the HAL, and unregisters the callback routines. + * + * After a call to close(), the previously registered callbacks must be + * considered invalid by the HAL. + * + * If close() is invoked without a previous setCallback, this function must perform + * no work. + */ + void close(); +} diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index 29bc5c42d7..b6df8956fc 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -59,6 +59,7 @@ cc_binary { "GnssBatching.cpp", "GnssGeofence.cpp", "GnssHidlHal.cpp", + "GnssNavigationMessageInterface.cpp", "GnssPowerIndication.cpp", "GnssPsds.cpp", "GnssConfiguration.cpp", diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 03d9e31f30..8d58a20754 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -22,6 +22,7 @@ #include "GnssConfiguration.h" #include "GnssGeofence.h" #include "GnssMeasurementInterface.h" +#include "GnssNavigationMessageInterface.h" #include "GnssPsds.h" namespace aidl::android::hardware::gnss { @@ -104,4 +105,12 @@ ndk::ScopedAStatus Gnss::getExtensionGnssGeofence(std::shared_ptr return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Gnss::getExtensionGnssNavigationMessage( + std::shared_ptr* iGnssNavigationMessage) { + ALOGD("Gnss::getExtensionGnssNavigationMessage"); + + *iGnssNavigationMessage = SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index 8e573b5f2b..128a6c16a4 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -42,6 +42,8 @@ class Gnss : public BnGnss { std::shared_ptr* iGnssBatching) override; ndk::ScopedAStatus getExtensionGnssGeofence( std::shared_ptr* iGnssGeofence) override; + ndk::ScopedAStatus getExtensionGnssNavigationMessage( + std::shared_ptr* iGnssNavigationMessage) override; std::shared_ptr mGnssConfiguration; std::shared_ptr mGnssPowerIndication; diff --git a/gnss/aidl/default/GnssNavigationMessageInterface.cpp b/gnss/aidl/default/GnssNavigationMessageInterface.cpp new file mode 100644 index 0000000000..4bc859d35f --- /dev/null +++ b/gnss/aidl/default/GnssNavigationMessageInterface.cpp @@ -0,0 +1,94 @@ +/* + * 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. + */ + +#define LOG_TAG "GnssNavigationMessageAidl" + +#include "GnssNavigationMessageInterface.h" +#include +#include +#include "Utils.h" + +namespace aidl::android::hardware::gnss { + +using namespace ::android::hardware::gnss; +using GnssNavigationMessage = IGnssNavigationMessageCallback::GnssNavigationMessage; +using GnssNavigationMessageType = GnssNavigationMessage::GnssNavigationMessageType; + +std::shared_ptr GnssNavigationMessageInterface::sCallback = nullptr; + +GnssNavigationMessageInterface::GnssNavigationMessageInterface() : mMinIntervalMillis(1000) {} + +GnssNavigationMessageInterface::~GnssNavigationMessageInterface() { + stop(); +} + +ndk::ScopedAStatus GnssNavigationMessageInterface::setCallback( + const std::shared_ptr& callback) { + ALOGD("setCallback"); + std::unique_lock lock(mMutex); + sCallback = callback; + start(); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus GnssNavigationMessageInterface::close() { + ALOGD("close"); + stop(); + std::unique_lock lock(mMutex); + sCallback = nullptr; + return ndk::ScopedAStatus::ok(); +} + +void GnssNavigationMessageInterface::start() { + ALOGD("start"); + mIsActive = true; + mThread = std::thread([this]() { + while (mIsActive == true) { + GnssNavigationMessage message = { + .svid = 19, + .type = GnssNavigationMessageType::GPS_L1CA, + .status = GnssNavigationMessage::STATUS_PARITY_PASSED, + .messageId = 2, + .submessageId = 3, + .data = std::vector(40, 0xF9), + }; + this->reportMessage(message); + std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMillis)); + } + }); + mThread.detach(); +} + +void GnssNavigationMessageInterface::stop() { + ALOGD("stop"); + mIsActive = false; +} + +void GnssNavigationMessageInterface::reportMessage(const GnssNavigationMessage& message) { + ALOGD("reportMessage()"); + std::shared_ptr callbackCopy; + { + std::unique_lock lock(mMutex); + if (sCallback == nullptr) { + ALOGE("%s: GnssNavigationMessageInterface::sCallback is null.", __func__); + return; + } + callbackCopy = sCallback; + } + callbackCopy->gnssNavigationMessageCb(message); +} + +} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/GnssNavigationMessageInterface.h b/gnss/aidl/default/GnssNavigationMessageInterface.h new file mode 100644 index 0000000000..600b23ab0a --- /dev/null +++ b/gnss/aidl/default/GnssNavigationMessageInterface.h @@ -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. + */ + +#pragma once + +#include +#include +#include + +namespace aidl::android::hardware::gnss { + +struct GnssNavigationMessageInterface : public BnGnssNavigationMessageInterface { + public: + GnssNavigationMessageInterface(); + ~GnssNavigationMessageInterface(); + ndk::ScopedAStatus setCallback( + const std::shared_ptr& callback) override; + ndk::ScopedAStatus close() override; + + private: + void start(); + void stop(); + void reportMessage(const IGnssNavigationMessageCallback::GnssNavigationMessage& message); + + std::atomic mMinIntervalMillis; + std::atomic mIsActive; + std::thread mThread; + + // Guarded by mMutex + static std::shared_ptr sCallback; + // Synchronization lock for sCallback + mutable std::mutex mMutex; +}; + +} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp index 8582b62dfd..4d81519f6d 100644 --- a/gnss/aidl/vts/Android.bp +++ b/gnss/aidl/vts/Android.bp @@ -34,6 +34,7 @@ cc_test { "GnssCallbackAidl.cpp", "GnssGeofenceCallback.cpp", "GnssMeasurementCallbackAidl.cpp", + "GnssNavigationMessageCallback.cpp", "GnssPowerIndicationCallback.cpp", "VtsHalGnssTargetTest.cpp", ], diff --git a/gnss/aidl/vts/GnssNavigationMessageCallback.cpp b/gnss/aidl/vts/GnssNavigationMessageCallback.cpp new file mode 100644 index 0000000000..cf4a6ebef8 --- /dev/null +++ b/gnss/aidl/vts/GnssNavigationMessageCallback.cpp @@ -0,0 +1,28 @@ +/* + * 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. + */ +#define LOG_TAG "GnssNavMsgCallback" + +#include "GnssNavigationMessageCallback.h" +#include + +android::binder::Status GnssNavigationMessageCallback::gnssNavigationMessageCb( + const android::hardware::gnss::IGnssNavigationMessageCallback::GnssNavigationMessage& msg) { + ALOGD("gnssNavigationMessageCb. svid=%d, type=%d, status=%d, msgId=%d, subMsgId=%d, " + "data.size=%d", + msg.svid, (int)msg.type, (int)msg.status, msg.messageId, msg.submessageId, + (int)msg.data.size()); + return android::binder::Status::ok(); +} diff --git a/gnss/aidl/vts/GnssNavigationMessageCallback.h b/gnss/aidl/vts/GnssNavigationMessageCallback.h new file mode 100644 index 0000000000..55114ca8d1 --- /dev/null +++ b/gnss/aidl/vts/GnssNavigationMessageCallback.h @@ -0,0 +1,31 @@ +/* + * 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 + +/** Implementation for IGnssNavigationMessageCallback. */ +class GnssNavigationMessageCallback + : public android::hardware::gnss::BnGnssNavigationMessageCallback { + public: + GnssNavigationMessageCallback() {} + ~GnssNavigationMessageCallback() {} + + android::binder::Status gnssNavigationMessageCb( + const android::hardware::gnss::IGnssNavigationMessageCallback::GnssNavigationMessage& + message) override; +}; diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 09f94122b2..830922c713 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -25,6 +25,7 @@ #include "GnssBatchingCallback.h" #include "GnssGeofenceCallback.h" #include "GnssMeasurementCallbackAidl.h" +#include "GnssNavigationMessageCallback.h" #include "GnssPowerIndicationCallback.h" #include "gnss_hal_test.h" @@ -43,6 +44,7 @@ using android::hardware::gnss::IGnssGeofence; using android::hardware::gnss::IGnssGeofenceCallback; using android::hardware::gnss::IGnssMeasurementCallback; using android::hardware::gnss::IGnssMeasurementInterface; +using android::hardware::gnss::IGnssNavigationMessageInterface; using android::hardware::gnss::IGnssPowerIndication; using android::hardware::gnss::IGnssPsds; using android::hardware::gnss::PsdsType; @@ -779,4 +781,15 @@ TEST_P(GnssHalTest, TestAllExtensions) { status = iGnssGeofence->setCallback(gnssGeofenceCallback); ASSERT_TRUE(status.isOk()); } + + sp iGnssNavMsgIface; + status = aidl_gnss_hal_->getExtensionGnssNavigationMessage(&iGnssNavMsgIface); + if (status.isOk() && iGnssNavMsgIface != nullptr) { + auto gnssNavMsgCallback = sp::make(); + status = iGnssNavMsgIface->setCallback(gnssNavMsgCallback); + ASSERT_TRUE(status.isOk()); + + status = iGnssNavMsgIface->close(); + ASSERT_TRUE(status.isOk()); + } } diff --git a/gnss/common/utils/default/include/v2_1/GnssTemplate.h b/gnss/common/utils/default/include/v2_1/GnssTemplate.h index 19b1b453b3..c5a186b7ab 100644 --- a/gnss/common/utils/default/include/v2_1/GnssTemplate.h +++ b/gnss/common/utils/default/include/v2_1/GnssTemplate.h @@ -523,7 +523,7 @@ Return GnssTemplate::setCallback_2_1(const spgnssSetCapabilitiesCb_2_1(capabilities); if (!ret.isOk()) { ALOGE("%s: Unable to invoke callback", __func__); -- GitLab From ece0bc399c7df3eeab48ed41d02a9aa29ae1f6b6 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Tue, 23 Nov 2021 13:26:43 -0800 Subject: [PATCH 290/825] Link in libshaders into composer VTS Bug: 200309590 Test: builds Change-Id: I71df8b0ea3b5df2ba09861bb3cd11645595f09bc --- graphics/composer/2.2/utils/vts/Android.bp | 1 + graphics/composer/2.2/vts/functional/Android.bp | 1 + 2 files changed, 2 insertions(+) diff --git a/graphics/composer/2.2/utils/vts/Android.bp b/graphics/composer/2.2/utils/vts/Android.bp index 51295a647d..4faf84bcdd 100644 --- a/graphics/composer/2.2/utils/vts/Android.bp +++ b/graphics/composer/2.2/utils/vts/Android.bp @@ -43,6 +43,7 @@ cc_library_static { "libmath", "libnativewindow", "librenderengine", + "libshaders", "libtonemap", "android.hardware.graphics.mapper@3.0", "android.hardware.graphics.mapper@3.0-vts", diff --git a/graphics/composer/2.2/vts/functional/Android.bp b/graphics/composer/2.2/vts/functional/Android.bp index 79ed368ab3..1e0a329cae 100644 --- a/graphics/composer/2.2/vts/functional/Android.bp +++ b/graphics/composer/2.2/vts/functional/Android.bp @@ -67,6 +67,7 @@ cc_test { "android.hardware.graphics.mapper@4.0-vts", "libgtest", "librenderengine", + "libshaders", "libtonemap", ], header_libs: [ -- GitLab From 6e6a0b04fdeaa0a134e245d3baab9d1395ac6ed2 Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Mon, 29 Nov 2021 14:53:17 +0100 Subject: [PATCH 291/825] fix mFilterEvents locking mFilterEventsLock was not always being held when mFilterEvents is modified. Test: atest VtsHalTvTunerTargetTest Bug: 183057734 Change-Id: I5b6bdb3bb8674d6da89665182ce1694f04dc64b2 --- tv/tuner/aidl/default/Filter.cpp | 38 +++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp index 5f61c8d82a..f6436cd9de 100644 --- a/tv/tuner/aidl/default/Filter.cpp +++ b/tv/tuner/aidl/default/Filter.cpp @@ -542,7 +542,9 @@ void Filter::filterThreadLoop() { // 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) { + std::unique_lock lock(mFilterEventsLock); if (mFilterEvents.size() == 0) { + lock.unlock(); if (DEBUG_FILTER) { ALOGD("[Filter] wait for filter data output."); } @@ -559,6 +561,7 @@ void Filter::filterThreadLoop() { mConfigured = false; } + // lock is still being held for (auto&& event : mFilterEvents) { mCallbackScheduler.onFilterEvent(std::move(event)); } @@ -741,7 +744,6 @@ void Filter::updateRecordOutput(vector& data) { } ::ndk::ScopedAStatus Filter::startPesFilterHandler() { - std::lock_guard lock(mFilterEventsLock); if (mFilterOutput.empty()) { return ::ndk::ScopedAStatus::ok(); } @@ -796,7 +798,11 @@ void Filter::updateRecordOutput(vector& data) { ALOGD("[Filter] assembled pes data length %d", pesEvent.dataLength); } - mFilterEvents.push_back(DemuxFilterEvent::make(pesEvent)); + { + std::lock_guard lock(mFilterEventsLock); + mFilterEvents.push_back(DemuxFilterEvent::make(pesEvent)); + } + mPesOutput.clear(); } @@ -811,7 +817,6 @@ void Filter::updateRecordOutput(vector& data) { } ::ndk::ScopedAStatus Filter::startMediaFilterHandler() { - std::lock_guard lock(mFilterEventsLock); if (mFilterOutput.empty()) { return ::ndk::ScopedAStatus::ok(); } @@ -900,7 +905,12 @@ void Filter::updateRecordOutput(vector& data) { .firstMbInSlice = 0, // random address }; - mFilterEvents.push_back(DemuxFilterEvent::make(recordEvent)); + { + std::lock_guard lock(mFilterEventsLock); + mFilterEvents.push_back( + DemuxFilterEvent::make(recordEvent)); + } + mRecordFilterOutput.clear(); return ::ndk::ScopedAStatus::ok(); } @@ -918,7 +928,6 @@ void Filter::updateRecordOutput(vector& data) { bool Filter::writeSectionsAndCreateEvent(vector& data) { // TODO check how many sections has been read ALOGD("[Filter] section handler"); - std::lock_guard lock(mFilterEventsLock); if (!writeDataToFilterMQ(data)) { return false; } @@ -930,7 +939,12 @@ bool Filter::writeSectionsAndCreateEvent(vector& data) { .sectionNum = 1, .dataLength = static_cast(data.size()), }; - mFilterEvents.push_back(DemuxFilterEvent::make(secEvent)); + + { + std::lock_guard lock(mFilterEventsLock); + mFilterEvents.push_back(DemuxFilterEvent::make(secEvent)); + } + return true; } @@ -1028,7 +1042,11 @@ native_handle_t* Filter::createNativeHandle(int fd) { mediaEvent.pts = mPts; mPts = 0; } - mFilterEvents.push_back(std::move(event)); + + { + std::lock_guard lock(mFilterEventsLock); + mFilterEvents.push_back(std::move(event)); + } // Clear and log native_handle_close(nativeHandle); @@ -1068,7 +1086,11 @@ native_handle_t* Filter::createNativeHandle(int fd) { mediaEvent.pts = mPts; mPts = 0; } - mFilterEvents.push_back(std::move(event)); + + { + std::lock_guard lock(mFilterEventsLock); + mFilterEvents.push_back(std::move(event)); + } mSharedAvMemOffset += output.size(); -- GitLab From 0b85b97213584397490edb85baf0c17eb4c1bab9 Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Mon, 29 Nov 2021 12:53:20 +0100 Subject: [PATCH 292/825] fix filter event creation Change I154eb05bc419f827008161f85a6304a8599dc399 was incomplete and caused some filter events to not be produced anymore. This change fixes that issue and moves to a cleaner (and clearer!) way of creating filter events. Note: Change I154eb05bc419f827008161f85a6304a8599dc399 did not break VTS which is problematic. Test: atest VtsHalTvTunerTargetTest Bug: 183057734 Change-Id: Id018c33c16c07a9dd9de725aea64207008d317b3 --- tv/tuner/aidl/default/Filter.cpp | 73 +++++++++++++------------------- 1 file changed, 29 insertions(+), 44 deletions(-) diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp index f6436cd9de..5e6d001346 100644 --- a/tv/tuner/aidl/default/Filter.cpp +++ b/tv/tuner/aidl/default/Filter.cpp @@ -1114,8 +1114,6 @@ bool Filter::sameFile(int fd1, int fd2) { void Filter::createMediaEvent(vector& events) { AudioExtraMetaData audio; - events.resize(1); - audio.adFade = 1; audio.adPan = 2; audio.versionTextTag = 3; @@ -1123,17 +1121,15 @@ void Filter::createMediaEvent(vector& events) { audio.adGainFront = 5; audio.adGainSurround = 6; - events[0] = DemuxFilterEvent::make(); - events[0].get().streamId = 1; - events[0].get().isPtsPresent = true; - events[0].get().dataLength = 3; - events[0].get().offset = 4; - events[0].get().isSecureMemory = true; - events[0].get().mpuSequenceNumber = 6; - events[0].get().isPesPrivateData = true; - events[0] - .get() - .extraMetaData.set(audio); + DemuxFilterMediaEvent mediaEvent; + mediaEvent.streamId = 1; + mediaEvent.isPtsPresent = true; + mediaEvent.dataLength = 3; + mediaEvent.offset = 4; + mediaEvent.isSecureMemory = true; + mediaEvent.mpuSequenceNumber = 6; + mediaEvent.isPesPrivateData = true; + mediaEvent.extraMetaData.set(audio); int av_fd = createAvIonFd(BUFFER_SIZE_16M); if (av_fd == -1) { @@ -1151,16 +1147,16 @@ void Filter::createMediaEvent(vector& events) { uint64_t dataId = mLastUsedDataId++ /*createdUID*/; mDataId2Avfd[dataId] = dup(av_fd); - events[0].get().avDataId = static_cast(dataId); - events[0].get().avMemory = ::android::dupToAidl(nativeHandle); + mediaEvent.avDataId = static_cast(dataId); + mediaEvent.avMemory = ::android::dupToAidl(nativeHandle); + + events.push_back(DemuxFilterEvent::make(std::move(mediaEvent))); native_handle_close(nativeHandle); native_handle_delete(nativeHandle); } void Filter::createTsRecordEvent(vector& events) { - events.resize(2); - DemuxPid pid; DemuxFilterScIndexMask mask; DemuxFilterTsRecordEvent tsRecord1; @@ -1175,13 +1171,11 @@ void Filter::createTsRecordEvent(vector& events) { tsRecord2.pts = 1; tsRecord2.firstMbInSlice = 2; // random address - events[0].set(tsRecord1); - events[1].set(tsRecord2); + events.push_back(DemuxFilterEvent::make(std::move(tsRecord1))); + events.push_back(DemuxFilterEvent::make(std::move(tsRecord2))); } void Filter::createMmtpRecordEvent(vector& events) { - events.resize(2); - DemuxFilterMmtpRecordEvent mmtpRecord1; mmtpRecord1.scHevcIndexMask = 1; mmtpRecord1.byteNumber = 2; @@ -1192,36 +1186,32 @@ void Filter::createMmtpRecordEvent(vector& events) { mmtpRecord2.firstMbInSlice = 3; mmtpRecord2.tsIndexMask = 4; - events[0].set(mmtpRecord1); - events[1].set(mmtpRecord2); + events.push_back( + DemuxFilterEvent::make(std::move(mmtpRecord1))); + events.push_back( + DemuxFilterEvent::make(std::move(mmtpRecord2))); } void Filter::createSectionEvent(vector& events) { - events.resize(1); - DemuxFilterSectionEvent section; section.tableId = 1; section.version = 2; section.sectionNum = 3; section.dataLength = 0; - events[0].set(section); + events.push_back(DemuxFilterEvent::make(std::move(section))); } void Filter::createPesEvent(vector& events) { - events.resize(1); - DemuxFilterPesEvent pes; pes.streamId = 1; pes.dataLength = 1; pes.mpuSequenceNumber = 2; - events[0].set(pes); + events.push_back(DemuxFilterEvent::make(std::move(pes))); } void Filter::createDownloadEvent(vector& events) { - events.resize(1); - DemuxFilterDownloadEvent download; download.itemId = 1; download.mpuSequenceNumber = 2; @@ -1229,41 +1219,36 @@ void Filter::createDownloadEvent(vector& events) { download.lastItemFragmentIndex = 4; download.dataLength = 0; - events[0].set(download); + events.push_back(DemuxFilterEvent::make(std::move(download))); } void Filter::createIpPayloadEvent(vector& events) { - events.resize(1); - DemuxFilterIpPayloadEvent ipPayload; ipPayload.dataLength = 0; - events[0].set(ipPayload); + events.push_back( + DemuxFilterEvent::make(std::move(ipPayload))); } void Filter::createTemiEvent(vector& events) { - events.resize(1); - DemuxFilterTemiEvent temi; temi.pts = 1; temi.descrTag = 2; temi.descrData = {3}; - events[0].set(temi); + events.push_back(DemuxFilterEvent::make(std::move(temi))); } void Filter::createMonitorEvent(vector& events) { - events.resize(1); - DemuxFilterMonitorEvent monitor; monitor.set(ScramblingStatus::SCRAMBLED); - events[0].set(monitor); + + events.push_back( + DemuxFilterEvent::make(std::move(monitor))); } void Filter::createRestartEvent(vector& events) { - events.resize(1); - - events[0].set(1); + events.push_back(DemuxFilterEvent::make(1)); } } // namespace tuner -- GitLab From 892366fe60043b4a8e2a9bfac95f4d7de231202a Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Thu, 25 Nov 2021 12:06:02 +0100 Subject: [PATCH 293/825] fix tuner filter callback scheduler This fixes multiple issues in filter callback scheduler: - currently, when mDataSizeDelayInBytes is 0, filter events are sent every time onFilterEvent is called. When mTimeDelayInMs is set (to something else than 0), this will falsely override the time delay. - when datasize delay or time delays are updated, the cv needs to be notified so the new delay goes into effect right away. - std::condition_variables *must* make use of a shared variable in order to prevent lost and spurious wakeups. Test: atest VtsHalTvTunerTargetTest Bug: 183057734 Change-Id: I9fb4e87e8ba887f0ce891ccb9981bfa49a3ceada --- tv/tuner/aidl/default/Filter.cpp | 72 +++++++++++++++++++++----------- tv/tuner/aidl/default/Filter.h | 14 ++++--- 2 files changed, 56 insertions(+), 30 deletions(-) diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp index 5e6d001346..54037be492 100644 --- a/tv/tuner/aidl/default/Filter.cpp +++ b/tv/tuner/aidl/default/Filter.cpp @@ -35,7 +35,11 @@ namespace tuner { #define WAIT_TIMEOUT 3000000000 FilterCallbackScheduler::FilterCallbackScheduler(const std::shared_ptr& cb) - : mCallback(cb), mDataLength(0), mTimeDelayInMs(0), mDataSizeDelayInBytes(0) { + : mCallback(cb), + mIsConditionMet(false), + mDataLength(0), + mTimeDelayInMs(0), + mDataSizeDelayInBytes(0) { start(); } @@ -44,12 +48,14 @@ FilterCallbackScheduler::~FilterCallbackScheduler() { } void FilterCallbackScheduler::onFilterEvent(DemuxFilterEvent&& event) { - std::lock_guard lock(mLock); + std::unique_lock lock(mLock); mCallbackBuffer.push_back(std::move(event)); mDataLength += getDemuxFilterEventDataLength(event); - if (mDataLength >= mDataSizeDelayInBytes) { - // size limit has been reached, send out events + if (isDataSizeDelayConditionMetLocked()) { + mIsConditionMet = true; + // unlock, so thread is not immediately blocked when it is notified. + lock.unlock(); mCv.notify_all(); } } @@ -67,21 +73,22 @@ void FilterCallbackScheduler::flushEvents() { } void FilterCallbackScheduler::setTimeDelayHint(int timeDelay) { - // updating the setTimeDelay does not go into effect until the condition - // variable times out or is notified. - // One possibility is to notify the condition variable right away when the - // time delay changes, but I don't see the benefit over waiting for the next - // timeout / push, since -- in any case -- this will not change very often. + std::unique_lock lock(mLock); mTimeDelayInMs = timeDelay; + // always notify condition variable to update timeout + mIsConditionMet = true; + lock.unlock(); + mCv.notify_all(); } void FilterCallbackScheduler::setDataSizeDelayHint(int dataSizeDelay) { - // similar to updating the time delay hint, when mDataSizeDelayInBytes - // changes, this will not go into immediate effect, but will wait until the - // next filterEvent. - // We could technically check the current data length and notify the - // condition variable if we wanted to, but again, this may be overkill. + std::unique_lock lock(mLock); mDataSizeDelayInBytes = dataSizeDelay; + if (isDataSizeDelayConditionMetLocked()) { + mIsConditionMet = true; + lock.unlock(); + mCv.notify_all(); + } } bool FilterCallbackScheduler::hasCallbackRegistered() const { @@ -96,6 +103,10 @@ void FilterCallbackScheduler::start() { void FilterCallbackScheduler::stop() { mIsRunning = false; if (mCallbackThread.joinable()) { + { + std::lock_guard lock(mLock); + mIsConditionMet = true; + } mCv.notify_all(); mCallbackThread.join(); } @@ -109,17 +120,15 @@ void FilterCallbackScheduler::threadLoop() { void FilterCallbackScheduler::threadLoopOnce() { std::unique_lock lock(mLock); - // mTimeDelayInMs is an atomic value, so it should be copied into a local - // variable before use (to make sure both the if statement and wait_for use - // the same value). - int timeDelayInMs = mTimeDelayInMs; - if (timeDelayInMs > 0) { - mCv.wait_for(lock, std::chrono::milliseconds(timeDelayInMs)); + if (mTimeDelayInMs > 0) { + // Note: predicate protects from lost and spurious wakeups + mCv.wait_for(lock, std::chrono::milliseconds(mTimeDelayInMs), + [this] { return mIsConditionMet; }); } else { - // no reason to timeout, just wait until main thread determines it's - // okay to send data. - mCv.wait(lock); + // Note: predicate protects from lost and spurious wakeups + mCv.wait(lock, [this] { return mIsConditionMet; }); } + mIsConditionMet = false; // condition_variable wait locks mutex on timeout / notify // Note: if stop() has been called in the meantime, do not send more filter @@ -131,7 +140,22 @@ void FilterCallbackScheduler::threadLoopOnce() { mCallbackBuffer.clear(); mDataLength = 0; } - lock.unlock(); +} + +// mLock needs to be held to call this function +bool FilterCallbackScheduler::isDataSizeDelayConditionMetLocked() { + if (mDataSizeDelayInBytes == 0) { + // Data size delay is disabled. + if (mTimeDelayInMs == 0) { + // Events should only be sent immediately if time delay is disabled + // as well. + return true; + } + return false; + } + + // Data size delay is enabled. + return mDataLength >= mDataSizeDelayInBytes; } int FilterCallbackScheduler::getDemuxFilterEventDataLength(const DemuxFilterEvent& event) { diff --git a/tv/tuner/aidl/default/Filter.h b/tv/tuner/aidl/default/Filter.h index 7298561d6a..8388c9861f 100644 --- a/tv/tuner/aidl/default/Filter.h +++ b/tv/tuner/aidl/default/Filter.h @@ -77,6 +77,9 @@ class FilterCallbackScheduler final { void threadLoop(); void threadLoopOnce(); + // function needs to be called while holding mLock + bool isDataSizeDelayConditionMetLocked(); + static int getDemuxFilterEventDataLength(const DemuxFilterEvent& event); private: @@ -84,16 +87,15 @@ class FilterCallbackScheduler final { std::thread mCallbackThread; std::atomic mIsRunning; - // mLock protects mCallbackBuffer, mCv, and mDataLength + // mLock protects mCallbackBuffer, mIsConditionMet, mCv, mDataLength, + // mTimeDelayInMs, and mDataSizeDelayInBytes std::mutex mLock; std::vector mCallbackBuffer; + bool mIsConditionMet; std::condition_variable mCv; int mDataLength; - - // both of these need to be atomic (not just mTimeDelayInMs) as this class - // needs to be threadsafe. - std::atomic mTimeDelayInMs; - std::atomic mDataSizeDelayInBytes; + int mTimeDelayInMs; + int mDataSizeDelayInBytes; }; class Filter : public BnFilter { -- GitLab From 0fbd060e51353fe7d1914de34166113392d4b2f4 Mon Sep 17 00:00:00 2001 From: Alice Kuo Date: Mon, 18 Oct 2021 03:35:59 +0800 Subject: [PATCH 294/825] Add new aidl interface for android.hardware.bluetooth.audio Bug: 203490261 Test: m android.hardware.bluetooth.audio-update-api Change-Id: Ida6d664b2c3eedfb4c3abaece7c3540623c72270 --- bluetooth/audio/aidl/Android.bp | 39 ++++++++++ .../bluetooth/audio/AacCapabilities.aidl | 42 +++++++++++ .../bluetooth/audio/AacConfiguration.aidl | 42 +++++++++++ .../bluetooth/audio/AacObjectType.aidl | 41 ++++++++++ .../bluetooth/audio/AptxCapabilities.aidl | 40 ++++++++++ .../bluetooth/audio/AptxConfiguration.aidl | 40 ++++++++++ .../bluetooth/audio/AudioCapabilities.aidl | 40 ++++++++++ .../bluetooth/audio/AudioConfiguration.aidl | 40 ++++++++++ .../bluetooth/audio/AudioLocation.aidl | 40 ++++++++++ .../audio/BroadcastConfiguration.aidl | 44 +++++++++++ .../hardware/bluetooth/audio/ChannelMode.aidl | 40 ++++++++++ .../bluetooth/audio/CodecCapabilities.aidl | 46 ++++++++++++ .../bluetooth/audio/CodecConfiguration.aidl | 49 ++++++++++++ .../hardware/bluetooth/audio/CodecType.aidl | 44 +++++++++++ .../bluetooth/audio/IBluetoothAudioPort.aidl | 42 +++++++++++ .../audio/IBluetoothAudioProvider.aidl | 41 ++++++++++ .../audio/IBluetoothAudioProviderFactory.aidl | 39 ++++++++++ .../bluetooth/audio/Lc3Capabilities.aidl | 42 +++++++++++ .../bluetooth/audio/Lc3Configuration.aidl | 42 +++++++++++ .../bluetooth/audio/LdacCapabilities.aidl | 41 ++++++++++ .../bluetooth/audio/LdacChannelMode.aidl | 41 ++++++++++ .../bluetooth/audio/LdacConfiguration.aidl | 41 ++++++++++ .../bluetooth/audio/LdacQualityIndex.aidl | 41 ++++++++++ .../bluetooth/audio/LeAudioCapabilities.aidl | 51 +++++++++++++ .../audio/LeAudioCodecConfiguration.aidl | 43 +++++++++++ .../bluetooth/audio/LeAudioConfiguration.aidl | 45 +++++++++++ .../hardware/bluetooth/audio/LeAudioMode.aidl | 40 ++++++++++ .../bluetooth/audio/PcmCapabilities.aidl | 41 ++++++++++ .../bluetooth/audio/PcmConfiguration.aidl | 41 ++++++++++ .../bluetooth/audio/PresentationPosition.aidl | 45 +++++++++++ .../bluetooth/audio/SbcAllocMethod.aidl | 39 ++++++++++ .../bluetooth/audio/SbcCapabilities.aidl | 45 +++++++++++ .../bluetooth/audio/SbcChannelMode.aidl | 42 +++++++++++ .../bluetooth/audio/SbcConfiguration.aidl | 45 +++++++++++ .../hardware/bluetooth/audio/SessionType.aidl | 45 +++++++++++ .../bluetooth/audio/UnicastConfiguration.aidl | 45 +++++++++++ .../bluetooth/audio/AacCapabilities.aidl | 34 +++++++++ .../bluetooth/audio/AacConfiguration.aidl | 32 ++++++++ .../bluetooth/audio/AacObjectType.aidl | 38 ++++++++++ .../bluetooth/audio/AptxCapabilities.aidl | 30 ++++++++ .../bluetooth/audio/AptxConfiguration.aidl | 29 ++++++++ .../bluetooth/audio/AudioCapabilities.aidl | 31 ++++++++ .../bluetooth/audio/AudioConfiguration.aidl | 31 ++++++++ .../bluetooth/audio/AudioLocation.aidl | 25 +++++++ .../audio/BroadcastConfiguration.aidl | 39 ++++++++++ .../hardware/bluetooth/audio/ChannelMode.aidl | 25 +++++++ .../bluetooth/audio/CodecCapabilities.aidl | 40 ++++++++++ .../bluetooth/audio/CodecConfiguration.aidl | 57 ++++++++++++++ .../hardware/bluetooth/audio/CodecType.aidl | 29 ++++++++ .../bluetooth/audio/IBluetoothAudioPort.aidl | 73 ++++++++++++++++++ .../audio/IBluetoothAudioProvider.aidl | 74 +++++++++++++++++++ .../audio/IBluetoothAudioProviderFactory.aidl | 65 ++++++++++++++++ .../bluetooth/audio/Lc3Capabilities.aidl | 44 +++++++++++ .../bluetooth/audio/Lc3Configuration.aidl | 44 +++++++++++ .../bluetooth/audio/LdacCapabilities.aidl | 34 +++++++++ .../bluetooth/audio/LdacChannelMode.aidl | 29 ++++++++ .../bluetooth/audio/LdacConfiguration.aidl | 32 ++++++++ .../bluetooth/audio/LdacQualityIndex.aidl | 38 ++++++++++ .../bluetooth/audio/LeAudioCapabilities.aidl | 47 ++++++++++++ .../audio/LeAudioCodecConfiguration.aidl | 29 ++++++++ .../bluetooth/audio/LeAudioConfiguration.aidl | 37 ++++++++++ .../hardware/bluetooth/audio/LeAudioMode.aidl | 25 +++++++ .../bluetooth/audio/PcmCapabilities.aidl | 33 +++++++++ .../bluetooth/audio/PcmConfiguration.aidl | 33 +++++++++ .../bluetooth/audio/PresentationPosition.aidl | 52 +++++++++++++ .../bluetooth/audio/SbcAllocMethod.aidl | 30 ++++++++ .../bluetooth/audio/SbcCapabilities.aidl | 43 +++++++++++ .../bluetooth/audio/SbcChannelMode.aidl | 27 +++++++ .../bluetooth/audio/SbcConfiguration.aidl | 41 ++++++++++ .../hardware/bluetooth/audio/SessionType.aidl | 51 +++++++++++++ .../bluetooth/audio/UnicastConfiguration.aidl | 41 ++++++++++ .../compatibility_matrix.current.xml | 7 ++ 72 files changed, 2893 insertions(+) create mode 100644 bluetooth/audio/aidl/Android.bp create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacObjectType.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AptxCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AptxConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioLocation.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/ChannelMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecType.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Capabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Configuration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacChannelMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcAllocMethod.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcChannelMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastConfiguration.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacCapabilities.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacConfiguration.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacObjectType.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/AptxCapabilities.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/AptxConfiguration.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioCapabilities.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioLocation.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/ChannelMode.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecType.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Capabilities.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Configuration.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacCapabilities.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacChannelMode.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacConfiguration.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioMode.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmConfiguration.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcAllocMethod.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcCapabilities.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcChannelMode.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcConfiguration.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastConfiguration.aidl diff --git a/bluetooth/audio/aidl/Android.bp b/bluetooth/audio/aidl/Android.bp new file mode 100644 index 0000000000..60da877af2 --- /dev/null +++ b/bluetooth/audio/aidl/Android.bp @@ -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. + +aidl_interface { + name: "android.hardware.bluetooth.audio", + vendor_available: true, + srcs: ["android/hardware/bluetooth/audio/*.aidl"], + stability: "vintf", + imports: [ + "android.hardware.common-V2", + "android.hardware.common.fmq-V1", + "android.hardware.audio.common", + ], + backend: { + cpp: { + enabled: false, + }, + java: { + sdk_version: "module_current", + enabled: false, + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacCapabilities.aidl new file mode 100644 index 0000000000..ad44c26f59 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacCapabilities.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable AacCapabilities { + android.hardware.bluetooth.audio.AacObjectType objectType; + int[] sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode channelMode; + boolean variableBitRateSupported; + byte[] bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacConfiguration.aidl new file mode 100644 index 0000000000..6adef6df16 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacConfiguration.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable AacConfiguration { + android.hardware.bluetooth.audio.AacObjectType objectType; + int sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode channelMode; + boolean variableBitRateEnabled; + byte bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacObjectType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacObjectType.aidl new file mode 100644 index 0000000000..c129c66b40 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacObjectType.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 -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.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum AacObjectType { + MPEG2_LC = 1, + MPEG4_LC = 2, + MPEG4_LTP = 4, + MPEG4_SCALABLE = 8, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AptxCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AptxCapabilities.aidl new file mode 100644 index 0000000000..4767b696ec --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AptxCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable AptxCapabilities { + int[] sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode channelMode; + byte[] bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AptxConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AptxConfiguration.aidl new file mode 100644 index 0000000000..91e88b32f3 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AptxConfiguration.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable AptxConfiguration { + int sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode channelMode; + byte bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioCapabilities.aidl new file mode 100644 index 0000000000..20a7731010 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +union AudioCapabilities { + android.hardware.bluetooth.audio.PcmCapabilities pcmCapabilities; + android.hardware.bluetooth.audio.CodecCapabilities codecCapabilities; + android.hardware.bluetooth.audio.LeAudioCapabilities leAudioCapabilities; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl new file mode 100644 index 0000000000..34f7837967 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +union AudioConfiguration { + android.hardware.bluetooth.audio.PcmConfiguration pcmConfig; + android.hardware.bluetooth.audio.CodecConfiguration codecConfig; + android.hardware.bluetooth.audio.LeAudioConfiguration leAudioConfig; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioLocation.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioLocation.aidl new file mode 100644 index 0000000000..319a5e2ad0 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioLocation.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="int") @VintfStability +enum AudioLocation { + UNKNOWN = 1, + FRONT_LEFT = 2, + FRONT_RIGHT = 4, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl new file mode 100644 index 0000000000..b3aa709ddd --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable BroadcastConfiguration { + android.hardware.bluetooth.audio.BroadcastConfiguration.BroadcastStreamMap[] streamMap; + @VintfStability + parcelable BroadcastStreamMap { + char streamHandle; + int audioChannelAllocation; + android.hardware.bluetooth.audio.LeAudioCodecConfiguration leAudioCondecConfig; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/ChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/ChannelMode.aidl new file mode 100644 index 0000000000..3ca93c3e03 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/ChannelMode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum ChannelMode { + UNKNOWN = 1, + MONO = 2, + STEREO = 4, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl new file mode 100644 index 0000000000..b451880e05 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable CodecCapabilities { + android.hardware.bluetooth.audio.CodecType codecType; + android.hardware.bluetooth.audio.CodecCapabilities.Capabilities capabilities; + @VintfStability + union Capabilities { + android.hardware.bluetooth.audio.SbcCapabilities sbcCapabilities; + android.hardware.bluetooth.audio.AacCapabilities aacCapabilities; + android.hardware.bluetooth.audio.LdacCapabilities ldacCapabilities; + android.hardware.bluetooth.audio.AptxCapabilities aptxCapabilities; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl new file mode 100644 index 0000000000..863aee244c --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable CodecConfiguration { + android.hardware.bluetooth.audio.CodecType codecType; + int encodedAudioBitrate; + int peerMtu; + boolean isScmstEnabled; + android.hardware.bluetooth.audio.CodecConfiguration.CodecSpecific config; + @VintfStability + union CodecSpecific { + android.hardware.bluetooth.audio.SbcConfiguration sbcConfig; + android.hardware.bluetooth.audio.AacConfiguration aacConfig; + android.hardware.bluetooth.audio.LdacConfiguration ldacConfig; + android.hardware.bluetooth.audio.AptxConfiguration aptxConfig; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecType.aidl new file mode 100644 index 0000000000..44b434bbd7 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecType.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="int") @VintfStability +enum CodecType { + UNKNOWN = 0, + SBC = 1, + AAC = 2, + APTX = 3, + APTX_HD = 4, + LDAC = 5, + LC3 = 6, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl new file mode 100644 index 0000000000..e389ef3876 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +interface IBluetoothAudioPort { + android.hardware.bluetooth.audio.PresentationPosition getPresentationPosition(); + void startStream(); + void stopStream(); + void suspendStream(); + void updateMetadata(in android.hardware.audio.common.SourceMetadata sourceMetadata); +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl new file mode 100644 index 0000000000..84bcc0c061 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +interface IBluetoothAudioProvider { + void endSession(); + android.hardware.common.fmq.MQDescriptor startSession(in android.hardware.bluetooth.audio.IBluetoothAudioPort hostIf, in android.hardware.bluetooth.audio.AudioConfiguration audioConfig); + void streamStarted(in boolean status); + void streamSuspended(in boolean status); +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl new file mode 100644 index 0000000000..5e33deb856 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +interface IBluetoothAudioProviderFactory { + android.hardware.bluetooth.audio.AudioCapabilities[] getProviderCapabilities(in android.hardware.bluetooth.audio.SessionType sessionType); + android.hardware.bluetooth.audio.IBluetoothAudioProvider openProvider(in android.hardware.bluetooth.audio.SessionType sessionType); +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Capabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Capabilities.aidl new file mode 100644 index 0000000000..3c650da4f7 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Capabilities.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable Lc3Capabilities { + byte[] pcmBitDepth; + int[] samplingFrequencyHz; + int[] frameDurationUs; + int[] octetsPerFrame; + byte[] blocksPerSdu; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Configuration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Configuration.aidl new file mode 100644 index 0000000000..ef77da7023 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Configuration.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable Lc3Configuration { + byte pcmBitDepth; + int samplingFrequencyHz; + int frameDurationUs; + int octetsPerFrame; + byte blocksPerSdu; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacCapabilities.aidl new file mode 100644 index 0000000000..19e041a15c --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacCapabilities.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable LdacCapabilities { + int[] sampleRateHz; + android.hardware.bluetooth.audio.LdacChannelMode channelMode; + android.hardware.bluetooth.audio.LdacQualityIndex qualityIndex; + byte[] bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacChannelMode.aidl new file mode 100644 index 0000000000..a9d6c5e14e --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacChannelMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum LdacChannelMode { + UNKNOWN = 1, + STEREO = 2, + DUAL = 4, + MONO = 8, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacConfiguration.aidl new file mode 100644 index 0000000000..8a3763800b --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacConfiguration.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable LdacConfiguration { + int sampleRateHz; + android.hardware.bluetooth.audio.LdacChannelMode channelMode; + android.hardware.bluetooth.audio.LdacQualityIndex qualityIndex; + byte bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl new file mode 100644 index 0000000000..bc0d97b8b4 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum LdacQualityIndex { + QUALITY_HIGH = 1, + QUALITY_MID = 2, + QUALITY_LOW = 4, + QUALITY_ABR = 8, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl new file mode 100644 index 0000000000..9efafcadeb --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable LeAudioCapabilities { + android.hardware.bluetooth.audio.LeAudioMode mode; + android.hardware.bluetooth.audio.CodecType codecType; + android.hardware.bluetooth.audio.AudioLocation supportedChannel; + int supportedChannelCount; + android.hardware.bluetooth.audio.LeAudioCapabilities.LeaudioCodecCapabilities leaudioCodecCapabilities; + @VintfStability + parcelable VendorCapabilities { + ParcelableHolder extension; + } + @VintfStability + union LeaudioCodecCapabilities { + android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities; + android.hardware.bluetooth.audio.LeAudioCapabilities.VendorCapabilities vendorCapabillities; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl new file mode 100644 index 0000000000..bb3d7e4b1e --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +union LeAudioCodecConfiguration { + android.hardware.bluetooth.audio.Lc3Configuration lc3Config; + android.hardware.bluetooth.audio.LeAudioCodecConfiguration.VendorConfiguration vendorConfig; + @VintfStability + parcelable VendorConfiguration { + ParcelableHolder extension; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl new file mode 100644 index 0000000000..c6cb5cb8f7 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable LeAudioConfiguration { + android.hardware.bluetooth.audio.LeAudioMode mode; + android.hardware.bluetooth.audio.LeAudioConfiguration.LeAuioModeConfig modeConfig; + android.hardware.bluetooth.audio.CodecType codecType; + @VintfStability + union LeAuioModeConfig { + android.hardware.bluetooth.audio.UnicastConfiguration unicastConfig; + android.hardware.bluetooth.audio.BroadcastConfiguration broadcastConfig; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl new file mode 100644 index 0000000000..766f6376c6 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum LeAudioMode { + UNKNOWN = 0, + UNICAST = 1, + BROADCAST = 2, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl new file mode 100644 index 0000000000..0c2f87d599 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable PcmCapabilities { + int[] sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; + byte[] bitsPerSample; + int[] dataIntervalUs; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmConfiguration.aidl new file mode 100644 index 0000000000..93d7805a33 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmConfiguration.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable PcmConfiguration { + int sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode channelMode; + byte bitsPerSample; + int dataIntervalUs; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl new file mode 100644 index 0000000000..810a9a1653 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.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 -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.bluetooth.audio; +@VintfStability +parcelable PresentationPosition { + long remoteDeviceAudioDelayNanos; + long transmittedOctets; + android.hardware.bluetooth.audio.PresentationPosition.TimeSpec transmittedOctetsTimeStamp; + @VintfStability + parcelable TimeSpec { + long tvSec; + long tvNSec; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcAllocMethod.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcAllocMethod.aidl new file mode 100644 index 0000000000..5170f164a3 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcAllocMethod.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum SbcAllocMethod { + ALLOC_MD_S = 1, + ALLOC_MD_L = 2, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcCapabilities.aidl new file mode 100644 index 0000000000..ec3aa0f262 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcCapabilities.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable SbcCapabilities { + int[] sampleRateHz; + android.hardware.bluetooth.audio.SbcChannelMode channelMode; + byte[] blockLength; + byte[] numSubbands; + android.hardware.bluetooth.audio.SbcAllocMethod allocMethod; + byte[] bitsPerSample; + int minBitpool; + int maxBitpool; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcChannelMode.aidl new file mode 100644 index 0000000000..88fca4aac4 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcChannelMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum SbcChannelMode { + UNKNOWN = 1, + JOINT_STEREO = 2, + STEREO = 4, + DUAL = 8, + MONO = 16, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcConfiguration.aidl new file mode 100644 index 0000000000..8eab9c3d96 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcConfiguration.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable SbcConfiguration { + int sampleRateHz; + android.hardware.bluetooth.audio.SbcChannelMode channelMode; + byte blockLength; + byte numSubbands; + android.hardware.bluetooth.audio.SbcAllocMethod allocMethod; + byte bitsPerSample; + int minBitpool; + int maxBitpool; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl new file mode 100644 index 0000000000..900ab318ce --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum SessionType { + UNKNOWN = 0, + A2DP_SOFTWARE_ENCODING_DATAPATH = 1, + A2DP_HARDWARE_OFFLOAD_DATAPATH = 2, + HEARING_AID_SOFTWARE_ENCODING_DATAPATH = 3, + LE_AUDIO_SOFTWARE_ENCODING_DATAPATH = 4, + LE_AUDIO_SOFTWARE_DECODING_DATAPATH = 5, + LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH = 6, + LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH = 7, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastConfiguration.aidl new file mode 100644 index 0000000000..b385763fa6 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastConfiguration.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable UnicastConfiguration { + android.hardware.bluetooth.audio.UnicastConfiguration.UnicastStreamMap[] streamMap; + int peerDelay; + android.hardware.bluetooth.audio.LeAudioCodecConfiguration leAudioCodecConfig; + @VintfStability + parcelable UnicastStreamMap { + char streamHandle; + int audioChannelAllocation; + } +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacCapabilities.aidl new file mode 100644 index 0000000000..43038836aa --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacCapabilities.aidl @@ -0,0 +1,34 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.AacObjectType; +import android.hardware.bluetooth.audio.ChannelMode; + +/** + * Used for Hardware Encoding AAC codec capabilities + */ +@VintfStability +parcelable AacCapabilities { + /* bitfield */ + AacObjectType objectType; + int[] sampleRateHz; + /* bitfield */ + ChannelMode channelMode; + boolean variableBitRateSupported; + byte[] bitsPerSample; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacConfiguration.aidl new file mode 100644 index 0000000000..30338e76d0 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacConfiguration.aidl @@ -0,0 +1,32 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.AacObjectType; +import android.hardware.bluetooth.audio.ChannelMode; + +/** + * Used for Hardware Encoding AAC codec configuration + */ +@VintfStability +parcelable AacConfiguration { + AacObjectType objectType; + int sampleRateHz; + ChannelMode channelMode; + boolean variableBitRateEnabled; + byte bitsPerSample; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacObjectType.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacObjectType.aidl new file mode 100644 index 0000000000..480e422e1c --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacObjectType.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. + */ + +package android.hardware.bluetooth.audio; + +@VintfStability +@Backing(type="byte") +enum AacObjectType { + /** + * MPEG-2 Low Complexity. Support is Mandatory. + */ + MPEG2_LC = 1, + /** + * MPEG-4 Low Complexity. Support is Optional. + */ + MPEG4_LC = 1 << 1, + /** + * MPEG-4 Long Term Prediction. Support is Optional. + */ + MPEG4_LTP = 1 << 2, + /** + * MPEG-4 Scalable. Support is Optional. + */ + MPEG4_SCALABLE = 1 << 3, +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AptxCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AptxCapabilities.aidl new file mode 100644 index 0000000000..6a37fc6a41 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AptxCapabilities.aidl @@ -0,0 +1,30 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.ChannelMode; + +/** + * Used for Hardware Encoding AptX and AptX-HD codec capabilities + */ +@VintfStability +parcelable AptxCapabilities { + int[] sampleRateHz; + /* bitfield */ + ChannelMode channelMode; + byte[] bitsPerSample; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AptxConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AptxConfiguration.aidl new file mode 100644 index 0000000000..83b7b0cc09 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AptxConfiguration.aidl @@ -0,0 +1,29 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.ChannelMode; + +/** + * Used for Hardware Encoding AptX and AptX-HD codec configuration + */ +@VintfStability +parcelable AptxConfiguration { + int sampleRateHz; + ChannelMode channelMode; + byte bitsPerSample; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioCapabilities.aidl new file mode 100644 index 0000000000..6ed44722cc --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioCapabilities.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.CodecCapabilities; +import android.hardware.bluetooth.audio.LeAudioCapabilities; +import android.hardware.bluetooth.audio.PcmCapabilities; + +/** + * Used to specify the capabilities of the different session types + */ +@VintfStability +union AudioCapabilities { + PcmCapabilities pcmCapabilities; + CodecCapabilities codecCapabilities; + LeAudioCapabilities leAudioCapabilities; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl new file mode 100644 index 0000000000..ce515b5611 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl @@ -0,0 +1,31 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.CodecConfiguration; +import android.hardware.bluetooth.audio.LeAudioConfiguration; +import android.hardware.bluetooth.audio.PcmConfiguration; + +/** + * Used to configure either a Hardware or Software Encoding session based on session type + */ +@VintfStability +union AudioConfiguration { + PcmConfiguration pcmConfig; + CodecConfiguration codecConfig; + LeAudioConfiguration leAudioConfig; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioLocation.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioLocation.aidl new file mode 100644 index 0000000000..dedfbf98a6 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioLocation.aidl @@ -0,0 +1,25 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +@VintfStability +@Backing(type="int") +enum AudioLocation { + UNKNOWN = 1, + FRONT_LEFT = 1 << 1, + FRONT_RIGHT = 1 << 2, +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl new file mode 100644 index 0000000000..07d05f1bd7 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.LeAudioCodecConfiguration; + +@VintfStability +parcelable BroadcastConfiguration { + @VintfStability + parcelable BroadcastStreamMap { + /* + * The connection handle used for a unicast or a broadcast group. + * Range: 0x0000 to 0xEFFF + */ + char streamHandle; + /* + * Audio channel allocation is a bit field, each enabled bit means that given audio + * direction, i.e. "left", or "right" is used. Ordering of audio channels comes from the + * least significant bit to the most significant bit. + */ + int audioChannelAllocation; + LeAudioCodecConfiguration leAudioCondecConfig; + } + BroadcastStreamMap[] streamMap; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/ChannelMode.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/ChannelMode.aidl new file mode 100644 index 0000000000..2df879d837 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/ChannelMode.aidl @@ -0,0 +1,25 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +@VintfStability +@Backing(type="byte") +enum ChannelMode { + UNKNOWN = 1, + MONO = 1 << 1, + STEREO = 1 << 2, +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl new file mode 100644 index 0000000000..0eee8cb55b --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.AacCapabilities; +import android.hardware.bluetooth.audio.AptxCapabilities; +import android.hardware.bluetooth.audio.CodecType; +import android.hardware.bluetooth.audio.LdacCapabilities; +import android.hardware.bluetooth.audio.SbcCapabilities; + +/** + * Used to specify the capabilities of the codecs supported by Hardware Encoding. + * AptX and AptX-HD both use the AptxCapabilities field. + */ +@VintfStability +parcelable CodecCapabilities { + @VintfStability + union Capabilities { + SbcCapabilities sbcCapabilities; + AacCapabilities aacCapabilities; + LdacCapabilities ldacCapabilities; + AptxCapabilities aptxCapabilities; + } + CodecType codecType; + Capabilities capabilities; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl new file mode 100644 index 0000000000..fac90f065d --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl @@ -0,0 +1,57 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.AacConfiguration; +import android.hardware.bluetooth.audio.AptxConfiguration; +import android.hardware.bluetooth.audio.CodecType; +import android.hardware.bluetooth.audio.LdacConfiguration; +import android.hardware.bluetooth.audio.SbcConfiguration; + +/** + * Used to configure a Hardware Encoding session. + * AptX and AptX-HD both use the AptxConfiguration field. + */ +@VintfStability +parcelable CodecConfiguration { + @VintfStability + union CodecSpecific { + SbcConfiguration sbcConfig; + AacConfiguration aacConfig; + LdacConfiguration ldacConfig; + AptxConfiguration aptxConfig; + } + CodecType codecType; + /** + * The encoded audio bitrate in bits / second. + * 0x00000000 - The audio bitrate is not specified / unused + * 0x00000001 - 0x00FFFFFF - Encoded audio bitrate in bits/second + * 0x01000000 - 0xFFFFFFFF - Reserved + * + * The HAL needs to support all legal bitrates for the selected codec. + */ + int encodedAudioBitrate; + /** + * Peer MTU (in two-octets) + */ + int peerMtu; + /** + * Content protection by SCMS-T + */ + boolean isScmstEnabled; + CodecSpecific config; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecType.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecType.aidl new file mode 100644 index 0000000000..68c60f548e --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecType.aidl @@ -0,0 +1,29 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +@VintfStability +@Backing(type="int") +enum CodecType { + UNKNOWN, + SBC, + AAC, + APTX, + APTX_HD, + LDAC, + LC3, +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl new file mode 100644 index 0000000000..50e3197c48 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl @@ -0,0 +1,73 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.audio.common.SourceMetadata; +import android.hardware.bluetooth.audio.PresentationPosition; + +/** + * HAL interface from the Audio HAL to the Bluetooth stack + * + * The Audio HAL calls methods in this interface to start, suspend, and stop + * an audio stream. These calls return immediately and the results, if any, + * are sent over the IBluetoothAudioProvider interface. + * + * Moreover, the Audio HAL can also get the presentation position of the stream + * and provide stream metadata. + * + */ +@VintfStability +interface IBluetoothAudioPort { + /** + * Get the audio presentation position. + * + * @return the audio presentation position + * + */ + PresentationPosition getPresentationPosition(); + + /** + * This indicates that the caller of this method has opened the data path + * and wants to start an audio stream. The caller must wait for a + * IBluetoothAudioProvider.streamStarted(Status) call. + */ + void startStream(); + + /** + * This indicates that the caller of this method wants to stop the audio + * stream. The data path will be closed after this call. There is no + * callback from the IBluetoothAudioProvider interface even though the + * teardown is asynchronous. + */ + void stopStream(); + + /** + * This indicates that the caller of this method wants to suspend the audio + * stream. The caller must wait for the Bluetooth process to call + * IBluetoothAudioProvider.streamSuspended(Status). The caller still keeps + * the data path open. + */ + void suspendStream(); + + /** + * Called when the metadata of the stream's source has been changed. + * + * @param sourceMetadata Description of the audio that is played by the + * clients. + */ + void updateMetadata(in SourceMetadata sourceMetadata); +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl new file mode 100644 index 0000000000..cebd808f5c --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl @@ -0,0 +1,74 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.AudioConfiguration; +import android.hardware.bluetooth.audio.IBluetoothAudioPort; +import android.hardware.common.fmq.MQDescriptor; +import android.hardware.common.fmq.UnsynchronizedWrite; + +/** + * HAL interface from the Bluetooth stack to the Audio HAL + * + * The Bluetooth stack calls methods in this interface to start and end audio + * sessions and sends callback events to the Audio HAL. + * + */ +@VintfStability +interface IBluetoothAudioProvider { + /** + * Ends the current session and unregisters the IBluetoothAudioPort + * interface. + */ + void endSession(); + + /** + * This method indicates that the Bluetooth stack is ready to stream audio. + * It registers an instance of IBluetoothAudioPort with and provides the + * current negotiated codec to the Audio HAL. After this method is called, + * the Audio HAL can invoke IBluetoothAudioPort.startStream(). + * + * Note: endSession() must be called to unregister this IBluetoothAudioPort + * + * @param hostIf An instance of IBluetoothAudioPort for stream control + * @param audioConfig The audio configuration negotiated with the remote + * device. The PCM parameters are set if software based encoding, + * otherwise the correct codec configuration is used for hardware + * encoding. + * + * @return The fast message queue for audio data from/to this + * provider. Audio data will be in PCM format as specified by the + * audioConfig.pcmConfig parameter. Invalid if streaming is offloaded + * from/to hardware or on failure + */ + MQDescriptor startSession( + in IBluetoothAudioPort hostIf, in AudioConfiguration audioConfig); + + /** + * Callback for IBluetoothAudioPort.startStream() + * + * @param status true for SUCCESS or false for FAILURE + */ + void streamStarted(in boolean status); + + /** + * Callback for IBluetoothAudioPort.suspendStream() + * + * @param status true for SUCCESS or false for FAILURE + */ + void streamSuspended(in boolean status); +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl new file mode 100644 index 0000000000..3cde22ca2c --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl @@ -0,0 +1,65 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.AudioCapabilities; +import android.hardware.bluetooth.audio.IBluetoothAudioProvider; +import android.hardware.bluetooth.audio.SessionType; +/** + * This factory allows a HAL implementation to be split into multiple + * independent providers. + * + * When the Bluetooth stack is ready to create an audio session, it must first + * obtain the IBluetoothAudioProvider for that session type by calling + * openProvider(). + * + */ + +@VintfStability +interface IBluetoothAudioProviderFactory { + /** + * Gets a list of audio capabilities for a session type. + * + * For software encoding, the PCM capabilities are returned. + * For hardware encoding, the supported codecs and their capabilities are + * returned. + * + * @param sessionType The session type (e.g. + * A2DP_SOFTWARE_ENCODING_DATAPATH). + * @return A list containing all the capabilities + * supported by the sesson type. The capabilities is a list of + * available options when configuring the codec for the session. + * For software encoding it is the PCM data rate. + * For hardware encoding it is the list of supported codecs and their + * capabilities. + * If a provider isn't supported, an empty list should be returned. + * Note: Only one entry should exist per codec when using hardware + * encoding. + */ + AudioCapabilities[] getProviderCapabilities(in SessionType sessionType); + + /** + * Opens an audio provider for a session type. To close the provider, it is + * necessary to release references to the returned provider object. + * + * @param sessionType The session type (e.g. + * LE_AUDIO_SOFTWARE_ENCODING_DATAPATH). + * + * @return provider The provider of the specified session type + */ + IBluetoothAudioProvider openProvider(in SessionType sessionType); +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Capabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Capabilities.aidl new file mode 100644 index 0000000000..1aedefd2d5 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Capabilities.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +/** + * Used for Hardware Encoding/Decoding LC3 codec capabilities. + */ +@VintfStability +parcelable Lc3Capabilities { + /* + * PCM is Input for encoder, Output for decoder + */ + byte[] pcmBitDepth; + /* + * codec-specific parameters + */ + int[] samplingFrequencyHz; + /* + * FrameDuration based on microseconds. + */ + int[] frameDurationUs; + /* + * length in octets of a codec frame + */ + int[] octetsPerFrame; + /* + * Number of blocks of codec frames per single SDU (Service Data Unit) + */ + byte[] blocksPerSdu; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Configuration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Configuration.aidl new file mode 100644 index 0000000000..77c04c1b6e --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Configuration.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +/** + * Used for Hardware Encoding/Decoding LC3 codec configuration. + */ +@VintfStability +parcelable Lc3Configuration { + /* + * PCM is Input for encoder, Output for decoder + */ + byte pcmBitDepth; + /* + * codec-specific parameters + */ + int samplingFrequencyHz; + /* + * FrameDuration based on microseconds. + */ + int frameDurationUs; + /* + * length in octets of a codec frame + */ + int octetsPerFrame; + /* + * Number of blocks of codec frames per single SDU (Service Data Unit) + */ + byte blocksPerSdu; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacCapabilities.aidl new file mode 100644 index 0000000000..44cca7e071 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacCapabilities.aidl @@ -0,0 +1,34 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.LdacChannelMode; +import android.hardware.bluetooth.audio.LdacQualityIndex; + +/** + * Used for Hardware Encoding LDAC codec capabilities + * all qualities must be supported. + */ +@VintfStability +parcelable LdacCapabilities { + int[] sampleRateHz; + /* bitfiled */ + LdacChannelMode channelMode; + /* bitfiled */ + LdacQualityIndex qualityIndex; + byte[] bitsPerSample; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacChannelMode.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacChannelMode.aidl new file mode 100644 index 0000000000..3acca32fc2 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacChannelMode.aidl @@ -0,0 +1,29 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +/** + * Channel Mode: 3 bits + */ +@VintfStability +@Backing(type="byte") +enum LdacChannelMode { + UNKNOWN = 1, + STEREO = 1 << 1, + DUAL = 1 << 2, + MONO = 1 << 3, +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacConfiguration.aidl new file mode 100644 index 0000000000..cc03dd0fc1 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacConfiguration.aidl @@ -0,0 +1,32 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.LdacChannelMode; +import android.hardware.bluetooth.audio.LdacQualityIndex; + +/** + * Used for Hardware Encoding LDAC codec configuration + * Only used when configuring the codec. + */ +@VintfStability +parcelable LdacConfiguration { + int sampleRateHz; + LdacChannelMode channelMode; + LdacQualityIndex qualityIndex; + byte bitsPerSample; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl new file mode 100644 index 0000000000..fc532f4298 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +@VintfStability +@Backing(type="byte") +enum LdacQualityIndex { + /** + * 990kbps + */ + QUALITY_HIGH = 1, + /** + * 660kbps + */ + QUALITY_MID = 1 << 1, + /** + * 330kbps + */ + QUALITY_LOW = 1 << 2, + /** + * Adaptive Bit Rate mode + */ + QUALITY_ABR = 1 << 3, +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl new file mode 100644 index 0000000000..ea05820b3e --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.AudioLocation; +import android.hardware.bluetooth.audio.CodecType; +import android.hardware.bluetooth.audio.Lc3Capabilities; +import android.hardware.bluetooth.audio.LeAudioMode; + +/** + * Used to specify the capabilities of the LC3 codecs supported by Hardware Encoding. + */ +@VintfStability +parcelable LeAudioCapabilities { + @VintfStability + parcelable VendorCapabilities { + ParcelableHolder extension; + } + @VintfStability + union LeaudioCodecCapabilities { + Lc3Capabilities lc3Capabilities; + VendorCapabilities vendorCapabillities; + } + LeAudioMode mode; + CodecType codecType; + /* + * This is bitfield, if bit N is set, HW Offloader supports N+1 channels at the same time. + * Example: 0x27 = 0b00100111: One, two, three or six channels supported. + */ + AudioLocation supportedChannel; + int supportedChannelCount; + LeaudioCodecCapabilities leaudioCodecCapabilities; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl new file mode 100644 index 0000000000..421eeb27f2 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl @@ -0,0 +1,29 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.Lc3Configuration; + +@VintfStability +union LeAudioCodecConfiguration { + @VintfStability + parcelable VendorConfiguration { + ParcelableHolder extension; + } + Lc3Configuration lc3Config; + VendorConfiguration vendorConfig; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl new file mode 100644 index 0000000000..a212c9682e --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl @@ -0,0 +1,37 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.BroadcastConfiguration; +import android.hardware.bluetooth.audio.CodecType; +import android.hardware.bluetooth.audio.LeAudioMode; +import android.hardware.bluetooth.audio.UnicastConfiguration; + +@VintfStability +parcelable LeAudioConfiguration { + @VintfStability + union LeAuioModeConfig { + UnicastConfiguration unicastConfig; + BroadcastConfiguration broadcastConfig; + } + /* + * The mode of the LE audio + */ + LeAudioMode mode; + LeAuioModeConfig modeConfig; + CodecType codecType; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioMode.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioMode.aidl new file mode 100644 index 0000000000..2cf019e9ad --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioMode.aidl @@ -0,0 +1,25 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +@VintfStability +@Backing(type="byte") +enum LeAudioMode { + UNKNOWN, + UNICAST, + BROADCAST, +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl new file mode 100644 index 0000000000..776b777f50 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl @@ -0,0 +1,33 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.ChannelMode; + +/** + * Used for Software Encoding audio feed capabilities + */ +@VintfStability +parcelable PcmCapabilities { + int[] sampleRateHz; + ChannelMode[] channelMode; + byte[] bitsPerSample; + /** + * Data interval for data transfer + */ + int[] dataIntervalUs; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmConfiguration.aidl new file mode 100644 index 0000000000..03aa27bb78 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmConfiguration.aidl @@ -0,0 +1,33 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.ChannelMode; + +/** + * Used for Software Encoding audio feed configuration + */ +@VintfStability +parcelable PcmConfiguration { + int sampleRateHz; + ChannelMode channelMode; + byte bitsPerSample; + /** + * Data interval for data transfer + */ + int dataIntervalUs; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl new file mode 100644 index 0000000000..17e746f5ed --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl @@ -0,0 +1,52 @@ +/* + * 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. + */ + +package android.hardware.bluetooth.audio; + +@VintfStability +parcelable PresentationPosition { + @VintfStability + parcelable TimeSpec { + /** + * seconds + */ + long tvSec; + /** + * nanoseconds + */ + long tvNSec; + } + /* + * remoteDeviceAudioDelayNanos the audio delay from when the remote + * device (e.g. headset) receives audio data to when the device plays the + * sound. If the delay is unknown, the value is set to zero. + */ + long remoteDeviceAudioDelayNanos; + /* + * transmittedOctets the number of audio data octets that were sent + * to a remote device. This excludes octets that have been written to the + * data path but have not been sent to the remote device. The count is + * not reset until stopStream() is called. If the software data path is + * unused (e.g. Hardware Offload), the value is set to 0. + */ + long transmittedOctets; + /* + * transmittedOctetsTimeStamp the value of CLOCK_MONOTONIC + * corresponding to transmittedOctets. If the software data path is + * unused (e.g., for Hardware Offload), the value is set to zero. + */ + TimeSpec transmittedOctetsTimeStamp; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcAllocMethod.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcAllocMethod.aidl new file mode 100644 index 0000000000..7047e346dc --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcAllocMethod.aidl @@ -0,0 +1,30 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +@VintfStability +@Backing(type="byte") +enum SbcAllocMethod { + /** + * SNR + */ + ALLOC_MD_S = 1, + /** + * Loudness + */ + ALLOC_MD_L = 1 << 1, +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcCapabilities.aidl new file mode 100644 index 0000000000..cf62ed4e5e --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcCapabilities.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.SbcAllocMethod; +import android.hardware.bluetooth.audio.SbcChannelMode; + +/** + * Used for Hardware Encoding SBC codec capabilities. + */ +@VintfStability +parcelable SbcCapabilities { + int[] sampleRateHz; + /* bitfield */ + SbcChannelMode channelMode; + byte[] blockLength; + byte[] numSubbands; + /* bitfield */ + SbcAllocMethod allocMethod; + byte[] bitsPerSample; + /* + * range from 2 to 250. + */ + int minBitpool; + /* + * range from 2 to 250. + */ + int maxBitpool; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcChannelMode.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcChannelMode.aidl new file mode 100644 index 0000000000..7eb38cd9f7 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcChannelMode.aidl @@ -0,0 +1,27 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +@VintfStability +@Backing(type="byte") +enum SbcChannelMode { + UNKNOWN = 1, + JOINT_STEREO = 1 << 1, + STEREO = 1 << 2, + DUAL = 1 << 3, + MONO = 1 << 4, +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcConfiguration.aidl new file mode 100644 index 0000000000..054d03e94a --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcConfiguration.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.SbcAllocMethod; +import android.hardware.bluetooth.audio.SbcChannelMode; + +/** + * Used for Hardware Encoding SBC codec configuration. + */ +@VintfStability +parcelable SbcConfiguration { + int sampleRateHz; + SbcChannelMode channelMode; + byte blockLength; + byte numSubbands; + SbcAllocMethod allocMethod; + byte bitsPerSample; + /* + * range from 2 to 250. + */ + int minBitpool; + /* + * range from 2 to 250. + */ + int maxBitpool; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl new file mode 100644 index 0000000000..b588869a3d --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +@VintfStability +@Backing(type="byte") +enum SessionType { + UNKNOWN, + /** + * A2DP legacy that AVDTP media is encoded by Bluetooth Stack + */ + A2DP_SOFTWARE_ENCODING_DATAPATH, + /** + * The encoding of AVDTP media is done by HW and there is control only + */ + A2DP_HARDWARE_OFFLOAD_DATAPATH, + /** + * Used when encoded by Bluetooth Stack and streaming to Hearing Aid + */ + HEARING_AID_SOFTWARE_ENCODING_DATAPATH, + /** + * Used when encoded by Bluetooth Stack and streaming to LE Audio device + */ + LE_AUDIO_SOFTWARE_ENCODING_DATAPATH, + /** + * Used when decoded by Bluetooth Stack and streaming to audio framework + */ + LE_AUDIO_SOFTWARE_DECODING_DATAPATH, + /** + * Encoding is done by HW an there is control only + */ + LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH, + /** + * Decoding is done by HW an there is control only + */ + LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH, +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastConfiguration.aidl new file mode 100644 index 0000000000..7be2c5b7bb --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastConfiguration.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.LeAudioCodecConfiguration; + +@VintfStability +parcelable UnicastConfiguration { + @VintfStability + parcelable UnicastStreamMap { + /* + * The connection handle used for a unicast or a broadcast group. + * Range: 0x0000 to 0xEFFF + */ + char streamHandle; + /* + * Audio channel allocation is a bit field, each enabled bit means that given audio + * direction, i.e. "left", or "right" is used. Ordering of audio channels comes from the + * least significant bit to the most significant bit. The valus follows the Bluetooth SIG + * Audio Location assigned number. + */ + int audioChannelAllocation; + } + UnicastStreamMap[] streamMap; + int peerDelay; + LeAudioCodecConfiguration leAudioCodecConfig; +} diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 74d93b39ef..dd5d7c51b7 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -147,6 +147,13 @@ default + + android.hardware.bluetooth.audio + + IBluetoothAudioProviderFactory + default + + android.hardware.boot 1.2 -- GitLab From 770d70876a9ff824ac346c2081db02064d9bf5e6 Mon Sep 17 00:00:00 2001 From: ramindani Date: Tue, 30 Nov 2021 00:36:42 +0000 Subject: [PATCH 295/825] AIDL vts 2.1 test differences in the existing tests. Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 199413815 Change-Id: I4b3c6eadea9d17eabb9c06d098b654cd4d93267b --- .../VtsHalGraphicsComposer3_TargetTest.cpp | 50 ++++++++++++------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 2d23b08a46..449d18063c 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -73,15 +73,14 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { ASSERT_NO_FATAL_FAILURE(mComposer = IComposer::fromBinder(binder)); ASSERT_NE(mComposer, nullptr); ASSERT_NO_FATAL_FAILURE(mComposer->createClient(&mComposerClient)); - mInvalidDisplayId = GetInvalidDisplayId(); mComposerCallback = ::ndk::SharedRefBase::make(); EXPECT_TRUE(mComposerClient->registerCallback(mComposerCallback).isOk()); // assume the first displays are built-in and are never removed mDisplays = waitForDisplays(); - mPrimaryDisplay = mDisplays[0].get(); + ASSERT_NO_FATAL_FAILURE(mInvalidDisplayId = GetInvalidDisplayId()); // explicitly disable vsync for (const auto& display : mDisplays) { @@ -101,7 +100,6 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { EXPECT_EQ(0, mComposerCallback->getInvalidHotplugCount()); EXPECT_EQ(0, mComposerCallback->getInvalidRefreshCount()); EXPECT_EQ(0, mComposerCallback->getInvalidVsyncCount()); - EXPECT_EQ(0, mComposerCallback->getInvalidVsyncCount()); EXPECT_EQ(0, mComposerCallback->getInvalidVsyncPeriodChangeCount()); EXPECT_EQ(0, mComposerCallback->getInvalidSeamlessPossibleCount()); } @@ -120,7 +118,11 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { id--; } - return 0; + // Although 0 could be an invalid display, a return value of 0 + // from GetInvalidDisplayId means all other ids are in use, a condition which + // we are assuming a device will never have + EXPECT_NE(0, id); + return id; } std::vector waitForDisplays() { @@ -816,11 +818,19 @@ TEST_P(GraphicsComposerAidlTest, SetColorMode) { } TEST_P(GraphicsComposerAidlTest, SetColorModeBadDisplay) { - auto const error = mComposerClient->setColorMode(mInvalidDisplayId, ColorMode::NATIVE, - RenderIntent::COLORIMETRIC); + std::vector colorModes; + EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &colorModes).isOk()); + for (auto mode : colorModes) { + std::vector intents; + EXPECT_TRUE(mComposerClient->getRenderIntents(mPrimaryDisplay, mode, &intents).isOk()) + << "failed to get render intents"; + for (auto intent : intents) { + auto const error = mComposerClient->setColorMode(mInvalidDisplayId, mode, intent); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + } + } } TEST_P(GraphicsComposerAidlTest, SetColorModeBadParameter) { @@ -1273,6 +1283,13 @@ TEST_P(GraphicsComposerAidlTest, SetPowerMode) { modes.push_back(PowerMode::ON_SUSPEND); modes.push_back(PowerMode::ON); + bool isDozeSupported; + EXPECT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk()); + if (isDozeSupported) { + modes.push_back(PowerMode::DOZE); + modes.push_back(PowerMode::DOZE_SUSPEND); + } + for (auto mode : modes) { EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); } @@ -1282,47 +1299,46 @@ TEST_P(GraphicsComposerAidlTest, SetPowerModeVariations) { std::vector modes; modes.push_back(PowerMode::OFF); + modes.push_back(PowerMode::ON); modes.push_back(PowerMode::OFF); - for (auto mode : modes) { EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); } + modes.clear(); + modes.push_back(PowerMode::OFF); + modes.push_back(PowerMode::OFF); + for (auto mode : modes) { + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + } modes.clear(); modes.push_back(PowerMode::ON); modes.push_back(PowerMode::ON); - for (auto mode : modes) { EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); } - modes.clear(); modes.push_back(PowerMode::ON_SUSPEND); modes.push_back(PowerMode::ON_SUSPEND); - for (auto mode : modes) { EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); } + modes.clear(); bool isDozeSupported = false; ASSERT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk()); if (isDozeSupported) { - modes.clear(); - modes.push_back(PowerMode::DOZE); modes.push_back(PowerMode::DOZE); - for (auto mode : modes) { EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); } - modes.clear(); modes.push_back(PowerMode::DOZE_SUSPEND); modes.push_back(PowerMode::DOZE_SUSPEND); - for (auto mode : modes) { EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); } -- GitLab From 2740baca707e3dd259a93f1fc29fffc4366a93d9 Mon Sep 17 00:00:00 2001 From: ramindani Date: Wed, 24 Nov 2021 22:58:32 +0000 Subject: [PATCH 296/825] AIDL vts non reader writer 2.1 tests Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 199413815 Change-Id: Ib801b248c83111fafc2c239e1edecd859067c62e --- .../VtsHalGraphicsComposer3_TargetTest.cpp | 166 ++++++++++++++++-- 1 file changed, 152 insertions(+), 14 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 2d23b08a46..4753006aa6 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -524,6 +524,19 @@ TEST_P(GraphicsComposerAidlTest, getDisplayCapabilities) { } } +TEST_P(GraphicsComposerAidlTest, DumpDebugInfo) { + std::string debugInfo; + EXPECT_TRUE(mComposer->dumpDebugInfo(&debugInfo).isOk()); +} + +TEST_P(GraphicsComposerAidlTest, CreateClientSingleton) { + std::shared_ptr composerClient; + const auto error = mComposer->createClient(&composerClient); + + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_NO_RESOURCES, error.getServiceSpecificError()); +} + TEST_P(GraphicsComposerAidlTest, getDisplayVsyncPeriod) { for (VtsDisplay& display : mDisplays) { std::vector configs; @@ -1267,6 +1280,145 @@ TEST_P(GraphicsComposerAidlTest, CreateVirtualDisplay) { EXPECT_TRUE(mComposerClient->destroyVirtualDisplay(virtualDisplay.display).isOk()); } +TEST_P(GraphicsComposerAidlTest, DestroyVirtualDisplayBadDisplay) { + int32_t maxDisplayCount = 0; + EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&maxDisplayCount).isOk()); + if (maxDisplayCount == 0) { + GTEST_SUCCEED() << "no virtual display support"; + return; + } + const auto error = mComposerClient->destroyVirtualDisplay(mInvalidDisplayId); + + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} + +TEST_P(GraphicsComposerAidlTest, CreateLayer) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); + + EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk()); +} + +TEST_P(GraphicsComposerAidlTest, CreateLayerBadDisplay) { + int64_t layer; + const auto error = mComposerClient->createLayer(mInvalidDisplayId, kBufferSlotCount, &layer); + + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} + +TEST_P(GraphicsComposerAidlTest, DestroyLayerBadDisplay) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); + + const auto error = mComposerClient->destroyLayer(mInvalidDisplayId, layer); + + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk()); +} + +TEST_P(GraphicsComposerAidlTest, DestroyLayerBadLayerError) { + // We haven't created any layers yet, so any id should be invalid + const auto error = mComposerClient->destroyLayer(mPrimaryDisplay, 1); + + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_LAYER, error.getServiceSpecificError()); +} + +TEST_P(GraphicsComposerAidlTest, GetActiveConfigBadDisplay) { + int32_t config; + const auto error = mComposerClient->getActiveConfig(mInvalidDisplayId, &config); + + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} + +TEST_P(GraphicsComposerAidlTest, GetDisplayConfig) { + std::vector configs; + EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); +} + +TEST_P(GraphicsComposerAidlTest, GetDisplayConfigBadDisplay) { + std::vector configs; + const auto error = mComposerClient->getDisplayConfigs(mInvalidDisplayId, &configs); + + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} + +TEST_P(GraphicsComposerAidlTest, GetDisplayName) { + std::string displayName; + EXPECT_TRUE(mComposerClient->getDisplayName(mPrimaryDisplay, &displayName).isOk()); +} + +TEST_P(GraphicsComposerAidlTest, SetClientTargetSlotCount) { + EXPECT_TRUE( + mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kBufferSlotCount).isOk()); +} + +TEST_P(GraphicsComposerAidlTest, SetActiveConfig) { + std::vector configs; + EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); + for (auto config : configs) { + EXPECT_TRUE(mComposerClient->setActiveConfig(mPrimaryDisplay, config).isOk()); + int32_t config1; + EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk()); + EXPECT_EQ(config, config1); + } +} + +TEST_P(GraphicsComposerAidlTest, SetActiveConfigPowerCycle) { + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk()); + + std::vector configs; + EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); + for (auto config : configs) { + EXPECT_TRUE(mComposerClient->setActiveConfig(mPrimaryDisplay, config).isOk()); + int32_t config1; + EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk()); + EXPECT_EQ(config, config1); + + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk()); + EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk()); + EXPECT_EQ(config, config1); + } +} + +TEST_P(GraphicsComposerAidlTest, GetDozeSupportBadDisplay) { + bool isDozeSupport; + const auto error = mComposerClient->getDozeSupport(mInvalidDisplayId, &isDozeSupport); + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} + +TEST_P(GraphicsComposerAidlTest, SetPowerModeUnsupported) { + bool isDozeSupported; + mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk(); + if (!isDozeSupported) { + auto error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + + error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE_SUSPEND); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + } +} + +TEST_P(GraphicsComposerAidlTest, SetVsyncEnabled) { + mComposerCallback->setVsyncAllowed(true); + + EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, true).isOk()); + usleep(60 * 1000); + EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, false).isOk()); + + mComposerCallback->setVsyncAllowed(false); +} + TEST_P(GraphicsComposerAidlTest, SetPowerMode) { std::vector modes; modes.push_back(PowerMode::OFF); @@ -1343,20 +1495,6 @@ TEST_P(GraphicsComposerAidlTest, SetPowerModeBadParameter) { ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, SetPowerModeUnsupported) { - bool isDozeSupported = false; - EXPECT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk()); - if (!isDozeSupported) { - auto error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); - - error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE_SUSPEND); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); - } -} - TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrix) { std::vector matrix; EXPECT_TRUE( -- GitLab From 0f4c3218adaa8f89cbd24416783fe7d446e58f95 Mon Sep 17 00:00:00 2001 From: Chris Weir Date: Thu, 16 Sep 2021 19:20:09 -0700 Subject: [PATCH 297/825] Move interceptor AIDL definition Move Netlink Interceptor AIDL definition to hardware/interfaces/wifi Bug: 201467304 Test: atest VtsHalNetlinkInterceptorV1_0Test Change-Id: Ia6b1d29b2f2cb45f91ab985ed64c44fdc6d54602 --- wifi/netlinkinterceptor/aidl/Android.bp | 36 +++++++++ .../net/nlinterceptor/IInterceptor.aidl | 41 ++++++++++ .../net/nlinterceptor/IInterceptor.aidl | 41 ++++++++++ .../net/nlinterceptor/InterceptedSocket.aidl | 39 ++++++++++ .../net/nlinterceptor/IInterceptor.aidl | 78 +++++++++++++++++++ .../net/nlinterceptor/InterceptedSocket.aidl | 33 ++++++++ 6 files changed, 268 insertions(+) create mode 100644 wifi/netlinkinterceptor/aidl/Android.bp create mode 100644 wifi/netlinkinterceptor/aidl/aidl_api/NetlinkInterceptor/current/android/hardware/net/nlinterceptor/IInterceptor.aidl create mode 100644 wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/current/android/hardware/net/nlinterceptor/IInterceptor.aidl create mode 100644 wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/current/android/hardware/net/nlinterceptor/InterceptedSocket.aidl create mode 100644 wifi/netlinkinterceptor/aidl/android/hardware/net/nlinterceptor/IInterceptor.aidl create mode 100644 wifi/netlinkinterceptor/aidl/android/hardware/net/nlinterceptor/InterceptedSocket.aidl diff --git a/wifi/netlinkinterceptor/aidl/Android.bp b/wifi/netlinkinterceptor/aidl/Android.bp new file mode 100644 index 0000000000..924edee384 --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/Android.bp @@ -0,0 +1,36 @@ +// +// 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. +// + +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.net.nlinterceptor", + vendor_available: true, + srcs: ["android/hardware/net/nlinterceptor/*.aidl"], + stability: "vintf", + backend: { + java: { + enabled: false, + }, + }, +} diff --git a/wifi/netlinkinterceptor/aidl/aidl_api/NetlinkInterceptor/current/android/hardware/net/nlinterceptor/IInterceptor.aidl b/wifi/netlinkinterceptor/aidl/aidl_api/NetlinkInterceptor/current/android/hardware/net/nlinterceptor/IInterceptor.aidl new file mode 100644 index 0000000000..249b343e8f --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/aidl_api/NetlinkInterceptor/current/android/hardware/net/nlinterceptor/IInterceptor.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 -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.net.nlinterceptor; +@VintfStability +interface IInterceptor { + int createSocket(in int nlFamily, in int clientNlPid, in String clientName); + void closeSocket(in int nlFamily, in int interceptorNlPid); + void subscribeGroup(in int nlFamily, in int interceptorNlPid, in int nlGroup); + void unsubscribeGroup(in int nlFamily, in int interceptorNlPid, in int nlGroup); +} diff --git a/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/current/android/hardware/net/nlinterceptor/IInterceptor.aidl b/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/current/android/hardware/net/nlinterceptor/IInterceptor.aidl new file mode 100644 index 0000000000..3d0f955371 --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/current/android/hardware/net/nlinterceptor/IInterceptor.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 -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.net.nlinterceptor; +@VintfStability +interface IInterceptor { + android.hardware.net.nlinterceptor.InterceptedSocket createSocket(in int nlFamily, in int clientNlPid, in String clientName); + void closeSocket(in android.hardware.net.nlinterceptor.InterceptedSocket handle); + void subscribeGroup(in android.hardware.net.nlinterceptor.InterceptedSocket handle, in int nlGroup); + void unsubscribeGroup(in android.hardware.net.nlinterceptor.InterceptedSocket handle, in int nlGroup); +} diff --git a/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/current/android/hardware/net/nlinterceptor/InterceptedSocket.aidl b/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/current/android/hardware/net/nlinterceptor/InterceptedSocket.aidl new file mode 100644 index 0000000000..b679be506a --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/current/android/hardware/net/nlinterceptor/InterceptedSocket.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 -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.net.nlinterceptor; +@VintfStability +parcelable InterceptedSocket { + int nlFamily; + int portId; +} diff --git a/wifi/netlinkinterceptor/aidl/android/hardware/net/nlinterceptor/IInterceptor.aidl b/wifi/netlinkinterceptor/aidl/android/hardware/net/nlinterceptor/IInterceptor.aidl new file mode 100644 index 0000000000..c222a1efc8 --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/android/hardware/net/nlinterceptor/IInterceptor.aidl @@ -0,0 +1,78 @@ +/* + * 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. + */ + +package android.hardware.net.nlinterceptor; + +import android.hardware.net.nlinterceptor.InterceptedSocket; + +/** + * Netlink Interceptor + * + * This HAL provides a way for Android services to route their Netlink traffic to a location other + * than the Kernel. One might want to do this for a variety of reasons: + * -> Route Netlink traffic to a different host. + * -> Route Netlink traffic to a different VM. + * -> Convert Netlink commands into proprietary vendor hardware commands. + * + * Some important notes regarding Netlink Interceptor. + * -> All int values are treated as unsigned. + * -> Users of Netlink Interceptor must close their sockets with closeSocket manually. + * -> PID != process ID. In this case, it is "port ID", a unique number assigned by the kernel to a + * given Netlink socket. + * -> Netlink PIDs are only unique per family. This means that for all NETLINK_GENERIC sockets, + * there can only be one socket with PID "1234". HOWEVER, there can ALSO be a Netlink socket + * using NETLINK_ROUTE which has a PID of "1234". Hence, in order to uniquely identify a Netlink + * socket, both the PID and Netlink Family are required. + */ +@VintfStability +interface IInterceptor { + /** + * Creates a Netlink socket on both the HU and TCU, and a bi-directional gRPC stream to carry + * data between them. This must be closed by the caller with closeSocket(). + * + * @param nlFamily - Netlink Family. Support for families other than NETLINK_GENERIC is still + * experimental. + * @param clientNlPid - Port ID of the caller's Netlink socket. + * @param clientName - Human readable name of the caller. Used for debugging. + * + * @return InterceptedSocket identifying the socket on the HU allocated for the caller. + */ + InterceptedSocket createSocket(in int nlFamily, in int clientNlPid, in String clientName); + + /** + * Closes a socket and gRPC stream given the socket's identifier. This must be invoked manually + * by the caller of createSocket(). + * + * @param handle - unique identifier for a socket returned by createSocket. + */ + void closeSocket(in InterceptedSocket handle); + + /** + * Subscribes a socket on the TCU to a Netlink multicast group. + * + * @param handle - unique identifier for a socket returned by createSocket. + * @param nlGroup - A single Netlink multicast group that the caller wants to subscribe to. + */ + void subscribeGroup(in InterceptedSocket handle, in int nlGroup); + + /** + * Unsubscribes a socket on the TCU from a Netlink multicast group. + * + * @param handle - unique identifier for a socket returned by createSocket. + * @param nlGroup - A single Netlink multicast group that the caller wants to unsubscribe from. + */ + void unsubscribeGroup(in InterceptedSocket handle, in int nlGroup); +} diff --git a/wifi/netlinkinterceptor/aidl/android/hardware/net/nlinterceptor/InterceptedSocket.aidl b/wifi/netlinkinterceptor/aidl/android/hardware/net/nlinterceptor/InterceptedSocket.aidl new file mode 100644 index 0000000000..d74a556cf1 --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/android/hardware/net/nlinterceptor/InterceptedSocket.aidl @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package android.hardware.net.nlinterceptor; + +/** + * Unique identifier for a Netlink socket. + */ +@VintfStability +parcelable InterceptedSocket { + /** + * Netlink family of the identified socket + */ + int nlFamily; + + /** + * Netlink port ID of the identified socket. + */ + int portId; +} -- GitLab From 5f9639673b5ca58c251e7440be1ac69150524e81 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Wed, 1 Dec 2021 10:11:14 -0800 Subject: [PATCH 298/825] Match Wi-Fi HAL native code style with rest of HALs. Bug: 201467304 Test: N/A Change-Id: Iba03628fa19598c9f4c7f2bf1156ebe69a46c270 --- wifi/.clang-format | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 wifi/.clang-format diff --git a/wifi/.clang-format b/wifi/.clang-format deleted file mode 100644 index 25ed9323e4..0000000000 --- a/wifi/.clang-format +++ /dev/null @@ -1,2 +0,0 @@ -BasedOnStyle: Google -IndentWidth: 4 \ No newline at end of file -- GitLab From 8136c00c7e05891ec09250f5678d73ea5421be72 Mon Sep 17 00:00:00 2001 From: Shuzhen Wang Date: Wed, 1 Dec 2021 17:56:10 -0800 Subject: [PATCH 299/825] Camera: Update readoutTimeout requirement Due to sensor crop, readoutTimeout - startOfExposure may be larger than exposureTime. Update the VTS test to reflect the spec change. Test: processCaptureRequestPreview Bug: 208270993 Change-Id: I51a373ecbc5c7c086f84c5479a43dffbe8fcc0c2 --- camera/device/3.8/types.hal | 5 +++-- .../VtsHalCameraProviderV2_4TargetTest.cpp | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/camera/device/3.8/types.hal b/camera/device/3.8/types.hal index 6daa0e13b7..843d050bb2 100644 --- a/camera/device/3.8/types.hal +++ b/camera/device/3.8/types.hal @@ -35,8 +35,9 @@ struct ShutterMsg { /** * Timestamp for the capture readout. This must be in the same time domain - * as v3_2.timestamp, and the value must be v3_2.timestamp + exposureTime - * for a rolling shutter sensor. + * as v3_2.timestamp, and for a rolling shutter sensor, the value must be + * v3_2.timestamp + exposureTime + t_crop_top where t_crop_top is the exposure time + * skew of the cropped lines on the top. */ uint64_t readoutTimestamp; }; diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index ff8cd49e26..77974fcbe4 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -4796,15 +4796,24 @@ void CameraHidlTest::processCaptureRequestInternal(uint64_t bufferUsage, ASSERT_EQ(testStream.id, inflightReq.resultOutputBuffers[0].streamId); // For camera device 3.8 or newer, shutterReadoutTimestamp must be - // available, and it must be shutterTimestamp + exposureTime. + // available, and it must be >= shutterTimestamp + exposureTime, and + // < shutterTimestamp + exposureTime + rollingShutterSkew / 2. if (deviceVersion >= CAMERA_DEVICE_API_VERSION_3_8) { ASSERT_TRUE(inflightReq.shutterReadoutTimestampValid); ASSERT_FALSE(inflightReq.collectedResult.isEmpty()); if (inflightReq.collectedResult.exists(ANDROID_SENSOR_EXPOSURE_TIME)) { camera_metadata_entry_t exposureTimeResult = inflightReq.collectedResult.find( ANDROID_SENSOR_EXPOSURE_TIME); - ASSERT_EQ(inflightReq.shutterReadoutTimestamp - inflightReq.shutterTimestamp, - exposureTimeResult.data.i64[0]); + nsecs_t exposureToReadout = + inflightReq.shutterReadoutTimestamp - inflightReq.shutterTimestamp; + ASSERT_GE(exposureToReadout, exposureTimeResult.data.i64[0]); + if (inflightReq.collectedResult.exists(ANDROID_SENSOR_ROLLING_SHUTTER_SKEW)) { + camera_metadata_entry_t rollingShutterSkew = + inflightReq.collectedResult.find( + ANDROID_SENSOR_ROLLING_SHUTTER_SKEW); + ASSERT_LT(exposureToReadout, exposureTimeResult.data.i64[0] + + rollingShutterSkew.data.i64[0] / 2); + } } } -- GitLab From f996b7c87b8192f8dce9882433ad008c37a959cd Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 30 Nov 2021 10:53:29 -0800 Subject: [PATCH 300/825] uwb(hal): Add SET_APP_CONFIG params for interleaving ratio This is defined in the vendor space since it has not been defined in the FIRA standards yet (even though the AOA_RESULT_REQ = 0xF0 has been accepted into the specification). Bug: 205730040 Test: Compiles Change-Id: Ib4106f123a2edf6ed00128985914a5bd932e249e --- .../fira_android/UwbAndroidCapabilities.aidl | 1 + ...UwbVendorSessionSetAppConfigCmdParams.aidl | 3 +++ .../fira_android/UwbAndroidCapabilities.aidl | 2 +- ...UwbVendorSessionSetAppConfigCmdParams.aidl | 22 ++++++++++++++++++- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl index 774133e3df..7e3be56d64 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl @@ -35,4 +35,5 @@ package android.hardware.uwb.fira_android; @Backing(type="long") @VintfStability enum UwbAndroidCapabilities { POWER_STATS_QUERY = 1, + ANTENNAE_INTERLEAVING = 2, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl index 37b7efb321..f449c60212 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl @@ -38,4 +38,7 @@ enum UwbVendorSessionSetAppConfigCmdParams { CCC_UWB_CONFIG_ID = 164, CCC_PULSESHAPE_COMBO = 165, CCC_URSK_TTL = 166, + NB_OF_RANGE_MEASUREMENTS = 227, + NB_OF_AZIMUTH_MEASUREMENTS = 228, + NB_OF_ELEVATION_MEASUREMENTS = 229, } diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl index 3486d5a078..0af99e0f29 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl @@ -26,6 +26,6 @@ package android.hardware.uwb.fira_android; @VintfStability @Backing(type="long") enum UwbAndroidCapabilities { - /** TODO: Change the name if necessary when the corresponding vendor commands are added */ POWER_STATS_QUERY = 0x1, + ANTENNAE_INTERLEAVING = 0x2, } diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl index 850e2da490..f5e02c07c1 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl @@ -29,9 +29,29 @@ package android.hardware.uwb.fira_android; enum UwbVendorSessionSetAppConfigCmdParams { /** CCC params for ranging start */ - /** Added in vendor version 0. */ + /** + * Added in vendor version 0. + * Range 0xA0 - 0xDF reserved for CCC use. + */ CCC_RANGING_PROTOCOL_VER = 0xA3, CCC_UWB_CONFIG_ID = 0xA4, CCC_PULSESHAPE_COMBO = 0xA5, CCC_URSK_TTL = 0xA6, + + /** + * Range 0xE3 - 0xFF is reserved for proprietary use in the FIRA spec. + * In Android, this range is reserved by the Android platform for Android-specific + * app config cmd params. + * Vendors must not define additional app config cmd params in this range. + */ + + /** + * Added in vendor version 0. + * Interleaving ratio if AOA_RESULT_REQ is set to 0xF0. + * Supported only if the value returned by getSupportedAndroidCapabilities() + * has the bit of UwbAndroidCapabilities.ANTENNAE_INTERLEAVING set to 1. + */ + NB_OF_RANGE_MEASUREMENTS = 0xE3, + NB_OF_AZIMUTH_MEASUREMENTS = 0xE4, + NB_OF_ELEVATION_MEASUREMENTS = 0xE5, } -- GitLab From dcfe3a8b963846a6bc0b147e52bb7adafeaefb4c Mon Sep 17 00:00:00 2001 From: ramindani Date: Mon, 29 Nov 2021 17:00:31 +0000 Subject: [PATCH 301/825] AIDL vts 2.1 command tests Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 199413815 Change-Id: I4a49ae5e6110e45e96cd595e916a84d42470a93b --- .../VtsHalGraphicsComposer3_TargetTest.cpp | 2522 ++++++++++------- 1 file changed, 1451 insertions(+), 1071 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 665da7adfc..b9460c82ff 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -40,6 +40,9 @@ namespace { using namespace std::chrono_literals; +using ::android::GraphicBuffer; +using ::android::sp; + class VtsDisplay { public: VtsDisplay(int64_t displayId, int32_t displayWidth, int32_t displayHeight) @@ -82,20 +85,26 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { mPrimaryDisplay = mDisplays[0].get(); ASSERT_NO_FATAL_FAILURE(mInvalidDisplayId = GetInvalidDisplayId()); + int32_t activeConfig; + EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &activeConfig).isOk()); + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(mPrimaryDisplay, activeConfig, + DisplayAttribute::WIDTH, &mDisplayWidth) + .isOk()); + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(mPrimaryDisplay, activeConfig, + DisplayAttribute::HEIGHT, &mDisplayHeight) + .isOk()); + // explicitly disable vsync for (const auto& display : mDisplays) { EXPECT_TRUE(mComposerClient->setVsyncEnabled(display.get(), false).isOk()); } mComposerCallback->setVsyncAllowed(false); - - mWriter = std::make_unique(1024); - mReader = std::make_unique(); } void TearDown() override { - ASSERT_EQ(0, mReader->mErrors.size()); - ASSERT_EQ(0, mReader->mCompositionChanges.size()); - + destroyAllLayers(); if (mComposerCallback != nullptr) { EXPECT_EQ(0, mComposerCallback->getInvalidHotplugCount()); EXPECT_EQ(0, mComposerCallback->getInvalidRefreshCount()); @@ -105,6 +114,79 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { } } + void Test_setContentTypeForDisplay(const int64_t& display, + const std::vector& capabilities, + const ContentType& contentType, const char* contentTypeStr) { + const bool contentTypeSupport = std::find(capabilities.begin(), capabilities.end(), + contentType) != capabilities.end(); + + if (!contentTypeSupport) { + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, + mComposerClient->setContentType(display, contentType) + .getServiceSpecificError()); + GTEST_SUCCEED() << contentTypeStr << " content type is not supported on display " + << std::to_string(display) << ", skipping test"; + return; + } + + EXPECT_TRUE(mComposerClient->setContentType(display, contentType).isOk()); + EXPECT_TRUE(mComposerClient->setContentType(display, ContentType::NONE).isOk()); + } + + void Test_setContentType(const ContentType& contentType, const char* contentTypeStr) { + for (const auto& display : mDisplays) { + std::vector supportedContentTypes; + const auto error = mComposerClient->getSupportedContentTypes(display.get(), + &supportedContentTypes); + EXPECT_TRUE(error.isOk()); + + Test_setContentTypeForDisplay(display.get(), supportedContentTypes, contentType, + contentTypeStr); + } + } + + int64_t createLayer(const VtsDisplay& display) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(display.get(), kBufferSlotCount, &layer).isOk()); + + auto resourceIt = mDisplayResources.find(display.get()); + if (resourceIt == mDisplayResources.end()) { + resourceIt = mDisplayResources.insert({display.get(), DisplayResource(false)}).first; + } + + EXPECT_TRUE(resourceIt->second.layers.insert(layer).second) + << "duplicated layer id " << layer; + + return layer; + } + + void destroyAllLayers() { + for (const auto& it : mDisplayResources) { + auto display = it.first; + const DisplayResource& resource = it.second; + + for (auto layer : resource.layers) { + const auto error = mComposerClient->destroyLayer(display, layer); + EXPECT_TRUE(error.isOk()); + } + + if (resource.isVirtual) { + const auto error = mComposerClient->destroyVirtualDisplay(display); + EXPECT_TRUE(error.isOk()); + } + } + mDisplayResources.clear(); + } + + void destroyLayer(const VtsDisplay& display, int64_t layer) { + auto const error = mComposerClient->destroyLayer(display.get(), layer); + ASSERT_TRUE(error.isOk()) << "failed to destroy layer " << layer; + + auto resourceIt = mDisplayResources.find(display.get()); + ASSERT_NE(mDisplayResources.end(), resourceIt); + resourceIt->second.layers.erase(layer); + } + // returns an invalid display id (one that has not been registered to a // display. Currently assuming that a device will never have close to // std::numeric_limit::max() displays registered while running tests @@ -181,1358 +263,1656 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { return error; } - void Test_setContentTypeForDisplay(const int64_t& display, - const std::vector& capabilities, - const ContentType& contentType, const char* contentTypeStr) { - const bool contentTypeSupport = std::find(capabilities.begin(), capabilities.end(), - contentType) != capabilities.end(); + struct TestParameters { + nsecs_t delayForChange; + bool refreshMiss; + }; - if (!contentTypeSupport) { - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, - mComposerClient->setContentType(display, contentType) - .getServiceSpecificError()); - GTEST_SUCCEED() << contentTypeStr << " content type is not supported on display " - << std::to_string(display) << ", skipping test"; - return; - } + // Keep track of all virtual displays and layers. When a test fails with + // ASSERT_*, the destructor will clean up the resources for the test. + struct DisplayResource { + DisplayResource(bool isVirtual_) : isVirtual(isVirtual_) {} - EXPECT_TRUE(mComposerClient->setContentType(display, contentType).isOk()); - EXPECT_TRUE(mComposerClient->setContentType(display, ContentType::NONE).isOk()); - } + bool isVirtual; + std::unordered_set layers; + }; - void Test_setContentType(const ContentType& contentType, const char* contentTypeStr) { - for (const auto& display : mDisplays) { - std::vector supportedContentTypes; - const auto error = mComposerClient->getSupportedContentTypes(display.get(), - &supportedContentTypes); - EXPECT_TRUE(error.isOk()); + std::shared_ptr mComposer; + std::shared_ptr mComposerClient; + int64_t mInvalidDisplayId; + int64_t mPrimaryDisplay; + std::vector mDisplays; + std::shared_ptr mComposerCallback; + // use the slot count usually set by SF + static constexpr uint32_t kBufferSlotCount = 64; + std::unordered_map mDisplayResources; + int32_t mDisplayWidth; + int32_t mDisplayHeight; +}; - Test_setContentTypeForDisplay(display.get(), supportedContentTypes, contentType, - contentTypeStr); - } +TEST_P(GraphicsComposerAidlTest, getDisplayCapabilitiesBadDisplay) { + std::vector capabilities; + const auto error = mComposerClient->getDisplayCapabilities(mInvalidDisplayId, &capabilities); + + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} + +TEST_P(GraphicsComposerAidlTest, getDisplayCapabilities) { + for (const auto& display : mDisplays) { + std::vector capabilities; + + EXPECT_TRUE(mComposerClient->getDisplayCapabilities(display.get(), &capabilities).isOk()); } +} - void execute() { - TestCommandReader* reader = mReader.get(); - CommandWriterBase* writer = mWriter.get(); - bool queueChanged = false; - int32_t commandLength = 0; - std::vector commandHandles; - ASSERT_TRUE(writer->writeQueue(&queueChanged, &commandLength, &commandHandles)); +TEST_P(GraphicsComposerAidlTest, DumpDebugInfo) { + std::string debugInfo; + EXPECT_TRUE(mComposer->dumpDebugInfo(&debugInfo).isOk()); +} - if (queueChanged) { - auto ret = mComposerClient->setInputCommandQueue(writer->getMQDescriptor()); - ASSERT_TRUE(ret.isOk()); - } +TEST_P(GraphicsComposerAidlTest, CreateClientSingleton) { + std::shared_ptr composerClient; + const auto error = mComposer->createClient(&composerClient); - ExecuteCommandsStatus commandStatus; - EXPECT_TRUE(mComposerClient->executeCommands(commandLength, commandHandles, &commandStatus) - .isOk()); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_NO_RESOURCES, error.getServiceSpecificError()); +} - if (commandStatus.queueChanged) { - MQDescriptor outputCommandQueue; - ASSERT_TRUE(mComposerClient->getOutputCommandQueue(&outputCommandQueue).isOk()); - reader->setMQDescriptor(outputCommandQueue); - } - ASSERT_TRUE(reader->readQueue(commandStatus.length, std::move(commandStatus.handles))); - reader->parse(); - reader->reset(); - writer->reset(); +TEST_P(GraphicsComposerAidlTest, GetDisplayIdentificationData) { + DisplayIdentification displayIdentification0; + + const auto error = + mComposerClient->getDisplayIdentificationData(mPrimaryDisplay, &displayIdentification0); + if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + return; } + ASSERT_TRUE(error.isOk()) << "failed to get display identification data"; + ASSERT_FALSE(displayIdentification0.data.empty()); - ::android::sp<::android::GraphicBuffer> allocate(uint32_t width, uint32_t height) { - ::android::sp<::android::GraphicBuffer> buffer = - ::android::sp<::android::GraphicBuffer>::make( - width, height, ::android::PIXEL_FORMAT_RGBA_8888, - /*layerCount*/ 1, - static_cast( - static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | - static_cast(common::BufferUsage::CPU_READ_OFTEN)), - "VtsHalGraphicsComposer3_TargetTest"); + constexpr size_t kEdidBlockSize = 128; + ASSERT_TRUE(displayIdentification0.data.size() % kEdidBlockSize == 0) + << "EDID blob length is not a multiple of " << kEdidBlockSize; - return buffer; - } + const uint8_t kEdidHeader[] = {0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00}; + ASSERT_TRUE(std::equal(std::begin(kEdidHeader), std::end(kEdidHeader), + displayIdentification0.data.begin())) + << "EDID blob doesn't start with the fixed EDID header"; + ASSERT_EQ(0, std::accumulate(displayIdentification0.data.begin(), + displayIdentification0.data.begin() + kEdidBlockSize, + static_cast(0))) + << "EDID base block doesn't checksum"; - struct TestParameters { - nsecs_t delayForChange; - bool refreshMiss; - }; + DisplayIdentification displayIdentification1; + ASSERT_TRUE( + mComposerClient->getDisplayIdentificationData(mPrimaryDisplay, &displayIdentification1) + .isOk()); - static inline auto toTimePoint(nsecs_t time) { - return std::chrono::time_point(std::chrono::nanoseconds(time)); - } + ASSERT_EQ(displayIdentification0.port, displayIdentification1.port) << "ports are not stable"; + ASSERT_TRUE(displayIdentification0.data.size() == displayIdentification1.data.size() && + std::equal(displayIdentification0.data.begin(), displayIdentification0.data.end(), + displayIdentification1.data.begin())) + << "data is not stable"; +} - int64_t createLayer(const VtsDisplay& display) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(display.get(), kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlTest, GetHdrCapabilities) { + HdrCapabilities hdrCapabilities; + const auto error = mComposerClient->getHdrCapabilities(mPrimaryDisplay, &hdrCapabilities); - auto resourceIt = mDisplayResources.find(display.get()); - if (resourceIt == mDisplayResources.end()) { - resourceIt = mDisplayResources.insert({display.get(), DisplayResource(false)}).first; - } + ASSERT_TRUE(error.isOk()); + ASSERT_TRUE(hdrCapabilities.maxLuminance >= hdrCapabilities.minLuminance); +} - EXPECT_TRUE(resourceIt->second.layers.insert(layer).second) - << "duplicated layer id " << layer; +TEST_P(GraphicsComposerAidlTest, GetPerFrameMetadataKeys) { + std::vector keys; + const auto error = mComposerClient->getPerFrameMetadataKeys(mPrimaryDisplay, &keys); - return layer; + if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + GTEST_SUCCEED() << "getPerFrameMetadataKeys is not supported"; + return; } + EXPECT_TRUE(error.isOk()); + ASSERT_TRUE(keys.size() >= 0); +} - void destroyLayer(const VtsDisplay& display, int64_t layer) { - auto const error = mComposerClient->destroyLayer(display.get(), layer); - ASSERT_TRUE(error.isOk()) << "failed to destroy layer " << layer; +TEST_P(GraphicsComposerAidlTest, GetReadbackBufferAttributes) { + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); - auto resourceIt = mDisplayResources.find(display.get()); - ASSERT_NE(mDisplayResources.end(), resourceIt); - resourceIt->second.layers.erase(layer); + if (error.isOk()) { + EXPECT_EQ(EX_NONE, error.getServiceSpecificError()); } +} - void forEachTwoConfigs(int64_t display, std::function func) { - std::vector displayConfigs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(display, &displayConfigs).isOk()); - for (const int32_t config1 : displayConfigs) { - for (const int32_t config2 : displayConfigs) { - if (config1 != config2) { - func(config1, config2); - } - } - } - } - - void setActiveConfig(VtsDisplay& display, int32_t config) { - EXPECT_TRUE(mComposerClient->setActiveConfig(display.get(), config).isOk()); - int32_t displayWidth; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, DisplayAttribute::WIDTH, - &displayWidth) - .isOk()); - int32_t displayHeight; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, DisplayAttribute::HEIGHT, - &displayHeight) - .isOk()); - display.setDimensions(displayWidth, displayHeight); - } - - void sendRefreshFrame(const VtsDisplay& display, const VsyncPeriodChangeTimeline* timeline) { - if (timeline != nullptr) { - // Refresh time should be before newVsyncAppliedTimeNanos - EXPECT_LT(timeline->refreshTimeNanos, timeline->newVsyncAppliedTimeNanos); +TEST_P(GraphicsComposerAidlTest, GetRenderIntents) { + std::vector modes; + EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &modes).isOk()); + for (auto mode : modes) { + std::vector intents; + EXPECT_TRUE(mComposerClient->getRenderIntents(mPrimaryDisplay, mode, &intents).isOk()); - std::this_thread::sleep_until(toTimePoint(timeline->refreshTimeNanos)); + bool isHdr; + switch (mode) { + case ColorMode::BT2100_PQ: + case ColorMode::BT2100_HLG: + isHdr = true; + break; + default: + isHdr = false; + break; } + RenderIntent requiredIntent = + isHdr ? RenderIntent::TONE_MAP_COLORIMETRIC : RenderIntent::COLORIMETRIC; - mWriter->selectDisplay(display.get()); - EXPECT_TRUE(mComposerClient->setPowerMode(display.get(), PowerMode::ON).isOk()); - EXPECT_TRUE( - mComposerClient - ->setColorMode(display.get(), ColorMode::NATIVE, RenderIntent::COLORIMETRIC) - .isOk()); + auto iter = std::find(intents.cbegin(), intents.cend(), requiredIntent); + EXPECT_NE(intents.cend(), iter); + } +} - FRect displayCrop = display.getCrop(); - auto displayWidth = static_cast(std::ceilf(displayCrop.right - displayCrop.left)); - auto displayHeight = - static_cast(std::ceilf(displayCrop.bottom - displayCrop.top)); - int64_t layer = 0; - ASSERT_NO_FATAL_FAILURE(layer = createLayer(display)); - { - auto buffer = allocate(displayWidth, displayHeight); - ASSERT_NE(nullptr, buffer); - ASSERT_EQ(::android::OK, buffer->initCheck()); - ASSERT_NE(nullptr, buffer->handle); +TEST_P(GraphicsComposerAidlTest, GetRenderIntentsBadDisplay) { + std::vector modes; + EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &modes).isOk()); + for (auto mode : modes) { + std::vector renderIntents; + const auto error = + mComposerClient->getRenderIntents(mInvalidDisplayId, mode, &renderIntents); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + } +} - mWriter->selectLayer(layer); - mWriter->setLayerCompositionType(Composition::DEVICE); - mWriter->setLayerDisplayFrame(display.getFrameRect()); - mWriter->setLayerPlaneAlpha(1); - mWriter->setLayerSourceCrop(display.getCrop()); - mWriter->setLayerTransform(static_cast(0)); - mWriter->setLayerVisibleRegion(std::vector(1, display.getFrameRect())); - mWriter->setLayerZOrder(10); - mWriter->setLayerBlendMode(BlendMode::NONE); - mWriter->setLayerSurfaceDamage(std::vector(1, display.getFrameRect())); - mWriter->setLayerBuffer(0, buffer->handle, -1); - mWriter->setLayerDataspace(common::Dataspace::UNKNOWN); +TEST_P(GraphicsComposerAidlTest, GetRenderIntentsBadParameter) { + std::vector renderIntents; + const auto error = mComposerClient->getRenderIntents( + mPrimaryDisplay, static_cast(-1), &renderIntents); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError()); +} - mWriter->validateDisplay(); - execute(); - ASSERT_EQ(0, mReader->mErrors.size()); - mReader->mCompositionChanges.clear(); +TEST_P(GraphicsComposerAidlTest, GetColorModes) { + std::vector colorModes; + EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &colorModes).isOk()); - mWriter->presentDisplay(); - execute(); - ASSERT_EQ(0, mReader->mErrors.size()); - } + auto native = std::find(colorModes.cbegin(), colorModes.cend(), ColorMode::NATIVE); + ASSERT_NE(colorModes.cend(), native); +} - { - auto buffer = allocate(displayWidth, displayHeight); - ASSERT_NE(nullptr, buffer->handle); +TEST_P(GraphicsComposerAidlTest, GetColorModeBadDisplay) { + std::vector colorModes; + const auto error = mComposerClient->getColorModes(mInvalidDisplayId, &colorModes); - mWriter->selectLayer(layer); - mWriter->setLayerBuffer(0, buffer->handle, -1); - mWriter->setLayerSurfaceDamage(std::vector(1, {0, 0, 10, 10})); - mWriter->validateDisplay(); - execute(); - ASSERT_EQ(0, mReader->mErrors.size()); - mReader->mCompositionChanges.clear(); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} - mWriter->presentDisplay(); - execute(); +TEST_P(GraphicsComposerAidlTest, SetColorMode) { + std::vector colorModes; + EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &colorModes).isOk()); + for (auto mode : colorModes) { + std::vector intents; + EXPECT_TRUE(mComposerClient->getRenderIntents(mPrimaryDisplay, mode, &intents).isOk()) + << "failed to get render intents"; + for (auto intent : intents) { + const auto error = mComposerClient->setColorMode(mPrimaryDisplay, mode, intent); + EXPECT_TRUE(error.isOk() || + IComposerClient::EX_UNSUPPORTED == error.getServiceSpecificError()) + << "failed to set color mode"; } - - ASSERT_NO_FATAL_FAILURE(destroyLayer(display, layer)); } - void waitForVsyncPeriodChange(int64_t display, const VsyncPeriodChangeTimeline& timeline, - int64_t desiredTimeNanos, int64_t oldPeriodNanos, - int64_t newPeriodNanos) { - const auto kChangeDeadline = toTimePoint(timeline.newVsyncAppliedTimeNanos) + 100ms; - while (std::chrono::steady_clock::now() <= kChangeDeadline) { - int32_t vsyncPeriodNanos; - EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display, &vsyncPeriodNanos).isOk()); - if (systemTime() <= desiredTimeNanos) { - EXPECT_EQ(vsyncPeriodNanos, oldPeriodNanos); - } else if (vsyncPeriodNanos == newPeriodNanos) { - break; - } - std::this_thread::sleep_for(std::chrono::nanoseconds(oldPeriodNanos)); + const auto error = mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE, + RenderIntent::COLORIMETRIC); + EXPECT_TRUE(error.isOk() || IComposerClient::EX_UNSUPPORTED == error.getServiceSpecificError()) + << "failed to set color mode"; +} + +TEST_P(GraphicsComposerAidlTest, SetColorModeBadDisplay) { + std::vector colorModes; + EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &colorModes).isOk()); + for (auto mode : colorModes) { + std::vector intents; + EXPECT_TRUE(mComposerClient->getRenderIntents(mPrimaryDisplay, mode, &intents).isOk()) + << "failed to get render intents"; + for (auto intent : intents) { + auto const error = mComposerClient->setColorMode(mInvalidDisplayId, mode, intent); + + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); } } +} - void Test_setActiveConfigWithConstraints(const TestParameters& params) { - for (VtsDisplay& display : mDisplays) { - forEachTwoConfigs(display.get(), [&](int32_t config1, int32_t config2) { - setActiveConfig(display, config1); - sendRefreshFrame(display, nullptr); +TEST_P(GraphicsComposerAidlTest, SetColorModeBadParameter) { + const auto colorModeError = mComposerClient->setColorMode( + mPrimaryDisplay, static_cast(-1), RenderIntent::COLORIMETRIC); - int32_t vsyncPeriod1; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config1, - DisplayAttribute::VSYNC_PERIOD, - &vsyncPeriod1) - .isOk()); - int32_t configGroup1; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config1, - DisplayAttribute::CONFIG_GROUP, - &configGroup1) - .isOk()); - int32_t vsyncPeriod2; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config2, - DisplayAttribute::VSYNC_PERIOD, - &vsyncPeriod2) - .isOk()); - int32_t configGroup2; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config2, - DisplayAttribute::CONFIG_GROUP, - &configGroup2) - .isOk()); + EXPECT_FALSE(colorModeError.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, colorModeError.getServiceSpecificError()); - if (vsyncPeriod1 == vsyncPeriod2) { - return; // continue - } + const auto renderIntentError = mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE, + static_cast(-1)); - // We don't allow delayed change when changing config groups - if (params.delayForChange > 0 && configGroup1 != configGroup2) { - return; // continue - } + EXPECT_FALSE(renderIntentError.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, renderIntentError.getServiceSpecificError()); +} - VsyncPeriodChangeTimeline timeline; - VsyncPeriodChangeConstraints constraints = { - .desiredTimeNanos = systemTime() + params.delayForChange, - .seamlessRequired = false}; - EXPECT_TRUE(setActiveConfigWithConstraints(display, config2, constraints, &timeline) - .isOk()); +TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSamplingAttributes) { + int constexpr invalid = -1; - 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()); + DisplayContentSamplingAttributes format; + auto error = mComposerClient->getDisplayedContentSamplingAttributes(mPrimaryDisplay, &format); - if (timeline.refreshRequired) { - if (params.refreshMiss) { - // Miss the refresh frame on purpose to make sure the implementation sends a - // callback - std::this_thread::sleep_until(toTimePoint(timeline.refreshTimeNanos) + - 100ms); - } - sendRefreshFrame(display, &timeline); - } - waitForVsyncPeriodChange(display.get(), timeline, constraints.desiredTimeNanos, - vsyncPeriod1, vsyncPeriod2); + if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + SUCCEED() << "Device does not support optional extension. Test skipped"; + return; + } - // At this point the refresh rate should have changed already, however in rare - // cases the implementation might have missed the deadline. In this case a new - // timeline should have been provided. - auto newTimeline = mComposerCallback->takeLastVsyncPeriodChangeTimeline(); - if (timeline.refreshRequired && params.refreshMiss) { - EXPECT_TRUE(newTimeline.has_value()); - } + EXPECT_TRUE(error.isOk()); + EXPECT_NE(format.format, static_cast(invalid)); + EXPECT_NE(format.dataspace, static_cast(invalid)); + EXPECT_NE(format.componentMask, static_cast(invalid)); +}; - if (newTimeline.has_value()) { - if (newTimeline->refreshRequired) { - sendRefreshFrame(display, &newTimeline.value()); - } - waitForVsyncPeriodChange(display.get(), newTimeline.value(), - constraints.desiredTimeNanos, vsyncPeriod1, - vsyncPeriod2); - } +TEST_P(GraphicsComposerAidlTest, SetDisplayedContentSamplingEnabled) { + auto const maxFrames = 10; + FormatColorComponent enableAllComponents = FormatColorComponent::FORMAT_COMPONENT_0; + auto error = mComposerClient->setDisplayedContentSamplingEnabled( + mPrimaryDisplay, true, enableAllComponents, maxFrames); + if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + SUCCEED() << "Device does not support optional extension. Test skipped"; + return; + } + EXPECT_TRUE(error.isOk()); - int32_t vsyncPeriodNanos; - EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display.get(), &vsyncPeriodNanos) - .isOk()); - EXPECT_EQ(vsyncPeriodNanos, vsyncPeriod2); - }); - } + error = mComposerClient->setDisplayedContentSamplingEnabled(mPrimaryDisplay, false, + enableAllComponents, maxFrames); + EXPECT_TRUE(error.isOk()); +} + +TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSample) { + DisplayContentSamplingAttributes displayContentSamplingAttributes; + int constexpr invalid = -1; + displayContentSamplingAttributes.format = static_cast(invalid); + displayContentSamplingAttributes.dataspace = static_cast(invalid); + displayContentSamplingAttributes.componentMask = static_cast(invalid); + auto error = mComposerClient->getDisplayedContentSamplingAttributes( + mPrimaryDisplay, &displayContentSamplingAttributes); + if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + SUCCEED() << "Sampling attributes aren't supported on this device, test skipped"; + return; } - // Keep track of all virtual displays and layers. When a test fails with - // ASSERT_*, the destructor will clean up the resources for the test. - struct DisplayResource { - DisplayResource(bool isVirtual_) : isVirtual(isVirtual_) {} + int64_t maxFrames = 10; + int64_t timestamp = 0; + int64_t frameCount = 0; + DisplayContentSample displayContentSample; + error = mComposerClient->getDisplayedContentSample(mPrimaryDisplay, maxFrames, timestamp, + &displayContentSample); + if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + SUCCEED() << "Device does not support optional extension. Test skipped"; + return; + } - bool isVirtual; - std::unordered_set layers; - }; + EXPECT_TRUE(error.isOk()); + EXPECT_LE(frameCount, maxFrames); + std::vector> histogram = { + displayContentSample.sampleComponent0, displayContentSample.sampleComponent1, + displayContentSample.sampleComponent2, displayContentSample.sampleComponent3}; - std::shared_ptr mComposer; - std::shared_ptr mComposerClient; - int64_t mInvalidDisplayId; - int64_t mPrimaryDisplay; - std::vector mDisplays; - std::shared_ptr mComposerCallback; - std::unique_ptr mWriter; - std::unique_ptr mReader; - // use the slot count usually set by SF - static constexpr uint32_t kBufferSlotCount = 64; - std::unordered_map mDisplayResources; -}; + for (size_t i = 0; i < histogram.size(); i++) { + const bool shouldHaveHistogram = + static_cast(displayContentSamplingAttributes.componentMask) & (1 << i); + EXPECT_EQ(shouldHaveHistogram, !histogram[i].empty()); + } +} -TEST_P(GraphicsComposerAidlTest, getDisplayCapabilitiesBadDisplay) { +TEST_P(GraphicsComposerAidlTest, getDisplayCapabilitiesBasic) { std::vector capabilities; - const auto error = mComposerClient->getDisplayCapabilities(mInvalidDisplayId, &capabilities); + const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); + ASSERT_TRUE(error.isOk()); + const bool hasDozeSupport = std::find(capabilities.begin(), capabilities.end(), + DisplayCapability::DOZE) != capabilities.end(); + bool isDozeSupported = false; + EXPECT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk()); + EXPECT_EQ(hasDozeSupport, isDozeSupported); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + bool hasBrightnessSupport = std::find(capabilities.begin(), capabilities.end(), + DisplayCapability::BRIGHTNESS) != capabilities.end(); + bool isBrightnessSupported = false; + EXPECT_TRUE( + mComposerClient->getDisplayBrightnessSupport(mPrimaryDisplay, &isBrightnessSupported) + .isOk()); + EXPECT_EQ(isBrightnessSupported, hasBrightnessSupport); } -TEST_P(GraphicsComposerAidlTest, getDisplayCapabilities) { - for (const auto& display : mDisplays) { - std::vector capabilities; - - EXPECT_TRUE(mComposerClient->getDisplayCapabilities(display.get(), &capabilities).isOk()); +/* + * Test that if brightness operations are supported, setDisplayBrightness works as expected. + */ +TEST_P(GraphicsComposerAidlTest, setDisplayBrightness) { + std::vector capabilities; + auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); + ASSERT_TRUE(error.isOk()); + bool brightnessSupport = std::find(capabilities.begin(), capabilities.end(), + DisplayCapability::BRIGHTNESS) != capabilities.end(); + if (!brightnessSupport) { + EXPECT_EQ(mComposerClient->setDisplayBrightness(mPrimaryDisplay, 0.5f) + .getServiceSpecificError(), + IComposerClient::EX_UNSUPPORTED); + GTEST_SUCCEED() << "Brightness operations are not supported"; + return; } -} -TEST_P(GraphicsComposerAidlTest, DumpDebugInfo) { - std::string debugInfo; - EXPECT_TRUE(mComposer->dumpDebugInfo(&debugInfo).isOk()); -} + EXPECT_TRUE(mComposerClient->setDisplayBrightness(mPrimaryDisplay, 0.0f).isOk()); + EXPECT_TRUE(mComposerClient->setDisplayBrightness(mPrimaryDisplay, 0.5f).isOk()); + EXPECT_TRUE(mComposerClient->setDisplayBrightness(mPrimaryDisplay, 1.0f).isOk()); + EXPECT_TRUE(mComposerClient->setDisplayBrightness(mPrimaryDisplay, -1.0f).isOk()); -TEST_P(GraphicsComposerAidlTest, CreateClientSingleton) { - std::shared_ptr composerClient; - const auto error = mComposer->createClient(&composerClient); + error = mComposerClient->setDisplayBrightness(mPrimaryDisplay, +2.0f); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(error.getServiceSpecificError(), IComposerClient::EX_BAD_PARAMETER); + error = mComposerClient->setDisplayBrightness(mPrimaryDisplay, -2.0f); EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_NO_RESOURCES, error.getServiceSpecificError()); + EXPECT_EQ(error.getServiceSpecificError(), IComposerClient::EX_BAD_PARAMETER); } -TEST_P(GraphicsComposerAidlTest, getDisplayVsyncPeriod) { - for (VtsDisplay& display : mDisplays) { +TEST_P(GraphicsComposerAidlTest, getDisplayConnectionType) { + DisplayConnectionType type; + EXPECT_FALSE(mComposerClient->getDisplayConnectionType(mInvalidDisplayId, &type).isOk()); + for (const auto& display : mDisplays) { + EXPECT_TRUE(mComposerClient->getDisplayConnectionType(display.get(), &type).isOk()); + } +} + +TEST_P(GraphicsComposerAidlTest, getDisplayAttribute) { + for (const auto& display : mDisplays) { std::vector configs; EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk()); - for (int32_t config : configs) { - int32_t expectedVsyncPeriodNanos = -1; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, - DisplayAttribute::VSYNC_PERIOD, - &expectedVsyncPeriodNanos) - .isOk()); - - VsyncPeriodChangeTimeline timeline; - VsyncPeriodChangeConstraints constraints; - - constraints.desiredTimeNanos = systemTime(); - constraints.seamlessRequired = false; - EXPECT_TRUE(mComposerClient - ->setActiveConfigWithConstraints(display.get(), config, constraints, - &timeline) - .isOk()); - - if (timeline.refreshRequired) { - sendRefreshFrame(display, &timeline); - } - waitForVsyncPeriodChange(display.get(), timeline, constraints.desiredTimeNanos, 0, - expectedVsyncPeriodNanos); - - int32_t vsyncPeriodNanos; - int retryCount = 100; - do { - std::this_thread::sleep_for(10ms); - vsyncPeriodNanos = 0; - EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display.get(), &vsyncPeriodNanos) + for (const auto& config : configs) { + const std::array requiredAttributes = {{ + DisplayAttribute::WIDTH, + DisplayAttribute::HEIGHT, + DisplayAttribute::VSYNC_PERIOD, + DisplayAttribute::CONFIG_GROUP, + }}; + int32_t value; + for (const auto& attribute : requiredAttributes) { + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(display.get(), config, attribute, &value) .isOk()); - --retryCount; - } while (vsyncPeriodNanos != expectedVsyncPeriodNanos && retryCount > 0); - - EXPECT_EQ(vsyncPeriodNanos, expectedVsyncPeriodNanos); + EXPECT_NE(-1, value); + } - // Make sure that the vsync period stays the same if the active config is not - // changed. - auto timeout = 1ms; - for (int i = 0; i < 10; i++) { - std::this_thread::sleep_for(timeout); - timeout *= 2; - vsyncPeriodNanos = 0; - EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display.get(), &vsyncPeriodNanos) - .isOk()); - EXPECT_EQ(vsyncPeriodNanos, expectedVsyncPeriodNanos); + const std::array optionalAttributes = {{ + DisplayAttribute::DPI_X, + DisplayAttribute::DPI_Y, + }}; + for (const auto& attribute : optionalAttributes) { + const auto error = mComposerClient->getDisplayAttribute(display.get(), config, + attribute, &value); + if (error.isOk()) { + EXPECT_EQ(EX_NONE, error.getServiceSpecificError()); + } else { + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + } } } } } -TEST_P(GraphicsComposerAidlTest, setActiveConfigWithConstraints_SeamlessNotAllowed) { - VsyncPeriodChangeTimeline timeline; - VsyncPeriodChangeConstraints constraints; +TEST_P(GraphicsComposerAidlTest, checkConfigsAreValid) { + for (const auto& display : mDisplays) { + std::vector configs; + EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk()); - constraints.seamlessRequired = true; - constraints.desiredTimeNanos = systemTime(); + EXPECT_FALSE(std::any_of(configs.begin(), configs.end(), [](auto config) { + return config == IComposerClient::INVALID_CONFIGURATION; + })); + } +} - for (VtsDisplay& display : mDisplays) { - forEachTwoConfigs(display.get(), [&](int32_t config1, int32_t config2) { - int32_t configGroup1; +TEST_P(GraphicsComposerAidlTest, getDisplayAttributeConfigsInAGroupDifferOnlyByVsyncPeriod) { + struct Resolution { + int32_t width; + int32_t height; + }; + struct Dpi { + int32_t x; + int32_t y; + }; + for (const auto& display : mDisplays) { + std::vector configs; + EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk()); + std::unordered_map configGroupToResolutionMap; + std::unordered_map configGroupToDpiMap; + for (const auto& config : configs) { + int32_t configGroup = -1; EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config1, - DisplayAttribute::CONFIG_GROUP, &configGroup1) + ->getDisplayAttribute(display.get(), config, + DisplayAttribute::CONFIG_GROUP, &configGroup) .isOk()); - int32_t configGroup2; + int32_t width = -1; EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config2, - DisplayAttribute::CONFIG_GROUP, &configGroup2) + ->getDisplayAttribute(display.get(), config, + DisplayAttribute::WIDTH, &width) .isOk()); - if (configGroup1 != configGroup2) { - setActiveConfig(display, config1); - sendRefreshFrame(display, nullptr); - EXPECT_EQ(IComposerClient::EX_SEAMLESS_NOT_ALLOWED, - setActiveConfigWithConstraints(display, config2, constraints, &timeline) - .getServiceSpecificError()); + int32_t height = -1; + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(display.get(), config, + DisplayAttribute::HEIGHT, &height) + .isOk()); + if (configGroupToResolutionMap.find(configGroup) == configGroupToResolutionMap.end()) { + configGroupToResolutionMap[configGroup] = {width, height}; } - }); - } -} + EXPECT_EQ(configGroupToResolutionMap[configGroup].width, width); + EXPECT_EQ(configGroupToResolutionMap[configGroup].height, height); -TEST_P(GraphicsComposerAidlTest, setActiveConfigWithConstraints) { - Test_setActiveConfigWithConstraints({.delayForChange = 0, .refreshMiss = false}); -} + int32_t dpiX = -1; + mComposerClient->getDisplayAttribute(display.get(), config, DisplayAttribute::DPI_X, + &dpiX); -TEST_P(GraphicsComposerAidlTest, setActiveConfigWithConstraints_Delayed) { - Test_setActiveConfigWithConstraints({.delayForChange = 300'000'000, // 300ms - .refreshMiss = false}); + int32_t dpiY = -1; + mComposerClient->getDisplayAttribute(display.get(), config, DisplayAttribute::DPI_Y, + &dpiY); + if (dpiX == -1 && dpiY == -1) { + continue; + } + + if (configGroupToDpiMap.find(configGroup) == configGroupToDpiMap.end()) { + configGroupToDpiMap[configGroup] = {dpiX, dpiY}; + } + EXPECT_EQ(configGroupToDpiMap[configGroup].x, dpiX); + EXPECT_EQ(configGroupToDpiMap[configGroup].y, dpiY); + } + } } -TEST_P(GraphicsComposerAidlTest, setActiveConfigWithConstraints_MissRefresh) { - Test_setActiveConfigWithConstraints({.delayForChange = 0, .refreshMiss = true}); +TEST_P(GraphicsComposerAidlTest, getDisplayVsyncPeriod_BadDisplay) { + int32_t vsyncPeriodNanos; + const auto error = mComposerClient->getDisplayVsyncPeriod(mInvalidDisplayId, &vsyncPeriodNanos); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, GetDisplayIdentificationData) { - DisplayIdentification displayIdentification0; +TEST_P(GraphicsComposerAidlTest, setActiveConfigWithConstraints_BadDisplay) { + VsyncPeriodChangeTimeline timeline; + VsyncPeriodChangeConstraints constraints; - const auto error = - mComposerClient->getDisplayIdentificationData(mPrimaryDisplay, &displayIdentification0); - if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { - return; - } - ASSERT_TRUE(error.isOk()) << "failed to get display identification data"; - ASSERT_FALSE(displayIdentification0.data.empty()); + constraints.seamlessRequired = false; + constraints.desiredTimeNanos = systemTime(); + int32_t config = 0; + auto const error = mComposerClient->setActiveConfigWithConstraints(mInvalidDisplayId, config, + constraints, &timeline); - constexpr size_t kEdidBlockSize = 128; - ASSERT_TRUE(displayIdentification0.data.size() % kEdidBlockSize == 0) - << "EDID blob length is not a multiple of " << kEdidBlockSize; + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} - const uint8_t kEdidHeader[] = {0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00}; - ASSERT_TRUE(std::equal(std::begin(kEdidHeader), std::end(kEdidHeader), - displayIdentification0.data.begin())) - << "EDID blob doesn't start with the fixed EDID header"; - ASSERT_EQ(0, std::accumulate(displayIdentification0.data.begin(), - displayIdentification0.data.begin() + kEdidBlockSize, - static_cast(0))) - << "EDID base block doesn't checksum"; +TEST_P(GraphicsComposerAidlTest, setActiveConfigWithConstraints_BadConfig) { + VsyncPeriodChangeTimeline timeline; + VsyncPeriodChangeConstraints constraints; - DisplayIdentification displayIdentification1; - ASSERT_TRUE( - mComposerClient->getDisplayIdentificationData(mPrimaryDisplay, &displayIdentification1) - .isOk()); + constraints.seamlessRequired = false; + constraints.desiredTimeNanos = systemTime(); - ASSERT_EQ(displayIdentification0.port, displayIdentification1.port) << "ports are not stable"; - ASSERT_TRUE(displayIdentification0.data.size() == displayIdentification1.data.size() && - std::equal(displayIdentification0.data.begin(), displayIdentification0.data.end(), - displayIdentification1.data.begin())) - << "data is not stable"; + for (VtsDisplay& display : mDisplays) { + int32_t invalidConfigId = GetInvalidConfigId(); + const auto error = + setActiveConfigWithConstraints(display, invalidConfigId, constraints, &timeline); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_CONFIG, error.getServiceSpecificError()); + } } -TEST_P(GraphicsComposerAidlTest, SET_LAYER_PER_FRAME_METADATA) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlTest, setAutoLowLatencyModeBadDisplay) { + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, + mComposerClient->setAutoLowLatencyMode(mInvalidDisplayId, true) + .getServiceSpecificError()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, + mComposerClient->setAutoLowLatencyMode(mInvalidDisplayId, false) + .getServiceSpecificError()); +} - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); +TEST_P(GraphicsComposerAidlTest, setAutoLowLatencyMode) { + for (const auto& display : mDisplays) { + std::vector capabilities; + const auto error = mComposerClient->getDisplayCapabilities(display.get(), &capabilities); + EXPECT_TRUE(error.isOk()); - /** - * DISPLAY_P3 is a color space that uses the DCI_P3 primaries, - * the D65 white point and the SRGB transfer functions. - * Rendering Intent: Colorimetric - * Primaries: - * x y - * green 0.265 0.690 - * blue 0.150 0.060 - * red 0.680 0.320 - * white (D65) 0.3127 0.3290 - */ + const bool allmSupport = + std::find(capabilities.begin(), capabilities.end(), + DisplayCapability::AUTO_LOW_LATENCY_MODE) != capabilities.end(); - std::vector aidlMetadata; - aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_RED_PRIMARY_X, 0.680f}); - aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_RED_PRIMARY_Y, 0.320f}); - aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_GREEN_PRIMARY_X, 0.265f}); - aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_GREEN_PRIMARY_Y, 0.690f}); - aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_X, 0.150f}); - aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_Y, 0.060f}); - aidlMetadata.push_back({PerFrameMetadataKey::WHITE_POINT_X, 0.3127f}); - aidlMetadata.push_back({PerFrameMetadataKey::WHITE_POINT_Y, 0.3290f}); - aidlMetadata.push_back({PerFrameMetadataKey::MAX_LUMINANCE, 100.0f}); - aidlMetadata.push_back({PerFrameMetadataKey::MIN_LUMINANCE, 0.1f}); - aidlMetadata.push_back({PerFrameMetadataKey::MAX_CONTENT_LIGHT_LEVEL, 78.0}); - aidlMetadata.push_back({PerFrameMetadataKey::MAX_FRAME_AVERAGE_LIGHT_LEVEL, 62.0}); - mWriter->setLayerPerFrameMetadata(aidlMetadata); - execute(); + if (!allmSupport) { + const auto errorIsOn = mComposerClient->setAutoLowLatencyMode(display.get(), true); + EXPECT_FALSE(errorIsOn.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, errorIsOn.getServiceSpecificError()); + const auto errorIsOff = mComposerClient->setAutoLowLatencyMode(display.get(), false); + EXPECT_FALSE(errorIsOff.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, errorIsOff.getServiceSpecificError()); + GTEST_SUCCEED() << "Auto Low Latency Mode is not supported on display " + << std::to_string(display.get()) << ", skipping test"; + return; + } - if (mReader->mErrors.size() == 1 && mReader->mErrors[0].second == EX_UNSUPPORTED_OPERATION) { - mReader->mErrors.clear(); - GTEST_SUCCEED() << "SetLayerPerFrameMetadata is not supported"; - EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk()); - return; + EXPECT_TRUE(mComposerClient->setAutoLowLatencyMode(display.get(), true).isOk()); + EXPECT_TRUE(mComposerClient->setAutoLowLatencyMode(display.get(), false).isOk()); } - - EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk()); } -TEST_P(GraphicsComposerAidlTest, GetHdrCapabilities) { - HdrCapabilities hdrCapabilities; - const auto error = mComposerClient->getHdrCapabilities(mPrimaryDisplay, &hdrCapabilities); - - ASSERT_TRUE(error.isOk()); - ASSERT_TRUE(hdrCapabilities.maxLuminance >= hdrCapabilities.minLuminance); +TEST_P(GraphicsComposerAidlTest, getSupportedContentTypesBadDisplay) { + std::vector supportedContentTypes; + const auto error = + mComposerClient->getSupportedContentTypes(mInvalidDisplayId, &supportedContentTypes); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, GetPerFrameMetadataKeys) { - std::vector keys; - const auto error = mComposerClient->getPerFrameMetadataKeys(mPrimaryDisplay, &keys); - - if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { - GTEST_SUCCEED() << "getPerFrameMetadataKeys is not supported"; - return; - } - EXPECT_TRUE(error.isOk()); - ASSERT_TRUE(keys.size() >= 0); -} +TEST_P(GraphicsComposerAidlTest, getSupportedContentTypes) { + std::vector supportedContentTypes; + for (const auto& display : mDisplays) { + supportedContentTypes.clear(); + const auto error = + mComposerClient->getSupportedContentTypes(display.get(), &supportedContentTypes); -TEST_P(GraphicsComposerAidlTest, GetReadbackBufferAttributes) { - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); + ASSERT_TRUE(error.isOk()); - if (error.isOk()) { - EXPECT_EQ(EX_NONE, error.getServiceSpecificError()); + const bool noneSupported = + std::find(supportedContentTypes.begin(), supportedContentTypes.end(), + ContentType::NONE) != supportedContentTypes.end(); + EXPECT_FALSE(noneSupported); } } -TEST_P(GraphicsComposerAidlTest, GetRenderIntents) { - std::vector modes; - EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &modes).isOk()); - for (auto mode : modes) { - std::vector intents; - EXPECT_TRUE(mComposerClient->getRenderIntents(mPrimaryDisplay, mode, &intents).isOk()); - - bool isHdr; - switch (mode) { - case ColorMode::BT2100_PQ: - case ColorMode::BT2100_HLG: - isHdr = true; - break; - default: - isHdr = false; - break; - } - RenderIntent requiredIntent = - isHdr ? RenderIntent::TONE_MAP_COLORIMETRIC : RenderIntent::COLORIMETRIC; - - auto iter = std::find(intents.cbegin(), intents.cend(), requiredIntent); - EXPECT_NE(intents.cend(), iter); +TEST_P(GraphicsComposerAidlTest, setContentTypeNoneAlwaysAccepted) { + for (const auto& display : mDisplays) { + const auto error = mComposerClient->setContentType(display.get(), ContentType::NONE); + EXPECT_TRUE(error.isOk()); } } -TEST_P(GraphicsComposerAidlTest, GetRenderIntentsBadDisplay) { - std::vector modes; - EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &modes).isOk()); - for (auto mode : modes) { - std::vector renderIntents; - const auto error = - mComposerClient->getRenderIntents(mInvalidDisplayId, mode, &renderIntents); +TEST_P(GraphicsComposerAidlTest, setContentTypeBadDisplay) { + constexpr ContentType types[] = {ContentType::NONE, ContentType::GRAPHICS, ContentType::PHOTO, + ContentType::CINEMA, ContentType::GAME}; + for (const auto& type : types) { + auto const error = mComposerClient->setContentType(mInvalidDisplayId, type); + EXPECT_FALSE(error.isOk()); EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); } } -TEST_P(GraphicsComposerAidlTest, GetRenderIntentsBadParameter) { - std::vector renderIntents; - const auto error = mComposerClient->getRenderIntents( - mPrimaryDisplay, static_cast(-1), &renderIntents); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError()); +TEST_P(GraphicsComposerAidlTest, setGraphicsContentType) { + Test_setContentType(ContentType::GRAPHICS, "GRAPHICS"); } -TEST_P(GraphicsComposerAidlTest, GetColorModes) { - std::vector colorModes; - EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &colorModes).isOk()); +TEST_P(GraphicsComposerAidlTest, setPhotoContentType) { + Test_setContentType(ContentType::PHOTO, "PHOTO"); +} - auto native = std::find(colorModes.cbegin(), colorModes.cend(), ColorMode::NATIVE); - ASSERT_NE(colorModes.cend(), native); +TEST_P(GraphicsComposerAidlTest, setCinemaContentType) { + Test_setContentType(ContentType::CINEMA, "CINEMA"); } -TEST_P(GraphicsComposerAidlTest, GetColorModeBadDisplay) { - std::vector colorModes; - const auto error = mComposerClient->getColorModes(mInvalidDisplayId, &colorModes); - - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +TEST_P(GraphicsComposerAidlTest, setGameContentType) { + Test_setContentType(ContentType::GAME, "GAME"); } -TEST_P(GraphicsComposerAidlTest, SetColorMode) { - std::vector colorModes; - EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &colorModes).isOk()); - for (auto mode : colorModes) { - std::vector intents; - EXPECT_TRUE(mComposerClient->getRenderIntents(mPrimaryDisplay, mode, &intents).isOk()) - << "failed to get render intents"; - for (auto intent : intents) { - const auto error = mComposerClient->setColorMode(mPrimaryDisplay, mode, intent); - EXPECT_TRUE(error.isOk() || - IComposerClient::EX_UNSUPPORTED == error.getServiceSpecificError()) - << "failed to set color mode"; - } - } +TEST_P(GraphicsComposerAidlTest, getLayerGenericMetadataKeys) { + std::vector keys; + EXPECT_TRUE(mComposerClient->getLayerGenericMetadataKeys(&keys).isOk()); - const auto error = mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE, - RenderIntent::COLORIMETRIC); - EXPECT_TRUE(error.isOk() || IComposerClient::EX_UNSUPPORTED == error.getServiceSpecificError()) - << "failed to set color mode"; -} + std::regex reverseDomainName("^[a-zA-Z-]{2,}(\\.[a-zA-Z0-9-]+)+$"); + std::unordered_set uniqueNames; + for (const auto& key : keys) { + std::string name(key.name); -TEST_P(GraphicsComposerAidlTest, SetColorModeBadDisplay) { - std::vector colorModes; - EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &colorModes).isOk()); - for (auto mode : colorModes) { - std::vector intents; - EXPECT_TRUE(mComposerClient->getRenderIntents(mPrimaryDisplay, mode, &intents).isOk()) - << "failed to get render intents"; - for (auto intent : intents) { - auto const error = mComposerClient->setColorMode(mInvalidDisplayId, mode, intent); + // Keys must not start with 'android' or 'com.android' + EXPECT_FALSE(name.find("android") == 0); + EXPECT_FALSE(name.find("com.android") == 0); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); - } + // Keys must be in reverse domain name format + EXPECT_TRUE(std::regex_match(name, reverseDomainName)); + + // Keys must be unique within this list + const auto& [iter, inserted] = uniqueNames.insert(name); + EXPECT_TRUE(inserted); } } -TEST_P(GraphicsComposerAidlTest, SetColorModeBadParameter) { - const auto colorModeError = mComposerClient->setColorMode( - mPrimaryDisplay, static_cast(-1), RenderIntent::COLORIMETRIC); - - EXPECT_FALSE(colorModeError.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, colorModeError.getServiceSpecificError()); - - const auto renderIntentError = mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE, - static_cast(-1)); +TEST_P(GraphicsComposerAidlTest, CreateVirtualDisplay) { + int32_t maxVirtualDisplayCount; + EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&maxVirtualDisplayCount).isOk()); + if (maxVirtualDisplayCount == 0) { + GTEST_SUCCEED() << "no virtual display support"; + return; + } - EXPECT_FALSE(renderIntentError.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, renderIntentError.getServiceSpecificError()); -} + VirtualDisplay virtualDisplay; -TEST_P(GraphicsComposerAidlTest, SetLayerColorTransform) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); + EXPECT_TRUE(mComposerClient + ->createVirtualDisplay(64, 64, common::PixelFormat::IMPLEMENTATION_DEFINED, + kBufferSlotCount, &virtualDisplay) + .isOk()); - // clang-format off - const std::array matrix = {{ - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f, - }}; - // clang-format on + ASSERT_TRUE(mDisplayResources.insert({virtualDisplay.display, DisplayResource(true)}).second) + << "duplicated virtual display id " << virtualDisplay.display; - mWriter->setLayerColorTransform(matrix.data()); - execute(); + EXPECT_TRUE(mComposerClient->destroyVirtualDisplay(virtualDisplay.display).isOk()); +} - if (mReader->mErrors.size() == 1 && mReader->mErrors[0].second == EX_UNSUPPORTED_OPERATION) { - mReader->mErrors.clear(); - GTEST_SUCCEED() << "setLayerColorTransform is not supported"; +TEST_P(GraphicsComposerAidlTest, DestroyVirtualDisplayBadDisplay) { + int32_t maxDisplayCount = 0; + EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&maxDisplayCount).isOk()); + if (maxDisplayCount == 0) { + GTEST_SUCCEED() << "no virtual display support"; return; } -} - -TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSamplingAttributes) { - int constexpr invalid = -1; + const auto error = mComposerClient->destroyVirtualDisplay(mInvalidDisplayId); - DisplayContentSamplingAttributes format; - auto error = mComposerClient->getDisplayedContentSamplingAttributes(mPrimaryDisplay, &format); + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} - if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { - SUCCEED() << "Device does not support optional extension. Test skipped"; - return; - } +TEST_P(GraphicsComposerAidlTest, CreateLayer) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - EXPECT_TRUE(error.isOk()); - EXPECT_NE(format.format, static_cast(invalid)); - EXPECT_NE(format.dataspace, static_cast(invalid)); - EXPECT_NE(format.componentMask, static_cast(invalid)); -}; + EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk()); +} -TEST_P(GraphicsComposerAidlTest, SetDisplayedContentSamplingEnabled) { - auto const maxFrames = 10; - FormatColorComponent enableAllComponents = FormatColorComponent::FORMAT_COMPONENT_0; - auto error = mComposerClient->setDisplayedContentSamplingEnabled( - mPrimaryDisplay, true, enableAllComponents, maxFrames); - if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { - SUCCEED() << "Device does not support optional extension. Test skipped"; - return; - } - EXPECT_TRUE(error.isOk()); +TEST_P(GraphicsComposerAidlTest, CreateLayerBadDisplay) { + int64_t layer; + const auto error = mComposerClient->createLayer(mInvalidDisplayId, kBufferSlotCount, &layer); - error = mComposerClient->setDisplayedContentSamplingEnabled(mPrimaryDisplay, false, - enableAllComponents, maxFrames); - EXPECT_TRUE(error.isOk()); + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSample) { - DisplayContentSamplingAttributes displayContentSamplingAttributes; - int constexpr invalid = -1; - displayContentSamplingAttributes.format = static_cast(invalid); - displayContentSamplingAttributes.dataspace = static_cast(invalid); - displayContentSamplingAttributes.componentMask = static_cast(invalid); - auto error = mComposerClient->getDisplayedContentSamplingAttributes( - mPrimaryDisplay, &displayContentSamplingAttributes); - if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { - SUCCEED() << "Sampling attributes aren't supported on this device, test skipped"; - return; - } +TEST_P(GraphicsComposerAidlTest, DestroyLayerBadDisplay) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - int64_t maxFrames = 10; - int64_t timestamp = 0; - int64_t frameCount = 0; - DisplayContentSample displayContentSample; - error = mComposerClient->getDisplayedContentSample(mPrimaryDisplay, maxFrames, timestamp, - &displayContentSample); - if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { - SUCCEED() << "Device does not support optional extension. Test skipped"; - return; - } + const auto error = mComposerClient->destroyLayer(mInvalidDisplayId, layer); - EXPECT_TRUE(error.isOk()); - EXPECT_LE(frameCount, maxFrames); - std::vector> histogram = { - displayContentSample.sampleComponent0, displayContentSample.sampleComponent1, - displayContentSample.sampleComponent2, displayContentSample.sampleComponent3}; + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk()); +} - for (size_t i = 0; i < histogram.size(); i++) { - const bool shouldHaveHistogram = - static_cast(displayContentSamplingAttributes.componentMask) & (1 << i); - EXPECT_EQ(shouldHaveHistogram, !histogram[i].empty()); - } +TEST_P(GraphicsComposerAidlTest, DestroyLayerBadLayerError) { + // We haven't created any layers yet, so any id should be invalid + const auto error = mComposerClient->destroyLayer(mPrimaryDisplay, 1); + + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_LAYER, error.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, getDisplayCapabilitiesBasic) { - std::vector capabilities; - const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); - ASSERT_TRUE(error.isOk()); - const bool hasDozeSupport = std::find(capabilities.begin(), capabilities.end(), - DisplayCapability::DOZE) != capabilities.end(); - bool isDozeSupported = false; - EXPECT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk()); - EXPECT_EQ(hasDozeSupport, isDozeSupported); +TEST_P(GraphicsComposerAidlTest, GetActiveConfigBadDisplay) { + int32_t config; + const auto error = mComposerClient->getActiveConfig(mInvalidDisplayId, &config); - bool hasBrightnessSupport = std::find(capabilities.begin(), capabilities.end(), - DisplayCapability::BRIGHTNESS) != capabilities.end(); - bool isBrightnessSupported = false; - EXPECT_TRUE( - mComposerClient->getDisplayBrightnessSupport(mPrimaryDisplay, &isBrightnessSupported) - .isOk()); - EXPECT_EQ(isBrightnessSupported, hasBrightnessSupport); + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); } -/* - * Test that if brightness operations are supported, setDisplayBrightness works as expected. - */ -TEST_P(GraphicsComposerAidlTest, setDisplayBrightness) { - std::vector capabilities; - auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); - ASSERT_TRUE(error.isOk()); - bool brightnessSupport = std::find(capabilities.begin(), capabilities.end(), - DisplayCapability::BRIGHTNESS) != capabilities.end(); - if (!brightnessSupport) { - EXPECT_EQ(mComposerClient->setDisplayBrightness(mPrimaryDisplay, 0.5f) - .getServiceSpecificError(), - IComposerClient::EX_UNSUPPORTED); - GTEST_SUCCEED() << "Brightness operations are not supported"; - return; - } +TEST_P(GraphicsComposerAidlTest, GetDisplayConfig) { + std::vector configs; + EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); +} - EXPECT_TRUE(mComposerClient->setDisplayBrightness(mPrimaryDisplay, 0.0f).isOk()); - EXPECT_TRUE(mComposerClient->setDisplayBrightness(mPrimaryDisplay, 0.5f).isOk()); - EXPECT_TRUE(mComposerClient->setDisplayBrightness(mPrimaryDisplay, 1.0f).isOk()); - EXPECT_TRUE(mComposerClient->setDisplayBrightness(mPrimaryDisplay, -1.0f).isOk()); +TEST_P(GraphicsComposerAidlTest, GetDisplayConfigBadDisplay) { + std::vector configs; + const auto error = mComposerClient->getDisplayConfigs(mInvalidDisplayId, &configs); - error = mComposerClient->setDisplayBrightness(mPrimaryDisplay, +2.0f); EXPECT_FALSE(error.isOk()); - EXPECT_EQ(error.getServiceSpecificError(), IComposerClient::EX_BAD_PARAMETER); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} - error = mComposerClient->setDisplayBrightness(mPrimaryDisplay, -2.0f); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(error.getServiceSpecificError(), IComposerClient::EX_BAD_PARAMETER); +TEST_P(GraphicsComposerAidlTest, GetDisplayName) { + std::string displayName; + EXPECT_TRUE(mComposerClient->getDisplayName(mPrimaryDisplay, &displayName).isOk()); } -TEST_P(GraphicsComposerAidlTest, getDisplayConnectionType) { - DisplayConnectionType type; - EXPECT_FALSE(mComposerClient->getDisplayConnectionType(mInvalidDisplayId, &type).isOk()); - for (const auto& display : mDisplays) { - EXPECT_TRUE(mComposerClient->getDisplayConnectionType(display.get(), &type).isOk()); - } +TEST_P(GraphicsComposerAidlTest, SetClientTargetSlotCount) { + EXPECT_TRUE( + mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kBufferSlotCount).isOk()); } -TEST_P(GraphicsComposerAidlTest, getDisplayAttribute) { - for (const auto& display : mDisplays) { - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk()); - for (const auto& config : configs) { - const std::array requiredAttributes = {{ - DisplayAttribute::WIDTH, - DisplayAttribute::HEIGHT, - DisplayAttribute::VSYNC_PERIOD, - DisplayAttribute::CONFIG_GROUP, - }}; - int32_t value; - for (const auto& attribute : requiredAttributes) { - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, attribute, &value) - .isOk()); - EXPECT_NE(-1, value); - } +TEST_P(GraphicsComposerAidlTest, SetActiveConfig) { + std::vector configs; + EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); + for (auto config : configs) { + EXPECT_TRUE(mComposerClient->setActiveConfig(mPrimaryDisplay, config).isOk()); + int32_t config1; + EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk()); + EXPECT_EQ(config, config1); + } +} - const std::array optionalAttributes = {{ - DisplayAttribute::DPI_X, - DisplayAttribute::DPI_Y, - }}; - for (const auto& attribute : optionalAttributes) { - const auto error = mComposerClient->getDisplayAttribute(display.get(), config, - attribute, &value); - if (error.isOk()) { - EXPECT_EQ(EX_NONE, error.getServiceSpecificError()); - } else { - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); - } - } - } +TEST_P(GraphicsComposerAidlTest, SetActiveConfigPowerCycle) { + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk()); + + std::vector configs; + EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); + for (auto config : configs) { + EXPECT_TRUE(mComposerClient->setActiveConfig(mPrimaryDisplay, config).isOk()); + int32_t config1; + EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk()); + EXPECT_EQ(config, config1); + + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk()); + EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk()); + EXPECT_EQ(config, config1); } } -TEST_P(GraphicsComposerAidlTest, checkConfigsAreValid) { - for (const auto& display : mDisplays) { - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk()); +TEST_P(GraphicsComposerAidlTest, GetDozeSupportBadDisplay) { + bool isDozeSupport; + const auto error = mComposerClient->getDozeSupport(mInvalidDisplayId, &isDozeSupport); + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} - EXPECT_FALSE(std::any_of(configs.begin(), configs.end(), [](auto config) { - return config == IComposerClient::INVALID_CONFIGURATION; - })); +TEST_P(GraphicsComposerAidlTest, SetPowerModeUnsupported) { + bool isDozeSupported; + mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk(); + if (!isDozeSupported) { + auto error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + + error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE_SUSPEND); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); } } -TEST_P(GraphicsComposerAidlTest, getDisplayAttributeConfigsInAGroupDifferOnlyByVsyncPeriod) { - struct Resolution { - int32_t width; - int32_t height; - }; - struct Dpi { - int32_t x; - int32_t y; - }; - for (const auto& display : mDisplays) { - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk()); - std::unordered_map configGroupToResolutionMap; - std::unordered_map configGroupToDpiMap; - for (const auto& config : configs) { - int32_t configGroup = -1; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, - DisplayAttribute::CONFIG_GROUP, &configGroup) - .isOk()); - int32_t width = -1; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, - DisplayAttribute::WIDTH, &width) - .isOk()); - int32_t height = -1; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, - DisplayAttribute::HEIGHT, &height) - .isOk()); - if (configGroupToResolutionMap.find(configGroup) == configGroupToResolutionMap.end()) { - configGroupToResolutionMap[configGroup] = {width, height}; - } - EXPECT_EQ(configGroupToResolutionMap[configGroup].width, width); - EXPECT_EQ(configGroupToResolutionMap[configGroup].height, height); +TEST_P(GraphicsComposerAidlTest, SetVsyncEnabled) { + mComposerCallback->setVsyncAllowed(true); - int32_t dpiX = -1; - mComposerClient->getDisplayAttribute(display.get(), config, DisplayAttribute::DPI_X, - &dpiX); + EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, true).isOk()); + usleep(60 * 1000); + EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, false).isOk()); - int32_t dpiY = -1; - mComposerClient->getDisplayAttribute(display.get(), config, DisplayAttribute::DPI_Y, - &dpiY); - if (dpiX == -1 && dpiY == -1) { - continue; - } + mComposerCallback->setVsyncAllowed(false); +} - if (configGroupToDpiMap.find(configGroup) == configGroupToDpiMap.end()) { - configGroupToDpiMap[configGroup] = {dpiX, dpiY}; - } - EXPECT_EQ(configGroupToDpiMap[configGroup].x, dpiX); - EXPECT_EQ(configGroupToDpiMap[configGroup].y, dpiY); +TEST_P(GraphicsComposerAidlTest, SetPowerMode) { + std::vector modes; + modes.push_back(PowerMode::OFF); + modes.push_back(PowerMode::ON_SUSPEND); + modes.push_back(PowerMode::ON); + + bool isDozeSupported; + EXPECT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk()); + if (isDozeSupported) { + modes.push_back(PowerMode::DOZE); + modes.push_back(PowerMode::DOZE_SUSPEND); + } + + for (auto mode : modes) { + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + } +} + +TEST_P(GraphicsComposerAidlTest, SetPowerModeVariations) { + std::vector modes; + + modes.push_back(PowerMode::OFF); + modes.push_back(PowerMode::ON); + modes.push_back(PowerMode::OFF); + for (auto mode : modes) { + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + } + modes.clear(); + + modes.push_back(PowerMode::OFF); + modes.push_back(PowerMode::OFF); + for (auto mode : modes) { + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + } + modes.clear(); + + modes.push_back(PowerMode::ON); + modes.push_back(PowerMode::ON); + for (auto mode : modes) { + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + } + modes.clear(); + + modes.push_back(PowerMode::ON_SUSPEND); + modes.push_back(PowerMode::ON_SUSPEND); + for (auto mode : modes) { + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + } + modes.clear(); + + bool isDozeSupported = false; + ASSERT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk()); + if (isDozeSupported) { + modes.push_back(PowerMode::DOZE); + modes.push_back(PowerMode::DOZE); + for (auto mode : modes) { + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + } + modes.clear(); + + modes.push_back(PowerMode::DOZE_SUSPEND); + modes.push_back(PowerMode::DOZE_SUSPEND); + for (auto mode : modes) { + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); } } } -TEST_P(GraphicsComposerAidlTest, getDisplayVsyncPeriod_BadDisplay) { - int32_t vsyncPeriodNanos; - const auto error = mComposerClient->getDisplayVsyncPeriod(mInvalidDisplayId, &vsyncPeriodNanos); +TEST_P(GraphicsComposerAidlTest, SetPowerModeBadDisplay) { + const auto error = mComposerClient->setPowerMode(mInvalidDisplayId, PowerMode::ON); + EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, setActiveConfigWithConstraints_BadDisplay) { - VsyncPeriodChangeTimeline timeline; - VsyncPeriodChangeConstraints constraints; +TEST_P(GraphicsComposerAidlTest, SetPowerModeBadParameter) { + const auto error = mComposerClient->setPowerMode(mPrimaryDisplay, static_cast(-1)); - constraints.seamlessRequired = false; - constraints.desiredTimeNanos = systemTime(); - int32_t config = 0; - auto const error = mComposerClient->setActiveConfigWithConstraints(mInvalidDisplayId, config, - constraints, &timeline); + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError()); +} + +TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrix) { + std::vector matrix; + EXPECT_TRUE( + mComposerClient->getDataspaceSaturationMatrix(common::Dataspace::SRGB_LINEAR, &matrix) + .isOk()); + + // the last row is known + ASSERT_EQ(0.0f, matrix[12]); + ASSERT_EQ(0.0f, matrix[13]); + ASSERT_EQ(0.0f, matrix[14]); + ASSERT_EQ(1.0f, matrix[15]); +} + +TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrixBadParameter) { + std::vector matrix; + const auto error = + mComposerClient->getDataspaceSaturationMatrix(common::Dataspace::UNKNOWN, &matrix); EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, setActiveConfigWithConstraints_BadConfig) { - VsyncPeriodChangeTimeline timeline; - VsyncPeriodChangeConstraints constraints; +// Tests for Command. +class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { + protected: + void SetUp() override { + ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::SetUp()); - constraints.seamlessRequired = false; - constraints.desiredTimeNanos = systemTime(); + mWriter = std::make_unique(1024); + mReader = std::make_unique(); + } - for (VtsDisplay& display : mDisplays) { - int32_t invalidConfigId = GetInvalidConfigId(); - const auto error = - setActiveConfigWithConstraints(display, invalidConfigId, constraints, &timeline); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_CONFIG, error.getServiceSpecificError()); + void TearDown() override { + ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_EQ(0, mReader->mCompositionChanges.size()); + ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::TearDown()); } -} -TEST_P(GraphicsComposerAidlTest, setAutoLowLatencyModeBadDisplay) { - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, - mComposerClient->setAutoLowLatencyMode(mInvalidDisplayId, true) - .getServiceSpecificError()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, - mComposerClient->setAutoLowLatencyMode(mInvalidDisplayId, false) - .getServiceSpecificError()); -} + void execute() { + TestCommandReader* reader = mReader.get(); + CommandWriterBase* writer = mWriter.get(); + bool queueChanged = false; + int32_t commandLength = 0; + std::vector commandHandles; + ASSERT_TRUE(writer->writeQueue(&queueChanged, &commandLength, &commandHandles)); -TEST_P(GraphicsComposerAidlTest, setAutoLowLatencyMode) { - for (const auto& display : mDisplays) { - std::vector capabilities; - const auto error = mComposerClient->getDisplayCapabilities(display.get(), &capabilities); - EXPECT_TRUE(error.isOk()); + if (queueChanged) { + auto ret = mComposerClient->setInputCommandQueue(writer->getMQDescriptor()); + ASSERT_TRUE(ret.isOk()); + } - const bool allmSupport = - std::find(capabilities.begin(), capabilities.end(), - DisplayCapability::AUTO_LOW_LATENCY_MODE) != capabilities.end(); + ExecuteCommandsStatus commandStatus; + EXPECT_TRUE(mComposerClient->executeCommands(commandLength, commandHandles, &commandStatus) + .isOk()); + + if (commandStatus.queueChanged) { + MQDescriptor outputCommandQueue; + ASSERT_TRUE(mComposerClient->getOutputCommandQueue(&outputCommandQueue).isOk()); + reader->setMQDescriptor(outputCommandQueue); + } + ASSERT_TRUE(reader->readQueue(commandStatus.length, std::move(commandStatus.handles))); + reader->parse(); + reader->reset(); + writer->reset(); + } + + static inline auto toTimePoint(nsecs_t time) { + return std::chrono::time_point(std::chrono::nanoseconds(time)); + } + + void setActiveConfig(VtsDisplay& display, int32_t config) { + EXPECT_TRUE(mComposerClient->setActiveConfig(display.get(), config).isOk()); + int32_t displayWidth; + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(display.get(), config, DisplayAttribute::WIDTH, + &displayWidth) + .isOk()); + int32_t displayHeight; + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(display.get(), config, DisplayAttribute::HEIGHT, + &displayHeight) + .isOk()); + display.setDimensions(displayWidth, displayHeight); + } + + void forEachTwoConfigs(int64_t display, std::function func) { + std::vector displayConfigs; + EXPECT_TRUE(mComposerClient->getDisplayConfigs(display, &displayConfigs).isOk()); + for (const int32_t config1 : displayConfigs) { + for (const int32_t config2 : displayConfigs) { + if (config1 != config2) { + func(config1, config2); + } + } + } + } + + void waitForVsyncPeriodChange(int64_t display, const VsyncPeriodChangeTimeline& timeline, + int64_t desiredTimeNanos, int64_t oldPeriodNanos, + int64_t newPeriodNanos) { + const auto kChangeDeadline = toTimePoint(timeline.newVsyncAppliedTimeNanos) + 100ms; + while (std::chrono::steady_clock::now() <= kChangeDeadline) { + int32_t vsyncPeriodNanos; + EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display, &vsyncPeriodNanos).isOk()); + if (systemTime() <= desiredTimeNanos) { + EXPECT_EQ(vsyncPeriodNanos, oldPeriodNanos); + } else if (vsyncPeriodNanos == newPeriodNanos) { + break; + } + std::this_thread::sleep_for(std::chrono::nanoseconds(oldPeriodNanos)); + } + } + + sp allocate() { + return sp::make( + static_cast(mDisplayWidth), static_cast(mDisplayHeight), + ::android::PIXEL_FORMAT_RGBA_8888, + /*layerCount*/ 1, + (static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | + static_cast(common::BufferUsage::CPU_READ_OFTEN) | + static_cast(common::BufferUsage::COMPOSER_OVERLAY)), + "VtsHalGraphicsComposer3_TargetTest"); + } + + void sendRefreshFrame(const VtsDisplay& display, const VsyncPeriodChangeTimeline* timeline) { + if (timeline != nullptr) { + // Refresh time should be before newVsyncAppliedTimeNanos + EXPECT_LT(timeline->refreshTimeNanos, timeline->newVsyncAppliedTimeNanos); + + std::this_thread::sleep_until(toTimePoint(timeline->refreshTimeNanos)); + } + + mWriter->selectDisplay(display.get()); + EXPECT_TRUE(mComposerClient->setPowerMode(display.get(), PowerMode::ON).isOk()); + EXPECT_TRUE( + mComposerClient + ->setColorMode(display.get(), ColorMode::NATIVE, RenderIntent::COLORIMETRIC) + .isOk()); + + int64_t layer = 0; + ASSERT_NO_FATAL_FAILURE(layer = createLayer(display)); + { + auto buffer = allocate(); + ASSERT_NE(nullptr, buffer); + ASSERT_EQ(::android::OK, buffer->initCheck()); + ASSERT_NE(nullptr, buffer->handle); + + mWriter->selectLayer(layer); + mWriter->setLayerCompositionType(Composition::DEVICE); + mWriter->setLayerDisplayFrame(display.getFrameRect()); + mWriter->setLayerPlaneAlpha(1); + mWriter->setLayerSourceCrop(display.getCrop()); + mWriter->setLayerTransform(static_cast(0)); + mWriter->setLayerVisibleRegion(std::vector(1, display.getFrameRect())); + mWriter->setLayerZOrder(10); + mWriter->setLayerBlendMode(BlendMode::NONE); + mWriter->setLayerSurfaceDamage(std::vector(1, display.getFrameRect())); + mWriter->setLayerBuffer(0, buffer->handle, -1); + mWriter->setLayerDataspace(common::Dataspace::UNKNOWN); + + mWriter->validateDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + mReader->mCompositionChanges.clear(); + + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + } + + { + auto buffer = allocate(); + ASSERT_NE(nullptr, buffer->handle); + + mWriter->selectLayer(layer); + mWriter->setLayerBuffer(0, buffer->handle, -1); + mWriter->setLayerSurfaceDamage(std::vector(1, {0, 0, 10, 10})); + mWriter->validateDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + mReader->mCompositionChanges.clear(); + + mWriter->presentDisplay(); + execute(); + } + + ASSERT_NO_FATAL_FAILURE(destroyLayer(display, layer)); + } + + void Test_setActiveConfigWithConstraints(const TestParameters& params) { + for (VtsDisplay& display : mDisplays) { + forEachTwoConfigs(display.get(), [&](int32_t config1, int32_t config2) { + setActiveConfig(display, config1); + sendRefreshFrame(display, nullptr); + + int32_t vsyncPeriod1; + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(display.get(), config1, + DisplayAttribute::VSYNC_PERIOD, + &vsyncPeriod1) + .isOk()); + int32_t configGroup1; + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(display.get(), config1, + DisplayAttribute::CONFIG_GROUP, + &configGroup1) + .isOk()); + int32_t vsyncPeriod2; + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(display.get(), config2, + DisplayAttribute::VSYNC_PERIOD, + &vsyncPeriod2) + .isOk()); + int32_t configGroup2; + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(display.get(), config2, + DisplayAttribute::CONFIG_GROUP, + &configGroup2) + .isOk()); + + if (vsyncPeriod1 == vsyncPeriod2) { + return; // continue + } + + // We don't allow delayed change when changing config groups + if (params.delayForChange > 0 && configGroup1 != configGroup2) { + return; // continue + } + + VsyncPeriodChangeTimeline timeline; + VsyncPeriodChangeConstraints constraints = { + .desiredTimeNanos = systemTime() + params.delayForChange, + .seamlessRequired = false}; + EXPECT_TRUE(setActiveConfigWithConstraints(display, config2, constraints, &timeline) + .isOk()); + + 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 (timeline.refreshRequired) { + if (params.refreshMiss) { + // Miss the refresh frame on purpose to make sure the implementation sends a + // callback + std::this_thread::sleep_until(toTimePoint(timeline.refreshTimeNanos) + + 100ms); + } + sendRefreshFrame(display, &timeline); + } + waitForVsyncPeriodChange(display.get(), timeline, constraints.desiredTimeNanos, + vsyncPeriod1, vsyncPeriod2); + + // At this point the refresh rate should have changed already, however in rare + // cases the implementation might have missed the deadline. In this case a new + // timeline should have been provided. + auto newTimeline = mComposerCallback->takeLastVsyncPeriodChangeTimeline(); + if (timeline.refreshRequired && params.refreshMiss) { + EXPECT_TRUE(newTimeline.has_value()); + } + + if (newTimeline.has_value()) { + if (newTimeline->refreshRequired) { + sendRefreshFrame(display, &newTimeline.value()); + } + waitForVsyncPeriodChange(display.get(), newTimeline.value(), + constraints.desiredTimeNanos, vsyncPeriod1, + vsyncPeriod2); + } - if (!allmSupport) { - const auto errorIsOn = mComposerClient->setAutoLowLatencyMode(display.get(), true); - EXPECT_FALSE(errorIsOn.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, errorIsOn.getServiceSpecificError()); - const auto errorIsOff = mComposerClient->setAutoLowLatencyMode(display.get(), false); - EXPECT_FALSE(errorIsOff.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, errorIsOff.getServiceSpecificError()); - GTEST_SUCCEED() << "Auto Low Latency Mode is not supported on display " - << std::to_string(display.get()) << ", skipping test"; - return; + int32_t vsyncPeriodNanos; + EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display.get(), &vsyncPeriodNanos) + .isOk()); + EXPECT_EQ(vsyncPeriodNanos, vsyncPeriod2); + }); } - - EXPECT_TRUE(mComposerClient->setAutoLowLatencyMode(display.get(), true).isOk()); - EXPECT_TRUE(mComposerClient->setAutoLowLatencyMode(display.get(), false).isOk()); } + + // clang-format off + const std::array kIdentity = {{ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f, + }}; + // clang-format on + + std::unique_ptr mWriter; + std::unique_ptr mReader; +}; + +TEST_P(GraphicsComposerAidlCommandTest, SET_COLOR_TRANSFORM) { + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->setColorTransform(kIdentity.data(), ColorTransform::IDENTITY); + execute(); } -TEST_P(GraphicsComposerAidlTest, getSupportedContentTypesBadDisplay) { - std::vector supportedContentTypes; - const auto error = - mComposerClient->getSupportedContentTypes(mInvalidDisplayId, &supportedContentTypes); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerColorTransform) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerColorTransform(kIdentity.data()); + execute(); + + if (mReader->mErrors.size() == 1 && mReader->mErrors[0].second == EX_UNSUPPORTED_OPERATION) { + mReader->mErrors.clear(); + GTEST_SUCCEED() << "setLayerColorTransform is not supported"; + return; + } } -TEST_P(GraphicsComposerAidlTest, getSupportedContentTypes) { - std::vector supportedContentTypes; - for (const auto& display : mDisplays) { - supportedContentTypes.clear(); - const auto error = - mComposerClient->getSupportedContentTypes(display.get(), &supportedContentTypes); +TEST_P(GraphicsComposerAidlCommandTest, SET_CLIENT_TARGET) { + EXPECT_TRUE( + mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kBufferSlotCount).isOk()); - ASSERT_TRUE(error.isOk()); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->setClientTarget(0, nullptr, -1, Dataspace::UNKNOWN, std::vector()); - const bool noneSupported = - std::find(supportedContentTypes.begin(), supportedContentTypes.end(), - ContentType::NONE) != supportedContentTypes.end(); - EXPECT_FALSE(noneSupported); - } + execute(); } -TEST_P(GraphicsComposerAidlTest, setContentTypeNoneAlwaysAccepted) { - for (const auto& display : mDisplays) { - const auto error = mComposerClient->setContentType(display.get(), ContentType::NONE); - EXPECT_TRUE(error.isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SET_OUTPUT_BUFFER) { + int32_t virtualDisplayCount; + EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&virtualDisplayCount).isOk()); + if (virtualDisplayCount == 0) { + GTEST_SUCCEED() << "no virtual display support"; + return; } -} -TEST_P(GraphicsComposerAidlTest, setContentTypeBadDisplay) { - constexpr ContentType types[] = {ContentType::NONE, ContentType::GRAPHICS, ContentType::PHOTO, - ContentType::CINEMA, ContentType::GAME}; - for (const auto& type : types) { - auto const error = mComposerClient->setContentType(mInvalidDisplayId, type); + VirtualDisplay display; + EXPECT_TRUE(mComposerClient + ->createVirtualDisplay(64, 64, common::PixelFormat::IMPLEMENTATION_DEFINED, + kBufferSlotCount, &display) + .isOk()); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); - } + mWriter->selectDisplay(display.display); + auto handle = allocate()->handle; + mWriter->setOutputBuffer(0, handle, -1); + execute(); } -TEST_P(GraphicsComposerAidlTest, setGraphicsContentType) { - Test_setContentType(ContentType::GRAPHICS, "GRAPHICS"); +TEST_P(GraphicsComposerAidlCommandTest, VALIDATE_DISPLAY) { + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->validateDisplay(); + execute(); } -TEST_P(GraphicsComposerAidlTest, setPhotoContentType) { - Test_setContentType(ContentType::PHOTO, "PHOTO"); +TEST_P(GraphicsComposerAidlCommandTest, ACCEPT_DISPLAY_CHANGES) { + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->validateDisplay(); + mWriter->acceptDisplayChanges(); + execute(); } -TEST_P(GraphicsComposerAidlTest, setCinemaContentType) { - Test_setContentType(ContentType::CINEMA, "CINEMA"); +// TODO(b/208441745) fix the test failure +TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY) { + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->validateDisplay(); + mWriter->presentDisplay(); + execute(); } -TEST_P(GraphicsComposerAidlTest, setGameContentType) { - Test_setContentType(ContentType::GAME, "GAME"); -} +/** + * Test IComposerClient::Command::PRESENT_DISPLAY + * + * Test that IComposerClient::Command::PRESENT_DISPLAY works without + * additional call to validateDisplay when only the layer buffer handle and + * surface damage have been set + */ +// TODO(b/208441745) fix the test failure +TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) { + std::vector capabilities; + EXPECT_TRUE(mComposer->getCapabilities(&capabilities).isOk()); + if (none_of(capabilities.begin(), capabilities.end(), + [&](auto item) { return item == Capability::SKIP_VALIDATE; })) { + GTEST_SUCCEED() << "Device does not have skip validate capability, skipping"; + return; + } + mWriter->selectDisplay(mPrimaryDisplay); + mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON); -TEST_P(GraphicsComposerAidlTest, getLayerGenericMetadataKeys) { - std::vector keys; - EXPECT_TRUE(mComposerClient->getLayerGenericMetadataKeys(&keys).isOk()); + std::vector renderIntents; + mComposerClient->getRenderIntents(mPrimaryDisplay, ColorMode::NATIVE, &renderIntents); + for (auto intent : renderIntents) { + mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE, intent); - std::regex reverseDomainName("^[a-zA-Z-]{2,}(\\.[a-zA-Z0-9-]+)+$"); - std::unordered_set uniqueNames; - for (const auto& key : keys) { - std::string name(key.name); + auto handle = allocate()->handle; + ASSERT_NE(nullptr, handle); - // Keys must not start with 'android' or 'com.android' - EXPECT_FALSE(name.find("android") == 0); - EXPECT_FALSE(name.find("com.android") == 0); + Rect displayFrame{0, 0, mDisplayWidth, mDisplayHeight}; - // Keys must be in reverse domain name format - EXPECT_TRUE(std::regex_match(name, reverseDomainName)); + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); + mWriter->selectLayer(layer); + mWriter->setLayerCompositionType(Composition::DEVICE); + mWriter->setLayerDisplayFrame(displayFrame); + mWriter->setLayerPlaneAlpha(1); + mWriter->setLayerSourceCrop({0, 0, (float)mDisplayWidth, (float)mDisplayHeight}); + mWriter->setLayerTransform(static_cast(0)); + mWriter->setLayerVisibleRegion(std::vector(1, displayFrame)); + mWriter->setLayerZOrder(10); + mWriter->setLayerBlendMode(BlendMode::NONE); + mWriter->setLayerSurfaceDamage(std::vector(1, displayFrame)); + mWriter->setLayerBuffer(0, handle, -1); + mWriter->setLayerDataspace(Dataspace::UNKNOWN); + + mWriter->validateDisplay(); + execute(); + if (mReader->mCompositionChanges.size() != 0) { + GTEST_SUCCEED() << "Composition change requested, skipping test"; + return; + } - // Keys must be unique within this list - const auto& [iter, inserted] = uniqueNames.insert(name); - EXPECT_TRUE(inserted); - } -} + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); -TEST_P(GraphicsComposerAidlTest, CreateVirtualDisplay) { - int32_t maxVirtualDisplayCount; - EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&maxVirtualDisplayCount).isOk()); - if (maxVirtualDisplayCount == 0) { - GTEST_SUCCEED() << "no virtual display support"; - return; + mWriter->selectLayer(layer); + auto handle2 = allocate()->handle; + ASSERT_NE(nullptr, handle2); + mWriter->setLayerBuffer(0, handle2, -1); + mWriter->setLayerSurfaceDamage(std::vector(1, {0, 0, 10, 10})); + mWriter->presentDisplay(); + execute(); } +} - VirtualDisplay virtualDisplay; - - EXPECT_TRUE(mComposerClient - ->createVirtualDisplay(64, 64, common::PixelFormat::IMPLEMENTATION_DEFINED, - kBufferSlotCount, &virtualDisplay) - .isOk()); +// TODO(b/208441745) fix the test failure +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_CURSOR_POSITION) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - ASSERT_TRUE(mDisplayResources.insert({virtualDisplay.display, DisplayResource(true)}).second) - << "duplicated virtual display id " << virtualDisplay.display; + auto handle = allocate()->handle; + ASSERT_NE(nullptr, handle); + Rect displayFrame{0, 0, mDisplayWidth, mDisplayHeight}; - EXPECT_TRUE(mComposerClient->destroyVirtualDisplay(virtualDisplay.display).isOk()); -} + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerBuffer(0, handle, -1); + mWriter->setLayerCompositionType(Composition::CURSOR); + mWriter->setLayerDisplayFrame(displayFrame); + mWriter->setLayerPlaneAlpha(1); + mWriter->setLayerSourceCrop({0, 0, (float)mDisplayWidth, (float)mDisplayHeight}); + mWriter->setLayerTransform(static_cast(0)); + mWriter->setLayerVisibleRegion(std::vector(1, displayFrame)); + mWriter->setLayerZOrder(10); + mWriter->setLayerBlendMode(BlendMode::NONE); + mWriter->setLayerSurfaceDamage(std::vector(1, displayFrame)); + mWriter->setLayerDataspace(Dataspace::UNKNOWN); + mWriter->validateDisplay(); -TEST_P(GraphicsComposerAidlTest, DestroyVirtualDisplayBadDisplay) { - int32_t maxDisplayCount = 0; - EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&maxDisplayCount).isOk()); - if (maxDisplayCount == 0) { - GTEST_SUCCEED() << "no virtual display support"; + execute(); + if (mReader->mCompositionChanges.size() != 0) { + GTEST_SUCCEED() << "Composition change requested, skipping test"; return; } - const auto error = mComposerClient->destroyVirtualDisplay(mInvalidDisplayId); + mWriter->presentDisplay(); + ASSERT_EQ(0, mReader->mErrors.size()); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + mWriter->setLayerCursorPosition(1, 1); + mWriter->setLayerCursorPosition(0, 0); + mWriter->validateDisplay(); + mWriter->presentDisplay(); + execute(); } -TEST_P(GraphicsComposerAidlTest, CreateLayer) { +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BUFFER) { + auto handle = allocate()->handle; + ASSERT_NE(nullptr, handle); + int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk()); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerBuffer(0, handle, -1); + execute(); } -TEST_P(GraphicsComposerAidlTest, CreateLayerBadDisplay) { +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SURFACE_DAMAGE) { int64_t layer; - const auto error = mComposerClient->createLayer(mInvalidDisplayId, kBufferSlotCount, &layer); + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + Rect empty{0, 0, 0, 0}; + Rect unit{0, 0, 1, 1}; + + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerSurfaceDamage(std::vector(1, empty)); + mWriter->setLayerSurfaceDamage(std::vector(1, unit)); + mWriter->setLayerSurfaceDamage(std::vector()); + execute(); } -TEST_P(GraphicsComposerAidlTest, DestroyLayerBadDisplay) { +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BLEND_MODE) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - const auto error = mComposerClient->destroyLayer(mInvalidDisplayId, layer); - - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); - EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk()); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerBlendMode(BlendMode::NONE); + mWriter->setLayerBlendMode(BlendMode::PREMULTIPLIED); + mWriter->setLayerBlendMode(BlendMode::COVERAGE); + execute(); } -TEST_P(GraphicsComposerAidlTest, DestroyLayerBadLayerError) { - // We haven't created any layers yet, so any id should be invalid - const auto error = mComposerClient->destroyLayer(mPrimaryDisplay, 1); +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_COLOR) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_LAYER, error.getServiceSpecificError()); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerColor(Color{static_cast(0xff), static_cast(0xff), + static_cast(0xff), static_cast(0xff)}); + mWriter->setLayerColor(Color{0, 0, 0, 0}); + execute(); } -TEST_P(GraphicsComposerAidlTest, GetActiveConfigBadDisplay) { - int32_t config; - const auto error = mComposerClient->getActiveConfig(mInvalidDisplayId, &config); - - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); -} +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_COMPOSITION_TYPE) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); -TEST_P(GraphicsComposerAidlTest, GetDisplayConfig) { - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerCompositionType(Composition::CLIENT); + mWriter->setLayerCompositionType(Composition::DEVICE); + mWriter->setLayerCompositionType(Composition::SOLID_COLOR); + mWriter->setLayerCompositionType(Composition::CURSOR); + execute(); } -TEST_P(GraphicsComposerAidlTest, GetDisplayConfigBadDisplay) { - std::vector configs; - const auto error = mComposerClient->getDisplayConfigs(mInvalidDisplayId, &configs); - - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); -} +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_DATASPACE) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); -TEST_P(GraphicsComposerAidlTest, GetDisplayName) { - std::string displayName; - EXPECT_TRUE(mComposerClient->getDisplayName(mPrimaryDisplay, &displayName).isOk()); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerDataspace(Dataspace::UNKNOWN); + execute(); } -TEST_P(GraphicsComposerAidlTest, SetClientTargetSlotCount) { - EXPECT_TRUE( - mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kBufferSlotCount).isOk()); -} +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_DISPLAY_FRAME) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); -TEST_P(GraphicsComposerAidlTest, SetActiveConfig) { - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); - for (auto config : configs) { - EXPECT_TRUE(mComposerClient->setActiveConfig(mPrimaryDisplay, config).isOk()); - int32_t config1; - EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk()); - EXPECT_EQ(config, config1); - } + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerDisplayFrame(Rect{0, 0, 1, 1}); + execute(); } -TEST_P(GraphicsComposerAidlTest, SetActiveConfigPowerCycle) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk()); - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk()); - - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); - for (auto config : configs) { - EXPECT_TRUE(mComposerClient->setActiveConfig(mPrimaryDisplay, config).isOk()); - int32_t config1; - EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk()); - EXPECT_EQ(config, config1); +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_PLANE_ALPHA) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk()); - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk()); - EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk()); - EXPECT_EQ(config, config1); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerPlaneAlpha(0.0f); + mWriter->setLayerPlaneAlpha(1.0f); + execute(); +} + +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SIDEBAND_STREAM) { + std::vector capabilities; + EXPECT_TRUE(mComposer->getCapabilities(&capabilities).isOk()); + if (none_of(capabilities.begin(), capabilities.end(), + [&](auto& item) { return item == Capability::SIDEBAND_STREAM; })) { + GTEST_SUCCEED() << "no sideband stream support"; + return; } + + auto handle = allocate()->handle; + ASSERT_NE(nullptr, handle); + + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); + + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerSidebandStream(handle); + execute(); } -TEST_P(GraphicsComposerAidlTest, GetDozeSupportBadDisplay) { - bool isDozeSupport; - const auto error = mComposerClient->getDozeSupport(mInvalidDisplayId, &isDozeSupport); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SOURCE_CROP) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); + + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerSourceCrop(FRect{0.0f, 0.0f, 1.0f, 1.0f}); + execute(); } -TEST_P(GraphicsComposerAidlTest, SetPowerModeUnsupported) { - bool isDozeSupported; - mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk(); - if (!isDozeSupported) { - auto error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_TRANSFORM) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE_SUSPEND); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); - } + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerTransform(static_cast(0)); + mWriter->setLayerTransform(Transform::FLIP_H); + mWriter->setLayerTransform(Transform::FLIP_V); + mWriter->setLayerTransform(Transform::ROT_90); + mWriter->setLayerTransform(Transform::ROT_180); + mWriter->setLayerTransform(Transform::ROT_270); + mWriter->setLayerTransform(static_cast(static_cast(Transform::FLIP_H) | + static_cast(Transform::ROT_90))); + mWriter->setLayerTransform(static_cast(static_cast(Transform::FLIP_V) | + static_cast(Transform::ROT_90))); + execute(); } -TEST_P(GraphicsComposerAidlTest, SetVsyncEnabled) { - mComposerCallback->setVsyncAllowed(true); +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_VISIBLE_REGION) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, true).isOk()); - usleep(60 * 1000); - EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, false).isOk()); + Rect empty{0, 0, 0, 0}; + Rect unit{0, 0, 1, 1}; - mComposerCallback->setVsyncAllowed(false); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerVisibleRegion(std::vector(1, empty)); + mWriter->setLayerVisibleRegion(std::vector(1, unit)); + mWriter->setLayerVisibleRegion(std::vector()); + execute(); } -TEST_P(GraphicsComposerAidlTest, SetPowerMode) { - std::vector modes; - modes.push_back(PowerMode::OFF); - modes.push_back(PowerMode::ON_SUSPEND); - modes.push_back(PowerMode::ON); - - bool isDozeSupported; - EXPECT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk()); - if (isDozeSupported) { - modes.push_back(PowerMode::DOZE); - modes.push_back(PowerMode::DOZE_SUSPEND); - } +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_Z_ORDER) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); - } + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); + mWriter->setLayerZOrder(10); + mWriter->setLayerZOrder(0); + execute(); } -TEST_P(GraphicsComposerAidlTest, SetPowerModeVariations) { - std::vector modes; +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_PER_FRAME_METADATA) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - modes.push_back(PowerMode::OFF); - modes.push_back(PowerMode::ON); - modes.push_back(PowerMode::OFF); - for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); - } - modes.clear(); + mWriter->selectDisplay(mPrimaryDisplay); + mWriter->selectLayer(layer); - modes.push_back(PowerMode::OFF); - modes.push_back(PowerMode::OFF); - for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); - } - modes.clear(); + /** + * DISPLAY_P3 is a color space that uses the DCI_P3 primaries, + * the D65 white point and the SRGB transfer functions. + * Rendering Intent: Colorimetric + * Primaries: + * x y + * green 0.265 0.690 + * blue 0.150 0.060 + * red 0.680 0.320 + * white (D65) 0.3127 0.3290 + */ - modes.push_back(PowerMode::ON); - modes.push_back(PowerMode::ON); - for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); - } - modes.clear(); + std::vector aidlMetadata; + aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_RED_PRIMARY_X, 0.680f}); + aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_RED_PRIMARY_Y, 0.320f}); + aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_GREEN_PRIMARY_X, 0.265f}); + aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_GREEN_PRIMARY_Y, 0.690f}); + aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_X, 0.150f}); + aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_Y, 0.060f}); + aidlMetadata.push_back({PerFrameMetadataKey::WHITE_POINT_X, 0.3127f}); + aidlMetadata.push_back({PerFrameMetadataKey::WHITE_POINT_Y, 0.3290f}); + aidlMetadata.push_back({PerFrameMetadataKey::MAX_LUMINANCE, 100.0f}); + aidlMetadata.push_back({PerFrameMetadataKey::MIN_LUMINANCE, 0.1f}); + aidlMetadata.push_back({PerFrameMetadataKey::MAX_CONTENT_LIGHT_LEVEL, 78.0}); + aidlMetadata.push_back({PerFrameMetadataKey::MAX_FRAME_AVERAGE_LIGHT_LEVEL, 62.0}); + mWriter->setLayerPerFrameMetadata(aidlMetadata); + execute(); - modes.push_back(PowerMode::ON_SUSPEND); - modes.push_back(PowerMode::ON_SUSPEND); - for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + if (mReader->mErrors.size() == 1 && mReader->mErrors[0].second == EX_UNSUPPORTED_OPERATION) { + mReader->mErrors.clear(); + GTEST_SUCCEED() << "SetLayerPerFrameMetadata is not supported"; + EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk()); + return; } - modes.clear(); - bool isDozeSupported = false; - ASSERT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk()); - if (isDozeSupported) { - modes.push_back(PowerMode::DOZE); - modes.push_back(PowerMode::DOZE); - for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); - } - modes.clear(); + EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk()); +} - modes.push_back(PowerMode::DOZE_SUSPEND); - modes.push_back(PowerMode::DOZE_SUSPEND); - for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); - } - } +TEST_P(GraphicsComposerAidlCommandTest, setActiveConfigWithConstraints) { + Test_setActiveConfigWithConstraints({.delayForChange = 0, .refreshMiss = false}); } -TEST_P(GraphicsComposerAidlTest, SetPowerModeBadDisplay) { - const auto error = mComposerClient->setPowerMode(mInvalidDisplayId, PowerMode::ON); +TEST_P(GraphicsComposerAidlCommandTest, setActiveConfigWithConstraints_Delayed) { + Test_setActiveConfigWithConstraints({.delayForChange = 300'000'000, // 300ms + .refreshMiss = false}); +} - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +TEST_P(GraphicsComposerAidlCommandTest, setActiveConfigWithConstraints_MissRefresh) { + Test_setActiveConfigWithConstraints({.delayForChange = 0, .refreshMiss = true}); } -TEST_P(GraphicsComposerAidlTest, SetPowerModeBadParameter) { - const auto error = mComposerClient->setPowerMode(mPrimaryDisplay, static_cast(-1)); +TEST_P(GraphicsComposerAidlCommandTest, getDisplayVsyncPeriod) { + for (VtsDisplay& display : mDisplays) { + std::vector configs; + EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk()); + for (int32_t config : configs) { + int32_t expectedVsyncPeriodNanos = -1; + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(display.get(), config, + DisplayAttribute::VSYNC_PERIOD, + &expectedVsyncPeriodNanos) + .isOk()); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError()); -} + VsyncPeriodChangeTimeline timeline; + VsyncPeriodChangeConstraints constraints; -TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrix) { - std::vector matrix; - EXPECT_TRUE( - mComposerClient->getDataspaceSaturationMatrix(common::Dataspace::SRGB_LINEAR, &matrix) - .isOk()); + constraints.desiredTimeNanos = systemTime(); + constraints.seamlessRequired = false; + EXPECT_TRUE(mComposerClient + ->setActiveConfigWithConstraints(display.get(), config, constraints, + &timeline) + .isOk()); - // the last row is known - ASSERT_EQ(0.0f, matrix[12]); - ASSERT_EQ(0.0f, matrix[13]); - ASSERT_EQ(0.0f, matrix[14]); - ASSERT_EQ(1.0f, matrix[15]); + if (timeline.refreshRequired) { + sendRefreshFrame(display, &timeline); + } + waitForVsyncPeriodChange(display.get(), timeline, constraints.desiredTimeNanos, 0, + expectedVsyncPeriodNanos); + + int32_t vsyncPeriodNanos; + int retryCount = 100; + do { + std::this_thread::sleep_for(10ms); + vsyncPeriodNanos = 0; + EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display.get(), &vsyncPeriodNanos) + .isOk()); + --retryCount; + } while (vsyncPeriodNanos != expectedVsyncPeriodNanos && retryCount > 0); + + EXPECT_EQ(vsyncPeriodNanos, expectedVsyncPeriodNanos); + + // Make sure that the vsync period stays the same if the active config is not + // changed. + auto timeout = 1ms; + for (int i = 0; i < 10; i++) { + std::this_thread::sleep_for(timeout); + timeout *= 2; + vsyncPeriodNanos = 0; + EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display.get(), &vsyncPeriodNanos) + .isOk()); + EXPECT_EQ(vsyncPeriodNanos, expectedVsyncPeriodNanos); + } + } + } } -TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrixBadParameter) { - std::vector matrix; - const auto error = - mComposerClient->getDataspaceSaturationMatrix(common::Dataspace::UNKNOWN, &matrix); +TEST_P(GraphicsComposerAidlCommandTest, setActiveConfigWithConstraints_SeamlessNotAllowed) { + VsyncPeriodChangeTimeline timeline; + VsyncPeriodChangeConstraints constraints; - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError()); + constraints.seamlessRequired = true; + constraints.desiredTimeNanos = systemTime(); + + for (VtsDisplay& display : mDisplays) { + forEachTwoConfigs(display.get(), [&](int32_t config1, int32_t config2) { + int32_t configGroup1; + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(display.get(), config1, + DisplayAttribute::CONFIG_GROUP, &configGroup1) + .isOk()); + int32_t configGroup2; + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(display.get(), config2, + DisplayAttribute::CONFIG_GROUP, &configGroup2) + .isOk()); + if (configGroup1 != configGroup2) { + setActiveConfig(display, config1); + sendRefreshFrame(display, nullptr); + EXPECT_EQ(IComposerClient::EX_SEAMLESS_NOT_ALLOWED, + setActiveConfigWithConstraints(display, config2, constraints, &timeline) + .getServiceSpecificError()); + } + }); + } } +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, GraphicsComposerAidlCommandTest, + testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)), + ::android::PrintInstanceNameToString); + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlTest); INSTANTIATE_TEST_SUITE_P( PerInstance, GraphicsComposerAidlTest, -- GitLab From 7b1428f3f3d652527c1186fb1459fe9efb436ccb Mon Sep 17 00:00:00 2001 From: Chris Weir Date: Mon, 22 Nov 2021 09:59:07 -0800 Subject: [PATCH 302/825] Add default implementation for Nlinterceptor Add default Netlink Interceptor implementation Bug: 201467304 Test: atest VtsHalNetlinkInterceptorV1_0Test Change-Id: I7c765f9528a3d5be85bf5554e22eae51c1607548 --- .../compatibility_matrix.current.xml | 7 + .../aidl/default/Android.bp | 39 ++++ .../aidl/default/InterceptorRelay.cpp | 129 +++++++++++++ .../aidl/default/InterceptorRelay.h | 93 ++++++++++ .../aidl/default/NetlinkInterceptor.cpp | 121 ++++++++++++ .../aidl/default/NetlinkInterceptor.h | 57 ++++++ wifi/netlinkinterceptor/aidl/default/OWNERS | 2 + .../aidl/default/nlinterceptor-default.rc | 4 + .../aidl/default/nlinterceptor-default.xml | 9 + .../aidl/default/service.cpp | 47 +++++ wifi/netlinkinterceptor/aidl/default/util.cpp | 29 +++ wifi/netlinkinterceptor/aidl/default/util.h | 52 ++++++ .../libnlinterceptor/Android.bp | 56 ++++++ .../libnlinterceptor/libnlinterceptor.h | 131 +++++++++++++ .../libnlinterceptor/libnlinterceptor.cpp | 174 ++++++++++++++++++ 15 files changed, 950 insertions(+) create mode 100644 wifi/netlinkinterceptor/aidl/default/Android.bp create mode 100644 wifi/netlinkinterceptor/aidl/default/InterceptorRelay.cpp create mode 100644 wifi/netlinkinterceptor/aidl/default/InterceptorRelay.h create mode 100644 wifi/netlinkinterceptor/aidl/default/NetlinkInterceptor.cpp create mode 100644 wifi/netlinkinterceptor/aidl/default/NetlinkInterceptor.h create mode 100644 wifi/netlinkinterceptor/aidl/default/OWNERS create mode 100644 wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.rc create mode 100644 wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.xml create mode 100644 wifi/netlinkinterceptor/aidl/default/service.cpp create mode 100644 wifi/netlinkinterceptor/aidl/default/util.cpp create mode 100644 wifi/netlinkinterceptor/aidl/default/util.h create mode 100644 wifi/netlinkinterceptor/libnlinterceptor/Android.bp create mode 100644 wifi/netlinkinterceptor/libnlinterceptor/include/libnlinterceptor/libnlinterceptor.h create mode 100644 wifi/netlinkinterceptor/libnlinterceptor/libnlinterceptor.cpp diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 5e6584996b..7ae1425fca 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -324,6 +324,13 @@ default + + android.hardware.net.nlinterceptor + + IInterceptor + default + + android.hardware.oemlock 1 diff --git a/wifi/netlinkinterceptor/aidl/default/Android.bp b/wifi/netlinkinterceptor/aidl/default/Android.bp new file mode 100644 index 0000000000..686ff19c3d --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/default/Android.bp @@ -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. +// + +cc_binary { + name: "android.hardware.net.nlinterceptor-service.default", + init_rc: ["nlinterceptor-default.rc"], + vintf_fragments: ["nlinterceptor-default.xml"], + vendor: true, + relative_install_path: "hw", + defaults: ["nlinterceptor@defaults"], + shared_libs: [ + "android.hardware.net.nlinterceptor-V1-ndk", + "libbase", + "libbinder_ndk", + ], + static_libs: [ + "libnlinterceptor", + "libnl++", + ], + srcs: [ + "InterceptorRelay.cpp", + "NetlinkInterceptor.cpp", + "service.cpp", + "util.cpp", + ], +} diff --git a/wifi/netlinkinterceptor/aidl/default/InterceptorRelay.cpp b/wifi/netlinkinterceptor/aidl/default/InterceptorRelay.cpp new file mode 100644 index 0000000000..ded9122a6f --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/default/InterceptorRelay.cpp @@ -0,0 +1,129 @@ +/* + * 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 "InterceptorRelay.h" + +#include +#include +#include + +#include + +#include "util.h" + +namespace android::nlinterceptor { +using namespace std::chrono_literals; + +static constexpr std::chrono::milliseconds kPollTimeout = 300ms; +static constexpr bool kSuperVerbose = true; + +InterceptorRelay::InterceptorRelay(uint32_t nlFamily, uint32_t clientNlPid, + const std::string& clientName) + : mClientName(clientName), + mNlSocket(std::make_optional(nlFamily, 0, 0)), + mClientNlPid(clientNlPid) {} + +InterceptorRelay::~InterceptorRelay() { + mRunning = false; + if (mRelayThread.joinable()) mRelayThread.join(); +} + +uint32_t InterceptorRelay::getPid() { + auto pidMaybe = mNlSocket->getPid(); + CHECK(pidMaybe.has_value()) << "Failed to get pid of nl::Socket!"; + return *pidMaybe; +} + +void InterceptorRelay::relayMessages() { + pollfd fds[] = { + mNlSocket->preparePoll(POLLIN), + }; + while (mRunning) { + if (poll(fds, countof(fds), kPollTimeout.count()) < 0) { + PLOG(FATAL) << "poll failed"; + return; + } + const auto nlsockEvents = fds[0].revents; + + if (isSocketBad(nlsockEvents)) { + LOG(ERROR) << "Netlink socket is bad"; + mRunning = false; + return; + } + if (!isSocketReadable(nlsockEvents)) continue; + + const auto [msgMaybe, sa] = mNlSocket->receiveFrom(); + if (!msgMaybe.has_value()) { + LOG(ERROR) << "Failed to receive Netlink data!"; + mRunning = false; + return; + } + const auto msg = *msgMaybe; + if (!msg.firstOk()) { + LOG(ERROR) << "Netlink packet is malformed!"; + // Test messages might be empty, this isn't fatal. + continue; + } + if constexpr (kSuperVerbose) { + LOG(VERBOSE) << "[" << mClientName + << "] nlMsg: " << nl::toString(msg, NETLINK_GENERIC); + } + + uint32_t destinationPid = 0; + if (sa.nl_pid == 0) { + destinationPid = mClientNlPid; + } + + if (!mNlSocket->send(msg, destinationPid)) { + LOG(ERROR) << "Failed to send Netlink message!"; + mRunning = false; + return; + } + } + LOG(VERBOSE) << "[" << mClientName << "] Exiting relay thread!"; +} + +bool InterceptorRelay::start() { + if (mRunning) { + LOG(ERROR) + << "Can't relay messages: InterceptorRelay is already running!"; + return false; + } + if (mRelayThread.joinable()) { + LOG(ERROR) << "relay thread is already running!"; + return false; + } + if (!mNlSocket.has_value()) { + LOG(ERROR) << "Netlink socket not initialized!"; + return false; + } + + mRunning = true; + mRelayThread = std::thread(&InterceptorRelay::relayMessages, this); + + LOG(VERBOSE) << "Relay threads initialized"; + return true; +} + +bool InterceptorRelay::subscribeGroup(uint32_t nlGroup) { + return mNlSocket->addMembership(nlGroup); +} + +bool InterceptorRelay::unsubscribeGroup(uint32_t nlGroup) { + return mNlSocket->dropMembership(nlGroup); +} + +} // namespace android::nlinterceptor diff --git a/wifi/netlinkinterceptor/aidl/default/InterceptorRelay.h b/wifi/netlinkinterceptor/aidl/default/InterceptorRelay.h new file mode 100644 index 0000000000..0178c90e1e --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/default/InterceptorRelay.h @@ -0,0 +1,93 @@ +/* + * 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 + +#include +#include + +namespace android::nlinterceptor { + +class InterceptorRelay { + public: + /** + * Wrapper around the netlink socket and thread which relays messages. + * + * \param nlFamily - netlink family to use for the netlink socket. + * \param clientNlPid - pid of the client netlink socket. + * \param clientName - name of the client to be used for debugging. + */ + InterceptorRelay(uint32_t nlFamily, uint32_t clientNlPid, + const std::string& clientName); + + /** + * Stops the relay thread if running and destroys itself. + */ + ~InterceptorRelay(); + + /** + * Returns the PID of the internal Netlink socket. + * + * \return value of PID, + */ + uint32_t getPid(); + + /** + * Spawns relay thread. + */ + bool start(); + + /** + * Subscribes the internal socket to a single Netlink multicast group. + * + * \param nlGroup - Netlink group to subscribe to. + * \returns - true for success, false for failure. + */ + bool subscribeGroup(uint32_t nlGroup); + + /** + * Unsubscribes the internal socket from a single Netlink multicast group. + * + * \param nlGroup - Netlink group to unsubscribe from. + * \returns - true for success, false for failure. + */ + bool unsubscribeGroup(uint32_t nlGroup); + + private: + std::string mClientName; ///< Name of client (Wificond, for example). + std::optional mNlSocket; + const uint32_t mClientNlPid = 0; ///< pid of client NL socket. + + /** + * If set to true, the relay thread should be running. Setting this to false + * stops the relay thread. + */ + std::atomic_bool mRunning = false; + + /** + * Reads incoming Netlink messages destined for mNlSocket. If from the + * kernel, the message is relayed to the client specified in the + * constructor. Otherwise, the message is relayed to the kernel. This will + * run as long as mRunning is set to true. + */ + void relayMessages(); + + std::thread mRelayThread; +}; + +} // namespace android::nlinterceptor diff --git a/wifi/netlinkinterceptor/aidl/default/NetlinkInterceptor.cpp b/wifi/netlinkinterceptor/aidl/default/NetlinkInterceptor.cpp new file mode 100644 index 0000000000..908ecf22de --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/default/NetlinkInterceptor.cpp @@ -0,0 +1,121 @@ +/* + * 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 "NetlinkInterceptor.h" + +#include +#include + +namespace android::nlinterceptor { + +ndk::ScopedAStatus NetlinkInterceptor::createSocket( + int32_t nlFamilyAidl, int32_t clientNlPidAidl, + const std::string& clientName, AidlInterceptedSocket* interceptedSocket) { + auto nlFamily = static_cast(nlFamilyAidl); + auto clientNlPid = static_cast(clientNlPidAidl); + uint32_t interceptorNlPid = 0; + + std::unique_ptr interceptor = + std::make_unique(nlFamily, clientNlPid, clientName); + + interceptorNlPid = interceptor->getPid(); + + if (interceptorNlPid == 0) { + LOG(ERROR) << "Failed to create a Netlink socket for " << clientName + << ", " << nlFamily << ":" << clientNlPid; + return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR)); + } + + if (mClientMap.find({nlFamily, interceptorNlPid}) != mClientMap.end()) { + LOG(ERROR) << "A socket with pid " << interceptorNlPid + << " already exists!"; + return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR)); + } + + if (!interceptor->start()) { + LOG(ERROR) << "Failed to start interceptor thread!"; + return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR)); + } + + if (!mClientMap + .emplace(InterceptedSocket(nlFamily, interceptorNlPid), + std::move(interceptor)) + .second) { + // If this happens, it is very bad. + LOG(FATAL) << "Failed to insert interceptor instance with pid " + << interceptorNlPid << " into map!"; + return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR)); + } + + interceptedSocket->nlFamily = nlFamily; + interceptedSocket->portId = interceptorNlPid; + + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus NetlinkInterceptor::closeSocket( + const AidlInterceptedSocket& interceptedSocket) { + InterceptedSocket sock(interceptedSocket); + + auto interceptorIt = mClientMap.find(sock); + if (interceptorIt == mClientMap.end()) { + LOG(ERROR) << "closeSocket Failed! No such socket " << sock; + return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR)); + } + mClientMap.erase(interceptorIt); + + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus NetlinkInterceptor::subscribeGroup( + const AidlInterceptedSocket& interceptedSocket, int32_t nlGroupAidl) { + InterceptedSocket sock(interceptedSocket); + auto nlGroup = static_cast(nlGroupAidl); + + auto interceptorIt = mClientMap.find(sock); + if (interceptorIt == mClientMap.end()) { + LOG(ERROR) << "subscribeGroup failed! No such socket " << sock; + return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR)); + } + + auto& interceptor = interceptorIt->second; + if (!interceptor->subscribeGroup(nlGroup)) { + LOG(ERROR) << "Failed to subscribe " << sock << " to " << nlGroup; + return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR)); + } + + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus NetlinkInterceptor::unsubscribeGroup( + const AidlInterceptedSocket& interceptedSocket, int32_t nlGroupAidl) { + InterceptedSocket sock(interceptedSocket); + auto nlGroup = static_cast(nlGroupAidl); + + auto interceptorIt = mClientMap.find(sock); + if (interceptorIt == mClientMap.end()) { + LOG(ERROR) << "unsubscribeGroup failed! No such socket " << sock; + return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR)); + } + + auto& interceptor = interceptorIt->second; + if (!interceptor->unsubscribeGroup(nlGroup)) { + LOG(ERROR) << "Failed to unsubscribe " << sock << " from " << nlGroup; + return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR)); + } + return ndk::ScopedAStatus::ok(); +} +} // namespace android::nlinterceptor diff --git a/wifi/netlinkinterceptor/aidl/default/NetlinkInterceptor.h b/wifi/netlinkinterceptor/aidl/default/NetlinkInterceptor.h new file mode 100644 index 0000000000..8345654fa7 --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/default/NetlinkInterceptor.h @@ -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. + */ + +#pragma once + +#include +#include + +#include + +#include "InterceptorRelay.h" + +namespace android::nlinterceptor { + +class NetlinkInterceptor + : public ::aidl::android::hardware::net::nlinterceptor::BnInterceptor { + using ClientMap = + std::map<::android::nlinterceptor::InterceptedSocket, + std::unique_ptr<::android::nlinterceptor::InterceptorRelay>>; + + using AidlInterceptedSocket = + ::aidl::android::hardware::net::nlinterceptor::InterceptedSocket; + + public: + ndk::ScopedAStatus createSocket( + int32_t nlFamily, int32_t clientNlPid, const std::string& clientName, + AidlInterceptedSocket* interceptedSocket) override; + + ndk::ScopedAStatus closeSocket( + const AidlInterceptedSocket& interceptedSocket) override; + + ndk::ScopedAStatus subscribeGroup( + const AidlInterceptedSocket& interceptedSocket, + int32_t nlGroup) override; + + ndk::ScopedAStatus unsubscribeGroup( + const AidlInterceptedSocket& interceptedSocket, + int32_t nlGroup) override; + + private: + ClientMap mClientMap; +}; + +} // namespace android::nlinterceptor diff --git a/wifi/netlinkinterceptor/aidl/default/OWNERS b/wifi/netlinkinterceptor/aidl/default/OWNERS new file mode 100644 index 0000000000..b738dac662 --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/default/OWNERS @@ -0,0 +1,2 @@ +chrisweir@google.com +twasilczyk@google.com diff --git a/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.rc b/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.rc new file mode 100644 index 0000000000..353cb27cd0 --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.rc @@ -0,0 +1,4 @@ +service nlinterceptor /vendor/bin/hw/android.hardware.net.nlinterceptor-service.default + class hal + user root + group system inet diff --git a/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.xml b/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.xml new file mode 100644 index 0000000000..d7d257e000 --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.xml @@ -0,0 +1,9 @@ + + + android.hardware.net.nlinterceptor + + IInterceptor + default + + + diff --git a/wifi/netlinkinterceptor/aidl/default/service.cpp b/wifi/netlinkinterceptor/aidl/default/service.cpp new file mode 100644 index 0000000000..2aec3a5780 --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/default/service.cpp @@ -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. + */ + +#include +#include +#include + +#include "NetlinkInterceptor.h" + +namespace android::nlinterceptor { +using namespace std::string_literals; + +static void service() { + base::SetDefaultTag("nlinterceptor"); + base::SetMinimumLogSeverity(base::VERBOSE); + LOG(DEBUG) << "Netlink Interceptor service starting..."; + + // TODO(202549296): Sometimes this causes an Address Sanitizer error. + auto interceptor = ndk::SharedRefBase::make(); + const auto instance = NetlinkInterceptor::descriptor + "/default"s; + const auto status = AServiceManager_addService( + interceptor->asBinder().get(), instance.c_str()); + CHECK(status == STATUS_OK); + + ABinderProcess_joinThreadPool(); + LOG(FATAL) << "Netlink Interceptor has stopped"; +} + +} // namespace android::nlinterceptor + +int main() { + ::android::nlinterceptor::service(); + return 0; +} diff --git a/wifi/netlinkinterceptor/aidl/default/util.cpp b/wifi/netlinkinterceptor/aidl/default/util.cpp new file mode 100644 index 0000000000..c7347472c9 --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/default/util.cpp @@ -0,0 +1,29 @@ +/* + * 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 "util.h" + +#include + +namespace android::nlinterceptor { + +bool isSocketReadable(const short revents) { return 0 != (revents & POLLIN); } + +bool isSocketBad(const short revents) { + return 0 != (revents & (POLLERR | POLLHUP | POLLNVAL)); +} + +} // namespace android::nlinterceptor diff --git a/wifi/netlinkinterceptor/aidl/default/util.h b/wifi/netlinkinterceptor/aidl/default/util.h new file mode 100644 index 0000000000..9b8ec63c1a --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/default/util.h @@ -0,0 +1,52 @@ +/* + * 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 + +#include + +namespace android::nlinterceptor { + +/** + * Handy-dandy helper to get the size of a statically initialized array. + * + * \param N the array to get the size of. + * \return the size of the array. + */ +template +size_t countof(T (&)[N]) { + return N; +} + +/** + * Helper to check if socket is readable (POLLIN is set). + * + * \param revents pollfd.revents value to check. + * \return true if socket is ready to read. + */ +bool isSocketReadable(short revents); + +/** + * Helper to check if socket is bad (POLLERR, POLLHUP or POLLNVAL is set). + * + * \param revents pollfd.revents value to check. + * \return true if socket is bad. + */ +bool isSocketBad(short revents); + +} // namespace android::nlinterceptor diff --git a/wifi/netlinkinterceptor/libnlinterceptor/Android.bp b/wifi/netlinkinterceptor/libnlinterceptor/Android.bp new file mode 100644 index 0000000000..a5e17668c3 --- /dev/null +++ b/wifi/netlinkinterceptor/libnlinterceptor/Android.bp @@ -0,0 +1,56 @@ +// +// 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. +// + +cc_defaults { + name: "nlinterceptor@defaults", + cpp_std: "experimental", + cflags: [ + "-Wall", + "-Wextra", + "-Wsuggest-override", + "-Werror", + ], + shared_libs: [ + "libbase", + "libutils", + ], + sanitize: { + address: true, + undefined: true, + all_undefined: true, + fuzzer: true, + cfi: true, + integer_overflow: true, + scs: true, + }, + strip: { + keep_symbols_and_debug_frame: true, + }, +} + +cc_library_static { + name: "libnlinterceptor", + defaults: ["nlinterceptor@defaults"], + vendor_available: true, + shared_libs: [ + "android.hardware.net.nlinterceptor-V1-ndk", + "libbinder_ndk", + ], + srcs: [ + "libnlinterceptor.cpp", + ], + export_include_dirs: ["include"], +} diff --git a/wifi/netlinkinterceptor/libnlinterceptor/include/libnlinterceptor/libnlinterceptor.h b/wifi/netlinkinterceptor/libnlinterceptor/include/libnlinterceptor/libnlinterceptor.h new file mode 100644 index 0000000000..ac8653ebe4 --- /dev/null +++ b/wifi/netlinkinterceptor/libnlinterceptor/include/libnlinterceptor/libnlinterceptor.h @@ -0,0 +1,131 @@ +/* + * 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 + +#ifdef __cplusplus + +#include +#include +#include + +#include +#include + +namespace android::nlinterceptor { + +/** + * Wrapper structure to uniquely identifies a socket that Netlink Interceptor + * has allocated for us. + */ +struct InterceptedSocket { + uint32_t nlFamily; + uint32_t portId; + + InterceptedSocket( + ::aidl::android::hardware::net::nlinterceptor::InterceptedSocket sock); + InterceptedSocket(uint32_t nlFamily, uint32_t portId); + + bool operator<(const InterceptedSocket& other) const; + operator sockaddr_nl() const; + operator ::aidl::android::hardware::net::nlinterceptor::InterceptedSocket() + const; +}; + +/** + * Output stream operator for InterceptedSocket + */ +std::ostream& operator<<(std::ostream& os, const InterceptedSocket& sock); + +/** + * Checks if an instance Netlink Interceptor exists. + * + * \return true if supported, false if not. + */ +bool isEnabled(); + +/** + * Asks Netlink Interceptor to allocate a socket to which we can send Netlink + * traffic. + * + * \param clientSocket - File descriptor for the client's Netlink socket. + * \param clientName - Human readable name of the client application. + * \return Identifier for the socket created by Netlink Interceptor, nullopt on + * error. + */ +std::optional createSocket(base::borrowed_fd clientSocket, + const std::string& clientName); + +/** + * Asks Netlink Interceptor to close a socket that it created for us previously, + * if it exists. + * + * \param sock - Identifier for the socket created by Netlink Interceptor. + */ +void closeSocket(const InterceptedSocket& sock); + +/** + * Asks Netlink Interceptor to subscribe a socket that it created for us + * previously to a specified multicast group. + * + * \param sock - Identifier for the socket created by Netlink Interceptor. + * \param group - A single Netlink multicast group for which we would like to + * receive events. + * \return true for success, false if something went wrong. + */ +bool subscribe(const InterceptedSocket& sock, uint32_t group); + +/** + * Asks Netlink Interceptor to unsubscribe a socket that it created for us + * previously from a specified multicast group. + * + * \param sock - Identifier for the socket created by Netlink Interceptor. + * \param group - A single Netlink multicast group for which we no longer wish + * to receive events. + * \return true for success, false if something went wrong. + */ +bool unsubscribe(const InterceptedSocket& sock, uint32_t group); +} // namespace android::nlinterceptor +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// C wrappers for libnlinterceptor +struct android_nlinterceptor_InterceptedSocket { + uint32_t nlFamily; + uint32_t portId; +}; + +bool android_nlinterceptor_isEnabled(); + +bool android_nlinterceptor_createSocket( + int clientSocketFd, const char* clientName, + struct android_nlinterceptor_InterceptedSocket* interceptedSocket); + +void android_nlinterceptor_closeSocket( + const struct android_nlinterceptor_InterceptedSocket* sock); + +bool android_nlinterceptor_subscribe( + const struct android_nlinterceptor_InterceptedSocket* sock, uint32_t group); + +bool android_nlinterceptor_unsubscribe( + const struct android_nlinterceptor_InterceptedSocket* sock, uint32_t group); + +#ifdef __cplusplus +} +#endif diff --git a/wifi/netlinkinterceptor/libnlinterceptor/libnlinterceptor.cpp b/wifi/netlinkinterceptor/libnlinterceptor/libnlinterceptor.cpp new file mode 100644 index 0000000000..575f90031a --- /dev/null +++ b/wifi/netlinkinterceptor/libnlinterceptor/libnlinterceptor.cpp @@ -0,0 +1,174 @@ +/* + * 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 +#include +#include +#include +#include +#include + +#include + +namespace android::nlinterceptor { +using namespace std::string_literals; +using namespace ::aidl::android::hardware::net::nlinterceptor; +using base::borrowed_fd; +using AidlInterceptedSocket = + ::aidl::android::hardware::net::nlinterceptor::InterceptedSocket; + +static const auto kServiceName = IInterceptor::descriptor + "/default"s; + +InterceptedSocket::InterceptedSocket( + ::aidl::android::hardware::net::nlinterceptor::InterceptedSocket sock) + : nlFamily(sock.nlFamily), portId(sock.portId) {} + +InterceptedSocket::InterceptedSocket(uint32_t nlFamily, uint32_t portId) + : nlFamily(nlFamily), portId(portId) {} + +std::ostream& operator<<(std::ostream& os, const InterceptedSocket& sock) { + return os << "family: " << sock.nlFamily << ", portId: " << sock.portId; +} + +bool InterceptedSocket::operator<(const InterceptedSocket& other) const { + if (nlFamily != other.nlFamily) { + return nlFamily < other.nlFamily; + } + return portId < other.portId; +} + +InterceptedSocket::operator sockaddr_nl() const { + return { + .nl_family = AF_NETLINK, + .nl_pad = 0, + .nl_pid = portId, + .nl_groups = 0, + }; +} + +InterceptedSocket::operator AidlInterceptedSocket() const { + return { + .nlFamily = static_cast(nlFamily), + .portId = static_cast(portId), + }; +} + +bool isEnabled() { + static std::mutex supportedMutex; + static std::optional interceptorSupported; + // Avoid querying service manager when we can cache the result. + if (interceptorSupported.has_value()) return *interceptorSupported; + std::lock_guard lock(supportedMutex); + if (interceptorSupported.has_value()) return *interceptorSupported; + + if (!AServiceManager_isDeclared(kServiceName.c_str())) { + interceptorSupported = false; + return false; + } + interceptorSupported = true; + return true; +} + +static IInterceptor& getInstance() { + static std::mutex instanceMutex; + static std::shared_ptr interceptorInstance; + CHECK(isEnabled()) << "Can't getInstance! Interceptor not supported!"; + // Don't overwrite the pointer once we've acquired it. + if (interceptorInstance != nullptr) return *interceptorInstance; + std::lock_guard lock(instanceMutex); + if (interceptorInstance != nullptr) return *interceptorInstance; + interceptorInstance = IInterceptor::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService(kServiceName.c_str()))); + CHECK(interceptorInstance != nullptr) + << "Failed to get Netlink Interceptor service!"; + return *interceptorInstance; +} + +std::optional createSocket(borrowed_fd clientSocket, + const std::string& clientName) { + sockaddr_nl nladdr = {}; + socklen_t nlsize = sizeof(nladdr); + if (getsockname(clientSocket.get(), reinterpret_cast(&nladdr), + &nlsize) < 0) { + PLOG(ERROR) << "Failed to get pid of fd passed by " << clientName; + return std::nullopt; + } + + ::aidl::android::hardware::net::nlinterceptor::InterceptedSocket + interceptedSocket; + auto aidlStatus = getInstance().createSocket( + nladdr.nl_family, nladdr.nl_pid, clientName, &interceptedSocket); + if (!aidlStatus.isOk()) { + return std::nullopt; + } + + return InterceptedSocket{nladdr.nl_family, + uint32_t(interceptedSocket.portId)}; +} + +void closeSocket(const InterceptedSocket& sock) { + auto aidlStatus = getInstance().closeSocket(sock); + if (!aidlStatus.isOk()) { + LOG(ERROR) << "Failed to close socket with pid = " << sock.portId; + } +} + +bool subscribe(const InterceptedSocket& sock, uint32_t group) { + auto aidlStatus = getInstance().subscribeGroup(sock, group); + return aidlStatus.isOk(); +} + +bool unsubscribe(const InterceptedSocket& sock, uint32_t group) { + auto aidlStatus = getInstance().unsubscribeGroup(sock, group); + return aidlStatus.isOk(); +} + +extern "C" bool android_nlinterceptor_isEnabled() { return isEnabled(); } + +extern "C" bool android_nlinterceptor_createSocket( + int clientSocketFd, const char* clientName, + android_nlinterceptor_InterceptedSocket* interceptedSocket) { + if (!clientName || clientSocketFd <= 0) return false; + const auto maybeSocket = + createSocket(borrowed_fd(clientSocketFd), clientName); + if (!maybeSocket) return false; + *interceptedSocket = {.nlFamily = maybeSocket->nlFamily, + .portId = maybeSocket->portId}; + return true; +} + +extern "C" void android_nlinterceptor_closeSocket( + const android_nlinterceptor_InterceptedSocket* sock) { + if (!sock) { + LOG(ERROR) << "Can't close socket identified by a null pointer!"; + return; + } + closeSocket({sock->nlFamily, sock->portId}); +} + +extern "C" bool android_nlinterceptor_subscribe( + const android_nlinterceptor_InterceptedSocket* sock, uint32_t group) { + if (!sock) return false; + return subscribe({sock->nlFamily, sock->portId}, group); +} + +extern "C" bool android_nlinterceptor_unsubscribe( + const android_nlinterceptor_InterceptedSocket* sock, uint32_t group) { + if (!sock) return false; + return unsubscribe({sock->nlFamily, sock->portId}, group); +} + +} // namespace android::nlinterceptor -- GitLab From 4669bd35a91a2cb24b88afa3c3c4c9113a466563 Mon Sep 17 00:00:00 2001 From: Chris Weir Date: Mon, 22 Nov 2021 10:52:33 -0800 Subject: [PATCH 303/825] Add VTS for Netlink Interceptor VTS tests for Netlink Interceptor BYPASS_INCLUSIVE_LANGUAGE_REASON="dummy" is what Linux uses to refer to interfaces that are not real or functional. I did not pick this name. Bug: 201467304 Test: atest VtsHalNetlinkInterceptorV1_0Test Change-Id: Idb5ad759c9226ddf9e6182213cced750efdbd293 --- wifi/netlinkinterceptor/vts/OWNERS | 2 + .../vts/functional/Android.bp | 51 +++++ .../vts/functional/interceptor_aidl_test.cpp | 195 ++++++++++++++++++ 3 files changed, 248 insertions(+) create mode 100644 wifi/netlinkinterceptor/vts/OWNERS create mode 100644 wifi/netlinkinterceptor/vts/functional/Android.bp create mode 100644 wifi/netlinkinterceptor/vts/functional/interceptor_aidl_test.cpp diff --git a/wifi/netlinkinterceptor/vts/OWNERS b/wifi/netlinkinterceptor/vts/OWNERS new file mode 100644 index 0000000000..b738dac662 --- /dev/null +++ b/wifi/netlinkinterceptor/vts/OWNERS @@ -0,0 +1,2 @@ +chrisweir@google.com +twasilczyk@google.com diff --git a/wifi/netlinkinterceptor/vts/functional/Android.bp b/wifi/netlinkinterceptor/vts/functional/Android.bp new file mode 100644 index 0000000000..33284e8e89 --- /dev/null +++ b/wifi/netlinkinterceptor/vts/functional/Android.bp @@ -0,0 +1,51 @@ +// +// 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. +// + +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: "VtsHalNetlinkInterceptorV1_0Test", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + cpp_std: "experimental", + srcs: [ + "interceptor_aidl_test.cpp", + ], + shared_libs: [ + "android.hardware.net.nlinterceptor-V1-ndk", + "libbase", + "libbinder_ndk", + ], + static_libs: [ + "libgmock", + "android.hardware.automotive.can@libnetdevice", + "libnl++", + ], + test_suites: [ + "general-tests", + "vts", + ], + disable_framework: true, +} diff --git a/wifi/netlinkinterceptor/vts/functional/interceptor_aidl_test.cpp b/wifi/netlinkinterceptor/vts/functional/interceptor_aidl_test.cpp new file mode 100644 index 0000000000..b26d8ec3e7 --- /dev/null +++ b/wifi/netlinkinterceptor/vts/functional/interceptor_aidl_test.cpp @@ -0,0 +1,195 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using aidl::android::hardware::net::nlinterceptor::IInterceptor; +using AidlInterceptedSocket = + ::aidl::android::hardware::net::nlinterceptor::InterceptedSocket; +using namespace std::chrono_literals; +using namespace std::string_literals; + +class InterceptorAidlTest : public ::testing::TestWithParam { + public: + virtual void SetUp() override { + android::base::SetDefaultTag("InterceptorAidlTest"); + android::base::SetMinimumLogSeverity(android::base::VERBOSE); + const auto instance = IInterceptor::descriptor + "/default"s; + mNlInterceptorService = IInterceptor::fromBinder( + ndk::SpAIBinder(AServiceManager_getService(instance.c_str()))); + + ASSERT_NE(mNlInterceptorService, nullptr); + mSocket = std::make_unique(NETLINK_ROUTE); + ASSERT_TRUE(mSocket->getPid().has_value()); + + // If the test broke last run, clean up our mess, don't worry about "no + // such device". + if (android::netdevice::del(mTestIfaceName)) { + LOG(WARNING) << "Test interface wasn't cleaned up on previous run!"; + } + } + + void multicastReceiver(); + + std::shared_ptr mNlInterceptorService; + std::unique_ptr mSocket; + bool mRunning; + bool mGotMulticast; + const std::string mTestIfaceName = "interceptorvts0"; +}; + +TEST_P(InterceptorAidlTest, createSocketTest) { + // Ask IInterceptor for a socket. + AidlInterceptedSocket interceptedSocket; + auto aidlStatus = mNlInterceptorService->createSocket( + NETLINK_ROUTE, *(mSocket->getPid()), "createSocketTest", + &interceptedSocket); + ASSERT_TRUE(aidlStatus.isOk()); + ASSERT_NE(interceptedSocket.portId, 0); + uint32_t interceptorPid = interceptedSocket.portId; + + // Ask the kernel to tell us what interfaces are available. + android::nl::MessageFactory req(RTM_GETLINK, + NLM_F_REQUEST | NLM_F_DUMP); + req->rtgen_family = AF_PACKET; + sockaddr_nl sa = {.nl_family = AF_NETLINK, + .nl_pad = 0, + .nl_pid = interceptorPid, + .nl_groups = 0}; + EXPECT_TRUE(mSocket->send(req, sa)); + + // We'll likely get back several messages, as indicated by the MULTI flag. + unsigned received = 0; + for (const auto msg : *mSocket) { + ASSERT_NE(msg->nlmsg_type, NLMSG_ERROR); + ++received; + break; + if (msg->nlmsg_type == NLMSG_DONE) { + // TODO(202548749): NLMSG_DONE on NETLINK_ROUTE doesn't work? + break; + } + } + ASSERT_GE(received, 1); + + // Close the socket and make sure it's stopped working. + aidlStatus = mNlInterceptorService->closeSocket(interceptedSocket); + EXPECT_TRUE(aidlStatus.isOk()); + EXPECT_FALSE(mSocket->send(req, sa)); +} + +static bool isSocketReadable(const short revents) { + return 0 != (revents & POLLIN); +} + +static bool isSocketBad(const short revents) { + return 0 != (revents & (POLLERR | POLLHUP | POLLNVAL)); +} + +void InterceptorAidlTest::multicastReceiver() { + pollfd fds[] = { + mSocket->preparePoll(POLLIN), + }; + while (mRunning) { + if (poll(fds, 1, 300) < 0) { + PLOG(FATAL) << "poll failed"; + return; + } + const auto nlsockEvents = fds[0].revents; + ASSERT_FALSE(isSocketBad(nlsockEvents)); + if (!isSocketReadable(nlsockEvents)) continue; + + const auto [msgMaybe, sa] = mSocket->receiveFrom(); + ASSERT_TRUE(msgMaybe.has_value()); + auto msg = *msgMaybe; + + // Multicast messages have 0 for their pid and sequence number. + if (msg->nlmsg_pid == 0 && msg->nlmsg_seq == 0) { + mGotMulticast = true; + } + } +} + +TEST_P(InterceptorAidlTest, subscribeGroupTest) { + // Ask IInterceptor for a socket. + AidlInterceptedSocket interceptedSocket; + auto aidlStatus = mNlInterceptorService->createSocket( + NETLINK_ROUTE, *(mSocket->getPid()), "subscribeGroupTest", + &interceptedSocket); + ASSERT_TRUE(aidlStatus.isOk()); + ASSERT_TRUE(interceptedSocket.portId != 0); + + // Listen for interface up/down events. + aidlStatus = + mNlInterceptorService->subscribeGroup(interceptedSocket, RTNLGRP_LINK); + ASSERT_TRUE(aidlStatus.isOk()); + + // Start a thread to receive a multicast + mRunning = true; + mGotMulticast = false; + std::thread successfulReceiver(&InterceptorAidlTest::multicastReceiver, + this); + + // TODO(201695162): use futures with wait_for instead of a sleep_for(). + std::this_thread::sleep_for(50ms); + // create a network interface and bring it up to trigger a multicast event. + ASSERT_TRUE(android::netdevice::add(mTestIfaceName, /*type=*/"dummy")); + ASSERT_TRUE(android::netdevice::up(mTestIfaceName)); + std::this_thread::sleep_for(50ms); + EXPECT_TRUE(mGotMulticast); + mRunning = false; + successfulReceiver.join(); + + // Stop listening to interface up/down events. + aidlStatus = mNlInterceptorService->unsubscribeGroup(interceptedSocket, + RTNLGRP_LINK); + ASSERT_TRUE(aidlStatus.isOk()); + + // This time, we should hear nothing. + mGotMulticast = false; + mRunning = true; + std::thread unsuccessfulReceiver(&InterceptorAidlTest::multicastReceiver, + this); + std::this_thread::sleep_for(50ms); + ASSERT_TRUE(android::netdevice::down(mTestIfaceName)); + ASSERT_TRUE(android::netdevice::del(mTestIfaceName)); + std::this_thread::sleep_for(50ms); + EXPECT_FALSE(mGotMulticast); + mRunning = false; + unsuccessfulReceiver.join(); + + aidlStatus = mNlInterceptorService->closeSocket(interceptedSocket); + EXPECT_TRUE(aidlStatus.isOk()); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(InterceptorAidlTest); +INSTANTIATE_TEST_SUITE_P(PerInstance, InterceptorAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames( + IInterceptor::descriptor)), + android::PrintInstanceNameToString); -- GitLab From bab8ba921fdf8bb1d9fa972a269e46ebee004444 Mon Sep 17 00:00:00 2001 From: ramindani Date: Thu, 18 Nov 2021 01:24:11 +0000 Subject: [PATCH 304/825] Readback tests from VTS 2.2 Tests are from https://source.corp.google.com/android/hardware/interfaces/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp;rcl=4796867049599ae1618d63cb93a38b269687164b;l=52 Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 202766745 Change-Id: I495819c168429873dc88decb20f398569c1a8128 --- .../composer3/vts/functional/Android.bp | 15 +- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 1360 +++++++++++++++++ .../vts/functional/composer-vts/Android.bp | 14 + .../functional/composer-vts/ReadbackVts.cpp | 360 +++++ .../composer-vts/RenderEngineVts.cpp | 89 ++ .../composer-vts/include/ReadbackVts.h | 214 +++ .../composer-vts/include/RenderEngineVts.h | 71 + 7 files changed, 2122 insertions(+), 1 deletion(-) create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp index c011f737a1..9bf860934e 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp @@ -19,7 +19,7 @@ package { // 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 + // SPDX-license-identifier-Apache-2.0 default_applicable_licenses: ["hardware_interfaces_license"], } @@ -28,20 +28,29 @@ cc_test { defaults: [ "VtsHalTargetTestDefaults", "use_libaidlvintf_gtest_helper_static", + // Needed for librenderengine + "skia_deps", ], srcs: [ "VtsHalGraphicsComposer3_TargetTest.cpp", + "VtsHalGraphicsComposer3_ReadbackTest.cpp", "composer-vts/GraphicsComposerCallback.cpp", "composer-vts/TestCommandReader.cpp", ], shared_libs: [ + "libEGL", + "libGLESv1_CM", + "libGLESv2", "libbinder_ndk", "libbinder", "libfmq", "libbase", "libsync", "libui", + "libgui", + "libhidlbase", + "libprocessgroup", "android.hardware.graphics.mapper@2.0", "android.hardware.graphics.mapper@2.1", "android.hardware.graphics.mapper@3.0", @@ -69,6 +78,10 @@ cc_test { "android.hardware.graphics.mapper@3.0-vts", "android.hardware.graphics.mapper@4.0-vts", "libaidlcommonsupport", + "libgtest", + "librenderengine", + "libshaders", + "libtonemap", ], cflags: [ "-Wconversion", diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp new file mode 100644 index 0000000000..6f83b90b13 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -0,0 +1,1360 @@ +/** + * 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. + */ + +#define LOG_TAG "graphics_composer_aidl_hal_readback_tests@3" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "composer-vts/include/GraphicsComposerCallback.h" +#include "composer-vts/include/TestCommandReader.h" + +namespace aidl::android::hardware::graphics::composer3::vts { +namespace { + +using ::android::Rect; +using common::Dataspace; +using common::PixelFormat; + +class GraphicsCompositionTestBase : public ::testing::Test { + protected: + void SetUpBase(const std::string& name) { + ndk::SpAIBinder binder(AServiceManager_waitForService(name.c_str())); + ASSERT_NE(binder, nullptr); + ASSERT_NO_FATAL_FAILURE(mComposer = IComposer::fromBinder(binder)); + ASSERT_NE(mComposer, nullptr); + ASSERT_NO_FATAL_FAILURE(mComposer->createClient(&mComposerClient)); + mComposerCallback = ::ndk::SharedRefBase::make(); + mComposerClient->registerCallback(mComposerCallback); + + // assume the first display is primary and is never removed + mPrimaryDisplay = waitForFirstDisplay(); + + int32_t activeConfig; + EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &activeConfig).isOk()); + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(mPrimaryDisplay, activeConfig, + DisplayAttribute::WIDTH, &mDisplayWidth) + .isOk()); + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(mPrimaryDisplay, activeConfig, + DisplayAttribute::HEIGHT, &mDisplayHeight) + .isOk()); + + setTestColorModes(); + + // explicitly disable vsync + EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, false).isOk()); + mComposerCallback->setVsyncAllowed(false); + + // set up command writer/reader and gralloc + mWriter = std::make_shared(1024); + mReader = std::make_unique(); + mGraphicBuffer = allocate(); + + ASSERT_NO_FATAL_FAILURE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON)); + + ASSERT_NO_FATAL_FAILURE( + mTestRenderEngine = std::unique_ptr(new TestRenderEngine( + ::android::renderengine::RenderEngineCreationArgs::Builder() + .setPixelFormat(static_cast(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(mDisplayWidth, mDisplayHeight); + clientCompositionDisplay.clip = clientCompositionDisplay.physicalDisplay; + + mTestRenderEngine->initGraphicBuffer( + static_cast(mDisplayWidth), static_cast(mDisplayHeight), 1, + static_cast( + static_cast(common::BufferUsage::CPU_READ_OFTEN) | + static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | + static_cast(common::BufferUsage::GPU_RENDER_TARGET))); + mTestRenderEngine->setDisplaySettings(clientCompositionDisplay); + } + + void TearDown() override { + ASSERT_NO_FATAL_FAILURE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF)); + EXPECT_EQ(0, mReader->mErrors.size()); + EXPECT_EQ(0, mReader->mCompositionChanges.size()); + if (mComposerCallback != nullptr) { + EXPECT_EQ(0, mComposerCallback->getInvalidHotplugCount()); + EXPECT_EQ(0, mComposerCallback->getInvalidRefreshCount()); + EXPECT_EQ(0, mComposerCallback->getInvalidVsyncCount()); + } + } + + ::android::sp<::android::GraphicBuffer> allocate() { + return ::android::sp<::android::GraphicBuffer>::make( + mDisplayWidth, mDisplayHeight, ::android::PIXEL_FORMAT_RGBA_8888, + /*layerCount*/ 1, + static_cast(static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | + static_cast(common::BufferUsage::CPU_READ_OFTEN)), + "VtsHalGraphicsComposer3_ReadbackTest"); + } + + void clearCommandReaderState() { + mReader->mCompositionChanges.clear(); + mReader->mErrors.clear(); + } + + void writeLayers(const std::vector>& layers) { + for (auto layer : layers) { + layer->write(mWriter); + } + execute(); + } + + void execute() { + TestCommandReader* reader = mReader.get(); + CommandWriterBase* writer = mWriter.get(); + bool queueChanged = false; + int32_t commandLength = 0; + std::vector commandHandles; + ASSERT_TRUE(writer->writeQueue(&queueChanged, &commandLength, &commandHandles)); + + if (queueChanged) { + auto ret = mComposerClient->setInputCommandQueue(writer->getMQDescriptor()); + ASSERT_TRUE(ret.isOk()); + } + + ExecuteCommandsStatus commandStatus; + EXPECT_TRUE(mComposerClient->executeCommands(commandLength, commandHandles, &commandStatus) + .isOk()); + + if (commandStatus.queueChanged) { + MQDescriptor outputCommandQueue; + ASSERT_TRUE(mComposerClient->getOutputCommandQueue(&outputCommandQueue).isOk()); + reader->setMQDescriptor(outputCommandQueue); + } + ASSERT_TRUE(reader->readQueue(commandStatus.length, std::move(commandStatus.handles))); + reader->parse(); + reader->reset(); + writer->reset(); + } + + std::shared_ptr mComposer; + std::shared_ptr mComposerClient; + + std::shared_ptr mComposerCallback; + // the first display and is assumed never to be removed + int64_t mPrimaryDisplay; + int32_t mDisplayWidth; + int32_t mDisplayHeight; + std::vector mTestColorModes; + std::shared_ptr mWriter; + std::unique_ptr mReader; + ::android::sp<::android::GraphicBuffer> mGraphicBuffer; + std::unique_ptr mTestRenderEngine; + + bool mHasReadbackBuffer; + common::PixelFormat mPixelFormat; + common::Dataspace mDataspace; + + static constexpr uint32_t kClientTargetSlotCount = 64; + + private: + int64_t waitForFirstDisplay() { + while (true) { + std::vector displays = mComposerCallback->getDisplays(); + if (displays.empty()) { + usleep(5 * 1000); + continue; + } + return displays[0]; + } + } + + void setTestColorModes() { + mTestColorModes.clear(); + std::vector modes; + EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &modes).isOk()); + + for (ColorMode mode : modes) { + if (std::find(ReadbackHelper::colorModes.begin(), ReadbackHelper::colorModes.end(), + mode) != ReadbackHelper::colorModes.end()) { + mTestColorModes.push_back(mode); + } + } + } +}; + +class GraphicsCompositionTest : public GraphicsCompositionTestBase, + public testing::WithParamInterface { + public: + void SetUp() override { SetUpBase(GetParam()); } +}; + +TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { + for (ColorMode mode : mTestColorModes) { + mWriter->selectDisplay(mPrimaryDisplay); + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + auto layer = std::make_shared(mComposerClient, mPrimaryDisplay); + common::Rect coloredSquare({0, 0, mDisplayWidth, mDisplayHeight}); + layer->setColor(BLUE); + layer->setDisplayFrame(coloredSquare); + layer->setZOrder(10); + + std::vector> layers = {layer}; + + // expected color for each pixel + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, coloredSquare, BLUE); + + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + + writeLayers(layers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + // if hwc cannot handle and asks for composition change, + // just succeed the test + if (mReader->mCompositionChanges.size() != 0) { + clearCommandReaderState(); + GTEST_SUCCEED(); + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + mTestRenderEngine->setRenderLayers(layers); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors)); + } +} + +TEST_P(GraphicsCompositionTest, SetLayerBuffer) { + for (ColorMode mode : mTestColorModes) { + mWriter->selectDisplay(mPrimaryDisplay); + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + mWriter->selectDisplay(mPrimaryDisplay); + + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {0, 0, mDisplayWidth, mDisplayHeight / 4}, RED); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {0, mDisplayHeight / 4, mDisplayWidth, mDisplayHeight / 2}, + GREEN); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, + BLUE); + + auto layer = std::make_shared( + mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, + mDisplayHeight, common::PixelFormat::RGBA_8888); + layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + layer->setZOrder(10); + layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors)); + + std::vector> layers = {layer}; + + writeLayers(layers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + + if (mReader->mCompositionChanges.size() != 0) { + clearCommandReaderState(); + GTEST_SUCCEED(); + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + + mWriter->presentDisplay(); + execute(); + + ASSERT_EQ(0, mReader->mErrors.size()); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + mTestRenderEngine->setRenderLayers(layers); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors)); + } +} + +TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { + for (ColorMode mode : mTestColorModes) { + mWriter->selectDisplay(mPrimaryDisplay); + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + auto layer = std::make_shared(mComposerClient, mPrimaryDisplay); + common::Rect coloredSquare({0, 0, mDisplayWidth, mDisplayHeight}); + layer->setColor(BLUE); + layer->setDisplayFrame(coloredSquare); + layer->setZOrder(10); + layer->write(mWriter); + + // This following buffer call should have no effect + uint64_t usage = + static_cast(static_cast(common::BufferUsage::CPU_READ_OFTEN) | + static_cast(common::BufferUsage::CPU_WRITE_OFTEN)); + + mGraphicBuffer->reallocate(static_cast(mDisplayWidth), + static_cast(mDisplayHeight), 1, + static_cast(common::PixelFormat::RGBA_8888), usage); + mWriter->setLayerBuffer(0, mGraphicBuffer->handle, -1); + + // expected color for each pixel + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, coloredSquare, BLUE); + + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + + mWriter->validateDisplay(); + execute(); + + if (mReader->mCompositionChanges.size() != 0) { + clearCommandReaderState(); + GTEST_SUCCEED(); + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + } +} + +TEST_P(GraphicsCompositionTest, ClientComposition) { + EXPECT_TRUE(mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kClientTargetSlotCount) + .isOk()); + + for (ColorMode mode : mTestColorModes) { + mWriter->selectDisplay(mPrimaryDisplay); + EXPECT_TRUE(mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC) + .isOk()); + + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + mWriter->selectDisplay(mPrimaryDisplay); + + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {0, 0, mDisplayWidth, mDisplayHeight / 4}, RED); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {0, mDisplayHeight / 4, mDisplayWidth, mDisplayHeight / 2}, + GREEN); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, + BLUE); + + auto layer = std::make_shared( + mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, + mDisplayHeight, PixelFormat::RGBA_FP16); + layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + layer->setZOrder(10); + layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + + std::vector> layers = {layer}; + + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + writeLayers(layers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + + if (!mReader->mCompositionChanges.empty()) { + ASSERT_EQ(1, mReader->mCompositionChanges.size()); + ASSERT_EQ(1, mReader->mCompositionChanges[0].second); + + PixelFormat clientFormat = PixelFormat::RGBA_8888; + auto clientUsage = static_cast( + static_cast(common::BufferUsage::CPU_READ_OFTEN) | + static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | + static_cast(common::BufferUsage::COMPOSER_CLIENT_TARGET)); + Dataspace clientDataspace = ReadbackHelper::getDataspaceForColorMode(mode); + common::Rect damage{0, 0, mDisplayWidth, mDisplayHeight}; + + // create client target buffer + mGraphicBuffer->reallocate(layer->getWidth(), layer->getHeight(), + static_cast(common::PixelFormat::RGBA_8888), + layer->getLayerCount(), clientUsage); + + ASSERT_NE(nullptr, mGraphicBuffer->handle); + + void* clientBufData; + mGraphicBuffer->lock(clientUsage, layer->getAccessRegion(), &clientBufData); + + ASSERT_NO_FATAL_FAILURE( + ReadbackHelper::fillBuffer(layer->getWidth(), layer->getHeight(), + static_cast(mGraphicBuffer->stride), + clientBufData, clientFormat, expectedColors)); + EXPECT_EQ(::android::OK, mGraphicBuffer->unlock()); + + ndk::ScopedFileDescriptor fenceHandle; + EXPECT_TRUE( + mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fenceHandle).isOk()); + + layer->setToClientComposition(mWriter); + mWriter->acceptDisplayChanges(); + mWriter->setClientTarget(0, mGraphicBuffer->handle, fenceHandle.get(), clientDataspace, + std::vector(1, damage)); + execute(); + ASSERT_EQ(0, mReader->mCompositionChanges.size()); + } + ASSERT_EQ(0, mReader->mErrors.size()); + + mWriter->presentDisplay(); + execute(); + + ASSERT_EQ(0, mReader->mErrors.size()); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + } +} + +TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kClientTargetSlotCount)); + + for (ColorMode mode : mTestColorModes) { + mWriter->selectDisplay(mPrimaryDisplay); + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {0, 0, mDisplayWidth, mDisplayHeight / 2}, GREEN); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, RED); + + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + + auto deviceLayer = std::make_shared( + mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, + mDisplayHeight / 2, PixelFormat::RGBA_8888); + std::vector deviceColors(deviceLayer->getWidth() * deviceLayer->getHeight()); + ReadbackHelper::fillColorsArea(deviceColors, static_cast(deviceLayer->getWidth()), + {0, 0, static_cast(deviceLayer->getWidth()), + static_cast(deviceLayer->getHeight())}, + GREEN); + deviceLayer->setDisplayFrame({0, 0, static_cast(deviceLayer->getWidth()), + static_cast(deviceLayer->getHeight())}); + deviceLayer->setZOrder(10); + deviceLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + ASSERT_NO_FATAL_FAILURE(deviceLayer->setBuffer(deviceColors)); + deviceLayer->write(mWriter); + + PixelFormat clientFormat = PixelFormat::RGBA_8888; + auto clientUsage = static_cast( + static_cast(common::BufferUsage::CPU_READ_OFTEN) | + static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | + static_cast(common::BufferUsage::COMPOSER_CLIENT_TARGET)); + Dataspace clientDataspace = ReadbackHelper::getDataspaceForColorMode(mode); + int32_t clientWidth = mDisplayWidth; + int32_t clientHeight = mDisplayHeight / 2; + + auto clientLayer = std::make_shared( + mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, clientWidth, + clientHeight, PixelFormat::RGBA_FP16, Composition::DEVICE); + common::Rect clientFrame = {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}; + clientLayer->setDisplayFrame(clientFrame); + clientLayer->setZOrder(0); + clientLayer->write(mWriter); + mWriter->validateDisplay(); + execute(); + + if (mReader->mCompositionChanges.size() != 1) { + mReader->mCompositionChanges.clear(); + continue; + } + // create client target buffer + ASSERT_EQ(1, mReader->mCompositionChanges[0].second); + mGraphicBuffer->reallocate(static_cast(mDisplayWidth), + static_cast(mDisplayHeight), + static_cast(common::PixelFormat::RGBA_8888), + clientLayer->getLayerCount(), clientUsage); + ASSERT_NE(nullptr, mGraphicBuffer->handle); + + void* clientBufData; + mGraphicBuffer->lock(clientUsage, {0, 0, mDisplayWidth, mDisplayHeight}, &clientBufData); + + std::vector clientColors(static_cast(mDisplayWidth * mDisplayHeight)); + ReadbackHelper::fillColorsArea(clientColors, mDisplayWidth, clientFrame, RED); + ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer( + static_cast(mDisplayWidth), static_cast(mDisplayHeight), + mGraphicBuffer->getStride(), clientBufData, clientFormat, clientColors)); + EXPECT_EQ(::android::OK, mGraphicBuffer->unlock()); + + ndk::ScopedFileDescriptor fenceHandle; + EXPECT_TRUE(mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fenceHandle).isOk()); + + clientLayer->setToClientComposition(mWriter); + mWriter->acceptDisplayChanges(); + mWriter->setClientTarget(0, mGraphicBuffer->handle, fenceHandle.get(), clientDataspace, + std::vector(1, clientFrame)); + execute(); + ASSERT_EQ(0, mReader->mCompositionChanges.size()); + ASSERT_EQ(0, mReader->mErrors.size()); + + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + } +} + +TEST_P(GraphicsCompositionTest, SetLayerDamage) { + for (ColorMode mode : mTestColorModes) { + mWriter->selectDisplay(mPrimaryDisplay); + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + mWriter->selectDisplay(mPrimaryDisplay); + + common::Rect redRect = {0, 0, mDisplayWidth / 4, mDisplayHeight / 4}; + + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); + + auto layer = std::make_shared( + mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, + mDisplayHeight, PixelFormat::RGBA_8888); + layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + layer->setZOrder(10); + layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors)); + + std::vector> layers = {layer}; + + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + + writeLayers(layers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + if (mReader->mCompositionChanges.size() != 0) { + clearCommandReaderState(); + GTEST_SUCCEED(); + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + + // update surface damage and recheck + redRect = {mDisplayWidth / 4, mDisplayHeight / 4, mDisplayWidth / 2, mDisplayHeight / 2}; + ReadbackHelper::clearColors(expectedColors, mDisplayWidth, mDisplayHeight, mDisplayWidth); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); + + ASSERT_NO_FATAL_FAILURE(layer->fillBuffer(expectedColors)); + layer->setSurfaceDamage( + std::vector(1, {0, 0, mDisplayWidth / 2, mDisplayWidth / 2})); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + + writeLayers(layers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_EQ(0, mReader->mCompositionChanges.size()); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + } +} + +TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) { + for (ColorMode mode : mTestColorModes) { + mWriter->selectDisplay(mPrimaryDisplay); + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + auto layer = std::make_shared(mComposerClient, mPrimaryDisplay); + layer->setColor(RED); + layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + layer->setZOrder(10); + layer->setAlpha(0); + layer->setBlendMode(BlendMode::PREMULTIPLIED); + + std::vector> layers = {layer}; + + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + + writeLayers(layers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + if (mReader->mCompositionChanges.size() != 0) { + clearCommandReaderState(); + GTEST_SUCCEED(); + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + mTestRenderEngine->setRenderLayers(layers); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors)); + } +} + +TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { + for (ColorMode mode : mTestColorModes) { + mWriter->selectDisplay(mPrimaryDisplay); + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + mWriter->selectDisplay(mPrimaryDisplay); + + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {0, 0, mDisplayWidth, mDisplayHeight / 4}, RED); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, + BLUE); + + auto layer = std::make_shared( + mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, + mDisplayHeight, PixelFormat::RGBA_8888); + layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + layer->setZOrder(10); + layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + layer->setSourceCrop({0, static_cast(mDisplayHeight / 2), + static_cast(mDisplayWidth), + static_cast(mDisplayHeight)}); + ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors)); + + std::vector> layers = {layer}; + + // update expected colors to match crop + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {0, 0, mDisplayWidth, mDisplayHeight}, BLUE); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + writeLayers(layers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + if (mReader->mCompositionChanges.size() != 0) { + clearCommandReaderState(); + GTEST_SUCCEED(); + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + mTestRenderEngine->setRenderLayers(layers); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors)); + } +} + +TEST_P(GraphicsCompositionTest, SetLayerZOrder) { + for (ColorMode mode : mTestColorModes) { + mWriter->selectDisplay(mPrimaryDisplay); + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + common::Rect redRect = {0, 0, mDisplayWidth, mDisplayHeight / 2}; + common::Rect blueRect = {0, mDisplayHeight / 4, mDisplayWidth, mDisplayHeight}; + auto redLayer = std::make_shared(mComposerClient, mPrimaryDisplay); + redLayer->setColor(RED); + redLayer->setDisplayFrame(redRect); + + auto blueLayer = std::make_shared(mComposerClient, mPrimaryDisplay); + blueLayer->setColor(BLUE); + blueLayer->setDisplayFrame(blueRect); + blueLayer->setZOrder(5); + + std::vector> layers = {redLayer, blueLayer}; + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + + // red in front of blue + redLayer->setZOrder(10); + + // fill blue first so that red will overwrite on overlap + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, blueRect, BLUE); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); + + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + + writeLayers(layers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + if (mReader->mCompositionChanges.size() != 0) { + clearCommandReaderState(); + GTEST_SUCCEED(); + return; + } + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + + redLayer->setZOrder(1); + ReadbackHelper::clearColors(expectedColors, mDisplayWidth, mDisplayHeight, mDisplayWidth); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, blueRect, BLUE); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + + writeLayers(layers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + ASSERT_EQ(0, mReader->mCompositionChanges.size()); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + mTestRenderEngine->setRenderLayers(layers); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors)); + } +} + +class GraphicsBlendModeCompositionTest + : public GraphicsCompositionTestBase, + public testing::WithParamInterface> { + public: + void SetUp() override { + SetUpBase(std::get<0>(GetParam())); + mBackgroundColor = BLACK; + mTopLayerColor = RED; + } + + void setBackgroundColor(Color color) { mBackgroundColor = color; } + + void setTopLayerColor(Color color) { mTopLayerColor = color; } + + void setUpLayers(BlendMode blendMode) { + mLayers.clear(); + std::vector topLayerPixelColors(static_cast(mDisplayWidth * mDisplayHeight)); + ReadbackHelper::fillColorsArea(topLayerPixelColors, mDisplayWidth, + {0, 0, mDisplayWidth, mDisplayHeight}, mTopLayerColor); + + auto backgroundLayer = std::make_shared(mComposerClient, mPrimaryDisplay); + backgroundLayer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + backgroundLayer->setZOrder(0); + backgroundLayer->setColor(mBackgroundColor); + + auto layer = std::make_shared( + mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, + mDisplayHeight, PixelFormat::RGBA_8888); + layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + layer->setZOrder(10); + layer->setDataspace(Dataspace::UNKNOWN, mWriter); + ASSERT_NO_FATAL_FAILURE(layer->setBuffer(topLayerPixelColors)); + + layer->setBlendMode(blendMode); + layer->setAlpha(std::stof(std::get<1>(GetParam()))); + + mLayers.push_back(backgroundLayer); + mLayers.push_back(layer); + } + + void setExpectedColors(std::vector& expectedColors) { + ASSERT_EQ(2, mLayers.size()); + ReadbackHelper::clearColors(expectedColors, mDisplayWidth, mDisplayHeight, mDisplayWidth); + + auto layer = mLayers[1]; + BlendMode blendMode = layer->getBlendMode(); + float alpha = mTopLayerColor.a / 255.0f * layer->getAlpha(); + if (blendMode == BlendMode::NONE) { + for (auto& expectedColor : expectedColors) { + expectedColor.r = mTopLayerColor.r * static_cast(layer->getAlpha()); + expectedColor.g = mTopLayerColor.g * static_cast(layer->getAlpha()); + expectedColor.b = mTopLayerColor.b * static_cast(layer->getAlpha()); + expectedColor.a = static_cast(alpha * 255.0); + } + } else if (blendMode == BlendMode::PREMULTIPLIED) { + for (auto& expectedColor : expectedColors) { + expectedColor.r = static_cast( + mTopLayerColor.r * static_cast(layer->getAlpha()) + + mBackgroundColor.r * (1.0 - alpha)); + expectedColor.g = static_cast(mTopLayerColor.g * layer->getAlpha() + + mBackgroundColor.g * (1.0 - alpha)); + expectedColor.b = static_cast(mTopLayerColor.b * layer->getAlpha() + + mBackgroundColor.b * (1.0 - alpha)); + expectedColor.a = static_cast(alpha + mBackgroundColor.a * (1.0 - alpha)); + } + } else if (blendMode == BlendMode::COVERAGE) { + for (auto& expectedColor : expectedColors) { + expectedColor.r = static_cast(mTopLayerColor.r * alpha + + mBackgroundColor.r * (1.0 - alpha)); + expectedColor.g = static_cast(mTopLayerColor.g * alpha + + mBackgroundColor.g * (1.0 - alpha)); + expectedColor.b = static_cast(mTopLayerColor.b * alpha + + mBackgroundColor.b * (1.0 - alpha)); + expectedColor.a = static_cast(mTopLayerColor.a * alpha + + mBackgroundColor.a * (1.0 - alpha)); + } + } + } + + protected: + std::vector> mLayers; + Color mBackgroundColor; + Color mTopLayerColor; +}; + +TEST_P(GraphicsBlendModeCompositionTest, None) { + for (ColorMode mode : mTestColorModes) { + mWriter->selectDisplay(mPrimaryDisplay); + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + mWriter->selectDisplay(mPrimaryDisplay); + + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + + setBackgroundColor(BLACK); + setTopLayerColor(TRANSLUCENT_RED); + setUpLayers(BlendMode::NONE); + setExpectedColors(expectedColors); + + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + writeLayers(mLayers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + if (mReader->mCompositionChanges.size() != 0) { + clearCommandReaderState(); + GTEST_SUCCEED(); + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + mTestRenderEngine->setRenderLayers(mLayers); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors)); + } +} + +TEST_P(GraphicsBlendModeCompositionTest, Coverage) { + for (ColorMode mode : mTestColorModes) { + mWriter->selectDisplay(mPrimaryDisplay); + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + mWriter->selectDisplay(mPrimaryDisplay); + + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + + setBackgroundColor(BLACK); + setTopLayerColor(TRANSLUCENT_RED); + + setUpLayers(BlendMode::COVERAGE); + setExpectedColors(expectedColors); + + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + writeLayers(mLayers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + if (mReader->mCompositionChanges.size() != 0) { + clearCommandReaderState(); + GTEST_SUCCEED(); + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + } +} + +TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) { + for (ColorMode mode : mTestColorModes) { + mWriter->selectDisplay(mPrimaryDisplay); + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + mWriter->selectDisplay(mPrimaryDisplay); + + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + + setBackgroundColor(BLACK); + setTopLayerColor(TRANSLUCENT_RED); + setUpLayers(BlendMode::PREMULTIPLIED); + setExpectedColors(expectedColors); + + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + writeLayers(mLayers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + if (mReader->mCompositionChanges.size() != 0) { + clearCommandReaderState(); + GTEST_SUCCEED(); + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + mTestRenderEngine->setRenderLayers(mLayers); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors)); + } +} + +class GraphicsTransformCompositionTest : public GraphicsCompositionTest { + protected: + void SetUp() override { + GraphicsCompositionTest::SetUp(); + mWriter->selectDisplay(mPrimaryDisplay); + auto backgroundLayer = std::make_shared(mComposerClient, mPrimaryDisplay); + backgroundLayer->setColor({0, 0, 0, 0}); + backgroundLayer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + backgroundLayer->setZOrder(0); + + mSideLength = mDisplayWidth < mDisplayHeight ? mDisplayWidth : mDisplayHeight; + common::Rect redRect = {0, 0, mSideLength / 2, mSideLength / 2}; + common::Rect blueRect = {mSideLength / 2, mSideLength / 2, mSideLength, mSideLength}; + + mLayer = std::make_shared(mComposerClient, mGraphicBuffer, + *mTestRenderEngine, mPrimaryDisplay, mSideLength, + mSideLength, PixelFormat::RGBA_8888); + mLayer->setDisplayFrame({0, 0, mSideLength, mSideLength}); + mLayer->setZOrder(10); + + std::vector baseColors(static_cast(mSideLength * mSideLength)); + ReadbackHelper::fillColorsArea(baseColors, mSideLength, redRect, RED); + ReadbackHelper::fillColorsArea(baseColors, mSideLength, blueRect, BLUE); + ASSERT_NO_FATAL_FAILURE(mLayer->setBuffer(baseColors)); + mLayers = {backgroundLayer, mLayer}; + } + + protected: + std::shared_ptr mLayer; + std::vector> mLayers; + int mSideLength; +}; + +TEST_P(GraphicsTransformCompositionTest, FLIP_H) { + for (ColorMode mode : mTestColorModes) { + ASSERT_NE(nullptr, mWriter); + mWriter->selectDisplay(mPrimaryDisplay); + auto error = + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC); + if (!error.isOk() && + (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED || + error.getServiceSpecificError() == IComposerClient::EX_BAD_PARAMETER)) { + SUCCEED() << "ColorMode not supported, skip test"; + return; + } + + ReadbackBufferAttributes readBackBufferAttributes; + error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + mLayer->setTransform(Transform::FLIP_H); + mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {mSideLength / 2, 0, mSideLength, mSideLength / 2}, RED); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {0, mSideLength / 2, mSideLength / 2, mSideLength}, BLUE); + + writeLayers(mLayers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + if (mReader->mCompositionChanges.size() != 0) { + clearCommandReaderState(); + GTEST_SUCCEED(); + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + mTestRenderEngine->setRenderLayers(mLayers); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors)); + } +} + +TEST_P(GraphicsTransformCompositionTest, FLIP_V) { + for (ColorMode mode : mTestColorModes) { + mWriter->selectDisplay(mPrimaryDisplay); + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + + mLayer->setTransform(Transform::FLIP_V); + mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {0, mSideLength / 2, mSideLength / 2, mSideLength}, RED); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {mSideLength / 2, 0, mSideLength, mSideLength / 2}, BLUE); + + writeLayers(mLayers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + if (mReader->mCompositionChanges.size() != 0) { + clearCommandReaderState(); + GTEST_SUCCEED(); + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + mTestRenderEngine->setRenderLayers(mLayers); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors)); + } +} + +TEST_P(GraphicsTransformCompositionTest, ROT_180) { + for (ColorMode mode : mTestColorModes) { + mWriter->selectDisplay(mPrimaryDisplay); + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + mHasReadbackBuffer = + error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + if (!mHasReadbackBuffer) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + + mLayer->setTransform(Transform::ROT_180); + mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); + + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {mSideLength / 2, mSideLength / 2, mSideLength, mSideLength}, + RED); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + {0, 0, mSideLength / 2, mSideLength / 2}, BLUE); + + writeLayers(mLayers); + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->validateDisplay(); + execute(); + if (!mReader->mCompositionChanges.empty()) { + clearCommandReaderState(); + GTEST_SUCCEED(); + return; + } + ASSERT_EQ(0, mReader->mErrors.size()); + mWriter->presentDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + mTestRenderEngine->setRenderLayers(mLayers); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors)); + } +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsCompositionTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, GraphicsCompositionTest, + testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)), + ::android::PrintInstanceNameToString); + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsBlendModeCompositionTest); +INSTANTIATE_TEST_SUITE_P(BlendMode, GraphicsBlendModeCompositionTest, + testing::Combine(testing::ValuesIn(::android::getAidlHalInstanceNames( + IComposer::descriptor)), + testing::Values("0.2", "1.0"))); + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsTransformCompositionTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, GraphicsTransformCompositionTest, + testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)), + ::android::PrintInstanceNameToString); + +} // namespace +} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp index 00ea4f3d05..2b058c7fdb 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp @@ -29,6 +29,8 @@ cc_library_static { srcs: [ "GraphicsComposerCallback.cpp", "TestCommandReader.cpp", + "ReadbackVts.cpp", + "RenderEngineVts.cpp", ], header_libs: [ "android.hardware.graphics.composer3-command-buffer", @@ -38,20 +40,32 @@ cc_library_static { "android.hardware.graphics.common-V3-ndk", "android.hardware.common-V2-ndk", "android.hardware.common.fmq-V1-ndk", + "libarect", "libgtest", "libbase", "libfmq", "libsync", + "libmath", "libaidlcommonsupport", + "libnativewindow", + "librenderengine", + "libshaders", + "libtonemap", "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", ], shared_libs: [ "libbinder_ndk", "libhidlbase", + "libui", "android.hardware.graphics.composer3-V1-ndk", ], + export_static_lib_headers: [ + "android.hardware.graphics.mapper@2.1-vts", + "librenderengine", + ], cflags: [ "-O0", "-g", diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp new file mode 100644 index 0000000000..e832cb7fc5 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp @@ -0,0 +1,360 @@ +/** + * 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. + */ + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + +#include "include/ReadbackVts.h" +#include +#include "include/RenderEngineVts.h" +#include "renderengine/ExternalTexture.h" + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion + +namespace aidl::android::hardware::graphics::composer3::vts { + +const std::vector ReadbackHelper::colorModes = {ColorMode::SRGB, ColorMode::DISPLAY_P3}; +const std::vector ReadbackHelper::dataspaces = {common::Dataspace::SRGB, + common::Dataspace::DISPLAY_P3}; + +void TestLayer::write(const std::shared_ptr& writer) { + writer->selectLayer(mLayer); + writer->setLayerDisplayFrame(mDisplayFrame); + writer->setLayerSourceCrop(mSourceCrop); + writer->setLayerZOrder(mZOrder); + writer->setLayerSurfaceDamage(mSurfaceDamage); + writer->setLayerTransform(mTransform); + writer->setLayerPlaneAlpha(mAlpha); + writer->setLayerBlendMode(mBlendMode); +} + +std::string ReadbackHelper::getColorModeString(ColorMode mode) { + switch (mode) { + case ColorMode::SRGB: + return {"SRGB"}; + case ColorMode::DISPLAY_P3: + return {"DISPLAY_P3"}; + default: + return {"Unsupported color mode for readback"}; + } +} + +std::string ReadbackHelper::getDataspaceString(common::Dataspace dataspace) { + switch (dataspace) { + case common::Dataspace::SRGB: + return {"SRGB"}; + case common::Dataspace::DISPLAY_P3: + return {"DISPLAY_P3"}; + case common::Dataspace::UNKNOWN: + return {"UNKNOWN"}; + default: + return {"Unsupported dataspace for readback"}; + } +} + +Dataspace ReadbackHelper::getDataspaceForColorMode(ColorMode mode) { + switch (mode) { + case ColorMode::DISPLAY_P3: + return Dataspace::DISPLAY_P3; + case ColorMode::SRGB: + default: + return common::Dataspace::UNKNOWN; + } +} + +LayerSettings TestLayer::toRenderEngineLayerSettings() { + LayerSettings layerSettings; + + layerSettings.alpha = ::android::half(mAlpha); + layerSettings.disableBlending = mBlendMode == BlendMode::NONE; + layerSettings.geometry.boundaries = ::android::FloatRect( + static_cast(mDisplayFrame.left), static_cast(mDisplayFrame.top), + static_cast(mDisplayFrame.right), static_cast(mDisplayFrame.bottom)); + + const ::android::mat4 translation = ::android::mat4::translate(::android::vec4( + (static_cast(mTransform) & static_cast(Transform::FLIP_H) + ? static_cast(-mDisplayFrame.right) + : 0.0f), + (static_cast(mTransform) & static_cast(Transform::FLIP_V) + ? static_cast(-mDisplayFrame.bottom) + : 0.0f), + 0.0f, 1.0f)); + + const ::android::mat4 scale = ::android::mat4::scale(::android::vec4( + static_cast(mTransform) & static_cast(Transform::FLIP_H) ? -1.0f + : 1.0f, + static_cast(mTransform) & static_cast(Transform::FLIP_V) ? -1.0f + : 1.0f, + 1.0f, 1.0f)); + + layerSettings.geometry.positionTransform = scale * translation; + + return layerSettings; +} + +int32_t ReadbackHelper::GetBytesPerPixel(common::PixelFormat pixelFormat) { + switch (pixelFormat) { + case common::PixelFormat::RGBA_8888: + return 4; + case common::PixelFormat::RGB_888: + return 3; + default: + return -1; + } +} + +void ReadbackHelper::fillBuffer(uint32_t width, uint32_t height, uint32_t stride, void* bufferData, + common::PixelFormat pixelFormat, + std::vector desiredPixelColors) { + ASSERT_TRUE(pixelFormat == common::PixelFormat::RGB_888 || + pixelFormat == common::PixelFormat::RGBA_8888); + int32_t bytesPerPixel = GetBytesPerPixel(pixelFormat); + ASSERT_NE(-1, bytesPerPixel); + for (int row = 0; row < height; row++) { + for (int col = 0; col < width; col++) { + auto pixel = row * static_cast(width) + col; + Color srcColor = desiredPixelColors[static_cast(pixel)]; + + int offset = (row * static_cast(stride) + col) * bytesPerPixel; + uint8_t* pixelColor = (uint8_t*)bufferData + offset; + pixelColor[0] = static_cast(srcColor.r); + pixelColor[1] = static_cast(srcColor.g); + pixelColor[2] = static_cast(srcColor.b); + + if (bytesPerPixel == 4) { + pixelColor[3] = static_cast(srcColor.a); + } + } + } +} + +void ReadbackHelper::clearColors(std::vector& expectedColors, int32_t width, int32_t height, + int32_t displayWidth) { + for (int row = 0; row < height; row++) { + for (int col = 0; col < width; col++) { + int pixel = row * displayWidth + col; + expectedColors[static_cast(pixel)] = BLACK; + } + } +} + +void ReadbackHelper::fillColorsArea(std::vector& expectedColors, int32_t stride, Rect area, + Color color) { + for (int row = area.top; row < area.bottom; row++) { + for (int col = area.left; col < area.right; col++) { + int pixel = row * stride + col; + expectedColors[static_cast(pixel)] = color; + } + } +} + +bool ReadbackHelper::readbackSupported(const common::PixelFormat& pixelFormat, + const common::Dataspace& dataspace) { + if (pixelFormat != common::PixelFormat::RGB_888 && + pixelFormat != common::PixelFormat::RGBA_8888) { + return false; + } + if (std::find(dataspaces.begin(), dataspaces.end(), dataspace) == dataspaces.end()) { + return false; + } + return true; +} + +void ReadbackHelper::compareColorBuffers(std::vector& expectedColors, void* bufferData, + const int32_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++) { + auto pixel = row * static_cast(width) + col; + int offset = (row * stride + col) * bytesPerPixel; + uint8_t* pixelColor = (uint8_t*)bufferData + offset; + + ASSERT_EQ(static_cast(expectedColors[static_cast(pixel)].r), + pixelColor[0]); + ASSERT_EQ(static_cast(expectedColors[static_cast(pixel)].g), + pixelColor[1]); + ASSERT_EQ(static_cast(expectedColors[static_cast(pixel)].b), + pixelColor[2]); + } + } +} + +ReadbackBuffer::ReadbackBuffer(int64_t display, const std::shared_ptr& client, + const ::android::sp<::android::GraphicBuffer>& graphicBuffer, + int32_t width, int32_t height, common::PixelFormat pixelFormat, + common::Dataspace dataspace) { + mDisplay = display; + + mComposerClient = client; + mGraphicBuffer = graphicBuffer; + + mPixelFormat = pixelFormat; + mDataspace = dataspace; + + mWidth = static_cast(width); + mHeight = static_cast(height); + mLayerCount = 1; + mUsage = static_cast(static_cast(common::BufferUsage::CPU_READ_OFTEN) | + static_cast(common::BufferUsage::GPU_TEXTURE)); + + mAccessRegion.top = 0; + mAccessRegion.left = 0; + mAccessRegion.right = static_cast(width); + mAccessRegion.bottom = static_cast(height); +} + +::android::sp<::android::GraphicBuffer> ReadbackBuffer::allocate() { + return ::android::sp<::android::GraphicBuffer>::make( + mWidth, mHeight, static_cast<::android::PixelFormat>(mPixelFormat), mLayerCount, mUsage, + "ReadbackVts"); +} + +void ReadbackBuffer::setReadbackBuffer() { + mGraphicBuffer = allocate(); + ASSERT_NE(nullptr, mGraphicBuffer); + ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck()); + aidl::android::hardware::common::NativeHandle bufferHandle = + ::android::dupToAidl(mGraphicBuffer->handle); + ::ndk::ScopedFileDescriptor fence = ::ndk::ScopedFileDescriptor(-1); + EXPECT_TRUE(mComposerClient->setReadbackBuffer(mDisplay, bufferHandle, fence).isOk()); +} + +void ReadbackBuffer::checkReadbackBuffer(std::vector expectedColors) { + // lock buffer for reading + ndk::ScopedFileDescriptor fenceHandle; + EXPECT_TRUE(mComposerClient->getReadbackBufferFence(mDisplay, &fenceHandle).isOk()); + + int outBytesPerPixel; + int outBytesPerStride; + auto status = mGraphicBuffer->lockAsync(mUsage, mAccessRegion, nullptr, fenceHandle.get(), + &outBytesPerPixel, &outBytesPerStride); + EXPECT_EQ(::android::OK, status); + ASSERT_TRUE(mPixelFormat == PixelFormat::RGB_888 || mPixelFormat == PixelFormat::RGBA_8888); + ReadbackHelper::compareColorBuffers(expectedColors, mGraphicBuffer.get(), + static_cast(mStride), mWidth, mHeight, + mPixelFormat); + status = mGraphicBuffer->unlock(); + EXPECT_EQ(::android::OK, status); +} + +void TestColorLayer::write(const std::shared_ptr& writer) { + TestLayer::write(writer); + writer->setLayerCompositionType(Composition::SOLID_COLOR); + writer->setLayerColor(mColor); +} + +LayerSettings TestColorLayer::toRenderEngineLayerSettings() { + LayerSettings layerSettings = TestLayer::toRenderEngineLayerSettings(); + + layerSettings.source.solidColor = + ::android::half3(static_cast<::android::half>(mColor.r) / 255.0, + static_cast<::android::half>(mColor.g) / 255.0, + static_cast<::android::half>(mColor.b) / 255.0); + layerSettings.alpha = + mAlpha * static_cast((static_cast<::android::half>(mColor.a) / 255.0)); + return layerSettings; +} + +TestBufferLayer::TestBufferLayer(const std::shared_ptr& client, + const ::android::sp<::android::GraphicBuffer>& graphicBuffer, + TestRenderEngine& renderEngine, int32_t display, uint32_t width, + uint32_t height, common::PixelFormat format, + Composition composition) + : TestLayer{client, display}, mRenderEngine(renderEngine) { + mGraphicBuffer = graphicBuffer; + mComposition = composition; + mWidth = width; + mHeight = height; + mLayerCount = 1; + mPixelFormat = format; + mUsage = (static_cast(common::BufferUsage::CPU_READ_OFTEN) | + static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | + static_cast(common::BufferUsage::COMPOSER_OVERLAY) | + static_cast(common::BufferUsage::GPU_TEXTURE)); + + mAccessRegion.top = 0; + mAccessRegion.left = 0; + mAccessRegion.right = static_cast(width); + mAccessRegion.bottom = static_cast(height); + + setSourceCrop({0, 0, (float)width, (float)height}); +} + +void TestBufferLayer::write(const std::shared_ptr& writer) { + TestLayer::write(writer); + writer->setLayerCompositionType(mComposition); + writer->setLayerVisibleRegion(std::vector(1, mDisplayFrame)); + if (mGraphicBuffer->handle != nullptr) + writer->setLayerBuffer(0, mGraphicBuffer->handle, mFillFence); +} + +LayerSettings TestBufferLayer::toRenderEngineLayerSettings() { + LayerSettings layerSettings = TestLayer::toRenderEngineLayerSettings(); + layerSettings.source.buffer.buffer = std::make_shared<::android::renderengine::ExternalTexture>( + ::android::sp<::android::GraphicBuffer>::make( + mGraphicBuffer->handle, ::android::GraphicBuffer::CLONE_HANDLE, mWidth, mHeight, + static_cast(mPixelFormat), 1, mUsage, mStride), + mRenderEngine.getInternalRenderEngine(), + ::android::renderengine::ExternalTexture::Usage::READABLE); + + layerSettings.source.buffer.usePremultipliedAlpha = mBlendMode == BlendMode::PREMULTIPLIED; + + const float scaleX = (mSourceCrop.right - mSourceCrop.left) / (static_cast(mWidth)); + const float scaleY = (mSourceCrop.bottom - mSourceCrop.top) / (static_cast(mHeight)); + const float translateX = mSourceCrop.left / (static_cast(mWidth)); + const float translateY = mSourceCrop.top / (static_cast(mHeight)); + + layerSettings.source.buffer.textureTransform = + ::android::mat4::translate(::android::vec4(translateX, translateY, 0, 1)) * + ::android::mat4::scale(::android::vec4(scaleX, scaleY, 1.0, 1.0)); + + return layerSettings; +} + +void TestBufferLayer::fillBuffer(std::vector& expectedColors) { + void* bufData; + auto status = mGraphicBuffer->lock(mUsage, &bufData); + EXPECT_EQ(::android::OK, status); + ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(mWidth, mHeight, mStride, bufData, + mPixelFormat, expectedColors)); + EXPECT_EQ(::android::OK, mGraphicBuffer->unlock()); +} + +void TestBufferLayer::setBuffer(std::vector colors) { + mGraphicBuffer->reallocate(mWidth, mHeight, static_cast<::android::PixelFormat>(mPixelFormat), + mLayerCount, mUsage); + ASSERT_NE(nullptr, mGraphicBuffer); + ASSERT_NE(nullptr, mGraphicBuffer->handle); + ASSERT_NO_FATAL_FAILURE(fillBuffer(colors)); + ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck()); +} + +void TestBufferLayer::setDataspace(common::Dataspace dataspace, + const std::shared_ptr& writer) { + writer->selectLayer(mLayer); + writer->setLayerDataspace(dataspace); +} + +void TestBufferLayer::setToClientComposition(const std::shared_ptr& writer) { + writer->selectLayer(mLayer); + writer->setLayerCompositionType(Composition::CLIENT); +} + +} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp new file mode 100644 index 0000000000..e83750e508 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp @@ -0,0 +1,89 @@ +/** + * 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 "include/RenderEngineVts.h" + +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; + +TestRenderEngine::TestRenderEngine(const RenderEngineCreationArgs& args) { + mFormat = static_cast(args.pixelFormat); + mRenderEngine = ::android::renderengine::RenderEngine::create(args); +} + +TestRenderEngine::~TestRenderEngine() { + mRenderEngine.release(); +} + +void TestRenderEngine::setRenderLayers(std::vector> layers) { + sort(layers.begin(), layers.end(), + [](const std::shared_ptr& lhs, const std::shared_ptr& rhs) -> bool { + return lhs->getZOrder() < rhs->getZOrder(); + }); + + if (!mCompositionLayers.empty()) { + mCompositionLayers.clear(); + } + for (auto& layer : layers) { + LayerSettings settings = layer->toRenderEngineLayerSettings(); + mCompositionLayers.push_back(settings); + } +} + +void TestRenderEngine::initGraphicBuffer(uint32_t width, uint32_t height, uint32_t layerCount, + uint64_t usage) { + mGraphicBuffer = ::android::sp<::android::GraphicBuffer>::make( + width, height, static_cast(mFormat), layerCount, usage); +} + +void TestRenderEngine::drawLayers() { + ::android::base::unique_fd bufferFence; + + std::vector<::android::renderengine::LayerSettings> compositionLayers; + compositionLayers.reserve(mCompositionLayers.size()); + std::transform(mCompositionLayers.begin(), mCompositionLayers.end(), + std::back_insert_iterator(compositionLayers), + [](::android::renderengine::LayerSettings& settings) + -> ::android::renderengine::LayerSettings { return settings; }); + auto texture = std::make_shared<::android::renderengine::ExternalTexture>( + mGraphicBuffer, *mRenderEngine, + ::android::renderengine::ExternalTexture::Usage::WRITEABLE); + auto [status, readyFence] = mRenderEngine + ->drawLayers(mDisplaySettings, compositionLayers, texture, + true, std::move(bufferFence)) + .get(); + int fd = readyFence.release(); + if (fd != -1) { + ASSERT_EQ(0, sync_wait(fd, -1)); + ASSERT_EQ(0, close(fd)); + } +} + +void TestRenderEngine::checkColorBuffer(std::vector& expectedColors) { + void* bufferData; + ASSERT_EQ(0, + mGraphicBuffer->lock(static_cast(mGraphicBuffer->getUsage()), &bufferData)); + ReadbackHelper::compareColorBuffers( + expectedColors, bufferData, static_cast(mGraphicBuffer->getStride()), + mGraphicBuffer->getWidth(), mGraphicBuffer->getHeight(), mFormat); + ASSERT_EQ(::android::OK, mGraphicBuffer->unlock()); +} + +} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h new file mode 100644 index 0000000000..58989d8286 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h @@ -0,0 +1,214 @@ +/** + * 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 + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion + +namespace aidl::android::hardware::graphics::composer3::vts { + +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, 0, 0, static_cast(0xff)}; +static const Color RED = {static_cast(0xff), 0, 0, static_cast(0xff)}; +static const Color TRANSLUCENT_RED = {static_cast(0xff), 0, 0, 0x33}; +static const Color GREEN = {0, static_cast(0xff), 0, static_cast(0xff)}; +static const Color BLUE = {0, 0, static_cast(0xff), static_cast(0xff)}; +static const Color WHITE = {static_cast(0xff), static_cast(0xff), + static_cast(0xff), static_cast(0xff)}; + +class TestRenderEngine; + +class TestLayer { + public: + TestLayer(const std::shared_ptr& client, int32_t display) + : mComposerClient(client) { + client->createLayer(display, kBufferSlotCount, &mLayer); + } + + // ComposerClient will take care of destroying layers, no need to explicitly + // call destroyLayers here + virtual ~TestLayer(){}; + + virtual void write(const std::shared_ptr& writer); + virtual LayerSettings toRenderEngineLayerSettings(); + + void setDisplayFrame(Rect frame) { mDisplayFrame = frame; } + void setSourceCrop(FRect crop) { mSourceCrop = crop; } + void setZOrder(uint32_t z) { mZOrder = z; } + + void setSurfaceDamage(std::vector surfaceDamage) { + mSurfaceDamage = std::move(surfaceDamage); + } + + void setTransform(Transform transform) { mTransform = transform; } + void setAlpha(float alpha) { mAlpha = alpha; } + void setBlendMode(BlendMode blendMode) { mBlendMode = blendMode; } + + BlendMode getBlendMode() const { return mBlendMode; } + + uint32_t getZOrder() const { return mZOrder; } + + float getAlpha() const { return mAlpha; } + + protected: + int64_t mLayer; + Rect mDisplayFrame = {0, 0, 0, 0}; + std::vector mSurfaceDamage; + Transform mTransform = static_cast(0); + FRect mSourceCrop = {0, 0, 0, 0}; + static constexpr uint32_t kBufferSlotCount = 64; + float mAlpha = 1.0; + BlendMode mBlendMode = BlendMode::NONE; + uint32_t mZOrder = 0; + + private: + std::shared_ptr const mComposerClient; +}; + +class TestColorLayer : public TestLayer { + public: + TestColorLayer(const std::shared_ptr& client, int32_t display) + : TestLayer{client, display} {} + + void write(const std::shared_ptr& writer) override; + + LayerSettings toRenderEngineLayerSettings() override; + + void setColor(Color color) { mColor = color; } + + private: + Color mColor = WHITE; +}; + +class TestBufferLayer : public TestLayer { + public: + TestBufferLayer(const std::shared_ptr& client, + const ::android::sp<::android::GraphicBuffer>& graphicBuffer, + TestRenderEngine& renderEngine, int32_t display, uint32_t width, + uint32_t height, common::PixelFormat format, + Composition composition = Composition::DEVICE); + + void write(const std::shared_ptr& writer) override; + + LayerSettings toRenderEngineLayerSettings() override; + + void fillBuffer(std::vector& expectedColors); + + void setBuffer(std::vector colors); + + void setDataspace(Dataspace dataspace, const std::shared_ptr& writer); + + void setToClientComposition(const std::shared_ptr& writer); + + uint32_t getWidth() const { return mWidth; } + + uint32_t getHeight() const { return mHeight; } + + ::android::Rect getAccessRegion() const { return mAccessRegion; } + + uint32_t getLayerCount() const { return mLayerCount; } + + protected: + Composition mComposition; + ::android::sp<::android::GraphicBuffer> mGraphicBuffer; + TestRenderEngine& mRenderEngine; + int32_t mFillFence; + uint32_t mWidth; + uint32_t mHeight; + uint32_t mLayerCount; + PixelFormat mPixelFormat; + uint32_t mUsage; + uint32_t mStride; + ::android::Rect mAccessRegion; +}; + +class ReadbackHelper { + public: + static std::string getColorModeString(ColorMode mode); + + static std::string getDataspaceString(Dataspace dataspace); + + static Dataspace getDataspaceForColorMode(ColorMode mode); + + static int32_t GetBytesPerPixel(PixelFormat pixelFormat); + + static void fillBuffer(uint32_t width, uint32_t height, uint32_t stride, void* bufferData, + PixelFormat pixelFormat, std::vector desiredPixelColors); + + static void clearColors(std::vector& expectedColors, int32_t width, int32_t height, + int32_t displayWidth); + + static void fillColorsArea(std::vector& expectedColors, int32_t stride, Rect area, + Color color); + + static bool readbackSupported(const PixelFormat& pixelFormat, const Dataspace& dataspace); + + static const std::vector colorModes; + static const std::vector dataspaces; + + static void compareColorBuffers(std::vector& expectedColors, void* bufferData, + const int32_t stride, const uint32_t width, + const uint32_t height, PixelFormat pixelFormat); +}; + +class ReadbackBuffer { + public: + ReadbackBuffer(int64_t display, const std::shared_ptr& client, + const ::android::sp<::android::GraphicBuffer>& graphicBuffer, int32_t width, + int32_t height, common::PixelFormat pixelFormat, common::Dataspace dataspace); + + void setReadbackBuffer(); + + void checkReadbackBuffer(std::vector expectedColors); + + ::android::sp<::android::GraphicBuffer> allocate(); + + protected: + uint32_t mWidth; + uint32_t mHeight; + uint32_t mLayerCount; + uint32_t mUsage; + uint32_t mStride; + PixelFormat mPixelFormat; + Dataspace mDataspace; + int64_t mDisplay; + ::android::sp<::android::GraphicBuffer> mGraphicBuffer; + std::shared_ptr mComposerClient; + ::android::Rect mAccessRegion; + native_handle_t mBufferHandle; +}; + +} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h new file mode 100644 index 0000000000..eaff6d7851 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h @@ -0,0 +1,71 @@ +/** + * 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 + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion + +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; + +class TestRenderEngine { + public: + static constexpr uint32_t sMaxFrameBufferAcquireBuffers = 2; + + TestRenderEngine(const RenderEngineCreationArgs& args); + ~TestRenderEngine(); + + void setRenderLayers(std::vector> layers); + void initGraphicBuffer(uint32_t width, uint32_t height, uint32_t layerCount, uint64_t usage); + void setDisplaySettings(DisplaySettings& displaySettings) { + mDisplaySettings = displaySettings; + }; + void drawLayers(); + void checkColorBuffer(std::vector& expectedColors); + + ::android::renderengine::RenderEngine& getInternalRenderEngine() { return *mRenderEngine; } + + private: + common::PixelFormat mFormat; + std::vector<::android::renderengine::LayerSettings> mCompositionLayers; + std::unique_ptr<::android::renderengine::RenderEngine> mRenderEngine; + std::vector<::android::renderengine::LayerSettings> mRenderLayers; + ::android::sp<::android::GraphicBuffer> mGraphicBuffer; + + DisplaySettings mDisplaySettings; +}; + +} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file -- GitLab From 7e54e604c8e4025bc82d19d80358739c8484860e Mon Sep 17 00:00:00 2001 From: Jim Blackler Date: Wed, 17 Nov 2021 16:39:37 +0000 Subject: [PATCH 305/825] Game Loading Time improvement by boosting CPU via ADPF Bug: 201769701 Test: atest android.gamemanager.cts.GameManagerTest Change-Id: Ie4f6855214d07fd73d730f7e261484c0114f0395 --- compatibility_matrices/compatibility_matrix.current.xml | 2 +- .../current/android/hardware/power/Mode.aidl | 1 + power/aidl/android/hardware/power/Mode.aidl | 5 +++++ power/aidl/default/Android.bp | 2 +- power/aidl/default/power-default.xml | 2 +- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 74d93b39ef..2094ed7699 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -453,7 +453,7 @@ android.hardware.power - 1-2 + 1-3 IPower default 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 8920c014e3..ba444a7081 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 @@ -49,4 +49,5 @@ enum Mode { CAMERA_STREAMING_LOW = 12, CAMERA_STREAMING_MID = 13, CAMERA_STREAMING_HIGH = 14, + GAME_LOADING = 15, } diff --git a/power/aidl/android/hardware/power/Mode.aidl b/power/aidl/android/hardware/power/Mode.aidl index ae113e3799..2ebace103f 100644 --- a/power/aidl/android/hardware/power/Mode.aidl +++ b/power/aidl/android/hardware/power/Mode.aidl @@ -162,4 +162,9 @@ enum Mode { * This hint indicates that camera high resolution stream is being started. */ CAMERA_STREAMING_HIGH, + + /** + * This mode indicates that the user is waiting for loading in a game. + */ + GAME_LOADING, } diff --git a/power/aidl/default/Android.bp b/power/aidl/default/Android.bp index 9acb9e044e..223b9d5e6b 100644 --- a/power/aidl/default/Android.bp +++ b/power/aidl/default/Android.bp @@ -30,7 +30,7 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.power-V2-ndk", + "android.hardware.power-V3-ndk", ], srcs: [ "main.cpp", diff --git a/power/aidl/default/power-default.xml b/power/aidl/default/power-default.xml index 9f56debdae..927ba22dbf 100644 --- a/power/aidl/default/power-default.xml +++ b/power/aidl/default/power-default.xml @@ -1,7 +1,7 @@ android.hardware.power - 2 + 3 IPower/default -- GitLab From 4aa4ead85d85ed6a24dab85ec8db94d13ed68967 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Fri, 3 Dec 2021 16:07:19 -0800 Subject: [PATCH 306/825] composer: vts: fix display type display is 64bit and not 32bit Test: build Bug: 202766745 Change-Id: I0e0d53222b306fe303867a105868e85e072c0299 --- .../composer3/vts/functional/composer-vts/ReadbackVts.cpp | 2 +- .../vts/functional/composer-vts/include/ReadbackVts.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp index e832cb7fc5..b612309138 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp @@ -274,7 +274,7 @@ LayerSettings TestColorLayer::toRenderEngineLayerSettings() { TestBufferLayer::TestBufferLayer(const std::shared_ptr& client, const ::android::sp<::android::GraphicBuffer>& graphicBuffer, - TestRenderEngine& renderEngine, int32_t display, uint32_t width, + TestRenderEngine& renderEngine, int64_t display, uint32_t width, uint32_t height, common::PixelFormat format, Composition composition) : TestLayer{client, display}, mRenderEngine(renderEngine) { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h index 58989d8286..85b4fdce2d 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h @@ -53,7 +53,7 @@ class TestRenderEngine; class TestLayer { public: - TestLayer(const std::shared_ptr& client, int32_t display) + TestLayer(const std::shared_ptr& client, int64_t display) : mComposerClient(client) { client->createLayer(display, kBufferSlotCount, &mLayer); } @@ -100,7 +100,7 @@ class TestLayer { class TestColorLayer : public TestLayer { public: - TestColorLayer(const std::shared_ptr& client, int32_t display) + TestColorLayer(const std::shared_ptr& client, int64_t display) : TestLayer{client, display} {} void write(const std::shared_ptr& writer) override; @@ -117,7 +117,7 @@ class TestBufferLayer : public TestLayer { public: TestBufferLayer(const std::shared_ptr& client, const ::android::sp<::android::GraphicBuffer>& graphicBuffer, - TestRenderEngine& renderEngine, int32_t display, uint32_t width, + TestRenderEngine& renderEngine, int64_t display, uint32_t width, uint32_t height, common::PixelFormat format, Composition composition = Composition::DEVICE); -- GitLab From 437dee048f92842f2b849225250545153baaa51e Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Wed, 1 Dec 2021 10:30:13 -0500 Subject: [PATCH 307/825] Add DISPLAY_DECORATION to HWC3 HAL Bug: 193170859 Test: TODO Change-Id: I90543850d57323be485a0fa8562f4e965aed28ab --- .../hardware/graphics/composer3/Composition.aidl | 1 + .../hardware/graphics/composer3/Composition.aidl | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl index e327e8722c..d2d8f0486a 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl @@ -40,4 +40,5 @@ enum Composition { SOLID_COLOR = 3, CURSOR = 4, SIDEBAND = 5, + DISPLAY_DECORATION = 6, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl index ea22af2a68..2f1c62c537 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl @@ -73,4 +73,17 @@ enum Composition { * will display correctly in these cases. */ SIDEBAND = 5, + /** + * A display decoration layer contains a buffer which is an 8 bit + * alpha mask. Pixels in the mask with an alpha of 0 (transparent) will + * show the content underneath, and pixels with an alpha of 255 will be + * be rendered in black. An alpha in between will show the content + * blended with black. This is useful, for example, to provide + * anti-aliasing on the cutout region/rounded corners on the top and + * bottom of a display. + * + * Upon validateDisplay, the device may request a change from this type + * to CLIENT. + */ + DISPLAY_DECORATION = 6, } -- GitLab From b27f33b4b4e386cbba8c2eb5054d04599dc290d6 Mon Sep 17 00:00:00 2001 From: ramindani Date: Fri, 3 Dec 2021 19:36:10 +0000 Subject: [PATCH 308/825] Readback tests from VtsHalGraphicsComposerV2_2TargetTest VTS 2.2 Tests are from https://source.corp.google.com/android/hardware/interfaces/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp;l=431 Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 202766745 Change-Id: I591a7ecfc8bb6ec5e9d764e93a9d43f91b23ea74 --- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 256 ++++++++---------- 1 file changed, 106 insertions(+), 150 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 6f83b90b13..4008cb4dcb 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -51,6 +51,8 @@ class GraphicsCompositionTestBase : public ::testing::Test { // assume the first display is primary and is never removed mPrimaryDisplay = waitForFirstDisplay(); + ASSERT_NO_FATAL_FAILURE(mInvalidDisplayId = GetInvalidDisplayId()); + int32_t activeConfig; EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &activeConfig).isOk()); EXPECT_TRUE(mComposerClient @@ -160,12 +162,22 @@ class GraphicsCompositionTestBase : public ::testing::Test { writer->reset(); } + bool getHasReadbackBuffer() { + ReadbackBufferAttributes readBackBufferAttributes; + const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, + &readBackBufferAttributes); + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + return error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + } + std::shared_ptr mComposer; std::shared_ptr mComposerClient; std::shared_ptr mComposerCallback; // the first display and is assumed never to be removed int64_t mPrimaryDisplay; + int64_t mInvalidDisplayId; int32_t mDisplayWidth; int32_t mDisplayHeight; std::vector mTestColorModes; @@ -174,7 +186,6 @@ class GraphicsCompositionTestBase : public ::testing::Test { ::android::sp<::android::GraphicBuffer> mGraphicBuffer; std::unique_ptr mTestRenderEngine; - bool mHasReadbackBuffer; common::PixelFormat mPixelFormat; common::Dataspace mDataspace; @@ -204,6 +215,27 @@ class GraphicsCompositionTestBase : public ::testing::Test { } } } + + // returns an invalid display id (one that has not been registered to a + // display. Currently assuming that a device will never have close to + // std::numeric_limit::max() displays registered while running tests + int64_t GetInvalidDisplayId() { + int64_t id = std::numeric_limits::max(); + std::vector displays = mComposerCallback->getDisplays(); + while (id > 0) { + if (std::none_of(displays.begin(), displays.end(), + [&](const auto& display) { return id == display; })) { + return id; + } + id--; + } + + // Although 0 could be an invalid display, a return value of 0 + // from GetInvalidDisplayId means all other ids are in use, a condition which + // we are assuming a device will never have + EXPECT_NE(0, id); + return id; + } }; class GraphicsCompositionTest : public GraphicsCompositionTestBase, @@ -218,16 +250,7 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -277,16 +300,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -346,16 +360,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -402,6 +407,64 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { } } +TEST_P(GraphicsCompositionTest, SetReadbackBuffer) { + if (!getHasReadbackBuffer()) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); +} + +TEST_P(GraphicsCompositionTest, SetReadbackBufferBadDisplay) { + if (!getHasReadbackBuffer()) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + ASSERT_NE(nullptr, mGraphicBuffer); + ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck()); + aidl::android::hardware::common::NativeHandle bufferHandle = + ::android::dupToAidl(mGraphicBuffer->handle); + ::ndk::ScopedFileDescriptor fence = ::ndk::ScopedFileDescriptor(-1); + + const auto error = mComposerClient->setReadbackBuffer(mInvalidDisplayId, bufferHandle, fence); + + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} + +TEST_P(GraphicsCompositionTest, SetReadbackBufferBadParameter) { + if (!getHasReadbackBuffer()) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + aidl::android::hardware::common::NativeHandle bufferHandle = ::android::dupToAidl(nullptr); + ndk::ScopedFileDescriptor releaseFence = ndk::ScopedFileDescriptor(-1); + const auto error = + mComposerClient->setReadbackBuffer(mPrimaryDisplay, bufferHandle, releaseFence); + + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError()); +} + +TEST_P(GraphicsCompositionTest, GetReadbackBufferFenceInactive) { + if (!getHasReadbackBuffer()) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + ndk::ScopedFileDescriptor releaseFence; + const auto error = mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &releaseFence); + + EXPECT_TRUE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); +} + TEST_P(GraphicsCompositionTest, ClientComposition) { EXPECT_TRUE(mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kClientTargetSlotCount) .isOk()); @@ -411,16 +474,7 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { EXPECT_TRUE(mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC) .isOk()); - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -513,16 +567,7 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -617,16 +662,7 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -699,16 +735,7 @@ TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) { ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -757,16 +784,7 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -825,16 +843,7 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -994,16 +1003,7 @@ TEST_P(GraphicsBlendModeCompositionTest, None) { ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -1047,16 +1047,7 @@ TEST_P(GraphicsBlendModeCompositionTest, Coverage) { ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -1097,16 +1088,7 @@ TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) { ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -1188,16 +1170,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { return; } - ReadbackBufferAttributes readBackBufferAttributes; - error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -1240,16 +1213,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) { ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -1292,15 +1256,7 @@ TEST_P(GraphicsTransformCompositionTest, ROT_180) { ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - mHasReadbackBuffer = - error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); - if (!mHasReadbackBuffer) { + if (!getHasReadbackBuffer()) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } -- GitLab From c0ae66a05e1a7b79697115e139e0f2e2d69d607f Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Mon, 22 Nov 2021 14:15:42 -0500 Subject: [PATCH 309/825] Add AIDL PixelFormat::R_8 Bug: 193170859 Bug: 209497983 Test: build and boot Test: TODO (b/209458105) Change-Id: I6f6b7f22e76609151a413ca6a6dbf55bd91911dd --- .../android/hardware/graphics/common/PixelFormat.aidl | 1 + .../aidl/android/hardware/graphics/common/PixelFormat.aidl | 7 +++++++ 2 files changed, 8 insertions(+) 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 04a863be0a..512fecbd86 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 @@ -63,4 +63,5 @@ enum PixelFormat { STENCIL_8 = 53, YCBCR_P010 = 54, HSV_888 = 55, + R_8 = 56, } diff --git a/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl b/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl index eb87f8d04f..4e891f6f9d 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl @@ -498,4 +498,11 @@ enum PixelFormat { * interpretation is defined by the dataspace. */ HSV_888 = 0x37, + + /** + * 8 bit format with a single 8-bit component. + * + * The component values are unsigned normalized to the range [0, 1]. + */ + R_8 = 0x38, } -- GitLab From 7f31c14c0c507c264e1e8288665bad354499b561 Mon Sep 17 00:00:00 2001 From: Shinru Han Date: Fri, 5 Nov 2021 11:56:40 +0800 Subject: [PATCH 310/825] Add AGnss AIDL HAL (hardware/interfaces) Bug: 205185251 Test: atest VtsHalGnssTargetTest Change-Id: Id7ea7f4e3cf274af237bb600ad02d573eea3ed70 --- .../current/android/hardware/gnss/IAGnss.aidl | 49 ++++++++++++ .../android/hardware/gnss/IAGnssCallback.aidl | 53 +++++++++++++ .../current/android/hardware/gnss/IGnss.aidl | 1 + gnss/aidl/android/hardware/gnss/IAGnss.aidl | 79 +++++++++++++++++++ .../android/hardware/gnss/IAGnssCallback.aidl | 63 +++++++++++++++ gnss/aidl/android/hardware/gnss/IGnss.aidl | 22 ++++-- gnss/aidl/default/AGnss.cpp | 47 +++++++++++ gnss/aidl/default/AGnss.h | 41 ++++++++++ gnss/aidl/default/Android.bp | 1 + gnss/aidl/default/Gnss.cpp | 7 ++ gnss/aidl/default/Gnss.h | 2 + gnss/aidl/vts/AGnssCallbackAidl.cpp | 24 ++++++ gnss/aidl/vts/AGnssCallbackAidl.h | 31 ++++++++ gnss/aidl/vts/Android.bp | 1 + gnss/aidl/vts/gnss_hal_test_cases.cpp | 24 ++++++ 15 files changed, 438 insertions(+), 7 deletions(-) create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnss.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssCallback.aidl create mode 100644 gnss/aidl/android/hardware/gnss/IAGnss.aidl create mode 100644 gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl create mode 100644 gnss/aidl/default/AGnss.cpp create mode 100644 gnss/aidl/default/AGnss.h create mode 100644 gnss/aidl/vts/AGnssCallbackAidl.cpp create mode 100644 gnss/aidl/vts/AGnssCallbackAidl.h diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnss.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnss.aidl new file mode 100644 index 0000000000..f02e08cc39 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnss.aidl @@ -0,0 +1,49 @@ +/* + * 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 -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.gnss; +@VintfStability +interface IAGnss { + void setCallback(in android.hardware.gnss.IAGnssCallback callback); + void dataConnClosed(); + void dataConnFailed(); + void setServer(in android.hardware.gnss.IAGnssCallback.AGnssType type, in String hostname, in int port); + void dataConnOpen(in long networkHandle, in String apn, in android.hardware.gnss.IAGnss.ApnIpType apnIpType); + @Backing(type="int") @VintfStability + enum ApnIpType { + INVALID = 0, + IPV4 = 1, + IPV6 = 2, + IPV4V6 = 3, + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssCallback.aidl new file mode 100644 index 0000000000..2a46f61758 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssCallback.aidl @@ -0,0 +1,53 @@ +/* + * 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 -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.gnss; +@VintfStability +interface IAGnssCallback { + void agnssStatusCb(in android.hardware.gnss.IAGnssCallback.AGnssType type, in android.hardware.gnss.IAGnssCallback.AGnssStatusValue status); + @Backing(type="int") @VintfStability + enum AGnssType { + SUPL = 1, + C2K = 2, + SUPL_EIMS = 3, + SUPL_IMS = 4, + } + @Backing(type="int") @VintfStability + enum AGnssStatusValue { + REQUEST_AGNSS_DATA_CONN = 1, + RELEASE_AGNSS_DATA_CONN = 2, + AGNSS_DATA_CONNECTED = 3, + AGNSS_DATA_CONN_DONE = 4, + AGNSS_DATA_CONN_FAILED = 5, + } +} 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 9bd04a0eeb..ea980308b7 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 @@ -43,6 +43,7 @@ interface IGnss { @nullable android.hardware.gnss.IGnssBatching getExtensionGnssBatching(); @nullable android.hardware.gnss.IGnssGeofence getExtensionGnssGeofence(); @nullable android.hardware.gnss.IGnssNavigationMessageInterface getExtensionGnssNavigationMessage(); + android.hardware.gnss.IAGnss getExtensionAGnss(); const int ERROR_INVALID_ARGUMENT = 1; const int ERROR_ALREADY_INIT = 2; const int ERROR_GENERIC = 3; diff --git a/gnss/aidl/android/hardware/gnss/IAGnss.aidl b/gnss/aidl/android/hardware/gnss/IAGnss.aidl new file mode 100644 index 0000000000..3e256e2e23 --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/IAGnss.aidl @@ -0,0 +1,79 @@ +/* + * 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. + */ + +package android.hardware.gnss; + +import android.hardware.gnss.IAGnssCallback; +import android.hardware.gnss.IAGnssCallback.AGnssType; + +/** Extended interface for Assisted GNSS support. */ +@VintfStability +interface IAGnss { + /** Access point name IP type */ + @VintfStability + @Backing(type="int") + enum ApnIpType { + INVALID = 0, + IPV4 = 1, + IPV6 = 2, + IPV4V6 = 3, + } + + /** + * Opens the AGNSS interface and provides the callback routines to the + * implementation of this interface. + * + * If setCallback is not called, this interface will not respond to any + * other method calls. + * + * @param callback Handle to the AGNSS status callback interface. + */ + void setCallback(in IAGnssCallback callback); + + /** + * Notifies that the AGNSS data connection has been closed. + */ + void dataConnClosed(); + + /** + * Notifies that a data connection is not available for AGNSS. + */ + void dataConnFailed(); + + /** + * Sets the hostname and port for the AGNSS server. + * + * @param type Specifies if SUPL or C2K. + * @param hostname Hostname of the AGNSS server. + * @param port Port number associated with the server. + */ + void setServer(in AGnssType type, in String hostname, in int port); + + /** + * Notifies GNSS that a data connection is available and sets the network handle, + * name of the APN, and its IP type to be used for SUPL connections. + * + * The HAL implementation must use the network handle to set the network for the + * SUPL connection sockets using the android_setsocknetwork function. This will ensure + * that there is a network path to the SUPL server. The network handle can also be used + * to get the IP address of SUPL FQDN using the android_getaddrinfofornetwork() function. + * + * @param networkHandle Handle representing the network for use with the NDK API. + * @param apn Access Point Name (follows regular APN naming convention). + * @param apnIpType Specifies IP type of APN. + */ + void dataConnOpen(in long networkHandle, in String apn, in ApnIpType apnIpType); +} diff --git a/gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl b/gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl new file mode 100644 index 0000000000..7c2593720e --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/IAGnssCallback.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. + */ + +package android.hardware.gnss; + +/** Callback structure for the AGNSS interface. */ +@VintfStability +interface IAGnssCallback { + /** AGNSS service type */ + @VintfStability + @Backing(type="int") + enum AGnssType { + SUPL = 1, + C2K = 2, + SUPL_EIMS = 3, + SUPL_IMS = 4, + } + + /** AGNSS status value */ + @VintfStability + @Backing(type="int") + enum AGnssStatusValue { + /** GNSS requests data connection for AGNSS. */ + REQUEST_AGNSS_DATA_CONN = 1, + + /** GNSS releases the AGNSS data connection. */ + RELEASE_AGNSS_DATA_CONN = 2, + + /** AGNSS data connection initiated */ + AGNSS_DATA_CONNECTED = 3, + + /** AGNSS data connection completed */ + AGNSS_DATA_CONN_DONE = 4, + + /** AGNSS data connection failed */ + AGNSS_DATA_CONN_FAILED = 5, + } + + /** + * Callback with AGNSS status information. + * + * The GNSS HAL implementation must use this method to request the framework to setup + * network connection for the specified AGNSS service and to update the connection + * status so that the framework can release the resources. + * + * @param type Type of AGNSS service. + * @parama status Status of the data connection. + */ + void agnssStatusCb(in AGnssType type, in AGnssStatusValue status); +} diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl index 42cc496e7d..91403cadfd 100644 --- a/gnss/aidl/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl @@ -16,6 +16,7 @@ package android.hardware.gnss; +import android.hardware.gnss.IAGnss; import android.hardware.gnss.IGnssBatching; import android.hardware.gnss.IGnssCallback; import android.hardware.gnss.IGnssConfiguration; @@ -75,7 +76,7 @@ interface IGnss { /** * This method returns the IGnssPsds interface. * - * @return Handle to the IGnssPsds interface. + * @return The IGnssPsds interface. */ @nullable IGnssPsds getExtensionPsds(); @@ -84,7 +85,7 @@ interface IGnss { * * This method must return non-null. * - * @return Handle to the IGnssConfiguration interface. + * @return The IGnssConfiguration interface. */ IGnssConfiguration getExtensionGnssConfiguration(); @@ -93,7 +94,7 @@ interface IGnss { * * This method must return non-null. * - * @return Handle to the IGnssMeasurementInterface interface. + * @return The IGnssMeasurementInterface interface. */ IGnssMeasurementInterface getExtensionGnssMeasurement(); @@ -102,28 +103,35 @@ interface IGnss { * * This method must return non-null. * - * @return Handle to the IGnssPowerIndication interface. + * @return The IGnssPowerIndication interface. */ IGnssPowerIndication getExtensionGnssPowerIndication(); /** * This method returns the IGnssBatching interface. * - * @return Handle to the IGnssBatching interface. + * @return The IGnssBatching interface. */ @nullable IGnssBatching getExtensionGnssBatching(); /** * This method returns the IGnssGeofence interface. * - * @return Handle to the IGnssGeofence interface. + * @return The IGnssGeofence interface. */ @nullable IGnssGeofence getExtensionGnssGeofence(); /** * This method returns the IGnssNavigationMessageInterface. * - * @return Handle to the IGnssNavigationMessageInterface. + * @return The IGnssNavigationMessageInterface. */ @nullable IGnssNavigationMessageInterface getExtensionGnssNavigationMessage(); + + /** + * This method returns the IAGnss interface. + * + * @return The IAGnss interface. + */ + IAGnss getExtensionAGnss(); } diff --git a/gnss/aidl/default/AGnss.cpp b/gnss/aidl/default/AGnss.cpp new file mode 100644 index 0000000000..e8d5ef7e1e --- /dev/null +++ b/gnss/aidl/default/AGnss.cpp @@ -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. + */ + +#define LOG_TAG "AGnssAidl" + +#include "AGnss.h" +#include +#include + +namespace aidl::android::hardware::gnss { + +std::shared_ptr AGnss::sCallback = nullptr; + +ndk::ScopedAStatus AGnss::setCallback(const std::shared_ptr& callback) { + ALOGD("AGnss::setCallback"); + std::unique_lock lock(mMutex); + sCallback = callback; + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus AGnss::setServer(AGnssType type, const std::string& hostname, int port) { + ALOGD("AGnss::setServer: type: %s, hostname: %s, port: %d", toString(type).c_str(), + hostname.c_str(), port); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus AGnss::dataConnOpen(int64_t networkHandle, const std::string& apn, + ApnIpType apnIpType) { + ALOGD("AGnss::dataConnOpen: networkHandle:%" PRId64 ", apn: %s, apnIpType %s", networkHandle, + apn.c_str(), toString(apnIpType).c_str()); + return ndk::ScopedAStatus::ok(); +} + +} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/AGnss.h b/gnss/aidl/default/AGnss.h new file mode 100644 index 0000000000..cd973e11b6 --- /dev/null +++ b/gnss/aidl/default/AGnss.h @@ -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. + */ + +#pragma once + +#include + +namespace aidl::android::hardware::gnss { + +using AGnssType = IAGnssCallback::AGnssType; + +struct AGnss : public BnAGnss { + public: + ndk::ScopedAStatus setCallback(const std::shared_ptr& callback) override; + ndk::ScopedAStatus dataConnClosed() override { return ndk::ScopedAStatus::ok(); } + ndk::ScopedAStatus dataConnFailed() override { return ndk::ScopedAStatus::ok(); } + ndk::ScopedAStatus setServer(AGnssType type, const std::string& hostname, int port) override; + ndk::ScopedAStatus dataConnOpen(int64_t networkHandle, const std::string& apn, + ApnIpType apnIpType) override; + + private: + // Synchronization lock for sCallback + mutable std::mutex mMutex; + // Guarded by mMutex + static std::shared_ptr sCallback; +}; + +} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index b6df8956fc..1236714bb8 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -55,6 +55,7 @@ cc_binary { "android.hardware.gnss-V2-ndk", ], srcs: [ + "AGnss.cpp", "Gnss.cpp", "GnssBatching.cpp", "GnssGeofence.cpp", diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 8d58a20754..0e3cdd3a6a 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -18,6 +18,7 @@ #include "Gnss.h" #include +#include "AGnss.h" #include "GnssBatching.h" #include "GnssConfiguration.h" #include "GnssGeofence.h" @@ -56,6 +57,12 @@ ndk::ScopedAStatus Gnss::close() { return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Gnss::getExtensionAGnss(std::shared_ptr* iAGnss) { + ALOGD("Gnss::getExtensionAGnss"); + *iAGnss = SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + ndk::ScopedAStatus Gnss::getExtensionPsds(std::shared_ptr* iGnssPsds) { ALOGD("Gnss::getExtensionPsds"); *iGnssPsds = SharedRefBase::make(); diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index 128a6c16a4..4feb781d10 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -16,6 +16,7 @@ #pragma once +#include #include #include #include @@ -44,6 +45,7 @@ class Gnss : public BnGnss { std::shared_ptr* iGnssGeofence) override; ndk::ScopedAStatus getExtensionGnssNavigationMessage( std::shared_ptr* iGnssNavigationMessage) override; + ndk::ScopedAStatus getExtensionAGnss(std::shared_ptr* iAGnss) override; std::shared_ptr mGnssConfiguration; std::shared_ptr mGnssPowerIndication; diff --git a/gnss/aidl/vts/AGnssCallbackAidl.cpp b/gnss/aidl/vts/AGnssCallbackAidl.cpp new file mode 100644 index 0000000000..3327835001 --- /dev/null +++ b/gnss/aidl/vts/AGnssCallbackAidl.cpp @@ -0,0 +1,24 @@ +/* + * 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 "AGnssCallbackAidl.h" +#include + +android::binder::Status AGnssCallbackAidl::agnssStatusCb(const AGnssType type, + const AGnssStatusValue status) { + ALOGI("agnssStatusCb type %d status %d", type, status); + return android::binder::Status::ok(); +} diff --git a/gnss/aidl/vts/AGnssCallbackAidl.h b/gnss/aidl/vts/AGnssCallbackAidl.h new file mode 100644 index 0000000000..6173e85798 --- /dev/null +++ b/gnss/aidl/vts/AGnssCallbackAidl.h @@ -0,0 +1,31 @@ +/* + * 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 + +using AGnssType = android::hardware::gnss::IAGnssCallback::AGnssType; +using AGnssStatusValue = android::hardware::gnss::IAGnssCallback::AGnssStatusValue; + +/** Implementation for IAGnssCallback. */ +class AGnssCallbackAidl : public android::hardware::gnss::BnAGnssCallback { + public: + AGnssCallbackAidl(){}; + ~AGnssCallbackAidl(){}; + android::binder::Status agnssStatusCb(const AGnssType type, + const AGnssStatusValue status) override; +}; diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp index 4d81519f6d..041d579091 100644 --- a/gnss/aidl/vts/Android.bp +++ b/gnss/aidl/vts/Android.bp @@ -30,6 +30,7 @@ cc_test { srcs: [ "gnss_hal_test.cpp", "gnss_hal_test_cases.cpp", + "AGnssCallbackAidl.cpp", "GnssBatchingCallback.cpp", "GnssCallbackAidl.cpp", "GnssGeofenceCallback.cpp", diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 830922c713..970d1cb27b 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -16,12 +16,14 @@ #define LOG_TAG "GnssHalTestCases" +#include #include #include #include #include #include #include +#include "AGnssCallbackAidl.h" #include "GnssBatchingCallback.h" #include "GnssGeofenceCallback.h" #include "GnssMeasurementCallbackAidl.h" @@ -36,6 +38,7 @@ using android::hardware::gnss::GnssClock; using android::hardware::gnss::GnssData; using android::hardware::gnss::GnssMeasurement; using android::hardware::gnss::GnssPowerStats; +using android::hardware::gnss::IAGnss; using android::hardware::gnss::IGnss; using android::hardware::gnss::IGnssBatching; using android::hardware::gnss::IGnssBatchingCallback; @@ -793,3 +796,24 @@ TEST_P(GnssHalTest, TestAllExtensions) { ASSERT_TRUE(status.isOk()); } } + +/* + * TestAGnssExtension: + * 1. Gets the IAGnss extension. + * 2. Sets AGnssCallback. + * 3. Sets SUPL server host/port. + */ +TEST_P(GnssHalTest, TestAGnssExtension) { + sp iAGnss; + auto status = aidl_gnss_hal_->getExtensionAGnss(&iAGnss); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(iAGnss != nullptr); + + auto agnssCallback = sp::make(); + status = iAGnss->setCallback(agnssCallback); + ASSERT_TRUE(status.isOk()); + + // Set SUPL server host/port + status = iAGnss->setServer(AGnssType::SUPL, String16("supl.google.com"), 7275); + ASSERT_TRUE(status.isOk()); +} -- GitLab From 3192f3dfdb24fb539917f697659ef704662311e6 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Fri, 3 Dec 2021 16:08:56 -0800 Subject: [PATCH 311/825] Add Parcelable AidlComposer commands Change the command interface to use parcelables instead of FMQ. Bug: 201008710 Test: VTS Change-Id: Iac67330eb34a5bcf253580e8109a67bd90483d85 --- .../exclude/fcm_exclude.cpp | 1 + .../hardware/graphics/common/Point.aidl} | 9 +- .../hardware/graphics/common/Point.aidl | 27 + graphics/composer/aidl/Android.bp | 7 +- .../graphics/composer3/IComposerClient.aidl | 4 +- .../graphics/composer3/command/Buffer.aidl | 40 + .../command/ChangedCompositionTypes.aidl | 44 + .../composer3/command/ClientTarget.aidl | 40 + .../command/ClientTargetPropertyWithNits.aidl | 40 + .../ColorTransformPayload.aidl} | 9 +- .../composer3/command/CommandPayload.aidl | 39 + .../command/CommandResultPayload.aidl | 44 + .../composer3/command/DisplayCommand.aidl | 45 + .../composer3/command/DisplayRequest.aidl | 48 + .../{BlendMode.aidl => command/Error.aidl} | 12 +- .../composer3/command/GenericMetadata.aidl | 39 + .../LayerCommand.aidl} | 67 +- .../ParcelableBlendMode.aidl} | 9 +- .../command/ParcelableComposition.aidl | 38 + .../command/ParcelableDataspace.aidl | 38 + .../command/ParcelableTransform.aidl | 38 + .../composer3/command/PlaneAlpha.aidl | 38 + .../composer3/command/PresentFence.aidl | 39 + .../composer3/command/PresentOrValidate.aidl | 44 + .../composer3/command/ReleaseFences.aidl | 44 + .../composer3/command/WhitePointNits.aidl | 38 + .../graphics/composer3/command/ZOrder.aidl | 38 + .../hardware/graphics/composer3/Command.aidl | 763 ------------ .../graphics/composer3/IComposerClient.aidl | 43 +- .../composer3/PerFrameMetadataKey.aidl | 2 - .../graphics/composer3/command/Buffer.aidl | 44 + .../ChangedCompositionTypes.aidl} | 38 +- .../ClientTarget.aidl} | 25 +- .../command/ClientTargetPropertyWithNits.aidl | 38 + .../command/ColorTransformPayload.aidl | 33 + .../composer3/command/CommandPayload.aidl | 30 + .../command/CommandResultPayload.aidl | 94 ++ .../composer3/command/DisplayCommand.aidl | 151 +++ .../composer3/command/DisplayRequest.aidl | 72 ++ .../{LayerRequest.aidl => command/Error.aidl} | 18 +- .../composer3/command/GenericMetadata.aidl | 33 + .../composer3/command/LayerCommand.aidl | 301 +++++ .../command/ParcelableBlendMode.aidl | 24 + .../command/ParcelableComposition.aidl | 24 + .../command/ParcelableDataspace.aidl | 24 + .../command/ParcelableTransform.aidl | 24 + .../composer3/command/PlaneAlpha.aidl | 27 + .../PresentFence.aidl} | 23 +- .../composer3/command/PresentOrValidate.aidl | 32 + .../composer3/command/ReleaseFences.aidl | 44 + .../composer3/command/WhitePointNits.aidl | 29 + .../graphics/composer3/command/ZOrder.aidl | 27 + .../graphics/composer3/translate-ndk.cpp | 197 +-- .../composer3/vts/functional/Android.bp | 1 - .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 395 +++--- .../VtsHalGraphicsComposer3_TargetTest.cpp | 403 ++++--- .../vts/functional/composer-vts/Android.bp | 1 - .../functional/composer-vts/ReadbackVts.cpp | 44 +- .../composer-vts/RenderEngineVts.cpp | 2 +- .../composer-vts/TestCommandReader.cpp | 92 -- .../composer-vts/include/ReadbackVts.h | 18 +- .../composer-vts/include/RenderEngineVts.h | 2 +- .../composer-vts/include/TestCommandReader.h | 41 - .../graphics/composer3/command-buffer.h | 1074 ++++++----------- .../graphics/composer3/translate-ndk.h | 5 +- 65 files changed, 2784 insertions(+), 2333 deletions(-) rename graphics/{composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl => common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl} (92%) create mode 100644 graphics/common/aidl/android/hardware/graphics/common/Point.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Buffer.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTarget.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{ExecuteCommandsStatus.aidl => command/ColorTransformPayload.aidl} (91%) create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandPayload.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandResultPayload.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayCommand.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayRequest.aidl rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{BlendMode.aidl => command/Error.aidl} (91%) create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/GenericMetadata.aidl rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{Command.aidl => command/LayerCommand.aidl} (51%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{DisplayRequest.aidl => command/ParcelableBlendMode.aidl} (91%) create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableTransform.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PlaneAlpha.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentOrValidate.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ReleaseFences.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/WhitePointNits.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ZOrder.aidl delete mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/Buffer.aidl rename graphics/composer/aidl/android/hardware/graphics/composer3/{DisplayRequest.aidl => command/ChangedCompositionTypes.aidl} (51%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{ExecuteCommandsStatus.aidl => command/ClientTarget.aidl} (60%) create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandPayload.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandResultPayload.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayCommand.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayRequest.aidl rename graphics/composer/aidl/android/hardware/graphics/composer3/{LayerRequest.aidl => command/Error.aidl} (65%) create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/GenericMetadata.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/LayerCommand.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableTransform.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/PlaneAlpha.aidl rename graphics/composer/aidl/android/hardware/graphics/composer3/{BlendMode.aidl => command/PresentFence.aidl} (64%) create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentOrValidate.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/ReleaseFences.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/WhitePointNits.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/ZOrder.aidl delete mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/TestCommandReader.cpp delete mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/TestCommandReader.h diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp index 2aa4bb2a22..720a76769c 100644 --- a/compatibility_matrices/exclude/fcm_exclude.cpp +++ b/compatibility_matrices/exclude/fcm_exclude.cpp @@ -56,6 +56,7 @@ bool ShouldCheckMissingHalsInFcm(const std::string& package) { "android.hardware.common", "android.hardware.common.fmq", "android.hardware.graphics.common", + "android.hardware.graphics.composer3.command", "android.hardware.keymaster", "android.hardware.radio", "android.hardware.uwb.fira_android", diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl similarity index 92% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl rename to graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl index cfafc50395..3722803cfe 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl @@ -31,8 +31,9 @@ // 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 LayerRequest { - CLEAR_CLIENT_TARGET = 1, +package android.hardware.graphics.common; +@VintfStability +parcelable Point { + int x; + int y; } diff --git a/graphics/common/aidl/android/hardware/graphics/common/Point.aidl b/graphics/common/aidl/android/hardware/graphics/common/Point.aidl new file mode 100644 index 0000000000..b3ede44ad6 --- /dev/null +++ b/graphics/common/aidl/android/hardware/graphics/common/Point.aidl @@ -0,0 +1,27 @@ +/** + * 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. + */ + +package android.hardware.graphics.common; + +/** + * General purpose definition of a point. + */ + +@VintfStability +parcelable Point { + int x; + int y; +} diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp index e33c6537e9..903413886a 100644 --- a/graphics/composer/aidl/Android.bp +++ b/graphics/composer/aidl/Android.bp @@ -31,12 +31,14 @@ aidl_interface { enabled: true, support_system_process: true, }, - srcs: ["android/hardware/graphics/composer3/*.aidl"], + srcs: [ + "android/hardware/graphics/composer3/*.aidl", + "android/hardware/graphics/composer3/command/*.aidl", + ], stability: "vintf", imports: [ "android.hardware.graphics.common-V3", "android.hardware.common-V2", - "android.hardware.common.fmq-V1", ], backend: { cpp: { @@ -73,6 +75,7 @@ cc_library_headers { vendor_available: true, shared_libs: [ "android.hardware.graphics.composer3-V1-ndk", + "android.hardware.common-V2-ndk", "libbase", "libfmq", "libsync", 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 d7cab2b4e8..65cf86ccca 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 @@ -38,7 +38,7 @@ interface IComposerClient { android.hardware.graphics.composer3.VirtualDisplay createVirtualDisplay(int width, int height, android.hardware.graphics.common.PixelFormat formatHint, int outputBufferSlotCount); void destroyLayer(long display, long layer); void destroyVirtualDisplay(long display); - android.hardware.graphics.composer3.ExecuteCommandsStatus executeCommands(int inLength, in android.hardware.common.NativeHandle[] inHandles); + android.hardware.graphics.composer3.command.CommandResultPayload[] executeCommands(in android.hardware.graphics.composer3.command.CommandPayload[] commands); int getActiveConfig(long display); android.hardware.graphics.composer3.ColorMode[] getColorModes(long display); float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); @@ -56,7 +56,6 @@ interface IComposerClient { android.hardware.graphics.composer3.HdrCapabilities getHdrCapabilities(long display); android.hardware.graphics.composer3.LayerGenericMetadataKey[] getLayerGenericMetadataKeys(); int getMaxVirtualDisplayCount(); - android.hardware.common.fmq.MQDescriptor getOutputCommandQueue(); android.hardware.graphics.composer3.PerFrameMetadataKey[] getPerFrameMetadataKeys(long display); android.hardware.graphics.composer3.ReadbackBufferAttributes getReadbackBufferAttributes(long display); ParcelFileDescriptor getReadbackBufferFence(long display); @@ -71,7 +70,6 @@ interface IComposerClient { void setContentType(long display, android.hardware.graphics.composer3.ContentType type); void setDisplayBrightness(long display, float brightness); void setDisplayedContentSamplingEnabled(long display, boolean enable, android.hardware.graphics.composer3.FormatColorComponent componentMask, long maxFrames); - void setInputCommandQueue(in android.hardware.common.fmq.MQDescriptor descriptor); void setPowerMode(long display, android.hardware.graphics.composer3.PowerMode mode); void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, in ParcelFileDescriptor releaseFence); void setVsyncEnabled(long display, boolean enabled); diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Buffer.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Buffer.aidl new file mode 100644 index 0000000000..cead848efd --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Buffer.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 -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.command; +@VintfStability +parcelable Buffer { + int slot; + @nullable android.hardware.common.NativeHandle handle; + @nullable ParcelFileDescriptor fence; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl new file mode 100644 index 0000000000..1377c6c00d --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ChangedCompositionTypes.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 -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.command; +@VintfStability +parcelable ChangedCompositionTypes { + long display; + android.hardware.graphics.composer3.command.ChangedCompositionTypes.Layer[] layers; + @VintfStability + parcelable Layer { + long layer; + android.hardware.graphics.composer3.Composition composition; + } +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTarget.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTarget.aidl new file mode 100644 index 0000000000..c3f4700c55 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTarget.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 -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.command; +@VintfStability +parcelable ClientTarget { + android.hardware.graphics.composer3.command.Buffer buffer; + android.hardware.graphics.common.Dataspace dataspace; + android.hardware.graphics.common.Rect[] damage; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl new file mode 100644 index 0000000000..b690a57596 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.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 -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.command; +@VintfStability +parcelable ClientTargetPropertyWithNits { + long display; + android.hardware.graphics.composer3.ClientTargetProperty clientTargetProperty; + float whitePointNits; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl similarity index 91% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl index 41a1afeef2..0b3071c0fd 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl @@ -31,10 +31,9 @@ // 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; +package android.hardware.graphics.composer3.command; @VintfStability -parcelable ExecuteCommandsStatus { - boolean queueChanged; - int length; - android.hardware.common.NativeHandle[] handles; +parcelable ColorTransformPayload { + float[] matrix; + android.hardware.graphics.common.ColorTransform hint; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandPayload.aidl new file mode 100644 index 0000000000..984830630a --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandPayload.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 -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.command; +@VintfStability +union CommandPayload { + android.hardware.graphics.composer3.command.DisplayCommand displayCommand; + android.hardware.graphics.composer3.command.LayerCommand layerCommand; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandResultPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandResultPayload.aidl new file mode 100644 index 0000000000..1b3cae83e6 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandResultPayload.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 -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.command; +@VintfStability +union CommandResultPayload { + android.hardware.graphics.composer3.command.Error error; + android.hardware.graphics.composer3.command.ChangedCompositionTypes changedCompositionType; + android.hardware.graphics.composer3.command.DisplayRequest displayRequest; + android.hardware.graphics.composer3.command.PresentFence presentFence; + android.hardware.graphics.composer3.command.ReleaseFences releaseFences; + android.hardware.graphics.composer3.command.PresentOrValidate presentOrValidateResult; + android.hardware.graphics.composer3.command.ClientTargetPropertyWithNits clientTargetProperty; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayCommand.aidl new file mode 100644 index 0000000000..7446db02ad --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayCommand.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 -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.command; +@VintfStability +parcelable DisplayCommand { + long display; + @nullable android.hardware.graphics.composer3.command.ColorTransformPayload colorTransform; + @nullable android.hardware.graphics.composer3.command.ClientTarget clientTarget; + @nullable android.hardware.graphics.composer3.command.Buffer virtualDisplayOutputBuffer; + boolean validateDisplay; + boolean acceptDisplayChanges; + boolean presentDisplay; + boolean presentOrValidateDisplay; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayRequest.aidl new file mode 100644 index 0000000000..7f413a9b62 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayRequest.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 -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.command; +@VintfStability +parcelable DisplayRequest { + long display; + int mask; + android.hardware.graphics.composer3.command.DisplayRequest.LayerRequest[] layerRequests; + const int FLIP_CLIENT_TARGET = 1; + const int WRITE_CLIENT_TARGET_TO_OUTPUT = 2; + @VintfStability + parcelable LayerRequest { + long layer; + int mask; + const int CLEAR_CLIENT_TARGET = 1; + } +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BlendMode.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Error.aidl similarity index 91% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BlendMode.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Error.aidl index a522d53e65..1726ea5bb1 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BlendMode.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Error.aidl @@ -31,11 +31,9 @@ // 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 BlendMode { - INVALID = 0, - NONE = 1, - PREMULTIPLIED = 2, - COVERAGE = 3, +package android.hardware.graphics.composer3.command; +@VintfStability +parcelable Error { + int commandIndex; + int errorCode; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/GenericMetadata.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/GenericMetadata.aidl new file mode 100644 index 0000000000..be889d8d44 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/GenericMetadata.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 -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.command; +@VintfStability +parcelable GenericMetadata { + android.hardware.graphics.composer3.LayerGenericMetadataKey key; + byte[] value; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/LayerCommand.aidl similarity index 51% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/LayerCommand.aidl index e19105d4ab..b5adbc307d 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/LayerCommand.aidl @@ -31,46 +31,29 @@ // 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 Command { - LENGTH_MASK = 65535, - OPCODE_SHIFT = 16, - OPCODE_MASK = -65536, - SELECT_DISPLAY = 0, - SELECT_LAYER = 65536, - SET_ERROR = 16777216, - SET_CHANGED_COMPOSITION_TYPES = 16842752, - SET_DISPLAY_REQUESTS = 16908288, - SET_PRESENT_FENCE = 16973824, - SET_RELEASE_FENCES = 17039360, - SET_COLOR_TRANSFORM = 33554432, - SET_CLIENT_TARGET = 33619968, - SET_OUTPUT_BUFFER = 33685504, - VALIDATE_DISPLAY = 33751040, - ACCEPT_DISPLAY_CHANGES = 33816576, - PRESENT_DISPLAY = 33882112, - PRESENT_OR_VALIDATE_DISPLAY = 33947648, - SET_LAYER_CURSOR_POSITION = 50331648, - SET_LAYER_BUFFER = 50397184, - SET_LAYER_SURFACE_DAMAGE = 50462720, - SET_LAYER_BLEND_MODE = 67108864, - SET_LAYER_COLOR = 67174400, - SET_LAYER_COMPOSITION_TYPE = 67239936, - SET_LAYER_DATASPACE = 67305472, - SET_LAYER_DISPLAY_FRAME = 67371008, - SET_LAYER_PLANE_ALPHA = 67436544, - SET_LAYER_SIDEBAND_STREAM = 67502080, - SET_LAYER_SOURCE_CROP = 67567616, - SET_LAYER_TRANSFORM = 67633152, - SET_LAYER_VISIBLE_REGION = 67698688, - SET_LAYER_Z_ORDER = 67764224, - SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT = 67829760, - SET_LAYER_PER_FRAME_METADATA = 50528256, - SET_LAYER_FLOAT_COLOR = 67895296, - SET_LAYER_COLOR_TRANSFORM = 67960832, - SET_LAYER_PER_FRAME_METADATA_BLOBS = 50593792, - SET_CLIENT_TARGET_PROPERTY = 17104896, - SET_LAYER_GENERIC_METADATA = 68026368, - SET_LAYER_WHITE_POINT_NITS = 50659328, +package android.hardware.graphics.composer3.command; +@VintfStability +parcelable LayerCommand { + long display; + long layer; + @nullable android.hardware.graphics.common.Point cursorPosition; + @nullable android.hardware.graphics.composer3.command.Buffer buffer; + @nullable android.hardware.graphics.common.Rect[] damage; + @nullable android.hardware.graphics.composer3.command.ParcelableBlendMode blendMode; + @nullable android.hardware.graphics.composer3.Color color; + @nullable android.hardware.graphics.composer3.FloatColor floatColor; + @nullable android.hardware.graphics.composer3.command.ParcelableComposition composition; + @nullable android.hardware.graphics.composer3.command.ParcelableDataspace dataspace; + @nullable android.hardware.graphics.common.Rect displayFrame; + @nullable android.hardware.graphics.composer3.command.PlaneAlpha planeAlpha; + @nullable android.hardware.common.NativeHandle sidebandStream; + @nullable android.hardware.graphics.common.FRect sourceCrop; + @nullable android.hardware.graphics.composer3.command.ParcelableTransform transform; + @nullable android.hardware.graphics.common.Rect[] visibleRegion; + @nullable android.hardware.graphics.composer3.command.ZOrder z; + @nullable float[] colorTransform; + @nullable android.hardware.graphics.composer3.command.WhitePointNits whitePointNits; + @nullable android.hardware.graphics.composer3.command.GenericMetadata genericMetadata; + @nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata; + @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob; } 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/command/ParcelableBlendMode.aidl similarity index 91% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl index 26e7d97727..5e6d212c65 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/command/ParcelableBlendMode.aidl @@ -31,9 +31,8 @@ // 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 DisplayRequest { - FLIP_CLIENT_TARGET = 1, - WRITE_CLIENT_TARGET_TO_OUTPUT = 2, +package android.hardware.graphics.composer3.command; +@VintfStability +parcelable ParcelableBlendMode { + android.hardware.graphics.common.BlendMode blendMode; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl new file mode 100644 index 0000000000..40637a9f57 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.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 -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.command; +@VintfStability +parcelable ParcelableComposition { + android.hardware.graphics.composer3.Composition composition; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl new file mode 100644 index 0000000000..8f06079421 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableDataspace.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 -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.command; +@VintfStability +parcelable ParcelableDataspace { + android.hardware.graphics.common.Dataspace dataspace; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableTransform.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableTransform.aidl new file mode 100644 index 0000000000..6d6fe5b89f --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableTransform.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 -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.command; +@VintfStability +parcelable ParcelableTransform { + android.hardware.graphics.common.Transform transform; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PlaneAlpha.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PlaneAlpha.aidl new file mode 100644 index 0000000000..97f5329817 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PlaneAlpha.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 -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.command; +@VintfStability +parcelable PlaneAlpha { + float alpha; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl new file mode 100644 index 0000000000..906f20c74c --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.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 -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.command; +@VintfStability +parcelable PresentFence { + long display; + ParcelFileDescriptor fence; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentOrValidate.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentOrValidate.aidl new file mode 100644 index 0000000000..66f1c0356b --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentOrValidate.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 -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.command; +@VintfStability +parcelable PresentOrValidate { + long display; + android.hardware.graphics.composer3.command.PresentOrValidate.Result result; + @VintfStability + enum Result { + Presented = 0, + Validated = 1, + } +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ReleaseFences.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ReleaseFences.aidl new file mode 100644 index 0000000000..b7d258652d --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ReleaseFences.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 -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.command; +@VintfStability +parcelable ReleaseFences { + long display; + android.hardware.graphics.composer3.command.ReleaseFences.Layer[] layers; + @VintfStability + parcelable Layer { + long layer; + ParcelFileDescriptor fence; + } +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/WhitePointNits.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/WhitePointNits.aidl new file mode 100644 index 0000000000..2b251677ab --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/WhitePointNits.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 -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.command; +@VintfStability +parcelable WhitePointNits { + float nits; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ZOrder.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ZOrder.aidl new file mode 100644 index 0000000000..69b68c49b4 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ZOrder.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 -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.command; +@VintfStability +parcelable ZOrder { + int z; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl deleted file mode 100644 index 95c07ac354..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl +++ /dev/null @@ -1,763 +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. - */ - -package android.hardware.graphics.composer3; - -import android.hardware.graphics.composer3.Command; - -/** - * The command interface allows composer3 to reduce binder overhead by sending - * atomic command stream in a command message queue. These commands are usually - * sent on a per frame basic and contains the information that describes how the - * display is composited. @see IComposerClient.executeCommands. - */ -@VintfStability -@Backing(type="int") -enum Command { - LENGTH_MASK = 0xffff, - OPCODE_SHIFT = 16, - OPCODE_MASK = 0xffff << OPCODE_SHIFT, - - // special commands - - /** - * SELECT_DISPLAY has this pseudo prototype - * - * selectDisplay(long display); - * - * Selects the current display implied by all other commands. - * - * @param display is the newly selected display. - */ - SELECT_DISPLAY = 0x000 << OPCODE_SHIFT, - - /** - * SELECT_LAYER has this pseudo prototype - * - * selectLayer(long layer); - * - * Selects the current layer implied by all implicit layer commands. - * - * @param layer is the newly selected layer. - */ - SELECT_LAYER = 0x001 << OPCODE_SHIFT, - - // value commands (for return values) - - /** - * SET_ERROR has this pseudo prototype - * - * setError(uint32_t location, int error); - * - * Indicates an error generated by a command. - * - * @param location is the offset of the command in the input command - * message queue. - * @param error is the error generated by the command. - */ - SET_ERROR = 0x100 << OPCODE_SHIFT, - - /** - * SET_CHANGED_COMPOSITION_TYPES has this pseudo prototype - * - * setChangedCompositionTypes(long[] layers, - * Composition[] types); - * - * Sets the layers for which the device requires a different composition - * type than had been set prior to the last call to VALIDATE_DISPLAY. The - * client must either update its state with these types and call - * ACCEPT_DISPLAY_CHANGES, or must set new types and attempt to validate - * the display again. - * - * @param layers is an array of layer handles. - * @param types is an array of composition types, each corresponding to - * an element of layers. - */ - SET_CHANGED_COMPOSITION_TYPES = 0x101 << OPCODE_SHIFT, - - /** - * SET_DISPLAY_REQUESTS has this pseudo prototype - * - * setDisplayRequests(int displayRequestMask, - * long[] layers, - * int[] layerRequestMasks); - * - * Sets the display requests and the layer requests required for the last - * validated configuration. - * - * Display requests provide information about how the client must handle - * the client target. Layer requests provide information about how the - * client must handle an individual layer. - * - * @param displayRequestMask is the display requests for the current - * validated state. - * @param layers is an array of layers which all have at least one - * request. - * @param layerRequestMasks is the requests corresponding to each element - * of layers. - */ - SET_DISPLAY_REQUESTS = 0x102 << OPCODE_SHIFT, - - /** - * SET_PRESENT_FENCE has this pseudo prototype - * - * setPresentFence(int presentFenceIndex); - * - * Sets the present fence as a result of PRESENT_DISPLAY. For physical - * displays, this fence must be signaled at the vsync when the result - * of composition of this frame starts to appear (for video-mode panels) - * or starts to transfer to panel memory (for command-mode panels). For - * virtual displays, this fence must be signaled when writes to the output - * buffer have completed and it is safe to read from it. - * - * @param presentFenceIndex is an index into outHandles array. - */ - SET_PRESENT_FENCE = 0x103 << OPCODE_SHIFT, - - /** - * SET_RELEASE_FENCES has this pseudo prototype - * - * setReleaseFences(long[] layers, - * int[] releaseFenceIndices); - * - * Sets the release fences for device layers on this display which will - * receive new buffer contents this frame. - * - * A release fence is a file descriptor referring to a sync fence object - * which must be signaled after the device has finished reading from the - * buffer presented in the prior frame. This indicates that it is safe to - * start writing to the buffer again. If a given layer's fence is not - * returned from this function, it must be assumed that the buffer - * presented on the previous frame is ready to be written. - * - * The fences returned by this function must be unique for each layer - * (even if they point to the same underlying sync object). - * - * @param layers is an array of layer handles. - * @param releaseFenceIndices are indices into outHandles array, each - * corresponding to an element of layers. - */ - SET_RELEASE_FENCES = 0x104 << OPCODE_SHIFT, - - // display commands - - /** - * SET_COLOR_TRANSFORM has this pseudo prototype - * - * setColorTransform(float[16] matrix, - * ColorTransform hint); - * - * Sets a color transform which will be applied after composition. - * - * If hint is not ColorTransform::ARBITRARY, then the device may use the - * hint to apply the desired color transform instead of using the color - * matrix directly. - * - * If the device is not capable of either using the hint or the matrix to - * apply the desired color transform, it must force all layers to client - * composition during VALIDATE_DISPLAY. - * - * If IComposer::Capability::SKIP_CLIENT_COLOR_TRANSFORM is present, then - * the client must never apply the color transform during client - * composition, even if all layers are being composed by the client. - * - * The matrix provided is an affine color transformation of the following - * form: - * - * |r.r r.g r.b 0| - * |g.r g.g g.b 0| - * |b.r b.g b.b 0| - * |Tr Tg Tb 1| - * - * This matrix must be provided in row-major form: - * - * {r.r, r.g, r.b, 0, g.r, ...}. - * - * Given a matrix of this form and an input color [R_in, G_in, B_in], the - * output color [R_out, G_out, B_out] will be: - * - * R_out = R_in * r.r + G_in * g.r + B_in * b.r + Tr - * G_out = R_in * r.g + G_in * g.g + B_in * b.g + Tg - * B_out = R_in * r.b + G_in * g.b + B_in * b.b + Tb - * - * @param matrix is a 4x4 transform matrix (16 floats) as described above. - * @param hint is a hint value which may be used instead of the given - * matrix unless it is ColorTransform::ARBITRARY. - */ - SET_COLOR_TRANSFORM = 0x200 << OPCODE_SHIFT, - - /** - * SET_CLIENT_TARGET has this pseudo prototype - * - * setClientTarget(int targetSlot, - * int targetIndex, - * int acquireFenceIndex, - * android.hardware.graphics.common.Dataspace dataspace, - * Rect[] damage); - * - * Sets the buffer handle which will receive the output of client - * composition. Layers marked as Composition::CLIENT must be composited - * into this buffer prior to the call to PRESENT_DISPLAY, and layers not - * marked as Composition::CLIENT must be composited with this buffer by - * the device. - * - * The buffer handle provided may be empty if no layers are being - * composited by the client. This must not result in an error (unless an - * invalid display handle is also provided). - * - * Also provides a file descriptor referring to an acquire sync fence - * object, which must be signaled when it is safe to read from the client - * target buffer. If it is already safe to read from this buffer, an - * empty handle may be passed instead. - * - * For more about dataspaces, see SET_LAYER_DATASPACE. - * - * The damage parameter describes a surface damage region as defined in - * the description of SET_LAYER_SURFACE_DAMAGE. - * - * Will be called before PRESENT_DISPLAY if any of the layers are marked - * as Composition::CLIENT. If no layers are so marked, then it is not - * necessary to call this function. It is not necessary to call - * validateDisplay after changing the target through this function. - * - * @param targetSlot is the client target buffer slot to use. - * @param targetIndex is an index into inHandles for the new target - * buffer. - * @param acquireFenceIndex is an index into inHandles for a sync fence - * file descriptor as described above. - * @param dataspace is the dataspace of the buffer, as described in - * setLayerDataspace. - * @param damage is the surface damage region. - * - */ - SET_CLIENT_TARGET = 0x201 << OPCODE_SHIFT, - - /** - * SET_OUTPUT_BUFFER has this pseudo prototype - * - * setOutputBuffer(int bufferSlot, - * int bufferIndex, - * int releaseFenceIndex); - * - * Sets the output buffer for a virtual display. That is, the buffer to - * which the composition result will be written. - * - * Also provides a file descriptor referring to a release sync fence - * object, which must be signaled when it is safe to write to the output - * buffer. If it is already safe to write to the output buffer, an empty - * handle may be passed instead. - * - * Must be called at least once before PRESENT_DISPLAY, but does not have - * any interaction with layer state or display validation. - * - * @param bufferSlot is the new output buffer. - * @param bufferIndex is the new output buffer. - * @param releaseFenceIndex is a sync fence file descriptor as described - * above. - */ - SET_OUTPUT_BUFFER = 0x202 << OPCODE_SHIFT, - - /** - * VALIDATE_DISPLAY has this pseudo prototype - * - * validateDisplay(); - * - * Instructs the device to inspect all of the layer state and determine if - * there are any composition type changes necessary before presenting the - * display. Permitted changes are described in the definition of - * Composition above. - */ - VALIDATE_DISPLAY = 0x203 << OPCODE_SHIFT, - - /** - * ACCEPT_DISPLAY_CHANGES has this pseudo prototype - * - * acceptDisplayChanges(); - * - * Accepts the changes required by the device from the previous - * validateDisplay call (which may be queried using - * getChangedCompositionTypes) and revalidates the display. This function - * is equivalent to requesting the changed types from - * getChangedCompositionTypes, setting those types on the corresponding - * layers, and then calling validateDisplay again. - * - * After this call it must be valid to present this display. Calling this - * after validateDisplay returns 0 changes must succeed with NONE, but - * must have no other effect. - */ - ACCEPT_DISPLAY_CHANGES = 0x204 << OPCODE_SHIFT, - - /** - * PRESENT_DISPLAY has this pseudo prototype - * - * presentDisplay(); - * - * Presents the current display contents on the screen (or in the case of - * virtual displays, into the output buffer). - * - * Prior to calling this function, the display must be successfully - * validated with validateDisplay. Note that setLayerBuffer and - * setLayerSurfaceDamage specifically do not count as layer state, so if - * there are no other changes to the layer state (or to the buffer's - * properties as described in setLayerBuffer), then it is safe to call - * this function without first validating the display. - */ - PRESENT_DISPLAY = 0x205 << OPCODE_SHIFT, - - /** - * PRESENT_OR_VALIDATE_DISPLAY has this pseudo prototype - * - * presentOrValidateDisplay(); - * - * Presents the current display contents on the screen (or in the case of - * virtual displays, into the output buffer) if validate can be skipped, - * or perform a VALIDATE_DISPLAY action instead. - */ - PRESENT_OR_VALIDATE_DISPLAY = 0x206 << OPCODE_SHIFT, - - // layer commands (VALIDATE_DISPLAY not required) - - /** - * SET_LAYER_CURSOR_POSITION has this pseudo prototype - * - * setLayerCursorPosition(int x, int y); - * - * Asynchronously sets the position of a cursor layer. - * - * Prior to validateDisplay, a layer may be marked as Composition::CURSOR. - * If validation succeeds (i.e., the device does not request a composition - * change for that layer), then once a buffer has been set for the layer - * and it has been presented, its position may be set by this function at - * any time between presentDisplay and any subsequent validateDisplay - * calls for this display. - * - * Once validateDisplay is called, this function must not be called again - * until the validate/present sequence is completed. - * - * May be called from any thread so long as it is not interleaved with the - * validate/present sequence as described above. - * - * @param layer is the layer to which the position is set. - * @param x is the new x coordinate (in pixels from the left of the - * screen). - * @param y is the new y coordinate (in pixels from the top of the - * screen). - */ - SET_LAYER_CURSOR_POSITION = 0x300 << OPCODE_SHIFT, - - /** - * SET_LAYER_BUFFER has this pseudo prototype - * - * setLayerBuffer(int bufferSlot, - * int bufferIndex, - * int acquireFenceIndex); - * - * Sets the buffer handle to be displayed for this layer. If the buffer - * properties set at allocation time (width, height, format, and usage) - * have not changed since the previous frame, it is not necessary to call - * validateDisplay before calling presentDisplay unless new state needs to - * be validated in the interim. - * - * Also provides a file descriptor referring to an acquire sync fence - * object, which must be signaled when it is safe to read from the given - * buffer. If it is already safe to read from the buffer, an empty handle - * may be passed instead. - * - * This function must return NONE and have no other effect if called for a - * layer with a composition type of Composition::SOLID_COLOR (because it - * has no buffer) or Composition::SIDEBAND or Composition::CLIENT (because - * synchronization and buffer updates for these layers are handled - * elsewhere). - * - * @param layer is the layer to which the buffer is set. - * @param bufferSlot is the buffer slot to use. - * @param bufferIndex is the buffer handle to set. - * @param acquireFenceIndex is a sync fence file descriptor as described above. - */ - SET_LAYER_BUFFER = 0x301 << OPCODE_SHIFT, - - /* - * SET_LAYER_SURFACE_DAMAGE has this pseudo prototype - * - * setLayerSurfaceDamage(Rect[] damage); - * - * Provides the region of the source buffer which has been modified since - * the last frame. This region does not need to be validated before - * calling presentDisplay. - * - * Once set through this function, the damage region remains the same - * until a subsequent call to this function. - * - * If damage is non-empty, then it may be assumed that any portion of the - * source buffer not covered by one of the rects has not been modified - * this frame. If damage is empty, then the whole source buffer must be - * treated as if it has been modified. - * - * If the layer's contents are not modified relative to the prior frame, - * damage must contain exactly one empty rect([0, 0, 0, 0]). - * - * The damage rects are relative to the pre-transformed buffer, and their - * origin is the top-left corner. They must not exceed the dimensions of - * the latched buffer. - * - * @param layer is the layer to which the damage region is set. - * @param damage is the new surface damage region. - */ - SET_LAYER_SURFACE_DAMAGE = 0x302 << OPCODE_SHIFT, - - // layer state commands (VALIDATE_DISPLAY required) - - /** - * SET_LAYER_BLEND_MODE has this pseudo prototype - * - * setLayerBlendMode(android.hardware.graphics.common.BlendMode mode) - * - * Sets the blend mode of the given layer. - * - * @param mode is the new blend mode. - */ - SET_LAYER_BLEND_MODE = 0x400 << OPCODE_SHIFT, - - /** - * SET_LAYER_COLOR has this pseudo prototype - * - * setLayerColor(Color color); - * - * Sets the color of the given layer. If the composition type of the layer - * is not Composition::SOLID_COLOR, this call must succeed and have no - * other effect. - * - * @param color is the new color. - */ - SET_LAYER_COLOR = 0x401 << OPCODE_SHIFT, - - /** - * SET_LAYER_COMPOSITION_TYPE has this pseudo prototype - * - * setLayerCompositionType(Composition type); - * - * Sets the desired composition type of the given layer. During - * validateDisplay, the device may request changes to the composition - * types of any of the layers as described in the definition of - * Composition above. - * - * @param type is the new composition type. - */ - SET_LAYER_COMPOSITION_TYPE = 0x402 << OPCODE_SHIFT, - - /** - * SET_LAYER_DATASPACE has this pseudo prototype - * - * setLayerDataspace(android.hardware.graphics.common.Dataspace dataspace); - * - * Sets the dataspace of the layer. - * - * The dataspace provides more information about how to interpret the buffer - * or solid color, such as the encoding standard and color transform. - * - * See the values of Dataspace for more information. - * - * @param dataspace is the new dataspace. - */ - SET_LAYER_DATASPACE = 0x403 << OPCODE_SHIFT, - - /** - * SET_LAYER_DISPLAY_FRAME has this pseudo prototype - * - * setLayerDisplayFrame(Rect frame); - * - * Sets the display frame (the portion of the display covered by a layer) - * of the given layer. This frame must not exceed the display dimensions. - * - * @param frame is the new display frame. - */ - SET_LAYER_DISPLAY_FRAME = 0x404 << OPCODE_SHIFT, - - /** - * SET_LAYER_PLANE_ALPHA has this pseudo prototype - * - * setLayerPlaneAlpha(float alpha); - * - * Sets an alpha value (a floating point value in the range [0.0, 1.0]) - * which will be applied to the whole layer. It can be conceptualized as a - * preprocessing step which applies the following function: - * if (blendMode == BlendMode::PREMULTIPLIED) - * out.rgb = in.rgb * planeAlpha - * out.a = in.a * planeAlpha - * - * If the device does not support this operation on a layer which is - * marked Composition::DEVICE, it must request a composition type change - * to Composition::CLIENT upon the next validateDisplay call. - * - * @param alpha is the plane alpha value to apply. - */ - SET_LAYER_PLANE_ALPHA = 0x405 << OPCODE_SHIFT, - - /** - * SET_LAYER_SIDEBAND_STREAM has this pseudo prototype - * - * setLayerSidebandStream(int streamIndex) - * - * Sets the sideband stream for this layer. If the composition type of the - * given layer is not Composition::SIDEBAND, this call must succeed and - * have no other effect. - * - * @param streamIndex is the new sideband stream. - */ - SET_LAYER_SIDEBAND_STREAM = 0x406 << OPCODE_SHIFT, - - /** - * SET_LAYER_SOURCE_CROP has this pseudo prototype - * - * setLayerSourceCrop(FRect crop); - * - * Sets the source crop (the portion of the source buffer which will fill - * the display frame) of the given layer. This crop rectangle must not - * exceed the dimensions of the latched buffer. - * - * If the device is not capable of supporting a true float source crop - * (i.e., it will truncate or round the floats to integers), it must set - * this layer to Composition::CLIENT when crop is non-integral for the - * most accurate rendering. - * - * If the device cannot support float source crops, but still wants to - * handle the layer, it must use the following code (or similar) to - * convert to an integer crop: - * intCrop.left = (int) ceilf(crop.left); - * intCrop.top = (int) ceilf(crop.top); - * intCrop.right = (int) floorf(crop.right); - * intCrop.bottom = (int) floorf(crop.bottom); - * - * @param crop is the new source crop. - */ - SET_LAYER_SOURCE_CROP = 0x407 << OPCODE_SHIFT, - - /** - * SET_LAYER_TRANSFORM has this pseudo prototype - * - * Sets the transform (rotation/flip) of the given layer. - * - * setLayerTransform(Transform transform); - * - * @param transform is the new transform. - */ - SET_LAYER_TRANSFORM = 0x408 << OPCODE_SHIFT, - - /** - * SET_LAYER_VISIBLE_REGION has this pseudo prototype - * - * setLayerVisibleRegion(Rect[] visible); - * - * Specifies the portion of the layer that is visible, including portions - * under translucent areas of other layers. The region is in screen space, - * and must not exceed the dimensions of the screen. - * - * @param visible is the new visible region, in screen space. - */ - SET_LAYER_VISIBLE_REGION = 0x409 << OPCODE_SHIFT, - - /** - * SET_LAYER_Z_ORDER has this pseudo prototype - * - * setLayerZOrder(int z); - * - * Sets the desired Z order (height) of the given layer. A layer with a - * greater Z value occludes a layer with a lesser Z value. - * - * @param z is the new Z order. - */ - SET_LAYER_Z_ORDER = 0x40a << OPCODE_SHIFT, - - /** - * SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT has this pseudo prototype - * - * setPresentOrValidateDisplayResult(int state); - * - * Sets the state of PRESENT_OR_VALIDATE_DISPLAY command. - * @param state is the state of present or validate - * 1 - Present Succeeded - * 0 - Validate succeeded - */ - SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT = 0x40b << OPCODE_SHIFT, - - /** - * SET_LAYER_PER_FRAME_METADATA has this pseudo prototype - * - * setLayerPerFrameMetadata(long display, long layer, - * PerFrameMetadata[] data); - * - * Sets the PerFrameMetadata for the display. This metadata must be used - * by the implementation to better tone map content to that display. - * - * This is a method that may be called every frame. Thus it's - * implemented using buffered transport. - * SET_LAYER_PER_FRAME_METADATA is the command used by the buffered transport - * mechanism. - */ - SET_LAYER_PER_FRAME_METADATA = 0x303 << OPCODE_SHIFT, - - /** - * SET_LAYER_FLOAT_COLOR has this pseudo prototype - * - * setLayerColor(FloatColor color); - * - * Sets the color of the given layer. If the composition type of the layer - * is not Composition::SOLID_COLOR, this call must succeed and have no - * other effect. - * - * @param color is the new color using float type. - */ - SET_LAYER_FLOAT_COLOR = 0x40c << OPCODE_SHIFT, - - /** - * SET_LAYER_COLOR_TRANSFORM has this pseudo prototype - * - * setLayerColorTransform(float[16] matrix); - * - * This command has the following binary layout in bytes: - * - * 0 - 16 * 4: matrix - * - * Sets a matrix for color transform which will be applied on this layer - * before composition. - * - * If the device is not capable of apply the matrix on this layer, it must force - * this layer to client composition during VALIDATE_DISPLAY. - * - * The matrix provided is an affine color transformation of the following - * form: - * - * |r.r r.g r.b 0| - * |g.r g.g g.b 0| - * |b.r b.g b.b 0| - * |Tr Tg Tb 1| - * - * This matrix must be provided in row-major form: - * - * {r.r, r.g, r.b, 0, g.r, ...}. - * - * Given a matrix of this form and an input color [R_in, G_in, B_in], - * the input color must first be converted to linear space - * [R_linear, G_linear, B_linear], then the output linear color - * [R_out_linear, G_out_linear, B_out_linear] will be: - * - * R_out_linear = R_linear * r.r + G_linear * g.r + B_linear * b.r + Tr - * G_out_linear = R_linear * r.g + G_linear * g.g + B_linear * b.g + Tg - * B_out_linear = R_linear * r.b + G_linear * g.b + B_linear * b.b + Tb - * - * [R_out_linear, G_out_linear, B_out_linear] must then be converted to - * gamma space: [R_out, G_out, B_out] before blending. - * - * @param matrix is a 4x4 transform matrix (16 floats) as described above. - */ - - SET_LAYER_COLOR_TRANSFORM = 0x40d << OPCODE_SHIFT, - /* - * SET_LAYER_PER_FRAME_METADATA_BLOBS has this pseudo prototype - * - * setLayerPerFrameMetadataBlobs(long display, long layer, - * PerFrameMetadataBlob[] metadata); - * - * This command sends metadata that may be used for tone-mapping the - * associated layer. The metadata structure follows a {key, blob} - * format (see the PerFrameMetadataBlob struct). All keys must be - * returned by a prior call to getPerFrameMetadataKeys and must - * be part of the list of keys associated with blob-type metadata - * (see PerFrameMetadataKey). - * - * This method may be called every frame. - */ - SET_LAYER_PER_FRAME_METADATA_BLOBS = 0x304 << OPCODE_SHIFT, - - /** - * SET_CLIENT_TARGET_PROPERTY has this pseudo prototype - * - * This command has the following binary layout in bytes: - * - * 0 - 3: clientTargetProperty.pixelFormat - * 4 - 7: clientTargetProperty.dataspace - * 8 - 11: whitePointNits - * - * The white point parameter describes the intended white point of the client target buffer. - * When client composition blends both HDR and SDR content, the client must composite to the - * brightness space as specified by the hardware composer. This is so that adjusting the real - * display brightness may be applied atomically with compensating the client target output. For - * instance, client-compositing a list of SDR layers requires dimming the brightness space of - * the SDR buffers when an HDR layer is simultaneously device-composited. - * - * setClientTargetProperty(ClientTargetProperty clientTargetProperty, float whitePointNits); - */ - SET_CLIENT_TARGET_PROPERTY = 0x105 << OPCODE_SHIFT, - - /** - * SET_LAYER_GENERIC_METADATA has this pseudo prototype - * - * setLayerGenericMetadata(string key, bool mandatory, byte[] value); - * - * Sets a piece of generic metadata for the given layer. If this - * function is called twice with the same key but different values, the - * newer value must override the older one. Calling this function with a - * 0-length value must reset that key's metadata as if it had not been - * set. - * - * A given piece of metadata may either be mandatory or a hint - * (non-mandatory) as indicated by the second parameter. Mandatory - * metadata may affect the composition result, which is to say that it - * may cause a visible change in the final image. By contrast, hints may - * only affect the composition strategy, such as which layers are - * composited by the client, but must not cause a visible change in the - * final image. The value of the mandatory flag shall match the value - * returned from getLayerGenericMetadataKeys for the given key. - * - * Only keys which have been returned from getLayerGenericMetadataKeys() - * shall be accepted. Any other keys must result in an UNSUPPORTED error. - * - * The value passed into this function shall be the binary - * representation of a HIDL type corresponding to the given key. For - * example, a key of 'com.example.V1_3.Foo' shall be paired with a - * value of type com.example@1.3::Foo, which would be defined in a - * vendor HAL extension. - * - * This function will be encoded in the command buffer in this order: - * 1) The key length, stored as a uint32_t - * 2) The key itself, padded to a uint32_t boundary if necessary - * 3) The mandatory flag, stored as a uint32_t - * 4) The value length in bytes, stored as a uint32_t - * 5) The value itself, padded to a uint32_t boundary if necessary - * - * @param key indicates which metadata value should be set on this layer - * @param mandatory indicates whether this particular key represents - * mandatory metadata or a hint (non-mandatory metadata), as - * described above - * @param value is a binary representation of a HIDL struct - * corresponding to the key as described above - */ - SET_LAYER_GENERIC_METADATA = 0x40e << OPCODE_SHIFT, - - /** - * SET_LAYER_WHITE_POINT_NITS has this pseudo prototype - * - * setLayerWhitePointNits(float sdrWhitePointNits); - * - * Sets the desired white point for the layer. This is intended to be used when presenting - * an SDR layer alongside HDR content. The HDR content will be presented at the display - * brightness in nits, and accordingly SDR content shall be dimmed to the desired white point - * provided. - * - * @param whitePointNits is the white point in nits. - */ - SET_LAYER_WHITE_POINT_NITS = 0x305 << OPCODE_SHIFT, -} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 230980d0fb..f661f8b919 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -16,11 +16,8 @@ package android.hardware.graphics.composer3; -import android.hardware.common.fmq.MQDescriptor; -import android.hardware.common.fmq.SynchronizedReadWrite; import android.hardware.graphics.composer3.ClientTargetProperty; import android.hardware.graphics.composer3.ColorMode; -import android.hardware.graphics.composer3.Command; import android.hardware.graphics.composer3.ContentType; import android.hardware.graphics.composer3.DisplayAttribute; import android.hardware.graphics.composer3.DisplayCapability; @@ -28,7 +25,6 @@ import android.hardware.graphics.composer3.DisplayConnectionType; import android.hardware.graphics.composer3.DisplayContentSample; import android.hardware.graphics.composer3.DisplayContentSamplingAttributes; import android.hardware.graphics.composer3.DisplayIdentification; -import android.hardware.graphics.composer3.ExecuteCommandsStatus; import android.hardware.graphics.composer3.FormatColorComponent; import android.hardware.graphics.composer3.HdrCapabilities; import android.hardware.graphics.composer3.IComposerCallback; @@ -40,6 +36,8 @@ import android.hardware.graphics.composer3.RenderIntent; import android.hardware.graphics.composer3.VirtualDisplay; import android.hardware.graphics.composer3.VsyncPeriodChangeConstraints; import android.hardware.graphics.composer3.VsyncPeriodChangeTimeline; +import android.hardware.graphics.composer3.command.CommandPayload; +import android.hardware.graphics.composer3.command.CommandResultPayload; @VintfStability interface IComposerClient { @@ -159,23 +157,13 @@ interface IComposerClient { void destroyVirtualDisplay(long display); /** - * Executes commands from the input command message queue. Return values - * generated by the input commands are written to the output command - * message queue in the form of value commands. + * Executes commands. * - * @param inLength is the length of input commands. - * @param inHandles is an array of handles referenced by the input - * commands. + * @param commands are the commands to be processed. * - * @return is the status of the command. - - * @exception EX_BAD_PARAMETER when inLength is not equal to the length of - * commands in the input command message queue. - * @exception NO_RESOURCES when the output command message queue was not - * properly drained. + * @return are the command statuses. */ - ExecuteCommandsStatus executeCommands( - int inLength, in android.hardware.common.NativeHandle[] inHandles); + CommandResultPayload[] executeCommands(in CommandPayload[] commands); /** * Retrieves which display configuration is currently active. @@ -435,17 +423,6 @@ interface IComposerClient { */ int getMaxVirtualDisplayCount(); - /** - * Gets the output command message queue. - * - * This function must only be called inside executeCommands closure. - * - * @return is the descriptor of the output command queue. - * - * @exception EX_NO_RESOURCES when failed to get the queue temporarily. - */ - MQDescriptor getOutputCommandQueue(); - /** * Returns the PerFrameMetadataKeys that are supported by this device. * @@ -731,14 +708,6 @@ interface IComposerClient { void setDisplayedContentSamplingEnabled( long display, boolean enable, FormatColorComponent componentMask, long maxFrames); - /** - * Sets the input command message queue. - * - * @param descriptor is the descriptor of the input command message queue. - * @exception EX_NO_RESOURCES when failed to set the queue temporarily. - */ - void setInputCommandQueue(in MQDescriptor descriptor); - /** * Sets the power mode of the given display. The transition must be * complete when this function returns. It is valid to call this function diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl index b666e6a0e0..3962920d49 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl @@ -16,8 +16,6 @@ package android.hardware.graphics.composer3; -import android.hardware.graphics.composer3.PerFrameMetadataKey; - /** * PerFrameMetadataKey * diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/Buffer.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/Buffer.aidl new file mode 100644 index 0000000000..3a08d3b522 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/Buffer.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. + */ + +package android.hardware.graphics.composer3.command; + +import android.hardware.common.NativeHandle; + +@VintfStability +parcelable Buffer { + /** + * Buffer slot in the range [0, bufferSlotCount) where bufferSlotCount is + * the parameter used when the layer was created. + * @see IComposer.createLayer. + * The slot is used as a buffer caching mechanism. When the Buffer.handle + * is null, the implementation uses the previous buffer associated with this + * slot. + */ + int slot; + + /** + * Buffer Handle. Can be null if this is the same buffer that was sent + * previously on this slot. + */ + @nullable NativeHandle handle; + + /** + * Buffer fence that represents when it is safe to access the buffer. + * A null fence indicates that the buffer can be accessed immediately. + */ + @nullable ParcelFileDescriptor fence; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl similarity index 51% rename from graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl index 4b3d31a176..3800efffd8 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl @@ -14,24 +14,34 @@ * limitations under the License. */ -package android.hardware.graphics.composer3; +package android.hardware.graphics.composer3.command; + +import android.hardware.graphics.composer3.Composition; -/** - * Display requests returned by getDisplayRequests. - */ @VintfStability -@Backing(type="int") -enum DisplayRequest { +parcelable ChangedCompositionTypes { /** - * Instructs the client to provide a new client target buffer, even if - * no layers are marked for client composition. + * The display which this commands refers to. + * @see IComposer.createDisplay */ - FLIP_CLIENT_TARGET = 1 << 0, + long display; + + @VintfStability + parcelable Layer { + /** + * The layer which this commands refers to. + * @see IComposer.createLayer + */ + long layer; + + /** + * The new composition type. + */ + Composition composition; + } + /** - * Instructs the client to write the result of client composition - * directly into the virtual display output buffer. If any of the - * layers are not marked as Composition::CLIENT or the given display - * is not a virtual display, this request has no effect. + * Indicates which layers has composition changes */ - WRITE_CLIENT_TARGET_TO_OUTPUT = 1 << 1, + Layer[] layers; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTarget.aidl similarity index 60% rename from graphics/composer/aidl/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTarget.aidl index f67c3ce75f..d8d45a1ccf 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTarget.aidl @@ -14,23 +14,26 @@ * limitations under the License. */ -package android.hardware.graphics.composer3; +package android.hardware.graphics.composer3.command; + +import android.hardware.graphics.common.Dataspace; +import android.hardware.graphics.common.Rect; +import android.hardware.graphics.composer3.command.Buffer; -/** - * Output parameters for IComposerClient.executeCommands - */ @VintfStability -parcelable ExecuteCommandsStatus { +parcelable ClientTarget { /** - * Indicates whether the output command message queue has changed. + * Client target Buffer */ - boolean queueChanged; + Buffer buffer; + /** - * Indicates whether the output command message queue has changed. + * The dataspace of the buffer, as described in LayerCommand.dataspace. */ - int length; + Dataspace dataspace; + /** - * An array of handles referenced by the output commands. + * The surface damage regions. */ - android.hardware.common.NativeHandle[] handles; + Rect[] damage; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl new file mode 100644 index 0000000000..c80e4ce1c7 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.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. + */ + +package android.hardware.graphics.composer3.command; + +import android.hardware.graphics.composer3.ClientTargetProperty; + +@VintfStability +parcelable ClientTargetPropertyWithNits { + /** + * The display which this commands refers to. + * @see IComposer.createDisplay + */ + long display; + + /** + * The Client target property. + */ + ClientTargetProperty clientTargetProperty; + + /** + * The white points nits as described in CommandResultPayload.clientTargetProperty + */ + float whitePointNits; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl new file mode 100644 index 0000000000..9cc8fa742a --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl @@ -0,0 +1,33 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +import android.hardware.graphics.common.ColorTransform; + +@VintfStability +parcelable ColorTransformPayload { + /** + * 4x4 transform matrix (16 floats) as described in DisplayCommand.colorTransform. + */ + float[] matrix; + + /** + * Hint value which may be used instead of the given matrix unless it + * is ColorTransform::ARBITRARY. + */ + ColorTransform hint; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandPayload.aidl new file mode 100644 index 0000000000..c1555e632b --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandPayload.aidl @@ -0,0 +1,30 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +import android.hardware.graphics.composer3.command.DisplayCommand; +import android.hardware.graphics.composer3.command.LayerCommand; + +/** + * Type of commands that can be used in IComposerClient.executeCommands. + * Note that this is a union and each command can only have one type. + */ +@VintfStability +union CommandPayload { + DisplayCommand displayCommand; + LayerCommand layerCommand; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandResultPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandResultPayload.aidl new file mode 100644 index 0000000000..b6086ca826 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandResultPayload.aidl @@ -0,0 +1,94 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +import android.hardware.graphics.composer3.command.ChangedCompositionTypes; +import android.hardware.graphics.composer3.command.ClientTargetPropertyWithNits; +import android.hardware.graphics.composer3.command.DisplayRequest; +import android.hardware.graphics.composer3.command.Error; +import android.hardware.graphics.composer3.command.PresentFence; +import android.hardware.graphics.composer3.command.PresentOrValidate; +import android.hardware.graphics.composer3.command.ReleaseFences; + +@VintfStability +union CommandResultPayload { + /** + * Indicates an error generated by a command. + */ + Error error; + + /** + * Sets the layers for which the device requires a different composition + * type than had been set prior to the last call to VALIDATE_DISPLAY. The + * client must either update its state with these types and call + * ACCEPT_DISPLAY_CHANGES, or must set new types and attempt to validate + * the display again. + */ + ChangedCompositionTypes changedCompositionType; + + /** + * Sets the display requests and the layer requests required for the last + * validated configuration. + * + * Display requests provide information about how the client must handle + * the client target. Layer requests provide information about how the + * client must handle an individual layer. + */ + DisplayRequest displayRequest; + + /** + * Sets the present fence as a result of PRESENT_DISPLAY. For physical + * displays, this fence must be signaled at the vsync when the result + * of composition of this frame starts to appear (for video-mode panels) + * or starts to transfer to panel memory (for command-mode panels). For + * virtual displays, this fence must be signaled when writes to the output + * buffer have completed and it is safe to read from it. + */ + PresentFence presentFence; + + /** + * Sets the release fences for device layers on this display which will + * receive new buffer contents this frame. + * + * A release fence is a file descriptor referring to a sync fence object + * which must be signaled after the device has finished reading from the + * buffer presented in the prior frame. This indicates that it is safe to + * start writing to the buffer again. If a given layer's fence is not + * returned from this function, it must be assumed that the buffer + * presented on the previous frame is ready to be written. + * + * The fences returned by this function must be unique for each layer + * (even if they point to the same underlying sync object). + * + */ + ReleaseFences releaseFences; + + /** + * Sets the state of PRESENT_OR_VALIDATE_DISPLAY command. + */ + PresentOrValidate presentOrValidateResult; + + /** + * The white point parameter describes the intended white point of the client target buffer. + * When client composition blends both HDR and SDR content, the client must composite to the + * brightness space as specified by the hardware composer. This is so that adjusting the real + * display brightness may be applied atomically with compensating the client target output. For + * instance, client-compositing a list of SDR layers requires dimming the brightness space of + * the SDR buffers when an HDR layer is simultaneously device-composited. + */ + ClientTargetPropertyWithNits clientTargetProperty; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayCommand.aidl new file mode 100644 index 0000000000..7295adab7c --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayCommand.aidl @@ -0,0 +1,151 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +import android.hardware.graphics.composer3.command.Buffer; +import android.hardware.graphics.composer3.command.ClientTarget; +import android.hardware.graphics.composer3.command.ColorTransformPayload; + +@VintfStability +parcelable DisplayCommand { + /** + * The display which this commands refers to. + * @see IComposer.createDisplay + */ + long display; + + /** + * Sets a color transform which will be applied after composition. + * + * If hint is not ColorTransform::ARBITRARY, then the device may use the + * hint to apply the desired color transform instead of using the color + * matrix directly. + * + * If the device is not capable of either using the hint or the matrix to + * apply the desired color transform, it must force all layers to client + * composition during VALIDATE_DISPLAY. + * + * If IComposer::Capability::SKIP_CLIENT_COLOR_TRANSFORM is present, then + * the client must never apply the color transform during client + * composition, even if all layers are being composed by the client. + * + * The matrix provided is an affine color transformation of the following + * form: + * + * |r.r r.g r.b 0| + * |g.r g.g g.b 0| + * |b.r b.g b.b 0| + * |Tr Tg Tb 1| + * + * This matrix must be provided in row-major form: + * + * {r.r, r.g, r.b, 0, g.r, ...}. + * + * Given a matrix of this form and an input color [R_in, G_in, B_in], the + * output color [R_out, G_out, B_out] will be: + * + * R_out = R_in * r.r + G_in * g.r + B_in * b.r + Tr + * G_out = R_in * r.g + G_in * g.g + B_in * b.g + Tg + * B_out = R_in * r.b + G_in * g.b + B_in * b.b + Tb + * + */ + @nullable ColorTransformPayload colorTransform; + + /** + * Sets the buffer handle which will receive the output of client + * composition. Layers marked as Composition::CLIENT must be composited + * into this buffer prior to the call to PRESENT_DISPLAY, and layers not + * marked as Composition::CLIENT must be composited with this buffer by + * the device. + * + * The buffer handle provided may be empty if no layers are being + * composited by the client. This must not result in an error (unless an + * invalid display handle is also provided). + * + * Also provides a file descriptor referring to an acquire sync fence + * object, which must be signaled when it is safe to read from the client + * target buffer. If it is already safe to read from this buffer, an + * empty handle may be passed instead. + * + * For more about dataspaces, see SET_LAYER_DATASPACE. + * + * The damage parameter describes a surface damage region as defined in + * the description of SET_LAYER_SURFACE_DAMAGE. + * + * Will be called before PRESENT_DISPLAY if any of the layers are marked + * as Composition::CLIENT. If no layers are so marked, then it is not + * necessary to call this function. It is not necessary to call + * validateDisplay after changing the target through this function. + */ + @nullable ClientTarget clientTarget; + + /** + * Sets the output buffer for a virtual display. That is, the buffer to + * which the composition result will be written. + * + * Also provides a file descriptor referring to a release sync fence + * object, which must be signaled when it is safe to write to the output + * buffer. If it is already safe to write to the output buffer, an empty + * handle may be passed instead. + * + * Must be called at least once before PRESENT_DISPLAY, but does not have + * any interaction with layer state or display validation. + */ + @nullable Buffer virtualDisplayOutputBuffer; + + /** + * Instructs the device to inspect all of the layer state and determine if + * there are any composition type changes necessary before presenting the + * display. Permitted changes are described in the definition of + * Composition above. + */ + boolean validateDisplay; + + /** + * Accepts the changes required by the device from the previous + * validateDisplay call (which may be queried using + * getChangedCompositionTypes) and revalidates the display. This function + * is equivalent to requesting the changed types from + * getChangedCompositionTypes, setting those types on the corresponding + * layers, and then calling validateDisplay again. + * + * After this call it must be valid to present this display. Calling this + * after validateDisplay returns 0 changes must succeed with NONE, but + * must have no other effect. + */ + boolean acceptDisplayChanges; + + /** + * Presents the current display contents on the screen (or in the case of + * virtual displays, into the output buffer). + * + * Prior to calling this function, the display must be successfully + * validated with validateDisplay. Note that setLayerBuffer and + * setLayerSurfaceDamage specifically do not count as layer state, so if + * there are no other changes to the layer state (or to the buffer's + * properties as described in setLayerBuffer), then it is safe to call + * this function without first validating the display. + */ + boolean presentDisplay; + + /** + * Presents the current display contents on the screen (or in the case of + * virtual displays, into the output buffer) if validate can be skipped, + * or perform a VALIDATE_DISPLAY action instead. + */ + boolean presentOrValidateDisplay; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayRequest.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayRequest.aidl new file mode 100644 index 0000000000..10bd10c789 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayRequest.aidl @@ -0,0 +1,72 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +@VintfStability +parcelable DisplayRequest { + /** + * Instructs the client to provide a new client target buffer, even if + * no layers are marked for client composition. + */ + const int FLIP_CLIENT_TARGET = 1 << 0; + + /** + * Instructs the client to write the result of client composition + * directly into the virtual display output buffer. If any of the + * layers are not marked as Composition::CLIENT or the given display + * is not a virtual display, this request has no effect. + */ + const int WRITE_CLIENT_TARGET_TO_OUTPUT = 1 << 1; + + /** + * The display which this commands refers to. + * @see IComposer.createDisplay + */ + long display; + + /** + * The display requests for the current validated state. This must be a + * bitwise-or of the constants in `DisplayRequest`. + */ + int mask; + + @VintfStability + parcelable LayerRequest { + /** + * The client must clear its target with transparent pixels where + * this layer would be. The client may ignore this request if the + * layer must be blended. + */ + const int CLEAR_CLIENT_TARGET = 1 << 0; + + /** + * The layer which this commands refers to. + * @see IComposer.createLayer + */ + long layer; + /** + * The layer requests for the current validated state. This must be a + * bitwise-or of the constants in `LayerRequest`. + */ + int mask; + } + + /** + * The layer requests for the current validated state. + */ + LayerRequest[] layerRequests; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/Error.aidl similarity index 65% rename from graphics/composer/aidl/android/hardware/graphics/composer3/LayerRequest.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/command/Error.aidl index 10de55877f..19843b97b5 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerRequest.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/Error.aidl @@ -14,18 +14,16 @@ * limitations under the License. */ -package android.hardware.graphics.composer3; +package android.hardware.graphics.composer3.command; -/** - * Layer requests returned from getDisplayRequests. - */ @VintfStability -@Backing(type="int") -enum LayerRequest { +parcelable Error { + /** + * The index in the command payload array. + */ + int commandIndex; /** - * The client must clear its target with transparent pixels where - * this layer would be. The client may ignore this request if the - * layer must be blended. + * The error generated by the command. Can be one of the IComposerClient.EX_* */ - CLEAR_CLIENT_TARGET = 1 << 0, + int errorCode; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/GenericMetadata.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/GenericMetadata.aidl new file mode 100644 index 0000000000..a4e1fe8d28 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/GenericMetadata.aidl @@ -0,0 +1,33 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +import android.hardware.graphics.composer3.LayerGenericMetadataKey; + +@VintfStability +parcelable GenericMetadata { + /** + * Indicates which metadata value should be set. + */ + LayerGenericMetadataKey key; + /** + * The binary representation of a AIDL struct corresponding to + * the key as described above. + * TODO(b/209691612): revisit the use of byte[] + */ + byte[] value; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/LayerCommand.aidl new file mode 100644 index 0000000000..eac051bb0e --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/LayerCommand.aidl @@ -0,0 +1,301 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +import android.hardware.common.NativeHandle; +import android.hardware.graphics.common.FRect; +import android.hardware.graphics.common.Point; +import android.hardware.graphics.common.Rect; +import android.hardware.graphics.composer3.Color; +import android.hardware.graphics.composer3.FloatColor; +import android.hardware.graphics.composer3.PerFrameMetadata; +import android.hardware.graphics.composer3.PerFrameMetadataBlob; +import android.hardware.graphics.composer3.command.Buffer; +import android.hardware.graphics.composer3.command.GenericMetadata; +import android.hardware.graphics.composer3.command.ParcelableBlendMode; +import android.hardware.graphics.composer3.command.ParcelableComposition; +import android.hardware.graphics.composer3.command.ParcelableDataspace; +import android.hardware.graphics.composer3.command.ParcelableTransform; +import android.hardware.graphics.composer3.command.PlaneAlpha; +import android.hardware.graphics.composer3.command.WhitePointNits; +import android.hardware.graphics.composer3.command.ZOrder; + +@VintfStability +parcelable LayerCommand { + /** + * The display which this commands refers to. + * @see IComposer.createDisplay + */ + long display; + + /** + * The layer which this commands refers to. + * @see IComposer.createLayer + */ + long layer; + + /** + * Asynchronously sets the position of a cursor layer. + * + * Prior to validateDisplay, a layer may be marked as Composition::CURSOR. + * If validation succeeds (i.e., the device does not request a composition + * change for that layer), then once a buffer has been set for the layer + * and it has been presented, its position may be set by this function at + * any time between presentDisplay and any subsequent validateDisplay + * calls for this display. + * + * Once validateDisplay is called, this function must not be called again + * until the validate/present sequence is completed. + * + * May be called from any thread so long as it is not interleaved with the + * validate/present sequence as described above. + */ + @nullable Point cursorPosition; + + /** + * Sets the buffer handle to be displayed for this layer. If the buffer + * properties set at allocation time (width, height, format, and usage) + * have not changed since the previous frame, it is not necessary to call + * validateDisplay before calling presentDisplay unless new state needs to + * be validated in the interim. + * + * Also provides a file descriptor referring to an acquire sync fence + * object, which must be signaled when it is safe to read from the given + * buffer. If it is already safe to read from the buffer, an empty handle + * may be passed instead. + * + * This function must return NONE and have no other effect if called for a + * layer with a composition type of Composition::SOLID_COLOR (because it + * has no buffer) or Composition::SIDEBAND or Composition::CLIENT (because + * synchronization and buffer updates for these layers are handled + * elsewhere). + */ + @nullable Buffer buffer; + + /** + * Provides the region of the source buffer which has been modified since + * the last frame. This region does not need to be validated before + * calling presentDisplay. + * + * Once set through this function, the damage region remains the same + * until a subsequent call to this function. + * + * If damage is non-empty, then it may be assumed that any portion of the + * source buffer not covered by one of the rects has not been modified + * this frame. If damage is empty, then the whole source buffer must be + * treated as if it has been modified. + * + * If the layer's contents are not modified relative to the prior frame, + * damage must contain exactly one empty rect([0, 0, 0, 0]). + * + * The damage rects are relative to the pre-transformed buffer, and their + * origin is the top-left corner. They must not exceed the dimensions of + * the latched buffer. + */ + @nullable Rect[] damage; + + /** + * Sets the blend mode of the given layer. + */ + @nullable ParcelableBlendMode blendMode; + + /** + * Sets the color of the given layer. If the composition type of the layer + * is not Composition::SOLID_COLOR, this call must succeed and have no + * other effect. + */ + @nullable Color color; + + /** + * Sets the color of the given layer. If the composition type of the layer + * is not Composition::SOLID_COLOR, this call must succeed and have no + * other effect. + */ + @nullable FloatColor floatColor; + + /** + * Sets the desired composition type of the given layer. During + * validateDisplay, the device may request changes to the composition + * types of any of the layers as described in the definition of + * Composition above. + */ + @nullable ParcelableComposition composition; + + /** + * Sets the dataspace of the layer. + * + * The dataspace provides more information about how to interpret the buffer + * or solid color, such as the encoding standard and color transform. + * + * See the values of ParcelableDataspace for more information. + */ + @nullable ParcelableDataspace dataspace; + + /** + * Sets the display frame (the portion of the display covered by a layer) + * of the given layer. This frame must not exceed the display dimensions. + */ + @nullable Rect displayFrame; + + /** + * Sets an alpha value (a floating point value in the range [0.0, 1.0]) + * which will be applied to the whole layer. It can be conceptualized as a + * preprocessing step which applies the following function: + * if (blendMode == BlendMode::PREMULTIPLIED) + * out.rgb = in.rgb * planeAlpha + * out.a = in.a * planeAlpha + * + * If the device does not support this operation on a layer which is + * marked Composition::DEVICE, it must request a composition type change + * to Composition::CLIENT upon the next validateDisplay call. + * + */ + @nullable PlaneAlpha planeAlpha; + + /** + * Sets the sideband stream for this layer. If the composition type of the + * given layer is not Composition::SIDEBAND, this call must succeed and + * have no other effect. + */ + @nullable NativeHandle sidebandStream; + + /** + * Sets the source crop (the portion of the source buffer which will fill + * the display frame) of the given layer. This crop rectangle must not + * exceed the dimensions of the latched buffer. + * + * If the device is not capable of supporting a true float source crop + * (i.e., it will truncate or round the floats to integers), it must set + * this layer to Composition::CLIENT when crop is non-integral for the + * most accurate rendering. + * + * If the device cannot support float source crops, but still wants to + * handle the layer, it must use the following code (or similar) to + * convert to an integer crop: + * intCrop.left = (int) ceilf(crop.left); + * intCrop.top = (int) ceilf(crop.top); + * intCrop.right = (int) floorf(crop.right); + * intCrop.bottom = (int) floorf(crop.bottom); + */ + @nullable FRect sourceCrop; + + /** + * Sets the transform (rotation/flip) of the given layer. + */ + @nullable ParcelableTransform transform; + + /** + * Specifies the portion of the layer that is visible, including portions + * under translucent areas of other layers. The region is in screen space, + * and must not exceed the dimensions of the screen. + */ + @nullable Rect[] visibleRegion; + + /** + * Sets the desired Z order (height) of the given layer. A layer with a + * greater Z value occludes a layer with a lesser Z value. + */ + @nullable ZOrder z; + + /** + * Sets a matrix for color transform which will be applied on this layer + * before composition. + * + * If the device is not capable of apply the matrix on this layer, it must force + * this layer to client composition during VALIDATE_DISPLAY. + * + * The matrix provided is an affine color transformation of the following + * form: + * + * |r.r r.g r.b 0| + * |g.r g.g g.b 0| + * |b.r b.g b.b 0| + * |Tr Tg Tb 1| + * + * This matrix must be provided in row-major form: + * + * {r.r, r.g, r.b, 0, g.r, ...}. + * + * Given a matrix of this form and an input color [R_in, G_in, B_in], + * the input color must first be converted to linear space + * [R_linear, G_linear, B_linear], then the output linear color + * [R_out_linear, G_out_linear, B_out_linear] will be: + * + * R_out_linear = R_linear * r.r + G_linear * g.r + B_linear * b.r + Tr + * G_out_linear = R_linear * r.g + G_linear * g.g + B_linear * b.g + Tg + * B_out_linear = R_linear * r.b + G_linear * g.b + B_linear * b.b + Tb + * + * [R_out_linear, G_out_linear, B_out_linear] must then be converted to + * gamma space: [R_out, G_out, B_out] before blending. + */ + @nullable float[] colorTransform; + + /** + * Sets the desired white point for the layer. This is intended to be used when presenting + * an SDR layer alongside HDR content. The HDR content will be presented at the display + * brightness in nits, and accordingly SDR content shall be dimmed to the desired white point + * provided. + */ + @nullable WhitePointNits whitePointNits; + + /** + * Sets a piece of generic metadata for the given layer. If this + * function is called twice with the same key but different values, the + * newer value must override the older one. Calling this function with a + * 0-length value must reset that key's metadata as if it had not been + * set. + * + * A given piece of metadata may either be mandatory or a hint + * (non-mandatory) as indicated by the second parameter. Mandatory + * metadata may affect the composition result, which is to say that it + * may cause a visible change in the final image. By contrast, hints may + * only affect the composition strategy, such as which layers are + * composited by the client, but must not cause a visible change in the + * final image. The value of the mandatory flag shall match the value + * returned from getLayerGenericMetadataKeys for the given key. + * + * Only keys which have been returned from getLayerGenericMetadataKeys() + * shall be accepted. Any other keys must result in an UNSUPPORTED error. + * + * The value passed into this function shall be the binary + * representation of a stable AIDL type corresponding to the given key. For + * example, a key of 'com.example.Foo-V2' shall be paired with a + * value of type com.exampleFoo-V2, which would be defined in a + * vendor HAL extension. + */ + @nullable GenericMetadata genericMetadata; + + /** + * Sets the PerFrameMetadata for the display. This metadata must be used + * by the implementation to better tone map content to that display. + * + * This is a command that may be called every frame. + */ + @nullable PerFrameMetadata[] perFrameMetadata; + + /** + * This command sends metadata that may be used for tone-mapping the + * associated layer. The metadata structure follows a {key, blob} + * format (see the PerFrameMetadataBlob struct). All keys must be + * returned by a prior call to getPerFrameMetadataKeys and must + * be part of the list of keys associated with blob-type metadata + * (see PerFrameMetadataKey). + * + * This command may be called every frame. + */ + @nullable PerFrameMetadataBlob[] perFrameMetadataBlob; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl new file mode 100644 index 0000000000..f91285379c --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl @@ -0,0 +1,24 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +import android.hardware.graphics.common.BlendMode; + +@VintfStability +parcelable ParcelableBlendMode { + BlendMode blendMode; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl new file mode 100644 index 0000000000..91979d8de5 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl @@ -0,0 +1,24 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +import android.hardware.graphics.composer3.Composition; + +@VintfStability +parcelable ParcelableComposition { + Composition composition; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl new file mode 100644 index 0000000000..6be750d978 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl @@ -0,0 +1,24 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +import android.hardware.graphics.common.Dataspace; + +@VintfStability +parcelable ParcelableDataspace { + Dataspace dataspace; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableTransform.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableTransform.aidl new file mode 100644 index 0000000000..910d014b67 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableTransform.aidl @@ -0,0 +1,24 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +import android.hardware.graphics.common.Transform; + +@VintfStability +parcelable ParcelableTransform { + Transform transform; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PlaneAlpha.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/PlaneAlpha.aidl new file mode 100644 index 0000000000..fa1889b5e5 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/PlaneAlpha.aidl @@ -0,0 +1,27 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +@VintfStability +parcelable PlaneAlpha { + /** + * An alpha value (a floating point value in the range [0.0, 1.0]) + * which will be applied to a whole layer. + * @see LayerCommand.planeAlpha + */ + float alpha; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentFence.aidl similarity index 64% rename from graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentFence.aidl index c6fd063028..0c144068e9 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentFence.aidl @@ -14,25 +14,18 @@ * limitations under the License. */ -package android.hardware.graphics.composer3; +package android.hardware.graphics.composer3.command; -/** - * Blend modes, settable per layer. - */ @VintfStability -@Backing(type="int") -enum BlendMode { - INVALID = 0, +parcelable PresentFence { /** - * colorOut = colorSrc + * The display which this commands refers to. + * @see IComposer.createDisplay */ - NONE = 1, - /** - * colorOut = colorSrc + colorDst * (1 - alphaSrc) - */ - PREMULTIPLIED = 2, + long display; + /** - * colorOut = colorSrc * alphaSrc + colorDst * (1 - alphaSrc) + * The present fence for this display. */ - COVERAGE = 3, + ParcelFileDescriptor fence; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentOrValidate.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentOrValidate.aidl new file mode 100644 index 0000000000..7fc60c4875 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentOrValidate.aidl @@ -0,0 +1,32 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +@VintfStability +parcelable PresentOrValidate { + /** + * The display which this commands refers to. + * @see IComposer.createDisplay + */ + long display; + + /** + * Whether PresentOrValidate presented or validated the display. + */ + @VintfStability enum Result { Presented, Validated } + Result result; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ReleaseFences.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ReleaseFences.aidl new file mode 100644 index 0000000000..762f5ebc75 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ReleaseFences.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. + */ + +package android.hardware.graphics.composer3.command; + +@VintfStability +parcelable ReleaseFences { + /** + * The display which this commands refers to. + * @see IComposer.createDisplay + */ + long display; + @VintfStability + parcelable Layer { + /** + * The layer which this commands refers to. + * @see IComposer.createLayer + */ + long layer; + + /** + * The release fence for this layer. + */ + ParcelFileDescriptor fence; + } + + /** + * The layers which has release fences. + */ + Layer[] layers; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/WhitePointNits.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/WhitePointNits.aidl new file mode 100644 index 0000000000..ec46cdf01c --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/WhitePointNits.aidl @@ -0,0 +1,29 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +@VintfStability +parcelable WhitePointNits { + /** + * The desired white point for the layer. This is intended to be used when presenting + * an SDR layer alongside HDR content. The HDR content will be presented at the display + * brightness in nits, and accordingly SDR content shall be dimmed to the desired white point + * provided. + * @see LayerCommand.whitePointNits. + */ + float nits; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ZOrder.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ZOrder.aidl new file mode 100644 index 0000000000..68120b0e6f --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/command/ZOrder.aidl @@ -0,0 +1,27 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3.command; + +@VintfStability +parcelable ZOrder { + /** + * The desired Z order (height) of the given layer. A layer with a + * greater Z value occludes a layer with a lesser Z value. + * @see LayerCommand.z; + */ + int z; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp index d59190d811..5bda15a449 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp @@ -74,25 +74,25 @@ static_assert( static_assert(aidl::android::hardware::graphics::composer3::Capability::SKIP_VALIDATE == static_cast(4)); -static_assert(aidl::android::hardware::graphics::composer3::LayerRequest::CLEAR_CLIENT_TARGET == - static_cast( - ::android::hardware::graphics::composer::V2_1::IComposerClient::LayerRequest:: - CLEAR_CLIENT_TARGET)); +static_assert(aidl::android::hardware::graphics::composer3::command::DisplayRequest::LayerRequest:: + CLEAR_CLIENT_TARGET == + static_cast(::android::hardware::graphics::composer::V2_1::IComposerClient:: + LayerRequest::CLEAR_CLIENT_TARGET)); -static_assert(aidl::android::hardware::graphics::composer3::BlendMode::INVALID == - static_cast( +static_assert(aidl::android::hardware::graphics::common::BlendMode::INVALID == + static_cast( ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode:: INVALID)); static_assert( - aidl::android::hardware::graphics::composer3::BlendMode::NONE == - static_cast( + aidl::android::hardware::graphics::common::BlendMode::NONE == + static_cast( ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode::NONE)); -static_assert(aidl::android::hardware::graphics::composer3::BlendMode::PREMULTIPLIED == - static_cast( +static_assert(aidl::android::hardware::graphics::common::BlendMode::PREMULTIPLIED == + static_cast( ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode:: PREMULTIPLIED)); -static_assert(aidl::android::hardware::graphics::composer3::BlendMode::COVERAGE == - static_cast( +static_assert(aidl::android::hardware::graphics::common::BlendMode::COVERAGE == + static_cast( ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode:: COVERAGE)); @@ -121,15 +121,14 @@ static_assert(aidl::android::hardware::graphics::composer3::Composition::SIDEBAN ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition:: SIDEBAND)); -static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest::FLIP_CLIENT_TARGET == - static_cast( - ::android::hardware::graphics::composer::V2_1::IComposerClient:: - DisplayRequest::FLIP_CLIENT_TARGET)); -static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest:: +static_assert( + aidl::android::hardware::graphics::composer3::command::DisplayRequest::FLIP_CLIENT_TARGET == + static_cast(::android::hardware::graphics::composer::V2_1::IComposerClient:: + DisplayRequest::FLIP_CLIENT_TARGET)); +static_assert(aidl::android::hardware::graphics::composer3::command::DisplayRequest:: WRITE_CLIENT_TARGET_TO_OUTPUT == - static_cast( - ::android::hardware::graphics::composer::V2_1::IComposerClient:: - DisplayRequest::WRITE_CLIENT_TARGET_TO_OUTPUT)); + static_cast(::android::hardware::graphics::composer::V2_1::IComposerClient:: + DisplayRequest::WRITE_CLIENT_TARGET_TO_OUTPUT)); static_assert(aidl::android::hardware::graphics::composer3::HandleIndex::EMPTY == static_cast( @@ -188,162 +187,6 @@ static_assert( ::android::hardware::graphics::composer::V2_4::IComposerClient::DisplayCapability:: AUTO_LOW_LATENCY_MODE)); -static_assert(aidl::android::hardware::graphics::composer3::Command::LENGTH_MASK == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - LENGTH_MASK)); -static_assert(aidl::android::hardware::graphics::composer3::Command::OPCODE_SHIFT == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - OPCODE_SHIFT)); -static_assert(aidl::android::hardware::graphics::composer3::Command::OPCODE_MASK == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - OPCODE_MASK)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SELECT_DISPLAY == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SELECT_DISPLAY)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SELECT_LAYER == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SELECT_LAYER)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_ERROR == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_ERROR)); -static_assert( - aidl::android::hardware::graphics::composer3::Command::SET_CHANGED_COMPOSITION_TYPES == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_CHANGED_COMPOSITION_TYPES)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_DISPLAY_REQUESTS == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_DISPLAY_REQUESTS)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_PRESENT_FENCE == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_PRESENT_FENCE)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_RELEASE_FENCES == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_RELEASE_FENCES)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_COLOR_TRANSFORM == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_COLOR_TRANSFORM)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_CLIENT_TARGET == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_CLIENT_TARGET)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_OUTPUT_BUFFER == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_OUTPUT_BUFFER)); -static_assert(aidl::android::hardware::graphics::composer3::Command::VALIDATE_DISPLAY == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - VALIDATE_DISPLAY)); -static_assert(aidl::android::hardware::graphics::composer3::Command::ACCEPT_DISPLAY_CHANGES == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - ACCEPT_DISPLAY_CHANGES)); -static_assert(aidl::android::hardware::graphics::composer3::Command::PRESENT_DISPLAY == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - PRESENT_DISPLAY)); -static_assert(aidl::android::hardware::graphics::composer3::Command::PRESENT_OR_VALIDATE_DISPLAY == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - PRESENT_OR_VALIDATE_DISPLAY)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_CURSOR_POSITION == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_CURSOR_POSITION)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_BUFFER == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_BUFFER)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_SURFACE_DAMAGE == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_SURFACE_DAMAGE)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_BLEND_MODE == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_BLEND_MODE)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_COLOR == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_COLOR)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_COMPOSITION_TYPE == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_COMPOSITION_TYPE)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_DATASPACE == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_DATASPACE)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_DISPLAY_FRAME == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_DISPLAY_FRAME)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_PLANE_ALPHA == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_PLANE_ALPHA)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_SIDEBAND_STREAM == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_SIDEBAND_STREAM)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_SOURCE_CROP == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_SOURCE_CROP)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_TRANSFORM == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_TRANSFORM)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_VISIBLE_REGION == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_VISIBLE_REGION)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_Z_ORDER == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_Z_ORDER)); -static_assert(aidl::android::hardware::graphics::composer3::Command:: - SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_PER_FRAME_METADATA == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_PER_FRAME_METADATA)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_FLOAT_COLOR == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_FLOAT_COLOR)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_COLOR_TRANSFORM == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_COLOR_TRANSFORM)); -static_assert( - aidl::android::hardware::graphics::composer3::Command::SET_LAYER_PER_FRAME_METADATA_BLOBS == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_PER_FRAME_METADATA_BLOBS)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_CLIENT_TARGET_PROPERTY == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_CLIENT_TARGET_PROPERTY)); -static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_GENERIC_METADATA == - static_cast( - ::android::hardware::graphics::composer::V2_4::IComposerClient::Command:: - SET_LAYER_GENERIC_METADATA)); - static_assert(aidl::android::hardware::graphics::composer3::DisplayAttribute::INVALID == static_cast( ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute:: @@ -612,4 +455,4 @@ __attribute__((warn_unused_result)) bool translate( return true; } -} // namespace android::h2a \ No newline at end of file +} // namespace android::h2a diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp index 9bf860934e..741572db57 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp @@ -35,7 +35,6 @@ cc_test { "VtsHalGraphicsComposer3_TargetTest.cpp", "VtsHalGraphicsComposer3_ReadbackTest.cpp", "composer-vts/GraphicsComposerCallback.cpp", - "composer-vts/TestCommandReader.cpp", ], shared_libs: [ diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 4008cb4dcb..717b60cd61 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -28,7 +28,6 @@ #include #include #include "composer-vts/include/GraphicsComposerCallback.h" -#include "composer-vts/include/TestCommandReader.h" namespace aidl::android::hardware::graphics::composer3::vts { namespace { @@ -70,9 +69,7 @@ class GraphicsCompositionTestBase : public ::testing::Test { EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, false).isOk()); mComposerCallback->setVsyncAllowed(false); - // set up command writer/reader and gralloc - mWriter = std::make_shared(1024); - mReader = std::make_unique(); + // set up gralloc mGraphicBuffer = allocate(); ASSERT_NO_FATAL_FAILURE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON)); @@ -104,8 +101,15 @@ class GraphicsCompositionTestBase : public ::testing::Test { void TearDown() override { ASSERT_NO_FATAL_FAILURE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF)); - EXPECT_EQ(0, mReader->mErrors.size()); - EXPECT_EQ(0, mReader->mCompositionChanges.size()); + const auto errors = mReader.takeErrors(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + std::vector layers; + std::vector types; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &layers, &types); + + ASSERT_TRUE(layers.empty()); + ASSERT_TRUE(types.empty()); if (mComposerCallback != nullptr) { EXPECT_EQ(0, mComposerCallback->getInvalidHotplugCount()); EXPECT_EQ(0, mComposerCallback->getInvalidRefreshCount()); @@ -122,11 +126,6 @@ class GraphicsCompositionTestBase : public ::testing::Test { "VtsHalGraphicsComposer3_ReadbackTest"); } - void clearCommandReaderState() { - mReader->mCompositionChanges.clear(); - mReader->mErrors.clear(); - } - void writeLayers(const std::vector>& layers) { for (auto layer : layers) { layer->write(mWriter); @@ -135,31 +134,18 @@ class GraphicsCompositionTestBase : public ::testing::Test { } void execute() { - TestCommandReader* reader = mReader.get(); - CommandWriterBase* writer = mWriter.get(); - bool queueChanged = false; - int32_t commandLength = 0; - std::vector commandHandles; - ASSERT_TRUE(writer->writeQueue(&queueChanged, &commandLength, &commandHandles)); - - if (queueChanged) { - auto ret = mComposerClient->setInputCommandQueue(writer->getMQDescriptor()); - ASSERT_TRUE(ret.isOk()); + const auto& commands = mWriter.getPendingCommands(); + if (commands.empty()) { + mWriter.reset(); + return; } - ExecuteCommandsStatus commandStatus; - EXPECT_TRUE(mComposerClient->executeCommands(commandLength, commandHandles, &commandStatus) - .isOk()); + std::vector results; + const auto status = mComposerClient->executeCommands(commands, &results); + ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); - if (commandStatus.queueChanged) { - MQDescriptor outputCommandQueue; - ASSERT_TRUE(mComposerClient->getOutputCommandQueue(&outputCommandQueue).isOk()); - reader->setMQDescriptor(outputCommandQueue); - } - ASSERT_TRUE(reader->readQueue(commandStatus.length, std::move(commandStatus.handles))); - reader->parse(); - reader->reset(); - writer->reset(); + mReader.parse(results); + mWriter.reset(); } bool getHasReadbackBuffer() { @@ -181,8 +167,8 @@ class GraphicsCompositionTestBase : public ::testing::Test { int32_t mDisplayWidth; int32_t mDisplayHeight; std::vector mTestColorModes; - std::shared_ptr mWriter; - std::unique_ptr mReader; + CommandWriterBase mWriter; + CommandReaderBase mReader; ::android::sp<::android::GraphicBuffer> mGraphicBuffer; std::unique_ptr mTestRenderEngine; @@ -246,7 +232,6 @@ class GraphicsCompositionTest : public GraphicsCompositionTestBase, TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { for (ColorMode mode : mTestColorModes) { - mWriter->selectDisplay(mPrimaryDisplay); ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); @@ -272,20 +257,23 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); // if hwc cannot handle and asks for composition change, // just succeed the test - if (mReader->mCompositionChanges.size() != 0) { - clearCommandReaderState(); + std::vector changedCompositionLayers; + std::vector changedCompositionTypes; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + if (!changedCompositionLayers.empty()) { GTEST_SUCCEED(); return; } - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->presentDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); mTestRenderEngine->setRenderLayers(layers); @@ -296,7 +284,6 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { TEST_P(GraphicsCompositionTest, SetLayerBuffer) { for (ColorMode mode : mTestColorModes) { - mWriter->selectDisplay(mPrimaryDisplay); ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); @@ -305,8 +292,6 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { return; } - mWriter->selectDisplay(mPrimaryDisplay); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); @@ -331,21 +316,24 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { std::vector> layers = {layer}; writeLayers(layers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (mReader->mCompositionChanges.size() != 0) { - clearCommandReaderState(); + std::vector changedCompositionLayers; + std::vector changedCompositionTypes; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + if (!changedCompositionLayers.empty()) { GTEST_SUCCEED(); return; } - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter->presentDisplay(); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); mTestRenderEngine->setRenderLayers(layers); @@ -356,7 +344,6 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { for (ColorMode mode : mTestColorModes) { - mWriter->selectDisplay(mPrimaryDisplay); ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); @@ -380,7 +367,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { mGraphicBuffer->reallocate(static_cast(mDisplayWidth), static_cast(mDisplayHeight), 1, static_cast(common::PixelFormat::RGBA_8888), usage); - mWriter->setLayerBuffer(0, mGraphicBuffer->handle, -1); + mWriter.setLayerBuffer(mPrimaryDisplay, layer->getLayer(), 0, mGraphicBuffer->handle, -1); // expected color for each pixel std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); @@ -390,18 +377,21 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); - mWriter->validateDisplay(); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (mReader->mCompositionChanges.size() != 0) { - clearCommandReaderState(); + std::vector changedCompositionLayers; + std::vector changedCompositionTypes; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + if (!changedCompositionLayers.empty()) { GTEST_SUCCEED(); return; } - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->presentDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); } @@ -470,7 +460,6 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { .isOk()); for (ColorMode mode : mTestColorModes) { - mWriter->selectDisplay(mPrimaryDisplay); EXPECT_TRUE(mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC) .isOk()); @@ -479,8 +468,6 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { return; } - mWriter->selectDisplay(mPrimaryDisplay); - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, {0, 0, mDisplayWidth, mDisplayHeight / 4}, RED); @@ -504,13 +491,18 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (!mReader->mCompositionChanges.empty()) { - ASSERT_EQ(1, mReader->mCompositionChanges.size()); - ASSERT_EQ(1, mReader->mCompositionChanges[0].second); + std::vector changedCompositionLayers; + std::vector changedCompositionTypes; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + if (!changedCompositionLayers.empty()) { + ASSERT_EQ(1, changedCompositionLayers.size()); + ASSERT_EQ(1, changedCompositionTypes.size()); + ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0]); PixelFormat clientFormat = PixelFormat::RGBA_8888; auto clientUsage = static_cast( @@ -541,18 +533,20 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fenceHandle).isOk()); layer->setToClientComposition(mWriter); - mWriter->acceptDisplayChanges(); - mWriter->setClientTarget(0, mGraphicBuffer->handle, fenceHandle.get(), clientDataspace, - std::vector(1, damage)); + mWriter.acceptDisplayChanges(mPrimaryDisplay); + mWriter.setClientTarget(mPrimaryDisplay, 0, mGraphicBuffer->handle, fenceHandle.get(), + clientDataspace, std::vector(1, damage)); execute(); - ASSERT_EQ(0, mReader->mCompositionChanges.size()); + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + ASSERT_TRUE(changedCompositionLayers.empty()); } - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter->presentDisplay(); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); } @@ -563,7 +557,6 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kClientTargetSlotCount)); for (ColorMode mode : mTestColorModes) { - mWriter->selectDisplay(mPrimaryDisplay); ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); @@ -613,15 +606,18 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { clientLayer->setDisplayFrame(clientFrame); clientLayer->setZOrder(0); clientLayer->write(mWriter); - mWriter->validateDisplay(); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (mReader->mCompositionChanges.size() != 1) { - mReader->mCompositionChanges.clear(); + std::vector changedCompositionLayers; + std::vector changedCompositionTypes; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + if (changedCompositionTypes.size() != 1) { continue; } // create client target buffer - ASSERT_EQ(1, mReader->mCompositionChanges[0].second); + ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0]); mGraphicBuffer->reallocate(static_cast(mDisplayWidth), static_cast(mDisplayHeight), static_cast(common::PixelFormat::RGBA_8888), @@ -642,23 +638,24 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { EXPECT_TRUE(mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fenceHandle).isOk()); clientLayer->setToClientComposition(mWriter); - mWriter->acceptDisplayChanges(); - mWriter->setClientTarget(0, mGraphicBuffer->handle, fenceHandle.get(), clientDataspace, - std::vector(1, clientFrame)); + mWriter.acceptDisplayChanges(mPrimaryDisplay); + mWriter.setClientTarget(mPrimaryDisplay, 0, mGraphicBuffer->handle, fenceHandle.get(), + clientDataspace, std::vector(1, clientFrame)); execute(); - ASSERT_EQ(0, mReader->mCompositionChanges.size()); - ASSERT_EQ(0, mReader->mErrors.size()); + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + ASSERT_EQ(0, changedCompositionLayers.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter->presentDisplay(); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); } } TEST_P(GraphicsCompositionTest, SetLayerDamage) { for (ColorMode mode : mTestColorModes) { - mWriter->selectDisplay(mPrimaryDisplay); ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); @@ -667,8 +664,6 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { return; } - mWriter->selectDisplay(mPrimaryDisplay); - common::Rect redRect = {0, 0, mDisplayWidth / 4, mDisplayHeight / 4}; std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); @@ -689,18 +684,21 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (mReader->mCompositionChanges.size() != 0) { - clearCommandReaderState(); + std::vector changedCompositionLayers; + std::vector changedCompositionTypes; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + if (!changedCompositionLayers.empty()) { GTEST_SUCCEED(); return; } - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->presentDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); @@ -716,14 +714,17 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); - ASSERT_EQ(0, mReader->mCompositionChanges.size()); - mWriter->presentDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + ASSERT_TRUE(changedCompositionLayers.empty()); + ASSERT_TRUE(changedCompositionTypes.empty()); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); } @@ -731,7 +732,6 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) { for (ColorMode mode : mTestColorModes) { - mWriter->selectDisplay(mPrimaryDisplay); ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); @@ -755,19 +755,22 @@ TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (mReader->mCompositionChanges.size() != 0) { - clearCommandReaderState(); + std::vector changedCompositionLayers; + std::vector changedCompositionTypes; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + if (!changedCompositionLayers.empty()) { GTEST_SUCCEED(); return; } - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter->presentDisplay(); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); @@ -780,7 +783,6 @@ TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) { TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { for (ColorMode mode : mTestColorModes) { - mWriter->selectDisplay(mPrimaryDisplay); ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); @@ -789,8 +791,6 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { return; } - mWriter->selectDisplay(mPrimaryDisplay); - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, {0, 0, mDisplayWidth, mDisplayHeight / 4}, RED); @@ -818,18 +818,21 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (mReader->mCompositionChanges.size() != 0) { - clearCommandReaderState(); + std::vector changedCompositionLayers; + std::vector changedCompositionTypes; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + if (!changedCompositionLayers.empty()) { GTEST_SUCCEED(); return; } - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->presentDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); mTestRenderEngine->setRenderLayers(layers); ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); @@ -839,7 +842,6 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { TEST_P(GraphicsCompositionTest, SetLayerZOrder) { for (ColorMode mode : mTestColorModes) { - mWriter->selectDisplay(mPrimaryDisplay); ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); @@ -874,17 +876,20 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (mReader->mCompositionChanges.size() != 0) { - clearCommandReaderState(); + std::vector changedCompositionLayers; + std::vector changedCompositionTypes; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + if (!changedCompositionLayers.empty()) { GTEST_SUCCEED(); return; } - mWriter->presentDisplay(); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); @@ -896,14 +901,17 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mCompositionChanges.size()); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->presentDisplay(); + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + ASSERT_TRUE(changedCompositionLayers.empty()); + ASSERT_TRUE(changedCompositionTypes.empty()); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); mTestRenderEngine->setRenderLayers(layers); @@ -999,7 +1007,6 @@ class GraphicsBlendModeCompositionTest TEST_P(GraphicsBlendModeCompositionTest, None) { for (ColorMode mode : mTestColorModes) { - mWriter->selectDisplay(mPrimaryDisplay); ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); @@ -1008,8 +1015,6 @@ TEST_P(GraphicsBlendModeCompositionTest, None) { return; } - mWriter->selectDisplay(mPrimaryDisplay); - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); setBackgroundColor(BLACK); @@ -1021,18 +1026,21 @@ TEST_P(GraphicsBlendModeCompositionTest, None) { mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (mReader->mCompositionChanges.size() != 0) { - clearCommandReaderState(); + std::vector changedCompositionLayers; + std::vector changedCompositionTypes; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + if (!changedCompositionLayers.empty()) { GTEST_SUCCEED(); return; } - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->presentDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); mTestRenderEngine->setRenderLayers(mLayers); @@ -1043,7 +1051,6 @@ TEST_P(GraphicsBlendModeCompositionTest, None) { TEST_P(GraphicsBlendModeCompositionTest, Coverage) { for (ColorMode mode : mTestColorModes) { - mWriter->selectDisplay(mPrimaryDisplay); ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); @@ -1052,8 +1059,6 @@ TEST_P(GraphicsBlendModeCompositionTest, Coverage) { return; } - mWriter->selectDisplay(mPrimaryDisplay); - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); setBackgroundColor(BLACK); @@ -1066,25 +1071,27 @@ TEST_P(GraphicsBlendModeCompositionTest, Coverage) { mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (mReader->mCompositionChanges.size() != 0) { - clearCommandReaderState(); + std::vector changedCompositionLayers; + std::vector changedCompositionTypes; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + if (!changedCompositionLayers.empty()) { GTEST_SUCCEED(); return; } - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->presentDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); } } TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) { for (ColorMode mode : mTestColorModes) { - mWriter->selectDisplay(mPrimaryDisplay); ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); @@ -1092,7 +1099,6 @@ TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - mWriter->selectDisplay(mPrimaryDisplay); std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); @@ -1105,18 +1111,21 @@ TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) { mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (mReader->mCompositionChanges.size() != 0) { - clearCommandReaderState(); + std::vector changedCompositionLayers; + std::vector changedCompositionTypes; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + if (!changedCompositionLayers.empty()) { GTEST_SUCCEED(); return; } - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->presentDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); mTestRenderEngine->setRenderLayers(mLayers); ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); @@ -1128,7 +1137,7 @@ class GraphicsTransformCompositionTest : public GraphicsCompositionTest { protected: void SetUp() override { GraphicsCompositionTest::SetUp(); - mWriter->selectDisplay(mPrimaryDisplay); + auto backgroundLayer = std::make_shared(mComposerClient, mPrimaryDisplay); backgroundLayer->setColor({0, 0, 0, 0}); backgroundLayer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); @@ -1159,8 +1168,6 @@ class GraphicsTransformCompositionTest : public GraphicsCompositionTest { TEST_P(GraphicsTransformCompositionTest, FLIP_H) { for (ColorMode mode : mTestColorModes) { - ASSERT_NE(nullptr, mWriter); - mWriter->selectDisplay(mPrimaryDisplay); auto error = mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC); if (!error.isOk() && @@ -1187,18 +1194,21 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { {0, mSideLength / 2, mSideLength / 2, mSideLength}, BLUE); writeLayers(mLayers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (mReader->mCompositionChanges.size() != 0) { - clearCommandReaderState(); + std::vector changedCompositionLayers; + std::vector changedCompositionTypes; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + if (!changedCompositionLayers.empty()) { GTEST_SUCCEED(); return; } - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->presentDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); mTestRenderEngine->setRenderLayers(mLayers); @@ -1209,7 +1219,6 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { TEST_P(GraphicsTransformCompositionTest, FLIP_V) { for (ColorMode mode : mTestColorModes) { - mWriter->selectDisplay(mPrimaryDisplay); ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); @@ -1231,18 +1240,21 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) { {mSideLength / 2, 0, mSideLength, mSideLength / 2}, BLUE); writeLayers(mLayers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (mReader->mCompositionChanges.size() != 0) { - clearCommandReaderState(); + std::vector changedCompositionLayers; + std::vector changedCompositionTypes; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, + &changedCompositionTypes); + if (!changedCompositionLayers.empty()) { GTEST_SUCCEED(); return; } - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->presentDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); mTestRenderEngine->setRenderLayers(mLayers); ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); @@ -1252,7 +1264,6 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) { TEST_P(GraphicsTransformCompositionTest, ROT_180) { for (ColorMode mode : mTestColorModes) { - mWriter->selectDisplay(mPrimaryDisplay); ASSERT_NO_FATAL_FAILURE( mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); @@ -1275,18 +1286,20 @@ TEST_P(GraphicsTransformCompositionTest, ROT_180) { {0, 0, mSideLength / 2, mSideLength / 2}, BLUE); writeLayers(mLayers); - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->validateDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (!mReader->mCompositionChanges.empty()) { - clearCommandReaderState(); + std::vector layers; + std::vector types; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &layers, &types); + if (!layers.empty()) { GTEST_SUCCEED(); return; } - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->presentDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); mTestRenderEngine->setRenderLayers(mLayers); ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); @@ -1313,4 +1326,4 @@ INSTANTIATE_TEST_SUITE_P( ::android::PrintInstanceNameToString); } // namespace -} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file +} // namespace aidl::android::hardware::graphics::composer3::vts diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index b9460c82ff..7a20a53e3b 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -4,10 +4,10 @@ #include #include +#include #include #include #include -#include #include #include #include @@ -27,7 +27,6 @@ #include #include #include "composer-vts/include/GraphicsComposerCallback.h" -#include "composer-vts/include/TestCommandReader.h" // TODO(b/129481165): remove the #pragma below and fix conversion issues #pragma clang diagnostic pop // ignored "-Wconversion @@ -1148,45 +1147,33 @@ TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrixBadParameter) { // Tests for Command. class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { protected: - void SetUp() override { - ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::SetUp()); + void TearDown() override { + const auto errors = mReader.takeErrors(); + ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter = std::make_unique(1024); - mReader = std::make_unique(); - } + std::vector layers; + std::vector types; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &layers, &types); + + ASSERT_TRUE(layers.empty()); + ASSERT_TRUE(types.empty()); - void TearDown() override { - ASSERT_EQ(0, mReader->mErrors.size()); - ASSERT_EQ(0, mReader->mCompositionChanges.size()); ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::TearDown()); } void execute() { - TestCommandReader* reader = mReader.get(); - CommandWriterBase* writer = mWriter.get(); - bool queueChanged = false; - int32_t commandLength = 0; - std::vector commandHandles; - ASSERT_TRUE(writer->writeQueue(&queueChanged, &commandLength, &commandHandles)); - - if (queueChanged) { - auto ret = mComposerClient->setInputCommandQueue(writer->getMQDescriptor()); - ASSERT_TRUE(ret.isOk()); + const auto& commands = mWriter.getPendingCommands(); + if (commands.empty()) { + mWriter.reset(); + return; } - ExecuteCommandsStatus commandStatus; - EXPECT_TRUE(mComposerClient->executeCommands(commandLength, commandHandles, &commandStatus) - .isOk()); + std::vector results; + const auto status = mComposerClient->executeCommands(commands, &results); + ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); - if (commandStatus.queueChanged) { - MQDescriptor outputCommandQueue; - ASSERT_TRUE(mComposerClient->getOutputCommandQueue(&outputCommandQueue).isOk()); - reader->setMQDescriptor(outputCommandQueue); - } - ASSERT_TRUE(reader->readQueue(commandStatus.length, std::move(commandStatus.handles))); - reader->parse(); - reader->reset(); - writer->reset(); + mReader.parse(results); + mWriter.reset(); } static inline auto toTimePoint(nsecs_t time) { @@ -1255,7 +1242,6 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { std::this_thread::sleep_until(toTimePoint(timeline->refreshTimeNanos)); } - mWriter->selectDisplay(display.get()); EXPECT_TRUE(mComposerClient->setPowerMode(display.get(), PowerMode::ON).isOk()); EXPECT_TRUE( mComposerClient @@ -1270,42 +1256,41 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { ASSERT_EQ(::android::OK, buffer->initCheck()); ASSERT_NE(nullptr, buffer->handle); - mWriter->selectLayer(layer); - mWriter->setLayerCompositionType(Composition::DEVICE); - mWriter->setLayerDisplayFrame(display.getFrameRect()); - mWriter->setLayerPlaneAlpha(1); - mWriter->setLayerSourceCrop(display.getCrop()); - mWriter->setLayerTransform(static_cast(0)); - mWriter->setLayerVisibleRegion(std::vector(1, display.getFrameRect())); - mWriter->setLayerZOrder(10); - mWriter->setLayerBlendMode(BlendMode::NONE); - mWriter->setLayerSurfaceDamage(std::vector(1, display.getFrameRect())); - mWriter->setLayerBuffer(0, buffer->handle, -1); - mWriter->setLayerDataspace(common::Dataspace::UNKNOWN); - - mWriter->validateDisplay(); + mWriter.setLayerCompositionType(display.get(), layer, Composition::DEVICE); + mWriter.setLayerDisplayFrame(display.get(), layer, display.getFrameRect()); + mWriter.setLayerPlaneAlpha(display.get(), layer, 1); + mWriter.setLayerSourceCrop(display.get(), layer, display.getCrop()); + mWriter.setLayerTransform(display.get(), layer, static_cast(0)); + mWriter.setLayerVisibleRegion(display.get(), layer, + std::vector(1, display.getFrameRect())); + mWriter.setLayerZOrder(display.get(), layer, 10); + mWriter.setLayerBlendMode(display.get(), layer, BlendMode::NONE); + mWriter.setLayerSurfaceDamage(display.get(), layer, + std::vector(1, display.getFrameRect())); + mWriter.setLayerBuffer(display.get(), layer, 0, buffer->handle, -1); + mWriter.setLayerDataspace(display.get(), layer, common::Dataspace::UNKNOWN); + + mWriter.validateDisplay(display.get()); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); - mReader->mCompositionChanges.clear(); + ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter->presentDisplay(); + mWriter.presentDisplay(display.get()); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); } { auto buffer = allocate(); ASSERT_NE(nullptr, buffer->handle); - mWriter->selectLayer(layer); - mWriter->setLayerBuffer(0, buffer->handle, -1); - mWriter->setLayerSurfaceDamage(std::vector(1, {0, 0, 10, 10})); - mWriter->validateDisplay(); + mWriter.setLayerBuffer(display.get(), layer, 0, buffer->handle, -1); + mWriter.setLayerSurfaceDamage(display.get(), layer, + std::vector(1, {0, 0, 10, 10})); + mWriter.validateDisplay(display.get()); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); - mReader->mCompositionChanges.clear(); + ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter->presentDisplay(); + mWriter.presentDisplay(display.get()); execute(); } @@ -1411,26 +1396,23 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { }}; // clang-format on - std::unique_ptr mWriter; - std::unique_ptr mReader; + CommandWriterBase mWriter; + CommandReaderBase mReader; }; TEST_P(GraphicsComposerAidlCommandTest, SET_COLOR_TRANSFORM) { - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->setColorTransform(kIdentity.data(), ColorTransform::IDENTITY); + mWriter.setColorTransform(mPrimaryDisplay, kIdentity.data(), ColorTransform::IDENTITY); execute(); } TEST_P(GraphicsComposerAidlCommandTest, SetLayerColorTransform) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerColorTransform(kIdentity.data()); + mWriter.setLayerColorTransform(mPrimaryDisplay, layer, kIdentity.data()); execute(); - if (mReader->mErrors.size() == 1 && mReader->mErrors[0].second == EX_UNSUPPORTED_OPERATION) { - mReader->mErrors.clear(); + const auto errors = mReader.takeErrors(); + if (errors.size() == 1 && errors[0].errorCode == EX_UNSUPPORTED_OPERATION) { GTEST_SUCCEED() << "setLayerColorTransform is not supported"; return; } @@ -1440,8 +1422,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_CLIENT_TARGET) { EXPECT_TRUE( mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kBufferSlotCount).isOk()); - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->setClientTarget(0, nullptr, -1, Dataspace::UNKNOWN, std::vector()); + mWriter.setClientTarget(mPrimaryDisplay, 0, nullptr, -1, Dataspace::UNKNOWN, + std::vector()); execute(); } @@ -1460,30 +1442,26 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_OUTPUT_BUFFER) { kBufferSlotCount, &display) .isOk()); - mWriter->selectDisplay(display.display); auto handle = allocate()->handle; - mWriter->setOutputBuffer(0, handle, -1); + mWriter.setOutputBuffer(display.display, 0, handle, -1); execute(); } TEST_P(GraphicsComposerAidlCommandTest, VALIDATE_DISPLAY) { - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->validateDisplay(); + mWriter.validateDisplay(mPrimaryDisplay); execute(); } TEST_P(GraphicsComposerAidlCommandTest, ACCEPT_DISPLAY_CHANGES) { - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->validateDisplay(); - mWriter->acceptDisplayChanges(); + mWriter.validateDisplay(mPrimaryDisplay); + mWriter.acceptDisplayChanges(mPrimaryDisplay); execute(); } // TODO(b/208441745) fix the test failure TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY) { - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->validateDisplay(); - mWriter->presentDisplay(); + mWriter.validateDisplay(mPrimaryDisplay); + mWriter.presentDisplay(mPrimaryDisplay); execute(); } @@ -1503,7 +1481,6 @@ TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) GTEST_SUCCEED() << "Device does not have skip validate capability, skipping"; return; } - mWriter->selectDisplay(mPrimaryDisplay); mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON); std::vector renderIntents; @@ -1518,37 +1495,39 @@ TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter->selectLayer(layer); - mWriter->setLayerCompositionType(Composition::DEVICE); - mWriter->setLayerDisplayFrame(displayFrame); - mWriter->setLayerPlaneAlpha(1); - mWriter->setLayerSourceCrop({0, 0, (float)mDisplayWidth, (float)mDisplayHeight}); - mWriter->setLayerTransform(static_cast(0)); - mWriter->setLayerVisibleRegion(std::vector(1, displayFrame)); - mWriter->setLayerZOrder(10); - mWriter->setLayerBlendMode(BlendMode::NONE); - mWriter->setLayerSurfaceDamage(std::vector(1, displayFrame)); - mWriter->setLayerBuffer(0, handle, -1); - mWriter->setLayerDataspace(Dataspace::UNKNOWN); - - mWriter->validateDisplay(); + mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::DEVICE); + mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, displayFrame); + mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1); + mWriter.setLayerSourceCrop(mPrimaryDisplay, layer, + {0, 0, (float)mDisplayWidth, (float)mDisplayHeight}); + mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast(0)); + mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector(1, displayFrame)); + mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10); + mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE); + mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector(1, displayFrame)); + mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle, -1); + mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN); + + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (mReader->mCompositionChanges.size() != 0) { + std::vector layers; + std::vector types; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &layers, &types); + if (!layers.empty()) { GTEST_SUCCEED() << "Composition change requested, skipping test"; return; } - ASSERT_EQ(0, mReader->mErrors.size()); - mWriter->presentDisplay(); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.presentDisplay(mPrimaryDisplay); execute(); - ASSERT_EQ(0, mReader->mErrors.size()); + ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter->selectLayer(layer); auto handle2 = allocate()->handle; ASSERT_NE(nullptr, handle2); - mWriter->setLayerBuffer(0, handle2, -1); - mWriter->setLayerSurfaceDamage(std::vector(1, {0, 0, 10, 10})); - mWriter->presentDisplay(); + mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle2, -1); + mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector(1, {0, 0, 10, 10})); + mWriter.presentDisplay(mPrimaryDisplay); execute(); } } @@ -1562,33 +1541,37 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_CURSOR_POSITION) { ASSERT_NE(nullptr, handle); Rect displayFrame{0, 0, mDisplayWidth, mDisplayHeight}; - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerBuffer(0, handle, -1); - mWriter->setLayerCompositionType(Composition::CURSOR); - mWriter->setLayerDisplayFrame(displayFrame); - mWriter->setLayerPlaneAlpha(1); - mWriter->setLayerSourceCrop({0, 0, (float)mDisplayWidth, (float)mDisplayHeight}); - mWriter->setLayerTransform(static_cast(0)); - mWriter->setLayerVisibleRegion(std::vector(1, displayFrame)); - mWriter->setLayerZOrder(10); - mWriter->setLayerBlendMode(BlendMode::NONE); - mWriter->setLayerSurfaceDamage(std::vector(1, displayFrame)); - mWriter->setLayerDataspace(Dataspace::UNKNOWN); - mWriter->validateDisplay(); + mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle, -1); + mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::CURSOR); + mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, displayFrame); + mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1); + mWriter.setLayerSourceCrop(mPrimaryDisplay, layer, + {0, 0, (float)mDisplayWidth, (float)mDisplayHeight}); + mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast(0)); + mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector(1, displayFrame)); + mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10); + mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE); + mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector(1, displayFrame)); + mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN); + mWriter.validateDisplay(mPrimaryDisplay); execute(); - if (mReader->mCompositionChanges.size() != 0) { + std::vector layers; + std::vector types; + mReader.takeChangedCompositionTypes(mPrimaryDisplay, &layers, &types); + if (!layers.empty()) { GTEST_SUCCEED() << "Composition change requested, skipping test"; return; } - mWriter->presentDisplay(); - ASSERT_EQ(0, mReader->mErrors.size()); + mWriter.presentDisplay(mPrimaryDisplay); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerCursorPosition(mPrimaryDisplay, layer, 1, 1); + execute(); - mWriter->setLayerCursorPosition(1, 1); - mWriter->setLayerCursorPosition(0, 0); - mWriter->validateDisplay(); - mWriter->presentDisplay(); + mWriter.setLayerCursorPosition(mPrimaryDisplay, layer, 0, 0); + mWriter.validateDisplay(mPrimaryDisplay); + mWriter.presentDisplay(mPrimaryDisplay); execute(); } @@ -1598,10 +1581,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BUFFER) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerBuffer(0, handle, -1); + mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle, -1); execute(); } @@ -1612,58 +1592,77 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SURFACE_DAMAGE) { Rect empty{0, 0, 0, 0}; Rect unit{0, 0, 1, 1}; - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerSurfaceDamage(std::vector(1, empty)); - mWriter->setLayerSurfaceDamage(std::vector(1, unit)); - mWriter->setLayerSurfaceDamage(std::vector()); + mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector(1, empty)); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector(1, unit)); execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector()); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); } TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BLEND_MODE) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerBlendMode(BlendMode::NONE); - mWriter->setLayerBlendMode(BlendMode::PREMULTIPLIED); - mWriter->setLayerBlendMode(BlendMode::COVERAGE); + mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::PREMULTIPLIED); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::COVERAGE); execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); } TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_COLOR) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerColor(Color{static_cast(0xff), static_cast(0xff), - static_cast(0xff), static_cast(0xff)}); - mWriter->setLayerColor(Color{0, 0, 0, 0}); + mWriter.setLayerColor(mPrimaryDisplay, layer, + Color{static_cast(0xff), static_cast(0xff), + static_cast(0xff), static_cast(0xff)}); execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerColor(mPrimaryDisplay, layer, Color{0, 0, 0, 0}); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); } TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_COMPOSITION_TYPE) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerCompositionType(Composition::CLIENT); - mWriter->setLayerCompositionType(Composition::DEVICE); - mWriter->setLayerCompositionType(Composition::SOLID_COLOR); - mWriter->setLayerCompositionType(Composition::CURSOR); + mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::CLIENT); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::DEVICE); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::SOLID_COLOR); execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::CURSOR); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); } TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_DATASPACE) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerDataspace(Dataspace::UNKNOWN); + mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN); execute(); } @@ -1671,9 +1670,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_DISPLAY_FRAME) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerDisplayFrame(Rect{0, 0, 1, 1}); + mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, Rect{0, 0, 1, 1}); execute(); } @@ -1681,11 +1678,13 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_PLANE_ALPHA) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerPlaneAlpha(0.0f); - mWriter->setLayerPlaneAlpha(1.0f); + mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 0.0f); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1.0f); execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); } TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SIDEBAND_STREAM) { @@ -1703,9 +1702,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SIDEBAND_STREAM) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerSidebandStream(handle); + mWriter.setLayerSidebandStream(mPrimaryDisplay, layer, handle); execute(); } @@ -1713,9 +1710,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SOURCE_CROP) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerSourceCrop(FRect{0.0f, 0.0f, 1.0f, 1.0f}); + mWriter.setLayerSourceCrop(mPrimaryDisplay, layer, FRect{0.0f, 0.0f, 1.0f, 1.0f}); execute(); } @@ -1723,19 +1718,41 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_TRANSFORM) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerTransform(static_cast(0)); - mWriter->setLayerTransform(Transform::FLIP_H); - mWriter->setLayerTransform(Transform::FLIP_V); - mWriter->setLayerTransform(Transform::ROT_90); - mWriter->setLayerTransform(Transform::ROT_180); - mWriter->setLayerTransform(Transform::ROT_270); - mWriter->setLayerTransform(static_cast(static_cast(Transform::FLIP_H) | - static_cast(Transform::ROT_90))); - mWriter->setLayerTransform(static_cast(static_cast(Transform::FLIP_V) | - static_cast(Transform::ROT_90))); + mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast(0)); execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::FLIP_H); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::FLIP_V); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::ROT_90); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::ROT_180); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::ROT_270); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerTransform(mPrimaryDisplay, layer, + static_cast(static_cast(Transform::FLIP_H) | + static_cast(Transform::ROT_90))); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerTransform(mPrimaryDisplay, layer, + static_cast(static_cast(Transform::FLIP_V) | + static_cast(Transform::ROT_90))); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); } TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_VISIBLE_REGION) { @@ -1745,32 +1762,36 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_VISIBLE_REGION) { Rect empty{0, 0, 0, 0}; Rect unit{0, 0, 1, 1}; - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerVisibleRegion(std::vector(1, empty)); - mWriter->setLayerVisibleRegion(std::vector(1, unit)); - mWriter->setLayerVisibleRegion(std::vector()); + mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector(1, empty)); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector(1, unit)); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector()); execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); } TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_Z_ORDER) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - mWriter->setLayerZOrder(10); - mWriter->setLayerZOrder(0); + mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10); execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerZOrder(mPrimaryDisplay, layer, 0); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); } TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_PER_FRAME_METADATA) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter->selectDisplay(mPrimaryDisplay); - mWriter->selectLayer(layer); - /** * DISPLAY_P3 is a color space that uses the DCI_P3 primaries, * the D65 white point and the SRGB transfer functions. @@ -1796,11 +1817,11 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_PER_FRAME_METADATA) { aidlMetadata.push_back({PerFrameMetadataKey::MIN_LUMINANCE, 0.1f}); aidlMetadata.push_back({PerFrameMetadataKey::MAX_CONTENT_LIGHT_LEVEL, 78.0}); aidlMetadata.push_back({PerFrameMetadataKey::MAX_FRAME_AVERAGE_LIGHT_LEVEL, 62.0}); - mWriter->setLayerPerFrameMetadata(aidlMetadata); + mWriter.setLayerPerFrameMetadata(mPrimaryDisplay, layer, aidlMetadata); execute(); - if (mReader->mErrors.size() == 1 && mReader->mErrors[0].second == EX_UNSUPPORTED_OPERATION) { - mReader->mErrors.clear(); + 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(mPrimaryDisplay, layer).isOk()); return; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp index 2b058c7fdb..df038db47b 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp @@ -28,7 +28,6 @@ cc_library_static { defaults: ["hidl_defaults"], srcs: [ "GraphicsComposerCallback.cpp", - "TestCommandReader.cpp", "ReadbackVts.cpp", "RenderEngineVts.cpp", ], diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp index b612309138..a6954b4625 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp @@ -32,15 +32,14 @@ const std::vector ReadbackHelper::colorModes = {ColorMode::SRGB, Colo const std::vector ReadbackHelper::dataspaces = {common::Dataspace::SRGB, common::Dataspace::DISPLAY_P3}; -void TestLayer::write(const std::shared_ptr& writer) { - writer->selectLayer(mLayer); - writer->setLayerDisplayFrame(mDisplayFrame); - writer->setLayerSourceCrop(mSourceCrop); - writer->setLayerZOrder(mZOrder); - writer->setLayerSurfaceDamage(mSurfaceDamage); - writer->setLayerTransform(mTransform); - writer->setLayerPlaneAlpha(mAlpha); - writer->setLayerBlendMode(mBlendMode); +void TestLayer::write(CommandWriterBase& writer) { + writer.setLayerDisplayFrame(mDisplay, mLayer, mDisplayFrame); + writer.setLayerSourceCrop(mDisplay, mLayer, mSourceCrop); + writer.setLayerZOrder(mDisplay, mLayer, mZOrder); + writer.setLayerSurfaceDamage(mDisplay, mLayer, mSurfaceDamage); + writer.setLayerTransform(mDisplay, mLayer, mTransform); + writer.setLayerPlaneAlpha(mDisplay, mLayer, mAlpha); + writer.setLayerBlendMode(mDisplay, mLayer, mBlendMode); } std::string ReadbackHelper::getColorModeString(ColorMode mode) { @@ -254,10 +253,10 @@ void ReadbackBuffer::checkReadbackBuffer(std::vector expectedColors) { EXPECT_EQ(::android::OK, status); } -void TestColorLayer::write(const std::shared_ptr& writer) { +void TestColorLayer::write(CommandWriterBase& writer) { TestLayer::write(writer); - writer->setLayerCompositionType(Composition::SOLID_COLOR); - writer->setLayerColor(mColor); + writer.setLayerCompositionType(mDisplay, mLayer, Composition::SOLID_COLOR); + writer.setLayerColor(mDisplay, mLayer, mColor); } LayerSettings TestColorLayer::toRenderEngineLayerSettings() { @@ -297,12 +296,12 @@ TestBufferLayer::TestBufferLayer(const std::shared_ptr& client, setSourceCrop({0, 0, (float)width, (float)height}); } -void TestBufferLayer::write(const std::shared_ptr& writer) { +void TestBufferLayer::write(CommandWriterBase& writer) { TestLayer::write(writer); - writer->setLayerCompositionType(mComposition); - writer->setLayerVisibleRegion(std::vector(1, mDisplayFrame)); + writer.setLayerCompositionType(mDisplay, mLayer, mComposition); + writer.setLayerVisibleRegion(mDisplay, mLayer, std::vector(1, mDisplayFrame)); if (mGraphicBuffer->handle != nullptr) - writer->setLayerBuffer(0, mGraphicBuffer->handle, mFillFence); + writer.setLayerBuffer(mDisplay, mLayer, 0, mGraphicBuffer->handle, mFillFence); } LayerSettings TestBufferLayer::toRenderEngineLayerSettings() { @@ -346,15 +345,12 @@ void TestBufferLayer::setBuffer(std::vector colors) { ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck()); } -void TestBufferLayer::setDataspace(common::Dataspace dataspace, - const std::shared_ptr& writer) { - writer->selectLayer(mLayer); - writer->setLayerDataspace(dataspace); +void TestBufferLayer::setDataspace(common::Dataspace dataspace, CommandWriterBase& writer) { + writer.setLayerDataspace(mDisplay, mLayer, dataspace); } -void TestBufferLayer::setToClientComposition(const std::shared_ptr& writer) { - writer->selectLayer(mLayer); - writer->setLayerCompositionType(Composition::CLIENT); +void TestBufferLayer::setToClientComposition(CommandWriterBase& writer) { + writer.setLayerCompositionType(mDisplay, mLayer, Composition::CLIENT); } -} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file +} // namespace aidl::android::hardware::graphics::composer3::vts diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp index e83750e508..50ce462459 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp @@ -86,4 +86,4 @@ void TestRenderEngine::checkColorBuffer(std::vector& expectedColors) { ASSERT_EQ(::android::OK, mGraphicBuffer->unlock()); } -} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file +} // namespace aidl::android::hardware::graphics::composer3::vts diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/TestCommandReader.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/TestCommandReader.cpp deleted file mode 100644 index a5a84d9285..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/TestCommandReader.cpp +++ /dev/null @@ -1,92 +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 "include/TestCommandReader.h" -#include - -namespace aidl::android::hardware::graphics::composer3::vts { - -void TestCommandReader::parse() { - mErrors.clear(); - mCompositionChanges.clear(); - while (!isEmpty()) { - int32_t command; - uint16_t length; - ASSERT_TRUE(beginCommand(&command, &length)); - - parseSingleCommand(command, length); - - endCommand(); - } -} - -void TestCommandReader::parseSingleCommand(int32_t commandRaw, uint16_t length) { - auto command = static_cast(commandRaw); - - switch (command) { - case Command::SET_CLIENT_TARGET_PROPERTY: { - ASSERT_EQ(2, length); - read(); - close(readFence()); - } break; - case Command::SELECT_DISPLAY: { - ASSERT_EQ(2, length); - read64(); // display - } break; - case Command::SET_ERROR: { - ASSERT_EQ(2, length); - auto loc = read(); - auto err = readSigned(); - std::pair error(loc, err); - mErrors.push_back(error); - } break; - case Command::SET_CHANGED_COMPOSITION_TYPES: { - ASSERT_EQ(0, length % 3); - for (uint16_t count = 0; count < length / 3; ++count) { - uint64_t layerId = read64(); - uint32_t composition = read(); - - std::pair compositionChange(layerId, composition); - mCompositionChanges.push_back(compositionChange); - } - } break; - case Command::SET_DISPLAY_REQUESTS: { - ASSERT_EQ(1, length % 3); - read(); // displayRequests, ignored for now - for (uint16_t count = 0; count < (length - 1) / 3; ++count) { - read64(); // layer - // silently eat requests to clear the client target, since we won't be testing - // client composition anyway - ASSERT_EQ(1u, read()); - } - } break; - case Command::SET_PRESENT_FENCE: { - ASSERT_EQ(1, length); - close(readFence()); - } break; - case Command::SET_RELEASE_FENCES: { - ASSERT_EQ(0, length % 3); - for (uint16_t count = 0; count < length / 3; ++count) { - read64(); - close(readFence()); - } - } break; - default: - GTEST_FAIL() << "unexpected return command " << std::hex << static_cast(command); - break; - } -} -} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h index 85b4fdce2d..d40e3d2d18 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h @@ -21,7 +21,6 @@ #pragma clang diagnostic ignored "-Wconversion" #include -#include #include #include #include @@ -54,7 +53,7 @@ class TestRenderEngine; class TestLayer { public: TestLayer(const std::shared_ptr& client, int64_t display) - : mComposerClient(client) { + : mDisplay(display), mComposerClient(client) { client->createLayer(display, kBufferSlotCount, &mLayer); } @@ -62,7 +61,7 @@ class TestLayer { // call destroyLayers here virtual ~TestLayer(){}; - virtual void write(const std::shared_ptr& writer); + virtual void write(CommandWriterBase& writer); virtual LayerSettings toRenderEngineLayerSettings(); void setDisplayFrame(Rect frame) { mDisplayFrame = frame; } @@ -83,7 +82,10 @@ class TestLayer { float getAlpha() const { return mAlpha; } + int64_t getLayer() const { return mLayer; } + protected: + int64_t mDisplay; int64_t mLayer; Rect mDisplayFrame = {0, 0, 0, 0}; std::vector mSurfaceDamage; @@ -103,7 +105,7 @@ class TestColorLayer : public TestLayer { TestColorLayer(const std::shared_ptr& client, int64_t display) : TestLayer{client, display} {} - void write(const std::shared_ptr& writer) override; + void write(CommandWriterBase& writer) override; LayerSettings toRenderEngineLayerSettings() override; @@ -121,7 +123,7 @@ class TestBufferLayer : public TestLayer { uint32_t height, common::PixelFormat format, Composition composition = Composition::DEVICE); - void write(const std::shared_ptr& writer) override; + void write(CommandWriterBase& writer) override; LayerSettings toRenderEngineLayerSettings() override; @@ -129,9 +131,9 @@ class TestBufferLayer : public TestLayer { void setBuffer(std::vector colors); - void setDataspace(Dataspace dataspace, const std::shared_ptr& writer); + void setDataspace(Dataspace dataspace, CommandWriterBase& writer); - void setToClientComposition(const std::shared_ptr& writer); + void setToClientComposition(CommandWriterBase& writer); uint32_t getWidth() const { return mWidth; } @@ -211,4 +213,4 @@ class ReadbackBuffer { native_handle_t mBufferHandle; }; -} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file +} // namespace aidl::android::hardware::graphics::composer3::vts diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h index eaff6d7851..2798e092a0 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h @@ -68,4 +68,4 @@ class TestRenderEngine { DisplaySettings mDisplaySettings; }; -} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file +} // namespace aidl::android::hardware::graphics::composer3::vts diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/TestCommandReader.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/TestCommandReader.h deleted file mode 100644 index 852a56ec47..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/TestCommandReader.h +++ /dev/null @@ -1,41 +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 - -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wconversion" - -#include - -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic pop // ignored "-Wconversion - -namespace aidl::android::hardware::graphics::composer3::vts { - -class TestCommandReader : public CommandReaderBase { - public: - virtual ~TestCommandReader() = default; - - std::vector> mErrors; - std::vector> mCompositionChanges; - - // Parse all commands in the return command queue. Call GTEST_FAIL() for - // unexpected errors or commands. - void parse(); - virtual void parseSingleCommand(int32_t commandRaw, uint16_t length); -}; -} // namespace aidl::android::hardware::graphics::composer3::vts diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h index d02cf9cf78..bdf97ca6e9 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h @@ -19,15 +19,16 @@ #include #include #include +#include +#include #include #include #include -#include +#include #include #include -#include #include #include #include @@ -36,39 +37,29 @@ #include #include +#include +#include + #include #include #include #include -#include #include #include #include +using aidl::android::hardware::graphics::common::BlendMode; using aidl::android::hardware::graphics::common::ColorTransform; using aidl::android::hardware::graphics::common::Dataspace; using aidl::android::hardware::graphics::common::FRect; using aidl::android::hardware::graphics::common::Rect; using aidl::android::hardware::graphics::common::Transform; -using aidl::android::hardware::graphics::composer3::BlendMode; -using aidl::android::hardware::graphics::composer3::ClientTargetProperty; -using aidl::android::hardware::graphics::composer3::Color; -using aidl::android::hardware::graphics::composer3::Command; -using aidl::android::hardware::graphics::composer3::Composition; -using aidl::android::hardware::graphics::composer3::FloatColor; -using aidl::android::hardware::graphics::composer3::HandleIndex; -using aidl::android::hardware::graphics::composer3::PerFrameMetadata; -using aidl::android::hardware::graphics::composer3::PerFrameMetadataBlob; +using namespace aidl::android::hardware::graphics::composer3; using aidl::android::hardware::common::NativeHandle; -using aidl::android::hardware::common::fmq::SynchronizedReadWrite; -using android::AidlMessageQueue; -using CommandQueueType = AidlMessageQueue; -using aidl::android::hardware::common::fmq::MQDescriptor; -using DescriptorType = MQDescriptor; namespace aidl::android::hardware::graphics::composer3 { @@ -76,820 +67,541 @@ namespace aidl::android::hardware::graphics::composer3 { // units of uint32_t's. class CommandWriterBase { public: - CommandWriterBase(uint32_t initialMaxSize) : mDataMaxSize(initialMaxSize) { - mData = std::make_unique(mDataMaxSize); - reset(); - } + CommandWriterBase() { reset(); } virtual ~CommandWriterBase() { reset(); } void reset() { - mDataWritten = 0; - mCommandEnd = 0; - - // handles in mDataHandles are owned by the caller - mDataHandles.clear(); - - // handles in mTemporaryHandles are owned by the writer - for (auto handle : mTemporaryHandles) { - native_handle_close(handle); - native_handle_delete(handle); - } - mTemporaryHandles.clear(); + mDisplayCommand.reset(); + mLayerCommand.reset(); + mCommands.clear(); + mCommandsResults.clear(); } - Command getCommand(uint32_t offset) { - uint32_t val = (offset < mDataWritten) ? mData[offset] : 0; - return static_cast(val & static_cast(Command::OPCODE_MASK)); + void setError(int32_t index, int32_t errorCode) { + command::Error error; + error.commandIndex = index; + error.errorCode = errorCode; + mCommandsResults.emplace_back(std::move(error)); } - bool writeQueue(bool* outQueueChanged, int32_t* outCommandLength, - std::vector* outCommandHandles) { - if (mDataWritten == 0) { - *outQueueChanged = false; - *outCommandLength = 0; - outCommandHandles->clear(); - return true; - } - - // After data are written to the queue, it may not be read by the - // remote reader when - // - // - the writer does not send them (because of other errors) - // - the hwbinder transaction fails - // - the reader does not read them (because of other errors) - // - // Discard the stale data here. - size_t staleDataSize = mQueue ? mQueue->availableToRead() : 0; - if (staleDataSize > 0) { - ALOGW("discarding stale data from message queue"); - CommandQueueType::MemTransaction tx; - if (mQueue->beginRead(staleDataSize, &tx)) { - mQueue->commitRead(staleDataSize); - } - } - - // write data to queue, optionally resizing it - if (mQueue && (mDataMaxSize <= mQueue->getQuantumCount())) { - if (!mQueue->write(mData.get(), mDataWritten)) { - ALOGE("failed to write commands to message queue"); - return false; - } + void setPresentOrValidateResult(int64_t display, command::PresentOrValidate::Result result) { + command::PresentOrValidate presentOrValidate; + presentOrValidate.display = display; + presentOrValidate.result = result; + mCommandsResults.emplace_back(std::move(presentOrValidate)); + } - *outQueueChanged = false; + void setChangedCompositionTypes(int64_t display, const std::vector& layers, + const std::vector& types) { + command::ChangedCompositionTypes changedCompositionTypes; + changedCompositionTypes.display = display; + changedCompositionTypes.layers.reserve(layers.size()); + for (int i = 0; i < layers.size(); i++) { + auto layer = command::ChangedCompositionTypes::Layer{.layer = layers[i], + .composition = types[i]}; + changedCompositionTypes.layers.emplace_back(std::move(layer)); + } + mCommandsResults.emplace_back(std::move(changedCompositionTypes)); + } + + void setDisplayRequests(int64_t display, int32_t displayRequestMask, + const std::vector& layers, + const std::vector& layerRequestMasks) { + command::DisplayRequest displayRequest; + displayRequest.display = display; + displayRequest.mask = displayRequestMask; + displayRequest.layerRequests.reserve(layers.size()); + for (int i = 0; i < layers.size(); i++) { + auto layerRequest = command::DisplayRequest::LayerRequest{.layer = layers[i], + .mask = layerRequestMasks[i]}; + displayRequest.layerRequests.emplace_back(std::move(layerRequest)); + } + mCommandsResults.emplace_back(std::move(displayRequest)); + } + + void setPresentFence(int64_t display, ::ndk::ScopedFileDescriptor presentFence) { + if (presentFence.get() >= 0) { + command::PresentFence presentFenceCommand; + presentFenceCommand.fence = std::move(presentFence); + presentFenceCommand.display = display; + mCommandsResults.emplace_back(std::move(presentFenceCommand)); } else { - auto newQueue = std::make_unique(mDataMaxSize); - if (!newQueue->isValid() || !newQueue->write(mData.get(), mDataWritten)) { - ALOGE("failed to prepare a new message queue "); - return false; - } - - mQueue = std::move(newQueue); - *outQueueChanged = true; + ALOGW("%s: invalid present fence %d", __func__, presentFence.get()); } - - *outCommandLength = mDataWritten; - *outCommandHandles = std::move(mDataHandles); - - return true; } - DescriptorType getMQDescriptor() const { - return (mQueue) ? mQueue->dupeDesc() : DescriptorType{}; + void setReleaseFences(int64_t display, const std::vector& layers, + std::vector<::ndk::ScopedFileDescriptor> releaseFences) { + command::ReleaseFences releaseFencesCommand; + releaseFencesCommand.display = display; + for (int i = 0; i < layers.size(); i++) { + if (releaseFences[i].get() >= 0) { + command::ReleaseFences::Layer layer; + layer.layer = layers[i]; + layer.fence = std::move(releaseFences[i]); + releaseFencesCommand.layers.emplace_back(std::move(layer)); + } else { + ALOGW("%s: invalid release fence %d", __func__, releaseFences[i].get()); + } + } + mCommandsResults.emplace_back(std::move(releaseFencesCommand)); } - static constexpr uint16_t kSelectDisplayLength = 2; - void selectDisplay(int64_t display) { - beginCommand(Command::SELECT_DISPLAY, kSelectDisplayLength); - write64(display); - endCommand(); + void setClientTargetProperty(int64_t display, const ClientTargetProperty& clientTargetProperty, + float whitePointNits) { + command::ClientTargetPropertyWithNits clientTargetPropertyWithNits; + clientTargetPropertyWithNits.display = display; + clientTargetPropertyWithNits.clientTargetProperty = clientTargetProperty; + clientTargetPropertyWithNits.whitePointNits = whitePointNits; + mCommandsResults.emplace_back(std::move(clientTargetPropertyWithNits)); } - static constexpr uint16_t kSelectLayerLength = 2; - void selectLayer(int64_t layer) { - beginCommand(Command::SELECT_LAYER, kSelectLayerLength); - write64(layer); - endCommand(); + void setColorTransform(int64_t display, const float* matrix, ColorTransform hint) { + command::ColorTransformPayload colorTransformPayload; + colorTransformPayload.matrix.assign(matrix, matrix + 16); + colorTransformPayload.hint = hint; + getDisplayCommand(display).colorTransform.emplace(std::move(colorTransformPayload)); } - static constexpr uint16_t kSetErrorLength = 2; - void setError(uint32_t location, int32_t error) { - beginCommand(Command::SET_ERROR, kSetErrorLength); - write(location); - writeSigned(error); - endCommand(); + void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target, + int acquireFence, Dataspace dataspace, const std::vector& damage) { + command::ClientTarget clientTargetCommand; + clientTargetCommand.buffer = getBuffer(slot, target, acquireFence); + clientTargetCommand.dataspace = dataspace; + clientTargetCommand.damage.assign(damage.begin(), damage.end()); + getDisplayCommand(display).clientTarget.emplace(std::move(clientTargetCommand)); } - static constexpr uint32_t kPresentOrValidateDisplayResultLength = 1; - void setPresentOrValidateResult(uint32_t state) { - beginCommand(Command::SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT, - kPresentOrValidateDisplayResultLength); - write(state); - endCommand(); + void setOutputBuffer(int64_t display, uint32_t slot, const native_handle_t* buffer, + int releaseFence) { + getDisplayCommand(display).virtualDisplayOutputBuffer.emplace( + getBuffer(slot, buffer, releaseFence)); } - void setChangedCompositionTypes(const std::vector& layers, - const std::vector& types) { - size_t totalLayers = std::min(layers.size(), types.size()); - size_t currentLayer = 0; - - while (currentLayer < totalLayers) { - size_t count = - std::min(totalLayers - currentLayer, static_cast(kMaxLength) / 3); - - beginCommand(Command::SET_CHANGED_COMPOSITION_TYPES, count * 3); - for (size_t i = 0; i < count; i++) { - write64(layers[currentLayer + i]); - writeSigned(static_cast(types[currentLayer + i])); - } - endCommand(); + void validateDisplay(int64_t display) { getDisplayCommand(display).validateDisplay = true; } - currentLayer += count; - } + void presentOrvalidateDisplay(int64_t display) { + getDisplayCommand(display).presentOrValidateDisplay = true; } - void setDisplayRequests(uint32_t displayRequestMask, const std::vector& layers, - const std::vector& layerRequestMasks) { - size_t totalLayers = std::min(layers.size(), layerRequestMasks.size()); - size_t currentLayer = 0; - - while (currentLayer < totalLayers) { - size_t count = - std::min(totalLayers - currentLayer, static_cast(kMaxLength - 1) / 3); + void acceptDisplayChanges(int64_t display) { + getDisplayCommand(display).acceptDisplayChanges = true; + } - beginCommand(Command::SET_DISPLAY_REQUESTS, 1 + count * 3); - write(displayRequestMask); - for (size_t i = 0; i < count; i++) { - write64(layers[currentLayer + i]); - write(static_cast(layerRequestMasks[currentLayer + i])); - } - endCommand(); + void presentDisplay(int64_t display) { getDisplayCommand(display).presentDisplay = true; } - currentLayer += count; - } + void setLayerCursorPosition(int64_t display, int64_t layer, int32_t x, int32_t y) { + common::Point cursorPosition; + cursorPosition.x = x; + cursorPosition.y = y; + getLayerCommand(display, layer).cursorPosition.emplace(std::move(cursorPosition)); } - static constexpr uint16_t kSetPresentFenceLength = 1; - void setPresentFence(int presentFence) { - beginCommand(Command::SET_PRESENT_FENCE, kSetPresentFenceLength); - writeFence(presentFence); - endCommand(); + void setLayerBuffer(int64_t display, int64_t layer, uint32_t slot, + const native_handle_t* buffer, int acquireFence) { + getLayerCommand(display, layer).buffer = getBuffer(slot, buffer, acquireFence); } - void setReleaseFences(const std::vector& layers, - const std::vector& releaseFences) { - size_t totalLayers = std::min(layers.size(), releaseFences.size()); - size_t currentLayer = 0; - - while (currentLayer < totalLayers) { - size_t count = - std::min(totalLayers - currentLayer, static_cast(kMaxLength) / 3); - - beginCommand(Command::SET_RELEASE_FENCES, count * 3); - for (size_t i = 0; i < count; i++) { - write64(layers[currentLayer + i]); - writeFence(releaseFences[currentLayer + i]); - } - endCommand(); - - currentLayer += count; - } + void setLayerSurfaceDamage(int64_t display, int64_t layer, const std::vector& damage) { + getLayerCommand(display, layer).damage.emplace(damage.begin(), damage.end()); } - static constexpr uint16_t kSetColorTransformLength = 17; - void setColorTransform(const float* matrix, ColorTransform hint) { - beginCommand(Command::SET_COLOR_TRANSFORM, kSetColorTransformLength); - for (int i = 0; i < 16; i++) { - writeFloat(matrix[i]); - } - writeSigned(static_cast(hint)); - endCommand(); + void setLayerBlendMode(int64_t display, int64_t layer, BlendMode mode) { + command::ParcelableBlendMode parcelableBlendMode; + parcelableBlendMode.blendMode = mode; + getLayerCommand(display, layer).blendMode.emplace(std::move(parcelableBlendMode)); } - void setClientTarget(uint32_t slot, const native_handle_t* target, int acquireFence, - Dataspace dataspace, const std::vector& damage) { - setClientTargetInternal(slot, target, acquireFence, static_cast(dataspace), - damage); + void setLayerColor(int64_t display, int64_t layer, Color color) { + getLayerCommand(display, layer).color.emplace(std::move(color)); } - static constexpr uint16_t kSetOutputBufferLength = 3; - void setOutputBuffer(uint32_t slot, const native_handle_t* buffer, int releaseFence) { - beginCommand(Command::SET_OUTPUT_BUFFER, kSetOutputBufferLength); - write(slot); - writeHandle(buffer, true); - writeFence(releaseFence); - endCommand(); + void setLayerCompositionType(int64_t display, int64_t layer, Composition type) { + command::ParcelableComposition compositionPayload; + compositionPayload.composition = type; + getLayerCommand(display, layer).composition.emplace(std::move(compositionPayload)); } - static constexpr uint16_t kValidateDisplayLength = 0; - void validateDisplay() { - beginCommand(Command::VALIDATE_DISPLAY, kValidateDisplayLength); - endCommand(); + void setLayerDataspace(int64_t display, int64_t layer, Dataspace dataspace) { + command::ParcelableDataspace dataspacePayload; + dataspacePayload.dataspace = dataspace; + getLayerCommand(display, layer).dataspace.emplace(std::move(dataspacePayload)); } - static constexpr uint16_t kPresentOrValidateDisplayLength = 0; - void presentOrvalidateDisplay() { - beginCommand(Command::PRESENT_OR_VALIDATE_DISPLAY, kPresentOrValidateDisplayLength); - endCommand(); + void setLayerDisplayFrame(int64_t display, int64_t layer, const Rect& frame) { + getLayerCommand(display, layer).displayFrame.emplace(frame); } - static constexpr uint16_t kAcceptDisplayChangesLength = 0; - void acceptDisplayChanges() { - beginCommand(Command::ACCEPT_DISPLAY_CHANGES, kAcceptDisplayChangesLength); - endCommand(); + void setLayerPlaneAlpha(int64_t display, int64_t layer, float alpha) { + command::PlaneAlpha planeAlpha; + planeAlpha.alpha = alpha; + getLayerCommand(display, layer).planeAlpha.emplace(std::move(planeAlpha)); } - static constexpr uint16_t kPresentDisplayLength = 0; - void presentDisplay() { - beginCommand(Command::PRESENT_DISPLAY, kPresentDisplayLength); - endCommand(); + void setLayerSidebandStream(int64_t display, int64_t layer, const native_handle_t* stream) { + NativeHandle handle; + if (stream) handle = ::android::dupToAidl(stream); + getLayerCommand(display, layer).sidebandStream.emplace(std::move(handle)); } - static constexpr uint16_t kSetLayerCursorPositionLength = 2; - void setLayerCursorPosition(int32_t x, int32_t y) { - beginCommand(Command::SET_LAYER_CURSOR_POSITION, kSetLayerCursorPositionLength); - writeSigned(x); - writeSigned(y); - endCommand(); + void setLayerSourceCrop(int64_t display, int64_t layer, const FRect& crop) { + getLayerCommand(display, layer).sourceCrop.emplace(crop); } - static constexpr uint16_t kSetLayerBufferLength = 3; - void setLayerBuffer(uint32_t slot, const native_handle_t* buffer, int acquireFence) { - beginCommand(Command::SET_LAYER_BUFFER, kSetLayerBufferLength); - write(slot); - writeHandle(buffer, true); - writeFence(acquireFence); - endCommand(); + void setLayerTransform(int64_t display, int64_t layer, Transform transform) { + command::ParcelableTransform transformPayload; + transformPayload.transform = transform; + getLayerCommand(display, layer).transform.emplace(std::move(transformPayload)); } - void setLayerSurfaceDamage(const std::vector& damage) { - bool doWrite = (damage.size() <= kMaxLength / 4); - size_t length = (doWrite) ? damage.size() * 4 : 0; - - beginCommand(Command::SET_LAYER_SURFACE_DAMAGE, length); - // When there are too many rectangles in the damage region and doWrite - // is false, we write no rectangle at all which means the entire - // layer is damaged. - if (doWrite) { - writeRegion(damage); - } - endCommand(); + void setLayerVisibleRegion(int64_t display, int64_t layer, const std::vector& visible) { + getLayerCommand(display, layer).visibleRegion.emplace(visible.begin(), visible.end()); } - static constexpr uint16_t kSetLayerBlendModeLength = 1; - void setLayerBlendMode(BlendMode mode) { - beginCommand(Command::SET_LAYER_BLEND_MODE, kSetLayerBlendModeLength); - writeSigned(static_cast(mode)); - endCommand(); + void setLayerZOrder(int64_t display, int64_t layer, uint32_t z) { + command::ZOrder zorder; + zorder.z = z; + getLayerCommand(display, layer).z.emplace(std::move(zorder)); } - static constexpr uint16_t kSetLayerColorLength = 1; - void setLayerColor(Color color) { - beginCommand(Command::SET_LAYER_COLOR, kSetLayerColorLength); - writeColor(color); - endCommand(); + void setLayerPerFrameMetadata(int64_t display, int64_t layer, + const std::vector& metadataVec) { + getLayerCommand(display, layer) + .perFrameMetadata.emplace(metadataVec.begin(), metadataVec.end()); } - static constexpr uint16_t kSetLayerCompositionTypeLength = 1; - void setLayerCompositionType(Composition type) { - beginCommand(Command::SET_LAYER_COMPOSITION_TYPE, kSetLayerCompositionTypeLength); - writeSigned(static_cast(type)); - endCommand(); + void setLayerColorTransform(int64_t display, int64_t layer, const float* matrix) { + getLayerCommand(display, layer).colorTransform.emplace(matrix, matrix + 16); } - static constexpr uint16_t kSetLayerDataspaceLength = 1; - void setLayerDataspace(Dataspace dataspace) { - setLayerDataspaceInternal(static_cast(dataspace)); + void setLayerPerFrameMetadataBlobs(int64_t display, int64_t layer, + const std::vector& metadata) { + getLayerCommand(display, layer) + .perFrameMetadataBlob.emplace(metadata.begin(), metadata.end()); } - static constexpr uint16_t kSetLayerDisplayFrameLength = 4; - void setLayerDisplayFrame(const Rect& frame) { - beginCommand(Command::SET_LAYER_DISPLAY_FRAME, kSetLayerDisplayFrameLength); - writeRect(frame); - endCommand(); + void setLayerFloatColor(int64_t display, int64_t layer, FloatColor color) { + getLayerCommand(display, layer).floatColor.emplace(color); } - static constexpr uint16_t kSetLayerPlaneAlphaLength = 1; - void setLayerPlaneAlpha(float alpha) { - beginCommand(Command::SET_LAYER_PLANE_ALPHA, kSetLayerPlaneAlphaLength); - writeFloat(alpha); - endCommand(); + void setLayerGenericMetadata(int64_t display, int64_t layer, const std::string& key, + const bool mandatory, const std::vector& value) { + command::GenericMetadata metadata; + metadata.key.name = key; + metadata.key.mandatory = mandatory; + metadata.value.assign(value.begin(), value.end()); + getLayerCommand(display, layer).genericMetadata.emplace(std::move(metadata)); } - static constexpr uint16_t kSetLayerSidebandStreamLength = 1; - void setLayerSidebandStream(const native_handle_t* stream) { - beginCommand(Command::SET_LAYER_SIDEBAND_STREAM, kSetLayerSidebandStreamLength); - writeHandle(stream); - endCommand(); + const std::vector& getPendingCommands() { + if (mLayerCommand.has_value()) { + mCommands.emplace_back(std::move(*mLayerCommand)); + mLayerCommand.reset(); + } + if (mDisplayCommand.has_value()) { + mCommands.emplace_back(std::move(*mDisplayCommand)); + mDisplayCommand.reset(); + } + return mCommands; } - - static constexpr uint16_t kSetLayerSourceCropLength = 4; - void setLayerSourceCrop(const FRect& crop) { - beginCommand(Command::SET_LAYER_SOURCE_CROP, kSetLayerSourceCropLength); - writeFRect(crop); - endCommand(); + std::vector getPendingCommandResults() { + return std::move(mCommandsResults); } - static constexpr uint16_t kSetLayerTransformLength = 1; - void setLayerTransform(Transform transform) { - beginCommand(Command::SET_LAYER_TRANSFORM, kSetLayerTransformLength); - writeSigned(static_cast(transform)); - endCommand(); + protected: + command::Buffer getBuffer(int slot, const native_handle_t* bufferHandle, int fence) { + command::Buffer bufferCommand; + bufferCommand.slot = slot; + if (bufferHandle) bufferCommand.handle.emplace(::android::dupToAidl(bufferHandle)); + if (fence > 0) bufferCommand.fence = ::ndk::ScopedFileDescriptor(fence); + return bufferCommand; } - void setLayerVisibleRegion(const std::vector& visible) { - bool doWrite = (visible.size() <= kMaxLength / 4); - size_t length = (doWrite) ? visible.size() * 4 : 0; - - beginCommand(Command::SET_LAYER_VISIBLE_REGION, length); - // When there are too many rectangles in the visible region and - // doWrite is false, we write no rectangle at all which means the - // entire layer is visible. - if (doWrite) { - writeRegion(visible); - } - endCommand(); - } + std::optional mDisplayCommand; + std::optional mLayerCommand; + std::vector mCommands; + std::vector mCommandsResults; - static constexpr uint16_t kSetLayerZOrderLength = 1; - void setLayerZOrder(uint32_t z) { - beginCommand(Command::SET_LAYER_Z_ORDER, kSetLayerZOrderLength); - write(z); - endCommand(); - } + private: + // std::vector mTemporaryHandles; - void setLayerPerFrameMetadata(const std::vector& metadataVec) { - beginCommand(Command::SET_LAYER_PER_FRAME_METADATA, metadataVec.size() * 2); - for (const auto& metadata : metadataVec) { - writeSigned(static_cast(metadata.key)); - writeFloat(metadata.value); + command::DisplayCommand& getDisplayCommand(int64_t display) { + if (!mDisplayCommand.has_value() || mDisplayCommand->display != display) { + if (mDisplayCommand.has_value()) mCommands.emplace_back(std::move(*mDisplayCommand)); + mDisplayCommand.emplace(); + mDisplayCommand->display = display; + return *mDisplayCommand; } - endCommand(); + return *mDisplayCommand; } - static constexpr uint16_t kSetLayerColorTransformLength = 16; - void setLayerColorTransform(const float* matrix) { - beginCommand(Command::SET_LAYER_COLOR_TRANSFORM, kSetLayerColorTransformLength); - for (int i = 0; i < 16; i++) { - writeFloat(matrix[i]); + command::LayerCommand& getLayerCommand(int64_t display, int64_t layer) { + if (!mLayerCommand.has_value() || mLayerCommand->display != display || + mLayerCommand->layer != layer) { + if (mLayerCommand.has_value()) mCommands.emplace_back(std::move(*mLayerCommand)); + mLayerCommand.emplace(); + mLayerCommand->display = display; + mLayerCommand->layer = layer; + return *mLayerCommand; } - endCommand(); + return *mLayerCommand; } +}; - void setLayerPerFrameMetadataBlobs(const std::vector& metadata) { - // in units of uint32_t's - size_t commandLength = 0; - - if (metadata.size() > std::numeric_limits::max()) { - LOG_FATAL("too many metadata blobs - dynamic metadata size is too large"); - return; +class CommandReaderBase { + public: + ~CommandReaderBase() { resetData(); } + + // Parse and execute commands from the command queue. The commands are + // actually return values from the server and will be saved in ReturnData. + void parse(const std::vector& results) { + resetData(); + + for (const auto& result : results) { + switch (result.getTag()) { + case command::CommandResultPayload::Tag::error: + parseSetError(result.get()); + break; + case command::CommandResultPayload::Tag::changedCompositionType: + parseSetChangedCompositionTypes( + result.get< + command::CommandResultPayload::Tag::changedCompositionType>()); + break; + case command::CommandResultPayload::Tag::displayRequest: + parseSetDisplayRequests( + result.get()); + break; + case command::CommandResultPayload::Tag::presentFence: + parseSetPresentFence( + result.get()); + break; + case command::CommandResultPayload::Tag::releaseFences: + parseSetReleaseFences( + result.get()); + break; + case command::CommandResultPayload::Tag::presentOrValidateResult: + parseSetPresentOrValidateDisplayResult( + result.get< + command::CommandResultPayload::Tag::presentOrValidateResult>()); + break; + case command::CommandResultPayload::Tag::clientTargetProperty: + parseSetClientTargetProperty( + result.get()); + break; + } } + } - // space for numElements - commandLength += 1; - - for (auto metadataBlob : metadata) { - commandLength += 1; // key of metadata blob - commandLength += 1; // size information of metadata blob - - // metadata content size - size_t metadataSize = metadataBlob.blob.size() / sizeof(uint32_t); - commandLength += metadataSize; - commandLength += - (metadataBlob.blob.size() - (metadataSize * sizeof(uint32_t)) > 0) ? 1 : 0; - } + std::vector takeErrors() { return std::move(mErrors); } - if (commandLength > std::numeric_limits::max()) { - LOG_FATAL("dynamic metadata size is too large"); - return; + bool hasChanges(int64_t display, uint32_t* outNumChangedCompositionTypes, + uint32_t* outNumLayerRequestMasks) const { + auto found = mReturnData.find(display); + if (found == mReturnData.end()) { + *outNumChangedCompositionTypes = 0; + *outNumLayerRequestMasks = 0; + return false; } - // Blobs are written as: - // {numElements, key1, size1, blob1, key2, size2, blob2, key3, size3...} - uint16_t length = static_cast(commandLength); - beginCommand(Command::SET_LAYER_PER_FRAME_METADATA_BLOBS, length); - write(static_cast(metadata.size())); - for (auto metadataBlob : metadata) { - writeSigned(static_cast(metadataBlob.key)); - write(static_cast(metadataBlob.blob.size())); - writeBlob(static_cast(metadataBlob.blob.size()), metadataBlob.blob.data()); - } - endCommand(); - } + const ReturnData& data = found->second; - static constexpr uint16_t kSetLayerFloatColorLength = 4; - void setLayerFloatColor(FloatColor color) { - beginCommand(Command::SET_LAYER_FLOAT_COLOR, kSetLayerFloatColorLength); - writeFloatColor(color); - endCommand(); - } + *outNumChangedCompositionTypes = static_cast(data.compositionTypes.size()); + *outNumLayerRequestMasks = static_cast(data.requestMasks.size()); - static constexpr uint16_t kSetClientTargetPropertyLength = 2; - void setClientTargetProperty(const ClientTargetProperty& clientTargetProperty) { - beginCommand(Command::SET_CLIENT_TARGET_PROPERTY, kSetClientTargetPropertyLength); - writeSigned(static_cast(clientTargetProperty.pixelFormat)); - writeSigned(static_cast(clientTargetProperty.dataspace)); - endCommand(); + return !(data.compositionTypes.empty() && data.requestMasks.empty()); } - void setLayerGenericMetadata(const std::string& key, const bool mandatory, - const std::vector& value) { - const size_t commandSize = 3 + sizeToElements(key.size()) + sizeToElements(value.size()); - if (commandSize > std::numeric_limits::max()) { - LOG_FATAL("Too much generic metadata (%zu elements)", commandSize); + // Get and clear saved changed composition types. + void takeChangedCompositionTypes(int64_t display, std::vector* outLayers, + std::vector* outTypes) { + auto found = mReturnData.find(display); + if (found == mReturnData.end()) { + outLayers->clear(); + outTypes->clear(); return; } - beginCommand(Command::SET_LAYER_GENERIC_METADATA, static_cast(commandSize)); - write(key.size()); - writeBlob(key.size(), reinterpret_cast(key.c_str())); - write(mandatory); - write(value.size()); - writeBlob(value.size(), value.data()); - endCommand(); - } - - protected: - template - void beginCommand(T command, uint16_t length) { - beginCommandBase(static_cast(command), length); - } - - void setClientTargetInternal(uint32_t slot, const native_handle_t* target, int acquireFence, - int32_t dataspace, const std::vector& damage) { - bool doWrite = (damage.size() <= (kMaxLength - 4) / 4); - size_t length = 4 + ((doWrite) ? damage.size() * 4 : 0); - - beginCommand(Command::SET_CLIENT_TARGET, length); - write(slot); - writeHandle(target, true); - writeFence(acquireFence); - writeSigned(dataspace); - // When there are too many rectangles in the damage region and doWrite - // is false, we write no rectangle at all which means the entire - // client target is damaged. - if (doWrite) { - writeRegion(damage); - } - endCommand(); - } + ReturnData& data = found->second; - void setLayerDataspaceInternal(int32_t dataspace) { - beginCommand(Command::SET_LAYER_DATASPACE, kSetLayerDataspaceLength); - writeSigned(dataspace); - endCommand(); + *outLayers = std::move(data.changedLayers); + *outTypes = std::move(data.compositionTypes); } - void beginCommandBase(Command command, uint16_t length) { - if (mCommandEnd) { - LOG_FATAL("endCommand was not called before command 0x%x", command); + // Get and clear saved display requests. + void takeDisplayRequests(int64_t display, uint32_t* outDisplayRequestMask, + std::vector* outLayers, + std::vector* outLayerRequestMasks) { + auto found = mReturnData.find(display); + if (found == mReturnData.end()) { + *outDisplayRequestMask = 0; + outLayers->clear(); + outLayerRequestMasks->clear(); + return; } - growData(1 + length); - write(static_cast(command) | length); + ReturnData& data = found->second; - mCommandEnd = mDataWritten + length; + *outDisplayRequestMask = data.displayRequests; + *outLayers = std::move(data.requestedLayers); + *outLayerRequestMasks = std::move(data.requestMasks); } - void endCommand() { - if (!mCommandEnd) { - LOG_FATAL("beginCommand was not called"); - } else if (mDataWritten > mCommandEnd) { - LOG_FATAL("too much data written"); - mDataWritten = mCommandEnd; - } else if (mDataWritten < mCommandEnd) { - LOG_FATAL("too little data written"); - while (mDataWritten < mCommandEnd) { - write(0); - } + // Get and clear saved release fences. + void takeReleaseFences(int64_t display, std::vector* outLayers, + std::vector* outReleaseFences) { + auto found = mReturnData.find(display); + if (found == mReturnData.end()) { + outLayers->clear(); + outReleaseFences->clear(); + return; } - mCommandEnd = 0; - } - - void write(uint32_t val) { mData[mDataWritten++] = val; } - - void writeSigned(int32_t val) { memcpy(&mData[mDataWritten++], &val, sizeof(val)); } - - void writeFloat(float val) { memcpy(&mData[mDataWritten++], &val, sizeof(val)); } - - void write64(uint64_t val) { - uint32_t lo = static_cast(val & 0xffffffff); - uint32_t hi = static_cast(val >> 32); - write(lo); - write(hi); - } + ReturnData& data = found->second; - void writeRect(const Rect& rect) { - writeSigned(rect.left); - writeSigned(rect.top); - writeSigned(rect.right); - writeSigned(rect.bottom); + *outLayers = std::move(data.releasedLayers); + *outReleaseFences = std::move(data.releaseFences); } - void writeRegion(const std::vector& region) { - for (const auto& rect : region) { - writeRect(rect); + // Get and clear saved present fence. + void takePresentFence(int64_t display, int* outPresentFence) { + auto found = mReturnData.find(display); + if (found == mReturnData.end()) { + *outPresentFence = -1; + return; } - } - - void writeFRect(const FRect& rect) { - writeFloat(rect.left); - writeFloat(rect.top); - writeFloat(rect.right); - writeFloat(rect.bottom); - } - void writeColor(const Color& color) { - write((color.r << 0) | (color.g << 8) | (color.b << 16) | (color.a << 24)); - } - - void writeFloatColor(const FloatColor& color) { - writeFloat(color.r); - writeFloat(color.g); - writeFloat(color.b); - writeFloat(color.a); - } + ReturnData& data = found->second; - void writeBlob(uint32_t length, const unsigned char* blob) { - memcpy(&mData[mDataWritten], blob, length); - uint32_t numElements = length / 4; - mDataWritten += numElements; - mDataWritten += (length - (numElements * 4) > 0) ? 1 : 0; + *outPresentFence = data.presentFence; + data.presentFence = -1; } - // ownership of handle is not transferred - void writeHandle(const native_handle_t* handle, bool useCache) { - if (!handle) { - writeSigned( - static_cast((useCache) ? HandleIndex::CACHED : HandleIndex::EMPTY)); + // Get what stage succeeded during PresentOrValidate: Present or Validate + void takePresentOrValidateStage(int64_t display, uint32_t* state) { + auto found = mReturnData.find(display); + if (found == mReturnData.end()) { + *state = static_cast(-1); return; } - - mDataHandles.push_back(::android::dupToAidl(handle)); - writeSigned(mDataHandles.size() - 1); + ReturnData& data = found->second; + *state = data.presentOrValidateState; } - void writeHandle(const native_handle_t* handle) { writeHandle(handle, false); } + // Get the client target properties requested by hardware composer. + void takeClientTargetProperty(int64_t display, ClientTargetProperty* outClientTargetProperty) { + auto found = mReturnData.find(display); - // ownership of fence is transferred - void writeFence(int fence) { - native_handle_t* handle = nullptr; - if (fence >= 0) { - handle = getTemporaryHandle(1, 0); - if (handle) { - handle->data[0] = fence; - } else { - ALOGW("failed to get temporary handle for fence %d", fence); - sync_wait(fence, -1); - close(fence); - } + // If not found, return the default values. + if (found == mReturnData.end()) { + outClientTargetProperty->pixelFormat = common::PixelFormat::RGBA_8888; + outClientTargetProperty->dataspace = Dataspace::UNKNOWN; + return; } - writeHandle(handle); - } - - native_handle_t* getTemporaryHandle(int numFds, int numInts) { - native_handle_t* handle = native_handle_create(numFds, numInts); - if (handle) { - mTemporaryHandles.push_back(handle); - } - return handle; + ReturnData& data = found->second; + *outClientTargetProperty = data.clientTargetProperty; } - static constexpr uint16_t kMaxLength = std::numeric_limits::max(); - - std::unique_ptr mData; - uint32_t mDataWritten; - private: - void growData(uint32_t grow) { - uint32_t newWritten = mDataWritten + grow; - if (newWritten < mDataWritten) { - LOG_ALWAYS_FATAL("buffer overflowed; data written %" PRIu32 ", growing by %" PRIu32, - mDataWritten, grow); - } + void resetData() { + mErrors.clear(); - if (newWritten <= mDataMaxSize) { - return; - } - - uint32_t newMaxSize = mDataMaxSize << 1; - if (newMaxSize < newWritten) { - newMaxSize = newWritten; + for (auto& data : mReturnData) { + if (data.second.presentFence >= 0) { + close(data.second.presentFence); + } + for (auto fence : data.second.releaseFences) { + if (fence >= 0) { + close(fence); + } + } } - auto newData = std::make_unique(newMaxSize); - std::copy_n(mData.get(), mDataWritten, newData.get()); - mDataMaxSize = newMaxSize; - mData = std::move(newData); + mReturnData.clear(); } - uint32_t sizeToElements(uint32_t size) { return (size + 3) / 4; } - - uint32_t mDataMaxSize; - // end offset of the current command - uint32_t mCommandEnd; - - std::vector mDataHandles; - std::vector mTemporaryHandles; - - std::unique_ptr mQueue; -}; + void parseSetError(const command::Error& error) { mErrors.emplace_back(error); } -// This class helps parse a command queue. Note that all sizes/lengths are in -// units of uint32_t's. -class CommandReaderBase { - public: - CommandReaderBase() : mDataMaxSize(0) { reset(); } + void parseSetChangedCompositionTypes( + const command::ChangedCompositionTypes& changedCompositionTypes) { + auto& data = mReturnData[changedCompositionTypes.display]; - bool setMQDescriptor(const DescriptorType& descriptor) { - mQueue = std::make_unique(descriptor, false); - if (mQueue->isValid()) { - return true; - } else { - mQueue = nullptr; - return false; + data.changedLayers.reserve(changedCompositionTypes.layers.size()); + data.compositionTypes.reserve(changedCompositionTypes.layers.size()); + for (const auto& layer : changedCompositionTypes.layers) { + data.changedLayers.push_back(layer.layer); + data.compositionTypes.push_back(layer.composition); } } - bool readQueue(int32_t commandLength, std::vector commandHandles) { - if (!mQueue) { - return false; - } - - auto quantumCount = mQueue->getQuantumCount(); - if (mDataMaxSize < quantumCount) { - mDataMaxSize = quantumCount; - mData = std::make_unique(mDataMaxSize); - } + void parseSetDisplayRequests(const command::DisplayRequest& displayRequest) { + auto& data = mReturnData[displayRequest.display]; - if (commandLength > mDataMaxSize || !mQueue->read(mData.get(), commandLength)) { - ALOGE("failed to read commands from message queue"); - return false; + data.displayRequests = displayRequest.mask; + data.requestedLayers.reserve(displayRequest.layerRequests.size()); + data.requestMasks.reserve(displayRequest.layerRequests.size()); + for (const auto& layerRequest : displayRequest.layerRequests) { + data.requestedLayers.push_back(layerRequest.layer); + data.requestMasks.push_back(layerRequest.mask); } - - mDataSize = commandLength; - mDataRead = 0; - mCommandBegin = 0; - mCommandEnd = 0; - mDataHandles = std::move(commandHandles); - return true; - } - - void reset() { - mDataSize = 0; - mDataRead = 0; - mCommandBegin = 0; - mCommandEnd = 0; - mDataHandles.clear(); } - protected: - template - bool beginCommand(T* outCommand, uint16_t* outLength) { - return beginCommandBase(reinterpret_cast(outCommand), outLength); - } - - bool isEmpty() const { return (mDataRead >= mDataSize); } - - bool beginCommandBase(Command* outCommand, uint16_t* outLength) { - if (mCommandEnd) { - LOG_FATAL("endCommand was not called for last command"); + void parseSetPresentFence(const command::PresentFence& presentFence) { + auto& data = mReturnData[presentFence.display]; + if (data.presentFence >= 0) { + close(data.presentFence); } - - constexpr uint32_t opcode_mask = static_cast(Command::OPCODE_MASK); - constexpr uint32_t length_mask = static_cast(Command::LENGTH_MASK); - - uint32_t val = read(); - *outCommand = static_cast(val & opcode_mask); - *outLength = static_cast(val & length_mask); - - if (mDataRead + *outLength > mDataSize) { - ALOGE("command 0x%x has invalid command length %" PRIu16, *outCommand, *outLength); - // undo the read() above - mDataRead--; - return false; - } - - mCommandEnd = mDataRead + *outLength; - - return true; + data.presentFence = dup(presentFence.fence.get()); } - void endCommand() { - if (!mCommandEnd) { - LOG_FATAL("beginCommand was not called"); - } else if (mDataRead > mCommandEnd) { - LOG_FATAL("too much data read"); - mDataRead = mCommandEnd; - } else if (mDataRead < mCommandEnd) { - LOG_FATAL("too little data read"); - mDataRead = mCommandEnd; + void parseSetReleaseFences(const command::ReleaseFences& releaseFences) { + auto& data = mReturnData[releaseFences.display]; + data.releasedLayers.reserve(releaseFences.layers.size()); + data.releaseFences.reserve(releaseFences.layers.size()); + for (const auto& layer : releaseFences.layers) { + data.releasedLayers.push_back(layer.layer); + data.releaseFences.push_back(dup(layer.fence.get())); } - - mCommandBegin = mCommandEnd; - mCommandEnd = 0; } - uint32_t getCommandLoc() const { return mCommandBegin; } - - uint32_t read() { return mData[mDataRead++]; } - - int32_t readSigned() { - int32_t val; - memcpy(&val, &mData[mDataRead++], sizeof(val)); - return val; + void parseSetPresentOrValidateDisplayResult( + const command::PresentOrValidate& presentOrValidate) { + auto& data = mReturnData[presentOrValidate.display]; + data.presentOrValidateState = + presentOrValidate.result == command::PresentOrValidate::Result::Presented ? 1 : 0; } - float readFloat() { - float val; - memcpy(&val, &mData[mDataRead++], sizeof(val)); - return val; + void parseSetClientTargetProperty( + const command::ClientTargetPropertyWithNits& clientTargetProperty) { + auto& data = mReturnData[clientTargetProperty.display]; + data.clientTargetProperty.pixelFormat = + clientTargetProperty.clientTargetProperty.pixelFormat; + data.clientTargetProperty.dataspace = clientTargetProperty.clientTargetProperty.dataspace; } - uint64_t read64() { - uint32_t lo = read(); - uint32_t hi = read(); - return (static_cast(hi) << 32) | lo; - } - - Color readColor() { - uint32_t val = read(); - return Color{ - static_cast((val >> 0) & 0xff), - static_cast((val >> 8) & 0xff), - static_cast((val >> 16) & 0xff), - static_cast((val >> 24) & 0xff), - }; - } - - // ownership of handle is not transferred - const native_handle_t* readHandle(bool* outUseCache) { - const native_handle_t* handle = nullptr; - - int32_t index = readSigned(); - switch (index) { - case static_cast(HandleIndex::EMPTY): - *outUseCache = false; - break; - case static_cast(HandleIndex::CACHED): - *outUseCache = true; - break; - default: - if (static_cast(index) < mDataHandles.size()) { - handle = ::android::makeFromAidl(mDataHandles[index]); - } else { - ALOGE("invalid handle index %zu", static_cast(index)); - } - *outUseCache = false; - break; - } - - return handle; - } + struct ReturnData { + int32_t displayRequests = 0; - const native_handle_t* readHandle() { - bool useCache; - return readHandle(&useCache); - } + std::vector changedLayers; + std::vector compositionTypes; - // ownership of fence is transferred - int readFence() { - auto handle = readHandle(); - if (!handle || handle->numFds == 0) { - return -1; - } + std::vector requestedLayers; + std::vector requestMasks; - if (handle->numFds != 1) { - ALOGE("invalid fence handle with %d fds", handle->numFds); - return -1; - } - - int fd = dup(handle->data[0]); - if (fd < 0) { - ALOGW("failed to dup fence %d", handle->data[0]); - sync_wait(handle->data[0], -1); - fd = -1; - } + int presentFence = -1; - return fd; - } - - std::unique_ptr mData; - uint32_t mDataRead; - - private: - std::unique_ptr mQueue; - uint32_t mDataMaxSize; + std::vector releasedLayers; + std::vector releaseFences; - uint32_t mDataSize; + uint32_t presentOrValidateState; - // begin/end offsets of the current command - uint32_t mCommandBegin; - uint32_t mCommandEnd; + ClientTargetProperty clientTargetProperty{common::PixelFormat::RGBA_8888, + Dataspace::UNKNOWN}; + }; - std::vector mDataHandles; + std::vector mErrors; + std::unordered_map mReturnData; }; } // namespace aidl::android::hardware::graphics::composer3 diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h index c892863d0b..7004955eae 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h @@ -17,25 +17,22 @@ #pragma once #include +#include "aidl/android/hardware/graphics/common/BlendMode.h" #include "aidl/android/hardware/graphics/common/FRect.h" #include "aidl/android/hardware/graphics/common/Rect.h" -#include "aidl/android/hardware/graphics/composer3/BlendMode.h" #include "aidl/android/hardware/graphics/composer3/Capability.h" #include "aidl/android/hardware/graphics/composer3/ClientTargetProperty.h" #include "aidl/android/hardware/graphics/composer3/Color.h" -#include "aidl/android/hardware/graphics/composer3/Command.h" #include "aidl/android/hardware/graphics/composer3/Composition.h" #include "aidl/android/hardware/graphics/composer3/ContentType.h" #include "aidl/android/hardware/graphics/composer3/DisplayAttribute.h" #include "aidl/android/hardware/graphics/composer3/DisplayCapability.h" #include "aidl/android/hardware/graphics/composer3/DisplayConnectionType.h" -#include "aidl/android/hardware/graphics/composer3/DisplayRequest.h" #include "aidl/android/hardware/graphics/composer3/FloatColor.h" #include "aidl/android/hardware/graphics/composer3/FormatColorComponent.h" #include "aidl/android/hardware/graphics/composer3/HandleIndex.h" #include "aidl/android/hardware/graphics/composer3/IComposer.h" #include "aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.h" -#include "aidl/android/hardware/graphics/composer3/LayerRequest.h" #include "aidl/android/hardware/graphics/composer3/PerFrameMetadata.h" #include "aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h" #include "aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.h" -- GitLab From 1586d21f643666124fbcc57334344fa30103aa22 Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Tue, 23 Nov 2021 00:40:56 +0100 Subject: [PATCH 312/825] Add VTS for FilterDelayHint The VTS can be configured by adding timeDelayInMs and dataDelayInBytes attributes to the VTS configuration's filter tags (as long as the filter is not a media filter (media filters do not support FilterDelayHints)). In order to circumvent a FilterDelayHint race condition around configuring the hint (where the internal condition variable is notified when the delay hint changes. If the scheduler thread has not been scheduled to run before adjusting the delay hint, and callbacks are added right after, they are always sent out immediately (as the cv predicate still returns true when it is first evaluated after adjusting the delay)). Test: atest VtsHalTvTunerTargetTest Test: atest android.media.tv.tuner.cts Bug: 183057734 CTS-Coverage-Bug: 209593343 Change-Id: I1b0893afce262b18ee385ec0f384e6ceebf58c7d --- tv/tuner/aidl/vts/functional/FilterTests.cpp | 26 ++-- tv/tuner/aidl/vts/functional/FilterTests.h | 13 +- .../functional/VtsHalTvTunerTargetTest.cpp | 138 ++++++++++++++---- .../vts/functional/VtsHalTvTunerTargetTest.h | 1 + .../config/TunerTestingConfigAidlReaderV1_0.h | 8 + tv/tuner/config/api/current.txt | 4 + .../sample_tuner_vts_config_aidl_V1.xml | 2 +- .../tuner_testing_dynamic_configuration.xsd | 6 + 8 files changed, 158 insertions(+), 40 deletions(-) diff --git a/tv/tuner/aidl/vts/functional/FilterTests.cpp b/tv/tuner/aidl/vts/functional/FilterTests.cpp index a5acdc171d..53afef731a 100644 --- a/tv/tuner/aidl/vts/functional/FilterTests.cpp +++ b/tv/tuner/aidl/vts/functional/FilterTests.cpp @@ -17,6 +17,7 @@ #include "FilterTests.h" #include +#include #include #include @@ -31,23 +32,24 @@ using ::aidl::android::hardware::common::NativeHandle; mPidFilterOutputCount++; mMsgCondition.signal(); - // HACK: we need to cast the const away as DemuxFilterEvent contains a ScopedFileDescriptor - // that cannot be copied. - for (auto&& e : const_cast&>(events)) { - auto it = mFilterEventPromises.find(e.getTag()); - if (it != mFilterEventPromises.cend()) { - it->second.set_value(std::move(e)); - mFilterEventPromises.erase(it); + for (auto it = mFilterCallbackVerifiers.begin(); it != mFilterCallbackVerifiers.end();) { + auto& [verifier, promise] = *it; + if (verifier(events)) { + promise.set_value(); + it = mFilterCallbackVerifiers.erase(it); + } else { + ++it; } - } + }; return ::ndk::ScopedAStatus::ok(); } -std::future FilterCallback::getNextFilterEventWithTag(DemuxFilterEvent::Tag tag) { - // Note: this currently only supports one future per DemuxFilterEvent::Tag. - mFilterEventPromises[tag] = std::promise(); - return mFilterEventPromises[tag].get_future(); +std::future FilterCallback::verifyFilterCallback(FilterCallbackVerifier&& verifier) { + std::promise promise; + auto future = promise.get_future(); + mFilterCallbackVerifiers.emplace_back(std::move(verifier), std::move(promise)); + return future; } void FilterCallback::testFilterDataOutput() { diff --git a/tv/tuner/aidl/vts/functional/FilterTests.h b/tv/tuner/aidl/vts/functional/FilterTests.h index 6258bacb47..f579441d4f 100644 --- a/tv/tuner/aidl/vts/functional/FilterTests.h +++ b/tv/tuner/aidl/vts/functional/FilterTests.h @@ -60,9 +60,18 @@ using MQDesc = MQDescriptor; class FilterCallback : public BnFilterCallback { public: + /** + * A FilterCallbackVerifier is used to test and verify filter callbacks. + * The function should return true when a callback has been handled by this + * filter verifier. This will cause the associated future to be unblocked. + * If the function returns false, we continue to wait for future callbacks + * (the future remains blocked). + */ + using FilterCallbackVerifier = std::function&)>; + virtual ::ndk::ScopedAStatus onFilterEvent(const vector& events) override; - std::future getNextFilterEventWithTag(DemuxFilterEvent::Tag tag); + std::future verifyFilterCallback(FilterCallbackVerifier&& verifier); virtual ::ndk::ScopedAStatus onFilterStatus(const DemuxFilterStatus /*status*/) override { return ::ndk::ScopedAStatus::ok(); @@ -85,7 +94,7 @@ class FilterCallback : public BnFilterCallback { int32_t mFilterId; std::shared_ptr mFilter; - std::unordered_map> mFilterEventPromises; + std::vector>> mFilterCallbackVerifiers; native_handle_t* mAvSharedHandle = nullptr; uint64_t mAvSharedMemSize = -1; diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp index 88890e45a6..89e42dfa29 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp @@ -640,10 +640,51 @@ TEST_P(TunerFilterAidlTest, testTimeFilter) { testTimeFilter(timeFilterMap[timeFilter.timeFilterId]); } -// TODO: move boilerplate into text fixture -TEST_P(TunerFilterAidlTest, FilterTimeDelayHintTest) { - description("Test filter delay hint."); +static bool isMediaFilter(const FilterConfig& filterConfig) { + switch (filterConfig.type.mainType) { + case DemuxFilterMainType::TS: { + // TS Audio and Video filters are media filters + auto tsFilterType = + filterConfig.type.subType.get(); + return (tsFilterType == DemuxTsFilterType::AUDIO || + tsFilterType == DemuxTsFilterType::VIDEO); + } + case DemuxFilterMainType::MMTP: { + // MMTP Audio and Video filters are media filters + auto mmtpFilterType = + filterConfig.type.subType.get(); + return (mmtpFilterType == DemuxMmtpFilterType::AUDIO || + mmtpFilterType == DemuxMmtpFilterType::VIDEO); + } + default: + return false; + } +} + +static int getDemuxFilterEventDataLength(const DemuxFilterEvent& event) { + switch (event.getTag()) { + case DemuxFilterEvent::Tag::section: + return event.get().dataLength; + case DemuxFilterEvent::Tag::media: + return event.get().dataLength; + case DemuxFilterEvent::Tag::pes: + return event.get().dataLength; + case DemuxFilterEvent::Tag::download: + return event.get().dataLength; + case DemuxFilterEvent::Tag::ipPayload: + return event.get().dataLength; + case DemuxFilterEvent::Tag::tsRecord: + case DemuxFilterEvent::Tag::mmtpRecord: + case DemuxFilterEvent::Tag::temi: + case DemuxFilterEvent::Tag::monitorEvent: + case DemuxFilterEvent::Tag::startId: + return 0; + } +} + +// TODO: move boilerplate into text fixture +void TunerFilterAidlTest::testDelayHint(const FilterConfig& filterConf) { int32_t feId; int32_t demuxId; std::shared_ptr demux; @@ -657,40 +698,87 @@ TEST_P(TunerFilterAidlTest, FilterTimeDelayHintTest) { ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId)); mFilterTests.setDemux(demux); - const auto& filterConf = filterMap[live.ipFilterId]; ASSERT_TRUE(mFilterTests.openFilterInDemux(filterConf.type, filterConf.bufferSize)); ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(filterId)); - ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId)); - ASSERT_TRUE(mFilterTests.configIpFilterCid(filterConf.ipCid, filterId)); + bool mediaFilter = isMediaFilter(filterConf); auto filter = mFilterTests.getFilterById(filterId); - auto delayValue = std::chrono::milliseconds(5000); - FilterDelayHint delayHint; - delayHint.hintType = FilterDelayHintType::TIME_DELAY_IN_MS; - delayHint.hintValue = delayValue.count(); - - auto status = filter->setDelayHint(delayHint); - ASSERT_TRUE(status.isOk()); - - auto startTime = std::chrono::steady_clock::now(); - ASSERT_TRUE(mFilterTests.startFilter(filterId)); - - auto cb = mFilterTests.getFilterCallbacks().at(filterId); - auto future = cb->getNextFilterEventWithTag(DemuxFilterEvent::Tag::ipPayload); + auto timeDelayInMs = std::chrono::milliseconds(filterConf.timeDelayInMs); + if (timeDelayInMs.count() > 0) { + FilterDelayHint delayHint; + delayHint.hintType = FilterDelayHintType::TIME_DELAY_IN_MS; + delayHint.hintValue = timeDelayInMs.count(); + + // setDelayHint should fail for media filters. + ASSERT_EQ(filter->setDelayHint(delayHint).isOk(), !mediaFilter); + } + + int dataDelayInBytes = filterConf.dataDelayInBytes; + if (dataDelayInBytes > 0) { + FilterDelayHint delayHint; + delayHint.hintType = FilterDelayHintType::DATA_SIZE_DELAY_IN_BYTES; + delayHint.hintValue = dataDelayInBytes; + + // setDelayHint should fail for media filters. + ASSERT_EQ(filter->setDelayHint(delayHint).isOk(), !mediaFilter); + } + + // start and stop filter in order to circumvent callback scheduler race + // conditions after adjusting filter delays. + mFilterTests.startFilter(filterId); + mFilterTests.stopFilter(filterId); + + if (!mediaFilter) { + auto cb = mFilterTests.getFilterCallbacks().at(filterId); + int callbackSize = 0; + auto future = cb->verifyFilterCallback( + [&callbackSize](const std::vector& events) { + for (const auto& event : events) { + callbackSize += getDemuxFilterEventDataLength(event); + } + return true; + }); + + // The configure stage can also produce events, so we should set the delay + // hint beforehand. + ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId)); + + auto startTime = std::chrono::steady_clock::now(); + ASSERT_TRUE(mFilterTests.startFilter(filterId)); + + // block and wait for callback to be received. + auto timeout = std::chrono::seconds(30); + ASSERT_EQ(future.wait_for(timeout), std::future_status::ready); + auto duration = std::chrono::steady_clock::now() - startTime; + + bool delayHintTest = duration >= timeDelayInMs; + bool dataSizeTest = callbackSize >= dataDelayInBytes; + + if (timeDelayInMs.count() > 0 && dataDelayInBytes > 0) { + ASSERT_TRUE(delayHintTest || dataSizeTest); + } else { + // if only one of time delay / data delay is configured, one of them + // holds true by default, so we want both assertions to be true. + ASSERT_TRUE(delayHintTest && dataSizeTest); + } - // block and wait for callback to be received. - ASSERT_EQ(future.wait_for(std::chrono::seconds(10)), std::future_status::ready); - auto duration = std::chrono::steady_clock::now() - startTime; - ASSERT_GE(duration, delayValue); + ASSERT_TRUE(mFilterTests.stopFilter(filterId)); + } - // cleanup - ASSERT_TRUE(mFilterTests.stopFilter(filterId)); ASSERT_TRUE(mFilterTests.closeFilter(filterId)); ASSERT_TRUE(mDemuxTests.closeDemux()); ASSERT_TRUE(mFrontendTests.closeFrontend()); } +TEST_P(TunerFilterAidlTest, FilterDelayHintTest) { + description("Test filter time delay hint."); + + for (const auto& obj : filterMap) { + testDelayHint(obj.second); + } +} + TEST_P(TunerPlaybackAidlTest, PlaybackDataFlowWithTsSectionFilterTest) { description("Feed ts data from playback and configure Ts section filter to get output"); if (!playback.support || playback.sectionFilterId.compare(emptyHardwareId) == 0) { diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h index 13c5a801a5..7f80d90c82 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h @@ -140,6 +140,7 @@ class TunerFilterAidlTest : public testing::TestWithParam { void reconfigSingleFilterInDemuxTest(FilterConfig filterConf, FilterConfig filterReconf, FrontendConfig frontendConf); void testTimeFilter(TimeFilterConfig filterConf); + void testDelayHint(const FilterConfig& filterConf); DemuxFilterType getLinkageFilterType(int bit) { DemuxFilterType type; diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h index 7ccf31ae74..b6cc5f80b0 100644 --- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h +++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h @@ -96,6 +96,8 @@ struct FilterConfig { AvStreamType streamType; int32_t ipCid; int32_t monitorEventTypes; + int timeDelayInMs = 0; + int dataDelayInBytes = 0; bool operator<(const FilterConfig& /*c*/) const { return false; } }; @@ -336,6 +338,12 @@ struct TunerTestingConfigAidlReader1_0 { if (filterConfig.hasMonitorEventTypes()) { filterMap[id].monitorEventTypes = (int32_t)filterConfig.getMonitorEventTypes(); } + if (filterConfig.hasTimeDelayInMs()) { + filterMap[id].timeDelayInMs = filterConfig.getTimeDelayInMs(); + } + if (filterConfig.hasDataDelayInBytes()) { + filterMap[id].dataDelayInBytes = filterConfig.getDataDelayInBytes(); + } if (filterConfig.hasAvFilterSettings_optional()) { auto av = filterConfig.getFirstAvFilterSettings_optional(); if (av->hasAudioStreamType_optional()) { diff --git a/tv/tuner/config/api/current.txt b/tv/tuner/config/api/current.txt index 6c637a4689..db1d076e10 100644 --- a/tv/tuner/config/api/current.txt +++ b/tv/tuner/config/api/current.txt @@ -256,6 +256,7 @@ package android.media.tuner.testing.configuration.V1_0 { ctor public Filter(); method @Nullable public android.media.tuner.testing.configuration.V1_0.AvFilterSettings getAvFilterSettings_optional(); method @Nullable public java.math.BigInteger getBufferSize(); + method @Nullable public java.math.BigInteger getDataDelayInBytes(); method @Nullable public String getId(); method @Nullable public android.media.tuner.testing.configuration.V1_0.IpFilterConfig getIpFilterConfig_optional(); method @Nullable public android.media.tuner.testing.configuration.V1_0.FilterMainTypeEnum getMainType(); @@ -264,9 +265,11 @@ package android.media.tuner.testing.configuration.V1_0 { method @Nullable public android.media.tuner.testing.configuration.V1_0.RecordFilterSettings getRecordFilterSettings_optional(); method @Nullable public android.media.tuner.testing.configuration.V1_0.SectionFilterSettings getSectionFilterSettings_optional(); method @Nullable public android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum getSubType(); + method @Nullable public java.math.BigInteger getTimeDelayInMs(); method @Nullable public boolean getUseFMQ(); method public void setAvFilterSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.AvFilterSettings); method public void setBufferSize(@Nullable java.math.BigInteger); + method public void setDataDelayInBytes(@Nullable java.math.BigInteger); method public void setId(@Nullable String); method public void setIpFilterConfig_optional(@Nullable android.media.tuner.testing.configuration.V1_0.IpFilterConfig); method public void setMainType(@Nullable android.media.tuner.testing.configuration.V1_0.FilterMainTypeEnum); @@ -275,6 +278,7 @@ package android.media.tuner.testing.configuration.V1_0 { method public void setRecordFilterSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.RecordFilterSettings); method public void setSectionFilterSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.SectionFilterSettings); method public void setSubType(@Nullable android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum); + method public void setTimeDelayInMs(@Nullable java.math.BigInteger); method public void setUseFMQ(@Nullable boolean); } diff --git a/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml b/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml index 8a6229ebb9..da77200f8a 100644 --- a/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml +++ b/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml @@ -101,7 +101,7 @@ bufferSize="16777216" pid="257" useFMQ="false"> - + diff --git a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd index fc2827f9a3..54cedfcf6b 100644 --- a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd +++ b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd @@ -243,6 +243,10 @@ "bufferSize": the buffer size of the filter in hex. "pid": the pid that would be used to configure the filter. "useFMQ": if the filter uses FMQ. + "timeDelayInMs": the filter's time delay hint. 0 by default. Must not be + longer than 30 seconds. + "dataDelayInBytes": the filter's data delay hint. 0 by default. Configured data + size must be received within 30 seconds. Each filter element also contains at most one type-related "filterSettings". - The settings type should match the filter "subType" attribute. @@ -274,6 +278,8 @@ + + -- GitLab From 2ecfc3989db3af785614b2ada6272010fb3a223a Mon Sep 17 00:00:00 2001 From: Hongguang Date: Tue, 23 Nov 2021 10:29:15 -0800 Subject: [PATCH 313/825] Add new features to tuner HAL. *) Add DTS info to DemuxFilterMediaEvent. *) Allow to ignore download Id in DemuxFilterDownloadSettings and put download id into DemuxFilterDownloadEvent. *) Support dumpsys. *) Change section data size 64 bits. *) Support FrontendStatus streamIdList. Bug: 183583908 Bug: 183024067 Bug: 184017033 Bug: 203181023 Bug: 171540818 Test: atest VtsHalTvTunerTargetTest Test: atest android.media.tv.tuner.cts Test: dumpsys android.hardware.tv.tuner.ITuner/default Change-Id: I7478d008fc50da6700c551ae398dca15f8b350be --- .../tv/tuner/DemuxFilterDownloadEvent.aidl | 1 + .../tv/tuner/DemuxFilterDownloadSettings.aidl | 1 + .../tv/tuner/DemuxFilterMediaEvent.aidl | 2 + .../tv/tuner/DemuxFilterSectionEvent.aidl | 2 +- .../hardware/tv/tuner/FrontendStatus.aidl | 1 + .../hardware/tv/tuner/FrontendStatusType.aidl | 1 + .../tv/tuner/DemuxFilterDownloadEvent.aidl | 5 +++ .../tv/tuner/DemuxFilterDownloadSettings.aidl | 5 +++ .../tv/tuner/DemuxFilterMediaEvent.aidl | 10 +++++ .../tv/tuner/DemuxFilterSectionEvent.aidl | 2 +- .../hardware/tv/tuner/FrontendStatus.aidl | 6 +++ .../hardware/tv/tuner/FrontendStatusType.aidl | 5 +++ tv/tuner/aidl/default/Demux.cpp | 31 +++++++++++++ tv/tuner/aidl/default/Demux.h | 2 + tv/tuner/aidl/default/Dvr.cpp | 7 +++ tv/tuner/aidl/default/Dvr.h | 2 + tv/tuner/aidl/default/Filter.cpp | 14 ++++++ tv/tuner/aidl/default/Filter.h | 2 + tv/tuner/aidl/default/Frontend.cpp | 13 ++++++ tv/tuner/aidl/default/Frontend.h | 2 + tv/tuner/aidl/default/TimeFilter.cpp | 6 +++ tv/tuner/aidl/default/TimeFilter.h | 4 +- tv/tuner/aidl/default/Tuner.cpp | 43 +++++++++++++++++-- tv/tuner/aidl/default/Tuner.h | 2 + .../aidl/vts/functional/FrontendTests.cpp | 7 +++ 25 files changed, 169 insertions(+), 7 deletions(-) diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl index b51e633840..8a05dbd6b8 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl @@ -36,6 +36,7 @@ package android.hardware.tv.tuner; @VintfStability parcelable DemuxFilterDownloadEvent { int itemId; + int downloadId; int mpuSequenceNumber; int itemFragmentIndex; int lastItemFragmentIndex; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl index ff06888b47..86ce646f69 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl @@ -35,5 +35,6 @@ package android.hardware.tv.tuner; /* @hide */ @VintfStability parcelable DemuxFilterDownloadSettings { + boolean useDownloadId; int downloadId; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl index a463d68035..993c6396e5 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl @@ -38,6 +38,8 @@ parcelable DemuxFilterMediaEvent { int streamId; boolean isPtsPresent; long pts; + boolean isDtsPresent; + long dts; long dataLength; long offset; android.hardware.common.NativeHandle avMemory; diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl index 01b8a775e8..199a09c747 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl @@ -38,5 +38,5 @@ parcelable DemuxFilterSectionEvent { int tableId; int version; int sectionNum; - int dataLength; + long dataLength; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl index 7677221a70..c79b7517fe 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl @@ -74,4 +74,5 @@ union FrontendStatus { boolean isShortFrames; android.hardware.tv.tuner.FrontendIsdbtMode isdbtMode; android.hardware.tv.tuner.FrontendIsdbtPartialReceptionFlag partialReceptionFlag; + int[] streamIdList; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl index 6342479233..9ea3200d35 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl @@ -74,4 +74,5 @@ enum FrontendStatusType { IS_SHORT_FRAMES = 36, ISDBT_MODE = 37, ISDBT_PARTIAL_RECEPTION_FLAG = 38, + STREAM_ID_LIST = 39, } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl index cf88928886..b9df5a02b9 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl @@ -27,6 +27,11 @@ parcelable DemuxFilterDownloadEvent { */ int itemId; + /** + * Uniquely identify data content within the same Package ID (PID). + */ + int downloadId; + /** * MPU sequence number of filtered data (only for MMTP) */ diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl index bd79bd529e..1188b033a3 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl @@ -22,6 +22,11 @@ package android.hardware.tv.tuner; */ @VintfStability parcelable DemuxFilterDownloadSettings { + /** + * Whether download ID should be used. + */ + boolean useDownloadId; + /** * Download ID (also known as the carousel ID) is carried in the PMT in * ISO/IEC 13818-1 for the service containing the object carousel. diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl index ec7bbf1aa7..e92b711fd2 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl @@ -39,6 +39,16 @@ parcelable DemuxFilterMediaEvent { */ long pts; + /** + * true if DTS is present in the PES header. + */ + boolean isDtsPresent; + + /** + * Decode TimeStamp for audio or video frame. + */ + long dts; + /** * Data size in bytes of audio or video frame */ diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl index d6663168d8..a5f9ca7c1c 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl @@ -40,5 +40,5 @@ parcelable DemuxFilterSectionEvent { /** * Data size in bytes of filtered data */ - int dataLength; + long dataLength; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl index 9302b76a01..234e18392e 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl @@ -202,4 +202,10 @@ union FrontendStatus { * ISDB-T Partial Reception Flag. */ FrontendIsdbtPartialReceptionFlag partialReceptionFlag; + + /** + * Stream ID list included in a transponder. + */ + int[] streamIdList; + } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl index 103a4ab3fb..7feb72d742 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl @@ -218,4 +218,9 @@ enum FrontendStatusType { * ISDB-T Partial Reception Flag. */ ISDBT_PARTIAL_RECEPTION_FLAG, + + /** + * Stream ID list included in a transponder. + */ + STREAM_ID_LIST, } diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp index 4385461815..a94b4ad38a 100644 --- a/tv/tuner/aidl/default/Demux.cpp +++ b/tv/tuner/aidl/default/Demux.cpp @@ -410,6 +410,37 @@ bool Demux::isRecording() { return mIsRecording; } +binder_status_t Demux::dump(int fd, const char** args, uint32_t numArgs) { + dprintf(fd, " Demux %d:\n", mDemuxId); + dprintf(fd, " mIsRecording %d\n", mIsRecording); + { + dprintf(fd, " Filters:\n"); + map>::iterator it; + for (it = mFilters.begin(); it != mFilters.end(); it++) { + it->second->dump(fd, args, numArgs); + } + } + { + dprintf(fd, " TimeFilter:\n"); + if (mTimeFilter != nullptr) { + mTimeFilter->dump(fd, args, numArgs); + } + } + { + dprintf(fd, " DvrPlayback:\n"); + if (mDvrPlayback != nullptr) { + mDvrPlayback->dump(fd, args, numArgs); + } + } + { + dprintf(fd, " DvrRecord:\n"); + if (mDvrRecord != nullptr) { + mDvrRecord->dump(fd, args, numArgs); + } + } + return STATUS_OK; +} + bool Demux::attachRecordFilter(int64_t filterId) { if (mFilters[filterId] == nullptr || mDvrRecord == nullptr || !mFilters[filterId]->isRecordFilter()) { diff --git a/tv/tuner/aidl/default/Demux.h b/tv/tuner/aidl/default/Demux.h index 1b789bd5d0..7f0b0a7d62 100644 --- a/tv/tuner/aidl/default/Demux.h +++ b/tv/tuner/aidl/default/Demux.h @@ -71,6 +71,8 @@ class Demux : public BnDemux { ::ndk::ScopedAStatus connectCiCam(int32_t in_ciCamId) override; ::ndk::ScopedAStatus disconnectCiCam() override; + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; + // Functions interacts with Tuner Service void stopFrontendInput(); ::ndk::ScopedAStatus removeFilter(int64_t filterId); diff --git a/tv/tuner/aidl/default/Dvr.cpp b/tv/tuner/aidl/default/Dvr.cpp index 4f34b8e2c8..c591d079a8 100644 --- a/tv/tuner/aidl/default/Dvr.cpp +++ b/tv/tuner/aidl/default/Dvr.cpp @@ -177,6 +177,13 @@ EventFlag* Dvr::getDvrEventFlag() { return mDvrEventFlag; } +binder_status_t Dvr::dump(int fd, const char** /* args */, uint32_t /* numArgs */) { + dprintf(fd, " Dvr:\n"); + dprintf(fd, " mType: %hhd\n", mType); + dprintf(fd, " mDvrThreadRunning: %d\n", (bool)mDvrThreadRunning); + return STATUS_OK; +} + void Dvr::playbackThreadLoop() { ALOGD("[Dvr] playback threadLoop start."); diff --git a/tv/tuner/aidl/default/Dvr.h b/tv/tuner/aidl/default/Dvr.h index ad8728e54b..6ff71cd13f 100644 --- a/tv/tuner/aidl/default/Dvr.h +++ b/tv/tuner/aidl/default/Dvr.h @@ -71,6 +71,8 @@ class Dvr : public BnDvr { ::ndk::ScopedAStatus flush() override; ::ndk::ScopedAStatus close() override; + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; + /** * To create a DvrMQ and its Event Flag. * diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp index 54037be492..769ebe21ee 100644 --- a/tv/tuner/aidl/default/Filter.cpp +++ b/tv/tuner/aidl/default/Filter.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "Filter.h" @@ -655,6 +656,17 @@ void Filter::freeSharedAvHandle() { mSharedAvMemHandle = nullptr; } +binder_status_t Filter::dump(int fd, const char** /* args */, uint32_t /* numArgs */) { + dprintf(fd, " Filter %" PRIu64 ":\n", mFilterId); + dprintf(fd, " Main type: %d\n", mType.mainType); + dprintf(fd, " mIsMediaFilter: %d\n", mIsMediaFilter); + dprintf(fd, " mIsPcrFilter: %d\n", mIsPcrFilter); + dprintf(fd, " mIsRecordFilter: %d\n", mIsRecordFilter); + dprintf(fd, " mIsUsingFMQ: %d\n", mIsUsingFMQ); + dprintf(fd, " mFilterThreadRunning: %d\n", (bool)mFilterThreadRunning); + return STATUS_OK; +} + void Filter::maySendFilterStatusCallback() { if (!mIsUsingFMQ) { return; @@ -1148,6 +1160,7 @@ void Filter::createMediaEvent(vector& events) { DemuxFilterMediaEvent mediaEvent; mediaEvent.streamId = 1; mediaEvent.isPtsPresent = true; + mediaEvent.isDtsPresent = false; mediaEvent.dataLength = 3; mediaEvent.offset = 4; mediaEvent.isSecureMemory = true; @@ -1238,6 +1251,7 @@ void Filter::createPesEvent(vector& events) { void Filter::createDownloadEvent(vector& events) { DemuxFilterDownloadEvent download; download.itemId = 1; + download.downloadId = 1; download.mpuSequenceNumber = 2; download.itemFragmentIndex = 3; download.lastItemFragmentIndex = 4; diff --git a/tv/tuner/aidl/default/Filter.h b/tv/tuner/aidl/default/Filter.h index 8388c9861f..e301249e81 100644 --- a/tv/tuner/aidl/default/Filter.h +++ b/tv/tuner/aidl/default/Filter.h @@ -126,6 +126,8 @@ class Filter : public BnFilter { ::ndk::ScopedAStatus setDataSource(const std::shared_ptr& in_filter) override; ::ndk::ScopedAStatus setDelayHint(const FilterDelayHint& in_hint) override; + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; + /** * To create a FilterMQ and its Event Flag. * diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index 77d20e28cf..a4dde2a721 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -676,6 +676,11 @@ Frontend::~Frontend() {} FrontendIsdbtPartialReceptionFlag::AUTO); break; } + case FrontendStatusType::STREAM_ID_LIST: { + vector streamIds = {0, 1}; + status.set(streamIds); + break; + } default: { continue; } @@ -718,6 +723,14 @@ Frontend::~Frontend() {} return ::ndk::ScopedAStatus::ok(); } +binder_status_t Frontend::dump(int fd, const char** /* args */, uint32_t /* numArgs */) { + dprintf(fd, " Frontend %d\n", mId); + dprintf(fd, " mType: %d\n", mType); + dprintf(fd, " mIsLocked: %d\n", mIsLocked); + dprintf(fd, " mCiCamId: %d\n", mCiCamId); + return STATUS_OK; +} + FrontendType Frontend::getFrontendType() { return mType; } diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h index 3c602cff8f..5e7b10c3c2 100644 --- a/tv/tuner/aidl/default/Frontend.h +++ b/tv/tuner/aidl/default/Frontend.h @@ -50,6 +50,8 @@ class Frontend : public BnFrontend { ::ndk::ScopedAStatus linkCiCam(int32_t in_ciCamId, int32_t* _aidl_return) override; ::ndk::ScopedAStatus unlinkCiCam(int32_t in_ciCamId) override; + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; + FrontendType getFrontendType(); int32_t getFrontendId(); string getSourceFile(); diff --git a/tv/tuner/aidl/default/TimeFilter.cpp b/tv/tuner/aidl/default/TimeFilter.cpp index dde7be34ca..9611ed9fb0 100644 --- a/tv/tuner/aidl/default/TimeFilter.cpp +++ b/tv/tuner/aidl/default/TimeFilter.cpp @@ -83,6 +83,12 @@ TimeFilter::~TimeFilter() {} return ::ndk::ScopedAStatus::ok(); } +binder_status_t TimeFilter::dump(int fd, const char** /* args */, uint32_t /* numArgs */) { + dprintf(fd, " TimeFilter:\n"); + dprintf(fd, " mTimeStamp: %" PRIu64 "\n", mTimeStamp); + return STATUS_OK; +} + } // namespace tuner } // namespace tv } // namespace hardware diff --git a/tv/tuner/aidl/default/TimeFilter.h b/tv/tuner/aidl/default/TimeFilter.h index ff35c47d70..5f4c2d4708 100644 --- a/tv/tuner/aidl/default/TimeFilter.h +++ b/tv/tuner/aidl/default/TimeFilter.h @@ -44,8 +44,10 @@ class TimeFilter : public BnTimeFilter { ::ndk::ScopedAStatus getSourceTime(int64_t* _aidl_return) override; ::ndk::ScopedAStatus close() override; + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; + private: - std::shared_ptr mDemux; + ::std::shared_ptr mDemux; uint64_t mTimeStamp = INVALID_TIME_STAMP; time_t mBeginTime; }; diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp index badb08fb33..96e83bbf65 100644 --- a/tv/tuner/aidl/default/Tuner.cpp +++ b/tv/tuner/aidl/default/Tuner.cpp @@ -55,9 +55,13 @@ void Tuner::init() { capsIsdbs.set(FrontendIsdbsCapabilities()); mFrontendCaps[0] = capsIsdbs; statusCaps = { - FrontendStatusType::DEMOD_LOCK, FrontendStatusType::SNR, - FrontendStatusType::FEC, FrontendStatusType::MODULATION, - FrontendStatusType::MODULATIONS, FrontendStatusType::ROLL_OFF, + FrontendStatusType::DEMOD_LOCK, + FrontendStatusType::SNR, + FrontendStatusType::FEC, + FrontendStatusType::MODULATION, + FrontendStatusType::MODULATIONS, + FrontendStatusType::ROLL_OFF, + FrontendStatusType::STREAM_ID_LIST, }; mFrontendStatusCaps[0] = statusCaps; @@ -169,7 +173,7 @@ void Tuner::init() { statusCaps = { FrontendStatusType::DEMOD_LOCK, FrontendStatusType::MODULATION, FrontendStatusType::MODULATIONS, FrontendStatusType::ROLL_OFF, - FrontendStatusType::IS_SHORT_FRAMES, + FrontendStatusType::IS_SHORT_FRAMES, FrontendStatusType::STREAM_ID_LIST, }; mFrontendStatusCaps[8] = statusCaps; @@ -313,6 +317,33 @@ std::shared_ptr Tuner::getFrontendById(int32_t frontendId) { return ::ndk::ScopedAStatus::ok(); } +binder_status_t Tuner::dump(int fd, const char** args, uint32_t numArgs) { + ALOGV("%s", __FUNCTION__); + { + dprintf(fd, "Frontends:\n"); + for (int i = 0; i < mFrontendSize; i++) { + mFrontends[i]->dump(fd, args, numArgs); + for (int j = 0; j < mFrontendStatusCaps[i].size(); j++) { + dprintf(fd, " statusCap: %d\n", mFrontendStatusCaps[i][j]); + } + } + } + { + dprintf(fd, "Demuxs:\n"); + map>::iterator it; + for (it = mDemuxes.begin(); it != mDemuxes.end(); it++) { + it->second->dump(fd, args, numArgs); + } + } + { + dprintf(fd, "Lnbs:\n"); + for (int i = 0; i < mLnbs.size(); i++) { + mLnbs[i]->dump(fd, args, numArgs); + } + } + return STATUS_OK; +} + void Tuner::setFrontendAsDemuxSource(int32_t frontendId, int32_t demuxId) { mFrontendToDemux[frontendId] = demuxId; if (mFrontends[frontendId] != nullptr && mFrontends[frontendId]->isLocked()) { @@ -332,6 +363,10 @@ void Tuner::removeDemux(int32_t demuxId) { } void Tuner::removeFrontend(int32_t frontendId) { + map::iterator it = mFrontendToDemux.find(frontendId); + if (it != mFrontendToDemux.end()) { + mDemuxes.erase(it->second); + } mFrontendToDemux.erase(frontendId); } diff --git a/tv/tuner/aidl/default/Tuner.h b/tv/tuner/aidl/default/Tuner.h index 7af7ab8d53..682496c15e 100644 --- a/tv/tuner/aidl/default/Tuner.h +++ b/tv/tuner/aidl/default/Tuner.h @@ -57,6 +57,8 @@ class Tuner : public BnTuner { std::vector* out_lnbId, std::shared_ptr* _aidl_return) override; + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; + std::shared_ptr getFrontendById(int32_t frontendId); void setFrontendAsDemuxSource(int32_t frontendId, int32_t demuxId); void frontendStartTune(int32_t frontendId); diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp index 6204803c15..12b1f33735 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp +++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp @@ -398,6 +398,13 @@ void FrontendTests::verifyFrontendStatus(vector statusTypes, expectStatuses[i].get()); break; } + case FrontendStatusType::STREAM_ID_LIST: { + ASSERT_TRUE(std::equal( + realStatuses[i].get().begin(), + realStatuses[i].get().end(), + expectStatuses[i].get().begin())); + break; + } default: { continue; } -- GitLab From 0e0ad3e8557940df83ce249b2fb2a06d177eb3ed Mon Sep 17 00:00:00 2001 From: Shinru Han Date: Wed, 8 Dec 2021 15:25:35 +0800 Subject: [PATCH 314/825] Fix GnssHalTest#TestAGnssExtension fail Bug: 209711226 Test: 1. atest GnssHalTest 2. gsi_avd/test-mapping-presubmit/vendor_img_sc Change-Id: I77e597732e29d069f4beaca91b1e530ca5499c78 --- gnss/aidl/vts/gnss_hal_test_cases.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 970d1cb27b..aac59db2a0 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -804,6 +804,9 @@ TEST_P(GnssHalTest, TestAllExtensions) { * 3. Sets SUPL server host/port. */ TEST_P(GnssHalTest, TestAGnssExtension) { + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + return; + } sp iAGnss; auto status = aidl_gnss_hal_->getExtensionAGnss(&iAGnss); ASSERT_TRUE(status.isOk()); -- GitLab From 37703ea26342098e28f91d3a270899b2422c46cc Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Thu, 9 Dec 2021 12:22:37 +0100 Subject: [PATCH 315/825] bluetooth.audio pass both source and sink metadata Currently just source metadata is passed through the new aidl. Test: m android.hardware.bluetooth.audio-update-api Bug: 203490261 Bug: 150670922 Change-Id: I76a44bb8c5cb0b6c16845aca36ba93517ecd07b4 --- .../hardware/bluetooth/audio/IBluetoothAudioPort.aidl | 3 ++- .../hardware/bluetooth/audio/IBluetoothAudioPort.aidl | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl index e389ef3876..9a1557a488 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl @@ -38,5 +38,6 @@ interface IBluetoothAudioPort { void startStream(); void stopStream(); void suspendStream(); - void updateMetadata(in android.hardware.audio.common.SourceMetadata sourceMetadata); + void updateSourceMetadata(in android.hardware.audio.common.SourceMetadata sourceMetadata); + void updateSinkMetadata(in android.hardware.audio.common.SinkMetadata sinkMetadata); } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl index 50e3197c48..827f57d91b 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl @@ -16,6 +16,7 @@ package android.hardware.bluetooth.audio; +import android.hardware.audio.common.SinkMetadata; import android.hardware.audio.common.SourceMetadata; import android.hardware.bluetooth.audio.PresentationPosition; @@ -69,5 +70,12 @@ interface IBluetoothAudioPort { * @param sourceMetadata Description of the audio that is played by the * clients. */ - void updateMetadata(in SourceMetadata sourceMetadata); + void updateSourceMetadata(in SourceMetadata sourceMetadata); + + /** + * Called when the metadata of the stream's sink has been changed. + * + * @param sinkMetadata as passed from Audio Framework + */ + void updateSinkMetadata(in SinkMetadata sinkMetadata); } -- GitLab From 29d2a0f73356998cc24ae6cb747174873dedbe18 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Fri, 19 Nov 2021 10:11:28 -0800 Subject: [PATCH 316/825] Add white point plumbing into command buffer Bug: 200310158 Test: builds, boots Change-Id: I67cadb441b24663346452850a86e3d9151868749 --- .../hardware/graphics/composer3/command-buffer.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h index bdf97ca6e9..b586e7fbec 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h @@ -294,6 +294,11 @@ class CommandWriterBase { getLayerCommand(display, layer).genericMetadata.emplace(std::move(metadata)); } + void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) { + getLayerCommand(display, layer) + .whitePointNits.emplace(command::WhitePointNits{.nits = whitePointNits}); + } + const std::vector& getPendingCommands() { if (mLayerCommand.has_value()) { mCommands.emplace_back(std::move(*mLayerCommand)); @@ -305,6 +310,7 @@ class CommandWriterBase { } return mCommands; } + std::vector getPendingCommandResults() { return std::move(mCommandsResults); } @@ -489,18 +495,21 @@ class CommandReaderBase { } // Get the client target properties requested by hardware composer. - void takeClientTargetProperty(int64_t display, ClientTargetProperty* outClientTargetProperty) { + void takeClientTargetProperty(int64_t display, ClientTargetProperty* outClientTargetProperty, + float* outWhitePointNits) { auto found = mReturnData.find(display); // If not found, return the default values. if (found == mReturnData.end()) { outClientTargetProperty->pixelFormat = common::PixelFormat::RGBA_8888; outClientTargetProperty->dataspace = Dataspace::UNKNOWN; + *outWhitePointNits = -1.f; return; } ReturnData& data = found->second; *outClientTargetProperty = data.clientTargetProperty; + *outWhitePointNits = data.clientTargetWhitePointNits; } private: @@ -578,6 +587,7 @@ class CommandReaderBase { data.clientTargetProperty.pixelFormat = clientTargetProperty.clientTargetProperty.pixelFormat; data.clientTargetProperty.dataspace = clientTargetProperty.clientTargetProperty.dataspace; + data.clientTargetWhitePointNits = clientTargetProperty.whitePointNits; } struct ReturnData { @@ -598,6 +608,7 @@ class CommandReaderBase { ClientTargetProperty clientTargetProperty{common::PixelFormat::RGBA_8888, Dataspace::UNKNOWN}; + float clientTargetWhitePointNits = -1.f; }; std::vector mErrors; -- GitLab From ba427352e25d97a9eb65817b43837c05b1dbf704 Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Thu, 9 Dec 2021 00:33:37 -0800 Subject: [PATCH 317/825] Add TrafficDescriptor to DataProfileInfo Test: build Bug: 208651109 Change-Id: Ic5e5edab9be1087044e1a303735a59a4cef8ee89 --- .../hardware/radio/data/DataProfileInfo.aidl | 1 + .../hardware/radio/data/IRadioData.aidl | 2 +- .../radio/data/IRadioDataIndication.aidl | 2 +- .../hardware/radio/data/DataProfileInfo.aidl | 9 +++++ .../hardware/radio/data/IRadioData.aidl | 7 ---- .../radio/data/IRadioDataIndication.aidl | 5 ++- radio/aidl/compat/libradiocompat/Android.bp | 2 + .../compat/libradiocompat/DriverContext.cpp | 37 +++++++++++++++++++ .../compat/libradiocompat/RadioCompatBase.cpp | 9 +++-- .../compat/libradiocompat/RadioIndication.cpp | 23 ++++++++++++ .../compat/libradiocompat/RadioResponse.cpp | 2 + .../compat/libradiocompat/data/RadioData.cpp | 7 ++-- .../data/RadioIndication-data.cpp | 2 +- .../include/libradiocompat/DriverContext.h | 32 ++++++++++++++++ .../include/libradiocompat/RadioCompatBase.h | 7 +++- .../include/libradiocompat/RadioData.h | 1 - .../include/libradiocompat/RadioIndication.h | 6 +++ .../include/libradiocompat/RadioResponse.h | 6 +++ radio/aidl/compat/service/service.cpp | 23 +++++++----- 19 files changed, 151 insertions(+), 32 deletions(-) create mode 100644 radio/aidl/compat/libradiocompat/DriverContext.cpp create mode 100644 radio/aidl/compat/libradiocompat/RadioIndication.cpp create mode 100644 radio/aidl/compat/libradiocompat/include/libradiocompat/DriverContext.h 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 9df687c258..334261965c 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 @@ -53,6 +53,7 @@ parcelable DataProfileInfo { boolean preferred; boolean persistent; boolean alwaysOn; + @nullable android.hardware.radio.data.TrafficDescriptor trafficDescriptor; const int ID_DEFAULT = 0; const int ID_TETHERED = 1; const int ID_IMS = 2; 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 a648675280..dc6092a066 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 @@ -46,7 +46,7 @@ interface IRadioData { oneway void setDataThrottling(in int serial, in android.hardware.radio.data.DataThrottlingAction dataThrottlingAction, in long completionDurationMillis); oneway void setInitialAttachApn(in int serial, in android.hardware.radio.data.DataProfileInfo dataProfileInfo); oneway void setResponseFunctions(in android.hardware.radio.data.IRadioDataResponse radioDataResponse, in android.hardware.radio.data.IRadioDataIndication radioDataIndication); - oneway void setupDataCall(in int serial, in android.hardware.radio.AccessNetwork accessNetwork, in android.hardware.radio.data.DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in android.hardware.radio.data.DataRequestReason reason, in android.hardware.radio.data.LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in @nullable android.hardware.radio.data.SliceInfo sliceInfo, in @nullable android.hardware.radio.data.TrafficDescriptor trafficDescriptor, in boolean matchAllRuleAllowed); + oneway void setupDataCall(in int serial, in android.hardware.radio.AccessNetwork accessNetwork, in android.hardware.radio.data.DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in android.hardware.radio.data.DataRequestReason reason, in android.hardware.radio.data.LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in @nullable android.hardware.radio.data.SliceInfo sliceInfo, in boolean matchAllRuleAllowed); oneway void startHandover(in int serial, in int callId); oneway void startKeepalive(in int serial, in android.hardware.radio.data.KeepaliveRequest keepalive); oneway void stopKeepalive(in int serial, in int sessionHandle); 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 e496c7be4e..b0cc1eb189 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 @@ -37,5 +37,5 @@ interface IRadioDataIndication { oneway void dataCallListChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.SetupDataCallResult[] dcList); oneway void keepaliveStatus(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.KeepaliveStatus status); oneway void pcoData(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.PcoDataInfo pco); - oneway void unthrottleApn(in android.hardware.radio.RadioIndicationType type, in String apn); + oneway void unthrottleApn(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.DataProfileInfo dataProfileInfo); } diff --git a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl index a14963fe60..0f061191fd 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.RadioAccessFamily; import android.hardware.radio.data.ApnAuthType; import android.hardware.radio.data.ApnTypes; import android.hardware.radio.data.PdpProtocolType; +import android.hardware.radio.data.TrafficDescriptor; @VintfStability parcelable DataProfileInfo { @@ -122,4 +123,12 @@ parcelable DataProfileInfo { * See 3GPP TS 23.501 section 5.6.13 for the details. */ boolean alwaysOn; + /** + * TrafficDescriptor for which data connection needs to be established. + * It is used for URSP traffic matching as described in TS 24.526 Section 4.2.2. + * It includes an optional DNN which, if present, must be used for traffic matching -- + * it does not specify the end point to be used for the data call. The end point is specified by + * apn; apn must be used as the end point if one is not specified through URSP rules. + */ + @nullable TrafficDescriptor trafficDescriptor; } diff --git a/radio/aidl/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/android/hardware/radio/data/IRadioData.aidl index 9f5ba4c147..54a045c35d 100644 --- a/radio/aidl/android/hardware/radio/data/IRadioData.aidl +++ b/radio/aidl/android/hardware/radio/data/IRadioData.aidl @@ -219,12 +219,6 @@ oneway interface IRadioData { * EPDG to 5G. It is valid only when accessNetwork is AccessNetwork:NGRAN. If the slice * passed from EPDG is rejected, then the data failure cause must be * DataCallFailCause:SLICE_REJECTED. - * @param trafficDescriptor TrafficDescriptor for which data connection needs to be established. - * It is used for URSP traffic matching as described in TS 24.526 Section 4.2.2. - * It includes an optional DNN which, if present, must be used for traffic matching -- - * it does not specify the end point to be used for the data call. The end point is - * specified by DataProfileInfo.apn; DataProfileInfo.apn must be used as the end point if - * one is not specified through URSP rules. * @param matchAllRuleAllowed bool to indicate if using default match-all URSP rule for this * request is allowed. If false, this request must not use the match-all URSP rule and if * a non-match-all rule is not found (or if URSP rules are not available) it should @@ -238,7 +232,6 @@ oneway interface IRadioData { in DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in DataRequestReason reason, in LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in @nullable SliceInfo sliceInfo, - in @nullable TrafficDescriptor trafficDescriptor, in boolean matchAllRuleAllowed); /** diff --git a/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl b/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl index 8e73ee33af..1772c8859f 100644 --- a/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl +++ b/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.data; import android.hardware.radio.RadioIndicationType; +import android.hardware.radio.data.DataProfileInfo; import android.hardware.radio.data.KeepaliveStatus; import android.hardware.radio.data.PcoDataInfo; import android.hardware.radio.data.SetupDataCallResult; @@ -68,7 +69,7 @@ oneway interface IRadioDataIndication { * is sent, AOSP will no longer throttle calls to IRadioData.SetupDataCall for the given APN. * * @param type Type of radio indication - * @param apn Apn to unthrottle + * @param dataProfileInfo Data profile info. */ - void unthrottleApn(in RadioIndicationType type, in String apn); + void unthrottleApn(in RadioIndicationType type, in DataProfileInfo dataProfileInfo); } diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp index 43d9378364..5294de4bb1 100644 --- a/radio/aidl/compat/libradiocompat/Android.bp +++ b/radio/aidl/compat/libradiocompat/Android.bp @@ -56,7 +56,9 @@ cc_library { "libutils", ], srcs: [ + "DriverContext.cpp", "RadioCompatBase.cpp", + "RadioIndication.cpp", "RadioResponse.cpp", "commonStructs.cpp", "config/RadioConfig.cpp", diff --git a/radio/aidl/compat/libradiocompat/DriverContext.cpp b/radio/aidl/compat/libradiocompat/DriverContext.cpp new file mode 100644 index 0000000000..a07173e6c9 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/DriverContext.cpp @@ -0,0 +1,37 @@ +/* + * 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 + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio; + +void DriverContext::addDataProfile(const aidl::data::DataProfileInfo& profile) { + mDataProfiles[profile.apn] = profile; +} + +aidl::data::DataProfileInfo DriverContext::getDataProfile(const std::string& apn) { + const auto it = mDataProfiles.find(apn); + if (it != mDataProfiles.end()) return it->second; + + // if not found in cache, return a made up default + return { + .apn = apn, + }; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp b/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp index a9eac68d13..dba6c19fa2 100644 --- a/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp +++ b/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp @@ -20,12 +20,13 @@ namespace android::hardware::radio::compat { -RadioCompatBase::RadioCompatBase(sp hidlHal, sp radioResponse, - sp radioIndication) - : mHal1_5(hidlHal), +RadioCompatBase::RadioCompatBase(std::shared_ptr context, sp hidlHal, + sp radioResponse, sp radioInd) + : mContext(context), + mHal1_5(hidlHal), mHal1_6(V1_6::IRadio::castFrom(hidlHal)), mRadioResponse(radioResponse), - mRadioIndication(radioIndication) {} + mRadioIndication(radioInd) {} V1_6::IRadioResponse& RadioCompatBase::respond() { CHECK(mRadioResponse) << "This shouldn't happen (response functions are passed in constructor)"; diff --git a/radio/aidl/compat/libradiocompat/RadioIndication.cpp b/radio/aidl/compat/libradiocompat/RadioIndication.cpp new file mode 100644 index 0000000000..30ef6a0dcc --- /dev/null +++ b/radio/aidl/compat/libradiocompat/RadioIndication.cpp @@ -0,0 +1,23 @@ +/* + * 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 + +namespace android::hardware::radio::compat { + +RadioIndication::RadioIndication(std::shared_ptr context) : mContext(context) {} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/RadioResponse.cpp b/radio/aidl/compat/libradiocompat/RadioResponse.cpp index 35b0ac1d82..e1bd4469cb 100644 --- a/radio/aidl/compat/libradiocompat/RadioResponse.cpp +++ b/radio/aidl/compat/libradiocompat/RadioResponse.cpp @@ -22,6 +22,8 @@ namespace android::hardware::radio::compat { +RadioResponse::RadioResponse(std::shared_ptr context) : mContext(context) {} + Return RadioResponse::acknowledgeRequest(int32_t serial) { LOG_CALL << serial; // TODO(b/203699028): send to correct requestor or confirm if spam is not a problem diff --git a/radio/aidl/compat/libradiocompat/data/RadioData.cpp b/radio/aidl/compat/libradiocompat/data/RadioData.cpp index fdb127318e..cc6f526de8 100644 --- a/radio/aidl/compat/libradiocompat/data/RadioData.cpp +++ b/radio/aidl/compat/libradiocompat/data/RadioData.cpp @@ -139,14 +139,15 @@ ScopedAStatus RadioData::setupDataCall( // const aidl::DataProfileInfo& dataProfileInfo, bool roamingAllowed, aidl::DataRequestReason reason, const std::vector& addresses, const std::vector& dnses, int32_t pduSessId, - const std::optional& sliceInfo, - const std::optional& trDesc, bool matchAllRuleAllowed) { + const std::optional& sliceInfo, bool matchAllRuleAllowed) { if (mHal1_6) { mHal1_6->setupDataCall_1_6( // serial, V1_5::AccessNetwork(accessNetwork), toHidl(dataProfileInfo), roamingAllowed, V1_2::DataRequestReason(reason), toHidl(addresses), toHidl(dnses), pduSessId, toHidl(sliceInfo), - toHidl(trDesc), matchAllRuleAllowed); + toHidl(dataProfileInfo.trafficDescriptor), + matchAllRuleAllowed); + mContext->addDataProfile(dataProfileInfo); } else { mHal1_5->setupDataCall_1_5( // serial, V1_5::AccessNetwork(accessNetwork), toHidl(dataProfileInfo), roamingAllowed, diff --git a/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp b/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp index f51d1a8d37..a680e562ab 100644 --- a/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp +++ b/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp @@ -83,7 +83,7 @@ Return RadioIndication::unthrottleApn(V1_0::RadioIndicationType type, const hidl_string& apn) { LOG_CALL << type; CHECK_CB(mDataCb); - mDataCb->unthrottleApn(toAidl(type), apn); + mDataCb->unthrottleApn(toAidl(type), mContext->getDataProfile(apn)); return {}; } diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/DriverContext.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/DriverContext.h new file mode 100644 index 0000000000..6833aca753 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/DriverContext.h @@ -0,0 +1,32 @@ +/* + * 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 + +#include + +namespace android::hardware::radio::compat { + +class DriverContext { + std::map mDataProfiles; + + public: + void addDataProfile(const ::aidl::android::hardware::radio::data::DataProfileInfo& profile); + ::aidl::android::hardware::radio::data::DataProfileInfo getDataProfile(const std::string& apn); +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h index a412c34abc..21d7898002 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h @@ -15,6 +15,7 @@ */ #pragma once +#include "DriverContext.h" #include "RadioIndication.h" #include "RadioResponse.h" @@ -24,6 +25,8 @@ namespace android::hardware::radio::compat { class RadioCompatBase { protected: + std::shared_ptr mContext; + sp mHal1_5; sp mHal1_6; @@ -33,8 +36,8 @@ class RadioCompatBase { V1_6::IRadioResponse& respond(); public: - RadioCompatBase(sp hidlHal, sp radioResponse, - sp radioIndication); + RadioCompatBase(std::shared_ptr context, sp hidlHal, + sp radioResponse, sp radioIndication); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h index 900a669064..ba8bb0a6ae 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h @@ -55,7 +55,6 @@ class RadioData : public RadioCompatBase, public aidl::android::hardware::radio: const std::vector<::aidl::android::hardware::radio::data::LinkAddress>& addresses, const std::vector& dnses, int32_t pduSessionId, const std::optional<::aidl::android::hardware::radio::data::SliceInfo>& sliceInfo, - const std::optional<::aidl::android::hardware::radio::data::TrafficDescriptor>& trDescr, bool matchAllRuleAllowed) override; ::ndk::ScopedAStatus startHandover(int32_t serial, int32_t callId) override; ::ndk::ScopedAStatus startKeepalive( diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h index 20e09735e6..4d03063a41 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h @@ -15,6 +15,8 @@ */ #pragma once +#include "DriverContext.h" + #include #include #include @@ -26,6 +28,8 @@ namespace android::hardware::radio::compat { class RadioIndication : public V1_6::IRadioIndication { + std::shared_ptr mContext; + std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> mDataCb; std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> mMessagingCb; @@ -181,6 +185,8 @@ class RadioIndication : public V1_6::IRadioIndication { const hidl_vec& records) override; public: + RadioIndication(std::shared_ptr context); + void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> dataCb); void setResponseFunction( diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h index 5db963f582..344864f75e 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h @@ -15,6 +15,8 @@ */ #pragma once +#include "DriverContext.h" + #include #include #include @@ -26,6 +28,8 @@ namespace android::hardware::radio::compat { class RadioResponse : public V1_6::IRadioResponse { + std::shared_ptr mContext; + std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> mDataCb; std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> mMessagingCb; @@ -409,6 +413,8 @@ class RadioResponse : public V1_6::IRadioResponse { int32_t updatedRecordIndex) override; public: + RadioResponse(std::shared_ptr context); + void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> dataCb); void setResponseFunction( diff --git a/radio/aidl/compat/service/service.cpp b/radio/aidl/compat/service/service.cpp index 2a67569452..6bcd4b0c61 100644 --- a/radio/aidl/compat/service/service.cpp +++ b/radio/aidl/compat/service/service.cpp @@ -36,7 +36,8 @@ using namespace std::string_literals; static std::vector> gPublishedHals; template -static void publishRadioHal(sp hidlHal, sp responseCb, +static void publishRadioHal(std::shared_ptr context, + sp hidlHal, sp responseCb, sp indicationCb, const std::string& slot) { const auto instance = T::descriptor + "/"s + slot; if (!AServiceManager_isDeclared(instance.c_str())) { @@ -45,7 +46,7 @@ static void publishRadioHal(sp hidlHal, sp } LOG(DEBUG) << "Publishing " << instance; - auto aidlHal = ndk::SharedRefBase::make(hidlHal, responseCb, indicationCb); + auto aidlHal = ndk::SharedRefBase::make(context, hidlHal, responseCb, indicationCb); gPublishedHals.push_back(aidlHal); const auto status = AServiceManager_addService(aidlHal->asBinder().get(), instance.c_str()); CHECK_EQ(status, STATUS_OK); @@ -57,16 +58,18 @@ static void publishRadio(std::string slot) { hidl_utils::linkDeathToDeath(radioHidl); - auto responseCb = sp::make(); - auto indicationCb = sp::make(); + auto context = std::make_shared(); + + auto responseCb = sp::make(context); + auto indicationCb = sp::make(context); radioHidl->setResponseFunctions(responseCb, indicationCb).assertOk(); - publishRadioHal(radioHidl, responseCb, indicationCb, slot); - publishRadioHal(radioHidl, responseCb, indicationCb, slot); - publishRadioHal(radioHidl, responseCb, indicationCb, slot); - publishRadioHal(radioHidl, responseCb, indicationCb, slot); - publishRadioHal(radioHidl, responseCb, indicationCb, slot); - publishRadioHal(radioHidl, responseCb, indicationCb, slot); + publishRadioHal(context, radioHidl, responseCb, indicationCb, slot); + publishRadioHal(context, radioHidl, responseCb, indicationCb, slot); + publishRadioHal(context, radioHidl, responseCb, indicationCb, slot); + publishRadioHal(context, radioHidl, responseCb, indicationCb, slot); + publishRadioHal(context, radioHidl, responseCb, indicationCb, slot); + publishRadioHal(context, radioHidl, responseCb, indicationCb, slot); } static void publishRadioConfig() { -- GitLab From d9ce3c88df9ea03e41d565878b79f0f5b7667ef2 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 3 Nov 2021 13:32:31 -0700 Subject: [PATCH 318/825] Change IVehicleHardware callbacks to shared_ptr. Use shared_ptr for hardware callbacks so that same callback could be reused for multiple hardware calls. Test: atest DefaultVehicleHalTest atest FakeVehicleHardwareTest Bug: 200737967 Change-Id: I2a005bbf77241fe2c85f871690c8aef18e770b69 --- .../hardware/include/FakeVehicleHardware.h | 24 ++++++++---------- .../hardware/src/FakeVehicleHardware.cpp | 25 +++++++++++-------- .../hardware/test/FakeVehicleHardwareTest.cpp | 25 +++++++++++-------- .../impl/hardware/include/IVehicleHardware.h | 22 +++++++++------- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 16 ++++++------ 5 files changed, 61 insertions(+), 51 deletions(-) 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 46a526c1af..cab184bb49 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -39,14 +39,6 @@ namespace fake { class FakeVehicleHardware final : public IVehicleHardware { public: - using SetValuesCallback = std::function&)>; - using GetValuesCallback = std::function&)>; - using OnPropertyChangeCallback = std::function&)>; - using OnPropertySetErrorCallback = std::function&)>; - FakeVehicleHardware(); explicit FakeVehicleHardware(std::unique_ptr valuePool); @@ -59,7 +51,7 @@ class FakeVehicleHardware final : public IVehicleHardware { // are sent to vehicle bus or before property set confirmation is received. The callback is // safe to be called after the function returns and is safe to be called in a different thread. ::aidl::android::hardware::automotive::vehicle::StatusCode setValues( - SetValuesCallback&& callback, + std::shared_ptr callback, const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>& requests) override; @@ -67,7 +59,7 @@ class FakeVehicleHardware final : public IVehicleHardware { // The callback is safe to be called after the function returns and is safe to be called in a // different thread. ::aidl::android::hardware::automotive::vehicle::StatusCode getValues( - GetValuesCallback&& callback, + std::shared_ptr callback, const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>& requests) const override; @@ -78,11 +70,13 @@ class FakeVehicleHardware final : public IVehicleHardware { ::aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() override; // Register a callback that would be called when there is a property change event from vehicle. - void registerOnPropertyChangeEvent(OnPropertyChangeCallback&& callback) override; + void registerOnPropertyChangeEvent( + std::unique_ptr callback) override; // Register a callback that would be called when there is a property set error event from // vehicle. - void registerOnPropertySetErrorEvent(OnPropertySetErrorCallback&& callback) override; + void registerOnPropertySetErrorEvent( + std::unique_ptr callback) override; private: // Expose private methods to unit test. @@ -94,8 +88,10 @@ class FakeVehicleHardware final : public IVehicleHardware { const std::unique_ptr mFakeObd2Frame; const std::unique_ptr mFakeUserHal; std::mutex mCallbackLock; - OnPropertyChangeCallback mOnPropertyChangeCallback GUARDED_BY(mCallbackLock); - OnPropertySetErrorCallback mOnPropertySetErrorCallback GUARDED_BY(mCallbackLock); + std::unique_ptr mOnPropertyChangeCallback + GUARDED_BY(mCallbackLock); + std::unique_ptr mOnPropertySetErrorCallback + GUARDED_BY(mCallbackLock); void init(); // Stores the initial value to property store. 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 5b2003ec19..e75f0e7c2c 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -379,7 +379,7 @@ Result FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValue& v return {}; } -StatusCode FakeVehicleHardware::setValues(FakeVehicleHardware::SetValuesCallback&& callback, +StatusCode FakeVehicleHardware::setValues(std::shared_ptr callback, const std::vector& requests) { std::vector updatedValues; std::vector results; @@ -424,12 +424,12 @@ StatusCode FakeVehicleHardware::setValues(FakeVehicleHardware::SetValuesCallback // In the real vhal, the values will be sent to Car ECU. We just pretend it is done here and // send back the updated property values to client. - callback(std::move(results)); + (*callback)(std::move(results)); return StatusCode::OK; } -StatusCode FakeVehicleHardware::getValues(FakeVehicleHardware::GetValuesCallback&& callback, +StatusCode FakeVehicleHardware::getValues(std::shared_ptr callback, const std::vector& requests) const { std::vector results; for (auto& request : requests) { @@ -471,7 +471,7 @@ StatusCode FakeVehicleHardware::getValues(FakeVehicleHardware::GetValuesCallback results.push_back(std::move(getValueResult)); } - callback(std::move(results)); + (*callback)(std::move(results)); return StatusCode::OK; } @@ -487,23 +487,28 @@ StatusCode FakeVehicleHardware::checkHealth() { return StatusCode::OK; } -void FakeVehicleHardware::registerOnPropertyChangeEvent(OnPropertyChangeCallback&& callback) { +void FakeVehicleHardware::registerOnPropertyChangeEvent( + std::unique_ptr callback) { std::scoped_lock lockGuard(mCallbackLock); mOnPropertyChangeCallback = std::move(callback); } -void FakeVehicleHardware::registerOnPropertySetErrorEvent(OnPropertySetErrorCallback&& callback) { +void FakeVehicleHardware::registerOnPropertySetErrorEvent( + std::unique_ptr callback) { std::scoped_lock lockGuard(mCallbackLock); mOnPropertySetErrorCallback = std::move(callback); } void FakeVehicleHardware::onValueChangeCallback(const VehiclePropValue& value) { std::scoped_lock lockGuard(mCallbackLock); - if (mOnPropertyChangeCallback != nullptr) { - std::vector updatedValues; - updatedValues.push_back(value); - mOnPropertyChangeCallback(std::move(updatedValues)); + + if (mOnPropertyChangeCallback == nullptr) { + return; } + + std::vector updatedValues; + updatedValues.push_back(value); + (*mOnPropertyChangeCallback)(std::move(updatedValues)); } void FakeVehicleHardware::maybeOverrideProperties(const char* overrideDir) { 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 88834f3e20..f8df6e62d1 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -76,24 +76,25 @@ class FakeVehicleHardwareTestHelper { class FakeVehicleHardwareTest : public ::testing::Test { protected: void SetUp() override { - getHardware()->registerOnPropertyChangeEvent( + auto callback = std::make_unique( [this](const std::vector& values) { - return onPropertyChangeEvent(values); + onPropertyChangeEvent(values); }); + getHardware()->registerOnPropertyChangeEvent(std::move(callback)); + mSetValuesCallback = std::make_shared( + [this](std::vector results) { onSetValues(results); }); + mGetValuesCallback = std::make_shared( + [this](std::vector results) { onGetValues(results); }); } FakeVehicleHardware* getHardware() { return &mHardware; } StatusCode setValues(const std::vector& requests) { - return getHardware()->setValues( - [this](const std::vector results) { return onSetValues(results); }, - requests); + return getHardware()->setValues(mSetValuesCallback, requests); } StatusCode getValues(const std::vector& requests) { - return getHardware()->getValues( - [this](const std::vector results) { return onGetValues(results); }, - requests); + return getHardware()->getValues(mGetValuesCallback, requests); } StatusCode setValue(const VehiclePropValue& value) { @@ -245,6 +246,8 @@ class FakeVehicleHardwareTest : public ::testing::Test { std::vector mSetValueResults; std::vector mGetValueResults; std::vector mChangedProperties; + std::shared_ptr mSetValuesCallback; + std::shared_ptr mGetValuesCallback; }; TEST_F(FakeVehicleHardwareTest, testGetAllPropertyConfigs) { @@ -367,9 +370,9 @@ TEST_F(FakeVehicleHardwareTest, testSetValuesError) { TEST_F(FakeVehicleHardwareTest, testRegisterOnPropertyChangeEvent) { // We have already registered this callback in Setup, here we are registering again. - getHardware()->registerOnPropertyChangeEvent(std::bind( - &FakeVehicleHardwareTest_testRegisterOnPropertyChangeEvent_Test::onPropertyChangeEvent, - this, std::placeholders::_1)); + auto callback = std::make_unique( + [this](const std::vector& values) { onPropertyChangeEvent(values); }); + getHardware()->registerOnPropertyChangeEvent(std::move(callback)); auto testValues = getTestPropValues(); std::vector requests; diff --git a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h index 2e12327300..4b9de2d2a9 100644 --- a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h @@ -19,6 +19,7 @@ #include +#include #include namespace android { @@ -49,6 +50,14 @@ struct SetValueErrorEvent { // with a VehicleHardware through this interface. class IVehicleHardware { public: + using SetValuesCallback = std::function)>; + using GetValuesCallback = std::function)>; + using PropertyChangeCallback = std::function)>; + using PropertySetErrorCallback = std::function)>; + virtual ~IVehicleHardware() = default; // Get all the property configs. @@ -59,9 +68,7 @@ class IVehicleHardware { // are sent to vehicle bus or before property set confirmation is received. The callback is // safe to be called after the function returns and is safe to be called in a different thread. virtual ::aidl::android::hardware::automotive::vehicle::StatusCode setValues( - std::function&)>&& - callback, + std::shared_ptr callback, const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>& requests) = 0; @@ -69,9 +76,7 @@ class IVehicleHardware { // The callback is safe to be called after the function returns and is safe to be called in a // different thread. virtual ::aidl::android::hardware::automotive::vehicle::StatusCode getValues( - std::function&)>&& - callback, + std::shared_ptr callback, const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>& requests) const = 0; @@ -83,13 +88,12 @@ class IVehicleHardware { // Register a callback that would be called when there is a property change event from vehicle. virtual void registerOnPropertyChangeEvent( - std::function&)>&& callback) = 0; + std::unique_ptr callback) = 0; // Register a callback that would be called when there is a property set error event from // vehicle. virtual void registerOnPropertySetErrorEvent( - std::function&)>&& callback) = 0; + std::unique_ptr callback) = 0; }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 62a7098585..2b5ca70285 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -53,16 +54,17 @@ using ::testing::WhenSortedBy; class MockVehicleHardware final : public IVehicleHardware { public: std::vector getAllPropertyConfigs() const override { + std::scoped_lock lockGuard(mLock); return mPropertyConfigs; } - StatusCode setValues(std::function&)>&&, + StatusCode setValues(std::shared_ptr, const std::vector&) override { // TODO(b/200737967): mock this. return StatusCode::OK; } - StatusCode getValues(std::function&)>&&, + StatusCode getValues(std::shared_ptr, const std::vector&) const override { // TODO(b/200737967): mock this. return StatusCode::OK; @@ -78,23 +80,23 @@ class MockVehicleHardware final : public IVehicleHardware { return StatusCode::OK; } - void registerOnPropertyChangeEvent( - std::function&)>&&) override { + void registerOnPropertyChangeEvent(std::unique_ptr) override { // TODO(b/200737967): mock this. } - void registerOnPropertySetErrorEvent( - std::function&)>&&) override { + void registerOnPropertySetErrorEvent(std::unique_ptr) override { // TODO(b/200737967): mock this. } // Test functions. void setPropertyConfigs(const std::vector& configs) { + std::scoped_lock lockGuard(mLock); mPropertyConfigs = configs; } private: - std::vector mPropertyConfigs; + mutable std::mutex mLock; + std::vector mPropertyConfigs GUARDED_BY(mLock); }; struct PropConfigCmp { -- GitLab From 498b6b7856b158facedb57379ce9cf831b910ee4 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 9 Dec 2021 14:59:49 -0800 Subject: [PATCH 319/825] Change the VHAL service name. Change the VHAL service name. Test: Manually build and test on emulator. Bug: 209718034 Change-Id: If6d654648d8d7b197c1c75b7de024bbadcec2122 --- automotive/vehicle/aidl/impl/vhal/Android.bp | 2 +- automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp | 4 ++-- automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp index 79d3ebd82e..454fea5050 100644 --- a/automotive/vehicle/aidl/impl/vhal/Android.bp +++ b/automotive/vehicle/aidl/impl/vhal/Android.bp @@ -19,7 +19,7 @@ package { } cc_binary { - name: "android.hardware.automotive.vehicle-aidl-default-service", + name: "android.hardware.automotive.vehicle@V1-default-service", vendor: true, defaults: [ "FakeVehicleHardwareDefaults", diff --git a/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp b/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp index 14224a52ad..c8b5c658dd 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp @@ -32,8 +32,8 @@ int main(int /* argc */, char* /* argv */[]) { ::ndk::SharedRefBase::make(std::move(hardware)); ALOGI("Registering as service..."); - binder_exception_t err = AServiceManager_addService(vhal->asBinder().get(), - "android.hardware.automotive.vehicle"); + binder_exception_t err = AServiceManager_addService( + vhal->asBinder().get(), "android.hardware.automotive.vehicle.IVehicle/default"); if (err != EX_NONE) { ALOGE("failed to register android.hardware.automotive.vehicle service, exception: %d", err); return 1; diff --git a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc index 4c8865a16f..19267cd383 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-aidl-default-service +service vendor.vehicle-hal-default /vendor/bin/hw/android.hardware.automotive.vehicle@V1-default-service class early_hal user vehicle_network group system inet -- GitLab From 80af4e446509a0fed1561798ac77233d84bc7f1e Mon Sep 17 00:00:00 2001 From: Sundong Ahn Date: Thu, 2 Dec 2021 01:01:49 +0000 Subject: [PATCH 320/825] Prepares android.hardware.wifi@1.0-service Prepares android.hardware.wifi@1.0-service for use by a wifi HAL vendor APEX. - Creates a cc_defaults with soong config vars for @1.0-service and @1.0-service lib that customized implementations can override. Bug: 205065320 Test: m -j with mac80211_hwsim vendor APEX on Cuttlefish Test: Connect to wifi Change-Id: I5827ed1ceb9be8278a54fd828249bf8e549fb950 --- wifi/1.5/default/Android.bp | 105 ++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 wifi/1.5/default/Android.bp diff --git a/wifi/1.5/default/Android.bp b/wifi/1.5/default/Android.bp new file mode 100644 index 0000000000..6333b6e265 --- /dev/null +++ b/wifi/1.5/default/Android.bp @@ -0,0 +1,105 @@ +// 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. + +package { + default_applicable_licenses: ["hardware_interfaces_license"], +} + +filegroup { + name: "android.hardware.wifi@1.0-service_srcs", + srcs: ["service.cpp"], +} + +cc_defaults { + name: "android.hardware.wifi@1.0-service_default", + srcs: [":android.hardware.wifi@1.0-service_srcs"], + relative_install_path: "hw", + soc_specific: true, + shared_libs: [ + "android.hardware.wifi@1.0", + "android.hardware.wifi@1.1", + "android.hardware.wifi@1.2", + "android.hardware.wifi@1.3", + "android.hardware.wifi@1.4", + "android.hardware.wifi@1.5", + "libbase", + "libcutils", + "libhidlbase", + "liblog", + "libnl", + "libutils", + "libwifi-system-iface", + "libxml2", + ], + cppflags: [ + "-Wall", + "-Werror", + "-Wextra", + ], +} + +filegroup { + name: "android.hardware.wifi@1.0-service-lib_srcs", + srcs: [ + "hidl_struct_util.cpp", + "hidl_sync_util.cpp", + "ringbuffer.cpp", + "wifi.cpp", + "wifi_ap_iface.cpp", + "wifi_chip.cpp", + "wifi_feature_flags.cpp", + "wifi_iface_util.cpp", + "wifi_legacy_hal.cpp", + "wifi_legacy_hal_factory.cpp", + "wifi_legacy_hal_stubs.cpp", + "wifi_mode_controller.cpp", + "wifi_nan_iface.cpp", + "wifi_p2p_iface.cpp", + "wifi_rtt_controller.cpp", + "wifi_sta_iface.cpp", + "wifi_status_util.cpp", + ], +} + +cc_defaults { + name: "android.hardware.wifi@1.0-service-lib_defaults", + srcs: [":android.hardware.wifi@1.0-service-lib_srcs"], + relative_install_path: "hw", + soc_specific: true, + shared_libs: [ + "android.hardware.wifi@1.0", + "android.hardware.wifi@1.1", + "android.hardware.wifi@1.2", + "android.hardware.wifi@1.3", + "android.hardware.wifi@1.4", + "android.hardware.wifi@1.5", + "libbase", + "libcutils", + "libhidlbase", + "liblog", + "libnl", + "libutils", + "libwifi-system-iface", + "libxml2", + ], + // Generated by building android.hardware.wifi@1.0-service-lib and printing LOCAL_CPPFLAGS. + cppflags: [ + "-Wall", + "-Werror", + "-Wextra", + "-DWIFI_HIDL_FEATURE_DUAL_INTERFACE", + ], + export_include_dirs: ["."], + include_dirs: ["external/libxml2/include"], +} -- GitLab From f2c2939b98d5fa7e1b6d81ed4fcaf69f774e4ac8 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 9 Dec 2021 10:18:39 -0800 Subject: [PATCH 321/825] uwb(hal): Add HAL API for session initialization Bug: 209990508 Test: atest VtsHalUwbTargetTest Change-Id: I7d10062cb3854ab39717d93a6eadba9dde99330d --- .../current/android/hardware/uwb/IUwbChip.aidl | 1 + uwb/aidl/android/hardware/uwb/IUwbChip.aidl | 8 ++++++++ uwb/aidl/default/uwb_chip.cpp | 4 ++++ uwb/aidl/default/uwb_chip.h | 1 + uwb/aidl/vts/VtsHalUwbTargetTest.cpp | 5 +++++ 5 files changed, 19 insertions(+) diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl index c4cb47b07b..c7708f1e93 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl @@ -40,6 +40,7 @@ interface IUwbChip { void open(in android.hardware.uwb.IUwbClientCallback clientCallback); void close(); void coreInit(); + void sessionInit(int sessionId); int getSupportedAndroidUciVersion(); long getSupportedAndroidCapabilities(); int sendUciMessage(in byte[] data); diff --git a/uwb/aidl/android/hardware/uwb/IUwbChip.aidl b/uwb/aidl/android/hardware/uwb/IUwbChip.aidl index 0c986116aa..f2bb0f114f 100644 --- a/uwb/aidl/android/hardware/uwb/IUwbChip.aidl +++ b/uwb/aidl/android/hardware/uwb/IUwbChip.aidl @@ -49,6 +49,14 @@ interface IUwbChip { */ void coreInit(); + /** + * Perform any necessary UWB session initializations. + * This must be invoked by the framework at the beginging of every new ranging session. + * + * @param sessionId Session identifier as defined in the UCI specification. + */ + void sessionInit(int sessionId); + /** * Supported version of vendor UCI specification. * diff --git a/uwb/aidl/default/uwb_chip.cpp b/uwb/aidl/default/uwb_chip.cpp index 10dbdb6e5b..a5a3f4a123 100644 --- a/uwb/aidl/default/uwb_chip.cpp +++ b/uwb/aidl/default/uwb_chip.cpp @@ -51,6 +51,10 @@ UwbChip::~UwbChip() {} return ndk::ScopedAStatus::ok(); } +::ndk::ScopedAStatus UwbChip::sessionInit(int /* sessionId */) { + return ndk::ScopedAStatus::ok(); +} + ::ndk::ScopedAStatus UwbChip::getSupportedAndroidUciVersion(int32_t* version) { *version = kAndroidUciVersion; return ndk::ScopedAStatus::ok(); diff --git a/uwb/aidl/default/uwb_chip.h b/uwb/aidl/default/uwb_chip.h index ca97120b3a..46cecd4739 100644 --- a/uwb/aidl/default/uwb_chip.h +++ b/uwb/aidl/default/uwb_chip.h @@ -37,6 +37,7 @@ class UwbChip : public BnUwbChip { ::ndk::ScopedAStatus open(const std::shared_ptr& clientCallback) override; ::ndk::ScopedAStatus close() override; ::ndk::ScopedAStatus coreInit() override; + ::ndk::ScopedAStatus sessionInit(int sesionId) override; ::ndk::ScopedAStatus getSupportedAndroidUciVersion(int32_t* version) override; ::ndk::ScopedAStatus getSupportedAndroidCapabilities(int64_t* capabilities) override; ::ndk::ScopedAStatus sendUciMessage(const std::vector& data, diff --git a/uwb/aidl/vts/VtsHalUwbTargetTest.cpp b/uwb/aidl/vts/VtsHalUwbTargetTest.cpp index 3820c0fc1d..1da4432e47 100644 --- a/uwb/aidl/vts/VtsHalUwbTargetTest.cpp +++ b/uwb/aidl/vts/VtsHalUwbTargetTest.cpp @@ -166,6 +166,11 @@ TEST_P(UwbAidl, ChipCoreInit) { EXPECT_TRUE(iuwb_chip->coreInit().isOk()); } +TEST_P(UwbAidl, ChipSessionInit) { + const auto iuwb_chip = getAnyChipAndOpen(); + EXPECT_TRUE(iuwb_chip->sessionInit(0).isOk()); +} + TEST_P(UwbAidl, ChipGetSupportedAndroidUciVersion) { const auto iuwb_chip = getAnyChipAndOpen(); EXPECT_TRUE(iuwb_chip->coreInit().isOk()); -- GitLab From dc205e077ed1d8f2389e7da586da053a53066e56 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Thu, 9 Dec 2021 18:54:17 -0800 Subject: [PATCH 322/825] [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces Added SPDX-license-identifier-Apache-2.0 to: bluetooth/audio/aidl/Android.bp wifi/netlinkinterceptor/aidl/default/Android.bp wifi/netlinkinterceptor/libnlinterceptor/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Change-Id: I4c18be830a5c0928d1a58f1e8e52067a2d6db66d --- bluetooth/audio/aidl/Android.bp | 9 +++++++++ wifi/netlinkinterceptor/aidl/default/Android.bp | 9 +++++++++ wifi/netlinkinterceptor/libnlinterceptor/Android.bp | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/bluetooth/audio/aidl/Android.bp b/bluetooth/audio/aidl/Android.bp index 60da877af2..12eed55072 100644 --- a/bluetooth/audio/aidl/Android.bp +++ b/bluetooth/audio/aidl/Android.bp @@ -12,6 +12,15 @@ // 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.bluetooth.audio", vendor_available: true, diff --git a/wifi/netlinkinterceptor/aidl/default/Android.bp b/wifi/netlinkinterceptor/aidl/default/Android.bp index 686ff19c3d..5227e51fac 100644 --- a/wifi/netlinkinterceptor/aidl/default/Android.bp +++ b/wifi/netlinkinterceptor/aidl/default/Android.bp @@ -14,6 +14,15 @@ // 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.net.nlinterceptor-service.default", init_rc: ["nlinterceptor-default.rc"], diff --git a/wifi/netlinkinterceptor/libnlinterceptor/Android.bp b/wifi/netlinkinterceptor/libnlinterceptor/Android.bp index a5e17668c3..00cae320dd 100644 --- a/wifi/netlinkinterceptor/libnlinterceptor/Android.bp +++ b/wifi/netlinkinterceptor/libnlinterceptor/Android.bp @@ -14,6 +14,15 @@ // 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_defaults { name: "nlinterceptor@defaults", cpp_std: "experimental", -- GitLab From beea10e8e63cfcc80810ffaf87c80770c101d2d5 Mon Sep 17 00:00:00 2001 From: ramindani Date: Tue, 7 Dec 2021 21:02:49 +0000 Subject: [PATCH 323/825] Set the thread pool count to 4 for vts3 tests. Thread priority is from https://source.corp.google.com/android/frameworks/native/services/surfaceflinger/main_surfaceflinger.cpp;rcl=e9cdd276a89d512137f22650da0c45ee4b28bd66;l=97 Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 207005096 Change-Id: Ic37b454c4ae3990fd8cb38fcdd50747083b2528c --- .../VtsHalGraphicsComposer3_TargetTest.cpp | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 7a20a53e3b..0d71b683b3 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1950,5 +1950,41 @@ int main(int argc, char** argv) { ALOGE("Failed to stop init.svc.surfaceflinger"); return -1; } + + android::ProcessState::self()->setThreadPoolMaxThreadCount(4); + + // The binder threadpool we start will inherit sched policy and priority + // of (this) creating thread. We want the binder thread pool to have + // SCHED_FIFO policy and priority 1 (lowest RT priority) + // Once the pool is created we reset this thread's priority back to + // original. + // This thread policy is based on what we do in the SurfaceFlinger while starting + // the thread pool and we need to replicate that for the VTS tests. + int newPriority = 0; + int origPolicy = sched_getscheduler(0); + struct sched_param origSchedParam; + + int errorInPriorityModification = sched_getparam(0, &origSchedParam); + if (errorInPriorityModification == 0) { + int policy = SCHED_FIFO; + newPriority = sched_get_priority_min(policy); + + struct sched_param param; + param.sched_priority = newPriority; + + errorInPriorityModification = sched_setscheduler(0, policy, ¶m); + } + + // start the thread pool + android::ProcessState::self()->startThreadPool(); + + // Reset current thread's policy and priority + if (errorInPriorityModification == 0) { + errorInPriorityModification = sched_setscheduler(0, origPolicy, &origSchedParam); + } else { + ALOGE("Failed to set VtsHalGraphicsComposer3_TargetTest binder threadpool priority to " + "SCHED_FIFO"); + } + return RUN_ALL_TESTS(); } -- GitLab From 08103076edd3991e43f2b385e953a2b923e58778 Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Thu, 9 Dec 2021 18:30:49 +0000 Subject: [PATCH 324/825] Add NanoappRpcService to Context Hub HAL Bug: 194287786 Test: Run VTS Change-Id: I8c100f73571f8f0c8689766328a430d0e457dc55 --- .../hardware/contexthub/NanoappInfo.aidl | 1 + .../contexthub/NanoappRpcService.aidl | 39 +++++++++++++++++ .../hardware/contexthub/NanoappInfo.aidl | 7 ++++ .../contexthub/NanoappRpcService.aidl | 42 +++++++++++++++++++ .../vts/VtsAidlHalContextHubTargetTest.cpp | 9 ++++ 5 files changed, 98 insertions(+) create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappRpcService.aidl create mode 100644 contexthub/aidl/android/hardware/contexthub/NanoappRpcService.aidl diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappInfo.aidl index ea7825aad2..7175d7f329 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappInfo.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappInfo.aidl @@ -38,4 +38,5 @@ parcelable NanoappInfo { int nanoappVersion; boolean enabled; String[] permissions; + android.hardware.contexthub.NanoappRpcService[] rpcServices; } diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappRpcService.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappRpcService.aidl new file mode 100644 index 0000000000..a6a1644195 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappRpcService.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 -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 NanoappRpcService { + long id; + int version; +} diff --git a/contexthub/aidl/android/hardware/contexthub/NanoappInfo.aidl b/contexthub/aidl/android/hardware/contexthub/NanoappInfo.aidl index 9991dc8fff..77ac0262b4 100644 --- a/contexthub/aidl/android/hardware/contexthub/NanoappInfo.aidl +++ b/contexthub/aidl/android/hardware/contexthub/NanoappInfo.aidl @@ -16,6 +16,8 @@ package android.hardware.contexthub; +import android.hardware.contexthub.NanoappRpcService; + @VintfStability parcelable NanoappInfo { /** The unique identifier of the nanoapp. */ @@ -39,4 +41,9 @@ parcelable NanoappInfo { * this list. */ String[] permissions; + + /** + * The list of RPC services supported by this nanoapp. + */ + NanoappRpcService[] rpcServices; } diff --git a/contexthub/aidl/android/hardware/contexthub/NanoappRpcService.aidl b/contexthub/aidl/android/hardware/contexthub/NanoappRpcService.aidl new file mode 100644 index 0000000000..6dc5e955e7 --- /dev/null +++ b/contexthub/aidl/android/hardware/contexthub/NanoappRpcService.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. + */ + +package android.hardware.contexthub; + +/** + * An RPC service exposed by a nanoapp. + * + * The implementation of the RPC interface is not defined by the HAL, and is written + * at the messaging endpoint layers (Android app and/or CHRE nanoapp). NanoappRpcService + * contains the informational metadata to be consumed by the RPC interface layer. + */ +@VintfStability +parcelable NanoappRpcService { + /** + * The unique 64-bit ID of an RPC service exposed by a nanoapp. Note that + * the uniqueness is only required within the nanoapp's domain (i.e. the + * combination of the nanoapp ID and service id must be unique). + */ + long id; + + /** + * The software version of this service, which follows the semantic + * versioning scheme (see semver.org). It follows the format + * major.minor.patch, where major and minor versions take up one byte + * each, and the patch version takes up the final 2 bytes. + */ + int version; +} diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp index 1b2dc29290..392e23c9c1 100644 --- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp +++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp @@ -41,6 +41,7 @@ using ::android::hardware::contexthub::IContextHub; using ::android::hardware::contexthub::IContextHubCallbackDefault; using ::android::hardware::contexthub::NanoappBinary; using ::android::hardware::contexthub::NanoappInfo; +using ::android::hardware::contexthub::NanoappRpcService; using ::android::hardware::contexthub::Setting; using ::android::hardware::contexthub::vts_utils::kNonExistentAppId; using ::android::hardware::contexthub::vts_utils::waitForCallback; @@ -151,6 +152,14 @@ TEST_P(ContextHubAidl, TestQueryApps) { for (const NanoappInfo& appInfo : appInfoList) { EXPECT_NE(appInfo.nanoappId, UINT64_C(0)); EXPECT_NE(appInfo.nanoappId, kNonExistentAppId); + + // Verify services are unique. + std::set existingServiceIds; + for (const NanoappRpcService& rpcService : appInfo.rpcServices) { + EXPECT_NE(rpcService.id, UINT64_C(0)); + EXPECT_EQ(existingServiceIds.count(rpcService.id), 0); + existingServiceIds.insert(rpcService.id); + } } } -- GitLab From 5ad93755c898c05780701db898f62ce306933ac5 Mon Sep 17 00:00:00 2001 From: Rucha Katakwar Date: Wed, 27 Oct 2021 15:58:11 -0700 Subject: [PATCH 325/825] Camera: Add 3.8 version of ICameraDevice. The new version of ICameraDevice supports interfaces for torch strength control feature. New VTS test has been added to test the emulator HAL-side implementation of the newly added interfaces. bug: 200174275 Test: Camera VTS test pass. Change-Id: Ia5652a96e09bd716b5079fe9ed071dffc53b5b12 --- camera/device/3.8/ICameraDevice.hal | 78 +++++++++ .../VtsHalCameraProviderV2_4TargetTest.cpp | 149 ++++++++++++++++++ 2 files changed, 227 insertions(+) diff --git a/camera/device/3.8/ICameraDevice.hal b/camera/device/3.8/ICameraDevice.hal index 448f176220..1101819a4d 100644 --- a/camera/device/3.8/ICameraDevice.hal +++ b/camera/device/3.8/ICameraDevice.hal @@ -16,6 +16,7 @@ package android.hardware.camera.device@3.8; +import android.hardware.camera.common@1.0::Status; import @3.7::ICameraDevice; /** @@ -29,4 +30,81 @@ import @3.7::ICameraDevice; * @3.7::ICameraDeviceSession. */ interface ICameraDevice extends @3.7::ICameraDevice { + /** + * turnOnTorchWithStrengthLevel: + * + * Change the brightness level of the flash unit associated with this camera device + * and set it to value in torchStrength. This function also turns ON the torch + * with specified torchStrength if the torch is OFF. + * + * The torchStrength value must be within the valid range i.e. >=1 and + * <= FLASH_INFO_STRENGTH_MAXIMUM_LEVEL. Whenever the torch is turned OFF, + * the brightness level will reset to FLASH_INFO_STRENGTH_DEFAULT_LEVEL. + * When the client calls setTorchMode(ON) after turnOnTorchWithStrengthLevel(N), + * the flash unit will have brightness level equal to N. This level does not + * represent the real brightness units. It is linear in nature i.e. flashlight + * at level 10 is twice as bright as at level 5. + * + * @param torchStrength Brightness level to be set for the flashlight. + * + * @return status Status code for the operation, one of: + * OK: + * On a successful change to the torch strength level. + * INTERNAL_ERROR: + * The flash unit cannot be operated due to an unexpected internal + * error. + * CAMERA_IN_USE: + * This status code is returned when: + * - This camera device has been opened, so the torch cannot be + * controlled until it is closed. + * - Due to other camera devices being open, or due to other + * resource constraints, the torch cannot be controlled currently. + * ILLEGAL_ARGUMENT: + * If the torchStrength value is not within the range i.e. < 1 or + * > FLASH_INFO_STRENGTH_MAXIMUM_LEVEL. + * METHOD_NOT_SUPPORTED: + * This status code is returned when: + * - This camera device does not support direct operation of flashlight + * torch mode. The framework must open the camera device and turn + * the torch on through the device interface. + * - This camera device does not have a flash unit. + * - This camera device has flash unit but does not support torch + * strength control. + * 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. + * + */ + turnOnTorchWithStrengthLevel(int32_t torchStrength) generates (Status status); + + /** + * getTorchStrengthLevel: + * + * Get current torch strength level. + * If the device supports torch strength control, when the torch is OFF the + * strength level will reset to default level, so the return + * value in this case will be equal to FLASH_INFO_STRENGTH_DEFAULT_LEVEL. + * + * @return status Status code for the operation, one of: + * OK: + * On success. + * INTERNAL_ERROR: + * An unexpected error occurred and the information is not + * available. + * METHOD_NOT_SUPPORTED: + * This status code is returned when: + * - This camera device does not support direct operation of flashlight + * torch mode. The framework must open the camera device and turn + * the torch on through the device interface. + * - This camera device does not have a flash unit. + * - This camera device has flash unit but does not support torch + * strength control. + * + * @return torchStrength Current torch strength level. + * + */ + getTorchStrengthLevel() generates (Status status, int32_t torchStrength); }; diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index 77974fcbe4..01ec9cb2fc 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -911,6 +912,7 @@ public: uint32_t* outBufSize); static Status isConstrainedModeAvailable(camera_metadata_t *staticMeta); static Status isLogicalMultiCamera(const camera_metadata_t *staticMeta); + static bool isTorchStrengthControlSupported(const camera_metadata_t *staticMeta); static Status isOfflineSessionSupported(const camera_metadata_t *staticMeta); static Status getPhysicalCameraIds(const camera_metadata_t *staticMeta, std::unordered_set *physicalIds/*out*/); @@ -2933,6 +2935,137 @@ TEST_P(CameraHidlTest, getCameraCharacteristics) { } } +// Verify that the torch strength level can be set and retrieved successfully. +TEST_P(CameraHidlTest, turnOnTorchWithStrengthLevel) { + hidl_vec cameraDeviceNames = getCameraDeviceNames(mProvider); + bool torchControlSupported = false; + bool torchStrengthControlSupported = false; + Return ret; + + ret = mProvider->isSetTorchModeSupported([&](auto status, bool support) { + ALOGI("isSetTorchModeSupported returns status:%d supported:%d", (int)status, support); + ASSERT_EQ(Status::OK, status); + torchControlSupported = support; + }); + + sp cb = new TorchProviderCb(this); + Return returnStatus = mProvider->setCallback(cb); + ASSERT_TRUE(returnStatus.isOk()); + ASSERT_EQ(Status::OK, returnStatus); + + for (const auto& name : cameraDeviceNames) { + int deviceVersion = getCameraDeviceVersion(name, mProviderType); + int32_t defaultLevel; + switch (deviceVersion) { + case CAMERA_DEVICE_API_VERSION_3_8: { + ::android::sp<::android::hardware::camera::device::V3_8::ICameraDevice> device3_8; + ALOGI("%s: Testing camera device %s", __FUNCTION__, name.c_str()); + ret = mProvider->getCameraDeviceInterface_V3_x( + name, [&](auto status, const auto& device) { + ASSERT_EQ(Status::OK, status); + ASSERT_NE(device, nullptr); + auto castResult = device::V3_8::ICameraDevice::castFrom(device); + ASSERT_TRUE(castResult.isOk()); + device3_8 = castResult; + }); + ASSERT_TRUE(ret.isOk()); + + ret = device3_8->getCameraCharacteristics([&] (auto s, const auto& chars) { + ASSERT_EQ(Status::OK, s); + const camera_metadata_t* staticMeta = + reinterpret_cast(chars.data()); + ASSERT_NE(nullptr, staticMeta); + torchStrengthControlSupported = isTorchStrengthControlSupported(staticMeta); + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry(staticMeta, + ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL, &entry); + if (torchStrengthControlSupported) { + ASSERT_EQ(rc, 0); + ASSERT_GT(entry.count, 0); + defaultLevel = *entry.data.i32; + ALOGI("Default level is:%d", defaultLevel); + } + }); + ASSERT_TRUE(ret.isOk()); + // If torchStrengthControl is supported, torchControlSupported should be true. + if (torchStrengthControlSupported) { + ASSERT_TRUE(torchControlSupported); + } + mTorchStatus = TorchModeStatus::NOT_AVAILABLE; + returnStatus = device3_8->turnOnTorchWithStrengthLevel(2); + ASSERT_TRUE(returnStatus.isOk()); + // Method_not_supported check + if (!torchStrengthControlSupported) { + ALOGI("Torch strength control not supported."); + ASSERT_EQ(Status::METHOD_NOT_SUPPORTED, returnStatus); + } else { + ASSERT_EQ(Status::OK, returnStatus); + if (returnStatus == Status::OK) { + { + std::unique_lock l(mTorchLock); + while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kTorchTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l, + timeout)); + } + ASSERT_EQ(TorchModeStatus::AVAILABLE_ON, mTorchStatus); + mTorchStatus = TorchModeStatus::NOT_AVAILABLE; + } + ALOGI("getTorchStrengthLevel: Testing"); + ret = device3_8->getTorchStrengthLevel([&] + (auto status, const auto& strengthLevel) { + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(Status::OK, status); + ALOGI("Torch strength level is : %d", strengthLevel); + ASSERT_EQ(strengthLevel, 2); + }); + // Turn OFF the torch and verify torch strength level is reset to default level. + ALOGI("Testing torch strength level reset after turning the torch OFF."); + returnStatus = device3_8->setTorchMode(TorchMode::OFF); + ASSERT_TRUE(returnStatus.isOk()); + ASSERT_EQ(Status::OK, returnStatus); + { + std::unique_lock l(mTorchLock); + while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kTorchTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l, + timeout)); + } + ASSERT_EQ(TorchModeStatus::AVAILABLE_OFF, mTorchStatus); + } + ret = device3_8->getTorchStrengthLevel([&] + (auto status, const auto& strengthLevel) { + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(Status::OK, status); + ALOGI("Torch strength level after turning OFF torch is : %d", + strengthLevel); + ASSERT_EQ(strengthLevel, defaultLevel); + }); + } + } + } + break; + case CAMERA_DEVICE_API_VERSION_3_7: + case CAMERA_DEVICE_API_VERSION_3_6: + case CAMERA_DEVICE_API_VERSION_3_5: + case CAMERA_DEVICE_API_VERSION_3_4: + case CAMERA_DEVICE_API_VERSION_3_3: + case CAMERA_DEVICE_API_VERSION_3_2: + case CAMERA_DEVICE_API_VERSION_1_0: { + ALOGI("Torch strength control feature not supported."); + } + break; + default: { + ALOGI("Invalid device version."); + ADD_FAILURE(); + } + break; + } + } +} + //In case it is supported verify that torch can be enabled. //Check for corresponding toch callbacks as well. TEST_P(CameraHidlTest, setTorchMode) { @@ -6600,6 +6733,22 @@ Status CameraHidlTest::isLogicalMultiCamera(const camera_metadata_t *staticMeta) return ret; } +bool CameraHidlTest::isTorchStrengthControlSupported(const camera_metadata_t *staticMetadata) { + int32_t maxLevel = 0; + camera_metadata_ro_entry maxEntry; + int rc = find_camera_metadata_ro_entry(staticMetadata, + ANDROID_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL, &maxEntry); + if (rc != 0) { + return false; + } + maxLevel = *maxEntry.data.i32; + if (maxLevel > 1) { + ALOGI("Torch strength control supported."); + return true; + } + return false; +} + // Check if the camera device has logical multi-camera capability. Status CameraHidlTest::isOfflineSessionSupported(const camera_metadata_t *staticMeta) { Status ret = Status::METHOD_NOT_SUPPORTED; -- GitLab From 3e777942d85bf61b57703738c8696b9a5f055d4c Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Thu, 9 Dec 2021 13:07:09 -0800 Subject: [PATCH 326/825] Add UsageSetting to IRadioNetwork Add usage setting to IRadioNetwork(Response) and the associated enum. Expose the cellular usage setting to Android to be able to query and set the modem to operate in a data-centric mode or a voice-centric mode. This facilitates "companion" subscriptions that might be data-only and allows voice-centric devices to operate in data-centric mode on networks that do not support voice service. Bug: 210023167 Test: compilation Change-Id: I61b559589a51d139374dc52599201b6412d93da5 --- .../hardware/radio/network/IRadioNetwork.aidl | 2 + .../radio/network/IRadioNetworkResponse.aidl | 2 + .../hardware/radio/network/UsageSetting.aidl | 39 ++++++++++++++++++ .../hardware/radio/network/IRadioNetwork.aidl | 22 ++++++++++ .../radio/network/IRadioNetworkResponse.aidl | 27 +++++++++++++ .../hardware/radio/network/UsageSetting.aidl | 40 +++++++++++++++++++ 6 files changed, 132 insertions(+) create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UsageSetting.aidl create mode 100644 radio/aidl/android/hardware/radio/network/UsageSetting.aidl 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 16433be238..c6187913dd 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 @@ -68,4 +68,6 @@ interface IRadioNetwork { oneway void startNetworkScan(in int serial, in android.hardware.radio.network.NetworkScanRequest request); oneway void stopNetworkScan(in int serial); oneway void supplyNetworkDepersonalization(in int serial, in String netPin); + oneway void setUsageSetting(in int serial, in android.hardware.radio.network.UsageSetting usageSetting); + oneway void getUsageSetting(in int serial); } 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 ff953964b7..8cf4c31149 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 @@ -67,4 +67,6 @@ interface IRadioNetworkResponse { oneway void startNetworkScanResponse(in android.hardware.radio.RadioResponseInfo info); oneway void stopNetworkScanResponse(in android.hardware.radio.RadioResponseInfo info); oneway void supplyNetworkDepersonalizationResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void setUsageSettingResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getUsageSettingResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.UsageSetting usageSetting); } 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 new file mode 100644 index 0000000000..7fdf8313d3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UsageSetting.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 -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; +@Backing(type="int") @VintfStability +enum UsageSetting { + VOICE_CENTRIC = 1, + DATA_CENTRIC = 2, +} diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl index 1081a75ae9..aaf432aaaa 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl @@ -27,6 +27,7 @@ import android.hardware.radio.network.NrDualConnectivityState; import android.hardware.radio.network.RadioAccessSpecifier; import android.hardware.radio.network.RadioBandMode; import android.hardware.radio.network.SignalThresholdInfo; +import android.hardware.radio.network.UsageSetting; /** * This interface is used by telephony and telecom to talk to cellular radio for network APIs. @@ -416,4 +417,25 @@ oneway interface IRadioNetwork { * Response function is IRadioNetworkResponse.supplyNetworkDepersonalizationResponse() */ void supplyNetworkDepersonalization(in int serial, in String netPin); + + /** + * Set the UE usage setting for data/voice centric usage. + * + *

Sets the usage setting in accordance with 3gpp 24.301 sec 4.3 and 3gpp 24.501 sec 4.3. + *

This value must be independently preserved for each SIM; (setting the value is not a + * "global" override). + * + * @param serial Serial number of request. + * @param usageSetting the usage setting for the current SIM. + */ + oneway void setUsageSetting(in int serial, in UsageSetting usageSetting); + + /** + * Get the UE usage setting for data/voice centric usage. + * + *

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. + */ + oneway void getUsageSetting(in int serial); } diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl index 429b5a8766..30f422101b 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl @@ -31,6 +31,7 @@ import android.hardware.radio.network.RadioAccessSpecifier; import android.hardware.radio.network.RadioBandMode; import android.hardware.radio.network.RegStateResult; import android.hardware.radio.network.SignalStrength; +import android.hardware.radio.network.UsageSetting; /** * Interface declaring response functions to solicited radio requests for network APIs. @@ -549,4 +550,30 @@ oneway interface IRadioNetworkResponse { * RadioError:SIM_ABSENT */ void supplyNetworkDepersonalizationResponse(in RadioResponseInfo info, in int remainingRetries); + + /** + * @param info Response info struct containing response type, serial no. and error. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_STATE + * RadioError:INVALID_ARGUMENTS + * RadioError:INTERNAL_ERR + * RadioError:SIM_ABSENT + */ + oneway void setUsageSettingResponse(in RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error. + * @param usageSetting the usage setting for the current SIM. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INVALID_STATE + * RadioError:INTERNAL_ERR + * RadioError:SIM_ABSENT + */ + oneway void getUsageSettingResponse(in RadioResponseInfo info, in UsageSetting usageSetting); } diff --git a/radio/aidl/android/hardware/radio/network/UsageSetting.aidl b/radio/aidl/android/hardware/radio/network/UsageSetting.aidl new file mode 100644 index 0000000000..ba8fe93f55 --- /dev/null +++ b/radio/aidl/android/hardware/radio/network/UsageSetting.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. + */ + +package android.hardware.radio.network; + +/** + * Cellular usage setting with values according to 3gpp 24.301 sec 4.3 and 3gpp 24.501 sec 4.3. + * + *

Also refer to "UE's usage setting" as defined in 3gpp 24.301 section 3.1 and 3gpp 23.221 + * Annex A. + */ +@VintfStability +@Backing(type="int") +enum UsageSetting { + /** + * UE operates in voice-centric mode. Generally speaking, in this mode of operation, the UE + * will not remain camped on a cell or attached to a network unless that cell/network provides + * voice service. + */ + VOICE_CENTRIC = 1, + + /** + * UE operates in data-centric mode. Generally speaking, in this mode of operation, the UE + * will not reselect away from a cell/network that only provides data services. + */ + DATA_CENTRIC = 2, +} -- GitLab From 055c02fcfb27d75b8aaf22a8a677296b767fa1d0 Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Mon, 13 Dec 2021 11:15:38 -0800 Subject: [PATCH 327/825] UsageSetting Compat Stubs Bug: 210023167 Test: make android.hardware.radio-library.compat Change-Id: Iea5e016878f375608a167ad0fdc232fd2e743fa6 --- .../include/libradiocompat/RadioNetwork.h | 4 ++++ .../libradiocompat/network/RadioNetwork.cpp | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h index c776fd1f09..09ae240dbc 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h @@ -88,6 +88,10 @@ class RadioNetwork : public RadioCompatBase, ::ndk::ScopedAStatus stopNetworkScan(int32_t serial) override; ::ndk::ScopedAStatus supplyNetworkDepersonalization(int32_t serial, const std::string& netPin) override; + ::ndk::ScopedAStatus setUsageSetting( + int32_t serial, + ::aidl::android::hardware::radio::network::UsageSetting usageSetting) override; + ::ndk::ScopedAStatus getUsageSetting(int32_t serial) override; public: using RadioCompatBase::RadioCompatBase; diff --git a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp index af0bc4619f..5fa1cf5da3 100644 --- a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp +++ b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp @@ -278,4 +278,19 @@ ScopedAStatus RadioNetwork::supplyNetworkDepersonalization(int32_t ser, const st return ok(); } +// TODO(b/210498497): is there a cleaner way to send a response back to Android, even though these +// methods must never be called? +ScopedAStatus RadioNetwork::setUsageSetting( + int32_t ser, ::aidl::android::hardware::radio::network::UsageSetting) { + LOG_CALL << ser; + LOG(ERROR) << "setUsageSetting is unsupported by HIDL HALs"; + return ok(); +} + +ScopedAStatus RadioNetwork::getUsageSetting(int32_t ser) { + LOG_CALL << ser; + LOG(ERROR) << "getUsageSetting is unsupported by HIDL HALs"; + return ok(); +} + } // namespace android::hardware::radio::compat -- GitLab From c26756d5eea27fabf51e252f27af5760d35a8d37 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Thu, 2 Dec 2021 23:29:17 -0800 Subject: [PATCH 328/825] composer: move LayerCommand to be part of DisplayCommand This CL also includes a few miscellaneous changes: - Remove ..composer3.command namespace (so all commands are in composer3) - Minor documentation update - Minor name changes Bug: 201008710 Test: VTS Change-Id: I3fc24392d6c019c39e4d7df735abacc2c793c4f9 --- .../exclude/fcm_exclude.cpp | 1 - graphics/composer/aidl/Android.bp | 1 - .../composer3/{command => }/Buffer.aidl | 2 +- .../composer3/ChangedCompositionLayer.aidl | 39 +++++ .../composer3/ChangedCompositionTypes.aidl | 39 +++++ .../composer3/{command => }/ClientTarget.aidl | 4 +- .../ClientTargetPropertyWithNits.aidl | 2 +- .../{command => }/ColorTransformPayload.aidl | 2 +- .../{command/Error.aidl => CommandError.aidl} | 4 +- ...onTypes.aidl => CommandResultPayload.aidl} | 18 +- .../{command => }/DisplayCommand.aidl | 9 +- .../{command => }/DisplayRequest.aidl | 4 +- .../{command => }/GenericMetadata.aidl | 2 +- .../graphics/composer3/IComposerClient.aidl | 2 +- .../composer3/{command => }/LayerCommand.aidl | 21 ++- .../{command => }/ParcelableBlendMode.aidl | 2 +- .../{command => }/ParcelableComposition.aidl | 2 +- .../{command => }/ParcelableDataspace.aidl | 2 +- .../{command => }/ParcelableTransform.aidl | 2 +- .../composer3/{command => }/PlaneAlpha.aidl | 2 +- .../composer3/{command => }/PresentFence.aidl | 2 +- .../{command => }/PresentOrValidate.aidl | 4 +- .../{command => }/ReleaseFences.aidl | 4 +- .../{command => }/WhitePointNits.aidl | 2 +- .../composer3/{command => }/ZOrder.aidl | 2 +- .../composer3/command/CommandPayload.aidl | 39 ----- .../command/CommandResultPayload.aidl | 44 ----- .../composer3/{command => }/Buffer.aidl | 2 +- .../composer3/ChangedCompositionLayer.aidl | 33 ++++ .../ChangedCompositionTypes.aidl | 19 +- .../composer3/{command => }/ClientTarget.aidl | 4 +- .../ClientTargetPropertyWithNits.aidl | 2 +- .../{command => }/ColorTransformPayload.aidl | 2 +- .../{command/Error.aidl => CommandError.aidl} | 4 +- .../{command => }/CommandResultPayload.aidl | 20 +-- .../{command => }/DisplayCommand.aidl | 15 +- .../{command => }/DisplayRequest.aidl | 2 +- .../{command => }/GenericMetadata.aidl | 2 +- .../graphics/composer3/IComposerClient.aidl | 6 +- .../composer3/{command => }/LayerCommand.aidl | 26 ++- .../{command => }/ParcelableBlendMode.aidl | 2 +- .../{command => }/ParcelableComposition.aidl | 2 +- .../{command => }/ParcelableDataspace.aidl | 2 +- .../{command => }/ParcelableTransform.aidl | 2 +- .../composer3/{command => }/PlaneAlpha.aidl | 2 +- .../composer3/{command => }/PresentFence.aidl | 2 +- .../{command => }/PresentOrValidate.aidl | 2 +- .../{command => }/ReleaseFences.aidl | 2 +- .../{command => }/WhitePointNits.aidl | 2 +- .../composer3/{command => }/ZOrder.aidl | 2 +- .../composer3/command/CommandPayload.aidl | 30 ---- .../graphics/composer3/translate-ndk.cpp | 11 +- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 2 +- .../VtsHalGraphicsComposer3_TargetTest.cpp | 2 +- .../graphics/composer3/command-buffer.h | 162 +++++++++--------- 55 files changed, 300 insertions(+), 321 deletions(-) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/Buffer.aidl (97%) create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/ClientTarget.aidl (94%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/ClientTargetPropertyWithNits.aidl (97%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/ColorTransformPayload.aidl (97%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command/Error.aidl => CommandError.aidl} (96%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command/ChangedCompositionTypes.aidl => CommandResultPayload.aidl} (74%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/DisplayCommand.aidl (84%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/DisplayRequest.aidl (93%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/GenericMetadata.aidl (97%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/LayerCommand.aidl (75%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/ParcelableBlendMode.aidl (97%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/ParcelableComposition.aidl (97%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/ParcelableDataspace.aidl (97%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/ParcelableTransform.aidl (97%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/PlaneAlpha.aidl (97%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/PresentFence.aidl (97%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/PresentOrValidate.aidl (93%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/ReleaseFences.aidl (93%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/WhitePointNits.aidl (97%) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{command => }/ZOrder.aidl (97%) delete mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandPayload.aidl delete mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandResultPayload.aidl rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/Buffer.aidl (96%) create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/ChangedCompositionTypes.aidl (72%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/ClientTarget.aidl (90%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/ClientTargetPropertyWithNits.aidl (95%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/ColorTransformPayload.aidl (95%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command/Error.aidl => CommandError.aidl} (92%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/CommandResultPayload.aidl (85%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/DisplayCommand.aidl (93%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/DisplayRequest.aidl (97%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/GenericMetadata.aidl (95%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/LayerCommand.aidl (93%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/ParcelableBlendMode.aidl (93%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/ParcelableComposition.aidl (93%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/ParcelableDataspace.aidl (93%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/ParcelableTransform.aidl (93%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/PlaneAlpha.aidl (94%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/PresentFence.aidl (94%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/PresentOrValidate.aidl (94%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/ReleaseFences.aidl (95%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/WhitePointNits.aidl (95%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{command => }/ZOrder.aidl (94%) delete mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandPayload.aidl diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp index 720a76769c..2aa4bb2a22 100644 --- a/compatibility_matrices/exclude/fcm_exclude.cpp +++ b/compatibility_matrices/exclude/fcm_exclude.cpp @@ -56,7 +56,6 @@ bool ShouldCheckMissingHalsInFcm(const std::string& package) { "android.hardware.common", "android.hardware.common.fmq", "android.hardware.graphics.common", - "android.hardware.graphics.composer3.command", "android.hardware.keymaster", "android.hardware.radio", "android.hardware.uwb.fira_android", diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp index 903413886a..5f5b54ec7c 100644 --- a/graphics/composer/aidl/Android.bp +++ b/graphics/composer/aidl/Android.bp @@ -33,7 +33,6 @@ aidl_interface { }, srcs: [ "android/hardware/graphics/composer3/*.aidl", - "android/hardware/graphics/composer3/command/*.aidl", ], stability: "vintf", imports: [ diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Buffer.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Buffer.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Buffer.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Buffer.aidl index cead848efd..a33ad23323 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Buffer.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Buffer.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable Buffer { int slot; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl new file mode 100644 index 0000000000..7e47ba8b5e --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionLayer.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 -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 ChangedCompositionLayer { + long layer; + android.hardware.graphics.composer3.Composition composition; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl new file mode 100644 index 0000000000..9a5ca9700d --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionTypes.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 -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 ChangedCompositionTypes { + long display; + android.hardware.graphics.composer3.ChangedCompositionLayer[] layers; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTarget.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl similarity index 94% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTarget.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl index c3f4700c55..7632707ec2 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTarget.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl @@ -31,10 +31,10 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ClientTarget { - android.hardware.graphics.composer3.command.Buffer buffer; + android.hardware.graphics.composer3.Buffer buffer; android.hardware.graphics.common.Dataspace dataspace; android.hardware.graphics.common.Rect[] damage; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl index b690a57596..f0fb22eb15 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ClientTargetPropertyWithNits { long display; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl index 0b3071c0fd..df07c9ca71 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ColorTransformPayload { float[] matrix; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Error.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandError.aidl similarity index 96% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Error.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandError.aidl index 1726ea5bb1..103bfdc689 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Error.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandError.aidl @@ -31,9 +31,9 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability -parcelable Error { +parcelable CommandError { int commandIndex; int errorCode; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl similarity index 74% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl index 1377c6c00d..ebbb31e59f 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl @@ -31,14 +31,14 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability -parcelable ChangedCompositionTypes { - long display; - android.hardware.graphics.composer3.command.ChangedCompositionTypes.Layer[] layers; - @VintfStability - parcelable Layer { - long layer; - android.hardware.graphics.composer3.Composition composition; - } +union CommandResultPayload { + android.hardware.graphics.composer3.CommandError error; + android.hardware.graphics.composer3.ChangedCompositionTypes changedCompositionTypes; + android.hardware.graphics.composer3.DisplayRequest displayRequest; + android.hardware.graphics.composer3.PresentFence presentFence; + android.hardware.graphics.composer3.ReleaseFences releaseFences; + android.hardware.graphics.composer3.PresentOrValidate presentOrValidateResult; + android.hardware.graphics.composer3.ClientTargetPropertyWithNits clientTargetProperty; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl similarity index 84% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayCommand.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl index 7446db02ad..2f5d00f698 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayCommand.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl @@ -31,13 +31,14 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable DisplayCommand { long display; - @nullable android.hardware.graphics.composer3.command.ColorTransformPayload colorTransform; - @nullable android.hardware.graphics.composer3.command.ClientTarget clientTarget; - @nullable android.hardware.graphics.composer3.command.Buffer virtualDisplayOutputBuffer; + android.hardware.graphics.composer3.LayerCommand[] layers; + @nullable android.hardware.graphics.composer3.ColorTransformPayload colorTransform; + @nullable android.hardware.graphics.composer3.ClientTarget clientTarget; + @nullable android.hardware.graphics.composer3.Buffer virtualDisplayOutputBuffer; boolean validateDisplay; boolean acceptDisplayChanges; boolean presentDisplay; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl similarity index 93% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayRequest.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl index 7f413a9b62..13462ce298 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayRequest.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl @@ -31,12 +31,12 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable DisplayRequest { long display; int mask; - android.hardware.graphics.composer3.command.DisplayRequest.LayerRequest[] layerRequests; + android.hardware.graphics.composer3.DisplayRequest.LayerRequest[] layerRequests; const int FLIP_CLIENT_TARGET = 1; const int WRITE_CLIENT_TARGET_TO_OUTPUT = 2; @VintfStability diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/GenericMetadata.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/GenericMetadata.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl index be889d8d44..c18529bb3f 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/GenericMetadata.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable GenericMetadata { android.hardware.graphics.composer3.LayerGenericMetadataKey key; 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 65cf86ccca..471721897e 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 @@ -38,7 +38,7 @@ interface IComposerClient { android.hardware.graphics.composer3.VirtualDisplay createVirtualDisplay(int width, int height, android.hardware.graphics.common.PixelFormat formatHint, int outputBufferSlotCount); void destroyLayer(long display, long layer); void destroyVirtualDisplay(long display); - android.hardware.graphics.composer3.command.CommandResultPayload[] executeCommands(in android.hardware.graphics.composer3.command.CommandPayload[] commands); + android.hardware.graphics.composer3.CommandResultPayload[] executeCommands(in android.hardware.graphics.composer3.DisplayCommand[] commands); int getActiveConfig(long display); android.hardware.graphics.composer3.ColorMode[] getColorModes(long display); float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/LayerCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl similarity index 75% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/LayerCommand.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl index b5adbc307d..bad72fcb5a 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/LayerCommand.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl @@ -31,29 +31,28 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable LayerCommand { - long display; long layer; @nullable android.hardware.graphics.common.Point cursorPosition; - @nullable android.hardware.graphics.composer3.command.Buffer buffer; + @nullable android.hardware.graphics.composer3.Buffer buffer; @nullable android.hardware.graphics.common.Rect[] damage; - @nullable android.hardware.graphics.composer3.command.ParcelableBlendMode blendMode; + @nullable android.hardware.graphics.composer3.ParcelableBlendMode blendMode; @nullable android.hardware.graphics.composer3.Color color; @nullable android.hardware.graphics.composer3.FloatColor floatColor; - @nullable android.hardware.graphics.composer3.command.ParcelableComposition composition; - @nullable android.hardware.graphics.composer3.command.ParcelableDataspace dataspace; + @nullable android.hardware.graphics.composer3.ParcelableComposition composition; + @nullable android.hardware.graphics.composer3.ParcelableDataspace dataspace; @nullable android.hardware.graphics.common.Rect displayFrame; - @nullable android.hardware.graphics.composer3.command.PlaneAlpha planeAlpha; + @nullable android.hardware.graphics.composer3.PlaneAlpha planeAlpha; @nullable android.hardware.common.NativeHandle sidebandStream; @nullable android.hardware.graphics.common.FRect sourceCrop; - @nullable android.hardware.graphics.composer3.command.ParcelableTransform transform; + @nullable android.hardware.graphics.composer3.ParcelableTransform transform; @nullable android.hardware.graphics.common.Rect[] visibleRegion; - @nullable android.hardware.graphics.composer3.command.ZOrder z; + @nullable android.hardware.graphics.composer3.ZOrder z; @nullable float[] colorTransform; - @nullable android.hardware.graphics.composer3.command.WhitePointNits whitePointNits; - @nullable android.hardware.graphics.composer3.command.GenericMetadata genericMetadata; + @nullable android.hardware.graphics.composer3.WhitePointNits whitePointNits; + @nullable android.hardware.graphics.composer3.GenericMetadata genericMetadata; @nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata; @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableBlendMode.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableBlendMode.aidl index 5e6d212c65..f1fee5f376 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableBlendMode.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ParcelableBlendMode { android.hardware.graphics.common.BlendMode blendMode; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableComposition.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableComposition.aidl index 40637a9f57..98fbb665e2 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableComposition.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ParcelableComposition { android.hardware.graphics.composer3.Composition composition; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableDataspace.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableDataspace.aidl index 8f06079421..76ecf85b9f 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableDataspace.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ParcelableDataspace { android.hardware.graphics.common.Dataspace dataspace; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableTransform.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableTransform.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableTransform.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableTransform.aidl index 6d6fe5b89f..b673656438 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableTransform.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableTransform.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ParcelableTransform { android.hardware.graphics.common.Transform transform; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PlaneAlpha.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PlaneAlpha.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PlaneAlpha.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PlaneAlpha.aidl index 97f5329817..c48c2a8a34 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PlaneAlpha.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PlaneAlpha.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable PlaneAlpha { float alpha; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentFence.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentFence.aidl index 906f20c74c..3bb09cdb34 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentFence.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable PresentFence { long display; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentOrValidate.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl similarity index 93% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentOrValidate.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl index 66f1c0356b..3514e5355a 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentOrValidate.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl @@ -31,11 +31,11 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable PresentOrValidate { long display; - android.hardware.graphics.composer3.command.PresentOrValidate.Result result; + android.hardware.graphics.composer3.PresentOrValidate.Result result; @VintfStability enum Result { Presented = 0, diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ReleaseFences.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReleaseFences.aidl similarity index 93% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ReleaseFences.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReleaseFences.aidl index b7d258652d..d623661250 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ReleaseFences.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReleaseFences.aidl @@ -31,11 +31,11 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ReleaseFences { long display; - android.hardware.graphics.composer3.command.ReleaseFences.Layer[] layers; + android.hardware.graphics.composer3.ReleaseFences.Layer[] layers; @VintfStability parcelable Layer { long layer; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/WhitePointNits.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/WhitePointNits.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl index 2b251677ab..c3925d2153 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/WhitePointNits.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable WhitePointNits { float nits; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ZOrder.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ZOrder.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ZOrder.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ZOrder.aidl index 69b68c49b4..ea96ea3a69 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ZOrder.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ZOrder.aidl @@ -31,7 +31,7 @@ // 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.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ZOrder { int z; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandPayload.aidl deleted file mode 100644 index 984830630a..0000000000 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandPayload.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.graphics.composer3.command; -@VintfStability -union CommandPayload { - android.hardware.graphics.composer3.command.DisplayCommand displayCommand; - android.hardware.graphics.composer3.command.LayerCommand layerCommand; -} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandResultPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandResultPayload.aidl deleted file mode 100644 index 1b3cae83e6..0000000000 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandResultPayload.aidl +++ /dev/null @@ -1,44 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.graphics.composer3.command; -@VintfStability -union CommandResultPayload { - android.hardware.graphics.composer3.command.Error error; - android.hardware.graphics.composer3.command.ChangedCompositionTypes changedCompositionType; - android.hardware.graphics.composer3.command.DisplayRequest displayRequest; - android.hardware.graphics.composer3.command.PresentFence presentFence; - android.hardware.graphics.composer3.command.ReleaseFences releaseFences; - android.hardware.graphics.composer3.command.PresentOrValidate presentOrValidateResult; - android.hardware.graphics.composer3.command.ClientTargetPropertyWithNits clientTargetProperty; -} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/Buffer.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Buffer.aidl similarity index 96% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/Buffer.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/Buffer.aidl index 3a08d3b522..415a9b61c1 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/Buffer.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Buffer.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.common.NativeHandle; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl new file mode 100644 index 0000000000..fb25163aa4 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl @@ -0,0 +1,33 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +import android.hardware.graphics.composer3.Composition; + +@VintfStability +parcelable ChangedCompositionLayer { + /** + * The layer which this commands refers to. + * @see IComposer.createLayer + */ + long layer; + + /** + * The new composition type. + */ + Composition composition; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl similarity index 72% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl index 3800efffd8..ddd45b7fdd 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl @@ -14,8 +14,9 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; +import android.hardware.graphics.composer3.ChangedCompositionLayer; import android.hardware.graphics.composer3.Composition; @VintfStability @@ -26,22 +27,8 @@ parcelable ChangedCompositionTypes { */ long display; - @VintfStability - parcelable Layer { - /** - * The layer which this commands refers to. - * @see IComposer.createLayer - */ - long layer; - - /** - * The new composition type. - */ - Composition composition; - } - /** * Indicates which layers has composition changes */ - Layer[] layers; + ChangedCompositionLayer[] layers; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTarget.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl similarity index 90% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTarget.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl index d8d45a1ccf..56488d56c3 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTarget.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl @@ -14,11 +14,11 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.common.Dataspace; import android.hardware.graphics.common.Rect; -import android.hardware.graphics.composer3.command.Buffer; +import android.hardware.graphics.composer3.Buffer; @VintfStability parcelable ClientTarget { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl similarity index 95% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl index c80e4ce1c7..50376519d8 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.composer3.ClientTargetProperty; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl similarity index 95% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl index 9cc8fa742a..8bb0711350 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.common.ColorTransform; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/Error.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandError.aidl similarity index 92% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/Error.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/CommandError.aidl index 19843b97b5..ea48600bf9 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/Error.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandError.aidl @@ -14,10 +14,10 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability -parcelable Error { +parcelable CommandError { /** * The index in the command payload array. */ diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandResultPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl similarity index 85% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandResultPayload.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl index b6086ca826..f2de68e025 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandResultPayload.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl @@ -14,22 +14,22 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; -import android.hardware.graphics.composer3.command.ChangedCompositionTypes; -import android.hardware.graphics.composer3.command.ClientTargetPropertyWithNits; -import android.hardware.graphics.composer3.command.DisplayRequest; -import android.hardware.graphics.composer3.command.Error; -import android.hardware.graphics.composer3.command.PresentFence; -import android.hardware.graphics.composer3.command.PresentOrValidate; -import android.hardware.graphics.composer3.command.ReleaseFences; +import android.hardware.graphics.composer3.ChangedCompositionTypes; +import android.hardware.graphics.composer3.ClientTargetPropertyWithNits; +import android.hardware.graphics.composer3.CommandError; +import android.hardware.graphics.composer3.DisplayRequest; +import android.hardware.graphics.composer3.PresentFence; +import android.hardware.graphics.composer3.PresentOrValidate; +import android.hardware.graphics.composer3.ReleaseFences; @VintfStability union CommandResultPayload { /** * Indicates an error generated by a command. */ - Error error; + CommandError error; /** * Sets the layers for which the device requires a different composition @@ -38,7 +38,7 @@ union CommandResultPayload { * ACCEPT_DISPLAY_CHANGES, or must set new types and attempt to validate * the display again. */ - ChangedCompositionTypes changedCompositionType; + ChangedCompositionTypes changedCompositionTypes; /** * Sets the display requests and the layer requests required for the last diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl similarity index 93% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayCommand.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl index 7295adab7c..cdc4759fd3 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl @@ -14,11 +14,12 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; -import android.hardware.graphics.composer3.command.Buffer; -import android.hardware.graphics.composer3.command.ClientTarget; -import android.hardware.graphics.composer3.command.ColorTransformPayload; +import android.hardware.graphics.composer3.Buffer; +import android.hardware.graphics.composer3.ClientTarget; +import android.hardware.graphics.composer3.ColorTransformPayload; +import android.hardware.graphics.composer3.LayerCommand; @VintfStability parcelable DisplayCommand { @@ -28,6 +29,12 @@ parcelable DisplayCommand { */ long display; + /** + * Sets layer commands for this display. + * @see LayerCommand. + */ + LayerCommand[] layers; + /** * Sets a color transform which will be applied after composition. * diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayRequest.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl similarity index 97% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayRequest.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl index 10bd10c789..ea7745d3ae 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayRequest.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability parcelable DisplayRequest { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/GenericMetadata.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl similarity index 95% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/GenericMetadata.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl index a4e1fe8d28..d0254ddf48 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/GenericMetadata.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.composer3.LayerGenericMetadataKey; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index f661f8b919..570d5d9e7f 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -18,9 +18,11 @@ package android.hardware.graphics.composer3; import android.hardware.graphics.composer3.ClientTargetProperty; 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.DisplayConnectionType; import android.hardware.graphics.composer3.DisplayContentSample; import android.hardware.graphics.composer3.DisplayContentSamplingAttributes; @@ -36,8 +38,6 @@ import android.hardware.graphics.composer3.RenderIntent; import android.hardware.graphics.composer3.VirtualDisplay; import android.hardware.graphics.composer3.VsyncPeriodChangeConstraints; import android.hardware.graphics.composer3.VsyncPeriodChangeTimeline; -import android.hardware.graphics.composer3.command.CommandPayload; -import android.hardware.graphics.composer3.command.CommandResultPayload; @VintfStability interface IComposerClient { @@ -163,7 +163,7 @@ interface IComposerClient { * * @return are the command statuses. */ - CommandResultPayload[] executeCommands(in CommandPayload[] commands); + CommandResultPayload[] executeCommands(in DisplayCommand[] commands); /** * Retrieves which display configuration is currently active. diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl similarity index 93% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/LayerCommand.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index eac051bb0e..130e3b15b4 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/LayerCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl @@ -14,34 +14,28 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.common.NativeHandle; import android.hardware.graphics.common.FRect; import android.hardware.graphics.common.Point; import android.hardware.graphics.common.Rect; +import android.hardware.graphics.composer3.Buffer; import android.hardware.graphics.composer3.Color; import android.hardware.graphics.composer3.FloatColor; +import android.hardware.graphics.composer3.GenericMetadata; +import android.hardware.graphics.composer3.ParcelableBlendMode; +import android.hardware.graphics.composer3.ParcelableComposition; +import android.hardware.graphics.composer3.ParcelableDataspace; +import android.hardware.graphics.composer3.ParcelableTransform; import android.hardware.graphics.composer3.PerFrameMetadata; import android.hardware.graphics.composer3.PerFrameMetadataBlob; -import android.hardware.graphics.composer3.command.Buffer; -import android.hardware.graphics.composer3.command.GenericMetadata; -import android.hardware.graphics.composer3.command.ParcelableBlendMode; -import android.hardware.graphics.composer3.command.ParcelableComposition; -import android.hardware.graphics.composer3.command.ParcelableDataspace; -import android.hardware.graphics.composer3.command.ParcelableTransform; -import android.hardware.graphics.composer3.command.PlaneAlpha; -import android.hardware.graphics.composer3.command.WhitePointNits; -import android.hardware.graphics.composer3.command.ZOrder; +import android.hardware.graphics.composer3.PlaneAlpha; +import android.hardware.graphics.composer3.WhitePointNits; +import android.hardware.graphics.composer3.ZOrder; @VintfStability parcelable LayerCommand { - /** - * The display which this commands refers to. - * @see IComposer.createDisplay - */ - long display; - /** * The layer which this commands refers to. * @see IComposer.createLayer diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableBlendMode.aidl similarity index 93% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableBlendMode.aidl index f91285379c..a6c016ab4b 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableBlendMode.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.common.BlendMode; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableComposition.aidl similarity index 93% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableComposition.aidl index 91979d8de5..0946ce75cd 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableComposition.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.composer3.Composition; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableDataspace.aidl similarity index 93% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableDataspace.aidl index 6be750d978..528cdf96c9 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableDataspace.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.common.Dataspace; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableTransform.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableTransform.aidl similarity index 93% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableTransform.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableTransform.aidl index 910d014b67..75f9f7e319 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableTransform.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableTransform.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; import android.hardware.graphics.common.Transform; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PlaneAlpha.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PlaneAlpha.aidl similarity index 94% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/PlaneAlpha.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/PlaneAlpha.aidl index fa1889b5e5..347dc19a15 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PlaneAlpha.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PlaneAlpha.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability parcelable PlaneAlpha { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentFence.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl similarity index 94% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentFence.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl index 0c144068e9..244b4e5af3 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentFence.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability parcelable PresentFence { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentOrValidate.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl similarity index 94% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentOrValidate.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl index 7fc60c4875..f3153bdeca 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentOrValidate.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability parcelable PresentOrValidate { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ReleaseFences.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl similarity index 95% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ReleaseFences.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl index 762f5ebc75..459a04265f 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ReleaseFences.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ReleaseFences { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/WhitePointNits.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl similarity index 95% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/WhitePointNits.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl index ec46cdf01c..2a1d1c666c 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/WhitePointNits.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability parcelable WhitePointNits { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ZOrder.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ZOrder.aidl similarity index 94% rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ZOrder.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ZOrder.aidl index 68120b0e6f..56cc2000ac 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ZOrder.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ZOrder.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.graphics.composer3.command; +package android.hardware.graphics.composer3; @VintfStability parcelable ZOrder { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandPayload.aidl deleted file mode 100644 index c1555e632b..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandPayload.aidl +++ /dev/null @@ -1,30 +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. - */ - -package android.hardware.graphics.composer3.command; - -import android.hardware.graphics.composer3.command.DisplayCommand; -import android.hardware.graphics.composer3.command.LayerCommand; - -/** - * Type of commands that can be used in IComposerClient.executeCommands. - * Note that this is a union and each command can only have one type. - */ -@VintfStability -union CommandPayload { - DisplayCommand displayCommand; - LayerCommand layerCommand; -} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp index 5bda15a449..a3c81765a1 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp @@ -74,7 +74,7 @@ static_assert( static_assert(aidl::android::hardware::graphics::composer3::Capability::SKIP_VALIDATE == static_cast(4)); -static_assert(aidl::android::hardware::graphics::composer3::command::DisplayRequest::LayerRequest:: +static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest::LayerRequest:: CLEAR_CLIENT_TARGET == static_cast(::android::hardware::graphics::composer::V2_1::IComposerClient:: LayerRequest::CLEAR_CLIENT_TARGET)); @@ -121,11 +121,10 @@ static_assert(aidl::android::hardware::graphics::composer3::Composition::SIDEBAN ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition:: SIDEBAND)); -static_assert( - aidl::android::hardware::graphics::composer3::command::DisplayRequest::FLIP_CLIENT_TARGET == - static_cast(::android::hardware::graphics::composer::V2_1::IComposerClient:: - DisplayRequest::FLIP_CLIENT_TARGET)); -static_assert(aidl::android::hardware::graphics::composer3::command::DisplayRequest:: +static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest::FLIP_CLIENT_TARGET == + static_cast(::android::hardware::graphics::composer::V2_1::IComposerClient:: + DisplayRequest::FLIP_CLIENT_TARGET)); +static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest:: WRITE_CLIENT_TARGET_TO_OUTPUT == static_cast(::android::hardware::graphics::composer::V2_1::IComposerClient:: DisplayRequest::WRITE_CLIENT_TARGET_TO_OUTPUT)); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 717b60cd61..8726043cf2 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -140,7 +140,7 @@ class GraphicsCompositionTestBase : public ::testing::Test { return; } - std::vector results; + std::vector results; const auto status = mComposerClient->executeCommands(commands, &results); ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 7a20a53e3b..17b0ebd0ea 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1168,7 +1168,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { return; } - std::vector results; + std::vector results; const auto status = mComposerClient->executeCommands(commands, &results); ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h index b586e7fbec..fcf2a34602 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h @@ -37,8 +37,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -79,14 +79,14 @@ class CommandWriterBase { } void setError(int32_t index, int32_t errorCode) { - command::Error error; + CommandError error; error.commandIndex = index; error.errorCode = errorCode; mCommandsResults.emplace_back(std::move(error)); } - void setPresentOrValidateResult(int64_t display, command::PresentOrValidate::Result result) { - command::PresentOrValidate presentOrValidate; + void setPresentOrValidateResult(int64_t display, PresentOrValidate::Result result) { + PresentOrValidate presentOrValidate; presentOrValidate.display = display; presentOrValidate.result = result; mCommandsResults.emplace_back(std::move(presentOrValidate)); @@ -94,12 +94,11 @@ class CommandWriterBase { void setChangedCompositionTypes(int64_t display, const std::vector& layers, const std::vector& types) { - command::ChangedCompositionTypes changedCompositionTypes; + ChangedCompositionTypes changedCompositionTypes; changedCompositionTypes.display = display; changedCompositionTypes.layers.reserve(layers.size()); for (int i = 0; i < layers.size(); i++) { - auto layer = command::ChangedCompositionTypes::Layer{.layer = layers[i], - .composition = types[i]}; + auto layer = ChangedCompositionLayer{.layer = layers[i], .composition = types[i]}; changedCompositionTypes.layers.emplace_back(std::move(layer)); } mCommandsResults.emplace_back(std::move(changedCompositionTypes)); @@ -108,13 +107,13 @@ class CommandWriterBase { void setDisplayRequests(int64_t display, int32_t displayRequestMask, const std::vector& layers, const std::vector& layerRequestMasks) { - command::DisplayRequest displayRequest; + DisplayRequest displayRequest; displayRequest.display = display; displayRequest.mask = displayRequestMask; displayRequest.layerRequests.reserve(layers.size()); for (int i = 0; i < layers.size(); i++) { - auto layerRequest = command::DisplayRequest::LayerRequest{.layer = layers[i], - .mask = layerRequestMasks[i]}; + auto layerRequest = + DisplayRequest::LayerRequest{.layer = layers[i], .mask = layerRequestMasks[i]}; displayRequest.layerRequests.emplace_back(std::move(layerRequest)); } mCommandsResults.emplace_back(std::move(displayRequest)); @@ -122,7 +121,7 @@ class CommandWriterBase { void setPresentFence(int64_t display, ::ndk::ScopedFileDescriptor presentFence) { if (presentFence.get() >= 0) { - command::PresentFence presentFenceCommand; + PresentFence presentFenceCommand; presentFenceCommand.fence = std::move(presentFence); presentFenceCommand.display = display; mCommandsResults.emplace_back(std::move(presentFenceCommand)); @@ -133,11 +132,11 @@ class CommandWriterBase { void setReleaseFences(int64_t display, const std::vector& layers, std::vector<::ndk::ScopedFileDescriptor> releaseFences) { - command::ReleaseFences releaseFencesCommand; + ReleaseFences releaseFencesCommand; releaseFencesCommand.display = display; for (int i = 0; i < layers.size(); i++) { if (releaseFences[i].get() >= 0) { - command::ReleaseFences::Layer layer; + ReleaseFences::Layer layer; layer.layer = layers[i]; layer.fence = std::move(releaseFences[i]); releaseFencesCommand.layers.emplace_back(std::move(layer)); @@ -150,7 +149,7 @@ class CommandWriterBase { void setClientTargetProperty(int64_t display, const ClientTargetProperty& clientTargetProperty, float whitePointNits) { - command::ClientTargetPropertyWithNits clientTargetPropertyWithNits; + ClientTargetPropertyWithNits clientTargetPropertyWithNits; clientTargetPropertyWithNits.display = display; clientTargetPropertyWithNits.clientTargetProperty = clientTargetProperty; clientTargetPropertyWithNits.whitePointNits = whitePointNits; @@ -158,7 +157,7 @@ class CommandWriterBase { } void setColorTransform(int64_t display, const float* matrix, ColorTransform hint) { - command::ColorTransformPayload colorTransformPayload; + ColorTransformPayload colorTransformPayload; colorTransformPayload.matrix.assign(matrix, matrix + 16); colorTransformPayload.hint = hint; getDisplayCommand(display).colorTransform.emplace(std::move(colorTransformPayload)); @@ -166,7 +165,7 @@ class CommandWriterBase { void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target, int acquireFence, Dataspace dataspace, const std::vector& damage) { - command::ClientTarget clientTargetCommand; + ClientTarget clientTargetCommand; clientTargetCommand.buffer = getBuffer(slot, target, acquireFence); clientTargetCommand.dataspace = dataspace; clientTargetCommand.damage.assign(damage.begin(), damage.end()); @@ -208,7 +207,7 @@ class CommandWriterBase { } void setLayerBlendMode(int64_t display, int64_t layer, BlendMode mode) { - command::ParcelableBlendMode parcelableBlendMode; + ParcelableBlendMode parcelableBlendMode; parcelableBlendMode.blendMode = mode; getLayerCommand(display, layer).blendMode.emplace(std::move(parcelableBlendMode)); } @@ -218,13 +217,13 @@ class CommandWriterBase { } void setLayerCompositionType(int64_t display, int64_t layer, Composition type) { - command::ParcelableComposition compositionPayload; + ParcelableComposition compositionPayload; compositionPayload.composition = type; getLayerCommand(display, layer).composition.emplace(std::move(compositionPayload)); } void setLayerDataspace(int64_t display, int64_t layer, Dataspace dataspace) { - command::ParcelableDataspace dataspacePayload; + ParcelableDataspace dataspacePayload; dataspacePayload.dataspace = dataspace; getLayerCommand(display, layer).dataspace.emplace(std::move(dataspacePayload)); } @@ -234,7 +233,7 @@ class CommandWriterBase { } void setLayerPlaneAlpha(int64_t display, int64_t layer, float alpha) { - command::PlaneAlpha planeAlpha; + PlaneAlpha planeAlpha; planeAlpha.alpha = alpha; getLayerCommand(display, layer).planeAlpha.emplace(std::move(planeAlpha)); } @@ -250,7 +249,7 @@ class CommandWriterBase { } void setLayerTransform(int64_t display, int64_t layer, Transform transform) { - command::ParcelableTransform transformPayload; + ParcelableTransform transformPayload; transformPayload.transform = transform; getLayerCommand(display, layer).transform.emplace(std::move(transformPayload)); } @@ -260,7 +259,7 @@ class CommandWriterBase { } void setLayerZOrder(int64_t display, int64_t layer, uint32_t z) { - command::ZOrder zorder; + ZOrder zorder; zorder.z = z; getLayerCommand(display, layer).z.emplace(std::move(zorder)); } @@ -287,7 +286,7 @@ class CommandWriterBase { void setLayerGenericMetadata(int64_t display, int64_t layer, const std::string& key, const bool mandatory, const std::vector& value) { - command::GenericMetadata metadata; + GenericMetadata metadata; metadata.key.name = key; metadata.key.mandatory = mandatory; metadata.value.assign(value.begin(), value.end()); @@ -296,60 +295,64 @@ class CommandWriterBase { void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) { getLayerCommand(display, layer) - .whitePointNits.emplace(command::WhitePointNits{.nits = whitePointNits}); + .whitePointNits.emplace(WhitePointNits{.nits = whitePointNits}); } - const std::vector& getPendingCommands() { - if (mLayerCommand.has_value()) { - mCommands.emplace_back(std::move(*mLayerCommand)); - mLayerCommand.reset(); - } - if (mDisplayCommand.has_value()) { - mCommands.emplace_back(std::move(*mDisplayCommand)); - mDisplayCommand.reset(); - } + const std::vector& getPendingCommands() { + flushLayerCommand(); + flushDisplayCommand(); return mCommands; } - std::vector getPendingCommandResults() { + std::vector getPendingCommandResults() { return std::move(mCommandsResults); } protected: - command::Buffer getBuffer(int slot, const native_handle_t* bufferHandle, int fence) { - command::Buffer bufferCommand; + Buffer getBuffer(int slot, const native_handle_t* bufferHandle, int fence) { + Buffer bufferCommand; bufferCommand.slot = slot; if (bufferHandle) bufferCommand.handle.emplace(::android::dupToAidl(bufferHandle)); if (fence > 0) bufferCommand.fence = ::ndk::ScopedFileDescriptor(fence); return bufferCommand; } - std::optional mDisplayCommand; - std::optional mLayerCommand; - std::vector mCommands; - std::vector mCommandsResults; + std::optional mDisplayCommand; + std::optional mLayerCommand; + std::vector mCommands; + std::vector mCommandsResults; private: - // std::vector mTemporaryHandles; + void flushLayerCommand() { + if (mLayerCommand.has_value()) { + mDisplayCommand->layers.emplace_back(std::move(*mLayerCommand)); + mLayerCommand.reset(); + } + } + + void flushDisplayCommand() { + if (mDisplayCommand.has_value()) { + mCommands.emplace_back(std::move(*mDisplayCommand)); + mDisplayCommand.reset(); + } + } - command::DisplayCommand& getDisplayCommand(int64_t display) { + DisplayCommand& getDisplayCommand(int64_t display) { if (!mDisplayCommand.has_value() || mDisplayCommand->display != display) { - if (mDisplayCommand.has_value()) mCommands.emplace_back(std::move(*mDisplayCommand)); + flushLayerCommand(); + flushDisplayCommand(); mDisplayCommand.emplace(); mDisplayCommand->display = display; - return *mDisplayCommand; } return *mDisplayCommand; } - command::LayerCommand& getLayerCommand(int64_t display, int64_t layer) { - if (!mLayerCommand.has_value() || mLayerCommand->display != display || - mLayerCommand->layer != layer) { - if (mLayerCommand.has_value()) mCommands.emplace_back(std::move(*mLayerCommand)); + LayerCommand& getLayerCommand(int64_t display, int64_t layer) { + getDisplayCommand(display); + if (!mLayerCommand.has_value() || mLayerCommand->layer != layer) { + flushLayerCommand(); mLayerCommand.emplace(); - mLayerCommand->display = display; mLayerCommand->layer = layer; - return *mLayerCommand; } return *mLayerCommand; } @@ -361,45 +364,41 @@ class CommandReaderBase { // Parse and execute commands from the command queue. The commands are // actually return values from the server and will be saved in ReturnData. - void parse(const std::vector& results) { + void parse(const std::vector& results) { resetData(); for (const auto& result : results) { switch (result.getTag()) { - case command::CommandResultPayload::Tag::error: - parseSetError(result.get()); + case CommandResultPayload::Tag::error: + parseSetError(result.get()); break; - case command::CommandResultPayload::Tag::changedCompositionType: + case CommandResultPayload::Tag::changedCompositionTypes: parseSetChangedCompositionTypes( - result.get< - command::CommandResultPayload::Tag::changedCompositionType>()); + result.get()); break; - case command::CommandResultPayload::Tag::displayRequest: + case CommandResultPayload::Tag::displayRequest: parseSetDisplayRequests( - result.get()); + result.get()); break; - case command::CommandResultPayload::Tag::presentFence: - parseSetPresentFence( - result.get()); + case CommandResultPayload::Tag::presentFence: + parseSetPresentFence(result.get()); break; - case command::CommandResultPayload::Tag::releaseFences: - parseSetReleaseFences( - result.get()); + case CommandResultPayload::Tag::releaseFences: + parseSetReleaseFences(result.get()); break; - case command::CommandResultPayload::Tag::presentOrValidateResult: + case CommandResultPayload::Tag::presentOrValidateResult: parseSetPresentOrValidateDisplayResult( - result.get< - command::CommandResultPayload::Tag::presentOrValidateResult>()); + result.get()); break; - case command::CommandResultPayload::Tag::clientTargetProperty: + case CommandResultPayload::Tag::clientTargetProperty: parseSetClientTargetProperty( - result.get()); + result.get()); break; } } } - std::vector takeErrors() { return std::move(mErrors); } + std::vector takeErrors() { return std::move(mErrors); } bool hasChanges(int64_t display, uint32_t* outNumChangedCompositionTypes, uint32_t* outNumLayerRequestMasks) const { @@ -530,10 +529,9 @@ class CommandReaderBase { mReturnData.clear(); } - void parseSetError(const command::Error& error) { mErrors.emplace_back(error); } + void parseSetError(const CommandError& error) { mErrors.emplace_back(error); } - void parseSetChangedCompositionTypes( - const command::ChangedCompositionTypes& changedCompositionTypes) { + void parseSetChangedCompositionTypes(const ChangedCompositionTypes& changedCompositionTypes) { auto& data = mReturnData[changedCompositionTypes.display]; data.changedLayers.reserve(changedCompositionTypes.layers.size()); @@ -544,7 +542,7 @@ class CommandReaderBase { } } - void parseSetDisplayRequests(const command::DisplayRequest& displayRequest) { + void parseSetDisplayRequests(const DisplayRequest& displayRequest) { auto& data = mReturnData[displayRequest.display]; data.displayRequests = displayRequest.mask; @@ -556,7 +554,7 @@ class CommandReaderBase { } } - void parseSetPresentFence(const command::PresentFence& presentFence) { + void parseSetPresentFence(const PresentFence& presentFence) { auto& data = mReturnData[presentFence.display]; if (data.presentFence >= 0) { close(data.presentFence); @@ -564,7 +562,7 @@ class CommandReaderBase { data.presentFence = dup(presentFence.fence.get()); } - void parseSetReleaseFences(const command::ReleaseFences& releaseFences) { + void parseSetReleaseFences(const ReleaseFences& releaseFences) { auto& data = mReturnData[releaseFences.display]; data.releasedLayers.reserve(releaseFences.layers.size()); data.releaseFences.reserve(releaseFences.layers.size()); @@ -574,15 +572,13 @@ class CommandReaderBase { } } - void parseSetPresentOrValidateDisplayResult( - const command::PresentOrValidate& presentOrValidate) { + void parseSetPresentOrValidateDisplayResult(const PresentOrValidate& presentOrValidate) { auto& data = mReturnData[presentOrValidate.display]; data.presentOrValidateState = - presentOrValidate.result == command::PresentOrValidate::Result::Presented ? 1 : 0; + presentOrValidate.result == PresentOrValidate::Result::Presented ? 1 : 0; } - void parseSetClientTargetProperty( - const command::ClientTargetPropertyWithNits& clientTargetProperty) { + void parseSetClientTargetProperty(const ClientTargetPropertyWithNits& clientTargetProperty) { auto& data = mReturnData[clientTargetProperty.display]; data.clientTargetProperty.pixelFormat = clientTargetProperty.clientTargetProperty.pixelFormat; @@ -611,7 +607,7 @@ class CommandReaderBase { float clientTargetWhitePointNits = -1.f; }; - std::vector mErrors; + std::vector mErrors; std::unordered_map mReturnData; }; -- GitLab From 6679baf603e4830a7198f2784b88e7ce7e0a82e3 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Wed, 8 Dec 2021 18:28:27 -0800 Subject: [PATCH 329/825] composer: add DisplayCapability::SUSPEND Also remove the redundant APIs getDisplayBrightnessSupport and getDozeSupport. Bug: 209889459 Test: VTS Change-Id: Id7e4da62fdcf65b279656a9f115e60b6145e8b5d --- .../graphics/composer3/DisplayCapability.aidl | 1 + .../graphics/composer3/IComposerClient.aidl | 2 - .../graphics/composer3/DisplayCapability.aidl | 11 ++- .../graphics/composer3/IComposerClient.aidl | 31 ------- .../VtsHalGraphicsComposer3_TargetTest.cpp | 88 +++++++++++-------- 5 files changed, 61 insertions(+), 72 deletions(-) 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 0bcd8707e9..9f5342ef4b 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 @@ -40,4 +40,5 @@ enum DisplayCapability { BRIGHTNESS = 3, PROTECTED_CONTENTS = 4, AUTO_LOW_LATENCY_MODE = 5, + SUSPEND = 6, } 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 471721897e..2bdbc9fd96 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 @@ -43,7 +43,6 @@ interface IComposerClient { android.hardware.graphics.composer3.ColorMode[] getColorModes(long display); float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); int getDisplayAttribute(long display, int config, android.hardware.graphics.composer3.DisplayAttribute attribute); - boolean getDisplayBrightnessSupport(long display); android.hardware.graphics.composer3.DisplayCapability[] getDisplayCapabilities(long display); int[] getDisplayConfigs(long display); android.hardware.graphics.composer3.DisplayConnectionType getDisplayConnectionType(long display); @@ -52,7 +51,6 @@ interface IComposerClient { int getDisplayVsyncPeriod(long display); android.hardware.graphics.composer3.DisplayContentSample getDisplayedContentSample(long display, long maxFrames, long timestamp); android.hardware.graphics.composer3.DisplayContentSamplingAttributes getDisplayedContentSamplingAttributes(long display); - boolean getDozeSupport(long display); android.hardware.graphics.composer3.HdrCapabilities getHdrCapabilities(long display); android.hardware.graphics.composer3.LayerGenericMetadataKey[] getLayerGenericMetadataKeys(); int getMaxVirtualDisplayCount(); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl index 54f09c1ade..bfaa15bea3 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl @@ -42,7 +42,8 @@ enum DisplayCapability { SKIP_CLIENT_COLOR_TRANSFORM = 1, /** * Indicates that the display supports PowerMode::DOZE and - * PowerMode::DOZE_SUSPEND. DOZE_SUSPEND may not provide any benefit + * potentially PowerMode::DOZE_SUSPEND if DisplayCapability.SUSPEND is also + * supported. DOZE_SUSPEND may not provide any benefit * over DOZE (see the definition of PowerMode for more information), * but if both DOZE and DOZE_SUSPEND are no different from * PowerMode::ON, the device must not claim support. @@ -66,4 +67,12 @@ enum DisplayCapability { * support a low latency mode, such as HDMI 2.1 Auto Low Latency Mode. */ AUTO_LOW_LATENCY_MODE = 5, + /** + * Indicates that the display supports PowerMode.ON_SUSPEND. + * If PowerMode.ON_SUSPEND is no different from PowerMode.ON, the device must not + * claim support. + * If the display supports DisplayCapability.DOZE and DisplayCapability.SUSPEND, then + * PowerMode.ON_SUSPEND and PowerMode.DOZE_SUSPEND must be supported. + */ + SUSPEND = 6, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 570d5d9e7f..b89b4c46c4 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -246,22 +246,6 @@ interface IComposerClient { */ int getDisplayAttribute(long display, int config, DisplayAttribute attribute); - /** - * Use getDisplayCapabilities instead. If brightness is supported, must return - * DisplayCapability::BRIGHTNESS as one of the display capabilities via getDisplayCapabilities. - * Only use getDisplayCapabilities as the source of truth to query brightness support. - * - * Gets whether brightness operations are supported on a display. - * - * @param display The display. - * - * @return Whether brightness operations are supported on the display. - * - * @exception EX_BAD_DISPLAY when the display is invalid, or - * @exception EX_BAD_PARAMETER when the output parameter is invalid. - */ - boolean getDisplayBrightnessSupport(long display); - /** * Provides a list of supported capabilities (as described in the * definition of DisplayCapability above). This list must not change after @@ -370,21 +354,6 @@ interface IComposerClient { */ DisplayContentSamplingAttributes getDisplayedContentSamplingAttributes(long display); - /** - * Returns whether the given display supports PowerMode::DOZE and - * PowerMode::DOZE_SUSPEND. DOZE_SUSPEND may not provide any benefit over - * DOZE (see the definition of PowerMode for more information), but if - * both DOZE and DOZE_SUSPEND are no different from PowerMode::ON, the - * device must not claim support. - * - * @param display is the display to query. - * - * @return is true only when the display supports doze modes. - * - * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. - */ - boolean getDozeSupport(long display); - /** * Returns the high dynamic range (HDR) capabilities of the given display, * which are invariant with regard to the active configuration. diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 17b0ebd0ea..20fffa9495 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -566,25 +566,6 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSample) { } } -TEST_P(GraphicsComposerAidlTest, getDisplayCapabilitiesBasic) { - std::vector capabilities; - const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); - ASSERT_TRUE(error.isOk()); - const bool hasDozeSupport = std::find(capabilities.begin(), capabilities.end(), - DisplayCapability::DOZE) != capabilities.end(); - bool isDozeSupported = false; - EXPECT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk()); - EXPECT_EQ(hasDozeSupport, isDozeSupported); - - bool hasBrightnessSupport = std::find(capabilities.begin(), capabilities.end(), - DisplayCapability::BRIGHTNESS) != capabilities.end(); - bool isBrightnessSupported = false; - EXPECT_TRUE( - mComposerClient->getDisplayBrightnessSupport(mPrimaryDisplay, &isBrightnessSupported) - .isOk()); - EXPECT_EQ(isBrightnessSupported, hasBrightnessSupport); -} - /* * Test that if brightness operations are supported, setDisplayBrightness works as expected. */ @@ -1009,16 +990,14 @@ TEST_P(GraphicsComposerAidlTest, SetActiveConfigPowerCycle) { } } -TEST_P(GraphicsComposerAidlTest, GetDozeSupportBadDisplay) { - bool isDozeSupport; - const auto error = mComposerClient->getDozeSupport(mInvalidDisplayId, &isDozeSupport); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); -} - TEST_P(GraphicsComposerAidlTest, SetPowerModeUnsupported) { - bool isDozeSupported; - mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk(); + std::vector capabilities; + const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); + ASSERT_TRUE(error.isOk()); + const bool isDozeSupported = std::find(capabilities.begin(), capabilities.end(), + DisplayCapability::DOZE) != capabilities.end(); + const bool isSuspendSupported = std::find(capabilities.begin(), capabilities.end(), + DisplayCapability::SUSPEND) != capabilities.end(); if (!isDozeSupported) { auto error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE); EXPECT_FALSE(error.isOk()); @@ -1028,6 +1007,16 @@ TEST_P(GraphicsComposerAidlTest, SetPowerModeUnsupported) { EXPECT_FALSE(error.isOk()); EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); } + + if (!isSuspendSupported) { + auto error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON_SUSPEND); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + + error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE_SUSPEND); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + } } TEST_P(GraphicsComposerAidlTest, SetVsyncEnabled) { @@ -1041,15 +1030,27 @@ TEST_P(GraphicsComposerAidlTest, SetVsyncEnabled) { } TEST_P(GraphicsComposerAidlTest, SetPowerMode) { + std::vector capabilities; + const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); + ASSERT_TRUE(error.isOk()); + const bool isDozeSupported = std::find(capabilities.begin(), capabilities.end(), + DisplayCapability::DOZE) != capabilities.end(); + const bool isSuspendSupported = std::find(capabilities.begin(), capabilities.end(), + DisplayCapability::SUSPEND) != capabilities.end(); + std::vector modes; modes.push_back(PowerMode::OFF); - modes.push_back(PowerMode::ON_SUSPEND); modes.push_back(PowerMode::ON); - bool isDozeSupported; - EXPECT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk()); + if (isSuspendSupported) { + modes.push_back(PowerMode::ON_SUSPEND); + } + if (isDozeSupported) { modes.push_back(PowerMode::DOZE); + } + + if (isSuspendSupported && isDozeSupported) { modes.push_back(PowerMode::DOZE_SUSPEND); } @@ -1059,6 +1060,14 @@ TEST_P(GraphicsComposerAidlTest, SetPowerMode) { } TEST_P(GraphicsComposerAidlTest, SetPowerModeVariations) { + std::vector capabilities; + const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); + ASSERT_TRUE(error.isOk()); + const bool isDozeSupported = std::find(capabilities.begin(), capabilities.end(), + DisplayCapability::DOZE) != capabilities.end(); + const bool isSuspendSupported = std::find(capabilities.begin(), capabilities.end(), + DisplayCapability::SUSPEND) != capabilities.end(); + std::vector modes; modes.push_back(PowerMode::OFF); @@ -1083,15 +1092,15 @@ TEST_P(GraphicsComposerAidlTest, SetPowerModeVariations) { } modes.clear(); - modes.push_back(PowerMode::ON_SUSPEND); - modes.push_back(PowerMode::ON_SUSPEND); - for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + if (isSuspendSupported) { + modes.push_back(PowerMode::ON_SUSPEND); + modes.push_back(PowerMode::ON_SUSPEND); + for (auto mode : modes) { + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + } + modes.clear(); } - modes.clear(); - bool isDozeSupported = false; - ASSERT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk()); if (isDozeSupported) { modes.push_back(PowerMode::DOZE); modes.push_back(PowerMode::DOZE); @@ -1099,12 +1108,15 @@ TEST_P(GraphicsComposerAidlTest, SetPowerModeVariations) { EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); } modes.clear(); + } + if (isSuspendSupported && isDozeSupported) { modes.push_back(PowerMode::DOZE_SUSPEND); modes.push_back(PowerMode::DOZE_SUSPEND); for (auto mode : modes) { EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); } + modes.clear(); } } -- GitLab From a80531fdc0e37489f7ce9116bf33812f0f2ac77b Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Mon, 13 Dec 2021 15:22:57 -0800 Subject: [PATCH 330/825] composer3: fix documentation to match aidl style Bug: 201008710 Test: N/A Change-Id: Ie7030e4e0ccf817b8dfc6bf7f91fbd1bd4d18928 --- .../composer3/ColorTransformPayload.aidl | 2 +- .../graphics/composer3/Composition.aidl | 2 +- .../graphics/composer3/DisplayCapability.aidl | 10 +++---- .../graphics/composer3/DisplayCommand.aidl | 10 +++---- .../graphics/composer3/DisplayRequest.aidl | 2 +- .../graphics/composer3/IComposer.aidl | 2 +- .../graphics/composer3/IComposerCallback.aidl | 2 +- .../graphics/composer3/IComposerClient.aidl | 26 +++++++++---------- .../graphics/composer3/LayerCommand.aidl | 20 +++++++------- .../graphics/composer3/RenderIntent.aidl | 6 ++--- 10 files changed, 41 insertions(+), 41 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl index 8bb0711350..fc37daca1c 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl @@ -27,7 +27,7 @@ parcelable ColorTransformPayload { /** * Hint value which may be used instead of the given matrix unless it - * is ColorTransform::ARBITRARY. + * is ColorTransform.ARBITRARY. */ ColorTransform hint; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl index ea22af2a68..d1c9b30b1c 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl @@ -66,7 +66,7 @@ enum Composition { /** * The device must handle the composition of this layer, as well as * its buffer updates and content synchronization. Only supported on - * devices which provide Capability::SIDEBAND_STREAM. + * devices which provide Capability.SIDEBAND_STREAM. * * Upon validateDisplay, the device may request a change from this * type to either DEVICE or CLIENT, but it is unlikely that content diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl index bfaa15bea3..eacf1068e1 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl @@ -41,15 +41,15 @@ enum DisplayCapability { */ SKIP_CLIENT_COLOR_TRANSFORM = 1, /** - * Indicates that the display supports PowerMode::DOZE and - * potentially PowerMode::DOZE_SUSPEND if DisplayCapability.SUSPEND is also + * Indicates that the display supports PowerMode.DOZE and + * potentially PowerMode.DOZE_SUSPEND if DisplayCapability.SUSPEND is also * supported. DOZE_SUSPEND may not provide any benefit * over DOZE (see the definition of PowerMode for more information), * but if both DOZE and DOZE_SUSPEND are no different from - * PowerMode::ON, the device must not claim support. + * PowerMode.ON, the device must not claim support. * Must be returned by getDisplayCapabilities when getDozeSupport - * indicates the display supports PowerMode::DOZE and - * PowerMode::DOZE_SUSPEND. + * indicates the display supports PowerMode.DOZE and + * PowerMode.DOZE_SUSPEND. */ DOZE = 2, /** diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl index cdc4759fd3..21497c43ed 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl @@ -38,7 +38,7 @@ parcelable DisplayCommand { /** * Sets a color transform which will be applied after composition. * - * If hint is not ColorTransform::ARBITRARY, then the device may use the + * If hint is not ColorTransform.ARBITRARY, then the device may use the * hint to apply the desired color transform instead of using the color * matrix directly. * @@ -46,7 +46,7 @@ parcelable DisplayCommand { * apply the desired color transform, it must force all layers to client * composition during VALIDATE_DISPLAY. * - * If IComposer::Capability::SKIP_CLIENT_COLOR_TRANSFORM is present, then + * If Capability.SKIP_CLIENT_COLOR_TRANSFORM is present, then * the client must never apply the color transform during client * composition, even if all layers are being composed by the client. * @@ -74,9 +74,9 @@ parcelable DisplayCommand { /** * Sets the buffer handle which will receive the output of client - * composition. Layers marked as Composition::CLIENT must be composited + * composition. Layers marked as Composition.CLIENT must be composited * into this buffer prior to the call to PRESENT_DISPLAY, and layers not - * marked as Composition::CLIENT must be composited with this buffer by + * marked as Composition.CLIENT must be composited with this buffer by * the device. * * The buffer handle provided may be empty if no layers are being @@ -94,7 +94,7 @@ parcelable DisplayCommand { * the description of SET_LAYER_SURFACE_DAMAGE. * * Will be called before PRESENT_DISPLAY if any of the layers are marked - * as Composition::CLIENT. If no layers are so marked, then it is not + * as Composition.CLIENT. If no layers are so marked, then it is not * necessary to call this function. It is not necessary to call * validateDisplay after changing the target through this function. */ diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl index ea7745d3ae..27fe1e6ed7 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl @@ -27,7 +27,7 @@ parcelable DisplayRequest { /** * Instructs the client to write the result of client composition * directly into the virtual display output buffer. If any of the - * layers are not marked as Composition::CLIENT or the given display + * layers are not marked as Composition.CLIENT or the given display * is not a virtual display, this request has no effect. */ const int WRITE_CLIENT_TARGET_TO_OUTPUT = 1 << 1; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl index a6a9f73b2a..b8edd8071d 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl @@ -27,7 +27,7 @@ interface IComposer { const int EX_NO_RESOURCES = 6; /** - * Creates a v2.4 client of the composer. Supersedes @2.3::createClient. + * Creates a client of the composer. * * @return is the newly created client. * diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl index 1709e6dff5..ac95b41a38 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl @@ -26,7 +26,7 @@ interface IComposerCallback { * 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, + * 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. * diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index b89b4c46c4..28bdb2c44e 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -185,7 +185,7 @@ interface IComposerClient { /** * Returns the color modes supported on this display. * - * All devices must support at least ColorMode::NATIVE. + * All devices must support at least ColorMode.NATIVE. * * @param display is the display to query. * @@ -201,7 +201,7 @@ interface IComposerClient { * * When the layer dataspace is a legacy dataspace (see * common@1.1::Dataspace) and the display render intent is - * RenderIntent::ENHANCE, the pixel values can go through an + * RenderIntent.ENHANCE, the pixel values can go through an * implementation-defined saturation transform before being mapped to the * current color mode colorimetrically. * @@ -409,8 +409,8 @@ interface IComposerClient { * * The width and height of this buffer must be those of the currently-active * display configuration, and the usage flags must consist of the following: - * BufferUsage::CPU_READ | BufferUsage::GPU_TEXTURE | - * BufferUsage::COMPOSER_OUTPUT + * BufferUsage.CPU_READ | BufferUsage.GPU_TEXTURE | + * BufferUsage.COMPOSER_OUTPUT * * The format and dataspace provided must be sufficient such that if a * correctly-configured buffer is passed into setReadbackBuffer, filled by @@ -485,8 +485,8 @@ interface IComposerClient { * Returns the render intents supported by the specified display and color * mode. * - * For SDR color modes, RenderIntent::COLORIMETRIC must be supported. For - * HDR color modes, RenderIntent::TONE_MAP_COLORIMETRIC must be supported. + * For SDR color modes, RenderIntent.COLORIMETRIC must be supported. For + * HDR color modes, RenderIntent.TONE_MAP_COLORIMETRIC must be supported. * * @param display is the display to query. * @param mode is the color mode to query. @@ -500,11 +500,11 @@ interface IComposerClient { /** * Provides a list of all the content types supported by this display (any of - * ContentType::{GRAPHICS, PHOTO, CINEMA, GAME}). This list must not change after + * ContentType.{GRAPHICS, PHOTO, CINEMA, GAME}). This list must not change after * initialization. * * Content types are introduced in HDMI 1.4 and supporting them is optional. The - * ContentType::NONE is always supported and will not be returned by this method.. + * ContentType.NONE is always supported and will not be returned by this method.. * * @return out is a list of supported content types. * @@ -571,7 +571,7 @@ interface IComposerClient { * be triggered. * * This function should only be called if the display reports support for - * DisplayCapability::AUTO_LOW_LATENCY_MODE from getDisplayCapabilities_2_4. + * DisplayCapability.AUTO_LOW_LATENCY_MODE from getDisplayCapabilities_2_4. * * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. * @exception EX_UNSUPPORTED when AUTO_LOW_LATENCY_MODE is not supported by the composer @@ -595,8 +595,8 @@ interface IComposerClient { * The color mode and render intent change must take effect on next * presentDisplay. * - * All devices must support at least ColorMode::NATIVE and - * RenderIntent::COLORIMETRIC, and displays are assumed to be in this mode + * All devices must support at least ColorMode.NATIVE and + * RenderIntent.COLORIMETRIC, and displays are assumed to be in this mode * upon hotplug. * * @param display is the display to which the color mode is set. @@ -682,8 +682,8 @@ interface IComposerClient { * complete when this function returns. It is valid to call this function * multiple times with the same power mode. * - * All displays must support PowerMode::ON and PowerMode::OFF. Whether a - * display supports PowerMode::DOZE or PowerMode::DOZE_SUSPEND may be + * All displays must support PowerMode.ON and PowerMode.OFF. Whether a + * display supports PowerMode.DOZE or PowerMode.DOZE_SUSPEND may be * queried using getDozeSupport. * * @param display is the display to which the power mode is set. diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index 130e3b15b4..761da9a2c5 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl @@ -45,7 +45,7 @@ parcelable LayerCommand { /** * Asynchronously sets the position of a cursor layer. * - * Prior to validateDisplay, a layer may be marked as Composition::CURSOR. + * Prior to validateDisplay, a layer may be marked as Composition.CURSOR. * If validation succeeds (i.e., the device does not request a composition * change for that layer), then once a buffer has been set for the layer * and it has been presented, its position may be set by this function at @@ -73,8 +73,8 @@ parcelable LayerCommand { * may be passed instead. * * This function must return NONE and have no other effect if called for a - * layer with a composition type of Composition::SOLID_COLOR (because it - * has no buffer) or Composition::SIDEBAND or Composition::CLIENT (because + * layer with a composition type of Composition.SOLID_COLOR (because it + * has no buffer) or Composition.SIDEBAND or Composition.CLIENT (because * synchronization and buffer updates for these layers are handled * elsewhere). */ @@ -109,14 +109,14 @@ parcelable LayerCommand { /** * Sets the color of the given layer. If the composition type of the layer - * is not Composition::SOLID_COLOR, this call must succeed and have no + * is not Composition.SOLID_COLOR, this call must succeed and have no * other effect. */ @nullable Color color; /** * Sets the color of the given layer. If the composition type of the layer - * is not Composition::SOLID_COLOR, this call must succeed and have no + * is not Composition.SOLID_COLOR, this call must succeed and have no * other effect. */ @nullable FloatColor floatColor; @@ -149,20 +149,20 @@ parcelable LayerCommand { * Sets an alpha value (a floating point value in the range [0.0, 1.0]) * which will be applied to the whole layer. It can be conceptualized as a * preprocessing step which applies the following function: - * if (blendMode == BlendMode::PREMULTIPLIED) + * if (blendMode == BlendMode.PREMULTIPLIED) * out.rgb = in.rgb * planeAlpha * out.a = in.a * planeAlpha * * If the device does not support this operation on a layer which is - * marked Composition::DEVICE, it must request a composition type change - * to Composition::CLIENT upon the next validateDisplay call. + * marked Composition.DEVICE, it must request a composition type change + * to Composition.CLIENT upon the next validateDisplay call. * */ @nullable PlaneAlpha planeAlpha; /** * Sets the sideband stream for this layer. If the composition type of the - * given layer is not Composition::SIDEBAND, this call must succeed and + * given layer is not Composition.SIDEBAND, this call must succeed and * have no other effect. */ @nullable NativeHandle sidebandStream; @@ -174,7 +174,7 @@ parcelable LayerCommand { * * If the device is not capable of supporting a true float source crop * (i.e., it will truncate or round the floats to integers), it must set - * this layer to Composition::CLIENT when crop is non-integral for the + * this layer to Composition.CLIENT when crop is non-integral for the * most accurate rendering. * * If the device cannot support float source crops, but still wants to diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/RenderIntent.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/RenderIntent.aidl index 043b24d341..debf32c372 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/RenderIntent.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/RenderIntent.aidl @@ -25,8 +25,8 @@ package android.hardware.graphics.composer3; * modes should not affect the mapping. * * RenderIntent overrides the render intents defined for individual color - * modes. It is ignored when the color mode is ColorMode::NATIVE, because - * ColorMode::NATIVE colors are already display colors. + * modes. It is ignored when the color mode is ColorMode.NATIVE, because + * ColorMode.NATIVE colors are already display colors. */ @VintfStability @Backing(type="int") @@ -36,7 +36,7 @@ enum RenderIntent { * gamut are hard-clipped. * * This implies that the display must have been calibrated unless - * ColorMode::NATIVE is the only supported color mode. + * ColorMode.NATIVE is the only supported color mode. */ COLORIMETRIC = 0, /** -- GitLab From 3d18f923804d6f6834e09825fd0930c4149ed69d Mon Sep 17 00:00:00 2001 From: ramindani Date: Mon, 13 Dec 2021 20:24:47 +0000 Subject: [PATCH 331/825] Store the GraphicBuffer allocated so that SP pointer is not deallocated when this function exists to verify values in other related fuctions. Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 199413815 Change-Id: I7e44311cf7a11220f80f41cef503b7b82b443ece --- .../VtsHalGraphicsComposer3_TargetTest.cpp | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 20fffa9495..272da7e041 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1263,7 +1263,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { int64_t layer = 0; ASSERT_NO_FATAL_FAILURE(layer = createLayer(display)); { - auto buffer = allocate(); + const auto buffer = allocate(); ASSERT_NE(nullptr, buffer); ASSERT_EQ(::android::OK, buffer->initCheck()); ASSERT_NE(nullptr, buffer->handle); @@ -1292,7 +1292,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { } { - auto buffer = allocate(); + const auto buffer = allocate(); ASSERT_NE(nullptr, buffer->handle); mWriter.setLayerBuffer(display.get(), layer, 0, buffer->handle, -1); @@ -1454,7 +1454,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_OUTPUT_BUFFER) { kBufferSlotCount, &display) .isOk()); - auto handle = allocate()->handle; + const auto buffer = allocate(); + const auto handle = buffer->handle; mWriter.setOutputBuffer(display.display, 0, handle, -1); execute(); } @@ -1500,7 +1501,8 @@ TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) for (auto intent : renderIntents) { mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE, intent); - auto handle = allocate()->handle; + const auto buffer = allocate(); + const auto handle = buffer->handle; ASSERT_NE(nullptr, handle); Rect displayFrame{0, 0, mDisplayWidth, mDisplayHeight}; @@ -1535,7 +1537,8 @@ TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - auto handle2 = allocate()->handle; + const auto buffer2 = allocate(); + const auto handle2 = buffer2->handle; ASSERT_NE(nullptr, handle2); mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle2, -1); mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector(1, {0, 0, 10, 10})); @@ -1549,7 +1552,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_CURSOR_POSITION) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - auto handle = allocate()->handle; + const auto buffer = allocate(); + const auto handle = buffer->handle; ASSERT_NE(nullptr, handle); Rect displayFrame{0, 0, mDisplayWidth, mDisplayHeight}; @@ -1588,7 +1592,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_CURSOR_POSITION) { } TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BUFFER) { - auto handle = allocate()->handle; + const auto buffer = allocate(); + const auto handle = buffer->handle; ASSERT_NE(nullptr, handle); int64_t layer; @@ -1708,7 +1713,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SIDEBAND_STREAM) { return; } - auto handle = allocate()->handle; + const auto buffer = allocate(); + const auto handle = buffer->handle; ASSERT_NE(nullptr, handle); int64_t layer; -- GitLab From 202b02de56b31bd358c94bc7989b4f34a177675b Mon Sep 17 00:00:00 2001 From: Joe Huang Date: Tue, 16 Nov 2021 23:09:11 +0800 Subject: [PATCH 332/825] Add IGnssDebug AIDL HAL Bug: 205185369 Test: atest VtsHalGnssTargetTest Change-Id: I78d9641b1cf3d39af9671805ce4e48cd358fa45c --- .../current/android/hardware/gnss/IGnss.aidl | 1 + .../android/hardware/gnss/IGnssDebug.aidl | 94 ++++++++ gnss/aidl/android/hardware/gnss/IGnss.aidl | 10 + .../android/hardware/gnss/IGnssDebug.aidl | 208 ++++++++++++++++++ gnss/aidl/default/Android.bp | 1 + gnss/aidl/default/Gnss.cpp | 8 + gnss/aidl/default/Gnss.h | 2 + gnss/aidl/default/GnssDebug.cpp | 50 +++++ gnss/aidl/default/GnssDebug.h | 28 +++ gnss/aidl/vts/gnss_hal_test_cases.cpp | 56 +++++ 10 files changed, 458 insertions(+) create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl create mode 100644 gnss/aidl/android/hardware/gnss/IGnssDebug.aidl create mode 100644 gnss/aidl/default/GnssDebug.cpp create mode 100644 gnss/aidl/default/GnssDebug.h 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 ea980308b7..9df7fe521b 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 @@ -44,6 +44,7 @@ interface IGnss { @nullable android.hardware.gnss.IGnssGeofence getExtensionGnssGeofence(); @nullable android.hardware.gnss.IGnssNavigationMessageInterface getExtensionGnssNavigationMessage(); android.hardware.gnss.IAGnss getExtensionAGnss(); + android.hardware.gnss.IGnssDebug getExtensionGnssDebug(); const int ERROR_INVALID_ARGUMENT = 1; const int ERROR_ALREADY_INIT = 2; const int ERROR_GENERIC = 3; diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl new file mode 100644 index 0000000000..27d9887083 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl @@ -0,0 +1,94 @@ +/* + * 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 -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.gnss; +@VintfStability +interface IGnssDebug { + android.hardware.gnss.IGnssDebug.DebugData getDebugData(); + @Backing(type="int") @VintfStability + enum SatelliteEphemerisType { + EPHEMERIS = 0, + ALMANAC_ONLY = 1, + NOT_AVAILABLE = 2, + } + @Backing(type="int") @VintfStability + enum SatelliteEphemerisSource { + DEMODULATED = 0, + SUPL_PROVIDED = 1, + OTHER_SERVER_PROVIDED = 2, + OTHER = 3, + } + @Backing(type="int") @VintfStability + enum SatelliteEphemerisHealth { + GOOD = 0, + BAD = 1, + UNKNOWN = 2, + } + @VintfStability + parcelable TimeDebug { + long timeEstimateMs; + float timeUncertaintyNs; + float frequencyUncertaintyNsPerSec; + } + @VintfStability + parcelable PositionDebug { + boolean valid; + double latitudeDegrees; + double longitudeDegrees; + float altitudeMeters; + float speedMetersPerSec; + float bearingDegrees; + double horizontalAccuracyMeters; + double verticalAccuracyMeters; + double speedAccuracyMetersPerSecond; + double bearingAccuracyDegrees; + float ageSeconds; + } + @VintfStability + parcelable SatelliteData { + int svid; + android.hardware.gnss.GnssConstellationType constellation; + android.hardware.gnss.IGnssDebug.SatelliteEphemerisType ephemerisType; + android.hardware.gnss.IGnssDebug.SatelliteEphemerisSource ephemerisSource; + android.hardware.gnss.IGnssDebug.SatelliteEphemerisHealth ephemerisHealth; + float ephemerisAgeSeconds; + boolean serverPredictionIsAvailable; + float serverPredictionAgeSeconds; + } + @VintfStability + parcelable DebugData { + android.hardware.gnss.IGnssDebug.PositionDebug position; + android.hardware.gnss.IGnssDebug.TimeDebug time; + List satelliteDataArray; + } +} diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl index 91403cadfd..2751521efc 100644 --- a/gnss/aidl/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl @@ -20,6 +20,7 @@ import android.hardware.gnss.IAGnss; import android.hardware.gnss.IGnssBatching; import android.hardware.gnss.IGnssCallback; import android.hardware.gnss.IGnssConfiguration; +import android.hardware.gnss.IGnssDebug; import android.hardware.gnss.IGnssGeofence; import android.hardware.gnss.IGnssMeasurementInterface; import android.hardware.gnss.IGnssNavigationMessageInterface; @@ -134,4 +135,13 @@ interface IGnss { * @return The IAGnss interface. */ IAGnss getExtensionAGnss(); + + /** + * This method returns the IGnssDebug interface. + * + * This method must return non-null. + * + * @return Handle to the IGnssDebug interface. + */ + IGnssDebug getExtensionGnssDebug(); } diff --git a/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl b/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl new file mode 100644 index 0000000000..475a4a3a7f --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl @@ -0,0 +1,208 @@ +/* + * 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. + */ + +package android.hardware.gnss; + +import android.hardware.gnss.GnssConstellationType; + +/** + * Extended interface for GNSS Debug support + * + * This information is used for debugging purpose, e.g., shown in a bugreport to + * describe the chipset states including time, position, and satellite data. + */ +@VintfStability +interface IGnssDebug { + /** Satellite's ephemeris type */ + @VintfStability + @Backing(type="int") + enum SatelliteEphemerisType { + EPHEMERIS = 0, + ALMANAC_ONLY = 1, + NOT_AVAILABLE = 2, + } + + /** Satellite's ephemeris source */ + @VintfStability + @Backing(type="int") + enum SatelliteEphemerisSource { + DEMODULATED = 0, + SUPL_PROVIDED = 1, + OTHER_SERVER_PROVIDED = 2, + OTHER = 3, + } + + /** Satellite's ephemeris health */ + @VintfStability + @Backing(type="int") + enum SatelliteEphemerisHealth { + GOOD = 0, + BAD = 1, + UNKNOWN = 2, + } + + /** + * Provides the current best known UTC time estimate. + * If no fresh information is available, e.g. after a delete all, + * then whatever the effective defaults are on the device must be + * provided (e.g. Jan. 1, 2017, with an uncertainty of 5 years) expressed + * in the specified units. + */ + @VintfStability + parcelable TimeDebug { + /** UTC time estimate in milliseconds. */ + long timeEstimateMs; + + /** 68% time error estimate in nanoseconds. */ + float timeUncertaintyNs; + + /** + * 68% error estimate in local clock drift, + * in nanoseconds per second (also known as parts per billion - ppb.) + */ + float frequencyUncertaintyNsPerSec; + } + + @VintfStability + parcelable PositionDebug { + /** + * Validity of the data in this struct. False only if no + * latitude/longitude information is known. + */ + boolean valid; + + /** Latitude expressed in degrees */ + double latitudeDegrees; + + /** Longitude expressed in degrees */ + double longitudeDegrees; + + /** Altitude above ellipsoid expressed in meters */ + float altitudeMeters; + + /** Represents horizontal speed in meters per second. */ + float speedMetersPerSec; + + /** Represents heading in degrees. */ + float bearingDegrees; + + /** + * Estimated horizontal accuracy of position expressed in meters, + * radial, 68% confidence. + */ + double horizontalAccuracyMeters; + + /** + * Estimated vertical accuracy of position expressed in meters, with + * 68% confidence. + */ + double verticalAccuracyMeters; + + /** + * Estimated speed accuracy in meters per second with 68% confidence. + */ + double speedAccuracyMetersPerSecond; + + /** + * Estimated bearing accuracy degrees with 68% confidence. + */ + double bearingAccuracyDegrees; + + /** + * Time duration before this report that this position information was + * valid. This can, for example, be a previous injected location with + * an age potentially thousands of seconds old, or + * extrapolated to the current time (with appropriately increased + * accuracy estimates), with a (near) zero age. + */ + float ageSeconds; + } + + @VintfStability + parcelable SatelliteData { + /** Satellite vehicle ID number */ + int svid; + + /** Defines the constellation type of the given SV. */ + GnssConstellationType constellation; + + /** + * Defines the standard broadcast ephemeris or almanac availability for + * the satellite. To report status of predicted orbit and clock + * information, see the serverPrediction fields below. + */ + SatelliteEphemerisType ephemerisType; + + /** Defines the ephemeris source of the satellite. */ + SatelliteEphemerisSource ephemerisSource; + + /** + * Defines whether the satellite is known healthy + * (safe for use in location calculation.) + */ + SatelliteEphemerisHealth ephemerisHealth; + + /** + * Time duration from this report (current time), minus the + * effective time of the ephemeris source (e.g. TOE, TOA.) + * Set to 0 when ephemerisType is NOT_AVAILABLE. + */ + float ephemerisAgeSeconds; + + /** + * True if a server has provided a predicted orbit and clock model for + * this satellite. + */ + boolean serverPredictionIsAvailable; + + /** + * Time duration from this report (current time) minus the time of the + * start of the server predicted information. For example, a 1 day + * old prediction would be reported as 86400 seconds here. + */ + float serverPredictionAgeSeconds; + } + + /** + * Provides a set of debug information that is filled by the GNSS chipset + * when the method getDebugData() is invoked. + */ + @VintfStability + parcelable DebugData { + /** Current best known position. */ + PositionDebug position; + + /** Current best know time estimate */ + TimeDebug time; + + /** + * Provides a list of the available satellite data, for all + * satellites and constellations the device can track, + * including GnssConstellationType UNKNOWN. + */ + List satelliteDataArray; + } + + /** + * This methods requests position, time and satellite ephemeris debug information + * from the HAL. + * + * @return ret debugData information from GNSS Hal that contains the current best + * known position, best known time estimate and a complete list of + * constellations that the device can track. + */ + DebugData getDebugData(); +} diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index 1236714bb8..24569aec21 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -58,6 +58,7 @@ cc_binary { "AGnss.cpp", "Gnss.cpp", "GnssBatching.cpp", + "GnssDebug.cpp", "GnssGeofence.cpp", "GnssHidlHal.cpp", "GnssNavigationMessageInterface.cpp", diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 0e3cdd3a6a..45d6b1d2f4 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -21,6 +21,7 @@ #include "AGnss.h" #include "GnssBatching.h" #include "GnssConfiguration.h" +#include "GnssDebug.h" #include "GnssGeofence.h" #include "GnssMeasurementInterface.h" #include "GnssNavigationMessageInterface.h" @@ -120,4 +121,11 @@ ndk::ScopedAStatus Gnss::getExtensionGnssNavigationMessage( return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Gnss::getExtensionGnssDebug(std::shared_ptr* iGnssDebug) { + ALOGD("Gnss::getExtensionGnssDebug"); + + *iGnssDebug = SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index 4feb781d10..f59607f267 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +47,7 @@ class Gnss : public BnGnss { ndk::ScopedAStatus getExtensionGnssNavigationMessage( std::shared_ptr* iGnssNavigationMessage) override; ndk::ScopedAStatus getExtensionAGnss(std::shared_ptr* iAGnss) override; + ndk::ScopedAStatus getExtensionGnssDebug(std::shared_ptr* iGnssDebug) override; std::shared_ptr mGnssConfiguration; std::shared_ptr mGnssPowerIndication; diff --git a/gnss/aidl/default/GnssDebug.cpp b/gnss/aidl/default/GnssDebug.cpp new file mode 100644 index 0000000000..f40c0bcef0 --- /dev/null +++ b/gnss/aidl/default/GnssDebug.cpp @@ -0,0 +1,50 @@ +/* + * 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. + */ + +#define LOG_TAG "GnssDebugAidl" + +#include "GnssDebug.h" +#include +#include "MockLocation.h" + +namespace aidl::android::hardware::gnss { + +ndk::ScopedAStatus GnssDebug::getDebugData(DebugData* debugData) { + ALOGD("GnssDebug::getDebugData"); + + PositionDebug positionDebug = {.valid = true, + .latitudeDegrees = 37.4219999, + .longitudeDegrees = -122.0840575, + .altitudeMeters = 1.60062531, + .speedMetersPerSec = 0, + .bearingDegrees = 0, + .horizontalAccuracyMeters = 5, + .verticalAccuracyMeters = 5, + .speedAccuracyMetersPerSecond = 1, + .bearingAccuracyDegrees = 90, + .ageSeconds = 0.99}; + TimeDebug timeDebug = {.timeEstimateMs = 1519930775453L, + .timeUncertaintyNs = 1000, + .frequencyUncertaintyNsPerSec = 5.0e4}; + std::vector satelliteDataArrayDebug = {}; + debugData->position = positionDebug; + debugData->time = timeDebug; + debugData->satelliteDataArray = satelliteDataArrayDebug; + + return ndk::ScopedAStatus::ok(); +} + +} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/GnssDebug.h b/gnss/aidl/default/GnssDebug.h new file mode 100644 index 0000000000..001d47cf5c --- /dev/null +++ b/gnss/aidl/default/GnssDebug.h @@ -0,0 +1,28 @@ +/* + * 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 + +namespace aidl::android::hardware::gnss { + +struct GnssDebug : public BnGnssDebug { + public: + ndk::ScopedAStatus getDebugData(DebugData* debugData) override; +}; + +} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index aac59db2a0..36be631743 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -19,10 +19,12 @@ #include #include #include +#include #include #include #include #include +#include #include "AGnssCallbackAidl.h" #include "GnssBatchingCallback.h" #include "GnssGeofenceCallback.h" @@ -43,6 +45,7 @@ using android::hardware::gnss::IGnss; using android::hardware::gnss::IGnssBatching; using android::hardware::gnss::IGnssBatchingCallback; using android::hardware::gnss::IGnssConfiguration; +using android::hardware::gnss::IGnssDebug; using android::hardware::gnss::IGnssGeofence; using android::hardware::gnss::IGnssGeofenceCallback; using android::hardware::gnss::IGnssMeasurementCallback; @@ -55,6 +58,12 @@ using android::hardware::gnss::SatellitePvt; using GnssConstellationTypeAidl = android::hardware::gnss::GnssConstellationType; +static bool IsAutomotiveDevice() { + char buffer[PROPERTY_VALUE_MAX] = {0}; + property_get("ro.hardware.type", buffer, ""); + return strncmp(buffer, "automotive", PROPERTY_VALUE_MAX) == 0; +} + /* * SetupTeardownCreateCleanup: * Requests the gnss HAL then calls cleanup @@ -820,3 +829,50 @@ TEST_P(GnssHalTest, TestAGnssExtension) { status = iAGnss->setServer(AGnssType::SUPL, String16("supl.google.com"), 7275); ASSERT_TRUE(status.isOk()); } + +/* + * GnssDebugValuesSanityTest: + * Ensures that GnssDebug values make sense. + */ +TEST_P(GnssHalTest, GnssDebugValuesSanityTest) { + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + return; + } + sp iGnssDebug; + auto status = aidl_gnss_hal_->getExtensionGnssDebug(&iGnssDebug); + ASSERT_TRUE(status.isOk()); + + if (!IsAutomotiveDevice() && gnss_cb_->info_cbq_.calledCount() > 0) { + ASSERT_TRUE(iGnssDebug != nullptr); + + IGnssDebug::DebugData data; + auto status = iGnssDebug->getDebugData(&data); + ASSERT_TRUE(status.isOk()); + + if (data.position.valid) { + ASSERT_TRUE(data.position.latitudeDegrees >= -90 && + data.position.latitudeDegrees <= 90); + ASSERT_TRUE(data.position.longitudeDegrees >= -180 && + data.position.longitudeDegrees <= 180); + ASSERT_TRUE(data.position.altitudeMeters >= -1000 && // Dead Sea: -414m + data.position.altitudeMeters <= 20000); // Mount Everest: 8850m + ASSERT_TRUE(data.position.speedMetersPerSec >= 0 && + data.position.speedMetersPerSec <= 600); + ASSERT_TRUE(data.position.bearingDegrees >= -360 && + data.position.bearingDegrees <= 360); + ASSERT_TRUE(data.position.horizontalAccuracyMeters > 0 && + data.position.horizontalAccuracyMeters <= 20000000); + ASSERT_TRUE(data.position.verticalAccuracyMeters > 0 && + data.position.verticalAccuracyMeters <= 20000); + ASSERT_TRUE(data.position.speedAccuracyMetersPerSecond > 0 && + data.position.speedAccuracyMetersPerSecond <= 500); + ASSERT_TRUE(data.position.bearingAccuracyDegrees > 0 && + data.position.bearingAccuracyDegrees <= 180); + ASSERT_TRUE(data.position.ageSeconds >= 0); + } + ASSERT_TRUE(data.time.timeEstimateMs >= 1483228800000); // Jan 01 2017 00:00:00 GMT. + ASSERT_TRUE(data.time.timeUncertaintyNs > 0); + ASSERT_TRUE(data.time.frequencyUncertaintyNsPerSec > 0 && + data.time.frequencyUncertaintyNsPerSec <= 2.0e5); // 200 ppm + } +} -- GitLab From 5e86eed7dff844c5ccb0f96821429f18bcfae4a4 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Mon, 13 Dec 2021 17:06:34 -0800 Subject: [PATCH 333/825] Update some comments for tuner AIDL HAL. *) Clarify the meaning and unit of FrontendStatus. *) Add comment for STC ready support. *) Support for control signal (e.g. TMCC) change monitoring Bug: 183634950 Bug: 202247846 Bug: 183630794 Test: Make Change-Id: I3c48993c354e865b0edfe56adbd34c7fce120efc --- .../hardware/tv/tuner/DemuxFilterStatus.aidl | 3 +- .../hardware/tv/tuner/FrontendEventType.aidl | 4 ++- .../hardware/tv/tuner/FrontendStatus.aidl | 28 +++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl index f07c26f4de..e6f3b63b95 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl @@ -24,7 +24,8 @@ package android.hardware.tv.tuner; @Backing(type="byte") enum DemuxFilterStatus { /** - * The data in the filter buffer is ready to be read. + * The data in the filter buffer is ready to be read. It can also be used to know the STC + * (System Time Clock) ready status if it's PCR filter. */ DATA_READY = 1 << 0, diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendEventType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendEventType.aidl index 40b5161b3b..501dc1f7a1 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendEventType.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendEventType.aidl @@ -24,7 +24,9 @@ package android.hardware.tv.tuner; @Backing(type="int") enum FrontendEventType { /** - * The frontend has locked to the signal specified by the tune method. + * The frontend has locked to the signal specified by the tune method. It can also be notified + * after signal is locked if the signal attributes transmission parameter of the signal is + * changed (e.g., Modulation). */ LOCKED, diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl index 234e18392e..6e6f315d38 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl @@ -91,11 +91,19 @@ union FrontendStatus { /** * AGC value is normalized from 0 to 255. + * Larger AGC values indicate it is applying more gain. */ int agc; boolean isLnaOn; + /** + * Layer Error status. + * + * The order of the vectors is in ascending order of the required CNR (Contrast-to-noise ratio). + * The most robust layer is the first. For example, in ISDB-T, isLayerError[0] is the + * information of layer A. isLayerError[1] is the information of layer B. + */ boolean[] isLayerError; /** @@ -119,16 +127,28 @@ union FrontendStatus { /** * Modulation status. + * + * The order of the vectors is in ascending order of the required CNR (Contrast-to-noise ratio). + * The most robust layer is the first. For example, in ISDB-T, modulations[0] is the information + * of layer A. modulations[1] is the information of layer B. */ FrontendModulation[] modulations; /** * Bit error ratio status. + * + * The order of the vectors is in ascending order of the required CNR (Contrast-to-noise ratio). + * The most robust layer is the first. For example, in ISDB-T, bers[0] is the information of + * layer A. bers[1] is the information of layer B. */ int[] bers; /** * Code rate status. + * + * The order of the vectors is in ascending order of the required CN. The most robust layer is + * the first. For example, in ISDB-T, codeRates[0] is the information of layer A. codeRates[1] + * is the information of layer B. */ FrontendInnerFec[] codeRates; @@ -160,11 +180,19 @@ union FrontendStatus { /** * Frontend Interleaving Modes. + * + * The order of the vectors is in ascending order of the required CNR (Contrast-to-noise ratio). + * The most robust layer is the first. For example, in ISDB-T, interleaving[0] is the + * information of layer A. interleaving[1] is the information of layer B. */ FrontendInterleaveMode[] interleaving; /** * Segments in ISDB-T Specification of all the channels. + * + * The order of the vectors is in ascending order of the required CNR (Contrast-to-noise ratio). + * The most robust layer is the first. For example, in ISDB-T, isdbtSegment[0] is the + * information of layer A. isdbtSegment[1] is the information of layer B. */ int[] isdbtSegment; -- GitLab From bf39d4db34d5800ac329b1d4ff227b8b2f2957ba Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Fri, 3 Dec 2021 12:20:07 -0800 Subject: [PATCH 334/825] VTS test for previewStabilization Bug: 200197440 Test: VtsHalCameraProviderV2_4TargetTest --gtest_filter=PerInstance/CameraHidlTest.processCaptureRequestPreviewStab* Change-Id: Iba71983a69d20af605924fa6f1c0697e49d911f8 Signed-off-by: Jayant Chowdhary --- .../VtsHalCameraProviderV2_4TargetTest.cpp | 275 +++++++++++++++++- 1 file changed, 265 insertions(+), 10 deletions(-) diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index 77974fcbe4..36b3d728d0 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -666,7 +666,7 @@ public: void waitForBuffersReturned(); - private: + private: bool processCaptureResultLocked(const CaptureResult& results, hidl_vec physicalCameraMetadata); Return notifyHelper(const hidl_vec& msgs, @@ -906,7 +906,7 @@ public: static Status getMandatoryConcurrentStreams(const camera_metadata_t* staticMeta, std::vector* outputStreams); - + static bool supportsPreviewStabilization(const std::string& name, sp provider); static Status getJpegBufferSize(camera_metadata_t *staticMeta, uint32_t* outBufSize); static Status isConstrainedModeAvailable(camera_metadata_t *staticMeta); @@ -953,6 +953,9 @@ public: void processCaptureRequestInternal(uint64_t bufferusage, RequestTemplate reqTemplate, bool useSecureOnlyCameras); + void processPreviewStabilizationCaptureRequestInternal( + bool previewStabilizationOn, + /*inout*/ std::unordered_map& cameraDeviceToTimeLag); // Used by switchToOffline where a new result queue is created for offline reqs void updateInflightResultQueue(std::shared_ptr resultQueue); @@ -1006,7 +1009,11 @@ protected: // Buffers are added by process_capture_result when output buffers // return from HAL but framework. - ::android::Vector resultOutputBuffers; + struct StreamBufferAndTimestamp { + StreamBuffer buffer; + nsecs_t timeStamp; + }; + ::android::Vector resultOutputBuffers; std::unordered_set expectedPhysicalResults; @@ -1421,8 +1428,25 @@ bool CameraHidlTest::DeviceCb::processCaptureResultLocked(const CaptureResult& r return notify; } - request->resultOutputBuffers.appendArray(results.outputBuffers.data(), - results.outputBuffers.size()); + for (const auto& buffer : results.outputBuffers) { + // wait for the fence timestamp and store it along with the buffer + // TODO: Check if we really need the dup here + sp releaseFence = nullptr; + if (buffer.releaseFence && (buffer.releaseFence->numFds == 1) && + buffer.releaseFence->data[0] >= 0) { + releaseFence = new android::Fence(dup(buffer.releaseFence->data[0])); + } + InFlightRequest::StreamBufferAndTimestamp streamBufferAndTimestamp; + streamBufferAndTimestamp.buffer = buffer; + streamBufferAndTimestamp.timeStamp = systemTime(); + if (releaseFence && releaseFence->isValid()) { + releaseFence->wait(/*ms*/ 300); + nsecs_t releaseTime = releaseFence->getSignalTime(); + if (streamBufferAndTimestamp.timeStamp < releaseTime) + streamBufferAndTimestamp.timeStamp = releaseTime; + } + request->resultOutputBuffers.push_back(streamBufferAndTimestamp); + } // If shutter event is received notify the pending threads. if (request->shutterTimestamp != 0) { notify = true; @@ -4793,7 +4817,7 @@ void CameraHidlTest::processCaptureRequestInternal(uint64_t bufferUsage, ASSERT_FALSE(inflightReq.errorCodeValid); ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u); - ASSERT_EQ(testStream.id, inflightReq.resultOutputBuffers[0].streamId); + ASSERT_EQ(testStream.id, inflightReq.resultOutputBuffers[0].buffer.streamId); // For camera device 3.8 or newer, shutterReadoutTimestamp must be // available, and it must be >= shutterTimestamp + exposureTime, and @@ -4853,7 +4877,197 @@ void CameraHidlTest::processCaptureRequestInternal(uint64_t bufferUsage, ASSERT_FALSE(inflightReq.errorCodeValid); ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u); - ASSERT_EQ(testStream.id, inflightReq.resultOutputBuffers[0].streamId); + ASSERT_EQ(testStream.id, inflightReq.resultOutputBuffers[0].buffer.streamId); + } + + if (useHalBufManager) { + verifyBuffersReturned(session, deviceVersion, testStream.id, cb); + } + + ret = session->close(); + ASSERT_TRUE(ret.isOk()); + } +} + +TEST_P(CameraHidlTest, processCaptureRequestPreviewStabilization) { + std::unordered_map cameraDeviceToTimeLag; + processPreviewStabilizationCaptureRequestInternal(/*previewStabilizationOn*/ false, + cameraDeviceToTimeLag); + processPreviewStabilizationCaptureRequestInternal(/*previewStabilizationOn*/ true, + cameraDeviceToTimeLag); +} + +void CameraHidlTest::processPreviewStabilizationCaptureRequestInternal( + bool previewStabilizationOn, + // Used as output when preview stabilization is off, as output when its + // on. + std::unordered_map& cameraDeviceToTimeLag) { + hidl_vec cameraDeviceNames = getCameraDeviceNames(mProvider); + AvailableStream streamThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; + uint64_t bufferId = 1; + uint32_t frameNumber = 1; + ::android::hardware::hidl_vec settings; + + for (const auto& name : cameraDeviceNames) { + int deviceVersion = getCameraDeviceVersion(name, mProviderType); + if (deviceVersion == CAMERA_DEVICE_API_VERSION_1_0) { + continue; + } else if (deviceVersion <= 0) { + ALOGE("%s: Unsupported device version %d", __func__, deviceVersion); + ADD_FAILURE(); + return; + } + + if (!supportsPreviewStabilization(name, mProvider)) { + ALOGI(" %s Camera device %s doesn't support preview stabilization, skipping", __func__, + name.c_str()); + continue; + } + + if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_8) { + ALOGE("%s: device version < 3.8 must not advertise preview stabilization," + " camera metadata validation will fail", + __func__); + ADD_FAILURE(); + } + + V3_2::Stream testStream; + HalStreamConfiguration halStreamConfig; + sp session; + sp cb; + bool supportsPartialResults = false; + bool useHalBufManager = false; + uint32_t partialResultCount = 0; + configureSingleStream(name, deviceVersion, mProvider, &streamThreshold, + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, RequestTemplate::PREVIEW, + &session /*out*/, &testStream /*out*/, &halStreamConfig /*out*/, + &supportsPartialResults /*out*/, &partialResultCount /*out*/, + &useHalBufManager /*out*/, &cb /*out*/); + + std::shared_ptr resultQueue; + auto resultQueueRet = + session->getCaptureResultMetadataQueue([&resultQueue](const auto& descriptor) { + resultQueue = std::make_shared(descriptor); + if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) { + ALOGE("%s: HAL returns empty result metadata fmq," + " not use it", + __func__); + resultQueue = nullptr; + // Don't use the queue onwards. + } + }); + ASSERT_TRUE(resultQueueRet.isOk()); + + InFlightRequest inflightReq = {1, false, supportsPartialResults, partialResultCount, + resultQueue}; + + Return ret; + android::hardware::camera::common::V1_0::helper::CameraMetadata defaultSettings; + ret = session->constructDefaultRequestSettings( + RequestTemplate::PREVIEW, [&](auto status, const auto& req) { + ASSERT_EQ(Status::OK, status); + const camera_metadata_t* metadata = + reinterpret_cast(req.data()); + defaultSettings = metadata; + settings = req; + }); + ASSERT_TRUE(ret.isOk()); + android::status_t metadataRet = ::android::OK; + uint8_t videoStabilizationMode = ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF; + if (previewStabilizationOn) { + videoStabilizationMode = ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION; + metadataRet = defaultSettings.update(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, + &videoStabilizationMode, 1); + } else { + metadataRet = defaultSettings.update(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, + &videoStabilizationMode, 1); + } + ASSERT_EQ(metadataRet, ::android::OK); + hidl_handle buffer_handle; + StreamBuffer outputBuffer; + if (useHalBufManager) { + outputBuffer = {halStreamConfig.streams[0].id, + /*bufferId*/ 0, + buffer_handle, + BufferStatus::OK, + nullptr, + nullptr}; + } else { + allocateGraphicBuffer( + testStream.width, testStream.height, + /* We don't look at halStreamConfig.streams[0].consumerUsage + * since that is 0 for output streams + */ + android_convertGralloc1To0Usage(halStreamConfig.streams[0].producerUsage, + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + halStreamConfig.streams[0].overrideFormat, &buffer_handle); + outputBuffer = {halStreamConfig.streams[0].id, + bufferId, + buffer_handle, + BufferStatus::OK, + nullptr, + nullptr}; + } + ::android::hardware::hidl_vec outputBuffers = {outputBuffer}; + StreamBuffer emptyInputBuffer = {-1, 0, nullptr, BufferStatus::ERROR, nullptr, nullptr}; + CaptureRequest request = {frameNumber, 0 /* fmqSettingsSize */, settings, emptyInputBuffer, + outputBuffers}; + + { + std::unique_lock l(mLock); + mInflightMap.clear(); + mInflightMap.add(frameNumber, &inflightReq); + } + + Status status = Status::INTERNAL_ERROR; + uint32_t numRequestProcessed = 0; + hidl_vec cachesToRemove; + Return returnStatus = session->processCaptureRequest( + {request}, cachesToRemove, [&status, &numRequestProcessed](auto s, uint32_t n) { + status = s; + numRequestProcessed = n; + }); + ASSERT_TRUE(returnStatus.isOk()); + ASSERT_EQ(Status::OK, status); + ASSERT_EQ(numRequestProcessed, 1u); + + { + std::unique_lock l(mLock); + while (!inflightReq.errorCodeValid && + ((0 < inflightReq.numBuffersLeft) || (!inflightReq.haveResultMetadata))) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kStreamBufferTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + ASSERT_FALSE(inflightReq.errorCodeValid); + ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u); + ASSERT_EQ(testStream.id, inflightReq.resultOutputBuffers[0].buffer.streamId); + ASSERT_TRUE(inflightReq.shutterReadoutTimestampValid); + nsecs_t readoutTimestamp = inflightReq.shutterReadoutTimestamp; + + if (previewStabilizationOn) { + // Here we collect the time difference between the buffer ready + // timestamp - notify readout timestamp. + // timeLag = buffer ready timestamp - notify readout timestamp. + // timeLag(previewStabilization) must be <= + // timeLag(stabilization off) + 1 frame duration. + auto it = cameraDeviceToTimeLag.find(name.c_str()); + camera_metadata_entry e; + e = inflightReq.collectedResult.find(ANDROID_SENSOR_FRAME_DURATION); + ASSERT_TRUE(e.count > 0); + nsecs_t frameDuration = e.data.i64[0]; + ASSERT_TRUE(it != cameraDeviceToTimeLag.end()); + + nsecs_t previewStabOnLagTime = + inflightReq.resultOutputBuffers[0].timeStamp - readoutTimestamp; + ASSERT_TRUE(previewStabOnLagTime <= (it->second + frameDuration)); + } else { + // Fill in the buffer ready timestamp - notify timestamp; + cameraDeviceToTimeLag[std::string(name.c_str())] = + inflightReq.resultOutputBuffers[0].timeStamp - readoutTimestamp; + } } if (useHalBufManager) { @@ -5434,7 +5648,7 @@ TEST_P(CameraHidlTest, processCaptureRequestBurstISO) { ASSERT_FALSE(inflightReqs[i].errorCodeValid); ASSERT_NE(inflightReqs[i].resultOutputBuffers.size(), 0u); - ASSERT_EQ(previewStream.id, inflightReqs[i].resultOutputBuffers[0].streamId); + ASSERT_EQ(previewStream.id, inflightReqs[i].resultOutputBuffers[0].buffer.streamId); ASSERT_FALSE(inflightReqs[i].collectedResult.isEmpty()); ASSERT_TRUE(inflightReqs[i].collectedResult.exists(ANDROID_SENSOR_SENSITIVITY)); camera_metadata_entry_t isoResult = inflightReqs[i].collectedResult.find( @@ -5718,7 +5932,7 @@ TEST_P(CameraHidlTest, switchToOffline) { ASSERT_FALSE(inflightReqs[i].errorCodeValid); ASSERT_NE(inflightReqs[i].resultOutputBuffers.size(), 0u); - ASSERT_EQ(stream.id, inflightReqs[i].resultOutputBuffers[0].streamId); + ASSERT_EQ(stream.id, inflightReqs[i].resultOutputBuffers[0].buffer.streamId); ASSERT_FALSE(inflightReqs[i].collectedResult.isEmpty()); } @@ -5914,7 +6128,7 @@ TEST_P(CameraHidlTest, flushPreviewRequest) { if (!inflightReq.errorCodeValid) { ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u); - ASSERT_EQ(previewStream.id, inflightReq.resultOutputBuffers[0].streamId); + ASSERT_EQ(previewStream.id, inflightReq.resultOutputBuffers[0].buffer.streamId); } else { switch (inflightReq.errorCode) { case ErrorCode::ERROR_REQUEST: @@ -7536,6 +7750,47 @@ void CameraHidlTest::configurePreviewStream(const std::string &name, int32_t dev previewStream, halStreamConfig, supportsPartialResults, partialResultCount, useHalBufManager, outCb, streamConfigCounter); } + +bool CameraHidlTest::supportsPreviewStabilization(const std::string& name, + sp provider) { + Return ret; + sp device3_x = nullptr; + ret = provider->getCameraDeviceInterface_V3_x(name, [&](auto status, const auto& device) { + ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status); + ASSERT_EQ(Status::OK, status); + ASSERT_NE(device, nullptr); + device3_x = device; + }); + if (!(ret.isOk())) { + ADD_FAILURE() << "Failed to get camera device interface for " << name; + } + + camera_metadata_t* staticMeta = nullptr; + ret = device3_x->getCameraCharacteristics([&](Status s, CameraMetadata metadata) { + ASSERT_EQ(Status::OK, s); + staticMeta = + clone_camera_metadata(reinterpret_cast(metadata.data())); + }); + if (!(ret.isOk())) { + ADD_FAILURE() << "Failed to get camera characteristics for " << name; + } + // Go through the characteristics and see if video stabilization modes have + // preview stabilization + camera_metadata_ro_entry entry; + + int retcode = find_camera_metadata_ro_entry( + staticMeta, ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES, &entry); + if ((0 == retcode) && (entry.count > 0)) { + for (auto i = 0; i < entry.count; i++) { + if (entry.data.u8[i] == + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION) { + return true; + } + } + } + return false; +} + // Open a device session and configure a preview stream. void CameraHidlTest::configureSingleStream( const std::string& name, int32_t deviceVersion, sp provider, -- GitLab From fcedda02cc1def3c10db9b9f260baf369419e100 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Mon, 13 Dec 2021 17:08:02 -0800 Subject: [PATCH 335/825] Add new features to tuner AIDL HAL. *) Adding key frame info (ScIndexMask) to DemuxFilterMediaEvent. *) Add more AAC formats. *) Support dumping frontend hardware information. *) Move LNA from IFrontend to ITuner. Bug: 202978951 Bug: 205265630 Bug: 184017033 Bug: 203623028 Test: atest VtsHalTvTunerTargetTest Change-Id: I8256da7f41c96d7de66d2796dd35c51637078da0 --- .../hardware/tv/tuner/AudioStreamType.aidl | 4 ++++ .../tv/tuner/DemuxFilterMediaEvent.aidl | 1 + .../android/hardware/tv/tuner/IFrontend.aidl | 2 +- .../android/hardware/tv/tuner/ITuner.aidl | 1 + .../hardware/tv/tuner/AudioStreamType.aidl | 20 +++++++++++++++++++ .../tv/tuner/DemuxFilterMediaEvent.aidl | 7 +++++++ .../android/hardware/tv/tuner/IFrontend.aidl | 17 +++++++++------- .../android/hardware/tv/tuner/ITuner.aidl | 7 +++++++ tv/tuner/aidl/default/Frontend.cpp | 13 ++++++------ tv/tuner/aidl/default/Frontend.h | 2 +- tv/tuner/aidl/default/Tuner.cpp | 6 ++++++ tv/tuner/aidl/default/Tuner.h | 1 + .../aidl/vts/functional/FrontendTests.cpp | 19 ++++++++++++++++++ tv/tuner/aidl/vts/functional/FrontendTests.h | 2 ++ .../functional/VtsHalTvTunerTargetTest.cpp | 8 ++++++++ 15 files changed, 95 insertions(+), 15 deletions(-) diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl index bfd2aa8b1f..6c538ea951 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl @@ -51,4 +51,8 @@ enum AudioStreamType { OPUS = 13, VORBIS = 14, DRA = 15, + AAC_ADTS = 16, + AAC_LATM = 17, + AAC_HE_ADTS = 18, + AAC_HE_LATM = 19, } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl index 993c6396e5..61a955590e 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl @@ -48,4 +48,5 @@ parcelable DemuxFilterMediaEvent { int mpuSequenceNumber; boolean isPesPrivateData; android.hardware.tv.tuner.DemuxFilterMediaEventExtraMetaData extraMetaData; + android.hardware.tv.tuner.DemuxFilterScIndexMask scIndexMask; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl index ed5b0c02c7..e7aa070552 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl @@ -43,7 +43,7 @@ interface IFrontend { void stopScan(); android.hardware.tv.tuner.FrontendStatus[] getStatus(in android.hardware.tv.tuner.FrontendStatusType[] statusTypes); void setLnb(in int lnbId); - void setLna(in boolean bEnable); int linkCiCam(in int ciCamId); void unlinkCiCam(in int ciCamId); + String getHardwareInfo(); } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl index 0e903d8a36..decf5b112b 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl @@ -44,4 +44,5 @@ interface ITuner { int[] getLnbIds(); android.hardware.tv.tuner.ILnb openLnbById(in int lnbId); android.hardware.tv.tuner.ILnb openLnbByName(in String lnbName, out int[] lnbId); + void setLna(in boolean bEnable); } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl index 1bb5c68fb3..9e9a8cf78b 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl @@ -99,4 +99,24 @@ enum AudioStreamType { * SJ/T 11368-2006 */ DRA, + + /* + * AAC with ADTS (Audio Data Transport Format). + */ + AAC_ADTS, + + /* + * AAC with ADTS with LATM (Low-overhead MPEG-4 Audio Transport Multiplex). + */ + AAC_LATM, + + /* + * High-Efficiency AAC (HE-AAC) with ADTS (Audio Data Transport Format). + */ + AAC_HE_ADTS, + + /* + * High-Efficiency AAC (HE-AAC) with LATM (Low-overhead MPEG-4 Audio Transport Multiplex). + */ + AAC_HE_LATM, } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl index e92b711fd2..32f0cb28bb 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl @@ -19,6 +19,7 @@ package android.hardware.tv.tuner; import android.hardware.common.NativeHandle; import android.hardware.tv.tuner.DemuxFilterMediaEventExtraMetaData; +import android.hardware.tv.tuner.DemuxFilterScIndexMask; /** * Filter Event for Audio or Video Filter. @@ -84,4 +85,10 @@ parcelable DemuxFilterMediaEvent { boolean isPesPrivateData; DemuxFilterMediaEventExtraMetaData extraMetaData; + + /** + * DemuxFilterScIndexMask for the key frame info. It's optional to hardware which can only + * access unit framing at decode stage. + */ + DemuxFilterScIndexMask scIndexMask; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl index b2717db3c1..5b3ce39c29 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl @@ -116,13 +116,6 @@ interface IFrontend { */ void setLnb(in int lnbId); - /** - * Enable or Disable Low Noise Amplifier (LNA). - * - * @param bEnable true if activate LNA module; false if deactivate LNA - */ - void setLna(in boolean bEnable); - /** * Link Conditional Access Modules (CAM) to Frontend support Common * Interface (CI) bypass mode. @@ -143,4 +136,14 @@ interface IFrontend { * @param ciCamId specify CI-CAM Id to unlink. */ void unlinkCiCam(in int ciCamId); + + /** + * Request Hardware information about the frontend. + * + * The client may use this to collect vendor specific hardware information, e.g. RF + * chip version, Demod chip version, detailed status of dvbs blind scan, etc. + * + * @return the frontend hardware information. + */ + String getHardwareInfo(); } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl index ab8b0b81a9..1fcbb06706 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl @@ -120,4 +120,11 @@ interface ITuner { * @return the newly opened Lnb iterface. */ ILnb openLnbByName(in String lnbName, out int[] lnbId); + + /** + * Enable or Disable Low Noise Amplifier (LNA). + * + * @param bEnable true if activate LNA module; false if deactivate LNA + */ + void setLna(in boolean bEnable); } diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index a4dde2a721..e35a8d931c 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -691,12 +691,6 @@ Frontend::~Frontend() {} return ::ndk::ScopedAStatus::ok(); } -::ndk::ScopedAStatus Frontend::setLna(bool /* in_bEnable */) { - ALOGV("%s", __FUNCTION__); - - return ::ndk::ScopedAStatus::ok(); -} - ::ndk::ScopedAStatus Frontend::setLnb(int32_t /* in_lnbId */) { ALOGV("%s", __FUNCTION__); if (!supportsSatellite()) { @@ -731,6 +725,13 @@ binder_status_t Frontend::dump(int fd, const char** /* args */, uint32_t /* numA return STATUS_OK; } +::ndk::ScopedAStatus Frontend::getHardwareInfo(std::string* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + *_aidl_return = "Sample Frontend"; + return ::ndk::ScopedAStatus::ok(); +} + FrontendType Frontend::getFrontendType() { return mType; } diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h index 5e7b10c3c2..66ae90130a 100644 --- a/tv/tuner/aidl/default/Frontend.h +++ b/tv/tuner/aidl/default/Frontend.h @@ -46,9 +46,9 @@ class Frontend : public BnFrontend { ::ndk::ScopedAStatus getStatus(const std::vector& in_statusTypes, std::vector* _aidl_return) override; ::ndk::ScopedAStatus setLnb(int32_t in_lnbId) override; - ::ndk::ScopedAStatus setLna(bool in_bEnable) override; ::ndk::ScopedAStatus linkCiCam(int32_t in_ciCamId, int32_t* _aidl_return) override; ::ndk::ScopedAStatus unlinkCiCam(int32_t in_ciCamId) override; + ::ndk::ScopedAStatus getHardwareInfo(std::string* _aidl_return) override; binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp index 96e83bbf65..fbf4763af9 100644 --- a/tv/tuner/aidl/default/Tuner.cpp +++ b/tv/tuner/aidl/default/Tuner.cpp @@ -317,6 +317,12 @@ std::shared_ptr Tuner::getFrontendById(int32_t frontendId) { return ::ndk::ScopedAStatus::ok(); } +::ndk::ScopedAStatus Tuner::setLna(bool /* in_bEnable */) { + ALOGV("%s", __FUNCTION__); + + return ::ndk::ScopedAStatus::ok(); +} + binder_status_t Tuner::dump(int fd, const char** args, uint32_t numArgs) { ALOGV("%s", __FUNCTION__); { diff --git a/tv/tuner/aidl/default/Tuner.h b/tv/tuner/aidl/default/Tuner.h index 682496c15e..b33a1bebc9 100644 --- a/tv/tuner/aidl/default/Tuner.h +++ b/tv/tuner/aidl/default/Tuner.h @@ -56,6 +56,7 @@ class Tuner : public BnTuner { ::ndk::ScopedAStatus openLnbByName(const std::string& in_lnbName, std::vector* out_lnbId, std::shared_ptr* _aidl_return) override; + ::ndk::ScopedAStatus setLna(bool in_bEnable) override; binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp index 12b1f33735..59a2582889 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp +++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp @@ -475,6 +475,13 @@ void FrontendTests::getFrontendIdByType(FrontendType feType, int32_t& feId) { feId = INVALID_ID; } +AssertionResult FrontendTests::verifyHardwareInfo() { + EXPECT_TRUE(mFrontend) << "Test with openFrontendById first."; + std::string info; + ndk::ScopedAStatus status = mFrontend->getHardwareInfo(&info); + return AssertionResult(status.isOk() && !info.empty()); +} + void FrontendTests::tuneTest(FrontendConfig frontendConf) { int32_t feId; getFrontendIdByType(frontendConf.type, feId); @@ -491,6 +498,18 @@ void FrontendTests::tuneTest(FrontendConfig frontendConf) { ASSERT_TRUE(closeFrontend()); } +void FrontendTests::debugInfoTest(FrontendConfig frontendConf) { + int32_t feId; + getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(openFrontendById(feId)); + ASSERT_TRUE(setFrontendCallback()); + ASSERT_TRUE(tuneFrontend(frontendConf, false /*testWithDemux*/)); + ASSERT_TRUE(verifyHardwareInfo()); + ASSERT_TRUE(stopTuneFrontend(false /*testWithDemux*/)); + ASSERT_TRUE(closeFrontend()); +} + void FrontendTests::scanTest(FrontendConfig frontendConf, FrontendScanType scanType) { int32_t feId; getFrontendIdByType(frontendConf.type, feId); diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.h b/tv/tuner/aidl/vts/functional/FrontendTests.h index e5a9cd3553..8f769a0004 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.h +++ b/tv/tuner/aidl/vts/functional/FrontendTests.h @@ -94,10 +94,12 @@ class FrontendTests { AssertionResult linkCiCam(int32_t ciCamId); AssertionResult unlinkCiCam(int32_t ciCamId); + AssertionResult verifyHardwareInfo(); void getFrontendIdByType(FrontendType feType, int32_t& feId); void tuneTest(FrontendConfig frontendConf); void scanTest(FrontendConfig frontend, FrontendScanType type); + void debugInfoTest(FrontendConfig frontendConf); void setDvrTests(DvrTests* dvrTests) { mExternalDvrTests = dvrTests; } void setDemux(std::shared_ptr demux) { getDvrTests()->setDemux(demux); } diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp index 89e42dfa29..202f83f542 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp @@ -883,6 +883,14 @@ TEST_P(TunerFrontendAidlTest, LinkToCiCam) { mFrontendTests.tuneTest(frontendMap[live.frontendId]); } +TEST_P(TunerFrontendAidlTest, getHardwareInfo) { + description("Test Frontend get hardware info"); + if (!live.hasFrontendConnection) { + return; + } + mFrontendTests.debugInfoTest(frontendMap[live.frontendId]); +} + TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowVideoFilterTest) { description("Test Video Filter functionality in Broadcast use case."); if (!live.hasFrontendConnection) { -- GitLab From 91c9d1a821f60a14ddaaa5ba47c5a31e7c0c2260 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Wed, 15 Dec 2021 18:14:45 -0800 Subject: [PATCH 336/825] composer: cleanup CommandWriterBase and CommandReaderBase These classes are used by both the client and the service, which makes them confusing. This CL splits the logic for the client and the service. Bug: 208856704 Test: VTS Change-Id: I6fa89858afeee9113ea8c810261d734163a95ec9 --- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 4 +- .../VtsHalGraphicsComposer3_TargetTest.cpp | 7 +- .../functional/composer-vts/ReadbackVts.cpp | 10 +- .../composer-vts/include/ReadbackVts.h | 13 +- .../graphics/composer3/ComposerClientReader.h | 319 +++++++++ .../graphics/composer3/ComposerClientWriter.h | 272 ++++++++ .../graphics/composer3/command-buffer.h | 614 ------------------ 7 files changed, 609 insertions(+), 630 deletions(-) create mode 100644 graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h create mode 100644 graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h delete mode 100644 graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 8726043cf2..34dea9ecc2 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -167,8 +167,8 @@ class GraphicsCompositionTestBase : public ::testing::Test { int32_t mDisplayWidth; int32_t mDisplayHeight; std::vector mTestColorModes; - CommandWriterBase mWriter; - CommandReaderBase mReader; + ComposerClientWriter mWriter; + ComposerClientReader mReader; ::android::sp<::android::GraphicBuffer> mGraphicBuffer; std::unique_ptr mTestRenderEngine; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 20fffa9495..c21a196014 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -13,7 +13,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -1408,8 +1409,8 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { }}; // clang-format on - CommandWriterBase mWriter; - CommandReaderBase mReader; + ComposerClientWriter mWriter; + ComposerClientReader mReader; }; TEST_P(GraphicsComposerAidlCommandTest, SET_COLOR_TRANSFORM) { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp index a6954b4625..4de2d71441 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp @@ -32,7 +32,7 @@ const std::vector ReadbackHelper::colorModes = {ColorMode::SRGB, Colo const std::vector ReadbackHelper::dataspaces = {common::Dataspace::SRGB, common::Dataspace::DISPLAY_P3}; -void TestLayer::write(CommandWriterBase& writer) { +void TestLayer::write(ComposerClientWriter& writer) { writer.setLayerDisplayFrame(mDisplay, mLayer, mDisplayFrame); writer.setLayerSourceCrop(mDisplay, mLayer, mSourceCrop); writer.setLayerZOrder(mDisplay, mLayer, mZOrder); @@ -253,7 +253,7 @@ void ReadbackBuffer::checkReadbackBuffer(std::vector expectedColors) { EXPECT_EQ(::android::OK, status); } -void TestColorLayer::write(CommandWriterBase& writer) { +void TestColorLayer::write(ComposerClientWriter& writer) { TestLayer::write(writer); writer.setLayerCompositionType(mDisplay, mLayer, Composition::SOLID_COLOR); writer.setLayerColor(mDisplay, mLayer, mColor); @@ -296,7 +296,7 @@ TestBufferLayer::TestBufferLayer(const std::shared_ptr& client, setSourceCrop({0, 0, (float)width, (float)height}); } -void TestBufferLayer::write(CommandWriterBase& writer) { +void TestBufferLayer::write(ComposerClientWriter& writer) { TestLayer::write(writer); writer.setLayerCompositionType(mDisplay, mLayer, mComposition); writer.setLayerVisibleRegion(mDisplay, mLayer, std::vector(1, mDisplayFrame)); @@ -345,11 +345,11 @@ void TestBufferLayer::setBuffer(std::vector colors) { ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck()); } -void TestBufferLayer::setDataspace(common::Dataspace dataspace, CommandWriterBase& writer) { +void TestBufferLayer::setDataspace(common::Dataspace dataspace, ComposerClientWriter& writer) { writer.setLayerDataspace(mDisplay, mLayer, dataspace); } -void TestBufferLayer::setToClientComposition(CommandWriterBase& writer) { +void TestBufferLayer::setToClientComposition(ComposerClientWriter& writer) { writer.setLayerCompositionType(mDisplay, mLayer, Composition::CLIENT); } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h index d40e3d2d18..60a036e3fd 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h @@ -23,7 +23,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -61,7 +62,7 @@ class TestLayer { // call destroyLayers here virtual ~TestLayer(){}; - virtual void write(CommandWriterBase& writer); + virtual void write(ComposerClientWriter& writer); virtual LayerSettings toRenderEngineLayerSettings(); void setDisplayFrame(Rect frame) { mDisplayFrame = frame; } @@ -105,7 +106,7 @@ class TestColorLayer : public TestLayer { TestColorLayer(const std::shared_ptr& client, int64_t display) : TestLayer{client, display} {} - void write(CommandWriterBase& writer) override; + void write(ComposerClientWriter& writer) override; LayerSettings toRenderEngineLayerSettings() override; @@ -123,7 +124,7 @@ class TestBufferLayer : public TestLayer { uint32_t height, common::PixelFormat format, Composition composition = Composition::DEVICE); - void write(CommandWriterBase& writer) override; + void write(ComposerClientWriter& writer) override; LayerSettings toRenderEngineLayerSettings() override; @@ -131,9 +132,9 @@ class TestBufferLayer : public TestLayer { void setBuffer(std::vector colors); - void setDataspace(Dataspace dataspace, CommandWriterBase& writer); + void setDataspace(Dataspace dataspace, ComposerClientWriter& writer); - void setToClientComposition(CommandWriterBase& writer); + void setToClientComposition(ComposerClientWriter& writer); uint32_t getWidth() const { return mWidth; } diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h new file mode 100644 index 0000000000..1dc914555c --- /dev/null +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h @@ -0,0 +1,319 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +using aidl::android::hardware::graphics::common::BlendMode; +using aidl::android::hardware::graphics::common::ColorTransform; +using aidl::android::hardware::graphics::common::Dataspace; +using aidl::android::hardware::graphics::common::FRect; +using aidl::android::hardware::graphics::common::Rect; +using aidl::android::hardware::graphics::common::Transform; + +using namespace aidl::android::hardware::graphics::composer3; + +using aidl::android::hardware::common::NativeHandle; + +namespace aidl::android::hardware::graphics::composer3 { + +class ComposerClientReader { + public: + ~ComposerClientReader() { resetData(); } + + // Parse and execute commands from the command queue. The commands are + // actually return values from the server and will be saved in ReturnData. + void parse(const std::vector& results) { + resetData(); + + for (const auto& result : results) { + switch (result.getTag()) { + case CommandResultPayload::Tag::error: + parseSetError(result.get()); + break; + case CommandResultPayload::Tag::changedCompositionTypes: + parseSetChangedCompositionTypes( + result.get()); + break; + case CommandResultPayload::Tag::displayRequest: + parseSetDisplayRequests( + result.get()); + break; + case CommandResultPayload::Tag::presentFence: + parseSetPresentFence(result.get()); + break; + case CommandResultPayload::Tag::releaseFences: + parseSetReleaseFences(result.get()); + break; + case CommandResultPayload::Tag::presentOrValidateResult: + parseSetPresentOrValidateDisplayResult( + result.get()); + break; + case CommandResultPayload::Tag::clientTargetProperty: + parseSetClientTargetProperty( + result.get()); + break; + } + } + } + + std::vector takeErrors() { return std::move(mErrors); } + + bool hasChanges(int64_t display, uint32_t* outNumChangedCompositionTypes, + uint32_t* outNumLayerRequestMasks) const { + auto found = mReturnData.find(display); + if (found == mReturnData.end()) { + *outNumChangedCompositionTypes = 0; + *outNumLayerRequestMasks = 0; + return false; + } + + const ReturnData& data = found->second; + + *outNumChangedCompositionTypes = static_cast(data.compositionTypes.size()); + *outNumLayerRequestMasks = static_cast(data.requestMasks.size()); + + return !(data.compositionTypes.empty() && data.requestMasks.empty()); + } + + // Get and clear saved changed composition types. + void takeChangedCompositionTypes(int64_t display, std::vector* outLayers, + std::vector* outTypes) { + auto found = mReturnData.find(display); + if (found == mReturnData.end()) { + outLayers->clear(); + outTypes->clear(); + return; + } + + ReturnData& data = found->second; + + *outLayers = std::move(data.changedLayers); + *outTypes = std::move(data.compositionTypes); + } + + // Get and clear saved display requests. + void takeDisplayRequests(int64_t display, uint32_t* outDisplayRequestMask, + std::vector* outLayers, + std::vector* outLayerRequestMasks) { + auto found = mReturnData.find(display); + if (found == mReturnData.end()) { + *outDisplayRequestMask = 0; + outLayers->clear(); + outLayerRequestMasks->clear(); + return; + } + + ReturnData& data = found->second; + + *outDisplayRequestMask = data.displayRequests; + *outLayers = std::move(data.requestedLayers); + *outLayerRequestMasks = std::move(data.requestMasks); + } + + // Get and clear saved release fences. + void takeReleaseFences(int64_t display, std::vector* outLayers, + std::vector* outReleaseFences) { + auto found = mReturnData.find(display); + if (found == mReturnData.end()) { + outLayers->clear(); + outReleaseFences->clear(); + return; + } + + ReturnData& data = found->second; + + *outLayers = std::move(data.releasedLayers); + *outReleaseFences = std::move(data.releaseFences); + } + + // Get and clear saved present fence. + void takePresentFence(int64_t display, int* outPresentFence) { + auto found = mReturnData.find(display); + if (found == mReturnData.end()) { + *outPresentFence = -1; + return; + } + + ReturnData& data = found->second; + + *outPresentFence = data.presentFence; + data.presentFence = -1; + } + + // Get what stage succeeded during PresentOrValidate: Present or Validate + void takePresentOrValidateStage(int64_t display, uint32_t* state) { + auto found = mReturnData.find(display); + if (found == mReturnData.end()) { + *state = static_cast(-1); + return; + } + ReturnData& data = found->second; + *state = data.presentOrValidateState; + } + + // Get the client target properties requested by hardware composer. + void takeClientTargetProperty(int64_t display, ClientTargetProperty* outClientTargetProperty, + float* outWhitePointNits) { + auto found = mReturnData.find(display); + + // If not found, return the default values. + if (found == mReturnData.end()) { + outClientTargetProperty->pixelFormat = common::PixelFormat::RGBA_8888; + outClientTargetProperty->dataspace = Dataspace::UNKNOWN; + *outWhitePointNits = -1.f; + return; + } + + ReturnData& data = found->second; + *outClientTargetProperty = data.clientTargetProperty; + *outWhitePointNits = data.clientTargetWhitePointNits; + } + + private: + void resetData() { + mErrors.clear(); + + for (auto& data : mReturnData) { + if (data.second.presentFence >= 0) { + close(data.second.presentFence); + } + for (auto fence : data.second.releaseFences) { + if (fence >= 0) { + close(fence); + } + } + } + + mReturnData.clear(); + } + + void parseSetError(const CommandError& error) { mErrors.emplace_back(error); } + + void parseSetChangedCompositionTypes(const ChangedCompositionTypes& changedCompositionTypes) { + auto& data = mReturnData[changedCompositionTypes.display]; + + data.changedLayers.reserve(changedCompositionTypes.layers.size()); + data.compositionTypes.reserve(changedCompositionTypes.layers.size()); + for (const auto& layer : changedCompositionTypes.layers) { + data.changedLayers.push_back(layer.layer); + data.compositionTypes.push_back(layer.composition); + } + } + + void parseSetDisplayRequests(const DisplayRequest& displayRequest) { + auto& data = mReturnData[displayRequest.display]; + + data.displayRequests = displayRequest.mask; + data.requestedLayers.reserve(displayRequest.layerRequests.size()); + data.requestMasks.reserve(displayRequest.layerRequests.size()); + for (const auto& layerRequest : displayRequest.layerRequests) { + data.requestedLayers.push_back(layerRequest.layer); + data.requestMasks.push_back(layerRequest.mask); + } + } + + void parseSetPresentFence(const PresentFence& presentFence) { + auto& data = mReturnData[presentFence.display]; + if (data.presentFence >= 0) { + close(data.presentFence); + } + data.presentFence = dup(presentFence.fence.get()); + } + + void parseSetReleaseFences(const ReleaseFences& releaseFences) { + auto& data = mReturnData[releaseFences.display]; + data.releasedLayers.reserve(releaseFences.layers.size()); + data.releaseFences.reserve(releaseFences.layers.size()); + for (const auto& layer : releaseFences.layers) { + data.releasedLayers.push_back(layer.layer); + data.releaseFences.push_back(dup(layer.fence.get())); + } + } + + void parseSetPresentOrValidateDisplayResult(const PresentOrValidate& presentOrValidate) { + auto& data = mReturnData[presentOrValidate.display]; + data.presentOrValidateState = + presentOrValidate.result == PresentOrValidate::Result::Presented ? 1 : 0; + } + + void parseSetClientTargetProperty(const ClientTargetPropertyWithNits& clientTargetProperty) { + auto& data = mReturnData[clientTargetProperty.display]; + data.clientTargetProperty.pixelFormat = + clientTargetProperty.clientTargetProperty.pixelFormat; + data.clientTargetProperty.dataspace = clientTargetProperty.clientTargetProperty.dataspace; + data.clientTargetWhitePointNits = clientTargetProperty.whitePointNits; + } + + struct ReturnData { + int32_t displayRequests = 0; + + std::vector changedLayers; + std::vector compositionTypes; + + std::vector requestedLayers; + std::vector requestMasks; + + int presentFence = -1; + + std::vector releasedLayers; + std::vector releaseFences; + + uint32_t presentOrValidateState; + + ClientTargetProperty clientTargetProperty{common::PixelFormat::RGBA_8888, + Dataspace::UNKNOWN}; + float clientTargetWhitePointNits = -1.f; + }; + + std::vector mErrors; + std::unordered_map mReturnData; +}; + +} // namespace aidl::android::hardware::graphics::composer3 diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h new file mode 100644 index 0000000000..bd0367394a --- /dev/null +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -0,0 +1,272 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include + +using aidl::android::hardware::graphics::common::BlendMode; +using aidl::android::hardware::graphics::common::ColorTransform; +using aidl::android::hardware::graphics::common::Dataspace; +using aidl::android::hardware::graphics::common::FRect; +using aidl::android::hardware::graphics::common::Rect; +using aidl::android::hardware::graphics::common::Transform; + +using namespace aidl::android::hardware::graphics::composer3; + +using aidl::android::hardware::common::NativeHandle; + +namespace aidl::android::hardware::graphics::composer3 { + +class ComposerClientWriter { + public: + ComposerClientWriter() { reset(); } + + virtual ~ComposerClientWriter() { reset(); } + + void reset() { + mDisplayCommand.reset(); + mLayerCommand.reset(); + mCommands.clear(); + } + + void setColorTransform(int64_t display, const float* matrix, ColorTransform hint) { + ColorTransformPayload colorTransformPayload; + colorTransformPayload.matrix.assign(matrix, matrix + 16); + colorTransformPayload.hint = hint; + getDisplayCommand(display).colorTransform.emplace(std::move(colorTransformPayload)); + } + + void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target, + int acquireFence, Dataspace dataspace, const std::vector& damage) { + ClientTarget clientTargetCommand; + clientTargetCommand.buffer = getBuffer(slot, target, acquireFence); + clientTargetCommand.dataspace = dataspace; + clientTargetCommand.damage.assign(damage.begin(), damage.end()); + getDisplayCommand(display).clientTarget.emplace(std::move(clientTargetCommand)); + } + + void setOutputBuffer(int64_t display, uint32_t slot, const native_handle_t* buffer, + int releaseFence) { + getDisplayCommand(display).virtualDisplayOutputBuffer.emplace( + getBuffer(slot, buffer, releaseFence)); + } + + void validateDisplay(int64_t display) { getDisplayCommand(display).validateDisplay = true; } + + void presentOrvalidateDisplay(int64_t display) { + getDisplayCommand(display).presentOrValidateDisplay = true; + } + + void acceptDisplayChanges(int64_t display) { + getDisplayCommand(display).acceptDisplayChanges = true; + } + + void presentDisplay(int64_t display) { getDisplayCommand(display).presentDisplay = true; } + + void setLayerCursorPosition(int64_t display, int64_t layer, int32_t x, int32_t y) { + common::Point cursorPosition; + cursorPosition.x = x; + cursorPosition.y = y; + getLayerCommand(display, layer).cursorPosition.emplace(std::move(cursorPosition)); + } + + void setLayerBuffer(int64_t display, int64_t layer, uint32_t slot, + const native_handle_t* buffer, int acquireFence) { + getLayerCommand(display, layer).buffer = getBuffer(slot, buffer, acquireFence); + } + + void setLayerSurfaceDamage(int64_t display, int64_t layer, const std::vector& damage) { + getLayerCommand(display, layer).damage.emplace(damage.begin(), damage.end()); + } + + void setLayerBlendMode(int64_t display, int64_t layer, BlendMode mode) { + ParcelableBlendMode parcelableBlendMode; + parcelableBlendMode.blendMode = mode; + getLayerCommand(display, layer).blendMode.emplace(std::move(parcelableBlendMode)); + } + + void setLayerColor(int64_t display, int64_t layer, Color color) { + getLayerCommand(display, layer).color.emplace(std::move(color)); + } + + void setLayerCompositionType(int64_t display, int64_t layer, Composition type) { + ParcelableComposition compositionPayload; + compositionPayload.composition = type; + getLayerCommand(display, layer).composition.emplace(std::move(compositionPayload)); + } + + void setLayerDataspace(int64_t display, int64_t layer, Dataspace dataspace) { + ParcelableDataspace dataspacePayload; + dataspacePayload.dataspace = dataspace; + getLayerCommand(display, layer).dataspace.emplace(std::move(dataspacePayload)); + } + + void setLayerDisplayFrame(int64_t display, int64_t layer, const Rect& frame) { + getLayerCommand(display, layer).displayFrame.emplace(frame); + } + + void setLayerPlaneAlpha(int64_t display, int64_t layer, float alpha) { + PlaneAlpha planeAlpha; + planeAlpha.alpha = alpha; + getLayerCommand(display, layer).planeAlpha.emplace(std::move(planeAlpha)); + } + + void setLayerSidebandStream(int64_t display, int64_t layer, const native_handle_t* stream) { + NativeHandle handle; + if (stream) handle = ::android::dupToAidl(stream); + getLayerCommand(display, layer).sidebandStream.emplace(std::move(handle)); + } + + void setLayerSourceCrop(int64_t display, int64_t layer, const FRect& crop) { + getLayerCommand(display, layer).sourceCrop.emplace(crop); + } + + void setLayerTransform(int64_t display, int64_t layer, Transform transform) { + ParcelableTransform transformPayload; + transformPayload.transform = transform; + getLayerCommand(display, layer).transform.emplace(std::move(transformPayload)); + } + + void setLayerVisibleRegion(int64_t display, int64_t layer, const std::vector& visible) { + getLayerCommand(display, layer).visibleRegion.emplace(visible.begin(), visible.end()); + } + + void setLayerZOrder(int64_t display, int64_t layer, uint32_t z) { + ZOrder zorder; + zorder.z = z; + getLayerCommand(display, layer).z.emplace(std::move(zorder)); + } + + void setLayerPerFrameMetadata(int64_t display, int64_t layer, + const std::vector& metadataVec) { + getLayerCommand(display, layer) + .perFrameMetadata.emplace(metadataVec.begin(), metadataVec.end()); + } + + void setLayerColorTransform(int64_t display, int64_t layer, const float* matrix) { + getLayerCommand(display, layer).colorTransform.emplace(matrix, matrix + 16); + } + + void setLayerPerFrameMetadataBlobs(int64_t display, int64_t layer, + const std::vector& metadata) { + getLayerCommand(display, layer) + .perFrameMetadataBlob.emplace(metadata.begin(), metadata.end()); + } + + void setLayerFloatColor(int64_t display, int64_t layer, FloatColor color) { + getLayerCommand(display, layer).floatColor.emplace(color); + } + + void setLayerGenericMetadata(int64_t display, int64_t layer, const std::string& key, + const bool mandatory, const std::vector& value) { + GenericMetadata metadata; + metadata.key.name = key; + metadata.key.mandatory = mandatory; + metadata.value.assign(value.begin(), value.end()); + getLayerCommand(display, layer).genericMetadata.emplace(std::move(metadata)); + } + + void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) { + getLayerCommand(display, layer) + .whitePointNits.emplace(WhitePointNits{.nits = whitePointNits}); + } + + const std::vector& getPendingCommands() { + flushLayerCommand(); + flushDisplayCommand(); + return mCommands; + } + + private: + std::optional mDisplayCommand; + std::optional mLayerCommand; + std::vector mCommands; + + Buffer getBuffer(int slot, const native_handle_t* bufferHandle, int fence) { + Buffer bufferCommand; + bufferCommand.slot = slot; + if (bufferHandle) bufferCommand.handle.emplace(::android::dupToAidl(bufferHandle)); + if (fence > 0) bufferCommand.fence = ::ndk::ScopedFileDescriptor(fence); + return bufferCommand; + } + + void flushLayerCommand() { + if (mLayerCommand.has_value()) { + mDisplayCommand->layers.emplace_back(std::move(*mLayerCommand)); + mLayerCommand.reset(); + } + } + + void flushDisplayCommand() { + if (mDisplayCommand.has_value()) { + mCommands.emplace_back(std::move(*mDisplayCommand)); + mDisplayCommand.reset(); + } + } + + DisplayCommand& getDisplayCommand(int64_t display) { + if (!mDisplayCommand.has_value() || mDisplayCommand->display != display) { + flushLayerCommand(); + flushDisplayCommand(); + mDisplayCommand.emplace(); + mDisplayCommand->display = display; + } + return *mDisplayCommand; + } + + LayerCommand& getLayerCommand(int64_t display, int64_t layer) { + getDisplayCommand(display); + if (!mLayerCommand.has_value() || mLayerCommand->layer != layer) { + flushLayerCommand(); + mLayerCommand.emplace(); + mLayerCommand->layer = layer; + } + return *mLayerCommand; + } +}; + +} // namespace aidl::android::hardware::graphics::composer3 diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h deleted file mode 100644 index fcf2a34602..0000000000 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h +++ /dev/null @@ -1,614 +0,0 @@ -/* - * Copyright 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include - -using aidl::android::hardware::graphics::common::BlendMode; -using aidl::android::hardware::graphics::common::ColorTransform; -using aidl::android::hardware::graphics::common::Dataspace; -using aidl::android::hardware::graphics::common::FRect; -using aidl::android::hardware::graphics::common::Rect; -using aidl::android::hardware::graphics::common::Transform; - -using namespace aidl::android::hardware::graphics::composer3; - -using aidl::android::hardware::common::NativeHandle; - -namespace aidl::android::hardware::graphics::composer3 { - -// This class helps build a command queue. Note that all sizes/lengths are in -// units of uint32_t's. -class CommandWriterBase { - public: - CommandWriterBase() { reset(); } - - virtual ~CommandWriterBase() { reset(); } - - void reset() { - mDisplayCommand.reset(); - mLayerCommand.reset(); - mCommands.clear(); - mCommandsResults.clear(); - } - - void setError(int32_t index, int32_t errorCode) { - CommandError error; - error.commandIndex = index; - error.errorCode = errorCode; - mCommandsResults.emplace_back(std::move(error)); - } - - void setPresentOrValidateResult(int64_t display, PresentOrValidate::Result result) { - PresentOrValidate presentOrValidate; - presentOrValidate.display = display; - presentOrValidate.result = result; - mCommandsResults.emplace_back(std::move(presentOrValidate)); - } - - void setChangedCompositionTypes(int64_t display, const std::vector& layers, - const std::vector& types) { - ChangedCompositionTypes changedCompositionTypes; - changedCompositionTypes.display = display; - changedCompositionTypes.layers.reserve(layers.size()); - for (int i = 0; i < layers.size(); i++) { - auto layer = ChangedCompositionLayer{.layer = layers[i], .composition = types[i]}; - changedCompositionTypes.layers.emplace_back(std::move(layer)); - } - mCommandsResults.emplace_back(std::move(changedCompositionTypes)); - } - - void setDisplayRequests(int64_t display, int32_t displayRequestMask, - const std::vector& layers, - const std::vector& layerRequestMasks) { - DisplayRequest displayRequest; - displayRequest.display = display; - displayRequest.mask = displayRequestMask; - displayRequest.layerRequests.reserve(layers.size()); - for (int i = 0; i < layers.size(); i++) { - auto layerRequest = - DisplayRequest::LayerRequest{.layer = layers[i], .mask = layerRequestMasks[i]}; - displayRequest.layerRequests.emplace_back(std::move(layerRequest)); - } - mCommandsResults.emplace_back(std::move(displayRequest)); - } - - void setPresentFence(int64_t display, ::ndk::ScopedFileDescriptor presentFence) { - if (presentFence.get() >= 0) { - PresentFence presentFenceCommand; - presentFenceCommand.fence = std::move(presentFence); - presentFenceCommand.display = display; - mCommandsResults.emplace_back(std::move(presentFenceCommand)); - } else { - ALOGW("%s: invalid present fence %d", __func__, presentFence.get()); - } - } - - void setReleaseFences(int64_t display, const std::vector& layers, - std::vector<::ndk::ScopedFileDescriptor> releaseFences) { - ReleaseFences releaseFencesCommand; - releaseFencesCommand.display = display; - for (int i = 0; i < layers.size(); i++) { - if (releaseFences[i].get() >= 0) { - ReleaseFences::Layer layer; - layer.layer = layers[i]; - layer.fence = std::move(releaseFences[i]); - releaseFencesCommand.layers.emplace_back(std::move(layer)); - } else { - ALOGW("%s: invalid release fence %d", __func__, releaseFences[i].get()); - } - } - mCommandsResults.emplace_back(std::move(releaseFencesCommand)); - } - - void setClientTargetProperty(int64_t display, const ClientTargetProperty& clientTargetProperty, - float whitePointNits) { - ClientTargetPropertyWithNits clientTargetPropertyWithNits; - clientTargetPropertyWithNits.display = display; - clientTargetPropertyWithNits.clientTargetProperty = clientTargetProperty; - clientTargetPropertyWithNits.whitePointNits = whitePointNits; - mCommandsResults.emplace_back(std::move(clientTargetPropertyWithNits)); - } - - void setColorTransform(int64_t display, const float* matrix, ColorTransform hint) { - ColorTransformPayload colorTransformPayload; - colorTransformPayload.matrix.assign(matrix, matrix + 16); - colorTransformPayload.hint = hint; - getDisplayCommand(display).colorTransform.emplace(std::move(colorTransformPayload)); - } - - void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target, - int acquireFence, Dataspace dataspace, const std::vector& damage) { - ClientTarget clientTargetCommand; - clientTargetCommand.buffer = getBuffer(slot, target, acquireFence); - clientTargetCommand.dataspace = dataspace; - clientTargetCommand.damage.assign(damage.begin(), damage.end()); - getDisplayCommand(display).clientTarget.emplace(std::move(clientTargetCommand)); - } - - void setOutputBuffer(int64_t display, uint32_t slot, const native_handle_t* buffer, - int releaseFence) { - getDisplayCommand(display).virtualDisplayOutputBuffer.emplace( - getBuffer(slot, buffer, releaseFence)); - } - - void validateDisplay(int64_t display) { getDisplayCommand(display).validateDisplay = true; } - - void presentOrvalidateDisplay(int64_t display) { - getDisplayCommand(display).presentOrValidateDisplay = true; - } - - void acceptDisplayChanges(int64_t display) { - getDisplayCommand(display).acceptDisplayChanges = true; - } - - void presentDisplay(int64_t display) { getDisplayCommand(display).presentDisplay = true; } - - void setLayerCursorPosition(int64_t display, int64_t layer, int32_t x, int32_t y) { - common::Point cursorPosition; - cursorPosition.x = x; - cursorPosition.y = y; - getLayerCommand(display, layer).cursorPosition.emplace(std::move(cursorPosition)); - } - - void setLayerBuffer(int64_t display, int64_t layer, uint32_t slot, - const native_handle_t* buffer, int acquireFence) { - getLayerCommand(display, layer).buffer = getBuffer(slot, buffer, acquireFence); - } - - void setLayerSurfaceDamage(int64_t display, int64_t layer, const std::vector& damage) { - getLayerCommand(display, layer).damage.emplace(damage.begin(), damage.end()); - } - - void setLayerBlendMode(int64_t display, int64_t layer, BlendMode mode) { - ParcelableBlendMode parcelableBlendMode; - parcelableBlendMode.blendMode = mode; - getLayerCommand(display, layer).blendMode.emplace(std::move(parcelableBlendMode)); - } - - void setLayerColor(int64_t display, int64_t layer, Color color) { - getLayerCommand(display, layer).color.emplace(std::move(color)); - } - - void setLayerCompositionType(int64_t display, int64_t layer, Composition type) { - ParcelableComposition compositionPayload; - compositionPayload.composition = type; - getLayerCommand(display, layer).composition.emplace(std::move(compositionPayload)); - } - - void setLayerDataspace(int64_t display, int64_t layer, Dataspace dataspace) { - ParcelableDataspace dataspacePayload; - dataspacePayload.dataspace = dataspace; - getLayerCommand(display, layer).dataspace.emplace(std::move(dataspacePayload)); - } - - void setLayerDisplayFrame(int64_t display, int64_t layer, const Rect& frame) { - getLayerCommand(display, layer).displayFrame.emplace(frame); - } - - void setLayerPlaneAlpha(int64_t display, int64_t layer, float alpha) { - PlaneAlpha planeAlpha; - planeAlpha.alpha = alpha; - getLayerCommand(display, layer).planeAlpha.emplace(std::move(planeAlpha)); - } - - void setLayerSidebandStream(int64_t display, int64_t layer, const native_handle_t* stream) { - NativeHandle handle; - if (stream) handle = ::android::dupToAidl(stream); - getLayerCommand(display, layer).sidebandStream.emplace(std::move(handle)); - } - - void setLayerSourceCrop(int64_t display, int64_t layer, const FRect& crop) { - getLayerCommand(display, layer).sourceCrop.emplace(crop); - } - - void setLayerTransform(int64_t display, int64_t layer, Transform transform) { - ParcelableTransform transformPayload; - transformPayload.transform = transform; - getLayerCommand(display, layer).transform.emplace(std::move(transformPayload)); - } - - void setLayerVisibleRegion(int64_t display, int64_t layer, const std::vector& visible) { - getLayerCommand(display, layer).visibleRegion.emplace(visible.begin(), visible.end()); - } - - void setLayerZOrder(int64_t display, int64_t layer, uint32_t z) { - ZOrder zorder; - zorder.z = z; - getLayerCommand(display, layer).z.emplace(std::move(zorder)); - } - - void setLayerPerFrameMetadata(int64_t display, int64_t layer, - const std::vector& metadataVec) { - getLayerCommand(display, layer) - .perFrameMetadata.emplace(metadataVec.begin(), metadataVec.end()); - } - - void setLayerColorTransform(int64_t display, int64_t layer, const float* matrix) { - getLayerCommand(display, layer).colorTransform.emplace(matrix, matrix + 16); - } - - void setLayerPerFrameMetadataBlobs(int64_t display, int64_t layer, - const std::vector& metadata) { - getLayerCommand(display, layer) - .perFrameMetadataBlob.emplace(metadata.begin(), metadata.end()); - } - - void setLayerFloatColor(int64_t display, int64_t layer, FloatColor color) { - getLayerCommand(display, layer).floatColor.emplace(color); - } - - void setLayerGenericMetadata(int64_t display, int64_t layer, const std::string& key, - const bool mandatory, const std::vector& value) { - GenericMetadata metadata; - metadata.key.name = key; - metadata.key.mandatory = mandatory; - metadata.value.assign(value.begin(), value.end()); - getLayerCommand(display, layer).genericMetadata.emplace(std::move(metadata)); - } - - void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) { - getLayerCommand(display, layer) - .whitePointNits.emplace(WhitePointNits{.nits = whitePointNits}); - } - - const std::vector& getPendingCommands() { - flushLayerCommand(); - flushDisplayCommand(); - return mCommands; - } - - std::vector getPendingCommandResults() { - return std::move(mCommandsResults); - } - - protected: - Buffer getBuffer(int slot, const native_handle_t* bufferHandle, int fence) { - Buffer bufferCommand; - bufferCommand.slot = slot; - if (bufferHandle) bufferCommand.handle.emplace(::android::dupToAidl(bufferHandle)); - if (fence > 0) bufferCommand.fence = ::ndk::ScopedFileDescriptor(fence); - return bufferCommand; - } - - std::optional mDisplayCommand; - std::optional mLayerCommand; - std::vector mCommands; - std::vector mCommandsResults; - - private: - void flushLayerCommand() { - if (mLayerCommand.has_value()) { - mDisplayCommand->layers.emplace_back(std::move(*mLayerCommand)); - mLayerCommand.reset(); - } - } - - void flushDisplayCommand() { - if (mDisplayCommand.has_value()) { - mCommands.emplace_back(std::move(*mDisplayCommand)); - mDisplayCommand.reset(); - } - } - - DisplayCommand& getDisplayCommand(int64_t display) { - if (!mDisplayCommand.has_value() || mDisplayCommand->display != display) { - flushLayerCommand(); - flushDisplayCommand(); - mDisplayCommand.emplace(); - mDisplayCommand->display = display; - } - return *mDisplayCommand; - } - - LayerCommand& getLayerCommand(int64_t display, int64_t layer) { - getDisplayCommand(display); - if (!mLayerCommand.has_value() || mLayerCommand->layer != layer) { - flushLayerCommand(); - mLayerCommand.emplace(); - mLayerCommand->layer = layer; - } - return *mLayerCommand; - } -}; - -class CommandReaderBase { - public: - ~CommandReaderBase() { resetData(); } - - // Parse and execute commands from the command queue. The commands are - // actually return values from the server and will be saved in ReturnData. - void parse(const std::vector& results) { - resetData(); - - for (const auto& result : results) { - switch (result.getTag()) { - case CommandResultPayload::Tag::error: - parseSetError(result.get()); - break; - case CommandResultPayload::Tag::changedCompositionTypes: - parseSetChangedCompositionTypes( - result.get()); - break; - case CommandResultPayload::Tag::displayRequest: - parseSetDisplayRequests( - result.get()); - break; - case CommandResultPayload::Tag::presentFence: - parseSetPresentFence(result.get()); - break; - case CommandResultPayload::Tag::releaseFences: - parseSetReleaseFences(result.get()); - break; - case CommandResultPayload::Tag::presentOrValidateResult: - parseSetPresentOrValidateDisplayResult( - result.get()); - break; - case CommandResultPayload::Tag::clientTargetProperty: - parseSetClientTargetProperty( - result.get()); - break; - } - } - } - - std::vector takeErrors() { return std::move(mErrors); } - - bool hasChanges(int64_t display, uint32_t* outNumChangedCompositionTypes, - uint32_t* outNumLayerRequestMasks) const { - auto found = mReturnData.find(display); - if (found == mReturnData.end()) { - *outNumChangedCompositionTypes = 0; - *outNumLayerRequestMasks = 0; - return false; - } - - const ReturnData& data = found->second; - - *outNumChangedCompositionTypes = static_cast(data.compositionTypes.size()); - *outNumLayerRequestMasks = static_cast(data.requestMasks.size()); - - return !(data.compositionTypes.empty() && data.requestMasks.empty()); - } - - // Get and clear saved changed composition types. - void takeChangedCompositionTypes(int64_t display, std::vector* outLayers, - std::vector* outTypes) { - auto found = mReturnData.find(display); - if (found == mReturnData.end()) { - outLayers->clear(); - outTypes->clear(); - return; - } - - ReturnData& data = found->second; - - *outLayers = std::move(data.changedLayers); - *outTypes = std::move(data.compositionTypes); - } - - // Get and clear saved display requests. - void takeDisplayRequests(int64_t display, uint32_t* outDisplayRequestMask, - std::vector* outLayers, - std::vector* outLayerRequestMasks) { - auto found = mReturnData.find(display); - if (found == mReturnData.end()) { - *outDisplayRequestMask = 0; - outLayers->clear(); - outLayerRequestMasks->clear(); - return; - } - - ReturnData& data = found->second; - - *outDisplayRequestMask = data.displayRequests; - *outLayers = std::move(data.requestedLayers); - *outLayerRequestMasks = std::move(data.requestMasks); - } - - // Get and clear saved release fences. - void takeReleaseFences(int64_t display, std::vector* outLayers, - std::vector* outReleaseFences) { - auto found = mReturnData.find(display); - if (found == mReturnData.end()) { - outLayers->clear(); - outReleaseFences->clear(); - return; - } - - ReturnData& data = found->second; - - *outLayers = std::move(data.releasedLayers); - *outReleaseFences = std::move(data.releaseFences); - } - - // Get and clear saved present fence. - void takePresentFence(int64_t display, int* outPresentFence) { - auto found = mReturnData.find(display); - if (found == mReturnData.end()) { - *outPresentFence = -1; - return; - } - - ReturnData& data = found->second; - - *outPresentFence = data.presentFence; - data.presentFence = -1; - } - - // Get what stage succeeded during PresentOrValidate: Present or Validate - void takePresentOrValidateStage(int64_t display, uint32_t* state) { - auto found = mReturnData.find(display); - if (found == mReturnData.end()) { - *state = static_cast(-1); - return; - } - ReturnData& data = found->second; - *state = data.presentOrValidateState; - } - - // Get the client target properties requested by hardware composer. - void takeClientTargetProperty(int64_t display, ClientTargetProperty* outClientTargetProperty, - float* outWhitePointNits) { - auto found = mReturnData.find(display); - - // If not found, return the default values. - if (found == mReturnData.end()) { - outClientTargetProperty->pixelFormat = common::PixelFormat::RGBA_8888; - outClientTargetProperty->dataspace = Dataspace::UNKNOWN; - *outWhitePointNits = -1.f; - return; - } - - ReturnData& data = found->second; - *outClientTargetProperty = data.clientTargetProperty; - *outWhitePointNits = data.clientTargetWhitePointNits; - } - - private: - void resetData() { - mErrors.clear(); - - for (auto& data : mReturnData) { - if (data.second.presentFence >= 0) { - close(data.second.presentFence); - } - for (auto fence : data.second.releaseFences) { - if (fence >= 0) { - close(fence); - } - } - } - - mReturnData.clear(); - } - - void parseSetError(const CommandError& error) { mErrors.emplace_back(error); } - - void parseSetChangedCompositionTypes(const ChangedCompositionTypes& changedCompositionTypes) { - auto& data = mReturnData[changedCompositionTypes.display]; - - data.changedLayers.reserve(changedCompositionTypes.layers.size()); - data.compositionTypes.reserve(changedCompositionTypes.layers.size()); - for (const auto& layer : changedCompositionTypes.layers) { - data.changedLayers.push_back(layer.layer); - data.compositionTypes.push_back(layer.composition); - } - } - - void parseSetDisplayRequests(const DisplayRequest& displayRequest) { - auto& data = mReturnData[displayRequest.display]; - - data.displayRequests = displayRequest.mask; - data.requestedLayers.reserve(displayRequest.layerRequests.size()); - data.requestMasks.reserve(displayRequest.layerRequests.size()); - for (const auto& layerRequest : displayRequest.layerRequests) { - data.requestedLayers.push_back(layerRequest.layer); - data.requestMasks.push_back(layerRequest.mask); - } - } - - void parseSetPresentFence(const PresentFence& presentFence) { - auto& data = mReturnData[presentFence.display]; - if (data.presentFence >= 0) { - close(data.presentFence); - } - data.presentFence = dup(presentFence.fence.get()); - } - - void parseSetReleaseFences(const ReleaseFences& releaseFences) { - auto& data = mReturnData[releaseFences.display]; - data.releasedLayers.reserve(releaseFences.layers.size()); - data.releaseFences.reserve(releaseFences.layers.size()); - for (const auto& layer : releaseFences.layers) { - data.releasedLayers.push_back(layer.layer); - data.releaseFences.push_back(dup(layer.fence.get())); - } - } - - void parseSetPresentOrValidateDisplayResult(const PresentOrValidate& presentOrValidate) { - auto& data = mReturnData[presentOrValidate.display]; - data.presentOrValidateState = - presentOrValidate.result == PresentOrValidate::Result::Presented ? 1 : 0; - } - - void parseSetClientTargetProperty(const ClientTargetPropertyWithNits& clientTargetProperty) { - auto& data = mReturnData[clientTargetProperty.display]; - data.clientTargetProperty.pixelFormat = - clientTargetProperty.clientTargetProperty.pixelFormat; - data.clientTargetProperty.dataspace = clientTargetProperty.clientTargetProperty.dataspace; - data.clientTargetWhitePointNits = clientTargetProperty.whitePointNits; - } - - struct ReturnData { - int32_t displayRequests = 0; - - std::vector changedLayers; - std::vector compositionTypes; - - std::vector requestedLayers; - std::vector requestMasks; - - int presentFence = -1; - - std::vector releasedLayers; - std::vector releaseFences; - - uint32_t presentOrValidateState; - - ClientTargetProperty clientTargetProperty{common::PixelFormat::RGBA_8888, - Dataspace::UNKNOWN}; - float clientTargetWhitePointNits = -1.f; - }; - - std::vector mErrors; - std::unordered_map mReturnData; -}; - -} // namespace aidl::android::hardware::graphics::composer3 -- GitLab From d7a5de2b13c122dac1be242bbf443e89c404a9b2 Mon Sep 17 00:00:00 2001 From: Edwin Tung Date: Wed, 8 Dec 2021 13:27:51 +0800 Subject: [PATCH 337/825] Add GnssVisibilityControl AIDL HAL (hardware/interfaces) Bug: 208728105 Test: atest VtsHalGnssTargetTest Change-Id: Ie42793a4d0ddf9c9b62c6dff2dc7a34797702e7f --- .../compatibility_matrix.current.xml | 8 + gnss/aidl/Android.bp | 18 ++ .../IGnssVisibilityControl.aidl | 39 ++++ .../IGnssVisibilityControlCallback.aidl | 74 ++++++++ .../current/android/hardware/gnss/IGnss.aidl | 1 + gnss/aidl/android/hardware/gnss/IGnss.aidl | 8 + .../IGnssVisibilityControl.aidl | 82 ++++++++ .../IGnssVisibilityControlCallback.aidl | 176 ++++++++++++++++++ gnss/aidl/default/Android.bp | 2 + gnss/aidl/default/Gnss.cpp | 9 + gnss/aidl/default/Gnss.h | 4 + gnss/aidl/default/GnssVisibilityControl.cpp | 51 +++++ gnss/aidl/default/GnssVisibilityControl.h | 36 ++++ gnss/aidl/vts/Android.bp | 2 + .../vts/GnssVisibilityControlCallback.cpp | 28 +++ gnss/aidl/vts/GnssVisibilityControlCallback.h | 30 +++ gnss/aidl/vts/gnss_hal_test_cases.cpp | 27 +++ 17 files changed, 595 insertions(+) create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl create mode 100644 gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl create mode 100644 gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl create mode 100644 gnss/aidl/default/GnssVisibilityControl.cpp create mode 100644 gnss/aidl/default/GnssVisibilityControl.h create mode 100644 gnss/aidl/vts/GnssVisibilityControlCallback.cpp create mode 100644 gnss/aidl/vts/GnssVisibilityControlCallback.h diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 34fbaaf338..70d72cce49 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -260,6 +260,14 @@ default + + android.hardware.gnss.visibility_control + 1 + + IGnssVisibilityControl + default + + android.hardware.graphics.allocator diff --git a/gnss/aidl/Android.bp b/gnss/aidl/Android.bp index b197eae32d..12dd0ac16e 100644 --- a/gnss/aidl/Android.bp +++ b/gnss/aidl/Android.bp @@ -23,10 +23,28 @@ package { default_applicable_licenses: ["hardware_interfaces_license"], } +aidl_interface { + name: "android.hardware.gnss.visibility_control", + vendor_available: true, + srcs: ["android/hardware/gnss/visibility_control/*.aidl"], + stability: "vintf", + backend: { + java: { + platform_apis: true, + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, +} + aidl_interface { name: "android.hardware.gnss", vendor_available: true, srcs: ["android/hardware/gnss/*.aidl"], + imports: ["android.hardware.gnss.visibility_control"], stability: "vintf", backend: { java: { diff --git a/gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl b/gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl new file mode 100644 index 0000000000..7ef08d2f52 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.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 -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.gnss.visibility_control; +@VintfStability +interface IGnssVisibilityControl { + void enableNfwLocationAccess(in String[] proxyApps); + void setCallback(in android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback callback); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl new file mode 100644 index 0000000000..37e1886576 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl @@ -0,0 +1,74 @@ +/* + * 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 -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.gnss.visibility_control; +@VintfStability +interface IGnssVisibilityControlCallback { + void nfwNotifyCb(in android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwNotification notification); + boolean isInEmergencySession(); + @Backing(type="int") @VintfStability + enum NfwProtocolStack { + CTRL_PLANE = 0, + SUPL = 1, + IMS = 10, + SIM = 11, + OTHER_PROTOCOL_STACK = 100, + } + @Backing(type="int") @VintfStability + enum NfwRequestor { + CARRIER = 0, + OEM = 10, + MODEM_CHIPSET_VENDOR = 11, + GNSS_CHIPSET_VENDOR = 12, + OTHER_CHIPSET_VENDOR = 13, + AUTOMOBILE_CLIENT = 20, + OTHER_REQUESTOR = 100, + } + @Backing(type="int") @VintfStability + enum NfwResponseType { + REJECTED = 0, + ACCEPTED_NO_LOCATION_PROVIDED = 1, + ACCEPTED_LOCATION_PROVIDED = 2, + } + @VintfStability + parcelable NfwNotification { + String proxyAppPackageName; + android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwProtocolStack protocolStack; + String otherProtocolStackName; + android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwRequestor requestor; + String requestorId; + android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwResponseType responseType; + boolean inEmergencyMode; + boolean isCachedLocation; + } +} 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 9df7fe521b..34773805f4 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 @@ -45,6 +45,7 @@ interface IGnss { @nullable android.hardware.gnss.IGnssNavigationMessageInterface getExtensionGnssNavigationMessage(); android.hardware.gnss.IAGnss getExtensionAGnss(); android.hardware.gnss.IGnssDebug getExtensionGnssDebug(); + android.hardware.gnss.visibility_control.IGnssVisibilityControl getExtensionGnssVisibilityControl(); const int ERROR_INVALID_ARGUMENT = 1; const int ERROR_ALREADY_INIT = 2; const int ERROR_GENERIC = 3; diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl index 2751521efc..1351f594e9 100644 --- a/gnss/aidl/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl @@ -26,6 +26,7 @@ import android.hardware.gnss.IGnssMeasurementInterface; import android.hardware.gnss.IGnssNavigationMessageInterface; import android.hardware.gnss.IGnssPowerIndication; import android.hardware.gnss.IGnssPsds; +import android.hardware.gnss.visibility_control.IGnssVisibilityControl; /** * Represents the standard GNSS (Global Navigation Satellite System) interface. @@ -144,4 +145,11 @@ interface IGnss { * @return Handle to the IGnssDebug interface. */ IGnssDebug getExtensionGnssDebug(); + + /** + * This method returns the IGnssVisibilityControl. + * + * @return Handle to the IGnssVisibilityControl. + */ + IGnssVisibilityControl getExtensionGnssVisibilityControl(); } diff --git a/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl b/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl new file mode 100644 index 0000000000..93c3f2c94f --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl @@ -0,0 +1,82 @@ +/* + * 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. + */ + +package android.hardware.gnss.visibility_control; + +import android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback; + +/** + * Represents the GNSS location reporting permissions and notification interface. + * + * This interface is used to tell the GNSS HAL implementation whether the framework user has + * granted permission to the GNSS HAL implementation to provide GNSS location information for + * non-framework (NFW), non-user initiated emergency use cases, and to notify the framework user + * of these GNSS location information deliveries. + * + * For user initiated emergency cases (and for the configured extended emergency session duration), + * the GNSS HAL implementation must serve the emergency location supporting network initiated + * location requests immediately irrespective of this permission settings. + * + * There is no separate need for the GNSS HAL implementation to monitor the global device location + * on/off setting. Permission to use GNSS for non-framework use cases is expressly controlled + * by the method enableNfwLocationAccess(). The framework monitors the location permission settings + * of the configured proxy applications(s), and device location settings, and calls the method + * enableNfwLocationAccess() whenever the user control proxy applications have, or do not have, + * location permission. The proxy applications are used to provide user visibility and control of + * location access by the non-framework on/off device entities they are representing. + * + * For device user visibility, the GNSS HAL implementation must call the method + * IGnssVisibilityControlCallback.nfwNotifyCb() whenever location request is rejected or + * location information is provided to non-framework entities (on or off device). This includes + * the network initiated location requests for user-initiated emergency use cases as well. + * + * The HAL implementations that support this interface must not report GNSS location, measurement, + * status, or other information that can be used to derive user location to any entity when not + * expressly authorized by this HAL. This includes all endpoints for location information + * off the device, including carriers, vendors, OEM and others directly or indirectly. + */ +@VintfStability +interface IGnssVisibilityControl { + /** + * Enables/disables non-framework entity location access permission in the GNSS HAL. + * + * The framework will call this method to update GNSS HAL implementation every time the + * framework user, through the given proxy application(s) and/or device location settings, + * explicitly grants/revokes the location access permission for non-framework, non-user + * initiated emergency use cases. + * + * Whenever the user location information is delivered to non-framework entities, the HAL + * implementation must call the method IGnssVisibilityControlCallback.nfwNotifyCb() to notify + * the framework for user visibility. + * + * @param proxyApps Full list of package names of proxy Android applications representing + * the non-framework location access entities (on/off the device) for which the framework + * user has granted non-framework location access permission. The GNSS HAL implementation + * must provide location information only to non-framework entities represented by these + * proxy applications. + * + * The package name of the proxy Android application follows the standard Java language + * package naming format. For example, com.example.myapp. + */ + void enableNfwLocationAccess(in String[] proxyApps); + + /** + * Registers the callback for HAL implementation to use. + * + * @param callback Handle to IGnssVisibilityControlCallback interface. + */ + void setCallback(in IGnssVisibilityControlCallback callback); +} diff --git a/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl b/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl new file mode 100644 index 0000000000..051fbe6fb0 --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl @@ -0,0 +1,176 @@ +/* + * 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. + */ + +package android.hardware.gnss.visibility_control; + +/** + * GNSS location reporting permissions and notification callback interface. + */ +@VintfStability +interface IGnssVisibilityControlCallback { + /** + * Protocol stack that is requesting the non-framework location information. + */ + @VintfStability + @Backing(type="int") + enum NfwProtocolStack { + /** Cellular control plane requests */ + CTRL_PLANE = 0, + + /** All types of SUPL requests */ + SUPL = 1, + + /** All types of requests from IMS */ + IMS = 10, + + /** All types of requests from SIM */ + SIM = 11, + + /** Requests from other protocol stacks */ + OTHER_PROTOCOL_STACK = 100 + } + + /** + * Entity that is requesting/receiving the location information. + */ + @VintfStability + @Backing(type="int") + enum NfwRequestor { + /** Wireless service provider */ + CARRIER = 0, + + /** Device manufacturer */ + OEM = 10, + + /** Modem chipset vendor */ + MODEM_CHIPSET_VENDOR = 11, + + /** GNSS chipset vendor */ + GNSS_CHIPSET_VENDOR = 12, + + /** Other chipset vendor */ + OTHER_CHIPSET_VENDOR = 13, + + /** Automobile client */ + AUTOMOBILE_CLIENT = 20, + + /** Other sources */ + OTHER_REQUESTOR = 100 + } + + /** + * GNSS response type for non-framework location requests. + */ + @VintfStability + @Backing(type="int") + enum NfwResponseType { + /** Request rejected because framework has not given permission for this use case */ + REJECTED = 0, + + /** Request accepted but could not provide location because of a failure */ + ACCEPTED_NO_LOCATION_PROVIDED = 1, + + /** Request accepted and location provided */ + ACCEPTED_LOCATION_PROVIDED = 2, + } + + /** + * Represents a non-framework location information request/response notification. + */ + @VintfStability + parcelable NfwNotification { + /** + * Package name of the Android proxy application representing the non-framework + * entity that requested location. Set to empty string if unknown. + * + * For user-initiated emergency use cases, this field must be set to empty string + * and the inEmergencyMode field must be set to true. + */ + String proxyAppPackageName; + + /** Protocol stack that initiated the non-framework location request. */ + NfwProtocolStack protocolStack; + + /** + * Name of the protocol stack if protocolStack field is set to OTHER_PROTOCOL_STACK. + * Otherwise, set to empty string. + * + * This field is opaque to the framework and used for logging purposes. + */ + String otherProtocolStackName; + + /** Source initiating/receiving the location information. */ + NfwRequestor requestor; + + /** + * Identity of the endpoint receiving the location information. For example, carrier + * name, OEM name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. + * + * This field is opaque to the framework and used for logging purposes. + */ + String requestorId; + + /** Indicates whether location information was provided for this request. */ + NfwResponseType responseType; + + /** Is the device in user initiated emergency session. */ + boolean inEmergencyMode; + + /** Is cached location provided */ + boolean isCachedLocation; + } + + /** + * Callback to report a non-framework delivered location. + * + * The GNSS HAL implementation must call this method to notify the framework whenever + * a non-framework location request is made to the GNSS HAL. + * + * Non-framework entities like low power sensor hubs that request location from GNSS and + * only pass location information through Android framework controls are exempt from this + * power-spending reporting. However, low power sensor hubs or other chipsets which may send + * the location information to anywhere other than Android framework (which provides user + * visibility and control), must report location information use through this API whenever + * location information (or events driven by that location such as "home" location detection) + * leaves the domain of that low power chipset. + * + * To avoid overly spamming the framework, high speed location reporting of the exact same + * type may be throttled to report location at a lower rate than the actual report rate, as + * long as the location is reported with a latency of no more than the larger of 5 seconds, + * or the next the Android processor awake time. For example, if an Automotive client is + * getting location information from the GNSS location system at 20Hz, this method may be + * called at 1Hz. As another example, if a low power processor is getting location from the + * GNSS chipset, and the Android processor is asleep, the notification to the Android HAL may + * be delayed until the next wake of the Android processor. + * + * @param notification Non-framework delivered location request/response description. + */ + void nfwNotifyCb(in NfwNotification notification); + + /** + * Tells if the device is currently in an emergency session. + * + * Emergency session is defined as the device being actively in a user initiated emergency + * call or in post emergency call extension time period. + * + * If the GNSS HAL implementation cannot determine if the device is in emergency session + * mode, it must call this method to confirm that the device is in emergency session before + * serving network initiated emergency SUPL and Control Plane location requests. + * + * @return success True if the framework determines that the device is in emergency session. + */ + boolean isInEmergencySession(); +} diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index 24569aec21..29c26d16ec 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -52,6 +52,7 @@ cc_binary { "android.hardware.gnss.measurement_corrections@1.1", "android.hardware.gnss.measurement_corrections@1.0", "android.hardware.gnss.visibility_control@1.0", + "android.hardware.gnss.visibility_control-V1-ndk", "android.hardware.gnss-V2-ndk", ], srcs: [ @@ -66,6 +67,7 @@ cc_binary { "GnssPsds.cpp", "GnssConfiguration.cpp", "GnssMeasurementInterface.cpp", + "GnssVisibilityControl.cpp", "service.cpp", ], static_libs: [ diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 45d6b1d2f4..afb7b9507a 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -26,6 +26,7 @@ #include "GnssMeasurementInterface.h" #include "GnssNavigationMessageInterface.h" #include "GnssPsds.h" +#include "GnssVisibilityControl.h" namespace aidl::android::hardware::gnss { @@ -128,4 +129,12 @@ ndk::ScopedAStatus Gnss::getExtensionGnssDebug(std::shared_ptr* iGns return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Gnss::getExtensionGnssVisibilityControl( + std::shared_ptr* iGnssVisibilityControl) { + ALOGD("Gnss::getExtensionGnssVisibilityControl"); + + *iGnssVisibilityControl = SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index f59607f267..67fef94ee7 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "GnssConfiguration.h" #include "GnssPowerIndication.h" @@ -48,6 +49,9 @@ class Gnss : public BnGnss { std::shared_ptr* iGnssNavigationMessage) override; ndk::ScopedAStatus getExtensionAGnss(std::shared_ptr* iAGnss) override; ndk::ScopedAStatus getExtensionGnssDebug(std::shared_ptr* iGnssDebug) override; + ndk::ScopedAStatus getExtensionGnssVisibilityControl( + std::shared_ptr* + iGnssVisibilityControl) override; std::shared_ptr mGnssConfiguration; std::shared_ptr mGnssPowerIndication; diff --git a/gnss/aidl/default/GnssVisibilityControl.cpp b/gnss/aidl/default/GnssVisibilityControl.cpp new file mode 100644 index 0000000000..208d73ca20 --- /dev/null +++ b/gnss/aidl/default/GnssVisibilityControl.cpp @@ -0,0 +1,51 @@ +/* + * 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. + */ + +#define LOG_TAG "GnssVisibilityControl" + +#include "GnssVisibilityControl.h" +#include + +namespace aidl::android::hardware::gnss::visibility_control { + +std::shared_ptr GnssVisibilityControl::sCallback = nullptr; + +ndk::ScopedAStatus GnssVisibilityControl::enableNfwLocationAccess( + const std::vector& proxyApps) { + std::string os; + bool first = true; + for (const auto& proxyApp : proxyApps) { + if (first) { + first = false; + } else { + os += " "; + } + os += proxyApp; + } + + ALOGD("GnssVisibilityControl::enableNfwLocationAccess proxyApps: %s", os.c_str()); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus GnssVisibilityControl::setCallback( + const std::shared_ptr& callback) { + ALOGD("GnssVisibilityControl::setCallback"); + std::unique_lock lock(mMutex); + sCallback = callback; + return ndk::ScopedAStatus::ok(); +} + +} // namespace aidl::android::hardware::gnss::visibility_control diff --git a/gnss/aidl/default/GnssVisibilityControl.h b/gnss/aidl/default/GnssVisibilityControl.h new file mode 100644 index 0000000000..5b36442374 --- /dev/null +++ b/gnss/aidl/default/GnssVisibilityControl.h @@ -0,0 +1,36 @@ +/* + * 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 + +namespace aidl::android::hardware::gnss::visibility_control { + +struct GnssVisibilityControl : public BnGnssVisibilityControl { + public: + ndk::ScopedAStatus enableNfwLocationAccess(const std::vector& hostname) override; + ndk::ScopedAStatus setCallback( + const std::shared_ptr& callback) override; + + private: + // Synchronization lock for sCallback + mutable std::mutex mMutex; + // Guarded by mMutex + static std::shared_ptr sCallback; +}; + +} // namespace aidl::android::hardware::gnss::visibility_control diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp index 041d579091..d532fad357 100644 --- a/gnss/aidl/vts/Android.bp +++ b/gnss/aidl/vts/Android.bp @@ -37,6 +37,7 @@ cc_test { "GnssMeasurementCallbackAidl.cpp", "GnssNavigationMessageCallback.cpp", "GnssPowerIndicationCallback.cpp", + "GnssVisibilityControlCallback.cpp", "VtsHalGnssTargetTest.cpp", ], shared_libs: [ @@ -49,6 +50,7 @@ cc_test { static_libs: [ "android.hardware.gnss-V2-cpp", "android.hardware.gnss@common-vts-lib", + "android.hardware.gnss.visibility_control-V1-cpp", ], test_suites: [ "general-tests", diff --git a/gnss/aidl/vts/GnssVisibilityControlCallback.cpp b/gnss/aidl/vts/GnssVisibilityControlCallback.cpp new file mode 100644 index 0000000000..aa27af169b --- /dev/null +++ b/gnss/aidl/vts/GnssVisibilityControlCallback.cpp @@ -0,0 +1,28 @@ +/* + * 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 "GnssVisibilityControlCallback.h" +#include + +android::binder::Status GnssVisibilityControlCallback::nfwNotifyCb(const NfwNotification&) { + // To implement + return android::binder::Status::ok(); +} + +android::binder::Status GnssVisibilityControlCallback::isInEmergencySession(bool*) { + // To implement + return android::binder::Status::ok(); +} diff --git a/gnss/aidl/vts/GnssVisibilityControlCallback.h b/gnss/aidl/vts/GnssVisibilityControlCallback.h new file mode 100644 index 0000000000..fbacde766d --- /dev/null +++ b/gnss/aidl/vts/GnssVisibilityControlCallback.h @@ -0,0 +1,30 @@ +/* + * 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 + +class GnssVisibilityControlCallback + : public android::hardware::gnss::visibility_control::BnGnssVisibilityControlCallback { + public: + GnssVisibilityControlCallback(){}; + ~GnssVisibilityControlCallback(){}; + android::binder::Status nfwNotifyCb( + const android::hardware::gnss::visibility_control::IGnssVisibilityControlCallback:: + NfwNotification& notification) override; + android::binder::Status isInEmergencySession(bool* _aidl_return) override; +}; diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 36be631743..90b643ca86 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "AGnssCallbackAidl.h" #include "GnssBatchingCallback.h" @@ -31,6 +32,7 @@ #include "GnssMeasurementCallbackAidl.h" #include "GnssNavigationMessageCallback.h" #include "GnssPowerIndicationCallback.h" +#include "GnssVisibilityControlCallback.h" #include "gnss_hal_test.h" using android::sp; @@ -55,6 +57,7 @@ using android::hardware::gnss::IGnssPowerIndication; using android::hardware::gnss::IGnssPsds; using android::hardware::gnss::PsdsType; using android::hardware::gnss::SatellitePvt; +using android::hardware::gnss::visibility_control::IGnssVisibilityControl; using GnssConstellationTypeAidl = android::hardware::gnss::GnssConstellationType; @@ -876,3 +879,27 @@ TEST_P(GnssHalTest, GnssDebugValuesSanityTest) { data.time.frequencyUncertaintyNsPerSec <= 2.0e5); // 200 ppm } } + +/* + * TestAGnssExtension: + * TestGnssVisibilityControlExtension: + * 1. Gets the IGnssVisibilityControl extension. + * 2. Sets GnssVisibilityControlCallback + * 3. Sets proxy apps + */ +TEST_P(GnssHalTest, TestGnssVisibilityControlExtension) { + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + return; + } + sp iGnssVisibilityControl; + auto status = aidl_gnss_hal_->getExtensionGnssVisibilityControl(&iGnssVisibilityControl); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(iGnssVisibilityControl != nullptr); + auto gnssVisibilityControlCallback = sp::make(); + status = iGnssVisibilityControl->setCallback(gnssVisibilityControlCallback); + ASSERT_TRUE(status.isOk()); + + std::vector proxyApps{String16("com.example.ims"), String16("com.example.mdt")}; + status = iGnssVisibilityControl->enableNfwLocationAccess(proxyApps); + ASSERT_TRUE(status.isOk()); +} -- GitLab From afe17c509334c2eae771cc65001152ea96792e1c Mon Sep 17 00:00:00 2001 From: Kensuke Miyagi Date: Thu, 16 Dec 2021 01:06:15 -0800 Subject: [PATCH 338/825] Enable LnbCallback in hidl/aidl default tuner implementation Bug: 210960436 Test: cts.TunerTest#testLnbAddAndRemoveSharee Change-Id: I11443144dcd1979afe9b077c446faaa293ccb61c --- tv/tuner/1.0/default/Lnb.cpp | 12 ++++++++++-- tv/tuner/1.0/default/Lnb.h | 1 + tv/tuner/1.1/default/Lnb.cpp | 12 ++++++++++-- tv/tuner/1.1/default/Lnb.h | 1 + tv/tuner/aidl/default/Lnb.cpp | 14 ++++++++++++-- tv/tuner/aidl/default/Lnb.h | 1 + 6 files changed, 35 insertions(+), 6 deletions(-) diff --git a/tv/tuner/1.0/default/Lnb.cpp b/tv/tuner/1.0/default/Lnb.cpp index 6025339ba7..c770e91145 100644 --- a/tv/tuner/1.0/default/Lnb.cpp +++ b/tv/tuner/1.0/default/Lnb.cpp @@ -33,9 +33,10 @@ Lnb::Lnb(int id) { Lnb::~Lnb() {} -Return Lnb::setCallback(const sp& /* callback */) { +Return Lnb::setCallback(const sp& callback) { ALOGV("%s", __FUNCTION__); + mCallback = callback; return Result::SUCCESS; } @@ -57,9 +58,16 @@ Return Lnb::setSatellitePosition(LnbPosition /* position */) { return Result::SUCCESS; } -Return Lnb::sendDiseqcMessage(const hidl_vec& /* diseqcMessage */) { +Return Lnb::sendDiseqcMessage(const hidl_vec& diseqcMessage) { ALOGV("%s", __FUNCTION__); + if (mCallback != nullptr) { + // The correct implementation should be to return the response from the + // device via onDiseqcMessage(). The below implementation is only to enable + // testing for LnbCallbacks. + ALOGV("[hidl] %s - this is for test purpose only, and must be replaced!", __FUNCTION__); + mCallback->onDiseqcMessage(diseqcMessage); + } return Result::SUCCESS; } diff --git a/tv/tuner/1.0/default/Lnb.h b/tv/tuner/1.0/default/Lnb.h index 1e97214430..c14bbd8735 100644 --- a/tv/tuner/1.0/default/Lnb.h +++ b/tv/tuner/1.0/default/Lnb.h @@ -57,6 +57,7 @@ class Lnb : public ILnb { private: int mId; virtual ~Lnb(); + sp mCallback; }; } // namespace implementation diff --git a/tv/tuner/1.1/default/Lnb.cpp b/tv/tuner/1.1/default/Lnb.cpp index 044727ff54..5dd01472d5 100644 --- a/tv/tuner/1.1/default/Lnb.cpp +++ b/tv/tuner/1.1/default/Lnb.cpp @@ -33,9 +33,10 @@ Lnb::Lnb(int id) { Lnb::~Lnb() {} -Return Lnb::setCallback(const sp& /* callback */) { +Return Lnb::setCallback(const sp& callback) { ALOGV("%s", __FUNCTION__); + mCallback = callback; return Result::SUCCESS; } @@ -57,9 +58,16 @@ Return Lnb::setSatellitePosition(LnbPosition /* position */) { return Result::SUCCESS; } -Return Lnb::sendDiseqcMessage(const hidl_vec& /* diseqcMessage */) { +Return Lnb::sendDiseqcMessage(const hidl_vec& diseqcMessage) { ALOGV("%s", __FUNCTION__); + if (mCallback != nullptr) { + // The correct implementation should be to return the response from the + // device via onDiseqcMessage(). The below implementation is only to enable + // testing for LnbCallbacks. + ALOGV("[hidl] %s - this is for test purpose only, and must be replaced!", __FUNCTION__); + mCallback->onDiseqcMessage(diseqcMessage); + } return Result::SUCCESS; } diff --git a/tv/tuner/1.1/default/Lnb.h b/tv/tuner/1.1/default/Lnb.h index 70a8e41b8b..b34ca396ca 100644 --- a/tv/tuner/1.1/default/Lnb.h +++ b/tv/tuner/1.1/default/Lnb.h @@ -51,6 +51,7 @@ class Lnb : public ILnb { private: int mId; virtual ~Lnb(); + sp mCallback; }; } // namespace implementation diff --git a/tv/tuner/aidl/default/Lnb.cpp b/tv/tuner/aidl/default/Lnb.cpp index 35d2da6310..f9343ae6c8 100644 --- a/tv/tuner/aidl/default/Lnb.cpp +++ b/tv/tuner/aidl/default/Lnb.cpp @@ -34,9 +34,11 @@ Lnb::Lnb(int id) { Lnb::~Lnb() {} -::ndk::ScopedAStatus Lnb::setCallback(const std::shared_ptr& /* in_callback */) { +::ndk::ScopedAStatus Lnb::setCallback(const std::shared_ptr& in_callback) { ALOGV("%s", __FUNCTION__); + mCallback = in_callback; + return ::ndk::ScopedAStatus::ok(); } @@ -58,9 +60,17 @@ Lnb::~Lnb() {} return ::ndk::ScopedAStatus::ok(); } -::ndk::ScopedAStatus Lnb::sendDiseqcMessage(const std::vector& /* in_diseqcMessage */) { +::ndk::ScopedAStatus Lnb::sendDiseqcMessage(const std::vector& in_diseqcMessage) { ALOGV("%s", __FUNCTION__); + if (mCallback != nullptr) { + // The correct implementation should be to return the response from the + // device via onDiseqcMessage(). The below implementation is only to enable + // testing for LnbCallbacks. + ALOGV("[aidl] %s - this is for test purpose only, and must be replaced!", __FUNCTION__); + mCallback->onDiseqcMessage(in_diseqcMessage); + } + return ::ndk::ScopedAStatus::ok(); } diff --git a/tv/tuner/aidl/default/Lnb.h b/tv/tuner/aidl/default/Lnb.h index bfe3097ddc..464f9a453f 100644 --- a/tv/tuner/aidl/default/Lnb.h +++ b/tv/tuner/aidl/default/Lnb.h @@ -44,6 +44,7 @@ class Lnb : public BnLnb { private: int mId; virtual ~Lnb(); + std::shared_ptr mCallback; }; } // namespace tuner -- GitLab From a2c195d5e0c6f941031a2caf994d54554abcb637 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Thu, 16 Dec 2021 09:49:48 -0800 Subject: [PATCH 339/825] Section filter isRepeat clarification. Bug: 210999986 Test: make Change-Id: I07fdd17a3c9d4f573f92ced6b89b7ab4bb570948 --- .../hardware/tv/tuner/DemuxFilterSectionSettings.aidl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl index 2102aa0a90..f6788ee131 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl @@ -32,7 +32,16 @@ parcelable DemuxFilterSectionSettings { boolean isCheckCrc; /** - * true if the filter repeats the data with the same version + * true if the filter repeats the data. + * + * If false, for DemuxFilterSectionSettingsConditionTableInfo, HAL filters out all sections + * based on tableId and version, and stops filtering data. For DemuxFilterSectionBits, HAL + * filters out first section which matches the DemuxFilterSectionBits configuration, and stops + * filtering data. + * + * If true, for DemuxFilterSectionSettingsConditionTableInfo, HAL filters out all sections based + * on tableId and version, and repeats. For DemuxFilterSectionBits, HAL filters out sections + * which match the DemuxFilterSectionBits configuration, and repeats. */ boolean isRepeat; -- GitLab From 6645e9ea7183cd513599dfd8b01b597f2e83f1bc Mon Sep 17 00:00:00 2001 From: Les Lee Date: Fri, 29 Oct 2021 16:04:23 +0800 Subject: [PATCH 340/825] wifi: Extend onFailure callback for dual AP case There are two AP instances when bridged AP is running. Extend onFailure callback to support if there is a problem one of the instances, The framework can handle the failure separately. (i.e. No need to shutdown whole Soft Ap) Bug: 188921389 Test: Test with test code, the callback works normally. Change-Id: I0aba5f3c5bf21badd3cf925908c853e9285fa6aa --- .../android/hardware/wifi/hostapd/IHostapdCallback.aidl | 2 +- .../android/hardware/wifi/hostapd/IHostapdCallback.aidl | 7 +++++-- .../aidl/vts/functional/VtsHalHostapdTargetTest.cpp | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapdCallback.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapdCallback.aidl index 36d210476a..9dd062a1f2 100644 --- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapdCallback.aidl +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapdCallback.aidl @@ -36,5 +36,5 @@ package android.hardware.wifi.hostapd; interface IHostapdCallback { oneway void onApInstanceInfoChanged(in android.hardware.wifi.hostapd.ApInfo apInfo); oneway void onConnectedClientsChanged(in android.hardware.wifi.hostapd.ClientInfo clientInfo); - oneway void onFailure(in String ifaceName); + oneway void onFailure(in String ifaceName, in String instanceName); } diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapdCallback.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapdCallback.aidl index 7b049442a6..456f46a6b1 100644 --- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapdCallback.aidl +++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapdCallback.aidl @@ -41,7 +41,10 @@ interface IHostapdCallback { * Invoked when an asynchronous failure is encountered in one of the access * points added via |IHostapd.addAccessPoint|. * - * @param ifaceName Name of the interface. + * @param ifaceName Name of the interface which was added via + * |IHostapd.addAccessPoint|. + * @param instanceName Name of the AP instance which is associated with + * the interface. */ - oneway void onFailure(in String ifaceName); + oneway void onFailure(in String ifaceName, in String instanceName); } diff --git a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp index 41c54b3725..dad708567c 100644 --- a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp +++ b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp @@ -232,7 +232,7 @@ class HostapdCallback : public BnHostapdCallback { const ::aidl::android::hardware::wifi::hostapd::ClientInfo &) override { return ndk::ScopedAStatus::ok(); } - ::ndk::ScopedAStatus onFailure(const std::string &) override { + ::ndk::ScopedAStatus onFailure(const std::string&, const std::string&) override { return ndk::ScopedAStatus::ok(); } }; -- GitLab From b23ec019ceaaa0f28da2b0f02f59ce20c0e2ee7b Mon Sep 17 00:00:00 2001 From: Francois Gaffie Date: Thu, 18 Nov 2021 11:28:53 +0100 Subject: [PATCH 341/825] AudioPolicy Engine: update schema for optional attributes of criterion types The wrapping of mutli bit audio devices on 64 bits requires an adaptation, adding the android value associated to the bitfield allow to translate android value to / from bitfield inclusive criterion type. Test: make Signed-off-by: Francois Gaffie Change-Id: I1bf31c6bf6c57c9b79f0d5751601aa77780f1f80 --- audio/policy/1.0/xml/api/current.txt | 2 ++ audio/policy/1.0/xml/audio_policy_engine_configuration.xsd | 1 + 2 files changed, 3 insertions(+) diff --git a/audio/policy/1.0/xml/api/current.txt b/audio/policy/1.0/xml/api/current.txt index 29a9cd402d..14783810a0 100644 --- a/audio/policy/1.0/xml/api/current.txt +++ b/audio/policy/1.0/xml/api/current.txt @@ -232,8 +232,10 @@ package audio.policy.V1_0 { public class ValueType { ctor public ValueType(); + method public int getAndroid_type(); method public String getLiteral(); method public int getNumerical(); + method public void setAndroid_type(int); method public void setLiteral(String); method public void setNumerical(int); } diff --git a/audio/policy/1.0/xml/audio_policy_engine_configuration.xsd b/audio/policy/1.0/xml/audio_policy_engine_configuration.xsd index 842e7246d6..852ea77dac 100644 --- a/audio/policy/1.0/xml/audio_policy_engine_configuration.xsd +++ b/audio/policy/1.0/xml/audio_policy_engine_configuration.xsd @@ -190,6 +190,7 @@ + -- GitLab From 4cdc4f20b7e59d5ae6d7e0d92e5fd73116a50746 Mon Sep 17 00:00:00 2001 From: Treehugger Robot Date: Fri, 17 Dec 2021 00:28:32 +0000 Subject: [PATCH 342/825] Merge "VTS: fix some logic errors for tuner HAL vts [1/1]" into android11-tests-dev am: 0638fc1ede Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1919318 Bug: 208191849 Change-Id: Ida7b10a22c9c72ac9bc0fffc97750aaf27860fd7 --- tv/tuner/1.0/vts/functional/FrontendTests.cpp | 2 ++ tv/tuner/1.1/vts/functional/FrontendTests.cpp | 2 ++ tv/tuner/aidl/vts/functional/FrontendTests.cpp | 2 ++ 3 files changed, 6 insertions(+) mode change 100644 => 100755 tv/tuner/1.0/vts/functional/FrontendTests.cpp diff --git a/tv/tuner/1.0/vts/functional/FrontendTests.cpp b/tv/tuner/1.0/vts/functional/FrontendTests.cpp old mode 100644 new mode 100755 index 4a642a067c..acc524b026 --- a/tv/tuner/1.0/vts/functional/FrontendTests.cpp +++ b/tv/tuner/1.0/vts/functional/FrontendTests.cpp @@ -377,6 +377,7 @@ AssertionResult FrontendTests::tuneFrontend(FrontendConfig config, bool testWith result &= getDvrTests()->getDvrPlaybackMQDescriptor() == success(); getDvrTests()->startPlaybackInputThread(mDvrConfig.playbackInputFile, mDvrConfig.settings.playback()); + getDvrTests()->startDvrPlayback(); if (!result) { ALOGW("[vts] Software frontend dvr configure failed."); return failure(); @@ -400,6 +401,7 @@ AssertionResult FrontendTests::stopTuneFrontend(bool testWithDemux) { status = mFrontend->stopTune(); if (mIsSoftwareFe && testWithDemux) { getDvrTests()->stopPlaybackThread(); + getDvrTests()->stopDvrPlayback(); getDvrTests()->closeDvrPlayback(); } return AssertionResult(status == Result::SUCCESS); diff --git a/tv/tuner/1.1/vts/functional/FrontendTests.cpp b/tv/tuner/1.1/vts/functional/FrontendTests.cpp index a595a93732..9f0f30dd0f 100644 --- a/tv/tuner/1.1/vts/functional/FrontendTests.cpp +++ b/tv/tuner/1.1/vts/functional/FrontendTests.cpp @@ -444,6 +444,7 @@ AssertionResult FrontendTests::tuneFrontend(FrontendConfig1_1 config, bool testW result &= getDvrTests()->getDvrPlaybackMQDescriptor() == success(); getDvrTests()->startPlaybackInputThread(mDvrConfig.playbackInputFile, mDvrConfig.settings.playback()); + getDvrTests()->startDvrPlayback(); if (!result) { ALOGW("[vts] Software frontend dvr configure failed."); return failure(); @@ -459,6 +460,7 @@ AssertionResult FrontendTests::stopTuneFrontend(bool testWithDemux) { status = mFrontend->stopTune(); if (mIsSoftwareFe && testWithDemux) { getDvrTests()->stopPlaybackThread(); + getDvrTests()->stopDvrPlayback(); getDvrTests()->closeDvrPlayback(); } return AssertionResult(status == Result::SUCCESS); diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp index 12b1f33735..42d20f7997 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp +++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp @@ -437,6 +437,7 @@ AssertionResult FrontendTests::tuneFrontend(FrontendConfig config, bool testWith getDvrTests()->startPlaybackInputThread( mDvrConfig.playbackInputFile, mDvrConfig.settings.get()); + getDvrTests()->startDvrPlayback(); } mFrontendCallback->tuneTestOnLock(mFrontend, config.settings); return AssertionResult(true); @@ -448,6 +449,7 @@ AssertionResult FrontendTests::stopTuneFrontend(bool testWithDemux) { status = mFrontend->stopTune(); if (mIsSoftwareFe && testWithDemux) { getDvrTests()->stopPlaybackThread(); + getDvrTests()->stopDvrPlayback(); getDvrTests()->closeDvrPlayback(); } return AssertionResult(status.isOk()); -- GitLab From 6902a757734c9c34e89c973e6aa323657461af24 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Mon, 13 Dec 2021 17:13:48 -0800 Subject: [PATCH 343/825] Use AIDL callbacks directly. Bug: 210498497 Test: build cuttlefish with ag/16322062, watch logs Change-Id: I1e0cd95f5f9a911564d14be2d8bbb328572de8c8 --- radio/aidl/compat/libradiocompat/Android.bp | 1 - .../compat/libradiocompat/RadioCompatBase.cpp | 5 - .../compat/libradiocompat/RadioResponse.cpp | 12 +- .../compat/libradiocompat/commonStructs.cpp | 6 +- .../compat/libradiocompat/commonStructs.h | 2 +- .../libradiocompat/config/RadioConfig.cpp | 18 +-- .../config/RadioConfigIndication.cpp | 16 +- .../config/RadioConfigResponse.cpp | 28 ++-- .../compat/libradiocompat/data/RadioData.cpp | 16 +- .../data/RadioIndication-data.cpp | 20 ++- .../data/RadioResponse-data.cpp | 59 +++---- radio/aidl/compat/libradiocompat/debug.h | 6 - .../libradiocompat/GuaranteedCallback.h | 50 ++++++ .../include/libradiocompat/RadioCompatBase.h | 2 - .../include/libradiocompat/RadioConfig.h | 15 +- .../libradiocompat}/RadioConfigIndication.h | 10 +- .../libradiocompat}/RadioConfigResponse.h | 10 +- .../include/libradiocompat/RadioData.h | 2 + .../include/libradiocompat/RadioIndication.h | 38 ++++- .../include/libradiocompat/RadioMessaging.h | 2 + .../include/libradiocompat/RadioModem.h | 2 + .../include/libradiocompat/RadioNetwork.h | 2 + .../include/libradiocompat/RadioResponse.h | 32 +++- .../include/libradiocompat/RadioSim.h | 2 + .../include/libradiocompat/RadioVoice.h | 2 + .../messaging/RadioIndication-messaging.cpp | 29 ++-- .../messaging/RadioMessaging.cpp | 4 + .../messaging/RadioResponse-messaging.cpp | 86 ++++------- .../modem/RadioIndication-modem.cpp | 20 ++- .../libradiocompat/modem/RadioModem.cpp | 4 + .../modem/RadioResponse-modem.cpp | 56 +++---- .../network/RadioIndication-network.cpp | 64 +++----- .../libradiocompat/network/RadioNetwork.cpp | 10 +- .../network/RadioResponse-network.cpp | 144 +++++++----------- .../sim/RadioIndication-sim.cpp | 38 ++--- .../libradiocompat/sim/RadioResponse-sim.cpp | 130 ++++++---------- .../compat/libradiocompat/sim/RadioSim.cpp | 10 +- .../voice/RadioIndication-voice.cpp | 47 +++--- .../voice/RadioResponse-voice.cpp | 110 +++++-------- .../libradiocompat/voice/RadioVoice.cpp | 9 +- 40 files changed, 528 insertions(+), 591 deletions(-) create mode 100644 radio/aidl/compat/libradiocompat/include/libradiocompat/GuaranteedCallback.h rename radio/aidl/compat/libradiocompat/{config => include/libradiocompat}/RadioConfigIndication.h (82%) rename radio/aidl/compat/libradiocompat/{config => include/libradiocompat}/RadioConfigResponse.h (88%) diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp index 5294de4bb1..9d568c4aa0 100644 --- a/radio/aidl/compat/libradiocompat/Android.bp +++ b/radio/aidl/compat/libradiocompat/Android.bp @@ -28,7 +28,6 @@ cc_library { cflags: [ "-Wall", "-Wextra", - //"-Wold-style-cast", // TODO(b/203699028) enable after aosp/1900880 gets merged "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", ], shared_libs: [ diff --git a/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp b/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp index dba6c19fa2..2364484f13 100644 --- a/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp +++ b/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp @@ -28,9 +28,4 @@ RadioCompatBase::RadioCompatBase(std::shared_ptr context, sp context) : mContext( Return RadioResponse::acknowledgeRequest(int32_t serial) { LOG_CALL << serial; // TODO(b/203699028): send to correct requestor or confirm if spam is not a problem - if (mDataCb) mDataCb->acknowledgeRequest(serial); - if (mMessagingCb) mMessagingCb->acknowledgeRequest(serial); - if (mModemCb) mModemCb->acknowledgeRequest(serial); - if (mNetworkCb) mNetworkCb->acknowledgeRequest(serial); - if (mSimCb) mSimCb->acknowledgeRequest(serial); - if (mVoiceCb) mVoiceCb->acknowledgeRequest(serial); + if (mDataCb) mDataCb.get()->acknowledgeRequest(serial); + if (mMessagingCb) mMessagingCb.get()->acknowledgeRequest(serial); + if (mModemCb) mModemCb.get()->acknowledgeRequest(serial); + if (mNetworkCb) mNetworkCb.get()->acknowledgeRequest(serial); + if (mSimCb) mSimCb.get()->acknowledgeRequest(serial); + if (mVoiceCb) mVoiceCb.get()->acknowledgeRequest(serial); return {}; } diff --git a/radio/aidl/compat/libradiocompat/commonStructs.cpp b/radio/aidl/compat/libradiocompat/commonStructs.cpp index c25768dc27..6e4c873d65 100644 --- a/radio/aidl/compat/libradiocompat/commonStructs.cpp +++ b/radio/aidl/compat/libradiocompat/commonStructs.cpp @@ -20,11 +20,11 @@ namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio; -V1_6::RadioResponseInfo notSupported(int32_t serial) { +aidl::RadioResponseInfo notSupported(int32_t serial) { return { - .type = V1_0::RadioResponseType::SOLICITED, + .type = aidl::RadioResponseType::SOLICITED, .serial = serial, - .error = V1_6::RadioError::REQUEST_NOT_SUPPORTED, + .error = aidl::RadioError::REQUEST_NOT_SUPPORTED, }; } diff --git a/radio/aidl/compat/libradiocompat/commonStructs.h b/radio/aidl/compat/libradiocompat/commonStructs.h index b8599167c9..a4a4869e61 100644 --- a/radio/aidl/compat/libradiocompat/commonStructs.h +++ b/radio/aidl/compat/libradiocompat/commonStructs.h @@ -21,7 +21,7 @@ namespace android::hardware::radio::compat { -V1_6::RadioResponseInfo notSupported(int32_t serial); +aidl::android::hardware::radio::RadioResponseInfo notSupported(int32_t serial); std::string toAidl(const hidl_string& str); hidl_string toHidl(const std::string& str); diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp index d0d6f7af28..d6399bfddf 100644 --- a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp +++ b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp @@ -16,8 +16,6 @@ #include -#include "RadioConfigIndication.h" -#include "RadioConfigResponse.h" #include "commonStructs.h" #include "debug.h" #include "structs.h" @@ -31,11 +29,13 @@ namespace aidl = ::aidl::android::hardware::radio::config; constexpr auto ok = &ScopedAStatus::ok; RadioConfig::RadioConfig(sp hidlHal) - : mHal1_1(hidlHal), mHal1_3(config::V1_3::IRadioConfig::castFrom(hidlHal)) {} + : mHal1_1(hidlHal), + mHal1_3(config::V1_3::IRadioConfig::castFrom(hidlHal)), + mRadioConfigResponse(sp::make()), + mRadioConfigIndication(sp::make()) {} -config::V1_3::IRadioConfigResponse& RadioConfig::respond() { - CHECK(mRadioConfigResponse) << "setResponseFunctions was not called yet"; - return *mRadioConfigResponse; +std::shared_ptr RadioConfig::respond() { + return mRadioConfigResponse->respond(); } ScopedAStatus RadioConfig::getHalDeviceCapabilities(int32_t serial) { @@ -43,7 +43,7 @@ ScopedAStatus RadioConfig::getHalDeviceCapabilities(int32_t serial) { if (mHal1_3) { mHal1_3->getHalDeviceCapabilities(serial); } else { - respond().getHalDeviceCapabilitiesResponse(notSupported(serial), false); + respond()->getHalDeviceCapabilitiesResponse(notSupported(serial), false); } return ok(); } @@ -86,8 +86,8 @@ ScopedAStatus RadioConfig::setResponseFunctions( CHECK(radioConfigResponse); CHECK(radioConfigIndication); - mRadioConfigResponse = sp::make(radioConfigResponse); - mRadioConfigIndication = sp::make(radioConfigIndication); + mRadioConfigResponse->setResponseFunction(radioConfigResponse); + mRadioConfigIndication->setResponseFunction(radioConfigIndication); mHal1_1->setResponseFunctions(mRadioConfigResponse, mRadioConfigIndication); return ok(); diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.cpp b/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.cpp index 0320ad77ca..c1e32c111f 100644 --- a/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.cpp +++ b/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "RadioConfigIndication.h" +#include #include "commonStructs.h" #include "debug.h" @@ -28,20 +28,26 @@ namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio::config; -RadioConfigIndication::RadioConfigIndication(std::shared_ptr callback) - : mCallback(callback) {} +void RadioConfigIndication::setResponseFunction( + std::shared_ptr callback) { + mCallback = callback; +} + +std::shared_ptr RadioConfigIndication::indicate() { + return mCallback.get(); +} Return RadioConfigIndication::simSlotsStatusChanged( V1_0::RadioIndicationType type, const hidl_vec& slotStatus) { LOG_CALL << type; - mCallback->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus)); + indicate()->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus)); return {}; } Return RadioConfigIndication::simSlotsStatusChanged_1_2( V1_0::RadioIndicationType type, const hidl_vec& slotStatus) { LOG_CALL << type; - mCallback->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus)); + indicate()->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus)); return {}; } diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.cpp b/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.cpp index 7066ae46c6..523c504781 100644 --- a/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.cpp +++ b/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "RadioConfigResponse.h" +#include #include "commonStructs.h" #include "debug.h" @@ -28,14 +28,20 @@ namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio::config; -RadioConfigResponse::RadioConfigResponse(std::shared_ptr callback) - : mCallback(callback) {} +void RadioConfigResponse::setResponseFunction( + std::shared_ptr callback) { + mCallback = callback; +} + +std::shared_ptr RadioConfigResponse::respond() { + return mCallback.get(); +} Return RadioConfigResponse::getSimSlotsStatusResponse( const V1_0::RadioResponseInfo& info, const hidl_vec& slotStatus) { LOG_CALL << info.serial; - mCallback->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus)); + respond()->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus)); return {}; }; @@ -43,47 +49,47 @@ Return RadioConfigResponse::getSimSlotsStatusResponse_1_2( const V1_0::RadioResponseInfo& info, const hidl_vec& slotStatus) { LOG_CALL << info.serial; - mCallback->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus)); + respond()->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus)); return {}; }; Return RadioConfigResponse::setSimSlotsMappingResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - mCallback->setSimSlotsMappingResponse(toAidl(info)); + respond()->setSimSlotsMappingResponse(toAidl(info)); return {}; }; Return RadioConfigResponse::getPhoneCapabilityResponse( const V1_0::RadioResponseInfo& info, const config::V1_1::PhoneCapability& phoneCapability) { LOG_CALL << info.serial; - mCallback->getPhoneCapabilityResponse(toAidl(info), toAidl(phoneCapability)); + respond()->getPhoneCapabilityResponse(toAidl(info), toAidl(phoneCapability)); return {}; }; Return RadioConfigResponse::setPreferredDataModemResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - mCallback->setPreferredDataModemResponse(toAidl(info)); + respond()->setPreferredDataModemResponse(toAidl(info)); return {}; }; Return RadioConfigResponse::setModemsConfigResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - mCallback->setNumOfLiveModemsResponse(toAidl(info)); + respond()->setNumOfLiveModemsResponse(toAidl(info)); return {}; }; Return RadioConfigResponse::getModemsConfigResponse( const V1_0::RadioResponseInfo& info, const config::V1_1::ModemsConfig& modemsConfig) { LOG_CALL << info.serial; - mCallback->getNumOfLiveModemsResponse(toAidl(info), modemsConfig.numOfLiveModems); + respond()->getNumOfLiveModemsResponse(toAidl(info), modemsConfig.numOfLiveModems); return {}; }; Return RadioConfigResponse::getHalDeviceCapabilitiesResponse( const V1_6::RadioResponseInfo& info, bool modemReducedFeatureSet1) { LOG_CALL << info.serial; - mCallback->getHalDeviceCapabilitiesResponse(toAidl(info), modemReducedFeatureSet1); + respond()->getHalDeviceCapabilitiesResponse(toAidl(info), modemReducedFeatureSet1); return {}; }; diff --git a/radio/aidl/compat/libradiocompat/data/RadioData.cpp b/radio/aidl/compat/libradiocompat/data/RadioData.cpp index cc6f526de8..c819251831 100644 --- a/radio/aidl/compat/libradiocompat/data/RadioData.cpp +++ b/radio/aidl/compat/libradiocompat/data/RadioData.cpp @@ -31,12 +31,16 @@ namespace aidl = ::aidl::android::hardware::radio::data; namespace aidlCommon = ::aidl::android::hardware::radio; constexpr auto ok = &ScopedAStatus::ok; +std::shared_ptr RadioData::respond() { + return mRadioResponse->dataCb(); +} + ScopedAStatus RadioData::allocatePduSessionId(int32_t serial) { LOG_CALL << serial; if (mHal1_6) { mHal1_6->allocatePduSessionId(serial); } else { - respond().allocatePduSessionIdResponse(notSupported(serial), 0); + respond()->allocatePduSessionIdResponse(notSupported(serial), 0); } return ok(); } @@ -46,7 +50,7 @@ ScopedAStatus RadioData::cancelHandover(int32_t serial, int32_t callId) { if (mHal1_6) { mHal1_6->cancelHandover(serial, callId); } else { - respond().cancelHandoverResponse(notSupported(serial)); + respond()->cancelHandoverResponse(notSupported(serial)); } return ok(); } @@ -69,7 +73,7 @@ ScopedAStatus RadioData::getSlicingConfig(int32_t serial) { if (mHal1_6) { mHal1_6->getSlicingConfig(serial); } else { - respond().getSlicingConfigResponse(notSupported(serial), {}); + respond()->getSlicingConfigResponse(notSupported(serial), {}); } return ok(); } @@ -79,7 +83,7 @@ ScopedAStatus RadioData::releasePduSessionId(int32_t serial, int32_t id) { if (mHal1_6) { mHal1_6->releasePduSessionId(serial, id); } else { - respond().releasePduSessionIdResponse(notSupported(serial)); + respond()->releasePduSessionIdResponse(notSupported(serial)); } return ok(); } @@ -109,7 +113,7 @@ ScopedAStatus RadioData::setDataThrottling(int32_t serial, aidl::DataThrottlingA if (mHal1_6) { mHal1_6->setDataThrottling(serial, V1_6::DataThrottlingAction(dta), completionDurationMs); } else { - respond().setDataThrottlingResponse(notSupported(serial)); + respond()->setDataThrottlingResponse(notSupported(serial)); } return ok(); } @@ -161,7 +165,7 @@ ScopedAStatus RadioData::startHandover(int32_t serial, int32_t callId) { if (mHal1_6) { mHal1_6->startHandover(serial, callId); } else { - respond().startHandoverResponse(notSupported(serial)); + respond()->startHandoverResponse(notSupported(serial)); } return ok(); } diff --git a/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp b/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp index a680e562ab..1d367d2025 100644 --- a/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp +++ b/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp @@ -29,10 +29,13 @@ namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio::data; void RadioIndication::setResponseFunction(std::shared_ptr dataCb) { - CHECK(dataCb); mDataCb = dataCb; } +std::shared_ptr RadioIndication::dataCb() { + return mDataCb.get(); +} + Return RadioIndication::dataCallListChanged(V1_0::RadioIndicationType type, const hidl_vec&) { LOG_CALL << type; @@ -50,40 +53,35 @@ Return RadioIndication::dataCallListChanged_1_4(V1_0::RadioIndicationType Return RadioIndication::dataCallListChanged_1_5( V1_0::RadioIndicationType type, const hidl_vec& dcList) { LOG_CALL << type; - CHECK_CB(mDataCb); - mDataCb->dataCallListChanged(toAidl(type), toAidl(dcList)); + dataCb()->dataCallListChanged(toAidl(type), toAidl(dcList)); return {}; } Return RadioIndication::dataCallListChanged_1_6( V1_0::RadioIndicationType type, const hidl_vec& dcList) { LOG_CALL << type; - CHECK_CB(mDataCb); - mDataCb->dataCallListChanged(toAidl(type), toAidl(dcList)); + dataCb()->dataCallListChanged(toAidl(type), toAidl(dcList)); return {}; } Return RadioIndication::keepaliveStatus(V1_0::RadioIndicationType type, const V1_1::KeepaliveStatus& status) { LOG_CALL << type; - CHECK_CB(mDataCb); - mDataCb->keepaliveStatus(toAidl(type), toAidl(status)); + dataCb()->keepaliveStatus(toAidl(type), toAidl(status)); return {}; } Return RadioIndication::pcoData(V1_0::RadioIndicationType type, const V1_0::PcoDataInfo& pco) { LOG_CALL << type; - CHECK_CB(mDataCb); - mDataCb->pcoData(toAidl(type), toAidl(pco)); + dataCb()->pcoData(toAidl(type), toAidl(pco)); return {}; } Return RadioIndication::unthrottleApn(V1_0::RadioIndicationType type, const hidl_string& apn) { LOG_CALL << type; - CHECK_CB(mDataCb); - mDataCb->unthrottleApn(toAidl(type), mContext->getDataProfile(apn)); + dataCb()->unthrottleApn(toAidl(type), mContext->getDataProfile(apn)); return {}; } diff --git a/radio/aidl/compat/libradiocompat/data/RadioResponse-data.cpp b/radio/aidl/compat/libradiocompat/data/RadioResponse-data.cpp index 171f692d41..0bfa2df5f0 100644 --- a/radio/aidl/compat/libradiocompat/data/RadioResponse-data.cpp +++ b/radio/aidl/compat/libradiocompat/data/RadioResponse-data.cpp @@ -29,29 +29,29 @@ namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio::data; void RadioResponse::setResponseFunction(std::shared_ptr dataCb) { - CHECK(dataCb); mDataCb = dataCb; } +std::shared_ptr RadioResponse::dataCb() { + return mDataCb.get(); +} + Return RadioResponse::allocatePduSessionIdResponse(const V1_6::RadioResponseInfo& info, int32_t id) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->allocatePduSessionIdResponse(toAidl(info), id); + dataCb()->allocatePduSessionIdResponse(toAidl(info), id); return {}; } Return RadioResponse::cancelHandoverResponse(const V1_6::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->cancelHandoverResponse(toAidl(info)); + dataCb()->cancelHandoverResponse(toAidl(info)); return {}; } Return RadioResponse::deactivateDataCallResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->deactivateDataCallResponse(toAidl(info)); + dataCb()->deactivateDataCallResponse(toAidl(info)); return {}; } @@ -73,8 +73,7 @@ Return RadioResponse::getDataCallListResponse_1_5( const V1_0::RadioResponseInfo& info, const hidl_vec& dcResponse) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->getDataCallListResponse(toAidl(info), toAidl(dcResponse)); + dataCb()->getDataCallListResponse(toAidl(info), toAidl(dcResponse)); return {}; } @@ -82,65 +81,56 @@ Return RadioResponse::getDataCallListResponse_1_6( const V1_6::RadioResponseInfo& info, const hidl_vec& dcResponse) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->getDataCallListResponse(toAidl(info), toAidl(dcResponse)); + dataCb()->getDataCallListResponse(toAidl(info), toAidl(dcResponse)); return {}; } Return RadioResponse::getSlicingConfigResponse(const V1_6::RadioResponseInfo& info, const V1_6::SlicingConfig& slicingConfig) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->getSlicingConfigResponse(toAidl(info), toAidl(slicingConfig)); + dataCb()->getSlicingConfigResponse(toAidl(info), toAidl(slicingConfig)); return {}; } Return RadioResponse::releasePduSessionIdResponse(const V1_6::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->releasePduSessionIdResponse(toAidl(info)); + dataCb()->releasePduSessionIdResponse(toAidl(info)); return {}; } Return RadioResponse::setDataAllowedResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->setDataAllowedResponse(toAidl(info)); + dataCb()->setDataAllowedResponse(toAidl(info)); return {}; } Return RadioResponse::setDataProfileResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->setDataProfileResponse(toAidl(info)); + dataCb()->setDataProfileResponse(toAidl(info)); return {}; } Return RadioResponse::setDataProfileResponse_1_5(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->setDataProfileResponse(toAidl(info)); + dataCb()->setDataProfileResponse(toAidl(info)); return {}; } Return RadioResponse::setDataThrottlingResponse(const V1_6::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->setDataThrottlingResponse(toAidl(info)); + dataCb()->setDataThrottlingResponse(toAidl(info)); return {}; } Return RadioResponse::setInitialAttachApnResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->setInitialAttachApnResponse(toAidl(info)); + dataCb()->setInitialAttachApnResponse(toAidl(info)); return {}; } Return RadioResponse::setInitialAttachApnResponse_1_5(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->setInitialAttachApnResponse(toAidl(info)); + dataCb()->setInitialAttachApnResponse(toAidl(info)); return {}; } @@ -161,38 +151,33 @@ Return RadioResponse::setupDataCallResponse_1_4(const V1_0::RadioResponseI Return RadioResponse::setupDataCallResponse_1_5(const V1_0::RadioResponseInfo& info, const V1_5::SetupDataCallResult& dcResponse) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->setupDataCallResponse(toAidl(info), toAidl(dcResponse)); + dataCb()->setupDataCallResponse(toAidl(info), toAidl(dcResponse)); return {}; } Return RadioResponse::setupDataCallResponse_1_6(const V1_6::RadioResponseInfo& info, const V1_6::SetupDataCallResult& dcResponse) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->setupDataCallResponse(toAidl(info), toAidl(dcResponse)); + dataCb()->setupDataCallResponse(toAidl(info), toAidl(dcResponse)); return {}; } Return RadioResponse::startHandoverResponse(const V1_6::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->startHandoverResponse(toAidl(info)); + dataCb()->startHandoverResponse(toAidl(info)); return {}; } Return RadioResponse::startKeepaliveResponse(const V1_0::RadioResponseInfo& info, const V1_1::KeepaliveStatus& status) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->startKeepaliveResponse(toAidl(info), toAidl(status)); + dataCb()->startKeepaliveResponse(toAidl(info), toAidl(status)); return {}; } Return RadioResponse::stopKeepaliveResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mDataCb); - mDataCb->stopKeepaliveResponse(toAidl(info)); + dataCb()->stopKeepaliveResponse(toAidl(info)); return {}; } diff --git a/radio/aidl/compat/libradiocompat/debug.h b/radio/aidl/compat/libradiocompat/debug.h index 4158059f88..cb773bf27d 100644 --- a/radio/aidl/compat/libradiocompat/debug.h +++ b/radio/aidl/compat/libradiocompat/debug.h @@ -26,12 +26,6 @@ static constexpr bool kSuperVerbose = true; #define LOG_CALL \ if constexpr (debug::kSuperVerbose) LOG(VERBOSE) << (RADIO_MODULE ".") << __func__ << ' ' -#define CHECK_CB(field) \ - if (!field) { \ - LOG(WARNING) << "Callback not set"; \ - return {}; \ - } - } // namespace debug inline std::ostream& operator<<(std::ostream& os, const V1_0::RadioIndicationType& type) { diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/GuaranteedCallback.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/GuaranteedCallback.h new file mode 100644 index 0000000000..0b6ee1115a --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/GuaranteedCallback.h @@ -0,0 +1,50 @@ +/* + * 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 +#include +#include + +namespace android::hardware::radio::compat { + +template +class GuaranteedCallback { + mutable std::mutex mCallbackGuard; + std::shared_ptr mCallback GUARDED_BY(mCallbackGuard); + + public: + GuaranteedCallback& operator=( + const std::shared_ptr& callback) { + CHECK(callback); + const std::lock_guard lock(mCallbackGuard); + mCallback = callback; + return *this; + } + + std::shared_ptr get() { + if (mCallback) return mCallback; + const std::lock_guard lock(mCallbackGuard); + if (mCallback) return mCallback; + + LOG(isIndication ? WARNING : ERROR) << "Callback is not set"; + return mCallback = ndk::SharedRefBase::make(); + } + + operator bool() const { return mCallback != nullptr; } +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h index 21d7898002..cd17541f69 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h @@ -33,8 +33,6 @@ class RadioCompatBase { sp mRadioResponse; sp mRadioIndication; - V1_6::IRadioResponse& respond(); - public: RadioCompatBase(std::shared_ptr context, sp hidlHal, sp radioResponse, sp radioIndication); diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h index 31ad207d40..bbfff61ec3 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h @@ -15,6 +15,9 @@ */ #pragma once +#include "RadioConfigIndication.h" +#include "RadioConfigResponse.h" + #include #include #include @@ -30,11 +33,13 @@ namespace android::hardware::radio::compat { * fetch source implementation and publish resulting HAL instance. */ class RadioConfig : public aidl::android::hardware::radio::config::BnRadioConfig { - sp mHal1_1; - sp mHal1_3; + const sp mHal1_1; + const sp mHal1_3; + + const sp mRadioConfigResponse; + const sp mRadioConfigIndication; - sp mRadioConfigResponse; - sp mRadioConfigIndication; + std::shared_ptr<::aidl::android::hardware::radio::config::IRadioConfigResponse> respond(); ::ndk::ScopedAStatus getHalDeviceCapabilities(int32_t serial) override; ::ndk::ScopedAStatus getNumOfLiveModems(int32_t serial) override; @@ -52,8 +57,6 @@ class RadioConfig : public aidl::android::hardware::radio::config::BnRadioConfig const std::vector& slotMap) override; - config::V1_3::IRadioConfigResponse& respond(); - public: /** * Constructs AIDL IRadioConfig instance wrapping existing HIDL IRadioConfig instance. diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfigIndication.h similarity index 82% rename from radio/aidl/compat/libradiocompat/config/RadioConfigIndication.h rename to radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfigIndication.h index 3d8d971694..d256a879f9 100644 --- a/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfigIndication.h @@ -15,13 +15,17 @@ */ #pragma once +#include "GuaranteedCallback.h" + #include #include namespace android::hardware::radio::compat { class RadioConfigIndication : public config::V1_2::IRadioConfigIndication { - std::shared_ptr mCallback; + GuaranteedCallback + mCallback; Return simSlotsStatusChanged( V1_0::RadioIndicationType type, @@ -31,8 +35,10 @@ class RadioConfigIndication : public config::V1_2::IRadioConfigIndication { const hidl_vec& slotStatus) override; public: - RadioConfigIndication( + void setResponseFunction( std::shared_ptr cb); + + std::shared_ptr indicate(); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfigResponse.h similarity index 88% rename from radio/aidl/compat/libradiocompat/config/RadioConfigResponse.h rename to radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfigResponse.h index 1461dd2035..dc86da22ee 100644 --- a/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfigResponse.h @@ -15,13 +15,17 @@ */ #pragma once +#include "GuaranteedCallback.h" + #include #include namespace android::hardware::radio::compat { class RadioConfigResponse : public config::V1_3::IRadioConfigResponse { - std::shared_ptr mCallback; + GuaranteedCallback + mCallback; Return getSimSlotsStatusResponse( const V1_0::RadioResponseInfo& info, @@ -41,8 +45,10 @@ class RadioConfigResponse : public config::V1_3::IRadioConfigResponse { bool modemReducedFeatureSet1) override; public: - RadioConfigResponse( + void setResponseFunction( std::shared_ptr callback); + + std::shared_ptr respond(); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h index ba8bb0a6ae..c617ec24ea 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h @@ -22,6 +22,8 @@ namespace android::hardware::radio::compat { class RadioData : public RadioCompatBase, public aidl::android::hardware::radio::data::BnRadioData { + std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> respond(); + ::ndk::ScopedAStatus allocatePduSessionId(int32_t serial) override; ::ndk::ScopedAStatus cancelHandover(int32_t serial, int32_t callId) override; ::ndk::ScopedAStatus deactivateDataCall( diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h index 4d03063a41..c668af5dce 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h @@ -16,6 +16,7 @@ #pragma once #include "DriverContext.h" +#include "GuaranteedCallback.h" #include #include @@ -30,13 +31,30 @@ namespace android::hardware::radio::compat { class RadioIndication : public V1_6::IRadioIndication { std::shared_ptr mContext; - std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> mDataCb; - std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> + GuaranteedCallback< // + ::aidl::android::hardware::radio::data::IRadioDataIndication, + ::aidl::android::hardware::radio::data::IRadioDataIndicationDefault, true> + mDataCb; + GuaranteedCallback< // + ::aidl::android::hardware::radio::messaging::IRadioMessagingIndication, + ::aidl::android::hardware::radio::messaging::IRadioMessagingIndicationDefault, true> mMessagingCb; - std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemIndication> mModemCb; - std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkIndication> mNetworkCb; - std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> mSimCb; - std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> mVoiceCb; + GuaranteedCallback< // + ::aidl::android::hardware::radio::modem::IRadioModemIndication, + ::aidl::android::hardware::radio::modem::IRadioModemIndicationDefault, true> + mModemCb; + GuaranteedCallback< // + ::aidl::android::hardware::radio::network::IRadioNetworkIndication, + ::aidl::android::hardware::radio::network::IRadioNetworkIndicationDefault, true> + mNetworkCb; + GuaranteedCallback< // + ::aidl::android::hardware::radio::sim::IRadioSimIndication, + ::aidl::android::hardware::radio::sim::IRadioSimIndicationDefault, true> + mSimCb; + GuaranteedCallback< // + ::aidl::android::hardware::radio::voice::IRadioVoiceIndication, + ::aidl::android::hardware::radio::voice::IRadioVoiceIndicationDefault, true> + mVoiceCb; // IRadioIndication @ 1.0 Return radioStateChanged(V1_0::RadioIndicationType type, @@ -200,6 +218,14 @@ class RadioIndication : public V1_6::IRadioIndication { std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> simCb); void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> voicCb); + + std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> dataCb(); + std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> + messagingCb(); + std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemIndication> modemCb(); + std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkIndication> networkCb(); + std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> simCb(); + std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> voiceCb(); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h index 0cd3381983..419e9fb3a4 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h @@ -23,6 +23,8 @@ namespace android::hardware::radio::compat { class RadioMessaging : public RadioCompatBase, public aidl::android::hardware::radio::messaging::BnRadioMessaging { + std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> respond(); + ::ndk::ScopedAStatus acknowledgeIncomingGsmSmsWithPdu(int32_t serial, bool success, const std::string& ackPdu) override; ::ndk::ScopedAStatus acknowledgeLastIncomingCdmaSms( diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h index 666ff472a0..fdca1244ae 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h @@ -23,6 +23,8 @@ namespace android::hardware::radio::compat { class RadioModem : public RadioCompatBase, public aidl::android::hardware::radio::modem::BnRadioModem { + std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> respond(); + ::ndk::ScopedAStatus enableModem(int32_t serial, bool on) override; ::ndk::ScopedAStatus getBasebandVersion(int32_t serial) override; ::ndk::ScopedAStatus getDeviceIdentity(int32_t serial) override; diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h index 09ae240dbc..ec76300f6c 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h @@ -23,6 +23,8 @@ namespace android::hardware::radio::compat { class RadioNetwork : public RadioCompatBase, public aidl::android::hardware::radio::network::BnRadioNetwork { + std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> respond(); + ::ndk::ScopedAStatus getAllowedNetworkTypesBitmap(int32_t serial) override; ::ndk::ScopedAStatus getAvailableBandModes(int32_t serial) override; ::ndk::ScopedAStatus getAvailableNetworks(int32_t serial) override; diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h index 344864f75e..1f82dd19ca 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h @@ -16,6 +16,7 @@ #pragma once #include "DriverContext.h" +#include "GuaranteedCallback.h" #include #include @@ -30,13 +31,24 @@ namespace android::hardware::radio::compat { class RadioResponse : public V1_6::IRadioResponse { std::shared_ptr mContext; - std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> mDataCb; - std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> + GuaranteedCallback<::aidl::android::hardware::radio::data::IRadioDataResponse, + ::aidl::android::hardware::radio::data::IRadioDataResponseDefault> + mDataCb; + GuaranteedCallback<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse, + ::aidl::android::hardware::radio::messaging::IRadioMessagingResponseDefault> mMessagingCb; - std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> mModemCb; - std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> mNetworkCb; - std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> mSimCb; - std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> mVoiceCb; + GuaranteedCallback<::aidl::android::hardware::radio::modem::IRadioModemResponse, + ::aidl::android::hardware::radio::modem::IRadioModemResponseDefault> + mModemCb; + GuaranteedCallback<::aidl::android::hardware::radio::network::IRadioNetworkResponse, + ::aidl::android::hardware::radio::network::IRadioNetworkResponseDefault> + mNetworkCb; + GuaranteedCallback<::aidl::android::hardware::radio::sim::IRadioSimResponse, + ::aidl::android::hardware::radio::sim::IRadioSimResponseDefault> + mSimCb; + GuaranteedCallback<::aidl::android::hardware::radio::voice::IRadioVoiceResponse, + ::aidl::android::hardware::radio::voice::IRadioVoiceResponseDefault> + mVoiceCb; // IRadioResponse @ 1.0 Return getIccCardStatusResponse(const V1_0::RadioResponseInfo& info, @@ -428,6 +440,14 @@ class RadioResponse : public V1_6::IRadioResponse { std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> simCb); void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> voiceCb); + + std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> dataCb(); + std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> + messagingCb(); + std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> modemCb(); + std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> networkCb(); + std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> simCb(); + std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> voiceCb(); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h index a6b77fd507..84bb68b57f 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h @@ -22,6 +22,8 @@ namespace android::hardware::radio::compat { class RadioSim : public RadioCompatBase, public aidl::android::hardware::radio::sim::BnRadioSim { + std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> respond(); + ::ndk::ScopedAStatus areUiccApplicationsEnabled(int32_t serial) override; ::ndk::ScopedAStatus changeIccPin2ForApp(int32_t serial, const std::string& oldPin2, const std::string& newPin2, diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h index 5bf93e0fb3..5839e3a774 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h @@ -23,6 +23,8 @@ namespace android::hardware::radio::compat { class RadioVoice : public RadioCompatBase, public aidl::android::hardware::radio::voice::BnRadioVoice { + std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> respond(); + ::ndk::ScopedAStatus acceptCall(int32_t serial) override; ::ndk::ScopedAStatus conference(int32_t serial) override; ::ndk::ScopedAStatus dial( diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp index c7342b1146..e5c33b300f 100644 --- a/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp +++ b/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp @@ -27,67 +27,62 @@ namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio::messaging; void RadioIndication::setResponseFunction(std::shared_ptr rmiCb) { - CHECK(rmiCb); mMessagingCb = rmiCb; } +std::shared_ptr RadioIndication::messagingCb() { + return mMessagingCb.get(); +} + Return RadioIndication::cdmaNewSms(V1_0::RadioIndicationType type, const V1_0::CdmaSmsMessage& msg) { LOG_CALL << type; - CHECK_CB(mMessagingCb); - mMessagingCb->cdmaNewSms(toAidl(type), toAidl(msg)); + messagingCb()->cdmaNewSms(toAidl(type), toAidl(msg)); return {}; } Return RadioIndication::cdmaRuimSmsStorageFull(V1_0::RadioIndicationType type) { LOG_CALL << type; - CHECK_CB(mMessagingCb); - mMessagingCb->cdmaRuimSmsStorageFull(toAidl(type)); + messagingCb()->cdmaRuimSmsStorageFull(toAidl(type)); return {}; } Return RadioIndication::newBroadcastSms(V1_0::RadioIndicationType type, const hidl_vec& data) { LOG_CALL << type; - CHECK_CB(mMessagingCb); - mMessagingCb->newBroadcastSms(toAidl(type), data); + messagingCb()->newBroadcastSms(toAidl(type), data); return {}; } Return RadioIndication::newSms(V1_0::RadioIndicationType type, const hidl_vec& pdu) { LOG_CALL << type; - CHECK_CB(mMessagingCb); - mMessagingCb->newSms(toAidl(type), pdu); + messagingCb()->newSms(toAidl(type), pdu); return {}; } Return RadioIndication::newSmsOnSim(V1_0::RadioIndicationType type, int32_t recordNumber) { LOG_CALL << type; - CHECK_CB(mMessagingCb); - mMessagingCb->newSmsOnSim(toAidl(type), recordNumber); + messagingCb()->newSmsOnSim(toAidl(type), recordNumber); return {}; } Return RadioIndication::newSmsStatusReport(V1_0::RadioIndicationType type, const hidl_vec& pdu) { LOG_CALL << type; - CHECK_CB(mMessagingCb); - mMessagingCb->newSmsStatusReport(toAidl(type), pdu); + messagingCb()->newSmsStatusReport(toAidl(type), pdu); return {}; } Return RadioIndication::onUssd(V1_0::RadioIndicationType type, V1_0::UssdModeType modeType, const hidl_string& msg) { LOG_CALL << type; - CHECK_CB(mMessagingCb); - mMessagingCb->onUssd(toAidl(type), aidl::UssdModeType(modeType), msg); + messagingCb()->onUssd(toAidl(type), aidl::UssdModeType(modeType), msg); return {}; } Return RadioIndication::simSmsStorageFull(V1_0::RadioIndicationType type) { LOG_CALL << type; - CHECK_CB(mMessagingCb); - mMessagingCb->simSmsStorageFull(toAidl(type)); + messagingCb()->simSmsStorageFull(toAidl(type)); return {}; } diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp index c1a82b566f..79e7c01441 100644 --- a/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp +++ b/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp @@ -29,6 +29,10 @@ using ::ndk::ScopedAStatus; namespace aidl = ::aidl::android::hardware::radio::messaging; constexpr auto ok = &ScopedAStatus::ok; +std::shared_ptr RadioMessaging::respond() { + return mRadioResponse->messagingCb(); +} + ScopedAStatus RadioMessaging::acknowledgeIncomingGsmSmsWithPdu( // int32_t serial, bool success, const std::string& ackPdu) { LOG_CALL << serial << ' ' << success << ' ' << ackPdu; diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp index 379e4630af..24ad3d7c9b 100644 --- a/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp +++ b/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp @@ -29,52 +29,49 @@ namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio::messaging; void RadioResponse::setResponseFunction(std::shared_ptr rmrCb) { - CHECK(rmrCb); mMessagingCb = rmrCb; } +std::shared_ptr RadioResponse::messagingCb() { + return mMessagingCb.get(); +} + Return RadioResponse::acknowledgeIncomingGsmSmsWithPduResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->acknowledgeIncomingGsmSmsWithPduResponse(toAidl(info)); + messagingCb()->acknowledgeIncomingGsmSmsWithPduResponse(toAidl(info)); return {}; } Return RadioResponse::acknowledgeLastIncomingCdmaSmsResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->acknowledgeLastIncomingCdmaSmsResponse(toAidl(info)); + messagingCb()->acknowledgeLastIncomingCdmaSmsResponse(toAidl(info)); return {}; } Return RadioResponse::acknowledgeLastIncomingGsmSmsResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->acknowledgeLastIncomingGsmSmsResponse(toAidl(info)); + messagingCb()->acknowledgeLastIncomingGsmSmsResponse(toAidl(info)); return {}; } Return RadioResponse::cancelPendingUssdResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->cancelPendingUssdResponse(toAidl(info)); + messagingCb()->cancelPendingUssdResponse(toAidl(info)); return {}; } Return RadioResponse::deleteSmsOnRuimResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->deleteSmsOnRuimResponse(toAidl(info)); + messagingCb()->deleteSmsOnRuimResponse(toAidl(info)); return {}; } Return RadioResponse::deleteSmsOnSimResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->deleteSmsOnSimResponse(toAidl(info)); + messagingCb()->deleteSmsOnSimResponse(toAidl(info)); return {}; } @@ -82,162 +79,141 @@ Return RadioResponse::getCdmaBroadcastConfigResponse( const V1_0::RadioResponseInfo& info, const hidl_vec& configs) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->getCdmaBroadcastConfigResponse(toAidl(info), toAidl(configs)); + messagingCb()->getCdmaBroadcastConfigResponse(toAidl(info), toAidl(configs)); return {}; } Return RadioResponse::getGsmBroadcastConfigResponse( const V1_0::RadioResponseInfo& info, const hidl_vec& cfg) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->getGsmBroadcastConfigResponse(toAidl(info), toAidl(cfg)); + messagingCb()->getGsmBroadcastConfigResponse(toAidl(info), toAidl(cfg)); return {}; } Return RadioResponse::getSmscAddressResponse(const V1_0::RadioResponseInfo& info, const hidl_string& smsc) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->getSmscAddressResponse(toAidl(info), smsc); + messagingCb()->getSmscAddressResponse(toAidl(info), smsc); return {}; } Return RadioResponse::reportSmsMemoryStatusResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->reportSmsMemoryStatusResponse(toAidl(info)); + messagingCb()->reportSmsMemoryStatusResponse(toAidl(info)); return {}; } Return RadioResponse::sendCdmaSmsExpectMoreResponse(const V1_0::RadioResponseInfo& info, const V1_0::SendSmsResult& sms) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->sendCdmaSmsExpectMoreResponse(toAidl(info), toAidl(sms)); + messagingCb()->sendCdmaSmsExpectMoreResponse(toAidl(info), toAidl(sms)); return {}; } Return RadioResponse::sendCdmaSmsExpectMoreResponse_1_6(const V1_6::RadioResponseInfo& info, const V1_0::SendSmsResult& sms) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->sendCdmaSmsExpectMoreResponse(toAidl(info), toAidl(sms)); + messagingCb()->sendCdmaSmsExpectMoreResponse(toAidl(info), toAidl(sms)); return {}; } Return RadioResponse::sendCdmaSmsResponse(const V1_0::RadioResponseInfo& info, const V1_0::SendSmsResult& sms) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->sendCdmaSmsResponse(toAidl(info), toAidl(sms)); + messagingCb()->sendCdmaSmsResponse(toAidl(info), toAidl(sms)); return {}; } Return RadioResponse::sendCdmaSmsResponse_1_6(const V1_6::RadioResponseInfo& info, const V1_0::SendSmsResult& sms) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->sendCdmaSmsResponse(toAidl(info), toAidl(sms)); + messagingCb()->sendCdmaSmsResponse(toAidl(info), toAidl(sms)); return {}; } Return RadioResponse::sendImsSmsResponse(const V1_0::RadioResponseInfo& info, const V1_0::SendSmsResult& sms) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->sendImsSmsResponse(toAidl(info), toAidl(sms)); + messagingCb()->sendImsSmsResponse(toAidl(info), toAidl(sms)); return {}; } Return RadioResponse::sendSMSExpectMoreResponse(const V1_0::RadioResponseInfo& info, const V1_0::SendSmsResult& sms) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->sendSmsExpectMoreResponse(toAidl(info), toAidl(sms)); + messagingCb()->sendSmsExpectMoreResponse(toAidl(info), toAidl(sms)); return {}; } Return RadioResponse::sendSmsExpectMoreResponse_1_6(const V1_6::RadioResponseInfo& info, const V1_0::SendSmsResult& sms) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->sendSmsExpectMoreResponse(toAidl(info), toAidl(sms)); + messagingCb()->sendSmsExpectMoreResponse(toAidl(info), toAidl(sms)); return {}; } Return RadioResponse::sendSmsResponse(const V1_0::RadioResponseInfo& info, const V1_0::SendSmsResult& sms) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->sendSmsResponse(toAidl(info), toAidl(sms)); + messagingCb()->sendSmsResponse(toAidl(info), toAidl(sms)); return {}; } Return RadioResponse::sendSmsResponse_1_6(const V1_6::RadioResponseInfo& info, const V1_0::SendSmsResult& sms) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->sendSmsResponse(toAidl(info), toAidl(sms)); + messagingCb()->sendSmsResponse(toAidl(info), toAidl(sms)); return {}; } Return RadioResponse::sendUssdResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->sendUssdResponse(toAidl(info)); + messagingCb()->sendUssdResponse(toAidl(info)); return {}; } Return RadioResponse::setCdmaBroadcastActivationResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->setCdmaBroadcastActivationResponse(toAidl(info)); + messagingCb()->setCdmaBroadcastActivationResponse(toAidl(info)); return {}; } Return RadioResponse::setCdmaBroadcastConfigResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->setCdmaBroadcastConfigResponse(toAidl(info)); + messagingCb()->setCdmaBroadcastConfigResponse(toAidl(info)); return {}; } Return RadioResponse::setGsmBroadcastActivationResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->setGsmBroadcastActivationResponse(toAidl(info)); + messagingCb()->setGsmBroadcastActivationResponse(toAidl(info)); return {}; } Return RadioResponse::setGsmBroadcastConfigResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->setGsmBroadcastConfigResponse(toAidl(info)); + messagingCb()->setGsmBroadcastConfigResponse(toAidl(info)); return {}; } Return RadioResponse::setSmscAddressResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mMessagingCb); - mMessagingCb->setSmscAddressResponse(toAidl(info)); + messagingCb()->setSmscAddressResponse(toAidl(info)); return {}; } Return RadioResponse::writeSmsToRuimResponse(const V1_0::RadioResponseInfo& info, uint32_t index) { LOG_CALL << info.serial << ' ' << index; - CHECK_CB(mMessagingCb); - mMessagingCb->writeSmsToRuimResponse(toAidl(info), index); + messagingCb()->writeSmsToRuimResponse(toAidl(info), index); return {}; } Return RadioResponse::writeSmsToSimResponse(const V1_0::RadioResponseInfo& info, int32_t index) { LOG_CALL << info.serial << ' ' << index; - CHECK_CB(mMessagingCb); - mMessagingCb->writeSmsToSimResponse(toAidl(info), index); + messagingCb()->writeSmsToSimResponse(toAidl(info), index); return {}; } diff --git a/radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp b/radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp index 8fc4da62d5..851c93b921 100644 --- a/radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp +++ b/radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp @@ -29,44 +29,42 @@ namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio::modem; void RadioIndication::setResponseFunction(std::shared_ptr modemCb) { - CHECK(modemCb); mModemCb = modemCb; } +std::shared_ptr RadioIndication::modemCb() { + return mModemCb.get(); +} + Return RadioIndication::hardwareConfigChanged(V1_0::RadioIndicationType type, const hidl_vec& configs) { LOG_CALL << type; - CHECK_CB(mModemCb); - mModemCb->hardwareConfigChanged(toAidl(type), toAidl(configs)); + modemCb()->hardwareConfigChanged(toAidl(type), toAidl(configs)); return {}; } Return RadioIndication::modemReset(V1_0::RadioIndicationType type, const hidl_string& reasn) { LOG_CALL << type; - CHECK_CB(mModemCb); - mModemCb->modemReset(toAidl(type), reasn); + modemCb()->modemReset(toAidl(type), reasn); return {}; } Return RadioIndication::radioCapabilityIndication(V1_0::RadioIndicationType type, const V1_0::RadioCapability& rc) { LOG_CALL << type; - CHECK_CB(mModemCb); - mModemCb->radioCapabilityIndication(toAidl(type), toAidl(rc)); + modemCb()->radioCapabilityIndication(toAidl(type), toAidl(rc)); return {}; } Return RadioIndication::radioStateChanged(V1_0::RadioIndicationType t, V1_0::RadioState st) { LOG_CALL << t; - CHECK_CB(mModemCb); - mModemCb->radioStateChanged(toAidl(t), aidl::RadioState(st)); + modemCb()->radioStateChanged(toAidl(t), aidl::RadioState(st)); return {}; } Return RadioIndication::rilConnected(V1_0::RadioIndicationType type) { LOG_CALL << type; - CHECK_CB(mModemCb); - mModemCb->rilConnected(toAidl(type)); + modemCb()->rilConnected(toAidl(type)); return {}; } diff --git a/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp b/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp index 660ae9f2ed..3fff5ee317 100644 --- a/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp +++ b/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp @@ -27,6 +27,10 @@ using ::ndk::ScopedAStatus; namespace aidl = ::aidl::android::hardware::radio::modem; constexpr auto ok = &ScopedAStatus::ok; +std::shared_ptr RadioModem::respond() { + return mRadioResponse->modemCb(); +} + ScopedAStatus RadioModem::enableModem(int32_t serial, bool on) { LOG_CALL << serial; mHal1_5->enableModem(serial, on); diff --git a/radio/aidl/compat/libradiocompat/modem/RadioResponse-modem.cpp b/radio/aidl/compat/libradiocompat/modem/RadioResponse-modem.cpp index 300627c0f4..6e1a962903 100644 --- a/radio/aidl/compat/libradiocompat/modem/RadioResponse-modem.cpp +++ b/radio/aidl/compat/libradiocompat/modem/RadioResponse-modem.cpp @@ -29,22 +29,23 @@ namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio::modem; void RadioResponse::setResponseFunction(std::shared_ptr modemCb) { - CHECK(modemCb); mModemCb = modemCb; } +std::shared_ptr RadioResponse::modemCb() { + return mModemCb.get(); +} + Return RadioResponse::enableModemResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->enableModemResponse(toAidl(info)); + modemCb()->enableModemResponse(toAidl(info)); return {}; } Return RadioResponse::getBasebandVersionResponse(const V1_0::RadioResponseInfo& info, const hidl_string& version) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->getBasebandVersionResponse(toAidl(info), version); + modemCb()->getBasebandVersionResponse(toAidl(info), version); return {}; } @@ -52,112 +53,97 @@ Return RadioResponse::getDeviceIdentityResponse( // const V1_0::RadioResponseInfo& info, const hidl_string& imei, const hidl_string& imeisv, const hidl_string& esn, const hidl_string& meid) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->getDeviceIdentityResponse(toAidl(info), imei, imeisv, esn, meid); + modemCb()->getDeviceIdentityResponse(toAidl(info), imei, imeisv, esn, meid); return {}; } Return RadioResponse::getHardwareConfigResponse( const V1_0::RadioResponseInfo& info, const hidl_vec& config) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->getHardwareConfigResponse(toAidl(info), toAidl(config)); + modemCb()->getHardwareConfigResponse(toAidl(info), toAidl(config)); return {}; } Return RadioResponse::getModemActivityInfoResponse( const V1_0::RadioResponseInfo& info, const V1_0::ActivityStatsInfo& activityInfo) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->getModemActivityInfoResponse(toAidl(info), toAidl(activityInfo)); + modemCb()->getModemActivityInfoResponse(toAidl(info), toAidl(activityInfo)); return {}; } Return RadioResponse::getModemStackStatusResponse(const V1_0::RadioResponseInfo& info, bool isEnabled) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->getModemStackStatusResponse(toAidl(info), isEnabled); + modemCb()->getModemStackStatusResponse(toAidl(info), isEnabled); return {}; } Return RadioResponse::getRadioCapabilityResponse(const V1_0::RadioResponseInfo& info, const V1_0::RadioCapability& rc) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->getRadioCapabilityResponse(toAidl(info), toAidl(rc)); + modemCb()->getRadioCapabilityResponse(toAidl(info), toAidl(rc)); return {}; } Return RadioResponse::nvReadItemResponse(const V1_0::RadioResponseInfo& info, const hidl_string& result) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->nvReadItemResponse(toAidl(info), result); + modemCb()->nvReadItemResponse(toAidl(info), result); return {}; } Return RadioResponse::nvResetConfigResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->nvResetConfigResponse(toAidl(info)); + modemCb()->nvResetConfigResponse(toAidl(info)); return {}; } Return RadioResponse::nvWriteCdmaPrlResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->nvWriteCdmaPrlResponse(toAidl(info)); + modemCb()->nvWriteCdmaPrlResponse(toAidl(info)); return {}; } Return RadioResponse::nvWriteItemResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->nvWriteItemResponse(toAidl(info)); + modemCb()->nvWriteItemResponse(toAidl(info)); return {}; } Return RadioResponse::requestShutdownResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->requestShutdownResponse(toAidl(info)); + modemCb()->requestShutdownResponse(toAidl(info)); return {}; } Return RadioResponse::sendDeviceStateResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->sendDeviceStateResponse(toAidl(info)); + modemCb()->sendDeviceStateResponse(toAidl(info)); return {}; } Return RadioResponse::setRadioCapabilityResponse(const V1_0::RadioResponseInfo& info, const V1_0::RadioCapability& rc) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->setRadioCapabilityResponse(toAidl(info), toAidl(rc)); + modemCb()->setRadioCapabilityResponse(toAidl(info), toAidl(rc)); return {}; } Return RadioResponse::setRadioPowerResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->setRadioPowerResponse(toAidl(info)); + modemCb()->setRadioPowerResponse(toAidl(info)); return {}; } Return RadioResponse::setRadioPowerResponse_1_5(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->setRadioPowerResponse(toAidl(info)); + modemCb()->setRadioPowerResponse(toAidl(info)); return {}; } Return RadioResponse::setRadioPowerResponse_1_6(const V1_6::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mModemCb); - mModemCb->setRadioPowerResponse(toAidl(info)); + modemCb()->setRadioPowerResponse(toAidl(info)); return {}; } diff --git a/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp b/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp index 899b133bfe..d4cbdbcf5b 100644 --- a/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp +++ b/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp @@ -30,23 +30,24 @@ using ::aidl::android::hardware::radio::RadioTechnology; namespace aidl = ::aidl::android::hardware::radio::network; void RadioIndication::setResponseFunction(std::shared_ptr netCb) { - CHECK(netCb); mNetworkCb = netCb; } +std::shared_ptr RadioIndication::networkCb() { + return mNetworkCb.get(); +} + Return RadioIndication::barringInfoChanged(V1_0::RadioIndicationType type, const V1_5::CellIdentity& cellIdentity, const hidl_vec& barringInfos) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->barringInfoChanged(toAidl(type), toAidl(cellIdentity), toAidl(barringInfos)); + networkCb()->barringInfoChanged(toAidl(type), toAidl(cellIdentity), toAidl(barringInfos)); return {}; } Return RadioIndication::cdmaPrlChanged(V1_0::RadioIndicationType type, int32_t version) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->cdmaPrlChanged(toAidl(type), version); + networkCb()->cdmaPrlChanged(toAidl(type), version); return {}; } @@ -74,32 +75,28 @@ Return RadioIndication::cellInfoList_1_4(V1_0::RadioIndicationType type, Return RadioIndication::cellInfoList_1_5(V1_0::RadioIndicationType type, const hidl_vec& records) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->cellInfoList(toAidl(type), toAidl(records)); + networkCb()->cellInfoList(toAidl(type), toAidl(records)); return {}; } Return RadioIndication::cellInfoList_1_6(V1_0::RadioIndicationType type, const hidl_vec& records) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->cellInfoList(toAidl(type), toAidl(records)); + networkCb()->cellInfoList(toAidl(type), toAidl(records)); return {}; } Return RadioIndication::currentLinkCapacityEstimate(V1_0::RadioIndicationType type, const V1_2::LinkCapacityEstimate& lce) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->currentLinkCapacityEstimate(toAidl(type), toAidl(lce)); + networkCb()->currentLinkCapacityEstimate(toAidl(type), toAidl(lce)); return {}; } Return RadioIndication::currentLinkCapacityEstimate_1_6( V1_0::RadioIndicationType type, const V1_6::LinkCapacityEstimate& lce) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->currentLinkCapacityEstimate(toAidl(type), toAidl(lce)); + networkCb()->currentLinkCapacityEstimate(toAidl(type), toAidl(lce)); return {}; } @@ -113,16 +110,14 @@ Return RadioIndication::currentPhysicalChannelConfigs( Return RadioIndication::currentPhysicalChannelConfigs_1_4( V1_0::RadioIndicationType type, const hidl_vec& configs) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->currentPhysicalChannelConfigs(toAidl(type), toAidl(configs)); + networkCb()->currentPhysicalChannelConfigs(toAidl(type), toAidl(configs)); return {}; } Return RadioIndication::currentPhysicalChannelConfigs_1_6( V1_0::RadioIndicationType type, const hidl_vec& configs) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->currentPhysicalChannelConfigs(toAidl(type), toAidl(configs)); + networkCb()->currentPhysicalChannelConfigs(toAidl(type), toAidl(configs)); return {}; } @@ -143,23 +138,20 @@ Return RadioIndication::currentSignalStrength_1_2(V1_0::RadioIndicationTyp Return RadioIndication::currentSignalStrength_1_4( V1_0::RadioIndicationType type, const V1_4::SignalStrength& signalStrength) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->currentSignalStrength(toAidl(type), toAidl(signalStrength)); + networkCb()->currentSignalStrength(toAidl(type), toAidl(signalStrength)); return {}; } Return RadioIndication::currentSignalStrength_1_6( V1_0::RadioIndicationType type, const V1_6::SignalStrength& signalStrength) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->currentSignalStrength(toAidl(type), toAidl(signalStrength)); + networkCb()->currentSignalStrength(toAidl(type), toAidl(signalStrength)); return {}; } Return RadioIndication::imsNetworkStateChanged(V1_0::RadioIndicationType type) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->imsNetworkStateChanged(toAidl(type)); + networkCb()->imsNetworkStateChanged(toAidl(type)); return {}; } @@ -187,31 +179,27 @@ Return RadioIndication::networkScanResult_1_4(V1_0::RadioIndicationType ty Return RadioIndication::networkScanResult_1_5(V1_0::RadioIndicationType type, const V1_5::NetworkScanResult& result) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->networkScanResult(toAidl(type), toAidl(result)); + networkCb()->networkScanResult(toAidl(type), toAidl(result)); return {}; } Return RadioIndication::networkScanResult_1_6(V1_0::RadioIndicationType type, const V1_6::NetworkScanResult& result) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->networkScanResult(toAidl(type), toAidl(result)); + networkCb()->networkScanResult(toAidl(type), toAidl(result)); return {}; } Return RadioIndication::networkStateChanged(V1_0::RadioIndicationType type) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->networkStateChanged(toAidl(type)); + networkCb()->networkStateChanged(toAidl(type)); return {}; } Return RadioIndication::nitzTimeReceived(V1_0::RadioIndicationType type, const hidl_string& nitzTime, uint64_t receivedTime) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->nitzTimeReceived(toAidl(type), nitzTime, receivedTime, 0); + networkCb()->nitzTimeReceived(toAidl(type), nitzTime, receivedTime, 0); return {}; } @@ -220,33 +208,29 @@ Return RadioIndication::registrationFailed( // const hidl_string& chosenPlmn, hidl_bitfield domain, int32_t causeCode, int32_t additionalCauseCode) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->registrationFailed(toAidl(type), toAidl(cellIdentity), chosenPlmn, - aidl::Domain(domain), causeCode, additionalCauseCode); + networkCb()->registrationFailed(toAidl(type), toAidl(cellIdentity), chosenPlmn, + aidl::Domain(domain), causeCode, additionalCauseCode); return {}; } Return RadioIndication::restrictedStateChanged(V1_0::RadioIndicationType type, V1_0::PhoneRestrictedState state) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->restrictedStateChanged(toAidl(type), aidl::PhoneRestrictedState(state)); + networkCb()->restrictedStateChanged(toAidl(type), aidl::PhoneRestrictedState(state)); return {}; } Return RadioIndication::suppSvcNotify(V1_0::RadioIndicationType type, const V1_0::SuppSvcNotification& suppSvc) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->suppSvcNotify(toAidl(type), toAidl(suppSvc)); + networkCb()->suppSvcNotify(toAidl(type), toAidl(suppSvc)); return {}; } Return RadioIndication::voiceRadioTechChanged(V1_0::RadioIndicationType type, V1_0::RadioTechnology rat) { LOG_CALL << type; - CHECK_CB(mNetworkCb); - mNetworkCb->voiceRadioTechChanged(toAidl(type), RadioTechnology(rat)); + networkCb()->voiceRadioTechChanged(toAidl(type), RadioTechnology(rat)); return {}; } diff --git a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp index 5fa1cf5da3..f6ed507690 100644 --- a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp +++ b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp @@ -33,6 +33,10 @@ using ::ndk::ScopedAStatus; namespace aidl = ::aidl::android::hardware::radio::network; constexpr auto ok = &ScopedAStatus::ok; +std::shared_ptr RadioNetwork::respond() { + return mRadioResponse->networkCb(); +} + ScopedAStatus RadioNetwork::getAllowedNetworkTypesBitmap(int32_t serial) { LOG_CALL << serial; if (mHal1_6) { @@ -108,7 +112,7 @@ ScopedAStatus RadioNetwork::getSystemSelectionChannels(int32_t serial) { if (mHal1_6) { mHal1_6->getSystemSelectionChannels(serial); } else { - respond().getSystemSelectionChannelsResponse(notSupported(serial), {}); + respond()->getSystemSelectionChannelsResponse(notSupported(serial), {}); } return ok(); } @@ -130,7 +134,7 @@ ScopedAStatus RadioNetwork::isNrDualConnectivityEnabled(int32_t serial) { if (mHal1_6) { mHal1_6->isNrDualConnectivityEnabled(serial); } else { - respond().isNrDualConnectivityEnabledResponse(notSupported(serial), false); + respond()->isNrDualConnectivityEnabledResponse(notSupported(serial), false); } return ok(); } @@ -219,7 +223,7 @@ ScopedAStatus RadioNetwork::setNrDualConnectivityState(int32_t serial, if (mHal1_6) { mHal1_6->setNrDualConnectivityState(serial, V1_6::NrDualConnectivityState(st)); } else { - respond().setNrDualConnectivityStateResponse(notSupported(serial)); + respond()->setNrDualConnectivityStateResponse(notSupported(serial)); } return ok(); } diff --git a/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp b/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp index 81f7775e19..bab1d4a30d 100644 --- a/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp +++ b/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp @@ -33,25 +33,26 @@ using ::aidl::android::hardware::radio::RadioTechnologyFamily; namespace aidl = ::aidl::android::hardware::radio::network; void RadioResponse::setResponseFunction(std::shared_ptr netCb) { - CHECK(netCb); mNetworkCb = netCb; } +std::shared_ptr RadioResponse::networkCb() { + return mNetworkCb.get(); +} + Return RadioResponse::getAllowedNetworkTypesBitmapResponse( const V1_6::RadioResponseInfo& info, hidl_bitfield networkTypeBitmap) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getAllowedNetworkTypesBitmapResponse(toAidl(info), - RadioAccessFamily(networkTypeBitmap)); + networkCb()->getAllowedNetworkTypesBitmapResponse(toAidl(info), + RadioAccessFamily(networkTypeBitmap)); return {}; } Return RadioResponse::getPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info, V1_0::PreferredNetworkType nwType) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getAllowedNetworkTypesBitmapResponse( // + networkCb()->getAllowedNetworkTypesBitmapResponse( // toAidl(info), RadioAccessFamily(getRafFromNetworkType(nwType))); return {}; } @@ -66,16 +67,14 @@ Return RadioResponse::getPreferredNetworkTypeBitmapResponse( Return RadioResponse::getAvailableBandModesResponse( const V1_0::RadioResponseInfo& info, const hidl_vec& bandModes) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getAvailableBandModesResponse(toAidl(info), toAidl(bandModes)); + networkCb()->getAvailableBandModesResponse(toAidl(info), toAidl(bandModes)); return {}; } Return RadioResponse::getAvailableNetworksResponse( const V1_0::RadioResponseInfo& info, const hidl_vec& networkInfos) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getAvailableNetworksResponse(toAidl(info), toAidl(networkInfos)); + networkCb()->getAvailableNetworksResponse(toAidl(info), toAidl(networkInfos)); return {}; } @@ -83,16 +82,14 @@ Return RadioResponse::getBarringInfoResponse( const V1_0::RadioResponseInfo& info, const V1_5::CellIdentity& cellIdentity, const hidl_vec& barringInfos) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getBarringInfoResponse(toAidl(info), toAidl(cellIdentity), toAidl(barringInfos)); + networkCb()->getBarringInfoResponse(toAidl(info), toAidl(cellIdentity), toAidl(barringInfos)); return {}; } Return RadioResponse::getCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info, V1_0::CdmaRoamingType type) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getCdmaRoamingPreferenceResponse(toAidl(info), aidl::CdmaRoamingType(type)); + networkCb()->getCdmaRoamingPreferenceResponse(toAidl(info), aidl::CdmaRoamingType(type)); return {}; } @@ -120,16 +117,14 @@ Return RadioResponse::getCellInfoListResponse_1_4(const V1_0::RadioRespons Return RadioResponse::getCellInfoListResponse_1_5(const V1_0::RadioResponseInfo& info, const hidl_vec& cellInfo) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getCellInfoListResponse(toAidl(info), toAidl(cellInfo)); + networkCb()->getCellInfoListResponse(toAidl(info), toAidl(cellInfo)); return {}; } Return RadioResponse::getCellInfoListResponse_1_6(const V1_6::RadioResponseInfo& info, const hidl_vec& cellInfo) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getCellInfoListResponse(toAidl(info), toAidl(cellInfo)); + networkCb()->getCellInfoListResponse(toAidl(info), toAidl(cellInfo)); return {}; } @@ -157,25 +152,22 @@ Return RadioResponse::getDataRegistrationStateResponse_1_4( Return RadioResponse::getDataRegistrationStateResponse_1_5( const V1_0::RadioResponseInfo& info, const V1_5::RegStateResult& dataRegResponse) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getDataRegistrationStateResponse(toAidl(info), toAidl(dataRegResponse)); + networkCb()->getDataRegistrationStateResponse(toAidl(info), toAidl(dataRegResponse)); return {}; } Return RadioResponse::getDataRegistrationStateResponse_1_6( const V1_6::RadioResponseInfo& info, const V1_6::RegStateResult& dataRegResponse) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getDataRegistrationStateResponse(toAidl(info), toAidl(dataRegResponse)); + networkCb()->getDataRegistrationStateResponse(toAidl(info), toAidl(dataRegResponse)); return {}; } Return RadioResponse::getImsRegistrationStateResponse( // const V1_0::RadioResponseInfo& info, bool isRegd, V1_0::RadioTechnologyFamily ratFamily) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getImsRegistrationStateResponse(toAidl(info), isRegd, - RadioTechnologyFamily(ratFamily)); + networkCb()->getImsRegistrationStateResponse(toAidl(info), isRegd, + RadioTechnologyFamily(ratFamily)); return {}; } @@ -189,8 +181,7 @@ Return RadioResponse::getNeighboringCidsResponse(const V1_0::RadioResponse Return RadioResponse::getNetworkSelectionModeResponse(const V1_0::RadioResponseInfo& info, bool manual) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getNetworkSelectionModeResponse(toAidl(info), manual); + networkCb()->getNetworkSelectionModeResponse(toAidl(info), manual); return {}; } @@ -198,8 +189,7 @@ Return RadioResponse::getOperatorResponse( // const V1_0::RadioResponseInfo& info, const hidl_string& longName, const hidl_string& shortName, const hidl_string& numeric) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getOperatorResponse(toAidl(info), longName, shortName, numeric); + networkCb()->getOperatorResponse(toAidl(info), longName, shortName, numeric); return {}; } @@ -220,16 +210,14 @@ Return RadioResponse::getSignalStrengthResponse_1_2(const V1_0::RadioRespo Return RadioResponse::getSignalStrengthResponse_1_4( const V1_0::RadioResponseInfo& info, const V1_4::SignalStrength& signalStrength) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getSignalStrengthResponse(toAidl(info), toAidl(signalStrength)); + networkCb()->getSignalStrengthResponse(toAidl(info), toAidl(signalStrength)); return {}; } Return RadioResponse::getSignalStrengthResponse_1_6( const V1_6::RadioResponseInfo& info, const V1_6::SignalStrength& signalStrength) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getSignalStrengthResponse(toAidl(info), toAidl(signalStrength)); + networkCb()->getSignalStrengthResponse(toAidl(info), toAidl(signalStrength)); return {}; } @@ -237,16 +225,14 @@ Return RadioResponse::getSystemSelectionChannelsResponse( const V1_6::RadioResponseInfo& info, const hidl_vec& specifiers) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getSystemSelectionChannelsResponse(toAidl(info), toAidl(specifiers)); + networkCb()->getSystemSelectionChannelsResponse(toAidl(info), toAidl(specifiers)); return {}; } Return RadioResponse::getVoiceRadioTechnologyResponse(const V1_0::RadioResponseInfo& info, V1_0::RadioTechnology rat) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getVoiceRadioTechnologyResponse(toAidl(info), RadioTechnology(rat)); + networkCb()->getVoiceRadioTechnologyResponse(toAidl(info), RadioTechnology(rat)); return {}; } @@ -267,24 +253,21 @@ Return RadioResponse::getVoiceRegistrationStateResponse_1_2( Return RadioResponse::getVoiceRegistrationStateResponse_1_5( const V1_0::RadioResponseInfo& info, const V1_5::RegStateResult& voiceRegResponse) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getVoiceRegistrationStateResponse(toAidl(info), toAidl(voiceRegResponse)); + networkCb()->getVoiceRegistrationStateResponse(toAidl(info), toAidl(voiceRegResponse)); return {}; } Return RadioResponse::getVoiceRegistrationStateResponse_1_6( const V1_6::RadioResponseInfo& info, const V1_6::RegStateResult& voiceRegResponse) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->getVoiceRegistrationStateResponse(toAidl(info), toAidl(voiceRegResponse)); + networkCb()->getVoiceRegistrationStateResponse(toAidl(info), toAidl(voiceRegResponse)); return {}; } Return RadioResponse::isNrDualConnectivityEnabledResponse(const V1_6::RadioResponseInfo& info, bool isEnabled) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->isNrDualConnectivityEnabledResponse(toAidl(info), isEnabled); + networkCb()->isNrDualConnectivityEnabledResponse(toAidl(info), isEnabled); return {}; } @@ -297,15 +280,13 @@ Return RadioResponse::pullLceDataResponse(const V1_0::RadioResponseInfo& i Return RadioResponse::setAllowedNetworkTypesBitmapResponse(const V1_6::RadioResponseInfo& i) { LOG_CALL << i.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setAllowedNetworkTypesBitmapResponse(toAidl(i)); + networkCb()->setAllowedNetworkTypesBitmapResponse(toAidl(i)); return {}; } Return RadioResponse::setPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setAllowedNetworkTypesBitmapResponse(toAidl(info)); + networkCb()->setAllowedNetworkTypesBitmapResponse(toAidl(info)); return {}; } @@ -318,174 +299,151 @@ Return RadioResponse::setPreferredNetworkTypeBitmapResponse( Return RadioResponse::setBandModeResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setBandModeResponse(toAidl(info)); + networkCb()->setBandModeResponse(toAidl(info)); return {}; } Return RadioResponse::setBarringPasswordResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setBarringPasswordResponse(toAidl(info)); + networkCb()->setBarringPasswordResponse(toAidl(info)); return {}; } Return RadioResponse::setCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setCdmaRoamingPreferenceResponse(toAidl(info)); + networkCb()->setCdmaRoamingPreferenceResponse(toAidl(info)); return {}; } Return RadioResponse::setCellInfoListRateResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setCellInfoListRateResponse(toAidl(info)); + networkCb()->setCellInfoListRateResponse(toAidl(info)); return {}; } Return RadioResponse::setIndicationFilterResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setIndicationFilterResponse(toAidl(info)); + networkCb()->setIndicationFilterResponse(toAidl(info)); return {}; } Return RadioResponse::setIndicationFilterResponse_1_5(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setIndicationFilterResponse(toAidl(info)); + networkCb()->setIndicationFilterResponse(toAidl(info)); return {}; } Return RadioResponse::setLinkCapacityReportingCriteriaResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setLinkCapacityReportingCriteriaResponse(toAidl(info)); + networkCb()->setLinkCapacityReportingCriteriaResponse(toAidl(info)); return {}; } Return RadioResponse::setLinkCapacityReportingCriteriaResponse_1_5( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setLinkCapacityReportingCriteriaResponse(toAidl(info)); + networkCb()->setLinkCapacityReportingCriteriaResponse(toAidl(info)); return {}; } Return RadioResponse::setLocationUpdatesResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setLocationUpdatesResponse(toAidl(info)); + networkCb()->setLocationUpdatesResponse(toAidl(info)); return {}; } Return RadioResponse::setNetworkSelectionModeAutomaticResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setNetworkSelectionModeAutomaticResponse(toAidl(info)); + networkCb()->setNetworkSelectionModeAutomaticResponse(toAidl(info)); return {}; } Return RadioResponse::setNetworkSelectionModeManualResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setNetworkSelectionModeManualResponse(toAidl(info)); + networkCb()->setNetworkSelectionModeManualResponse(toAidl(info)); return {}; } Return RadioResponse::setNetworkSelectionModeManualResponse_1_5( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setNetworkSelectionModeManualResponse(toAidl(info)); + networkCb()->setNetworkSelectionModeManualResponse(toAidl(info)); return {}; } Return RadioResponse::setNrDualConnectivityStateResponse( const V1_6::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setNrDualConnectivityStateResponse(toAidl(info)); + networkCb()->setNrDualConnectivityStateResponse(toAidl(info)); return {}; } Return RadioResponse::setSignalStrengthReportingCriteriaResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setSignalStrengthReportingCriteriaResponse(toAidl(info)); + networkCb()->setSignalStrengthReportingCriteriaResponse(toAidl(info)); return {}; } Return RadioResponse::setSignalStrengthReportingCriteriaResponse_1_5( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setSignalStrengthReportingCriteriaResponse(toAidl(info)); + networkCb()->setSignalStrengthReportingCriteriaResponse(toAidl(info)); return {}; } Return RadioResponse::setSuppServiceNotificationsResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setSuppServiceNotificationsResponse(toAidl(info)); + networkCb()->setSuppServiceNotificationsResponse(toAidl(info)); return {}; } Return RadioResponse::setSystemSelectionChannelsResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setSystemSelectionChannelsResponse(toAidl(info)); + networkCb()->setSystemSelectionChannelsResponse(toAidl(info)); return {}; } Return RadioResponse::setSystemSelectionChannelsResponse_1_5( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->setSystemSelectionChannelsResponse(toAidl(info)); + networkCb()->setSystemSelectionChannelsResponse(toAidl(info)); return {}; } Return RadioResponse::startNetworkScanResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->startNetworkScanResponse(toAidl(info)); + networkCb()->startNetworkScanResponse(toAidl(info)); return {}; } Return RadioResponse::startNetworkScanResponse_1_4(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->startNetworkScanResponse(toAidl(info)); + networkCb()->startNetworkScanResponse(toAidl(info)); return {}; } Return RadioResponse::startNetworkScanResponse_1_5(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->startNetworkScanResponse(toAidl(info)); + networkCb()->startNetworkScanResponse(toAidl(info)); return {}; } Return RadioResponse::stopNetworkScanResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->stopNetworkScanResponse(toAidl(info)); + networkCb()->stopNetworkScanResponse(toAidl(info)); return {}; } Return RadioResponse::supplyNetworkDepersonalizationResponse( const V1_0::RadioResponseInfo& info, int32_t remainingRetries) { LOG_CALL << info.serial; - CHECK_CB(mNetworkCb); - mNetworkCb->supplyNetworkDepersonalizationResponse(toAidl(info), remainingRetries); + networkCb()->supplyNetworkDepersonalizationResponse(toAidl(info), remainingRetries); return {}; } diff --git a/radio/aidl/compat/libradiocompat/sim/RadioIndication-sim.cpp b/radio/aidl/compat/libradiocompat/sim/RadioIndication-sim.cpp index 6b906c62f3..3938e004d3 100644 --- a/radio/aidl/compat/libradiocompat/sim/RadioIndication-sim.cpp +++ b/radio/aidl/compat/libradiocompat/sim/RadioIndication-sim.cpp @@ -29,29 +29,29 @@ namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio::sim; void RadioIndication::setResponseFunction(std::shared_ptr simCb) { - CHECK(simCb); mSimCb = simCb; } +std::shared_ptr RadioIndication::simCb() { + return mSimCb.get(); +} + Return RadioIndication::carrierInfoForImsiEncryption(V1_0::RadioIndicationType type) { LOG_CALL << type; - CHECK_CB(mSimCb); - mSimCb->carrierInfoForImsiEncryption(toAidl(type)); + simCb()->carrierInfoForImsiEncryption(toAidl(type)); return {}; } Return RadioIndication::cdmaSubscriptionSourceChanged( V1_0::RadioIndicationType type, V1_0::CdmaSubscriptionSource cdmaSource) { LOG_CALL << type; - CHECK_CB(mSimCb); - mSimCb->cdmaSubscriptionSourceChanged(toAidl(type), aidl::CdmaSubscriptionSource(cdmaSource)); + simCb()->cdmaSubscriptionSourceChanged(toAidl(type), aidl::CdmaSubscriptionSource(cdmaSource)); return {}; } Return RadioIndication::simPhonebookChanged(V1_0::RadioIndicationType type) { LOG_CALL << type; - CHECK_CB(mSimCb); - mSimCb->simPhonebookChanged(toAidl(type)); + simCb()->simPhonebookChanged(toAidl(type)); return {}; } @@ -59,62 +59,54 @@ Return RadioIndication::simPhonebookRecordsReceived( V1_0::RadioIndicationType type, V1_6::PbReceivedStatus status, const hidl_vec& rec) { LOG_CALL << type; - CHECK_CB(mSimCb); - mSimCb->simPhonebookRecordsReceived(toAidl(type), aidl::PbReceivedStatus(status), toAidl(rec)); + simCb()->simPhonebookRecordsReceived(toAidl(type), aidl::PbReceivedStatus(status), toAidl(rec)); return {}; } Return RadioIndication::simRefresh(V1_0::RadioIndicationType type, const V1_0::SimRefreshResult& refreshResult) { LOG_CALL << type; - CHECK_CB(mSimCb); - mSimCb->simRefresh(toAidl(type), toAidl(refreshResult)); + simCb()->simRefresh(toAidl(type), toAidl(refreshResult)); return {}; } Return RadioIndication::simStatusChanged(V1_0::RadioIndicationType type) { LOG_CALL << type; - CHECK_CB(mSimCb); - mSimCb->simStatusChanged(toAidl(type)); + simCb()->simStatusChanged(toAidl(type)); return {}; } Return RadioIndication::stkEventNotify(V1_0::RadioIndicationType type, const hidl_string& cmd) { LOG_CALL << type; - CHECK_CB(mSimCb); - mSimCb->stkEventNotify(toAidl(type), cmd); + simCb()->stkEventNotify(toAidl(type), cmd); return {}; } Return RadioIndication::stkProactiveCommand(V1_0::RadioIndicationType type, const hidl_string& cmd) { LOG_CALL << type; - CHECK_CB(mSimCb); - mSimCb->stkProactiveCommand(toAidl(type), cmd); + simCb()->stkProactiveCommand(toAidl(type), cmd); return {}; } Return RadioIndication::stkSessionEnd(V1_0::RadioIndicationType type) { LOG_CALL << type; - CHECK_CB(mSimCb); - mSimCb->stkSessionEnd(toAidl(type)); + simCb()->stkSessionEnd(toAidl(type)); return {}; } Return RadioIndication::subscriptionStatusChanged(V1_0::RadioIndicationType type, bool activate) { LOG_CALL << type; - CHECK_CB(mSimCb); - mSimCb->subscriptionStatusChanged(toAidl(type), activate); + simCb()->subscriptionStatusChanged(toAidl(type), activate); return {}; } Return RadioIndication::uiccApplicationsEnablementChanged(V1_0::RadioIndicationType type, bool enabled) { LOG_CALL << type; - CHECK_CB(mSimCb); - mSimCb->uiccApplicationsEnablementChanged(toAidl(type), enabled); + simCb()->uiccApplicationsEnablementChanged(toAidl(type), enabled); return {}; } diff --git a/radio/aidl/compat/libradiocompat/sim/RadioResponse-sim.cpp b/radio/aidl/compat/libradiocompat/sim/RadioResponse-sim.cpp index 2dfbc50fcd..3ad9130314 100644 --- a/radio/aidl/compat/libradiocompat/sim/RadioResponse-sim.cpp +++ b/radio/aidl/compat/libradiocompat/sim/RadioResponse-sim.cpp @@ -29,48 +29,46 @@ namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio::sim; void RadioResponse::setResponseFunction(std::shared_ptr simCb) { - CHECK(simCb); mSimCb = simCb; } +std::shared_ptr RadioResponse::simCb() { + return mSimCb.get(); +} + Return RadioResponse::areUiccApplicationsEnabledResponse(const V1_0::RadioResponseInfo& info, bool enabled) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->areUiccApplicationsEnabledResponse(toAidl(info), enabled); + simCb()->areUiccApplicationsEnabledResponse(toAidl(info), enabled); return {}; } Return RadioResponse::changeIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info, int32_t remainingRetries) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->changeIccPin2ForAppResponse(toAidl(info), remainingRetries); + simCb()->changeIccPin2ForAppResponse(toAidl(info), remainingRetries); return {}; } Return RadioResponse::changeIccPinForAppResponse(const V1_0::RadioResponseInfo& info, int32_t remainingRetries) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->changeIccPinForAppResponse(toAidl(info), remainingRetries); + simCb()->changeIccPinForAppResponse(toAidl(info), remainingRetries); return {}; } Return RadioResponse::enableUiccApplicationsResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->enableUiccApplicationsResponse(toAidl(info)); + simCb()->enableUiccApplicationsResponse(toAidl(info)); return {}; } Return RadioResponse::getAllowedCarriersResponse( // const V1_0::RadioResponseInfo& info, bool allAllowed, const V1_0::CarrierRestrictions& cr) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); aidl::CarrierRestrictions aidlCr = toAidl(cr); if (allAllowed) aidlCr = {}; - mSimCb->getAllowedCarriersResponse(toAidl(info), aidlCr, {}); + simCb()->getAllowedCarriersResponse(toAidl(info), aidlCr, {}); return {}; } @@ -78,9 +76,8 @@ Return RadioResponse::getAllowedCarriersResponse_1_4( const V1_0::RadioResponseInfo& info, const V1_4::CarrierRestrictionsWithPriority& carriers, V1_4::SimLockMultiSimPolicy multiSimPolicy) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->getAllowedCarriersResponse(toAidl(info), toAidl(carriers), - aidl::SimLockMultiSimPolicy(multiSimPolicy)); + simCb()->getAllowedCarriersResponse(toAidl(info), toAidl(carriers), + aidl::SimLockMultiSimPolicy(multiSimPolicy)); return {}; } @@ -88,133 +85,116 @@ Return RadioResponse::getCDMASubscriptionResponse( const V1_0::RadioResponseInfo& info, const hidl_string& mdn, const hidl_string& hSid, const hidl_string& hNid, const hidl_string& min, const hidl_string& prl) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->getCdmaSubscriptionResponse(toAidl(info), mdn, hSid, hNid, min, prl); + simCb()->getCdmaSubscriptionResponse(toAidl(info), mdn, hSid, hNid, min, prl); return {}; } Return RadioResponse::getCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info, V1_0::CdmaSubscriptionSource s) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->getCdmaSubscriptionSourceResponse(toAidl(info), aidl::CdmaSubscriptionSource(s)); + simCb()->getCdmaSubscriptionSourceResponse(toAidl(info), aidl::CdmaSubscriptionSource(s)); return {}; } Return RadioResponse::getFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info, int32_t response) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->getFacilityLockForAppResponse(toAidl(info), response); + simCb()->getFacilityLockForAppResponse(toAidl(info), response); return {}; } Return RadioResponse::getIccCardStatusResponse(const V1_0::RadioResponseInfo& info, const V1_0::CardStatus& cardStatus) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus)); + simCb()->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus)); return {}; } Return RadioResponse::getIccCardStatusResponse_1_2(const V1_0::RadioResponseInfo& info, const V1_2::CardStatus& cardStatus) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus)); + simCb()->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus)); return {}; } Return RadioResponse::getIccCardStatusResponse_1_4(const V1_0::RadioResponseInfo& info, const V1_4::CardStatus& cardStatus) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus)); + simCb()->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus)); return {}; } Return RadioResponse::getIccCardStatusResponse_1_5(const V1_0::RadioResponseInfo& info, const V1_5::CardStatus& cardStatus) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus)); + simCb()->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus)); return {}; } Return RadioResponse::getIMSIForAppResponse(const V1_0::RadioResponseInfo& info, const hidl_string& imsi) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->getImsiForAppResponse(toAidl(info), imsi); + simCb()->getImsiForAppResponse(toAidl(info), imsi); return {}; } Return RadioResponse::getSimPhonebookCapacityResponse( const V1_6::RadioResponseInfo& info, const V1_6::PhonebookCapacity& capacity) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->getSimPhonebookCapacityResponse(toAidl(info), toAidl(capacity)); + simCb()->getSimPhonebookCapacityResponse(toAidl(info), toAidl(capacity)); return {}; } Return RadioResponse::getSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->getSimPhonebookRecordsResponse(toAidl(info)); + simCb()->getSimPhonebookRecordsResponse(toAidl(info)); return {}; } Return RadioResponse::iccCloseLogicalChannelResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->iccCloseLogicalChannelResponse(toAidl(info)); + simCb()->iccCloseLogicalChannelResponse(toAidl(info)); return {}; } Return RadioResponse::iccIOForAppResponse(const V1_0::RadioResponseInfo& info, const V1_0::IccIoResult& iccIo) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->iccIoForAppResponse(toAidl(info), toAidl(iccIo)); + simCb()->iccIoForAppResponse(toAidl(info), toAidl(iccIo)); return {}; } Return RadioResponse::iccOpenLogicalChannelResponse( // const V1_0::RadioResponseInfo& info, int32_t chanId, const hidl_vec& selectResp) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->iccOpenLogicalChannelResponse(toAidl(info), chanId, toAidl(selectResp)); + simCb()->iccOpenLogicalChannelResponse(toAidl(info), chanId, toAidl(selectResp)); return {}; } Return RadioResponse::iccTransmitApduBasicChannelResponse(const V1_0::RadioResponseInfo& info, const V1_0::IccIoResult& result) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->iccTransmitApduBasicChannelResponse(toAidl(info), toAidl(result)); + simCb()->iccTransmitApduBasicChannelResponse(toAidl(info), toAidl(result)); return {}; } Return RadioResponse::iccTransmitApduLogicalChannelResponse( const V1_0::RadioResponseInfo& info, const V1_0::IccIoResult& result) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->iccTransmitApduLogicalChannelResponse(toAidl(info), toAidl(result)); + simCb()->iccTransmitApduLogicalChannelResponse(toAidl(info), toAidl(result)); return {}; } Return RadioResponse::reportStkServiceIsRunningResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->reportStkServiceIsRunningResponse(toAidl(info)); + simCb()->reportStkServiceIsRunningResponse(toAidl(info)); return {}; } Return RadioResponse::requestIccSimAuthenticationResponse(const V1_0::RadioResponseInfo& info, const V1_0::IccIoResult& result) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->requestIccSimAuthenticationResponse(toAidl(info), toAidl(result)); + simCb()->requestIccSimAuthenticationResponse(toAidl(info), toAidl(result)); return {}; } @@ -228,121 +208,105 @@ Return RadioResponse::requestIsimAuthenticationResponse(const V1_0::RadioR Return RadioResponse::sendEnvelopeResponse(const V1_0::RadioResponseInfo& info, const hidl_string& commandResponse) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->sendEnvelopeResponse(toAidl(info), commandResponse); + simCb()->sendEnvelopeResponse(toAidl(info), commandResponse); return {}; } Return RadioResponse::sendEnvelopeWithStatusResponse(const V1_0::RadioResponseInfo& info, const V1_0::IccIoResult& iccIo) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->sendEnvelopeWithStatusResponse(toAidl(info), toAidl(iccIo)); + simCb()->sendEnvelopeWithStatusResponse(toAidl(info), toAidl(iccIo)); return {}; } Return RadioResponse::sendTerminalResponseToSimResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->sendTerminalResponseToSimResponse(toAidl(info)); + simCb()->sendTerminalResponseToSimResponse(toAidl(info)); return {}; } Return RadioResponse::setAllowedCarriersResponse(const V1_0::RadioResponseInfo& info, int32_t numAllowed) { LOG_CALL << info.serial << ' ' << numAllowed; - CHECK_CB(mSimCb); - mSimCb->setAllowedCarriersResponse(toAidl(info)); + simCb()->setAllowedCarriersResponse(toAidl(info)); return {}; } Return RadioResponse::setAllowedCarriersResponse_1_4(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->setAllowedCarriersResponse(toAidl(info)); + simCb()->setAllowedCarriersResponse(toAidl(info)); return {}; } Return RadioResponse::setCarrierInfoForImsiEncryptionResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->setCarrierInfoForImsiEncryptionResponse(toAidl(info)); + simCb()->setCarrierInfoForImsiEncryptionResponse(toAidl(info)); return {}; } Return RadioResponse::setCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->setCdmaSubscriptionSourceResponse(toAidl(info)); + simCb()->setCdmaSubscriptionSourceResponse(toAidl(info)); return {}; } Return RadioResponse::setFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info, int32_t retry) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->setFacilityLockForAppResponse(toAidl(info), retry); + simCb()->setFacilityLockForAppResponse(toAidl(info), retry); return {}; } Return RadioResponse::setSimCardPowerResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->setSimCardPowerResponse(toAidl(info)); + simCb()->setSimCardPowerResponse(toAidl(info)); return {}; } Return RadioResponse::setSimCardPowerResponse_1_1(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->setSimCardPowerResponse(toAidl(info)); + simCb()->setSimCardPowerResponse(toAidl(info)); return {}; } Return RadioResponse::setSimCardPowerResponse_1_6(const V1_6::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->setSimCardPowerResponse(toAidl(info)); + simCb()->setSimCardPowerResponse(toAidl(info)); return {}; } Return RadioResponse::setUiccSubscriptionResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->setUiccSubscriptionResponse(toAidl(info)); + simCb()->setUiccSubscriptionResponse(toAidl(info)); return {}; } Return RadioResponse::supplyIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info, int32_t remainingRetries) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->supplyIccPin2ForAppResponse(toAidl(info), remainingRetries); + simCb()->supplyIccPin2ForAppResponse(toAidl(info), remainingRetries); return {}; } Return RadioResponse::supplyIccPinForAppResponse(const V1_0::RadioResponseInfo& info, int32_t remainingRetries) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->supplyIccPinForAppResponse(toAidl(info), remainingRetries); + simCb()->supplyIccPinForAppResponse(toAidl(info), remainingRetries); return {}; } Return RadioResponse::supplyIccPuk2ForAppResponse(const V1_0::RadioResponseInfo& info, int32_t remainingRetries) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->supplyIccPuk2ForAppResponse(toAidl(info), remainingRetries); + simCb()->supplyIccPuk2ForAppResponse(toAidl(info), remainingRetries); return {}; } Return RadioResponse::supplyIccPukForAppResponse(const V1_0::RadioResponseInfo& info, int32_t remainingRetries) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->supplyIccPukForAppResponse(toAidl(info), remainingRetries); + simCb()->supplyIccPukForAppResponse(toAidl(info), remainingRetries); return {}; } @@ -350,16 +314,14 @@ Return RadioResponse::supplySimDepersonalizationResponse(const V1_0::Radio V1_5::PersoSubstate persoType, int32_t rRet) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->supplySimDepersonalizationResponse(toAidl(info), aidl::PersoSubstate(persoType), rRet); + simCb()->supplySimDepersonalizationResponse(toAidl(info), aidl::PersoSubstate(persoType), rRet); return {}; } Return RadioResponse::updateSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info, int32_t updatedRecordIndex) { LOG_CALL << info.serial; - CHECK_CB(mSimCb); - mSimCb->updateSimPhonebookRecordsResponse(toAidl(info), updatedRecordIndex); + simCb()->updateSimPhonebookRecordsResponse(toAidl(info), updatedRecordIndex); return {}; } diff --git a/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp b/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp index ca27918024..5fecd8838b 100644 --- a/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp +++ b/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp @@ -30,6 +30,10 @@ using ::ndk::ScopedAStatus; namespace aidl = ::aidl::android::hardware::radio::sim; constexpr auto ok = &ScopedAStatus::ok; +std::shared_ptr RadioSim::respond() { + return mRadioResponse->simCb(); +} + ScopedAStatus RadioSim::areUiccApplicationsEnabled(int32_t serial) { LOG_CALL << serial; mHal1_5->areUiccApplicationsEnabled(serial); @@ -99,7 +103,7 @@ ScopedAStatus RadioSim::getSimPhonebookCapacity(int32_t serial) { if (mHal1_6) { mHal1_6->getSimPhonebookCapacity(serial); } else { - respond().getSimPhonebookCapacityResponse(notSupported(serial), {}); + respond()->getSimPhonebookCapacityResponse(notSupported(serial), {}); } return ok(); } @@ -109,7 +113,7 @@ ScopedAStatus RadioSim::getSimPhonebookRecords(int32_t serial) { if (mHal1_6) { mHal1_6->getSimPhonebookRecords(serial); } else { - respond().getSimPhonebookRecordsResponse(notSupported(serial)); + respond()->getSimPhonebookRecordsResponse(notSupported(serial)); } return ok(); } @@ -287,7 +291,7 @@ ScopedAStatus RadioSim::updateSimPhonebookRecords(int32_t serial, if (mHal1_6) { mHal1_6->updateSimPhonebookRecords(serial, toHidl(recordInfo)); } else { - respond().updateSimPhonebookRecordsResponse(notSupported(serial), 0); + respond()->updateSimPhonebookRecordsResponse(notSupported(serial), 0); } return ok(); } diff --git a/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp index 6d9bda8dea..359fce0321 100644 --- a/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp +++ b/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp @@ -29,113 +29,102 @@ namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio::voice; void RadioIndication::setResponseFunction(std::shared_ptr voiceCb) { - CHECK(voiceCb); mVoiceCb = voiceCb; } +std::shared_ptr RadioIndication::voiceCb() { + return mVoiceCb.get(); +} + Return RadioIndication::callRing(V1_0::RadioIndicationType type, bool isGsm, const V1_0::CdmaSignalInfoRecord& record) { LOG_CALL << type; - CHECK_CB(mVoiceCb); - mVoiceCb->callRing(toAidl(type), isGsm, toAidl(record)); + voiceCb()->callRing(toAidl(type), isGsm, toAidl(record)); return {}; } Return RadioIndication::callStateChanged(V1_0::RadioIndicationType type) { LOG_CALL << type; - CHECK_CB(mVoiceCb); - mVoiceCb->callStateChanged(toAidl(type)); + voiceCb()->callStateChanged(toAidl(type)); return {}; } Return RadioIndication::cdmaCallWaiting(V1_0::RadioIndicationType type, const V1_0::CdmaCallWaiting& callWaitingRecord) { LOG_CALL << type; - CHECK_CB(mVoiceCb); - mVoiceCb->cdmaCallWaiting(toAidl(type), toAidl(callWaitingRecord)); + voiceCb()->cdmaCallWaiting(toAidl(type), toAidl(callWaitingRecord)); return {}; } Return RadioIndication::cdmaInfoRec(V1_0::RadioIndicationType type, const V1_0::CdmaInformationRecords& records) { LOG_CALL << type; - CHECK_CB(mVoiceCb); - mVoiceCb->cdmaInfoRec(toAidl(type), toAidl(records.infoRec)); + voiceCb()->cdmaInfoRec(toAidl(type), toAidl(records.infoRec)); return {}; } Return RadioIndication::cdmaOtaProvisionStatus(V1_0::RadioIndicationType type, V1_0::CdmaOtaProvisionStatus status) { LOG_CALL << type; - CHECK_CB(mVoiceCb); - mVoiceCb->cdmaOtaProvisionStatus(toAidl(type), aidl::CdmaOtaProvisionStatus(status)); + voiceCb()->cdmaOtaProvisionStatus(toAidl(type), aidl::CdmaOtaProvisionStatus(status)); return {}; } Return RadioIndication::currentEmergencyNumberList( V1_0::RadioIndicationType type, const hidl_vec& emergencyNumbers) { LOG_CALL << type; - CHECK_CB(mVoiceCb); - mVoiceCb->currentEmergencyNumberList(toAidl(type), toAidl(emergencyNumbers)); + voiceCb()->currentEmergencyNumberList(toAidl(type), toAidl(emergencyNumbers)); return {}; } Return RadioIndication::enterEmergencyCallbackMode(V1_0::RadioIndicationType type) { LOG_CALL << type; - CHECK_CB(mVoiceCb); - mVoiceCb->enterEmergencyCallbackMode(toAidl(type)); + voiceCb()->enterEmergencyCallbackMode(toAidl(type)); return {}; } Return RadioIndication::exitEmergencyCallbackMode(V1_0::RadioIndicationType type) { LOG_CALL << type; - CHECK_CB(mVoiceCb); - mVoiceCb->exitEmergencyCallbackMode(toAidl(type)); + voiceCb()->exitEmergencyCallbackMode(toAidl(type)); return {}; } Return RadioIndication::indicateRingbackTone(V1_0::RadioIndicationType type, bool start) { LOG_CALL << type; - CHECK_CB(mVoiceCb); - mVoiceCb->indicateRingbackTone(toAidl(type), start); + voiceCb()->indicateRingbackTone(toAidl(type), start); return {}; } Return RadioIndication::onSupplementaryServiceIndication(V1_0::RadioIndicationType type, const V1_0::StkCcUnsolSsResult& ss) { LOG_CALL << type; - CHECK_CB(mVoiceCb); - mVoiceCb->onSupplementaryServiceIndication(toAidl(type), toAidl(ss)); + voiceCb()->onSupplementaryServiceIndication(toAidl(type), toAidl(ss)); return {}; } Return RadioIndication::resendIncallMute(V1_0::RadioIndicationType type) { LOG_CALL << type; - CHECK_CB(mVoiceCb); - mVoiceCb->resendIncallMute(toAidl(type)); + voiceCb()->resendIncallMute(toAidl(type)); return {}; } Return RadioIndication::srvccStateNotify(V1_0::RadioIndicationType type, V1_0::SrvccState state) { LOG_CALL << type; - CHECK_CB(mVoiceCb); - mVoiceCb->srvccStateNotify(toAidl(type), aidl::SrvccState(state)); + voiceCb()->srvccStateNotify(toAidl(type), aidl::SrvccState(state)); return {}; } Return RadioIndication::stkCallControlAlphaNotify(V1_0::RadioIndicationType type, const hidl_string& alpha) { LOG_CALL << type; - CHECK_CB(mVoiceCb); - mVoiceCb->stkCallControlAlphaNotify(toAidl(type), alpha); + voiceCb()->stkCallControlAlphaNotify(toAidl(type), alpha); return {}; } Return RadioIndication::stkCallSetup(V1_0::RadioIndicationType type, int64_t timeout) { LOG_CALL << type; - CHECK_CB(mVoiceCb); - mVoiceCb->stkCallSetup(toAidl(type), timeout); + voiceCb()->stkCallSetup(toAidl(type), timeout); return {}; } diff --git a/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp index 0a64c56be2..d233548233 100644 --- a/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp +++ b/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp @@ -29,265 +29,233 @@ namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio::voice; void RadioResponse::setResponseFunction(std::shared_ptr voiceCb) { - CHECK(voiceCb); mVoiceCb = voiceCb; } +std::shared_ptr RadioResponse::voiceCb() { + return mVoiceCb.get(); +} + Return RadioResponse::acceptCallResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->acceptCallResponse(toAidl(info)); + voiceCb()->acceptCallResponse(toAidl(info)); return {}; } Return RadioResponse::conferenceResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->conferenceResponse(toAidl(info)); + voiceCb()->conferenceResponse(toAidl(info)); return {}; } Return RadioResponse::dialResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->dialResponse(toAidl(info)); + voiceCb()->dialResponse(toAidl(info)); return {}; } Return RadioResponse::emergencyDialResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->emergencyDialResponse(toAidl(info)); + voiceCb()->emergencyDialResponse(toAidl(info)); return {}; } Return RadioResponse::exitEmergencyCallbackModeResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->exitEmergencyCallbackModeResponse(toAidl(info)); + voiceCb()->exitEmergencyCallbackModeResponse(toAidl(info)); return {}; } Return RadioResponse::explicitCallTransferResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->explicitCallTransferResponse(toAidl(info)); + voiceCb()->explicitCallTransferResponse(toAidl(info)); return {}; } Return RadioResponse::getCallForwardStatusResponse( const V1_0::RadioResponseInfo& info, const hidl_vec& callFwdInfos) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->getCallForwardStatusResponse(toAidl(info), toAidl(callFwdInfos)); + voiceCb()->getCallForwardStatusResponse(toAidl(info), toAidl(callFwdInfos)); return {}; } Return RadioResponse::getCallWaitingResponse(const V1_0::RadioResponseInfo& info, bool enable, int32_t serviceClass) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->getCallWaitingResponse(toAidl(info), enable, serviceClass); + voiceCb()->getCallWaitingResponse(toAidl(info), enable, serviceClass); return {}; } Return RadioResponse::getClipResponse(const V1_0::RadioResponseInfo& info, V1_0::ClipStatus status) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->getClipResponse(toAidl(info), aidl::ClipStatus(status)); + voiceCb()->getClipResponse(toAidl(info), aidl::ClipStatus(status)); return {}; } Return RadioResponse::getClirResponse(const V1_0::RadioResponseInfo& info, int32_t n, int32_t m) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->getClirResponse(toAidl(info), n, m); + voiceCb()->getClirResponse(toAidl(info), n, m); return {}; } Return RadioResponse::getCurrentCallsResponse(const V1_0::RadioResponseInfo& info, const hidl_vec& calls) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->getCurrentCallsResponse(toAidl(info), toAidl(calls)); + voiceCb()->getCurrentCallsResponse(toAidl(info), toAidl(calls)); return {}; } Return RadioResponse::getCurrentCallsResponse_1_2(const V1_0::RadioResponseInfo& info, const hidl_vec& calls) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->getCurrentCallsResponse(toAidl(info), toAidl(calls)); + voiceCb()->getCurrentCallsResponse(toAidl(info), toAidl(calls)); return {}; } Return RadioResponse::getCurrentCallsResponse_1_6(const V1_6::RadioResponseInfo& info, const hidl_vec& calls) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->getCurrentCallsResponse(toAidl(info), toAidl(calls)); + voiceCb()->getCurrentCallsResponse(toAidl(info), toAidl(calls)); return {}; } Return RadioResponse::getLastCallFailCauseResponse( const V1_0::RadioResponseInfo& info, const V1_0::LastCallFailCauseInfo& failCauseinfo) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->getLastCallFailCauseResponse(toAidl(info), toAidl(failCauseinfo)); + voiceCb()->getLastCallFailCauseResponse(toAidl(info), toAidl(failCauseinfo)); return {}; } Return RadioResponse::getMuteResponse(const V1_0::RadioResponseInfo& info, bool enable) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->getMuteResponse(toAidl(info), enable); + voiceCb()->getMuteResponse(toAidl(info), enable); return {}; } Return RadioResponse::getPreferredVoicePrivacyResponse(const V1_0::RadioResponseInfo& info, bool enable) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->getPreferredVoicePrivacyResponse(toAidl(info), enable); + voiceCb()->getPreferredVoicePrivacyResponse(toAidl(info), enable); return {}; } Return RadioResponse::getTTYModeResponse(const V1_0::RadioResponseInfo& info, V1_0::TtyMode mode) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->getTtyModeResponse(toAidl(info), aidl::TtyMode(mode)); + voiceCb()->getTtyModeResponse(toAidl(info), aidl::TtyMode(mode)); return {}; } Return RadioResponse::handleStkCallSetupRequestFromSimResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->handleStkCallSetupRequestFromSimResponse(toAidl(info)); + voiceCb()->handleStkCallSetupRequestFromSimResponse(toAidl(info)); return {}; } Return RadioResponse::hangupConnectionResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->hangupConnectionResponse(toAidl(info)); + voiceCb()->hangupConnectionResponse(toAidl(info)); return {}; } Return RadioResponse::hangupForegroundResumeBackgroundResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->hangupForegroundResumeBackgroundResponse(toAidl(info)); + voiceCb()->hangupForegroundResumeBackgroundResponse(toAidl(info)); return {}; } Return RadioResponse::hangupWaitingOrBackgroundResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->hangupWaitingOrBackgroundResponse(toAidl(info)); + voiceCb()->hangupWaitingOrBackgroundResponse(toAidl(info)); return {}; } Return RadioResponse::rejectCallResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->rejectCallResponse(toAidl(info)); + voiceCb()->rejectCallResponse(toAidl(info)); return {}; } Return RadioResponse::sendBurstDtmfResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->sendBurstDtmfResponse(toAidl(info)); + voiceCb()->sendBurstDtmfResponse(toAidl(info)); return {}; } Return RadioResponse::sendCDMAFeatureCodeResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->sendCdmaFeatureCodeResponse(toAidl(info)); + voiceCb()->sendCdmaFeatureCodeResponse(toAidl(info)); return {}; } Return RadioResponse::sendDtmfResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->sendDtmfResponse(toAidl(info)); + voiceCb()->sendDtmfResponse(toAidl(info)); return {}; } Return RadioResponse::separateConnectionResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->separateConnectionResponse(toAidl(info)); + voiceCb()->separateConnectionResponse(toAidl(info)); return {}; } Return RadioResponse::setCallForwardResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->setCallForwardResponse(toAidl(info)); + voiceCb()->setCallForwardResponse(toAidl(info)); return {}; } Return RadioResponse::setCallWaitingResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->setCallWaitingResponse(toAidl(info)); + voiceCb()->setCallWaitingResponse(toAidl(info)); return {}; } Return RadioResponse::setClirResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->setClirResponse(toAidl(info)); + voiceCb()->setClirResponse(toAidl(info)); return {}; } Return RadioResponse::setMuteResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->setMuteResponse(toAidl(info)); + voiceCb()->setMuteResponse(toAidl(info)); return {}; } Return RadioResponse::setPreferredVoicePrivacyResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->setPreferredVoicePrivacyResponse(toAidl(info)); + voiceCb()->setPreferredVoicePrivacyResponse(toAidl(info)); return {}; } Return RadioResponse::setTTYModeResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->setTtyModeResponse(toAidl(info)); + voiceCb()->setTtyModeResponse(toAidl(info)); return {}; } Return RadioResponse::startDtmfResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->startDtmfResponse(toAidl(info)); + voiceCb()->startDtmfResponse(toAidl(info)); return {}; } Return RadioResponse::stopDtmfResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->stopDtmfResponse(toAidl(info)); + voiceCb()->stopDtmfResponse(toAidl(info)); return {}; } Return RadioResponse::switchWaitingOrHoldingAndActiveResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; - CHECK_CB(mVoiceCb); - mVoiceCb->switchWaitingOrHoldingAndActiveResponse(toAidl(info)); + voiceCb()->switchWaitingOrHoldingAndActiveResponse(toAidl(info)); return {}; } diff --git a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp index 16c6b14632..d4c0c92e3a 100644 --- a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp +++ b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp @@ -30,6 +30,10 @@ using ::ndk::ScopedAStatus; namespace aidl = ::aidl::android::hardware::radio::voice; constexpr auto ok = &ScopedAStatus::ok; +std::shared_ptr RadioVoice::respond() { + return mRadioResponse->voiceCb(); +} + ScopedAStatus RadioVoice::acceptCall(int32_t serial) { LOG_CALL << serial; mHal1_5->acceptCall(serial); @@ -152,7 +156,7 @@ ScopedAStatus RadioVoice::hangupWaitingOrBackground(int32_t serial) { ScopedAStatus RadioVoice::isVoNrEnabled(int32_t serial) { LOG_CALL << serial; - // TODO(b/203699028): can't call isVoNrEnabledResponse with 1.6 callback + respond()->isVoNrEnabledResponse(notSupported(serial), false); return ok(); } @@ -245,7 +249,8 @@ ScopedAStatus RadioVoice::setTtyMode(int32_t serial, aidl::TtyMode mode) { ndk::ScopedAStatus RadioVoice::setVoNrEnabled(int32_t serial, [[maybe_unused]] bool enable) { LOG_CALL << serial; - // TODO(b/203699028): should set `persist.radio.is_vonr_enabled_` property instead + // Note: a workaround for older HALs could also be setting persist.radio.is_vonr_enabled_ + respond()->setVoNrEnabledResponse(notSupported(serial)); return ok(); } -- GitLab From 31f6fab3cc85b50f351fcdbe07f9be5efe92b186 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Wed, 15 Dec 2021 16:15:45 -0800 Subject: [PATCH 344/825] Use most recent available HAL methods. Bug: 207695009 Test: Build with ag/16322062 and a handful of patches from b/207695009, try to use telephony stack Change-Id: I7db1747550493a634290a968e3f5bbada66f322f --- .../compat/libradiocompat/data/RadioData.cpp | 6 +++- .../messaging/RadioMessaging.cpp | 24 ++++++++++++--- .../libradiocompat/network/RadioNetwork.cpp | 30 ++++++++++++++----- .../compat/libradiocompat/sim/RadioSim.cpp | 2 +- .../libradiocompat/voice/RadioVoice.cpp | 22 ++++++++++---- 5 files changed, 65 insertions(+), 19 deletions(-) diff --git a/radio/aidl/compat/libradiocompat/data/RadioData.cpp b/radio/aidl/compat/libradiocompat/data/RadioData.cpp index c819251831..91529c9af3 100644 --- a/radio/aidl/compat/libradiocompat/data/RadioData.cpp +++ b/radio/aidl/compat/libradiocompat/data/RadioData.cpp @@ -64,7 +64,11 @@ ScopedAStatus RadioData::deactivateDataCall(int32_t serial, int32_t cid, ScopedAStatus RadioData::getDataCallList(int32_t serial) { LOG_CALL << serial; - mHal1_5->getDataCallList(serial); + if (mHal1_6) { + mHal1_6->getDataCallList_1_6(serial); + } else { + mHal1_5->getDataCallList(serial); + } return ok(); } diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp index 79e7c01441..650d1910ff 100644 --- a/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp +++ b/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp @@ -104,13 +104,21 @@ ScopedAStatus RadioMessaging::responseAcknowledgement() { ScopedAStatus RadioMessaging::sendCdmaSms(int32_t serial, const aidl::CdmaSmsMessage& sms) { LOG_CALL << serial; - mHal1_5->sendCdmaSms(serial, toHidl(sms)); + if (mHal1_6) { + mHal1_6->sendCdmaSms_1_6(serial, toHidl(sms)); + } else { + mHal1_5->sendCdmaSms(serial, toHidl(sms)); + } return ok(); } ScopedAStatus RadioMessaging::sendCdmaSmsExpectMore(int32_t serial, const aidl::CdmaSmsMessage& m) { LOG_CALL << serial; - mHal1_5->sendCdmaSmsExpectMore(serial, toHidl(m)); + if (mHal1_6) { + mHal1_6->sendCdmaSmsExpectMore_1_6(serial, toHidl(m)); + } else { + mHal1_5->sendCdmaSmsExpectMore(serial, toHidl(m)); + } return ok(); } @@ -122,13 +130,21 @@ ScopedAStatus RadioMessaging::sendImsSms(int32_t serial, const aidl::ImsSmsMessa ScopedAStatus RadioMessaging::sendSms(int32_t serial, const aidl::GsmSmsMessage& message) { LOG_CALL << serial; - mHal1_5->sendSms(serial, toHidl(message)); + if (mHal1_6) { + mHal1_6->sendSms_1_6(serial, toHidl(message)); + } else { + mHal1_5->sendSms(serial, toHidl(message)); + } return ok(); } ScopedAStatus RadioMessaging::sendSmsExpectMore(int32_t serial, const aidl::GsmSmsMessage& msg) { LOG_CALL << serial; - mHal1_5->sendSMSExpectMore(serial, toHidl(msg)); + if (mHal1_6) { + mHal1_6->sendSmsExpectMore_1_6(serial, toHidl(msg)); + } else { + mHal1_5->sendSMSExpectMore(serial, toHidl(msg)); + } return ok(); } diff --git a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp index f6ed507690..8f3bc5b6af 100644 --- a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp +++ b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp @@ -73,13 +73,21 @@ ScopedAStatus RadioNetwork::getCdmaRoamingPreference(int32_t serial) { ScopedAStatus RadioNetwork::getCellInfoList(int32_t serial) { LOG_CALL << serial; - mHal1_5->getCellInfoList(serial); + if (mHal1_6) { + mHal1_6->getCellInfoList_1_6(serial); + } else { + mHal1_5->getCellInfoList(serial); + } return ok(); } ScopedAStatus RadioNetwork::getDataRegistrationState(int32_t serial) { LOG_CALL << serial; - mHal1_5->getDataRegistrationState(serial); + if (mHal1_6) { + mHal1_6->getDataRegistrationState_1_6(serial); + } else { + mHal1_5->getDataRegistrationState_1_5(serial); + } return ok(); } @@ -103,7 +111,11 @@ ScopedAStatus RadioNetwork::getOperator(int32_t serial) { ScopedAStatus RadioNetwork::getSignalStrength(int32_t serial) { LOG_CALL << serial; - mHal1_5->getSignalStrength(serial); + if (mHal1_6) { + mHal1_6->getSignalStrength_1_6(serial); + } else { + mHal1_5->getSignalStrength_1_4(serial); + } return ok(); } @@ -125,7 +137,11 @@ ScopedAStatus RadioNetwork::getVoiceRadioTechnology(int32_t serial) { ScopedAStatus RadioNetwork::getVoiceRegistrationState(int32_t serial) { LOG_CALL << serial; - mHal1_5->getVoiceRegistrationState(serial); + if (mHal1_6) { + mHal1_6->getVoiceRegistrationState_1_6(serial); + } else { + mHal1_5->getVoiceRegistrationState_1_5(serial); + } return ok(); } @@ -183,7 +199,7 @@ ScopedAStatus RadioNetwork::setCellInfoListRate(int32_t serial, int32_t rate) { ScopedAStatus RadioNetwork::setIndicationFilter(int32_t serial, aidl::IndicationFilter indFilter) { LOG_CALL << serial; - mHal1_5->setIndicationFilter(serial, toHidlBitfield(indFilter)); + mHal1_5->setIndicationFilter_1_5(serial, toHidlBitfield(indFilter)); return ok(); } @@ -192,9 +208,9 @@ ScopedAStatus RadioNetwork::setLinkCapacityReportingCriteria( // const std::vector& thrDownlinkKbps, const std::vector& thrUplinkKbps, AccessNetwork accessNetwork) { LOG_CALL << serial; - mHal1_5->setLinkCapacityReportingCriteria( // + mHal1_5->setLinkCapacityReportingCriteria_1_5( // serial, hysteresisMs, hysteresisDlKbps, hysteresisUlKbps, thrDownlinkKbps, - thrUplinkKbps, V1_2::AccessNetwork(accessNetwork)); + thrUplinkKbps, V1_5::AccessNetwork(accessNetwork)); return ok(); } diff --git a/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp b/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp index 5fecd8838b..e72ac7ee99 100644 --- a/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp +++ b/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp @@ -62,7 +62,7 @@ ScopedAStatus RadioSim::enableUiccApplications(int32_t serial, bool enable) { ScopedAStatus RadioSim::getAllowedCarriers(int32_t serial) { LOG_CALL << serial; - mHal1_5->getAllowedCarriers(serial); + mHal1_5->getAllowedCarriers_1_4(serial); return ok(); } diff --git a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp index d4c0c92e3a..742fdbe844 100644 --- a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp +++ b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp @@ -53,13 +53,19 @@ ScopedAStatus RadioVoice::dial(int32_t serial, const aidl::Dial& dialInfo) { } ScopedAStatus RadioVoice::emergencyDial( // - int32_t serial, const aidl::Dial& dialInfo, aidl::EmergencyServiceCategory categories, + int32_t serial, const aidl::Dial& info, aidl::EmergencyServiceCategory categories, const std::vector& urns, aidl::EmergencyCallRouting routing, - bool hasKnownUserIntentEmerg, bool isTesting) { + bool knownUserIntentEmerg, bool isTesting) { LOG_CALL << serial; - mHal1_5->emergencyDial(serial, toHidl(dialInfo), - toHidlBitfield(categories), toHidl(urns), - V1_4::EmergencyCallRouting(routing), hasKnownUserIntentEmerg, isTesting); + if (mHal1_6) { + mHal1_6->emergencyDial_1_6( // + serial, toHidl(info), toHidlBitfield(categories), + toHidl(urns), V1_4::EmergencyCallRouting(routing), knownUserIntentEmerg, isTesting); + } else { + mHal1_5->emergencyDial( // + serial, toHidl(info), toHidlBitfield(categories), + toHidl(urns), V1_4::EmergencyCallRouting(routing), knownUserIntentEmerg, isTesting); + } return ok(); } @@ -102,7 +108,11 @@ ScopedAStatus RadioVoice::getClir(int32_t serial) { ScopedAStatus RadioVoice::getCurrentCalls(int32_t serial) { LOG_CALL << serial; - mHal1_5->getCurrentCalls(serial); + if (mHal1_6) { + mHal1_6->getCurrentCalls_1_6(serial); + } else { + mHal1_5->getCurrentCalls(serial); + } return ok(); } -- GitLab From 8579f1d1cb3be617ad6ed0a527d6dea10dcb9041 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Thu, 16 Dec 2021 12:19:09 -0800 Subject: [PATCH 345/825] Set HAL response functions after framework sets all of theirs. Bug: 207695009 Test: Build with ag/16322062 and a handful of patches from b/207695009, try to use telephony stack Change-Id: I74afe105a22a24efa0c38de20c75beffc58b144f --- radio/aidl/compat/libradiocompat/Android.bp | 1 + .../compat/libradiocompat/CallbackManager.cpp | 84 +++++++++++++++++++ .../compat/libradiocompat/RadioCompatBase.cpp | 5 +- .../libradiocompat/config/RadioConfig.cpp | 2 +- .../compat/libradiocompat/data/RadioData.cpp | 16 ++-- .../include/libradiocompat/CallbackManager.h | 62 ++++++++++++++ .../include/libradiocompat/RadioCompatBase.h | 8 +- .../messaging/RadioMessaging.cpp | 16 ++-- .../libradiocompat/modem/RadioModem.cpp | 16 ++-- .../libradiocompat/network/RadioNetwork.cpp | 16 ++-- .../compat/libradiocompat/sim/RadioSim.cpp | 16 ++-- .../libradiocompat/voice/RadioVoice.cpp | 16 ++-- radio/aidl/compat/service/service.cpp | 29 +++---- 13 files changed, 195 insertions(+), 92 deletions(-) create mode 100644 radio/aidl/compat/libradiocompat/CallbackManager.cpp create mode 100644 radio/aidl/compat/libradiocompat/include/libradiocompat/CallbackManager.h diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp index 9d568c4aa0..487d91b6b9 100644 --- a/radio/aidl/compat/libradiocompat/Android.bp +++ b/radio/aidl/compat/libradiocompat/Android.bp @@ -55,6 +55,7 @@ cc_library { "libutils", ], srcs: [ + "CallbackManager.cpp", "DriverContext.cpp", "RadioCompatBase.cpp", "RadioIndication.cpp", diff --git a/radio/aidl/compat/libradiocompat/CallbackManager.cpp b/radio/aidl/compat/libradiocompat/CallbackManager.cpp new file mode 100644 index 0000000000..c2eaed1959 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/CallbackManager.cpp @@ -0,0 +1,84 @@ +/* + * 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 + +#include + +using namespace std::literals::chrono_literals; + +namespace android::hardware::radio::compat { + +/** + * How much setter thread will wait with setting response functions after the last + * setResponseFunctions call from the framework. Subsequent calls from the framework reset the + * clock, so this number should be larger than the longest time between setResponseFunctions calls + * from the framework. + * + * Real world measurements with Cuttlefish give <10ms delay between Modem and Data and <2ms delays + * between all others. + */ +static constexpr auto kDelayedSetterDelay = 100ms; + +CallbackManager::CallbackManager(std::shared_ptr context, sp hidlHal) + : mHidlHal(hidlHal), + mRadioResponse(sp::make(context)), + mRadioIndication(sp::make(context)), + mDelayedSetterThread(&CallbackManager::delayedSetterThread, this) {} + +CallbackManager::~CallbackManager() { + { + std::unique_lock lock(mDelayedSetterGuard); + mDelayedSetterDeadline = std::nullopt; + mDestroy = true; + mDelayedSetterCv.notify_all(); + } + mDelayedSetterThread.join(); +} + +RadioResponse& CallbackManager::response() const { + return *mRadioResponse; +} + +void CallbackManager::setResponseFunctionsDelayed() { + std::unique_lock lock(mDelayedSetterGuard); + mDelayedSetterDeadline = std::chrono::steady_clock::now() + kDelayedSetterDelay; + mDelayedSetterCv.notify_all(); +} + +void CallbackManager::delayedSetterThread() { + while (!mDestroy) { + std::unique_lock lock(mDelayedSetterGuard); + auto deadline = mDelayedSetterDeadline; + + // not waiting to set response functions + if (!deadline) { + mDelayedSetterCv.wait(lock); + continue; + } + + // waiting to set response functions, but not yet + if (*deadline > std::chrono::steady_clock::now()) { + mDelayedSetterCv.wait_until(lock, *deadline); + continue; + } + + mHidlHal->setResponseFunctions(mRadioResponse, mRadioIndication).assertOk(); + mDelayedSetterDeadline = std::nullopt; + } +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp b/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp index 2364484f13..2a2d7a36e9 100644 --- a/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp +++ b/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp @@ -21,11 +21,10 @@ namespace android::hardware::radio::compat { RadioCompatBase::RadioCompatBase(std::shared_ptr context, sp hidlHal, - sp radioResponse, sp radioInd) + std::shared_ptr cbMgr) : mContext(context), mHal1_5(hidlHal), mHal1_6(V1_6::IRadio::castFrom(hidlHal)), - mRadioResponse(radioResponse), - mRadioIndication(radioInd) {} + mCallbackManager(cbMgr) {} } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp index d6399bfddf..5b22dbe6ca 100644 --- a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp +++ b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp @@ -88,7 +88,7 @@ ScopedAStatus RadioConfig::setResponseFunctions( mRadioConfigResponse->setResponseFunction(radioConfigResponse); mRadioConfigIndication->setResponseFunction(radioConfigIndication); - mHal1_1->setResponseFunctions(mRadioConfigResponse, mRadioConfigIndication); + mHal1_1->setResponseFunctions(mRadioConfigResponse, mRadioConfigIndication).assertOk(); return ok(); } diff --git a/radio/aidl/compat/libradiocompat/data/RadioData.cpp b/radio/aidl/compat/libradiocompat/data/RadioData.cpp index 91529c9af3..d2f368778f 100644 --- a/radio/aidl/compat/libradiocompat/data/RadioData.cpp +++ b/radio/aidl/compat/libradiocompat/data/RadioData.cpp @@ -32,7 +32,7 @@ namespace aidlCommon = ::aidl::android::hardware::radio; constexpr auto ok = &ScopedAStatus::ok; std::shared_ptr RadioData::respond() { - return mRadioResponse->dataCb(); + return mCallbackManager->response().dataCb(); } ScopedAStatus RadioData::allocatePduSessionId(int32_t serial) { @@ -129,16 +129,10 @@ ScopedAStatus RadioData::setInitialAttachApn(int32_t serial, const aidl::DataPro } ScopedAStatus RadioData::setResponseFunctions( - const std::shared_ptr& dataResponse, - const std::shared_ptr& dataIndication) { - LOG_CALL << dataResponse << ' ' << dataIndication; - - CHECK(dataResponse); - CHECK(dataIndication); - - mRadioResponse->setResponseFunction(dataResponse); - mRadioIndication->setResponseFunction(dataIndication); - + const std::shared_ptr& response, + const std::shared_ptr& indication) { + LOG_CALL << response << ' ' << indication; + mCallbackManager->setResponseFunctions(response, indication); return ok(); } diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/CallbackManager.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/CallbackManager.h new file mode 100644 index 0000000000..f1a7b49c7a --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/CallbackManager.h @@ -0,0 +1,62 @@ +/* + * 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 "DriverContext.h" +#include "RadioIndication.h" +#include "RadioResponse.h" + +#include +#include + +#include + +namespace android::hardware::radio::compat { + +class CallbackManager { + sp mHidlHal; + sp mRadioResponse; + sp mRadioIndication; + + std::thread mDelayedSetterThread; + std::mutex mDelayedSetterGuard; + std::optional> mDelayedSetterDeadline + GUARDED_BY(mDelayedSetterGuard); + std::condition_variable mDelayedSetterCv GUARDED_BY(mDelayedSetterGuard); + bool mDestroy GUARDED_BY(mDelayedSetterGuard) = false; + + void setResponseFunctionsDelayed(); + void delayedSetterThread(); + + public: + CallbackManager(std::shared_ptr context, sp hidlHal); + ~CallbackManager(); + + RadioResponse& response() const; + + template + void setResponseFunctions(const std::shared_ptr& response, + const std::shared_ptr& indication) { + CHECK(response); + CHECK(indication); + + mRadioResponse->setResponseFunction(response); + mRadioIndication->setResponseFunction(indication); + setResponseFunctionsDelayed(); + } +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h index cd17541f69..eb22fff25d 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h @@ -15,9 +15,8 @@ */ #pragma once +#include "CallbackManager.h" #include "DriverContext.h" -#include "RadioIndication.h" -#include "RadioResponse.h" #include @@ -30,12 +29,11 @@ class RadioCompatBase { sp mHal1_5; sp mHal1_6; - sp mRadioResponse; - sp mRadioIndication; + std::shared_ptr mCallbackManager; public: RadioCompatBase(std::shared_ptr context, sp hidlHal, - sp radioResponse, sp radioIndication); + std::shared_ptr cbMgr); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp index 650d1910ff..4d94e17e99 100644 --- a/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp +++ b/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp @@ -30,7 +30,7 @@ namespace aidl = ::aidl::android::hardware::radio::messaging; constexpr auto ok = &ScopedAStatus::ok; std::shared_ptr RadioMessaging::respond() { - return mRadioResponse->messagingCb(); + return mCallbackManager->response().messagingCb(); } ScopedAStatus RadioMessaging::acknowledgeIncomingGsmSmsWithPdu( // @@ -181,16 +181,10 @@ ScopedAStatus RadioMessaging::setGsmBroadcastConfig( } ScopedAStatus RadioMessaging::setResponseFunctions( - const std::shared_ptr& messagingResponse, - const std::shared_ptr& messagingIndication) { - LOG_CALL << messagingResponse << ' ' << messagingIndication; - - CHECK(messagingResponse); - CHECK(messagingIndication); - - mRadioResponse->setResponseFunction(messagingResponse); - mRadioIndication->setResponseFunction(messagingIndication); - + const std::shared_ptr& response, + const std::shared_ptr& indication) { + LOG_CALL << response << ' ' << indication; + mCallbackManager->setResponseFunctions(response, indication); return ok(); } diff --git a/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp b/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp index 3fff5ee317..d28b94041b 100644 --- a/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp +++ b/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp @@ -28,7 +28,7 @@ namespace aidl = ::aidl::android::hardware::radio::modem; constexpr auto ok = &ScopedAStatus::ok; std::shared_ptr RadioModem::respond() { - return mRadioResponse->modemCb(); + return mCallbackManager->response().modemCb(); } ScopedAStatus RadioModem::enableModem(int32_t serial, bool on) { @@ -133,16 +133,10 @@ ScopedAStatus RadioModem::setRadioPower(int32_t serial, bool powerOn, bool forEm } ScopedAStatus RadioModem::setResponseFunctions( - const std::shared_ptr& modemResponse, - const std::shared_ptr& modemIndication) { - LOG_CALL << modemResponse << ' ' << modemIndication; - - CHECK(modemResponse); - CHECK(modemIndication); - - mRadioResponse->setResponseFunction(modemResponse); - mRadioIndication->setResponseFunction(modemIndication); - + const std::shared_ptr& response, + const std::shared_ptr& indication) { + LOG_CALL << response << ' ' << indication; + mCallbackManager->setResponseFunctions(response, indication); return ok(); } diff --git a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp index 8f3bc5b6af..8bfa0bbbb2 100644 --- a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp +++ b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp @@ -34,7 +34,7 @@ namespace aidl = ::aidl::android::hardware::radio::network; constexpr auto ok = &ScopedAStatus::ok; std::shared_ptr RadioNetwork::respond() { - return mRadioResponse->networkCb(); + return mCallbackManager->response().networkCb(); } ScopedAStatus RadioNetwork::getAllowedNetworkTypesBitmap(int32_t serial) { @@ -245,16 +245,10 @@ ScopedAStatus RadioNetwork::setNrDualConnectivityState(int32_t serial, } ScopedAStatus RadioNetwork::setResponseFunctions( - const std::shared_ptr& networkResponse, - const std::shared_ptr& networkIndication) { - LOG_CALL << networkResponse << ' ' << networkIndication; - - CHECK(networkResponse); - CHECK(networkIndication); - - mRadioResponse->setResponseFunction(networkResponse); - mRadioIndication->setResponseFunction(networkIndication); - + const std::shared_ptr& response, + const std::shared_ptr& indication) { + LOG_CALL << response << ' ' << indication; + mCallbackManager->setResponseFunctions(response, indication); return ok(); } diff --git a/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp b/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp index e72ac7ee99..b43f64f784 100644 --- a/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp +++ b/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp @@ -31,7 +31,7 @@ namespace aidl = ::aidl::android::hardware::radio::sim; constexpr auto ok = &ScopedAStatus::ok; std::shared_ptr RadioSim::respond() { - return mRadioResponse->simCb(); + return mCallbackManager->response().simCb(); } ScopedAStatus RadioSim::areUiccApplicationsEnabled(int32_t serial) { @@ -221,16 +221,10 @@ ScopedAStatus RadioSim::setFacilityLockForApp( // } ScopedAStatus RadioSim::setResponseFunctions( - const std::shared_ptr& simResponse, - const std::shared_ptr& simIndication) { - LOG_CALL << simResponse << ' ' << simIndication; - - CHECK(simResponse); - CHECK(simIndication); - - mRadioResponse->setResponseFunction(simResponse); - mRadioIndication->setResponseFunction(simIndication); - + const std::shared_ptr& response, + const std::shared_ptr& indication) { + LOG_CALL << response << ' ' << indication; + mCallbackManager->setResponseFunctions(response, indication); return ok(); } diff --git a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp index 742fdbe844..7b1d1fa01e 100644 --- a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp +++ b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp @@ -31,7 +31,7 @@ namespace aidl = ::aidl::android::hardware::radio::voice; constexpr auto ok = &ScopedAStatus::ok; std::shared_ptr RadioVoice::respond() { - return mRadioResponse->voiceCb(); + return mCallbackManager->response().voiceCb(); } ScopedAStatus RadioVoice::acceptCall(int32_t serial) { @@ -238,16 +238,10 @@ ScopedAStatus RadioVoice::setPreferredVoicePrivacy(int32_t serial, bool enable) } ScopedAStatus RadioVoice::setResponseFunctions( - const std::shared_ptr& voiceResponse, - const std::shared_ptr& voiceIndication) { - LOG_CALL << voiceResponse << ' ' << voiceIndication; - - CHECK(voiceResponse); - CHECK(voiceIndication); - - mRadioResponse->setResponseFunction(voiceResponse); - mRadioIndication->setResponseFunction(voiceIndication); - + const std::shared_ptr& response, + const std::shared_ptr& indication) { + LOG_CALL << response << ' ' << indication; + mCallbackManager->setResponseFunctions(response, indication); return ok(); } diff --git a/radio/aidl/compat/service/service.cpp b/radio/aidl/compat/service/service.cpp index 6bcd4b0c61..7433feef17 100644 --- a/radio/aidl/compat/service/service.cpp +++ b/radio/aidl/compat/service/service.cpp @@ -19,13 +19,12 @@ #include #include #include +#include #include #include -#include #include #include #include -#include #include #include @@ -36,9 +35,8 @@ using namespace std::string_literals; static std::vector> gPublishedHals; template -static void publishRadioHal(std::shared_ptr context, - sp hidlHal, sp responseCb, - sp indicationCb, const std::string& slot) { +static void publishRadioHal(std::shared_ptr ctx, sp hidlHal, + std::shared_ptr cm, const std::string& slot) { const auto instance = T::descriptor + "/"s + slot; if (!AServiceManager_isDeclared(instance.c_str())) { LOG(INFO) << instance << " is not declared in VINTF (this may be intentional)"; @@ -46,7 +44,7 @@ static void publishRadioHal(std::shared_ptr context, } LOG(DEBUG) << "Publishing " << instance; - auto aidlHal = ndk::SharedRefBase::make(context, hidlHal, responseCb, indicationCb); + auto aidlHal = ndk::SharedRefBase::make(ctx, hidlHal, cm); gPublishedHals.push_back(aidlHal); const auto status = AServiceManager_addService(aidlHal->asBinder().get(), instance.c_str()); CHECK_EQ(status, STATUS_OK); @@ -59,17 +57,14 @@ static void publishRadio(std::string slot) { hidl_utils::linkDeathToDeath(radioHidl); auto context = std::make_shared(); - - auto responseCb = sp::make(context); - auto indicationCb = sp::make(context); - radioHidl->setResponseFunctions(responseCb, indicationCb).assertOk(); - - publishRadioHal(context, radioHidl, responseCb, indicationCb, slot); - publishRadioHal(context, radioHidl, responseCb, indicationCb, slot); - publishRadioHal(context, radioHidl, responseCb, indicationCb, slot); - publishRadioHal(context, radioHidl, responseCb, indicationCb, slot); - publishRadioHal(context, radioHidl, responseCb, indicationCb, slot); - publishRadioHal(context, radioHidl, responseCb, indicationCb, slot); + auto callbackMgr = std::make_shared(context, radioHidl); + + publishRadioHal(context, radioHidl, callbackMgr, slot); + publishRadioHal(context, radioHidl, callbackMgr, slot); + publishRadioHal(context, radioHidl, callbackMgr, slot); + publishRadioHal(context, radioHidl, callbackMgr, slot); + publishRadioHal(context, radioHidl, callbackMgr, slot); + publishRadioHal(context, radioHidl, callbackMgr, slot); } static void publishRadioConfig() { -- GitLab From 7eda78274cf45eca3eaaa470cfe749710e4312dc Mon Sep 17 00:00:00 2001 From: Hongguang Date: Mon, 20 Dec 2021 14:48:14 -0800 Subject: [PATCH 346/825] Support DVB-T Cell Ids. Bug: 210358443 Test: atest VtsHalTvTunerTargetTest Change-Id: I36a61a78e919c036cde5ea24634eed28d7eb4e5d --- .../hardware/tv/tuner/FrontendScanMessage.aidl | 1 + .../hardware/tv/tuner/FrontendScanMessageType.aidl | 1 + .../android/hardware/tv/tuner/FrontendStatus.aidl | 1 + .../hardware/tv/tuner/FrontendStatusType.aidl | 1 + .../hardware/tv/tuner/FrontendScanMessage.aidl | 6 ++++++ .../hardware/tv/tuner/FrontendScanMessageType.aidl | 6 ++++++ .../android/hardware/tv/tuner/FrontendStatus.aidl | 6 ++++++ .../hardware/tv/tuner/FrontendStatusType.aidl | 5 +++++ tv/tuner/aidl/default/Frontend.cpp | 12 ++++++++++++ tv/tuner/aidl/default/Tuner.cpp | 1 + tv/tuner/aidl/vts/functional/FrontendTests.cpp | 7 +++++++ 11 files changed, 47 insertions(+) diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl index 2c6cc00edb..e763cfb617 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl @@ -50,4 +50,5 @@ union FrontendScanMessage { android.hardware.tv.tuner.FrontendModulation modulation; android.hardware.tv.tuner.FrontendDvbcAnnex annex; boolean isHighPriority; + int[] dvbtCellIds; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl index b121c8513a..6976ecd8d0 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl @@ -50,4 +50,5 @@ enum FrontendScanMessageType { MODULATION = 12, DVBC_ANNEX = 13, HIGH_PRIORITY = 14, + DVBT_CELL_IDS = 15, } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl index c79b7517fe..fc0efc92be 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl @@ -75,4 +75,5 @@ union FrontendStatus { android.hardware.tv.tuner.FrontendIsdbtMode isdbtMode; android.hardware.tv.tuner.FrontendIsdbtPartialReceptionFlag partialReceptionFlag; int[] streamIdList; + int[] dvbtCellIds; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl index 9ea3200d35..2cc62d533e 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl @@ -75,4 +75,5 @@ enum FrontendStatusType { ISDBT_MODE = 37, ISDBT_PARTIAL_RECEPTION_FLAG = 38, STREAM_ID_LIST = 39, + DVBT_CELL_IDS = 40, } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl index 19c6766235..a94106686a 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl @@ -70,4 +70,10 @@ union FrontendScanMessage { FrontendDvbcAnnex annex; boolean isHighPriority; + + /** + * DVB-T Cell Ids. + */ + int[] dvbtCellIds; + } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl index 2b91216f6e..f4d2ee021b 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl @@ -86,4 +86,10 @@ enum FrontendScanMessageType { DVBC_ANNEX, HIGH_PRIORITY, + + /** + * DVB-T CELL ID. + */ + DVBT_CELL_IDS, + } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl index 6e6f315d38..ae6e46fa29 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl @@ -236,4 +236,10 @@ union FrontendStatus { */ int[] streamIdList; + /** + * DVB-T Cell Id. + */ + int[] dvbtCellIds; + + } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl index 7feb72d742..e7da51767a 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl @@ -223,4 +223,9 @@ enum FrontendStatusType { * Stream ID list included in a transponder. */ STREAM_ID_LIST, + + /** + * DVB-T Cell Id. + */ + DVBT_CELL_IDS, } diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index a4dde2a721..c1b8b5da05 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -237,6 +237,13 @@ Frontend::~Frontend() {} mCallback->onScanMessage(FrontendScanMessageType::HIGH_PRIORITY, msg); } + if (mType == FrontendType::DVBT) { + FrontendScanMessage msg; + vector dvbtCellIds = {0, 1}; + msg.set(dvbtCellIds); + mCallback->onScanMessage(FrontendScanMessageType::DVBT_CELL_IDS, msg); + } + { FrontendScanMessage msg; msg.set(true); @@ -681,6 +688,11 @@ Frontend::~Frontend() {} status.set(streamIds); break; } + case FrontendStatusType::DVBT_CELL_IDS: { + vector dvbtCellIds = {0, 1}; + status.set(dvbtCellIds); + break; + } default: { continue; } diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp index 96e83bbf65..9e81177ce0 100644 --- a/tv/tuner/aidl/default/Tuner.cpp +++ b/tv/tuner/aidl/default/Tuner.cpp @@ -112,6 +112,7 @@ void Tuner::init() { FrontendStatusType::GUARD_INTERVAL, FrontendStatusType::TRANSMISSION_MODE, FrontendStatusType::T2_SYSTEM_ID, + FrontendStatusType::DVBT_CELL_IDS, }; mFrontendStatusCaps[4] = statusCaps; diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp index 42d20f7997..f24dea14da 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp +++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp @@ -405,6 +405,13 @@ void FrontendTests::verifyFrontendStatus(vector statusTypes, expectStatuses[i].get().begin())); break; } + case FrontendStatusType::DVBT_CELL_IDS: { + ASSERT_TRUE(std::equal( + realStatuses[i].get().begin(), + realStatuses[i].get().end(), + expectStatuses[i].get().begin())); + break; + } default: { continue; } -- GitLab From 72c5b503e55d1ccf235891fd72da9d16d17acc94 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Fri, 10 Dec 2021 17:23:39 -0800 Subject: [PATCH 347/825] composer: pass expetcedPresentTime Add expectedPresentTime as an optional field to DisplayCommand. Test: VTS Bug: 198186194 Change-Id: I1203422b5d052508ca42a80da5d252c106efc5ee --- .../composer3/ClockMonotonicTimestamp.aidl | 38 ++++++ .../graphics/composer3/DisplayCommand.aidl | 1 + .../composer3/ClockMonotonicTimestamp.aidl | 25 ++++ .../graphics/composer3/DisplayCommand.aidl | 9 ++ .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 34 ++--- .../VtsHalGraphicsComposer3_TargetTest.cpp | 123 ++++++++++++++++-- .../graphics/composer3/ComposerClientWriter.h | 16 ++- 7 files changed, 215 insertions(+), 31 deletions(-) create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl new file mode 100644 index 0000000000..856ec64218 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClockMonotonicTimestamp.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 -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 ClockMonotonicTimestamp { + long timestamp; +} 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 2f5d00f698..35a1eed0bb 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 @@ -39,6 +39,7 @@ parcelable DisplayCommand { @nullable android.hardware.graphics.composer3.ColorTransformPayload colorTransform; @nullable android.hardware.graphics.composer3.ClientTarget clientTarget; @nullable android.hardware.graphics.composer3.Buffer virtualDisplayOutputBuffer; + @nullable android.hardware.graphics.composer3.ClockMonotonicTimestamp expectedPresentTime; boolean validateDisplay; boolean acceptDisplayChanges; boolean presentDisplay; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl new file mode 100644 index 0000000000..f38503818d --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl @@ -0,0 +1,25 @@ +/** + * 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. + */ + +package android.hardware.graphics.composer3; + +/** + * Represents a nanoseconds timestamp in CLOCK_MONOTONIC. + */ +@VintfStability +parcelable ClockMonotonicTimestamp { + long timestamp; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl index 21497c43ed..fdaf35a146 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl @@ -18,6 +18,7 @@ package android.hardware.graphics.composer3; import android.hardware.graphics.composer3.Buffer; import android.hardware.graphics.composer3.ClientTarget; +import android.hardware.graphics.composer3.ClockMonotonicTimestamp; import android.hardware.graphics.composer3.ColorTransformPayload; import android.hardware.graphics.composer3.LayerCommand; @@ -114,6 +115,14 @@ parcelable DisplayCommand { */ @nullable Buffer virtualDisplayOutputBuffer; + /** + * Sets the expected present time to present the current content on screen. + * The implementation should try to present the display as close as possible + * to the given expectedPresentTime. If expectedPresentTime is 0, the + * implementation should present the display as soon as possible. + */ + @nullable ClockMonotonicTimestamp expectedPresentTime; + /** * Instructs the device to inspect all of the layer state and determine if * there are any composition type changes necessary before presenting the diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 34dea9ecc2..eddc2d3271 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -258,7 +258,7 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); // if hwc cannot handle and asks for composition change, // just succeed the test @@ -317,7 +317,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector changedCompositionLayers; @@ -377,7 +377,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector changedCompositionLayers; @@ -492,7 +492,7 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector changedCompositionLayers; @@ -606,7 +606,7 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { clientLayer->setDisplayFrame(clientFrame); clientLayer->setZOrder(0); clientLayer->write(mWriter); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector changedCompositionLayers; @@ -685,7 +685,7 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector changedCompositionLayers; std::vector changedCompositionTypes; @@ -715,7 +715,7 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, @@ -756,7 +756,7 @@ TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector changedCompositionLayers; std::vector changedCompositionTypes; @@ -819,7 +819,7 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector changedCompositionLayers; std::vector changedCompositionTypes; @@ -877,7 +877,7 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector changedCompositionLayers; std::vector changedCompositionTypes; @@ -902,7 +902,7 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, &changedCompositionTypes); @@ -1027,7 +1027,7 @@ TEST_P(GraphicsBlendModeCompositionTest, None) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector changedCompositionLayers; std::vector changedCompositionTypes; @@ -1072,7 +1072,7 @@ TEST_P(GraphicsBlendModeCompositionTest, Coverage) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector changedCompositionLayers; std::vector changedCompositionTypes; @@ -1112,7 +1112,7 @@ TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector changedCompositionLayers; std::vector changedCompositionTypes; @@ -1195,7 +1195,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector changedCompositionLayers; std::vector changedCompositionTypes; @@ -1241,7 +1241,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) { writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector changedCompositionLayers; std::vector changedCompositionTypes; @@ -1287,7 +1287,7 @@ TEST_P(GraphicsTransformCompositionTest, ROT_180) { writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector layers; std::vector types; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 1f30475737..19b1fb202f 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -993,14 +994,14 @@ TEST_P(GraphicsComposerAidlTest, SetActiveConfigPowerCycle) { TEST_P(GraphicsComposerAidlTest, SetPowerModeUnsupported) { std::vector capabilities; - const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); + auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); ASSERT_TRUE(error.isOk()); const bool isDozeSupported = std::find(capabilities.begin(), capabilities.end(), DisplayCapability::DOZE) != capabilities.end(); const bool isSuspendSupported = std::find(capabilities.begin(), capabilities.end(), DisplayCapability::SUSPEND) != capabilities.end(); if (!isDozeSupported) { - auto error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE); + error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE); EXPECT_FALSE(error.isOk()); EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); @@ -1010,7 +1011,7 @@ TEST_P(GraphicsComposerAidlTest, SetPowerModeUnsupported) { } if (!isSuspendSupported) { - auto error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON_SUSPEND); + error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON_SUSPEND); EXPECT_FALSE(error.isOk()); EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); @@ -1283,7 +1284,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { mWriter.setLayerBuffer(display.get(), layer, 0, buffer->handle, -1); mWriter.setLayerDataspace(display.get(), layer, common::Dataspace::UNKNOWN); - mWriter.validateDisplay(display.get()); + mWriter.validateDisplay(display.get(), ComposerClientWriter::kNoTimestamp); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -1299,7 +1300,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { mWriter.setLayerBuffer(display.get(), layer, 0, buffer->handle, -1); mWriter.setLayerSurfaceDamage(display.get(), layer, std::vector(1, {0, 0, 10, 10})); - mWriter.validateDisplay(display.get()); + mWriter.validateDisplay(display.get(), ComposerClientWriter::kNoTimestamp); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -1310,6 +1311,53 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { ASSERT_NO_FATAL_FAILURE(destroyLayer(display, layer)); } + sp<::android::Fence> presentAndGetFence( + std::optional expectedPresentTime) { + mWriter.validateDisplay(mPrimaryDisplay, expectedPresentTime); + execute(); + EXPECT_TRUE(mReader.takeErrors().empty()); + + mWriter.presentDisplay(mPrimaryDisplay); + execute(); + EXPECT_TRUE(mReader.takeErrors().empty()); + + int presentFence; + mReader.takePresentFence(mPrimaryDisplay, &presentFence); + EXPECT_NE(-1, presentFence); + return sp<::android::Fence>::make(presentFence); + } + + int32_t getVsyncPeriod() { + int32_t activeConfig; + EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &activeConfig).isOk()); + + int32_t vsyncPeriod; + EXPECT_TRUE(mComposerClient + ->getDisplayAttribute(mPrimaryDisplay, activeConfig, + DisplayAttribute::VSYNC_PERIOD, &vsyncPeriod) + .isOk()); + return vsyncPeriod; + } + + int64_t createOnScreenLayer() { + const int64_t layer = createLayer(mDisplays[0]); + mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::DEVICE); + mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, {0, 0, mDisplayWidth, mDisplayHeight}); + mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1); + mWriter.setLayerSourceCrop( + mPrimaryDisplay, layer, + {0, 0, static_cast(mDisplayWidth), static_cast(mDisplayHeight)}); + mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast(0)); + mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, + std::vector(1, {0, 0, mDisplayWidth, mDisplayHeight})); + mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10); + mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE); + mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, + std::vector(1, {0, 0, mDisplayWidth, mDisplayHeight})); + mWriter.setLayerDataspace(mPrimaryDisplay, layer, common::Dataspace::UNKNOWN); + return layer; + } + void Test_setActiveConfigWithConstraints(const TestParameters& params) { for (VtsDisplay& display : mDisplays) { forEachTwoConfigs(display.get(), [&](int32_t config1, int32_t config2) { @@ -1400,6 +1448,47 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { } } + void Test_expectedPresentTime(std::optional framesDelay) { + ASSERT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk()); + + const auto vsyncPeriod = getVsyncPeriod(); + + const auto buffer1 = allocate(); + const auto buffer2 = allocate(); + ASSERT_NE(nullptr, buffer1); + ASSERT_NE(nullptr, buffer2); + + const auto layer = createOnScreenLayer(); + mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, buffer1->handle, -1); + const sp<::android::Fence> presentFence1 = + presentAndGetFence(ComposerClientWriter::kNoTimestamp); + presentFence1->waitForever(LOG_TAG); + + auto expectedPresentTime = presentFence1->getSignalTime() + vsyncPeriod; + if (framesDelay.has_value()) { + expectedPresentTime += *framesDelay * vsyncPeriod; + } + + mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, buffer2->handle, -1); + const auto setExpectedPresentTime = [&]() -> std::optional { + if (!framesDelay.has_value()) { + return ComposerClientWriter::kNoTimestamp; + } else if (*framesDelay == 0) { + return ClockMonotonicTimestamp{0}; + } + return ClockMonotonicTimestamp{expectedPresentTime}; + }(); + + const sp<::android::Fence> presentFence2 = presentAndGetFence(setExpectedPresentTime); + presentFence2->waitForever(LOG_TAG); + + const auto actualPresentTime = presentFence2->getSignalTime(); + const auto presentError = std::abs(expectedPresentTime - actualPresentTime); + EXPECT_LE(presentError, vsyncPeriod / 2); + + ASSERT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk()); + } + // clang-format off const std::array kIdentity = {{ 1.0f, 0.0f, 0.0f, 0.0f, @@ -1462,19 +1551,19 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_OUTPUT_BUFFER) { } TEST_P(GraphicsComposerAidlCommandTest, VALIDATE_DISPLAY) { - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); } TEST_P(GraphicsComposerAidlCommandTest, ACCEPT_DISPLAY_CHANGES) { - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); mWriter.acceptDisplayChanges(mPrimaryDisplay); execute(); } // TODO(b/208441745) fix the test failure TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY) { - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); mWriter.presentDisplay(mPrimaryDisplay); execute(); } @@ -1523,7 +1612,7 @@ TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle, -1); mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector layers; std::vector types; @@ -1570,7 +1659,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_CURSOR_POSITION) { mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE); mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector(1, displayFrame)); mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); std::vector layers; @@ -1587,7 +1676,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_CURSOR_POSITION) { execute(); mWriter.setLayerCursorPosition(mPrimaryDisplay, layer, 0, 0); - mWriter.validateDisplay(mPrimaryDisplay); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); mWriter.presentDisplay(mPrimaryDisplay); execute(); } @@ -1947,6 +2036,18 @@ TEST_P(GraphicsComposerAidlCommandTest, setActiveConfigWithConstraints_SeamlessN } } +TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_NoTimestamp) { + ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(std::nullopt)); +} + +TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_0) { + ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(0)); +} + +TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_5) { + ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(5)); +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest); INSTANTIATE_TEST_SUITE_P( PerInstance, GraphicsComposerAidlCommandTest, 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 bd0367394a..dc15ea08f4 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -63,6 +63,8 @@ namespace aidl::android::hardware::graphics::composer3 { class ComposerClientWriter { public: + static constexpr std::optional kNoTimestamp = std::nullopt; + ComposerClientWriter() { reset(); } virtual ~ComposerClientWriter() { reset(); } @@ -95,10 +97,18 @@ class ComposerClientWriter { getBuffer(slot, buffer, releaseFence)); } - void validateDisplay(int64_t display) { getDisplayCommand(display).validateDisplay = true; } + void validateDisplay(int64_t display, + std::optional expectedPresentTime) { + auto& command = getDisplayCommand(display); + command.expectedPresentTime = expectedPresentTime; + command.validateDisplay = true; + } - void presentOrvalidateDisplay(int64_t display) { - getDisplayCommand(display).presentOrValidateDisplay = true; + void presentOrvalidateDisplay(int64_t display, + std::optional expectedPresentTime) { + auto& command = getDisplayCommand(display); + command.expectedPresentTime = expectedPresentTime; + command.presentOrValidateDisplay = true; } void acceptDisplayChanges(int64_t display) { -- GitLab From 64803940e6fcb1117200bc5a9f73982ffc311960 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Mon, 20 Dec 2021 23:04:11 -0500 Subject: [PATCH 348/825] Update documentation for DISPLAY_DECORATION After some discussion, we've decided to always set the ScreenDecorations to DISPLAY_DECORATION. HWC can decide, based on the format, whether to truly treat it as DISPLAY_DECORATION, or to change to DEVICE composition. Update the documentation to reflect this change. See also I1da3199bacf5877e88876249c60c0a33fcd44c1e. Bug: 193170859 Test: NA Change-Id: I1fae74b360d1b9d79fc4afeab6f71089d4c8b7e5 --- .../hardware/graphics/composer3/Composition.aidl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl index 4947463ba9..49cdffcf20 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl @@ -74,16 +74,20 @@ enum Composition { */ SIDEBAND = 5, /** - * A display decoration layer contains a buffer which is an 8 bit - * alpha mask. Pixels in the mask with an alpha of 0 (transparent) will - * show the content underneath, and pixels with an alpha of 255 will be - * be rendered in black. An alpha in between will show the content - * blended with black. This is useful, for example, to provide + * A display decoration layer contains a buffer which is used to provide * anti-aliasing on the cutout region/rounded corners on the top and * bottom of a display. * + * Pixels in the buffer with an alpha of 0 (transparent) will show the + * content underneath, and pixels with an alpha of 255 will be rendered in + * black. An alpha in between will show the underlying content blended with + * black. + * + * Some devices may support this flag with a buffer containing an 8 bit + * alpha mask. + * * Upon validateDisplay, the device may request a change from this type - * to CLIENT. + * to either DEVICE or CLIENT. */ DISPLAY_DECORATION = 6, } -- GitLab From 74fc8e81985f034c2bf3097d2415be5b75168918 Mon Sep 17 00:00:00 2001 From: Josh Wu Date: Wed, 15 Dec 2021 23:08:12 -0800 Subject: [PATCH 349/825] BT: Fix typo and improper data type Bug: 203490261 Test: m android.hardware.bluetooth.audio-update-api Change-Id: I366140cdaff2c42b724444dc9855d993cd502dcd --- .../bluetooth/audio/BluetoothAudioStatus.aidl | 41 +++++++++++++++++++ .../audio/IBluetoothAudioProvider.aidl | 6 +-- .../bluetooth/audio/LdacQualityIndex.aidl | 8 ++-- .../bluetooth/audio/LeAudioCapabilities.aidl | 4 +- .../bluetooth/audio/LeAudioConfiguration.aidl | 4 +- .../bluetooth/audio/PcmCapabilities.aidl | 2 +- .../bluetooth/audio/PresentationPosition.aidl | 2 +- .../hardware/bluetooth/audio/SessionType.aidl | 2 +- .../bluetooth/audio/BluetoothAudioStatus.aidl | 27 ++++++++++++ .../audio/IBluetoothAudioProvider.aidl | 9 ++-- .../bluetooth/audio/LdacQualityIndex.aidl | 8 ++-- .../bluetooth/audio/LeAudioCapabilities.aidl | 4 +- .../bluetooth/audio/LeAudioConfiguration.aidl | 4 +- .../bluetooth/audio/PcmCapabilities.aidl | 2 +- .../bluetooth/audio/PresentationPosition.aidl | 4 +- .../hardware/bluetooth/audio/SessionType.aidl | 2 +- 16 files changed, 99 insertions(+), 30 deletions(-) create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl new file mode 100644 index 0000000000..7c0d82588c --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="int") @VintfStability +enum BluetoothAudioStatus { + UNKNOWN = 0, + SUCCESS = 1, + UNSUPPORTED_CODEC_CONFIGURATION = 2, + FAILURE = 3, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl index 84bcc0c061..e5e79cb1c4 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl @@ -35,7 +35,7 @@ package android.hardware.bluetooth.audio; @VintfStability interface IBluetoothAudioProvider { void endSession(); - android.hardware.common.fmq.MQDescriptor startSession(in android.hardware.bluetooth.audio.IBluetoothAudioPort hostIf, in android.hardware.bluetooth.audio.AudioConfiguration audioConfig); - void streamStarted(in boolean status); - void streamSuspended(in boolean status); + android.hardware.common.fmq.MQDescriptor startSession(in android.hardware.bluetooth.audio.IBluetoothAudioPort hostIf, in android.hardware.bluetooth.audio.AudioConfiguration audioConfig); + void streamStarted(in android.hardware.bluetooth.audio.BluetoothAudioStatus status); + void streamSuspended(in android.hardware.bluetooth.audio.BluetoothAudioStatus status); } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl index bc0d97b8b4..693392fe51 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl @@ -34,8 +34,8 @@ package android.hardware.bluetooth.audio; @Backing(type="byte") @VintfStability enum LdacQualityIndex { - QUALITY_HIGH = 1, - QUALITY_MID = 2, - QUALITY_LOW = 4, - QUALITY_ABR = 8, + HIGH = 1, + MID = 2, + LOW = 4, + ABR = 8, } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl index 9efafcadeb..a7224ca5da 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl @@ -38,13 +38,13 @@ parcelable LeAudioCapabilities { android.hardware.bluetooth.audio.CodecType codecType; android.hardware.bluetooth.audio.AudioLocation supportedChannel; int supportedChannelCount; - android.hardware.bluetooth.audio.LeAudioCapabilities.LeaudioCodecCapabilities leaudioCodecCapabilities; + android.hardware.bluetooth.audio.LeAudioCapabilities.LeAudioCodecCapabilities leAudioCodecCapabilities; @VintfStability parcelable VendorCapabilities { ParcelableHolder extension; } @VintfStability - union LeaudioCodecCapabilities { + union LeAudioCodecCapabilities { android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities; android.hardware.bluetooth.audio.LeAudioCapabilities.VendorCapabilities vendorCapabillities; } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl index c6cb5cb8f7..2bc179163f 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl @@ -35,10 +35,10 @@ package android.hardware.bluetooth.audio; @VintfStability parcelable LeAudioConfiguration { android.hardware.bluetooth.audio.LeAudioMode mode; - android.hardware.bluetooth.audio.LeAudioConfiguration.LeAuioModeConfig modeConfig; + android.hardware.bluetooth.audio.LeAudioConfiguration.LeAudioModeConfig modeConfig; android.hardware.bluetooth.audio.CodecType codecType; @VintfStability - union LeAuioModeConfig { + union LeAudioModeConfig { android.hardware.bluetooth.audio.UnicastConfiguration unicastConfig; android.hardware.bluetooth.audio.BroadcastConfiguration broadcastConfig; } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl index 0c2f87d599..6cfe5cd78c 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl @@ -35,7 +35,7 @@ package android.hardware.bluetooth.audio; @VintfStability parcelable PcmCapabilities { int[] sampleRateHz; - android.hardware.bluetooth.audio.ChannelMode[] channelMode; + android.hardware.bluetooth.audio.ChannelMode channelMode; byte[] bitsPerSample; int[] dataIntervalUs; } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl index 810a9a1653..7e997e8c8f 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl @@ -36,7 +36,7 @@ package android.hardware.bluetooth.audio; parcelable PresentationPosition { long remoteDeviceAudioDelayNanos; long transmittedOctets; - android.hardware.bluetooth.audio.PresentationPosition.TimeSpec transmittedOctetsTimeStamp; + android.hardware.bluetooth.audio.PresentationPosition.TimeSpec transmittedOctetsTimestamp; @VintfStability parcelable TimeSpec { long tvSec; diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl index 900ab318ce..72d7fb247a 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl @@ -36,7 +36,7 @@ package android.hardware.bluetooth.audio; enum SessionType { UNKNOWN = 0, A2DP_SOFTWARE_ENCODING_DATAPATH = 1, - A2DP_HARDWARE_OFFLOAD_DATAPATH = 2, + A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH = 2, HEARING_AID_SOFTWARE_ENCODING_DATAPATH = 3, LE_AUDIO_SOFTWARE_ENCODING_DATAPATH = 4, LE_AUDIO_SOFTWARE_DECODING_DATAPATH = 5, diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl new file mode 100644 index 0000000000..ec78445e6e --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl @@ -0,0 +1,27 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +@VintfStability +@Backing(type="int") +enum BluetoothAudioStatus { + UNKNOWN = 0, + SUCCESS = 1, + UNSUPPORTED_CODEC_CONFIGURATION = 2, + // General failure + FAILURE = 3 +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl index cebd808f5c..a2c5ae9a76 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl @@ -17,9 +17,10 @@ package android.hardware.bluetooth.audio; import android.hardware.bluetooth.audio.AudioConfiguration; +import android.hardware.bluetooth.audio.BluetoothAudioStatus; import android.hardware.bluetooth.audio.IBluetoothAudioPort; import android.hardware.common.fmq.MQDescriptor; -import android.hardware.common.fmq.UnsynchronizedWrite; +import android.hardware.common.fmq.SynchronizedReadWrite; /** * HAL interface from the Bluetooth stack to the Audio HAL @@ -55,7 +56,7 @@ interface IBluetoothAudioProvider { * audioConfig.pcmConfig parameter. Invalid if streaming is offloaded * from/to hardware or on failure */ - MQDescriptor startSession( + MQDescriptor startSession( in IBluetoothAudioPort hostIf, in AudioConfiguration audioConfig); /** @@ -63,12 +64,12 @@ interface IBluetoothAudioProvider { * * @param status true for SUCCESS or false for FAILURE */ - void streamStarted(in boolean status); + void streamStarted(in BluetoothAudioStatus status); /** * Callback for IBluetoothAudioPort.suspendStream() * * @param status true for SUCCESS or false for FAILURE */ - void streamSuspended(in boolean status); + void streamSuspended(in BluetoothAudioStatus status); } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl index fc532f4298..cb125839ef 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl @@ -22,17 +22,17 @@ enum LdacQualityIndex { /** * 990kbps */ - QUALITY_HIGH = 1, + HIGH = 1, /** * 660kbps */ - QUALITY_MID = 1 << 1, + MID = 1 << 1, /** * 330kbps */ - QUALITY_LOW = 1 << 2, + LOW = 1 << 2, /** * Adaptive Bit Rate mode */ - QUALITY_ABR = 1 << 3, + ABR = 1 << 3, } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl index ea05820b3e..732427f060 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl @@ -31,7 +31,7 @@ parcelable LeAudioCapabilities { ParcelableHolder extension; } @VintfStability - union LeaudioCodecCapabilities { + union LeAudioCodecCapabilities { Lc3Capabilities lc3Capabilities; VendorCapabilities vendorCapabillities; } @@ -43,5 +43,5 @@ parcelable LeAudioCapabilities { */ AudioLocation supportedChannel; int supportedChannelCount; - LeaudioCodecCapabilities leaudioCodecCapabilities; + LeAudioCodecCapabilities leAudioCodecCapabilities; } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl index a212c9682e..515794b247 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl @@ -24,7 +24,7 @@ import android.hardware.bluetooth.audio.UnicastConfiguration; @VintfStability parcelable LeAudioConfiguration { @VintfStability - union LeAuioModeConfig { + union LeAudioModeConfig { UnicastConfiguration unicastConfig; BroadcastConfiguration broadcastConfig; } @@ -32,6 +32,6 @@ parcelable LeAudioConfiguration { * The mode of the LE audio */ LeAudioMode mode; - LeAuioModeConfig modeConfig; + LeAudioModeConfig modeConfig; CodecType codecType; } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl index 776b777f50..f5d699edf1 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl @@ -24,7 +24,7 @@ import android.hardware.bluetooth.audio.ChannelMode; @VintfStability parcelable PcmCapabilities { int[] sampleRateHz; - ChannelMode[] channelMode; + ChannelMode channelMode; byte[] bitsPerSample; /** * Data interval for data transfer diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl index 17e746f5ed..f3b8aed488 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl @@ -44,9 +44,9 @@ parcelable PresentationPosition { */ long transmittedOctets; /* - * transmittedOctetsTimeStamp the value of CLOCK_MONOTONIC + * transmittedOctetsTimestamp the value of CLOCK_MONOTONIC * corresponding to transmittedOctets. If the software data path is * unused (e.g., for Hardware Offload), the value is set to zero. */ - TimeSpec transmittedOctetsTimeStamp; + TimeSpec transmittedOctetsTimestamp; } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl index b588869a3d..30faae31c9 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl @@ -27,7 +27,7 @@ enum SessionType { /** * The encoding of AVDTP media is done by HW and there is control only */ - A2DP_HARDWARE_OFFLOAD_DATAPATH, + A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH, /** * Used when encoded by Bluetooth Stack and streaming to Hearing Aid */ -- GitLab From 8de988580071a1dcaccb9c336ca9094e297f2cd5 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Tue, 21 Dec 2021 14:04:33 -0800 Subject: [PATCH 350/825] composer: DisplayCommand.colorTransform is just a matrix Remove the hint from DisplayCommand.colorTransform as currently we only use ColorTransform::IDENTITY and ColorTransform::ARBITRARY_MATRIX, which both can be expressed using a matrix. Bug: 208879711 Test: VTS Change-Id: Ibb24593e3d0af5afdc8f3f79de2fc22eeccfcea8 --- .../composer3/ColorTransformPayload.aidl | 39 ------------------- .../graphics/composer3/DisplayCommand.aidl | 2 +- .../composer3/ColorTransformPayload.aidl | 33 ---------------- .../graphics/composer3/DisplayCommand.aidl | 9 +---- .../VtsHalGraphicsComposer3_TargetTest.cpp | 2 +- .../graphics/composer3/ComposerClientWriter.h | 10 ++--- 6 files changed, 9 insertions(+), 86 deletions(-) delete mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl delete mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl deleted file mode 100644 index df07c9ca71..0000000000 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.graphics.composer3; -@VintfStability -parcelable ColorTransformPayload { - float[] matrix; - android.hardware.graphics.common.ColorTransform hint; -} 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 35a1eed0bb..3382633554 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 @@ -36,7 +36,7 @@ package android.hardware.graphics.composer3; parcelable DisplayCommand { long display; android.hardware.graphics.composer3.LayerCommand[] layers; - @nullable android.hardware.graphics.composer3.ColorTransformPayload colorTransform; + @nullable float[] colorTransformMatrix; @nullable android.hardware.graphics.composer3.ClientTarget clientTarget; @nullable android.hardware.graphics.composer3.Buffer virtualDisplayOutputBuffer; @nullable android.hardware.graphics.composer3.ClockMonotonicTimestamp expectedPresentTime; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl deleted file mode 100644 index fc37daca1c..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl +++ /dev/null @@ -1,33 +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. - */ - -package android.hardware.graphics.composer3; - -import android.hardware.graphics.common.ColorTransform; - -@VintfStability -parcelable ColorTransformPayload { - /** - * 4x4 transform matrix (16 floats) as described in DisplayCommand.colorTransform. - */ - float[] matrix; - - /** - * Hint value which may be used instead of the given matrix unless it - * is ColorTransform.ARBITRARY. - */ - ColorTransform hint; -} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl index fdaf35a146..18461aded7 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl @@ -19,7 +19,6 @@ package android.hardware.graphics.composer3; import android.hardware.graphics.composer3.Buffer; import android.hardware.graphics.composer3.ClientTarget; import android.hardware.graphics.composer3.ClockMonotonicTimestamp; -import android.hardware.graphics.composer3.ColorTransformPayload; import android.hardware.graphics.composer3.LayerCommand; @VintfStability @@ -39,11 +38,7 @@ parcelable DisplayCommand { /** * Sets a color transform which will be applied after composition. * - * If hint is not ColorTransform.ARBITRARY, then the device may use the - * hint to apply the desired color transform instead of using the color - * matrix directly. - * - * If the device is not capable of either using the hint or the matrix to + * If the device is not capable of either using the matrix to * apply the desired color transform, it must force all layers to client * composition during VALIDATE_DISPLAY. * @@ -71,7 +66,7 @@ parcelable DisplayCommand { * B_out = R_in * r.b + G_in * g.b + B_in * b.b + Tb * */ - @nullable ColorTransformPayload colorTransform; + @nullable float[] colorTransformMatrix; /** * Sets the buffer handle which will receive the output of client diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 19b1fb202f..e8dd61c5a3 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1503,7 +1503,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { }; TEST_P(GraphicsComposerAidlCommandTest, SET_COLOR_TRANSFORM) { - mWriter.setColorTransform(mPrimaryDisplay, kIdentity.data(), ColorTransform::IDENTITY); + mWriter.setColorTransform(mPrimaryDisplay, kIdentity.data()); execute(); } 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 dc15ea08f4..be31d7974c 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -75,11 +75,11 @@ class ComposerClientWriter { mCommands.clear(); } - void setColorTransform(int64_t display, const float* matrix, ColorTransform hint) { - ColorTransformPayload colorTransformPayload; - colorTransformPayload.matrix.assign(matrix, matrix + 16); - colorTransformPayload.hint = hint; - getDisplayCommand(display).colorTransform.emplace(std::move(colorTransformPayload)); + void setColorTransform(int64_t display, const float* matrix) { + std::vector matVec; + matVec.reserve(16); + matVec.assign(matrix, matrix + 16); + getDisplayCommand(display).colorTransformMatrix.emplace(std::move(matVec)); } void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target, -- GitLab From 654a3287ae018019047102edfda1ce779e8dd11e Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Mon, 20 Dec 2021 16:27:18 -0800 Subject: [PATCH 351/825] Remove GenericMetadata from composer3 There are no current users for GenericMetadata, so removing from composer 3. Bug: 209691612 Test: VTS Change-Id: I729a3646d9684c78454708fd15f1571aa405e9bb --- .../graphics/composer3/GenericMetadata.aidl | 39 ------------------- .../graphics/composer3/IComposerClient.aidl | 1 - .../graphics/composer3/LayerCommand.aidl | 1 - .../composer3/LayerGenericMetadataKey.aidl | 39 ------------------- .../graphics/composer3/GenericMetadata.aidl | 33 ---------------- .../graphics/composer3/IComposerClient.aidl | 15 ------- .../graphics/composer3/LayerCommand.aidl | 28 ------------- .../composer3/LayerGenericMetadataKey.aidl | 31 --------------- .../graphics/composer3/translate-ndk.cpp | 9 ----- .../VtsHalGraphicsComposer3_TargetTest.cpp | 22 ----------- .../graphics/composer3/ComposerClientWriter.h | 9 ----- .../graphics/composer3/translate-ndk.h | 5 --- 12 files changed, 232 deletions(-) delete mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl delete mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl delete mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl delete mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl deleted file mode 100644 index c18529bb3f..0000000000 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.graphics.composer3; -@VintfStability -parcelable GenericMetadata { - android.hardware.graphics.composer3.LayerGenericMetadataKey key; - byte[] value; -} 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 2bdbc9fd96..1354ea0182 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 @@ -52,7 +52,6 @@ interface IComposerClient { android.hardware.graphics.composer3.DisplayContentSample getDisplayedContentSample(long display, long maxFrames, long timestamp); android.hardware.graphics.composer3.DisplayContentSamplingAttributes getDisplayedContentSamplingAttributes(long display); android.hardware.graphics.composer3.HdrCapabilities getHdrCapabilities(long display); - android.hardware.graphics.composer3.LayerGenericMetadataKey[] getLayerGenericMetadataKeys(); int getMaxVirtualDisplayCount(); android.hardware.graphics.composer3.PerFrameMetadataKey[] getPerFrameMetadataKeys(long display); android.hardware.graphics.composer3.ReadbackBufferAttributes getReadbackBufferAttributes(long display); 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 bad72fcb5a..ab77880daf 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 @@ -52,7 +52,6 @@ parcelable LayerCommand { @nullable android.hardware.graphics.composer3.ZOrder z; @nullable float[] colorTransform; @nullable android.hardware.graphics.composer3.WhitePointNits whitePointNits; - @nullable android.hardware.graphics.composer3.GenericMetadata genericMetadata; @nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata; @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl deleted file mode 100644 index 73385d438c..0000000000 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.graphics.composer3; -@VintfStability -parcelable LayerGenericMetadataKey { - String name; - boolean mandatory; -} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl deleted file mode 100644 index d0254ddf48..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl +++ /dev/null @@ -1,33 +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. - */ - -package android.hardware.graphics.composer3; - -import android.hardware.graphics.composer3.LayerGenericMetadataKey; - -@VintfStability -parcelable GenericMetadata { - /** - * Indicates which metadata value should be set. - */ - LayerGenericMetadataKey key; - /** - * The binary representation of a AIDL struct corresponding to - * the key as described above. - * TODO(b/209691612): revisit the use of byte[] - */ - byte[] value; -} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 28bdb2c44e..742b52b5f4 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -30,7 +30,6 @@ import android.hardware.graphics.composer3.DisplayIdentification; import android.hardware.graphics.composer3.FormatColorComponent; import android.hardware.graphics.composer3.HdrCapabilities; import android.hardware.graphics.composer3.IComposerCallback; -import android.hardware.graphics.composer3.LayerGenericMetadataKey; import android.hardware.graphics.composer3.PerFrameMetadataKey; import android.hardware.graphics.composer3.PowerMode; import android.hardware.graphics.composer3.ReadbackBufferAttributes; @@ -368,20 +367,6 @@ interface IComposerClient { */ HdrCapabilities getHdrCapabilities(long display); - /** - * Retrieves the set of keys that may be passed into setLayerGenericMetadata - * - * Key names must meet the following requirements: - * - Must be specified in reverse domain name notation - * - Must not start with 'com.android' or 'android' - * - Must be unique within the returned vector - * - Must correspond to a matching HIDL struct type, which defines the - * structure of its values. For example, the key 'com.example.V1-3.Foo' - * should correspond to a value of type com.example@1.3::Foo, which is - * defined in a vendor HAL extension - */ - LayerGenericMetadataKey[] getLayerGenericMetadataKeys(); - /** * Returns the maximum number of virtual displays supported by this device * (which may be 0). The client must not attempt to create more than this diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index 761da9a2c5..44fd4dcb9a 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl @@ -23,7 +23,6 @@ import android.hardware.graphics.common.Rect; import android.hardware.graphics.composer3.Buffer; import android.hardware.graphics.composer3.Color; import android.hardware.graphics.composer3.FloatColor; -import android.hardware.graphics.composer3.GenericMetadata; import android.hardware.graphics.composer3.ParcelableBlendMode; import android.hardware.graphics.composer3.ParcelableComposition; import android.hardware.graphics.composer3.ParcelableDataspace; @@ -246,33 +245,6 @@ parcelable LayerCommand { */ @nullable WhitePointNits whitePointNits; - /** - * Sets a piece of generic metadata for the given layer. If this - * function is called twice with the same key but different values, the - * newer value must override the older one. Calling this function with a - * 0-length value must reset that key's metadata as if it had not been - * set. - * - * A given piece of metadata may either be mandatory or a hint - * (non-mandatory) as indicated by the second parameter. Mandatory - * metadata may affect the composition result, which is to say that it - * may cause a visible change in the final image. By contrast, hints may - * only affect the composition strategy, such as which layers are - * composited by the client, but must not cause a visible change in the - * final image. The value of the mandatory flag shall match the value - * returned from getLayerGenericMetadataKeys for the given key. - * - * Only keys which have been returned from getLayerGenericMetadataKeys() - * shall be accepted. Any other keys must result in an UNSUPPORTED error. - * - * The value passed into this function shall be the binary - * representation of a stable AIDL type corresponding to the given key. For - * example, a key of 'com.example.Foo-V2' shall be paired with a - * value of type com.exampleFoo-V2, which would be defined in a - * vendor HAL extension. - */ - @nullable GenericMetadata genericMetadata; - /** * Sets the PerFrameMetadata for the display. This metadata must be used * by the implementation to better tone map content to that display. diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl deleted file mode 100644 index 17704b8d3c..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl +++ /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. - */ - -package android.hardware.graphics.composer3; - -@VintfStability -parcelable LayerGenericMetadataKey { - /** - * Key names must comply with the requirements specified for - * getLayerGenericMetadataKeys below - */ - String name; - /** - * The mandatory flag is defined in the description of - * setLayerGenericMetadata above - */ - boolean mandatory; -} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp index a3c81765a1..8a789e3ac1 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp @@ -445,13 +445,4 @@ __attribute__((warn_unused_result)) bool translate( return true; } -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_4::IComposerClient:: - LayerGenericMetadataKey& in, - aidl::android::hardware::graphics::composer3::LayerGenericMetadataKey* out) { - out->name = in.name; - out->mandatory = static_cast(in.mandatory); - return true; -} - } // namespace android::h2a diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 1f30475737..040f402493 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -840,28 +840,6 @@ TEST_P(GraphicsComposerAidlTest, setGameContentType) { Test_setContentType(ContentType::GAME, "GAME"); } -TEST_P(GraphicsComposerAidlTest, getLayerGenericMetadataKeys) { - std::vector keys; - EXPECT_TRUE(mComposerClient->getLayerGenericMetadataKeys(&keys).isOk()); - - std::regex reverseDomainName("^[a-zA-Z-]{2,}(\\.[a-zA-Z0-9-]+)+$"); - std::unordered_set uniqueNames; - for (const auto& key : keys) { - std::string name(key.name); - - // Keys must not start with 'android' or 'com.android' - EXPECT_FALSE(name.find("android") == 0); - EXPECT_FALSE(name.find("com.android") == 0); - - // Keys must be in reverse domain name format - EXPECT_TRUE(std::regex_match(name, reverseDomainName)); - - // Keys must be unique within this list - const auto& [iter, inserted] = uniqueNames.insert(name); - EXPECT_TRUE(inserted); - } -} - TEST_P(GraphicsComposerAidlTest, CreateVirtualDisplay) { int32_t maxVirtualDisplayCount; EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&maxVirtualDisplayCount).isOk()); 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 bd0367394a..28bdd70e50 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -201,15 +201,6 @@ class ComposerClientWriter { getLayerCommand(display, layer).floatColor.emplace(color); } - void setLayerGenericMetadata(int64_t display, int64_t layer, const std::string& key, - const bool mandatory, const std::vector& value) { - GenericMetadata metadata; - metadata.key.name = key; - metadata.key.mandatory = mandatory; - metadata.value.assign(value.begin(), value.end()); - getLayerCommand(display, layer).genericMetadata.emplace(std::move(metadata)); - } - void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) { getLayerCommand(display, layer) .whitePointNits.emplace(WhitePointNits{.nits = whitePointNits}); diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h index 7004955eae..263167ee29 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h @@ -32,7 +32,6 @@ #include "aidl/android/hardware/graphics/composer3/FormatColorComponent.h" #include "aidl/android/hardware/graphics/composer3/HandleIndex.h" #include "aidl/android/hardware/graphics/composer3/IComposer.h" -#include "aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.h" #include "aidl/android/hardware/graphics/composer3/PerFrameMetadata.h" #include "aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h" #include "aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.h" @@ -79,9 +78,5 @@ __attribute__((warn_unused_result)) bool translate( const ::android::hardware::graphics::composer::V2_4::IComposerClient::ClientTargetProperty& in, aidl::android::hardware::graphics::composer3::ClientTargetProperty* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_4::IComposerClient:: - LayerGenericMetadataKey& in, - aidl::android::hardware::graphics::composer3::LayerGenericMetadataKey* out); } // namespace android::h2a -- GitLab From bf7a5d2866f3716a1d130392845e120d240a8486 Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Wed, 22 Dec 2021 01:28:05 -0800 Subject: [PATCH 352/825] VtsHalInputClassifier test: Include libbinder headers Bug: 162194035 Test: build Change-Id: I83329cacbb1f4755026c9ab44908fe0564f7fea8 --- input/classifier/1.0/vts/functional/Android.bp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/input/classifier/1.0/vts/functional/Android.bp b/input/classifier/1.0/vts/functional/Android.bp index 58945d3f63..5ff1457dcd 100644 --- a/input/classifier/1.0/vts/functional/Android.bp +++ b/input/classifier/1.0/vts/functional/Android.bp @@ -30,7 +30,10 @@ cc_test { ":inputconstants_aidl", "VtsHalInputClassifierV1_0TargetTest.cpp", ], - header_libs: ["jni_headers"], + header_libs: [ + "jni_headers", + "libbinder_headers", + ], static_libs: [ "android.hardware.input.classifier@1.0", "android.hardware.input.common@1.0", -- GitLab From d7b62ecbd7ada13d79531faaae62237fd71a4dbb Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Wed, 22 Dec 2021 16:10:01 +0000 Subject: [PATCH 353/825] Remove HIDL Context Hub from compatibility matrix We are requiring AIDL Context Hub HAL from Android T. Bug: 204591467 Test: None Change-Id: I14e8af2f6960aaa6502edd47e7685ea42ecfa513 --- compatibility_matrices/compatibility_matrix.current.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 27e6b265e1..667a209813 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -209,14 +209,6 @@ default - - android.hardware.contexthub - 1.2 - - IContexthub - default - - android.hardware.drm 1.3-4 -- GitLab From fc5603b7eca0f19e57a2b2775a2210f7a9a0fd01 Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Tue, 21 Dec 2021 11:34:00 -0800 Subject: [PATCH 354/825] VTS for IRadio AIDL Test: build Bug: 210712359 Change-Id: I4ee665519bfd2fc818fb68beee1f158b10e46176 --- radio/aidl/vts/Android.bp | 71 +++++ radio/aidl/vts/VtsHalRadioTargetTest.cpp | 66 ++++ radio/aidl/vts/radio_aidl_hal_utils.cpp | 176 +++++++++++ radio/aidl/vts/radio_aidl_hal_utils.h | 140 +++++++++ radio/aidl/vts/radio_data_indication.cpp | 39 +++ radio/aidl/vts/radio_data_response.cpp | 104 +++++++ radio/aidl/vts/radio_data_test.cpp | 292 ++++++++++++++++++ radio/aidl/vts/radio_data_utils.h | 116 +++++++ radio/aidl/vts/radio_messaging_indication.cpp | 59 ++++ radio/aidl/vts/radio_messaging_response.cpp | 152 +++++++++ radio/aidl/vts/radio_messaging_test.cpp | 194 ++++++++++++ radio/aidl/vts/radio_messaging_utils.h | 153 +++++++++ radio/aidl/vts/radio_modem_indication.cpp | 43 +++ radio/aidl/vts/radio_modem_response.cpp | 96 ++++++ radio/aidl/vts/radio_modem_test.cpp | 84 +++++ radio/aidl/vts/radio_modem_utils.h | 122 ++++++++ radio/aidl/vts/radio_network_indication.cpp | 94 ++++++ radio/aidl/vts/radio_network_response.cpp | 216 +++++++++++++ radio/aidl/vts/radio_network_test.cpp | 149 +++++++++ radio/aidl/vts/radio_network_utils.h | 214 +++++++++++++ radio/aidl/vts/radio_sim_indication.cpp | 71 +++++ radio/aidl/vts/radio_sim_response.cpp | 209 +++++++++++++ radio/aidl/vts/radio_sim_test.cpp | 259 ++++++++++++++++ radio/aidl/vts/radio_sim_utils.h | 207 +++++++++++++ radio/aidl/vts/radio_voice_indication.cpp | 85 +++++ radio/aidl/vts/radio_voice_response.cpp | 191 ++++++++++++ radio/aidl/vts/radio_voice_test.cpp | 261 ++++++++++++++++ radio/aidl/vts/radio_voice_utils.h | 192 ++++++++++++ 28 files changed, 4055 insertions(+) create mode 100644 radio/aidl/vts/Android.bp create mode 100644 radio/aidl/vts/VtsHalRadioTargetTest.cpp create mode 100644 radio/aidl/vts/radio_aidl_hal_utils.cpp create mode 100644 radio/aidl/vts/radio_aidl_hal_utils.h create mode 100644 radio/aidl/vts/radio_data_indication.cpp create mode 100644 radio/aidl/vts/radio_data_response.cpp create mode 100644 radio/aidl/vts/radio_data_test.cpp create mode 100644 radio/aidl/vts/radio_data_utils.h create mode 100644 radio/aidl/vts/radio_messaging_indication.cpp create mode 100644 radio/aidl/vts/radio_messaging_response.cpp create mode 100644 radio/aidl/vts/radio_messaging_test.cpp create mode 100644 radio/aidl/vts/radio_messaging_utils.h create mode 100644 radio/aidl/vts/radio_modem_indication.cpp create mode 100644 radio/aidl/vts/radio_modem_response.cpp create mode 100644 radio/aidl/vts/radio_modem_test.cpp create mode 100644 radio/aidl/vts/radio_modem_utils.h create mode 100644 radio/aidl/vts/radio_network_indication.cpp create mode 100644 radio/aidl/vts/radio_network_response.cpp create mode 100644 radio/aidl/vts/radio_network_test.cpp create mode 100644 radio/aidl/vts/radio_network_utils.h create mode 100644 radio/aidl/vts/radio_sim_indication.cpp create mode 100644 radio/aidl/vts/radio_sim_response.cpp create mode 100644 radio/aidl/vts/radio_sim_test.cpp create mode 100644 radio/aidl/vts/radio_sim_utils.h create mode 100644 radio/aidl/vts/radio_voice_indication.cpp create mode 100644 radio/aidl/vts/radio_voice_response.cpp create mode 100644 radio/aidl/vts/radio_voice_test.cpp create mode 100644 radio/aidl/vts/radio_voice_utils.h diff --git a/radio/aidl/vts/Android.bp b/radio/aidl/vts/Android.bp new file mode 100644 index 0000000000..935d2e5077 --- /dev/null +++ b/radio/aidl/vts/Android.bp @@ -0,0 +1,71 @@ +// Copyright 2021 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +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: "VtsHalRadioTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: [ + "radio_aidl_hal_utils.cpp", + "radio_data_indication.cpp", + "radio_data_response.cpp", + "radio_data_test.cpp", + "radio_messaging_indication.cpp", + "radio_messaging_response.cpp", + "radio_messaging_test.cpp", + "radio_modem_indication.cpp", + "radio_modem_response.cpp", + "radio_modem_test.cpp", + "radio_network_indication.cpp", + "radio_network_response.cpp", + "radio_network_test.cpp", + "radio_sim_indication.cpp", + "radio_sim_response.cpp", + "radio_sim_test.cpp", + "radio_voice_indication.cpp", + "radio_voice_response.cpp", + "radio_voice_test.cpp", + "VtsHalRadioTargetTest.cpp", + ], + shared_libs: [ + "libbinder_ndk", + "libvintf", + ], + static_libs: [ + "android.hardware.radio-V1-ndk", + "android.hardware.radio.config-V1-ndk", + "android.hardware.radio.data-V1-ndk", + "android.hardware.radio.messaging-V1-ndk", + "android.hardware.radio.modem-V1-ndk", + "android.hardware.radio.network-V1-ndk", + "android.hardware.radio.sim-V1-ndk", + "android.hardware.radio.voice-V1-ndk", + ], + // TODO(b/210712359): enable after b/207695009 is resolved. + //test_suites: [ + // "general-tests", + // "vts", + //], +} diff --git a/radio/aidl/vts/VtsHalRadioTargetTest.cpp b/radio/aidl/vts/VtsHalRadioTargetTest.cpp new file mode 100644 index 0000000000..e829f8e253 --- /dev/null +++ b/radio/aidl/vts/VtsHalRadioTargetTest.cpp @@ -0,0 +1,66 @@ +/* + * 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 + +#include "radio_data_utils.h" +#include "radio_messaging_utils.h" +#include "radio_modem_utils.h" +#include "radio_network_utils.h" +#include "radio_sim_utils.h" +#include "radio_voice_utils.h" + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioDataTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, RadioDataTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IRadioData::descriptor)), + android::PrintInstanceNameToString); + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioMessagingTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, RadioMessagingTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IRadioMessaging::descriptor)), + android::PrintInstanceNameToString); + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioModemTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, RadioModemTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IRadioModem::descriptor)), + android::PrintInstanceNameToString); + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioNetworkTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, RadioNetworkTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IRadioNetwork::descriptor)), + android::PrintInstanceNameToString); + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioSimTest); +INSTANTIATE_TEST_SUITE_P(PerInstance, RadioSimTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IRadioSim::descriptor)), + android::PrintInstanceNameToString); + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioVoiceTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, RadioVoiceTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IRadioVoice::descriptor)), + android::PrintInstanceNameToString); + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + ABinderProcess_setThreadPoolMaxThreadCount(1); + ABinderProcess_startThreadPool(); + return RUN_ALL_TESTS(); +} diff --git a/radio/aidl/vts/radio_aidl_hal_utils.cpp b/radio/aidl/vts/radio_aidl_hal_utils.cpp new file mode 100644 index 0000000000..14a16c0f2b --- /dev/null +++ b/radio/aidl/vts/radio_aidl_hal_utils.cpp @@ -0,0 +1,176 @@ +/* + * 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. + */ +#define LOG_TAG "RadioTest" + +#include "radio_aidl_hal_utils.h" +#include +#include "VtsCoreUtil.h" + +using namespace aidl::android::hardware::radio::network; + +#define WAIT_TIMEOUT_PERIOD 75 + +aidl::android::hardware::radio::sim::CardStatus cardStatus = {}; + +int GetRandomSerialNumber() { + return rand(); +} + +::testing::AssertionResult CheckAnyOfErrors(RadioError err, std::vector errors, + CheckFlag flag) { + const static std::vector generalErrors = { + RadioError::RADIO_NOT_AVAILABLE, RadioError::NO_MEMORY, + RadioError::INTERNAL_ERR, RadioError::SYSTEM_ERR, + RadioError::REQUEST_NOT_SUPPORTED, RadioError::CANCELLED}; + if (flag == CHECK_GENERAL_ERROR || flag == CHECK_OEM_AND_GENERAL_ERROR) { + for (size_t i = 0; i < generalErrors.size(); i++) { + if (err == generalErrors[i]) { + return testing::AssertionSuccess(); + } + } + } + if (flag == CHECK_OEM_ERROR || flag == CHECK_OEM_AND_GENERAL_ERROR) { + if (err >= RadioError::OEM_ERROR_1 && err <= RadioError::OEM_ERROR_25) { + return testing::AssertionSuccess(); + } + } + for (size_t i = 0; i < errors.size(); i++) { + if (err == errors[i]) { + return testing::AssertionSuccess(); + } + } + return testing::AssertionFailure() << "RadioError:" + toString(err) + " is returned"; +} + +// Runs "pm list features" and attempts to find the specified feature in its output. +bool deviceSupportsFeature(const char* feature) { + bool hasFeature = false; + FILE* p = popen("/system/bin/pm list features", "re"); + if (p) { + char* line = NULL; + size_t len = 0; + while (getline(&line, &len, p) > 0) { + if (strstr(line, feature)) { + hasFeature = true; + break; + } + } + pclose(p); + } else { + __android_log_print(ANDROID_LOG_FATAL, LOG_TAG, "popen failed: %d", errno); + _exit(EXIT_FAILURE); + } + __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "Feature %s: %ssupported", feature, + hasFeature ? "" : "not "); + return hasFeature; +} + +bool isSsSsEnabled() { + // Do not use checkSubstringInCommandOutput("getprop persist.radio.multisim.config", "") + // until b/148904287 is fixed. We need exact matching instead of partial matching. (i.e. + // by definition the empty string "" is a substring of any string). + return !isDsDsEnabled() && !isTsTsEnabled(); +} + +bool isDsDsEnabled() { + return testing::checkSubstringInCommandOutput("getprop persist.radio.multisim.config", "dsds"); +} + +bool isTsTsEnabled() { + return testing::checkSubstringInCommandOutput("getprop persist.radio.multisim.config", "tsts"); +} + +bool isVoiceInService(RegState state) { + return RegState::REG_HOME == state || RegState::REG_ROAMING == state; +} + +bool isVoiceEmergencyOnly(RegState state) { + return RegState::NOT_REG_MT_NOT_SEARCHING_OP_EM == state || + RegState::NOT_REG_MT_SEARCHING_OP_EM == state || RegState::REG_DENIED_EM == state || + RegState::UNKNOWN_EM == state; +} + +bool isServiceValidForDeviceConfiguration(std::string& serviceName) { + if (isSsSsEnabled()) { + // Device is configured as SSSS. + if (serviceName != RADIO_SERVICE_SLOT1_NAME) { + ALOGI("%s instance is not valid for SSSS device.", serviceName.c_str()); + return false; + } + } else if (isDsDsEnabled()) { + // Device is configured as DSDS. + if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME) { + ALOGI("%s instance is not valid for DSDS device.", serviceName.c_str()); + return false; + } + } else if (isTsTsEnabled()) { + // Device is configured as TSTS. + if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME && + serviceName != RADIO_SERVICE_SLOT3_NAME) { + ALOGI("%s instance is not valid for TSTS device.", serviceName.c_str()); + return false; + } + } + return true; +} + +/* + * Notify that the response message is received. + */ +void RadioResponseWaiter::notify(int receivedSerial) { + std::unique_lock lock(mtx_); + if (serial == receivedSerial) { + count_++; + cv_.notify_one(); + } +} + +/* + * Wait till the response message is notified or till WAIT_TIMEOUT_PERIOD. + */ +std::cv_status RadioResponseWaiter::wait() { + std::unique_lock lock(mtx_); + std::cv_status status = std::cv_status::no_timeout; + auto now = std::chrono::system_clock::now(); + while (count_ == 0) { + status = cv_.wait_until(lock, now + std::chrono::seconds(WAIT_TIMEOUT_PERIOD)); + if (status == std::cv_status::timeout) { + return status; + } + } + count_--; + return status; +} + +/** + * Specific features on the Radio HAL rely on Radio HAL Capabilities. + * The VTS test related to those features must not run if the related capability is disabled. + * Typical usage within VTS: if (getRadioHalCapabilities()) return; + */ +bool RadioResponseWaiter::getRadioHalCapabilities() { + // TODO(b/210712359): implement after RadioConfig VTS is created + /** + // Get HalDeviceCapabilities from the radio config + std::shared_ptr radioConfigRsp = new (std::nothrow) + RadioConfigResponse(*this); radioConfig->setResponseFunctions(radioConfigRsp, nullptr); serial = + GetRandomSerialNumber(); + + radioConfig->getHalDeviceCapabilities(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + return radioConfigRsp->modemReducedFeatureSet1; + **/ + return true; +} \ No newline at end of file diff --git a/radio/aidl/vts/radio_aidl_hal_utils.h b/radio/aidl/vts/radio_aidl_hal_utils.h new file mode 100644 index 0000000000..2f31fa80a5 --- /dev/null +++ b/radio/aidl/vts/radio_aidl_hal_utils.h @@ -0,0 +1,140 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include + +using namespace aidl::android::hardware::radio; +using aidl::android::hardware::radio::sim::CardStatus; + +extern CardStatus cardStatus; + +/* + * MACRO used to skip test case when radio response return error REQUEST_NOT_SUPPORTED + * on HAL versions which has deprecated the request interfaces. The MACRO can only be used + * AFTER receiving radio response. + */ +#define SKIP_TEST_IF_REQUEST_NOT_SUPPORTED_WITH_HAL(__ver__, __radio__, __radioRsp__) \ + do { \ + sp<::android::hardware::radio::V##__ver__::IRadio> __radio = \ + ::android::hardware::radio::V##__ver__::IRadio::castFrom(__radio__); \ + if (__radio && __radioRsp__->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED) { \ + GTEST_SKIP() << "REQUEST_NOT_SUPPORTED"; \ + } \ + } while (0) + +enum CheckFlag { + CHECK_DEFAULT = 0, + CHECK_GENERAL_ERROR = 1, + CHECK_OEM_ERROR = 2, + CHECK_OEM_AND_GENERAL_ERROR = 3, + CHECK_SAP_ERROR = 4, +}; + +static constexpr const char* FEATURE_VOICE_CALL = "android.software.connectionservice"; + +static constexpr const char* FEATURE_TELEPHONY = "android.hardware.telephony"; + +static constexpr const char* FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm"; + +static constexpr const char* FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma"; + +#define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3 +#define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3 +#define MODEM_SET_SIM_POWER_DELAY_IN_SECONDS 2 + +#define RADIO_SERVICE_SLOT1_NAME "slot1" // HAL instance name for SIM slot 1 or single SIM device +#define RADIO_SERVICE_SLOT2_NAME "slot2" // HAL instance name for SIM slot 2 on dual SIM device +#define RADIO_SERVICE_SLOT3_NAME "slot3" // HAL instance name for SIM slot 3 on triple SIM device + +/* + * Generate random serial number for radio test + */ +int GetRandomSerialNumber(); + +/* + * Check multiple radio error codes which are possibly returned because of the different + * vendor/devices implementations. It allows optional checks for general errors or/and oem errors. + */ +::testing::AssertionResult CheckAnyOfErrors(RadioError err, std::vector generalError, + CheckFlag flag = CHECK_DEFAULT); + +/* + * Check if device supports feature. + */ +bool deviceSupportsFeature(const char* feature); + +/* + * Check if device is in SsSs (Single SIM Single Standby). + */ +bool isSsSsEnabled(); + +/* + * Check if device is in DSDS (Dual SIM Dual Standby). + */ +bool isDsDsEnabled(); + +/* + * Check if device is in TSTS (Triple SIM Triple Standby). + */ +bool isTsTsEnabled(); + +/* + * Check if voice status is in emergency only. + */ +bool isVoiceEmergencyOnly(aidl::android::hardware::radio::network::RegState state); + +/* + * Check if voice status is in service. + */ +bool isVoiceInService(aidl::android::hardware::radio::network::RegState state); + +/* + * Check if service is valid for device configuration + */ +bool isServiceValidForDeviceConfiguration(std::string& serviceName); + +/** + * Used when waiting for an asynchronous response from the HAL. + */ +class RadioResponseWaiter { + protected: + std::mutex mtx_; + std::condition_variable cv_; + int count_; + + public: + /* Serial number for radio request */ + int serial; + + /* Used as a mechanism to inform the test about data/event callback */ + void notify(int receivedSerial); + + /* Test code calls this function to wait for response */ + std::cv_status wait(); + + // TODO(b/210712359): this probably isn't the best place to put this, but it works for now + // since all RadioXTest extend RadioResponseWaiter + /* Used to get the radio HAL capabilities */ + bool getRadioHalCapabilities(); +}; diff --git a/radio/aidl/vts/radio_data_indication.cpp b/radio/aidl/vts/radio_data_indication.cpp new file mode 100644 index 0000000000..1e02fe1024 --- /dev/null +++ b/radio/aidl/vts/radio_data_indication.cpp @@ -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. + */ + +#include "radio_data_utils.h" + +RadioDataIndication::RadioDataIndication(RadioDataTest& parent) : parent_data(parent) {} + +ndk::ScopedAStatus RadioDataIndication::dataCallListChanged( + RadioIndicationType /*type*/, const std::vector& /*dcList*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataIndication::keepaliveStatus(RadioIndicationType /*type*/, + const KeepaliveStatus& /*status*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataIndication::pcoData(RadioIndicationType /*type*/, + const PcoDataInfo& /*pco*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataIndication::unthrottleApn(RadioIndicationType /*type*/, + const DataProfileInfo& /*dataProfileInfo*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_data_response.cpp b/radio/aidl/vts/radio_data_response.cpp new file mode 100644 index 0000000000..682ddfbfee --- /dev/null +++ b/radio/aidl/vts/radio_data_response.cpp @@ -0,0 +1,104 @@ +/* + * 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 "radio_data_utils.h" + +RadioDataResponse::RadioDataResponse(RadioResponseWaiter& parent) : parent_data(parent) {} + +ndk::ScopedAStatus RadioDataResponse::acknowledgeRequest(int32_t /*serial*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataResponse::allocatePduSessionIdResponse(const RadioResponseInfo& info, + int32_t id) { + rspInfo = info; + allocatedPduSessionId = id; + parent_data.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataResponse::cancelHandoverResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_data.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataResponse::deactivateDataCallResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataResponse::getDataCallListResponse( + const RadioResponseInfo& info, const std::vector& /*dcResponse*/) { + rspInfo = info; + parent_data.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataResponse::getSlicingConfigResponse( + const RadioResponseInfo& info, const SlicingConfig& /*slicingConfig*/) { + rspInfo = info; + parent_data.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataResponse::releasePduSessionIdResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_data.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataResponse::setDataAllowedResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataResponse::setDataProfileResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataResponse::setDataThrottlingResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_data.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataResponse::setInitialAttachApnResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataResponse::setupDataCallResponse(const RadioResponseInfo& info, + const SetupDataCallResult& dcResponse) { + rspInfo = info; + setupDataCallResult = dcResponse; + parent_data.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataResponse::startHandoverResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_data.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataResponse::startKeepaliveResponse(const RadioResponseInfo& /*info*/, + const KeepaliveStatus& /*status*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioDataResponse::stopKeepaliveResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_data_test.cpp b/radio/aidl/vts/radio_data_test.cpp new file mode 100644 index 0000000000..dbf0eb7ec3 --- /dev/null +++ b/radio/aidl/vts/radio_data_test.cpp @@ -0,0 +1,292 @@ +/* + * 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 +#include +#include +#include + +#include "radio_data_utils.h" + +#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) + +void RadioDataTest::SetUp() { + std::string serviceName = GetParam(); + + if (!isServiceValidForDeviceConfiguration(serviceName)) { + ALOGI("Skipped the test due to device configuration."); + GTEST_SKIP(); + } + + radio_data = IRadioData::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); + ASSERT_NE(nullptr, radio_data.get()); + + radioRsp_data = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioRsp_data.get()); + + count_ = 0; + + radioInd_data = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioInd_data.get()); + + radio_data->setResponseFunctions(radioRsp_data, radioInd_data); + + // Assert IRadioConfig exists before testing + std::shared_ptr radioConfig = + aidl::android::hardware::radio::config::IRadioConfig::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService( + "android.hardware.radio.config.IRadioConfig/default"))); + ASSERT_NE(nullptr, radioConfig.get()); +} + +ndk::ScopedAStatus RadioDataTest::getDataCallList() { + serial = GetRandomSerialNumber(); + radio_data->getDataCallList(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + return ndk::ScopedAStatus::ok(); +} + +/* + * Test IRadioData.setupDataCall() for the response returned. + */ +TEST_P(RadioDataTest, setupDataCall) { + serial = GetRandomSerialNumber(); + + AccessNetwork accessNetwork = AccessNetwork::EUTRAN; + + DataProfileInfo dataProfileInfo; + memset(&dataProfileInfo, 0, sizeof(dataProfileInfo)); + dataProfileInfo.profileId = DataProfileInfo::ID_DEFAULT; + dataProfileInfo.apn = std::string("internet"); + dataProfileInfo.protocol = PdpProtocolType::IP; + dataProfileInfo.roamingProtocol = PdpProtocolType::IP; + dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP; + dataProfileInfo.user = std::string("username"); + dataProfileInfo.password = std::string("password"); + dataProfileInfo.type = DataProfileInfo::TYPE_THREE_GPP; + dataProfileInfo.maxConnsTime = 300; + dataProfileInfo.maxConns = 20; + dataProfileInfo.waitTime = 0; + dataProfileInfo.enabled = true; + // TODO(b/210712359): 320 was the previous value; need to support bitmaps + dataProfileInfo.supportedApnTypesBitmap = ApnTypes::DEFAULT; + // TODO(b/210712359): 161543 was the previous value; need to support bitmaps + dataProfileInfo.bearerBitmap = RadioAccessFamily::LTE; + dataProfileInfo.mtuV4 = 0; + dataProfileInfo.mtuV6 = 0; + dataProfileInfo.preferred = true; + dataProfileInfo.persistent = false; + + bool roamingAllowed = false; + + std::vector addresses = {}; + std::vector dnses = {}; + + DataRequestReason reason = DataRequestReason::NORMAL; + SliceInfo sliceInfo; + bool matchAllRuleAllowed = true; + + ndk::ScopedAStatus res = + radio_data->setupDataCall(serial, accessNetwork, dataProfileInfo, roamingAllowed, + reason, addresses, dnses, -1, sliceInfo, matchAllRuleAllowed); + ASSERT_OK(res); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type); + EXPECT_EQ(serial, radioRsp_data->rspInfo.serial); + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE, + RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, + RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); + } +} + +/* + * Test IRadioData.setupDataCall() with osAppId for the response returned. + */ +TEST_P(RadioDataTest, setupDataCall_osAppId) { + serial = GetRandomSerialNumber(); + + AccessNetwork accessNetwork = AccessNetwork::EUTRAN; + + TrafficDescriptor trafficDescriptor; + OsAppId osAppId; + std::string osAppIdString("osAppId"); + // TODO(b/210712359): there should be a cleaner way to convert this + std::vector output(osAppIdString.length()); + std::transform(osAppIdString.begin(), osAppIdString.end(), output.begin(), + [](char c) { return static_cast(c); }); + osAppId.osAppId = output; + trafficDescriptor.osAppId = osAppId; + + DataProfileInfo dataProfileInfo; + memset(&dataProfileInfo, 0, sizeof(dataProfileInfo)); + dataProfileInfo.profileId = DataProfileInfo::ID_DEFAULT; + dataProfileInfo.apn = std::string("internet"); + dataProfileInfo.protocol = PdpProtocolType::IP; + dataProfileInfo.roamingProtocol = PdpProtocolType::IP; + dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP; + dataProfileInfo.user = std::string("username"); + dataProfileInfo.password = std::string("password"); + dataProfileInfo.type = DataProfileInfo::TYPE_THREE_GPP; + dataProfileInfo.maxConnsTime = 300; + dataProfileInfo.maxConns = 20; + dataProfileInfo.waitTime = 0; + dataProfileInfo.enabled = true; + // TODO(b/210712359): 320 was the previous value; need to support bitmaps + dataProfileInfo.supportedApnTypesBitmap = ApnTypes::DEFAULT; + // TODO(b/210712359): 161543 was the previous value; need to support bitmaps + dataProfileInfo.bearerBitmap = RadioAccessFamily::LTE; + dataProfileInfo.mtuV4 = 0; + dataProfileInfo.mtuV6 = 0; + dataProfileInfo.preferred = true; + dataProfileInfo.persistent = false; + dataProfileInfo.trafficDescriptor = trafficDescriptor; + + bool roamingAllowed = false; + + std::vector addresses = {}; + std::vector dnses = {}; + + DataRequestReason reason = DataRequestReason::NORMAL; + SliceInfo sliceInfo; + bool matchAllRuleAllowed = true; + + ndk::ScopedAStatus res = + radio_data->setupDataCall(serial, accessNetwork, dataProfileInfo, roamingAllowed, + reason, addresses, dnses, -1, sliceInfo, matchAllRuleAllowed); + ASSERT_OK(res); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type); + EXPECT_EQ(serial, radioRsp_data->rspInfo.serial); + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE, + RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, + RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); + if (radioRsp_data->setupDataCallResult.trafficDescriptors.size() <= 0) { + return; + } + EXPECT_EQ(trafficDescriptor.osAppId.value().osAppId, + radioRsp_data->setupDataCallResult.trafficDescriptors[0].osAppId.value().osAppId); + } +} + +/* + * Test IRadioData.getSlicingConfig() for the response returned. + */ +TEST_P(RadioDataTest, getSlicingConfig) { + serial = GetRandomSerialNumber(); + radio_data->getSlicingConfig(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type); + EXPECT_EQ(serial, radioRsp_data->rspInfo.serial); + if (getRadioHalCapabilities()) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::REQUEST_NOT_SUPPORTED})); + } else { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, + RadioError::INTERNAL_ERR, RadioError::MODEM_ERR})); + } +} + +/* + * Test IRadioData.setDataThrottling() for the response returned. + */ +TEST_P(RadioDataTest, setDataThrottling) { + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_data->setDataThrottling( + serial, DataThrottlingAction::THROTTLE_SECONDARY_CARRIER, 60000); + ASSERT_OK(res); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type); + EXPECT_EQ(serial, radioRsp_data->rspInfo.serial); + if (getRadioHalCapabilities()) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE})); + } else { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR, + RadioError::NONE, RadioError::INVALID_ARGUMENTS})); + } + + sleep(1); + serial = GetRandomSerialNumber(); + + res = radio_data->setDataThrottling(serial, DataThrottlingAction::THROTTLE_ANCHOR_CARRIER, + 60000); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type); + EXPECT_EQ(serial, radioRsp_data->rspInfo.serial); + if (getRadioHalCapabilities()) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE})); + } else { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR, + RadioError::NONE, RadioError::INVALID_ARGUMENTS})); + } + + sleep(1); + serial = GetRandomSerialNumber(); + + res = radio_data->setDataThrottling(serial, DataThrottlingAction::HOLD, 60000); + ASSERT_OK(res); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type); + EXPECT_EQ(serial, radioRsp_data->rspInfo.serial); + if (getRadioHalCapabilities()) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE})); + } else { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR, + RadioError::NONE, RadioError::INVALID_ARGUMENTS})); + } + + sleep(1); + serial = GetRandomSerialNumber(); + + res = radio_data->setDataThrottling(serial, DataThrottlingAction::NO_DATA_THROTTLING, 60000); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type); + EXPECT_EQ(serial, radioRsp_data->rspInfo.serial); + if (getRadioHalCapabilities()) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE})); + } else { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR, + RadioError::NONE, RadioError::INVALID_ARGUMENTS})); + } + + sleep(1); +} diff --git a/radio/aidl/vts/radio_data_utils.h b/radio/aidl/vts/radio_data_utils.h new file mode 100644 index 0000000000..ada8ac1cc6 --- /dev/null +++ b/radio/aidl/vts/radio_data_utils.h @@ -0,0 +1,116 @@ +/* + * 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 +#include +#include + +#include "radio_aidl_hal_utils.h" + +using namespace aidl::android::hardware::radio::data; +using aidl::android::hardware::radio::sim::CardStatus; + +class RadioDataTest; + +/* Callback class for radio data response */ +class RadioDataResponse : public BnRadioDataResponse { + protected: + RadioResponseWaiter& parent_data; + + public: + RadioDataResponse(RadioResponseWaiter& parent_data); + virtual ~RadioDataResponse() = default; + + RadioResponseInfo rspInfo; + int32_t allocatedPduSessionId; + SetupDataCallResult setupDataCallResult; + + virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; + + virtual ndk::ScopedAStatus allocatePduSessionIdResponse(const RadioResponseInfo& info, + int32_t id) override; + + virtual ndk::ScopedAStatus cancelHandoverResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus deactivateDataCallResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus getDataCallListResponse( + const RadioResponseInfo& info, + const std::vector& dcResponse) override; + + virtual ndk::ScopedAStatus getSlicingConfigResponse( + const RadioResponseInfo& info, const SlicingConfig& slicingConfig) override; + + virtual ndk::ScopedAStatus releasePduSessionIdResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setDataAllowedResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setDataProfileResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setDataThrottlingResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setInitialAttachApnResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setupDataCallResponse( + const RadioResponseInfo& info, const SetupDataCallResult& dcResponse) override; + + virtual ndk::ScopedAStatus startHandoverResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus startKeepaliveResponse(const RadioResponseInfo& info, + const KeepaliveStatus& status) override; + + virtual ndk::ScopedAStatus stopKeepaliveResponse(const RadioResponseInfo& info) override; +}; + +/* Callback class for radio data indication */ +class RadioDataIndication : public BnRadioDataIndication { + protected: + RadioDataTest& parent_data; + + public: + RadioDataIndication(RadioDataTest& parent_data); + virtual ~RadioDataIndication() = default; + + virtual ndk::ScopedAStatus dataCallListChanged( + RadioIndicationType type, const std::vector& dcList) override; + + virtual ndk::ScopedAStatus keepaliveStatus(RadioIndicationType type, + const KeepaliveStatus& status) override; + + virtual ndk::ScopedAStatus pcoData(RadioIndicationType type, const PcoDataInfo& pco) override; + + virtual ndk::ScopedAStatus unthrottleApn(RadioIndicationType type, + const DataProfileInfo& dataProfile) override; +}; + +// The main test class for Radio AIDL Data. +class RadioDataTest : public ::testing::TestWithParam, public RadioResponseWaiter { + protected: + /* Get current data call list */ + ndk::ScopedAStatus getDataCallList(); + + public: + virtual void SetUp() override; + + /* radio data service handle */ + std::shared_ptr radio_data; + /* radio data response handle */ + std::shared_ptr radioRsp_data; + /* radio data indication handle */ + std::shared_ptr radioInd_data; +}; diff --git a/radio/aidl/vts/radio_messaging_indication.cpp b/radio/aidl/vts/radio_messaging_indication.cpp new file mode 100644 index 0000000000..7eeb266f4a --- /dev/null +++ b/radio/aidl/vts/radio_messaging_indication.cpp @@ -0,0 +1,59 @@ +/* + * 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 "radio_messaging_utils.h" + +RadioMessagingIndication::RadioMessagingIndication(RadioMessagingTest& parent) + : parent_messaging(parent) {} + +ndk::ScopedAStatus RadioMessagingIndication::cdmaNewSms(RadioIndicationType /*type*/, + const CdmaSmsMessage& /*msg*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingIndication::cdmaRuimSmsStorageFull(RadioIndicationType /*type*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingIndication::newBroadcastSms(RadioIndicationType /*type*/, + const std::vector& /*data*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingIndication::newSms(RadioIndicationType /*type*/, + const std::vector& /*pdu*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingIndication::newSmsOnSim(RadioIndicationType /*type*/, + int32_t /*recordNumber*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingIndication::newSmsStatusReport( + RadioIndicationType /*type*/, const std::vector& /*pdu*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingIndication::onUssd(RadioIndicationType /*type*/, + UssdModeType /*modeType*/, + const std::string& /*msg*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingIndication::simSmsStorageFull(RadioIndicationType /*type*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_messaging_response.cpp b/radio/aidl/vts/radio_messaging_response.cpp new file mode 100644 index 0000000000..d73278f152 --- /dev/null +++ b/radio/aidl/vts/radio_messaging_response.cpp @@ -0,0 +1,152 @@ +/* + * 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 "radio_messaging_utils.h" + +RadioMessagingResponse::RadioMessagingResponse(RadioResponseWaiter& parent) + : parent_messaging(parent) {} + +ndk::ScopedAStatus RadioMessagingResponse::acknowledgeIncomingGsmSmsWithPduResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingCdmaSmsResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingGsmSmsResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::acknowledgeRequest(int32_t /*serial*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::cancelPendingUssdResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnRuimResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnSimResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::getCdmaBroadcastConfigResponse( + const RadioResponseInfo& /*info*/, + const std::vector& /*configs*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::getGsmBroadcastConfigResponse( + const RadioResponseInfo& /*info*/, + const std::vector& /*configs*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::getSmscAddressResponse(const RadioResponseInfo& /*info*/, + const std::string& /*smsc*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::reportSmsMemoryStatusResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::sendCdmaSmsExpectMoreResponse( + const RadioResponseInfo& info, const SendSmsResult& sms) { + rspInfo = info; + sendSmsResult = sms; + parent_messaging.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::sendCdmaSmsResponse(const RadioResponseInfo& info, + const SendSmsResult& sms) { + rspInfo = info; + sendSmsResult = sms; + parent_messaging.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::sendImsSmsResponse(const RadioResponseInfo& /*info*/, + const SendSmsResult& /*sms*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::sendSmsExpectMoreResponse(const RadioResponseInfo& info, + const SendSmsResult& sms) { + rspInfo = info; + sendSmsResult = sms; + parent_messaging.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::sendSmsResponse(const RadioResponseInfo& info, + const SendSmsResult& sms) { + rspInfo = info; + sendSmsResult = sms; + parent_messaging.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::sendUssdResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastActivationResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastConfigResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastActivationResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastConfigResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::setSmscAddressResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::writeSmsToRuimResponse(const RadioResponseInfo& /*info*/, + int32_t /*index*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioMessagingResponse::writeSmsToSimResponse(const RadioResponseInfo& /*info*/, + int32_t /*index*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_messaging_test.cpp b/radio/aidl/vts/radio_messaging_test.cpp new file mode 100644 index 0000000000..58aeaab3f4 --- /dev/null +++ b/radio/aidl/vts/radio_messaging_test.cpp @@ -0,0 +1,194 @@ +/* + * 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 +#include +#include + +#include "radio_messaging_utils.h" + +#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) + +void RadioMessagingTest::SetUp() { + std::string serviceName = GetParam(); + + if (!isServiceValidForDeviceConfiguration(serviceName)) { + ALOGI("Skipped the test due to device configuration."); + GTEST_SKIP(); + } + + radio_messaging = IRadioMessaging::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); + ASSERT_NE(nullptr, radio_messaging.get()); + + radioRsp_messaging = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioRsp_messaging.get()); + + count_ = 0; + + radioInd_messaging = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioInd_messaging.get()); + + radio_messaging->setResponseFunctions(radioRsp_messaging, radioInd_messaging); + + // Assert IRadioConfig exists before testing + std::shared_ptr radioConfig = + aidl::android::hardware::radio::config::IRadioConfig::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService( + "android.hardware.radio.config.IRadioConfig/default"))); + ASSERT_NE(nullptr, radioConfig.get()); +} + +/* + * Test IRadioMessaging.sendSms() for the response returned. + */ +TEST_P(RadioMessagingTest, sendSms) { + LOG(DEBUG) << "sendSms"; + serial = GetRandomSerialNumber(); + GsmSmsMessage msg; + msg.smscPdu = ""; + msg.pdu = "01000b916105770203f3000006d4f29c3e9b01"; + + radio_messaging->sendSms(serial, msg); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_messaging->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + EXPECT_EQ(0, radioRsp_messaging->sendSmsResult.errorCode); + } + LOG(DEBUG) << "sendSms finished"; +} + +/* + * Test IRadioMessaging.sendSmsExpectMore() for the response returned. + */ +TEST_P(RadioMessagingTest, sendSmsExpectMore) { + LOG(DEBUG) << "sendSmsExpectMore"; + serial = GetRandomSerialNumber(); + GsmSmsMessage msg; + msg.smscPdu = ""; + msg.pdu = "01000b916105770203f3000006d4f29c3e9b01"; + + radio_messaging->sendSmsExpectMore(serial, msg); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_messaging->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "sendSmsExpectMore finished"; +} + +/* + * Test IRadioMessaging.sendCdmaSms() for the response returned. + */ +TEST_P(RadioMessagingTest, sendCdmaSms) { + LOG(DEBUG) << "sendCdmaSms"; + serial = GetRandomSerialNumber(); + + // Create a CdmaSmsAddress + CdmaSmsAddress cdmaSmsAddress; + cdmaSmsAddress.digitMode = CdmaSmsAddress::DIGIT_MODE_FOUR_BIT; + cdmaSmsAddress.isNumberModeDataNetwork = false; + cdmaSmsAddress.numberType = CdmaSmsAddress::NUMBER_TYPE_UNKNOWN; + cdmaSmsAddress.numberPlan = CdmaSmsAddress::NUMBER_PLAN_UNKNOWN; + cdmaSmsAddress.digits = (std::vector){11, 1, 6, 5, 10, 7, 7, 2, 10, 3, 10, 3}; + + // Create a CdmaSmsSubAddress + CdmaSmsSubaddress cdmaSmsSubaddress; + cdmaSmsSubaddress.subaddressType = CdmaSmsSubaddress::SUBADDRESS_TYPE_NSAP; + cdmaSmsSubaddress.odd = false; + cdmaSmsSubaddress.digits = (std::vector){}; + + // Create a CdmaSmsMessage + CdmaSmsMessage cdmaSmsMessage; + cdmaSmsMessage.teleserviceId = 4098; + cdmaSmsMessage.isServicePresent = false; + cdmaSmsMessage.serviceCategory = 0; + cdmaSmsMessage.address = cdmaSmsAddress; + cdmaSmsMessage.subAddress = cdmaSmsSubaddress; + cdmaSmsMessage.bearerData = + (std::vector){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0}; + + radio_messaging->sendCdmaSms(serial, cdmaSmsMessage); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_messaging->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "sendCdmaSms finished"; +} + +/* + * Test IRadioMessaging.sendCdmaSmsExpectMore() for the response returned. + */ +TEST_P(RadioMessagingTest, sendCdmaSmsExpectMore) { + serial = GetRandomSerialNumber(); + + // Create a CdmaSmsAddress + CdmaSmsAddress cdmaSmsAddress; + cdmaSmsAddress.digitMode = CdmaSmsAddress::DIGIT_MODE_FOUR_BIT; + cdmaSmsAddress.isNumberModeDataNetwork = false; + cdmaSmsAddress.numberType = CdmaSmsAddress::NUMBER_TYPE_UNKNOWN; + cdmaSmsAddress.numberPlan = CdmaSmsAddress::NUMBER_PLAN_UNKNOWN; + cdmaSmsAddress.digits = (std::vector){11, 1, 6, 5, 10, 7, 7, 2, 10, 3, 10, 3}; + + // Create a CdmaSmsSubAddress + CdmaSmsSubaddress cdmaSmsSubaddress; + cdmaSmsSubaddress.subaddressType = CdmaSmsSubaddress::SUBADDRESS_TYPE_NSAP; + cdmaSmsSubaddress.odd = false; + cdmaSmsSubaddress.digits = (std::vector){}; + + // Create a CdmaSmsMessage + CdmaSmsMessage cdmaSmsMessage; + cdmaSmsMessage.teleserviceId = 4098; + cdmaSmsMessage.isServicePresent = false; + cdmaSmsMessage.serviceCategory = 0; + cdmaSmsMessage.address = cdmaSmsAddress; + cdmaSmsMessage.subAddress = cdmaSmsSubaddress; + cdmaSmsMessage.bearerData = + (std::vector){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0}; + + radio_messaging->sendCdmaSmsExpectMore(serial, cdmaSmsMessage); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_messaging->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } +} diff --git a/radio/aidl/vts/radio_messaging_utils.h b/radio/aidl/vts/radio_messaging_utils.h new file mode 100644 index 0000000000..96cde088f3 --- /dev/null +++ b/radio/aidl/vts/radio_messaging_utils.h @@ -0,0 +1,153 @@ +/* + * 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 +#include +#include + +#include "radio_aidl_hal_utils.h" + +using namespace aidl::android::hardware::radio::messaging; + +class RadioMessagingTest; + +/* Callback class for radio messaging response */ +class RadioMessagingResponse : public BnRadioMessagingResponse { + protected: + RadioResponseWaiter& parent_messaging; + + public: + RadioMessagingResponse(RadioResponseWaiter& parent_messaging); + virtual ~RadioMessagingResponse() = default; + + RadioResponseInfo rspInfo; + SendSmsResult sendSmsResult; + + virtual ndk::ScopedAStatus acknowledgeIncomingGsmSmsWithPduResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus acknowledgeLastIncomingCdmaSmsResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus acknowledgeLastIncomingGsmSmsResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; + + virtual ndk::ScopedAStatus cancelPendingUssdResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus deleteSmsOnRuimResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus deleteSmsOnSimResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus getCdmaBroadcastConfigResponse( + const RadioResponseInfo& info, + const std::vector& configs) override; + + virtual ndk::ScopedAStatus getGsmBroadcastConfigResponse( + const RadioResponseInfo& info, + const std::vector& configs) override; + + virtual ndk::ScopedAStatus getSmscAddressResponse(const RadioResponseInfo& info, + const std::string& smsc) override; + + virtual ndk::ScopedAStatus reportSmsMemoryStatusResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus sendCdmaSmsExpectMoreResponse(const RadioResponseInfo& info, + const SendSmsResult& sms) override; + + virtual ndk::ScopedAStatus sendCdmaSmsResponse(const RadioResponseInfo& info, + const SendSmsResult& sms) override; + + virtual ndk::ScopedAStatus sendImsSmsResponse(const RadioResponseInfo& info, + const SendSmsResult& sms) override; + + virtual ndk::ScopedAStatus sendSmsExpectMoreResponse(const RadioResponseInfo& info, + const SendSmsResult& sms) override; + + virtual ndk::ScopedAStatus sendSmsResponse(const RadioResponseInfo& info, + const SendSmsResult& sms) override; + + virtual ndk::ScopedAStatus sendUssdResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setCdmaBroadcastActivationResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setCdmaBroadcastConfigResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setGsmBroadcastActivationResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setGsmBroadcastConfigResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setSmscAddressResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus writeSmsToRuimResponse(const RadioResponseInfo& info, + int32_t index) override; + + virtual ndk::ScopedAStatus writeSmsToSimResponse(const RadioResponseInfo& info, + int32_t index) override; +}; + +/* Callback class for radio messaging indication */ +class RadioMessagingIndication : public BnRadioMessagingIndication { + protected: + RadioMessagingTest& parent_messaging; + + public: + RadioMessagingIndication(RadioMessagingTest& parent_messaging); + virtual ~RadioMessagingIndication() = default; + + virtual ndk::ScopedAStatus cdmaNewSms(RadioIndicationType type, + const CdmaSmsMessage& msg) override; + + virtual ndk::ScopedAStatus cdmaRuimSmsStorageFull(RadioIndicationType type) override; + + virtual ndk::ScopedAStatus newBroadcastSms(RadioIndicationType type, + const std::vector& data) override; + + virtual ndk::ScopedAStatus newSms(RadioIndicationType type, + const std::vector& pdu) override; + + virtual ndk::ScopedAStatus newSmsOnSim(RadioIndicationType type, int32_t recordNumber) override; + + virtual ndk::ScopedAStatus newSmsStatusReport(RadioIndicationType type, + const std::vector& pdu) override; + + virtual ndk::ScopedAStatus onUssd(RadioIndicationType type, UssdModeType modeType, + const std::string& msg) override; + + virtual ndk::ScopedAStatus simSmsStorageFull(RadioIndicationType type) override; +}; + +// The main test class for Radio AIDL Messaging. +class RadioMessagingTest : public ::testing::TestWithParam, + public RadioResponseWaiter { + public: + virtual void SetUp() override; + + /* radio messaging service handle */ + std::shared_ptr radio_messaging; + /* radio messaging response handle */ + std::shared_ptr radioRsp_messaging; + /* radio messaging indication handle */ + std::shared_ptr radioInd_messaging; +}; diff --git a/radio/aidl/vts/radio_modem_indication.cpp b/radio/aidl/vts/radio_modem_indication.cpp new file mode 100644 index 0000000000..17f37a8dd5 --- /dev/null +++ b/radio/aidl/vts/radio_modem_indication.cpp @@ -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. + */ + +#include "radio_modem_utils.h" + +RadioModemIndication::RadioModemIndication(RadioModemTest& parent) : parent_modem(parent) {} + +ndk::ScopedAStatus RadioModemIndication::hardwareConfigChanged( + RadioIndicationType /*type*/, const std::vector& /*configs*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemIndication::modemReset(RadioIndicationType /*type*/, + const std::string& /*reason*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemIndication::radioCapabilityIndication(RadioIndicationType /*type*/, + const RadioCapability& /*rc*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemIndication::radioStateChanged(RadioIndicationType /*type*/, + RadioState /*radioState*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemIndication::rilConnected(RadioIndicationType /*type*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_modem_response.cpp b/radio/aidl/vts/radio_modem_response.cpp new file mode 100644 index 0000000000..7ac590f4db --- /dev/null +++ b/radio/aidl/vts/radio_modem_response.cpp @@ -0,0 +1,96 @@ +/* + * 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 "radio_modem_utils.h" + +RadioModemResponse::RadioModemResponse(RadioResponseWaiter& parent) : parent_modem(parent) {} + +ndk::ScopedAStatus RadioModemResponse::acknowledgeRequest(int32_t /*serial*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::enableModemResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::getBasebandVersionResponse(const RadioResponseInfo& /*info*/, + const std::string& /*version*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::getDeviceIdentityResponse(const RadioResponseInfo& /*info*/, + const std::string& /*imei*/, + const std::string& /*imeisv*/, + const std::string& /*esn*/, + const std::string& /*meid*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::getHardwareConfigResponse( + const RadioResponseInfo& /*info*/, const std::vector& /*config*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::getModemActivityInfoResponse( + const RadioResponseInfo& /*info*/, const ActivityStatsInfo& /*activityInfo*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::getModemStackStatusResponse( + const RadioResponseInfo& /*info*/, const bool /*enabled*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::getRadioCapabilityResponse(const RadioResponseInfo& /*info*/, + const RadioCapability& /*rc*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::nvReadItemResponse(const RadioResponseInfo& /*info*/, + const std::string& /*result*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::nvResetConfigResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::nvWriteCdmaPrlResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::nvWriteItemResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::requestShutdownResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::sendDeviceStateResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::setRadioCapabilityResponse(const RadioResponseInfo& /*info*/, + const RadioCapability& /*rc*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioModemResponse::setRadioPowerResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_modem.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_modem_test.cpp b/radio/aidl/vts/radio_modem_test.cpp new file mode 100644 index 0000000000..406927f5bc --- /dev/null +++ b/radio/aidl/vts/radio_modem_test.cpp @@ -0,0 +1,84 @@ +/* + * 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 +#include +#include + +#include "radio_modem_utils.h" + +#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) + +void RadioModemTest::SetUp() { + std::string serviceName = GetParam(); + + if (!isServiceValidForDeviceConfiguration(serviceName)) { + ALOGI("Skipped the test due to device configuration."); + GTEST_SKIP(); + } + + radio_modem = IRadioModem::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); + ASSERT_NE(nullptr, radio_modem.get()); + + radioRsp_modem = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioRsp_modem.get()); + + count_ = 0; + + radioInd_modem = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioInd_modem.get()); + + radio_modem->setResponseFunctions(radioRsp_modem, radioInd_modem); + + // Assert IRadioConfig exists before testing + std::shared_ptr radioConfig = + aidl::android::hardware::radio::config::IRadioConfig::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService( + "android.hardware.radio.config.IRadioConfig/default"))); + ASSERT_NE(nullptr, radioConfig.get()); +} + +/* + * Test IRadioModem.setRadioPower() for the response returned. + */ +TEST_P(RadioModemTest, setRadioPower_emergencyCall_cancelled) { + // Set radio power to off. + serial = GetRandomSerialNumber(); + radio_modem->setRadioPower(serial, false, false, false); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error); + + // Set radio power to on with forEmergencyCall being true. This should put modem to only scan + // emergency call bands. + serial = GetRandomSerialNumber(); + radio_modem->setRadioPower(serial, true, true, true); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error); + + // Set radio power to on with forEmergencyCall being false. This should put modem in regular + // operation modem. + serial = GetRandomSerialNumber(); + radio_modem->setRadioPower(serial, true, false, false); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error); +} diff --git a/radio/aidl/vts/radio_modem_utils.h b/radio/aidl/vts/radio_modem_utils.h new file mode 100644 index 0000000000..cd9a30d315 --- /dev/null +++ b/radio/aidl/vts/radio_modem_utils.h @@ -0,0 +1,122 @@ +/* + * 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 +#include +#include + +#include "radio_aidl_hal_utils.h" + +using namespace aidl::android::hardware::radio::config; +using namespace aidl::android::hardware::radio::modem; + +class RadioModemTest; + +/* Callback class for radio modem response */ +class RadioModemResponse : public BnRadioModemResponse { + protected: + RadioResponseWaiter& parent_modem; + + public: + RadioModemResponse(RadioResponseWaiter& parent_modem); + virtual ~RadioModemResponse() = default; + + RadioResponseInfo rspInfo; + bool isModemEnabled; + bool enableModemResponseToggle; + + virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; + + virtual ndk::ScopedAStatus enableModemResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus getBasebandVersionResponse(const RadioResponseInfo& info, + const std::string& version) override; + + virtual ndk::ScopedAStatus getDeviceIdentityResponse(const RadioResponseInfo& info, + const std::string& imei, + const std::string& imeisv, + const std::string& esn, + const std::string& meid) override; + + virtual ndk::ScopedAStatus getHardwareConfigResponse( + const RadioResponseInfo& info, const std::vector& config) override; + + virtual ndk::ScopedAStatus getModemActivityInfoResponse( + const RadioResponseInfo& info, const ActivityStatsInfo& activityInfo) override; + + virtual ndk::ScopedAStatus getModemStackStatusResponse(const RadioResponseInfo& info, + const bool enabled) override; + + virtual ndk::ScopedAStatus getRadioCapabilityResponse(const RadioResponseInfo& info, + const RadioCapability& rc) override; + + virtual ndk::ScopedAStatus nvReadItemResponse(const RadioResponseInfo& info, + const std::string& result) override; + + virtual ndk::ScopedAStatus nvResetConfigResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus nvWriteCdmaPrlResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus nvWriteItemResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus requestShutdownResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus sendDeviceStateResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setRadioCapabilityResponse(const RadioResponseInfo& info, + const RadioCapability& rc) override; + + virtual ndk::ScopedAStatus setRadioPowerResponse(const RadioResponseInfo& info) override; +}; + +/* Callback class for radio modem indication */ +class RadioModemIndication : public BnRadioModemIndication { + protected: + RadioModemTest& parent_modem; + + public: + RadioModemIndication(RadioModemTest& parent_modem); + virtual ~RadioModemIndication() = default; + + virtual ndk::ScopedAStatus hardwareConfigChanged( + RadioIndicationType type, const std::vector& configs) override; + + virtual ndk::ScopedAStatus modemReset(RadioIndicationType type, + const std::string& reason) override; + + virtual ndk::ScopedAStatus radioCapabilityIndication(RadioIndicationType type, + const RadioCapability& rc) override; + + virtual ndk::ScopedAStatus radioStateChanged(RadioIndicationType type, + RadioState radioState) override; + + virtual ndk::ScopedAStatus rilConnected(RadioIndicationType type) override; +}; + +// The main test class for Radio AIDL Modem. +class RadioModemTest : public ::testing::TestWithParam, public RadioResponseWaiter { + public: + virtual void SetUp() override; + + /* radio modem service handle */ + std::shared_ptr radio_modem; + /* radio modem response handle */ + std::shared_ptr radioRsp_modem; + /* radio modem indication handle */ + std::shared_ptr radioInd_modem; +}; diff --git a/radio/aidl/vts/radio_network_indication.cpp b/radio/aidl/vts/radio_network_indication.cpp new file mode 100644 index 0000000000..7bed7593a6 --- /dev/null +++ b/radio/aidl/vts/radio_network_indication.cpp @@ -0,0 +1,94 @@ +/* + * 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 "radio_network_utils.h" + +RadioNetworkIndication::RadioNetworkIndication(RadioNetworkTest& parent) : parent_network(parent) {} + +ndk::ScopedAStatus RadioNetworkIndication::barringInfoChanged( + RadioIndicationType /*type*/, const CellIdentity& /*cellIdentity*/, + const std::vector& /*barringInfos*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkIndication::cdmaPrlChanged(RadioIndicationType /*type*/, + int32_t /*version*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkIndication::cellInfoList(RadioIndicationType /*type*/, + const std::vector& /*records*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkIndication::currentLinkCapacityEstimate( + RadioIndicationType /*type*/, const LinkCapacityEstimate& /*lce*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkIndication::currentPhysicalChannelConfigs( + RadioIndicationType /*type*/, const std::vector& /*configs*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkIndication::currentSignalStrength( + RadioIndicationType /*type*/, const SignalStrength& /*signalStrength*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkIndication::imsNetworkStateChanged(RadioIndicationType /*type*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkIndication::networkScanResult(RadioIndicationType /*type*/, + const NetworkScanResult& /*result*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkIndication::networkStateChanged(RadioIndicationType /*type*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkIndication::nitzTimeReceived(RadioIndicationType /*type*/, + const std::string& /*nitzTime*/, + int64_t /*receivedTime*/, + int64_t /*age*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkIndication::registrationFailed(RadioIndicationType /*type*/, + const CellIdentity& /*cellIdentity*/, + const std::string& /*chosenPlmn*/, + Domain /*domain*/, + int32_t /*causeCode*/, + int32_t /*additionalCauseCode*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkIndication::restrictedStateChanged(RadioIndicationType /*type*/, + PhoneRestrictedState /*state*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkIndication::suppSvcNotify(RadioIndicationType /*type*/, + const SuppSvcNotification& /*suppSvc*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkIndication::voiceRadioTechChanged(RadioIndicationType /*type*/, + RadioTechnology /*rat*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_network_response.cpp b/radio/aidl/vts/radio_network_response.cpp new file mode 100644 index 0000000000..64f85c6bab --- /dev/null +++ b/radio/aidl/vts/radio_network_response.cpp @@ -0,0 +1,216 @@ +/* + * 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 "radio_network_utils.h" + +RadioNetworkResponse::RadioNetworkResponse(RadioResponseWaiter& parent) : parent_network(parent) {} + +ndk::ScopedAStatus RadioNetworkResponse::acknowledgeRequest(int32_t /*serial*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getAllowedNetworkTypesBitmapResponse( + const RadioResponseInfo& info, const RadioAccessFamily networkTypeBitmap) { + rspInfo = info; + networkTypeBitmapResponse = networkTypeBitmap; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getAvailableBandModesResponse( + const RadioResponseInfo& /*info*/, const std::vector& /*bandModes*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getAvailableNetworksResponse( + const RadioResponseInfo& info, const std::vector& operatorInfos) { + rspInfo = info; + networkInfos = operatorInfos; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getBarringInfoResponse( + const RadioResponseInfo& /*info*/, const CellIdentity& /*cellIdentity*/, + const std::vector& /*barringInfos*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getCdmaRoamingPreferenceResponse( + const RadioResponseInfo& /*info*/, CdmaRoamingType /*type*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getCellInfoListResponse( + const RadioResponseInfo& /*info*/, const std::vector& /*cellInfo*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getDataRegistrationStateResponse( + const RadioResponseInfo& info, const RegStateResult& /*regResponse*/) { + rspInfo = info; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getImsRegistrationStateResponse( + const RadioResponseInfo& /*info*/, bool /*isRegistered*/, + RadioTechnologyFamily /*ratFamily*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getNetworkSelectionModeResponse( + const RadioResponseInfo& /*info*/, bool /*manual*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getOperatorResponse(const RadioResponseInfo& /*info*/, + const std::string& /*longName*/, + const std::string& /*shortName*/, + const std::string& /*numeric*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getSignalStrengthResponse( + const RadioResponseInfo& /*info*/, const SignalStrength& /*sig_strength*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getSystemSelectionChannelsResponse( + const RadioResponseInfo& info, const std::vector& /*specifier*/) { + rspInfo = info; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getUsageSettingResponse( + const RadioResponseInfo& /*info*/, const UsageSetting /*usageSetting*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getVoiceRadioTechnologyResponse( + const RadioResponseInfo& /*info*/, RadioTechnology /*rat*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::getVoiceRegistrationStateResponse( + const RadioResponseInfo& info, const RegStateResult& regResponse) { + rspInfo = info; + regStateResp.regState = regResponse.regState; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::isNrDualConnectivityEnabledResponse( + const RadioResponseInfo& info, bool isEnabled) { + rspInfo = info; + isNrDualConnectivityEnabled = isEnabled; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setAllowedNetworkTypesBitmapResponse( + const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setBandModeResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setBarringPasswordResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setCdmaRoamingPreferenceResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setCellInfoListRateResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setIndicationFilterResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setLinkCapacityReportingCriteriaResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setLocationUpdatesResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setNetworkSelectionModeAutomaticResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setNetworkSelectionModeManualResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setNrDualConnectivityStateResponse( + const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setSignalStrengthReportingCriteriaResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setSuppServiceNotificationsResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setSystemSelectionChannelsResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::setUsageSettingResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::startNetworkScanResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::stopNetworkScanResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioNetworkResponse::supplyNetworkDepersonalizationResponse( + const RadioResponseInfo& /*info*/, int32_t /*remainingRetries*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp new file mode 100644 index 0000000000..a8f87fc6ed --- /dev/null +++ b/radio/aidl/vts/radio_network_test.cpp @@ -0,0 +1,149 @@ +/* + * 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 +#include +#include + +#include "radio_network_utils.h" + +#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) + +void RadioNetworkTest::SetUp() { + std::string serviceName = GetParam(); + + if (!isServiceValidForDeviceConfiguration(serviceName)) { + ALOGI("Skipped the test due to device configuration."); + GTEST_SKIP(); + } + + radio_network = IRadioNetwork::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); + ASSERT_NE(nullptr, radio_network.get()); + + radioRsp_network = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioRsp_network.get()); + + count_ = 0; + + radioInd_network = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioInd_network.get()); + + radio_network->setResponseFunctions(radioRsp_network, radioInd_network); + + // Assert IRadioConfig exists before testing + std::shared_ptr radioConfig = + aidl::android::hardware::radio::config::IRadioConfig::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService( + "android.hardware.radio.config.IRadioConfig/default"))); + ASSERT_NE(nullptr, radioConfig.get()); +} + +/* + * Test IRadioNetwork.setAllowedNetworkTypesBitmap for the response returned. + */ +TEST_P(RadioNetworkTest, setAllowedNetworkTypesBitmap) { + serial = GetRandomSerialNumber(); + RadioAccessFamily allowedNetworkTypesBitmap = RadioAccessFamily::LTE; + + radio_network->setAllowedNetworkTypesBitmap(serial, allowedNetworkTypesBitmap); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::OPERATION_NOT_ALLOWED, + RadioError::MODE_NOT_SUPPORTED, RadioError::INTERNAL_ERR, RadioError::MODEM_ERR, + RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED, + RadioError::NO_RESOURCES})); +} + +/* + * Test IRadioNetwork.getAllowedNetworkTypesBitmap for the response returned. + */ +TEST_P(RadioNetworkTest, getAllowedNetworkTypesBitmap) { + serial = GetRandomSerialNumber(); + RadioAccessFamily allowedNetworkTypesBitmap = RadioAccessFamily::LTE; + + radio_network->setAllowedNetworkTypesBitmap(serial, allowedNetworkTypesBitmap); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (radioRsp_network->rspInfo.error == RadioError::NONE) { + sleep(3); // wait for modem + serial = GetRandomSerialNumber(); + radio_network->getAllowedNetworkTypesBitmap(serial); + + 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::INTERNAL_ERR, + RadioError::OPERATION_NOT_ALLOWED, RadioError::MODE_NOT_SUPPORTED, + RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR, + RadioError::REQUEST_NOT_SUPPORTED, RadioError::NO_RESOURCES})); + } +} + +/* + * Test IRadioNetwork.setNrDualConnectivityState() for the response returned. + */ +TEST_P(RadioNetworkTest, setNrDualConnectivityState) { + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = + radio_network->setNrDualConnectivityState(serial, NrDualConnectivityState::DISABLE); + 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); + if (getRadioHalCapabilities()) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::REQUEST_NOT_SUPPORTED})); + } else { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR, + RadioError::INVALID_STATE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE})); + } +} + +/* + * Test IRadioNetwork.isNrDualConnectivityEnabled() for the response returned. + */ +TEST_P(RadioNetworkTest, isNrDualConnectivityEnabled) { + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_network->isNrDualConnectivityEnabled(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); + if (getRadioHalCapabilities()) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::REQUEST_NOT_SUPPORTED})); + } else { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR, RadioError::NONE})); + } +} \ No newline at end of file diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h new file mode 100644 index 0000000000..26fce016b2 --- /dev/null +++ b/radio/aidl/vts/radio_network_utils.h @@ -0,0 +1,214 @@ +/* + * 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 +#include +#include + +#include "radio_aidl_hal_utils.h" + +using namespace aidl::android::hardware::radio::network; + +class RadioNetworkTest; + +/* Callback class for radio network response */ +class RadioNetworkResponse : public BnRadioNetworkResponse { + protected: + RadioResponseWaiter& parent_network; + + public: + RadioNetworkResponse(RadioResponseWaiter& parent_network); + virtual ~RadioNetworkResponse() = default; + + RadioResponseInfo rspInfo; + std::vector radioBandModes; + std::vector networkInfos; + bool isNrDualConnectivityEnabled; + RadioAccessFamily networkTypeBitmapResponse; + RegStateResult regStateResp; + CellIdentity barringCellIdentity; + std::vector barringInfos; + + virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; + + virtual ndk::ScopedAStatus getAllowedNetworkTypesBitmapResponse( + const RadioResponseInfo& info, const RadioAccessFamily networkTypeBitmap) override; + + virtual ndk::ScopedAStatus getAvailableBandModesResponse( + const RadioResponseInfo& info, const std::vector& bandModes) override; + + virtual ndk::ScopedAStatus getAvailableNetworksResponse( + const RadioResponseInfo& info, const std::vector& networkInfos) override; + + virtual ndk::ScopedAStatus getBarringInfoResponse( + const RadioResponseInfo& info, const CellIdentity& cellIdentity, + const std::vector& barringInfos) override; + + virtual ndk::ScopedAStatus getCdmaRoamingPreferenceResponse(const RadioResponseInfo& info, + CdmaRoamingType type) override; + + virtual ndk::ScopedAStatus getCellInfoListResponse( + const RadioResponseInfo& info, const std::vector& cellInfo) override; + + virtual ndk::ScopedAStatus getDataRegistrationStateResponse( + const RadioResponseInfo& info, const RegStateResult& dataRegResponse) override; + + virtual ndk::ScopedAStatus getImsRegistrationStateResponse( + const RadioResponseInfo& info, bool isRegistered, + RadioTechnologyFamily ratFamily) override; + + virtual ndk::ScopedAStatus getNetworkSelectionModeResponse(const RadioResponseInfo& info, + bool manual) override; + + virtual ndk::ScopedAStatus getOperatorResponse(const RadioResponseInfo& info, + const std::string& longName, + const std::string& shortName, + const std::string& numeric) override; + + virtual ndk::ScopedAStatus getSignalStrengthResponse( + const RadioResponseInfo& info, const SignalStrength& sigStrength) override; + + virtual ndk::ScopedAStatus getSystemSelectionChannelsResponse( + const RadioResponseInfo& info, + const std::vector& specifier) override; + + virtual ndk::ScopedAStatus getUsageSettingResponse(const RadioResponseInfo& info, + UsageSetting usageSetting) override; + + virtual ndk::ScopedAStatus getVoiceRadioTechnologyResponse(const RadioResponseInfo& info, + RadioTechnology rat) override; + + virtual ndk::ScopedAStatus getVoiceRegistrationStateResponse( + const RadioResponseInfo& info, const RegStateResult& voiceRegResponse) override; + + virtual ndk::ScopedAStatus isNrDualConnectivityEnabledResponse(const RadioResponseInfo& info, + bool isEnabled) override; + + virtual ndk::ScopedAStatus setAllowedNetworkTypesBitmapResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setBandModeResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setBarringPasswordResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setCdmaRoamingPreferenceResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setCellInfoListRateResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setIndicationFilterResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setLinkCapacityReportingCriteriaResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setLocationUpdatesResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setNetworkSelectionModeAutomaticResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setNetworkSelectionModeManualResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setNrDualConnectivityStateResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setSignalStrengthReportingCriteriaResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setSuppServiceNotificationsResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setSystemSelectionChannelsResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setUsageSettingResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus startNetworkScanResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus stopNetworkScanResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus supplyNetworkDepersonalizationResponse( + const RadioResponseInfo& info, int32_t remainingRetries) override; +}; + +/* Callback class for radio network indication */ +class RadioNetworkIndication : public BnRadioNetworkIndication { + protected: + RadioNetworkTest& parent_network; + + public: + RadioNetworkIndication(RadioNetworkTest& parent_network); + virtual ~RadioNetworkIndication() = default; + + virtual ndk::ScopedAStatus barringInfoChanged( + RadioIndicationType type, const CellIdentity& cellIdentity, + const std::vector& barringInfos) override; + + virtual ndk::ScopedAStatus cdmaPrlChanged(RadioIndicationType type, int32_t version) override; + + virtual ndk::ScopedAStatus cellInfoList(RadioIndicationType type, + const std::vector& records) override; + + virtual ndk::ScopedAStatus currentLinkCapacityEstimate( + RadioIndicationType type, const LinkCapacityEstimate& lce) override; + + virtual ndk::ScopedAStatus currentPhysicalChannelConfigs( + RadioIndicationType type, const std::vector& configs) override; + + virtual ndk::ScopedAStatus currentSignalStrength(RadioIndicationType type, + const SignalStrength& signalStrength) override; + + virtual ndk::ScopedAStatus imsNetworkStateChanged(RadioIndicationType type) override; + + virtual ndk::ScopedAStatus networkScanResult(RadioIndicationType type, + const NetworkScanResult& result) override; + + virtual ndk::ScopedAStatus networkStateChanged(RadioIndicationType type) override; + + virtual ndk::ScopedAStatus nitzTimeReceived(RadioIndicationType type, + const std::string& nitzTime, int64_t receivedTimeMs, + int64_t ageMs) override; + + virtual ndk::ScopedAStatus registrationFailed(RadioIndicationType type, + const CellIdentity& cellIdentity, + const std::string& chosenPlmn, Domain domain, + int32_t causeCode, + int32_t additionalCauseCode) override; + + virtual ndk::ScopedAStatus restrictedStateChanged(RadioIndicationType type, + PhoneRestrictedState state) override; + + virtual ndk::ScopedAStatus suppSvcNotify(RadioIndicationType type, + const SuppSvcNotification& suppSvc) override; + + virtual ndk::ScopedAStatus voiceRadioTechChanged(RadioIndicationType type, + RadioTechnology rat) override; +}; + +// The main test class for Radio AIDL Network. +class RadioNetworkTest : public ::testing::TestWithParam, public RadioResponseWaiter { + public: + virtual void SetUp() override; + + /* radio network service handle */ + std::shared_ptr radio_network; + /* radio network response handle */ + std::shared_ptr radioRsp_network; + /* radio network indication handle */ + std::shared_ptr radioInd_network; +}; diff --git a/radio/aidl/vts/radio_sim_indication.cpp b/radio/aidl/vts/radio_sim_indication.cpp new file mode 100644 index 0000000000..03858458b1 --- /dev/null +++ b/radio/aidl/vts/radio_sim_indication.cpp @@ -0,0 +1,71 @@ +/* + * 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 "radio_sim_utils.h" + +RadioSimIndication::RadioSimIndication(RadioSimTest& parent) : parent_sim(parent) {} + +ndk::ScopedAStatus RadioSimIndication::carrierInfoForImsiEncryption(RadioIndicationType /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimIndication::cdmaSubscriptionSourceChanged( + RadioIndicationType /*type*/, CdmaSubscriptionSource /*cdmaSource*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimIndication::simPhonebookChanged(RadioIndicationType /*type*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimIndication::simPhonebookRecordsReceived( + RadioIndicationType /*type*/, PbReceivedStatus /*status*/, + const std::vector& /*records*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimIndication::simRefresh(RadioIndicationType /*type*/, + const SimRefreshResult& /*refreshResult*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimIndication::simStatusChanged(RadioIndicationType /*type*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimIndication::stkEventNotify(RadioIndicationType /*type*/, + const std::string& /*cmd*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimIndication::stkProactiveCommand(RadioIndicationType /*type*/, + const std::string& /*cmd*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimIndication::stkSessionEnd(RadioIndicationType /*type*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimIndication::subscriptionStatusChanged(RadioIndicationType /*type*/, + bool /*activate*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimIndication::uiccApplicationsEnablementChanged( + RadioIndicationType /*type*/, bool /*enabled*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_sim_response.cpp b/radio/aidl/vts/radio_sim_response.cpp new file mode 100644 index 0000000000..2c796faa12 --- /dev/null +++ b/radio/aidl/vts/radio_sim_response.cpp @@ -0,0 +1,209 @@ +/* + * 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 "radio_sim_utils.h" + +RadioSimResponse::RadioSimResponse(RadioResponseWaiter& parent) : parent_sim(parent) {} + +ndk::ScopedAStatus RadioSimResponse::acknowledgeRequest(int32_t /*serial*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::areUiccApplicationsEnabledResponse( + const RadioResponseInfo& /*info*/, bool /*enabled*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::changeIccPin2ForAppResponse(const RadioResponseInfo& /*info*/, + int32_t /*remainingRetries*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::changeIccPinForAppResponse(const RadioResponseInfo& /*info*/, + int32_t /*remainingRetries*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::enableUiccApplicationsResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::getAllowedCarriersResponse( + const RadioResponseInfo& /*info*/, const CarrierRestrictions& /*carriers*/, + SimLockMultiSimPolicy /*multiSimPolicy*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::getCdmaSubscriptionResponse( + const RadioResponseInfo& /*info*/, const std::string& /*mdn*/, const std::string& /*hSid*/, + const std::string& /*hNid*/, const std::string& /*min*/, const std::string& /*prl*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::getCdmaSubscriptionSourceResponse( + const RadioResponseInfo& /*info*/, CdmaSubscriptionSource /*source*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::getFacilityLockForAppResponse( + const RadioResponseInfo& /*info*/, int32_t /*response*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::getIccCardStatusResponse(const RadioResponseInfo& info, + const CardStatus& card_status) { + rspInfo = info; + cardStatus = card_status; + parent_sim.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::getImsiForAppResponse(const RadioResponseInfo& /*info*/, + const std::string& /*imsi*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::getSimPhonebookCapacityResponse( + const RadioResponseInfo& info, const PhonebookCapacity& pbCapacity) { + rspInfo = info; + capacity = pbCapacity; + parent_sim.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::getSimPhonebookRecordsResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_sim.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::iccCloseLogicalChannelResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::iccIoForAppResponse(const RadioResponseInfo& /*info*/, + const IccIoResult& /*iccIo*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::iccOpenLogicalChannelResponse( + const RadioResponseInfo& /*info*/, int32_t /*channelId*/, + const std::vector& /*selectResponse*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::iccTransmitApduBasicChannelResponse( + const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::iccTransmitApduLogicalChannelResponse( + const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::reportStkServiceIsRunningResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::requestIccSimAuthenticationResponse( + const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::sendEnvelopeResponse(const RadioResponseInfo& /*info*/, + const std::string& /*commandResponse*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::sendEnvelopeWithStatusResponse( + const RadioResponseInfo& /*info*/, const IccIoResult& /*iccIo*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::sendTerminalResponseToSimResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::setAllowedCarriersResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::setCarrierInfoForImsiEncryptionResponse( + const RadioResponseInfo& info) { + rspInfo = info; + parent_sim.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::setCdmaSubscriptionSourceResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::setFacilityLockForAppResponse( + const RadioResponseInfo& /*info*/, int32_t /*retry*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::setSimCardPowerResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_sim.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::setUiccSubscriptionResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::supplyIccPin2ForAppResponse(const RadioResponseInfo& /*info*/, + int32_t /*remainingRetries*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::supplyIccPinForAppResponse(const RadioResponseInfo& /*info*/, + int32_t /*remainingRetries*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::supplyIccPuk2ForAppResponse(const RadioResponseInfo& /*info*/, + int32_t /*remainingRetries*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::supplyIccPukForAppResponse(const RadioResponseInfo& /*info*/, + int32_t /*remainingRetries*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::supplySimDepersonalizationResponse( + const RadioResponseInfo& /*info*/, PersoSubstate /*persoType*/, + int32_t /*remainingRetries*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioSimResponse::updateSimPhonebookRecordsResponse( + const RadioResponseInfo& info, int32_t recordIndex) { + rspInfo = info; + updatedRecordIndex = recordIndex; + parent_sim.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp new file mode 100644 index 0000000000..c70219ff94 --- /dev/null +++ b/radio/aidl/vts/radio_sim_test.cpp @@ -0,0 +1,259 @@ +/* + * 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 +#include +#include + +#include "radio_sim_utils.h" + +#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) + +void RadioSimTest::SetUp() { + std::string serviceName = GetParam(); + + if (!isServiceValidForDeviceConfiguration(serviceName)) { + ALOGI("Skipped the test due to device configuration."); + GTEST_SKIP(); + } + + radio_sim = IRadioSim::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); + ASSERT_NE(nullptr, radio_sim.get()); + + radioRsp_sim = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioRsp_sim.get()); + + count_ = 0; + + radioInd_sim = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioInd_sim.get()); + + radio_sim->setResponseFunctions(radioRsp_sim, radioInd_sim); + + // Assert IRadioConfig exists before testing + std::shared_ptr radioConfig = + aidl::android::hardware::radio::config::IRadioConfig::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService( + "android.hardware.radio.config.IRadioConfig/default"))); + ASSERT_NE(nullptr, radioConfig.get()); +} + +ndk::ScopedAStatus RadioSimTest::updateSimCardStatus() { + serial = GetRandomSerialNumber(); + radio_sim->getIccCardStatus(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + return ndk::ScopedAStatus::ok(); +} + +/* + * Test IRadioSim.setSimCardPower() for the response returned. + */ +TEST_P(RadioSimTest, setSimCardPower) { + /* Test setSimCardPower power down */ + serial = GetRandomSerialNumber(); + radio_sim->setSimCardPower(serial, CardPowerState::POWER_DOWN); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, + RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ERR})); + + // setSimCardPower does not return until the request is handled, and should not trigger + // CardStatus::STATE_ABSENT when turning off power + if (radioRsp_sim->rspInfo.error == RadioError::NONE) { + /* Wait some time for setting sim power down and then verify it */ + updateSimCardStatus(); + // We cannot assert the consistency of CardState here due to b/203031664 + // EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState); + // applications should be an empty vector of AppStatus + EXPECT_EQ(0, cardStatus.applications.size()); + } + + // Give some time for modem to fully power down the SIM card + sleep(MODEM_SET_SIM_POWER_DELAY_IN_SECONDS); + + /* Test setSimCardPower power up */ + serial = GetRandomSerialNumber(); + radio_sim->setSimCardPower(serial, CardPowerState::POWER_UP); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, + RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ERR})); + + // Give some time for modem to fully power up the SIM card + sleep(MODEM_SET_SIM_POWER_DELAY_IN_SECONDS); + + // setSimCardPower does not return until the request is handled. Just verify that we still + // have CardStatus::STATE_PRESENT after turning the power back on + if (radioRsp_sim->rspInfo.error == RadioError::NONE) { + updateSimCardStatus(); + EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState); + } +} + +/* + * Test IRadioSim.setCarrierInfoForImsiEncryption() for the response returned. + */ +TEST_P(RadioSimTest, setCarrierInfoForImsiEncryption) { + serial = GetRandomSerialNumber(); + ImsiEncryptionInfo imsiInfo; + imsiInfo.mcc = "310"; + imsiInfo.mnc = "004"; + imsiInfo.carrierKey = (std::vector){1, 2, 3, 4, 5, 6}; + imsiInfo.keyIdentifier = "Test"; + imsiInfo.expirationTime = 20180101; + imsiInfo.keyType = ImsiEncryptionInfo::PUBLIC_KEY_TYPE_EPDG; + + radio_sim->setCarrierInfoForImsiEncryption(serial, imsiInfo); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); + } +} + +/* + * Test IRadioSim.getSimPhonebookRecords() for the response returned. + */ +TEST_P(RadioSimTest, getSimPhonebookRecords) { + serial = GetRandomSerialNumber(); + radio_sim->getSimPhonebookRecords(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE( + CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::INVALID_SIM_STATE, RadioError::RADIO_NOT_AVAILABLE, + RadioError::MODEM_ERR, RadioError::INVALID_ARGUMENTS, + RadioError::REQUEST_NOT_SUPPORTED}, + CHECK_GENERAL_ERROR)); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}, + CHECK_GENERAL_ERROR)); + } +} + +/* + * Test IRadioSim.getSimPhonebookCapacity for the response returned. + */ +TEST_P(RadioSimTest, getSimPhonebookCapacity) { + serial = GetRandomSerialNumber(); + radio_sim->getSimPhonebookCapacity(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE( + CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::INVALID_SIM_STATE, RadioError::RADIO_NOT_AVAILABLE, + RadioError::MODEM_ERR, RadioError::INVALID_ARGUMENTS, + RadioError::REQUEST_NOT_SUPPORTED}, + CHECK_GENERAL_ERROR)); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}, + CHECK_GENERAL_ERROR)); + + PhonebookCapacity pbCapacity = radioRsp_sim->capacity; + if (pbCapacity.maxAdnRecords > 0) { + EXPECT_TRUE(pbCapacity.maxNameLen > 0 && pbCapacity.maxNumberLen > 0); + EXPECT_TRUE(pbCapacity.usedAdnRecords <= pbCapacity.maxAdnRecords); + } + + if (pbCapacity.maxEmailRecords > 0) { + EXPECT_TRUE(pbCapacity.maxEmailLen > 0); + EXPECT_TRUE(pbCapacity.usedEmailRecords <= pbCapacity.maxEmailRecords); + } + + if (pbCapacity.maxAdditionalNumberRecords > 0) { + EXPECT_TRUE(pbCapacity.maxAdditionalNumberLen > 0); + EXPECT_TRUE(pbCapacity.usedAdditionalNumberRecords <= + pbCapacity.maxAdditionalNumberRecords); + } + } +} + +/* + * Test IRadioSim.updateSimPhonebookRecords() for the response returned. + */ +TEST_P(RadioSimTest, updateSimPhonebookRecords) { + serial = GetRandomSerialNumber(); + radio_sim->getSimPhonebookCapacity(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE( + CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::INVALID_SIM_STATE, RadioError::RADIO_NOT_AVAILABLE, + RadioError::MODEM_ERR, RadioError::INVALID_ARGUMENTS, + RadioError::REQUEST_NOT_SUPPORTED}, + CHECK_GENERAL_ERROR)); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}, + CHECK_GENERAL_ERROR)); + PhonebookCapacity pbCapacity = radioRsp_sim->capacity; + + serial = GetRandomSerialNumber(); + radio_sim->getSimPhonebookRecords(serial); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}, + CHECK_GENERAL_ERROR)); + + if (pbCapacity.maxAdnRecords > 0 && pbCapacity.usedAdnRecords < pbCapacity.maxAdnRecords) { + // Add a phonebook record + PhonebookRecordInfo recordInfo; + recordInfo.recordId = 0; + recordInfo.name = "ABC"; + recordInfo.number = "1234567890"; + serial = GetRandomSerialNumber(); + radio_sim->updateSimPhonebookRecords(serial, recordInfo); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error); + int index = radioRsp_sim->updatedRecordIndex; + EXPECT_TRUE(index > 0); + + // Deleted a phonebook record + recordInfo.recordId = index; + recordInfo.name = ""; + recordInfo.number = ""; + serial = GetRandomSerialNumber(); + radio_sim->updateSimPhonebookRecords(serial, recordInfo); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error); + } + } +} diff --git a/radio/aidl/vts/radio_sim_utils.h b/radio/aidl/vts/radio_sim_utils.h new file mode 100644 index 0000000000..6cb6790453 --- /dev/null +++ b/radio/aidl/vts/radio_sim_utils.h @@ -0,0 +1,207 @@ +/* + * 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 +#include +#include + +#include "radio_aidl_hal_utils.h" + +using namespace aidl::android::hardware::radio::sim; + +class RadioSimTest; + +/* Callback class for radio SIM response */ +class RadioSimResponse : public BnRadioSimResponse { + protected: + RadioResponseWaiter& parent_sim; + + public: + RadioSimResponse(RadioResponseWaiter& parent_sim); + virtual ~RadioSimResponse() = default; + + RadioResponseInfo rspInfo; + CarrierRestrictions carrierRestrictionsResp; + SimLockMultiSimPolicy multiSimPolicyResp; + bool canToggleUiccApplicationsEnablement; + bool areUiccApplicationsEnabled; + PhonebookCapacity capacity; + int32_t updatedRecordIndex; + + virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; + + virtual ndk::ScopedAStatus areUiccApplicationsEnabledResponse(const RadioResponseInfo& info, + bool enabled) override; + + virtual ndk::ScopedAStatus changeIccPin2ForAppResponse(const RadioResponseInfo& info, + int32_t remainingRetries) override; + + virtual ndk::ScopedAStatus changeIccPinForAppResponse(const RadioResponseInfo& info, + int32_t remainingRetries) override; + + virtual ndk::ScopedAStatus enableUiccApplicationsResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus getAllowedCarriersResponse( + const RadioResponseInfo& info, const CarrierRestrictions& carriers, + const SimLockMultiSimPolicy multiSimPolicy) override; + + virtual ndk::ScopedAStatus getCdmaSubscriptionResponse( + const RadioResponseInfo& info, const std::string& mdn, const std::string& hSid, + const std::string& hNid, const std::string& min, const std::string& prl) override; + + virtual ndk::ScopedAStatus getCdmaSubscriptionSourceResponse( + const RadioResponseInfo& info, CdmaSubscriptionSource source) override; + + virtual ndk::ScopedAStatus getFacilityLockForAppResponse(const RadioResponseInfo& info, + int32_t response) override; + + virtual ndk::ScopedAStatus getIccCardStatusResponse(const RadioResponseInfo& info, + const CardStatus& cardStatus) override; + + virtual ndk::ScopedAStatus getImsiForAppResponse(const RadioResponseInfo& info, + const std::string& imsi) override; + + virtual ndk::ScopedAStatus getSimPhonebookCapacityResponse( + const RadioResponseInfo& info, const PhonebookCapacity& capacity) override; + + virtual ndk::ScopedAStatus getSimPhonebookRecordsResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus iccCloseLogicalChannelResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus iccIoForAppResponse(const RadioResponseInfo& info, + const IccIoResult& iccIo) override; + + virtual ndk::ScopedAStatus iccOpenLogicalChannelResponse( + const RadioResponseInfo& info, int32_t channelId, + const std::vector& selectResponse) override; + + virtual ndk::ScopedAStatus iccTransmitApduBasicChannelResponse( + const RadioResponseInfo& info, const IccIoResult& result) override; + + virtual ndk::ScopedAStatus iccTransmitApduLogicalChannelResponse( + const RadioResponseInfo& info, const IccIoResult& result) override; + + virtual ndk::ScopedAStatus reportStkServiceIsRunningResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus requestIccSimAuthenticationResponse( + const RadioResponseInfo& info, const IccIoResult& result) override; + + virtual ndk::ScopedAStatus sendEnvelopeResponse(const RadioResponseInfo& info, + const std::string& commandResponse) override; + + virtual ndk::ScopedAStatus sendEnvelopeWithStatusResponse(const RadioResponseInfo& info, + const IccIoResult& iccIo) override; + + virtual ndk::ScopedAStatus sendTerminalResponseToSimResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setAllowedCarriersResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setCarrierInfoForImsiEncryptionResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setCdmaSubscriptionSourceResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setFacilityLockForAppResponse(const RadioResponseInfo& info, + int32_t retry) override; + + virtual ndk::ScopedAStatus setSimCardPowerResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setUiccSubscriptionResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus supplyIccPin2ForAppResponse(const RadioResponseInfo& info, + int32_t remainingRetries) override; + + virtual ndk::ScopedAStatus supplyIccPinForAppResponse(const RadioResponseInfo& info, + int32_t remainingRetries) override; + + virtual ndk::ScopedAStatus supplyIccPuk2ForAppResponse(const RadioResponseInfo& info, + int32_t remainingRetries) override; + + virtual ndk::ScopedAStatus supplyIccPukForAppResponse(const RadioResponseInfo& info, + int32_t remainingRetries) override; + + virtual ndk::ScopedAStatus supplySimDepersonalizationResponse( + const RadioResponseInfo& info, PersoSubstate persoType, + int32_t remainingRetries) override; + + virtual ndk::ScopedAStatus updateSimPhonebookRecordsResponse( + const RadioResponseInfo& info, int32_t updatedRecordIndex) override; +}; + +/* Callback class for radio SIM indication */ +class RadioSimIndication : public BnRadioSimIndication { + protected: + RadioSimTest& parent_sim; + + public: + RadioSimIndication(RadioSimTest& parent_sim); + virtual ~RadioSimIndication() = default; + + virtual ndk::ScopedAStatus carrierInfoForImsiEncryption(RadioIndicationType info) override; + + virtual ndk::ScopedAStatus cdmaSubscriptionSourceChanged( + RadioIndicationType type, CdmaSubscriptionSource cdmaSource) override; + + virtual ndk::ScopedAStatus simPhonebookChanged(RadioIndicationType type) override; + + virtual ndk::ScopedAStatus simPhonebookRecordsReceived( + RadioIndicationType type, PbReceivedStatus status, + const std::vector& records) override; + + virtual ndk::ScopedAStatus simRefresh(RadioIndicationType type, + const SimRefreshResult& refreshResult) override; + + virtual ndk::ScopedAStatus simStatusChanged(RadioIndicationType type) override; + + virtual ndk::ScopedAStatus stkEventNotify(RadioIndicationType type, + const std::string& cmd) override; + + virtual ndk::ScopedAStatus stkProactiveCommand(RadioIndicationType type, + const std::string& cmd) override; + + virtual ndk::ScopedAStatus stkSessionEnd(RadioIndicationType type) override; + + virtual ndk::ScopedAStatus subscriptionStatusChanged(RadioIndicationType type, + bool activate) override; + + virtual ndk::ScopedAStatus uiccApplicationsEnablementChanged(RadioIndicationType type, + bool enabled) override; +}; + +// The main test class for Radio AIDL SIM. +class RadioSimTest : public ::testing::TestWithParam, public RadioResponseWaiter { + protected: + /* Update Sim Card Status */ + virtual ndk::ScopedAStatus updateSimCardStatus(); + + public: + virtual void SetUp() override; + + /* radio SIM service handle */ + std::shared_ptr radio_sim; + /* radio SIM response handle */ + std::shared_ptr radioRsp_sim; + /* radio SIM indication handle */ + std::shared_ptr radioInd_sim; +}; diff --git a/radio/aidl/vts/radio_voice_indication.cpp b/radio/aidl/vts/radio_voice_indication.cpp new file mode 100644 index 0000000000..2c468174e8 --- /dev/null +++ b/radio/aidl/vts/radio_voice_indication.cpp @@ -0,0 +1,85 @@ +/* + * 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 "radio_voice_utils.h" + +RadioVoiceIndication::RadioVoiceIndication(RadioVoiceTest& parent) : parent_voice(parent) {} + +ndk::ScopedAStatus RadioVoiceIndication::callRing(RadioIndicationType /*type*/, bool /*isGsm*/, + const CdmaSignalInfoRecord& /*record*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceIndication::callStateChanged(RadioIndicationType /*type*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceIndication::cdmaCallWaiting( + RadioIndicationType /*type*/, const CdmaCallWaiting& /*callWaitingRecord*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceIndication::cdmaInfoRec( + RadioIndicationType /*type*/, const std::vector& /*records*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceIndication::cdmaOtaProvisionStatus(RadioIndicationType /*type*/, + CdmaOtaProvisionStatus /*status*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceIndication::currentEmergencyNumberList( + RadioIndicationType /*type*/, const std::vector& /*emergencyNumberList*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceIndication::enterEmergencyCallbackMode(RadioIndicationType /*type*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceIndication::exitEmergencyCallbackMode(RadioIndicationType /*type*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceIndication::indicateRingbackTone(RadioIndicationType /*type*/, + bool /*start*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceIndication::onSupplementaryServiceIndication( + RadioIndicationType /*type*/, const StkCcUnsolSsResult& /*ss*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceIndication::resendIncallMute(RadioIndicationType /*type*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceIndication::srvccStateNotify(RadioIndicationType /*type*/, + SrvccState /*state*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceIndication::stkCallControlAlphaNotify(RadioIndicationType /*type*/, + const std::string& /*alpha*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceIndication::stkCallSetup(RadioIndicationType /*type*/, + int64_t /*timeout*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_voice_response.cpp b/radio/aidl/vts/radio_voice_response.cpp new file mode 100644 index 0000000000..ca350c6660 --- /dev/null +++ b/radio/aidl/vts/radio_voice_response.cpp @@ -0,0 +1,191 @@ +/* + * 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 "radio_voice_utils.h" + +RadioVoiceResponse::RadioVoiceResponse(RadioResponseWaiter& parent) : parent_voice(parent) {} + +ndk::ScopedAStatus RadioVoiceResponse::acceptCallResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::acknowledgeRequest(int32_t /*serial*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::conferenceResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::dialResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::emergencyDialResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::exitEmergencyCallbackModeResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::explicitCallTransferResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::getCallForwardStatusResponse( + const RadioResponseInfo& /*info*/, + const std::vector& /*callForwardInfos*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::getCallWaitingResponse(const RadioResponseInfo& /*info*/, + bool /*enable*/, + int32_t /*serviceClass*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::getClipResponse(const RadioResponseInfo& /*info*/, + ClipStatus /*status*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::getClirResponse(const RadioResponseInfo& /*info*/, + int32_t /*n*/, int32_t /*m*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::getCurrentCallsResponse(const RadioResponseInfo& info, + const std::vector& calls) { + rspInfo = info; + currentCalls = calls; + parent_voice.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::getLastCallFailCauseResponse( + const RadioResponseInfo& /*info*/, const LastCallFailCauseInfo& /*failCauseInfo*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::getMuteResponse(const RadioResponseInfo& /*info*/, + bool /*enable*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::getPreferredVoicePrivacyResponse( + const RadioResponseInfo& /*info*/, bool /*enable*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::getTtyModeResponse(const RadioResponseInfo& /*info*/, + TtyMode /*mode*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::handleStkCallSetupRequestFromSimResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::hangupConnectionResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::hangupForegroundResumeBackgroundResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::hangupWaitingOrBackgroundResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::isVoNrEnabledResponse(const RadioResponseInfo& /*info*/, + bool /*enabled*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::rejectCallResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::sendBurstDtmfResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::sendCdmaFeatureCodeResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::sendDtmfResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::separateConnectionResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::setCallForwardResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::setCallWaitingResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::setClirResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::setMuteResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::setPreferredVoicePrivacyResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::setTtyModeResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::setVoNrEnabledResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::startDtmfResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::stopDtmfResponse(const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioVoiceResponse::switchWaitingOrHoldingAndActiveResponse( + const RadioResponseInfo& /*info*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_voice_test.cpp b/radio/aidl/vts/radio_voice_test.cpp new file mode 100644 index 0000000000..201f14c2d9 --- /dev/null +++ b/radio/aidl/vts/radio_voice_test.cpp @@ -0,0 +1,261 @@ +/* + * 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 +#include +#include + +#include "radio_voice_utils.h" + +#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) + +void RadioVoiceTest::SetUp() { + std::string serviceName = GetParam(); + + if (!isServiceValidForDeviceConfiguration(serviceName)) { + ALOGI("Skipped the test due to device configuration."); + GTEST_SKIP(); + } + + radio_voice = IRadioVoice::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); + ASSERT_NE(nullptr, radio_voice.get()); + + radioRsp_voice = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioRsp_voice.get()); + + count_ = 0; + + radioInd_voice = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioInd_voice.get()); + + radio_voice->setResponseFunctions(radioRsp_voice, radioInd_voice); + + // Assert IRadioConfig exists before testing + std::shared_ptr radioConfig = + aidl::android::hardware::radio::config::IRadioConfig::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService( + "android.hardware.radio.config.IRadioConfig/default"))); + ASSERT_NE(nullptr, radioConfig.get()); +} + +ndk::ScopedAStatus RadioVoiceTest::clearPotentialEstablishedCalls() { + // Get the current call Id to hangup the established emergency call. + serial = GetRandomSerialNumber(); + radio_voice->getCurrentCalls(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + + // Hang up to disconnect the established call channels. + for (const Call& call : radioRsp_voice->currentCalls) { + serial = GetRandomSerialNumber(); + radio_voice->hangup(serial, call.index); + ALOGI("Hang up to disconnect the established call channel: %d", call.index); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + // Give some time for modem to disconnect the established call channel. + sleep(MODEM_EMERGENCY_CALL_DISCONNECT_TIME); + } + + // Verify there are no more current calls. + serial = GetRandomSerialNumber(); + radio_voice->getCurrentCalls(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(0, radioRsp_voice->currentCalls.size()); + return ndk::ScopedAStatus::ok(); +} + +/* + * 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; + } else { + ALOGI("Running emergencyDial because voice call is supported in device"); + } + + serial = GetRandomSerialNumber(); + + Dial dialInfo; + dialInfo.address = std::string("911"); + EmergencyServiceCategory categories = EmergencyServiceCategory::UNSPECIFIED; + std::vector urns = {""}; + EmergencyCallRouting routing = EmergencyCallRouting::UNKNOWN; + + ndk::ScopedAStatus res = + radio_voice->emergencyDial(serial, dialInfo, categories, urns, routing, true, true); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + ALOGI("emergencyDial, rspInfo.error = %s\n", toString(radioRsp_voice->rspInfo.error).c_str()); + + RadioError rspEmergencyDial = radioRsp_voice->rspInfo.error; + // In DSDS or TSTS, we only check the result if the current slot is IN_SERVICE + // or Emergency_Only. + if (isDsDsEnabled() || isTsTsEnabled()) { + // TODO(b/210712359): maybe create a local RadioNetwork instance + /** + serial = GetRandomSerialNumber(); + radio_v1_6->getVoiceRegistrationState(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + if (isVoiceEmergencyOnly(radioRsp_v1_6->voiceRegResp.regState) || + isVoiceInService(radioRsp_v1_6->voiceRegResp.regState)) { + EXPECT_EQ(RadioError::NONE, rspEmergencyDial); + } + **/ + } else { + EXPECT_EQ(RadioError::NONE, rspEmergencyDial); + } + + // Give some time for modem to establish the emergency call channel. + sleep(MODEM_EMERGENCY_CALL_ESTABLISH_TIME); + + // Disconnect all the potential established calls to prevent them affecting other tests. + clearPotentialEstablishedCalls(); +} + +/* + * 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; + } else { + ALOGI("Running emergencyDial because voice call is supported in device"); + } + + serial = GetRandomSerialNumber(); + + Dial dialInfo; + dialInfo.address = std::string("911"); + EmergencyServiceCategory categories = EmergencyServiceCategory::AMBULANCE; + std::vector urns = {"urn:service:sos.ambulance"}; + EmergencyCallRouting routing = EmergencyCallRouting::UNKNOWN; + + ndk::ScopedAStatus res = + radio_voice->emergencyDial(serial, dialInfo, categories, urns, routing, true, true); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + ALOGI("emergencyDial_withServices, rspInfo.error = %s\n", + toString(radioRsp_voice->rspInfo.error).c_str()); + RadioError rspEmergencyDial = radioRsp_voice->rspInfo.error; + + // In DSDS or TSTS, we only check the result if the current slot is IN_SERVICE + // or Emergency_Only. + if (isDsDsEnabled() || isTsTsEnabled()) { + // TODO(b/210712359): maybe create a local RadioNetwork instance + /** + serial = GetRandomSerialNumber(); + radio_v1_6->getVoiceRegistrationState_1_6(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + if (isVoiceEmergencyOnly(radioRsp_v1_6->voiceRegResp.regState) || + isVoiceInService(radioRsp_v1_6->voiceRegResp.regState)) { + EXPECT_EQ(RadioError::NONE, rspEmergencyDial); + } + **/ + } else { + EXPECT_EQ(RadioError::NONE, rspEmergencyDial); + } + // Give some time for modem to establish the emergency call channel. + sleep(MODEM_EMERGENCY_CALL_ESTABLISH_TIME); + + // Disconnect all the potential established calls to prevent them affecting other tests. + clearPotentialEstablishedCalls(); +} + +/* + * 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; + } else { + ALOGI("Running emergencyDial because voice call is supported in device"); + } + + serial = GetRandomSerialNumber(); + + Dial dialInfo; + dialInfo.address = std::string("911"); + EmergencyServiceCategory categories = EmergencyServiceCategory::UNSPECIFIED; + std::vector urns = {""}; + EmergencyCallRouting routing = EmergencyCallRouting::EMERGENCY; + + ndk::ScopedAStatus res = + radio_voice->emergencyDial(serial, dialInfo, categories, urns, routing, true, true); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + ALOGI("emergencyDial_withEmergencyRouting, rspInfo.error = %s\n", + toString(radioRsp_voice->rspInfo.error).c_str()); + RadioError rspEmergencyDial = radioRsp_voice->rspInfo.error; + + // In DSDS or TSTS, we only check the result if the current slot is IN_SERVICE + // or Emergency_Only. + if (isDsDsEnabled() || isTsTsEnabled()) { + // TODO(b/210712359): maybe create a local RadioNetwork instance + /** + serial = GetRandomSerialNumber(); + radio_v1_6->getVoiceRegistrationState_1_6(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + if (isVoiceEmergencyOnly(radioRsp_v1_6->voiceRegResp.regState) || + isVoiceInService(radioRsp_v1_6->voiceRegResp.regState)) { + EXPECT_EQ(RadioError::NONE, rspEmergencyDial); + } + **/ + } else { + EXPECT_EQ(RadioError::NONE, rspEmergencyDial); + } + + // Give some time for modem to establish the emergency call channel. + sleep(MODEM_EMERGENCY_CALL_ESTABLISH_TIME); + + // Disconnect all the potential established calls to prevent them affecting other tests. + clearPotentialEstablishedCalls(); +} + +/* + * Test IRadioVoice.getCurrentCalls() for the response returned. + */ +TEST_P(RadioVoiceTest, getCurrentCalls) { + serial = GetRandomSerialNumber(); + radio_voice->getCurrentCalls(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error); +} diff --git a/radio/aidl/vts/radio_voice_utils.h b/radio/aidl/vts/radio_voice_utils.h new file mode 100644 index 0000000000..a676a7fcbb --- /dev/null +++ b/radio/aidl/vts/radio_voice_utils.h @@ -0,0 +1,192 @@ +/* + * 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 +#include +#include + +#include "radio_aidl_hal_utils.h" + +using namespace aidl::android::hardware::radio::voice; + +class RadioVoiceTest; + +/* Callback class for radio voice response */ +class RadioVoiceResponse : public BnRadioVoiceResponse { + protected: + RadioResponseWaiter& parent_voice; + + public: + RadioVoiceResponse(RadioResponseWaiter& parent_voice); + virtual ~RadioVoiceResponse() = default; + + RadioResponseInfo rspInfo; + std::vector currentCalls; + + virtual ndk::ScopedAStatus acceptCallResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; + + virtual ndk::ScopedAStatus conferenceResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus dialResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus emergencyDialResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus exitEmergencyCallbackModeResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus explicitCallTransferResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus getCallForwardStatusResponse( + const RadioResponseInfo& info, + const std::vector& call_forwardInfos) override; + + virtual ndk::ScopedAStatus getCallWaitingResponse(const RadioResponseInfo& info, bool enable, + int32_t serviceClass) override; + + virtual ndk::ScopedAStatus getClipResponse(const RadioResponseInfo& info, + ClipStatus status) override; + + virtual ndk::ScopedAStatus getClirResponse(const RadioResponseInfo& info, int32_t n, + int32_t m) override; + + virtual ndk::ScopedAStatus getCurrentCallsResponse(const RadioResponseInfo& info, + const std::vector& calls) override; + + virtual ndk::ScopedAStatus getLastCallFailCauseResponse( + const RadioResponseInfo& info, const LastCallFailCauseInfo& failCauseInfo) override; + + virtual ndk::ScopedAStatus getMuteResponse(const RadioResponseInfo& info, bool enable) override; + + virtual ndk::ScopedAStatus getPreferredVoicePrivacyResponse(const RadioResponseInfo& info, + bool enable) override; + + virtual ndk::ScopedAStatus getTtyModeResponse(const RadioResponseInfo& info, + TtyMode mode) override; + + virtual ndk::ScopedAStatus handleStkCallSetupRequestFromSimResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus hangupConnectionResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus hangupForegroundResumeBackgroundResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus hangupWaitingOrBackgroundResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus isVoNrEnabledResponse(const RadioResponseInfo& info, + bool enable) override; + + virtual ndk::ScopedAStatus rejectCallResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus sendBurstDtmfResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus sendCdmaFeatureCodeResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus sendDtmfResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus separateConnectionResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setCallForwardResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setCallWaitingResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setClirResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setMuteResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setPreferredVoicePrivacyResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setTtyModeResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setVoNrEnabledResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus startDtmfResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus stopDtmfResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus switchWaitingOrHoldingAndActiveResponse( + const RadioResponseInfo& info) override; +}; + +/* Callback class for radio voice indication */ +class RadioVoiceIndication : public BnRadioVoiceIndication { + protected: + RadioVoiceTest& parent_voice; + + public: + RadioVoiceIndication(RadioVoiceTest& parent_voice); + virtual ~RadioVoiceIndication() = default; + + virtual ndk::ScopedAStatus callRing(RadioIndicationType type, bool isGsm, + const CdmaSignalInfoRecord& record) override; + + virtual ndk::ScopedAStatus callStateChanged(RadioIndicationType type) override; + + virtual ndk::ScopedAStatus cdmaCallWaiting(RadioIndicationType type, + const CdmaCallWaiting& callWaitingRecord) override; + + virtual ndk::ScopedAStatus cdmaInfoRec( + RadioIndicationType type, const std::vector& records) override; + + virtual ndk::ScopedAStatus cdmaOtaProvisionStatus(RadioIndicationType type, + CdmaOtaProvisionStatus status) override; + + virtual ndk::ScopedAStatus currentEmergencyNumberList( + RadioIndicationType type, + const std::vector& emergencyNumberList) override; + + virtual ndk::ScopedAStatus enterEmergencyCallbackMode(RadioIndicationType type) override; + + virtual ndk::ScopedAStatus exitEmergencyCallbackMode(RadioIndicationType type) override; + + virtual ndk::ScopedAStatus indicateRingbackTone(RadioIndicationType type, bool start) override; + + virtual ndk::ScopedAStatus onSupplementaryServiceIndication( + RadioIndicationType type, const StkCcUnsolSsResult& ss) override; + + virtual ndk::ScopedAStatus resendIncallMute(RadioIndicationType type) override; + + virtual ndk::ScopedAStatus srvccStateNotify(RadioIndicationType type, + SrvccState state) override; + + virtual ndk::ScopedAStatus stkCallControlAlphaNotify(RadioIndicationType type, + const std::string& alpha) override; + + virtual ndk::ScopedAStatus stkCallSetup(RadioIndicationType type, int64_t timeout) override; +}; + +// The main test class for Radio AIDL Voice. +class RadioVoiceTest : public ::testing::TestWithParam, public RadioResponseWaiter { + protected: + /* Clear Potential Established Calls */ + virtual ndk::ScopedAStatus clearPotentialEstablishedCalls(); + + public: + virtual void SetUp() override; + + /* radio voice service handle */ + std::shared_ptr radio_voice; + /* radio voice response handle */ + std::shared_ptr radioRsp_voice; + /* radio voice indication handle */ + std::shared_ptr radioInd_voice; +}; -- GitLab From 244423c76b4afe649eec4194ced19a36c5c66472 Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Wed, 22 Dec 2021 13:27:36 -0800 Subject: [PATCH 355/825] VTS for UsageSetting Add tests to check that usage setting can be retrived and set as well as ensuring that invalid values cannot be set. Bug: 205595503 Test: make VtsHalRadioTargetTest Change-Id: I26a68d4b6be4810fab9302b58a3be7f65fc82c83 --- radio/aidl/vts/radio_network_response.cpp | 12 ++- radio/aidl/vts/radio_network_test.cpp | 112 +++++++++++++++++++++- radio/aidl/vts/radio_network_utils.h | 7 ++ 3 files changed, 126 insertions(+), 5 deletions(-) diff --git a/radio/aidl/vts/radio_network_response.cpp b/radio/aidl/vts/radio_network_response.cpp index 64f85c6bab..b242341960 100644 --- a/radio/aidl/vts/radio_network_response.cpp +++ b/radio/aidl/vts/radio_network_response.cpp @@ -96,8 +96,11 @@ ndk::ScopedAStatus RadioNetworkResponse::getSystemSelectionChannelsResponse( return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioNetworkResponse::getUsageSettingResponse( - const RadioResponseInfo& /*info*/, const UsageSetting /*usageSetting*/) { +ndk::ScopedAStatus RadioNetworkResponse::getUsageSettingResponse(const RadioResponseInfo& info, + const UsageSetting usageSetting) { + rspInfo = info; + this->usageSetting = usageSetting; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -195,8 +198,9 @@ ndk::ScopedAStatus RadioNetworkResponse::setSystemSelectionChannelsResponse( return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioNetworkResponse::setUsageSettingResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioNetworkResponse::setUsageSettingResponse(const RadioResponseInfo& info) { + rspInfo = info; + 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 a8f87fc6ed..1cdbb6dca8 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -146,4 +146,114 @@ TEST_P(RadioNetworkTest, isNrDualConnectivityEnabled) { radioRsp_network->rspInfo.error, {RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR, RadioError::NONE})); } -} \ No newline at end of file +} + +void RadioNetworkTest::invokeAndExpectResponse( + std::function request, + std::vector errors_to_check) { + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = request(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, errors_to_check)); +} + +/* + * Test IRadioNetwork.getUsageSetting() + * + * Verify that the usage setting can be retrieved. + */ +TEST_P(RadioNetworkTest, getUsageSetting) { + invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); }, + {RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_STATE, + RadioError::SIM_ABSENT, RadioError::INTERNAL_ERR, RadioError::NONE}); + + ASSERT_TRUE(radioRsp_network->usageSetting == UsageSetting::VOICE_CENTRIC || + radioRsp_network->usageSetting == UsageSetting::DATA_CENTRIC); +} + +void RadioNetworkTest::testSetUsageSetting_InvalidValues(std::vector errors) { + invokeAndExpectResponse( + [&](int serial) { + return radio_network->setUsageSetting(serial, + UsageSetting(0) /*below valid range*/); + }, + errors); + invokeAndExpectResponse( + [&](int serial) { + return radio_network->setUsageSetting(serial, UsageSetting(-1) /*negative*/); + }, + errors); + invokeAndExpectResponse( + [&](int serial) { + return radio_network->setUsageSetting(serial, + UsageSetting(3) /*above valid range*/); + }, + errors); +} + +/* + * Test IRadioNetwork.setUsageSetting() and IRadioNetwork.getUsageSetting() + * + * Verify the following: + * -That the usage setting can be retrieved. + * -That the usage setting can be successfully set to allowed values. + * -That the usage setting cannot be set to invalid values. + */ +TEST_P(RadioNetworkTest, setUsageSetting) { + invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); }, + {RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_STATE, + RadioError::SIM_ABSENT, RadioError::INTERNAL_ERR, RadioError::NONE}); + + if (radioRsp_network->rspInfo.error != RadioError::NONE) { + // Test only for invalid values, with the only allowable response being the same error + // that was previously provided, or an error indicating invalid arguments. + testSetUsageSetting_InvalidValues( + {radioRsp_network->rspInfo.error, RadioError::INVALID_ARGUMENTS}); + // It is unsafe to proceed with setting valid values without knowing the starting value, but + // we expect errors anyway, so not necessary. + return; + } else { + // Because querying succeeded, the device is in a valid state to test for invalid values + // and the only thing that can change is that we expect to have an EINVAL return each time. + testSetUsageSetting_InvalidValues({RadioError::INVALID_ARGUMENTS}); + } + + // Store the original setting value to reset later. + const UsageSetting originalSetting = radioRsp_network->usageSetting; + + // Choose the "other" value that is not the current value for test. + const UsageSetting testSetting = radioRsp_network->usageSetting == UsageSetting::VOICE_CENTRIC + ? UsageSetting::DATA_CENTRIC + : UsageSetting::VOICE_CENTRIC; + + // Set an alternative setting; it may either succeed or be disallowed as out of range for + // the current device (if the device only supports its current mode). + invokeAndExpectResponse( + [&](int serial) { return radio_network->setUsageSetting(serial, testSetting); }, + {RadioError::INVALID_ARGUMENTS, RadioError::NONE}); + + // If there was no error, then we expect the test setting to be set, or if there is an error + // we expect the original setting to be maintained. + const UsageSetting expectedSetting = + radioRsp_network->rspInfo.error == RadioError::NONE ? testSetting : originalSetting; + invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); }, + {RadioError::NONE}); + + const UsageSetting updatedSetting = radioRsp_network->usageSetting; + + // Re-set the original setting, which must always succeed. + invokeAndExpectResponse( + [&](int serial) { return radio_network->setUsageSetting(serial, originalSetting); }, + {RadioError::NONE}); + + // Check that indeed the updated setting was set. We do this after resetting to original + // conditions to avoid early-exiting the test and leaving the device in a modified state. + ASSERT_TRUE(expectedSetting == updatedSetting); + // Check that indeed the original setting was reset. + ASSERT_TRUE(originalSetting == radioRsp_network->usageSetting); +} diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h index 26fce016b2..caa1ecc62a 100644 --- a/radio/aidl/vts/radio_network_utils.h +++ b/radio/aidl/vts/radio_network_utils.h @@ -43,6 +43,7 @@ class RadioNetworkResponse : public BnRadioNetworkResponse { RegStateResult regStateResp; CellIdentity barringCellIdentity; std::vector barringInfos; + UsageSetting usageSetting; virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; @@ -211,4 +212,10 @@ class RadioNetworkTest : public ::testing::TestWithParam, public Ra std::shared_ptr radioRsp_network; /* radio network indication handle */ std::shared_ptr radioInd_network; + + void invokeAndExpectResponse(std::function request, + std::vector errors_to_check); + + // Helper function to reduce copy+paste + void testSetUsageSetting_InvalidValues(std::vector errors); }; -- GitLab From dc6dd69948498538c8668de47f53cb576250dc59 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Tue, 21 Dec 2021 18:10:46 -0800 Subject: [PATCH 356/825] composer: release fence can be null Add @nullable to the releaseFence in IComposerClient.setReadbackBuffer as it can be null, if the buffer is ready to be consumed. Bug: 210166943 Test: VTS Change-Id: Ic556ceabd22ba8acddf37ca7d9a6d14d41697c5b --- .../graphics/composer3/IComposerClient.aidl | 4 ++-- .../graphics/composer3/IComposerClient.aidl | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) 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 2bdbc9fd96..36f701ce2b 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 @@ -56,7 +56,7 @@ interface IComposerClient { int getMaxVirtualDisplayCount(); android.hardware.graphics.composer3.PerFrameMetadataKey[] getPerFrameMetadataKeys(long display); android.hardware.graphics.composer3.ReadbackBufferAttributes getReadbackBufferAttributes(long display); - ParcelFileDescriptor getReadbackBufferFence(long display); + @nullable ParcelFileDescriptor getReadbackBufferFence(long display); android.hardware.graphics.composer3.RenderIntent[] getRenderIntents(long display, android.hardware.graphics.composer3.ColorMode mode); android.hardware.graphics.composer3.ContentType[] getSupportedContentTypes(long display); void registerCallback(in android.hardware.graphics.composer3.IComposerCallback callback); @@ -69,7 +69,7 @@ interface IComposerClient { void setDisplayBrightness(long display, float brightness); void setDisplayedContentSamplingEnabled(long display, boolean enable, android.hardware.graphics.composer3.FormatColorComponent componentMask, long maxFrames); void setPowerMode(long display, android.hardware.graphics.composer3.PowerMode mode); - void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, in ParcelFileDescriptor releaseFence); + void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, in @nullable ParcelFileDescriptor releaseFence); void setVsyncEnabled(long display, boolean enabled); const int EX_BAD_CONFIG = 1; const int EX_BAD_DISPLAY = 2; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 28bdb2c44e..1b198924fb 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -479,7 +479,7 @@ interface IComposerClient { * getReadbackBufferAttributes * setReadbackBuffer */ - ParcelFileDescriptor getReadbackBufferFence(long display); + @nullable ParcelFileDescriptor getReadbackBufferFence(long display); /** * Returns the render intents supported by the specified display and color @@ -702,13 +702,15 @@ interface IComposerClient { * This buffer must have been allocated as described in * getReadbackBufferAttributes and is in the dataspace provided by the same. * + * Also provides a file descriptor referring to a release sync fence + * object, which must be signaled when it is safe to write to the readback + * buffer. If it is already safe to write to the readback buffer, null may be passed instead. + * * If there is hardware protected content on the display at the time of the next * composition, the area of the readback buffer covered by such content must be * completely black. Any areas of the buffer not covered by such content may * optionally be black as well. * - * The release fence file descriptor provided works identically to the one - * described for setOutputBuffer. * * This function must not be called between any call to validateDisplay and a * subsequent call to presentDisplay. @@ -716,7 +718,8 @@ interface IComposerClient { * Parameters: * @param display - the display on which to create the layer. * @param buffer - the new readback buffer - * @param releaseFence - a sync fence file descriptor as described in setOutputBuffer + * @param releaseFence - a sync fence file descriptor as described above or null if it is + * already safe to write to the readback buffer. * * @exception EX_BAD_DISPLAY - an invalid display handle was passed in * @exception EX_BAD_PARAMETER - the new readback buffer handle was invalid @@ -726,7 +729,7 @@ interface IComposerClient { * getReadbackBufferFence */ void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, - in ParcelFileDescriptor releaseFence); + in @nullable ParcelFileDescriptor releaseFence); /** * Enables or disables the vsync signal for the given display. Virtual -- GitLab From 8d65de5874ac8846b370680ba9b163e68e46d83a Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Wed, 22 Dec 2021 16:54:14 -0800 Subject: [PATCH 357/825] composer: rename ClockMonotonicTimestamp.timestamp Rename ClockMonotonicTimestamp.timestamp to ClockMonotonicTimestamp.timestampNanos to improve readability. Fixes: 211801233 Test: build Change-Id: Ia71525fd9ccb77d871857f60dac29ac9198c0258 --- .../hardware/graphics/composer3/ClockMonotonicTimestamp.aidl | 2 +- .../hardware/graphics/composer3/ClockMonotonicTimestamp.aidl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl index 856ec64218..480a85c27f 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl @@ -34,5 +34,5 @@ package android.hardware.graphics.composer3; @VintfStability parcelable ClockMonotonicTimestamp { - long timestamp; + long timestampNanos; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl index f38503818d..0cfd1c4c13 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl @@ -21,5 +21,5 @@ package android.hardware.graphics.composer3; */ @VintfStability parcelable ClockMonotonicTimestamp { - long timestamp; + long timestampNanos; } -- GitLab From b9b5df3ce5a65a38b7b063979291b7d884211b5e Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Wed, 22 Dec 2021 20:09:17 -0800 Subject: [PATCH 358/825] composer: make PresentOrValidate.Result consistent with hidl HIDL expects that Presented will be 1 and Validated witll be 0. Even though we map the enum values of PresentOrValidate.Result to the correct value, this CL makes the interface consistent with the HIDL so that we can directly use the enum value. Bug: 208856704 Test: VTS Change-Id: I9fb2421e32c2288c5495422eda6764f6102337f0 --- .../hardware/graphics/composer3/PresentOrValidate.aidl | 4 ++-- .../hardware/graphics/composer3/PresentOrValidate.aidl | 2 +- .../android/hardware/graphics/composer3/translate-ndk.cpp | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl index 3514e5355a..e6ddeba784 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl @@ -38,7 +38,7 @@ parcelable PresentOrValidate { android.hardware.graphics.composer3.PresentOrValidate.Result result; @VintfStability enum Result { - Presented = 0, - Validated = 1, + Validated = 0, + Presented = 1, } } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl index f3153bdeca..5ae8940be0 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl @@ -27,6 +27,6 @@ parcelable PresentOrValidate { /** * Whether PresentOrValidate presented or validated the display. */ - @VintfStability enum Result { Presented, Validated } + @VintfStability enum Result { Validated, Presented } Result result; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp index 8a789e3ac1..c1e988a729 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp @@ -327,6 +327,13 @@ static_assert( static_cast( ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType::GAME)); +static_assert( + aidl::android::hardware::graphics::composer3::PresentOrValidate::Result::Presented == + static_cast(1)); +static_assert( + aidl::android::hardware::graphics::composer3::PresentOrValidate::Result::Validated == + static_cast(0)); + __attribute__((warn_unused_result)) bool translate( const ::android::hardware::graphics::composer::V2_4::VsyncPeriodChangeTimeline& in, aidl::android::hardware::graphics::composer3::VsyncPeriodChangeTimeline* out) { -- GitLab From 46219f5731fa5ce62a0c6ea6dc1a769c16b7b852 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Mon, 20 Dec 2021 09:44:31 -0800 Subject: [PATCH 359/825] composer: cleanup CommandWriterBase and CommandReaderBase part 2 Bug: 208856704 Test: VTS Change-Id: I30f4cfef66a1c833142b4645f69e8ad9fbf0de8e --- .../graphics/composer3/HandleIndex.aidl | 39 ---- .../graphics/composer3/HandleIndex.aidl | 33 --- .../graphics/composer3/translate-ndk.cpp | 9 - .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 138 +++-------- .../VtsHalGraphicsComposer3_TargetTest.cpp | 31 +-- .../graphics/composer3/ComposerClientReader.h | 217 +++++------------- .../graphics/composer3/ComposerClientWriter.h | 3 - .../graphics/composer3/translate-ndk.h | 1 - 8 files changed, 108 insertions(+), 363 deletions(-) delete mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HandleIndex.aidl delete mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HandleIndex.aidl deleted file mode 100644 index b87870d648..0000000000 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HandleIndex.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.graphics.composer3; -@Backing(type="int") @VintfStability -enum HandleIndex { - EMPTY = -1, - CACHED = -2, -} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl deleted file mode 100644 index 0a93c9ee36..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl +++ /dev/null @@ -1,33 +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. - */ - -package android.hardware.graphics.composer3; - -/** - * Special index values (always negative) for command queue commands. - */ -@VintfStability -@Backing(type="int") -enum HandleIndex { - /** - * No handle - */ - EMPTY = -1, - /** - * Use cached handle - */ - CACHED = -2, -} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp index c1e988a729..c2a4fdd0ce 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp @@ -129,15 +129,6 @@ static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest:: static_cast(::android::hardware::graphics::composer::V2_1::IComposerClient:: DisplayRequest::WRITE_CLIENT_TARGET_TO_OUTPUT)); -static_assert(aidl::android::hardware::graphics::composer3::HandleIndex::EMPTY == - static_cast( - ::android::hardware::graphics::composer::V2_1::IComposerClient::HandleIndex:: - EMPTY)); -static_assert(aidl::android::hardware::graphics::composer3::HandleIndex::CACHED == - static_cast( - ::android::hardware::graphics::composer::V2_1::IComposerClient::HandleIndex:: - CACHED)); - static_assert( aidl::android::hardware::graphics::composer3::PowerMode::OFF == static_cast( diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index eddc2d3271..96d240a2fb 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -103,13 +104,8 @@ class GraphicsCompositionTestBase : public ::testing::Test { ASSERT_NO_FATAL_FAILURE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF)); const auto errors = mReader.takeErrors(); ASSERT_TRUE(mReader.takeErrors().empty()); + ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()); - std::vector layers; - std::vector types; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &layers, &types); - - ASSERT_TRUE(layers.empty()); - ASSERT_TRUE(types.empty()); if (mComposerCallback != nullptr) { EXPECT_EQ(0, mComposerCallback->getInvalidHotplugCount()); EXPECT_EQ(0, mComposerCallback->getInvalidRefreshCount()); @@ -118,12 +114,14 @@ class GraphicsCompositionTestBase : public ::testing::Test { } ::android::sp<::android::GraphicBuffer> allocate() { + const auto width = static_cast(mDisplayWidth); + const auto height = static_cast(mDisplayHeight); + const auto usage = static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | + static_cast(common::BufferUsage::CPU_READ_OFTEN); + return ::android::sp<::android::GraphicBuffer>::make( - mDisplayWidth, mDisplayHeight, ::android::PIXEL_FORMAT_RGBA_8888, - /*layerCount*/ 1, - static_cast(static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | - static_cast(common::BufferUsage::CPU_READ_OFTEN)), - "VtsHalGraphicsComposer3_ReadbackTest"); + width, height, ::android::PIXEL_FORMAT_RGBA_8888, + /*layerCount*/ 1u, usage, "VtsHalGraphicsComposer3_ReadbackTest"); } void writeLayers(const std::vector>& layers) { @@ -141,10 +139,10 @@ class GraphicsCompositionTestBase : public ::testing::Test { } std::vector results; - const auto status = mComposerClient->executeCommands(commands, &results); + auto status = mComposerClient->executeCommands(commands, &results); ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); - mReader.parse(results); + mReader.parse(std::move(results)); mWriter.reset(); } @@ -262,11 +260,7 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { execute(); // if hwc cannot handle and asks for composition change, // just succeed the test - std::vector changedCompositionLayers; - std::vector changedCompositionTypes; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - if (!changedCompositionLayers.empty()) { + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED(); return; } @@ -320,11 +314,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector changedCompositionLayers; - std::vector changedCompositionTypes; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - if (!changedCompositionLayers.empty()) { + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED(); return; } @@ -380,11 +370,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector changedCompositionLayers; - std::vector changedCompositionTypes; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - if (!changedCompositionLayers.empty()) { + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED(); return; } @@ -495,14 +481,10 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector changedCompositionLayers; - std::vector changedCompositionTypes; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - if (!changedCompositionLayers.empty()) { - ASSERT_EQ(1, changedCompositionLayers.size()); + auto changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay); + if (!changedCompositionTypes.empty()) { ASSERT_EQ(1, changedCompositionTypes.size()); - ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0]); + ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition); PixelFormat clientFormat = PixelFormat::RGBA_8888; auto clientUsage = static_cast( @@ -537,9 +519,8 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { mWriter.setClientTarget(mPrimaryDisplay, 0, mGraphicBuffer->handle, fenceHandle.get(), clientDataspace, std::vector(1, damage)); execute(); - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - ASSERT_TRUE(changedCompositionLayers.empty()); + changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay); + ASSERT_TRUE(changedCompositionTypes.empty()); } ASSERT_TRUE(mReader.takeErrors().empty()); @@ -609,15 +590,12 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector changedCompositionLayers; - std::vector changedCompositionTypes; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); + auto changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay); if (changedCompositionTypes.size() != 1) { continue; } // create client target buffer - ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0]); + ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition); mGraphicBuffer->reallocate(static_cast(mDisplayWidth), static_cast(mDisplayHeight), static_cast(common::PixelFormat::RGBA_8888), @@ -642,9 +620,8 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { mWriter.setClientTarget(mPrimaryDisplay, 0, mGraphicBuffer->handle, fenceHandle.get(), clientDataspace, std::vector(1, clientFrame)); execute(); - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - ASSERT_EQ(0, changedCompositionLayers.size()); + changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay); + ASSERT_TRUE(changedCompositionTypes.empty()); ASSERT_TRUE(mReader.takeErrors().empty()); mWriter.presentDisplay(mPrimaryDisplay); @@ -687,11 +664,7 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { ASSERT_TRUE(mReader.takeErrors().empty()); mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector changedCompositionLayers; - std::vector changedCompositionTypes; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - if (!changedCompositionLayers.empty()) { + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED(); return; } @@ -718,10 +691,7 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - ASSERT_TRUE(changedCompositionLayers.empty()); - ASSERT_TRUE(changedCompositionTypes.empty()); + ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()); mWriter.presentDisplay(mPrimaryDisplay); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -758,11 +728,7 @@ TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) { ASSERT_TRUE(mReader.takeErrors().empty()); mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector changedCompositionLayers; - std::vector changedCompositionTypes; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - if (!changedCompositionLayers.empty()) { + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED(); return; } @@ -821,11 +787,7 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { ASSERT_TRUE(mReader.takeErrors().empty()); mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector changedCompositionLayers; - std::vector changedCompositionTypes; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - if (!changedCompositionLayers.empty()) { + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED(); return; } @@ -879,11 +841,7 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { ASSERT_TRUE(mReader.takeErrors().empty()); mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector changedCompositionLayers; - std::vector changedCompositionTypes; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - if (!changedCompositionLayers.empty()) { + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED(); return; } @@ -904,10 +862,7 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { ASSERT_TRUE(mReader.takeErrors().empty()); mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - ASSERT_TRUE(changedCompositionLayers.empty()); - ASSERT_TRUE(changedCompositionTypes.empty()); + ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()); ASSERT_TRUE(mReader.takeErrors().empty()); mWriter.presentDisplay(mPrimaryDisplay); execute(); @@ -1029,11 +984,7 @@ TEST_P(GraphicsBlendModeCompositionTest, None) { ASSERT_TRUE(mReader.takeErrors().empty()); mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector changedCompositionLayers; - std::vector changedCompositionTypes; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - if (!changedCompositionLayers.empty()) { + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED(); return; } @@ -1074,11 +1025,7 @@ TEST_P(GraphicsBlendModeCompositionTest, Coverage) { ASSERT_TRUE(mReader.takeErrors().empty()); mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector changedCompositionLayers; - std::vector changedCompositionTypes; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - if (!changedCompositionLayers.empty()) { + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED(); return; } @@ -1114,11 +1061,7 @@ TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) { ASSERT_TRUE(mReader.takeErrors().empty()); mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector changedCompositionLayers; - std::vector changedCompositionTypes; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - if (!changedCompositionLayers.empty()) { + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED(); return; } @@ -1197,11 +1140,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { ASSERT_TRUE(mReader.takeErrors().empty()); mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector changedCompositionLayers; - std::vector changedCompositionTypes; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - if (!changedCompositionLayers.empty()) { + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED(); return; } @@ -1243,11 +1182,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) { ASSERT_TRUE(mReader.takeErrors().empty()); mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector changedCompositionLayers; - std::vector changedCompositionTypes; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers, - &changedCompositionTypes); - if (!changedCompositionLayers.empty()) { + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED(); return; } @@ -1289,10 +1224,7 @@ TEST_P(GraphicsTransformCompositionTest, ROT_180) { ASSERT_TRUE(mReader.takeErrors().empty()); mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector layers; - std::vector types; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &layers, &types); - if (!layers.empty()) { + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED(); return; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 6638744547..4dbe191f0c 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1142,13 +1142,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { void TearDown() override { const auto errors = mReader.takeErrors(); ASSERT_TRUE(mReader.takeErrors().empty()); - - std::vector layers; - std::vector types; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &layers, &types); - - ASSERT_TRUE(layers.empty()); - ASSERT_TRUE(types.empty()); + ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()); ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::TearDown()); } @@ -1164,7 +1158,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { const auto status = mComposerClient->executeCommands(commands, &results); ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); - mReader.parse(results); + mReader.parse(std::move(results)); mWriter.reset(); } @@ -1299,10 +1293,12 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - int presentFence; - mReader.takePresentFence(mPrimaryDisplay, &presentFence); - EXPECT_NE(-1, presentFence); - return sp<::android::Fence>::make(presentFence); + auto presentFence = mReader.takePresentFence(mPrimaryDisplay); + // take ownership + const int fenceOwner = presentFence.get(); + *presentFence.getR() = -1; + EXPECT_NE(-1, fenceOwner); + return sp<::android::Fence>::make(fenceOwner); } int32_t getVsyncPeriod() { @@ -1592,10 +1588,7 @@ TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector layers; - std::vector types; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &layers, &types); - if (!layers.empty()) { + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED() << "Composition change requested, skipping test"; return; } @@ -1640,10 +1633,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_CURSOR_POSITION) { mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); execute(); - std::vector layers; - std::vector types; - mReader.takeChangedCompositionTypes(mPrimaryDisplay, &layers, &types); - if (!layers.empty()) { + + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { GTEST_SUCCEED() << "Composition change requested, skipping test"; return; } diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h index 1dc914555c..f9e35e94e0 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h @@ -26,40 +26,16 @@ #include #include -#include #include -#include #include -#include -#include -#include -#include -#include -#include - #include -#include -#include -#include -#include -#include #include #include -#include -using aidl::android::hardware::graphics::common::BlendMode; -using aidl::android::hardware::graphics::common::ColorTransform; using aidl::android::hardware::graphics::common::Dataspace; -using aidl::android::hardware::graphics::common::FRect; -using aidl::android::hardware::graphics::common::Rect; -using aidl::android::hardware::graphics::common::Transform; - -using namespace aidl::android::hardware::graphics::composer3; - -using aidl::android::hardware::common::NativeHandle; namespace aidl::android::hardware::graphics::composer3 { @@ -69,35 +45,37 @@ class ComposerClientReader { // Parse and execute commands from the command queue. The commands are // actually return values from the server and will be saved in ReturnData. - void parse(const std::vector& results) { + void parse(std::vector&& results) { resetData(); - for (const auto& result : results) { + for (auto& result : results) { switch (result.getTag()) { case CommandResultPayload::Tag::error: - parseSetError(result.get()); + parseSetError(std::move(result.get())); break; case CommandResultPayload::Tag::changedCompositionTypes: - parseSetChangedCompositionTypes( - result.get()); + parseSetChangedCompositionTypes(std::move( + result.get())); break; case CommandResultPayload::Tag::displayRequest: parseSetDisplayRequests( - result.get()); + std::move(result.get())); break; case CommandResultPayload::Tag::presentFence: - parseSetPresentFence(result.get()); + parseSetPresentFence( + std::move(result.get())); break; case CommandResultPayload::Tag::releaseFences: - parseSetReleaseFences(result.get()); + parseSetReleaseFences( + std::move(result.get())); break; case CommandResultPayload::Tag::presentOrValidateResult: - parseSetPresentOrValidateDisplayResult( - result.get()); + parseSetPresentOrValidateDisplayResult(std::move( + result.get())); break; case CommandResultPayload::Tag::clientTargetProperty: - parseSetClientTargetProperty( - result.get()); + parseSetClientTargetProperty(std::move( + result.get())); break; } } @@ -105,211 +83,140 @@ class ComposerClientReader { std::vector takeErrors() { return std::move(mErrors); } - bool hasChanges(int64_t display, uint32_t* outNumChangedCompositionTypes, + void hasChanges(int64_t display, uint32_t* outNumChangedCompositionTypes, uint32_t* outNumLayerRequestMasks) const { auto found = mReturnData.find(display); if (found == mReturnData.end()) { *outNumChangedCompositionTypes = 0; *outNumLayerRequestMasks = 0; - return false; + return; } const ReturnData& data = found->second; - *outNumChangedCompositionTypes = static_cast(data.compositionTypes.size()); - *outNumLayerRequestMasks = static_cast(data.requestMasks.size()); - - return !(data.compositionTypes.empty() && data.requestMasks.empty()); + *outNumChangedCompositionTypes = static_cast(data.changedLayers.size()); + *outNumLayerRequestMasks = static_cast(data.displayRequests.layerRequests.size()); } // Get and clear saved changed composition types. - void takeChangedCompositionTypes(int64_t display, std::vector* outLayers, - std::vector* outTypes) { + std::vector takeChangedCompositionTypes(int64_t display) { auto found = mReturnData.find(display); if (found == mReturnData.end()) { - outLayers->clear(); - outTypes->clear(); - return; + return {}; } ReturnData& data = found->second; - - *outLayers = std::move(data.changedLayers); - *outTypes = std::move(data.compositionTypes); + return std::move(data.changedLayers); } // Get and clear saved display requests. - void takeDisplayRequests(int64_t display, uint32_t* outDisplayRequestMask, - std::vector* outLayers, - std::vector* outLayerRequestMasks) { + DisplayRequest takeDisplayRequests(int64_t display) { auto found = mReturnData.find(display); if (found == mReturnData.end()) { - *outDisplayRequestMask = 0; - outLayers->clear(); - outLayerRequestMasks->clear(); - return; + return {}; } ReturnData& data = found->second; - - *outDisplayRequestMask = data.displayRequests; - *outLayers = std::move(data.requestedLayers); - *outLayerRequestMasks = std::move(data.requestMasks); + return std::move(data.displayRequests); } // Get and clear saved release fences. - void takeReleaseFences(int64_t display, std::vector* outLayers, - std::vector* outReleaseFences) { + std::vector takeReleaseFences(int64_t display) { auto found = mReturnData.find(display); if (found == mReturnData.end()) { - outLayers->clear(); - outReleaseFences->clear(); - return; + return {}; } ReturnData& data = found->second; - - *outLayers = std::move(data.releasedLayers); - *outReleaseFences = std::move(data.releaseFences); + return std::move(data.releasedLayers); } // Get and clear saved present fence. - void takePresentFence(int64_t display, int* outPresentFence) { + ndk::ScopedFileDescriptor takePresentFence(int64_t display) { auto found = mReturnData.find(display); if (found == mReturnData.end()) { - *outPresentFence = -1; - return; + return {}; } ReturnData& data = found->second; - - *outPresentFence = data.presentFence; - data.presentFence = -1; + return std::move(data.presentFence); } // Get what stage succeeded during PresentOrValidate: Present or Validate - void takePresentOrValidateStage(int64_t display, uint32_t* state) { + std::optional takePresentOrValidateStage(int64_t display) { auto found = mReturnData.find(display); if (found == mReturnData.end()) { - *state = static_cast(-1); - return; + return std::nullopt; } ReturnData& data = found->second; - *state = data.presentOrValidateState; + return data.presentOrValidateState; } // Get the client target properties requested by hardware composer. - void takeClientTargetProperty(int64_t display, ClientTargetProperty* outClientTargetProperty, - float* outWhitePointNits) { + ClientTargetPropertyWithNits takeClientTargetProperty(int64_t display) { auto found = mReturnData.find(display); // If not found, return the default values. if (found == mReturnData.end()) { - outClientTargetProperty->pixelFormat = common::PixelFormat::RGBA_8888; - outClientTargetProperty->dataspace = Dataspace::UNKNOWN; - *outWhitePointNits = -1.f; - return; + return ClientTargetPropertyWithNits{ + .clientTargetProperty = {common::PixelFormat::RGBA_8888, Dataspace::UNKNOWN}, + .whitePointNits = -1.f, + }; } ReturnData& data = found->second; - *outClientTargetProperty = data.clientTargetProperty; - *outWhitePointNits = data.clientTargetWhitePointNits; + return std::move(data.clientTargetProperty); } private: void resetData() { mErrors.clear(); - - for (auto& data : mReturnData) { - if (data.second.presentFence >= 0) { - close(data.second.presentFence); - } - for (auto fence : data.second.releaseFences) { - if (fence >= 0) { - close(fence); - } - } - } - mReturnData.clear(); } - void parseSetError(const CommandError& error) { mErrors.emplace_back(error); } + void parseSetError(CommandError&& error) { mErrors.emplace_back(error); } - void parseSetChangedCompositionTypes(const ChangedCompositionTypes& changedCompositionTypes) { + void parseSetChangedCompositionTypes(ChangedCompositionTypes&& changedCompositionTypes) { auto& data = mReturnData[changedCompositionTypes.display]; - - data.changedLayers.reserve(changedCompositionTypes.layers.size()); - data.compositionTypes.reserve(changedCompositionTypes.layers.size()); - for (const auto& layer : changedCompositionTypes.layers) { - data.changedLayers.push_back(layer.layer); - data.compositionTypes.push_back(layer.composition); - } + data.changedLayers = std::move(changedCompositionTypes.layers); } - void parseSetDisplayRequests(const DisplayRequest& displayRequest) { + void parseSetDisplayRequests(DisplayRequest&& displayRequest) { auto& data = mReturnData[displayRequest.display]; - - data.displayRequests = displayRequest.mask; - data.requestedLayers.reserve(displayRequest.layerRequests.size()); - data.requestMasks.reserve(displayRequest.layerRequests.size()); - for (const auto& layerRequest : displayRequest.layerRequests) { - data.requestedLayers.push_back(layerRequest.layer); - data.requestMasks.push_back(layerRequest.mask); - } + data.displayRequests = std::move(displayRequest); } - void parseSetPresentFence(const PresentFence& presentFence) { + void parseSetPresentFence(PresentFence&& presentFence) { auto& data = mReturnData[presentFence.display]; - if (data.presentFence >= 0) { - close(data.presentFence); - } - data.presentFence = dup(presentFence.fence.get()); + data.presentFence = std::move(presentFence.fence); } - void parseSetReleaseFences(const ReleaseFences& releaseFences) { + void parseSetReleaseFences(ReleaseFences&& releaseFences) { auto& data = mReturnData[releaseFences.display]; - data.releasedLayers.reserve(releaseFences.layers.size()); - data.releaseFences.reserve(releaseFences.layers.size()); - for (const auto& layer : releaseFences.layers) { - data.releasedLayers.push_back(layer.layer); - data.releaseFences.push_back(dup(layer.fence.get())); - } + data.releasedLayers = std::move(releaseFences.layers); } - void parseSetPresentOrValidateDisplayResult(const PresentOrValidate& presentOrValidate) { + void parseSetPresentOrValidateDisplayResult(const PresentOrValidate&& presentOrValidate) { auto& data = mReturnData[presentOrValidate.display]; - data.presentOrValidateState = - presentOrValidate.result == PresentOrValidate::Result::Presented ? 1 : 0; + data.presentOrValidateState = std::move(presentOrValidate.result); } - void parseSetClientTargetProperty(const ClientTargetPropertyWithNits& clientTargetProperty) { + void parseSetClientTargetProperty(const ClientTargetPropertyWithNits&& clientTargetProperty) { auto& data = mReturnData[clientTargetProperty.display]; - data.clientTargetProperty.pixelFormat = - clientTargetProperty.clientTargetProperty.pixelFormat; - data.clientTargetProperty.dataspace = clientTargetProperty.clientTargetProperty.dataspace; - data.clientTargetWhitePointNits = clientTargetProperty.whitePointNits; + data.clientTargetProperty = std::move(clientTargetProperty); } struct ReturnData { - int32_t displayRequests = 0; - - std::vector changedLayers; - std::vector compositionTypes; - - std::vector requestedLayers; - std::vector requestMasks; - - int presentFence = -1; - - std::vector releasedLayers; - std::vector releaseFences; - - uint32_t presentOrValidateState; - - ClientTargetProperty clientTargetProperty{common::PixelFormat::RGBA_8888, - Dataspace::UNKNOWN}; - float clientTargetWhitePointNits = -1.f; + DisplayRequest displayRequests; + std::vector changedLayers; + ndk::ScopedFileDescriptor presentFence; + std::vector releasedLayers; + PresentOrValidate::Result presentOrValidateState; + + ClientTargetPropertyWithNits clientTargetProperty = { + .clientTargetProperty = {common::PixelFormat::RGBA_8888, Dataspace::UNKNOWN}, + .whitePointNits = -1.f, + }; }; std::vector mErrors; 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 5bab266fa3..16d63e57ca 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -30,9 +30,6 @@ #include #include #include -#include -#include -#include #include #include diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h index 263167ee29..3a92ae61d0 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h @@ -30,7 +30,6 @@ #include "aidl/android/hardware/graphics/composer3/DisplayConnectionType.h" #include "aidl/android/hardware/graphics/composer3/FloatColor.h" #include "aidl/android/hardware/graphics/composer3/FormatColorComponent.h" -#include "aidl/android/hardware/graphics/composer3/HandleIndex.h" #include "aidl/android/hardware/graphics/composer3/IComposer.h" #include "aidl/android/hardware/graphics/composer3/PerFrameMetadata.h" #include "aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h" -- GitLab From c4fd63353dda2d0b9ed6cb39c84fe39fe04c85a0 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Wed, 22 Dec 2021 20:13:43 -0800 Subject: [PATCH 360/825] composer: remove translate-ndk - No one is using the translate functions, so removing. - Rename the static_assert portion to Hidl2AidlAsserts Test: build Change-Id: I42abc37953e1d927a3bcf5f60f56acf99fde6bf5 --- graphics/composer/aidl/Android.bp | 27 ++-- ...translate-ndk.cpp => Hidl2AidlAsserts.cpp} | 146 ++++-------------- .../graphics/composer3/translate-ndk.h | 81 ---------- 3 files changed, 40 insertions(+), 214 deletions(-) rename graphics/composer/aidl/android/hardware/graphics/composer3/{translate-ndk.cpp => Hidl2AidlAsserts.cpp} (81%) delete mode 100644 graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp index 5f5b54ec7c..2532a7a740 100644 --- a/graphics/composer/aidl/Android.bp +++ b/graphics/composer/aidl/Android.bp @@ -55,20 +55,6 @@ aidl_interface { }, } -cc_library { - name: "android.hardware.graphics.composer3-translate-ndk", - vendor_available: true, - srcs: ["android/hardware/graphics/composer3/translate-ndk.cpp"], - shared_libs: [ - "libbinder_ndk", - "libhidlbase", - "android.hardware.graphics.composer3-V1-ndk", - "android.hardware.graphics.composer@2.1", - "android.hardware.graphics.composer@2.4", - ], - export_include_dirs: ["include"], -} - cc_library_headers { name: "android.hardware.graphics.composer3-command-buffer", vendor_available: true, @@ -88,3 +74,16 @@ cc_library_headers { ], export_include_dirs: ["include"], } + +cc_test { + name: "android.hardware.graphics.composer3-hidl2aidl-asserts", + vendor_available: true, + srcs: ["android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp"], + shared_libs: [ + "libbinder_ndk", + "libhidlbase", + "android.hardware.graphics.composer3-V1-ndk", + "android.hardware.graphics.composer@2.1", + "android.hardware.graphics.composer@2.4", + ], +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp similarity index 81% rename from graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp rename to graphics/composer/aidl/android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp index c2a4fdd0ce..d34b4051fa 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp @@ -14,7 +14,33 @@ * limitations under the License. */ -#include "android/hardware/graphics/composer3/translate-ndk.h" +#include "aidl/android/hardware/graphics/common/BlendMode.h" +#include "aidl/android/hardware/graphics/common/FRect.h" +#include "aidl/android/hardware/graphics/common/Rect.h" +#include "aidl/android/hardware/graphics/composer3/Capability.h" +#include "aidl/android/hardware/graphics/composer3/ClientTargetProperty.h" +#include "aidl/android/hardware/graphics/composer3/Color.h" +#include "aidl/android/hardware/graphics/composer3/Composition.h" +#include "aidl/android/hardware/graphics/composer3/ContentType.h" +#include "aidl/android/hardware/graphics/composer3/DisplayAttribute.h" +#include "aidl/android/hardware/graphics/composer3/DisplayCapability.h" +#include "aidl/android/hardware/graphics/composer3/DisplayConnectionType.h" +#include "aidl/android/hardware/graphics/composer3/FloatColor.h" +#include "aidl/android/hardware/graphics/composer3/FormatColorComponent.h" +#include "aidl/android/hardware/graphics/composer3/IComposer.h" +#include "aidl/android/hardware/graphics/composer3/PerFrameMetadata.h" +#include "aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h" +#include "aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.h" +#include "aidl/android/hardware/graphics/composer3/PowerMode.h" +#include "aidl/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.h" +#include "aidl/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.h" +#include "android/hardware/graphics/composer/2.1/IComposer.h" +#include "android/hardware/graphics/composer/2.1/IComposerCallback.h" +#include "android/hardware/graphics/composer/2.1/IComposerClient.h" +#include "android/hardware/graphics/composer/2.2/IComposerClient.h" +#include "android/hardware/graphics/composer/2.3/IComposerClient.h" +#include "android/hardware/graphics/composer/2.4/IComposerClient.h" +#include "android/hardware/graphics/composer/2.4/types.h" namespace android::h2a { @@ -325,122 +351,4 @@ static_assert( aidl::android::hardware::graphics::composer3::PresentOrValidate::Result::Validated == static_cast(0)); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_4::VsyncPeriodChangeTimeline& in, - aidl::android::hardware::graphics::composer3::VsyncPeriodChangeTimeline* out) { - out->newVsyncAppliedTimeNanos = static_cast(in.newVsyncAppliedTimeNanos); - out->refreshRequired = static_cast(in.refreshRequired); - out->refreshTimeNanos = static_cast(in.refreshTimeNanos); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_1::IComposerClient::Rect& in, - aidl::android::hardware::graphics::common::Rect* out) { - out->left = static_cast(in.left); - out->top = static_cast(in.top); - out->right = static_cast(in.right); - out->bottom = static_cast(in.bottom); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_1::IComposerClient::FRect& in, - aidl::android::hardware::graphics::common::FRect* out) { - out->left = static_cast(in.left); - out->top = static_cast(in.top); - out->right = static_cast(in.right); - out->bottom = static_cast(in.bottom); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_1::IComposerClient::Color& in, - aidl::android::hardware::graphics::composer3::Color* out) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.r > std::numeric_limits::max() || in.r < 0) { - return false; - } - out->r = static_cast(in.r); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.g > std::numeric_limits::max() || in.g < 0) { - return false; - } - out->g = static_cast(in.g); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.b > std::numeric_limits::max() || in.b < 0) { - return false; - } - out->b = static_cast(in.b); - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit - // your needs. - if (in.a > std::numeric_limits::max() || in.a < 0) { - return false; - } - out->a = static_cast(in.a); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_3::IComposerClient::PerFrameMetadata& in, - aidl::android::hardware::graphics::composer3::PerFrameMetadata* out) { - out->key = - static_cast(in.key); - out->value = static_cast(in.value); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_2::IComposerClient::FloatColor& in, - aidl::android::hardware::graphics::composer3::FloatColor* out) { - out->r = static_cast(in.r); - out->g = static_cast(in.g); - out->b = static_cast(in.b); - out->a = static_cast(in.a); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_3::IComposerClient::PerFrameMetadataBlob& - in, - aidl::android::hardware::graphics::composer3::PerFrameMetadataBlob* out) { - out->key = - static_cast(in.key); - { - size_t size = in.blob.size(); - for (size_t i = 0; i < size; i++) { - // FIXME This requires conversion between signed and unsigned. Change this if it doesn't - // suit your needs. - if (in.blob[i] > std::numeric_limits::max() || in.blob[i] < 0) { - return false; - } - out->blob.push_back(static_cast(in.blob[i])); - } - } - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_4::IComposerClient:: - VsyncPeriodChangeConstraints& in, - aidl::android::hardware::graphics::composer3::VsyncPeriodChangeConstraints* out) { - out->desiredTimeNanos = static_cast(in.desiredTimeNanos); - out->seamlessRequired = static_cast(in.seamlessRequired); - return true; -} - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_4::IComposerClient::ClientTargetProperty& - in, - aidl::android::hardware::graphics::composer3::ClientTargetProperty* out) { - out->pixelFormat = - static_cast(in.pixelFormat); - out->dataspace = - static_cast(in.dataspace); - return true; -} - } // namespace android::h2a diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h deleted file mode 100644 index 3a92ae61d0..0000000000 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h +++ /dev/null @@ -1,81 +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 -#include "aidl/android/hardware/graphics/common/BlendMode.h" -#include "aidl/android/hardware/graphics/common/FRect.h" -#include "aidl/android/hardware/graphics/common/Rect.h" -#include "aidl/android/hardware/graphics/composer3/Capability.h" -#include "aidl/android/hardware/graphics/composer3/ClientTargetProperty.h" -#include "aidl/android/hardware/graphics/composer3/Color.h" -#include "aidl/android/hardware/graphics/composer3/Composition.h" -#include "aidl/android/hardware/graphics/composer3/ContentType.h" -#include "aidl/android/hardware/graphics/composer3/DisplayAttribute.h" -#include "aidl/android/hardware/graphics/composer3/DisplayCapability.h" -#include "aidl/android/hardware/graphics/composer3/DisplayConnectionType.h" -#include "aidl/android/hardware/graphics/composer3/FloatColor.h" -#include "aidl/android/hardware/graphics/composer3/FormatColorComponent.h" -#include "aidl/android/hardware/graphics/composer3/IComposer.h" -#include "aidl/android/hardware/graphics/composer3/PerFrameMetadata.h" -#include "aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h" -#include "aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.h" -#include "aidl/android/hardware/graphics/composer3/PowerMode.h" -#include "aidl/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.h" -#include "aidl/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.h" -#include "android/hardware/graphics/composer/2.1/IComposer.h" -#include "android/hardware/graphics/composer/2.1/IComposerCallback.h" -#include "android/hardware/graphics/composer/2.1/IComposerClient.h" -#include "android/hardware/graphics/composer/2.2/IComposerClient.h" -#include "android/hardware/graphics/composer/2.3/IComposerClient.h" -#include "android/hardware/graphics/composer/2.4/IComposerClient.h" -#include "android/hardware/graphics/composer/2.4/types.h" - -namespace android::h2a { - -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_4::VsyncPeriodChangeTimeline& in, - aidl::android::hardware::graphics::composer3::VsyncPeriodChangeTimeline* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_1::IComposerClient::Rect& in, - aidl::android::hardware::graphics::common::Rect* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_1::IComposerClient::FRect& in, - aidl::android::hardware::graphics::common::FRect* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_1::IComposerClient::Color& in, - aidl::android::hardware::graphics::composer3::Color* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_3::IComposerClient::PerFrameMetadata& in, - aidl::android::hardware::graphics::composer3::PerFrameMetadata* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_2::IComposerClient::FloatColor& in, - aidl::android::hardware::graphics::composer3::FloatColor* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_3::IComposerClient::PerFrameMetadataBlob& - in, - aidl::android::hardware::graphics::composer3::PerFrameMetadataBlob* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_4::IComposerClient:: - VsyncPeriodChangeConstraints& in, - aidl::android::hardware::graphics::composer3::VsyncPeriodChangeConstraints* out); -__attribute__((warn_unused_result)) bool translate( - const ::android::hardware::graphics::composer::V2_4::IComposerClient::ClientTargetProperty& - in, - aidl::android::hardware::graphics::composer3::ClientTargetProperty* out); - -} // namespace android::h2a -- GitLab From fa7e058b5e641bea32ecf8ea6a229dda630c50fe Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Thu, 23 Dec 2021 15:28:46 +0000 Subject: [PATCH 361/825] Revert "Update documentation for DISPLAY_DECORATION" Revert "Add/plumb SurfaceControl.DISPLAY_DECORATION" Revert "Add eLayerIsDisplayDecoration flag" Revert submission 16511727-wm_DISPLAY_DECORATION Reason for revert: b/211835607 Reverted Changes: I1da3199ba:Allow changing composition from DISPLAY_DECORATION... I1fae74b36:Update documentation for DISPLAY_DECORATION I1da03a88f:Add eLayerIsDisplayDecoration flag I7f22dfd03:Add/plumb SurfaceControl.DISPLAY_DECORATION Change-Id: I7238bcc96325873ec7dbdd42894192c48e7cf92e --- .../hardware/graphics/composer3/Composition.aidl | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl index 49cdffcf20..4947463ba9 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl @@ -74,20 +74,16 @@ enum Composition { */ SIDEBAND = 5, /** - * A display decoration layer contains a buffer which is used to provide + * A display decoration layer contains a buffer which is an 8 bit + * alpha mask. Pixels in the mask with an alpha of 0 (transparent) will + * show the content underneath, and pixels with an alpha of 255 will be + * be rendered in black. An alpha in between will show the content + * blended with black. This is useful, for example, to provide * anti-aliasing on the cutout region/rounded corners on the top and * bottom of a display. * - * Pixels in the buffer with an alpha of 0 (transparent) will show the - * content underneath, and pixels with an alpha of 255 will be rendered in - * black. An alpha in between will show the underlying content blended with - * black. - * - * Some devices may support this flag with a buffer containing an 8 bit - * alpha mask. - * * Upon validateDisplay, the device may request a change from this type - * to either DEVICE or CLIENT. + * to CLIENT. */ DISPLAY_DECORATION = 6, } -- GitLab From 6d29f096eedfdbcda5aedf9646fa1fd312b26100 Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Thu, 23 Dec 2021 15:28:46 +0000 Subject: [PATCH 362/825] Revert "Update documentation for DISPLAY_DECORATION" Revert "Add/plumb SurfaceControl.DISPLAY_DECORATION" Revert "Add eLayerIsDisplayDecoration flag" Revert submission 16511727-wm_DISPLAY_DECORATION Reason for revert: b/211835607 Reverted Changes: I1da3199ba:Allow changing composition from DISPLAY_DECORATION... I1fae74b36:Update documentation for DISPLAY_DECORATION I1da03a88f:Add eLayerIsDisplayDecoration flag I7f22dfd03:Add/plumb SurfaceControl.DISPLAY_DECORATION Change-Id: I7238bcc96325873ec7dbdd42894192c48e7cf92e (cherry picked from commit fa7e058b5e641bea32ecf8ea6a229dda630c50fe) Merged-In:I7238bcc96325873ec7dbdd42894192c48e7cf92e --- .../hardware/graphics/composer3/Composition.aidl | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl index 49cdffcf20..4947463ba9 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl @@ -74,20 +74,16 @@ enum Composition { */ SIDEBAND = 5, /** - * A display decoration layer contains a buffer which is used to provide + * A display decoration layer contains a buffer which is an 8 bit + * alpha mask. Pixels in the mask with an alpha of 0 (transparent) will + * show the content underneath, and pixels with an alpha of 255 will be + * be rendered in black. An alpha in between will show the content + * blended with black. This is useful, for example, to provide * anti-aliasing on the cutout region/rounded corners on the top and * bottom of a display. * - * Pixels in the buffer with an alpha of 0 (transparent) will show the - * content underneath, and pixels with an alpha of 255 will be rendered in - * black. An alpha in between will show the underlying content blended with - * black. - * - * Some devices may support this flag with a buffer containing an 8 bit - * alpha mask. - * * Upon validateDisplay, the device may request a change from this type - * to either DEVICE or CLIENT. + * to CLIENT. */ DISPLAY_DECORATION = 6, } -- GitLab From 6c09bff37275579b28f9960445b219e058105971 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Thu, 23 Dec 2021 10:50:03 -0800 Subject: [PATCH 363/825] Put tuner scan handling to a thread. Bug: 210747502 Fix: 210747502 Test: atest android.media.tv.tuner.cts on AIDL and HILD HALs. Test: atest VtsHalTvTunerTargetTest Test: atest VtsHalTvTunerV1_1TargetTest Test: atest VtsHalTvTunerV1_0TargetTest Change-Id: Iead93df1dc09ef2a047893037ad2345ad4183b1e --- tv/tuner/1.1/default/Frontend.cpp | 44 ++++++++++++++++++++---------- tv/tuner/1.1/default/Frontend.h | 7 ++++- tv/tuner/aidl/default/Frontend.cpp | 43 +++++++++++++++++++---------- tv/tuner/aidl/default/Frontend.h | 7 ++++- 4 files changed, 71 insertions(+), 30 deletions(-) diff --git a/tv/tuner/1.1/default/Frontend.cpp b/tv/tuner/1.1/default/Frontend.cpp index f5463a9fe1..919c956392 100644 --- a/tv/tuner/1.1/default/Frontend.cpp +++ b/tv/tuner/1.1/default/Frontend.cpp @@ -88,46 +88,60 @@ Return Frontend::stopTune() { Return Frontend::scan(const FrontendSettings& settings, FrontendScanType type) { ALOGV("%s", __FUNCTION__); + + // If it's in middle of scanning, stop it first. + if (mScanThread.joinable()) { + mScanThread.join(); + } + + mFrontendSettings = settings; + mFrontendScanType = type; + mScanThread = std::thread(&Frontend::scanThreadLoop, this); + + return Result::SUCCESS; +} + +void Frontend::scanThreadLoop() { FrontendScanMessage msg; if (mIsLocked) { msg.isEnd(true); mCallback->onScanMessage(FrontendScanMessageType::END, msg); - return Result::SUCCESS; + return; } uint32_t frequency; - switch (settings.getDiscriminator()) { + switch (mFrontendSettings.getDiscriminator()) { case FrontendSettings::hidl_discriminator::analog: - frequency = settings.analog().frequency; + frequency = mFrontendSettings.analog().frequency; break; case FrontendSettings::hidl_discriminator::atsc: - frequency = settings.atsc().frequency; + frequency = mFrontendSettings.atsc().frequency; break; case FrontendSettings::hidl_discriminator::atsc3: - frequency = settings.atsc3().frequency; + frequency = mFrontendSettings.atsc3().frequency; break; case FrontendSettings::hidl_discriminator::dvbs: - frequency = settings.dvbs().frequency; + frequency = mFrontendSettings.dvbs().frequency; break; case FrontendSettings::hidl_discriminator::dvbc: - frequency = settings.dvbc().frequency; + frequency = mFrontendSettings.dvbc().frequency; break; case FrontendSettings::hidl_discriminator::dvbt: - frequency = settings.dvbt().frequency; + frequency = mFrontendSettings.dvbt().frequency; break; case FrontendSettings::hidl_discriminator::isdbs: - frequency = settings.isdbs().frequency; + frequency = mFrontendSettings.isdbs().frequency; break; case FrontendSettings::hidl_discriminator::isdbs3: - frequency = settings.isdbs3().frequency; + frequency = mFrontendSettings.isdbs3().frequency; break; case FrontendSettings::hidl_discriminator::isdbt: - frequency = settings.isdbt().frequency; + frequency = mFrontendSettings.isdbt().frequency; break; } - if (type == FrontendScanType::SCAN_BLIND) { + if (mFrontendScanType == FrontendScanType::SCAN_BLIND) { frequency += 100 * 1000; } @@ -204,8 +218,6 @@ Return Frontend::scan(const FrontendSettings& settings, FrontendScanType msg.isLocked(true); mCallback->onScanMessage(FrontendScanMessageType::LOCKED, msg); mIsLocked = true; - - return Result::SUCCESS; } Return Frontend::scan_1_1(const FrontendSettings& settings, FrontendScanType type, @@ -218,6 +230,10 @@ Return Frontend::scan_1_1(const FrontendSettings& settings, FrontendScan Return Frontend::stopScan() { ALOGV("%s", __FUNCTION__); + if (mScanThread.joinable()) { + mScanThread.join(); + } + mIsLocked = false; return Result::SUCCESS; } diff --git a/tv/tuner/1.1/default/Frontend.h b/tv/tuner/1.1/default/Frontend.h index a28fb6483b..bf739a8a98 100644 --- a/tv/tuner/1.1/default/Frontend.h +++ b/tv/tuner/1.1/default/Frontend.h @@ -20,6 +20,7 @@ #include #include #include +#include #include "Tuner.h" using namespace std; @@ -81,13 +82,17 @@ class Frontend : public V1_1::IFrontend { private: virtual ~Frontend(); bool supportsSatellite(); + void scanThreadLoop(); + sp mCallback; sp mTunerService; FrontendType mType = FrontendType::UNDEFINED; FrontendId mId = 0; bool mIsLocked = false; uint32_t mCiCamId; - + std::thread mScanThread; + FrontendSettings mFrontendSettings; + FrontendScanType mFrontendScanType; std::ifstream mFrontendData; }; diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index d36841c517..714612d006 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -87,47 +87,60 @@ Frontend::~Frontend() {} ::ndk::ScopedAStatus Frontend::scan(const FrontendSettings& in_settings, FrontendScanType in_type) { ALOGV("%s", __FUNCTION__); + // If it's in middle of scanning, stop it first. + if (mScanThread.joinable()) { + mScanThread.join(); + } + + mFrontendSettings = in_settings; + mFrontendScanType = in_type; + mScanThread = std::thread(&Frontend::scanThreadLoop, this); + + return ::ndk::ScopedAStatus::ok(); +} + +void Frontend::scanThreadLoop() { if (mIsLocked) { FrontendScanMessage msg; msg.set(true); mCallback->onScanMessage(FrontendScanMessageType::END, msg); - return ::ndk::ScopedAStatus::ok(); + return; } int64_t frequency = 0; - switch (in_settings.getTag()) { + switch (mFrontendSettings.getTag()) { case FrontendSettings::Tag::analog: - frequency = in_settings.get().frequency; + frequency = mFrontendSettings.get().frequency; break; case FrontendSettings::Tag::atsc: - frequency = in_settings.get().frequency; + frequency = mFrontendSettings.get().frequency; break; case FrontendSettings::Tag::atsc3: - frequency = in_settings.get().frequency; + frequency = mFrontendSettings.get().frequency; break; case FrontendSettings::Tag::dvbs: - frequency = in_settings.get().frequency; + frequency = mFrontendSettings.get().frequency; break; case FrontendSettings::Tag::dvbc: - frequency = in_settings.get().frequency; + frequency = mFrontendSettings.get().frequency; break; case FrontendSettings::Tag::dvbt: - frequency = in_settings.get().frequency; + frequency = mFrontendSettings.get().frequency; break; case FrontendSettings::Tag::isdbs: - frequency = in_settings.get().frequency; + frequency = mFrontendSettings.get().frequency; break; case FrontendSettings::Tag::isdbs3: - frequency = in_settings.get().frequency; + frequency = mFrontendSettings.get().frequency; break; case FrontendSettings::Tag::isdbt: - frequency = in_settings.get().frequency; + frequency = mFrontendSettings.get().frequency; break; default: break; } - if (in_type == FrontendScanType::SCAN_BLIND) { + if (mFrontendScanType == FrontendScanType::SCAN_BLIND) { frequency += 100 * 1000; } @@ -250,13 +263,15 @@ Frontend::~Frontend() {} mCallback->onScanMessage(FrontendScanMessageType::LOCKED, msg); mIsLocked = true; } - - return ::ndk::ScopedAStatus::ok(); } ::ndk::ScopedAStatus Frontend::stopScan() { ALOGV("%s", __FUNCTION__); + if (mScanThread.joinable()) { + mScanThread.join(); + } + mIsLocked = false; return ::ndk::ScopedAStatus::ok(); } diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h index 66ae90130a..fdedf1ef6f 100644 --- a/tv/tuner/aidl/default/Frontend.h +++ b/tv/tuner/aidl/default/Frontend.h @@ -19,6 +19,7 @@ #include #include #include +#include #include "Tuner.h" using namespace std; @@ -60,13 +61,17 @@ class Frontend : public BnFrontend { private: virtual ~Frontend(); bool supportsSatellite(); + void scanThreadLoop(); + std::shared_ptr mCallback; std::shared_ptr mTuner; FrontendType mType = FrontendType::UNDEFINED; int32_t mId = 0; bool mIsLocked = false; int32_t mCiCamId; - + std::thread mScanThread; + FrontendSettings mFrontendSettings; + FrontendScanType mFrontendScanType; std::ifstream mFrontendData; }; -- GitLab From c7ac0b2a17167cf3c30c1ce99cc8c664cf6c1f3e Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Wed, 13 Oct 2021 16:12:37 +0000 Subject: [PATCH 364/825] Adds sensors HAL AIDL interface Bug: 195593357 Test: Compile Change-Id: I6c63a6ba2dc3fbe5b25f401728d0724df2620bef --- .../compatibility_matrix.current.xml | 7 + sensors/aidl/Android.bp | 25 + .../hardware/sensors/AdditionalInfo.aidl | 76 ++ .../hardware/sensors/DynamicSensorInfo.aidl | 44 + .../android/hardware/sensors/Event.aidl | 99 ++ .../android/hardware/sensors/ISensors.aidl | 89 ++ .../hardware/sensors/ISensorsCallback.aidl | 39 + .../android/hardware/sensors/SensorInfo.aidl | 71 ++ .../hardware/sensors/SensorStatus.aidl | 42 + .../android/hardware/sensors/SensorType.aidl | 74 ++ .../hardware/sensors/AdditionalInfo.aidl | 234 +++++ .../hardware/sensors/DynamicSensorInfo.aidl | 39 + .../aidl/android/hardware/sensors/Event.aidl | 198 ++++ .../android/hardware/sensors/ISensors.aidl | 375 ++++++++ .../hardware/sensors/ISensorsCallback.aidl | 49 + .../android/hardware/sensors/SensorInfo.aidl | 217 +++++ .../hardware/sensors/SensorStatus.aidl | 27 + .../android/hardware/sensors/SensorType.aidl | 641 +++++++++++++ sensors/aidl/default/Android.bp | 59 ++ sensors/aidl/default/Sensors.cpp | 84 ++ .../default/include/sensors-impl/Sensors.h | 60 ++ sensors/aidl/default/main.cpp | 37 + sensors/aidl/default/sensors-default.rc | 5 + sensors/aidl/default/sensors-default.xml | 7 + sensors/aidl/vts/Android.bp | 49 + sensors/aidl/vts/OWNERS | 3 + sensors/aidl/vts/SensorsAidlEnvironment.cpp | 164 ++++ sensors/aidl/vts/SensorsAidlEnvironment.h | 110 +++ .../aidl/vts/VtsAidlHalSensorsTargetTest.cpp | 871 ++++++++++++++++++ 29 files changed, 3795 insertions(+) create mode 100644 sensors/aidl/Android.bp create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/AdditionalInfo.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/DynamicSensorInfo.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/ISensors.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/ISensorsCallback.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorInfo.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorStatus.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl create mode 100644 sensors/aidl/android/hardware/sensors/AdditionalInfo.aidl create mode 100644 sensors/aidl/android/hardware/sensors/DynamicSensorInfo.aidl create mode 100644 sensors/aidl/android/hardware/sensors/Event.aidl create mode 100644 sensors/aidl/android/hardware/sensors/ISensors.aidl create mode 100644 sensors/aidl/android/hardware/sensors/ISensorsCallback.aidl create mode 100644 sensors/aidl/android/hardware/sensors/SensorInfo.aidl create mode 100644 sensors/aidl/android/hardware/sensors/SensorStatus.aidl create mode 100644 sensors/aidl/android/hardware/sensors/SensorType.aidl create mode 100644 sensors/aidl/default/Android.bp create mode 100644 sensors/aidl/default/Sensors.cpp create mode 100644 sensors/aidl/default/include/sensors-impl/Sensors.h create mode 100644 sensors/aidl/default/main.cpp create mode 100644 sensors/aidl/default/sensors-default.rc create mode 100644 sensors/aidl/default/sensors-default.xml create mode 100644 sensors/aidl/vts/Android.bp create mode 100644 sensors/aidl/vts/OWNERS create mode 100644 sensors/aidl/vts/SensorsAidlEnvironment.cpp create mode 100644 sensors/aidl/vts/SensorsAidlEnvironment.h create mode 100644 sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index c875e8c2a1..2f3e523cf2 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -618,6 +618,13 @@ strongbox + + android.hardware.sensors + + ISensors + default + + android.hardware.sensors 1.0 diff --git a/sensors/aidl/Android.bp b/sensors/aidl/Android.bp new file mode 100644 index 0000000000..fd1ac441e2 --- /dev/null +++ b/sensors/aidl/Android.bp @@ -0,0 +1,25 @@ +// This is the expected build file, but it may not be right in all cases + +aidl_interface { + name: "android.hardware.sensors", + vendor_available: true, + srcs: ["android/hardware/sensors/*.aidl"], + imports: [ + "android.hardware.common-V2", + "android.hardware.common.fmq-V1", + ], + stability: "vintf", + backend: { + cpp: { + enabled: false, + }, + java: { + enabled: false, + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/AdditionalInfo.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/AdditionalInfo.aidl new file mode 100644 index 0000000000..518472305d --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/AdditionalInfo.aidl @@ -0,0 +1,76 @@ +/* + * 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 -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.sensors; +@FixedSize @VintfStability +parcelable AdditionalInfo { + android.hardware.sensors.AdditionalInfo.AdditionalInfoType type; + int serial; + android.hardware.sensors.AdditionalInfo.AdditionalInfoPayload payload; + @FixedSize @VintfStability + union AdditionalInfoPayload { + android.hardware.sensors.AdditionalInfo.AdditionalInfoPayload.Int32Values dataInt32; + android.hardware.sensors.AdditionalInfo.AdditionalInfoPayload.FloatValues dataFloat; + @FixedSize @VintfStability + parcelable Int32Values { + int[14] values; + } + @FixedSize @VintfStability + parcelable FloatValues { + float[14] values; + } + } + @Backing(type="int") @VintfStability + enum AdditionalInfoType { + AINFO_BEGIN = 0, + AINFO_END = 1, + AINFO_UNTRACKED_DELAY = 65536, + AINFO_INTERNAL_TEMPERATURE = 65537, + AINFO_VEC3_CALIBRATION = 65538, + AINFO_SENSOR_PLACEMENT = 65539, + AINFO_SAMPLING = 65540, + AINFO_CHANNEL_NOISE = 131072, + AINFO_CHANNEL_SAMPLER = 131073, + AINFO_CHANNEL_FILTER = 131074, + AINFO_CHANNEL_LINEAR_TRANSFORM = 131075, + AINFO_CHANNEL_NONLINEAR_MAP = 131076, + AINFO_CHANNEL_RESAMPLER = 131077, + AINFO_LOCAL_GEOMAGNETIC_FIELD = 196608, + AINFO_LOCAL_GRAVITY = 196609, + AINFO_DOCK_STATE = 196610, + AINFO_HIGH_PERFORMANCE_MODE = 196611, + AINFO_MAGNETIC_FIELD_CALIBRATION = 196612, + AINFO_CUSTOM_START = 268435456, + AINFO_DEBUGGING_START = 1073741824, + } +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/DynamicSensorInfo.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/DynamicSensorInfo.aidl new file mode 100644 index 0000000000..0c9a493a91 --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/DynamicSensorInfo.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 -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.sensors; +@FixedSize @VintfStability +parcelable DynamicSensorInfo { + boolean connected; + int sensorHandle; + android.hardware.sensors.DynamicSensorInfo.Uuid uuid; + @FixedSize @VintfStability + parcelable Uuid { + byte[16] values; + } +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl new file mode 100644 index 0000000000..186b2be8b3 --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl @@ -0,0 +1,99 @@ +/* + * 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 -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.sensors; +@FixedSize @VintfStability +parcelable Event { + long timestamp; + int sensorHandle; + android.hardware.sensors.SensorType sensorType; + android.hardware.sensors.Event.EventPayload payload; + @FixedSize @VintfStability + union EventPayload { + android.hardware.sensors.Event.EventPayload.Vec3 vec3; + android.hardware.sensors.Event.EventPayload.Vec4 vec4; + android.hardware.sensors.Event.EventPayload.Uncal uncal; + android.hardware.sensors.Event.EventPayload.MetaData meta; + float scalar; + long stepCount; + android.hardware.sensors.Event.EventPayload.HeartRate heartRate; + android.hardware.sensors.Event.EventPayload.Pose6Dof pose6DOF; + android.hardware.sensors.DynamicSensorInfo dynamic; + android.hardware.sensors.AdditionalInfo additional; + android.hardware.sensors.Event.EventPayload.Data data; + @FixedSize @VintfStability + parcelable Vec4 { + float x; + float y; + float z; + float w; + } + @FixedSize @VintfStability + parcelable Vec3 { + float x; + float y; + float z; + android.hardware.sensors.SensorStatus status; + } + @FixedSize @VintfStability + parcelable Uncal { + float x; + float y; + float z; + float xBias; + float yBias; + float zBias; + } + @FixedSize @VintfStability + parcelable HeartRate { + float bpm; + android.hardware.sensors.SensorStatus status; + } + @FixedSize @VintfStability + parcelable MetaData { + android.hardware.sensors.Event.EventPayload.MetaData.MetaDataEventType what; + @Backing(type="int") @VintfStability + enum MetaDataEventType { + META_DATA_FLUSH_COMPLETE = 1, + } + } + @FixedSize @VintfStability + parcelable Pose6Dof { + float[15] values; + } + @FixedSize @VintfStability + parcelable Data { + float[16] values; + } + } +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/ISensors.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/ISensors.aidl new file mode 100644 index 0000000000..f60f5bb247 --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/ISensors.aidl @@ -0,0 +1,89 @@ +/* + * 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 -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.sensors; +@VintfStability +interface ISensors { + void activate(in int sensorHandle, in boolean enabled); + void batch(in int sensorHandle, in long samplingPeriodNs, in long maxReportLatencyNs); + int configDirectReport(in int sensorHandle, in int channelHandle, in android.hardware.sensors.ISensors.RateLevel rate); + void flush(in int sensorHandle); + android.hardware.sensors.SensorInfo[] getSensorsList(); + void initialize(in android.hardware.common.fmq.MQDescriptor eventQueueDescriptor, in android.hardware.common.fmq.MQDescriptor wakeLockDescriptor, in android.hardware.sensors.ISensorsCallback sensorsCallback); + void injectSensorData(in android.hardware.sensors.Event event); + int registerDirectChannel(in android.hardware.sensors.ISensors.SharedMemInfo mem); + void setOperationMode(in android.hardware.sensors.ISensors.OperationMode mode); + void unregisterDirectChannel(in int channelHandle); + const int ERROR_NO_MEMORY = -12; + const int ERROR_BAD_VALUE = -22; + const int WAKE_LOCK_TIMEOUT_SECONDS = 1; + const int EVENT_QUEUE_FLAG_BITS_READ_AND_PROCESS = 1; + const int EVENT_QUEUE_FLAG_BITS_EVENTS_READ = 2; + const int WAKE_LOCK_QUEUE_FLAG_BITS_DATA_WRITTEN = 1; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_FIELD = 0; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_REPORT_TOKEN = 4; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_SENSOR_TYPE = 8; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_ATOMIC_COUNTER = 12; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_TIMESTAMP = 16; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_DATA = 24; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_RESERVED = 88; + const int DIRECT_REPORT_SENSOR_EVENT_TOTAL_LENGTH = 104; + @Backing(type="int") @VintfStability + enum RateLevel { + STOP = 0, + NORMAL = 1, + FAST = 2, + VERY_FAST = 3, + } + @Backing(type="int") @VintfStability + enum OperationMode { + NORMAL = 0, + DATA_INJECTION = 1, + } + @VintfStability + parcelable SharedMemInfo { + android.hardware.sensors.ISensors.SharedMemInfo.SharedMemType type; + android.hardware.sensors.ISensors.SharedMemInfo.SharedMemFormat format; + int size; + android.hardware.common.NativeHandle memoryHandle; + @Backing(type="int") @VintfStability + enum SharedMemFormat { + SENSORS_EVENT = 1, + } + @Backing(type="int") @VintfStability + enum SharedMemType { + ASHMEM = 1, + GRALLOC = 2, + } + } +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/ISensorsCallback.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/ISensorsCallback.aidl new file mode 100644 index 0000000000..78ab56711b --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/ISensorsCallback.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 -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.sensors; +@VintfStability +interface ISensorsCallback { + void onDynamicSensorsConnected(in android.hardware.sensors.SensorInfo[] sensorInfos); + void onDynamicSensorsDisconnected(in int[] sensorHandles); +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorInfo.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorInfo.aidl new file mode 100644 index 0000000000..996be3d4db --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorInfo.aidl @@ -0,0 +1,71 @@ +/* + * 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 -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.sensors; +@VintfStability +parcelable SensorInfo { + int sensorHandle; + String name; + String vendor; + int version; + android.hardware.sensors.SensorType type; + String typeAsString; + float maxRange; + float resolution; + float power; + int minDelayUs; + int fifoReservedEventCount; + int fifoMaxEventCount; + String requiredPermission; + int maxDelayUs; + int flags; + const int SENSOR_FLAG_BITS_WAKE_UP = 1; + const int SENSOR_FLAG_BITS_CONTINUOUS_MODE = 0; + const int SENSOR_FLAG_BITS_ON_CHANGE_MODE = 2; + const int SENSOR_FLAG_BITS_ONE_SHOT_MODE = 4; + const int SENSOR_FLAG_BITS_SPECIAL_REPORTING_MODE = 6; + const int SENSOR_FLAG_BITS_DATA_INJECTION = 16; + const int SENSOR_FLAG_BITS_DYNAMIC_SENSOR = 32; + const int SENSOR_FLAG_BITS_ADDITIONAL_INFO = 64; + const int SENSOR_FLAG_BITS_DIRECT_CHANNEL_ASHMEM = 1024; + const int SENSOR_FLAG_BITS_DIRECT_CHANNEL_GRALLOC = 2048; + const int SENSOR_FLAG_BITS_MASK_REPORTING_MODE = 14; + const int SENSOR_FLAG_BITS_MASK_DIRECT_REPORT = 896; + const int SENSOR_FLAG_BITS_MASK_DIRECT_CHANNEL = 3072; + const int SENSOR_FLAG_SHIFT_REPORTING_MODE = 1; + const int SENSOR_FLAG_SHIFT_DATA_INJECTION = 4; + const int SENSOR_FLAG_SHIFT_DYNAMIC_SENSOR = 5; + const int SENSOR_FLAG_SHIFT_ADDITIONAL_INFO = 6; + const int SENSOR_FLAG_SHIFT_DIRECT_REPORT = 7; + const int SENSOR_FLAG_SHIFT_DIRECT_CHANNEL = 10; +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorStatus.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorStatus.aidl new file mode 100644 index 0000000000..45217107fc --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorStatus.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 -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.sensors; +@Backing(type="byte") @VintfStability +enum SensorStatus { + NO_CONTACT = -1, + UNRELIABLE = 0, + ACCURACY_LOW = 1, + ACCURACY_MEDIUM = 2, + ACCURACY_HIGH = 3, +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl new file mode 100644 index 0000000000..4f3b5b2e79 --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl @@ -0,0 +1,74 @@ +/* + * 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 -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.sensors; +@Backing(type="int") @VintfStability +enum SensorType { + META_DATA = 0, + ACCELEROMETER = 1, + MAGNETIC_FIELD = 2, + ORIENTATION = 3, + GYROSCOPE = 4, + LIGHT = 5, + PRESSURE = 6, + PROXIMITY = 8, + GRAVITY = 9, + LINEAR_ACCELERATION = 10, + ROTATION_VECTOR = 11, + RELATIVE_HUMIDITY = 12, + AMBIENT_TEMPERATURE = 13, + MAGNETIC_FIELD_UNCALIBRATED = 14, + GAME_ROTATION_VECTOR = 15, + GYROSCOPE_UNCALIBRATED = 16, + SIGNIFICANT_MOTION = 17, + STEP_DETECTOR = 18, + STEP_COUNTER = 19, + GEOMAGNETIC_ROTATION_VECTOR = 20, + HEART_RATE = 21, + TILT_DETECTOR = 22, + WAKE_GESTURE = 23, + GLANCE_GESTURE = 24, + PICK_UP_GESTURE = 25, + WRIST_TILT_GESTURE = 26, + DEVICE_ORIENTATION = 27, + POSE_6DOF = 28, + STATIONARY_DETECT = 29, + MOTION_DETECT = 30, + HEART_BEAT = 31, + DYNAMIC_SENSOR_META = 32, + ADDITIONAL_INFO = 33, + LOW_LATENCY_OFFBODY_DETECT = 34, + ACCELEROMETER_UNCALIBRATED = 35, + HINGE_ANGLE = 36, + DEVICE_PRIVATE_BASE = 65536, +} diff --git a/sensors/aidl/android/hardware/sensors/AdditionalInfo.aidl b/sensors/aidl/android/hardware/sensors/AdditionalInfo.aidl new file mode 100644 index 0000000000..9fe2d39700 --- /dev/null +++ b/sensors/aidl/android/hardware/sensors/AdditionalInfo.aidl @@ -0,0 +1,234 @@ +/* + * 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. + */ + +package android.hardware.sensors; + +@FixedSize +@VintfStability +parcelable AdditionalInfo { + /** + * type of payload data, see AdditionalInfoType + */ + AdditionalInfoType type; + + /** + * sequence number of this frame for this type + */ + int serial; + + AdditionalInfoPayload payload; + + @FixedSize + @VintfStability + union AdditionalInfoPayload { + Int32Values dataInt32; + FloatValues dataFloat; + + @FixedSize + @VintfStability + parcelable Int32Values { + int[14] values; + } + + @FixedSize + @VintfStability + parcelable FloatValues { + float[14] values; + } + } + + @VintfStability + @Backing(type="int") + enum AdditionalInfoType { + /** + * Marks the beginning of additional information frames + */ + AINFO_BEGIN = 0, + + /** + * Marks the end of additional information frames + */ + AINFO_END = 1, + + /** + * Estimation of the delay that is not tracked by sensor timestamps. This + * includes delay introduced by sensor front-end filtering, data transport, + * etc. + * float[2]: delay in seconds, standard deviation of estimated value + */ + AINFO_UNTRACKED_DELAY = 0x10000, + + /** + * float: Celsius temperature + */ + AINFO_INTERNAL_TEMPERATURE, + + /** + * First three rows of a homogeneous matrix, which represents calibration to + * a three-element vector raw sensor reading. + * float[12]: 3x4 matrix in row major order + */ + AINFO_VEC3_CALIBRATION, + + /** + * Provides the orientation and location of the sensor element in terms of + * the Android coordinate system. This data is given as a 3x4 matrix + * consisting of a 3x3 rotation matrix (R) concatenated with a 3x1 location + * vector (t). The rotation matrix provides the orientation of the Android + * device coordinate frame relative to the local coordinate frame of the + * sensor. Note that assuming the axes conventions of the sensor are the + * same as Android, this is the inverse of the matrix applied to raw + * samples read from the sensor to convert them into the Android + * representation. The location vector represents the translation from the + * origin of the Android sensor coordinate system to the geometric center + * of the sensor, specified in millimeters (mm). + * + * float[12]: 3x4 matrix in row major order [R; t] + * + * Example: + * This raw buffer: {0, 1, 0, 0, -1, 0, 0, 10, 0, 0, 1, -2.5} + * Corresponds to this 3x4 matrix: + * 0 1 0 0 + * -1 0 0 10 + * 0 0 1 -2.5 + * The sensor is oriented such that: + * - the device X axis corresponds to the sensor's local -Y axis + * - the device Y axis corresponds to the sensor's local X axis + * - the device Z axis and sensor's local Z axis are equivalent + * In other words, if viewing the origin of the Android coordinate + * system from the positive Z direction, the device coordinate frame is + * to be rotated 90 degrees counter-clockwise about the Z axis to align + * with the sensor's local coordinate frame. Equivalently, a vector in + * the Android coordinate frame may be multiplied with R to rotate it + * 90 degrees clockwise (270 degrees counter-clockwise), yielding its + * representation in the sensor's coordinate frame. + * Relative to the origin of the Android coordinate system, the physical + * center of the sensor is located 10mm in the positive Y direction, and + * 2.5mm in the negative Z direction. + */ + AINFO_SENSOR_PLACEMENT, + + /** + * float[2]: raw sample period in seconds, + * standard deviation of sampling period + */ + AINFO_SAMPLING, + + /** + * int32_t: noise type + * float[n]: parameters + */ + AINFO_CHANNEL_NOISE = 0x20000, + + /** + * float[3]: sample period, standard deviation of sample period, + * quantization unit + */ + AINFO_CHANNEL_SAMPLER, + + /** + * Represents a filter: + * \sum_j a_j y[n-j] == \sum_i b_i x[n-i] + * + * int32_t[3]: number of feedforward coeffients M, + * number of feedback coefficients N (for FIR filter, N = 1). + * bit mask that represents which element the filter is applied + * to. (bit 0==1 means this filter applies to vector element 0). + * float[M+N]: filter coefficients (b0, b1, ..., b_{M-1}), then + * (a0, a1, ..., a_{N-1}), a0 is always 1. + * + * Multiple frames may be needed for higher number of taps. + */ + AINFO_CHANNEL_FILTER, + + /** + * int32_t[2]: size in (row, column) ... 1st frame + * float[n]: matrix element values in row major order. + */ + AINFO_CHANNEL_LINEAR_TRANSFORM, + + /** + * int32_t[2]: extrapolate method, interpolate method + * float[n]: mapping key points in pairs, (in, out)... + * (may be used to model saturation). + */ + AINFO_CHANNEL_NONLINEAR_MAP, + + /** + * int32_t: resample method (0-th order, 1st order...) + * float[1]: resample ratio (upsampling if < 1.0, downsampling if > 1.0). + */ + AINFO_CHANNEL_RESAMPLER, + + /** + * Operation environment parameters section + * Types in the following section is sent down (instead of reported from) + * device as additional information to aid sensor operation. Data is sent + * via injectSensorData() function to sensor handle -1 denoting all sensors + * in device. + * + * + * Local geomagnetic field information based on device geo location. This + * type is primarily for for magnetic field calibration and rotation vector + * sensor fusion. + * float[3]: strength (uT), declination and inclination angle (rad). + */ + AINFO_LOCAL_GEOMAGNETIC_FIELD = 0x30000, + + /** + * Local gravitational acceleration strength at device geo location. + * float: gravitational acceleration norm in m/s^2. + */ + AINFO_LOCAL_GRAVITY, + + /** + * Device dock state. + * int32_t: dock state following Android API Intent.EXTRA_DOCK_STATE + * definition, undefined value is ignored. + */ + AINFO_DOCK_STATE, + + /** + * High performance mode hint. Device is able to use up more power and take + * more resources to improve throughput and latency in high performance mode. + * One possible use case is virtual reality, when sensor latency need to be + * carefully controlled. + * int32_t: 1 or 0, denote if device is in/out of high performance mode, + * other values is ignored. + */ + AINFO_HIGH_PERFORMANCE_MODE, + + /** + * Magnetic field calibration hint. Device is notified when manually + * triggered magnetic field calibration procedure is started or stopped. The + * calibration procedure is assumed timed out after 1 minute from start, + * even if an explicit stop is not received. + * + * int32_t: 1 for start, 0 for stop, other value is ignored. + */ + AINFO_MAGNETIC_FIELD_CALIBRATION, + + /** + * Custom information + */ + AINFO_CUSTOM_START = 0x10000000, + + /** + * Debugging + */ + AINFO_DEBUGGING_START = 0x40000000, + } +} diff --git a/sensors/aidl/android/hardware/sensors/DynamicSensorInfo.aidl b/sensors/aidl/android/hardware/sensors/DynamicSensorInfo.aidl new file mode 100644 index 0000000000..4b14ed0b20 --- /dev/null +++ b/sensors/aidl/android/hardware/sensors/DynamicSensorInfo.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. + */ + +package android.hardware.sensors; + +@VintfStability +@FixedSize +parcelable DynamicSensorInfo { + boolean connected; + + int sensorHandle; + + /** + * UUID of a dynamic sensor (using RFC 4122 byte order) + * For UUID 12345678-90AB-CDEF-1122-334455667788 the uuid field is + * initialized as: + * {0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0x11, ...} + */ + Uuid uuid; + + @FixedSize + @VintfStability + parcelable Uuid { + byte[16] values; + } +} diff --git a/sensors/aidl/android/hardware/sensors/Event.aidl b/sensors/aidl/android/hardware/sensors/Event.aidl new file mode 100644 index 0000000000..6ef9acbbda --- /dev/null +++ b/sensors/aidl/android/hardware/sensors/Event.aidl @@ -0,0 +1,198 @@ +/* + * 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. + */ + +package android.hardware.sensors; + +import android.hardware.sensors.AdditionalInfo; +import android.hardware.sensors.DynamicSensorInfo; +import android.hardware.sensors.SensorStatus; +import android.hardware.sensors.SensorType; + +@VintfStability +@FixedSize +parcelable Event { + /** + * Time measured in nanoseconds, in "elapsedRealtimeNano()'s" timebase. + */ + long timestamp; + + /** + * sensor identifier + */ + int sensorHandle; + + SensorType sensorType; + + /** + * Union discriminated on sensorType + */ + EventPayload payload; + + /* + * acceleration values are in meter per second per second (m/s^2) + * magnetic vector values are in micro-Tesla (uT) + * orientation values are in degrees + * gyroscope values are in rad/s + * temperature is in degrees centigrade (Celsius) + * distance in centimeters + * light in SI lux units + * pressure in hectopascal (hPa) + * relative humidity in percent + */ + @VintfStability + @FixedSize + union EventPayload { + /** + * SensorType::ACCELEROMETER, SensorType::MAGNETIC_FIELD, + * SensorType::ORIENTATION, SensorType::GYROSCOPE, SensorType::GRAVITY, + * SensorType::LINEAR_ACCELERATION + */ + Vec3 vec3; + + /** + * SensorType::GAME_ROTATION_VECTOR + */ + Vec4 vec4; + + /** + * SensorType::MAGNETIC_FIELD_UNCALIBRATED, + * SensorType::GYROSCOPE_UNCALIBRATED + * SensorType::ACCELEROMETER_UNCALIBRATED + */ + Uncal uncal; + + /** + * SensorType::META_DATA + */ + MetaData meta; + + /** + * SensorType::DEVICE_ORIENTATION, SensorType::LIGHT, SensorType::PRESSURE, + * SensorType::TEMPERATURE, SensorType::PROXIMITY, + * SensorType::RELATIVE_HUMIDITY, SensorType::AMBIENT_TEMPERATURE, + * SensorType::SIGNIFICANT_MOTION, SensorType::STEP_DETECTOR, + * SensorType::TILT_DETECTOR, SensorType::WAKE_GESTURE, + * SensorType::GLANCE_GESTURE, SensorType::PICK_UP_GESTURE, + * SensorType::WRIST_TILT_GESTURE, SensorType::STATIONARY_DETECT, + * SensorType::MOTION_DETECT, SensorType::HEART_BEAT, + * SensorType::LOW_LATENCY_OFFBODY_DETECT + */ + float scalar; + + /** + * SensorType::STEP_COUNTER + */ + long stepCount; + + /** + * SensorType::HEART_RATE + */ + HeartRate heartRate; + + /** + * SensorType::POSE_6DOF + */ + Pose6Dof pose6DOF; + + /** + * SensorType::DYNAMIC_SENSOR_META + */ + DynamicSensorInfo dynamic; + + /** + * SensorType::ADDITIONAL_INFO + */ + AdditionalInfo additional; + + /** + * The following sensors should use the data field: + * - Undefined/custom sensor type >= SensorType::DEVICE_PRIVATE_BASE + * - SensorType::ROTATION_VECTOR, SensorType::GEOMAGNETIC_ROTATION_VECTOR: + * - These are Vec4 types with an additional float accuracy field, + * where data[4] is the estimated heading accuracy in radians + * (-1 if unavailable, and invalid if not in the range (0, 2 * pi]). + */ + Data data; + + @FixedSize + @VintfStability + parcelable Vec4 { + float x; + float y; + float z; + float w; + } + + @FixedSize + @VintfStability + parcelable Vec3 { + float x; + float y; + float z; + SensorStatus status; + } + + @FixedSize + @VintfStability + parcelable Uncal { + float x; + float y; + float z; + float xBias; + float yBias; + float zBias; + } + + @FixedSize + @VintfStability + parcelable HeartRate { + /** + * Heart rate in beats per minute. + * Set to 0 when status is SensorStatus::UNRELIABLE or + * SensorStatus::NO_CONTACT + */ + float bpm; + /** + * Status of the heart rate sensor for this reading. + */ + SensorStatus status; + } + + @FixedSize + @VintfStability + parcelable MetaData { + MetaDataEventType what; + + @VintfStability + @Backing(type="int") + enum MetaDataEventType { + META_DATA_FLUSH_COMPLETE = 1, + } + } + + @FixedSize + @VintfStability + parcelable Pose6Dof { + float[15] values; + } + + @FixedSize + @VintfStability + parcelable Data { + float[16] values; + } + } +} diff --git a/sensors/aidl/android/hardware/sensors/ISensors.aidl b/sensors/aidl/android/hardware/sensors/ISensors.aidl new file mode 100644 index 0000000000..2ac188454b --- /dev/null +++ b/sensors/aidl/android/hardware/sensors/ISensors.aidl @@ -0,0 +1,375 @@ +/* + * 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. + */ + +package android.hardware.sensors; + +import android.hardware.common.NativeHandle; +import android.hardware.common.fmq.MQDescriptor; +import android.hardware.common.fmq.SynchronizedReadWrite; +import android.hardware.sensors.Event; +import android.hardware.sensors.ISensorsCallback; +import android.hardware.sensors.SensorInfo; + +@VintfStability +interface ISensors { + /** + * Activate/de-activate one sensor. + * + * After sensor de-activation, existing sensor events that have not + * been written to the event queue must be abandoned immediately so that + * subsequent activations do not get stale sensor events (events + * that are generated prior to the latter activation). + * + * @param sensorHandle is the handle of the sensor to change. + * @param enabled set to true to enable, or false to disable the sensor. + * @return Status::ok on success + * EX_ILLEGAL_ARGUMENT if the sensorHandle is invalid. + */ + void activate(in int sensorHandle, in boolean enabled); + + /** + * Sets a sensor’s parameters, including sampling frequency and maximum + * report latency. This function can be called while the sensor is + * activated, in which case it must not cause any sensor measurements to + * be lost: transitioning from one sampling rate to the other cannot cause + * lost events, nor can transitioning from a high maximum report latency to + * a low maximum report latency. + * + * @param sensorHandle handle of sensor to be changed. + * @param samplingPeriodNs specifies sensor sample period in nanoseconds. + * @param maxReportLatencyNs allowed delay time before an event is sampled + * to time of report. + * @return Status::ok on success + * EX_ILLEGAL_ARGUMENT if any parameters are invalid. + */ + void batch(in int sensorHandle, in long samplingPeriodNs, in long maxReportLatencyNs); + + /** + * Configure direct sensor event report in direct channel. + * + * This function start, modify rate or stop direct report of a sensor in a + * certain direct channel. + * + * @param sensorHandle handle of sensor to be configured. When combined + * with STOP rate, sensorHandle can be -1 to denote all active sensors + * in the direct channel specified by channel Handle. + * @param channelHandle handle of direct channel to be configured. + * @param rate rate level, see RateLevel enum. + * @param out reportToken The report token, ignored if rate is STOP. + * See SharedMemFormat. + * @return The direct report token to identify multiple sensors of the same type in a single + * direct channel. + * @return Status::ok on success + * EX_ILLEGAL_ARGUMENT if the parameter is invalid (e.g. unsupported rate level + * for sensor, channelHandle does not exist, etc). + * EX_UNSUPPORTED_OPERATION if this functionality is unsupported. + */ + int configDirectReport(in int sensorHandle, in int channelHandle, in RateLevel rate); + + /** + * Trigger a flush of internal FIFO. + * + * Flush adds a FLUSH_COMPLETE metadata event to the end of the "batch mode" + * FIFO for the specified sensor and flushes the FIFO. If the FIFO is empty + * or if the sensor doesn't support batching (FIFO size zero), return + * SUCCESS and add a trivial FLUSH_COMPLETE event added to the event stream. + * This applies to all sensors other than one-shot sensors. If the sensor + * is a one-shot sensor, flush must return EX_ILLEGAL_ARGUMENT and not generate any + * flush complete metadata. If the sensor is not active at the time flush() + * is called, flush() return EX_ILLEGAL_ARGUMENT. + * + * @param sensorHandle handle of sensor to be flushed. + * @return Status::ok on success + * EX_ILLEGAL_ARGUMENT if the sensorHandle is invalid. + */ + void flush(in int sensorHandle); + + /** + * Enumerate all available (static) sensors. + * + * The SensorInfo for each sensor returned by getSensorsList must be stable + * from the initial call to getSensorsList after a device boot until the + * entire system restarts. The SensorInfo for each sensor must not change + * between subsequent calls to getSensorsList, even across restarts of the + * HAL and its dependencies (for example, the sensor handle for a given + * sensor must not change across HAL restarts). + */ + SensorInfo[] getSensorsList(); + + /** + * Initialize the Sensors HAL's Fast Message Queues (FMQ) and callback. + * + * The Fast Message Queues (FMQ) that are used to send data between the + * framework and the HAL. The callback is used by the HAL to notify the + * framework of asynchronous events, such as a dynamic sensor connection. + * + * The Event FMQ is used to transport sensor events from the HAL to the + * framework. The Event FMQ is created using the eventQueueDescriptor. + * Data may only be written to the Event FMQ. Data must not be read from + * the Event FMQ since the framework is the only reader. Upon receiving + * sensor events, the HAL writes the sensor events to the Event FMQ. + * + * Once the HAL is finished writing sensor events to the Event FMQ, the HAL + * must notify the framework that sensor events are available to be read and + * processed. This is accomplished by either: + * 1) Calling the Event FMQ’s EventFlag::wake() function with + * EventQueueFlagBits::READ_AND_PROCESS + * 2) Setting the write notification in the Event FMQ’s writeBlocking() + * function to EventQueueFlagBits::READ_AND_PROCESS. + * + * If the Event FMQ’s writeBlocking() function is used, the read + * notification must be set to EventQueueFlagBits::EVENTS_READ in order to + * be notified and unblocked when the framework has successfully read events + * from the Event FMQ. + * + * The Wake Lock FMQ is used by the framework to notify the HAL when it is + * safe to release its wake_lock. When the framework receives WAKE_UP events + * from the Event FMQ and the framework has acquired a wake_lock, the + * framework must write the number of WAKE_UP events processed to the Wake + * Lock FMQ. When the HAL reads the data from the Wake Lock FMQ, the HAL + * decrements its current count of unprocessed WAKE_UP events and releases + * its wake_lock if the current count of unprocessed WAKE_UP events is + * zero. It is important to note that the HAL must acquire the wake lock and + * update its internal state regarding the number of outstanding WAKE_UP + * events _before_ posting the event to the Wake Lock FMQ, in order to avoid + * a race condition that can lead to loss of wake lock synchronization with + * the framework. + * + * The framework must use the WAKE_LOCK_QUEUE_FLAG_BITS_DATA_WRITTEN value to + * notify the HAL that data has been written to the Wake Lock FMQ and must + * be read by HAL. + * + * The ISensorsCallback is used by the HAL to notify the framework of + * asynchronous events, such as a dynamic sensor connection. + * + * The name of any wake_lock acquired by the Sensors HAL for WAKE_UP events + * must begin with "SensorsHAL_WAKEUP". + * + * If WAKE_LOCK_TIMEOUT_SECONDS has elapsed since the most recent WAKE_UP + * event was written to the Event FMQ without receiving a message on the + * Wake Lock FMQ, then any held wake_lock for WAKE_UP events must be + * released. + * + * If either the Event FMQ or the Wake Lock FMQ is already initialized when + * initialize is invoked, then both existing FMQs must be discarded and the + * new descriptors must be used to create new FMQs within the HAL. The + * number of outstanding WAKE_UP events should also be reset to zero, and + * any outstanding wake_locks held as a result of WAKE_UP events should be + * released. + * + * All active sensor requests and direct channels must be closed and + * properly cleaned up when initialize is called in order to ensure that the + * HAL and framework's state is consistent (e.g. after a runtime restart). + * + * initialize must be thread safe and prevent concurrent calls + * to initialize from simultaneously modifying state. + * + * @param eventQueueDescriptor Fast Message Queue descriptor that is used to + * create the Event FMQ which is where sensor events are written. The + * descriptor is obtained from the framework's FMQ that is used to read + * sensor events. + * @param wakeLockDescriptor Fast Message Queue descriptor that is used to + * create the Wake Lock FMQ which is where wake_lock events are read + * from. The descriptor is obtained from the framework's FMQ that is + * used to write wake_lock events. + * @param sensorsCallback sensors callback that receives asynchronous data + * from the Sensors HAL. + * @return Status::ok on success + * EX_ILLEGAL_ARGUMENT if the descriptor is invalid (such as null). + */ + void initialize(in MQDescriptor eventQueueDescriptor, + in MQDescriptor wakeLockDescriptor, + in ISensorsCallback sensorsCallback); + + /** + * Inject a single sensor event or push operation environment parameters to + * device. + * + * When device is in NORMAL mode, this function is called to push operation + * environment data to device. In this operation, Event is always of + * SensorType::AdditionalInfo type. See operation environment parameters + * section in AdditionalInfoType. + * + * When device is in DATA_INJECTION mode, this function is also used for + * injecting sensor events. + * + * Regardless of OperationMode, injected SensorType::ADDITIONAL_INFO + * type events should not be routed back to the sensor event queue. + * + * @see AdditionalInfoType + * @see OperationMode + * @param event sensor event to be injected + * @return Status::ok on success + * EX_UNSUPPORTED_OPERATION if this functionality is unsupported. + * EX_SECURITY if the operation is not allowed. + * EX_SERVICE_SPECIFIC on error + * - ERROR_BAD_VALUE if the sensor event cannot be injected. + */ + void injectSensorData(in Event event); + + /** + * Register direct report channel. + * + * Register a direct channel with supplied shared memory information. Upon + * return, the sensor hardware is responsible for resetting the memory + * content to initial value (depending on memory format settings). + * + * @param mem shared memory info data structure. + * @param out channelHandle The registered channel handle. + * @return The direct channel handle, which is positive if successfully registered, and -1 + * otherwise. + * @return Status::ok on success + * EX_ILLEGAL_ARGUMENT if the shared memory information is not consistent. + * EX_UNSUPPORTED_OPERATION if this functionality is unsupported. + * EX_SERVICE_SPECIFIC on error + * - ERROR_NO_MEMORY if shared memory cannot be used by sensor system. + */ + int registerDirectChannel(in SharedMemInfo mem); + + /** + * Place the module in a specific mode. + * + * @see OperationMode + * @param mode The operation mode. + * @return Status::ok on success + * EX_UNSUPPORTED_OPERATION if requested mode is not supported. + * EX_SECURITY if the operation is not allowed. + */ + void setOperationMode(in OperationMode mode); + + /** + * Unregister direct report channel. + * + * Unregister a direct channel previously registered using + * registerDirectChannel, and remove all active sensor report configured in + * still active sensor report configured in the direct channel. + * + * @param channelHandle handle of direct channel to be unregistered. + * @return Status::ok on success + * EX_UNSUPPORTED_OPERATION if direct report is not supported. + */ + void unregisterDirectChannel(in int channelHandle); + + /** + * Direct report rate level definition. Except for SENSOR_DIRECT_RATE_STOP, each + * rate level covers the range (55%, 220%] * nominal report rate. For example, + * if config direct report specify a rate level SENSOR_DIRECT_RATE_FAST, it is + * legal for sensor hardware to report event at a rate greater than 110Hz, and + * less or equal to 440Hz. Note that rate has to remain steady without variation + * before new rate level is configured, i.e. if a sensor is configured to + * SENSOR_DIRECT_RATE_FAST and starts to report event at 256Hz, it cannot + * change rate to 128Hz after a few seconds of running even if 128Hz is also in + * the legal range of SENSOR_DIRECT_RATE_FAST. Thus, it is recommended to + * associate report rate with RateLvel statically for single sensor. + */ + @VintfStability + @Backing(type="int") + enum RateLevel { + STOP, + NORMAL, + FAST, + VERY_FAST, + } + + @VintfStability + @Backing(type="int") + enum OperationMode { + // Normal operation. Default state of the module. + NORMAL = 0, + // Loopback mode. Data is injected for the supported sensors by the sensor service in this + // mode. + DATA_INJECTION = 1, + } + + @VintfStability + parcelable SharedMemInfo { + SharedMemType type; + SharedMemFormat format; + int size; + NativeHandle memoryHandle; + + @VintfStability + @Backing(type="int") + enum SharedMemFormat { + SENSORS_EVENT = 1, + } + + @VintfStability + @Backing(type="int") + enum SharedMemType { + ASHMEM = 1, + GRALLOC, + } + } + + /** + * Error codes that are used as service specific errors with the AIDL return + * value EX_SERVICE_SPECIFIC. + */ + const int ERROR_NO_MEMORY = -12; + const int ERROR_BAD_VALUE = -22; + + /** + * The maximum number of seconds to wait for a message on the Wake Lock FMQ + * before automatically releasing any wake_lock held for a WAKE_UP event. + */ + const int WAKE_LOCK_TIMEOUT_SECONDS = 1; + + /** + * Used to notify the Event FMQ that events should be read and processed. + */ + const int EVENT_QUEUE_FLAG_BITS_READ_AND_PROCESS = 1 << 0; + + /** + * Used by the framework to signal to the HAL when events have been + * successfully read from the Event FMQ. + * + * If the MessageQueue::writeBlocking function is being used to write sensor + * events to the Event FMQ, then the readNotification parameter must be set + * to EVENTS_READ. + */ + const int EVENT_QUEUE_FLAG_BITS_EVENTS_READ = 1 << 1; + + /** + * Used to notify the HAL that the framework has written data to the Wake + * Lock FMQ. + */ + const int WAKE_LOCK_QUEUE_FLAG_BITS_DATA_WRITTEN = 1 << 0; + + /** + * Constants related to direct sensor events. The following table illustrates the + * data format. + * + * Offset Type Name + * ----------------------------------- + * 0x0000 int32_t Size (always DIRECT_REPORT_SENSOR_EVENT_TOTAL_LENGTH) + * 0x0004 int32_t Sensor report token + * 0x0008 int32_t Type (see SensorType.aidl) + * 0x000C uint32_t Atomic counter + * 0x0010 int64_t Timestamp (see Event.aidl) + * 0x0018 float[16]/ Data + * int64_t[8] + * 0x0058 int32_t[4] Reserved (set to zero) + */ + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_FIELD = 0x0; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_REPORT_TOKEN = 0x4; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_SENSOR_TYPE = 0x8; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_ATOMIC_COUNTER = 0xC; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_TIMESTAMP = 0x10; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_DATA = 0x18; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_RESERVED = 0x58; + const int DIRECT_REPORT_SENSOR_EVENT_TOTAL_LENGTH = 104; +} diff --git a/sensors/aidl/android/hardware/sensors/ISensorsCallback.aidl b/sensors/aidl/android/hardware/sensors/ISensorsCallback.aidl new file mode 100644 index 0000000000..01bae52d24 --- /dev/null +++ b/sensors/aidl/android/hardware/sensors/ISensorsCallback.aidl @@ -0,0 +1,49 @@ +/* + * 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. + */ + +package android.hardware.sensors; + +import android.hardware.sensors.SensorInfo; + +@VintfStability +interface ISensorsCallback { + /** + * Notify the framework that new dynamic sensors have been connected. + * + * If a dynamic sensor was previously connected and has not been + * disconnected, then that sensor must not be included in sensorInfos. + * + * @param sensorInfos vector of SensorInfo for each dynamic sensor that + * was connected. + */ + void onDynamicSensorsConnected(in SensorInfo[] sensorInfos); + + /** + * Notify the framework that previously connected dynamic sensors have been + * disconnected. + * + * If a dynamic sensor was previously disconnected and has not been + * reconnected, then that sensor must not be included in sensorHandles. + * + * The HAL must ensure that all sensor events from departing dynamic + * sensors have been written to the Event FMQ before calling + * onDynamicSensorsDisconnected. + * + * @param sensorHandles vector of sensor handles for each dynamic sensors + * that was disconnected. + */ + void onDynamicSensorsDisconnected(in int[] sensorHandles); +} diff --git a/sensors/aidl/android/hardware/sensors/SensorInfo.aidl b/sensors/aidl/android/hardware/sensors/SensorInfo.aidl new file mode 100644 index 0000000000..35caf8bd67 --- /dev/null +++ b/sensors/aidl/android/hardware/sensors/SensorInfo.aidl @@ -0,0 +1,217 @@ +/* + * 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. + */ + +package android.hardware.sensors; + +import android.hardware.sensors.SensorType; + +@VintfStability +parcelable SensorInfo { + /** + * handle that identifies this sensors. This handle is used to reference + * this sensor throughout the HAL API. + */ + int sensorHandle; + + /** + * Name of this sensor. + * All sensors of the same "type" must have a different "name". + */ + String name; + + /** + * vendor of the hardware part + */ + String vendor; + + /** + * version of the hardware part + driver. The value of this field + * must increase when the driver is updated in a way that changes the + * output of this sensor. This is important for fused sensors when the + * fusion algorithm is updated. + */ + int version; + + /** + * this sensor's type. + */ + SensorType type; + + /** + * type of this sensor as a string. + * + * When defining an OEM specific sensor or sensor manufacturer specific + * sensor, use your reserve domain name as a prefix. + * e.g. com.google.glass.onheaddetector + * + * For sensors of known type defined in SensorType (value < + * SensorType::DEVICE_PRIVATE_BASE), this can be an empty string. + */ + String typeAsString; + + /** + * maximum range of this sensor's value in SI units + */ + float maxRange; + + /** + * smallest difference between two values reported by this sensor + */ + float resolution; + + /** + * rough estimate of this sensor's power consumption in mA + */ + float power; + + /** + * this value depends on the reporting mode: + * + * continuous: minimum sample period allowed in microseconds + * on-change : 0 + * one-shot :-1 + * special : 0, unless otherwise noted + */ + int minDelayUs; + + /** + * number of events reserved for this sensor in the batch mode FIFO. + * If there is a dedicated FIFO for this sensor, then this is the + * size of this FIFO. If the FIFO is shared with other sensors, + * this is the size reserved for that sensor and it can be zero. + */ + int fifoReservedEventCount; + + /** + * maximum number of events of this sensor that could be batched. + * This is especially relevant when the FIFO is shared between + * several sensors; this value is then set to the size of that FIFO. + */ + int fifoMaxEventCount; + + /** + * permission required to see this sensor, register to it and receive data. + * Set to "" if no permission is required. Some sensor types like the + * heart rate monitor have a mandatory require_permission. + * For sensors that always require a specific permission, like the heart + * rate monitor, the android framework might overwrite this string + * automatically. + */ + String requiredPermission; + + /** + * This value is defined only for continuous mode and on-change sensors. + * It is the delay between two sensor events corresponding to the lowest + * frequency that this sensor supports. When lower frequencies are requested + * through batch()/setDelay() the events will be generated at this frequency + * instead. + * It can be used by the framework or applications to estimate when the + * batch FIFO may be full. + * + * continuous, on-change: maximum sampling period allowed in microseconds. + * one-shot, special : 0 + */ + int maxDelayUs; + + /** + * Bitmasks defined in SENSOR_FLAG_BITS_* below. + */ + int flags; + + /** + * Whether this sensor wakes up the AP from suspend mode when data is + * available. Whenever sensor events are delivered from a wake_up sensor, + * the driver needs to hold a wake_lock till the events are read by the + * SensorService i.e. till ISensors::poll() is called the next time. + * Once poll is called again it means events have been read by the + * SensorService, the driver can safely release the wake_lock. SensorService + * will continue to hold a wake_lock till the app actually reads the events. + */ + const int SENSOR_FLAG_BITS_WAKE_UP = 1; + + /** + * Reporting modes for various sensors. Each sensor will have exactly one of + * these modes set. + * The least significant 2nd, 3rd and 4th bits are used to represent four + * possible reporting modes. + */ + const int SENSOR_FLAG_BITS_CONTINUOUS_MODE = 0; + const int SENSOR_FLAG_BITS_ON_CHANGE_MODE = 2; + const int SENSOR_FLAG_BITS_ONE_SHOT_MODE = 4; + const int SENSOR_FLAG_BITS_SPECIAL_REPORTING_MODE = 6; + + /** + * Set this flag if the sensor supports data_injection mode and allows data + * to be injected from the SensorService. When in data_injection ONLY + * sensors with this flag set are injected sensor data and only sensors with + * this flag set are activated. Eg: Accelerometer and Step Counter sensors + * can be set with this flag and SensorService will inject accelerometer + * data and read the corresponding step counts. + */ + const int SENSOR_FLAG_BITS_DATA_INJECTION = 0x10; + + /** + * Set this flag if the sensor is a dynamically connected sensor. See + * DynamicSensorInfo and DYNAMIC_SENSOR_META for details. + */ + const int SENSOR_FLAG_BITS_DYNAMIC_SENSOR = 0x20; + + /** + * Set this flag if sensor additional information is supported. + * See ADDITIONAL_INFO and AdditionalInfo for details. + */ + const int SENSOR_FLAG_BITS_ADDITIONAL_INFO = 0x40; + + /** + * Set this flag if sensor suppor direct channel backed by ashmem. + * See SharedMemType and registerDirectChannel for more details. + */ + const int SENSOR_FLAG_BITS_DIRECT_CHANNEL_ASHMEM = 0x400; + + /** + * Set this flag if sensor suppor direct channel backed by gralloc HAL memory. + * See SharedMemType and registerDirectChannel for more details. + */ + const int SENSOR_FLAG_BITS_DIRECT_CHANNEL_GRALLOC = 0x800; + + /** + * Flags mask for reporting mode of sensor. + */ + const int SENSOR_FLAG_BITS_MASK_REPORTING_MODE = 0xE; + + /** + * Flags mask for direct report maximum rate level support. + * See RateLevel. + */ + const int SENSOR_FLAG_BITS_MASK_DIRECT_REPORT = 0x380; + + /** + * Flags mask for all direct channel support bits. + * See SharedMemType. + */ + const int SENSOR_FLAG_BITS_MASK_DIRECT_CHANNEL = 0xC00; + + /** + * Defines the number of bits different pieces of information are shifted in the + * SENSOR_FLAG_BITS_* bitmask. + */ + const int SENSOR_FLAG_SHIFT_REPORTING_MODE = 1; + const int SENSOR_FLAG_SHIFT_DATA_INJECTION = 4; + const int SENSOR_FLAG_SHIFT_DYNAMIC_SENSOR = 5; + const int SENSOR_FLAG_SHIFT_ADDITIONAL_INFO = 6; + const int SENSOR_FLAG_SHIFT_DIRECT_REPORT = 7; + const int SENSOR_FLAG_SHIFT_DIRECT_CHANNEL = 10; +} diff --git a/sensors/aidl/android/hardware/sensors/SensorStatus.aidl b/sensors/aidl/android/hardware/sensors/SensorStatus.aidl new file mode 100644 index 0000000000..0fd86975f5 --- /dev/null +++ b/sensors/aidl/android/hardware/sensors/SensorStatus.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.sensors; + +@VintfStability +@Backing(type="byte") +enum SensorStatus { + NO_CONTACT = -1, + UNRELIABLE = 0, + ACCURACY_LOW = 1, + ACCURACY_MEDIUM = 2, + ACCURACY_HIGH = 3, +} diff --git a/sensors/aidl/android/hardware/sensors/SensorType.aidl b/sensors/aidl/android/hardware/sensors/SensorType.aidl new file mode 100644 index 0000000000..95c7a6a2ad --- /dev/null +++ b/sensors/aidl/android/hardware/sensors/SensorType.aidl @@ -0,0 +1,641 @@ +/* + * 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. + */ + +package android.hardware.sensors; + +@VintfStability +@Backing(type="int") +enum SensorType { + /** + * META_DATA is a special event type used to populate the MetaData + * structure. It doesn't correspond to a physical sensor. Events of this + * type exist only inside the HAL, their primary purpose is to signal the + * completion of a flush request. + */ + META_DATA = 0, + + /** + * ACCELEROMETER + * reporting-mode: continuous + * + * All values are in SI units (m/s^2) and measure the acceleration of the + * device minus the acceleration due to gravity. + * + * Implement the non-wake-up version of this sensor and implement the + * wake-up version if the system possesses a wake up fifo. + */ + ACCELEROMETER = 1, + + /** + * MAGNETIC_FIELD + * reporting-mode: continuous + * + * All values are in micro-Tesla (uT) and measure the geomagnetic + * field in the X, Y and Z axis. + * + * Implement the non-wake-up version of this sensor and implement the + * wake-up version if the system possesses a wake up fifo. + */ + MAGNETIC_FIELD = 2, + + /** + * ORIENTATION + * reporting-mode: continuous + * + * All values are angles in degrees. + * + * Orientation sensors return sensor events for all 3 axes at a constant + * rate defined by setDelay(). + * + * Implement the non-wake-up version of this sensor and implement the + * wake-up version if the system possesses a wake up fifo. + */ + ORIENTATION = 3, + + /** + * GYROSCOPE + * reporting-mode: continuous + * + * All values are in radians/second and measure the rate of rotation + * around the X, Y and Z axis. + * + * Implement the non-wake-up version of this sensor and implement the + * wake-up version if the system possesses a wake up fifo. + */ + GYROSCOPE = 4, + + /** + * LIGHT + * reporting-mode: on-change + * + * The light sensor value is returned in SI lux units. + * + * Both wake-up and non wake-up versions are useful. + */ + LIGHT = 5, + + /** + * PRESSURE + * reporting-mode: continuous + * + * The pressure sensor return the athmospheric pressure in hectopascal (hPa) + * + * Implement the non-wake-up version of this sensor and implement the + * wake-up version if the system possesses a wake up fifo. + */ + PRESSURE = 6, + + /** + * PROXIMITY + * reporting-mode: on-change + * + * The proximity sensor which turns the screen off and back on during calls + * is the wake-up proximity sensor. Implement wake-up proximity sensor + * before implementing a non wake-up proximity sensor. For the wake-up + * proximity sensor set the flag SENSOR_FLAG_WAKE_UP. + * The value corresponds to the distance to the nearest object in + * centimeters. + */ + PROXIMITY = 8, + + /** + * GRAVITY + * reporting-mode: continuous + * + * A gravity output indicates the direction of and magnitude of gravity in + * the devices's coordinates. + * + * Implement the non-wake-up version of this sensor and implement the + * wake-up version if the system possesses a wake up fifo. + */ + GRAVITY = 9, + + /** + * LINEAR_ACCELERATION + * reporting-mode: continuous + * + * Indicates the linear acceleration of the device in device coordinates, + * not including gravity. + * + * Implement the non-wake-up version of this sensor and implement the + * wake-up version if the system possesses a wake up fifo. + */ + LINEAR_ACCELERATION = 10, + + /** + * ROTATION_VECTOR + * reporting-mode: continuous + * + * The rotation vector symbolizes the orientation of the device relative to + * the East-North-Up coordinates frame. + * + * Implement the non-wake-up version of this sensor and implement the + * wake-up version if the system possesses a wake up fifo. + */ + ROTATION_VECTOR = 11, + + /** + * RELATIVE_HUMIDITY + * reporting-mode: on-change + * + * A relative humidity sensor measures relative ambient air humidity and + * returns a value in percent. + * + * Both wake-up and non wake-up versions are useful. + */ + RELATIVE_HUMIDITY = 12, + + /** + * AMBIENT_TEMPERATURE + * reporting-mode: on-change + * + * The ambient (room) temperature in degree Celsius. + * + * Both wake-up and non wake-up versions are useful. + */ + AMBIENT_TEMPERATURE = 13, + + /** + * MAGNETIC_FIELD_UNCALIBRATED + * reporting-mode: continuous + * + * Similar to MAGNETIC_FIELD, but the hard iron calibration is + * reported separately instead of being included in the measurement. + * + * Implement the non-wake-up version of this sensor and implement the + * wake-up version if the system possesses a wake up fifo. + */ + MAGNETIC_FIELD_UNCALIBRATED = 14, + + /** + * GAME_ROTATION_VECTOR + * reporting-mode: continuous + * + * Similar to ROTATION_VECTOR, but not using the geomagnetic + * field. + * + * Implement the non-wake-up version of this sensor and implement the + * wake-up version if the system possesses a wake up fifo. + */ + GAME_ROTATION_VECTOR = 15, + + /** + * GYROSCOPE_UNCALIBRATED + * reporting-mode: continuous + * + * All values are in radians/second and measure the rate of rotation + * around the X, Y and Z axis. + * + * Implement the non-wake-up version of this sensor and implement the + * wake-up version if the system possesses a wake up fifo. + */ + GYROSCOPE_UNCALIBRATED = 16, + + /** + * SIGNIFICANT_MOTION + * reporting-mode: one-shot + * + * A sensor of this type triggers an event each time significant motion + * is detected and automatically disables itself. + * For Significant Motion sensor to be useful, it must be defined as a + * wake-up sensor. (set SENSOR_FLAG_WAKE_UP). Implement the wake-up + * significant motion sensor. A non wake-up version is not useful. + * The only allowed value to return is 1.0. + */ + SIGNIFICANT_MOTION = 17, + + /** + * STEP_DETECTOR + * reporting-mode: special + * + * A sensor of this type triggers an event each time a step is taken + * by the user. The only allowed value to return is 1.0 and an event + * is generated for each step. + * + * Both wake-up and non wake-up versions are useful. + */ + STEP_DETECTOR = 18, + + /** + * STEP_COUNTER + * reporting-mode: on-change + * + * A sensor of this type returns the number of steps taken by the user since + * the last reboot while activated. The value is returned as a uint64_t and + * is reset to zero only on a system / android reboot. + * + * Implement the non-wake-up version of this sensor and implement the + * wake-up version if the system possesses a wake up fifo. + */ + STEP_COUNTER = 19, + + /** + * GEOMAGNETIC_ROTATION_VECTOR + * reporting-mode: continuous + * + * Similar to ROTATION_VECTOR, but using a magnetometer instead + * of using a gyroscope. + * + * Implement the non-wake-up version of this sensor and implement the + * wake-up version if the system possesses a wake up fifo. + */ + GEOMAGNETIC_ROTATION_VECTOR = 20, + + /** + * HEART_RATE + * reporting-mode: on-change + * + * A sensor of this type returns the current heart rate. + * The events contain the current heart rate in beats per minute (BPM) and + * the status of the sensor during the measurement. See "HeartRate" below + * for more details. + * + * Because this sensor is on-change, events must be generated when and only + * when heart_rate.bpm or heart_rate.status have changed since the last + * event. In particular, upon the first activation, unless the device is + * known to not be on the body, the status field of the first event must be + * set to SensorStatus::UNRELIABLE. The event should be generated no faster + * than every period_ns passed to setDelay() or to batch(). + * See the definition of the on-change reporting mode for more information. + * + * SensorInfo.requiredPermission must be set to + * SENSOR_PERMISSION_BODY_SENSORS. + * + * Both wake-up and non wake-up versions are useful. + */ + HEART_RATE = 21, + + /** + * WAKE_UP_TILT_DETECTOR + * reporting-mode: special (setDelay has no impact) + * + * A sensor of this type generates an event each time a tilt event is + * detected. A tilt event must be generated if the direction of the + * 2-seconds window average gravity changed by at least 35 degrees since the + * activation or the last trigger of the sensor. + * + * reference_estimated_gravity = average of accelerometer measurements over + * the first 1 second after activation or the estimated gravity at the last + * trigger. + * + * current_estimated_gravity = average of accelerometer measurements over + * the last 2 seconds. + * + * trigger when + * angle(reference_estimated_gravity, current_estimated_gravity) + * > 35 degrees + * + * Large accelerations without a change in phone orientation must not + * trigger a tilt event. + * For example, a sharp turn or strong acceleration while driving a car + * must not trigger a tilt event, even though the angle of the average + * acceleration might vary by more than 35 degrees. + * + * Typically, this sensor is implemented with the help of only an + * accelerometer. Other sensors can be used as well if they do not increase + * the power consumption significantly. This is a low power sensor that + * must allow the AP to go into suspend mode. Do not emulate this sensor + * in the HAL. + * Like other wake up sensors, the driver is expected to a hold a wake_lock + * with a timeout of 200 ms while reporting this event. The only allowed + * return value is 1.0. + * + * Implement only the wake-up version of this sensor. + */ + TILT_DETECTOR = 22, + + /** + * WAKE_GESTURE + * reporting-mode: one-shot + * + * A sensor enabling waking up the device based on a device specific motion. + * + * When this sensor triggers, the device behaves as if the power button was + * pressed, turning the screen on. This behavior (turning on the screen when + * this sensor triggers) might be deactivated by the user in the device + * settings. Changes in settings do not impact the behavior of the sensor: + * only whether the framework turns the screen on when it triggers. + * + * The actual gesture to be detected is not specified, and can be chosen by + * the manufacturer of the device. + * This sensor must be low power, as it is likely to be activated 24/7. + * The only allowed value to return is 1.0. + * + * Implement only the wake-up version of this sensor. + */ + WAKE_GESTURE = 23, + + /** + * GLANCE_GESTURE + * reporting-mode: one-shot + * + * A sensor enabling briefly turning the screen on to enable the user to + * glance content on screen based on a specific motion. The device must + * turn the screen off after a few moments. + * + * When this sensor triggers, the device turns the screen on momentarily + * to allow the user to glance notifications or other content while the + * device remains locked in a non-interactive state (dozing). This behavior + * (briefly turning on the screen when this sensor triggers) might be + * deactivated by the user in the device settings. + * Changes in settings do not impact the behavior of the sensor: only + * whether the framework briefly turns the screen on when it triggers. + * + * The actual gesture to be detected is not specified, and can be chosen by + * the manufacturer of the device. + * This sensor must be low power, as it is likely to be activated 24/7. + * The only allowed value to return is 1.0. + * + * Implement only the wake-up version of this sensor. + */ + GLANCE_GESTURE = 24, + + /** + * PICK_UP_GESTURE + * reporting-mode: one-shot + * + * A sensor of this type triggers when the device is picked up regardless of + * wherever is was before (desk, pocket, bag). The only allowed return value + * is 1.0. This sensor de-activates itself immediately after it triggers. + * + * Implement only the wake-up version of this sensor. + */ + PICK_UP_GESTURE = 25, + + /** + * WRIST_TILT_GESTURE + * trigger-mode: special + * wake-up sensor: yes + * + * A sensor of this type triggers an event each time a tilt of the + * wrist-worn device is detected. + * + * This sensor must be low power, as it is likely to be activated 24/7. + * The only allowed value to return is 1.0. + * + * Implement only the wake-up version of this sensor. + */ + WRIST_TILT_GESTURE = 26, + + /** + * DEVICE_ORIENTATION + * reporting-mode: on-change + * + * The current orientation of the device. The value is reported in + * the "scalar" element of the EventPayload in Event. The + * only values that can be reported are (please refer to Android Sensor + * Coordinate System to understand the X and Y axis direction with respect + * to default orientation): + * - 0: device is in default orientation (Y axis is vertical and points up) + * - 1: device is rotated 90 degrees counter-clockwise from default + * orientation (X axis is vertical and points up) + * - 2: device is rotated 180 degrees from default orientation (Y axis is + * vertical and points down) + * - 3: device is rotated 90 degrees clockwise from default orientation + * (X axis is vertical and points down) + * + * Moving the device to an orientation where the Z axis is vertical (either + * up or down) must not cause a new event to be reported. + * + * To improve the user experience of this sensor, it is recommended to + * implement some physical (i.e., rotation angle) and temporal (i.e., delay) + * hysteresis. In other words, minor or transient rotations must not cause + * a new event to be reported. + * + * This is a low power sensor that intended to reduce interrupts of + * application processor and thus allow it to go sleep. Use hardware + * implementation based on low power consumption sensors, such as + * accelerometer. Device must not emulate this sensor in the HAL. + * + * Both wake-up and non wake-up versions are useful. + */ + DEVICE_ORIENTATION = 27, + + /** + * POSE_6DOF + * trigger-mode: continuous + * + * A sensor of this type returns the pose of the device. + * Pose of the device is defined as the orientation of the device from a + * Earth Centered Earth Fixed frame and the translation from an arbitrary + * point at subscription. + * + * This sensor can be high power. It can use any and all of the following + * . Accelerometer + * . Gyroscope + * . Camera + * . Depth Camera + * + */ + POSE_6DOF = 28, + + /** + * STATIONARY_DETECT + * trigger mode: one shot + * + * A sensor of this type returns an event if the device is still/stationary + * for a while. The period of time to monitor for stationarity must be + * greater than 5 seconds. The latency must be less than 10 seconds. + * + * Stationarity here refers to absolute stationarity. eg: device on desk. + * + * The only allowed value to return is 1.0. + */ + STATIONARY_DETECT = 29, + + /** + * MOTION_DETECT + * trigger mode: one shot + * + * A sensor of this type returns an event if the device is not still for + * for a while. The period of time to monitor for stationarity must be + * greater than 5 seconds. The latency must be less than 10 seconds. + * + * Motion here refers to any mechanism in which the device is causes to be + * moved in its inertial frame. eg: Pickin up the device and walking with it + * to a nearby room may trigger motion wherewas keeping the device on a + * table on a smooth train moving at constant velocity may not trigger + * motion. + * + * The only allowed value to return is 1.0. + */ + MOTION_DETECT = 30, + + /** + * HEART_BEAT + * trigger mode: continuous + * + * A sensor of this type returns an event everytime a hear beat peak is + * detected. + * + * Peak here ideally corresponds to the positive peak in the QRS complex of + * and ECG signal. + * + * The sensor is not expected to be optimized for latency. As a guide, a + * latency of up to 10 seconds is acceptable. However, the timestamp attached + * to the event must be accuratly correspond to the time the peak occurred. + * + * The sensor event contains a parameter for the confidence in the detection + * of the peak where 0.0 represent no information at all, and 1.0 represents + * certainty. + */ + HEART_BEAT = 31, + + /** + * DYNAMIC_SENSOR_META + * trigger-mode: special + * wake-up sensor: yes + * + * A sensor event of this type is received when a dynamic sensor is added to + * or removed from the system. At most one sensor of this type can be + * present in one sensor HAL implementation and presence of a sensor of this + * type in sensor HAL implementation indicates that this sensor HAL supports + * dynamic sensor feature. Operations, such as batch, activate and setDelay, + * to this special purpose sensor must be treated as no-op and return + * successful; flush() also has to generate flush complete event as if this + * is a sensor that does not support batching. + * + * A dynamic sensor connection indicates connection of a physical device or + * instantiation of a virtual sensor backed by algorithm; and a dynamic + * sensor disconnection indicates the opposite. A sensor event of + * DYNAMIC_SENSOR_META type should be delivered regardless of + * the activation status of the sensor in the event of dynamic sensor + * connection and disconnection. In the sensor event, besides the common + * data entries, "dynamic_sensor_meta", which includes fields for connection + * status, handle of the sensor involved, pointer to sensor_t structure and + * a uuid field, must be populated. + * + * At a dynamic sensor connection event, fields of sensor_t structure + * referenced by a pointer in dynamic_sensor_meta must be filled as if it + * was regular sensors. Sensor HAL is responsible for recovery of memory if + * the corresponding data is dynamicially allocated. However, the + * pointer must be valid until the first activate call to the sensor + * reported in this connection event. At a dynamic sensor disconnection, + * the sensor_t pointer must be NULL. + * + * The sensor handle assigned to dynamic sensors must never be the same as + * that of any regular static sensors, and must be unique until next boot. + * In another word, if a handle h is used for a dynamic sensor A, that same + * number cannot be used for the same dynamic sensor A or another dynamic + * sensor B even after disconnection of A until reboot. + * + * The UUID field will be used for identifying the sensor in addition to + * name, vendor and version and type. For physical sensors of the same + * model, all sensors will have the same values in sensor_t, but the UUID + * must be unique and persistent for each individual unit. An all zero + * UUID indicates it is not possible to differentiate individual sensor + * unit. + * + */ + DYNAMIC_SENSOR_META = 32, + + /** + * ADDITIONAL_INFO + * reporting-mode: N/A + * + * This sensor type is for delivering additional sensor information aside + * from sensor event data. + * Additional information may include sensor front-end group delay, internal + * calibration parameters, noise level metrics, device internal temperature, + * etc. + * + * This type will never bind to a sensor. In other words, no sensor in the + * sensor list can have the type SENSOR_TYPE_ADDITIONAL_INFO. If a + * sensor HAL supports sensor additional information feature, it reports + * sensor_event_t with "sensor" field set to handle of the reporting sensor + * and "type" field set to ADDITIONAL_INFO. Delivery of + * additional information events is triggered under two conditions: an + * enable activate() call or a flush() call to the corresponding sensor. + * Besides, time varying parameters can update infrequently without being + * triggered. Device is responsible to control update rate. The recommend + * update rate is less than 1/1000 of sensor event rate or less than once + * per minute in average. + * + * A single additional information report consists of multiple frames. + * Sequences of these frames are ordered using timestamps, which means the + * timestamps of sequential frames have to be at least 1 nanosecond apart + * from each other. Each frame is a sensor_event_t delivered through the HAL + * interface, with related data stored in the "additional_info" field, which + * is of type additional_info_event_t. + * The "type" field of additional_info_event_t denotes the nature of the + * payload data (see additional_info_type_t). + * The "serial" field is used to keep the sequence of payload data that + * spans multiple frames. The first frame of the entire report is always of + * type AINFO_BEGIN, and the last frame is always AINFO_END. + * + * If flush() was triggering the report, all additional information frames + * must be delivered after flush complete event. + */ + ADDITIONAL_INFO = 33, + + /** + * LOW_LATENCY_OFFBODY_DETECT + * trigger-mode: on-change + * wake-up sensor: yes + * + * A sensor of this type is defined for devices that are supposed to be worn + * by the user in the normal use case (such as a watch, wristband, etc) and + * is not yet defined for other device. + * + * A sensor of this type triggers an event each time the wearable device + * is removed from the body and each time it's put back onto the body. + * It must be low-latency and be able to detect the on-body to off-body + * transition within one second (event delivery time included), + * and 3-second latency to determine the off-body to on-body transition + * (event delivery time included). + * + * There are only two valid event values for the sensor to return : + * 0.0 for off-body + * 1.0 for on-body + * + */ + LOW_LATENCY_OFFBODY_DETECT = 34, + + /** + * ACCELEROMETER_UNCALIBRATED + * reporting-mode: continuous + * + * All values are in SI units (m/s^2) and measure the acceleration of the + * device minus the acceleration due to gravity. + * + * Implement the non-wake-up version of this sensor and implement the + * wake-up version if the system possesses a wake up fifo. + */ + ACCELEROMETER_UNCALIBRATED = 35, + + /** + * HINGE_ANGLE + * reporting-mode: on-change + * wake-up sensor: yes + * + * A sensor of this type measures the angle, in degrees, between two + * integral parts of the device. Movement of a hinge measured by this sensor + * type is expected to alter the ways in which the user may interact with + * the device, for example by unfolding or revealing a display. + * + * Sensor data is output using EventPayload.scalar. + * + * Implement wake-up proximity sensor before implementing a non wake-up + * proximity sensor. + */ + HINGE_ANGLE = 36, + + /** + * Base for device manufacturers private sensor types. + * These sensor types can't be exposed in the SDK. + */ + DEVICE_PRIVATE_BASE = 0x10000, +} diff --git a/sensors/aidl/default/Android.bp b/sensors/aidl/default/Android.bp new file mode 100644 index 0000000000..487387d1ce --- /dev/null +++ b/sensors/aidl/default/Android.bp @@ -0,0 +1,59 @@ +/* + * 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. + */ + +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_library_static { + name: "libsensorsexampleimpl", + vendor: true, + shared_libs: [ + "libbase", + "libbinder_ndk", + "android.hardware.sensors-V1-ndk", + ], + export_include_dirs: ["include"], + srcs: [ + "Sensors.cpp", + ], + visibility: [ + ":__subpackages__", + "//hardware/interfaces/tests/extension/sensors:__subpackages__", + ], +} + +cc_binary { + name: "android.hardware.sensors-service.example", + relative_install_path: "hw", + init_rc: ["sensors-default.rc"], + vintf_fragments: ["sensors-default.xml"], + vendor: true, + shared_libs: [ + "libbase", + "libbinder_ndk", + "android.hardware.sensors-V1-ndk", + ], + static_libs: [ + "libsensorsexampleimpl", + ], + srcs: ["main.cpp"], +} diff --git a/sensors/aidl/default/Sensors.cpp b/sensors/aidl/default/Sensors.cpp new file mode 100644 index 0000000000..14bbbbf7f4 --- /dev/null +++ b/sensors/aidl/default/Sensors.cpp @@ -0,0 +1,84 @@ +/* + * 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 "sensors-impl/Sensors.h" + +using ::aidl::android::hardware::common::fmq::MQDescriptor; +using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite; +using ::aidl::android::hardware::sensors::Event; +using ::aidl::android::hardware::sensors::ISensors; +using ::aidl::android::hardware::sensors::ISensorsCallback; +using ::aidl::android::hardware::sensors::SensorInfo; + +namespace aidl { +namespace android { +namespace hardware { +namespace sensors { + +// TODO(b/195593357): Implement AIDL HAL +::ndk::ScopedAStatus Sensors::activate(int32_t /* in_sensorHandle */, bool /* in_enabled */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Sensors::batch(int32_t /* in_sensorHandle */, + int64_t /* in_samplingPeriodNs */, + int64_t /* in_maxReportLatencyNs */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Sensors::configDirectReport(int32_t /* in_sensorHandle */, + int32_t /* in_channelHandle */, + ISensors::RateLevel /* in_rate */, + int32_t* /* _aidl_return */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Sensors::flush(int32_t /* in_sensorHandle */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Sensors::getSensorsList(std::vector* /* _aidl_return */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Sensors::initialize( + const MQDescriptor& /* in_eventQueueDescriptor */, + const MQDescriptor& /* in_wakeLockDescriptor */, + const std::shared_ptr& /* in_sensorsCallback */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Sensors::injectSensorData(const Event& /* in_event */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Sensors::registerDirectChannel(const ISensors::SharedMemInfo& /* in_mem */, + int32_t* /* _aidl_return */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Sensors::setOperationMode(OperationMode /* in_mode */) { + return ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Sensors::unregisterDirectChannel(int32_t /* in_channelHandle */) { + return ndk::ScopedAStatus::ok(); +} + +} // namespace sensors +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/sensors/aidl/default/include/sensors-impl/Sensors.h b/sensors/aidl/default/include/sensors-impl/Sensors.h new file mode 100644 index 0000000000..b6be4a5efd --- /dev/null +++ b/sensors/aidl/default/include/sensors-impl/Sensors.h @@ -0,0 +1,60 @@ +/* + * 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 + +namespace aidl { +namespace android { +namespace hardware { +namespace sensors { + +class Sensors : public BnSensors { + ::ndk::ScopedAStatus activate(int32_t in_sensorHandle, bool in_enabled) override; + ::ndk::ScopedAStatus batch(int32_t in_sensorHandle, int64_t in_samplingPeriodNs, + int64_t in_maxReportLatencyNs) override; + ::ndk::ScopedAStatus configDirectReport( + int32_t in_sensorHandle, int32_t in_channelHandle, + ::aidl::android::hardware::sensors::ISensors::RateLevel in_rate, + int32_t* _aidl_return) override; + ::ndk::ScopedAStatus flush(int32_t in_sensorHandle) override; + ::ndk::ScopedAStatus getSensorsList( + std::vector<::aidl::android::hardware::sensors::SensorInfo>* _aidl_return) override; + ::ndk::ScopedAStatus initialize( + const ::aidl::android::hardware::common::fmq::MQDescriptor< + ::aidl::android::hardware::sensors::Event, + ::aidl::android::hardware::common::fmq::SynchronizedReadWrite>& + in_eventQueueDescriptor, + const ::aidl::android::hardware::common::fmq::MQDescriptor< + int32_t, ::aidl::android::hardware::common::fmq::SynchronizedReadWrite>& + in_wakeLockDescriptor, + const std::shared_ptr<::aidl::android::hardware::sensors::ISensorsCallback>& + in_sensorsCallback) override; + ::ndk::ScopedAStatus injectSensorData( + const ::aidl::android::hardware::sensors::Event& in_event) override; + ::ndk::ScopedAStatus registerDirectChannel( + const ::aidl::android::hardware::sensors::ISensors::SharedMemInfo& in_mem, + int32_t* _aidl_return) override; + ::ndk::ScopedAStatus setOperationMode( + ::aidl::android::hardware::sensors::ISensors::OperationMode in_mode) override; + ::ndk::ScopedAStatus unregisterDirectChannel(int32_t in_channelHandle) override; +}; + +} // namespace sensors +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/sensors/aidl/default/main.cpp b/sensors/aidl/default/main.cpp new file mode 100644 index 0000000000..8a5a7de124 --- /dev/null +++ b/sensors/aidl/default/main.cpp @@ -0,0 +1,37 @@ +/* + * 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 "sensors-impl/Sensors.h" + +#include +#include +#include + +using aidl::android::hardware::sensors::Sensors; + +int main() { + ABinderProcess_setThreadPoolMaxThreadCount(0); + + // Make a default sensors service + auto sensor = ndk::SharedRefBase::make(); + const std::string sensorName = std::string() + Sensors::descriptor + "/default"; + binder_status_t status = + AServiceManager_addService(sensor->asBinder().get(), sensorName.c_str()); + CHECK_EQ(status, STATUS_OK); + + ABinderProcess_joinThreadPool(); + return EXIT_FAILURE; // should not reach +} diff --git a/sensors/aidl/default/sensors-default.rc b/sensors/aidl/default/sensors-default.rc new file mode 100644 index 0000000000..96da85dc29 --- /dev/null +++ b/sensors/aidl/default/sensors-default.rc @@ -0,0 +1,5 @@ +service vendor.sensors-default /vendor/bin/hw/android.hardware.sensors-service.example + class hal + user system + group system + rlimit rtprio 10 10 diff --git a/sensors/aidl/default/sensors-default.xml b/sensors/aidl/default/sensors-default.xml new file mode 100644 index 0000000000..7898a6bab0 --- /dev/null +++ b/sensors/aidl/default/sensors-default.xml @@ -0,0 +1,7 @@ + + + android.hardware.sensors + 1 + ISensors/default + + diff --git a/sensors/aidl/vts/Android.bp b/sensors/aidl/vts/Android.bp new file mode 100644 index 0000000000..5a519a5a1e --- /dev/null +++ b/sensors/aidl/vts/Android.bp @@ -0,0 +1,49 @@ +// Copyright 2021 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +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: "VtsAidlHalSensorsTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: [ + "VtsAidlHalSensorsTargetTest.cpp", + "SensorsAidlEnvironment.cpp", + ], + shared_libs: [ + "libbinder", + "libbinder_ndk", + "libfmq", + "android.hardware.common-V2-ndk", + "android.hardware.common.fmq-V1-ndk", + ], + static_libs: [ + "android.hardware.sensors-V1-ndk", + "VtsHalSensorsTargetTestUtils", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/sensors/aidl/vts/OWNERS b/sensors/aidl/vts/OWNERS new file mode 100644 index 0000000000..90c233030e --- /dev/null +++ b/sensors/aidl/vts/OWNERS @@ -0,0 +1,3 @@ +arthuri@google.com +bduddie@google.com +stange@google.com diff --git a/sensors/aidl/vts/SensorsAidlEnvironment.cpp b/sensors/aidl/vts/SensorsAidlEnvironment.cpp new file mode 100644 index 0000000000..e71251f698 --- /dev/null +++ b/sensors/aidl/vts/SensorsAidlEnvironment.cpp @@ -0,0 +1,164 @@ +/* + * 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 "SensorsAidlEnvironment.h" + +#include +#include + +#include + +using aidl::android::hardware::sensors::BnSensorsCallback; +using aidl::android::hardware::sensors::SensorInfo; +using android::hardware::EventFlag; +using ndk::ScopedAStatus; +using ndk::SpAIBinder; + +namespace { + +void serviceDied(void* /* cookie */) { + ALOGE("Sensors HAL died (likely crashed) during test"); + FAIL() << "Sensors HAL died during test"; +} + +class NoOpSensorsCallback : public BnSensorsCallback { + public: + ScopedAStatus onDynamicSensorsConnected( + const std::vector& /* sensorInfos */) override { + return ScopedAStatus::ok(); + } + + ScopedAStatus onDynamicSensorsDisconnected( + const std::vector& /* sensorHandles */) override { + return ScopedAStatus::ok(); + } +}; + +} // anonymous namespace + +SensorsAidlEnvironment::SensorsAidlEnvironment(const std::string& service_name) + : SensorsVtsEnvironmentBase(service_name), + mCallback(ndk::SharedRefBase::make()), + mDeathRecipient(AIBinder_DeathRecipient_new(serviceDied)) {} + +bool SensorsAidlEnvironment::resetHal() { + bool succeed = false; + do { + mSensors = ISensors::fromBinder( + SpAIBinder(AServiceManager_waitForService(mServiceName.c_str()))); + if (mSensors == nullptr) { + break; + } + + AIBinder_linkToDeath(mSensors->asBinder().get(), mDeathRecipient.get(), this); + + // Initialize FMQs + mWakeLockQueue = std::make_unique(MAX_RECEIVE_BUFFER_EVENT_COUNT, + true /* configureEventFlagWord */); + mEventQueue = std::make_unique(MAX_RECEIVE_BUFFER_EVENT_COUNT, + true /* configureEventFlagWord */); + + if (mWakeLockQueue == nullptr || mEventQueue == nullptr) { + break; + } + + EventFlag::deleteEventFlag(&mEventQueueFlag); + EventFlag::createEventFlag(mEventQueue->getEventFlagWord(), &mEventQueueFlag); + if (mEventQueueFlag == nullptr) { + break; + } + + mSensors->initialize(mEventQueue->dupeDesc(), mWakeLockQueue->dupeDesc(), mCallback); + + std::vector sensorList; + if (!mSensors->getSensorsList(&sensorList).isOk()) { + break; + } + + // stop each sensor individually + bool ok = true; + for (const auto& i : sensorList) { + if (!mSensors->activate(i.sensorHandle, false).isOk()) { + ok = false; + break; + } + } + + if (!ok) { + break; + } + + // mark it done + succeed = true; + } while (0); + + if (!succeed) { + mSensors = nullptr; + } + + return succeed; +} + +void SensorsAidlEnvironment::TearDown() { + mStopThread = true; + + if (mEventQueueFlag != nullptr) { + // Wake up the event queue so the poll thread can exit + mEventQueueFlag->wake(ISensors::EVENT_QUEUE_FLAG_BITS_READ_AND_PROCESS); + if (mPollThread.joinable()) { + mPollThread.join(); + } + + EventFlag::deleteEventFlag(&mEventQueueFlag); + } +} + +void SensorsAidlEnvironment::startPollingThread() { + mStopThread = false; + mEvents.reserve(MAX_RECEIVE_BUFFER_EVENT_COUNT); + mPollThread = std::thread(pollingThread, this); +} + +void SensorsAidlEnvironment::readEvents() { + size_t availableEvents = mEventQueue->availableToRead(); + + if (availableEvents == 0) { + uint32_t eventFlagState = 0; + + mEventQueueFlag->wait(ISensors::EVENT_QUEUE_FLAG_BITS_READ_AND_PROCESS, &eventFlagState); + availableEvents = mEventQueue->availableToRead(); + } + + size_t eventsToRead = std::min(availableEvents, mEventBuffer.size()); + if (eventsToRead > 0) { + if (mEventQueue->read(mEventBuffer.data(), eventsToRead)) { + mEventQueueFlag->wake(ISensors::EVENT_QUEUE_FLAG_BITS_EVENTS_READ); + for (size_t i = 0; i < eventsToRead; i++) { + addEvent(mEventBuffer[i]); + } + } + } +} + +void SensorsAidlEnvironment::pollingThread(SensorsAidlEnvironment* env) { + ALOGD("polling thread start"); + + while (!env->mStopThread.load()) { + env->readEvents(); + } + + ALOGD("polling thread end"); +} diff --git a/sensors/aidl/vts/SensorsAidlEnvironment.h b/sensors/aidl/vts/SensorsAidlEnvironment.h new file mode 100644 index 0000000000..2f5f28712b --- /dev/null +++ b/sensors/aidl/vts/SensorsAidlEnvironment.h @@ -0,0 +1,110 @@ +/* + * 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_SENSORS_AIDL_ENVIRONMENT_H +#define ANDROID_SENSORS_AIDL_ENVIRONMENT_H + +#include "sensors-vts-utils/SensorsVtsEnvironmentBase.h" + +#include +#include +#include +#include +#include + +#include +#include + +using aidl::android::hardware::common::fmq::SynchronizedReadWrite; +using aidl::android::hardware::sensors::Event; +using aidl::android::hardware::sensors::ISensors; +using aidl::android::hardware::sensors::ISensorsCallback; + +static constexpr size_t MAX_RECEIVE_BUFFER_EVENT_COUNT = 256; + +class SensorsAidlTest; + +class SensorsAidlEnvironment : public SensorsVtsEnvironmentBase { + public: + virtual void TearDown() override; + + protected: + friend SensorsAidlTest; + SensorsAidlEnvironment(const std::string& service_name); + + /** + * Resets the HAL with new FMQs and a new Event Flag + * + * @return bool true if successful, false otherwise + */ + bool resetHal() override; + + /** + * Starts the polling thread that reads sensor events from the Event FMQ + */ + void startPollingThread() override; + + /** + * Thread responsible for calling functions to read Event FMQ + * + * @param env SensorEnvironment to being polling for events on + */ + static void pollingThread(SensorsAidlEnvironment* env); + + /** + * Reads and saves sensor events from the Event FMQ + */ + void readEvents(); + + GTEST_DISALLOW_COPY_AND_ASSIGN_(SensorsAidlEnvironment); + + /** + * Pointer to the Sensors HAL Interface that allows the test to call HAL functions. + */ + std::shared_ptr mSensors; + std::shared_ptr mCallback; + + ndk::ScopedAIBinder_DeathRecipient mDeathRecipient; + + /** + * Type used to simplify the creation of the Wake Lock FMQ + */ + typedef android::AidlMessageQueue WakeLockQueue; + typedef android::AidlMessageQueue EventQueue; + + /** + * The Wake Lock FMQ is used by the test to notify the Sensors HAL whenever it has processed + * WAKE_UP sensor events. + */ + std::unique_ptr mWakeLockQueue; + std::unique_ptr mEventQueue; + + /** + * The Event Queue Flag notifies the test framework when sensor events have been written to the + * Event FMQ by the Sensors HAL. + */ + ::android::hardware::EventFlag* mEventQueueFlag; + + std::atomic_bool mStopThread; + std::thread mPollThread; + + /** + * An array that is used to store sensor events read from the Event FMQ + */ + std::array mEventBuffer; +}; + +#endif // ANDROID_SENSORS_AIDL_ENVIRONMENT_H diff --git a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp new file mode 100644 index 0000000000..33645b2a95 --- /dev/null +++ b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp @@ -0,0 +1,871 @@ +/* + * 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 +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SensorsAidlEnvironment.h" +#include "sensors-vts-utils/SensorsVtsEnvironmentBase.h" + +#include +#include +#include +#include +#include +#include + +using aidl::android::hardware::sensors::Event; +using aidl::android::hardware::sensors::ISensors; +using aidl::android::hardware::sensors::SensorInfo; +using aidl::android::hardware::sensors::SensorStatus; +using aidl::android::hardware::sensors::SensorType; +using android::ProcessState; +using std::chrono::duration_cast; + +namespace { + +static void assertTypeMatchStringType(SensorType type, const std::string& stringType) { + if (type >= SensorType::DEVICE_PRIVATE_BASE) { + return; + } + + switch (type) { +#define CHECK_TYPE_STRING_FOR_SENSOR_TYPE(type) \ + case SensorType::type: \ + ASSERT_STREQ(SENSOR_STRING_TYPE_##type, stringType.c_str()); \ + break; + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ACCELEROMETER); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ACCELEROMETER_UNCALIBRATED); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ADDITIONAL_INFO); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(AMBIENT_TEMPERATURE); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(DEVICE_ORIENTATION); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(DYNAMIC_SENSOR_META); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GAME_ROTATION_VECTOR); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GEOMAGNETIC_ROTATION_VECTOR); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GLANCE_GESTURE); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GRAVITY); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GYROSCOPE); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GYROSCOPE_UNCALIBRATED); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(HEART_BEAT); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(HEART_RATE); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(LIGHT); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(LINEAR_ACCELERATION); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(LOW_LATENCY_OFFBODY_DETECT); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(MAGNETIC_FIELD); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(MAGNETIC_FIELD_UNCALIBRATED); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(MOTION_DETECT); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ORIENTATION); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(PICK_UP_GESTURE); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(POSE_6DOF); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(PRESSURE); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(PROXIMITY); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(RELATIVE_HUMIDITY); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ROTATION_VECTOR); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(SIGNIFICANT_MOTION); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(STATIONARY_DETECT); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(STEP_COUNTER); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(STEP_DETECTOR); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(TILT_DETECTOR); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(WAKE_GESTURE); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(WRIST_TILT_GESTURE); + default: + FAIL() << "Type " << static_cast(type) + << " in android defined range is not checked, " + << "stringType = " << stringType; +#undef CHECK_TYPE_STRING_FOR_SENSOR_TYPE + } +} + +int expectedReportModeForType(SensorType type) { + switch (type) { + case SensorType::ACCELEROMETER: + case SensorType::ACCELEROMETER_UNCALIBRATED: + case SensorType::GYROSCOPE: + case SensorType::MAGNETIC_FIELD: + case SensorType::ORIENTATION: + case SensorType::PRESSURE: + case SensorType::GRAVITY: + case SensorType::LINEAR_ACCELERATION: + case SensorType::ROTATION_VECTOR: + case SensorType::MAGNETIC_FIELD_UNCALIBRATED: + case SensorType::GAME_ROTATION_VECTOR: + case SensorType::GYROSCOPE_UNCALIBRATED: + case SensorType::GEOMAGNETIC_ROTATION_VECTOR: + case SensorType::POSE_6DOF: + case SensorType::HEART_BEAT: + return SensorInfo::SENSOR_FLAG_BITS_CONTINUOUS_MODE; + + case SensorType::LIGHT: + case SensorType::PROXIMITY: + case SensorType::RELATIVE_HUMIDITY: + case SensorType::AMBIENT_TEMPERATURE: + case SensorType::HEART_RATE: + case SensorType::DEVICE_ORIENTATION: + case SensorType::STEP_COUNTER: + case SensorType::LOW_LATENCY_OFFBODY_DETECT: + return SensorInfo::SENSOR_FLAG_BITS_ON_CHANGE_MODE; + + case SensorType::SIGNIFICANT_MOTION: + case SensorType::WAKE_GESTURE: + case SensorType::GLANCE_GESTURE: + case SensorType::PICK_UP_GESTURE: + case SensorType::MOTION_DETECT: + case SensorType::STATIONARY_DETECT: + return SensorInfo::SENSOR_FLAG_BITS_ONE_SHOT_MODE; + + case SensorType::STEP_DETECTOR: + case SensorType::TILT_DETECTOR: + case SensorType::WRIST_TILT_GESTURE: + case SensorType::DYNAMIC_SENSOR_META: + return SensorInfo::SENSOR_FLAG_BITS_SPECIAL_REPORTING_MODE; + + default: + ALOGW("Type %d is not implemented in expectedReportModeForType", (int)type); + return INT32_MAX; + } +} + +void assertTypeMatchReportMode(SensorType type, int reportMode) { + if (type >= SensorType::DEVICE_PRIVATE_BASE) { + return; + } + + int expected = expectedReportModeForType(type); + + ASSERT_TRUE(expected == INT32_MAX || expected == reportMode) + << "reportMode=" << static_cast(reportMode) + << "expected=" << static_cast(expected); +} + +void assertDelayMatchReportMode(int32_t minDelayUs, int32_t maxDelayUs, int reportMode) { + switch (reportMode) { + case SensorInfo::SENSOR_FLAG_BITS_CONTINUOUS_MODE: + ASSERT_LT(0, minDelayUs); + ASSERT_LE(0, maxDelayUs); + break; + case SensorInfo::SENSOR_FLAG_BITS_ON_CHANGE_MODE: + ASSERT_LE(0, minDelayUs); + ASSERT_LE(0, maxDelayUs); + break; + case SensorInfo::SENSOR_FLAG_BITS_ONE_SHOT_MODE: + ASSERT_EQ(-1, minDelayUs); + ASSERT_EQ(0, maxDelayUs); + break; + case SensorInfo::SENSOR_FLAG_BITS_SPECIAL_REPORTING_MODE: + // do not enforce anything for special reporting mode + break; + default: + FAIL() << "Report mode " << static_cast(reportMode) << " not checked"; + } +} + +void checkIsOk(ndk::ScopedAStatus status) { + ASSERT_TRUE(status.isOk()); +} + +} // namespace + +class EventCallback : public IEventCallback { + public: + void reset() { + mFlushMap.clear(); + mEventMap.clear(); + } + + void onEvent(const Event& event) override { + if (event.sensorType == SensorType::META_DATA && + event.payload.get().what == + Event::EventPayload::MetaData::MetaDataEventType::META_DATA_FLUSH_COMPLETE) { + std::unique_lock lock(mFlushMutex); + mFlushMap[event.sensorHandle]++; + mFlushCV.notify_all(); + } else if (event.sensorType != SensorType::ADDITIONAL_INFO) { + std::unique_lock lock(mEventMutex); + mEventMap[event.sensorHandle].push_back(event); + mEventCV.notify_all(); + } + } + + int32_t getFlushCount(int32_t sensorHandle) { + std::unique_lock lock(mFlushMutex); + return mFlushMap[sensorHandle]; + } + + void waitForFlushEvents(const std::vector& sensorsToWaitFor, + int32_t numCallsToFlush, std::chrono::milliseconds timeout) { + std::unique_lock lock(mFlushMutex); + mFlushCV.wait_for(lock, timeout, + [&] { return flushesReceived(sensorsToWaitFor, numCallsToFlush); }); + } + + const std::vector getEvents(int32_t sensorHandle) { + std::unique_lock lock(mEventMutex); + return mEventMap[sensorHandle]; + } + + void waitForEvents(const std::vector& sensorsToWaitFor, + std::chrono::milliseconds timeout) { + std::unique_lock lock(mEventMutex); + mEventCV.wait_for(lock, timeout, [&] { return eventsReceived(sensorsToWaitFor); }); + } + + protected: + bool flushesReceived(const std::vector& sensorsToWaitFor, int32_t numCallsToFlush) { + for (const SensorInfo& sensor : sensorsToWaitFor) { + if (getFlushCount(sensor.sensorHandle) < numCallsToFlush) { + return false; + } + } + return true; + } + + bool eventsReceived(const std::vector& sensorsToWaitFor) { + for (const SensorInfo& sensor : sensorsToWaitFor) { + if (getEvents(sensor.sensorHandle).size() == 0) { + return false; + } + } + return true; + } + + std::map mFlushMap; + std::recursive_mutex mFlushMutex; + std::condition_variable_any mFlushCV; + + std::map> mEventMap; + std::recursive_mutex mEventMutex; + std::condition_variable_any mEventCV; +}; + +class SensorsAidlTest : public testing::TestWithParam { + public: + virtual void SetUp() override { + mEnvironment = new SensorsAidlEnvironment(GetParam()); + mEnvironment->SetUp(); + + // Ensure that we have a valid environment before performing tests + ASSERT_NE(getSensors(), nullptr); + } + + virtual void TearDown() override { + for (int32_t handle : mSensorHandles) { + activate(handle, false); + } + mSensorHandles.clear(); + + mEnvironment->TearDown(); + delete mEnvironment; + mEnvironment = nullptr; + } + + protected: + std::vector getNonOneShotSensors(); + std::vector getNonOneShotAndNonSpecialSensors(); + std::vector getNonOneShotAndNonOnChangeAndNonSpecialSensors(); + std::vector getOneShotSensors(); + std::vector getInjectEventSensors(); + + inline std::shared_ptr& getSensors() { return mEnvironment->mSensors; } + + inline SensorsAidlEnvironment* getEnvironment() { return mEnvironment; } + + inline bool isValidType(SensorType sensorType) { return (int)sensorType > 0; } + + std::vector getSensorsList(); + + int32_t getInvalidSensorHandle() { + // Find a sensor handle that does not exist in the sensor list + int32_t maxHandle = 0; + for (const SensorInfo& sensor : getSensorsList()) { + maxHandle = std::max(maxHandle, sensor.sensorHandle); + } + return maxHandle + 1; + } + + ndk::ScopedAStatus activate(int32_t sensorHandle, bool enable); + void activateAllSensors(bool enable); + + ndk::ScopedAStatus batch(int32_t sensorHandle, int64_t samplingPeriodNs, + int64_t maxReportLatencyNs) { + return getSensors()->batch(sensorHandle, samplingPeriodNs, maxReportLatencyNs); + } + + ndk::ScopedAStatus flush(int32_t sensorHandle) { return getSensors()->flush(sensorHandle); } + + void runSingleFlushTest(const std::vector& sensors, bool activateSensor, + int32_t expectedFlushCount, bool expectedResult); + + void runFlushTest(const std::vector& sensors, bool activateSensor, + int32_t flushCalls, int32_t expectedFlushCount, bool expectedResult); + + inline static int32_t extractReportMode(int32_t flag) { + return (flag & (SensorInfo::SENSOR_FLAG_BITS_CONTINUOUS_MODE | + SensorInfo::SENSOR_FLAG_BITS_ON_CHANGE_MODE | + SensorInfo::SENSOR_FLAG_BITS_ONE_SHOT_MODE | + SensorInfo::SENSOR_FLAG_BITS_SPECIAL_REPORTING_MODE)); + } + + // All sensors and direct channnels used + std::unordered_set mSensorHandles; + std::unordered_set mDirectChannelHandles; + + private: + SensorsAidlEnvironment* mEnvironment; +}; + +std::vector SensorsAidlTest::getSensorsList() { + std::vector sensorInfoList; + checkIsOk(getSensors()->getSensorsList(&sensorInfoList)); + return sensorInfoList; +} + +ndk::ScopedAStatus SensorsAidlTest::activate(int32_t sensorHandle, bool enable) { + // If activating a sensor, add the handle in a set so that when test fails it can be turned off. + // The handle is not removed when it is deactivating on purpose so that it is not necessary to + // check the return value of deactivation. Deactivating a sensor more than once does not have + // negative effect. + if (enable) { + mSensorHandles.insert(sensorHandle); + } + return getSensors()->activate(sensorHandle, enable); +} + +void SensorsAidlTest::activateAllSensors(bool enable) { + for (const SensorInfo& sensorInfo : getSensorsList()) { + if (isValidType(sensorInfo.type)) { + checkIsOk(batch(sensorInfo.sensorHandle, sensorInfo.minDelayUs, + 0 /* maxReportLatencyNs */)); + checkIsOk(activate(sensorInfo.sensorHandle, enable)); + } + } +} + +std::vector SensorsAidlTest::getNonOneShotSensors() { + std::vector sensors; + for (const SensorInfo& info : getSensorsList()) { + if (extractReportMode(info.flags) != SensorInfo::SENSOR_FLAG_BITS_ONE_SHOT_MODE) { + sensors.push_back(info); + } + } + return sensors; +} + +std::vector SensorsAidlTest::getNonOneShotAndNonSpecialSensors() { + std::vector sensors; + for (const SensorInfo& info : getSensorsList()) { + int reportMode = extractReportMode(info.flags); + if (reportMode != SensorInfo::SENSOR_FLAG_BITS_ONE_SHOT_MODE && + reportMode != SensorInfo::SENSOR_FLAG_BITS_SPECIAL_REPORTING_MODE) { + sensors.push_back(info); + } + } + return sensors; +} + +std::vector SensorsAidlTest::getNonOneShotAndNonOnChangeAndNonSpecialSensors() { + std::vector sensors; + for (const SensorInfo& info : getSensorsList()) { + int reportMode = extractReportMode(info.flags); + if (reportMode != SensorInfo::SENSOR_FLAG_BITS_ONE_SHOT_MODE && + reportMode != SensorInfo::SENSOR_FLAG_BITS_ON_CHANGE_MODE && + reportMode != SensorInfo::SENSOR_FLAG_BITS_SPECIAL_REPORTING_MODE) { + sensors.push_back(info); + } + } + return sensors; +} + +std::vector SensorsAidlTest::getOneShotSensors() { + std::vector sensors; + for (const SensorInfo& info : getSensorsList()) { + if (extractReportMode(info.flags) == SensorInfo::SENSOR_FLAG_BITS_ONE_SHOT_MODE) { + sensors.push_back(info); + } + } + return sensors; +} + +std::vector SensorsAidlTest::getInjectEventSensors() { + std::vector out; + std::vector sensorInfoList = getSensorsList(); + for (const SensorInfo& info : sensorInfoList) { + if (info.flags & SensorInfo::SENSOR_FLAG_BITS_DATA_INJECTION) { + out.push_back(info); + } + } + return out; +} + +void SensorsAidlTest::runSingleFlushTest(const std::vector& sensors, + bool activateSensor, int32_t expectedFlushCount, + bool expectedResult) { + runFlushTest(sensors, activateSensor, 1 /* flushCalls */, expectedFlushCount, expectedResult); +} + +void SensorsAidlTest::runFlushTest(const std::vector& sensors, bool activateSensor, + int32_t flushCalls, int32_t expectedFlushCount, + bool expectedResult) { + EventCallback callback; + getEnvironment()->registerCallback(&callback); + + for (const SensorInfo& sensor : sensors) { + // Configure and activate the sensor + batch(sensor.sensorHandle, sensor.maxDelayUs, 0 /* maxReportLatencyNs */); + activate(sensor.sensorHandle, activateSensor); + + // Flush the sensor + for (int32_t i = 0; i < flushCalls; i++) { + SCOPED_TRACE(::testing::Message() + << "Flush " << i << "/" << flushCalls << ": " + << " handle=0x" << std::hex << std::setw(8) << std::setfill('0') + << sensor.sensorHandle << std::dec + << " type=" << static_cast(sensor.type) << " name=" << sensor.name); + + EXPECT_EQ(flush(sensor.sensorHandle).isOk(), expectedResult); + } + } + + // Wait up to one second for the flush events + 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. + for (const SensorInfo& sensor : sensors) { + activate(sensor.sensorHandle, false); + } + getEnvironment()->unregisterCallback(); + + // Check that the correct number of flushes are present for each sensor + for (const SensorInfo& sensor : sensors) { + SCOPED_TRACE(::testing::Message() + << " handle=0x" << std::hex << std::setw(8) << std::setfill('0') + << sensor.sensorHandle << std::dec << " type=" << static_cast(sensor.type) + << " name=" << sensor.name); + ASSERT_EQ(callback.getFlushCount(sensor.sensorHandle), expectedFlushCount); + } +} + +TEST_P(SensorsAidlTest, SensorListValid) { + std::vector sensorInfoList = getSensorsList(); + std::unordered_map> sensorTypeNameMap; + for (size_t i = 0; i < sensorInfoList.size(); ++i) { + const SensorInfo& info = sensorInfoList[i]; + SCOPED_TRACE(::testing::Message() + << i << "/" << sensorInfoList.size() << ": " + << " handle=0x" << std::hex << std::setw(8) << std::setfill('0') + << info.sensorHandle << std::dec << " type=" << static_cast(info.type) + << " name=" << info.name); + + // Test type string non-empty only for private sensor typeinfo. + if (info.type >= SensorType::DEVICE_PRIVATE_BASE) { + EXPECT_FALSE(info.typeAsString.empty()); + } else if (!info.typeAsString.empty()) { + // Test type string matches framework string if specified for non-private typeinfo. + EXPECT_NO_FATAL_FAILURE(assertTypeMatchStringType(info.type, info.typeAsString)); + } + + // Test if all sensor has name and vendor + EXPECT_FALSE(info.name.empty()); + EXPECT_FALSE(info.vendor.empty()); + + // Make sure that sensors of the same type have a unique name. + std::vector& v = sensorTypeNameMap[static_cast(info.type)]; + bool isUniqueName = std::find(v.begin(), v.end(), info.name) == v.end(); + EXPECT_TRUE(isUniqueName) << "Duplicate sensor Name: " << info.name; + if (isUniqueName) { + v.push_back(info.name); + } + + EXPECT_LE(0, info.power); + EXPECT_LT(0, info.maxRange); + + // Info type, should have no sensor + EXPECT_FALSE(info.type == SensorType::ADDITIONAL_INFO || + info.type == SensorType::META_DATA); + + EXPECT_GE(info.fifoMaxEventCount, info.fifoReservedEventCount); + + // Test Reporting mode valid + EXPECT_NO_FATAL_FAILURE( + assertTypeMatchReportMode(info.type, extractReportMode(info.flags))); + + // Test min max are in the right order + EXPECT_LE(info.minDelayUs, info.maxDelayUs); + // Test min/max delay matches reporting mode + EXPECT_NO_FATAL_FAILURE(assertDelayMatchReportMode(info.minDelayUs, info.maxDelayUs, + extractReportMode(info.flags))); + } +} + +TEST_P(SensorsAidlTest, SetOperationMode) { + if (getInjectEventSensors().size() > 0) { + ASSERT_TRUE(getSensors()->setOperationMode(ISensors::OperationMode::NORMAL).isOk()); + ASSERT_TRUE(getSensors()->setOperationMode(ISensors::OperationMode::DATA_INJECTION).isOk()); + ASSERT_TRUE(getSensors()->setOperationMode(ISensors::OperationMode::NORMAL).isOk()); + } else { + ASSERT_EQ(getSensors() + ->setOperationMode(ISensors::OperationMode::DATA_INJECTION) + .getExceptionCode(), + EX_UNSUPPORTED_OPERATION); + } +} + +TEST_P(SensorsAidlTest, InjectSensorEventData) { + std::vector sensors = getInjectEventSensors(); + if (sensors.size() == 0) { + return; + } + + ASSERT_TRUE(getSensors()->setOperationMode(ISensors::OperationMode::DATA_INJECTION).isOk()); + + EventCallback callback; + getEnvironment()->registerCallback(&callback); + + // AdditionalInfo event should not be sent to Event FMQ + Event additionalInfoEvent; + additionalInfoEvent.sensorType = SensorType::ADDITIONAL_INFO; + additionalInfoEvent.timestamp = android::elapsedRealtimeNano(); + + Event injectedEvent; + injectedEvent.timestamp = android::elapsedRealtimeNano(); + Event::EventPayload::Vec3 data = {1, 2, 3, SensorStatus::ACCURACY_HIGH}; + injectedEvent.payload.set(data); + + for (const auto& s : sensors) { + additionalInfoEvent.sensorHandle = s.sensorHandle; + ASSERT_TRUE(getSensors()->injectSensorData(additionalInfoEvent).isOk()); + + injectedEvent.sensorType = s.type; + injectedEvent.sensorHandle = s.sensorHandle; + ASSERT_TRUE(getSensors()->injectSensorData(injectedEvent).isOk()); + } + + // Wait for events to be written back to the Event FMQ + callback.waitForEvents(sensors, std::chrono::milliseconds(1000) /* timeout */); + getEnvironment()->unregisterCallback(); + + for (const auto& s : sensors) { + auto events = callback.getEvents(s.sensorHandle); + if (events.empty()) { + FAIL() << "Received no events"; + } else { + auto lastEvent = events.back(); + SCOPED_TRACE(::testing::Message() + << " handle=0x" << std::hex << std::setw(8) << std::setfill('0') + << s.sensorHandle << std::dec << " type=" << static_cast(s.type) + << " name=" << s.name); + + // Verify that only a single event has been received + ASSERT_EQ(events.size(), 1); + + // Verify that the event received matches the event injected and is not the additional + // info event + ASSERT_EQ(lastEvent.sensorType, s.type); + ASSERT_EQ(lastEvent.timestamp, injectedEvent.timestamp); + ASSERT_EQ(lastEvent.payload.get().x, + injectedEvent.payload.get().x); + ASSERT_EQ(lastEvent.payload.get().y, + injectedEvent.payload.get().y); + ASSERT_EQ(lastEvent.payload.get().z, + injectedEvent.payload.get().z); + ASSERT_EQ(lastEvent.payload.get().status, + injectedEvent.payload.get().status); + } + } + + ASSERT_TRUE(getSensors()->setOperationMode(ISensors::OperationMode::NORMAL).isOk()); +} + +TEST_P(SensorsAidlTest, CallInitializeTwice) { + // Create a helper class so that a second environment is able to be instantiated + class SensorsAidlEnvironmentTest : public SensorsAidlEnvironment { + public: + SensorsAidlEnvironmentTest(const std::string& service_name) + : SensorsAidlEnvironment(service_name) {} + }; + + if (getSensorsList().size() == 0) { + // No sensors + return; + } + + constexpr useconds_t kCollectionTimeoutUs = 1000 * 1000; // 1s + constexpr int32_t kNumEvents = 1; + + // Create a new environment that calls initialize() + std::unique_ptr newEnv = + std::make_unique(GetParam()); + newEnv->SetUp(); + if (HasFatalFailure()) { + return; // Exit early if setting up the new environment failed + } + + activateAllSensors(true); + // Verify that the old environment does not receive any events + EXPECT_EQ(getEnvironment()->collectEvents(kCollectionTimeoutUs, kNumEvents).size(), 0); + // Verify that the new event queue receives sensor events + EXPECT_GE(newEnv.get()->collectEvents(kCollectionTimeoutUs, kNumEvents).size(), kNumEvents); + activateAllSensors(false); + + // Cleanup the test environment + newEnv->TearDown(); + + // Restore the test environment for future tests + getEnvironment()->TearDown(); + getEnvironment()->SetUp(); + if (HasFatalFailure()) { + return; // Exit early if resetting the environment failed + } + + // Ensure that the original environment is receiving events + activateAllSensors(true); + EXPECT_GE(getEnvironment()->collectEvents(kCollectionTimeoutUs, kNumEvents).size(), kNumEvents); + activateAllSensors(false); +} + +TEST_P(SensorsAidlTest, CleanupConnectionsOnInitialize) { + activateAllSensors(true); + + // Verify that events are received + constexpr useconds_t kCollectionTimeoutUs = 1000 * 1000; // 1s + constexpr int32_t kNumEvents = 1; + ASSERT_GE(getEnvironment()->collectEvents(kCollectionTimeoutUs, kNumEvents).size(), kNumEvents); + + // Clear the active sensor handles so they are not disabled during TearDown + auto handles = mSensorHandles; + mSensorHandles.clear(); + getEnvironment()->TearDown(); + getEnvironment()->SetUp(); + if (HasFatalFailure()) { + return; // Exit early if resetting the environment failed + } + + // Verify no events are received until sensors are re-activated + ASSERT_EQ(getEnvironment()->collectEvents(kCollectionTimeoutUs, kNumEvents).size(), 0); + activateAllSensors(true); + ASSERT_GE(getEnvironment()->collectEvents(kCollectionTimeoutUs, kNumEvents).size(), kNumEvents); + + // Disable sensors + activateAllSensors(false); + + // Restore active sensors prior to clearing the environment + mSensorHandles = handles; +} + +TEST_P(SensorsAidlTest, FlushSensor) { + std::vector sensors = getNonOneShotSensors(); + if (sensors.size() == 0) { + return; + } + + constexpr int32_t kFlushes = 5; + runSingleFlushTest(sensors, true /* activateSensor */, 1 /* expectedFlushCount */, + true /* expectedResult */); + runFlushTest(sensors, true /* activateSensor */, kFlushes, kFlushes, true /* expectedResult */); +} + +TEST_P(SensorsAidlTest, FlushOneShotSensor) { + // Find a sensor that is a one-shot sensor + std::vector sensors = getOneShotSensors(); + if (sensors.size() == 0) { + return; + } + + runSingleFlushTest(sensors, true /* activateSensor */, 0 /* expectedFlushCount */, + false /* expectedResult */); +} + +TEST_P(SensorsAidlTest, FlushInactiveSensor) { + // Attempt to find a non-one shot sensor, then a one-shot sensor if necessary + std::vector sensors = getNonOneShotSensors(); + if (sensors.size() == 0) { + sensors = getOneShotSensors(); + if (sensors.size() == 0) { + return; + } + } + + runSingleFlushTest(sensors, false /* activateSensor */, 0 /* expectedFlushCount */, + false /* expectedResult */); +} + +TEST_P(SensorsAidlTest, Batch) { + if (getSensorsList().size() == 0) { + return; + } + + activateAllSensors(false /* enable */); + for (const SensorInfo& sensor : getSensorsList()) { + SCOPED_TRACE(::testing::Message() + << " handle=0x" << std::hex << std::setw(8) << std::setfill('0') + << sensor.sensorHandle << std::dec << " type=" << static_cast(sensor.type) + << " name=" << sensor.name); + + // Call batch on inactive sensor + // One shot sensors have minDelay set to -1 which is an invalid + // parameter. Use 0 instead to avoid errors. + int64_t samplingPeriodNs = + extractReportMode(sensor.flags) == SensorInfo::SENSOR_FLAG_BITS_ONE_SHOT_MODE + ? 0 + : sensor.minDelayUs; + checkIsOk(batch(sensor.sensorHandle, samplingPeriodNs, 0 /* maxReportLatencyNs */)); + + // Activate the sensor + activate(sensor.sensorHandle, true /* enabled */); + + // Call batch on an active sensor + checkIsOk(batch(sensor.sensorHandle, sensor.maxDelayUs, 0 /* maxReportLatencyNs */)); + } + activateAllSensors(false /* enable */); + + // Call batch on an invalid sensor + SensorInfo sensor = getSensorsList().front(); + sensor.sensorHandle = getInvalidSensorHandle(); + ASSERT_EQ(batch(sensor.sensorHandle, sensor.minDelayUs, 0 /* maxReportLatencyNs */) + .getExceptionCode(), + EX_ILLEGAL_ARGUMENT); +} + +TEST_P(SensorsAidlTest, Activate) { + if (getSensorsList().size() == 0) { + return; + } + + // Verify that sensor events are generated when activate is called + for (const SensorInfo& sensor : getSensorsList()) { + SCOPED_TRACE(::testing::Message() + << " handle=0x" << std::hex << std::setw(8) << std::setfill('0') + << sensor.sensorHandle << std::dec << " type=" << static_cast(sensor.type) + << " name=" << sensor.name); + + checkIsOk(batch(sensor.sensorHandle, sensor.minDelayUs, 0 /* maxReportLatencyNs */)); + checkIsOk(activate(sensor.sensorHandle, true)); + + // Call activate on a sensor that is already activated + checkIsOk(activate(sensor.sensorHandle, true)); + + // Deactivate the sensor + checkIsOk(activate(sensor.sensorHandle, false)); + + // Call deactivate on a sensor that is already deactivated + checkIsOk(activate(sensor.sensorHandle, false)); + } + + // Attempt to activate an invalid sensor + int32_t invalidHandle = getInvalidSensorHandle(); + ASSERT_EQ(activate(invalidHandle, true).getExceptionCode(), EX_ILLEGAL_ARGUMENT); + ASSERT_EQ(activate(invalidHandle, false).getExceptionCode(), EX_ILLEGAL_ARGUMENT); +} + +TEST_P(SensorsAidlTest, NoStaleEvents) { + constexpr std::chrono::milliseconds kFiveHundredMs(500); + constexpr std::chrono::milliseconds kOneSecond(1000); + + // Register the callback to receive sensor events + EventCallback callback; + getEnvironment()->registerCallback(&callback); + + // This test is not valid for one-shot, on-change or special-report-mode sensors + const std::vector sensors = getNonOneShotAndNonOnChangeAndNonSpecialSensors(); + std::chrono::milliseconds maxMinDelay(0); + for (const SensorInfo& sensor : sensors) { + std::chrono::milliseconds minDelay = duration_cast( + std::chrono::microseconds(sensor.minDelayUs)); + maxMinDelay = std::chrono::milliseconds(std::max(maxMinDelay.count(), minDelay.count())); + } + + // Activate the sensors so that they start generating events + activateAllSensors(true); + + // According to the CDD, the first sample must be generated within 400ms + 2 * sample_time + // and the maximum reporting latency is 100ms + 2 * sample_time. Wait a sufficient amount + // of time to guarantee that a sample has arrived. + callback.waitForEvents(sensors, kFiveHundredMs + (5 * maxMinDelay)); + activateAllSensors(false); + + // Save the last received event for each sensor + std::map lastEventTimestampMap; + for (const SensorInfo& sensor : sensors) { + SCOPED_TRACE(::testing::Message() + << " handle=0x" << std::hex << std::setw(8) << std::setfill('0') + << sensor.sensorHandle << std::dec << " type=" << static_cast(sensor.type) + << " name=" << sensor.name); + + if (callback.getEvents(sensor.sensorHandle).size() >= 1) { + lastEventTimestampMap[sensor.sensorHandle] = + callback.getEvents(sensor.sensorHandle).back().timestamp; + } + } + + // Allow some time to pass, reset the callback, then reactivate the sensors + usleep(duration_cast(kOneSecond + (5 * maxMinDelay)).count()); + callback.reset(); + activateAllSensors(true); + callback.waitForEvents(sensors, kFiveHundredMs + (5 * maxMinDelay)); + activateAllSensors(false); + + getEnvironment()->unregisterCallback(); + + for (const SensorInfo& sensor : sensors) { + SCOPED_TRACE(::testing::Message() + << " handle=0x" << std::hex << std::setw(8) << std::setfill('0') + << sensor.sensorHandle << std::dec << " type=" << static_cast(sensor.type) + << " name=" << sensor.name); + + // Skip sensors that did not previously report an event + if (lastEventTimestampMap.find(sensor.sensorHandle) == lastEventTimestampMap.end()) { + 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(); + std::chrono::milliseconds delta = + duration_cast(std::chrono::nanoseconds( + newEvent.timestamp - lastEventTimestampMap[sensor.sensorHandle])); + std::chrono::milliseconds sensorMinDelay = duration_cast( + std::chrono::microseconds(sensor.minDelayUs)); + ASSERT_GE(delta, kFiveHundredMs + (3 * sensorMinDelay)); + } +} + +TEST_P(SensorsAidlTest, DirectChannelAshmem) { + // TODO(b/195593357): Implement this +} + +TEST_P(SensorsAidlTest, DirectChannelGralloc) { + // TODO(b/195593357): Implement this +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SensorsAidlTest); +INSTANTIATE_TEST_SUITE_P(Sensors, SensorsAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(ISensors::descriptor)), + android::PrintInstanceNameToString); + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + ProcessState::self()->setThreadPoolMaxThreadCount(1); + ProcessState::self()->startThreadPool(); + return RUN_ALL_TESTS(); +} -- GitLab From 435fd2fda1df0c236ab25900c97791668b074e00 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Thu, 23 Dec 2021 16:22:44 -0800 Subject: [PATCH 365/825] composer: fix null pointer dereference The test process was crashing on null pointer instead of exiting successfully, so fixing the null pointer error. Test: VTS Change-Id: I1d6988d25ed58c159adc49d43d36e4b3f0ffa289 --- .../functional/VtsHalGraphicsComposer3_ReadbackTest.cpp | 3 ++- .../composer3/vts/functional/composer-vts/ReadbackVts.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 96d240a2fb..0ece1d55a4 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -419,7 +419,8 @@ TEST_P(GraphicsCompositionTest, SetReadbackBufferBadParameter) { return; } - aidl::android::hardware::common::NativeHandle bufferHandle = ::android::dupToAidl(nullptr); + aidl::android::hardware::common::NativeHandle bufferHandle = + ::android::dupToAidl(mGraphicBuffer->handle); ndk::ScopedFileDescriptor releaseFence = ndk::ScopedFileDescriptor(-1); const auto error = mComposerClient->setReadbackBuffer(mPrimaryDisplay, bufferHandle, releaseFence); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp index 4de2d71441..5eb912bb3f 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp @@ -242,13 +242,13 @@ void ReadbackBuffer::checkReadbackBuffer(std::vector expectedColors) { int outBytesPerPixel; int outBytesPerStride; - auto status = mGraphicBuffer->lockAsync(mUsage, mAccessRegion, nullptr, fenceHandle.get(), + void* bufData = nullptr; + auto status = mGraphicBuffer->lockAsync(mUsage, mAccessRegion, &bufData, fenceHandle.get(), &outBytesPerPixel, &outBytesPerStride); EXPECT_EQ(::android::OK, status); ASSERT_TRUE(mPixelFormat == PixelFormat::RGB_888 || mPixelFormat == PixelFormat::RGBA_8888); - ReadbackHelper::compareColorBuffers(expectedColors, mGraphicBuffer.get(), - static_cast(mStride), mWidth, mHeight, - mPixelFormat); + ReadbackHelper::compareColorBuffers(expectedColors, bufData, static_cast(mStride), + mWidth, mHeight, mPixelFormat); status = mGraphicBuffer->unlock(); EXPECT_EQ(::android::OK, status); } -- GitLab From 2b0e9ee4ac1dd395e2e68eb6ddb687da17491c60 Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Mon, 27 Dec 2021 13:55:16 +0100 Subject: [PATCH 366/825] Fix time measurement in FilterDelayHintTest The startTime needs to be set before setting the delayHint timeout as that is when the callback scheduler's clock start ticking. In addition, we need to await the first callback before starting the test to make sure the scheduler thread has been run at least once (so the timeout should be initialized correctly). Test: atest TunerFilterAidlTest#FilterDelayHintTest Bug: 210943300 Change-Id: I0b2443f3e7d33977fb6666ba09d3ff51d8b1f152 --- .../functional/VtsHalTvTunerTargetTest.cpp | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp index 202f83f542..f489bf7b66 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp @@ -704,6 +704,9 @@ void TunerFilterAidlTest::testDelayHint(const FilterConfig& filterConf) { bool mediaFilter = isMediaFilter(filterConf); auto filter = mFilterTests.getFilterById(filterId); + // startTime needs to be set before calling setDelayHint. + auto startTime = std::chrono::steady_clock::now(); + auto timeDelayInMs = std::chrono::milliseconds(filterConf.timeDelayInMs); if (timeDelayInMs.count() > 0) { FilterDelayHint delayHint; @@ -724,15 +727,22 @@ void TunerFilterAidlTest::testDelayHint(const FilterConfig& filterConf) { ASSERT_EQ(filter->setDelayHint(delayHint).isOk(), !mediaFilter); } - // start and stop filter in order to circumvent callback scheduler race - // conditions after adjusting filter delays. + // start and stop filter (and wait for first callback) in order to + // circumvent callback scheduler race conditions after adjusting filter + // delays. + auto cb = mFilterTests.getFilterCallbacks().at(filterId); + auto future = + cb->verifyFilterCallback([](const std::vector&) { return true; }); mFilterTests.startFilter(filterId); + + auto timeout = std::chrono::seconds(30); + ASSERT_EQ(future.wait_for(timeout), std::future_status::ready); + mFilterTests.stopFilter(filterId); if (!mediaFilter) { - auto cb = mFilterTests.getFilterCallbacks().at(filterId); int callbackSize = 0; - auto future = cb->verifyFilterCallback( + future = cb->verifyFilterCallback( [&callbackSize](const std::vector& events) { for (const auto& event : events) { callbackSize += getDemuxFilterEventDataLength(event); @@ -744,11 +754,9 @@ void TunerFilterAidlTest::testDelayHint(const FilterConfig& filterConf) { // hint beforehand. ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId)); - auto startTime = std::chrono::steady_clock::now(); ASSERT_TRUE(mFilterTests.startFilter(filterId)); // block and wait for callback to be received. - auto timeout = std::chrono::seconds(30); ASSERT_EQ(future.wait_for(timeout), std::future_status::ready); auto duration = std::chrono::steady_clock::now() - startTime; -- GitLab From 23d32a1fc347f2188d8222d18ce6efa6e205783b Mon Sep 17 00:00:00 2001 From: Valentin Iftime Date: Wed, 29 Sep 2021 14:15:39 +0200 Subject: [PATCH 367/825] Add external lazy camera provider 2.7 Add default implementation for external camera provider with lazy HAL support v2.7. Test configuration for devices: PRODUCT_PACKAGES += android.hardware.camera.provider@2.7-impl PRODUCT_PACKAGES += android.hardware.camera.provider@2.7-external-service-lazy PRODUCT_PROPERTY_OVERRIDES += ro.camera.enableLazyHal=true Test: atest CtsCameraTestCases atest VtsHalCameraProviderV2_4TargetTest Bug: 191248460 Change-Id: I57c8130d7c331028eff35dc68e360fdd8d8c32e2 --- camera/provider/2.7/default/Android.bp | 111 +++++ .../provider/2.7/default/CameraProvider_2_7.h | 122 ++++++ .../ExternalCameraProviderImpl_2_7.cpp | 394 ++++++++++++++++++ .../default/ExternalCameraProviderImpl_2_7.h | 134 ++++++ ...mera.provider@2.7-external-service-lazy.rc | 13 + ...re.camera.provider@2.7-external-service.rc | 11 + .../provider/2.7/default/external-service.cpp | 66 +++ 7 files changed, 851 insertions(+) create mode 100644 camera/provider/2.7/default/Android.bp create mode 100644 camera/provider/2.7/default/CameraProvider_2_7.h create mode 100644 camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp create mode 100644 camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.h create mode 100644 camera/provider/2.7/default/android.hardware.camera.provider@2.7-external-service-lazy.rc create mode 100644 camera/provider/2.7/default/android.hardware.camera.provider@2.7-external-service.rc create mode 100644 camera/provider/2.7/default/external-service.cpp diff --git a/camera/provider/2.7/default/Android.bp b/camera/provider/2.7/default/Android.bp new file mode 100644 index 0000000000..bd5da2dbfa --- /dev/null +++ b/camera/provider/2.7/default/Android.bp @@ -0,0 +1,111 @@ +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_library_shared { + name: "android.hardware.camera.provider@2.7-external", + proprietary: true, + srcs: ["ExternalCameraProviderImpl_2_7.cpp"], + shared_libs: [ + "android.hardware.camera.common@1.0", + "android.hardware.camera.device@1.0", + "android.hardware.camera.device@3.2", + "android.hardware.camera.device@3.3", + "android.hardware.camera.device@3.4", + "android.hardware.camera.device@3.5", + "android.hardware.camera.device@3.6", + "android.hardware.camera.provider@2.4", + "android.hardware.camera.provider@2.5", + "android.hardware.camera.provider@2.6", + "android.hardware.camera.provider@2.7", + "android.hardware.graphics.mapper@2.0", + "android.hardware.graphics.mapper@3.0", + "android.hardware.graphics.mapper@4.0", + "android.hidl.allocator@1.0", + "android.hidl.memory@1.0", + "camera.device@3.3-impl", + "camera.device@3.4-external-impl", + "camera.device@3.4-impl", + "camera.device@3.5-external-impl", + "camera.device@3.5-impl", + "camera.device@3.6-external-impl", + "libcamera_metadata", + "libcutils", + "libhardware", + "libhidlbase", + "liblog", + "libtinyxml2", + "libutils", + ], + static_libs: [ + "android.hardware.camera.common@1.0-helper", + ], + header_libs: [ + "camera.device@3.4-external-impl_headers", + "camera.device@3.5-external-impl_headers", + "camera.device@3.6-external-impl_headers", + ], + export_include_dirs: ["."], +} + +cc_defaults { + name: "camera_external_service_2_7_defaults", + defaults: ["hidl_defaults"], + proprietary: true, + relative_install_path: "hw", + srcs: ["external-service.cpp"], + compile_multilib: "32", + shared_libs: [ + "android.hardware.camera.common@1.0", + "android.hardware.camera.device@1.0", + "android.hardware.camera.device@3.2", + "android.hardware.camera.device@3.3", + "android.hardware.camera.device@3.4", + "android.hardware.camera.device@3.5", + "android.hardware.camera.provider@2.4", + "android.hardware.camera.provider@2.4-external", + "android.hardware.camera.provider@2.5", + "android.hardware.camera.provider@2.5-external", + "android.hardware.camera.provider@2.6", + "android.hardware.camera.provider@2.7", + "android.hardware.camera.provider@2.7-external", + "android.hardware.graphics.mapper@2.0", + "android.hardware.graphics.mapper@3.0", + "android.hardware.graphics.mapper@4.0", + "libbinder", + "libcamera_metadata", + "libhidlbase", + "liblog", + "libtinyxml2", + "libutils", + ], + static_libs: [ + "android.hardware.camera.common@1.0-helper", + ], + header_libs: [ + "camera.device@3.4-external-impl_headers", + "camera.device@3.4-impl_headers", + "camera.device@3.5-external-impl_headers", + "camera.device@3.5-impl_headers", + "camera.device@3.6-external-impl_headers", + ], +} + +cc_binary { + name: "android.hardware.camera.provider@2.7-external-service", + defaults: ["camera_external_service_2_7_defaults"], + init_rc: ["android.hardware.camera.provider@2.7-external-service.rc"], +} + +cc_binary { + name: "android.hardware.camera.provider@2.7-external-service-lazy", + overrides: ["android.hardware.camera.provider@2.7-external-service"], + defaults: ["camera_external_service_2_7_defaults"], + init_rc: ["android.hardware.camera.provider@2.7-external-service-lazy.rc"], + cflags: ["-DLAZY_SERVICE"], +} diff --git a/camera/provider/2.7/default/CameraProvider_2_7.h b/camera/provider/2.7/default/CameraProvider_2_7.h new file mode 100644 index 0000000000..c34905f3f3 --- /dev/null +++ b/camera/provider/2.7/default/CameraProvider_2_7.h @@ -0,0 +1,122 @@ +/* + * 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_CAMERA_PROVIDER_V2_7_CAMERAPROVIDER_H +#define ANDROID_HARDWARE_CAMERA_PROVIDER_V2_7_CAMERAPROVIDER_H + +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace camera { +namespace provider { +namespace V2_7 { +namespace implementation { + +using ::android::sp; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::camera::common::V1_0::CameraDeviceStatus; +using ::android::hardware::camera::common::V1_0::Status; +using ::android::hardware::camera::common::V1_0::TorchModeStatus; +using ::android::hardware::camera::common::V1_0::VendorTag; +using ::android::hardware::camera::common::V1_0::VendorTagSection; +using ::android::hardware::camera::provider::V2_4::ICameraProviderCallback; +using ::android::hardware::camera::provider::V2_5::DeviceState; +using ::android::hardware::camera::provider::V2_7::CameraIdAndStreamCombination; +using ::android::hardware::camera::provider::V2_7::ICameraProvider; +using ::android::hidl::base::V1_0::IBase; + +// Default recommended RPC thread count for camera provider implementations +const int HWBINDER_THREAD_COUNT = 6; + +template +struct CameraProvider : public ICameraProvider { + CameraProvider() : impl() {} + ~CameraProvider() {} + + // Caller must use this method to check if CameraProvider ctor failed + bool isInitFailed() { return impl.isInitFailed(); } + + // Methods from ::android::hardware::camera::provider::V2_4::ICameraProvider follow. + Return setCallback(const sp& callback) override { + return impl.setCallback(callback); + } + + Return getVendorTags(getVendorTags_cb _hidl_cb) override { + return impl.getVendorTags(_hidl_cb); + } + + Return getCameraIdList(getCameraIdList_cb _hidl_cb) override { + return impl.getCameraIdList(_hidl_cb); + } + + Return isSetTorchModeSupported(isSetTorchModeSupported_cb _hidl_cb) override { + return impl.isSetTorchModeSupported(_hidl_cb); + } + + Return getCameraDeviceInterface_V1_x(const hidl_string& cameraDeviceName, + getCameraDeviceInterface_V1_x_cb _hidl_cb) override { + return impl.getCameraDeviceInterface_V1_x(cameraDeviceName, _hidl_cb); + } + + Return getCameraDeviceInterface_V3_x(const hidl_string& cameraDeviceName, + getCameraDeviceInterface_V3_x_cb _hidl_cb) override { + return impl.getCameraDeviceInterface_V3_x(cameraDeviceName, _hidl_cb); + } + + // Methods from ::android::hardware::camera::provider::V2_5::ICameraProvider follow. + Return notifyDeviceStateChange(hardware::hidl_bitfield newState) override { + return impl.notifyDeviceStateChange(newState); + } + + // Methods from ::android::hardware::camera::provider::V2_7::ICameraProvider follow. + Return getConcurrentStreamingCameraIds( + getConcurrentStreamingCameraIds_cb _hidl_cb) override { + return impl.getConcurrentStreamingCameraIds(_hidl_cb); + } + + Return isConcurrentStreamCombinationSupported( + const hidl_vec< + ::android::hardware::camera::provider::V2_6::CameraIdAndStreamCombination>& + configs, + isConcurrentStreamCombinationSupported_cb _hidl_cb) override { + return impl.isConcurrentStreamCombinationSupported(configs, _hidl_cb); + } + + Return isConcurrentStreamCombinationSupported_2_7( + const hidl_vec& configs, + isConcurrentStreamCombinationSupported_2_7_cb _hidl_cb) override { + return impl.isConcurrentStreamCombinationSupported_2_7(configs, _hidl_cb); + } + + private: + IMPL impl; +}; + +} // namespace implementation +} // namespace V2_7 +} // namespace provider +} // namespace camera +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_CAMERA_PROVIDER_V2_4_CAMERAPROVIDER_H \ No newline at end of file diff --git a/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp b/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp new file mode 100644 index 0000000000..c812d54a09 --- /dev/null +++ b/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp @@ -0,0 +1,394 @@ +/* + * 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. + */ + +#define LOG_TAG "CamPrvdr@2.7-external" +//#define LOG_NDEBUG 0 +#include + +#include +#include +#include +#include +#include +#include "ExternalCameraDevice_3_4.h" +#include "ExternalCameraDevice_3_5.h" +#include "ExternalCameraDevice_3_6.h" +#include "ExternalCameraProviderImpl_2_7.h" + +namespace android { +namespace hardware { +namespace camera { +namespace provider { +namespace V2_7 { +namespace implementation { + +namespace { +// "device@/external/" +const std::regex kDeviceNameRE("device@([0-9]+\\.[0-9]+)/external/(.+)"); +const int kMaxDevicePathLen = 256; +const char* kDevicePath = "/dev/"; +constexpr char kPrefix[] = "video"; +constexpr int kPrefixLen = sizeof(kPrefix) - 1; +constexpr int kDevicePrefixLen = sizeof(kDevicePath) + kPrefixLen + 1; + +bool matchDeviceName(int cameraIdOffset, const hidl_string& deviceName, std::string* deviceVersion, + std::string* cameraDevicePath) { + std::string deviceNameStd(deviceName.c_str()); + std::smatch sm; + if (std::regex_match(deviceNameStd, sm, kDeviceNameRE)) { + if (deviceVersion != nullptr) { + *deviceVersion = sm[1]; + } + if (cameraDevicePath != nullptr) { + *cameraDevicePath = "/dev/video" + std::to_string(std::stoi(sm[2]) - cameraIdOffset); + } + return true; + } + return false; +} + +} // anonymous namespace + +ExternalCameraProviderImpl_2_7::ExternalCameraProviderImpl_2_7() + : mCfg(ExternalCameraConfig::loadFromCfg()) { + mHotPlugThread = sp::make(this); + mHotPlugThread->run("ExtCamHotPlug", PRIORITY_BACKGROUND); + + mPreferredHal3MinorVersion = + property_get_int32("ro.vendor.camera.external.hal3TrebleMinorVersion", 4); + ALOGV("Preferred HAL 3 minor version is %d", mPreferredHal3MinorVersion); + switch (mPreferredHal3MinorVersion) { + case 4: + case 5: + case 6: + // OK + break; + default: + ALOGW("Unknown minor camera device HAL version %d in property " + "'camera.external.hal3TrebleMinorVersion', defaulting to 4", + mPreferredHal3MinorVersion); + mPreferredHal3MinorVersion = 4; + } +} + +ExternalCameraProviderImpl_2_7::~ExternalCameraProviderImpl_2_7() { + mHotPlugThread->requestExit(); +} + +Return ExternalCameraProviderImpl_2_7::setCallback( + const sp& callback) { + 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) { + mCallbacks->cameraDeviceStatusChange(pair.first, pair.second); + } + } + + return Status::OK; +} + +Return ExternalCameraProviderImpl_2_7::getVendorTags( + ICameraProvider::getVendorTags_cb _hidl_cb) { + // No vendor tag support for USB camera + hidl_vec zeroSections; + _hidl_cb(Status::OK, zeroSections); + return Void(); +} + +Return ExternalCameraProviderImpl_2_7::getCameraIdList( + ICameraProvider::getCameraIdList_cb _hidl_cb) { + // External camera HAL always report 0 camera, and extra cameras + // are just reported via cameraDeviceStatusChange callbacks + hidl_vec hidlDeviceNameList; + _hidl_cb(Status::OK, hidlDeviceNameList); + return Void(); +} + +void ExternalCameraProviderImpl_2_7::updateAttachedCameras() { + ALOGV("%s start scaning for existing V4L2 devices", __FUNCTION__); + // Find existing /dev/video* devices + DIR* devdir = opendir(kDevicePath); + if (devdir == 0) { + ALOGE("%s: cannot open %s! Exiting threadloop", __FUNCTION__, kDevicePath); + return; + } + + struct dirent* de; + while ((de = readdir(devdir)) != 0) { + // Find external v4l devices that's existing before we start watching and add them + if (!strncmp(kPrefix, de->d_name, kPrefixLen)) { + // TODO: This might reject some valid devices. Ex: internal is 33 and a device named 3 + // is added. + std::string deviceId(de->d_name + kPrefixLen); + if (mCfg.mInternalDevices.count(deviceId) == 0) { + ALOGV("Non-internal v4l device %s found", de->d_name); + char v4l2DevicePath[kMaxDevicePathLen]; + snprintf(v4l2DevicePath, kMaxDevicePathLen, "%s%s", kDevicePath, de->d_name); + deviceAdded(v4l2DevicePath); + } + } + } + closedir(devdir); +} + +Return ExternalCameraProviderImpl_2_7::isSetTorchModeSupported( + ICameraProvider::isSetTorchModeSupported_cb _hidl_cb) { + // setTorchMode API is supported, though right now no external camera device + // has a flash unit. + _hidl_cb(Status::OK, true); + return Void(); +} + +Return ExternalCameraProviderImpl_2_7::getCameraDeviceInterface_V1_x( + const hidl_string&, ICameraProvider::getCameraDeviceInterface_V1_x_cb _hidl_cb) { + // External Camera HAL does not support HAL1 + _hidl_cb(Status::OPERATION_NOT_SUPPORTED, nullptr); + return Void(); +} + +Return ExternalCameraProviderImpl_2_7::getCameraDeviceInterface_V3_x( + const hidl_string& cameraDeviceName, + ICameraProvider::getCameraDeviceInterface_V3_x_cb _hidl_cb) { + std::string cameraDevicePath, deviceVersion; + bool match = matchDeviceName(mCfg.cameraIdOffset, cameraDeviceName, &deviceVersion, + &cameraDevicePath); + if (!match) { + _hidl_cb(Status::ILLEGAL_ARGUMENT, nullptr); + return Void(); + } + + if (mCameraStatusMap.count(cameraDeviceName) == 0 || + mCameraStatusMap[cameraDeviceName] != CameraDeviceStatus::PRESENT) { + _hidl_cb(Status::ILLEGAL_ARGUMENT, nullptr); + return Void(); + } + + sp deviceImpl; + switch (mPreferredHal3MinorVersion) { + case 4: { + ALOGV("Constructing v3.4 external camera device"); + deviceImpl = + new device::V3_4::implementation::ExternalCameraDevice(cameraDevicePath, mCfg); + break; + } + case 5: { + ALOGV("Constructing v3.5 external camera device"); + deviceImpl = + new device::V3_5::implementation::ExternalCameraDevice(cameraDevicePath, mCfg); + break; + } + case 6: { + ALOGV("Constructing v3.6 external camera device"); + deviceImpl = + new device::V3_6::implementation::ExternalCameraDevice(cameraDevicePath, mCfg); + break; + } + default: + ALOGE("%s: Unknown HAL minor version %d!", __FUNCTION__, mPreferredHal3MinorVersion); + _hidl_cb(Status::INTERNAL_ERROR, nullptr); + return Void(); + } + + if (deviceImpl == nullptr || deviceImpl->isInitFailed()) { + ALOGE("%s: camera device %s init failed!", __FUNCTION__, cameraDevicePath.c_str()); + _hidl_cb(Status::INTERNAL_ERROR, nullptr); + return Void(); + } + + IF_ALOGV() { + deviceImpl->getInterface()->interfaceChain( + [](::android::hardware::hidl_vec<::android::hardware::hidl_string> interfaceChain) { + ALOGV("Device interface chain:"); + for (auto iface : interfaceChain) { + ALOGV(" %s", iface.c_str()); + } + }); + } + + _hidl_cb(Status::OK, deviceImpl->getInterface()); + + return Void(); +} + +void ExternalCameraProviderImpl_2_7::addExternalCamera(const char* devName) { + ALOGV("ExtCam: adding %s to External Camera HAL!", devName); + Mutex::Autolock _l(mLock); + std::string deviceName; + std::string cameraId = + std::to_string(mCfg.cameraIdOffset + std::atoi(devName + kDevicePrefixLen)); + if (mPreferredHal3MinorVersion == 6) { + deviceName = std::string("device@3.6/external/") + cameraId; + } else if (mPreferredHal3MinorVersion == 5) { + deviceName = std::string("device@3.5/external/") + cameraId; + } else { + deviceName = std::string("device@3.4/external/") + cameraId; + } + mCameraStatusMap[deviceName] = CameraDeviceStatus::PRESENT; + if (mCallbacks != nullptr) { + mCallbacks->cameraDeviceStatusChange(deviceName, CameraDeviceStatus::PRESENT); + } +} + +void ExternalCameraProviderImpl_2_7::deviceAdded(const char* devName) { + { + base::unique_fd fd(::open(devName, O_RDWR)); + if (fd.get() < 0) { + ALOGE("%s open v4l2 device %s failed:%s", __FUNCTION__, devName, strerror(errno)); + return; + } + + struct v4l2_capability capability; + int ret = ioctl(fd.get(), VIDIOC_QUERYCAP, &capability); + if (ret < 0) { + ALOGE("%s v4l2 QUERYCAP %s failed", __FUNCTION__, devName); + return; + } + + if (!(capability.device_caps & V4L2_CAP_VIDEO_CAPTURE)) { + ALOGW("%s device %s does not support VIDEO_CAPTURE", __FUNCTION__, devName); + return; + } + } + // See if we can initialize ExternalCameraDevice correctly + sp deviceImpl = + new device::V3_4::implementation::ExternalCameraDevice(devName, mCfg); + if (deviceImpl == nullptr || deviceImpl->isInitFailed()) { + ALOGW("%s: Attempt to init camera device %s failed!", __FUNCTION__, devName); + return; + } + deviceImpl.clear(); + + addExternalCamera(devName); + return; +} + +void ExternalCameraProviderImpl_2_7::deviceRemoved(const char* devName) { + Mutex::Autolock _l(mLock); + std::string deviceName; + std::string cameraId = + std::to_string(mCfg.cameraIdOffset + std::atoi(devName + kDevicePrefixLen)); + if (mPreferredHal3MinorVersion == 6) { + deviceName = std::string("device@3.6/external/") + cameraId; + } else if (mPreferredHal3MinorVersion == 5) { + deviceName = std::string("device@3.5/external/") + cameraId; + } else { + deviceName = std::string("device@3.4/external/") + cameraId; + } + if (mCameraStatusMap.find(deviceName) != mCameraStatusMap.end()) { + mCameraStatusMap.erase(deviceName); + if (mCallbacks != nullptr) { + mCallbacks->cameraDeviceStatusChange(deviceName, CameraDeviceStatus::NOT_PRESENT); + } + } else { + ALOGE("%s: cannot find camera device %s", __FUNCTION__, devName); + } +} + +ExternalCameraProviderImpl_2_7::HotplugThread::HotplugThread(ExternalCameraProviderImpl_2_7* parent) + : Thread(/*canCallJava*/ false), + mParent(parent), + mInternalDevices(parent->mCfg.mInternalDevices) {} + +ExternalCameraProviderImpl_2_7::HotplugThread::~HotplugThread() {} + +bool ExternalCameraProviderImpl_2_7::HotplugThread::threadLoop() { + // Update existing cameras + mParent->updateAttachedCameras(); + + // Watch new video devices + mINotifyFD = inotify_init(); + if (mINotifyFD < 0) { + ALOGE("%s: inotify init failed! Exiting threadloop", __FUNCTION__); + return true; + } + + mWd = inotify_add_watch(mINotifyFD, kDevicePath, IN_CREATE | IN_DELETE); + if (mWd < 0) { + ALOGE("%s: inotify add watch failed! Exiting threadloop", __FUNCTION__); + return true; + } + + bool done = false; + char eventBuf[512]; + while (!done) { + int offset = 0; + int ret = read(mINotifyFD, eventBuf, sizeof(eventBuf)); + if (ret >= (int)sizeof(struct inotify_event)) { + while (offset < ret) { + struct inotify_event* event = (struct inotify_event*)&eventBuf[offset]; + if (event->wd == mWd) { + ALOGV("%s inotify_event %s", __FUNCTION__, event->name); + if (!strncmp(kPrefix, event->name, kPrefixLen)) { + std::string deviceId(event->name + kPrefixLen); + if (mInternalDevices.count(deviceId) == 0) { + char v4l2DevicePath[kMaxDevicePathLen]; + snprintf(v4l2DevicePath, kMaxDevicePathLen, "%s%s", kDevicePath, + event->name); + if (event->mask & IN_CREATE) { + mParent->deviceAdded(v4l2DevicePath); + } + if (event->mask & IN_DELETE) { + mParent->deviceRemoved(v4l2DevicePath); + } + } + } + } + offset += sizeof(struct inotify_event) + event->len; + } + } + } + + return true; +} + +Return ExternalCameraProviderImpl_2_7::notifyDeviceStateChange( + hidl_bitfield /*newState*/) { + return Void(); +} + +Return ExternalCameraProviderImpl_2_7::getConcurrentStreamingCameraIds( + ICameraProvider::getConcurrentStreamingCameraIds_cb _hidl_cb) { + hidl_vec> hidl_camera_id_combinations; + _hidl_cb(Status::OK, hidl_camera_id_combinations); + return Void(); +} + +Return ExternalCameraProviderImpl_2_7::isConcurrentStreamCombinationSupported( + const hidl_vec<::android::hardware::camera::provider::V2_6:: + CameraIdAndStreamCombination>& /* configs */, + ICameraProvider::isConcurrentStreamCombinationSupported_cb _hidl_cb) { + _hidl_cb(Status::OK, false); + return Void(); +} + +Return ExternalCameraProviderImpl_2_7::isConcurrentStreamCombinationSupported_2_7( + const hidl_vec& /* configs */, + ICameraProvider::isConcurrentStreamCombinationSupported_2_7_cb _hidl_cb) { + _hidl_cb(Status::OK, false); + return Void(); +} + +} // namespace implementation +} // namespace V2_7 +} // namespace provider +} // namespace camera +} // namespace hardware +} // namespace android \ No newline at end of file diff --git a/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.h b/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.h new file mode 100644 index 0000000000..da9f6b3a91 --- /dev/null +++ b/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.h @@ -0,0 +1,134 @@ +/* + * 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_CAMERA_PROVIDER_V2_7_EXTCAMERAPROVIDER_H +#define ANDROID_HARDWARE_CAMERA_PROVIDER_V2_7_EXTCAMERAPROVIDER_H + +#include +#include +#include +#include +#include +#include +#include +#include "ExternalCameraUtils.h" + +#include +#include + +namespace android { +namespace hardware { +namespace camera { +namespace provider { +namespace V2_7 { +namespace implementation { + +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::camera::common::V1_0::CameraDeviceStatus; +using ::android::hardware::camera::common::V1_0::Status; +using ::android::hardware::camera::common::V1_0::VendorTagSection; +using ::android::hardware::camera::external::common::ExternalCameraConfig; +using ::android::hardware::camera::provider::V2_4::ICameraProviderCallback; +using ::android::hardware::camera::provider::V2_5::DeviceState; +using ::android::hardware::camera::provider::V2_7::CameraIdAndStreamCombination; +using ::android::hardware::camera::provider::V2_7::ICameraProvider; +using ::android::hidl::base::V1_0::IBase; + +/** + * The implementation of external webcam CameraProvider 2.7, separated + * from the HIDL interface layer to allow for implementation reuse by later + * provider versions. + * + * This camera provider supports standard UVC webcameras via the Linux V4L2 + * UVC driver. + */ +struct ExternalCameraProviderImpl_2_7 { + ExternalCameraProviderImpl_2_7(); + ~ExternalCameraProviderImpl_2_7(); + + // Caller must use this method to check if CameraProvider ctor failed + bool isInitFailed() { return false; } + + // Methods from ::android::hardware::camera::provider::V2_4::ICameraProvider follow. + Return setCallback(const sp& callback); + Return getVendorTags(ICameraProvider::getVendorTags_cb _hidl_cb); + Return getCameraIdList(ICameraProvider::getCameraIdList_cb _hidl_cb); + Return isSetTorchModeSupported(ICameraProvider::isSetTorchModeSupported_cb _hidl_cb); + Return getCameraDeviceInterface_V1_x(const hidl_string&, + ICameraProvider::getCameraDeviceInterface_V1_x_cb); + Return getCameraDeviceInterface_V3_x(const hidl_string&, + ICameraProvider::getCameraDeviceInterface_V3_x_cb); + + // Methods from ::android::hardware::camera::provider::V2_5::ICameraProvider follow. + Return notifyDeviceStateChange(hidl_bitfield newState); + + // Methods from ::android::hardware::camera::provider::V2_7::ICameraProvider follow. + Return getConcurrentStreamingCameraIds( + ICameraProvider::getConcurrentStreamingCameraIds_cb _hidl_cb); + + Return isConcurrentStreamCombinationSupported( + const hidl_vec< + ::android::hardware::camera::provider::V2_6::CameraIdAndStreamCombination>& + configs, + ICameraProvider::isConcurrentStreamCombinationSupported_cb _hidl_cb); + + Return isConcurrentStreamCombinationSupported_2_7( + const hidl_vec& configs, + ICameraProvider::isConcurrentStreamCombinationSupported_2_7_cb _hidl_cb); + + private: + void addExternalCamera(const char* devName); + + void deviceAdded(const char* devName); + + void deviceRemoved(const char* devName); + + void updateAttachedCameras(); + + class HotplugThread : public android::Thread { + public: + HotplugThread(ExternalCameraProviderImpl_2_7* parent); + ~HotplugThread(); + + virtual bool threadLoop() override; + + private: + ExternalCameraProviderImpl_2_7* mParent = nullptr; + const std::unordered_set mInternalDevices; + + int mINotifyFD = -1; + int mWd = -1; + }; + + Mutex mLock; + sp mCallbacks = nullptr; + std::unordered_map mCameraStatusMap; // camera id -> status + const ExternalCameraConfig mCfg; + sp mHotPlugThread; + int mPreferredHal3MinorVersion; +}; + +} // namespace implementation +} // namespace V2_7 +} // namespace provider +} // namespace camera +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_CAMERA_PROVIDER_V2_7_EXTCAMERAPROVIDER_H diff --git a/camera/provider/2.7/default/android.hardware.camera.provider@2.7-external-service-lazy.rc b/camera/provider/2.7/default/android.hardware.camera.provider@2.7-external-service-lazy.rc new file mode 100644 index 0000000000..9292c4f959 --- /dev/null +++ b/camera/provider/2.7/default/android.hardware.camera.provider@2.7-external-service-lazy.rc @@ -0,0 +1,13 @@ +service vendor.camera-provider-2-7-ext /vendor/bin/hw/android.hardware.camera.provider@2.7-external-service-lazy + interface android.hardware.camera.provider@2.4::ICameraProvider external/0 + interface android.hardware.camera.provider@2.5::ICameraProvider external/0 + interface android.hardware.camera.provider@2.6::ICameraProvider external/0 + interface android.hardware.camera.provider@2.7::ICameraProvider external/0 + class hal + oneshot + disabled + user cameraserver + group audio camera input drmrpc usb + ioprio rt 4 + capabilities SYS_NICE + task_profiles CameraServiceCapacity MaxPerformance \ No newline at end of file diff --git a/camera/provider/2.7/default/android.hardware.camera.provider@2.7-external-service.rc b/camera/provider/2.7/default/android.hardware.camera.provider@2.7-external-service.rc new file mode 100644 index 0000000000..2c9b782c1c --- /dev/null +++ b/camera/provider/2.7/default/android.hardware.camera.provider@2.7-external-service.rc @@ -0,0 +1,11 @@ +service vendor.camera-provider-2-7-ext /vendor/bin/hw/android.hardware.camera.provider@2.7-external-service + interface android.hardware.camera.provider@2.4::ICameraProvider external/0 + interface android.hardware.camera.provider@2.5::ICameraProvider external/0 + interface android.hardware.camera.provider@2.6::ICameraProvider external/0 + interface android.hardware.camera.provider@2.7::ICameraProvider external/0 + class hal + user cameraserver + group audio camera input drmrpc usb + ioprio rt 4 + capabilities SYS_NICE + task_profiles CameraServiceCapacity MaxPerformance diff --git a/camera/provider/2.7/default/external-service.cpp b/camera/provider/2.7/default/external-service.cpp new file mode 100644 index 0000000000..90b823970f --- /dev/null +++ b/camera/provider/2.7/default/external-service.cpp @@ -0,0 +1,66 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifdef LAZY_SERVICE +#define LOG_TAG "android.hardware.camera.provider@2.7-external-service-lazy" +#else +#define LOG_TAG "android.hardware.camera.provider@2.7-external-service" +#endif + +#include +#include +#include +#include + +#include "CameraProvider_2_7.h" +#include "ExternalCameraProviderImpl_2_7.h" + +using android::status_t; +using android::hardware::camera::provider::V2_7::ICameraProvider; +using android::hidl::base::V1_0::IBase; + +#ifdef LAZY_SERVICE +const bool kLazyService = true; +#else +const bool kLazyService = false; +#endif + +int main() { + using namespace android::hardware::camera::provider::V2_7::implementation; + + ALOGI("CameraProvider@2.7 external webcam service is starting."); + + ::android::hardware::configureRpcThreadpool(/*threads*/ HWBINDER_THREAD_COUNT, + /*willJoin*/ true); + + ::android::sp> provider = + new CameraProvider(); + + status_t status; + if (kLazyService) { + auto serviceRegistrar = ::android::hardware::LazyServiceRegistrar::getInstance(); + status = serviceRegistrar.registerService(provider, "external/0"); + } else { + status = provider->registerAsService("external/0"); + } + + LOG_ALWAYS_FATAL_IF(status != android::OK, "Error while registering provider service: %d", + status); + + ::android::hardware::joinRpcThreadpool(); + + return 0; +} \ No newline at end of file -- GitLab From 5766ddfacaa346f81c4e8decc3c12271adefac20 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Thu, 23 Dec 2021 11:40:37 -0800 Subject: [PATCH 368/825] Support enable/disable Frontends. Bug: 210199978 Test: atest VtsHalTvTunerTargetTest Change-Id: I08411ef92d83be6623ed60565d65d6e9093405ad --- .../android/hardware/tv/tuner/ITuner.aidl | 2 + .../android/hardware/tv/tuner/ITuner.aidl | 21 +++++++++++ tv/tuner/aidl/default/Tuner.cpp | 29 +++++++++++++++ tv/tuner/aidl/default/Tuner.h | 5 +++ .../aidl/vts/functional/FrontendTests.cpp | 37 +++++++++++++++++++ tv/tuner/aidl/vts/functional/FrontendTests.h | 1 + .../functional/VtsHalTvTunerTargetTest.cpp | 8 ++++ 7 files changed, 103 insertions(+) diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl index decf5b112b..0ff2da9aa1 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl @@ -45,4 +45,6 @@ interface ITuner { android.hardware.tv.tuner.ILnb openLnbById(in int lnbId); android.hardware.tv.tuner.ILnb openLnbByName(in String lnbName, out int[] lnbId); void setLna(in boolean bEnable); + void setMaxNumberOfFrontends(in android.hardware.tv.tuner.FrontendType frontendType, in int maxNumber); + int getMaxNumberOfFrontends(in android.hardware.tv.tuner.FrontendType frontendType); } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl index 1fcbb06706..03def33d46 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl @@ -18,6 +18,7 @@ package android.hardware.tv.tuner; import android.hardware.tv.tuner.DemuxCapabilities; import android.hardware.tv.tuner.FrontendInfo; +import android.hardware.tv.tuner.FrontendType; import android.hardware.tv.tuner.IDemux; import android.hardware.tv.tuner.IDescrambler; import android.hardware.tv.tuner.IFrontend; @@ -127,4 +128,24 @@ interface ITuner { * @param bEnable true if activate LNA module; false if deactivate LNA */ void setLna(in boolean bEnable); + + /** + * Set the maximum usable frontends number of a given frontend type. + * + * It is used by the client to enable or disable frontends when cable connection status + * is changed by user. + * + * @param frontendType the frontend type which the maximum usable number will be set. + * @param maxNumber the new maximum usable number. + */ + void setMaxNumberOfFrontends(in FrontendType frontendType, in int maxNumber); + + /** + * Get the maximum usable frontends number of a given frontend type. + * + * @param frontendType the frontend type which the maximum usable number will be queried. + * + * @return the maximum usable number of the queried frontend type. + */ + int getMaxNumberOfFrontends(in FrontendType frontendType); } diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp index 45f3dfafcc..48c1b66a50 100644 --- a/tv/tuner/aidl/default/Tuner.cpp +++ b/tv/tuner/aidl/default/Tuner.cpp @@ -64,6 +64,7 @@ void Tuner::init() { FrontendStatusType::STREAM_ID_LIST, }; mFrontendStatusCaps[0] = statusCaps; + mMaxUsableFrontends[FrontendType::ISDBS] = 1; FrontendCapabilities capsAtsc3; capsAtsc3.set(FrontendAtsc3Capabilities()); @@ -78,6 +79,7 @@ void Tuner::init() { FrontendStatusType::BANDWIDTH, }; mFrontendStatusCaps[1] = statusCaps; + mMaxUsableFrontends[FrontendType::ATSC3] = 1; FrontendCapabilities capsDvbc; capsDvbc.set(FrontendDvbcCapabilities()); @@ -89,6 +91,7 @@ void Tuner::init() { FrontendStatusType::INTERLEAVINGS, FrontendStatusType::BANDWIDTH, }; mFrontendStatusCaps[2] = statusCaps; + mMaxUsableFrontends[FrontendType::DVBC] = 1; FrontendCapabilities capsDvbs; capsDvbs.set(FrontendDvbsCapabilities()); @@ -99,6 +102,7 @@ void Tuner::init() { FrontendStatusType::ROLL_OFF, FrontendStatusType::IS_MISO, }; mFrontendStatusCaps[3] = statusCaps; + mMaxUsableFrontends[FrontendType::DVBS] = 1; FrontendCapabilities capsDvbt; capsDvbt.set(FrontendDvbtCapabilities()); @@ -115,6 +119,7 @@ void Tuner::init() { FrontendStatusType::DVBT_CELL_IDS, }; mFrontendStatusCaps[4] = statusCaps; + mMaxUsableFrontends[FrontendType::DVBT] = 1; FrontendCapabilities capsIsdbt; FrontendIsdbtCapabilities isdbtCaps{ @@ -145,6 +150,7 @@ void Tuner::init() { FrontendStatusType::INTERLEAVINGS, }; mFrontendStatusCaps[5] = statusCaps; + mMaxUsableFrontends[FrontendType::ISDBT] = 1; FrontendCapabilities capsAnalog; capsAnalog.set(FrontendAnalogCapabilities()); @@ -156,6 +162,7 @@ void Tuner::init() { FrontendStatusType::TS_DATA_RATES, }; mFrontendStatusCaps[6] = statusCaps; + mMaxUsableFrontends[FrontendType::ANALOG] = 1; FrontendCapabilities capsAtsc; capsAtsc.set(FrontendAtscCapabilities()); @@ -167,6 +174,7 @@ void Tuner::init() { FrontendStatusType::IS_LINEAR, }; mFrontendStatusCaps[7] = statusCaps; + mMaxUsableFrontends[FrontendType::ATSC] = 1; FrontendCapabilities capsIsdbs3; capsIsdbs3.set(FrontendIsdbs3Capabilities()); @@ -177,6 +185,7 @@ void Tuner::init() { FrontendStatusType::IS_SHORT_FRAMES, FrontendStatusType::STREAM_ID_LIST, }; mFrontendStatusCaps[8] = statusCaps; + mMaxUsableFrontends[FrontendType::ISDBS3] = 1; FrontendCapabilities capsDtmb; capsDtmb.set(FrontendDtmbCapabilities()); @@ -187,6 +196,7 @@ void Tuner::init() { FrontendStatusType::TRANSMISSION_MODE, }; mFrontendStatusCaps[9] = statusCaps; + mMaxUsableFrontends[FrontendType::DTMB] = 1; mLnbs.resize(2); mLnbs[0] = ndk::SharedRefBase::make(0); @@ -324,6 +334,25 @@ std::shared_ptr Tuner::getFrontendById(int32_t frontendId) { return ::ndk::ScopedAStatus::ok(); } +::ndk::ScopedAStatus Tuner::setMaxNumberOfFrontends(FrontendType in_frontendType, + int32_t in_maxNumber) { + ALOGV("%s", __FUNCTION__); + + // In the default implementation, every type only has one frontend. + if (in_maxNumber < 0 || in_maxNumber > 1) { + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); + } + mMaxUsableFrontends[in_frontendType] = in_maxNumber; + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus Tuner::getMaxNumberOfFrontends(FrontendType in_frontendType, + int32_t* _aidl_return) { + *_aidl_return = mMaxUsableFrontends[in_frontendType]; + return ::ndk::ScopedAStatus::ok(); +} + binder_status_t Tuner::dump(int fd, const char** args, uint32_t numArgs) { ALOGV("%s", __FUNCTION__); { diff --git a/tv/tuner/aidl/default/Tuner.h b/tv/tuner/aidl/default/Tuner.h index b33a1bebc9..216a2b6280 100644 --- a/tv/tuner/aidl/default/Tuner.h +++ b/tv/tuner/aidl/default/Tuner.h @@ -57,6 +57,10 @@ class Tuner : public BnTuner { std::vector* out_lnbId, std::shared_ptr* _aidl_return) override; ::ndk::ScopedAStatus setLna(bool in_bEnable) override; + ::ndk::ScopedAStatus setMaxNumberOfFrontends(FrontendType in_frontendType, + int32_t in_maxNumber) override; + ::ndk::ScopedAStatus getMaxNumberOfFrontends(FrontendType in_frontendType, + int32_t* _aidl_return) override; binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; @@ -81,6 +85,7 @@ class Tuner : public BnTuner { // First used id will be 0. int32_t mLastUsedId = -1; vector> mLnbs; + map mMaxUsableFrontends; }; } // namespace tuner diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp index 075ffad79b..41e98ea586 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp +++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp @@ -14,6 +14,8 @@ * limitations under the License. */ +#include + #include "FrontendTests.h" ndk::ScopedAStatus FrontendCallback::onEvent(FrontendEventType frontendEventType) { @@ -519,6 +521,41 @@ void FrontendTests::debugInfoTest(FrontendConfig frontendConf) { ASSERT_TRUE(closeFrontend()); } +void FrontendTests::maxNumberOfFrontendsTest() { + ASSERT_TRUE(getFrontendIds()); + for (size_t i = 0; i < mFeIds.size(); i++) { + ASSERT_TRUE(getFrontendInfo(mFeIds[i])); + int32_t defaultMax = -1; + ndk::ScopedAStatus status; + // Check default value + status = mService->getMaxNumberOfFrontends(mFrontendInfo.type, &defaultMax); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(defaultMax > 0); + // Set to -1 + status = mService->setMaxNumberOfFrontends(mFrontendInfo.type, -1); + ASSERT_TRUE(status.getServiceSpecificError() == + static_cast(Result::INVALID_ARGUMENT)); + // Set to defaultMax + 1 + status = mService->setMaxNumberOfFrontends(mFrontendInfo.type, defaultMax + 1); + ASSERT_TRUE(status.getServiceSpecificError() == + static_cast(Result::INVALID_ARGUMENT)); + // Set to 0 + status = mService->setMaxNumberOfFrontends(mFrontendInfo.type, 0); + ASSERT_TRUE(status.isOk()); + // Check after set + int32_t currentMax = -1; + status = mService->getMaxNumberOfFrontends(mFrontendInfo.type, ¤tMax); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(currentMax == 0); + // Reset to default + status = mService->setMaxNumberOfFrontends(mFrontendInfo.type, defaultMax); + ASSERT_TRUE(status.isOk()); + status = mService->getMaxNumberOfFrontends(mFrontendInfo.type, ¤tMax); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(defaultMax == currentMax); + } +} + void FrontendTests::scanTest(FrontendConfig frontendConf, FrontendScanType scanType) { int32_t feId; getFrontendIdByType(frontendConf.type, feId); diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.h b/tv/tuner/aidl/vts/functional/FrontendTests.h index 8f769a0004..1745f76cd8 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.h +++ b/tv/tuner/aidl/vts/functional/FrontendTests.h @@ -100,6 +100,7 @@ class FrontendTests { void tuneTest(FrontendConfig frontendConf); void scanTest(FrontendConfig frontend, FrontendScanType type); void debugInfoTest(FrontendConfig frontendConf); + void maxNumberOfFrontendsTest(); void setDvrTests(DvrTests* dvrTests) { mExternalDvrTests = dvrTests; } void setDemux(std::shared_ptr demux) { getDvrTests()->setDemux(demux); } diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp index 202f83f542..a042427556 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp @@ -891,6 +891,14 @@ TEST_P(TunerFrontendAidlTest, getHardwareInfo) { mFrontendTests.debugInfoTest(frontendMap[live.frontendId]); } +TEST_P(TunerFrontendAidlTest, maxNumberOfFrontends) { + description("Test Max Frontend number"); + if (!live.hasFrontendConnection) { + return; + } + mFrontendTests.maxNumberOfFrontendsTest(); +} + TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowVideoFilterTest) { description("Test Video Filter functionality in Broadcast use case."); if (!live.hasFrontendConnection) { -- GitLab From 2efab6cd3ce6efb5f1fc9a3242f649594a02cc1a Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Tue, 28 Dec 2021 14:43:12 +0000 Subject: [PATCH 369/825] Reland "Update documentation for DISPLAY_DECORATION" The first time this topic landed, it resulted in b/212402133. We avoid running into this bug with Ib11d46439db57b90486bad07dd90f2cf0822182a. Remove references to 8 bit alpha. Original commit message: After some discussion, we've decided to always set the ScreenDecorations to DISPLAY_DECORATION. HWC can decide, based on the format, whether to truly treat it as DISPLAY_DECORATION, or to change to DEVICE composition. Update the documentation to reflect this change. See also I1da3199bacf5877e88876249c60c0a33fcd44c1e. Bug: 193170859 Test: NA Change-Id: Iaf5385c38f6827e07b91a9a0a8769fb7a125e847 --- .../hardware/graphics/composer3/Composition.aidl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl index 4947463ba9..803de0656a 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl @@ -74,16 +74,17 @@ enum Composition { */ SIDEBAND = 5, /** - * A display decoration layer contains a buffer which is an 8 bit - * alpha mask. Pixels in the mask with an alpha of 0 (transparent) will - * show the content underneath, and pixels with an alpha of 255 will be - * be rendered in black. An alpha in between will show the content - * blended with black. This is useful, for example, to provide + * A display decoration layer contains a buffer which is used to provide * anti-aliasing on the cutout region/rounded corners on the top and * bottom of a display. * + * Pixels in the buffer with an alpha of 0 (transparent) will show the + * content underneath, and pixels with a max alpha value will be rendered in + * black. An alpha in between will show the underlying content blended with + * black. + * * Upon validateDisplay, the device may request a change from this type - * to CLIENT. + * to either DEVICE or CLIENT. */ DISPLAY_DECORATION = 6, } -- GitLab From 11c0c2423ef203ef10dc2fc2409514eb842046d7 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Wed, 15 Dec 2021 11:22:09 -0800 Subject: [PATCH 370/825] Add intervalMillis to IGnssMeasurement (hardware/interfaces) Bug: 206670536 Test: atest VtsHalGnssTargetTest Change-Id: I911fc3c0fd6010ddb20265e1551a7cb3b75216d7 --- .../gnss/IGnssMeasurementInterface.aidl | 7 +++ .../gnss/IGnssMeasurementInterface.aidl | 57 +++++++++++++++++-- .../aidl/default/GnssMeasurementInterface.cpp | 18 ++++++ gnss/aidl/default/GnssMeasurementInterface.h | 3 + gnss/aidl/vts/gnss_hal_test_cases.cpp | 39 +++++++++++++ 5 files changed, 118 insertions(+), 6 deletions(-) diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssMeasurementInterface.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssMeasurementInterface.aidl index 24d6f9c4cf..9c4a54beb1 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssMeasurementInterface.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssMeasurementInterface.aidl @@ -36,4 +36,11 @@ package android.hardware.gnss; interface IGnssMeasurementInterface { void setCallback(in android.hardware.gnss.IGnssMeasurementCallback callback, in boolean enableFullTracking, in boolean enableCorrVecOutputs); void close(); + void setCallbackWithOptions(in android.hardware.gnss.IGnssMeasurementCallback callback, in android.hardware.gnss.IGnssMeasurementInterface.Options options); + @VintfStability + parcelable Options { + boolean enableFullTracking; + boolean enableCorrVecOutputs; + int intervalMs; + } } diff --git a/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl b/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl index 08c83a42e7..102cdcd1d4 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl @@ -23,6 +23,48 @@ import android.hardware.gnss.IGnssMeasurementCallback; */ @VintfStability interface IGnssMeasurementInterface { + /** + * Options specifying the GnssMeasurement request. + */ + @VintfStability + parcelable Options { + /** + * Enable full tracking mode. + * + * If true, GNSS chipset must switch off duty cycling. In such mode no clock discontinuities + * are expected and, when supported, carrier phase should be continuous in good signal + * conditions. All non-blocklisted, healthy constellations, satellites and frequency bands + * that the chipset supports must be reported in this mode. The GNSS chipset is allowed to + * consume more power in this mode. If false, API must optimize power via duty cycling, + * constellations and frequency limits, etc. + */ + boolean enableFullTracking; + + /** + * Enable Correlation Vector outputs. + * + * If true, enable correlation vectors as part of the raw GNSS measurements outputs. If + * false, disable correlation vectors. + */ + boolean enableCorrVecOutputs; + + /** + * Time interval between the reported measurements in milliseconds. + * + * The GNSS chipset must not report measurements with a rate slower than requested. All the + * available measurements must be reported to the framework. + * + * For cases where concurrently serving the location and the measurement requests would not + * consume more power than only the measurement request, the faster rate of the 2 requests + * must be chosen. Otherwise, it is recommended that the GNSS chipset minimizes the power + * consumption with appropriate location and measurement intervals to satisfy both requests. + * For example, for 2-sec measurement interval request and 7-sec location interval request, + * the GNSS chipset is recommended to run the measurement engine with 2-sec interval and the + * location engine with 6-sec interval. + */ + int intervalMs; + } + /** * Initializes the interface and registers the callback routines with the HAL. After a * successful call to 'setCallback' the HAL must begin to provide updates at an average @@ -39,13 +81,9 @@ interface IGnssMeasurementInterface { * * @param enableCorrVecOutputs If true, enable correlation vectors as part of the raw GNSS * measurements outputs. If false, disable correlation vectors. - * - * Returns ok() if successful. Returns ERROR_ALREADY_INIT if a callback has already been - * registered without a corresponding call to 'close'. Returns ERROR_GENERIC for any other - * error. The HAL must not generate any other updates upon returning this error code. */ void setCallback(in IGnssMeasurementCallback callback, in boolean enableFullTracking, - in boolean enableCorrVecOutputs); + in boolean enableCorrVecOutputs); /** * Stops updates from the HAL, and unregisters the callback routines. After a call to close(), @@ -55,4 +93,11 @@ interface IGnssMeasurementInterface { * no work. */ void close(); -} \ No newline at end of file + + /** + * Initializes the interface and registers the callback routines with the HAL. + * + * @param options See Options definition. + */ + void setCallbackWithOptions(in IGnssMeasurementCallback callback, in Options options); +} diff --git a/gnss/aidl/default/GnssMeasurementInterface.cpp b/gnss/aidl/default/GnssMeasurementInterface.cpp index 9e4f7c7f25..2c7241b82e 100644 --- a/gnss/aidl/default/GnssMeasurementInterface.cpp +++ b/gnss/aidl/default/GnssMeasurementInterface.cpp @@ -56,11 +56,29 @@ ndk::ScopedAStatus GnssMeasurementInterface::setCallback( return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus GnssMeasurementInterface::setCallbackWithOptions( + const std::shared_ptr& callback, const Options& options) { + ALOGD("setCallbackWithOptions: fullTracking:%d, corrVec:%d, intervalMs:%d", + (int)options.enableFullTracking, (int)options.enableCorrVecOutputs, options.intervalMs); + std::unique_lock lock(mMutex); + sCallback = callback; + + if (mIsActive) { + ALOGW("GnssMeasurement callback already set. Resetting the callback..."); + stop(); + } + mMinIntervalMillis = options.intervalMs; + start(options.enableCorrVecOutputs); + + return ndk::ScopedAStatus::ok(); +} + ndk::ScopedAStatus GnssMeasurementInterface::close() { ALOGD("close"); stop(); std::unique_lock lock(mMutex); sCallback = nullptr; + mMinIntervalMillis = 1000; return ndk::ScopedAStatus::ok(); } diff --git a/gnss/aidl/default/GnssMeasurementInterface.h b/gnss/aidl/default/GnssMeasurementInterface.h index db6351555d..bf77806acb 100644 --- a/gnss/aidl/default/GnssMeasurementInterface.h +++ b/gnss/aidl/default/GnssMeasurementInterface.h @@ -32,6 +32,9 @@ struct GnssMeasurementInterface : public BnGnssMeasurementInterface { const bool enableFullTracking, const bool enableCorrVecOutputs) override; ndk::ScopedAStatus close() override; + ndk::ScopedAStatus setCallbackWithOptions( + const std::shared_ptr& callback, + const Options& options) override; private: void start(const bool enableCorrVecOutputs); diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 90b643ca86..d3cb0a0298 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -903,3 +903,42 @@ TEST_P(GnssHalTest, TestGnssVisibilityControlExtension) { status = iGnssVisibilityControl->enableNfwLocationAccess(proxyApps); ASSERT_TRUE(status.isOk()); } + +/* + * TestGnssMeasurementSetCallbackWithOptions: + * 1. Gets the GnssMeasurementExtension and verifies that it returns a non-null extension. + * 2. Sets a GnssMeasurementCallback with intervalMillis option, waits for measurements reported, + * and verifies mandatory fields are valid. + */ +TEST_P(GnssHalTest, TestGnssMeasurementSetCallbackWithOptions) { + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + return; + } + const int kFirstGnssMeasurementTimeoutSeconds = 10; + const int kNumMeasurementEvents = 5; + + sp iGnssMeasurement; + auto status = aidl_gnss_hal_->getExtensionGnssMeasurement(&iGnssMeasurement); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(iGnssMeasurement != nullptr); + + auto callback = sp::make(); + IGnssMeasurementInterface::Options options; + options.intervalMs = 2000; + status = iGnssMeasurement->setCallbackWithOptions(callback, options); + ASSERT_TRUE(status.isOk()); + + for (int i = 0; i < kNumMeasurementEvents; i++) { + GnssData lastMeasurement; + ASSERT_TRUE(callback->gnss_data_cbq_.retrieve(lastMeasurement, + kFirstGnssMeasurementTimeoutSeconds)); + EXPECT_EQ(callback->gnss_data_cbq_.calledCount(), i + 1); + ASSERT_TRUE(lastMeasurement.measurements.size() > 0); + + // Validity check GnssData fields + CheckGnssMeasurementClockFields(lastMeasurement); + } + + status = iGnssMeasurement->close(); + ASSERT_TRUE(status.isOk()); +} -- GitLab From c2cf86b1575c4e7eaa40ad86b98ddfc1a1bd273f Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 15 Oct 2021 17:08:16 -0700 Subject: [PATCH 371/825] Implment getValues in Default VHAL. Test: atest DefaultVehicleHalTest Bug: 200737967 Change-Id: I46a0ebdf1c8e211cacc7568e7a8e6f5332083c14 --- .../impl/vhal/include/DefaultVehicleHal.h | 81 +++-- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 70 +++- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 307 +++++++++++++++++- 3 files changed, 395 insertions(+), 63 deletions(-) diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index 43bdca2314..da83e94706 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -17,10 +17,15 @@ #ifndef android_hardware_automotive_vehicle_aidl_impl_vhal_include_DefaultVehicleHal_H_ #define android_hardware_automotive_vehicle_aidl_impl_vhal_include_DefaultVehicleHal_H_ +#include "ConnectedClient.h" +#include "ParcelableUtils.h" + #include #include #include #include +#include +#include #include #include @@ -40,12 +45,20 @@ constexpr int INVALID_MEMORY_FD = -1; template ::ndk::ScopedAStatus toScopedAStatus( const ::android::base::Result& result, - ::aidl::android::hardware::automotive::vehicle::StatusCode status) { + ::aidl::android::hardware::automotive::vehicle::StatusCode status, + const std::string& additionalErrorMsg) { if (result.ok()) { return ::ndk::ScopedAStatus::ok(); } - return ::ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage(toInt(status), - getErrorMsg(result).c_str()); + return ::ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( + toInt(status), (additionalErrorMsg + getErrorMsg(result)).c_str()); +} + +template +::ndk::ScopedAStatus toScopedAStatus( + const ::android::base::Result& result, + ::aidl::android::hardware::automotive::vehicle::StatusCode status) { + return toScopedAStatus(result, status, ""); } template @@ -53,43 +66,30 @@ template return toScopedAStatus(result, getErrorCode(result)); } -template -::ndk::ScopedAStatus vectorToStableLargeParcelable(std::vector& values, T2* output) { - auto result = ::android::automotive::car_binder_lib::LargeParcelableBase:: - parcelableVectorToStableLargeParcelable(values); - if (!result.ok()) { - return toScopedAStatus( - result, ::aidl::android::hardware::automotive::vehicle::StatusCode::INTERNAL_ERROR); - } - auto& fd = result.value(); - if (fd == nullptr) { - output->payloads = values; - } else { - // Move the returned ScopedFileDescriptor pointer to ScopedFileDescriptor value in - // 'sharedMemoryFd' field. - output->sharedMemoryFd.set(fd->get()); - *(fd->getR()) = INVALID_MEMORY_FD; - } - return ::ndk::ScopedAStatus::ok(); +template +::ndk::ScopedAStatus toScopedAStatus(const ::android::base::Result& result, + const std::string& additionalErrorMsg) { + return toScopedAStatus(result, getErrorCode(result), additionalErrorMsg); } } // namespace defaultvehiclehal_impl class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::vehicle::BnVehicle { public: + using CallbackType = + std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>; + explicit DefaultVehicleHal(std::unique_ptr hardware); ::ndk::ScopedAStatus getAllPropConfigs( ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs) override; ::ndk::ScopedAStatus getValues( - const std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>& - callback, + const CallbackType& callback, const ::aidl::android::hardware::automotive::vehicle::GetValueRequests& requests) override; ::ndk::ScopedAStatus setValues( - const std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>& - callback, + const CallbackType& callback, const ::aidl::android::hardware::automotive::vehicle::SetValueRequests& requests) override; ::ndk::ScopedAStatus getPropConfigs( @@ -97,27 +97,38 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs) override; ::ndk::ScopedAStatus subscribe( - const std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>& - callback, + const CallbackType& callback, const std::vector<::aidl::android::hardware::automotive::vehicle::SubscribeOptions>& options, int32_t maxSharedMemoryFileCount) override; - ::ndk::ScopedAStatus unsubscribe( - const std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>& - callback, - const std::vector& propIds) override; - ::ndk::ScopedAStatus returnSharedMemory( - const std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>& - callback, - int64_t sharedMemoryId) override; + ::ndk::ScopedAStatus unsubscribe(const CallbackType& callback, + const std::vector& propIds) override; + ::ndk::ScopedAStatus returnSharedMemory(const CallbackType& callback, + int64_t sharedMemoryId) override; IVehicleHardware* getHardware(); private: + // friend class for unit testing. + friend class DefaultVehicleHalTest; + + using GetValuesClient = + GetSetValuesClient<::aidl::android::hardware::automotive::vehicle::GetValueResult, + ::aidl::android::hardware::automotive::vehicle::GetValueResults>; + const std::unique_ptr mVehicleHardware; std::unordered_map mConfigsByPropId; std::unique_ptr<::ndk::ScopedFileDescriptor> mConfigFile; + + std::mutex mLock; + std::unordered_map> mGetValuesClients + GUARDED_BY(mLock); + + template + std::shared_ptr getOrCreateClient( + std::unordered_map>* clients, + const CallbackType& callback) REQUIRES(mLock); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index fd9e331c0d..41753a6bde 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -21,6 +21,7 @@ #include #include #include + #include #include @@ -29,14 +30,19 @@ namespace hardware { namespace automotive { namespace vehicle { +using ::aidl::android::hardware::automotive::vehicle::GetValueRequest; using ::aidl::android::hardware::automotive::vehicle::GetValueRequests; +using ::aidl::android::hardware::automotive::vehicle::GetValueResult; +using ::aidl::android::hardware::automotive::vehicle::GetValueResults; using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback; using ::aidl::android::hardware::automotive::vehicle::SetValueRequests; 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::VehiclePropConfigs; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::automotive::car_binder_lib::LargeParcelableBase; +using ::android::base::expected; using ::android::base::Result; using ::ndk::ScopedAStatus; @@ -70,14 +76,58 @@ ScopedAStatus DefaultVehicleHal::getAllPropConfigs(VehiclePropConfigs* output) { return ScopedAStatus::ok(); } -ScopedAStatus DefaultVehicleHal::getValues(const std::shared_ptr&, - const GetValueRequests&) { - // TODO(b/200737967): implement this. +template +std::shared_ptr DefaultVehicleHal::getOrCreateClient( + std::unordered_map>* clients, + const CallbackType& callback) { + if (clients->find(callback) == clients->end()) { + // TODO(b/204943359): Remove client from clients when linkToDeath is implemented. + (*clients)[callback] = std::make_shared(callback); + } + return (*clients)[callback]; +} + +template std::shared_ptr +DefaultVehicleHal::getOrCreateClient( + std::unordered_map>* clients, + const CallbackType& callback); + +ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, + const GetValueRequests& requests) { + // TODO(b/203713317): check for duplicate properties and duplicate request IDs. + + const std::vector* getValueRequests; + // Define deserializedResults here because we need it to have the same lifetime as + // getValueRequests. + expected, ScopedAStatus> deserializedResults; + if (!requests.payloads.empty()) { + getValueRequests = &requests.payloads; + } else { + deserializedResults = stableLargeParcelableToVector(requests); + if (!deserializedResults.ok()) { + ALOGE("failed to parse getValues requests"); + return std::move(deserializedResults.error()); + } + getValueRequests = &deserializedResults.value(); + } + + std::shared_ptr client; + { + std::scoped_lock lockGuard(mLock); + client = getOrCreateClient(&mGetValuesClients, callback); + } + + if (StatusCode status = + mVehicleHardware->getValues(client->getResultCallback(), *getValueRequests); + status != StatusCode::OK) { + return ScopedAStatus::fromServiceSpecificErrorWithMessage( + toInt(status), "failed to get value from VehicleHardware"); + } + return ScopedAStatus::ok(); } -ScopedAStatus DefaultVehicleHal::setValues(const std::shared_ptr&, - const SetValueRequests&) { +ScopedAStatus DefaultVehicleHal::setValues(const CallbackType&, const SetValueRequests&) { // TODO(b/200737967): implement this. return ScopedAStatus::ok(); } @@ -90,23 +140,21 @@ ScopedAStatus DefaultVehicleHal::getPropConfigs(const std::vector& prop configs.push_back(mConfigsByPropId[prop]); } } - return defaultvehiclehal_impl::vectorToStableLargeParcelable(configs, output); + return vectorToStableLargeParcelable(std::move(configs), output); } -ScopedAStatus DefaultVehicleHal::subscribe(const std::shared_ptr&, +ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType&, const std::vector&, int32_t) { // TODO(b/200737967): implement this. return ScopedAStatus::ok(); } -ScopedAStatus DefaultVehicleHal::unsubscribe(const std::shared_ptr&, - const std::vector&) { +ScopedAStatus DefaultVehicleHal::unsubscribe(const CallbackType&, const std::vector&) { // TODO(b/200737967): implement this. return ScopedAStatus::ok(); } -ScopedAStatus DefaultVehicleHal::returnSharedMemory(const std::shared_ptr&, - int64_t) { +ScopedAStatus DefaultVehicleHal::returnSharedMemory(const CallbackType&, int64_t) { // TODO(b/200737967): implement this. return ScopedAStatus::ok(); } diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 2b5ca70285..26380b3a5c 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -15,17 +15,23 @@ */ #include "DefaultVehicleHal.h" +#include "MockVehicleCallback.h" #include #include #include -#include +#include +#include #include #include +#include +#include #include +#include #include +#include #include namespace android { @@ -36,21 +42,40 @@ namespace vehicle { namespace { using ::aidl::android::hardware::automotive::vehicle::GetValueRequest; +using ::aidl::android::hardware::automotive::vehicle::GetValueRequests; using ::aidl::android::hardware::automotive::vehicle::GetValueResult; +using ::aidl::android::hardware::automotive::vehicle::GetValueResults; using ::aidl::android::hardware::automotive::vehicle::IVehicle; +using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback; using ::aidl::android::hardware::automotive::vehicle::SetValueRequest; using ::aidl::android::hardware::automotive::vehicle::SetValueResult; +using ::aidl::android::hardware::automotive::vehicle::SetValueResults; using ::aidl::android::hardware::automotive::vehicle::StatusCode; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropValues; using ::android::automotive::car_binder_lib::LargeParcelableBase; using ::android::base::Result; +using ::ndk::ScopedAStatus; +using ::ndk::ScopedFileDescriptor; + using ::testing::Eq; using ::testing::WhenSortedBy; +template +std::optional pop(std::list& items) { + if (items.size() > 0) { + auto item = std::move(items.front()); + items.pop_front(); + return item; + } + return std::nullopt; +} + class MockVehicleHardware final : public IVehicleHardware { public: std::vector getAllPropertyConfigs() const override { @@ -58,16 +83,16 @@ class MockVehicleHardware final : public IVehicleHardware { return mPropertyConfigs; } - StatusCode setValues(std::shared_ptr, - const std::vector&) override { - // TODO(b/200737967): mock this. - return StatusCode::OK; + StatusCode setValues(std::shared_ptr callback, + const std::vector& requests) override { + std::scoped_lock lockGuard(mLock); + return handleRequests(__func__, callback, requests, mSetValueRequests, mSetValueResponses); } - StatusCode getValues(std::shared_ptr, - const std::vector&) const override { - // TODO(b/200737967): mock this. - return StatusCode::OK; + StatusCode getValues(std::shared_ptr callback, + const std::vector& requests) const override { + std::scoped_lock lockGuard(mLock); + return handleRequests(__func__, callback, requests, mGetValueRequests, mGetValueResponses); } DumpResult dump(const std::vector&) override { @@ -94,11 +119,110 @@ class MockVehicleHardware final : public IVehicleHardware { mPropertyConfigs = configs; } + void addGetValueResponses(const std::vector& responses) { + std::scoped_lock lockGuard(mLock); + mGetValueResponses.push_back(responses); + } + + std::vector nextGetValueRequests() { + std::scoped_lock lockGuard(mLock); + std::optional> request = pop(mGetValueRequests); + if (!request.has_value()) { + return std::vector(); + } + return std::move(request.value()); + } + + std::vector nextSetValueRequests() { + std::scoped_lock lockGuard(mLock); + std::optional> request = pop(mSetValueRequests); + if (!request.has_value()) { + return std::vector(); + } + return std::move(request.value()); + } + + void setStatus(const char* functionName, StatusCode status) { + std::scoped_lock lockGuard(mLock); + mStatusByFunctions[functionName] = status; + } + private: mutable std::mutex mLock; std::vector mPropertyConfigs GUARDED_BY(mLock); + mutable std::list> mGetValueRequests GUARDED_BY(mLock); + mutable std::list> mGetValueResponses GUARDED_BY(mLock); + mutable std::list> mSetValueRequests GUARDED_BY(mLock); + mutable std::list> mSetValueResponses GUARDED_BY(mLock); + std::unordered_map mStatusByFunctions GUARDED_BY(mLock); + + template + StatusCode returnResponse( + std::shared_ptr)>> callback, + std::list>& storedResponses) const; + + template + StatusCode handleRequests( + const char* functionName, + std::shared_ptr)>> callback, + const std::vector& requests, + std::list>& storedRequests, + std::list>& storedResponses) const REQUIRES(mLock); }; +template +StatusCode MockVehicleHardware::returnResponse( + std::shared_ptr)>> callback, + std::list>& storedResponses) const { + if (storedResponses.size() > 0) { + (*callback)(std::move(storedResponses.front())); + storedResponses.pop_front(); + return StatusCode::OK; + } else { + ALOGE("no more response"); + return StatusCode::INTERNAL_ERROR; + } +} + +template StatusCode MockVehicleHardware::returnResponse( + std::shared_ptr)>> callback, + std::list>& storedResponses) const; + +template StatusCode MockVehicleHardware::returnResponse( + std::shared_ptr)>> callback, + std::list>& storedResponses) const; + +template +StatusCode MockVehicleHardware::handleRequests( + const char* functionName, + std::shared_ptr)>> callback, + const std::vector& requests, + std::list>& storedRequests, + std::list>& storedResponses) const { + storedRequests.push_back(requests); + if (auto it = mStatusByFunctions.find(functionName); it != mStatusByFunctions.end()) { + if (StatusCode status = it->second; status != StatusCode::OK) { + return status; + } + } + + return returnResponse(callback, storedResponses); +} + +template StatusCode MockVehicleHardware::handleRequests( + const char* functionName, + std::shared_ptr)>> callback, + const std::vector& requests, + std::list>& storedRequests, + std::list>& storedResponses) const; + +template StatusCode MockVehicleHardware::handleRequests( + const char* functionName, + std::shared_ptr)>> callback, + const std::vector& requests, + std::list>& storedRequests, + std::list>& storedResponses) const; + struct PropConfigCmp { bool operator()(const VehiclePropConfig& a, const VehiclePropConfig& b) const { return (a.prop < b.prop); @@ -107,7 +231,77 @@ struct PropConfigCmp { } // namespace -TEST(DefaultVehicleHalTest, testGetAllPropConfigsSmall) { +class DefaultVehicleHalTest : public ::testing::Test { + public: + void SetUp() override { + auto hardware = std::make_unique(); + mHardwarePtr = hardware.get(); + mVhal = ndk::SharedRefBase::make(std::move(hardware)); + mVhalClient = IVehicle::fromBinder(mVhal->asBinder()); + mCallback = ndk::SharedRefBase::make(); + mCallbackClient = IVehicleCallback::fromBinder(mCallback->asBinder()); + } + + MockVehicleHardware* getHardware() { return mHardwarePtr; } + + std::shared_ptr getClient() { return mVhal; } + + std::shared_ptr getCallbackClient() { return mCallbackClient; } + + MockVehicleCallback* getCallback() { return mCallback.get(); } + + static Result getValuesTestCases(size_t size, GetValueRequests& requests, + std::vector& expectedResults, + std::vector& expectedHardwareRequests) { + expectedHardwareRequests.clear(); + for (size_t i = 0; i < size; i++) { + int64_t requestId = static_cast(i); + int32_t propId = static_cast(i); + expectedHardwareRequests.push_back(GetValueRequest{ + .prop = + VehiclePropValue{ + .prop = propId, + }, + .requestId = requestId, + }); + expectedResults.push_back(GetValueResult{ + .requestId = requestId, + .status = StatusCode::OK, + .prop = + VehiclePropValue{ + .prop = propId, + .value.int32Values = {1, 2, 3, 4}, + }, + }); + } + + auto result = LargeParcelableBase::parcelableVectorToStableLargeParcelable( + expectedHardwareRequests); + if (!result.ok()) { + return result.error(); + } + if (result.value() == nullptr) { + requests.payloads = expectedHardwareRequests; + } else { + requests.sharedMemoryFd = std::move(*result.value()); + } + return {}; + } + + size_t countClients() { + std::scoped_lock lockGuard(mVhal->mLock); + return mVhal->mGetValuesClients.size(); + } + + private: + std::shared_ptr mVhal; + std::shared_ptr mVhalClient; + MockVehicleHardware* mHardwarePtr; + std::shared_ptr mCallback; + std::shared_ptr mCallbackClient; +}; + +TEST_F(DefaultVehicleHalTest, testGetAllPropConfigsSmall) { auto testConfigs = std::vector({ VehiclePropConfig{ .prop = 1, @@ -125,14 +319,14 @@ TEST(DefaultVehicleHalTest, testGetAllPropConfigsSmall) { VehiclePropConfigs output; auto status = client->getAllPropConfigs(&output); - ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(status.isOk()) << "getAllPropConfigs failed: " << status.getMessage(); ASSERT_THAT(output.payloads, WhenSortedBy(propConfigCmp, Eq(testConfigs))); } -TEST(DefaultVehicleHalTest, testGetAllPropConfigsLarge) { +TEST_F(DefaultVehicleHalTest, testGetAllPropConfigsLarge) { std::vector testConfigs; - // 10000 VehiclePropConfig exceeds 4k memory limit, so it would be sent through shared memory. - for (size_t i = 0; i < 10000; i++) { + // 5000 VehiclePropConfig exceeds 4k memory limit, so it would be sent through shared memory. + for (size_t i = 0; i < 5000; i++) { testConfigs.push_back(VehiclePropConfig{ .prop = static_cast(i), }); @@ -146,16 +340,95 @@ TEST(DefaultVehicleHalTest, testGetAllPropConfigsLarge) { VehiclePropConfigs output; auto status = client->getAllPropConfigs(&output); - ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(status.isOk()) << "getAllPropConfigs failed: " << status.getMessage(); ASSERT_TRUE(output.payloads.empty()); Result>> result = LargeParcelableBase::stableLargeParcelableToParcelableVector( output.sharedMemoryFd); - ASSERT_TRUE(result.ok()); - ASSERT_TRUE(result.value().has_value()); + ASSERT_TRUE(result.ok()) << "failed to parse result shared memory file: " + << result.error().message(); + ASSERT_TRUE(result.value().has_value()) << "empty parsed value"; ASSERT_EQ(result.value().value(), testConfigs); } +TEST_F(DefaultVehicleHalTest, testGetValuesSmall) { + GetValueRequests requests; + std::vector expectedResults; + std::vector expectedHardwareRequests; + + ASSERT_TRUE(getValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok()); + + getHardware()->addGetValueResponses(expectedResults); + + auto status = getClient()->getValues(getCallbackClient(), requests); + + ASSERT_TRUE(status.isOk()) << "getValues failed: " << status.getMessage(); + + EXPECT_EQ(getHardware()->nextGetValueRequests(), expectedHardwareRequests) + << "requests to hardware mismatch"; + + auto maybeGetValueResults = getCallback()->nextGetValueResults(); + ASSERT_TRUE(maybeGetValueResults.has_value()) << "no results in callback"; + EXPECT_EQ(maybeGetValueResults.value().payloads, expectedResults) << "results mismatch"; + EXPECT_EQ(countClients(), static_cast(1)); +} + +TEST_F(DefaultVehicleHalTest, testGetValuesLarge) { + GetValueRequests requests; + std::vector expectedResults; + std::vector expectedHardwareRequests; + + ASSERT_TRUE(getValuesTestCases(5000, requests, expectedResults, expectedHardwareRequests).ok()) + << "requests to hardware mismatch"; + ; + + getHardware()->addGetValueResponses(expectedResults); + + auto status = getClient()->getValues(getCallbackClient(), requests); + + ASSERT_TRUE(status.isOk()) << "getValues failed: " << status.getMessage(); + + EXPECT_EQ(getHardware()->nextGetValueRequests(), expectedHardwareRequests); + + auto maybeGetValueResults = getCallback()->nextGetValueResults(); + ASSERT_TRUE(maybeGetValueResults.has_value()) << "no results in callback"; + const GetValueResults& getValueResults = maybeGetValueResults.value(); + ASSERT_TRUE(getValueResults.payloads.empty()) + << "payload should be empty, shared memory file should be used"; + + auto result = LargeParcelableBase::stableLargeParcelableToParcelableVector( + getValueResults.sharedMemoryFd); + ASSERT_TRUE(result.ok()) << "failed to parse shared memory file"; + ASSERT_TRUE(result.value().has_value()) << "no parsed value"; + ASSERT_EQ(result.value().value(), expectedResults) << "results mismatch"; + EXPECT_EQ(countClients(), static_cast(1)); +} + +TEST_F(DefaultVehicleHalTest, testGetValuesErrorFromHardware) { + GetValueRequests requests; + std::vector expectedResults; + std::vector expectedHardwareRequests; + + ASSERT_TRUE(getValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok()); + + getHardware()->setStatus("getValues", StatusCode::INTERNAL_ERROR); + + auto status = getClient()->getValues(getCallbackClient(), requests); + + ASSERT_FALSE(status.isOk()) << "expect getValues to fail when hardware returns error"; + ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::INTERNAL_ERROR)); +} + +TEST_F(DefaultVehicleHalTest, testGetValuesInvalidLargeParcelableInput) { + GetValueRequests requests; + requests.sharedMemoryFd = ScopedFileDescriptor(0); + + auto status = getClient()->getValues(getCallbackClient(), requests); + + ASSERT_FALSE(status.isOk()) << "expect getValues to fail when input parcelable is not valid"; + ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::INVALID_ARG)); +} + } // namespace vehicle } // namespace automotive } // namespace hardware -- GitLab From 377dc7558d060b49b2f5bbbf982991207cea3bd9 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 18 Oct 2021 18:48:42 -0700 Subject: [PATCH 372/825] Add checkPropValue in VehicleUtils. Test: atest VehicleHalVehicleUtilsTest Bug: 200737967 Change-Id: I0e6eed7d085af2a45448efa845e3e8f66c0a84ce --- .../impl/utils/common/include/VehicleUtils.h | 40 ++ .../impl/utils/common/src/VehicleUtils.cpp | 210 ++++++++ .../aidl/impl/utils/common/test/Android.bp | 1 + .../utils/common/test/VehicleUtilsTest.cpp | 458 ++++++++++++++++++ 4 files changed, 709 insertions(+) create mode 100644 automotive/vehicle/aidl/impl/utils/common/src/VehicleUtils.cpp diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h index 63eb747965..c3e8168628 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h @@ -240,6 +240,46 @@ template return toScopedAStatus(result, getErrorCode(result), additionalErrorMsg); } +// Check whether the value is valid according to config. +// We check for the following: +// * If the type is INT32, {@code value.int32Values} must contain one element. +// * If the type is INT32_VEC, {@code value.int32Values} must contain at least one element. +// * If the type is INT64, {@code value.int64Values} must contain one element. +// * If the type is INT64_VEC, {@code value.int64Values} must contain at least one element. +// * If the type is FLOAT, {@code value.floatValues} must contain one element. +// * If the type is FLOAT_VEC, {@code value.floatValues} must contain at least one element. +// * If the type is MIXED, see checkVendorMixedPropValue. +::android::base::Result checkPropValue( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, + const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig* config); + +// Check whether the Mixed type value is valid according to config. +// We check for the following: +// * configArray[1] + configArray[2] + configArray[3] must be equal to the number of +// {@code value.int32Values} elements. +// * configArray[4] + configArray[5] must be equal to the number of {@code value.int64Values} +// elements. +// * configArray[6] + configArray[7] must be equal to the number of {@code value.floatValues} +// elements. +// * configArray[8] must be equal to the number of {@code value.byteValues} elements. +::android::base::Result checkVendorMixedPropValue( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, + const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig* config); + +// Check whether the value is within the configured range. +// We check for the following types: +// * If type is INT32 or INT32_VEC, all {@code value.int32Values} elements must be within +// {@code minInt32Value} and {@code maxInt32Value} if either of them is not 0. +// * If type is INT64 or INT64_VEC, all {@code value.int64Values} elements must be within +// {@code minInt64Value} and {@code maxInt64Value} if either of them is not 0. +// * If type is FLOAT or FLOAT_VEC, all {@code value.floatValues} elements must be within +// {@code minFloatValues} and {@code maxFloatValues} if either of them is not 0. +// We don't check other types. If more checks are required, they should be added in VehicleHardware +// implementation. +::android::base::Result checkValueRange( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, + const ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* config); + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/utils/common/src/VehicleUtils.cpp b/automotive/vehicle/aidl/impl/utils/common/src/VehicleUtils.cpp new file mode 100644 index 0000000000..5abde8de44 --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/common/src/VehicleUtils.cpp @@ -0,0 +1,210 @@ +/* + * 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 "VehicleUtils.h" + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; +using ::android::base::Error; +using ::android::base::Result; +using ::ndk::ScopedAStatus; + +Result checkPropValue(const VehiclePropValue& value, const VehiclePropConfig* config) { + int32_t property = value.prop; + VehiclePropertyType type = getPropType(property); + switch (type) { + case VehiclePropertyType::BOOLEAN: + [[fallthrough]]; + case VehiclePropertyType::INT32: + if (value.value.int32Values.size() != 1) { + return Error() << "expect 1 int32Values for INT32 type"; + } + break; + case VehiclePropertyType::INT32_VEC: + if (value.value.int32Values.size() < 1) { + return Error() << "expect >=1 int32Values for INT32_VEC type"; + } + break; + case VehiclePropertyType::INT64: + if (value.value.int64Values.size() != 1) { + return Error() << "expect 1 int64Values for INT64 type"; + } + break; + case VehiclePropertyType::INT64_VEC: + if (value.value.int64Values.size() < 1) { + return Error() << "expect >=1 int64Values for INT64_VEC type"; + } + break; + case VehiclePropertyType::FLOAT: + if (value.value.floatValues.size() != 1) { + return Error() << "expect 1 floatValues for FLOAT type"; + } + break; + case VehiclePropertyType::FLOAT_VEC: + if (value.value.floatValues.size() < 1) { + return Error() << "expect >=1 floatValues for FLOAT_VEC type"; + } + break; + case VehiclePropertyType::BYTES: + // We allow setting an empty bytes array. + break; + case VehiclePropertyType::STRING: + // We allow setting an empty string. + break; + case VehiclePropertyType::MIXED: + if (getPropGroup(property) == VehiclePropertyGroup::VENDOR) { + // We only checks vendor mixed properties. + return checkVendorMixedPropValue(value, config); + } + break; + default: + return Error() << "unknown property type: " << toInt(type); + } + return {}; +} + +Result checkVendorMixedPropValue(const VehiclePropValue& value, + const VehiclePropConfig* config) { + auto configArray = config->configArray; + // configArray[0], 1 indicates the property has a String value, we allow the string value to + // be empty. + + size_t int32Count = 0; + // configArray[1], 1 indicates the property has a Boolean value. + if (configArray[1] == 1) { + int32Count++; + } + // configArray[2], 1 indicates the property has an Integer value. + if (configArray[2] == 1) { + int32Count++; + } + // configArray[3], the number indicates the size of Integer[] in the property. + int32Count += static_cast(configArray[3]); + size_t int32Size = value.value.int32Values.size(); + if (int32Size != int32Count) { + return Error() << "invalid mixed property, got " << int32Size << " int32Values, expect " + << int32Count; + } + + size_t int64Count = 0; + // configArray[4], 1 indicates the property has a Long value. + if (configArray[4] == 1) { + int64Count++; + } + // configArray[5], the number indicates the size of Long[] in the property. + int64Count += static_cast(configArray[5]); + size_t int64Size = value.value.int64Values.size(); + if (int64Size != int64Count) { + return Error() << "invalid mixed property, got " << int64Size << " int64Values, expect " + << int64Count; + } + + size_t floatCount = 0; + // configArray[6], 1 indicates the property has a Float value. + if (configArray[6] == 1) { + floatCount++; + } + // configArray[7], the number indicates the size of Float[] in the property. + floatCount += static_cast(configArray[7]); + size_t floatSize = value.value.floatValues.size(); + if (floatSize != floatCount) { + return Error() << "invalid mixed property, got " << floatSize << " floatValues, expect " + << floatCount; + } + + // configArray[8], the number indicates the size of byte[] in the property. + size_t byteSize = value.value.byteValues.size(); + size_t byteCount = static_cast(configArray[8]); + if (byteCount != 0 && byteSize != byteCount) { + return Error() << "invalid mixed property, got " << byteSize << " byteValues, expect " + << byteCount; + } + return {}; +} + +Result checkValueRange(const VehiclePropValue& value, const VehicleAreaConfig* areaConfig) { + if (areaConfig == nullptr) { + return {}; + } + int32_t property = value.prop; + VehiclePropertyType type = getPropType(property); + switch (type) { + case VehiclePropertyType::INT32: + [[fallthrough]]; + case VehiclePropertyType::INT32_VEC: + if (areaConfig->minInt32Value == 0 && areaConfig->maxInt32Value == 0) { + break; + } + for (int32_t int32Value : value.value.int32Values) { + if (int32Value < areaConfig->minInt32Value || + int32Value > areaConfig->maxInt32Value) { + return Error() << "int32Value: " << int32Value + << " out of range, min: " << areaConfig->minInt32Value + << " max: " << areaConfig->maxInt32Value; + } + } + break; + case VehiclePropertyType::INT64: + [[fallthrough]]; + case VehiclePropertyType::INT64_VEC: + if (areaConfig->minInt64Value == 0 && areaConfig->maxInt64Value == 0) { + break; + } + for (int64_t int64Value : value.value.int64Values) { + if (int64Value < areaConfig->minInt64Value || + int64Value > areaConfig->maxInt64Value) { + return Error() << "int64Value: " << int64Value + << " out of range, min: " << areaConfig->minInt64Value + << " max: " << areaConfig->maxInt64Value; + } + } + break; + case VehiclePropertyType::FLOAT: + [[fallthrough]]; + case VehiclePropertyType::FLOAT_VEC: + if (areaConfig->minFloatValue == 0.f && areaConfig->maxFloatValue == 0.f) { + break; + } + for (float floatValue : value.value.floatValues) { + if (floatValue < areaConfig->minFloatValue || + floatValue > areaConfig->maxFloatValue) { + return Error() << "floatValue: " << floatValue + << " out of range, min: " << areaConfig->minFloatValue + << " max: " << areaConfig->maxFloatValue; + } + } + break; + default: + // We don't check the rest of property types. Additional logic needs to be added if + // required in VehicleHardware, e.g. you might want to check the range for mixed + // property. + break; + } + return {}; +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp index dd43712558..250b33135b 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp +++ b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp @@ -27,6 +27,7 @@ cc_test { "libgtest", "libgmock", ], + header_libs: ["VehicleHalTestUtilHeaders"], defaults: ["VehicleHalDefaults"], test_suites: ["device-tests"], } diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp index 131eb3b95b..de8b26d37f 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -29,6 +30,8 @@ namespace hardware { namespace automotive { namespace vehicle { +namespace { + using ::aidl::android::hardware::automotive::vehicle::VehicleArea; using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; @@ -37,6 +40,427 @@ using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; +struct InvalidPropValueTestCase { + std::string name; + VehiclePropValue value; + bool valid = false; + VehiclePropConfig config; +}; + +constexpr int32_t int32Prop = toInt(VehicleProperty::INFO_MODEL_YEAR); +constexpr int32_t int32VecProp = toInt(VehicleProperty::INFO_FUEL_TYPE); +constexpr int32_t int64Prop = toInt(VehicleProperty::ANDROID_EPOCH_TIME); +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); + +std::vector getInvalidPropValuesTestCases() { + return std::vector( + { + InvalidPropValueTestCase{ + .name = "int32_normal", + .value = + { + .prop = int32Prop, + .value.int32Values = {0}, + }, + .valid = true, + }, + InvalidPropValueTestCase{ + .name = "int32_no_value", + .value = + { + .prop = int32Prop, + }, + }, + InvalidPropValueTestCase{ + .name = "int32_more_than_one_value", + .value = + { + .prop = int32Prop, + .value.int32Values = {0, 1}, + }, + }, + InvalidPropValueTestCase{ + .name = "int32_vec_normal", + .value = + { + .prop = int32VecProp, + .value.int32Values = {0, 1}, + }, + .valid = true, + }, + InvalidPropValueTestCase{ + .name = "int32_vec_no_value", + .value = + { + .prop = int32VecProp, + }, + }, + InvalidPropValueTestCase{ + .name = "int64_normal", + .value = + { + .prop = int64Prop, + .value.int64Values = {0}, + }, + .valid = true, + }, + InvalidPropValueTestCase{ + .name = "int64_no_value", + .value = + { + .prop = int64Prop, + }, + }, + InvalidPropValueTestCase{ + .name = "int64_more_than_one_value", + .value = + { + .prop = int64Prop, + .value.int64Values = {0, 1}, + }, + }, + InvalidPropValueTestCase{ + .name = "int64_vec_normal", + .value = + { + .prop = int64VecProp, + .value.int64Values = {0, 1}, + }, + .valid = true, + }, + InvalidPropValueTestCase{ + .name = "int64_vec_no_value", + .value = + { + .prop = int64VecProp, + }, + }, + InvalidPropValueTestCase{ + .name = "float_normal", + .value = + { + .prop = floatProp, + .value.floatValues = {0.0}, + }, + .valid = true, + }, + InvalidPropValueTestCase{ + .name = "float_no_value", + .value = + { + .prop = floatProp, + }, + }, + InvalidPropValueTestCase{ + .name = "float_more_than_one_value", + .value = + { + .prop = floatProp, + .value.floatValues = {0.0, 1.0}, + }, + }, + InvalidPropValueTestCase{ + .name = "float_vec_normal", + .value = + { + .prop = floatVecProp, + .value.floatValues = {0.0, 1.0}, + }, + .valid = true, + }, + InvalidPropValueTestCase{ + .name = "float_vec_no_value", + .value = + { + .prop = floatVecProp, + }, + }, + InvalidPropValueTestCase{ + .name = "mixed_normal", + .value = + { + .prop = kMixedTypePropertyForTest, + // Expect 3 values. + .value.int32Values = {0, 1, 2}, + // Expect 2 values. + .value.int64Values = {0, 1}, + // Expect 2 values. + .value.floatValues = {0.0, 1.0}, + // Expect 1 value. + .value.byteValues = {static_cast(0)}, + }, + .config = + { + .prop = kMixedTypePropertyForTest, + .configArray = {0, 1, 1, 1, 1, 1, 1, 1, 1}, + }, + .valid = true, + }, + InvalidPropValueTestCase{ + .name = "mixed_mismatch_int32_values_count", + .value = + { + .prop = kMixedTypePropertyForTest, + // Expect 3 values. + .value.int32Values = {0, 1}, + // Expect 2 values. + .value.int64Values = {0, 1}, + // Expect 2 values. + .value.floatValues = {0.0, 1.0}, + // Expect 1 value. + .value.byteValues = {static_cast(0)}, + }, + .config = + { + .prop = kMixedTypePropertyForTest, + .configArray = {0, 1, 1, 1, 1, 1, 1, 1, 1}, + }, + }, + InvalidPropValueTestCase{ + .name = "mixed_mismatch_int64_values_count", + .value = + { + .prop = kMixedTypePropertyForTest, + // Expect 3 values. + .value.int32Values = {0, 1, 2}, + // Expect 2 values. + .value.int64Values = {0}, + // Expect 2 values. + .value.floatValues = {0.0, 1.0}, + // Expect 1 value. + .value.byteValues = {static_cast(0)}, + }, + .config = + { + .prop = kMixedTypePropertyForTest, + .configArray = {0, 1, 1, 1, 1, 1, 1, 1, 1}, + }, + }, + InvalidPropValueTestCase{ + .name = "mixed_mismatch_float_values_count", + .value = + { + .prop = kMixedTypePropertyForTest, + // Expect 3 values. + .value.int32Values = {0, 1, 2}, + // Expect 2 values. + .value.int64Values = {0, 1}, + // Expect 2 values. + .value.floatValues = {0.0}, + // Expect 1 value. + .value.byteValues = {static_cast(0)}, + }, + .config = + { + .prop = kMixedTypePropertyForTest, + .configArray = {0, 1, 1, 1, 1, 1, 1, 1, 1}, + }, + }, + InvalidPropValueTestCase{ + .name = "mixed_mismatch_byte_values_count", + .value = + { + .prop = kMixedTypePropertyForTest, + // Expect 3 values. + .value.int32Values = {0, 1, 2}, + // Expect 2 values. + .value.int64Values = {0, 1}, + // Expect 2 values. + .value.floatValues = {0.0, 1.0}, + // Expect 1 value. + .value.byteValues = {static_cast(0), + static_cast(1)}, + }, + .config = + { + .prop = kMixedTypePropertyForTest, + .configArray = {0, 1, 1, 1, 1, 1, 1, 1, 1}, + }, + }, + }); +} + +struct InvalidValueRangeTestCase { + std::string name; + VehiclePropValue value; + bool valid = false; + VehicleAreaConfig config; +}; + +std::vector getInvalidValueRangeTestCases() { + return std::vector({{ + InvalidValueRangeTestCase{ + .name = "int32_normal", + .value = + { + .prop = int32Prop, + .value.int32Values = {0}, + }, + .valid = true, + .config = + { + .minInt32Value = 0, + .maxInt32Value = 10, + }, + }, + InvalidValueRangeTestCase{ + .name = "int32_vec_normal", + .value = + { + .prop = int32VecProp, + .value.int32Values = {0, 1}, + }, + .valid = true, + .config = + { + .minInt32Value = 0, + .maxInt32Value = 10, + }, + }, + InvalidValueRangeTestCase{ + .name = "int32_vec_underflow", + .value = + { + .prop = int32VecProp, + .value.int32Values = {-1, 1}, + }, + + .config = + { + .minInt32Value = 0, + .maxInt32Value = 10, + }, + }, + InvalidValueRangeTestCase{ + .name = "int32_vec_overflow", + .value = + { + .prop = int32VecProp, + .value.int32Values = {0, 100}, + }, + .config = + { + .minInt32Value = 0, + .maxInt32Value = 10, + }, + }, + InvalidValueRangeTestCase{ + .name = "int64_normal", + .value = + { + .prop = int64Prop, + .value.int64Values = {0}, + }, + .valid = true, + .config = + { + .minInt64Value = 0, + .maxInt64Value = 10, + }, + }, + InvalidValueRangeTestCase{ + .name = "int64_vec_normal", + .value = + { + .prop = int64VecProp, + .value.int64Values = {0, 1}, + }, + .valid = true, + .config = + { + .minInt64Value = 0, + .maxInt64Value = 10, + }, + }, + InvalidValueRangeTestCase{ + .name = "int64_vec_underflow", + .value = + { + .prop = int64VecProp, + .value.int64Values = {-1, 1}, + }, + + .config = + { + .minInt64Value = 0, + .maxInt64Value = 10, + }, + }, + InvalidValueRangeTestCase{ + .name = "int64_vec_overflow", + .value = + { + .prop = int64VecProp, + .value.int64Values = {0, 100}, + }, + .config = + { + .minInt64Value = 0, + .maxInt64Value = 10, + }, + }, + InvalidValueRangeTestCase{ + .name = "float_normal", + .value = + { + .prop = floatProp, + .value.floatValues = {0.0}, + }, + .valid = true, + .config = + { + .minFloatValue = 0.0, + .maxFloatValue = 10.0, + }, + }, + InvalidValueRangeTestCase{ + .name = "float_vec_normal", + .value = + { + .prop = floatVecProp, + .value.floatValues = {0.0, 10.0}, + }, + .valid = true, + .config = + { + .minFloatValue = 0.0, + .maxFloatValue = 10.0, + }, + }, + InvalidValueRangeTestCase{ + .name = "float_vec_underflow", + .value = + { + .prop = floatVecProp, + .value.floatValues = {-0.1, 1.1}, + }, + + .config = + { + .minFloatValue = 0.0, + .maxFloatValue = 10.0, + }, + }, + InvalidValueRangeTestCase{ + .name = "float_vec_overflow", + .value = + { + .prop = floatVecProp, + .value.floatValues = {0.0, 10.1}, + }, + .config = + { + .minFloatValue = 0.0, + .maxFloatValue = 10.0, + }, + }, + }}); +} + +} // namespace + TEST(VehicleUtilsTest, testToInt) { int areaGlobal = toInt(VehicleArea::GLOBAL); @@ -335,6 +759,40 @@ TEST(VehicleUtilsTest, testConcurrentQueueDeactivateNotifyWaitingThread) { t.join(); } +class InvalidPropValueTest : public testing::TestWithParam {}; + +INSTANTIATE_TEST_SUITE_P(InvalidPropValueTests, InvalidPropValueTest, + testing::ValuesIn(getInvalidPropValuesTestCases()), + [](const testing::TestParamInfo& info) { + return info.param.name; + }); + +TEST_P(InvalidPropValueTest, testCheckPropValue) { + InvalidPropValueTestCase tc = GetParam(); + + // Config is not used for non-mixed types. + auto result = checkPropValue(tc.value, &tc.config); + + ASSERT_EQ(tc.valid, result.ok()); +} + +class InvalidValueRangeTest : public testing::TestWithParam {}; + +INSTANTIATE_TEST_SUITE_P(InvalidValueRangeTests, InvalidValueRangeTest, + testing::ValuesIn(getInvalidValueRangeTestCases()), + [](const testing::TestParamInfo& info) { + return info.param.name; + }); + +TEST_P(InvalidValueRangeTest, testCheckValueRange) { + InvalidValueRangeTestCase tc = GetParam(); + + // Config is not used for non-mixed types. + auto result = checkValueRange(tc.value, &tc.config); + + ASSERT_EQ(tc.valid, result.ok()); +} + } // namespace vehicle } // namespace automotive } // namespace hardware -- GitLab From ca779c76b9fd4803363fc4fee8586a24eed140db Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 3 Nov 2021 16:36:13 -0700 Subject: [PATCH 373/825] Support latency in MockVehicleHardware. Allow MockVehicleHardware to sleep for some time before returning results to VHAL, so that we could test timeout behavior. Test: atest DefaultVehicleHalTest Bug: 200737967 Change-Id: I1198b80f1c08f664bc2fcdb6b590f6d84bc75384 --- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 71 ++++++++++++++----- 1 file changed, 52 insertions(+), 19 deletions(-) diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 26380b3a5c..6c99ceb69b 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -48,6 +49,7 @@ using ::aidl::android::hardware::automotive::vehicle::GetValueResults; using ::aidl::android::hardware::automotive::vehicle::IVehicle; using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback; using ::aidl::android::hardware::automotive::vehicle::SetValueRequest; +using ::aidl::android::hardware::automotive::vehicle::SetValueRequests; using ::aidl::android::hardware::automotive::vehicle::SetValueResult; using ::aidl::android::hardware::automotive::vehicle::SetValueResults; using ::aidl::android::hardware::automotive::vehicle::StatusCode; @@ -83,16 +85,25 @@ class MockVehicleHardware final : public IVehicleHardware { return mPropertyConfigs; } + ~MockVehicleHardware() { + std::scoped_lock lockGuard(mLock); + for (auto& thread : mThreads) { + thread.join(); + } + } + StatusCode setValues(std::shared_ptr callback, const std::vector& requests) override { std::scoped_lock lockGuard(mLock); - return handleRequests(__func__, callback, requests, mSetValueRequests, mSetValueResponses); + return handleRequests(__func__, callback, requests, &mSetValueRequests, + &mSetValueResponses); } StatusCode getValues(std::shared_ptr callback, const std::vector& requests) const override { std::scoped_lock lockGuard(mLock); - return handleRequests(__func__, callback, requests, mGetValueRequests, mGetValueResponses); + return handleRequests(__func__, callback, requests, &mGetValueRequests, + &mGetValueResponses); } DumpResult dump(const std::vector&) override { @@ -124,6 +135,11 @@ class MockVehicleHardware final : public IVehicleHardware { mGetValueResponses.push_back(responses); } + void addSetValueResponses(const std::vector& responses) { + std::scoped_lock lockGuard(mLock); + mSetValueResponses.push_back(responses); + } + std::vector nextGetValueRequests() { std::scoped_lock lockGuard(mLock); std::optional> request = pop(mGetValueRequests); @@ -147,6 +163,11 @@ class MockVehicleHardware final : public IVehicleHardware { mStatusByFunctions[functionName] = status; } + void setSleepTime(int64_t timeInNano) { + std::scoped_lock lockGuard(mLock); + mSleepTime = timeInNano; + } + private: mutable std::mutex mLock; std::vector mPropertyConfigs GUARDED_BY(mLock); @@ -155,28 +176,30 @@ class MockVehicleHardware final : public IVehicleHardware { mutable std::list> mSetValueRequests GUARDED_BY(mLock); mutable std::list> mSetValueResponses GUARDED_BY(mLock); std::unordered_map mStatusByFunctions GUARDED_BY(mLock); + int64_t mSleepTime GUARDED_BY(mLock) = 0; + mutable std::vector mThreads GUARDED_BY(mLock); template StatusCode returnResponse( std::shared_ptr)>> callback, - std::list>& storedResponses) const; + std::list>* storedResponses) const; template StatusCode handleRequests( const char* functionName, std::shared_ptr)>> callback, const std::vector& requests, - std::list>& storedRequests, - std::list>& storedResponses) const REQUIRES(mLock); + std::list>* storedRequests, + std::list>* storedResponses) const REQUIRES(mLock); }; template StatusCode MockVehicleHardware::returnResponse( std::shared_ptr)>> callback, - std::list>& storedResponses) const { - if (storedResponses.size() > 0) { - (*callback)(std::move(storedResponses.front())); - storedResponses.pop_front(); + std::list>* storedResponses) const { + if (storedResponses->size() > 0) { + (*callback)(std::move(storedResponses->front())); + storedResponses->pop_front(); return StatusCode::OK; } else { ALOGE("no more response"); @@ -186,42 +209,52 @@ StatusCode MockVehicleHardware::returnResponse( template StatusCode MockVehicleHardware::returnResponse( std::shared_ptr)>> callback, - std::list>& storedResponses) const; + std::list>* storedResponses) const; template StatusCode MockVehicleHardware::returnResponse( std::shared_ptr)>> callback, - std::list>& storedResponses) const; + std::list>* storedResponses) const; template StatusCode MockVehicleHardware::handleRequests( const char* functionName, std::shared_ptr)>> callback, const std::vector& requests, - std::list>& storedRequests, - std::list>& storedResponses) const { - storedRequests.push_back(requests); + std::list>* storedRequests, + std::list>* storedResponses) const { + storedRequests->push_back(requests); if (auto it = mStatusByFunctions.find(functionName); it != mStatusByFunctions.end()) { if (StatusCode status = it->second; status != StatusCode::OK) { return status; } } - return returnResponse(callback, storedResponses); + if (mSleepTime != 0) { + int64_t sleepTime = mSleepTime; + mThreads.emplace_back([this, callback, sleepTime, storedResponses]() { + std::this_thread::sleep_for(std::chrono::nanoseconds(sleepTime)); + returnResponse(callback, storedResponses); + }); + return StatusCode::OK; + + } else { + return returnResponse(callback, storedResponses); + } } template StatusCode MockVehicleHardware::handleRequests( const char* functionName, std::shared_ptr)>> callback, const std::vector& requests, - std::list>& storedRequests, - std::list>& storedResponses) const; + std::list>* storedRequests, + std::list>* storedResponses) const; template StatusCode MockVehicleHardware::handleRequests( const char* functionName, std::shared_ptr)>> callback, const std::vector& requests, - std::list>& storedRequests, - std::list>& storedResponses) const; + std::list>* storedRequests, + std::list>* storedResponses) const; struct PropConfigCmp { bool operator()(const VehiclePropConfig& a, const VehiclePropConfig& b) const { -- GitLab From 65b7f4453b0f4c5a500b180dea5e92b3173c7b0c Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 18 Oct 2021 18:48:53 -0700 Subject: [PATCH 374/825] Implement setValues in DefaultVHAL. Test: atest DefaultVehicleHalTest Bug: 200737967 Change-Id: I702d139d2f1c0eb647559dde88deb0486c986c66 --- .../impl/utils/common/include/VehicleUtils.h | 4 +- .../impl/vhal/include/DefaultVehicleHal.h | 42 +--- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 91 ++++++- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 236 +++++++++++++++++- 4 files changed, 331 insertions(+), 42 deletions(-) diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h index c3e8168628..49b33d594a 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h @@ -213,7 +213,7 @@ template ::ndk::ScopedAStatus toScopedAStatus( const ::android::base::Result& result, ::aidl::android::hardware::automotive::vehicle::StatusCode status, - std::string additionalErrorMsg) { + const std::string& additionalErrorMsg) { if (result.ok()) { return ::ndk::ScopedAStatus::ok(); } @@ -236,7 +236,7 @@ template template ::ndk::ScopedAStatus toScopedAStatus(const ::android::base::Result& result, - std::string additionalErrorMsg) { + const std::string& additionalErrorMsg) { return toScopedAStatus(result, getErrorCode(result), additionalErrorMsg); } diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index da83e94706..4ee3ee93d8 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -21,7 +21,6 @@ #include "ParcelableUtils.h" #include -#include #include #include #include @@ -42,36 +41,6 @@ namespace defaultvehiclehal_impl { constexpr int INVALID_MEMORY_FD = -1; -template -::ndk::ScopedAStatus toScopedAStatus( - const ::android::base::Result& result, - ::aidl::android::hardware::automotive::vehicle::StatusCode status, - const std::string& additionalErrorMsg) { - if (result.ok()) { - return ::ndk::ScopedAStatus::ok(); - } - return ::ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( - toInt(status), (additionalErrorMsg + getErrorMsg(result)).c_str()); -} - -template -::ndk::ScopedAStatus toScopedAStatus( - const ::android::base::Result& result, - ::aidl::android::hardware::automotive::vehicle::StatusCode status) { - return toScopedAStatus(result, status, ""); -} - -template -::ndk::ScopedAStatus toScopedAStatus(const ::android::base::Result& result) { - return toScopedAStatus(result, getErrorCode(result)); -} - -template -::ndk::ScopedAStatus toScopedAStatus(const ::android::base::Result& result, - const std::string& additionalErrorMsg) { - return toScopedAStatus(result, getErrorCode(result), additionalErrorMsg); -} - } // namespace defaultvehiclehal_impl class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::vehicle::BnVehicle { @@ -115,8 +84,14 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve using GetValuesClient = GetSetValuesClient<::aidl::android::hardware::automotive::vehicle::GetValueResult, ::aidl::android::hardware::automotive::vehicle::GetValueResults>; + using SetValuesClient = + GetSetValuesClient<::aidl::android::hardware::automotive::vehicle::SetValueResult, + ::aidl::android::hardware::automotive::vehicle::SetValueResults>; const std::unique_ptr mVehicleHardware; + + // mConfigsByPropId and mConfigFile are only modified during initialization, so no need to + // lock guard them. std::unordered_map mConfigsByPropId; std::unique_ptr<::ndk::ScopedFileDescriptor> mConfigFile; @@ -124,11 +99,16 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve std::mutex mLock; std::unordered_map> mGetValuesClients GUARDED_BY(mLock); + std::unordered_map> mSetValuesClients + GUARDED_BY(mLock); template std::shared_ptr getOrCreateClient( std::unordered_map>* clients, const CallbackType& callback) REQUIRES(mLock); + + ::android::base::Result checkProperty( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index 41753a6bde..e98f02112e 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -35,13 +35,18 @@ using ::aidl::android::hardware::automotive::vehicle::GetValueRequests; using ::aidl::android::hardware::automotive::vehicle::GetValueResult; using ::aidl::android::hardware::automotive::vehicle::GetValueResults; using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback; +using ::aidl::android::hardware::automotive::vehicle::SetValueRequest; using ::aidl::android::hardware::automotive::vehicle::SetValueRequests; +using ::aidl::android::hardware::automotive::vehicle::SetValueResult; +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::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::automotive::car_binder_lib::LargeParcelableBase; +using ::android::base::Error; using ::android::base::expected; using ::android::base::Result; using ::ndk::ScopedAStatus; @@ -92,6 +97,36 @@ DefaultVehicleHal::getOrCreateClient( std::unordered_map>* clients, const CallbackType& callback); +template std::shared_ptr +DefaultVehicleHal::getOrCreateClient( + std::unordered_map>* clients, + const CallbackType& callback); + +Result DefaultVehicleHal::checkProperty(const VehiclePropValue& propValue) { + int32_t propId = propValue.prop; + auto it = mConfigsByPropId.find(propId); + if (it == mConfigsByPropId.end()) { + return Error() << "no config for property, ID: " << propId; + } + const VehiclePropConfig& config = it->second; + const VehicleAreaConfig* areaConfig = getAreaConfig(propValue, config); + if (!isGlobalProp(propId) && areaConfig == nullptr) { + // Ignore areaId for global property. For non global property, check whether areaId is + // allowed. areaId must appear in areaConfig. + return Error() << "invalid area ID: " << propValue.areaId << " for prop ID: " << propId + << ", not listed in config"; + } + if (auto result = checkPropValue(propValue, &config); !result.ok()) { + return Error() << "invalid property value: " << propValue.toString() + << ", error: " << result.error().message(); + } + if (auto result = checkValueRange(propValue, areaConfig); !result.ok()) { + return Error() << "property value out of range: " << propValue.toString() + << ", error: " << result.error().message(); + } + return {}; +} + ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, const GetValueRequests& requests) { // TODO(b/203713317): check for duplicate properties and duplicate request IDs. @@ -127,8 +162,60 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, return ScopedAStatus::ok(); } -ScopedAStatus DefaultVehicleHal::setValues(const CallbackType&, const SetValueRequests&) { - // TODO(b/200737967): implement this. +ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, + const SetValueRequests& requests) { + // TODO(b/203713317): check for duplicate properties and duplicate request IDs. + + const std::vector* setValueRequests; + // Define deserializedResults here because we need it to have the same lifetime as + // setValueRequests. + expected, ScopedAStatus> deserializedResults; + if (!requests.payloads.empty()) { + setValueRequests = &requests.payloads; + } else { + deserializedResults = stableLargeParcelableToVector(requests); + if (!deserializedResults.ok()) { + ALOGE("failed to parse setValues requests"); + return std::move(deserializedResults.error()); + } + setValueRequests = &deserializedResults.value(); + } + + // A list of failed result we already know before sending to hardware. + std::vector failedResults; + // The list of requests that we would send to hardware. + std::vector hardwareRequests; + + for (auto& request : *setValueRequests) { + int64_t requestId = request.requestId; + if (auto result = checkProperty(request.value); !result.ok()) { + ALOGW("property not valid: %s", result.error().message().c_str()); + failedResults.push_back(SetValueResult{ + .requestId = requestId, + .status = StatusCode::INVALID_ARG, + }); + continue; + } + hardwareRequests.push_back(request); + } + + std::shared_ptr client; + { + std::scoped_lock lockGuard(mLock); + client = getOrCreateClient(&mSetValuesClients, callback); + } + + if (!failedResults.empty()) { + client->sendResults(failedResults); + } + + if (StatusCode status = + mVehicleHardware->setValues(client->getResultCallback(), hardwareRequests); + status != StatusCode::OK) { + return ScopedAStatus::fromServiceSpecificErrorWithMessage( + toInt(status), "failed to set value to VehicleHardware"); + } + return ScopedAStatus::ok(); } diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 6c99ceb69b..8934a7b012 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -53,6 +53,7 @@ using ::aidl::android::hardware::automotive::vehicle::SetValueRequests; using ::aidl::android::hardware::automotive::vehicle::SetValueResult; using ::aidl::android::hardware::automotive::vehicle::SetValueResults; using ::aidl::android::hardware::automotive::vehicle::StatusCode; +using ::aidl::android::hardware::automotive::vehicle::VehicleAreaWindow; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs; using ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors; @@ -68,6 +69,10 @@ using ::ndk::ScopedFileDescriptor; using ::testing::Eq; using ::testing::WhenSortedBy; +constexpr int32_t INVALID_PROP_ID = 0; +// VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32 +constexpr int32_t INT32_WINDOW_PROP = 10001 + 0x10000000 + 0x03000000 + 0x00400000; + template std::optional pop(std::list& items) { if (items.size() > 0) { @@ -78,13 +83,13 @@ std::optional pop(std::list& items) { return std::nullopt; } +int32_t testInt32VecProp(size_t i) { + // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + return static_cast(i) + 0x10000000 + 0x01000000 + 0x00410000; +} + class MockVehicleHardware final : public IVehicleHardware { public: - std::vector getAllPropertyConfigs() const override { - std::scoped_lock lockGuard(mLock); - return mPropertyConfigs; - } - ~MockVehicleHardware() { std::scoped_lock lockGuard(mLock); for (auto& thread : mThreads) { @@ -92,6 +97,11 @@ class MockVehicleHardware final : public IVehicleHardware { } } + std::vector getAllPropertyConfigs() const override { + std::scoped_lock lockGuard(mLock); + return mPropertyConfigs; + } + StatusCode setValues(std::shared_ptr callback, const std::vector& requests) override { std::scoped_lock lockGuard(mLock); @@ -262,12 +272,83 @@ struct PropConfigCmp { } } propConfigCmp; +struct SetValuesInvalidRequestTestCase { + std::string name; + VehiclePropValue request; + StatusCode expectedStatus; +}; + +std::vector getSetValuesInvalidRequestTestCases() { + return {{ + .name = "config_not_found", + .request = + { + // No config for INVALID_PROP_ID. + .prop = INVALID_PROP_ID, + }, + .expectedStatus = StatusCode::INVALID_ARG, + }, + { + .name = "invalid_prop_value", + .request = + { + .prop = testInt32VecProp(0), + // No int32Values for INT32_VEC property. + .value.int32Values = {}, + }, + .expectedStatus = StatusCode::INVALID_ARG, + }, + { + .name = "value_out_of_range", + .request = + { + .prop = testInt32VecProp(0), + // We configured the range to be 0-100. + .value.int32Values = {0, -1}, + }, + .expectedStatus = StatusCode::INVALID_ARG, + }, + { + .name = "invalid_area", + .request = + { + .prop = INT32_WINDOW_PROP, + .value.int32Values = {0}, + // Only ROW_1_LEFT is allowed. + .areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT), + }, + .expectedStatus = StatusCode::INVALID_ARG, + }}; +} + } // namespace class DefaultVehicleHalTest : public ::testing::Test { public: void SetUp() override { auto hardware = std::make_unique(); + std::vector testConfigs; + for (size_t i = 0; i < 10000; i++) { + testConfigs.push_back(VehiclePropConfig{ + .prop = testInt32VecProp(i), + .areaConfigs = + { + { + .areaId = 0, + .minInt32Value = 0, + .maxInt32Value = 100, + }, + }, + }); + } + testConfigs.push_back( + VehiclePropConfig{.prop = INT32_WINDOW_PROP, + .areaConfigs = {{ + .areaId = toInt(VehicleAreaWindow::ROW_1_LEFT), + .minInt32Value = 0, + .maxInt32Value = 100, + }}}); + hardware->setPropertyConfigs(testConfigs); mHardwarePtr = hardware.get(); mVhal = ndk::SharedRefBase::make(std::move(hardware)); mVhalClient = IVehicle::fromBinder(mVhal->asBinder()); @@ -289,7 +370,7 @@ class DefaultVehicleHalTest : public ::testing::Test { expectedHardwareRequests.clear(); for (size_t i = 0; i < size; i++) { int64_t requestId = static_cast(i); - int32_t propId = static_cast(i); + int32_t propId = testInt32VecProp(i); expectedHardwareRequests.push_back(GetValueRequest{ .prop = VehiclePropValue{ @@ -321,9 +402,43 @@ class DefaultVehicleHalTest : public ::testing::Test { return {}; } + static Result setValuesTestCases(size_t size, SetValueRequests& requests, + std::vector& expectedResults, + std::vector& expectedHardwareRequests) { + expectedHardwareRequests.clear(); + for (size_t i = 0; i < size; i++) { + int64_t requestId = static_cast(i); + int32_t propId = testInt32VecProp(i); + expectedHardwareRequests.push_back(SetValueRequest{ + .value = + VehiclePropValue{ + .prop = propId, + .value.int32Values = {1, 2, 3, 4}, + }, + .requestId = requestId, + }); + expectedResults.push_back(SetValueResult{ + .requestId = requestId, + .status = StatusCode::OK, + }); + } + + auto result = LargeParcelableBase::parcelableVectorToStableLargeParcelable( + expectedHardwareRequests); + if (!result.ok()) { + return result.error(); + } + if (result.value() == nullptr) { + requests.payloads = expectedHardwareRequests; + } else { + requests.sharedMemoryFd = std::move(*result.value()); + } + return {}; + } + size_t countClients() { std::scoped_lock lockGuard(mVhal->mLock); - return mVhal->mGetValuesClients.size(); + return mVhal->mGetValuesClients.size() + mVhal->mSetValuesClients.size(); } private: @@ -462,6 +577,113 @@ TEST_F(DefaultVehicleHalTest, testGetValuesInvalidLargeParcelableInput) { ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::INVALID_ARG)); } +TEST_F(DefaultVehicleHalTest, testSetValuesSmall) { + SetValueRequests requests; + std::vector expectedResults; + std::vector expectedHardwareRequests; + + ASSERT_TRUE(setValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok()); + + getHardware()->addSetValueResponses(expectedResults); + + auto status = getClient()->setValues(getCallbackClient(), requests); + + ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage(); + + EXPECT_EQ(getHardware()->nextSetValueRequests(), expectedHardwareRequests) + << "requests to hardware mismatch"; + + auto maybeSetValueResults = getCallback()->nextSetValueResults(); + ASSERT_TRUE(maybeSetValueResults.has_value()) << "no results in callback"; + ASSERT_EQ(maybeSetValueResults.value().payloads, expectedResults) << "results mismatch"; + EXPECT_EQ(countClients(), static_cast(1)); +} + +TEST_F(DefaultVehicleHalTest, testSetValuesLarge) { + SetValueRequests requests; + std::vector expectedResults; + std::vector expectedHardwareRequests; + + ASSERT_TRUE(setValuesTestCases(5000, requests, expectedResults, expectedHardwareRequests).ok()); + + getHardware()->addSetValueResponses(expectedResults); + + auto status = getClient()->setValues(getCallbackClient(), requests); + + ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage(); + + EXPECT_EQ(getHardware()->nextSetValueRequests(), expectedHardwareRequests) + << "requests to hardware mismatch"; + + auto maybeSetValueResults = getCallback()->nextSetValueResults(); + ASSERT_TRUE(maybeSetValueResults.has_value()) << "no results in callback"; + const SetValueResults& setValueResults = maybeSetValueResults.value(); + ASSERT_TRUE(setValueResults.payloads.empty()) + << "payload should be empty, shared memory file should be used"; + + auto result = LargeParcelableBase::stableLargeParcelableToParcelableVector( + setValueResults.sharedMemoryFd); + ASSERT_TRUE(result.ok()) << "failed to parse shared memory file"; + ASSERT_TRUE(result.value().has_value()) << "no parsed value"; + ASSERT_EQ(result.value().value(), expectedResults) << "results mismatch"; + EXPECT_EQ(countClients(), static_cast(1)); +} + +class SetValuesInvalidRequestTest + : public DefaultVehicleHalTest, + public testing::WithParamInterface {}; + +INSTANTIATE_TEST_SUITE_P( + SetValuesInvalidRequestTests, SetValuesInvalidRequestTest, + ::testing::ValuesIn(getSetValuesInvalidRequestTestCases()), + [](const testing::TestParamInfo& info) { + return info.param.name; + }); + +TEST_P(SetValuesInvalidRequestTest, testSetValuesInvalidRequest) { + SetValuesInvalidRequestTestCase tc = GetParam(); + std::vector expectedHardwareResults{ + SetValueResult{ + .requestId = 1, + .status = StatusCode::OK, + }, + }; + getHardware()->addSetValueResponses(expectedHardwareResults); + + SetValueRequests requests; + SetValueRequest invalidRequest{ + .requestId = 0, + .value = tc.request, + }; + SetValueRequest normalRequest{.requestId = 1, + .value = { + .prop = testInt32VecProp(0), + .value.int32Values = {0}, + }}; + requests.payloads = {invalidRequest, normalRequest}; + auto status = getClient()->setValues(getCallbackClient(), requests); + + ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage(); + + EXPECT_EQ(getHardware()->nextSetValueRequests(), std::vector({normalRequest})) + << "requests to hardware mismatch"; + + auto maybeSetValueResults = getCallback()->nextSetValueResults(); + ASSERT_TRUE(maybeSetValueResults.has_value()) << "no results in callback"; + EXPECT_EQ(maybeSetValueResults.value().payloads, std::vector({ + { + .requestId = 0, + .status = tc.expectedStatus, + }, + })) + << "invalid argument result mismatch"; + + maybeSetValueResults = getCallback()->nextSetValueResults(); + ASSERT_TRUE(maybeSetValueResults.has_value()) << "no results from hardware in callback"; + EXPECT_EQ(maybeSetValueResults.value().payloads, expectedHardwareResults) + << "results from hardware mismatch"; +} + } // namespace vehicle } // namespace automotive } // namespace hardware -- GitLab From d1d52fac2ac7ff1a79817c2e5f0591617be3b689 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Tue, 28 Dec 2021 20:30:54 -0800 Subject: [PATCH 375/825] Move Radio HAL compat shim logs to radio buffer Test: adb logcat -b radio | grep -i radiocompat Change-Id: Iac870a24d619db8a86ce91029f25c50ef862a268 --- radio/aidl/compat/service/service.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/radio/aidl/compat/service/service.cpp b/radio/aidl/compat/service/service.cpp index 7433feef17..8af05deb08 100644 --- a/radio/aidl/compat/service/service.cpp +++ b/radio/aidl/compat/service/service.cpp @@ -81,6 +81,7 @@ static void publishRadioConfig() { } static void main() { + base::InitLogging(nullptr, base::LogdLogger(base::RADIO)); base::SetDefaultTag("radiocompat"); base::SetMinimumLogSeverity(base::VERBOSE); LOG(DEBUG) << "Radio HAL compat service starting..."; -- GitLab From 830a0b445e683eec00ec7a3d2db3d0b4b7a35801 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Wed, 29 Dec 2021 11:44:52 -0500 Subject: [PATCH 376/825] Add DisplayCapability::DISPLAY_DECORATION Bug: 193170859 Test: manual Test: TODO (b/212697197) Change-Id: I5e5efe671f0b3d724bafeff93e2d97007cb167ab --- .../hardware/graphics/composer3/DisplayCapability.aidl | 1 + .../hardware/graphics/composer3/DisplayCapability.aidl | 4 ++++ 2 files changed, 5 insertions(+) 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 9f5342ef4b..fdf110032d 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 @@ -41,4 +41,5 @@ enum DisplayCapability { PROTECTED_CONTENTS = 4, AUTO_LOW_LATENCY_MODE = 5, SUSPEND = 6, + DISPLAY_DECORATION = 7, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl index eacf1068e1..249fed03a0 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl @@ -75,4 +75,8 @@ enum DisplayCapability { * PowerMode.ON_SUSPEND and PowerMode.DOZE_SUSPEND must be supported. */ SUSPEND = 6, + /** + * Indicates that the display supports Composition.DISPLAY_DECORATION. + */ + DISPLAY_DECORATION = 7, } -- GitLab From fcf0785d7492902100ea6f1dd9c1ceb0d692242b Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Sun, 26 Dec 2021 07:13:20 +0000 Subject: [PATCH 377/825] Add dummy interface combination for debugging Add another dummy interface combination to be used for debugging: STA+(STA||P2P||NAN||AP) Bug: 211919010 Test: adb shell setprop persist.vendor.debug.wifi.hal.preset_interface_combination_idx 5 Change-Id: I0499da1d0920ce03fe142f5b0936c6efe0dcf21a --- wifi/1.5/default/wifi_feature_flags.cpp | 31 ++++++++++++------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/wifi/1.5/default/wifi_feature_flags.cpp b/wifi/1.5/default/wifi_feature_flags.cpp index 124ba32e9f..70ce55a70e 100644 --- a/wifi/1.5/default/wifi_feature_flags.cpp +++ b/wifi/1.5/default/wifi_feature_flags.cpp @@ -157,43 +157,42 @@ constexpr char kDebugPresetInterfaceCombinationIdxProperty[] = // List of pre-defined interface combinations that can be enabled at runtime via // setting the property: "kDebugPresetInterfaceCombinationIdxProperty" to the // corresponding index value. -static const std::vector< - std::pair>> - kDebugChipModes{ +static const std::vector>> kDebugChipModes{ // Legacy combination - No STA/AP concurrencies. // 0 - (1 AP) or (1 STA + 1 of (P2P or NAN)) {"No STA/AP Concurrency", {{kMainModeId, - ChipIfaceCombination::make_vec( - {{{{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, + ChipIfaceCombination::make_vec({{{{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, // STA + AP concurrency // 1 - (1 STA + 1 AP) or (1 STA + 1 of (P2P or NAN)) {"STA + AP Concurrency", - {{kMainModeId, - ChipIfaceCombination::make_vec( - {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, + {{kMainModeId, ChipIfaceCombination::make_vec( + {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, // STA + STA concurrency // 2 - (1 STA + 1 AP) or (2 STA + 1 of (P2P or NAN)) {"Dual STA Concurrency", - {{kMainModeId, - ChipIfaceCombination::make_vec( - {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}}, + {{kMainModeId, ChipIfaceCombination::make_vec( + {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}}, // AP + AP + STA concurrency // 3 - (1 STA + 2 AP) or (1 STA + 1 of (P2P or NAN)) {"Dual AP Concurrency", - {{kMainModeId, - ChipIfaceCombination::make_vec( - {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, + {{kMainModeId, ChipIfaceCombination::make_vec( + {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, // STA + STA concurrency and AP + AP + STA concurrency // 4 - (1 STA + 2 AP) or (2 STA + 1 of (P2P or NAN)) {"Dual STA & Dual AP Concurrency", + {{kMainModeId, ChipIfaceCombination::make_vec( + {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}}, + + // STA + STA concurrency + // 5 - (1 STA + 1 AP (bridged or single) | P2P | NAN), or (2 STA)) + {"Dual STA or STA plus single other interface", {{kMainModeId, - ChipIfaceCombination::make_vec( - {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}}}; + ChipIfaceCombination::make_vec({{{{STA}, 1}, {{P2P, NAN, AP}, 1}}, {{{STA}, 2}}})}}}}; #undef STA #undef AP -- GitLab From bc2a1b7321149a08693c38177f05b6274d49f99c Mon Sep 17 00:00:00 2001 From: Grace Cheng Date: Tue, 9 Nov 2021 14:26:23 +0000 Subject: [PATCH 378/825] Adds sensors aidl default (cuttlefish) implementation Bug: 195593357 Test: Verify VTS AIDL sensors tests pass Change-Id: I12f09adfb0d81c8c15e2c18c836f03cbd9d82daf --- sensors/aidl/default/Android.bp | 8 + sensors/aidl/default/Sensor.cpp | 434 ++++++++++++++++++ sensors/aidl/default/Sensors.cpp | 133 ++++-- .../default/include/sensors-impl/Sensor.h | 168 +++++++ .../default/include/sensors-impl/Sensors.h | 158 ++++++- 5 files changed, 870 insertions(+), 31 deletions(-) create mode 100644 sensors/aidl/default/Sensor.cpp create mode 100644 sensors/aidl/default/include/sensors-impl/Sensor.h diff --git a/sensors/aidl/default/Android.bp b/sensors/aidl/default/Android.bp index 487387d1ce..49841a456b 100644 --- a/sensors/aidl/default/Android.bp +++ b/sensors/aidl/default/Android.bp @@ -28,12 +28,15 @@ cc_library_static { vendor: true, shared_libs: [ "libbase", + "libfmq", + "libpower", "libbinder_ndk", "android.hardware.sensors-V1-ndk", ], export_include_dirs: ["include"], srcs: [ "Sensors.cpp", + "Sensor.cpp", ], visibility: [ ":__subpackages__", @@ -50,6 +53,11 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", + "libfmq", + "libpower", + "libcutils", + "liblog", + "libutils", "android.hardware.sensors-V1-ndk", ], static_libs: [ diff --git a/sensors/aidl/default/Sensor.cpp b/sensors/aidl/default/Sensor.cpp new file mode 100644 index 0000000000..50d8841b2a --- /dev/null +++ b/sensors/aidl/default/Sensor.cpp @@ -0,0 +1,434 @@ +/* + * 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 "sensors-impl/Sensor.h" + +#include "utils/SystemClock.h" + +#include + +using ::ndk::ScopedAStatus; + +namespace aidl { +namespace android { +namespace hardware { +namespace sensors { + +static constexpr int32_t kDefaultMaxDelayUs = 10 * 1000 * 1000; + +Sensor::Sensor(ISensorsEventCallback* callback) + : mIsEnabled(false), + mSamplingPeriodNs(0), + mLastSampleTimeNs(0), + mCallback(callback), + mMode(OperationMode::NORMAL) { + mRunThread = std::thread(startThread, this); +} + +Sensor::~Sensor() { + std::unique_lock lock(mRunMutex); + mStopThread = true; + mIsEnabled = false; + mWaitCV.notify_all(); + lock.release(); + mRunThread.join(); +} + +const SensorInfo& Sensor::getSensorInfo() const { + return mSensorInfo; +} + +void Sensor::batch(int64_t samplingPeriodNs) { + if (samplingPeriodNs < mSensorInfo.minDelayUs * 1000ll) { + samplingPeriodNs = mSensorInfo.minDelayUs * 1000ll; + } else if (samplingPeriodNs > mSensorInfo.maxDelayUs * 1000ll) { + samplingPeriodNs = mSensorInfo.maxDelayUs * 1000ll; + } + + if (mSamplingPeriodNs != samplingPeriodNs) { + mSamplingPeriodNs = samplingPeriodNs; + // Wake up the 'run' thread to check if a new event should be generated now + mWaitCV.notify_all(); + } +} + +void Sensor::activate(bool enable) { + if (mIsEnabled != enable) { + std::unique_lock lock(mRunMutex); + mIsEnabled = enable; + mWaitCV.notify_all(); + } +} + +ScopedAStatus Sensor::flush() { + // Only generate a flush complete event if the sensor is enabled and if the sensor is not a + // one-shot sensor. + if (!mIsEnabled || + (mSensorInfo.flags & static_cast(SensorInfo::SENSOR_FLAG_BITS_ONE_SHOT_MODE))) { + return ScopedAStatus::fromServiceSpecificError( + static_cast(BnSensors::ERROR_BAD_VALUE)); + } + + // Note: If a sensor supports batching, write all of the currently batched events for the sensor + // to the Event FMQ prior to writing the flush complete event. + Event ev; + ev.sensorHandle = mSensorInfo.sensorHandle; + ev.sensorType = SensorType::META_DATA; + EventPayload::MetaData meta = { + .what = MetaDataEventType::META_DATA_FLUSH_COMPLETE, + }; + ev.payload.set(meta); + std::vector evs{ev}; + mCallback->postEvents(evs, isWakeUpSensor()); + + return ScopedAStatus::ok(); +} + +void Sensor::startThread(Sensor* sensor) { + sensor->run(); +} + +void Sensor::run() { + std::unique_lock runLock(mRunMutex); + constexpr int64_t kNanosecondsInSeconds = 1000 * 1000 * 1000; + + while (!mStopThread) { + if (!mIsEnabled || mMode == OperationMode::DATA_INJECTION) { + mWaitCV.wait(runLock, [&] { + return ((mIsEnabled && mMode == OperationMode::NORMAL) || mStopThread); + }); + } else { + timespec curTime; + clock_gettime(CLOCK_BOOTTIME, &curTime); + int64_t now = (curTime.tv_sec * kNanosecondsInSeconds) + curTime.tv_nsec; + int64_t nextSampleTime = mLastSampleTimeNs + mSamplingPeriodNs; + + if (now >= nextSampleTime) { + mLastSampleTimeNs = now; + nextSampleTime = mLastSampleTimeNs + mSamplingPeriodNs; + mCallback->postEvents(readEvents(), isWakeUpSensor()); + } + + mWaitCV.wait_for(runLock, std::chrono::nanoseconds(nextSampleTime - now)); + } + } +} + +bool Sensor::isWakeUpSensor() { + return mSensorInfo.flags & static_cast(SensorInfo::SENSOR_FLAG_BITS_WAKE_UP); +} + +std::vector Sensor::readEvents() { + std::vector events; + Event event; + event.sensorHandle = mSensorInfo.sensorHandle; + event.sensorType = mSensorInfo.type; + event.timestamp = ::android::elapsedRealtimeNano(); + memset(&event.payload, 0, sizeof(event.payload)); + readEventPayload(event.payload); + events.push_back(event); + return events; +} + +void Sensor::setOperationMode(OperationMode mode) { + if (mMode != mode) { + std::unique_lock lock(mRunMutex); + mMode = mode; + mWaitCV.notify_all(); + } +} + +bool Sensor::supportsDataInjection() const { + return mSensorInfo.flags & static_cast(SensorInfo::SENSOR_FLAG_BITS_DATA_INJECTION); +} + +ScopedAStatus Sensor::injectEvent(const Event& event) { + if (event.sensorType == SensorType::ADDITIONAL_INFO) { + return ScopedAStatus::ok(); + // When in OperationMode::NORMAL, SensorType::ADDITIONAL_INFO is used to push operation + // environment data into the device. + } + + if (!supportsDataInjection()) { + return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); + } + + if (mMode == OperationMode::DATA_INJECTION) { + mCallback->postEvents(std::vector{event}, isWakeUpSensor()); + return ScopedAStatus::ok(); + } + + return ScopedAStatus::fromServiceSpecificError( + static_cast(BnSensors::ERROR_BAD_VALUE)); +} + +OnChangeSensor::OnChangeSensor(ISensorsEventCallback* callback) + : Sensor(callback), mPreviousEventSet(false) {} + +void OnChangeSensor::activate(bool enable) { + Sensor::activate(enable); + if (!enable) { + mPreviousEventSet = false; + } +} + +std::vector OnChangeSensor::readEvents() { + std::vector events = Sensor::readEvents(); + std::vector outputEvents; + + for (auto iter = events.begin(); iter != events.end(); ++iter) { + Event ev = *iter; + if (!mPreviousEventSet || + memcmp(&mPreviousEvent.payload, &ev.payload, sizeof(ev.payload)) != 0) { + outputEvents.push_back(ev); + mPreviousEvent = ev; + mPreviousEventSet = true; + } + } + return outputEvents; +} + +AccelSensor::AccelSensor(int32_t sensorHandle, ISensorsEventCallback* callback) : Sensor(callback) { + mSensorInfo.sensorHandle = sensorHandle; + mSensorInfo.name = "Accel Sensor"; + mSensorInfo.vendor = "Vendor String"; + mSensorInfo.version = 1; + mSensorInfo.type = SensorType::ACCELEROMETER; + mSensorInfo.typeAsString = ""; + mSensorInfo.maxRange = 78.4f; // +/- 8g + mSensorInfo.resolution = 1.52e-5; + mSensorInfo.power = 0.001f; // mA + mSensorInfo.minDelayUs = 10 * 1000; // microseconds + mSensorInfo.maxDelayUs = kDefaultMaxDelayUs; + mSensorInfo.fifoReservedEventCount = 0; + mSensorInfo.fifoMaxEventCount = 0; + mSensorInfo.requiredPermission = ""; + mSensorInfo.flags = static_cast(SensorInfo::SENSOR_FLAG_BITS_DATA_INJECTION); +}; + +void AccelSensor::readEventPayload(EventPayload& payload) { + EventPayload::Vec3 vec3 = { + .x = 0, + .y = 0, + .z = -9.8, + .status = SensorStatus::ACCURACY_HIGH, + }; + payload.set(vec3); +} + +PressureSensor::PressureSensor(int32_t sensorHandle, ISensorsEventCallback* callback) + : Sensor(callback) { + mSensorInfo.sensorHandle = sensorHandle; + mSensorInfo.name = "Pressure Sensor"; + mSensorInfo.vendor = "Vendor String"; + mSensorInfo.version = 1; + mSensorInfo.type = SensorType::PRESSURE; + mSensorInfo.typeAsString = ""; + mSensorInfo.maxRange = 1100.0f; // hPa + mSensorInfo.resolution = 0.005f; // hPa + mSensorInfo.power = 0.001f; // mA + mSensorInfo.minDelayUs = 100 * 1000; // microseconds + mSensorInfo.maxDelayUs = kDefaultMaxDelayUs; + mSensorInfo.fifoReservedEventCount = 0; + mSensorInfo.fifoMaxEventCount = 0; + mSensorInfo.requiredPermission = ""; + mSensorInfo.flags = 0; +}; + +void PressureSensor::readEventPayload(EventPayload& payload) { + payload.set(1013.25f); +} + +MagnetometerSensor::MagnetometerSensor(int32_t sensorHandle, ISensorsEventCallback* callback) + : Sensor(callback) { + mSensorInfo.sensorHandle = sensorHandle; + mSensorInfo.name = "Magnetic Field Sensor"; + mSensorInfo.vendor = "Vendor String"; + mSensorInfo.version = 1; + mSensorInfo.type = SensorType::MAGNETIC_FIELD; + mSensorInfo.typeAsString = ""; + mSensorInfo.maxRange = 1300.0f; + mSensorInfo.resolution = 0.01f; + mSensorInfo.power = 0.001f; // mA + mSensorInfo.minDelayUs = 20 * 1000; // microseconds + mSensorInfo.maxDelayUs = kDefaultMaxDelayUs; + mSensorInfo.fifoReservedEventCount = 0; + mSensorInfo.fifoMaxEventCount = 0; + mSensorInfo.requiredPermission = ""; + mSensorInfo.flags = 0; +}; + +void MagnetometerSensor::readEventPayload(EventPayload& payload) { + EventPayload::Vec3 vec3 = { + .x = 100.0, + .y = 0, + .z = 50.0, + .status = SensorStatus::ACCURACY_HIGH, + }; + payload.set(vec3); +} + +LightSensor::LightSensor(int32_t sensorHandle, ISensorsEventCallback* callback) + : OnChangeSensor(callback) { + mSensorInfo.sensorHandle = sensorHandle; + mSensorInfo.name = "Light Sensor"; + mSensorInfo.vendor = "Vendor String"; + mSensorInfo.version = 1; + mSensorInfo.type = SensorType::LIGHT; + mSensorInfo.typeAsString = ""; + mSensorInfo.maxRange = 43000.0f; + mSensorInfo.resolution = 10.0f; + mSensorInfo.power = 0.001f; // mA + mSensorInfo.minDelayUs = 200 * 1000; // microseconds + mSensorInfo.maxDelayUs = kDefaultMaxDelayUs; + mSensorInfo.fifoReservedEventCount = 0; + mSensorInfo.fifoMaxEventCount = 0; + mSensorInfo.requiredPermission = ""; + mSensorInfo.flags = static_cast(SensorInfo::SENSOR_FLAG_BITS_ON_CHANGE_MODE); +}; + +void LightSensor::readEventPayload(EventPayload& payload) { + payload.set(80.0f); +} + +ProximitySensor::ProximitySensor(int32_t sensorHandle, ISensorsEventCallback* callback) + : OnChangeSensor(callback) { + mSensorInfo.sensorHandle = sensorHandle; + mSensorInfo.name = "Proximity Sensor"; + mSensorInfo.vendor = "Vendor String"; + mSensorInfo.version = 1; + mSensorInfo.type = SensorType::PROXIMITY; + mSensorInfo.typeAsString = ""; + mSensorInfo.maxRange = 5.0f; + mSensorInfo.resolution = 1.0f; + mSensorInfo.power = 0.012f; // mA + mSensorInfo.minDelayUs = 200 * 1000; // microseconds + mSensorInfo.maxDelayUs = kDefaultMaxDelayUs; + mSensorInfo.fifoReservedEventCount = 0; + mSensorInfo.fifoMaxEventCount = 0; + mSensorInfo.requiredPermission = ""; + mSensorInfo.flags = static_cast(SensorInfo::SENSOR_FLAG_BITS_ON_CHANGE_MODE | + SensorInfo::SENSOR_FLAG_BITS_WAKE_UP); +}; + +void ProximitySensor::readEventPayload(EventPayload& payload) { + payload.set(2.5f); +} + +GyroSensor::GyroSensor(int32_t sensorHandle, ISensorsEventCallback* callback) : Sensor(callback) { + mSensorInfo.sensorHandle = sensorHandle; + mSensorInfo.name = "Gyro Sensor"; + mSensorInfo.vendor = "Vendor String"; + mSensorInfo.version = 1; + mSensorInfo.type = SensorType::GYROSCOPE; + mSensorInfo.typeAsString = ""; + mSensorInfo.maxRange = 1000.0f * M_PI / 180.0f; + mSensorInfo.resolution = 1000.0f * M_PI / (180.0f * 32768.0f); + mSensorInfo.power = 0.001f; + mSensorInfo.minDelayUs = 10 * 1000; // microseconds + mSensorInfo.maxDelayUs = kDefaultMaxDelayUs; + mSensorInfo.fifoReservedEventCount = 0; + mSensorInfo.fifoMaxEventCount = 0; + mSensorInfo.requiredPermission = ""; + mSensorInfo.flags = 0; +}; + +void GyroSensor::readEventPayload(EventPayload& payload) { + EventPayload::Vec3 vec3 = { + .x = 0, + .y = 0, + .z = 0, + .status = SensorStatus::ACCURACY_HIGH, + }; + payload.set(vec3); +} + +AmbientTempSensor::AmbientTempSensor(int32_t sensorHandle, ISensorsEventCallback* callback) + : OnChangeSensor(callback) { + mSensorInfo.sensorHandle = sensorHandle; + mSensorInfo.name = "Ambient Temp Sensor"; + mSensorInfo.vendor = "Vendor String"; + mSensorInfo.version = 1; + mSensorInfo.type = SensorType::AMBIENT_TEMPERATURE; + mSensorInfo.typeAsString = ""; + mSensorInfo.maxRange = 80.0f; + mSensorInfo.resolution = 0.01f; + mSensorInfo.power = 0.001f; + mSensorInfo.minDelayUs = 40 * 1000; // microseconds + mSensorInfo.maxDelayUs = kDefaultMaxDelayUs; + mSensorInfo.fifoReservedEventCount = 0; + mSensorInfo.fifoMaxEventCount = 0; + mSensorInfo.requiredPermission = ""; + mSensorInfo.flags = static_cast(SensorInfo::SENSOR_FLAG_BITS_ON_CHANGE_MODE); +}; + +void AmbientTempSensor::readEventPayload(EventPayload& payload) { + payload.set(40.0f); +} + +RelativeHumiditySensor::RelativeHumiditySensor(int32_t sensorHandle, + ISensorsEventCallback* callback) + : OnChangeSensor(callback) { + mSensorInfo.sensorHandle = sensorHandle; + mSensorInfo.name = "Relative Humidity Sensor"; + mSensorInfo.vendor = "Vendor String"; + mSensorInfo.version = 1; + mSensorInfo.type = SensorType::RELATIVE_HUMIDITY; + mSensorInfo.typeAsString = ""; + mSensorInfo.maxRange = 100.0f; + mSensorInfo.resolution = 0.1f; + mSensorInfo.power = 0.001f; + mSensorInfo.minDelayUs = 40 * 1000; // microseconds + mSensorInfo.maxDelayUs = kDefaultMaxDelayUs; + mSensorInfo.fifoReservedEventCount = 0; + mSensorInfo.fifoMaxEventCount = 0; + mSensorInfo.requiredPermission = ""; + mSensorInfo.flags = static_cast(SensorInfo::SENSOR_FLAG_BITS_ON_CHANGE_MODE); +} + +void RelativeHumiditySensor::readEventPayload(EventPayload& payload) { + payload.set(50.0f); +} + +HingeAngleSensor::HingeAngleSensor(int32_t sensorHandle, ISensorsEventCallback* callback) + : OnChangeSensor(callback) { + mSensorInfo.sensorHandle = sensorHandle; + mSensorInfo.name = "Hinge Angle Sensor"; + mSensorInfo.vendor = "Vendor String"; + mSensorInfo.version = 1; + mSensorInfo.type = SensorType::HINGE_ANGLE; + mSensorInfo.typeAsString = ""; + mSensorInfo.maxRange = 360.0f; + mSensorInfo.resolution = 1.0f; + mSensorInfo.power = 0.001f; + mSensorInfo.minDelayUs = 40 * 1000; // microseconds + mSensorInfo.maxDelayUs = kDefaultMaxDelayUs; + mSensorInfo.fifoReservedEventCount = 0; + mSensorInfo.fifoMaxEventCount = 0; + mSensorInfo.requiredPermission = ""; + mSensorInfo.flags = static_cast(SensorInfo::SENSOR_FLAG_BITS_ON_CHANGE_MODE | + SensorInfo::SENSOR_FLAG_BITS_WAKE_UP | + SensorInfo::SENSOR_FLAG_BITS_DATA_INJECTION); +} + +void HingeAngleSensor::readEventPayload(EventPayload& payload) { + payload.set(180.0f); +} + +} // namespace sensors +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/sensors/aidl/default/Sensors.cpp b/sensors/aidl/default/Sensors.cpp index 14bbbbf7f4..65dd304b2c 100644 --- a/sensors/aidl/default/Sensors.cpp +++ b/sensors/aidl/default/Sensors.cpp @@ -16,66 +16,139 @@ #include "sensors-impl/Sensors.h" +#include + using ::aidl::android::hardware::common::fmq::MQDescriptor; using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite; using ::aidl::android::hardware::sensors::Event; using ::aidl::android::hardware::sensors::ISensors; using ::aidl::android::hardware::sensors::ISensorsCallback; using ::aidl::android::hardware::sensors::SensorInfo; +using ::ndk::ScopedAStatus; namespace aidl { namespace android { namespace hardware { namespace sensors { -// TODO(b/195593357): Implement AIDL HAL -::ndk::ScopedAStatus Sensors::activate(int32_t /* in_sensorHandle */, bool /* in_enabled */) { - return ndk::ScopedAStatus::ok(); +ScopedAStatus Sensors::activate(int32_t in_sensorHandle, bool in_enabled) { + auto sensor = mSensors.find(in_sensorHandle); + if (sensor != mSensors.end()) { + sensor->second->activate(in_enabled); + return ScopedAStatus::ok(); + } + + return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } -::ndk::ScopedAStatus Sensors::batch(int32_t /* in_sensorHandle */, - int64_t /* in_samplingPeriodNs */, - int64_t /* in_maxReportLatencyNs */) { - return ndk::ScopedAStatus::ok(); +ScopedAStatus Sensors::batch(int32_t in_sensorHandle, int64_t in_samplingPeriodNs, + int64_t /* in_maxReportLatencyNs */) { + auto sensor = mSensors.find(in_sensorHandle); + if (sensor != mSensors.end()) { + sensor->second->batch(in_samplingPeriodNs); + return ScopedAStatus::ok(); + } + + return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } -::ndk::ScopedAStatus Sensors::configDirectReport(int32_t /* in_sensorHandle */, - int32_t /* in_channelHandle */, - ISensors::RateLevel /* in_rate */, - int32_t* /* _aidl_return */) { - return ndk::ScopedAStatus::ok(); +ScopedAStatus Sensors::configDirectReport(int32_t /* in_sensorHandle */, + int32_t /* in_channelHandle */, + ISensors::RateLevel /* in_rate */, + int32_t* _aidl_return) { + *_aidl_return = EX_UNSUPPORTED_OPERATION; + + return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } -::ndk::ScopedAStatus Sensors::flush(int32_t /* in_sensorHandle */) { - return ndk::ScopedAStatus::ok(); +ScopedAStatus Sensors::flush(int32_t in_sensorHandle) { + auto sensor = mSensors.find(in_sensorHandle); + if (sensor != mSensors.end()) { + return sensor->second->flush(); + } + + return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } -::ndk::ScopedAStatus Sensors::getSensorsList(std::vector* /* _aidl_return */) { - return ndk::ScopedAStatus::ok(); +ScopedAStatus Sensors::getSensorsList(std::vector* _aidl_return) { + for (const auto& sensor : mSensors) { + _aidl_return->push_back(sensor.second->getSensorInfo()); + } + return ScopedAStatus::ok(); } -::ndk::ScopedAStatus Sensors::initialize( - const MQDescriptor& /* in_eventQueueDescriptor */, - const MQDescriptor& /* in_wakeLockDescriptor */, - const std::shared_ptr& /* in_sensorsCallback */) { - return ndk::ScopedAStatus::ok(); +ScopedAStatus Sensors::initialize( + const MQDescriptor& in_eventQueueDescriptor, + const MQDescriptor& in_wakeLockDescriptor, + const std::shared_ptr<::aidl::android::hardware::sensors::ISensorsCallback>& + in_sensorsCallback) { + ScopedAStatus result = ScopedAStatus::ok(); + + mEventQueue = std::make_unique>( + in_eventQueueDescriptor, true /* resetPointers */); + + // Ensure that all sensors are disabled. + for (auto sensor : mSensors) { + sensor.second->activate(false); + } + + // Stop the Wake Lock thread if it is currently running + if (mReadWakeLockQueueRun.load()) { + mReadWakeLockQueueRun = false; + mWakeLockThread.join(); + } + + // Save a reference to the callback + mCallback = in_sensorsCallback; + + // Ensure that any existing EventFlag is properly deleted + deleteEventFlag(); + + // Create the EventFlag that is used to signal to the framework that sensor events have been + // written to the Event FMQ + if (EventFlag::createEventFlag(mEventQueue->getEventFlagWord(), &mEventQueueFlag) != OK) { + result = ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } + + // Create the Wake Lock FMQ that is used by the framework to communicate whenever WAKE_UP + // events have been successfully read and handled by the framework. + mWakeLockQueue = std::make_unique>( + in_wakeLockDescriptor, true /* resetPointers */); + + if (!mCallback || !mEventQueue || !mWakeLockQueue || mEventQueueFlag == nullptr) { + result = ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } + + // Start the thread to read events from the Wake Lock FMQ + mReadWakeLockQueueRun = true; + mWakeLockThread = std::thread(startReadWakeLockThread, this); + return result; } -::ndk::ScopedAStatus Sensors::injectSensorData(const Event& /* in_event */) { - return ndk::ScopedAStatus::ok(); +ScopedAStatus Sensors::injectSensorData(const Event& in_event) { + auto sensor = mSensors.find(in_event.sensorHandle); + if (sensor != mSensors.end()) { + return sensor->second->injectEvent(in_event); + } + return ScopedAStatus::fromServiceSpecificError(static_cast(ERROR_BAD_VALUE)); } -::ndk::ScopedAStatus Sensors::registerDirectChannel(const ISensors::SharedMemInfo& /* in_mem */, - int32_t* /* _aidl_return */) { - return ndk::ScopedAStatus::ok(); +ScopedAStatus Sensors::registerDirectChannel(const ISensors::SharedMemInfo& /* in_mem */, + int32_t* _aidl_return) { + *_aidl_return = EX_UNSUPPORTED_OPERATION; + + return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } -::ndk::ScopedAStatus Sensors::setOperationMode(OperationMode /* in_mode */) { - return ndk::ScopedAStatus::ok(); +ScopedAStatus Sensors::setOperationMode(OperationMode in_mode) { + for (auto sensor : mSensors) { + sensor.second->setOperationMode(in_mode); + } + return ScopedAStatus::ok(); } -::ndk::ScopedAStatus Sensors::unregisterDirectChannel(int32_t /* in_channelHandle */) { - return ndk::ScopedAStatus::ok(); +ScopedAStatus Sensors::unregisterDirectChannel(int32_t /* in_channelHandle */) { + return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } } // namespace sensors diff --git a/sensors/aidl/default/include/sensors-impl/Sensor.h b/sensors/aidl/default/include/sensors-impl/Sensor.h new file mode 100644 index 0000000000..e6cd3e6970 --- /dev/null +++ b/sensors/aidl/default/include/sensors-impl/Sensor.h @@ -0,0 +1,168 @@ +/* + * 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 + +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace sensors { + +class ISensorsEventCallback { + public: + using Event = ::aidl::android::hardware::sensors::Event; + + virtual ~ISensorsEventCallback(){}; + virtual void postEvents(const std::vector& events, bool wakeup) = 0; +}; + +class Sensor { + public: + using OperationMode = ::aidl::android::hardware::sensors::ISensors::OperationMode; + using Event = ::aidl::android::hardware::sensors::Event; + using EventPayload = ::aidl::android::hardware::sensors::Event::EventPayload; + using SensorInfo = ::aidl::android::hardware::sensors::SensorInfo; + using SensorType = ::aidl::android::hardware::sensors::SensorType; + using MetaDataEventType = + ::aidl::android::hardware::sensors::Event::EventPayload::MetaData::MetaDataEventType; + + Sensor(ISensorsEventCallback* callback); + virtual ~Sensor(); + + const SensorInfo& getSensorInfo() const; + void batch(int64_t samplingPeriodNs); + virtual void activate(bool enable); + ndk::ScopedAStatus flush(); + + void setOperationMode(OperationMode mode); + bool supportsDataInjection() const; + ndk::ScopedAStatus injectEvent(const Event& event); + + protected: + void run(); + virtual std::vector readEvents(); + virtual void readEventPayload(EventPayload&) = 0; + static void startThread(Sensor* sensor); + + bool isWakeUpSensor(); + + bool mIsEnabled; + int64_t mSamplingPeriodNs; + int64_t mLastSampleTimeNs; + SensorInfo mSensorInfo; + + std::atomic_bool mStopThread; + std::condition_variable mWaitCV; + std::mutex mRunMutex; + std::thread mRunThread; + + ISensorsEventCallback* mCallback; + + OperationMode mMode; +}; + +class OnChangeSensor : public Sensor { + public: + OnChangeSensor(ISensorsEventCallback* callback); + + virtual void activate(bool enable) override; + + protected: + virtual std::vector readEvents() override; + + protected: + Event mPreviousEvent; + bool mPreviousEventSet; +}; + +class AccelSensor : public Sensor { + public: + AccelSensor(int32_t sensorHandle, ISensorsEventCallback* callback); + + protected: + virtual void readEventPayload(EventPayload& payload) override; +}; + +class GyroSensor : public Sensor { + public: + GyroSensor(int32_t sensorHandle, ISensorsEventCallback* callback); + + protected: + virtual void readEventPayload(EventPayload& payload) override; +}; + +class AmbientTempSensor : public OnChangeSensor { + public: + AmbientTempSensor(int32_t sensorHandle, ISensorsEventCallback* callback); + + protected: + virtual void readEventPayload(EventPayload& payload) override; +}; + +class PressureSensor : public Sensor { + public: + PressureSensor(int32_t sensorHandle, ISensorsEventCallback* callback); + + protected: + virtual void readEventPayload(EventPayload& payload) override; +}; + +class MagnetometerSensor : public Sensor { + public: + MagnetometerSensor(int32_t sensorHandle, ISensorsEventCallback* callback); + + protected: + virtual void readEventPayload(EventPayload& payload) override; +}; + +class LightSensor : public OnChangeSensor { + public: + LightSensor(int32_t sensorHandle, ISensorsEventCallback* callback); + + protected: + virtual void readEventPayload(EventPayload& payload) override; +}; + +class ProximitySensor : public OnChangeSensor { + public: + ProximitySensor(int32_t sensorHandle, ISensorsEventCallback* callback); + + protected: + virtual void readEventPayload(EventPayload& payload) override; +}; + +class RelativeHumiditySensor : public OnChangeSensor { + public: + RelativeHumiditySensor(int32_t sensorHandle, ISensorsEventCallback* callback); + + protected: + virtual void readEventPayload(EventPayload& payload) override; +}; + +class HingeAngleSensor : public OnChangeSensor { + public: + HingeAngleSensor(int32_t sensorHandle, ISensorsEventCallback* callback); + + protected: + virtual void readEventPayload(EventPayload& payload) override; +}; + +} // namespace sensors +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/sensors/aidl/default/include/sensors-impl/Sensors.h b/sensors/aidl/default/include/sensors-impl/Sensors.h index b6be4a5efd..e270d9682e 100644 --- a/sensors/aidl/default/include/sensors-impl/Sensors.h +++ b/sensors/aidl/default/include/sensors-impl/Sensors.h @@ -16,14 +16,52 @@ #pragma once +#include #include +#include +#include +#include +#include "Sensor.h" namespace aidl { namespace android { namespace hardware { namespace sensors { -class Sensors : public BnSensors { +using aidl::android::hardware::common::fmq::SynchronizedReadWrite; +using ::android::AidlMessageQueue; +using ::android::OK; +using ::android::status_t; +using ::android::hardware::EventFlag; + +class Sensors : public BnSensors, public ISensorsEventCallback { + static constexpr const char* kWakeLockName = "SensorsHAL_WAKEUP"; + + public: + Sensors() + : mEventQueueFlag(nullptr), + mNextHandle(1), + mOutstandingWakeUpEvents(0), + mReadWakeLockQueueRun(false), + mAutoReleaseWakeLockTime(0), + mHasWakeLock(false) { + AddSensor(); + AddSensor(); + AddSensor(); + AddSensor(); + AddSensor(); + AddSensor(); + AddSensor(); + AddSensor(); + AddSensor(); + } + + virtual ~Sensors() { + deleteEventFlag(); + mReadWakeLockQueueRun = false; + mWakeLockThread.join(); + } + ::ndk::ScopedAStatus activate(int32_t in_sensorHandle, bool in_enabled) override; ::ndk::ScopedAStatus batch(int32_t in_sensorHandle, int64_t in_samplingPeriodNs, int64_t in_maxReportLatencyNs) override; @@ -52,6 +90,124 @@ class Sensors : public BnSensors { ::ndk::ScopedAStatus setOperationMode( ::aidl::android::hardware::sensors::ISensors::OperationMode in_mode) override; ::ndk::ScopedAStatus unregisterDirectChannel(int32_t in_channelHandle) override; + + void postEvents(const std::vector& events, bool wakeup) override { + std::lock_guard lock(mWriteLock); + if (mEventQueue == nullptr) { + return; + } + if (mEventQueue->write(&events.front(), events.size())) { + mEventQueueFlag->wake( + static_cast(BnSensors::EVENT_QUEUE_FLAG_BITS_READ_AND_PROCESS)); + + if (wakeup) { + // Keep track of the number of outstanding WAKE_UP events in order to properly hold + // a wake lock until the framework has secured a wake lock + updateWakeLock(events.size(), 0 /* eventsHandled */); + } + } + } + + protected: + // Add a new sensor + template + void AddSensor() { + std::shared_ptr sensor = + std::make_shared(mNextHandle++ /* sensorHandle */, this /* callback */); + mSensors[sensor->getSensorInfo().sensorHandle] = sensor; + } + + // Utility function to delete the Event Flag + void deleteEventFlag() { + if (mEventQueueFlag != nullptr) { + status_t status = EventFlag::deleteEventFlag(&mEventQueueFlag); + if (status != OK) { + ALOGI("Failed to delete event flag: %d", status); + } + } + } + + static void startReadWakeLockThread(Sensors* sensors) { sensors->readWakeLockFMQ(); } + + // Function to read the Wake Lock FMQ and release the wake lock when appropriate + void readWakeLockFMQ() { + while (mReadWakeLockQueueRun.load()) { + constexpr int64_t kReadTimeoutNs = 500 * 1000 * 1000; // 500 ms + int32_t eventsHandled = 0; + + // Read events from the Wake Lock FMQ. Timeout after a reasonable amount of time to + // ensure that any held wake lock is able to be released if it is held for too long. + mWakeLockQueue->readBlocking( + &eventsHandled, 1 /* count */, 0 /* readNotification */, + static_cast(WAKE_LOCK_QUEUE_FLAG_BITS_DATA_WRITTEN), kReadTimeoutNs); + updateWakeLock(0 /* eventsWritten */, eventsHandled); + } + } + + /** + * Responsible for acquiring and releasing a wake lock when there are unhandled WAKE_UP events + */ + void updateWakeLock(int32_t eventsWritten, int32_t eventsHandled) { + std::lock_guard lock(mWakeLockLock); + int32_t newVal = mOutstandingWakeUpEvents + eventsWritten - eventsHandled; + if (newVal < 0) { + mOutstandingWakeUpEvents = 0; + } else { + mOutstandingWakeUpEvents = newVal; + } + + if (eventsWritten > 0) { + // Update the time at which the last WAKE_UP event was sent + mAutoReleaseWakeLockTime = ::android::uptimeMillis() + + static_cast(WAKE_LOCK_TIMEOUT_SECONDS) * 1000; + } + + if (!mHasWakeLock && mOutstandingWakeUpEvents > 0 && + acquire_wake_lock(PARTIAL_WAKE_LOCK, kWakeLockName) == 0) { + mHasWakeLock = true; + } else if (mHasWakeLock) { + // Check if the wake lock should be released automatically if + // SensorTimeout::WAKE_LOCK_SECONDS has elapsed since the last WAKE_UP event was written + // to the Wake Lock FMQ. + if (::android::uptimeMillis() > mAutoReleaseWakeLockTime) { + ALOGD("No events read from wake lock FMQ for %d seconds, auto releasing wake lock", + WAKE_LOCK_TIMEOUT_SECONDS); + mOutstandingWakeUpEvents = 0; + } + + if (mOutstandingWakeUpEvents == 0 && release_wake_lock(kWakeLockName) == 0) { + mHasWakeLock = false; + } + } + } + + private: + // The Event FMQ where sensor events are written + std::unique_ptr> mEventQueue; + // The Wake Lock FMQ that is read to determine when the framework has handled WAKE_UP events + std::unique_ptr> mWakeLockQueue; + // Event Flag to signal to the framework when sensor events are available to be read + EventFlag* mEventQueueFlag; + // Callback for asynchronous events, such as dynamic sensor connections. + std::shared_ptr<::aidl::android::hardware::sensors::ISensorsCallback> mCallback; + // A map of the available sensors. + std::map> mSensors; + // The next available sensor handle. + int32_t mNextHandle; + // Lock to protect writes to the FMQs. + std::mutex mWriteLock; + // Lock to protect acquiring and releasing the wake lock + std::mutex mWakeLockLock; + // Track the number of WAKE_UP events that have not been handled by the framework + uint32_t mOutstandingWakeUpEvents; + // A thread to read the Wake Lock FMQ + std::thread mWakeLockThread; + // Flag to indicate that the Wake Lock Thread should continue to run + std::atomic_bool mReadWakeLockQueueRun; + // Track the time when the wake lock should automatically be released + int64_t mAutoReleaseWakeLockTime; + // Flag to indicate if a wake lock has been acquired + bool mHasWakeLock; }; } // namespace sensors -- GitLab From 6d8e49a05e97924b687d0d8114470b36c5fde29c Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Thu, 23 Dec 2021 16:41:58 -0800 Subject: [PATCH 379/825] Convert hidl_bitfield and bitfield to int The previous API surface replaced bitfields of enums with the enum, which only allows one value at a time. Instead of using the enum, replace with int instead. Test: build Bug: 210712359 Change-Id: I2963200311494718ae89af8deade0b1dd41354f8 --- .../hardware/radio/data/DataProfileInfo.aidl | 4 +- .../hardware/radio/modem/RadioCapability.aidl | 2 +- .../hardware/radio/network/IRadioNetwork.aidl | 4 +- .../network/IRadioNetworkIndication.aidl | 2 +- .../radio/network/IRadioNetworkResponse.aidl | 2 +- .../hardware/radio/voice/EmergencyNumber.aidl | 2 +- .../hardware/radio/voice/IRadioVoice.aidl | 2 +- .../hardware/radio/data/DataProfileInfo.aidl | 4 +- .../hardware/radio/modem/RadioCapability.aidl | 2 +- .../hardware/radio/network/IRadioNetwork.aidl | 4 +- .../network/IRadioNetworkIndication.aidl | 6 +-- .../radio/network/IRadioNetworkResponse.aidl | 3 +- .../hardware/radio/voice/EmergencyNumber.aidl | 2 +- .../hardware/radio/voice/IRadioVoice.aidl | 6 +-- .../include/libradiocompat/RadioNetwork.h | 9 ++-- .../include/libradiocompat/RadioVoice.h | 3 +- .../compat/libradiocompat/modem/structs.cpp | 3 +- .../network/RadioIndication-network.cpp | 4 +- .../libradiocompat/network/RadioNetwork.cpp | 5 +-- .../network/RadioResponse-network.cpp | 7 +--- .../libradiocompat/voice/RadioVoice.cpp | 2 +- .../compat/libradiocompat/voice/structs.cpp | 2 +- radio/aidl/vts/radio_data_test.cpp | 42 ++++++++++++------- radio/aidl/vts/radio_network_indication.cpp | 2 +- radio/aidl/vts/radio_network_response.cpp | 2 +- radio/aidl/vts/radio_network_test.cpp | 5 ++- radio/aidl/vts/radio_network_utils.h | 6 +-- radio/aidl/vts/radio_voice_test.cpp | 7 ++-- 28 files changed, 75 insertions(+), 69 deletions(-) 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 334261965c..c8efea02d0 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 @@ -46,8 +46,8 @@ parcelable DataProfileInfo { int maxConns; int waitTime; boolean enabled; - android.hardware.radio.data.ApnTypes supportedApnTypesBitmap; - android.hardware.radio.RadioAccessFamily bearerBitmap; + int supportedApnTypesBitmap; + int bearerBitmap; int mtuV4; int mtuV6; boolean preferred; 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 d5716acf40..5aaf5a7303 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 @@ -36,7 +36,7 @@ package android.hardware.radio.modem; parcelable RadioCapability { int session; int phase; - android.hardware.radio.RadioAccessFamily raf; + int raf; String logicalModemUuid; int status; const int PHASE_CONFIGURED = 0; 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 c6187913dd..2b70e45084 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 @@ -50,12 +50,12 @@ interface IRadioNetwork { oneway void getVoiceRegistrationState(in int serial); oneway void isNrDualConnectivityEnabled(in int serial); oneway void responseAcknowledgement(); - oneway void setAllowedNetworkTypesBitmap(in int serial, in android.hardware.radio.RadioAccessFamily networkTypeBitmap); + oneway void setAllowedNetworkTypesBitmap(in int serial, in int networkTypeBitmap); oneway void setBandMode(in int serial, in android.hardware.radio.network.RadioBandMode mode); oneway void setBarringPassword(in int serial, in String facility, in String oldPassword, in String newPassword); oneway void setCdmaRoamingPreference(in int serial, in android.hardware.radio.network.CdmaRoamingType type); oneway void setCellInfoListRate(in int serial, in int rate); - oneway void setIndicationFilter(in int serial, in android.hardware.radio.network.IndicationFilter indicationFilter); + oneway void setIndicationFilter(in int serial, in int indicationFilter); oneway void setLinkCapacityReportingCriteria(in int serial, in int hysteresisMs, in int hysteresisDlKbps, in int hysteresisUlKbps, in int[] thresholdsDownlinkKbps, in int[] thresholdsUplinkKbps, in android.hardware.radio.AccessNetwork accessNetwork); oneway void setLocationUpdates(in int serial, in boolean enable); oneway void setNetworkSelectionModeAutomatic(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 d135a69ecc..bd03c51ec7 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 @@ -44,7 +44,7 @@ interface IRadioNetworkIndication { oneway void networkScanResult(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.NetworkScanResult result); oneway void networkStateChanged(in android.hardware.radio.RadioIndicationType type); oneway void nitzTimeReceived(in android.hardware.radio.RadioIndicationType type, in String nitzTime, in long receivedTimeMs, in long ageMs); - oneway void registrationFailed(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.CellIdentity cellIdentity, in String chosenPlmn, in android.hardware.radio.network.Domain domain, in int causeCode, in int additionalCauseCode); + oneway void registrationFailed(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.CellIdentity cellIdentity, in String chosenPlmn, in int domain, in int causeCode, in int additionalCauseCode); oneway void restrictedStateChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.PhoneRestrictedState state); 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); 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 8cf4c31149..5f6c7369f4 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 @@ -35,7 +35,7 @@ package android.hardware.radio.network; @VintfStability interface IRadioNetworkResponse { oneway void acknowledgeRequest(in int serial); - oneway void getAllowedNetworkTypesBitmapResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.RadioAccessFamily networkTypeBitmap); + oneway void getAllowedNetworkTypesBitmapResponse(in android.hardware.radio.RadioResponseInfo info, in int networkTypeBitmap); oneway void getAvailableBandModesResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.RadioBandMode[] bandModes); oneway void getAvailableNetworksResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.OperatorInfo[] networkInfos); oneway void getBarringInfoResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.CellIdentity cellIdentity, in android.hardware.radio.network.BarringInfo[] barringInfos); 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 4f415ee3a2..39bcf1a20e 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 @@ -37,7 +37,7 @@ parcelable EmergencyNumber { String number; String mcc; String mnc; - android.hardware.radio.voice.EmergencyServiceCategory categories; + int categories; String[] urns; int sources; const int SOURCE_NETWORK_SIGNALING = 1; 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 68c82fa4f8..34d155aa79 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 @@ -37,7 +37,7 @@ interface IRadioVoice { oneway void acceptCall(in int serial); oneway void conference(in int serial); oneway void dial(in int serial, in android.hardware.radio.voice.Dial dialInfo); - oneway void emergencyDial(in int serial, in android.hardware.radio.voice.Dial dialInfo, in android.hardware.radio.voice.EmergencyServiceCategory categories, in String[] urns, in android.hardware.radio.voice.EmergencyCallRouting routing, in boolean hasKnownUserIntentEmergency, in boolean isTesting); + oneway void emergencyDial(in int serial, in android.hardware.radio.voice.Dial dialInfo, in int categories, in String[] urns, in android.hardware.radio.voice.EmergencyCallRouting routing, in boolean hasKnownUserIntentEmergency, in boolean isTesting); oneway void exitEmergencyCallbackMode(in int serial); oneway void explicitCallTransfer(in int serial); oneway void getCallForwardStatus(in int serial, in android.hardware.radio.voice.CallForwardInfo callInfo); diff --git a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl index 0f061191fd..7360202aaf 100644 --- a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl +++ b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl @@ -93,11 +93,11 @@ parcelable DataProfileInfo { /** * Supported APN types bitmap. See ApnTypes for the value of each bit. */ - ApnTypes supportedApnTypesBitmap; + int supportedApnTypesBitmap; /** * The bearer bitmap. See RadioAccessFamily for the value of each bit. */ - RadioAccessFamily bearerBitmap; + int bearerBitmap; /** * Maximum transmission unit (MTU) size in bytes for IPv4. */ diff --git a/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl b/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl index b7b8ef3552..9bd5f21a7f 100644 --- a/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl +++ b/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl @@ -71,7 +71,7 @@ parcelable RadioCapability { /** * 32-bit bitmap of RadioAccessFamily. */ - RadioAccessFamily raf; + int raf; /** * A UUID typically "com.xxxx.lmX" where X is the logical modem. * RadioConst:MAX_UUID_LENGTH is the max length. diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl index aaf432aaaa..7a22a9a68f 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl @@ -195,7 +195,7 @@ oneway interface IRadioNetwork { * * Response function is IRadioNetworkResponse.setAllowedNetworkTypesBitmapResponse() */ - void setAllowedNetworkTypesBitmap(in int serial, in RadioAccessFamily networkTypeBitmap); + void setAllowedNetworkTypesBitmap(in int serial, in int networkTypeBitmap); /** * Assign a specified band for RF configuration. @@ -253,7 +253,7 @@ oneway interface IRadioNetwork { * * Response function is IRadioNetworkResponse.setIndicationFilterResponse() */ - void setIndicationFilter(in int serial, in IndicationFilter indicationFilter); + void setIndicationFilter(in int serial, in int indicationFilter); /** * Sets the link capacity reporting criteria. The resulting reporting criteria are the AND of diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl index ba7610dfbd..6863ac3acd 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl @@ -136,8 +136,8 @@ oneway interface IRadioNetworkIndication { * include the time spend in sleep / low power states. If it can not be guaranteed, * there must not be any caching done at the modem and should fill in 0 for ageMs */ - void nitzTimeReceived(in RadioIndicationType type, in String nitzTime, - in long receivedTimeMs, in long ageMs); + void nitzTimeReceived( + in RadioIndicationType type, in String nitzTime, in long receivedTimeMs, in long ageMs); /** * Report that Registration or a Location/Routing/Tracking Area update has failed. @@ -165,7 +165,7 @@ oneway interface IRadioNetworkIndication { * MAX_INT if this value is unused. */ void registrationFailed(in RadioIndicationType type, in CellIdentity cellIdentity, - in String chosenPlmn, in Domain domain, in int causeCode, in int additionalCauseCode); + in String chosenPlmn, in int domain, in int causeCode, in int additionalCauseCode); /** * Indicates a restricted state change (eg, for Domain Specific Access Control). diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl index 30f422101b..e650321ef9 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl @@ -62,8 +62,7 @@ oneway interface IRadioNetworkResponse { * RadioError:REQUEST_NOT_SUPPORTED * RadioError:NO_RESOURCES */ - void getAllowedNetworkTypesBitmapResponse( - in RadioResponseInfo info, in RadioAccessFamily networkTypeBitmap); + void getAllowedNetworkTypesBitmapResponse(in RadioResponseInfo info, in int networkTypeBitmap); /** * @param info Response info struct containing response type, serial no. and error diff --git a/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl b/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl index aa4dde2893..ddc5d765a0 100644 --- a/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl +++ b/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl @@ -78,7 +78,7 @@ parcelable EmergencyNumber { * The bitfield of EmergencyServiceCategory(s). See EmergencyServiceCategory for the value of * each bit. */ - EmergencyServiceCategory categories; + int categories; /** * The list of emergency Uniform Resource Names (URN). */ diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl index a012be4515..b25e63dff6 100644 --- a/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl +++ b/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl @@ -117,9 +117,9 @@ oneway interface IRadioVoice { * * Response function is IRadioVoiceResponse.emergencyDialResponse() */ - void emergencyDial(in int serial, in Dial dialInfo, in EmergencyServiceCategory categories, - in String[] urns, in EmergencyCallRouting routing, - in boolean hasKnownUserIntentEmergency, in boolean isTesting); + void emergencyDial(in int serial, in Dial dialInfo, in int categories, in String[] urns, + in EmergencyCallRouting routing, in boolean hasKnownUserIntentEmergency, + in boolean isTesting); /** * Request the radio's system selection module to exit emergency callback mode. Radio must not diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h index ec76300f6c..1731b78851 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h @@ -41,9 +41,8 @@ class RadioNetwork : public RadioCompatBase, ::ndk::ScopedAStatus getVoiceRegistrationState(int32_t serial) override; ::ndk::ScopedAStatus isNrDualConnectivityEnabled(int32_t serial) override; ::ndk::ScopedAStatus responseAcknowledgement() override; - ::ndk::ScopedAStatus setAllowedNetworkTypesBitmap( - int32_t serial, - ::aidl::android::hardware::radio::RadioAccessFamily networkTypeBitmap) override; + ::ndk::ScopedAStatus setAllowedNetworkTypesBitmap(int32_t serial, + int32_t networkTypeBitmap) override; ::ndk::ScopedAStatus setBandMode( int32_t serial, ::aidl::android::hardware::radio::network::RadioBandMode mode) override; ::ndk::ScopedAStatus setBarringPassword(int32_t serial, const std::string& facility, @@ -53,9 +52,7 @@ class RadioNetwork : public RadioCompatBase, int32_t serial, ::aidl::android::hardware::radio::network::CdmaRoamingType type) override; ::ndk::ScopedAStatus setCellInfoListRate(int32_t serial, int32_t rate) override; - ::ndk::ScopedAStatus setIndicationFilter( - int32_t serial, - ::aidl::android::hardware::radio::network::IndicationFilter indicationFilter) override; + ::ndk::ScopedAStatus setIndicationFilter(int32_t serial, int32_t indicationFilter) override; ::ndk::ScopedAStatus setLinkCapacityReportingCriteria( int32_t serial, int32_t hysteresisMs, int32_t hysteresisDlKbps, int32_t hysteresisUlKbps, const std::vector& thresholdsDownlinkKbps, diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h index 5839e3a774..a0e1e82f5f 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h @@ -31,8 +31,7 @@ class RadioVoice : public RadioCompatBase, int32_t serial, const ::aidl::android::hardware::radio::voice::Dial& dialInfo) override; ::ndk::ScopedAStatus emergencyDial( int32_t serial, const ::aidl::android::hardware::radio::voice::Dial& dialInfo, - ::aidl::android::hardware::radio::voice::EmergencyServiceCategory categories, - const std::vector& urns, + int32_t categories, const std::vector& urns, ::aidl::android::hardware::radio::voice::EmergencyCallRouting routing, bool hasKnownUserIntentEmergency, bool isTesting) override; ::ndk::ScopedAStatus exitEmergencyCallbackMode(int32_t serial) override; diff --git a/radio/aidl/compat/libradiocompat/modem/structs.cpp b/radio/aidl/compat/libradiocompat/modem/structs.cpp index 53d575347b..69e651be42 100644 --- a/radio/aidl/compat/libradiocompat/modem/structs.cpp +++ b/radio/aidl/compat/libradiocompat/modem/structs.cpp @@ -25,7 +25,6 @@ namespace android::hardware::radio::compat { using ::aidl::android::hardware::radio::AccessNetwork; -using ::aidl::android::hardware::radio::RadioAccessFamily; using ::aidl::android::hardware::radio::RadioTechnology; namespace aidl = ::aidl::android::hardware::radio::modem; @@ -40,7 +39,7 @@ aidl::RadioCapability toAidl(const V1_0::RadioCapability& capa) { return { .session = capa.session, .phase = static_cast(capa.phase), - .raf = RadioAccessFamily(capa.raf), + .raf = static_cast(capa.raf), .logicalModemUuid = capa.logicalModemUuid, .status = static_cast(capa.status), }; diff --git a/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp b/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp index d4cbdbcf5b..4eb99f7486 100644 --- a/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp +++ b/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp @@ -208,8 +208,8 @@ Return RadioIndication::registrationFailed( // const hidl_string& chosenPlmn, hidl_bitfield domain, int32_t causeCode, int32_t additionalCauseCode) { LOG_CALL << type; - networkCb()->registrationFailed(toAidl(type), toAidl(cellIdentity), chosenPlmn, - aidl::Domain(domain), causeCode, additionalCauseCode); + networkCb()->registrationFailed(toAidl(type), toAidl(cellIdentity), chosenPlmn, domain, + causeCode, additionalCauseCode); return {}; } diff --git a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp index 8bfa0bbbb2..d3b600221f 100644 --- a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp +++ b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp @@ -28,7 +28,6 @@ namespace android::hardware::radio::compat { using ::aidl::android::hardware::radio::AccessNetwork; -using ::aidl::android::hardware::radio::RadioAccessFamily; using ::ndk::ScopedAStatus; namespace aidl = ::aidl::android::hardware::radio::network; constexpr auto ok = &ScopedAStatus::ok; @@ -161,7 +160,7 @@ ScopedAStatus RadioNetwork::responseAcknowledgement() { return ok(); } -ScopedAStatus RadioNetwork::setAllowedNetworkTypesBitmap(int32_t serial, RadioAccessFamily ntype) { +ScopedAStatus RadioNetwork::setAllowedNetworkTypesBitmap(int32_t serial, int32_t ntype) { LOG_CALL << serial; const auto raf = toHidlBitfield(ntype); if (mHal1_6) { @@ -197,7 +196,7 @@ ScopedAStatus RadioNetwork::setCellInfoListRate(int32_t serial, int32_t rate) { return ok(); } -ScopedAStatus RadioNetwork::setIndicationFilter(int32_t serial, aidl::IndicationFilter indFilter) { +ScopedAStatus RadioNetwork::setIndicationFilter(int32_t serial, int32_t indFilter) { LOG_CALL << serial; mHal1_5->setIndicationFilter_1_5(serial, toHidlBitfield(indFilter)); return ok(); diff --git a/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp b/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp index bab1d4a30d..5a98eb223c 100644 --- a/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp +++ b/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp @@ -27,7 +27,6 @@ namespace android::hardware::radio::compat { -using ::aidl::android::hardware::radio::RadioAccessFamily; using ::aidl::android::hardware::radio::RadioTechnology; using ::aidl::android::hardware::radio::RadioTechnologyFamily; namespace aidl = ::aidl::android::hardware::radio::network; @@ -44,16 +43,14 @@ Return RadioResponse::getAllowedNetworkTypesBitmapResponse( const V1_6::RadioResponseInfo& info, hidl_bitfield networkTypeBitmap) { LOG_CALL << info.serial; - networkCb()->getAllowedNetworkTypesBitmapResponse(toAidl(info), - RadioAccessFamily(networkTypeBitmap)); + networkCb()->getAllowedNetworkTypesBitmapResponse(toAidl(info), networkTypeBitmap); return {}; } Return RadioResponse::getPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info, V1_0::PreferredNetworkType nwType) { LOG_CALL << info.serial; - networkCb()->getAllowedNetworkTypesBitmapResponse( // - toAidl(info), RadioAccessFamily(getRafFromNetworkType(nwType))); + networkCb()->getAllowedNetworkTypesBitmapResponse(toAidl(info), getRafFromNetworkType(nwType)); return {}; } diff --git a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp index 7b1d1fa01e..71d1a568a4 100644 --- a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp +++ b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp @@ -53,7 +53,7 @@ ScopedAStatus RadioVoice::dial(int32_t serial, const aidl::Dial& dialInfo) { } ScopedAStatus RadioVoice::emergencyDial( // - int32_t serial, const aidl::Dial& info, aidl::EmergencyServiceCategory categories, + int32_t serial, const aidl::Dial& info, int32_t categories, const std::vector& urns, aidl::EmergencyCallRouting routing, bool knownUserIntentEmerg, bool isTesting) { LOG_CALL << serial; diff --git a/radio/aidl/compat/libradiocompat/voice/structs.cpp b/radio/aidl/compat/libradiocompat/voice/structs.cpp index ae6342e5be..254ea20c42 100644 --- a/radio/aidl/compat/libradiocompat/voice/structs.cpp +++ b/radio/aidl/compat/libradiocompat/voice/structs.cpp @@ -147,7 +147,7 @@ aidl::EmergencyNumber toAidl(const V1_4::EmergencyNumber& num) { .number = num.number, .mcc = num.mcc, .mnc = num.mnc, - .categories = aidl::EmergencyServiceCategory(num.categories), + .categories = num.categories, .urns = toAidl(num.urns), .sources = num.sources, }; diff --git a/radio/aidl/vts/radio_data_test.cpp b/radio/aidl/vts/radio_data_test.cpp index dbf0eb7ec3..87521cc057 100644 --- a/radio/aidl/vts/radio_data_test.cpp +++ b/radio/aidl/vts/radio_data_test.cpp @@ -14,10 +14,11 @@ * limitations under the License. */ +#include #include +#include #include #include -#include #include "radio_data_utils.h" @@ -82,10 +83,18 @@ TEST_P(RadioDataTest, setupDataCall) { dataProfileInfo.maxConns = 20; dataProfileInfo.waitTime = 0; dataProfileInfo.enabled = true; - // TODO(b/210712359): 320 was the previous value; need to support bitmaps - dataProfileInfo.supportedApnTypesBitmap = ApnTypes::DEFAULT; - // TODO(b/210712359): 161543 was the previous value; need to support bitmaps - dataProfileInfo.bearerBitmap = RadioAccessFamily::LTE; + dataProfileInfo.supportedApnTypesBitmap = + static_cast(ApnTypes::IMS) | static_cast(ApnTypes::IA); + dataProfileInfo.bearerBitmap = static_cast(RadioAccessFamily::GPRS) | + static_cast(RadioAccessFamily::EDGE) | + static_cast(RadioAccessFamily::UMTS) | + static_cast(RadioAccessFamily::HSDPA) | + static_cast(RadioAccessFamily::HSUPA) | + static_cast(RadioAccessFamily::HSPA) | + static_cast(RadioAccessFamily::EHRPD) | + static_cast(RadioAccessFamily::LTE) | + static_cast(RadioAccessFamily::HSPAP) | + static_cast(RadioAccessFamily::IWLAN); dataProfileInfo.mtuV4 = 0; dataProfileInfo.mtuV6 = 0; dataProfileInfo.preferred = true; @@ -130,11 +139,8 @@ TEST_P(RadioDataTest, setupDataCall_osAppId) { TrafficDescriptor trafficDescriptor; OsAppId osAppId; std::string osAppIdString("osAppId"); - // TODO(b/210712359): there should be a cleaner way to convert this - std::vector output(osAppIdString.length()); - std::transform(osAppIdString.begin(), osAppIdString.end(), output.begin(), - [](char c) { return static_cast(c); }); - osAppId.osAppId = output; + std::vector osAppIdVec(osAppIdString.begin(), osAppIdString.end()); + osAppId.osAppId = osAppIdVec; trafficDescriptor.osAppId = osAppId; DataProfileInfo dataProfileInfo; @@ -151,10 +157,18 @@ TEST_P(RadioDataTest, setupDataCall_osAppId) { dataProfileInfo.maxConns = 20; dataProfileInfo.waitTime = 0; dataProfileInfo.enabled = true; - // TODO(b/210712359): 320 was the previous value; need to support bitmaps - dataProfileInfo.supportedApnTypesBitmap = ApnTypes::DEFAULT; - // TODO(b/210712359): 161543 was the previous value; need to support bitmaps - dataProfileInfo.bearerBitmap = RadioAccessFamily::LTE; + dataProfileInfo.supportedApnTypesBitmap = + static_cast(ApnTypes::IMS) | static_cast(ApnTypes::IA); + dataProfileInfo.bearerBitmap = static_cast(RadioAccessFamily::GPRS) | + static_cast(RadioAccessFamily::EDGE) | + static_cast(RadioAccessFamily::UMTS) | + static_cast(RadioAccessFamily::HSDPA) | + static_cast(RadioAccessFamily::HSUPA) | + static_cast(RadioAccessFamily::HSPA) | + static_cast(RadioAccessFamily::EHRPD) | + static_cast(RadioAccessFamily::LTE) | + static_cast(RadioAccessFamily::HSPAP) | + static_cast(RadioAccessFamily::IWLAN); dataProfileInfo.mtuV4 = 0; dataProfileInfo.mtuV6 = 0; dataProfileInfo.preferred = true; diff --git a/radio/aidl/vts/radio_network_indication.cpp b/radio/aidl/vts/radio_network_indication.cpp index 7bed7593a6..03caf3bbf5 100644 --- a/radio/aidl/vts/radio_network_indication.cpp +++ b/radio/aidl/vts/radio_network_indication.cpp @@ -72,7 +72,7 @@ ndk::ScopedAStatus RadioNetworkIndication::nitzTimeReceived(RadioIndicationType ndk::ScopedAStatus RadioNetworkIndication::registrationFailed(RadioIndicationType /*type*/, const CellIdentity& /*cellIdentity*/, const std::string& /*chosenPlmn*/, - Domain /*domain*/, + int32_t /*domain*/, int32_t /*causeCode*/, int32_t /*additionalCauseCode*/) { return ndk::ScopedAStatus::ok(); diff --git a/radio/aidl/vts/radio_network_response.cpp b/radio/aidl/vts/radio_network_response.cpp index b242341960..dc40e6f916 100644 --- a/radio/aidl/vts/radio_network_response.cpp +++ b/radio/aidl/vts/radio_network_response.cpp @@ -23,7 +23,7 @@ ndk::ScopedAStatus RadioNetworkResponse::acknowledgeRequest(int32_t /*serial*/) } ndk::ScopedAStatus RadioNetworkResponse::getAllowedNetworkTypesBitmapResponse( - const RadioResponseInfo& info, const RadioAccessFamily networkTypeBitmap) { + const RadioResponseInfo& info, const int32_t networkTypeBitmap) { rspInfo = info; networkTypeBitmapResponse = networkTypeBitmap; parent_network.notify(info.serial); diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp index 1cdbb6dca8..08af636c90 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include #include #include @@ -57,7 +58,7 @@ void RadioNetworkTest::SetUp() { */ TEST_P(RadioNetworkTest, setAllowedNetworkTypesBitmap) { serial = GetRandomSerialNumber(); - RadioAccessFamily allowedNetworkTypesBitmap = RadioAccessFamily::LTE; + int32_t allowedNetworkTypesBitmap = static_cast(RadioAccessFamily::LTE); radio_network->setAllowedNetworkTypesBitmap(serial, allowedNetworkTypesBitmap); @@ -77,7 +78,7 @@ TEST_P(RadioNetworkTest, setAllowedNetworkTypesBitmap) { */ TEST_P(RadioNetworkTest, getAllowedNetworkTypesBitmap) { serial = GetRandomSerialNumber(); - RadioAccessFamily allowedNetworkTypesBitmap = RadioAccessFamily::LTE; + int32_t allowedNetworkTypesBitmap = static_cast(RadioAccessFamily::LTE); radio_network->setAllowedNetworkTypesBitmap(serial, allowedNetworkTypesBitmap); diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h index caa1ecc62a..79367215eb 100644 --- a/radio/aidl/vts/radio_network_utils.h +++ b/radio/aidl/vts/radio_network_utils.h @@ -39,7 +39,7 @@ class RadioNetworkResponse : public BnRadioNetworkResponse { std::vector radioBandModes; std::vector networkInfos; bool isNrDualConnectivityEnabled; - RadioAccessFamily networkTypeBitmapResponse; + int networkTypeBitmapResponse; RegStateResult regStateResp; CellIdentity barringCellIdentity; std::vector barringInfos; @@ -48,7 +48,7 @@ class RadioNetworkResponse : public BnRadioNetworkResponse { virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; virtual ndk::ScopedAStatus getAllowedNetworkTypesBitmapResponse( - const RadioResponseInfo& info, const RadioAccessFamily networkTypeBitmap) override; + const RadioResponseInfo& info, const int32_t networkTypeBitmap) override; virtual ndk::ScopedAStatus getAvailableBandModesResponse( const RadioResponseInfo& info, const std::vector& bandModes) override; @@ -187,7 +187,7 @@ class RadioNetworkIndication : public BnRadioNetworkIndication { virtual ndk::ScopedAStatus registrationFailed(RadioIndicationType type, const CellIdentity& cellIdentity, - const std::string& chosenPlmn, Domain domain, + const std::string& chosenPlmn, int32_t domain, int32_t causeCode, int32_t additionalCauseCode) override; diff --git a/radio/aidl/vts/radio_voice_test.cpp b/radio/aidl/vts/radio_voice_test.cpp index 201f14c2d9..7a0bedd3ee 100644 --- a/radio/aidl/vts/radio_voice_test.cpp +++ b/radio/aidl/vts/radio_voice_test.cpp @@ -15,6 +15,7 @@ */ #include +#include #include #include @@ -95,7 +96,7 @@ TEST_P(RadioVoiceTest, emergencyDial) { Dial dialInfo; dialInfo.address = std::string("911"); - EmergencyServiceCategory categories = EmergencyServiceCategory::UNSPECIFIED; + int32_t categories = static_cast(EmergencyServiceCategory::UNSPECIFIED); std::vector urns = {""}; EmergencyCallRouting routing = EmergencyCallRouting::UNKNOWN; @@ -152,7 +153,7 @@ TEST_P(RadioVoiceTest, emergencyDial_withServices) { Dial dialInfo; dialInfo.address = std::string("911"); - EmergencyServiceCategory categories = EmergencyServiceCategory::AMBULANCE; + int32_t categories = static_cast(EmergencyServiceCategory::AMBULANCE); std::vector urns = {"urn:service:sos.ambulance"}; EmergencyCallRouting routing = EmergencyCallRouting::UNKNOWN; @@ -209,7 +210,7 @@ TEST_P(RadioVoiceTest, emergencyDial_withEmergencyRouting) { Dial dialInfo; dialInfo.address = std::string("911"); - EmergencyServiceCategory categories = EmergencyServiceCategory::UNSPECIFIED; + int32_t categories = static_cast(EmergencyServiceCategory::UNSPECIFIED); std::vector urns = {""}; EmergencyCallRouting routing = EmergencyCallRouting::EMERGENCY; -- GitLab From b09c752e53309fa27a9d42f857715156bf344aa1 Mon Sep 17 00:00:00 2001 From: Ji Soo Shin Date: Thu, 30 Dec 2021 13:13:56 +0100 Subject: [PATCH 380/825] Move libprotocan to hardware/interfaces/automotive domain Bug: 203756395 Change-Id: I4d0a1dcff2d6a974b40bccd403cecdc5cd03ac4f --- .../can/1.0/tools/libprotocan/Android.bp | 42 ++++ .../can/1.0/tools/libprotocan/Checksum.cpp | 28 +++ .../1.0/tools/libprotocan/MessageCounter.cpp | 61 +++++ .../can/1.0/tools/libprotocan/MessageDef.cpp | 62 +++++ .../1.0/tools/libprotocan/MessageInjector.cpp | 110 +++++++++ .../can/1.0/tools/libprotocan/Signal.cpp | 84 +++++++ .../include/libprotocan/Checksum.h | 37 +++ .../include/libprotocan/MessageCounter.h | 55 +++++ .../include/libprotocan/MessageDef.h | 69 ++++++ .../include/libprotocan/MessageInjector.h | 78 +++++++ .../libprotocan/include/libprotocan/Signal.h | 50 ++++ .../1.0/tools/libprotocan/tests/Android.bp | 39 ++++ .../tests/libprotocan_signal_test.cpp | 218 ++++++++++++++++++ 13 files changed, 933 insertions(+) create mode 100644 automotive/can/1.0/tools/libprotocan/Android.bp create mode 100644 automotive/can/1.0/tools/libprotocan/Checksum.cpp create mode 100644 automotive/can/1.0/tools/libprotocan/MessageCounter.cpp create mode 100644 automotive/can/1.0/tools/libprotocan/MessageDef.cpp create mode 100644 automotive/can/1.0/tools/libprotocan/MessageInjector.cpp create mode 100644 automotive/can/1.0/tools/libprotocan/Signal.cpp create mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/Checksum.h create mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageCounter.h create mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageDef.h create mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageInjector.h create mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/Signal.h create mode 100644 automotive/can/1.0/tools/libprotocan/tests/Android.bp create mode 100644 automotive/can/1.0/tools/libprotocan/tests/libprotocan_signal_test.cpp diff --git a/automotive/can/1.0/tools/libprotocan/Android.bp b/automotive/can/1.0/tools/libprotocan/Android.bp new file mode 100644 index 0000000000..76c238b046 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/Android.bp @@ -0,0 +1,42 @@ +// +// 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. +// + +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_library_static { + name: "libprotocan", + defaults: ["android.hardware.automotive.vehicle@2.0-protocan-defaults"], + vendor: true, + srcs: [ + "Checksum.cpp", + "MessageCounter.cpp", + "MessageDef.cpp", + "MessageInjector.cpp", + "Signal.cpp", + ], + export_include_dirs: ["include"], + + shared_libs: [ + "android.hardware.automotive.can@1.0", + ], +} diff --git a/automotive/can/1.0/tools/libprotocan/Checksum.cpp b/automotive/can/1.0/tools/libprotocan/Checksum.cpp new file mode 100644 index 0000000000..72fb0af1a7 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/Checksum.cpp @@ -0,0 +1,28 @@ +/* + * 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. + */ + +#include + +namespace android::hardware::automotive::protocan { + +Checksum::Checksum(Signal signal, formula f) : mSignal(signal), mFormula(f) {} + +void Checksum::update(can::V1_0::CanMessage& msg) const { + mSignal.set(msg, 0); + mSignal.set(msg, mFormula(msg) % (mSignal.maxValue + 1)); +} + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/MessageCounter.cpp b/automotive/can/1.0/tools/libprotocan/MessageCounter.cpp new file mode 100644 index 0000000000..ef9882fd8c --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/MessageCounter.cpp @@ -0,0 +1,61 @@ +/* + * 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. + */ + +#include + +#include + +namespace android::hardware::automotive::protocan { + +/** Whether to log counter state messages. */ +static constexpr bool kSuperVerbose = false; + +MessageCounter::MessageCounter(Signal signal) : upperBound(signal.maxValue + 1), mSignal(signal) {} + +Signal::value MessageCounter::next() const { + CHECK(mCurrent.has_value()) << "Counter not initialized. Did you call isReady?"; + return (*mCurrent + 1) % upperBound; +} + +void MessageCounter::read(const can::V1_0::CanMessage& msg) { + auto val = mSignal.get(msg); + + if (!mCurrent.has_value()) { + LOG(VERBOSE) << "Got first counter val of " << val; + mCurrent = val; + return; + } + + auto nextVal = next(); + if (nextVal == val) { + if constexpr (kSuperVerbose) { + LOG(VERBOSE) << "Got next counter val of " << nextVal; + } + mCurrent = nextVal; + } else { + LOG(DEBUG) << "Ignoring next counter val of " << val << ", waiting for " << nextVal; + } +} + +bool MessageCounter::isReady() const { return mCurrent.has_value(); } + +void MessageCounter::increment(can::V1_0::CanMessage& msg) { + auto newVal = next(); + mCurrent = newVal; + mSignal.set(msg, newVal); +} + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/MessageDef.cpp b/automotive/can/1.0/tools/libprotocan/MessageDef.cpp new file mode 100644 index 0000000000..23ce1df640 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/MessageDef.cpp @@ -0,0 +1,62 @@ +/* + * 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. + */ + +#include + +#include + +namespace android::hardware::automotive::protocan { + +using can::V1_0::CanMessage; +using can::V1_0::CanMessageId; + +MessageDef::MessageDef(CanMessageId id, uint16_t len, std::map signals, + std::optional counter, std::optional checksum) + : id(id), kLen(len), kSignals(std::move(signals)), kCounter(counter), kChecksum(checksum) {} + +const Signal& MessageDef::operator[](const std::string& signalName) const { + auto it = kSignals.find(signalName); + CHECK(it != kSignals.end()) << "Signal " << signalName << " doesn't exist"; + return it->second; +} + +CanMessage MessageDef::makeDefault() const { + CanMessage msg = {}; + msg.id = id; + msg.payload.resize(kLen); + + for (auto const& [name, signal] : kSignals) { + signal.setDefault(msg); + } + + return msg; +} + +MessageCounter MessageDef::makeCounter() const { + CHECK(kCounter.has_value()) << "Can't build a counter for message without such signal"; + return MessageCounter(*kCounter); +} + +void MessageDef::updateChecksum(can::V1_0::CanMessage& msg) const { + if (!kChecksum.has_value()) return; + kChecksum->update(msg); +} + +bool MessageDef::validate(const can::V1_0::CanMessage& msg) const { + return msg.payload.size() >= kLen; +} + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/MessageInjector.cpp b/automotive/can/1.0/tools/libprotocan/MessageInjector.cpp new file mode 100644 index 0000000000..7c45eaa025 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/MessageInjector.cpp @@ -0,0 +1,110 @@ +/* + * 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. + */ + +#include + +#include + +#include + +namespace android::hardware::automotive::protocan { + +/** Whether to log injected messages. */ +static constexpr bool kSuperVerbose = true; + +using namespace std::literals::chrono_literals; + +using can::V1_0::CanMessage; +using can::V1_0::CanMessageId; +using can::V1_0::ICanBus; +using can::V1_0::Result; + +MessageInjector::MessageInjector(MessageDef msgDef, + std::optional interMessageDelay) + : kMsgDef(std::move(msgDef)), + kInterMessageDelay(interMessageDelay), + mCounter(msgDef.makeCounter()) {} + +void MessageInjector::inject(const CanMessage& msg) { inject({msg}); } + +void MessageInjector::inject(const std::initializer_list msgs) { + std::lock_guard lock(mMessagesGuard); + for (const auto& msg : msgs) { + if constexpr (kSuperVerbose) { + LOG(VERBOSE) << "Message scheduled for injection: " << toString(msg); + } + + mMessages.push(msg); + } +} + +void MessageInjector::processQueueLocked(can::V1_0::ICanBus& bus) { + if (mMessages.empty() || !mCounter.isReady()) return; + + auto paddingMessagesCount = mCounter.upperBound - (mMessages.size() % mCounter.upperBound); + auto padMessage = kMsgDef.makeDefault(); + for (unsigned i = 0; i < paddingMessagesCount; i++) { + mMessages.push(padMessage); + } + + while (!mMessages.empty()) { + auto&& outMsg = mMessages.front(); + + mCounter.increment(outMsg); + kMsgDef.updateChecksum(outMsg); + + if constexpr (kSuperVerbose) { + LOG(VERBOSE) << "Injecting message: " << toString(outMsg); + } + auto result = bus.send(outMsg); + if (result != Result::OK) { + LOG(ERROR) << "Message injection failed: " << toString(result); + } + + mMessages.pop(); + + // This would block onReceive, but the class is not supposed to be used in production anyway + // (see MessageInjector docstring). + if (kInterMessageDelay.has_value()) { + std::this_thread::sleep_for(*kInterMessageDelay); + } + } +} + +void MessageInjector::onReceive(ICanBus& bus, const CanMessage& msg) { + if (!kMsgDef.validate(msg)) return; + + std::lock_guard lock(mMessagesGuard); + + mCounter.read(msg); + processQueueLocked(bus); +} + +MessageInjectorManager::MessageInjectorManager( + std::initializer_list> injectors) { + std::transform(injectors.begin(), injectors.end(), std::inserter(mInjectors, mInjectors.end()), + [](const std::shared_ptr& injector) { + return std::make_pair(injector->kMsgDef.id, std::move(injector)); + }); +} + +void MessageInjectorManager::onReceive(sp bus, const CanMessage& msg) { + auto it = mInjectors.find(msg.id); + if (it == mInjectors.end()) return; + it->second->onReceive(*bus, msg); +} + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/Signal.cpp b/automotive/can/1.0/tools/libprotocan/Signal.cpp new file mode 100644 index 0000000000..bc3e070ca1 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/Signal.cpp @@ -0,0 +1,84 @@ +/* + * 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. + */ + +#include + +#include + +namespace android::hardware::automotive::protocan { + +static uint8_t calculateLastByteMask(uint16_t start, uint8_t length) { + unsigned lastByteBits = (start + length) % 8; + unsigned lastBytePadding = (8 - lastByteBits) % 8; + return 0xFF >> lastBytePadding; +} + +static uint8_t calculateFirstByteMask(uint16_t firstByte, uint8_t firstBit, uint16_t lastByte, + uint8_t lastMask) { + uint8_t firstMask = 0xFF << firstBit; + if (firstByte == lastByte) firstMask &= lastMask; + return firstMask; +} + +Signal::Signal(uint16_t start, uint8_t length, value defVal) + : maxValue((1u << length) - 1), + kFirstByte(start / 8), + kFirstBit(start % 8), + kFirstByteBits(8 - kFirstBit), + kLastByte((start + length - 1) / 8), + kLastMask(calculateLastByteMask(start, length)), + kFirstMask(calculateFirstByteMask(kFirstByte, kFirstBit, kLastByte, kLastMask)), + kDefVal(defVal) { + CHECK(length > 0) << "Signal length must not be zero"; +} + +Signal::value Signal::get(const can::V1_0::CanMessage& msg) const { + CHECK(msg.payload.size() > kLastByte) + << "Message is too short. Did you call MessageDef::validate?"; + + Signal::value v = 0; + if (kLastByte != kFirstByte) v = kLastMask & msg.payload[kLastByte]; + + for (int i = kLastByte - 1; i > kFirstByte; i--) { + v = (v << 8) | msg.payload[i]; + } + + return (v << kFirstByteBits) | ((msg.payload[kFirstByte] & kFirstMask) >> kFirstBit); +} + +void Signal::set(can::V1_0::CanMessage& msg, Signal::value val) const { + CHECK(msg.payload.size() > kLastByte) + << "Signal requires message of length " << (kLastByte + 1) + << " which is beyond message length of " << msg.payload.size(); + + uint8_t firstByte = val << kFirstBit; + val >>= kFirstByteBits; + + msg.payload[kFirstByte] = (msg.payload[kFirstByte] & ~kFirstMask) | (firstByte & kFirstMask); + + for (int i = kFirstByte + 1; i < kLastByte; i++) { + msg.payload[i] = val & 0xFF; + val >>= 8; + } + + if (kLastByte != kFirstByte) { + msg.payload[kLastByte] = (msg.payload[kLastByte] & ~kLastMask) | (val & kLastMask); + } +} + +void Signal::setDefault(can::V1_0::CanMessage& msg) const { set(msg, kDefVal); } + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/Checksum.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/Checksum.h new file mode 100644 index 0000000000..ff1dc91a50 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/include/libprotocan/Checksum.h @@ -0,0 +1,37 @@ +/* + * 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. + */ + +#pragma once + +#include +#include + +namespace android::hardware::automotive::protocan { + +class Checksum { + public: + using formula = std::function; + + Checksum(Signal signal, formula f); + + void update(can::V1_0::CanMessage& msg) const; + + private: + const Signal mSignal; + const formula mFormula; +}; + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageCounter.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageCounter.h new file mode 100644 index 0000000000..56113be61f --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageCounter.h @@ -0,0 +1,55 @@ +/* + * 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. + */ + +#pragma once + +#include +#include + +namespace android::hardware::automotive::protocan { + +class MessageCounter { + public: + const Signal::value upperBound; + + MessageCounter(Signal signal); + + /** + * Parse CAN message sent by external ECU to determine current counter value. + */ + void read(const can::V1_0::CanMessage& msg); + + /** + * States whether current counter value is determined. + */ + bool isReady() const; + + /** + * Increment current counter value and set it in a new message. + * + * Caller must check isReady() at least once before calling this method. + */ + void increment(can::V1_0::CanMessage& msg); + + private: + const Signal mSignal; + + std::optional mCurrent = std::nullopt; + + Signal::value next() const; +}; + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageDef.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageDef.h new file mode 100644 index 0000000000..79b21e17b4 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageDef.h @@ -0,0 +1,69 @@ +/* + * 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. + */ + +#pragma once + +#include +#include +#include +#include + +namespace android::hardware::automotive::protocan { + +/** + * CAN message definition (not the actual message data). + * + * Describes static message properties (message ID, signals etc). + */ +class MessageDef { + public: + const can::V1_0::CanMessageId id; + + /** + * Create message definition. + * + * Currently only constant length messages are supported. + * + * \param id CAN message ID + * \param len CAN message length + * \param signals CAN signal definitions + * \param counter Designated CAN signal definition for message counter, if the message has one + * \param checksum Designated CAN signal definition for payload checksum, if the message has one + */ + MessageDef(can::V1_0::CanMessageId id, uint16_t len, std::map signals, + std::optional counter = std::nullopt, + std::optional checksum = std::nullopt); + + const Signal& operator[](const std::string& signalName) const; + + can::V1_0::CanMessage makeDefault() const; + MessageCounter makeCounter() const; + + void updateChecksum(can::V1_0::CanMessage& msg) const; + + /** + * Validate the message payload is large enough to hold all the signals. + */ + bool validate(const can::V1_0::CanMessage& msg) const; + +private: + const uint16_t kLen; + const std::map kSignals; + const std::optional kCounter; + const std::optional kChecksum; +}; + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageInjector.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageInjector.h new file mode 100644 index 0000000000..b0ea260640 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageInjector.h @@ -0,0 +1,78 @@ +/* + * 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. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include + +namespace android::hardware::automotive::protocan { + +class MessageInjectorManager; + +/** + * Injects CAN messages with a counter to an existing system. + * + * This class is NOT meant to use in production - there should be no need to inject counted CAN + * messages where the other sender is also broadcasting them. If this is the case, it may be a sign + * your CAN network needs a redesign. This tool is intended for use for testing and demo purposes. + */ +class MessageInjector { + public: + MessageInjector(MessageDef msgDef, std::optional interMessageDelay); + + void inject(const can::V1_0::CanMessage& msg); + void inject(const std::initializer_list msgs); + + private: + const MessageDef kMsgDef; + const std::optional kInterMessageDelay; + MessageCounter mCounter; + + mutable std::mutex mMessagesGuard; + std::queue mMessages GUARDED_BY(mMessagesGuard); + + void onReceive(can::V1_0::ICanBus& bus, const can::V1_0::CanMessage& msg); + void processQueueLocked(can::V1_0::ICanBus& bus); + + friend class MessageInjectorManager; + + DISALLOW_COPY_AND_ASSIGN(MessageInjector); +}; + +/** + * Routes intercepted messages to MessageInjector instances configured to handle specific CAN + * message (CAN message ID). Intercepted messages from other nodes in CAN network are used to read + * current counter value in order to spoof the next packet. + */ +class MessageInjectorManager { + public: + MessageInjectorManager(std::initializer_list> injectors); + + void onReceive(sp bus, const can::V1_0::CanMessage& msg); + + private: + std::map> mInjectors; + + DISALLOW_COPY_AND_ASSIGN(MessageInjectorManager); +}; + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/Signal.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/Signal.h new file mode 100644 index 0000000000..7c0f11933a --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/include/libprotocan/Signal.h @@ -0,0 +1,50 @@ +/* + * 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. + */ + +#pragma once + +#include +#include + +namespace android::hardware::automotive::protocan { + +/** + * TODO(twasilczyk): right now, only Little Endian signals are supported. + */ +class Signal { + public: + using value = uint64_t; + + const value maxValue; + + Signal(uint16_t start, uint8_t length, value defVal = 0); + + value get(const can::V1_0::CanMessage& msg) const; + void set(can::V1_0::CanMessage& msg, value val) const; + void setDefault(can::V1_0::CanMessage& msg) const; + + private: + const uint16_t kFirstByte; ///< Index of first byte that holds the signal + const uint8_t kFirstBit; ///< Index of first bit within first byte + const uint8_t kFirstByteBits; ///< How many bits of the first byte belong to the signal + const uint16_t kLastByte; ///< Index of last byte that holds the signal + const uint8_t kLastMask; ///< Bits of the last byte that belong to the signal + const uint8_t kFirstMask; ///< Bits of the first byte that belong to the signal + + const value kDefVal; +}; + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/tests/Android.bp b/automotive/can/1.0/tools/libprotocan/tests/Android.bp new file mode 100644 index 0000000000..251cc061cd --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/tests/Android.bp @@ -0,0 +1,39 @@ +// +// 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. +// + +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: "libprotocan_signal_test", + defaults: ["android.hardware.automotive.can@defaults"], + vendor: true, + gtest: true, + srcs: ["libprotocan_signal_test.cpp"], + static_libs: [ + "libprotocan", + ], + shared_libs: [ + "android.hardware.automotive.can@1.0", + "libhidlbase", + ], +} diff --git a/automotive/can/1.0/tools/libprotocan/tests/libprotocan_signal_test.cpp b/automotive/can/1.0/tools/libprotocan/tests/libprotocan_signal_test.cpp new file mode 100644 index 0000000000..19c12099e6 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/tests/libprotocan_signal_test.cpp @@ -0,0 +1,218 @@ +/* + * 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. + */ + +#include + +#include + +namespace android::hardware::automotive::protocan::unittest { + +TEST(SignalTest, TestGetSingleBytes) { + can::V1_0::CanMessage msg = {}; + msg.payload = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + for (unsigned i = 0; i < msg.payload.size(); i++) { + Signal signal(8 * i, 8); + ASSERT_EQ(i, signal.get(msg)); + } +} + +TEST(SignalTest, TestSetSingleBytes) { + std::vector msgs = {{}, {}, {}}; + msgs[0].payload = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; + msgs[1].payload = {0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB}; + msgs[2].payload = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + for (unsigned i = 0; i < msgs[0].payload.size(); i++) { + Signal signal(8 * i, 8); + + for (auto&& msgOriginal : msgs) { + auto msgModified = msgOriginal; + signal.set(msgModified, 0xBA); + + auto msgExpected = msgOriginal; + msgExpected.payload[i] = 0xBA; + + ASSERT_EQ(msgExpected, msgModified) << "i=" << i; + } + } +} + +TEST(SignalTest, TestGetStart4) { + /* Data generated with Python3: + * + * from cantools.database.can import * + * hex(Message(1, 'm', 4, [Signal('s', 4, 16, byte_order='little_endian')]). + * decode(b'\xde\xad\xbe\xef')['s']) + */ + + can::V1_0::CanMessage msg = {}; + msg.payload = {0xDE, 0xAD, 0xBE, 0xEF}; + can::V1_0::CanMessage msg2 = {}; + msg2.payload = {0xDE, 0xAD, 0xBE, 0xEF, 0xDE, 0xAD}; + + Signal s0_4(0, 4); + Signal s4_4(4, 4); + Signal s4_8(4, 8); + Signal s4_16(4, 16); + Signal s4_28(4, 28); + Signal s12_8(12, 8); + Signal s12_12(12, 12); + Signal s12_16(12, 16); + Signal s12_20(12, 20); + Signal s12_32(12, 32); + + ASSERT_EQ(0xEu, s0_4.get(msg)); + ASSERT_EQ(0xDu, s4_4.get(msg)); + ASSERT_EQ(0xDDu, s4_8.get(msg)); + ASSERT_EQ(0xEADDu, s4_16.get(msg)); + ASSERT_EQ(0xEFBEADDu, s4_28.get(msg)); + ASSERT_EQ(0xEAu, s12_8.get(msg)); + ASSERT_EQ(0xBEAu, s12_12.get(msg)); + ASSERT_EQ(0xFBEAu, s12_16.get(msg)); + ASSERT_EQ(0xEFBEAu, s12_20.get(msg)); + ASSERT_EQ(0xDDEEFBEAu, s12_32.get(msg2)); +} + +TEST(SignalTest, TestGet64) { + /* Data generated with Python3: + * + * from cantools.database.can import * + * hex(Message(1, 'm', 9, [Signal('s', 4, 64, byte_order='little_endian')]). + * decode(b'\xde\xad\xbe\xef\xab\xbc\xcd\xde\xef')['s']) + */ + + can::V1_0::CanMessage msg = {}; + msg.payload = {0xDE, 0xAD, 0xBE, 0xEF, 0xAB, 0xBC, 0xCD, 0xDE, 0xEF}; + + Signal s0_64(0, 64); + Signal s8_64(8, 64); + Signal s4_64(4, 64); + Signal s1_64(1, 64); + + ASSERT_EQ(0xDECDBCABEFBEADDEu, s0_64.get(msg)); + ASSERT_EQ(0xEFDECDBCABEFBEADu, s8_64.get(msg)); + ASSERT_EQ(0xFDECDBCABEFBEADDu, s4_64.get(msg)); + ASSERT_EQ(0xEF66DE55F7DF56EFu, s1_64.get(msg)); +} + +TEST(SignalTest, TestGetAllStarts) { + /* Data generated with Python3: + * + * from cantools.database.can import * + * hex(Message(1, 'm', 6, [Signal('s', 0, 20, byte_order='little_endian')]). + * decode(b'\xde\xad\xbe\xef\xde\xad')['s']) + */ + + std::map shifts = { + {0, 0xEADDEu}, {1, 0xF56EFu}, {2, 0xFAB77u}, {3, 0x7D5BBu}, {4, 0xBEADDu}, {5, 0xDF56Eu}, + {6, 0xEFAB7u}, {7, 0xF7D5Bu}, {8, 0xFBEADu}, {9, 0x7DF56u}, {10, 0xBEFABu}, {11, 0xDF7D5u}, + }; + + can::V1_0::CanMessage msg = {}; + msg.payload = {0xDE, 0xAD, 0xBE, 0xEF, 0xCC, 0xCC}; + + for (auto const& [start, expected] : shifts) { + Signal s(start, 20); + ASSERT_EQ(expected, s.get(msg)) << "shift of " << start << " failed"; + } +} + +TEST(SignalTest, TestSetStart4) { + /* Data generated with Python3: + * + * from cantools.database.can import * + * so=4 ; sl=8 + * md = Message(1, 'm', 4, [Signal('a1', 0, so), Signal('a2', so+sl, 32-so-sl), + * Signal('s', so, sl, byte_order='little_endian')]) + * m = md.decode(b'\xcc\xcc\xcc\xcc') + * m['s'] = 0xDE + * binascii.hexlify(md.encode(m)).upper() + */ + typedef struct { + int start; + int length; + Signal::value setValue; + hidl_vec payload; + } case_t; + + std::vector cases = { + {0, 4, 0xDu, {0xCD, 0xCC, 0xCC, 0xCC}}, {4, 4, 0xDu, {0xDC, 0xCC, 0xCC, 0xCC}}, + {4, 8, 0xDEu, {0xEC, 0xCD, 0xCC, 0xCC}}, {4, 16, 0xDEADu, {0xDC, 0xEA, 0xCD, 0xCC}}, + {4, 24, 0xDEADBEu, {0xEC, 0xDB, 0xEA, 0xCD}}, {4, 28, 0xDEADBEEu, {0xEC, 0xBE, 0xAD, 0xDE}}, + {12, 8, 0xDEu, {0xCC, 0xEC, 0xCD, 0xCC}}, {12, 12, 0xDEAu, {0xCC, 0xAC, 0xDE, 0xCC}}, + {12, 16, 0xDEADu, {0xCC, 0xDC, 0xEA, 0xCD}}, {12, 20, 0xDEADBu, {0xCC, 0xBC, 0xAD, 0xDE}}, + }; + + can::V1_0::CanMessage msg = {}; + msg.payload = {0xCC, 0xCC, 0xCC, 0xCC}; + + for (auto const& tcase : cases) { + Signal s(tcase.start, tcase.length); + + can::V1_0::CanMessage expectedMsg = {}; + expectedMsg.payload = tcase.payload; + + can::V1_0::CanMessage editedMsg = msg; + s.set(editedMsg, tcase.setValue); + + ASSERT_EQ(expectedMsg, editedMsg) << " set(" << tcase.start << ", " << tcase.length << ")"; + } +} + +TEST(SignalTest, TestSetAllStarts) { + /* Data generated with Python3: + * from cantools.database.can import * + * import binascii + * import textwrap + * + * length = 20 + * for start in range(0, 32 - length): + * signals = [Signal('s', start, length, byte_order='little_endian')] + * if start > 0: signals.append(Signal('a', 0, start, byte_order='little_endian')) + * signals.append(Signal('b', start + length, 32 - start - length, + * byte_order='little_endian')) + * + * md = Message(1, 'm', 4, signals) + * m = md.decode(b'\xcc\xcc\xcc\xcc') + * m['s'] = 0xDEADB + * out = binascii.hexlify(md.encode(m)).decode('ascii').upper() + * out = ', '.join(['0x{}'.format(v) for v in textwrap.wrap(out, 2)]) + * print('{{ {:d}, {{ {:s} }}}},'.format(start, out)) + */ + + std::map> shifts = { + {0, {0xDB, 0xEA, 0xCD, 0xCC}}, {1, {0xB6, 0xD5, 0xDB, 0xCC}}, {2, {0x6C, 0xAB, 0xF7, 0xCC}}, + {3, {0xDC, 0x56, 0xEF, 0xCC}}, {4, {0xBC, 0xAD, 0xDE, 0xCC}}, {5, {0x6C, 0x5B, 0xBD, 0xCD}}, + {6, {0xCC, 0xB6, 0x7A, 0xCF}}, {7, {0xCC, 0x6D, 0xF5, 0xCE}}, {8, {0xCC, 0xDB, 0xEA, 0xCD}}, + {9, {0xCC, 0xB6, 0xD5, 0xDB}}, {10, {0xCC, 0x6C, 0xAB, 0xF7}}, {11, {0xCC, 0xDC, 0x56, 0xEF}}, + }; + + can::V1_0::CanMessage msg = {}; + msg.payload = {0xCC, 0xCC, 0xCC, 0xCC}; + + for (auto const& [start, expectedPayload] : shifts) { + Signal s(start, 20); + + can::V1_0::CanMessage expectedMsg = {}; + expectedMsg.payload = expectedPayload; + + can::V1_0::CanMessage editedMsg = msg; + s.set(editedMsg, 0xDEADB); + + ASSERT_EQ(expectedMsg, editedMsg) << "shift of " << start << " failed"; + } +} + +} // namespace android::hardware::automotive::protocan::unittest -- GitLab From c83bce4cc9c073daa900b8af4b3525ad01e6d65e Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Wed, 29 Dec 2021 00:35:12 -0800 Subject: [PATCH 381/825] Finish IRadio 1.6/IRadioConfig 1.3 AIDL VTS Implement IRadioConfig VTS and helper methods Verify that VtsHalRadioTargetTest passes Bug: 210712359 Test: atest VtsHalRadioTargetTest Change-Id: Ic82ffd2feacc107e9b291ef3aab861d0c1496489 --- radio/aidl/vts/Android.bp | 3 + radio/aidl/vts/VtsHalRadioTargetTest.cpp | 7 ++ radio/aidl/vts/radio_aidl_hal_utils.cpp | 74 +++++++++++----- radio/aidl/vts/radio_aidl_hal_utils.h | 26 +++--- radio/aidl/vts/radio_config_indication.cpp | 24 ++++++ radio/aidl/vts/radio_config_response.cpp | 59 +++++++++++++ radio/aidl/vts/radio_config_test.cpp | 56 ++++++++++++ radio/aidl/vts/radio_config_utils.h | 86 +++++++++++++++++++ radio/aidl/vts/radio_data_indication.cpp | 2 +- radio/aidl/vts/radio_data_response.cpp | 2 +- radio/aidl/vts/radio_data_test.cpp | 15 ++-- radio/aidl/vts/radio_data_utils.h | 11 ++- radio/aidl/vts/radio_messaging_indication.cpp | 2 +- radio/aidl/vts/radio_messaging_response.cpp | 2 +- radio/aidl/vts/radio_messaging_test.cpp | 15 ++-- radio/aidl/vts/radio_messaging_utils.h | 11 ++- radio/aidl/vts/radio_modem_indication.cpp | 2 +- radio/aidl/vts/radio_modem_response.cpp | 2 +- radio/aidl/vts/radio_modem_test.cpp | 15 ++-- radio/aidl/vts/radio_modem_utils.h | 11 ++- radio/aidl/vts/radio_network_indication.cpp | 2 +- radio/aidl/vts/radio_network_response.cpp | 4 +- radio/aidl/vts/radio_network_test.cpp | 15 ++-- radio/aidl/vts/radio_network_utils.h | 12 +-- radio/aidl/vts/radio_sim_indication.cpp | 2 +- radio/aidl/vts/radio_sim_response.cpp | 2 +- radio/aidl/vts/radio_sim_test.cpp | 17 ++-- radio/aidl/vts/radio_sim_utils.h | 20 ++--- radio/aidl/vts/radio_voice_indication.cpp | 2 +- radio/aidl/vts/radio_voice_response.cpp | 2 +- radio/aidl/vts/radio_voice_test.cpp | 51 ++++++----- radio/aidl/vts/radio_voice_utils.h | 14 +-- 32 files changed, 432 insertions(+), 136 deletions(-) create mode 100644 radio/aidl/vts/radio_config_indication.cpp create mode 100644 radio/aidl/vts/radio_config_response.cpp create mode 100644 radio/aidl/vts/radio_config_test.cpp create mode 100644 radio/aidl/vts/radio_config_utils.h diff --git a/radio/aidl/vts/Android.bp b/radio/aidl/vts/Android.bp index 935d2e5077..8060e4bcc3 100644 --- a/radio/aidl/vts/Android.bp +++ b/radio/aidl/vts/Android.bp @@ -29,6 +29,9 @@ cc_test { ], srcs: [ "radio_aidl_hal_utils.cpp", + "radio_config_indication.cpp", + "radio_config_response.cpp", + "radio_config_test.cpp", "radio_data_indication.cpp", "radio_data_response.cpp", "radio_data_test.cpp", diff --git a/radio/aidl/vts/VtsHalRadioTargetTest.cpp b/radio/aidl/vts/VtsHalRadioTargetTest.cpp index e829f8e253..1ebc6afa8a 100644 --- a/radio/aidl/vts/VtsHalRadioTargetTest.cpp +++ b/radio/aidl/vts/VtsHalRadioTargetTest.cpp @@ -16,6 +16,7 @@ #include +#include "radio_config_utils.h" #include "radio_data_utils.h" #include "radio_messaging_utils.h" #include "radio_modem_utils.h" @@ -23,6 +24,12 @@ #include "radio_sim_utils.h" #include "radio_voice_utils.h" +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioConfigTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, RadioConfigTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IRadioConfig::descriptor)), + android::PrintInstanceNameToString); + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioDataTest); INSTANTIATE_TEST_SUITE_P( PerInstance, RadioDataTest, diff --git a/radio/aidl/vts/radio_aidl_hal_utils.cpp b/radio/aidl/vts/radio_aidl_hal_utils.cpp index 14a16c0f2b..dc61a3cfd3 100644 --- a/radio/aidl/vts/radio_aidl_hal_utils.cpp +++ b/radio/aidl/vts/radio_aidl_hal_utils.cpp @@ -18,12 +18,14 @@ #include "radio_aidl_hal_utils.h" #include #include "VtsCoreUtil.h" - -using namespace aidl::android::hardware::radio::network; +#include "radio_config_utils.h" +#include "radio_sim_utils.h" #define WAIT_TIMEOUT_PERIOD 75 -aidl::android::hardware::radio::sim::CardStatus cardStatus = {}; +sim::CardStatus cardStatus = {}; +int serial = 0; +int count_ = 0; int GetRandomSerialNumber() { return rand(); @@ -103,23 +105,33 @@ bool isVoiceEmergencyOnly(RegState state) { RegState::UNKNOWN_EM == state; } +bool stringEndsWith(std::string const& string, std::string const& end) { + if (string.size() >= end.size()) { + return (0 == string.compare(string.size() - end.size() - 1, end.size(), end)); + } else { + return false; + } +} + bool isServiceValidForDeviceConfiguration(std::string& serviceName) { if (isSsSsEnabled()) { // Device is configured as SSSS. - if (serviceName != RADIO_SERVICE_SLOT1_NAME) { + if (stringEndsWith(serviceName, RADIO_SERVICE_SLOT1_NAME)) { ALOGI("%s instance is not valid for SSSS device.", serviceName.c_str()); return false; } } else if (isDsDsEnabled()) { // Device is configured as DSDS. - if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME) { + if (!stringEndsWith(serviceName, RADIO_SERVICE_SLOT1_NAME) && + !stringEndsWith(serviceName, RADIO_SERVICE_SLOT2_NAME)) { ALOGI("%s instance is not valid for DSDS device.", serviceName.c_str()); return false; } } else if (isTsTsEnabled()) { // Device is configured as TSTS. - if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME && - serviceName != RADIO_SERVICE_SLOT3_NAME) { + if (!stringEndsWith(serviceName, RADIO_SERVICE_SLOT1_NAME) && + !stringEndsWith(serviceName, RADIO_SERVICE_SLOT2_NAME) && + !stringEndsWith(serviceName, RADIO_SERVICE_SLOT3_NAME)) { ALOGI("%s instance is not valid for TSTS device.", serviceName.c_str()); return false; } @@ -130,7 +142,7 @@ bool isServiceValidForDeviceConfiguration(std::string& serviceName) { /* * Notify that the response message is received. */ -void RadioResponseWaiter::notify(int receivedSerial) { +void RadioServiceTest::notify(int receivedSerial) { std::unique_lock lock(mtx_); if (serial == receivedSerial) { count_++; @@ -141,7 +153,7 @@ void RadioResponseWaiter::notify(int receivedSerial) { /* * Wait till the response message is notified or till WAIT_TIMEOUT_PERIOD. */ -std::cv_status RadioResponseWaiter::wait() { +std::cv_status RadioServiceTest::wait() { std::unique_lock lock(mtx_); std::cv_status status = std::cv_status::no_timeout; auto now = std::chrono::system_clock::now(); @@ -158,19 +170,37 @@ std::cv_status RadioResponseWaiter::wait() { /** * Specific features on the Radio HAL rely on Radio HAL Capabilities. * The VTS test related to those features must not run if the related capability is disabled. - * Typical usage within VTS: if (getRadioHalCapabilities()) return; + * Typical usage within VTS: + * if (getRadioHalCapabilities()) return; */ -bool RadioResponseWaiter::getRadioHalCapabilities() { - // TODO(b/210712359): implement after RadioConfig VTS is created - /** - // Get HalDeviceCapabilities from the radio config - std::shared_ptr radioConfigRsp = new (std::nothrow) - RadioConfigResponse(*this); radioConfig->setResponseFunctions(radioConfigRsp, nullptr); serial = - GetRandomSerialNumber(); - - radioConfig->getHalDeviceCapabilities(serial); +bool RadioServiceTest::getRadioHalCapabilities() { + // Get HalDeviceCapabilities from RadioConfig + std::shared_ptr radioConfigRsp = + ndk::SharedRefBase::make(*this); + std::shared_ptr radioConfigInd = + ndk::SharedRefBase::make(*this); + radio_config->setResponseFunctions(radioConfigRsp, radioConfigInd); + serial = GetRandomSerialNumber(); + radio_config->getHalDeviceCapabilities(serial); EXPECT_EQ(std::cv_status::no_timeout, wait()); return radioConfigRsp->modemReducedFeatureSet1; - **/ - return true; -} \ No newline at end of file +} + +/** + * Some VTS tests require the SIM card status to be present before running. + * Update the SIM card status, which can be accessed via the extern cardStatus. + */ +void RadioServiceTest::updateSimCardStatus() { + // Update CardStatus from RadioSim + std::shared_ptr radioSimRsp = + ndk::SharedRefBase::make(*this); + std::shared_ptr radioSimInd = + ndk::SharedRefBase::make(*this); + radio_sim->setResponseFunctions(radioSimRsp, radioSimInd); + serial = GetRandomSerialNumber(); + radio_sim->getIccCardStatus(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioSimRsp->rspInfo.type); + EXPECT_EQ(serial, radioSimRsp->rspInfo.serial); + EXPECT_EQ(RadioError::NONE, radioSimRsp->rspInfo.error); +} diff --git a/radio/aidl/vts/radio_aidl_hal_utils.h b/radio/aidl/vts/radio_aidl_hal_utils.h index 2f31fa80a5..414ffbc456 100644 --- a/radio/aidl/vts/radio_aidl_hal_utils.h +++ b/radio/aidl/vts/radio_aidl_hal_utils.h @@ -19,15 +19,20 @@ #include #include #include +#include #include #include +#include #include #include using namespace aidl::android::hardware::radio; +using aidl::android::hardware::radio::network::RegState; using aidl::android::hardware::radio::sim::CardStatus; extern CardStatus cardStatus; +extern int serial; +extern int count_; /* * MACRO used to skip test case when radio response return error REQUEST_NOT_SUPPORTED @@ -102,12 +107,12 @@ bool isTsTsEnabled(); /* * Check if voice status is in emergency only. */ -bool isVoiceEmergencyOnly(aidl::android::hardware::radio::network::RegState state); +bool isVoiceEmergencyOnly(RegState state); /* * Check if voice status is in service. */ -bool isVoiceInService(aidl::android::hardware::radio::network::RegState state); +bool isVoiceInService(RegState state); /* * Check if service is valid for device configuration @@ -115,26 +120,25 @@ bool isVoiceInService(aidl::android::hardware::radio::network::RegState state); bool isServiceValidForDeviceConfiguration(std::string& serviceName); /** - * Used when waiting for an asynchronous response from the HAL. + * RadioServiceTest base class */ -class RadioResponseWaiter { +class RadioServiceTest { protected: std::mutex mtx_; std::condition_variable cv_; - int count_; + std::shared_ptr radio_config; + std::shared_ptr radio_sim; public: - /* Serial number for radio request */ - int serial; - /* Used as a mechanism to inform the test about data/event callback */ void notify(int receivedSerial); /* Test code calls this function to wait for response */ std::cv_status wait(); - // TODO(b/210712359): this probably isn't the best place to put this, but it works for now - // since all RadioXTest extend RadioResponseWaiter - /* Used to get the radio HAL capabilities */ + /* Get the radio HAL capabilities */ bool getRadioHalCapabilities(); + + /* Update SIM card status */ + void updateSimCardStatus(); }; diff --git a/radio/aidl/vts/radio_config_indication.cpp b/radio/aidl/vts/radio_config_indication.cpp new file mode 100644 index 0000000000..a84c20b4b7 --- /dev/null +++ b/radio/aidl/vts/radio_config_indication.cpp @@ -0,0 +1,24 @@ +/* + * 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 "radio_config_utils.h" + +RadioConfigIndication::RadioConfigIndication(RadioServiceTest& parent) : parent_config(parent) {} + +ndk::ScopedAStatus RadioConfigIndication::simSlotsStatusChanged( + RadioIndicationType /*type*/, const std::vector& /*slotStatus*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_config_response.cpp b/radio/aidl/vts/radio_config_response.cpp new file mode 100644 index 0000000000..1a152fb712 --- /dev/null +++ b/radio/aidl/vts/radio_config_response.cpp @@ -0,0 +1,59 @@ +/* + * 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 "radio_config_utils.h" + +RadioConfigResponse::RadioConfigResponse(RadioServiceTest& parent) : parent_config(parent) {} + +ndk::ScopedAStatus RadioConfigResponse::getSimSlotsStatusResponse( + const RadioResponseInfo& /* info */, const std::vector& /* slotStatus */) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioConfigResponse::setSimSlotsMappingResponse( + const RadioResponseInfo& /* info */) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioConfigResponse::getPhoneCapabilityResponse( + const RadioResponseInfo& info, const PhoneCapability& phoneCapability) { + rspInfo = info; + phoneCap = phoneCapability; + parent_config.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioConfigResponse::setPreferredDataModemResponse( + const RadioResponseInfo& /* info */) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioConfigResponse::getNumOfLiveModemsResponse( + const RadioResponseInfo& /* info */, const int8_t /* numOfLiveModems */) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioConfigResponse::setNumOfLiveModemsResponse( + const RadioResponseInfo& /* info */) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus RadioConfigResponse::getHalDeviceCapabilitiesResponse( + const RadioResponseInfo& info, bool modemReducedFeatures) { + modemReducedFeatureSet1 = modemReducedFeatures; + parent_config.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp new file mode 100644 index 0000000000..2d7fe01575 --- /dev/null +++ b/radio/aidl/vts/radio_config_test.cpp @@ -0,0 +1,56 @@ +/* + * 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 +#include + +#include "radio_config_utils.h" + +#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) + +void RadioConfigTest::SetUp() { + std::string serviceName = GetParam(); + + if (!isServiceValidForDeviceConfiguration(serviceName)) { + ALOGI("Skipped the test due to device configuration."); + GTEST_SKIP(); + } + + radio_config = IRadioConfig::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); + ASSERT_NE(nullptr, radio_config.get()); + + radioRsp_config = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioRsp_config.get()); + + count_ = 0; + + radioInd_config = ndk::SharedRefBase::make(*this); + ASSERT_NE(nullptr, radioInd_config.get()); + + radio_config->setResponseFunctions(radioRsp_config, radioInd_config); +} + +/* + * Test IRadioConfig.getHalDeviceCapabilities() for the response returned. + */ +TEST_P(RadioConfigTest, getHalDeviceCapabilities) { + serial = GetRandomSerialNumber(); + ndk::ScopedAStatus res = radio_config->getHalDeviceCapabilities(serial); + ASSERT_OK(res); + ALOGI("getHalDeviceCapabilities, rspInfo.error = %s\n", + toString(radioRsp_config->rspInfo.error).c_str()); +} diff --git a/radio/aidl/vts/radio_config_utils.h b/radio/aidl/vts/radio_config_utils.h new file mode 100644 index 0000000000..465c10653b --- /dev/null +++ b/radio/aidl/vts/radio_config_utils.h @@ -0,0 +1,86 @@ +/* + * 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 +#include +#include + +#include "radio_aidl_hal_utils.h" + +using namespace aidl::android::hardware::radio::config; + +class RadioConfigTest; + +/* Callback class for radio config response */ +class RadioConfigResponse : public BnRadioConfigResponse { + protected: + RadioServiceTest& parent_config; + + public: + RadioConfigResponse(RadioServiceTest& parent_config); + virtual ~RadioConfigResponse() = default; + + RadioResponseInfo rspInfo; + PhoneCapability phoneCap; + bool modemReducedFeatureSet1; + + virtual ndk::ScopedAStatus getSimSlotsStatusResponse( + const RadioResponseInfo& info, const std::vector& slotStatus) override; + + virtual ndk::ScopedAStatus setSimSlotsMappingResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus getPhoneCapabilityResponse( + const RadioResponseInfo& info, const PhoneCapability& phoneCapability) override; + + virtual ndk::ScopedAStatus setPreferredDataModemResponse( + const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus getNumOfLiveModemsResponse(const RadioResponseInfo& info, + const int8_t numOfLiveModems) override; + + virtual ndk::ScopedAStatus setNumOfLiveModemsResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus getHalDeviceCapabilitiesResponse( + const RadioResponseInfo& info, bool modemReducedFeatureSet1) override; +}; + +/* Callback class for radio config indication */ +class RadioConfigIndication : public BnRadioConfigIndication { + protected: + RadioServiceTest& parent_config; + + public: + RadioConfigIndication(RadioServiceTest& parent_config); + virtual ~RadioConfigIndication() = default; + + virtual ndk::ScopedAStatus simSlotsStatusChanged( + RadioIndicationType type, const std::vector& slotStatus) override; +}; + +// The main test class for Radio AIDL Config. +class RadioConfigTest : public ::testing::TestWithParam, public RadioServiceTest { + public: + virtual void SetUp() override; + ndk::ScopedAStatus updateSimCardStatus(); + + /* radio config service handle in RadioServiceTest */ + /* radio config response handle */ + std::shared_ptr radioRsp_config; + /* radio config indication handle */ + std::shared_ptr radioInd_config; +}; diff --git a/radio/aidl/vts/radio_data_indication.cpp b/radio/aidl/vts/radio_data_indication.cpp index 1e02fe1024..4d3c539d91 100644 --- a/radio/aidl/vts/radio_data_indication.cpp +++ b/radio/aidl/vts/radio_data_indication.cpp @@ -16,7 +16,7 @@ #include "radio_data_utils.h" -RadioDataIndication::RadioDataIndication(RadioDataTest& parent) : parent_data(parent) {} +RadioDataIndication::RadioDataIndication(RadioServiceTest& parent) : parent_data(parent) {} ndk::ScopedAStatus RadioDataIndication::dataCallListChanged( RadioIndicationType /*type*/, const std::vector& /*dcList*/) { diff --git a/radio/aidl/vts/radio_data_response.cpp b/radio/aidl/vts/radio_data_response.cpp index 682ddfbfee..9b17bfb380 100644 --- a/radio/aidl/vts/radio_data_response.cpp +++ b/radio/aidl/vts/radio_data_response.cpp @@ -16,7 +16,7 @@ #include "radio_data_utils.h" -RadioDataResponse::RadioDataResponse(RadioResponseWaiter& parent) : parent_data(parent) {} +RadioDataResponse::RadioDataResponse(RadioServiceTest& parent) : parent_data(parent) {} ndk::ScopedAStatus RadioDataResponse::acknowledgeRequest(int32_t /*serial*/) { return ndk::ScopedAStatus::ok(); diff --git a/radio/aidl/vts/radio_data_test.cpp b/radio/aidl/vts/radio_data_test.cpp index 87521cc057..8547e9d4db 100644 --- a/radio/aidl/vts/radio_data_test.cpp +++ b/radio/aidl/vts/radio_data_test.cpp @@ -46,12 +46,17 @@ void RadioDataTest::SetUp() { radio_data->setResponseFunctions(radioRsp_data, radioInd_data); + // Assert IRadioSim exists and SIM is present before testing + radio_sim = sim::IRadioSim::fromBinder(ndk::SpAIBinder( + AServiceManager_waitForService("android.hardware.radio.sim.IRadioSim/slot1"))); + ASSERT_NE(nullptr, radio_sim.get()); + updateSimCardStatus(); + EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState); + // Assert IRadioConfig exists before testing - std::shared_ptr radioConfig = - aidl::android::hardware::radio::config::IRadioConfig::fromBinder( - ndk::SpAIBinder(AServiceManager_waitForService( - "android.hardware.radio.config.IRadioConfig/default"))); - ASSERT_NE(nullptr, radioConfig.get()); + radio_config = config::IRadioConfig::fromBinder(ndk::SpAIBinder( + AServiceManager_waitForService("android.hardware.radio.config.IRadioConfig/default"))); + ASSERT_NE(nullptr, radio_config.get()); } ndk::ScopedAStatus RadioDataTest::getDataCallList() { diff --git a/radio/aidl/vts/radio_data_utils.h b/radio/aidl/vts/radio_data_utils.h index ada8ac1cc6..50c7878a2c 100644 --- a/radio/aidl/vts/radio_data_utils.h +++ b/radio/aidl/vts/radio_data_utils.h @@ -23,17 +23,16 @@ #include "radio_aidl_hal_utils.h" using namespace aidl::android::hardware::radio::data; -using aidl::android::hardware::radio::sim::CardStatus; class RadioDataTest; /* Callback class for radio data response */ class RadioDataResponse : public BnRadioDataResponse { protected: - RadioResponseWaiter& parent_data; + RadioServiceTest& parent_data; public: - RadioDataResponse(RadioResponseWaiter& parent_data); + RadioDataResponse(RadioServiceTest& parent_data); virtual ~RadioDataResponse() = default; RadioResponseInfo rspInfo; @@ -80,10 +79,10 @@ class RadioDataResponse : public BnRadioDataResponse { /* Callback class for radio data indication */ class RadioDataIndication : public BnRadioDataIndication { protected: - RadioDataTest& parent_data; + RadioServiceTest& parent_data; public: - RadioDataIndication(RadioDataTest& parent_data); + RadioDataIndication(RadioServiceTest& parent_data); virtual ~RadioDataIndication() = default; virtual ndk::ScopedAStatus dataCallListChanged( @@ -99,7 +98,7 @@ class RadioDataIndication : public BnRadioDataIndication { }; // The main test class for Radio AIDL Data. -class RadioDataTest : public ::testing::TestWithParam, public RadioResponseWaiter { +class RadioDataTest : public ::testing::TestWithParam, public RadioServiceTest { protected: /* Get current data call list */ ndk::ScopedAStatus getDataCallList(); diff --git a/radio/aidl/vts/radio_messaging_indication.cpp b/radio/aidl/vts/radio_messaging_indication.cpp index 7eeb266f4a..c69611f74d 100644 --- a/radio/aidl/vts/radio_messaging_indication.cpp +++ b/radio/aidl/vts/radio_messaging_indication.cpp @@ -16,7 +16,7 @@ #include "radio_messaging_utils.h" -RadioMessagingIndication::RadioMessagingIndication(RadioMessagingTest& parent) +RadioMessagingIndication::RadioMessagingIndication(RadioServiceTest& parent) : parent_messaging(parent) {} ndk::ScopedAStatus RadioMessagingIndication::cdmaNewSms(RadioIndicationType /*type*/, diff --git a/radio/aidl/vts/radio_messaging_response.cpp b/radio/aidl/vts/radio_messaging_response.cpp index d73278f152..718df7e60b 100644 --- a/radio/aidl/vts/radio_messaging_response.cpp +++ b/radio/aidl/vts/radio_messaging_response.cpp @@ -16,7 +16,7 @@ #include "radio_messaging_utils.h" -RadioMessagingResponse::RadioMessagingResponse(RadioResponseWaiter& parent) +RadioMessagingResponse::RadioMessagingResponse(RadioServiceTest& parent) : parent_messaging(parent) {} ndk::ScopedAStatus RadioMessagingResponse::acknowledgeIncomingGsmSmsWithPduResponse( diff --git a/radio/aidl/vts/radio_messaging_test.cpp b/radio/aidl/vts/radio_messaging_test.cpp index 58aeaab3f4..8abd91d709 100644 --- a/radio/aidl/vts/radio_messaging_test.cpp +++ b/radio/aidl/vts/radio_messaging_test.cpp @@ -44,12 +44,17 @@ void RadioMessagingTest::SetUp() { radio_messaging->setResponseFunctions(radioRsp_messaging, radioInd_messaging); + // Assert IRadioSim exists and SIM is present before testing + radio_sim = sim::IRadioSim::fromBinder(ndk::SpAIBinder( + AServiceManager_waitForService("android.hardware.radio.sim.IRadioSim/slot1"))); + ASSERT_NE(nullptr, radio_sim.get()); + updateSimCardStatus(); + EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState); + // Assert IRadioConfig exists before testing - std::shared_ptr radioConfig = - aidl::android::hardware::radio::config::IRadioConfig::fromBinder( - ndk::SpAIBinder(AServiceManager_waitForService( - "android.hardware.radio.config.IRadioConfig/default"))); - ASSERT_NE(nullptr, radioConfig.get()); + radio_config = config::IRadioConfig::fromBinder(ndk::SpAIBinder( + AServiceManager_waitForService("android.hardware.radio.config.IRadioConfig/default"))); + ASSERT_NE(nullptr, radio_config.get()); } /* diff --git a/radio/aidl/vts/radio_messaging_utils.h b/radio/aidl/vts/radio_messaging_utils.h index 96cde088f3..7bb99cdcab 100644 --- a/radio/aidl/vts/radio_messaging_utils.h +++ b/radio/aidl/vts/radio_messaging_utils.h @@ -29,10 +29,10 @@ class RadioMessagingTest; /* Callback class for radio messaging response */ class RadioMessagingResponse : public BnRadioMessagingResponse { protected: - RadioResponseWaiter& parent_messaging; + RadioServiceTest& parent_messaging; public: - RadioMessagingResponse(RadioResponseWaiter& parent_messaging); + RadioMessagingResponse(RadioServiceTest& parent_messaging); virtual ~RadioMessagingResponse() = default; RadioResponseInfo rspInfo; @@ -110,10 +110,10 @@ class RadioMessagingResponse : public BnRadioMessagingResponse { /* Callback class for radio messaging indication */ class RadioMessagingIndication : public BnRadioMessagingIndication { protected: - RadioMessagingTest& parent_messaging; + RadioServiceTest& parent_messaging; public: - RadioMessagingIndication(RadioMessagingTest& parent_messaging); + RadioMessagingIndication(RadioServiceTest& parent_messaging); virtual ~RadioMessagingIndication() = default; virtual ndk::ScopedAStatus cdmaNewSms(RadioIndicationType type, @@ -139,8 +139,7 @@ class RadioMessagingIndication : public BnRadioMessagingIndication { }; // The main test class for Radio AIDL Messaging. -class RadioMessagingTest : public ::testing::TestWithParam, - public RadioResponseWaiter { +class RadioMessagingTest : public ::testing::TestWithParam, public RadioServiceTest { public: virtual void SetUp() override; diff --git a/radio/aidl/vts/radio_modem_indication.cpp b/radio/aidl/vts/radio_modem_indication.cpp index 17f37a8dd5..0bfcd669c7 100644 --- a/radio/aidl/vts/radio_modem_indication.cpp +++ b/radio/aidl/vts/radio_modem_indication.cpp @@ -16,7 +16,7 @@ #include "radio_modem_utils.h" -RadioModemIndication::RadioModemIndication(RadioModemTest& parent) : parent_modem(parent) {} +RadioModemIndication::RadioModemIndication(RadioServiceTest& parent) : parent_modem(parent) {} ndk::ScopedAStatus RadioModemIndication::hardwareConfigChanged( RadioIndicationType /*type*/, const std::vector& /*configs*/) { diff --git a/radio/aidl/vts/radio_modem_response.cpp b/radio/aidl/vts/radio_modem_response.cpp index 7ac590f4db..53bfab40a9 100644 --- a/radio/aidl/vts/radio_modem_response.cpp +++ b/radio/aidl/vts/radio_modem_response.cpp @@ -16,7 +16,7 @@ #include "radio_modem_utils.h" -RadioModemResponse::RadioModemResponse(RadioResponseWaiter& parent) : parent_modem(parent) {} +RadioModemResponse::RadioModemResponse(RadioServiceTest& parent) : parent_modem(parent) {} ndk::ScopedAStatus RadioModemResponse::acknowledgeRequest(int32_t /*serial*/) { return ndk::ScopedAStatus::ok(); diff --git a/radio/aidl/vts/radio_modem_test.cpp b/radio/aidl/vts/radio_modem_test.cpp index 406927f5bc..b40bb7b573 100644 --- a/radio/aidl/vts/radio_modem_test.cpp +++ b/radio/aidl/vts/radio_modem_test.cpp @@ -44,12 +44,17 @@ void RadioModemTest::SetUp() { radio_modem->setResponseFunctions(radioRsp_modem, radioInd_modem); + // Assert IRadioSim exists and SIM is present before testing + radio_sim = sim::IRadioSim::fromBinder(ndk::SpAIBinder( + AServiceManager_waitForService("android.hardware.radio.sim.IRadioSim/slot1"))); + ASSERT_NE(nullptr, radio_sim.get()); + updateSimCardStatus(); + EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState); + // Assert IRadioConfig exists before testing - std::shared_ptr radioConfig = - aidl::android::hardware::radio::config::IRadioConfig::fromBinder( - ndk::SpAIBinder(AServiceManager_waitForService( - "android.hardware.radio.config.IRadioConfig/default"))); - ASSERT_NE(nullptr, radioConfig.get()); + radio_config = config::IRadioConfig::fromBinder(ndk::SpAIBinder( + AServiceManager_waitForService("android.hardware.radio.config.IRadioConfig/default"))); + ASSERT_NE(nullptr, radio_config.get()); } /* diff --git a/radio/aidl/vts/radio_modem_utils.h b/radio/aidl/vts/radio_modem_utils.h index cd9a30d315..8779e0cbd2 100644 --- a/radio/aidl/vts/radio_modem_utils.h +++ b/radio/aidl/vts/radio_modem_utils.h @@ -22,7 +22,6 @@ #include "radio_aidl_hal_utils.h" -using namespace aidl::android::hardware::radio::config; using namespace aidl::android::hardware::radio::modem; class RadioModemTest; @@ -30,10 +29,10 @@ class RadioModemTest; /* Callback class for radio modem response */ class RadioModemResponse : public BnRadioModemResponse { protected: - RadioResponseWaiter& parent_modem; + RadioServiceTest& parent_modem; public: - RadioModemResponse(RadioResponseWaiter& parent_modem); + RadioModemResponse(RadioServiceTest& parent_modem); virtual ~RadioModemResponse() = default; RadioResponseInfo rspInfo; @@ -87,10 +86,10 @@ class RadioModemResponse : public BnRadioModemResponse { /* Callback class for radio modem indication */ class RadioModemIndication : public BnRadioModemIndication { protected: - RadioModemTest& parent_modem; + RadioServiceTest& parent_modem; public: - RadioModemIndication(RadioModemTest& parent_modem); + RadioModemIndication(RadioServiceTest& parent_modem); virtual ~RadioModemIndication() = default; virtual ndk::ScopedAStatus hardwareConfigChanged( @@ -109,7 +108,7 @@ class RadioModemIndication : public BnRadioModemIndication { }; // The main test class for Radio AIDL Modem. -class RadioModemTest : public ::testing::TestWithParam, public RadioResponseWaiter { +class RadioModemTest : public ::testing::TestWithParam, public RadioServiceTest { public: virtual void SetUp() override; diff --git a/radio/aidl/vts/radio_network_indication.cpp b/radio/aidl/vts/radio_network_indication.cpp index 03caf3bbf5..7acbff4b2e 100644 --- a/radio/aidl/vts/radio_network_indication.cpp +++ b/radio/aidl/vts/radio_network_indication.cpp @@ -16,7 +16,7 @@ #include "radio_network_utils.h" -RadioNetworkIndication::RadioNetworkIndication(RadioNetworkTest& parent) : parent_network(parent) {} +RadioNetworkIndication::RadioNetworkIndication(RadioServiceTest& parent) : parent_network(parent) {} ndk::ScopedAStatus RadioNetworkIndication::barringInfoChanged( RadioIndicationType /*type*/, const CellIdentity& /*cellIdentity*/, diff --git a/radio/aidl/vts/radio_network_response.cpp b/radio/aidl/vts/radio_network_response.cpp index dc40e6f916..ccae0f3458 100644 --- a/radio/aidl/vts/radio_network_response.cpp +++ b/radio/aidl/vts/radio_network_response.cpp @@ -16,7 +16,7 @@ #include "radio_network_utils.h" -RadioNetworkResponse::RadioNetworkResponse(RadioResponseWaiter& parent) : parent_network(parent) {} +RadioNetworkResponse::RadioNetworkResponse(RadioServiceTest& parent) : parent_network(parent) {} ndk::ScopedAStatus RadioNetworkResponse::acknowledgeRequest(int32_t /*serial*/) { return ndk::ScopedAStatus::ok(); @@ -112,7 +112,7 @@ ndk::ScopedAStatus RadioNetworkResponse::getVoiceRadioTechnologyResponse( ndk::ScopedAStatus RadioNetworkResponse::getVoiceRegistrationStateResponse( const RadioResponseInfo& info, const RegStateResult& regResponse) { rspInfo = info; - regStateResp.regState = regResponse.regState; + voiceRegResp.regState = regResponse.regState; 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 08af636c90..93c4c35686 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -45,12 +45,17 @@ void RadioNetworkTest::SetUp() { radio_network->setResponseFunctions(radioRsp_network, radioInd_network); + // Assert IRadioSim exists and SIM is present before testing + radio_sim = sim::IRadioSim::fromBinder(ndk::SpAIBinder( + AServiceManager_waitForService("android.hardware.radio.sim.IRadioSim/slot1"))); + ASSERT_NE(nullptr, radio_sim.get()); + updateSimCardStatus(); + EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState); + // Assert IRadioConfig exists before testing - std::shared_ptr radioConfig = - aidl::android::hardware::radio::config::IRadioConfig::fromBinder( - ndk::SpAIBinder(AServiceManager_waitForService( - "android.hardware.radio.config.IRadioConfig/default"))); - ASSERT_NE(nullptr, radioConfig.get()); + radio_config = config::IRadioConfig::fromBinder(ndk::SpAIBinder( + AServiceManager_waitForService("android.hardware.radio.config.IRadioConfig/default"))); + ASSERT_NE(nullptr, radio_config.get()); } /* diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h index 79367215eb..9f7676969d 100644 --- a/radio/aidl/vts/radio_network_utils.h +++ b/radio/aidl/vts/radio_network_utils.h @@ -29,10 +29,10 @@ class RadioNetworkTest; /* Callback class for radio network response */ class RadioNetworkResponse : public BnRadioNetworkResponse { protected: - RadioResponseWaiter& parent_network; + RadioServiceTest& parent_network; public: - RadioNetworkResponse(RadioResponseWaiter& parent_network); + RadioNetworkResponse(RadioServiceTest& parent_network); virtual ~RadioNetworkResponse() = default; RadioResponseInfo rspInfo; @@ -40,7 +40,7 @@ class RadioNetworkResponse : public BnRadioNetworkResponse { std::vector networkInfos; bool isNrDualConnectivityEnabled; int networkTypeBitmapResponse; - RegStateResult regStateResp; + RegStateResult voiceRegResp; CellIdentity barringCellIdentity; std::vector barringInfos; UsageSetting usageSetting; @@ -150,10 +150,10 @@ class RadioNetworkResponse : public BnRadioNetworkResponse { /* Callback class for radio network indication */ class RadioNetworkIndication : public BnRadioNetworkIndication { protected: - RadioNetworkTest& parent_network; + RadioServiceTest& parent_network; public: - RadioNetworkIndication(RadioNetworkTest& parent_network); + RadioNetworkIndication(RadioServiceTest& parent_network); virtual ~RadioNetworkIndication() = default; virtual ndk::ScopedAStatus barringInfoChanged( @@ -202,7 +202,7 @@ class RadioNetworkIndication : public BnRadioNetworkIndication { }; // The main test class for Radio AIDL Network. -class RadioNetworkTest : public ::testing::TestWithParam, public RadioResponseWaiter { +class RadioNetworkTest : public ::testing::TestWithParam, public RadioServiceTest { public: virtual void SetUp() override; diff --git a/radio/aidl/vts/radio_sim_indication.cpp b/radio/aidl/vts/radio_sim_indication.cpp index 03858458b1..c03d947828 100644 --- a/radio/aidl/vts/radio_sim_indication.cpp +++ b/radio/aidl/vts/radio_sim_indication.cpp @@ -16,7 +16,7 @@ #include "radio_sim_utils.h" -RadioSimIndication::RadioSimIndication(RadioSimTest& parent) : parent_sim(parent) {} +RadioSimIndication::RadioSimIndication(RadioServiceTest& parent) : parent_sim(parent) {} ndk::ScopedAStatus RadioSimIndication::carrierInfoForImsiEncryption(RadioIndicationType /*info*/) { return ndk::ScopedAStatus::ok(); diff --git a/radio/aidl/vts/radio_sim_response.cpp b/radio/aidl/vts/radio_sim_response.cpp index 2c796faa12..a783f43e0a 100644 --- a/radio/aidl/vts/radio_sim_response.cpp +++ b/radio/aidl/vts/radio_sim_response.cpp @@ -16,7 +16,7 @@ #include "radio_sim_utils.h" -RadioSimResponse::RadioSimResponse(RadioResponseWaiter& parent) : parent_sim(parent) {} +RadioSimResponse::RadioSimResponse(RadioServiceTest& parent) : parent_sim(parent) {} ndk::ScopedAStatus RadioSimResponse::acknowledgeRequest(int32_t /*serial*/) { return ndk::ScopedAStatus::ok(); diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp index c70219ff94..5db77f6600 100644 --- a/radio/aidl/vts/radio_sim_test.cpp +++ b/radio/aidl/vts/radio_sim_test.cpp @@ -43,20 +43,23 @@ void RadioSimTest::SetUp() { ASSERT_NE(nullptr, radioInd_sim.get()); radio_sim->setResponseFunctions(radioRsp_sim, radioInd_sim); + // Assert SIM is present before testing + updateSimCardStatus(); + EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState); // Assert IRadioConfig exists before testing - std::shared_ptr radioConfig = - aidl::android::hardware::radio::config::IRadioConfig::fromBinder( - ndk::SpAIBinder(AServiceManager_waitForService( - "android.hardware.radio.config.IRadioConfig/default"))); - ASSERT_NE(nullptr, radioConfig.get()); + radio_config = config::IRadioConfig::fromBinder(ndk::SpAIBinder( + AServiceManager_waitForService("android.hardware.radio.config.IRadioConfig/default"))); + ASSERT_NE(nullptr, radio_config.get()); } -ndk::ScopedAStatus RadioSimTest::updateSimCardStatus() { +void RadioSimTest::updateSimCardStatus() { serial = GetRandomSerialNumber(); radio_sim->getIccCardStatus(serial); EXPECT_EQ(std::cv_status::no_timeout, wait()); - return ndk::ScopedAStatus::ok(); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error); } /* diff --git a/radio/aidl/vts/radio_sim_utils.h b/radio/aidl/vts/radio_sim_utils.h index 6cb6790453..b5e365d436 100644 --- a/radio/aidl/vts/radio_sim_utils.h +++ b/radio/aidl/vts/radio_sim_utils.h @@ -29,10 +29,10 @@ class RadioSimTest; /* Callback class for radio SIM response */ class RadioSimResponse : public BnRadioSimResponse { protected: - RadioResponseWaiter& parent_sim; + RadioServiceTest& parent_sim; public: - RadioSimResponse(RadioResponseWaiter& parent_sim); + RadioSimResponse(RadioServiceTest& parent_sim); virtual ~RadioSimResponse() = default; RadioResponseInfo rspInfo; @@ -152,10 +152,10 @@ class RadioSimResponse : public BnRadioSimResponse { /* Callback class for radio SIM indication */ class RadioSimIndication : public BnRadioSimIndication { protected: - RadioSimTest& parent_sim; + RadioServiceTest& parent_sim; public: - RadioSimIndication(RadioSimTest& parent_sim); + RadioSimIndication(RadioServiceTest& parent_sim); virtual ~RadioSimIndication() = default; virtual ndk::ScopedAStatus carrierInfoForImsiEncryption(RadioIndicationType info) override; @@ -190,16 +190,14 @@ class RadioSimIndication : public BnRadioSimIndication { }; // The main test class for Radio AIDL SIM. -class RadioSimTest : public ::testing::TestWithParam, public RadioResponseWaiter { - protected: - /* Update Sim Card Status */ - virtual ndk::ScopedAStatus updateSimCardStatus(); - +class RadioSimTest : public ::testing::TestWithParam, public RadioServiceTest { public: virtual void SetUp() override; - /* radio SIM service handle */ - std::shared_ptr radio_sim; + /* Override updateSimCardStatus in RadioServiceTest to not call setResponseFunctions */ + void updateSimCardStatus(); + + /* radio SIM service handle in RadioServiceTest */ /* radio SIM response handle */ std::shared_ptr radioRsp_sim; /* radio SIM indication handle */ diff --git a/radio/aidl/vts/radio_voice_indication.cpp b/radio/aidl/vts/radio_voice_indication.cpp index 2c468174e8..d814c1857e 100644 --- a/radio/aidl/vts/radio_voice_indication.cpp +++ b/radio/aidl/vts/radio_voice_indication.cpp @@ -16,7 +16,7 @@ #include "radio_voice_utils.h" -RadioVoiceIndication::RadioVoiceIndication(RadioVoiceTest& parent) : parent_voice(parent) {} +RadioVoiceIndication::RadioVoiceIndication(RadioServiceTest& parent) : parent_voice(parent) {} ndk::ScopedAStatus RadioVoiceIndication::callRing(RadioIndicationType /*type*/, bool /*isGsm*/, const CdmaSignalInfoRecord& /*record*/) { diff --git a/radio/aidl/vts/radio_voice_response.cpp b/radio/aidl/vts/radio_voice_response.cpp index ca350c6660..a491613b60 100644 --- a/radio/aidl/vts/radio_voice_response.cpp +++ b/radio/aidl/vts/radio_voice_response.cpp @@ -16,7 +16,7 @@ #include "radio_voice_utils.h" -RadioVoiceResponse::RadioVoiceResponse(RadioResponseWaiter& parent) : parent_voice(parent) {} +RadioVoiceResponse::RadioVoiceResponse(RadioServiceTest& parent) : parent_voice(parent) {} ndk::ScopedAStatus RadioVoiceResponse::acceptCallResponse(const RadioResponseInfo& /*info*/) { return ndk::ScopedAStatus::ok(); diff --git a/radio/aidl/vts/radio_voice_test.cpp b/radio/aidl/vts/radio_voice_test.cpp index 7a0bedd3ee..717f3f0be9 100644 --- a/radio/aidl/vts/radio_voice_test.cpp +++ b/radio/aidl/vts/radio_voice_test.cpp @@ -45,12 +45,26 @@ void RadioVoiceTest::SetUp() { radio_voice->setResponseFunctions(radioRsp_voice, radioInd_voice); + // Assert IRadioSim exists and SIM is present before testing + radio_sim = sim::IRadioSim::fromBinder(ndk::SpAIBinder( + AServiceManager_waitForService("android.hardware.radio.sim.IRadioSim/slot1"))); + ASSERT_NE(nullptr, radio_sim.get()); + updateSimCardStatus(); + EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState); + // Assert IRadioConfig exists before testing - std::shared_ptr radioConfig = - aidl::android::hardware::radio::config::IRadioConfig::fromBinder( - ndk::SpAIBinder(AServiceManager_waitForService( - "android.hardware.radio.config.IRadioConfig/default"))); - ASSERT_NE(nullptr, radioConfig.get()); + radio_config = config::IRadioConfig::fromBinder(ndk::SpAIBinder( + AServiceManager_waitForService("android.hardware.radio.config.IRadioConfig/default"))); + ASSERT_NE(nullptr, radio_config.get()); + + if (isDsDsEnabled() || isTsTsEnabled()) { + radio_network = IRadioNetwork::fromBinder(ndk::SpAIBinder(AServiceManager_waitForService( + "android.hardware.radio.network.IRadioNetwork/slot1"))); + ASSERT_NE(nullptr, radio_network.get()); + radioRsp_network = ndk::SharedRefBase::make(*this); + radioInd_network = ndk::SharedRefBase::make(*this); + radio_network->setResponseFunctions(radioRsp_network, radioInd_network); + } } ndk::ScopedAStatus RadioVoiceTest::clearPotentialEstablishedCalls() { @@ -113,16 +127,13 @@ TEST_P(RadioVoiceTest, emergencyDial) { // In DSDS or TSTS, we only check the result if the current slot is IN_SERVICE // or Emergency_Only. if (isDsDsEnabled() || isTsTsEnabled()) { - // TODO(b/210712359): maybe create a local RadioNetwork instance - /** serial = GetRandomSerialNumber(); - radio_v1_6->getVoiceRegistrationState(serial); + radio_network->getVoiceRegistrationState(serial); EXPECT_EQ(std::cv_status::no_timeout, wait()); - if (isVoiceEmergencyOnly(radioRsp_v1_6->voiceRegResp.regState) || - isVoiceInService(radioRsp_v1_6->voiceRegResp.regState)) { + if (isVoiceEmergencyOnly(radioRsp_network->voiceRegResp.regState) || + isVoiceInService(radioRsp_network->voiceRegResp.regState)) { EXPECT_EQ(RadioError::NONE, rspEmergencyDial); } - **/ } else { EXPECT_EQ(RadioError::NONE, rspEmergencyDial); } @@ -171,16 +182,13 @@ TEST_P(RadioVoiceTest, emergencyDial_withServices) { // In DSDS or TSTS, we only check the result if the current slot is IN_SERVICE // or Emergency_Only. if (isDsDsEnabled() || isTsTsEnabled()) { - // TODO(b/210712359): maybe create a local RadioNetwork instance - /** serial = GetRandomSerialNumber(); - radio_v1_6->getVoiceRegistrationState_1_6(serial); + radio_network->getVoiceRegistrationState(serial); EXPECT_EQ(std::cv_status::no_timeout, wait()); - if (isVoiceEmergencyOnly(radioRsp_v1_6->voiceRegResp.regState) || - isVoiceInService(radioRsp_v1_6->voiceRegResp.regState)) { + if (isVoiceEmergencyOnly(radioRsp_network->voiceRegResp.regState) || + isVoiceInService(radioRsp_network->voiceRegResp.regState)) { EXPECT_EQ(RadioError::NONE, rspEmergencyDial); } - **/ } else { EXPECT_EQ(RadioError::NONE, rspEmergencyDial); } @@ -228,16 +236,13 @@ TEST_P(RadioVoiceTest, emergencyDial_withEmergencyRouting) { // In DSDS or TSTS, we only check the result if the current slot is IN_SERVICE // or Emergency_Only. if (isDsDsEnabled() || isTsTsEnabled()) { - // TODO(b/210712359): maybe create a local RadioNetwork instance - /** serial = GetRandomSerialNumber(); - radio_v1_6->getVoiceRegistrationState_1_6(serial); + radio_network->getVoiceRegistrationState(serial); EXPECT_EQ(std::cv_status::no_timeout, wait()); - if (isVoiceEmergencyOnly(radioRsp_v1_6->voiceRegResp.regState) || - isVoiceInService(radioRsp_v1_6->voiceRegResp.regState)) { + if (isVoiceEmergencyOnly(radioRsp_network->voiceRegResp.regState) || + isVoiceInService(radioRsp_network->voiceRegResp.regState)) { EXPECT_EQ(RadioError::NONE, rspEmergencyDial); } - **/ } else { EXPECT_EQ(RadioError::NONE, rspEmergencyDial); } diff --git a/radio/aidl/vts/radio_voice_utils.h b/radio/aidl/vts/radio_voice_utils.h index a676a7fcbb..d61bf1eee8 100644 --- a/radio/aidl/vts/radio_voice_utils.h +++ b/radio/aidl/vts/radio_voice_utils.h @@ -21,6 +21,7 @@ #include #include "radio_aidl_hal_utils.h" +#include "radio_network_utils.h" using namespace aidl::android::hardware::radio::voice; @@ -29,10 +30,10 @@ class RadioVoiceTest; /* Callback class for radio voice response */ class RadioVoiceResponse : public BnRadioVoiceResponse { protected: - RadioResponseWaiter& parent_voice; + RadioServiceTest& parent_voice; public: - RadioVoiceResponse(RadioResponseWaiter& parent_voice); + RadioVoiceResponse(RadioServiceTest& parent_voice); virtual ~RadioVoiceResponse() = default; RadioResponseInfo rspInfo; @@ -130,10 +131,10 @@ class RadioVoiceResponse : public BnRadioVoiceResponse { /* Callback class for radio voice indication */ class RadioVoiceIndication : public BnRadioVoiceIndication { protected: - RadioVoiceTest& parent_voice; + RadioServiceTest& parent_voice; public: - RadioVoiceIndication(RadioVoiceTest& parent_voice); + RadioVoiceIndication(RadioServiceTest& parent_voice); virtual ~RadioVoiceIndication() = default; virtual ndk::ScopedAStatus callRing(RadioIndicationType type, bool isGsm, @@ -175,10 +176,13 @@ class RadioVoiceIndication : public BnRadioVoiceIndication { }; // The main test class for Radio AIDL Voice. -class RadioVoiceTest : public ::testing::TestWithParam, public RadioResponseWaiter { +class RadioVoiceTest : public ::testing::TestWithParam, public RadioServiceTest { protected: /* Clear Potential Established Calls */ virtual ndk::ScopedAStatus clearPotentialEstablishedCalls(); + std::shared_ptr radio_network; + std::shared_ptr radioRsp_network; + std::shared_ptr radioInd_network; public: virtual void SetUp() override; -- GitLab From 12788a42882872c7207cd9239541a9832aa58ad2 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Wed, 5 Jan 2022 01:00:33 +0000 Subject: [PATCH 382/825] Add android.hardware.ir to vndk Bug: 206116595 Test: m Change-Id: Iab49b78b87957387fd3f82685fc430dc3da00456 --- ir/aidl/Android.bp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ir/aidl/Android.bp b/ir/aidl/Android.bp index 6dacb858d2..df9ab21a02 100644 --- a/ir/aidl/Android.bp +++ b/ir/aidl/Android.bp @@ -26,8 +26,7 @@ aidl_interface { }, ndk: { vndk: { - // TODO(b/206116595) enable this - enabled: false, + enabled: true, }, }, }, -- GitLab From 2247b0ba22091db462257cd2507bf48ec9b37ed8 Mon Sep 17 00:00:00 2001 From: Tommy Chiu Date: Thu, 30 Dec 2021 00:28:59 +0800 Subject: [PATCH 383/825] IRemotelyProvisionedComponent: Add strongbox definition Bug: 203037043 Change-Id: I8524699786fde888f753687f6fc3a825f5028f5d --- compatibility_matrices/compatibility_matrix.current.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 27e6b265e1..3b011d35d5 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -393,6 +393,7 @@ IRemotelyProvisionedComponent default + strongbox -- GitLab From 7f6d54c371b3480ccd07b747a872418443c76937 Mon Sep 17 00:00:00 2001 From: Shubham Dubey Date: Wed, 5 Jan 2022 04:53:32 +0000 Subject: [PATCH 384/825] Revert "Move libprotocan to hardware/interfaces/automotive domain" Revert submission 16551592-protocan_move Reason for revert: Breaking git_master-wihtout-vendor BUGID: b/213244647 Reverted Changes: I4d0a1dcff:Move libprotocan to hardware/interfaces/automotive... I166ea7741:Move libprotocan to hardware/interfaces/automotive... Change-Id: I190155faa9cec22931baa4b0b245037b61f15cf9 --- .../can/1.0/tools/libprotocan/Android.bp | 42 ---- .../can/1.0/tools/libprotocan/Checksum.cpp | 28 --- .../1.0/tools/libprotocan/MessageCounter.cpp | 61 ----- .../can/1.0/tools/libprotocan/MessageDef.cpp | 62 ----- .../1.0/tools/libprotocan/MessageInjector.cpp | 110 --------- .../can/1.0/tools/libprotocan/Signal.cpp | 84 ------- .../include/libprotocan/Checksum.h | 37 --- .../include/libprotocan/MessageCounter.h | 55 ----- .../include/libprotocan/MessageDef.h | 69 ------ .../include/libprotocan/MessageInjector.h | 78 ------- .../libprotocan/include/libprotocan/Signal.h | 50 ---- .../1.0/tools/libprotocan/tests/Android.bp | 39 ---- .../tests/libprotocan_signal_test.cpp | 218 ------------------ 13 files changed, 933 deletions(-) delete mode 100644 automotive/can/1.0/tools/libprotocan/Android.bp delete mode 100644 automotive/can/1.0/tools/libprotocan/Checksum.cpp delete mode 100644 automotive/can/1.0/tools/libprotocan/MessageCounter.cpp delete mode 100644 automotive/can/1.0/tools/libprotocan/MessageDef.cpp delete mode 100644 automotive/can/1.0/tools/libprotocan/MessageInjector.cpp delete mode 100644 automotive/can/1.0/tools/libprotocan/Signal.cpp delete mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/Checksum.h delete mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageCounter.h delete mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageDef.h delete mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageInjector.h delete mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/Signal.h delete mode 100644 automotive/can/1.0/tools/libprotocan/tests/Android.bp delete mode 100644 automotive/can/1.0/tools/libprotocan/tests/libprotocan_signal_test.cpp diff --git a/automotive/can/1.0/tools/libprotocan/Android.bp b/automotive/can/1.0/tools/libprotocan/Android.bp deleted file mode 100644 index 76c238b046..0000000000 --- a/automotive/can/1.0/tools/libprotocan/Android.bp +++ /dev/null @@ -1,42 +0,0 @@ -// -// 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. -// - -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_library_static { - name: "libprotocan", - defaults: ["android.hardware.automotive.vehicle@2.0-protocan-defaults"], - vendor: true, - srcs: [ - "Checksum.cpp", - "MessageCounter.cpp", - "MessageDef.cpp", - "MessageInjector.cpp", - "Signal.cpp", - ], - export_include_dirs: ["include"], - - shared_libs: [ - "android.hardware.automotive.can@1.0", - ], -} diff --git a/automotive/can/1.0/tools/libprotocan/Checksum.cpp b/automotive/can/1.0/tools/libprotocan/Checksum.cpp deleted file mode 100644 index 72fb0af1a7..0000000000 --- a/automotive/can/1.0/tools/libprotocan/Checksum.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -#include - -namespace android::hardware::automotive::protocan { - -Checksum::Checksum(Signal signal, formula f) : mSignal(signal), mFormula(f) {} - -void Checksum::update(can::V1_0::CanMessage& msg) const { - mSignal.set(msg, 0); - mSignal.set(msg, mFormula(msg) % (mSignal.maxValue + 1)); -} - -} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/MessageCounter.cpp b/automotive/can/1.0/tools/libprotocan/MessageCounter.cpp deleted file mode 100644 index ef9882fd8c..0000000000 --- a/automotive/can/1.0/tools/libprotocan/MessageCounter.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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. - */ - -#include - -#include - -namespace android::hardware::automotive::protocan { - -/** Whether to log counter state messages. */ -static constexpr bool kSuperVerbose = false; - -MessageCounter::MessageCounter(Signal signal) : upperBound(signal.maxValue + 1), mSignal(signal) {} - -Signal::value MessageCounter::next() const { - CHECK(mCurrent.has_value()) << "Counter not initialized. Did you call isReady?"; - return (*mCurrent + 1) % upperBound; -} - -void MessageCounter::read(const can::V1_0::CanMessage& msg) { - auto val = mSignal.get(msg); - - if (!mCurrent.has_value()) { - LOG(VERBOSE) << "Got first counter val of " << val; - mCurrent = val; - return; - } - - auto nextVal = next(); - if (nextVal == val) { - if constexpr (kSuperVerbose) { - LOG(VERBOSE) << "Got next counter val of " << nextVal; - } - mCurrent = nextVal; - } else { - LOG(DEBUG) << "Ignoring next counter val of " << val << ", waiting for " << nextVal; - } -} - -bool MessageCounter::isReady() const { return mCurrent.has_value(); } - -void MessageCounter::increment(can::V1_0::CanMessage& msg) { - auto newVal = next(); - mCurrent = newVal; - mSignal.set(msg, newVal); -} - -} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/MessageDef.cpp b/automotive/can/1.0/tools/libprotocan/MessageDef.cpp deleted file mode 100644 index 23ce1df640..0000000000 --- a/automotive/can/1.0/tools/libprotocan/MessageDef.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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. - */ - -#include - -#include - -namespace android::hardware::automotive::protocan { - -using can::V1_0::CanMessage; -using can::V1_0::CanMessageId; - -MessageDef::MessageDef(CanMessageId id, uint16_t len, std::map signals, - std::optional counter, std::optional checksum) - : id(id), kLen(len), kSignals(std::move(signals)), kCounter(counter), kChecksum(checksum) {} - -const Signal& MessageDef::operator[](const std::string& signalName) const { - auto it = kSignals.find(signalName); - CHECK(it != kSignals.end()) << "Signal " << signalName << " doesn't exist"; - return it->second; -} - -CanMessage MessageDef::makeDefault() const { - CanMessage msg = {}; - msg.id = id; - msg.payload.resize(kLen); - - for (auto const& [name, signal] : kSignals) { - signal.setDefault(msg); - } - - return msg; -} - -MessageCounter MessageDef::makeCounter() const { - CHECK(kCounter.has_value()) << "Can't build a counter for message without such signal"; - return MessageCounter(*kCounter); -} - -void MessageDef::updateChecksum(can::V1_0::CanMessage& msg) const { - if (!kChecksum.has_value()) return; - kChecksum->update(msg); -} - -bool MessageDef::validate(const can::V1_0::CanMessage& msg) const { - return msg.payload.size() >= kLen; -} - -} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/MessageInjector.cpp b/automotive/can/1.0/tools/libprotocan/MessageInjector.cpp deleted file mode 100644 index 7c45eaa025..0000000000 --- a/automotive/can/1.0/tools/libprotocan/MessageInjector.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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. - */ - -#include - -#include - -#include - -namespace android::hardware::automotive::protocan { - -/** Whether to log injected messages. */ -static constexpr bool kSuperVerbose = true; - -using namespace std::literals::chrono_literals; - -using can::V1_0::CanMessage; -using can::V1_0::CanMessageId; -using can::V1_0::ICanBus; -using can::V1_0::Result; - -MessageInjector::MessageInjector(MessageDef msgDef, - std::optional interMessageDelay) - : kMsgDef(std::move(msgDef)), - kInterMessageDelay(interMessageDelay), - mCounter(msgDef.makeCounter()) {} - -void MessageInjector::inject(const CanMessage& msg) { inject({msg}); } - -void MessageInjector::inject(const std::initializer_list msgs) { - std::lock_guard lock(mMessagesGuard); - for (const auto& msg : msgs) { - if constexpr (kSuperVerbose) { - LOG(VERBOSE) << "Message scheduled for injection: " << toString(msg); - } - - mMessages.push(msg); - } -} - -void MessageInjector::processQueueLocked(can::V1_0::ICanBus& bus) { - if (mMessages.empty() || !mCounter.isReady()) return; - - auto paddingMessagesCount = mCounter.upperBound - (mMessages.size() % mCounter.upperBound); - auto padMessage = kMsgDef.makeDefault(); - for (unsigned i = 0; i < paddingMessagesCount; i++) { - mMessages.push(padMessage); - } - - while (!mMessages.empty()) { - auto&& outMsg = mMessages.front(); - - mCounter.increment(outMsg); - kMsgDef.updateChecksum(outMsg); - - if constexpr (kSuperVerbose) { - LOG(VERBOSE) << "Injecting message: " << toString(outMsg); - } - auto result = bus.send(outMsg); - if (result != Result::OK) { - LOG(ERROR) << "Message injection failed: " << toString(result); - } - - mMessages.pop(); - - // This would block onReceive, but the class is not supposed to be used in production anyway - // (see MessageInjector docstring). - if (kInterMessageDelay.has_value()) { - std::this_thread::sleep_for(*kInterMessageDelay); - } - } -} - -void MessageInjector::onReceive(ICanBus& bus, const CanMessage& msg) { - if (!kMsgDef.validate(msg)) return; - - std::lock_guard lock(mMessagesGuard); - - mCounter.read(msg); - processQueueLocked(bus); -} - -MessageInjectorManager::MessageInjectorManager( - std::initializer_list> injectors) { - std::transform(injectors.begin(), injectors.end(), std::inserter(mInjectors, mInjectors.end()), - [](const std::shared_ptr& injector) { - return std::make_pair(injector->kMsgDef.id, std::move(injector)); - }); -} - -void MessageInjectorManager::onReceive(sp bus, const CanMessage& msg) { - auto it = mInjectors.find(msg.id); - if (it == mInjectors.end()) return; - it->second->onReceive(*bus, msg); -} - -} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/Signal.cpp b/automotive/can/1.0/tools/libprotocan/Signal.cpp deleted file mode 100644 index bc3e070ca1..0000000000 --- a/automotive/can/1.0/tools/libprotocan/Signal.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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. - */ - -#include - -#include - -namespace android::hardware::automotive::protocan { - -static uint8_t calculateLastByteMask(uint16_t start, uint8_t length) { - unsigned lastByteBits = (start + length) % 8; - unsigned lastBytePadding = (8 - lastByteBits) % 8; - return 0xFF >> lastBytePadding; -} - -static uint8_t calculateFirstByteMask(uint16_t firstByte, uint8_t firstBit, uint16_t lastByte, - uint8_t lastMask) { - uint8_t firstMask = 0xFF << firstBit; - if (firstByte == lastByte) firstMask &= lastMask; - return firstMask; -} - -Signal::Signal(uint16_t start, uint8_t length, value defVal) - : maxValue((1u << length) - 1), - kFirstByte(start / 8), - kFirstBit(start % 8), - kFirstByteBits(8 - kFirstBit), - kLastByte((start + length - 1) / 8), - kLastMask(calculateLastByteMask(start, length)), - kFirstMask(calculateFirstByteMask(kFirstByte, kFirstBit, kLastByte, kLastMask)), - kDefVal(defVal) { - CHECK(length > 0) << "Signal length must not be zero"; -} - -Signal::value Signal::get(const can::V1_0::CanMessage& msg) const { - CHECK(msg.payload.size() > kLastByte) - << "Message is too short. Did you call MessageDef::validate?"; - - Signal::value v = 0; - if (kLastByte != kFirstByte) v = kLastMask & msg.payload[kLastByte]; - - for (int i = kLastByte - 1; i > kFirstByte; i--) { - v = (v << 8) | msg.payload[i]; - } - - return (v << kFirstByteBits) | ((msg.payload[kFirstByte] & kFirstMask) >> kFirstBit); -} - -void Signal::set(can::V1_0::CanMessage& msg, Signal::value val) const { - CHECK(msg.payload.size() > kLastByte) - << "Signal requires message of length " << (kLastByte + 1) - << " which is beyond message length of " << msg.payload.size(); - - uint8_t firstByte = val << kFirstBit; - val >>= kFirstByteBits; - - msg.payload[kFirstByte] = (msg.payload[kFirstByte] & ~kFirstMask) | (firstByte & kFirstMask); - - for (int i = kFirstByte + 1; i < kLastByte; i++) { - msg.payload[i] = val & 0xFF; - val >>= 8; - } - - if (kLastByte != kFirstByte) { - msg.payload[kLastByte] = (msg.payload[kLastByte] & ~kLastMask) | (val & kLastMask); - } -} - -void Signal::setDefault(can::V1_0::CanMessage& msg) const { set(msg, kDefVal); } - -} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/Checksum.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/Checksum.h deleted file mode 100644 index ff1dc91a50..0000000000 --- a/automotive/can/1.0/tools/libprotocan/include/libprotocan/Checksum.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -#pragma once - -#include -#include - -namespace android::hardware::automotive::protocan { - -class Checksum { - public: - using formula = std::function; - - Checksum(Signal signal, formula f); - - void update(can::V1_0::CanMessage& msg) const; - - private: - const Signal mSignal; - const formula mFormula; -}; - -} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageCounter.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageCounter.h deleted file mode 100644 index 56113be61f..0000000000 --- a/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageCounter.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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. - */ - -#pragma once - -#include -#include - -namespace android::hardware::automotive::protocan { - -class MessageCounter { - public: - const Signal::value upperBound; - - MessageCounter(Signal signal); - - /** - * Parse CAN message sent by external ECU to determine current counter value. - */ - void read(const can::V1_0::CanMessage& msg); - - /** - * States whether current counter value is determined. - */ - bool isReady() const; - - /** - * Increment current counter value and set it in a new message. - * - * Caller must check isReady() at least once before calling this method. - */ - void increment(can::V1_0::CanMessage& msg); - - private: - const Signal mSignal; - - std::optional mCurrent = std::nullopt; - - Signal::value next() const; -}; - -} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageDef.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageDef.h deleted file mode 100644 index 79b21e17b4..0000000000 --- a/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageDef.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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. - */ - -#pragma once - -#include -#include -#include -#include - -namespace android::hardware::automotive::protocan { - -/** - * CAN message definition (not the actual message data). - * - * Describes static message properties (message ID, signals etc). - */ -class MessageDef { - public: - const can::V1_0::CanMessageId id; - - /** - * Create message definition. - * - * Currently only constant length messages are supported. - * - * \param id CAN message ID - * \param len CAN message length - * \param signals CAN signal definitions - * \param counter Designated CAN signal definition for message counter, if the message has one - * \param checksum Designated CAN signal definition for payload checksum, if the message has one - */ - MessageDef(can::V1_0::CanMessageId id, uint16_t len, std::map signals, - std::optional counter = std::nullopt, - std::optional checksum = std::nullopt); - - const Signal& operator[](const std::string& signalName) const; - - can::V1_0::CanMessage makeDefault() const; - MessageCounter makeCounter() const; - - void updateChecksum(can::V1_0::CanMessage& msg) const; - - /** - * Validate the message payload is large enough to hold all the signals. - */ - bool validate(const can::V1_0::CanMessage& msg) const; - -private: - const uint16_t kLen; - const std::map kSignals; - const std::optional kCounter; - const std::optional kChecksum; -}; - -} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageInjector.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageInjector.h deleted file mode 100644 index b0ea260640..0000000000 --- a/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageInjector.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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. - */ - -#pragma once - -#include -#include -#include -#include -#include - -#include - -namespace android::hardware::automotive::protocan { - -class MessageInjectorManager; - -/** - * Injects CAN messages with a counter to an existing system. - * - * This class is NOT meant to use in production - there should be no need to inject counted CAN - * messages where the other sender is also broadcasting them. If this is the case, it may be a sign - * your CAN network needs a redesign. This tool is intended for use for testing and demo purposes. - */ -class MessageInjector { - public: - MessageInjector(MessageDef msgDef, std::optional interMessageDelay); - - void inject(const can::V1_0::CanMessage& msg); - void inject(const std::initializer_list msgs); - - private: - const MessageDef kMsgDef; - const std::optional kInterMessageDelay; - MessageCounter mCounter; - - mutable std::mutex mMessagesGuard; - std::queue mMessages GUARDED_BY(mMessagesGuard); - - void onReceive(can::V1_0::ICanBus& bus, const can::V1_0::CanMessage& msg); - void processQueueLocked(can::V1_0::ICanBus& bus); - - friend class MessageInjectorManager; - - DISALLOW_COPY_AND_ASSIGN(MessageInjector); -}; - -/** - * Routes intercepted messages to MessageInjector instances configured to handle specific CAN - * message (CAN message ID). Intercepted messages from other nodes in CAN network are used to read - * current counter value in order to spoof the next packet. - */ -class MessageInjectorManager { - public: - MessageInjectorManager(std::initializer_list> injectors); - - void onReceive(sp bus, const can::V1_0::CanMessage& msg); - - private: - std::map> mInjectors; - - DISALLOW_COPY_AND_ASSIGN(MessageInjectorManager); -}; - -} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/Signal.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/Signal.h deleted file mode 100644 index 7c0f11933a..0000000000 --- a/automotive/can/1.0/tools/libprotocan/include/libprotocan/Signal.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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. - */ - -#pragma once - -#include -#include - -namespace android::hardware::automotive::protocan { - -/** - * TODO(twasilczyk): right now, only Little Endian signals are supported. - */ -class Signal { - public: - using value = uint64_t; - - const value maxValue; - - Signal(uint16_t start, uint8_t length, value defVal = 0); - - value get(const can::V1_0::CanMessage& msg) const; - void set(can::V1_0::CanMessage& msg, value val) const; - void setDefault(can::V1_0::CanMessage& msg) const; - - private: - const uint16_t kFirstByte; ///< Index of first byte that holds the signal - const uint8_t kFirstBit; ///< Index of first bit within first byte - const uint8_t kFirstByteBits; ///< How many bits of the first byte belong to the signal - const uint16_t kLastByte; ///< Index of last byte that holds the signal - const uint8_t kLastMask; ///< Bits of the last byte that belong to the signal - const uint8_t kFirstMask; ///< Bits of the first byte that belong to the signal - - const value kDefVal; -}; - -} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/tests/Android.bp b/automotive/can/1.0/tools/libprotocan/tests/Android.bp deleted file mode 100644 index 251cc061cd..0000000000 --- a/automotive/can/1.0/tools/libprotocan/tests/Android.bp +++ /dev/null @@ -1,39 +0,0 @@ -// -// 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. -// - -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: "libprotocan_signal_test", - defaults: ["android.hardware.automotive.can@defaults"], - vendor: true, - gtest: true, - srcs: ["libprotocan_signal_test.cpp"], - static_libs: [ - "libprotocan", - ], - shared_libs: [ - "android.hardware.automotive.can@1.0", - "libhidlbase", - ], -} diff --git a/automotive/can/1.0/tools/libprotocan/tests/libprotocan_signal_test.cpp b/automotive/can/1.0/tools/libprotocan/tests/libprotocan_signal_test.cpp deleted file mode 100644 index 19c12099e6..0000000000 --- a/automotive/can/1.0/tools/libprotocan/tests/libprotocan_signal_test.cpp +++ /dev/null @@ -1,218 +0,0 @@ -/* - * 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. - */ - -#include - -#include - -namespace android::hardware::automotive::protocan::unittest { - -TEST(SignalTest, TestGetSingleBytes) { - can::V1_0::CanMessage msg = {}; - msg.payload = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; - for (unsigned i = 0; i < msg.payload.size(); i++) { - Signal signal(8 * i, 8); - ASSERT_EQ(i, signal.get(msg)); - } -} - -TEST(SignalTest, TestSetSingleBytes) { - std::vector msgs = {{}, {}, {}}; - msgs[0].payload = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; - msgs[1].payload = {0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB}; - msgs[2].payload = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - for (unsigned i = 0; i < msgs[0].payload.size(); i++) { - Signal signal(8 * i, 8); - - for (auto&& msgOriginal : msgs) { - auto msgModified = msgOriginal; - signal.set(msgModified, 0xBA); - - auto msgExpected = msgOriginal; - msgExpected.payload[i] = 0xBA; - - ASSERT_EQ(msgExpected, msgModified) << "i=" << i; - } - } -} - -TEST(SignalTest, TestGetStart4) { - /* Data generated with Python3: - * - * from cantools.database.can import * - * hex(Message(1, 'm', 4, [Signal('s', 4, 16, byte_order='little_endian')]). - * decode(b'\xde\xad\xbe\xef')['s']) - */ - - can::V1_0::CanMessage msg = {}; - msg.payload = {0xDE, 0xAD, 0xBE, 0xEF}; - can::V1_0::CanMessage msg2 = {}; - msg2.payload = {0xDE, 0xAD, 0xBE, 0xEF, 0xDE, 0xAD}; - - Signal s0_4(0, 4); - Signal s4_4(4, 4); - Signal s4_8(4, 8); - Signal s4_16(4, 16); - Signal s4_28(4, 28); - Signal s12_8(12, 8); - Signal s12_12(12, 12); - Signal s12_16(12, 16); - Signal s12_20(12, 20); - Signal s12_32(12, 32); - - ASSERT_EQ(0xEu, s0_4.get(msg)); - ASSERT_EQ(0xDu, s4_4.get(msg)); - ASSERT_EQ(0xDDu, s4_8.get(msg)); - ASSERT_EQ(0xEADDu, s4_16.get(msg)); - ASSERT_EQ(0xEFBEADDu, s4_28.get(msg)); - ASSERT_EQ(0xEAu, s12_8.get(msg)); - ASSERT_EQ(0xBEAu, s12_12.get(msg)); - ASSERT_EQ(0xFBEAu, s12_16.get(msg)); - ASSERT_EQ(0xEFBEAu, s12_20.get(msg)); - ASSERT_EQ(0xDDEEFBEAu, s12_32.get(msg2)); -} - -TEST(SignalTest, TestGet64) { - /* Data generated with Python3: - * - * from cantools.database.can import * - * hex(Message(1, 'm', 9, [Signal('s', 4, 64, byte_order='little_endian')]). - * decode(b'\xde\xad\xbe\xef\xab\xbc\xcd\xde\xef')['s']) - */ - - can::V1_0::CanMessage msg = {}; - msg.payload = {0xDE, 0xAD, 0xBE, 0xEF, 0xAB, 0xBC, 0xCD, 0xDE, 0xEF}; - - Signal s0_64(0, 64); - Signal s8_64(8, 64); - Signal s4_64(4, 64); - Signal s1_64(1, 64); - - ASSERT_EQ(0xDECDBCABEFBEADDEu, s0_64.get(msg)); - ASSERT_EQ(0xEFDECDBCABEFBEADu, s8_64.get(msg)); - ASSERT_EQ(0xFDECDBCABEFBEADDu, s4_64.get(msg)); - ASSERT_EQ(0xEF66DE55F7DF56EFu, s1_64.get(msg)); -} - -TEST(SignalTest, TestGetAllStarts) { - /* Data generated with Python3: - * - * from cantools.database.can import * - * hex(Message(1, 'm', 6, [Signal('s', 0, 20, byte_order='little_endian')]). - * decode(b'\xde\xad\xbe\xef\xde\xad')['s']) - */ - - std::map shifts = { - {0, 0xEADDEu}, {1, 0xF56EFu}, {2, 0xFAB77u}, {3, 0x7D5BBu}, {4, 0xBEADDu}, {5, 0xDF56Eu}, - {6, 0xEFAB7u}, {7, 0xF7D5Bu}, {8, 0xFBEADu}, {9, 0x7DF56u}, {10, 0xBEFABu}, {11, 0xDF7D5u}, - }; - - can::V1_0::CanMessage msg = {}; - msg.payload = {0xDE, 0xAD, 0xBE, 0xEF, 0xCC, 0xCC}; - - for (auto const& [start, expected] : shifts) { - Signal s(start, 20); - ASSERT_EQ(expected, s.get(msg)) << "shift of " << start << " failed"; - } -} - -TEST(SignalTest, TestSetStart4) { - /* Data generated with Python3: - * - * from cantools.database.can import * - * so=4 ; sl=8 - * md = Message(1, 'm', 4, [Signal('a1', 0, so), Signal('a2', so+sl, 32-so-sl), - * Signal('s', so, sl, byte_order='little_endian')]) - * m = md.decode(b'\xcc\xcc\xcc\xcc') - * m['s'] = 0xDE - * binascii.hexlify(md.encode(m)).upper() - */ - typedef struct { - int start; - int length; - Signal::value setValue; - hidl_vec payload; - } case_t; - - std::vector cases = { - {0, 4, 0xDu, {0xCD, 0xCC, 0xCC, 0xCC}}, {4, 4, 0xDu, {0xDC, 0xCC, 0xCC, 0xCC}}, - {4, 8, 0xDEu, {0xEC, 0xCD, 0xCC, 0xCC}}, {4, 16, 0xDEADu, {0xDC, 0xEA, 0xCD, 0xCC}}, - {4, 24, 0xDEADBEu, {0xEC, 0xDB, 0xEA, 0xCD}}, {4, 28, 0xDEADBEEu, {0xEC, 0xBE, 0xAD, 0xDE}}, - {12, 8, 0xDEu, {0xCC, 0xEC, 0xCD, 0xCC}}, {12, 12, 0xDEAu, {0xCC, 0xAC, 0xDE, 0xCC}}, - {12, 16, 0xDEADu, {0xCC, 0xDC, 0xEA, 0xCD}}, {12, 20, 0xDEADBu, {0xCC, 0xBC, 0xAD, 0xDE}}, - }; - - can::V1_0::CanMessage msg = {}; - msg.payload = {0xCC, 0xCC, 0xCC, 0xCC}; - - for (auto const& tcase : cases) { - Signal s(tcase.start, tcase.length); - - can::V1_0::CanMessage expectedMsg = {}; - expectedMsg.payload = tcase.payload; - - can::V1_0::CanMessage editedMsg = msg; - s.set(editedMsg, tcase.setValue); - - ASSERT_EQ(expectedMsg, editedMsg) << " set(" << tcase.start << ", " << tcase.length << ")"; - } -} - -TEST(SignalTest, TestSetAllStarts) { - /* Data generated with Python3: - * from cantools.database.can import * - * import binascii - * import textwrap - * - * length = 20 - * for start in range(0, 32 - length): - * signals = [Signal('s', start, length, byte_order='little_endian')] - * if start > 0: signals.append(Signal('a', 0, start, byte_order='little_endian')) - * signals.append(Signal('b', start + length, 32 - start - length, - * byte_order='little_endian')) - * - * md = Message(1, 'm', 4, signals) - * m = md.decode(b'\xcc\xcc\xcc\xcc') - * m['s'] = 0xDEADB - * out = binascii.hexlify(md.encode(m)).decode('ascii').upper() - * out = ', '.join(['0x{}'.format(v) for v in textwrap.wrap(out, 2)]) - * print('{{ {:d}, {{ {:s} }}}},'.format(start, out)) - */ - - std::map> shifts = { - {0, {0xDB, 0xEA, 0xCD, 0xCC}}, {1, {0xB6, 0xD5, 0xDB, 0xCC}}, {2, {0x6C, 0xAB, 0xF7, 0xCC}}, - {3, {0xDC, 0x56, 0xEF, 0xCC}}, {4, {0xBC, 0xAD, 0xDE, 0xCC}}, {5, {0x6C, 0x5B, 0xBD, 0xCD}}, - {6, {0xCC, 0xB6, 0x7A, 0xCF}}, {7, {0xCC, 0x6D, 0xF5, 0xCE}}, {8, {0xCC, 0xDB, 0xEA, 0xCD}}, - {9, {0xCC, 0xB6, 0xD5, 0xDB}}, {10, {0xCC, 0x6C, 0xAB, 0xF7}}, {11, {0xCC, 0xDC, 0x56, 0xEF}}, - }; - - can::V1_0::CanMessage msg = {}; - msg.payload = {0xCC, 0xCC, 0xCC, 0xCC}; - - for (auto const& [start, expectedPayload] : shifts) { - Signal s(start, 20); - - can::V1_0::CanMessage expectedMsg = {}; - expectedMsg.payload = expectedPayload; - - can::V1_0::CanMessage editedMsg = msg; - s.set(editedMsg, 0xDEADB); - - ASSERT_EQ(expectedMsg, editedMsg) << "shift of " << start << " failed"; - } -} - -} // namespace android::hardware::automotive::protocan::unittest -- GitLab From 9035e7c6f041acbc78c4b43749ebbdce8162e9a5 Mon Sep 17 00:00:00 2001 From: Ji Soo Shin Date: Wed, 5 Jan 2022 11:58:21 +0100 Subject: [PATCH 385/825] Revert "Revert "Move libprotocan to hardware/interfaces/automotive domain"" Fixed the offending line :( This reverts commit 7f6d54c371b3480ccd07b747a872418443c76937. Bug: 213244647 Change-Id: Ic90560ea970705a42466ece3ba2d7422f37a706e --- .../can/1.0/tools/libprotocan/Android.bp | 42 ++++ .../can/1.0/tools/libprotocan/Checksum.cpp | 28 +++ .../1.0/tools/libprotocan/MessageCounter.cpp | 61 +++++ .../can/1.0/tools/libprotocan/MessageDef.cpp | 62 +++++ .../1.0/tools/libprotocan/MessageInjector.cpp | 110 +++++++++ .../can/1.0/tools/libprotocan/Signal.cpp | 84 +++++++ .../include/libprotocan/Checksum.h | 37 +++ .../include/libprotocan/MessageCounter.h | 55 +++++ .../include/libprotocan/MessageDef.h | 69 ++++++ .../include/libprotocan/MessageInjector.h | 78 +++++++ .../libprotocan/include/libprotocan/Signal.h | 50 ++++ .../1.0/tools/libprotocan/tests/Android.bp | 39 ++++ .../tests/libprotocan_signal_test.cpp | 218 ++++++++++++++++++ 13 files changed, 933 insertions(+) create mode 100644 automotive/can/1.0/tools/libprotocan/Android.bp create mode 100644 automotive/can/1.0/tools/libprotocan/Checksum.cpp create mode 100644 automotive/can/1.0/tools/libprotocan/MessageCounter.cpp create mode 100644 automotive/can/1.0/tools/libprotocan/MessageDef.cpp create mode 100644 automotive/can/1.0/tools/libprotocan/MessageInjector.cpp create mode 100644 automotive/can/1.0/tools/libprotocan/Signal.cpp create mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/Checksum.h create mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageCounter.h create mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageDef.h create mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageInjector.h create mode 100644 automotive/can/1.0/tools/libprotocan/include/libprotocan/Signal.h create mode 100644 automotive/can/1.0/tools/libprotocan/tests/Android.bp create mode 100644 automotive/can/1.0/tools/libprotocan/tests/libprotocan_signal_test.cpp diff --git a/automotive/can/1.0/tools/libprotocan/Android.bp b/automotive/can/1.0/tools/libprotocan/Android.bp new file mode 100644 index 0000000000..4c23fada29 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/Android.bp @@ -0,0 +1,42 @@ +// +// 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. +// + +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_library_static { + name: "libprotocan", + defaults: ["android.hardware.automotive.can@defaults"], + vendor: true, + srcs: [ + "Checksum.cpp", + "MessageCounter.cpp", + "MessageDef.cpp", + "MessageInjector.cpp", + "Signal.cpp", + ], + export_include_dirs: ["include"], + + shared_libs: [ + "android.hardware.automotive.can@1.0", + ], +} diff --git a/automotive/can/1.0/tools/libprotocan/Checksum.cpp b/automotive/can/1.0/tools/libprotocan/Checksum.cpp new file mode 100644 index 0000000000..72fb0af1a7 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/Checksum.cpp @@ -0,0 +1,28 @@ +/* + * 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. + */ + +#include + +namespace android::hardware::automotive::protocan { + +Checksum::Checksum(Signal signal, formula f) : mSignal(signal), mFormula(f) {} + +void Checksum::update(can::V1_0::CanMessage& msg) const { + mSignal.set(msg, 0); + mSignal.set(msg, mFormula(msg) % (mSignal.maxValue + 1)); +} + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/MessageCounter.cpp b/automotive/can/1.0/tools/libprotocan/MessageCounter.cpp new file mode 100644 index 0000000000..ef9882fd8c --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/MessageCounter.cpp @@ -0,0 +1,61 @@ +/* + * 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. + */ + +#include + +#include + +namespace android::hardware::automotive::protocan { + +/** Whether to log counter state messages. */ +static constexpr bool kSuperVerbose = false; + +MessageCounter::MessageCounter(Signal signal) : upperBound(signal.maxValue + 1), mSignal(signal) {} + +Signal::value MessageCounter::next() const { + CHECK(mCurrent.has_value()) << "Counter not initialized. Did you call isReady?"; + return (*mCurrent + 1) % upperBound; +} + +void MessageCounter::read(const can::V1_0::CanMessage& msg) { + auto val = mSignal.get(msg); + + if (!mCurrent.has_value()) { + LOG(VERBOSE) << "Got first counter val of " << val; + mCurrent = val; + return; + } + + auto nextVal = next(); + if (nextVal == val) { + if constexpr (kSuperVerbose) { + LOG(VERBOSE) << "Got next counter val of " << nextVal; + } + mCurrent = nextVal; + } else { + LOG(DEBUG) << "Ignoring next counter val of " << val << ", waiting for " << nextVal; + } +} + +bool MessageCounter::isReady() const { return mCurrent.has_value(); } + +void MessageCounter::increment(can::V1_0::CanMessage& msg) { + auto newVal = next(); + mCurrent = newVal; + mSignal.set(msg, newVal); +} + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/MessageDef.cpp b/automotive/can/1.0/tools/libprotocan/MessageDef.cpp new file mode 100644 index 0000000000..23ce1df640 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/MessageDef.cpp @@ -0,0 +1,62 @@ +/* + * 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. + */ + +#include + +#include + +namespace android::hardware::automotive::protocan { + +using can::V1_0::CanMessage; +using can::V1_0::CanMessageId; + +MessageDef::MessageDef(CanMessageId id, uint16_t len, std::map signals, + std::optional counter, std::optional checksum) + : id(id), kLen(len), kSignals(std::move(signals)), kCounter(counter), kChecksum(checksum) {} + +const Signal& MessageDef::operator[](const std::string& signalName) const { + auto it = kSignals.find(signalName); + CHECK(it != kSignals.end()) << "Signal " << signalName << " doesn't exist"; + return it->second; +} + +CanMessage MessageDef::makeDefault() const { + CanMessage msg = {}; + msg.id = id; + msg.payload.resize(kLen); + + for (auto const& [name, signal] : kSignals) { + signal.setDefault(msg); + } + + return msg; +} + +MessageCounter MessageDef::makeCounter() const { + CHECK(kCounter.has_value()) << "Can't build a counter for message without such signal"; + return MessageCounter(*kCounter); +} + +void MessageDef::updateChecksum(can::V1_0::CanMessage& msg) const { + if (!kChecksum.has_value()) return; + kChecksum->update(msg); +} + +bool MessageDef::validate(const can::V1_0::CanMessage& msg) const { + return msg.payload.size() >= kLen; +} + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/MessageInjector.cpp b/automotive/can/1.0/tools/libprotocan/MessageInjector.cpp new file mode 100644 index 0000000000..7c45eaa025 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/MessageInjector.cpp @@ -0,0 +1,110 @@ +/* + * 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. + */ + +#include + +#include + +#include + +namespace android::hardware::automotive::protocan { + +/** Whether to log injected messages. */ +static constexpr bool kSuperVerbose = true; + +using namespace std::literals::chrono_literals; + +using can::V1_0::CanMessage; +using can::V1_0::CanMessageId; +using can::V1_0::ICanBus; +using can::V1_0::Result; + +MessageInjector::MessageInjector(MessageDef msgDef, + std::optional interMessageDelay) + : kMsgDef(std::move(msgDef)), + kInterMessageDelay(interMessageDelay), + mCounter(msgDef.makeCounter()) {} + +void MessageInjector::inject(const CanMessage& msg) { inject({msg}); } + +void MessageInjector::inject(const std::initializer_list msgs) { + std::lock_guard lock(mMessagesGuard); + for (const auto& msg : msgs) { + if constexpr (kSuperVerbose) { + LOG(VERBOSE) << "Message scheduled for injection: " << toString(msg); + } + + mMessages.push(msg); + } +} + +void MessageInjector::processQueueLocked(can::V1_0::ICanBus& bus) { + if (mMessages.empty() || !mCounter.isReady()) return; + + auto paddingMessagesCount = mCounter.upperBound - (mMessages.size() % mCounter.upperBound); + auto padMessage = kMsgDef.makeDefault(); + for (unsigned i = 0; i < paddingMessagesCount; i++) { + mMessages.push(padMessage); + } + + while (!mMessages.empty()) { + auto&& outMsg = mMessages.front(); + + mCounter.increment(outMsg); + kMsgDef.updateChecksum(outMsg); + + if constexpr (kSuperVerbose) { + LOG(VERBOSE) << "Injecting message: " << toString(outMsg); + } + auto result = bus.send(outMsg); + if (result != Result::OK) { + LOG(ERROR) << "Message injection failed: " << toString(result); + } + + mMessages.pop(); + + // This would block onReceive, but the class is not supposed to be used in production anyway + // (see MessageInjector docstring). + if (kInterMessageDelay.has_value()) { + std::this_thread::sleep_for(*kInterMessageDelay); + } + } +} + +void MessageInjector::onReceive(ICanBus& bus, const CanMessage& msg) { + if (!kMsgDef.validate(msg)) return; + + std::lock_guard lock(mMessagesGuard); + + mCounter.read(msg); + processQueueLocked(bus); +} + +MessageInjectorManager::MessageInjectorManager( + std::initializer_list> injectors) { + std::transform(injectors.begin(), injectors.end(), std::inserter(mInjectors, mInjectors.end()), + [](const std::shared_ptr& injector) { + return std::make_pair(injector->kMsgDef.id, std::move(injector)); + }); +} + +void MessageInjectorManager::onReceive(sp bus, const CanMessage& msg) { + auto it = mInjectors.find(msg.id); + if (it == mInjectors.end()) return; + it->second->onReceive(*bus, msg); +} + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/Signal.cpp b/automotive/can/1.0/tools/libprotocan/Signal.cpp new file mode 100644 index 0000000000..bc3e070ca1 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/Signal.cpp @@ -0,0 +1,84 @@ +/* + * 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. + */ + +#include + +#include + +namespace android::hardware::automotive::protocan { + +static uint8_t calculateLastByteMask(uint16_t start, uint8_t length) { + unsigned lastByteBits = (start + length) % 8; + unsigned lastBytePadding = (8 - lastByteBits) % 8; + return 0xFF >> lastBytePadding; +} + +static uint8_t calculateFirstByteMask(uint16_t firstByte, uint8_t firstBit, uint16_t lastByte, + uint8_t lastMask) { + uint8_t firstMask = 0xFF << firstBit; + if (firstByte == lastByte) firstMask &= lastMask; + return firstMask; +} + +Signal::Signal(uint16_t start, uint8_t length, value defVal) + : maxValue((1u << length) - 1), + kFirstByte(start / 8), + kFirstBit(start % 8), + kFirstByteBits(8 - kFirstBit), + kLastByte((start + length - 1) / 8), + kLastMask(calculateLastByteMask(start, length)), + kFirstMask(calculateFirstByteMask(kFirstByte, kFirstBit, kLastByte, kLastMask)), + kDefVal(defVal) { + CHECK(length > 0) << "Signal length must not be zero"; +} + +Signal::value Signal::get(const can::V1_0::CanMessage& msg) const { + CHECK(msg.payload.size() > kLastByte) + << "Message is too short. Did you call MessageDef::validate?"; + + Signal::value v = 0; + if (kLastByte != kFirstByte) v = kLastMask & msg.payload[kLastByte]; + + for (int i = kLastByte - 1; i > kFirstByte; i--) { + v = (v << 8) | msg.payload[i]; + } + + return (v << kFirstByteBits) | ((msg.payload[kFirstByte] & kFirstMask) >> kFirstBit); +} + +void Signal::set(can::V1_0::CanMessage& msg, Signal::value val) const { + CHECK(msg.payload.size() > kLastByte) + << "Signal requires message of length " << (kLastByte + 1) + << " which is beyond message length of " << msg.payload.size(); + + uint8_t firstByte = val << kFirstBit; + val >>= kFirstByteBits; + + msg.payload[kFirstByte] = (msg.payload[kFirstByte] & ~kFirstMask) | (firstByte & kFirstMask); + + for (int i = kFirstByte + 1; i < kLastByte; i++) { + msg.payload[i] = val & 0xFF; + val >>= 8; + } + + if (kLastByte != kFirstByte) { + msg.payload[kLastByte] = (msg.payload[kLastByte] & ~kLastMask) | (val & kLastMask); + } +} + +void Signal::setDefault(can::V1_0::CanMessage& msg) const { set(msg, kDefVal); } + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/Checksum.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/Checksum.h new file mode 100644 index 0000000000..ff1dc91a50 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/include/libprotocan/Checksum.h @@ -0,0 +1,37 @@ +/* + * 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. + */ + +#pragma once + +#include +#include + +namespace android::hardware::automotive::protocan { + +class Checksum { + public: + using formula = std::function; + + Checksum(Signal signal, formula f); + + void update(can::V1_0::CanMessage& msg) const; + + private: + const Signal mSignal; + const formula mFormula; +}; + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageCounter.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageCounter.h new file mode 100644 index 0000000000..56113be61f --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageCounter.h @@ -0,0 +1,55 @@ +/* + * 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. + */ + +#pragma once + +#include +#include + +namespace android::hardware::automotive::protocan { + +class MessageCounter { + public: + const Signal::value upperBound; + + MessageCounter(Signal signal); + + /** + * Parse CAN message sent by external ECU to determine current counter value. + */ + void read(const can::V1_0::CanMessage& msg); + + /** + * States whether current counter value is determined. + */ + bool isReady() const; + + /** + * Increment current counter value and set it in a new message. + * + * Caller must check isReady() at least once before calling this method. + */ + void increment(can::V1_0::CanMessage& msg); + + private: + const Signal mSignal; + + std::optional mCurrent = std::nullopt; + + Signal::value next() const; +}; + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageDef.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageDef.h new file mode 100644 index 0000000000..79b21e17b4 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageDef.h @@ -0,0 +1,69 @@ +/* + * 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. + */ + +#pragma once + +#include +#include +#include +#include + +namespace android::hardware::automotive::protocan { + +/** + * CAN message definition (not the actual message data). + * + * Describes static message properties (message ID, signals etc). + */ +class MessageDef { + public: + const can::V1_0::CanMessageId id; + + /** + * Create message definition. + * + * Currently only constant length messages are supported. + * + * \param id CAN message ID + * \param len CAN message length + * \param signals CAN signal definitions + * \param counter Designated CAN signal definition for message counter, if the message has one + * \param checksum Designated CAN signal definition for payload checksum, if the message has one + */ + MessageDef(can::V1_0::CanMessageId id, uint16_t len, std::map signals, + std::optional counter = std::nullopt, + std::optional checksum = std::nullopt); + + const Signal& operator[](const std::string& signalName) const; + + can::V1_0::CanMessage makeDefault() const; + MessageCounter makeCounter() const; + + void updateChecksum(can::V1_0::CanMessage& msg) const; + + /** + * Validate the message payload is large enough to hold all the signals. + */ + bool validate(const can::V1_0::CanMessage& msg) const; + +private: + const uint16_t kLen; + const std::map kSignals; + const std::optional kCounter; + const std::optional kChecksum; +}; + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageInjector.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageInjector.h new file mode 100644 index 0000000000..b0ea260640 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/include/libprotocan/MessageInjector.h @@ -0,0 +1,78 @@ +/* + * 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. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include + +namespace android::hardware::automotive::protocan { + +class MessageInjectorManager; + +/** + * Injects CAN messages with a counter to an existing system. + * + * This class is NOT meant to use in production - there should be no need to inject counted CAN + * messages where the other sender is also broadcasting them. If this is the case, it may be a sign + * your CAN network needs a redesign. This tool is intended for use for testing and demo purposes. + */ +class MessageInjector { + public: + MessageInjector(MessageDef msgDef, std::optional interMessageDelay); + + void inject(const can::V1_0::CanMessage& msg); + void inject(const std::initializer_list msgs); + + private: + const MessageDef kMsgDef; + const std::optional kInterMessageDelay; + MessageCounter mCounter; + + mutable std::mutex mMessagesGuard; + std::queue mMessages GUARDED_BY(mMessagesGuard); + + void onReceive(can::V1_0::ICanBus& bus, const can::V1_0::CanMessage& msg); + void processQueueLocked(can::V1_0::ICanBus& bus); + + friend class MessageInjectorManager; + + DISALLOW_COPY_AND_ASSIGN(MessageInjector); +}; + +/** + * Routes intercepted messages to MessageInjector instances configured to handle specific CAN + * message (CAN message ID). Intercepted messages from other nodes in CAN network are used to read + * current counter value in order to spoof the next packet. + */ +class MessageInjectorManager { + public: + MessageInjectorManager(std::initializer_list> injectors); + + void onReceive(sp bus, const can::V1_0::CanMessage& msg); + + private: + std::map> mInjectors; + + DISALLOW_COPY_AND_ASSIGN(MessageInjectorManager); +}; + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/include/libprotocan/Signal.h b/automotive/can/1.0/tools/libprotocan/include/libprotocan/Signal.h new file mode 100644 index 0000000000..7c0f11933a --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/include/libprotocan/Signal.h @@ -0,0 +1,50 @@ +/* + * 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. + */ + +#pragma once + +#include +#include + +namespace android::hardware::automotive::protocan { + +/** + * TODO(twasilczyk): right now, only Little Endian signals are supported. + */ +class Signal { + public: + using value = uint64_t; + + const value maxValue; + + Signal(uint16_t start, uint8_t length, value defVal = 0); + + value get(const can::V1_0::CanMessage& msg) const; + void set(can::V1_0::CanMessage& msg, value val) const; + void setDefault(can::V1_0::CanMessage& msg) const; + + private: + const uint16_t kFirstByte; ///< Index of first byte that holds the signal + const uint8_t kFirstBit; ///< Index of first bit within first byte + const uint8_t kFirstByteBits; ///< How many bits of the first byte belong to the signal + const uint16_t kLastByte; ///< Index of last byte that holds the signal + const uint8_t kLastMask; ///< Bits of the last byte that belong to the signal + const uint8_t kFirstMask; ///< Bits of the first byte that belong to the signal + + const value kDefVal; +}; + +} // namespace android::hardware::automotive::protocan diff --git a/automotive/can/1.0/tools/libprotocan/tests/Android.bp b/automotive/can/1.0/tools/libprotocan/tests/Android.bp new file mode 100644 index 0000000000..251cc061cd --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/tests/Android.bp @@ -0,0 +1,39 @@ +// +// 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. +// + +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: "libprotocan_signal_test", + defaults: ["android.hardware.automotive.can@defaults"], + vendor: true, + gtest: true, + srcs: ["libprotocan_signal_test.cpp"], + static_libs: [ + "libprotocan", + ], + shared_libs: [ + "android.hardware.automotive.can@1.0", + "libhidlbase", + ], +} diff --git a/automotive/can/1.0/tools/libprotocan/tests/libprotocan_signal_test.cpp b/automotive/can/1.0/tools/libprotocan/tests/libprotocan_signal_test.cpp new file mode 100644 index 0000000000..19c12099e6 --- /dev/null +++ b/automotive/can/1.0/tools/libprotocan/tests/libprotocan_signal_test.cpp @@ -0,0 +1,218 @@ +/* + * 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. + */ + +#include + +#include + +namespace android::hardware::automotive::protocan::unittest { + +TEST(SignalTest, TestGetSingleBytes) { + can::V1_0::CanMessage msg = {}; + msg.payload = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + for (unsigned i = 0; i < msg.payload.size(); i++) { + Signal signal(8 * i, 8); + ASSERT_EQ(i, signal.get(msg)); + } +} + +TEST(SignalTest, TestSetSingleBytes) { + std::vector msgs = {{}, {}, {}}; + msgs[0].payload = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; + msgs[1].payload = {0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB}; + msgs[2].payload = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + for (unsigned i = 0; i < msgs[0].payload.size(); i++) { + Signal signal(8 * i, 8); + + for (auto&& msgOriginal : msgs) { + auto msgModified = msgOriginal; + signal.set(msgModified, 0xBA); + + auto msgExpected = msgOriginal; + msgExpected.payload[i] = 0xBA; + + ASSERT_EQ(msgExpected, msgModified) << "i=" << i; + } + } +} + +TEST(SignalTest, TestGetStart4) { + /* Data generated with Python3: + * + * from cantools.database.can import * + * hex(Message(1, 'm', 4, [Signal('s', 4, 16, byte_order='little_endian')]). + * decode(b'\xde\xad\xbe\xef')['s']) + */ + + can::V1_0::CanMessage msg = {}; + msg.payload = {0xDE, 0xAD, 0xBE, 0xEF}; + can::V1_0::CanMessage msg2 = {}; + msg2.payload = {0xDE, 0xAD, 0xBE, 0xEF, 0xDE, 0xAD}; + + Signal s0_4(0, 4); + Signal s4_4(4, 4); + Signal s4_8(4, 8); + Signal s4_16(4, 16); + Signal s4_28(4, 28); + Signal s12_8(12, 8); + Signal s12_12(12, 12); + Signal s12_16(12, 16); + Signal s12_20(12, 20); + Signal s12_32(12, 32); + + ASSERT_EQ(0xEu, s0_4.get(msg)); + ASSERT_EQ(0xDu, s4_4.get(msg)); + ASSERT_EQ(0xDDu, s4_8.get(msg)); + ASSERT_EQ(0xEADDu, s4_16.get(msg)); + ASSERT_EQ(0xEFBEADDu, s4_28.get(msg)); + ASSERT_EQ(0xEAu, s12_8.get(msg)); + ASSERT_EQ(0xBEAu, s12_12.get(msg)); + ASSERT_EQ(0xFBEAu, s12_16.get(msg)); + ASSERT_EQ(0xEFBEAu, s12_20.get(msg)); + ASSERT_EQ(0xDDEEFBEAu, s12_32.get(msg2)); +} + +TEST(SignalTest, TestGet64) { + /* Data generated with Python3: + * + * from cantools.database.can import * + * hex(Message(1, 'm', 9, [Signal('s', 4, 64, byte_order='little_endian')]). + * decode(b'\xde\xad\xbe\xef\xab\xbc\xcd\xde\xef')['s']) + */ + + can::V1_0::CanMessage msg = {}; + msg.payload = {0xDE, 0xAD, 0xBE, 0xEF, 0xAB, 0xBC, 0xCD, 0xDE, 0xEF}; + + Signal s0_64(0, 64); + Signal s8_64(8, 64); + Signal s4_64(4, 64); + Signal s1_64(1, 64); + + ASSERT_EQ(0xDECDBCABEFBEADDEu, s0_64.get(msg)); + ASSERT_EQ(0xEFDECDBCABEFBEADu, s8_64.get(msg)); + ASSERT_EQ(0xFDECDBCABEFBEADDu, s4_64.get(msg)); + ASSERT_EQ(0xEF66DE55F7DF56EFu, s1_64.get(msg)); +} + +TEST(SignalTest, TestGetAllStarts) { + /* Data generated with Python3: + * + * from cantools.database.can import * + * hex(Message(1, 'm', 6, [Signal('s', 0, 20, byte_order='little_endian')]). + * decode(b'\xde\xad\xbe\xef\xde\xad')['s']) + */ + + std::map shifts = { + {0, 0xEADDEu}, {1, 0xF56EFu}, {2, 0xFAB77u}, {3, 0x7D5BBu}, {4, 0xBEADDu}, {5, 0xDF56Eu}, + {6, 0xEFAB7u}, {7, 0xF7D5Bu}, {8, 0xFBEADu}, {9, 0x7DF56u}, {10, 0xBEFABu}, {11, 0xDF7D5u}, + }; + + can::V1_0::CanMessage msg = {}; + msg.payload = {0xDE, 0xAD, 0xBE, 0xEF, 0xCC, 0xCC}; + + for (auto const& [start, expected] : shifts) { + Signal s(start, 20); + ASSERT_EQ(expected, s.get(msg)) << "shift of " << start << " failed"; + } +} + +TEST(SignalTest, TestSetStart4) { + /* Data generated with Python3: + * + * from cantools.database.can import * + * so=4 ; sl=8 + * md = Message(1, 'm', 4, [Signal('a1', 0, so), Signal('a2', so+sl, 32-so-sl), + * Signal('s', so, sl, byte_order='little_endian')]) + * m = md.decode(b'\xcc\xcc\xcc\xcc') + * m['s'] = 0xDE + * binascii.hexlify(md.encode(m)).upper() + */ + typedef struct { + int start; + int length; + Signal::value setValue; + hidl_vec payload; + } case_t; + + std::vector cases = { + {0, 4, 0xDu, {0xCD, 0xCC, 0xCC, 0xCC}}, {4, 4, 0xDu, {0xDC, 0xCC, 0xCC, 0xCC}}, + {4, 8, 0xDEu, {0xEC, 0xCD, 0xCC, 0xCC}}, {4, 16, 0xDEADu, {0xDC, 0xEA, 0xCD, 0xCC}}, + {4, 24, 0xDEADBEu, {0xEC, 0xDB, 0xEA, 0xCD}}, {4, 28, 0xDEADBEEu, {0xEC, 0xBE, 0xAD, 0xDE}}, + {12, 8, 0xDEu, {0xCC, 0xEC, 0xCD, 0xCC}}, {12, 12, 0xDEAu, {0xCC, 0xAC, 0xDE, 0xCC}}, + {12, 16, 0xDEADu, {0xCC, 0xDC, 0xEA, 0xCD}}, {12, 20, 0xDEADBu, {0xCC, 0xBC, 0xAD, 0xDE}}, + }; + + can::V1_0::CanMessage msg = {}; + msg.payload = {0xCC, 0xCC, 0xCC, 0xCC}; + + for (auto const& tcase : cases) { + Signal s(tcase.start, tcase.length); + + can::V1_0::CanMessage expectedMsg = {}; + expectedMsg.payload = tcase.payload; + + can::V1_0::CanMessage editedMsg = msg; + s.set(editedMsg, tcase.setValue); + + ASSERT_EQ(expectedMsg, editedMsg) << " set(" << tcase.start << ", " << tcase.length << ")"; + } +} + +TEST(SignalTest, TestSetAllStarts) { + /* Data generated with Python3: + * from cantools.database.can import * + * import binascii + * import textwrap + * + * length = 20 + * for start in range(0, 32 - length): + * signals = [Signal('s', start, length, byte_order='little_endian')] + * if start > 0: signals.append(Signal('a', 0, start, byte_order='little_endian')) + * signals.append(Signal('b', start + length, 32 - start - length, + * byte_order='little_endian')) + * + * md = Message(1, 'm', 4, signals) + * m = md.decode(b'\xcc\xcc\xcc\xcc') + * m['s'] = 0xDEADB + * out = binascii.hexlify(md.encode(m)).decode('ascii').upper() + * out = ', '.join(['0x{}'.format(v) for v in textwrap.wrap(out, 2)]) + * print('{{ {:d}, {{ {:s} }}}},'.format(start, out)) + */ + + std::map> shifts = { + {0, {0xDB, 0xEA, 0xCD, 0xCC}}, {1, {0xB6, 0xD5, 0xDB, 0xCC}}, {2, {0x6C, 0xAB, 0xF7, 0xCC}}, + {3, {0xDC, 0x56, 0xEF, 0xCC}}, {4, {0xBC, 0xAD, 0xDE, 0xCC}}, {5, {0x6C, 0x5B, 0xBD, 0xCD}}, + {6, {0xCC, 0xB6, 0x7A, 0xCF}}, {7, {0xCC, 0x6D, 0xF5, 0xCE}}, {8, {0xCC, 0xDB, 0xEA, 0xCD}}, + {9, {0xCC, 0xB6, 0xD5, 0xDB}}, {10, {0xCC, 0x6C, 0xAB, 0xF7}}, {11, {0xCC, 0xDC, 0x56, 0xEF}}, + }; + + can::V1_0::CanMessage msg = {}; + msg.payload = {0xCC, 0xCC, 0xCC, 0xCC}; + + for (auto const& [start, expectedPayload] : shifts) { + Signal s(start, 20); + + can::V1_0::CanMessage expectedMsg = {}; + expectedMsg.payload = expectedPayload; + + can::V1_0::CanMessage editedMsg = msg; + s.set(editedMsg, 0xDEADB); + + ASSERT_EQ(expectedMsg, editedMsg) << "shift of " << start << " failed"; + } +} + +} // namespace android::hardware::automotive::protocan::unittest -- GitLab From 1afbd5f23e0f72b7f03ed15ce973371f18f9d2c3 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Wed, 24 Nov 2021 16:39:13 -0800 Subject: [PATCH 386/825] Add navigation methods to IGnss AIDL HAL (hardware/interfaces) Bug: 205185251 Test: atest VtsHalGnssTargetTest Change-Id: Ib412aeb0b302952d13e236554f00690206b98253 --- .../current/android/hardware/gnss/IAGnss.aidl | 4 +- .../current/android/hardware/gnss/IGnss.aidl | 34 ++ .../android/hardware/gnss/IGnssCallback.aidl | 52 +++ gnss/aidl/android/hardware/gnss/IAGnss.aidl | 5 +- gnss/aidl/android/hardware/gnss/IGnss.aidl | 125 +++++++ .../android/hardware/gnss/IGnssCallback.aidl | 258 ++++++++++++++ gnss/aidl/default/Gnss.cpp | 183 ++++++++-- gnss/aidl/default/Gnss.h | 30 ++ gnss/aidl/default/GnssConfiguration.cpp | 10 + gnss/aidl/default/GnssConfiguration.h | 2 + gnss/aidl/vts/GnssBatchingCallback.cpp | 2 + gnss/aidl/vts/GnssCallbackAidl.cpp | 57 ++- gnss/aidl/vts/GnssCallbackAidl.h | 28 +- gnss/aidl/vts/gnss_hal_test.cpp | 262 +++++++++++++- gnss/aidl/vts/gnss_hal_test.h | 41 +++ gnss/aidl/vts/gnss_hal_test_cases.cpp | 324 ++++++++++-------- gnss/common/utils/default/Utils.cpp | 59 +++- gnss/common/utils/default/include/Utils.h | 5 + gnss/common/utils/vts/Android.bp | 1 + gnss/common/utils/vts/Utils.cpp | 72 +--- gnss/common/utils/vts/include/Utils.h | 78 ++++- .../utils/vts/include/v2_1/GnssCallback.h | 1 - 22 files changed, 1360 insertions(+), 273 deletions(-) diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnss.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnss.aidl index f02e08cc39..1a69f3338a 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnss.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnss.aidl @@ -37,8 +37,8 @@ interface IAGnss { void setCallback(in android.hardware.gnss.IAGnssCallback callback); void dataConnClosed(); void dataConnFailed(); - void setServer(in android.hardware.gnss.IAGnssCallback.AGnssType type, in String hostname, in int port); - void dataConnOpen(in long networkHandle, in String apn, in android.hardware.gnss.IAGnss.ApnIpType apnIpType); + void setServer(in android.hardware.gnss.IAGnssCallback.AGnssType type, in @utf8InCpp String hostname, in int port); + void dataConnOpen(in long networkHandle, in @utf8InCpp String apn, in android.hardware.gnss.IAGnss.ApnIpType apnIpType); @Backing(type="int") @VintfStability enum ApnIpType { INVALID = 0, 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 34773805f4..1b4c5817ce 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 @@ -46,7 +46,41 @@ interface IGnss { android.hardware.gnss.IAGnss getExtensionAGnss(); android.hardware.gnss.IGnssDebug getExtensionGnssDebug(); android.hardware.gnss.visibility_control.IGnssVisibilityControl getExtensionGnssVisibilityControl(); + void start(); + void stop(); + void injectTime(in long timeMs, in long timeReferenceMs, in int uncertaintyMs); + void injectLocation(in android.hardware.gnss.GnssLocation location); + void injectBestLocation(in android.hardware.gnss.GnssLocation location); + void deleteAidingData(in android.hardware.gnss.IGnss.GnssAidingData aidingDataFlags); + void setPositionMode(in android.hardware.gnss.IGnss.GnssPositionMode mode, in android.hardware.gnss.IGnss.GnssPositionRecurrence recurrence, in int minIntervalMs, in int preferredAccuracyMeters, in int preferredTimeMs, in boolean lowPowerMode); const int ERROR_INVALID_ARGUMENT = 1; const int ERROR_ALREADY_INIT = 2; const int ERROR_GENERIC = 3; + @Backing(type="int") @VintfStability + enum GnssPositionMode { + STANDALONE = 0, + MS_BASED = 1, + MS_ASSISTED = 2, + } + @Backing(type="int") @VintfStability + enum GnssPositionRecurrence { + RECURRENCE_PERIODIC = 0, + RECURRENCE_SINGLE = 1, + } + @Backing(type="int") @VintfStability + enum GnssAidingData { + DELETE_EPHEMERIS = 1, + DELETE_ALMANAC = 2, + DELETE_POSITION = 4, + DELETE_TIME = 8, + DELETE_IONO = 16, + DELETE_UTC = 32, + DELETE_HEALTH = 64, + DELETE_SVDIR = 128, + DELETE_SVSTEER = 256, + DELETE_SADATA = 512, + DELETE_RTI = 1024, + DELETE_CELLDB_INFO = 32768, + DELETE_ALL = 65535, + } } 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 fb0931c59a..957a75fe9a 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 @@ -35,8 +35,60 @@ package android.hardware.gnss; @VintfStability interface IGnssCallback { void gnssSetCapabilitiesCb(in int capabilities); + void gnssStatusCb(in android.hardware.gnss.IGnssCallback.GnssStatusValue status); + void gnssSvStatusCb(in android.hardware.gnss.IGnssCallback.GnssSvInfo[] svInfoList); + void gnssLocationCb(in android.hardware.gnss.GnssLocation location); + void gnssNmeaCb(in long timestamp, in @utf8InCpp String nmea); + void gnssAcquireWakelockCb(); + void gnssReleaseWakelockCb(); + void gnssSetSystemInfoCb(in android.hardware.gnss.IGnssCallback.GnssSystemInfo info); + void gnssRequestTimeCb(); + void gnssRequestLocationCb(in boolean independentFromGnss, in boolean isUserEmergency); + 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; + @Backing(type="int") @VintfStability + enum GnssStatusValue { + NONE = 0, + SESSION_BEGIN = 1, + SESSION_END = 2, + ENGINE_ON = 3, + ENGINE_OFF = 4, + } + @Backing(type="int") @VintfStability + enum GnssSvFlags { + NONE = 0, + HAS_EPHEMERIS_DATA = 1, + HAS_ALMANAC_DATA = 2, + USED_IN_FIX = 4, + HAS_CARRIER_FREQUENCY = 8, + } + @VintfStability + parcelable GnssSvInfo { + int svid; + android.hardware.gnss.GnssConstellationType constellation; + float cN0Dbhz; + float basebandCN0DbHz; + float elevationDegrees; + float azimuthDegrees; + long carrierFrequencyHz; + int svFlag; + } + @VintfStability + parcelable GnssSystemInfo { + int yearOfHw; + @utf8InCpp String name; + } } diff --git a/gnss/aidl/android/hardware/gnss/IAGnss.aidl b/gnss/aidl/android/hardware/gnss/IAGnss.aidl index 3e256e2e23..30b2167445 100644 --- a/gnss/aidl/android/hardware/gnss/IAGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IAGnss.aidl @@ -60,7 +60,7 @@ interface IAGnss { * @param hostname Hostname of the AGNSS server. * @param port Port number associated with the server. */ - void setServer(in AGnssType type, in String hostname, in int port); + void setServer(in AGnssType type, in @utf8InCpp String hostname, in int port); /** * Notifies GNSS that a data connection is available and sets the network handle, @@ -75,5 +75,6 @@ interface IAGnss { * @param apn Access Point Name (follows regular APN naming convention). * @param apnIpType Specifies IP type of APN. */ - void dataConnOpen(in long networkHandle, in String apn, in ApnIpType apnIpType); + void dataConnOpen( + in long networkHandle, in @utf8InCpp String apn, in ApnIpType apnIpType); } diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl index 1351f594e9..4ddc6a6193 100644 --- a/gnss/aidl/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl @@ -16,6 +16,7 @@ package android.hardware.gnss; +import android.hardware.gnss.GnssLocation; import android.hardware.gnss.IAGnss; import android.hardware.gnss.IGnssBatching; import android.hardware.gnss.IGnssCallback; @@ -45,6 +46,53 @@ interface IGnss { /** Any other error. */ const int ERROR_GENERIC = 3; + /** Requested operational mode for GNSS operation. */ + @VintfStability + @Backing(type="int") + enum GnssPositionMode { + /** Mode for running GNSS standalone (no assistance). */ + STANDALONE = 0, + /** AGNSS MS-Based mode. */ + MS_BASED = 1, + /** + * AGNSS MS-Assisted mode. This mode is not maintained by the platform anymore. + * It is strongly recommended to use MS_BASED instead. + */ + MS_ASSISTED = 2, + } + + /** Requested recurrence mode for GNSS operation. */ + @VintfStability + @Backing(type="int") + enum GnssPositionRecurrence { + /** Receive GNSS fixes on a recurring basis at a specified period. */ + RECURRENCE_PERIODIC = 0, + /** Request a single shot GNSS fix. */ + RECURRENCE_SINGLE = 1, + } + + /** + * Flags used to specify which aiding data to delete when calling + * deleteAidingData(). + */ + @VintfStability + @Backing(type="int") + enum GnssAidingData { + DELETE_EPHEMERIS = 0x0001, + DELETE_ALMANAC = 0x0002, + DELETE_POSITION = 0x0004, + DELETE_TIME = 0x0008, + DELETE_IONO = 0x0010, + DELETE_UTC = 0x0020, + DELETE_HEALTH = 0x0040, + DELETE_SVDIR = 0x0080, + DELETE_SVSTEER = 0x0100, + DELETE_SADATA = 0x0200, + DELETE_RTI = 0x0400, + DELETE_CELLDB_INFO = 0x8000, + DELETE_ALL = 0xFFFF + } + /** * Opens the interface and provides the callback routines to the implementation of this * interface. @@ -152,4 +200,81 @@ interface IGnss { * @return Handle to the IGnssVisibilityControl. */ IGnssVisibilityControl getExtensionGnssVisibilityControl(); + + /** + * Starts a location output stream using the IGnssCallback gnssLocationCb(), following the + * settings from the most recent call to setPositionMode(). + * + * This output must operate independently of any GNSS location batching operations, + * see the IGnssBatching for details. + */ + void start(); + + /** + * Stops the location output stream. + */ + void stop(); + + /** + * Injects the current time. + * + * @param timeMs This is the UTC time received from the NTP server, its value is given in + * milliseconds since January 1, 1970. + * @param timeReferenceMs The corresponding value of SystemClock.elapsedRealtime() from the + * device when the NTP response was received in milliseconds. + * @param uncertaintyMs Uncertainty associated with the value represented by time. Represented + * in milliseconds. + */ + void injectTime(in long timeMs, in long timeReferenceMs, in int uncertaintyMs); + + /** + * Injects current location from another (typically network) location provider. + * + * @param location Current location from the location provider + */ + void injectLocation(in GnssLocation location); + + /** + * Injects current location from the best available location provider. + * + * Unlike injectLocation, this method may inject a recent GNSS location from the HAL + * implementation, if that is the best available location known to the framework. + * + * @param location Location information from the best available location provider. + */ + void injectBestLocation(in GnssLocation location); + + /** + * Specifies that the next call to start will not use the information defined in the flags. + * GnssAidingData value of DELETE_ALL is passed for a cold start. + * + * @param aidingDataFlags Flags specifying the aiding data to be deleted. + */ + void deleteAidingData(in GnssAidingData aidingDataFlags); + + /** + * Sets the GnssPositionMode parameter, its associated recurrence value, the time between fixes, + * requested fix accuracy, time to first fix. + * + * @param mode Parameter must be one of MS_BASED or STANDALONE. It is allowed by the platform + * (and it is recommended) to fallback to MS_BASED if MS_ASSISTED is passed in, and MS_BASED + * is supported. + * @param recurrence GNSS position recurrence value, either periodic or single. + * @param minIntervalMs Represents the time between fixes in milliseconds. + * @param preferredAccuracyMeters Represents the requested fix accuracy in meters. + * @param preferredTimeMs Represents the requested time to first fix in milliseconds. + * @param lowPowerMode When true, and IGnss is the only client to the GNSS hardware, the GNSS + * hardware must make strong tradeoffs to substantially restrict power use. Specifically, in + * the case of a several second long minIntervalMs, the GNSS hardware must not, on average, + * run power hungry operations like RF and signal searches for more than one second per + * interval, and must make exactly one call to gnssSvStatusCb(), and either zero or one call + * to GnssLocationCb() at each interval. When false, HAL must operate in the nominal mode + * and is expected to make power and performance tradoffs such as duty-cycling when signal + * conditions are good and more active searches to reacquire GNSS signals when no signals + * are present. When there are additional clients using the GNSS hardware other than IGnss, + * the GNSS hardware may operate in a higher power mode, on behalf of those clients. + */ + void setPositionMode(in GnssPositionMode mode, in GnssPositionRecurrence recurrence, + in int minIntervalMs, in int preferredAccuracyMeters, in int preferredTimeMs, + in boolean lowPowerMode); } diff --git a/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl index aad09ef98b..157c912054 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl @@ -16,6 +16,8 @@ package android.hardware.gnss; +import android.hardware.gnss.GnssConstellationType; +import android.hardware.gnss.GnssLocation; import android.hardware.gnss.IGnssConfiguration; import android.hardware.gnss.IGnssPsds; @@ -26,9 +28,48 @@ import android.hardware.gnss.IGnssPsds; */ @VintfStability interface IGnssCallback { + /** + * Capability bit mask indicating that GNSS supports scheduling fixes for RECURRENCE_PERIODIC + * mode. + * + * If this is not set, then the framework will use 1000ms for minInterval and will call start() + * and stop() to schedule the GNSS. + */ + const int CAPABILITY_SCHEDULING = 1 << 0; + + /** Capability bit mask indicating that GNSS supports MS-Based AGNSS mode */ + const int CAPABILITY_MSB = 1 << 1; + + /** Capability bit mask indicating that GNSS supports MS-Assisted AGNSS mode */ + const int CAPABILITY_MSA = 1 << 2; + + /** Capability bit mask indicating that GNSS supports single-shot fixes */ + const int CAPABILITY_SINGLE_SHOT = 1 << 3; + + /** Capability bit mask indicating that GNSS supports on demand time injection */ + const int CAPABILITY_ON_DEMAND_TIME = 1 << 4; + + /** Capability bit mask indicating that GNSS supports Geofencing */ + const int CAPABILITY_GEOFENCING = 1 << 5; + + /** Capability bit mask indicating that GNSS supports Measurements. */ + const int CAPABILITY_MEASUREMENTS = 1 << 6; + + /** Capability bit mask indicating that GNSS supports Navigation Messages */ + const int CAPABILITY_NAV_MESSAGES = 1 << 7; + + /** Capability bit mask indicating that GNSS supports low power mode */ + const int CAPABILITY_LOW_POWER_MODE = 1 << 8; + /** Capability bit mask indicating that GNSS supports blocklisting satellites */ const int CAPABILITY_SATELLITE_BLOCKLIST = 1 << 9; + /** Capability bit mask indicating that GNSS supports measurement corrections */ + const int CAPABILITY_MEASUREMENT_CORRECTIONS = 1 << 10; + + /** Capability bit mask indicating that GNSS supports measurement corrections */ + const int CAPABILITY_ANTENNA_INFO = 1 << 11; + /** Capability bit mask indicating that GNSS supports correlation vector */ const int CAPABILITY_CORRELATION_VECTOR = 1 << 12; @@ -44,4 +85,221 @@ interface IGnssCallback { * @param capabilities Capability parameter is a bit field of the Capability bit masks. */ void gnssSetCapabilitiesCb(in int capabilities); + + /** GNSS status event values. */ + @VintfStability + @Backing(type="int") + enum GnssStatusValue { + /** GNSS status unknown. */ + NONE = 0, + /** GNSS has begun navigating. */ + SESSION_BEGIN = 1, + /** GNSS has stopped navigating. */ + SESSION_END = 2, + /** GNSS has powered on but is not navigating. */ + ENGINE_ON = 3, + /** GNSS is powered off. */ + ENGINE_OFF = 4 + } + + /** + * Flags that indicate information about the satellite + */ + @VintfStability + @Backing(type="int") + enum GnssSvFlags { + NONE = 0, + HAS_EPHEMERIS_DATA = 1 << 0, + HAS_ALMANAC_DATA = 1 << 1, + USED_IN_FIX = 1 << 2, + HAS_CARRIER_FREQUENCY = 1 << 3, + } + + @VintfStability + parcelable GnssSvInfo { + /** + * Pseudo-random or satellite ID number for the satellite, a.k.a. Space Vehicle (SV), or + * FCN/OSN number for Glonass. The distinction is made by looking at constellation field. + * Values must be in the range of: + * + * - GNSS: 1-32 + * - SBAS: 120-151, 183-192 + * - GLONASS: 1-24, the orbital slot number (OSN), if known. Or, if not: + * 93-106, the frequency channel number (FCN) (-7 to +6) offset by + * + 100 + * i.e. report an FCN of -7 as 93, FCN of 0 as 100, and FCN of +6 + * as 106. + * - QZSS: 193-200 + * - Galileo: 1-36 + * - Beidou: 1-37 + * - IRNSS: 1-14 + */ + int svid; + + /** + * Defines the constellation of the given SV. + */ + GnssConstellationType constellation; + + /** + * Carrier-to-noise density in dB-Hz, typically in the range [0, 63]. + * It contains the measured C/N0 value for the signal at the antenna port. + * + * This is a mandatory field. + */ + float cN0Dbhz; + + /** + * Baseband Carrier-to-noise density in dB-Hz, typically in the range [0, 63]. It contains + * the measured C/N0 value for the signal measured at the baseband. + * + * This is typically a few dB weaker than the value estimated for C/N0 at the antenna port, + * which is reported in cN0DbHz. + * + * If a signal has separate components (e.g. Pilot and Data channels) and the receiver only + * processes one of the components, then the reported basebandCN0DbHz reflects only the + * component that is processed. + * + * This field is mandatory. Like cN0DbHz, it may be reported as 0 for satellites being + * reported that may be searched for, but not yet tracked. + */ + float basebandCN0DbHz; + + /** Elevation of SV in degrees. */ + float elevationDegrees; + + /** Azimuth of SV in degrees. */ + float azimuthDegrees; + + /** + * Carrier frequency of the signal tracked, for example it can be the + * GPS central frequency for L1 = 1575.45 MHz, or L2 = 1227.60 MHz, L5 = + * 1176.45 MHz, varying GLO channels, etc. If the field is zero, it is + * the primary common use central frequency, e.g. L1 = 1575.45 MHz for + * GPS. + * + * For an L1, L5 receiver tracking a satellite on L1 and L5 at the same + * time, two GnssSvInfo structs must be reported for this same + * satellite, in one of the structs, all the values related + * to L1 must be filled, and in the other all of the values related to + * L5 must be filled. + * + * If the data is available, svFlag must contain HAS_CARRIER_FREQUENCY. + */ + long carrierFrequencyHz; + + /** A bit field of the GnssSvFlags. */ + int svFlag; + } + + /** + * Called to communicate the status of the GNSS engine. + * + * @param status Status information from HAL. + */ + void gnssStatusCb(in GnssStatusValue status); + + /** + * Callback for the HAL to pass a vector of GnssSvInfo back to the client. + * + * @param svInfo SV status information from HAL. + */ + void gnssSvStatusCb(in GnssSvInfo[] svInfoList); + + /** + * Called when a GNSS location is available. + * + * @param location Location information from HAL. + */ + void gnssLocationCb(in GnssLocation location); + + /** + * Callback for reporting NMEA sentences. Called when NMEA data is available. + * + * @param timestamp Marks the instance of reporting. + * @param nmea Follows standard NMEA 0183. Each sentence begins with a '$' + * and ends with a carriage return/line feed sequence and can be no longer + * than 80 characters of visible text (plus the line terminators). The data + * is contained within this single line with data items separated by commas. + * The data itself is just ascii text and may extend over multiple sentences + * in certain specialized instances but is normally fully contained in one + * variable length sentence. The data may vary in the amount of precision + * contained in the message. For example time might be indicated to decimal + * parts of a second or location may be shown with 3 or even 4 digits after + * the decimal point. Programs that read the data must only use the commas + * to determine the field boundaries and not depend on column positions. + * There is a provision for a checksum at the end of each sentence which may + * or may not be checked by the unit that reads the data. The checksum field + * consists of a '*' and two hex digits representing an 8 bit exclusive OR + * of all characters between, but not including, the '$' and '*'. + */ + void gnssNmeaCb(in long timestamp, in @utf8InCpp String nmea); + + /** + * Callback utility for acquiring the GNSS wakelock. This can be used to prevent + * the CPU from suspending while handling GNSS events. + */ + void gnssAcquireWakelockCb(); + + /** Callback utility for releasing the GNSS wakelock. */ + void gnssReleaseWakelockCb(); + + /** + * Provides information about how new the underlying GPS/GNSS hardware and software is. + */ + @VintfStability + parcelable GnssSystemInfo { + /** + * The year in which the last update was made to the underlying hardware/firmware used to + * capture GNSS signals, e.g. 2016. + */ + int yearOfHw; + + /** + * The name of the GNSS HAL implementation model and version name. + * + * This is a user-visible string that identifies the model and version of the GNSS HAL. + * For example "ABC Co., Baseband Part 1234, RF Part 567, Software version 3.14.159" + * + * For privacy reasons, this string must not contain any device-specific serial number or + * other identifier that uniquely identifies an individual device. + */ + @utf8InCpp String name; + } + + /** + * Callback to inform the framework of the GNSS system information. + * + * This must be called in response to IGnss::setCallback + * + * @param info GnssSystemInfo about the GPS/GNSS hardware. + */ + void gnssSetSystemInfoCb(in GnssSystemInfo info); + + /** Callback for requesting NTP time */ + void gnssRequestTimeCb(); + + /** + * Callback for requesting Location. + * + * HAL implementation must call this when it wants the framework to provide locations to assist + * with GNSS HAL operation, for example, to assist with time to first fix, error recovery, or to + * supplement GNSS location for other clients of the GNSS HAL. + * + * If a request is made with independentFromGnss set to true, the framework must avoid + * providing locations derived from GNSS locations (such as "fused" location), to help improve + * information independence for situations such as error recovery. + * + * In response to this method call, GNSS HAL can expect zero, one, or more calls to + * IGnss::injectLocation or IGnss::injectBestLocation, dependent on availability of location + * from other sources, which may happen at some arbitrary delay. Generally speaking, HAL + * implementations must be able to handle calls to IGnss::injectLocation or + * IGnss::injectBestLocation at any time. + * + * @param independentFromGnss True if requesting a location that is independent from GNSS. + * @param isUserEmergency True if the location request is for delivery of this location to an + * emergency services endpoint, during a user-initiated emergency session (e.g. + * during-call to E911, or up to 5 minutes after end-of-call or text to E911). + */ + void gnssRequestLocationCb(in boolean independentFromGnss, in boolean isUserEmergency); } diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index afb7b9507a..e296351d95 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -17,6 +17,7 @@ #define LOG_TAG "GnssAidl" #include "Gnss.h" +#include #include #include "AGnss.h" #include "GnssBatching.h" @@ -27,16 +28,24 @@ #include "GnssNavigationMessageInterface.h" #include "GnssPsds.h" #include "GnssVisibilityControl.h" +#include "Utils.h" namespace aidl::android::hardware::gnss { +using ::android::hardware::gnss::common::Utils; +using ndk::ScopedAStatus; +using GnssSvInfo = IGnssCallback::GnssSvInfo; + +constexpr int TTFF_MILLIS = 2200; std::shared_ptr Gnss::sGnssCallback = nullptr; -ndk::ScopedAStatus Gnss::setCallback(const std::shared_ptr& callback) { - ALOGD("Gnss::setCallback"); +Gnss::Gnss() : mMinIntervalMs(1000), mFirstFixReceived(false) {} + +ScopedAStatus Gnss::setCallback(const std::shared_ptr& callback) { + ALOGD("setCallback"); if (callback == nullptr) { ALOGE("%s: Null callback ignored", __func__); - return ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); + return ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); } sGnssCallback = callback; @@ -50,13 +59,99 @@ ndk::ScopedAStatus Gnss::setCallback(const std::shared_ptr& callb ALOGE("%s: Unable to invoke callback.gnssSetCapabilities", __func__); } - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::start() { + ALOGD("start()"); + if (mIsActive) { + ALOGW("Gnss has started. Restarting..."); + stop(); + } + + mIsActive = true; + this->reportGnssStatusValue(IGnssCallback::GnssStatusValue::SESSION_BEGIN); + mThread = std::thread([this]() { + auto svStatus = filterBlocklistedSatellites(Utils::getMockSvInfoList()); + this->reportSvStatus(svStatus); + if (!mFirstFixReceived) { + std::this_thread::sleep_for(std::chrono::milliseconds(TTFF_MILLIS)); + mFirstFixReceived = true; + } + while (mIsActive == true) { + auto svStatus = filterBlocklistedSatellites(Utils::getMockSvInfoList()); + this->reportSvStatus(svStatus); + + mGnssPowerIndication->notePowerConsumption(); + const auto location = Utils::getMockLocation(); + this->reportLocation(location); + std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMs)); + } + }); + return ScopedAStatus::ok(); +} + +void Gnss::reportLocation(const GnssLocation& location) const { + std::unique_lock lock(mMutex); + if (sGnssCallback == nullptr) { + ALOGE("%s: GnssCallback is null.", __func__); + return; + } + auto status = sGnssCallback->gnssLocationCb(location); + if (!status.isOk()) { + ALOGE("%s: Unable to invoke gnssLocationCb", __func__); + } + return; +} + +void Gnss::reportSvStatus(const std::vector& svInfoList) const { + std::unique_lock lock(mMutex); + if (sGnssCallback == nullptr) { + ALOGE("%s: sGnssCallback is null.", __func__); + return; + } + auto status = sGnssCallback->gnssSvStatusCb(svInfoList); + if (!status.isOk()) { + ALOGE("%s: Unable to invoke callback", __func__); + } } -ndk::ScopedAStatus Gnss::close() { - ALOGD("Gnss::close"); +std::vector Gnss::filterBlocklistedSatellites(std::vector gnssSvInfoList) { + ALOGD("filterBlocklistedSatellites"); + for (uint32_t i = 0; i < gnssSvInfoList.size(); i++) { + if (mGnssConfiguration->isBlocklisted(gnssSvInfoList[i])) { + gnssSvInfoList[i].svFlag &= ~(uint32_t)IGnssCallback::GnssSvFlags::USED_IN_FIX; + } + } + return gnssSvInfoList; +} + +void Gnss::reportGnssStatusValue(const IGnssCallback::GnssStatusValue gnssStatusValue) const { + std::unique_lock lock(mMutex); + if (sGnssCallback == nullptr) { + ALOGE("%s: sGnssCallback is null.", __func__); + return; + } + auto status = sGnssCallback->gnssStatusCb(gnssStatusValue); + if (!status.isOk()) { + ALOGE("%s: Unable to invoke gnssStatusCb", __func__); + } +} + +ScopedAStatus Gnss::stop() { + ALOGD("stop"); + mIsActive = false; + this->reportGnssStatusValue(IGnssCallback::GnssStatusValue::SESSION_END); + if (mThread.joinable()) { + mThread.join(); + } + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::close() { + ALOGD("close"); sGnssCallback = nullptr; - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } ndk::ScopedAStatus Gnss::getExtensionAGnss(std::shared_ptr* iAGnss) { @@ -65,61 +160,93 @@ ndk::ScopedAStatus Gnss::getExtensionAGnss(std::shared_ptr* iAGnss) { return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus Gnss::getExtensionPsds(std::shared_ptr* iGnssPsds) { - ALOGD("Gnss::getExtensionPsds"); +ScopedAStatus Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs, int uncertaintyMs) { + ALOGD("injectTime. timeMs:%" PRId64 ", timeReferenceMs:%" PRId64 ", uncertaintyMs:%d", timeMs, + timeReferenceMs, uncertaintyMs); + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::injectLocation(const GnssLocation& location) { + ALOGD("injectLocation. lat:%lf, lng:%lf, acc:%f", location.latitudeDegrees, + location.longitudeDegrees, location.horizontalAccuracyMeters); + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::injectBestLocation(const GnssLocation& location) { + ALOGD("injectBestLocation. lat:%lf, lng:%lf, acc:%f", location.latitudeDegrees, + location.longitudeDegrees, location.horizontalAccuracyMeters); + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::deleteAidingData(GnssAidingData aidingDataFlags) { + ALOGD("deleteAidingData. flags:%d", (int)aidingDataFlags); + mFirstFixReceived = false; + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::setPositionMode(GnssPositionMode, GnssPositionRecurrence, int minIntervalMs, + int /* preferredAccuracyMeters */, int /* preferredTimeMs */, + bool lowPowerMode) { + ALOGD("setPositionMode. minIntervalMs:%d, lowPowerMode:%d", minIntervalMs, (int)lowPowerMode); + mMinIntervalMs = minIntervalMs; + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::getExtensionPsds(std::shared_ptr* iGnssPsds) { + ALOGD("getExtensionPsds"); *iGnssPsds = SharedRefBase::make(); - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } -ndk::ScopedAStatus Gnss::getExtensionGnssConfiguration( +ScopedAStatus Gnss::getExtensionGnssConfiguration( std::shared_ptr* iGnssConfiguration) { - ALOGD("Gnss::getExtensionGnssConfiguration"); + ALOGD("getExtensionGnssConfiguration"); if (mGnssConfiguration == nullptr) { mGnssConfiguration = SharedRefBase::make(); } *iGnssConfiguration = mGnssConfiguration; - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } -ndk::ScopedAStatus Gnss::getExtensionGnssPowerIndication( +ScopedAStatus Gnss::getExtensionGnssPowerIndication( std::shared_ptr* iGnssPowerIndication) { - ALOGD("Gnss::getExtensionGnssPowerIndication"); + ALOGD("getExtensionGnssPowerIndication"); if (mGnssPowerIndication == nullptr) { mGnssPowerIndication = SharedRefBase::make(); } *iGnssPowerIndication = mGnssPowerIndication; - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } -ndk::ScopedAStatus Gnss::getExtensionGnssMeasurement( +ScopedAStatus Gnss::getExtensionGnssMeasurement( std::shared_ptr* iGnssMeasurement) { - ALOGD("Gnss::getExtensionGnssMeasurement"); + ALOGD("getExtensionGnssMeasurement"); *iGnssMeasurement = SharedRefBase::make(); - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } -ndk::ScopedAStatus Gnss::getExtensionGnssBatching(std::shared_ptr* iGnssBatching) { - ALOGD("Gnss::getExtensionGnssBatching"); +ScopedAStatus Gnss::getExtensionGnssBatching(std::shared_ptr* iGnssBatching) { + ALOGD("getExtensionGnssBatching"); *iGnssBatching = SharedRefBase::make(); - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } -ndk::ScopedAStatus Gnss::getExtensionGnssGeofence(std::shared_ptr* iGnssGeofence) { - ALOGD("Gnss::getExtensionGnssGeofence"); +ScopedAStatus Gnss::getExtensionGnssGeofence(std::shared_ptr* iGnssGeofence) { + ALOGD("getExtensionGnssGeofence"); *iGnssGeofence = SharedRefBase::make(); - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } -ndk::ScopedAStatus Gnss::getExtensionGnssNavigationMessage( +ScopedAStatus Gnss::getExtensionGnssNavigationMessage( std::shared_ptr* iGnssNavigationMessage) { - ALOGD("Gnss::getExtensionGnssNavigationMessage"); + ALOGD("getExtensionGnssNavigationMessage"); *iGnssNavigationMessage = SharedRefBase::make(); - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } ndk::ScopedAStatus Gnss::getExtensionGnssDebug(std::shared_ptr* iGnssDebug) { diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index 67fef94ee7..384c8629a2 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -25,6 +25,9 @@ #include #include #include +#include +#include +#include #include "GnssConfiguration.h" #include "GnssPowerIndication.h" @@ -32,8 +35,22 @@ namespace aidl::android::hardware::gnss { class Gnss : public BnGnss { public: + Gnss(); + ~Gnss() { stop(); }; ndk::ScopedAStatus setCallback(const std::shared_ptr& callback) override; + ndk::ScopedAStatus start() override; + ndk::ScopedAStatus stop() override; ndk::ScopedAStatus close() override; + + ndk::ScopedAStatus injectTime(int64_t timeMs, int64_t timeReferenceMs, + int uncertaintyMs) override; + ndk::ScopedAStatus injectLocation(const GnssLocation& location) override; + ndk::ScopedAStatus injectBestLocation(const GnssLocation& location) override; + ndk::ScopedAStatus deleteAidingData(GnssAidingData aidingDataFlags) override; + ndk::ScopedAStatus setPositionMode(GnssPositionMode mode, GnssPositionRecurrence recurrence, + int minIntervalMs, int preferredAccuracyMeters, + int preferredTimeMs, bool lowPowerMode) override; + ndk::ScopedAStatus getExtensionPsds(std::shared_ptr* iGnssPsds) override; ndk::ScopedAStatus getExtensionGnssConfiguration( std::shared_ptr* iGnssConfiguration) override; @@ -57,7 +74,20 @@ class Gnss : public BnGnss { std::shared_ptr mGnssPowerIndication; private: + void reportLocation(const GnssLocation&) const; + void reportSvStatus(const std::vector& svInfoList) const; + std::vector filterBlocklistedSatellites( + std::vector gnssSvInfoList); + void reportGnssStatusValue(const IGnssCallback::GnssStatusValue gnssStatusValue) const; + static std::shared_ptr sGnssCallback; + + std::atomic mMinIntervalMs; + std::atomic mIsActive; + std::atomic mFirstFixReceived; + std::thread mThread; + + mutable std::mutex mMutex; }; } // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/GnssConfiguration.cpp b/gnss/aidl/default/GnssConfiguration.cpp index 30e0d8c8b9..96a1aa2a3f 100644 --- a/gnss/aidl/default/GnssConfiguration.cpp +++ b/gnss/aidl/default/GnssConfiguration.cpp @@ -49,4 +49,14 @@ bool GnssConfiguration::isBlocklistedV2_1(const GnssSvInfoV2_1& gnssSvInfo) cons return (mBlocklistedSourceSet.find(source) != mBlocklistedSourceSet.end()); } +bool GnssConfiguration::isBlocklisted(const IGnssCallback::GnssSvInfo& gnssSvInfo) const { + std::unique_lock lock(mMutex); + if (mBlocklistedConstellationSet.find(gnssSvInfo.constellation) != + mBlocklistedConstellationSet.end()) { + return true; + } + BlocklistedSource source = {.constellation = gnssSvInfo.constellation, .svid = gnssSvInfo.svid}; + return (mBlocklistedSourceSet.find(source) != mBlocklistedSourceSet.end()); +} + } // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/GnssConfiguration.h b/gnss/aidl/default/GnssConfiguration.h index 491733c9ca..3c77f32d1f 100644 --- a/gnss/aidl/default/GnssConfiguration.h +++ b/gnss/aidl/default/GnssConfiguration.h @@ -16,6 +16,7 @@ #pragma once +#include #include #include #include @@ -62,6 +63,7 @@ struct GnssConfiguration : public BnGnssConfiguration { ndk::ScopedAStatus setBlocklist(const vector& blocklist) override; bool isBlocklistedV2_1(const GnssSvInfoV2_1& gnssSvInfo) const; + bool isBlocklisted(const IGnssCallback::GnssSvInfo& gnssSvInfo) const; private: BlocklistedSourceSet mBlocklistedSourceSet; diff --git a/gnss/aidl/vts/GnssBatchingCallback.cpp b/gnss/aidl/vts/GnssBatchingCallback.cpp index 2da3b12e68..d4eb0a58b6 100644 --- a/gnss/aidl/vts/GnssBatchingCallback.cpp +++ b/gnss/aidl/vts/GnssBatchingCallback.cpp @@ -14,6 +14,8 @@ * limitations under the License. */ +#define LOG_TAG "GnssBatchingCallbackAidl" + #include "GnssBatchingCallback.h" #include #include diff --git a/gnss/aidl/vts/GnssCallbackAidl.cpp b/gnss/aidl/vts/GnssCallbackAidl.cpp index f5c745b75c..77a2506820 100644 --- a/gnss/aidl/vts/GnssCallbackAidl.cpp +++ b/gnss/aidl/vts/GnssCallbackAidl.cpp @@ -14,11 +14,62 @@ * limitations under the License. */ +#define LOG_TAG "GnssCallbackAidl" + #include "GnssCallbackAidl.h" #include -android::binder::Status GnssCallbackAidl::gnssSetCapabilitiesCb(const int capabilities) { - ALOGI("Capabilities received %d", capabilities); +using android::binder::Status; +using android::hardware::gnss::GnssLocation; +using GnssSvInfo = android::hardware::gnss::IGnssCallback::GnssSvInfo; +using GnssSystemInfo = android::hardware::gnss::IGnssCallback::GnssSystemInfo; + +Status GnssCallbackAidl::gnssSetCapabilitiesCb(const int capabilities) { + ALOGI("Capabilities received %#08x", capabilities); capabilities_cbq_.store(capabilities); - return android::binder::Status::ok(); + return Status::ok(); +} + +Status GnssCallbackAidl::gnssStatusCb(const GnssStatusValue /* status */) { + ALOGI("gnssSvStatusCb"); + return Status::ok(); +} + +Status GnssCallbackAidl::gnssSvStatusCb(const std::vector& svInfoList) { + ALOGI("gnssSvStatusCb. Size = %d", (int)svInfoList.size()); + sv_info_list_cbq_.store(svInfoList); + return Status::ok(); +} + +Status GnssCallbackAidl::gnssLocationCb(const GnssLocation& location) { + ALOGI("Location received"); + location_cbq_.store(location); + return Status::ok(); +} + +Status GnssCallbackAidl::gnssNmeaCb(const int64_t /* timestamp */, const std::string& /* nmea */) { + return Status::ok(); +} + +Status GnssCallbackAidl::gnssAcquireWakelockCb() { + return Status::ok(); +} + +Status GnssCallbackAidl::gnssReleaseWakelockCb() { + return Status::ok(); +} + +Status GnssCallbackAidl::gnssSetSystemInfoCb(const GnssSystemInfo& info) { + ALOGI("gnssSetSystemInfoCb, year=%d, name=%s", info.yearOfHw, info.name.c_str()); + info_cbq_.store(info); + return Status::ok(); +} + +Status GnssCallbackAidl::gnssRequestTimeCb() { + return Status::ok(); +} + +Status GnssCallbackAidl::gnssRequestLocationCb(const bool /* independentFromGnss */, + const bool /* isUserEmergency */) { + return Status::ok(); } diff --git a/gnss/aidl/vts/GnssCallbackAidl.h b/gnss/aidl/vts/GnssCallbackAidl.h index 7f802ea02e..209728df7f 100644 --- a/gnss/aidl/vts/GnssCallbackAidl.h +++ b/gnss/aidl/vts/GnssCallbackAidl.h @@ -22,11 +22,37 @@ /* Callback class for data & Event. */ class GnssCallbackAidl : public android::hardware::gnss::BnGnssCallback { public: - GnssCallbackAidl() : capabilities_cbq_("capabilities"){}; + GnssCallbackAidl() + : capabilities_cbq_("capabilities"), + info_cbq_("system_info"), + location_cbq_("location"), + sv_info_list_cbq_("sv_info"){}; ~GnssCallbackAidl(){}; android::binder::Status gnssSetCapabilitiesCb(const int capabilities) override; + android::binder::Status gnssStatusCb(const GnssStatusValue status) override; + android::binder::Status gnssSvStatusCb(const std::vector& svInfoList) override; + android::binder::Status gnssLocationCb( + const android::hardware::gnss::GnssLocation& location) override; + android::binder::Status gnssNmeaCb(const int64_t timestamp, const std::string& nmea) override; + android::binder::Status gnssAcquireWakelockCb() override; + android::binder::Status gnssReleaseWakelockCb() override; + android::binder::Status gnssSetSystemInfoCb(const GnssSystemInfo& info) override; + android::binder::Status gnssRequestTimeCb() override; + android::binder::Status gnssRequestLocationCb(const bool independentFromGnss, + const bool isUserEmergency) override; int last_capabilities_; + android::hardware::gnss::IGnssCallback::GnssSystemInfo last_info_; + android::hardware::gnss::GnssLocation last_location_; + android::hardware::gnss::common::GnssCallbackEventQueue capabilities_cbq_; + android::hardware::gnss::common::GnssCallbackEventQueue< + android::hardware::gnss::IGnssCallback::GnssSystemInfo> + info_cbq_; + android::hardware::gnss::common::GnssCallbackEventQueue + location_cbq_; + android::hardware::gnss::common::GnssCallbackEventQueue< + std::vector> + sv_info_list_cbq_; }; \ No newline at end of file diff --git a/gnss/aidl/vts/gnss_hal_test.cpp b/gnss/aidl/vts/gnss_hal_test.cpp index 2447bf8c84..13c32ee8c4 100644 --- a/gnss/aidl/vts/gnss_hal_test.cpp +++ b/gnss/aidl/vts/gnss_hal_test.cpp @@ -14,20 +14,31 @@ * limitations under the License. */ +#define LOG_TAG "GnssHalTest" + #include "gnss_hal_test.h" #include +#include "Utils.h" -using GnssConstellationTypeAidl = android::hardware::gnss::GnssConstellationType; +using android::hardware::gnss::GnssConstellationType; +using android::hardware::gnss::GnssLocation; +using android::hardware::gnss::IGnss; +using android::hardware::gnss::IGnssCallback; +using android::hardware::gnss::common::Utils; +using GnssConstellationTypeV2_0 = android::hardware::gnss::V2_0::GnssConstellationType; void GnssHalTest::SetUp() { // Get AIDL handle aidl_gnss_hal_ = android::waitForDeclaredService(String16(GetParam().c_str())); ASSERT_NE(aidl_gnss_hal_, nullptr); + ALOGD("AIDL Interface Version = %d", aidl_gnss_hal_->getInterfaceVersion()); - const auto& hidlInstanceNames = android::hardware::getAllHalInstanceNames( - android::hardware::gnss::V2_1::IGnss::descriptor); - gnss_hal_ = IGnss_V2_1::getService(hidlInstanceNames[0]); - ASSERT_NE(gnss_hal_, nullptr); + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + const auto& hidlInstanceNames = android::hardware::getAllHalInstanceNames( + android::hardware::gnss::V2_1::IGnss::descriptor); + gnss_hal_ = IGnss_V2_1::getService(hidlInstanceNames[0]); + ASSERT_NE(gnss_hal_, nullptr); + } SetUpGnssCallback(); } @@ -40,7 +51,6 @@ void GnssHalTest::SetUpGnssCallback() { if (!status.isOk()) { ALOGE("Failed to setCallback"); } - ASSERT_TRUE(status.isOk()); /* @@ -48,9 +58,243 @@ void GnssHalTest::SetUpGnssCallback() { */ EXPECT_TRUE(aidl_gnss_cb_->capabilities_cbq_.retrieve(aidl_gnss_cb_->last_capabilities_, TIMEOUT_SEC)); - EXPECT_EQ(aidl_gnss_cb_->capabilities_cbq_.calledCount(), 1); - // Invoke the super method. - GnssHalTestTemplate::SetUpGnssCallback(); + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + // Invoke the super method. + GnssHalTestTemplate::SetUpGnssCallback(); + } +} + +void GnssHalTest::CheckLocation(const GnssLocation& location, bool check_speed) { + Utils::checkLocation(location, check_speed, /* check_more_accuracies= */ true); +} + +void GnssHalTest::SetPositionMode(const int min_interval_msec, const bool low_power_mode) { + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + // Invoke the super method. + return GnssHalTestTemplate::SetPositionMode(min_interval_msec, low_power_mode); + } + + const int kPreferredAccuracy = 0; // Ideally perfect (matches GnssLocationProvider) + const int kPreferredTimeMsec = 0; // Ideally immediate + + auto status = aidl_gnss_hal_->setPositionMode( + IGnss::GnssPositionMode::MS_BASED, IGnss::GnssPositionRecurrence::RECURRENCE_PERIODIC, + min_interval_msec, kPreferredAccuracy, kPreferredTimeMsec, low_power_mode); + + ASSERT_TRUE(status.isOk()); +} + +bool GnssHalTest::StartAndCheckFirstLocation(const int min_interval_msec, + const bool low_power_mode) { + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + // Invoke the super method. + return GnssHalTestTemplate::StartAndCheckFirstLocation(min_interval_msec, + low_power_mode); + } + + SetPositionMode(min_interval_msec, low_power_mode); + auto result = aidl_gnss_hal_->start(); + + EXPECT_TRUE(result.isOk()); + + /* + * GnssLocationProvider support of AGPS SUPL & XtraDownloader is not available in VTS, + * so allow time to demodulate ephemeris over the air. + */ + const int kFirstGnssLocationTimeoutSeconds = 75; + + EXPECT_TRUE(aidl_gnss_cb_->location_cbq_.retrieve(aidl_gnss_cb_->last_location_, + kFirstGnssLocationTimeoutSeconds)); + int locationCalledCount = aidl_gnss_cb_->location_cbq_.calledCount(); + EXPECT_EQ(locationCalledCount, 1); + + if (locationCalledCount > 0) { + // don't require speed on first fix + CheckLocation(aidl_gnss_cb_->last_location_, false); + return true; + } + return false; +} + +void GnssHalTest::StopAndClearLocations() { + ALOGD("StopAndClearLocations"); + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + // Invoke the super method. + return GnssHalTestTemplate::StopAndClearLocations(); + } + + auto status = aidl_gnss_hal_->stop(); + EXPECT_TRUE(status.isOk()); + + /* + * Clear notify/waiting counter, allowing up till the timeout after + * the last reply for final startup messages to arrive (esp. system + * info.) + */ + while (aidl_gnss_cb_->location_cbq_.retrieve(aidl_gnss_cb_->last_location_, TIMEOUT_SEC)) { + } + aidl_gnss_cb_->location_cbq_.reset(); +} + +void GnssHalTest::StartAndCheckLocations(int count) { + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + // Invoke the super method. + return GnssHalTestTemplate::StartAndCheckLocations(count); + } + const int kMinIntervalMsec = 500; + const int kLocationTimeoutSubsequentSec = 2; + const bool kLowPowerMode = false; + + EXPECT_TRUE(StartAndCheckFirstLocation(kMinIntervalMsec, kLowPowerMode)); + + for (int i = 1; i < count; i++) { + EXPECT_TRUE(aidl_gnss_cb_->location_cbq_.retrieve(aidl_gnss_cb_->last_location_, + kLocationTimeoutSubsequentSec)); + int locationCalledCount = aidl_gnss_cb_->location_cbq_.calledCount(); + EXPECT_EQ(locationCalledCount, i + 1); + // Don't cause confusion by checking details if no location yet + if (locationCalledCount > 0) { + // Should be more than 1 location by now, but if not, still don't check first fix speed + CheckLocation(aidl_gnss_cb_->last_location_, locationCalledCount > 1); + } + } +} + +std::list> GnssHalTest::convertToAidl( + const std::list>& sv_info_list) { + std::list> aidl_sv_info_list; + for (const auto& sv_info_vec : sv_info_list) { + std::vector aidl_sv_info_vec; + for (const auto& sv_info : sv_info_vec) { + IGnssCallback::GnssSvInfo aidl_sv_info; + aidl_sv_info.svid = sv_info.v2_0.v1_0.svid; + aidl_sv_info.constellation = + static_cast(sv_info.v2_0.constellation); + aidl_sv_info.cN0Dbhz = sv_info.v2_0.v1_0.cN0Dbhz; + aidl_sv_info.basebandCN0DbHz = sv_info.basebandCN0DbHz; + aidl_sv_info.elevationDegrees = sv_info.v2_0.v1_0.elevationDegrees; + aidl_sv_info.azimuthDegrees = sv_info.v2_0.v1_0.azimuthDegrees; + aidl_sv_info.carrierFrequencyHz = (int64_t)sv_info.v2_0.v1_0.carrierFrequencyHz; + aidl_sv_info.svFlag = (int)sv_info.v2_0.v1_0.svFlag; + aidl_sv_info_vec.push_back(aidl_sv_info); + } + aidl_sv_info_list.push_back(aidl_sv_info_vec); + } + return aidl_sv_info_list; +} + +/* + * FindStrongFrequentNonGpsSource: + * + * Search through a GnssSvStatus list for the strongest non-GPS satellite observed enough times + * + * returns the strongest source, + * or a source with constellation == UNKNOWN if none are found sufficient times + */ +BlocklistedSource GnssHalTest::FindStrongFrequentNonGpsSource( + const std::list> sv_info_list, + const int min_observations) { + return FindStrongFrequentNonGpsSource(convertToAidl(sv_info_list), min_observations); +} + +BlocklistedSource GnssHalTest::FindStrongFrequentNonGpsSource( + const std::list> sv_info_list, + const int min_observations) { + std::map mapSignals; + + for (const auto& sv_info_vec : sv_info_list) { + for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { + const auto& gnss_sv = sv_info_vec[iSv]; + if ((gnss_sv.svFlag & (int)IGnssCallback::GnssSvFlags::USED_IN_FIX) && + (gnss_sv.constellation != GnssConstellationType::GPS)) { + ComparableBlocklistedSource source; + source.id.svid = gnss_sv.svid; + source.id.constellation = gnss_sv.constellation; + + const auto& itSignal = mapSignals.find(source); + if (itSignal == mapSignals.end()) { + SignalCounts counts; + counts.observations = 1; + counts.max_cn0_dbhz = gnss_sv.cN0Dbhz; + mapSignals.insert( + std::pair(source, counts)); + } else { + itSignal->second.observations++; + if (itSignal->second.max_cn0_dbhz < gnss_sv.cN0Dbhz) { + itSignal->second.max_cn0_dbhz = gnss_sv.cN0Dbhz; + } + } + } + } + } + + float max_cn0_dbhz_with_sufficient_count = 0.; + int total_observation_count = 0; + int blocklisted_source_count_observation = 0; + + ComparableBlocklistedSource source_to_blocklist; // initializes to zero = UNKNOWN constellation + for (auto const& pairSignal : mapSignals) { + total_observation_count += pairSignal.second.observations; + if ((pairSignal.second.observations >= min_observations) && + (pairSignal.second.max_cn0_dbhz > max_cn0_dbhz_with_sufficient_count)) { + source_to_blocklist = pairSignal.first; + blocklisted_source_count_observation = pairSignal.second.observations; + max_cn0_dbhz_with_sufficient_count = pairSignal.second.max_cn0_dbhz; + } + } + ALOGD("Among %d observations, chose svid %d, constellation %d, " + "with %d observations at %.1f max CNo", + total_observation_count, source_to_blocklist.id.svid, + (int)source_to_blocklist.id.constellation, blocklisted_source_count_observation, + max_cn0_dbhz_with_sufficient_count); + + return source_to_blocklist.id; +} + +GnssConstellationType GnssHalTest::startLocationAndGetNonGpsConstellation( + const int locations_to_await, const int gnss_sv_info_list_timeout) { + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + return static_cast( + GnssHalTestTemplate::startLocationAndGetNonGpsConstellation( + locations_to_await, gnss_sv_info_list_timeout)); + } + aidl_gnss_cb_->location_cbq_.reset(); + StartAndCheckLocations(locations_to_await); + const int location_called_count = aidl_gnss_cb_->location_cbq_.calledCount(); + + // Tolerate 1 less sv status to handle edge cases in reporting. + int sv_info_list_cbq_size = aidl_gnss_cb_->sv_info_list_cbq_.size(); + EXPECT_GE(sv_info_list_cbq_size + 1, locations_to_await); + ALOGD("Observed %d GnssSvInfo, while awaiting %d Locations (%d received)", + sv_info_list_cbq_size, locations_to_await, location_called_count); + + // Find first non-GPS constellation to blocklist + GnssConstellationType constellation_to_blocklist = GnssConstellationType::UNKNOWN; + for (int i = 0; i < sv_info_list_cbq_size; ++i) { + std::vector sv_info_vec; + aidl_gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, gnss_sv_info_list_timeout); + for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { + auto& gnss_sv = sv_info_vec[iSv]; + if ((gnss_sv.svFlag & (uint32_t)IGnssCallback::GnssSvFlags::USED_IN_FIX) && + (gnss_sv.constellation != GnssConstellationType::UNKNOWN) && + (gnss_sv.constellation != GnssConstellationType::GPS)) { + // found a non-GPS constellation + constellation_to_blocklist = gnss_sv.constellation; + break; + } + } + if (constellation_to_blocklist != GnssConstellationType::UNKNOWN) { + break; + } + } + + if (constellation_to_blocklist == GnssConstellationType::UNKNOWN) { + ALOGI("No non-GPS constellations found, constellation blocklist test less effective."); + // Proceed functionally to blocklist something. + constellation_to_blocklist = GnssConstellationType::GLONASS; + } + + return constellation_to_blocklist; } diff --git a/gnss/aidl/vts/gnss_hal_test.h b/gnss/aidl/vts/gnss_hal_test.h index e3ecbed8cc..d479af3445 100644 --- a/gnss/aidl/vts/gnss_hal_test.h +++ b/gnss/aidl/vts/gnss_hal_test.h @@ -41,9 +41,50 @@ class GnssHalTest : public android::hardware::gnss::common::GnssHalTestTemplate< public: GnssHalTest(){}; ~GnssHalTest(){}; + + struct ComparableBlocklistedSource { + android::hardware::gnss::BlocklistedSource id; + + ComparableBlocklistedSource() { + id.constellation = android::hardware::gnss::GnssConstellationType::UNKNOWN; + id.svid = 0; + } + + bool operator<(const ComparableBlocklistedSource& compare) const { + return ((id.svid < compare.id.svid) || ((id.svid == compare.id.svid) && + (id.constellation < compare.id.constellation))); + } + }; + + struct SignalCounts { + int observations; + float max_cn0_dbhz; + }; + virtual void SetUp() override; virtual void SetUpGnssCallback() override; + void CheckLocation(const android::hardware::gnss::GnssLocation& location, + const bool check_speed); + void SetPositionMode(const int min_interval_msec, const bool low_power_mode); + bool StartAndCheckFirstLocation(const int min_interval_msec, const bool low_power_mode); + void StopAndClearLocations(); + void StartAndCheckLocations(int count); + + android::hardware::gnss::GnssConstellationType startLocationAndGetNonGpsConstellation( + const int locations_to_await, const int gnss_sv_info_list_timeout); + std::list> convertToAidl( + const std::list>& + sv_info_list); + android::hardware::gnss::BlocklistedSource FindStrongFrequentNonGpsSource( + const std::list> + sv_info_list, + const int min_observations); + android::hardware::gnss::BlocklistedSource FindStrongFrequentNonGpsSource( + const std::list> + sv_info_list, + const int min_observations); + sp aidl_gnss_hal_; sp aidl_gnss_cb_; // Primary callback interface }; diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 90b643ca86..3aa308fbdb 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -46,6 +46,7 @@ using android::hardware::gnss::IAGnss; using android::hardware::gnss::IGnss; using android::hardware::gnss::IGnssBatching; using android::hardware::gnss::IGnssBatchingCallback; +using android::hardware::gnss::IGnssCallback; using android::hardware::gnss::IGnssConfiguration; using android::hardware::gnss::IGnssDebug; using android::hardware::gnss::IGnssGeofence; @@ -59,6 +60,7 @@ using android::hardware::gnss::PsdsType; using android::hardware::gnss::SatellitePvt; using android::hardware::gnss::visibility_control::IGnssVisibilityControl; +using GnssConstellationTypeV2_0 = android::hardware::gnss::V2_0::GnssConstellationType; using GnssConstellationTypeAidl = android::hardware::gnss::GnssConstellationType; static bool IsAutomotiveDevice() { @@ -324,7 +326,11 @@ TEST_P(GnssHalTest, TestGnssPowerIndication) { auto powerStats1 = gnssPowerIndicationCallback->last_gnss_power_stats_; // Get a location and request another GnssPowerStats - gnss_cb_->location_cbq_.reset(); + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + gnss_cb_->location_cbq_.reset(); + } else { + aidl_gnss_cb_->location_cbq_.reset(); + } StartAndCheckFirstLocation(/* min_interval_msec= */ 1000, /* low_power_mode= */ false); // Request and verify the 2nd GnssPowerStats has larger values than the 1st one @@ -374,88 +380,6 @@ TEST_P(GnssHalTest, TestGnssPowerIndication) { StopAndClearLocations(); } -/* - * FindStrongFrequentNonGpsSource: - * - * Search through a GnssSvStatus list for the strongest non-GPS satellite observed enough times - * - * returns the strongest source, - * or a source with constellation == UNKNOWN if none are found sufficient times - */ -BlocklistedSource FindStrongFrequentNonGpsSource( - const std::list> sv_info_list, - const int min_observations) { - struct ComparableBlocklistedSource { - BlocklistedSource id; - - ComparableBlocklistedSource() { - id.constellation = GnssConstellationTypeAidl::UNKNOWN; - id.svid = 0; - } - - bool operator<(const ComparableBlocklistedSource& compare) const { - return ((id.svid < compare.id.svid) || ((id.svid == compare.id.svid) && - (id.constellation < compare.id.constellation))); - } - }; - - struct SignalCounts { - int observations; - float max_cn0_dbhz; - }; - - std::map mapSignals; - - for (const auto& sv_info_vec : sv_info_list) { - for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { - const auto& gnss_sv = sv_info_vec[iSv]; - if ((gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX) && - (gnss_sv.v2_0.constellation != GnssConstellationType::GPS)) { - ComparableBlocklistedSource source; - source.id.svid = gnss_sv.v2_0.v1_0.svid; - source.id.constellation = - static_cast(gnss_sv.v2_0.constellation); - - const auto& itSignal = mapSignals.find(source); - if (itSignal == mapSignals.end()) { - SignalCounts counts; - counts.observations = 1; - counts.max_cn0_dbhz = gnss_sv.v2_0.v1_0.cN0Dbhz; - mapSignals.insert( - std::pair(source, counts)); - } else { - itSignal->second.observations++; - if (itSignal->second.max_cn0_dbhz < gnss_sv.v2_0.v1_0.cN0Dbhz) { - itSignal->second.max_cn0_dbhz = gnss_sv.v2_0.v1_0.cN0Dbhz; - } - } - } - } - } - - float max_cn0_dbhz_with_sufficient_count = 0.; - int total_observation_count = 0; - int blocklisted_source_count_observation = 0; - - ComparableBlocklistedSource source_to_blocklist; // initializes to zero = UNKNOWN constellation - for (auto const& pairSignal : mapSignals) { - total_observation_count += pairSignal.second.observations; - if ((pairSignal.second.observations >= min_observations) && - (pairSignal.second.max_cn0_dbhz > max_cn0_dbhz_with_sufficient_count)) { - source_to_blocklist = pairSignal.first; - blocklisted_source_count_observation = pairSignal.second.observations; - max_cn0_dbhz_with_sufficient_count = pairSignal.second.max_cn0_dbhz; - } - } - ALOGD("Among %d observations, chose svid %d, constellation %d, " - "with %d observations at %.1f max CNo", - total_observation_count, source_to_blocklist.id.svid, - (int)source_to_blocklist.id.constellation, blocklisted_source_count_observation, - max_cn0_dbhz_with_sufficient_count); - - return source_to_blocklist.id; -} - /* * BlocklistIndividualSatellites: * @@ -481,12 +405,20 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { const int kLocationsToAwait = 3; const int kRetriesToUnBlocklist = 10; - gnss_cb_->location_cbq_.reset(); + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + gnss_cb_->location_cbq_.reset(); + } else { + aidl_gnss_cb_->location_cbq_.reset(); + } StartAndCheckLocations(kLocationsToAwait); - int location_called_count = gnss_cb_->location_cbq_.calledCount(); + int location_called_count = (aidl_gnss_hal_->getInterfaceVersion() == 1) + ? gnss_cb_->location_cbq_.calledCount() + : aidl_gnss_cb_->location_cbq_.calledCount(); // Tolerate 1 less sv status to handle edge cases in reporting. - int sv_info_list_cbq_size = gnss_cb_->sv_info_list_cbq_.size(); + int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1) + ? gnss_cb_->sv_info_list_cbq_.size() + : aidl_gnss_cb_->sv_info_list_cbq_.size(); EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait); ALOGD("Observed %d GnssSvInfo, while awaiting %d Locations (%d received)", sv_info_list_cbq_size, kLocationsToAwait, location_called_count); @@ -498,14 +430,22 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { */ const int kGnssSvInfoListTimeout = 2; - std::list> sv_info_vec_list; - int count = gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec_list, sv_info_list_cbq_size, - kGnssSvInfoListTimeout); - - ASSERT_EQ(count, sv_info_list_cbq_size); - - BlocklistedSource source_to_blocklist = - FindStrongFrequentNonGpsSource(sv_info_vec_list, kLocationsToAwait - 1); + BlocklistedSource source_to_blocklist; + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + std::list> sv_info_vec_list; + int count = gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec_list, sv_info_list_cbq_size, + kGnssSvInfoListTimeout); + ASSERT_EQ(count, sv_info_list_cbq_size); + source_to_blocklist = + FindStrongFrequentNonGpsSource(sv_info_vec_list, kLocationsToAwait - 1); + } else { + std::list> sv_info_vec_list; + int count = aidl_gnss_cb_->sv_info_list_cbq_.retrieve( + sv_info_vec_list, sv_info_list_cbq_size, kGnssSvInfoListTimeout); + ASSERT_EQ(count, sv_info_list_cbq_size); + source_to_blocklist = + FindStrongFrequentNonGpsSource(sv_info_vec_list, kLocationsToAwait - 1); + } if (source_to_blocklist.constellation == GnssConstellationTypeAidl::UNKNOWN) { // Cannot find a non-GPS satellite. Let the test pass. @@ -529,32 +469,53 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { ASSERT_TRUE(status.isOk()); // retry and ensure satellite not used - gnss_cb_->sv_info_list_cbq_.reset(); + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + gnss_cb_->sv_info_list_cbq_.reset(); + gnss_cb_->location_cbq_.reset(); + } else { + aidl_gnss_cb_->sv_info_list_cbq_.reset(); + aidl_gnss_cb_->location_cbq_.reset(); + } - gnss_cb_->location_cbq_.reset(); StartAndCheckLocations(kLocationsToAwait); // early exit if test is being run with insufficient signal - location_called_count = gnss_cb_->location_cbq_.calledCount(); + location_called_count = (aidl_gnss_hal_->getInterfaceVersion() == 1) + ? gnss_cb_->location_cbq_.calledCount() + : aidl_gnss_cb_->location_cbq_.calledCount(); if (location_called_count == 0) { ALOGE("0 Gnss locations received - ensure sufficient signal and retry"); } ASSERT_TRUE(location_called_count > 0); // Tolerate 1 less sv status to handle edge cases in reporting. - sv_info_list_cbq_size = gnss_cb_->sv_info_list_cbq_.size(); + sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1) + ? gnss_cb_->sv_info_list_cbq_.size() + : aidl_gnss_cb_->sv_info_list_cbq_.size(); EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait); ALOGD("Observed %d GnssSvInfo, while awaiting %d Locations (%d received)", sv_info_list_cbq_size, kLocationsToAwait, location_called_count); for (int i = 0; i < sv_info_list_cbq_size; ++i) { - hidl_vec sv_info_vec; - gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); - for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { - const auto& gnss_sv = sv_info_vec[iSv]; - EXPECT_FALSE((gnss_sv.v2_0.v1_0.svid == source_to_blocklist.svid) && - (static_cast(gnss_sv.v2_0.constellation) == - source_to_blocklist.constellation) && - (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + hidl_vec sv_info_vec; + gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); + for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { + auto& gnss_sv = sv_info_vec[iSv]; + EXPECT_FALSE( + (gnss_sv.v2_0.v1_0.svid == source_to_blocklist.svid) && + (static_cast(gnss_sv.v2_0.constellation) == + source_to_blocklist.constellation) && + (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); + } + } else { + std::vector sv_info_vec; + aidl_gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); + for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { + auto& gnss_sv = sv_info_vec[iSv]; + EXPECT_FALSE((gnss_sv.svid == source_to_blocklist.svid) && + (gnss_sv.constellation == source_to_blocklist.constellation) && + (gnss_sv.svFlag & (int)IGnssCallback::GnssSvFlags::USED_IN_FIX)); + } } } @@ -569,36 +530,59 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { int unblocklist_loops_remaining = kRetriesToUnBlocklist; while (!strongest_sv_is_reobserved && (unblocklist_loops_remaining-- > 0)) { StopAndClearLocations(); - gnss_cb_->sv_info_list_cbq_.reset(); - gnss_cb_->location_cbq_.reset(); + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + gnss_cb_->sv_info_list_cbq_.reset(); + gnss_cb_->location_cbq_.reset(); + } else { + aidl_gnss_cb_->sv_info_list_cbq_.reset(); + aidl_gnss_cb_->location_cbq_.reset(); + } StartAndCheckLocations(kLocationsToAwait); // early exit loop if test is being run with insufficient signal - location_called_count = gnss_cb_->location_cbq_.calledCount(); + location_called_count = (aidl_gnss_hal_->getInterfaceVersion() == 1) + ? gnss_cb_->location_cbq_.calledCount() + : aidl_gnss_cb_->location_cbq_.calledCount(); if (location_called_count == 0) { ALOGE("0 Gnss locations received - ensure sufficient signal and retry"); } ASSERT_TRUE(location_called_count > 0); // Tolerate 1 less sv status to handle edge cases in reporting. - sv_info_list_cbq_size = gnss_cb_->sv_info_list_cbq_.size(); + sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1) + ? gnss_cb_->sv_info_list_cbq_.size() + : aidl_gnss_cb_->sv_info_list_cbq_.size(); EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait); ALOGD("Clear blocklist, observed %d GnssSvInfo, while awaiting %d Locations" ", tries remaining %d", sv_info_list_cbq_size, kLocationsToAwait, unblocklist_loops_remaining); for (int i = 0; i < sv_info_list_cbq_size; ++i) { - hidl_vec sv_info_vec; - gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); - for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { - const auto& gnss_sv = sv_info_vec[iSv]; - if ((gnss_sv.v2_0.v1_0.svid == source_to_blocklist.svid) && - (static_cast(gnss_sv.v2_0.constellation) == - source_to_blocklist.constellation) && - (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)) { - strongest_sv_is_reobserved = true; - break; + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + hidl_vec sv_info_vec; + gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); + for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { + auto& gnss_sv = sv_info_vec[iSv]; + if ((gnss_sv.v2_0.v1_0.svid == source_to_blocklist.svid) && + (static_cast(gnss_sv.v2_0.constellation) == + source_to_blocklist.constellation) && + (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)) { + strongest_sv_is_reobserved = true; + break; + } + } + } else { + std::vector sv_info_vec; + aidl_gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); + for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { + auto& gnss_sv = sv_info_vec[iSv]; + if ((gnss_sv.svid == source_to_blocklist.svid) && + (gnss_sv.constellation == source_to_blocklist.constellation) && + (gnss_sv.svFlag & (int)IGnssCallback::GnssSvFlags::USED_IN_FIX)) { + strongest_sv_is_reobserved = true; + break; + } } } if (strongest_sv_is_reobserved) break; @@ -660,27 +644,47 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOff) { ASSERT_TRUE(status.isOk()); // retry and ensure constellation not used - gnss_cb_->sv_info_list_cbq_.reset(); - - gnss_cb_->location_cbq_.reset(); + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + gnss_cb_->sv_info_list_cbq_.reset(); + gnss_cb_->location_cbq_.reset(); + } else { + aidl_gnss_cb_->sv_info_list_cbq_.reset(); + aidl_gnss_cb_->location_cbq_.reset(); + } StartAndCheckLocations(kLocationsToAwait); // Tolerate 1 less sv status to handle edge cases in reporting. - int sv_info_list_cbq_size = gnss_cb_->sv_info_list_cbq_.size(); + int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1) + ? gnss_cb_->sv_info_list_cbq_.size() + : aidl_gnss_cb_->sv_info_list_cbq_.size(); EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait); ALOGD("Observed %d GnssSvInfo, while awaiting %d Locations", sv_info_list_cbq_size, kLocationsToAwait); for (int i = 0; i < sv_info_list_cbq_size; ++i) { - hidl_vec sv_info_vec; - gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); - for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { - const auto& gnss_sv = sv_info_vec[iSv]; - EXPECT_FALSE((static_cast(gnss_sv.v2_0.constellation) == - source_to_blocklist_1.constellation) && - (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); - EXPECT_FALSE((static_cast(gnss_sv.v2_0.constellation) == - source_to_blocklist_2.constellation) && - (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + hidl_vec sv_info_vec; + gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); + for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { + const auto& gnss_sv = sv_info_vec[iSv]; + EXPECT_FALSE( + (static_cast(gnss_sv.v2_0.constellation) == + source_to_blocklist_1.constellation) && + (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); + EXPECT_FALSE( + (static_cast(gnss_sv.v2_0.constellation) == + source_to_blocklist_2.constellation) && + (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); + } + } else { + std::vector sv_info_vec; + aidl_gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); + for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { + const auto& gnss_sv = sv_info_vec[iSv]; + EXPECT_FALSE((gnss_sv.constellation == source_to_blocklist_1.constellation) && + (gnss_sv.svFlag & (int)IGnssCallback::GnssSvFlags::USED_IN_FIX)); + EXPECT_FALSE((gnss_sv.constellation == source_to_blocklist_2.constellation) && + (gnss_sv.svFlag & (int)IGnssCallback::GnssSvFlags::USED_IN_FIX)); + } } } @@ -743,27 +747,47 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOn) { StopAndClearLocations(); // retry and ensure constellation not used - gnss_cb_->sv_info_list_cbq_.reset(); - - gnss_cb_->location_cbq_.reset(); + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + gnss_cb_->sv_info_list_cbq_.reset(); + gnss_cb_->location_cbq_.reset(); + } else { + aidl_gnss_cb_->sv_info_list_cbq_.reset(); + aidl_gnss_cb_->location_cbq_.reset(); + } StartAndCheckLocations(kLocationsToAwait); // Tolerate 1 less sv status to handle edge cases in reporting. - int sv_info_list_cbq_size = gnss_cb_->sv_info_list_cbq_.size(); + int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1) + ? gnss_cb_->sv_info_list_cbq_.size() + : aidl_gnss_cb_->sv_info_list_cbq_.size(); EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait); ALOGD("Observed %d GnssSvInfo, while awaiting %d Locations", sv_info_list_cbq_size, kLocationsToAwait); for (int i = 0; i < sv_info_list_cbq_size; ++i) { - hidl_vec sv_info_vec; - gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); - for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { - const auto& gnss_sv = sv_info_vec[iSv]; - EXPECT_FALSE((static_cast(gnss_sv.v2_0.constellation) == - source_to_blocklist_1.constellation) && - (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); - EXPECT_FALSE((static_cast(gnss_sv.v2_0.constellation) == - source_to_blocklist_2.constellation) && - (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + hidl_vec sv_info_vec; + gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); + for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { + const auto& gnss_sv = sv_info_vec[iSv]; + EXPECT_FALSE( + (static_cast(gnss_sv.v2_0.constellation) == + source_to_blocklist_1.constellation) && + (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); + EXPECT_FALSE( + (static_cast(gnss_sv.v2_0.constellation) == + source_to_blocklist_2.constellation) && + (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); + } + } else { + std::vector sv_info_vec; + aidl_gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); + for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { + const auto& gnss_sv = sv_info_vec[iSv]; + EXPECT_FALSE((gnss_sv.constellation == source_to_blocklist_1.constellation) && + (gnss_sv.svFlag & (int)IGnssCallback::GnssSvFlags::USED_IN_FIX)); + EXPECT_FALSE((gnss_sv.constellation == source_to_blocklist_2.constellation) && + (gnss_sv.svFlag & (int)IGnssCallback::GnssSvFlags::USED_IN_FIX)); + } } } @@ -829,7 +853,7 @@ TEST_P(GnssHalTest, TestAGnssExtension) { ASSERT_TRUE(status.isOk()); // Set SUPL server host/port - status = iAGnss->setServer(AGnssType::SUPL, String16("supl.google.com"), 7275); + status = iAGnss->setServer(AGnssType::SUPL, std::string("supl.google.com"), 7275); ASSERT_TRUE(status.isOk()); } @@ -845,7 +869,7 @@ TEST_P(GnssHalTest, GnssDebugValuesSanityTest) { auto status = aidl_gnss_hal_->getExtensionGnssDebug(&iGnssDebug); ASSERT_TRUE(status.isOk()); - if (!IsAutomotiveDevice() && gnss_cb_->info_cbq_.calledCount() > 0) { + if (!IsAutomotiveDevice()) { ASSERT_TRUE(iGnssDebug != nullptr); IGnssDebug::DebugData data; diff --git a/gnss/common/utils/default/Utils.cpp b/gnss/common/utils/default/Utils.cpp index c339e72d43..563c6d5d21 100644 --- a/gnss/common/utils/default/Utils.cpp +++ b/gnss/common/utils/default/Utils.cpp @@ -27,14 +27,17 @@ namespace common { using aidl::android::hardware::gnss::ElapsedRealtime; using aidl::android::hardware::gnss::GnssClock; +using aidl::android::hardware::gnss::GnssConstellationType; using aidl::android::hardware::gnss::GnssData; using aidl::android::hardware::gnss::GnssLocation; using aidl::android::hardware::gnss::GnssMeasurement; using aidl::android::hardware::gnss::IGnss; using aidl::android::hardware::gnss::IGnssMeasurementCallback; using aidl::android::hardware::gnss::SatellitePvt; +using GnssSvInfo = aidl::android::hardware::gnss::IGnssCallback::GnssSvInfo; +using GnssSvFlags = aidl::android::hardware::gnss::IGnssCallback::GnssSvFlags; -using GnssSvFlags = V1_0::IGnssCallback::GnssSvFlags; +using GnssSvFlagsV1_0 = V1_0::IGnssCallback::GnssSvFlags; using GnssMeasurementFlagsV1_0 = V1_0::IGnssMeasurementCallback::GnssMeasurementFlags; using GnssMeasurementFlagsV2_1 = V2_1::IGnssMeasurementCallback::GnssMeasurementFlags; using GnssMeasurementStateV2_0 = V2_0::IGnssMeasurementCallback::GnssMeasurementState; @@ -144,7 +147,7 @@ GnssDataV2_0 Utils::getMockMeasurementV2_0() { GnssData Utils::getMockMeasurement(const bool enableCorrVecOutputs) { aidl::android::hardware::gnss::GnssSignalType signalType = { - .constellation = aidl::android::hardware::gnss::GnssConstellationType::GLONASS, + .constellation = GnssConstellationType::GLONASS, .carrierFrequencyHz = 1.59975e+09, .codeType = aidl::android::hardware::gnss::GnssSignalType::CODE_TYPE_C, }; @@ -289,6 +292,40 @@ V1_0::GnssLocation Utils::getMockLocationV1_0() { return location; } +namespace { +GnssSvInfo getMockSvInfo(int svid, GnssConstellationType type, float cN0DbHz, float basebandCN0DbHz, + float elevationDegrees, float azimuthDegrees, long carrierFrequencyHz) { + GnssSvInfo svInfo = { + .svid = svid, + .constellation = type, + .cN0Dbhz = cN0DbHz, + .basebandCN0DbHz = basebandCN0DbHz, + .elevationDegrees = elevationDegrees, + .azimuthDegrees = azimuthDegrees, + .carrierFrequencyHz = carrierFrequencyHz, + .svFlag = (int)GnssSvFlags::USED_IN_FIX | (int)GnssSvFlags::HAS_EPHEMERIS_DATA | + (int)GnssSvFlags::HAS_ALMANAC_DATA | (int)GnssSvFlags::HAS_CARRIER_FREQUENCY}; + return svInfo; +} +} // anonymous namespace + +std::vector Utils::getMockSvInfoList() { + std::vector gnssSvInfoList = { + getMockSvInfo(3, GnssConstellationType::GPS, 32.5, 27.5, 59.1, 166.5, kGpsL1FreqHz), + getMockSvInfo(5, GnssConstellationType::GPS, 27.0, 22.0, 29.0, 56.5, kGpsL1FreqHz), + getMockSvInfo(17, GnssConstellationType::GPS, 30.5, 25.5, 71.0, 77.0, kGpsL5FreqHz), + getMockSvInfo(26, GnssConstellationType::GPS, 24.1, 19.1, 28.0, 253.0, kGpsL5FreqHz), + getMockSvInfo(5, GnssConstellationType::GLONASS, 20.5, 15.5, 11.5, 116.0, kGloG1FreqHz), + getMockSvInfo(17, GnssConstellationType::GLONASS, 21.5, 16.5, 28.5, 186.0, + kGloG1FreqHz), + getMockSvInfo(18, GnssConstellationType::GLONASS, 28.3, 25.3, 38.8, 69.0, kGloG1FreqHz), + getMockSvInfo(10, GnssConstellationType::GLONASS, 25.0, 20.0, 66.0, 247.0, + kGloG1FreqHz), + getMockSvInfo(3, GnssConstellationType::IRNSS, 22.0, 19.7, 35.0, 112.0, kIrnssL5FreqHz), + }; + return gnssSvInfoList; +} + hidl_vec Utils::getMockSvInfoListV2_1() { GnssSvInfoV1_0 gnssSvInfoV1_0 = Utils::getMockSvInfoV1_0(3, V1_0::GnssConstellationType::GPS, 32.5, 59.1, 166.5, kGpsL1FreqHz); @@ -360,15 +397,15 @@ GnssSvInfoV2_0 Utils::getMockSvInfoV2_0(GnssSvInfoV1_0 gnssSvInfoV1_0, GnssSvInfoV1_0 Utils::getMockSvInfoV1_0(int16_t svid, V1_0::GnssConstellationType type, float cN0DbHz, float elevationDegrees, float azimuthDegrees, float carrierFrequencyHz) { - GnssSvInfoV1_0 svInfo = {.svid = svid, - .constellation = type, - .cN0Dbhz = cN0DbHz, - .elevationDegrees = elevationDegrees, - .azimuthDegrees = azimuthDegrees, - .carrierFrequencyHz = carrierFrequencyHz, - .svFlag = GnssSvFlags::USED_IN_FIX | GnssSvFlags::HAS_EPHEMERIS_DATA | - GnssSvFlags::HAS_ALMANAC_DATA | - GnssSvFlags::HAS_CARRIER_FREQUENCY}; + GnssSvInfoV1_0 svInfo = { + .svid = svid, + .constellation = type, + .cN0Dbhz = cN0DbHz, + .elevationDegrees = elevationDegrees, + .azimuthDegrees = azimuthDegrees, + .carrierFrequencyHz = carrierFrequencyHz, + .svFlag = GnssSvFlagsV1_0::USED_IN_FIX | GnssSvFlagsV1_0::HAS_EPHEMERIS_DATA | + GnssSvFlagsV1_0::HAS_ALMANAC_DATA | GnssSvFlagsV1_0::HAS_CARRIER_FREQUENCY}; return svInfo; } diff --git a/gnss/common/utils/default/include/Utils.h b/gnss/common/utils/default/include/Utils.h index 4500ee6abf..7065a6fb00 100644 --- a/gnss/common/utils/default/include/Utils.h +++ b/gnss/common/utils/default/include/Utils.h @@ -35,9 +35,13 @@ struct Utils { const bool enableCorrVecOutputs); static V2_0::IGnssMeasurementCallback::GnssData getMockMeasurementV2_0(); static V2_1::IGnssMeasurementCallback::GnssData getMockMeasurementV2_1(); + static aidl::android::hardware::gnss::GnssLocation getMockLocation(); static V2_0::GnssLocation getMockLocationV2_0(); static V1_0::GnssLocation getMockLocationV1_0(); + + static std::vector + getMockSvInfoList(); static hidl_vec getMockSvInfoListV2_1(); static V2_1::IGnssCallback::GnssSvInfo getMockSvInfoV2_1( V2_0::IGnssCallback::GnssSvInfo gnssSvInfoV2_0, float basebandCN0DbHz); @@ -48,6 +52,7 @@ struct Utils { float cN0DbHz, float elevationDegrees, float azimuthDegrees, float carrierFrequencyHz); + static hidl_vec getMockAntennaInfos(); }; diff --git a/gnss/common/utils/vts/Android.bp b/gnss/common/utils/vts/Android.bp index 47eff2ec9c..f92e609f3c 100644 --- a/gnss/common/utils/vts/Android.bp +++ b/gnss/common/utils/vts/Android.bp @@ -44,6 +44,7 @@ cc_library_static { "android.hardware.gnss@2.1", "android.hardware.gnss.measurement_corrections@1.0", "android.hardware.gnss.measurement_corrections@1.1", + "android.hardware.gnss-V2-cpp", ], static_libs: [ "libgtest", diff --git a/gnss/common/utils/vts/Utils.cpp b/gnss/common/utils/vts/Utils.cpp index be22ff6e65..06bce9d3a7 100644 --- a/gnss/common/utils/vts/Utils.cpp +++ b/gnss/common/utils/vts/Utils.cpp @@ -15,6 +15,7 @@ */ #include +#include #include "gtest/gtest.h" #include @@ -27,71 +28,14 @@ namespace common { using namespace measurement_corrections::V1_0; using V1_0::GnssLocationFlags; -void Utils::checkLocation(const V1_0::GnssLocation& location, bool check_speed, - bool check_more_accuracies) { - EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG); - EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE); - if (check_speed) { - EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED); - } - EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_HORIZONTAL_ACCURACY); - // New uncertainties available in O must be provided, - // at least when paired with modern hardware (2017+) - if (check_more_accuracies) { - EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY); - if (check_speed) { - EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY); - if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) { - EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY); - } - } - } - EXPECT_GE(location.latitudeDegrees, -90.0); - EXPECT_LE(location.latitudeDegrees, 90.0); - EXPECT_GE(location.longitudeDegrees, -180.0); - EXPECT_LE(location.longitudeDegrees, 180.0); - EXPECT_GE(location.altitudeMeters, -1000.0); - EXPECT_LE(location.altitudeMeters, 30000.0); - if (check_speed) { - EXPECT_GE(location.speedMetersPerSec, 0.0); - EXPECT_LE(location.speedMetersPerSec, 5.0); // VTS tests are stationary. - - // Non-zero speeds must be reported with an associated bearing - if (location.speedMetersPerSec > 0.0) { - EXPECT_TRUE(location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING); - } - } - - /* - * Tolerating some especially high values for accuracy estimate, in case of - * first fix with especially poor geometry (happens occasionally) - */ - EXPECT_GT(location.horizontalAccuracyMeters, 0.0); - EXPECT_LE(location.horizontalAccuracyMeters, 250.0); - - /* - * Some devices may define bearing as -180 to +180, others as 0 to 360. - * Both are okay & understandable. - */ - if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) { - EXPECT_GE(location.bearingDegrees, -180.0); - EXPECT_LE(location.bearingDegrees, 360.0); - } - if (location.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY) { - EXPECT_GT(location.verticalAccuracyMeters, 0.0); - EXPECT_LE(location.verticalAccuracyMeters, 500.0); - } - if (location.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY) { - EXPECT_GT(location.speedAccuracyMetersPerSecond, 0.0); - EXPECT_LE(location.speedAccuracyMetersPerSecond, 50.0); - } - if (location.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY) { - EXPECT_GT(location.bearingAccuracyDegrees, 0.0); - EXPECT_LE(location.bearingAccuracyDegrees, 360.0); - } +template <> +int64_t Utils::getLocationTimestampMillis(const android::hardware::gnss::GnssLocation& location) { + return location.timestampMillis; +} - // Check timestamp > 1.48e12 (47 years in msec - 1970->2017+) - EXPECT_GT(location.timestamp, 1.48e12); +template <> +int64_t Utils::getLocationTimestampMillis(const V1_0::GnssLocation& location) { + return location.timestamp; } const MeasurementCorrections Utils::getMockMeasurementCorrections() { diff --git a/gnss/common/utils/vts/include/Utils.h b/gnss/common/utils/vts/include/Utils.h index 91c1167b31..40f31d288e 100644 --- a/gnss/common/utils/vts/include/Utils.h +++ b/gnss/common/utils/vts/include/Utils.h @@ -21,6 +21,7 @@ #include #include #include +#include namespace android { namespace hardware { @@ -28,8 +29,9 @@ namespace gnss { namespace common { struct Utils { - static void checkLocation(const V1_0::GnssLocation& location, bool check_speed, - bool check_more_accuracies); + public: + template + static void checkLocation(const T& location, bool check_speed, bool check_more_accuracies); static const measurement_corrections::V1_0::MeasurementCorrections getMockMeasurementCorrections(); static const measurement_corrections::V1_1::MeasurementCorrections @@ -39,8 +41,80 @@ struct Utils { V2_0::GnssConstellationType constellation); static bool isAutomotiveDevice(); + + private: + template + static int64_t getLocationTimestampMillis(const T&); }; +template +void Utils::checkLocation(const T& location, bool check_speed, bool check_more_accuracies) { + EXPECT_TRUE(location.gnssLocationFlags & V1_0::GnssLocationFlags::HAS_LAT_LONG); + EXPECT_TRUE(location.gnssLocationFlags & V1_0::GnssLocationFlags::HAS_ALTITUDE); + if (check_speed) { + EXPECT_TRUE(location.gnssLocationFlags & V1_0::GnssLocationFlags::HAS_SPEED); + } + EXPECT_TRUE(location.gnssLocationFlags & V1_0::GnssLocationFlags::HAS_HORIZONTAL_ACCURACY); + // New uncertainties available in O must be provided, + // at least when paired with modern hardware (2017+) + if (check_more_accuracies) { + EXPECT_TRUE(location.gnssLocationFlags & V1_0::GnssLocationFlags::HAS_VERTICAL_ACCURACY); + if (check_speed) { + EXPECT_TRUE(location.gnssLocationFlags & V1_0::GnssLocationFlags::HAS_SPEED_ACCURACY); + if (location.gnssLocationFlags & V1_0::GnssLocationFlags::HAS_BEARING) { + EXPECT_TRUE(location.gnssLocationFlags & + V1_0::GnssLocationFlags::HAS_BEARING_ACCURACY); + } + } + } + EXPECT_GE(location.latitudeDegrees, -90.0); + EXPECT_LE(location.latitudeDegrees, 90.0); + EXPECT_GE(location.longitudeDegrees, -180.0); + EXPECT_LE(location.longitudeDegrees, 180.0); + EXPECT_GE(location.altitudeMeters, -1000.0); + EXPECT_LE(location.altitudeMeters, 30000.0); + if (check_speed) { + EXPECT_GE(location.speedMetersPerSec, 0.0); + EXPECT_LE(location.speedMetersPerSec, 5.0); // VTS tests are stationary. + + // Non-zero speeds must be reported with an associated bearing + if (location.speedMetersPerSec > 0.0) { + EXPECT_TRUE(location.gnssLocationFlags & V1_0::GnssLocationFlags::HAS_BEARING); + } + } + + /* + * Tolerating some especially high values for accuracy estimate, in case of + * first fix with especially poor geometry (happens occasionally) + */ + EXPECT_GT(location.horizontalAccuracyMeters, 0.0); + EXPECT_LE(location.horizontalAccuracyMeters, 250.0); + + /* + * Some devices may define bearing as -180 to +180, others as 0 to 360. + * Both are okay & understandable. + */ + if (location.gnssLocationFlags & V1_0::GnssLocationFlags::HAS_BEARING) { + EXPECT_GE(location.bearingDegrees, -180.0); + EXPECT_LE(location.bearingDegrees, 360.0); + } + if (location.gnssLocationFlags & V1_0::GnssLocationFlags::HAS_VERTICAL_ACCURACY) { + EXPECT_GT(location.verticalAccuracyMeters, 0.0); + EXPECT_LE(location.verticalAccuracyMeters, 500.0); + } + if (location.gnssLocationFlags & V1_0::GnssLocationFlags::HAS_SPEED_ACCURACY) { + EXPECT_GT(location.speedAccuracyMetersPerSecond, 0.0); + EXPECT_LE(location.speedAccuracyMetersPerSecond, 50.0); + } + if (location.gnssLocationFlags & V1_0::GnssLocationFlags::HAS_BEARING_ACCURACY) { + EXPECT_GT(location.bearingAccuracyDegrees, 0.0); + EXPECT_LE(location.bearingAccuracyDegrees, 360.0); + } + + // Check timestamp > 1.48e12 (47 years in msec - 1970->2017+) + EXPECT_GT(getLocationTimestampMillis(location), 1.48e12); +} + } // namespace common } // namespace gnss } // namespace hardware diff --git a/gnss/common/utils/vts/include/v2_1/GnssCallback.h b/gnss/common/utils/vts/include/v2_1/GnssCallback.h index ab1375d3a5..09a67de717 100644 --- a/gnss/common/utils/vts/include/v2_1/GnssCallback.h +++ b/gnss/common/utils/vts/include/v2_1/GnssCallback.h @@ -28,7 +28,6 @@ using android::hardware::Void; using android::hardware::gnss::common::GnssCallbackEventQueue; using android::hardware::gnss::measurement_corrections::V1_0::IMeasurementCorrectionsCallback; using android::hardware::gnss::V1_0::GnssLocationFlags; -using android::hardware::gnss::V2_0::GnssConstellationType; using GnssLocation_1_0 = android::hardware::gnss::V1_0::GnssLocation; using GnssLocation_2_0 = android::hardware::gnss::V2_0::GnssLocation; -- GitLab From b5f634fc37d70e9c595efa318f10b35e201180bd Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Mon, 13 Dec 2021 15:13:46 -0800 Subject: [PATCH 387/825] Camera: Add device 3.8 and HDR10 native APIs Initial set of native API extensions to support 10-bit output capable device: - Identification - Configuration - Data plumbing Bug: 195946346 Test: adb shell /data/nativetest64/VtsHalCameraProviderV2_4TargetTest/VtsHalCameraProviderV2_4TargetTest --gtest_filter=PerInstance/CameraHidlTest.process10BitDynamicRangeRequest/0_internal_0 Change-Id: I526120944232ce211259cbd215935db7e445a6c5 --- camera/common/1.0/default/HandleImporter.cpp | 65 ++ .../1.0/default/include/HandleImporter.h | 5 + camera/device/3.8/Android.bp | 3 +- camera/device/3.8/ICameraDevice.hal | 15 +- camera/device/3.8/ICameraDeviceSession.hal | 95 +++ camera/device/3.8/types.hal | 77 +++ camera/metadata/3.8/types.hal | 63 ++ camera/provider/2.4/vts/functional/Android.bp | 4 + .../VtsHalCameraProviderV2_4TargetTest.cpp | 565 +++++++++++++++++- 9 files changed, 858 insertions(+), 34 deletions(-) create mode 100644 camera/device/3.8/ICameraDeviceSession.hal diff --git a/camera/common/1.0/default/HandleImporter.cpp b/camera/common/1.0/default/HandleImporter.cpp index 7fcf52330c..fbe8686766 100644 --- a/camera/common/1.0/default/HandleImporter.cpp +++ b/camera/common/1.0/default/HandleImporter.cpp @@ -30,6 +30,7 @@ namespace helper { using aidl::android::hardware::graphics::common::PlaneLayout; using aidl::android::hardware::graphics::common::PlaneLayoutComponent; using aidl::android::hardware::graphics::common::PlaneLayoutComponentType; +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; @@ -123,6 +124,21 @@ YCbCrLayout HandleImporter::lockYCbCrInternal(const sp mapper, buffer_handle_ return layout; } +bool isMetadataPesent(const sp mapper, const buffer_handle_t& buf, + MetadataType metadataType) { + auto buffer = const_cast(buf); + mapper->get(buffer, metadataType, [] (const auto& tmpError, + const auto& tmpMetadata) { + if (tmpError == MapperErrorV4::NONE) { + return tmpMetadata.size() > 0; + } else { + ALOGE("%s: failed to get metadata %d!", __FUNCTION__, tmpError); + return false; + }}); + + return false; +} + std::vector getPlaneLayouts(const sp mapper, buffer_handle_t& buf) { auto buffer = const_cast(buf); std::vector planeLayouts; @@ -449,6 +465,55 @@ int HandleImporter::unlock(buffer_handle_t& buf) { return -1; } +bool HandleImporter::isSmpte2086Present(const buffer_handle_t& buf) { + Mutex::Autolock lock(mLock); + + if (!mInitialized) { + initializeLocked(); + } + + if (mMapperV4 != nullptr) { + return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2086); + } else { + ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); + } + + return false; +} + +bool HandleImporter::isSmpte2094_10Present(const buffer_handle_t& buf) { + Mutex::Autolock lock(mLock); + + if (!mInitialized) { + initializeLocked(); + } + + if (mMapperV4 != nullptr) { + return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2094_10); + } else { + ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); + } + + return false; +} + +bool HandleImporter::isSmpte2094_40Present(const buffer_handle_t& buf) { + Mutex::Autolock lock(mLock); + + if (!mInitialized) { + initializeLocked(); + } + + if (mMapperV4 != nullptr) { + return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2094_40); + } else { + ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); + } + + return false; +} + + } // namespace helper } // namespace V1_0 } // namespace common diff --git a/camera/common/1.0/default/include/HandleImporter.h b/camera/common/1.0/default/include/HandleImporter.h index e404439cb6..83fa755c99 100644 --- a/camera/common/1.0/default/include/HandleImporter.h +++ b/camera/common/1.0/default/include/HandleImporter.h @@ -61,6 +61,11 @@ public: int unlock(buffer_handle_t& buf); // returns release fence + // Query Gralloc4 metadata + bool isSmpte2086Present(const buffer_handle_t& buf); + bool isSmpte2094_10Present(const buffer_handle_t& buf); + bool isSmpte2094_40Present(const buffer_handle_t& buf); + private: void initializeLocked(); void cleanup(); diff --git a/camera/device/3.8/Android.bp b/camera/device/3.8/Android.bp index 2a1f215023..c3c29416a9 100644 --- a/camera/device/3.8/Android.bp +++ b/camera/device/3.8/Android.bp @@ -9,7 +9,6 @@ package { default_applicable_licenses: ["hardware_interfaces_license"], } - hidl_interface { name: "android.hardware.camera.device@3.8", root: "android.hardware", @@ -17,6 +16,7 @@ hidl_interface { "types.hal", "ICameraDevice.hal", "ICameraDeviceCallback.hal", + "ICameraDeviceSession.hal", ], interfaces: [ "android.hardware.camera.common@1.0", @@ -31,6 +31,7 @@ hidl_interface { "android.hardware.camera.metadata@3.4", "android.hardware.camera.metadata@3.5", "android.hardware.camera.metadata@3.6", + "android.hardware.camera.metadata@3.8", "android.hardware.graphics.common@1.0", "android.hidl.base@1.0", ], diff --git a/camera/device/3.8/ICameraDevice.hal b/camera/device/3.8/ICameraDevice.hal index 1101819a4d..8832c68098 100644 --- a/camera/device/3.8/ICameraDevice.hal +++ b/camera/device/3.8/ICameraDevice.hal @@ -26,8 +26,8 @@ import @3.7::ICameraDevice; * API at LIMITED or better hardware level. * * ICameraDevice.open() must return @3.2::ICameraDeviceSession, - * @3.5::ICameraDeviceSession, @3.6::ICameraDeviceSession, or - * @3.7::ICameraDeviceSession. + * @3.5::ICameraDeviceSession, @3.6::ICameraDeviceSession, + * @3.7::ICameraDeviceSession, or @3.8::ICameraDeviceSession. */ interface ICameraDevice extends @3.7::ICameraDevice { /** @@ -107,4 +107,15 @@ interface ICameraDevice extends @3.7::ICameraDevice { * */ getTorchStrengthLevel() generates (Status status, int32_t torchStrength); + + /** + * isStreamCombinationSupported_3_8: + * + * Identical to @3.7::ICameraDevice.isStreamCombinationSupported, except + * that it takes a @3.8::StreamConfiguration parameter, which could contain + * additional information about a specific 10-bit dynamic range profile. + * + */ + isStreamCombinationSupported_3_8(StreamConfiguration streams) + generates (Status status, bool queryStatus); }; diff --git a/camera/device/3.8/ICameraDeviceSession.hal b/camera/device/3.8/ICameraDeviceSession.hal new file mode 100644 index 0000000000..88e4338209 --- /dev/null +++ b/camera/device/3.8/ICameraDeviceSession.hal @@ -0,0 +1,95 @@ +/* + * 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. + */ + +package android.hardware.camera.device@3.8; + +import android.hardware.camera.common@1.0::Status; +import @3.5::StreamConfiguration; +import @3.7::ICameraDeviceSession; +import @3.6::HalStreamConfiguration; + +/** + * Camera device active session interface. + * + * Obtained via ICameraDevice::open(), this interface contains the methods to + * configure and request captures from an active camera device. + */ +interface ICameraDeviceSession extends @3.7::ICameraDeviceSession { + /** + * configureStreams_3_8: + * + * Identical to @3.7::ICameraDeviceSession.configureStreams_3_7, except that: + * + * - The requestedConfiguration allows the camera framework to configure + * 10-bit dynamic range profile. + * + * @return status Status code for the operation, one of: + * OK: + * On successful stream configuration. + * INTERNAL_ERROR: + * If there has been a fatal error and the device is no longer + * operational. Only close() can be called successfully by the + * framework after this error is returned. + * ILLEGAL_ARGUMENT: + * If the requested stream configuration is invalid. Some examples + * of invalid stream configurations include: + * - Including more than 1 INPUT stream + * - Not including any OUTPUT streams + * - Including streams with unsupported formats, or an unsupported + * size for that format. + * - Including too many output streams of a certain format. + * - Unsupported rotation configuration + * - Stream sizes/formats don't satisfy the + * StreamConfigurationMode requirements + * for non-NORMAL mode, or the requested operation_mode is not + * supported by the HAL. + * - Unsupported usage flag + * - Unsupported stream groupIds, or unsupported multi-resolution + * input stream. + * - Invalid combination between a 10-bit dynamic range profile + * and none impl. defined 8-bit format for a particular stream. + * The camera service cannot filter out all possible illegal stream + * configurations, since some devices may support more simultaneous + * streams or larger stream resolutions than the minimum required + * for a given camera device hardware level. The HAL must return an + * ILLEGAL_ARGUMENT for any unsupported stream set, and then be + * ready to accept a future valid stream configuration in a later + * configureStreams call. + * @return halConfiguration The stream parameters desired by the HAL for + * each stream, including maximum buffers, the usage flags, and the + * override format and dataspace. + */ + configureStreams_3_8(StreamConfiguration requestedConfiguration) + generates (Status status, @3.6::HalStreamConfiguration halConfiguration); + + /** + * repeatingRequestEnd: + * + * Notification about the last frame number in a repeating request along with the + * ids of all streams included in the repeating request. + * + * This can be called at any point after 'processCaptureRequest' in response + * to camera clients disabling an active repeating request. + * + * Performance requirements: + * The call must not be blocked for extensive periods and should be extremely lightweight. There + * must be no frame rate degradation or frame jitter introduced. + * + * This method must always succeed, even if the device has encountered a + * serious error. + */ + repeatingRequestEnd(uint32_t frameNumber, vec streamIds); +}; diff --git a/camera/device/3.8/types.hal b/camera/device/3.8/types.hal index 843d050bb2..9d1ac22f5a 100644 --- a/camera/device/3.8/types.hal +++ b/camera/device/3.8/types.hal @@ -19,6 +19,11 @@ package android.hardware.camera.device@3.8; import @3.2::ErrorMsg; import @3.2::MsgType; import @3.2::ShutterMsg; +import @3.2::CameraMetadata; +import @3.2::StreamConfigurationMode; +import @3.7::Stream; + +import android.hardware.camera.metadata@3.8::CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap; /** * ShutterMsg: @@ -67,3 +72,75 @@ struct NotifyMsg { ShutterMsg shutter; } msg; }; + +/** + * Stream: + * + * A descriptor for a single camera input or output stream. A stream is defined + * by the framework by its buffer resolution and format, and additionally by the + * HAL with the gralloc usage flags and the maximum in-flight buffer count. + * + * This version extends the @3.7 Stream with the dynamic range profile field. + */ +struct Stream { + /** + * The definition of Stream from the prior version. + */ + @3.7::Stream v3_7; + + /** + * The dynamic range profile for this stream. + * + * This field is valid and must only be considered for streams with format + * android.hardware.graphics.common.PixelFormat.YCBCR_P010 or + * android.hardware.graphics.common.PixelFormat.IMPLEMENTATION_DEFINED on devices supporting the + * ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_10_BIT capability. + * + */ + CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap dynamicRangeProfile; +}; + +/** + * StreamConfiguration: + * + * Identical to @3.7::StreamConfiguration, except that the streams + * vector contains @3.8::Stream. + */ +struct StreamConfiguration { + /** + * An array of camera stream pointers, defining the input/output + * configuration for the camera HAL device. + */ + vec streams; + + /** + * The definition of operation mode from prior version. + * + */ + @3.2::StreamConfigurationMode operationMode; + + /** + * The definition of session parameters from prior version. + */ + @3.2::CameraMetadata sessionParams; + + /** + * The definition of stream configuration counter from prior version. + */ + uint32_t streamConfigCounter; + + /** + * If an input stream is configured, whether the input stream is expected to + * receive variable resolution images. + * + * This flag can only be set to true if the camera device supports + * multi-resolution input streams by advertising input stream configurations in + * physicalCameraMultiResolutionStreamConfigurations in its physical cameras' + * characteristics. + * + * When this flag is set to true, the input stream's width and height can be + * any one of the supported multi-resolution input stream sizes. + */ + bool multiResolutionInputImage; +}; + diff --git a/camera/metadata/3.8/types.hal b/camera/metadata/3.8/types.hal index 11360da72b..4c70eb9528 100644 --- a/camera/metadata/3.8/types.hal +++ b/camera/metadata/3.8/types.hal @@ -53,6 +53,21 @@ enum CameraMetadataTag : @3.7::CameraMetadataTag { ANDROID_FLASH_INFO_END_3_8, + /** android.request.availableDynamicRangeProfilesMap [static, enum[], ndk_public] + * + *

A map of all available 10-bit dynamic range profiles along with their + * capture request constraints.

+ */ + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP = android.hardware.camera.metadata@3.4::CameraMetadataTag:ANDROID_REQUEST_END_3_4, + + /** android.request.recommendedTenBitDynamicRangeProfile [static, int32, java_public] + * + *

Recommended 10-bit dynamic range profile.

+ */ + ANDROID_REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE, + + ANDROID_REQUEST_END_3_8, + }; /* @@ -66,3 +81,51 @@ enum CameraMetadataEnumAndroidControlVideoStabilizationMode : @3.2::CameraMetadataEnumAndroidControlVideoStabilizationMode { ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION, }; + +/** android.request.availableCapabilities enumeration values added since v3.6 + * @see ANDROID_REQUEST_AVAILABLE_CAPABILITIES + */ +enum CameraMetadataEnumAndroidRequestAvailableCapabilities : + @3.6::CameraMetadataEnumAndroidRequestAvailableCapabilities { + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT, +}; + +/** android.request.availableDynamicRangeProfilesMap enumeration values + * @see ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP + */ +enum CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap : uint32_t { + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD + = 0x1, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10 = 0x2, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10 = 0x4, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS + = 0x8, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF + = 0x10, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO + = 0x20, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM + = 0x40, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO + = 0x80, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF + = 0x100, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO + = 0x200, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM + = 0x400, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO + = 0x800, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_MAX = 0x1000, +}; + +/** android.scaler.availableRecommendedStreamConfigurations enumeration values added since v3.4 + * @see ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS + */ +enum CameraMetadataEnumAndroidScalerAvailableRecommendedStreamConfigurations : + @3.4::CameraMetadataEnumAndroidScalerAvailableRecommendedStreamConfigurations { + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_10BIT_OUTPUT + = 0x8, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END_3_8 + = 0x9, +}; diff --git a/camera/provider/2.4/vts/functional/Android.bp b/camera/provider/2.4/vts/functional/Android.bp index 2c141ee1d6..0e622655df 100644 --- a/camera/provider/2.4/vts/functional/Android.bp +++ b/camera/provider/2.4/vts/functional/Android.bp @@ -51,11 +51,15 @@ cc_test { "android.hardware.camera.device@3.7", "android.hardware.camera.device@3.8", "android.hardware.camera.metadata@3.4", + "android.hardware.camera.metadata@3.8", "android.hardware.camera.provider@2.4", "android.hardware.camera.provider@2.5", "android.hardware.camera.provider@2.6", "android.hardware.camera.provider@2.7", "android.hardware.graphics.common@1.0", + "android.hardware.graphics.mapper@2.0", + "android.hardware.graphics.mapper@3.0", + "android.hardware.graphics.mapper@4.0", "android.hidl.allocator@1.0", "libgrallocusage", "libhidlmemory", diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index d39850d06d..dd45b0dca8 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -45,7 +46,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -97,6 +100,7 @@ using ::android::hardware::camera::common::V1_0::Status; using ::android::hardware::camera::common::V1_0::TorchMode; using ::android::hardware::camera::common::V1_0::TorchModeStatus; using ::android::hardware::camera::common::V1_0::helper::CameraParameters; +using ::android::hardware::camera::common::V1_0::helper::HandleImporter; using ::android::hardware::camera::common::V1_0::helper::Size; using ::android::hardware::camera::device::V1_0::CameraFacing; using ::android::hardware::camera::device::V1_0::CameraFrameMetadata; @@ -129,6 +133,8 @@ using ::android::hardware::camera::metadata::V3_4:: CameraMetadataEnumAndroidSensorInfoColorFilterArrangement; using ::android::hardware::camera::metadata::V3_4::CameraMetadataTag; using ::android::hardware::camera::metadata::V3_6::CameraMetadataEnumAndroidSensorPixelMode; +using ::android::hardware::camera::metadata::V3_8:: + CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap; using ::android::hardware::camera::provider::V2_4::ICameraProvider; using ::android::hardware::camera::provider::V2_4::ICameraProviderCallback; using ::android::hardware::camera::provider::V2_6::CameraIdAndStreamCombination; @@ -136,7 +142,6 @@ using ::android::hardware::graphics::common::V1_0::BufferUsage; using ::android::hardware::graphics::common::V1_0::Dataspace; using ::android::hardware::graphics::common::V1_0::PixelFormat; using ::android::hidl::allocator::V1_0::IAllocator; -using ::android::hidl::memory::V1_0::IMapper; using ::android::hidl::memory::V1_0::IMemory; using ResultMetadataQueue = MessageQueue; using ::android::hidl::manager::V1_0::IServiceManager; @@ -781,13 +786,15 @@ public: sp *session3_4 /*out*/, sp *session3_5 /*out*/, sp *session3_6 /*out*/, - sp *session3_7 /*out*/); + sp *session3_7 /*out*/, + sp *session3_8 /*out*/); void castInjectionSession( const sp& session, sp* injectionSession3_7 /*out*/); void castDevice(const sp& device, int32_t deviceVersion, sp* device3_5 /*out*/, - sp* device3_7 /*out*/); + sp* device3_7 /*out*/, + sp* device3_8 /*out*/); void createStreamConfiguration( const ::android::hardware::hidl_vec& streams3_2, StreamConfigurationMode configMode, @@ -817,6 +824,16 @@ public: uint32_t* partialResultCount /*out*/, bool* useHalBufManager /*out*/, sp* outCb /*out*/, uint32_t streamConfigCounter, bool maxResolution); + void configureStreams3_8(const std::string& name, int32_t deviceVersion, + sp provider, PixelFormat format, + sp* session3_8 /*out*/, + V3_2::Stream* previewStream /*out*/, + device::V3_6::HalStreamConfiguration* halStreamConfig /*out*/, + bool* supportsPartialResults /*out*/, + uint32_t* partialResultCount /*out*/, bool* useHalBufManager /*out*/, + sp* outCb /*out*/, uint32_t streamConfigCounter, + bool maxResolution, + CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap prof); void configurePreviewStreams3_4(const std::string &name, int32_t deviceVersion, sp provider, @@ -896,6 +913,9 @@ public: static bool isDepthOnly(const camera_metadata_t* staticMeta); static bool isUltraHighResolution(const camera_metadata_t* staticMeta); + static void get10BitDynamicRangeProfiles(const camera_metadata_t* staticMeta, + std::vector *profiles); + static bool is10BitDynamicRangeCapable(const camera_metadata_t* staticMeta); static Status getAvailableOutputStreams(const camera_metadata_t* staticMeta, std::vector& outputStreams, @@ -1077,6 +1097,10 @@ protected: expectedPhysicalResults(extraPhysicalResult) {} }; + static void verify10BitMetadata(HandleImporter& importer, + const InFlightRequest& request, + CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap profile); + // Map from frame number to the in-flight request state typedef ::android::KeyedVector InFlightMap; @@ -1105,6 +1129,8 @@ protected: // Camera provider type. std::string mProviderType; + + HandleImporter mHandleImporter; }; Return CameraHidlTest::Camera1DeviceCb::notifyCallback( @@ -3342,10 +3368,13 @@ TEST_P(CameraHidlTest, openClose) { sp sessionV3_5; sp sessionV3_6; sp sessionV3_7; + sp sessionV3_8; castSession(session, deviceVersion, &sessionV3_3, &sessionV3_4, &sessionV3_5, &sessionV3_6, - &sessionV3_7); - if (deviceVersion >= CAMERA_DEVICE_API_VERSION_3_7) { + &sessionV3_7, &sessionV3_8); + if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_8) { + ASSERT_TRUE(sessionV3_8.get() != nullptr); + } else if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_7) { ASSERT_TRUE(sessionV3_7.get() != nullptr); } else if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_6) { ASSERT_TRUE(sessionV3_6.get() != nullptr); @@ -3513,14 +3542,17 @@ TEST_P(CameraHidlTest, configureStreamsAvailableOutputs) { sp session3_5; sp session3_6; sp session3_7; + sp session3_8; sp cameraDevice; sp cameraDevice3_5; sp cameraDevice3_7; + sp cameraDevice3_8; openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/, &cameraDevice /*out*/); castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7); - castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); + &session3_6, &session3_7, &session3_8); + castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, + &cameraDevice3_8); outputStreams.clear(); ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputStreams)); @@ -3616,9 +3648,11 @@ TEST_P(CameraHidlTest, configureConcurrentStreamsAvailableOutputs) { sp session3_5; sp session3_6; sp session3_7; + sp session3_8; sp cameraDevice; sp cameraDevice3_5; sp cameraDevice3_7; + sp cameraDevice3_8; ::android::hardware::camera::device::V3_7::StreamConfiguration config3_7; ::android::hardware::camera::device::V3_5::StreamConfiguration config3_5; ::android::hardware::camera::device::V3_4::StreamConfiguration config3_4; @@ -3655,8 +3689,9 @@ TEST_P(CameraHidlTest, configureConcurrentStreamsAvailableOutputs) { openEmptyDeviceSession(name, mProvider2_6, &cti.session /*out*/, &cti.staticMeta /*out*/, &cti.cameraDevice /*out*/); castSession(cti.session, deviceVersion, &cti.session3_3, &cti.session3_4, - &cti.session3_5, &cti.session3_6, &cti.session3_7); - castDevice(cti.cameraDevice, deviceVersion, &cti.cameraDevice3_5, &cti.cameraDevice3_7); + &cti.session3_5, &cti.session3_6, &cti.session3_7, &cti.session3_8); + castDevice(cti.cameraDevice, deviceVersion, &cti.cameraDevice3_5, &cti.cameraDevice3_7, + &cti.cameraDevice3_8); outputStreams.clear(); ASSERT_EQ(Status::OK, getMandatoryConcurrentStreams(cti.staticMeta, &outputStreams)); @@ -3785,14 +3820,17 @@ TEST_P(CameraHidlTest, configureStreamsInvalidOutputs) { sp session3_5; sp session3_6; sp session3_7; + sp session3_8; sp cameraDevice; sp cameraDevice3_5; sp cameraDevice3_7; + sp cameraDevice3_8; openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/, &cameraDevice /*out*/); castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7); - castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); + &session3_6, &session3_7, &session3_8); + castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, + &cameraDevice3_8); outputStreams.clear(); ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputStreams)); @@ -3998,14 +4036,17 @@ TEST_P(CameraHidlTest, configureStreamsZSLInputOutputs) { sp session3_5; sp session3_6; sp session3_7; + sp session3_8; sp cameraDevice; sp cameraDevice3_5; sp cameraDevice3_7; + sp cameraDevice3_8; openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/, &cameraDevice /*out*/); castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7); - castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); + &session3_6, &session3_7, &session3_8); + castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, + &cameraDevice3_8); Status rc = isZSLModeAvailable(staticMeta); if (Status::METHOD_NOT_SUPPORTED == rc) { @@ -4184,9 +4225,10 @@ TEST_P(CameraHidlTest, configureStreamsWithSessionParameters) { sp session3_5; sp session3_6; sp session3_7; + sp session3_8; openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMetaBuffer /*out*/); castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7); + &session3_6, &session3_7, &session3_8); if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_4) { ASSERT_NE(session3_4, nullptr); } else { @@ -4325,14 +4367,17 @@ TEST_P(CameraHidlTest, configureStreamsPreviewStillOutputs) { sp session3_5; sp session3_6; sp session3_7; + sp session3_8; sp cameraDevice; sp cameraDevice3_5; sp cameraDevice3_7; + sp cameraDevice3_8; openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/, &cameraDevice /*out*/); castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7); - castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); + &session3_6, &session3_7, &session3_8); + castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, + &cameraDevice3_8); // Check if camera support depth only if (isDepthOnly(staticMeta)) { @@ -4459,14 +4504,17 @@ TEST_P(CameraHidlTest, configureStreamsConstrainedOutputs) { sp session3_5; sp session3_6; sp session3_7; + sp session3_8; sp cameraDevice; sp cameraDevice3_5; sp cameraDevice3_7; + sp cameraDevice3_8; openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/, &cameraDevice /*out*/); castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7); - castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); + &session3_6, &session3_7, &session3_8); + castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, + &cameraDevice3_8); Status rc = isConstrainedModeAvailable(staticMeta); if (Status::METHOD_NOT_SUPPORTED == rc) { @@ -4706,14 +4754,17 @@ TEST_P(CameraHidlTest, configureStreamsVideoStillOutputs) { sp session3_5; sp session3_6; sp session3_7; + sp session3_8; sp cameraDevice; sp cameraDevice3_5; sp cameraDevice3_7; + sp cameraDevice3_8; openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/, &cameraDevice /*out*/); castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7); - castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); + &session3_6, &session3_7, &session3_8); + castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, + &cameraDevice3_8); // Check if camera support depth only if (isDepthOnly(staticMeta)) { @@ -4997,6 +5048,20 @@ void CameraHidlTest::processCaptureRequestInternal(uint64_t bufferUsage, ASSERT_EQ(Status::OK, status); ASSERT_EQ(numRequestProcessed, 1u); + if (deviceVersion >= CAMERA_DEVICE_API_VERSION_3_8) { + sp session3_3; + sp session3_4; + sp session3_5; + sp session3_6; + sp session3_7; + sp session3_8; + castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, + &session3_6, &session3_7, &session3_8); + ASSERT_TRUE(session3_8.get() != nullptr); + hidl_vec streamIds = { halStreamConfig.streams[0].id }; + session3_8->repeatingRequestEnd(request.frameNumber, streamIds); + } + { std::unique_lock l(mLock); while (!inflightReq.errorCodeValid && @@ -5640,6 +5705,188 @@ TEST_P(CameraHidlTest, processUltraHighResolutionRequest) { } } +// Generate and verify 10-bit dynamic range request +TEST_P(CameraHidlTest, process10BitDynamicRangeRequest) { + hidl_vec cameraDeviceNames = getCameraDeviceNames(mProvider); + uint64_t bufferId = 1; + uint32_t frameNumber = 1; + ::android::hardware::hidl_vec settings; + + for (const auto& name : cameraDeviceNames) { + int deviceVersion = getCameraDeviceVersion(name, mProviderType); + if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_8) { + continue; + } + std::string version, deviceId; + ASSERT_TRUE(::matchDeviceName(name, mProviderType, &version, &deviceId)); + camera_metadata_t* staticMeta; + Return ret; + sp session; + openEmptyDeviceSession(name, mProvider, &session, &staticMeta); + if (!is10BitDynamicRangeCapable(staticMeta)) { + free_camera_metadata(staticMeta); + ret = session->close(); + ASSERT_TRUE(ret.isOk()); + continue; + } + std::vector profileList; + get10BitDynamicRangeProfiles(staticMeta, &profileList); + ASSERT_FALSE(profileList.empty()); + + android::hardware::camera::common::V1_0::helper::CameraMetadata defaultSettings; + ret = session->constructDefaultRequestSettings( + RequestTemplate::STILL_CAPTURE, + [&defaultSettings](auto status, const auto& req) mutable { + ASSERT_EQ(Status::OK, status); + + const camera_metadata_t* metadata = + reinterpret_cast(req.data()); + size_t expectedSize = req.size(); + int result = validate_camera_metadata_structure(metadata, &expectedSize); + ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED)); + + size_t entryCount = get_camera_metadata_entry_count(metadata); + ASSERT_GT(entryCount, 0u); + defaultSettings = metadata; + }); + ASSERT_TRUE(ret.isOk()); + + const camera_metadata_t* settingsBuffer = defaultSettings.getAndLock(); + settings.setToExternal( + reinterpret_cast(const_cast(settingsBuffer)), + get_camera_metadata_size(settingsBuffer)); + overrideRotateAndCrop(&settings); + + free_camera_metadata(staticMeta); + ret = session->close(); + ASSERT_TRUE(ret.isOk()); + V3_6::HalStreamConfiguration halStreamConfig; + bool supportsPartialResults = false; + bool useHalBufManager = false; + uint32_t partialResultCount = 0; + V3_2::Stream previewStream; + sp session3_8; + sp cb; + for (const auto& profile : profileList) { + configureStreams3_8(name, deviceVersion, mProvider, PixelFormat::IMPLEMENTATION_DEFINED, + &session3_8, &previewStream, &halStreamConfig, + &supportsPartialResults, &partialResultCount, &useHalBufManager, + &cb, 0, /*maxResolution*/ false, profile); + ASSERT_NE(session3_8, nullptr); + + std::shared_ptr resultQueue; + auto resultQueueRet = session3_8->getCaptureResultMetadataQueue( + [&resultQueue](const auto& descriptor) { + resultQueue = std::make_shared(descriptor); + if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) { + ALOGE("%s: HAL returns empty result metadata fmq," + " not use it", + __func__); + resultQueue = nullptr; + // Don't use the queue onwards. + } + }); + ASSERT_TRUE(resultQueueRet.isOk()); + + std::vector graphicBuffers; + graphicBuffers.reserve(halStreamConfig.streams.size()); + ::android::hardware::hidl_vec outputBuffers; + outputBuffers.resize(halStreamConfig.streams.size()); + InFlightRequest inflightReq = {static_cast(halStreamConfig.streams.size()), + false, + supportsPartialResults, + partialResultCount, + std::unordered_set(), + resultQueue}; + + size_t k = 0; + for (const auto& halStream : halStreamConfig.streams) { + hidl_handle buffer_handle; + if (useHalBufManager) { + outputBuffers[k] = {halStream.v3_4.v3_3.v3_2.id, + 0, + buffer_handle, + BufferStatus::OK, + nullptr, + nullptr}; + } else { + allocateGraphicBuffer( + previewStream.width, previewStream.height, + android_convertGralloc1To0Usage(halStream.v3_4.v3_3.v3_2.producerUsage, + halStream.v3_4.v3_3.v3_2.consumerUsage), + halStream.v3_4.v3_3.v3_2.overrideFormat, &buffer_handle); + + graphicBuffers.push_back(buffer_handle); + outputBuffers[k] = {halStream.v3_4.v3_3.v3_2.id, + bufferId, + buffer_handle, + BufferStatus::OK, + nullptr, + nullptr}; + bufferId++; + } + k++; + } + + StreamBuffer emptyInputBuffer = {-1, 0, nullptr, BufferStatus::ERROR, nullptr, nullptr}; + V3_4::CaptureRequest request3_4; + request3_4.v3_2.frameNumber = frameNumber; + request3_4.v3_2.fmqSettingsSize = 0; + request3_4.v3_2.settings = settings; + request3_4.v3_2.inputBuffer = emptyInputBuffer; + request3_4.v3_2.outputBuffers = outputBuffers; + V3_7::CaptureRequest request3_7; + request3_7.v3_4 = request3_4; + request3_7.inputWidth = 0; + request3_7.inputHeight = 0; + + { + std::unique_lock l(mLock); + mInflightMap.clear(); + mInflightMap.add(frameNumber, &inflightReq); + } + + Status stat = Status::INTERNAL_ERROR; + uint32_t numRequestProcessed = 0; + hidl_vec cachesToRemove; + Return returnStatus = session3_8->processCaptureRequest_3_7( + {request3_7}, cachesToRemove, + [&stat, &numRequestProcessed](auto s, uint32_t n) { + stat = s; + numRequestProcessed = n; + }); + ASSERT_TRUE(returnStatus.isOk()); + ASSERT_EQ(Status::OK, stat); + ASSERT_EQ(numRequestProcessed, 1u); + + { + std::unique_lock l(mLock); + while (!inflightReq.errorCodeValid && + ((0 < inflightReq.numBuffersLeft) || (!inflightReq.haveResultMetadata))) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kStreamBufferTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + ASSERT_FALSE(inflightReq.errorCodeValid); + ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u); + verify10BitMetadata(mHandleImporter, inflightReq, profile); + } + if (useHalBufManager) { + hidl_vec streamIds(halStreamConfig.streams.size()); + for (size_t i = 0; i < streamIds.size(); i++) { + streamIds[i] = halStreamConfig.streams[i].v3_4.v3_3.v3_2.id; + } + session3_8->signalStreamFlush(streamIds, /*streamConfigCounter*/ 0); + cb->waitForBuffersReturned(); + } + + ret = session3_8->close(); + ASSERT_TRUE(ret.isOk()); + } + } +} + // Generate and verify a burst containing alternating sensor sensitivity values TEST_P(CameraHidlTest, processCaptureRequestBurstISO) { hidl_vec cameraDeviceNames = getCameraDeviceNames(mProvider); @@ -7448,8 +7695,9 @@ void CameraHidlTest::configureStreams3_7( sp session3_4; sp session3_5; sp session3_6; + sp session3_8; castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6, - session3_7); + session3_7, &session3_8); ASSERT_NE(nullptr, (*session3_7).get()); *useHalBufManager = false; @@ -7497,7 +7745,8 @@ void CameraHidlTest::configureStreams3_7( ASSERT_TRUE(deviceVersion >= CAMERA_DEVICE_API_VERSION_3_7); sp cameraDevice3_5 = nullptr; sp cameraDevice3_7 = nullptr; - castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); + sp cameraDevice3_8 = nullptr; + castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, &cameraDevice3_8); ASSERT_NE(cameraDevice3_7, nullptr); bool supported = false; ret = cameraDevice3_7->isStreamCombinationSupported_3_7( @@ -7530,6 +7779,153 @@ void CameraHidlTest::configureStreams3_7( ASSERT_TRUE(ret.isOk()); } +// Configure streams +void CameraHidlTest::configureStreams3_8( + const std::string& name, int32_t deviceVersion, sp provider, + PixelFormat format, sp* session3_8 /*out*/, + V3_2::Stream* previewStream /*out*/, + device::V3_6::HalStreamConfiguration* halStreamConfig /*out*/, + bool* supportsPartialResults /*out*/, uint32_t* partialResultCount /*out*/, + bool* useHalBufManager /*out*/, sp* outCb /*out*/, uint32_t streamConfigCounter, + bool maxResolution, + CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap prof) { + ASSERT_NE(nullptr, session3_8); + ASSERT_NE(nullptr, halStreamConfig); + ASSERT_NE(nullptr, previewStream); + ASSERT_NE(nullptr, supportsPartialResults); + ASSERT_NE(nullptr, partialResultCount); + ASSERT_NE(nullptr, useHalBufManager); + ASSERT_NE(nullptr, outCb); + ASSERT_TRUE(deviceVersion >= CAMERA_DEVICE_API_VERSION_3_8); + + std::vector outputStreams; + ::android::sp device3_x; + ALOGI("configureStreams: Testing camera device %s", name.c_str()); + Return ret; + ret = provider->getCameraDeviceInterface_V3_x(name, [&](auto status, const auto& device) { + ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status); + ASSERT_EQ(Status::OK, status); + ASSERT_NE(device, nullptr); + device3_x = device; + }); + ASSERT_TRUE(ret.isOk()); + + camera_metadata_t* staticMeta; + ret = device3_x->getCameraCharacteristics([&](Status s, CameraMetadata metadata) { + ASSERT_EQ(Status::OK, s); + staticMeta = + clone_camera_metadata(reinterpret_cast(metadata.data())); + ASSERT_NE(nullptr, staticMeta); + }); + ASSERT_TRUE(ret.isOk()); + + camera_metadata_ro_entry entry; + auto status = + find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_PARTIAL_RESULT_COUNT, &entry); + if ((0 == status) && (entry.count > 0)) { + *partialResultCount = entry.data.i32[0]; + *supportsPartialResults = (*partialResultCount > 1); + } + + sp cb = new DeviceCb(this, deviceVersion, staticMeta); + sp session; + ret = device3_x->open(cb, [&session](auto status, const auto& newSession) { + ALOGI("device::open returns status:%d", (int)status); + ASSERT_EQ(Status::OK, status); + ASSERT_NE(newSession, nullptr); + session = newSession; + }); + ASSERT_TRUE(ret.isOk()); + *outCb = cb; + + sp session3_3; + sp session3_4; + sp session3_5; + sp session3_6; + sp session3_7; + castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6, + &session3_7, session3_8); + ASSERT_NE(nullptr, (*session3_8).get()); + + *useHalBufManager = 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); + } + + outputStreams.clear(); + Size maxSize; + auto rc = getMaxOutputSizeForFormat(staticMeta, format, &maxSize, maxResolution); + ASSERT_EQ(Status::OK, rc); + free_camera_metadata(staticMeta); + + ::android::hardware::hidl_vec streams3_8(1); + streams3_8[0].v3_7.groupId = -1; + streams3_8[0].v3_7.sensorPixelModesUsed = { + CameraMetadataEnumAndroidSensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}; + streams3_8[0].v3_7.v3_4.bufferSize = 0; + streams3_8[0].v3_7.v3_4.v3_2.id = 0; + streams3_8[0].v3_7.v3_4.v3_2.streamType = StreamType::OUTPUT; + streams3_8[0].v3_7.v3_4.v3_2.width = static_cast(maxSize.width); + streams3_8[0].v3_7.v3_4.v3_2.height = static_cast(maxSize.height); + streams3_8[0].v3_7.v3_4.v3_2.format = static_cast(format); + streams3_8[0].v3_7.v3_4.v3_2.usage = GRALLOC1_CONSUMER_USAGE_CPU_READ; + streams3_8[0].v3_7.v3_4.v3_2.dataSpace = 0; + streams3_8[0].v3_7.v3_4.v3_2.rotation = StreamRotation::ROTATION_0; + streams3_8[0].dynamicRangeProfile = prof; + + ::android::hardware::camera::device::V3_8::StreamConfiguration config3_8; + config3_8.streams = streams3_8; + config3_8.operationMode = StreamConfigurationMode::NORMAL_MODE; + config3_8.streamConfigCounter = streamConfigCounter; + config3_8.multiResolutionInputImage = false; + RequestTemplate reqTemplate = RequestTemplate::STILL_CAPTURE; + ret = (*session3_8) + ->constructDefaultRequestSettings(reqTemplate, + [&config3_8](auto status, const auto& req) { + ASSERT_EQ(Status::OK, status); + config3_8.sessionParams = req; + }); + ASSERT_TRUE(ret.isOk()); + + sp cameraDevice3_5 = nullptr; + sp cameraDevice3_7 = nullptr; + sp cameraDevice3_8 = nullptr; + castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, &cameraDevice3_8); + ASSERT_NE(cameraDevice3_8, nullptr); + bool supported = false; + ret = cameraDevice3_8->isStreamCombinationSupported_3_8( + config3_8, [&supported](Status s, bool combStatus) { + ASSERT_TRUE((Status::OK == s) || (Status::METHOD_NOT_SUPPORTED == s)); + if (Status::OK == s) { + supported = combStatus; + } + }); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(supported, true); + + if (*session3_8 != nullptr) { + ret = (*session3_8) + ->configureStreams_3_8( + config3_8, + [&](Status s, device::V3_6::HalStreamConfiguration halConfig) { + ASSERT_EQ(Status::OK, s); + *halStreamConfig = halConfig; + if (*useHalBufManager) { + hidl_vec streams(1); + hidl_vec halStreams(1); + streams[0] = streams3_8[0].v3_7.v3_4; + halStreams[0] = halConfig.streams[0].v3_4.v3_3.v3_2; + cb->setCurrentStreamConfig(streams, halStreams); + } + }); + } + *previewStream = streams3_8[0].v3_7.v3_4.v3_2; + ASSERT_TRUE(ret.isOk()); +} + // Configure multiple preview streams using different physical ids. void CameraHidlTest::configurePreviewStreams3_4(const std::string &name, int32_t deviceVersion, sp provider, @@ -7604,8 +8000,9 @@ void CameraHidlTest::configurePreviewStreams3_4(const std::string &name, int32_t sp session3_3; sp session3_6; sp session3_7; + sp session3_8; castSession(session, deviceVersion, &session3_3, session3_4, session3_5, - &session3_6, &session3_7); + &session3_6, &session3_7, &session3_8); ASSERT_NE(nullptr, (*session3_4).get()); *useHalBufManager = false; @@ -7650,7 +8047,8 @@ void CameraHidlTest::configurePreviewStreams3_4(const std::string &name, int32_t if (allowUnsupport) { sp cameraDevice3_5; sp cameraDevice3_7; - castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); + sp cameraDevice3_8; + castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, &cameraDevice3_8); bool supported = false; ret = cameraDevice3_5->isStreamCombinationSupported(config3_4, @@ -7843,6 +8241,95 @@ bool CameraHidlTest::isUltraHighResolution(const camera_metadata_t* staticMeta) return false; } +void CameraHidlTest::get10BitDynamicRangeProfiles(const camera_metadata_t* staticMeta, + std::vector *profiles) { + ASSERT_NE(nullptr, staticMeta); + ASSERT_NE(nullptr, profiles); + camera_metadata_ro_entry entry; + std::unordered_set entries; + int rc = find_camera_metadata_ro_entry(staticMeta, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP, &entry); + ASSERT_EQ(rc, 0); + ASSERT_TRUE(entry.count > 0); + ASSERT_EQ(entry.count % 2, 0); + + for (uint32_t i = 0; i < entry.count; i += 2) { + ASSERT_NE(entry.data.i32[i], + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD); + ASSERT_EQ(entries.find(entry.data.i32[i]), entries.end()); + entries.insert(static_cast(entry.data.i32[i])); + profiles->emplace_back( + static_cast + (entry.data.i32[i])); + } + + if (!entries.empty()) { + ASSERT_NE(entries.find(ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10), + entries.end()); + } +} + +bool CameraHidlTest::is10BitDynamicRangeCapable(const camera_metadata_t* staticMeta) { + camera_metadata_ro_entry scalarEntry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + &scalarEntry); + if (rc == 0) { + for (uint32_t i = 0; i < scalarEntry.count; i++) { + if (scalarEntry.data.u8[i] == + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT) { + return true; + } + } + } + return false; +} + +void CameraHidlTest::verify10BitMetadata(HandleImporter& importer, + const InFlightRequest& request, + CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap profile) { + for (const auto& b : request.resultOutputBuffers) { + bool smpte2086Present = importer.isSmpte2086Present(b.buffer.buffer.getNativeHandle()); + bool smpte2094_10Present = importer.isSmpte2094_10Present( + b.buffer.buffer.getNativeHandle()); + bool smpte2094_40Present = importer.isSmpte2094_40Present( + b.buffer.buffer.getNativeHandle()); + + switch (static_cast(profile)) { + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10: + ASSERT_FALSE(smpte2086Present); + ASSERT_FALSE(smpte2094_10Present); + ASSERT_FALSE(smpte2094_40Present); + break; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10: + ASSERT_TRUE(smpte2086Present); + ASSERT_FALSE(smpte2094_10Present); + ASSERT_FALSE(smpte2094_40Present); + break; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS: + ASSERT_FALSE(smpte2086Present); + ASSERT_FALSE(smpte2094_10Present); + ASSERT_TRUE(smpte2094_40Present); + break; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF: + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO: + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM: + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO: + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF: + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO: + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM: + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO: + ASSERT_FALSE(smpte2086Present); + ASSERT_TRUE(smpte2094_10Present); + ASSERT_FALSE(smpte2094_40Present); + break; + default: + ALOGE("%s: Unexpected 10-bit dynamic range profile: %d", + __FUNCTION__, profile); + ADD_FAILURE(); + } + } +} + bool CameraHidlTest::isDepthOnly(const camera_metadata_t* staticMeta) { camera_metadata_ro_entry scalarEntry; camera_metadata_ro_entry depthEntry; @@ -8006,8 +8493,9 @@ void CameraHidlTest::configureSingleStream( sp session3_5; sp session3_6; sp session3_7; + sp session3_8; castSession(*session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7); + &session3_6, &session3_7, &session3_8); *useHalBufManager = false; status = find_camera_metadata_ro_entry(staticMeta, @@ -8138,12 +8626,19 @@ void CameraHidlTest::configureSingleStream( void CameraHidlTest::castDevice(const sp& device, int32_t deviceVersion, sp* device3_5 /*out*/, - sp* device3_7 /*out*/) { + sp* device3_7 /*out*/, + sp* device3_8 /*out*/) { ASSERT_NE(nullptr, device3_5); ASSERT_NE(nullptr, device3_7); + ASSERT_NE(nullptr, device3_8); switch (deviceVersion) { - case CAMERA_DEVICE_API_VERSION_3_8: + case CAMERA_DEVICE_API_VERSION_3_8: { + auto castResult = device::V3_8::ICameraDevice::castFrom(device); + ASSERT_TRUE(castResult.isOk()); + *device3_8 = castResult; + } + [[fallthrough]]; case CAMERA_DEVICE_API_VERSION_3_7: { auto castResult = device::V3_7::ICameraDevice::castFrom(device); ASSERT_TRUE(castResult.isOk()); @@ -8192,15 +8687,22 @@ void CameraHidlTest::castSession(const sp &session, int32_ sp *session3_4 /*out*/, sp *session3_5 /*out*/, sp *session3_6 /*out*/, - sp *session3_7 /*out*/) { + sp *session3_7 /*out*/, + sp *session3_8 /*out*/) { ASSERT_NE(nullptr, session3_3); ASSERT_NE(nullptr, session3_4); ASSERT_NE(nullptr, session3_5); ASSERT_NE(nullptr, session3_6); ASSERT_NE(nullptr, session3_7); + ASSERT_NE(nullptr, session3_8); switch (deviceVersion) { - case CAMERA_DEVICE_API_VERSION_3_8: + case CAMERA_DEVICE_API_VERSION_3_8: { + auto castResult = device::V3_8::ICameraDeviceSession::castFrom(session); + ASSERT_TRUE(castResult.isOk()); + *session3_8 = castResult; + } + [[fallthrough]]; case CAMERA_DEVICE_API_VERSION_3_7: { auto castResult = device::V3_7::ICameraDeviceSession::castFrom(session); ASSERT_TRUE(castResult.isOk()); @@ -9077,8 +9579,9 @@ void CameraHidlTest::verifyBuffersReturned( sp session3_5; sp session3_6; sp session3_7; + sp session3_8; castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7); + &session3_6, &session3_7, &session3_8); ASSERT_NE(nullptr, session3_5.get()); hidl_vec streamIds(1); @@ -9320,7 +9823,7 @@ void CameraHidlTest::verifyRecommendedConfigs(const CameraMetadata& chars) { size_t CONFIG_ENTRY_TYPE_OFFSET = 3; size_t CONFIG_ENTRY_BITFIELD_OFFSET = 4; uint32_t maxPublicUsecase = - ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END; + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END_3_8; uint32_t vendorUsecaseStart = ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VENDOR_START; uint32_t usecaseMask = (1 << vendorUsecaseStart) - 1; -- GitLab From 7dc51f44c9e6f68242b3fe6606e4f698aa89f47c Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Wed, 5 Jan 2022 16:09:03 -0800 Subject: [PATCH 388/825] Empty change to fix automerger errors Test: build Bug: 210712359 Change-Id: I82c1b0f4d3b6698e663a5b8b33e9d9f47f7d095d -- GitLab From 5f33dbe46c9bf323837ba8c55facbd688b2c4e3f Mon Sep 17 00:00:00 2001 From: Shinru Han Date: Tue, 14 Dec 2021 12:06:02 +0800 Subject: [PATCH 389/825] Add IAGnssRil AIDL HAL (hardware/interfaces) Bug: 205185251 Bug: 182975915 Test: atest VtsHalGnssTargetTest Change-Id: Ie5746ae25db3beff20f1311f4ddaa592d8ca934b --- .../android/hardware/gnss/IAGnssRil.aidl | 79 +++++++++ .../hardware/gnss/IAGnssRilCallback.aidl | 39 +++++ .../current/android/hardware/gnss/IGnss.aidl | 1 + .../aidl/android/hardware/gnss/IAGnssRil.aidl | 163 ++++++++++++++++++ .../hardware/gnss/IAGnssRilCallback.aidl | 38 ++++ gnss/aidl/android/hardware/gnss/IGnss.aidl | 8 + gnss/aidl/default/AGnssRil.cpp | 55 ++++++ gnss/aidl/default/AGnssRil.h | 37 ++++ gnss/aidl/default/Android.bp | 1 + gnss/aidl/default/Gnss.cpp | 9 +- gnss/aidl/default/Gnss.h | 2 + gnss/aidl/vts/AGnssRilCallbackAidl.cpp | 28 +++ gnss/aidl/vts/AGnssRilCallbackAidl.h | 28 +++ gnss/aidl/vts/Android.bp | 1 + gnss/aidl/vts/gnss_hal_test_cases.cpp | 38 ++++ 15 files changed, 526 insertions(+), 1 deletion(-) create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.aidl create mode 100644 gnss/aidl/android/hardware/gnss/IAGnssRil.aidl create mode 100644 gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl create mode 100644 gnss/aidl/default/AGnssRil.cpp create mode 100644 gnss/aidl/default/AGnssRil.h create mode 100644 gnss/aidl/vts/AGnssRilCallbackAidl.cpp create mode 100644 gnss/aidl/vts/AGnssRilCallbackAidl.h 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 new file mode 100644 index 0000000000..73df1950bf --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl @@ -0,0 +1,79 @@ +/* + * 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 -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.gnss; +@VintfStability +interface IAGnssRil { + void setCallback(in android.hardware.gnss.IAGnssRilCallback callback); + void setRefLocation(in android.hardware.gnss.IAGnssRil.AGnssRefLocation agnssReflocation); + void setSetId(in android.hardware.gnss.IAGnssRil.SetIDType type, in @utf8InCpp String setid); + void updateNetworkState(in android.hardware.gnss.IAGnssRil.NetworkAttributes attributes); + const int NETWORK_CAPABILITY_NOT_METERED = 1; + const int NETWORK_CAPABILITY_NOT_ROAMING = 2; + @Backing(type="int") @VintfStability + enum AGnssRefLocationType { + GSM_CELLID = 1, + UMTS_CELLID = 2, + LTE_CELLID = 4, + NR_CELLID = 8, + } + @Backing(type="int") @VintfStability + enum SetIDType { + NONE = 0, + IMSI = 1, + MSISDM = 2, + } + @VintfStability + parcelable AGnssRefLocationCellID { + android.hardware.gnss.IAGnssRil.AGnssRefLocationType type; + int mcc; + int mnc; + int lac; + long cid; + int tac; + int pcid; + int arfcn; + } + @VintfStability + parcelable AGnssRefLocation { + android.hardware.gnss.IAGnssRil.AGnssRefLocationType type; + android.hardware.gnss.IAGnssRil.AGnssRefLocationCellID cellID; + } + @VintfStability + parcelable NetworkAttributes { + long networkHandle; + boolean isConnected; + int capabilities; + @utf8InCpp String apn; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.aidl new file mode 100644 index 0000000000..152b10aea0 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.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 -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.gnss; +@VintfStability +interface IAGnssRilCallback { + void requestSetIdCb(in int setIdflag); + void requestRefLocCb(); +} 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 1b4c5817ce..8e967444ef 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 @@ -44,6 +44,7 @@ interface IGnss { @nullable android.hardware.gnss.IGnssGeofence getExtensionGnssGeofence(); @nullable android.hardware.gnss.IGnssNavigationMessageInterface getExtensionGnssNavigationMessage(); android.hardware.gnss.IAGnss getExtensionAGnss(); + android.hardware.gnss.IAGnssRil getExtensionAGnssRil(); android.hardware.gnss.IGnssDebug getExtensionGnssDebug(); android.hardware.gnss.visibility_control.IGnssVisibilityControl getExtensionGnssVisibilityControl(); void start(); diff --git a/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl b/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl new file mode 100644 index 0000000000..b57c9bffb4 --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.gnss; + +import android.hardware.gnss.IAGnssRilCallback; +import android.hardware.gnss.IAGnssRilCallback.SetIDType; + +/** + * Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface + * Layer interface allows the GNSS chipset to request radio interface layer + * information from Android platform. Examples of such information are reference + * location, unique subscriber ID, phone number string and network availability changes. + */ +@VintfStability +interface IAGnssRil { + /** Network capability mode bitmask for not metered. */ + const int NETWORK_CAPABILITY_NOT_METERED = 0x01; + + /** Network capability mode bitmask for not roaming. */ + const int NETWORK_CAPABILITY_NOT_ROAMING = 0x02; + + /** AGNSS reference location type */ + @VintfStability + @Backing(type="int") + enum AGnssRefLocationType { + GSM_CELLID = 1, + UMTS_CELLID = 2, + LTE_CELLID = 4, + NR_CELLID = 8, + } + + /** SET ID type*/ + @VintfStability + @Backing(type="int") + enum SetIDType { + NONE = 0, + IMSI = 1, + MSISDM = 2, + } + + /** CellID for 2G, 3G ,LTE and NR used in AGNSS. */ + @VintfStability + parcelable AGnssRefLocationCellID { + AGnssRefLocationType type; + + /** Mobile Country Code. */ + int mcc; + + /** Mobile Network Code .*/ + int mnc; + + /** + * Location Area Code in 2G, 3G and LTE. In 3G lac is discarded. In LTE, + * lac is populated with tac, to ensure that we don't break old clients that + * might rely on the old (wrong) behavior. + */ + int lac; + + /** + * Cell id in 2G. Utran Cell id in 3G. Cell Global Id EUTRA in LTE. + * Cell Global Id NR in 5G. + */ + long cid; + + /** Tracking Area Code in LTE and NR. */ + int tac; + + /** Physical Cell id in LTE and NR (not used in 2G and 3G) */ + int pcid; + + /** Absolute Radio Frequency Channel Number in NR. */ + int arfcn; + } + + /** Represents ref locations */ + @VintfStability + parcelable AGnssRefLocation { + AGnssRefLocationType type; + + AGnssRefLocationCellID cellID; + } + + /** Represents network connection status and capabilities. */ + @VintfStability + parcelable NetworkAttributes { + /** Network handle of the network for use with the NDK API. */ + long networkHandle; + + /** + * True indicates that network connectivity exists and it is possible to + * establish connections and pass data. If false, only the networkHandle field + * is populated to indicate that this network has just disconnected. + */ + boolean isConnected; + + /** + * A bitfield of flags indicating the capabilities of this network. The bit masks are + * defined in NETWORK_CAPABILITY_*. + */ + int capabilities; + + /** + * Telephony preferred Access Point Name to use for carrier data connection when + * connected to a cellular network. Empty string, otherwise. + */ + @utf8InCpp String apn; + } + + /** + * Opens the AGNSS interface and provides the callback routines + * to the implementation of this interface. + * + * @param callback Interface for AGnssRil callbacks. + * + */ + void setCallback(in IAGnssRilCallback callback); + + /** + * Sets the reference location. + * + * @param agnssReflocation AGNSS reference location CellID. + * + */ + void setRefLocation(in AGnssRefLocation agnssReflocation); + + /** + * Sets the SET ID. + * + * @param type Must be populated with either IMSI or MSISDN or NONE. + * @param setid If type is IMSI then setid is populated with + * a string representing the unique Subscriber ID, for example, the IMSI for + * a GMS phone. If type is MSISDN, then setid must contain + * the phone number string for line 1. For example, the MSISDN for a GSM phone. + * If the type is NONE, then the string must be empty. + * + */ + void setSetId(in SetIDType type, in @utf8InCpp String setid); + + /** + * Notifies GNSS of network status changes. + * + * The framework calls this method to update the GNSS HAL implementation of network + * state changes. + * + * @param attributes Updated network attributes. + * + */ + void updateNetworkState(in NetworkAttributes attributes); +} diff --git a/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl b/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl new file mode 100644 index 0000000000..6fb093e165 --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.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. + */ + +package android.hardware.gnss; + +/** + * Callback for IAGnssRil interface. Used to request SET ID and + * Reference Location. + */ +@VintfStability +interface IAGnssRilCallback { + /** + * The Hal uses this API to request a SET ID. + * + * @param setIdflag A bitfield of IAGnssRil.SetIDType that is required by + * the HAL. The framework will inject an empty SET ID if the flag is NONE. + * + */ + void requestSetIdCb(in int setIdflag); + + /** + * The Hal uses this API to request a reference location. + */ + void requestRefLocCb(); +} diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl index 4ddc6a6193..b6bd38a118 100644 --- a/gnss/aidl/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl @@ -18,6 +18,7 @@ package android.hardware.gnss; import android.hardware.gnss.GnssLocation; import android.hardware.gnss.IAGnss; +import android.hardware.gnss.IAGnssRil; import android.hardware.gnss.IGnssBatching; import android.hardware.gnss.IGnssCallback; import android.hardware.gnss.IGnssConfiguration; @@ -185,6 +186,13 @@ interface IGnss { */ IAGnss getExtensionAGnss(); + /** + * This method returns the IAGnssRil interface. + * + * @return The IAGnssRil interface. + */ + IAGnssRil getExtensionAGnssRil(); + /** * This method returns the IGnssDebug interface. * diff --git a/gnss/aidl/default/AGnssRil.cpp b/gnss/aidl/default/AGnssRil.cpp new file mode 100644 index 0000000000..e6009bdcd9 --- /dev/null +++ b/gnss/aidl/default/AGnssRil.cpp @@ -0,0 +1,55 @@ +/* + * 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. + */ + +#define LOG_TAG "AGnssRilAidl" + +#include "AGnssRil.h" +#include + +namespace aidl::android::hardware::gnss { + +std::shared_ptr AGnssRil::sCallback = nullptr; + +ndk::ScopedAStatus AGnssRil::setCallback(const std::shared_ptr& callback) { + ALOGD("AGnssRil::setCallback"); + std::unique_lock lock(mMutex); + sCallback = callback; + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus AGnssRil::setRefLocation(const AGnssRefLocation& agnssReflocation) { + const AGnssRefLocationCellID& cellInfo = agnssReflocation.cellID; + ALOGD("AGnssRil::setRefLocation: type: %s, mcc: %d, mnc: %d, lac: %d, cid: %ld, tac: %d, pcid: " + "%d, arfcn: %d", + toString(agnssReflocation.type).c_str(), cellInfo.mcc, cellInfo.mnc, cellInfo.lac, + cellInfo.cid, cellInfo.tac, cellInfo.pcid, cellInfo.arfcn); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus AGnssRil::setSetId(SetIDType type, const std::string& setid) { + ALOGD("AGnssRil::setSetId: type:%s, setid: %s", toString(type).c_str(), setid.c_str()); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus AGnssRil::updateNetworkState(const NetworkAttributes& attributes) { + ALOGD("AGnssRil::updateNetworkState: networkHandle: %ld, isConnected: %d, capabilities: %d, " + "apn: %s", + attributes.networkHandle, attributes.isConnected, attributes.capabilities, + attributes.apn.c_str()); + return ndk::ScopedAStatus::ok(); +} + +} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/AGnssRil.h b/gnss/aidl/default/AGnssRil.h new file mode 100644 index 0000000000..7e429ee8f4 --- /dev/null +++ b/gnss/aidl/default/AGnssRil.h @@ -0,0 +1,37 @@ +/* + * 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 + +namespace aidl::android::hardware::gnss { + +struct AGnssRil : public BnAGnssRil { + public: + ndk::ScopedAStatus setCallback(const std::shared_ptr& callback) override; + ndk::ScopedAStatus setRefLocation(const AGnssRefLocation& agnssReflocation) override; + ndk::ScopedAStatus setSetId(SetIDType type, const std::string& setid) override; + ndk::ScopedAStatus updateNetworkState(const NetworkAttributes& attributes) override; + + private: + // Synchronization lock for sCallback + mutable std::mutex mMutex; + // Guarded by mMutex + static std::shared_ptr sCallback; +}; + +} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index 29c26d16ec..5797e1c645 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -56,6 +56,7 @@ cc_binary { "android.hardware.gnss-V2-ndk", ], srcs: [ + "AGnssRil.cpp", "AGnss.cpp", "Gnss.cpp", "GnssBatching.cpp", diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index e296351d95..dba54a017d 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -20,6 +20,7 @@ #include #include #include "AGnss.h" +#include "AGnssRil.h" #include "GnssBatching.h" #include "GnssConfiguration.h" #include "GnssDebug.h" @@ -154,7 +155,7 @@ ScopedAStatus Gnss::close() { return ScopedAStatus::ok(); } -ndk::ScopedAStatus Gnss::getExtensionAGnss(std::shared_ptr* iAGnss) { +ScopedAStatus Gnss::getExtensionAGnss(std::shared_ptr* iAGnss) { ALOGD("Gnss::getExtensionAGnss"); *iAGnss = SharedRefBase::make(); return ndk::ScopedAStatus::ok(); @@ -166,6 +167,12 @@ ScopedAStatus Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs, int unce return ScopedAStatus::ok(); } +ScopedAStatus Gnss::getExtensionAGnssRil(std::shared_ptr* iAGnssRil) { + ALOGD("Gnss::getExtensionAGnssRil"); + *iAGnssRil = SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + ScopedAStatus Gnss::injectLocation(const GnssLocation& location) { ALOGD("injectLocation. lat:%lf, lng:%lf, acc:%f", location.latitudeDegrees, location.longitudeDegrees, location.horizontalAccuracyMeters); diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index 384c8629a2..731eaa3f36 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -17,6 +17,7 @@ #pragma once #include +#include #include #include #include @@ -65,6 +66,7 @@ class Gnss : public BnGnss { ndk::ScopedAStatus getExtensionGnssNavigationMessage( std::shared_ptr* iGnssNavigationMessage) override; ndk::ScopedAStatus getExtensionAGnss(std::shared_ptr* iAGnss) override; + ndk::ScopedAStatus getExtensionAGnssRil(std::shared_ptr* iAGnssRil) override; ndk::ScopedAStatus getExtensionGnssDebug(std::shared_ptr* iGnssDebug) override; ndk::ScopedAStatus getExtensionGnssVisibilityControl( std::shared_ptr* diff --git a/gnss/aidl/vts/AGnssRilCallbackAidl.cpp b/gnss/aidl/vts/AGnssRilCallbackAidl.cpp new file mode 100644 index 0000000000..4e4166d61d --- /dev/null +++ b/gnss/aidl/vts/AGnssRilCallbackAidl.cpp @@ -0,0 +1,28 @@ +/* + * 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. + */ + +#include "AGnssRilCallbackAidl.h" +#include + +android::binder::Status AGnssRilCallbackAidl::requestSetIdCb(int setIdflag) { + ALOGI("requestSetIdCb setIdflag %d", setIdflag); + return android::binder::Status::ok(); +} + +android::binder::Status AGnssRilCallbackAidl::requestRefLocCb() { + ALOGI("requestRefLocCb"); + return android::binder::Status::ok(); +} diff --git a/gnss/aidl/vts/AGnssRilCallbackAidl.h b/gnss/aidl/vts/AGnssRilCallbackAidl.h new file mode 100644 index 0000000000..74b34eee94 --- /dev/null +++ b/gnss/aidl/vts/AGnssRilCallbackAidl.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +/** Implementation for IAGnssRilCallback. */ +class AGnssRilCallbackAidl : public android::hardware::gnss::BnAGnssRilCallback { + public: + AGnssRilCallbackAidl(){}; + ~AGnssRilCallbackAidl(){}; + android::binder::Status requestSetIdCb(int setIdflag) override; + android::binder::Status requestRefLocCb() override; +}; diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp index d532fad357..c39803f970 100644 --- a/gnss/aidl/vts/Android.bp +++ b/gnss/aidl/vts/Android.bp @@ -31,6 +31,7 @@ cc_test { "gnss_hal_test.cpp", "gnss_hal_test_cases.cpp", "AGnssCallbackAidl.cpp", + "AGnssRilCallbackAidl.cpp", "GnssBatchingCallback.cpp", "GnssCallbackAidl.cpp", "GnssGeofenceCallback.cpp", diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 9acef8bed0..6811b7b847 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -27,6 +27,7 @@ #include #include #include "AGnssCallbackAidl.h" +#include "AGnssRilCallbackAidl.h" #include "GnssBatchingCallback.h" #include "GnssGeofenceCallback.h" #include "GnssMeasurementCallbackAidl.h" @@ -43,6 +44,7 @@ using android::hardware::gnss::GnssData; using android::hardware::gnss::GnssMeasurement; using android::hardware::gnss::GnssPowerStats; using android::hardware::gnss::IAGnss; +using android::hardware::gnss::IAGnssRil; using android::hardware::gnss::IGnss; using android::hardware::gnss::IGnssBatching; using android::hardware::gnss::IGnssBatchingCallback; @@ -857,6 +859,42 @@ TEST_P(GnssHalTest, TestAGnssExtension) { ASSERT_TRUE(status.isOk()); } +/* + * TestAGnssRilExtension: + * 1. Gets the IAGnssRil extension. + * 2. Sets AGnssRilCallback. + * 3. Sets reference location. + */ +TEST_P(GnssHalTest, TestAGnssRilExtension) { + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + return; + } + sp iAGnssRil; + auto status = aidl_gnss_hal_->getExtensionAGnssRil(&iAGnssRil); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(iAGnssRil != nullptr); + + auto agnssRilCallback = sp::make(); + status = iAGnssRil->setCallback(agnssRilCallback); + ASSERT_TRUE(status.isOk()); + + // Set RefLocation + IAGnssRil::AGnssRefLocationCellID agnssReflocationCellId; + agnssReflocationCellId.type = IAGnssRil::AGnssRefLocationType::LTE_CELLID; + agnssReflocationCellId.mcc = 466; + agnssReflocationCellId.mnc = 97; + agnssReflocationCellId.lac = 46697; + agnssReflocationCellId.cid = 59168142; + agnssReflocationCellId.pcid = 420; + agnssReflocationCellId.tac = 11460; + IAGnssRil::AGnssRefLocation agnssReflocation; + agnssReflocation.type = IAGnssRil::AGnssRefLocationType::LTE_CELLID; + agnssReflocation.cellID = agnssReflocationCellId; + + status = iAGnssRil->setRefLocation(agnssReflocation); + ASSERT_TRUE(status.isOk()); +} + /* * GnssDebugValuesSanityTest: * Ensures that GnssDebug values make sense. -- GitLab From 7ae4255438c5b187186416e2a5c84842eeed1192 Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Thu, 6 Jan 2022 19:39:47 +0000 Subject: [PATCH 390/825] Adjust Context Hub AIDL based on feedback - Add additional documentation of ContextHubMessage.aidl. - Remove redundant TYPE_ specifier in HostEndpointInfo.aidl. Bug: 213474931 Test: Compile Change-Id: Ice1ac925a8b977abee8a9fa376ad40b33f315a3f --- .../android/hardware/contexthub/HostEndpointInfo.aidl | 4 ++-- .../android/hardware/contexthub/ContextHubMessage.aidl | 8 ++++++-- .../android/hardware/contexthub/HostEndpointInfo.aidl | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl index e7dcbc706d..84e8531eb9 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/HostEndpointInfo.aidl @@ -40,7 +40,7 @@ parcelable HostEndpointInfo { @nullable String attributionTag; @Backing(type="int") @VintfStability enum Type { - TYPE_FRAMEWORK = 1, - TYPE_APP = 2, + FRAMEWORK = 1, + APP = 2, } } diff --git a/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl b/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl index 867da2f9c0..95d478e6c2 100644 --- a/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl +++ b/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl @@ -32,10 +32,14 @@ parcelable ContextHubMessage { */ char hostEndPoint; - /** The type of this message */ + /** + * The type of this message payload, defined by the communication endpoints (i.e. + * either the nanoapp or the host endpoint). This value can be used to distinguish + * the handling of messageBody (e.g. for decoding). + */ int messageType; - /** The payload containing the message */ + /** The payload containing the message. */ byte[] messageBody; /** diff --git a/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl b/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl index 40a231d804..a9d6657097 100644 --- a/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl +++ b/contexthub/aidl/android/hardware/contexthub/HostEndpointInfo.aidl @@ -37,12 +37,12 @@ parcelable HostEndpointInfo { @Backing(type="int") enum Type { /** - This endpoint is from the Android framework, where packageName and attributionTag may be - empty. + * This endpoint is from the Android framework, where packageName and attributionTag may be + * empty. */ - TYPE_FRAMEWORK = 1, + FRAMEWORK = 1, /** This endpoint is an Android app. */ - TYPE_APP = 2, + APP = 2, } } -- GitLab From 60564e18c8e069c3d3da1d786956a4b927a06e85 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Thu, 9 Dec 2021 18:48:20 -0800 Subject: [PATCH 391/825] Adjustments to composer apis for HDR: 1. Add setDisplayBrightness as a display command, so that it may be set atomically with composition updates for that display. 2. Adjust tests to set display brightness using display commands. The setDisplayBrightness api on IComposer should be deprecated. It will be removed in a follow-up patch. Bug: 210151839 Test: builds Change-Id: I2e4348e1d7f799d1744390afbb9bd206054eb933 --- .../graphics/composer3/DisplayBrightness.aidl | 38 +++++++++ .../graphics/composer3/DisplayCommand.aidl | 1 + .../graphics/composer3/DisplayBrightness.aidl | 26 ++++++ .../graphics/composer3/DisplayCommand.aidl | 24 ++++++ .../VtsHalGraphicsComposer3_TargetTest.cpp | 80 ++++++++++++------- .../graphics/composer3/ComposerClientWriter.h | 6 ++ 6 files changed, 144 insertions(+), 31 deletions(-) create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayBrightness.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/DisplayBrightness.aidl diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayBrightness.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayBrightness.aidl new file mode 100644 index 0000000000..be623df763 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayBrightness.aidl @@ -0,0 +1,38 @@ +/** + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable DisplayBrightness { + float brightness; +} 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 3382633554..662240e96b 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 @@ -37,6 +37,7 @@ parcelable DisplayCommand { long display; android.hardware.graphics.composer3.LayerCommand[] layers; @nullable float[] colorTransformMatrix; + @nullable android.hardware.graphics.composer3.DisplayBrightness brightness; @nullable android.hardware.graphics.composer3.ClientTarget clientTarget; @nullable android.hardware.graphics.composer3.Buffer virtualDisplayOutputBuffer; @nullable android.hardware.graphics.composer3.ClockMonotonicTimestamp expectedPresentTime; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayBrightness.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayBrightness.aidl new file mode 100644 index 0000000000..f66b235098 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayBrightness.aidl @@ -0,0 +1,26 @@ +/** + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +parcelable DisplayBrightness { + /** + * A number between 0.0f (minimum brightness) and 1.0f (maximum brightness), a negative value to + * turn the backlight off. + */ + float brightness; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl index 18461aded7..f1ce1a7dad 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl @@ -19,6 +19,7 @@ package android.hardware.graphics.composer3; import android.hardware.graphics.composer3.Buffer; import android.hardware.graphics.composer3.ClientTarget; import android.hardware.graphics.composer3.ClockMonotonicTimestamp; +import android.hardware.graphics.composer3.DisplayBrightness; import android.hardware.graphics.composer3.LayerCommand; @VintfStability @@ -68,6 +69,29 @@ parcelable DisplayCommand { */ @nullable float[] colorTransformMatrix; + /** + * Sets the desired brightness of the display. + * + * Ideally, the brightness of the display will take effect within this frame so that it can be + * aligned with color transforms. Some display architectures may take multiple frames to apply + * the display brightness, for example when internally switching the display between multiple + * power modes to achieve higher luminance. In those cases, the underlying display panel's real + * brightness may not be applied atomically; however, layer dimming when mixing HDR and SDR + * content must be synchronized. + * + * As an illustrative example: suppose two layers have white + * points of 200 nits and 1000 nits respectively, the old display luminance is 200 nits, and the + * new display luminance is 1000 nits. If the new display luminance takes two frames to apply, + * then: In the first frame, there must not be any relative dimming of layers (treat both layers + * as 200 nits as the maximum luminance of the display is 200 nits). In the second frame, there + * dimming should be applied to ensure that the first layer does not become perceptually + * brighter during the transition. + * + * The display luminance must be updated by this command even if there is not pending validate + * or present command. + */ + @nullable DisplayBrightness brightness; + /** * Sets the buffer handle which will receive the output of client * composition. Layers marked as Composition.CLIENT must be composited diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 4dbe191f0c..a591aaa67d 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -568,37 +568,6 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSample) { } } -/* - * Test that if brightness operations are supported, setDisplayBrightness works as expected. - */ -TEST_P(GraphicsComposerAidlTest, setDisplayBrightness) { - std::vector capabilities; - auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); - ASSERT_TRUE(error.isOk()); - bool brightnessSupport = std::find(capabilities.begin(), capabilities.end(), - DisplayCapability::BRIGHTNESS) != capabilities.end(); - if (!brightnessSupport) { - EXPECT_EQ(mComposerClient->setDisplayBrightness(mPrimaryDisplay, 0.5f) - .getServiceSpecificError(), - IComposerClient::EX_UNSUPPORTED); - GTEST_SUCCEED() << "Brightness operations are not supported"; - return; - } - - EXPECT_TRUE(mComposerClient->setDisplayBrightness(mPrimaryDisplay, 0.0f).isOk()); - EXPECT_TRUE(mComposerClient->setDisplayBrightness(mPrimaryDisplay, 0.5f).isOk()); - EXPECT_TRUE(mComposerClient->setDisplayBrightness(mPrimaryDisplay, 1.0f).isOk()); - EXPECT_TRUE(mComposerClient->setDisplayBrightness(mPrimaryDisplay, -1.0f).isOk()); - - error = mComposerClient->setDisplayBrightness(mPrimaryDisplay, +2.0f); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(error.getServiceSpecificError(), IComposerClient::EX_BAD_PARAMETER); - - error = mComposerClient->setDisplayBrightness(mPrimaryDisplay, -2.0f); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(error.getServiceSpecificError(), IComposerClient::EX_BAD_PARAMETER); -} - TEST_P(GraphicsComposerAidlTest, getDisplayConnectionType) { DisplayConnectionType type; EXPECT_FALSE(mComposerClient->getDisplayConnectionType(mInvalidDisplayId, &type).isOk()); @@ -1494,6 +1463,55 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerColorTransform) { } } +TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { + std::vector capabilities; + auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); + ASSERT_TRUE(error.isOk()); + bool brightnessSupport = std::find(capabilities.begin(), capabilities.end(), + DisplayCapability::BRIGHTNESS) != capabilities.end(); + if (!brightnessSupport) { + mWriter.setDisplayBrightness(mPrimaryDisplay, 0.5f); + execute(); + const auto errors = mReader.takeErrors(); + EXPECT_EQ(1, errors.size()); + EXPECT_EQ(EX_UNSUPPORTED_OPERATION, errors[0].errorCode); + GTEST_SUCCEED() << "SetDisplayBrightness is not supported"; + return; + } + + mWriter.setDisplayBrightness(mPrimaryDisplay, 0.0f); + execute(); + EXPECT_TRUE(mReader.takeErrors().empty()); + + mWriter.setDisplayBrightness(mPrimaryDisplay, 0.5f); + execute(); + EXPECT_TRUE(mReader.takeErrors().empty()); + + mWriter.setDisplayBrightness(mPrimaryDisplay, 1.0f); + execute(); + EXPECT_TRUE(mReader.takeErrors().empty()); + + mWriter.setDisplayBrightness(mPrimaryDisplay, -1.0f); + execute(); + EXPECT_TRUE(mReader.takeErrors().empty()); + + mWriter.setDisplayBrightness(mPrimaryDisplay, 2.0f); + execute(); + { + const auto errors = mReader.takeErrors(); + EXPECT_EQ(1, errors.size()); + EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode); + } + + mWriter.setDisplayBrightness(mPrimaryDisplay, -2.0f); + execute(); + { + const auto errors = mReader.takeErrors(); + EXPECT_EQ(1, errors.size()); + EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode); + } +} + TEST_P(GraphicsComposerAidlCommandTest, SET_CLIENT_TARGET) { EXPECT_TRUE( mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kBufferSlotCount).isOk()); 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 16d63e57ca..b202b34c64 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -29,9 +29,11 @@ #include #include #include +#include #include #include #include +#include #include @@ -79,6 +81,10 @@ class ComposerClientWriter { getDisplayCommand(display).colorTransformMatrix.emplace(std::move(matVec)); } + void setDisplayBrightness(int64_t display, float brightness) { + getDisplayCommand(display).brightness.emplace(DisplayBrightness{.brightness = brightness}); + } + void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target, int acquireFence, Dataspace dataspace, const std::vector& damage) { ClientTarget clientTargetCommand; -- GitLab From 406cb76efedd24d345660451362f804fd2d819d5 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Tue, 28 Dec 2021 12:14:22 -0800 Subject: [PATCH 392/825] Add GnssAgc to GnssMeasurementsEvent (hardware/interfaces) Bug: 206670536 Test: atest VtsHalGnssTargetTest Change-Id: I024c503f05c17d769e0833090ca555dc2a6f3ece --- .../android/hardware/gnss/GnssData.aidl | 7 +++ gnss/aidl/android/hardware/gnss/GnssData.aidl | 54 ++++++++++++++++++- gnss/aidl/vts/gnss_hal_test_cases.cpp | 43 +++++++++++++++ gnss/common/utils/default/Utils.cpp | 20 ++++++- 4 files changed, 121 insertions(+), 3 deletions(-) diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl index ebb5d0bdff..aa514da38c 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl @@ -37,4 +37,11 @@ parcelable GnssData { android.hardware.gnss.GnssMeasurement[] measurements; android.hardware.gnss.GnssClock clock; android.hardware.gnss.ElapsedRealtime elapsedRealtime; + @nullable android.hardware.gnss.GnssData.GnssAgc[] gnssAgcs; + @VintfStability + parcelable GnssAgc { + double agcLevelDb; + android.hardware.gnss.GnssConstellationType constellation = android.hardware.gnss.GnssConstellationType.UNKNOWN; + long carrierFrequencyHz; + } } diff --git a/gnss/aidl/android/hardware/gnss/GnssData.aidl b/gnss/aidl/android/hardware/gnss/GnssData.aidl index ed30c989f8..204eb65e6b 100644 --- a/gnss/aidl/android/hardware/gnss/GnssData.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssData.aidl @@ -18,6 +18,7 @@ package android.hardware.gnss; import android.hardware.gnss.ElapsedRealtime; import android.hardware.gnss.GnssClock; +import android.hardware.gnss.GnssConstellationType; import android.hardware.gnss.GnssMeasurement; /** @@ -41,4 +42,55 @@ parcelable GnssData { * clock. */ ElapsedRealtime elapsedRealtime; -} \ No newline at end of file + + /** + * Represents a reading of GNSS AGC value of a constellation type and a frequency band. + */ + @VintfStability + parcelable GnssAgc { + /** + * Automatic gain control (AGC) level. AGC acts as a variable gain amplifier adjusting the + * power of the incoming signal. The AGC level may be used to indicate potential + * interference. Higher gain (and/or lower input power) must be output as a positive number. + * Hence in cases of strong jamming, in the band of this signal, this value must go more + * negative. This value must be consistent given the same level of the incoming signal + * power. + * + * Note: Different hardware designs (e.g. antenna, pre-amplification, or other RF HW + * components) may also affect the typical output of this value on any given hardware design + * in an open sky test - the important aspect of this output is that changes in this value + * are indicative of changes on input signal power in the frequency band for this + * measurement. + */ + double agcLevelDb; + + /** + * Constellation type of the SV that transmits the signal. + */ + GnssConstellationType constellation = GnssConstellationType.UNKNOWN; + + /** + * Carrier frequency of the signal tracked, for example it can be the + * GPS central frequency for L1 = 1575.45 MHz, or L2 = 1227.60 MHz, L5 = + * 1176.45 MHz, varying GLO channels, etc. If the field is not set, it + * is the primary common use central frequency, e.g. L1 = 1575.45 MHz + * for GPS. + * + * For an L1, L5 receiver tracking a satellite on L1 and L5 at the same + * time, two raw measurement structs must be reported for this same + * satellite, in one of the measurement structs, all the values related + * to L1 must be filled, and in the other all of the values related to + * L5 must be filled. + */ + long carrierFrequencyHz; + } + + /** + * The array of GNSS AGC values. + * + * This field must be reported when the GNSS measurement engine is running, even when the + * GnssMeasurement or GnssClock fields are not reported yet. E.g., when a GNSS signal is too + * weak to be acquired, the AGC value must still be reported. + */ + @nullable GnssAgc[] gnssAgcs; +} diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 9acef8bed0..eec50b0a13 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -966,3 +966,46 @@ TEST_P(GnssHalTest, TestGnssMeasurementSetCallbackWithOptions) { status = iGnssMeasurement->close(); ASSERT_TRUE(status.isOk()); } + +/* + * TestGnssAgcInGnssMeasurement: + * 1. Gets the GnssMeasurementExtension and verifies that it returns a non-null extension. + * 2. Sets a GnssMeasurementCallback, waits for a measurement. + */ +TEST_P(GnssHalTest, TestGnssAgcInGnssMeasurement) { + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + return; + } + const int kFirstGnssMeasurementTimeoutSeconds = 10; + const int kNumMeasurementEvents = 15; + + sp iGnssMeasurement; + auto status = aidl_gnss_hal_->getExtensionGnssMeasurement(&iGnssMeasurement); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(iGnssMeasurement != nullptr); + + auto callback = sp::make(); + status = iGnssMeasurement->setCallback(callback, /* enableFullTracking= */ false, + /* enableCorrVecOutputs */ false); + ASSERT_TRUE(status.isOk()); + + for (int i = 0; i < kNumMeasurementEvents; i++) { + GnssData lastMeasurement; + ASSERT_TRUE(callback->gnss_data_cbq_.retrieve(lastMeasurement, + kFirstGnssMeasurementTimeoutSeconds)); + EXPECT_EQ(callback->gnss_data_cbq_.calledCount(), i + 1); + ASSERT_TRUE(lastMeasurement.measurements.size() > 0); + + // Validity check GnssData fields + CheckGnssMeasurementClockFields(lastMeasurement); + + ASSERT_TRUE(lastMeasurement.gnssAgcs.has_value()); + for (const auto& gnssAgc : lastMeasurement.gnssAgcs.value()) { + ASSERT_TRUE(gnssAgc.has_value()); + ASSERT_TRUE(gnssAgc.value().carrierFrequencyHz >= 0); + } + } + + status = iGnssMeasurement->close(); + ASSERT_TRUE(status.isOk()); +} diff --git a/gnss/common/utils/default/Utils.cpp b/gnss/common/utils/default/Utils.cpp index 563c6d5d21..1ff84eb9a5 100644 --- a/gnss/common/utils/default/Utils.cpp +++ b/gnss/common/utils/default/Utils.cpp @@ -38,6 +38,7 @@ using GnssSvInfo = aidl::android::hardware::gnss::IGnssCallback::GnssSvInfo; using GnssSvFlags = aidl::android::hardware::gnss::IGnssCallback::GnssSvFlags; using GnssSvFlagsV1_0 = V1_0::IGnssCallback::GnssSvFlags; +using GnssAgc = aidl::android::hardware::gnss::GnssData::GnssAgc; using GnssMeasurementFlagsV1_0 = V1_0::IGnssMeasurementCallback::GnssMeasurementFlags; using GnssMeasurementFlagsV2_1 = V2_1::IGnssMeasurementCallback::GnssMeasurementFlags; using GnssMeasurementStateV2_0 = V2_0::IGnssMeasurementCallback::GnssMeasurementState; @@ -231,8 +232,23 @@ GnssData Utils::getMockMeasurement(const bool enableCorrVecOutputs) { measurement.flags |= GnssMeasurement::HAS_CORRELATION_VECTOR; } - GnssData gnssData = { - .measurements = {measurement}, .clock = clock, .elapsedRealtime = timestamp}; + GnssAgc gnssAgc1 = { + .agcLevelDb = 3.5, + .constellation = GnssConstellationType::GLONASS, + .carrierFrequencyHz = (int64_t)kGloG1FreqHz, + }; + + GnssAgc gnssAgc2 = { + .agcLevelDb = -5.1, + .constellation = GnssConstellationType::GPS, + .carrierFrequencyHz = (int64_t)kGpsL1FreqHz, + }; + + GnssData gnssData = {.measurements = {measurement}, + .clock = clock, + .elapsedRealtime = timestamp, + .gnssAgcs = std::make_optional(std::vector( + {std::make_optional(gnssAgc1), std::make_optional(gnssAgc2)}))}; return gnssData; } -- GitLab From 8ee98880efef3fec2418b53683771425782aa885 Mon Sep 17 00:00:00 2001 From: Robert Shih Date: Tue, 4 Jan 2022 23:37:35 -0800 Subject: [PATCH 393/825] Add Stable AIDL interface for DRM service Test: m -j128 android.hardware.drm-update-api Bug: 200055138 Bug: 170964303 Change-Id: I091d839cd94075bf36670a9494aa99f7b6c97365 --- .../compatibility_matrix.current.xml | 12 + drm/aidl/Android.bp | 32 + .../android/hardware/drm/BufferType.aidl | 39 + .../android/hardware/drm/DecryptResult.aidl | 39 + .../hardware/drm/DestinationBuffer.aidl | 40 + .../android/hardware/drm/DrmMetric.aidl | 40 + .../android/hardware/drm/DrmMetricGroup.aidl | 38 + .../hardware/drm/DrmMetricNamedValue.aidl | 39 + .../android/hardware/drm/DrmMetricValue.aidl | 40 + .../android/hardware/drm/EventType.aidl | 42 + .../android/hardware/drm/HdcpLevel.aidl | 45 ++ .../android/hardware/drm/HdcpLevels.aidl | 39 + .../android/hardware/drm/ICryptoFactory.aidl | 39 + .../android/hardware/drm/ICryptoPlugin.aidl | 43 + .../android/hardware/drm/IDrmFactory.aidl | 41 + .../android/hardware/drm/IDrmPlugin.aidl | 77 ++ .../hardware/drm/IDrmPluginListener.aidl | 41 + .../android/hardware/drm/KeyRequest.aidl | 40 + .../android/hardware/drm/KeyRequestType.aidl | 43 + .../android/hardware/drm/KeySetId.aidl | 38 + .../android/hardware/drm/KeyStatus.aidl | 39 + .../android/hardware/drm/KeyStatusType.aidl | 43 + .../current/android/hardware/drm/KeyType.aidl | 40 + .../android/hardware/drm/KeyValue.aidl | 39 + .../android/hardware/drm/LogMessage.aidl | 40 + .../android/hardware/drm/LogPriority.aidl | 45 ++ .../current/android/hardware/drm/Mode.aidl | 41 + .../hardware/drm/NumberOfSessions.aidl | 39 + .../hardware/drm/OfflineLicenseState.aidl | 40 + .../android/hardware/drm/OpaqueData.aidl | 38 + .../current/android/hardware/drm/Pattern.aidl | 39 + .../drm/ProvideProvisionResponseResult.aidl | 39 + .../hardware/drm/ProvisionRequest.aidl | 39 + .../android/hardware/drm/SecureStop.aidl | 38 + .../android/hardware/drm/SecureStopId.aidl | 38 + .../android/hardware/drm/SecurityLevel.aidl | 44 + .../android/hardware/drm/SharedBuffer.aidl | 40 + .../current/android/hardware/drm/Status.aidl | 77 ++ .../android/hardware/drm/SubSample.aidl | 39 + .../current/android/hardware/drm/Uuid.aidl | 38 + drm/aidl/android/hardware/drm/BufferType.aidl | 24 + .../android/hardware/drm/DecryptResult.aidl | 33 + .../hardware/drm/DestinationBuffer.aidl | 45 ++ drm/aidl/android/hardware/drm/DrmMetric.aidl | 46 ++ .../android/hardware/drm/DrmMetricGroup.aidl | 61 ++ .../hardware/drm/DrmMetricNamedValue.aidl | 28 + .../android/hardware/drm/DrmMetricValue.aidl | 27 + drm/aidl/android/hardware/drm/EventType.aidl | 51 ++ drm/aidl/android/hardware/drm/HdcpLevel.aidl | 59 ++ drm/aidl/android/hardware/drm/HdcpLevels.aidl | 28 + .../android/hardware/drm/ICryptoFactory.aidl | 51 ++ .../android/hardware/drm/ICryptoPlugin.aidl | 138 ++++ .../android/hardware/drm/IDrmFactory.aidl | 76 ++ drm/aidl/android/hardware/drm/IDrmPlugin.aidl | 755 ++++++++++++++++++ .../hardware/drm/IDrmPluginListener.aidl | 76 ++ drm/aidl/android/hardware/drm/KeyRequest.aidl | 46 ++ .../android/hardware/drm/KeyRequestType.aidl | 52 ++ drm/aidl/android/hardware/drm/KeySetId.aidl | 22 + drm/aidl/android/hardware/drm/KeyStatus.aidl | 29 + .../android/hardware/drm/KeyStatusType.aidl | 51 ++ drm/aidl/android/hardware/drm/KeyType.aidl | 38 + drm/aidl/android/hardware/drm/KeyValue.aidl | 23 + drm/aidl/android/hardware/drm/LogMessage.aidl | 38 + .../android/hardware/drm/LogPriority.aidl | 30 + drm/aidl/android/hardware/drm/Mode.aidl | 29 + .../hardware/drm/NumberOfSessions.aidl | 26 + .../hardware/drm/OfflineLicenseState.aidl | 36 + drm/aidl/android/hardware/drm/OpaqueData.aidl | 22 + drm/aidl/android/hardware/drm/Pattern.aidl | 39 + .../drm/ProvideProvisionResponseResult.aidl | 34 + .../hardware/drm/ProvisionRequest.aidl | 31 + drm/aidl/android/hardware/drm/SecureStop.aidl | 25 + .../android/hardware/drm/SecureStopId.aidl | 22 + .../android/hardware/drm/SecurityLevel.aidl | 55 ++ .../android/hardware/drm/SharedBuffer.aidl | 39 + drm/aidl/android/hardware/drm/Status.aidl | 221 +++++ drm/aidl/android/hardware/drm/SubSample.aidl | 27 + drm/aidl/android/hardware/drm/Uuid.aidl | 22 + 78 files changed, 4097 insertions(+) create mode 100644 drm/aidl/Android.bp create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/BufferType.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DecryptResult.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DestinationBuffer.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetric.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetricGroup.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetricNamedValue.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetricValue.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/EventType.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/HdcpLevel.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/HdcpLevels.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoFactory.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoPlugin.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmFactory.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPlugin.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPluginListener.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyRequest.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyRequestType.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeySetId.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatus.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatusType.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyType.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyValue.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/LogMessage.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/LogPriority.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Mode.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/NumberOfSessions.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/OfflineLicenseState.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/OpaqueData.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Pattern.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ProvideProvisionResponseResult.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ProvisionRequest.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SecureStop.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SecureStopId.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SecurityLevel.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SharedBuffer.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Status.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SubSample.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Uuid.aidl create mode 100644 drm/aidl/android/hardware/drm/BufferType.aidl create mode 100644 drm/aidl/android/hardware/drm/DecryptResult.aidl create mode 100644 drm/aidl/android/hardware/drm/DestinationBuffer.aidl create mode 100644 drm/aidl/android/hardware/drm/DrmMetric.aidl create mode 100644 drm/aidl/android/hardware/drm/DrmMetricGroup.aidl create mode 100644 drm/aidl/android/hardware/drm/DrmMetricNamedValue.aidl create mode 100644 drm/aidl/android/hardware/drm/DrmMetricValue.aidl create mode 100644 drm/aidl/android/hardware/drm/EventType.aidl create mode 100644 drm/aidl/android/hardware/drm/HdcpLevel.aidl create mode 100644 drm/aidl/android/hardware/drm/HdcpLevels.aidl create mode 100644 drm/aidl/android/hardware/drm/ICryptoFactory.aidl create mode 100644 drm/aidl/android/hardware/drm/ICryptoPlugin.aidl create mode 100644 drm/aidl/android/hardware/drm/IDrmFactory.aidl create mode 100644 drm/aidl/android/hardware/drm/IDrmPlugin.aidl create mode 100644 drm/aidl/android/hardware/drm/IDrmPluginListener.aidl create mode 100644 drm/aidl/android/hardware/drm/KeyRequest.aidl create mode 100644 drm/aidl/android/hardware/drm/KeyRequestType.aidl create mode 100644 drm/aidl/android/hardware/drm/KeySetId.aidl create mode 100644 drm/aidl/android/hardware/drm/KeyStatus.aidl create mode 100644 drm/aidl/android/hardware/drm/KeyStatusType.aidl create mode 100644 drm/aidl/android/hardware/drm/KeyType.aidl create mode 100644 drm/aidl/android/hardware/drm/KeyValue.aidl create mode 100644 drm/aidl/android/hardware/drm/LogMessage.aidl create mode 100644 drm/aidl/android/hardware/drm/LogPriority.aidl create mode 100644 drm/aidl/android/hardware/drm/Mode.aidl create mode 100644 drm/aidl/android/hardware/drm/NumberOfSessions.aidl create mode 100644 drm/aidl/android/hardware/drm/OfflineLicenseState.aidl create mode 100644 drm/aidl/android/hardware/drm/OpaqueData.aidl create mode 100644 drm/aidl/android/hardware/drm/Pattern.aidl create mode 100644 drm/aidl/android/hardware/drm/ProvideProvisionResponseResult.aidl create mode 100644 drm/aidl/android/hardware/drm/ProvisionRequest.aidl create mode 100644 drm/aidl/android/hardware/drm/SecureStop.aidl create mode 100644 drm/aidl/android/hardware/drm/SecureStopId.aidl create mode 100644 drm/aidl/android/hardware/drm/SecurityLevel.aidl create mode 100644 drm/aidl/android/hardware/drm/SharedBuffer.aidl create mode 100644 drm/aidl/android/hardware/drm/Status.aidl create mode 100644 drm/aidl/android/hardware/drm/SubSample.aidl create mode 100644 drm/aidl/android/hardware/drm/Uuid.aidl diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index c480c13554..cb9bd3db45 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -209,6 +209,18 @@ default
+ + android.hardware.drm + 1 + + ICryptoFactory + .* + + + IDrmFactory + .* + + android.hardware.drm 1.3-4 diff --git a/drm/aidl/Android.bp b/drm/aidl/Android.bp new file mode 100644 index 0000000000..d8500ec3b2 --- /dev/null +++ b/drm/aidl/Android.bp @@ -0,0 +1,32 @@ +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.drm", + vendor_available: true, + srcs: ["android/hardware/drm/*.aidl"], + stability: "vintf", + imports: [ + "android.hardware.common-V2", + ], + backend: { + cpp: { + enabled: false, + }, + java: { + sdk_version: "module_current", + }, + ndk: { + vndk: { + enabled: true, + }, + min_sdk_version: "current", + }, + }, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/BufferType.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/BufferType.aidl new file mode 100644 index 0000000000..b6ec34d897 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/BufferType.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 -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.drm; +@Backing(type="int") @VintfStability +enum BufferType { + SHARED_MEMORY = 0, + NATIVE_HANDLE = 1, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DecryptResult.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DecryptResult.aidl new file mode 100644 index 0000000000..d2b48d2b98 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DecryptResult.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 -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.drm; +@VintfStability +parcelable DecryptResult { + int bytesWritten; + String detailedError; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DestinationBuffer.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DestinationBuffer.aidl new file mode 100644 index 0000000000..4f2d133cae --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DestinationBuffer.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 -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.drm; +@VintfStability +parcelable DestinationBuffer { + android.hardware.drm.BufferType type; + android.hardware.drm.SharedBuffer nonsecureMemory; + android.hardware.common.NativeHandle secureMemory; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetric.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetric.aidl new file mode 100644 index 0000000000..c78dff0b16 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetric.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 -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.drm; +@VintfStability +parcelable DrmMetric { + String name; + List attributes; + List values; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetricGroup.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetricGroup.aidl new file mode 100644 index 0000000000..4128eaa54d --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetricGroup.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 -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.drm; +@VintfStability +parcelable DrmMetricGroup { + List metrics; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetricNamedValue.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetricNamedValue.aidl new file mode 100644 index 0000000000..76ec35c0cf --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetricNamedValue.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 -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.drm; +@VintfStability +parcelable DrmMetricNamedValue { + String name; + android.hardware.drm.DrmMetricValue value; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetricValue.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetricValue.aidl new file mode 100644 index 0000000000..806491357c --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DrmMetricValue.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 -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.drm; +@VintfStability +union DrmMetricValue { + long int64Value; + double doubleValue; + String stringValue; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/EventType.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/EventType.aidl new file mode 100644 index 0000000000..80ebb285ae --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/EventType.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 -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.drm; +@Backing(type="int") @VintfStability +enum EventType { + PROVISION_REQUIRED = 0, + KEY_NEEDED = 1, + KEY_EXPIRED = 2, + VENDOR_DEFINED = 3, + SESSION_RECLAIMED = 4, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/HdcpLevel.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/HdcpLevel.aidl new file mode 100644 index 0000000000..5704fb0726 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/HdcpLevel.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 -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.drm; +@Backing(type="int") @VintfStability +enum HdcpLevel { + HDCP_UNKNOWN = 0, + HDCP_NONE = 1, + HDCP_V1 = 2, + HDCP_V2 = 3, + HDCP_V2_1 = 4, + HDCP_V2_2 = 5, + HDCP_NO_OUTPUT = 6, + HDCP_V2_3 = 7, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/HdcpLevels.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/HdcpLevels.aidl new file mode 100644 index 0000000000..a6f86ace67 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/HdcpLevels.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 -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.drm; +@VintfStability +parcelable HdcpLevels { + android.hardware.drm.HdcpLevel connectedLevel; + android.hardware.drm.HdcpLevel maxLevel; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoFactory.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoFactory.aidl new file mode 100644 index 0000000000..0d4296ec1f --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoFactory.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 -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.drm; +@VintfStability +interface ICryptoFactory { + @nullable android.hardware.drm.ICryptoPlugin createPlugin(in android.hardware.drm.Uuid uuid, in byte[] initData); + boolean isCryptoSchemeSupported(in android.hardware.drm.Uuid uuid); +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoPlugin.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoPlugin.aidl new file mode 100644 index 0000000000..2224795198 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoPlugin.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 -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.drm; +@VintfStability +interface ICryptoPlugin { + android.hardware.drm.DecryptResult decrypt(in boolean secure, in byte[] keyId, in byte[] iv, in android.hardware.drm.Mode mode, in android.hardware.drm.Pattern pattern, in android.hardware.drm.SubSample[] subSamples, in android.hardware.drm.SharedBuffer source, in long offset, in android.hardware.drm.DestinationBuffer destination); + List getLogMessages(); + void notifyResolution(in int width, in int height); + boolean requiresSecureDecoderComponent(in String mime); + void setMediaDrmSession(in byte[] sessionId); + void setSharedBufferBase(in android.hardware.common.Ashmem base, in int bufferId); +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmFactory.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmFactory.aidl new file mode 100644 index 0000000000..af48737892 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmFactory.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 -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.drm; +@VintfStability +interface IDrmFactory { + @nullable android.hardware.drm.IDrmPlugin createPlugin(in android.hardware.drm.Uuid uuid, in String appPackageName); + List getSupportedCryptoSchemes(); + boolean isContentTypeSupported(in String mimeType); + boolean isCryptoSchemeSupported(in android.hardware.drm.Uuid uuid, in String mimeType, in android.hardware.drm.SecurityLevel securityLevel); +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPlugin.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPlugin.aidl new file mode 100644 index 0000000000..5f839d763c --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPlugin.aidl @@ -0,0 +1,77 @@ +/* + * 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 -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.drm; +@VintfStability +interface IDrmPlugin { + void closeSession(in byte[] sessionId); + byte[] decrypt(in byte[] sessionId, in byte[] keyId, in byte[] input, in byte[] iv); + byte[] encrypt(in byte[] sessionId, in byte[] keyId, in byte[] input, in byte[] iv); + android.hardware.drm.HdcpLevels getHdcpLevels(); + android.hardware.drm.KeyRequest getKeyRequest(in byte[] scope, in byte[] initData, in String mimeType, in android.hardware.drm.KeyType keyType, in android.hardware.drm.KeyValue[] optionalParameters); + List getLogMessages(); + List getMetrics(); + android.hardware.drm.NumberOfSessions getNumberOfSessions(); + List getOfflineLicenseKeySetIds(); + android.hardware.drm.OfflineLicenseState getOfflineLicenseState(in android.hardware.drm.KeySetId keySetId); + byte[] getPropertyByteArray(in String propertyName); + String getPropertyString(in String propertyName); + android.hardware.drm.ProvisionRequest getProvisionRequest(in String certificateType, in String certificateAuthority); + android.hardware.drm.SecureStop getSecureStop(in android.hardware.drm.SecureStopId secureStopId); + List getSecureStopIds(); + List getSecureStops(); + android.hardware.drm.SecurityLevel getSecurityLevel(in byte[] sessionId); + byte[] openSession(in android.hardware.drm.SecurityLevel securityLevel); + android.hardware.drm.KeySetId provideKeyResponse(in byte[] scope, in byte[] response); + android.hardware.drm.ProvideProvisionResponseResult provideProvisionResponse(in byte[] response); + List queryKeyStatus(in byte[] sessionId); + void releaseAllSecureStops(); + void releaseSecureStop(in android.hardware.drm.SecureStopId secureStopId); + void releaseSecureStops(in android.hardware.drm.OpaqueData ssRelease); + void removeAllSecureStops(); + void removeKeys(in byte[] sessionId); + void removeOfflineLicense(in android.hardware.drm.KeySetId keySetId); + void removeSecureStop(in android.hardware.drm.SecureStopId secureStopId); + boolean requiresSecureDecoder(in String mime, in android.hardware.drm.SecurityLevel level); + boolean requiresSecureDecoderDefault(in String mime); + void restoreKeys(in byte[] sessionId, in android.hardware.drm.KeySetId keySetId); + void setCipherAlgorithm(in byte[] sessionId, in String algorithm); + void setListener(in android.hardware.drm.IDrmPluginListener listener); + void setMacAlgorithm(in byte[] sessionId, in String algorithm); + void setPlaybackId(in byte[] sessionId, in String playbackId); + void setPropertyByteArray(in String propertyName, in byte[] value); + void setPropertyString(in String propertyName, in String value); + byte[] sign(in byte[] sessionId, in byte[] keyId, in byte[] message); + byte[] signRSA(in byte[] sessionId, in String algorithm, in byte[] message, in byte[] wrappedkey); + boolean verify(in byte[] sessionId, in byte[] keyId, in byte[] message, in byte[] signature); +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPluginListener.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPluginListener.aidl new file mode 100644 index 0000000000..0a4b4b70bc --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPluginListener.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 -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.drm; +@VintfStability +interface IDrmPluginListener { + oneway void onEvent(in android.hardware.drm.EventType eventType, in byte[] sessionId, in byte[] data); + oneway void onExpirationUpdate(in byte[] sessionId, in long expiryTimeInMS); + oneway void onKeysChange(in byte[] sessionId, in android.hardware.drm.KeyStatus[] keyStatusList, in boolean hasNewUsableKey); + oneway void onSessionLostState(in byte[] sessionId); +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyRequest.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyRequest.aidl new file mode 100644 index 0000000000..267f532755 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyRequest.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 -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.drm; +@VintfStability +parcelable KeyRequest { + byte[] request; + android.hardware.drm.KeyRequestType requestType; + String defaultUrl; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyRequestType.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyRequestType.aidl new file mode 100644 index 0000000000..34b9615c55 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyRequestType.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 -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.drm; +@Backing(type="int") @VintfStability +enum KeyRequestType { + INITIAL = 0, + RENEWAL = 1, + RELEASE = 2, + UNKNOWN = 3, + NONE = 4, + UPDATE = 5, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeySetId.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeySetId.aidl new file mode 100644 index 0000000000..58dfe1a412 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeySetId.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 -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.drm; +@VintfStability +parcelable KeySetId { + byte[] keySetId; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatus.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatus.aidl new file mode 100644 index 0000000000..53ab70f0fb --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatus.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 -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.drm; +@VintfStability +parcelable KeyStatus { + byte[] keyId; + android.hardware.drm.KeyStatusType type; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatusType.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatusType.aidl new file mode 100644 index 0000000000..e88d3886a2 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatusType.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 -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.drm; +@Backing(type="int") @VintfStability +enum KeyStatusType { + USABLE = 0, + EXPIRED = 1, + OUTPUTNOTALLOWED = 2, + STATUSPENDING = 3, + INTERNALERROR = 4, + USABLEINFUTURE = 5, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyType.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyType.aidl new file mode 100644 index 0000000000..7a9d633578 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyType.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 -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.drm; +@Backing(type="int") @VintfStability +enum KeyType { + OFFLINE = 0, + STREAMING = 1, + RELEASE = 2, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyValue.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyValue.aidl new file mode 100644 index 0000000000..35d7b77bc9 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyValue.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 -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.drm; +@VintfStability +parcelable KeyValue { + String key; + String value; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/LogMessage.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/LogMessage.aidl new file mode 100644 index 0000000000..93f76e1c41 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/LogMessage.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 -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.drm; +@VintfStability +parcelable LogMessage { + long timeMs; + android.hardware.drm.LogPriority priority; + String message; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/LogPriority.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/LogPriority.aidl new file mode 100644 index 0000000000..83362c359f --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/LogPriority.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 -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.drm; +@Backing(type="int") @VintfStability +enum LogPriority { + UNKNOWN = 0, + DEFAULT = 1, + VERBOSE = 2, + DEBUG = 3, + INFO = 4, + WARN = 5, + ERROR = 6, + FATAL = 7, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Mode.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Mode.aidl new file mode 100644 index 0000000000..7379774093 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Mode.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 -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.drm; +@Backing(type="int") @VintfStability +enum Mode { + UNENCRYPTED = 0, + AES_CTR = 1, + AES_CBC_CTS = 2, + AES_CBC = 3, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/NumberOfSessions.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/NumberOfSessions.aidl new file mode 100644 index 0000000000..a421125fc3 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/NumberOfSessions.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 -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.drm; +@VintfStability +parcelable NumberOfSessions { + int currentSessions; + int maxSessions; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/OfflineLicenseState.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/OfflineLicenseState.aidl new file mode 100644 index 0000000000..629564d706 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/OfflineLicenseState.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 -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.drm; +@Backing(type="int") @VintfStability +enum OfflineLicenseState { + UNKNOWN = 0, + USABLE = 1, + INACTIVE = 2, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/OpaqueData.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/OpaqueData.aidl new file mode 100644 index 0000000000..3085889faf --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/OpaqueData.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 -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.drm; +@VintfStability +parcelable OpaqueData { + byte[] opaqueData; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Pattern.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Pattern.aidl new file mode 100644 index 0000000000..b01562e67e --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Pattern.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 -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.drm; +@VintfStability +parcelable Pattern { + int encryptBlocks; + int skipBlocks; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ProvideProvisionResponseResult.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ProvideProvisionResponseResult.aidl new file mode 100644 index 0000000000..827de59093 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ProvideProvisionResponseResult.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 -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.drm; +@VintfStability +parcelable ProvideProvisionResponseResult { + byte[] certificate; + byte[] wrappedKey; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ProvisionRequest.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ProvisionRequest.aidl new file mode 100644 index 0000000000..84c56621f2 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ProvisionRequest.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 -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.drm; +@VintfStability +parcelable ProvisionRequest { + byte[] request; + String defaultUrl; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SecureStop.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SecureStop.aidl new file mode 100644 index 0000000000..81d2dfe75c --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SecureStop.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 -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.drm; +@VintfStability +parcelable SecureStop { + byte[] opaqueData; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SecureStopId.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SecureStopId.aidl new file mode 100644 index 0000000000..2b904c8629 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SecureStopId.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 -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.drm; +@VintfStability +parcelable SecureStopId { + byte[] secureStopId; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SecurityLevel.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SecurityLevel.aidl new file mode 100644 index 0000000000..65b2b9d2ae --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SecurityLevel.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 -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.drm; +@Backing(type="int") @VintfStability +enum SecurityLevel { + UNKNOWN = 0, + SW_SECURE_CRYPTO = 1, + SW_SECURE_DECODE = 2, + HW_SECURE_CRYPTO = 3, + HW_SECURE_DECODE = 4, + HW_SECURE_ALL = 5, + DEFAULT = 6, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SharedBuffer.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SharedBuffer.aidl new file mode 100644 index 0000000000..973ef0db3d --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SharedBuffer.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 -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.drm; +@VintfStability +parcelable SharedBuffer { + int bufferId; + long offset; + long size; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Status.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Status.aidl new file mode 100644 index 0000000000..c64068958f --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Status.aidl @@ -0,0 +1,77 @@ +/* + * 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 -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.drm; +@Backing(type="int") @VintfStability +enum Status { + OK = 0, + ERROR_DRM_NO_LICENSE = 1, + ERROR_DRM_LICENSE_EXPIRED = 2, + ERROR_DRM_SESSION_NOT_OPENED = 3, + ERROR_DRM_CANNOT_HANDLE = 4, + ERROR_DRM_INVALID_STATE = 5, + BAD_VALUE = 6, + ERROR_DRM_NOT_PROVISIONED = 7, + ERROR_DRM_RESOURCE_BUSY = 8, + ERROR_DRM_INSUFFICIENT_OUTPUT_PROTECTION = 9, + ERROR_DRM_DEVICE_REVOKED = 10, + ERROR_DRM_DECRYPT = 11, + ERROR_DRM_UNKNOWN = 12, + ERROR_DRM_INSUFFICIENT_SECURITY = 13, + ERROR_DRM_FRAME_TOO_LARGE = 14, + ERROR_DRM_SESSION_LOST_STATE = 15, + ERROR_DRM_RESOURCE_CONTENTION = 16, + CANNOT_DECRYPT_ZERO_SUBSAMPLES = 17, + CRYPTO_LIBRARY_ERROR = 18, + GENERAL_OEM_ERROR = 19, + GENERAL_PLUGIN_ERROR = 20, + INIT_DATA_INVALID = 21, + KEY_NOT_LOADED = 22, + LICENSE_PARSE_ERROR = 23, + LICENSE_POLICY_ERROR = 24, + LICENSE_RELEASE_ERROR = 25, + LICENSE_REQUEST_REJECTED = 26, + LICENSE_RESTORE_ERROR = 27, + LICENSE_STATE_ERROR = 28, + MALFORMED_CERTIFICATE = 29, + MEDIA_FRAMEWORK_ERROR = 30, + MISSING_CERTIFICATE = 31, + PROVISIONING_CERTIFICATE_ERROR = 32, + PROVISIONING_CONFIGURATION_ERROR = 33, + PROVISIONING_PARSE_ERROR = 34, + PROVISIONING_REQUEST_REJECTED = 35, + RETRYABLE_PROVISIONING_ERROR = 36, + SECURE_STOP_RELEASE_ERROR = 37, + STORAGE_READ_FAILURE = 38, + STORAGE_WRITE_FAILURE = 39, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SubSample.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SubSample.aidl new file mode 100644 index 0000000000..57d815eeb2 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SubSample.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 -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.drm; +@VintfStability +parcelable SubSample { + int numBytesOfClearData; + int numBytesOfEncryptedData; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Uuid.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Uuid.aidl new file mode 100644 index 0000000000..ec2eb164c9 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Uuid.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 -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.drm; +@VintfStability +parcelable Uuid { + byte[] uuid; +} diff --git a/drm/aidl/android/hardware/drm/BufferType.aidl b/drm/aidl/android/hardware/drm/BufferType.aidl new file mode 100644 index 0000000000..089c950656 --- /dev/null +++ b/drm/aidl/android/hardware/drm/BufferType.aidl @@ -0,0 +1,24 @@ +/* + * 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. + */ + +package android.hardware.drm; + +@VintfStability +@Backing(type="int") +enum BufferType { + SHARED_MEMORY = 0, + NATIVE_HANDLE = 1, +} diff --git a/drm/aidl/android/hardware/drm/DecryptResult.aidl b/drm/aidl/android/hardware/drm/DecryptResult.aidl new file mode 100644 index 0000000000..17e939bc95 --- /dev/null +++ b/drm/aidl/android/hardware/drm/DecryptResult.aidl @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package android.hardware.drm; + +/** + * The DecryptResult parcelable contains the result of + * ICryptoPlugin decrypt method. + */ +@VintfStability +parcelable DecryptResult { + /** The number of decrypted bytes. */ + int bytesWritten; + + /** + * Vendor-specific error message if provided by the vendor's + * crypto HAL. + */ + String detailedError; +} diff --git a/drm/aidl/android/hardware/drm/DestinationBuffer.aidl b/drm/aidl/android/hardware/drm/DestinationBuffer.aidl new file mode 100644 index 0000000000..0f1e3f5398 --- /dev/null +++ b/drm/aidl/android/hardware/drm/DestinationBuffer.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. + */ + +package android.hardware.drm; + +import android.hardware.common.NativeHandle; +import android.hardware.drm.BufferType; +import android.hardware.drm.SharedBuffer; + +/** + * A decrypt destination buffer can be either normal user-space shared + * memory for the non-secure decrypt case, or it can be a secure buffer + * which is referenced by a native-handle. The native handle is allocated + * by the vendor's buffer allocator. + */ +@VintfStability +parcelable DestinationBuffer { + /** + * The type of the buffer + */ + BufferType type; + /** + * If type == SHARED_MEMORY, the decrypted data must be written + * to user-space non-secure shared memory. + */ + SharedBuffer nonsecureMemory; + /** + * If type == NATIVE_HANDLE, the decrypted data must be written + * to secure memory referenced by the vendor's buffer allocator. + */ + NativeHandle secureMemory; +} diff --git a/drm/aidl/android/hardware/drm/DrmMetric.aidl b/drm/aidl/android/hardware/drm/DrmMetric.aidl new file mode 100644 index 0000000000..6199af6d4d --- /dev/null +++ b/drm/aidl/android/hardware/drm/DrmMetric.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ + +package android.hardware.drm; + +import android.hardware.drm.DrmMetricNamedValue; + +/** + * The metric being captured. + * + * A metric must have a name and at least one value. A metric may have 0 or + * more attributes. The fields of a Metric are opaque to the framework. + */ +@VintfStability +parcelable DrmMetric { + String name; + + /** + * Detail(s) about the metric being captured. + * + * The fields of an Attribute are opaque to the framework. + */ + List attributes; + + /** + * Value(s) of the metric. + * + * A metric may have multiple values. The component name may be left empty + * if there is only supposed to be one value for the given metric. The + * fields of the Value are opaque to the framework. + */ + List values; +} diff --git a/drm/aidl/android/hardware/drm/DrmMetricGroup.aidl b/drm/aidl/android/hardware/drm/DrmMetricGroup.aidl new file mode 100644 index 0000000000..3b1f3c9b0e --- /dev/null +++ b/drm/aidl/android/hardware/drm/DrmMetricGroup.aidl @@ -0,0 +1,61 @@ +/* + * 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. + */ + +package android.hardware.drm; + +import android.hardware.drm.DrmMetric; + +/** + * This message contains plugin-specific metrics made available to the client. + * The message is used for making vendor-specific metrics available to an + * application. The framework is not consuming any of the information. + * + * Metrics are grouped in instances of DrmMetricGroup. Each group contains + * multiple instances of Metric. + * + * Example: + * + * Capture the timing information of a buffer copy event, "buf_copy", broken + * out by the "size" of the buffer. + * + * DrmMetricGroup { + * metrics[0] { + * name: "buf_copy" + * attributes[0] { + * name: "size" + * type: INT64_TYPE + * int64Value: 1024 + * } + * values[0] { + * componentName: "operation_count" + * type: INT64_TYPE + * int64Value: 75 + * } + * values[1] { + * component_name: "average_time_seconds" + * type: DOUBLE_TYPE + * doubleValue: 0.00000042 + * } + * } + * } + */ +@VintfStability +parcelable DrmMetricGroup { + /** + * The list of metrics to be captured. + */ + List metrics; +} diff --git a/drm/aidl/android/hardware/drm/DrmMetricNamedValue.aidl b/drm/aidl/android/hardware/drm/DrmMetricNamedValue.aidl new file mode 100644 index 0000000000..5bb17a6036 --- /dev/null +++ b/drm/aidl/android/hardware/drm/DrmMetricNamedValue.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.drm; + +import android.hardware.drm.DrmMetricValue; + +/** + * A name-value pair used in drm metrics. + */ +@VintfStability +parcelable DrmMetricNamedValue { + String name; + DrmMetricValue value; +} diff --git a/drm/aidl/android/hardware/drm/DrmMetricValue.aidl b/drm/aidl/android/hardware/drm/DrmMetricValue.aidl new file mode 100644 index 0000000000..0203f3f801 --- /dev/null +++ b/drm/aidl/android/hardware/drm/DrmMetricValue.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.drm; + +/** + * The value of a metric or a metric's attribute. + */ +@VintfStability +union DrmMetricValue { + long int64Value; + double doubleValue; + String stringValue; +} diff --git a/drm/aidl/android/hardware/drm/EventType.aidl b/drm/aidl/android/hardware/drm/EventType.aidl new file mode 100644 index 0000000000..7a06eb0505 --- /dev/null +++ b/drm/aidl/android/hardware/drm/EventType.aidl @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package android.hardware.drm; + +/** + * EventType enumerates the events that can be delivered by sendEvent + */ +@VintfStability +@Backing(type="int") +enum EventType { + /** + * This event type indicates that the app needs to request a certificate + * from the provisioning server. The request message data is obtained using + * getProvisionRequest(). + */ + PROVISION_REQUIRED, + /** + * This event type indicates that the app needs to request keys from a + * license server. The request message data is obtained using getKeyRequest. + */ + KEY_NEEDED, + /** + * This event type indicates that the licensed usage duration for keys in a + * session has expired. The keys are no longer valid. + */ + KEY_EXPIRED, + /** + * This event may indicate some specific vendor-defined condition, see your + * DRM provider documentation for details. + */ + VENDOR_DEFINED, + /** + * This event indicates that a session opened by the app has been reclaimed + * by the resource manager. + */ + SESSION_RECLAIMED, +} diff --git a/drm/aidl/android/hardware/drm/HdcpLevel.aidl b/drm/aidl/android/hardware/drm/HdcpLevel.aidl new file mode 100644 index 0000000000..3497b78431 --- /dev/null +++ b/drm/aidl/android/hardware/drm/HdcpLevel.aidl @@ -0,0 +1,59 @@ +/* + * 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. + */ + +package android.hardware.drm; + +/** + * HDCP specifications are defined by Digital Content Protection LLC (DCP). + * "HDCP Specification Rev. 2.3 Interface Independent Adaptation" + * "HDCP 2.3 on HDMI Specification" + */ +@VintfStability +@Backing(type="int") +enum HdcpLevel { + /** + * Unable to determine the HDCP level + */ + HDCP_UNKNOWN, + /** + * No HDCP, output is unprotected + */ + HDCP_NONE, + /** + * HDCP version 1.0 + */ + HDCP_V1, + /** + * HDCP version 2.0 Type 1. + */ + HDCP_V2, + /** + * HDCP version 2.1 Type 1. + */ + HDCP_V2_1, + /** + * HDCP version 2.2 Type 1. + */ + HDCP_V2_2, + /** + * No digital output, implicitly secure + */ + HDCP_NO_OUTPUT, + /** + * HDCP version 2.3 Type 1. + */ + HDCP_V2_3, +} diff --git a/drm/aidl/android/hardware/drm/HdcpLevels.aidl b/drm/aidl/android/hardware/drm/HdcpLevels.aidl new file mode 100644 index 0000000000..cd4642ba42 --- /dev/null +++ b/drm/aidl/android/hardware/drm/HdcpLevels.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.drm; + +import android.hardware.drm.HdcpLevel; + +@VintfStability +parcelable HdcpLevels { + /** The lowest HDCP level for any connected displays. */ + HdcpLevel connectedLevel; + + /** The highest HDCP level that can be supported by the device. */ + HdcpLevel maxLevel; +} diff --git a/drm/aidl/android/hardware/drm/ICryptoFactory.aidl b/drm/aidl/android/hardware/drm/ICryptoFactory.aidl new file mode 100644 index 0000000000..202bd3dbfe --- /dev/null +++ b/drm/aidl/android/hardware/drm/ICryptoFactory.aidl @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package android.hardware.drm; + +import android.hardware.drm.Uuid; + +/** + * ICryptoFactory is the main entry point for interacting with a vendor's + * crypto HAL to create crypto plugins. + + * Crypto plugins create crypto sessions which are used by a codec to decrypt + * protected video content. + */ +@VintfStability +interface ICryptoFactory { + /** + * Create a crypto plugin for the specified uuid and scheme-specific + * initialization data. + * + * @param uuid uniquely identifies the drm scheme. See + * http://dashif.org/identifiers/protection for uuid assignments + * + * @param initData scheme-specific init data. + * + * @return A crypto plugin instance if successful, or null if not created. + */ + @nullable android.hardware.drm.ICryptoPlugin createPlugin( + in Uuid uuid, in byte[] initData); + + /** + * Determine if a crypto scheme is supported by this HAL. + * + * @param uuid identifies the crypto scheme in question + * @return must be true only if the scheme is supported + */ + boolean isCryptoSchemeSupported(in Uuid uuid); +} diff --git a/drm/aidl/android/hardware/drm/ICryptoPlugin.aidl b/drm/aidl/android/hardware/drm/ICryptoPlugin.aidl new file mode 100644 index 0000000000..80a63dfdae --- /dev/null +++ b/drm/aidl/android/hardware/drm/ICryptoPlugin.aidl @@ -0,0 +1,138 @@ +/* + * 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. + */ + +package android.hardware.drm; + +import android.hardware.common.Ashmem; +import android.hardware.drm.DecryptResult; +import android.hardware.drm.DestinationBuffer; +import android.hardware.drm.LogMessage; +import android.hardware.drm.Mode; +import android.hardware.drm.Pattern; +import android.hardware.drm.SharedBuffer; +import android.hardware.drm.Status; +import android.hardware.drm.SubSample; + +/** + * ICryptoPlugin is the HAL for vendor-provided crypto plugins. + * + * It allows crypto sessions to be opened and operated on, to + * load crypto keys for a codec to decrypt protected video content. + */ +@VintfStability +interface ICryptoPlugin { + /** + * Decrypt an array of subsamples from the source memory buffer to the + * destination memory buffer. + * + * @param secure a flag to indicate if a secure decoder is being used. + * This enables the plugin to configure buffer modes to work + * consistently with a secure decoder. + * @param the keyId for the key that is used to do the decryption. The + * keyId refers to a key in the associated MediaDrm instance. + * @param iv the initialization vector to use + * @param mode the crypto mode to use + * @param pattern the crypto pattern to use + * @param subSamples a vector of subsamples indicating the number + * of clear and encrypted bytes to process. This allows the decrypt + * call to operate on a range of subsamples in a single call + * @param source the input buffer for the decryption + * @param offset the offset of the first byte of encrypted data from + * the base of the source buffer + * @param destination the output buffer for the decryption + * + * @return DecryptResult parcelable + * Implicit error codes: + * + ERROR_DRM_CANNOT_HANDLE in other failure cases + * + ERROR_DRM_DECRYPT if the decrypt operation fails + * + ERROR_DRM_FRAME_TOO_LARGE if the frame being decrypted into + * the secure output buffer exceeds the size of the buffer + * + ERROR_DRM_INSUFFICIENT_OUTPUT_PROTECTION if required output + * protections are not active + * + ERROR_DRM_INSUFFICIENT_SECURITY if the security level of the + * device is not sufficient to meet the requirements in + * the license policy + * + ERROR_DRM_INVALID_STATE if the device is in a state where it + * is not able to perform decryption + * + ERROR_DRM_LICENSE_EXPIRED if the license keys have expired + * + ERROR_DRM_NO_LICENSE if no license keys have been loaded + * + ERROR_DRM_RESOURCE_BUSY if the resources required to perform + * the decryption are not available + * + ERROR_DRM_SESSION_NOT_OPENED if the decrypt session is not + * opened + */ + DecryptResult decrypt(in boolean secure, in byte[] keyId, in byte[] iv, in Mode mode, + in Pattern pattern, in SubSample[] subSamples, in SharedBuffer source, in long offset, + in DestinationBuffer destination); + + /** + * Get OEMCrypto or plugin error messages. + * + * @return LogMessages + * Implicit error codes: + * + GENERAL_OEM_ERROR on OEM-provided, low-level component failures; + * + GENERAL_PLUGIN_ERROR on unexpected plugin-level errors. + */ + List getLogMessages(); + + /** + * Notify a plugin of the currently configured resolution. + * + * @param width - the display resolutions's width + * @param height - the display resolution's height + */ + void notifyResolution(in int width, in int height); + + /** + * Check if the specified mime-type requires a secure decoder + * component. + * + * @param mime The content mime-type + * @return must be true only if a secure decoder is required + * for the specified mime-type + */ + boolean requiresSecureDecoderComponent(in String mime); + + /** + * Associate a mediadrm session with this crypto session. + * + * @param sessionId the MediaDrm session ID to associate with + * this crypto session + * @return (implicit) the status of the call, status can be: + * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened, or + * ERROR_DRM_CANNOT_HANDLE if the operation is not supported by + * the drm scheme + */ + void setMediaDrmSession(in byte[] sessionId); + + /** + * Set a shared memory base for subsequent decrypt operations. + * The buffer base is mmaped from a ParcelFileDesciptor in Ashmem + * which maps shared memory in the HAL module. + * After the shared buffer base is established, the decrypt() method + * receives SharedBuffer instances which specify the buffer address range + * for decrypt source and destination addresses. + * + * There can be multiple shared buffers per crypto plugin. The buffers + * are distinguished by the bufferId. + * + * @param base the base of the memory buffer identified by + * bufferId + * @param bufferId identifies the specific shared buffer for which + * the base is being set. + */ + void setSharedBufferBase(in Ashmem base, in int bufferId); +} diff --git a/drm/aidl/android/hardware/drm/IDrmFactory.aidl b/drm/aidl/android/hardware/drm/IDrmFactory.aidl new file mode 100644 index 0000000000..b9622a427b --- /dev/null +++ b/drm/aidl/android/hardware/drm/IDrmFactory.aidl @@ -0,0 +1,76 @@ +/* + * 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. + */ + +package android.hardware.drm; + +import android.hardware.drm.SecurityLevel; +import android.hardware.drm.Uuid; + +/** + * IDrmFactory is the main entry point for interacting with a vendor's + * drm HAL to create drm plugin instances. A drm plugin instance + * creates drm sessions which are used to obtain keys for a crypto + * session so it can decrypt protected video content. + */ +@VintfStability +interface IDrmFactory { + /** + * Create a drm plugin instance for the specified uuid and + * scheme-specific initialization data. + * + * @param uuid uniquely identifies the drm scheme. See + * http://dashif.org/identifiers/protection for uuid assignments + * @param appPackageName identifies the package name of the calling + * application. + * + * @return A DRM plugin instance if successful, or null if not created. + * Implicit error codes: + * + ERROR_DRM_CANNOT_HANDLE if the plugin cannot be created. + */ + @nullable android.hardware.drm.IDrmPlugin createPlugin( + in Uuid uuid, in String appPackageName); + + /** + * Return vector of uuids identifying crypto schemes supported by + * this HAL. + * + * @return List of uuids for which isCryptoSchemeSupported is true; + * each uuid can be used as input to createPlugin. + */ + List getSupportedCryptoSchemes(); + + /** + * Determine if the HAL factory is able to construct plugins that + * support a given media container format specified by mimeType + * + * @param mimeType identifies the mime type in question + * + * @return must be true only if the scheme is supported + */ + boolean isContentTypeSupported(in String mimeType); + + /** + * Determine if a specific security level is supported by the device. + * + * @param uuid identifies the crypto scheme in question + * @param mimeType identifies the mime type in question + * @param securityLevel specifies the security level required + * + * @return must be true only if the scheme is supported + */ + boolean isCryptoSchemeSupported( + in Uuid uuid, in String mimeType, in SecurityLevel securityLevel); +} diff --git a/drm/aidl/android/hardware/drm/IDrmPlugin.aidl b/drm/aidl/android/hardware/drm/IDrmPlugin.aidl new file mode 100644 index 0000000000..e649f264ea --- /dev/null +++ b/drm/aidl/android/hardware/drm/IDrmPlugin.aidl @@ -0,0 +1,755 @@ +/* + * 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. + */ + +package android.hardware.drm; + +import android.hardware.drm.DrmMetricGroup; +import android.hardware.drm.HdcpLevels; +import android.hardware.drm.IDrmPluginListener; +import android.hardware.drm.KeySetId; +import android.hardware.drm.KeyRequest; +import android.hardware.drm.KeyStatus; +import android.hardware.drm.KeyType; +import android.hardware.drm.KeyValue; +import android.hardware.drm.LogMessage; +import android.hardware.drm.NumberOfSessions; +import android.hardware.drm.OfflineLicenseState; +import android.hardware.drm.OpaqueData; +import android.hardware.drm.ProvideProvisionResponseResult; +import android.hardware.drm.ProvisionRequest; +import android.hardware.drm.SecureStop; +import android.hardware.drm.SecureStopId; +import android.hardware.drm.SecurityLevel; + +/** + * IDrmPlugin is used to interact with a specific drm plugin that was + * created by IDrmFactory::createPlugin. + * + * A drm plugin provides methods for obtaining drm keys to be used by a codec + * to decrypt protected video content. + */ +@VintfStability +interface IDrmPlugin { + /** + * Close a session on the DrmPlugin object + * + * @param sessionId the session id the call applies to + * + * @return (implicit) the status of the call: + * BAD_VALUE if the sessionId is invalid + * ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the session cannot be closed. + * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened + */ + void closeSession(in byte[] sessionId); + + /** + * Decrypt the provided input buffer with the cipher algorithm + * specified by setCipherAlgorithm and the key selected by keyId, + * and return the decrypted data. + * + * @param sessionId the session id the call applies to + * @param keyId the ID of the key to use for decryption + * @param input the input data to decrypt + * @param iv the initialization vector to use for decryption + * + * @return decrypted output buffer + * Implicit error codes: + * + BAD_VALUE if the sessionId is invalid + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the decrypt operation cannot be performed. + * + ERROR_DRM_SESSION_NOT_OPENED if the session is not opened + */ + byte[] decrypt(in byte[] sessionId, in byte[] keyId, in byte[] input, in byte[] iv); + + /** + * Encrypt the provided input buffer with the cipher algorithm specified by + * setCipherAlgorithm and the key selected by keyId, and return the + * encrypted data. + * + * @param sessionId the session id the call applies to + * @param keyId the ID of the key to use for encryption + * @param input the input data to encrypt + * @param iv the initialization vector to use for encryption + * + * @return encrypted output buffer + * Implicit error codes: + * + BAD_VALUE if the sessionId is invalid + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the encrypt operation cannot be performed. + * + ERROR_DRM_SESSION_NOT_OPENED if the session is not opened + */ + byte[] encrypt(in byte[] sessionId, in byte[] keyId, in byte[] input, in byte[] iv); + + /** + * Return the currently negotiated and max supported HDCP levels. + * + * The current level is based on the display(s) the device is connected to. + * If multiple HDCP-capable displays are simultaneously connected to + * separate interfaces, this method returns the lowest negotiated HDCP level + * of all interfaces. + * + * The maximum HDCP level is the highest level that can potentially be + * negotiated. It is a constant for any device, i.e. it does not depend on + * downstream receiving devices that could be connected. For example, if + * the device has HDCP 1.x keys and is capable of negotiating HDCP 1.x, but + * does not have HDCP 2.x keys, then the maximum HDCP capability would be + * reported as 1.x. If multiple HDCP-capable interfaces are present, it + * indicates the highest of the maximum HDCP levels of all interfaces. + * + * This method should only be used for informational purposes, not for + * enforcing compliance with HDCP requirements. Trusted enforcement of HDCP + * policies must be handled by the DRM system. + * + * @return HdcpLevels parcelable + * Implicit error codes: + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the HDCP level cannot be queried + */ + HdcpLevels getHdcpLevels(); + + /** + * A key request/response exchange occurs between the app and a License + * Server to obtain the keys required to decrypt the content. + * getKeyRequest() is used to obtain an opaque key request blob that is + * delivered to the license server. + * + * @param scope either a sessionId or a keySetId, depending on the + * specified keyType. When the keyType is OFFLINE or STREAMING, scope + * must be set to the sessionId the keys will be provided to. When the + * keyType is RELEASE, scope must be set to the keySetId of the keys + * being released. + * @param initData container-specific data, its meaning is interpreted + * based on the mime type provided in the mimeType parameter. It could + * contain, for example, the content ID, key ID or other data obtained + * from the content metadata that is required to generate the key + * request. initData must be empty when keyType is RELEASE. + * @param mimeType identifies the mime type of the content + * @param keyType specifies if the keys are to be used for streaming, + * offline or a release + * @param optionalParameters included in the key request message to + * allow a client application to provide additional message parameters + * to the server. + * + * @return KeyRequest parcelable + * Implicit error codes: + * + BAD_VALUE if any parameters are invalid + * + ERROR_DRM_CANNOT_HANDLE if getKeyRequest is not supported at + * the time of the call + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where + * a key request cannot be generated + * + ERROR_DRM_NOT_PROVISIONED if the device requires provisioning + * before it is able to generate a key request + * + ERROR_DRM_RESOURCE_CONTENTION if client applications using the + * hal are temporarily exceeding the available crypto resources + * such that a retry of the operation is likely to succeed + * + ERROR_DRM_SESSION_NOT_OPENED if the session is not opened + */ + KeyRequest getKeyRequest(in byte[] scope, in byte[] initData, in String mimeType, + in KeyType keyType, in KeyValue[] optionalParameters); + + /** + * Get Plugin error messages. + * + * @return LogMessages + * Implicit error codes: + * + GENERAL_OEM_ERROR on OEM-provided, low-level component failures; + * + GENERAL_PLUGIN_ERROR on unexpected plugin-level errors. + */ + List getLogMessages(); + + /** + * Returns the plugin-specific metrics. Multiple metric groups may be + * returned in one call to getMetrics(). The scope and definition of the + * metrics is defined by the plugin. + * + * @return collection of metric groups provided by the plugin + * Implicit error codes: + * + ERROR_DRM_INVALID_STATE if the metrics are not available to be + * returned. + */ + List getMetrics(); + + /** + * Return the current number of open sessions and the maximum number of + * sessions that may be opened simultaneously among all DRM instances + * for the active DRM scheme. + * + * @return NumberOfSessions parcelable + * Implicit error codes: + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where the + * number of sessions cannot be queried + */ + NumberOfSessions getNumberOfSessions(); + + /** + * The keys in an offline license allow protected content to be + * played even if the device is not connected to a network. + * Offline licenses are stored on the device after a key + * request/response exchange when the key request KeyType is + * OFFLINE. Normally each app is responsible for keeping track of + * the KeySetIds it has created. In some situations however, it + * will be necessary to request the list of stored offline license + * KeySetIds. If an app loses the KeySetId for any stored licenses + * that it created, for example, it must be able to recover the + * stored KeySetIds so those licenses will be removed when they + * expire or when the app is uninstalled. + * + * This method returns a list of the KeySetIds for all offline + * licenses. The offline license KeySetId allows an app to query + * the status of an offline license or remove it. + * + * @return list of keySetIds + * Implicit error codes: + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where the + * KeySetIds can't be returned + */ + List getOfflineLicenseKeySetIds(); + + /** + * Request the state of an offline license. An offline license must + * be usable or inactive. The keys in a usable offline license are + * available for decryption. When the offline license state is + * inactive, the keys have been marked for release using + * getKeyRequest with KeyType RELEASE but the key response has not + * been received. The keys in an inactive offline license are not + * usable for decryption. + * + * @param keySetId the id of the offline license + * + * @return The offline license state, UNKNOWN, USABLE or INACTIVE. + * Implicit error codes: + * + BAD_VALUE if the license is not found + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where the + * offline license state can't be queried + */ + OfflineLicenseState getOfflineLicenseState(in KeySetId keySetId); + + /** + * Read a byte array property value given the property name. + * See getPropertyString. + * + * @param propertyName the name of the property + * + * @return property value bye array + * Implicit error codes: + * + BAD_VALUE if the property name is invalid + * + ERROR_DRM_CANNOT_HANDLE if the property is not supported + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where the + * property cannot be obtained + */ + byte[] getPropertyByteArray(in String propertyName); + + /** + * A drm scheme can have properties that are settable and readable + * by an app. There are a few forms of property access methods, + * depending on the data type of the property. + * + * Property values defined by the public API are: + * "vendor" [string] identifies the maker of the drm scheme + * "version" [string] identifies the version of the drm scheme + * "description" [string] describes the drm scheme + * 'deviceUniqueId' [byte array] The device unique identifier is + * established during device provisioning and provides a means of + * uniquely identifying each device. + * + * Since drm scheme properties may vary, additional field names may be + * defined by each DRM vendor. Refer to your DRM provider documentation + * for definitions of its additional field names. + * + * Read a string property value given the property name. + * + * @param propertyName the name of the property + * + * @return the property value string. + * Implicit error codes: + * + BAD_VALUE if the property name is invalid + * + ERROR_DRM_CANNOT_HANDLE if the property is not supported + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where the + * property cannot be obtained + */ + String getPropertyString(in String propertyName); + + /** + * A provision request/response exchange occurs between the app + * and a provisioning server to retrieve a device certificate. + * getProvisionRequest is used to obtain an opaque provisioning + * request blob that is delivered to the provisioning server. + * + * @param certificateType the type of certificate requested, e.g. "X.509" + * @param certificateAuthority identifies the certificate authority. + * A certificate authority (CA) is an entity which issues digital + * certificates for use by other parties. It is an example of a + * trusted third party. + * + * @return ProvisionRequest parcelable + * Implicit error codes: + * + ERROR_DRM_CANNOT_HANDLE if the drm scheme does not require + * provisioning + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the provision request cannot be generated + * + ERROR_DRM_RESOURCE_CONTENTION if client applications using + * the hal are temporarily exceeding the available crypto + * resources such that a retry of the operation is likely + * to succeed + */ + ProvisionRequest getProvisionRequest( + in String certificateType, in String certificateAuthority); + + /** + * Get all secure stops by secure stop ID + * + * @param secureStopId the ID of the secure stop to return. + * The secure stop ID is delivered by the key server + * as part of the key response and must also be known by the app. + * + * @return secure stop opaque object. + * Implicit error codes: + * + BAD_VALUE if the secureStopId is invalid + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the secure stop cannot be returned + */ + SecureStop getSecureStop(in SecureStopId secureStopId); + + /** + * Get the IDs of all secure stops on the device + * + * @return list of secure stops IDs. + * Implicit error codes: + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the secure stop IDs list cannot be returned + */ + List getSecureStopIds(); + + /** + * SecureStop is a way of enforcing the concurrent stream limit per + * subscriber. + * + * It can securely monitor the lifetime of sessions across device reboots + * by periodically persisting the session lifetime status in secure + * storage. + * + * A signed version of the sessionID is written to persistent storage on the + * device when each MediaCrypto object is created and periodically during + * playback. The sessionID is signed by the device private key to prevent + * tampering. + * + * When playback is completed the session is destroyed, and the secure + * stops are queried by the app. The app then delivers the secure stop + * message to a server which verifies the signature to confirm that the + * session and its keys have been removed from the device. The persisted + * record on the device is removed after receiving and verifying the + * signed response from the server. + * + * Get all secure stops on the device + * + * @return list of the opaque secure stop objects. + * Implicit error codes: + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the secure stops cannot be returned + */ + List getSecureStops(); + + /** + * Return the current security level of a session. A session has an initial + * security level determined by the robustness of the DRM system's + * implementation on the device. + * + * @param sessionId the session id the call applies to + * + * @return the current security level for the session. + * Implicit error codes: + * + BAD_VALUE if the sessionId is invalid + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the security level cannot be queried + * + ERROR_DRM_SESSION_NOT_OPENED if the session is not opened + */ + SecurityLevel getSecurityLevel(in byte[] sessionId); + + /** + * Open a new session at a requested security level. The security level + * represents the robustness of the device's DRM implementation. By default, + * sessions are opened at the native security level of the device which is + * the maximum level that can be supported. Overriding the security level is + * necessary when the decrypted frames need to be manipulated, such as for + * image compositing. The security level parameter must be equal to or lower + * than the native level. If the requested level is not supported, the next + * lower supported security level must be set. The level can be queried + * using {@link #getSecurityLevel}. A session ID is returned. + * + * @param level the requested security level + * + * @return sessionId + */ + byte[] openSession(in SecurityLevel securityLevel); + + /** + * After a key response is received by the app, it is provided to the + * Drm plugin using provideKeyResponse. + * + * @param scope may be a sessionId or a keySetId depending on the + * type of the response. Scope should be set to the sessionId + * when the response is for either streaming or offline key requests. + * Scope should be set to the keySetId when the response is for + * a release request. + * @param response the response from the key server that is being + * provided to the drm HAL. + * + * @return a keySetId that can be used to later restore the keys to a new + * session with the method restoreKeys when the response is for an + * offline key request. + * Implicit error codes: + * + BAD_VALUE if any parameters are invalid + * + ERROR_DRM_CANNOT_HANDLE if provideKeyResponse is not supported + * at the time of the call + * + ERROR_DRM_DEVICE_REVOKED if the device has been disabled by + * the license policy + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where + * a key response cannot be handled. + * + ERROR_DRM_NOT_PROVISIONED if the device requires provisioning + * before it can handle the key response + * + ERROR_DRM_SESSION_NOT_OPENED if the session is not opened + */ + KeySetId provideKeyResponse(in byte[] scope, in byte[] response); + + /** + * After a provision response is received by the app from a provisioning + * server, it is provided to the Drm HAL using provideProvisionResponse. + * The HAL implementation must receive the provision request and + * store the provisioned credentials. + * + * @param response the opaque provisioning response received by the + * app from a provisioning server. + * + * @return ProvideProvisionResponseResult parcelable, which contains + * the public certificate and encrypted private key that can be + * used by signRSA to compute an RSA signature on a message. + * Implicit error codes: + * + BAD_VALUE if any parameters are invalid + * + ERROR_DRM_DEVICE_REVOKED if the device has been disabled by + * the license policy + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where the + * provision response cannot be handled + */ + ProvideProvisionResponseResult provideProvisionResponse(in byte[] response); + + /** + * Request an informative description of the license for the session. + * The status is in the form of {name, value} pairs. Since DRM license + * policies vary by vendor, the specific status field names are + * determined by each DRM vendor. Refer to your DRM provider + * documentation for definitions of the field names for a particular + * drm scheme. + * + * @param sessionId the session id the call applies to + * + * @return a list of name value pairs describing the license. + * Implicit error codes: + * + ERROR_DRM_SESSION_NOT_OPENED if the session is not opened + * + BAD_VALUE if any parameters are invalid + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where the + * key status cannot be queried. + */ + List queryKeyStatus(in byte[] sessionId); + + /** + * Release all secure stops on the device + * + * @return (implicit) the status of the call: + * ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the secure stops cannot be released. + */ + void releaseAllSecureStops(); + + /** + * Release a secure stop by secure stop ID + * + * @param secureStopId the ID of the secure stop to release. + * The secure stop ID is delivered by the key server as + * part of the key response and must also be known by the app. + * + * @return (implicit) the status of the call: + * BAD_VALUE if the secureStopId is invalid + * ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the secure stop cannot be released. + */ + void releaseSecureStop(in SecureStopId secureStopId); + + /** + * Release secure stops given a release message from the key server + * + * @param ssRelease the secure stop release message identifying + * one or more secure stops to release. ssRelease is opaque, + * it is passed directly from a DRM license server through + * the app and media framework to the vendor HAL module. + * The format and content of ssRelease must be defined by the + * DRM scheme being implemented according to this HAL. + * The DRM scheme can be identified by its UUID which + * can be queried using IDrmFactory::isCryptoSchemeSupported. + * + * @return (implicit) the status of the call: + * BAD_VALUE if ssRelease is invalid + * ERROR_DRM_INVALID_STATE if the HAL is in a state wherei + * the secure stop cannot be released. + */ + void releaseSecureStops(in OpaqueData ssRelease); + + /** + * Remove all secure stops on the device without requiring a secure + * stop release response message from the key server. + * + * @return (implicit) the status of the call: + * ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the secure stops cannot be removed. + */ + void removeAllSecureStops(); + + /** + * Remove the current keys from a session + * + * @param sessionId the session id the call applies to + * + * @return (implicit) the status of the call: + * BAD_VALUE if the sessionId is invalid + * ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the keys cannot be removed. + * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened + */ + void removeKeys(in byte[] sessionId); + + /** + * Normally offline licenses are released using a key + * request/response exchange using getKeyRequest where the KeyType + * is RELEASE, followed by provideKeyResponse. This allows the + * server to cryptographically confirm that the license has been + * removed and then adjust the count of offline licenses allocated + * to the device. + *

+ * In some exceptional situations it will be necessary to directly + * remove offline licenses without notifying the server, which is + * performed by this method. + * + * @param keySetId the id of the offline license to remove + * + * @return (implicit) the status of the call: + * BAD_VALUE if the license is not found + * ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the KeySetIds can't be removed. + */ + void removeOfflineLicense(in KeySetId keySetId); + + /** + * Remove a secure stop given its secure stop ID, without requiring + * a secure stop release response message from the key server. + * + * @param secureStopId the ID of the secure stop to release. + * + * @return the status of the call: + * BAD_VALUE if the secureStopId is invalid + * ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the secure stop cannot be removed. + */ + void removeSecureStop(in SecureStopId secureStopId); + + /** + * Check if the specified mime-type & security level require a secure decoder + * component. + * + * @param mime The content mime-type + * @param level the requested security level + * + * @return must be true if and only if a secure decoder is + * required for the specified mime-type & security level + */ + boolean requiresSecureDecoder(in String mime, in SecurityLevel level); + + /** + * Check if the specified mime-type requires a secure decoder component + * at the highest security level supported on the device. + * + * @param mime The content mime-type + * + * @return must be true if and only if a secure decoder is required + * for the specified mime-type + */ + boolean requiresSecureDecoderDefault(in String mime); + + /** + * Restore persisted offline keys into a new session + * + * @param sessionId the session id the call applies to + * @param keySetId identifies the keys to load, obtained from + * a prior call to provideKeyResponse(). + * + * @return (implicit) the status of the call: + * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened + * BAD_VALUE if any parameters are invalid + * ERROR_DRM_INVALID_STATE if the HAL is in a state where + * keys cannot be restored. + */ + void restoreKeys(in byte[] sessionId, in KeySetId keySetId); + + /** + * The following methods implement operations on a CryptoSession to support + * encrypt, decrypt, sign verify operations on operator-provided + * session keys. + * + * + * Set the cipher algorithm to be used for the specified session. + * + * @param sessionId the session id the call applies to + * @param algorithm the algorithm to use. The string conforms to JCA + * Standard Names for Cipher Transforms and is case insensitive. An + * example algorithm is "AES/CBC/PKCS5Padding". + * + * @return (implicit) the status of the call: + * BAD_VALUE if any parameters are invalid + * ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the algorithm cannot be set. + * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened` + */ + void setCipherAlgorithm(in byte[] sessionId, in String algorithm); + + /** + * Plugins call the following methods to deliver events to the + * java app. + * + * + * Set a listener for a drm session. This allows the drm HAL to + * make asynchronous calls back to the client of IDrm. + * + * @param listener instance of IDrmPluginListener to receive the events + */ + void setListener(in IDrmPluginListener listener); + + /** + * Set the MAC algorithm to be used for computing hashes in a session. + * + * @param sessionId the session id the call applies to + * @param algorithm the algorithm to use. The string conforms to JCA + * Standard Names for Mac Algorithms and is case insensitive. An example MAC + * algorithm string is "HmacSHA256". + * + * @return (implicit) the status of the call: + * BAD_VALUE if any parameters are invalid + * ERROR_DRM_INVALID_STATE if the HAL is in a state where + * the algorithm cannot be set. + * ERROR_DRM_SESSION_NOT_OPENED if the session is not opened` + */ + void setMacAlgorithm(in byte[] sessionId, in String algorithm); + + /** + * Set playback id of a drm session. The playback id can be used to join drm session metrics + * with metrics from other low level media components, e.g. codecs, or metrics from the high + * level player. + * + * @param sessionId drm session id + * @param playbackId high level playback id + * + * @return (implicit) the status of the call: + * ERROR_DRM_SESSION_NOT_OPENED if the drm session cannot be found + */ + void setPlaybackId(in byte[] sessionId, in String playbackId); + + /** + * Write a property byte array value given the property name + * + * @param propertyName the name of the property + * @param value the value to write + * + * @return (implicit) the status of the call: + * BAD_VALUE if the property name is invalid + * ERROR_DRM_CANNOT_HANDLE if the property is not supported + * ERROR_DRM_INVALID_STATE if the HAL is in a state where the + * property cannot be set + */ + void setPropertyByteArray(in String propertyName, in byte[] value); + + /** + * Write a property string value given the property name + * + * @param propertyName the name of the property + * @param value the value to write + * + * @return (implicit) status of the call: + * BAD_VALUE if the property name is invalid + * ERROR_DRM_CANNOT_HANDLE if the property is not supported + * ERROR_DRM_INVALID_STATE if the HAL is in a state where the + * property cannot be set + */ + void setPropertyString(in String propertyName, in String value); + + /** + * Compute a signature over the provided message using the mac algorithm + * specified by setMacAlgorithm and the key selected by keyId and return + * the signature. + * + * @param sessionId the session id the call applies to + * @param keyId the ID of the key to use for decryption + * @param message the message to compute a signature over + * + * @return signature computed over the message + * Implicit error codes: + * + ERROR_DRM_SESSION_NOT_OPENED if the session is not opened + * + BAD_VALUE if any parameters are invalid + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where the + * sign operation cannot be performed. + */ + byte[] sign(in byte[] sessionId, in byte[] keyId, in byte[] message); + + /** + * Compute an RSA signature on the provided message using the specified + * algorithm. + * + * @param sessionId the session id the call applies to + * @param algorithm the signing algorithm, such as "RSASSA-PSS-SHA1" + * or "PKCS1-BlockType1" + * @param message the message to compute the signature on + * @param wrappedKey the private key returned during provisioning as + * returned by provideProvisionResponse. + * + * @return signature computed over the message + * Implicit error codes: + * + BAD_VALUE if any parameters are invalid + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where the + * signRSA operation operation cannot be performed + * + ERROR_DRM_SESSION_NOT_OPENED if the session is not opened + */ + byte[] signRSA( + in byte[] sessionId, in String algorithm, in byte[] message, + in byte[] wrappedkey); + + /** + * Compute a hash of the provided message using the mac algorithm specified + * by setMacAlgorithm and the key selected by keyId, and compare with the + * expected result. + * + * @param sessionId the session id the call applies to + * @param keyId the ID of the key to use for decryption + * @param message the message to compute a hash of + * @param signature the signature to verify + * + * @return true if the signature is verified positively, false otherwise. + * Implicit error codes: + * + ERROR_DRM_SESSION_NOT_OPENED if the session is not opened + * + BAD_VALUE if any parameters are invalid + * + ERROR_DRM_INVALID_STATE if the HAL is in a state where the + * verify operation cannot be performed. + */ + boolean verify( + in byte[] sessionId, in byte[] keyId, in byte[] message, + in byte[] signature); +} diff --git a/drm/aidl/android/hardware/drm/IDrmPluginListener.aidl b/drm/aidl/android/hardware/drm/IDrmPluginListener.aidl new file mode 100644 index 0000000000..d52da66742 --- /dev/null +++ b/drm/aidl/android/hardware/drm/IDrmPluginListener.aidl @@ -0,0 +1,76 @@ +/* + * 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. + */ + +package android.hardware.drm; + +import android.hardware.drm.EventType; +import android.hardware.drm.KeyStatus; + +/** + * IDrmPluginListener is a listener interface for Drm events sent from an + * IDrmPlugin instance. + */ +@VintfStability +interface IDrmPluginListener { + /** + * Legacy event sending method, it sends events of various types using a + * single overloaded set of parameters. This form is deprecated. + * + * @param eventType the type of the event + * @param sessionId identifies the session the event originated from + * @param data event-specific data blob + */ + oneway void onEvent(in EventType eventType, in byte[] sessionId, in byte[] data); + + /** + * Send a license expiration update to the listener. The expiration + * update indicates how long the current keys are valid before they + * need to be renewed. + * + * @param sessionId identifies the session the event originated from + * @param expiryTimeInMS the time when the keys need to be renewed. + * The time is in milliseconds, relative to the Unix epoch. A time + * of 0 indicates that the keys never expire. + */ + oneway void onExpirationUpdate(in byte[] sessionId, in long expiryTimeInMS); + + /** + * Send a keys change event to the listener. The keys change event + * indicates the status of each key in the session. Keys can be + * indicated as being usable, expired, outputnotallowed or statuspending. + * + * @param sessionId identifies the session the event originated from + * @param keyStatusList indicates the status for each key ID in the + * session. + * @param hasNewUsableKey indicates if the event includes at least one + * key that has become usable. + */ + oneway void onKeysChange( + in byte[] sessionId, in KeyStatus[] keyStatusList, in boolean hasNewUsableKey); + + /** + * Some device crypto hardware is incapable of retaining crypto + * session state across suspend and resume cycles. A + * SessionLostState event must be signaled when a session has + * become invalid for this reason. This event must not be used to + * indicate a failure in the crypto system. Closing the session + * and opening a new one must allow the application to resume + * normal use of the drm hal module. + * + * @param sessionId identifies the session that has been invalidated + */ + oneway void onSessionLostState(in byte[] sessionId); +} diff --git a/drm/aidl/android/hardware/drm/KeyRequest.aidl b/drm/aidl/android/hardware/drm/KeyRequest.aidl new file mode 100644 index 0000000000..0c732055f2 --- /dev/null +++ b/drm/aidl/android/hardware/drm/KeyRequest.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ + +package android.hardware.drm; + +import android.hardware.drm.KeyRequestType; + +@VintfStability +parcelable KeyRequest { + /** The opaque key request blob. */ + byte[] request; + + /** + * Enumerated type: + * INITIAL - the first key request for a license + * NONE - indicates that no request is needed because the keys + * are already loaded + * RENEWAL - is a subsequent key request used to refresh the + * keys in a license + * RELEASE - indicates keys are being released + * UPDATE - indicates that the keys need to be refetched after + * the initial license request + */ + KeyRequestType requestType; + + /** + * The URL that the request may be sent to, + * if provided by the drm HAL. The app can choose to + * override this URL. If the HAL implementation does not provide + * a defaultUrl, the returned string must be empty. + */ + String defaultUrl; +} diff --git a/drm/aidl/android/hardware/drm/KeyRequestType.aidl b/drm/aidl/android/hardware/drm/KeyRequestType.aidl new file mode 100644 index 0000000000..3a603ff6c8 --- /dev/null +++ b/drm/aidl/android/hardware/drm/KeyRequestType.aidl @@ -0,0 +1,52 @@ +/* + * 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. + */ + +package android.hardware.drm; + +/** + * An app determines the type of a key request returned from getKeyRequest. + */ +@VintfStability +@Backing(type="int") +enum KeyRequestType { + /** + * Key request type is for an initial license request + */ + INITIAL, + /** + * Key request type is for license renewal. Renewal requests are used + * to extend the validity period for streaming keys. + */ + RENEWAL, + /** + * Key request type is a release. A key release causes offline keys + * to become available for streaming. + */ + RELEASE, + /** + * Key request type is unknown due to some error condition. + */ + UNKNOWN, + /** + * Keys are already loaded. No key request is needed. + */ + NONE, + /** + * Keys have previously been loaded. An additional (non-renewal) license + * request is needed. + */ + UPDATE, +} diff --git a/drm/aidl/android/hardware/drm/KeySetId.aidl b/drm/aidl/android/hardware/drm/KeySetId.aidl new file mode 100644 index 0000000000..be0ce0efa8 --- /dev/null +++ b/drm/aidl/android/hardware/drm/KeySetId.aidl @@ -0,0 +1,22 @@ +/* + * 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. + */ + +package android.hardware.drm; + +@VintfStability +parcelable KeySetId { + byte[] keySetId; +} diff --git a/drm/aidl/android/hardware/drm/KeyStatus.aidl b/drm/aidl/android/hardware/drm/KeyStatus.aidl new file mode 100644 index 0000000000..16e042a147 --- /dev/null +++ b/drm/aidl/android/hardware/drm/KeyStatus.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.drm; + +import android.hardware.drm.KeyStatusType; + +/** + * Used by sendKeysChange to report the usability status of each key + * to the app. + */ +@VintfStability +parcelable KeyStatus { + byte[] keyId; + KeyStatusType type; +} diff --git a/drm/aidl/android/hardware/drm/KeyStatusType.aidl b/drm/aidl/android/hardware/drm/KeyStatusType.aidl new file mode 100644 index 0000000000..6902d8708c --- /dev/null +++ b/drm/aidl/android/hardware/drm/KeyStatusType.aidl @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package android.hardware.drm; + +@VintfStability +@Backing(type="int") +enum KeyStatusType { + /** + * The key is currently usable to decrypt media data. + */ + USABLE, + /** + * The key is no longer usable to decrypt media data because its expiration + * time has passed. + */ + EXPIRED, + /** + * The key is not currently usable to decrypt media data because its output + * requirements cannot currently be met. + */ + OUTPUTNOTALLOWED, + /** + * The status of the key is not yet known and is being determined. + */ + STATUSPENDING, + /** + * The key is not currently usable to decrypt media data because of an + * internal error in processing unrelated to input parameters. + */ + INTERNALERROR, + /** + * The key is not yet usable to decrypt media because the start + * time is in the future. The key must become usable when + * its start time is reached. + */ + USABLEINFUTURE, +} diff --git a/drm/aidl/android/hardware/drm/KeyType.aidl b/drm/aidl/android/hardware/drm/KeyType.aidl new file mode 100644 index 0000000000..78b4d8369c --- /dev/null +++ b/drm/aidl/android/hardware/drm/KeyType.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. + */ + +package android.hardware.drm; + +@VintfStability +@Backing(type="int") +enum KeyType { + /** + * Drm keys can be for offline content or for online streaming. + * Offline keys are persisted on the device and may be used when the device + * is disconnected from the network. + */ + OFFLINE, + /** + * Keys for streaming are not persisted and require the device to be + * connected to the network for periodic renewal. + */ + STREAMING, + /** + * The Release type is used to request that offline keys be no longer + * restricted to offline use. + */ + RELEASE, +} diff --git a/drm/aidl/android/hardware/drm/KeyValue.aidl b/drm/aidl/android/hardware/drm/KeyValue.aidl new file mode 100644 index 0000000000..e26781b58b --- /dev/null +++ b/drm/aidl/android/hardware/drm/KeyValue.aidl @@ -0,0 +1,23 @@ +/* + * 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. + */ + +package android.hardware.drm; + +@VintfStability +parcelable KeyValue { + String key; + String value; +} diff --git a/drm/aidl/android/hardware/drm/LogMessage.aidl b/drm/aidl/android/hardware/drm/LogMessage.aidl new file mode 100644 index 0000000000..8ac1ced585 --- /dev/null +++ b/drm/aidl/android/hardware/drm/LogMessage.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. + */ + +package android.hardware.drm; + +import android.hardware.drm.LogPriority; + +/** + * Returned by getLogMessages to report error diagnostics to the + * app. + * + * The |message| field is for informational purposes only, and + * NOT meant to be parsed programmatically when handling errors. + * For programmatic error handling, please check the return |Status| + * of APIs instead. + */ +@VintfStability +parcelable LogMessage { + /** + * Epoch time in milliseconds. + */ + long timeMs; + LogPriority priority; + String message; +} diff --git a/drm/aidl/android/hardware/drm/LogPriority.aidl b/drm/aidl/android/hardware/drm/LogPriority.aidl new file mode 100644 index 0000000000..4db3b40982 --- /dev/null +++ b/drm/aidl/android/hardware/drm/LogPriority.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.drm; + +@VintfStability +@Backing(type="int") +enum LogPriority { + UNKNOWN, + DEFAULT, + VERBOSE, + DEBUG, + INFO, + WARN, + ERROR, + FATAL, +} diff --git a/drm/aidl/android/hardware/drm/Mode.aidl b/drm/aidl/android/hardware/drm/Mode.aidl new file mode 100644 index 0000000000..6fc00651a8 --- /dev/null +++ b/drm/aidl/android/hardware/drm/Mode.aidl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package android.hardware.drm; + +/** + * Enumerate the supported crypto modes + */ +@VintfStability +@Backing(type="int") +enum Mode { + UNENCRYPTED = 0, + AES_CTR = 1, + AES_CBC_CTS = 2, + AES_CBC = 3, +} diff --git a/drm/aidl/android/hardware/drm/NumberOfSessions.aidl b/drm/aidl/android/hardware/drm/NumberOfSessions.aidl new file mode 100644 index 0000000000..75b7c2ece8 --- /dev/null +++ b/drm/aidl/android/hardware/drm/NumberOfSessions.aidl @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package android.hardware.drm; + +@VintfStability +parcelable NumberOfSessions { + /** The number of currently opened sessions. */ + int currentSessions; + + /** The maximum number of sessions that the device can support. */ + int maxSessions; +} diff --git a/drm/aidl/android/hardware/drm/OfflineLicenseState.aidl b/drm/aidl/android/hardware/drm/OfflineLicenseState.aidl new file mode 100644 index 0000000000..0f447db2fa --- /dev/null +++ b/drm/aidl/android/hardware/drm/OfflineLicenseState.aidl @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package android.hardware.drm; + +@VintfStability +@Backing(type="int") +enum OfflineLicenseState { + /** + * Offline license state is unknown + */ + UNKNOWN, + /** + * Offline license state is usable, the keys are usable for decryption. + */ + USABLE, + /** + * Offline license state is inactive, the keys have been marked for + * release using {@link #getKeyRequest} with KEY_TYPE_RELEASE but the + * key response has not been received. + */ + INACTIVE, +} diff --git a/drm/aidl/android/hardware/drm/OpaqueData.aidl b/drm/aidl/android/hardware/drm/OpaqueData.aidl new file mode 100644 index 0000000000..6b2a2e79c0 --- /dev/null +++ b/drm/aidl/android/hardware/drm/OpaqueData.aidl @@ -0,0 +1,22 @@ +/* + * 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. + */ + +package android.hardware.drm; + +@VintfStability +parcelable OpaqueData { + byte[] opaqueData; +} diff --git a/drm/aidl/android/hardware/drm/Pattern.aidl b/drm/aidl/android/hardware/drm/Pattern.aidl new file mode 100644 index 0000000000..88d22cf221 --- /dev/null +++ b/drm/aidl/android/hardware/drm/Pattern.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. + */ + +package android.hardware.drm; + +/** + * A crypto Pattern is a repeating sequence of encrypted and clear blocks + * occurring within the bytes indicated by mNumBytesOfEncryptedDatad bytes + * of a subsample. Patterns are used to reduce the CPU overhead of + * decrypting samples. As an example, HLS uses 1:9 patterns where every + * 10th block is encrypted. + */ +@VintfStability +parcelable Pattern { + /** + * The number of blocks to be encrypted in the pattern. If zero, + * pattern encryption is inoperative. + */ + int encryptBlocks; + + /** + * The number of blocks to be skipped (left clear) in the pattern. If + * zero, pattern encryption is inoperative. + */ + int skipBlocks; +} diff --git a/drm/aidl/android/hardware/drm/ProvideProvisionResponseResult.aidl b/drm/aidl/android/hardware/drm/ProvideProvisionResponseResult.aidl new file mode 100644 index 0000000000..e9f1e2b956 --- /dev/null +++ b/drm/aidl/android/hardware/drm/ProvideProvisionResponseResult.aidl @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package android.hardware.drm; + +@VintfStability +parcelable ProvideProvisionResponseResult { + /** + * The public certificate resulting from the provisioning + * operation, if any. An empty vector indicates that no + * certificate was returned. + */ + byte[] certificate; + + /** + * An opaque object containing encrypted private key material + * to be used by signRSA when computing an RSA signature on a + * message, see the signRSA method. + */ + byte[] wrappedKey; +} diff --git a/drm/aidl/android/hardware/drm/ProvisionRequest.aidl b/drm/aidl/android/hardware/drm/ProvisionRequest.aidl new file mode 100644 index 0000000000..eb42d32c87 --- /dev/null +++ b/drm/aidl/android/hardware/drm/ProvisionRequest.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.drm; + +@VintfStability +parcelable ProvisionRequest { + /** The opaque certificate request blob. */ + byte[] request; + + /** + * The URL that the provisioning request may be sent to, + * if known by the HAL implementation. An app can choose to + * override this URL. If the HAL implementation does not provide + * a defaultUrl, the returned string must be empty. + */ + String defaultUrl; +} diff --git a/drm/aidl/android/hardware/drm/SecureStop.aidl b/drm/aidl/android/hardware/drm/SecureStop.aidl new file mode 100644 index 0000000000..37cfbd39ab --- /dev/null +++ b/drm/aidl/android/hardware/drm/SecureStop.aidl @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package android.hardware.drm; + +/** + * Encapsulates a secure stop opaque object. + */ +@VintfStability +parcelable SecureStop { + byte[] opaqueData; +} diff --git a/drm/aidl/android/hardware/drm/SecureStopId.aidl b/drm/aidl/android/hardware/drm/SecureStopId.aidl new file mode 100644 index 0000000000..775e60b391 --- /dev/null +++ b/drm/aidl/android/hardware/drm/SecureStopId.aidl @@ -0,0 +1,22 @@ +/* + * 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. + */ + +package android.hardware.drm; + +@VintfStability +parcelable SecureStopId { + byte[] secureStopId; +} diff --git a/drm/aidl/android/hardware/drm/SecurityLevel.aidl b/drm/aidl/android/hardware/drm/SecurityLevel.aidl new file mode 100644 index 0000000000..aac1b686f3 --- /dev/null +++ b/drm/aidl/android/hardware/drm/SecurityLevel.aidl @@ -0,0 +1,55 @@ +/* + * 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. + */ + +package android.hardware.drm; + +@VintfStability +@Backing(type="int") +enum SecurityLevel { + /** + * Unable to determine the security level + */ + UNKNOWN, + /** + * Software-based whitebox crypto + */ + SW_SECURE_CRYPTO, + /** + * Software-based whitebox crypto and an obfuscated decoder + */ + SW_SECURE_DECODE, + /** + * DRM key management and crypto operations are performed within a + * hardware backed trusted execution environment + */ + HW_SECURE_CRYPTO, + /** + * DRM key management, crypto operations and decoding of content + * are performed within a hardware backed trusted execution environment + */ + HW_SECURE_DECODE, + /** + * DRM key management, crypto operations, decoding of content and all + * handling of the media (compressed and uncompressed) is handled within + * a hardware backed trusted execution environment. + */ + HW_SECURE_ALL, + /** + * The default security level is defined as the highest security level + * supported on the device. + */ + DEFAULT, +} diff --git a/drm/aidl/android/hardware/drm/SharedBuffer.aidl b/drm/aidl/android/hardware/drm/SharedBuffer.aidl new file mode 100644 index 0000000000..69772840ba --- /dev/null +++ b/drm/aidl/android/hardware/drm/SharedBuffer.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. + */ + +package android.hardware.drm; + +/** + * SharedBuffer describes a decrypt buffer which is defined by a bufferId, an + * offset and a size. The offset is relative to the shared memory base for the + * memory region identified by bufferId, which is established by + * setSharedMemoryBase(). + */ +@VintfStability +parcelable SharedBuffer { + /** + * The unique buffer identifier + */ + int bufferId; + /** + * The offset from the shared memory base + */ + long offset; + /** + * The size of the shared buffer in bytes + */ + long size; +} diff --git a/drm/aidl/android/hardware/drm/Status.aidl b/drm/aidl/android/hardware/drm/Status.aidl new file mode 100644 index 0000000000..ee57d64608 --- /dev/null +++ b/drm/aidl/android/hardware/drm/Status.aidl @@ -0,0 +1,221 @@ +/* + * 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. + */ + +package android.hardware.drm; + +@VintfStability +@Backing(type="int") +enum Status { + /** + * The DRM plugin must return OK when an operation completes without any + * errors. + */ + OK, + /** + * The DRM plugin must return ERROR_DRM_NO_LICENSE, when decryption is + * attempted and no license keys have been provided. + */ + ERROR_DRM_NO_LICENSE, + /** + * ERROR_DRM_LICENSE_EXPIRED must be returned when an attempt is made + * to use a license and the keys in that license have expired. + */ + ERROR_DRM_LICENSE_EXPIRED, + /** + * The DRM plugin must return ERROR_DRM_SESSION_NOT_OPENED when an + * attempt is made to use a session that has not been opened. + */ + ERROR_DRM_SESSION_NOT_OPENED, + /** + * The DRM plugin must return ERROR_DRM_CANNOT_HANDLE when an unsupported + * data format or operation is attempted. + */ + ERROR_DRM_CANNOT_HANDLE, + /** + * ERROR_DRM_INVALID_STATE must be returned when the device is in a state + * where it is not able to perform decryption. + */ + ERROR_DRM_INVALID_STATE, + /** + * The DRM plugin must return BAD_VALUE whenever an illegal parameter is + * passed to one of the interface functions. + */ + BAD_VALUE, + /** + * The DRM plugin must return ERROR_DRM_NOT_PROVISIONED from getKeyRequest, + * openSession or provideKeyResponse when the device has not yet been + * provisioned. + */ + ERROR_DRM_NOT_PROVISIONED, + /** + * ERROR_DRM_RESOURCE_BUSY must be returned when resources, such as drm + * sessions or secure buffers are not available to perform a requested + * operation because they are already in use. + */ + ERROR_DRM_RESOURCE_BUSY, + /** + * The DRM Plugin must return ERROR_DRM_INSUFFICIENT_OUTPUT_PROTECTION + * when the output protection level enabled on the device is not + * sufficient to meet the requirements in the license policy. HDCP is an + * example of a form of output protection. + */ + ERROR_DRM_INSUFFICIENT_OUTPUT_PROTECTION, + /** + * The DRM Plugin must return ERROR_DRM_DEVICE_REVOKED from + * provideProvisionResponse and provideKeyResponse if the response indicates + * that the device has been revoked. Device revocation means that the device + * is no longer permitted to play content. + */ + ERROR_DRM_DEVICE_REVOKED, + /** + * The DRM Plugin must return ERROR_DRM_DECRYPT if the CryptoPlugin + * decrypt operation fails. + */ + ERROR_DRM_DECRYPT, + /** + * ERROR_DRM_UNKNOWN must be returned when a fatal failure occurs and no + * other defined error is appropriate. + */ + ERROR_DRM_UNKNOWN, + /** + * The drm HAL module must return ERROR_DRM_INSUFFICIENT_SECURITY + * from the crypto plugin decrypt method when the security level + * of the device is not sufficient to meet the requirements in the + * license policy. + */ + ERROR_DRM_INSUFFICIENT_SECURITY, + /** + * The drm HAL module must return ERROR_FRAME_TOO_LARGE from the + * decrypt method when the frame being decrypted into the secure + * output buffer exceeds the size of the buffer. + */ + ERROR_DRM_FRAME_TOO_LARGE, + /** + * This error must be returned from any session method when an + * attempt is made to use the session after the crypto hardware + * state has been invalidated. Some devices are not able to + * retain crypto session state across device suspend/resume which + * results in invalid session state. + */ + ERROR_DRM_SESSION_LOST_STATE, + /** + * The drm HAL module must return this error if client + * applications using the hal are temporarily exceeding the + * capacity of available crypto resources such that a retry of + * the operation is likely to succeed. + */ + ERROR_DRM_RESOURCE_CONTENTION, + /** + * queueSecureInput buffer called with 0 subsamples. + */ + CANNOT_DECRYPT_ZERO_SUBSAMPLES, + /** + * An error happened within the crypto library used by the drm plugin. + */ + CRYPTO_LIBRARY_ERROR, + /** + * Non-specific error reported by the device OEM subsystem. + */ + GENERAL_OEM_ERROR, + /** + * Unexpected internal failure in the drm/crypto plugin. + */ + GENERAL_PLUGIN_ERROR, + /** + * The init data parameter passed to getKeyRequest is empty or invalid. + */ + INIT_DATA_INVALID, + /** + * Either the key was not loaded from the license before attempting the + * operation, or the key ID parameter provided by the app is incorrect. + */ + KEY_NOT_LOADED, + /** + * The license response was empty, fields are missing or otherwise unable + * to be parsed. + */ + LICENSE_PARSE_ERROR, + /** + * The operation (e.g. to renew or persist a license) is prohibited by the + * license policy. + */ + LICENSE_POLICY_ERROR, + /** + * Failed to generate a release request because a field in the stored + * license is empty or malformed. + */ + LICENSE_RELEASE_ERROR, + /** + * The license server detected an error in the license request. + */ + LICENSE_REQUEST_REJECTED, + /** + * Failed to restore an offline license because a field is empty or + * malformed. + */ + LICENSE_RESTORE_ERROR, + /** + * License is in an invalid state for the attempted operation. + */ + LICENSE_STATE_ERROR, + /** + * Certificate is malformed or is of the wrong type. + */ + MALFORMED_CERTIFICATE, + /** + * Failure in the media framework. + */ + MEDIA_FRAMEWORK_ERROR, + /** + * Certificate has not been set. + */ + MISSING_CERTIFICATE, + /** + * There was an error loading the provisioned certificate. + */ + PROVISIONING_CERTIFICATE_ERROR, + /** + * Required steps where not performed before provisioning was attempted. + */ + PROVISIONING_CONFIGURATION_ERROR, + /** + * The provisioning response was empty, fields are missing or otherwise + * unable to be parsed. + */ + PROVISIONING_PARSE_ERROR, + /** + * The provisioning server detected an error in the provisioning request. + */ + PROVISIONING_REQUEST_REJECTED, + /** + * Provisioning failed in a way that is likely to succeed on a subsequent + * attempt. + */ + RETRYABLE_PROVISIONING_ERROR, + /** + * Failed to generate a secure stop request because a field in the stored + * license is empty or malformed. + */ + SECURE_STOP_RELEASE_ERROR, + /** + * The plugin was unable to read data from the filesystem. + */ + STORAGE_READ_FAILURE, + /** + * The plugin was unable to write data to the filesystem. + */ + STORAGE_WRITE_FAILURE, +} diff --git a/drm/aidl/android/hardware/drm/SubSample.aidl b/drm/aidl/android/hardware/drm/SubSample.aidl new file mode 100644 index 0000000000..68a8fb1123 --- /dev/null +++ b/drm/aidl/android/hardware/drm/SubSample.aidl @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package android.hardware.drm; + +/** + * A subsample consists of some number of bytes of clear (unencrypted) + * data followed by a number of bytes of encrypted data. + */ +@VintfStability +parcelable SubSample { + int numBytesOfClearData; + int numBytesOfEncryptedData; +} diff --git a/drm/aidl/android/hardware/drm/Uuid.aidl b/drm/aidl/android/hardware/drm/Uuid.aidl new file mode 100644 index 0000000000..b36c409c66 --- /dev/null +++ b/drm/aidl/android/hardware/drm/Uuid.aidl @@ -0,0 +1,22 @@ +/* + * 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. + */ + +package android.hardware.drm; + +@VintfStability +parcelable Uuid { + byte[] uuid; +} -- GitLab From 070f47dd7fd64c0c979a85a65c23fe559f65a6ed Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Thu, 6 Jan 2022 22:42:10 +0000 Subject: [PATCH 394/825] Make return values of IContextHub.aidl more consistent Follow the pattern of using well-defined AIDL error codes as return values for methods. Bug: 213474931 Test: Compile, run VTS Change-Id: If04d989cf504161638ec47b2302e60cbf32db502 --- .../hardware/contexthub/IContextHub.aidl | 15 ++-- .../hardware/contexthub/IContextHub.aidl | 57 ++++++++++----- contexthub/aidl/default/ContextHub.cpp | 73 ++++++++----------- .../include/contexthub-impl/ContextHub.h | 18 ++--- .../vts/VtsAidlHalContextHubTargetTest.cpp | 58 +++++---------- 5 files changed, 104 insertions(+), 117 deletions(-) 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 facce4b65e..f0676bec74 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 @@ -35,14 +35,15 @@ package android.hardware.contexthub; @VintfStability interface IContextHub { List getContextHubs(); - boolean loadNanoapp(in int contextHubId, in android.hardware.contexthub.NanoappBinary appBinary, in int transactionId); - boolean unloadNanoapp(in int contextHubId, in long appId, in int transactionId); - boolean disableNanoapp(in int contextHubId, in long appId, in int transactionId); - boolean enableNanoapp(in int contextHubId, in long appId, in int transactionId); + void loadNanoapp(in int contextHubId, in android.hardware.contexthub.NanoappBinary appBinary, in int transactionId); + void unloadNanoapp(in int contextHubId, in long appId, in int transactionId); + void disableNanoapp(in int contextHubId, in long appId, in int transactionId); + void enableNanoapp(in int contextHubId, in long appId, in int transactionId); void onSettingChanged(in android.hardware.contexthub.Setting setting, in boolean enabled); - boolean queryNanoapps(in int contextHubId); - boolean registerCallback(in int contextHubId, in android.hardware.contexthub.IContextHubCallback cb); - boolean sendMessageToHub(in int contextHubId, in android.hardware.contexthub.ContextHubMessage message); + void queryNanoapps(in int contextHubId); + void registerCallback(in int contextHubId, in android.hardware.contexthub.IContextHubCallback cb); + void sendMessageToHub(in int contextHubId, in android.hardware.contexthub.ContextHubMessage message); void onHostEndpointConnected(in android.hardware.contexthub.HostEndpointInfo hostEndpointInfo); void onHostEndpointDisconnected(char hostEndpointId); + const int EX_CONTEXT_HUB_UNSPECIFIED = -1; } diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl index 33d241a3c3..2135041ed7 100644 --- a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl +++ b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl @@ -52,9 +52,12 @@ interface IContextHub { * @param appBinary The nanoapp binary with header * @param transactionId The transaction ID associated with this request * - * @return The return code + * @throws EX_ILLEGAL_ARGUMENT if any of the arguments are invalid. + * EX_UNSUPPORTED_OPERATION if this functionality is unsupported. + * EX_SERVICE_SPECIFIC on error + * - EX_CONTEXT_HUB_UNSPECIFIED if the request failed for other reasons. */ - boolean loadNanoapp(in int contextHubId, in NanoappBinary appBinary, in int transactionId); + void loadNanoapp(in int contextHubId, in NanoappBinary appBinary, in int transactionId); /** * Invokes the nanoapp's deinitialization "end()" entrypoint, and unloads the nanoapp. @@ -69,9 +72,12 @@ interface IContextHub { * @param appId The unique ID of the nanoapp * @param transactionId The transaction ID associated with this request * - * @return The return code + * @throws EX_ILLEGAL_ARGUMENT if any of the arguments are invalid. + * EX_UNSUPPORTED_OPERATION if this functionality is unsupported. + * EX_SERVICE_SPECIFIC on error + * - EX_CONTEXT_HUB_UNSPECIFIED if the request failed for other reasons. */ - boolean unloadNanoapp(in int contextHubId, in long appId, in int transactionId); + void unloadNanoapp(in int contextHubId, in long appId, in int transactionId); /** * Disables a nanoapp by invoking the nanoapp's "end()" entrypoint, but does not unload the @@ -87,9 +93,12 @@ interface IContextHub { * @param appId The unique ID of the nanoapp * @param transactionId The transaction ID associated with this request * - * @return The return code + * @throws EX_ILLEGAL_ARGUMENT if any of the arguments are invalid. + * EX_UNSUPPORTED_OPERATION if this functionality is unsupported. + * EX_SERVICE_SPECIFIC on error + * - EX_CONTEXT_HUB_UNSPECIFIED if the request failed for other reasons. */ - boolean disableNanoapp(in int contextHubId, in long appId, in int transactionId); + void disableNanoapp(in int contextHubId, in long appId, in int transactionId); /** * Enables a nanoapp by invoking the nanoapp's initialization "start()" entrypoint. @@ -104,9 +113,12 @@ interface IContextHub { * @param appId appIdentifier returned by the HAL * @param message message to be sent * - * @return true on success + * @throws EX_ILLEGAL_ARGUMENT if any of the arguments are invalid. + * EX_UNSUPPORTED_OPERATION if this functionality is unsupported. + * EX_SERVICE_SPECIFIC on error + * - EX_CONTEXT_HUB_UNSPECIFIED if the request failed for other reasons. */ - boolean enableNanoapp(in int contextHubId, in long appId, in int transactionId); + void enableNanoapp(in int contextHubId, in long appId, in int transactionId); /** * Notification sent by the framework to indicate that the user has changed a setting. @@ -124,9 +136,12 @@ interface IContextHub { * * @param contextHubId The identifier of the Context Hub * - * @return true on success + * @throws EX_ILLEGAL_ARGUMENT if any of the arguments are invalid. + * EX_UNSUPPORTED_OPERATION if this functionality is unsupported. + * EX_SERVICE_SPECIFIC on error + * - EX_CONTEXT_HUB_UNSPECIFIED if the request failed for other reasons. */ - boolean queryNanoapps(in int contextHubId); + void queryNanoapps(in int contextHubId); /** * Register a callback for the HAL implementation to send asynchronous messages to the service @@ -138,10 +153,11 @@ interface IContextHub { * @param contextHubId The identifier of the Context Hub * @param callback an implementation of the IContextHubCallbacks * - * @return true on success - * + * @throws EX_ILLEGAL_ARGUMENT if any of the arguments are invalid. + * EX_SERVICE_SPECIFIC on error + * - EX_CONTEXT_HUB_UNSPECIFIED if the request failed for other reasons. */ - boolean registerCallback(in int contextHubId, in IContextHubCallback cb); + void registerCallback(in int contextHubId, in IContextHubCallback cb); /** * Sends a message targeted to a nanoapp to the Context Hub. @@ -149,9 +165,11 @@ interface IContextHub { * @param contextHubId The identifier of the Context Hub * @param message The message to be sent * - * @return true on success + * @throws EX_ILLEGAL_ARGUMENT if any of the arguments are invalid. + * EX_SERVICE_SPECIFIC on error + * - EX_CONTEXT_HUB_UNSPECIFIED if the request failed for other reasons. */ - boolean sendMessageToHub(in int contextHubId, in ContextHubMessage message); + void sendMessageToHub(in int contextHubId, in ContextHubMessage message); /** * Invoked when a host endpoint has connected with the ContextHubService. @@ -173,8 +191,13 @@ interface IContextHub { * * @param hostEndPointId The ID of the host that has disconnected. * - * @return Status::ok on success - * EX_ILLEGAL_ARGUMENT if hostEndpointId is not associated with a connected host. + * @throws EX_ILLEGAL_ARGUMENT if hostEndpointId is not associated with a connected host. */ void onHostEndpointDisconnected(char hostEndpointId); + + /** + * Error codes that are used as service specific errors with the AIDL return + * value EX_SERVICE_SPECIFIC. + */ + const int EX_CONTEXT_HUB_UNSPECIFIED = -1; } diff --git a/contexthub/aidl/default/ContextHub.cpp b/contexthub/aidl/default/ContextHub.cpp index 6da690da4f..4c23cbc8bf 100644 --- a/contexthub/aidl/default/ContextHub.cpp +++ b/contexthub/aidl/default/ContextHub.cpp @@ -21,7 +21,9 @@ namespace android { namespace hardware { namespace contexthub { -::ndk::ScopedAStatus ContextHub::getContextHubs(std::vector* out_contextHubInfos) { +using ::ndk::ScopedAStatus; + +ScopedAStatus ContextHub::getContextHubs(std::vector* out_contextHubInfos) { ContextHubInfo hub = {}; hub.name = "Mock Context Hub"; hub.vendor = "AOSP"; @@ -39,85 +41,70 @@ namespace contexthub { } // We don't expose any nanoapps for the default impl, therefore all nanoapp-related APIs fail. -::ndk::ScopedAStatus ContextHub::loadNanoapp(int32_t /* in_contextHubId */, - const NanoappBinary& /* in_appBinary */, - int32_t /* in_transactionId */, bool* _aidl_return) { - *_aidl_return = false; - return ndk::ScopedAStatus::ok(); +ScopedAStatus ContextHub::loadNanoapp(int32_t /* in_contextHubId */, + const NanoappBinary& /* in_appBinary */, + int32_t /* in_transactionId */) { + return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } -::ndk::ScopedAStatus ContextHub::unloadNanoapp(int32_t /* in_contextHubId */, - int64_t /* in_appId */, - int32_t /* in_transactionId */, bool* _aidl_return) { - *_aidl_return = false; - return ndk::ScopedAStatus::ok(); +ScopedAStatus ContextHub::unloadNanoapp(int32_t /* in_contextHubId */, int64_t /* in_appId */, + int32_t /* in_transactionId */) { + return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } -::ndk::ScopedAStatus ContextHub::disableNanoapp(int32_t /* in_contextHubId */, - int64_t /* in_appId */, - int32_t /* in_transactionId */, - bool* _aidl_return) { - *_aidl_return = false; - return ndk::ScopedAStatus::ok(); +ScopedAStatus ContextHub::disableNanoapp(int32_t /* in_contextHubId */, int64_t /* in_appId */, + int32_t /* in_transactionId */) { + return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } -::ndk::ScopedAStatus ContextHub::enableNanoapp(int32_t /* in_contextHubId */, - int64_t /* in_appId */, - int32_t /* in_transactionId */, bool* _aidl_return) { - *_aidl_return = false; - return ndk::ScopedAStatus::ok(); +ScopedAStatus ContextHub::enableNanoapp(int32_t /* in_contextHubId */, int64_t /* in_appId */, + int32_t /* in_transactionId */) { + return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } -::ndk::ScopedAStatus ContextHub::onSettingChanged(Setting /* in_setting */, bool /*in_enabled */) { +ScopedAStatus ContextHub::onSettingChanged(Setting /* in_setting */, bool /*in_enabled */) { return ndk::ScopedAStatus::ok(); } -::ndk::ScopedAStatus ContextHub::queryNanoapps(int32_t in_contextHubId, bool* _aidl_return) { +ScopedAStatus ContextHub::queryNanoapps(int32_t in_contextHubId) { if (in_contextHubId == kMockHubId && mCallback != nullptr) { std::vector nanoapps; mCallback->handleNanoappInfo(nanoapps); - *_aidl_return = true; + return ndk::ScopedAStatus::ok(); } else { - *_aidl_return = false; + return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } - - return ndk::ScopedAStatus::ok(); } -::ndk::ScopedAStatus ContextHub::registerCallback(int32_t in_contextHubId, - const std::shared_ptr& in_cb, - bool* _aidl_return) { +ScopedAStatus ContextHub::registerCallback(int32_t in_contextHubId, + const std::shared_ptr& in_cb) { if (in_contextHubId == kMockHubId) { mCallback = in_cb; - *_aidl_return = true; + return ndk::ScopedAStatus::ok(); } else { - *_aidl_return = false; + return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } - return ndk::ScopedAStatus::ok(); } -::ndk::ScopedAStatus ContextHub::sendMessageToHub(int32_t in_contextHubId, - const ContextHubMessage& /* in_message */, - bool* _aidl_return) { +ScopedAStatus ContextHub::sendMessageToHub(int32_t in_contextHubId, + const ContextHubMessage& /* in_message */) { if (in_contextHubId == kMockHubId) { // 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. - *_aidl_return = true; + return ndk::ScopedAStatus::ok(); } else { - *_aidl_return = false; + return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } - - return ndk::ScopedAStatus::ok(); } -::ndk::ScopedAStatus ContextHub::onHostEndpointConnected(const HostEndpointInfo& in_info) { +ScopedAStatus ContextHub::onHostEndpointConnected(const HostEndpointInfo& in_info) { mConnectedHostEndpoints.insert(in_info.hostEndpointId); return ndk::ScopedAStatus::ok(); } -::ndk::ScopedAStatus ContextHub::onHostEndpointDisconnected(char16_t in_hostEndpointId) { +ScopedAStatus ContextHub::onHostEndpointDisconnected(char16_t in_hostEndpointId) { if (mConnectedHostEndpoints.count(in_hostEndpointId) > 0) { mConnectedHostEndpoints.erase(in_hostEndpointId); return ndk::ScopedAStatus::ok(); diff --git a/contexthub/aidl/default/include/contexthub-impl/ContextHub.h b/contexthub/aidl/default/include/contexthub-impl/ContextHub.h index dd739e63f8..03d8432134 100644 --- a/contexthub/aidl/default/include/contexthub-impl/ContextHub.h +++ b/contexthub/aidl/default/include/contexthub-impl/ContextHub.h @@ -28,21 +28,19 @@ namespace contexthub { class ContextHub : public BnContextHub { ::ndk::ScopedAStatus getContextHubs(std::vector* out_contextHubInfos) override; ::ndk::ScopedAStatus loadNanoapp(int32_t in_contextHubId, const NanoappBinary& in_appBinary, - int32_t in_transactionId, bool* _aidl_return) override; + int32_t in_transactionId) override; ::ndk::ScopedAStatus unloadNanoapp(int32_t in_contextHubId, int64_t in_appId, - int32_t in_transactionId, bool* _aidl_return) override; + int32_t in_transactionId) override; ::ndk::ScopedAStatus disableNanoapp(int32_t in_contextHubId, int64_t in_appId, - int32_t in_transactionId, bool* _aidl_return) override; + int32_t in_transactionId) override; ::ndk::ScopedAStatus enableNanoapp(int32_t in_contextHubId, int64_t in_appId, - int32_t in_transactionId, bool* _aidl_return) override; + int32_t in_transactionId) override; ::ndk::ScopedAStatus onSettingChanged(Setting in_setting, bool in_enabled) override; - ::ndk::ScopedAStatus queryNanoapps(int32_t in_contextHubId, bool* _aidl_return) override; - ::ndk::ScopedAStatus registerCallback(int32_t in_contextHubId, - const std::shared_ptr& in_cb, - bool* _aidl_return) override; + ::ndk::ScopedAStatus queryNanoapps(int32_t in_contextHubId) override; + ::ndk::ScopedAStatus registerCallback( + int32_t in_contextHubId, const std::shared_ptr& in_cb) override; ::ndk::ScopedAStatus sendMessageToHub(int32_t in_contextHubId, - const ContextHubMessage& in_message, - bool* _aidl_return) override; + const ContextHubMessage& in_message) override; ::ndk::ScopedAStatus onHostEndpointConnected(const HostEndpointInfo& in_info) override; ::ndk::ScopedAStatus onHostEndpointDisconnected(char16_t in_hostEndpointId) override; diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp index 392e23c9c1..a47f64e5be 100644 --- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp +++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp @@ -103,15 +103,12 @@ class EmptyContextHubCallback : public android::hardware::contexthub::BnContextH }; TEST_P(ContextHubAidl, TestRegisterCallback) { - bool success; sp cb = sp::make(); - ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb, &success).isOk()); - ASSERT_TRUE(success); + ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb).isOk()); } TEST_P(ContextHubAidl, TestRegisterNullCallback) { - bool success; - ASSERT_TRUE(contextHub->registerCallback(getHubId(), nullptr, &success).isOk()); + ASSERT_TRUE(contextHub->registerCallback(getHubId(), nullptr).isOk()); } // Helper callback that puts the async appInfo callback data into a promise @@ -140,12 +137,8 @@ class QueryAppsCallback : public android::hardware::contexthub::BnContextHubCall // Calls queryApps() and checks the returned metadata TEST_P(ContextHubAidl, TestQueryApps) { sp cb = sp::make(); - bool success; - ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb, &success).isOk()); - ASSERT_TRUE(success); - - ASSERT_TRUE(contextHub->queryNanoapps(getHubId(), &success).isOk()); - ASSERT_TRUE(success); + ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb).isOk()); + ASSERT_TRUE(contextHub->queryNanoapps(getHubId()).isOk()); std::vector appInfoList; ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &appInfoList)); @@ -197,9 +190,7 @@ class ContextHubTransactionTest : public ContextHubAidl { public: virtual void SetUp() override { ContextHubAidl::SetUp(); - bool success; - ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb, &success).isOk()); - ASSERT_TRUE(success); + ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb).isOk()); } sp cb = sp::make(); @@ -213,9 +204,7 @@ TEST_P(ContextHubTransactionTest, TestSendMessageToNonExistentNanoapp) { std::fill(message.messageBody.begin(), message.messageBody.end(), 0); ALOGD("Sending message to non-existent nanoapp"); - bool success; - ASSERT_TRUE(contextHub->sendMessageToHub(getHubId(), message, &success).isOk()); - ASSERT_TRUE(success); + ASSERT_TRUE(contextHub->sendMessageToHub(getHubId(), message).isOk()); } TEST_P(ContextHubTransactionTest, TestLoadEmptyNanoapp) { @@ -229,9 +218,7 @@ TEST_P(ContextHubTransactionTest, TestLoadEmptyNanoapp) { emptyApp.targetChreApiMinorVersion = 0; ALOGD("Loading empty nanoapp"); - bool success; - ASSERT_TRUE(contextHub->loadNanoapp(getHubId(), emptyApp, cb->expectedTransactionId, &success) - .isOk()); + bool success = contextHub->loadNanoapp(getHubId(), emptyApp, cb->expectedTransactionId).isOk(); if (success) { bool transactionSuccess; ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &transactionSuccess)); @@ -243,11 +230,9 @@ TEST_P(ContextHubTransactionTest, TestUnloadNonexistentNanoapp) { cb->expectedTransactionId = 1234; ALOGD("Unloading nonexistent nanoapp"); - bool success; - ASSERT_TRUE(contextHub - ->unloadNanoapp(getHubId(), kNonExistentAppId, cb->expectedTransactionId, - &success) - .isOk()); + bool success = + contextHub->unloadNanoapp(getHubId(), kNonExistentAppId, cb->expectedTransactionId) + .isOk(); if (success) { bool transactionSuccess; ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &transactionSuccess)); @@ -259,11 +244,9 @@ TEST_P(ContextHubTransactionTest, TestEnableNonexistentNanoapp) { cb->expectedTransactionId = 2345; ALOGD("Enabling nonexistent nanoapp"); - bool success; - ASSERT_TRUE(contextHub - ->enableNanoapp(getHubId(), kNonExistentAppId, cb->expectedTransactionId, - &success) - .isOk()); + bool success = + contextHub->enableNanoapp(getHubId(), kNonExistentAppId, cb->expectedTransactionId) + .isOk(); if (success) { bool transactionSuccess; ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &transactionSuccess)); @@ -275,11 +258,9 @@ TEST_P(ContextHubTransactionTest, TestDisableNonexistentNanoapp) { cb->expectedTransactionId = 3456; ALOGD("Disabling nonexistent nanoapp"); - bool success; - ASSERT_TRUE(contextHub - ->disableNanoapp(getHubId(), kNonExistentAppId, cb->expectedTransactionId, - &success) - .isOk()); + bool success = + contextHub->disableNanoapp(getHubId(), kNonExistentAppId, cb->expectedTransactionId) + .isOk(); if (success) { bool transactionSuccess; ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &transactionSuccess)); @@ -290,16 +271,13 @@ TEST_P(ContextHubTransactionTest, TestDisableNonexistentNanoapp) { void ContextHubAidl::testSettingChanged(Setting setting) { // In VTS, we only test that sending the values doesn't cause things to blow up - GTS tests // verify the expected E2E behavior in CHRE - bool success; sp cb = sp::make(); - ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb, &success).isOk()); - ASSERT_TRUE(success); + ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb).isOk()); ASSERT_TRUE(contextHub->onSettingChanged(setting, true /* enabled */).isOk()); ASSERT_TRUE(contextHub->onSettingChanged(setting, false /* enabled */).isOk()); - ASSERT_TRUE(contextHub->registerCallback(getHubId(), nullptr, &success).isOk()); - ASSERT_TRUE(success); + ASSERT_TRUE(contextHub->registerCallback(getHubId(), nullptr).isOk()); } TEST_P(ContextHubAidl, TestOnLocationSettingChanged) { -- GitLab From 536f04e354c055a60be2e19c52b579730dc50582 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Tue, 4 Jan 2022 13:33:11 -0500 Subject: [PATCH 395/825] Add LayerCommand.blockingRegion This hint tells the HWC that it may use a blocking feature to skip a portion of the layer's buffer. Bug: 212736475 Test: TODO (b/213361853) Change-Id: Ib0fa41e56196feeff201637d5599830d2565da2b --- .../hardware/graphics/composer3/LayerCommand.aidl | 1 + .../hardware/graphics/composer3/LayerCommand.aidl | 11 +++++++++++ .../graphics/composer3/ComposerClientWriter.h | 4 ++++ 3 files changed, 16 insertions(+) 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 ab77880daf..ac080ddab4 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 @@ -54,4 +54,5 @@ parcelable LayerCommand { @nullable android.hardware.graphics.composer3.WhitePointNits whitePointNits; @nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata; @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob; + @nullable android.hardware.graphics.common.Rect[] blockingRegion; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index 44fd4dcb9a..f9ae28ee6e 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl @@ -264,4 +264,15 @@ parcelable LayerCommand { * This command may be called every frame. */ @nullable PerFrameMetadataBlob[] perFrameMetadataBlob; + + /** + * Specifies a region of the layer that is transparent and may be skipped + * by the DPU, e.g. using a blocking region, in order to save power. This + * is only a hint, so the composition of the layer must look the same + * whether or not this region is skipped. + * + * The region is in screen space and must not exceed the dimensions of + * the screen. + */ + @nullable Rect[] blockingRegion; } 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 16d63e57ca..128bc1a095 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -213,6 +213,10 @@ class ComposerClientWriter { .whitePointNits.emplace(WhitePointNits{.nits = whitePointNits}); } + void setLayerBlockingRegion(int64_t display, int64_t layer, const std::vector& blocking) { + getLayerCommand(display, layer).blockingRegion.emplace(blocking.begin(), blocking.end()); + } + const std::vector& getPendingCommands() { flushLayerCommand(); flushDisplayCommand(); -- GitLab From bc1c7438327559d6985841ca82b58c841809b17e Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Thu, 9 Dec 2021 18:48:20 -0800 Subject: [PATCH 396/825] Cleanup to composer apis for HDR: 1. Remove the setDisplayBrightness method, as it's been moved to a display command 2. Rename the WhitePointNits stable stuct to Luminance, since it's a more general descriptor. Bug: 210151839 Test: builds Change-Id: Ic948dce737ce718772100b0e976ec93069d5e8e1 --- .../graphics/composer3/IComposerClient.aidl | 1 - .../graphics/composer3/LayerCommand.aidl | 2 +- .../{WhitePointNits.aidl => Luminance.aidl} | 2 +- .../graphics/composer3/IComposerClient.aidl | 19 ------------------- .../graphics/composer3/LayerCommand.aidl | 4 ++-- .../{WhitePointNits.aidl => Luminance.aidl} | 9 +++------ .../graphics/composer3/ComposerClientWriter.h | 5 ++--- 7 files changed, 9 insertions(+), 33 deletions(-) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{WhitePointNits.aidl => Luminance.aidl} (98%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{WhitePointNits.aidl => Luminance.aidl} (66%) 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 2d17e0fdea..e9d9745dff 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 @@ -65,7 +65,6 @@ interface IComposerClient { void setClientTargetSlotCount(long display, int clientTargetSlotCount); void setColorMode(long display, android.hardware.graphics.composer3.ColorMode mode, android.hardware.graphics.composer3.RenderIntent intent); void setContentType(long display, android.hardware.graphics.composer3.ContentType type); - void setDisplayBrightness(long display, float brightness); void setDisplayedContentSamplingEnabled(long display, boolean enable, android.hardware.graphics.composer3.FormatColorComponent componentMask, long maxFrames); void setPowerMode(long display, android.hardware.graphics.composer3.PowerMode mode); void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, in @nullable ParcelFileDescriptor releaseFence); 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 ab77880daf..7e6c00b1f5 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 @@ -51,7 +51,7 @@ parcelable LayerCommand { @nullable android.hardware.graphics.common.Rect[] visibleRegion; @nullable android.hardware.graphics.composer3.ZOrder z; @nullable float[] colorTransform; - @nullable android.hardware.graphics.composer3.WhitePointNits whitePointNits; + @nullable android.hardware.graphics.composer3.Luminance whitePointNits; @nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata; @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Luminance.aidl similarity index 98% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Luminance.aidl index c3925d2153..adb49a81b4 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Luminance.aidl @@ -33,6 +33,6 @@ package android.hardware.graphics.composer3; @VintfStability -parcelable WhitePointNits { +parcelable Luminance { float nits; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index ab7f39781e..3ab6329bff 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -615,25 +615,6 @@ interface IComposerClient { */ void setContentType(long display, ContentType type); - /** - * Sets the brightness of a display. - * - * Ideally, the brightness change should take effect in the next frame post (so that it can be - * aligned with color transforms). - * - * @param display - * The display whose brightness is set. - * @param brightness - * A number between 0.0f (minimum brightness) and 1.0f (maximum brightness), or -1.0 to - * turn the backlight off. - * - * @exception EX_BAD_DISPLAY when the display is invalid, or - * @exception EX_UNSUPPORTED when brightness operations are not supported, or - * @exception EX_BAD_PARAMETER when the brightness is invalid, or - * @exception EX_NO_RESOURCES when the brightness cannot be applied. - */ - void setDisplayBrightness(long display, float brightness); - /** * Enables or disables the collection of color content statistics * on this display. diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index 44fd4dcb9a..fa2d154c9b 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.common.Rect; import android.hardware.graphics.composer3.Buffer; import android.hardware.graphics.composer3.Color; import android.hardware.graphics.composer3.FloatColor; +import android.hardware.graphics.composer3.Luminance; import android.hardware.graphics.composer3.ParcelableBlendMode; import android.hardware.graphics.composer3.ParcelableComposition; import android.hardware.graphics.composer3.ParcelableDataspace; @@ -30,7 +31,6 @@ import android.hardware.graphics.composer3.ParcelableTransform; import android.hardware.graphics.composer3.PerFrameMetadata; import android.hardware.graphics.composer3.PerFrameMetadataBlob; import android.hardware.graphics.composer3.PlaneAlpha; -import android.hardware.graphics.composer3.WhitePointNits; import android.hardware.graphics.composer3.ZOrder; @VintfStability @@ -243,7 +243,7 @@ parcelable LayerCommand { * brightness in nits, and accordingly SDR content shall be dimmed to the desired white point * provided. */ - @nullable WhitePointNits whitePointNits; + @nullable Luminance whitePointNits; /** * Sets the PerFrameMetadata for the display. This metadata must be used diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Luminance.aidl similarity index 66% rename from graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/Luminance.aidl index 2a1d1c666c..5b1c1b40fe 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Luminance.aidl @@ -17,13 +17,10 @@ package android.hardware.graphics.composer3; @VintfStability -parcelable WhitePointNits { +parcelable Luminance { /** - * The desired white point for the layer. This is intended to be used when presenting - * an SDR layer alongside HDR content. The HDR content will be presented at the display - * brightness in nits, and accordingly SDR content shall be dimmed to the desired white point - * provided. - * @see LayerCommand.whitePointNits. + * Photometric measure of luminous intensity per unit area of light. + * Units are nits, or cd/m^2. */ float nits; } 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 b202b34c64..2d927cdae4 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -31,9 +31,9 @@ #include #include #include +#include #include #include -#include #include @@ -215,8 +215,7 @@ class ComposerClientWriter { } void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) { - getLayerCommand(display, layer) - .whitePointNits.emplace(WhitePointNits{.nits = whitePointNits}); + getLayerCommand(display, layer).whitePointNits.emplace(Luminance{.nits = whitePointNits}); } const std::vector& getPendingCommands() { -- GitLab From 494ba666ac41fb44d6beeb12d743daa171e1c26f Mon Sep 17 00:00:00 2001 From: Hongguang Date: Wed, 5 Jan 2022 22:08:10 -0800 Subject: [PATCH 397/825] Add CRC32 checking hint. Bug: 172985025 Test: atest VtsHalTvTunerTargetTest Change-Id: Ie26cfee7ba0254fe20e485cd173e65d391f7a254 --- .../hardware/tv/tuner/DemuxFilterSectionSettings.aidl | 1 + .../hardware/tv/tuner/DemuxFilterSectionSettings.aidl | 10 +++++++++- tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h | 1 + tv/tuner/config/api/current.txt | 2 ++ .../config/tuner_testing_dynamic_configuration.xsd | 1 + 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl index 2858565099..7936e59001 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl @@ -39,4 +39,5 @@ parcelable DemuxFilterSectionSettings { boolean isCheckCrc; boolean isRepeat; boolean isRaw; + int bitWidthOfLengthField; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl index f6788ee131..aa30175823 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl @@ -19,7 +19,7 @@ package android.hardware.tv.tuner; import android.hardware.tv.tuner.DemuxFilterSectionSettingsCondition; /** - * Filter Settings for Section data according to ISO/IEC 13818-1. + * Filter Settings for Section data according to ISO/IEC 13818-1 and ISO/IEC 23008-1. * @hide */ @VintfStability @@ -49,4 +49,12 @@ parcelable DemuxFilterSectionSettings { * true if the filter send onFilterStatus instead of onFilterEvent. */ boolean isRaw; + + /** + * The bit width of the MMTP (MPEG Media Transport Protocol) section message's length field + * according to ISO/IEC 23008-1. + * + * The filter uses this for CRC checking when isCheckCrc is true. + */ + int bitWidthOfLengthField; } diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h index b6cc5f80b0..b73d59411b 100644 --- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h +++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h @@ -954,6 +954,7 @@ struct TunerTestingConfigAidlReader1_0 { settings.isCheckCrc = section->getIsCheckCrc(); settings.isRepeat = section->getIsRepeat(); settings.isRaw = section->getIsRaw(); + settings.bitWidthOfLengthField = section->getBitWidthOfLengthField(); return settings; } diff --git a/tv/tuner/config/api/current.txt b/tv/tuner/config/api/current.txt index db1d076e10..4d519d7cb5 100644 --- a/tv/tuner/config/api/current.txt +++ b/tv/tuner/config/api/current.txt @@ -477,9 +477,11 @@ package android.media.tuner.testing.configuration.V1_0 { public class SectionFilterSettings { ctor public SectionFilterSettings(); + method @Nullable public java.math.BigInteger getBitWidthOfLengthField(); method @Nullable public boolean getIsCheckCrc(); method @Nullable public boolean getIsRaw(); method @Nullable public boolean getIsRepeat(); + method public void setBitWidthOfLengthField(@Nullable java.math.BigInteger); method public void setIsCheckCrc(@Nullable boolean); method public void setIsRaw(@Nullable boolean); method public void setIsRepeat(@Nullable boolean); diff --git a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd index 54cedfcf6b..94f108b43a 100644 --- a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd +++ b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd @@ -226,6 +226,7 @@ + -- GitLab From df084f35fc18077b4e6026e8708a64e842d611c9 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Mon, 10 Jan 2022 14:10:23 -0800 Subject: [PATCH 398/825] composer: deflake Test_expectedPresentTime Test_expectedPresentTime might fail due to scheduling delays. To avoid that, we test that the actual presentation didn't happen too early, but we allow for a late presentation. Bug: 198186194 Test: VTS Change-Id: I9be4bfe5a848443e69ef7b62ffb3dae675a9b81f --- .../vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index a591aaa67d..24b742e80c 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1426,8 +1426,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { presentFence2->waitForever(LOG_TAG); const auto actualPresentTime = presentFence2->getSignalTime(); - const auto presentError = std::abs(expectedPresentTime - actualPresentTime); - EXPECT_LE(presentError, vsyncPeriod / 2); + EXPECT_GE(actualPresentTime, expectedPresentTime - vsyncPeriod / 2); ASSERT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk()); } -- GitLab From faeb133031e13da5f71f2d1d2ec37d52a1e16f8d Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 22 Dec 2021 16:17:02 +0800 Subject: [PATCH 399/825] wifi: add certificate HAL callback for Trust On First Use support This API is used to pass the certificate returned from the server to the framework. Bug: 196180536 Test: atest VtsHalWifiSupplicantStaIfaceTargetTest \ VtsHalWifiSupplicantStaNetworkTargetTest \ VtsHalWifiSupplicantP2pIfaceTargetTest Change-Id: I462008e8b2a0f18824b2886613f300213544c785 --- .../wifi/supplicant/ISupplicantStaNetworkCallback.aidl | 1 + .../wifi/supplicant/WpaDriverCapabilitiesMask.aidl | 1 + .../wifi/supplicant/ISupplicantStaNetworkCallback.aidl | 9 +++++++++ .../wifi/supplicant/WpaDriverCapabilitiesMask.aidl | 4 ++++ .../vts/functional/supplicant_sta_network_aidl_test.cpp | 6 ++++++ 5 files changed, 21 insertions(+) diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl index 4f7584d938..6276a3521b 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl @@ -38,4 +38,5 @@ interface ISupplicantStaNetworkCallback { oneway void onNetworkEapSimGsmAuthRequest(in android.hardware.wifi.supplicant.NetworkRequestEapSimGsmAuthParams params); oneway void onNetworkEapSimUmtsAuthRequest(in android.hardware.wifi.supplicant.NetworkRequestEapSimUmtsAuthParams params); oneway void onTransitionDisable(in android.hardware.wifi.supplicant.TransitionDisableIndication ind); + oneway void onServerCertificateAvailable(in int depth, in byte[] subject, in byte[] certHash, in byte[] certBlob); } 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 43772af0c0..9a0a924c66 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 @@ -38,4 +38,5 @@ enum WpaDriverCapabilitiesMask { OCE = 2, SAE_PK = 4, WFD_R2 = 8, + TRUST_ON_FIRST_USE = 16, } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl index c28b494d6a..4024c35fed 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl @@ -62,4 +62,13 @@ interface ISupplicantStaNetworkCallback { * Used to notify WPA3 transition disable. */ oneway void onTransitionDisable(in TransitionDisableIndication ind); + + /** + * Used to notify EAP certificate event. + * + * On receiving a server certifidate from TLS handshake, send this certificate + * to the framework for Trust On First Use. + */ + oneway void onServerCertificateAvailable( + in int depth, in byte[] subject, in byte[] certHash, in byte[] certBlob); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl index e174199c78..08006cffba 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl @@ -38,4 +38,8 @@ enum WpaDriverCapabilitiesMask { * Wi-Fi Display R2 */ WFD_R2 = 1 << 3, + /** + * Trust On First Use + */ + TRUST_ON_FIRST_USE = 1 << 4, } 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 66c88073cc..26cf817c68 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 @@ -92,6 +92,12 @@ class SupplicantStaNetworkCallback : public BnSupplicantStaNetworkCallback { TransitionDisableIndication /* ind */) override { return ndk::ScopedAStatus::ok(); } + ::ndk::ScopedAStatus onServerCertificateAvailable( + int32_t /* depth */, const std::vector& /* subject */, + const std::vector& /* certHash */, + const std::vector& /* certBlob */) override { + return ndk::ScopedAStatus::ok(); + } }; class SupplicantStaNetworkAidlTest -- GitLab From 4596369b26016adbb2fffc3d832bad3d45aeae9a Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Thu, 6 Jan 2022 16:12:57 -0800 Subject: [PATCH 400/825] composer: remove FloatColor Currently not used. Bug: 207139550 Test: VTS Change-Id: I190382a7e72bd07b84a44f22f7b4b8b39b961355 --- .../graphics/composer3/FloatColor.aidl | 41 ------------------- .../graphics/composer3/LayerCommand.aidl | 1 - .../graphics/composer3/FloatColor.aidl | 29 ------------- .../graphics/composer3/Hidl2AidlAsserts.cpp | 1 - .../graphics/composer3/LayerCommand.aidl | 8 ---- .../graphics/composer3/ComposerClientWriter.h | 5 --- 6 files changed, 85 deletions(-) delete mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FloatColor.aidl delete mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/FloatColor.aidl diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FloatColor.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FloatColor.aidl deleted file mode 100644 index faadf575d1..0000000000 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FloatColor.aidl +++ /dev/null @@ -1,41 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.graphics.composer3; -@VintfStability -parcelable FloatColor { - float r; - float g; - float b; - float a; -} 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 7e6c00b1f5..49fbededf8 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 @@ -40,7 +40,6 @@ parcelable LayerCommand { @nullable android.hardware.graphics.common.Rect[] damage; @nullable android.hardware.graphics.composer3.ParcelableBlendMode blendMode; @nullable android.hardware.graphics.composer3.Color color; - @nullable android.hardware.graphics.composer3.FloatColor floatColor; @nullable android.hardware.graphics.composer3.ParcelableComposition composition; @nullable android.hardware.graphics.composer3.ParcelableDataspace dataspace; @nullable android.hardware.graphics.common.Rect displayFrame; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/FloatColor.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/FloatColor.aidl deleted file mode 100644 index a0a1d4b179..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/FloatColor.aidl +++ /dev/null @@ -1,29 +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. - */ - -package android.hardware.graphics.composer3; - -/** - * Color representation as a floating point number in the range [0.0 - 1.0] - */ - -@VintfStability -parcelable FloatColor { - float r; - float g; - float b; - float a; -} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp index d34b4051fa..d2cabff346 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp @@ -25,7 +25,6 @@ #include "aidl/android/hardware/graphics/composer3/DisplayAttribute.h" #include "aidl/android/hardware/graphics/composer3/DisplayCapability.h" #include "aidl/android/hardware/graphics/composer3/DisplayConnectionType.h" -#include "aidl/android/hardware/graphics/composer3/FloatColor.h" #include "aidl/android/hardware/graphics/composer3/FormatColorComponent.h" #include "aidl/android/hardware/graphics/composer3/IComposer.h" #include "aidl/android/hardware/graphics/composer3/PerFrameMetadata.h" diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index fa2d154c9b..e481d12c01 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl @@ -22,7 +22,6 @@ import android.hardware.graphics.common.Point; import android.hardware.graphics.common.Rect; import android.hardware.graphics.composer3.Buffer; import android.hardware.graphics.composer3.Color; -import android.hardware.graphics.composer3.FloatColor; import android.hardware.graphics.composer3.Luminance; import android.hardware.graphics.composer3.ParcelableBlendMode; import android.hardware.graphics.composer3.ParcelableComposition; @@ -113,13 +112,6 @@ parcelable LayerCommand { */ @nullable Color color; - /** - * Sets the color of the given layer. If the composition type of the layer - * is not Composition.SOLID_COLOR, this call must succeed and have no - * other effect. - */ - @nullable FloatColor floatColor; - /** * Sets the desired composition type of the given layer. During * validateDisplay, the device may request changes to the composition 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 2d927cdae4..b2776d6517 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -210,10 +209,6 @@ class ComposerClientWriter { .perFrameMetadataBlob.emplace(metadata.begin(), metadata.end()); } - void setLayerFloatColor(int64_t display, int64_t layer, FloatColor color) { - getLayerCommand(display, layer).floatColor.emplace(color); - } - void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) { getLayerCommand(display, layer).whitePointNits.emplace(Luminance{.nits = whitePointNits}); } -- GitLab From 1bee7abe605ba79a7db6e11de8f8ad68c7053270 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Thu, 6 Jan 2022 17:22:08 -0800 Subject: [PATCH 401/825] composer: Color.aidl should use floats Color is represented as a float [0.0 - 1.0] in the upper part of the stack, so make composer3 interface consistent. Bug: 207139550 Test: VTS Change-Id: Ic14288b5c87ff5cccfc9a0756d2630b8715759f7 --- .../hardware/graphics/composer3/Color.aidl | 8 ++-- .../hardware/graphics/composer3/Color.aidl | 11 ++++-- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 39 ++++++++----------- .../VtsHalGraphicsComposer3_TargetTest.cpp | 6 +-- .../functional/composer-vts/ReadbackVts.cpp | 26 +++++-------- .../composer-vts/include/ReadbackVts.h | 13 +++---- 6 files changed, 46 insertions(+), 57 deletions(-) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Color.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Color.aidl index 7733debc9e..822290908e 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Color.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Color.aidl @@ -34,8 +34,8 @@ package android.hardware.graphics.composer3; @VintfStability parcelable Color { - byte r; - byte g; - byte b; - byte a; + float r; + float g; + float b; + float a; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Color.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Color.aidl index 979f677379..151a8540c9 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Color.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Color.aidl @@ -16,10 +16,13 @@ package android.hardware.graphics.composer3; +/** + * Color representation as a floating point number in the range [0.0 - 1.0] + */ @VintfStability parcelable Color { - byte r; - byte g; - byte b; - byte a; + float r; + float g; + float b; + float a; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 0ece1d55a4..e519221159 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -922,35 +922,30 @@ class GraphicsBlendModeCompositionTest auto layer = mLayers[1]; BlendMode blendMode = layer->getBlendMode(); - float alpha = mTopLayerColor.a / 255.0f * layer->getAlpha(); + float alpha = mTopLayerColor.a * layer->getAlpha(); if (blendMode == BlendMode::NONE) { for (auto& expectedColor : expectedColors) { - expectedColor.r = mTopLayerColor.r * static_cast(layer->getAlpha()); - expectedColor.g = mTopLayerColor.g * static_cast(layer->getAlpha()); - expectedColor.b = mTopLayerColor.b * static_cast(layer->getAlpha()); - expectedColor.a = static_cast(alpha * 255.0); + expectedColor.r = mTopLayerColor.r * layer->getAlpha(); + expectedColor.g = mTopLayerColor.g * layer->getAlpha(); + expectedColor.b = mTopLayerColor.b * layer->getAlpha(); + expectedColor.a = alpha; } } else if (blendMode == BlendMode::PREMULTIPLIED) { for (auto& expectedColor : expectedColors) { - expectedColor.r = static_cast( - mTopLayerColor.r * static_cast(layer->getAlpha()) + - mBackgroundColor.r * (1.0 - alpha)); - expectedColor.g = static_cast(mTopLayerColor.g * layer->getAlpha() + - mBackgroundColor.g * (1.0 - alpha)); - expectedColor.b = static_cast(mTopLayerColor.b * layer->getAlpha() + - mBackgroundColor.b * (1.0 - alpha)); - expectedColor.a = static_cast(alpha + mBackgroundColor.a * (1.0 - alpha)); + expectedColor.r = + mTopLayerColor.r * layer->getAlpha() + mBackgroundColor.r * (1.0f - alpha); + expectedColor.g = + mTopLayerColor.g * layer->getAlpha() + mBackgroundColor.g * (1.0f - alpha); + expectedColor.b = + mTopLayerColor.b * layer->getAlpha() + mBackgroundColor.b * (1.0f - alpha); + expectedColor.a = alpha + mBackgroundColor.a * (1.0f - alpha); } } else if (blendMode == BlendMode::COVERAGE) { for (auto& expectedColor : expectedColors) { - expectedColor.r = static_cast(mTopLayerColor.r * alpha + - mBackgroundColor.r * (1.0 - alpha)); - expectedColor.g = static_cast(mTopLayerColor.g * alpha + - mBackgroundColor.g * (1.0 - alpha)); - expectedColor.b = static_cast(mTopLayerColor.b * alpha + - mBackgroundColor.b * (1.0 - alpha)); - expectedColor.a = static_cast(mTopLayerColor.a * alpha + - mBackgroundColor.a * (1.0 - alpha)); + expectedColor.r = mTopLayerColor.r * alpha + mBackgroundColor.r * (1.0f - alpha); + expectedColor.g = mTopLayerColor.g * alpha + mBackgroundColor.g * (1.0f - alpha); + expectedColor.b = mTopLayerColor.b * alpha + mBackgroundColor.b * (1.0f - alpha); + expectedColor.a = mTopLayerColor.a * alpha + mBackgroundColor.a * (1.0f - alpha); } } } @@ -1083,7 +1078,7 @@ class GraphicsTransformCompositionTest : public GraphicsCompositionTest { GraphicsCompositionTest::SetUp(); auto backgroundLayer = std::make_shared(mComposerClient, mPrimaryDisplay); - backgroundLayer->setColor({0, 0, 0, 0}); + backgroundLayer->setColor({0.0f, 0.0f, 0.0f, 0.0f}); backgroundLayer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); backgroundLayer->setZOrder(0); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index a591aaa67d..c61693e458 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1720,13 +1720,11 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_COLOR) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter.setLayerColor(mPrimaryDisplay, layer, - Color{static_cast(0xff), static_cast(0xff), - static_cast(0xff), static_cast(0xff)}); + mWriter.setLayerColor(mPrimaryDisplay, layer, Color{1.0f, 1.0f, 1.0f, 1.0f}); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerColor(mPrimaryDisplay, layer, Color{0, 0, 0, 0}); + mWriter.setLayerColor(mPrimaryDisplay, layer, Color{0.0f, 0.0f, 0.0f, 0.0f}); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp index 5eb912bb3f..deb5ac3106 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp @@ -131,12 +131,12 @@ void ReadbackHelper::fillBuffer(uint32_t width, uint32_t height, uint32_t stride int offset = (row * static_cast(stride) + col) * bytesPerPixel; uint8_t* pixelColor = (uint8_t*)bufferData + offset; - pixelColor[0] = static_cast(srcColor.r); - pixelColor[1] = static_cast(srcColor.g); - pixelColor[2] = static_cast(srcColor.b); + pixelColor[0] = static_cast(std::round(255.0f * srcColor.r)); + pixelColor[1] = static_cast(std::round(255.0f * srcColor.g)); + pixelColor[2] = static_cast(std::round(255.0f * srcColor.b)); if (bytesPerPixel == 4) { - pixelColor[3] = static_cast(srcColor.a); + pixelColor[3] = static_cast(std::round(255.0f * srcColor.a)); } } } @@ -184,13 +184,11 @@ void ReadbackHelper::compareColorBuffers(std::vector& expectedColors, voi auto pixel = row * static_cast(width) + col; int offset = (row * stride + col) * bytesPerPixel; uint8_t* pixelColor = (uint8_t*)bufferData + offset; + const Color expectedColor = expectedColors[static_cast(pixel)]; - ASSERT_EQ(static_cast(expectedColors[static_cast(pixel)].r), - pixelColor[0]); - ASSERT_EQ(static_cast(expectedColors[static_cast(pixel)].g), - pixelColor[1]); - ASSERT_EQ(static_cast(expectedColors[static_cast(pixel)].b), - pixelColor[2]); + ASSERT_EQ(std::round(255.0f * expectedColor.r), pixelColor[0]); + ASSERT_EQ(std::round(255.0f * expectedColor.g), pixelColor[1]); + ASSERT_EQ(std::round(255.0f * expectedColor.b), pixelColor[2]); } } } @@ -262,12 +260,8 @@ void TestColorLayer::write(ComposerClientWriter& writer) { LayerSettings TestColorLayer::toRenderEngineLayerSettings() { LayerSettings layerSettings = TestLayer::toRenderEngineLayerSettings(); - layerSettings.source.solidColor = - ::android::half3(static_cast<::android::half>(mColor.r) / 255.0, - static_cast<::android::half>(mColor.g) / 255.0, - static_cast<::android::half>(mColor.b) / 255.0); - layerSettings.alpha = - mAlpha * static_cast((static_cast<::android::half>(mColor.a) / 255.0)); + layerSettings.source.solidColor = ::android::half3(mColor.r, mColor.g, mColor.b); + layerSettings.alpha = mAlpha * mColor.a; return layerSettings; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h index 60a036e3fd..0fac2b3bfe 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h @@ -41,13 +41,12 @@ using common::Dataspace; using common::PixelFormat; using IMapper2_1 = ::android::hardware::graphics::mapper::V2_1::IMapper; -static const Color BLACK = {0, 0, 0, static_cast(0xff)}; -static const Color RED = {static_cast(0xff), 0, 0, static_cast(0xff)}; -static const Color TRANSLUCENT_RED = {static_cast(0xff), 0, 0, 0x33}; -static const Color GREEN = {0, static_cast(0xff), 0, static_cast(0xff)}; -static const Color BLUE = {0, 0, static_cast(0xff), static_cast(0xff)}; -static const Color WHITE = {static_cast(0xff), static_cast(0xff), - static_cast(0xff), static_cast(0xff)}; +static const Color BLACK = {0.0f, 0.0f, 0.0f, 1.0f}; +static const Color RED = {1.0f, 0.0f, 0.0f, 1.0f}; +static const Color TRANSLUCENT_RED = {1.0f, 0.0f, 0.0f, 0.3f}; +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}; class TestRenderEngine; -- GitLab From dd7f7b9a9b8ed020e49a329ff2025da713b878e3 Mon Sep 17 00:00:00 2001 From: Shubham Dubey Date: Tue, 11 Jan 2022 05:26:13 +0000 Subject: [PATCH 402/825] Revert "Add IAGnssRil AIDL HAL (hardware/interfaces)" Revert "Add AGnssRil AIDL HAL (frameworks/base)" Revert submission 16548632-IAGnssRil-AIDL Reason for revert: Breaking Build BUGID: b/213964109 Reverted Changes: I087f7c9ae:Add AGnssRil AIDL HAL (frameworks/base) Ie5746ae25:Add IAGnssRil AIDL HAL (hardware/interfaces) Change-Id: I2404199e0b881a18429cc2a4ebc87bb41e5be655 --- .../android/hardware/gnss/IAGnssRil.aidl | 79 --------- .../hardware/gnss/IAGnssRilCallback.aidl | 39 ----- .../current/android/hardware/gnss/IGnss.aidl | 1 - .../aidl/android/hardware/gnss/IAGnssRil.aidl | 163 ------------------ .../hardware/gnss/IAGnssRilCallback.aidl | 38 ---- gnss/aidl/android/hardware/gnss/IGnss.aidl | 8 - gnss/aidl/default/AGnssRil.cpp | 55 ------ gnss/aidl/default/AGnssRil.h | 37 ---- gnss/aidl/default/Android.bp | 1 - gnss/aidl/default/Gnss.cpp | 9 +- gnss/aidl/default/Gnss.h | 2 - gnss/aidl/vts/AGnssRilCallbackAidl.cpp | 28 --- gnss/aidl/vts/AGnssRilCallbackAidl.h | 28 --- gnss/aidl/vts/Android.bp | 1 - gnss/aidl/vts/gnss_hal_test_cases.cpp | 38 ---- 15 files changed, 1 insertion(+), 526 deletions(-) delete mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl delete mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.aidl delete mode 100644 gnss/aidl/android/hardware/gnss/IAGnssRil.aidl delete mode 100644 gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl delete mode 100644 gnss/aidl/default/AGnssRil.cpp delete mode 100644 gnss/aidl/default/AGnssRil.h delete mode 100644 gnss/aidl/vts/AGnssRilCallbackAidl.cpp delete mode 100644 gnss/aidl/vts/AGnssRilCallbackAidl.h 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 deleted file mode 100644 index 73df1950bf..0000000000 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.gnss; -@VintfStability -interface IAGnssRil { - void setCallback(in android.hardware.gnss.IAGnssRilCallback callback); - void setRefLocation(in android.hardware.gnss.IAGnssRil.AGnssRefLocation agnssReflocation); - void setSetId(in android.hardware.gnss.IAGnssRil.SetIDType type, in @utf8InCpp String setid); - void updateNetworkState(in android.hardware.gnss.IAGnssRil.NetworkAttributes attributes); - const int NETWORK_CAPABILITY_NOT_METERED = 1; - const int NETWORK_CAPABILITY_NOT_ROAMING = 2; - @Backing(type="int") @VintfStability - enum AGnssRefLocationType { - GSM_CELLID = 1, - UMTS_CELLID = 2, - LTE_CELLID = 4, - NR_CELLID = 8, - } - @Backing(type="int") @VintfStability - enum SetIDType { - NONE = 0, - IMSI = 1, - MSISDM = 2, - } - @VintfStability - parcelable AGnssRefLocationCellID { - android.hardware.gnss.IAGnssRil.AGnssRefLocationType type; - int mcc; - int mnc; - int lac; - long cid; - int tac; - int pcid; - int arfcn; - } - @VintfStability - parcelable AGnssRefLocation { - android.hardware.gnss.IAGnssRil.AGnssRefLocationType type; - android.hardware.gnss.IAGnssRil.AGnssRefLocationCellID cellID; - } - @VintfStability - parcelable NetworkAttributes { - long networkHandle; - boolean isConnected; - int capabilities; - @utf8InCpp String apn; - } -} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.aidl deleted file mode 100644 index 152b10aea0..0000000000 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.aidl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.gnss; -@VintfStability -interface IAGnssRilCallback { - void requestSetIdCb(in int setIdflag); - void requestRefLocCb(); -} 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 8e967444ef..1b4c5817ce 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 @@ -44,7 +44,6 @@ interface IGnss { @nullable android.hardware.gnss.IGnssGeofence getExtensionGnssGeofence(); @nullable android.hardware.gnss.IGnssNavigationMessageInterface getExtensionGnssNavigationMessage(); android.hardware.gnss.IAGnss getExtensionAGnss(); - android.hardware.gnss.IAGnssRil getExtensionAGnssRil(); android.hardware.gnss.IGnssDebug getExtensionGnssDebug(); android.hardware.gnss.visibility_control.IGnssVisibilityControl getExtensionGnssVisibilityControl(); void start(); diff --git a/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl b/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl deleted file mode 100644 index b57c9bffb4..0000000000 --- a/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.gnss; - -import android.hardware.gnss.IAGnssRilCallback; -import android.hardware.gnss.IAGnssRilCallback.SetIDType; - -/** - * Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface - * Layer interface allows the GNSS chipset to request radio interface layer - * information from Android platform. Examples of such information are reference - * location, unique subscriber ID, phone number string and network availability changes. - */ -@VintfStability -interface IAGnssRil { - /** Network capability mode bitmask for not metered. */ - const int NETWORK_CAPABILITY_NOT_METERED = 0x01; - - /** Network capability mode bitmask for not roaming. */ - const int NETWORK_CAPABILITY_NOT_ROAMING = 0x02; - - /** AGNSS reference location type */ - @VintfStability - @Backing(type="int") - enum AGnssRefLocationType { - GSM_CELLID = 1, - UMTS_CELLID = 2, - LTE_CELLID = 4, - NR_CELLID = 8, - } - - /** SET ID type*/ - @VintfStability - @Backing(type="int") - enum SetIDType { - NONE = 0, - IMSI = 1, - MSISDM = 2, - } - - /** CellID for 2G, 3G ,LTE and NR used in AGNSS. */ - @VintfStability - parcelable AGnssRefLocationCellID { - AGnssRefLocationType type; - - /** Mobile Country Code. */ - int mcc; - - /** Mobile Network Code .*/ - int mnc; - - /** - * Location Area Code in 2G, 3G and LTE. In 3G lac is discarded. In LTE, - * lac is populated with tac, to ensure that we don't break old clients that - * might rely on the old (wrong) behavior. - */ - int lac; - - /** - * Cell id in 2G. Utran Cell id in 3G. Cell Global Id EUTRA in LTE. - * Cell Global Id NR in 5G. - */ - long cid; - - /** Tracking Area Code in LTE and NR. */ - int tac; - - /** Physical Cell id in LTE and NR (not used in 2G and 3G) */ - int pcid; - - /** Absolute Radio Frequency Channel Number in NR. */ - int arfcn; - } - - /** Represents ref locations */ - @VintfStability - parcelable AGnssRefLocation { - AGnssRefLocationType type; - - AGnssRefLocationCellID cellID; - } - - /** Represents network connection status and capabilities. */ - @VintfStability - parcelable NetworkAttributes { - /** Network handle of the network for use with the NDK API. */ - long networkHandle; - - /** - * True indicates that network connectivity exists and it is possible to - * establish connections and pass data. If false, only the networkHandle field - * is populated to indicate that this network has just disconnected. - */ - boolean isConnected; - - /** - * A bitfield of flags indicating the capabilities of this network. The bit masks are - * defined in NETWORK_CAPABILITY_*. - */ - int capabilities; - - /** - * Telephony preferred Access Point Name to use for carrier data connection when - * connected to a cellular network. Empty string, otherwise. - */ - @utf8InCpp String apn; - } - - /** - * Opens the AGNSS interface and provides the callback routines - * to the implementation of this interface. - * - * @param callback Interface for AGnssRil callbacks. - * - */ - void setCallback(in IAGnssRilCallback callback); - - /** - * Sets the reference location. - * - * @param agnssReflocation AGNSS reference location CellID. - * - */ - void setRefLocation(in AGnssRefLocation agnssReflocation); - - /** - * Sets the SET ID. - * - * @param type Must be populated with either IMSI or MSISDN or NONE. - * @param setid If type is IMSI then setid is populated with - * a string representing the unique Subscriber ID, for example, the IMSI for - * a GMS phone. If type is MSISDN, then setid must contain - * the phone number string for line 1. For example, the MSISDN for a GSM phone. - * If the type is NONE, then the string must be empty. - * - */ - void setSetId(in SetIDType type, in @utf8InCpp String setid); - - /** - * Notifies GNSS of network status changes. - * - * The framework calls this method to update the GNSS HAL implementation of network - * state changes. - * - * @param attributes Updated network attributes. - * - */ - void updateNetworkState(in NetworkAttributes attributes); -} diff --git a/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl b/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl deleted file mode 100644 index 6fb093e165..0000000000 --- a/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.gnss; - -/** - * Callback for IAGnssRil interface. Used to request SET ID and - * Reference Location. - */ -@VintfStability -interface IAGnssRilCallback { - /** - * The Hal uses this API to request a SET ID. - * - * @param setIdflag A bitfield of IAGnssRil.SetIDType that is required by - * the HAL. The framework will inject an empty SET ID if the flag is NONE. - * - */ - void requestSetIdCb(in int setIdflag); - - /** - * The Hal uses this API to request a reference location. - */ - void requestRefLocCb(); -} diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl index b6bd38a118..4ddc6a6193 100644 --- a/gnss/aidl/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl @@ -18,7 +18,6 @@ package android.hardware.gnss; import android.hardware.gnss.GnssLocation; import android.hardware.gnss.IAGnss; -import android.hardware.gnss.IAGnssRil; import android.hardware.gnss.IGnssBatching; import android.hardware.gnss.IGnssCallback; import android.hardware.gnss.IGnssConfiguration; @@ -186,13 +185,6 @@ interface IGnss { */ IAGnss getExtensionAGnss(); - /** - * This method returns the IAGnssRil interface. - * - * @return The IAGnssRil interface. - */ - IAGnssRil getExtensionAGnssRil(); - /** * This method returns the IGnssDebug interface. * diff --git a/gnss/aidl/default/AGnssRil.cpp b/gnss/aidl/default/AGnssRil.cpp deleted file mode 100644 index e6009bdcd9..0000000000 --- a/gnss/aidl/default/AGnssRil.cpp +++ /dev/null @@ -1,55 +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. - */ - -#define LOG_TAG "AGnssRilAidl" - -#include "AGnssRil.h" -#include - -namespace aidl::android::hardware::gnss { - -std::shared_ptr AGnssRil::sCallback = nullptr; - -ndk::ScopedAStatus AGnssRil::setCallback(const std::shared_ptr& callback) { - ALOGD("AGnssRil::setCallback"); - std::unique_lock lock(mMutex); - sCallback = callback; - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus AGnssRil::setRefLocation(const AGnssRefLocation& agnssReflocation) { - const AGnssRefLocationCellID& cellInfo = agnssReflocation.cellID; - ALOGD("AGnssRil::setRefLocation: type: %s, mcc: %d, mnc: %d, lac: %d, cid: %ld, tac: %d, pcid: " - "%d, arfcn: %d", - toString(agnssReflocation.type).c_str(), cellInfo.mcc, cellInfo.mnc, cellInfo.lac, - cellInfo.cid, cellInfo.tac, cellInfo.pcid, cellInfo.arfcn); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus AGnssRil::setSetId(SetIDType type, const std::string& setid) { - ALOGD("AGnssRil::setSetId: type:%s, setid: %s", toString(type).c_str(), setid.c_str()); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus AGnssRil::updateNetworkState(const NetworkAttributes& attributes) { - ALOGD("AGnssRil::updateNetworkState: networkHandle: %ld, isConnected: %d, capabilities: %d, " - "apn: %s", - attributes.networkHandle, attributes.isConnected, attributes.capabilities, - attributes.apn.c_str()); - return ndk::ScopedAStatus::ok(); -} - -} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/AGnssRil.h b/gnss/aidl/default/AGnssRil.h deleted file mode 100644 index 7e429ee8f4..0000000000 --- a/gnss/aidl/default/AGnssRil.h +++ /dev/null @@ -1,37 +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 - -namespace aidl::android::hardware::gnss { - -struct AGnssRil : public BnAGnssRil { - public: - ndk::ScopedAStatus setCallback(const std::shared_ptr& callback) override; - ndk::ScopedAStatus setRefLocation(const AGnssRefLocation& agnssReflocation) override; - ndk::ScopedAStatus setSetId(SetIDType type, const std::string& setid) override; - ndk::ScopedAStatus updateNetworkState(const NetworkAttributes& attributes) override; - - private: - // Synchronization lock for sCallback - mutable std::mutex mMutex; - // Guarded by mMutex - static std::shared_ptr sCallback; -}; - -} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index 5797e1c645..29c26d16ec 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -56,7 +56,6 @@ cc_binary { "android.hardware.gnss-V2-ndk", ], srcs: [ - "AGnssRil.cpp", "AGnss.cpp", "Gnss.cpp", "GnssBatching.cpp", diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index dba54a017d..e296351d95 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -20,7 +20,6 @@ #include #include #include "AGnss.h" -#include "AGnssRil.h" #include "GnssBatching.h" #include "GnssConfiguration.h" #include "GnssDebug.h" @@ -155,7 +154,7 @@ ScopedAStatus Gnss::close() { return ScopedAStatus::ok(); } -ScopedAStatus Gnss::getExtensionAGnss(std::shared_ptr* iAGnss) { +ndk::ScopedAStatus Gnss::getExtensionAGnss(std::shared_ptr* iAGnss) { ALOGD("Gnss::getExtensionAGnss"); *iAGnss = SharedRefBase::make(); return ndk::ScopedAStatus::ok(); @@ -167,12 +166,6 @@ ScopedAStatus Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs, int unce return ScopedAStatus::ok(); } -ScopedAStatus Gnss::getExtensionAGnssRil(std::shared_ptr* iAGnssRil) { - ALOGD("Gnss::getExtensionAGnssRil"); - *iAGnssRil = SharedRefBase::make(); - return ndk::ScopedAStatus::ok(); -} - ScopedAStatus Gnss::injectLocation(const GnssLocation& location) { ALOGD("injectLocation. lat:%lf, lng:%lf, acc:%f", location.latitudeDegrees, location.longitudeDegrees, location.horizontalAccuracyMeters); diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index 731eaa3f36..384c8629a2 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -17,7 +17,6 @@ #pragma once #include -#include #include #include #include @@ -66,7 +65,6 @@ class Gnss : public BnGnss { ndk::ScopedAStatus getExtensionGnssNavigationMessage( std::shared_ptr* iGnssNavigationMessage) override; ndk::ScopedAStatus getExtensionAGnss(std::shared_ptr* iAGnss) override; - ndk::ScopedAStatus getExtensionAGnssRil(std::shared_ptr* iAGnssRil) override; ndk::ScopedAStatus getExtensionGnssDebug(std::shared_ptr* iGnssDebug) override; ndk::ScopedAStatus getExtensionGnssVisibilityControl( std::shared_ptr* diff --git a/gnss/aidl/vts/AGnssRilCallbackAidl.cpp b/gnss/aidl/vts/AGnssRilCallbackAidl.cpp deleted file mode 100644 index 4e4166d61d..0000000000 --- a/gnss/aidl/vts/AGnssRilCallbackAidl.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "AGnssRilCallbackAidl.h" -#include - -android::binder::Status AGnssRilCallbackAidl::requestSetIdCb(int setIdflag) { - ALOGI("requestSetIdCb setIdflag %d", setIdflag); - return android::binder::Status::ok(); -} - -android::binder::Status AGnssRilCallbackAidl::requestRefLocCb() { - ALOGI("requestRefLocCb"); - return android::binder::Status::ok(); -} diff --git a/gnss/aidl/vts/AGnssRilCallbackAidl.h b/gnss/aidl/vts/AGnssRilCallbackAidl.h deleted file mode 100644 index 74b34eee94..0000000000 --- a/gnss/aidl/vts/AGnssRilCallbackAidl.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -/** Implementation for IAGnssRilCallback. */ -class AGnssRilCallbackAidl : public android::hardware::gnss::BnAGnssRilCallback { - public: - AGnssRilCallbackAidl(){}; - ~AGnssRilCallbackAidl(){}; - android::binder::Status requestSetIdCb(int setIdflag) override; - android::binder::Status requestRefLocCb() override; -}; diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp index c39803f970..d532fad357 100644 --- a/gnss/aidl/vts/Android.bp +++ b/gnss/aidl/vts/Android.bp @@ -31,7 +31,6 @@ cc_test { "gnss_hal_test.cpp", "gnss_hal_test_cases.cpp", "AGnssCallbackAidl.cpp", - "AGnssRilCallbackAidl.cpp", "GnssBatchingCallback.cpp", "GnssCallbackAidl.cpp", "GnssGeofenceCallback.cpp", diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 6811b7b847..9acef8bed0 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -27,7 +27,6 @@ #include #include #include "AGnssCallbackAidl.h" -#include "AGnssRilCallbackAidl.h" #include "GnssBatchingCallback.h" #include "GnssGeofenceCallback.h" #include "GnssMeasurementCallbackAidl.h" @@ -44,7 +43,6 @@ using android::hardware::gnss::GnssData; using android::hardware::gnss::GnssMeasurement; using android::hardware::gnss::GnssPowerStats; using android::hardware::gnss::IAGnss; -using android::hardware::gnss::IAGnssRil; using android::hardware::gnss::IGnss; using android::hardware::gnss::IGnssBatching; using android::hardware::gnss::IGnssBatchingCallback; @@ -859,42 +857,6 @@ TEST_P(GnssHalTest, TestAGnssExtension) { ASSERT_TRUE(status.isOk()); } -/* - * TestAGnssRilExtension: - * 1. Gets the IAGnssRil extension. - * 2. Sets AGnssRilCallback. - * 3. Sets reference location. - */ -TEST_P(GnssHalTest, TestAGnssRilExtension) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { - return; - } - sp iAGnssRil; - auto status = aidl_gnss_hal_->getExtensionAGnssRil(&iAGnssRil); - ASSERT_TRUE(status.isOk()); - ASSERT_TRUE(iAGnssRil != nullptr); - - auto agnssRilCallback = sp::make(); - status = iAGnssRil->setCallback(agnssRilCallback); - ASSERT_TRUE(status.isOk()); - - // Set RefLocation - IAGnssRil::AGnssRefLocationCellID agnssReflocationCellId; - agnssReflocationCellId.type = IAGnssRil::AGnssRefLocationType::LTE_CELLID; - agnssReflocationCellId.mcc = 466; - agnssReflocationCellId.mnc = 97; - agnssReflocationCellId.lac = 46697; - agnssReflocationCellId.cid = 59168142; - agnssReflocationCellId.pcid = 420; - agnssReflocationCellId.tac = 11460; - IAGnssRil::AGnssRefLocation agnssReflocation; - agnssReflocation.type = IAGnssRil::AGnssRefLocationType::LTE_CELLID; - agnssReflocation.cellID = agnssReflocationCellId; - - status = iAGnssRil->setRefLocation(agnssReflocation); - ASSERT_TRUE(status.isOk()); -} - /* * GnssDebugValuesSanityTest: * Ensures that GnssDebug values make sense. -- GitLab From 4d37f69678a4907d2510e72d25ccf1da7ae9970f Mon Sep 17 00:00:00 2001 From: Serik Beketayev Date: Mon, 29 Nov 2021 15:24:19 -0800 Subject: [PATCH 403/825] [IHostapd] Support vendor-specific AP config elem Bug: 139204496 Test: mma -j Change-Id: I7caa7d3b27bca7898d8857bfb841b5466643644e --- .../android/hardware/wifi/hostapd/NetworkParams.aidl | 1 + .../aidl/android/hardware/wifi/hostapd/NetworkParams.aidl | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/NetworkParams.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/NetworkParams.aidl index ffe2f33475..4554223751 100644 --- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/NetworkParams.aidl +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/NetworkParams.aidl @@ -39,4 +39,5 @@ parcelable NetworkParams { android.hardware.wifi.hostapd.EncryptionType encryptionType; String passphrase; boolean isMetered; + byte[] vendorElements; } diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/NetworkParams.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/NetworkParams.aidl index df84eca23d..47d9e6f96b 100644 --- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/NetworkParams.aidl +++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/NetworkParams.aidl @@ -44,4 +44,12 @@ parcelable NetworkParams { * CHARGEABLE_PUBLIC_NETWORK when set to true. */ boolean isMetered; + /** + * Additional vendor specific elements for Beacon and Probe Response frames + * This parameter can be used to add additional vendor specific element(s) into + * the end of the Beacon and Probe Response frames. The format for these + * element(s) is a binary dump of the raw information elements (id+len+payload for + * one or more elements). Example: byte[]{ 221, 4, 17, 34, 51, 1 } + */ + byte[] vendorElements; } -- GitLab From e106f475b6cfdf9abcc560d723a0148d5c4f3d82 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Tue, 11 Jan 2022 12:09:22 -0800 Subject: [PATCH 404/825] Add API to filter out unnecessary PIDs from frontend output. Bug: 213287138 Test: atest VtsHalTvTunerTargetTest Change-Id: I075d68d722b2804f54d57a1ac9c350e2a9724ae3 --- .../current/android/hardware/tv/tuner/IFrontend.aidl | 1 + tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl | 9 +++++++++ tv/tuner/aidl/default/Frontend.cpp | 7 +++++++ tv/tuner/aidl/default/Frontend.h | 1 + tv/tuner/aidl/vts/functional/FrontendTests.cpp | 8 ++++++++ tv/tuner/aidl/vts/functional/FrontendTests.h | 1 + tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h | 9 +++++++-- tv/tuner/config/api/current.txt | 2 ++ tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml | 8 ++++++-- tv/tuner/config/tuner_testing_dynamic_configuration.xsd | 3 +++ 10 files changed, 45 insertions(+), 4 deletions(-) diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl index e7aa070552..e240e40666 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl @@ -46,4 +46,5 @@ interface IFrontend { int linkCiCam(in int ciCamId); void unlinkCiCam(in int ciCamId); String getHardwareInfo(); + void removeOutputPid(int pid); } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl index 5b3ce39c29..f8248e660b 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl @@ -146,4 +146,13 @@ interface IFrontend { * @return the frontend hardware information. */ String getHardwareInfo(); + + /** + * Filter out unnecessary PID from frontend output. + * + * @param pid specify the PID will be filtered out. + * + * @return UNAVAILABLE if the frontend doesn’t support PID filtering out. + */ + void removeOutputPid(int pid); } diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index 714612d006..9fcb432ed3 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -759,6 +759,13 @@ binder_status_t Frontend::dump(int fd, const char** /* args */, uint32_t /* numA return ::ndk::ScopedAStatus::ok(); } +::ndk::ScopedAStatus Frontend::removeOutputPid(int32_t /* in_pid */) { + ALOGV("%s", __FUNCTION__); + + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNAVAILABLE)); +} + FrontendType Frontend::getFrontendType() { return mType; } diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h index fdedf1ef6f..3df1aa1d78 100644 --- a/tv/tuner/aidl/default/Frontend.h +++ b/tv/tuner/aidl/default/Frontend.h @@ -50,6 +50,7 @@ class Frontend : public BnFrontend { ::ndk::ScopedAStatus linkCiCam(int32_t in_ciCamId, int32_t* _aidl_return) override; ::ndk::ScopedAStatus unlinkCiCam(int32_t in_ciCamId) override; ::ndk::ScopedAStatus getHardwareInfo(std::string* _aidl_return) override; + ::ndk::ScopedAStatus removeOutputPid(int32_t in_pid) override; binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp index 41e98ea586..a9feeabbc3 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp +++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp @@ -298,6 +298,13 @@ AssertionResult FrontendTests::linkCiCam(int32_t ciCamId) { return AssertionResult(status.isOk()); } +AssertionResult FrontendTests::removeOutputPid(int32_t removePid) { + ndk::ScopedAStatus status; + status = mFrontend->removeOutputPid(removePid); + return AssertionResult(status.isOk() || status.getServiceSpecificError() == + static_cast(Result::UNAVAILABLE)); +} + AssertionResult FrontendTests::unlinkCiCam(int32_t ciCamId) { ndk::ScopedAStatus status = mFrontend->unlinkCiCam(ciCamId); return AssertionResult(status.isOk()); @@ -501,6 +508,7 @@ void FrontendTests::tuneTest(FrontendConfig frontendConf) { ASSERT_TRUE(setFrontendCallback()); if (frontendConf.canConnectToCiCam) { ASSERT_TRUE(linkCiCam(frontendConf.ciCamId)); + ASSERT_TRUE(removeOutputPid(frontendConf.removePid)); ASSERT_TRUE(unlinkCiCam(frontendConf.ciCamId)); } ASSERT_TRUE(tuneFrontend(frontendConf, false /*testWithDemux*/)); diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.h b/tv/tuner/aidl/vts/functional/FrontendTests.h index 1745f76cd8..537c419256 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.h +++ b/tv/tuner/aidl/vts/functional/FrontendTests.h @@ -95,6 +95,7 @@ class FrontendTests { AssertionResult linkCiCam(int32_t ciCamId); AssertionResult unlinkCiCam(int32_t ciCamId); AssertionResult verifyHardwareInfo(); + AssertionResult removeOutputPid(int32_t removePid); void getFrontendIdByType(FrontendType feType, int32_t& feId); void tuneTest(FrontendConfig frontendConf); diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h index b73d59411b..3009c4a28d 100644 --- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h +++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h @@ -83,6 +83,7 @@ struct FrontendConfig { FrontendType type; bool canConnectToCiCam; int32_t ciCamId; + int32_t removePid; FrontendSettings settings; vector tuneStatusTypes; vector expectTuneStatuses; @@ -304,7 +305,8 @@ struct TunerTestingConfigAidlReader1_0 { // TODO: b/182519645 complete the tune status config frontendMap[id].tuneStatusTypes = types; frontendMap[id].expectTuneStatuses = statuses; - getCiCamInfo(feConfig, frontendMap[id].canConnectToCiCam, frontendMap[id].ciCamId); + getCiCamInfo(feConfig, frontendMap[id].canConnectToCiCam, frontendMap[id].ciCamId, + frontendMap[id].removePid); } } } @@ -1004,13 +1006,16 @@ struct TunerTestingConfigAidlReader1_0 { return recordSettings; } - static void getCiCamInfo(Frontend feConfig, bool& canConnectToCiCam, int32_t& ciCamId) { + static void getCiCamInfo(Frontend feConfig, bool& canConnectToCiCam, int32_t& ciCamId, + int32_t& removePid) { if (!feConfig.hasConnectToCicamId()) { canConnectToCiCam = false; ciCamId = -1; + removePid = -1; return; } canConnectToCiCam = true; ciCamId = static_cast(feConfig.getConnectToCicamId()); + removePid = static_cast(feConfig.getRemoveOutputPid()); } }; diff --git a/tv/tuner/config/api/current.txt b/tv/tuner/config/api/current.txt index 4d519d7cb5..383d49f452 100644 --- a/tv/tuner/config/api/current.txt +++ b/tv/tuner/config/api/current.txt @@ -317,6 +317,7 @@ package android.media.tuner.testing.configuration.V1_0 { method @Nullable public java.math.BigInteger getFrequency(); method @Nullable public String getId(); method @Nullable public boolean getIsSoftwareFrontend(); + method @Nullable public java.math.BigInteger getRemoveOutputPid(); method @Nullable public android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum getType(); method public void setConnectToCicamId(@Nullable java.math.BigInteger); method public void setDvbsFrontendSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.DvbsFrontendSettings); @@ -325,6 +326,7 @@ package android.media.tuner.testing.configuration.V1_0 { method public void setFrequency(@Nullable java.math.BigInteger); method public void setId(@Nullable String); method public void setIsSoftwareFrontend(@Nullable boolean); + method public void setRemoveOutputPid(@Nullable java.math.BigInteger); method public void setType(@Nullable android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum); } diff --git a/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml b/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml index da77200f8a..fefe86edab 100644 --- a/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml +++ b/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml @@ -42,6 +42,8 @@ "softwareFeInputPath": used as the source of the software frontend. "connectToCicamId": if the device supports frontend connecting to cicam, the target cicam id needs to be configured here. Supported in Tuner 1.1 or higher. + "removeOutputPid": the unnecessary PID will be filtered out from frontend + output. Supported in Tuner 2.0 or higher. "frequency": the frequency used to configure tune and scan. "endFrequency": the end frequency of scan. Supported in Tuner 1.1 or higher. @@ -53,11 +55,13 @@ --> + connectToCicamId="0" removeOutputPid="10" frequency="578000000" + endFrequency="800000000"> + connectToCicamId="0" removeOutputPid="10" frequency="578000000" + endFrequency="800000000"> + + + + android.hardware.sensors + 1 + ISensors/default + + diff --git a/sensors/aidl/multihal/android.hardware.sensors-service-multihal.rc b/sensors/aidl/multihal/android.hardware.sensors-service-multihal.rc new file mode 100644 index 0000000000..3f91a0a04a --- /dev/null +++ b/sensors/aidl/multihal/android.hardware.sensors-service-multihal.rc @@ -0,0 +1,7 @@ +service vendor.sensors-hal-multihal /vendor/bin/hw/android.hardware.sensors-service.multihal + class hal + user system + group system wakelock context_hub + task_profiles ServiceCapacityLow + capabilities BLOCK_SUSPEND + rlimit rtprio 10 10 \ No newline at end of file diff --git a/sensors/aidl/multihal/service.cpp b/sensors/aidl/multihal/service.cpp new file mode 100644 index 0000000000..11c108a395 --- /dev/null +++ b/sensors/aidl/multihal/service.cpp @@ -0,0 +1,36 @@ +/* + * 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 +#include +#include +#include "HalProxyAidl.h" + +using ::aidl::android::hardware::sensors::implementation::HalProxyAidl; + +int main() { + ABinderProcess_setThreadPoolMaxThreadCount(0); + + // Make a default multihal sensors service + auto halProxy = ndk::SharedRefBase::make(); + const std::string halProxyName = std::string() + HalProxyAidl::descriptor + "/default"; + binder_status_t status = + AServiceManager_addService(halProxy->asBinder().get(), halProxyName.c_str()); + CHECK_EQ(status, STATUS_OK); + + ABinderProcess_joinThreadPool(); + return EXIT_FAILURE; // should not reach +} diff --git a/sensors/common/default/2.X/multihal/HalProxy.cpp b/sensors/common/default/2.X/multihal/HalProxy.cpp index f5fc066820..73b0594f06 100644 --- a/sensors/common/default/2.X/multihal/HalProxy.cpp +++ b/sensors/common/default/2.X/multihal/HalProxy.cpp @@ -176,7 +176,13 @@ Return HalProxy::initialize_2_1( std::unique_ptr queue = std::make_unique(eventQueue); - return initializeCommon(queue, wakeLockDescriptor, dynamicCallback); + // Create the Wake Lock FMQ from the wakeLockDescriptor. Reset the read/write positions. + auto hidlWakeLockQueue = + std::make_unique(wakeLockDescriptor, true /* resetPointers */); + std::unique_ptr wakeLockQueue = + std::make_unique(hidlWakeLockQueue); + + return initializeCommon(queue, wakeLockQueue, dynamicCallback); } Return HalProxy::initialize( @@ -192,12 +198,18 @@ Return HalProxy::initialize( std::unique_ptr queue = std::make_unique(eventQueue); - return initializeCommon(queue, wakeLockDescriptor, dynamicCallback); + // Create the Wake Lock FMQ from the wakeLockDescriptor. Reset the read/write positions. + auto hidlWakeLockQueue = + std::make_unique(wakeLockDescriptor, true /* resetPointers */); + std::unique_ptr wakeLockQueue = + std::make_unique(hidlWakeLockQueue); + + return initializeCommon(queue, wakeLockQueue, dynamicCallback); } Return HalProxy::initializeCommon( std::unique_ptr& eventQueue, - const ::android::hardware::MQDescriptorSync& wakeLockDescriptor, + std::unique_ptr& wakeLockQueue, const sp& sensorsCallback) { Result result = Result::OK; @@ -222,8 +234,7 @@ Return HalProxy::initializeCommon( // Create the Wake Lock FMQ that is used by the framework to communicate whenever WAKE_UP // events have been successfully read and handled by the framework. - mWakeLockQueue = - std::make_unique(wakeLockDescriptor, true /* resetPointers */); + mWakeLockQueue = std::move(wakeLockQueue); if (mEventQueueFlag != nullptr) { EventFlag::deleteEventFlag(&mEventQueueFlag); diff --git a/sensors/common/default/2.X/multihal/include/HalProxy.h b/sensors/common/default/2.X/multihal/include/HalProxy.h index 35d7c8bae1..61745281f8 100644 --- a/sensors/common/default/2.X/multihal/include/HalProxy.h +++ b/sensors/common/default/2.X/multihal/include/HalProxy.h @@ -23,6 +23,7 @@ #include "V2_0/ScopedWakelock.h" #include "V2_0/SubHal.h" #include "V2_1/SubHal.h" +#include "WakeLockMessageQueueWrapper.h" #include "convertV2_1.h" #include @@ -98,10 +99,9 @@ class HalProxy : public V2_0::implementation::IScopedWakelockRefCounter, const ::android::hardware::MQDescriptorSync& wakeLockDescriptor, const sp& sensorsCallback); - Return initializeCommon( - std::unique_ptr& eventQueue, - const ::android::hardware::MQDescriptorSync& wakeLockDescriptor, - const sp& sensorsCallback); + Return initializeCommon(std::unique_ptr& eventQueue, + std::unique_ptr& wakeLockQueue, + const sp& sensorsCallback); Return batch(int32_t sensorHandle, int64_t samplingPeriodNs, int64_t maxReportLatencyNs); @@ -141,6 +141,8 @@ class HalProxy : public V2_0::implementation::IScopedWakelockRefCounter, void decrementRefCountAndMaybeReleaseWakelock(size_t delta, int64_t timeoutStart = -1) override; + const std::map& getSensors() { return mSensors; } + private: using EventMessageQueueV2_1 = MessageQueue; using EventMessageQueueV2_0 = MessageQueue; @@ -154,7 +156,7 @@ class HalProxy : public V2_0::implementation::IScopedWakelockRefCounter, /** * The Wake Lock FMQ that is read to determine when the framework has handled WAKE_UP events */ - std::unique_ptr mWakeLockQueue; + std::unique_ptr mWakeLockQueue; /** * Event Flag to signal to the framework when sensor events are available to be read and to diff --git a/sensors/common/utils/WakeLockMessageQueueWrapper.h b/sensors/common/utils/WakeLockMessageQueueWrapper.h new file mode 100644 index 0000000000..3a219cffbe --- /dev/null +++ b/sensors/common/utils/WakeLockMessageQueueWrapper.h @@ -0,0 +1,72 @@ +/* + * 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 "convertV2_1.h" + +#include +#include +#include +#include +#include + +#include + +namespace android { +namespace hardware { +namespace sensors { +namespace V2_1 { +namespace implementation { + +class WakeLockMessageQueueWrapperBase { + public: + virtual ~WakeLockMessageQueueWrapperBase() {} + + virtual std::atomic* getEventFlagWord() = 0; + virtual bool readBlocking(uint32_t* events, size_t numToRead, uint32_t readNotification, + uint32_t writeNotification, int64_t timeOutNanos, + ::android::hardware::EventFlag* evFlag = nullptr) = 0; + virtual bool write(const uint32_t* wakeLock) = 0; +}; + +class WakeLockMessageQueueWrapperHidl : public WakeLockMessageQueueWrapperBase { + public: + WakeLockMessageQueueWrapperHidl( + std::unique_ptr<::android::hardware::MessageQueue>& + queue) + : mQueue(std::move(queue)) {} + + std::atomic* getEventFlagWord() override { return mQueue->getEventFlagWord(); } + + bool readBlocking(uint32_t* wakeLocks, size_t numToRead, uint32_t readNotification, + uint32_t writeNotification, int64_t timeOutNanos, + ::android::hardware::EventFlag* evFlag) override { + return mQueue->readBlocking(wakeLocks, numToRead, readNotification, writeNotification, + timeOutNanos, evFlag); + } + + bool write(const uint32_t* wakeLock) override { return mQueue->write(wakeLock); } + + private: + std::unique_ptr<::android::hardware::MessageQueue> mQueue; +}; + +} // namespace implementation +} // namespace V2_1 +} // namespace sensors +} // namespace hardware +} // namespace android -- GitLab From d72ba14c90511a7be5a130c54e6bbdec282f5c8e Mon Sep 17 00:00:00 2001 From: Brian Duddie Date: Fri, 10 Dec 2021 14:24:09 -0800 Subject: [PATCH 407/825] Add HEAD_TRACKER sensor type definition This new sensor type supports tracking the orientation and rate of rotation of a user's head, which can be useful for features such as spatial audio. Bug: 210156629 Test: compile only; to be validated in later CLs Change-Id: I861be09d14e208fb992b23554b6c0733e4163f0c --- sensors/aidl/Android.bp | 2 - .../android/hardware/sensors/Event.aidl | 11 +++++ .../android/hardware/sensors/SensorType.aidl | 1 + .../aidl/android/hardware/sensors/Event.aidl | 45 +++++++++++++++++++ .../android/hardware/sensors/SensorType.aidl | 33 ++++++++++++++ 5 files changed, 90 insertions(+), 2 deletions(-) diff --git a/sensors/aidl/Android.bp b/sensors/aidl/Android.bp index fd1ac441e2..7324abf50d 100644 --- a/sensors/aidl/Android.bp +++ b/sensors/aidl/Android.bp @@ -1,5 +1,3 @@ -// This is the expected build file, but it may not be right in all cases - aidl_interface { name: "android.hardware.sensors", vendor_available: true, diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl index 186b2be8b3..c92ab1ab0c 100644 --- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl +++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl @@ -51,6 +51,7 @@ parcelable Event { android.hardware.sensors.DynamicSensorInfo dynamic; android.hardware.sensors.AdditionalInfo additional; android.hardware.sensors.Event.EventPayload.Data data; + android.hardware.sensors.Event.EventPayload.HeadTracker headTracker; @FixedSize @VintfStability parcelable Vec4 { float x; @@ -75,6 +76,16 @@ parcelable Event { float zBias; } @FixedSize @VintfStability + parcelable HeadTracker { + float rx; + float ry; + float rz; + float vx; + float vy; + float vz; + int discontinuityCount; + } + @FixedSize @VintfStability parcelable HeartRate { float bpm; android.hardware.sensors.SensorStatus status; diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl index 4f3b5b2e79..3d7ab45cd8 100644 --- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl +++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl @@ -70,5 +70,6 @@ enum SensorType { LOW_LATENCY_OFFBODY_DETECT = 34, ACCELEROMETER_UNCALIBRATED = 35, HINGE_ANGLE = 36, + HEAD_TRACKER = 37, DEVICE_PRIVATE_BASE = 65536, } diff --git a/sensors/aidl/android/hardware/sensors/Event.aidl b/sensors/aidl/android/hardware/sensors/Event.aidl index 6ef9acbbda..fd6a8cc4ba 100644 --- a/sensors/aidl/android/hardware/sensors/Event.aidl +++ b/sensors/aidl/android/hardware/sensors/Event.aidl @@ -127,6 +127,11 @@ parcelable Event { */ Data data; + /** + * SensorType::HEAD_TRACKER + */ + HeadTracker headTracker; + @FixedSize @VintfStability parcelable Vec4 { @@ -156,6 +161,46 @@ parcelable Event { float zBias; } + /** + * Payload of the HEAD_TRACKER sensor type. Note that the axis + * definition of this sensor type differs from the rest of Android. See + * SensorType::HEAD_TRACKER for more information. + */ + @FixedSize + @VintfStability + parcelable HeadTracker { + /** + * An Euler vector (rotation vector, i.e. a vector whose direction + * indicates the axis of rotation and magnitude indicates the angle + * to rotate around that axis) representing the transform from + * the (arbitrary, possibly slowly drifting) reference frame to the + * head frame. Expressed in radians. Magnitude of the vector must be + * in the range [0, pi], while the value of individual axes are + * in the range [-pi, pi]. + */ + float rx; + float ry; + float rz; + + /** + * An Euler vector (rotation vector) representing the angular + * velocity of the head (relative to itself), in radians per second. + * The direction of this vector indicates the axis of rotation, and + * the magnitude indicates the rate of rotation. + */ + float vx; + float vy; + float vz; + + /** + * This value increments (or wraps around to 0) each time the + * reference frame is suddenly and significantly changed, for + * example if an orientation filter algorithm used for determining + * the orientation has had its state reset. + */ + int discontinuityCount; + } + @FixedSize @VintfStability parcelable HeartRate { diff --git a/sensors/aidl/android/hardware/sensors/SensorType.aidl b/sensors/aidl/android/hardware/sensors/SensorType.aidl index 95c7a6a2ad..01e6bee1d5 100644 --- a/sensors/aidl/android/hardware/sensors/SensorType.aidl +++ b/sensors/aidl/android/hardware/sensors/SensorType.aidl @@ -142,6 +142,10 @@ enum SensorType { * The rotation vector symbolizes the orientation of the device relative to * the East-North-Up coordinates frame. * + * Note that despite the name, SensorType::ROTATION_VECTOR uses + * quaternion representation, rather than the rotation vector representation + * (aka Euler vector) seen in SensorType::HEAD_TRACKER. + * * Implement the non-wake-up version of this sensor and implement the * wake-up version if the system possesses a wake up fifo. */ @@ -633,6 +637,35 @@ enum SensorType { */ HINGE_ANGLE = 36, + /** + * HEAD_TRACKER + * reporting-mode: continuous + * + * A sensor of this type measures the orientation of a user's head relative + * to an arbitrary reference frame, and the rate of rotation. + * + * Events produced by this sensor follow a special head-centric coordinate + * frame, where: + * - The X axis crosses through the user's ears, with the positive X + * direction extending out of the user's right ear + * - The Y axis crosses from the back of the user's head through their + * nose, with the positive direction extending out of the nose, and the + * X/Y plane being nominally parallel to the ground when the user is + * upright and looking straight ahead + * - The Z axis crosses from the neck through the top of the user's head, + * with the positive direction extending out from the top of the head + * + * When this sensor type is exposed as a dynamic sensor through a + * communications channel that uses HID, such as Bluetooth or USB, as part + * of a device with audio output capability (e.g. headphones), then the + * DynamicSensorInfo::uuid field shall be set to contents of the HID + * Persistent Unique ID to permit association between the sensor and audio + * device. Accordingly, the HID Persistent Unique ID (Sensors Page 0x20, + * Usage ID 0x302) must be populated as a UUID in binary representation, + * following RFC 4122 byte order. + */ + HEAD_TRACKER = 37, + /** * Base for device manufacturers private sensor types. * These sensor types can't be exposed in the SDK. -- GitLab From 629b3a4cf2f36fc5052a0f2e872c7f8c1295fd20 Mon Sep 17 00:00:00 2001 From: Grace Cheng Date: Thu, 6 Jan 2022 12:19:17 +0000 Subject: [PATCH 408/825] Implements AIDL VTS direct channel tests Bug: 195593357 Test: Compile, run tests Change-Id: I3e78050fc28c9a0d20cd18788a357bc9b82f2ced --- sensors/aidl/vts/Android.bp | 2 + .../aidl/vts/SensorsAidlTestSharedMemory.h | 218 ++++++++++++++++++ .../aidl/vts/VtsAidlHalSensorsTargetTest.cpp | 198 +++++++++++++++- 3 files changed, 416 insertions(+), 2 deletions(-) create mode 100644 sensors/aidl/vts/SensorsAidlTestSharedMemory.h diff --git a/sensors/aidl/vts/Android.bp b/sensors/aidl/vts/Android.bp index 5a519a5a1e..b5a5f15691 100644 --- a/sensors/aidl/vts/Android.bp +++ b/sensors/aidl/vts/Android.bp @@ -34,6 +34,7 @@ cc_test { shared_libs: [ "libbinder", "libbinder_ndk", + "libvndksupport", "libfmq", "android.hardware.common-V2-ndk", "android.hardware.common.fmq-V1-ndk", @@ -41,6 +42,7 @@ cc_test { static_libs: [ "android.hardware.sensors-V1-ndk", "VtsHalSensorsTargetTestUtils", + "libaidlcommonsupport", ], test_suites: [ "general-tests", diff --git a/sensors/aidl/vts/SensorsAidlTestSharedMemory.h b/sensors/aidl/vts/SensorsAidlTestSharedMemory.h new file mode 100644 index 0000000000..4b5916a0d7 --- /dev/null +++ b/sensors/aidl/vts/SensorsAidlTestSharedMemory.h @@ -0,0 +1,218 @@ +/* + * 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 ANDROID_SENSORS_AIDL_TEST_SHARED_MEMORY_H +#define ANDROID_SENSORS_AIDL_TEST_SHARED_MEMORY_H + +#include "sensors-vts-utils/GrallocWrapper.h" + +#include +#include +#include + +#include +#include + +#include + +using ::aidl::android::hardware::sensors::BnSensors; +using ::aidl::android::hardware::sensors::Event; +using ::aidl::android::hardware::sensors::ISensors; +using ::aidl::android::hardware::sensors::SensorType; + +template +class SensorsAidlTestSharedMemory { + public: + static SensorsAidlTestSharedMemory* create(ISensors::SharedMemInfo::SharedMemType type, + size_t size) { + constexpr size_t kMaxSize = + 128 * 1024 * 1024; // sensor test should not need more than 128M + if (size == 0 || size >= kMaxSize) { + return nullptr; + } + + auto m = new SensorsAidlTestSharedMemory(type, size); + if (m->mSize != size || m->mBuffer == nullptr) { + delete m; + m = nullptr; + } + return m; + } + + ISensors::SharedMemInfo getSharedMemInfo() const { + ISensors::SharedMemInfo mem = { + .type = mType, + .format = ISensors::SharedMemInfo::SharedMemFormat::SENSORS_EVENT, + .size = static_cast(mSize), + .memoryHandle = android::dupToAidl(mNativeHandle)}; + return mem; + } + char* getBuffer() const { return mBuffer; } + size_t getSize() const { return mSize; } + std::vector parseEvents(int64_t lastCounter = -1, size_t offset = 0) const { + constexpr size_t kEventSize = + static_cast(BnSensors::DIRECT_REPORT_SENSOR_EVENT_TOTAL_LENGTH); + constexpr size_t kOffsetSize = + static_cast(BnSensors::DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_FIELD); + constexpr size_t kOffsetToken = + static_cast(BnSensors::DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_REPORT_TOKEN); + constexpr size_t kOffsetType = + static_cast(BnSensors::DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_SENSOR_TYPE); + constexpr size_t kOffsetAtomicCounter = static_cast( + BnSensors::DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_ATOMIC_COUNTER); + constexpr size_t kOffsetTimestamp = + static_cast(BnSensors::DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_TIMESTAMP); + constexpr size_t kOffsetData = + static_cast(BnSensors::DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_DATA); + + std::vector events; + std::vector data(16); + + while (offset + kEventSize <= mSize) { + int64_t atomicCounter = + *reinterpret_cast(mBuffer + offset + kOffsetAtomicCounter); + if (atomicCounter <= lastCounter) { + ALOGV("atomicCounter = %" PRId64 ", lastCounter = %" PRId64, atomicCounter, + lastCounter); + break; + } + + int32_t size = *reinterpret_cast(mBuffer + offset + kOffsetSize); + if (size != kEventSize) { + // unknown error, events parsed may be wrong, remove all + events.clear(); + break; + } + + int32_t token = *reinterpret_cast(mBuffer + offset + kOffsetToken); + int32_t type = *reinterpret_cast(mBuffer + offset + kOffsetType); + int64_t timestamp = *reinterpret_cast(mBuffer + offset + kOffsetTimestamp); + + ALOGV("offset = %zu, cnt %" PRId64 ", token %" PRId32 ", type %" PRId32 + ", timestamp %" PRId64, + offset, atomicCounter, token, type, timestamp); + + Event event = { + .timestamp = timestamp, + .sensorHandle = token, + .sensorType = type, + }; + + event.set(reinterpret_cast(mBuffer + offset + kOffsetData)); + // event.u.data = android::hardware::hidl_array(reinterpret_cast(mBuffer + offset + kOffsetData)); + + events.push_back(event); + + lastCounter = atomicCounter; + offset += kEventSize; + } + + return events; + } + + virtual ~SensorsAidlTestSharedMemory() { + switch (mType) { + case ISensors::SharedMemInfo::SharedMemType::ASHMEM: { + if (mSize != 0) { + ::munmap(mBuffer, mSize); + mBuffer = nullptr; + + ::native_handle_close(mNativeHandle); + ::native_handle_delete(mNativeHandle); + + mNativeHandle = nullptr; + mSize = 0; + } + break; + } + case ISensors::SharedMemInfo::SharedMemType::GRALLOC: { + if (mSize != 0) { + mGrallocWrapper->freeBuffer(mNativeHandle); + mNativeHandle = nullptr; + mSize = 0; + } + break; + } + default: { + if (mNativeHandle != nullptr || mSize != 0 || mBuffer != nullptr) { + ALOGE("SensorsAidlTestSharedMemory %p not properly destructed: " + "type %d, native handle %p, size %zu, buffer %p", + this, static_cast(mType), mNativeHandle, mSize, mBuffer); + } + break; + } + } + } + + private: + SensorsAidlTestSharedMemory(ISensors::SharedMemInfo::SharedMemType type, size_t size) + : mType(type), mSize(0), mBuffer(nullptr) { + native_handle_t* handle = nullptr; + char* buffer = nullptr; + switch (type) { + case ISensors::SharedMemInfo::SharedMemType::ASHMEM: { + int fd; + handle = ::native_handle_create(1 /*nFds*/, 0 /*nInts*/); + if (handle != nullptr) { + handle->data[0] = fd = + ::ashmem_create_region("SensorsAidlTestSharedMemory", size); + if (handle->data[0] > 0) { + // memory is pinned by default + buffer = static_cast( + ::mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)); + if (buffer != reinterpret_cast(MAP_FAILED)) { + break; + } + ::native_handle_close(handle); + } + ::native_handle_delete(handle); + handle = nullptr; + } + break; + } + case ISensors::SharedMemInfo::SharedMemType::GRALLOC: { + mGrallocWrapper = std::make_unique<::android::GrallocWrapper>(); + if (!mGrallocWrapper->isInitialized()) { + break; + } + + std::pair buf = mGrallocWrapper->allocate(size); + handle = buf.first; + buffer = static_cast(buf.second); + break; + } + default: + break; + } + + if (buffer != nullptr) { + mNativeHandle = handle; + mSize = size; + mBuffer = buffer; + } + } + + ISensors::SharedMemInfo::SharedMemType mType; + native_handle_t* mNativeHandle; + size_t mSize; + char* mBuffer; + std::unique_ptr<::android::GrallocWrapper> mGrallocWrapper; + + DISALLOW_COPY_AND_ASSIGN(SensorsAidlTestSharedMemory); +}; + +#endif // ANDROID_SENSORS_TEST_SHARED_MEMORY_H diff --git a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp index 33645b2a95..608a4b0c4c 100644 --- a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp +++ b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp @@ -26,6 +26,7 @@ #include #include "SensorsAidlEnvironment.h" +#include "SensorsAidlTestSharedMemory.h" #include "sensors-vts-utils/SensorsVtsEnvironmentBase.h" #include @@ -43,6 +44,9 @@ using aidl::android::hardware::sensors::SensorType; using android::ProcessState; using std::chrono::duration_cast; +constexpr size_t kEventSize = + static_cast(ISensors::DIRECT_REPORT_SENSOR_EVENT_TOTAL_LENGTH); + namespace { static void assertTypeMatchStringType(SensorType type, const std::string& stringType) { @@ -97,6 +101,24 @@ static void assertTypeMatchStringType(SensorType type, const std::string& string } } +bool isDirectChannelTypeSupported(SensorInfo sensor, ISensors::SharedMemInfo::SharedMemType type) { + switch (type) { + case ISensors::SharedMemInfo::SharedMemType::ASHMEM: + return (sensor.flags & SensorInfo::SENSOR_FLAG_BITS_DIRECT_CHANNEL_ASHMEM) != 0; + case ISensors::SharedMemInfo::SharedMemType::GRALLOC: + return (sensor.flags & SensorInfo::SENSOR_FLAG_BITS_DIRECT_CHANNEL_GRALLOC) != 0; + default: + return false; + } +} + +bool isDirectReportRateSupported(SensorInfo sensor, ISensors::RateLevel rate) { + unsigned int r = static_cast(sensor.flags & + SensorInfo::SENSOR_FLAG_BITS_MASK_DIRECT_REPORT) >> + static_cast(SensorInfo::SENSOR_FLAG_SHIFT_DIRECT_REPORT); + return r >= static_cast(rate); +} + int expectedReportModeForType(SensorType type) { switch (type) { case SensorType::ACCELEROMETER: @@ -286,6 +308,24 @@ class SensorsAidlTest : public testing::TestWithParam { std::vector getOneShotSensors(); std::vector getInjectEventSensors(); + void verifyDirectChannel(ISensors::SharedMemInfo::SharedMemType memType); + + void verifyRegisterDirectChannel( + std::shared_ptr> mem, + int32_t* directChannelHandle, bool supportsSharedMemType, + bool supportsAnyDirectChannel); + + void verifyConfigure(const SensorInfo& sensor, ISensors::SharedMemInfo::SharedMemType memType, + int32_t directChannelHandle, bool directChannelSupported); + + void queryDirectChannelSupport(ISensors::SharedMemInfo::SharedMemType memType, + bool* supportsSharedMemType, bool* supportsAnyDirectChannel); + + void verifyUnregisterDirectChannel(int32_t* directChannelHandle, bool supportsAnyDirectChannel); + + void checkRateLevel(const SensorInfo& sensor, int32_t directChannelHandle, + ISensors::RateLevel rateLevel, int32_t* reportToken); + inline std::shared_ptr& getSensors() { return mEnvironment->mSensors; } inline SensorsAidlEnvironment* getEnvironment() { return mEnvironment; } @@ -313,6 +353,18 @@ class SensorsAidlTest : public testing::TestWithParam { ndk::ScopedAStatus flush(int32_t sensorHandle) { return getSensors()->flush(sensorHandle); } + ndk::ScopedAStatus registerDirectChannel(const ISensors::SharedMemInfo& mem, + int32_t* aidlReturn); + + ndk::ScopedAStatus unregisterDirectChannel(int32_t* channelHandle) { + return getSensors()->unregisterDirectChannel(*channelHandle); + } + + ndk::ScopedAStatus configDirectReport(int32_t sensorHandle, int32_t channelHandle, + ISensors::RateLevel rate, int32_t* reportToken) { + return getSensors()->configDirectReport(sensorHandle, channelHandle, rate, reportToken); + } + void runSingleFlushTest(const std::vector& sensors, bool activateSensor, int32_t expectedFlushCount, bool expectedResult); @@ -334,6 +386,19 @@ class SensorsAidlTest : public testing::TestWithParam { SensorsAidlEnvironment* mEnvironment; }; +ndk::ScopedAStatus SensorsAidlTest::registerDirectChannel(const ISensors::SharedMemInfo& mem, + int32_t* aidlReturn) { + // If registeration of a channel succeeds, add the handle of channel to a set so that it can be + // unregistered when test fails. Unregister a channel does not remove the handle on purpose. + // Unregistering a channel more than once should not have negative effect. + + ndk::ScopedAStatus status = getSensors()->registerDirectChannel(mem, aidlReturn); + if (status.isOk()) { + mDirectChannelHandles.insert(*aidlReturn); + } + return status; +} + std::vector SensorsAidlTest::getSensorsList() { std::vector sensorInfoList; checkIsOk(getSensors()->getSensorsList(&sensorInfoList)); @@ -850,12 +915,141 @@ TEST_P(SensorsAidlTest, NoStaleEvents) { } } +void SensorsAidlTest::checkRateLevel(const SensorInfo& sensor, int32_t directChannelHandle, + ISensors::RateLevel rateLevel, int32_t* reportToken) { + ndk::ScopedAStatus status = + configDirectReport(sensor.sensorHandle, directChannelHandle, rateLevel, reportToken); + + SCOPED_TRACE(::testing::Message() + << " handle=0x" << std::hex << std::setw(8) << std::setfill('0') + << sensor.sensorHandle << std::dec << " type=" << static_cast(sensor.type) + << " name=" << sensor.name); + + if (isDirectReportRateSupported(sensor, rateLevel)) { + ASSERT_TRUE(status.isOk()); + if (rateLevel != ISensors::RateLevel::STOP) { + ASSERT_GT(*reportToken, 0); + } else { + ASSERT_EQ(status.getExceptionCode(), EX_ILLEGAL_ARGUMENT); + } + } +} + +void SensorsAidlTest::queryDirectChannelSupport(ISensors::SharedMemInfo::SharedMemType memType, + bool* supportsSharedMemType, + bool* supportsAnyDirectChannel) { + *supportsSharedMemType = false; + *supportsAnyDirectChannel = false; + for (const SensorInfo& curSensor : getSensorsList()) { + if (isDirectChannelTypeSupported(curSensor, memType)) { + *supportsSharedMemType = true; + } + if (isDirectChannelTypeSupported(curSensor, + ISensors::SharedMemInfo::SharedMemType::ASHMEM) || + isDirectChannelTypeSupported(curSensor, + ISensors::SharedMemInfo::SharedMemType::GRALLOC)) { + *supportsAnyDirectChannel = true; + } + + if (*supportsSharedMemType && *supportsAnyDirectChannel) { + break; + } + } +} + +void SensorsAidlTest::verifyRegisterDirectChannel( + std::shared_ptr> mem, + int32_t* directChannelHandle, bool supportsSharedMemType, bool supportsAnyDirectChannel) { + char* buffer = mem->getBuffer(); + size_t size = mem->getSize(); + + if (supportsSharedMemType) { + memset(buffer, 0xff, size); + } + + int32_t channelHandle; + + ::ndk::ScopedAStatus status = registerDirectChannel(mem->getSharedMemInfo(), &channelHandle); + if (supportsSharedMemType) { + ASSERT_TRUE(status.isOk()); + ASSERT_EQ(channelHandle, 0); + } else { + int32_t error = supportsAnyDirectChannel ? EX_ILLEGAL_ARGUMENT : EX_UNSUPPORTED_OPERATION; + ASSERT_EQ(status.getExceptionCode(), error); + ASSERT_EQ(channelHandle, -1); + } + directChannelHandle = &channelHandle; +} + +void SensorsAidlTest::verifyUnregisterDirectChannel(int32_t* channelHandle, + bool supportsAnyDirectChannel) { + int result = supportsAnyDirectChannel ? EX_NONE : EX_UNSUPPORTED_OPERATION; + ndk::ScopedAStatus status = unregisterDirectChannel(channelHandle); + ASSERT_EQ(status.getExceptionCode(), result); +} + +void SensorsAidlTest::verifyDirectChannel(ISensors::SharedMemInfo::SharedMemType memType) { + constexpr size_t kNumEvents = 1; + constexpr size_t kMemSize = kNumEvents * kEventSize; + + std::shared_ptr> mem( + SensorsAidlTestSharedMemory::create(memType, kMemSize)); + ASSERT_NE(mem, nullptr); + + bool supportsSharedMemType; + bool supportsAnyDirectChannel; + queryDirectChannelSupport(memType, &supportsSharedMemType, &supportsAnyDirectChannel); + + for (const SensorInfo& sensor : getSensorsList()) { + int32_t directChannelHandle = 0; + verifyRegisterDirectChannel(mem, &directChannelHandle, supportsSharedMemType, + supportsAnyDirectChannel); + verifyConfigure(sensor, memType, directChannelHandle, supportsAnyDirectChannel); + verifyUnregisterDirectChannel(&directChannelHandle, supportsAnyDirectChannel); + } +} + +void SensorsAidlTest::verifyConfigure(const SensorInfo& sensor, + ISensors::SharedMemInfo::SharedMemType memType, + int32_t directChannelHandle, bool supportsAnyDirectChannel) { + SCOPED_TRACE(::testing::Message() + << " handle=0x" << std::hex << std::setw(8) << std::setfill('0') + << sensor.sensorHandle << std::dec << " type=" << static_cast(sensor.type) + << " name=" << sensor.name); + + int32_t reportToken = 0; + if (isDirectChannelTypeSupported(sensor, memType)) { + // Verify that each rate level is properly supported + checkRateLevel(sensor, directChannelHandle, ISensors::RateLevel::NORMAL, &reportToken); + checkRateLevel(sensor, directChannelHandle, ISensors::RateLevel::FAST, &reportToken); + checkRateLevel(sensor, directChannelHandle, ISensors::RateLevel::VERY_FAST, &reportToken); + checkRateLevel(sensor, directChannelHandle, ISensors::RateLevel::STOP, &reportToken); + + // Verify that a sensor handle of -1 is only acceptable when using RateLevel::STOP + ndk::ScopedAStatus status = configDirectReport(-1 /* sensorHandle */, directChannelHandle, + ISensors::RateLevel::NORMAL, &reportToken); + ASSERT_EQ(status.getServiceSpecificError(), android::BAD_VALUE); + + status = configDirectReport(-1 /* sensorHandle */, directChannelHandle, + ISensors::RateLevel::STOP, &reportToken); + ASSERT_TRUE(status.isOk()); + } else { + // directChannelHandle will be -1 here, HAL should either reject it as a bad value if there + // is some level of direct channel report, otherwise return INVALID_OPERATION if direct + // channel is not supported at all + int error = supportsAnyDirectChannel ? EX_ILLEGAL_ARGUMENT : EX_UNSUPPORTED_OPERATION; + ndk::ScopedAStatus status = configDirectReport(sensor.sensorHandle, directChannelHandle, + ISensors::RateLevel::NORMAL, &reportToken); + ASSERT_EQ(status.getExceptionCode(), error); + } +} + TEST_P(SensorsAidlTest, DirectChannelAshmem) { - // TODO(b/195593357): Implement this + verifyDirectChannel(ISensors::SharedMemInfo::SharedMemType::ASHMEM); } TEST_P(SensorsAidlTest, DirectChannelGralloc) { - // TODO(b/195593357): Implement this + verifyDirectChannel(ISensors::SharedMemInfo::SharedMemType::GRALLOC); } GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SensorsAidlTest); -- GitLab From b3bdf0535c895f610588807976aeca673dba059b Mon Sep 17 00:00:00 2001 From: ramindani Date: Wed, 12 Jan 2022 18:27:05 +0000 Subject: [PATCH 409/825] ASSERT error check in brightness test Without ASSERT the next call to take the first element will crash the instrumentation for the tests. BUG: 210151839 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I2c78b9130661e543e62138c064ab15dd79180920 --- .../vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index a591aaa67d..63a6b86696 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1499,7 +1499,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { execute(); { const auto errors = mReader.takeErrors(); - EXPECT_EQ(1, errors.size()); + ASSERT_EQ(1, errors.size()); EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode); } @@ -1507,7 +1507,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { execute(); { const auto errors = mReader.takeErrors(); - EXPECT_EQ(1, errors.size()); + ASSERT_EQ(1, errors.size()); EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode); } } -- GitLab From 13cb0fb2356a23a566fd5cdd1875f686a64878b2 Mon Sep 17 00:00:00 2001 From: Joe Bolinger Date: Fri, 3 Dec 2021 12:45:48 -0800 Subject: [PATCH 410/825] Update common and fingerprint AIDL for session logging. This also partially reverts commit 1988b3825bc95a0e7e3bb86bfa5bf70ea5323a61 which unnecessarily froze the interface during a prior interface addition. Bug: 204585936 Bug: 204584403 Test: atest VtsHalBiometricsFingerprintTargetTest Change-Id: Ibc9934390a487f5bfb9d3678ad65e7b1c3740ae7 --- .../biometrics/common/OperationContext.aidl} | 21 +++----- .../biometrics/common/OperationReason.aidl} | 13 ++--- .../biometrics/common/OperationContext.aidl | 49 +++++++++++++++++ .../biometrics/common/OperationReason.aidl | 37 +++++++++++++ biometrics/fingerprint/aidl/Android.bp | 7 +-- .../2/.hash | 1 - .../biometrics/fingerprint/AcquiredInfo.aidl | 50 ----------------- .../biometrics/fingerprint/IFingerprint.aidl | 39 -------------- .../biometrics/fingerprint/ISession.aidl | 51 ------------------ .../fingerprint/ISessionCallback.aidl | 53 ------------------- .../biometrics/fingerprint/SensorProps.aidl | 44 --------------- .../biometrics/fingerprint/ISession.aidl | 5 ++ .../fingerprint/PointerContext.aidl} | 13 ++--- .../biometrics/fingerprint/ISession.aidl | 29 +++++++++- .../fingerprint/PointerContext.aidl | 41 ++++++++++++++ .../fingerprint/aidl/default/Android.bp | 2 +- .../fingerprint/aidl/default/Session.cpp | 26 +++++++++ .../aidl/default/include/Session.h | 16 ++++++ 18 files changed, 224 insertions(+), 273 deletions(-) rename biometrics/{fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/Error.aidl => common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl} (83%) rename biometrics/{fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl => common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationReason.aidl} (87%) create mode 100644 biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl create mode 100644 biometrics/common/aidl/android/hardware/biometrics/common/OperationReason.aidl delete mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/.hash delete mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl delete mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/IFingerprint.aidl delete mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISession.aidl delete mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISessionCallback.aidl delete mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorProps.aidl rename biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/{2/android/hardware/biometrics/fingerprint/SensorLocation.aidl => current/android/hardware/biometrics/fingerprint/PointerContext.aidl} (92%) create mode 100644 biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/Error.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl similarity index 83% rename from biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/Error.aidl rename to biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl index af7bc3c56b..3a6461ed91 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/Error.aidl +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 The Android Open Source Project + * 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. @@ -31,16 +31,11 @@ // 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.fingerprint; -@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, - BAD_CALIBRATION = 8, +package android.hardware.biometrics.common; +@VintfStability +parcelable OperationContext { + int id = 0; + android.hardware.biometrics.common.OperationReason reason = android.hardware.biometrics.common.OperationReason.UNKNOWN; + boolean isAoD = false; + boolean isCrypto = false; } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationReason.aidl similarity index 87% rename from biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl rename to biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationReason.aidl index 9c208c4e7c..3da3a6ab0b 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationReason.aidl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 The Android Open Source Project + * 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. @@ -31,13 +31,10 @@ // 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.fingerprint; +package android.hardware.biometrics.common; @Backing(type="byte") @VintfStability -enum FingerprintSensorType { +enum OperationReason { UNKNOWN = 0, - REAR = 1, - UNDER_DISPLAY_ULTRASONIC = 2, - UNDER_DISPLAY_OPTICAL = 3, - POWER_BUTTON = 4, - HOME_BUTTON = 5, + BIOMETRIC_PROMPT = 1, + KEYGUARD = 2, } diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl new file mode 100644 index 0000000000..390e6985e4 --- /dev/null +++ b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl @@ -0,0 +1,49 @@ +/* + * 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. + */ + +package android.hardware.biometrics.common; + +import android.hardware.biometrics.common.OperationReason; + +/** + * Additional context associated with an operation. + */ +@VintfStability +parcelable OperationContext { + /** + * An identifier for the logical action that the user is engaged in. These identifiers are + * not guaranteed to be unique. However, the framework will not reuse identifiers within + * short periods of time so they can be made unique, if needed, by appending a timestamp. + * + * Zero if the reason is OperationReason.UNKNOWN. + */ + int id = 0; + + /** + * A logical reason for this operation. + * + * This should be interpreted as a hint to enable optimizations or tracing. The + * framework may choose to use OperationReason.UNKNOWN at any time based on the device's + * policy. + */ + OperationReason reason = OperationReason.UNKNOWN; + + /* Flag indicating that the display is in AoD mode. */ + boolean isAoD = false; + + /** Flag indicating that crypto was requested. */ + boolean isCrypto = false; +} diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/OperationReason.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/OperationReason.aidl new file mode 100644 index 0000000000..abc25ed663 --- /dev/null +++ b/biometrics/common/aidl/android/hardware/biometrics/common/OperationReason.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.biometrics.common; + +@VintfStability +@Backing(type="byte") +enum OperationReason { + /** + * A normal operation without an explicit reason. + */ + UNKNOWN, + + /** + * An operation associated with biometric prompt. This may be due to either application or + * system use, but it is not related to KEYGUARD device entry. + */ + BIOMETRIC_PROMPT, + + /** + * An operation associated with device entry. + */ + KEYGUARD, +} diff --git a/biometrics/fingerprint/aidl/Android.bp b/biometrics/fingerprint/aidl/Android.bp index c46150ebe5..c3a056cc2b 100644 --- a/biometrics/fingerprint/aidl/Android.bp +++ b/biometrics/fingerprint/aidl/Android.bp @@ -15,7 +15,7 @@ aidl_interface { ], imports: [ "android.hardware.biometrics.common", - "android.hardware.keymaster", + "android.hardware.keymaster-V3", ], stability: "vintf", backend: { @@ -26,8 +26,5 @@ aidl_interface { enabled: false, }, }, - versions: [ - "1", - "2", - ], + versions: ["1"], } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/.hash b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/.hash deleted file mode 100644 index 411cb751cb..0000000000 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/.hash +++ /dev/null @@ -1 +0,0 @@ -762eb38ce93ea3c7d39a680949cbdbd2371b3f06 diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl deleted file mode 100644 index c51aa033d4..0000000000 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.fingerprint; -@Backing(type="byte") @VintfStability -enum AcquiredInfo { - UNKNOWN = 0, - GOOD = 1, - PARTIAL = 2, - INSUFFICIENT = 3, - SENSOR_DIRTY = 4, - TOO_SLOW = 5, - TOO_FAST = 6, - VENDOR = 7, - START = 8, - TOO_DARK = 9, - TOO_BRIGHT = 10, - IMMOBILE = 11, - RETRYING_CAPTURE = 12, -} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/IFingerprint.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/IFingerprint.aidl deleted file mode 100644 index 5d3df6fbaa..0000000000 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/IFingerprint.aidl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.fingerprint; -@VintfStability -interface IFingerprint { - android.hardware.biometrics.fingerprint.SensorProps[] getSensorProps(); - android.hardware.biometrics.fingerprint.ISession createSession(in int sensorId, in int userId, in android.hardware.biometrics.fingerprint.ISessionCallback cb); -} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISession.aidl deleted file mode 100644 index 9934a763e7..0000000000 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISession.aidl +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.fingerprint; -@VintfStability -interface ISession { - void generateChallenge(); - void revokeChallenge(in long challenge); - android.hardware.biometrics.common.ICancellationSignal enroll(in android.hardware.keymaster.HardwareAuthToken hat); - android.hardware.biometrics.common.ICancellationSignal authenticate(in long operationId); - android.hardware.biometrics.common.ICancellationSignal detectInteraction(); - void enumerateEnrollments(); - void removeEnrollments(in int[] enrollmentIds); - void getAuthenticatorId(); - void invalidateAuthenticatorId(); - void resetLockout(in android.hardware.keymaster.HardwareAuthToken hat); - void close(); - void onPointerDown(in int pointerId, in int x, in int y, in float minor, in float major); - void onPointerUp(in int pointerId); - void onUiReady(); -} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISessionCallback.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISessionCallback.aidl deleted file mode 100644 index 3c40ad63bf..0000000000 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISessionCallback.aidl +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.fingerprint; -@VintfStability -interface ISessionCallback { - void onChallengeGenerated(in long challenge); - void onChallengeRevoked(in long challenge); - void onAcquired(in android.hardware.biometrics.fingerprint.AcquiredInfo info, in int vendorCode); - void onError(in android.hardware.biometrics.fingerprint.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 onEnrollmentsRemoved(in int[] enrollmentIds); - void onAuthenticatorIdRetrieved(in long authenticatorId); - void onAuthenticatorIdInvalidated(in long newAuthenticatorId); - void onSessionClosed(); -} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorProps.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorProps.aidl deleted file mode 100644 index 782d2899d3..0000000000 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorProps.aidl +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.fingerprint; -@VintfStability -parcelable SensorProps { - android.hardware.biometrics.common.CommonProps commonProps; - android.hardware.biometrics.fingerprint.FingerprintSensorType sensorType = android.hardware.biometrics.fingerprint.FingerprintSensorType.UNKNOWN; - android.hardware.biometrics.fingerprint.SensorLocation[] sensorLocations; - boolean supportsNavigationGestures; - boolean supportsDetectInteraction; - boolean halHandlesDisplayTouches; - boolean halControlsIllumination; -} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl index 9934a763e7..4e7b3b451e 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl @@ -48,4 +48,9 @@ interface ISession { void onPointerDown(in int pointerId, in int x, in int y, in float minor, in float major); void onPointerUp(in int pointerId); void onUiReady(); + android.hardware.biometrics.common.ICancellationSignal authenticateWithContext(in long operationId, in android.hardware.biometrics.common.OperationContext context); + android.hardware.biometrics.common.ICancellationSignal enrollWithContext(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.common.OperationContext context); + android.hardware.biometrics.common.ICancellationSignal detectInteractionWithContext(in android.hardware.biometrics.common.OperationContext context); + void onPointerDownWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); + void onPointerUpWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorLocation.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl similarity index 92% rename from biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorLocation.aidl rename to biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl index 295fde9f5f..e383330b69 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorLocation.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl @@ -33,10 +33,11 @@ package android.hardware.biometrics.fingerprint; @VintfStability -parcelable SensorLocation { - int displayId; - int sensorLocationX; - int sensorLocationY; - int sensorRadius; - String display = ""; +parcelable PointerContext { + int pointerId = 0; + int x = 0; + int y = 0; + float minor = 0.000000f; + float major = 0.000000f; + boolean isAoD = false; } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl index f1d96d3039..ea8c6aa869 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl @@ -17,6 +17,8 @@ package android.hardware.biometrics.fingerprint; import android.hardware.biometrics.common.ICancellationSignal; +import android.hardware.biometrics.common.OperationContext; +import android.hardware.biometrics.fingerprint.PointerContext; import android.hardware.keymaster.HardwareAuthToken; /** @@ -140,7 +142,7 @@ interface ISession { * * @param hat See above documentation. * @return ICancellationSignal An object that can be used by the framework to cancel this - * operation. + * operation. */ ICancellationSignal enroll(in HardwareAuthToken hat); @@ -234,7 +236,7 @@ interface ISession { * - ISessionCallback#onAcquired * * @return ICancellationSignal An object that can be used by the framework to cancel this - * operation. + * operation. */ ICancellationSignal detectInteraction(); @@ -448,4 +450,27 @@ interface ISession { * HAL, the framework will invoke this operation to notify when the illumination is showing. */ void onUiReady(); + + /** + * These are alternative methods for some operations to allow the HAL to make optional + * optimizations during execution. + * + * HALs may ignore the additional context and treat all *WithContext methods the same as + * the original methods. + */ + + /** See ISession#authenticate(long) */ + ICancellationSignal authenticateWithContext(in long operationId, in OperationContext context); + + /** See ISession#enroll(HardwareAuthToken) */ + ICancellationSignal enrollWithContext(in HardwareAuthToken hat, in OperationContext context); + + /** See ISession#detectInteraction() */ + ICancellationSignal detectInteractionWithContext(in OperationContext context); + + /** See ISession#onPointerDown(int, int, int, float, float) */ + void onPointerDownWithContext(in PointerContext context); + + /** See ISession#onPointerUp(int) */ + void onPointerUpWithContext(in PointerContext context); } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl new file mode 100644 index 0000000000..4975175d8c --- /dev/null +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.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. + */ + +package android.hardware.biometrics.fingerprint; + +/** + * Additional context associated with a pointer event. + */ +@VintfStability +parcelable PointerContext { + /* See android.view.MotionEvent#getPointerId. */ + int pointerId = 0; + + /* The distance in pixels from the left edge of the display. */ + int x = 0; + + /* The distance in pixels from the top edge of the display. */ + int y = 0; + + /* See android.view.MotionEvent#getTouchMinor. */ + float minor = 0f; + + /* See android.view.MotionEvent#getTouchMajor. */ + float major = 0f; + + /* Flag indicating that the display is in AoD mode. */ + boolean isAoD = false; +} diff --git a/biometrics/fingerprint/aidl/default/Android.bp b/biometrics/fingerprint/aidl/default/Android.bp index d4194a3afb..430bf3cd82 100644 --- a/biometrics/fingerprint/aidl/default/Android.bp +++ b/biometrics/fingerprint/aidl/default/Android.bp @@ -25,7 +25,7 @@ cc_binary { "libbase", "libbinder_ndk", "android.hardware.biometrics.fingerprint-V2-ndk", - "android.hardware.biometrics.common-V1-ndk", + "android.hardware.biometrics.common-V2-ndk", ], } diff --git a/biometrics/fingerprint/aidl/default/Session.cpp b/biometrics/fingerprint/aidl/default/Session.cpp index ca481e7cf0..8cbcfc77c5 100644 --- a/biometrics/fingerprint/aidl/default/Session.cpp +++ b/biometrics/fingerprint/aidl/default/Session.cpp @@ -244,4 +244,30 @@ ndk::ScopedAStatus Session::onUiReady() { return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Session::authenticateWithContext( + int64_t operationId, const common::OperationContext& /*context*/, + std::shared_ptr* out) { + return authenticate(operationId, out); +} + +ndk::ScopedAStatus Session::enrollWithContext(const keymaster::HardwareAuthToken& hat, + const common::OperationContext& /*context*/, + std::shared_ptr* out) { + return enroll(hat, out); +} + +ndk::ScopedAStatus Session::detectInteractionWithContext( + const common::OperationContext& /*context*/, + std::shared_ptr* out) { + return detectInteraction(out); +} + +ndk::ScopedAStatus Session::onPointerDownWithContext(const PointerContext& context) { + return onPointerDown(context.pointerId, context.x, context.y, context.minor, context.major); +} + +ndk::ScopedAStatus Session::onPointerUpWithContext(const PointerContext& context) { + return onPointerUp(context.pointerId); +} + } // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/include/Session.h b/biometrics/fingerprint/aidl/default/include/Session.h index 9e464229e1..584cb27b96 100644 --- a/biometrics/fingerprint/aidl/default/include/Session.h +++ b/biometrics/fingerprint/aidl/default/include/Session.h @@ -79,6 +79,22 @@ class Session : public BnSession { ndk::ScopedAStatus onUiReady() override; + ndk::ScopedAStatus authenticateWithContext( + int64_t operationId, const common::OperationContext& context, + std::shared_ptr* out) override; + + ndk::ScopedAStatus enrollWithContext( + const keymaster::HardwareAuthToken& hat, const common::OperationContext& context, + std::shared_ptr* out) override; + + ndk::ScopedAStatus detectInteractionWithContext( + const common::OperationContext& context, + std::shared_ptr* out) override; + + ndk::ScopedAStatus onPointerDownWithContext(const PointerContext& context) override; + + ndk::ScopedAStatus onPointerUpWithContext(const PointerContext& context) override; + bool isClosed(); private: -- GitLab From 687ce13059f60539d8e2dfc1e6ba74c04fb78602 Mon Sep 17 00:00:00 2001 From: Ahmed ElArabawy Date: Tue, 11 Jan 2022 16:42:48 -0800 Subject: [PATCH 411/825] Wifi: Uprev wifi HAL to 1.6 This commit uprevs the Wifi vendor HAL to 1.6 Bug: 214108561 Test: atest VtsHalWifiV1_0TargetTest VtsHalWifiNanV1_0TargetTest VtsHalWifiApV1_0TargetTest \ VtsHalWifiV1_1TargetTest \ VtsHalWifiV1_2TargetTest VtsHalWifiNanV1_2TargetTest \ VtsHalWifiV1_3TargetTest \ VtsHalWifiApV1_4TargetTest VtsHalWifiNanV1_4TargetTest VtsHalWifiRttV1_4TargetTest \ VtsHalWifiV1_5TargetTest VtsHalWifiNanV1_5TargetTest VtsHalWifiApV1_5TargetTest Change-Id: I059a5de346e353f7fba1e008ecd9fb4611e66880 --- .../compatibility_matrix.current.xml | 2 +- wifi/1.5/default/hidl_struct_util.h | 227 --- .../tests/wifi_nan_iface_unit_tests.cpp | 162 -- wifi/1.5/default/wifi_nan_iface.cpp | 1003 ----------- wifi/1.5/default/wifi_nan_iface.h | 212 --- wifi/1.5/default/wifi_rtt_controller.cpp | 351 ---- wifi/1.5/default/wifi_sta_iface.h | 187 -- wifi/1.6/Android.bp | 32 + wifi/1.6/IWifi.hal | 27 + wifi/{1.5 => 1.6}/default/Android.bp | 0 wifi/{1.5 => 1.6}/default/Android.mk | 10 +- wifi/{1.5 => 1.6}/default/OWNERS | 0 wifi/{1.5 => 1.6}/default/THREADING.README | 0 .../android.hardware.wifi@1.0-service-lazy.rc | 0 .../android.hardware.wifi@1.0-service.rc | 1 + .../android.hardware.wifi@1.0-service.xml | 2 +- .../{1.5 => 1.6}/default/hidl_callback_util.h | 25 +- wifi/{1.5 => 1.6}/default/hidl_return_util.h | 32 +- .../{1.5 => 1.6}/default/hidl_struct_util.cpp | 1517 +++++++---------- wifi/1.6/default/hidl_struct_util.h | 200 +++ wifi/{1.5 => 1.6}/default/hidl_sync_util.cpp | 4 +- wifi/{1.5 => 1.6}/default/hidl_sync_util.h | 4 +- wifi/{1.5 => 1.6}/default/ringbuffer.cpp | 7 +- wifi/{1.5 => 1.6}/default/ringbuffer.h | 8 +- wifi/{1.5 => 1.6}/default/service.cpp | 34 +- .../tests/hidl_struct_util_unit_tests.cpp | 215 +-- wifi/{1.5 => 1.6}/default/tests/main.cpp | 0 .../default/tests/mock_interface_tool.cpp | 0 .../default/tests/mock_interface_tool.h | 8 +- .../default/tests/mock_wifi_feature_flags.cpp | 4 +- .../default/tests/mock_wifi_feature_flags.h | 9 +- .../default/tests/mock_wifi_iface_util.cpp | 9 +- .../default/tests/mock_wifi_iface_util.h | 20 +- .../default/tests/mock_wifi_legacy_hal.cpp | 9 +- .../default/tests/mock_wifi_legacy_hal.h | 41 +- .../tests/mock_wifi_mode_controller.cpp | 4 +- .../default/tests/mock_wifi_mode_controller.h | 6 +- .../default/tests/ringbuffer_unit_tests.cpp | 6 +- wifi/{1.5 => 1.6}/default/tests/runtests.sh | 0 .../default/tests/wifi_chip_unit_tests.cpp | 349 ++-- .../tests/wifi_iface_util_unit_tests.cpp | 25 +- .../tests/wifi_nan_iface_unit_tests.cpp | 132 ++ wifi/{1.5 => 1.6}/default/wifi.cpp | 106 +- wifi/{1.5 => 1.6}/default/wifi.h | 40 +- wifi/{1.5 => 1.6}/default/wifi_ap_iface.cpp | 88 +- wifi/{1.5 => 1.6}/default/wifi_ap_iface.h | 34 +- wifi/{1.5 => 1.6}/default/wifi_chip.cpp | 804 ++++----- wifi/{1.5 => 1.6}/default/wifi_chip.h | 249 ++- .../default/wifi_feature_flags.cpp | 47 +- .../{1.5 => 1.6}/default/wifi_feature_flags.h | 11 +- wifi/{1.5 => 1.6}/default/wifi_iface_util.cpp | 34 +- wifi/{1.5 => 1.6}/default/wifi_iface_util.h | 20 +- wifi/{1.5 => 1.6}/default/wifi_legacy_hal.cpp | 1119 ++++++------ wifi/{1.5 => 1.6}/default/wifi_legacy_hal.h | 303 ++-- .../default/wifi_legacy_hal_factory.cpp | 45 +- .../default/wifi_legacy_hal_factory.h | 11 +- .../default/wifi_legacy_hal_stubs.cpp | 4 +- .../default/wifi_legacy_hal_stubs.h | 4 +- .../default/wifi_mode_controller.cpp | 10 +- .../default/wifi_mode_controller.h | 8 +- wifi/1.6/default/wifi_nan_iface.cpp | 905 ++++++++++ wifi/1.6/default/wifi_nan_iface.h | 174 ++ wifi/{1.5 => 1.6}/default/wifi_p2p_iface.cpp | 17 +- wifi/{1.5 => 1.6}/default/wifi_p2p_iface.h | 8 +- wifi/1.6/default/wifi_rtt_controller.cpp | 311 ++++ .../default/wifi_rtt_controller.h | 75 +- wifi/{1.5 => 1.6}/default/wifi_sta_iface.cpp | 490 +++--- wifi/1.6/default/wifi_sta_iface.h | 155 ++ .../{1.5 => 1.6}/default/wifi_status_util.cpp | 22 +- wifi/{1.5 => 1.6}/default/wifi_status_util.h | 7 +- 70 files changed, 4374 insertions(+), 5611 deletions(-) delete mode 100644 wifi/1.5/default/hidl_struct_util.h delete mode 100644 wifi/1.5/default/tests/wifi_nan_iface_unit_tests.cpp delete mode 100644 wifi/1.5/default/wifi_nan_iface.cpp delete mode 100644 wifi/1.5/default/wifi_nan_iface.h delete mode 100644 wifi/1.5/default/wifi_rtt_controller.cpp delete mode 100644 wifi/1.5/default/wifi_sta_iface.h create mode 100644 wifi/1.6/Android.bp create mode 100644 wifi/1.6/IWifi.hal rename wifi/{1.5 => 1.6}/default/Android.bp (100%) rename wifi/{1.5 => 1.6}/default/Android.mk (96%) rename wifi/{1.5 => 1.6}/default/OWNERS (100%) rename wifi/{1.5 => 1.6}/default/THREADING.README (100%) rename wifi/{1.5 => 1.6}/default/android.hardware.wifi@1.0-service-lazy.rc (100%) rename wifi/{1.5 => 1.6}/default/android.hardware.wifi@1.0-service.rc (90%) rename wifi/{1.5 => 1.6}/default/android.hardware.wifi@1.0-service.xml (90%) rename wifi/{1.5 => 1.6}/default/hidl_callback_util.h (88%) rename wifi/{1.5 => 1.6}/default/hidl_return_util.h (77%) rename wifi/{1.5 => 1.6}/default/hidl_struct_util.cpp (63%) create mode 100644 wifi/1.6/default/hidl_struct_util.h rename wifi/{1.5 => 1.6}/default/hidl_sync_util.cpp (96%) rename wifi/{1.5 => 1.6}/default/hidl_sync_util.h (96%) rename wifi/{1.5 => 1.6}/default/ringbuffer.cpp (91%) rename wifi/{1.5 => 1.6}/default/ringbuffer.h (95%) rename wifi/{1.5 => 1.6}/default/service.cpp (63%) rename wifi/{1.5 => 1.6}/default/tests/hidl_struct_util_unit_tests.cpp (74%) rename wifi/{1.5 => 1.6}/default/tests/main.cpp (100%) rename wifi/{1.5 => 1.6}/default/tests/mock_interface_tool.cpp (100%) rename wifi/{1.5 => 1.6}/default/tests/mock_interface_tool.h (83%) rename wifi/{1.5 => 1.6}/default/tests/mock_wifi_feature_flags.cpp (96%) rename wifi/{1.5 => 1.6}/default/tests/mock_wifi_feature_flags.h (89%) rename wifi/{1.5 => 1.6}/default/tests/mock_wifi_iface_util.cpp (82%) rename wifi/{1.5 => 1.6}/default/tests/mock_wifi_iface_util.h (71%) rename wifi/{1.5 => 1.6}/default/tests/mock_wifi_legacy_hal.cpp (84%) rename wifi/{1.5 => 1.6}/default/tests/mock_wifi_legacy_hal.h (56%) rename wifi/{1.5 => 1.6}/default/tests/mock_wifi_mode_controller.cpp (96%) rename wifi/{1.5 => 1.6}/default/tests/mock_wifi_mode_controller.h (96%) rename wifi/{1.5 => 1.6}/default/tests/ringbuffer_unit_tests.cpp (98%) rename wifi/{1.5 => 1.6}/default/tests/runtests.sh (100%) rename wifi/{1.5 => 1.6}/default/tests/wifi_chip_unit_tests.cpp (74%) rename wifi/{1.5 => 1.6}/default/tests/wifi_iface_util_unit_tests.cpp (82%) create mode 100644 wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp rename wifi/{1.5 => 1.6}/default/wifi.cpp (74%) rename wifi/{1.5 => 1.6}/default/wifi.h (79%) rename wifi/{1.5 => 1.6}/default/wifi_ap_iface.cpp (75%) rename wifi/{1.5 => 1.6}/default/wifi_ap_iface.h (75%) rename wifi/{1.5 => 1.6}/default/wifi_chip.cpp (73%) rename wifi/{1.5 => 1.6}/default/wifi_chip.h (55%) rename wifi/{1.5 => 1.6}/default/wifi_feature_flags.cpp (87%) rename wifi/{1.5 => 1.6}/default/wifi_feature_flags.h (94%) rename wifi/{1.5 => 1.6}/default/wifi_iface_util.cpp (85%) rename wifi/{1.5 => 1.6}/default/wifi_iface_util.h (85%) rename wifi/{1.5 => 1.6}/default/wifi_legacy_hal.cpp (57%) rename wifi/{1.5 => 1.6}/default/wifi_legacy_hal.h (73%) rename wifi/{1.5 => 1.6}/default/wifi_legacy_hal_factory.cpp (87%) rename wifi/{1.5 => 1.6}/default/wifi_legacy_hal_factory.h (92%) rename wifi/{1.5 => 1.6}/default/wifi_legacy_hal_stubs.cpp (99%) rename wifi/{1.5 => 1.6}/default/wifi_legacy_hal_stubs.h (96%) rename wifi/{1.5 => 1.6}/default/wifi_mode_controller.cpp (90%) rename wifi/{1.5 => 1.6}/default/wifi_mode_controller.h (96%) create mode 100644 wifi/1.6/default/wifi_nan_iface.cpp create mode 100644 wifi/1.6/default/wifi_nan_iface.h rename wifi/{1.5 => 1.6}/default/wifi_p2p_iface.cpp (86%) rename wifi/{1.5 => 1.6}/default/wifi_p2p_iface.h (96%) create mode 100644 wifi/1.6/default/wifi_rtt_controller.cpp rename wifi/{1.5 => 1.6}/default/wifi_rtt_controller.h (59%) rename wifi/{1.5 => 1.6}/default/wifi_sta_iface.cpp (54%) create mode 100644 wifi/1.6/default/wifi_sta_iface.h rename wifi/{1.5 => 1.6}/default/wifi_status_util.cpp (87%) rename wifi/{1.5 => 1.6}/default/wifi_status_util.h (90%) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index cf856889df..aaebb6b813 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -777,7 +777,7 @@ android.hardware.wifi - 1.3-5 + 1.3-6 IWifi default diff --git a/wifi/1.5/default/hidl_struct_util.h b/wifi/1.5/default/hidl_struct_util.h deleted file mode 100644 index 352f213664..0000000000 --- a/wifi/1.5/default/hidl_struct_util.h +++ /dev/null @@ -1,227 +0,0 @@ -/* - * 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 HIDL_STRUCT_UTIL_H_ -#define HIDL_STRUCT_UTIL_H_ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "wifi_legacy_hal.h" - -/** - * This file contains a bunch of functions to convert structs from the legacy - * HAL to HIDL and vice versa. - * TODO(b/32093047): Add unit tests for these conversion methods in the VTS test - * suite. - */ -namespace android { -namespace hardware { -namespace wifi { -namespace V1_5 { -namespace implementation { -namespace hidl_struct_util { -using namespace android::hardware::wifi::V1_0; - -// Chip conversion methods. -bool convertLegacyFeaturesToHidlChipCapabilities( - uint64_t legacy_feature_set, uint32_t legacy_logger_feature_set, - uint32_t* hidl_caps); -bool convertLegacyDebugRingBufferStatusToHidl( - const legacy_hal::wifi_ring_buffer_status& legacy_status, - WifiDebugRingBufferStatus* hidl_status); -bool convertLegacyVectorOfDebugRingBufferStatusToHidl( - const std::vector& legacy_status_vec, - std::vector* hidl_status_vec); -bool convertLegacyWakeReasonStatsToHidl( - const legacy_hal::WakeReasonStats& legacy_stats, - WifiDebugHostWakeReasonStats* hidl_stats); -legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy( - V1_1::IWifiChip::TxPowerScenario hidl_scenario); -legacy_hal::wifi_latency_mode convertHidlLatencyModeToLegacy( - V1_3::IWifiChip::LatencyMode hidl_latency_mode); -legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy_1_2( - V1_2::IWifiChip::TxPowerScenario hidl_scenario); -bool convertLegacyWifiMacInfosToHidl( - const std::vector& legacy_mac_infos, - std::vector* - hidl_radio_mode_infos); -legacy_hal::wifi_interface_type convertHidlIfaceTypeToLegacy( - IfaceType hidl_interface_type); -legacy_hal::wifi_multi_sta_use_case convertHidlMultiStaUseCaseToLegacy( - IWifiChip::MultiStaUseCase use_case); -bool convertHidlCoexUnsafeChannelToLegacy( - const IWifiChip::CoexUnsafeChannel& hidl_unsafe_channel, - legacy_hal::wifi_coex_unsafe_channel* legacy_unsafe_channel); -bool convertHidlVectorOfCoexUnsafeChannelToLegacy( - const std::vector& hidl_unsafe_channels, - std::vector* legacy_unsafe_channels); - -// STA iface conversion methods. -bool convertLegacyFeaturesToHidlStaCapabilities( - uint64_t legacy_feature_set, uint32_t legacy_logger_feature_set, - uint32_t* hidl_caps); -bool convertLegacyApfCapabilitiesToHidl( - const legacy_hal::PacketFilterCapabilities& legacy_caps, - StaApfPacketFilterCapabilities* hidl_caps); -bool convertLegacyGscanCapabilitiesToHidl( - const legacy_hal::wifi_gscan_capabilities& legacy_caps, - StaBackgroundScanCapabilities* hidl_caps); -legacy_hal::wifi_band convertHidlWifiBandToLegacy(V1_0::WifiBand band); -bool convertHidlGscanParamsToLegacy( - const StaBackgroundScanParameters& hidl_scan_params, - legacy_hal::wifi_scan_cmd_params* legacy_scan_params); -// |has_ie_data| indicates whether or not the wifi_scan_result includes 802.11 -// Information Elements (IEs) -bool convertLegacyGscanResultToHidl( - const legacy_hal::wifi_scan_result& legacy_scan_result, bool has_ie_data, - StaScanResult* hidl_scan_result); -// |cached_results| is assumed to not include IEs. -bool convertLegacyVectorOfCachedGscanResultsToHidl( - const std::vector& - legacy_cached_scan_results, - std::vector* hidl_scan_datas); -bool convertLegacyLinkLayerStatsToHidl( - const legacy_hal::LinkLayerStats& legacy_stats, - StaLinkLayerStats* hidl_stats); -bool convertLegacyRoamingCapabilitiesToHidl( - const legacy_hal::wifi_roaming_capabilities& legacy_caps, - StaRoamingCapabilities* hidl_caps); -bool convertHidlRoamingConfigToLegacy( - const StaRoamingConfig& hidl_config, - legacy_hal::wifi_roaming_config* legacy_config); -legacy_hal::fw_roaming_state_t convertHidlRoamingStateToLegacy( - StaRoamingState state); -bool convertLegacyVectorOfDebugTxPacketFateToHidl( - const std::vector& legacy_fates, - std::vector* hidl_fates); -bool convertLegacyVectorOfDebugRxPacketFateToHidl( - const std::vector& legacy_fates, - std::vector* hidl_fates); - -// NAN iface conversion methods. -void convertToWifiNanStatus(legacy_hal::NanStatusType type, const char* str, - size_t max_len, WifiNanStatus* wifiNanStatus); -bool convertHidlNanEnableRequestToLegacy( - const V1_4::NanEnableRequest& hidl_request, - legacy_hal::NanEnableRequest* legacy_request); -bool convertHidlNanConfigRequestToLegacy( - const V1_4::NanConfigRequest& hidl_request, - legacy_hal::NanConfigRequest* legacy_request); -bool convertHidlNanEnableRequest_1_4ToLegacy( - const V1_4::NanEnableRequest& hidl_request1, - const NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanEnableRequest* legacy_request); -bool convertHidlNanConfigRequest_1_4ToLegacy( - const V1_4::NanConfigRequest& hidl_request1, - const NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanConfigRequest* legacy_request); -bool convertHidlNanEnableRequest_1_5ToLegacy( - const V1_4::NanEnableRequest& hidl_request1, - const NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanEnableRequest* legacy_request); -bool convertHidlNanConfigRequest_1_5ToLegacy( - const V1_4::NanConfigRequest& hidl_request1, - const NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanConfigRequest* legacy_request); -bool convertHidlNanPublishRequestToLegacy( - const NanPublishRequest& hidl_request, - legacy_hal::NanPublishRequest* legacy_request); -bool convertHidlNanSubscribeRequestToLegacy( - const NanSubscribeRequest& hidl_request, - legacy_hal::NanSubscribeRequest* legacy_request); -bool convertHidlNanTransmitFollowupRequestToLegacy( - const NanTransmitFollowupRequest& hidl_request, - legacy_hal::NanTransmitFollowupRequest* legacy_request); -bool convertHidlNanDataPathInitiatorRequestToLegacy( - const NanInitiateDataPathRequest& hidl_request, - legacy_hal::NanDataPathInitiatorRequest* legacy_request); -bool convertHidlNanDataPathIndicationResponseToLegacy( - const NanRespondToDataPathIndicationRequest& hidl_response, - legacy_hal::NanDataPathIndicationResponse* legacy_response); -bool convertLegacyNanResponseHeaderToHidl( - const legacy_hal::NanResponseMsg& legacy_response, - WifiNanStatus* wifiNanStatus); -bool convertLegacyNanCapabilitiesResponseToHidl( - const legacy_hal::NanCapabilities& legacy_response, - NanCapabilities* hidl_response); -bool convertLegacyNanMatchIndToHidl(const legacy_hal::NanMatchInd& legacy_ind, - NanMatchInd* hidl_ind); -bool convertLegacyNanFollowupIndToHidl( - const legacy_hal::NanFollowupInd& legacy_ind, - NanFollowupReceivedInd* hidl_ind); -bool convertLegacyNanDataPathRequestIndToHidl( - const legacy_hal::NanDataPathRequestInd& legacy_ind, - NanDataPathRequestInd* hidl_ind); -bool convertLegacyNanDataPathConfirmIndToHidl( - const legacy_hal::NanDataPathConfirmInd& legacy_ind, - V1_2::NanDataPathConfirmInd* hidl_ind); -bool convertLegacyNanDataPathScheduleUpdateIndToHidl( - const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind, - V1_2::NanDataPathScheduleUpdateInd* hidl_ind); - -// RTT controller conversion methods. -bool convertHidlVectorOfRttConfigToLegacy( - const std::vector& hidl_configs, - std::vector* legacy_configs); -bool convertHidlRttLciInformationToLegacy( - const RttLciInformation& hidl_info, - legacy_hal::wifi_lci_information* legacy_info); -bool convertHidlRttLcrInformationToLegacy( - const RttLcrInformation& hidl_info, - legacy_hal::wifi_lcr_information* legacy_info); -bool convertHidlRttResponderToLegacy( - const V1_4::RttResponder& hidl_responder, - legacy_hal::wifi_rtt_responder* legacy_responder); -bool convertHidlWifiChannelInfoToLegacy( - const WifiChannelInfo& hidl_info, - legacy_hal::wifi_channel_info* legacy_info); -bool convertLegacyRttResponderToHidl( - const legacy_hal::wifi_rtt_responder& legacy_responder, - V1_4::RttResponder* hidl_responder); -bool convertLegacyRttCapabilitiesToHidl( - const legacy_hal::wifi_rtt_capabilities& legacy_capabilities, - V1_4::RttCapabilities* hidl_capabilities); -bool convertLegacyVectorOfRttResultToHidl( - const std::vector& legacy_results, - std::vector* hidl_results); -uint32_t convertHidlWifiBandToLegacyMacBand(V1_5::WifiBand band); -uint32_t convertHidlWifiIfaceModeToLegacy(uint32_t hidl_iface_mask); -uint32_t convertHidlUsableChannelFilterToLegacy(uint32_t hidl_filter_mask); -bool convertLegacyWifiUsableChannelsToHidl( - const std::vector& legacy_usable_channels, - std::vector* hidl_usable_channels); -bool convertLegacyPeerInfoStatsToHidl( - const legacy_hal::WifiPeerInfo& legacy_peer_info_stats, - StaPeerInfo* hidl_peer_info_stats); -bool convertLegacyWifiRateInfoToHidl(const legacy_hal::wifi_rate& legacy_rate, - V1_4::WifiRateInfo* hidl_rate); -} // namespace hidl_struct_util -} // namespace implementation -} // namespace V1_5 -} // namespace wifi -} // namespace hardware -} // namespace android - -#endif // HIDL_STRUCT_UTIL_H_ diff --git a/wifi/1.5/default/tests/wifi_nan_iface_unit_tests.cpp b/wifi/1.5/default/tests/wifi_nan_iface_unit_tests.cpp deleted file mode 100644 index 32da55ec2b..0000000000 --- a/wifi/1.5/default/tests/wifi_nan_iface_unit_tests.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (C) 2019, The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include - -#undef NAN // This is weird, NAN is defined in bionic/libc/include/math.h:38 -#include "wifi_nan_iface.h" - -#include "mock_interface_tool.h" -#include "mock_wifi_feature_flags.h" -#include "mock_wifi_iface_util.h" -#include "mock_wifi_legacy_hal.h" - -using testing::NiceMock; -using testing::Return; -using testing::Test; - -namespace { -constexpr char kIfaceName[] = "mockWlan0"; -} // namespace - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_5 { -namespace implementation { - -using android::hardware::wifi::V1_2::NanDataPathConfirmInd; - -bool CaptureIfaceEventHandlers( - const std::string& /* iface_name*/, - iface_util::IfaceEventHandlers in_iface_event_handlers, - iface_util::IfaceEventHandlers* out_iface_event_handlers) { - *out_iface_event_handlers = in_iface_event_handlers; - return true; -} - -class MockNanIfaceEventCallback : public IWifiNanIfaceEventCallback { - public: - MockNanIfaceEventCallback() = default; - - MOCK_METHOD3( - notifyCapabilitiesResponse, - Return(uint16_t, const WifiNanStatus&, - const android::hardware::wifi::V1_0::NanCapabilities&)); - MOCK_METHOD2(notifyEnableResponse, - Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD2(notifyConfigResponse, - Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD2(notifyDisableResponse, - Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD3(notifyStartPublishResponse, - Return(uint16_t, const WifiNanStatus&, uint8_t)); - MOCK_METHOD2(notifyStopPublishResponse, - Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD3(notifyStartSubscribeResponse, - Return(uint16_t, const WifiNanStatus&, uint8_t)); - MOCK_METHOD2(notifyStopSubscribeResponse, - Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD2(notifyTransmitFollowupResponse, - Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD2(notifyCreateDataInterfaceResponse, - Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD2(notifyDeleteDataInterfaceResponse, - Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD3(notifyInitiateDataPathResponse, - Return(uint16_t, const WifiNanStatus&, uint32_t)); - MOCK_METHOD2(notifyRespondToDataPathIndicationResponse, - Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD2(notifyTerminateDataPathResponse, - Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD1(eventClusterEvent, Return(const NanClusterEventInd&)); - MOCK_METHOD1(eventDisabled, Return(const WifiNanStatus&)); - MOCK_METHOD2(eventPublishTerminated, - Return(uint8_t, const WifiNanStatus&)); - MOCK_METHOD2(eventSubscribeTerminated, - Return(uint8_t, const WifiNanStatus&)); - MOCK_METHOD1(eventMatch, Return(const NanMatchInd&)); - MOCK_METHOD2(eventMatchExpired, Return(uint8_t, uint32_t)); - MOCK_METHOD1(eventFollowupReceived, - Return(const NanFollowupReceivedInd&)); - MOCK_METHOD2(eventTransmitFollowup, - Return(uint16_t, const WifiNanStatus&)); - MOCK_METHOD1(eventDataPathRequest, - Return(const NanDataPathRequestInd&)); - MOCK_METHOD1( - eventDataPathConfirm, - Return( - const android::hardware::wifi::V1_0::NanDataPathConfirmInd&)); - MOCK_METHOD1(eventDataPathTerminated, Return(uint32_t)); - MOCK_METHOD1(eventDataPathConfirm_1_2, - Return(const NanDataPathConfirmInd&)); - MOCK_METHOD1(eventDataPathScheduleUpdate, - Return(const NanDataPathScheduleUpdateInd&)); - MOCK_METHOD3(notifyCapabilitiesResponse_1_5, - Return(uint16_t, const WifiNanStatus&, - const NanCapabilities&)); -}; - -class WifiNanIfaceTest : public Test { - protected: - legacy_hal::wifi_hal_fn fake_func_table_; - std::shared_ptr> iface_tool_{ - new NiceMock}; - std::shared_ptr> legacy_hal_{ - new NiceMock(iface_tool_, - fake_func_table_, true)}; - std::shared_ptr> iface_util_{ - new NiceMock(iface_tool_, legacy_hal_)}; -}; - -TEST_F(WifiNanIfaceTest, IfacEventHandlers_OnStateToggleOffOn) { - iface_util::IfaceEventHandlers captured_iface_event_handlers = {}; - EXPECT_CALL(*legacy_hal_, - nanRegisterCallbackHandlers(testing::_, testing::_)) - .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); - EXPECT_CALL(*iface_util_, - registerIfaceEventHandlers(testing::_, testing::_)) - .WillOnce(testing::Invoke( - bind(CaptureIfaceEventHandlers, std::placeholders::_1, - std::placeholders::_2, &captured_iface_event_handlers))); - sp nan_iface = - new WifiNanIface(kIfaceName, false, legacy_hal_, iface_util_); - - // Register a mock nan event callback. - sp> mock_event_callback{ - new NiceMock}; - nan_iface->registerEventCallback( - mock_event_callback, [](const WifiStatus& status) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - }); - // Ensure that the eventDisabled() function in mock callback will be - // invoked. - WifiNanStatus expected_nan_status = { - NanStatusType::UNSUPPORTED_CONCURRENCY_NAN_DISABLED, ""}; - EXPECT_CALL(*mock_event_callback, eventDisabled(expected_nan_status)) - .Times(1); - - // Trigger the iface state toggle callback. - captured_iface_event_handlers.on_state_toggle_off_on(kIfaceName); -} -} // namespace implementation -} // namespace V1_5 -} // namespace wifi -} // namespace hardware -} // namespace android diff --git a/wifi/1.5/default/wifi_nan_iface.cpp b/wifi/1.5/default/wifi_nan_iface.cpp deleted file mode 100644 index 0cc6cd5fce..0000000000 --- a/wifi/1.5/default/wifi_nan_iface.cpp +++ /dev/null @@ -1,1003 +0,0 @@ -/* - * 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. - */ - -#include - -#include "hidl_return_util.h" -#include "hidl_struct_util.h" -#include "wifi_nan_iface.h" -#include "wifi_status_util.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_5 { -namespace implementation { -using hidl_return_util::validateAndCall; - -WifiNanIface::WifiNanIface( - const std::string& ifname, bool is_dedicated_iface, - const std::weak_ptr legacy_hal, - const std::weak_ptr iface_util) - : ifname_(ifname), - is_dedicated_iface_(is_dedicated_iface), - legacy_hal_(legacy_hal), - iface_util_(iface_util), - is_valid_(true) { - if (is_dedicated_iface_) { - // If using a dedicated iface, set the iface up first. - if (!iface_util_.lock()->setUpState(ifname_, true)) { - // Fatal failure, invalidate the iface object. - invalidate(); - return; - } - } - // Register all the callbacks here. these should be valid for the lifetime - // of the object. Whenever the mode changes legacy HAL will remove - // all of these callbacks. - legacy_hal::NanCallbackHandlers callback_handlers; - android::wp weak_ptr_this(this); - - // Callback for response. - callback_handlers - .on_notify_response = [weak_ptr_this]( - legacy_hal::transaction_id id, - const legacy_hal::NanResponseMsg& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - WifiNanStatus wifiNanStatus; - if (!hidl_struct_util::convertLegacyNanResponseHeaderToHidl( - msg, &wifiNanStatus)) { - LOG(ERROR) << "Failed to convert nan response header"; - return; - } - - switch (msg.response_type) { - case legacy_hal::NAN_RESPONSE_ENABLED: { - for (const auto& callback : - shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyEnableResponse(id, wifiNanStatus) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_DISABLED: { - for (const auto& callback : - shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyDisableResponse(id, wifiNanStatus) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_PUBLISH: { - for (const auto& callback : - shared_ptr_this->getEventCallbacks()) { - if (!callback - ->notifyStartPublishResponse( - id, wifiNanStatus, - msg.body.publish_response.publish_id) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_PUBLISH_CANCEL: { - for (const auto& callback : - shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyStopPublishResponse(id, wifiNanStatus) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_TRANSMIT_FOLLOWUP: { - for (const auto& callback : - shared_ptr_this->getEventCallbacks()) { - if (!callback - ->notifyTransmitFollowupResponse(id, wifiNanStatus) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_SUBSCRIBE: { - for (const auto& callback : - shared_ptr_this->getEventCallbacks()) { - if (!callback - ->notifyStartSubscribeResponse( - id, wifiNanStatus, - msg.body.subscribe_response.subscribe_id) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_SUBSCRIBE_CANCEL: { - for (const auto& callback : - shared_ptr_this->getEventCallbacks()) { - if (!callback - ->notifyStopSubscribeResponse(id, wifiNanStatus) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_CONFIG: { - for (const auto& callback : - shared_ptr_this->getEventCallbacks()) { - if (!callback->notifyConfigResponse(id, wifiNanStatus) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_GET_CAPABILITIES: { - NanCapabilities hidl_struct; - if (!hidl_struct_util:: - convertLegacyNanCapabilitiesResponseToHidl( - msg.body.nan_capabilities, &hidl_struct)) { - LOG(ERROR) << "Failed to convert nan capabilities response"; - return; - } - for (const auto& callback : - shared_ptr_this->getEventCallbacks_1_5()) { - if (!callback - ->notifyCapabilitiesResponse_1_5(id, wifiNanStatus, - hidl_struct) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_DP_INTERFACE_CREATE: { - for (const auto& callback : - shared_ptr_this->getEventCallbacks()) { - if (!callback - ->notifyCreateDataInterfaceResponse(id, - wifiNanStatus) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_DP_INTERFACE_DELETE: { - for (const auto& callback : - shared_ptr_this->getEventCallbacks()) { - if (!callback - ->notifyDeleteDataInterfaceResponse(id, - wifiNanStatus) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_DP_INITIATOR_RESPONSE: { - for (const auto& callback : - shared_ptr_this->getEventCallbacks()) { - if (!callback - ->notifyInitiateDataPathResponse( - id, wifiNanStatus, - msg.body.data_request_response.ndp_instance_id) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_DP_RESPONDER_RESPONSE: { - for (const auto& callback : - shared_ptr_this->getEventCallbacks()) { - if (!callback - ->notifyRespondToDataPathIndicationResponse( - id, wifiNanStatus) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_DP_END: { - for (const auto& callback : - shared_ptr_this->getEventCallbacks()) { - if (!callback - ->notifyTerminateDataPathResponse(id, - wifiNanStatus) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - break; - } - case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD: - /* fall through */ - case legacy_hal::NAN_RESPONSE_TCA: - /* fall through */ - case legacy_hal::NAN_RESPONSE_STATS: - /* fall through */ - case legacy_hal::NAN_RESPONSE_ERROR: - /* fall through */ - default: - LOG(ERROR) << "Unknown or unhandled response type: " - << msg.response_type; - return; - } - }; - - callback_handlers.on_event_disc_eng_event = - [weak_ptr_this](const legacy_hal::NanDiscEngEventInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - NanClusterEventInd hidl_struct; - // event types defined identically - hence can be cast - hidl_struct.eventType = (NanClusterEventType)msg.event_type; - hidl_struct.addr = msg.data.mac_addr.addr; - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventClusterEvent(hidl_struct).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_disabled = - [weak_ptr_this](const legacy_hal::NanDisabledInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - WifiNanStatus status; - hidl_struct_util::convertToWifiNanStatus( - msg.reason, msg.nan_reason, sizeof(msg.nan_reason), &status); - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventDisabled(status).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_publish_terminated = - [weak_ptr_this](const legacy_hal::NanPublishTerminatedInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - WifiNanStatus status; - hidl_struct_util::convertToWifiNanStatus( - msg.reason, msg.nan_reason, sizeof(msg.nan_reason), &status); - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventPublishTerminated(msg.publish_id, status) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_subscribe_terminated = - [weak_ptr_this](const legacy_hal::NanSubscribeTerminatedInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - WifiNanStatus status; - hidl_struct_util::convertToWifiNanStatus( - msg.reason, msg.nan_reason, sizeof(msg.nan_reason), &status); - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback - ->eventSubscribeTerminated(msg.subscribe_id, status) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_match = - [weak_ptr_this](const legacy_hal::NanMatchInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - NanMatchInd hidl_struct; - if (!hidl_struct_util::convertLegacyNanMatchIndToHidl( - msg, &hidl_struct)) { - LOG(ERROR) << "Failed to convert nan capabilities response"; - return; - } - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventMatch(hidl_struct).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_match_expired = - [weak_ptr_this](const legacy_hal::NanMatchExpiredInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - 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 - ->eventMatchExpired(msg.publish_subscribe_id, - msg.requestor_instance_id) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_followup = - [weak_ptr_this](const legacy_hal::NanFollowupInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - NanFollowupReceivedInd hidl_struct; - if (!hidl_struct_util::convertLegacyNanFollowupIndToHidl( - msg, &hidl_struct)) { - LOG(ERROR) << "Failed to convert nan capabilities response"; - return; - } - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventFollowupReceived(hidl_struct).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_transmit_follow_up = - [weak_ptr_this](const legacy_hal::NanTransmitFollowupInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - WifiNanStatus status; - hidl_struct_util::convertToWifiNanStatus( - msg.reason, msg.nan_reason, sizeof(msg.nan_reason), &status); - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventTransmitFollowup(msg.id, status).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_data_path_request = - [weak_ptr_this](const legacy_hal::NanDataPathRequestInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - NanDataPathRequestInd hidl_struct; - if (!hidl_struct_util::convertLegacyNanDataPathRequestIndToHidl( - msg, &hidl_struct)) { - LOG(ERROR) << "Failed to convert nan capabilities response"; - return; - } - - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventDataPathRequest(hidl_struct).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_data_path_confirm = - [weak_ptr_this](const legacy_hal::NanDataPathConfirmInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - V1_2::NanDataPathConfirmInd hidl_struct; - if (!hidl_struct_util::convertLegacyNanDataPathConfirmIndToHidl( - msg, &hidl_struct)) { - LOG(ERROR) << "Failed to convert nan capabilities response"; - return; - } - - for (const auto& callback : - shared_ptr_this->getEventCallbacks_1_2()) { - if (!callback->eventDataPathConfirm_1_2(hidl_struct).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - callback_handlers.on_event_data_path_end = - [weak_ptr_this](const legacy_hal::NanDataPathEndInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - 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()) { - for (int i = 0; i < msg.num_ndp_instances; ++i) { - if (!callback - ->eventDataPathTerminated(msg.ndp_instance_id[i]) - .isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - } - }; - - callback_handlers.on_event_beacon_sdf_payload = - [weak_ptr_this](const legacy_hal::NanBeaconSdfPayloadInd& /* msg */) { - LOG(ERROR) << "on_event_beacon_sdf_payload - should not be called"; - }; - - callback_handlers.on_event_range_request = - [weak_ptr_this](const legacy_hal::NanRangeRequestInd& /* msg */) { - LOG(ERROR) << "on_event_range_request - should not be called"; - }; - - callback_handlers.on_event_range_report = - [weak_ptr_this](const legacy_hal::NanRangeReportInd& /* msg */) { - LOG(ERROR) << "on_event_range_report - should not be called"; - }; - - callback_handlers - .on_event_schedule_update = [weak_ptr_this]( - const legacy_hal:: - NanDataPathScheduleUpdateInd& msg) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - V1_2::NanDataPathScheduleUpdateInd hidl_struct; - if (!hidl_struct_util::convertLegacyNanDataPathScheduleUpdateIndToHidl( - msg, &hidl_struct)) { - LOG(ERROR) << "Failed to convert nan capabilities response"; - return; - } - - for (const auto& callback : shared_ptr_this->getEventCallbacks_1_2()) { - if (!callback->eventDataPathScheduleUpdate(hidl_struct).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanRegisterCallbackHandlers(ifname_, - callback_handlers); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - LOG(ERROR) << "Failed to register nan callbacks. Invalidating object"; - invalidate(); - } - - // Register for iface state toggle events. - iface_util::IfaceEventHandlers event_handlers = {}; - event_handlers.on_state_toggle_off_on = - [weak_ptr_this](const std::string& /* iface_name */) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - // Tell framework that NAN has been disabled. - WifiNanStatus status = { - NanStatusType::UNSUPPORTED_CONCURRENCY_NAN_DISABLED, ""}; - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventDisabled(status).isOk()) { - LOG(ERROR) << "Failed to invoke the callback"; - } - } - }; - iface_util_.lock()->registerIfaceEventHandlers(ifname_, event_handlers); -} - -void WifiNanIface::invalidate() { - if (!isValid()) { - return; - } - // send commands to HAL to actually disable and destroy interfaces - legacy_hal_.lock()->nanDisableRequest(ifname_, 0xFFFF); - legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, 0xFFFE, "aware_data0"); - legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, 0xFFFD, "aware_data1"); - iface_util_.lock()->unregisterIfaceEventHandlers(ifname_); - legacy_hal_.reset(); - event_cb_handler_.invalidate(); - event_cb_handler_1_2_.invalidate(); - event_cb_handler_1_5_.invalidate(); - is_valid_ = false; - if (is_dedicated_iface_) { - // If using a dedicated iface, set the iface down. - iface_util_.lock()->setUpState(ifname_, false); - } -} - -bool WifiNanIface::isValid() { return is_valid_; } - -std::string WifiNanIface::getName() { return ifname_; } - -std::set> -WifiNanIface::getEventCallbacks() { - return event_cb_handler_.getCallbacks(); -} - -std::set> -WifiNanIface::getEventCallbacks_1_2() { - return event_cb_handler_1_2_.getCallbacks(); -} - -std::set> WifiNanIface::getEventCallbacks_1_5() { - return event_cb_handler_1_5_.getCallbacks(); -} - -Return WifiNanIface::getName(getName_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::getNameInternal, hidl_status_cb); -} - -Return WifiNanIface::getType(getType_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::getTypeInternal, hidl_status_cb); -} - -Return WifiNanIface::registerEventCallback( - const sp& callback, - registerEventCallback_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::registerEventCallbackInternal, - hidl_status_cb, callback); -} - -Return WifiNanIface::getCapabilitiesRequest( - uint16_t cmd_id, getCapabilitiesRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::getCapabilitiesRequestInternal, - hidl_status_cb, cmd_id); -} - -Return WifiNanIface::enableRequest(uint16_t cmd_id, - const V1_0::NanEnableRequest& msg, - enableRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::enableRequestInternal, hidl_status_cb, - cmd_id, msg); -} - -Return WifiNanIface::configRequest(uint16_t cmd_id, - const V1_0::NanConfigRequest& msg, - configRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::configRequestInternal, hidl_status_cb, - cmd_id, msg); -} - -Return WifiNanIface::disableRequest(uint16_t cmd_id, - disableRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::disableRequestInternal, - hidl_status_cb, cmd_id); -} - -Return WifiNanIface::startPublishRequest( - uint16_t cmd_id, const NanPublishRequest& msg, - startPublishRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::startPublishRequestInternal, - hidl_status_cb, cmd_id, msg); -} - -Return WifiNanIface::stopPublishRequest( - uint16_t cmd_id, uint8_t sessionId, stopPublishRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::stopPublishRequestInternal, - hidl_status_cb, cmd_id, sessionId); -} - -Return WifiNanIface::startSubscribeRequest( - uint16_t cmd_id, const NanSubscribeRequest& msg, - startSubscribeRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::startSubscribeRequestInternal, - hidl_status_cb, cmd_id, msg); -} - -Return WifiNanIface::stopSubscribeRequest( - uint16_t cmd_id, uint8_t sessionId, - stopSubscribeRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::stopSubscribeRequestInternal, - hidl_status_cb, cmd_id, sessionId); -} - -Return WifiNanIface::transmitFollowupRequest( - uint16_t cmd_id, const NanTransmitFollowupRequest& msg, - transmitFollowupRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::transmitFollowupRequestInternal, - hidl_status_cb, cmd_id, msg); -} - -Return WifiNanIface::createDataInterfaceRequest( - uint16_t cmd_id, const hidl_string& iface_name, - createDataInterfaceRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::createDataInterfaceRequestInternal, - hidl_status_cb, cmd_id, iface_name); -} - -Return WifiNanIface::deleteDataInterfaceRequest( - uint16_t cmd_id, const hidl_string& iface_name, - deleteDataInterfaceRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::deleteDataInterfaceRequestInternal, - hidl_status_cb, cmd_id, iface_name); -} - -Return WifiNanIface::initiateDataPathRequest( - uint16_t cmd_id, const NanInitiateDataPathRequest& msg, - initiateDataPathRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::initiateDataPathRequestInternal, - hidl_status_cb, cmd_id, msg); -} - -Return WifiNanIface::respondToDataPathIndicationRequest( - uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg, - respondToDataPathIndicationRequest_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::respondToDataPathIndicationRequestInternal, - hidl_status_cb, cmd_id, msg); -} - -Return WifiNanIface::terminateDataPathRequest( - uint16_t cmd_id, uint32_t ndpInstanceId, - terminateDataPathRequest_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::terminateDataPathRequestInternal, - hidl_status_cb, cmd_id, ndpInstanceId); -} - -Return WifiNanIface::registerEventCallback_1_2( - const sp& callback, - registerEventCallback_1_2_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::registerEventCallback_1_2Internal, - hidl_status_cb, callback); -} - -Return WifiNanIface::enableRequest_1_2( - uint16_t cmd_id, const V1_0::NanEnableRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - enableRequest_1_2_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::enableRequest_1_2Internal, - hidl_status_cb, cmd_id, msg1, msg2); -} - -Return WifiNanIface::configRequest_1_2( - uint16_t cmd_id, const V1_0::NanConfigRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - configRequest_1_2_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::configRequest_1_2Internal, - hidl_status_cb, cmd_id, msg1, msg2); -} - -Return WifiNanIface::enableRequest_1_4( - uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - enableRequest_1_4_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::enableRequest_1_4Internal, - hidl_status_cb, cmd_id, msg1, msg2); -} - -Return WifiNanIface::configRequest_1_4( - uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - configRequest_1_4_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::configRequest_1_4Internal, - hidl_status_cb, cmd_id, msg1, msg2); -} - -Return WifiNanIface::registerEventCallback_1_5( - const sp& callback, - registerEventCallback_1_5_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::registerEventCallback_1_5Internal, - hidl_status_cb, callback); -} - -Return WifiNanIface::enableRequest_1_5( - uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const NanConfigRequestSupplemental& msg2, - enableRequest_1_5_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::enableRequest_1_5Internal, - hidl_status_cb, cmd_id, msg1, msg2); -} - -Return WifiNanIface::configRequest_1_5( - uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, - const NanConfigRequestSupplemental& msg2, - configRequest_1_5_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::configRequest_1_5Internal, - hidl_status_cb, cmd_id, msg1, msg2); -} - -Return WifiNanIface::getCapabilitiesRequest_1_5( - uint16_t cmd_id, getCapabilitiesRequest_1_5_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiNanIface::getCapabilitiesRequest_1_5Internal, - hidl_status_cb, cmd_id); -} - -std::pair WifiNanIface::getNameInternal() { - return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_}; -} - -std::pair WifiNanIface::getTypeInternal() { - return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::NAN}; -} - -WifiStatus WifiNanIface::registerEventCallbackInternal( - const sp& callback) { - if (!event_cb_handler_.addCallback(callback)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - return createWifiStatus(WifiStatusCode::SUCCESS); -} - -WifiStatus WifiNanIface::getCapabilitiesRequestInternal(uint16_t /* cmd_id */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::enableRequestInternal( - uint16_t /* cmd_id */, const V1_0::NanEnableRequest& /* msg */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::configRequestInternal( - uint16_t /* cmd_id */, const V1_0::NanConfigRequest& /* msg */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::disableRequestInternal(uint16_t cmd_id) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanDisableRequest(ifname_, cmd_id); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::startPublishRequestInternal( - uint16_t cmd_id, const NanPublishRequest& msg) { - legacy_hal::NanPublishRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanPublishRequestToLegacy(msg, - &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanPublishRequest(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::stopPublishRequestInternal(uint16_t cmd_id, - uint8_t sessionId) { - legacy_hal::NanPublishCancelRequest legacy_msg; - legacy_msg.publish_id = sessionId; - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanPublishCancelRequest(ifname_, cmd_id, - legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::startSubscribeRequestInternal( - uint16_t cmd_id, const NanSubscribeRequest& msg) { - legacy_hal::NanSubscribeRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanSubscribeRequestToLegacy( - msg, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanSubscribeRequest(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::stopSubscribeRequestInternal(uint16_t cmd_id, - uint8_t sessionId) { - legacy_hal::NanSubscribeCancelRequest legacy_msg; - legacy_msg.subscribe_id = sessionId; - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanSubscribeCancelRequest(ifname_, cmd_id, - legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::transmitFollowupRequestInternal( - uint16_t cmd_id, const NanTransmitFollowupRequest& msg) { - legacy_hal::NanTransmitFollowupRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanTransmitFollowupRequestToLegacy( - msg, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanTransmitFollowupRequest(ifname_, cmd_id, - legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::createDataInterfaceRequestInternal( - uint16_t cmd_id, const std::string& iface_name) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanDataInterfaceCreate(ifname_, cmd_id, iface_name); - return createWifiStatusFromLegacyError(legacy_status); -} -WifiStatus WifiNanIface::deleteDataInterfaceRequestInternal( - uint16_t cmd_id, const std::string& iface_name) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, cmd_id, iface_name); - return createWifiStatusFromLegacyError(legacy_status); -} -WifiStatus WifiNanIface::initiateDataPathRequestInternal( - uint16_t cmd_id, const NanInitiateDataPathRequest& msg) { - legacy_hal::NanDataPathInitiatorRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanDataPathInitiatorRequestToLegacy( - msg, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanDataRequestInitiator(ifname_, cmd_id, - legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} -WifiStatus WifiNanIface::respondToDataPathIndicationRequestInternal( - uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg) { - legacy_hal::NanDataPathIndicationResponse legacy_msg; - if (!hidl_struct_util::convertHidlNanDataPathIndicationResponseToLegacy( - msg, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanDataIndicationResponse(ifname_, cmd_id, - legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} -WifiStatus WifiNanIface::terminateDataPathRequestInternal( - uint16_t cmd_id, uint32_t ndpInstanceId) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanDataEnd(ifname_, cmd_id, ndpInstanceId); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::registerEventCallback_1_2Internal( - const sp& callback) { - sp callback_1_0 = callback; - if (!event_cb_handler_.addCallback(callback_1_0)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - if (!event_cb_handler_1_2_.addCallback(callback)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - return createWifiStatus(WifiStatusCode::SUCCESS); -} - -WifiStatus WifiNanIface::enableRequest_1_2Internal( - uint16_t /* cmd_id */, const V1_0::NanEnableRequest& /* msg1 */, - const V1_2::NanConfigRequestSupplemental& /* msg2 */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::configRequest_1_2Internal( - uint16_t /* cmd_id */, const V1_0::NanConfigRequest& /* msg1 */, - const V1_2::NanConfigRequestSupplemental& /* msg2 */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::enableRequest_1_4Internal( - uint16_t /* cmd_id */, const V1_4::NanEnableRequest& /* msg1 */, - const V1_2::NanConfigRequestSupplemental& /* msg2 */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::configRequest_1_4Internal( - uint16_t /* cmd_id */, const V1_4::NanConfigRequest& /* msg1 */, - const V1_2::NanConfigRequestSupplemental& /* msg2 */) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiNanIface::registerEventCallback_1_5Internal( - const sp& callback) { - sp callback_1_0 = callback; - if (!event_cb_handler_.addCallback(callback_1_0)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - sp callback_1_2 = callback; - if (!event_cb_handler_1_2_.addCallback(callback_1_2)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - if (!event_cb_handler_1_5_.addCallback(callback)) { - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); - } - return createWifiStatus(WifiStatusCode::SUCCESS); -} - -WifiStatus WifiNanIface::getCapabilitiesRequest_1_5Internal(uint16_t cmd_id) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanGetCapabilities(ifname_, cmd_id); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::enableRequest_1_5Internal( - uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const NanConfigRequestSupplemental& msg2) { - legacy_hal::NanEnableRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanEnableRequest_1_5ToLegacy( - msg1, msg2, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanEnableRequest(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiNanIface::configRequest_1_5Internal( - uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, - const NanConfigRequestSupplemental& msg2) { - legacy_hal::NanConfigRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanConfigRequest_1_5ToLegacy( - msg1, msg2, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanConfigRequest(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); -} - -} // namespace implementation -} // namespace V1_5 -} // namespace wifi -} // namespace hardware -} // namespace android diff --git a/wifi/1.5/default/wifi_nan_iface.h b/wifi/1.5/default/wifi_nan_iface.h deleted file mode 100644 index fb9c047ff6..0000000000 --- a/wifi/1.5/default/wifi_nan_iface.h +++ /dev/null @@ -1,212 +0,0 @@ -/* - * 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_NAN_IFACE_H_ -#define WIFI_NAN_IFACE_H_ - -#include -#include -#include - -#include "hidl_callback_util.h" -#include "wifi_iface_util.h" -#include "wifi_legacy_hal.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_5 { -namespace implementation { -using namespace android::hardware::wifi::V1_0; -using namespace android::hardware::wifi::V1_2; - -/** - * HIDL interface object used to control a NAN Iface instance. - */ -class WifiNanIface : public V1_5::IWifiNanIface { - public: - WifiNanIface(const std::string& ifname, bool is_dedicated_iface, - const std::weak_ptr legacy_hal, - const std::weak_ptr iface_util); - // Refer to |WifiChip::invalidate()|. - void invalidate(); - bool isValid(); - std::string getName(); - - // HIDL methods exposed. - Return getName(getName_cb hidl_status_cb) override; - Return getType(getType_cb hidl_status_cb) override; - Return registerEventCallback( - const sp& callback, - registerEventCallback_cb hidl_status_cb) override; - Return getCapabilitiesRequest( - uint16_t cmd_id, getCapabilitiesRequest_cb hidl_status_cb) override; - Return enableRequest(uint16_t cmd_id, - const V1_0::NanEnableRequest& msg, - enableRequest_cb hidl_status_cb) override; - Return configRequest(uint16_t cmd_id, - const V1_0::NanConfigRequest& msg, - configRequest_cb hidl_status_cb) override; - Return disableRequest(uint16_t cmd_id, - disableRequest_cb hidl_status_cb) override; - Return startPublishRequest( - uint16_t cmd_id, const NanPublishRequest& msg, - startPublishRequest_cb hidl_status_cb) override; - Return stopPublishRequest( - uint16_t cmd_id, uint8_t sessionId, - stopPublishRequest_cb hidl_status_cb) override; - Return startSubscribeRequest( - uint16_t cmd_id, const NanSubscribeRequest& msg, - startSubscribeRequest_cb hidl_status_cb) override; - Return stopSubscribeRequest( - uint16_t cmd_id, uint8_t sessionId, - stopSubscribeRequest_cb hidl_status_cb) override; - Return transmitFollowupRequest( - uint16_t cmd_id, const NanTransmitFollowupRequest& msg, - transmitFollowupRequest_cb hidl_status_cb) override; - Return createDataInterfaceRequest( - uint16_t cmd_id, const hidl_string& iface_name, - createDataInterfaceRequest_cb hidl_status_cb) override; - Return deleteDataInterfaceRequest( - uint16_t cmd_id, const hidl_string& iface_name, - deleteDataInterfaceRequest_cb hidl_status_cb) override; - Return initiateDataPathRequest( - uint16_t cmd_id, const NanInitiateDataPathRequest& msg, - initiateDataPathRequest_cb hidl_status_cb) override; - Return respondToDataPathIndicationRequest( - uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg, - respondToDataPathIndicationRequest_cb hidl_status_cb) override; - Return terminateDataPathRequest( - uint16_t cmd_id, uint32_t ndpInstanceId, - terminateDataPathRequest_cb hidl_status_cb) override; - - Return registerEventCallback_1_2( - const sp& callback, - registerEventCallback_1_2_cb hidl_status_cb) override; - Return enableRequest_1_2( - uint16_t cmd_id, const V1_0::NanEnableRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - enableRequest_1_2_cb hidl_status_cb) override; - Return configRequest_1_2( - uint16_t cmd_id, const V1_0::NanConfigRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - configRequest_1_2_cb hidl_status_cb) override; - Return enableRequest_1_4( - uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - enableRequest_1_4_cb hidl_status_cb) override; - Return configRequest_1_4( - uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2, - configRequest_1_4_cb hidl_status_cb) override; - Return registerEventCallback_1_5( - const sp& callback, - registerEventCallback_1_5_cb hidl_status_cb) override; - Return enableRequest_1_5( - uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const NanConfigRequestSupplemental& msg2, - enableRequest_1_4_cb hidl_status_cb) override; - Return configRequest_1_5( - uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, - const NanConfigRequestSupplemental& msg2, - configRequest_1_4_cb hidl_status_cb) override; - Return getCapabilitiesRequest_1_5( - uint16_t cmd_id, getCapabilitiesRequest_cb hidl_status_cb) override; - - private: - // Corresponding worker functions for the HIDL methods. - std::pair getNameInternal(); - std::pair getTypeInternal(); - WifiStatus registerEventCallbackInternal( - const sp& callback); - WifiStatus getCapabilitiesRequestInternal(uint16_t cmd_id); - WifiStatus enableRequestInternal(uint16_t cmd_id, - const V1_0::NanEnableRequest& msg); - WifiStatus configRequestInternal(uint16_t cmd_id, - const V1_0::NanConfigRequest& msg); - WifiStatus disableRequestInternal(uint16_t cmd_id); - WifiStatus startPublishRequestInternal(uint16_t cmd_id, - const NanPublishRequest& msg); - WifiStatus stopPublishRequestInternal(uint16_t cmd_id, uint8_t sessionId); - WifiStatus startSubscribeRequestInternal(uint16_t cmd_id, - const NanSubscribeRequest& msg); - WifiStatus stopSubscribeRequestInternal(uint16_t cmd_id, uint8_t sessionId); - WifiStatus transmitFollowupRequestInternal( - uint16_t cmd_id, const NanTransmitFollowupRequest& msg); - WifiStatus createDataInterfaceRequestInternal( - uint16_t cmd_id, const std::string& iface_name); - WifiStatus deleteDataInterfaceRequestInternal( - uint16_t cmd_id, const std::string& iface_name); - WifiStatus initiateDataPathRequestInternal( - uint16_t cmd_id, const NanInitiateDataPathRequest& msg); - WifiStatus respondToDataPathIndicationRequestInternal( - uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg); - WifiStatus terminateDataPathRequestInternal(uint16_t cmd_id, - uint32_t ndpInstanceId); - - WifiStatus registerEventCallback_1_2Internal( - const sp& callback); - WifiStatus enableRequest_1_2Internal( - uint16_t cmd_id, const V1_0::NanEnableRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2); - WifiStatus configRequest_1_2Internal( - uint16_t cmd_id, const V1_0::NanConfigRequest& msg, - const V1_2::NanConfigRequestSupplemental& msg2); - WifiStatus enableRequest_1_4Internal( - uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const V1_2::NanConfigRequestSupplemental& msg2); - WifiStatus configRequest_1_4Internal( - uint16_t cmd_id, const V1_4::NanConfigRequest& msg, - const V1_2::NanConfigRequestSupplemental& msg2); - WifiStatus registerEventCallback_1_5Internal( - const sp& callback); - WifiStatus enableRequest_1_5Internal( - uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const NanConfigRequestSupplemental& msg2); - WifiStatus configRequest_1_5Internal( - uint16_t cmd_id, const V1_4::NanConfigRequest& msg, - const NanConfigRequestSupplemental& msg2); - WifiStatus getCapabilitiesRequest_1_5Internal(uint16_t cmd_id); - - // all 1_0 and descendant callbacks - std::set> getEventCallbacks(); - // all 1_2 and descendant callbacks - std::set> getEventCallbacks_1_2(); - // all 1_5 and descendant callbacks - std::set> getEventCallbacks_1_5(); - - std::string ifname_; - bool is_dedicated_iface_; - std::weak_ptr legacy_hal_; - std::weak_ptr iface_util_; - bool is_valid_; - hidl_callback_util::HidlCallbackHandler - event_cb_handler_; - hidl_callback_util::HidlCallbackHandler - event_cb_handler_1_2_; - hidl_callback_util::HidlCallbackHandler - event_cb_handler_1_5_; - - DISALLOW_COPY_AND_ASSIGN(WifiNanIface); -}; - -} // namespace implementation -} // namespace V1_5 -} // namespace wifi -} // namespace hardware -} // namespace android - -#endif // WIFI_NAN_IFACE_H_ diff --git a/wifi/1.5/default/wifi_rtt_controller.cpp b/wifi/1.5/default/wifi_rtt_controller.cpp deleted file mode 100644 index a0f9969033..0000000000 --- a/wifi/1.5/default/wifi_rtt_controller.cpp +++ /dev/null @@ -1,351 +0,0 @@ -/* - * 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. - */ - -#include - -#include "hidl_return_util.h" -#include "hidl_struct_util.h" -#include "wifi_rtt_controller.h" -#include "wifi_status_util.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_5 { -namespace implementation { -using hidl_return_util::validateAndCall; - -WifiRttController::WifiRttController( - const std::string& iface_name, const sp& bound_iface, - const std::weak_ptr legacy_hal) - : ifname_(iface_name), - bound_iface_(bound_iface), - legacy_hal_(legacy_hal), - is_valid_(true) {} - -void WifiRttController::invalidate() { - legacy_hal_.reset(); - event_callbacks_.clear(); - is_valid_ = false; -} - -bool WifiRttController::isValid() { return is_valid_; } - -std::vector> -WifiRttController::getEventCallbacks() { - return event_callbacks_; -} - -std::string WifiRttController::getIfaceName() { return ifname_; } - -Return WifiRttController::getBoundIface(getBoundIface_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::getBoundIfaceInternal, hidl_status_cb); -} - -Return WifiRttController::registerEventCallback( - const sp& callback, - registerEventCallback_cb hidl_status_cb) { - return validateAndCall(this, - WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::registerEventCallbackInternal, - hidl_status_cb, callback); -} - -Return WifiRttController::rangeRequest( - uint32_t cmd_id, const hidl_vec& rtt_configs, - rangeRequest_cb hidl_status_cb) { - return validateAndCall(this, - WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::rangeRequestInternal, - hidl_status_cb, cmd_id, rtt_configs); -} - -Return WifiRttController::rangeCancel( - uint32_t cmd_id, const hidl_vec>& addrs, - rangeCancel_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::rangeCancelInternal, hidl_status_cb, cmd_id, addrs); -} - -Return WifiRttController::getCapabilities( - getCapabilities_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::getCapabilitiesInternal, hidl_status_cb); -} - -Return WifiRttController::setLci(uint32_t cmd_id, - const RttLciInformation& lci, - setLci_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::setLciInternal, hidl_status_cb, cmd_id, lci); -} - -Return WifiRttController::setLcr(uint32_t cmd_id, - const RttLcrInformation& lcr, - setLcr_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::setLcrInternal, hidl_status_cb, cmd_id, lcr); -} - -Return WifiRttController::getResponderInfo( - getResponderInfo_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::getResponderInfoInternal, hidl_status_cb); -} - -Return WifiRttController::enableResponder( - uint32_t cmd_id, const WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, const V1_0::RttResponder& info, - enableResponder_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::enableResponderInternal, hidl_status_cb, cmd_id, - channel_hint, max_duration_seconds, info); -} - -Return WifiRttController::disableResponder( - uint32_t cmd_id, disableResponder_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::disableResponderInternal, hidl_status_cb, cmd_id); -} - -Return WifiRttController::registerEventCallback_1_4( - const sp& callback, - registerEventCallback_1_4_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::registerEventCallbackInternal_1_4, hidl_status_cb, - callback); -} - -Return WifiRttController::rangeRequest_1_4( - uint32_t cmd_id, const hidl_vec& rtt_configs, - rangeRequest_1_4_cb hidl_status_cb) { - return validateAndCall(this, - WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::rangeRequestInternal_1_4, - hidl_status_cb, cmd_id, rtt_configs); -} - -Return WifiRttController::getCapabilities_1_4( - getCapabilities_1_4_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::getCapabilitiesInternal_1_4, hidl_status_cb); -} - -Return WifiRttController::getResponderInfo_1_4( - getResponderInfo_1_4_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::getResponderInfoInternal_1_4, hidl_status_cb); -} - -Return WifiRttController::enableResponder_1_4( - uint32_t cmd_id, const WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, const V1_4::RttResponder& info, - enableResponder_1_4_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - &WifiRttController::enableResponderInternal_1_4, hidl_status_cb, cmd_id, - channel_hint, max_duration_seconds, info); -} - -std::pair> -WifiRttController::getBoundIfaceInternal() { - return {createWifiStatus(WifiStatusCode::SUCCESS), bound_iface_}; -} - -WifiStatus WifiRttController::registerEventCallbackInternal( - const sp& /* callback */) { - // Deprecated support for this api - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiRttController::rangeRequestInternal( - uint32_t /* cmd_id */, - const std::vector& /* rtt_configs */) { - // Deprecated support for this api - return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); -} - -WifiStatus WifiRttController::rangeCancelInternal( - uint32_t cmd_id, const std::vector>& addrs) { - std::vector> legacy_addrs; - for (const auto& addr : addrs) { - legacy_addrs.push_back(addr); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->cancelRttRangeRequest(ifname_, cmd_id, - legacy_addrs); - return createWifiStatusFromLegacyError(legacy_status); -} - -std::pair -WifiRttController::getCapabilitiesInternal() { - // Deprecated support for this api - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; -} - -WifiStatus WifiRttController::setLciInternal(uint32_t cmd_id, - const RttLciInformation& lci) { - legacy_hal::wifi_lci_information legacy_lci; - if (!hidl_struct_util::convertHidlRttLciInformationToLegacy(lci, - &legacy_lci)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->setRttLci(ifname_, cmd_id, legacy_lci); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiRttController::setLcrInternal(uint32_t cmd_id, - const RttLcrInformation& lcr) { - legacy_hal::wifi_lcr_information legacy_lcr; - if (!hidl_struct_util::convertHidlRttLcrInformationToLegacy(lcr, - &legacy_lcr)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->setRttLcr(ifname_, cmd_id, legacy_lcr); - return createWifiStatusFromLegacyError(legacy_status); -} - -std::pair -WifiRttController::getResponderInfoInternal() { - // Deprecated support for this api - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; -} - -WifiStatus WifiRttController::enableResponderInternal( - uint32_t /* cmd_id */, const WifiChannelInfo& /* channel_hint */, - uint32_t /* max_duration_seconds */, const V1_0::RttResponder& /* info */) { - // Deprecated support for this api - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED)}; -} - -WifiStatus WifiRttController::disableResponderInternal(uint32_t cmd_id) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->disableRttResponder(ifname_, cmd_id); - return createWifiStatusFromLegacyError(legacy_status); -} - -WifiStatus WifiRttController::registerEventCallbackInternal_1_4( - const sp& callback) { - // TODO(b/31632518): remove the callback when the client is destroyed - event_callbacks_.emplace_back(callback); - return createWifiStatus(WifiStatusCode::SUCCESS); -} - -WifiStatus WifiRttController::rangeRequestInternal_1_4( - uint32_t cmd_id, const std::vector& rtt_configs) { - std::vector legacy_configs; - if (!hidl_struct_util::convertHidlVectorOfRttConfigToLegacy( - rtt_configs, &legacy_configs)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - android::wp weak_ptr_this(this); - const auto& on_results_callback = - [weak_ptr_this]( - legacy_hal::wifi_request_id id, - const std::vector& results) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - std::vector hidl_results; - if (!hidl_struct_util::convertLegacyVectorOfRttResultToHidl( - results, &hidl_results)) { - LOG(ERROR) << "Failed to convert rtt results to HIDL structs"; - return; - } - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - callback->onResults_1_4(id, hidl_results); - } - }; - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->startRttRangeRequest( - ifname_, cmd_id, legacy_configs, on_results_callback); - return createWifiStatusFromLegacyError(legacy_status); -} - -std::pair -WifiRttController::getCapabilitiesInternal_1_4() { - legacy_hal::wifi_error legacy_status; - 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 {createWifiStatusFromLegacyError(legacy_status), {}}; - } - V1_4::RttCapabilities hidl_caps; - if (!hidl_struct_util::convertLegacyRttCapabilitiesToHidl(legacy_caps, - &hidl_caps)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; - } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps}; -} - -std::pair -WifiRttController::getResponderInfoInternal_1_4() { - legacy_hal::wifi_error legacy_status; - legacy_hal::wifi_rtt_responder legacy_responder; - std::tie(legacy_status, legacy_responder) = - legacy_hal_.lock()->getRttResponderInfo(ifname_); - if (legacy_status != legacy_hal::WIFI_SUCCESS) { - return {createWifiStatusFromLegacyError(legacy_status), {}}; - } - V1_4::RttResponder hidl_responder; - if (!hidl_struct_util::convertLegacyRttResponderToHidl(legacy_responder, - &hidl_responder)) { - return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; - } - return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_responder}; -} - -WifiStatus WifiRttController::enableResponderInternal_1_4( - uint32_t cmd_id, const WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, const V1_4::RttResponder& info) { - legacy_hal::wifi_channel_info legacy_channel_info; - if (!hidl_struct_util::convertHidlWifiChannelInfoToLegacy( - channel_hint, &legacy_channel_info)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_rtt_responder legacy_responder; - if (!hidl_struct_util::convertHidlRttResponderToLegacy(info, - &legacy_responder)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->enableRttResponder( - ifname_, cmd_id, legacy_channel_info, max_duration_seconds, - legacy_responder); - return createWifiStatusFromLegacyError(legacy_status); -} -} // namespace implementation -} // namespace V1_5 -} // namespace wifi -} // namespace hardware -} // namespace android diff --git a/wifi/1.5/default/wifi_sta_iface.h b/wifi/1.5/default/wifi_sta_iface.h deleted file mode 100644 index f9058b8af1..0000000000 --- a/wifi/1.5/default/wifi_sta_iface.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - * 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_STA_IFACE_H_ -#define WIFI_STA_IFACE_H_ - -#include -#include -#include - -#include "hidl_callback_util.h" -#include "wifi_iface_util.h" -#include "wifi_legacy_hal.h" - -namespace android { -namespace hardware { -namespace wifi { -namespace V1_5 { -namespace implementation { -using namespace android::hardware::wifi::V1_0; - -/** - * HIDL interface object used to control a STA Iface instance. - */ -class WifiStaIface : public V1_5::IWifiStaIface { - public: - WifiStaIface(const std::string& ifname, - const std::weak_ptr legacy_hal, - const std::weak_ptr iface_util); - // Refer to |WifiChip::invalidate()|. - void invalidate(); - bool isValid(); - std::set> getEventCallbacks(); - std::string getName(); - - // HIDL methods exposed. - Return getName(getName_cb hidl_status_cb) override; - Return getType(getType_cb hidl_status_cb) override; - Return registerEventCallback( - const sp& callback, - registerEventCallback_cb hidl_status_cb) override; - Return getCapabilities(getCapabilities_cb hidl_status_cb) override; - Return getApfPacketFilterCapabilities( - getApfPacketFilterCapabilities_cb hidl_status_cb) override; - Return installApfPacketFilter( - uint32_t cmd_id, const hidl_vec& program, - installApfPacketFilter_cb hidl_status_cb) override; - Return readApfPacketFilterData( - readApfPacketFilterData_cb hidl_status_cb) override; - Return getBackgroundScanCapabilities( - getBackgroundScanCapabilities_cb hidl_status_cb) override; - Return getValidFrequenciesForBand( - V1_0::WifiBand band, - getValidFrequenciesForBand_cb hidl_status_cb) override; - Return startBackgroundScan( - uint32_t cmd_id, const StaBackgroundScanParameters& params, - startBackgroundScan_cb hidl_status_cb) override; - Return stopBackgroundScan( - uint32_t cmd_id, stopBackgroundScan_cb hidl_status_cb) override; - Return enableLinkLayerStatsCollection( - bool debug, enableLinkLayerStatsCollection_cb hidl_status_cb) override; - Return disableLinkLayerStatsCollection( - disableLinkLayerStatsCollection_cb hidl_status_cb) override; - Return getLinkLayerStats( - getLinkLayerStats_cb hidl_status_cb) override; - Return getLinkLayerStats_1_3( - getLinkLayerStats_1_3_cb hidl_status_cb) override; - Return getLinkLayerStats_1_5( - getLinkLayerStats_1_5_cb hidl_status_cb) override; - Return startRssiMonitoring( - uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi, - startRssiMonitoring_cb hidl_status_cb) override; - Return stopRssiMonitoring( - uint32_t cmd_id, stopRssiMonitoring_cb hidl_status_cb) override; - Return getRoamingCapabilities( - getRoamingCapabilities_cb hidl_status_cb) override; - Return configureRoaming(const StaRoamingConfig& config, - configureRoaming_cb hidl_status_cb) override; - Return setRoamingState(StaRoamingState state, - setRoamingState_cb hidl_status_cb) override; - Return enableNdOffload(bool enable, - enableNdOffload_cb hidl_status_cb) override; - Return startSendingKeepAlivePackets( - uint32_t cmd_id, const hidl_vec& ip_packet_data, - uint16_t ether_type, const hidl_array& src_address, - const hidl_array& dst_address, uint32_t period_in_ms, - startSendingKeepAlivePackets_cb hidl_status_cb) override; - Return stopSendingKeepAlivePackets( - uint32_t cmd_id, - stopSendingKeepAlivePackets_cb hidl_status_cb) override; - Return setScanningMacOui( - const hidl_array& oui, - setScanningMacOui_cb hidl_status_cb) override; - Return startDebugPacketFateMonitoring( - startDebugPacketFateMonitoring_cb hidl_status_cb) override; - Return getDebugTxPacketFates( - getDebugTxPacketFates_cb hidl_status_cb) override; - Return getDebugRxPacketFates( - getDebugRxPacketFates_cb hidl_status_cb) override; - Return setMacAddress(const hidl_array& mac, - setMacAddress_cb hidl_status_cb) override; - Return getFactoryMacAddress( - getFactoryMacAddress_cb hidl_status_cb) override; - Return setScanMode(bool enable, - setScanMode_cb hidl_status_cb) override; - - private: - // Corresponding worker functions for the HIDL methods. - std::pair getNameInternal(); - std::pair getTypeInternal(); - WifiStatus registerEventCallbackInternal( - const sp& callback); - std::pair getCapabilitiesInternal(); - std::pair - getApfPacketFilterCapabilitiesInternal(); - WifiStatus installApfPacketFilterInternal( - uint32_t cmd_id, const std::vector& program); - std::pair> - readApfPacketFilterDataInternal(); - std::pair - getBackgroundScanCapabilitiesInternal(); - std::pair> - getValidFrequenciesForBandInternal(V1_0::WifiBand band); - WifiStatus startBackgroundScanInternal( - uint32_t cmd_id, const StaBackgroundScanParameters& params); - WifiStatus stopBackgroundScanInternal(uint32_t cmd_id); - WifiStatus enableLinkLayerStatsCollectionInternal(bool debug); - WifiStatus disableLinkLayerStatsCollectionInternal(); - std::pair getLinkLayerStatsInternal(); - std::pair - getLinkLayerStatsInternal_1_3(); - std::pair - getLinkLayerStatsInternal_1_5(); - WifiStatus startRssiMonitoringInternal(uint32_t cmd_id, int32_t max_rssi, - int32_t min_rssi); - WifiStatus stopRssiMonitoringInternal(uint32_t cmd_id); - std::pair - getRoamingCapabilitiesInternal(); - WifiStatus configureRoamingInternal(const StaRoamingConfig& config); - WifiStatus setRoamingStateInternal(StaRoamingState state); - WifiStatus enableNdOffloadInternal(bool enable); - WifiStatus startSendingKeepAlivePacketsInternal( - uint32_t cmd_id, const std::vector& ip_packet_data, - uint16_t ether_type, const std::array& src_address, - const std::array& dst_address, uint32_t period_in_ms); - WifiStatus stopSendingKeepAlivePacketsInternal(uint32_t cmd_id); - WifiStatus setScanningMacOuiInternal(const std::array& oui); - WifiStatus startDebugPacketFateMonitoringInternal(); - std::pair> - getDebugTxPacketFatesInternal(); - std::pair> - getDebugRxPacketFatesInternal(); - WifiStatus setMacAddressInternal(const std::array& mac); - std::pair> - getFactoryMacAddressInternal(); - WifiStatus setScanModeInternal(bool enable); - - std::string ifname_; - std::weak_ptr legacy_hal_; - std::weak_ptr iface_util_; - bool is_valid_; - hidl_callback_util::HidlCallbackHandler - event_cb_handler_; - - DISALLOW_COPY_AND_ASSIGN(WifiStaIface); -}; - -} // namespace implementation -} // namespace V1_5 -} // namespace wifi -} // namespace hardware -} // namespace android - -#endif // WIFI_STA_IFACE_H_ diff --git a/wifi/1.6/Android.bp b/wifi/1.6/Android.bp new file mode 100644 index 0000000000..d293c73a79 --- /dev/null +++ b/wifi/1.6/Android.bp @@ -0,0 +1,32 @@ +// This file is autogenerated by hidl-gen -Landroidbp. + +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"], +} + +hidl_interface { + name: "android.hardware.wifi@1.6", + root: "android.hardware", + srcs: [ + "IWifi.hal", + ], + interfaces: [ + "android.hardware.wifi@1.0", + "android.hardware.wifi@1.1", + "android.hardware.wifi@1.2", + "android.hardware.wifi@1.3", + "android.hardware.wifi@1.4", + "android.hardware.wifi@1.5", + "android.hidl.base@1.0", + ], + gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.wifi", + ], +} diff --git a/wifi/1.6/IWifi.hal b/wifi/1.6/IWifi.hal new file mode 100644 index 0000000000..0123e6ca83 --- /dev/null +++ b/wifi/1.6/IWifi.hal @@ -0,0 +1,27 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.5::IWifi; + +/** + * This is the root of the HAL module and is the interface returned when + * loading an implementation of the Wi-Fi HAL. There must be at most one + * module loaded in the system. + * IWifi.getChip() must return @1.5::IWifiChip + */ +interface IWifi extends @1.5::IWifi {}; diff --git a/wifi/1.5/default/Android.bp b/wifi/1.6/default/Android.bp similarity index 100% rename from wifi/1.5/default/Android.bp rename to wifi/1.6/default/Android.bp diff --git a/wifi/1.5/default/Android.mk b/wifi/1.6/default/Android.mk similarity index 96% rename from wifi/1.5/default/Android.mk rename to wifi/1.6/default/Android.mk index 1997b2209f..ca1c022db1 100644 --- a/wifi/1.5/default/Android.mk +++ b/wifi/1.6/default/Android.mk @@ -77,7 +77,8 @@ LOCAL_SHARED_LIBRARIES := \ android.hardware.wifi@1.2 \ android.hardware.wifi@1.3 \ android.hardware.wifi@1.4 \ - android.hardware.wifi@1.5 + android.hardware.wifi@1.5 \ + android.hardware.wifi@1.6 LOCAL_C_INCLUDES += $(TOP)/external/libxml2/include LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) include $(BUILD_STATIC_LIBRARY) @@ -111,7 +112,8 @@ LOCAL_SHARED_LIBRARIES := \ android.hardware.wifi@1.2 \ android.hardware.wifi@1.3 \ android.hardware.wifi@1.4 \ - android.hardware.wifi@1.5 + android.hardware.wifi@1.5 \ + android.hardware.wifi@1.6 LOCAL_STATIC_LIBRARIES := \ android.hardware.wifi@1.0-service-lib LOCAL_INIT_RC := android.hardware.wifi@1.0-service.rc @@ -148,7 +150,8 @@ LOCAL_SHARED_LIBRARIES := \ android.hardware.wifi@1.2 \ android.hardware.wifi@1.3 \ android.hardware.wifi@1.4 \ - android.hardware.wifi@1.5 + android.hardware.wifi@1.5 \ + android.hardware.wifi@1.6 LOCAL_STATIC_LIBRARIES := \ android.hardware.wifi@1.0-service-lib LOCAL_INIT_RC := android.hardware.wifi@1.0-service-lazy.rc @@ -185,6 +188,7 @@ LOCAL_STATIC_LIBRARIES := \ android.hardware.wifi@1.3 \ android.hardware.wifi@1.4 \ android.hardware.wifi@1.5 \ + android.hardware.wifi@1.6 \ android.hardware.wifi@1.0-service-lib LOCAL_SHARED_LIBRARIES := \ libbase \ diff --git a/wifi/1.5/default/OWNERS b/wifi/1.6/default/OWNERS similarity index 100% rename from wifi/1.5/default/OWNERS rename to wifi/1.6/default/OWNERS diff --git a/wifi/1.5/default/THREADING.README b/wifi/1.6/default/THREADING.README similarity index 100% rename from wifi/1.5/default/THREADING.README rename to wifi/1.6/default/THREADING.README diff --git a/wifi/1.5/default/android.hardware.wifi@1.0-service-lazy.rc b/wifi/1.6/default/android.hardware.wifi@1.0-service-lazy.rc similarity index 100% rename from wifi/1.5/default/android.hardware.wifi@1.0-service-lazy.rc rename to wifi/1.6/default/android.hardware.wifi@1.0-service-lazy.rc diff --git a/wifi/1.5/default/android.hardware.wifi@1.0-service.rc b/wifi/1.6/default/android.hardware.wifi@1.0-service.rc similarity index 90% rename from wifi/1.5/default/android.hardware.wifi@1.0-service.rc rename to wifi/1.6/default/android.hardware.wifi@1.0-service.rc index 05706ef4f4..18f40d0bb5 100644 --- a/wifi/1.5/default/android.hardware.wifi@1.0-service.rc +++ b/wifi/1.6/default/android.hardware.wifi@1.0-service.rc @@ -5,6 +5,7 @@ service vendor.wifi_hal_legacy /vendor/bin/hw/android.hardware.wifi@1.0-service interface android.hardware.wifi@1.3::IWifi default interface android.hardware.wifi@1.4::IWifi default interface android.hardware.wifi@1.5::IWifi default + interface android.hardware.wifi@1.6::IWifi default class hal capabilities NET_ADMIN NET_RAW SYS_MODULE user wifi diff --git a/wifi/1.5/default/android.hardware.wifi@1.0-service.xml b/wifi/1.6/default/android.hardware.wifi@1.0-service.xml similarity index 90% rename from wifi/1.5/default/android.hardware.wifi@1.0-service.xml rename to wifi/1.6/default/android.hardware.wifi@1.0-service.xml index 88dd1e3285..771fbaaf42 100644 --- a/wifi/1.5/default/android.hardware.wifi@1.0-service.xml +++ b/wifi/1.6/default/android.hardware.wifi@1.0-service.xml @@ -2,7 +2,7 @@ android.hardware.wifi hwbinder - 1.5 + 1.6 IWifi default diff --git a/wifi/1.5/default/hidl_callback_util.h b/wifi/1.6/default/hidl_callback_util.h similarity index 88% rename from wifi/1.5/default/hidl_callback_util.h rename to wifi/1.6/default/hidl_callback_util.h index d144658750..3ac54c1666 100644 --- a/wifi/1.5/default/hidl_callback_util.h +++ b/wifi/1.6/default/hidl_callback_util.h @@ -29,20 +29,18 @@ using on_death_cb_function = std::function; // callbacks stored in HidlCallbackHandler. template class HidlDeathHandler : public android::hardware::hidl_death_recipient { - public: + public: HidlDeathHandler(const on_death_cb_function& user_cb_function) : cb_function_(user_cb_function) {} ~HidlDeathHandler() = default; // Death notification for callbacks. - void serviceDied( - uint64_t cookie, - const android::wp& /* who */) - override { + void serviceDied(uint64_t cookie, + const android::wp& /* who */) override { cb_function_(cookie); } - private: + private: on_death_cb_function cb_function_; DISALLOW_COPY_AND_ASSIGN(HidlDeathHandler); @@ -52,18 +50,17 @@ class HidlDeathHandler : public android::hardware::hidl_death_recipient { namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace hidl_callback_util { template // Provides a class to manage callbacks for the various HIDL interfaces and // handle the death of the process hosting each callback. class HidlCallbackHandler { - public: + public: HidlCallbackHandler() : death_handler_(new HidlDeathHandler( - std::bind(&HidlCallbackHandler::onObjectDeath, this, - std::placeholders::_1))) {} + std::bind(&HidlCallbackHandler::onObjectDeath, this, std::placeholders::_1))) {} ~HidlCallbackHandler() = default; bool addCallback(const sp& cb) { @@ -83,9 +80,7 @@ class HidlCallbackHandler { return true; } - const std::set>& getCallbacks() { - return cb_set_; - } + const std::set>& getCallbacks() { return cb_set_; } // Death notification for callbacks. void onObjectDeath(uint64_t cookie) { @@ -108,7 +103,7 @@ class HidlCallbackHandler { cb_set_.clear(); } - private: + private: std::set> cb_set_; sp> death_handler_; @@ -117,7 +112,7 @@ class HidlCallbackHandler { } // namespace hidl_callback_util } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/hidl_return_util.h b/wifi/1.6/default/hidl_return_util.h similarity index 77% rename from wifi/1.5/default/hidl_return_util.h rename to wifi/1.6/default/hidl_return_util.h index 4455185283..a0efac2c57 100644 --- a/wifi/1.5/default/hidl_return_util.h +++ b/wifi/1.6/default/hidl_return_util.h @@ -23,7 +23,7 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace hidl_return_util { using namespace android::hardware::wifi::V1_0; @@ -40,9 +40,9 @@ using namespace android::hardware::wifi::V1_0; */ // Use for HIDL methods which return only an instance of WifiStatus. template -Return validateAndCall( - ObjT* obj, WifiStatusCode status_code_if_invalid, WorkFuncT&& work, - const std::function& hidl_cb, Args&&... args) { +Return validateAndCall(ObjT* obj, WifiStatusCode status_code_if_invalid, WorkFuncT&& work, + const std::function& hidl_cb, + Args&&... args) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (obj->isValid()) { hidl_cb((obj->*work)(std::forward(args)...)); @@ -56,9 +56,10 @@ Return validateAndCall( // This version passes the global lock acquired to the body of the method. // Note: Only used by IWifi::stop() currently. template -Return validateAndCallWithLock( - ObjT* obj, WifiStatusCode status_code_if_invalid, WorkFuncT&& work, - const std::function& hidl_cb, Args&&... args) { +Return validateAndCallWithLock(ObjT* obj, WifiStatusCode status_code_if_invalid, + WorkFuncT&& work, + const std::function& hidl_cb, + Args&&... args) { auto lock = hidl_sync_util::acquireGlobalLock(); if (obj->isValid()) { hidl_cb((obj->*work)(&lock, std::forward(args)...)); @@ -71,10 +72,9 @@ Return validateAndCallWithLock( // Use for HIDL methods which return instance of WifiStatus and a single return // value. template -Return validateAndCall( - ObjT* obj, WifiStatusCode status_code_if_invalid, WorkFuncT&& work, - const std::function& hidl_cb, - Args&&... args) { +Return validateAndCall(ObjT* obj, WifiStatusCode status_code_if_invalid, WorkFuncT&& work, + const std::function& hidl_cb, + Args&&... args) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (obj->isValid()) { const auto& ret_pair = (obj->*work)(std::forward(args)...); @@ -90,12 +90,10 @@ Return validateAndCall( // Use for HIDL methods which return instance of WifiStatus and 2 return // values. -template +template Return validateAndCall( - ObjT* obj, WifiStatusCode status_code_if_invalid, WorkFuncT&& work, - const std::function& hidl_cb, - Args&&... args) { + ObjT* obj, WifiStatusCode status_code_if_invalid, WorkFuncT&& work, + const std::function& hidl_cb, Args&&... args) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (obj->isValid()) { const auto& ret_tuple = (obj->*work)(std::forward(args)...); @@ -113,7 +111,7 @@ Return validateAndCall( } // namespace hidl_return_util } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/hidl_struct_util.cpp b/wifi/1.6/default/hidl_struct_util.cpp similarity index 63% rename from wifi/1.5/default/hidl_struct_util.cpp rename to wifi/1.6/default/hidl_struct_util.cpp index 338a8f13c1..3489c9e4d3 100644 --- a/wifi/1.5/default/hidl_struct_util.cpp +++ b/wifi/1.6/default/hidl_struct_util.cpp @@ -22,12 +22,13 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace hidl_struct_util { -WifiChannelWidthInMhz convertLegacyWifiChannelWidthToHidl( - legacy_hal::wifi_channel_width type); +using V1_5::NanConfigRequestSupplemental; + +WifiChannelWidthInMhz convertLegacyWifiChannelWidthToHidl(legacy_hal::wifi_channel_width type); hidl_string safeConvertChar(const char* str, size_t max_len) { const char* c = str; @@ -39,8 +40,7 @@ hidl_string safeConvertChar(const char* str, size_t max_len) { return hidl_string(str, size); } -IWifiChip::ChipCapabilityMask convertLegacyLoggerFeatureToHidlChipCapability( - uint32_t feature) { +IWifiChip::ChipCapabilityMask convertLegacyLoggerFeatureToHidlChipCapability(uint32_t feature) { using HidlChipCaps = IWifiChip::ChipCapabilityMask; switch (feature) { case legacy_hal::WIFI_LOGGER_MEMORY_DUMP_SUPPORTED: @@ -58,8 +58,8 @@ IWifiChip::ChipCapabilityMask convertLegacyLoggerFeatureToHidlChipCapability( return {}; } -IWifiStaIface::StaIfaceCapabilityMask -convertLegacyLoggerFeatureToHidlStaIfaceCapability(uint32_t feature) { +IWifiStaIface::StaIfaceCapabilityMask convertLegacyLoggerFeatureToHidlStaIfaceCapability( + uint32_t feature) { using HidlStaIfaceCaps = IWifiStaIface::StaIfaceCapabilityMask; switch (feature) { case legacy_hal::WIFI_LOGGER_PACKET_FATE_SUPPORTED: @@ -69,8 +69,7 @@ convertLegacyLoggerFeatureToHidlStaIfaceCapability(uint32_t feature) { return {}; } -V1_5::IWifiChip::ChipCapabilityMask convertLegacyFeatureToHidlChipCapability( - uint64_t feature) { +V1_5::IWifiChip::ChipCapabilityMask convertLegacyFeatureToHidlChipCapability(uint64_t feature) { using HidlChipCaps = V1_5::IWifiChip::ChipCapabilityMask; switch (feature) { case WIFI_FEATURE_SET_TX_POWER_LIMIT: @@ -92,8 +91,8 @@ V1_5::IWifiChip::ChipCapabilityMask convertLegacyFeatureToHidlChipCapability( return {}; } -IWifiStaIface::StaIfaceCapabilityMask -convertLegacyFeatureToHidlStaIfaceCapability(uint64_t feature) { +IWifiStaIface::StaIfaceCapabilityMask convertLegacyFeatureToHidlStaIfaceCapability( + uint64_t feature) { using HidlStaIfaceCaps = IWifiStaIface::StaIfaceCapabilityMask; switch (feature) { case WIFI_FEATURE_GSCAN: @@ -127,9 +126,9 @@ convertLegacyFeatureToHidlStaIfaceCapability(uint64_t feature) { return {}; } -bool convertLegacyFeaturesToHidlChipCapabilities( - uint64_t legacy_feature_set, uint32_t legacy_logger_feature_set, - uint32_t* hidl_caps) { +bool convertLegacyFeaturesToHidlChipCapabilities(uint64_t legacy_feature_set, + uint32_t legacy_logger_feature_set, + uint32_t* hidl_caps) { if (!hidl_caps) { return false; } @@ -141,8 +140,7 @@ bool convertLegacyFeaturesToHidlChipCapabilities( legacy_hal::WIFI_LOGGER_POWER_EVENT_SUPPORTED, legacy_hal::WIFI_LOGGER_WAKE_LOCK_SUPPORTED}) { if (feature & legacy_logger_feature_set) { - *hidl_caps |= - convertLegacyLoggerFeatureToHidlChipCapability(feature); + *hidl_caps |= convertLegacyLoggerFeatureToHidlChipCapability(feature); } } std::vector features = {WIFI_FEATURE_SET_TX_POWER_LIMIT, @@ -166,8 +164,7 @@ bool convertLegacyFeaturesToHidlChipCapabilities( return true; } -WifiDebugRingBufferFlags convertLegacyDebugRingBufferFlagsToHidl( - uint32_t flag) { +WifiDebugRingBufferFlags convertLegacyDebugRingBufferFlagsToHidl(uint32_t flag) { switch (flag) { case WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES: return WifiDebugRingBufferFlags::HAS_BINARY_ENTRIES; @@ -179,22 +176,20 @@ WifiDebugRingBufferFlags convertLegacyDebugRingBufferFlagsToHidl( } bool convertLegacyDebugRingBufferStatusToHidl( - const legacy_hal::wifi_ring_buffer_status& legacy_status, - WifiDebugRingBufferStatus* hidl_status) { + const legacy_hal::wifi_ring_buffer_status& legacy_status, + WifiDebugRingBufferStatus* hidl_status) { if (!hidl_status) { return false; } *hidl_status = {}; - hidl_status->ringName = - safeConvertChar(reinterpret_cast(legacy_status.name), - sizeof(legacy_status.name)); + hidl_status->ringName = safeConvertChar(reinterpret_cast(legacy_status.name), + sizeof(legacy_status.name)); hidl_status->flags = 0; - for (const auto flag : {WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES, - WIFI_RING_BUFFER_FLAG_HAS_ASCII_ENTRIES}) { + for (const auto flag : + {WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES, WIFI_RING_BUFFER_FLAG_HAS_ASCII_ENTRIES}) { if (flag & legacy_status.flags) { - hidl_status->flags |= static_cast< - std::underlying_type::type>( - convertLegacyDebugRingBufferFlagsToHidl(flag)); + hidl_status->flags |= static_cast::type>( + convertLegacyDebugRingBufferFlagsToHidl(flag)); } } hidl_status->ringId = legacy_status.ring_id; @@ -202,28 +197,25 @@ bool convertLegacyDebugRingBufferStatusToHidl( // Calculate free size of the ring the buffer. We don't need to send the // exact read/write pointers that were there in the legacy HAL interface. if (legacy_status.written_bytes >= legacy_status.read_bytes) { - hidl_status->freeSizeInBytes = - legacy_status.ring_buffer_byte_size - - (legacy_status.written_bytes - legacy_status.read_bytes); + hidl_status->freeSizeInBytes = legacy_status.ring_buffer_byte_size - + (legacy_status.written_bytes - legacy_status.read_bytes); } else { - hidl_status->freeSizeInBytes = - legacy_status.read_bytes - legacy_status.written_bytes; + hidl_status->freeSizeInBytes = legacy_status.read_bytes - legacy_status.written_bytes; } hidl_status->verboseLevel = legacy_status.verbose_level; return true; } bool convertLegacyVectorOfDebugRingBufferStatusToHidl( - const std::vector& legacy_status_vec, - std::vector* hidl_status_vec) { + const std::vector& legacy_status_vec, + std::vector* hidl_status_vec) { if (!hidl_status_vec) { return false; } *hidl_status_vec = {}; for (const auto& legacy_status : legacy_status_vec) { WifiDebugRingBufferStatus hidl_status; - if (!convertLegacyDebugRingBufferStatusToHidl(legacy_status, - &hidl_status)) { + if (!convertLegacyDebugRingBufferStatusToHidl(legacy_status, &hidl_status)) { return false; } hidl_status_vec->push_back(hidl_status); @@ -231,52 +223,44 @@ bool convertLegacyVectorOfDebugRingBufferStatusToHidl( return true; } -bool convertLegacyWakeReasonStatsToHidl( - const legacy_hal::WakeReasonStats& legacy_stats, - WifiDebugHostWakeReasonStats* hidl_stats) { +bool convertLegacyWakeReasonStatsToHidl(const legacy_hal::WakeReasonStats& legacy_stats, + WifiDebugHostWakeReasonStats* hidl_stats) { if (!hidl_stats) { return false; } *hidl_stats = {}; - hidl_stats->totalCmdEventWakeCnt = - legacy_stats.wake_reason_cnt.total_cmd_event_wake; + hidl_stats->totalCmdEventWakeCnt = legacy_stats.wake_reason_cnt.total_cmd_event_wake; hidl_stats->cmdEventWakeCntPerType = legacy_stats.cmd_event_wake_cnt; - hidl_stats->totalDriverFwLocalWakeCnt = - legacy_stats.wake_reason_cnt.total_driver_fw_local_wake; - hidl_stats->driverFwLocalWakeCntPerType = - legacy_stats.driver_fw_local_wake_cnt; - hidl_stats->totalRxPacketWakeCnt = - legacy_stats.wake_reason_cnt.total_rx_data_wake; + hidl_stats->totalDriverFwLocalWakeCnt = legacy_stats.wake_reason_cnt.total_driver_fw_local_wake; + hidl_stats->driverFwLocalWakeCntPerType = legacy_stats.driver_fw_local_wake_cnt; + hidl_stats->totalRxPacketWakeCnt = legacy_stats.wake_reason_cnt.total_rx_data_wake; hidl_stats->rxPktWakeDetails.rxUnicastCnt = - legacy_stats.wake_reason_cnt.rx_wake_details.rx_unicast_cnt; + legacy_stats.wake_reason_cnt.rx_wake_details.rx_unicast_cnt; hidl_stats->rxPktWakeDetails.rxMulticastCnt = - legacy_stats.wake_reason_cnt.rx_wake_details.rx_multicast_cnt; + legacy_stats.wake_reason_cnt.rx_wake_details.rx_multicast_cnt; hidl_stats->rxPktWakeDetails.rxBroadcastCnt = - legacy_stats.wake_reason_cnt.rx_wake_details.rx_broadcast_cnt; + legacy_stats.wake_reason_cnt.rx_wake_details.rx_broadcast_cnt; hidl_stats->rxMulticastPkWakeDetails.ipv4RxMulticastAddrCnt = - legacy_stats.wake_reason_cnt.rx_multicast_wake_pkt_info - .ipv4_rx_multicast_addr_cnt; + legacy_stats.wake_reason_cnt.rx_multicast_wake_pkt_info.ipv4_rx_multicast_addr_cnt; hidl_stats->rxMulticastPkWakeDetails.ipv6RxMulticastAddrCnt = - legacy_stats.wake_reason_cnt.rx_multicast_wake_pkt_info - .ipv6_rx_multicast_addr_cnt; + legacy_stats.wake_reason_cnt.rx_multicast_wake_pkt_info.ipv6_rx_multicast_addr_cnt; hidl_stats->rxMulticastPkWakeDetails.otherRxMulticastAddrCnt = - legacy_stats.wake_reason_cnt.rx_multicast_wake_pkt_info - .other_rx_multicast_addr_cnt; + legacy_stats.wake_reason_cnt.rx_multicast_wake_pkt_info.other_rx_multicast_addr_cnt; hidl_stats->rxIcmpPkWakeDetails.icmpPkt = - legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp_pkt; + legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp_pkt; hidl_stats->rxIcmpPkWakeDetails.icmp6Pkt = - legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_pkt; + legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_pkt; hidl_stats->rxIcmpPkWakeDetails.icmp6Ra = - legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_ra; + legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_ra; hidl_stats->rxIcmpPkWakeDetails.icmp6Na = - legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_na; + legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_na; hidl_stats->rxIcmpPkWakeDetails.icmp6Ns = - legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_ns; + legacy_stats.wake_reason_cnt.rx_wake_pkt_classification_info.icmp6_ns; return true; } legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy( - V1_1::IWifiChip::TxPowerScenario hidl_scenario) { + V1_1::IWifiChip::TxPowerScenario hidl_scenario) { switch (hidl_scenario) { // This is the only supported scenario for V1_1 case V1_1::IWifiChip::TxPowerScenario::VOICE_CALL: @@ -286,7 +270,7 @@ legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy( } legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy_1_2( - V1_2::IWifiChip::TxPowerScenario hidl_scenario) { + V1_2::IWifiChip::TxPowerScenario hidl_scenario) { switch (hidl_scenario) { // This is the only supported scenario for V1_1 case V1_2::IWifiChip::TxPowerScenario::VOICE_CALL: @@ -305,7 +289,7 @@ legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy_1_2( } legacy_hal::wifi_latency_mode convertHidlLatencyModeToLegacy( - V1_3::IWifiChip::LatencyMode hidl_latency_mode) { + V1_3::IWifiChip::LatencyMode hidl_latency_mode) { switch (hidl_latency_mode) { case V1_3::IWifiChip::LatencyMode::NORMAL: return legacy_hal::WIFI_LATENCY_MODE_NORMAL; @@ -316,8 +300,8 @@ legacy_hal::wifi_latency_mode convertHidlLatencyModeToLegacy( } bool convertLegacyWifiMacInfoToHidl( - const legacy_hal::WifiMacInfo& legacy_mac_info, - V1_4::IWifiChipEventCallback::RadioModeInfo* hidl_radio_mode_info) { + const legacy_hal::WifiMacInfo& legacy_mac_info, + V1_4::IWifiChipEventCallback::RadioModeInfo* hidl_radio_mode_info) { if (!hidl_radio_mode_info) { return false; } @@ -366,24 +350,20 @@ uint32_t convertHidlWifiBandToLegacyMacBand(V1_5::WifiBand hidl_band) { return legacy_hal::WLAN_MAC_5_0_BAND; case V1_5::WifiBand::BAND_24GHZ_5GHZ: case V1_5::WifiBand::BAND_24GHZ_5GHZ_WITH_DFS: - return (legacy_hal::WLAN_MAC_2_4_BAND | - legacy_hal::WLAN_MAC_5_0_BAND); + return (legacy_hal::WLAN_MAC_2_4_BAND | legacy_hal::WLAN_MAC_5_0_BAND); case V1_5::WifiBand::BAND_6GHZ: return legacy_hal::WLAN_MAC_6_0_BAND; case V1_5::WifiBand::BAND_5GHZ_6GHZ: - return (legacy_hal::WLAN_MAC_5_0_BAND | - legacy_hal::WLAN_MAC_6_0_BAND); + return (legacy_hal::WLAN_MAC_5_0_BAND | legacy_hal::WLAN_MAC_6_0_BAND); case V1_5::WifiBand::BAND_24GHZ_5GHZ_6GHZ: case V1_5::WifiBand::BAND_24GHZ_5GHZ_WITH_DFS_6GHZ: - return (legacy_hal::WLAN_MAC_2_4_BAND | - legacy_hal::WLAN_MAC_5_0_BAND | + return (legacy_hal::WLAN_MAC_2_4_BAND | legacy_hal::WLAN_MAC_5_0_BAND | legacy_hal::WLAN_MAC_6_0_BAND); case V1_5::WifiBand::BAND_60GHZ: return legacy_hal::WLAN_MAC_60_0_BAND; default: - return ( - legacy_hal::WLAN_MAC_2_4_BAND | legacy_hal::WLAN_MAC_5_0_BAND | - legacy_hal::WLAN_MAC_6_0_BAND | legacy_hal::WLAN_MAC_60_0_BAND); + return (legacy_hal::WLAN_MAC_2_4_BAND | legacy_hal::WLAN_MAC_5_0_BAND | + legacy_hal::WLAN_MAC_6_0_BAND | legacy_hal::WLAN_MAC_60_0_BAND); } } @@ -447,45 +427,41 @@ uint32_t convertLegacyWifiInterfaceModeToHidl(uint32_t legacy_iface_mask) { uint32_t convertHidlUsableChannelFilterToLegacy(uint32_t hidl_filter_mask) { uint32_t legacy_filter_mask = 0; - if (hidl_filter_mask & - IWifiChip::UsableChannelFilter::CELLULAR_COEXISTENCE) { - legacy_filter_mask |= - legacy_hal::WIFI_USABLE_CHANNEL_FILTER_CELLULAR_COEXISTENCE; + if (hidl_filter_mask & V1_5::IWifiChip::UsableChannelFilter::CELLULAR_COEXISTENCE) { + legacy_filter_mask |= legacy_hal::WIFI_USABLE_CHANNEL_FILTER_CELLULAR_COEXISTENCE; } - if (hidl_filter_mask & IWifiChip::UsableChannelFilter::CONCURRENCY) { - legacy_filter_mask |= - legacy_hal::WIFI_USABLE_CHANNEL_FILTER_CONCURRENCY; + if (hidl_filter_mask & V1_5::IWifiChip::UsableChannelFilter::CONCURRENCY) { + legacy_filter_mask |= legacy_hal::WIFI_USABLE_CHANNEL_FILTER_CONCURRENCY; } return legacy_filter_mask; } bool convertLegacyWifiUsableChannelToHidl( - const legacy_hal::wifi_usable_channel& legacy_usable_channel, - V1_5::WifiUsableChannel* hidl_usable_channel) { + const legacy_hal::wifi_usable_channel& legacy_usable_channel, + V1_5::WifiUsableChannel* hidl_usable_channel) { if (!hidl_usable_channel) { return false; } *hidl_usable_channel = {}; hidl_usable_channel->channel = legacy_usable_channel.freq; hidl_usable_channel->channelBandwidth = - convertLegacyWifiChannelWidthToHidl(legacy_usable_channel.width); - hidl_usable_channel->ifaceModeMask = convertLegacyWifiInterfaceModeToHidl( - legacy_usable_channel.iface_mode_mask); + convertLegacyWifiChannelWidthToHidl(legacy_usable_channel.width); + hidl_usable_channel->ifaceModeMask = + convertLegacyWifiInterfaceModeToHidl(legacy_usable_channel.iface_mode_mask); return true; } bool convertLegacyWifiUsableChannelsToHidl( - const std::vector& legacy_usable_channels, - std::vector* hidl_usable_channels) { + const std::vector& legacy_usable_channels, + std::vector* hidl_usable_channels) { if (!hidl_usable_channels) { return false; } *hidl_usable_channels = {}; for (const auto& legacy_usable_channel : legacy_usable_channels) { V1_5::WifiUsableChannel hidl_usable_channel; - if (!convertLegacyWifiUsableChannelToHidl(legacy_usable_channel, - &hidl_usable_channel)) { + if (!convertLegacyWifiUsableChannelToHidl(legacy_usable_channel, &hidl_usable_channel)) { return false; } hidl_usable_channels->push_back(hidl_usable_channel); @@ -494,9 +470,8 @@ bool convertLegacyWifiUsableChannelsToHidl( } bool convertLegacyWifiMacInfosToHidl( - const std::vector& legacy_mac_infos, - std::vector* - hidl_radio_mode_infos) { + const std::vector& legacy_mac_infos, + std::vector* hidl_radio_mode_infos) { if (!hidl_radio_mode_infos) { return false; } @@ -504,8 +479,7 @@ bool convertLegacyWifiMacInfosToHidl( for (const auto& legacy_mac_info : legacy_mac_infos) { V1_4::IWifiChipEventCallback::RadioModeInfo hidl_radio_mode_info; - if (!convertLegacyWifiMacInfoToHidl(legacy_mac_info, - &hidl_radio_mode_info)) { + if (!convertLegacyWifiMacInfoToHidl(legacy_mac_info, &hidl_radio_mode_info)) { return false; } hidl_radio_mode_infos->push_back(hidl_radio_mode_info); @@ -513,9 +487,9 @@ bool convertLegacyWifiMacInfosToHidl( return true; } -bool convertLegacyFeaturesToHidlStaCapabilities( - uint64_t legacy_feature_set, uint32_t legacy_logger_feature_set, - uint32_t* hidl_caps) { +bool convertLegacyFeaturesToHidlStaCapabilities(uint64_t legacy_feature_set, + uint32_t legacy_logger_feature_set, + uint32_t* hidl_caps) { if (!hidl_caps) { return false; } @@ -523,17 +497,14 @@ bool convertLegacyFeaturesToHidlStaCapabilities( using HidlStaIfaceCaps = IWifiStaIface::StaIfaceCapabilityMask; for (const auto feature : {legacy_hal::WIFI_LOGGER_PACKET_FATE_SUPPORTED}) { if (feature & legacy_logger_feature_set) { - *hidl_caps |= - convertLegacyLoggerFeatureToHidlStaIfaceCapability(feature); + *hidl_caps |= convertLegacyLoggerFeatureToHidlStaIfaceCapability(feature); } } for (const auto feature : - {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_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}) { if (feature & legacy_feature_set) { *hidl_caps |= convertLegacyFeatureToHidlStaIfaceCapability(feature); } @@ -544,9 +515,8 @@ bool convertLegacyFeaturesToHidlStaCapabilities( return true; } -bool convertLegacyApfCapabilitiesToHidl( - const legacy_hal::PacketFilterCapabilities& legacy_caps, - StaApfPacketFilterCapabilities* hidl_caps) { +bool convertLegacyApfCapabilitiesToHidl(const legacy_hal::PacketFilterCapabilities& legacy_caps, + StaApfPacketFilterCapabilities* hidl_caps) { if (!hidl_caps) { return false; } @@ -557,7 +527,7 @@ bool convertLegacyApfCapabilitiesToHidl( } uint8_t convertHidlGscanReportEventFlagToLegacy( - StaBackgroundScanBucketEventReportSchemeMask hidl_flag) { + StaBackgroundScanBucketEventReportSchemeMask hidl_flag) { using HidlFlag = StaBackgroundScanBucketEventReportSchemeMask; switch (hidl_flag) { case HidlFlag::EACH_SCAN: @@ -581,9 +551,8 @@ StaScanDataFlagMask convertLegacyGscanDataFlagToHidl(uint8_t legacy_flag) { return {}; } -bool convertLegacyGscanCapabilitiesToHidl( - const legacy_hal::wifi_gscan_capabilities& legacy_caps, - StaBackgroundScanCapabilities* hidl_caps) { +bool convertLegacyGscanCapabilitiesToHidl(const legacy_hal::wifi_gscan_capabilities& legacy_caps, + StaBackgroundScanCapabilities* hidl_caps) { if (!hidl_caps) { return false; } @@ -615,73 +584,61 @@ legacy_hal::wifi_band convertHidlWifiBandToLegacy(V1_0::WifiBand band) { CHECK(false); } -bool convertHidlGscanParamsToLegacy( - const StaBackgroundScanParameters& hidl_scan_params, - legacy_hal::wifi_scan_cmd_params* legacy_scan_params) { +bool convertHidlGscanParamsToLegacy(const StaBackgroundScanParameters& hidl_scan_params, + legacy_hal::wifi_scan_cmd_params* legacy_scan_params) { if (!legacy_scan_params) { return false; } *legacy_scan_params = {}; legacy_scan_params->base_period = hidl_scan_params.basePeriodInMs; legacy_scan_params->max_ap_per_scan = hidl_scan_params.maxApPerScan; - legacy_scan_params->report_threshold_percent = - hidl_scan_params.reportThresholdPercent; - legacy_scan_params->report_threshold_num_scans = - hidl_scan_params.reportThresholdNumScans; + legacy_scan_params->report_threshold_percent = hidl_scan_params.reportThresholdPercent; + legacy_scan_params->report_threshold_num_scans = hidl_scan_params.reportThresholdNumScans; if (hidl_scan_params.buckets.size() > MAX_BUCKETS) { return false; } legacy_scan_params->num_buckets = hidl_scan_params.buckets.size(); - for (uint32_t bucket_idx = 0; bucket_idx < hidl_scan_params.buckets.size(); - bucket_idx++) { + for (uint32_t bucket_idx = 0; bucket_idx < hidl_scan_params.buckets.size(); bucket_idx++) { const StaBackgroundScanBucketParameters& hidl_bucket_spec = - hidl_scan_params.buckets[bucket_idx]; + hidl_scan_params.buckets[bucket_idx]; legacy_hal::wifi_scan_bucket_spec& legacy_bucket_spec = - legacy_scan_params->buckets[bucket_idx]; + legacy_scan_params->buckets[bucket_idx]; if (hidl_bucket_spec.bucketIdx >= MAX_BUCKETS) { return false; } legacy_bucket_spec.bucket = hidl_bucket_spec.bucketIdx; - legacy_bucket_spec.band = - convertHidlWifiBandToLegacy(hidl_bucket_spec.band); + legacy_bucket_spec.band = convertHidlWifiBandToLegacy(hidl_bucket_spec.band); legacy_bucket_spec.period = hidl_bucket_spec.periodInMs; - legacy_bucket_spec.max_period = - hidl_bucket_spec.exponentialMaxPeriodInMs; + legacy_bucket_spec.max_period = hidl_bucket_spec.exponentialMaxPeriodInMs; legacy_bucket_spec.base = hidl_bucket_spec.exponentialBase; legacy_bucket_spec.step_count = hidl_bucket_spec.exponentialStepCount; legacy_bucket_spec.report_events = 0; using HidlFlag = StaBackgroundScanBucketEventReportSchemeMask; - for (const auto flag : {HidlFlag::EACH_SCAN, HidlFlag::FULL_RESULTS, - HidlFlag::NO_BATCH}) { + for (const auto flag : {HidlFlag::EACH_SCAN, HidlFlag::FULL_RESULTS, HidlFlag::NO_BATCH}) { if (hidl_bucket_spec.eventReportScheme & static_cast::type>(flag)) { - legacy_bucket_spec.report_events |= - convertHidlGscanReportEventFlagToLegacy(flag); + legacy_bucket_spec.report_events |= convertHidlGscanReportEventFlagToLegacy(flag); } } if (hidl_bucket_spec.frequencies.size() > MAX_CHANNELS) { return false; } legacy_bucket_spec.num_channels = hidl_bucket_spec.frequencies.size(); - for (uint32_t freq_idx = 0; - freq_idx < hidl_bucket_spec.frequencies.size(); freq_idx++) { - legacy_bucket_spec.channels[freq_idx].channel = - hidl_bucket_spec.frequencies[freq_idx]; + for (uint32_t freq_idx = 0; freq_idx < hidl_bucket_spec.frequencies.size(); freq_idx++) { + legacy_bucket_spec.channels[freq_idx].channel = hidl_bucket_spec.frequencies[freq_idx]; } } return true; } -bool convertLegacyIeToHidl( - const legacy_hal::wifi_information_element& legacy_ie, - WifiInformationElement* hidl_ie) { +bool convertLegacyIeToHidl(const legacy_hal::wifi_information_element& legacy_ie, + WifiInformationElement* hidl_ie) { if (!hidl_ie) { return false; } *hidl_ie = {}; hidl_ie->id = legacy_ie.id; - hidl_ie->data = - std::vector(legacy_ie.data, legacy_ie.data + legacy_ie.len); + hidl_ie->data = std::vector(legacy_ie.data, legacy_ie.data + legacy_ie.len); return true; } @@ -702,14 +659,12 @@ bool convertLegacyIeBlobToHidl(const uint8_t* ie_blob, uint32_t ie_blob_len, uint32_t curr_ie_len = kIeHeaderLen + legacy_ie.len; if (next_ie + curr_ie_len > ies_end) { LOG(ERROR) << "Error parsing IE blob. Next IE: " << (void*)next_ie - << ", Curr IE len: " << curr_ie_len - << ", IEs End: " << (void*)ies_end; + << ", Curr IE len: " << curr_ie_len << ", IEs End: " << (void*)ies_end; break; } WifiInformationElement hidl_ie; if (!convertLegacyIeToHidl(legacy_ie, &hidl_ie)) { - LOG(ERROR) << "Error converting IE. Id: " << legacy_ie.id - << ", len: " << legacy_ie.len; + LOG(ERROR) << "Error converting IE. Id: " << legacy_ie.id << ", len: " << legacy_ie.len; break; } hidl_ies->push_back(std::move(hidl_ie)); @@ -717,24 +672,23 @@ bool convertLegacyIeBlobToHidl(const uint8_t* ie_blob, uint32_t ie_blob_len, } // Check if the blob has been fully consumed. if (next_ie != ies_end) { - LOG(ERROR) << "Failed to fully parse IE blob. Next IE: " - << (void*)next_ie << ", IEs End: " << (void*)ies_end; + LOG(ERROR) << "Failed to fully parse IE blob. Next IE: " << (void*)next_ie + << ", IEs End: " << (void*)ies_end; } return true; } -bool convertLegacyGscanResultToHidl( - const legacy_hal::wifi_scan_result& legacy_scan_result, bool has_ie_data, - StaScanResult* hidl_scan_result) { +bool convertLegacyGscanResultToHidl(const legacy_hal::wifi_scan_result& legacy_scan_result, + bool has_ie_data, StaScanResult* hidl_scan_result) { if (!hidl_scan_result) { return false; } *hidl_scan_result = {}; hidl_scan_result->timeStampInUs = legacy_scan_result.ts; hidl_scan_result->ssid = std::vector( - legacy_scan_result.ssid, - legacy_scan_result.ssid + strnlen(legacy_scan_result.ssid, - sizeof(legacy_scan_result.ssid) - 1)); + legacy_scan_result.ssid, + legacy_scan_result.ssid + + strnlen(legacy_scan_result.ssid, sizeof(legacy_scan_result.ssid) - 1)); memcpy(hidl_scan_result->bssid.data(), legacy_scan_result.bssid, hidl_scan_result->bssid.size()); hidl_scan_result->frequency = legacy_scan_result.channel; @@ -743,9 +697,8 @@ bool convertLegacyGscanResultToHidl( hidl_scan_result->capability = legacy_scan_result.capability; if (has_ie_data) { std::vector ies; - if (!convertLegacyIeBlobToHidl( - reinterpret_cast(legacy_scan_result.ie_data), - legacy_scan_result.ie_length, &ies)) { + if (!convertLegacyIeBlobToHidl(reinterpret_cast(legacy_scan_result.ie_data), + legacy_scan_result.ie_length, &ies)) { return false; } hidl_scan_result->informationElements = std::move(ies); @@ -754,8 +707,8 @@ bool convertLegacyGscanResultToHidl( } bool convertLegacyCachedGscanResultsToHidl( - const legacy_hal::wifi_cached_scan_results& legacy_cached_scan_result, - StaScanData* hidl_scan_data) { + const legacy_hal::wifi_cached_scan_results& legacy_cached_scan_result, + StaScanData* hidl_scan_data) { if (!hidl_scan_data) { return false; } @@ -763,8 +716,7 @@ bool convertLegacyCachedGscanResultsToHidl( hidl_scan_data->flags = 0; for (const auto flag : {legacy_hal::WIFI_SCAN_FLAG_INTERRUPTED}) { if (legacy_cached_scan_result.flags & flag) { - hidl_scan_data->flags |= - static_cast::type>( + hidl_scan_data->flags |= static_cast::type>( convertLegacyGscanDataFlagToHidl(flag)); } } @@ -773,12 +725,10 @@ bool convertLegacyCachedGscanResultsToHidl( CHECK(legacy_cached_scan_result.num_results >= 0 && legacy_cached_scan_result.num_results <= MAX_AP_CACHE_PER_SCAN); std::vector hidl_scan_results; - for (int32_t result_idx = 0; - result_idx < legacy_cached_scan_result.num_results; result_idx++) { + for (int32_t result_idx = 0; result_idx < legacy_cached_scan_result.num_results; result_idx++) { StaScanResult hidl_scan_result; - if (!convertLegacyGscanResultToHidl( - legacy_cached_scan_result.results[result_idx], false, - &hidl_scan_result)) { + if (!convertLegacyGscanResultToHidl(legacy_cached_scan_result.results[result_idx], false, + &hidl_scan_result)) { return false; } hidl_scan_results.push_back(hidl_scan_result); @@ -788,17 +738,15 @@ bool convertLegacyCachedGscanResultsToHidl( } bool convertLegacyVectorOfCachedGscanResultsToHidl( - const std::vector& - legacy_cached_scan_results, - std::vector* hidl_scan_datas) { + const std::vector& legacy_cached_scan_results, + std::vector* hidl_scan_datas) { if (!hidl_scan_datas) { return false; } *hidl_scan_datas = {}; for (const auto& legacy_cached_scan_result : legacy_cached_scan_results) { StaScanData hidl_scan_data; - if (!convertLegacyCachedGscanResultsToHidl(legacy_cached_scan_result, - &hidl_scan_data)) { + if (!convertLegacyCachedGscanResultsToHidl(legacy_cached_scan_result, &hidl_scan_data)) { return false; } hidl_scan_datas->push_back(hidl_scan_data); @@ -806,8 +754,7 @@ bool convertLegacyVectorOfCachedGscanResultsToHidl( return true; } -WifiDebugTxPacketFate convertLegacyDebugTxPacketFateToHidl( - legacy_hal::wifi_tx_packet_fate fate) { +WifiDebugTxPacketFate convertLegacyDebugTxPacketFateToHidl(legacy_hal::wifi_tx_packet_fate fate) { switch (fate) { case legacy_hal::TX_PKT_FATE_ACKED: return WifiDebugTxPacketFate::ACKED; @@ -833,8 +780,7 @@ WifiDebugTxPacketFate convertLegacyDebugTxPacketFateToHidl( CHECK(false) << "Unknown legacy fate type: " << fate; } -WifiDebugRxPacketFate convertLegacyDebugRxPacketFateToHidl( - legacy_hal::wifi_rx_packet_fate fate) { +WifiDebugRxPacketFate convertLegacyDebugRxPacketFateToHidl(legacy_hal::wifi_rx_packet_fate fate) { switch (fate) { case legacy_hal::RX_PKT_FATE_SUCCESS: return WifiDebugRxPacketFate::SUCCESS; @@ -863,7 +809,7 @@ WifiDebugRxPacketFate convertLegacyDebugRxPacketFateToHidl( } WifiDebugPacketFateFrameType convertLegacyDebugPacketFateFrameTypeToHidl( - legacy_hal::frame_type type) { + legacy_hal::frame_type type) { switch (type) { case legacy_hal::FRAME_TYPE_UNKNOWN: return WifiDebugPacketFateFrameType::UNKNOWN; @@ -875,40 +821,36 @@ WifiDebugPacketFateFrameType convertLegacyDebugPacketFateFrameTypeToHidl( CHECK(false) << "Unknown legacy frame type: " << type; } -bool convertLegacyDebugPacketFateFrameToHidl( - const legacy_hal::frame_info& legacy_frame, - WifiDebugPacketFateFrameInfo* hidl_frame) { +bool convertLegacyDebugPacketFateFrameToHidl(const legacy_hal::frame_info& legacy_frame, + WifiDebugPacketFateFrameInfo* hidl_frame) { if (!hidl_frame) { return false; } *hidl_frame = {}; - hidl_frame->frameType = - convertLegacyDebugPacketFateFrameTypeToHidl(legacy_frame.payload_type); + hidl_frame->frameType = convertLegacyDebugPacketFateFrameTypeToHidl(legacy_frame.payload_type); hidl_frame->frameLen = legacy_frame.frame_len; hidl_frame->driverTimestampUsec = legacy_frame.driver_timestamp_usec; hidl_frame->firmwareTimestampUsec = legacy_frame.firmware_timestamp_usec; - const uint8_t* frame_begin = reinterpret_cast( - legacy_frame.frame_content.ethernet_ii_bytes); + const uint8_t* frame_begin = + reinterpret_cast(legacy_frame.frame_content.ethernet_ii_bytes); hidl_frame->frameContent = - std::vector(frame_begin, frame_begin + legacy_frame.frame_len); + std::vector(frame_begin, frame_begin + legacy_frame.frame_len); return true; } -bool convertLegacyDebugTxPacketFateToHidl( - const legacy_hal::wifi_tx_report& legacy_fate, - WifiDebugTxPacketFateReport* hidl_fate) { +bool convertLegacyDebugTxPacketFateToHidl(const legacy_hal::wifi_tx_report& legacy_fate, + WifiDebugTxPacketFateReport* hidl_fate) { if (!hidl_fate) { return false; } *hidl_fate = {}; hidl_fate->fate = convertLegacyDebugTxPacketFateToHidl(legacy_fate.fate); - return convertLegacyDebugPacketFateFrameToHidl(legacy_fate.frame_inf, - &hidl_fate->frameInfo); + return convertLegacyDebugPacketFateFrameToHidl(legacy_fate.frame_inf, &hidl_fate->frameInfo); } bool convertLegacyVectorOfDebugTxPacketFateToHidl( - const std::vector& legacy_fates, - std::vector* hidl_fates) { + const std::vector& legacy_fates, + std::vector* hidl_fates) { if (!hidl_fates) { return false; } @@ -923,21 +865,19 @@ bool convertLegacyVectorOfDebugTxPacketFateToHidl( return true; } -bool convertLegacyDebugRxPacketFateToHidl( - const legacy_hal::wifi_rx_report& legacy_fate, - WifiDebugRxPacketFateReport* hidl_fate) { +bool convertLegacyDebugRxPacketFateToHidl(const legacy_hal::wifi_rx_report& legacy_fate, + WifiDebugRxPacketFateReport* hidl_fate) { if (!hidl_fate) { return false; } *hidl_fate = {}; hidl_fate->fate = convertLegacyDebugRxPacketFateToHidl(legacy_fate.fate); - return convertLegacyDebugPacketFateFrameToHidl(legacy_fate.frame_inf, - &hidl_fate->frameInfo); + return convertLegacyDebugPacketFateFrameToHidl(legacy_fate.frame_inf, &hidl_fate->frameInfo); } bool convertLegacyVectorOfDebugRxPacketFateToHidl( - const std::vector& legacy_fates, - std::vector* hidl_fates) { + const std::vector& legacy_fates, + std::vector* hidl_fates) { if (!hidl_fates) { return false; } @@ -953,8 +893,8 @@ bool convertLegacyVectorOfDebugRxPacketFateToHidl( } bool convertLegacyLinkLayerRadioStatsToHidl( - const legacy_hal::LinkLayerRadioStats& legacy_radio_stat, - V1_5::StaLinkLayerRadioStats* hidl_radio_stat) { + const legacy_hal::LinkLayerRadioStats& legacy_radio_stat, + V1_5::StaLinkLayerRadioStats* hidl_radio_stat) { if (!hidl_radio_stat) { return false; } @@ -964,20 +904,13 @@ bool convertLegacyLinkLayerRadioStatsToHidl( hidl_radio_stat->V1_3.V1_0.onTimeInMs = legacy_radio_stat.stats.on_time; hidl_radio_stat->V1_3.V1_0.txTimeInMs = legacy_radio_stat.stats.tx_time; hidl_radio_stat->V1_3.V1_0.rxTimeInMs = legacy_radio_stat.stats.rx_time; - hidl_radio_stat->V1_3.V1_0.onTimeInMsForScan = - legacy_radio_stat.stats.on_time_scan; - hidl_radio_stat->V1_3.V1_0.txTimeInMsPerLevel = - legacy_radio_stat.tx_time_per_levels; - hidl_radio_stat->V1_3.onTimeInMsForNanScan = - legacy_radio_stat.stats.on_time_nbd; - hidl_radio_stat->V1_3.onTimeInMsForBgScan = - legacy_radio_stat.stats.on_time_gscan; - hidl_radio_stat->V1_3.onTimeInMsForRoamScan = - legacy_radio_stat.stats.on_time_roam_scan; - hidl_radio_stat->V1_3.onTimeInMsForPnoScan = - legacy_radio_stat.stats.on_time_pno_scan; - hidl_radio_stat->V1_3.onTimeInMsForHs20Scan = - legacy_radio_stat.stats.on_time_hs20; + hidl_radio_stat->V1_3.V1_0.onTimeInMsForScan = legacy_radio_stat.stats.on_time_scan; + hidl_radio_stat->V1_3.V1_0.txTimeInMsPerLevel = legacy_radio_stat.tx_time_per_levels; + hidl_radio_stat->V1_3.onTimeInMsForNanScan = legacy_radio_stat.stats.on_time_nbd; + hidl_radio_stat->V1_3.onTimeInMsForBgScan = legacy_radio_stat.stats.on_time_gscan; + hidl_radio_stat->V1_3.onTimeInMsForRoamScan = legacy_radio_stat.stats.on_time_roam_scan; + hidl_radio_stat->V1_3.onTimeInMsForPnoScan = legacy_radio_stat.stats.on_time_pno_scan; + hidl_radio_stat->V1_3.onTimeInMsForHs20Scan = legacy_radio_stat.stats.on_time_hs20; std::vector hidl_channel_stats; @@ -991,10 +924,8 @@ bool convertLegacyLinkLayerRadioStatsToHidl( */ hidl_channel_stat.channel.width = WifiChannelWidthInMhz::WIDTH_20; hidl_channel_stat.channel.centerFreq = channel_stat.channel.center_freq; - hidl_channel_stat.channel.centerFreq0 = - channel_stat.channel.center_freq0; - hidl_channel_stat.channel.centerFreq1 = - channel_stat.channel.center_freq1; + hidl_channel_stat.channel.centerFreq0 = channel_stat.channel.center_freq0; + hidl_channel_stat.channel.centerFreq1 = channel_stat.channel.center_freq1; hidl_channel_stats.push_back(hidl_channel_stat); } @@ -1003,9 +934,8 @@ bool convertLegacyLinkLayerRadioStatsToHidl( return true; } -bool convertLegacyLinkLayerStatsToHidl( - const legacy_hal::LinkLayerStats& legacy_stats, - StaLinkLayerStats* hidl_stats) { +bool convertLegacyLinkLayerStatsToHidl(const legacy_hal::LinkLayerStats& legacy_stats, + V1_5::StaLinkLayerStats* hidl_stats) { if (!hidl_stats) { return false; } @@ -1014,77 +944,76 @@ bool convertLegacyLinkLayerStatsToHidl( hidl_stats->iface.V1_0.beaconRx = legacy_stats.iface.beacon_rx; hidl_stats->iface.V1_0.avgRssiMgmt = legacy_stats.iface.rssi_mgmt; hidl_stats->iface.V1_0.wmeBePktStats.rxMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].rx_mpdu; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].rx_mpdu; hidl_stats->iface.V1_0.wmeBePktStats.txMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].tx_mpdu; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].tx_mpdu; hidl_stats->iface.V1_0.wmeBePktStats.lostMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].mpdu_lost; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].mpdu_lost; hidl_stats->iface.V1_0.wmeBePktStats.retries = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].retries; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].retries; hidl_stats->iface.wmeBeContentionTimeStats.contentionTimeMinInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_min; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_min; hidl_stats->iface.wmeBeContentionTimeStats.contentionTimeMaxInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_max; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_max; hidl_stats->iface.wmeBeContentionTimeStats.contentionTimeAvgInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_avg; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_avg; hidl_stats->iface.wmeBeContentionTimeStats.contentionNumSamples = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_num_samples; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_num_samples; hidl_stats->iface.V1_0.wmeBkPktStats.rxMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].rx_mpdu; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].rx_mpdu; hidl_stats->iface.V1_0.wmeBkPktStats.txMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].tx_mpdu; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].tx_mpdu; hidl_stats->iface.V1_0.wmeBkPktStats.lostMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].mpdu_lost; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].mpdu_lost; hidl_stats->iface.V1_0.wmeBkPktStats.retries = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].retries; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].retries; hidl_stats->iface.wmeBkContentionTimeStats.contentionTimeMinInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_min; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_min; hidl_stats->iface.wmeBkContentionTimeStats.contentionTimeMaxInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_max; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_max; hidl_stats->iface.wmeBkContentionTimeStats.contentionTimeAvgInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_avg; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_avg; hidl_stats->iface.wmeBkContentionTimeStats.contentionNumSamples = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_num_samples; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_num_samples; hidl_stats->iface.V1_0.wmeViPktStats.rxMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].rx_mpdu; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].rx_mpdu; hidl_stats->iface.V1_0.wmeViPktStats.txMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].tx_mpdu; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].tx_mpdu; hidl_stats->iface.V1_0.wmeViPktStats.lostMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].mpdu_lost; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].mpdu_lost; hidl_stats->iface.V1_0.wmeViPktStats.retries = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].retries; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].retries; hidl_stats->iface.wmeViContentionTimeStats.contentionTimeMinInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_min; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_min; hidl_stats->iface.wmeViContentionTimeStats.contentionTimeMaxInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_max; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_max; hidl_stats->iface.wmeViContentionTimeStats.contentionTimeAvgInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_avg; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_avg; hidl_stats->iface.wmeViContentionTimeStats.contentionNumSamples = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_num_samples; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_num_samples; hidl_stats->iface.V1_0.wmeVoPktStats.rxMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].rx_mpdu; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].rx_mpdu; hidl_stats->iface.V1_0.wmeVoPktStats.txMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].tx_mpdu; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].tx_mpdu; hidl_stats->iface.V1_0.wmeVoPktStats.lostMpdu = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].mpdu_lost; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].mpdu_lost; hidl_stats->iface.V1_0.wmeVoPktStats.retries = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].retries; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].retries; hidl_stats->iface.wmeVoContentionTimeStats.contentionTimeMinInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_min; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_min; hidl_stats->iface.wmeVoContentionTimeStats.contentionTimeMaxInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_max; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_max; hidl_stats->iface.wmeVoContentionTimeStats.contentionTimeAvgInUsec = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_avg; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_avg; hidl_stats->iface.wmeVoContentionTimeStats.contentionNumSamples = - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_num_samples; + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_num_samples; hidl_stats->iface.timeSliceDutyCycleInPercent = - legacy_stats.iface.info.time_slicing_duty_cycle_percent; + legacy_stats.iface.info.time_slicing_duty_cycle_percent; // peer info legacy_stats conversion. - std::vector hidl_peers_info_stats; + std::vector hidl_peers_info_stats; for (const auto& legacy_peer_info_stats : legacy_stats.peers) { - StaPeerInfo hidl_peer_info_stats; - if (!convertLegacyPeerInfoStatsToHidl(legacy_peer_info_stats, - &hidl_peer_info_stats)) { + V1_5::StaPeerInfo hidl_peer_info_stats; + if (!convertLegacyPeerInfoStatsToHidl(legacy_peer_info_stats, &hidl_peer_info_stats)) { return false; } hidl_peers_info_stats.push_back(hidl_peer_info_stats); @@ -1094,8 +1023,7 @@ bool convertLegacyLinkLayerStatsToHidl( std::vector hidl_radios_stats; for (const auto& legacy_radio_stats : legacy_stats.radios) { V1_5::StaLinkLayerRadioStats hidl_radio_stats; - if (!convertLegacyLinkLayerRadioStatsToHidl(legacy_radio_stats, - &hidl_radio_stats)) { + if (!convertLegacyLinkLayerRadioStatsToHidl(legacy_radio_stats, &hidl_radio_stats)) { return false; } hidl_radios_stats.push_back(hidl_radio_stats); @@ -1107,23 +1035,19 @@ bool convertLegacyLinkLayerStatsToHidl( return true; } -bool convertLegacyPeerInfoStatsToHidl( - const legacy_hal::WifiPeerInfo& legacy_peer_info_stats, - StaPeerInfo* hidl_peer_info_stats) { +bool convertLegacyPeerInfoStatsToHidl(const legacy_hal::WifiPeerInfo& legacy_peer_info_stats, + V1_5::StaPeerInfo* hidl_peer_info_stats) { if (!hidl_peer_info_stats) { return false; } *hidl_peer_info_stats = {}; - hidl_peer_info_stats->staCount = - legacy_peer_info_stats.peer_info.bssload.sta_count; - hidl_peer_info_stats->chanUtil = - legacy_peer_info_stats.peer_info.bssload.chan_util; + hidl_peer_info_stats->staCount = legacy_peer_info_stats.peer_info.bssload.sta_count; + hidl_peer_info_stats->chanUtil = legacy_peer_info_stats.peer_info.bssload.chan_util; - std::vector hidlRateStats; + std::vector hidlRateStats; for (const auto& legacy_rate_stats : legacy_peer_info_stats.rate_stats) { - StaRateStat rateStat; - if (!convertLegacyWifiRateInfoToHidl(legacy_rate_stats.rate, - &rateStat.rateInfo)) { + V1_5::StaRateStat rateStat; + if (!convertLegacyWifiRateInfoToHidl(legacy_rate_stats.rate, &rateStat.rateInfo)) { return false; } rateStat.txMpdu = legacy_rate_stats.tx_mpdu; @@ -1137,8 +1061,8 @@ bool convertLegacyPeerInfoStatsToHidl( } bool convertLegacyRoamingCapabilitiesToHidl( - const legacy_hal::wifi_roaming_capabilities& legacy_caps, - StaRoamingCapabilities* hidl_caps) { + const legacy_hal::wifi_roaming_capabilities& legacy_caps, + StaRoamingCapabilities* hidl_caps) { if (!hidl_caps) { return false; } @@ -1148,9 +1072,8 @@ bool convertLegacyRoamingCapabilitiesToHidl( return true; } -bool convertHidlRoamingConfigToLegacy( - const StaRoamingConfig& hidl_config, - legacy_hal::wifi_roaming_config* legacy_config) { +bool convertHidlRoamingConfigToLegacy(const StaRoamingConfig& hidl_config, + legacy_hal::wifi_roaming_config* legacy_config) { if (!legacy_config) { return false; } @@ -1170,15 +1093,13 @@ bool convertHidlRoamingConfigToLegacy( for (const auto& ssid : hidl_config.ssidWhitelist) { CHECK(ssid.size() <= sizeof(legacy_hal::ssid_t::ssid_str)); legacy_config->whitelist_ssid[i].length = ssid.size(); - memcpy(legacy_config->whitelist_ssid[i].ssid_str, ssid.data(), - ssid.size()); + memcpy(legacy_config->whitelist_ssid[i].ssid_str, ssid.data(), ssid.size()); i++; } return true; } -legacy_hal::fw_roaming_state_t convertHidlRoamingStateToLegacy( - StaRoamingState state) { +legacy_hal::fw_roaming_state_t convertHidlRoamingStateToLegacy(StaRoamingState state) { switch (state) { case StaRoamingState::ENABLED: return legacy_hal::ROAMING_ENABLE; @@ -1200,8 +1121,7 @@ legacy_hal::NanMatchAlg convertHidlNanMatchAlgToLegacy(NanMatchAlg type) { CHECK(false); } -legacy_hal::NanPublishType convertHidlNanPublishTypeToLegacy( - NanPublishType type) { +legacy_hal::NanPublishType convertHidlNanPublishTypeToLegacy(NanPublishType type) { switch (type) { case NanPublishType::UNSOLICITED: return legacy_hal::NAN_PUBLISH_TYPE_UNSOLICITED; @@ -1223,8 +1143,7 @@ legacy_hal::NanTxType convertHidlNanTxTypeToLegacy(NanTxType type) { CHECK(false); } -legacy_hal::NanSubscribeType convertHidlNanSubscribeTypeToLegacy( - NanSubscribeType type) { +legacy_hal::NanSubscribeType convertHidlNanSubscribeTypeToLegacy(NanSubscribeType type) { switch (type) { case NanSubscribeType::PASSIVE: return legacy_hal::NAN_SUBSCRIBE_TYPE_PASSIVE; @@ -1245,7 +1164,7 @@ legacy_hal::NanSRFType convertHidlNanSrfTypeToLegacy(NanSrfType type) { } legacy_hal::NanDataPathChannelCfg convertHidlNanDataPathChannelCfgToLegacy( - NanDataPathChannelCfg type) { + NanDataPathChannelCfg type) { switch (type) { case NanDataPathChannelCfg::CHANNEL_NOT_REQUESTED: return legacy_hal::NAN_DP_CHANNEL_NOT_REQUESTED; @@ -1289,39 +1208,36 @@ NanStatusType convertLegacyNanStatusTypeToHidl(legacy_hal::NanStatusType type) { CHECK(false); } -void convertToWifiNanStatus(legacy_hal::NanStatusType type, const char* str, - size_t max_len, WifiNanStatus* wifiNanStatus) { +void convertToWifiNanStatus(legacy_hal::NanStatusType type, const char* str, size_t max_len, + WifiNanStatus* wifiNanStatus) { wifiNanStatus->status = convertLegacyNanStatusTypeToHidl(type); wifiNanStatus->description = safeConvertChar(str, max_len); } -bool convertHidlNanEnableRequestToLegacy( - const V1_4::NanEnableRequest& hidl_request, - legacy_hal::NanEnableRequest* legacy_request) { +bool convertHidlNanEnableRequestToLegacy(const V1_4::NanEnableRequest& hidl_request, + legacy_hal::NanEnableRequest* legacy_request) { if (!legacy_request) { - LOG(ERROR) - << "convertHidlNanEnableRequestToLegacy: null legacy_request"; + LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: null legacy_request"; return false; } *legacy_request = {}; legacy_request->config_2dot4g_support = 1; legacy_request->support_2dot4g_val = - hidl_request.operateInBand[(size_t)NanBandIndex::NAN_BAND_24GHZ]; + hidl_request.operateInBand[(size_t)NanBandIndex::NAN_BAND_24GHZ]; legacy_request->config_support_5g = 1; legacy_request->support_5g_val = - hidl_request.operateInBand[(size_t)NanBandIndex::NAN_BAND_5GHZ]; + hidl_request.operateInBand[(size_t)NanBandIndex::NAN_BAND_5GHZ]; legacy_request->config_hop_count_limit = 1; legacy_request->hop_count_limit_val = hidl_request.hopCountMax; legacy_request->master_pref = hidl_request.configParams.masterPref; legacy_request->discovery_indication_cfg = 0; legacy_request->discovery_indication_cfg |= - hidl_request.configParams.disableDiscoveryAddressChangeIndication ? 0x1 - : 0x0; + hidl_request.configParams.disableDiscoveryAddressChangeIndication ? 0x1 : 0x0; legacy_request->discovery_indication_cfg |= - hidl_request.configParams.disableStartedClusterIndication ? 0x2 : 0x0; + hidl_request.configParams.disableStartedClusterIndication ? 0x2 : 0x0; legacy_request->discovery_indication_cfg |= - hidl_request.configParams.disableJoinedClusterIndication ? 0x4 : 0x0; + hidl_request.configParams.disableJoinedClusterIndication ? 0x4 : 0x0; legacy_request->config_sid_beacon = 1; if (hidl_request.configParams.numberOfPublishServiceIdsInBeacon > 127) { LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: " @@ -1329,9 +1245,8 @@ bool convertHidlNanEnableRequestToLegacy( return false; } legacy_request->sid_beacon_val = - (hidl_request.configParams.includePublishServiceIdsInBeacon ? 0x1 - : 0x0) | - (hidl_request.configParams.numberOfPublishServiceIdsInBeacon << 1); + (hidl_request.configParams.includePublishServiceIdsInBeacon ? 0x1 : 0x0) | + (hidl_request.configParams.numberOfPublishServiceIdsInBeacon << 1); legacy_request->config_subscribe_sid_beacon = 1; if (hidl_request.configParams.numberOfSubscribeServiceIdsInBeacon > 127) { LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: " @@ -1339,15 +1254,13 @@ bool convertHidlNanEnableRequestToLegacy( return false; } legacy_request->subscribe_sid_beacon_val = - (hidl_request.configParams.includeSubscribeServiceIdsInBeacon ? 0x1 - : 0x0) | - (hidl_request.configParams.numberOfSubscribeServiceIdsInBeacon << 1); + (hidl_request.configParams.includeSubscribeServiceIdsInBeacon ? 0x1 : 0x0) | + (hidl_request.configParams.numberOfSubscribeServiceIdsInBeacon << 1); legacy_request->config_rssi_window_size = 1; - legacy_request->rssi_window_size_val = - hidl_request.configParams.rssiWindowSize; + legacy_request->rssi_window_size_val = hidl_request.configParams.rssiWindowSize; legacy_request->config_disc_mac_addr_randomization = 1; legacy_request->disc_mac_addr_rand_interval_sec = - hidl_request.configParams.macAddressRandomizationIntervalSec; + hidl_request.configParams.macAddressRandomizationIntervalSec; legacy_request->config_2dot4g_rssi_close = 1; if (hidl_request.configParams.bandSpecificConfig.size() != 3) { LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: " @@ -1355,134 +1268,93 @@ bool convertHidlNanEnableRequestToLegacy( return false; } legacy_request->rssi_close_2dot4g_val = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .rssiClose; + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .rssiClose; legacy_request->config_2dot4g_rssi_middle = 1; legacy_request->rssi_middle_2dot4g_val = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .rssiMiddle; + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .rssiMiddle; legacy_request->config_2dot4g_rssi_proximity = 1; legacy_request->rssi_proximity_2dot4g_val = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .rssiCloseProximity; + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .rssiCloseProximity; legacy_request->config_scan_params = 1; - legacy_request->scan_params_val - .dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .dwellTimeMs; - legacy_request->scan_params_val - .scan_period[legacy_hal::NAN_CHANNEL_24G_BAND] = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .scanPeriodSec; + legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] = + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .dwellTimeMs; + legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_24G_BAND] = + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .scanPeriodSec; legacy_request->config_dw.config_2dot4g_dw_band = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .validDiscoveryWindowIntervalVal; + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .validDiscoveryWindowIntervalVal; legacy_request->config_dw.dw_2dot4g_interval_val = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .discoveryWindowIntervalVal; + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .discoveryWindowIntervalVal; legacy_request->config_5g_rssi_close = 1; legacy_request->rssi_close_5g_val = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .rssiClose; + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .rssiClose; legacy_request->config_5g_rssi_middle = 1; legacy_request->rssi_middle_5g_val = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .rssiMiddle; + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .rssiMiddle; legacy_request->config_5g_rssi_close_proximity = 1; legacy_request->rssi_close_proximity_5g_val = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .rssiCloseProximity; - legacy_request->scan_params_val - .dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .dwellTimeMs; - legacy_request->scan_params_val - .scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .scanPeriodSec; - legacy_request->scan_params_val - .dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .dwellTimeMs; - legacy_request->scan_params_val - .scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .scanPeriodSec; + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .rssiCloseProximity; + legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .dwellTimeMs; + legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .scanPeriodSec; + legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .dwellTimeMs; + legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .scanPeriodSec; legacy_request->config_dw.config_5g_dw_band = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .validDiscoveryWindowIntervalVal; + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .validDiscoveryWindowIntervalVal; legacy_request->config_dw.dw_5g_interval_val = - hidl_request.configParams - .bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .discoveryWindowIntervalVal; + hidl_request.configParams.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .discoveryWindowIntervalVal; if (hidl_request.debugConfigs.validClusterIdVals) { - legacy_request->cluster_low = - hidl_request.debugConfigs.clusterIdBottomRangeVal; - legacy_request->cluster_high = - hidl_request.debugConfigs.clusterIdTopRangeVal; + legacy_request->cluster_low = hidl_request.debugConfigs.clusterIdBottomRangeVal; + legacy_request->cluster_high = hidl_request.debugConfigs.clusterIdTopRangeVal; } else { // need 'else' since not configurable in legacy HAL legacy_request->cluster_low = 0x0000; legacy_request->cluster_high = 0xFFFF; } - legacy_request->config_intf_addr = - hidl_request.debugConfigs.validIntfAddrVal; - memcpy(legacy_request->intf_addr_val, - hidl_request.debugConfigs.intfAddrVal.data(), 6); + legacy_request->config_intf_addr = hidl_request.debugConfigs.validIntfAddrVal; + memcpy(legacy_request->intf_addr_val, hidl_request.debugConfigs.intfAddrVal.data(), 6); legacy_request->config_oui = hidl_request.debugConfigs.validOuiVal; legacy_request->oui_val = hidl_request.debugConfigs.ouiVal; legacy_request->config_random_factor_force = - hidl_request.debugConfigs.validRandomFactorForceVal; - legacy_request->random_factor_force_val = - hidl_request.debugConfigs.randomFactorForceVal; - legacy_request->config_hop_count_force = - hidl_request.debugConfigs.validHopCountForceVal; - legacy_request->hop_count_force_val = - hidl_request.debugConfigs.hopCountForceVal; - legacy_request->config_24g_channel = - hidl_request.debugConfigs.validDiscoveryChannelVal; + hidl_request.debugConfigs.validRandomFactorForceVal; + legacy_request->random_factor_force_val = hidl_request.debugConfigs.randomFactorForceVal; + legacy_request->config_hop_count_force = hidl_request.debugConfigs.validHopCountForceVal; + legacy_request->hop_count_force_val = hidl_request.debugConfigs.hopCountForceVal; + legacy_request->config_24g_channel = hidl_request.debugConfigs.validDiscoveryChannelVal; legacy_request->channel_24g_val = - hidl_request.debugConfigs - .discoveryChannelMhzVal[(size_t)NanBandIndex::NAN_BAND_24GHZ]; - legacy_request->config_5g_channel = - hidl_request.debugConfigs.validDiscoveryChannelVal; + hidl_request.debugConfigs.discoveryChannelMhzVal[(size_t)NanBandIndex::NAN_BAND_24GHZ]; + legacy_request->config_5g_channel = hidl_request.debugConfigs.validDiscoveryChannelVal; legacy_request->channel_5g_val = - hidl_request.debugConfigs - .discoveryChannelMhzVal[(size_t)NanBandIndex::NAN_BAND_5GHZ]; - legacy_request->config_2dot4g_beacons = - hidl_request.debugConfigs.validUseBeaconsInBandVal; + hidl_request.debugConfigs.discoveryChannelMhzVal[(size_t)NanBandIndex::NAN_BAND_5GHZ]; + legacy_request->config_2dot4g_beacons = hidl_request.debugConfigs.validUseBeaconsInBandVal; legacy_request->beacon_2dot4g_val = - hidl_request.debugConfigs - .useBeaconsInBandVal[(size_t)NanBandIndex::NAN_BAND_24GHZ]; - legacy_request->config_5g_beacons = - hidl_request.debugConfigs.validUseBeaconsInBandVal; + hidl_request.debugConfigs.useBeaconsInBandVal[(size_t)NanBandIndex::NAN_BAND_24GHZ]; + legacy_request->config_5g_beacons = hidl_request.debugConfigs.validUseBeaconsInBandVal; legacy_request->beacon_5g_val = - hidl_request.debugConfigs - .useBeaconsInBandVal[(size_t)NanBandIndex::NAN_BAND_5GHZ]; - legacy_request->config_2dot4g_sdf = - hidl_request.debugConfigs.validUseSdfInBandVal; + hidl_request.debugConfigs.useBeaconsInBandVal[(size_t)NanBandIndex::NAN_BAND_5GHZ]; + legacy_request->config_2dot4g_sdf = hidl_request.debugConfigs.validUseSdfInBandVal; legacy_request->sdf_2dot4g_val = - hidl_request.debugConfigs - .useSdfInBandVal[(size_t)NanBandIndex::NAN_BAND_24GHZ]; - legacy_request->config_5g_sdf = - hidl_request.debugConfigs.validUseSdfInBandVal; + hidl_request.debugConfigs.useSdfInBandVal[(size_t)NanBandIndex::NAN_BAND_24GHZ]; + legacy_request->config_5g_sdf = hidl_request.debugConfigs.validUseSdfInBandVal; legacy_request->sdf_5g_val = - hidl_request.debugConfigs - .useSdfInBandVal[(size_t)NanBandIndex::NAN_BAND_5GHZ]; + hidl_request.debugConfigs.useSdfInBandVal[(size_t)NanBandIndex::NAN_BAND_5GHZ]; /* TODO: b/145609058 * Missing updates needed to legacy_hal::NanEnableRequest and conversion to @@ -1491,13 +1363,11 @@ bool convertHidlNanEnableRequestToLegacy( return true; } -bool convertHidlNanEnableRequest_1_4ToLegacy( - const V1_4::NanEnableRequest& hidl_request1, - const NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanEnableRequest* legacy_request) { +bool convertHidlNanEnableRequest_1_4ToLegacy(const V1_4::NanEnableRequest& hidl_request1, + const NanConfigRequestSupplemental& hidl_request2, + legacy_hal::NanEnableRequest* legacy_request) { if (!legacy_request) { - LOG(ERROR) - << "convertHidlNanEnableRequest_1_4ToLegacy: null legacy_request"; + LOG(ERROR) << "convertHidlNanEnableRequest_1_4ToLegacy: null legacy_request"; return false; } @@ -1507,71 +1377,60 @@ bool convertHidlNanEnableRequest_1_4ToLegacy( } legacy_request->config_discovery_beacon_int = 1; - legacy_request->discovery_beacon_interval = - hidl_request2.V1_2.discoveryBeaconIntervalMs; + legacy_request->discovery_beacon_interval = hidl_request2.V1_2.discoveryBeaconIntervalMs; legacy_request->config_nss = 1; legacy_request->nss = hidl_request2.V1_2.numberOfSpatialStreamsInDiscovery; legacy_request->config_dw_early_termination = 1; legacy_request->enable_dw_termination = - hidl_request2.V1_2.enableDiscoveryWindowEarlyTermination; + hidl_request2.V1_2.enableDiscoveryWindowEarlyTermination; legacy_request->config_enable_ranging = 1; legacy_request->enable_ranging = hidl_request2.V1_2.enableRanging; return true; } -bool convertHidlNanEnableRequest_1_5ToLegacy( - const V1_4::NanEnableRequest& hidl_request1, - const NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanEnableRequest* legacy_request) { +bool convertHidlNanEnableRequest_1_5ToLegacy(const V1_4::NanEnableRequest& hidl_request1, + const NanConfigRequestSupplemental& hidl_request2, + legacy_hal::NanEnableRequest* legacy_request) { if (!legacy_request) { - LOG(ERROR) - << "convertHidlNanEnableRequest_1_5ToLegacy: null legacy_request"; + LOG(ERROR) << "convertHidlNanEnableRequest_1_5ToLegacy: null legacy_request"; return false; } *legacy_request = {}; - if (!convertHidlNanEnableRequest_1_4ToLegacy(hidl_request1, hidl_request2, - legacy_request)) { + if (!convertHidlNanEnableRequest_1_4ToLegacy(hidl_request1, hidl_request2, legacy_request)) { return false; } legacy_request->config_enable_instant_mode = 1; - legacy_request->enable_instant_mode = - hidl_request2.enableInstantCommunicationMode; + legacy_request->enable_instant_mode = hidl_request2.enableInstantCommunicationMode; return true; } -bool convertHidlNanConfigRequest_1_5ToLegacy( - const V1_4::NanConfigRequest& hidl_request1, - const NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanConfigRequest* legacy_request) { +bool convertHidlNanConfigRequest_1_5ToLegacy(const V1_4::NanConfigRequest& hidl_request1, + const NanConfigRequestSupplemental& hidl_request2, + legacy_hal::NanConfigRequest* legacy_request) { if (!legacy_request) { - LOG(ERROR) - << "convertHidlNanConfigRequest_1_5ToLegacy: null legacy_request"; + LOG(ERROR) << "convertHidlNanConfigRequest_1_5ToLegacy: null legacy_request"; return false; } *legacy_request = {}; - if (!convertHidlNanConfigRequest_1_4ToLegacy(hidl_request1, hidl_request2, - legacy_request)) { + if (!convertHidlNanConfigRequest_1_4ToLegacy(hidl_request1, hidl_request2, legacy_request)) { return false; } legacy_request->config_enable_instant_mode = 1; - legacy_request->enable_instant_mode = - hidl_request2.enableInstantCommunicationMode; + legacy_request->enable_instant_mode = hidl_request2.enableInstantCommunicationMode; return true; } -bool convertHidlNanPublishRequestToLegacy( - const NanPublishRequest& hidl_request, - legacy_hal::NanPublishRequest* legacy_request) { +bool convertHidlNanPublishRequestToLegacy(const NanPublishRequest& hidl_request, + legacy_hal::NanPublishRequest* legacy_request) { if (!legacy_request) { - LOG(ERROR) - << "convertHidlNanPublishRequestToLegacy: null legacy_request"; + LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: null legacy_request"; return false; } *legacy_request = {}; @@ -1580,22 +1439,18 @@ bool convertHidlNanPublishRequestToLegacy( legacy_request->ttl = hidl_request.baseConfigs.ttlSec; legacy_request->period = hidl_request.baseConfigs.discoveryWindowPeriod; legacy_request->publish_count = hidl_request.baseConfigs.discoveryCount; - legacy_request->service_name_len = - hidl_request.baseConfigs.serviceName.size(); + legacy_request->service_name_len = hidl_request.baseConfigs.serviceName.size(); if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: service_name_len " "too large"; return false; } - memcpy(legacy_request->service_name, - hidl_request.baseConfigs.serviceName.data(), + memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.data(), legacy_request->service_name_len); - legacy_request->publish_match_indicator = convertHidlNanMatchAlgToLegacy( - hidl_request.baseConfigs.discoveryMatchIndicator); - legacy_request->service_specific_info_len = - hidl_request.baseConfigs.serviceSpecificInfo.size(); - if (legacy_request->service_specific_info_len > - NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) { + legacy_request->publish_match_indicator = + convertHidlNanMatchAlgToLegacy(hidl_request.baseConfigs.discoveryMatchIndicator); + legacy_request->service_specific_info_len = hidl_request.baseConfigs.serviceSpecificInfo.size(); + if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) { LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: " "service_specific_info_len too large"; return false; @@ -1604,9 +1459,8 @@ bool convertHidlNanPublishRequestToLegacy( hidl_request.baseConfigs.serviceSpecificInfo.data(), legacy_request->service_specific_info_len); legacy_request->sdea_service_specific_info_len = - hidl_request.baseConfigs.extendedServiceSpecificInfo.size(); - if (legacy_request->sdea_service_specific_info_len > - NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN) { + hidl_request.baseConfigs.extendedServiceSpecificInfo.size(); + if (legacy_request->sdea_service_specific_info_len > NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN) { LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: " "sdea_service_specific_info_len too large"; return false; @@ -1614,49 +1468,38 @@ bool convertHidlNanPublishRequestToLegacy( memcpy(legacy_request->sdea_service_specific_info, hidl_request.baseConfigs.extendedServiceSpecificInfo.data(), legacy_request->sdea_service_specific_info_len); - legacy_request->rx_match_filter_len = - hidl_request.baseConfigs.rxMatchFilter.size(); + legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size(); if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) { LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: " "rx_match_filter_len too large"; return false; } - memcpy(legacy_request->rx_match_filter, - hidl_request.baseConfigs.rxMatchFilter.data(), + memcpy(legacy_request->rx_match_filter, hidl_request.baseConfigs.rxMatchFilter.data(), legacy_request->rx_match_filter_len); - legacy_request->tx_match_filter_len = - hidl_request.baseConfigs.txMatchFilter.size(); + legacy_request->tx_match_filter_len = hidl_request.baseConfigs.txMatchFilter.size(); if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) { LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: " "tx_match_filter_len too large"; return false; } - memcpy(legacy_request->tx_match_filter, - hidl_request.baseConfigs.txMatchFilter.data(), + memcpy(legacy_request->tx_match_filter, hidl_request.baseConfigs.txMatchFilter.data(), legacy_request->tx_match_filter_len); - legacy_request->rssi_threshold_flag = - hidl_request.baseConfigs.useRssiThreshold; + legacy_request->rssi_threshold_flag = hidl_request.baseConfigs.useRssiThreshold; legacy_request->recv_indication_cfg = 0; legacy_request->recv_indication_cfg |= - hidl_request.baseConfigs.disableDiscoveryTerminationIndication ? 0x1 - : 0x0; + hidl_request.baseConfigs.disableDiscoveryTerminationIndication ? 0x1 : 0x0; legacy_request->recv_indication_cfg |= - hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0; + hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0; legacy_request->recv_indication_cfg |= - hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0; + hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0; legacy_request->recv_indication_cfg |= 0x8; - legacy_request->cipher_type = - (unsigned int)hidl_request.baseConfigs.securityConfig.cipherType; - if (hidl_request.baseConfigs.securityConfig.securityType == - NanDataPathSecurityType::PMK) { - legacy_request->key_info.key_type = - legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; + legacy_request->cipher_type = (unsigned int)hidl_request.baseConfigs.securityConfig.cipherType; + if (hidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PMK) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; legacy_request->key_info.body.pmk_info.pmk_len = - hidl_request.baseConfigs.securityConfig.pmk.size(); - if (legacy_request->key_info.body.pmk_info.pmk_len != - NAN_PMK_INFO_LEN) { - LOG(ERROR) - << "convertHidlNanPublishRequestToLegacy: invalid pmk_len"; + hidl_request.baseConfigs.securityConfig.pmk.size(); + if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { + LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: invalid pmk_len"; return false; } memcpy(legacy_request->key_info.body.pmk_info.pmk, @@ -1665,10 +1508,9 @@ bool convertHidlNanPublishRequestToLegacy( } if (hidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) { - legacy_request->key_info.key_type = - legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; legacy_request->key_info.body.passphrase_info.passphrase_len = - hidl_request.baseConfigs.securityConfig.passphrase.size(); + hidl_request.baseConfigs.securityConfig.passphrase.size(); if (legacy_request->key_info.body.passphrase_info.passphrase_len < NAN_SECURITY_MIN_PASSPHRASE_LEN) { LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: " @@ -1686,45 +1528,36 @@ bool convertHidlNanPublishRequestToLegacy( legacy_request->key_info.body.passphrase_info.passphrase_len); } legacy_request->sdea_params.security_cfg = - (hidl_request.baseConfigs.securityConfig.securityType != - NanDataPathSecurityType::OPEN) - ? legacy_hal::NAN_DP_CONFIG_SECURITY - : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; - legacy_request->sdea_params.ranging_state = - hidl_request.baseConfigs.rangingRequired - ? legacy_hal::NAN_RANGING_ENABLE - : legacy_hal::NAN_RANGING_DISABLE; + (hidl_request.baseConfigs.securityConfig.securityType != NanDataPathSecurityType::OPEN) + ? legacy_hal::NAN_DP_CONFIG_SECURITY + : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; + legacy_request->sdea_params.ranging_state = hidl_request.baseConfigs.rangingRequired + ? legacy_hal::NAN_RANGING_ENABLE + : legacy_hal::NAN_RANGING_DISABLE; legacy_request->ranging_cfg.ranging_interval_msec = - hidl_request.baseConfigs.rangingIntervalMsec; + hidl_request.baseConfigs.rangingIntervalMsec; legacy_request->ranging_cfg.config_ranging_indications = - hidl_request.baseConfigs.configRangingIndications; + hidl_request.baseConfigs.configRangingIndications; legacy_request->ranging_cfg.distance_ingress_mm = - hidl_request.baseConfigs.distanceIngressCm * 10; - legacy_request->ranging_cfg.distance_egress_mm = - hidl_request.baseConfigs.distanceEgressCm * 10; - legacy_request->ranging_auto_response = - hidl_request.baseConfigs.rangingRequired - ? legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE - : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE; - legacy_request->sdea_params.range_report = - legacy_hal::NAN_DISABLE_RANGE_REPORT; - legacy_request->publish_type = - convertHidlNanPublishTypeToLegacy(hidl_request.publishType); + hidl_request.baseConfigs.distanceIngressCm * 10; + legacy_request->ranging_cfg.distance_egress_mm = hidl_request.baseConfigs.distanceEgressCm * 10; + legacy_request->ranging_auto_response = hidl_request.baseConfigs.rangingRequired + ? legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE + : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE; + legacy_request->sdea_params.range_report = legacy_hal::NAN_DISABLE_RANGE_REPORT; + legacy_request->publish_type = convertHidlNanPublishTypeToLegacy(hidl_request.publishType); legacy_request->tx_type = convertHidlNanTxTypeToLegacy(hidl_request.txType); - legacy_request->service_responder_policy = - hidl_request.autoAcceptDataPathRequests - ? legacy_hal::NAN_SERVICE_ACCEPT_POLICY_ALL - : legacy_hal::NAN_SERVICE_ACCEPT_POLICY_NONE; + legacy_request->service_responder_policy = hidl_request.autoAcceptDataPathRequests + ? legacy_hal::NAN_SERVICE_ACCEPT_POLICY_ALL + : legacy_hal::NAN_SERVICE_ACCEPT_POLICY_NONE; return true; } -bool convertHidlNanSubscribeRequestToLegacy( - const NanSubscribeRequest& hidl_request, - legacy_hal::NanSubscribeRequest* legacy_request) { +bool convertHidlNanSubscribeRequestToLegacy(const NanSubscribeRequest& hidl_request, + legacy_hal::NanSubscribeRequest* legacy_request) { if (!legacy_request) { - LOG(ERROR) - << "convertHidlNanSubscribeRequestToLegacy: legacy_request is null"; + LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: legacy_request is null"; return false; } *legacy_request = {}; @@ -1733,22 +1566,18 @@ bool convertHidlNanSubscribeRequestToLegacy( legacy_request->ttl = hidl_request.baseConfigs.ttlSec; legacy_request->period = hidl_request.baseConfigs.discoveryWindowPeriod; legacy_request->subscribe_count = hidl_request.baseConfigs.discoveryCount; - legacy_request->service_name_len = - hidl_request.baseConfigs.serviceName.size(); + legacy_request->service_name_len = hidl_request.baseConfigs.serviceName.size(); if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " "service_name_len too large"; return false; } - memcpy(legacy_request->service_name, - hidl_request.baseConfigs.serviceName.data(), + memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.data(), legacy_request->service_name_len); - legacy_request->subscribe_match_indicator = convertHidlNanMatchAlgToLegacy( - hidl_request.baseConfigs.discoveryMatchIndicator); - legacy_request->service_specific_info_len = - hidl_request.baseConfigs.serviceSpecificInfo.size(); - if (legacy_request->service_specific_info_len > - NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) { + legacy_request->subscribe_match_indicator = + convertHidlNanMatchAlgToLegacy(hidl_request.baseConfigs.discoveryMatchIndicator); + legacy_request->service_specific_info_len = hidl_request.baseConfigs.serviceSpecificInfo.size(); + if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) { LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " "service_specific_info_len too large"; return false; @@ -1757,9 +1586,8 @@ bool convertHidlNanSubscribeRequestToLegacy( hidl_request.baseConfigs.serviceSpecificInfo.data(), legacy_request->service_specific_info_len); legacy_request->sdea_service_specific_info_len = - hidl_request.baseConfigs.extendedServiceSpecificInfo.size(); - if (legacy_request->sdea_service_specific_info_len > - NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN) { + hidl_request.baseConfigs.extendedServiceSpecificInfo.size(); + if (legacy_request->sdea_service_specific_info_len > NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN) { LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " "sdea_service_specific_info_len too large"; return false; @@ -1767,48 +1595,37 @@ bool convertHidlNanSubscribeRequestToLegacy( memcpy(legacy_request->sdea_service_specific_info, hidl_request.baseConfigs.extendedServiceSpecificInfo.data(), legacy_request->sdea_service_specific_info_len); - legacy_request->rx_match_filter_len = - hidl_request.baseConfigs.rxMatchFilter.size(); + legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size(); if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) { LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " "rx_match_filter_len too large"; return false; } - memcpy(legacy_request->rx_match_filter, - hidl_request.baseConfigs.rxMatchFilter.data(), + memcpy(legacy_request->rx_match_filter, hidl_request.baseConfigs.rxMatchFilter.data(), legacy_request->rx_match_filter_len); - legacy_request->tx_match_filter_len = - hidl_request.baseConfigs.txMatchFilter.size(); + legacy_request->tx_match_filter_len = hidl_request.baseConfigs.txMatchFilter.size(); if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) { LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " "tx_match_filter_len too large"; return false; } - memcpy(legacy_request->tx_match_filter, - hidl_request.baseConfigs.txMatchFilter.data(), + memcpy(legacy_request->tx_match_filter, hidl_request.baseConfigs.txMatchFilter.data(), legacy_request->tx_match_filter_len); - legacy_request->rssi_threshold_flag = - hidl_request.baseConfigs.useRssiThreshold; + legacy_request->rssi_threshold_flag = hidl_request.baseConfigs.useRssiThreshold; legacy_request->recv_indication_cfg = 0; legacy_request->recv_indication_cfg |= - hidl_request.baseConfigs.disableDiscoveryTerminationIndication ? 0x1 - : 0x0; + hidl_request.baseConfigs.disableDiscoveryTerminationIndication ? 0x1 : 0x0; legacy_request->recv_indication_cfg |= - hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0; + hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0; legacy_request->recv_indication_cfg |= - hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0; - legacy_request->cipher_type = - (unsigned int)hidl_request.baseConfigs.securityConfig.cipherType; - if (hidl_request.baseConfigs.securityConfig.securityType == - NanDataPathSecurityType::PMK) { - legacy_request->key_info.key_type = - legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; + hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0; + legacy_request->cipher_type = (unsigned int)hidl_request.baseConfigs.securityConfig.cipherType; + if (hidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PMK) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; legacy_request->key_info.body.pmk_info.pmk_len = - hidl_request.baseConfigs.securityConfig.pmk.size(); - if (legacy_request->key_info.body.pmk_info.pmk_len != - NAN_PMK_INFO_LEN) { - LOG(ERROR) - << "convertHidlNanSubscribeRequestToLegacy: invalid pmk_len"; + hidl_request.baseConfigs.securityConfig.pmk.size(); + if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { + LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: invalid pmk_len"; return false; } memcpy(legacy_request->key_info.body.pmk_info.pmk, @@ -1817,10 +1634,9 @@ bool convertHidlNanSubscribeRequestToLegacy( } if (hidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) { - legacy_request->key_info.key_type = - legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; legacy_request->key_info.body.passphrase_info.passphrase_len = - hidl_request.baseConfigs.securityConfig.passphrase.size(); + hidl_request.baseConfigs.securityConfig.passphrase.size(); if (legacy_request->key_info.body.passphrase_info.passphrase_len < NAN_SECURITY_MIN_PASSPHRASE_LEN) { LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " @@ -1838,43 +1654,34 @@ bool convertHidlNanSubscribeRequestToLegacy( legacy_request->key_info.body.passphrase_info.passphrase_len); } legacy_request->sdea_params.security_cfg = - (hidl_request.baseConfigs.securityConfig.securityType != - NanDataPathSecurityType::OPEN) - ? legacy_hal::NAN_DP_CONFIG_SECURITY - : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; - legacy_request->sdea_params.ranging_state = - hidl_request.baseConfigs.rangingRequired - ? legacy_hal::NAN_RANGING_ENABLE - : legacy_hal::NAN_RANGING_DISABLE; + (hidl_request.baseConfigs.securityConfig.securityType != NanDataPathSecurityType::OPEN) + ? legacy_hal::NAN_DP_CONFIG_SECURITY + : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; + legacy_request->sdea_params.ranging_state = hidl_request.baseConfigs.rangingRequired + ? legacy_hal::NAN_RANGING_ENABLE + : legacy_hal::NAN_RANGING_DISABLE; legacy_request->ranging_cfg.ranging_interval_msec = - hidl_request.baseConfigs.rangingIntervalMsec; + hidl_request.baseConfigs.rangingIntervalMsec; legacy_request->ranging_cfg.config_ranging_indications = - hidl_request.baseConfigs.configRangingIndications; + hidl_request.baseConfigs.configRangingIndications; legacy_request->ranging_cfg.distance_ingress_mm = - hidl_request.baseConfigs.distanceIngressCm * 10; - legacy_request->ranging_cfg.distance_egress_mm = - hidl_request.baseConfigs.distanceEgressCm * 10; - legacy_request->ranging_auto_response = - hidl_request.baseConfigs.rangingRequired - ? legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE - : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE; - legacy_request->sdea_params.range_report = - legacy_hal::NAN_DISABLE_RANGE_REPORT; + hidl_request.baseConfigs.distanceIngressCm * 10; + legacy_request->ranging_cfg.distance_egress_mm = hidl_request.baseConfigs.distanceEgressCm * 10; + legacy_request->ranging_auto_response = hidl_request.baseConfigs.rangingRequired + ? legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE + : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE; + legacy_request->sdea_params.range_report = legacy_hal::NAN_DISABLE_RANGE_REPORT; legacy_request->subscribe_type = - convertHidlNanSubscribeTypeToLegacy(hidl_request.subscribeType); - legacy_request->serviceResponseFilter = - convertHidlNanSrfTypeToLegacy(hidl_request.srfType); - legacy_request->serviceResponseInclude = - hidl_request.srfRespondIfInAddressSet - ? legacy_hal::NAN_SRF_INCLUDE_RESPOND - : legacy_hal::NAN_SRF_INCLUDE_DO_NOT_RESPOND; + convertHidlNanSubscribeTypeToLegacy(hidl_request.subscribeType); + legacy_request->serviceResponseFilter = convertHidlNanSrfTypeToLegacy(hidl_request.srfType); + legacy_request->serviceResponseInclude = hidl_request.srfRespondIfInAddressSet + ? legacy_hal::NAN_SRF_INCLUDE_RESPOND + : legacy_hal::NAN_SRF_INCLUDE_DO_NOT_RESPOND; legacy_request->useServiceResponseFilter = - hidl_request.shouldUseSrf ? legacy_hal::NAN_USE_SRF - : legacy_hal::NAN_DO_NOT_USE_SRF; + hidl_request.shouldUseSrf ? legacy_hal::NAN_USE_SRF : legacy_hal::NAN_DO_NOT_USE_SRF; legacy_request->ssiRequiredForMatchIndication = - hidl_request.isSsiRequiredForMatch - ? legacy_hal::NAN_SSI_REQUIRED_IN_MATCH_IND - : legacy_hal::NAN_SSI_NOT_REQUIRED_IN_MATCH_IND; + hidl_request.isSsiRequiredForMatch ? legacy_hal::NAN_SSI_REQUIRED_IN_MATCH_IND + : legacy_hal::NAN_SSI_NOT_REQUIRED_IN_MATCH_IND; legacy_request->num_intf_addr_present = hidl_request.intfAddr.size(); if (legacy_request->num_intf_addr_present > NAN_MAX_SUBSCRIBE_MAX_ADDRESS) { LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: " @@ -1882,16 +1689,15 @@ bool convertHidlNanSubscribeRequestToLegacy( return false; } for (int i = 0; i < legacy_request->num_intf_addr_present; i++) { - memcpy(legacy_request->intf_addr[i], hidl_request.intfAddr[i].data(), - 6); + memcpy(legacy_request->intf_addr[i], hidl_request.intfAddr[i].data(), 6); } return true; } bool convertHidlNanTransmitFollowupRequestToLegacy( - const NanTransmitFollowupRequest& hidl_request, - legacy_hal::NanTransmitFollowupRequest* legacy_request) { + const NanTransmitFollowupRequest& hidl_request, + legacy_hal::NanTransmitFollowupRequest* legacy_request) { if (!legacy_request) { LOG(ERROR) << "convertHidlNanTransmitFollowupRequestToLegacy: " "legacy_request is null"; @@ -1902,27 +1708,22 @@ bool convertHidlNanTransmitFollowupRequestToLegacy( legacy_request->publish_subscribe_id = hidl_request.discoverySessionId; legacy_request->requestor_instance_id = hidl_request.peerId; memcpy(legacy_request->addr, hidl_request.addr.data(), 6); - legacy_request->priority = hidl_request.isHighPriority - ? legacy_hal::NAN_TX_PRIORITY_HIGH - : legacy_hal::NAN_TX_PRIORITY_NORMAL; + legacy_request->priority = hidl_request.isHighPriority ? legacy_hal::NAN_TX_PRIORITY_HIGH + : legacy_hal::NAN_TX_PRIORITY_NORMAL; legacy_request->dw_or_faw = hidl_request.shouldUseDiscoveryWindow - ? legacy_hal::NAN_TRANSMIT_IN_DW - : legacy_hal::NAN_TRANSMIT_IN_FAW; - legacy_request->service_specific_info_len = - hidl_request.serviceSpecificInfo.size(); - if (legacy_request->service_specific_info_len > - NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) { + ? legacy_hal::NAN_TRANSMIT_IN_DW + : legacy_hal::NAN_TRANSMIT_IN_FAW; + legacy_request->service_specific_info_len = hidl_request.serviceSpecificInfo.size(); + if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) { LOG(ERROR) << "convertHidlNanTransmitFollowupRequestToLegacy: " "service_specific_info_len too large"; return false; } - memcpy(legacy_request->service_specific_info, - hidl_request.serviceSpecificInfo.data(), + memcpy(legacy_request->service_specific_info, hidl_request.serviceSpecificInfo.data(), legacy_request->service_specific_info_len); legacy_request->sdea_service_specific_info_len = - hidl_request.extendedServiceSpecificInfo.size(); - if (legacy_request->sdea_service_specific_info_len > - NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN) { + hidl_request.extendedServiceSpecificInfo.size(); + if (legacy_request->sdea_service_specific_info_len > NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN) { LOG(ERROR) << "convertHidlNanTransmitFollowupRequestToLegacy: " "sdea_service_specific_info_len too large"; return false; @@ -1930,18 +1731,15 @@ bool convertHidlNanTransmitFollowupRequestToLegacy( memcpy(legacy_request->sdea_service_specific_info, hidl_request.extendedServiceSpecificInfo.data(), legacy_request->sdea_service_specific_info_len); - legacy_request->recv_indication_cfg = - hidl_request.disableFollowupResultIndication ? 0x1 : 0x0; + legacy_request->recv_indication_cfg = hidl_request.disableFollowupResultIndication ? 0x1 : 0x0; return true; } -bool convertHidlNanConfigRequestToLegacy( - const V1_4::NanConfigRequest& hidl_request, - legacy_hal::NanConfigRequest* legacy_request) { +bool convertHidlNanConfigRequestToLegacy(const V1_4::NanConfigRequest& hidl_request, + legacy_hal::NanConfigRequest* legacy_request) { if (!legacy_request) { - LOG(ERROR) - << "convertHidlNanConfigRequestToLegacy: legacy_request is null"; + LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: legacy_request is null"; return false; } *legacy_request = {}; @@ -1951,20 +1749,19 @@ bool convertHidlNanConfigRequestToLegacy( legacy_request->master_pref = hidl_request.masterPref; legacy_request->discovery_indication_cfg = 0; legacy_request->discovery_indication_cfg |= - hidl_request.disableDiscoveryAddressChangeIndication ? 0x1 : 0x0; + hidl_request.disableDiscoveryAddressChangeIndication ? 0x1 : 0x0; legacy_request->discovery_indication_cfg |= - hidl_request.disableStartedClusterIndication ? 0x2 : 0x0; + hidl_request.disableStartedClusterIndication ? 0x2 : 0x0; legacy_request->discovery_indication_cfg |= - hidl_request.disableJoinedClusterIndication ? 0x4 : 0x0; + hidl_request.disableJoinedClusterIndication ? 0x4 : 0x0; legacy_request->config_sid_beacon = 1; if (hidl_request.numberOfPublishServiceIdsInBeacon > 127) { LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: " "numberOfPublishServiceIdsInBeacon > 127"; return false; } - legacy_request->sid_beacon = - (hidl_request.includePublishServiceIdsInBeacon ? 0x1 : 0x0) | - (hidl_request.numberOfPublishServiceIdsInBeacon << 1); + legacy_request->sid_beacon = (hidl_request.includePublishServiceIdsInBeacon ? 0x1 : 0x0) | + (hidl_request.numberOfPublishServiceIdsInBeacon << 1); legacy_request->config_subscribe_sid_beacon = 1; if (hidl_request.numberOfSubscribeServiceIdsInBeacon > 127) { LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: " @@ -1972,13 +1769,13 @@ bool convertHidlNanConfigRequestToLegacy( return false; } legacy_request->subscribe_sid_beacon_val = - (hidl_request.includeSubscribeServiceIdsInBeacon ? 0x1 : 0x0) | - (hidl_request.numberOfSubscribeServiceIdsInBeacon << 1); + (hidl_request.includeSubscribeServiceIdsInBeacon ? 0x1 : 0x0) | + (hidl_request.numberOfSubscribeServiceIdsInBeacon << 1); legacy_request->config_rssi_window_size = 1; legacy_request->rssi_window_size_val = hidl_request.rssiWindowSize; legacy_request->config_disc_mac_addr_randomization = 1; legacy_request->disc_mac_addr_rand_interval_sec = - hidl_request.macAddressRandomizationIntervalSec; + hidl_request.macAddressRandomizationIntervalSec; /* TODO : missing legacy_request->config_2dot4g_rssi_close = 1; legacy_request->rssi_close_2dot4g_val = @@ -1994,20 +1791,16 @@ bool convertHidlNanConfigRequestToLegacy( (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiCloseProximity; */ legacy_request->config_scan_params = 1; - legacy_request->scan_params_val - .dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .dwellTimeMs; - legacy_request->scan_params_val - .scan_period[legacy_hal::NAN_CHANNEL_24G_BAND] = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .scanPeriodSec; + legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] = + hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ].dwellTimeMs; + legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_24G_BAND] = + hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ].scanPeriodSec; legacy_request->config_dw.config_2dot4g_dw_band = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .validDiscoveryWindowIntervalVal; + hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .validDiscoveryWindowIntervalVal; legacy_request->config_dw.dw_2dot4g_interval_val = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] - .discoveryWindowIntervalVal; + hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_24GHZ] + .discoveryWindowIntervalVal; /* TODO: missing legacy_request->config_5g_rssi_close = 1; legacy_request->rssi_close_5g_val = @@ -2020,30 +1813,21 @@ bool convertHidlNanConfigRequestToLegacy( */ legacy_request->config_5g_rssi_close_proximity = 1; legacy_request->rssi_close_proximity_5g_val = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .rssiCloseProximity; - legacy_request->scan_params_val - .dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .dwellTimeMs; - legacy_request->scan_params_val - .scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .scanPeriodSec; - legacy_request->scan_params_val - .dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .dwellTimeMs; - legacy_request->scan_params_val - .scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .scanPeriodSec; + hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ].rssiCloseProximity; + legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = + hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs; + legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] = + hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec; + legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = + hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs; + legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] = + hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec; legacy_request->config_dw.config_5g_dw_band = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .validDiscoveryWindowIntervalVal; + hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .validDiscoveryWindowIntervalVal; legacy_request->config_dw.dw_5g_interval_val = - hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] - .discoveryWindowIntervalVal; + hidl_request.bandSpecificConfig[(size_t)NanBandIndex::NAN_BAND_5GHZ] + .discoveryWindowIntervalVal; /* TODO: b/145609058 * Missing updates needed to legacy_hal::NanConfigRequest and conversion to * it for 6GHz band */ @@ -2051,10 +1835,9 @@ bool convertHidlNanConfigRequestToLegacy( return true; } -bool convertHidlNanConfigRequest_1_4ToLegacy( - const V1_4::NanConfigRequest& hidl_request1, - const NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanConfigRequest* legacy_request) { +bool convertHidlNanConfigRequest_1_4ToLegacy(const V1_4::NanConfigRequest& hidl_request1, + const NanConfigRequestSupplemental& hidl_request2, + legacy_hal::NanConfigRequest* legacy_request) { if (!legacy_request) { LOG(ERROR) << "convertHidlNanConfigRequest_1_4ToLegacy: legacy_request " "is null"; @@ -2067,13 +1850,12 @@ bool convertHidlNanConfigRequest_1_4ToLegacy( } legacy_request->config_discovery_beacon_int = 1; - legacy_request->discovery_beacon_interval = - hidl_request2.V1_2.discoveryBeaconIntervalMs; + legacy_request->discovery_beacon_interval = hidl_request2.V1_2.discoveryBeaconIntervalMs; legacy_request->config_nss = 1; legacy_request->nss = hidl_request2.V1_2.numberOfSpatialStreamsInDiscovery; legacy_request->config_dw_early_termination = 1; legacy_request->enable_dw_termination = - hidl_request2.V1_2.enableDiscoveryWindowEarlyTermination; + hidl_request2.V1_2.enableDiscoveryWindowEarlyTermination; legacy_request->config_enable_ranging = 1; legacy_request->enable_ranging = hidl_request2.V1_2.enableRanging; @@ -2081,8 +1863,8 @@ bool convertHidlNanConfigRequest_1_4ToLegacy( } bool convertHidlNanDataPathInitiatorRequestToLegacy( - const NanInitiateDataPathRequest& hidl_request, - legacy_hal::NanDataPathInitiatorRequest* legacy_request) { + const NanInitiateDataPathRequest& hidl_request, + legacy_hal::NanDataPathInitiatorRequest* legacy_request) { if (!legacy_request) { LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " "legacy_request is null"; @@ -2091,24 +1873,20 @@ bool convertHidlNanDataPathInitiatorRequestToLegacy( *legacy_request = {}; legacy_request->requestor_instance_id = hidl_request.peerId; - memcpy(legacy_request->peer_disc_mac_addr, - hidl_request.peerDiscMacAddr.data(), 6); + memcpy(legacy_request->peer_disc_mac_addr, hidl_request.peerDiscMacAddr.data(), 6); legacy_request->channel_request_type = - convertHidlNanDataPathChannelCfgToLegacy( - hidl_request.channelRequestType); + convertHidlNanDataPathChannelCfgToLegacy(hidl_request.channelRequestType); legacy_request->channel = hidl_request.channel; if (strnlen(hidl_request.ifaceName.c_str(), IFNAMSIZ + 1) == IFNAMSIZ + 1) { LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " "ifaceName too long"; return false; } - strncpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), - IFNAMSIZ + 1); + strncpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); legacy_request->ndp_cfg.security_cfg = - (hidl_request.securityConfig.securityType != - NanDataPathSecurityType::OPEN) - ? legacy_hal::NAN_DP_CONFIG_SECURITY - : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; + (hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN) + ? legacy_hal::NAN_DP_CONFIG_SECURITY + : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size(); if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) { LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " @@ -2117,30 +1895,22 @@ bool convertHidlNanDataPathInitiatorRequestToLegacy( } memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(), legacy_request->app_info.ndp_app_info_len); - legacy_request->cipher_type = - (unsigned int)hidl_request.securityConfig.cipherType; - if (hidl_request.securityConfig.securityType == - NanDataPathSecurityType::PMK) { - legacy_request->key_info.key_type = - legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; - legacy_request->key_info.body.pmk_info.pmk_len = - hidl_request.securityConfig.pmk.size(); - if (legacy_request->key_info.body.pmk_info.pmk_len != - NAN_PMK_INFO_LEN) { + legacy_request->cipher_type = (unsigned int)hidl_request.securityConfig.cipherType; + if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; + legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size(); + if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " "invalid pmk_len"; return false; } - memcpy(legacy_request->key_info.body.pmk_info.pmk, - hidl_request.securityConfig.pmk.data(), + memcpy(legacy_request->key_info.body.pmk_info.pmk, hidl_request.securityConfig.pmk.data(), legacy_request->key_info.body.pmk_info.pmk_len); } - if (hidl_request.securityConfig.securityType == - NanDataPathSecurityType::PASSPHRASE) { - legacy_request->key_info.key_type = - legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; + if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; legacy_request->key_info.body.passphrase_info.passphrase_len = - hidl_request.securityConfig.passphrase.size(); + hidl_request.securityConfig.passphrase.size(); if (legacy_request->key_info.body.passphrase_info.passphrase_len < NAN_SECURITY_MIN_PASSPHRASE_LEN) { LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " @@ -2163,16 +1933,15 @@ bool convertHidlNanDataPathInitiatorRequestToLegacy( "service_name_len too large"; return false; } - memcpy(legacy_request->service_name, - hidl_request.serviceNameOutOfBand.data(), + memcpy(legacy_request->service_name, hidl_request.serviceNameOutOfBand.data(), legacy_request->service_name_len); return true; } bool convertHidlNanDataPathIndicationResponseToLegacy( - const NanRespondToDataPathIndicationRequest& hidl_request, - legacy_hal::NanDataPathIndicationResponse* legacy_request) { + const NanRespondToDataPathIndicationRequest& hidl_request, + legacy_hal::NanDataPathIndicationResponse* legacy_request) { if (!legacy_request) { LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: " "legacy_request is null"; @@ -2180,22 +1949,19 @@ bool convertHidlNanDataPathIndicationResponseToLegacy( } *legacy_request = {}; - legacy_request->rsp_code = hidl_request.acceptRequest - ? legacy_hal::NAN_DP_REQUEST_ACCEPT - : legacy_hal::NAN_DP_REQUEST_REJECT; + legacy_request->rsp_code = hidl_request.acceptRequest ? legacy_hal::NAN_DP_REQUEST_ACCEPT + : legacy_hal::NAN_DP_REQUEST_REJECT; legacy_request->ndp_instance_id = hidl_request.ndpInstanceId; if (strnlen(hidl_request.ifaceName.c_str(), IFNAMSIZ + 1) == IFNAMSIZ + 1) { LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: " "ifaceName too long"; return false; } - strncpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), - IFNAMSIZ + 1); + strncpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); legacy_request->ndp_cfg.security_cfg = - (hidl_request.securityConfig.securityType != - NanDataPathSecurityType::OPEN) - ? legacy_hal::NAN_DP_CONFIG_SECURITY - : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; + (hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN) + ? legacy_hal::NAN_DP_CONFIG_SECURITY + : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size(); if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) { LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: " @@ -2204,30 +1970,22 @@ bool convertHidlNanDataPathIndicationResponseToLegacy( } memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(), legacy_request->app_info.ndp_app_info_len); - legacy_request->cipher_type = - (unsigned int)hidl_request.securityConfig.cipherType; - if (hidl_request.securityConfig.securityType == - NanDataPathSecurityType::PMK) { - legacy_request->key_info.key_type = - legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; - legacy_request->key_info.body.pmk_info.pmk_len = - hidl_request.securityConfig.pmk.size(); - if (legacy_request->key_info.body.pmk_info.pmk_len != - NAN_PMK_INFO_LEN) { + legacy_request->cipher_type = (unsigned int)hidl_request.securityConfig.cipherType; + if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; + legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size(); + if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: " "invalid pmk_len"; return false; } - memcpy(legacy_request->key_info.body.pmk_info.pmk, - hidl_request.securityConfig.pmk.data(), + memcpy(legacy_request->key_info.body.pmk_info.pmk, hidl_request.securityConfig.pmk.data(), legacy_request->key_info.body.pmk_info.pmk_len); } - if (hidl_request.securityConfig.securityType == - NanDataPathSecurityType::PASSPHRASE) { - legacy_request->key_info.key_type = - legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; + if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; legacy_request->key_info.body.passphrase_info.passphrase_len = - hidl_request.securityConfig.passphrase.size(); + hidl_request.securityConfig.passphrase.size(); if (legacy_request->key_info.body.passphrase_info.passphrase_len < NAN_SECURITY_MIN_PASSPHRASE_LEN) { LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: " @@ -2250,19 +2008,16 @@ bool convertHidlNanDataPathIndicationResponseToLegacy( "service_name_len too large"; return false; } - memcpy(legacy_request->service_name, - hidl_request.serviceNameOutOfBand.data(), + memcpy(legacy_request->service_name, hidl_request.serviceNameOutOfBand.data(), legacy_request->service_name_len); return true; } -bool convertLegacyNanResponseHeaderToHidl( - const legacy_hal::NanResponseMsg& legacy_response, - WifiNanStatus* wifiNanStatus) { +bool convertLegacyNanResponseHeaderToHidl(const legacy_hal::NanResponseMsg& legacy_response, + WifiNanStatus* wifiNanStatus) { if (!wifiNanStatus) { - LOG(ERROR) - << "convertLegacyNanResponseHeaderToHidl: wifiNanStatus is null"; + LOG(ERROR) << "convertLegacyNanResponseHeaderToHidl: wifiNanStatus is null"; return false; } *wifiNanStatus = {}; @@ -2272,9 +2027,8 @@ bool convertLegacyNanResponseHeaderToHidl( return true; } -bool convertLegacyNanCapabilitiesResponseToHidl( - const legacy_hal::NanCapabilities& legacy_response, - NanCapabilities* hidl_response) { +bool convertLegacyNanCapabilitiesResponseToHidl(const legacy_hal::NanCapabilities& legacy_response, + V1_5::NanCapabilities* hidl_response) { if (!hidl_response) { LOG(ERROR) << "convertLegacyNanCapabilitiesResponseToHidl: " "hidl_response is null"; @@ -2282,31 +2036,23 @@ bool convertLegacyNanCapabilitiesResponseToHidl( } *hidl_response = {}; - hidl_response->V1_0.maxConcurrentClusters = - legacy_response.max_concurrent_nan_clusters; + hidl_response->V1_0.maxConcurrentClusters = legacy_response.max_concurrent_nan_clusters; hidl_response->V1_0.maxPublishes = legacy_response.max_publishes; hidl_response->V1_0.maxSubscribes = legacy_response.max_subscribes; - hidl_response->V1_0.maxServiceNameLen = - legacy_response.max_service_name_len; - hidl_response->V1_0.maxMatchFilterLen = - legacy_response.max_match_filter_len; - hidl_response->V1_0.maxTotalMatchFilterLen = - legacy_response.max_total_match_filter_len; - hidl_response->V1_0.maxServiceSpecificInfoLen = - legacy_response.max_service_specific_info_len; + hidl_response->V1_0.maxServiceNameLen = legacy_response.max_service_name_len; + hidl_response->V1_0.maxMatchFilterLen = legacy_response.max_match_filter_len; + hidl_response->V1_0.maxTotalMatchFilterLen = legacy_response.max_total_match_filter_len; + hidl_response->V1_0.maxServiceSpecificInfoLen = legacy_response.max_service_specific_info_len; hidl_response->V1_0.maxExtendedServiceSpecificInfoLen = - legacy_response.max_sdea_service_specific_info_len; + legacy_response.max_sdea_service_specific_info_len; hidl_response->V1_0.maxNdiInterfaces = legacy_response.max_ndi_interfaces; hidl_response->V1_0.maxNdpSessions = legacy_response.max_ndp_sessions; hidl_response->V1_0.maxAppInfoLen = legacy_response.max_app_info_len; hidl_response->V1_0.maxQueuedTransmitFollowupMsgs = - legacy_response.max_queued_transmit_followup_msgs; - hidl_response->V1_0.maxSubscribeInterfaceAddresses = - legacy_response.max_subscribe_address; - hidl_response->V1_0.supportedCipherSuites = - legacy_response.cipher_suites_supported; - hidl_response->instantCommunicationModeSupportFlag = - legacy_response.is_instant_mode_supported; + legacy_response.max_queued_transmit_followup_msgs; + hidl_response->V1_0.maxSubscribeInterfaceAddresses = legacy_response.max_subscribe_address; + hidl_response->V1_0.supportedCipherSuites = legacy_response.cipher_suites_supported; + hidl_response->instantCommunicationModeSupportFlag = legacy_response.is_instant_mode_supported; return true; } @@ -2322,36 +2068,31 @@ bool convertLegacyNanMatchIndToHidl(const legacy_hal::NanMatchInd& legacy_ind, hidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id; hidl_ind->peerId = legacy_ind.requestor_instance_id; hidl_ind->addr = hidl_array(legacy_ind.addr); - hidl_ind->serviceSpecificInfo = - std::vector(legacy_ind.service_specific_info, - legacy_ind.service_specific_info + - legacy_ind.service_specific_info_len); - hidl_ind->extendedServiceSpecificInfo = - std::vector(legacy_ind.sdea_service_specific_info, - legacy_ind.sdea_service_specific_info + - legacy_ind.sdea_service_specific_info_len); - hidl_ind->matchFilter = std::vector( - legacy_ind.sdf_match_filter, - legacy_ind.sdf_match_filter + legacy_ind.sdf_match_filter_len); + hidl_ind->serviceSpecificInfo = std::vector( + legacy_ind.service_specific_info, + legacy_ind.service_specific_info + legacy_ind.service_specific_info_len); + hidl_ind->extendedServiceSpecificInfo = std::vector( + legacy_ind.sdea_service_specific_info, + legacy_ind.sdea_service_specific_info + legacy_ind.sdea_service_specific_info_len); + hidl_ind->matchFilter = + std::vector(legacy_ind.sdf_match_filter, + legacy_ind.sdf_match_filter + legacy_ind.sdf_match_filter_len); hidl_ind->matchOccuredInBeaconFlag = legacy_ind.match_occured_flag == 1; hidl_ind->outOfResourceFlag = legacy_ind.out_of_resource_flag == 1; hidl_ind->rssiValue = legacy_ind.rssi_value; hidl_ind->peerCipherType = (NanCipherSuiteType)legacy_ind.peer_cipher_type; hidl_ind->peerRequiresSecurityEnabledInNdp = - legacy_ind.peer_sdea_params.security_cfg == - legacy_hal::NAN_DP_CONFIG_SECURITY; - hidl_ind->peerRequiresRanging = legacy_ind.peer_sdea_params.ranging_state == - legacy_hal::NAN_RANGING_ENABLE; - hidl_ind->rangingMeasurementInCm = - legacy_ind.range_info.range_measurement_mm / 10; + legacy_ind.peer_sdea_params.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY; + hidl_ind->peerRequiresRanging = + legacy_ind.peer_sdea_params.ranging_state == legacy_hal::NAN_RANGING_ENABLE; + hidl_ind->rangingMeasurementInCm = legacy_ind.range_info.range_measurement_mm / 10; hidl_ind->rangingIndicationType = legacy_ind.range_info.ranging_event_type; return true; } -bool convertLegacyNanFollowupIndToHidl( - const legacy_hal::NanFollowupInd& legacy_ind, - NanFollowupReceivedInd* hidl_ind) { +bool convertLegacyNanFollowupIndToHidl(const legacy_hal::NanFollowupInd& legacy_ind, + NanFollowupReceivedInd* hidl_ind) { if (!hidl_ind) { LOG(ERROR) << "convertLegacyNanFollowupIndToHidl: hidl_ind is null"; return false; @@ -2362,45 +2103,38 @@ bool convertLegacyNanFollowupIndToHidl( hidl_ind->peerId = legacy_ind.requestor_instance_id; hidl_ind->addr = hidl_array(legacy_ind.addr); hidl_ind->receivedInFaw = legacy_ind.dw_or_faw == 1; - hidl_ind->serviceSpecificInfo = - std::vector(legacy_ind.service_specific_info, - legacy_ind.service_specific_info + - legacy_ind.service_specific_info_len); - hidl_ind->extendedServiceSpecificInfo = - std::vector(legacy_ind.sdea_service_specific_info, - legacy_ind.sdea_service_specific_info + - legacy_ind.sdea_service_specific_info_len); + hidl_ind->serviceSpecificInfo = std::vector( + legacy_ind.service_specific_info, + legacy_ind.service_specific_info + legacy_ind.service_specific_info_len); + hidl_ind->extendedServiceSpecificInfo = std::vector( + legacy_ind.sdea_service_specific_info, + legacy_ind.sdea_service_specific_info + legacy_ind.sdea_service_specific_info_len); return true; } -bool convertLegacyNanDataPathRequestIndToHidl( - const legacy_hal::NanDataPathRequestInd& legacy_ind, - NanDataPathRequestInd* hidl_ind) { +bool convertLegacyNanDataPathRequestIndToHidl(const legacy_hal::NanDataPathRequestInd& legacy_ind, + NanDataPathRequestInd* hidl_ind) { if (!hidl_ind) { - LOG(ERROR) - << "convertLegacyNanDataPathRequestIndToHidl: hidl_ind is null"; + LOG(ERROR) << "convertLegacyNanDataPathRequestIndToHidl: hidl_ind is null"; return false; } *hidl_ind = {}; hidl_ind->discoverySessionId = legacy_ind.service_instance_id; - hidl_ind->peerDiscMacAddr = - hidl_array(legacy_ind.peer_disc_mac_addr); + hidl_ind->peerDiscMacAddr = hidl_array(legacy_ind.peer_disc_mac_addr); hidl_ind->ndpInstanceId = legacy_ind.ndp_instance_id; hidl_ind->securityRequired = - legacy_ind.ndp_cfg.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY; - hidl_ind->appInfo = - std::vector(legacy_ind.app_info.ndp_app_info, - legacy_ind.app_info.ndp_app_info + - legacy_ind.app_info.ndp_app_info_len); + legacy_ind.ndp_cfg.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY; + hidl_ind->appInfo = std::vector( + legacy_ind.app_info.ndp_app_info, + legacy_ind.app_info.ndp_app_info + legacy_ind.app_info.ndp_app_info_len); return true; } -bool convertLegacyNdpChannelInfoToHidl( - const legacy_hal::NanChannelInfo& legacy_struct, - V1_2::NanDataPathChannelInfo* hidl_struct) { +bool convertLegacyNdpChannelInfoToHidl(const legacy_hal::NanChannelInfo& legacy_struct, + V1_2::NanDataPathChannelInfo* hidl_struct) { if (!hidl_struct) { LOG(ERROR) << "convertLegacyNdpChannelInfoToHidl: hidl_struct is null"; return false; @@ -2409,40 +2143,33 @@ bool convertLegacyNdpChannelInfoToHidl( hidl_struct->channelFreq = legacy_struct.channel; hidl_struct->channelBandwidth = convertLegacyWifiChannelWidthToHidl( - (legacy_hal::wifi_channel_width)legacy_struct.bandwidth); + (legacy_hal::wifi_channel_width)legacy_struct.bandwidth); hidl_struct->numSpatialStreams = legacy_struct.nss; return true; } -bool convertLegacyNanDataPathConfirmIndToHidl( - const legacy_hal::NanDataPathConfirmInd& legacy_ind, - V1_2::NanDataPathConfirmInd* hidl_ind) { +bool convertLegacyNanDataPathConfirmIndToHidl(const legacy_hal::NanDataPathConfirmInd& legacy_ind, + V1_2::NanDataPathConfirmInd* hidl_ind) { if (!hidl_ind) { - LOG(ERROR) - << "convertLegacyNanDataPathConfirmIndToHidl: hidl_ind is null"; + LOG(ERROR) << "convertLegacyNanDataPathConfirmIndToHidl: hidl_ind is null"; return false; } *hidl_ind = {}; hidl_ind->V1_0.ndpInstanceId = legacy_ind.ndp_instance_id; - hidl_ind->V1_0.dataPathSetupSuccess = - legacy_ind.rsp_code == legacy_hal::NAN_DP_REQUEST_ACCEPT; - hidl_ind->V1_0.peerNdiMacAddr = - hidl_array(legacy_ind.peer_ndi_mac_addr); - hidl_ind->V1_0.appInfo = - std::vector(legacy_ind.app_info.ndp_app_info, - legacy_ind.app_info.ndp_app_info + - legacy_ind.app_info.ndp_app_info_len); - hidl_ind->V1_0.status.status = - convertLegacyNanStatusTypeToHidl(legacy_ind.reason_code); + hidl_ind->V1_0.dataPathSetupSuccess = legacy_ind.rsp_code == legacy_hal::NAN_DP_REQUEST_ACCEPT; + hidl_ind->V1_0.peerNdiMacAddr = hidl_array(legacy_ind.peer_ndi_mac_addr); + hidl_ind->V1_0.appInfo = std::vector( + legacy_ind.app_info.ndp_app_info, + legacy_ind.app_info.ndp_app_info + legacy_ind.app_info.ndp_app_info_len); + hidl_ind->V1_0.status.status = convertLegacyNanStatusTypeToHidl(legacy_ind.reason_code); hidl_ind->V1_0.status.description = ""; // TODO: b/34059183 std::vector channelInfo; for (unsigned int i = 0; i < legacy_ind.num_channels; ++i) { V1_2::NanDataPathChannelInfo hidl_struct; - if (!convertLegacyNdpChannelInfoToHidl(legacy_ind.channel_info[i], - &hidl_struct)) { + if (!convertLegacyNdpChannelInfoToHidl(legacy_ind.channel_info[i], &hidl_struct)) { return false; } channelInfo.push_back(hidl_struct); @@ -2453,8 +2180,8 @@ bool convertLegacyNanDataPathConfirmIndToHidl( } bool convertLegacyNanDataPathScheduleUpdateIndToHidl( - const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind, - V1_2::NanDataPathScheduleUpdateInd* hidl_ind) { + const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind, + V1_2::NanDataPathScheduleUpdateInd* hidl_ind) { if (!hidl_ind) { LOG(ERROR) << "convertLegacyNanDataPathScheduleUpdateIndToHidl: " "hidl_ind is null"; @@ -2462,13 +2189,11 @@ bool convertLegacyNanDataPathScheduleUpdateIndToHidl( } *hidl_ind = {}; - hidl_ind->peerDiscoveryAddress = - hidl_array(legacy_ind.peer_mac_addr); + hidl_ind->peerDiscoveryAddress = hidl_array(legacy_ind.peer_mac_addr); std::vector channelInfo; for (unsigned int i = 0; i < legacy_ind.num_channels; ++i) { V1_2::NanDataPathChannelInfo hidl_struct; - if (!convertLegacyNdpChannelInfoToHidl(legacy_ind.channel_info[i], - &hidl_struct)) { + if (!convertLegacyNdpChannelInfoToHidl(legacy_ind.channel_info[i], &hidl_struct)) { return false; } channelInfo.push_back(hidl_struct); @@ -2519,8 +2244,7 @@ legacy_hal::rtt_peer_type convertHidlRttPeerTypeToLegacy(RttPeerType type) { CHECK(false); } -legacy_hal::wifi_channel_width convertHidlWifiChannelWidthToLegacy( - WifiChannelWidthInMhz type) { +legacy_hal::wifi_channel_width convertHidlWifiChannelWidthToLegacy(WifiChannelWidthInMhz type) { switch (type) { case WifiChannelWidthInMhz::WIDTH_20: return legacy_hal::WIFI_CHAN_WIDTH_20; @@ -2542,8 +2266,7 @@ legacy_hal::wifi_channel_width convertHidlWifiChannelWidthToLegacy( CHECK(false); } -WifiChannelWidthInMhz convertLegacyWifiChannelWidthToHidl( - legacy_hal::wifi_channel_width type) { +WifiChannelWidthInMhz convertLegacyWifiChannelWidthToHidl(legacy_hal::wifi_channel_width type) { switch (type) { case legacy_hal::WIFI_CHAN_WIDTH_20: return WifiChannelWidthInMhz::WIDTH_20; @@ -2564,8 +2287,7 @@ WifiChannelWidthInMhz convertLegacyWifiChannelWidthToHidl( }; } -legacy_hal::wifi_rtt_preamble convertHidlRttPreambleToLegacy( - V1_4::RttPreamble type) { +legacy_hal::wifi_rtt_preamble convertHidlRttPreambleToLegacy(V1_4::RttPreamble type) { switch (type) { case V1_4::RttPreamble::LEGACY: return legacy_hal::WIFI_RTT_PREAMBLE_LEGACY; @@ -2579,8 +2301,7 @@ legacy_hal::wifi_rtt_preamble convertHidlRttPreambleToLegacy( CHECK(false); } -V1_4::RttPreamble convertLegacyRttPreambleToHidl( - legacy_hal::wifi_rtt_preamble type) { +V1_4::RttPreamble convertLegacyRttPreambleToHidl(legacy_hal::wifi_rtt_preamble type) { switch (type) { case legacy_hal::WIFI_RTT_PREAMBLE_LEGACY: return V1_4::RttPreamble::LEGACY; @@ -2630,8 +2351,7 @@ RttBw convertLegacyRttBwToHidl(legacy_hal::wifi_rtt_bw type) { CHECK(false) << "Unknown legacy type: " << type; } -legacy_hal::wifi_motion_pattern convertHidlRttMotionPatternToLegacy( - RttMotionPattern type) { +legacy_hal::wifi_motion_pattern convertHidlRttMotionPatternToLegacy(RttMotionPattern type) { switch (type) { case RttMotionPattern::NOT_EXPECTED: return legacy_hal::WIFI_MOTION_NOT_EXPECTED; @@ -2718,9 +2438,8 @@ RttStatus convertLegacyRttStatusToHidl(legacy_hal::wifi_rtt_status status) { CHECK(false) << "Unknown legacy status: " << status; } -bool convertHidlWifiChannelInfoToLegacy( - const WifiChannelInfo& hidl_info, - legacy_hal::wifi_channel_info* legacy_info) { +bool convertHidlWifiChannelInfoToLegacy(const WifiChannelInfo& hidl_info, + legacy_hal::wifi_channel_info* legacy_info) { if (!legacy_info) { return false; } @@ -2732,9 +2451,8 @@ bool convertHidlWifiChannelInfoToLegacy( return true; } -bool convertLegacyWifiChannelInfoToHidl( - const legacy_hal::wifi_channel_info& legacy_info, - WifiChannelInfo* hidl_info) { +bool convertLegacyWifiChannelInfoToHidl(const legacy_hal::wifi_channel_info& legacy_info, + WifiChannelInfo* hidl_info) { if (!hidl_info) { return false; } @@ -2753,32 +2471,28 @@ bool convertHidlRttConfigToLegacy(const V1_4::RttConfig& hidl_config, } *legacy_config = {}; CHECK(hidl_config.addr.size() == sizeof(legacy_config->addr)); - memcpy(legacy_config->addr, hidl_config.addr.data(), - hidl_config.addr.size()); + memcpy(legacy_config->addr, hidl_config.addr.data(), hidl_config.addr.size()); legacy_config->type = convertHidlRttTypeToLegacy(hidl_config.type); legacy_config->peer = convertHidlRttPeerTypeToLegacy(hidl_config.peer); - if (!convertHidlWifiChannelInfoToLegacy(hidl_config.channel, - &legacy_config->channel)) { + if (!convertHidlWifiChannelInfoToLegacy(hidl_config.channel, &legacy_config->channel)) { return false; } legacy_config->burst_period = hidl_config.burstPeriod; legacy_config->num_burst = hidl_config.numBurst; legacy_config->num_frames_per_burst = hidl_config.numFramesPerBurst; - legacy_config->num_retries_per_rtt_frame = - hidl_config.numRetriesPerRttFrame; + legacy_config->num_retries_per_rtt_frame = hidl_config.numRetriesPerRttFrame; legacy_config->num_retries_per_ftmr = hidl_config.numRetriesPerFtmr; legacy_config->LCI_request = hidl_config.mustRequestLci; legacy_config->LCR_request = hidl_config.mustRequestLcr; legacy_config->burst_duration = hidl_config.burstDuration; - legacy_config->preamble = - convertHidlRttPreambleToLegacy(hidl_config.preamble); + legacy_config->preamble = convertHidlRttPreambleToLegacy(hidl_config.preamble); legacy_config->bw = convertHidlRttBwToLegacy(hidl_config.bw); return true; } bool convertHidlVectorOfRttConfigToLegacy( - const std::vector& hidl_configs, - std::vector* legacy_configs) { + const std::vector& hidl_configs, + std::vector* legacy_configs) { if (!legacy_configs) { return false; } @@ -2793,9 +2507,8 @@ bool convertHidlVectorOfRttConfigToLegacy( return true; } -bool convertHidlRttLciInformationToLegacy( - const RttLciInformation& hidl_info, - legacy_hal::wifi_lci_information* legacy_info) { +bool convertHidlRttLciInformationToLegacy(const RttLciInformation& hidl_info, + legacy_hal::wifi_lci_information* legacy_info) { if (!legacy_info) { return false; } @@ -2806,99 +2519,83 @@ bool convertHidlRttLciInformationToLegacy( legacy_info->latitude_unc = hidl_info.latitudeUnc; legacy_info->longitude_unc = hidl_info.longitudeUnc; legacy_info->altitude_unc = hidl_info.altitudeUnc; - legacy_info->motion_pattern = - convertHidlRttMotionPatternToLegacy(hidl_info.motionPattern); + legacy_info->motion_pattern = convertHidlRttMotionPatternToLegacy(hidl_info.motionPattern); legacy_info->floor = hidl_info.floor; legacy_info->height_above_floor = hidl_info.heightAboveFloor; legacy_info->height_unc = hidl_info.heightUnc; return true; } -bool convertHidlRttLcrInformationToLegacy( - const RttLcrInformation& hidl_info, - legacy_hal::wifi_lcr_information* legacy_info) { +bool convertHidlRttLcrInformationToLegacy(const RttLcrInformation& hidl_info, + legacy_hal::wifi_lcr_information* legacy_info) { if (!legacy_info) { return false; } *legacy_info = {}; CHECK(hidl_info.countryCode.size() == sizeof(legacy_info->country_code)); - memcpy(legacy_info->country_code, hidl_info.countryCode.data(), - hidl_info.countryCode.size()); + memcpy(legacy_info->country_code, hidl_info.countryCode.data(), hidl_info.countryCode.size()); if (hidl_info.civicInfo.size() > sizeof(legacy_info->civic_info)) { return false; } legacy_info->length = hidl_info.civicInfo.size(); - memcpy(legacy_info->civic_info, hidl_info.civicInfo.c_str(), - hidl_info.civicInfo.size()); + memcpy(legacy_info->civic_info, hidl_info.civicInfo.c_str(), hidl_info.civicInfo.size()); return true; } -bool convertHidlRttResponderToLegacy( - const V1_4::RttResponder& hidl_responder, - legacy_hal::wifi_rtt_responder* legacy_responder) { +bool convertHidlRttResponderToLegacy(const V1_4::RttResponder& hidl_responder, + legacy_hal::wifi_rtt_responder* legacy_responder) { if (!legacy_responder) { return false; } *legacy_responder = {}; - if (!convertHidlWifiChannelInfoToLegacy(hidl_responder.channel, - &legacy_responder->channel)) { + if (!convertHidlWifiChannelInfoToLegacy(hidl_responder.channel, &legacy_responder->channel)) { return false; } - legacy_responder->preamble = - convertHidlRttPreambleToLegacy(hidl_responder.preamble); + legacy_responder->preamble = convertHidlRttPreambleToLegacy(hidl_responder.preamble); return true; } -bool convertLegacyRttResponderToHidl( - const legacy_hal::wifi_rtt_responder& legacy_responder, - V1_4::RttResponder* hidl_responder) { +bool convertLegacyRttResponderToHidl(const legacy_hal::wifi_rtt_responder& legacy_responder, + V1_4::RttResponder* hidl_responder) { if (!hidl_responder) { return false; } *hidl_responder = {}; - if (!convertLegacyWifiChannelInfoToHidl(legacy_responder.channel, - &hidl_responder->channel)) { + if (!convertLegacyWifiChannelInfoToHidl(legacy_responder.channel, &hidl_responder->channel)) { return false; } - hidl_responder->preamble = - convertLegacyRttPreambleToHidl(legacy_responder.preamble); + hidl_responder->preamble = convertLegacyRttPreambleToHidl(legacy_responder.preamble); return true; } bool convertLegacyRttCapabilitiesToHidl( - const legacy_hal::wifi_rtt_capabilities& legacy_capabilities, - V1_4::RttCapabilities* hidl_capabilities) { + const legacy_hal::wifi_rtt_capabilities& legacy_capabilities, + V1_4::RttCapabilities* hidl_capabilities) { if (!hidl_capabilities) { return false; } *hidl_capabilities = {}; - hidl_capabilities->rttOneSidedSupported = - legacy_capabilities.rtt_one_sided_supported; + hidl_capabilities->rttOneSidedSupported = legacy_capabilities.rtt_one_sided_supported; hidl_capabilities->rttFtmSupported = legacy_capabilities.rtt_ftm_supported; hidl_capabilities->lciSupported = legacy_capabilities.lci_support; hidl_capabilities->lcrSupported = legacy_capabilities.lcr_support; - hidl_capabilities->responderSupported = - legacy_capabilities.responder_supported; + hidl_capabilities->responderSupported = legacy_capabilities.responder_supported; hidl_capabilities->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}) { + 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}) { if (legacy_capabilities.preamble_support & flag) { hidl_capabilities->preambleSupport |= - static_cast::type>( - convertLegacyRttPreambleToHidl(flag)); + static_cast::type>( + convertLegacyRttPreambleToHidl(flag)); } } hidl_capabilities->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_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}) { if (legacy_capabilities.bw_support & flag) { hidl_capabilities->bwSupport |= - static_cast::type>( - convertLegacyRttBwToHidl(flag)); + static_cast::type>(convertLegacyRttBwToHidl(flag)); } } hidl_capabilities->mcVersion = legacy_capabilities.mc_version; @@ -2911,26 +2608,23 @@ bool convertLegacyWifiRateInfoToHidl(const legacy_hal::wifi_rate& legacy_rate, return false; } *hidl_rate = {}; - hidl_rate->preamble = - convertLegacyWifiRatePreambleToHidl(legacy_rate.preamble); + hidl_rate->preamble = convertLegacyWifiRatePreambleToHidl(legacy_rate.preamble); hidl_rate->nss = convertLegacyWifiRateNssToHidl(legacy_rate.nss); hidl_rate->bw = convertLegacyWifiChannelWidthToHidl( - static_cast(legacy_rate.bw)); + static_cast(legacy_rate.bw)); hidl_rate->rateMcsIdx = legacy_rate.rateMcsIdx; hidl_rate->bitRateInKbps = legacy_rate.bitrate; return true; } -bool convertLegacyRttResultToHidl( - const legacy_hal::wifi_rtt_result& legacy_result, - V1_4::RttResult* hidl_result) { +bool convertLegacyRttResultToHidl(const legacy_hal::wifi_rtt_result& legacy_result, + V1_4::RttResult* hidl_result) { if (!hidl_result) { return false; } *hidl_result = {}; CHECK(sizeof(legacy_result.addr) == hidl_result->addr.size()); - memcpy(hidl_result->addr.data(), legacy_result.addr, - sizeof(legacy_result.addr)); + memcpy(hidl_result->addr.data(), legacy_result.addr, sizeof(legacy_result.addr)); hidl_result->burstNum = legacy_result.burst_num; hidl_result->measurementNumber = legacy_result.measurement_number; hidl_result->successNumber = legacy_result.success_number; @@ -2940,12 +2634,10 @@ bool convertLegacyRttResultToHidl( hidl_result->type = convertLegacyRttTypeToHidl(legacy_result.type); hidl_result->rssi = legacy_result.rssi; hidl_result->rssiSpread = legacy_result.rssi_spread; - if (!convertLegacyWifiRateInfoToHidl(legacy_result.tx_rate, - &hidl_result->txRate)) { + if (!convertLegacyWifiRateInfoToHidl(legacy_result.tx_rate, &hidl_result->txRate)) { return false; } - if (!convertLegacyWifiRateInfoToHidl(legacy_result.rx_rate, - &hidl_result->rxRate)) { + if (!convertLegacyWifiRateInfoToHidl(legacy_result.rx_rate, &hidl_result->rxRate)) { return false; } hidl_result->rtt = legacy_result.rtt; @@ -2957,20 +2649,18 @@ bool convertLegacyRttResultToHidl( hidl_result->timeStampInUs = legacy_result.ts; hidl_result->burstDurationInMs = legacy_result.burst_duration; hidl_result->negotiatedBurstNum = legacy_result.negotiated_burst_num; - if (legacy_result.LCI && - !convertLegacyIeToHidl(*legacy_result.LCI, &hidl_result->lci)) { + if (legacy_result.LCI && !convertLegacyIeToHidl(*legacy_result.LCI, &hidl_result->lci)) { return false; } - if (legacy_result.LCR && - !convertLegacyIeToHidl(*legacy_result.LCR, &hidl_result->lcr)) { + if (legacy_result.LCR && !convertLegacyIeToHidl(*legacy_result.LCR, &hidl_result->lcr)) { return false; } return true; } bool convertLegacyVectorOfRttResultToHidl( - const std::vector& legacy_results, - std::vector* hidl_results) { + const std::vector& legacy_results, + std::vector* hidl_results) { if (!hidl_results) { return false; } @@ -2985,8 +2675,7 @@ bool convertLegacyVectorOfRttResultToHidl( return true; } -legacy_hal::wifi_interface_type convertHidlIfaceTypeToLegacy( - IfaceType hidl_interface_type) { +legacy_hal::wifi_interface_type convertHidlIfaceTypeToLegacy(IfaceType hidl_interface_type) { switch (hidl_interface_type) { case IfaceType::STA: return legacy_hal::WIFI_INTERFACE_TYPE_STA; @@ -3001,28 +2690,28 @@ legacy_hal::wifi_interface_type convertHidlIfaceTypeToLegacy( } legacy_hal::wifi_multi_sta_use_case convertHidlMultiStaUseCaseToLegacy( - IWifiChip::MultiStaUseCase use_case) { + V1_5::IWifiChip::MultiStaUseCase use_case) { switch (use_case) { - case IWifiChip::MultiStaUseCase::DUAL_STA_TRANSIENT_PREFER_PRIMARY: + case V1_5::IWifiChip::MultiStaUseCase::DUAL_STA_TRANSIENT_PREFER_PRIMARY: return legacy_hal::WIFI_DUAL_STA_TRANSIENT_PREFER_PRIMARY; - case IWifiChip::MultiStaUseCase::DUAL_STA_NON_TRANSIENT_UNBIASED: + case V1_5::IWifiChip::MultiStaUseCase::DUAL_STA_NON_TRANSIENT_UNBIASED: return legacy_hal::WIFI_DUAL_STA_NON_TRANSIENT_UNBIASED; } CHECK(false); } bool convertHidlCoexUnsafeChannelToLegacy( - const IWifiChip::CoexUnsafeChannel& hidl_unsafe_channel, - legacy_hal::wifi_coex_unsafe_channel* legacy_unsafe_channel) { + const V1_5::IWifiChip::CoexUnsafeChannel& hidl_unsafe_channel, + legacy_hal::wifi_coex_unsafe_channel* legacy_unsafe_channel) { if (!legacy_unsafe_channel) { return false; } *legacy_unsafe_channel = {}; switch (hidl_unsafe_channel.band) { - case WifiBand::BAND_24GHZ: + case V1_5::WifiBand::BAND_24GHZ: legacy_unsafe_channel->band = legacy_hal::WLAN_MAC_2_4_BAND; break; - case WifiBand::BAND_5GHZ: + case V1_5::WifiBand::BAND_5GHZ: legacy_unsafe_channel->band = legacy_hal::WLAN_MAC_5_0_BAND; break; default: @@ -3034,16 +2723,16 @@ bool convertHidlCoexUnsafeChannelToLegacy( } bool convertHidlVectorOfCoexUnsafeChannelToLegacy( - const std::vector& hidl_unsafe_channels, - std::vector* legacy_unsafe_channels) { + const std::vector& hidl_unsafe_channels, + std::vector* legacy_unsafe_channels) { if (!legacy_unsafe_channels) { return false; } *legacy_unsafe_channels = {}; for (const auto& hidl_unsafe_channel : hidl_unsafe_channels) { legacy_hal::wifi_coex_unsafe_channel legacy_unsafe_channel; - if (!hidl_struct_util::convertHidlCoexUnsafeChannelToLegacy( - hidl_unsafe_channel, &legacy_unsafe_channel)) { + if (!hidl_struct_util::convertHidlCoexUnsafeChannelToLegacy(hidl_unsafe_channel, + &legacy_unsafe_channel)) { return false; } legacy_unsafe_channels->push_back(legacy_unsafe_channel); @@ -3053,7 +2742,7 @@ bool convertHidlVectorOfCoexUnsafeChannelToLegacy( } // namespace hidl_struct_util } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.6/default/hidl_struct_util.h b/wifi/1.6/default/hidl_struct_util.h new file mode 100644 index 0000000000..15a3205847 --- /dev/null +++ b/wifi/1.6/default/hidl_struct_util.h @@ -0,0 +1,200 @@ +/* + * 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 HIDL_STRUCT_UTIL_H_ +#define HIDL_STRUCT_UTIL_H_ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wifi_legacy_hal.h" + +/** + * This file contains a bunch of functions to convert structs from the legacy + * HAL to HIDL and vice versa. + * TODO(b/32093047): Add unit tests for these conversion methods in the VTS test + * suite. + */ +namespace android { +namespace hardware { +namespace wifi { +namespace V1_6 { +namespace implementation { +namespace hidl_struct_util { +using namespace android::hardware::wifi::V1_0; + +// Chip conversion methods. +bool convertLegacyFeaturesToHidlChipCapabilities(uint64_t legacy_feature_set, + uint32_t legacy_logger_feature_set, + uint32_t* hidl_caps); +bool convertLegacyDebugRingBufferStatusToHidl( + const legacy_hal::wifi_ring_buffer_status& legacy_status, + WifiDebugRingBufferStatus* hidl_status); +bool convertLegacyVectorOfDebugRingBufferStatusToHidl( + const std::vector& legacy_status_vec, + std::vector* hidl_status_vec); +bool convertLegacyWakeReasonStatsToHidl(const legacy_hal::WakeReasonStats& legacy_stats, + WifiDebugHostWakeReasonStats* hidl_stats); +legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy( + V1_1::IWifiChip::TxPowerScenario hidl_scenario); +legacy_hal::wifi_latency_mode convertHidlLatencyModeToLegacy( + V1_3::IWifiChip::LatencyMode hidl_latency_mode); +legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy_1_2( + V1_2::IWifiChip::TxPowerScenario hidl_scenario); +bool convertLegacyWifiMacInfosToHidl( + const std::vector& legacy_mac_infos, + std::vector* hidl_radio_mode_infos); +legacy_hal::wifi_interface_type convertHidlIfaceTypeToLegacy(IfaceType hidl_interface_type); +legacy_hal::wifi_multi_sta_use_case convertHidlMultiStaUseCaseToLegacy( + V1_5::IWifiChip::MultiStaUseCase use_case); +bool convertHidlCoexUnsafeChannelToLegacy( + const V1_5::IWifiChip::CoexUnsafeChannel& hidl_unsafe_channel, + legacy_hal::wifi_coex_unsafe_channel* legacy_unsafe_channel); +bool convertHidlVectorOfCoexUnsafeChannelToLegacy( + const std::vector& hidl_unsafe_channels, + std::vector* legacy_unsafe_channels); + +// STA iface conversion methods. +bool convertLegacyFeaturesToHidlStaCapabilities(uint64_t legacy_feature_set, + uint32_t legacy_logger_feature_set, + uint32_t* hidl_caps); +bool convertLegacyApfCapabilitiesToHidl(const legacy_hal::PacketFilterCapabilities& legacy_caps, + StaApfPacketFilterCapabilities* hidl_caps); +bool convertLegacyGscanCapabilitiesToHidl(const legacy_hal::wifi_gscan_capabilities& legacy_caps, + StaBackgroundScanCapabilities* hidl_caps); +legacy_hal::wifi_band convertHidlWifiBandToLegacy(V1_0::WifiBand band); +bool convertHidlGscanParamsToLegacy(const StaBackgroundScanParameters& hidl_scan_params, + legacy_hal::wifi_scan_cmd_params* legacy_scan_params); +// |has_ie_data| indicates whether or not the wifi_scan_result includes 802.11 +// Information Elements (IEs) +bool convertLegacyGscanResultToHidl(const legacy_hal::wifi_scan_result& legacy_scan_result, + bool has_ie_data, StaScanResult* hidl_scan_result); +// |cached_results| is assumed to not include IEs. +bool convertLegacyVectorOfCachedGscanResultsToHidl( + const std::vector& legacy_cached_scan_results, + std::vector* hidl_scan_datas); +bool convertLegacyLinkLayerStatsToHidl(const legacy_hal::LinkLayerStats& legacy_stats, + V1_5::StaLinkLayerStats* hidl_stats); +bool convertLegacyRoamingCapabilitiesToHidl( + const legacy_hal::wifi_roaming_capabilities& legacy_caps, + StaRoamingCapabilities* hidl_caps); +bool convertHidlRoamingConfigToLegacy(const StaRoamingConfig& hidl_config, + legacy_hal::wifi_roaming_config* legacy_config); +legacy_hal::fw_roaming_state_t convertHidlRoamingStateToLegacy(StaRoamingState state); +bool convertLegacyVectorOfDebugTxPacketFateToHidl( + const std::vector& legacy_fates, + std::vector* hidl_fates); +bool convertLegacyVectorOfDebugRxPacketFateToHidl( + const std::vector& legacy_fates, + std::vector* hidl_fates); + +// NAN iface conversion methods. +void convertToWifiNanStatus(legacy_hal::NanStatusType type, const char* str, size_t max_len, + WifiNanStatus* wifiNanStatus); +bool convertHidlNanEnableRequestToLegacy(const V1_4::NanEnableRequest& hidl_request, + legacy_hal::NanEnableRequest* legacy_request); +bool convertHidlNanConfigRequestToLegacy(const V1_4::NanConfigRequest& hidl_request, + legacy_hal::NanConfigRequest* legacy_request); +bool convertHidlNanEnableRequest_1_4ToLegacy( + const V1_4::NanEnableRequest& hidl_request1, + const V1_5::NanConfigRequestSupplemental& hidl_request2, + legacy_hal::NanEnableRequest* legacy_request); +bool convertHidlNanConfigRequest_1_4ToLegacy( + const V1_4::NanConfigRequest& hidl_request1, + const V1_5::NanConfigRequestSupplemental& hidl_request2, + legacy_hal::NanConfigRequest* legacy_request); +bool convertHidlNanEnableRequest_1_5ToLegacy( + const V1_4::NanEnableRequest& hidl_request1, + const V1_5::NanConfigRequestSupplemental& hidl_request2, + legacy_hal::NanEnableRequest* legacy_request); +bool convertHidlNanConfigRequest_1_5ToLegacy( + const V1_4::NanConfigRequest& hidl_request1, + const V1_5::NanConfigRequestSupplemental& hidl_request2, + legacy_hal::NanConfigRequest* legacy_request); +bool convertHidlNanPublishRequestToLegacy(const NanPublishRequest& hidl_request, + legacy_hal::NanPublishRequest* legacy_request); +bool convertHidlNanSubscribeRequestToLegacy(const NanSubscribeRequest& hidl_request, + legacy_hal::NanSubscribeRequest* legacy_request); +bool convertHidlNanTransmitFollowupRequestToLegacy( + const NanTransmitFollowupRequest& hidl_request, + legacy_hal::NanTransmitFollowupRequest* legacy_request); +bool convertHidlNanDataPathInitiatorRequestToLegacy( + const NanInitiateDataPathRequest& hidl_request, + legacy_hal::NanDataPathInitiatorRequest* legacy_request); +bool convertHidlNanDataPathIndicationResponseToLegacy( + const NanRespondToDataPathIndicationRequest& hidl_response, + legacy_hal::NanDataPathIndicationResponse* legacy_response); +bool convertLegacyNanResponseHeaderToHidl(const legacy_hal::NanResponseMsg& legacy_response, + WifiNanStatus* wifiNanStatus); +bool convertLegacyNanCapabilitiesResponseToHidl(const legacy_hal::NanCapabilities& legacy_response, + V1_5::NanCapabilities* hidl_response); +bool convertLegacyNanMatchIndToHidl(const legacy_hal::NanMatchInd& legacy_ind, + NanMatchInd* hidl_ind); +bool convertLegacyNanFollowupIndToHidl(const legacy_hal::NanFollowupInd& legacy_ind, + NanFollowupReceivedInd* hidl_ind); +bool convertLegacyNanDataPathRequestIndToHidl(const legacy_hal::NanDataPathRequestInd& legacy_ind, + NanDataPathRequestInd* hidl_ind); +bool convertLegacyNanDataPathConfirmIndToHidl(const legacy_hal::NanDataPathConfirmInd& legacy_ind, + V1_2::NanDataPathConfirmInd* hidl_ind); +bool convertLegacyNanDataPathScheduleUpdateIndToHidl( + const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind, + V1_2::NanDataPathScheduleUpdateInd* hidl_ind); + +// RTT controller conversion methods. +bool convertHidlVectorOfRttConfigToLegacy(const std::vector& hidl_configs, + std::vector* legacy_configs); +bool convertHidlRttLciInformationToLegacy(const RttLciInformation& hidl_info, + legacy_hal::wifi_lci_information* legacy_info); +bool convertHidlRttLcrInformationToLegacy(const RttLcrInformation& hidl_info, + legacy_hal::wifi_lcr_information* legacy_info); +bool convertHidlRttResponderToLegacy(const V1_4::RttResponder& hidl_responder, + legacy_hal::wifi_rtt_responder* legacy_responder); +bool convertHidlWifiChannelInfoToLegacy(const WifiChannelInfo& hidl_info, + legacy_hal::wifi_channel_info* legacy_info); +bool convertLegacyRttResponderToHidl(const legacy_hal::wifi_rtt_responder& legacy_responder, + V1_4::RttResponder* hidl_responder); +bool convertLegacyRttCapabilitiesToHidl( + const legacy_hal::wifi_rtt_capabilities& legacy_capabilities, + V1_4::RttCapabilities* hidl_capabilities); +bool convertLegacyVectorOfRttResultToHidl( + const std::vector& legacy_results, + std::vector* hidl_results); +uint32_t convertHidlWifiBandToLegacyMacBand(V1_5::WifiBand band); +uint32_t convertHidlWifiIfaceModeToLegacy(uint32_t hidl_iface_mask); +uint32_t convertHidlUsableChannelFilterToLegacy(uint32_t hidl_filter_mask); +bool convertLegacyWifiUsableChannelsToHidl( + const std::vector& legacy_usable_channels, + std::vector* hidl_usable_channels); +bool convertLegacyPeerInfoStatsToHidl(const legacy_hal::WifiPeerInfo& legacy_peer_info_stats, + V1_5::StaPeerInfo* hidl_peer_info_stats); +bool convertLegacyWifiRateInfoToHidl(const legacy_hal::wifi_rate& legacy_rate, + V1_4::WifiRateInfo* hidl_rate); +} // namespace hidl_struct_util +} // namespace implementation +} // namespace V1_6 +} // namespace wifi +} // namespace hardware +} // namespace android + +#endif // HIDL_STRUCT_UTIL_H_ diff --git a/wifi/1.5/default/hidl_sync_util.cpp b/wifi/1.6/default/hidl_sync_util.cpp similarity index 96% rename from wifi/1.5/default/hidl_sync_util.cpp rename to wifi/1.6/default/hidl_sync_util.cpp index 93eefe9560..358d95e668 100644 --- a/wifi/1.5/default/hidl_sync_util.cpp +++ b/wifi/1.6/default/hidl_sync_util.cpp @@ -23,7 +23,7 @@ std::recursive_mutex g_mutex; namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace hidl_sync_util { @@ -33,7 +33,7 @@ std::unique_lock acquireGlobalLock() { } // namespace hidl_sync_util } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/hidl_sync_util.h b/wifi/1.6/default/hidl_sync_util.h similarity index 96% rename from wifi/1.5/default/hidl_sync_util.h rename to wifi/1.6/default/hidl_sync_util.h index e706f4cd87..2c1c37b0ad 100644 --- a/wifi/1.5/default/hidl_sync_util.h +++ b/wifi/1.6/default/hidl_sync_util.h @@ -24,13 +24,13 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace hidl_sync_util { std::unique_lock acquireGlobalLock(); } // namespace hidl_sync_util } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/ringbuffer.cpp b/wifi/1.6/default/ringbuffer.cpp similarity index 91% rename from wifi/1.5/default/ringbuffer.cpp rename to wifi/1.6/default/ringbuffer.cpp index f554111e61..6d4ed843c3 100644 --- a/wifi/1.5/default/ringbuffer.cpp +++ b/wifi/1.6/default/ringbuffer.cpp @@ -21,7 +21,7 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { Ringbuffer::Ringbuffer(size_t maxSize) : size_(0), maxSize_(maxSize) {} @@ -31,8 +31,7 @@ void Ringbuffer::append(const std::vector& input) { return; } if (input.size() > maxSize_) { - LOG(INFO) << "Oversized message of " << input.size() - << " bytes is dropped"; + LOG(INFO) << "Oversized message of " << input.size() << " bytes is dropped"; return; } data_.push_back(input); @@ -53,7 +52,7 @@ void Ringbuffer::clear() { } } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/ringbuffer.h b/wifi/1.6/default/ringbuffer.h similarity index 95% rename from wifi/1.5/default/ringbuffer.h rename to wifi/1.6/default/ringbuffer.h index 03fb37a6a2..8571a9f3d4 100644 --- a/wifi/1.5/default/ringbuffer.h +++ b/wifi/1.6/default/ringbuffer.h @@ -23,14 +23,14 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { /** * Ringbuffer object used to store debug data. */ class Ringbuffer { - public: + public: explicit Ringbuffer(size_t maxSize); // Appends the data buffer and deletes from the front until buffer is @@ -39,14 +39,14 @@ class Ringbuffer { const std::list>& getData() const; void clear(); - private: + private: std::list> data_; size_t size_; size_t maxSize_; }; } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/service.cpp b/wifi/1.6/default/service.cpp similarity index 63% rename from wifi/1.5/default/service.cpp rename to wifi/1.6/default/service.cpp index 3de49b29bb..c874d8b199 100644 --- a/wifi/1.5/default/service.cpp +++ b/wifi/1.6/default/service.cpp @@ -30,13 +30,10 @@ using android::hardware::configureRpcThreadpool; using android::hardware::joinRpcThreadpool; using android::hardware::LazyServiceRegistrar; -using android::hardware::wifi::V1_5::implementation::feature_flags:: - WifiFeatureFlags; -using android::hardware::wifi::V1_5::implementation::legacy_hal::WifiLegacyHal; -using android::hardware::wifi::V1_5::implementation::legacy_hal:: - WifiLegacyHalFactory; -using android::hardware::wifi::V1_5::implementation::mode_controller:: - WifiModeController; +using android::hardware::wifi::V1_6::implementation::feature_flags::WifiFeatureFlags; +using android::hardware::wifi::V1_6::implementation::legacy_hal::WifiLegacyHal; +using android::hardware::wifi::V1_6::implementation::legacy_hal::WifiLegacyHalFactory; +using android::hardware::wifi::V1_6::implementation::mode_controller::WifiModeController; #ifdef LAZY_SERVICE const bool kLazyService = true; @@ -46,30 +43,25 @@ const bool kLazyService = false; int main(int /*argc*/, char** argv) { signal(SIGPIPE, SIG_IGN); - android::base::InitLogging( - argv, android::base::LogdLogger(android::base::SYSTEM)); + android::base::InitLogging(argv, android::base::LogdLogger(android::base::SYSTEM)); LOG(INFO) << "Wifi Hal is booting up..."; configureRpcThreadpool(1, true /* callerWillJoin */); - const auto iface_tool = - std::make_shared(); - const auto legacy_hal_factory = - std::make_shared(iface_tool); + const auto iface_tool = std::make_shared(); + const auto legacy_hal_factory = std::make_shared(iface_tool); // Setup hwbinder service - android::sp service = - new android::hardware::wifi::V1_5::implementation::Wifi( - iface_tool, legacy_hal_factory, - std::make_shared(), - std::make_shared()); + android::sp service = + new android::hardware::wifi::V1_6::implementation::Wifi( + iface_tool, legacy_hal_factory, std::make_shared(), + std::make_shared()); if (kLazyService) { auto registrar = LazyServiceRegistrar::getInstance(); CHECK_EQ(registrar.registerService(service), android::NO_ERROR) - << "Failed to register wifi HAL"; + << "Failed to register wifi HAL"; } else { - CHECK_EQ(service->registerAsService(), android::NO_ERROR) - << "Failed to register wifi HAL"; + CHECK_EQ(service->registerAsService(), android::NO_ERROR) << "Failed to register wifi HAL"; } joinRpcThreadpool(); diff --git a/wifi/1.5/default/tests/hidl_struct_util_unit_tests.cpp b/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp similarity index 74% rename from wifi/1.5/default/tests/hidl_struct_util_unit_tests.cpp rename to wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp index 4b4ebd6138..1182a58dbd 100644 --- a/wifi/1.5/default/tests/hidl_struct_util_unit_tests.cpp +++ b/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp @@ -34,7 +34,7 @@ constexpr char kIfaceName2[] = "wlan1"; namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { using namespace android::hardware::wifi::V1_0; using ::android::hardware::wifi::V1_0::WifiChannelWidthInMhz; @@ -44,21 +44,17 @@ class HidlStructUtilTest : public Test {}; TEST_F(HidlStructUtilTest, CanConvertLegacyWifiMacInfosToHidlWithOneMac) { std::vector legacy_mac_infos; legacy_hal::WifiMacInfo legacy_mac_info1 = { - .wlan_mac_id = kMacId1, - .mac_band = - legacy_hal::WLAN_MAC_5_0_BAND | legacy_hal::WLAN_MAC_2_4_BAND}; - legacy_hal::WifiIfaceInfo legacy_iface_info1 = {.name = kIfaceName1, - .channel = kIfaceChannel1}; - legacy_hal::WifiIfaceInfo legacy_iface_info2 = {.name = kIfaceName2, - .channel = kIfaceChannel2}; + .wlan_mac_id = kMacId1, + .mac_band = legacy_hal::WLAN_MAC_5_0_BAND | legacy_hal::WLAN_MAC_2_4_BAND}; + legacy_hal::WifiIfaceInfo legacy_iface_info1 = {.name = kIfaceName1, .channel = kIfaceChannel1}; + legacy_hal::WifiIfaceInfo legacy_iface_info2 = {.name = kIfaceName2, .channel = kIfaceChannel2}; legacy_mac_info1.iface_infos.push_back(legacy_iface_info1); legacy_mac_info1.iface_infos.push_back(legacy_iface_info2); legacy_mac_infos.push_back(legacy_mac_info1); - std::vector - hidl_radio_mode_infos; - ASSERT_TRUE(hidl_struct_util::convertLegacyWifiMacInfosToHidl( - legacy_mac_infos, &hidl_radio_mode_infos)); + std::vector hidl_radio_mode_infos; + ASSERT_TRUE(hidl_struct_util::convertLegacyWifiMacInfosToHidl(legacy_mac_infos, + &hidl_radio_mode_infos)); ASSERT_EQ(1u, hidl_radio_mode_infos.size()); auto hidl_radio_mode_info1 = hidl_radio_mode_infos[0]; @@ -67,65 +63,56 @@ TEST_F(HidlStructUtilTest, CanConvertLegacyWifiMacInfosToHidlWithOneMac) { ASSERT_EQ(2u, hidl_radio_mode_info1.ifaceInfos.size()); auto hidl_iface_info1 = hidl_radio_mode_info1.ifaceInfos[0]; EXPECT_EQ(legacy_iface_info1.name, hidl_iface_info1.name); - EXPECT_EQ(static_cast(legacy_iface_info1.channel), - hidl_iface_info1.channel); + EXPECT_EQ(static_cast(legacy_iface_info1.channel), hidl_iface_info1.channel); auto hidl_iface_info2 = hidl_radio_mode_info1.ifaceInfos[1]; EXPECT_EQ(legacy_iface_info2.name, hidl_iface_info2.name); - EXPECT_EQ(static_cast(legacy_iface_info2.channel), - hidl_iface_info2.channel); + EXPECT_EQ(static_cast(legacy_iface_info2.channel), hidl_iface_info2.channel); } TEST_F(HidlStructUtilTest, CanConvertLegacyWifiMacInfosToHidlWithTwoMac) { std::vector legacy_mac_infos; - legacy_hal::WifiMacInfo legacy_mac_info1 = { - .wlan_mac_id = kMacId1, .mac_band = legacy_hal::WLAN_MAC_5_0_BAND}; - legacy_hal::WifiIfaceInfo legacy_iface_info1 = {.name = kIfaceName1, - .channel = kIfaceChannel1}; - legacy_hal::WifiMacInfo legacy_mac_info2 = { - .wlan_mac_id = kMacId2, .mac_band = legacy_hal::WLAN_MAC_2_4_BAND}; - legacy_hal::WifiIfaceInfo legacy_iface_info2 = {.name = kIfaceName2, - .channel = kIfaceChannel2}; + legacy_hal::WifiMacInfo legacy_mac_info1 = {.wlan_mac_id = kMacId1, + .mac_band = legacy_hal::WLAN_MAC_5_0_BAND}; + legacy_hal::WifiIfaceInfo legacy_iface_info1 = {.name = kIfaceName1, .channel = kIfaceChannel1}; + legacy_hal::WifiMacInfo legacy_mac_info2 = {.wlan_mac_id = kMacId2, + .mac_band = legacy_hal::WLAN_MAC_2_4_BAND}; + legacy_hal::WifiIfaceInfo legacy_iface_info2 = {.name = kIfaceName2, .channel = kIfaceChannel2}; legacy_mac_info1.iface_infos.push_back(legacy_iface_info1); legacy_mac_infos.push_back(legacy_mac_info1); legacy_mac_info2.iface_infos.push_back(legacy_iface_info2); legacy_mac_infos.push_back(legacy_mac_info2); - std::vector - hidl_radio_mode_infos; - ASSERT_TRUE(hidl_struct_util::convertLegacyWifiMacInfosToHidl( - legacy_mac_infos, &hidl_radio_mode_infos)); + std::vector hidl_radio_mode_infos; + ASSERT_TRUE(hidl_struct_util::convertLegacyWifiMacInfosToHidl(legacy_mac_infos, + &hidl_radio_mode_infos)); ASSERT_EQ(2u, hidl_radio_mode_infos.size()); // Find mac info 1. const auto hidl_radio_mode_info1 = - std::find_if(hidl_radio_mode_infos.begin(), hidl_radio_mode_infos.end(), - [&legacy_mac_info1]( - const V1_4::IWifiChipEventCallback::RadioModeInfo& x) { - return x.radioId == legacy_mac_info1.wlan_mac_id; - }); + std::find_if(hidl_radio_mode_infos.begin(), hidl_radio_mode_infos.end(), + [&legacy_mac_info1](const V1_4::IWifiChipEventCallback::RadioModeInfo& x) { + return x.radioId == legacy_mac_info1.wlan_mac_id; + }); ASSERT_NE(hidl_radio_mode_infos.end(), hidl_radio_mode_info1); EXPECT_EQ(V1_4::WifiBand::BAND_5GHZ, hidl_radio_mode_info1->bandInfo); ASSERT_EQ(1u, hidl_radio_mode_info1->ifaceInfos.size()); auto hidl_iface_info1 = hidl_radio_mode_info1->ifaceInfos[0]; EXPECT_EQ(legacy_iface_info1.name, hidl_iface_info1.name); - EXPECT_EQ(static_cast(legacy_iface_info1.channel), - hidl_iface_info1.channel); + EXPECT_EQ(static_cast(legacy_iface_info1.channel), hidl_iface_info1.channel); // Find mac info 2. const auto hidl_radio_mode_info2 = - std::find_if(hidl_radio_mode_infos.begin(), hidl_radio_mode_infos.end(), - [&legacy_mac_info2]( - const V1_4::IWifiChipEventCallback::RadioModeInfo& x) { - return x.radioId == legacy_mac_info2.wlan_mac_id; - }); + std::find_if(hidl_radio_mode_infos.begin(), hidl_radio_mode_infos.end(), + [&legacy_mac_info2](const V1_4::IWifiChipEventCallback::RadioModeInfo& x) { + return x.radioId == legacy_mac_info2.wlan_mac_id; + }); ASSERT_NE(hidl_radio_mode_infos.end(), hidl_radio_mode_info2); EXPECT_EQ(V1_4::WifiBand::BAND_24GHZ, hidl_radio_mode_info2->bandInfo); ASSERT_EQ(1u, hidl_radio_mode_info2->ifaceInfos.size()); auto hidl_iface_info2 = hidl_radio_mode_info2->ifaceInfos[0]; EXPECT_EQ(legacy_iface_info2.name, hidl_iface_info2.name); - EXPECT_EQ(static_cast(legacy_iface_info2.channel), - hidl_iface_info2.channel); + EXPECT_EQ(static_cast(legacy_iface_info2.channel), hidl_iface_info2.channel); } TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { @@ -143,8 +130,7 @@ TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_min = rand(); legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_max = rand(); legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_avg = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_num_samples = - rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_num_samples = rand(); legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].rx_mpdu = rand(); legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].tx_mpdu = rand(); @@ -153,8 +139,7 @@ TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_min = rand(); legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_max = rand(); legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_avg = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_num_samples = - rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_num_samples = rand(); legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].rx_mpdu = rand(); legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].tx_mpdu = rand(); @@ -163,8 +148,7 @@ TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_min = rand(); legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_max = rand(); legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_avg = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_num_samples = - rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_num_samples = rand(); legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].rx_mpdu = rand(); legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].tx_mpdu = rand(); @@ -173,8 +157,7 @@ TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_min = rand(); legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_max = rand(); legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_avg = rand(); - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_num_samples = - rand(); + legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_num_samples = rand(); legacy_stats.iface.info.time_slicing_duty_cycle_percent = rand(); legacy_stats.iface.num_peers = 1; @@ -195,14 +178,14 @@ TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { } legacy_hal::wifi_channel_stat channel_stat1 = { - .channel = {legacy_hal::WIFI_CHAN_WIDTH_20, 2437, 2437, 0}, - .on_time = 0x1111, - .cca_busy_time = 0x55, + .channel = {legacy_hal::WIFI_CHAN_WIDTH_20, 2437, 2437, 0}, + .on_time = 0x1111, + .cca_busy_time = 0x55, }; legacy_hal::wifi_channel_stat channel_stat2 = { - .channel = {legacy_hal::WIFI_CHAN_WIDTH_20, 5180, 5180, 0}, - .on_time = 0x2222, - .cca_busy_time = 0x66, + .channel = {legacy_hal::WIFI_CHAN_WIDTH_20, 5180, 5180, 0}, + .on_time = 0x2222, + .cca_busy_time = 0x66, }; radio.channel_stats.push_back(channel_stat1); radio.channel_stats.push_back(channel_stat2); @@ -212,30 +195,29 @@ TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { peer.peer_info.bssload.sta_count = rand(); peer.peer_info.bssload.chan_util = rand(); wifi_rate_stat rate_stat1 = { - .rate = {3, 1, 2, 5, 0, 0}, - .tx_mpdu = 0, - .rx_mpdu = 1, - .mpdu_lost = 2, - .retries = 3, - .retries_short = 4, - .retries_long = 5, + .rate = {3, 1, 2, 5, 0, 0}, + .tx_mpdu = 0, + .rx_mpdu = 1, + .mpdu_lost = 2, + .retries = 3, + .retries_short = 4, + .retries_long = 5, }; wifi_rate_stat rate_stat2 = { - .rate = {2, 2, 1, 6, 0, 1}, - .tx_mpdu = 6, - .rx_mpdu = 7, - .mpdu_lost = 8, - .retries = 9, - .retries_short = 10, - .retries_long = 11, + .rate = {2, 2, 1, 6, 0, 1}, + .tx_mpdu = 6, + .rx_mpdu = 7, + .mpdu_lost = 8, + .retries = 9, + .retries_short = 10, + .retries_long = 11, }; peer.rate_stats.push_back(rate_stat1); peer.rate_stats.push_back(rate_stat2); } V1_5::StaLinkLayerStats converted{}; - hidl_struct_util::convertLegacyLinkLayerStatsToHidl(legacy_stats, - &converted); + hidl_struct_util::convertLegacyLinkLayerStatsToHidl(legacy_stats, &converted); EXPECT_EQ(legacy_stats.iface.beacon_rx, converted.iface.V1_0.beaconRx); EXPECT_EQ(legacy_stats.iface.rssi_mgmt, converted.iface.V1_0.avgRssiMgmt); EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].rx_mpdu, @@ -252,9 +234,8 @@ TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { converted.iface.wmeBeContentionTimeStats.contentionTimeMaxInUsec); EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_time_avg, converted.iface.wmeBeContentionTimeStats.contentionTimeAvgInUsec); - EXPECT_EQ( - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_num_samples, - converted.iface.wmeBeContentionTimeStats.contentionNumSamples); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BE].contention_num_samples, + converted.iface.wmeBeContentionTimeStats.contentionNumSamples); EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].rx_mpdu, converted.iface.V1_0.wmeBkPktStats.rxMpdu); @@ -270,9 +251,8 @@ TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { converted.iface.wmeBkContentionTimeStats.contentionTimeMaxInUsec); EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_time_avg, converted.iface.wmeBkContentionTimeStats.contentionTimeAvgInUsec); - EXPECT_EQ( - legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_num_samples, - converted.iface.wmeBkContentionTimeStats.contentionNumSamples); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_BK].contention_num_samples, + converted.iface.wmeBkContentionTimeStats.contentionNumSamples); EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].rx_mpdu, converted.iface.V1_0.wmeViPktStats.rxMpdu); @@ -288,9 +268,8 @@ TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { converted.iface.wmeViContentionTimeStats.contentionTimeMaxInUsec); EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_time_avg, converted.iface.wmeViContentionTimeStats.contentionTimeAvgInUsec); - EXPECT_EQ( - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_num_samples, - converted.iface.wmeViContentionTimeStats.contentionNumSamples); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VI].contention_num_samples, + converted.iface.wmeViContentionTimeStats.contentionNumSamples); EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].rx_mpdu, converted.iface.V1_0.wmeVoPktStats.rxMpdu); @@ -306,29 +285,23 @@ TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { converted.iface.wmeVoContentionTimeStats.contentionTimeMaxInUsec); EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_time_avg, converted.iface.wmeVoContentionTimeStats.contentionTimeAvgInUsec); - EXPECT_EQ( - legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_num_samples, - converted.iface.wmeVoContentionTimeStats.contentionNumSamples); + EXPECT_EQ(legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].contention_num_samples, + converted.iface.wmeVoContentionTimeStats.contentionNumSamples); EXPECT_EQ(legacy_stats.iface.info.time_slicing_duty_cycle_percent, converted.iface.timeSliceDutyCycleInPercent); EXPECT_EQ(legacy_stats.radios.size(), converted.radios.size()); for (size_t i = 0; i < legacy_stats.radios.size(); i++) { - EXPECT_EQ(legacy_stats.radios[i].stats.radio, - converted.radios[i].radioId); - EXPECT_EQ(legacy_stats.radios[i].stats.on_time, - converted.radios[i].V1_3.V1_0.onTimeInMs); - EXPECT_EQ(legacy_stats.radios[i].stats.tx_time, - converted.radios[i].V1_3.V1_0.txTimeInMs); - EXPECT_EQ(legacy_stats.radios[i].stats.rx_time, - converted.radios[i].V1_3.V1_0.rxTimeInMs); + EXPECT_EQ(legacy_stats.radios[i].stats.radio, converted.radios[i].radioId); + EXPECT_EQ(legacy_stats.radios[i].stats.on_time, converted.radios[i].V1_3.V1_0.onTimeInMs); + EXPECT_EQ(legacy_stats.radios[i].stats.tx_time, converted.radios[i].V1_3.V1_0.txTimeInMs); + EXPECT_EQ(legacy_stats.radios[i].stats.rx_time, converted.radios[i].V1_3.V1_0.rxTimeInMs); EXPECT_EQ(legacy_stats.radios[i].stats.on_time_scan, converted.radios[i].V1_3.V1_0.onTimeInMsForScan); EXPECT_EQ(legacy_stats.radios[i].tx_time_per_levels.size(), converted.radios[i].V1_3.V1_0.txTimeInMsPerLevel.size()); - for (size_t j = 0; j < legacy_stats.radios[i].tx_time_per_levels.size(); - j++) { + for (size_t j = 0; j < legacy_stats.radios[i].tx_time_per_levels.size(); j++) { EXPECT_EQ(legacy_stats.radios[i].tx_time_per_levels[j], converted.radios[i].V1_3.V1_0.txTimeInMsPerLevel[j]); } @@ -344,20 +317,16 @@ TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { converted.radios[i].V1_3.onTimeInMsForHs20Scan); EXPECT_EQ(legacy_stats.radios[i].channel_stats.size(), converted.radios[i].V1_3.channelStats.size()); - for (size_t k = 0; k < legacy_stats.radios[i].channel_stats.size(); - k++) { + for (size_t k = 0; k < legacy_stats.radios[i].channel_stats.size(); k++) { auto& legacy_channel_st = legacy_stats.radios[i].channel_stats[k]; EXPECT_EQ(WifiChannelWidthInMhz::WIDTH_20, converted.radios[i].V1_3.channelStats[k].channel.width); - EXPECT_EQ( - WifiChannelInMhz(legacy_channel_st.channel.center_freq), - converted.radios[i].V1_3.channelStats[k].channel.centerFreq); - EXPECT_EQ( - WifiChannelInMhz(legacy_channel_st.channel.center_freq0), - converted.radios[i].V1_3.channelStats[k].channel.centerFreq0); - EXPECT_EQ( - WifiChannelInMhz(legacy_channel_st.channel.center_freq1), - converted.radios[i].V1_3.channelStats[k].channel.centerFreq1); + EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq), + converted.radios[i].V1_3.channelStats[k].channel.centerFreq); + EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq0), + converted.radios[i].V1_3.channelStats[k].channel.centerFreq0); + EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq1), + converted.radios[i].V1_3.channelStats[k].channel.centerFreq1); EXPECT_EQ(legacy_channel_st.cca_busy_time, converted.radios[i].V1_3.channelStats[k].ccaBusyTimeInMs); EXPECT_EQ(legacy_channel_st.on_time, @@ -373,18 +342,13 @@ TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { converted.iface.peers[i].chanUtil); for (size_t j = 0; j < legacy_stats.peers[i].rate_stats.size(); j++) { EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rate.preamble, - (uint32_t)converted.iface.peers[i] - .rateStats[j] - .rateInfo.preamble); - EXPECT_EQ( - legacy_stats.peers[i].rate_stats[j].rate.nss, - (uint32_t)converted.iface.peers[i].rateStats[j].rateInfo.nss); - EXPECT_EQ( - legacy_stats.peers[i].rate_stats[j].rate.bw, - (uint32_t)converted.iface.peers[i].rateStats[j].rateInfo.bw); - EXPECT_EQ( - legacy_stats.peers[i].rate_stats[j].rate.rateMcsIdx, - converted.iface.peers[i].rateStats[j].rateInfo.rateMcsIdx); + (uint32_t)converted.iface.peers[i].rateStats[j].rateInfo.preamble); + EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rate.nss, + (uint32_t)converted.iface.peers[i].rateStats[j].rateInfo.nss); + EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rate.bw, + (uint32_t)converted.iface.peers[i].rateStats[j].rateInfo.bw); + EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rate.rateMcsIdx, + converted.iface.peers[i].rateStats[j].rateInfo.rateMcsIdx); EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].tx_mpdu, converted.iface.peers[i].rateStats[j].txMpdu); EXPECT_EQ(legacy_stats.peers[i].rate_stats[j].rx_mpdu, @@ -402,23 +366,20 @@ TEST_F(HidlStructUtilTest, CanConvertLegacyFeaturesToHidl) { uint32_t hidle_caps; - uint32_t legacy_feature_set = - WIFI_FEATURE_D2D_RTT | WIFI_FEATURE_SET_LATENCY_MODE; - uint32_t legacy_logger_feature_set = - legacy_hal::WIFI_LOGGER_DRIVER_DUMP_SUPPORTED; + uint32_t legacy_feature_set = WIFI_FEATURE_D2D_RTT | WIFI_FEATURE_SET_LATENCY_MODE; + uint32_t legacy_logger_feature_set = legacy_hal::WIFI_LOGGER_DRIVER_DUMP_SUPPORTED; ASSERT_TRUE(hidl_struct_util::convertLegacyFeaturesToHidlChipCapabilities( - legacy_feature_set, legacy_logger_feature_set, &hidle_caps)); + legacy_feature_set, legacy_logger_feature_set, &hidle_caps)); EXPECT_EQ(HidlChipCaps::DEBUG_RING_BUFFER_VENDOR_DATA | - HidlChipCaps::DEBUG_HOST_WAKE_REASON_STATS | - HidlChipCaps::DEBUG_ERROR_ALERTS | HidlChipCaps::D2D_RTT | - HidlChipCaps::SET_LATENCY_MODE | - HidlChipCaps::DEBUG_MEMORY_DRIVER_DUMP, + HidlChipCaps::DEBUG_HOST_WAKE_REASON_STATS | + HidlChipCaps::DEBUG_ERROR_ALERTS | HidlChipCaps::D2D_RTT | + HidlChipCaps::SET_LATENCY_MODE | HidlChipCaps::DEBUG_MEMORY_DRIVER_DUMP, hidle_caps); } } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/tests/main.cpp b/wifi/1.6/default/tests/main.cpp similarity index 100% rename from wifi/1.5/default/tests/main.cpp rename to wifi/1.6/default/tests/main.cpp diff --git a/wifi/1.5/default/tests/mock_interface_tool.cpp b/wifi/1.6/default/tests/mock_interface_tool.cpp similarity index 100% rename from wifi/1.5/default/tests/mock_interface_tool.cpp rename to wifi/1.6/default/tests/mock_interface_tool.cpp diff --git a/wifi/1.5/default/tests/mock_interface_tool.h b/wifi/1.6/default/tests/mock_interface_tool.h similarity index 83% rename from wifi/1.5/default/tests/mock_interface_tool.h rename to wifi/1.6/default/tests/mock_interface_tool.h index 0f17551f96..7ce3992c7e 100644 --- a/wifi/1.5/default/tests/mock_interface_tool.h +++ b/wifi/1.6/default/tests/mock_interface_tool.h @@ -24,17 +24,15 @@ namespace android { namespace wifi_system { class MockInterfaceTool : public InterfaceTool { - public: + public: MockInterfaceTool(); MOCK_METHOD1(GetUpState, bool(const char* if_name)); MOCK_METHOD2(SetUpState, bool(const char* if_name, bool request_up)); MOCK_METHOD1(SetWifiUpState, bool(bool request_up)); MOCK_METHOD2(SetMacAddress, - bool(const char* if_name, - const std::array& address)); - MOCK_METHOD1(GetFactoryMacAddress, - std::array(const char* if_name)); + bool(const char* if_name, const std::array& address)); + MOCK_METHOD1(GetFactoryMacAddress, std::array(const char* if_name)); }; // class MockInterfaceTool diff --git a/wifi/1.5/default/tests/mock_wifi_feature_flags.cpp b/wifi/1.6/default/tests/mock_wifi_feature_flags.cpp similarity index 96% rename from wifi/1.5/default/tests/mock_wifi_feature_flags.cpp rename to wifi/1.6/default/tests/mock_wifi_feature_flags.cpp index 2f66ba121b..d10b74c3a0 100644 --- a/wifi/1.5/default/tests/mock_wifi_feature_flags.cpp +++ b/wifi/1.6/default/tests/mock_wifi_feature_flags.cpp @@ -21,7 +21,7 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace feature_flags { @@ -29,7 +29,7 @@ MockWifiFeatureFlags::MockWifiFeatureFlags() {} } // namespace feature_flags } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/tests/mock_wifi_feature_flags.h b/wifi/1.6/default/tests/mock_wifi_feature_flags.h similarity index 89% rename from wifi/1.5/default/tests/mock_wifi_feature_flags.h rename to wifi/1.6/default/tests/mock_wifi_feature_flags.h index c3877edd60..fa3600a4b1 100644 --- a/wifi/1.5/default/tests/mock_wifi_feature_flags.h +++ b/wifi/1.6/default/tests/mock_wifi_feature_flags.h @@ -25,22 +25,21 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace feature_flags { class MockWifiFeatureFlags : public WifiFeatureFlags { - public: + public: MockWifiFeatureFlags(); - MOCK_METHOD1(getChipModes, - std::vector(bool is_primary)); + MOCK_METHOD1(getChipModes, std::vector(bool is_primary)); MOCK_METHOD0(isApMacRandomizationDisabled, bool()); }; } // namespace feature_flags } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/tests/mock_wifi_iface_util.cpp b/wifi/1.6/default/tests/mock_wifi_iface_util.cpp similarity index 82% rename from wifi/1.5/default/tests/mock_wifi_iface_util.cpp rename to wifi/1.6/default/tests/mock_wifi_iface_util.cpp index b101c4ac34..24b16cb469 100644 --- a/wifi/1.5/default/tests/mock_wifi_iface_util.cpp +++ b/wifi/1.6/default/tests/mock_wifi_iface_util.cpp @@ -24,17 +24,16 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace iface_util { -MockWifiIfaceUtil::MockWifiIfaceUtil( - const std::weak_ptr iface_tool, - const std::weak_ptr legacy_hal) +MockWifiIfaceUtil::MockWifiIfaceUtil(const std::weak_ptr iface_tool, + const std::weak_ptr legacy_hal) : WifiIfaceUtil(iface_tool, legacy_hal) {} } // namespace iface_util } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/tests/mock_wifi_iface_util.h b/wifi/1.6/default/tests/mock_wifi_iface_util.h similarity index 71% rename from wifi/1.5/default/tests/mock_wifi_iface_util.h rename to wifi/1.6/default/tests/mock_wifi_iface_util.h index 6d5f59ce53..2701c36d76 100644 --- a/wifi/1.5/default/tests/mock_wifi_iface_util.h +++ b/wifi/1.6/default/tests/mock_wifi_iface_util.h @@ -24,29 +24,25 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace iface_util { class MockWifiIfaceUtil : public WifiIfaceUtil { - public: - MockWifiIfaceUtil( - const std::weak_ptr iface_tool, - const std::weak_ptr legacy_hal); - MOCK_METHOD1(getFactoryMacAddress, - std::array(const std::string&)); - MOCK_METHOD2(setMacAddress, - bool(const std::string&, const std::array&)); + public: + MockWifiIfaceUtil(const std::weak_ptr iface_tool, + const std::weak_ptr legacy_hal); + MOCK_METHOD1(getFactoryMacAddress, std::array(const std::string&)); + MOCK_METHOD2(setMacAddress, bool(const std::string&, const std::array&)); MOCK_METHOD0(getOrCreateRandomMacAddress, std::array()); - MOCK_METHOD2(registerIfaceEventHandlers, - void(const std::string&, IfaceEventHandlers)); + MOCK_METHOD2(registerIfaceEventHandlers, void(const std::string&, IfaceEventHandlers)); MOCK_METHOD1(unregisterIfaceEventHandlers, void(const std::string&)); MOCK_METHOD2(setUpState, bool(const std::string&, bool)); MOCK_METHOD1(ifNameToIndex, unsigned(const std::string&)); }; } // namespace iface_util } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/tests/mock_wifi_legacy_hal.cpp b/wifi/1.6/default/tests/mock_wifi_legacy_hal.cpp similarity index 84% rename from wifi/1.5/default/tests/mock_wifi_legacy_hal.cpp rename to wifi/1.6/default/tests/mock_wifi_legacy_hal.cpp index d13c5568b3..2c558612e3 100644 --- a/wifi/1.5/default/tests/mock_wifi_legacy_hal.cpp +++ b/wifi/1.6/default/tests/mock_wifi_legacy_hal.cpp @@ -24,17 +24,16 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace legacy_hal { -MockWifiLegacyHal::MockWifiLegacyHal( - const std::weak_ptr iface_tool, - const wifi_hal_fn& fn, bool is_primary) +MockWifiLegacyHal::MockWifiLegacyHal(const std::weak_ptr iface_tool, + const wifi_hal_fn& fn, bool is_primary) : WifiLegacyHal(iface_tool, fn, is_primary) {} } // namespace legacy_hal } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/tests/mock_wifi_legacy_hal.h b/wifi/1.6/default/tests/mock_wifi_legacy_hal.h similarity index 56% rename from wifi/1.5/default/tests/mock_wifi_legacy_hal.h rename to wifi/1.6/default/tests/mock_wifi_legacy_hal.h index 826b35f8dd..b1f53273ba 100644 --- a/wifi/1.5/default/tests/mock_wifi_legacy_hal.h +++ b/wifi/1.6/default/tests/mock_wifi_legacy_hal.h @@ -24,49 +24,42 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace legacy_hal { class MockWifiLegacyHal : public WifiLegacyHal { - public: - MockWifiLegacyHal( - const std::weak_ptr iface_tool, - const wifi_hal_fn& fn, bool is_primary); + public: + MockWifiLegacyHal(const std::weak_ptr iface_tool, + const wifi_hal_fn& fn, bool is_primary); MOCK_METHOD0(initialize, wifi_error()); MOCK_METHOD0(start, wifi_error()); - MOCK_METHOD2(stop, wifi_error(std::unique_lock*, - const std::function&)); + MOCK_METHOD2(stop, + wifi_error(std::unique_lock*, const std::function&)); MOCK_METHOD2(setDfsFlag, wifi_error(const std::string&, bool)); MOCK_METHOD2(registerRadioModeChangeCallbackHandler, - wifi_error(const std::string&, - const on_radio_mode_change_callback&)); - MOCK_METHOD1(getFirmwareVersion, std::pair( - const std::string& iface_name)); - MOCK_METHOD1(getDriverVersion, std::pair( - const std::string& iface_name)); + wifi_error(const std::string&, const on_radio_mode_change_callback&)); + MOCK_METHOD1(getFirmwareVersion, + std::pair(const std::string& iface_name)); + MOCK_METHOD1(getDriverVersion, + std::pair(const std::string& iface_name)); MOCK_METHOD2(selectTxPowerScenario, - wifi_error(const std::string& iface_name, - wifi_power_scenario scenario)); - MOCK_METHOD1(resetTxPowerScenario, - wifi_error(const std::string& iface_name)); + wifi_error(const std::string& iface_name, wifi_power_scenario scenario)); + MOCK_METHOD1(resetTxPowerScenario, wifi_error(const std::string& iface_name)); MOCK_METHOD2(nanRegisterCallbackHandlers, wifi_error(const std::string&, const NanCallbackHandlers&)); - MOCK_METHOD2(nanDisableRequest, - wifi_error(const std::string&, transaction_id)); + MOCK_METHOD2(nanDisableRequest, wifi_error(const std::string&, transaction_id)); MOCK_METHOD3(nanDataInterfaceDelete, - wifi_error(const std::string&, transaction_id, - const std::string&)); + wifi_error(const std::string&, transaction_id, const std::string&)); MOCK_METHOD2(createVirtualInterface, - wifi_error(const std::string& ifname, - wifi_interface_type iftype)); + wifi_error(const std::string& ifname, wifi_interface_type iftype)); MOCK_METHOD1(deleteVirtualInterface, wifi_error(const std::string& ifname)); MOCK_METHOD0(waitForDriverReady, wifi_error()); }; } // namespace legacy_hal } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/tests/mock_wifi_mode_controller.cpp b/wifi/1.6/default/tests/mock_wifi_mode_controller.cpp similarity index 96% rename from wifi/1.5/default/tests/mock_wifi_mode_controller.cpp rename to wifi/1.6/default/tests/mock_wifi_mode_controller.cpp index e7ab22a01b..446f8296f8 100644 --- a/wifi/1.5/default/tests/mock_wifi_mode_controller.cpp +++ b/wifi/1.6/default/tests/mock_wifi_mode_controller.cpp @@ -24,14 +24,14 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace mode_controller { MockWifiModeController::MockWifiModeController() : WifiModeController() {} } // namespace mode_controller } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/tests/mock_wifi_mode_controller.h b/wifi/1.6/default/tests/mock_wifi_mode_controller.h similarity index 96% rename from wifi/1.5/default/tests/mock_wifi_mode_controller.h rename to wifi/1.6/default/tests/mock_wifi_mode_controller.h index b9151f18b4..addcc81591 100644 --- a/wifi/1.5/default/tests/mock_wifi_mode_controller.h +++ b/wifi/1.6/default/tests/mock_wifi_mode_controller.h @@ -24,12 +24,12 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace mode_controller { class MockWifiModeController : public WifiModeController { - public: + public: MockWifiModeController(); MOCK_METHOD0(initialize, bool()); MOCK_METHOD1(changeFirmwareMode, bool(IfaceType)); @@ -38,7 +38,7 @@ class MockWifiModeController : public WifiModeController { }; } // namespace mode_controller } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/tests/ringbuffer_unit_tests.cpp b/wifi/1.6/default/tests/ringbuffer_unit_tests.cpp similarity index 98% rename from wifi/1.5/default/tests/ringbuffer_unit_tests.cpp rename to wifi/1.6/default/tests/ringbuffer_unit_tests.cpp index 6fd34ee29c..eb86194ff0 100644 --- a/wifi/1.5/default/tests/ringbuffer_unit_tests.cpp +++ b/wifi/1.6/default/tests/ringbuffer_unit_tests.cpp @@ -24,11 +24,11 @@ using testing::Test; namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { class RingbufferTest : public Test { - public: + public: const uint32_t maxBufferSize_ = 10; Ringbuffer buffer_{maxBufferSize_}; }; @@ -91,7 +91,7 @@ TEST_F(RingbufferTest, OversizedAppendDoesNotDropExistingData) { EXPECT_EQ(input, buffer_.getData().front()); } } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/tests/runtests.sh b/wifi/1.6/default/tests/runtests.sh similarity index 100% rename from wifi/1.5/default/tests/runtests.sh rename to wifi/1.6/default/tests/runtests.sh diff --git a/wifi/1.5/default/tests/wifi_chip_unit_tests.cpp b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp similarity index 74% rename from wifi/1.5/default/tests/wifi_chip_unit_tests.cpp rename to wifi/1.6/default/tests/wifi_chip_unit_tests.cpp index 0ad6f3e821..53904116cf 100644 --- a/wifi/1.5/default/tests/wifi_chip_unit_tests.cpp +++ b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp @@ -41,11 +41,11 @@ constexpr ChipId kFakeChipId = 5; namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { class WifiChipTest : public Test { - protected: + protected: void setupV1IfaceCombination() { // clang-format off const hidl_vec combinationsSta = { @@ -59,8 +59,7 @@ class WifiChipTest : public Test { {feature_flags::chip_mode_ids::kV1Ap, combinationsAp} }; // clang-format on - EXPECT_CALL(*feature_flags_, getChipModes(true)) - .WillRepeatedly(testing::Return(modes)); + EXPECT_CALL(*feature_flags_, getChipModes(true)).WillRepeatedly(testing::Return(modes)); } void setupV1_AwareIfaceCombination() { @@ -76,8 +75,7 @@ class WifiChipTest : public Test { {feature_flags::chip_mode_ids::kV1Ap, combinationsAp} }; // clang-format on - EXPECT_CALL(*feature_flags_, getChipModes(true)) - .WillRepeatedly(testing::Return(modes)); + EXPECT_CALL(*feature_flags_, getChipModes(true)).WillRepeatedly(testing::Return(modes)); } void setupV1_AwareDisabledApIfaceCombination() { @@ -89,8 +87,7 @@ class WifiChipTest : public Test { {feature_flags::chip_mode_ids::kV1Sta, combinationsSta} }; // clang-format on - EXPECT_CALL(*feature_flags_, getChipModes(true)) - .WillRepeatedly(testing::Return(modes)); + EXPECT_CALL(*feature_flags_, getChipModes(true)).WillRepeatedly(testing::Return(modes)); } void setupV2_AwareIfaceCombination() { @@ -103,8 +100,7 @@ class WifiChipTest : public Test { {feature_flags::chip_mode_ids::kV3, combinations} }; // clang-format on - EXPECT_CALL(*feature_flags_, getChipModes(true)) - .WillRepeatedly(testing::Return(modes)); + EXPECT_CALL(*feature_flags_, getChipModes(true)).WillRepeatedly(testing::Return(modes)); } void setupV2_AwareDisabledApIfaceCombination() { @@ -116,8 +112,7 @@ class WifiChipTest : public Test { {feature_flags::chip_mode_ids::kV3, combinations} }; // clang-format on - EXPECT_CALL(*feature_flags_, getChipModes(true)) - .WillRepeatedly(testing::Return(modes)); + EXPECT_CALL(*feature_flags_, getChipModes(true)).WillRepeatedly(testing::Return(modes)); } void setup_MultiIfaceCombination() { @@ -129,39 +124,35 @@ class WifiChipTest : public Test { {feature_flags::chip_mode_ids::kV3, combinations} }; // clang-format on - EXPECT_CALL(*feature_flags_, getChipModes(true)) - .WillRepeatedly(testing::Return(modes)); + EXPECT_CALL(*feature_flags_, getChipModes(true)).WillRepeatedly(testing::Return(modes)); } void assertNumberOfModes(uint32_t num_modes) { - chip_->getAvailableModes( - [num_modes](const WifiStatus& status, - const std::vector& modes) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - // V2_Aware has 1 mode of operation. - ASSERT_EQ(num_modes, modes.size()); - }); + chip_->getAvailableModes([num_modes](const WifiStatus& status, + const std::vector& modes) { + ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); + // V2_Aware has 1 mode of operation. + ASSERT_EQ(num_modes, modes.size()); + }); } void findModeAndConfigureForIfaceType(const IfaceType& type) { // This should be aligned with kInvalidModeId in wifi_chip.cpp. ChipModeId mode_id = UINT32_MAX; - chip_->getAvailableModes( - [&mode_id, &type](const WifiStatus& status, - const std::vector& modes) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - for (const auto& mode : modes) { - for (const auto& combination : mode.availableCombinations) { - for (const auto& limit : combination.limits) { - if (limit.types.end() != - std::find(limit.types.begin(), - limit.types.end(), type)) { - mode_id = mode.id; - } + chip_->getAvailableModes([&mode_id, &type](const WifiStatus& status, + const std::vector& modes) { + ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); + for (const auto& mode : modes) { + for (const auto& combination : mode.availableCombinations) { + for (const auto& limit : combination.limits) { + if (limit.types.end() != + std::find(limit.types.begin(), limit.types.end(), type)) { + mode_id = mode.id; } } } - }); + } + }); ASSERT_NE(UINT32_MAX, mode_id); chip_->configureChip(mode_id, [](const WifiStatus& status) { @@ -174,58 +165,53 @@ class WifiChipTest : public Test { std::string iface_name; if (type == IfaceType::AP) { chip_->createApIface( - [&iface_name](const WifiStatus& status, - const sp& iface) { - if (WifiStatusCode::SUCCESS == status.code) { - ASSERT_NE(iface.get(), nullptr); - iface->getName([&iface_name](const WifiStatus& status, - const hidl_string& name) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - iface_name = name.c_str(); - }); - } - }); + [&iface_name](const WifiStatus& status, const sp& iface) { + if (WifiStatusCode::SUCCESS == status.code) { + ASSERT_NE(iface.get(), nullptr); + iface->getName([&iface_name](const WifiStatus& status, + const hidl_string& name) { + ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); + iface_name = name.c_str(); + }); + } + }); } else if (type == IfaceType::NAN) { chip_->createNanIface( - [&iface_name]( - const WifiStatus& status, - const sp& - iface) { - if (WifiStatusCode::SUCCESS == status.code) { - ASSERT_NE(iface.get(), nullptr); - iface->getName([&iface_name](const WifiStatus& status, - const hidl_string& name) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - iface_name = name.c_str(); - }); - } - }); + [&iface_name](const WifiStatus& status, + const sp& iface) { + if (WifiStatusCode::SUCCESS == status.code) { + ASSERT_NE(iface.get(), nullptr); + iface->getName([&iface_name](const WifiStatus& status, + const hidl_string& name) { + ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); + iface_name = name.c_str(); + }); + } + }); } else if (type == IfaceType::P2P) { chip_->createP2pIface( - [&iface_name](const WifiStatus& status, - const sp& iface) { - if (WifiStatusCode::SUCCESS == status.code) { - ASSERT_NE(iface.get(), nullptr); - iface->getName([&iface_name](const WifiStatus& status, - const hidl_string& name) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - iface_name = name.c_str(); - }); - } - }); + [&iface_name](const WifiStatus& status, const sp& iface) { + if (WifiStatusCode::SUCCESS == status.code) { + ASSERT_NE(iface.get(), nullptr); + iface->getName([&iface_name](const WifiStatus& status, + const hidl_string& name) { + ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); + iface_name = name.c_str(); + }); + } + }); } else if (type == IfaceType::STA) { chip_->createStaIface( - [&iface_name](const WifiStatus& status, - const sp& iface) { - if (WifiStatusCode::SUCCESS == status.code) { - ASSERT_NE(iface.get(), nullptr); - iface->getName([&iface_name](const WifiStatus& status, - const hidl_string& name) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - iface_name = name.c_str(); - }); - } - }); + [&iface_name](const WifiStatus& status, const sp& iface) { + if (WifiStatusCode::SUCCESS == status.code) { + ASSERT_NE(iface.get(), nullptr); + iface->getName([&iface_name](const WifiStatus& status, + const hidl_string& name) { + ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); + iface_name = name.c_str(); + }); + } + }); } return iface_name; } @@ -253,13 +239,12 @@ class WifiChipTest : public Test { bool createRttController() { bool success = false; chip_->createRttController_1_4( - NULL, [&success](const WifiStatus& status, - const sp& rtt) { - if (WifiStatusCode::SUCCESS == status.code) { - ASSERT_NE(rtt.get(), nullptr); - success = true; - } - }); + NULL, [&success](const WifiStatus& status, const sp& rtt) { + if (WifiStatusCode::SUCCESS == status.code) { + ASSERT_NE(rtt.get(), nullptr); + success = true; + } + }); return success; } @@ -269,27 +254,25 @@ class WifiChipTest : public Test { ChipId chip_id_ = kFakeChipId; legacy_hal::wifi_hal_fn fake_func_table_; std::shared_ptr> iface_tool_{ - new NiceMock}; + new NiceMock}; std::shared_ptr> legacy_hal_{ - new NiceMock(iface_tool_, - fake_func_table_, true)}; - std::shared_ptr> - mode_controller_{new NiceMock}; + new NiceMock(iface_tool_, fake_func_table_, true)}; + std::shared_ptr> mode_controller_{ + new NiceMock}; std::shared_ptr> iface_util_{ - new NiceMock(iface_tool_, legacy_hal_)}; - std::shared_ptr> - feature_flags_{new NiceMock}; + new NiceMock(iface_tool_, legacy_hal_)}; + std::shared_ptr> feature_flags_{ + new NiceMock}; - public: + public: void SetUp() override { - chip_ = - new WifiChip(chip_id_, true, legacy_hal_, mode_controller_, - iface_util_, feature_flags_, subsystemRestartHandler); + chip_ = new WifiChip(chip_id_, true, legacy_hal_, mode_controller_, iface_util_, + feature_flags_, subsystemRestartHandler); EXPECT_CALL(*mode_controller_, changeFirmwareMode(testing::_)) - .WillRepeatedly(testing::Return(true)); + .WillRepeatedly(testing::Return(true)); EXPECT_CALL(*legacy_hal_, start()) - .WillRepeatedly(testing::Return(legacy_hal::WIFI_SUCCESS)); + .WillRepeatedly(testing::Return(legacy_hal::WIFI_SUCCESS)); } void TearDown() override { @@ -305,7 +288,7 @@ class WifiChipTest : public Test { // Mode 1 - STA + P2P // Mode 2 - AP class WifiChipV1IfaceCombinationTest : public WifiChipTest { - public: + public: void SetUp() override { setupV1IfaceCombination(); WifiChipTest::SetUp(); @@ -364,7 +347,7 @@ TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateNan_ShouldFail) { // Mode 1 - STA + P2P/NAN // Mode 2 - AP class WifiChipV1_AwareIfaceCombinationTest : public WifiChipTest { - public: + public: void SetUp() override { setupV1_AwareIfaceCombination(); WifiChipTest::SetUp(); @@ -393,30 +376,26 @@ TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateAp_ShouldFail) { ASSERT_TRUE(createIface(IfaceType::AP).empty()); } -TEST_F(WifiChipV1_AwareIfaceCombinationTest, - StaMode_CreateStaP2p_ShouldSucceed) { +TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2p_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); } -TEST_F(WifiChipV1_AwareIfaceCombinationTest, - StaMode_CreateStaNan_ShouldSucceed) { +TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaNan_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::NAN).empty()); } -TEST_F(WifiChipV1_AwareIfaceCombinationTest, - StaMode_CreateStaP2PNan_ShouldFail) { +TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2PNan_ShouldFail) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); ASSERT_TRUE(createIface(IfaceType::NAN).empty()); } -TEST_F(WifiChipV1_AwareIfaceCombinationTest, - StaMode_CreateStaNan_AfterP2pRemove_ShouldSucceed) { +TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaNan_AfterP2pRemove_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); const auto p2p_iface_name = createIface(IfaceType::P2P); @@ -428,8 +407,7 @@ TEST_F(WifiChipV1_AwareIfaceCombinationTest, ASSERT_FALSE(createIface(IfaceType::NAN).empty()); } -TEST_F(WifiChipV1_AwareIfaceCombinationTest, - StaMode_CreateStaP2p_AfterNanRemove_ShouldSucceed) { +TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2p_AfterNanRemove_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); const auto nan_iface_name = createIface(IfaceType::NAN); @@ -488,31 +466,27 @@ TEST_F(WifiChipV1_AwareIfaceCombinationTest, SelectTxScenarioWithOnlySta) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_)) - .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); + .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); chip_->selectTxPowerScenario_1_2( - V1_2::IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF, - [](const WifiStatus& status) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - }); + V1_2::IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF, + [](const WifiStatus& status) { ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); }); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, SelectTxScenarioWithOnlyAp) { findModeAndConfigureForIfaceType(IfaceType::AP); ASSERT_EQ(createIface(IfaceType::AP), "wlan0"); EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_)) - .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); + .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); chip_->selectTxPowerScenario_1_2( - V1_2::IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF, - [](const WifiStatus& status) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - }); + V1_2::IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF, + [](const WifiStatus& status) { ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); }); } ////////// V2 + Aware Iface Combinations //////////// // Mode 1 - STA + STA/AP // - STA + P2P/NAN class WifiChipV2_AwareIfaceCombinationTest : public WifiChipTest { - public: + public: void SetUp() override { setupV2_AwareIfaceCombination(); WifiChipTest::SetUp(); @@ -559,8 +533,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApSta_ShouldSucceed) { ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); } -TEST_F(WifiChipV2_AwareIfaceCombinationTest, - CreateSta_AfterStaApRemove_ShouldSucceed) { +TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateSta_AfterStaApRemove_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceType::STA); const auto sta_iface_name = createIface(IfaceType::STA); ASSERT_FALSE(sta_iface_name.empty()); @@ -594,8 +567,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2PNan_ShouldFail) { ASSERT_TRUE(createIface(IfaceType::NAN).empty()); } -TEST_F(WifiChipV2_AwareIfaceCombinationTest, - CreateStaNan_AfterP2pRemove_ShouldSucceed) { +TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaNan_AfterP2pRemove_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); const auto p2p_iface_name = createIface(IfaceType::P2P); @@ -607,8 +579,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, ASSERT_FALSE(createIface(IfaceType::NAN).empty()); } -TEST_F(WifiChipV2_AwareIfaceCombinationTest, - CreateStaP2p_AfterNanRemove_ShouldSucceed) { +TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2p_AfterNanRemove_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); const auto nan_iface_name = createIface(IfaceType::NAN); @@ -632,8 +603,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApP2p_ShouldFail) { ASSERT_TRUE(createIface(IfaceType::P2P).empty()); } -TEST_F(WifiChipV2_AwareIfaceCombinationTest, - StaMode_CreateStaNan_AfterP2pRemove_ShouldSucceed) { +TEST_F(WifiChipV2_AwareIfaceCombinationTest, StaMode_CreateStaNan_AfterP2pRemove_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); const auto p2p_iface_name = createIface(IfaceType::P2P); @@ -645,8 +615,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, ASSERT_FALSE(createIface(IfaceType::NAN).empty()); } -TEST_F(WifiChipV2_AwareIfaceCombinationTest, - StaMode_CreateStaP2p_AfterNanRemove_ShouldSucceed) { +TEST_F(WifiChipV2_AwareIfaceCombinationTest, StaMode_CreateStaP2p_AfterNanRemove_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); const auto nan_iface_name = createIface(IfaceType::NAN); @@ -658,8 +627,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, ASSERT_FALSE(createIface(IfaceType::P2P).empty()); } -TEST_F(WifiChipV2_AwareIfaceCombinationTest, - CreateStaAp_EnsureDifferentIfaceNames) { +TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaAp_EnsureDifferentIfaceNames) { findModeAndConfigureForIfaceType(IfaceType::AP); const auto sta_iface_name = createIface(IfaceType::STA); const auto ap_iface_name = createIface(IfaceType::AP); @@ -690,28 +658,23 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, SelectTxScenarioWithOnlySta) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_)) - .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); + .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); chip_->selectTxPowerScenario_1_2( - V1_2::IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF, - [](const WifiStatus& status) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - }); + V1_2::IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF, + [](const WifiStatus& status) { ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); }); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, SelectTxScenarioWithOnlyAp) { findModeAndConfigureForIfaceType(IfaceType::AP); ASSERT_EQ(createIface(IfaceType::AP), "wlan1"); EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan1", testing::_)) - .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); + .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); chip_->selectTxPowerScenario_1_2( - V1_2::IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF, - [](const WifiStatus& status) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - }); + V1_2::IWifiChip::TxPowerScenario::ON_HEAD_CELL_OFF, + [](const WifiStatus& status) { ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); }); } -TEST_F(WifiChipV2_AwareIfaceCombinationTest, - InvalidateAndRemoveNanOnStaRemove) { +TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveNanOnStaRemove) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); @@ -719,64 +682,55 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, ASSERT_EQ(createIface(IfaceType::NAN), "wlan0"); // We should have 1 nan iface. - chip_->getNanIfaceNames( - [](const WifiStatus& status, const hidl_vec& iface_names) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - ASSERT_EQ(iface_names.size(), 1u); - ASSERT_EQ(iface_names[0], "wlan0"); - }); + chip_->getNanIfaceNames([](const WifiStatus& status, const hidl_vec& iface_names) { + ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); + ASSERT_EQ(iface_names.size(), 1u); + ASSERT_EQ(iface_names[0], "wlan0"); + }); // Retrieve the exact iface object. sp nan_iface; - chip_->getNanIface( - "wlan0", - [&nan_iface]( - const WifiStatus& status, - const sp& iface) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - ASSERT_NE(iface.get(), nullptr); - nan_iface = iface; - }); + chip_->getNanIface("wlan0", + [&nan_iface](const WifiStatus& status, + const sp& iface) { + ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); + ASSERT_NE(iface.get(), nullptr); + nan_iface = iface; + }); // Remove the STA iface. removeIface(IfaceType::STA, "wlan0"); // We should have 0 nan iface now. - chip_->getNanIfaceNames( - [](const WifiStatus& status, const hidl_vec& iface_names) { - ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); - ASSERT_EQ(iface_names.size(), 0u); - }); + chip_->getNanIfaceNames([](const WifiStatus& status, const hidl_vec& iface_names) { + ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); + ASSERT_EQ(iface_names.size(), 0u); + }); // Any operation on the nan iface object should return error now. - nan_iface->getName( - [](const WifiStatus& status, const std::string& /* iface_name */) { - ASSERT_EQ(WifiStatusCode::ERROR_WIFI_IFACE_INVALID, status.code); - }); + nan_iface->getName([](const WifiStatus& status, const std::string& /* iface_name */) { + ASSERT_EQ(WifiStatusCode::ERROR_WIFI_IFACE_INVALID, status.code); + }); } -TEST_F(WifiChipV2_AwareIfaceCombinationTest, - InvalidateAndRemoveRttControllerOnStaRemove) { +TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveRttControllerOnStaRemove) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); // Create RTT controller sp rtt_controller; chip_->createRttController_1_4( - NULL, [&rtt_controller](const WifiStatus& status, - const sp& rtt) { - if (WifiStatusCode::SUCCESS == status.code) { - ASSERT_NE(rtt.get(), nullptr); - rtt_controller = rtt; - } - }); + NULL, [&rtt_controller](const WifiStatus& status, const sp& rtt) { + if (WifiStatusCode::SUCCESS == status.code) { + ASSERT_NE(rtt.get(), nullptr); + rtt_controller = rtt; + } + }); // Remove the STA iface. removeIface(IfaceType::STA, "wlan0"); // Any operation on the rtt controller object should return error now. - rtt_controller->getBoundIface( - [](const WifiStatus& status, const sp& /* iface */) { - ASSERT_EQ(WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, - status.code); - }); + rtt_controller->getBoundIface([](const WifiStatus& status, const sp& /* iface */) { + ASSERT_EQ(WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, status.code); + }); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNanWithSharedNanIface) { @@ -792,28 +746,24 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNanWithDedicatedNanIface) { property_set("wifi.aware.interface", "aware0"); findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); - EXPECT_CALL(*iface_util_, ifNameToIndex("aware0")) - .WillOnce(testing::Return(4)); - EXPECT_CALL(*iface_util_, setUpState("aware0", true)) - .WillOnce(testing::Return(true)); + EXPECT_CALL(*iface_util_, ifNameToIndex("aware0")).WillOnce(testing::Return(4)); + EXPECT_CALL(*iface_util_, setUpState("aware0", true)).WillOnce(testing::Return(true)); ASSERT_EQ(createIface(IfaceType::NAN), "aware0"); - EXPECT_CALL(*iface_util_, setUpState("aware0", false)) - .WillOnce(testing::Return(true)); + EXPECT_CALL(*iface_util_, setUpState("aware0", false)).WillOnce(testing::Return(true)); removeIface(IfaceType::NAN, "aware0"); } ////////// V1 Iface Combinations when AP creation is disabled ////////// class WifiChipV1_AwareDisabledApIfaceCombinationTest : public WifiChipTest { - public: + public: void SetUp() override { setupV1_AwareDisabledApIfaceCombination(); WifiChipTest::SetUp(); } }; -TEST_F(WifiChipV1_AwareDisabledApIfaceCombinationTest, - StaMode_CreateSta_ShouldSucceed) { +TEST_F(WifiChipV1_AwareDisabledApIfaceCombinationTest, StaMode_CreateSta_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_TRUE(createIface(IfaceType::AP).empty()); @@ -821,15 +771,14 @@ TEST_F(WifiChipV1_AwareDisabledApIfaceCombinationTest, ////////// V2 Iface Combinations when AP creation is disabled ////////// class WifiChipV2_AwareDisabledApIfaceCombinationTest : public WifiChipTest { - public: + public: void SetUp() override { setupV2_AwareDisabledApIfaceCombination(); WifiChipTest::SetUp(); } }; -TEST_F(WifiChipV2_AwareDisabledApIfaceCombinationTest, - CreateSta_ShouldSucceed) { +TEST_F(WifiChipV2_AwareDisabledApIfaceCombinationTest, CreateSta_ShouldSucceed) { findModeAndConfigureForIfaceType(IfaceType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_TRUE(createIface(IfaceType::AP).empty()); @@ -837,7 +786,7 @@ TEST_F(WifiChipV2_AwareDisabledApIfaceCombinationTest, ////////// Hypothetical Iface Combination with multiple ifaces ////////// class WifiChip_MultiIfaceTest : public WifiChipTest { - public: + public: void SetUp() override { setup_MultiIfaceCombination(); WifiChipTest::SetUp(); @@ -899,7 +848,7 @@ TEST_F(WifiChip_MultiIfaceTest, CreateApStartsWithIdx1) { ASSERT_EQ(createIface(IfaceType::STA), "wlan3"); } } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/tests/wifi_iface_util_unit_tests.cpp b/wifi/1.6/default/tests/wifi_iface_util_unit_tests.cpp similarity index 82% rename from wifi/1.5/default/tests/wifi_iface_util_unit_tests.cpp rename to wifi/1.6/default/tests/wifi_iface_util_unit_tests.cpp index 8b67bb80c8..cc9a3340a5 100644 --- a/wifi/1.5/default/tests/wifi_iface_util_unit_tests.cpp +++ b/wifi/1.6/default/tests/wifi_iface_util_unit_tests.cpp @@ -32,8 +32,7 @@ constexpr uint8_t kValidUnicastLocallyAssignedMacAddressMask = 0x02; constexpr uint8_t kMacAddress[] = {0x02, 0x12, 0x45, 0x56, 0xab, 0xcc}; constexpr char kIfaceName[] = "test-wlan0"; -bool isValidUnicastLocallyAssignedMacAddress( - const std::array& mac_address) { +bool isValidUnicastLocallyAssignedMacAddress(const std::array& mac_address) { uint8_t first_byte = mac_address[0]; return (first_byte & 0x3) == kValidUnicastLocallyAssignedMacAddressMask; } @@ -42,17 +41,16 @@ bool isValidUnicastLocallyAssignedMacAddress( namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace iface_util { class WifiIfaceUtilTest : public Test { - protected: + protected: std::shared_ptr> iface_tool_{ - new NiceMock}; + new NiceMock}; legacy_hal::wifi_hal_fn fake_func_table_; std::shared_ptr> legacy_hal_{ - new NiceMock(iface_tool_, - fake_func_table_, true)}; + new NiceMock(iface_tool_, fake_func_table_, true)}; WifiIfaceUtil* iface_util_ = new WifiIfaceUtil(iface_tool_, legacy_hal_); }; @@ -67,20 +65,17 @@ TEST_F(WifiIfaceUtilTest, GetOrCreateRandomMacAddress) { TEST_F(WifiIfaceUtilTest, IfaceEventHandlers_SetMacAddress) { std::array mac_address = {}; - std::copy(std::begin(kMacAddress), std::end(kMacAddress), - std::begin(mac_address)); + std::copy(std::begin(kMacAddress), std::end(kMacAddress), std::begin(mac_address)); EXPECT_CALL(*iface_tool_, SetMacAddress(testing::_, testing::_)) - .WillRepeatedly(testing::Return(true)); + .WillRepeatedly(testing::Return(true)); EXPECT_CALL(*iface_tool_, SetUpState(testing::_, testing::_)) - .WillRepeatedly(testing::Return(true)); + .WillRepeatedly(testing::Return(true)); // Register for iface state toggle events. bool callback_invoked = false; iface_util::IfaceEventHandlers event_handlers = {}; event_handlers.on_state_toggle_off_on = - [&callback_invoked](const std::string& /* iface_name */) { - callback_invoked = true; - }; + [&callback_invoked](const std::string& /* iface_name */) { callback_invoked = true; }; iface_util_->registerIfaceEventHandlers(kIfaceName, event_handlers); // Invoke setMacAddress and ensure that the cb is invoked. ASSERT_TRUE(iface_util_->setMacAddress(kIfaceName, mac_address)); @@ -95,7 +90,7 @@ TEST_F(WifiIfaceUtilTest, IfaceEventHandlers_SetMacAddress) { } } // namespace iface_util } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp b/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp new file mode 100644 index 0000000000..c7c566bec1 --- /dev/null +++ b/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#undef NAN // This is weird, NAN is defined in bionic/libc/include/math.h:38 +#include "wifi_nan_iface.h" + +#include "mock_interface_tool.h" +#include "mock_wifi_feature_flags.h" +#include "mock_wifi_iface_util.h" +#include "mock_wifi_legacy_hal.h" + +using testing::NiceMock; +using testing::Return; +using testing::Test; + +namespace { +constexpr char kIfaceName[] = "mockWlan0"; +} // namespace + +namespace android { +namespace hardware { +namespace wifi { +namespace V1_6 { +namespace implementation { + +using android::hardware::wifi::V1_2::NanDataPathConfirmInd; + +bool CaptureIfaceEventHandlers(const std::string& /* iface_name*/, + iface_util::IfaceEventHandlers in_iface_event_handlers, + iface_util::IfaceEventHandlers* out_iface_event_handlers) { + *out_iface_event_handlers = in_iface_event_handlers; + return true; +} + +class MockNanIfaceEventCallback : public V1_5::IWifiNanIfaceEventCallback { + public: + MockNanIfaceEventCallback() = default; + + MOCK_METHOD3(notifyCapabilitiesResponse, + Return(uint16_t, const WifiNanStatus&, + const android::hardware::wifi::V1_0::NanCapabilities&)); + MOCK_METHOD2(notifyEnableResponse, Return(uint16_t, const WifiNanStatus&)); + MOCK_METHOD2(notifyConfigResponse, Return(uint16_t, const WifiNanStatus&)); + MOCK_METHOD2(notifyDisableResponse, Return(uint16_t, const WifiNanStatus&)); + MOCK_METHOD3(notifyStartPublishResponse, Return(uint16_t, const WifiNanStatus&, uint8_t)); + MOCK_METHOD2(notifyStopPublishResponse, Return(uint16_t, const WifiNanStatus&)); + MOCK_METHOD3(notifyStartSubscribeResponse, + Return(uint16_t, const WifiNanStatus&, uint8_t)); + MOCK_METHOD2(notifyStopSubscribeResponse, Return(uint16_t, const WifiNanStatus&)); + MOCK_METHOD2(notifyTransmitFollowupResponse, Return(uint16_t, const WifiNanStatus&)); + MOCK_METHOD2(notifyCreateDataInterfaceResponse, Return(uint16_t, const WifiNanStatus&)); + MOCK_METHOD2(notifyDeleteDataInterfaceResponse, Return(uint16_t, const WifiNanStatus&)); + MOCK_METHOD3(notifyInitiateDataPathResponse, + Return(uint16_t, const WifiNanStatus&, uint32_t)); + MOCK_METHOD2(notifyRespondToDataPathIndicationResponse, + Return(uint16_t, const WifiNanStatus&)); + MOCK_METHOD2(notifyTerminateDataPathResponse, Return(uint16_t, const WifiNanStatus&)); + MOCK_METHOD1(eventClusterEvent, Return(const NanClusterEventInd&)); + MOCK_METHOD1(eventDisabled, Return(const WifiNanStatus&)); + MOCK_METHOD2(eventPublishTerminated, Return(uint8_t, const WifiNanStatus&)); + MOCK_METHOD2(eventSubscribeTerminated, Return(uint8_t, const WifiNanStatus&)); + MOCK_METHOD1(eventMatch, Return(const NanMatchInd&)); + MOCK_METHOD2(eventMatchExpired, Return(uint8_t, uint32_t)); + MOCK_METHOD1(eventFollowupReceived, Return(const NanFollowupReceivedInd&)); + MOCK_METHOD2(eventTransmitFollowup, Return(uint16_t, const WifiNanStatus&)); + MOCK_METHOD1(eventDataPathRequest, Return(const NanDataPathRequestInd&)); + MOCK_METHOD1(eventDataPathConfirm, + Return(const android::hardware::wifi::V1_0::NanDataPathConfirmInd&)); + MOCK_METHOD1(eventDataPathTerminated, Return(uint32_t)); + MOCK_METHOD1(eventDataPathConfirm_1_2, Return(const NanDataPathConfirmInd&)); + MOCK_METHOD1(eventDataPathScheduleUpdate, Return(const NanDataPathScheduleUpdateInd&)); + MOCK_METHOD3(notifyCapabilitiesResponse_1_5, + Return(uint16_t, const WifiNanStatus&, const V1_5::NanCapabilities&)); +}; + +class WifiNanIfaceTest : public Test { + protected: + legacy_hal::wifi_hal_fn fake_func_table_; + std::shared_ptr> iface_tool_{ + new NiceMock}; + std::shared_ptr> legacy_hal_{ + new NiceMock(iface_tool_, fake_func_table_, true)}; + std::shared_ptr> iface_util_{ + new NiceMock(iface_tool_, legacy_hal_)}; +}; + +TEST_F(WifiNanIfaceTest, IfacEventHandlers_OnStateToggleOffOn) { + iface_util::IfaceEventHandlers captured_iface_event_handlers = {}; + EXPECT_CALL(*legacy_hal_, nanRegisterCallbackHandlers(testing::_, testing::_)) + .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); + EXPECT_CALL(*iface_util_, registerIfaceEventHandlers(testing::_, testing::_)) + .WillOnce(testing::Invoke(bind(CaptureIfaceEventHandlers, std::placeholders::_1, + std::placeholders::_2, &captured_iface_event_handlers))); + sp nan_iface = new WifiNanIface(kIfaceName, false, legacy_hal_, iface_util_); + + // Register a mock nan event callback. + sp> mock_event_callback{ + new NiceMock}; + nan_iface->registerEventCallback(mock_event_callback, [](const WifiStatus& status) { + ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); + }); + // Ensure that the eventDisabled() function in mock callback will be + // invoked. + WifiNanStatus expected_nan_status = {NanStatusType::UNSUPPORTED_CONCURRENCY_NAN_DISABLED, ""}; + EXPECT_CALL(*mock_event_callback, eventDisabled(expected_nan_status)).Times(1); + + // Trigger the iface state toggle callback. + captured_iface_event_handlers.on_state_toggle_off_on(kIfaceName); +} +} // namespace implementation +} // namespace V1_6 +} // namespace wifi +} // namespace hardware +} // namespace android diff --git a/wifi/1.5/default/wifi.cpp b/wifi/1.6/default/wifi.cpp similarity index 74% rename from wifi/1.5/default/wifi.cpp rename to wifi/1.6/default/wifi.cpp index a85b242a8a..c302ce2434 100644 --- a/wifi/1.5/default/wifi.cpp +++ b/wifi/1.6/default/wifi.cpp @@ -28,16 +28,15 @@ static constexpr android::hardware::wifi::V1_0::ChipId kPrimaryChipId = 0; namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { using hidl_return_util::validateAndCall; using hidl_return_util::validateAndCallWithLock; -Wifi::Wifi( - const std::shared_ptr iface_tool, - const std::shared_ptr legacy_hal_factory, - const std::shared_ptr mode_controller, - const std::shared_ptr feature_flags) +Wifi::Wifi(const std::shared_ptr iface_tool, + const std::shared_ptr legacy_hal_factory, + const std::shared_ptr mode_controller, + const std::shared_ptr feature_flags) : iface_tool_(iface_tool), legacy_hal_factory_(legacy_hal_factory), mode_controller_(mode_controller), @@ -49,46 +48,44 @@ bool Wifi::isValid() { return true; } -Return Wifi::registerEventCallback( - const sp& event_callback, - registerEventCallback_cb hidl_status_cb) { +Return Wifi::registerEventCallback(const sp& event_callback, + registerEventCallback_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_UNKNOWN, - &Wifi::registerEventCallbackInternal, hidl_status_cb, - event_callback); + &Wifi::registerEventCallbackInternal, hidl_status_cb, event_callback); } -Return Wifi::registerEventCallback_1_5( - const sp& event_callback, - registerEventCallback_1_5_cb hidl_status_cb) { +Return Wifi::registerEventCallback_1_5(const sp& event_callback, + registerEventCallback_1_5_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_UNKNOWN, - &Wifi::registerEventCallbackInternal_1_5, - hidl_status_cb, event_callback); + &Wifi::registerEventCallbackInternal_1_5, hidl_status_cb, + event_callback); } -Return Wifi::isStarted() { return run_state_ != RunState::STOPPED; } +Return Wifi::isStarted() { + return run_state_ != RunState::STOPPED; +} Return Wifi::start(start_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_UNKNOWN, - &Wifi::startInternal, hidl_status_cb); + return validateAndCall(this, WifiStatusCode::ERROR_UNKNOWN, &Wifi::startInternal, + hidl_status_cb); } Return Wifi::stop(stop_cb hidl_status_cb) { - return validateAndCallWithLock(this, WifiStatusCode::ERROR_UNKNOWN, - &Wifi::stopInternal, hidl_status_cb); + return validateAndCallWithLock(this, WifiStatusCode::ERROR_UNKNOWN, &Wifi::stopInternal, + hidl_status_cb); } Return Wifi::getChipIds(getChipIds_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_UNKNOWN, - &Wifi::getChipIdsInternal, hidl_status_cb); + return validateAndCall(this, WifiStatusCode::ERROR_UNKNOWN, &Wifi::getChipIdsInternal, + hidl_status_cb); } Return Wifi::getChip(ChipId chip_id, getChip_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_UNKNOWN, - &Wifi::getChipInternal, hidl_status_cb, chip_id); + return validateAndCall(this, WifiStatusCode::ERROR_UNKNOWN, &Wifi::getChipInternal, + hidl_status_cb, chip_id); } -Return Wifi::debug(const hidl_handle& handle, - const hidl_vec&) { +Return Wifi::debug(const hidl_handle& handle, const hidl_vec&) { LOG(INFO) << "-----------Debug is called----------------"; if (chips_.size() == 0) { return Void(); @@ -103,13 +100,13 @@ Return Wifi::debug(const hidl_handle& handle, } WifiStatus Wifi::registerEventCallbackInternal( - const sp& event_callback __unused) { + const sp& event_callback __unused) { // Deprecated support for this callback. return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); } WifiStatus Wifi::registerEventCallbackInternal_1_5( - const sp& event_callback) { + const sp& event_callback) { if (!event_cb_handler_.addCallback(event_callback)) { return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } @@ -120,36 +117,32 @@ WifiStatus Wifi::startInternal() { if (run_state_ == RunState::STARTED) { return createWifiStatus(WifiStatusCode::SUCCESS); } else if (run_state_ == RunState::STOPPING) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, - "HAL is stopping"); + return createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, "HAL is stopping"); } WifiStatus wifi_status = initializeModeControllerAndLegacyHal(); if (wifi_status.code == WifiStatusCode::SUCCESS) { // Register the callback for subsystem restart - const auto& on_subsystem_restart_callback = - [this](const std::string& error) { - WifiStatus wifi_status = - createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, error); - for (const auto& callback : event_cb_handler_.getCallbacks()) { - LOG(INFO) << "Attempting to invoke onSubsystemRestart " + const auto& on_subsystem_restart_callback = [this](const std::string& error) { + WifiStatus wifi_status = createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, error); + for (const auto& callback : event_cb_handler_.getCallbacks()) { + LOG(INFO) << "Attempting to invoke onSubsystemRestart " + "callback"; + if (!callback->onSubsystemRestart(wifi_status).isOk()) { + LOG(ERROR) << "Failed to invoke onSubsystemRestart callback"; + } else { + LOG(INFO) << "Succeeded to invoke onSubsystemRestart " "callback"; - if (!callback->onSubsystemRestart(wifi_status).isOk()) { - LOG(ERROR) - << "Failed to invoke onSubsystemRestart callback"; - } else { - LOG(INFO) << "Succeeded to invoke onSubsystemRestart " - "callback"; - } } - }; + } + }; // Create the chip instance once the HAL is started. android::hardware::wifi::V1_0::ChipId chipId = kPrimaryChipId; for (auto& hal : legacy_hals_) { - chips_.push_back(new WifiChip( - chipId, chipId == kPrimaryChipId, hal, mode_controller_, - std::make_shared(iface_tool_, hal), - feature_flags_, on_subsystem_restart_callback)); + chips_.push_back( + new WifiChip(chipId, chipId == kPrimaryChipId, hal, mode_controller_, + std::make_shared(iface_tool_, hal), + feature_flags_, on_subsystem_restart_callback)); chipId++; } run_state_ = RunState::STARTED; @@ -173,12 +166,11 @@ WifiStatus Wifi::startInternal() { } WifiStatus Wifi::stopInternal( - /* NONNULL */ std::unique_lock* lock) { + /* NONNULL */ std::unique_lock* lock) { if (run_state_ == RunState::STOPPED) { return createWifiStatus(WifiStatusCode::SUCCESS); } else if (run_state_ == RunState::STOPPING) { - return createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, - "HAL is stopping"); + return createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, "HAL is stopping"); } // Clear the chip object and its child objects since the HAL is now // stopped. @@ -220,8 +212,7 @@ std::pair> Wifi::getChipIdsInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), std::move(chip_ids)}; } -std::pair> Wifi::getChipInternal( - ChipId chip_id) { +std::pair> Wifi::getChipInternal(ChipId chip_id) { for (auto& chip : chips_) { ChipId cand_id = getChipIdFromWifiChip(chip); if ((cand_id != UINT32_MAX) && (cand_id == chip_id)) @@ -238,8 +229,7 @@ WifiStatus Wifi::initializeModeControllerAndLegacyHal() { } legacy_hals_ = legacy_hal_factory_->getHals(); - if (legacy_hals_.empty()) - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); + if (legacy_hals_.empty()) return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); int index = 0; // for failure log for (auto& hal : legacy_hals_) { legacy_hal::wifi_error legacy_status = hal->initialize(); @@ -258,7 +248,7 @@ WifiStatus Wifi::initializeModeControllerAndLegacyHal() { } WifiStatus Wifi::stopLegacyHalAndDeinitializeModeController( - /* NONNULL */ std::unique_lock* lock) { + /* NONNULL */ std::unique_lock* lock) { legacy_hal::wifi_error legacy_status = legacy_hal::WIFI_SUCCESS; int index = 0; @@ -298,7 +288,7 @@ ChipId Wifi::getChipIdFromWifiChip(sp& chip) { return chip_id; } } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi.h b/wifi/1.6/default/wifi.h similarity index 79% rename from wifi/1.5/default/wifi.h rename to wifi/1.6/default/wifi.h index c94ef3f4cf..435358e797 100644 --- a/wifi/1.5/default/wifi.h +++ b/wifi/1.6/default/wifi.h @@ -21,7 +21,7 @@ // headers. This wifi HAL uses an enum called NAN, which does not compile when // the macro is defined. Undefine NAN to work around it. #undef NAN -#include +#include #include #include @@ -37,46 +37,41 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { /** * Root HIDL interface object used to control the Wifi HAL. */ -class Wifi : public V1_5::IWifi { - public: +class Wifi : public V1_6::IWifi { + public: Wifi(const std::shared_ptr iface_tool, - const std::shared_ptr - legacy_hal_factory, - const std::shared_ptr - mode_controller, + const std::shared_ptr legacy_hal_factory, + const std::shared_ptr mode_controller, const std::shared_ptr feature_flags); bool isValid(); // HIDL methods exposed. - Return registerEventCallback( - const sp& event_callback, - registerEventCallback_cb hidl_status_cb) override; - Return registerEventCallback_1_5( - const sp& event_callback, - registerEventCallback_1_5_cb hidl_status_cb) override; + Return registerEventCallback(const sp& event_callback, + registerEventCallback_cb hidl_status_cb) override; + Return registerEventCallback_1_5(const sp& event_callback, + registerEventCallback_1_5_cb hidl_status_cb) override; Return isStarted() override; Return start(start_cb hidl_status_cb) override; Return stop(stop_cb hidl_status_cb) override; Return getChipIds(getChipIds_cb hidl_status_cb) override; Return getChip(ChipId chip_id, getChip_cb hidl_status_cb) override; - Return debug(const hidl_handle& handle, - const hidl_vec& options) override; + Return debug(const hidl_handle& handle, const hidl_vec& options) override; - private: + private: enum class RunState { STOPPED, STARTED, STOPPING }; // Corresponding worker functions for the HIDL methods. WifiStatus registerEventCallbackInternal( - const sp& event_callback __unused); + const sp& event_callback __unused); WifiStatus registerEventCallbackInternal_1_5( - const sp& event_callback); + const sp& event_callback); WifiStatus startInternal(); WifiStatus stopInternal(std::unique_lock* lock); std::pair> getChipIdsInternal(); @@ -84,7 +79,7 @@ class Wifi : public V1_5::IWifi { WifiStatus initializeModeControllerAndLegacyHal(); WifiStatus stopLegacyHalAndDeinitializeModeController( - std::unique_lock* lock); + std::unique_lock* lock); ChipId getChipIdFromWifiChip(sp& chip); // Instance is created in this root level |IWifi| HIDL interface object @@ -96,14 +91,13 @@ class Wifi : public V1_5::IWifi { std::shared_ptr feature_flags_; RunState run_state_; std::vector> chips_; - hidl_callback_util::HidlCallbackHandler - event_cb_handler_; + hidl_callback_util::HidlCallbackHandler event_cb_handler_; DISALLOW_COPY_AND_ASSIGN(Wifi); }; } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_ap_iface.cpp b/wifi/1.6/default/wifi_ap_iface.cpp similarity index 75% rename from wifi/1.5/default/wifi_ap_iface.cpp rename to wifi/1.6/default/wifi_ap_iface.cpp index 1ae7905f74..b2957db13f 100644 --- a/wifi/1.5/default/wifi_ap_iface.cpp +++ b/wifi/1.6/default/wifi_ap_iface.cpp @@ -24,14 +24,13 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { using hidl_return_util::validateAndCall; -WifiApIface::WifiApIface( - const std::string& ifname, const std::vector& instances, - const std::weak_ptr legacy_hal, - const std::weak_ptr iface_util) +WifiApIface::WifiApIface(const std::string& ifname, const std::vector& instances, + const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util) : ifname_(ifname), instances_(instances), legacy_hal_(legacy_hal), @@ -43,14 +42,16 @@ void WifiApIface::invalidate() { is_valid_ = false; } -bool WifiApIface::isValid() { return is_valid_; } +bool WifiApIface::isValid() { + return is_valid_; +} -std::string WifiApIface::getName() { return ifname_; } +std::string WifiApIface::getName() { + return ifname_; +} void WifiApIface::removeInstance(std::string instance) { - instances_.erase( - std::remove(instances_.begin(), instances_.end(), instance), - instances_.end()); + instances_.erase(std::remove(instances_.begin(), instances_.end(), instance), instances_.end()); } Return WifiApIface::getName(getName_cb hidl_status_cb) { @@ -66,44 +67,35 @@ Return WifiApIface::getType(getType_cb hidl_status_cb) { Return WifiApIface::setCountryCode(const hidl_array& code, setCountryCode_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiApIface::setCountryCodeInternal, hidl_status_cb, - code); + &WifiApIface::setCountryCodeInternal, hidl_status_cb, code); } -Return WifiApIface::getValidFrequenciesForBand( - V1_0::WifiBand band, getValidFrequenciesForBand_cb hidl_status_cb) { +Return WifiApIface::getValidFrequenciesForBand(V1_0::WifiBand band, + getValidFrequenciesForBand_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiApIface::getValidFrequenciesForBandInternal, - hidl_status_cb, band); + &WifiApIface::getValidFrequenciesForBandInternal, hidl_status_cb, band); } Return WifiApIface::setMacAddress(const hidl_array& mac, setMacAddress_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiApIface::setMacAddressInternal, hidl_status_cb, - mac); + &WifiApIface::setMacAddressInternal, hidl_status_cb, mac); } -Return WifiApIface::getFactoryMacAddress( - getFactoryMacAddress_cb hidl_status_cb) { +Return WifiApIface::getFactoryMacAddress(getFactoryMacAddress_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiApIface::getFactoryMacAddressInternal, - hidl_status_cb, + &WifiApIface::getFactoryMacAddressInternal, hidl_status_cb, instances_.size() > 0 ? instances_[0] : ifname_); } -Return WifiApIface::resetToFactoryMacAddress( - resetToFactoryMacAddress_cb hidl_status_cb) { +Return WifiApIface::resetToFactoryMacAddress(resetToFactoryMacAddress_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiApIface::resetToFactoryMacAddressInternal, - hidl_status_cb); + &WifiApIface::resetToFactoryMacAddressInternal, hidl_status_cb); } -Return WifiApIface::getBridgedInstances( - getBridgedInstances_cb hidl_status_cb) { +Return WifiApIface::getBridgedInstances(getBridgedInstances_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiApIface::getBridgedInstancesInternal, - hidl_status_cb); + &WifiApIface::getBridgedInstancesInternal, hidl_status_cb); } std::pair WifiApIface::getNameInternal() { @@ -114,28 +106,24 @@ std::pair WifiApIface::getTypeInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::AP}; } -WifiStatus WifiApIface::setCountryCodeInternal( - const std::array& code) { +WifiStatus WifiApIface::setCountryCodeInternal(const std::array& code) { legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->setCountryCode( - instances_.size() > 0 ? instances_[0] : ifname_, code); + instances_.size() > 0 ? instances_[0] : ifname_, code); return createWifiStatusFromLegacyError(legacy_status); } std::pair> WifiApIface::getValidFrequenciesForBandInternal(V1_0::WifiBand band) { - static_assert(sizeof(WifiChannelInMhz) == sizeof(uint32_t), - "Size mismatch"); + static_assert(sizeof(WifiChannelInMhz) == sizeof(uint32_t), "Size mismatch"); legacy_hal::wifi_error legacy_status; std::vector valid_frequencies; - std::tie(legacy_status, valid_frequencies) = - legacy_hal_.lock()->getValidFrequenciesForBand( + std::tie(legacy_status, valid_frequencies) = legacy_hal_.lock()->getValidFrequenciesForBand( instances_.size() > 0 ? instances_[0] : ifname_, hidl_struct_util::convertHidlWifiBandToLegacy(band)); return {createWifiStatusFromLegacyError(legacy_status), valid_frequencies}; } -WifiStatus WifiApIface::setMacAddressInternal( - const std::array& mac) { +WifiStatus WifiApIface::setMacAddressInternal(const std::array& mac) { // Support random MAC up to 2 interfaces if (instances_.size() == 2) { int rbyte = 1; @@ -160,12 +148,10 @@ WifiStatus WifiApIface::setMacAddressInternal( return createWifiStatus(WifiStatusCode::SUCCESS); } -std::pair> -WifiApIface::getFactoryMacAddressInternal(const std::string& ifaceName) { - std::array mac = - iface_util_.lock()->getFactoryMacAddress(ifaceName); - if (mac[0] == 0 && mac[1] == 0 && mac[2] == 0 && mac[3] == 0 && - mac[4] == 0 && mac[5] == 0) { +std::pair> WifiApIface::getFactoryMacAddressInternal( + const std::string& ifaceName) { + std::array mac = iface_util_.lock()->getFactoryMacAddress(ifaceName); + if (mac[0] == 0 && mac[1] == 0 && mac[2] == 0 && mac[3] == 0 && mac[4] == 0 && mac[5] == 0) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), mac}; } return {createWifiStatus(WifiStatusCode::SUCCESS), mac}; @@ -188,10 +174,9 @@ WifiStatus WifiApIface::resetToFactoryMacAddressInternal() { // bridged interface even if we got the request to reset the Factory // MAC. Since the bridged interface is an internal interface for the // operation of bpf and others networking operation. - if (!iface_util_.lock()->setMacAddress( - ifname_, iface_util_.lock()->createRandomMacAddress())) { - LOG(ERROR) << "Fail to config MAC for bridged interface " - << ifname_; + if (!iface_util_.lock()->setMacAddress(ifname_, + iface_util_.lock()->createRandomMacAddress())) { + LOG(ERROR) << "Fail to config MAC for bridged interface " << ifname_; return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } } else { @@ -205,8 +190,7 @@ WifiStatus WifiApIface::resetToFactoryMacAddressInternal() { return createWifiStatus(WifiStatusCode::SUCCESS); } -std::pair> -WifiApIface::getBridgedInstancesInternal() { +std::pair> WifiApIface::getBridgedInstancesInternal() { std::vector instances; for (const auto& instance_name : instances_) { instances.push_back(instance_name); @@ -214,7 +198,7 @@ WifiApIface::getBridgedInstancesInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), instances}; } } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_ap_iface.h b/wifi/1.6/default/wifi_ap_iface.h similarity index 75% rename from wifi/1.5/default/wifi_ap_iface.h rename to wifi/1.6/default/wifi_ap_iface.h index 8f8387deae..d1c06424df 100644 --- a/wifi/1.5/default/wifi_ap_iface.h +++ b/wifi/1.6/default/wifi_ap_iface.h @@ -26,7 +26,7 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { using namespace android::hardware::wifi::V1_0; @@ -34,9 +34,8 @@ using namespace android::hardware::wifi::V1_0; * HIDL interface object used to control a AP Iface instance. */ class WifiApIface : public V1_5::IWifiApIface { - public: - WifiApIface(const std::string& ifname, - const std::vector& instances, + public: + WifiApIface(const std::string& ifname, const std::vector& instances, const std::weak_ptr legacy_hal, const std::weak_ptr iface_util); // Refer to |WifiChip::invalidate()|. @@ -50,32 +49,27 @@ class WifiApIface : public V1_5::IWifiApIface { Return getType(getType_cb hidl_status_cb) override; Return setCountryCode(const hidl_array& code, setCountryCode_cb hidl_status_cb) override; - Return getValidFrequenciesForBand( - V1_0::WifiBand band, - getValidFrequenciesForBand_cb hidl_status_cb) override; + Return getValidFrequenciesForBand(V1_0::WifiBand band, + getValidFrequenciesForBand_cb hidl_status_cb) override; Return setMacAddress(const hidl_array& mac, setMacAddress_cb hidl_status_cb) override; - Return getFactoryMacAddress( - getFactoryMacAddress_cb hidl_status_cb) override; - Return resetToFactoryMacAddress( - resetToFactoryMacAddress_cb hidl_status_cb) override; + Return getFactoryMacAddress(getFactoryMacAddress_cb hidl_status_cb) override; + Return resetToFactoryMacAddress(resetToFactoryMacAddress_cb hidl_status_cb) override; - Return getBridgedInstances( - getBridgedInstances_cb hidl_status_cb) override; + Return getBridgedInstances(getBridgedInstances_cb hidl_status_cb) override; - private: + private: // Corresponding worker functions for the HIDL methods. std::pair getNameInternal(); std::pair getTypeInternal(); WifiStatus setCountryCodeInternal(const std::array& code); - std::pair> - getValidFrequenciesForBandInternal(V1_0::WifiBand band); + std::pair> getValidFrequenciesForBandInternal( + V1_0::WifiBand band); WifiStatus setMacAddressInternal(const std::array& mac); std::pair> getFactoryMacAddressInternal( - const std::string& ifaceName); + const std::string& ifaceName); WifiStatus resetToFactoryMacAddressInternal(); - std::pair> - getBridgedInstancesInternal(); + std::pair> getBridgedInstancesInternal(); std::string ifname_; std::vector instances_; @@ -87,7 +81,7 @@ class WifiApIface : public V1_5::IWifiApIface { }; } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_chip.cpp b/wifi/1.6/default/wifi_chip.cpp similarity index 73% rename from wifi/1.5/default/wifi_chip.cpp rename to wifi/1.6/default/wifi_chip.cpp index 6bdff42149..c1ce766a4f 100644 --- a/wifi/1.5/default/wifi_chip.cpp +++ b/wifi/1.6/default/wifi_chip.cpp @@ -52,8 +52,7 @@ constexpr char kApBridgeIfacePrefix[] = "ap_br_"; template void invalidateAndClear(std::vector>& ifaces, sp iface) { iface->invalidate(); - ifaces.erase(std::remove(ifaces.begin(), ifaces.end(), iface), - ifaces.end()); + ifaces.erase(std::remove(ifaces.begin(), ifaces.end(), iface), ifaces.end()); } template @@ -74,8 +73,7 @@ std::vector getNames(std::vector>& ifaces) { } template -sp findUsingName(std::vector>& ifaces, - const std::string& name) { +sp findUsingName(std::vector>& ifaces, const std::string& name) { std::vector names; for (const auto& iface : ifaces) { if (name == iface->getName()) { @@ -93,8 +91,7 @@ std::string getWlanIfaceName(unsigned idx) { std::array buffer; if (idx == 0 || idx == 1) { - const char* altPropName = - (idx == 0) ? "wifi.interface" : "wifi.concurrent.interface"; + const char* altPropName = (idx == 0) ? "wifi.interface" : "wifi.concurrent.interface"; auto res = property_get(altPropName, buffer.data(), nullptr); if (res > 0) return buffer.data(); } @@ -111,15 +108,13 @@ std::vector getPredefinedApIfaceNames(bool is_bridged) { std::vector ifnames; std::array buffer; buffer.fill(0); - if (property_get("ro.vendor.wifi.sap.interface", buffer.data(), nullptr) == - 0) { + if (property_get("ro.vendor.wifi.sap.interface", buffer.data(), nullptr) == 0) { return ifnames; } ifnames.push_back(buffer.data()); if (is_bridged) { buffer.fill(0); - if (property_get("ro.vendor.wifi.sap.concurrent.iface", buffer.data(), - nullptr) == 0) { + if (property_get("ro.vendor.wifi.sap.concurrent.iface", buffer.data(), nullptr) == 0) { return ifnames; } ifnames.push_back(buffer.data()); @@ -133,29 +128,25 @@ std::string getPredefinedP2pIfaceName() { std::string p2pDevIfName = ""; std::array buffer; property_get("wifi.direct.interface", buffer.data(), "p2p0"); - if (strncmp(buffer.data(), P2P_MGMT_DEVICE_PREFIX, - strlen(P2P_MGMT_DEVICE_PREFIX)) == 0) { + if (strncmp(buffer.data(), P2P_MGMT_DEVICE_PREFIX, strlen(P2P_MGMT_DEVICE_PREFIX)) == 0) { /* Get the p2p parent interface name from p2p device interface name set * in property */ strncpy(p2pParentIfname, buffer.data() + strlen(P2P_MGMT_DEVICE_PREFIX), strlen(buffer.data()) - strlen(P2P_MGMT_DEVICE_PREFIX)); - if (property_get(kActiveWlanIfaceNameProperty, primaryIfaceName.data(), - nullptr) == 0) { + if (property_get(kActiveWlanIfaceNameProperty, primaryIfaceName.data(), nullptr) == 0) { return buffer.data(); } /* Check if the parent interface derived from p2p device interface name * is active */ if (strncmp(p2pParentIfname, primaryIfaceName.data(), - strlen(buffer.data()) - strlen(P2P_MGMT_DEVICE_PREFIX)) != - 0) { + strlen(buffer.data()) - strlen(P2P_MGMT_DEVICE_PREFIX)) != 0) { /* * Update the predefined p2p device interface parent interface name * with current active wlan interface */ p2pDevIfName += P2P_MGMT_DEVICE_PREFIX; p2pDevIfName += primaryIfaceName.data(); - LOG(INFO) << "update the p2p device interface name to " - << p2pDevIfName.c_str(); + LOG(INFO) << "update the p2p device interface name to " << p2pDevIfName.c_str(); return p2pDevIfName; } } @@ -184,8 +175,7 @@ void setActiveWlanIfaceNameProperty(const std::string& ifname) { bool removeOldFilesInternal() { time_t now = time(0); const time_t delete_files_before = now - kMaxRingBufferFileAgeSeconds; - std::unique_ptr dir_dump( - opendir(kTombstoneFolderPath), closedir); + std::unique_ptr dir_dump(opendir(kTombstoneFolderPath), closedir); if (!dir_dump) { PLOG(ERROR) << "Failed to open directory"; return false; @@ -206,15 +196,13 @@ bool removeOldFilesInternal() { continue; } const time_t cur_file_time = cur_file_stat.st_mtime; - valid_files.push_back( - std::pair(cur_file_time, cur_file_path)); + valid_files.push_back(std::pair(cur_file_time, cur_file_path)); } valid_files.sort(); // sort the list of files by last modified time from // small to big. uint32_t cur_file_count = valid_files.size(); for (auto cur_file : valid_files) { - if (cur_file_count > kMaxRingBufferFileNum || - cur_file.first < delete_files_before) { + if (cur_file_count > kMaxRingBufferFileNum || cur_file.first < delete_files_before) { if (unlink(cur_file.second.c_str()) != 0) { PLOG(ERROR) << "Error deleting file"; success = false; @@ -228,17 +216,14 @@ bool removeOldFilesInternal() { } // Helper function for |cpioArchiveFilesInDir| -bool cpioWriteHeader(int out_fd, struct stat& st, const char* file_name, - size_t file_name_len) { +bool cpioWriteHeader(int out_fd, struct stat& st, const char* file_name, size_t file_name_len) { std::array read_buf; ssize_t llen = - sprintf(read_buf.data(), - "%s%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X", - kCpioMagic, static_cast(st.st_ino), st.st_mode, st.st_uid, - st.st_gid, static_cast(st.st_nlink), - static_cast(st.st_mtime), static_cast(st.st_size), - major(st.st_dev), minor(st.st_dev), major(st.st_rdev), - minor(st.st_rdev), static_cast(file_name_len), 0); + sprintf(read_buf.data(), "%s%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X", + kCpioMagic, static_cast(st.st_ino), st.st_mode, st.st_uid, st.st_gid, + static_cast(st.st_nlink), static_cast(st.st_mtime), + static_cast(st.st_size), major(st.st_dev), minor(st.st_dev), + major(st.st_rdev), minor(st.st_rdev), static_cast(file_name_len), 0); if (write(out_fd, read_buf.data(), llen) == -1) { PLOG(ERROR) << "Error writing cpio header to file " << file_name; return false; @@ -300,9 +285,7 @@ bool cpioWriteFileTrailer(int out_fd) { std::array read_buf; read_buf.fill(0); if (write(out_fd, read_buf.data(), - sprintf(read_buf.data(), "070701%040X%056X%08XTRAILER!!!", 1, - 0x0b, 0) + - 4) == -1) { + sprintf(read_buf.data(), "070701%040X%056X%08XTRAILER!!!", 1, 0x0b, 0) + 4) == -1) { PLOG(ERROR) << "Error writing trailing bytes"; return false; } @@ -315,8 +298,7 @@ bool cpioWriteFileTrailer(int out_fd) { size_t cpioArchiveFilesInDir(int out_fd, const char* input_dir) { struct dirent* dp; size_t n_error = 0; - std::unique_ptr dir_dump(opendir(input_dir), - closedir); + std::unique_ptr dir_dump(opendir(input_dir), closedir); if (!dir_dump) { PLOG(ERROR) << "Failed to open directory"; return ++n_error; @@ -340,14 +322,12 @@ size_t cpioArchiveFilesInDir(int out_fd, const char* input_dir) { continue; } std::string file_name_with_last_modified_time = - cur_file_name + "-" + std::to_string(st.st_mtime); + 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; + 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(), + if (!cpioWriteHeader(out_fd, st, file_name_with_last_modified_time.c_str(), file_name_len)) { return ++n_error; } @@ -375,18 +355,17 @@ std::vector makeCharVec(const std::string& str) { namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { using hidl_return_util::validateAndCall; using hidl_return_util::validateAndCallWithLock; -WifiChip::WifiChip( - ChipId chip_id, bool is_primary, - const std::weak_ptr legacy_hal, - const std::weak_ptr mode_controller, - const std::shared_ptr iface_util, - const std::weak_ptr feature_flags, - const std::function& handler) +WifiChip::WifiChip(ChipId chip_id, bool is_primary, + const std::weak_ptr legacy_hal, + const std::weak_ptr mode_controller, + const std::shared_ptr iface_util, + const std::weak_ptr feature_flags, + const std::function& handler) : chip_id_(chip_id), legacy_hal_(legacy_hal), mode_controller_(mode_controller), @@ -410,24 +389,25 @@ void WifiChip::invalidate() { is_valid_ = false; } -bool WifiChip::isValid() { return is_valid_; } +bool WifiChip::isValid() { + return is_valid_; +} std::set> WifiChip::getEventCallbacks() { return event_cb_handler_.getCallbacks(); } Return WifiChip::getId(getId_cb hidl_status_cb) { - return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getIdInternal, hidl_status_cb); + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, &WifiChip::getIdInternal, + hidl_status_cb); } // Deprecated support for this callback -Return WifiChip::registerEventCallback( - const sp& event_callback, - registerEventCallback_cb hidl_status_cb) { +Return WifiChip::registerEventCallback(const sp& event_callback, + registerEventCallback_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::registerEventCallbackInternal, - hidl_status_cb, event_callback); + &WifiChip::registerEventCallbackInternal, hidl_status_cb, + event_callback); } Return WifiChip::getCapabilities(getCapabilities_cb hidl_status_cb) { @@ -437,15 +417,12 @@ Return WifiChip::getCapabilities(getCapabilities_cb hidl_status_cb) { Return WifiChip::getAvailableModes(getAvailableModes_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getAvailableModesInternal, - hidl_status_cb); + &WifiChip::getAvailableModesInternal, hidl_status_cb); } -Return WifiChip::configureChip(ChipModeId mode_id, - configureChip_cb hidl_status_cb) { - return validateAndCallWithLock( - this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::configureChipInternal, hidl_status_cb, mode_id); +Return WifiChip::configureChip(ChipModeId mode_id, configureChip_cb hidl_status_cb) { + return validateAndCallWithLock(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::configureChipInternal, hidl_status_cb, mode_id); } Return WifiChip::getMode(getMode_cb hidl_status_cb) { @@ -453,25 +430,19 @@ Return WifiChip::getMode(getMode_cb hidl_status_cb) { &WifiChip::getModeInternal, hidl_status_cb); } -Return WifiChip::requestChipDebugInfo( - requestChipDebugInfo_cb hidl_status_cb) { +Return WifiChip::requestChipDebugInfo(requestChipDebugInfo_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::requestChipDebugInfoInternal, - hidl_status_cb); + &WifiChip::requestChipDebugInfoInternal, hidl_status_cb); } -Return WifiChip::requestDriverDebugDump( - requestDriverDebugDump_cb hidl_status_cb) { +Return WifiChip::requestDriverDebugDump(requestDriverDebugDump_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::requestDriverDebugDumpInternal, - hidl_status_cb); + &WifiChip::requestDriverDebugDumpInternal, hidl_status_cb); } -Return WifiChip::requestFirmwareDebugDump( - requestFirmwareDebugDump_cb hidl_status_cb) { +Return WifiChip::requestFirmwareDebugDump(requestFirmwareDebugDump_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::requestFirmwareDebugDumpInternal, - hidl_status_cb); + &WifiChip::requestFirmwareDebugDumpInternal, hidl_status_cb); } Return WifiChip::createApIface(createApIface_cb hidl_status_cb) { @@ -479,11 +450,9 @@ Return WifiChip::createApIface(createApIface_cb hidl_status_cb) { &WifiChip::createApIfaceInternal, hidl_status_cb); } -Return WifiChip::createBridgedApIface( - createBridgedApIface_cb hidl_status_cb) { +Return WifiChip::createBridgedApIface(createBridgedApIface_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::createBridgedApIfaceInternal, - hidl_status_cb); + &WifiChip::createBridgedApIfaceInternal, hidl_status_cb); } Return WifiChip::getApIfaceNames(getApIfaceNames_cb hidl_status_cb) { @@ -491,27 +460,22 @@ Return WifiChip::getApIfaceNames(getApIfaceNames_cb hidl_status_cb) { &WifiChip::getApIfaceNamesInternal, hidl_status_cb); } -Return WifiChip::getApIface(const hidl_string& ifname, - getApIface_cb hidl_status_cb) { +Return WifiChip::getApIface(const hidl_string& ifname, getApIface_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getApIfaceInternal, hidl_status_cb, - ifname); + &WifiChip::getApIfaceInternal, hidl_status_cb, ifname); } -Return WifiChip::removeApIface(const hidl_string& ifname, - removeApIface_cb hidl_status_cb) { +Return WifiChip::removeApIface(const hidl_string& ifname, removeApIface_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::removeApIfaceInternal, hidl_status_cb, - ifname); + &WifiChip::removeApIfaceInternal, hidl_status_cb, ifname); } Return WifiChip::removeIfaceInstanceFromBridgedApIface( - const hidl_string& ifname, const hidl_string& ifInstanceName, - removeIfaceInstanceFromBridgedApIface_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal, - hidl_status_cb, ifname, ifInstanceName); + const hidl_string& ifname, const hidl_string& ifInstanceName, + removeIfaceInstanceFromBridgedApIface_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal, hidl_status_cb, + ifname, ifInstanceName); } Return WifiChip::createNanIface(createNanIface_cb hidl_status_cb) { @@ -524,18 +488,14 @@ Return WifiChip::getNanIfaceNames(getNanIfaceNames_cb hidl_status_cb) { &WifiChip::getNanIfaceNamesInternal, hidl_status_cb); } -Return WifiChip::getNanIface(const hidl_string& ifname, - getNanIface_cb hidl_status_cb) { +Return WifiChip::getNanIface(const hidl_string& ifname, getNanIface_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getNanIfaceInternal, hidl_status_cb, - ifname); + &WifiChip::getNanIfaceInternal, hidl_status_cb, ifname); } -Return WifiChip::removeNanIface(const hidl_string& ifname, - removeNanIface_cb hidl_status_cb) { +Return WifiChip::removeNanIface(const hidl_string& ifname, removeNanIface_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::removeNanIfaceInternal, hidl_status_cb, - ifname); + &WifiChip::removeNanIfaceInternal, hidl_status_cb, ifname); } Return WifiChip::createP2pIface(createP2pIface_cb hidl_status_cb) { @@ -548,18 +508,14 @@ Return WifiChip::getP2pIfaceNames(getP2pIfaceNames_cb hidl_status_cb) { &WifiChip::getP2pIfaceNamesInternal, hidl_status_cb); } -Return WifiChip::getP2pIface(const hidl_string& ifname, - getP2pIface_cb hidl_status_cb) { +Return WifiChip::getP2pIface(const hidl_string& ifname, getP2pIface_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getP2pIfaceInternal, hidl_status_cb, - ifname); + &WifiChip::getP2pIfaceInternal, hidl_status_cb, ifname); } -Return WifiChip::removeP2pIface(const hidl_string& ifname, - removeP2pIface_cb hidl_status_cb) { +Return WifiChip::removeP2pIface(const hidl_string& ifname, removeP2pIface_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::removeP2pIfaceInternal, hidl_status_cb, - ifname); + &WifiChip::removeP2pIfaceInternal, hidl_status_cb, ifname); } Return WifiChip::createStaIface(createStaIface_cb hidl_status_cb) { @@ -572,132 +528,106 @@ Return WifiChip::getStaIfaceNames(getStaIfaceNames_cb hidl_status_cb) { &WifiChip::getStaIfaceNamesInternal, hidl_status_cb); } -Return WifiChip::getStaIface(const hidl_string& ifname, - getStaIface_cb hidl_status_cb) { +Return WifiChip::getStaIface(const hidl_string& ifname, getStaIface_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getStaIfaceInternal, hidl_status_cb, - ifname); + &WifiChip::getStaIfaceInternal, hidl_status_cb, ifname); } -Return WifiChip::removeStaIface(const hidl_string& ifname, - removeStaIface_cb hidl_status_cb) { +Return WifiChip::removeStaIface(const hidl_string& ifname, removeStaIface_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::removeStaIfaceInternal, hidl_status_cb, - ifname); + &WifiChip::removeStaIfaceInternal, hidl_status_cb, ifname); } -Return WifiChip::createRttController( - const sp& bound_iface, createRttController_cb hidl_status_cb) { +Return WifiChip::createRttController(const sp& bound_iface, + createRttController_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::createRttControllerInternal, - hidl_status_cb, bound_iface); + &WifiChip::createRttControllerInternal, hidl_status_cb, bound_iface); } -Return WifiChip::getDebugRingBuffersStatus( - getDebugRingBuffersStatus_cb hidl_status_cb) { +Return WifiChip::getDebugRingBuffersStatus(getDebugRingBuffersStatus_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getDebugRingBuffersStatusInternal, - hidl_status_cb); + &WifiChip::getDebugRingBuffersStatusInternal, hidl_status_cb); } Return WifiChip::startLoggingToDebugRingBuffer( - const hidl_string& ring_name, WifiDebugRingBufferVerboseLevel verbose_level, - uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes, - startLoggingToDebugRingBuffer_cb hidl_status_cb) { + const hidl_string& ring_name, WifiDebugRingBufferVerboseLevel verbose_level, + uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes, + startLoggingToDebugRingBuffer_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::startLoggingToDebugRingBufferInternal, - hidl_status_cb, ring_name, verbose_level, - max_interval_in_sec, min_data_size_in_bytes); + &WifiChip::startLoggingToDebugRingBufferInternal, hidl_status_cb, + ring_name, verbose_level, max_interval_in_sec, min_data_size_in_bytes); } -Return WifiChip::forceDumpToDebugRingBuffer( - const hidl_string& ring_name, - forceDumpToDebugRingBuffer_cb hidl_status_cb) { +Return WifiChip::forceDumpToDebugRingBuffer(const hidl_string& ring_name, + forceDumpToDebugRingBuffer_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::forceDumpToDebugRingBufferInternal, - hidl_status_cb, ring_name); + &WifiChip::forceDumpToDebugRingBufferInternal, hidl_status_cb, + ring_name); } -Return WifiChip::flushRingBufferToFile( - flushRingBufferToFile_cb hidl_status_cb) { +Return WifiChip::flushRingBufferToFile(flushRingBufferToFile_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::flushRingBufferToFileInternal, - hidl_status_cb); + &WifiChip::flushRingBufferToFileInternal, hidl_status_cb); } Return WifiChip::stopLoggingToDebugRingBuffer( - stopLoggingToDebugRingBuffer_cb hidl_status_cb) { + stopLoggingToDebugRingBuffer_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::stopLoggingToDebugRingBufferInternal, - hidl_status_cb); + &WifiChip::stopLoggingToDebugRingBufferInternal, hidl_status_cb); } -Return WifiChip::getDebugHostWakeReasonStats( - getDebugHostWakeReasonStats_cb hidl_status_cb) { +Return WifiChip::getDebugHostWakeReasonStats(getDebugHostWakeReasonStats_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getDebugHostWakeReasonStatsInternal, - hidl_status_cb); + &WifiChip::getDebugHostWakeReasonStatsInternal, hidl_status_cb); } -Return WifiChip::enableDebugErrorAlerts( - bool enable, enableDebugErrorAlerts_cb hidl_status_cb) { +Return WifiChip::enableDebugErrorAlerts(bool enable, + enableDebugErrorAlerts_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::enableDebugErrorAlertsInternal, - hidl_status_cb, enable); + &WifiChip::enableDebugErrorAlertsInternal, hidl_status_cb, enable); } -Return WifiChip::selectTxPowerScenario( - V1_1::IWifiChip::TxPowerScenario scenario, - selectTxPowerScenario_cb hidl_status_cb) { +Return WifiChip::selectTxPowerScenario(V1_1::IWifiChip::TxPowerScenario scenario, + selectTxPowerScenario_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::selectTxPowerScenarioInternal, - hidl_status_cb, scenario); + &WifiChip::selectTxPowerScenarioInternal, hidl_status_cb, scenario); } -Return WifiChip::resetTxPowerScenario( - resetTxPowerScenario_cb hidl_status_cb) { +Return WifiChip::resetTxPowerScenario(resetTxPowerScenario_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::resetTxPowerScenarioInternal, - hidl_status_cb); + &WifiChip::resetTxPowerScenarioInternal, hidl_status_cb); } -Return WifiChip::setLatencyMode(LatencyMode mode, - setLatencyMode_cb hidl_status_cb) { +Return WifiChip::setLatencyMode(LatencyMode mode, setLatencyMode_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::setLatencyModeInternal, hidl_status_cb, - mode); + &WifiChip::setLatencyModeInternal, hidl_status_cb, mode); } Return WifiChip::registerEventCallback_1_2( - const sp& event_callback, - registerEventCallback_cb hidl_status_cb) { + const sp& event_callback, + registerEventCallback_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::registerEventCallbackInternal_1_2, - hidl_status_cb, event_callback); + &WifiChip::registerEventCallbackInternal_1_2, hidl_status_cb, + event_callback); } -Return WifiChip::selectTxPowerScenario_1_2( - TxPowerScenario scenario, selectTxPowerScenario_cb hidl_status_cb) { +Return WifiChip::selectTxPowerScenario_1_2(TxPowerScenario scenario, + selectTxPowerScenario_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::selectTxPowerScenarioInternal_1_2, - hidl_status_cb, scenario); + &WifiChip::selectTxPowerScenarioInternal_1_2, hidl_status_cb, scenario); } Return WifiChip::getCapabilities_1_3(getCapabilities_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getCapabilitiesInternal_1_3, - hidl_status_cb); + &WifiChip::getCapabilitiesInternal_1_3, hidl_status_cb); } -Return WifiChip::getCapabilities_1_5( - getCapabilities_1_5_cb hidl_status_cb) { +Return WifiChip::getCapabilities_1_5(getCapabilities_1_5_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getCapabilitiesInternal_1_5, - hidl_status_cb); + &WifiChip::getCapabilitiesInternal_1_5, hidl_status_cb); } -Return WifiChip::debug(const hidl_handle& handle, - const hidl_vec&) { +Return WifiChip::debug(const hidl_handle& handle, const hidl_vec&) { if (handle != nullptr && handle->numFds >= 1) { { std::unique_lock lk(lock_t); @@ -723,66 +653,58 @@ Return WifiChip::debug(const hidl_handle& handle, return Void(); } -Return WifiChip::createRttController_1_4( - const sp& bound_iface, - createRttController_1_4_cb hidl_status_cb) { +Return WifiChip::createRttController_1_4(const sp& bound_iface, + createRttController_1_4_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::createRttControllerInternal_1_4, - hidl_status_cb, bound_iface); + &WifiChip::createRttControllerInternal_1_4, hidl_status_cb, bound_iface); } Return WifiChip::registerEventCallback_1_4( - const sp& event_callback, - registerEventCallback_cb hidl_status_cb) { + const sp& event_callback, + registerEventCallback_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::registerEventCallbackInternal_1_4, - hidl_status_cb, event_callback); + &WifiChip::registerEventCallbackInternal_1_4, hidl_status_cb, + event_callback); } Return WifiChip::setMultiStaPrimaryConnection( - const hidl_string& ifname, setMultiStaPrimaryConnection_cb hidl_status_cb) { + const hidl_string& ifname, setMultiStaPrimaryConnection_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::setMultiStaPrimaryConnectionInternal, - hidl_status_cb, ifname); + &WifiChip::setMultiStaPrimaryConnectionInternal, hidl_status_cb, ifname); } -Return WifiChip::setMultiStaUseCase( - MultiStaUseCase use_case, setMultiStaUseCase_cb hidl_status_cb) { +Return WifiChip::setMultiStaUseCase(MultiStaUseCase use_case, + setMultiStaUseCase_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::setMultiStaUseCaseInternal, - hidl_status_cb, use_case); + &WifiChip::setMultiStaUseCaseInternal, hidl_status_cb, use_case); } -Return WifiChip::setCoexUnsafeChannels( - const hidl_vec& unsafeChannels, - hidl_bitfield restrictions, - setCoexUnsafeChannels_cb hidl_status_cb) { +Return WifiChip::setCoexUnsafeChannels(const hidl_vec& unsafeChannels, + hidl_bitfield restrictions, + setCoexUnsafeChannels_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::setCoexUnsafeChannelsInternal, - hidl_status_cb, unsafeChannels, restrictions); + &WifiChip::setCoexUnsafeChannelsInternal, hidl_status_cb, unsafeChannels, + restrictions); } Return WifiChip::setCountryCode(const hidl_array& code, setCountryCode_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiChip::setCountryCodeInternal, hidl_status_cb, - code); + &WifiChip::setCountryCodeInternal, hidl_status_cb, code); } Return WifiChip::getUsableChannels( - WifiBand band, hidl_bitfield ifaceModeMask, - hidl_bitfield filterMask, - getUsableChannels_cb _hidl_cb) { + WifiBand band, hidl_bitfield ifaceModeMask, + hidl_bitfield filterMask, + getUsableChannels_cb _hidl_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::getUsableChannelsInternal, _hidl_cb, band, - ifaceModeMask, filterMask); + &WifiChip::getUsableChannelsInternal, _hidl_cb, band, ifaceModeMask, + filterMask); } -Return WifiChip::triggerSubsystemRestart( - triggerSubsystemRestart_cb hidl_status_cb) { +Return WifiChip::triggerSubsystemRestart(triggerSubsystemRestart_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, - &WifiChip::triggerSubsystemRestartInternal, - hidl_status_cb); + &WifiChip::triggerSubsystemRestartInternal, hidl_status_cb); } void WifiChip::invalidateAndRemoveAllIfaces() { @@ -799,16 +721,13 @@ void WifiChip::invalidateAndRemoveAllIfaces() { rtt_controllers_.clear(); } -void WifiChip::invalidateAndRemoveDependencies( - const std::string& removed_iface_name) { +void WifiChip::invalidateAndRemoveDependencies(const std::string& removed_iface_name) { for (auto it = nan_ifaces_.begin(); it != nan_ifaces_.end();) { auto nan_iface = *it; if (nan_iface->getName() == removed_iface_name) { nan_iface->invalidate(); for (const auto& callback : event_cb_handler_.getCallbacks()) { - if (!callback - ->onIfaceRemoved(IfaceType::NAN, removed_iface_name) - .isOk()) { + if (!callback->onIfaceRemoved(IfaceType::NAN, removed_iface_name).isOk()) { LOG(ERROR) << "Failed to invoke onIfaceRemoved callback"; } } @@ -834,7 +753,7 @@ std::pair WifiChip::getIdInternal() { } WifiStatus WifiChip::registerEventCallbackInternal( - const sp& /* event_callback */) { + const sp& /* event_callback */) { // Deprecated support for this callback. return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); } @@ -850,8 +769,7 @@ WifiChip::getAvailableModesInternal() { } WifiStatus WifiChip::configureChipInternal( - /* NONNULL */ std::unique_lock* lock, - ChipModeId mode_id) { + /* NONNULL */ std::unique_lock* lock, ChipModeId mode_id) { if (!isValidModeId(mode_id)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); } @@ -863,8 +781,7 @@ WifiStatus WifiChip::configureChipInternal( if (status.code != WifiStatusCode::SUCCESS) { for (const auto& callback : event_cb_handler_.getCallbacks()) { if (!callback->onChipReconfigureFailure(status).isOk()) { - LOG(ERROR) - << "Failed to invoke onChipReconfigureFailure callback"; + LOG(ERROR) << "Failed to invoke onChipReconfigureFailure callback"; } } return status; @@ -878,45 +795,38 @@ WifiStatus WifiChip::configureChipInternal( LOG(INFO) << "Configured chip in mode " << mode_id; setActiveWlanIfaceNameProperty(getFirstActiveWlanIfaceName()); - legacy_hal_.lock()->registerSubsystemRestartCallbackHandler( - subsystemCallbackHandler_); + legacy_hal_.lock()->registerSubsystemRestartCallbackHandler(subsystemCallbackHandler_); return status; } std::pair WifiChip::getModeInternal() { if (!isValidModeId(current_mode_id_)) { - return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), - current_mode_id_}; + return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), current_mode_id_}; } return {createWifiStatus(WifiStatusCode::SUCCESS), current_mode_id_}; } -std::pair -WifiChip::requestChipDebugInfoInternal() { +std::pair WifiChip::requestChipDebugInfoInternal() { V1_4::IWifiChip::ChipDebugInfo result; legacy_hal::wifi_error legacy_status; std::string driver_desc; const auto ifname = getFirstActiveWlanIfaceName(); - std::tie(legacy_status, driver_desc) = - legacy_hal_.lock()->getDriverVersion(ifname); + std::tie(legacy_status, driver_desc) = legacy_hal_.lock()->getDriverVersion(ifname); if (legacy_status != legacy_hal::WIFI_SUCCESS) { - LOG(ERROR) << "Failed to get driver version: " - << legacyErrorToString(legacy_status); - WifiStatus status = createWifiStatusFromLegacyError( - legacy_status, "failed to get driver version"); + LOG(ERROR) << "Failed to get driver version: " << legacyErrorToString(legacy_status); + WifiStatus status = + createWifiStatusFromLegacyError(legacy_status, "failed to get driver version"); return {status, result}; } result.driverDescription = driver_desc.c_str(); std::string firmware_desc; - std::tie(legacy_status, firmware_desc) = - legacy_hal_.lock()->getFirmwareVersion(ifname); + std::tie(legacy_status, firmware_desc) = legacy_hal_.lock()->getFirmwareVersion(ifname); if (legacy_status != legacy_hal::WIFI_SUCCESS) { - LOG(ERROR) << "Failed to get firmware version: " - << legacyErrorToString(legacy_status); - WifiStatus status = createWifiStatusFromLegacyError( - legacy_status, "failed to get firmware version"); + LOG(ERROR) << "Failed to get firmware version: " << legacyErrorToString(legacy_status); + WifiStatus status = + createWifiStatusFromLegacyError(legacy_status, "failed to get firmware version"); return {status, result}; } result.firmwareDescription = firmware_desc.c_str(); @@ -924,32 +834,25 @@ WifiChip::requestChipDebugInfoInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), result}; } -std::pair> -WifiChip::requestDriverDebugDumpInternal() { +std::pair> WifiChip::requestDriverDebugDumpInternal() { legacy_hal::wifi_error legacy_status; std::vector driver_dump; std::tie(legacy_status, driver_dump) = - legacy_hal_.lock()->requestDriverMemoryDump( - getFirstActiveWlanIfaceName()); + legacy_hal_.lock()->requestDriverMemoryDump(getFirstActiveWlanIfaceName()); if (legacy_status != legacy_hal::WIFI_SUCCESS) { - LOG(ERROR) << "Failed to get driver debug dump: " - << legacyErrorToString(legacy_status); - return {createWifiStatusFromLegacyError(legacy_status), - std::vector()}; + LOG(ERROR) << "Failed to get driver debug dump: " << legacyErrorToString(legacy_status); + return {createWifiStatusFromLegacyError(legacy_status), std::vector()}; } return {createWifiStatus(WifiStatusCode::SUCCESS), driver_dump}; } -std::pair> -WifiChip::requestFirmwareDebugDumpInternal() { +std::pair> WifiChip::requestFirmwareDebugDumpInternal() { legacy_hal::wifi_error legacy_status; std::vector firmware_dump; std::tie(legacy_status, firmware_dump) = - legacy_hal_.lock()->requestFirmwareMemoryDump( - getFirstActiveWlanIfaceName()); + legacy_hal_.lock()->requestFirmwareMemoryDump(getFirstActiveWlanIfaceName()); if (legacy_status != legacy_hal::WIFI_SUCCESS) { - LOG(ERROR) << "Failed to get firmware debug dump: " - << legacyErrorToString(legacy_status); + LOG(ERROR) << "Failed to get firmware debug dump: " << legacyErrorToString(legacy_status); return {createWifiStatusFromLegacyError(legacy_status), {}}; } return {createWifiStatus(WifiStatusCode::SUCCESS), firmware_dump}; @@ -958,8 +861,7 @@ WifiChip::requestFirmwareDebugDumpInternal() { WifiStatus WifiChip::createVirtualApInterface(const std::string& apVirtIf) { legacy_hal::wifi_error legacy_status; legacy_status = legacy_hal_.lock()->createVirtualInterface( - apVirtIf, - hidl_struct_util::convertHidlIfaceTypeToLegacy(IfaceType::AP)); + apVirtIf, hidl_struct_util::convertHidlIfaceTypeToLegacy(IfaceType::AP)); if (legacy_status != legacy_hal::WIFI_SUCCESS) { LOG(ERROR) << "Failed to add interface: " << apVirtIf << " " << legacyErrorToString(legacy_status); @@ -975,8 +877,7 @@ sp WifiChip::newWifiApIface(std::string& ifname) { ap_instances = it.second; } } - sp iface = - new WifiApIface(ifname, ap_instances, legacy_hal_, iface_util_); + sp iface = new WifiApIface(ifname, ap_instances, legacy_hal_, iface_util_); ap_ifaces_.push_back(iface); for (const auto& callback : event_cb_handler_.getCallbacks()) { if (!callback->onIfaceAdded(IfaceType::AP, ifname).isOk()) { @@ -987,8 +888,7 @@ sp WifiChip::newWifiApIface(std::string& ifname) { return iface; } -std::pair> -WifiChip::createApIfaceInternal() { +std::pair> WifiChip::createApIfaceInternal() { if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::AP)) { return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } @@ -1001,8 +901,7 @@ WifiChip::createApIfaceInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), iface}; } -std::pair> -WifiChip::createBridgedApIfaceInternal() { +std::pair> WifiChip::createBridgedApIfaceInternal() { if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::AP)) { return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } @@ -1018,7 +917,7 @@ WifiChip::createBridgedApIfaceInternal() { if (i != 0) { // The failure happened when creating second virtual // iface. legacy_hal_.lock()->deleteVirtualInterface( - ap_instances.front()); // Remove the first virtual iface. + ap_instances.front()); // Remove the first virtual iface. } return {status, {}}; } @@ -1032,8 +931,7 @@ WifiChip::createBridgedApIfaceInternal() { for (auto const& instance : ap_instances) { // Bind ap instance interface to AP bridge if (!iface_util_->addIfaceToBridge(br_ifname, instance)) { - LOG(ERROR) << "Failed add if to Bridge - if_name=" - << instance.c_str(); + LOG(ERROR) << "Failed add if to Bridge - if_name=" << instance.c_str(); invalidateAndClearBridgedAp(br_ifname); return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } @@ -1042,8 +940,7 @@ WifiChip::createBridgedApIfaceInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), iface}; } -std::pair> -WifiChip::getApIfaceNamesInternal() { +std::pair> WifiChip::getApIfaceNamesInternal() { if (ap_ifaces_.empty()) { return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; } @@ -1051,7 +948,7 @@ WifiChip::getApIfaceNamesInternal() { } std::pair> WifiChip::getApIfaceInternal( - const std::string& ifname) { + const std::string& ifname) { const auto iface = findUsingName(ap_ifaces_, ifname); if (!iface.get()) { return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), nullptr}; @@ -1082,7 +979,7 @@ WifiStatus WifiChip::removeApIfaceInternal(const std::string& ifname) { } WifiStatus WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal( - const std::string& ifname, const std::string& ifInstanceName) { + const std::string& ifname, const std::string& ifInstanceName) { const auto iface = findUsingName(ap_ifaces_, ifname); if (!iface.get() || ifInstanceName.empty()) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); @@ -1094,23 +991,20 @@ WifiStatus WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal( for (auto const& iface : ap_instances) { if (iface == ifInstanceName) { if (!iface_util_->removeIfaceFromBridge(it.first, iface)) { - LOG(ERROR) - << "Failed to remove interface: " << ifInstanceName - << " from " << ifname; - return createWifiStatus( - WifiStatusCode::ERROR_NOT_AVAILABLE); + LOG(ERROR) << "Failed to remove interface: " << ifInstanceName << " from " + << ifname; + return createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE); } legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->deleteVirtualInterface(iface); + legacy_hal_.lock()->deleteVirtualInterface(iface); if (legacy_status != legacy_hal::WIFI_SUCCESS) { - LOG(ERROR) << "Failed to del interface: " << iface - << " " << legacyErrorToString(legacy_status); + LOG(ERROR) << "Failed to del interface: " << iface << " " + << legacyErrorToString(legacy_status); return createWifiStatusFromLegacyError(legacy_status); } ap_instances.erase( - std::remove(ap_instances.begin(), ap_instances.end(), - ifInstanceName), - ap_instances.end()); + std::remove(ap_instances.begin(), ap_instances.end(), ifInstanceName), + ap_instances.end()); br_ifaces_ap_instances_[ifname] = ap_instances; break; } @@ -1124,8 +1018,7 @@ WifiStatus WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal( return createWifiStatus(WifiStatusCode::SUCCESS); } -std::pair> -WifiChip::createNanIfaceInternal() { +std::pair> WifiChip::createNanIfaceInternal() { if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::NAN)) { return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } @@ -1137,8 +1030,7 @@ WifiChip::createNanIfaceInternal() { ifname = getFirstActiveWlanIfaceName(); is_dedicated_iface = false; } - sp iface = - new WifiNanIface(ifname, is_dedicated_iface, legacy_hal_, iface_util_); + sp iface = new WifiNanIface(ifname, is_dedicated_iface, legacy_hal_, iface_util_); nan_ifaces_.push_back(iface); for (const auto& callback : event_cb_handler_.getCallbacks()) { if (!callback->onIfaceAdded(IfaceType::NAN, ifname).isOk()) { @@ -1148,8 +1040,7 @@ WifiChip::createNanIfaceInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), iface}; } -std::pair> -WifiChip::getNanIfaceNamesInternal() { +std::pair> WifiChip::getNanIfaceNamesInternal() { if (nan_ifaces_.empty()) { return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; } @@ -1157,7 +1048,7 @@ WifiChip::getNanIfaceNamesInternal() { } std::pair> WifiChip::getNanIfaceInternal( - const std::string& ifname) { + const std::string& ifname) { const auto iface = findUsingName(nan_ifaces_, ifname); if (!iface.get()) { return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), nullptr}; @@ -1194,16 +1085,14 @@ std::pair> WifiChip::createP2pIfaceInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), iface}; } -std::pair> -WifiChip::getP2pIfaceNamesInternal() { +std::pair> WifiChip::getP2pIfaceNamesInternal() { if (p2p_ifaces_.empty()) { return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; } return {createWifiStatus(WifiStatusCode::SUCCESS), getNames(p2p_ifaces_)}; } -std::pair> WifiChip::getP2pIfaceInternal( - const std::string& ifname) { +std::pair> WifiChip::getP2pIfaceInternal(const std::string& ifname) { const auto iface = findUsingName(p2p_ifaces_, ifname); if (!iface.get()) { return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), nullptr}; @@ -1225,16 +1114,13 @@ WifiStatus WifiChip::removeP2pIfaceInternal(const std::string& ifname) { return createWifiStatus(WifiStatusCode::SUCCESS); } -std::pair> -WifiChip::createStaIfaceInternal() { +std::pair> WifiChip::createStaIfaceInternal() { if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::STA)) { return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } std::string ifname = allocateStaIfaceName(); - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->createVirtualInterface( - ifname, - hidl_struct_util::convertHidlIfaceTypeToLegacy(IfaceType::STA)); + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->createVirtualInterface( + ifname, hidl_struct_util::convertHidlIfaceTypeToLegacy(IfaceType::STA)); if (legacy_status != legacy_hal::WIFI_SUCCESS) { LOG(ERROR) << "Failed to add interface: " << ifname << " " << legacyErrorToString(legacy_status); @@ -1251,8 +1137,7 @@ WifiChip::createStaIfaceInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), iface}; } -std::pair> -WifiChip::getStaIfaceNamesInternal() { +std::pair> WifiChip::getStaIfaceNamesInternal() { if (sta_ifaces_.empty()) { return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; } @@ -1260,7 +1145,7 @@ WifiChip::getStaIfaceNamesInternal() { } std::pair> WifiChip::getStaIfaceInternal( - const std::string& ifname) { + const std::string& ifname) { const auto iface = findUsingName(sta_ifaces_, ifname); if (!iface.get()) { return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), nullptr}; @@ -1275,8 +1160,7 @@ WifiStatus WifiChip::removeStaIfaceInternal(const std::string& ifname) { } // Invalidate & remove any dependent objects first. invalidateAndRemoveDependencies(ifname); - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->deleteVirtualInterface(ifname); + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->deleteVirtualInterface(ifname); if (legacy_status != legacy_hal::WIFI_SUCCESS) { LOG(ERROR) << "Failed to remove interface: " << ifname << " " << legacyErrorToString(legacy_status); @@ -1291,8 +1175,8 @@ WifiStatus WifiChip::removeStaIfaceInternal(const std::string& ifname) { return createWifiStatus(WifiStatusCode::SUCCESS); } -std::pair> -WifiChip::createRttControllerInternal(const sp& /*bound_iface*/) { +std::pair> WifiChip::createRttControllerInternal( + const sp& /*bound_iface*/) { LOG(ERROR) << "createRttController is not supported on this HAL"; return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; } @@ -1300,38 +1184,33 @@ WifiChip::createRttControllerInternal(const sp& /*bound_iface*/) { std::pair> WifiChip::getDebugRingBuffersStatusInternal() { legacy_hal::wifi_error legacy_status; - std::vector - legacy_ring_buffer_status_vec; + std::vector legacy_ring_buffer_status_vec; std::tie(legacy_status, legacy_ring_buffer_status_vec) = - legacy_hal_.lock()->getRingBuffersStatus(getFirstActiveWlanIfaceName()); + legacy_hal_.lock()->getRingBuffersStatus(getFirstActiveWlanIfaceName()); if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {createWifiStatusFromLegacyError(legacy_status), {}}; } std::vector hidl_ring_buffer_status_vec; if (!hidl_struct_util::convertLegacyVectorOfDebugRingBufferStatusToHidl( - legacy_ring_buffer_status_vec, &hidl_ring_buffer_status_vec)) { + legacy_ring_buffer_status_vec, &hidl_ring_buffer_status_vec)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; } - return {createWifiStatus(WifiStatusCode::SUCCESS), - hidl_ring_buffer_status_vec}; + return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_ring_buffer_status_vec}; } WifiStatus WifiChip::startLoggingToDebugRingBufferInternal( - const hidl_string& ring_name, WifiDebugRingBufferVerboseLevel verbose_level, - uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes) { + const hidl_string& ring_name, WifiDebugRingBufferVerboseLevel verbose_level, + uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes) { WifiStatus status = registerDebugRingBufferCallback(); if (status.code != WifiStatusCode::SUCCESS) { return status; } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->startRingBufferLogging( + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRingBufferLogging( getFirstActiveWlanIfaceName(), ring_name, - static_cast< - std::underlying_type::type>( - verbose_level), + static_cast::type>(verbose_level), max_interval_in_sec, min_data_size_in_bytes); - ringbuffer_map_.insert(std::pair( - ring_name, Ringbuffer(kMaxBufferSizeBytes))); + ringbuffer_map_.insert( + std::pair(ring_name, Ringbuffer(kMaxBufferSizeBytes))); // if verbose logging enabled, turn up HAL daemon logging as well. if (verbose_level < WifiDebugRingBufferVerboseLevel::VERBOSE) { android::base::SetMinimumLogSeverity(android::base::DEBUG); @@ -1341,15 +1220,13 @@ WifiStatus WifiChip::startLoggingToDebugRingBufferInternal( return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiChip::forceDumpToDebugRingBufferInternal( - const hidl_string& ring_name) { +WifiStatus WifiChip::forceDumpToDebugRingBufferInternal(const hidl_string& ring_name) { WifiStatus status = registerDebugRingBufferCallback(); if (status.code != WifiStatusCode::SUCCESS) { return status; } legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->getRingBufferData(getFirstActiveWlanIfaceName(), - ring_name); + legacy_hal_.lock()->getRingBufferData(getFirstActiveWlanIfaceName(), ring_name); return createWifiStatusFromLegacyError(legacy_status); } @@ -1364,8 +1241,7 @@ WifiStatus WifiChip::flushRingBufferToFileInternal() { WifiStatus WifiChip::stopLoggingToDebugRingBufferInternal() { legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->deregisterRingBufferCallbackHandler( - getFirstActiveWlanIfaceName()); + legacy_hal_.lock()->deregisterRingBufferCallbackHandler(getFirstActiveWlanIfaceName()); if (legacy_status == legacy_hal::WIFI_SUCCESS) { debug_ring_buffer_cb_registered_ = false; } @@ -1377,13 +1253,12 @@ WifiChip::getDebugHostWakeReasonStatsInternal() { legacy_hal::wifi_error legacy_status; legacy_hal::WakeReasonStats legacy_stats; std::tie(legacy_status, legacy_stats) = - legacy_hal_.lock()->getWakeReasonStats(getFirstActiveWlanIfaceName()); + legacy_hal_.lock()->getWakeReasonStats(getFirstActiveWlanIfaceName()); if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {createWifiStatusFromLegacyError(legacy_status), {}}; } WifiDebugHostWakeReasonStats hidl_stats; - if (!hidl_struct_util::convertLegacyWakeReasonStatsToHidl(legacy_stats, - &hidl_stats)) { + if (!hidl_struct_util::convertLegacyWakeReasonStatsToHidl(legacy_stats, &hidl_stats)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; } return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_stats}; @@ -1393,62 +1268,56 @@ WifiStatus WifiChip::enableDebugErrorAlertsInternal(bool enable) { legacy_hal::wifi_error legacy_status; if (enable) { android::wp weak_ptr_this(this); - const auto& on_alert_callback = [weak_ptr_this]( - int32_t error_code, - std::vector debug_data) { + const auto& on_alert_callback = [weak_ptr_this](int32_t error_code, + std::vector debug_data) { const auto shared_ptr_this = weak_ptr_this.promote(); 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->onDebugErrorAlert(error_code, debug_data) - .isOk()) { + if (!callback->onDebugErrorAlert(error_code, debug_data).isOk()) { LOG(ERROR) << "Failed to invoke onDebugErrorAlert callback"; } } }; legacy_status = legacy_hal_.lock()->registerErrorAlertCallbackHandler( - getFirstActiveWlanIfaceName(), on_alert_callback); + getFirstActiveWlanIfaceName(), on_alert_callback); } else { legacy_status = legacy_hal_.lock()->deregisterErrorAlertCallbackHandler( - getFirstActiveWlanIfaceName()); + getFirstActiveWlanIfaceName()); } return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiChip::selectTxPowerScenarioInternal( - V1_1::IWifiChip::TxPowerScenario scenario) { +WifiStatus WifiChip::selectTxPowerScenarioInternal(V1_1::IWifiChip::TxPowerScenario scenario) { auto legacy_status = legacy_hal_.lock()->selectTxPowerScenario( - getFirstActiveWlanIfaceName(), - hidl_struct_util::convertHidlTxPowerScenarioToLegacy(scenario)); + getFirstActiveWlanIfaceName(), + hidl_struct_util::convertHidlTxPowerScenarioToLegacy(scenario)); return createWifiStatusFromLegacyError(legacy_status); } WifiStatus WifiChip::resetTxPowerScenarioInternal() { - auto legacy_status = - legacy_hal_.lock()->resetTxPowerScenario(getFirstActiveWlanIfaceName()); + auto legacy_status = legacy_hal_.lock()->resetTxPowerScenario(getFirstActiveWlanIfaceName()); return createWifiStatusFromLegacyError(legacy_status); } WifiStatus WifiChip::setLatencyModeInternal(LatencyMode mode) { auto legacy_status = legacy_hal_.lock()->setLatencyMode( - getFirstActiveWlanIfaceName(), - hidl_struct_util::convertHidlLatencyModeToLegacy(mode)); + getFirstActiveWlanIfaceName(), hidl_struct_util::convertHidlLatencyModeToLegacy(mode)); return createWifiStatusFromLegacyError(legacy_status); } WifiStatus WifiChip::registerEventCallbackInternal_1_2( - const sp& /* event_callback */) { + const sp& /* event_callback */) { // Deprecated support for this callback. return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); } -WifiStatus WifiChip::selectTxPowerScenarioInternal_1_2( - TxPowerScenario scenario) { +WifiStatus WifiChip::selectTxPowerScenarioInternal_1_2(TxPowerScenario scenario) { auto legacy_status = legacy_hal_.lock()->selectTxPowerScenario( - getFirstActiveWlanIfaceName(), - hidl_struct_util::convertHidlTxPowerScenarioToLegacy_1_2(scenario)); + getFirstActiveWlanIfaceName(), + hidl_struct_util::convertHidlTxPowerScenarioToLegacy_1_2(scenario)); return createWifiStatusFromLegacyError(legacy_status); } @@ -1463,65 +1332,61 @@ std::pair WifiChip::getCapabilitiesInternal_1_5() { uint32_t legacy_logger_feature_set; const auto ifname = getFirstActiveWlanIfaceName(); std::tie(legacy_status, legacy_feature_set) = - legacy_hal_.lock()->getSupportedFeatureSet(ifname); + legacy_hal_.lock()->getSupportedFeatureSet(ifname); if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {createWifiStatusFromLegacyError(legacy_status), 0}; } std::tie(legacy_status, legacy_logger_feature_set) = - legacy_hal_.lock()->getLoggerSupportedFeatureSet(ifname); + legacy_hal_.lock()->getLoggerSupportedFeatureSet(ifname); if (legacy_status != legacy_hal::WIFI_SUCCESS) { // some devices don't support querying logger feature set legacy_logger_feature_set = 0; } uint32_t hidl_caps; if (!hidl_struct_util::convertLegacyFeaturesToHidlChipCapabilities( - legacy_feature_set, legacy_logger_feature_set, &hidl_caps)) { + legacy_feature_set, legacy_logger_feature_set, &hidl_caps)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), 0}; } return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps}; } -std::pair> -WifiChip::createRttControllerInternal_1_4(const sp& bound_iface) { - if (sta_ifaces_.size() == 0 && - !canCurrentModeSupportIfaceOfType(IfaceType::STA)) { - LOG(ERROR) - << "createRttControllerInternal_1_4: Chip cannot support STAs " - "(and RTT by extension)"; +std::pair> WifiChip::createRttControllerInternal_1_4( + const sp& bound_iface) { + if (sta_ifaces_.size() == 0 && !canCurrentModeSupportIfaceOfType(IfaceType::STA)) { + LOG(ERROR) << "createRttControllerInternal_1_4: Chip cannot support STAs " + "(and RTT by extension)"; return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } - sp rtt = new WifiRttController( - getFirstActiveWlanIfaceName(), bound_iface, legacy_hal_); + sp rtt = + new WifiRttController(getFirstActiveWlanIfaceName(), bound_iface, legacy_hal_); rtt_controllers_.emplace_back(rtt); return {createWifiStatus(WifiStatusCode::SUCCESS), rtt}; } WifiStatus WifiChip::registerEventCallbackInternal_1_4( - const sp& event_callback) { + const sp& event_callback) { if (!event_cb_handler_.addCallback(event_callback)) { return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } return createWifiStatus(WifiStatusCode::SUCCESS); } -WifiStatus WifiChip::setMultiStaPrimaryConnectionInternal( - const std::string& ifname) { - auto legacy_status = - legacy_hal_.lock()->multiStaSetPrimaryConnection(ifname); +WifiStatus WifiChip::setMultiStaPrimaryConnectionInternal(const std::string& ifname) { + auto legacy_status = legacy_hal_.lock()->multiStaSetPrimaryConnection(ifname); return createWifiStatusFromLegacyError(legacy_status); } WifiStatus WifiChip::setMultiStaUseCaseInternal(MultiStaUseCase use_case) { auto legacy_status = legacy_hal_.lock()->multiStaSetUseCase( - hidl_struct_util::convertHidlMultiStaUseCaseToLegacy(use_case)); + hidl_struct_util::convertHidlMultiStaUseCaseToLegacy(use_case)); return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiChip::setCoexUnsafeChannelsInternal( - std::vector unsafe_channels, uint32_t restrictions) { +WifiStatus WifiChip::setCoexUnsafeChannelsInternal(std::vector unsafe_channels, + uint32_t restrictions) { std::vector legacy_unsafe_channels; - if (!hidl_struct_util::convertHidlVectorOfCoexUnsafeChannelToLegacy( - unsafe_channels, &legacy_unsafe_channels)) { + if (!hidl_struct_util::convertHidlVectorOfCoexUnsafeChannelToLegacy(unsafe_channels, + &legacy_unsafe_channels)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); } uint32_t legacy_restrictions = 0; @@ -1534,35 +1399,31 @@ WifiStatus WifiChip::setCoexUnsafeChannelsInternal( if (restrictions & CoexRestriction::WIFI_AWARE) { legacy_restrictions |= legacy_hal::wifi_coex_restriction::WIFI_AWARE; } - auto legacy_status = legacy_hal_.lock()->setCoexUnsafeChannels( - legacy_unsafe_channels, legacy_restrictions); + auto legacy_status = + legacy_hal_.lock()->setCoexUnsafeChannels(legacy_unsafe_channels, legacy_restrictions); return createWifiStatusFromLegacyError(legacy_status); } WifiStatus WifiChip::setCountryCodeInternal(const std::array& code) { - auto legacy_status = - legacy_hal_.lock()->setCountryCode(getFirstActiveWlanIfaceName(), code); + auto legacy_status = legacy_hal_.lock()->setCountryCode(getFirstActiveWlanIfaceName(), code); return createWifiStatusFromLegacyError(legacy_status); } -std::pair> -WifiChip::getUsableChannelsInternal(WifiBand band, uint32_t ifaceModeMask, - uint32_t filterMask) { +std::pair> WifiChip::getUsableChannelsInternal( + WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask) { legacy_hal::wifi_error legacy_status; std::vector legacy_usable_channels; - std::tie(legacy_status, legacy_usable_channels) = - legacy_hal_.lock()->getUsableChannels( + std::tie(legacy_status, legacy_usable_channels) = legacy_hal_.lock()->getUsableChannels( hidl_struct_util::convertHidlWifiBandToLegacyMacBand(band), hidl_struct_util::convertHidlWifiIfaceModeToLegacy(ifaceModeMask), - hidl_struct_util::convertHidlUsableChannelFilterToLegacy( - filterMask)); + hidl_struct_util::convertHidlUsableChannelFilterToLegacy(filterMask)); if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {createWifiStatusFromLegacyError(legacy_status), {}}; } std::vector hidl_usable_channels; - if (!hidl_struct_util::convertLegacyWifiUsableChannelsToHidl( - legacy_usable_channels, &hidl_usable_channels)) { + if (!hidl_struct_util::convertLegacyWifiUsableChannelsToHidl(legacy_usable_channels, + &hidl_usable_channels)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; } return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_usable_channels}; @@ -1574,19 +1435,15 @@ WifiStatus WifiChip::triggerSubsystemRestartInternal() { } WifiStatus WifiChip::handleChipConfiguration( - /* NONNULL */ std::unique_lock* lock, - ChipModeId mode_id) { + /* NONNULL */ std::unique_lock* lock, ChipModeId mode_id) { // If the chip is already configured in a different mode, stop // the legacy HAL and then start it after firmware mode change. if (isValidModeId(current_mode_id_)) { - LOG(INFO) << "Reconfiguring chip from mode " << current_mode_id_ - << " to mode " << mode_id; + LOG(INFO) << "Reconfiguring chip from mode " << current_mode_id_ << " to mode " << mode_id; invalidateAndRemoveAllIfaces(); - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->stop(lock, []() {}); + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->stop(lock, []() {}); if (legacy_status != legacy_hal::WIFI_SUCCESS) { - LOG(ERROR) << "Failed to stop legacy HAL: " - << legacyErrorToString(legacy_status); + LOG(ERROR) << "Failed to stop legacy HAL: " << legacyErrorToString(legacy_status); return createWifiStatusFromLegacyError(legacy_status); } } @@ -1602,8 +1459,7 @@ WifiStatus WifiChip::handleChipConfiguration( } legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->start(); if (legacy_status != legacy_hal::WIFI_SUCCESS) { - LOG(ERROR) << "Failed to start legacy HAL: " - << legacyErrorToString(legacy_status); + LOG(ERROR) << "Failed to start legacy HAL: " << legacyErrorToString(legacy_status); return createWifiStatusFromLegacyError(legacy_status); } // Every time the HAL is restarted, we need to register the @@ -1619,8 +1475,7 @@ WifiStatus WifiChip::handleChipConfiguration( if (WifiStatusCode::SUCCESS == version_info.first.code) { property_set("vendor.wlan.firmware.version", version_info.second.firmwareDescription.c_str()); - property_set("vendor.wlan.driver.version", - version_info.second.driverDescription.c_str()); + property_set("vendor.wlan.driver.version", version_info.second.driverDescription.c_str()); } return createWifiStatus(WifiStatusCode::SUCCESS); @@ -1633,36 +1488,33 @@ WifiStatus WifiChip::registerDebugRingBufferCallback() { android::wp weak_ptr_this(this); const auto& on_ring_buffer_data_callback = - [weak_ptr_this](const std::string& name, - const std::vector& data, - const legacy_hal::wifi_ring_buffer_status& status) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - WifiDebugRingBufferStatus hidl_status; - if (!hidl_struct_util::convertLegacyDebugRingBufferStatusToHidl( - status, &hidl_status)) { - LOG(ERROR) << "Error converting ring buffer status"; - return; - } - { - std::unique_lock lk(shared_ptr_this->lock_t); - const auto& target = - shared_ptr_this->ringbuffer_map_.find(name); - if (target != shared_ptr_this->ringbuffer_map_.end()) { - Ringbuffer& cur_buffer = target->second; - cur_buffer.append(data); - } else { - LOG(ERROR) << "Ringname " << name << " not found"; + [weak_ptr_this](const std::string& name, const std::vector& data, + const legacy_hal::wifi_ring_buffer_status& status) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; return; } - // unique_lock unlocked here - } - }; - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->registerRingBufferCallbackHandler( + WifiDebugRingBufferStatus hidl_status; + if (!hidl_struct_util::convertLegacyDebugRingBufferStatusToHidl(status, + &hidl_status)) { + LOG(ERROR) << "Error converting ring buffer status"; + return; + } + { + std::unique_lock lk(shared_ptr_this->lock_t); + const auto& target = shared_ptr_this->ringbuffer_map_.find(name); + if (target != shared_ptr_this->ringbuffer_map_.end()) { + Ringbuffer& cur_buffer = target->second; + cur_buffer.append(data); + } else { + LOG(ERROR) << "Ringname " << name << " not found"; + return; + } + // unique_lock unlocked here + } + }; + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->registerRingBufferCallbackHandler( getFirstActiveWlanIfaceName(), on_ring_buffer_data_callback); if (legacy_status == legacy_hal::WIFI_SUCCESS) { @@ -1674,35 +1526,32 @@ WifiStatus WifiChip::registerDebugRingBufferCallback() { WifiStatus WifiChip::registerRadioModeChangeCallback() { android::wp weak_ptr_this(this); const auto& on_radio_mode_change_callback = - [weak_ptr_this](const std::vector& mac_infos) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - std::vector - hidl_radio_mode_infos; - if (!hidl_struct_util::convertLegacyWifiMacInfosToHidl( - mac_infos, &hidl_radio_mode_infos)) { - LOG(ERROR) << "Error converting wifi mac info"; - return; - } - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->onRadioModeChange_1_4(hidl_radio_mode_infos) - .isOk()) { - LOG(ERROR) << "Failed to invoke onRadioModeChange_1_4" - << " callback on: " << toString(callback); + [weak_ptr_this](const std::vector& mac_infos) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; } - } - }; + std::vector hidl_radio_mode_infos; + if (!hidl_struct_util::convertLegacyWifiMacInfosToHidl(mac_infos, + &hidl_radio_mode_infos)) { + LOG(ERROR) << "Error converting wifi mac info"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onRadioModeChange_1_4(hidl_radio_mode_infos).isOk()) { + LOG(ERROR) << "Failed to invoke onRadioModeChange_1_4" + << " callback on: " << toString(callback); + } + } + }; legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->registerRadioModeChangeCallbackHandler( - getFirstActiveWlanIfaceName(), on_radio_mode_change_callback); + legacy_hal_.lock()->registerRadioModeChangeCallbackHandler( + getFirstActiveWlanIfaceName(), on_radio_mode_change_callback); return createWifiStatusFromLegacyError(legacy_status); } -std::vector -WifiChip::getCurrentModeIfaceCombinations() { +std::vector WifiChip::getCurrentModeIfaceCombinations() { if (!isValidModeId(current_mode_id_)) { LOG(ERROR) << "Chip not configured in a mode yet"; return {}; @@ -1732,7 +1581,7 @@ std::map WifiChip::getCurrentIfaceCombination() { // of ifaces of each type in the combination. // This method is a port of HalDeviceManager.expandIfaceCombos() from framework. std::vector> WifiChip::expandIfaceCombinations( - const V1_4::IWifiChip::ChipIfaceCombination& combination) { + const V1_4::IWifiChip::ChipIfaceCombination& combination) { uint32_t num_expanded_combos = 1; for (const auto& limit : combination.limits) { for (uint32_t i = 0; i < limit.maxIfaces; i++) { @@ -1745,8 +1594,7 @@ std::vector> WifiChip::expandIfaceCombinations( std::vector> expanded_combos; expanded_combos.resize(num_expanded_combos); for (auto& expanded_combo : expanded_combos) { - for (const auto type : - {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) { + for (const auto type : {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) { expanded_combo[type] = 0; } } @@ -1755,8 +1603,7 @@ std::vector> WifiChip::expandIfaceCombinations( for (uint32_t i = 0; i < limit.maxIfaces; i++) { span /= limit.types.size(); for (uint32_t k = 0; k < num_expanded_combos; ++k) { - const auto iface_type = - limit.types[(k / span) % limit.types.size()]; + const auto iface_type = limit.types[(k / span) % limit.types.size()]; expanded_combos[k][iface_type]++; } } @@ -1765,13 +1612,11 @@ std::vector> WifiChip::expandIfaceCombinations( } bool WifiChip::canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces( - const std::map& expanded_combo, - IfaceType requested_type) { + const std::map& expanded_combo, IfaceType requested_type) { const auto current_combo = getCurrentIfaceCombination(); // Check if we have space for 1 more iface of |type| in this combo - for (const auto type : - {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) { + for (const auto type : {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) { size_t num_ifaces_needed = current_combo.at(type); if (type == requested_type) { num_ifaces_needed++; @@ -1789,8 +1634,7 @@ bool WifiChip::canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces( // ChipIfaceCombination. // b) Check if the requested iface type can be added to the current mode // with the iface combination that is already active. -bool WifiChip::canCurrentModeSupportIfaceOfTypeWithCurrentIfaces( - IfaceType requested_type) { +bool WifiChip::canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType requested_type) { if (!isValidModeId(current_mode_id_)) { LOG(ERROR) << "Chip not configured in a mode yet"; return false; @@ -1799,8 +1643,8 @@ bool WifiChip::canCurrentModeSupportIfaceOfTypeWithCurrentIfaces( for (const auto& combination : combinations) { const auto expanded_combos = expandIfaceCombinations(combination); for (const auto& expanded_combo : expanded_combos) { - if (canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces( - expanded_combo, requested_type)) { + if (canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces(expanded_combo, + requested_type)) { return true; } } @@ -1811,11 +1655,10 @@ bool WifiChip::canCurrentModeSupportIfaceOfTypeWithCurrentIfaces( // Note: This does not consider ifaces already active. It only checks if the // provided expanded iface combination can support the requested combo. bool WifiChip::canExpandedIfaceComboSupportIfaceCombo( - const std::map& expanded_combo, - const std::map& req_combo) { + const std::map& expanded_combo, + const std::map& req_combo) { // Check if we have space for 1 more iface of |type| in this combo - for (const auto type : - {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) { + for (const auto type : {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) { if (req_combo.count(type) == 0) { // Iface of "type" not in the req_combo. continue; @@ -1834,8 +1677,7 @@ bool WifiChip::canExpandedIfaceComboSupportIfaceCombo( // b) Check if the requested iface combo can be added to the current mode. // Note: This does not consider ifaces already active. It only checks if the // current mode can support the requested combo. -bool WifiChip::canCurrentModeSupportIfaceCombo( - const std::map& req_combo) { +bool WifiChip::canCurrentModeSupportIfaceCombo(const std::map& req_combo) { if (!isValidModeId(current_mode_id_)) { LOG(ERROR) << "Chip not configured in a mode yet"; return false; @@ -1844,8 +1686,7 @@ bool WifiChip::canCurrentModeSupportIfaceCombo( for (const auto& combination : combinations) { const auto expanded_combos = expandIfaceCombinations(combination); for (const auto& expanded_combo : expanded_combos) { - if (canExpandedIfaceComboSupportIfaceCombo(expanded_combo, - req_combo)) { + if (canExpandedIfaceComboSupportIfaceCombo(expanded_combo, req_combo)) { return true; } } @@ -1909,8 +1750,7 @@ std::string WifiChip::getFirstActiveWlanIfaceName() { // Return the first wlan (wlan0, wlan1 etc.) starting from |start_idx| // not already in use. // Note: This doesn't check the actual presence of these interfaces. -std::string WifiChip::allocateApOrStaIfaceName(IfaceType type, - uint32_t start_idx) { +std::string WifiChip::allocateApOrStaIfaceName(IfaceType type, uint32_t start_idx) { for (unsigned idx = start_idx; idx < kMaxWlanIfaces; idx++) { const auto ifname = getWlanIfaceNameWithType(type, idx); if (findUsingNameFromBridgedApInstances(ifname)) continue; @@ -1955,8 +1795,8 @@ std::vector WifiChip::allocateBridgedApInstanceNames() { } else { int num_ifaces_need_to_allocate = 2 - instances.size(); for (int i = 0; i < num_ifaces_need_to_allocate; i++) { - std::string instance_name = allocateApOrStaIfaceName( - IfaceType::AP, startIdxOfApIface() + i); + std::string instance_name = + allocateApOrStaIfaceName(IfaceType::AP, startIdxOfApIface() + i); if (!instance_name.empty()) { instances.push_back(instance_name); } @@ -1984,8 +1824,7 @@ bool WifiChip::writeRingbufferFilesInternal() { if (cur_buffer.getData().empty()) { continue; } - const std::string file_path_raw = - kTombstoneFolderPath + item.first + "XXXXXXXXXX"; + const std::string file_path_raw = kTombstoneFolderPath + item.first + "XXXXXXXXXX"; const int dump_fd = mkstemp(makeCharVec(file_path_raw).data()); if (dump_fd == -1) { PLOG(ERROR) << "create file failed"; @@ -1993,8 +1832,8 @@ bool WifiChip::writeRingbufferFilesInternal() { } unique_fd file_auto_closer(dump_fd); for (const auto& cur_block : cur_buffer.getData()) { - if (write(dump_fd, cur_block.data(), - sizeof(cur_block[0]) * cur_block.size()) == -1) { + if (write(dump_fd, cur_block.data(), sizeof(cur_block[0]) * cur_block.size()) == + -1) { PLOG(ERROR) << "Error writing to file"; } } @@ -2009,8 +1848,7 @@ std::string WifiChip::getWlanIfaceNameWithType(IfaceType type, unsigned idx) { std::string ifname; // let the legacy hal override the interface name - legacy_hal::wifi_error err = - legacy_hal_.lock()->getSupportedIfaceName((uint32_t)type, ifname); + legacy_hal::wifi_error err = legacy_hal_.lock()->getSupportedIfaceName((uint32_t)type, ifname); if (err == legacy_hal::WIFI_SUCCESS) return ifname; return getWlanIfaceName(idx); @@ -2059,7 +1897,7 @@ bool WifiChip::findUsingNameFromBridgedApInstances(const std::string& name) { } } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_chip.h b/wifi/1.6/default/wifi_chip.h similarity index 55% rename from wifi/1.5/default/wifi_chip.h rename to wifi/1.6/default/wifi_chip.h index bd40ead35a..8a068985d1 100644 --- a/wifi/1.5/default/wifi_chip.h +++ b/wifi/1.6/default/wifi_chip.h @@ -39,9 +39,11 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { using namespace android::hardware::wifi::V1_0; +using V1_5::WifiBand; +using V1_5::WifiUsableChannel; /** * HIDL interface object used to control a Wifi HAL chip instance. @@ -49,15 +51,13 @@ using namespace android::hardware::wifi::V1_0; * identifying handle information stored here. */ class WifiChip : public V1_5::IWifiChip { - public: + public: WifiChip(ChipId chip_id, bool is_primary, const std::weak_ptr legacy_hal, - const std::weak_ptr - mode_controller, + const std::weak_ptr mode_controller, const std::shared_ptr iface_util, const std::weak_ptr feature_flags, - const std::function& - subsystemCallbackHandler); + const std::function& subsystemCallbackHandler); // HIDL does not provide a built-in mechanism to let the server invalidate // a HIDL interface object after creation. If any client process holds onto // a reference to the object in their context, any method calls on that @@ -78,116 +78,84 @@ class WifiChip : public V1_5::IWifiChip { // HIDL methods exposed. Return getId(getId_cb hidl_status_cb) override; // Deprecated support for this callback - Return registerEventCallback( - const sp& event_callback, - registerEventCallback_cb hidl_status_cb) override; + Return registerEventCallback(const sp& event_callback, + registerEventCallback_cb hidl_status_cb) override; Return getCapabilities(getCapabilities_cb hidl_status_cb) override; - Return getAvailableModes( - getAvailableModes_cb hidl_status_cb) override; - Return configureChip(ChipModeId mode_id, - configureChip_cb hidl_status_cb) override; + Return getAvailableModes(getAvailableModes_cb hidl_status_cb) override; + Return configureChip(ChipModeId mode_id, configureChip_cb hidl_status_cb) override; Return getMode(getMode_cb hidl_status_cb) override; - Return requestChipDebugInfo( - requestChipDebugInfo_cb hidl_status_cb) override; - Return requestDriverDebugDump( - requestDriverDebugDump_cb hidl_status_cb) override; - Return requestFirmwareDebugDump( - requestFirmwareDebugDump_cb hidl_status_cb) override; + Return requestChipDebugInfo(requestChipDebugInfo_cb hidl_status_cb) override; + Return requestDriverDebugDump(requestDriverDebugDump_cb hidl_status_cb) override; + Return requestFirmwareDebugDump(requestFirmwareDebugDump_cb hidl_status_cb) override; Return createApIface(createApIface_cb hidl_status_cb) override; - Return createBridgedApIface( - createBridgedApIface_cb hidl_status_cb) override; + Return createBridgedApIface(createBridgedApIface_cb hidl_status_cb) override; Return getApIfaceNames(getApIfaceNames_cb hidl_status_cb) override; - Return getApIface(const hidl_string& ifname, - getApIface_cb hidl_status_cb) override; - Return removeApIface(const hidl_string& ifname, - removeApIface_cb hidl_status_cb) override; + Return getApIface(const hidl_string& ifname, getApIface_cb hidl_status_cb) override; + Return removeApIface(const hidl_string& ifname, removeApIface_cb hidl_status_cb) override; Return removeIfaceInstanceFromBridgedApIface( - const hidl_string& brIfaceName, const hidl_string& ifaceInstanceName, - removeIfaceInstanceFromBridgedApIface_cb hidl_status_cb) override; + const hidl_string& brIfaceName, const hidl_string& ifaceInstanceName, + removeIfaceInstanceFromBridgedApIface_cb hidl_status_cb) override; Return createNanIface(createNanIface_cb hidl_status_cb) override; Return getNanIfaceNames(getNanIfaceNames_cb hidl_status_cb) override; - Return getNanIface(const hidl_string& ifname, - getNanIface_cb hidl_status_cb) override; + Return getNanIface(const hidl_string& ifname, getNanIface_cb hidl_status_cb) override; Return removeNanIface(const hidl_string& ifname, removeNanIface_cb hidl_status_cb) override; Return createP2pIface(createP2pIface_cb hidl_status_cb) override; Return getP2pIfaceNames(getP2pIfaceNames_cb hidl_status_cb) override; - Return getP2pIface(const hidl_string& ifname, - getP2pIface_cb hidl_status_cb) override; + Return getP2pIface(const hidl_string& ifname, getP2pIface_cb hidl_status_cb) override; Return removeP2pIface(const hidl_string& ifname, removeP2pIface_cb hidl_status_cb) override; Return createStaIface(createStaIface_cb hidl_status_cb) override; Return getStaIfaceNames(getStaIfaceNames_cb hidl_status_cb) override; - Return getStaIface(const hidl_string& ifname, - getStaIface_cb hidl_status_cb) override; + Return getStaIface(const hidl_string& ifname, getStaIface_cb hidl_status_cb) override; Return removeStaIface(const hidl_string& ifname, removeStaIface_cb hidl_status_cb) override; - Return createRttController( - const sp& bound_iface, - createRttController_cb hidl_status_cb) override; - Return getDebugRingBuffersStatus( - getDebugRingBuffersStatus_cb hidl_status_cb) override; + Return createRttController(const sp& bound_iface, + createRttController_cb hidl_status_cb) override; + Return getDebugRingBuffersStatus(getDebugRingBuffersStatus_cb hidl_status_cb) override; Return startLoggingToDebugRingBuffer( - const hidl_string& ring_name, - WifiDebugRingBufferVerboseLevel verbose_level, - uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes, - startLoggingToDebugRingBuffer_cb hidl_status_cb) override; - Return forceDumpToDebugRingBuffer( - const hidl_string& ring_name, - forceDumpToDebugRingBuffer_cb hidl_status_cb) override; - Return flushRingBufferToFile( - flushRingBufferToFile_cb hidl_status_cb) override; + const hidl_string& ring_name, WifiDebugRingBufferVerboseLevel verbose_level, + uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes, + startLoggingToDebugRingBuffer_cb hidl_status_cb) override; + Return forceDumpToDebugRingBuffer(const hidl_string& ring_name, + forceDumpToDebugRingBuffer_cb hidl_status_cb) override; + Return flushRingBufferToFile(flushRingBufferToFile_cb hidl_status_cb) override; Return stopLoggingToDebugRingBuffer( - stopLoggingToDebugRingBuffer_cb hidl_status_cb) override; + stopLoggingToDebugRingBuffer_cb hidl_status_cb) override; Return getDebugHostWakeReasonStats( - getDebugHostWakeReasonStats_cb hidl_status_cb) override; - Return enableDebugErrorAlerts( - bool enable, enableDebugErrorAlerts_cb hidl_status_cb) override; - Return selectTxPowerScenario( - V1_1::IWifiChip::TxPowerScenario scenario, - selectTxPowerScenario_cb hidl_status_cb) override; - Return resetTxPowerScenario( - resetTxPowerScenario_cb hidl_status_cb) override; - Return setLatencyMode(LatencyMode mode, - setLatencyMode_cb hidl_status_cb) override; - Return registerEventCallback_1_2( - const sp& event_callback, - registerEventCallback_1_2_cb hidl_status_cb) override; - Return selectTxPowerScenario_1_2( - TxPowerScenario scenario, - selectTxPowerScenario_cb hidl_status_cb) override; - Return getCapabilities_1_3( - getCapabilities_cb hidl_status_cb) override; - Return getCapabilities_1_5( - getCapabilities_1_5_cb hidl_status_cb) override; - Return debug(const hidl_handle& handle, - const hidl_vec& options) override; - Return createRttController_1_4( - const sp& bound_iface, - createRttController_1_4_cb hidl_status_cb) override; - Return registerEventCallback_1_4( - const sp& event_callback, - registerEventCallback_1_4_cb hidl_status_cb) override; + getDebugHostWakeReasonStats_cb hidl_status_cb) override; + Return enableDebugErrorAlerts(bool enable, + enableDebugErrorAlerts_cb hidl_status_cb) override; + Return selectTxPowerScenario(V1_1::IWifiChip::TxPowerScenario scenario, + selectTxPowerScenario_cb hidl_status_cb) override; + Return resetTxPowerScenario(resetTxPowerScenario_cb hidl_status_cb) override; + Return setLatencyMode(LatencyMode mode, setLatencyMode_cb hidl_status_cb) override; + Return registerEventCallback_1_2(const sp& event_callback, + registerEventCallback_1_2_cb hidl_status_cb) override; + Return selectTxPowerScenario_1_2(TxPowerScenario scenario, + selectTxPowerScenario_cb hidl_status_cb) override; + Return getCapabilities_1_3(getCapabilities_cb hidl_status_cb) override; + Return getCapabilities_1_5(getCapabilities_1_5_cb hidl_status_cb) override; + Return debug(const hidl_handle& handle, const hidl_vec& options) override; + Return createRttController_1_4(const sp& bound_iface, + createRttController_1_4_cb hidl_status_cb) override; + Return registerEventCallback_1_4(const sp& event_callback, + registerEventCallback_1_4_cb hidl_status_cb) override; Return setMultiStaPrimaryConnection( - const hidl_string& ifname, - setMultiStaPrimaryConnection_cb hidl_status_cb) override; - Return setMultiStaUseCase( - MultiStaUseCase use_case, - setMultiStaUseCase_cb hidl_status_cb) override; - Return setCoexUnsafeChannels( - const hidl_vec& unsafe_channels, - hidl_bitfield restrictions, - setCoexUnsafeChannels_cb hidl_status_cb) override; + const hidl_string& ifname, setMultiStaPrimaryConnection_cb hidl_status_cb) override; + Return setMultiStaUseCase(MultiStaUseCase use_case, + setMultiStaUseCase_cb hidl_status_cb) override; + Return setCoexUnsafeChannels(const hidl_vec& unsafe_channels, + hidl_bitfield restrictions, + setCoexUnsafeChannels_cb hidl_status_cb) override; Return setCountryCode(const hidl_array& code, setCountryCode_cb _hidl_cb) override; - Return getUsableChannels( - WifiBand band, hidl_bitfield ifaceModeMask, - hidl_bitfield filterMask, - getUsableChannels_cb _hidl_cb) override; - Return triggerSubsystemRestart( - triggerSubsystemRestart_cb hidl_status_cb) override; + Return getUsableChannels(WifiBand band, hidl_bitfield ifaceModeMask, + hidl_bitfield filterMask, + getUsableChannels_cb _hidl_cb) override; + Return triggerSubsystemRestart(triggerSubsystemRestart_cb hidl_status_cb) override; - private: + private: void invalidateAndRemoveAllIfaces(); // When a STA iface is removed any dependent NAN-ifaces/RTT-controllers are // invalidated & removed. @@ -197,99 +165,83 @@ class WifiChip : public V1_5::IWifiChip { std::pair getIdInternal(); // Deprecated support for this callback WifiStatus registerEventCallbackInternal( - const sp& event_callback); + const sp& event_callback); std::pair getCapabilitiesInternal(); std::pair> getAvailableModesInternal(); - WifiStatus configureChipInternal( - std::unique_lock* lock, ChipModeId mode_id); + WifiStatus configureChipInternal(std::unique_lock* lock, + ChipModeId mode_id); std::pair getModeInternal(); - std::pair - requestChipDebugInfoInternal(); - std::pair> - requestDriverDebugDumpInternal(); - std::pair> - requestFirmwareDebugDumpInternal(); + std::pair requestChipDebugInfoInternal(); + std::pair> requestDriverDebugDumpInternal(); + std::pair> requestFirmwareDebugDumpInternal(); sp newWifiApIface(std::string& ifname); WifiStatus createVirtualApInterface(const std::string& apVirtIf); std::pair> createApIfaceInternal(); - std::pair> - createBridgedApIfaceInternal(); + std::pair> createBridgedApIfaceInternal(); std::pair> getApIfaceNamesInternal(); - std::pair> getApIfaceInternal( - const std::string& ifname); + std::pair> getApIfaceInternal(const std::string& ifname); WifiStatus removeApIfaceInternal(const std::string& ifname); - WifiStatus removeIfaceInstanceFromBridgedApIfaceInternal( - const std::string& brIfaceName, const std::string& ifInstanceName); + WifiStatus removeIfaceInstanceFromBridgedApIfaceInternal(const std::string& brIfaceName, + const std::string& ifInstanceName); std::pair> createNanIfaceInternal(); std::pair> getNanIfaceNamesInternal(); - std::pair> getNanIfaceInternal( - const std::string& ifname); + std::pair> getNanIfaceInternal(const std::string& ifname); WifiStatus removeNanIfaceInternal(const std::string& ifname); std::pair> createP2pIfaceInternal(); std::pair> getP2pIfaceNamesInternal(); - std::pair> getP2pIfaceInternal( - const std::string& ifname); + std::pair> getP2pIfaceInternal(const std::string& ifname); WifiStatus removeP2pIfaceInternal(const std::string& ifname); std::pair> createStaIfaceInternal(); std::pair> getStaIfaceNamesInternal(); - std::pair> getStaIfaceInternal( - const std::string& ifname); + std::pair> getStaIfaceInternal(const std::string& ifname); WifiStatus removeStaIfaceInternal(const std::string& ifname); - std::pair> - createRttControllerInternal(const sp& bound_iface); + std::pair> createRttControllerInternal( + const sp& bound_iface); std::pair> getDebugRingBuffersStatusInternal(); - WifiStatus startLoggingToDebugRingBufferInternal( - const hidl_string& ring_name, - WifiDebugRingBufferVerboseLevel verbose_level, - uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes); + WifiStatus startLoggingToDebugRingBufferInternal(const hidl_string& ring_name, + WifiDebugRingBufferVerboseLevel verbose_level, + uint32_t max_interval_in_sec, + uint32_t min_data_size_in_bytes); WifiStatus forceDumpToDebugRingBufferInternal(const hidl_string& ring_name); WifiStatus flushRingBufferToFileInternal(); WifiStatus stopLoggingToDebugRingBufferInternal(); - std::pair - getDebugHostWakeReasonStatsInternal(); + std::pair getDebugHostWakeReasonStatsInternal(); WifiStatus enableDebugErrorAlertsInternal(bool enable); - WifiStatus selectTxPowerScenarioInternal( - V1_1::IWifiChip::TxPowerScenario scenario); + WifiStatus selectTxPowerScenarioInternal(V1_1::IWifiChip::TxPowerScenario scenario); WifiStatus resetTxPowerScenarioInternal(); WifiStatus setLatencyModeInternal(LatencyMode mode); WifiStatus registerEventCallbackInternal_1_2( - const sp& event_callback); + const sp& event_callback); WifiStatus selectTxPowerScenarioInternal_1_2(TxPowerScenario scenario); std::pair getCapabilitiesInternal_1_3(); std::pair getCapabilitiesInternal_1_5(); - std::pair> - createRttControllerInternal_1_4(const sp& bound_iface); + std::pair> createRttControllerInternal_1_4( + const sp& bound_iface); WifiStatus registerEventCallbackInternal_1_4( - const sp& event_callback); + const sp& event_callback); WifiStatus setMultiStaPrimaryConnectionInternal(const std::string& ifname); WifiStatus setMultiStaUseCaseInternal(MultiStaUseCase use_case); - WifiStatus setCoexUnsafeChannelsInternal( - std::vector unsafe_channels, uint32_t restrictions); + WifiStatus setCoexUnsafeChannelsInternal(std::vector unsafe_channels, + uint32_t restrictions); WifiStatus setCountryCodeInternal(const std::array& code); - std::pair> - getUsableChannelsInternal(WifiBand band, uint32_t ifaceModeMask, - uint32_t filterMask); - WifiStatus handleChipConfiguration( - std::unique_lock* lock, ChipModeId mode_id); + std::pair> getUsableChannelsInternal( + WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask); + WifiStatus handleChipConfiguration(std::unique_lock* lock, + ChipModeId mode_id); WifiStatus registerDebugRingBufferCallback(); WifiStatus registerRadioModeChangeCallback(); - std::vector - getCurrentModeIfaceCombinations(); + std::vector getCurrentModeIfaceCombinations(); std::map getCurrentIfaceCombination(); std::vector> expandIfaceCombinations( - const V1_4::IWifiChip::ChipIfaceCombination& combination); + const V1_4::IWifiChip::ChipIfaceCombination& combination); bool canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces( - const std::map& expanded_combo, - IfaceType requested_type); - bool canCurrentModeSupportIfaceOfTypeWithCurrentIfaces( - IfaceType requested_type); - bool canExpandedIfaceComboSupportIfaceCombo( - const std::map& expanded_combo, - const std::map& req_combo); - bool canCurrentModeSupportIfaceCombo( - const std::map& req_combo); + const std::map& expanded_combo, IfaceType requested_type); + bool canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType requested_type); + bool canExpandedIfaceComboSupportIfaceCombo(const std::map& expanded_combo, + const std::map& req_combo); + bool canCurrentModeSupportIfaceCombo(const std::map& req_combo); bool canCurrentModeSupportIfaceOfType(IfaceType requested_type); bool isValidModeId(ChipModeId mode_id); bool isStaApConcurrencyAllowedInCurrentMode(); @@ -326,8 +278,7 @@ class WifiChip : public V1_5::IWifiChip { // registration mechanism. Use this to check if we have already // registered a callback. bool debug_ring_buffer_cb_registered_; - hidl_callback_util::HidlCallbackHandler - event_cb_handler_; + hidl_callback_util::HidlCallbackHandler event_cb_handler_; const std::function subsystemCallbackHandler_; std::map> br_ifaces_ap_instances_; @@ -335,7 +286,7 @@ class WifiChip : public V1_5::IWifiChip { }; } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_feature_flags.cpp b/wifi/1.6/default/wifi_feature_flags.cpp similarity index 87% rename from wifi/1.5/default/wifi_feature_flags.cpp rename to wifi/1.6/default/wifi_feature_flags.cpp index 70ce55a70e..71319e1e90 100644 --- a/wifi/1.5/default/wifi_feature_flags.cpp +++ b/wifi/1.6/default/wifi_feature_flags.cpp @@ -24,7 +24,7 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace feature_flags { @@ -117,18 +117,16 @@ constexpr ChipModeId kMainModeId = chip_mode_ids::kV1Sta; * The main point here is to simplify the syntax required by * WIFI_HAL_INTERFACE_COMBINATIONS. */ -struct ChipIfaceCombination - : public hidl_vec { - ChipIfaceCombination( - const std::initializer_list list) +struct ChipIfaceCombination : public hidl_vec { + ChipIfaceCombination(const std::initializer_list list) : hidl_vec(list) {} operator IWifiChip::ChipIfaceCombination() const { return {*this}; } static hidl_vec make_vec( - const std::initializer_list list) { + const std::initializer_list list) { return hidl_vec( // - std::begin(list), std::end(list)); + std::begin(list), std::end(list)); } }; @@ -137,23 +135,22 @@ struct ChipIfaceCombination #define P2P IfaceType::P2P #define NAN IfaceType::NAN static const std::vector kChipModesPrimary{ - {kMainModeId, - ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS})}, + {kMainModeId, ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS})}, #ifdef WIFI_HAL_INTERFACE_COMBINATIONS_AP - {chip_mode_ids::kV1Ap, - ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_AP})}, + {chip_mode_ids::kV1Ap, + ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_AP})}, #endif }; static const std::vector kChipModesSecondary{ #ifdef WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP - {chip_mode_ids::kV3, ChipIfaceCombination::make_vec( - {WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP})}, + {chip_mode_ids::kV3, + ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP})}, #endif }; constexpr char kDebugPresetInterfaceCombinationIdxProperty[] = - "persist.vendor.debug.wifi.hal.preset_interface_combination_idx"; + "persist.vendor.debug.wifi.hal.preset_interface_combination_idx"; // List of pre-defined interface combinations that can be enabled at runtime via // setting the property: "kDebugPresetInterfaceCombinationIdxProperty" to the // corresponding index value. @@ -200,19 +197,18 @@ static const std::vector #undef NAN #ifdef WIFI_HIDL_FEATURE_DISABLE_AP_MAC_RANDOMIZATION -#pragma message \ - "WIFI_HIDL_FEATURE_DISABLE_AP_MAC_RANDOMIZATION is deprecated; override " \ - "'config_wifi_ap_randomization_supported' in " \ - "frameworks/base/core/res/res/values/config.xml in the device overlay " \ - "instead" +#pragma message \ + "WIFI_HIDL_FEATURE_DISABLE_AP_MAC_RANDOMIZATION is deprecated; override " \ + "'config_wifi_ap_randomization_supported' in " \ + "frameworks/base/core/res/res/values/config.xml in the device overlay " \ + "instead" #endif // WIFI_HIDL_FEATURE_DISABLE_AP_MAC_RANDOMIZATION WifiFeatureFlags::WifiFeatureFlags() {} std::vector WifiFeatureFlags::getChipModesForPrimary() { std::array buffer; - auto res = property_get(kDebugPresetInterfaceCombinationIdxProperty, - buffer.data(), nullptr); + auto res = property_get(kDebugPresetInterfaceCombinationIdxProperty, buffer.data(), nullptr); // Debug propety not set, use the device preset interface combination. if (res <= 0) return kChipModesPrimary; @@ -226,19 +222,18 @@ std::vector WifiFeatureFlags::getChipModesForPrimary() { std::string name; std::vector chip_modes; std::tie(name, chip_modes) = kDebugChipModes[idx]; - LOG(INFO) << "Using debug chip mode: <" << name << "> set via property: " - << kDebugPresetInterfaceCombinationIdxProperty; + LOG(INFO) << "Using debug chip mode: <" << name + << "> set via property: " << kDebugPresetInterfaceCombinationIdxProperty; return chip_modes; } -std::vector WifiFeatureFlags::getChipModes( - bool is_primary) { +std::vector WifiFeatureFlags::getChipModes(bool is_primary) { return (is_primary) ? getChipModesForPrimary() : kChipModesSecondary; } } // namespace feature_flags } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_feature_flags.h b/wifi/1.6/default/wifi_feature_flags.h similarity index 94% rename from wifi/1.5/default/wifi_feature_flags.h rename to wifi/1.6/default/wifi_feature_flags.h index 7d561fc949..d5844d99b3 100644 --- a/wifi/1.5/default/wifi_feature_flags.h +++ b/wifi/1.6/default/wifi_feature_flags.h @@ -22,7 +22,7 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace feature_flags { @@ -38,20 +38,19 @@ constexpr V1_0::ChipModeId kV3 = 3; } // namespace chip_mode_ids class WifiFeatureFlags { - public: + public: WifiFeatureFlags(); virtual ~WifiFeatureFlags() = default; - virtual std::vector getChipModes( - bool is_primary); + virtual std::vector getChipModes(bool is_primary); - private: + private: std::vector getChipModesForPrimary(); }; } // namespace feature_flags } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_iface_util.cpp b/wifi/1.6/default/wifi_iface_util.cpp similarity index 85% rename from wifi/1.5/default/wifi_iface_util.cpp rename to wifi/1.6/default/wifi_iface_util.cpp index 0977026698..d55e4f8251 100644 --- a/wifi/1.5/default/wifi_iface_util.cpp +++ b/wifi/1.6/default/wifi_iface_util.cpp @@ -36,20 +36,18 @@ constexpr uint8_t kMacAddressLocallyAssignedMask = 0x02; namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace iface_util { -WifiIfaceUtil::WifiIfaceUtil( - const std::weak_ptr iface_tool, - const std::weak_ptr legacy_hal) +WifiIfaceUtil::WifiIfaceUtil(const std::weak_ptr iface_tool, + const std::weak_ptr legacy_hal) : iface_tool_(iface_tool), legacy_hal_(legacy_hal), random_mac_address_(nullptr), event_handlers_map_() {} -std::array WifiIfaceUtil::getFactoryMacAddress( - const std::string& iface_name) { +std::array WifiIfaceUtil::getFactoryMacAddress(const std::string& iface_name) { return iface_tool_.lock()->GetFactoryMacAddress(iface_name.c_str()); } @@ -59,7 +57,7 @@ bool WifiIfaceUtil::setMacAddress(const std::string& iface_name, legacy_hal::wifi_error legacy_status; uint64_t legacy_feature_set; std::tie(legacy_status, legacy_feature_set) = - legacy_hal_.lock()->getSupportedFeatureSet(iface_name); + legacy_hal_.lock()->getSupportedFeatureSet(iface_name); if (!(legacy_feature_set & WIFI_FEATURE_DYNAMIC_SET_MAC) && !iface_tool_.lock()->SetUpState(iface_name.c_str(), false)) { @@ -73,8 +71,7 @@ bool WifiIfaceUtil::setMacAddress(const std::string& iface_name, !iface_tool_.lock()->SetUpState(iface_name.c_str(), true)) { LOG(ERROR) << "SetUpState(true) failed. Wait for driver ready."; // Wait for driver ready and try to set iface UP again - if (legacy_hal_.lock()->waitForDriverReady() != - legacy_hal::WIFI_SUCCESS) { + if (legacy_hal_.lock()->waitForDriverReady() != legacy_hal::WIFI_SUCCESS) { LOG(ERROR) << "SetUpState(true) wait for driver ready failed."; return false; } @@ -104,8 +101,7 @@ std::array WifiIfaceUtil::getOrCreateRandomMacAddress() { if (random_mac_address_) { return *random_mac_address_.get(); } - random_mac_address_ = - std::make_unique>(createRandomMacAddress()); + random_mac_address_ = std::make_unique>(createRandomMacAddress()); return *random_mac_address_.get(); } @@ -114,8 +110,7 @@ void WifiIfaceUtil::registerIfaceEventHandlers(const std::string& iface_name, event_handlers_map_[iface_name] = handlers; } -void WifiIfaceUtil::unregisterIfaceEventHandlers( - const std::string& iface_name) { +void WifiIfaceUtil::unregisterIfaceEventHandlers(const std::string& iface_name) { event_handlers_map_.erase(iface_name); } @@ -123,9 +118,8 @@ std::array WifiIfaceUtil::createRandomMacAddress() { std::array address = {}; std::random_device rd; std::default_random_engine engine(rd()); - std::uniform_int_distribution dist( - std::numeric_limits::min(), - std::numeric_limits::max()); + std::uniform_int_distribution dist(std::numeric_limits::min(), + std::numeric_limits::max()); for (size_t i = 0; i < address.size(); i++) { address[i] = dist(engine); } @@ -166,19 +160,17 @@ bool WifiIfaceUtil::deleteBridge(const std::string& br_name) { return iface_tool_.lock()->deleteBridge(br_name); } -bool WifiIfaceUtil::addIfaceToBridge(const std::string& br_name, - const std::string& if_name) { +bool WifiIfaceUtil::addIfaceToBridge(const std::string& br_name, const std::string& if_name) { return iface_tool_.lock()->addIfaceToBridge(br_name, if_name); } -bool WifiIfaceUtil::removeIfaceFromBridge(const std::string& br_name, - const std::string& if_name) { +bool WifiIfaceUtil::removeIfaceFromBridge(const std::string& br_name, const std::string& if_name) { return iface_tool_.lock()->removeIfaceFromBridge(br_name, if_name); } } // namespace iface_util } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_iface_util.h b/wifi/1.6/default/wifi_iface_util.h similarity index 85% rename from wifi/1.5/default/wifi_iface_util.h rename to wifi/1.6/default/wifi_iface_util.h index 544f575d41..c5db5deed1 100644 --- a/wifi/1.5/default/wifi_iface_util.h +++ b/wifi/1.6/default/wifi_iface_util.h @@ -26,7 +26,7 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace iface_util { @@ -41,15 +41,13 @@ struct IfaceEventHandlers { * Util class for common iface operations. */ class WifiIfaceUtil { - public: + public: WifiIfaceUtil(const std::weak_ptr iface_tool, const std::weak_ptr legacy_hal); virtual ~WifiIfaceUtil() = default; - virtual std::array getFactoryMacAddress( - const std::string& iface_name); - virtual bool setMacAddress(const std::string& iface_name, - const std::array& mac); + virtual std::array getFactoryMacAddress(const std::string& iface_name); + virtual bool setMacAddress(const std::string& iface_name, const std::array& mac); // Get or create a random MAC address. The MAC address returned from // this method will remain the same throughout the lifetime of the HAL // daemon. (So, changes on every reboot) @@ -66,15 +64,13 @@ class WifiIfaceUtil { virtual bool deleteBridge(const std::string& br_name); - virtual bool addIfaceToBridge(const std::string& br_name, - const std::string& if_name); + virtual bool addIfaceToBridge(const std::string& br_name, const std::string& if_name); - virtual bool removeIfaceFromBridge(const std::string& br_name, - const std::string& if_name); + virtual bool removeIfaceFromBridge(const std::string& br_name, const std::string& if_name); // Get a random MAC address. virtual std::array createRandomMacAddress(); - private: + private: std::weak_ptr iface_tool_; std::weak_ptr legacy_hal_; std::unique_ptr> random_mac_address_; @@ -83,7 +79,7 @@ class WifiIfaceUtil { } // namespace iface_util } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_legacy_hal.cpp b/wifi/1.6/default/wifi_legacy_hal.cpp similarity index 57% rename from wifi/1.5/default/wifi_legacy_hal.cpp rename to wifi/1.6/default/wifi_legacy_hal.cpp index 5074252d3d..e6e8141603 100644 --- a/wifi/1.5/default/wifi_legacy_hal.cpp +++ b/wifi/1.6/default/wifi_legacy_hal.cpp @@ -53,7 +53,7 @@ std::vector makeCharVec(const std::string& str) { namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace legacy_hal { @@ -89,8 +89,7 @@ void onSyncFirmwareMemoryDump(char* buffer, int buffer_size) { } // Callback to be invoked for Gscan events. -std::function - on_gscan_event_internal_callback; +std::function on_gscan_event_internal_callback; void onAsyncGscanEvent(wifi_request_id id, wifi_scan_event event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_gscan_event_internal_callback) { @@ -100,7 +99,7 @@ void onAsyncGscanEvent(wifi_request_id id, wifi_scan_event event) { // Callback to be invoked for Gscan full results. std::function - on_gscan_full_result_internal_callback; + on_gscan_full_result_internal_callback; void onAsyncGscanFullResult(wifi_request_id id, wifi_scan_result* result, uint32_t buckets_scanned) { const auto lock = hidl_sync_util::acquireGlobalLock(); @@ -111,20 +110,18 @@ void onAsyncGscanFullResult(wifi_request_id id, wifi_scan_result* result, // Callback to be invoked for link layer stats results. std::function - on_link_layer_stats_result_internal_callback; -void onSyncLinkLayerStatsResult(wifi_request_id id, wifi_iface_stat* iface_stat, - int num_radios, wifi_radio_stat* radio_stat) { + on_link_layer_stats_result_internal_callback; +void onSyncLinkLayerStatsResult(wifi_request_id id, wifi_iface_stat* iface_stat, int num_radios, + wifi_radio_stat* radio_stat) { if (on_link_layer_stats_result_internal_callback) { - on_link_layer_stats_result_internal_callback(id, iface_stat, num_radios, - radio_stat); + on_link_layer_stats_result_internal_callback(id, iface_stat, num_radios, radio_stat); } } // Callback to be invoked for rssi threshold breach. std::function - on_rssi_threshold_breached_internal_callback; -void onAsyncRssiThresholdBreached(wifi_request_id id, uint8_t* bssid, - int8_t rssi) { + on_rssi_threshold_breached_internal_callback; +void onAsyncRssiThresholdBreached(wifi_request_id id, uint8_t* bssid, int8_t rssi) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_rssi_threshold_breached_internal_callback) { on_rssi_threshold_breached_internal_callback(id, bssid, rssi); @@ -133,21 +130,18 @@ void onAsyncRssiThresholdBreached(wifi_request_id id, uint8_t* bssid, // Callback to be invoked for ring buffer data indication. std::function - on_ring_buffer_data_internal_callback; + on_ring_buffer_data_internal_callback; void onAsyncRingBufferData(char* ring_name, char* buffer, int buffer_size, wifi_ring_buffer_status* status) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_ring_buffer_data_internal_callback) { - on_ring_buffer_data_internal_callback(ring_name, buffer, buffer_size, - status); + on_ring_buffer_data_internal_callback(ring_name, buffer, buffer_size, status); } } // Callback to be invoked for error alert indication. -std::function - on_error_alert_internal_callback; -void onAsyncErrorAlert(wifi_request_id id, char* buffer, int buffer_size, - int err_code) { +std::function on_error_alert_internal_callback; +void onAsyncErrorAlert(wifi_request_id id, char* buffer, int buffer_size, int err_code) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_error_alert_internal_callback) { on_error_alert_internal_callback(id, buffer, buffer_size, err_code); @@ -156,9 +150,8 @@ void onAsyncErrorAlert(wifi_request_id id, char* buffer, int buffer_size, // Callback to be invoked for radio mode change indication. std::function - on_radio_mode_change_internal_callback; -void onAsyncRadioModeChange(wifi_request_id id, uint32_t num_macs, - wifi_mac_info* mac_infos) { + on_radio_mode_change_internal_callback; +void onAsyncRadioModeChange(wifi_request_id id, uint32_t num_macs, wifi_mac_info* mac_infos) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_radio_mode_change_internal_callback) { on_radio_mode_change_internal_callback(id, num_macs, mac_infos); @@ -175,11 +168,9 @@ void onAsyncSubsystemRestart(const char* error) { } // Callback to be invoked for rtt results results. -std::function - on_rtt_results_internal_callback; -void onAsyncRttResults(wifi_request_id id, unsigned num_results, - wifi_rtt_result* rtt_results[]) { +std::function + on_rtt_results_internal_callback; +void onAsyncRttResults(wifi_request_id id, unsigned num_results, wifi_rtt_result* rtt_results[]) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_rtt_results_internal_callback) { on_rtt_results_internal_callback(id, num_results, rtt_results); @@ -191,8 +182,7 @@ void onAsyncRttResults(wifi_request_id id, unsigned num_results, // NOTE: These have very little conversions to perform before invoking the user // callbacks. // So, handle all of them here directly to avoid adding an unnecessary layer. -std::function - on_nan_notify_response_user_callback; +std::function on_nan_notify_response_user_callback; void onAysncNanNotifyResponse(transaction_id id, NanResponseMsg* msg) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_nan_notify_response_user_callback && msg) { @@ -200,14 +190,12 @@ void onAysncNanNotifyResponse(transaction_id id, NanResponseMsg* msg) { } } -std::function - on_nan_event_publish_replied_user_callback; +std::function on_nan_event_publish_replied_user_callback; void onAysncNanEventPublishReplied(NanPublishRepliedInd* /* event */) { LOG(ERROR) << "onAysncNanEventPublishReplied triggered"; } -std::function - on_nan_event_publish_terminated_user_callback; +std::function on_nan_event_publish_terminated_user_callback; void onAysncNanEventPublishTerminated(NanPublishTerminatedInd* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_nan_event_publish_terminated_user_callback && event) { @@ -223,8 +211,7 @@ void onAysncNanEventMatch(NanMatchInd* event) { } } -std::function - on_nan_event_match_expired_user_callback; +std::function on_nan_event_match_expired_user_callback; void onAysncNanEventMatchExpired(NanMatchExpiredInd* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_nan_event_match_expired_user_callback && event) { @@ -233,7 +220,7 @@ void onAysncNanEventMatchExpired(NanMatchExpiredInd* event) { } std::function - on_nan_event_subscribe_terminated_user_callback; + on_nan_event_subscribe_terminated_user_callback; void onAysncNanEventSubscribeTerminated(NanSubscribeTerminatedInd* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_nan_event_subscribe_terminated_user_callback && event) { @@ -249,8 +236,7 @@ void onAysncNanEventFollowup(NanFollowupInd* event) { } } -std::function - on_nan_event_disc_eng_event_user_callback; +std::function on_nan_event_disc_eng_event_user_callback; void onAysncNanEventDiscEngEvent(NanDiscEngEventInd* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_nan_event_disc_eng_event_user_callback && event) { @@ -274,8 +260,7 @@ void onAysncNanEventTca(NanTCAInd* event) { } } -std::function - on_nan_event_beacon_sdf_payload_user_callback; +std::function on_nan_event_beacon_sdf_payload_user_callback; void onAysncNanEventBeaconSdfPayload(NanBeaconSdfPayloadInd* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_nan_event_beacon_sdf_payload_user_callback && event) { @@ -283,16 +268,14 @@ void onAysncNanEventBeaconSdfPayload(NanBeaconSdfPayloadInd* event) { } } -std::function - on_nan_event_data_path_request_user_callback; +std::function on_nan_event_data_path_request_user_callback; void onAysncNanEventDataPathRequest(NanDataPathRequestInd* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_nan_event_data_path_request_user_callback && event) { on_nan_event_data_path_request_user_callback(*event); } } -std::function - on_nan_event_data_path_confirm_user_callback; +std::function on_nan_event_data_path_confirm_user_callback; void onAysncNanEventDataPathConfirm(NanDataPathConfirmInd* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_nan_event_data_path_confirm_user_callback && event) { @@ -300,8 +283,7 @@ void onAysncNanEventDataPathConfirm(NanDataPathConfirmInd* event) { } } -std::function - on_nan_event_data_path_end_user_callback; +std::function on_nan_event_data_path_end_user_callback; void onAysncNanEventDataPathEnd(NanDataPathEndInd* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_nan_event_data_path_end_user_callback && event) { @@ -309,8 +291,7 @@ void onAysncNanEventDataPathEnd(NanDataPathEndInd* event) { } } -std::function - on_nan_event_transmit_follow_up_user_callback; +std::function on_nan_event_transmit_follow_up_user_callback; void onAysncNanEventTransmitFollowUp(NanTransmitFollowupInd* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_nan_event_transmit_follow_up_user_callback && event) { @@ -318,8 +299,7 @@ void onAysncNanEventTransmitFollowUp(NanTransmitFollowupInd* event) { } } -std::function - on_nan_event_range_request_user_callback; +std::function on_nan_event_range_request_user_callback; void onAysncNanEventRangeRequest(NanRangeRequestInd* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_nan_event_range_request_user_callback && event) { @@ -327,8 +307,7 @@ void onAysncNanEventRangeRequest(NanRangeRequestInd* event) { } } -std::function - on_nan_event_range_report_user_callback; +std::function on_nan_event_range_report_user_callback; void onAysncNanEventRangeReport(NanRangeReportInd* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_nan_event_range_report_user_callback && event) { @@ -336,8 +315,7 @@ void onAysncNanEventRangeReport(NanRangeReportInd* event) { } } -std::function - on_nan_event_schedule_update_user_callback; +std::function on_nan_event_schedule_update_user_callback; void onAsyncNanEventScheduleUpdate(NanDataPathScheduleUpdateInd* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_nan_event_schedule_update_user_callback && event) { @@ -346,8 +324,7 @@ void onAsyncNanEventScheduleUpdate(NanDataPathScheduleUpdateInd* event) { } // Callbacks for the various TWT operations. -std::function - on_twt_event_setup_response_callback; +std::function on_twt_event_setup_response_callback; void onAsyncTwtEventSetupResponse(TwtSetupResponse* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_twt_event_setup_response_callback && event) { @@ -355,8 +332,7 @@ void onAsyncTwtEventSetupResponse(TwtSetupResponse* event) { } } -std::function - on_twt_event_teardown_completion_callback; +std::function on_twt_event_teardown_completion_callback; void onAsyncTwtEventTeardownCompletion(TwtTeardownCompletion* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_twt_event_teardown_completion_callback && event) { @@ -364,8 +340,7 @@ void onAsyncTwtEventTeardownCompletion(TwtTeardownCompletion* event) { } } -std::function - on_twt_event_info_frame_received_callback; +std::function on_twt_event_info_frame_received_callback; void onAsyncTwtEventInfoFrameReceived(TwtInfoFrameReceived* event) { const auto lock = hidl_sync_util::acquireGlobalLock(); if (on_twt_event_info_frame_received_callback && event) { @@ -383,9 +358,8 @@ void onAsyncTwtEventDeviceNotify(TwtDeviceNotify* event) { // End of the free-standing "C" style callbacks. -WifiLegacyHal::WifiLegacyHal( - const std::weak_ptr iface_tool, - const wifi_hal_fn& fn, bool is_primary) +WifiLegacyHal::WifiLegacyHal(const std::weak_ptr iface_tool, + const wifi_hal_fn& fn, bool is_primary) : global_func_table_(fn), global_handle_(nullptr), awaiting_event_loop_termination_(false), @@ -402,8 +376,8 @@ wifi_error WifiLegacyHal::initialize() { wifi_error WifiLegacyHal::start() { // Ensure that we're starting in a good state. - CHECK(global_func_table_.wifi_initialize && !global_handle_ && - iface_name_to_handle_.empty() && !awaiting_event_loop_termination_); + CHECK(global_func_table_.wifi_initialize && !global_handle_ && iface_name_to_handle_.empty() && + !awaiting_event_loop_termination_); if (is_started_) { LOG(DEBUG) << "Legacy HAL already started"; return WIFI_SUCCESS; @@ -442,8 +416,8 @@ wifi_error WifiLegacyHal::start() { } wifi_error WifiLegacyHal::stop( - /* NONNULL */ std::unique_lock* lock, - const std::function& on_stop_complete_user_callback) { + /* NONNULL */ std::unique_lock* lock, + const std::function& on_stop_complete_user_callback) { if (!is_started_) { LOG(DEBUG) << "Legacy HAL already stopped"; on_stop_complete_user_callback(); @@ -463,9 +437,9 @@ wifi_error WifiLegacyHal::stop( }; awaiting_event_loop_termination_ = true; global_func_table_.wifi_cleanup(global_handle_, onAsyncStopComplete); - const auto status = stop_wait_cv_.wait_for( - *lock, std::chrono::milliseconds(kMaxStopCompleteWaitMs), - [this] { return !awaiting_event_loop_termination_; }); + const auto status = + stop_wait_cv_.wait_for(*lock, std::chrono::milliseconds(kMaxStopCompleteWaitMs), + [this] { return !awaiting_event_loop_termination_; }); if (!status) { LOG(ERROR) << "Legacy HAL stop failed or timed out"; return WIFI_ERROR_UNKNOWN; @@ -474,62 +448,59 @@ wifi_error WifiLegacyHal::stop( return WIFI_SUCCESS; } -bool WifiLegacyHal::isStarted() { return is_started_; } +bool WifiLegacyHal::isStarted() { + return is_started_; +} wifi_error WifiLegacyHal::waitForDriverReady() { return global_func_table_.wifi_wait_for_driver_ready(); } -std::pair WifiLegacyHal::getDriverVersion( - const std::string& iface_name) { +std::pair WifiLegacyHal::getDriverVersion(const std::string& iface_name) { std::array buffer; buffer.fill(0); - wifi_error status = global_func_table_.wifi_get_driver_version( - getIfaceHandle(iface_name), buffer.data(), buffer.size()); + wifi_error status = global_func_table_.wifi_get_driver_version(getIfaceHandle(iface_name), + buffer.data(), buffer.size()); return {status, buffer.data()}; } std::pair WifiLegacyHal::getFirmwareVersion( - const std::string& iface_name) { + const std::string& iface_name) { std::array buffer; buffer.fill(0); - wifi_error status = global_func_table_.wifi_get_firmware_version( - getIfaceHandle(iface_name), buffer.data(), buffer.size()); + wifi_error status = global_func_table_.wifi_get_firmware_version(getIfaceHandle(iface_name), + buffer.data(), buffer.size()); return {status, buffer.data()}; } -std::pair> -WifiLegacyHal::requestDriverMemoryDump(const std::string& iface_name) { +std::pair> WifiLegacyHal::requestDriverMemoryDump( + const std::string& iface_name) { std::vector driver_dump; - on_driver_memory_dump_internal_callback = [&driver_dump](char* buffer, - int buffer_size) { - driver_dump.insert(driver_dump.end(), - reinterpret_cast(buffer), + on_driver_memory_dump_internal_callback = [&driver_dump](char* buffer, int buffer_size) { + driver_dump.insert(driver_dump.end(), reinterpret_cast(buffer), reinterpret_cast(buffer) + buffer_size); }; - wifi_error status = global_func_table_.wifi_get_driver_memory_dump( - getIfaceHandle(iface_name), {onSyncDriverMemoryDump}); + wifi_error status = global_func_table_.wifi_get_driver_memory_dump(getIfaceHandle(iface_name), + {onSyncDriverMemoryDump}); on_driver_memory_dump_internal_callback = nullptr; return {status, std::move(driver_dump)}; } -std::pair> -WifiLegacyHal::requestFirmwareMemoryDump(const std::string& iface_name) { +std::pair> WifiLegacyHal::requestFirmwareMemoryDump( + const std::string& iface_name) { std::vector firmware_dump; - on_firmware_memory_dump_internal_callback = - [&firmware_dump](char* buffer, int buffer_size) { - firmware_dump.insert( - firmware_dump.end(), reinterpret_cast(buffer), - reinterpret_cast(buffer) + buffer_size); - }; + on_firmware_memory_dump_internal_callback = [&firmware_dump](char* buffer, int buffer_size) { + firmware_dump.insert(firmware_dump.end(), reinterpret_cast(buffer), + reinterpret_cast(buffer) + buffer_size); + }; wifi_error status = global_func_table_.wifi_get_firmware_memory_dump( - getIfaceHandle(iface_name), {onSyncFirmwareMemoryDump}); + getIfaceHandle(iface_name), {onSyncFirmwareMemoryDump}); on_firmware_memory_dump_internal_callback = nullptr; return {status, std::move(firmware_dump)}; } std::pair WifiLegacyHal::getSupportedFeatureSet( - const std::string& iface_name) { + const std::string& iface_name) { feature_set set = 0, chip_set = 0; wifi_error status = WIFI_SUCCESS; @@ -538,34 +509,33 @@ std::pair WifiLegacyHal::getSupportedFeatureSet( wifi_interface_handle iface_handle = getIfaceHandle(iface_name); global_func_table_.wifi_get_chip_feature_set( - global_handle_, &chip_set); /* ignore error, chip_set will stay 0 */ + global_handle_, &chip_set); /* ignore error, chip_set will stay 0 */ if (iface_handle) { - status = global_func_table_.wifi_get_supported_feature_set(iface_handle, - &set); + status = global_func_table_.wifi_get_supported_feature_set(iface_handle, &set); } return {status, static_cast(set | chip_set)}; } -std::pair -WifiLegacyHal::getPacketFilterCapabilities(const std::string& iface_name) { +std::pair WifiLegacyHal::getPacketFilterCapabilities( + const std::string& iface_name) { PacketFilterCapabilities caps; wifi_error status = global_func_table_.wifi_get_packet_filter_capabilities( - getIfaceHandle(iface_name), &caps.version, &caps.max_len); + getIfaceHandle(iface_name), &caps.version, &caps.max_len); return {status, caps}; } wifi_error WifiLegacyHal::setPacketFilter(const std::string& iface_name, const std::vector& program) { - return global_func_table_.wifi_set_packet_filter( - getIfaceHandle(iface_name), program.data(), program.size()); + return global_func_table_.wifi_set_packet_filter(getIfaceHandle(iface_name), program.data(), + program.size()); } -std::pair> -WifiLegacyHal::readApfPacketFilterData(const std::string& iface_name) { +std::pair> WifiLegacyHal::readApfPacketFilterData( + const std::string& iface_name) { PacketFilterCapabilities caps; wifi_error status = global_func_table_.wifi_get_packet_filter_capabilities( - getIfaceHandle(iface_name), &caps.version, &caps.max_len); + getIfaceHandle(iface_name), &caps.version, &caps.max_len); if (status != WIFI_SUCCESS) { return {status, {}}; } @@ -574,74 +544,68 @@ WifiLegacyHal::readApfPacketFilterData(const std::string& iface_name) { std::vector buffer(caps.max_len); status = global_func_table_.wifi_read_packet_filter( - getIfaceHandle(iface_name), /*src_offset=*/0, buffer.data(), - buffer.size()); + getIfaceHandle(iface_name), /*src_offset=*/0, buffer.data(), buffer.size()); return {status, move(buffer)}; } -std::pair -WifiLegacyHal::getGscanCapabilities(const std::string& iface_name) { +std::pair WifiLegacyHal::getGscanCapabilities( + const std::string& iface_name) { wifi_gscan_capabilities caps; - wifi_error status = global_func_table_.wifi_get_gscan_capabilities( - getIfaceHandle(iface_name), &caps); + wifi_error status = + global_func_table_.wifi_get_gscan_capabilities(getIfaceHandle(iface_name), &caps); return {status, caps}; } wifi_error WifiLegacyHal::startGscan( - const std::string& iface_name, wifi_request_id id, - const wifi_scan_cmd_params& params, - const std::function& on_failure_user_callback, - const on_gscan_results_callback& on_results_user_callback, - const on_gscan_full_result_callback& on_full_result_user_callback) { + const std::string& iface_name, wifi_request_id id, const wifi_scan_cmd_params& params, + const std::function& on_failure_user_callback, + const on_gscan_results_callback& on_results_user_callback, + const on_gscan_full_result_callback& on_full_result_user_callback) { // If there is already an ongoing background scan, reject new scan requests. - if (on_gscan_event_internal_callback || - on_gscan_full_result_internal_callback) { + if (on_gscan_event_internal_callback || on_gscan_full_result_internal_callback) { return WIFI_ERROR_NOT_AVAILABLE; } // This callback will be used to either trigger |on_results_user_callback| // or |on_failure_user_callback|. - on_gscan_event_internal_callback = - [iface_name, on_failure_user_callback, on_results_user_callback, this]( - wifi_request_id id, wifi_scan_event event) { - switch (event) { - case WIFI_SCAN_RESULTS_AVAILABLE: - case WIFI_SCAN_THRESHOLD_NUM_SCANS: - case WIFI_SCAN_THRESHOLD_PERCENT: { - wifi_error status; - std::vector cached_scan_results; - std::tie(status, cached_scan_results) = - getGscanCachedResults(iface_name); - if (status == WIFI_SUCCESS) { - on_results_user_callback(id, cached_scan_results); - return; - } - FALLTHROUGH_INTENDED; - } - // Fall through if failed. Failure to retrieve cached scan - // results should trigger a background scan failure. - case WIFI_SCAN_FAILED: - on_failure_user_callback(id); - on_gscan_event_internal_callback = nullptr; - on_gscan_full_result_internal_callback = nullptr; + on_gscan_event_internal_callback = [iface_name, on_failure_user_callback, + on_results_user_callback, + this](wifi_request_id id, wifi_scan_event event) { + switch (event) { + case WIFI_SCAN_RESULTS_AVAILABLE: + case WIFI_SCAN_THRESHOLD_NUM_SCANS: + case WIFI_SCAN_THRESHOLD_PERCENT: { + wifi_error status; + std::vector cached_scan_results; + std::tie(status, cached_scan_results) = getGscanCachedResults(iface_name); + if (status == WIFI_SUCCESS) { + on_results_user_callback(id, cached_scan_results); return; + } + FALLTHROUGH_INTENDED; } - LOG(FATAL) << "Unexpected gscan event received: " << event; - }; + // Fall through if failed. Failure to retrieve cached scan + // results should trigger a background scan failure. + case WIFI_SCAN_FAILED: + on_failure_user_callback(id); + on_gscan_event_internal_callback = nullptr; + on_gscan_full_result_internal_callback = nullptr; + return; + } + LOG(FATAL) << "Unexpected gscan event received: " << event; + }; on_gscan_full_result_internal_callback = [on_full_result_user_callback]( - wifi_request_id id, - wifi_scan_result* result, - uint32_t buckets_scanned) { + wifi_request_id id, wifi_scan_result* result, + uint32_t buckets_scanned) { if (result) { on_full_result_user_callback(id, result, buckets_scanned); } }; - wifi_scan_result_handler handler = {onAsyncGscanFullResult, - onAsyncGscanEvent}; - wifi_error status = global_func_table_.wifi_start_gscan( - id, getIfaceHandle(iface_name), params, handler); + wifi_scan_result_handler handler = {onAsyncGscanFullResult, onAsyncGscanEvent}; + wifi_error status = + global_func_table_.wifi_start_gscan(id, getIfaceHandle(iface_name), params, handler); if (status != WIFI_SUCCESS) { on_gscan_event_internal_callback = nullptr; on_gscan_full_result_internal_callback = nullptr; @@ -649,17 +613,14 @@ wifi_error WifiLegacyHal::startGscan( return status; } -wifi_error WifiLegacyHal::stopGscan(const std::string& iface_name, - wifi_request_id id) { +wifi_error WifiLegacyHal::stopGscan(const std::string& iface_name, wifi_request_id id) { // If there is no an ongoing background scan, reject stop requests. // TODO(b/32337212): This needs to be handled by the HIDL object because we // need to return the NOT_STARTED error code. - if (!on_gscan_event_internal_callback && - !on_gscan_full_result_internal_callback) { + if (!on_gscan_event_internal_callback && !on_gscan_full_result_internal_callback) { return WIFI_ERROR_NOT_AVAILABLE; } - wifi_error status = - global_func_table_.wifi_stop_gscan(id, getIfaceHandle(iface_name)); + wifi_error status = global_func_table_.wifi_stop_gscan(id, getIfaceHandle(iface_name)); // If the request Id is wrong, don't stop the ongoing background scan. Any // other error should be treated as the end of background scan. if (status != WIFI_ERROR_INVALID_REQUEST_ID) { @@ -669,161 +630,147 @@ wifi_error WifiLegacyHal::stopGscan(const std::string& iface_name, return status; } -std::pair> -WifiLegacyHal::getValidFrequenciesForBand(const std::string& iface_name, - wifi_band band) { +std::pair> WifiLegacyHal::getValidFrequenciesForBand( + const std::string& iface_name, wifi_band band) { static_assert(sizeof(uint32_t) >= sizeof(wifi_channel), "Wifi Channel cannot be represented in output"); std::vector freqs; freqs.resize(kMaxGscanFrequenciesForBand); int32_t num_freqs = 0; wifi_error status = global_func_table_.wifi_get_valid_channels( - getIfaceHandle(iface_name), band, freqs.size(), - reinterpret_cast(freqs.data()), &num_freqs); - CHECK(num_freqs >= 0 && - static_cast(num_freqs) <= kMaxGscanFrequenciesForBand); + getIfaceHandle(iface_name), band, freqs.size(), + reinterpret_cast(freqs.data()), &num_freqs); + CHECK(num_freqs >= 0 && static_cast(num_freqs) <= kMaxGscanFrequenciesForBand); freqs.resize(num_freqs); return {status, std::move(freqs)}; } -wifi_error WifiLegacyHal::setDfsFlag(const std::string& iface_name, - bool dfs_on) { - return global_func_table_.wifi_set_nodfs_flag(getIfaceHandle(iface_name), - dfs_on ? 0 : 1); +wifi_error WifiLegacyHal::setDfsFlag(const std::string& iface_name, bool dfs_on) { + return global_func_table_.wifi_set_nodfs_flag(getIfaceHandle(iface_name), dfs_on ? 0 : 1); } -wifi_error WifiLegacyHal::enableLinkLayerStats(const std::string& iface_name, - bool debug) { +wifi_error WifiLegacyHal::enableLinkLayerStats(const std::string& iface_name, bool debug) { wifi_link_layer_params params; params.mpdu_size_threshold = kLinkLayerStatsDataMpduSizeThreshold; params.aggressive_statistics_gathering = debug; - return global_func_table_.wifi_set_link_stats(getIfaceHandle(iface_name), - params); + return global_func_table_.wifi_set_link_stats(getIfaceHandle(iface_name), params); } wifi_error WifiLegacyHal::disableLinkLayerStats(const std::string& iface_name) { // TODO: Do we care about these responses? uint32_t clear_mask_rsp; uint8_t stop_rsp; - return global_func_table_.wifi_clear_link_stats( - getIfaceHandle(iface_name), 0xFFFFFFFF, &clear_mask_rsp, 1, &stop_rsp); + return global_func_table_.wifi_clear_link_stats(getIfaceHandle(iface_name), 0xFFFFFFFF, + &clear_mask_rsp, 1, &stop_rsp); } std::pair WifiLegacyHal::getLinkLayerStats( - const std::string& iface_name) { + const std::string& iface_name) { LinkLayerStats link_stats{}; LinkLayerStats* link_stats_ptr = &link_stats; - on_link_layer_stats_result_internal_callback = - [&link_stats_ptr](wifi_request_id /* id */, - wifi_iface_stat* iface_stats_ptr, int num_radios, - wifi_radio_stat* radio_stats_ptr) { - wifi_radio_stat* l_radio_stats_ptr; - wifi_peer_info* l_peer_info_stats_ptr; - - if (iface_stats_ptr != nullptr) { - link_stats_ptr->iface = *iface_stats_ptr; - l_peer_info_stats_ptr = iface_stats_ptr->peer_info; - for (uint32_t i = 0; i < iface_stats_ptr->num_peers; i++) { - WifiPeerInfo peer; - peer.peer_info = *l_peer_info_stats_ptr; - if (l_peer_info_stats_ptr->num_rate > 0) { - /* Copy the rate stats */ - peer.rate_stats.assign( + on_link_layer_stats_result_internal_callback = [&link_stats_ptr]( + wifi_request_id /* id */, + wifi_iface_stat* iface_stats_ptr, + int num_radios, + wifi_radio_stat* radio_stats_ptr) { + wifi_radio_stat* l_radio_stats_ptr; + wifi_peer_info* l_peer_info_stats_ptr; + + if (iface_stats_ptr != nullptr) { + link_stats_ptr->iface = *iface_stats_ptr; + l_peer_info_stats_ptr = iface_stats_ptr->peer_info; + for (uint32_t i = 0; i < iface_stats_ptr->num_peers; i++) { + WifiPeerInfo peer; + peer.peer_info = *l_peer_info_stats_ptr; + if (l_peer_info_stats_ptr->num_rate > 0) { + /* Copy the rate stats */ + peer.rate_stats.assign( l_peer_info_stats_ptr->rate_stats, - l_peer_info_stats_ptr->rate_stats + - l_peer_info_stats_ptr->num_rate); - } - peer.peer_info.num_rate = 0; - link_stats_ptr->peers.push_back(peer); - l_peer_info_stats_ptr = - (wifi_peer_info*)((u8*)l_peer_info_stats_ptr + - sizeof(wifi_peer_info) + + l_peer_info_stats_ptr->rate_stats + l_peer_info_stats_ptr->num_rate); + } + peer.peer_info.num_rate = 0; + link_stats_ptr->peers.push_back(peer); + l_peer_info_stats_ptr = + (wifi_peer_info*)((u8*)l_peer_info_stats_ptr + sizeof(wifi_peer_info) + (sizeof(wifi_rate_stat) * l_peer_info_stats_ptr->num_rate)); - } - link_stats_ptr->iface.num_peers = 0; - } else { - LOG(ERROR) << "Invalid iface stats in link layer stats"; - } - if (num_radios <= 0 || radio_stats_ptr == nullptr) { - LOG(ERROR) << "Invalid radio stats in link layer stats"; - return; } - l_radio_stats_ptr = radio_stats_ptr; - for (int i = 0; i < num_radios; i++) { - LinkLayerRadioStats radio; - - radio.stats = *l_radio_stats_ptr; - // Copy over the tx level array to the separate vector. - if (l_radio_stats_ptr->num_tx_levels > 0 && - l_radio_stats_ptr->tx_time_per_levels != nullptr) { - radio.tx_time_per_levels.assign( + link_stats_ptr->iface.num_peers = 0; + } else { + LOG(ERROR) << "Invalid iface stats in link layer stats"; + } + if (num_radios <= 0 || radio_stats_ptr == nullptr) { + LOG(ERROR) << "Invalid radio stats in link layer stats"; + return; + } + l_radio_stats_ptr = radio_stats_ptr; + for (int i = 0; i < num_radios; i++) { + LinkLayerRadioStats radio; + + radio.stats = *l_radio_stats_ptr; + // Copy over the tx level array to the separate vector. + if (l_radio_stats_ptr->num_tx_levels > 0 && + l_radio_stats_ptr->tx_time_per_levels != nullptr) { + radio.tx_time_per_levels.assign( l_radio_stats_ptr->tx_time_per_levels, - l_radio_stats_ptr->tx_time_per_levels + - l_radio_stats_ptr->num_tx_levels); - } - radio.stats.num_tx_levels = 0; - radio.stats.tx_time_per_levels = nullptr; - /* Copy over the channel stat to separate vector */ - if (l_radio_stats_ptr->num_channels > 0) { - /* Copy the channel stats */ - radio.channel_stats.assign( + l_radio_stats_ptr->tx_time_per_levels + l_radio_stats_ptr->num_tx_levels); + } + radio.stats.num_tx_levels = 0; + radio.stats.tx_time_per_levels = nullptr; + /* Copy over the channel stat to separate vector */ + if (l_radio_stats_ptr->num_channels > 0) { + /* Copy the channel stats */ + radio.channel_stats.assign( l_radio_stats_ptr->channels, - l_radio_stats_ptr->channels + - l_radio_stats_ptr->num_channels); - } - link_stats_ptr->radios.push_back(radio); - l_radio_stats_ptr = - (wifi_radio_stat*)((u8*)l_radio_stats_ptr + - sizeof(wifi_radio_stat) + + l_radio_stats_ptr->channels + l_radio_stats_ptr->num_channels); + } + link_stats_ptr->radios.push_back(radio); + l_radio_stats_ptr = + (wifi_radio_stat*)((u8*)l_radio_stats_ptr + sizeof(wifi_radio_stat) + (sizeof(wifi_channel_stat) * l_radio_stats_ptr->num_channels)); - } - }; + } + }; - wifi_error status = global_func_table_.wifi_get_link_stats( - 0, getIfaceHandle(iface_name), {onSyncLinkLayerStatsResult}); + wifi_error status = global_func_table_.wifi_get_link_stats(0, getIfaceHandle(iface_name), + {onSyncLinkLayerStatsResult}); on_link_layer_stats_result_internal_callback = nullptr; return {status, link_stats}; } wifi_error WifiLegacyHal::startRssiMonitoring( - const std::string& iface_name, wifi_request_id id, int8_t max_rssi, - int8_t min_rssi, - const on_rssi_threshold_breached_callback& - on_threshold_breached_user_callback) { + const std::string& iface_name, wifi_request_id id, int8_t max_rssi, int8_t min_rssi, + const on_rssi_threshold_breached_callback& on_threshold_breached_user_callback) { if (on_rssi_threshold_breached_internal_callback) { return WIFI_ERROR_NOT_AVAILABLE; } - on_rssi_threshold_breached_internal_callback = - [on_threshold_breached_user_callback](wifi_request_id id, - uint8_t* bssid_ptr, int8_t rssi) { - if (!bssid_ptr) { - return; - } - std::array bssid_arr; - // |bssid_ptr| pointer is assumed to have 6 bytes for the mac - // address. - std::copy(bssid_ptr, bssid_ptr + 6, std::begin(bssid_arr)); - on_threshold_breached_user_callback(id, bssid_arr, rssi); - }; + on_rssi_threshold_breached_internal_callback = [on_threshold_breached_user_callback]( + wifi_request_id id, uint8_t* bssid_ptr, + int8_t rssi) { + if (!bssid_ptr) { + return; + } + std::array bssid_arr; + // |bssid_ptr| pointer is assumed to have 6 bytes for the mac + // address. + std::copy(bssid_ptr, bssid_ptr + 6, std::begin(bssid_arr)); + on_threshold_breached_user_callback(id, bssid_arr, rssi); + }; wifi_error status = global_func_table_.wifi_start_rssi_monitoring( - id, getIfaceHandle(iface_name), max_rssi, min_rssi, - {onAsyncRssiThresholdBreached}); + id, getIfaceHandle(iface_name), max_rssi, min_rssi, {onAsyncRssiThresholdBreached}); if (status != WIFI_SUCCESS) { on_rssi_threshold_breached_internal_callback = nullptr; } return status; } -wifi_error WifiLegacyHal::stopRssiMonitoring(const std::string& iface_name, - wifi_request_id id) { +wifi_error WifiLegacyHal::stopRssiMonitoring(const std::string& iface_name, wifi_request_id id) { if (!on_rssi_threshold_breached_internal_callback) { return WIFI_ERROR_NOT_AVAILABLE; } - wifi_error status = global_func_table_.wifi_stop_rssi_monitoring( - id, getIfaceHandle(iface_name)); + wifi_error status = + global_func_table_.wifi_stop_rssi_monitoring(id, getIfaceHandle(iface_name)); // If the request Id is wrong, don't stop the ongoing rssi monitoring. Any // other error should be treated as the end of background scan. if (status != WIFI_ERROR_INVALID_REQUEST_ID) { @@ -832,82 +779,75 @@ wifi_error WifiLegacyHal::stopRssiMonitoring(const std::string& iface_name, return status; } -std::pair -WifiLegacyHal::getRoamingCapabilities(const std::string& iface_name) { +std::pair WifiLegacyHal::getRoamingCapabilities( + const std::string& iface_name) { wifi_roaming_capabilities caps; - wifi_error status = global_func_table_.wifi_get_roaming_capabilities( - getIfaceHandle(iface_name), &caps); + wifi_error status = + global_func_table_.wifi_get_roaming_capabilities(getIfaceHandle(iface_name), &caps); return {status, caps}; } wifi_error WifiLegacyHal::configureRoaming(const std::string& iface_name, const wifi_roaming_config& config) { wifi_roaming_config config_internal = config; - return global_func_table_.wifi_configure_roaming(getIfaceHandle(iface_name), - &config_internal); + return global_func_table_.wifi_configure_roaming(getIfaceHandle(iface_name), &config_internal); } wifi_error WifiLegacyHal::enableFirmwareRoaming(const std::string& iface_name, fw_roaming_state_t state) { - return global_func_table_.wifi_enable_firmware_roaming( - getIfaceHandle(iface_name), state); + return global_func_table_.wifi_enable_firmware_roaming(getIfaceHandle(iface_name), state); } -wifi_error WifiLegacyHal::configureNdOffload(const std::string& iface_name, - bool enable) { - return global_func_table_.wifi_configure_nd_offload( - getIfaceHandle(iface_name), enable); +wifi_error WifiLegacyHal::configureNdOffload(const std::string& iface_name, bool enable) { + return global_func_table_.wifi_configure_nd_offload(getIfaceHandle(iface_name), enable); } -wifi_error WifiLegacyHal::startSendingOffloadedPacket( - const std::string& iface_name, uint32_t cmd_id, uint16_t ether_type, - const std::vector& ip_packet_data, - const std::array& src_address, - const std::array& dst_address, uint32_t period_in_ms) { +wifi_error WifiLegacyHal::startSendingOffloadedPacket(const std::string& iface_name, + uint32_t cmd_id, uint16_t ether_type, + const std::vector& ip_packet_data, + const std::array& src_address, + const std::array& dst_address, + uint32_t period_in_ms) { std::vector ip_packet_data_internal(ip_packet_data); - std::vector src_address_internal( - src_address.data(), src_address.data() + src_address.size()); - std::vector dst_address_internal( - dst_address.data(), dst_address.data() + dst_address.size()); + std::vector src_address_internal(src_address.data(), + src_address.data() + src_address.size()); + std::vector dst_address_internal(dst_address.data(), + dst_address.data() + dst_address.size()); return global_func_table_.wifi_start_sending_offloaded_packet( - cmd_id, getIfaceHandle(iface_name), ether_type, - ip_packet_data_internal.data(), ip_packet_data_internal.size(), - src_address_internal.data(), dst_address_internal.data(), period_in_ms); + cmd_id, getIfaceHandle(iface_name), ether_type, ip_packet_data_internal.data(), + ip_packet_data_internal.size(), src_address_internal.data(), + dst_address_internal.data(), period_in_ms); } -wifi_error WifiLegacyHal::stopSendingOffloadedPacket( - const std::string& iface_name, uint32_t cmd_id) { - return global_func_table_.wifi_stop_sending_offloaded_packet( - cmd_id, getIfaceHandle(iface_name)); +wifi_error WifiLegacyHal::stopSendingOffloadedPacket(const std::string& iface_name, + uint32_t cmd_id) { + return global_func_table_.wifi_stop_sending_offloaded_packet(cmd_id, + getIfaceHandle(iface_name)); } wifi_error WifiLegacyHal::selectTxPowerScenario(const std::string& iface_name, wifi_power_scenario scenario) { - return global_func_table_.wifi_select_tx_power_scenario( - getIfaceHandle(iface_name), scenario); + return global_func_table_.wifi_select_tx_power_scenario(getIfaceHandle(iface_name), scenario); } wifi_error WifiLegacyHal::resetTxPowerScenario(const std::string& iface_name) { - return global_func_table_.wifi_reset_tx_power_scenario( - getIfaceHandle(iface_name)); + return global_func_table_.wifi_reset_tx_power_scenario(getIfaceHandle(iface_name)); } -wifi_error WifiLegacyHal::setLatencyMode(const std::string& iface_name, - wifi_latency_mode mode) { - return global_func_table_.wifi_set_latency_mode(getIfaceHandle(iface_name), - mode); +wifi_error WifiLegacyHal::setLatencyMode(const std::string& iface_name, wifi_latency_mode mode) { + return global_func_table_.wifi_set_latency_mode(getIfaceHandle(iface_name), mode); } wifi_error WifiLegacyHal::setThermalMitigationMode(wifi_thermal_mode mode, uint32_t completion_window) { - return global_func_table_.wifi_set_thermal_mitigation_mode( - global_handle_, mode, completion_window); + return global_func_table_.wifi_set_thermal_mitigation_mode(global_handle_, mode, + completion_window); } -wifi_error WifiLegacyHal::setDscpToAccessCategoryMapping( - uint32_t start, uint32_t end, uint32_t access_category) { - return global_func_table_.wifi_map_dscp_access_category( - global_handle_, start, end, access_category); +wifi_error WifiLegacyHal::setDscpToAccessCategoryMapping(uint32_t start, uint32_t end, + uint32_t access_category) { + return global_func_table_.wifi_map_dscp_access_category(global_handle_, start, end, + access_category); } wifi_error WifiLegacyHal::resetDscpToAccessCategoryMapping() { @@ -915,53 +855,49 @@ wifi_error WifiLegacyHal::resetDscpToAccessCategoryMapping() { } std::pair WifiLegacyHal::getLoggerSupportedFeatureSet( - const std::string& iface_name) { + const std::string& iface_name) { uint32_t supported_feature_flags = 0; wifi_error status = WIFI_SUCCESS; wifi_interface_handle iface_handle = getIfaceHandle(iface_name); if (iface_handle) { - status = global_func_table_.wifi_get_logger_supported_feature_set( - iface_handle, &supported_feature_flags); + status = global_func_table_.wifi_get_logger_supported_feature_set(iface_handle, + &supported_feature_flags); } return {status, supported_feature_flags}; } -wifi_error WifiLegacyHal::startPktFateMonitoring( - const std::string& iface_name) { - return global_func_table_.wifi_start_pkt_fate_monitoring( - getIfaceHandle(iface_name)); +wifi_error WifiLegacyHal::startPktFateMonitoring(const std::string& iface_name) { + return global_func_table_.wifi_start_pkt_fate_monitoring(getIfaceHandle(iface_name)); } std::pair> WifiLegacyHal::getTxPktFates( - const std::string& iface_name) { + const std::string& iface_name) { std::vector tx_pkt_fates; tx_pkt_fates.resize(MAX_FATE_LOG_LEN); size_t num_fates = 0; wifi_error status = global_func_table_.wifi_get_tx_pkt_fates( - getIfaceHandle(iface_name), tx_pkt_fates.data(), tx_pkt_fates.size(), - &num_fates); + getIfaceHandle(iface_name), tx_pkt_fates.data(), tx_pkt_fates.size(), &num_fates); CHECK(num_fates <= MAX_FATE_LOG_LEN); tx_pkt_fates.resize(num_fates); return {status, std::move(tx_pkt_fates)}; } std::pair> WifiLegacyHal::getRxPktFates( - const std::string& iface_name) { + const std::string& iface_name) { std::vector rx_pkt_fates; rx_pkt_fates.resize(MAX_FATE_LOG_LEN); size_t num_fates = 0; wifi_error status = global_func_table_.wifi_get_rx_pkt_fates( - getIfaceHandle(iface_name), rx_pkt_fates.data(), rx_pkt_fates.size(), - &num_fates); + getIfaceHandle(iface_name), rx_pkt_fates.data(), rx_pkt_fates.size(), &num_fates); CHECK(num_fates <= MAX_FATE_LOG_LEN); rx_pkt_fates.resize(num_fates); return {status, std::move(rx_pkt_fates)}; } std::pair WifiLegacyHal::getWakeReasonStats( - const std::string& iface_name) { + const std::string& iface_name) { WakeReasonStats stats; stats.cmd_event_wake_cnt.resize(kMaxWakeReasonStatsArraySize); stats.driver_fw_local_wake_cnt.resize(kMaxWakeReasonStatsArraySize); @@ -969,79 +905,69 @@ std::pair WifiLegacyHal::getWakeReasonStats( // This legacy struct needs separate memory to store the variable sized wake // reason types. stats.wake_reason_cnt.cmd_event_wake_cnt = - reinterpret_cast(stats.cmd_event_wake_cnt.data()); - stats.wake_reason_cnt.cmd_event_wake_cnt_sz = - stats.cmd_event_wake_cnt.size(); + reinterpret_cast(stats.cmd_event_wake_cnt.data()); + stats.wake_reason_cnt.cmd_event_wake_cnt_sz = stats.cmd_event_wake_cnt.size(); stats.wake_reason_cnt.cmd_event_wake_cnt_used = 0; stats.wake_reason_cnt.driver_fw_local_wake_cnt = - reinterpret_cast(stats.driver_fw_local_wake_cnt.data()); - stats.wake_reason_cnt.driver_fw_local_wake_cnt_sz = - stats.driver_fw_local_wake_cnt.size(); + reinterpret_cast(stats.driver_fw_local_wake_cnt.data()); + stats.wake_reason_cnt.driver_fw_local_wake_cnt_sz = stats.driver_fw_local_wake_cnt.size(); stats.wake_reason_cnt.driver_fw_local_wake_cnt_used = 0; - wifi_error status = global_func_table_.wifi_get_wake_reason_stats( - getIfaceHandle(iface_name), &stats.wake_reason_cnt); + wifi_error status = global_func_table_.wifi_get_wake_reason_stats(getIfaceHandle(iface_name), + &stats.wake_reason_cnt); - CHECK( - stats.wake_reason_cnt.cmd_event_wake_cnt_used >= 0 && - static_cast(stats.wake_reason_cnt.cmd_event_wake_cnt_used) <= - kMaxWakeReasonStatsArraySize); - stats.cmd_event_wake_cnt.resize( - stats.wake_reason_cnt.cmd_event_wake_cnt_used); + CHECK(stats.wake_reason_cnt.cmd_event_wake_cnt_used >= 0 && + static_cast(stats.wake_reason_cnt.cmd_event_wake_cnt_used) <= + kMaxWakeReasonStatsArraySize); + stats.cmd_event_wake_cnt.resize(stats.wake_reason_cnt.cmd_event_wake_cnt_used); stats.wake_reason_cnt.cmd_event_wake_cnt = nullptr; CHECK(stats.wake_reason_cnt.driver_fw_local_wake_cnt_used >= 0 && - static_cast( - stats.wake_reason_cnt.driver_fw_local_wake_cnt_used) <= - kMaxWakeReasonStatsArraySize); - stats.driver_fw_local_wake_cnt.resize( - stats.wake_reason_cnt.driver_fw_local_wake_cnt_used); + static_cast(stats.wake_reason_cnt.driver_fw_local_wake_cnt_used) <= + kMaxWakeReasonStatsArraySize); + stats.driver_fw_local_wake_cnt.resize(stats.wake_reason_cnt.driver_fw_local_wake_cnt_used); stats.wake_reason_cnt.driver_fw_local_wake_cnt = nullptr; return {status, stats}; } wifi_error WifiLegacyHal::registerRingBufferCallbackHandler( - const std::string& iface_name, - const on_ring_buffer_data_callback& on_user_data_callback) { + const std::string& iface_name, const on_ring_buffer_data_callback& on_user_data_callback) { if (on_ring_buffer_data_internal_callback) { return WIFI_ERROR_NOT_AVAILABLE; } - on_ring_buffer_data_internal_callback = - [on_user_data_callback](char* ring_name, char* buffer, int buffer_size, - wifi_ring_buffer_status* status) { - if (status && buffer) { - std::vector buffer_vector( - reinterpret_cast(buffer), - reinterpret_cast(buffer) + buffer_size); - on_user_data_callback(ring_name, buffer_vector, *status); - } - }; - wifi_error status = global_func_table_.wifi_set_log_handler( - 0, getIfaceHandle(iface_name), {onAsyncRingBufferData}); + on_ring_buffer_data_internal_callback = [on_user_data_callback]( + char* ring_name, char* buffer, int buffer_size, + wifi_ring_buffer_status* status) { + if (status && buffer) { + std::vector buffer_vector(reinterpret_cast(buffer), + reinterpret_cast(buffer) + buffer_size); + on_user_data_callback(ring_name, buffer_vector, *status); + } + }; + wifi_error status = global_func_table_.wifi_set_log_handler(0, getIfaceHandle(iface_name), + {onAsyncRingBufferData}); if (status != WIFI_SUCCESS) { on_ring_buffer_data_internal_callback = nullptr; } return status; } -wifi_error WifiLegacyHal::deregisterRingBufferCallbackHandler( - const std::string& iface_name) { +wifi_error WifiLegacyHal::deregisterRingBufferCallbackHandler(const std::string& iface_name) { if (!on_ring_buffer_data_internal_callback) { return WIFI_ERROR_NOT_AVAILABLE; } on_ring_buffer_data_internal_callback = nullptr; - return global_func_table_.wifi_reset_log_handler( - 0, getIfaceHandle(iface_name)); + return global_func_table_.wifi_reset_log_handler(0, getIfaceHandle(iface_name)); } -std::pair> -WifiLegacyHal::getRingBuffersStatus(const std::string& iface_name) { +std::pair> WifiLegacyHal::getRingBuffersStatus( + const std::string& iface_name) { std::vector ring_buffers_status; ring_buffers_status.resize(kMaxRingBuffers); uint32_t num_rings = kMaxRingBuffers; wifi_error status = global_func_table_.wifi_get_ring_buffers_status( - getIfaceHandle(iface_name), &num_rings, ring_buffers_status.data()); + getIfaceHandle(iface_name), &num_rings, ring_buffers_status.data()); CHECK(num_rings <= kMaxRingBuffers); ring_buffers_status.resize(num_rings); return {status, std::move(ring_buffers_status)}; @@ -1049,12 +975,11 @@ WifiLegacyHal::getRingBuffersStatus(const std::string& iface_name) { wifi_error WifiLegacyHal::startRingBufferLogging(const std::string& iface_name, const std::string& ring_name, - uint32_t verbose_level, - uint32_t max_interval_sec, + uint32_t verbose_level, uint32_t max_interval_sec, uint32_t min_data_size) { - return global_func_table_.wifi_start_logging( - getIfaceHandle(iface_name), verbose_level, 0, max_interval_sec, - min_data_size, makeCharVec(ring_name).data()); + return global_func_table_.wifi_start_logging(getIfaceHandle(iface_name), verbose_level, 0, + max_interval_sec, min_data_size, + makeCharVec(ring_name).data()); } wifi_error WifiLegacyHal::getRingBufferData(const std::string& iface_name, @@ -1064,51 +989,45 @@ wifi_error WifiLegacyHal::getRingBufferData(const std::string& iface_name, } wifi_error WifiLegacyHal::registerErrorAlertCallbackHandler( - const std::string& iface_name, - const on_error_alert_callback& on_user_alert_callback) { + const std::string& iface_name, const on_error_alert_callback& on_user_alert_callback) { if (on_error_alert_internal_callback) { return WIFI_ERROR_NOT_AVAILABLE; } - on_error_alert_internal_callback = [on_user_alert_callback]( - wifi_request_id id, char* buffer, - int buffer_size, int err_code) { + on_error_alert_internal_callback = [on_user_alert_callback](wifi_request_id id, char* buffer, + int buffer_size, int err_code) { if (buffer) { CHECK(id == 0); on_user_alert_callback( - err_code, - std::vector( - reinterpret_cast(buffer), - reinterpret_cast(buffer) + buffer_size)); + err_code, + std::vector(reinterpret_cast(buffer), + reinterpret_cast(buffer) + buffer_size)); } }; - wifi_error status = global_func_table_.wifi_set_alert_handler( - 0, getIfaceHandle(iface_name), {onAsyncErrorAlert}); + wifi_error status = global_func_table_.wifi_set_alert_handler(0, getIfaceHandle(iface_name), + {onAsyncErrorAlert}); if (status != WIFI_SUCCESS) { on_error_alert_internal_callback = nullptr; } return status; } -wifi_error WifiLegacyHal::deregisterErrorAlertCallbackHandler( - const std::string& iface_name) { +wifi_error WifiLegacyHal::deregisterErrorAlertCallbackHandler(const std::string& iface_name) { if (!on_error_alert_internal_callback) { return WIFI_ERROR_NOT_AVAILABLE; } on_error_alert_internal_callback = nullptr; - return global_func_table_.wifi_reset_alert_handler( - 0, getIfaceHandle(iface_name)); + return global_func_table_.wifi_reset_alert_handler(0, getIfaceHandle(iface_name)); } wifi_error WifiLegacyHal::registerRadioModeChangeCallbackHandler( - const std::string& iface_name, - const on_radio_mode_change_callback& on_user_change_callback) { + const std::string& iface_name, + const on_radio_mode_change_callback& on_user_change_callback) { if (on_radio_mode_change_internal_callback) { return WIFI_ERROR_NOT_AVAILABLE; } on_radio_mode_change_internal_callback = [on_user_change_callback]( - wifi_request_id /* id */, - uint32_t num_macs, - wifi_mac_info* mac_infos_arr) { + wifi_request_id /* id */, uint32_t num_macs, + wifi_mac_info* mac_infos_arr) { if (num_macs > 0 && mac_infos_arr) { std::vector mac_infos_vec; for (uint32_t i = 0; i < num_macs; i++) { @@ -1127,7 +1046,7 @@ wifi_error WifiLegacyHal::registerRadioModeChangeCallbackHandler( } }; wifi_error status = global_func_table_.wifi_set_radio_mode_change_handler( - 0, getIfaceHandle(iface_name), {onAsyncRadioModeChange}); + 0, getIfaceHandle(iface_name), {onAsyncRadioModeChange}); if (status != WIFI_SUCCESS) { on_radio_mode_change_internal_callback = nullptr; } @@ -1135,16 +1054,15 @@ wifi_error WifiLegacyHal::registerRadioModeChangeCallbackHandler( } wifi_error WifiLegacyHal::registerSubsystemRestartCallbackHandler( - const on_subsystem_restart_callback& on_restart_callback) { + const on_subsystem_restart_callback& on_restart_callback) { if (on_subsystem_restart_internal_callback) { return WIFI_ERROR_NOT_AVAILABLE; } - on_subsystem_restart_internal_callback = - [on_restart_callback](const char* error) { - on_restart_callback(error); - }; + on_subsystem_restart_internal_callback = [on_restart_callback](const char* error) { + on_restart_callback(error); + }; wifi_error status = global_func_table_.wifi_set_subsystem_restart_handler( - global_handle_, {onAsyncSubsystemRestart}); + global_handle_, {onAsyncSubsystemRestart}); if (status != WIFI_SUCCESS) { on_subsystem_restart_internal_callback = nullptr; } @@ -1152,33 +1070,30 @@ wifi_error WifiLegacyHal::registerSubsystemRestartCallbackHandler( } wifi_error WifiLegacyHal::startRttRangeRequest( - const std::string& iface_name, wifi_request_id id, - const std::vector& rtt_configs, - const on_rtt_results_callback& on_results_user_callback) { + const std::string& iface_name, wifi_request_id id, + const std::vector& rtt_configs, + const on_rtt_results_callback& on_results_user_callback) { if (on_rtt_results_internal_callback) { return WIFI_ERROR_NOT_AVAILABLE; } - on_rtt_results_internal_callback = - [on_results_user_callback](wifi_request_id id, unsigned num_results, - wifi_rtt_result* rtt_results[]) { - if (num_results > 0 && !rtt_results) { - LOG(ERROR) << "Unexpected nullptr in RTT results"; - return; - } - std::vector rtt_results_vec; - std::copy_if(rtt_results, rtt_results + num_results, - back_inserter(rtt_results_vec), - [](wifi_rtt_result* rtt_result) { - return rtt_result != nullptr; - }); - on_results_user_callback(id, rtt_results_vec); - }; + on_rtt_results_internal_callback = [on_results_user_callback](wifi_request_id id, + unsigned num_results, + wifi_rtt_result* rtt_results[]) { + if (num_results > 0 && !rtt_results) { + LOG(ERROR) << "Unexpected nullptr in RTT results"; + return; + } + std::vector rtt_results_vec; + std::copy_if(rtt_results, rtt_results + num_results, back_inserter(rtt_results_vec), + [](wifi_rtt_result* rtt_result) { return rtt_result != nullptr; }); + on_results_user_callback(id, rtt_results_vec); + }; std::vector rtt_configs_internal(rtt_configs); wifi_error status = global_func_table_.wifi_rtt_range_request( - id, getIfaceHandle(iface_name), rtt_configs.size(), - rtt_configs_internal.data(), {onAsyncRttResults}); + id, getIfaceHandle(iface_name), rtt_configs.size(), rtt_configs_internal.data(), + {onAsyncRttResults}); if (status != WIFI_SUCCESS) { on_rtt_results_internal_callback = nullptr; } @@ -1186,19 +1101,18 @@ wifi_error WifiLegacyHal::startRttRangeRequest( } wifi_error WifiLegacyHal::cancelRttRangeRequest( - const std::string& iface_name, wifi_request_id id, - const std::vector>& mac_addrs) { + const std::string& iface_name, wifi_request_id id, + const std::vector>& mac_addrs) { if (!on_rtt_results_internal_callback) { return WIFI_ERROR_NOT_AVAILABLE; } - static_assert(sizeof(mac_addr) == sizeof(std::array), - "MAC address size mismatch"); + static_assert(sizeof(mac_addr) == sizeof(std::array), "MAC address size mismatch"); // TODO: How do we handle partial cancels (i.e only a subset of enabled mac // addressed are cancelled). std::vector> mac_addrs_internal(mac_addrs); wifi_error status = global_func_table_.wifi_rtt_range_cancel( - id, getIfaceHandle(iface_name), mac_addrs.size(), - reinterpret_cast(mac_addrs_internal.data())); + id, getIfaceHandle(iface_name), mac_addrs.size(), + reinterpret_cast(mac_addrs_internal.data())); // If the request Id is wrong, don't stop the ongoing range request. Any // other error should be treated as the end of rtt ranging. if (status != WIFI_ERROR_INVALID_REQUEST_ID) { @@ -1208,225 +1122,188 @@ wifi_error WifiLegacyHal::cancelRttRangeRequest( } std::pair WifiLegacyHal::getRttCapabilities( - const std::string& iface_name) { + const std::string& iface_name) { wifi_rtt_capabilities rtt_caps; - wifi_error status = global_func_table_.wifi_get_rtt_capabilities( - getIfaceHandle(iface_name), &rtt_caps); + wifi_error status = + global_func_table_.wifi_get_rtt_capabilities(getIfaceHandle(iface_name), &rtt_caps); return {status, rtt_caps}; } std::pair WifiLegacyHal::getRttResponderInfo( - const std::string& iface_name) { + const std::string& iface_name) { wifi_rtt_responder rtt_responder; - wifi_error status = global_func_table_.wifi_rtt_get_responder_info( - getIfaceHandle(iface_name), &rtt_responder); + wifi_error status = global_func_table_.wifi_rtt_get_responder_info(getIfaceHandle(iface_name), + &rtt_responder); return {status, rtt_responder}; } -wifi_error WifiLegacyHal::enableRttResponder( - const std::string& iface_name, wifi_request_id id, - const wifi_channel_info& channel_hint, uint32_t max_duration_secs, - const wifi_rtt_responder& info) { +wifi_error WifiLegacyHal::enableRttResponder(const std::string& iface_name, wifi_request_id id, + const wifi_channel_info& channel_hint, + uint32_t max_duration_secs, + const wifi_rtt_responder& info) { wifi_rtt_responder info_internal(info); - return global_func_table_.wifi_enable_responder( - id, getIfaceHandle(iface_name), channel_hint, max_duration_secs, - &info_internal); + return global_func_table_.wifi_enable_responder(id, getIfaceHandle(iface_name), channel_hint, + max_duration_secs, &info_internal); } -wifi_error WifiLegacyHal::disableRttResponder(const std::string& iface_name, - wifi_request_id id) { - return global_func_table_.wifi_disable_responder( - id, getIfaceHandle(iface_name)); +wifi_error WifiLegacyHal::disableRttResponder(const std::string& iface_name, wifi_request_id id) { + return global_func_table_.wifi_disable_responder(id, getIfaceHandle(iface_name)); } -wifi_error WifiLegacyHal::setRttLci(const std::string& iface_name, - wifi_request_id id, +wifi_error WifiLegacyHal::setRttLci(const std::string& iface_name, wifi_request_id id, const wifi_lci_information& info) { wifi_lci_information info_internal(info); - return global_func_table_.wifi_set_lci(id, getIfaceHandle(iface_name), - &info_internal); + return global_func_table_.wifi_set_lci(id, getIfaceHandle(iface_name), &info_internal); } -wifi_error WifiLegacyHal::setRttLcr(const std::string& iface_name, - wifi_request_id id, +wifi_error WifiLegacyHal::setRttLcr(const std::string& iface_name, wifi_request_id id, const wifi_lcr_information& info) { wifi_lcr_information info_internal(info); - return global_func_table_.wifi_set_lcr(id, getIfaceHandle(iface_name), - &info_internal); + return global_func_table_.wifi_set_lcr(id, getIfaceHandle(iface_name), &info_internal); } -wifi_error WifiLegacyHal::nanRegisterCallbackHandlers( - const std::string& iface_name, const NanCallbackHandlers& user_callbacks) { +wifi_error WifiLegacyHal::nanRegisterCallbackHandlers(const std::string& iface_name, + const NanCallbackHandlers& user_callbacks) { on_nan_notify_response_user_callback = user_callbacks.on_notify_response; - on_nan_event_publish_terminated_user_callback = - user_callbacks.on_event_publish_terminated; + on_nan_event_publish_terminated_user_callback = user_callbacks.on_event_publish_terminated; on_nan_event_match_user_callback = user_callbacks.on_event_match; - on_nan_event_match_expired_user_callback = - user_callbacks.on_event_match_expired; - on_nan_event_subscribe_terminated_user_callback = - user_callbacks.on_event_subscribe_terminated; + on_nan_event_match_expired_user_callback = user_callbacks.on_event_match_expired; + on_nan_event_subscribe_terminated_user_callback = user_callbacks.on_event_subscribe_terminated; on_nan_event_followup_user_callback = user_callbacks.on_event_followup; - on_nan_event_disc_eng_event_user_callback = - user_callbacks.on_event_disc_eng_event; + on_nan_event_disc_eng_event_user_callback = user_callbacks.on_event_disc_eng_event; on_nan_event_disabled_user_callback = user_callbacks.on_event_disabled; on_nan_event_tca_user_callback = user_callbacks.on_event_tca; - on_nan_event_beacon_sdf_payload_user_callback = - user_callbacks.on_event_beacon_sdf_payload; - on_nan_event_data_path_request_user_callback = - user_callbacks.on_event_data_path_request; - on_nan_event_data_path_confirm_user_callback = - user_callbacks.on_event_data_path_confirm; - on_nan_event_data_path_end_user_callback = - user_callbacks.on_event_data_path_end; - on_nan_event_transmit_follow_up_user_callback = - user_callbacks.on_event_transmit_follow_up; - on_nan_event_range_request_user_callback = - user_callbacks.on_event_range_request; - on_nan_event_range_report_user_callback = - user_callbacks.on_event_range_report; - on_nan_event_schedule_update_user_callback = - user_callbacks.on_event_schedule_update; + on_nan_event_beacon_sdf_payload_user_callback = user_callbacks.on_event_beacon_sdf_payload; + on_nan_event_data_path_request_user_callback = user_callbacks.on_event_data_path_request; + on_nan_event_data_path_confirm_user_callback = user_callbacks.on_event_data_path_confirm; + on_nan_event_data_path_end_user_callback = user_callbacks.on_event_data_path_end; + on_nan_event_transmit_follow_up_user_callback = user_callbacks.on_event_transmit_follow_up; + on_nan_event_range_request_user_callback = user_callbacks.on_event_range_request; + on_nan_event_range_report_user_callback = user_callbacks.on_event_range_report; + on_nan_event_schedule_update_user_callback = user_callbacks.on_event_schedule_update; return global_func_table_.wifi_nan_register_handler( - getIfaceHandle(iface_name), - {onAysncNanNotifyResponse, onAysncNanEventPublishReplied, - onAysncNanEventPublishTerminated, onAysncNanEventMatch, - onAysncNanEventMatchExpired, onAysncNanEventSubscribeTerminated, - onAysncNanEventFollowup, onAysncNanEventDiscEngEvent, - onAysncNanEventDisabled, onAysncNanEventTca, - onAysncNanEventBeaconSdfPayload, onAysncNanEventDataPathRequest, - onAysncNanEventDataPathConfirm, onAysncNanEventDataPathEnd, - onAysncNanEventTransmitFollowUp, onAysncNanEventRangeRequest, - onAysncNanEventRangeReport, onAsyncNanEventScheduleUpdate}); -} - -wifi_error WifiLegacyHal::nanEnableRequest(const std::string& iface_name, - transaction_id id, + getIfaceHandle(iface_name), + {onAysncNanNotifyResponse, onAysncNanEventPublishReplied, + onAysncNanEventPublishTerminated, onAysncNanEventMatch, onAysncNanEventMatchExpired, + onAysncNanEventSubscribeTerminated, onAysncNanEventFollowup, + onAysncNanEventDiscEngEvent, onAysncNanEventDisabled, onAysncNanEventTca, + onAysncNanEventBeaconSdfPayload, onAysncNanEventDataPathRequest, + onAysncNanEventDataPathConfirm, onAysncNanEventDataPathEnd, + onAysncNanEventTransmitFollowUp, onAysncNanEventRangeRequest, + onAysncNanEventRangeReport, onAsyncNanEventScheduleUpdate}); +} + +wifi_error WifiLegacyHal::nanEnableRequest(const std::string& iface_name, transaction_id id, const NanEnableRequest& msg) { NanEnableRequest msg_internal(msg); - return global_func_table_.wifi_nan_enable_request( - id, getIfaceHandle(iface_name), &msg_internal); + return global_func_table_.wifi_nan_enable_request(id, getIfaceHandle(iface_name), + &msg_internal); } -wifi_error WifiLegacyHal::nanDisableRequest(const std::string& iface_name, - transaction_id id) { - return global_func_table_.wifi_nan_disable_request( - id, getIfaceHandle(iface_name)); +wifi_error WifiLegacyHal::nanDisableRequest(const std::string& iface_name, transaction_id id) { + return global_func_table_.wifi_nan_disable_request(id, getIfaceHandle(iface_name)); } -wifi_error WifiLegacyHal::nanPublishRequest(const std::string& iface_name, - transaction_id id, +wifi_error WifiLegacyHal::nanPublishRequest(const std::string& iface_name, transaction_id id, const NanPublishRequest& msg) { NanPublishRequest msg_internal(msg); - return global_func_table_.wifi_nan_publish_request( - id, getIfaceHandle(iface_name), &msg_internal); + return global_func_table_.wifi_nan_publish_request(id, getIfaceHandle(iface_name), + &msg_internal); } -wifi_error WifiLegacyHal::nanPublishCancelRequest( - const std::string& iface_name, transaction_id id, - const NanPublishCancelRequest& msg) { +wifi_error WifiLegacyHal::nanPublishCancelRequest(const std::string& iface_name, transaction_id id, + const NanPublishCancelRequest& msg) { NanPublishCancelRequest msg_internal(msg); - return global_func_table_.wifi_nan_publish_cancel_request( - id, getIfaceHandle(iface_name), &msg_internal); + return global_func_table_.wifi_nan_publish_cancel_request(id, getIfaceHandle(iface_name), + &msg_internal); } -wifi_error WifiLegacyHal::nanSubscribeRequest(const std::string& iface_name, - transaction_id id, +wifi_error WifiLegacyHal::nanSubscribeRequest(const std::string& iface_name, transaction_id id, const NanSubscribeRequest& msg) { NanSubscribeRequest msg_internal(msg); - return global_func_table_.wifi_nan_subscribe_request( - id, getIfaceHandle(iface_name), &msg_internal); + return global_func_table_.wifi_nan_subscribe_request(id, getIfaceHandle(iface_name), + &msg_internal); } -wifi_error WifiLegacyHal::nanSubscribeCancelRequest( - const std::string& iface_name, transaction_id id, - const NanSubscribeCancelRequest& msg) { +wifi_error WifiLegacyHal::nanSubscribeCancelRequest(const std::string& iface_name, + transaction_id id, + const NanSubscribeCancelRequest& msg) { NanSubscribeCancelRequest msg_internal(msg); - return global_func_table_.wifi_nan_subscribe_cancel_request( - id, getIfaceHandle(iface_name), &msg_internal); + return global_func_table_.wifi_nan_subscribe_cancel_request(id, getIfaceHandle(iface_name), + &msg_internal); } -wifi_error WifiLegacyHal::nanTransmitFollowupRequest( - const std::string& iface_name, transaction_id id, - const NanTransmitFollowupRequest& msg) { +wifi_error WifiLegacyHal::nanTransmitFollowupRequest(const std::string& iface_name, + transaction_id id, + const NanTransmitFollowupRequest& msg) { NanTransmitFollowupRequest msg_internal(msg); - return global_func_table_.wifi_nan_transmit_followup_request( - id, getIfaceHandle(iface_name), &msg_internal); + return global_func_table_.wifi_nan_transmit_followup_request(id, getIfaceHandle(iface_name), + &msg_internal); } -wifi_error WifiLegacyHal::nanStatsRequest(const std::string& iface_name, - transaction_id id, +wifi_error WifiLegacyHal::nanStatsRequest(const std::string& iface_name, transaction_id id, const NanStatsRequest& msg) { NanStatsRequest msg_internal(msg); - return global_func_table_.wifi_nan_stats_request( - id, getIfaceHandle(iface_name), &msg_internal); + return global_func_table_.wifi_nan_stats_request(id, getIfaceHandle(iface_name), &msg_internal); } -wifi_error WifiLegacyHal::nanConfigRequest(const std::string& iface_name, - transaction_id id, +wifi_error WifiLegacyHal::nanConfigRequest(const std::string& iface_name, transaction_id id, const NanConfigRequest& msg) { NanConfigRequest msg_internal(msg); - return global_func_table_.wifi_nan_config_request( - id, getIfaceHandle(iface_name), &msg_internal); + return global_func_table_.wifi_nan_config_request(id, getIfaceHandle(iface_name), + &msg_internal); } -wifi_error WifiLegacyHal::nanTcaRequest(const std::string& iface_name, - transaction_id id, +wifi_error WifiLegacyHal::nanTcaRequest(const std::string& iface_name, transaction_id id, const NanTCARequest& msg) { NanTCARequest msg_internal(msg); - return global_func_table_.wifi_nan_tca_request( - id, getIfaceHandle(iface_name), &msg_internal); + return global_func_table_.wifi_nan_tca_request(id, getIfaceHandle(iface_name), &msg_internal); } -wifi_error WifiLegacyHal::nanBeaconSdfPayloadRequest( - const std::string& iface_name, transaction_id id, - const NanBeaconSdfPayloadRequest& msg) { +wifi_error WifiLegacyHal::nanBeaconSdfPayloadRequest(const std::string& iface_name, + transaction_id id, + const NanBeaconSdfPayloadRequest& msg) { NanBeaconSdfPayloadRequest msg_internal(msg); - return global_func_table_.wifi_nan_beacon_sdf_payload_request( - id, getIfaceHandle(iface_name), &msg_internal); + return global_func_table_.wifi_nan_beacon_sdf_payload_request(id, getIfaceHandle(iface_name), + &msg_internal); } std::pair WifiLegacyHal::nanGetVersion() { NanVersion version; - wifi_error status = - global_func_table_.wifi_nan_get_version(global_handle_, &version); + wifi_error status = global_func_table_.wifi_nan_get_version(global_handle_, &version); return {status, version}; } -wifi_error WifiLegacyHal::nanGetCapabilities(const std::string& iface_name, - transaction_id id) { - return global_func_table_.wifi_nan_get_capabilities( - id, getIfaceHandle(iface_name)); +wifi_error WifiLegacyHal::nanGetCapabilities(const std::string& iface_name, transaction_id id) { + return global_func_table_.wifi_nan_get_capabilities(id, getIfaceHandle(iface_name)); } -wifi_error WifiLegacyHal::nanDataInterfaceCreate( - const std::string& iface_name, transaction_id id, - const std::string& data_iface_name) { - return global_func_table_.wifi_nan_data_interface_create( - id, getIfaceHandle(iface_name), makeCharVec(data_iface_name).data()); +wifi_error WifiLegacyHal::nanDataInterfaceCreate(const std::string& iface_name, transaction_id id, + const std::string& data_iface_name) { + return global_func_table_.wifi_nan_data_interface_create(id, getIfaceHandle(iface_name), + makeCharVec(data_iface_name).data()); } -wifi_error WifiLegacyHal::nanDataInterfaceDelete( - const std::string& iface_name, transaction_id id, - const std::string& data_iface_name) { - return global_func_table_.wifi_nan_data_interface_delete( - id, getIfaceHandle(iface_name), makeCharVec(data_iface_name).data()); +wifi_error WifiLegacyHal::nanDataInterfaceDelete(const std::string& iface_name, transaction_id id, + const std::string& data_iface_name) { + return global_func_table_.wifi_nan_data_interface_delete(id, getIfaceHandle(iface_name), + makeCharVec(data_iface_name).data()); } -wifi_error WifiLegacyHal::nanDataRequestInitiator( - const std::string& iface_name, transaction_id id, - const NanDataPathInitiatorRequest& msg) { +wifi_error WifiLegacyHal::nanDataRequestInitiator(const std::string& iface_name, transaction_id id, + const NanDataPathInitiatorRequest& msg) { NanDataPathInitiatorRequest msg_internal(msg); - return global_func_table_.wifi_nan_data_request_initiator( - id, getIfaceHandle(iface_name), &msg_internal); + return global_func_table_.wifi_nan_data_request_initiator(id, getIfaceHandle(iface_name), + &msg_internal); } -wifi_error WifiLegacyHal::nanDataIndicationResponse( - const std::string& iface_name, transaction_id id, - const NanDataPathIndicationResponse& msg) { +wifi_error WifiLegacyHal::nanDataIndicationResponse(const std::string& iface_name, + transaction_id id, + const NanDataPathIndicationResponse& msg) { NanDataPathIndicationResponse msg_internal(msg); - return global_func_table_.wifi_nan_data_indication_response( - id, getIfaceHandle(iface_name), &msg_internal); + return global_func_table_.wifi_nan_data_indication_response(id, getIfaceHandle(iface_name), + &msg_internal); } typedef struct { @@ -1434,29 +1311,27 @@ typedef struct { NanDataPathId ndp_instance_id; } NanDataPathEndSingleNdpIdRequest; -wifi_error WifiLegacyHal::nanDataEnd(const std::string& iface_name, - transaction_id id, +wifi_error WifiLegacyHal::nanDataEnd(const std::string& iface_name, transaction_id id, uint32_t ndpInstanceId) { NanDataPathEndSingleNdpIdRequest msg; msg.num_ndp_instances = 1; msg.ndp_instance_id = ndpInstanceId; - wifi_error status = global_func_table_.wifi_nan_data_end( - id, getIfaceHandle(iface_name), (NanDataPathEndRequest*)&msg); + wifi_error status = global_func_table_.wifi_nan_data_end(id, getIfaceHandle(iface_name), + (NanDataPathEndRequest*)&msg); return status; } wifi_error WifiLegacyHal::setCountryCode(const std::string& iface_name, std::array code) { std::string code_str(code.data(), code.data() + code.size()); - return global_func_table_.wifi_set_country_code(getIfaceHandle(iface_name), - code_str.c_str()); + return global_func_table_.wifi_set_country_code(getIfaceHandle(iface_name), code_str.c_str()); } wifi_error WifiLegacyHal::retrieveIfaceHandles() { wifi_interface_handle* iface_handles = nullptr; int num_iface_handles = 0; - wifi_error status = global_func_table_.wifi_get_ifaces( - global_handle_, &num_iface_handles, &iface_handles); + wifi_error status = + global_func_table_.wifi_get_ifaces(global_handle_, &num_iface_handles, &iface_handles); if (status != WIFI_SUCCESS) { LOG(ERROR) << "Failed to enumerate interface handles"; return status; @@ -1464,8 +1339,8 @@ wifi_error WifiLegacyHal::retrieveIfaceHandles() { iface_name_to_handle_.clear(); for (int i = 0; i < num_iface_handles; ++i) { std::array iface_name_arr = {}; - status = global_func_table_.wifi_get_iface_name( - iface_handles[i], iface_name_arr.data(), iface_name_arr.size()); + status = global_func_table_.wifi_get_iface_name(iface_handles[i], iface_name_arr.data(), + iface_name_arr.size()); if (status != WIFI_SUCCESS) { LOG(WARNING) << "Failed to get interface handle name"; continue; @@ -1479,8 +1354,7 @@ wifi_error WifiLegacyHal::retrieveIfaceHandles() { return WIFI_SUCCESS; } -wifi_interface_handle WifiLegacyHal::getIfaceHandle( - const std::string& iface_name) { +wifi_interface_handle WifiLegacyHal::getIfaceHandle(const std::string& iface_name) { const auto iface_handle_iter = iface_name_to_handle_.find(iface_name); if (iface_handle_iter == iface_name_to_handle_.end()) { LOG(ERROR) << "Unknown iface name: " << iface_name; @@ -1494,24 +1368,22 @@ void WifiLegacyHal::runEventLoop() { global_func_table_.wifi_event_loop(global_handle_); const auto lock = hidl_sync_util::acquireGlobalLock(); if (!awaiting_event_loop_termination_) { - LOG(FATAL) - << "Legacy HAL event loop terminated, but HAL was not stopping"; + LOG(FATAL) << "Legacy HAL event loop terminated, but HAL was not stopping"; } LOG(DEBUG) << "Legacy HAL event loop terminated"; awaiting_event_loop_termination_ = false; stop_wait_cv_.notify_one(); } -std::pair> -WifiLegacyHal::getGscanCachedResults(const std::string& iface_name) { +std::pair> WifiLegacyHal::getGscanCachedResults( + const std::string& iface_name) { std::vector cached_scan_results; cached_scan_results.resize(kMaxCachedGscanResults); int32_t num_results = 0; wifi_error status = global_func_table_.wifi_get_cached_gscan_results( - getIfaceHandle(iface_name), true /* always flush */, - cached_scan_results.size(), cached_scan_results.data(), &num_results); - CHECK(num_results >= 0 && - static_cast(num_results) <= kMaxCachedGscanResults); + getIfaceHandle(iface_name), true /* always flush */, cached_scan_results.size(), + cached_scan_results.data(), &num_results); + CHECK(num_results >= 0 && static_cast(num_results) <= kMaxCachedGscanResults); cached_scan_results.resize(num_results); // Check for invalid IE lengths in these cached scan results and correct it. for (auto& cached_scan_result : cached_scan_results) { @@ -1519,8 +1391,7 @@ WifiLegacyHal::getGscanCachedResults(const std::string& iface_name) { for (int i = 0; i < num_scan_results; i++) { auto& scan_result = cached_scan_result.results[i]; if (scan_result.ie_length > 0) { - LOG(DEBUG) << "Cached scan result has non-zero IE length " - << scan_result.ie_length; + LOG(DEBUG) << "Cached scan result has non-zero IE length " << scan_result.ie_length; scan_result.ie_length = 0; } } @@ -1532,20 +1403,20 @@ wifi_error WifiLegacyHal::createVirtualInterface(const std::string& ifname, wifi_interface_type iftype) { // Create the interface if it doesn't exist. If interface already exist, // Vendor Hal should return WIFI_SUCCESS. - wifi_error status = global_func_table_.wifi_virtual_interface_create( - global_handle_, ifname.c_str(), iftype); + wifi_error status = global_func_table_.wifi_virtual_interface_create(global_handle_, + ifname.c_str(), iftype); return handleVirtualInterfaceCreateOrDeleteStatus(ifname, status); } wifi_error WifiLegacyHal::deleteVirtualInterface(const std::string& ifname) { // Delete the interface if it was created dynamically. - wifi_error status = global_func_table_.wifi_virtual_interface_delete( - global_handle_, ifname.c_str()); + wifi_error status = + global_func_table_.wifi_virtual_interface_delete(global_handle_, ifname.c_str()); return handleVirtualInterfaceCreateOrDeleteStatus(ifname, status); } -wifi_error WifiLegacyHal::handleVirtualInterfaceCreateOrDeleteStatus( - const std::string& ifname, wifi_error status) { +wifi_error WifiLegacyHal::handleVirtualInterfaceCreateOrDeleteStatus(const std::string& ifname, + wifi_error status) { if (status == WIFI_SUCCESS) { // refresh list of handlers now. status = retrieveIfaceHandles(); @@ -1561,116 +1432,98 @@ wifi_error WifiLegacyHal::handleVirtualInterfaceCreateOrDeleteStatus( return status; } -wifi_error WifiLegacyHal::getSupportedIfaceName(uint32_t iface_type, - std::string& ifname) { +wifi_error WifiLegacyHal::getSupportedIfaceName(uint32_t iface_type, std::string& ifname) { std::array buffer; wifi_error res = global_func_table_.wifi_get_supported_iface_name( - global_handle_, (uint32_t)iface_type, buffer.data(), buffer.size()); + global_handle_, (uint32_t)iface_type, buffer.data(), buffer.size()); if (res == WIFI_SUCCESS) ifname = buffer.data(); return res; } -wifi_error WifiLegacyHal::multiStaSetPrimaryConnection( - const std::string& ifname) { - return global_func_table_.wifi_multi_sta_set_primary_connection( - global_handle_, getIfaceHandle(ifname)); +wifi_error WifiLegacyHal::multiStaSetPrimaryConnection(const std::string& ifname) { + return global_func_table_.wifi_multi_sta_set_primary_connection(global_handle_, + getIfaceHandle(ifname)); } wifi_error WifiLegacyHal::multiStaSetUseCase(wifi_multi_sta_use_case use_case) { - return global_func_table_.wifi_multi_sta_set_use_case(global_handle_, - use_case); + return global_func_table_.wifi_multi_sta_set_use_case(global_handle_, use_case); } wifi_error WifiLegacyHal::setCoexUnsafeChannels( - std::vector unsafe_channels, - uint32_t restrictions) { - return global_func_table_.wifi_set_coex_unsafe_channels( - global_handle_, unsafe_channels.size(), unsafe_channels.data(), - restrictions); + std::vector unsafe_channels, uint32_t restrictions) { + return global_func_table_.wifi_set_coex_unsafe_channels(global_handle_, unsafe_channels.size(), + unsafe_channels.data(), restrictions); } -wifi_error WifiLegacyHal::setVoipMode(const std::string& iface_name, - wifi_voip_mode mode) { - return global_func_table_.wifi_set_voip_mode(getIfaceHandle(iface_name), - mode); +wifi_error WifiLegacyHal::setVoipMode(const std::string& iface_name, wifi_voip_mode mode) { + return global_func_table_.wifi_set_voip_mode(getIfaceHandle(iface_name), mode); } -wifi_error WifiLegacyHal::twtRegisterHandler( - const std::string& iface_name, const TwtCallbackHandlers& user_callbacks) { +wifi_error WifiLegacyHal::twtRegisterHandler(const std::string& iface_name, + const TwtCallbackHandlers& user_callbacks) { on_twt_event_setup_response_callback = user_callbacks.on_setup_response; - on_twt_event_teardown_completion_callback = - user_callbacks.on_teardown_completion; - on_twt_event_info_frame_received_callback = - user_callbacks.on_info_frame_received; + on_twt_event_teardown_completion_callback = user_callbacks.on_teardown_completion; + on_twt_event_info_frame_received_callback = user_callbacks.on_info_frame_received; on_twt_event_device_notify_callback = user_callbacks.on_device_notify; return global_func_table_.wifi_twt_register_handler( - getIfaceHandle(iface_name), - {onAsyncTwtEventSetupResponse, onAsyncTwtEventTeardownCompletion, - onAsyncTwtEventInfoFrameReceived, onAsyncTwtEventDeviceNotify}); + getIfaceHandle(iface_name), + {onAsyncTwtEventSetupResponse, onAsyncTwtEventTeardownCompletion, + onAsyncTwtEventInfoFrameReceived, onAsyncTwtEventDeviceNotify}); } std::pair WifiLegacyHal::twtGetCapability( - const std::string& iface_name) { + const std::string& iface_name) { TwtCapabilitySet capSet; - wifi_error status = global_func_table_.wifi_twt_get_capability( - getIfaceHandle(iface_name), &capSet); + wifi_error status = + global_func_table_.wifi_twt_get_capability(getIfaceHandle(iface_name), &capSet); return {status, capSet}; } wifi_error WifiLegacyHal::twtSetupRequest(const std::string& iface_name, const TwtSetupRequest& msg) { TwtSetupRequest msgInternal(msg); - return global_func_table_.wifi_twt_setup_request(getIfaceHandle(iface_name), - &msgInternal); + return global_func_table_.wifi_twt_setup_request(getIfaceHandle(iface_name), &msgInternal); } wifi_error WifiLegacyHal::twtTearDownRequest(const std::string& iface_name, const TwtTeardownRequest& msg) { TwtTeardownRequest msgInternal(msg); - return global_func_table_.wifi_twt_teardown_request( - getIfaceHandle(iface_name), &msgInternal); + return global_func_table_.wifi_twt_teardown_request(getIfaceHandle(iface_name), &msgInternal); } wifi_error WifiLegacyHal::twtInfoFrameRequest(const std::string& iface_name, const TwtInfoFrameRequest& msg) { TwtInfoFrameRequest msgInternal(msg); - return global_func_table_.wifi_twt_info_frame_request( - getIfaceHandle(iface_name), &msgInternal); + return global_func_table_.wifi_twt_info_frame_request(getIfaceHandle(iface_name), &msgInternal); } -std::pair WifiLegacyHal::twtGetStats( - const std::string& iface_name, uint8_t configId) { +std::pair WifiLegacyHal::twtGetStats(const std::string& iface_name, + uint8_t configId) { TwtStats stats; - wifi_error status = global_func_table_.wifi_twt_get_stats( - getIfaceHandle(iface_name), configId, &stats); + wifi_error status = + global_func_table_.wifi_twt_get_stats(getIfaceHandle(iface_name), configId, &stats); return {status, stats}; } -wifi_error WifiLegacyHal::twtClearStats(const std::string& iface_name, - uint8_t configId) { - return global_func_table_.wifi_twt_clear_stats(getIfaceHandle(iface_name), - configId); +wifi_error WifiLegacyHal::twtClearStats(const std::string& iface_name, uint8_t configId) { + return global_func_table_.wifi_twt_clear_stats(getIfaceHandle(iface_name), configId); } -wifi_error WifiLegacyHal::setDtimConfig(const std::string& iface_name, - uint32_t multiplier) { - return global_func_table_.wifi_set_dtim_config(getIfaceHandle(iface_name), - multiplier); +wifi_error WifiLegacyHal::setDtimConfig(const std::string& iface_name, uint32_t multiplier) { + return global_func_table_.wifi_set_dtim_config(getIfaceHandle(iface_name), multiplier); } -std::pair> -WifiLegacyHal::getUsableChannels(uint32_t band_mask, uint32_t iface_mode_mask, - uint32_t filter_mask) { +std::pair> WifiLegacyHal::getUsableChannels( + uint32_t band_mask, uint32_t iface_mode_mask, uint32_t filter_mask) { std::vector channels; channels.resize(kMaxWifiUsableChannels); uint32_t size = 0; wifi_error status = global_func_table_.wifi_get_usable_channels( - global_handle_, band_mask, iface_mode_mask, filter_mask, - channels.size(), &size, - reinterpret_cast(channels.data())); + global_handle_, band_mask, iface_mode_mask, filter_mask, channels.size(), &size, + reinterpret_cast(channels.data())); CHECK(size >= 0 && size <= kMaxWifiUsableChannels); channels.resize(size); return {status, std::move(channels)}; @@ -1719,7 +1572,7 @@ void WifiLegacyHal::invalidate() { } // namespace legacy_hal } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_legacy_hal.h b/wifi/1.6/default/wifi_legacy_hal.h similarity index 73% rename from wifi/1.5/default/wifi_legacy_hal.h rename to wifi/1.6/default/wifi_legacy_hal.h index 2bb7631efa..d87242cdd5 100644 --- a/wifi/1.5/default/wifi_legacy_hal.h +++ b/wifi/1.6/default/wifi_legacy_hal.h @@ -29,7 +29,7 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { // This is in a separate namespace to prevent typename conflicts between // the legacy HAL types and the HIDL interface types. @@ -366,63 +366,53 @@ struct WakeReasonStats { // NAN response and event callbacks struct. struct NanCallbackHandlers { // NotifyResponse invoked to notify the status of the Request. - std::function - on_notify_response; + std::function on_notify_response; // Various event callbacks. - std::function - on_event_publish_terminated; + std::function on_event_publish_terminated; std::function on_event_match; std::function on_event_match_expired; - std::function - on_event_subscribe_terminated; + std::function on_event_subscribe_terminated; std::function on_event_followup; std::function on_event_disc_eng_event; std::function on_event_disabled; std::function on_event_tca; - std::function - on_event_beacon_sdf_payload; - std::function - on_event_data_path_request; - std::function - on_event_data_path_confirm; + std::function on_event_beacon_sdf_payload; + std::function on_event_data_path_request; + std::function on_event_data_path_confirm; std::function on_event_data_path_end; - std::function - on_event_transmit_follow_up; + std::function on_event_transmit_follow_up; std::function on_event_range_request; std::function on_event_range_report; - std::function - on_event_schedule_update; + std::function on_event_schedule_update; }; // Full scan results contain IE info and are hence passed by reference, to // preserve the variable length array member |ie_data|. Callee must not retain // the pointer. using on_gscan_full_result_callback = - std::function; + std::function; // These scan results don't contain any IE info, so no need to pass by // reference. -using on_gscan_results_callback = std::function&)>; +using on_gscan_results_callback = + std::function&)>; // Invoked when the rssi value breaches the thresholds set. using on_rssi_threshold_breached_callback = - std::function, int8_t)>; + std::function, int8_t)>; // Callback for RTT range request results. // Rtt results contain IE info and are hence passed by reference, to // preserve the |LCI| and |LCR| pointers. Callee must not retain // the pointer. -using on_rtt_results_callback = std::function&)>; +using on_rtt_results_callback = + std::function&)>; // Callback for ring buffer data. -using on_ring_buffer_data_callback = - std::function&, - const wifi_ring_buffer_status&)>; +using on_ring_buffer_data_callback = std::function&, const wifi_ring_buffer_status&)>; // Callback for alerts. -using on_error_alert_callback = - std::function&)>; +using on_error_alert_callback = std::function&)>; // Callback for subsystem restart using on_subsystem_restart_callback = std::function; @@ -443,8 +433,7 @@ typedef struct { } WifiMacInfo; // Callback for radio mode change -using on_radio_mode_change_callback = - std::function&)>; +using on_radio_mode_change_callback = std::function&)>; // TWT response and event callbacks struct. struct TwtCallbackHandlers { @@ -466,9 +455,9 @@ struct TwtCallbackHandlers { * object and will be valid for the lifetime of the process. */ class WifiLegacyHal { - public: - WifiLegacyHal(const std::weak_ptr iface_tool, - const wifi_hal_fn& fn, bool is_primary); + public: + WifiLegacyHal(const std::weak_ptr iface_tool, const wifi_hal_fn& fn, + bool is_primary); virtual ~WifiLegacyHal() = default; // Initialize the legacy HAL function table. @@ -483,26 +472,22 @@ class WifiLegacyHal { // Checks if legacy HAL has successfully started bool isStarted(); // Wrappers for all the functions in the legacy HAL function table. - virtual std::pair getDriverVersion( - const std::string& iface_name); - virtual std::pair getFirmwareVersion( - const std::string& iface_name); + virtual std::pair getDriverVersion(const std::string& iface_name); + virtual std::pair getFirmwareVersion(const std::string& iface_name); std::pair> requestDriverMemoryDump( - const std::string& iface_name); + const std::string& iface_name); std::pair> requestFirmwareMemoryDump( - const std::string& iface_name); - std::pair getSupportedFeatureSet( - const std::string& iface_name); + const std::string& iface_name); + std::pair getSupportedFeatureSet(const std::string& iface_name); // APF functions. std::pair getPacketFilterCapabilities( - const std::string& iface_name); - wifi_error setPacketFilter(const std::string& iface_name, - const std::vector& program); + const std::string& iface_name); + wifi_error setPacketFilter(const std::string& iface_name, const std::vector& program); std::pair> readApfPacketFilterData( - const std::string& iface_name); + const std::string& iface_name); // Gscan functions. std::pair getGscanCapabilities( - const std::string& iface_name); + const std::string& iface_name); // These API's provides a simplified interface over the legacy Gscan API's: // a) All scan events from the legacy HAL API other than the // |WIFI_SCAN_FAILED| are treated as notification of results. @@ -514,162 +499,121 @@ class WifiLegacyHal { // triggers the externally provided |on_failure_user_callback|. // c) Full scan result event triggers the externally provided // |on_full_result_user_callback|. - wifi_error startGscan( - const std::string& iface_name, wifi_request_id id, - const wifi_scan_cmd_params& params, - const std::function& on_failure_callback, - const on_gscan_results_callback& on_results_callback, - const on_gscan_full_result_callback& on_full_result_callback); + wifi_error startGscan(const std::string& iface_name, wifi_request_id id, + const wifi_scan_cmd_params& params, + const std::function& on_failure_callback, + const on_gscan_results_callback& on_results_callback, + const on_gscan_full_result_callback& on_full_result_callback); wifi_error stopGscan(const std::string& iface_name, wifi_request_id id); std::pair> getValidFrequenciesForBand( - const std::string& iface_name, wifi_band band); + const std::string& iface_name, wifi_band band); virtual wifi_error setDfsFlag(const std::string& iface_name, bool dfs_on); // Link layer stats functions. wifi_error enableLinkLayerStats(const std::string& iface_name, bool debug); wifi_error disableLinkLayerStats(const std::string& iface_name); - std::pair getLinkLayerStats( - const std::string& iface_name); + std::pair getLinkLayerStats(const std::string& iface_name); // RSSI monitor functions. - wifi_error startRssiMonitoring(const std::string& iface_name, - wifi_request_id id, int8_t max_rssi, - int8_t min_rssi, - const on_rssi_threshold_breached_callback& - on_threshold_breached_callback); - wifi_error stopRssiMonitoring(const std::string& iface_name, - wifi_request_id id); + wifi_error startRssiMonitoring( + const std::string& iface_name, wifi_request_id id, int8_t max_rssi, int8_t min_rssi, + const on_rssi_threshold_breached_callback& on_threshold_breached_callback); + wifi_error stopRssiMonitoring(const std::string& iface_name, wifi_request_id id); std::pair getRoamingCapabilities( - const std::string& iface_name); - wifi_error configureRoaming(const std::string& iface_name, - const wifi_roaming_config& config); - wifi_error enableFirmwareRoaming(const std::string& iface_name, - fw_roaming_state_t state); + const std::string& iface_name); + wifi_error configureRoaming(const std::string& iface_name, const wifi_roaming_config& config); + wifi_error enableFirmwareRoaming(const std::string& iface_name, fw_roaming_state_t state); wifi_error configureNdOffload(const std::string& iface_name, bool enable); - wifi_error startSendingOffloadedPacket( - const std::string& iface_name, uint32_t cmd_id, uint16_t ether_type, - const std::vector& ip_packet_data, - const std::array& src_address, - const std::array& dst_address, uint32_t period_in_ms); - wifi_error stopSendingOffloadedPacket(const std::string& iface_name, - uint32_t cmd_id); + wifi_error startSendingOffloadedPacket(const std::string& iface_name, uint32_t cmd_id, + uint16_t ether_type, + const std::vector& ip_packet_data, + const std::array& src_address, + const std::array& dst_address, + uint32_t period_in_ms); + wifi_error stopSendingOffloadedPacket(const std::string& iface_name, uint32_t cmd_id); virtual wifi_error selectTxPowerScenario(const std::string& iface_name, wifi_power_scenario scenario); virtual wifi_error resetTxPowerScenario(const std::string& iface_name); - wifi_error setLatencyMode(const std::string& iface_name, - wifi_latency_mode mode); - wifi_error setThermalMitigationMode(wifi_thermal_mode mode, - uint32_t completion_window); + wifi_error setLatencyMode(const std::string& iface_name, wifi_latency_mode mode); + wifi_error setThermalMitigationMode(wifi_thermal_mode mode, uint32_t completion_window); wifi_error setDscpToAccessCategoryMapping(uint32_t start, uint32_t end, uint32_t access_category); wifi_error resetDscpToAccessCategoryMapping(); // Logger/debug functions. - std::pair getLoggerSupportedFeatureSet( - const std::string& iface_name); + std::pair getLoggerSupportedFeatureSet(const std::string& iface_name); wifi_error startPktFateMonitoring(const std::string& iface_name); - std::pair> getTxPktFates( - const std::string& iface_name); - std::pair> getRxPktFates( - const std::string& iface_name); - std::pair getWakeReasonStats( - const std::string& iface_name); + std::pair> getTxPktFates(const std::string& iface_name); + std::pair> getRxPktFates(const std::string& iface_name); + std::pair getWakeReasonStats(const std::string& iface_name); wifi_error registerRingBufferCallbackHandler( - const std::string& iface_name, - const on_ring_buffer_data_callback& on_data_callback); - wifi_error deregisterRingBufferCallbackHandler( - const std::string& iface_name); + const std::string& iface_name, const on_ring_buffer_data_callback& on_data_callback); + wifi_error deregisterRingBufferCallbackHandler(const std::string& iface_name); wifi_error registerSubsystemRestartCallbackHandler( - const on_subsystem_restart_callback& on_restart_callback); - std::pair> - getRingBuffersStatus(const std::string& iface_name); - wifi_error startRingBufferLogging(const std::string& iface_name, - const std::string& ring_name, - uint32_t verbose_level, - uint32_t max_interval_sec, + const on_subsystem_restart_callback& on_restart_callback); + std::pair> getRingBuffersStatus( + const std::string& iface_name); + wifi_error startRingBufferLogging(const std::string& iface_name, const std::string& ring_name, + uint32_t verbose_level, uint32_t max_interval_sec, uint32_t min_data_size); - wifi_error getRingBufferData(const std::string& iface_name, - const std::string& ring_name); - wifi_error registerErrorAlertCallbackHandler( - const std::string& iface_name, - const on_error_alert_callback& on_alert_callback); - wifi_error deregisterErrorAlertCallbackHandler( - const std::string& iface_name); + wifi_error getRingBufferData(const std::string& iface_name, const std::string& ring_name); + wifi_error registerErrorAlertCallbackHandler(const std::string& iface_name, + const on_error_alert_callback& on_alert_callback); + wifi_error deregisterErrorAlertCallbackHandler(const std::string& iface_name); // Radio mode functions. virtual wifi_error registerRadioModeChangeCallbackHandler( - const std::string& iface_name, - const on_radio_mode_change_callback& on_user_change_callback); + const std::string& iface_name, + const on_radio_mode_change_callback& on_user_change_callback); // RTT functions. - wifi_error startRttRangeRequest( - const std::string& iface_name, wifi_request_id id, - const std::vector& rtt_configs, - const on_rtt_results_callback& on_results_callback); - wifi_error cancelRttRangeRequest( - const std::string& iface_name, wifi_request_id id, - const std::vector>& mac_addrs); - std::pair getRttCapabilities( - const std::string& iface_name); - std::pair 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, + wifi_error startRttRangeRequest(const std::string& iface_name, wifi_request_id id, + const std::vector& rtt_configs, + const on_rtt_results_callback& on_results_callback); + wifi_error cancelRttRangeRequest(const std::string& iface_name, wifi_request_id id, + const std::vector>& mac_addrs); + std::pair getRttCapabilities(const std::string& iface_name); + std::pair 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, const wifi_rtt_responder& info); - wifi_error disableRttResponder(const std::string& iface_name, - wifi_request_id id); + wifi_error disableRttResponder(const std::string& iface_name, wifi_request_id id); wifi_error setRttLci(const std::string& iface_name, wifi_request_id id, const wifi_lci_information& info); wifi_error setRttLcr(const std::string& iface_name, wifi_request_id id, const wifi_lcr_information& info); // NAN functions. - virtual wifi_error nanRegisterCallbackHandlers( - const std::string& iface_name, const NanCallbackHandlers& callbacks); - wifi_error nanEnableRequest(const std::string& iface_name, - transaction_id id, const NanEnableRequest& msg); - virtual wifi_error nanDisableRequest(const std::string& iface_name, - transaction_id id); - wifi_error nanPublishRequest(const std::string& iface_name, - transaction_id id, + virtual wifi_error nanRegisterCallbackHandlers(const std::string& iface_name, + const NanCallbackHandlers& callbacks); + wifi_error nanEnableRequest(const std::string& iface_name, transaction_id id, + const NanEnableRequest& msg); + virtual wifi_error nanDisableRequest(const std::string& iface_name, transaction_id id); + wifi_error nanPublishRequest(const std::string& iface_name, transaction_id id, const NanPublishRequest& msg); - wifi_error nanPublishCancelRequest(const std::string& iface_name, - transaction_id id, + wifi_error nanPublishCancelRequest(const std::string& iface_name, transaction_id id, const NanPublishCancelRequest& msg); - wifi_error nanSubscribeRequest(const std::string& iface_name, - transaction_id id, + wifi_error nanSubscribeRequest(const std::string& iface_name, transaction_id id, const NanSubscribeRequest& msg); - wifi_error nanSubscribeCancelRequest(const std::string& iface_name, - transaction_id id, + wifi_error nanSubscribeCancelRequest(const std::string& iface_name, transaction_id id, const NanSubscribeCancelRequest& msg); - wifi_error nanTransmitFollowupRequest( - const std::string& iface_name, transaction_id id, - const NanTransmitFollowupRequest& msg); + wifi_error nanTransmitFollowupRequest(const std::string& iface_name, transaction_id id, + const NanTransmitFollowupRequest& msg); wifi_error nanStatsRequest(const std::string& iface_name, transaction_id id, const NanStatsRequest& msg); - wifi_error nanConfigRequest(const std::string& iface_name, - transaction_id id, const NanConfigRequest& msg); + wifi_error nanConfigRequest(const std::string& iface_name, transaction_id id, + const NanConfigRequest& msg); wifi_error nanTcaRequest(const std::string& iface_name, transaction_id id, const NanTCARequest& msg); - wifi_error nanBeaconSdfPayloadRequest( - const std::string& iface_name, transaction_id id, - const NanBeaconSdfPayloadRequest& msg); + wifi_error nanBeaconSdfPayloadRequest(const std::string& iface_name, transaction_id id, + const NanBeaconSdfPayloadRequest& msg); std::pair nanGetVersion(); - wifi_error nanGetCapabilities(const std::string& iface_name, - transaction_id id); - wifi_error nanDataInterfaceCreate(const std::string& iface_name, - transaction_id id, + wifi_error nanGetCapabilities(const std::string& iface_name, transaction_id id); + wifi_error nanDataInterfaceCreate(const std::string& iface_name, transaction_id id, const std::string& data_iface_name); - virtual wifi_error nanDataInterfaceDelete( - const std::string& iface_name, transaction_id id, - const std::string& data_iface_name); - wifi_error nanDataRequestInitiator(const std::string& iface_name, - transaction_id id, + virtual wifi_error nanDataInterfaceDelete(const std::string& iface_name, transaction_id id, + const std::string& data_iface_name); + wifi_error nanDataRequestInitiator(const std::string& iface_name, transaction_id id, const NanDataPathInitiatorRequest& msg); - wifi_error nanDataIndicationResponse( - const std::string& iface_name, transaction_id id, - const NanDataPathIndicationResponse& msg); - wifi_error nanDataEnd(const std::string& iface_name, transaction_id id, - uint32_t ndpInstanceId); + wifi_error nanDataIndicationResponse(const std::string& iface_name, transaction_id id, + const NanDataPathIndicationResponse& msg); + wifi_error nanDataEnd(const std::string& iface_name, transaction_id id, uint32_t ndpInstanceId); // AP functions. - wifi_error setCountryCode(const std::string& iface_name, - std::array code); + wifi_error setCountryCode(const std::string& iface_name, std::array code); // interface functions. virtual wifi_error createVirtualInterface(const std::string& ifname, @@ -682,43 +626,36 @@ class WifiLegacyHal { virtual wifi_error multiStaSetUseCase(wifi_multi_sta_use_case use_case); // Coex functions. - virtual wifi_error setCoexUnsafeChannels( - std::vector unsafe_channels, - uint32_t restrictions); + virtual wifi_error setCoexUnsafeChannels(std::vector unsafe_channels, + uint32_t restrictions); wifi_error setVoipMode(const std::string& iface_name, wifi_voip_mode mode); wifi_error twtRegisterHandler(const std::string& iface_name, const TwtCallbackHandlers& handler); - std::pair twtGetCapability( - const std::string& iface_name); + std::pair twtGetCapability(const std::string& iface_name); - wifi_error twtSetupRequest(const std::string& iface_name, - const TwtSetupRequest& msg); + wifi_error twtSetupRequest(const std::string& iface_name, const TwtSetupRequest& msg); - wifi_error twtTearDownRequest(const std::string& iface_name, - const TwtTeardownRequest& msg); + wifi_error twtTearDownRequest(const std::string& iface_name, const TwtTeardownRequest& msg); - wifi_error twtInfoFrameRequest(const std::string& iface_name, - const TwtInfoFrameRequest& msg); + wifi_error twtInfoFrameRequest(const std::string& iface_name, const TwtInfoFrameRequest& msg); - std::pair twtGetStats(const std::string& iface_name, - uint8_t configId); + std::pair twtGetStats(const std::string& iface_name, uint8_t configId); wifi_error twtClearStats(const std::string& iface_name, uint8_t configId); - wifi_error setDtimConfig(const std::string& iface_name, - uint32_t multiplier); + wifi_error setDtimConfig(const std::string& iface_name, uint32_t multiplier); // Retrieve the list of usable channels in the requested bands // for the requested modes std::pair> getUsableChannels( - uint32_t band_mask, uint32_t iface_mode_mask, uint32_t filter_mask); + uint32_t band_mask, uint32_t iface_mode_mask, uint32_t filter_mask); wifi_error triggerSubsystemRestart(); - private: + private: // Retrieve interface handles for all the available interfaces. wifi_error retrieveIfaceHandles(); wifi_interface_handle getIfaceHandle(const std::string& iface_name); @@ -726,12 +663,12 @@ class WifiLegacyHal { void runEventLoop(); // Retrieve the cached gscan results to pass the results back to the // external callbacks. - std::pair> - getGscanCachedResults(const std::string& iface_name); + std::pair> getGscanCachedResults( + const std::string& iface_name); void invalidate(); // Handles wifi (error) status of Virtual interface create/delete - wifi_error handleVirtualInterfaceCreateOrDeleteStatus( - const std::string& ifname, wifi_error status); + wifi_error handleVirtualInterfaceCreateOrDeleteStatus(const std::string& ifname, + wifi_error status); // Global function table of legacy HAL. wifi_hal_fn global_func_table_; @@ -755,7 +692,7 @@ class WifiLegacyHal { } // namespace legacy_hal } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_legacy_hal_factory.cpp b/wifi/1.6/default/wifi_legacy_hal_factory.cpp similarity index 87% rename from wifi/1.5/default/wifi_legacy_hal_factory.cpp rename to wifi/1.6/default/wifi_legacy_hal_factory.cpp index fbaa284f56..147bf4d7cc 100644 --- a/wifi/1.5/default/wifi_legacy_hal_factory.cpp +++ b/wifi/1.6/default/wifi_legacy_hal_factory.cpp @@ -62,22 +62,20 @@ bool isFileExtension(const char* name, const char* ext) { namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace legacy_hal { WifiLegacyHalFactory::WifiLegacyHalFactory( - const std::weak_ptr iface_tool) + const std::weak_ptr iface_tool) : iface_tool_(iface_tool) {} std::vector> WifiLegacyHalFactory::getHals() { if (legacy_hals_.empty()) { - if (!initVendorHalDescriptorFromLinked()) - initVendorHalsDescriptorList(); + if (!initVendorHalDescriptorFromLinked()) initVendorHalsDescriptorList(); for (auto& desc : descs_) { std::shared_ptr hal = - std::make_shared(iface_tool_, desc.fn, - desc.primary); + std::make_shared(iface_tool_, desc.fn, desc.primary); legacy_hals_.push_back(hal); } } @@ -99,8 +97,8 @@ bool WifiLegacyHalFactory::initVendorHalDescriptorFromLinked() { bool WifiLegacyHalFactory::initLinkedHalFunctionTable(wifi_hal_fn* hal_fn) { init_wifi_vendor_hal_func_table_t initfn; - initfn = (init_wifi_vendor_hal_func_table_t)dlsym( - RTLD_DEFAULT, "init_wifi_vendor_hal_func_table"); + initfn = (init_wifi_vendor_hal_func_table_t)dlsym(RTLD_DEFAULT, + "init_wifi_vendor_hal_func_table"); if (!initfn) { LOG(INFO) << "no vendor HAL library linked, will try dynamic load"; return false; @@ -136,8 +134,7 @@ void WifiLegacyHalFactory::initVendorHalsDescriptorList() { xmlChar* value; wifi_hal_lib_desc desc; - LOG(INFO) << "processing vendor HALs descriptions in " - << kVendorHalsDescPath; + LOG(INFO) << "processing vendor HALs descriptions in " << kVendorHalsDescPath; DIR* dirPtr = ::opendir(kVendorHalsDescPath); if (dirPtr == NULL) { LOG(ERROR) << "failed to open " << kVendorHalsDescPath; @@ -157,26 +154,23 @@ void WifiLegacyHalFactory::initVendorHalsDescriptorList() { fullPath.append(entryPtr->d_name); xml = xmlReadFile(fullPath.c_str(), "UTF-8", XML_PARSE_RECOVER); if (!xml) { - LOG(ERROR) << "failed to parse: " << entryPtr->d_name - << " skipping..."; + LOG(ERROR) << "failed to parse: " << entryPtr->d_name << " skipping..."; continue; } node = xmlDocGetRootElement(xml); if (!node) { - LOG(ERROR) << "empty config file: " << entryPtr->d_name - << " skipping..."; + LOG(ERROR) << "empty config file: " << entryPtr->d_name << " skipping..."; goto skip; } if (xmlStrcmp(node->name, BAD_CAST "WifiVendorHal")) { - LOG(ERROR) << "bad config, root element not WifiVendorHal: " - << entryPtr->d_name << " skipping..."; + LOG(ERROR) << "bad config, root element not WifiVendorHal: " << entryPtr->d_name + << " skipping..."; goto skip; } version = (char*)xmlGetProp(node, BAD_CAST "version"); if (!version || strtoul(version, NULL, 0) != kVendorHalsDescVersion) { LOG(ERROR) << "conf file: " << entryPtr->d_name - << "must have version: " << kVendorHalsDescVersion - << ", skipping..."; + << "must have version: " << kVendorHalsDescVersion << ", skipping..."; goto skip; } cnode = node->children; @@ -195,8 +189,8 @@ void WifiLegacyHalFactory::initVendorHalsDescriptorList() { cnode = cnode->next; } if (path.empty()) { - LOG(ERROR) << "hal library path not provided in: " - << entryPtr->d_name << ", skipping..."; + LOG(ERROR) << "hal library path not provided in: " << entryPtr->d_name + << ", skipping..."; goto skip; } if (loadVendorHalLib(path, desc)) { @@ -211,8 +205,7 @@ void WifiLegacyHalFactory::initVendorHalsDescriptorList() { ::closedir(dirPtr); } -bool WifiLegacyHalFactory::loadVendorHalLib(const std::string& path, - wifi_hal_lib_desc& desc) { +bool WifiLegacyHalFactory::loadVendorHalLib(const std::string& path, wifi_hal_lib_desc& desc) { void* h = dlopen(path.c_str(), RTLD_NOW | RTLD_LOCAL); init_wifi_vendor_hal_func_table_t initfn; wifi_error res; @@ -221,8 +214,7 @@ bool WifiLegacyHalFactory::loadVendorHalLib(const std::string& path, LOG(ERROR) << "failed to open vendor hal library: " << path; return false; } - initfn = (init_wifi_vendor_hal_func_table_t)dlsym( - h, "init_wifi_vendor_hal_func_table"); + initfn = (init_wifi_vendor_hal_func_table_t)dlsym(h, "init_wifi_vendor_hal_func_table"); if (!initfn) { LOG(ERROR) << "init_wifi_vendor_hal_func_table not found in: " << path; goto out_err; @@ -243,8 +235,7 @@ bool WifiLegacyHalFactory::loadVendorHalLib(const std::string& path, // vendor HALs which do not implement early_initialize will return // WIFI_ERROR_NOT_SUPPORTED, treat this as success. if (res != WIFI_SUCCESS && res != WIFI_ERROR_NOT_SUPPORTED) { - LOG(ERROR) << "early initialization failed in: " << path - << " error: " << res; + LOG(ERROR) << "early initialization failed in: " << path << " error: " << res; goto out_err; } @@ -257,7 +248,7 @@ out_err: } // namespace legacy_hal } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_legacy_hal_factory.h b/wifi/1.6/default/wifi_legacy_hal_factory.h similarity index 92% rename from wifi/1.5/default/wifi_legacy_hal_factory.h rename to wifi/1.6/default/wifi_legacy_hal_factory.h index e3440faff2..9f4423efb7 100644 --- a/wifi/1.5/default/wifi_legacy_hal_factory.h +++ b/wifi/1.6/default/wifi_legacy_hal_factory.h @@ -24,7 +24,7 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { // This is in a separate namespace to prevent typename conflicts between // the legacy HAL types and the HIDL interface types. @@ -33,14 +33,13 @@ namespace legacy_hal { * Class that creates WifiLegacyHal objects for vendor HALs in the system. */ class WifiLegacyHalFactory { - public: - WifiLegacyHalFactory( - const std::weak_ptr iface_tool); + public: + WifiLegacyHalFactory(const std::weak_ptr iface_tool); virtual ~WifiLegacyHalFactory() = default; std::vector> getHals(); - private: + private: typedef struct { wifi_hal_fn fn; bool primary; @@ -59,7 +58,7 @@ class WifiLegacyHalFactory { } // namespace legacy_hal } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_legacy_hal_stubs.cpp b/wifi/1.6/default/wifi_legacy_hal_stubs.cpp similarity index 99% rename from wifi/1.5/default/wifi_legacy_hal_stubs.cpp rename to wifi/1.6/default/wifi_legacy_hal_stubs.cpp index dd860d6920..e03e1ae1a1 100644 --- a/wifi/1.5/default/wifi_legacy_hal_stubs.cpp +++ b/wifi/1.6/default/wifi_legacy_hal_stubs.cpp @@ -20,7 +20,7 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace legacy_hal { template @@ -165,7 +165,7 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) { } } // namespace legacy_hal } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_legacy_hal_stubs.h b/wifi/1.6/default/wifi_legacy_hal_stubs.h similarity index 96% rename from wifi/1.5/default/wifi_legacy_hal_stubs.h rename to wifi/1.6/default/wifi_legacy_hal_stubs.h index 480389b0ce..c9a03bf4c9 100644 --- a/wifi/1.5/default/wifi_legacy_hal_stubs.h +++ b/wifi/1.6/default/wifi_legacy_hal_stubs.h @@ -22,14 +22,14 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace legacy_hal { bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn); } // namespace legacy_hal } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_mode_controller.cpp b/wifi/1.6/default/wifi_mode_controller.cpp similarity index 90% rename from wifi/1.5/default/wifi_mode_controller.cpp rename to wifi/1.6/default/wifi_mode_controller.cpp index b1db8b3725..4b8ac7dd1c 100644 --- a/wifi/1.5/default/wifi_mode_controller.cpp +++ b/wifi/1.6/default/wifi_mode_controller.cpp @@ -48,15 +48,14 @@ int convertIfaceTypeToFirmwareMode(IfaceType type) { namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace mode_controller { WifiModeController::WifiModeController() : driver_tool_(new DriverTool) {} bool WifiModeController::isFirmwareModeChangeNeeded(IfaceType type) { - return driver_tool_->IsFirmwareModeChangeNeeded( - convertIfaceTypeToFirmwareMode(type)); + return driver_tool_->IsFirmwareModeChangeNeeded(convertIfaceTypeToFirmwareMode(type)); } bool WifiModeController::initialize() { @@ -68,8 +67,7 @@ bool WifiModeController::initialize() { } bool WifiModeController::changeFirmwareMode(IfaceType type) { - if (!driver_tool_->ChangeFirmwareMode( - convertIfaceTypeToFirmwareMode(type))) { + if (!driver_tool_->ChangeFirmwareMode(convertIfaceTypeToFirmwareMode(type))) { LOG(ERROR) << "Failed to change firmware mode"; return false; } @@ -85,7 +83,7 @@ bool WifiModeController::deinitialize() { } } // namespace mode_controller } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_mode_controller.h b/wifi/1.6/default/wifi_mode_controller.h similarity index 96% rename from wifi/1.5/default/wifi_mode_controller.h rename to wifi/1.6/default/wifi_mode_controller.h index 2eeca78c8b..fee2b66d4e 100644 --- a/wifi/1.5/default/wifi_mode_controller.h +++ b/wifi/1.6/default/wifi_mode_controller.h @@ -24,7 +24,7 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { namespace mode_controller { using namespace android::hardware::wifi::V1_0; @@ -35,7 +35,7 @@ using namespace android::hardware::wifi::V1_0; * required state (essentially a wrapper over DriverTool). */ class WifiModeController { - public: + public: WifiModeController(); virtual ~WifiModeController() = default; @@ -49,13 +49,13 @@ class WifiModeController { // invoked. virtual bool deinitialize(); - private: + private: std::unique_ptr driver_tool_; }; } // namespace mode_controller } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.6/default/wifi_nan_iface.cpp b/wifi/1.6/default/wifi_nan_iface.cpp new file mode 100644 index 0000000000..236cb64e32 --- /dev/null +++ b/wifi/1.6/default/wifi_nan_iface.cpp @@ -0,0 +1,905 @@ +/* + * 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. + */ + +#include + +#include "hidl_return_util.h" +#include "hidl_struct_util.h" +#include "wifi_nan_iface.h" +#include "wifi_status_util.h" + +namespace android { +namespace hardware { +namespace wifi { +namespace V1_6 { +namespace implementation { +using hidl_return_util::validateAndCall; + +WifiNanIface::WifiNanIface(const std::string& ifname, bool is_dedicated_iface, + const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util) + : ifname_(ifname), + is_dedicated_iface_(is_dedicated_iface), + legacy_hal_(legacy_hal), + iface_util_(iface_util), + is_valid_(true) { + if (is_dedicated_iface_) { + // If using a dedicated iface, set the iface up first. + if (!iface_util_.lock()->setUpState(ifname_, true)) { + // Fatal failure, invalidate the iface object. + invalidate(); + return; + } + } + // Register all the callbacks here. these should be valid for the lifetime + // of the object. Whenever the mode changes legacy HAL will remove + // all of these callbacks. + legacy_hal::NanCallbackHandlers callback_handlers; + android::wp weak_ptr_this(this); + + // Callback for response. + callback_handlers.on_notify_response = [weak_ptr_this](legacy_hal::transaction_id id, + const legacy_hal::NanResponseMsg& msg) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + WifiNanStatus wifiNanStatus; + if (!hidl_struct_util::convertLegacyNanResponseHeaderToHidl(msg, &wifiNanStatus)) { + LOG(ERROR) << "Failed to convert nan response header"; + return; + } + + switch (msg.response_type) { + case legacy_hal::NAN_RESPONSE_ENABLED: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyEnableResponse(id, wifiNanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_DISABLED: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyDisableResponse(id, wifiNanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_PUBLISH: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyStartPublishResponse(id, wifiNanStatus, + msg.body.publish_response.publish_id) + .isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_PUBLISH_CANCEL: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyStopPublishResponse(id, wifiNanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_TRANSMIT_FOLLOWUP: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyTransmitFollowupResponse(id, wifiNanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_SUBSCRIBE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyStartSubscribeResponse( + id, wifiNanStatus, + msg.body.subscribe_response.subscribe_id) + .isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_SUBSCRIBE_CANCEL: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyStopSubscribeResponse(id, wifiNanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_CONFIG: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyConfigResponse(id, wifiNanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_GET_CAPABILITIES: { + V1_5::NanCapabilities hidl_struct; + if (!hidl_struct_util::convertLegacyNanCapabilitiesResponseToHidl( + msg.body.nan_capabilities, &hidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks_1_5()) { + if (!callback->notifyCapabilitiesResponse_1_5(id, wifiNanStatus, hidl_struct) + .isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_DP_INTERFACE_CREATE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyCreateDataInterfaceResponse(id, wifiNanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_DP_INTERFACE_DELETE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyDeleteDataInterfaceResponse(id, wifiNanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_DP_INITIATOR_RESPONSE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyInitiateDataPathResponse( + id, wifiNanStatus, + msg.body.data_request_response.ndp_instance_id) + .isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_DP_RESPONDER_RESPONSE: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyRespondToDataPathIndicationResponse(id, wifiNanStatus) + .isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_DP_END: { + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->notifyTerminateDataPathResponse(id, wifiNanStatus).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + break; + } + case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD: + /* fall through */ + case legacy_hal::NAN_RESPONSE_TCA: + /* fall through */ + case legacy_hal::NAN_RESPONSE_STATS: + /* fall through */ + case legacy_hal::NAN_RESPONSE_ERROR: + /* fall through */ + default: + LOG(ERROR) << "Unknown or unhandled response type: " << msg.response_type; + return; + } + }; + + callback_handlers.on_event_disc_eng_event = + [weak_ptr_this](const legacy_hal::NanDiscEngEventInd& msg) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + NanClusterEventInd hidl_struct; + // event types defined identically - hence can be cast + hidl_struct.eventType = (NanClusterEventType)msg.event_type; + hidl_struct.addr = msg.data.mac_addr.addr; + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventClusterEvent(hidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_disabled = [weak_ptr_this](const legacy_hal::NanDisabledInd& msg) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + WifiNanStatus status; + hidl_struct_util::convertToWifiNanStatus(msg.reason, msg.nan_reason, sizeof(msg.nan_reason), + &status); + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventDisabled(status).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_publish_terminated = + [weak_ptr_this](const legacy_hal::NanPublishTerminatedInd& msg) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + WifiNanStatus status; + hidl_struct_util::convertToWifiNanStatus(msg.reason, msg.nan_reason, + sizeof(msg.nan_reason), &status); + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventPublishTerminated(msg.publish_id, status).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_subscribe_terminated = + [weak_ptr_this](const legacy_hal::NanSubscribeTerminatedInd& msg) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + WifiNanStatus status; + hidl_struct_util::convertToWifiNanStatus(msg.reason, msg.nan_reason, + sizeof(msg.nan_reason), &status); + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventSubscribeTerminated(msg.subscribe_id, status).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_match = [weak_ptr_this](const legacy_hal::NanMatchInd& msg) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + NanMatchInd hidl_struct; + if (!hidl_struct_util::convertLegacyNanMatchIndToHidl(msg, &hidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventMatch(hidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_match_expired = [weak_ptr_this]( + const legacy_hal::NanMatchExpiredInd& msg) { + const auto shared_ptr_this = weak_ptr_this.promote(); + 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->eventMatchExpired(msg.publish_subscribe_id, msg.requestor_instance_id) + .isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_followup = [weak_ptr_this](const legacy_hal::NanFollowupInd& msg) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + NanFollowupReceivedInd hidl_struct; + if (!hidl_struct_util::convertLegacyNanFollowupIndToHidl(msg, &hidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventFollowupReceived(hidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_transmit_follow_up = + [weak_ptr_this](const legacy_hal::NanTransmitFollowupInd& msg) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + WifiNanStatus status; + hidl_struct_util::convertToWifiNanStatus(msg.reason, msg.nan_reason, + sizeof(msg.nan_reason), &status); + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventTransmitFollowup(msg.id, status).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_data_path_request = + [weak_ptr_this](const legacy_hal::NanDataPathRequestInd& msg) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + NanDataPathRequestInd hidl_struct; + if (!hidl_struct_util::convertLegacyNanDataPathRequestIndToHidl(msg, + &hidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventDataPathRequest(hidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_data_path_confirm = + [weak_ptr_this](const legacy_hal::NanDataPathConfirmInd& msg) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + V1_2::NanDataPathConfirmInd hidl_struct; + if (!hidl_struct_util::convertLegacyNanDataPathConfirmIndToHidl(msg, + &hidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + + for (const auto& callback : shared_ptr_this->getEventCallbacks_1_2()) { + if (!callback->eventDataPathConfirm_1_2(hidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + callback_handlers.on_event_data_path_end = + [weak_ptr_this](const legacy_hal::NanDataPathEndInd& msg) { + const auto shared_ptr_this = weak_ptr_this.promote(); + 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()) { + for (int i = 0; i < msg.num_ndp_instances; ++i) { + if (!callback->eventDataPathTerminated(msg.ndp_instance_id[i]).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + } + }; + + callback_handlers.on_event_beacon_sdf_payload = + [weak_ptr_this](const legacy_hal::NanBeaconSdfPayloadInd& /* msg */) { + LOG(ERROR) << "on_event_beacon_sdf_payload - should not be called"; + }; + + callback_handlers.on_event_range_request = + [weak_ptr_this](const legacy_hal::NanRangeRequestInd& /* msg */) { + LOG(ERROR) << "on_event_range_request - should not be called"; + }; + + callback_handlers.on_event_range_report = + [weak_ptr_this](const legacy_hal::NanRangeReportInd& /* msg */) { + LOG(ERROR) << "on_event_range_report - should not be called"; + }; + + callback_handlers.on_event_schedule_update = + [weak_ptr_this](const legacy_hal::NanDataPathScheduleUpdateInd& msg) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + V1_2::NanDataPathScheduleUpdateInd hidl_struct; + if (!hidl_struct_util::convertLegacyNanDataPathScheduleUpdateIndToHidl( + msg, &hidl_struct)) { + LOG(ERROR) << "Failed to convert nan capabilities response"; + return; + } + + for (const auto& callback : shared_ptr_this->getEventCallbacks_1_2()) { + if (!callback->eventDataPathScheduleUpdate(hidl_struct).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanRegisterCallbackHandlers(ifname_, callback_handlers); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + LOG(ERROR) << "Failed to register nan callbacks. Invalidating object"; + invalidate(); + } + + // Register for iface state toggle events. + iface_util::IfaceEventHandlers event_handlers = {}; + event_handlers.on_state_toggle_off_on = [weak_ptr_this](const std::string& /* iface_name */) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + // Tell framework that NAN has been disabled. + WifiNanStatus status = {NanStatusType::UNSUPPORTED_CONCURRENCY_NAN_DISABLED, ""}; + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->eventDisabled(status).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } + } + }; + iface_util_.lock()->registerIfaceEventHandlers(ifname_, event_handlers); +} + +void WifiNanIface::invalidate() { + if (!isValid()) { + return; + } + // send commands to HAL to actually disable and destroy interfaces + legacy_hal_.lock()->nanDisableRequest(ifname_, 0xFFFF); + legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, 0xFFFE, "aware_data0"); + legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, 0xFFFD, "aware_data1"); + iface_util_.lock()->unregisterIfaceEventHandlers(ifname_); + legacy_hal_.reset(); + event_cb_handler_.invalidate(); + event_cb_handler_1_2_.invalidate(); + event_cb_handler_1_5_.invalidate(); + is_valid_ = false; + if (is_dedicated_iface_) { + // If using a dedicated iface, set the iface down. + iface_util_.lock()->setUpState(ifname_, false); + } +} + +bool WifiNanIface::isValid() { + return is_valid_; +} + +std::string WifiNanIface::getName() { + return ifname_; +} + +std::set> WifiNanIface::getEventCallbacks() { + return event_cb_handler_.getCallbacks(); +} + +std::set> WifiNanIface::getEventCallbacks_1_2() { + return event_cb_handler_1_2_.getCallbacks(); +} + +std::set> WifiNanIface::getEventCallbacks_1_5() { + return event_cb_handler_1_5_.getCallbacks(); +} + +Return WifiNanIface::getName(getName_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::getNameInternal, hidl_status_cb); +} + +Return WifiNanIface::getType(getType_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::getTypeInternal, hidl_status_cb); +} + +Return WifiNanIface::registerEventCallback( + const sp& callback, + registerEventCallback_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::registerEventCallbackInternal, hidl_status_cb, callback); +} + +Return WifiNanIface::getCapabilitiesRequest(uint16_t cmd_id, + getCapabilitiesRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::getCapabilitiesRequestInternal, hidl_status_cb, cmd_id); +} + +Return WifiNanIface::enableRequest(uint16_t cmd_id, const V1_0::NanEnableRequest& msg, + enableRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::enableRequestInternal, hidl_status_cb, cmd_id, msg); +} + +Return WifiNanIface::configRequest(uint16_t cmd_id, const V1_0::NanConfigRequest& msg, + configRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::configRequestInternal, hidl_status_cb, cmd_id, msg); +} + +Return WifiNanIface::disableRequest(uint16_t cmd_id, disableRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::disableRequestInternal, hidl_status_cb, cmd_id); +} + +Return WifiNanIface::startPublishRequest(uint16_t cmd_id, const NanPublishRequest& msg, + startPublishRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::startPublishRequestInternal, hidl_status_cb, cmd_id, msg); +} + +Return WifiNanIface::stopPublishRequest(uint16_t cmd_id, uint8_t sessionId, + stopPublishRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::stopPublishRequestInternal, hidl_status_cb, cmd_id, + sessionId); +} + +Return WifiNanIface::startSubscribeRequest(uint16_t cmd_id, const NanSubscribeRequest& msg, + startSubscribeRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::startSubscribeRequestInternal, hidl_status_cb, cmd_id, + msg); +} + +Return WifiNanIface::stopSubscribeRequest(uint16_t cmd_id, uint8_t sessionId, + stopSubscribeRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::stopSubscribeRequestInternal, hidl_status_cb, cmd_id, + sessionId); +} + +Return WifiNanIface::transmitFollowupRequest(uint16_t cmd_id, + const NanTransmitFollowupRequest& msg, + transmitFollowupRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::transmitFollowupRequestInternal, hidl_status_cb, cmd_id, + msg); +} + +Return WifiNanIface::createDataInterfaceRequest( + uint16_t cmd_id, const hidl_string& iface_name, + createDataInterfaceRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::createDataInterfaceRequestInternal, hidl_status_cb, + cmd_id, iface_name); +} + +Return WifiNanIface::deleteDataInterfaceRequest( + uint16_t cmd_id, const hidl_string& iface_name, + deleteDataInterfaceRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::deleteDataInterfaceRequestInternal, hidl_status_cb, + cmd_id, iface_name); +} + +Return WifiNanIface::initiateDataPathRequest(uint16_t cmd_id, + const NanInitiateDataPathRequest& msg, + initiateDataPathRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::initiateDataPathRequestInternal, hidl_status_cb, cmd_id, + msg); +} + +Return WifiNanIface::respondToDataPathIndicationRequest( + uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg, + respondToDataPathIndicationRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::respondToDataPathIndicationRequestInternal, + hidl_status_cb, cmd_id, msg); +} + +Return WifiNanIface::terminateDataPathRequest(uint16_t cmd_id, uint32_t ndpInstanceId, + terminateDataPathRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::terminateDataPathRequestInternal, hidl_status_cb, cmd_id, + ndpInstanceId); +} + +Return WifiNanIface::registerEventCallback_1_2( + const sp& callback, + registerEventCallback_1_2_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::registerEventCallback_1_2Internal, hidl_status_cb, + callback); +} + +Return WifiNanIface::enableRequest_1_2(uint16_t cmd_id, const V1_0::NanEnableRequest& msg1, + const V1_2::NanConfigRequestSupplemental& msg2, + enableRequest_1_2_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::enableRequest_1_2Internal, hidl_status_cb, cmd_id, msg1, + msg2); +} + +Return WifiNanIface::configRequest_1_2(uint16_t cmd_id, const V1_0::NanConfigRequest& msg1, + const V1_2::NanConfigRequestSupplemental& msg2, + configRequest_1_2_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::configRequest_1_2Internal, hidl_status_cb, cmd_id, msg1, + msg2); +} + +Return WifiNanIface::enableRequest_1_4(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, + const V1_2::NanConfigRequestSupplemental& msg2, + enableRequest_1_4_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::enableRequest_1_4Internal, hidl_status_cb, cmd_id, msg1, + msg2); +} + +Return WifiNanIface::configRequest_1_4(uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, + const V1_2::NanConfigRequestSupplemental& msg2, + configRequest_1_4_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::configRequest_1_4Internal, hidl_status_cb, cmd_id, msg1, + msg2); +} + +Return WifiNanIface::registerEventCallback_1_5( + const sp& callback, + registerEventCallback_1_5_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::registerEventCallback_1_5Internal, hidl_status_cb, + callback); +} + +Return WifiNanIface::enableRequest_1_5(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, + const V1_5::NanConfigRequestSupplemental& msg2, + enableRequest_1_5_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::enableRequest_1_5Internal, hidl_status_cb, cmd_id, msg1, + msg2); +} + +Return WifiNanIface::configRequest_1_5(uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, + const V1_5::NanConfigRequestSupplemental& msg2, + configRequest_1_5_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::configRequest_1_5Internal, hidl_status_cb, cmd_id, msg1, + msg2); +} + +Return WifiNanIface::getCapabilitiesRequest_1_5( + uint16_t cmd_id, getCapabilitiesRequest_1_5_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::getCapabilitiesRequest_1_5Internal, hidl_status_cb, + cmd_id); +} + +std::pair WifiNanIface::getNameInternal() { + return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_}; +} + +std::pair WifiNanIface::getTypeInternal() { + return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::NAN}; +} + +WifiStatus WifiNanIface::registerEventCallbackInternal( + const sp& callback) { + if (!event_cb_handler_.addCallback(callback)) { + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); + } + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiNanIface::getCapabilitiesRequestInternal(uint16_t /* cmd_id */) { + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); +} + +WifiStatus WifiNanIface::enableRequestInternal(uint16_t /* cmd_id */, + const V1_0::NanEnableRequest& /* msg */) { + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); +} + +WifiStatus WifiNanIface::configRequestInternal(uint16_t /* cmd_id */, + const V1_0::NanConfigRequest& /* msg */) { + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); +} + +WifiStatus WifiNanIface::disableRequestInternal(uint16_t cmd_id) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->nanDisableRequest(ifname_, cmd_id); + return createWifiStatusFromLegacyError(legacy_status); +} + +WifiStatus WifiNanIface::startPublishRequestInternal(uint16_t cmd_id, + const NanPublishRequest& msg) { + legacy_hal::NanPublishRequest legacy_msg; + if (!hidl_struct_util::convertHidlNanPublishRequestToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanPublishRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +WifiStatus WifiNanIface::stopPublishRequestInternal(uint16_t cmd_id, uint8_t sessionId) { + legacy_hal::NanPublishCancelRequest legacy_msg; + legacy_msg.publish_id = sessionId; + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanPublishCancelRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +WifiStatus WifiNanIface::startSubscribeRequestInternal(uint16_t cmd_id, + const NanSubscribeRequest& msg) { + legacy_hal::NanSubscribeRequest legacy_msg; + if (!hidl_struct_util::convertHidlNanSubscribeRequestToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanSubscribeRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +WifiStatus WifiNanIface::stopSubscribeRequestInternal(uint16_t cmd_id, uint8_t sessionId) { + legacy_hal::NanSubscribeCancelRequest legacy_msg; + legacy_msg.subscribe_id = sessionId; + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanSubscribeCancelRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +WifiStatus WifiNanIface::transmitFollowupRequestInternal(uint16_t cmd_id, + const NanTransmitFollowupRequest& msg) { + legacy_hal::NanTransmitFollowupRequest legacy_msg; + if (!hidl_struct_util::convertHidlNanTransmitFollowupRequestToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanTransmitFollowupRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +WifiStatus WifiNanIface::createDataInterfaceRequestInternal(uint16_t cmd_id, + const std::string& iface_name) { + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanDataInterfaceCreate(ifname_, cmd_id, iface_name); + return createWifiStatusFromLegacyError(legacy_status); +} +WifiStatus WifiNanIface::deleteDataInterfaceRequestInternal(uint16_t cmd_id, + const std::string& iface_name) { + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, cmd_id, iface_name); + return createWifiStatusFromLegacyError(legacy_status); +} +WifiStatus WifiNanIface::initiateDataPathRequestInternal(uint16_t cmd_id, + const NanInitiateDataPathRequest& msg) { + legacy_hal::NanDataPathInitiatorRequest legacy_msg; + if (!hidl_struct_util::convertHidlNanDataPathInitiatorRequestToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanDataRequestInitiator(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} +WifiStatus WifiNanIface::respondToDataPathIndicationRequestInternal( + uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg) { + legacy_hal::NanDataPathIndicationResponse legacy_msg; + if (!hidl_struct_util::convertHidlNanDataPathIndicationResponseToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanDataIndicationResponse(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} +WifiStatus WifiNanIface::terminateDataPathRequestInternal(uint16_t cmd_id, uint32_t ndpInstanceId) { + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanDataEnd(ifname_, cmd_id, ndpInstanceId); + return createWifiStatusFromLegacyError(legacy_status); +} + +WifiStatus WifiNanIface::registerEventCallback_1_2Internal( + const sp& callback) { + sp callback_1_0 = callback; + if (!event_cb_handler_.addCallback(callback_1_0)) { + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); + } + if (!event_cb_handler_1_2_.addCallback(callback)) { + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); + } + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiNanIface::enableRequest_1_2Internal( + uint16_t /* cmd_id */, const V1_0::NanEnableRequest& /* msg1 */, + const V1_2::NanConfigRequestSupplemental& /* msg2 */) { + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); +} + +WifiStatus WifiNanIface::configRequest_1_2Internal( + uint16_t /* cmd_id */, const V1_0::NanConfigRequest& /* msg1 */, + const V1_2::NanConfigRequestSupplemental& /* msg2 */) { + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); +} + +WifiStatus WifiNanIface::enableRequest_1_4Internal( + uint16_t /* cmd_id */, const V1_4::NanEnableRequest& /* msg1 */, + const V1_2::NanConfigRequestSupplemental& /* msg2 */) { + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); +} + +WifiStatus WifiNanIface::configRequest_1_4Internal( + uint16_t /* cmd_id */, const V1_4::NanConfigRequest& /* msg1 */, + const V1_2::NanConfigRequestSupplemental& /* msg2 */) { + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); +} + +WifiStatus WifiNanIface::registerEventCallback_1_5Internal( + const sp& callback) { + sp callback_1_0 = callback; + if (!event_cb_handler_.addCallback(callback_1_0)) { + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); + } + sp callback_1_2 = callback; + if (!event_cb_handler_1_2_.addCallback(callback_1_2)) { + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); + } + if (!event_cb_handler_1_5_.addCallback(callback)) { + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); + } + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiNanIface::getCapabilitiesRequest_1_5Internal(uint16_t cmd_id) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->nanGetCapabilities(ifname_, cmd_id); + return createWifiStatusFromLegacyError(legacy_status); +} + +WifiStatus WifiNanIface::enableRequest_1_5Internal(uint16_t cmd_id, + const V1_4::NanEnableRequest& msg1, + const V1_5::NanConfigRequestSupplemental& msg2) { + legacy_hal::NanEnableRequest legacy_msg; + if (!hidl_struct_util::convertHidlNanEnableRequest_1_5ToLegacy(msg1, msg2, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanEnableRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +WifiStatus WifiNanIface::configRequest_1_5Internal(uint16_t cmd_id, + const V1_4::NanConfigRequest& msg1, + const V1_5::NanConfigRequestSupplemental& msg2) { + legacy_hal::NanConfigRequest legacy_msg; + if (!hidl_struct_util::convertHidlNanConfigRequest_1_5ToLegacy(msg1, msg2, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanConfigRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +} // namespace implementation +} // namespace V1_6 +} // namespace wifi +} // namespace hardware +} // namespace android diff --git a/wifi/1.6/default/wifi_nan_iface.h b/wifi/1.6/default/wifi_nan_iface.h new file mode 100644 index 0000000000..c445afc541 --- /dev/null +++ b/wifi/1.6/default/wifi_nan_iface.h @@ -0,0 +1,174 @@ +/* + * 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_NAN_IFACE_H_ +#define WIFI_NAN_IFACE_H_ + +#include +#include +#include + +#include "hidl_callback_util.h" +#include "wifi_iface_util.h" +#include "wifi_legacy_hal.h" + +namespace android { +namespace hardware { +namespace wifi { +namespace V1_6 { +namespace implementation { +using namespace android::hardware::wifi::V1_0; +using namespace android::hardware::wifi::V1_2; + +/** + * HIDL interface object used to control a NAN Iface instance. + */ +class WifiNanIface : public V1_5::IWifiNanIface { + public: + WifiNanIface(const std::string& ifname, bool is_dedicated_iface, + const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util); + // Refer to |WifiChip::invalidate()|. + void invalidate(); + bool isValid(); + std::string getName(); + + // HIDL methods exposed. + Return getName(getName_cb hidl_status_cb) override; + Return getType(getType_cb hidl_status_cb) override; + Return registerEventCallback(const sp& callback, + registerEventCallback_cb hidl_status_cb) override; + Return getCapabilitiesRequest(uint16_t cmd_id, + getCapabilitiesRequest_cb hidl_status_cb) override; + Return enableRequest(uint16_t cmd_id, const V1_0::NanEnableRequest& msg, + enableRequest_cb hidl_status_cb) override; + Return configRequest(uint16_t cmd_id, const V1_0::NanConfigRequest& msg, + configRequest_cb hidl_status_cb) override; + Return disableRequest(uint16_t cmd_id, disableRequest_cb hidl_status_cb) override; + Return startPublishRequest(uint16_t cmd_id, const NanPublishRequest& msg, + startPublishRequest_cb hidl_status_cb) override; + Return stopPublishRequest(uint16_t cmd_id, uint8_t sessionId, + stopPublishRequest_cb hidl_status_cb) override; + Return startSubscribeRequest(uint16_t cmd_id, const NanSubscribeRequest& msg, + startSubscribeRequest_cb hidl_status_cb) override; + Return stopSubscribeRequest(uint16_t cmd_id, uint8_t sessionId, + stopSubscribeRequest_cb hidl_status_cb) override; + Return transmitFollowupRequest(uint16_t cmd_id, const NanTransmitFollowupRequest& msg, + transmitFollowupRequest_cb hidl_status_cb) override; + Return createDataInterfaceRequest(uint16_t cmd_id, const hidl_string& iface_name, + createDataInterfaceRequest_cb hidl_status_cb) override; + Return deleteDataInterfaceRequest(uint16_t cmd_id, const hidl_string& iface_name, + deleteDataInterfaceRequest_cb hidl_status_cb) override; + Return initiateDataPathRequest(uint16_t cmd_id, const NanInitiateDataPathRequest& msg, + initiateDataPathRequest_cb hidl_status_cb) override; + Return respondToDataPathIndicationRequest( + uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg, + respondToDataPathIndicationRequest_cb hidl_status_cb) override; + Return terminateDataPathRequest(uint16_t cmd_id, uint32_t ndpInstanceId, + terminateDataPathRequest_cb hidl_status_cb) override; + + Return registerEventCallback_1_2(const sp& callback, + registerEventCallback_1_2_cb hidl_status_cb) override; + Return enableRequest_1_2(uint16_t cmd_id, const V1_0::NanEnableRequest& msg1, + const V1_2::NanConfigRequestSupplemental& msg2, + enableRequest_1_2_cb hidl_status_cb) override; + Return configRequest_1_2(uint16_t cmd_id, const V1_0::NanConfigRequest& msg1, + const V1_2::NanConfigRequestSupplemental& msg2, + configRequest_1_2_cb hidl_status_cb) override; + Return enableRequest_1_4(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, + const V1_2::NanConfigRequestSupplemental& msg2, + enableRequest_1_4_cb hidl_status_cb) override; + Return configRequest_1_4(uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, + const V1_2::NanConfigRequestSupplemental& msg2, + configRequest_1_4_cb hidl_status_cb) override; + Return registerEventCallback_1_5(const sp& callback, + registerEventCallback_1_5_cb hidl_status_cb) override; + Return enableRequest_1_5(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, + const V1_5::NanConfigRequestSupplemental& msg2, + enableRequest_1_4_cb hidl_status_cb) override; + Return configRequest_1_5(uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, + const V1_5::NanConfigRequestSupplemental& msg2, + configRequest_1_4_cb hidl_status_cb) override; + Return getCapabilitiesRequest_1_5(uint16_t cmd_id, + getCapabilitiesRequest_cb hidl_status_cb) override; + + private: + // Corresponding worker functions for the HIDL methods. + std::pair getNameInternal(); + std::pair getTypeInternal(); + WifiStatus registerEventCallbackInternal(const sp& callback); + WifiStatus getCapabilitiesRequestInternal(uint16_t cmd_id); + WifiStatus enableRequestInternal(uint16_t cmd_id, const V1_0::NanEnableRequest& msg); + WifiStatus configRequestInternal(uint16_t cmd_id, const V1_0::NanConfigRequest& msg); + WifiStatus disableRequestInternal(uint16_t cmd_id); + WifiStatus startPublishRequestInternal(uint16_t cmd_id, const NanPublishRequest& msg); + WifiStatus stopPublishRequestInternal(uint16_t cmd_id, uint8_t sessionId); + WifiStatus startSubscribeRequestInternal(uint16_t cmd_id, const NanSubscribeRequest& msg); + WifiStatus stopSubscribeRequestInternal(uint16_t cmd_id, uint8_t sessionId); + WifiStatus transmitFollowupRequestInternal(uint16_t cmd_id, + const NanTransmitFollowupRequest& msg); + WifiStatus createDataInterfaceRequestInternal(uint16_t cmd_id, const std::string& iface_name); + WifiStatus deleteDataInterfaceRequestInternal(uint16_t cmd_id, const std::string& iface_name); + WifiStatus initiateDataPathRequestInternal(uint16_t cmd_id, + const NanInitiateDataPathRequest& msg); + WifiStatus respondToDataPathIndicationRequestInternal( + uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg); + WifiStatus terminateDataPathRequestInternal(uint16_t cmd_id, uint32_t ndpInstanceId); + + WifiStatus registerEventCallback_1_2Internal( + const sp& callback); + WifiStatus enableRequest_1_2Internal(uint16_t cmd_id, const V1_0::NanEnableRequest& msg1, + const V1_2::NanConfigRequestSupplemental& msg2); + WifiStatus configRequest_1_2Internal(uint16_t cmd_id, const V1_0::NanConfigRequest& msg, + const V1_2::NanConfigRequestSupplemental& msg2); + WifiStatus enableRequest_1_4Internal(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, + const V1_2::NanConfigRequestSupplemental& msg2); + WifiStatus configRequest_1_4Internal(uint16_t cmd_id, const V1_4::NanConfigRequest& msg, + const V1_2::NanConfigRequestSupplemental& msg2); + WifiStatus registerEventCallback_1_5Internal( + const sp& callback); + WifiStatus enableRequest_1_5Internal(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, + const V1_5::NanConfigRequestSupplemental& msg2); + WifiStatus configRequest_1_5Internal(uint16_t cmd_id, const V1_4::NanConfigRequest& msg, + const V1_5::NanConfigRequestSupplemental& msg2); + WifiStatus getCapabilitiesRequest_1_5Internal(uint16_t cmd_id); + + // all 1_0 and descendant callbacks + std::set> getEventCallbacks(); + // all 1_2 and descendant callbacks + std::set> getEventCallbacks_1_2(); + // all 1_5 and descendant callbacks + std::set> getEventCallbacks_1_5(); + + std::string ifname_; + bool is_dedicated_iface_; + std::weak_ptr legacy_hal_; + std::weak_ptr iface_util_; + bool is_valid_; + hidl_callback_util::HidlCallbackHandler event_cb_handler_; + hidl_callback_util::HidlCallbackHandler event_cb_handler_1_2_; + hidl_callback_util::HidlCallbackHandler event_cb_handler_1_5_; + + DISALLOW_COPY_AND_ASSIGN(WifiNanIface); +}; + +} // namespace implementation +} // namespace V1_6 +} // namespace wifi +} // namespace hardware +} // namespace android + +#endif // WIFI_NAN_IFACE_H_ diff --git a/wifi/1.5/default/wifi_p2p_iface.cpp b/wifi/1.6/default/wifi_p2p_iface.cpp similarity index 86% rename from wifi/1.5/default/wifi_p2p_iface.cpp rename to wifi/1.6/default/wifi_p2p_iface.cpp index b8893da153..d4b1fcabf1 100644 --- a/wifi/1.5/default/wifi_p2p_iface.cpp +++ b/wifi/1.6/default/wifi_p2p_iface.cpp @@ -23,13 +23,12 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { using hidl_return_util::validateAndCall; -WifiP2pIface::WifiP2pIface( - const std::string& ifname, - const std::weak_ptr legacy_hal) +WifiP2pIface::WifiP2pIface(const std::string& ifname, + const std::weak_ptr legacy_hal) : ifname_(ifname), legacy_hal_(legacy_hal), is_valid_(true) {} void WifiP2pIface::invalidate() { @@ -37,9 +36,13 @@ void WifiP2pIface::invalidate() { is_valid_ = false; } -bool WifiP2pIface::isValid() { return is_valid_; } +bool WifiP2pIface::isValid() { + return is_valid_; +} -std::string WifiP2pIface::getName() { return ifname_; } +std::string WifiP2pIface::getName() { + return ifname_; +} Return WifiP2pIface::getName(getName_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, @@ -60,7 +63,7 @@ std::pair WifiP2pIface::getTypeInternal() { } } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_p2p_iface.h b/wifi/1.6/default/wifi_p2p_iface.h similarity index 96% rename from wifi/1.5/default/wifi_p2p_iface.h rename to wifi/1.6/default/wifi_p2p_iface.h index c1adc50278..00894437cf 100644 --- a/wifi/1.5/default/wifi_p2p_iface.h +++ b/wifi/1.6/default/wifi_p2p_iface.h @@ -25,7 +25,7 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { using namespace android::hardware::wifi::V1_0; @@ -33,7 +33,7 @@ using namespace android::hardware::wifi::V1_0; * HIDL interface object used to control a P2P Iface instance. */ class WifiP2pIface : public V1_0::IWifiP2pIface { - public: + public: WifiP2pIface(const std::string& ifname, const std::weak_ptr legacy_hal); // Refer to |WifiChip::invalidate()|. @@ -45,7 +45,7 @@ class WifiP2pIface : public V1_0::IWifiP2pIface { Return getName(getName_cb hidl_status_cb) override; Return getType(getType_cb hidl_status_cb) override; - private: + private: // Corresponding worker functions for the HIDL methods. std::pair getNameInternal(); std::pair getTypeInternal(); @@ -58,7 +58,7 @@ class WifiP2pIface : public V1_0::IWifiP2pIface { }; } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.6/default/wifi_rtt_controller.cpp b/wifi/1.6/default/wifi_rtt_controller.cpp new file mode 100644 index 0000000000..f5e1d5aafc --- /dev/null +++ b/wifi/1.6/default/wifi_rtt_controller.cpp @@ -0,0 +1,311 @@ +/* + * 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. + */ + +#include + +#include "hidl_return_util.h" +#include "hidl_struct_util.h" +#include "wifi_rtt_controller.h" +#include "wifi_status_util.h" + +namespace android { +namespace hardware { +namespace wifi { +namespace V1_6 { +namespace implementation { +using hidl_return_util::validateAndCall; + +WifiRttController::WifiRttController(const std::string& iface_name, + const sp& bound_iface, + const std::weak_ptr legacy_hal) + : ifname_(iface_name), bound_iface_(bound_iface), legacy_hal_(legacy_hal), is_valid_(true) {} + +void WifiRttController::invalidate() { + legacy_hal_.reset(); + event_callbacks_.clear(); + is_valid_ = false; +} + +bool WifiRttController::isValid() { + return is_valid_; +} + +std::vector> WifiRttController::getEventCallbacks() { + return event_callbacks_; +} + +std::string WifiRttController::getIfaceName() { + return ifname_; +} + +Return WifiRttController::getBoundIface(getBoundIface_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::getBoundIfaceInternal, hidl_status_cb); +} + +Return WifiRttController::registerEventCallback( + const sp& callback, + registerEventCallback_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::registerEventCallbackInternal, hidl_status_cb, + callback); +} + +Return WifiRttController::rangeRequest(uint32_t cmd_id, + const hidl_vec& rtt_configs, + rangeRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::rangeRequestInternal, hidl_status_cb, cmd_id, + rtt_configs); +} + +Return WifiRttController::rangeCancel(uint32_t cmd_id, + const hidl_vec>& addrs, + rangeCancel_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::rangeCancelInternal, hidl_status_cb, cmd_id, addrs); +} + +Return WifiRttController::getCapabilities(getCapabilities_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::getCapabilitiesInternal, hidl_status_cb); +} + +Return WifiRttController::setLci(uint32_t cmd_id, const RttLciInformation& lci, + setLci_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::setLciInternal, hidl_status_cb, cmd_id, lci); +} + +Return WifiRttController::setLcr(uint32_t cmd_id, const RttLcrInformation& lcr, + setLcr_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::setLcrInternal, hidl_status_cb, cmd_id, lcr); +} + +Return WifiRttController::getResponderInfo(getResponderInfo_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::getResponderInfoInternal, hidl_status_cb); +} + +Return WifiRttController::enableResponder(uint32_t cmd_id, + const WifiChannelInfo& channel_hint, + uint32_t max_duration_seconds, + const V1_0::RttResponder& info, + enableResponder_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::enableResponderInternal, hidl_status_cb, cmd_id, + channel_hint, max_duration_seconds, info); +} + +Return WifiRttController::disableResponder(uint32_t cmd_id, + disableResponder_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::disableResponderInternal, hidl_status_cb, cmd_id); +} + +Return WifiRttController::registerEventCallback_1_4( + const sp& callback, + registerEventCallback_1_4_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::registerEventCallbackInternal_1_4, hidl_status_cb, + callback); +} + +Return WifiRttController::rangeRequest_1_4(uint32_t cmd_id, + const hidl_vec& rtt_configs, + rangeRequest_1_4_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::rangeRequestInternal_1_4, hidl_status_cb, cmd_id, + rtt_configs); +} + +Return WifiRttController::getCapabilities_1_4(getCapabilities_1_4_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::getCapabilitiesInternal_1_4, hidl_status_cb); +} + +Return WifiRttController::getResponderInfo_1_4(getResponderInfo_1_4_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::getResponderInfoInternal_1_4, hidl_status_cb); +} + +Return WifiRttController::enableResponder_1_4(uint32_t cmd_id, + const WifiChannelInfo& channel_hint, + uint32_t max_duration_seconds, + const V1_4::RttResponder& info, + enableResponder_1_4_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::enableResponderInternal_1_4, hidl_status_cb, cmd_id, + channel_hint, max_duration_seconds, info); +} + +std::pair> WifiRttController::getBoundIfaceInternal() { + return {createWifiStatus(WifiStatusCode::SUCCESS), bound_iface_}; +} + +WifiStatus WifiRttController::registerEventCallbackInternal( + const sp& /* callback */) { + // Deprecated support for this api + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); +} + +WifiStatus WifiRttController::rangeRequestInternal( + uint32_t /* cmd_id */, const std::vector& /* rtt_configs */) { + // Deprecated support for this api + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); +} + +WifiStatus WifiRttController::rangeCancelInternal( + uint32_t cmd_id, const std::vector>& addrs) { + std::vector> legacy_addrs; + for (const auto& addr : addrs) { + legacy_addrs.push_back(addr); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->cancelRttRangeRequest(ifname_, cmd_id, legacy_addrs); + return createWifiStatusFromLegacyError(legacy_status); +} + +std::pair WifiRttController::getCapabilitiesInternal() { + // Deprecated support for this api + return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; +} + +WifiStatus WifiRttController::setLciInternal(uint32_t cmd_id, const RttLciInformation& lci) { + legacy_hal::wifi_lci_information legacy_lci; + if (!hidl_struct_util::convertHidlRttLciInformationToLegacy(lci, &legacy_lci)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->setRttLci(ifname_, cmd_id, legacy_lci); + return createWifiStatusFromLegacyError(legacy_status); +} + +WifiStatus WifiRttController::setLcrInternal(uint32_t cmd_id, const RttLcrInformation& lcr) { + legacy_hal::wifi_lcr_information legacy_lcr; + if (!hidl_struct_util::convertHidlRttLcrInformationToLegacy(lcr, &legacy_lcr)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->setRttLcr(ifname_, cmd_id, legacy_lcr); + return createWifiStatusFromLegacyError(legacy_status); +} + +std::pair WifiRttController::getResponderInfoInternal() { + // Deprecated support for this api + return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; +} + +WifiStatus WifiRttController::enableResponderInternal(uint32_t /* cmd_id */, + const WifiChannelInfo& /* channel_hint */, + uint32_t /* max_duration_seconds */, + const V1_0::RttResponder& /* info */) { + // Deprecated support for this api + return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED)}; +} + +WifiStatus WifiRttController::disableResponderInternal(uint32_t cmd_id) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->disableRttResponder(ifname_, cmd_id); + return createWifiStatusFromLegacyError(legacy_status); +} + +WifiStatus WifiRttController::registerEventCallbackInternal_1_4( + const sp& callback) { + // TODO(b/31632518): remove the callback when the client is destroyed + event_callbacks_.emplace_back(callback); + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiRttController::rangeRequestInternal_1_4( + uint32_t cmd_id, const std::vector& rtt_configs) { + std::vector legacy_configs; + if (!hidl_struct_util::convertHidlVectorOfRttConfigToLegacy(rtt_configs, &legacy_configs)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + android::wp weak_ptr_this(this); + const auto& on_results_callback = + [weak_ptr_this](legacy_hal::wifi_request_id id, + const std::vector& results) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + std::vector hidl_results; + if (!hidl_struct_util::convertLegacyVectorOfRttResultToHidl(results, + &hidl_results)) { + LOG(ERROR) << "Failed to convert rtt results to HIDL structs"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + callback->onResults_1_4(id, hidl_results); + } + }; + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRttRangeRequest( + ifname_, cmd_id, legacy_configs, on_results_callback); + return createWifiStatusFromLegacyError(legacy_status); +} + +std::pair WifiRttController::getCapabilitiesInternal_1_4() { + legacy_hal::wifi_error legacy_status; + 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 {createWifiStatusFromLegacyError(legacy_status), {}}; + } + V1_4::RttCapabilities hidl_caps; + if (!hidl_struct_util::convertLegacyRttCapabilitiesToHidl(legacy_caps, &hidl_caps)) { + return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; + } + return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps}; +} + +std::pair WifiRttController::getResponderInfoInternal_1_4() { + legacy_hal::wifi_error legacy_status; + legacy_hal::wifi_rtt_responder legacy_responder; + std::tie(legacy_status, legacy_responder) = legacy_hal_.lock()->getRttResponderInfo(ifname_); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + return {createWifiStatusFromLegacyError(legacy_status), {}}; + } + V1_4::RttResponder hidl_responder; + if (!hidl_struct_util::convertLegacyRttResponderToHidl(legacy_responder, &hidl_responder)) { + return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; + } + return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_responder}; +} + +WifiStatus WifiRttController::enableResponderInternal_1_4(uint32_t cmd_id, + const WifiChannelInfo& channel_hint, + uint32_t max_duration_seconds, + const V1_4::RttResponder& info) { + legacy_hal::wifi_channel_info legacy_channel_info; + if (!hidl_struct_util::convertHidlWifiChannelInfoToLegacy(channel_hint, &legacy_channel_info)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_rtt_responder legacy_responder; + if (!hidl_struct_util::convertHidlRttResponderToLegacy(info, &legacy_responder)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->enableRttResponder( + ifname_, cmd_id, legacy_channel_info, max_duration_seconds, legacy_responder); + return createWifiStatusFromLegacyError(legacy_status); +} +} // namespace implementation +} // namespace V1_6 +} // namespace wifi +} // namespace hardware +} // namespace android diff --git a/wifi/1.5/default/wifi_rtt_controller.h b/wifi/1.6/default/wifi_rtt_controller.h similarity index 59% rename from wifi/1.5/default/wifi_rtt_controller.h rename to wifi/1.6/default/wifi_rtt_controller.h index 9ac3e06fcc..b4a2116f2b 100644 --- a/wifi/1.5/default/wifi_rtt_controller.h +++ b/wifi/1.6/default/wifi_rtt_controller.h @@ -27,17 +27,16 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { /** * HIDL interface object used to control all RTT operations. */ class WifiRttController : public V1_4::IWifiRttController { - public: - WifiRttController( - const std::string& iface_name, const sp& bound_iface, - const std::weak_ptr legacy_hal); + public: + WifiRttController(const std::string& iface_name, const sp& bound_iface, + const std::weak_ptr legacy_hal); // Refer to |WifiChip::invalidate()|. void invalidate(); bool isValid(); @@ -46,14 +45,11 @@ class WifiRttController : public V1_4::IWifiRttController { // HIDL methods exposed. Return getBoundIface(getBoundIface_cb hidl_status_cb) override; - Return registerEventCallback( - const sp& callback, - registerEventCallback_cb hidl_status_cb) override; - Return rangeRequest(uint32_t cmd_id, - const hidl_vec& rtt_configs, + Return registerEventCallback(const sp& callback, + registerEventCallback_cb hidl_status_cb) override; + Return rangeRequest(uint32_t cmd_id, const hidl_vec& rtt_configs, rangeRequest_cb hidl_status_cb) override; - Return rangeCancel(uint32_t cmd_id, - const hidl_vec>& addrs, + Return rangeCancel(uint32_t cmd_id, const hidl_vec>& addrs, rangeCancel_cb hidl_status_cb) override; Return getCapabilities(getCapabilities_cb hidl_status_cb) override; Return setLci(uint32_t cmd_id, const RttLciInformation& lci, @@ -61,54 +57,45 @@ class WifiRttController : public V1_4::IWifiRttController { Return setLcr(uint32_t cmd_id, const RttLcrInformation& lcr, setLcr_cb hidl_status_cb) override; Return getResponderInfo(getResponderInfo_cb hidl_status_cb) override; - Return enableResponder(uint32_t cmd_id, - const WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, - const V1_0::RttResponder& info, + Return enableResponder(uint32_t cmd_id, const WifiChannelInfo& channel_hint, + uint32_t max_duration_seconds, const V1_0::RttResponder& info, enableResponder_cb hidl_status_cb) override; - Return disableResponder(uint32_t cmd_id, - disableResponder_cb hidl_status_cb) override; + Return disableResponder(uint32_t cmd_id, disableResponder_cb hidl_status_cb) override; Return registerEventCallback_1_4( - const sp& callback, - registerEventCallback_1_4_cb hidl_status_cb) override; - Return rangeRequest_1_4(uint32_t cmd_id, - const hidl_vec& rtt_configs, + const sp& callback, + registerEventCallback_1_4_cb hidl_status_cb) override; + Return rangeRequest_1_4(uint32_t cmd_id, const hidl_vec& rtt_configs, rangeRequest_1_4_cb hidl_status_cb) override; - Return getCapabilities_1_4( - getCapabilities_1_4_cb hidl_status_cb) override; - Return getResponderInfo_1_4( - getResponderInfo_1_4_cb hidl_status_cb) override; - Return enableResponder_1_4( - uint32_t cmd_id, const WifiChannelInfo& channel_hint, - uint32_t max_duration_seconds, const V1_4::RttResponder& info, - enableResponder_1_4_cb hidl_status_cb) override; + Return getCapabilities_1_4(getCapabilities_1_4_cb hidl_status_cb) override; + Return getResponderInfo_1_4(getResponderInfo_1_4_cb hidl_status_cb) override; + Return enableResponder_1_4(uint32_t cmd_id, const WifiChannelInfo& channel_hint, + uint32_t max_duration_seconds, const V1_4::RttResponder& info, + enableResponder_1_4_cb hidl_status_cb) override; - private: + private: // Corresponding worker functions for the HIDL methods. std::pair> getBoundIfaceInternal(); WifiStatus registerEventCallbackInternal( - const sp& callback); - WifiStatus rangeRequestInternal( - uint32_t cmd_id, const std::vector& rtt_configs); - WifiStatus rangeCancelInternal( - uint32_t cmd_id, const std::vector>& addrs); + const sp& callback); + WifiStatus rangeRequestInternal(uint32_t cmd_id, + const std::vector& rtt_configs); + WifiStatus rangeCancelInternal(uint32_t cmd_id, + const std::vector>& addrs); std::pair getCapabilitiesInternal(); WifiStatus setLciInternal(uint32_t cmd_id, const RttLciInformation& lci); WifiStatus setLcrInternal(uint32_t cmd_id, const RttLcrInformation& lcr); std::pair getResponderInfoInternal(); - WifiStatus enableResponderInternal(uint32_t cmd_id, - const WifiChannelInfo& channel_hint, + WifiStatus enableResponderInternal(uint32_t cmd_id, const WifiChannelInfo& channel_hint, uint32_t max_duration_seconds, const V1_0::RttResponder& info); WifiStatus disableResponderInternal(uint32_t cmd_id); WifiStatus registerEventCallbackInternal_1_4( - const sp& callback); - WifiStatus rangeRequestInternal_1_4( - uint32_t cmd_id, const std::vector& rtt_configs); + const sp& callback); + WifiStatus rangeRequestInternal_1_4(uint32_t cmd_id, + const std::vector& rtt_configs); std::pair getCapabilitiesInternal_1_4(); std::pair getResponderInfoInternal_1_4(); - WifiStatus enableResponderInternal_1_4(uint32_t cmd_id, - const WifiChannelInfo& channel_hint, + WifiStatus enableResponderInternal_1_4(uint32_t cmd_id, const WifiChannelInfo& channel_hint, uint32_t max_duration_seconds, const V1_4::RttResponder& info); @@ -122,7 +109,7 @@ class WifiRttController : public V1_4::IWifiRttController { }; } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_sta_iface.cpp b/wifi/1.6/default/wifi_sta_iface.cpp similarity index 54% rename from wifi/1.5/default/wifi_sta_iface.cpp rename to wifi/1.6/default/wifi_sta_iface.cpp index 92c9fe4392..f852d36689 100644 --- a/wifi/1.5/default/wifi_sta_iface.cpp +++ b/wifi/1.6/default/wifi_sta_iface.cpp @@ -24,24 +24,18 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { using hidl_return_util::validateAndCall; -WifiStaIface::WifiStaIface( - const std::string& ifname, - const std::weak_ptr legacy_hal, - const std::weak_ptr iface_util) - : ifname_(ifname), - legacy_hal_(legacy_hal), - iface_util_(iface_util), - is_valid_(true) { +WifiStaIface::WifiStaIface(const std::string& ifname, + const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util) + : ifname_(ifname), legacy_hal_(legacy_hal), iface_util_(iface_util), is_valid_(true) { // Turn on DFS channel usage for STA iface. - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->setDfsFlag(ifname_, true); + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->setDfsFlag(ifname_, true); if (legacy_status != legacy_hal::WIFI_SUCCESS) { - LOG(ERROR) - << "Failed to set DFS flag; DFS channels may be unavailable."; + LOG(ERROR) << "Failed to set DFS flag; DFS channels may be unavailable."; } } @@ -51,9 +45,13 @@ void WifiStaIface::invalidate() { is_valid_ = false; } -bool WifiStaIface::isValid() { return is_valid_; } +bool WifiStaIface::isValid() { + return is_valid_; +} -std::string WifiStaIface::getName() { return ifname_; } +std::string WifiStaIface::getName() { + return ifname_; +} std::set> WifiStaIface::getEventCallbacks() { return event_cb_handler_.getCallbacks(); @@ -69,215 +67,177 @@ Return WifiStaIface::getType(getType_cb hidl_status_cb) { &WifiStaIface::getTypeInternal, hidl_status_cb); } -Return WifiStaIface::registerEventCallback( - const sp& callback, - registerEventCallback_cb hidl_status_cb) { +Return WifiStaIface::registerEventCallback(const sp& callback, + registerEventCallback_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::registerEventCallbackInternal, - hidl_status_cb, callback); + &WifiStaIface::registerEventCallbackInternal, hidl_status_cb, callback); } Return WifiStaIface::getCapabilities(getCapabilities_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getCapabilitiesInternal, - hidl_status_cb); + &WifiStaIface::getCapabilitiesInternal, hidl_status_cb); } Return WifiStaIface::getApfPacketFilterCapabilities( - getApfPacketFilterCapabilities_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getApfPacketFilterCapabilitiesInternal, hidl_status_cb); + getApfPacketFilterCapabilities_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getApfPacketFilterCapabilitiesInternal, hidl_status_cb); } -Return WifiStaIface::installApfPacketFilter( - uint32_t cmd_id, const hidl_vec& program, - installApfPacketFilter_cb hidl_status_cb) { +Return WifiStaIface::installApfPacketFilter(uint32_t cmd_id, const hidl_vec& program, + installApfPacketFilter_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::installApfPacketFilterInternal, - hidl_status_cb, cmd_id, program); + &WifiStaIface::installApfPacketFilterInternal, hidl_status_cb, cmd_id, + program); } -Return WifiStaIface::readApfPacketFilterData( - readApfPacketFilterData_cb hidl_status_cb) { +Return WifiStaIface::readApfPacketFilterData(readApfPacketFilterData_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::readApfPacketFilterDataInternal, - hidl_status_cb); + &WifiStaIface::readApfPacketFilterDataInternal, hidl_status_cb); } Return WifiStaIface::getBackgroundScanCapabilities( - getBackgroundScanCapabilities_cb hidl_status_cb) { + getBackgroundScanCapabilities_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getBackgroundScanCapabilitiesInternal, - hidl_status_cb); + &WifiStaIface::getBackgroundScanCapabilitiesInternal, hidl_status_cb); } Return WifiStaIface::getValidFrequenciesForBand( - V1_0::WifiBand band, getValidFrequenciesForBand_cb hidl_status_cb) { + V1_0::WifiBand band, getValidFrequenciesForBand_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getValidFrequenciesForBandInternal, - hidl_status_cb, band); + &WifiStaIface::getValidFrequenciesForBandInternal, hidl_status_cb, band); } -Return WifiStaIface::startBackgroundScan( - uint32_t cmd_id, const StaBackgroundScanParameters& params, - startBackgroundScan_cb hidl_status_cb) { +Return WifiStaIface::startBackgroundScan(uint32_t cmd_id, + const StaBackgroundScanParameters& params, + startBackgroundScan_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::startBackgroundScanInternal, - hidl_status_cb, cmd_id, params); + &WifiStaIface::startBackgroundScanInternal, hidl_status_cb, cmd_id, + params); } -Return WifiStaIface::stopBackgroundScan( - uint32_t cmd_id, stopBackgroundScan_cb hidl_status_cb) { +Return WifiStaIface::stopBackgroundScan(uint32_t cmd_id, + stopBackgroundScan_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::stopBackgroundScanInternal, - hidl_status_cb, cmd_id); + &WifiStaIface::stopBackgroundScanInternal, hidl_status_cb, cmd_id); } Return WifiStaIface::enableLinkLayerStatsCollection( - bool debug, enableLinkLayerStatsCollection_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::enableLinkLayerStatsCollectionInternal, hidl_status_cb, - debug); + bool debug, enableLinkLayerStatsCollection_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::enableLinkLayerStatsCollectionInternal, hidl_status_cb, + debug); } Return WifiStaIface::disableLinkLayerStatsCollection( - disableLinkLayerStatsCollection_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::disableLinkLayerStatsCollectionInternal, hidl_status_cb); + disableLinkLayerStatsCollection_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::disableLinkLayerStatsCollectionInternal, hidl_status_cb); } -Return WifiStaIface::getLinkLayerStats( - getLinkLayerStats_cb hidl_status_cb) { +Return WifiStaIface::getLinkLayerStats(getLinkLayerStats_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getLinkLayerStatsInternal, - hidl_status_cb); + &WifiStaIface::getLinkLayerStatsInternal, hidl_status_cb); } -Return WifiStaIface::getLinkLayerStats_1_3( - getLinkLayerStats_1_3_cb hidl_status_cb) { +Return WifiStaIface::getLinkLayerStats_1_3(getLinkLayerStats_1_3_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getLinkLayerStatsInternal_1_3, - hidl_status_cb); + &WifiStaIface::getLinkLayerStatsInternal_1_3, hidl_status_cb); } -Return WifiStaIface::getLinkLayerStats_1_5( - getLinkLayerStats_1_5_cb hidl_status_cb) { +Return WifiStaIface::getLinkLayerStats_1_5(getLinkLayerStats_1_5_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getLinkLayerStatsInternal_1_5, - hidl_status_cb); + &WifiStaIface::getLinkLayerStatsInternal_1_5, hidl_status_cb); } -Return WifiStaIface::startRssiMonitoring( - uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi, - startRssiMonitoring_cb hidl_status_cb) { +Return WifiStaIface::startRssiMonitoring(uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi, + startRssiMonitoring_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::startRssiMonitoringInternal, - hidl_status_cb, cmd_id, max_rssi, min_rssi); + &WifiStaIface::startRssiMonitoringInternal, hidl_status_cb, cmd_id, + max_rssi, min_rssi); } -Return WifiStaIface::stopRssiMonitoring( - uint32_t cmd_id, stopRssiMonitoring_cb hidl_status_cb) { +Return WifiStaIface::stopRssiMonitoring(uint32_t cmd_id, + stopRssiMonitoring_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::stopRssiMonitoringInternal, - hidl_status_cb, cmd_id); + &WifiStaIface::stopRssiMonitoringInternal, hidl_status_cb, cmd_id); } -Return WifiStaIface::getRoamingCapabilities( - getRoamingCapabilities_cb hidl_status_cb) { +Return WifiStaIface::getRoamingCapabilities(getRoamingCapabilities_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getRoamingCapabilitiesInternal, - hidl_status_cb); + &WifiStaIface::getRoamingCapabilitiesInternal, hidl_status_cb); } -Return WifiStaIface::configureRoaming( - const StaRoamingConfig& config, configureRoaming_cb hidl_status_cb) { +Return WifiStaIface::configureRoaming(const StaRoamingConfig& config, + configureRoaming_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::configureRoamingInternal, - hidl_status_cb, config); + &WifiStaIface::configureRoamingInternal, hidl_status_cb, config); } Return WifiStaIface::setRoamingState(StaRoamingState state, setRoamingState_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::setRoamingStateInternal, - hidl_status_cb, state); + &WifiStaIface::setRoamingStateInternal, hidl_status_cb, state); } -Return WifiStaIface::enableNdOffload(bool enable, - enableNdOffload_cb hidl_status_cb) { +Return WifiStaIface::enableNdOffload(bool enable, enableNdOffload_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::enableNdOffloadInternal, - hidl_status_cb, enable); + &WifiStaIface::enableNdOffloadInternal, hidl_status_cb, enable); } Return WifiStaIface::startSendingKeepAlivePackets( - uint32_t cmd_id, const hidl_vec& ip_packet_data, - uint16_t ether_type, const hidl_array& src_address, - const hidl_array& dst_address, uint32_t period_in_ms, - startSendingKeepAlivePackets_cb hidl_status_cb) { + uint32_t cmd_id, const hidl_vec& ip_packet_data, uint16_t ether_type, + const hidl_array& src_address, const hidl_array& dst_address, + uint32_t period_in_ms, startSendingKeepAlivePackets_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::startSendingKeepAlivePacketsInternal, - hidl_status_cb, cmd_id, ip_packet_data, ether_type, - src_address, dst_address, period_in_ms); + &WifiStaIface::startSendingKeepAlivePacketsInternal, hidl_status_cb, + cmd_id, ip_packet_data, ether_type, src_address, dst_address, + period_in_ms); } Return WifiStaIface::stopSendingKeepAlivePackets( - uint32_t cmd_id, stopSendingKeepAlivePackets_cb hidl_status_cb) { + uint32_t cmd_id, stopSendingKeepAlivePackets_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::stopSendingKeepAlivePacketsInternal, - hidl_status_cb, cmd_id); + &WifiStaIface::stopSendingKeepAlivePacketsInternal, hidl_status_cb, + cmd_id); } -Return WifiStaIface::setScanningMacOui( - const hidl_array& oui, setScanningMacOui_cb hidl_status_cb) { +Return WifiStaIface::setScanningMacOui(const hidl_array& oui, + setScanningMacOui_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::setScanningMacOuiInternal, - hidl_status_cb, oui); + &WifiStaIface::setScanningMacOuiInternal, hidl_status_cb, oui); } Return WifiStaIface::startDebugPacketFateMonitoring( - startDebugPacketFateMonitoring_cb hidl_status_cb) { - return validateAndCall( - this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::startDebugPacketFateMonitoringInternal, hidl_status_cb); + startDebugPacketFateMonitoring_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::startDebugPacketFateMonitoringInternal, hidl_status_cb); } -Return WifiStaIface::getDebugTxPacketFates( - getDebugTxPacketFates_cb hidl_status_cb) { +Return WifiStaIface::getDebugTxPacketFates(getDebugTxPacketFates_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getDebugTxPacketFatesInternal, - hidl_status_cb); + &WifiStaIface::getDebugTxPacketFatesInternal, hidl_status_cb); } -Return WifiStaIface::getDebugRxPacketFates( - getDebugRxPacketFates_cb hidl_status_cb) { +Return WifiStaIface::getDebugRxPacketFates(getDebugRxPacketFates_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getDebugRxPacketFatesInternal, - hidl_status_cb); + &WifiStaIface::getDebugRxPacketFatesInternal, hidl_status_cb); } Return WifiStaIface::setMacAddress(const hidl_array& mac, setMacAddress_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::setMacAddressInternal, hidl_status_cb, - mac); + &WifiStaIface::setMacAddressInternal, hidl_status_cb, mac); } -Return WifiStaIface::getFactoryMacAddress( - getFactoryMacAddress_cb hidl_status_cb) { +Return WifiStaIface::getFactoryMacAddress(getFactoryMacAddress_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::getFactoryMacAddressInternal, - hidl_status_cb); + &WifiStaIface::getFactoryMacAddressInternal, hidl_status_cb); } -Return WifiStaIface::setScanMode(bool enable, - setScanMode_cb hidl_status_cb) { +Return WifiStaIface::setScanMode(bool enable, setScanMode_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, - &WifiStaIface::setScanModeInternal, hidl_status_cb, - enable); + &WifiStaIface::setScanModeInternal, hidl_status_cb, enable); } std::pair WifiStaIface::getNameInternal() { @@ -289,7 +249,7 @@ std::pair WifiStaIface::getTypeInternal() { } WifiStatus WifiStaIface::registerEventCallbackInternal( - const sp& callback) { + const sp& callback) { if (!event_cb_handler_.addCallback(callback)) { return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); } @@ -300,20 +260,20 @@ std::pair WifiStaIface::getCapabilitiesInternal() { legacy_hal::wifi_error legacy_status; uint64_t legacy_feature_set; std::tie(legacy_status, legacy_feature_set) = - legacy_hal_.lock()->getSupportedFeatureSet(ifname_); + legacy_hal_.lock()->getSupportedFeatureSet(ifname_); if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {createWifiStatusFromLegacyError(legacy_status), 0}; } uint32_t legacy_logger_feature_set; std::tie(legacy_status, legacy_logger_feature_set) = - legacy_hal_.lock()->getLoggerSupportedFeatureSet(ifname_); + legacy_hal_.lock()->getLoggerSupportedFeatureSet(ifname_); if (legacy_status != legacy_hal::WIFI_SUCCESS) { // some devices don't support querying logger feature set legacy_logger_feature_set = 0; } uint32_t hidl_caps; if (!hidl_struct_util::convertLegacyFeaturesToHidlStaCapabilities( - legacy_feature_set, legacy_logger_feature_set, &hidl_caps)) { + legacy_feature_set, legacy_logger_feature_set, &hidl_caps)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), 0}; } return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps}; @@ -323,30 +283,25 @@ std::pair WifiStaIface::getApfPacketFilterCapabilitiesInternal() { legacy_hal::wifi_error legacy_status; legacy_hal::PacketFilterCapabilities legacy_caps; - std::tie(legacy_status, legacy_caps) = - legacy_hal_.lock()->getPacketFilterCapabilities(ifname_); + std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getPacketFilterCapabilities(ifname_); if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {createWifiStatusFromLegacyError(legacy_status), {}}; } StaApfPacketFilterCapabilities hidl_caps; - if (!hidl_struct_util::convertLegacyApfCapabilitiesToHidl(legacy_caps, - &hidl_caps)) { + if (!hidl_struct_util::convertLegacyApfCapabilitiesToHidl(legacy_caps, &hidl_caps)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; } return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps}; } -WifiStatus WifiStaIface::installApfPacketFilterInternal( - uint32_t /* cmd_id */, const std::vector& program) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->setPacketFilter(ifname_, program); +WifiStatus WifiStaIface::installApfPacketFilterInternal(uint32_t /* cmd_id */, + const std::vector& program) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->setPacketFilter(ifname_, program); return createWifiStatusFromLegacyError(legacy_status); } -std::pair> -WifiStaIface::readApfPacketFilterDataInternal() { - const std::pair> - legacy_status_and_data = +std::pair> WifiStaIface::readApfPacketFilterDataInternal() { + const std::pair> legacy_status_and_data = legacy_hal_.lock()->readApfPacketFilterData(ifname_); return {createWifiStatusFromLegacyError(legacy_status_and_data.first), std::move(legacy_status_and_data.second)}; @@ -356,14 +311,12 @@ std::pair WifiStaIface::getBackgroundScanCapabilitiesInternal() { legacy_hal::wifi_error legacy_status; legacy_hal::wifi_gscan_capabilities legacy_caps; - std::tie(legacy_status, legacy_caps) = - legacy_hal_.lock()->getGscanCapabilities(ifname_); + std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getGscanCapabilities(ifname_); if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {createWifiStatusFromLegacyError(legacy_status), {}}; } StaBackgroundScanCapabilities hidl_caps; - if (!hidl_struct_util::convertLegacyGscanCapabilitiesToHidl(legacy_caps, - &hidl_caps)) { + if (!hidl_struct_util::convertLegacyGscanCapabilitiesToHidl(legacy_caps, &hidl_caps)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; } return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps}; @@ -371,240 +324,201 @@ WifiStaIface::getBackgroundScanCapabilitiesInternal() { std::pair> WifiStaIface::getValidFrequenciesForBandInternal(V1_0::WifiBand band) { - static_assert(sizeof(WifiChannelInMhz) == sizeof(uint32_t), - "Size mismatch"); + static_assert(sizeof(WifiChannelInMhz) == sizeof(uint32_t), "Size mismatch"); legacy_hal::wifi_error legacy_status; std::vector valid_frequencies; - std::tie(legacy_status, valid_frequencies) = - legacy_hal_.lock()->getValidFrequenciesForBand( + std::tie(legacy_status, valid_frequencies) = legacy_hal_.lock()->getValidFrequenciesForBand( ifname_, hidl_struct_util::convertHidlWifiBandToLegacy(band)); return {createWifiStatusFromLegacyError(legacy_status), valid_frequencies}; } -WifiStatus WifiStaIface::startBackgroundScanInternal( - uint32_t cmd_id, const StaBackgroundScanParameters& params) { +WifiStatus WifiStaIface::startBackgroundScanInternal(uint32_t cmd_id, + const StaBackgroundScanParameters& params) { legacy_hal::wifi_scan_cmd_params legacy_params; - if (!hidl_struct_util::convertHidlGscanParamsToLegacy(params, - &legacy_params)) { + if (!hidl_struct_util::convertHidlGscanParamsToLegacy(params, &legacy_params)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); } android::wp weak_ptr_this(this); - const auto& on_failure_callback = - [weak_ptr_this](legacy_hal::wifi_request_id id) { - const auto shared_ptr_this = weak_ptr_this.promote(); - 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->onBackgroundScanFailure(id).isOk()) { - LOG(ERROR) - << "Failed to invoke onBackgroundScanFailure callback"; - } + const auto& on_failure_callback = [weak_ptr_this](legacy_hal::wifi_request_id id) { + const auto shared_ptr_this = weak_ptr_this.promote(); + 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->onBackgroundScanFailure(id).isOk()) { + LOG(ERROR) << "Failed to invoke onBackgroundScanFailure callback"; } - }; + } + }; const auto& on_results_callback = - [weak_ptr_this]( - legacy_hal::wifi_request_id id, - const std::vector& results) { - const auto shared_ptr_this = weak_ptr_this.promote(); - if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { - LOG(ERROR) << "Callback invoked on an invalid object"; - return; - } - std::vector hidl_scan_datas; - if (!hidl_struct_util:: - convertLegacyVectorOfCachedGscanResultsToHidl( - results, &hidl_scan_datas)) { - LOG(ERROR) << "Failed to convert scan results to HIDL structs"; - return; - } - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->onBackgroundScanResults(id, hidl_scan_datas) - .isOk()) { - LOG(ERROR) - << "Failed to invoke onBackgroundScanResults callback"; + [weak_ptr_this](legacy_hal::wifi_request_id id, + const std::vector& results) { + const auto shared_ptr_this = weak_ptr_this.promote(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; } - } - }; + std::vector hidl_scan_datas; + if (!hidl_struct_util::convertLegacyVectorOfCachedGscanResultsToHidl( + results, &hidl_scan_datas)) { + LOG(ERROR) << "Failed to convert scan results to HIDL structs"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onBackgroundScanResults(id, hidl_scan_datas).isOk()) { + LOG(ERROR) << "Failed to invoke onBackgroundScanResults callback"; + } + } + }; const auto& on_full_result_callback = [weak_ptr_this]( - legacy_hal::wifi_request_id id, - const legacy_hal:: - wifi_scan_result* result, - uint32_t buckets_scanned) { + legacy_hal::wifi_request_id id, + const legacy_hal::wifi_scan_result* result, + uint32_t buckets_scanned) { const auto shared_ptr_this = weak_ptr_this.promote(); if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { LOG(ERROR) << "Callback invoked on an invalid object"; return; } StaScanResult hidl_scan_result; - if (!hidl_struct_util::convertLegacyGscanResultToHidl( - *result, true, &hidl_scan_result)) { + if (!hidl_struct_util::convertLegacyGscanResultToHidl(*result, true, &hidl_scan_result)) { LOG(ERROR) << "Failed to convert full scan results to HIDL structs"; return; } for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback - ->onBackgroundFullScanResult(id, buckets_scanned, - hidl_scan_result) - .isOk()) { - LOG(ERROR) - << "Failed to invoke onBackgroundFullScanResult callback"; + if (!callback->onBackgroundFullScanResult(id, buckets_scanned, hidl_scan_result) + .isOk()) { + LOG(ERROR) << "Failed to invoke onBackgroundFullScanResult callback"; } } }; - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startGscan( - ifname_, cmd_id, legacy_params, on_failure_callback, - on_results_callback, on_full_result_callback); + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->startGscan(ifname_, cmd_id, legacy_params, on_failure_callback, + on_results_callback, on_full_result_callback); return createWifiStatusFromLegacyError(legacy_status); } WifiStatus WifiStaIface::stopBackgroundScanInternal(uint32_t cmd_id) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->stopGscan(ifname_, cmd_id); + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->stopGscan(ifname_, cmd_id); return createWifiStatusFromLegacyError(legacy_status); } WifiStatus WifiStaIface::enableLinkLayerStatsCollectionInternal(bool debug) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->enableLinkLayerStats(ifname_, debug); + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->enableLinkLayerStats(ifname_, debug); return createWifiStatusFromLegacyError(legacy_status); } WifiStatus WifiStaIface::disableLinkLayerStatsCollectionInternal() { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->disableLinkLayerStats(ifname_); + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->disableLinkLayerStats(ifname_); return createWifiStatusFromLegacyError(legacy_status); } -std::pair -WifiStaIface::getLinkLayerStatsInternal() { +std::pair WifiStaIface::getLinkLayerStatsInternal() { return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; } -std::pair -WifiStaIface::getLinkLayerStatsInternal_1_3() { +std::pair WifiStaIface::getLinkLayerStatsInternal_1_3() { return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; } -std::pair -WifiStaIface::getLinkLayerStatsInternal_1_5() { +std::pair WifiStaIface::getLinkLayerStatsInternal_1_5() { legacy_hal::wifi_error legacy_status; legacy_hal::LinkLayerStats legacy_stats; - std::tie(legacy_status, legacy_stats) = - legacy_hal_.lock()->getLinkLayerStats(ifname_); + std::tie(legacy_status, legacy_stats) = legacy_hal_.lock()->getLinkLayerStats(ifname_); if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {createWifiStatusFromLegacyError(legacy_status), {}}; } V1_5::StaLinkLayerStats hidl_stats; - if (!hidl_struct_util::convertLegacyLinkLayerStatsToHidl(legacy_stats, - &hidl_stats)) { + if (!hidl_struct_util::convertLegacyLinkLayerStatsToHidl(legacy_stats, &hidl_stats)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; } return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_stats}; } -WifiStatus WifiStaIface::startRssiMonitoringInternal(uint32_t cmd_id, - int32_t max_rssi, +WifiStatus WifiStaIface::startRssiMonitoringInternal(uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi) { android::wp weak_ptr_this(this); - const auto& on_threshold_breached_callback = - [weak_ptr_this](legacy_hal::wifi_request_id id, - std::array bssid, int8_t rssi) { - const auto shared_ptr_this = weak_ptr_this.promote(); - 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->onRssiThresholdBreached(id, bssid, rssi) - .isOk()) { - LOG(ERROR) - << "Failed to invoke onRssiThresholdBreached callback"; - } + const auto& on_threshold_breached_callback = [weak_ptr_this](legacy_hal::wifi_request_id id, + std::array bssid, + int8_t rssi) { + const auto shared_ptr_this = weak_ptr_this.promote(); + 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->onRssiThresholdBreached(id, bssid, rssi).isOk()) { + LOG(ERROR) << "Failed to invoke onRssiThresholdBreached callback"; } - }; - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->startRssiMonitoring(ifname_, cmd_id, max_rssi, - min_rssi, - on_threshold_breached_callback); + } + }; + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRssiMonitoring( + ifname_, cmd_id, max_rssi, min_rssi, on_threshold_breached_callback); return createWifiStatusFromLegacyError(legacy_status); } WifiStatus WifiStaIface::stopRssiMonitoringInternal(uint32_t cmd_id) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->stopRssiMonitoring(ifname_, cmd_id); + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->stopRssiMonitoring(ifname_, cmd_id); return createWifiStatusFromLegacyError(legacy_status); } -std::pair -WifiStaIface::getRoamingCapabilitiesInternal() { +std::pair WifiStaIface::getRoamingCapabilitiesInternal() { legacy_hal::wifi_error legacy_status; legacy_hal::wifi_roaming_capabilities legacy_caps; - std::tie(legacy_status, legacy_caps) = - legacy_hal_.lock()->getRoamingCapabilities(ifname_); + std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getRoamingCapabilities(ifname_); if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {createWifiStatusFromLegacyError(legacy_status), {}}; } StaRoamingCapabilities hidl_caps; - if (!hidl_struct_util::convertLegacyRoamingCapabilitiesToHidl(legacy_caps, - &hidl_caps)) { + if (!hidl_struct_util::convertLegacyRoamingCapabilitiesToHidl(legacy_caps, &hidl_caps)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; } return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps}; } -WifiStatus WifiStaIface::configureRoamingInternal( - const StaRoamingConfig& config) { +WifiStatus WifiStaIface::configureRoamingInternal(const StaRoamingConfig& config) { legacy_hal::wifi_roaming_config legacy_config; - if (!hidl_struct_util::convertHidlRoamingConfigToLegacy(config, - &legacy_config)) { + if (!hidl_struct_util::convertHidlRoamingConfigToLegacy(config, &legacy_config)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); } legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->configureRoaming(ifname_, legacy_config); + legacy_hal_.lock()->configureRoaming(ifname_, legacy_config); return createWifiStatusFromLegacyError(legacy_status); } WifiStatus WifiStaIface::setRoamingStateInternal(StaRoamingState state) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->enableFirmwareRoaming( + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->enableFirmwareRoaming( ifname_, hidl_struct_util::convertHidlRoamingStateToLegacy(state)); return createWifiStatusFromLegacyError(legacy_status); } WifiStatus WifiStaIface::enableNdOffloadInternal(bool enable) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->configureNdOffload(ifname_, enable); + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->configureNdOffload(ifname_, enable); return createWifiStatusFromLegacyError(legacy_status); } WifiStatus WifiStaIface::startSendingKeepAlivePacketsInternal( - uint32_t cmd_id, const std::vector& ip_packet_data, - uint16_t ether_type, const std::array& src_address, - const std::array& dst_address, uint32_t period_in_ms) { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->startSendingOffloadedPacket( - ifname_, cmd_id, ether_type, ip_packet_data, src_address, - dst_address, period_in_ms); + uint32_t cmd_id, const std::vector& ip_packet_data, uint16_t ether_type, + const std::array& src_address, const std::array& dst_address, + uint32_t period_in_ms) { + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startSendingOffloadedPacket( + ifname_, cmd_id, ether_type, ip_packet_data, src_address, dst_address, period_in_ms); return createWifiStatusFromLegacyError(legacy_status); } WifiStatus WifiStaIface::stopSendingKeepAlivePacketsInternal(uint32_t cmd_id) { legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->stopSendingOffloadedPacket(ifname_, cmd_id); + legacy_hal_.lock()->stopSendingOffloadedPacket(ifname_, cmd_id); return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiStaIface::setScanningMacOuiInternal( - const std::array& /* oui */) { +WifiStatus WifiStaIface::setScanningMacOuiInternal(const std::array& /* oui */) { // deprecated. return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); } WifiStatus WifiStaIface::startDebugPacketFateMonitoringInternal() { - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->startPktFateMonitoring(ifname_); + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startPktFateMonitoring(ifname_); return createWifiStatusFromLegacyError(legacy_status); } @@ -612,14 +526,13 @@ std::pair> WifiStaIface::getDebugTxPacketFatesInternal() { legacy_hal::wifi_error legacy_status; std::vector legacy_fates; - std::tie(legacy_status, legacy_fates) = - legacy_hal_.lock()->getTxPktFates(ifname_); + std::tie(legacy_status, legacy_fates) = legacy_hal_.lock()->getTxPktFates(ifname_); if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {createWifiStatusFromLegacyError(legacy_status), {}}; } std::vector hidl_fates; - if (!hidl_struct_util::convertLegacyVectorOfDebugTxPacketFateToHidl( - legacy_fates, &hidl_fates)) { + if (!hidl_struct_util::convertLegacyVectorOfDebugTxPacketFateToHidl(legacy_fates, + &hidl_fates)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; } return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_fates}; @@ -629,21 +542,19 @@ std::pair> WifiStaIface::getDebugRxPacketFatesInternal() { legacy_hal::wifi_error legacy_status; std::vector legacy_fates; - std::tie(legacy_status, legacy_fates) = - legacy_hal_.lock()->getRxPktFates(ifname_); + std::tie(legacy_status, legacy_fates) = legacy_hal_.lock()->getRxPktFates(ifname_); if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {createWifiStatusFromLegacyError(legacy_status), {}}; } std::vector hidl_fates; - if (!hidl_struct_util::convertLegacyVectorOfDebugRxPacketFateToHidl( - legacy_fates, &hidl_fates)) { + if (!hidl_struct_util::convertLegacyVectorOfDebugRxPacketFateToHidl(legacy_fates, + &hidl_fates)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; } return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_fates}; } -WifiStatus WifiStaIface::setMacAddressInternal( - const std::array& mac) { +WifiStatus WifiStaIface::setMacAddressInternal(const std::array& mac) { bool status = iface_util_.lock()->setMacAddress(ifname_, mac); if (!status) { return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); @@ -651,12 +562,9 @@ WifiStatus WifiStaIface::setMacAddressInternal( return createWifiStatus(WifiStatusCode::SUCCESS); } -std::pair> -WifiStaIface::getFactoryMacAddressInternal() { - std::array mac = - iface_util_.lock()->getFactoryMacAddress(ifname_); - if (mac[0] == 0 && mac[1] == 0 && mac[2] == 0 && mac[3] == 0 && - mac[4] == 0 && mac[5] == 0) { +std::pair> WifiStaIface::getFactoryMacAddressInternal() { + std::array mac = iface_util_.lock()->getFactoryMacAddress(ifname_); + if (mac[0] == 0 && mac[1] == 0 && mac[2] == 0 && mac[3] == 0 && mac[4] == 0 && mac[5] == 0) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), mac}; } return {createWifiStatus(WifiStatusCode::SUCCESS), mac}; @@ -669,7 +577,7 @@ WifiStatus WifiStaIface::setScanModeInternal(bool enable) { } } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.6/default/wifi_sta_iface.h b/wifi/1.6/default/wifi_sta_iface.h new file mode 100644 index 0000000000..37358a5fb0 --- /dev/null +++ b/wifi/1.6/default/wifi_sta_iface.h @@ -0,0 +1,155 @@ +/* + * 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_STA_IFACE_H_ +#define WIFI_STA_IFACE_H_ + +#include +#include +#include + +#include "hidl_callback_util.h" +#include "wifi_iface_util.h" +#include "wifi_legacy_hal.h" + +namespace android { +namespace hardware { +namespace wifi { +namespace V1_6 { +namespace implementation { +using namespace android::hardware::wifi::V1_0; + +/** + * HIDL interface object used to control a STA Iface instance. + */ +class WifiStaIface : public V1_5::IWifiStaIface { + public: + WifiStaIface(const std::string& ifname, + const std::weak_ptr legacy_hal, + const std::weak_ptr iface_util); + // Refer to |WifiChip::invalidate()|. + void invalidate(); + bool isValid(); + std::set> getEventCallbacks(); + std::string getName(); + + // HIDL methods exposed. + Return getName(getName_cb hidl_status_cb) override; + Return getType(getType_cb hidl_status_cb) override; + Return registerEventCallback(const sp& callback, + registerEventCallback_cb hidl_status_cb) override; + Return getCapabilities(getCapabilities_cb hidl_status_cb) override; + Return getApfPacketFilterCapabilities( + getApfPacketFilterCapabilities_cb hidl_status_cb) override; + Return installApfPacketFilter(uint32_t cmd_id, const hidl_vec& program, + installApfPacketFilter_cb hidl_status_cb) override; + Return readApfPacketFilterData(readApfPacketFilterData_cb hidl_status_cb) override; + Return getBackgroundScanCapabilities( + getBackgroundScanCapabilities_cb hidl_status_cb) override; + Return getValidFrequenciesForBand(V1_0::WifiBand band, + getValidFrequenciesForBand_cb hidl_status_cb) override; + Return startBackgroundScan(uint32_t cmd_id, const StaBackgroundScanParameters& params, + startBackgroundScan_cb hidl_status_cb) override; + Return stopBackgroundScan(uint32_t cmd_id, stopBackgroundScan_cb hidl_status_cb) override; + Return enableLinkLayerStatsCollection( + bool debug, enableLinkLayerStatsCollection_cb hidl_status_cb) override; + Return disableLinkLayerStatsCollection( + disableLinkLayerStatsCollection_cb hidl_status_cb) override; + Return getLinkLayerStats(getLinkLayerStats_cb hidl_status_cb) override; + Return getLinkLayerStats_1_3(getLinkLayerStats_1_3_cb hidl_status_cb) override; + Return getLinkLayerStats_1_5(getLinkLayerStats_1_5_cb hidl_status_cb) override; + Return startRssiMonitoring(uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi, + startRssiMonitoring_cb hidl_status_cb) override; + Return stopRssiMonitoring(uint32_t cmd_id, stopRssiMonitoring_cb hidl_status_cb) override; + Return getRoamingCapabilities(getRoamingCapabilities_cb hidl_status_cb) override; + Return configureRoaming(const StaRoamingConfig& config, + configureRoaming_cb hidl_status_cb) override; + Return setRoamingState(StaRoamingState state, setRoamingState_cb hidl_status_cb) override; + Return enableNdOffload(bool enable, enableNdOffload_cb hidl_status_cb) override; + Return startSendingKeepAlivePackets( + uint32_t cmd_id, const hidl_vec& ip_packet_data, uint16_t ether_type, + const hidl_array& src_address, const hidl_array& dst_address, + uint32_t period_in_ms, startSendingKeepAlivePackets_cb hidl_status_cb) override; + Return stopSendingKeepAlivePackets( + uint32_t cmd_id, stopSendingKeepAlivePackets_cb hidl_status_cb) override; + Return setScanningMacOui(const hidl_array& oui, + setScanningMacOui_cb hidl_status_cb) override; + Return startDebugPacketFateMonitoring( + startDebugPacketFateMonitoring_cb hidl_status_cb) override; + Return getDebugTxPacketFates(getDebugTxPacketFates_cb hidl_status_cb) override; + Return getDebugRxPacketFates(getDebugRxPacketFates_cb hidl_status_cb) override; + Return setMacAddress(const hidl_array& mac, + setMacAddress_cb hidl_status_cb) override; + Return getFactoryMacAddress(getFactoryMacAddress_cb hidl_status_cb) override; + Return setScanMode(bool enable, setScanMode_cb hidl_status_cb) override; + + private: + // Corresponding worker functions for the HIDL methods. + std::pair getNameInternal(); + std::pair getTypeInternal(); + WifiStatus registerEventCallbackInternal(const sp& callback); + std::pair getCapabilitiesInternal(); + std::pair getApfPacketFilterCapabilitiesInternal(); + WifiStatus installApfPacketFilterInternal(uint32_t cmd_id, const std::vector& program); + std::pair> readApfPacketFilterDataInternal(); + std::pair getBackgroundScanCapabilitiesInternal(); + std::pair> getValidFrequenciesForBandInternal( + V1_0::WifiBand band); + WifiStatus startBackgroundScanInternal(uint32_t cmd_id, + const StaBackgroundScanParameters& params); + WifiStatus stopBackgroundScanInternal(uint32_t cmd_id); + WifiStatus enableLinkLayerStatsCollectionInternal(bool debug); + WifiStatus disableLinkLayerStatsCollectionInternal(); + std::pair getLinkLayerStatsInternal(); + std::pair getLinkLayerStatsInternal_1_3(); + std::pair getLinkLayerStatsInternal_1_5(); + WifiStatus startRssiMonitoringInternal(uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi); + WifiStatus stopRssiMonitoringInternal(uint32_t cmd_id); + std::pair getRoamingCapabilitiesInternal(); + WifiStatus configureRoamingInternal(const StaRoamingConfig& config); + WifiStatus setRoamingStateInternal(StaRoamingState state); + WifiStatus enableNdOffloadInternal(bool enable); + WifiStatus startSendingKeepAlivePacketsInternal(uint32_t cmd_id, + const std::vector& ip_packet_data, + uint16_t ether_type, + const std::array& src_address, + const std::array& dst_address, + uint32_t period_in_ms); + WifiStatus stopSendingKeepAlivePacketsInternal(uint32_t cmd_id); + WifiStatus setScanningMacOuiInternal(const std::array& oui); + WifiStatus startDebugPacketFateMonitoringInternal(); + std::pair> getDebugTxPacketFatesInternal(); + std::pair> getDebugRxPacketFatesInternal(); + WifiStatus setMacAddressInternal(const std::array& mac); + std::pair> getFactoryMacAddressInternal(); + WifiStatus setScanModeInternal(bool enable); + + std::string ifname_; + std::weak_ptr legacy_hal_; + std::weak_ptr iface_util_; + bool is_valid_; + hidl_callback_util::HidlCallbackHandler event_cb_handler_; + + DISALLOW_COPY_AND_ASSIGN(WifiStaIface); +}; + +} // namespace implementation +} // namespace V1_6 +} // namespace wifi +} // namespace hardware +} // namespace android + +#endif // WIFI_STA_IFACE_H_ diff --git a/wifi/1.5/default/wifi_status_util.cpp b/wifi/1.6/default/wifi_status_util.cpp similarity index 87% rename from wifi/1.5/default/wifi_status_util.cpp rename to wifi/1.6/default/wifi_status_util.cpp index eb8c8694db..3b18e537cd 100644 --- a/wifi/1.5/default/wifi_status_util.cpp +++ b/wifi/1.6/default/wifi_status_util.cpp @@ -19,7 +19,7 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { std::string legacyErrorToString(legacy_hal::wifi_error error) { @@ -51,8 +51,7 @@ std::string legacyErrorToString(legacy_hal::wifi_error error) { } } -WifiStatus createWifiStatus(WifiStatusCode code, - const std::string& description) { +WifiStatus createWifiStatus(WifiStatusCode code, const std::string& description) { return {code, description}; } @@ -60,8 +59,7 @@ WifiStatus createWifiStatus(WifiStatusCode code) { return createWifiStatus(code, ""); } -WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error, - const std::string& desc) { +WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error, const std::string& desc) { switch (error) { case legacy_hal::WIFI_ERROR_UNINITIALIZED: case legacy_hal::WIFI_ERROR_NOT_AVAILABLE: @@ -75,16 +73,13 @@ WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error, return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS, desc); case legacy_hal::WIFI_ERROR_TIMED_OUT: - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, - desc + ", timed out"); + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, desc + ", timed out"); case legacy_hal::WIFI_ERROR_TOO_MANY_REQUESTS: - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, - desc + ", too many requests"); + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, desc + ", too many requests"); case legacy_hal::WIFI_ERROR_OUT_OF_MEMORY: - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, - desc + ", out of memory"); + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, desc + ", out of memory"); case legacy_hal::WIFI_ERROR_BUSY: return createWifiStatus(WifiStatusCode::ERROR_BUSY); @@ -96,8 +91,7 @@ WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error, return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, "unknown"); default: - return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, - "unknown error"); + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, "unknown error"); } } @@ -106,7 +100,7 @@ WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error) { } } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/1.5/default/wifi_status_util.h b/wifi/1.6/default/wifi_status_util.h similarity index 90% rename from wifi/1.5/default/wifi_status_util.h rename to wifi/1.6/default/wifi_status_util.h index 68f21689c5..ea1c29486b 100644 --- a/wifi/1.5/default/wifi_status_util.h +++ b/wifi/1.6/default/wifi_status_util.h @@ -24,20 +24,19 @@ namespace android { namespace hardware { namespace wifi { -namespace V1_5 { +namespace V1_6 { namespace implementation { using namespace android::hardware::wifi::V1_0; std::string legacyErrorToString(legacy_hal::wifi_error error); -WifiStatus createWifiStatus(WifiStatusCode code, - const std::string& description); +WifiStatus createWifiStatus(WifiStatusCode code, const std::string& description); WifiStatus createWifiStatus(WifiStatusCode code); WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error, const std::string& description); WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error); } // namespace implementation -} // namespace V1_5 +} // namespace V1_6 } // namespace wifi } // namespace hardware } // namespace android -- GitLab From 7bd42e1b14baccde7eb584541181eaec0612a64a Mon Sep 17 00:00:00 2001 From: Joe Bolinger Date: Wed, 12 Jan 2022 16:27:03 -0800 Subject: [PATCH 412/825] Update common and face AIDL for session logging. Bug: 204585936 Bug: 204584403 Test: atest VtsHalBiometricsFaceTargetTest Change-Id: Icba064c5c48f808327323ab64b7b63f68737a2f8 --- biometrics/face/aidl/Android.bp | 2 +- .../hardware/biometrics/face/ISession.aidl | 3 +++ .../hardware/biometrics/face/ISession.aidl | 20 ++++++++++++++++++ biometrics/face/aidl/default/Android.bp | 4 ++-- biometrics/face/aidl/default/Session.cpp | 21 +++++++++++++++++++ biometrics/face/aidl/default/Session.h | 14 +++++++++++++ biometrics/face/aidl/default/face-default.xml | 1 + biometrics/face/aidl/vts/Android.bp | 4 ++-- .../compatibility_matrix.current.xml | 1 + 9 files changed, 65 insertions(+), 5 deletions(-) diff --git a/biometrics/face/aidl/Android.bp b/biometrics/face/aidl/Android.bp index 3f53fc8cdf..fff2c1d3d4 100644 --- a/biometrics/face/aidl/Android.bp +++ b/biometrics/face/aidl/Android.bp @@ -16,7 +16,7 @@ aidl_interface { imports: [ "android.hardware.biometrics.common", "android.hardware.common-V2", - "android.hardware.keymaster", + "android.hardware.keymaster-V3", ], stability: "vintf", backend: { 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 78178642cd..4b51bb17cc 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 @@ -48,4 +48,7 @@ interface ISession { 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); + 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); } diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl index 5f06b408e8..bbe3632b6b 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl @@ -17,6 +17,7 @@ package android.hardware.biometrics.face; import android.hardware.biometrics.common.ICancellationSignal; +import android.hardware.biometrics.common.OperationContext; import android.hardware.biometrics.face.EnrollmentStageConfig; import android.hardware.biometrics.face.EnrollmentType; import android.hardware.biometrics.face.Feature; @@ -441,4 +442,23 @@ interface ISession { * - ISessionCallback#onSessionClosed */ void close(); + + /** + * These are alternative methods for some operations to allow the HAL to make optional + * optimizations during execution. + * + * HALs may ignore the additional context and treat all *WithContext methods the same as + * the original methods. + */ + + /* See ISession#authenticateWithContext(long) */ + ICancellationSignal authenticateWithContext(in long operationId, in OperationContext context); + + /* See ISession#enroll(HardwareAuthToken, EnrollmentType, Feature[], NativeHandle) */ + ICancellationSignal enrollWithContext(in HardwareAuthToken hat, in EnrollmentType type, + in Feature[] features, in @nullable NativeHandle previewSurface, + in OperationContext context); + + /* See ISession#detectInteraction() */ + ICancellationSignal detectInteractionWithContext(in OperationContext context); } diff --git a/biometrics/face/aidl/default/Android.bp b/biometrics/face/aidl/default/Android.bp index 509231859d..7f66ecaf83 100644 --- a/biometrics/face/aidl/default/Android.bp +++ b/biometrics/face/aidl/default/Android.bp @@ -16,8 +16,8 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.biometrics.face-V1-ndk", - "android.hardware.biometrics.common-V1-ndk", + "android.hardware.biometrics.face-V2-ndk", + "android.hardware.biometrics.common-V2-ndk", ], srcs: [ "main.cpp", diff --git a/biometrics/face/aidl/default/Session.cpp b/biometrics/face/aidl/default/Session.cpp index 01cb620b35..9e753e5c33 100644 --- a/biometrics/face/aidl/default/Session.cpp +++ b/biometrics/face/aidl/default/Session.cpp @@ -151,4 +151,25 @@ ndk::ScopedAStatus Session::close() { return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Session::authenticateWithContext( + int64_t operationId, const common::OperationContext& /*context*/, + std::shared_ptr* out) { + return authenticate(operationId, out); +} + +ndk::ScopedAStatus Session::enrollWithContext(const keymaster::HardwareAuthToken& hat, + EnrollmentType enrollmentType, + const std::vector& features, + const std::optional& previewSurface, + const common::OperationContext& /*context*/, + std::shared_ptr* out) { + return enroll(hat, enrollmentType, features, previewSurface, out); +} + +ndk::ScopedAStatus Session::detectInteractionWithContext( + const common::OperationContext& /*context*/, + std::shared_ptr* out) { + return detectInteraction(out); +} + } // namespace aidl::android::hardware::biometrics::face diff --git a/biometrics/face/aidl/default/Session.h b/biometrics/face/aidl/default/Session.h index 4152909a49..0ce9e2060e 100644 --- a/biometrics/face/aidl/default/Session.h +++ b/biometrics/face/aidl/default/Session.h @@ -68,6 +68,20 @@ class Session : public BnSession { ndk::ScopedAStatus close() override; + ndk::ScopedAStatus authenticateWithContext( + int64_t operationId, const common::OperationContext& context, + std::shared_ptr* out) override; + + ndk::ScopedAStatus enrollWithContext( + const keymaster::HardwareAuthToken& hat, EnrollmentType enrollmentType, + const std::vector& features, const std::optional& previewSurface, + const common::OperationContext& context, + std::shared_ptr* out) override; + + ndk::ScopedAStatus detectInteractionWithContext( + const common::OperationContext& context, + std::shared_ptr* out) override; + private: std::shared_ptr cb_; std::mt19937 mRandom; diff --git a/biometrics/face/aidl/default/face-default.xml b/biometrics/face/aidl/default/face-default.xml index 6915ad0a4d..e6ef842734 100644 --- a/biometrics/face/aidl/default/face-default.xml +++ b/biometrics/face/aidl/default/face-default.xml @@ -1,6 +1,7 @@ android.hardware.biometrics.face + 2 IFace/default diff --git a/biometrics/face/aidl/vts/Android.bp b/biometrics/face/aidl/vts/Android.bp index 09ec4d06e3..4171ac3364 100644 --- a/biometrics/face/aidl/vts/Android.bp +++ b/biometrics/face/aidl/vts/Android.bp @@ -15,8 +15,8 @@ cc_test { ], srcs: ["VtsHalBiometricsFaceTargetTest.cpp"], static_libs: [ - "android.hardware.biometrics.common-V1-ndk", - "android.hardware.biometrics.face-V1-ndk", + "android.hardware.biometrics.common-V2-ndk", + "android.hardware.biometrics.face-V2-ndk", "android.hardware.common-V2-ndk", "android.hardware.keymaster-V3-ndk", ], diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index cf856889df..2762bf1de5 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -110,6 +110,7 @@ android.hardware.biometrics.face + 2 IFace default -- GitLab From 42b2d0a65f4ba512004cf86c1e8ebd8898cd423d Mon Sep 17 00:00:00 2001 From: Yuchen He Date: Wed, 12 Jan 2022 04:39:37 +0000 Subject: [PATCH 413/825] Support the location injection in AIDL HAL Bug: 213225295 Test: atest VtsHalGnssTargetTest Change-Id: Iff9fca55722af9bad6cc50f0170e4e1a069d05d6 --- gnss/aidl/default/Gnss.cpp | 19 +++++++++- gnss/aidl/default/Gnss.h | 1 + gnss/common/utils/default/GnssReplayUtils.cpp | 2 +- gnss/common/utils/default/NmeaFixInfo.cpp | 37 +++++++++++++++++++ .../utils/default/include/NmeaFixInfo.h | 3 ++ 5 files changed, 59 insertions(+), 3 deletions(-) diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index e296351d95..657877898f 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -20,6 +20,7 @@ #include #include #include "AGnss.h" +#include "DeviceFileReader.h" #include "GnssBatching.h" #include "GnssConfiguration.h" #include "GnssDebug.h" @@ -28,10 +29,13 @@ #include "GnssNavigationMessageInterface.h" #include "GnssPsds.h" #include "GnssVisibilityControl.h" +#include "NmeaFixInfo.h" #include "Utils.h" namespace aidl::android::hardware::gnss { +using ::android::hardware::gnss::common::NmeaFixInfo; using ::android::hardware::gnss::common::Utils; + using ndk::ScopedAStatus; using GnssSvInfo = IGnssCallback::GnssSvInfo; @@ -62,6 +66,12 @@ ScopedAStatus Gnss::setCallback(const std::shared_ptr& callback) return ScopedAStatus::ok(); } +std::unique_ptr Gnss::getLocationFromHW() { + std::string inputStr = + ::android::hardware::gnss::common::DeviceFileReader::Instance().getLocationData(); + return ::android::hardware::gnss::common::NmeaFixInfo::getAidlLocationFromInputStr(inputStr); +} + ScopedAStatus Gnss::start() { ALOGD("start()"); if (mIsActive) { @@ -82,9 +92,14 @@ ScopedAStatus Gnss::start() { auto svStatus = filterBlocklistedSatellites(Utils::getMockSvInfoList()); this->reportSvStatus(svStatus); + auto currentLocation = getLocationFromHW(); mGnssPowerIndication->notePowerConsumption(); - const auto location = Utils::getMockLocation(); - this->reportLocation(location); + if (currentLocation != nullptr) { + this->reportLocation(*currentLocation); + } else { + const auto location = Utils::getMockLocation(); + this->reportLocation(location); + } std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMs)); } }); diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index 384c8629a2..f21d756c24 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -79,6 +79,7 @@ class Gnss : public BnGnss { std::vector filterBlocklistedSatellites( std::vector gnssSvInfoList); void reportGnssStatusValue(const IGnssCallback::GnssStatusValue gnssStatusValue) const; + std::unique_ptr getLocationFromHW(); static std::shared_ptr sGnssCallback; diff --git a/gnss/common/utils/default/GnssReplayUtils.cpp b/gnss/common/utils/default/GnssReplayUtils.cpp index e3f4ff82a0..535647716b 100644 --- a/gnss/common/utils/default/GnssReplayUtils.cpp +++ b/gnss/common/utils/default/GnssReplayUtils.cpp @@ -41,7 +41,7 @@ bool ReplayUtils::isGnssRawMeasurement(const std::string& inputStr) { bool ReplayUtils::isNMEA(const std::string& inputStr) { return !inputStr.empty() && (inputStr.find("$GPRMC,", 0) != std::string::npos || - inputStr.find("$GPRMA,", 0) != std::string::npos); + inputStr.find("$GPGGA,", 0) != std::string::npos); } } // namespace common diff --git a/gnss/common/utils/default/NmeaFixInfo.cpp b/gnss/common/utils/default/NmeaFixInfo.cpp index c7ee13488b..22aef90204 100644 --- a/gnss/common/utils/default/NmeaFixInfo.cpp +++ b/gnss/common/utils/default/NmeaFixInfo.cpp @@ -34,6 +34,9 @@ namespace hardware { namespace gnss { namespace common { +using aidl::android::hardware::gnss::ElapsedRealtime; +using aidl::android::hardware::gnss::GnssLocation; + NmeaFixInfo::NmeaFixInfo() : hasGMCRecord(false), hasGGARecord(false) {} float NmeaFixInfo::getAltitudeMeters() const { @@ -236,6 +239,40 @@ std::unique_ptr NmeaFixInfo::getLocationFromInputStr( return nmeaFixInfo.toGnssLocation(); } +/** + * Convert V2_0::GnssLocation to aidl::GnssLocation. + */ +std::unique_ptr NmeaFixInfo::getAidlLocationFromInputStr( + const std::string& inputStr) { + std::unique_ptr locationV2 = getLocationFromInputStr(inputStr); + if (locationV2 == nullptr) { + return nullptr; + } + + ElapsedRealtime elapsedRealtime = { + .flags = ElapsedRealtime::HAS_TIMESTAMP_NS | ElapsedRealtime::HAS_TIME_UNCERTAINTY_NS, + .timestampNs = ::android::elapsedRealtimeNano(), + // This is an hardcoded value indicating a 1ms of uncertainty between the two clocks. + // In an actual implementation provide an estimate of the synchronization uncertainty + // or don't set the field. + .timeUncertaintyNs = 1020400}; + + GnssLocation location = { + .gnssLocationFlags = locationV2->v1_0.gnssLocationFlags, + .latitudeDegrees = locationV2->v1_0.latitudeDegrees, + .longitudeDegrees = locationV2->v1_0.longitudeDegrees, + .altitudeMeters = locationV2->v1_0.altitudeMeters, + .speedMetersPerSec = locationV2->v1_0.speedMetersPerSec, + .bearingDegrees = locationV2->v1_0.bearingDegrees, + .horizontalAccuracyMeters = locationV2->v1_0.horizontalAccuracyMeters, + .verticalAccuracyMeters = locationV2->v1_0.verticalAccuracyMeters, + .speedAccuracyMetersPerSecond = locationV2->v1_0.speedAccuracyMetersPerSecond, + .bearingAccuracyDegrees = locationV2->v1_0.bearingAccuracyDegrees, + .timestampMillis = locationV2->v1_0.timestamp, + .elapsedRealtime = elapsedRealtime}; + return std::make_unique(location); +} + /** * Parses the input string in NMEA format and convert to GnssLocation. */ diff --git a/gnss/common/utils/default/include/NmeaFixInfo.h b/gnss/common/utils/default/include/NmeaFixInfo.h index 5c27045316..407336121d 100644 --- a/gnss/common/utils/default/include/NmeaFixInfo.h +++ b/gnss/common/utils/default/include/NmeaFixInfo.h @@ -22,6 +22,7 @@ #include #include #include +#include "aidl/android/hardware/gnss/IGnss.h" namespace android { namespace hardware { namespace gnss { @@ -45,6 +46,8 @@ class NmeaFixInfo { public: static std::unique_ptr getLocationFromInputStr(const std::string& inputStr); + static std::unique_ptr getAidlLocationFromInputStr( + const std::string& inputStr); private: static void splitStr(const std::string& line, const char& delimiter, -- GitLab From ab1851e9f2c40942fff243504788795aeaf89961 Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Tue, 14 Dec 2021 14:32:51 +0000 Subject: [PATCH 414/825] Alter spec text for RSA-PSS to match reality The Key{Mint,Master} spec previously said that RSA-PSS mode should use SHA-1 for the MGF1 digest, separately from whatever Tag::DIGEST gets specified as the main digest. However, both the reference implementation and the VTS/CTS tests use BoringSSL's defaults, which is to re-use the main digest as the MGF1 digest if none is separately specified. Given that this behaviour is embedded in many implementations over several years (and given that there isn't a security implication), change the spec to match this behaviour. Also update the VTS test code to make this clear/obvious. Test: VtsAidlKeyMintTargetTest, VtsHalKeymasterV4_0TargetTest Bug: 210424594 Change-Id: I4303f28d094ef4d4b9dc931d6728b1fa040de20d Ignore-AOSP-First: target internal master first due to merge conflict --- current.txt | 1 + keymaster/4.0/IKeymasterDevice.hal | 3 ++- keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp | 1 + .../android/hardware/security/keymint/IKeyMintOperation.aidl | 3 ++- security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/current.txt b/current.txt index 1dbf5ab1be..1fedaa0d6e 100644 --- a/current.txt +++ b/current.txt @@ -907,6 +907,7 @@ c8a57364f6ad20842be14f4db284df5304f7521ca8eac6bcc1fa6c5b466fb8a6 android.hardwar # ABI preserving changes to HALs during Android T 62ace52d9c3ff1f60f94118557a2aaf0b953513e59dcd34d5f94ae28d4c7e780 android.hardware.fastboot@1.0::IFastboot f767a132ef28275294db15353f14f3876a4048770751931a77d038d4228f2cb7 android.hardware.graphics.composer@2.4::IComposerClient +d0fb32f3ddeb9af7115ab32905225ea69b930d2472be8e9610f0cf136c15aefb android.hardware.keymaster@4.0::IKeymasterDevice # b/210424594 ca62a2a95d173ed323309e5e00f653ad3cceec82a6e5e4976a249cb5aafe2515 android.hardware.neuralnetworks@1.2::types fa76bced6b1b71c40fc706c508a9011284c57f57831cd0cf5f45653ed4ea463e android.hardware.neuralnetworks@1.3::types diff --git a/keymaster/4.0/IKeymasterDevice.hal b/keymaster/4.0/IKeymasterDevice.hal index dfde060e3f..1c6ae478f4 100644 --- a/keymaster/4.0/IKeymasterDevice.hal +++ b/keymaster/4.0/IKeymasterDevice.hal @@ -1254,7 +1254,8 @@ interface IKeymasterDevice { * o PaddingMode::RSA_PSS. For PSS-padded signature operations, the PSS salt length must match * the size of the PSS digest selected. The digest specified with Tag::DIGEST in inputParams * on begin() must be used as the PSS digest algorithm, MGF1 must be used as the mask - * generation function and SHA1 must be used as the MGF1 digest algorithm. + * generation function and the digest specified with Tag:DIGEST in inputParams must also be + * used as the MGF1 digest algorithm. * * o PaddingMode::RSA_OAEP. The digest specified with Tag::DIGEST in inputParams on begin is * used as the OAEP digest algorithm, MGF1 must be used as the mask generation function and diff --git a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp index 767614754b..6412f3a06b 100644 --- a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp +++ b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp @@ -1712,6 +1712,7 @@ TEST_P(VerificationOperationsTest, RsaAllPaddingsAndDigests) { case PaddingMode::RSA_PSS: EXPECT_GT(EVP_PKEY_CTX_set_rsa_padding(pkey_ctx, RSA_PKCS1_PSS_PADDING), 0); EXPECT_GT(EVP_PKEY_CTX_set_rsa_pss_saltlen(pkey_ctx, EVP_MD_size(md)), 0); + EXPECT_GT(EVP_PKEY_CTX_set_rsa_mgf1_md(pkey_ctx, md), 0); break; case PaddingMode::RSA_PKCS1_1_5_SIGN: // PKCS1 is the default; don't need to set anything. diff --git a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintOperation.aidl b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintOperation.aidl index ce83044d0e..ca8955552e 100644 --- a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintOperation.aidl +++ b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintOperation.aidl @@ -227,7 +227,8 @@ interface IKeyMintOperation { * o PaddingMode::RSA_PSS. For PSS-padded signature operations, the PSS salt length must match * the size of the PSS digest selected. The digest specified with Tag::DIGEST in params * on begin() must be used as the PSS digest algorithm, MGF1 must be used as the mask - * generation function and SHA1 must be used as the MGF1 digest algorithm. + * generation function and the digest specified with Tag:DIGEST in params on begin() must also + * be used as the MGF1 digest algorithm. * * -- ECDSA keys -- * diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp index 02462fce3a..374f2da7a8 100644 --- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp +++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp @@ -812,6 +812,7 @@ void KeyMintAidlTestBase::LocalVerifyMessage(const string& message, const string if (padding == PaddingMode::RSA_PSS) { EXPECT_GT(EVP_PKEY_CTX_set_rsa_padding(pkey_ctx, RSA_PKCS1_PSS_PADDING), 0); EXPECT_GT(EVP_PKEY_CTX_set_rsa_pss_saltlen(pkey_ctx, EVP_MD_size(md)), 0); + EXPECT_GT(EVP_PKEY_CTX_set_rsa_mgf1_md(pkey_ctx, md), 0); } ASSERT_EQ(1, EVP_DigestVerifyUpdate(&digest_ctx, -- GitLab From 4c6e9ebf1ee7fbfda9a0997c7dc509db1bdbc29c Mon Sep 17 00:00:00 2001 From: Kriti Dang Date: Wed, 17 Nov 2021 14:56:29 +0100 Subject: [PATCH 415/825] Composer hal changes for boot time display mode Bug: 203520442 Test: m Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I530d7f52acaaee8c728dbd9a95ecca017804304a --- .../graphics/composer3/IComposerClient.aidl | 3 + .../graphics/composer3/IComposerClient.aidl | 52 ++++++++++++++++++ .../VtsHalGraphicsComposer3_TargetTest.cpp | 55 +++++++++++++++++++ 3 files changed, 110 insertions(+) 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 e9d9745dff..a8239cd052 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 @@ -61,6 +61,9 @@ interface IComposerClient { void registerCallback(in android.hardware.graphics.composer3.IComposerCallback callback); void setActiveConfig(long display, int config); android.hardware.graphics.composer3.VsyncPeriodChangeTimeline setActiveConfigWithConstraints(long display, int config, in android.hardware.graphics.composer3.VsyncPeriodChangeConstraints vsyncPeriodChangeConstraints); + void setBootDisplayConfig(long display, int config); + void clearBootDisplayConfig(long display); + int getPreferredBootDisplayConfig(long display); void setAutoLowLatencyMode(long display, boolean on); void setClientTargetSlotCount(long display, int clientTargetSlotCount); void setColorMode(long display, android.hardware.graphics.composer3.ColorMode mode, android.hardware.graphics.composer3.RenderIntent intent); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 3ab6329bff..9a29e7e23e 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -548,6 +548,58 @@ interface IComposerClient { VsyncPeriodChangeTimeline setActiveConfigWithConstraints( long display, int config, in VsyncPeriodChangeConstraints vsyncPeriodChangeConstraints); + /** + * Sets the display config in which the device boots. + * + * If the device is unable to boot in this config for any reason (example HDMI display changed), + * the implementation should try to find a config which matches the resolution and refresh-rate + * of this config. If no such config exists, the implementation's preferred display config + * should be used. + * + * @param display is the display for which the boot config is set. + * @param config is the new boot config for the display. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_BAD_CONFIG when an invalid config id was passed in. + * + * @see getDisplayConfigs + * @see clearBootDisplayConfig + * @see getPreferredBootDisplayConfig + */ + void setBootDisplayConfig(long display, int config); + + /** + * Clears the boot display config. + * + * The device should boot in the implementation's preferred display config. + * + * @param display is the display for which the cached boot config is cleared. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * + * @see getDisplayConfigs + * @see setBootDisplayConfig + * @see getPreferredBootDisplayConfig + */ + void clearBootDisplayConfig(long display); + + /** + * Returns the implementation's preferred display config. + * + * This is the display config used by the implementation at boot time, if the boot display + * config has not been requested yet, or if it has been previously cleared. + * + * @param display is the display to which the preferred config is queried. + * @return the implementation's preferred display config. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * + * @see getDisplayConfigs + * @see setBootDisplayConfig + * @see clearBootDisplayConfig + */ + int getPreferredBootDisplayConfig(long display); + /** * Requests the display to enable/disable its low latency mode. * diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index c61693e458..a59a090b27 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -716,6 +716,61 @@ TEST_P(GraphicsComposerAidlTest, setActiveConfigWithConstraints_BadConfig) { } } +TEST_P(GraphicsComposerAidlTest, setBootDisplayConfig_BadDisplay) { + int32_t config = 0; + auto const error = mComposerClient->setBootDisplayConfig(mInvalidDisplayId, config); + + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} + +TEST_P(GraphicsComposerAidlTest, setBootDisplayConfig_BadConfig) { + for (VtsDisplay& display : mDisplays) { + int32_t invalidConfigId = GetInvalidConfigId(); + const auto error = mComposerClient->setBootDisplayConfig(display.get(), invalidConfigId); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_CONFIG, error.getServiceSpecificError()); + } +} + +TEST_P(GraphicsComposerAidlTest, setBootDisplayConfig) { + std::vector configs; + EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); + for (auto config : configs) { + EXPECT_TRUE(mComposerClient->setBootDisplayConfig(mPrimaryDisplay, config).isOk()); + } +} + +TEST_P(GraphicsComposerAidlTest, clearBootDisplayConfig_BadDisplay) { + auto const error = mComposerClient->clearBootDisplayConfig(mInvalidDisplayId); + + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} + +TEST_P(GraphicsComposerAidlTest, clearBootDisplayConfig) { + EXPECT_TRUE(mComposerClient->clearBootDisplayConfig(mPrimaryDisplay).isOk()); +} + +TEST_P(GraphicsComposerAidlTest, getPreferredBootDisplayConfig_BadDisplay) { + int32_t config; + auto const error = mComposerClient->getPreferredBootDisplayConfig(mInvalidDisplayId, &config); + + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} + +TEST_P(GraphicsComposerAidlTest, getPreferredBootDisplayConfig) { + int32_t preferredDisplayConfig = 0; + auto const error = mComposerClient->getPreferredBootDisplayConfig(mPrimaryDisplay, + &preferredDisplayConfig); + EXPECT_TRUE(error.isOk()); + + std::vector configs; + EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); + EXPECT_NE(configs.end(), std::find(configs.begin(), configs.end(), preferredDisplayConfig)); +} + TEST_P(GraphicsComposerAidlTest, setAutoLowLatencyModeBadDisplay) { EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, mComposerClient->setAutoLowLatencyMode(mInvalidDisplayId, true) -- GitLab From 0331815adb4c952bcdd01d938b106495349186da Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Thu, 13 Jan 2022 12:24:19 -0500 Subject: [PATCH 416/825] Add VTS for setLayerBlockingRegion Fixes: 213361853 Test this Change-Id: Iaca3be9f83420964cd3945d39665a95da50fee08 --- .../VtsHalGraphicsComposer3_TargetTest.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 829b0ff66f..a3ee49f474 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1698,6 +1698,26 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SURFACE_DAMAGE) { ASSERT_TRUE(mReader.takeErrors().empty()); } +TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BLOCKING_REGION) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); + + Rect empty{0, 0, 0, 0}; + Rect unit{0, 0, 1, 1}; + + mWriter.setLayerBlockingRegion(mPrimaryDisplay, layer, std::vector(1, empty)); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerBlockingRegion(mPrimaryDisplay, layer, std::vector(1, unit)); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerBlockingRegion(mPrimaryDisplay, layer, std::vector()); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); +} + TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BLEND_MODE) { int64_t layer; EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); -- GitLab From ef1d9b6f8fec0108c9c23cacaede3457355fc5a2 Mon Sep 17 00:00:00 2001 From: John Reck Date: Tue, 4 Jan 2022 11:08:53 -0500 Subject: [PATCH 417/825] Add front buffer usage Test: Builds & boots Bug: 193558894 Change-Id: I5e6aa11b47272d9d8aa8a8bac256861f7a0629cb --- common/support/Android.bp | 1 + .../compatibility_matrix.current.xml | 8 ++++ graphics/allocator/aidl/Android.bp | 40 +++++++++++++++++++ .../graphics/allocator/AllocationError.aidl | 40 +++++++++++++++++++ .../graphics/allocator/AllocationResult.aidl | 39 ++++++++++++++++++ .../graphics/allocator/IAllocator.aidl | 38 ++++++++++++++++++ .../graphics/allocator/AllocationError.aidl | 36 +++++++++++++++++ .../graphics/allocator/AllocationResult.aidl | 30 ++++++++++++++ .../graphics/allocator/IAllocator.aidl | 36 +++++++++++++++++ .../hardware/graphics/common/BufferUsage.aidl | 3 +- .../hardware/graphics/common/BufferUsage.aidl | 18 ++++++--- 11 files changed, 282 insertions(+), 7 deletions(-) create mode 100644 graphics/allocator/aidl/Android.bp create mode 100644 graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/AllocationError.aidl create mode 100644 graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/AllocationResult.aidl create mode 100644 graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/IAllocator.aidl create mode 100644 graphics/allocator/aidl/android/hardware/graphics/allocator/AllocationError.aidl create mode 100644 graphics/allocator/aidl/android/hardware/graphics/allocator/AllocationResult.aidl create mode 100644 graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl diff --git a/common/support/Android.bp b/common/support/Android.bp index b24893b16e..4a69618579 100644 --- a/common/support/Android.bp +++ b/common/support/Android.bp @@ -21,6 +21,7 @@ cc_library_static { apex_available: [ "//apex_available:platform", "com.android.neuralnetworks", + "com.android.media.swcodec", ], min_sdk_version: "29", } diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index c480c13554..f8731dba51 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -271,6 +271,14 @@ default + + android.hardware.graphics.allocator + 1 + + IAllocator + default + + android.hardware.graphics.composer 2.1-4 diff --git a/graphics/allocator/aidl/Android.bp b/graphics/allocator/aidl/Android.bp new file mode 100644 index 0000000000..ea8a599578 --- /dev/null +++ b/graphics/allocator/aidl/Android.bp @@ -0,0 +1,40 @@ +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.graphics.allocator", + vendor_available: true, + vndk: { + enabled: true, + support_system_process: true, + }, + srcs: ["android/hardware/graphics/allocator/*.aidl"], + imports: [ + "android.hardware.common-V2", + ], + stability: "vintf", + backend: { + cpp: { + enabled: false, + }, + java: { + enabled: false, + }, + ndk: { + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + ], + vndk: { + enabled: true, + }, + min_sdk_version: "29", + }, + }, +} diff --git a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/AllocationError.aidl b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/AllocationError.aidl new file mode 100644 index 0000000000..6e7b739ed5 --- /dev/null +++ b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/AllocationError.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 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 -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.allocator; +@Backing(type="int") @VintfStability +enum AllocationError { + BAD_DESCRIPTOR = 0, + NO_RESOURCES = 1, + UNSUPPORTED = 2, +} diff --git a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/AllocationResult.aidl b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/AllocationResult.aidl new file mode 100644 index 0000000000..73cfeb5422 --- /dev/null +++ b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/AllocationResult.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 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 -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.allocator; +@VintfStability +parcelable AllocationResult { + int stride; + android.hardware.common.NativeHandle[] buffers; +} diff --git a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/IAllocator.aidl b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/IAllocator.aidl new file mode 100644 index 0000000000..fe0b0a214b --- /dev/null +++ b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/current/android/hardware/graphics/allocator/IAllocator.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 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 -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.allocator; +@VintfStability +interface IAllocator { + android.hardware.graphics.allocator.AllocationResult allocate(in byte[] descriptor, in int count); +} diff --git a/graphics/allocator/aidl/android/hardware/graphics/allocator/AllocationError.aidl b/graphics/allocator/aidl/android/hardware/graphics/allocator/AllocationError.aidl new file mode 100644 index 0000000000..c6b77b9f7f --- /dev/null +++ b/graphics/allocator/aidl/android/hardware/graphics/allocator/AllocationError.aidl @@ -0,0 +1,36 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.graphics.allocator; + +@VintfStability +@Backing(type="int") +enum AllocationError { + /** + * Invalid BufferDescriptor. + */ + BAD_DESCRIPTOR, + + /** + * Resource unavailable. + */ + NO_RESOURCES, + + /** + * Permanent failure. + */ + UNSUPPORTED +} \ No newline at end of file diff --git a/graphics/allocator/aidl/android/hardware/graphics/allocator/AllocationResult.aidl b/graphics/allocator/aidl/android/hardware/graphics/allocator/AllocationResult.aidl new file mode 100644 index 0000000000..0774e2554c --- /dev/null +++ b/graphics/allocator/aidl/android/hardware/graphics/allocator/AllocationResult.aidl @@ -0,0 +1,30 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.graphics.allocator; + +import android.hardware.common.NativeHandle; + + /** + * Result of an IAllocator::allocate call. + * + * @sa +ndk libnativewindow#AHardwareBuffer_Desc + */ +@VintfStability +parcelable AllocationResult { + int stride; + NativeHandle[] buffers; +} \ No newline at end of file diff --git a/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl b/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl new file mode 100644 index 0000000000..8c3ca9601e --- /dev/null +++ b/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl @@ -0,0 +1,36 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.graphics.allocator; + +import android.hardware.graphics.allocator.AllocationResult; + +@VintfStability +interface IAllocator { + /** + * Allocates buffers with the properties specified by the descriptor. + * + * Allocations should be optimized for usage bits provided in the + * descriptor. + * + * @param descriptor Properties of the buffers to allocate. This must be + * obtained from IMapper::createDescriptor(). + * @param count The number of buffers to allocate. + * @return An AllocationResult containing the result of an error, or + * an AllocationError status + */ + AllocationResult allocate(in byte[] descriptor, in int count); +} 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 b4ef4515c7..e1edb17793 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 @@ -54,10 +54,11 @@ enum BufferUsage { 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, - GPU_DATA_BUFFER = 16777216, + FRONT_BUFFER = 4294967296, VENDOR_MASK = -268435456, VENDOR_MASK_HI = -281474976710656, } diff --git a/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl b/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl index d978f46345..4b5a306881 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl @@ -87,6 +87,12 @@ enum BufferUsage { /** buffer is used as a sensor direct report output */ SENSOR_DIRECT_DATA = 1 << 23, + /** + * buffer is used as as an OpenGL shader storage or uniform + * buffer object + */ + GPU_DATA_BUFFER = 1 << 24, + /** buffer is used as a cube map texture */ GPU_CUBE_MAP = 1 << 25, @@ -98,17 +104,17 @@ enum BufferUsage { */ HW_IMAGE_ENCODER = 1 << 27, + /* Bits 28-31 are reserved for vendor usage */ + /** - * buffer is used as as an OpenGL shader storage or uniform - * buffer object - */ - GPU_DATA_BUFFER = 1 << 24, + * Buffer is used for front-buffer rendering + */ + FRONT_BUFFER = 1L << 32, - /** bits 25-27 must be zero and are reserved for future versions */ /** bits 28-31 are reserved for vendor extensions */ VENDOR_MASK = 0xf << 28, - /** bits 32-47 must be zero and are reserved for future versions */ + /** 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, } -- GitLab From 19a6a6a76ca5abedfaf4d4fd871b70bd8ef3eba7 Mon Sep 17 00:00:00 2001 From: Yuchen He Date: Thu, 13 Jan 2022 18:39:50 +0000 Subject: [PATCH 418/825] Add parser to support CSV location data Bug: 213225295 Test: launch_cvd -cpus 16 -memory_mb 16192 --start_gnss_proxy --gnss_file_path=/google/data/rw/users/yu/yuchenhe/input.txt (Running blue dot in Google Maps) Change-Id: I572315888c2f57ce701e695acb03aa6b28787f31 --- gnss/common/utils/default/Android.bp | 1 + .../utils/default/FixLocationParser.cpp | 75 +++++++++++++++++++ .../utils/default/include/FixLocationParser.h | 48 ++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 gnss/common/utils/default/FixLocationParser.cpp create mode 100644 gnss/common/utils/default/include/FixLocationParser.h diff --git a/gnss/common/utils/default/Android.bp b/gnss/common/utils/default/Android.bp index 05bec882de..b896f04ddf 100644 --- a/gnss/common/utils/default/Android.bp +++ b/gnss/common/utils/default/Android.bp @@ -39,6 +39,7 @@ cc_library_static { "v2_1/GnssMeasurement.cpp", "v2_1/GnssMeasurementCorrections.cpp", "DeviceFileReader.cpp", + "FixLocationParser.cpp", "GnssRawMeasurementParser.cpp", "GnssReplayUtils.cpp", "MockLocation.cpp", diff --git a/gnss/common/utils/default/FixLocationParser.cpp b/gnss/common/utils/default/FixLocationParser.cpp new file mode 100644 index 0000000000..f391d96616 --- /dev/null +++ b/gnss/common/utils/default/FixLocationParser.cpp @@ -0,0 +1,75 @@ +/* + * 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. + */ + +#include "FixLocationParser.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace common { + +using aidl::android::hardware::gnss::ElapsedRealtime; +using aidl::android::hardware::gnss::GnssLocation; + +std::unique_ptr FixLocationParser::getLocationFromInputStr( + const std::string& locationStr) { + /* + * Fix,Provider,LatitudeDegrees,LongitudeDegrees,AltitudeMeters,SpeedMps, + * AccuracyMeters,BearingDegrees,UnixTimeMillis,SpeedAccuracyMps,BearingAccuracyDegrees, + * elapsedRealtimeNanos + */ + if (locationStr.empty()) { + return nullptr; + } + std::vector locationStrRecords; + ParseUtils::splitStr(locationStr, LINE_SEPARATOR, locationStrRecords); + if (locationStrRecords.empty()) { + return nullptr; + } + + std::vector locationValues; + ParseUtils::splitStr(locationStrRecords[0], COMMA_SEPARATOR, locationValues); + if (locationValues.size() < 12) { + return nullptr; + } + ElapsedRealtime elapsedRealtime = { + .flags = ElapsedRealtime::HAS_TIMESTAMP_NS | ElapsedRealtime::HAS_TIME_UNCERTAINTY_NS, + .timestampNs = ::android::elapsedRealtimeNano(), + // This is an hardcoded value indicating a 1ms of uncertainty between the two clocks. + // In an actual implementation provide an estimate of the synchronization uncertainty + // or don't set the field. + .timeUncertaintyNs = 1020400}; + + GnssLocation location = { + .gnssLocationFlags = 0xFF, + .latitudeDegrees = ParseUtils::tryParseDouble(locationValues[2], 0), + .longitudeDegrees = ParseUtils::tryParseDouble(locationValues[3], 0), + .altitudeMeters = ParseUtils::tryParseDouble(locationValues[4], 0), + .speedMetersPerSec = ParseUtils::tryParseDouble(locationValues[5], 0), + .bearingDegrees = ParseUtils::tryParseDouble(locationValues[7], 0), + .horizontalAccuracyMeters = ParseUtils::tryParseDouble(locationValues[6], 0), + .verticalAccuracyMeters = ParseUtils::tryParseDouble(locationValues[6], 0), + .speedAccuracyMetersPerSecond = ParseUtils::tryParseDouble(locationValues[9], 0), + .bearingAccuracyDegrees = ParseUtils::tryParseDouble(locationValues[10], 0), + .timestampMillis = ParseUtils::tryParseLongLong(locationValues[8], 0), + .elapsedRealtime = elapsedRealtime}; + return std::make_unique(location); +} + +} // namespace common +} // namespace gnss +} // namespace hardware +} // namespace android \ No newline at end of file diff --git a/gnss/common/utils/default/include/FixLocationParser.h b/gnss/common/utils/default/include/FixLocationParser.h new file mode 100644 index 0000000000..a73891452a --- /dev/null +++ b/gnss/common/utils/default/include/FixLocationParser.h @@ -0,0 +1,48 @@ +/* + * 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 android_hardware_gnss_common_default_FixLocationParser_H_ +#define android_hardware_gnss_common_default_FixLocationParser_H_ + +#include + +#include +#include +#include + +#include +#include +#include +#include "Constants.h" +#include "ParseUtils.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace common { + +struct FixLocationParser { + public: + static std::unique_ptr getLocationFromInputStr( + const std::string& inputStr); +}; + +} // namespace common +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // android_hardware_gnss_common_default_FixLocationParser_H_ \ No newline at end of file -- GitLab From d99c82dc5ce7b216bc53c9dca084d078846b710d Mon Sep 17 00:00:00 2001 From: Hongguang Date: Thu, 13 Jan 2022 12:42:52 -0800 Subject: [PATCH 419/825] Support not tuned PLP info query. Bug: 209762260 Test: atest VtsHalTvTunerTargetTest Change-Id: Iefc02ae7f4145cfabae8c5a5d60f28ef02ec9bc0 --- .../hardware/tv/tuner/FrontendStatus.aidl | 1 + .../hardware/tv/tuner/FrontendStatusType.aidl | 1 + .../hardware/tv/tuner/FrontendStatus.aidl | 7 ++++++- .../hardware/tv/tuner/FrontendStatusType.aidl | 18 ++++++++++++------ tv/tuner/aidl/default/Frontend.cpp | 14 ++++++++++++++ tv/tuner/aidl/default/Tuner.cpp | 1 + tv/tuner/aidl/vts/functional/FrontendTests.cpp | 7 +++++++ 7 files changed, 42 insertions(+), 7 deletions(-) diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl index fc0efc92be..1e0f5f0840 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl @@ -76,4 +76,5 @@ union FrontendStatus { android.hardware.tv.tuner.FrontendIsdbtPartialReceptionFlag partialReceptionFlag; int[] streamIdList; int[] dvbtCellIds; + android.hardware.tv.tuner.FrontendScanAtsc3PlpInfo[] allPlpInfo; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl index 2cc62d533e..cd6ccb3dc1 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl @@ -76,4 +76,5 @@ enum FrontendStatusType { ISDBT_PARTIAL_RECEPTION_FLAG = 38, STREAM_ID_LIST = 39, DVBT_CELL_IDS = 40, + ATSC3_ALL_PLP_INFO = 41, } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl index ae6e46fa29..b5d02016df 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl @@ -27,6 +27,7 @@ import android.hardware.tv.tuner.FrontendModulation; import android.hardware.tv.tuner.FrontendModulationStatus; import android.hardware.tv.tuner.FrontendRollOff; import android.hardware.tv.tuner.FrontendSpectralInversion; +import android.hardware.tv.tuner.FrontendScanAtsc3PlpInfo; import android.hardware.tv.tuner.FrontendStatusAtsc3PlpInfo; import android.hardware.tv.tuner.FrontendTransmissionMode; import android.hardware.tv.tuner.LnbVoltage; @@ -241,5 +242,9 @@ union FrontendStatus { */ int[] dvbtCellIds; - + /** + * A list of all PLPs in the frequency band for ATSC3 frontend, which includes both tuned + * and not tuned PLPs for currently watching service. + */ + FrontendScanAtsc3PlpInfo[] allPlpInfo; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl index e7da51767a..8f3f2c56c1 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl @@ -130,7 +130,7 @@ enum FrontendStatusType { RF_LOCK, /** - * PLP information in a frequency band for ATSC3.0 frontend. + * Current tuned PLP information in a frequency band for ATSC3 frontend. */ ATSC3_PLP_INFO, @@ -222,10 +222,16 @@ enum FrontendStatusType { /** * Stream ID list included in a transponder. */ - STREAM_ID_LIST, + STREAM_ID_LIST, - /** - * DVB-T Cell Id. - */ - DVBT_CELL_IDS, + /** + * DVB-T Cell Id. + */ + DVBT_CELL_IDS, + + /** + * All PLP information in a frequency band for ATSC3 frontend, which includes both tuned + * and not tuned PLPs for currently watching service. + */ + ATSC3_ALL_PLP_INFO, } diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index 714612d006..445d2b6d7c 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -708,6 +708,20 @@ void Frontend::scanThreadLoop() { status.set(dvbtCellIds); break; } + case FrontendStatusType::ATSC3_ALL_PLP_INFO: { + FrontendScanAtsc3PlpInfo info1; + info1.plpId = 1; + info1.bLlsFlag = false; + FrontendScanAtsc3PlpInfo info2; + info2.plpId = 2; + info2.bLlsFlag = true; + FrontendScanAtsc3PlpInfo info3; + info3.plpId = 3; + info3.bLlsFlag = false; + vector infos = {info1, info2, info3}; + status.set(infos); + break; + } default: { continue; } diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp index 48c1b66a50..7a5fa6ecad 100644 --- a/tv/tuner/aidl/default/Tuner.cpp +++ b/tv/tuner/aidl/default/Tuner.cpp @@ -77,6 +77,7 @@ void Tuner::init() { FrontendStatusType::BERS, FrontendStatusType::INTERLEAVINGS, FrontendStatusType::BANDWIDTH, + FrontendStatusType::ATSC3_ALL_PLP_INFO, }; mFrontendStatusCaps[1] = statusCaps; mMaxUsableFrontends[FrontendType::ATSC3] = 1; diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp index 41e98ea586..a8799aba8b 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp +++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp @@ -414,6 +414,13 @@ void FrontendTests::verifyFrontendStatus(vector statusTypes, expectStatuses[i].get().begin())); break; } + case FrontendStatusType::ATSC3_ALL_PLP_INFO: { + ASSERT_TRUE(std::equal( + realStatuses[i].get().begin(), + realStatuses[i].get().end(), + expectStatuses[i].get().begin())); + break; + } default: { continue; } -- GitLab From ae38634050115817a822c717584b361286e79c49 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Thu, 13 Jan 2022 16:14:17 -0800 Subject: [PATCH 420/825] Power: add a generic game mode Test: Boot Bug: 201769701 Bug: 214405108 Signed-off-by: Wei Wang Change-Id: I4da5821bb0ed135d467146babe03863145e42435 --- .../current/android/hardware/power/Mode.aidl | 3 ++- power/aidl/android/hardware/power/Mode.aidl | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 ba444a7081..f38426b785 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 @@ -49,5 +49,6 @@ enum Mode { CAMERA_STREAMING_LOW = 12, CAMERA_STREAMING_MID = 13, CAMERA_STREAMING_HIGH = 14, - GAME_LOADING = 15, + GAME = 15, + GAME_LOADING = 16, } diff --git a/power/aidl/android/hardware/power/Mode.aidl b/power/aidl/android/hardware/power/Mode.aidl index 2ebace103f..cc4b1308d2 100644 --- a/power/aidl/android/hardware/power/Mode.aidl +++ b/power/aidl/android/hardware/power/Mode.aidl @@ -163,6 +163,11 @@ enum Mode { */ CAMERA_STREAMING_HIGH, + /** + * This mode indicates that user is playing a game. + */ + GAME, + /** * This mode indicates that the user is waiting for loading in a game. */ -- GitLab From 154fbf15198acb7ddb37126a914f0f5bf2e24510 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Thu, 13 Jan 2022 16:50:17 -0800 Subject: [PATCH 421/825] [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces Added SPDX-license-identifier-Apache-2.0 to: sensors/aidl/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Change-Id: I6597543c2398a639c850f72bfe7013e9df2a2358 --- sensors/aidl/Android.bp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sensors/aidl/Android.bp b/sensors/aidl/Android.bp index 7324abf50d..92b7ad03d8 100644 --- a/sensors/aidl/Android.bp +++ b/sensors/aidl/Android.bp @@ -1,3 +1,12 @@ +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.sensors", vendor_available: true, -- GitLab From 59329712a917a4c4e81fffc0891063d0c5d96fff Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Thu, 13 Jan 2022 07:59:37 -0800 Subject: [PATCH 422/825] Update VTS to use ExternalTexture impl We want to expose GraphicBuffer properties via ExternalTexture class and within, SurfaceFlinger access the buffer via this proxy interface. This allows us to inject and mock GraphicBuffers as needed. Specifically this will be used to recreate layer state from transaction traces. Test: compiles Bug: 200284593 Change-Id: If2b6c43bb5b302fbc49dfa49d6ac1f79f92f30f7 --- graphics/composer/2.2/utils/vts/ReadbackVts.cpp | 5 +++-- .../composer/2.2/utils/vts/RenderEngineVts.cpp | 5 +++-- .../vts/functional/composer-vts/ReadbackVts.cpp | 14 ++++++++------ .../functional/composer-vts/RenderEngineVts.cpp | 5 +++-- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/graphics/composer/2.2/utils/vts/ReadbackVts.cpp b/graphics/composer/2.2/utils/vts/ReadbackVts.cpp index 30596fc4c9..a1794afeed 100644 --- a/graphics/composer/2.2/utils/vts/ReadbackVts.cpp +++ b/graphics/composer/2.2/utils/vts/ReadbackVts.cpp @@ -17,6 +17,7 @@ #include #include #include "renderengine/ExternalTexture.h" +#include "renderengine/impl/ExternalTexture.h" namespace android { namespace hardware { @@ -281,11 +282,11 @@ void TestBufferLayer::write(const std::shared_ptr& writer) { LayerSettings TestBufferLayer::toRenderEngineLayerSettings() { LayerSettings layerSettings = TestLayer::toRenderEngineLayerSettings(); - layerSettings.source.buffer.buffer = std::make_shared( + layerSettings.source.buffer.buffer = std::make_shared( new GraphicBuffer(mBufferHandle->get(), GraphicBuffer::CLONE_HANDLE, mWidth, mHeight, static_cast(mFormat), 1, mUsage, mStride), mRenderEngine.getInternalRenderEngine(), - renderengine::ExternalTexture::Usage::READABLE); + renderengine::impl::ExternalTexture::Usage::READABLE); layerSettings.source.buffer.usePremultipliedAlpha = mBlendMode == IComposerClient::BlendMode::PREMULTIPLIED; diff --git a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp index 2d4cc7d80e..4a33fb5b42 100644 --- a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp +++ b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp @@ -15,6 +15,7 @@ */ #include +#include "renderengine/impl/ExternalTexture.h" namespace android { namespace hardware { @@ -68,8 +69,8 @@ void TestRenderEngine::drawLayers() { [](renderengine::LayerSettings& settings) -> renderengine::LayerSettings { return settings; }); - auto texture = std::make_shared( - mGraphicBuffer, *mRenderEngine, renderengine::ExternalTexture::Usage::WRITEABLE); + auto texture = std::make_shared( + mGraphicBuffer, *mRenderEngine, renderengine::impl::ExternalTexture::Usage::WRITEABLE); auto [status, readyFence] = mRenderEngine ->drawLayers(mDisplaySettings, compositionLayers, texture, true, std::move(bufferFence)) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp index 5eb912bb3f..c5e4268e6b 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp @@ -22,6 +22,7 @@ #include #include "include/RenderEngineVts.h" #include "renderengine/ExternalTexture.h" +#include "renderengine/impl/ExternalTexture.h" // TODO(b/129481165): remove the #pragma below and fix conversion issues #pragma clang diagnostic pop // ignored "-Wconversion @@ -306,12 +307,13 @@ void TestBufferLayer::write(ComposerClientWriter& writer) { LayerSettings TestBufferLayer::toRenderEngineLayerSettings() { LayerSettings layerSettings = TestLayer::toRenderEngineLayerSettings(); - layerSettings.source.buffer.buffer = std::make_shared<::android::renderengine::ExternalTexture>( - ::android::sp<::android::GraphicBuffer>::make( - mGraphicBuffer->handle, ::android::GraphicBuffer::CLONE_HANDLE, mWidth, mHeight, - static_cast(mPixelFormat), 1, mUsage, mStride), - mRenderEngine.getInternalRenderEngine(), - ::android::renderengine::ExternalTexture::Usage::READABLE); + layerSettings.source.buffer.buffer = + std::make_shared<::android::renderengine::impl::ExternalTexture>( + ::android::sp<::android::GraphicBuffer>::make( + mGraphicBuffer->handle, ::android::GraphicBuffer::CLONE_HANDLE, mWidth, + mHeight, static_cast(mPixelFormat), 1, mUsage, mStride), + mRenderEngine.getInternalRenderEngine(), + ::android::renderengine::impl::ExternalTexture::Usage::READABLE); layerSettings.source.buffer.usePremultipliedAlpha = mBlendMode == BlendMode::PREMULTIPLIED; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp index 50ce462459..6ff064f93c 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp @@ -15,6 +15,7 @@ */ #include "include/RenderEngineVts.h" +#include "renderengine/impl/ExternalTexture.h" namespace aidl::android::hardware::graphics::composer3::vts { @@ -62,9 +63,9 @@ void TestRenderEngine::drawLayers() { std::back_insert_iterator(compositionLayers), [](::android::renderengine::LayerSettings& settings) -> ::android::renderengine::LayerSettings { return settings; }); - auto texture = std::make_shared<::android::renderengine::ExternalTexture>( + auto texture = std::make_shared<::android::renderengine::impl::ExternalTexture>( mGraphicBuffer, *mRenderEngine, - ::android::renderengine::ExternalTexture::Usage::WRITEABLE); + ::android::renderengine::impl::ExternalTexture::Usage::WRITEABLE); auto [status, readyFence] = mRenderEngine ->drawLayers(mDisplaySettings, compositionLayers, texture, true, std::move(bufferFence)) -- GitLab From 9918ede8cec4bcaec76d32dc963177897ce46fae Mon Sep 17 00:00:00 2001 From: Ling Ma Date: Thu, 13 Jan 2022 19:55:45 +0000 Subject: [PATCH 423/825] Add ApnType.ENTERPRISE Test: build succeed Bug: 214240937 Change-Id: I718ff225c7fc9b9667f6360ae623e5d8bbf1f03c --- .../android/hardware/radio/data/ApnTypes.aidl | 3 +++ radio/aidl/android/hardware/radio/data/ApnTypes.aidl | 12 ++++++++++++ 2 files changed, 15 insertions(+) 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 6982d404bd..980b042cdf 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 @@ -47,4 +47,7 @@ enum ApnTypes { EMERGENCY = 512, MCX = 1024, XCAP = 2048, + VSIM = 4096, + BIP = 8192, + ENTERPRISE = 16384, } diff --git a/radio/aidl/android/hardware/radio/data/ApnTypes.aidl b/radio/aidl/android/hardware/radio/data/ApnTypes.aidl index e780d8ee6b..ae103fc7e5 100644 --- a/radio/aidl/android/hardware/radio/data/ApnTypes.aidl +++ b/radio/aidl/android/hardware/radio/data/ApnTypes.aidl @@ -73,4 +73,16 @@ enum ApnTypes { * APN type for XCAP */ XCAP = 1 << 11, + /** + * APN type for VSIM. + */ + VSIM = 1 << 12, + /** + * APN type for BIP. + */ + BIP = 1 << 13, + /** + * APN type for ENTERPRISE + */ + ENTERPRISE = 1 << 14 } -- GitLab From aae30614d6efec7e7c7aea61845b06e9b583087d Mon Sep 17 00:00:00 2001 From: Greg Kaiser Date: Fri, 14 Jan 2022 07:54:49 -0800 Subject: [PATCH 424/825] VtsAidlHalSensorsTargetTest: Fix assignment To make this assignment have an impact outside the function, we need to assign to the dereference of the pointer. Test: TreeHugger Bug: 195593357 Change-Id: I3541735574d6ebe2f2620c2bc5fbf5dd7d97cd91 --- sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp index 608a4b0c4c..1bc7263048 100644 --- a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp +++ b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp @@ -978,7 +978,7 @@ void SensorsAidlTest::verifyRegisterDirectChannel( ASSERT_EQ(status.getExceptionCode(), error); ASSERT_EQ(channelHandle, -1); } - directChannelHandle = &channelHandle; + *directChannelHandle = channelHandle; } void SensorsAidlTest::verifyUnregisterDirectChannel(int32_t* channelHandle, -- GitLab From bd838b8b5e673451e5ac85131d6cb119960d2fce Mon Sep 17 00:00:00 2001 From: Tyler Trephan Date: Thu, 13 Jan 2022 22:52:53 +0000 Subject: [PATCH 425/825] Moved implementation of ConvertUtils to cpp file. Test: make android.hardware.sensors@aidl-multihal Bug: 206867060 Change-Id: I73e8d061bdfe39f956acda1cf9b138da2dcc1f22 --- sensors/aidl/default/multihal/Android.bp | 1 + .../aidl/default/multihal/ConvertUtils.cpp | 321 ++++++++++++++ .../default/multihal/include/ConvertUtils.h | 406 +----------------- 3 files changed, 339 insertions(+), 389 deletions(-) create mode 100644 sensors/aidl/default/multihal/ConvertUtils.cpp diff --git a/sensors/aidl/default/multihal/Android.bp b/sensors/aidl/default/multihal/Android.bp index a7f6af2df2..eee10625bb 100644 --- a/sensors/aidl/default/multihal/Android.bp +++ b/sensors/aidl/default/multihal/Android.bp @@ -43,6 +43,7 @@ cc_library_static { export_include_dirs: ["include"], srcs: [ "HalProxyAidl.cpp", + "ConvertUtils.cpp", ], visibility: [ ":__subpackages__", diff --git a/sensors/aidl/default/multihal/ConvertUtils.cpp b/sensors/aidl/default/multihal/ConvertUtils.cpp new file mode 100644 index 0000000000..4d6697be3e --- /dev/null +++ b/sensors/aidl/default/multihal/ConvertUtils.cpp @@ -0,0 +1,321 @@ +/* + * 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 "ConvertUtils.h" +#include +#include + +using AidlSensorInfo = ::aidl::android::hardware::sensors::SensorInfo; +using AidlSensorType = ::aidl::android::hardware::sensors::SensorType; +using AidlEvent = ::aidl::android::hardware::sensors::Event; +using AidlSensorStatus = ::aidl::android::hardware::sensors::SensorStatus; +using ::aidl::android::hardware::sensors::AdditionalInfo; +using ::aidl::android::hardware::sensors::DynamicSensorInfo; +using ::android::hardware::sensors::V1_0::MetaDataEventType; +using V1_0SensorStatus = ::android::hardware::sensors::V1_0::SensorStatus; +using ::android::hardware::sensors::V1_0::AdditionalInfoType; +using V2_1SensorInfo = ::android::hardware::sensors::V2_1::SensorInfo; +using V2_1Event = ::android::hardware::sensors::V2_1::Event; +using V2_1SensorType = ::android::hardware::sensors::V2_1::SensorType; + +namespace aidl { +namespace android { +namespace hardware { +namespace sensors { +namespace implementation { + +AidlSensorInfo convertSensorInfo(const V2_1SensorInfo& sensorInfo) { + AidlSensorInfo aidlSensorInfo; + aidlSensorInfo.sensorHandle = sensorInfo.sensorHandle; + aidlSensorInfo.name = sensorInfo.name; + aidlSensorInfo.vendor = sensorInfo.vendor; + aidlSensorInfo.version = sensorInfo.version; + aidlSensorInfo.type = (AidlSensorType)sensorInfo.type; + aidlSensorInfo.typeAsString = sensorInfo.typeAsString; + aidlSensorInfo.maxRange = sensorInfo.maxRange; + aidlSensorInfo.resolution = sensorInfo.resolution; + aidlSensorInfo.power = sensorInfo.power; + aidlSensorInfo.minDelayUs = sensorInfo.minDelay; + aidlSensorInfo.fifoReservedEventCount = sensorInfo.fifoReservedEventCount; + aidlSensorInfo.fifoMaxEventCount = sensorInfo.fifoMaxEventCount; + aidlSensorInfo.requiredPermission = sensorInfo.requiredPermission; + aidlSensorInfo.maxDelayUs = sensorInfo.maxDelay; + aidlSensorInfo.flags = sensorInfo.flags; + return aidlSensorInfo; +} + +void convertToHidlEvent(const AidlEvent& aidlEvent, V2_1Event* hidlEvent) { + hidlEvent->timestamp = aidlEvent.timestamp; + hidlEvent->sensorHandle = aidlEvent.sensorHandle; + hidlEvent->sensorType = (V2_1SensorType)aidlEvent.sensorType; + + switch (aidlEvent.sensorType) { + case AidlSensorType::META_DATA: + hidlEvent->u.meta.what = + (MetaDataEventType)aidlEvent.payload.get().what; + break; + case AidlSensorType::ACCELEROMETER: + case AidlSensorType::MAGNETIC_FIELD: + case AidlSensorType::ORIENTATION: + case AidlSensorType::GYROSCOPE: + case AidlSensorType::GRAVITY: + case AidlSensorType::LINEAR_ACCELERATION: + hidlEvent->u.vec3.x = aidlEvent.payload.get().x; + hidlEvent->u.vec3.y = aidlEvent.payload.get().y; + hidlEvent->u.vec3.z = aidlEvent.payload.get().z; + break; + case AidlSensorType::GAME_ROTATION_VECTOR: + hidlEvent->u.vec4.x = aidlEvent.payload.get().x; + hidlEvent->u.vec4.y = aidlEvent.payload.get().y; + hidlEvent->u.vec4.z = aidlEvent.payload.get().z; + hidlEvent->u.vec4.w = aidlEvent.payload.get().w; + break; + case AidlSensorType::ROTATION_VECTOR: + case AidlSensorType::GEOMAGNETIC_ROTATION_VECTOR: + std::copy(aidlEvent.payload.get().values.data(), + aidlEvent.payload.get().values.data() + 5, + hidlEvent->u.data.data()); + break; + case AidlSensorType::ACCELEROMETER_UNCALIBRATED: + case AidlSensorType::MAGNETIC_FIELD_UNCALIBRATED: + case AidlSensorType::GYROSCOPE_UNCALIBRATED: + hidlEvent->u.uncal.x = aidlEvent.payload.get().x; + hidlEvent->u.uncal.y = aidlEvent.payload.get().y; + hidlEvent->u.uncal.z = aidlEvent.payload.get().z; + hidlEvent->u.uncal.x_bias = aidlEvent.payload.get().xBias; + hidlEvent->u.uncal.y_bias = aidlEvent.payload.get().yBias; + hidlEvent->u.uncal.z_bias = aidlEvent.payload.get().zBias; + break; + case AidlSensorType::DEVICE_ORIENTATION: + case AidlSensorType::LIGHT: + case AidlSensorType::PRESSURE: + case AidlSensorType::PROXIMITY: + case AidlSensorType::RELATIVE_HUMIDITY: + case AidlSensorType::AMBIENT_TEMPERATURE: + case AidlSensorType::SIGNIFICANT_MOTION: + case AidlSensorType::STEP_DETECTOR: + case AidlSensorType::TILT_DETECTOR: + case AidlSensorType::WAKE_GESTURE: + case AidlSensorType::GLANCE_GESTURE: + case AidlSensorType::PICK_UP_GESTURE: + case AidlSensorType::WRIST_TILT_GESTURE: + case AidlSensorType::STATIONARY_DETECT: + case AidlSensorType::MOTION_DETECT: + case AidlSensorType::HEART_BEAT: + case AidlSensorType::LOW_LATENCY_OFFBODY_DETECT: + case AidlSensorType::HINGE_ANGLE: + hidlEvent->u.scalar = aidlEvent.payload.get(); + break; + case AidlSensorType::STEP_COUNTER: + hidlEvent->u.stepCount = aidlEvent.payload.get(); + break; + case AidlSensorType::HEART_RATE: + hidlEvent->u.heartRate.bpm = + aidlEvent.payload.get().bpm; + hidlEvent->u.heartRate.status = + (V1_0SensorStatus)aidlEvent.payload.get() + .status; + break; + case AidlSensorType::POSE_6DOF: + std::copy(std::begin(aidlEvent.payload.get().values), + std::end(aidlEvent.payload.get().values), + hidlEvent->u.pose6DOF.data()); + break; + case AidlSensorType::DYNAMIC_SENSOR_META: + hidlEvent->u.dynamic.connected = + aidlEvent.payload.get().connected; + hidlEvent->u.dynamic.sensorHandle = + aidlEvent.payload.get().sensorHandle; + std::copy( + std::begin( + aidlEvent.payload.get().uuid.values), + std::end(aidlEvent.payload.get().uuid.values), + hidlEvent->u.dynamic.uuid.data()); + break; + case AidlSensorType::ADDITIONAL_INFO: { + const AdditionalInfo& additionalInfo = + aidlEvent.payload.get(); + hidlEvent->u.additional.type = (AdditionalInfoType)additionalInfo.type; + hidlEvent->u.additional.serial = additionalInfo.serial; + + switch (additionalInfo.payload.getTag()) { + case AdditionalInfo::AdditionalInfoPayload::Tag::dataInt32: { + const auto& aidlData = + additionalInfo.payload + .get() + .values; + std::copy(std::begin(aidlData), std::end(aidlData), + hidlEvent->u.additional.u.data_int32.data()); + break; + } + case AdditionalInfo::AdditionalInfoPayload::Tag::dataFloat: { + const auto& aidlData = + additionalInfo.payload + .get() + .values; + std::copy(std::begin(aidlData), std::end(aidlData), + hidlEvent->u.additional.u.data_float.data()); + break; + } + default: + ALOGE("Invalid sensor additioanl info tag: %d", + additionalInfo.payload.getTag()); + break; + } + break; + } + default: + CHECK_GE((int32_t)aidlEvent.sensorType, (int32_t)SensorType::DEVICE_PRIVATE_BASE); + std::copy(std::begin(aidlEvent.payload.get().values), + std::end(aidlEvent.payload.get().values), + hidlEvent->u.data.data()); + break; + } +} + +void convertToAidlEvent(const V2_1Event& hidlEvent, AidlEvent* aidlEvent) { + aidlEvent->timestamp = hidlEvent.timestamp; + aidlEvent->sensorHandle = hidlEvent.sensorHandle; + aidlEvent->sensorType = (AidlSensorType)hidlEvent.sensorType; + switch (hidlEvent.sensorType) { + case V2_1SensorType::META_DATA: { + AidlEvent::EventPayload::MetaData meta; + meta.what = (Event::EventPayload::MetaData::MetaDataEventType)hidlEvent.u.meta.what; + aidlEvent->payload.set(meta); + break; + } + case V2_1SensorType::ACCELEROMETER: + case V2_1SensorType::MAGNETIC_FIELD: + case V2_1SensorType::ORIENTATION: + case V2_1SensorType::GYROSCOPE: + case V2_1SensorType::GRAVITY: + case V2_1SensorType::LINEAR_ACCELERATION: { + AidlEvent::EventPayload::Vec3 vec3; + vec3.x = hidlEvent.u.vec3.x; + vec3.y = hidlEvent.u.vec3.y; + vec3.z = hidlEvent.u.vec3.z; + aidlEvent->payload.set(vec3); + break; + } + case V2_1SensorType::GAME_ROTATION_VECTOR: { + AidlEvent::EventPayload::Vec4 vec4; + vec4.x = hidlEvent.u.vec4.x; + vec4.y = hidlEvent.u.vec4.y; + vec4.z = hidlEvent.u.vec4.z; + vec4.w = hidlEvent.u.vec4.w; + aidlEvent->payload.set(vec4); + break; + } + case V2_1SensorType::ROTATION_VECTOR: + case V2_1SensorType::GEOMAGNETIC_ROTATION_VECTOR: { + AidlEvent::EventPayload::Data data; + std::copy(hidlEvent.u.data.data(), hidlEvent.u.data.data() + 5, + std::begin(data.values)); + aidlEvent->payload.set(data); + break; + } + case V2_1SensorType::MAGNETIC_FIELD_UNCALIBRATED: + case V2_1SensorType::GYROSCOPE_UNCALIBRATED: + case V2_1SensorType::ACCELEROMETER_UNCALIBRATED: { + AidlEvent::EventPayload::Uncal uncal; + uncal.x = hidlEvent.u.uncal.x; + uncal.y = hidlEvent.u.uncal.y; + uncal.z = hidlEvent.u.uncal.z; + uncal.xBias = hidlEvent.u.uncal.x_bias; + uncal.yBias = hidlEvent.u.uncal.y_bias; + uncal.zBias = hidlEvent.u.uncal.z_bias; + aidlEvent->payload.set(uncal); + break; + } + case V2_1SensorType::DEVICE_ORIENTATION: + case V2_1SensorType::LIGHT: + case V2_1SensorType::PRESSURE: + case V2_1SensorType::PROXIMITY: + case V2_1SensorType::RELATIVE_HUMIDITY: + case V2_1SensorType::AMBIENT_TEMPERATURE: + case V2_1SensorType::SIGNIFICANT_MOTION: + case V2_1SensorType::STEP_DETECTOR: + case V2_1SensorType::TILT_DETECTOR: + case V2_1SensorType::WAKE_GESTURE: + case V2_1SensorType::GLANCE_GESTURE: + case V2_1SensorType::PICK_UP_GESTURE: + case V2_1SensorType::WRIST_TILT_GESTURE: + case V2_1SensorType::STATIONARY_DETECT: + case V2_1SensorType::MOTION_DETECT: + case V2_1SensorType::HEART_BEAT: + case V2_1SensorType::LOW_LATENCY_OFFBODY_DETECT: + case V2_1SensorType::HINGE_ANGLE: + aidlEvent->payload.set(hidlEvent.u.scalar); + break; + case V2_1SensorType::STEP_COUNTER: + aidlEvent->payload.set(hidlEvent.u.stepCount); + break; + case V2_1SensorType::HEART_RATE: { + AidlEvent::EventPayload::HeartRate heartRate; + heartRate.bpm = hidlEvent.u.heartRate.bpm; + heartRate.status = (SensorStatus)hidlEvent.u.heartRate.status; + aidlEvent->payload.set(heartRate); + break; + } + case V2_1SensorType::POSE_6DOF: { + AidlEvent::EventPayload::Pose6Dof pose6Dof; + std::copy(hidlEvent.u.pose6DOF.data(), + hidlEvent.u.pose6DOF.data() + hidlEvent.u.pose6DOF.size(), + std::begin(pose6Dof.values)); + aidlEvent->payload.set(pose6Dof); + break; + } + case V2_1SensorType::DYNAMIC_SENSOR_META: { + DynamicSensorInfo dynamicSensorInfo; + dynamicSensorInfo.connected = hidlEvent.u.dynamic.connected; + dynamicSensorInfo.sensorHandle = hidlEvent.u.dynamic.sensorHandle; + std::copy(hidlEvent.u.dynamic.uuid.data(), + hidlEvent.u.dynamic.uuid.data() + hidlEvent.u.dynamic.uuid.size(), + std::begin(dynamicSensorInfo.uuid.values)); + aidlEvent->payload.set(dynamicSensorInfo); + break; + } + case V2_1SensorType::ADDITIONAL_INFO: { + AdditionalInfo additionalInfo; + additionalInfo.type = (AdditionalInfo::AdditionalInfoType)hidlEvent.u.additional.type; + additionalInfo.serial = hidlEvent.u.additional.serial; + + AdditionalInfo::AdditionalInfoPayload::Int32Values int32Values; + std::copy(hidlEvent.u.additional.u.data_int32.data(), + hidlEvent.u.additional.u.data_int32.data() + + hidlEvent.u.additional.u.data_int32.size(), + std::begin(int32Values.values)); + additionalInfo.payload.set( + int32Values); + aidlEvent->payload.set(additionalInfo); + break; + } + default: { + CHECK_GE((int32_t)hidlEvent.sensorType, (int32_t)V2_1SensorType::DEVICE_PRIVATE_BASE); + AidlEvent::EventPayload::Data data; + std::copy(hidlEvent.u.data.data(), hidlEvent.u.data.data() + hidlEvent.u.data.size(), + std::begin(data.values)); + aidlEvent->payload.set(data); + break; + } + } +} + +} // namespace implementation +} // namespace sensors +} // namespace hardware +} // namespace android +} // namespace aidl \ No newline at end of file diff --git a/sensors/aidl/default/multihal/include/ConvertUtils.h b/sensors/aidl/default/multihal/include/ConvertUtils.h index 09ec0dc144..91dfabde3a 100644 --- a/sensors/aidl/default/multihal/include/ConvertUtils.h +++ b/sensors/aidl/default/multihal/include/ConvertUtils.h @@ -16,7 +16,8 @@ #pragma once -#include +#include +#include namespace aidl { namespace android { @@ -24,396 +25,23 @@ namespace hardware { namespace sensors { namespace implementation { -static ::aidl::android::hardware::sensors::SensorInfo convertSensorInfo( - const ::android::hardware::sensors::V2_1::SensorInfo& sensorInfo) { - ::aidl::android::hardware::sensors::SensorInfo aidlSensorInfo; - aidlSensorInfo.sensorHandle = sensorInfo.sensorHandle; - aidlSensorInfo.name = sensorInfo.name; - aidlSensorInfo.vendor = sensorInfo.vendor; - aidlSensorInfo.version = sensorInfo.version; - aidlSensorInfo.type = (::aidl::android::hardware::sensors::SensorType)sensorInfo.type; - aidlSensorInfo.typeAsString = sensorInfo.typeAsString; - aidlSensorInfo.maxRange = sensorInfo.maxRange; - aidlSensorInfo.resolution = sensorInfo.resolution; - aidlSensorInfo.power = sensorInfo.power; - aidlSensorInfo.minDelayUs = sensorInfo.minDelay; - aidlSensorInfo.fifoReservedEventCount = sensorInfo.fifoReservedEventCount; - aidlSensorInfo.fifoMaxEventCount = sensorInfo.fifoMaxEventCount; - aidlSensorInfo.requiredPermission = sensorInfo.requiredPermission; - aidlSensorInfo.maxDelayUs = sensorInfo.maxDelay; - aidlSensorInfo.flags = sensorInfo.flags; - return aidlSensorInfo; -} - -static void convertToHidlEvent(const ::aidl::android::hardware::sensors::Event& aidlEvent, - ::android::hardware::sensors::V2_1::Event* hidlEvent) { - hidlEvent->timestamp = aidlEvent.timestamp; - hidlEvent->sensorHandle = aidlEvent.sensorHandle; - hidlEvent->sensorType = (::android::hardware::sensors::V2_1::SensorType)aidlEvent.sensorType; - - switch (aidlEvent.sensorType) { - case ::aidl::android::hardware::sensors::SensorType::META_DATA: - hidlEvent->u.meta.what = - (::android::hardware::sensors::V1_0::MetaDataEventType)aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::meta>() - .what; - break; - case ::aidl::android::hardware::sensors::SensorType::ACCELEROMETER: - case ::aidl::android::hardware::sensors::SensorType::MAGNETIC_FIELD: - case ::aidl::android::hardware::sensors::SensorType::ORIENTATION: - case ::aidl::android::hardware::sensors::SensorType::GYROSCOPE: - case ::aidl::android::hardware::sensors::SensorType::GRAVITY: - case ::aidl::android::hardware::sensors::SensorType::LINEAR_ACCELERATION: - hidlEvent->u.vec3.x = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::vec3>() - .x; - hidlEvent->u.vec3.y = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::vec3>() - .y; - hidlEvent->u.vec3.z = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::vec3>() - .z; - break; - case ::aidl::android::hardware::sensors::SensorType::GAME_ROTATION_VECTOR: - hidlEvent->u.vec4.x = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::vec4>() - .x; - hidlEvent->u.vec4.y = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::vec4>() - .y; - hidlEvent->u.vec4.z = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::vec4>() - .z; - hidlEvent->u.vec4.w = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::vec4>() - .w; - break; - case ::aidl::android::hardware::sensors::SensorType::ROTATION_VECTOR: - case ::aidl::android::hardware::sensors::SensorType::GEOMAGNETIC_ROTATION_VECTOR: - std::copy(aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::data>() - .values.data(), - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload:: - data>() - .values.data() + - 5, - hidlEvent->u.data.data()); - break; - case ::aidl::android::hardware::sensors::SensorType::ACCELEROMETER_UNCALIBRATED: - case ::aidl::android::hardware::sensors::SensorType::MAGNETIC_FIELD_UNCALIBRATED: - case ::aidl::android::hardware::sensors::SensorType::GYROSCOPE_UNCALIBRATED: - hidlEvent->u.uncal.x = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::uncal>() - .x; - hidlEvent->u.uncal.y = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::uncal>() - .y; - hidlEvent->u.uncal.z = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::uncal>() - .z; - hidlEvent->u.uncal.x_bias = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::uncal>() - .xBias; - hidlEvent->u.uncal.y_bias = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::uncal>() - .yBias; - hidlEvent->u.uncal.z_bias = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::uncal>() - .zBias; - break; - case ::aidl::android::hardware::sensors::SensorType::DEVICE_ORIENTATION: - case ::aidl::android::hardware::sensors::SensorType::LIGHT: - case ::aidl::android::hardware::sensors::SensorType::PRESSURE: - case ::aidl::android::hardware::sensors::SensorType::PROXIMITY: - case ::aidl::android::hardware::sensors::SensorType::RELATIVE_HUMIDITY: - case ::aidl::android::hardware::sensors::SensorType::AMBIENT_TEMPERATURE: - case ::aidl::android::hardware::sensors::SensorType::SIGNIFICANT_MOTION: - case ::aidl::android::hardware::sensors::SensorType::STEP_DETECTOR: - case ::aidl::android::hardware::sensors::SensorType::TILT_DETECTOR: - case ::aidl::android::hardware::sensors::SensorType::WAKE_GESTURE: - case ::aidl::android::hardware::sensors::SensorType::GLANCE_GESTURE: - case ::aidl::android::hardware::sensors::SensorType::PICK_UP_GESTURE: - case ::aidl::android::hardware::sensors::SensorType::WRIST_TILT_GESTURE: - case ::aidl::android::hardware::sensors::SensorType::STATIONARY_DETECT: - case ::aidl::android::hardware::sensors::SensorType::MOTION_DETECT: - case ::aidl::android::hardware::sensors::SensorType::HEART_BEAT: - case ::aidl::android::hardware::sensors::SensorType::LOW_LATENCY_OFFBODY_DETECT: - case ::aidl::android::hardware::sensors::SensorType::HINGE_ANGLE: - hidlEvent->u.scalar = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::scalar>(); - break; - case ::aidl::android::hardware::sensors::SensorType::STEP_COUNTER: - hidlEvent->u.stepCount = aidlEvent.payload.get< - ::aidl::android::hardware::sensors::Event::EventPayload::stepCount>(); - break; - case ::aidl::android::hardware::sensors::SensorType::HEART_RATE: - hidlEvent->u.heartRate.bpm = aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event:: - EventPayload::heartRate>() - .bpm; - hidlEvent->u.heartRate.status = - (::android::hardware::sensors::V1_0::SensorStatus)aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload:: - heartRate>() - .status; - break; - case ::aidl::android::hardware::sensors::SensorType::POSE_6DOF: - std::copy(std::begin(aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event:: - EventPayload::pose6DOF>() - .values), - std::end(aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event:: - EventPayload::data>() - .values), - hidlEvent->u.pose6DOF.data()); - break; - case ::aidl::android::hardware::sensors::SensorType::DYNAMIC_SENSOR_META: - hidlEvent->u.dynamic.connected = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::dynamic>() - .connected; - hidlEvent->u.dynamic.sensorHandle = - aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event::EventPayload::dynamic>() - .sensorHandle; - std::copy(std::begin(aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event:: - EventPayload::dynamic>() - .uuid.values), - std::end(aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event:: - EventPayload::dynamic>() - .uuid.values), - hidlEvent->u.dynamic.uuid.data()); - break; - case ::aidl::android::hardware::sensors::SensorType::ADDITIONAL_INFO: { - const AdditionalInfo& additionalInfo = aidlEvent.payload.get< - ::aidl::android::hardware::sensors::Event::EventPayload::additional>(); - hidlEvent->u.additional.type = - (::android::hardware::sensors::V1_0::AdditionalInfoType)additionalInfo.type; - hidlEvent->u.additional.serial = additionalInfo.serial; - - switch (additionalInfo.payload.getTag()) { - case ::aidl::android::hardware::sensors::AdditionalInfo::AdditionalInfoPayload:: - Tag::dataInt32: - std::copy( - std::begin(additionalInfo.payload - .get<::aidl::android::hardware::sensors:: - AdditionalInfo::AdditionalInfoPayload:: - dataInt32>() - .values), - std::end(additionalInfo.payload - .get<::aidl::android::hardware::sensors:: - AdditionalInfo::AdditionalInfoPayload:: - dataInt32>() - .values), - hidlEvent->u.additional.u.data_int32.data()); - break; - case ::aidl::android::hardware::sensors::AdditionalInfo::AdditionalInfoPayload:: - Tag::dataFloat: - std::copy( - std::begin(additionalInfo.payload - .get<::aidl::android::hardware::sensors:: - AdditionalInfo::AdditionalInfoPayload:: - dataFloat>() - .values), - std::end(additionalInfo.payload - .get<::aidl::android::hardware::sensors:: - AdditionalInfo::AdditionalInfoPayload:: - dataFloat>() - .values), - hidlEvent->u.additional.u.data_float.data()); - break; - default: - ALOGE("Invalid sensor additioanl info tag: %d", - additionalInfo.payload.getTag()); - break; - } - break; - } - default: - CHECK_GE((int32_t)aidlEvent.sensorType, - (int32_t)::aidl::android::hardware::sensors::SensorType::DEVICE_PRIVATE_BASE); - std::copy(std::begin(aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event:: - EventPayload::data>() - .values), - std::end(aidlEvent.payload - .get<::aidl::android::hardware::sensors::Event:: - EventPayload::data>() - .values), - hidlEvent->u.data.data()); - break; - } -} +/** + * Generates an AIDL SensorInfo instance from the passed HIDL V2.1 SensorInfo instance. + */ +::aidl::android::hardware::sensors::SensorInfo convertSensorInfo( + const ::android::hardware::sensors::V2_1::SensorInfo& sensorInfo); -static void convertToAidlEvent(const ::android::hardware::sensors::V2_1::Event& hidlEvent, - ::aidl::android::hardware::sensors::Event* aidlEvent) { - aidlEvent->timestamp = hidlEvent.timestamp; - aidlEvent->sensorHandle = hidlEvent.sensorHandle; - aidlEvent->sensorType = (::aidl::android::hardware::sensors::SensorType)hidlEvent.sensorType; - switch (hidlEvent.sensorType) { - case ::android::hardware::sensors::V2_1::SensorType::META_DATA: { - ::aidl::android::hardware::sensors::Event::EventPayload::MetaData meta; - meta.what = (::aidl::android::hardware::sensors::Event::EventPayload::MetaData:: - MetaDataEventType)hidlEvent.u.meta.what; - aidlEvent->payload.set<::aidl::android::hardware::sensors::Event::EventPayload::meta>( - meta); - break; - } - case ::android::hardware::sensors::V2_1::SensorType::ACCELEROMETER: - case ::android::hardware::sensors::V2_1::SensorType::MAGNETIC_FIELD: - case ::android::hardware::sensors::V2_1::SensorType::ORIENTATION: - case ::android::hardware::sensors::V2_1::SensorType::GYROSCOPE: - case ::android::hardware::sensors::V2_1::SensorType::GRAVITY: - case ::android::hardware::sensors::V2_1::SensorType::LINEAR_ACCELERATION: { - ::aidl::android::hardware::sensors::Event::EventPayload::Vec3 vec3; - vec3.x = hidlEvent.u.vec3.x; - vec3.y = hidlEvent.u.vec3.y; - vec3.z = hidlEvent.u.vec3.z; - aidlEvent->payload.set<::aidl::android::hardware::sensors::Event::EventPayload::vec3>( - vec3); - break; - } - case ::android::hardware::sensors::V2_1::SensorType::GAME_ROTATION_VECTOR: { - ::aidl::android::hardware::sensors::Event::EventPayload::Vec4 vec4; - vec4.x = hidlEvent.u.vec4.x; - vec4.y = hidlEvent.u.vec4.y; - vec4.z = hidlEvent.u.vec4.z; - vec4.w = hidlEvent.u.vec4.w; - aidlEvent->payload.set<::aidl::android::hardware::sensors::Event::EventPayload::vec4>( - vec4); - break; - } - case ::android::hardware::sensors::V2_1::SensorType::ROTATION_VECTOR: - case ::android::hardware::sensors::V2_1::SensorType::GEOMAGNETIC_ROTATION_VECTOR: { - ::aidl::android::hardware::sensors::Event::EventPayload::Data data; - std::copy(hidlEvent.u.data.data(), hidlEvent.u.data.data() + 5, - std::begin(data.values)); - aidlEvent->payload.set<::aidl::android::hardware::sensors::Event::EventPayload::data>( - data); - break; - } - case ::android::hardware::sensors::V2_1::SensorType::MAGNETIC_FIELD_UNCALIBRATED: - case ::android::hardware::sensors::V2_1::SensorType::GYROSCOPE_UNCALIBRATED: - case ::android::hardware::sensors::V2_1::SensorType::ACCELEROMETER_UNCALIBRATED: { - ::aidl::android::hardware::sensors::Event::EventPayload::Uncal uncal; - uncal.x = hidlEvent.u.uncal.x; - uncal.y = hidlEvent.u.uncal.y; - uncal.z = hidlEvent.u.uncal.z; - uncal.xBias = hidlEvent.u.uncal.x_bias; - uncal.yBias = hidlEvent.u.uncal.y_bias; - uncal.zBias = hidlEvent.u.uncal.z_bias; - aidlEvent->payload.set<::aidl::android::hardware::sensors::Event::EventPayload::uncal>( - uncal); - break; - } - case ::android::hardware::sensors::V2_1::SensorType::DEVICE_ORIENTATION: - case ::android::hardware::sensors::V2_1::SensorType::LIGHT: - case ::android::hardware::sensors::V2_1::SensorType::PRESSURE: - case ::android::hardware::sensors::V2_1::SensorType::PROXIMITY: - case ::android::hardware::sensors::V2_1::SensorType::RELATIVE_HUMIDITY: - case ::android::hardware::sensors::V2_1::SensorType::AMBIENT_TEMPERATURE: - case ::android::hardware::sensors::V2_1::SensorType::SIGNIFICANT_MOTION: - case ::android::hardware::sensors::V2_1::SensorType::STEP_DETECTOR: - case ::android::hardware::sensors::V2_1::SensorType::TILT_DETECTOR: - case ::android::hardware::sensors::V2_1::SensorType::WAKE_GESTURE: - case ::android::hardware::sensors::V2_1::SensorType::GLANCE_GESTURE: - case ::android::hardware::sensors::V2_1::SensorType::PICK_UP_GESTURE: - case ::android::hardware::sensors::V2_1::SensorType::WRIST_TILT_GESTURE: - case ::android::hardware::sensors::V2_1::SensorType::STATIONARY_DETECT: - case ::android::hardware::sensors::V2_1::SensorType::MOTION_DETECT: - case ::android::hardware::sensors::V2_1::SensorType::HEART_BEAT: - case ::android::hardware::sensors::V2_1::SensorType::LOW_LATENCY_OFFBODY_DETECT: - case ::android::hardware::sensors::V2_1::SensorType::HINGE_ANGLE: - aidlEvent->payload.set<::aidl::android::hardware::sensors::Event::EventPayload::scalar>( - hidlEvent.u.scalar); - break; - case ::android::hardware::sensors::V2_1::SensorType::STEP_COUNTER: - aidlEvent->payload - .set<::aidl::android::hardware::sensors::Event::EventPayload::stepCount>( - hidlEvent.u.stepCount); - break; - case ::android::hardware::sensors::V2_1::SensorType::HEART_RATE: { - ::aidl::android::hardware::sensors::Event::EventPayload::HeartRate heartRate; - heartRate.bpm = hidlEvent.u.heartRate.bpm; - heartRate.status = - (::aidl::android::hardware::sensors::SensorStatus)hidlEvent.u.heartRate.status; - aidlEvent->payload - .set<::aidl::android::hardware::sensors::Event::EventPayload::heartRate>( - heartRate); - break; - } - case ::android::hardware::sensors::V2_1::SensorType::POSE_6DOF: { - ::aidl::android::hardware::sensors::Event::EventPayload::Pose6Dof pose6Dof; - std::copy(hidlEvent.u.pose6DOF.data(), - hidlEvent.u.pose6DOF.data() + hidlEvent.u.pose6DOF.size(), - std::begin(pose6Dof.values)); - aidlEvent->payload - .set<::aidl::android::hardware::sensors::Event::EventPayload::pose6DOF>( - pose6Dof); - break; - } - case ::android::hardware::sensors::V2_1::SensorType::DYNAMIC_SENSOR_META: { - ::aidl::android::hardware::sensors::DynamicSensorInfo dynamicSensorInfo; - dynamicSensorInfo.connected = hidlEvent.u.dynamic.connected; - dynamicSensorInfo.sensorHandle = hidlEvent.u.dynamic.sensorHandle; - std::copy(hidlEvent.u.dynamic.uuid.data(), - hidlEvent.u.dynamic.uuid.data() + hidlEvent.u.dynamic.uuid.size(), - std::begin(dynamicSensorInfo.uuid.values)); - aidlEvent->payload - .set<::aidl::android::hardware::sensors::Event::EventPayload::dynamic>( - dynamicSensorInfo); - break; - } - case ::android::hardware::sensors::V2_1::SensorType::ADDITIONAL_INFO: { - ::aidl::android::hardware::sensors::AdditionalInfo additionalInfo; - additionalInfo.type = - (::aidl::android::hardware::sensors::AdditionalInfo::AdditionalInfoType) - hidlEvent.u.additional.type; - additionalInfo.serial = hidlEvent.u.additional.serial; +/** + * Populates a HIDL V2.1 Event instance based on an AIDL Event instance. + */ +void convertToHidlEvent(const ::aidl::android::hardware::sensors::Event& aidlEvent, + ::android::hardware::sensors::V2_1::Event* hidlEvent); - ::aidl::android::hardware::sensors::AdditionalInfo::AdditionalInfoPayload::Int32Values - int32Values; - std::copy(hidlEvent.u.additional.u.data_int32.data(), - hidlEvent.u.additional.u.data_int32.data() + - hidlEvent.u.additional.u.data_int32.size(), - std::begin(int32Values.values)); - additionalInfo.payload.set<::aidl::android::hardware::sensors::AdditionalInfo:: - AdditionalInfoPayload::dataInt32>(int32Values); - aidlEvent->payload - .set<::aidl::android::hardware::sensors::Event::EventPayload::additional>( - additionalInfo); - break; - } - default: { - CHECK_GE((int32_t)hidlEvent.sensorType, - (int32_t)::android::hardware::sensors::V2_1::SensorType::DEVICE_PRIVATE_BASE); - ::aidl::android::hardware::sensors::Event::EventPayload::Data data; - std::copy(hidlEvent.u.data.data(), hidlEvent.u.data.data() + hidlEvent.u.data.size(), - std::begin(data.values)); - aidlEvent->payload.set<::aidl::android::hardware::sensors::Event::EventPayload::data>( - data); - break; - } - } -} +/** + * Populates an AIDL Event instance based on a HIDL V2.1 Event instance. + */ +void convertToAidlEvent(const ::android::hardware::sensors::V2_1::Event& hidlEvent, + ::aidl::android::hardware::sensors::Event* aidlEvent); } // namespace implementation } // namespace sensors -- GitLab From 95e490bf23c82407d8c21774cb0933b182b5e989 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Thu, 6 Jan 2022 13:46:58 -0800 Subject: [PATCH 426/825] Add VTS for setting layer white point No readback tests as of yet, as that will necessitate a new api to get the max display brightness, so that we can max out the brightness -> use well-defined dimming ratios Bug: 213493262 Test: builds Change-Id: I0166dc67f4c52919c02ab7abbf47701e6be3d983 --- .../VtsHalGraphicsComposer3_TargetTest.cpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 829b0ff66f..928e506c9e 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1922,6 +1922,27 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_PER_FRAME_METADATA) { EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk()); } +TEST_P(GraphicsComposerAidlCommandTest, setLayerWhitePointNits) { + int64_t layer; + EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); + + mWriter.setLayerWhitePointNits(mPrimaryDisplay, layer, 200.f); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerWhitePointNits(mPrimaryDisplay, layer, 1000.f); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerWhitePointNits(mPrimaryDisplay, layer, 0.f); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mWriter.setLayerWhitePointNits(mPrimaryDisplay, layer, -1.f); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); +} + TEST_P(GraphicsComposerAidlCommandTest, setActiveConfigWithConstraints) { Test_setActiveConfigWithConstraints({.delayForChange = 0, .refreshMiss = false}); } -- GitLab From 510670192afeb2de10e9f45584db6e5e060528d9 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Thu, 6 Jan 2022 17:28:39 -0800 Subject: [PATCH 427/825] Readback test support for per-layer dimming Dimming is only verified if setting display brightness is supported. The test then does: * Sets the display brightness to max, which is the same nit level that is found in the display xml file * Dims a layer by 10% Bug: 213493262 Test: builds Change-Id: I3b552682276be26fefd7ae5586ba42af0e574e31 --- .../composer3/vts/functional/Android.bp | 1 + .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 162 ++++++++++++++++++ .../functional/composer-vts/ReadbackVts.cpp | 2 + .../composer-vts/include/ReadbackVts.h | 8 + 4 files changed, 173 insertions(+) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp index 741572db57..bd2c3b1248 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp @@ -50,6 +50,7 @@ cc_test { "libgui", "libhidlbase", "libprocessgroup", + "libtinyxml2", "android.hardware.graphics.mapper@2.0", "android.hardware.graphics.mapper@2.1", "android.hardware.graphics.mapper@3.0", diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index e519221159..3e0992ed34 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -24,10 +24,18 @@ #include #include #include +#include +#include #include #include #include #include + +// tinyxml2 does implicit conversions >:( +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" +#include +#pragma clang diagnostic pop #include "composer-vts/include/GraphicsComposerCallback.h" namespace aidl::android::hardware::graphics::composer3::vts { @@ -124,6 +132,76 @@ class GraphicsCompositionTestBase : public ::testing::Test { /*layerCount*/ 1u, usage, "VtsHalGraphicsComposer3_ReadbackTest"); } + uint64_t getStableDisplayId(int64_t display) { + DisplayIdentification identification; + const auto error = mComposerClient->getDisplayIdentificationData(display, &identification); + EXPECT_TRUE(error.isOk()); + + if (const auto info = ::android::parseDisplayIdentificationData( + static_cast(identification.port), identification.data)) { + return info->id.value; + } + + return ::android::PhysicalDisplayId::fromPort(static_cast(identification.port)) + .value; + } + + // Gets the per-display XML config + std::unique_ptr getDisplayConfigXml(int64_t display) { + std::stringstream pathBuilder; + pathBuilder << "/vendor/etc/displayconfig/display_id_" << getStableDisplayId(display) + << ".xml"; + const std::string path = pathBuilder.str(); + auto document = std::make_unique(); + const tinyxml2::XMLError error = document->LoadFile(path.c_str()); + if (error == tinyxml2::XML_SUCCESS) { + return document; + } else { + return nullptr; + } + } + + // Gets the max display brightness for this display. + // If the display config xml does not exist, then assume that the display is not well-configured + // enough to provide a display brightness, so return nullopt. + std::optional getMaxDisplayBrightnessNits(int64_t display) { + const auto document = getDisplayConfigXml(display); + if (!document) { + // Assume the device doesn't support display brightness + return std::nullopt; + } + + const auto root = document->RootElement(); + if (!root) { + // If there's somehow no root element, then this isn't a valid config + return std::nullopt; + } + + const auto screenBrightnessMap = root->FirstChildElement("screenBrightnessMap"); + if (!screenBrightnessMap) { + // A valid display config must have a screen brightness map + return std::nullopt; + } + + auto point = screenBrightnessMap->FirstChildElement("point"); + float maxNits = -1.f; + while (point != nullptr) { + const auto nits = point->FirstChildElement("nits"); + if (nits) { + maxNits = std::max(maxNits, nits->FloatText(-1.f)); + } + point = point->NextSiblingElement("point"); + } + + if (maxNits < 0.f) { + // If we got here, then there were no point elements containing a nit value, so this + // config isn't valid + return std::nullopt; + } + + return maxNits; + } + void writeLayers(const std::vector>& layers) { for (auto layer : layers) { layer->write(mWriter); @@ -876,6 +954,90 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { } } +TEST_P(GraphicsCompositionTest, SetLayerWhitePointDims) { + std::vector capabilities; + const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); + ASSERT_TRUE(error.isOk()); + + const bool brightnessSupport = std::find(capabilities.begin(), capabilities.end(), + DisplayCapability::BRIGHTNESS) != capabilities.end(); + + if (!brightnessSupport) { + GTEST_SUCCEED() << "Cannot verify dimming behavior without brightness support"; + return; + } + + const std::optional maxBrightnessNitsOptional = + getMaxDisplayBrightnessNits(mPrimaryDisplay); + + ASSERT_TRUE(maxBrightnessNitsOptional.has_value()); + + const float maxBrightnessNits = *maxBrightnessNitsOptional; + + // Preconditions to successfully run are knowing the max brightness and successfully applying + // the max brightness + ASSERT_GT(maxBrightnessNits, 0.f); + mWriter.setDisplayBrightness(mPrimaryDisplay, 1.f); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + for (ColorMode mode : mTestColorModes) { + ASSERT_NO_FATAL_FAILURE( + mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + + if (!getHasReadbackBuffer()) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace for " + "color mode: " + << toString(mode); + continue; + } + const common::Rect redRect = {0, 0, mDisplayWidth, mDisplayHeight / 2}; + const common::Rect dimmerRedRect = {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}; + const auto redLayer = std::make_shared(mComposerClient, mPrimaryDisplay); + redLayer->setColor(RED); + redLayer->setDisplayFrame(redRect); + redLayer->setWhitePointNits(maxBrightnessNits); + + const auto dimmerRedLayer = + std::make_shared(mComposerClient, mPrimaryDisplay); + dimmerRedLayer->setColor(RED); + dimmerRedLayer->setDisplayFrame(dimmerRedRect); + // Intentionally use a small dimming ratio as some implementations may be more likely to + // kick into GPU composition to apply dithering when the dimming ratio is high. + static constexpr float kDimmingRatio = 0.9f; + dimmerRedLayer->setWhitePointNits(maxBrightnessNits * kDimmingRatio); + + const std::vector> layers = {redLayer, dimmerRedLayer}; + std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); + ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, dimmerRedRect, DIM_RED); + + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, + mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + + writeLayers(layers); + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + execute(); + if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + GTEST_SUCCEED() + << "Readback verification not supported for GPU composition for color mode: " + << toString(mode); + continue; + } + mWriter.presentDisplay(mPrimaryDisplay); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); + mTestRenderEngine->setRenderLayers(layers); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->checkColorBuffer(expectedColors)); + } +} + class GraphicsBlendModeCompositionTest : public GraphicsCompositionTestBase, public testing::WithParamInterface> { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp index deb5ac3106..fa1b08d1bc 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp @@ -40,6 +40,7 @@ void TestLayer::write(ComposerClientWriter& writer) { writer.setLayerTransform(mDisplay, mLayer, mTransform); writer.setLayerPlaneAlpha(mDisplay, mLayer, mAlpha); writer.setLayerBlendMode(mDisplay, mLayer, mBlendMode); + writer.setLayerWhitePointNits(mDisplay, mLayer, mWhitePointNits); } std::string ReadbackHelper::getColorModeString(ColorMode mode) { @@ -102,6 +103,7 @@ LayerSettings TestLayer::toRenderEngineLayerSettings() { 1.0f, 1.0f)); layerSettings.geometry.positionTransform = scale * translation; + layerSettings.whitePointNits = mWhitePointNits; return layerSettings; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h index 0fac2b3bfe..8d84667527 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h @@ -43,6 +43,10 @@ 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}; +// DIM_RED is 90% dimmed from RED in linear space +// hard-code as value 243 in 8-bit space here, as calculating it requires +// oetf(eotf(value) * .9), which is a complex non-linear transformation +static const Color DIM_RED = {243.f / 255.f, 0.0f, 0.0f, 1.0f}; static const Color TRANSLUCENT_RED = {1.0f, 0.0f, 0.0f, 0.3f}; static const Color GREEN = {0.0f, 1.0f, 0.0f, 1.0f}; static const Color BLUE = {0.0f, 0.0f, 1.0f, 1.0f}; @@ -67,6 +71,7 @@ class TestLayer { void setDisplayFrame(Rect frame) { mDisplayFrame = frame; } void setSourceCrop(FRect crop) { mSourceCrop = crop; } void setZOrder(uint32_t z) { mZOrder = z; } + void setWhitePointNits(float whitePointNits) { mWhitePointNits = whitePointNits; } void setSurfaceDamage(std::vector surfaceDamage) { mSurfaceDamage = std::move(surfaceDamage); @@ -84,10 +89,13 @@ class TestLayer { int64_t getLayer() const { return mLayer; } + float getWhitePointNits() const { return mWhitePointNits; } + protected: int64_t mDisplay; int64_t mLayer; Rect mDisplayFrame = {0, 0, 0, 0}; + float mWhitePointNits = -1.f; std::vector mSurfaceDamage; Transform mTransform = static_cast(0); FRect mSourceCrop = {0, 0, 0, 0}; -- GitLab From 54cfc5a102845d560e151e9f091a90faebaaff97 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 26 Oct 2021 15:22:28 -0700 Subject: [PATCH 428/825] Add PendingRequestPool to handle pending requests. PendingRequestPool would store all pending requests that we have not yet got responses from hardware. If a request has been pending for too long, the timout callback would be called and the request would be removed. Test: atest DefaultVehicleHalTest Bug: 203713317 Change-Id: I4d7ae2c72b960347be70ac4cc8ce3d66eb8128f9 --- .../hardware/test/FakeVehicleHardwareTest.cpp | 6 +- automotive/vehicle/aidl/impl/vhal/Android.bp | 1 + .../impl/vhal/include/DefaultVehicleHal.h | 5 + .../impl/vhal/include/PendingRequestPool.h | 100 +++++++ .../aidl/impl/vhal/src/PendingRequestPool.cpp | 220 ++++++++++++++ .../impl/vhal/test/PendingRequestPoolTest.cpp | 274 ++++++++++++++++++ 6 files changed, 603 insertions(+), 3 deletions(-) create mode 100644 automotive/vehicle/aidl/impl/vhal/include/PendingRequestPool.h create mode 100644 automotive/vehicle/aidl/impl/vhal/src/PendingRequestPool.cpp create mode 100644 automotive/vehicle/aidl/impl/vhal/test/PendingRequestPoolTest.cpp 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 f8df6e62d1..970d044d43 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -154,7 +154,7 @@ class FakeVehicleHardwareTest : public ::testing::Test { return toInt(result.error()); } - void onSetValues(const std::vector results) { + void onSetValues(std::vector results) { for (auto& result : results) { mSetValueResults.push_back(result); } @@ -162,7 +162,7 @@ class FakeVehicleHardwareTest : public ::testing::Test { const std::vector& getSetValueResults() { return mSetValueResults; } - void onGetValues(const std::vector results) { + void onGetValues(std::vector results) { for (auto& result : results) { mGetValueResults.push_back(result); } @@ -170,7 +170,7 @@ class FakeVehicleHardwareTest : public ::testing::Test { const std::vector& getGetValueResults() { return mGetValueResults; } - void onPropertyChangeEvent(const std::vector& values) { + void onPropertyChangeEvent(std::vector values) { for (auto& value : values) { mChangedProperties.push_back(value); } diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp index 454fea5050..a54ab4bbe9 100644 --- a/automotive/vehicle/aidl/impl/vhal/Android.bp +++ b/automotive/vehicle/aidl/impl/vhal/Android.bp @@ -56,6 +56,7 @@ cc_library { srcs: [ "src/ConnectedClient.cpp", "src/DefaultVehicleHal.cpp", + "src/PendingRequestPool.cpp", ], static_libs: [ "VehicleHalUtils", diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index 4ee3ee93d8..f6f7d80002 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -88,12 +88,17 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve GetSetValuesClient<::aidl::android::hardware::automotive::vehicle::SetValueResult, ::aidl::android::hardware::automotive::vehicle::SetValueResults>; + // The default timeout of get or set value requests is 30s. + // TODO(b/214605968): define TIMEOUT_IN_NANO in IVehicle and allow getValues/setValues/subscribe + // to specify custom timeouts. + static constexpr int64_t TIMEOUT_IN_NANO = 30'000'000'000; const std::unique_ptr mVehicleHardware; // mConfigsByPropId and mConfigFile are only modified during initialization, so no need to // lock guard them. std::unordered_map mConfigsByPropId; + // Only modified in constructor, so thread-safe. std::unique_ptr<::ndk::ScopedFileDescriptor> mConfigFile; std::mutex mLock; diff --git a/automotive/vehicle/aidl/impl/vhal/include/PendingRequestPool.h b/automotive/vehicle/aidl/impl/vhal/include/PendingRequestPool.h new file mode 100644 index 0000000000..6dcfaff5fa --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/include/PendingRequestPool.h @@ -0,0 +1,100 @@ +/* + * 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_aidl_impl_vhal_include_PendingRequestPool_H_ +#define android_hardware_automotive_vehicle_aidl_impl_vhal_include_PendingRequestPool_H_ + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +// A thread-safe pending request pool that tracks whether each request has timed-out. +class PendingRequestPool final { + public: + using TimeoutCallbackFunc = std::function&)>; + + explicit PendingRequestPool(int64_t timeoutInSec); + + ~PendingRequestPool(); + + // Adds a list of requests to the request pool. + // The clientId is the key for all the requests. It could be a number or an address to a data + // structure that represents a client. The caller must maintain this data structure. + // All the request IDs must be unique for one client, if any of the requestIds is duplicate with + // any pending request IDs for the client, this function returns error and no requests would be + // added. Otherwise, they would be added to the request pool. + // The callback would be called if requests are not finished within {@code mTimeoutInNano} + // seconds. + android::base::Result addRequests(const void* clientId, + const std::unordered_set& requestIds, + std::shared_ptr callback); + + // Checks whether the request is currently pending. + bool isRequestPending(const void* clientId, int64_t requestId) const; + + // Tries to mark the requests as finished and remove them from the pool if the request is + // currently pending. Returns the list of request that is pending and has been finished + // successfully. This function would try to finish any valid requestIds even though some of the + // requestIds are not valid. + std::unordered_set tryFinishRequests(const void* clientId, + const std::unordered_set& requestIds); + + // Returns how many pending requests in the pool, for testing purpose. + size_t countPendingRequests(const void* clientId) const; + + private: + // The maximum number of pending requests allowed per client. If exceeds this number, adding + // more requests would fail. This is to prevent spamming from client. + static constexpr size_t MAX_PENDING_REQUEST_PER_CLIENT = 10000; + + struct PendingRequest { + std::unordered_set requestIds; + int64_t timeoutTimestamp; + std::shared_ptr callback; + }; + + int64_t mTimeoutInNano; + mutable std::mutex mLock; + std::unordered_map> mPendingRequestsByClient + GUARDED_BY(mLock); + std::thread mThread; + std::atomic mThreadStop = false; + std::condition_variable mCv; + std::mutex mCvLock; + + bool isRequestPendingLocked(const void* clientId, int64_t requestId) const REQUIRES(mLock); + + // Checks whether the requests in the pool has timed-out, run periodically in a separate thread. + void checkTimeout(); +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_aidl_impl_vhal_include_PendingRequestPool_H_ diff --git a/automotive/vehicle/aidl/impl/vhal/src/PendingRequestPool.cpp b/automotive/vehicle/aidl/impl/vhal/src/PendingRequestPool.cpp new file mode 100644 index 0000000000..c2d6f89c2d --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/src/PendingRequestPool.cpp @@ -0,0 +1,220 @@ +/* + * 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 "PendingRequestPool.h" + +#include +#include + +#include +#include + +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +namespace { + +using ::aidl::android::hardware::automotive::vehicle::StatusCode; +using ::android::base::Error; +using ::android::base::Result; + +// At least check every 1s. +constexpr int64_t CHECK_TIME_IN_NANO = 1000000000; + +} // namespace + +PendingRequestPool::PendingRequestPool(int64_t timeoutInNano) + : mTimeoutInNano(timeoutInNano), mThread([this] { + // [this] must be alive within this thread because destructor would wait for this thread + // to exit. + int64_t sleepTime = std::min(mTimeoutInNano, static_cast(CHECK_TIME_IN_NANO)); + std::unique_lock lk(mCvLock); + while (!mCv.wait_for(lk, std::chrono::nanoseconds(sleepTime), + [this] { return mThreadStop.load(); })) { + checkTimeout(); + } + }) {} + +PendingRequestPool::~PendingRequestPool() { + mThreadStop = true; + mCv.notify_all(); + if (mThread.joinable()) { + mThread.join(); + } + + // If this pool is being destructed, send out all pending requests as timeout. + { + std::scoped_lock lockGuard(mLock); + + for (auto& [_, pendingRequests] : mPendingRequestsByClient) { + for (const auto& request : pendingRequests) { + (*request.callback)(request.requestIds); + } + } + mPendingRequestsByClient.clear(); + } +} + +Result PendingRequestPool::addRequests(const void* clientId, + const std::unordered_set& requestIds, + std::shared_ptr callback) { + std::scoped_lock lockGuard(mLock); + std::list* pendingRequests; + size_t pendingRequestCount = 0; + if (mPendingRequestsByClient.find(clientId) != mPendingRequestsByClient.end()) { + pendingRequests = &mPendingRequestsByClient[clientId]; + for (const auto& pendingRequest : *pendingRequests) { + const auto& pendingRequestIds = pendingRequest.requestIds; + for (int64_t requestId : requestIds) { + if (pendingRequestIds.find(requestId) != pendingRequestIds.end()) { + return Error(toInt(StatusCode::INVALID_ARG)) + << "duplicate request ID: " << requestId; + } + } + pendingRequestCount += pendingRequestIds.size(); + } + } else { + // Create a new empty list for this client. + pendingRequests = &mPendingRequestsByClient[clientId]; + } + + if (requestIds.size() > MAX_PENDING_REQUEST_PER_CLIENT - pendingRequestCount) { + return Error(toInt(StatusCode::TRY_AGAIN)) << "too many pending requests"; + } + + int64_t currentTime = elapsedRealtimeNano(); + int64_t timeoutTimestamp = currentTime + mTimeoutInNano; + + pendingRequests->push_back({ + .requestIds = std::unordered_set(requestIds.begin(), requestIds.end()), + .timeoutTimestamp = timeoutTimestamp, + .callback = callback, + }); + + return {}; +} + +bool PendingRequestPool::isRequestPending(const void* clientId, int64_t requestId) const { + std::scoped_lock lockGuard(mLock); + + return isRequestPendingLocked(clientId, requestId); +} + +size_t PendingRequestPool::countPendingRequests(const void* clientId) const { + std::scoped_lock lockGuard(mLock); + + auto it = mPendingRequestsByClient.find(clientId); + if (it == mPendingRequestsByClient.end()) { + return 0; + } + + size_t count = 0; + for (const auto& pendingRequest : it->second) { + count += pendingRequest.requestIds.size(); + } + + return count; +} + +bool PendingRequestPool::isRequestPendingLocked(const void* clientId, int64_t requestId) const { + auto it = mPendingRequestsByClient.find(clientId); + if (it == mPendingRequestsByClient.end()) { + return false; + } + for (const auto& pendingRequest : it->second) { + const auto& requestIds = pendingRequest.requestIds; + if (requestIds.find(requestId) != requestIds.end()) { + return true; + } + } + return false; +} + +void PendingRequestPool::checkTimeout() { + std::vector timeoutRequests; + { + std::scoped_lock lockGuard(mLock); + + int64_t currentTime = elapsedRealtimeNano(); + + std::vector clientsWithEmptyRequests; + + for (auto& [clientId, pendingRequests] : mPendingRequestsByClient) { + auto it = pendingRequests.begin(); + while (it != pendingRequests.end()) { + if (it->timeoutTimestamp >= currentTime) { + break; + } + timeoutRequests.push_back(std::move(*it)); + it = pendingRequests.erase(it); + } + + if (pendingRequests.empty()) { + clientsWithEmptyRequests.push_back(clientId); + } + } + + for (const void* clientId : clientsWithEmptyRequests) { + mPendingRequestsByClient.erase(clientId); + } + } + + // Call the callback outside the lock. + for (const auto& request : timeoutRequests) { + (*request.callback)(request.requestIds); + } +} + +std::unordered_set PendingRequestPool::tryFinishRequests( + const void* clientId, const std::unordered_set& requestIds) { + std::scoped_lock lockGuard(mLock); + + std::unordered_set foundIds; + + if (mPendingRequestsByClient.find(clientId) == mPendingRequestsByClient.end()) { + return foundIds; + } + + auto& pendingRequests = mPendingRequestsByClient[clientId]; + auto it = pendingRequests.begin(); + while (it != pendingRequests.end()) { + auto& pendingRequestIds = it->requestIds; + for (int64_t requestId : requestIds) { + auto idIt = pendingRequestIds.find(requestId); + if (idIt == pendingRequestIds.end()) { + continue; + } + pendingRequestIds.erase(idIt); + foundIds.insert(requestId); + } + if (pendingRequestIds.empty()) { + it = pendingRequests.erase(it); + continue; + } + it++; + } + + return foundIds; +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/aidl/impl/vhal/test/PendingRequestPoolTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/PendingRequestPoolTest.cpp new file mode 100644 index 0000000000..03d795beaa --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/test/PendingRequestPoolTest.cpp @@ -0,0 +1,274 @@ +/* + * 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 "PendingRequestPool.h" + +#include +#include + +#include +#include + +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +using ::aidl::android::hardware::automotive::vehicle::StatusCode; + +using ::testing::ElementsAre; +using ::testing::UnorderedElementsAre; +using ::testing::WhenSorted; + +class PendingRequestPoolTest : public ::testing::Test { + public: + void SetUp() override { mPool = std::make_unique(TEST_TIMEOUT); } + + void TearDown() override { + if (mPool != nullptr) { + ASSERT_EQ(mPool->countPendingRequests(getTestClientId()), static_cast(0)) + << "at least one pending request still exists in the pool when finish"; + } + } + + PendingRequestPool* getPool() { return mPool.get(); } + + void destroyPool() { mPool.reset(); } + + int64_t getTimeout() { return TEST_TIMEOUT; } + + void* getTestClientId() { return reinterpret_cast(0); } + + private: + // Test timeout is 0.1s. + static const int64_t TEST_TIMEOUT = 100000000; + + std::unique_ptr mPool; +}; + +TEST_F(PendingRequestPoolTest, testFinishAllRequests) { + std::mutex lock; + std::vector timeoutRequestIds; + + std::unordered_set requestIds; + for (int64_t i = 0; i < 10; i++) { + requestIds.insert(i); + } + + auto callback = std::make_shared( + [&lock, &timeoutRequestIds](const std::unordered_set& requests) { + std::scoped_lock lockGuard(lock); + for (int64_t request : requests) { + timeoutRequestIds.push_back(request); + } + }); + + ASSERT_RESULT_OK(getPool()->addRequests(getTestClientId(), requestIds, callback)); + + for (int64_t i = 0; i < 10; i++) { + ASSERT_TRUE(getPool()->isRequestPending(getTestClientId(), i)); + } + + for (int64_t i = 0; i < 10; i++) { + ASSERT_THAT(getPool()->tryFinishRequests(getTestClientId(), {i}), UnorderedElementsAre(i)); + } + + for (int64_t i = 0; i < 10; i++) { + ASSERT_FALSE(getPool()->isRequestPending(getTestClientId(), i)); + } +} + +TEST_F(PendingRequestPoolTest, testFinishHalfOfRequest) { + int64_t timeout = getTimeout(); + std::mutex lock; + std::vector timeoutRequestIds; + + std::unordered_set requestIds; + for (int64_t i = 0; i < 10; i++) { + requestIds.insert(i); + } + + auto callback = std::make_shared( + [&lock, &timeoutRequestIds](const std::unordered_set& requests) { + std::scoped_lock lockGuard(lock); + for (int64_t request : requests) { + timeoutRequestIds.push_back(request); + } + }); + + ASSERT_RESULT_OK(getPool()->addRequests(getTestClientId(), requestIds, callback)); + + for (int64_t i = 0; i < 10; i++) { + ASSERT_TRUE(getPool()->isRequestPending(getTestClientId(), i)); + } + + // Finish half of the requests. + requestIds.clear(); + for (int64_t i = 0; i < 5; i++) { + requestIds.insert(i); + } + + ASSERT_EQ(getPool()->tryFinishRequests(getTestClientId(), requestIds), requestIds); + + for (int64_t i = 0; i < 5; i++) { + ASSERT_FALSE(getPool()->isRequestPending(getTestClientId(), i)); + } + for (int64_t i = 5; i < 10; i++) { + ASSERT_TRUE(getPool()->isRequestPending(getTestClientId(), i)); + } + + // Wait until the unfinished requests timeout. The check interval is timeout, so at max we + // would wait an additional interval, which is 2 * timeout until the callback is called. + std::this_thread::sleep_for(2 * std::chrono::nanoseconds(timeout)); + + ASSERT_THAT(timeoutRequestIds, WhenSorted(ElementsAre(5, 6, 7, 8, 9))); +} + +TEST_F(PendingRequestPoolTest, testFinishRequestTwice) { + std::mutex lock; + std::vector timeoutRequestIds; + + auto callback = std::make_shared( + [&lock, &timeoutRequestIds](const std::unordered_set& requests) { + std::scoped_lock lockGuard(lock); + for (int64_t request : requests) { + timeoutRequestIds.push_back(request); + } + }); + + ASSERT_RESULT_OK(getPool()->addRequests(getTestClientId(), {0}, callback)); + + ASSERT_THAT(getPool()->tryFinishRequests(getTestClientId(), {0}), UnorderedElementsAre(0)) + << "failed to finish an added request"; + ASSERT_TRUE(getPool()->tryFinishRequests(getTestClientId(), {0}).empty()) + << "finish a request second time must return empty result"; +} + +TEST_F(PendingRequestPoolTest, testFinishRequestNonExistingId) { + std::mutex lock; + std::vector timeoutRequestIds; + + auto callback = std::make_shared( + [&lock, &timeoutRequestIds](const std::unordered_set& requests) { + std::scoped_lock lockGuard(lock); + for (int64_t request : requests) { + timeoutRequestIds.push_back(request); + } + }); + + ASSERT_RESULT_OK(getPool()->addRequests(getTestClientId(), {0, 1, 2}, callback)); + + ASSERT_THAT(getPool()->tryFinishRequests(getTestClientId(), {0, 1, 2, 3}), + UnorderedElementsAre(0, 1, 2)) + << "finished request IDs must not contain non-existing request ID"; + // Even though one of the request to finish does not exist, the rest of the requests should be + // finished. + ASSERT_EQ(getPool()->countPendingRequests(getTestClientId()), static_cast(0)) + << "requests not being finished correctly"; +} + +TEST_F(PendingRequestPoolTest, testFinishAfterTimeout) { + std::mutex lock; + std::vector timeoutRequestIds; + + auto callback = std::make_shared( + [&lock, &timeoutRequestIds](const std::unordered_set& requests) { + std::scoped_lock lockGuard(lock); + for (int64_t request : requests) { + timeoutRequestIds.push_back(request); + } + }); + + ASSERT_RESULT_OK(getPool()->addRequests(getTestClientId(), {0}, callback)); + + std::this_thread::sleep_for(2 * std::chrono::nanoseconds(getTimeout())); + + ASSERT_TRUE(getPool()->tryFinishRequests(getTestClientId(), {0}).empty()) + << "finish a request after timeout must do nothing"; +} + +TEST_F(PendingRequestPoolTest, testDestroyWithPendingRequests) { + std::mutex lock; + std::vector timeoutRequestIds; + + auto callback = std::make_shared( + [&lock, &timeoutRequestIds](const std::unordered_set& requests) { + std::scoped_lock lockGuard(lock); + for (int64_t request : requests) { + timeoutRequestIds.push_back(request); + } + }); + + ASSERT_RESULT_OK(getPool()->addRequests(getTestClientId(), {0}, callback)); + + destroyPool(); + + // Before the pool is destroyed, the pending requests should be notified as timeout. + ASSERT_THAT(timeoutRequestIds, UnorderedElementsAre(0)) + << "timeout not triggered when the pool is destroyed"; +} + +TEST_F(PendingRequestPoolTest, testDuplicateRequestId) { + auto callback = std::make_shared( + [](std::unordered_set) {}); + + ASSERT_RESULT_OK(getPool()->addRequests(getTestClientId(), {0}, callback)); + ASSERT_FALSE(getPool()->addRequests(getTestClientId(), {1, 2, 0}, callback).ok()) + << "adding duplicate request IDs must fail"; + + ASSERT_THAT(getPool()->tryFinishRequests(getTestClientId(), {0}), UnorderedElementsAre(0)); +} + +TEST_F(PendingRequestPoolTest, testSameRequestIdForDifferentClient) { + auto callback = std::make_shared( + [](std::unordered_set) {}); + + ASSERT_RESULT_OK(getPool()->addRequests(reinterpret_cast(0), {0}, callback)); + ASSERT_RESULT_OK(getPool()->addRequests(reinterpret_cast(1), {1, 2, 0}, callback)); + + ASSERT_THAT(getPool()->tryFinishRequests(reinterpret_cast(0), {0}), + UnorderedElementsAre(0)); + ASSERT_THAT(getPool()->tryFinishRequests(reinterpret_cast(1), {1, 2, 0}), + UnorderedElementsAre(0, 1, 2)); +} + +TEST_F(PendingRequestPoolTest, testPendingRequestCountLimit) { + auto callback = std::make_shared( + [](std::unordered_set) {}); + + std::unordered_set requests; + + // MAX_PENDING_REQUEST_PER_CLIENT = 10000 + for (size_t i = 0; i < 10000; i++) { + requests.insert(static_cast(i)); + } + ASSERT_RESULT_OK(getPool()->addRequests(reinterpret_cast(0), requests, callback)); + + auto result = getPool()->addRequests(reinterpret_cast(0), {static_cast(10000)}, + callback); + ASSERT_FALSE(result.ok()) << "adding more pending requests than limit must fail"; + ASSERT_EQ(result.error().code(), toInt(StatusCode::TRY_AGAIN)); + + getPool()->tryFinishRequests(reinterpret_cast(0), requests); +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android -- GitLab From 0d9b1a9d287d3751c305742af81850b7ceea0c6b Mon Sep 17 00:00:00 2001 From: Xusong Wang Date: Tue, 5 Oct 2021 10:17:01 -0700 Subject: [PATCH 429/825] Define AIDL reusable execution interface. This CL defines the AIDL interface for reusable execution. This CL also fixes a stale statement in IBurst about deadlineNs: boot_clock should be used rather than steady_clock. Bug: 202405342 Bug: 202431255 Test: NNT_static Test: VtsHalNeuralnetworksTargetTest Change-Id: I07d26909081018ffd92264d76109a66d4a0de3bd --- .../compatibility_matrix.current.xml | 2 +- .../hardware/neuralnetworks/IExecution.aidl | 39 +++++ .../neuralnetworks/IPreparedModel.aidl | 1 + .../hardware/neuralnetworks/IBurst.aidl | 8 +- .../hardware/neuralnetworks/IExecution.aidl | 153 ++++++++++++++++++ .../neuralnetworks/IPreparedModel.aidl | 44 ++++- 6 files changed, 237 insertions(+), 10 deletions(-) create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IExecution.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/IExecution.aidl diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index cf856889df..d0c55f2a24 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -455,7 +455,7 @@ android.hardware.neuralnetworks - 1-3 + 1-4 IDevice .* diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IExecution.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IExecution.aidl new file mode 100644 index 0000000000..ab5275e582 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IExecution.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 -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.neuralnetworks; +@VintfStability +interface IExecution { + android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in long deadlineNs); + android.hardware.neuralnetworks.FencedExecutionResult executeFenced(in ParcelFileDescriptor[] waitFor, in long deadlineNs, in long durationNs); +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl index fccb5dc98e..f89956719e 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl @@ -37,6 +37,7 @@ interface IPreparedModel { android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in android.hardware.neuralnetworks.Request request, in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs); android.hardware.neuralnetworks.FencedExecutionResult executeFenced(in android.hardware.neuralnetworks.Request request, in ParcelFileDescriptor[] waitFor, in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs, in long durationNs); android.hardware.neuralnetworks.IBurst configureExecutionBurst(); + android.hardware.neuralnetworks.IExecution createReusableExecution(in android.hardware.neuralnetworks.Request request, in boolean measureTiming, in long loopTimeoutDurationNs); const long DEFAULT_LOOP_TIMEOUT_DURATION_NS = 2000000000; const long MAXIMUM_LOOP_TIMEOUT_DURATION_NS = 15000000000; } diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IBurst.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IBurst.aidl index decdc481f1..b089c499c6 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/IBurst.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IBurst.aidl @@ -78,10 +78,10 @@ interface IBurst { * runs from the time the driver sees the call to the executeSynchronously * function to the time the driver returns from the function. * @param deadlineNs The time by which the execution is expected to complete. The time is - * measured in nanoseconds since epoch of the steady clock (as from - * std::chrono::steady_clock). If the execution cannot be finished by the - * deadline, the execution may be aborted. Passing -1 means the deadline is - * omitted. Other negative values are invalid. + * measured in nanoseconds since boot (as from clock_gettime(CLOCK_BOOTTIME, + * &ts) or ::android::base::boot_clock). If the execution cannot be finished + * by the deadline, the execution may be aborted. Passing -1 means the + * deadline is omitted. Other negative values are invalid. * @param loopTimeoutDurationNs The maximum amount of time in nanoseconds that should be spent * executing a {@link OperationType::WHILE} operation. If a loop * condition model does not output false within this duration, the diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IExecution.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IExecution.aidl new file mode 100644 index 0000000000..3cb9c1a592 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IExecution.aidl @@ -0,0 +1,153 @@ +/* + * 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. + */ + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.ExecutionResult; +import android.hardware.neuralnetworks.FencedExecutionResult; + +/** + * IExecution represents a reusable execution object with request and most other execution + * properties fixed. It is used to launch executions. + * + * At most one execution may occur on a reusable execution object at any given time, either by + * means of executeSynchronously or executeFenced. + * + * An IExecution object is used to control a set of executions on the same prepared model with + * the same request and properties. IExecution objects enable some optimizations: + * (1) An IExecution object can preserve resources between executions. For example, a driver can + * map a memory object when the IExecution object is created and cache the mapping for reuse in + * subsequent executions. Any cached resource can be released when the IExecution object is + * destroyed. + * (2) Because an IExecution object may be used for at most one execution at a time, any transient + * execution resources such as intermediate tensors can be allocated once when the IExecution + * object is created and freed when the IExecution object is destroyed. + * (3) An IExecution object is created for a fixed request. This enables the implementation to apply + * request-specific optimizations. For example, an implementation can avoid request validation + * and conversions when the IExecution object is reused. An implementation may also choose to + * specialize the dynamic tensor shapes in the IExecution object according to the request. + */ +@VintfStability +interface IExecution { + /** + * Performs a synchronous execution on the reusable execution object. + * + * The execution is performed synchronously with respect to the caller. executeSynchronously + * must verify the inputs to the function are correct, and the usages of memory pools allocated + * by IDevice::allocate are valid. If there is an error, executeSynchronously must immediately + * return a service specific exception with the appropriate ErrorStatus value. If the inputs to + * the function are valid and there is no error, executeSynchronously must perform the + * execution, and must not return until the execution is complete. + * + * The caller must not change the content of any data object referenced by the 'request' + * provided in {@link IPreparedModel::createReusableExecution} (described by the + * {@link DataLocation} of a {@link RequestArgument}) until executeSynchronously returns. + * executeSynchronously must not change the content of any of the data objects corresponding to + * 'request' inputs. + * + * If the execution object was configured from a prepared model wherein all tensor operands have + * fully specified dimensions, and the inputs to the function are valid, and at execution time + * every operation's input operands have legal values, then the execution should complete + * successfully: there must be no failure unless the device itself is in a bad state. + * + * If the execution object was created with measureTiming being true and the execution is + * successful, the driver may report the timing information in the returning + * {@link ExecutionResult}. The duration runs from the time the driver sees the call to the time + * the driver returns from the function. + * + * executeSynchronously may be called with an optional deadline. If the execution is not able to + * be completed before the provided deadline, the execution may be aborted, and either + * {@link ErrorStatus::MISSED_DEADLINE_TRANSIENT} or {@link + * ErrorStatus::MISSED_DEADLINE_PERSISTENT} may be returned. The error due to an abort must be + * sent the same way as other errors, described above. + * + * @param deadlineNs The time by which the execution is expected to complete. The time is + * measured in nanoseconds since boot (as from clock_gettime(CLOCK_BOOTTIME, + * &ts) or ::android::base::boot_clock). If the execution cannot be finished + * by the deadline, the execution may be aborted. Passing -1 means the + * deadline is omitted. Other negative values are invalid. + * @return ExecutionResult parcelable, containing the status of the execution, output shapes + * and timing information. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - INVALID_ARGUMENT if one of the input arguments is invalid + * - MISSED_DEADLINE_* if the execution is aborted because it cannot be completed by the + * deadline + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + */ + ExecutionResult executeSynchronously(in long deadlineNs); + + /** + * Launch a fenced asynchronous execution on the reusable execution object. + * + * The execution is performed asynchronously with respect to the caller. executeFenced must + * verify the inputs to the function are correct, and the usages of memory pools allocated by + * IDevice::allocate are valid. If there is an error, executeFenced must immediately return a + * service specific exception with the corresponding ErrorStatus. If the inputs to the function + * are valid and there is no error, executeFenced must dispatch an asynchronous task to perform + * the execution in the background, and immediately return a {@link FencedExecutionResult} + * containing two fields: a callback (which can be used by the client to query the duration and + * runtime error status) and a sync fence (which will be signaled once the execution is + * completed). If the task has finished before the call returns, syncFence file descriptor may + * be set to -1. The execution must wait for all the sync fences (if any) in waitFor to be + * signaled before starting the actual execution. + * + * When the asynchronous task has finished its execution, it must immediately signal the + * syncFence returned from the executeFenced call. After the syncFence is signaled, the task + * must not modify the content of any data object referenced by the 'request' provided in + * IPreparedModel::createReusableExecution (described by the {@link DataLocation} of a + * {@link RequestArgument}). + * + * executeFenced may be called with an optional deadline and an optional duration. If the + * execution is not able to be completed before the provided deadline or within the timeout + * duration (measured from when all sync fences in waitFor are signaled), whichever comes + * earlier, the execution may be aborted, and either + * {@link ErrorStatus::MISSED_DEADLINE_TRANSIENT} or {@link + * ErrorStatus::MISSED_DEADLINE_PERSISTENT} may be returned. The error due to an abort must be + * sent the same way as other errors, described above. + * + * If any of the sync fences in waitFor changes to error status after the executeFenced call + * succeeds, or the execution is aborted because it cannot finish before the deadline has been + * reached or the duration has elapsed, the driver must immediately set the returned syncFence + * to error status. + * + * @param waitFor A vector of sync fence file descriptors. Execution must not start until all + * sync fences have been signaled. + * @param deadlineNs The time by which the execution is expected to complete. The time is + * measured in nanoseconds since boot (as from clock_gettime(CLOCK_BOOTTIME, + * &ts) or ::android::base::boot_clock). If the execution cannot be finished + * by the deadline, the execution may be aborted. Passing -1 means the + * deadline is omitted. Other negative values are invalid. + * @param durationNs The length of time in nanoseconds within which the execution is expected + * to complete after all sync fences in waitFor are signaled. If the + * execution cannot be finished within the duration, the execution may be + * aborted. Passing -1 means the duration is omitted. Other negative values + * are invalid. + * @return The FencedExecutionResult parcelable, containing IFencedExecutionCallback and the + * sync fence. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - INVALID_ARGUMENT if one of the input arguments is invalid, including fences in error + * states. + * - MISSED_DEADLINE_* if the execution is aborted because it cannot be completed by the + * deadline + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + */ + FencedExecutionResult executeFenced( + in ParcelFileDescriptor[] waitFor, in long deadlineNs, in long durationNs); +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl index 956b626dd9..79053e527f 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl @@ -21,6 +21,7 @@ import android.hardware.neuralnetworks.ErrorStatus; import android.hardware.neuralnetworks.ExecutionResult; import android.hardware.neuralnetworks.FencedExecutionResult; import android.hardware.neuralnetworks.IBurst; +import android.hardware.neuralnetworks.IExecution; import android.hardware.neuralnetworks.Request; /** @@ -105,11 +106,12 @@ interface IPreparedModel { * IDevice::allocate are valid. If there is an error, executeFenced must immediately return a * service specific exception with the corresponding ErrorStatus. If the inputs to the function * are valid and there is no error, executeFenced must dispatch an asynchronous task to perform - * the execution in the background, assign a sync fence that will be signaled once the execution - * is completed and immediately return a callback that can be used by the client to query the - * duration and runtime error status. If the task has finished before the call returns, - * syncFence file descriptor may be set to -1. The execution must wait for all the sync fences - * (if any) in waitFor to be signaled before starting the actual execution. + * the execution in the background, and immediately return a {@link FencedExecutionResult} + * containing two fields: a callback (which can be used by the client to query the duration and + * runtime error status) and a sync fence (which will be signaled once the execution is + * completed). If the task has finished before the call returns, syncFence file descriptor may + * be set to -1. The execution must wait for all the sync fences (if any) in waitFor to be + * signaled before starting the actual execution. * * When the asynchronous task has finished its execution, it must immediately signal the * syncFence returned from the executeFenced call. After the syncFence is signaled, the task @@ -186,4 +188,36 @@ interface IPreparedModel { * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver */ IBurst configureExecutionBurst(); + + /** + * Create a reusable execution object to launch multiple executions with the same request and + * properties. + * + * createReusableExecution must verify the inputs to the function are correct, and the usages of + * memory pools allocated by IDevice::allocate are valid. If there is an error, + * createReusableExecution must immediately return a service specific exception with the + * appropriate ErrorStatus value. If the inputs to the function are valid and there is no error, + * createReusableExecution must construct a reusable execution. + * + * @param request The input and output information on which the prepared model is to be + * executed. + * @param measure Specifies whether or not to measure duration of the execution. + * @param loopTimeoutDurationNs The maximum amount of time in nanoseconds that should be spent + * executing a {@link OperationType::WHILE} operation. If a loop + * condition model does not output false within this duration, the + * computation performed on the returned reusable execution object + * must be aborted. If -1 is provided, the maximum amount + * of time is {@link DEFAULT_LOOP_TIMEOUT_DURATION_NS}. Other + * negative values are invalid. When provided, the duration must + * not exceed {@link MAXIMUM_LOOP_TIMEOUT_DURATION_NS}. + * @return execution An IExecution object representing a reusable execution that has been + * specialized for a fixed request. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - INVALID_ARGUMENT if one of the input arguments is invalid + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + */ + IExecution createReusableExecution( + in Request request, in boolean measureTiming, in long loopTimeoutDurationNs); } -- GitLab From 7f5c7d293c2dad462dc9c0f1f1a160fb2c2c9a9b Mon Sep 17 00:00:00 2001 From: Xusong Wang Date: Tue, 5 Oct 2021 14:10:41 -0700 Subject: [PATCH 430/825] Reusable execution at HAL level -- HAL. This CL modifies the canonical/AIDL adapter to use IExecution object if available. Bug: 202405342 Bug: 202431255 Test: NNT_static Test: CtsNNAPITestCases Test: VtsHalNeuralnetworksTargetTest Change-Id: I6aac3c57f97ac87a5ba3f78cfd843fcc403decff --- neuralnetworks/aidl/utils/Android.bp | 37 ++- .../utils/include/nnapi/hal/aidl/Callbacks.h | 3 + .../utils/include/nnapi/hal/aidl/Execution.h | 41 ++- .../include/nnapi/hal/aidl/HalInterfaces.h | 5 + .../include/nnapi/hal/aidl/PreparedModel.h | 6 +- .../aidl/utils/include/nnapi/hal/aidl/Utils.h | 2 + neuralnetworks/aidl/utils/src/Callbacks.cpp | 7 +- neuralnetworks/aidl/utils/src/Device.cpp | 4 +- neuralnetworks/aidl/utils/src/Execution.cpp | 45 +++- .../aidl/utils/src/PreparedModel.cpp | 158 +++++++---- neuralnetworks/aidl/utils/test/DeviceTest.cpp | 27 +- .../aidl/utils/test/ExecutionTest.cpp | 254 ++++++++++++++++++ .../aidl/utils/test/MockExecution.h | 47 ++++ .../aidl/utils/test/MockPreparedModel.h | 5 + .../aidl/utils/test/PreparedModelTest.cpp | 194 +++++++++---- neuralnetworks/aidl/utils/test/TestUtils.cpp | 44 +++ neuralnetworks/aidl/utils/test/TestUtils.h | 43 +++ .../aidl/vts/functional/MemoryDomainTests.cpp | 5 + .../aidl/include/nnapi/hal/aidl/Execution.h | 56 ++++ .../include/nnapi/hal/aidl/PreparedModel.h | 4 + .../utils/adapter/aidl/src/PreparedModel.cpp | 99 +++++++ 21 files changed, 925 insertions(+), 161 deletions(-) create mode 100644 neuralnetworks/aidl/utils/test/ExecutionTest.cpp create mode 100644 neuralnetworks/aidl/utils/test/MockExecution.h create mode 100644 neuralnetworks/aidl/utils/test/TestUtils.cpp create mode 100644 neuralnetworks/aidl/utils/test/TestUtils.h create mode 100644 neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/Execution.h diff --git a/neuralnetworks/aidl/utils/Android.bp b/neuralnetworks/aidl/utils/Android.bp index e3561042be..3faa613514 100644 --- a/neuralnetworks/aidl/utils/Android.bp +++ b/neuralnetworks/aidl/utils/Android.bp @@ -26,7 +26,14 @@ package { cc_defaults { name: "neuralnetworks_utils_hal_aidl_defaults", defaults: ["neuralnetworks_utils_defaults"], - srcs: ["src/*"], + srcs: [ + // AIDL utils that a driver may depend on. + "src/BufferTracker.cpp", + "src/Conversions.cpp", + "src/HalUtils.cpp", + "src/Utils.cpp", + "src/ValidateHal.cpp", + ], local_include_dirs: ["include/nnapi/hal/aidl/"], export_include_dirs: ["include"], cflags: ["-Wthread-safety"], @@ -47,6 +54,7 @@ cc_defaults { }, } +// Deprecated. Remove once all modules depending on this are migrated away. cc_library_static { name: "neuralnetworks_utils_hal_aidl_v1", defaults: ["neuralnetworks_utils_hal_aidl_defaults"], @@ -55,20 +63,26 @@ cc_library_static { ], } -cc_library_static { - name: "neuralnetworks_utils_hal_aidl_v2", - defaults: ["neuralnetworks_utils_hal_aidl_defaults"], - shared_libs: [ - "android.hardware.neuralnetworks-V2-ndk", - ], -} - cc_library_static { name: "neuralnetworks_utils_hal_aidl", defaults: ["neuralnetworks_utils_hal_aidl_defaults"], + srcs: [ + // Additional AIDL utils for the runtime. + "src/Assertions.cpp", + "src/Buffer.cpp", + "src/Burst.cpp", + "src/Callbacks.cpp", + "src/Device.cpp", + "src/Execution.cpp", + "src/InvalidDevice.cpp", + "src/PreparedModel.cpp", + "src/ProtectCallback.cpp", + "src/Service.cpp", + ], shared_libs: [ - "android.hardware.neuralnetworks-V3-ndk", + "android.hardware.neuralnetworks-V4-ndk", ], + cflags: ["-DNN_AIDL_V4_OR_ABOVE"], } // A cc_defaults that includes the latest non-experimental AIDL utilities and other AIDL libraries @@ -79,9 +93,10 @@ cc_defaults { static_libs: [ "android.hardware.common-V2-ndk", "android.hardware.graphics.common-V3-ndk", - "android.hardware.neuralnetworks-V3-ndk", + "android.hardware.neuralnetworks-V4-ndk", "neuralnetworks_utils_hal_aidl", ], + cflags: ["-DNN_AIDL_V4_OR_ABOVE"], } cc_test { diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Callbacks.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Callbacks.h index 168264babf..960be2bb54 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Callbacks.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Callbacks.h @@ -36,6 +36,8 @@ class PreparedModelCallback final : public BnPreparedModelCallback, public IProt public: using Data = nn::GeneralResult; + PreparedModelCallback(nn::Version featureLevel) : kFeatureLevel(featureLevel) {} + ndk::ScopedAStatus notify(ErrorStatus status, const std::shared_ptr& preparedModel) override; @@ -44,6 +46,7 @@ class PreparedModelCallback final : public BnPreparedModelCallback, public IProt Data get(); private: + const nn::Version kFeatureLevel; hal::utils::TransferValue mData; }; diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Execution.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Execution.h index a77ea984b2..14802b98cc 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Execution.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Execution.h @@ -17,6 +17,8 @@ #ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_EXECUTION_H #define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_EXECUTION_H +#include + #include #include #include @@ -33,17 +35,22 @@ namespace aidl::android::hardware::neuralnetworks::utils { -class Execution final : public nn::IExecution, public std::enable_shared_from_this { +// A reusable execution implementation with a cached Request, internally it is still passing the +// request to the driver in every computation. +class ExecutionWithCachedRequest final + : public nn::IExecution, + public std::enable_shared_from_this { struct PrivateConstructorTag {}; public: - static nn::GeneralResult> create( + static nn::GeneralResult> create( std::shared_ptr preparedModel, Request request, hal::utils::RequestRelocation relocation, bool measure, int64_t loopTimeoutDuration); - Execution(PrivateConstructorTag tag, std::shared_ptr preparedModel, - Request request, hal::utils::RequestRelocation relocation, bool measure, - int64_t loopTimeoutDuration); + ExecutionWithCachedRequest(PrivateConstructorTag tag, + std::shared_ptr preparedModel, Request request, + hal::utils::RequestRelocation relocation, bool measure, + int64_t loopTimeoutDuration); nn::ExecutionResult, nn::Timing>> compute( const nn::OptionalTimePoint& deadline) const override; @@ -60,6 +67,30 @@ class Execution final : public nn::IExecution, public std::enable_shared_from_th const int64_t kLoopTimeoutDuration; }; +// A reusable execution implementation that is backed by an actual AIDL IExecution object. +class Execution final : public nn::IExecution, public std::enable_shared_from_this { + struct PrivateConstructorTag {}; + + public: + static nn::GeneralResult> create( + std::shared_ptr execution, + hal::utils::RequestRelocation relocation); + + Execution(PrivateConstructorTag tag, std::shared_ptr execution, + hal::utils::RequestRelocation relocation); + + nn::ExecutionResult, nn::Timing>> compute( + const nn::OptionalTimePoint& deadline) const override; + + nn::GeneralResult> computeFenced( + const std::vector& waitFor, const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& timeoutDurationAfterFence) const override; + + private: + const std::shared_ptr kExecution; + const hal::utils::RequestRelocation kRelocation; +}; + } // namespace aidl::android::hardware::neuralnetworks::utils #endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_EXECUTION_H diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/HalInterfaces.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/HalInterfaces.h index 3fb443c388..205d428cf4 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/HalInterfaces.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/HalInterfaces.h @@ -61,6 +61,11 @@ #include #include +#ifdef NN_AIDL_V4_OR_ABOVE +#include +#include +#endif // NN_AIDL_V4_OR_ABOVE + namespace android::nn { namespace aidl_hal = ::aidl::android::hardware::neuralnetworks; diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h index 4035764ea4..24cd681658 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h @@ -41,10 +41,11 @@ class PreparedModel final : public nn::IPreparedModel, public: static nn::GeneralResult> create( - std::shared_ptr preparedModel); + std::shared_ptr preparedModel, nn::Version featureLevel); PreparedModel(PrivateConstructorTag tag, - std::shared_ptr preparedModel); + std::shared_ptr preparedModel, + nn::Version featureLevel); nn::ExecutionResult, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure, @@ -78,6 +79,7 @@ class PreparedModel final : public nn::IPreparedModel, private: const std::shared_ptr kPreparedModel; + const nn::Version kFeatureLevel; }; } // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h index a27487e17c..beca38b1ee 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h @@ -38,6 +38,8 @@ constexpr std::optional aidlVersionToCanonicalVersion(int aidlVersi return nn::kVersionFeatureLevel6; case 3: return nn::kVersionFeatureLevel7; + case 4: + return nn::kVersionFeatureLevel8; default: return std::nullopt; } diff --git a/neuralnetworks/aidl/utils/src/Callbacks.cpp b/neuralnetworks/aidl/utils/src/Callbacks.cpp index 8084970690..554f3faa73 100644 --- a/neuralnetworks/aidl/utils/src/Callbacks.cpp +++ b/neuralnetworks/aidl/utils/src/Callbacks.cpp @@ -38,16 +38,17 @@ namespace { // nn::kVersionFeatureLevel5. On failure, this function returns with the appropriate // nn::GeneralError. nn::GeneralResult prepareModelCallback( - ErrorStatus status, const std::shared_ptr& preparedModel) { + ErrorStatus status, const std::shared_ptr& preparedModel, + nn::Version featureLevel) { HANDLE_STATUS_AIDL(status) << "model preparation failed with " << toString(status); - return NN_TRY(PreparedModel::create(preparedModel)); + return NN_TRY(PreparedModel::create(preparedModel, featureLevel)); } } // namespace ndk::ScopedAStatus PreparedModelCallback::notify( ErrorStatus status, const std::shared_ptr& preparedModel) { - mData.put(prepareModelCallback(status, preparedModel)); + mData.put(prepareModelCallback(status, preparedModel, kFeatureLevel)); return ndk::ScopedAStatus::ok(); } diff --git a/neuralnetworks/aidl/utils/src/Device.cpp b/neuralnetworks/aidl/utils/src/Device.cpp index 5b7ec4ebd7..bad10ed347 100644 --- a/neuralnetworks/aidl/utils/src/Device.cpp +++ b/neuralnetworks/aidl/utils/src/Device.cpp @@ -229,7 +229,7 @@ nn::GeneralResult Device::prepareModel( const auto aidlDataCache = NN_TRY(convert(dataCache)); const auto aidlToken = NN_TRY(convert(token)); - const auto cb = ndk::SharedRefBase::make(); + const auto cb = ndk::SharedRefBase::make(kFeatureLevel); const auto scoped = kDeathHandler.protectCallback(cb.get()); const auto ret = kDevice->prepareModel(aidlModel, aidlPreference, aidlPriority, aidlDeadline, @@ -247,7 +247,7 @@ nn::GeneralResult Device::prepareModelFromCache( const auto aidlDataCache = NN_TRY(convert(dataCache)); const auto aidlToken = NN_TRY(convert(token)); - const auto cb = ndk::SharedRefBase::make(); + const auto cb = ndk::SharedRefBase::make(kFeatureLevel); const auto scoped = kDeathHandler.protectCallback(cb.get()); const auto ret = kDevice->prepareModelFromCache(aidlDeadline, aidlModelCache, aidlDataCache, diff --git a/neuralnetworks/aidl/utils/src/Execution.cpp b/neuralnetworks/aidl/utils/src/Execution.cpp index 94edd90c89..c4add636e5 100644 --- a/neuralnetworks/aidl/utils/src/Execution.cpp +++ b/neuralnetworks/aidl/utils/src/Execution.cpp @@ -35,36 +35,39 @@ namespace aidl::android::hardware::neuralnetworks::utils { -nn::GeneralResult> Execution::create( - std::shared_ptr preparedModel, Request request, - hal::utils::RequestRelocation relocation, bool measure, int64_t loopTimeoutDuration) { +nn::GeneralResult> +ExecutionWithCachedRequest::create(std::shared_ptr preparedModel, + Request request, hal::utils::RequestRelocation relocation, + bool measure, int64_t loopTimeoutDuration) { if (preparedModel == nullptr) { - return NN_ERROR() << "aidl::utils::Execution::create must have non-null preparedModel"; + return NN_ERROR() << "aidl::utils::ExecutionWithCachedRequest::create must have non-null " + "preparedModel"; } - return std::make_shared(PrivateConstructorTag{}, std::move(preparedModel), - std::move(request), std::move(relocation), measure, - loopTimeoutDuration); + return std::make_shared( + PrivateConstructorTag{}, std::move(preparedModel), std::move(request), + std::move(relocation), measure, loopTimeoutDuration); } -Execution::Execution(PrivateConstructorTag /*tag*/, - std::shared_ptr preparedModel, Request request, - hal::utils::RequestRelocation relocation, bool measure, - int64_t loopTimeoutDuration) +ExecutionWithCachedRequest::ExecutionWithCachedRequest( + PrivateConstructorTag /*tag*/, std::shared_ptr preparedModel, + Request request, hal::utils::RequestRelocation relocation, bool measure, + int64_t loopTimeoutDuration) : kPreparedModel(std::move(preparedModel)), kRequest(std::move(request)), kRelocation(std::move(relocation)), kMeasure(measure), kLoopTimeoutDuration(loopTimeoutDuration) {} -nn::ExecutionResult, nn::Timing>> Execution::compute( - const nn::OptionalTimePoint& deadline) const { +nn::ExecutionResult, nn::Timing>> +ExecutionWithCachedRequest::compute(const nn::OptionalTimePoint& deadline) const { const auto aidlDeadline = NN_TRY(convert(deadline)); return kPreparedModel->executeInternal(kRequest, kMeasure, aidlDeadline, kLoopTimeoutDuration, kRelocation); } -nn::GeneralResult> Execution::computeFenced( +nn::GeneralResult> +ExecutionWithCachedRequest::computeFenced( const std::vector& waitFor, const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& timeoutDurationAfterFence) const { const auto aidlWaitFor = NN_TRY(convert(waitFor)); @@ -75,4 +78,18 @@ nn::GeneralResult> Execu aidlTimeoutDurationAfterFence, kRelocation); } +nn::GeneralResult> Execution::create( + std::shared_ptr execution, hal::utils::RequestRelocation relocation) { + if (execution == nullptr) { + return NN_ERROR() << "aidl::utils::Execution::create must have non-null execution"; + } + + return std::make_shared(PrivateConstructorTag{}, std::move(execution), + std::move(relocation)); +} + +Execution::Execution(PrivateConstructorTag /*tag*/, std::shared_ptr execution, + hal::utils::RequestRelocation relocation) + : kExecution(std::move(execution)), kRelocation(std::move(relocation)) {} + } // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/src/PreparedModel.cpp b/neuralnetworks/aidl/utils/src/PreparedModel.cpp index f25c2c8825..6d1de569d0 100644 --- a/neuralnetworks/aidl/utils/src/PreparedModel.cpp +++ b/neuralnetworks/aidl/utils/src/PreparedModel.cpp @@ -54,21 +54,77 @@ nn::GeneralResult> convertFencedExecutionResul return std::make_pair(NN_TRY(nn::convert(timingLaunched)), NN_TRY(nn::convert(timingFenced))); } +nn::ExecutionResult, nn::Timing>> handleExecutionResult( + const ExecutionResult& result, const hal::utils::RequestRelocation& relocation) { + if (!result.outputSufficientSize) { + auto canonicalOutputShapes = + nn::convert(result.outputShapes).value_or(std::vector{}); + return NN_ERROR(nn::ErrorStatus::OUTPUT_INSUFFICIENT_SIZE, std::move(canonicalOutputShapes)) + << "execution failed with " << nn::ErrorStatus::OUTPUT_INSUFFICIENT_SIZE; + } + auto [outputShapes, timing] = + NN_TRY(convertExecutionResults(result.outputShapes, result.timing)); + + if (relocation.output) { + relocation.output->flush(); + } + return std::make_pair(std::move(outputShapes), timing); +} + +nn::GeneralResult> +handleFencedExecutionResult(const FencedExecutionResult& result, + const hal::utils::RequestRelocation& relocation) { + auto resultSyncFence = nn::SyncFence::createAsSignaled(); + if (result.syncFence.get() != -1) { + resultSyncFence = nn::SyncFence::create(NN_TRY(nn::convert(result.syncFence))).value(); + } + + auto callback = result.callback; + if (callback == nullptr) { + return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) << "callback is null"; + } + + // If computeFenced required the request memory to be moved into shared memory, block here until + // the fenced execution has completed and flush the memory back. + if (relocation.output) { + const auto state = resultSyncFence.syncWait({}); + if (state != nn::SyncFence::FenceState::SIGNALED) { + return NN_ERROR() << "syncWait failed with " << state; + } + relocation.output->flush(); + } + + // Create callback which can be used to retrieve the execution error status and timings. + nn::ExecuteFencedInfoCallback resultCallback = + [callback]() -> nn::GeneralResult> { + ErrorStatus errorStatus; + Timing timingLaunched; + Timing timingFenced; + const auto ret = callback->getExecutionInfo(&timingLaunched, &timingFenced, &errorStatus); + HANDLE_ASTATUS(ret) << "fenced execution callback getExecutionInfo failed"; + return convertFencedExecutionResults(errorStatus, timingLaunched, timingFenced); + }; + + return std::make_pair(std::move(resultSyncFence), std::move(resultCallback)); +} + } // namespace nn::GeneralResult> PreparedModel::create( - std::shared_ptr preparedModel) { + std::shared_ptr preparedModel, nn::Version featureLevel) { if (preparedModel == nullptr) { return NN_ERROR() << "aidl_hal::utils::PreparedModel::create must have non-null preparedModel"; } - return std::make_shared(PrivateConstructorTag{}, std::move(preparedModel)); + return std::make_shared(PrivateConstructorTag{}, std::move(preparedModel), + featureLevel); } PreparedModel::PreparedModel(PrivateConstructorTag /*tag*/, - std::shared_ptr preparedModel) - : kPreparedModel(std::move(preparedModel)) {} + std::shared_ptr preparedModel, + nn::Version featureLevel) + : kPreparedModel(std::move(preparedModel)), kFeatureLevel(featureLevel) {} nn::ExecutionResult, nn::Timing>> PreparedModel::execute( const nn::Request& request, nn::MeasureTiming measure, @@ -101,19 +157,7 @@ PreparedModel::executeInternal(const Request& request, bool measure, int64_t dea const auto ret = kPreparedModel->executeSynchronously(request, measure, deadline, loopTimeoutDuration, &executionResult); HANDLE_ASTATUS(ret) << "executeSynchronously failed"; - if (!executionResult.outputSufficientSize) { - auto canonicalOutputShapes = - nn::convert(executionResult.outputShapes).value_or(std::vector{}); - return NN_ERROR(nn::ErrorStatus::OUTPUT_INSUFFICIENT_SIZE, std::move(canonicalOutputShapes)) - << "execution failed with " << nn::ErrorStatus::OUTPUT_INSUFFICIENT_SIZE; - } - auto [outputShapes, timing] = - NN_TRY(convertExecutionResults(executionResult.outputShapes, executionResult.timing)); - - if (relocation.output) { - relocation.output->flush(); - } - return std::make_pair(std::move(outputShapes), timing); + return handleExecutionResult(executionResult, relocation); } nn::GeneralResult> @@ -154,39 +198,7 @@ PreparedModel::executeFencedInternal(const Request& request, kPreparedModel->executeFenced(request, waitFor, measure, deadline, loopTimeoutDuration, timeoutDurationAfterFence, &result); HANDLE_ASTATUS(ret) << "executeFenced failed"; - - auto resultSyncFence = nn::SyncFence::createAsSignaled(); - if (result.syncFence.get() != -1) { - resultSyncFence = nn::SyncFence::create(NN_TRY(nn::convert(result.syncFence))).value(); - } - - auto callback = result.callback; - if (callback == nullptr) { - return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) << "callback is null"; - } - - // If executeFenced required the request memory to be moved into shared memory, block here until - // the fenced execution has completed and flush the memory back. - if (relocation.output) { - const auto state = resultSyncFence.syncWait({}); - if (state != nn::SyncFence::FenceState::SIGNALED) { - return NN_ERROR() << "syncWait failed with " << state; - } - relocation.output->flush(); - } - - // Create callback which can be used to retrieve the execution error status and timings. - nn::ExecuteFencedInfoCallback resultCallback = - [callback]() -> nn::GeneralResult> { - ErrorStatus errorStatus; - Timing timingLaunched; - Timing timingFenced; - const auto ret = callback->getExecutionInfo(&timingLaunched, &timingFenced, &errorStatus); - HANDLE_ASTATUS(ret) << "fenced execution callback getExecutionInfo failed"; - return convertFencedExecutionResults(errorStatus, timingLaunched, timingFenced); - }; - - return std::make_pair(std::move(resultSyncFence), std::move(resultCallback)); + return handleFencedExecutionResult(result, relocation); } nn::GeneralResult PreparedModel::createReusableExecution( @@ -202,8 +214,18 @@ nn::GeneralResult PreparedModel::createReusableExecution( auto aidlRequest = NN_TRY(convert(requestInShared)); auto aidlMeasure = NN_TRY(convert(measure)); auto aidlLoopTimeoutDuration = NN_TRY(convert(loopTimeoutDuration)); - return Execution::create(shared_from_this(), std::move(aidlRequest), std::move(relocation), - aidlMeasure, aidlLoopTimeoutDuration); + + if (kFeatureLevel.level >= nn::Version::Level::FEATURE_LEVEL_8) { + std::shared_ptr execution; + const auto ret = kPreparedModel->createReusableExecution( + aidlRequest, aidlMeasure, aidlLoopTimeoutDuration, &execution); + HANDLE_ASTATUS(ret) << "createReusableExecution failed"; + return Execution::create(std::move(execution), std::move(relocation)); + } + + return ExecutionWithCachedRequest::create(shared_from_this(), std::move(aidlRequest), + std::move(relocation), aidlMeasure, + aidlLoopTimeoutDuration); } nn::GeneralResult PreparedModel::configureExecutionBurst() const { @@ -218,4 +240,36 @@ std::any PreparedModel::getUnderlyingResource() const { return resource; } +nn::ExecutionResult, nn::Timing>> Execution::compute( + const nn::OptionalTimePoint& deadline) const { + const auto aidlDeadline = NN_TRY(convert(deadline)); + + if (kRelocation.input) { + kRelocation.input->flush(); + } + + ExecutionResult executionResult; + auto ret = kExecution->executeSynchronously(aidlDeadline, &executionResult); + HANDLE_ASTATUS(ret) << "executeSynchronously failed"; + return handleExecutionResult(executionResult, kRelocation); +} + +nn::GeneralResult> Execution::computeFenced( + const std::vector& waitFor, const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& timeoutDurationAfterFence) const { + const auto aidlWaitFor = NN_TRY(convert(waitFor)); + const auto aidlDeadline = NN_TRY(convert(deadline)); + const auto aidlTimeoutDurationAfterFence = NN_TRY(convert(timeoutDurationAfterFence)); + + if (kRelocation.input) { + kRelocation.input->flush(); + } + + FencedExecutionResult result; + const auto ret = kExecution->executeFenced(aidlWaitFor, aidlDeadline, + aidlTimeoutDurationAfterFence, &result); + HANDLE_ASTATUS(ret) << "executeFenced failed"; + return handleFencedExecutionResult(result, kRelocation); +} + } // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/test/DeviceTest.cpp b/neuralnetworks/aidl/utils/test/DeviceTest.cpp index 0366e7dff0..fb13af8d9f 100644 --- a/neuralnetworks/aidl/utils/test/DeviceTest.cpp +++ b/neuralnetworks/aidl/utils/test/DeviceTest.cpp @@ -17,6 +17,7 @@ #include "MockBuffer.h" #include "MockDevice.h" #include "MockPreparedModel.h" +#include "TestUtils.h" #include #include @@ -146,26 +147,7 @@ constexpr auto makeDeadObjectFailure = [] { return ndk::ScopedAStatus::fromStatus(STATUS_DEAD_OBJECT); }; -class DeviceTest : public ::testing::TestWithParam { - protected: - const nn::Version kVersion = GetParam(); -}; - -std::string printDeviceTest(const testing::TestParamInfo& info) { - const nn::Version version = info.param; - CHECK(!version.runtimeOnlyFeatures); - switch (version.level) { - case nn::Version::Level::FEATURE_LEVEL_5: - return "v1"; - case nn::Version::Level::FEATURE_LEVEL_6: - return "v2"; - case nn::Version::Level::FEATURE_LEVEL_7: - return "v3"; - default: - LOG(FATAL) << "Invalid AIDL version: " << version; - return "invalid"; - } -} +class DeviceTest : public VersionedAidlUtilsTestBase {}; } // namespace @@ -894,9 +876,6 @@ TEST_P(DeviceTest, allocateDeadObject) { EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); } -INSTANTIATE_TEST_SUITE_P(TestDevice, DeviceTest, - ::testing::Values(nn::kVersionFeatureLevel5, nn::kVersionFeatureLevel6, - nn::kVersionFeatureLevel7), - printDeviceTest); +INSTANTIATE_VERSIONED_AIDL_UTILS_TEST(DeviceTest, kAllAidlVersions); } // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/test/ExecutionTest.cpp b/neuralnetworks/aidl/utils/test/ExecutionTest.cpp new file mode 100644 index 0000000000..8519290145 --- /dev/null +++ b/neuralnetworks/aidl/utils/test/ExecutionTest.cpp @@ -0,0 +1,254 @@ +/* + * 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 "MockExecution.h" +#include "MockFencedExecutionCallback.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace aidl::android::hardware::neuralnetworks::utils { +namespace { + +using ::testing::_; +using ::testing::DoAll; +using ::testing::Invoke; +using ::testing::InvokeWithoutArgs; +using ::testing::SetArgPointee; + +const std::shared_ptr kInvalidExecution; +constexpr auto kNoTiming = Timing{.timeOnDeviceNs = -1, .timeInDriverNs = -1}; + +constexpr auto makeStatusOk = [] { return ndk::ScopedAStatus::ok(); }; + +constexpr auto makeGeneralFailure = [] { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(ErrorStatus::GENERAL_FAILURE)); +}; +constexpr auto makeGeneralTransportFailure = [] { + return ndk::ScopedAStatus::fromStatus(STATUS_NO_MEMORY); +}; +constexpr auto makeDeadObjectFailure = [] { + return ndk::ScopedAStatus::fromStatus(STATUS_DEAD_OBJECT); +}; + +auto makeFencedExecutionResult(const std::shared_ptr& callback) { + return [callback](const std::vector& /*waitFor*/, + int64_t /*deadline*/, int64_t /*duration*/, + FencedExecutionResult* fencedExecutionResult) { + *fencedExecutionResult = FencedExecutionResult{.callback = callback, + .syncFence = ndk::ScopedFileDescriptor(-1)}; + return ndk::ScopedAStatus::ok(); + }; +} + +} // namespace + +TEST(ExecutionTest, invalidExecution) { + // run test + const auto result = Execution::create(kInvalidExecution, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(ExecutionTest, executeSync) { + // setup call + const auto mockExecution = MockExecution::create(); + const auto execution = Execution::create(mockExecution, {}).value(); + const auto mockExecutionResult = ExecutionResult{ + .outputSufficientSize = true, + .outputShapes = {}, + .timing = kNoTiming, + }; + EXPECT_CALL(*mockExecution, executeSynchronously(_, _)) + .Times(1) + .WillOnce( + DoAll(SetArgPointee<1>(mockExecutionResult), InvokeWithoutArgs(makeStatusOk))); + + // run test + const auto result = execution->compute({}); + + // verify result + EXPECT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; +} + +TEST(ExecutionTest, executeSyncError) { + // setup test + const auto mockExecution = MockExecution::create(); + const auto execution = Execution::create(mockExecution, {}).value(); + EXPECT_CALL(*mockExecution, executeSynchronously(_, _)) + .Times(1) + .WillOnce(Invoke(makeGeneralFailure)); + + // run test + const auto result = execution->compute({}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(ExecutionTest, executeSyncTransportFailure) { + // setup test + const auto mockExecution = MockExecution::create(); + const auto execution = Execution::create(mockExecution, {}).value(); + EXPECT_CALL(*mockExecution, executeSynchronously(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = execution->compute({}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(ExecutionTest, executeSyncDeadObject) { + // setup test + const auto mockExecution = MockExecution::create(); + const auto execution = Execution::create(mockExecution, {}).value(); + EXPECT_CALL(*mockExecution, executeSynchronously(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = execution->compute({}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST(ExecutionTest, executeFenced) { + // setup call + const auto mockExecution = MockExecution::create(); + const auto execution = Execution::create(mockExecution, {}).value(); + const auto mockCallback = MockFencedExecutionCallback::create(); + EXPECT_CALL(*mockCallback, getExecutionInfo(_, _, _)) + .Times(1) + .WillOnce(DoAll(SetArgPointee<0>(kNoTiming), SetArgPointee<1>(kNoTiming), + SetArgPointee<2>(ErrorStatus::NONE), Invoke(makeStatusOk))); + EXPECT_CALL(*mockExecution, executeFenced(_, _, _, _)) + .Times(1) + .WillOnce(Invoke(makeFencedExecutionResult(mockCallback))); + + // run test + const auto result = execution->computeFenced({}, {}, {}); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + const auto& [syncFence, callback] = result.value(); + EXPECT_EQ(syncFence.syncWait({}), nn::SyncFence::FenceState::SIGNALED); + ASSERT_NE(callback, nullptr); + + // get results from callback + const auto callbackResult = callback(); + ASSERT_TRUE(callbackResult.has_value()) << "Failed with " << callbackResult.error().code << ": " + << callbackResult.error().message; +} + +TEST(ExecutionTest, executeFencedCallbackError) { + // setup call + const auto mockExecution = MockExecution::create(); + const auto execution = Execution::create(mockExecution, {}).value(); + const auto mockCallback = MockFencedExecutionCallback::create(); + EXPECT_CALL(*mockCallback, getExecutionInfo(_, _, _)) + .Times(1) + .WillOnce(Invoke(DoAll(SetArgPointee<0>(kNoTiming), SetArgPointee<1>(kNoTiming), + SetArgPointee<2>(ErrorStatus::GENERAL_FAILURE), + Invoke(makeStatusOk)))); + EXPECT_CALL(*mockExecution, executeFenced(_, _, _, _)) + .Times(1) + .WillOnce(Invoke(makeFencedExecutionResult(mockCallback))); + + // run test + const auto result = execution->computeFenced({}, {}, {}); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + const auto& [syncFence, callback] = result.value(); + EXPECT_NE(syncFence.syncWait({}), nn::SyncFence::FenceState::ACTIVE); + ASSERT_NE(callback, nullptr); + + // verify callback failure + const auto callbackResult = callback(); + ASSERT_FALSE(callbackResult.has_value()); + EXPECT_EQ(callbackResult.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(ExecutionTest, executeFencedError) { + // setup test + const auto mockExecution = MockExecution::create(); + const auto execution = Execution::create(mockExecution, {}).value(); + EXPECT_CALL(*mockExecution, executeFenced(_, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); + + // run test + const auto result = execution->computeFenced({}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(ExecutionTest, executeFencedTransportFailure) { + // setup test + const auto mockExecution = MockExecution::create(); + const auto execution = Execution::create(mockExecution, {}).value(); + EXPECT_CALL(*mockExecution, executeFenced(_, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = execution->computeFenced({}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST(ExecutionTest, executeFencedDeadObject) { + // setup test + const auto mockExecution = MockExecution::create(); + const auto execution = Execution::create(mockExecution, {}).value(); + EXPECT_CALL(*mockExecution, executeFenced(_, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = execution->computeFenced({}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/test/MockExecution.h b/neuralnetworks/aidl/utils/test/MockExecution.h new file mode 100644 index 0000000000..216f569abc --- /dev/null +++ b/neuralnetworks/aidl/utils/test/MockExecution.h @@ -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. + */ + +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_EXECUTION_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_EXECUTION_H + +#include +#include +#include +#include +#include +#include + +namespace aidl::android::hardware::neuralnetworks::utils { + +class MockExecution final : public BnExecution { + public: + static std::shared_ptr create(); + + MOCK_METHOD(ndk::ScopedAStatus, executeSynchronously, + (int64_t deadline, ExecutionResult* executionResult), (override)); + MOCK_METHOD(ndk::ScopedAStatus, executeFenced, + (const std::vector& waitFor, int64_t deadline, + int64_t duration, FencedExecutionResult* fencedExecutionResult), + (override)); +}; + +inline std::shared_ptr MockExecution::create() { + return ndk::SharedRefBase::make(); +} + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_EXECUTION_H diff --git a/neuralnetworks/aidl/utils/test/MockPreparedModel.h b/neuralnetworks/aidl/utils/test/MockPreparedModel.h index a4ae2b778a..0ed9af9929 100644 --- a/neuralnetworks/aidl/utils/test/MockPreparedModel.h +++ b/neuralnetworks/aidl/utils/test/MockPreparedModel.h @@ -17,6 +17,7 @@ #ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_PREPARED_MODEL_H #define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_MOCK_PREPARED_MODEL_H +#include #include #include #include @@ -41,6 +42,10 @@ class MockPreparedModel final : public BnPreparedModel { (override)); MOCK_METHOD(ndk::ScopedAStatus, configureExecutionBurst, (std::shared_ptr * burst), (override)); + MOCK_METHOD(ndk::ScopedAStatus, createReusableExecution, + (const Request& request, bool measureTiming, int64_t loopTimeoutDuration, + std::shared_ptr* execution), + (override)); }; inline std::shared_ptr MockPreparedModel::create() { diff --git a/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp b/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp index 8bb5c90d1e..8cfb7c123a 100644 --- a/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp +++ b/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp @@ -15,8 +15,10 @@ */ #include "MockBurst.h" +#include "MockExecution.h" #include "MockFencedExecutionCallback.h" #include "MockPreparedModel.h" +#include "TestUtils.h" #include #include @@ -66,21 +68,23 @@ auto makeFencedExecutionResult(const std::shared_ptr= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup call const uint32_t kNumberOfComputations = 2; const auto mockPreparedModel = MockPreparedModel::create(); - const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); const auto mockExecutionResult = ExecutionResult{ .outputSufficientSize = true, .outputShapes = {}, @@ -283,10 +289,12 @@ TEST(PreparedModelTest, reusableExecuteSync) { } } -TEST(PreparedModelTest, reusableExecuteSyncError) { +TEST_P(PreparedModelTest, reusableExecuteSyncError) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup test const auto mockPreparedModel = MockPreparedModel::create(); - const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); EXPECT_CALL(*mockPreparedModel, executeSynchronously(_, _, _, _, _)) .Times(1) .WillOnce(Invoke(makeGeneralFailure)); @@ -303,10 +311,12 @@ TEST(PreparedModelTest, reusableExecuteSyncError) { EXPECT_EQ(computeResult.error().code, nn::ErrorStatus::GENERAL_FAILURE); } -TEST(PreparedModelTest, reusableExecuteSyncTransportFailure) { +TEST_P(PreparedModelTest, reusableExecuteSyncTransportFailure) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup test const auto mockPreparedModel = MockPreparedModel::create(); - const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); EXPECT_CALL(*mockPreparedModel, executeSynchronously(_, _, _, _, _)) .Times(1) .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); @@ -323,10 +333,12 @@ TEST(PreparedModelTest, reusableExecuteSyncTransportFailure) { EXPECT_EQ(computeResult.error().code, nn::ErrorStatus::GENERAL_FAILURE); } -TEST(PreparedModelTest, reusableExecuteSyncDeadObject) { +TEST_P(PreparedModelTest, reusableExecuteSyncDeadObject) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup test const auto mockPreparedModel = MockPreparedModel::create(); - const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); EXPECT_CALL(*mockPreparedModel, executeSynchronously(_, _, _, _, _)) .Times(1) .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); @@ -343,11 +355,13 @@ TEST(PreparedModelTest, reusableExecuteSyncDeadObject) { EXPECT_EQ(computeResult.error().code, nn::ErrorStatus::DEAD_OBJECT); } -TEST(PreparedModelTest, reusableExecuteFenced) { +TEST_P(PreparedModelTest, reusableExecuteFenced) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup call const uint32_t kNumberOfComputations = 2; const auto mockPreparedModel = MockPreparedModel::create(); - const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); const auto mockCallback = MockFencedExecutionCallback::create(); EXPECT_CALL(*mockCallback, getExecutionInfo(_, _, _)) .Times(kNumberOfComputations) @@ -379,10 +393,12 @@ TEST(PreparedModelTest, reusableExecuteFenced) { } } -TEST(PreparedModelTest, reusableExecuteFencedCallbackError) { +TEST_P(PreparedModelTest, reusableExecuteFencedCallbackError) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup call const auto mockPreparedModel = MockPreparedModel::create(); - const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); const auto mockCallback = MockFencedExecutionCallback::create(); EXPECT_CALL(*mockCallback, getExecutionInfo(_, _, _)) .Times(1) @@ -413,10 +429,12 @@ TEST(PreparedModelTest, reusableExecuteFencedCallbackError) { EXPECT_EQ(callbackResult.error().code, nn::ErrorStatus::GENERAL_FAILURE); } -TEST(PreparedModelTest, reusableExecuteFencedError) { +TEST_P(PreparedModelTest, reusableExecuteFencedError) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup test const auto mockPreparedModel = MockPreparedModel::create(); - const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _, _)) .Times(1) .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); @@ -433,10 +451,12 @@ TEST(PreparedModelTest, reusableExecuteFencedError) { EXPECT_EQ(computeResult.error().code, nn::ErrorStatus::GENERAL_FAILURE); } -TEST(PreparedModelTest, reusableExecuteFencedTransportFailure) { +TEST_P(PreparedModelTest, reusableExecuteFencedTransportFailure) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup test const auto mockPreparedModel = MockPreparedModel::create(); - const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _, _)) .Times(1) .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); @@ -453,10 +473,12 @@ TEST(PreparedModelTest, reusableExecuteFencedTransportFailure) { EXPECT_EQ(computeResult.error().code, nn::ErrorStatus::GENERAL_FAILURE); } -TEST(PreparedModelTest, reusableExecuteFencedDeadObject) { +TEST_P(PreparedModelTest, reusableExecuteFencedDeadObject) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup test const auto mockPreparedModel = MockPreparedModel::create(); - const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _, _)) .Times(1) .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); @@ -473,14 +495,14 @@ TEST(PreparedModelTest, reusableExecuteFencedDeadObject) { EXPECT_EQ(computeResult.error().code, nn::ErrorStatus::DEAD_OBJECT); } -TEST(PreparedModelTest, configureExecutionBurst) { +TEST_P(PreparedModelTest, configureExecutionBurst) { // setup test const auto mockPreparedModel = MockPreparedModel::create(); const auto mockBurst = ndk::SharedRefBase::make(); EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_)) .Times(1) .WillOnce(DoAll(SetArgPointee<0>(mockBurst), Invoke(makeStatusOk))); - const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); // run test const auto result = preparedModel->configureExecutionBurst(); @@ -491,13 +513,13 @@ TEST(PreparedModelTest, configureExecutionBurst) { EXPECT_NE(result.value(), nullptr); } -TEST(PreparedModelTest, configureExecutionBurstError) { +TEST_P(PreparedModelTest, configureExecutionBurstError) { // setup test const auto mockPreparedModel = MockPreparedModel::create(); EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_)) .Times(1) .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); - const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); // run test const auto result = preparedModel->configureExecutionBurst(); @@ -507,13 +529,13 @@ TEST(PreparedModelTest, configureExecutionBurstError) { EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); } -TEST(PreparedModelTest, configureExecutionBurstTransportFailure) { +TEST_P(PreparedModelTest, configureExecutionBurstTransportFailure) { // setup test const auto mockPreparedModel = MockPreparedModel::create(); EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_)) .Times(1) .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); - const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); // run test const auto result = preparedModel->configureExecutionBurst(); @@ -523,13 +545,13 @@ TEST(PreparedModelTest, configureExecutionBurstTransportFailure) { EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); } -TEST(PreparedModelTest, configureExecutionBurstDeadObject) { +TEST_P(PreparedModelTest, configureExecutionBurstDeadObject) { // setup test const auto mockPreparedModel = MockPreparedModel::create(); EXPECT_CALL(*mockPreparedModel, configureExecutionBurst(_)) .Times(1) .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); - const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); // run test const auto result = preparedModel->configureExecutionBurst(); @@ -539,10 +561,84 @@ TEST(PreparedModelTest, configureExecutionBurstDeadObject) { EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); } -TEST(PreparedModelTest, getUnderlyingResource) { +TEST_P(PreparedModelTest, createReusableExecution) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto mockExecution = ndk::SharedRefBase::make(); + EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _, _)) + .Times(1) + .WillOnce(DoAll(SetArgPointee<3>(mockExecution), Invoke(makeStatusOk))); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); + + // run test + const auto result = preparedModel->createReusableExecution({}, {}, {}); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + EXPECT_NE(result.value(), nullptr); +} + +TEST_P(PreparedModelTest, createReusableExecutionError) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + // setup test const auto mockPreparedModel = MockPreparedModel::create(); - const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); + + // run test + const auto result = preparedModel->createReusableExecution({}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST_P(PreparedModelTest, createReusableExecutionTransportFailure) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); + + // run test + const auto result = preparedModel->createReusableExecution({}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST_P(PreparedModelTest, createReusableExecutionDeadObject) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); + + // run test + const auto result = preparedModel->createReusableExecution({}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST_P(PreparedModelTest, getUnderlyingResource) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); // run test const auto resource = preparedModel->getUnderlyingResource(); @@ -554,4 +650,6 @@ TEST(PreparedModelTest, getUnderlyingResource) { EXPECT_EQ(maybeMock->get(), mockPreparedModel.get()); } +INSTANTIATE_VERSIONED_AIDL_UTILS_TEST(PreparedModelTest, kAllAidlVersions); + } // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/test/TestUtils.cpp b/neuralnetworks/aidl/utils/test/TestUtils.cpp new file mode 100644 index 0000000000..9abec883a6 --- /dev/null +++ b/neuralnetworks/aidl/utils/test/TestUtils.cpp @@ -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. + */ + +#include "TestUtils.h" + +#include +#include +#include +#include +#include +#include + +namespace aidl::android::hardware::neuralnetworks::utils { + +std::string printTestVersion(const testing::TestParamInfo& info) { + switch (info.param.level) { + case nn::Version::Level::FEATURE_LEVEL_5: + return "v1"; + case nn::Version::Level::FEATURE_LEVEL_6: + return "v2"; + case nn::Version::Level::FEATURE_LEVEL_7: + return "v3"; + case nn::Version::Level::FEATURE_LEVEL_8: + return "v4"; + default: + LOG(FATAL) << "Invalid AIDL version: " << info.param; + return "invalid"; + } +} + +} // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/test/TestUtils.h b/neuralnetworks/aidl/utils/test/TestUtils.h new file mode 100644 index 0000000000..23f734a47a --- /dev/null +++ b/neuralnetworks/aidl/utils/test/TestUtils.h @@ -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. + */ + +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_TEST_UTILS_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_TEST_UTILS_H + +#include +#include +#include +#include + +namespace aidl::android::hardware::neuralnetworks::utils { + +class VersionedAidlUtilsTestBase : public ::testing::TestWithParam { + protected: + const nn::Version kVersion = GetParam(); +}; + +std::string printTestVersion(const testing::TestParamInfo& info); + +inline const auto kAllAidlVersions = + ::testing::Values(nn::kVersionFeatureLevel5, nn::kVersionFeatureLevel6, + nn::kVersionFeatureLevel7, nn::kVersionFeatureLevel8); + +#define INSTANTIATE_VERSIONED_AIDL_UTILS_TEST(TestSuite, versions) \ + INSTANTIATE_TEST_SUITE_P(Versioned, TestSuite, versions, printTestVersion) + +} // namespace aidl::android::hardware::neuralnetworks::utils + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_AIDL_UTILS_TEST_TEST_UTILS_H diff --git a/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp b/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp index cd5475c0d3..b3e9c633e3 100644 --- a/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp +++ b/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp @@ -208,6 +208,11 @@ class InvalidPreparedModel : public BnPreparedModel { return ndk::ScopedAStatus::fromServiceSpecificError( static_cast(ErrorStatus::GENERAL_FAILURE)); } + ndk::ScopedAStatus createReusableExecution(const aidl_hal::Request&, bool, int64_t, + std::shared_ptr*) override { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(ErrorStatus::GENERAL_FAILURE)); + } }; template diff --git a/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/Execution.h b/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/Execution.h new file mode 100644 index 0000000000..6a9ac57fbe --- /dev/null +++ b/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/Execution.h @@ -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. + */ + +#ifndef ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_AIDL_EXECUTION_H +#define ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_AIDL_EXECUTION_H + +#include "nnapi/hal/aidl/Adapter.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +// See hardware/interfaces/neuralnetworks/utils/README.md for more information on AIDL interface +// lifetimes across processes and for protecting asynchronous calls across AIDL. + +namespace aidl::android::hardware::neuralnetworks::adapter { + +// Class that adapts nn::IExecution to BnExecution. +class Execution : public BnExecution { + public: + explicit Execution(::android::nn::SharedExecution execution); + + ndk::ScopedAStatus executeSynchronously(int64_t deadlineNs, + ExecutionResult* executionResult) override; + ndk::ScopedAStatus executeFenced(const std::vector& waitFor, + int64_t deadlineNs, int64_t durationNs, + FencedExecutionResult* fencedExecutionResult) override; + + protected: + const ::android::nn::SharedExecution kExecution; +}; + +} // namespace aidl::android::hardware::neuralnetworks::adapter + +#endif // ANDROID_HARDWARE_INTERFACES_NEURALNETWORKS_UTILS_ADAPTER_AIDL_EXECUTION_H diff --git a/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/PreparedModel.h b/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/PreparedModel.h index 93e0427426..f92b0bc783 100644 --- a/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/PreparedModel.h +++ b/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/PreparedModel.h @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -50,6 +51,9 @@ class PreparedModel : public BnPreparedModel { int64_t loopTimeoutDurationNs, int64_t durationNs, FencedExecutionResult* executionResult) override; ndk::ScopedAStatus configureExecutionBurst(std::shared_ptr* burst) override; + ndk::ScopedAStatus createReusableExecution(const Request& request, bool measureTiming, + int64_t loopTimeoutDurationNs, + std::shared_ptr* execution) override; ::android::nn::SharedPreparedModel getUnderlyingPreparedModel() const; diff --git a/neuralnetworks/utils/adapter/aidl/src/PreparedModel.cpp b/neuralnetworks/utils/adapter/aidl/src/PreparedModel.cpp index 71ed1a857b..5cab62c625 100644 --- a/neuralnetworks/utils/adapter/aidl/src/PreparedModel.cpp +++ b/neuralnetworks/utils/adapter/aidl/src/PreparedModel.cpp @@ -17,6 +17,7 @@ #include "PreparedModel.h" #include "Burst.h" +#include "Execution.h" #include #include @@ -26,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -167,6 +169,56 @@ nn::GeneralResult executeFenced( .syncFence = std::move(fileDescriptor)}; } +nn::GeneralResult createReusableExecution( + const nn::IPreparedModel& preparedModel, const Request& request, bool measureTiming, + int64_t loopTimeoutDurationNs) { + const auto nnRequest = NN_TRY(convertInput(request)); + const auto nnMeasureTiming = measureTiming ? nn::MeasureTiming::YES : nn::MeasureTiming::NO; + const auto nnLoopTimeoutDuration = NN_TRY(makeOptionalDuration(loopTimeoutDurationNs)); + return preparedModel.createReusableExecution(nnRequest, nnMeasureTiming, nnLoopTimeoutDuration); +} + +nn::ExecutionResult executeSynchronously(const nn::IExecution& execution, + int64_t deadlineNs) { + const auto nnDeadline = NN_TRY(makeOptionalTimePoint(deadlineNs)); + + const auto result = execution.compute(nnDeadline); + + if (!result.ok() && result.error().code == nn::ErrorStatus::OUTPUT_INSUFFICIENT_SIZE) { + const auto& [message, code, outputShapes] = result.error(); + LOG(ERROR) << "executeSynchronously failed with " << code << ": " << message; + return ExecutionResult{.outputSufficientSize = false, + .outputShapes = utils::convert(outputShapes).value(), + .timing = {.timeInDriverNs = -1, .timeOnDeviceNs = -1}}; + } + + const auto& [outputShapes, timing] = NN_TRY(result); + return ExecutionResult{.outputSufficientSize = true, + .outputShapes = utils::convert(outputShapes).value(), + .timing = utils::convert(timing).value()}; +} + +nn::GeneralResult executeFenced( + const nn::IExecution& execution, const std::vector& waitFor, + int64_t deadlineNs, int64_t durationNs) { + const auto nnWaitFor = NN_TRY(convertSyncFences(waitFor)); + const auto nnDeadline = NN_TRY(makeOptionalTimePoint(deadlineNs)); + const auto nnDuration = NN_TRY(makeOptionalDuration(durationNs)); + + auto [syncFence, executeFencedInfoCallback] = + NN_TRY(execution.computeFenced(nnWaitFor, nnDeadline, nnDuration)); + + ndk::ScopedFileDescriptor fileDescriptor; + if (syncFence.hasFd()) { + auto uniqueFd = NN_TRY(nn::dupFd(syncFence.getFd())); + fileDescriptor = ndk::ScopedFileDescriptor(uniqueFd.release()); + } + + return FencedExecutionResult{.callback = ndk::SharedRefBase::make( + std::move(executeFencedInfoCallback)), + .syncFence = std::move(fileDescriptor)}; +} + } // namespace PreparedModel::PreparedModel(nn::SharedPreparedModel preparedModel) @@ -222,4 +274,51 @@ nn::SharedPreparedModel PreparedModel::getUnderlyingPreparedModel() const { return kPreparedModel; } +ndk::ScopedAStatus PreparedModel::createReusableExecution(const Request& request, + bool measureTiming, + int64_t loopTimeoutDurationNs, + std::shared_ptr* execution) { + auto result = adapter::createReusableExecution(*kPreparedModel, request, measureTiming, + loopTimeoutDurationNs); + if (!result.has_value()) { + const auto& [message, code] = result.error(); + const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); + return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( + static_cast(aidlCode), message.c_str()); + } + *execution = ndk::SharedRefBase::make(std::move(result).value()); + return ndk::ScopedAStatus::ok(); +} + +Execution::Execution(nn::SharedExecution execution) : kExecution(std::move(execution)) { + CHECK(kExecution != nullptr); +} + +ndk::ScopedAStatus Execution::executeSynchronously(int64_t deadlineNs, + ExecutionResult* executionResult) { + auto result = adapter::executeSynchronously(*kExecution, deadlineNs); + if (!result.has_value()) { + const auto& [message, code, _] = result.error(); + const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); + return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( + static_cast(aidlCode), message.c_str()); + } + *executionResult = std::move(result).value(); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus Execution::executeFenced(const std::vector& waitFor, + int64_t deadlineNs, int64_t durationNs, + FencedExecutionResult* executionResult) { + auto result = adapter::executeFenced(*kExecution, waitFor, deadlineNs, durationNs); + if (!result.has_value()) { + const auto& [message, code] = result.error(); + const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); + return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( + static_cast(aidlCode), message.c_str()); + } + *executionResult = std::move(result).value(); + return ndk::ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::neuralnetworks::adapter -- GitLab From 38dd4789016954fc5797d141f9d9ff4825024c2e Mon Sep 17 00:00:00 2001 From: David Gross Date: Wed, 17 Nov 2021 15:39:18 -0800 Subject: [PATCH 431/825] Add NNAPI specification and infrastructure for FL7. Adds operations MIRROR_PAD and REVERSE. Extends RSQRT to support QUANT8_ASYMM and QUANT8_ASYMM_SIGNED. DOES NOT include tests or CPU reference implementation. (This is a slightly non-trivial cherry pick that had to be hand-edited to compensate for the fact that certain nn::Version changes are absent from the target branch.) Bug: 202280917 Test: NeuralNetworksTest_static Test: VtsHalNeuralnetworksTargetTest Merged-In: I0b2133346b996849faac00c46885e3633c78f024 Change-Id: I0b2133346b996849faac00c46885e3633c78f024 (cherry picked from commit 04ed8595b5587e9f6e71ac45edd17cf92da56c32) --- .../compatibility_matrix.current.xml | 2 +- .../neuralnetworks/OperationType.aidl | 2 + .../neuralnetworks/OperationType.aidl | 69 +++++++++++++++++++ neuralnetworks/aidl/utils/Android.bp | 2 +- .../aidl/utils/include/nnapi/hal/aidl/Utils.h | 2 +- 5 files changed, 74 insertions(+), 3 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index eb6ead3851..baf31e234e 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -396,7 +396,7 @@ android.hardware.neuralnetworks - 1-2 + 1-3 IDevice .* diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl index 2eff11b146..34506c8860 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/OperationType.aidl @@ -138,4 +138,6 @@ enum OperationType { RANK = 101, BATCH_MATMUL = 102, PACK = 103, + MIRROR_PAD = 104, + REVERSE = 105, } diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl index 3499fc1af8..0b745a966b 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl @@ -4229,6 +4229,8 @@ enum OperationType { * Supported tensor {@link OperandType}: * * {@link OperandType::TENSOR_FLOAT16} * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} (since NNAPI feature level 7) + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} (since NNAPI feature level 7) * * Supported tensor rank: from 1. * @@ -4237,6 +4239,9 @@ enum OperationType { * * Outputs: * * 0: The output tensor of same shape as input0. + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint can be different from inputs' scale and zeroPoint. */ RSQRT = 83, /** @@ -5214,4 +5219,68 @@ enum OperationType { * * 0: The packed tensor. */ PACK = 103, + + /** + * Pads a tensor with mirrored values. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * * {@link OperandType::TENSOR_INT32} + * + * Supported tensor rank: from 1. + * + * Inputs: + * * 0: An n-D tensor, specifying the tensor to be padded. + * * 1: A 2-D tensor of {@link OperandType::TENSOR_INT32}, the paddings + * for each spatial dimension of the input tensor. The shape of the + * tensor must be {rank(input0), 2}. + * padding[i, 0] specifies the number of elements to be padded in the + * front of dimension i. + * padding[i, 1] specifies the number of elements to be padded after the + * end of dimension i. + * * 2: An {@link OperandType::INT32} scalar, specifying the mode. + * Options are 0:REFLECT and 1:SYMMETRIC. + * + * Outputs: + * * 0: A tensor of the same {@link OperandType} as input0. The + * output tensor has the same rank as input0, and each + * dimension of the output tensor has the same size as the + * corresponding dimension of the input tensor plus the size + * of the padding: + * output0.dimension[i] = + * padding[i, 0] + input0.dimension[i] + padding[i, 1] + * For a {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensor, + * the scale and zeroPoint must be the same as input0. + */ + MIRROR_PAD = 104, + + /** + * Reverses a specified dimension of a tensor. + * + * Supported tensor {@link OperandType}: + * * {@link OperandType::TENSOR_FLOAT16} + * * {@link OperandType::TENSOR_FLOAT32} + * * {@link OperandType::TENSOR_QUANT8_ASYMM} + * * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} + * * {@link OperandType::TENSOR_INT32} + * + * Supported tensor rank: up to 8. + * + * Inputs: + * * 0: Input tensor of rank n. + * * 1: Axis tensor of type {@link OperandType::TENSOR_INT32} and shape [1], + * specifying which dimension of the input tensor is to be reversed. The dimension + * must be in the range [0, n). + * + * Outputs: + * * 0: The reversed tensor. + * For {@link OperandType::TENSOR_QUANT8_ASYMM} and + * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensors, + * the scales and zeroPoint must be the same as input0. + */ + REVERSE = 105, } diff --git a/neuralnetworks/aidl/utils/Android.bp b/neuralnetworks/aidl/utils/Android.bp index 872e4e8581..5a6a080653 100644 --- a/neuralnetworks/aidl/utils/Android.bp +++ b/neuralnetworks/aidl/utils/Android.bp @@ -38,7 +38,7 @@ cc_library_static { "neuralnetworks_utils_hal_common", ], shared_libs: [ - "android.hardware.neuralnetworks-V2-ndk", + "android.hardware.neuralnetworks-V3-ndk", "libbinder_ndk", "libhidlbase", "libnativewindow", diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h index 72cf73e136..03530955ca 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Utils.h @@ -29,7 +29,7 @@ namespace aidl::android::hardware::neuralnetworks::utils { constexpr auto kDefaultPriority = Priority::MEDIUM; -constexpr auto kVersion = nn::Version::FEATURE_LEVEL_6; +constexpr auto kVersion = nn::Version::FEATURE_LEVEL_7; template nn::Result validate(const Type& halObject) { -- GitLab From 8cfb70f93ef39ff5b3ad11dacc2e1f961a5602ca Mon Sep 17 00:00:00 2001 From: David Gross Date: Wed, 12 Jan 2022 14:18:36 -0800 Subject: [PATCH 432/825] Freeze neuralnetworks AIDL version as v3 for FL7 $ m android.hardware.neuralnetworks-update-api $ m android.hardware.neuralnetworks-freeze-api (This cherry pick required hand editing to change makefile references from android.hardware.neuralnetworks-V2-ndk to android.hardware.neuralnetworks-V3-ndk.) Bug: 202280925 Test: adb shell NeuralNetworksTest_static Test: atest VtsHalNeuralnetworksTargetTest Merged-In: I2b2755d7376bb847b15b395e280bf352b5b9ef55 Change-Id: I2b2755d7376bb847b15b395e280bf352b5b9ef55 (cherry picked from commit 68e4300c72a8646f085b94e309abc5b6edd300e8) --- neuralnetworks/1.3/vts/functional/Android.bp | 2 +- neuralnetworks/aidl/Android.bp | 1 + .../android.hardware.neuralnetworks/3/.hash | 1 + .../hardware/neuralnetworks/BufferDesc.aidl | 38 +++++ .../hardware/neuralnetworks/BufferRole.aidl | 40 +++++ .../hardware/neuralnetworks/Capabilities.aidl | 42 +++++ .../hardware/neuralnetworks/DataLocation.aidl | 41 +++++ .../hardware/neuralnetworks/DeviceBuffer.aidl | 39 +++++ .../hardware/neuralnetworks/DeviceType.aidl | 41 +++++ .../hardware/neuralnetworks/ErrorStatus.aidl | 46 ++++++ .../neuralnetworks/ExecutionPreference.aidl | 40 +++++ .../neuralnetworks/ExecutionResult.aidl | 40 +++++ .../hardware/neuralnetworks/Extension.aidl | 39 +++++ .../ExtensionNameAndPrefix.aidl | 39 +++++ .../ExtensionOperandTypeInformation.aidl | 40 +++++ .../neuralnetworks/FencedExecutionResult.aidl | 39 +++++ .../neuralnetworks/FusedActivationFunc.aidl | 41 +++++ .../hardware/neuralnetworks/IBuffer.aidl | 39 +++++ .../hardware/neuralnetworks/IBurst.aidl | 39 +++++ .../hardware/neuralnetworks/IDevice.aidl | 52 +++++++ .../IFencedExecutionCallback.aidl | 38 +++++ .../neuralnetworks/IPreparedModel.aidl | 42 +++++ .../IPreparedModelCallback.aidl | 38 +++++ .../neuralnetworks/IPreparedModelParcel.aidl | 38 +++++ .../hardware/neuralnetworks/Memory.aidl | 40 +++++ .../hardware/neuralnetworks/Model.aidl | 43 ++++++ .../neuralnetworks/NumberOfCacheFiles.aidl | 39 +++++ .../hardware/neuralnetworks/Operand.aidl | 44 ++++++ .../neuralnetworks/OperandExtraParams.aidl | 39 +++++ .../neuralnetworks/OperandLifeTime.aidl | 44 ++++++ .../neuralnetworks/OperandPerformance.aidl | 39 +++++ .../hardware/neuralnetworks/OperandType.aidl | 53 +++++++ .../hardware/neuralnetworks/Operation.aidl | 40 +++++ .../neuralnetworks/OperationType.aidl | 143 ++++++++++++++++++ .../hardware/neuralnetworks/OutputShape.aidl | 39 +++++ .../neuralnetworks/PerformanceInfo.aidl | 39 +++++ .../hardware/neuralnetworks/Priority.aidl | 40 +++++ .../hardware/neuralnetworks/Request.aidl | 40 +++++ .../neuralnetworks/RequestArgument.aidl | 40 +++++ .../neuralnetworks/RequestMemoryPool.aidl | 39 +++++ .../hardware/neuralnetworks/Subgraph.aidl | 41 +++++ .../SymmPerChannelQuantParams.aidl | 39 +++++ .../hardware/neuralnetworks/Timing.aidl | 39 +++++ neuralnetworks/aidl/utils/Android.bp | 2 +- neuralnetworks/aidl/vts/functional/Android.bp | 2 +- neuralnetworks/utils/common/Android.bp | 2 +- neuralnetworks/utils/service/Android.bp | 2 +- 47 files changed, 1738 insertions(+), 5 deletions(-) create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/.hash create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/BufferDesc.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/BufferRole.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Capabilities.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/DataLocation.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/DeviceBuffer.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/DeviceType.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ErrorStatus.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExecutionPreference.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExecutionResult.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Extension.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/FencedExecutionResult.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/FusedActivationFunc.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IBuffer.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IBurst.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IDevice.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IPreparedModel.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IPreparedModelCallback.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IPreparedModelParcel.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Memory.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Model.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Operand.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandExtraParams.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandLifeTime.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandPerformance.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandType.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Operation.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperationType.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OutputShape.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/PerformanceInfo.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Priority.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Request.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/RequestArgument.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/RequestMemoryPool.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Subgraph.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Timing.aidl diff --git a/neuralnetworks/1.3/vts/functional/Android.bp b/neuralnetworks/1.3/vts/functional/Android.bp index ab0a0184be..5cf71cffd6 100644 --- a/neuralnetworks/1.3/vts/functional/Android.bp +++ b/neuralnetworks/1.3/vts/functional/Android.bp @@ -66,7 +66,7 @@ cc_test { "VtsHalNeuralNetworksV1_0_utils", "VtsHalNeuralNetworksV1_2_utils", "VtsHalNeuralNetworksV1_3_utils", - "android.hardware.neuralnetworks-V2-ndk", + "android.hardware.neuralnetworks-V3-ndk", "android.hardware.neuralnetworks@1.0", "android.hardware.neuralnetworks@1.1", "android.hardware.neuralnetworks@1.2", diff --git a/neuralnetworks/aidl/Android.bp b/neuralnetworks/aidl/Android.bp index f5193df281..f38d6cafaf 100644 --- a/neuralnetworks/aidl/Android.bp +++ b/neuralnetworks/aidl/Android.bp @@ -37,5 +37,6 @@ aidl_interface { versions: [ "1", "2", + "3", ], } diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/.hash b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/.hash new file mode 100644 index 0000000000..3b9f018381 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/.hash @@ -0,0 +1 @@ +8c2c4ca2327e6f779dad6119c03d832ea4e1def1 diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/BufferDesc.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/BufferDesc.aidl new file mode 100644 index 0000000000..05cec76c88 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/BufferDesc.aidl @@ -0,0 +1,38 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable BufferDesc { + int[] dimensions; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/BufferRole.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/BufferRole.aidl new file mode 100644 index 0000000000..10a6b75ac7 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/BufferRole.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable BufferRole { + int modelIndex; + int ioIndex; + float probability; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Capabilities.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Capabilities.aidl new file mode 100644 index 0000000000..30877c0294 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Capabilities.aidl @@ -0,0 +1,42 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Capabilities { + android.hardware.neuralnetworks.PerformanceInfo relaxedFloat32toFloat16PerformanceScalar; + android.hardware.neuralnetworks.PerformanceInfo relaxedFloat32toFloat16PerformanceTensor; + android.hardware.neuralnetworks.OperandPerformance[] operandPerformance; + android.hardware.neuralnetworks.PerformanceInfo ifPerformance; + android.hardware.neuralnetworks.PerformanceInfo whilePerformance; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/DataLocation.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/DataLocation.aidl new file mode 100644 index 0000000000..db49a38979 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/DataLocation.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable DataLocation { + int poolIndex; + long offset; + long length; + long padding; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/DeviceBuffer.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/DeviceBuffer.aidl new file mode 100644 index 0000000000..7cdd6db742 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/DeviceBuffer.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable DeviceBuffer { + android.hardware.neuralnetworks.IBuffer buffer; + int token; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/DeviceType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/DeviceType.aidl new file mode 100644 index 0000000000..82fe8ae3e7 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/DeviceType.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum DeviceType { + OTHER = 1, + CPU = 2, + GPU = 3, + ACCELERATOR = 4, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ErrorStatus.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ErrorStatus.aidl new file mode 100644 index 0000000000..57d5d6e4cd --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ErrorStatus.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum ErrorStatus { + NONE = 0, + DEVICE_UNAVAILABLE = 1, + GENERAL_FAILURE = 2, + OUTPUT_INSUFFICIENT_SIZE = 3, + INVALID_ARGUMENT = 4, + MISSED_DEADLINE_TRANSIENT = 5, + MISSED_DEADLINE_PERSISTENT = 6, + RESOURCE_EXHAUSTED_TRANSIENT = 7, + RESOURCE_EXHAUSTED_PERSISTENT = 8, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExecutionPreference.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExecutionPreference.aidl new file mode 100644 index 0000000000..4352d8f334 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExecutionPreference.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum ExecutionPreference { + LOW_POWER = 0, + FAST_SINGLE_ANSWER = 1, + SUSTAINED_SPEED = 2, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExecutionResult.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExecutionResult.aidl new file mode 100644 index 0000000000..44e9922f52 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExecutionResult.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 -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.neuralnetworks; +@VintfStability +parcelable ExecutionResult { + boolean outputSufficientSize; + android.hardware.neuralnetworks.OutputShape[] outputShapes; + android.hardware.neuralnetworks.Timing timing; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Extension.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Extension.aidl new file mode 100644 index 0000000000..c47028d99f --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Extension.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Extension { + String name; + android.hardware.neuralnetworks.ExtensionOperandTypeInformation[] operandTypes; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl new file mode 100644 index 0000000000..6c287fd460 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable ExtensionNameAndPrefix { + String name; + char prefix; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl new file mode 100644 index 0000000000..a3680aa9dd --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable ExtensionOperandTypeInformation { + char type; + boolean isTensor; + int byteSize; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/FencedExecutionResult.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/FencedExecutionResult.aidl new file mode 100644 index 0000000000..7952b34632 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/FencedExecutionResult.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 -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.neuralnetworks; +@VintfStability +parcelable FencedExecutionResult { + android.hardware.neuralnetworks.IFencedExecutionCallback callback; + @nullable ParcelFileDescriptor syncFence; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/FusedActivationFunc.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/FusedActivationFunc.aidl new file mode 100644 index 0000000000..7e61bbbdb1 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/FusedActivationFunc.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum FusedActivationFunc { + NONE = 0, + RELU = 1, + RELU1 = 2, + RELU6 = 3, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IBuffer.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IBuffer.aidl new file mode 100644 index 0000000000..f10e7e24ca --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IBuffer.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +interface IBuffer { + void copyFrom(in android.hardware.neuralnetworks.Memory src, in int[] dimensions); + void copyTo(in android.hardware.neuralnetworks.Memory dst); +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IBurst.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IBurst.aidl new file mode 100644 index 0000000000..eb3d0b004a --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IBurst.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 -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.neuralnetworks; +@VintfStability +interface IBurst { + android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in android.hardware.neuralnetworks.Request request, in long[] memoryIdentifierTokens, in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs); + void releaseMemoryResource(in long memoryIdentifierToken); +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IDevice.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IDevice.aidl new file mode 100644 index 0000000000..c9c67f2fcd --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IDevice.aidl @@ -0,0 +1,52 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +interface IDevice { + android.hardware.neuralnetworks.DeviceBuffer allocate(in android.hardware.neuralnetworks.BufferDesc desc, in android.hardware.neuralnetworks.IPreparedModelParcel[] preparedModels, in android.hardware.neuralnetworks.BufferRole[] inputRoles, in android.hardware.neuralnetworks.BufferRole[] outputRoles); + android.hardware.neuralnetworks.Capabilities getCapabilities(); + android.hardware.neuralnetworks.NumberOfCacheFiles getNumberOfCacheFilesNeeded(); + android.hardware.neuralnetworks.Extension[] getSupportedExtensions(); + boolean[] getSupportedOperations(in android.hardware.neuralnetworks.Model model); + android.hardware.neuralnetworks.DeviceType getType(); + String getVersionString(); + void prepareModel(in android.hardware.neuralnetworks.Model model, in android.hardware.neuralnetworks.ExecutionPreference preference, in android.hardware.neuralnetworks.Priority priority, in long deadlineNs, in ParcelFileDescriptor[] modelCache, in ParcelFileDescriptor[] dataCache, in byte[] token, in android.hardware.neuralnetworks.IPreparedModelCallback callback); + void prepareModelFromCache(in long deadlineNs, in ParcelFileDescriptor[] modelCache, in ParcelFileDescriptor[] dataCache, in byte[] token, in android.hardware.neuralnetworks.IPreparedModelCallback callback); + const int BYTE_SIZE_OF_CACHE_TOKEN = 32; + const int MAX_NUMBER_OF_CACHE_FILES = 32; + const int EXTENSION_TYPE_HIGH_BITS_PREFIX = 15; + const int EXTENSION_TYPE_LOW_BITS_TYPE = 16; + const int OPERAND_TYPE_BASE_MAX = 65535; + const int OPERATION_TYPE_BASE_MAX = 65535; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl new file mode 100644 index 0000000000..0bfb80ac78 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl @@ -0,0 +1,38 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +interface IFencedExecutionCallback { + android.hardware.neuralnetworks.ErrorStatus getExecutionInfo(out android.hardware.neuralnetworks.Timing timingLaunched, out android.hardware.neuralnetworks.Timing timingFenced); +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IPreparedModel.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IPreparedModel.aidl new file mode 100644 index 0000000000..fccb5dc98e --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IPreparedModel.aidl @@ -0,0 +1,42 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +interface IPreparedModel { + android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in android.hardware.neuralnetworks.Request request, in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs); + android.hardware.neuralnetworks.FencedExecutionResult executeFenced(in android.hardware.neuralnetworks.Request request, in ParcelFileDescriptor[] waitFor, in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs, in long durationNs); + android.hardware.neuralnetworks.IBurst configureExecutionBurst(); + const long DEFAULT_LOOP_TIMEOUT_DURATION_NS = 2000000000; + const long MAXIMUM_LOOP_TIMEOUT_DURATION_NS = 15000000000; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IPreparedModelCallback.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IPreparedModelCallback.aidl new file mode 100644 index 0000000000..e0c763bc2a --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IPreparedModelCallback.aidl @@ -0,0 +1,38 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +interface IPreparedModelCallback { + void notify(in android.hardware.neuralnetworks.ErrorStatus status, in android.hardware.neuralnetworks.IPreparedModel preparedModel); +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IPreparedModelParcel.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IPreparedModelParcel.aidl new file mode 100644 index 0000000000..dbedf12772 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/IPreparedModelParcel.aidl @@ -0,0 +1,38 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable IPreparedModelParcel { + android.hardware.neuralnetworks.IPreparedModel preparedModel; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Memory.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Memory.aidl new file mode 100644 index 0000000000..37fa102cf4 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Memory.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +union Memory { + android.hardware.common.Ashmem ashmem; + android.hardware.common.MappableFile mappableFile; + android.hardware.graphics.common.HardwareBuffer hardwareBuffer; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Model.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Model.aidl new file mode 100644 index 0000000000..30d8dda55d --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Model.aidl @@ -0,0 +1,43 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Model { + android.hardware.neuralnetworks.Subgraph main; + android.hardware.neuralnetworks.Subgraph[] referenced; + byte[] operandValues; + android.hardware.neuralnetworks.Memory[] pools; + boolean relaxComputationFloat32toFloat16; + android.hardware.neuralnetworks.ExtensionNameAndPrefix[] extensionNameToPrefix; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl new file mode 100644 index 0000000000..9314760a43 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable NumberOfCacheFiles { + int numModelCache; + int numDataCache; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Operand.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Operand.aidl new file mode 100644 index 0000000000..1d9bdd8446 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Operand.aidl @@ -0,0 +1,44 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Operand { + android.hardware.neuralnetworks.OperandType type = android.hardware.neuralnetworks.OperandType.FLOAT32; + int[] dimensions; + float scale; + int zeroPoint; + android.hardware.neuralnetworks.OperandLifeTime lifetime = android.hardware.neuralnetworks.OperandLifeTime.TEMPORARY_VARIABLE; + android.hardware.neuralnetworks.DataLocation location; + @nullable android.hardware.neuralnetworks.OperandExtraParams extraParams; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandExtraParams.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandExtraParams.aidl new file mode 100644 index 0000000000..14792cff08 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandExtraParams.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +union OperandExtraParams { + android.hardware.neuralnetworks.SymmPerChannelQuantParams channelQuant; + byte[] extension; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandLifeTime.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandLifeTime.aidl new file mode 100644 index 0000000000..40adfb1dd8 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandLifeTime.aidl @@ -0,0 +1,44 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum OperandLifeTime { + TEMPORARY_VARIABLE = 0, + SUBGRAPH_INPUT = 1, + SUBGRAPH_OUTPUT = 2, + CONSTANT_COPY = 3, + CONSTANT_POOL = 4, + NO_VALUE = 5, + SUBGRAPH = 6, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandPerformance.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandPerformance.aidl new file mode 100644 index 0000000000..ebb361b762 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandPerformance.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable OperandPerformance { + android.hardware.neuralnetworks.OperandType type = android.hardware.neuralnetworks.OperandType.FLOAT32; + android.hardware.neuralnetworks.PerformanceInfo info; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandType.aidl new file mode 100644 index 0000000000..9f2c759d38 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperandType.aidl @@ -0,0 +1,53 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum OperandType { + FLOAT32 = 0, + INT32 = 1, + UINT32 = 2, + TENSOR_FLOAT32 = 3, + TENSOR_INT32 = 4, + TENSOR_QUANT8_ASYMM = 5, + BOOL = 6, + TENSOR_QUANT16_SYMM = 7, + TENSOR_FLOAT16 = 8, + TENSOR_BOOL8 = 9, + FLOAT16 = 10, + TENSOR_QUANT8_SYMM_PER_CHANNEL = 11, + TENSOR_QUANT16_ASYMM = 12, + TENSOR_QUANT8_SYMM = 13, + TENSOR_QUANT8_ASYMM_SIGNED = 14, + SUBGRAPH = 15, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Operation.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Operation.aidl new file mode 100644 index 0000000000..a4a3fbee60 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Operation.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Operation { + android.hardware.neuralnetworks.OperationType type = android.hardware.neuralnetworks.OperationType.ADD; + int[] inputs; + int[] outputs; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperationType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperationType.aidl new file mode 100644 index 0000000000..34506c8860 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OperationType.aidl @@ -0,0 +1,143 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum OperationType { + ADD = 0, + AVERAGE_POOL_2D = 1, + CONCATENATION = 2, + CONV_2D = 3, + DEPTHWISE_CONV_2D = 4, + DEPTH_TO_SPACE = 5, + DEQUANTIZE = 6, + EMBEDDING_LOOKUP = 7, + FLOOR = 8, + FULLY_CONNECTED = 9, + HASHTABLE_LOOKUP = 10, + L2_NORMALIZATION = 11, + L2_POOL_2D = 12, + LOCAL_RESPONSE_NORMALIZATION = 13, + LOGISTIC = 14, + LSH_PROJECTION = 15, + LSTM = 16, + MAX_POOL_2D = 17, + MUL = 18, + RELU = 19, + RELU1 = 20, + RELU6 = 21, + RESHAPE = 22, + RESIZE_BILINEAR = 23, + RNN = 24, + SOFTMAX = 25, + SPACE_TO_DEPTH = 26, + SVDF = 27, + TANH = 28, + BATCH_TO_SPACE_ND = 29, + DIV = 30, + MEAN = 31, + PAD = 32, + SPACE_TO_BATCH_ND = 33, + SQUEEZE = 34, + STRIDED_SLICE = 35, + SUB = 36, + TRANSPOSE = 37, + ABS = 38, + ARGMAX = 39, + ARGMIN = 40, + AXIS_ALIGNED_BBOX_TRANSFORM = 41, + BIDIRECTIONAL_SEQUENCE_LSTM = 42, + BIDIRECTIONAL_SEQUENCE_RNN = 43, + BOX_WITH_NMS_LIMIT = 44, + CAST = 45, + CHANNEL_SHUFFLE = 46, + DETECTION_POSTPROCESSING = 47, + EQUAL = 48, + EXP = 49, + EXPAND_DIMS = 50, + GATHER = 51, + GENERATE_PROPOSALS = 52, + GREATER = 53, + GREATER_EQUAL = 54, + GROUPED_CONV_2D = 55, + HEATMAP_MAX_KEYPOINT = 56, + INSTANCE_NORMALIZATION = 57, + LESS = 58, + LESS_EQUAL = 59, + LOG = 60, + LOGICAL_AND = 61, + LOGICAL_NOT = 62, + LOGICAL_OR = 63, + LOG_SOFTMAX = 64, + MAXIMUM = 65, + MINIMUM = 66, + NEG = 67, + NOT_EQUAL = 68, + PAD_V2 = 69, + POW = 70, + PRELU = 71, + QUANTIZE = 72, + QUANTIZED_16BIT_LSTM = 73, + RANDOM_MULTINOMIAL = 74, + REDUCE_ALL = 75, + REDUCE_ANY = 76, + REDUCE_MAX = 77, + REDUCE_MIN = 78, + REDUCE_PROD = 79, + REDUCE_SUM = 80, + ROI_ALIGN = 81, + ROI_POOLING = 82, + RSQRT = 83, + SELECT = 84, + SIN = 85, + SLICE = 86, + SPLIT = 87, + SQRT = 88, + TILE = 89, + TOPK_V2 = 90, + TRANSPOSE_CONV_2D = 91, + UNIDIRECTIONAL_SEQUENCE_LSTM = 92, + UNIDIRECTIONAL_SEQUENCE_RNN = 93, + RESIZE_NEAREST_NEIGHBOR = 94, + QUANTIZED_LSTM = 95, + IF = 96, + WHILE = 97, + ELU = 98, + HARD_SWISH = 99, + FILL = 100, + RANK = 101, + BATCH_MATMUL = 102, + PACK = 103, + MIRROR_PAD = 104, + REVERSE = 105, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OutputShape.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OutputShape.aidl new file mode 100644 index 0000000000..f7335054cf --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/OutputShape.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable OutputShape { + int[] dimensions; + boolean isSufficient; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/PerformanceInfo.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/PerformanceInfo.aidl new file mode 100644 index 0000000000..04910f5410 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/PerformanceInfo.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable PerformanceInfo { + float execTime; + float powerUsage; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Priority.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Priority.aidl new file mode 100644 index 0000000000..8f357097ab --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Priority.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum Priority { + LOW = 0, + MEDIUM = 1, + HIGH = 2, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Request.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Request.aidl new file mode 100644 index 0000000000..39ec7a9acd --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Request.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Request { + android.hardware.neuralnetworks.RequestArgument[] inputs; + android.hardware.neuralnetworks.RequestArgument[] outputs; + android.hardware.neuralnetworks.RequestMemoryPool[] pools; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/RequestArgument.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/RequestArgument.aidl new file mode 100644 index 0000000000..e3541c0ece --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/RequestArgument.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable RequestArgument { + boolean hasNoValue; + android.hardware.neuralnetworks.DataLocation location; + int[] dimensions; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/RequestMemoryPool.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/RequestMemoryPool.aidl new file mode 100644 index 0000000000..312f5813bc --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/RequestMemoryPool.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +union RequestMemoryPool { + android.hardware.neuralnetworks.Memory pool; + int token; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Subgraph.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Subgraph.aidl new file mode 100644 index 0000000000..b7d44515f4 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Subgraph.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Subgraph { + android.hardware.neuralnetworks.Operand[] operands; + android.hardware.neuralnetworks.Operation[] operations; + int[] inputIndexes; + int[] outputIndexes; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl new file mode 100644 index 0000000000..02d68f9ed1 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable SymmPerChannelQuantParams { + float[] scales; + int channelDim; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Timing.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Timing.aidl new file mode 100644 index 0000000000..bcc83cfbee --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/3/android/hardware/neuralnetworks/Timing.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Timing { + long timeOnDeviceNs; + long timeInDriverNs; +} diff --git a/neuralnetworks/aidl/utils/Android.bp b/neuralnetworks/aidl/utils/Android.bp index 5a6a080653..068727214f 100644 --- a/neuralnetworks/aidl/utils/Android.bp +++ b/neuralnetworks/aidl/utils/Android.bp @@ -54,7 +54,7 @@ cc_test { static_libs: [ "android.hardware.common-V2-ndk", "android.hardware.graphics.common-V2-ndk", - "android.hardware.neuralnetworks-V2-ndk", + "android.hardware.neuralnetworks-V3-ndk", "libaidlcommonsupport", "libgmock", "libneuralnetworks_common", diff --git a/neuralnetworks/aidl/vts/functional/Android.bp b/neuralnetworks/aidl/vts/functional/Android.bp index 3558d12aa1..27758a7487 100644 --- a/neuralnetworks/aidl/vts/functional/Android.bp +++ b/neuralnetworks/aidl/vts/functional/Android.bp @@ -51,7 +51,7 @@ cc_test { static_libs: [ "android.hardware.common-V2-ndk", "android.hardware.graphics.common-V2-ndk", - "android.hardware.neuralnetworks-V2-ndk", + "android.hardware.neuralnetworks-V3-ndk", "android.hidl.allocator@1.0", "android.hidl.memory@1.0", "libaidlcommonsupport", diff --git a/neuralnetworks/utils/common/Android.bp b/neuralnetworks/utils/common/Android.bp index e50fa37a0a..86608ee104 100644 --- a/neuralnetworks/utils/common/Android.bp +++ b/neuralnetworks/utils/common/Android.bp @@ -35,7 +35,7 @@ cc_library_static { "neuralnetworks_types", ], shared_libs: [ - "android.hardware.neuralnetworks-V2-ndk", + "android.hardware.neuralnetworks-V3-ndk", "libhidlbase", "libnativewindow", "libbinder_ndk", diff --git a/neuralnetworks/utils/service/Android.bp b/neuralnetworks/utils/service/Android.bp index fbb8679508..80f1ff8bec 100644 --- a/neuralnetworks/utils/service/Android.bp +++ b/neuralnetworks/utils/service/Android.bp @@ -39,7 +39,7 @@ cc_library_static { "neuralnetworks_utils_hal_common", ], shared_libs: [ - "android.hardware.neuralnetworks-V2-ndk", + "android.hardware.neuralnetworks-V3-ndk", "android.hardware.neuralnetworks@1.0", "android.hardware.neuralnetworks@1.1", "android.hardware.neuralnetworks@1.2", -- GitLab From 3210fd82425b90fcd933d0b79541a85a7c8ea15b Mon Sep 17 00:00:00 2001 From: David Gross Date: Thu, 2 Dec 2021 15:39:33 -0800 Subject: [PATCH 433/825] FL7: Add some AIDL_V3 test infrastructure Test: atest VtsHalNeuralnetworksTargetTest -- --test-arg com.android.tradefed.testtype.GTest:native-test-flag:"--gtest_filter=*abs*:*floor*:*log*:*rsqrt*:*sin*:*sqrt*" Bug: 202280925 Merged-In: I848add0ddb94e1500a5d4d6af5d51ddf5ebba045 Change-Id: I848add0ddb94e1500a5d4d6af5d51ddf5ebba045 (cherry picked from commit 8e9fbfc592d937ea39b587660f9790a0daae31ea) --- neuralnetworks/aidl/vts/functional/Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/neuralnetworks/aidl/vts/functional/Android.bp b/neuralnetworks/aidl/vts/functional/Android.bp index 27758a7487..4fdf57d843 100644 --- a/neuralnetworks/aidl/vts/functional/Android.bp +++ b/neuralnetworks/aidl/vts/functional/Android.bp @@ -63,6 +63,7 @@ cc_test { "neuralnetworks_utils_hal_aidl", ], whole_static_libs: [ + "neuralnetworks_generated_AIDL_V3_example", "neuralnetworks_generated_AIDL_V2_example", "neuralnetworks_generated_V1_0_example", "neuralnetworks_generated_V1_1_example", -- GitLab From ec291441a54ebbfbe764e31c89e0670bbcc5be27 Mon Sep 17 00:00:00 2001 From: David Gross Date: Tue, 7 Dec 2021 15:51:42 -0800 Subject: [PATCH 434/825] FL7: Refine REVERSE specification Test: N/A Bug: 202280925 Merged-In: Iae1f177254023c750c701e6594a61f3958de538c Change-Id: Iae1f177254023c750c701e6594a61f3958de538c (cherry picked from commit 91a30c1ceab9d27dd491fd961c70217b20c27578) --- .../aidl/android/hardware/neuralnetworks/OperationType.aidl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl index 0b745a966b..88c61c34b7 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl @@ -5277,7 +5277,7 @@ enum OperationType { * must be in the range [0, n). * * Outputs: - * * 0: The reversed tensor. + * * 0: The reversed tensor of the same shape as the input tensor. * For {@link OperandType::TENSOR_QUANT8_ASYMM} and * {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensors, * the scales and zeroPoint must be the same as input0. -- GitLab From 75c5fdcb8c6ffd43ffe357ade3ae905989ba8221 Mon Sep 17 00:00:00 2001 From: David Gross Date: Fri, 7 Jan 2022 14:56:03 -0800 Subject: [PATCH 435/825] FL7: Refine MIRROR_PAD specification Test: N/A Bug: 202280925 Merged-In: If19d45d806f6ba33f9aa6c7af9bc411957cdc706 Change-Id: If19d45d806f6ba33f9aa6c7af9bc411957cdc706 (cherry picked from commit 4718025a6c3b4c0fe62eb39879b93aec90340446) --- .../hardware/neuralnetworks/OperationType.aidl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl index 88c61c34b7..04c15b9eb1 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl @@ -5223,6 +5223,18 @@ enum OperationType { /** * Pads a tensor with mirrored values. * + * This operator specifies one of two padding modes: REFLECT or SYMMETRIC. + * In the case of REFLECT mode, the mirroring excludes the border element + * on the padding side. + * In the case of SYMMETRIC mode, the mirroring includes the border element + * on the padding side. + * + * For example, if the input is the 1-D tensor `[1, 2, 3]` and the padding + * is `[0, 2]` (i.e., pad no elements before the first (and only) dimension, + * and two elements after the first (and only) dimension), then: + * - REFLECT mode produces the output `[1, 2, 3, 2, 1]` + * - SYMMETRIC mode produces the output `[1, 2, 3, 3, 2]` + * * Supported tensor {@link OperandType}: * * {@link OperandType::TENSOR_FLOAT16} * * {@link OperandType::TENSOR_FLOAT32} @@ -5241,6 +5253,11 @@ enum OperationType { * front of dimension i. * padding[i, 1] specifies the number of elements to be padded after the * end of dimension i. + * Each padding value must be nonnegative. + * In the case of REFLECT mode, each padding value must be less than the + * corresponding dimension. + * In the case of SYMMETRIC mode, each padding value must be less than or + * equal to the corresponding dimension. * * 2: An {@link OperandType::INT32} scalar, specifying the mode. * Options are 0:REFLECT and 1:SYMMETRIC. * -- GitLab From cf9779659cc4d0c5ec0f75235471d23bc3742516 Mon Sep 17 00:00:00 2001 From: Tanmay Patil Date: Fri, 14 Jan 2022 13:57:05 -0800 Subject: [PATCH 436/825] Remove SurroundView HAL from compatibility_matrix.current This will depreciate the SV HAL from Android T onwards. Refer go/aaos-sv-hal-depreciate for details on reason Bug: 213898970 Test: Verfied with presubmit Change-Id: I5decd4fcf4a3ac4abc3b2229894f015ee506c03e --- compatibility_matrices/compatibility_matrix.current.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index f03008a4e4..7a70667f54 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -77,14 +77,6 @@ default - - android.hardware.automotive.sv - 1.0 - - ISurroundViewService - default - - android.hardware.automotive.vehicle -- GitLab From 28e06feed8c63b6d89454f7d36436dc476bfd9da Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 11 Jan 2022 21:06:48 -0800 Subject: [PATCH 437/825] Use the new LargeParcelable API. Bug: 210063973 Test: atest DefaultVehicleHalTest Change-Id: Id1805638918acdf5bc79d2591d26829289ba56e8 --- .../aidl/impl/vhal/include/ParcelableUtils.h | 32 +++++------- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 49 ++++++++----------- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 37 ++++++-------- 3 files changed, 46 insertions(+), 72 deletions(-) diff --git a/automotive/vehicle/aidl/impl/vhal/include/ParcelableUtils.h b/automotive/vehicle/aidl/impl/vhal/include/ParcelableUtils.h index dcb15b9c63..4b7c2f3221 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/ParcelableUtils.h +++ b/automotive/vehicle/aidl/impl/vhal/include/ParcelableUtils.h @@ -31,19 +31,18 @@ namespace vehicle { template ::ndk::ScopedAStatus vectorToStableLargeParcelable(std::vector&& values, T2* output) { + output->payloads = std::move(values); auto result = ::android::automotive::car_binder_lib::LargeParcelableBase:: - parcelableVectorToStableLargeParcelable(values); + parcelableToStableLargeParcelable(*output); if (!result.ok()) { return toScopedAStatus( result, ::aidl::android::hardware::automotive::vehicle::StatusCode::INTERNAL_ERROR); } auto& fd = result.value(); - if (fd == nullptr) { - // If we no longer needs values, move it inside the payloads to avoid copying. - output->payloads = std::move(values); - } else { + if (fd != nullptr) { // Move the returned ScopedFileDescriptor pointer to ScopedFileDescriptor value in // 'sharedMemoryFd' field. + output->payloads.clear(); output->sharedMemoryFd = std::move(*fd); } return ::ndk::ScopedAStatus::ok(); @@ -57,12 +56,13 @@ template return vectorToStableLargeParcelable(std::move(valuesCopy), output); } -template -::android::base::expected, ::ndk::ScopedAStatus> stableLargeParcelableToVector( - const T2& largeParcelable) { - ::android::base::Result>> result = - ::android::automotive::car_binder_lib::LargeParcelableBase:: - stableLargeParcelableToParcelableVector(largeParcelable.sharedMemoryFd); +template +::android::base::expected< + ::android::automotive::car_binder_lib::LargeParcelableBase::BorrowedOwnedObject, + ::ndk::ScopedAStatus> +fromStableLargeParcelable(const T& largeParcelable) { + auto result = ::android::automotive::car_binder_lib::LargeParcelableBase:: + stableLargeParcelableToParcelable(largeParcelable); if (!result.ok()) { return ::android::base::unexpected(toScopedAStatus( @@ -70,15 +70,7 @@ template "failed to parse large parcelable")); } - if (!result.value().has_value()) { - return ::android::base::unexpected( - ::ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( - toInt(::aidl::android::hardware::automotive::vehicle::StatusCode:: - INVALID_ARG), - "empty request")); - } - - return std::move(result.value().value()); + return std::move(result.value()); } } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index e98f02112e..7f09a59fbb 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -57,7 +57,9 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) for (auto& config : configs) { mConfigsByPropId[config.prop] = config; } - auto result = LargeParcelableBase::parcelableVectorToStableLargeParcelable(configs); + VehiclePropConfigs vehiclePropConfigs; + vehiclePropConfigs.payloads = std::move(configs); + auto result = LargeParcelableBase::parcelableToStableLargeParcelable(vehiclePropConfigs); if (!result.ok()) { ALOGE("failed to convert configs to shared memory file, error: %s, code: %d", getErrorMsg(result).c_str(), getIntErrorCode(result)); @@ -71,6 +73,7 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) ScopedAStatus DefaultVehicleHal::getAllPropConfigs(VehiclePropConfigs* output) { if (mConfigFile != nullptr) { + output->payloads.clear(); output->sharedMemoryFd.set(dup(mConfigFile->get())); return ScopedAStatus::ok(); } @@ -131,20 +134,14 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, const GetValueRequests& requests) { // TODO(b/203713317): check for duplicate properties and duplicate request IDs. - const std::vector* getValueRequests; - // Define deserializedResults here because we need it to have the same lifetime as - // getValueRequests. - expected, ScopedAStatus> deserializedResults; - if (!requests.payloads.empty()) { - getValueRequests = &requests.payloads; - } else { - deserializedResults = stableLargeParcelableToVector(requests); - if (!deserializedResults.ok()) { - ALOGE("failed to parse getValues requests"); - return std::move(deserializedResults.error()); - } - getValueRequests = &deserializedResults.value(); + expected, ScopedAStatus> + deserializedResults = fromStableLargeParcelable(requests); + if (!deserializedResults.ok()) { + ALOGE("getValues: failed to parse getValues requests"); + return std::move(deserializedResults.error()); } + const std::vector& getValueRequests = + deserializedResults.value().getObject()->payloads; std::shared_ptr client; { @@ -153,7 +150,7 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, } if (StatusCode status = - mVehicleHardware->getValues(client->getResultCallback(), *getValueRequests); + mVehicleHardware->getValues(client->getResultCallback(), getValueRequests); status != StatusCode::OK) { return ScopedAStatus::fromServiceSpecificErrorWithMessage( toInt(status), "failed to get value from VehicleHardware"); @@ -166,27 +163,21 @@ ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, const SetValueRequests& requests) { // TODO(b/203713317): check for duplicate properties and duplicate request IDs. - const std::vector* setValueRequests; - // Define deserializedResults here because we need it to have the same lifetime as - // setValueRequests. - expected, ScopedAStatus> deserializedResults; - if (!requests.payloads.empty()) { - setValueRequests = &requests.payloads; - } else { - deserializedResults = stableLargeParcelableToVector(requests); - if (!deserializedResults.ok()) { - ALOGE("failed to parse setValues requests"); - return std::move(deserializedResults.error()); - } - setValueRequests = &deserializedResults.value(); + expected, ScopedAStatus> + deserializedResults = fromStableLargeParcelable(requests); + if (!deserializedResults.ok()) { + ALOGE("setValues: failed to parse setValues requests"); + return std::move(deserializedResults.error()); } + const std::vector& setValueRequests = + deserializedResults.value().getObject()->payloads; // A list of failed result we already know before sending to hardware. std::vector failedResults; // The list of requests that we would send to hardware. std::vector hardwareRequests; - for (auto& request : *setValueRequests) { + for (auto& request : setValueRequests) { int64_t requestId = request.requestId; if (auto result = checkProperty(request.value); !result.ok()) { ALOGW("property not valid: %s", result.error().message().c_str()); diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 8934a7b012..ffc08a71b8 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -389,15 +389,14 @@ class DefaultVehicleHalTest : public ::testing::Test { }); } - auto result = LargeParcelableBase::parcelableVectorToStableLargeParcelable( - expectedHardwareRequests); + requests.payloads = expectedHardwareRequests; + auto result = LargeParcelableBase::parcelableToStableLargeParcelable(requests); if (!result.ok()) { return result.error(); } - if (result.value() == nullptr) { - requests.payloads = expectedHardwareRequests; - } else { + if (result.value() != nullptr) { requests.sharedMemoryFd = std::move(*result.value()); + requests.payloads.clear(); } return {}; } @@ -423,14 +422,13 @@ class DefaultVehicleHalTest : public ::testing::Test { }); } - auto result = LargeParcelableBase::parcelableVectorToStableLargeParcelable( - expectedHardwareRequests); + requests.payloads = expectedHardwareRequests; + auto result = LargeParcelableBase::parcelableToStableLargeParcelable(requests); if (!result.ok()) { return result.error(); } - if (result.value() == nullptr) { - requests.payloads = expectedHardwareRequests; - } else { + if (result.value() != nullptr) { + requests.payloads.clear(); requests.sharedMemoryFd = std::move(*result.value()); } return {}; @@ -490,13 +488,10 @@ TEST_F(DefaultVehicleHalTest, testGetAllPropConfigsLarge) { ASSERT_TRUE(status.isOk()) << "getAllPropConfigs failed: " << status.getMessage(); ASSERT_TRUE(output.payloads.empty()); - Result>> result = - LargeParcelableBase::stableLargeParcelableToParcelableVector( - output.sharedMemoryFd); + auto result = LargeParcelableBase::stableLargeParcelableToParcelable(output); ASSERT_TRUE(result.ok()) << "failed to parse result shared memory file: " << result.error().message(); - ASSERT_TRUE(result.value().has_value()) << "empty parsed value"; - ASSERT_EQ(result.value().value(), testConfigs); + ASSERT_EQ(result.value().getObject()->payloads, testConfigs); } TEST_F(DefaultVehicleHalTest, testGetValuesSmall) { @@ -544,11 +539,9 @@ TEST_F(DefaultVehicleHalTest, testGetValuesLarge) { ASSERT_TRUE(getValueResults.payloads.empty()) << "payload should be empty, shared memory file should be used"; - auto result = LargeParcelableBase::stableLargeParcelableToParcelableVector( - getValueResults.sharedMemoryFd); + auto result = LargeParcelableBase::stableLargeParcelableToParcelable(getValueResults); ASSERT_TRUE(result.ok()) << "failed to parse shared memory file"; - ASSERT_TRUE(result.value().has_value()) << "no parsed value"; - ASSERT_EQ(result.value().value(), expectedResults) << "results mismatch"; + ASSERT_EQ(result.value().getObject()->payloads, expectedResults) << "results mismatch"; EXPECT_EQ(countClients(), static_cast(1)); } @@ -621,11 +614,9 @@ TEST_F(DefaultVehicleHalTest, testSetValuesLarge) { ASSERT_TRUE(setValueResults.payloads.empty()) << "payload should be empty, shared memory file should be used"; - auto result = LargeParcelableBase::stableLargeParcelableToParcelableVector( - setValueResults.sharedMemoryFd); + auto result = LargeParcelableBase::stableLargeParcelableToParcelable(setValueResults); ASSERT_TRUE(result.ok()) << "failed to parse shared memory file"; - ASSERT_TRUE(result.value().has_value()) << "no parsed value"; - ASSERT_EQ(result.value().value(), expectedResults) << "results mismatch"; + ASSERT_EQ(result.value().getObject()->payloads, expectedResults) << "results mismatch"; EXPECT_EQ(countClients(), static_cast(1)); } -- GitLab From 600e91322b2cba39171c9085fba679dd9d2a0de8 Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Fri, 7 Jan 2022 16:27:22 -0800 Subject: [PATCH 438/825] Add aidl version of android.hardware.input.common This is a type HAL that will be used for input-related types. Currently the main thing that's stored there is MotionEvent. Bug: 210158587 Test: m Change-Id: Id6658a179147591564521a36d0de296a1f2212b0 --- .../exclude/fcm_exclude.cpp | 1 + input/common/aidl/Android.bp | 22 + .../android/hardware/input/common/Action.aidl | 50 +++ .../android/hardware/input/common/Axis.aidl | 82 ++++ .../android/hardware/input/common/Button.aidl | 45 ++ .../hardware/input/common/Classification.aidl | 40 ++ .../hardware/input/common/EdgeFlag.aidl | 42 ++ .../android/hardware/input/common/Flag.aidl | 40 ++ .../android/hardware/input/common/Meta.aidl | 55 +++ .../hardware/input/common/MotionEvent.aidl | 56 +++ .../hardware/input/common/PointerCoords.aidl | 39 ++ .../input/common/PointerProperties.aidl | 39 ++ .../hardware/input/common/PolicyFlag.aidl | 47 +++ .../android/hardware/input/common/Source.aidl | 53 +++ .../hardware/input/common/SourceClass.aidl | 43 ++ .../hardware/input/common/ToolType.aidl | 42 ++ .../hardware/input/common/VideoFrame.aidl | 41 ++ .../android/hardware/input/common/Action.aidl | 89 ++++ .../android/hardware/input/common/Axis.aidl | 387 ++++++++++++++++++ .../android/hardware/input/common/Button.aidl | 33 ++ .../hardware/input/common/Classification.aidl | 34 ++ .../hardware/input/common/EdgeFlag.aidl | 45 ++ .../android/hardware/input/common/Flag.aidl | 45 ++ .../android/hardware/input/common/Meta.aidl | 94 +++++ .../hardware/input/common/MotionEvent.aidl | 114 ++++++ .../hardware/input/common/PointerCoords.aidl | 41 ++ .../input/common/PointerProperties.aidl | 41 ++ .../hardware/input/common/PolicyFlag.aidl | 70 ++++ .../android/hardware/input/common/Source.aidl | 43 ++ .../hardware/input/common/SourceClass.aidl | 28 ++ .../hardware/input/common/ToolType.aidl | 30 ++ .../hardware/input/common/VideoFrame.aidl | 79 ++++ 32 files changed, 1910 insertions(+) create mode 100644 input/common/aidl/Android.bp create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Action.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Axis.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Button.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Classification.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/EdgeFlag.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Flag.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Meta.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/MotionEvent.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/PointerCoords.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/PointerProperties.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/PolicyFlag.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Source.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/SourceClass.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/ToolType.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/VideoFrame.aidl create mode 100644 input/common/aidl/android/hardware/input/common/Action.aidl create mode 100644 input/common/aidl/android/hardware/input/common/Axis.aidl create mode 100644 input/common/aidl/android/hardware/input/common/Button.aidl create mode 100644 input/common/aidl/android/hardware/input/common/Classification.aidl create mode 100644 input/common/aidl/android/hardware/input/common/EdgeFlag.aidl create mode 100644 input/common/aidl/android/hardware/input/common/Flag.aidl create mode 100644 input/common/aidl/android/hardware/input/common/Meta.aidl create mode 100644 input/common/aidl/android/hardware/input/common/MotionEvent.aidl create mode 100644 input/common/aidl/android/hardware/input/common/PointerCoords.aidl create mode 100644 input/common/aidl/android/hardware/input/common/PointerProperties.aidl create mode 100644 input/common/aidl/android/hardware/input/common/PolicyFlag.aidl create mode 100644 input/common/aidl/android/hardware/input/common/Source.aidl create mode 100644 input/common/aidl/android/hardware/input/common/SourceClass.aidl create mode 100644 input/common/aidl/android/hardware/input/common/ToolType.aidl create mode 100644 input/common/aidl/android/hardware/input/common/VideoFrame.aidl diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp index 2aa4bb2a22..414c502fd7 100644 --- a/compatibility_matrices/exclude/fcm_exclude.cpp +++ b/compatibility_matrices/exclude/fcm_exclude.cpp @@ -56,6 +56,7 @@ bool ShouldCheckMissingHalsInFcm(const std::string& package) { "android.hardware.common", "android.hardware.common.fmq", "android.hardware.graphics.common", + "android.hardware.input.common", "android.hardware.keymaster", "android.hardware.radio", "android.hardware.uwb.fira_android", diff --git a/input/common/aidl/Android.bp b/input/common/aidl/Android.bp new file mode 100644 index 0000000000..6cf64a6fdd --- /dev/null +++ b/input/common/aidl/Android.bp @@ -0,0 +1,22 @@ +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.input.common", + srcs: ["android/hardware/input/common/*.aidl"], + stability: "vintf", + backend: { + cpp: { + enabled: false, + }, + java: { + enabled: false, + }, + }, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Action.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Action.aidl new file mode 100644 index 0000000000..a2e0381188 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Action.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 -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.input.common; +@Backing(type="int") @VintfStability +enum Action { + DOWN = 0, + UP = 1, + MOVE = 2, + CANCEL = 3, + OUTSIDE = 4, + POINTER_DOWN = 5, + POINTER_UP = 6, + HOVER_MOVE = 7, + SCROLL = 8, + HOVER_ENTER = 9, + HOVER_EXIT = 10, + BUTTON_PRESS = 11, + BUTTON_RELEASE = 12, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Axis.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Axis.aidl new file mode 100644 index 0000000000..2114c7deb1 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Axis.aidl @@ -0,0 +1,82 @@ +/* + * 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 -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.input.common; +@Backing(type="int") @VintfStability +enum Axis { + X = 0, + Y = 1, + PRESSURE = 2, + SIZE = 3, + TOUCH_MAJOR = 4, + TOUCH_MINOR = 5, + TOOL_MAJOR = 6, + TOOL_MINOR = 7, + ORIENTATION = 8, + VSCROLL = 9, + HSCROLL = 10, + Z = 11, + RX = 12, + RY = 13, + RZ = 14, + HAT_X = 15, + HAT_Y = 16, + LTRIGGER = 17, + RTRIGGER = 18, + THROTTLE = 19, + RUDDER = 20, + WHEEL = 21, + GAS = 22, + BRAKE = 23, + DISTANCE = 24, + TILT = 25, + SCROLL = 26, + RELATIVE_X = 27, + RELATIVE_Y = 28, + GENERIC_1 = 32, + GENERIC_2 = 33, + GENERIC_3 = 34, + GENERIC_4 = 35, + GENERIC_5 = 36, + GENERIC_6 = 37, + GENERIC_7 = 38, + GENERIC_8 = 39, + GENERIC_9 = 40, + GENERIC_10 = 41, + GENERIC_11 = 42, + GENERIC_12 = 43, + GENERIC_13 = 44, + GENERIC_14 = 45, + GENERIC_15 = 46, + GENERIC_16 = 47, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Button.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Button.aidl new file mode 100644 index 0000000000..10ad65a19a --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Button.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 -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.input.common; +@Backing(type="int") @VintfStability +enum Button { + NONE = 0, + PRIMARY = 1, + SECONDARY = 2, + TERTIARY = 4, + BACK = 8, + FORWARD = 16, + STYLUS_PRIMARY = 32, + STYLUS_SECONDARY = 64, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Classification.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Classification.aidl new file mode 100644 index 0000000000..ddd524685f --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Classification.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 -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.input.common; +@Backing(type="byte") @VintfStability +enum Classification { + NONE = 0, + AMBIGUOUS_GESTURE = 1, + DEEP_PRESS = 2, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/EdgeFlag.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/EdgeFlag.aidl new file mode 100644 index 0000000000..1040049b81 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/EdgeFlag.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 -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.input.common; +@Backing(type="int") @VintfStability +enum EdgeFlag { + NONE = 0, + TOP = 1, + BOTTOM = 2, + LEFT = 4, + RIGHT = 8, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Flag.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Flag.aidl new file mode 100644 index 0000000000..d3fcd9ff16 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Flag.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 -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.input.common; +@Backing(type="int") @VintfStability +enum Flag { + WINDOW_IS_OBSCURED = 1, + IS_GENERATED_GESTURE = 8, + TAINTED = -2147483648, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Meta.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Meta.aidl new file mode 100644 index 0000000000..2c229f9f36 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Meta.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 -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.input.common; +@Backing(type="int") @VintfStability +enum Meta { + NONE = 0, + ALT_ON = 2, + ALT_LEFT_ON = 16, + ALT_RIGHT_ON = 32, + SHIFT_ON = 1, + SHIFT_LEFT_ON = 64, + SHIFT_RIGHT_ON = 128, + SYM_ON = 4, + FUNCTION_ON = 8, + CTRL_ON = 4096, + CTRL_LEFT_ON = 8192, + CTRL_RIGHT_ON = 16384, + META_ON = 65536, + META_LEFT_ON = 131072, + META_RIGHT_ON = 262144, + CAPS_LOCK_ON = 1048576, + NUM_LOCK_ON = 2097152, + SCROLL_LOCK_ON = 4194304, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/MotionEvent.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/MotionEvent.aidl new file mode 100644 index 0000000000..84af4bf4ca --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/MotionEvent.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 -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.input.common; +@VintfStability +parcelable MotionEvent { + int deviceId; + android.hardware.input.common.Source source; + int displayId; + long downTime; + long eventTime; + android.hardware.input.common.Action action; + byte actionIndex; + android.hardware.input.common.Button actionButton; + android.hardware.input.common.Flag flags; + android.hardware.input.common.PolicyFlag policyFlags; + android.hardware.input.common.EdgeFlag edgeFlags; + android.hardware.input.common.Meta metaState; + android.hardware.input.common.Button buttonState; + float xPrecision; + float yPrecision; + android.hardware.input.common.PointerProperties[] pointerProperties; + android.hardware.input.common.PointerCoords[] pointerCoords; + int deviceTimestamp; + android.hardware.input.common.VideoFrame[] frames; +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/PointerCoords.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/PointerCoords.aidl new file mode 100644 index 0000000000..353a106868 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/PointerCoords.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 -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.input.common; +@VintfStability +parcelable PointerCoords { + long bits; + float[] values; +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/PointerProperties.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/PointerProperties.aidl new file mode 100644 index 0000000000..a49581b438 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/PointerProperties.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 -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.input.common; +@VintfStability +parcelable PointerProperties { + int id; + android.hardware.input.common.ToolType toolType; +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/PolicyFlag.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/PolicyFlag.aidl new file mode 100644 index 0000000000..247e868fcb --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/PolicyFlag.aidl @@ -0,0 +1,47 @@ +/* + * 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 -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.input.common; +@Backing(type="int") @VintfStability +enum PolicyFlag { + WAKE = 1, + VIRTUAL = 2, + FUNCTION = 4, + GESTURE = 8, + INJECTED = 16777216, + TRUSTED = 33554432, + FILTERED = 67108864, + DISABLE_KEY_REPEAT = 134217728, + INTERACTIVE = 536870912, + PASS_TO_USER = 1073741824, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Source.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Source.aidl new file mode 100644 index 0000000000..24d02cdbdc --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Source.aidl @@ -0,0 +1,53 @@ +/* + * 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 -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.input.common; +@Backing(type="int") @VintfStability +enum Source { + UNKNOWN = 0, + KEYBOARD = 257, + DPAD = 513, + GAMEPAD = 1025, + TOUCHSCREEN = 4098, + MOUSE = 8194, + STYLUS = 16386, + BLUETOOTH_STYLUS = 49154, + TRACKBALL = 65540, + MOUSE_RELATIVE = 131076, + TOUCHPAD = 1048584, + TOUCH_NAVIGATION = 2097152, + ROTARY_ENCODER = 4194304, + JOYSTICK = 16777232, + SENSOR = 67108864, + ANY = -256, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/SourceClass.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/SourceClass.aidl new file mode 100644 index 0000000000..96eede24b0 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/SourceClass.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 -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.input.common; +@Backing(type="byte") @VintfStability +enum SourceClass { + NONE = 0, + BUTTON = 1, + POINTER = 2, + NAVIGATION = 4, + POSITION = 8, + JOYSTICK = 16, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/ToolType.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/ToolType.aidl new file mode 100644 index 0000000000..ac1b69d74e --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/ToolType.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 -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.input.common; +@Backing(type="byte") @VintfStability +enum ToolType { + UNKNOWN = 0, + FINGER = 1, + STYLUS = 2, + MOUSE = 3, + ERASER = 4, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/VideoFrame.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/VideoFrame.aidl new file mode 100644 index 0000000000..14985c51d5 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/VideoFrame.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 -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.input.common; +@VintfStability +parcelable VideoFrame { + char[] data; + int height; + int width; + long timestamp; +} diff --git a/input/common/aidl/android/hardware/input/common/Action.aidl b/input/common/aidl/android/hardware/input/common/Action.aidl new file mode 100644 index 0000000000..ebe5e676dc --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/Action.aidl @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.input.common; + +/** + * Motion event actions + */ +@VintfStability +@Backing(type="int") +enum Action { + /** + * A pressed gesture has started, the motion contains the initial starting location. + */ + DOWN = 0, + /** + * A pressed gesture has finished, the motion contains the final release location + * as well as any intermediate points since the last down or move event. + */ + UP = 1, + /** + * A change has happened during a press gesture (between AMOTION_EVENT_ACTION_DOWN and + * AMOTION_EVENT_ACTION_UP). The motion contains the most recent point. + */ + MOVE = 2, + /** + * The current gesture has been aborted. + * You will not receive any more points in it. You must treat this as + * an up event, but not perform any action that you normally would. + */ + CANCEL = 3, + /** + * A movement has happened outside of the normal bounds of the UI element. + * This does not provide a full gesture, but only the initial location of the movement/touch. + */ + OUTSIDE = 4, + /** + * A non-primary pointer has gone down. + */ + POINTER_DOWN = 5, + /** + * A non-primary pointer has gone up. + */ + POINTER_UP = 6, + /** + * A change happened but the pointer is not down (unlike AMOTION_EVENT_ACTION_MOVE). + * The motion contains the most recent point, as well as any intermediate points since + * the last hover move event. + */ + HOVER_MOVE = 7, + /** + * The motion event contains relative vertical and/or horizontal scroll offsets. + * Use getAxisValue to retrieve the information from AMOTION_EVENT_AXIS_VSCROLL + * and AMOTION_EVENT_AXIS_HSCROLL. + * The pointer may or may not be down when this event is dispatched. + * The framework will always deliver this action to the window under the pointer, which + * may not be the window currently touched. + */ + SCROLL = 8, + /** + * The pointer is not down but has entered the boundaries of a window or view. + */ + HOVER_ENTER = 9, + /** + * The pointer is not down but has exited the boundaries of a window or view. + */ + HOVER_EXIT = 10, + /** + * One or more buttons have been pressed. + */ + BUTTON_PRESS = 11, + /** + * One or more buttons have been released. + */ + BUTTON_RELEASE = 12, +} diff --git a/input/common/aidl/android/hardware/input/common/Axis.aidl b/input/common/aidl/android/hardware/input/common/Axis.aidl new file mode 100644 index 0000000000..11509494fa --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/Axis.aidl @@ -0,0 +1,387 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.input.common; + +/** + * Constants that identify each individual axis of a motion event. + * Each value represents a bit position. The user is expected to manually shift + * to the desired position (e.g., 1 << Axis.X) when reading or writing these + * from a bitfield manually. + */ +@VintfStability +@Backing(type="int") +enum Axis { + /** + * Axis constant: X axis of a motion event. + * + * - For a touch screen, reports the absolute X screen position of the center of + * the touch contact area. The units are display pixels. + * - For a touch pad, reports the absolute X surface position of the center of the touch + * contact area. The units are device-dependent. + * - For a mouse, reports the absolute X screen position of the mouse pointer. + * The units are display pixels. + * - For a trackball, reports the relative horizontal displacement of the trackball. + * The value is normalized to a range from -1.0 (left) to 1.0 (right). + * - For a joystick, reports the absolute X position of the joystick. + * The value is normalized to a range from -1.0 (left) to 1.0 (right). + */ + X = 0, + /** + * Axis constant: Y axis of a motion event. + * + * - For a touch screen, reports the absolute Y screen position of the center of + * the touch contact area. The units are display pixels. + * - For a touch pad, reports the absolute Y surface position of the center of the touch + * contact area. The units are device-dependent. + * - For a mouse, reports the absolute Y screen position of the mouse pointer. + * The units are display pixels. + * - For a trackball, reports the relative vertical displacement of the trackball. + * The value is normalized to a range from -1.0 (up) to 1.0 (down). + * - For a joystick, reports the absolute Y position of the joystick. + * The value is normalized to a range from -1.0 (up or far) to 1.0 (down or near). + */ + Y = 1, + /** + * Axis constant: Pressure axis of a motion event. + * + * - For a touch screen or touch pad, reports the approximate pressure applied to the surface + * by a finger or other tool. The value is normalized to a range from + * 0 (no pressure at all) to 1 (normal pressure), although values higher than 1 + * may be generated depending on the calibration of the input device. + * - For a trackball, the value is set to 1 if the trackball button is pressed + * or 0 otherwise. + * - For a mouse, the value is set to 1 if the primary mouse button is pressed + * or 0 otherwise. + */ + PRESSURE = 2, + /** + * Axis constant: Size axis of a motion event. + * + * - For a touch screen or touch pad, reports the approximate size of the contact area in + * relation to the maximum detectable size for the device. The value is normalized + * to a range from 0 (smallest detectable size) to 1 (largest detectable size), + * although it is not a linear scale. This value is of limited use. + * To obtain calibrated size information, see + * {@link TOUCH_MAJOR} or {@link TOOL_MAJOR}. + */ + SIZE = 3, + /** + * Axis constant: TouchMajor axis of a motion event. + * + * - For a touch screen, reports the length of the major axis of an ellipse that + * represents the touch area at the point of contact. + * The units are display pixels. + * - For a touch pad, reports the length of the major axis of an ellipse that + * represents the touch area at the point of contact. + * The units are device-dependent. + */ + TOUCH_MAJOR = 4, + /** + * Axis constant: TouchMinor axis of a motion event. + * + * - For a touch screen, reports the length of the minor axis of an ellipse that + * represents the touch area at the point of contact. + * The units are display pixels. + * - For a touch pad, reports the length of the minor axis of an ellipse that + * represents the touch area at the point of contact. + * The units are device-dependent. + * + * When the touch is circular, the major and minor axis lengths will be equal to one another. + */ + TOUCH_MINOR = 5, + /** + * Axis constant: ToolMajor axis of a motion event. + * + * - For a touch screen, reports the length of the major axis of an ellipse that + * represents the size of the approaching finger or tool used to make contact. + * - For a touch pad, reports the length of the major axis of an ellipse that + * represents the size of the approaching finger or tool used to make contact. + * The units are device-dependent. + * + * When the touch is circular, the major and minor axis lengths will be equal to one another. + * + * The tool size may be larger than the touch size since the tool may not be fully + * in contact with the touch sensor. + */ + TOOL_MAJOR = 6, + /** + * Axis constant: ToolMinor axis of a motion event. + * + * - For a touch screen, reports the length of the minor axis of an ellipse that + * represents the size of the approaching finger or tool used to make contact. + * - For a touch pad, reports the length of the minor axis of an ellipse that + * represents the size of the approaching finger or tool used to make contact. + * The units are device-dependent. + * + * When the touch is circular, the major and minor axis lengths will be equal to one another. + * + * The tool size may be larger than the touch size since the tool may not be fully + * in contact with the touch sensor. + */ + TOOL_MINOR = 7, + /** + * Axis constant: Orientation axis of a motion event. + * + * - For a touch screen or touch pad, reports the orientation of the finger + * or tool in radians relative to the vertical plane of the device. + * An angle of 0 radians indicates that the major axis of contact is oriented + * upwards, is perfectly circular or is of unknown orientation. A positive angle + * indicates that the major axis of contact is oriented to the right. A negative angle + * indicates that the major axis of contact is oriented to the left. + * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians + * (finger pointing fully right). + * - For a stylus, the orientation indicates the direction in which the stylus + * is pointing in relation to the vertical axis of the current orientation of the screen. + * The range is from -PI radians to PI radians, where 0 is pointing up, + * -PI/2 radians is pointing left, -PI or PI radians is pointing down, and PI/2 radians + * is pointing right. See also {@link TILT}. + */ + ORIENTATION = 8, + /** + * Axis constant: Vertical Scroll axis of a motion event. + * + * - For a mouse, reports the relative movement of the vertical scroll wheel. + * The value is normalized to a range from -1.0 (down) to 1.0 (up). + * + * The framework may use this axis to scroll views vertically. + */ + VSCROLL = 9, + /** + * Axis constant: Horizontal Scroll axis of a motion event. + * + * - For a mouse, reports the relative movement of the horizontal scroll wheel. + * The value is normalized to a range from -1.0 (left) to 1.0 (right). + * + * The framework may use this axis to scroll views horizontally. + */ + HSCROLL = 10, + /** + * Axis constant: Z axis of a motion event. + * + * - For a joystick, reports the absolute Z position of the joystick. + * The value is normalized to a range from -1.0 (high) to 1.0 (low). + * On game pads with two analog joysticks, this axis is often reinterpreted + * to report the absolute X position of the second joystick instead. + */ + Z = 11, + /** + * Axis constant: X Rotation axis of a motion event. + * + * - For a joystick, reports the absolute rotation angle about the X axis. + * The value is normalized to a range from -1.0 (counter-clockwise) to 1.0 (clockwise). + */ + RX = 12, + /** + * Axis constant: Y Rotation axis of a motion event. + * + * - For a joystick, reports the absolute rotation angle about the Y axis. + * The value is normalized to a range from -1.0 (counter-clockwise) to 1.0 (clockwise). + */ + RY = 13, + /** + * Axis constant: Z Rotation axis of a motion event. + * + * - For a joystick, reports the absolute rotation angle about the Z axis. + * The value is normalized to a range from -1.0 (counter-clockwise) to 1.0 (clockwise). + * On game pads with two analog joysticks, this axis is often reinterpreted + * to report the absolute Y position of the second joystick instead. + */ + RZ = 14, + /** + * Axis constant: Hat X axis of a motion event. + * + * - For a joystick, reports the absolute X position of the directional hat control. + * The value is normalized to a range from -1.0 (left) to 1.0 (right). + */ + HAT_X = 15, + /** + * Axis constant: Hat Y axis of a motion event. + * + * - For a joystick, reports the absolute Y position of the directional hat control. + * The value is normalized to a range from -1.0 (up) to 1.0 (down). + */ + HAT_Y = 16, + /** + * Axis constant: Left Trigger axis of a motion event. + * + * - For a joystick, reports the absolute position of the left trigger control. + * The value is normalized to a range from 0.0 (released) to 1.0 (fully pressed). + */ + LTRIGGER = 17, + /** + * Axis constant: Right Trigger axis of a motion event. + * + * - For a joystick, reports the absolute position of the right trigger control. + * The value is normalized to a range from 0.0 (released) to 1.0 (fully pressed). + */ + RTRIGGER = 18, + /** + * Axis constant: Throttle axis of a motion event. + * + * - For a joystick, reports the absolute position of the throttle control. + * The value is normalized to a range from 0.0 (fully open) to 1.0 (fully closed). + */ + THROTTLE = 19, + /** + * Axis constant: Rudder axis of a motion event. + * + * - For a joystick, reports the absolute position of the rudder control. + * The value is normalized to a range from -1.0 (turn left) to 1.0 (turn right). + */ + RUDDER = 20, + /** + * Axis constant: Wheel axis of a motion event. + * + * - For a joystick, reports the absolute position of the steering wheel control. + * The value is normalized to a range from -1.0 (turn left) to 1.0 (turn right). + */ + WHEEL = 21, + /** + * Axis constant: Gas axis of a motion event. + * + * - For a joystick, reports the absolute position of the gas (accelerator) control. + * The value is normalized to a range from 0.0 (no acceleration) + * to 1.0 (maximum acceleration). + */ + GAS = 22, + /** + * Axis constant: Brake axis of a motion event. + * + * - For a joystick, reports the absolute position of the brake control. + * The value is normalized to a range from 0.0 (no braking) to 1.0 (maximum braking). + */ + BRAKE = 23, + /** + * Axis constant: Distance axis of a motion event. + * + * - For a stylus, reports the distance of the stylus from the screen. + * A value of 0.0 indicates direct contact and larger values indicate increasing + * distance from the surface. + */ + DISTANCE = 24, + /** + * Axis constant: Tilt axis of a motion event. + * + * - For a stylus, reports the tilt angle of the stylus in radians where + * 0 radians indicates that the stylus is being held perpendicular to the + * surface, and PI/2 radians indicates that the stylus is being held flat + * against the surface. + */ + TILT = 25, + /** + * Axis constant: Generic scroll axis of a motion event. + * + * - This is used for scroll axis motion events that can't be classified as strictly + * vertical or horizontal. The movement of a rotating scroller is an example of this. + */ + SCROLL = 26, + /** + * Axis constant: The movement of x position of a motion event. + * + * - For a mouse, reports a difference of x position between the previous position. + * This is useful when pointer is captured, in that case the mouse pointer doesn't + * change the location but this axis reports the difference which allows the app + * to see how the mouse is moved. + */ + RELATIVE_X = 27, + /** + * Axis constant: The movement of y position of a motion event. + * + * Same as {@link RELATIVE_X}, but for y position. + */ + RELATIVE_Y = 28, + /** + * Axis constant: Generic 1 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_1 = 32, + /** + * Axis constant: Generic 2 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_2 = 33, + /** + * Axis constant: Generic 3 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_3 = 34, + /** + * Axis constant: Generic 4 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_4 = 35, + /** + * Axis constant: Generic 5 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_5 = 36, + /** + * Axis constant: Generic 6 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_6 = 37, + /** + * Axis constant: Generic 7 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_7 = 38, + /** + * Axis constant: Generic 8 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_8 = 39, + /** + * Axis constant: Generic 9 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_9 = 40, + /** + * Axis constant: Generic 10 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_10 = 41, + /** + * Axis constant: Generic 11 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_11 = 42, + /** + * Axis constant: Generic 12 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_12 = 43, + /** + * Axis constant: Generic 13 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_13 = 44, + /** + * Axis constant: Generic 14 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_14 = 45, + /** + * Axis constant: Generic 15 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_15 = 46, + /** + * Axis constant: Generic 16 axis of a motion event. + * The interpretation of a generic axis is device-specific. + */ + GENERIC_16 = 47, +} diff --git a/input/common/aidl/android/hardware/input/common/Button.aidl b/input/common/aidl/android/hardware/input/common/Button.aidl new file mode 100644 index 0000000000..4bbd5f5a17 --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/Button.aidl @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.input.common; + +/** + * Buttons that are associated with motion events. + */ +@VintfStability +@Backing(type="int") +enum Button { + NONE = 0, + PRIMARY = 1 << 0, + SECONDARY = 1 << 1, + TERTIARY = 1 << 2, + BACK = 1 << 3, + FORWARD = 1 << 4, + STYLUS_PRIMARY = 1 << 5, + STYLUS_SECONDARY = 1 << 6, +} diff --git a/input/common/aidl/android/hardware/input/common/Classification.aidl b/input/common/aidl/android/hardware/input/common/Classification.aidl new file mode 100644 index 0000000000..f573174e90 --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/Classification.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. + */ + +package android.hardware.input.common; + +/** + * Classification of the current gesture, if available. + */ +@VintfStability +@Backing(type="byte") +enum Classification { + NONE = 0, + /** + * Too early to classify the gesture, need more events. + */ + AMBIGUOUS_GESTURE = 1, + /** + * User is force-pressing the screen. + */ + DEEP_PRESS = 2, +} diff --git a/input/common/aidl/android/hardware/input/common/EdgeFlag.aidl b/input/common/aidl/android/hardware/input/common/EdgeFlag.aidl new file mode 100644 index 0000000000..8d2263586e --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/EdgeFlag.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. + */ + +package android.hardware.input.common; + +/** + * Edge flags + */ +@VintfStability +@Backing(type="int") +enum EdgeFlag { + /** + * No edges are intersected + */ + NONE = 0, + /** + * Motion intersected top edge of the screen + */ + TOP = 1 << 0, + /** + * Motion intersected bottom edge of the screen + */ + BOTTOM = 1 << 1, + /** + * Motion intersected left edge of the screen + */ + LEFT = 1 << 2, + /** + * Motion intersected right edge of the screen + */ + RIGHT = 1 << 3, +} diff --git a/input/common/aidl/android/hardware/input/common/Flag.aidl b/input/common/aidl/android/hardware/input/common/Flag.aidl new file mode 100644 index 0000000000..600bdd3993 --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/Flag.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. + */ + +package android.hardware.input.common; + +/** + * Motion event flags + */ +@VintfStability +@Backing(type="int") +enum Flag { + /** + * Indicates that the window that received this motion event is partly + * or wholly obscured by another visible window above it. This flag is set to true + * even if the event did not directly pass through the obscured area. + * A security sensitive application can check this flag to identify situations in which + * a malicious application may have covered up part of its content for the purpose + * of misleading the user or hijacking touches. An appropriate response might be + * to drop the suspect touches or to take additional precautions to confirm the user's + * actual intent. + */ + WINDOW_IS_OBSCURED = 1 << 0, + /** + * This flag indicates that the event has been generated by a gesture generator. It + * could be used, for example, to determine whether touch slop should be applied. + */ + IS_GENERATED_GESTURE = 1 << 3, + /** + * Motion event is inconsistent with previously sent motion events. + */ + TAINTED = 1 << 31, +} diff --git a/input/common/aidl/android/hardware/input/common/Meta.aidl b/input/common/aidl/android/hardware/input/common/Meta.aidl new file mode 100644 index 0000000000..9ccf11b69d --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/Meta.aidl @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.input.common; + +/** + * Meta key / modifier state + */ +@VintfStability +@Backing(type="int") +enum Meta { + NONE = 0, + /** + * One of the ALT meta keys is pressed. + */ + ALT_ON = 1 << 1, + /** + * The left ALT meta key is pressed. + */ + ALT_LEFT_ON = 1 << 4, + /** + * The right ALT meta key is pressed. + */ + ALT_RIGHT_ON = 1 << 5, + /** + * One of the SHIFT meta keys is pressed. + */ + SHIFT_ON = 1 << 0, + /** + * The left SHIFT meta key is pressed. + */ + SHIFT_LEFT_ON = 1 << 6, + /** + * The right SHIFT meta key is pressed. + */ + SHIFT_RIGHT_ON = 1 << 7, + /** + * The SYM meta key is pressed. + */ + SYM_ON = 1 << 2, + /** + * The FUNCTION meta key is pressed. + */ + FUNCTION_ON = 1 << 3, + /** + * One of the CTRL meta keys is pressed. + */ + CTRL_ON = 1 << 12, + /** + * The left CTRL meta key is pressed. + */ + CTRL_LEFT_ON = 1 << 13, + /** + * The right CTRL meta key is pressed. + */ + CTRL_RIGHT_ON = 1 << 14, + /** + * One of the META meta keys is pressed. + */ + META_ON = 1 << 16, + /** + * The left META meta key is pressed. + */ + META_LEFT_ON = 1 << 17, + /** + * The right META meta key is pressed. + */ + META_RIGHT_ON = 1 << 18, + /** + * The CAPS LOCK meta key is on. + */ + CAPS_LOCK_ON = 1 << 20, + /** + * The NUM LOCK meta key is on. + */ + NUM_LOCK_ON = 1 << 21, + /** + * The SCROLL LOCK meta key is on. + */ + SCROLL_LOCK_ON = 1 << 22, +} diff --git a/input/common/aidl/android/hardware/input/common/MotionEvent.aidl b/input/common/aidl/android/hardware/input/common/MotionEvent.aidl new file mode 100644 index 0000000000..dfea7033f2 --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/MotionEvent.aidl @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.input.common; + +import android.hardware.input.common.Action; +import android.hardware.input.common.Button; +import android.hardware.input.common.EdgeFlag; +import android.hardware.input.common.Flag; +import android.hardware.input.common.Meta; +import android.hardware.input.common.PointerCoords; +import android.hardware.input.common.PointerProperties; +import android.hardware.input.common.PolicyFlag; +import android.hardware.input.common.Source; +import android.hardware.input.common.VideoFrame; + +/** + * Analogous to Android's native MotionEvent / NotifyMotionArgs. + * Stores the basic information about pointer movements. + */ +@VintfStability +parcelable MotionEvent { + /** + * The id of the device which produced this event. + */ + int deviceId; + /** + * The source type of this event. + */ + Source source; + /** + * The display id associated with this event. + */ + int displayId; + /** + * Time when the initial touch down occurred, in nanoseconds. + */ + long downTime; + /** + * Time when this event occurred, in nanoseconds. + */ + long eventTime; + /** + * The kind of action being performed. + */ + Action action; + /** + * For ACTION_POINTER_DOWN or ACTION_POINTER_UP, this contains the associated pointer index. + * The index may be used to get information about the pointer that has gone down or up. + */ + byte actionIndex; + /** + * The button that has been modified during a press or release action. + */ + Button actionButton; + /** + * The motion event flags. + */ + Flag flags; + /** + * The motion event policy flags. + */ + PolicyFlag policyFlags; + /** + * The edges, if any, that were touched by this motion event. + */ + EdgeFlag edgeFlags; + /** + * The state of any meta / modifier keys that were in effect when the event was generated. + */ + Meta metaState; + /** + * The state of buttons that are pressed. + */ + Button buttonState; + /** + * The precision of the X coordinate being reported. + */ + float xPrecision; + /** + * The precision of the Y coordinate being reported. + */ + float yPrecision; + /** + * The properties of each pointer present in this motion event. + */ + PointerProperties[] pointerProperties; + /** + * The coordinates of each pointer. + */ + PointerCoords[] pointerCoords; + /** + * Device time at which the event occurred, in microseconds. + * Will wrap after a little over an hour. + */ + int deviceTimestamp; + /** + * The video frames, if any, associated with the current or previous motion events. + */ + VideoFrame[] frames; +} diff --git a/input/common/aidl/android/hardware/input/common/PointerCoords.aidl b/input/common/aidl/android/hardware/input/common/PointerCoords.aidl new file mode 100644 index 0000000000..56d9a74a4f --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/PointerCoords.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. + */ + +package android.hardware.input.common; + +import android.hardware.input.common.Axis; + +/** + * Pointer coordinate data. Analogous to Android's PointerCoords. + */ +@VintfStability +parcelable PointerCoords { + /** + * Bitfield of axes that are present in this structure. + * Each bit position matches an axis defined in Axis.aidl. + */ + long bits; + /** + * The values corresponding to each non-zero axis. This vector only + * contains non-zero entries. If an axis that is not currently specified + * in "bits" is requested, a zero value is returned. + * There are only as many values stored here + * as there are non-zero bits in the "bits" field. + * The values are position-packed. So the first non-zero axis will be + * at position 0, the next non-zero axis will be at position 1, and so on. + */ + float[] values; +} diff --git a/input/common/aidl/android/hardware/input/common/PointerProperties.aidl b/input/common/aidl/android/hardware/input/common/PointerProperties.aidl new file mode 100644 index 0000000000..38d815e022 --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/PointerProperties.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. + */ + +package android.hardware.input.common; + +import android.hardware.input.common.ToolType; + +/** + * Properties of a particular pointer. Analogous to Android's PointerProperties. + */ +@VintfStability +parcelable PointerProperties { + /** + * A number identifying a specific pointer. When a pointer is lifted, + * this value may be reused by another new pointer, even during the + * same gesture. For example, if there are two pointers touching the screen + * at the same time, they might have pointer ID's of 0 and 1. If the + * pointer with id = 0 is lifted, while the pointer with id = 1 remains, and + * a new pointer is placed on the screen, then the new pointer may receive + * an id of 0. While a pointer is active, it is guaranteed to keep the same + * id. + */ + int id; + /** + * Type of tool used to make contact, such as a finger or stylus, if known. + */ + ToolType toolType; +} diff --git a/input/common/aidl/android/hardware/input/common/PolicyFlag.aidl b/input/common/aidl/android/hardware/input/common/PolicyFlag.aidl new file mode 100644 index 0000000000..c5edd0d433 --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/PolicyFlag.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. + */ + +package android.hardware.input.common; + +/** + * Policy flags. + * The values 1 << 4 through 1 << 23 are not currently used. + * When a new value is added, make sure it matches a value defined in Input.h + * and other relevant files in frameworks/base and frameworks/native. + */ +@VintfStability +@Backing(type="int") +enum PolicyFlag { + /** + * Event should wake the device + */ + WAKE = 1 << 0, + /** + * Key is virtual, and should generate haptic feedback + */ + VIRTUAL = 1 << 1, + /** + * Key is the special function modifier + */ + FUNCTION = 1 << 2, + /** + * Key represents a special gesture that has been detected + * by the touch firmware or driver. + */ + GESTURE = 1 << 3, + /** + * Event was injected + */ + INJECTED = 1 << 24, + /** + * Event comes from a trusted source, such as a directly attached input + * device or an application with system-wide event injection permission. + */ + TRUSTED = 1 << 25, + /** + * Event has passed through an input filter. + */ + FILTERED = 1 << 26, + /** + * Disable automatic key repeating behaviour. + */ + DISABLE_KEY_REPEAT = 1 << 27, + /** + * Device was in an interactive state when the event was intercepted + */ + INTERACTIVE = 1 << 29, + /** + * Event should be dispatched to applications + */ + PASS_TO_USER = 1 << 30, +} diff --git a/input/common/aidl/android/hardware/input/common/Source.aidl b/input/common/aidl/android/hardware/input/common/Source.aidl new file mode 100644 index 0000000000..7eb6d66d64 --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/Source.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. + */ + +package android.hardware.input.common; + +import android.hardware.input.common.SourceClass; + +/** + * Input sources + */ +@VintfStability +@Backing(type="int") +enum Source { + UNKNOWN = 0, + KEYBOARD = (1 << 8) | SourceClass.BUTTON, + DPAD = (1 << 9) | SourceClass.BUTTON, + GAMEPAD = (1 << 10) | SourceClass.BUTTON, + TOUCHSCREEN = (1 << 12) | SourceClass.POINTER, + MOUSE = (1 << 13) | SourceClass.POINTER, + STYLUS = (1 << 14) | SourceClass.POINTER, + BLUETOOTH_STYLUS = (1 << 15) | STYLUS, + TRACKBALL = (1 << 16) | SourceClass.NAVIGATION, + MOUSE_RELATIVE = (1 << 17) | SourceClass.NAVIGATION, + TOUCHPAD = (1 << 20) | SourceClass.POSITION, + TOUCH_NAVIGATION = (1 << 21) | SourceClass.NONE, + ROTARY_ENCODER = (1 << 22) | SourceClass.NONE, + JOYSTICK = (1 << 24) | SourceClass.JOYSTICK, + SENSOR = (1 << 26) | SourceClass.NONE, + ANY = 0xFFFFFF00, +} diff --git a/input/common/aidl/android/hardware/input/common/SourceClass.aidl b/input/common/aidl/android/hardware/input/common/SourceClass.aidl new file mode 100644 index 0000000000..43157981e3 --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/SourceClass.aidl @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.input.common; + +@VintfStability +@Backing(type="byte") +enum SourceClass { + NONE = 0 << 0, + BUTTON = 1 << 0, + POINTER = 1 << 1, + NAVIGATION = 1 << 2, + POSITION = 1 << 3, + JOYSTICK = 1 << 4, +} diff --git a/input/common/aidl/android/hardware/input/common/ToolType.aidl b/input/common/aidl/android/hardware/input/common/ToolType.aidl new file mode 100644 index 0000000000..cfa057dc15 --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/ToolType.aidl @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.input.common; + +/** + * Tool type of a pointer + */ +@VintfStability +@Backing(type="byte") +enum ToolType { + UNKNOWN = 0, + FINGER = 1, + STYLUS = 2, + MOUSE = 3, + ERASER = 4, +} diff --git a/input/common/aidl/android/hardware/input/common/VideoFrame.aidl b/input/common/aidl/android/hardware/input/common/VideoFrame.aidl new file mode 100644 index 0000000000..409cee50fc --- /dev/null +++ b/input/common/aidl/android/hardware/input/common/VideoFrame.aidl @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.input.common; + +/** + * Touch heatmap. + * + * The array is a 2-D row-major matrix with dimensions (height, width). + * The heatmap data is rotated when device orientation changes. + * + * Example: + * + * If the data in the array is: + * data[i] = i for i in 0 .. 59, + * then it can be represented as a 10 x 6 matrix: + * + * <-- width --> + * 0 1 2 3 4 5 ^ + * 6 7 8 9 10 11 | + * 12 13 14 15 16 17 | + * 18 ... 23 | + * 24 ... 29 | height + * 30 ... 35 | + * 36 ... 41 | + * 42 ... 47 | + * 48 ... 53 | + * 54 ... 59 v + * + * Looking at the device in standard portrait orientation, + * the element "0" is the top left of the screen, + * "5" is at the top right, and "59" is the bottom right. + * Here height=10 and width=6. + * + * If the screen orientation changes to landscape (a 90 degree orientation + * change), the frame's dimensions will become 6 x 10 + * and the data will look as follows: + * 54 48 42 36 30 24 18 12 6 0 ^ + * ... 13 7 1 | + * ... 14 8 2 | height + * ... 15 9 3 | + * ... 16 10 4 | + * 59 53 47 41 35 29 23 17 11 5 v + * <-- width --> + * + * Here the element "0" is at the physical top left of the unrotated screen. + * + * Since the coordinates of a MotionEvent are also adjusted based on the + * orientation, the rotation of the video frame data ensures that + * the axes for MotionEvent and VideoFrame data are consistent. + */ +@VintfStability +parcelable VideoFrame { + /** + * Video frame data. + * Size of the data is height * width. + */ + char[] data; + int height; + int width; + /** + * Time at which the frame was collected, in nanoseconds. + * Measured with the same clock that is used to populate MotionEvent times. + */ + long timestamp; +} -- GitLab From 37d77dded63f6f4d28a853e459e42939eb308328 Mon Sep 17 00:00:00 2001 From: Joe Huang Date: Thu, 30 Dec 2021 13:14:29 +0800 Subject: [PATCH 439/825] Add IGnssAntennaInfo AIDL HAL Bug: 205185369 Test: atest VtsHalGnssTargetTest Change-Id: If269c61b408c2710a4fa224de4d684c99ac5732b --- .../current/android/hardware/gnss/IGnss.aidl | 1 + .../hardware/gnss/IGnssAntennaInfo.aidl | 39 +++++ .../gnss/IGnssAntennaInfoCallback.aidl | 60 +++++++ gnss/aidl/android/hardware/gnss/IGnss.aidl | 8 + .../hardware/gnss/IGnssAntennaInfo.aidl | 41 +++++ .../gnss/IGnssAntennaInfoCallback.aidl | 140 ++++++++++++++++ .../android/hardware/gnss/IGnssCallback.aidl | 2 +- gnss/aidl/default/Android.bp | 1 + gnss/aidl/default/Gnss.cpp | 12 +- gnss/aidl/default/Gnss.h | 3 + gnss/aidl/default/GnssAntennaInfo.cpp | 149 ++++++++++++++++++ gnss/aidl/default/GnssAntennaInfo.h | 51 ++++++ gnss/aidl/vts/Android.bp | 1 + gnss/aidl/vts/GnssAntennaInfoCallbackAidl.cpp | 26 +++ gnss/aidl/vts/GnssAntennaInfoCallbackAidl.h | 36 +++++ gnss/aidl/vts/gnss_hal_test_cases.cpp | 85 ++++++++++ 16 files changed, 653 insertions(+), 2 deletions(-) create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfo.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfoCallback.aidl create mode 100644 gnss/aidl/android/hardware/gnss/IGnssAntennaInfo.aidl create mode 100644 gnss/aidl/android/hardware/gnss/IGnssAntennaInfoCallback.aidl create mode 100644 gnss/aidl/default/GnssAntennaInfo.cpp create mode 100644 gnss/aidl/default/GnssAntennaInfo.h create mode 100644 gnss/aidl/vts/GnssAntennaInfoCallbackAidl.cpp create mode 100644 gnss/aidl/vts/GnssAntennaInfoCallbackAidl.h 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 1b4c5817ce..281c531977 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 @@ -53,6 +53,7 @@ interface IGnss { void injectBestLocation(in android.hardware.gnss.GnssLocation location); void deleteAidingData(in android.hardware.gnss.IGnss.GnssAidingData aidingDataFlags); void setPositionMode(in android.hardware.gnss.IGnss.GnssPositionMode mode, in android.hardware.gnss.IGnss.GnssPositionRecurrence recurrence, in int minIntervalMs, in int preferredAccuracyMeters, in int preferredTimeMs, in boolean lowPowerMode); + android.hardware.gnss.IGnssAntennaInfo getExtensionGnssAntennaInfo(); const int ERROR_INVALID_ARGUMENT = 1; const int ERROR_ALREADY_INIT = 2; const int ERROR_GENERIC = 3; diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfo.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfo.aidl new file mode 100644 index 0000000000..2734ac1d69 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfo.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 -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.gnss; +@VintfStability +interface IGnssAntennaInfo { + void setCallback(in android.hardware.gnss.IGnssAntennaInfoCallback callback); + void close(); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfoCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfoCallback.aidl new file mode 100644 index 0000000000..ada97077e7 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfoCallback.aidl @@ -0,0 +1,60 @@ +/* + * 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 -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.gnss; +@VintfStability +interface IGnssAntennaInfoCallback { + void gnssAntennaInfoCb(in android.hardware.gnss.IGnssAntennaInfoCallback.GnssAntennaInfo[] gnssAntennaInfos); + @VintfStability + parcelable Row { + double[] row; + } + @VintfStability + parcelable Coord { + double x; + double xUncertainty; + double y; + double yUncertainty; + double z; + double zUncertainty; + } + @VintfStability + parcelable GnssAntennaInfo { + long carrierFrequencyHz; + android.hardware.gnss.IGnssAntennaInfoCallback.Coord phaseCenterOffsetCoordinateMillimeters; + android.hardware.gnss.IGnssAntennaInfoCallback.Row[] phaseCenterVariationCorrectionMillimeters; + android.hardware.gnss.IGnssAntennaInfoCallback.Row[] phaseCenterVariationCorrectionUncertaintyMillimeters; + android.hardware.gnss.IGnssAntennaInfoCallback.Row[] signalGainCorrectionDbi; + android.hardware.gnss.IGnssAntennaInfoCallback.Row[] signalGainCorrectionUncertaintyDbi; + } +} diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl index 4ddc6a6193..e1d46703fa 100644 --- a/gnss/aidl/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl @@ -18,6 +18,7 @@ package android.hardware.gnss; import android.hardware.gnss.GnssLocation; import android.hardware.gnss.IAGnss; +import android.hardware.gnss.IGnssAntennaInfo; import android.hardware.gnss.IGnssBatching; import android.hardware.gnss.IGnssCallback; import android.hardware.gnss.IGnssConfiguration; @@ -277,4 +278,11 @@ interface IGnss { void setPositionMode(in GnssPositionMode mode, in GnssPositionRecurrence recurrence, in int minIntervalMs, in int preferredAccuracyMeters, in int preferredTimeMs, in boolean lowPowerMode); + + /* + * This method returns the IGnssAntennaInfo. + * + * @return Handle to the IGnssAntennaInfo. + */ + IGnssAntennaInfo getExtensionGnssAntennaInfo(); } diff --git a/gnss/aidl/android/hardware/gnss/IGnssAntennaInfo.aidl b/gnss/aidl/android/hardware/gnss/IGnssAntennaInfo.aidl new file mode 100644 index 0000000000..de83b67bd6 --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/IGnssAntennaInfo.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. + */ + +package android.hardware.gnss; + +import android.hardware.gnss.IGnssAntennaInfoCallback; + +/** + * Extended interface for GNSS antenna information support. + */ +@VintfStability +interface IGnssAntennaInfo { + /** + * Registers the callback routines with the HAL. + * + * @param callback Handle to the GnssAntennaInfo callback interface. + */ + void setCallback(in IGnssAntennaInfoCallback callback); + + /** + * Stops updates from the HAL, and unregisters the callback routines. + * After a call to close(), the previously registered callbacks must be + * considered invalid by the HAL. + * If close() is invoked without a previous setCallback, this function must perform + * no work. + */ + void close(); +} diff --git a/gnss/aidl/android/hardware/gnss/IGnssAntennaInfoCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssAntennaInfoCallback.aidl new file mode 100644 index 0000000000..ef0a7fc6fd --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/IGnssAntennaInfoCallback.aidl @@ -0,0 +1,140 @@ +/* + * 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. + */ + +package android.hardware.gnss; + +/** + * The callback interface to report GNSS antenna information from the HAL. + */ +@VintfStability +interface IGnssAntennaInfoCallback { + /** + * A row of doubles. This is used to represent a row in a 2D array, which are used to + * characterize the phase center variation corrections and signal gain corrections. + */ + @VintfStability + parcelable Row { + double[] row; + } + + /** + * A point in 3D space, with associated uncertainty. + */ + @VintfStability + parcelable Coord { + double x; + + double xUncertainty; + + double y; + + double yUncertainty; + + double z; + + double zUncertainty; + } + + @VintfStability + parcelable GnssAntennaInfo { + /** + * The carrier frequency in Hz. + */ + long carrierFrequencyHz; + + /** + * Phase center offset (PCO) with associated 1-sigma uncertainty. PCO is defined with + * respect to the origin of the Android sensor coordinate system, e.g., center of primary + * screen for mobiles - see sensor or form factor documents for details. + */ + Coord phaseCenterOffsetCoordinateMillimeters; + + /** + * 2D vectors representing the phase center variation (PCV) corrections, in + * millimeters, at regularly spaced azimuthal angle (theta) and zenith angle + * (phi). The PCV correction is added to the phase measurement to obtain the + * corrected value. + * + * The azimuthal angle, theta, is defined with respect to the X axis of the + * Android sensor coordinate system, increasing toward the Y axis. The zenith + * angle, phi, is defined with respect to the Z axis of the Android Sensor + * coordinate system, increasing toward the X-Y plane. + * + * Each row vector (outer vectors) represents a fixed theta. The first row + * corresponds to a theta angle of 0 degrees. The last row corresponds to a + * theta angle of (360 - deltaTheta) degrees, where deltaTheta is the regular + * spacing between azimuthal angles, i.e., deltaTheta = 360 / (number of rows). + * + * The columns (inner vectors) represent fixed zenith angles, beginning at 0 + * degrees and ending at 180 degrees. They are separated by deltaPhi, the regular + * spacing between zenith angles, i.e., deltaPhi = 180 / (number of columns - 1). + * + * This field is optional, i.e., an empty vector. + */ + Row[] phaseCenterVariationCorrectionMillimeters; + + /** + * 2D vectors of 1-sigma uncertainty in millimeters associated with the PCV + * correction values. + * + * This field is optional, i.e., an empty vector. + */ + Row[] phaseCenterVariationCorrectionUncertaintyMillimeters; + + /** + * 2D vectors representing the signal gain corrections at regularly spaced + * azimuthal angle (theta) and zenith angle (phi). The values are calculated or + * measured at the antenna feed point without considering the radio and receiver + * noise figure and path loss contribution, in dBi, i.e., decibel over isotropic + * antenna with the same total power. The signal gain correction is added the + * signal gain measurement to obtain the corrected value. + * + * The azimuthal angle, theta, is defined with respect to the X axis of the + * Android sensor coordinate system, increasing toward the Y axis. The zenith + * angle, phi, is defined with respect to the Z axis of the Android Sensor + * coordinate system, increasing toward the X-Y plane. + * + * Each row vector (outer vectors) represents a fixed theta. The first row + * corresponds to a theta angle of 0 degrees. The last row corresponds to a + * theta angle of (360 - deltaTheta) degrees, where deltaTheta is the regular + * spacing between azimuthal angles, i.e., deltaTheta = 360 / (number of rows). + * + * The columns (inner vectors) represent fixed zenith angles, beginning at 0 + * degrees and ending at 180 degrees. They are separated by deltaPhi, the regular + * spacing between zenith angles, i.e., deltaPhi = 180 / (number of columns - 1). + * + * This field is optional, i.e., an empty vector. + */ + Row[] signalGainCorrectionDbi; + + /** + * 2D vectors of 1-sigma uncertainty in dBi associated with the signal + * gain correction values. + * + * This field is optional, i.e., an empty vector. + */ + Row[] signalGainCorrectionUncertaintyDbi; + } + + /** + * Called when on connection, and on known-change to these values, such as upon a known + * GNSS RF antenna tuning change, or a foldable device state change. + * + * This is optional. It can never be called if the GNSS antenna information is not + * available. + */ + void gnssAntennaInfoCb(in GnssAntennaInfo[] gnssAntennaInfos); +} diff --git a/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl index 157c912054..a74d097ad6 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl @@ -67,7 +67,7 @@ interface IGnssCallback { /** Capability bit mask indicating that GNSS supports measurement corrections */ const int CAPABILITY_MEASUREMENT_CORRECTIONS = 1 << 10; - /** Capability bit mask indicating that GNSS supports measurement corrections */ + /** Capability bit mask indicating that GNSS supports antenna info */ const int CAPABILITY_ANTENNA_INFO = 1 << 11; /** Capability bit mask indicating that GNSS supports correlation vector */ diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index 29c26d16ec..6168ad5f33 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -58,6 +58,7 @@ cc_binary { srcs: [ "AGnss.cpp", "Gnss.cpp", + "GnssAntennaInfo.cpp", "GnssBatching.cpp", "GnssDebug.cpp", "GnssGeofence.cpp", diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 657877898f..2c6df995f1 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -21,6 +21,7 @@ #include #include "AGnss.h" #include "DeviceFileReader.h" +#include "GnssAntennaInfo.h" #include "GnssBatching.h" #include "GnssConfiguration.h" #include "GnssDebug.h" @@ -56,7 +57,8 @@ ScopedAStatus Gnss::setCallback(const std::shared_ptr& callback) int capabilities = (int)(IGnssCallback::CAPABILITY_SATELLITE_BLOCKLIST | IGnssCallback::CAPABILITY_SATELLITE_PVT | - IGnssCallback::CAPABILITY_CORRELATION_VECTOR); + IGnssCallback::CAPABILITY_CORRELATION_VECTOR | + IGnssCallback::CAPABILITY_ANTENNA_INFO); auto status = sGnssCallback->gnssSetCapabilitiesCb(capabilities); if (!status.isOk()) { @@ -279,4 +281,12 @@ ndk::ScopedAStatus Gnss::getExtensionGnssVisibilityControl( return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Gnss::getExtensionGnssAntennaInfo( + std::shared_ptr* iGnssAntennaInfo) { + ALOGD("Gnss::getExtensionGnssAntennaInfo"); + + *iGnssAntennaInfo = SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index f21d756c24..b92f4fb9ba 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -69,6 +70,8 @@ class Gnss : public BnGnss { ndk::ScopedAStatus getExtensionGnssVisibilityControl( std::shared_ptr* iGnssVisibilityControl) override; + ndk::ScopedAStatus getExtensionGnssAntennaInfo( + std::shared_ptr* iGnssAntennaInfo) override; std::shared_ptr mGnssConfiguration; std::shared_ptr mGnssPowerIndication; diff --git a/gnss/aidl/default/GnssAntennaInfo.cpp b/gnss/aidl/default/GnssAntennaInfo.cpp new file mode 100644 index 0000000000..72def716de --- /dev/null +++ b/gnss/aidl/default/GnssAntennaInfo.cpp @@ -0,0 +1,149 @@ +/* + * 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. + */ + +#define LOG_TAG "GnssAntennaInfoAidl" + +#include "GnssAntennaInfo.h" +#include +#include +#include "Utils.h" + +namespace aidl::android::hardware::gnss { + +using namespace ::android::hardware::gnss; +using Row = IGnssAntennaInfoCallback::Row; +using Coord = IGnssAntennaInfoCallback::Coord; + +std::shared_ptr GnssAntennaInfo::sCallback = nullptr; + +GnssAntennaInfo::GnssAntennaInfo() : mMinIntervalMs(1000) {} + +GnssAntennaInfo::~GnssAntennaInfo() { + stop(); +} + +// Methods from ::android::hardware::gnss::V2_1::IGnssAntennaInfo follow. +ndk::ScopedAStatus GnssAntennaInfo::setCallback( + const std::shared_ptr& callback) { + ALOGD("setCallback"); + std::unique_lock lock(mMutex); + sCallback = callback; + + if (mIsActive) { + ALOGW("GnssAntennaInfo callback already set. Resetting the callback..."); + stop(); + } + start(); + + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus GnssAntennaInfo::close() { + ALOGD("close"); + stop(); + std::unique_lock lock(mMutex); + sCallback = nullptr; + return ndk::ScopedAStatus::ok(); +} + +void GnssAntennaInfo::start() { + ALOGD("start"); + mIsActive = true; + mThread = std::thread([this]() { + while (mIsActive == true) { + if (sCallback != nullptr) { + IGnssAntennaInfoCallback::GnssAntennaInfo mockAntennaInfo_1 = { + .carrierFrequencyHz = 1575420000, + .phaseCenterOffsetCoordinateMillimeters = Coord{.x = 1, + .xUncertainty = 0.1, + .y = 2, + .yUncertainty = 0.1, + .z = 3, + .zUncertainty = 0.1}, + .phaseCenterVariationCorrectionMillimeters = + { + Row{std::vector{1, -1, 5, -2, 3, -1}}, + Row{std::vector{-2, 3, 2, 0, 1, 2}}, + Row{std::vector{1, 3, 2, -1, -3, 5}}, + }, + .phaseCenterVariationCorrectionUncertaintyMillimeters = + { + Row{std::vector{0.1, 0.2, 0.4, 0.1, 0.2, 0.3}}, + Row{std::vector{0.3, 0.2, 0.3, 0.6, 0.1, 0.1}}, + Row{std::vector{0.1, 0.1, 0.4, 0.2, 0.5, 0.3}}, + }, + .signalGainCorrectionDbi = + { + Row{std::vector{2, -3, 1, -3, 0, -4}}, + Row{std::vector{1, 0, -4, 1, 3, -2}}, + Row{std::vector{3, -2, 0, -2, 3, 0}}, + }, + .signalGainCorrectionUncertaintyDbi = + { + Row{std::vector{0.3, 0.1, 0.2, 0.6, 0.1, 0.3}}, + Row{std::vector{0.1, 0.1, 0.5, 0.2, 0.3, 0.1}}, + Row{std::vector{0.2, 0.4, 0.2, 0.1, 0.1, 0.2}}, + }, + }; + + IGnssAntennaInfoCallback::GnssAntennaInfo mockAntennaInfo_2 = { + .carrierFrequencyHz = 1176450000, + .phaseCenterOffsetCoordinateMillimeters = Coord{.x = 5, + .xUncertainty = 0.1, + .y = 6, + .yUncertainty = 0.1, + .z = 7, + .zUncertainty = 0.1}, + }; + + std::vector mockAntennaInfos = { + mockAntennaInfo_1, + mockAntennaInfo_2, + }; + this->reportAntennaInfo(mockAntennaInfos); + } + + /** For mock implementation this is good. On real device, we should only report + antennaInfo at start and when there is a configuration change. **/ + std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMs)); + } + }); +} + +void GnssAntennaInfo::stop() { + ALOGD("stop"); + mIsActive = false; + if (mThread.joinable()) { + mThread.join(); + } +} + +void GnssAntennaInfo::reportAntennaInfo( + const std::vector& antennaInfo) const { + std::unique_lock lock(mMutex); + + if (sCallback == nullptr) { + ALOGE("%s: No non-null callback", __func__); + return; + } + + auto ret = sCallback->gnssAntennaInfoCb(antennaInfo); + if (!ret.isOk()) { + ALOGE("%s: Unable to invoke callback", __func__); + } +} + +} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/GnssAntennaInfo.h b/gnss/aidl/default/GnssAntennaInfo.h new file mode 100644 index 0000000000..2cf7b1366b --- /dev/null +++ b/gnss/aidl/default/GnssAntennaInfo.h @@ -0,0 +1,51 @@ +/* + * 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 +#include +#include +#include + +namespace aidl::android::hardware::gnss { + +struct GnssAntennaInfo : public BnGnssAntennaInfo { + public: + GnssAntennaInfo(); + ~GnssAntennaInfo(); + ndk::ScopedAStatus setCallback( + const std::shared_ptr& callback) override; + ndk::ScopedAStatus close() override; + + private: + void start(); + void stop(); + void reportAntennaInfo( + const std::vector& antennaInfo) const; + + // Guarded by mMutex + static std::shared_ptr sCallback; + + std::atomic mIsActive; + std::atomic mMinIntervalMs; + std::thread mThread; + + // Synchronization lock for sCallback + mutable std::mutex mMutex; +}; + +} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp index d532fad357..6045b0e38d 100644 --- a/gnss/aidl/vts/Android.bp +++ b/gnss/aidl/vts/Android.bp @@ -31,6 +31,7 @@ cc_test { "gnss_hal_test.cpp", "gnss_hal_test_cases.cpp", "AGnssCallbackAidl.cpp", + "GnssAntennaInfoCallbackAidl.cpp", "GnssBatchingCallback.cpp", "GnssCallbackAidl.cpp", "GnssGeofenceCallback.cpp", diff --git a/gnss/aidl/vts/GnssAntennaInfoCallbackAidl.cpp b/gnss/aidl/vts/GnssAntennaInfoCallbackAidl.cpp new file mode 100644 index 0000000000..11001cde89 --- /dev/null +++ b/gnss/aidl/vts/GnssAntennaInfoCallbackAidl.cpp @@ -0,0 +1,26 @@ +/* + * 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 "GnssAntennaInfoCallbackAidl.h" +#include +#include + +android::binder::Status GnssAntennaInfoCallbackAidl::gnssAntennaInfoCb( + const std::vector& gnssAntennaInfos) { + ALOGD("GnssAntennaInfo received. Size = %d", (int)gnssAntennaInfos.size()); + antenna_info_cbq_.store(gnssAntennaInfos); + return android::binder::Status::ok(); +} diff --git a/gnss/aidl/vts/GnssAntennaInfoCallbackAidl.h b/gnss/aidl/vts/GnssAntennaInfoCallbackAidl.h new file mode 100644 index 0000000000..77e105797a --- /dev/null +++ b/gnss/aidl/vts/GnssAntennaInfoCallbackAidl.h @@ -0,0 +1,36 @@ +/* + * 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 +#include +#include "GnssCallbackEventQueue.h" + +/** Implementation for IGnssAntennaInfoCallback. */ +class GnssAntennaInfoCallbackAidl : public android::hardware::gnss::BnGnssAntennaInfoCallback { + public: + GnssAntennaInfoCallbackAidl() : antenna_info_cbq_("info"){}; + ~GnssAntennaInfoCallbackAidl(){}; + + android::binder::Status gnssAntennaInfoCb( + const std::vector& gnssAntennaInfos) + override; + + android::hardware::gnss::common::GnssCallbackEventQueue< + std::vector> + antenna_info_cbq_; +}; diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index eec50b0a13..0d85ffe9c3 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -27,6 +28,7 @@ #include #include #include "AGnssCallbackAidl.h" +#include "GnssAntennaInfoCallbackAidl.h" #include "GnssBatchingCallback.h" #include "GnssGeofenceCallback.h" #include "GnssMeasurementCallbackAidl.h" @@ -44,6 +46,8 @@ using android::hardware::gnss::GnssMeasurement; using android::hardware::gnss::GnssPowerStats; using android::hardware::gnss::IAGnss; using android::hardware::gnss::IGnss; +using android::hardware::gnss::IGnssAntennaInfo; +using android::hardware::gnss::IGnssAntennaInfoCallback; using android::hardware::gnss::IGnssBatching; using android::hardware::gnss::IGnssBatchingCallback; using android::hardware::gnss::IGnssCallback; @@ -1009,3 +1013,84 @@ TEST_P(GnssHalTest, TestGnssAgcInGnssMeasurement) { status = iGnssMeasurement->close(); ASSERT_TRUE(status.isOk()); } + +/* + * TestGnssAntennaInfo: + * Sets a GnssAntennaInfoCallback, waits for report, and verifies + * 1. phaseCenterOffsetCoordinateMillimeters is valid + * 2. phaseCenterOffsetCoordinateUncertaintyMillimeters is valid. + * PhaseCenterVariationCorrections and SignalGainCorrections are optional. + */ +TEST_P(GnssHalTest, TestGnssAntennaInfo) { + const int kAntennaInfoTimeoutSeconds = 2; + + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + return; + } + + sp iGnssAntennaInfo; + auto status = aidl_gnss_hal_->getExtensionGnssAntennaInfo(&iGnssAntennaInfo); + ASSERT_TRUE(status.isOk()); + + if (!(aidl_gnss_cb_->last_capabilities_ & (int)GnssCallbackAidl::CAPABILITY_ANTENNA_INFO) || + iGnssAntennaInfo == nullptr) { + ALOGD("GnssAntennaInfo AIDL is not supported."); + return; + } + + auto callback = sp::make(); + status = iGnssAntennaInfo->setCallback(callback); + ASSERT_TRUE(status.isOk()); + + std::vector antennaInfos; + ASSERT_TRUE(callback->antenna_info_cbq_.retrieve(antennaInfos, kAntennaInfoTimeoutSeconds)); + EXPECT_EQ(callback->antenna_info_cbq_.calledCount(), 1); + ASSERT_TRUE(antennaInfos.size() > 0); + + for (auto antennaInfo : antennaInfos) { + // Remaining fields are optional + if (!antennaInfo.phaseCenterVariationCorrectionMillimeters.empty()) { + int numRows = antennaInfo.phaseCenterVariationCorrectionMillimeters.size(); + int numColumns = antennaInfo.phaseCenterVariationCorrectionMillimeters[0].row.size(); + // Must have at least 1 row and 2 columns + ASSERT_TRUE(numRows >= 1 && numColumns >= 2); + + // Corrections and uncertainties must have same dimensions + ASSERT_TRUE(antennaInfo.phaseCenterVariationCorrectionMillimeters.size() == + antennaInfo.phaseCenterVariationCorrectionUncertaintyMillimeters.size()); + ASSERT_TRUE( + antennaInfo.phaseCenterVariationCorrectionMillimeters[0].row.size() == + antennaInfo.phaseCenterVariationCorrectionUncertaintyMillimeters[0].row.size()); + + // Must be rectangular + for (auto row : antennaInfo.phaseCenterVariationCorrectionMillimeters) { + ASSERT_TRUE(row.row.size() == numColumns); + } + for (auto row : antennaInfo.phaseCenterVariationCorrectionUncertaintyMillimeters) { + ASSERT_TRUE(row.row.size() == numColumns); + } + } + if (!antennaInfo.signalGainCorrectionDbi.empty()) { + int numRows = antennaInfo.signalGainCorrectionDbi.size(); + int numColumns = antennaInfo.signalGainCorrectionUncertaintyDbi[0].row.size(); + // Must have at least 1 row and 2 columns + ASSERT_TRUE(numRows >= 1 && numColumns >= 2); + + // Corrections and uncertainties must have same dimensions + ASSERT_TRUE(antennaInfo.signalGainCorrectionDbi.size() == + antennaInfo.signalGainCorrectionUncertaintyDbi.size()); + ASSERT_TRUE(antennaInfo.signalGainCorrectionDbi[0].row.size() == + antennaInfo.signalGainCorrectionUncertaintyDbi[0].row.size()); + + // Must be rectangular + for (auto row : antennaInfo.signalGainCorrectionDbi) { + ASSERT_TRUE(row.row.size() == numColumns); + } + for (auto row : antennaInfo.signalGainCorrectionUncertaintyDbi) { + ASSERT_TRUE(row.row.size() == numColumns); + } + } + } + + iGnssAntennaInfo->close(); +} -- GitLab From 4c7b8f8fd93576daba32591c812206044b272480 Mon Sep 17 00:00:00 2001 From: Edwin Tung Date: Fri, 14 Jan 2022 17:32:04 +0800 Subject: [PATCH 440/825] Combining GnssVisibilityControl to gnss aidl_interface Bug: 208728105 Test: atest VtsHalGnssTargetTest Change-Id: I7295a59a93778a186727e2a22c9669770f021d1a --- gnss/aidl/Android.bp | 23 ++++--------------- .../IGnssVisibilityControl.aidl | 2 +- .../IGnssVisibilityControlCallback.aidl | 0 .../IGnssVisibilityControl.aidl | 2 +- gnss/aidl/default/Android.bp | 1 - gnss/aidl/vts/Android.bp | 1 - gnss/aidl/vts/gnss_hal_test_cases.cpp | 3 ++- 7 files changed, 8 insertions(+), 24 deletions(-) rename gnss/aidl/aidl_api/{android.hardware.gnss.visibility_control => android.hardware.gnss}/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl (96%) rename gnss/aidl/aidl_api/{android.hardware.gnss.visibility_control => android.hardware.gnss}/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl (100%) diff --git a/gnss/aidl/Android.bp b/gnss/aidl/Android.bp index 12dd0ac16e..d90cf0b634 100644 --- a/gnss/aidl/Android.bp +++ b/gnss/aidl/Android.bp @@ -23,28 +23,13 @@ package { default_applicable_licenses: ["hardware_interfaces_license"], } -aidl_interface { - name: "android.hardware.gnss.visibility_control", - vendor_available: true, - srcs: ["android/hardware/gnss/visibility_control/*.aidl"], - stability: "vintf", - backend: { - java: { - platform_apis: true, - }, - ndk: { - vndk: { - enabled: true, - }, - }, - }, -} - aidl_interface { name: "android.hardware.gnss", vendor_available: true, - srcs: ["android/hardware/gnss/*.aidl"], - imports: ["android.hardware.gnss.visibility_control"], + srcs: [ + "android/hardware/gnss/*.aidl", + "android/hardware/gnss/visibility_control/*.aidl", + ], stability: "vintf", backend: { java: { diff --git a/gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl similarity index 96% rename from gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl rename to gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl index 7ef08d2f52..f6740992c4 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl @@ -34,6 +34,6 @@ package android.hardware.gnss.visibility_control; @VintfStability interface IGnssVisibilityControl { - void enableNfwLocationAccess(in String[] proxyApps); + void enableNfwLocationAccess(in @utf8InCpp String[] proxyApps); void setCallback(in android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback callback); } diff --git a/gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl similarity index 100% rename from gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl rename to gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl diff --git a/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl b/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl index 93c3f2c94f..c9c15491fb 100644 --- a/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl +++ b/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl @@ -71,7 +71,7 @@ interface IGnssVisibilityControl { * The package name of the proxy Android application follows the standard Java language * package naming format. For example, com.example.myapp. */ - void enableNfwLocationAccess(in String[] proxyApps); + void enableNfwLocationAccess(in @utf8InCpp String[] proxyApps); /** * Registers the callback for HAL implementation to use. diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index 29c26d16ec..6d03279ea1 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -52,7 +52,6 @@ cc_binary { "android.hardware.gnss.measurement_corrections@1.1", "android.hardware.gnss.measurement_corrections@1.0", "android.hardware.gnss.visibility_control@1.0", - "android.hardware.gnss.visibility_control-V1-ndk", "android.hardware.gnss-V2-ndk", ], srcs: [ diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp index d532fad357..36497aa240 100644 --- a/gnss/aidl/vts/Android.bp +++ b/gnss/aidl/vts/Android.bp @@ -50,7 +50,6 @@ cc_test { static_libs: [ "android.hardware.gnss-V2-cpp", "android.hardware.gnss@common-vts-lib", - "android.hardware.gnss.visibility_control-V1-cpp", ], test_suites: [ "general-tests", diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index eec50b0a13..99d196debb 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -923,7 +923,8 @@ TEST_P(GnssHalTest, TestGnssVisibilityControlExtension) { status = iGnssVisibilityControl->setCallback(gnssVisibilityControlCallback); ASSERT_TRUE(status.isOk()); - std::vector proxyApps{String16("com.example.ims"), String16("com.example.mdt")}; + std::vector proxyApps{std::string("com.example.ims"), + std::string("com.example.mdt")}; status = iGnssVisibilityControl->enableNfwLocationAccess(proxyApps); ASSERT_TRUE(status.isOk()); } -- GitLab From 80189011cab43c93dab0d3dcd5beaefed1386a35 Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Sun, 10 Oct 2021 16:34:21 -0700 Subject: [PATCH 441/825] Add Stable AIDL version of EVS HAL This CL add a new set of EVS APIs written in Stable AIDL with an empty IEvsEnumerator implementation. Bug: 170401743 Bug: 195672428 Bug: 202031799 Bug: 202669715 Test: m -j Change-Id: I28ff4391ba51b72299ebfae801d21a8ab0e37917 --- automotive/evs/aidl/Android.bp | 51 + .../hardware/automotive/evs/BufferDesc.aidl | 43 + .../hardware/automotive/evs/CameraDesc.aidl | 40 + .../hardware/automotive/evs/CameraParam.aidl | 49 + .../hardware/automotive/evs/DeviceStatus.aidl | 39 + .../automotive/evs/DeviceStatusType.aidl | 41 + .../hardware/automotive/evs/DisplayDesc.aidl | 42 + .../hardware/automotive/evs/DisplayState.aidl | 42 + .../hardware/automotive/evs/EvsEventDesc.aidl | 40 + .../hardware/automotive/evs/EvsEventType.aidl | 44 + .../hardware/automotive/evs/EvsResult.aidl | 48 + .../hardware/automotive/evs/IEvsCamera.aidl | 55 + .../automotive/evs/IEvsCameraStream.aidl | 39 + .../hardware/automotive/evs/IEvsDisplay.aidl | 42 + .../automotive/evs/IEvsEnumerator.aidl | 50 + .../evs/IEvsEnumeratorStatusCallback.aidl | 38 + .../automotive/evs/IEvsUltrasonicsArray.aidl | 42 + .../evs/IEvsUltrasonicsArrayStream.aidl | 39 + .../automotive/evs/ParameterRange.aidl | 40 + .../hardware/automotive/evs/Rotation.aidl | 41 + .../automotive/evs/RotationQuaternion.aidl | 41 + .../hardware/automotive/evs/SensorPose.aidl | 39 + .../hardware/automotive/evs/Stream.aidl | 44 + .../hardware/automotive/evs/StreamType.aidl | 39 + .../hardware/automotive/evs/Translation.aidl | 40 + .../automotive/evs/UltrasonicSensor.aidl | 40 + .../automotive/evs/UltrasonicsArrayDesc.aidl | 41 + .../evs/UltrasonicsDataFrameDesc.aidl | 43 + .../hardware/automotive/evs/BufferDesc.aidl | 60 + .../hardware/automotive/evs/CameraDesc.aidl | 42 + .../hardware/automotive/evs/CameraParam.aidl | 75 + .../hardware/automotive/evs/DeviceStatus.aidl | 36 + .../automotive/evs/DeviceStatusType.aidl | 42 + .../hardware/automotive/evs/DisplayDesc.aidl | 53 + .../hardware/automotive/evs/DisplayState.aidl | 51 + .../hardware/automotive/evs/EvsEventDesc.aidl | 39 + .../hardware/automotive/evs/EvsEventType.aidl | 54 + .../hardware/automotive/evs/EvsResult.aidl | 66 + .../hardware/automotive/evs/IEvsCamera.aidl | 248 ++ .../automotive/evs/IEvsCameraStream.aidl | 53 + .../hardware/automotive/evs/IEvsDisplay.aidl | 94 + .../automotive/evs/IEvsEnumerator.aidl | 166 ++ .../evs/IEvsEnumeratorStatusCallback.aidl | 34 + .../automotive/evs/IEvsUltrasonicsArray.aidl | 79 + .../evs/IEvsUltrasonicsArrayStream.aidl | 41 + .../automotive/evs/ParameterRange.aidl | 36 + .../hardware/automotive/evs/Rotation.aidl | 36 + .../automotive/evs/RotationQuaternion.aidl | 29 + .../hardware/automotive/evs/SensorPose.aidl | 64 + .../hardware/automotive/evs/Stream.aidl | 75 + .../hardware/automotive/evs/StreamType.aidl | 41 + .../hardware/automotive/evs/Translation.aidl | 27 + .../automotive/evs/UltrasonicSensor.aidl | 41 + .../automotive/evs/UltrasonicsArrayDesc.aidl | 56 + .../evs/UltrasonicsDataFrameDesc.aidl | 82 + automotive/evs/aidl/impl/Android.bp | 39 + automotive/evs/aidl/impl/default/Android.bp | 36 + .../aidl/impl/default/evs-default-service.rc | 5 + .../aidl/impl/default/evs-default-service.xml | 11 + .../default/include/DefaultEvsEnumerator.h | 66 + .../impl/default/src/DefaultEvsEnumerator.cpp | 93 + .../evs/aidl/impl/default/src/service.cpp | 51 + automotive/evs/aidl/vts/Android.bp | 53 + automotive/evs/aidl/vts/FrameHandler.cpp | 358 +++ automotive/evs/aidl/vts/FrameHandler.h | 105 + .../evs/aidl/vts/FrameHandlerUltrasonics.cpp | 123 + .../evs/aidl/vts/FrameHandlerUltrasonics.h | 52 + automotive/evs/aidl/vts/OWNERS | 3 + .../evs/aidl/vts/VtsHalEvsTargetTest.cpp | 2170 +++++++++++++++++ .../compatibility_matrix.current.xml | 8 + 70 files changed, 6085 insertions(+) create mode 100644 automotive/evs/aidl/Android.bp create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/BufferDesc.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/CameraDesc.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/CameraParam.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DeviceStatus.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DeviceStatusType.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DisplayDesc.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DisplayState.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsEventDesc.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsEventType.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsResult.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsCamera.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsCameraStream.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsDisplay.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsUltrasonicsArray.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/ParameterRange.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Rotation.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/RotationQuaternion.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/SensorPose.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Stream.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/StreamType.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Translation.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/UltrasonicSensor.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/UltrasonicsArrayDesc.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/BufferDesc.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/CameraDesc.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/CameraParam.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/DeviceStatus.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/DeviceStatusType.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/DisplayDesc.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/DisplayState.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/EvsEventDesc.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/EvsEventType.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/EvsResult.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/IEvsCamera.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/IEvsCameraStream.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/IEvsDisplay.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/IEvsUltrasonicsArray.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/ParameterRange.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/Rotation.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/RotationQuaternion.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/SensorPose.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/Stream.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/StreamType.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/Translation.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/UltrasonicSensor.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/UltrasonicsArrayDesc.aidl create mode 100644 automotive/evs/aidl/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.aidl create mode 100644 automotive/evs/aidl/impl/Android.bp create mode 100644 automotive/evs/aidl/impl/default/Android.bp create mode 100644 automotive/evs/aidl/impl/default/evs-default-service.rc create mode 100644 automotive/evs/aidl/impl/default/evs-default-service.xml create mode 100644 automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h create mode 100644 automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp create mode 100644 automotive/evs/aidl/impl/default/src/service.cpp create mode 100644 automotive/evs/aidl/vts/Android.bp create mode 100644 automotive/evs/aidl/vts/FrameHandler.cpp create mode 100644 automotive/evs/aidl/vts/FrameHandler.h create mode 100644 automotive/evs/aidl/vts/FrameHandlerUltrasonics.cpp create mode 100644 automotive/evs/aidl/vts/FrameHandlerUltrasonics.h create mode 100644 automotive/evs/aidl/vts/OWNERS create mode 100644 automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp diff --git a/automotive/evs/aidl/Android.bp b/automotive/evs/aidl/Android.bp new file mode 100644 index 0000000000..3c0aa13f49 --- /dev/null +++ b/automotive/evs/aidl/Android.bp @@ -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. + +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.automotive.evs", + vendor_available: true, + srcs: [ + "android/hardware/automotive/evs/*.aidl" + ], + stability: "vintf", + imports: [ + "android.hardware.common-V2", + "android.hardware.graphics.common-V3", + ], + backend: { + java: { + // android.hardware.graphics.common package is not enabled + // for Java backend. + enabled: false, + }, + cpp: { + enabled: false, + }, + ndk: { + vndk: { + enabled: false, + }, + min_sdk_version: "29" + }, + }, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/BufferDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/BufferDesc.aidl new file mode 100644 index 0000000000..31acdb8e27 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/BufferDesc.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 -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.evs; +@VintfStability +parcelable BufferDesc { + android.hardware.graphics.common.HardwareBuffer buffer; + int pixelSizeBytes; + int bufferId; + @utf8InCpp String deviceId; + long timestamp; + byte[] metadata; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/CameraDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/CameraDesc.aidl new file mode 100644 index 0000000000..4dadeb88b2 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/CameraDesc.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 -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.evs; +@VintfStability +parcelable CameraDesc { + @utf8InCpp String id; + int vendorFlags; + byte[] metadata; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/CameraParam.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/CameraParam.aidl new file mode 100644 index 0000000000..ae4ce77192 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/CameraParam.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 -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.evs; +@Backing(type="int") @VintfStability +enum CameraParam { + BRIGHTNESS = 0, + CONTRAST = 1, + AUTOGAIN = 2, + GAIN = 3, + AUTO_WHITE_BALANCE = 4, + WHITE_BALANCE_TEMPERATURE = 5, + SHARPNESS = 6, + AUTO_EXPOSURE = 7, + ABSOLUTE_EXPOSURE = 8, + ABSOLUTE_FOCUS = 9, + AUTO_FOCUS = 10, + ABSOLUTE_ZOOM = 11, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DeviceStatus.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DeviceStatus.aidl new file mode 100644 index 0000000000..cc066ac6db --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DeviceStatus.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 -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.evs; +@VintfStability +parcelable DeviceStatus { + @utf8InCpp String id; + android.hardware.automotive.evs.DeviceStatusType status; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DeviceStatusType.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DeviceStatusType.aidl new file mode 100644 index 0000000000..d0f1d8e1d6 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DeviceStatusType.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 -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.evs; +@Backing(type="int") @VintfStability +enum DeviceStatusType { + CAMERA_AVAILABLE = 0, + CAMERA_NOT_AVAILABLE = 1, + DISPLAY_AVAILABLE = 2, + DISPLAY_NOT_AVAILABLE = 3, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DisplayDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DisplayDesc.aidl new file mode 100644 index 0000000000..4ac029e479 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DisplayDesc.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 -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.evs; +@VintfStability +parcelable DisplayDesc { + @utf8InCpp String id; + int width; + int height; + android.hardware.automotive.evs.Rotation orientation; + int vendorFlags; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DisplayState.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DisplayState.aidl new file mode 100644 index 0000000000..a5f43095c8 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/DisplayState.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 -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.evs; +@Backing(type="int") @VintfStability +enum DisplayState { + NOT_OPEN = 0, + NOT_VISIBLE = 1, + VISIBLE_ON_NEXT_FRAME = 2, + VISIBLE = 3, + DEAD = 4, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsEventDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsEventDesc.aidl new file mode 100644 index 0000000000..09b2b9db13 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsEventDesc.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 -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.evs; +@VintfStability +parcelable EvsEventDesc { + android.hardware.automotive.evs.EvsEventType aType; + @utf8InCpp String deviceId; + int[] payload; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsEventType.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsEventType.aidl new file mode 100644 index 0000000000..052a6b3969 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsEventType.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 -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.evs; +@Backing(type="int") @VintfStability +enum EvsEventType { + STREAM_STARTED = 0, + STREAM_STOPPED = 1, + FRAME_DROPPED = 2, + TIMEOUT = 3, + PARAMETER_CHANGED = 4, + MASTER_RELEASED = 5, + STREAM_ERROR = 6, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsResult.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsResult.aidl new file mode 100644 index 0000000000..a0418a94ef --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/EvsResult.aidl @@ -0,0 +1,48 @@ +/* + * 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 -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.evs; +@Backing(type="int") @VintfStability +enum EvsResult { + OK = 0, + INVALID_ARG = 1, + STREAM_ALREADY_RUNNING = 2, + BUFFER_NOT_AVAILABLE = 3, + OWNERSHIP_LOST = 4, + UNDERLYING_SERVICE_ERROR = 5, + PERMISSION_DENIED = 6, + RESOURCE_NOT_AVAILABLE = 7, + RESOURCE_BUSY = 8, + NOT_IMPLEMENTED = 9, + NOT_SUPPORTED = 10, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsCamera.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsCamera.aidl new file mode 100644 index 0000000000..ce1b97d16c --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsCamera.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 -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.evs; +@VintfStability +interface IEvsCamera { + void doneWithFrame(in android.hardware.automotive.evs.BufferDesc[] buffer); + void forcePrimaryClient(in android.hardware.automotive.evs.IEvsDisplay display); + android.hardware.automotive.evs.CameraDesc getCameraInfo(); + byte[] getExtendedInfo(in int opaqueIdentifier); + int[] getIntParameter(in android.hardware.automotive.evs.CameraParam id); + android.hardware.automotive.evs.ParameterRange getIntParameterRange(in android.hardware.automotive.evs.CameraParam id); + android.hardware.automotive.evs.CameraParam[] getParameterList(); + android.hardware.automotive.evs.CameraDesc getPhysicalCameraInfo(in String deviceId); + int importExternalBuffers(in android.hardware.automotive.evs.BufferDesc[] buffers); + void pauseVideoStream(); + void resumeVideoStream(); + void setExtendedInfo(in int opaqueIdentifier, in byte[] opaqueValue); + int[] setIntParameter(in android.hardware.automotive.evs.CameraParam id, in int value); + void setPrimaryClient(); + void setMaxFramesInFlight(in int bufferCount); + void startVideoStream(in android.hardware.automotive.evs.IEvsCameraStream receiver); + void stopVideoStream(); + void unsetPrimaryClient(); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsCameraStream.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsCameraStream.aidl new file mode 100644 index 0000000000..6e2e64a3c4 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsCameraStream.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 -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.evs; +@VintfStability +interface IEvsCameraStream { + oneway void deliverFrame(in android.hardware.automotive.evs.BufferDesc[] buffer); + oneway void notify(in android.hardware.automotive.evs.EvsEventDesc event); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsDisplay.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsDisplay.aidl new file mode 100644 index 0000000000..9b538d43a2 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsDisplay.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 -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.evs; +@VintfStability +interface IEvsDisplay { + android.hardware.automotive.evs.DisplayDesc getDisplayInfo(); + android.hardware.automotive.evs.DisplayState getDisplayState(); + android.hardware.automotive.evs.BufferDesc getTargetBuffer(); + void returnTargetBufferForDisplay(in android.hardware.automotive.evs.BufferDesc buffer); + void setDisplayState(in android.hardware.automotive.evs.DisplayState state); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl new file mode 100644 index 0000000000..a79c68d898 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.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 -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.evs; +@VintfStability +interface IEvsEnumerator { + void closeCamera(in android.hardware.automotive.evs.IEvsCamera carCamera); + void closeDisplay(in android.hardware.automotive.evs.IEvsDisplay display); + void closeUltrasonicsArray(in android.hardware.automotive.evs.IEvsUltrasonicsArray evsUltrasonicsArray); + android.hardware.automotive.evs.CameraDesc[] getCameraList(); + byte[] getDisplayIdList(); + android.hardware.automotive.evs.DisplayState getDisplayState(); + android.hardware.automotive.evs.Stream[] getStreamList(in android.hardware.automotive.evs.CameraDesc description); + android.hardware.automotive.evs.UltrasonicsArrayDesc[] getUltrasonicsArrayList(); + boolean isHardware(); + android.hardware.automotive.evs.IEvsCamera openCamera(in String cameraId, in android.hardware.automotive.evs.Stream streamCfg); + android.hardware.automotive.evs.IEvsDisplay openDisplay(in byte id); + android.hardware.automotive.evs.IEvsUltrasonicsArray openUltrasonicsArray(in String ultrasonicsArrayId); + void registerStatusCallback(in android.hardware.automotive.evs.IEvsEnumeratorStatusCallback callback); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.aidl new file mode 100644 index 0000000000..c39a4e855e --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.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 -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.evs; +@VintfStability +interface IEvsEnumeratorStatusCallback { + oneway void deviceStatusChanged(in android.hardware.automotive.evs.DeviceStatus[] status); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsUltrasonicsArray.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsUltrasonicsArray.aidl new file mode 100644 index 0000000000..1183ab392c --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsUltrasonicsArray.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 -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.evs; +@VintfStability +interface IEvsUltrasonicsArray { + void doneWithDataFrame(in android.hardware.automotive.evs.UltrasonicsDataFrameDesc dataFrameDesc); + android.hardware.automotive.evs.UltrasonicsArrayDesc getUltrasonicArrayInfo(); + void setMaxFramesInFlight(in int bufferCount); + void startStream(in android.hardware.automotive.evs.IEvsUltrasonicsArrayStream stream); + void stopStream(); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.aidl new file mode 100644 index 0000000000..510b0a4692 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.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 -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.evs; +@VintfStability +interface IEvsUltrasonicsArrayStream { + oneway void deliverDataFrame(in android.hardware.automotive.evs.UltrasonicsDataFrameDesc dataFrameDesc); + oneway void notify(in android.hardware.automotive.evs.EvsEventDesc event); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/ParameterRange.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/ParameterRange.aidl new file mode 100644 index 0000000000..44e9b59276 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/ParameterRange.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 -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.evs; +@VintfStability +parcelable ParameterRange { + int min; + int max; + int step; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Rotation.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Rotation.aidl new file mode 100644 index 0000000000..91971fc5e7 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Rotation.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 -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.evs; +@Backing(type="int") @VintfStability +enum Rotation { + ROTATION_0 = 0, + ROTATION_90 = 1, + ROTATION_180 = 2, + ROTATION_270 = 3, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/RotationQuaternion.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/RotationQuaternion.aidl new file mode 100644 index 0000000000..d9c8b6e247 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/RotationQuaternion.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 -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.evs; +@VintfStability +parcelable RotationQuaternion { + float x; + float y; + float z; + float w; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/SensorPose.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/SensorPose.aidl new file mode 100644 index 0000000000..4ead9eaf2e --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/SensorPose.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 -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.evs; +@VintfStability +parcelable SensorPose { + android.hardware.automotive.evs.RotationQuaternion rotation; + android.hardware.automotive.evs.Translation translation; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Stream.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Stream.aidl new file mode 100644 index 0000000000..a7804121b3 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Stream.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 -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.evs; +@VintfStability +parcelable Stream { + int id; + android.hardware.automotive.evs.StreamType streamType; + int width; + int height; + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.BufferUsage usage; + android.hardware.automotive.evs.Rotation rotation; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/StreamType.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/StreamType.aidl new file mode 100644 index 0000000000..9819c8910b --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/StreamType.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 -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.evs; +@Backing(type="int") @VintfStability +enum StreamType { + OUTPUT = 0, + INPUT = 1, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Translation.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Translation.aidl new file mode 100644 index 0000000000..488d80f479 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Translation.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 -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.evs; +@VintfStability +parcelable Translation { + float x; + float y; + float z; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/UltrasonicSensor.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/UltrasonicSensor.aidl new file mode 100644 index 0000000000..23f81f8093 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/UltrasonicSensor.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 -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.evs; +@VintfStability +parcelable UltrasonicSensor { + android.hardware.automotive.evs.SensorPose pose; + float maxRangeMm; + float angleOfMeasurement; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/UltrasonicsArrayDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/UltrasonicsArrayDesc.aidl new file mode 100644 index 0000000000..4a988759fd --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/UltrasonicsArrayDesc.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 -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.evs; +@VintfStability +parcelable UltrasonicsArrayDesc { + @utf8InCpp String ultrasonicsArrayId; + int maxReadingsPerSensorCount; + int maxReceiversCount; + android.hardware.automotive.evs.UltrasonicSensor[] sensors; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.aidl new file mode 100644 index 0000000000..35ec84bdcc --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.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 -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.evs; +@VintfStability +parcelable UltrasonicsDataFrameDesc { + long timestampNs; + int id; + byte[] transmittersIdList; + byte[] receiversIdList; + int[] receiversReadingsCountList; + android.hardware.common.Ashmem waveformsData; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/BufferDesc.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/BufferDesc.aidl new file mode 100644 index 0000000000..0604abe1dc --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/BufferDesc.aidl @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +import android.hardware.graphics.common.HardwareBuffer; + +/** + * Structure representing an image buffer through our APIs + * + * In addition to the handle to the graphics memory, we need to retain + * the properties of the buffer for easy reference and reconstruction of + * an ANativeWindowBuffer object on the remote side of API calls. + * (Not least because OpenGL expect an ANativeWindowBuffer* for us as a + * texture via eglCreateImageKHR()). + */ +@VintfStability +parcelable BufferDesc { + /** + * Stable AIDL counter part of AHardwareBuffer. Please see + * hardware/interfaces/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl + * for more details. + */ + HardwareBuffer buffer; + /** + * The size of a pixel in the units of bytes. + */ + int pixelSizeBytes; + /** + * Opaque value from driver + */ + int bufferId; + /** + * Unique identifier of the physical camera device that produces this buffer. + */ + @utf8InCpp + String deviceId; + /** + * Time that this buffer is being filled in the units of microseconds and must be + * obtained from android::elapsedRealtimeNanos() or its equivalents. + */ + long timestamp; + /** + * Frame metadata. This is opaque to EvsManager. + */ + byte[] metadata; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/CameraDesc.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/CameraDesc.aidl new file mode 100644 index 0000000000..2f500a73c5 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/CameraDesc.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. + */ + +package android.hardware.automotive.evs; + +/** + * Structure describing the basic properties of an EVS camera. + * + * The HAL is responsible for filling out this structure for each + * EVS camera in the system. + */ +@VintfStability +parcelable CameraDesc { + /** + * Unique identifier for camera devices. This may be a path to detected + * camera device; for example, "/dev/video0". + */ + @utf8InCpp + String id; + /** + * Opaque value from driver. Vendor may use this field to store additional + * information; for example, sensor and bridge chip id. + */ + int vendorFlags; + /** + * Store camera metadata such as lens characteristics. + */ + byte[] metadata; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/CameraParam.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/CameraParam.aidl new file mode 100644 index 0000000000..15500b2def --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/CameraParam.aidl @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +/** + * EVS camera parameter + */ +@VintfStability +@Backing(type="int") +enum CameraParam { + /** + * The brightness of image frames + */ + BRIGHTNESS, + /** + * The contrast of image frames + */ + CONTRAST, + /** + * Automatic gain/exposure control + */ + AUTOGAIN, + /** + * Gain control + */ + GAIN, + /** + * Automatic Whitebalance + */ + AUTO_WHITE_BALANCE, + /** + * Manual white balance setting as a color temperature in Kelvin. + */ + WHITE_BALANCE_TEMPERATURE, + /** + * Image sharpness adjustment + */ + SHARPNESS, + /** + * Auto Exposure Control modes; auto, manual, shutter priority, or + * aperture priority. + */ + AUTO_EXPOSURE, + /** + * Manual exposure time of the camera + */ + ABSOLUTE_EXPOSURE, + /** + * Sets the focal point of the camera to the specified position. This + * parameter may not be effective when auto focus is enabled. + */ + ABSOLUTE_FOCUS, + /** + * Enables continuous automatic focus adjustments. + */ + AUTO_FOCUS, + /** + * Specifies the objective lens focal length as an absolute value. + */ + ABSOLUTE_ZOOM, +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/DeviceStatus.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/DeviceStatus.aidl new file mode 100644 index 0000000000..535ace30ac --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/DeviceStatus.aidl @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.DeviceStatusType; + +/** + * The status of the devices, as sent by EVS HAL through the + * IEvsEnumeratorCallback::deviceStatusChanged() call. + */ +@VintfStability +parcelable DeviceStatus { + /** + * The identifier of a device that has transitioned to a new status. + */ + @utf8InCpp + String id; + /** + * A new status of this device + */ + DeviceStatusType status; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/DeviceStatusType.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/DeviceStatusType.aidl new file mode 100644 index 0000000000..902b31b15e --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/DeviceStatusType.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. + */ + +package android.hardware.automotive.evs; + +/** + * The status of the devices available through the EVS + */ +@VintfStability +@Backing(type="int") +enum DeviceStatusType { + /** + * A camera device is available and ready to be used. + */ + CAMERA_AVAILABLE, + /** + * A camera device is not available; e.g. disconnected from the system. + */ + CAMERA_NOT_AVAILABLE, + /** + * A display device is available and ready to be used. + */ + DISPLAY_AVAILABLE, + /** + * A display device is not available; e.g. disconnected from the + * system. + */ + DISPLAY_NOT_AVAILABLE, +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/DisplayDesc.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/DisplayDesc.aidl new file mode 100644 index 0000000000..0b4243b8d9 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/DisplayDesc.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.Rotation; + +/** + * Structure describing the basic properties of an EVS display + * + * The HAL is responsible for filling out this structure to describe + * the EVS display. As an implementation detail, this may be a physical + * display or a virtual display that is overlaid or mixed with another + * presentation device. + */ +@VintfStability +parcelable DisplayDesc { + /** + * Unique identifier for the display + */ + @utf8InCpp + String id; + /** + * The width of the display + */ + int width; + /** + * The height of the display + */ + int height; + /** + * Counterclock-wise orientation of the display + */ + Rotation orientation; + /** + * Opaque value from driver. Vendor may use this field to store additional + * information; for example, sensor and bridge chip id. + */ + int vendorFlags; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/DisplayState.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/DisplayState.aidl new file mode 100644 index 0000000000..c242d2fb7d --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/DisplayState.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. + */ + +package android.hardware.automotive.evs; + +/** + * States for control of the EVS display + * + * The DisplayInfo structure describes the basic properties of an EVS display. Any EVS + * implementation is required to have one. The HAL is responsible for filling out this + * structure to describe the EVS display. As an implementation detail, this may be a + * physical display or a virtual display that is overlaid or mixed with another + * presentation device. + */ +@VintfStability +@Backing(type="int") +enum DisplayState { + /* + * Display has not been requested by any application yet + */ + NOT_OPEN = 0, + /* + * Display is inhibited + */ + NOT_VISIBLE, + /* + * Will become visible with next frame + */ + VISIBLE_ON_NEXT_FRAME, + /* + * Display is currently active + */ + VISIBLE, + /* + * Driver is in an undefined state. Interface should be closed. + */ + DEAD, +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/EvsEventDesc.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/EvsEventDesc.aidl new file mode 100644 index 0000000000..ebff98f077 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/EvsEventDesc.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. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.EvsEventType; + +/** + * Structure that describes informative events occurred during EVS is streaming + */ +@VintfStability +parcelable EvsEventDesc { + /** + * Type of an informative event + */ + EvsEventType aType; + /** + * Device identifier + */ + @utf8InCpp + String deviceId; + /** + * Possible additional vendor information that is opaque to the EvsManager + */ + int[] payload; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/EvsEventType.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/EvsEventType.aidl new file mode 100644 index 0000000000..3a493af61b --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/EvsEventType.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. + */ + +package android.hardware.automotive.evs; + +/** + * Types of informative streaming events + */ +@VintfStability +@Backing(type="int") +enum EvsEventType { + /** + * Video stream is started + */ + STREAM_STARTED = 0, + /** + * Video stream is stopped + */ + STREAM_STOPPED, + /** + * Video frame is dropped + */ + FRAME_DROPPED, + /** + * Timeout happens + */ + TIMEOUT, + /** + * Camera parameter is changed; payload contains a changed parameter ID and + * its value + */ + PARAMETER_CHANGED, + /** + * Master role has become available + */ + MASTER_RELEASED, + /** + * Any other erroneous streaming events + */ + STREAM_ERROR, +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/EvsResult.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/EvsResult.aidl new file mode 100644 index 0000000000..c355be35c2 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/EvsResult.aidl @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +/** + * Error codes used in EVS HAL interface. + */ +@VintfStability +@Backing(type="int") +enum EvsResult { + OK = 0, + /** + * Given arguments are invalid + */ + INVALID_ARG, + /** + * Requested stream is already running + */ + STREAM_ALREADY_RUNNING, + /** + * Buffer is not available; e.g. failed to allocate + */ + BUFFER_NOT_AVAILABLE, + /** + * Ownership has been expired or stolen by other clients + */ + OWNERSHIP_LOST, + /** + * A dependent service fails to handle a request + */ + UNDERLYING_SERVICE_ERROR, + /** + * Permission denied + */ + PERMISSION_DENIED, + /** + * Either the camera or the display is not available + */ + RESOURCE_NOT_AVAILABLE, + /** + * Device or resource busy + */ + RESOURCE_BUSY, + /** + * A method is not implemented yet + */ + NOT_IMPLEMENTED, + /** + * Requested functionality is not supported + */ + NOT_SUPPORTED, +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/IEvsCamera.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsCamera.aidl new file mode 100644 index 0000000000..080dd75247 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsCamera.aidl @@ -0,0 +1,248 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.BufferDesc; +import android.hardware.automotive.evs.CameraDesc; +import android.hardware.automotive.evs.CameraParam; +import android.hardware.automotive.evs.IEvsCameraStream; +import android.hardware.automotive.evs.IEvsDisplay; +import android.hardware.automotive.evs.ParameterRange; + +/** + * Represents a single camera and is the primary interface for capturing images. + */ +@VintfStability +interface IEvsCamera { + /** + * Returns frames that were delivered to the IEvsCameraStream. + * + * When done consuming a frame delivered to the IEvsCameraStream + * interface, it must be returned to the IEvsCamera for reuse. + * A small, finite number of buffers are available (possibly as small + * as one), and if the supply is exhausted, no further frames may be + * delivered until a buffer is returned. + * + * @param in buffer Buffers to be returned. + */ + void doneWithFrame(in BufferDesc[] buffer); + + /** + * Sets to be the primary client forcibly. + * + * The client, which owns the display, has a high priority and can take over + * a primary client role from other clients without the display. + * + * @param in display IEvsDisplay handle. If a given display is in either + * NOT_VISIBLE, VISIBLE_ON_NEXT_FRAME, or VISIBLE state, the + * calling client is considered as the high priority client + * and therefore allowed to take over a primary client role from + * existing primary client. + * @throws EvsResult::INVALID_ARG if a given display handle is null or invalid states. + */ + void forcePrimaryClient(in IEvsDisplay display); + + /** + * Returns the description of this camera. + * + * @return The description of this camera. This must be the same value as + * reported by IEvsEnumerator::getCameraList(). + */ + CameraDesc getCameraInfo(); + + /** + * Request driver specific information from the HAL implementation. + * + * The values allowed for opaqueIdentifier are driver specific, + * but no value passed in may crash the driver. + * + * @param in opaqueIdentifier An unique identifier of the information to + * request. + * @return Requested information. Zero-size vector is returned if the driver does + * not recognize a given identifier. + * @throws EvsResult::INVALID_ARG for any unrecognized opaqueIdentifier. + */ + byte[] getExtendedInfo(in int opaqueIdentifier); + + /** + * Retrieves values of given camera parameter. The driver must report + * EvsResult::INVALID_ARG if a request parameter is not supported. + * + * @param in id The identifier of camera parameter, CameraParam enum. + * @return Values of requested camera parameter, the same number of values as + * backing camera devices. + * @throws EvsResult::INVALID_ARG for any unrecognized parameter. + * EvsResult::UNDERLYING_SERVICE_ERROR for any other failures. + */ + int[] getIntParameter(in CameraParam id); + + /** + * Requests a valid value range of a camera parameter + * + * @param in id The identifier of camera parameter, CameraParam enum. + * @return ParameterRange of a requested CameraParam + */ + ParameterRange getIntParameterRange(in CameraParam id); + + /** + * Retrieves a list of parameters this camera supports. + * + * @return A list of CameraParam that this camera supports. + */ + CameraParam[] getParameterList(); + + /** + * Returns the description of the physical camera device that backs this + * logical camera. + * + * If a requested device does not either exist or back this logical device, + * this method returns a null camera descriptor. And, if this is called on + * a physical camera device, this method is the same as getCameraInfo() + * method if a given device ID is matched. Otherwise, this will return a + * null camera descriptor. + * + * @param in deviceId Physical camera device identifier string. + * @return The description of a member physical camera device. + * This must be the same value as reported by IEvsEnumerator::getCameraList(). + */ + CameraDesc getPhysicalCameraInfo(in String deviceId); + + /** + * Import external buffers to capture frames + * + * This API must be called with a physical camera device identifier. + * + * @param in buffers A list of buffers allocated by the caller. EvsCamera + * will use these buffers to capture frames, in addition to + * other buffers already in its buffer pool. + * @return The amount of buffer pool size changes after importing given buffers. + */ + int importExternalBuffers(in BufferDesc[] buffers); + + /** + * Requests to pause EVS camera stream events. + * + * Like stopVideoStream(), events may continue to arrive for some time + * after this call returns. Delivered frame buffers must be returned. + */ + void pauseVideoStream(); + + /** + * Requests to resume EVS camera stream. + */ + void resumeVideoStream(); + + /** + * Send a driver specific value to the HAL implementation. + * + * This extension is provided to facilitate car specific + * extensions, but no HAL implementation may require this call + * in order to function in a default state. + * INVALID_ARG is returned if the opaqueValue is not meaningful to + * the driver implementation. + * + * @param in opaqueIdentifier An unique identifier of the information to + * program. + * in opaqueValue A value to program. + * @throws EvsResult::INVALID_ARG if this call fails to set a parameter. + */ + void setExtendedInfo(in int opaqueIdentifier, in byte[] opaqueValue); + + /** + * Requests to set a camera parameter. + * + * Only a request from the primary client will be processed successfully. + * When this method is called on a logical camera device, it will be forwarded + * to each physical device and, if it fails to program any physical device, + * it will return an error code with the same number of effective values as + * the number of backing camera devices. + * + * @param in id The identifier of camera parameter, CameraParam enum. + * @param in value A desired parameter value. + * @return Programmed parameter values. This may differ from what the client + * gives if, for example, the driver does not support a target parameter. + * @throws EvsResult::INVALID_ARG if either the request is not made by the primary + * client, or a requested parameter is not supported. + * EvsResult::UNDERLYING_SERVICE_ERROR if it fails to program a value by any + * other reason. + */ + int[] setIntParameter(in CameraParam id, in int value); + + /** + * Requests to be the primary client. + * + * When multiple clients subscribe to a single camera hardware and one of + * them adjusts a camera parameter such as the contrast, it may disturb + * other clients' operations. Therefore, the client must call this method + * to be a primary client. Once it becomes a primary client, it will be able to + * change camera parameters until either it dies or explicitly gives up the + * role. + * + * @throws EvsResult::OWNERSHIP_LOST if there is already the primary client. + */ + void setPrimaryClient(); + + /** + * Specifies the depth of the buffer chain the camera is asked to support. + * + * Up to this many frames may be held concurrently by the client of IEvsCamera. + * If this many frames have been delivered to the receiver without being returned + * by doneWithFrame, the stream must skip frames until a buffer is returned for reuse. + * It is legal for this call to come at any time, even while streams are already running, + * in which case buffers should be added or removed from the chain as appropriate. + * If no call is made to this entry point, the IEvsCamera must support at least one + * frame by default. More is acceptable. + * + * @param in bufferCount Number of buffers the client of IEvsCamera may hold concurrently. + * @throws EvsResult::BUFFER_NOT_AVAILABLE if the client cannot increase the max frames. + * EvsResult::INVALID_ARG if the client cannot decrease the max frames. + * EvsResult::OWNERSHIP_LOST if we lost an ownership of a target camera. + */ + void setMaxFramesInFlight(in int bufferCount); + + /** + * Request to start EVS camera stream from this camera. + * + * The IEvsCameraStream must begin receiving calls with various events + * including new image frame ready until stopVideoStream() is called. + * + * @param in receiver IEvsCameraStream implementation. + * @throws EvsResult::OWNERSHIP_LOST if we lost an ownership of a target camera. + * EvsResult::STREAM_ALREADY_RUNNING if a video stream has been started already. + * EvsResult::BUFFER_NOT_AVAILABLE if it fails to secure a minimum number of + * buffers to run a video stream. + * EvsResult::UNDERLYING_SERVICE_ERROR for all other failures. + */ + void startVideoStream(in IEvsCameraStream receiver); + + /** + * Stop the delivery of EVS camera frames. + * + * Because delivery is asynchronous, frames may continue to arrive for + * some time after this call returns. Each must be returned until the + * closure of the stream is signaled to the IEvsCameraStream. + * This function cannot fail and is simply ignored if the stream isn't running. + */ + void stopVideoStream(); + + /** + * Retires from the primary client role. + * + * @throws EvsResult::INVALID_ARG if the caller client is not a primary client. + */ + void unsetPrimaryClient(); +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/IEvsCameraStream.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsCameraStream.aidl new file mode 100644 index 0000000000..2c2b44caf5 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsCameraStream.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.BufferDesc; +import android.hardware.automotive.evs.EvsEventDesc; +import android.hardware.graphics.common.HardwareBuffer; + +/** + * Implemented on client side to receive asynchronous streaming event deliveries. + */ +@VintfStability +oneway interface IEvsCameraStream { + /** + * Receives calls from the HAL each time video frames is ready for inspection. + * Buffer handles received by this method must be returned via calls to + * IEvsCamera::doneWithFrame(). When the video stream is stopped via a call + * to IEvsCamera::stopVideoStream(), this callback may continue to happen for + * some time as the pipeline drains. Each frame must still be returned. + * When the last frame in the stream has been delivered, STREAM_STOPPED + * event must be delivered. No further frame deliveries may happen + * thereafter. + * + * A camera device will deliver the same number of frames as number of + * backing physical camera devices; it means, a physical camera device + * sends always a single frame and a logical camera device sends multiple + * frames as many as number of backing physical camera devices. + * + * @param in buffer Buffer descriptors of delivered image frames. + */ + void deliverFrame(in BufferDesc[] buffer); + + /** + * Receives calls from the HAL each time an event happens. + * + * @param in event EVS event with possible event information. + */ + void notify(in EvsEventDesc event); +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/IEvsDisplay.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsDisplay.aidl new file mode 100644 index 0000000000..8d57014df5 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsDisplay.aidl @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.BufferDesc; +import android.hardware.automotive.evs.DisplayDesc; +import android.hardware.automotive.evs.DisplayState; + +/** + * Represents a single display. + */ +@VintfStability +interface IEvsDisplay { + /** + * Returns the description of this display. + * + * @return The information of this display including id, current mode, current state, + * and additional vendor-specific information. + * @throws EvsResult::UNDERLYING_SERVICE_ERROR if it fails to read a display information. + */ + DisplayDesc getDisplayInfo(); + + /** + * This call requests the current state of the display + * + * The HAL implementation should report the actual current state, which might + * transiently differ from the most recently requested state. Note, however, that + * the logic responsible for changing display states should generally live above + * the device layer, making it undesirable for the HAL implementation to spontaneously + * change display states. + * + * @return Current DisplayState of this Display. + */ + DisplayState getDisplayState(); + + /** + * This call returns a handle to a frame buffer associated with the display. + * + * @return A handle to a frame buffer. The returned buffer may be locked and + * written to by software and/or GL. This buffer must be returned via + * a call to returnTargetBufferForDisplay() even if the display is no + * longer visible. + * @throws EvsResult::OWNERSHIP_LOST if a display is in DisplayState::DEAD. + * EvsResult::BUFFER_NOT_AVAILABLE if no buffer is available. + * EvsResult::UNDERLYING_SERVICE_ERROR for any other failures. + */ + BufferDesc getTargetBuffer(); + + /** + * This call tells the display that the buffer is ready for display. + * + * The buffer is no longer valid for use by the client after this call. + * There is no maximum time the caller may hold onto the buffer before making this + * call. The buffer may be returned at any time and in any DisplayState, but all + * buffers are expected to be returned before the IEvsDisplay interface is destroyed. + * + * @param in buffer A buffer handle to the frame that is ready for display. + * @throws EvsResult::INVALID_ARG if a given buffer is unknown or invalid. + * EvsResult::OWNERSHIP_LOST if a display is in DisplayState::DEAD. + * EvsResult::UNDERLYING_SERVICE_ERROR for any other failures. + */ + void returnTargetBufferForDisplay(in BufferDesc buffer); + + /** + * Clients may set the display state to express their desired state. + * + * The HAL implementation must gracefully accept a request for any state while in + * any other state, although the response may be to defer or ignore the request. The display + * is defined to start in the NOT_VISIBLE state upon initialization. The client is + * then expected to request the VISIBLE_ON_NEXT_FRAME state, and then begin providing + * video. When the display is no longer required, the client is expected to request + * the NOT_VISIBLE state after passing the last video frame. + * Returns INVALID_ARG if the requested state is not a recognized value. + * + * @param in state Desired new DisplayState. + * @throws EvsResult::INVALID_ARG if a given state is invalid. + * EvsResult::OWNERSHIP_LOST if a display is in DisplayState::DEAD. + */ + void setDisplayState(in DisplayState state); +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl new file mode 100644 index 0000000000..8e380e0bd4 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.CameraDesc; +import android.hardware.automotive.evs.DisplayState; +import android.hardware.automotive.evs.IEvsCamera; +import android.hardware.automotive.evs.IEvsDisplay; +import android.hardware.automotive.evs.IEvsEnumeratorStatusCallback; +import android.hardware.automotive.evs.IEvsUltrasonicsArray; +import android.hardware.automotive.evs.Stream; +import android.hardware.automotive.evs.UltrasonicsArrayDesc; + +/** + * Provides the mechanism for EVS camera and ultrasonics array discovery + */ +@VintfStability +interface IEvsEnumerator { + /** + * Return the specified IEvsCamera interface as no longer in use + * + * When the IEvsCamera object is no longer required, it must be released. + * NOTE: Video streaming must be cleanly stopped before making this call. + * + * @param in carCamera EvsCamera object to be closed. + * @throws EvsResult::INVALID_ARG if a given camera object is invalid. + */ + void closeCamera(in IEvsCamera carCamera); + + /** + * Return the specified IEvsDisplay interface as no longer in use + * + * When the IEvsDisplay object is no longer required, it must be released. + * NOTE: All buffers must have been returned to the display before making this call. + * + * @param in display EvsDisplay object to be closed. + */ + void closeDisplay(in IEvsDisplay display); + + /** + * Return the specified IEvsUltrasonicsArray interface as no longer in use + * + * When the IEvsUltrasonicsArray object is no longer required, it must be released. + * NOTE: Data streaming must be cleanly stopped before making this call. + * + * @param in evsUltrasonicsArray EvsUltrasonics array object to be closed. + */ + void closeUltrasonicsArray(in IEvsUltrasonicsArray evsUltrasonicsArray); + + /** + * Returns a list of all EVS cameras available to the system + * + * @return A list of cameras availale for EVS service. + * @throws EvsResult::PERMISSION_DENIED if the process is not permitted to enumerate + * camera devices. + */ + CameraDesc[] getCameraList(); + + /** + * Returns a list of all EVS displays available to the system + * + * @return Identifiers of available displays. + */ + byte[] getDisplayIdList(); + + /** + * This call requests the current state of the display + * + * If there is no open display, this returns DisplayState::NOT_OPEN. otherwise, it returns + * the actual state of the active display. This call is replicated on the IEvsEnumerator + * interface in order to allow secondary clients to monitor the state of the EVS display + * without acquiring exclusive ownership of the display. + * + * @return Current DisplayState of this Display. + * @throws EvsResult::OWNERSHIP_LOST if current display is inactive + * EvsResult::PERMISSION_DENIED if the process is not permitted to do this operation. + */ + DisplayState getDisplayState(); + + /** + * Return a list of the stream configurations a target camera device supports + * + * @param in description A target camera descriptor + * @return A list of stream configurations supported by a given camera device + */ + Stream[] getStreamList(in CameraDesc description); + + /** + * Returns a list of all ultrasonics array available to the system. + * Will return an empty vector if ultrasonics is not supported. + * + * @return A list of ultrasonics available for EVS service. + */ + UltrasonicsArrayDesc[] getUltrasonicsArrayList(); + + /** + * Tells whether this is EvsManager or HAL implementation. + * + * @return False for EvsManager implementations and true for all others. + */ + boolean isHardware(); + + /** + * Gets the IEvsCamera associated with a cameraId from a CameraDesc + * + * Given a camera's unique cameraId from CameraDesc, returns the + * IEvsCamera interface associated with the specified camera. When + * done using the camera, the caller may release it by calling closeCamera(). + * + * @param in cameraId A unique identifier of the camera. + * @param in streamCfg A stream configuration the client wants to use. + * @return EvsCamera object associated with a given cameraId. + * Returned object would be null if a camera device does not support a + * given stream configuration or is already configured differently by + * another client. + * @throws EvsResult::PERMISSION_DENIED if the process is not permitted to use camera + * devices. + * EveResult::INVALID_ARG if it fails to open a camera with a given id. + */ + IEvsCamera openCamera(in String cameraId, in Stream streamCfg); + + /** + * Get exclusive access to IEvsDisplay for the system + * + * There can be more than one EVS display objects for the system and this function + * requests access to the display identified by a given ID. If the target EVS display + * is not available or is already in use the old instance shall be closed and give + * the new caller exclusive access. + * When done using the display, the caller may release it by calling closeDisplay(). + * + * @param in id Target display identifier. + * @return EvsDisplay object to be used. + * @throws EvsResult::INVALID_ARG if no display with a given id exists + */ + IEvsDisplay openDisplay(in byte id); + + /** + * Gets the IEvsUltrasonicsArray associated with a ultrasonicsArrayId from a + * UltrasonicsDataDesc + * + * @param in ultrasonicsArrayId A unique identifier of the ultrasonic array. + * @return IEvsUltrasonicsArray object associated with a given ultrasonicsArrayId. + */ + IEvsUltrasonicsArray openUltrasonicsArray(in String ultrasonicsArrayId); + + /** + * Registers a callback to listen to devices' status changes + * + * @param in callback IEvsEnumeratorStatusCallback implementation + */ + void registerStatusCallback(in IEvsEnumeratorStatusCallback callback); +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.aidl new file mode 100644 index 0000000000..26ccf72f08 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.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. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.DeviceStatus; + +/** + * Implemented on client side to receive asynchronous notifications from + * IEvsEnumreator. + */ +@VintfStability +oneway interface IEvsEnumeratorStatusCallback { + /** + * Receives calls from the HAL each time a status of camera devices is + * changed. + * + * @param in status A list of newly updated device status + */ + void deviceStatusChanged(in DeviceStatus[] status); +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/IEvsUltrasonicsArray.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsUltrasonicsArray.aidl new file mode 100644 index 0000000000..40de313abf --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsUltrasonicsArray.aidl @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.IEvsUltrasonicsArrayStream; +import android.hardware.automotive.evs.UltrasonicsArrayDesc; +import android.hardware.automotive.evs.UltrasonicsDataFrameDesc; + +/** + * HAL interface for ultrasonics sensor array. + */ +@VintfStability +interface IEvsUltrasonicsArray { + /** + * Notifies the UltrasonicsDataDesc is consumed that was received from + * IEvsUltrasonicsArrayStream + * + * @param in dataFrameDesc Ultrasonics data descriptor + */ + void doneWithDataFrame(in UltrasonicsDataFrameDesc dataFrameDesc); + + /** + * Returns the ultrasonic sensor array information + * + * @throws The description of this ultrasonic array. This must be the same + * value as reported by IEvsEnumerator::getUltrasonicsArrayList(). + */ + UltrasonicsArrayDesc getUltrasonicArrayInfo(); + + /** + * Specifies the depth of the buffer chain the ultrasonic sensors is + * asked to support + * + * Up to this many data frames may be held concurrently by the client of IEvsUltrasonicsArray. + * If this many frames have been delivered to the receiver without being returned + * by doneWithFrame, the stream must skip frames until a buffer is returned for reuse. + * It is legal for this call to come at any time, even while streams are already running, + * in which case buffers should be added or removed from the chain as appropriate. + * If no call is made to this entry point, the IEvsUltrasonicsArray must support at least one + * data frame by default. More is acceptable. + * + * @param in bufferCount Number of buffers the client of IEvsUltrasonicsArray may hold + * concurrently. + * @throws EvsResult::INVALID_ARG on invalid bufferCount. + */ + void setMaxFramesInFlight(in int bufferCount); + + /** + * Requests to start the stream + * + * @param in stream Implementation of IEvsUltrasonicsArrayStream. + * @throws EvsResult::STREAM_ALREADY_RUNNING if stream is already running + */ + void startStream(in IEvsUltrasonicsArrayStream stream); + + /** + * Requests to stop the delivery of the ultrasonic array data frames + * + * Because delivery is asynchronous, frames may continue to arrive for + * some time after this call returns. Each must be returned until the + * closure of the stream is signaled to the IEvsCameraStream. + * This function cannot fail and is ignored if the stream isn't running. + */ + void stopStream(); +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.aidl new file mode 100644 index 0000000000..bc31a6ba95 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.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. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.EvsEventDesc; +import android.hardware.automotive.evs.UltrasonicsDataFrameDesc; + +/** + * Implemented on client side to receive asynchronous ultrasonic data + * deliveries. + */ +@VintfStability +interface IEvsUltrasonicsArrayStream { + /** + * Receives calls from the HAL each time a data frame is ready + * + * @param in dataFrameDesc Ultrasonic array data frame descriptor + */ + oneway void deliverDataFrame(in UltrasonicsDataFrameDesc dataFrameDesc); + + /** + * Receives calls from the HAL each time an event happens + * + * @param in event Event EVS event with possible event information + */ + oneway void notify(in EvsEventDesc event); +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/ParameterRange.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/ParameterRange.aidl new file mode 100644 index 0000000000..b08fcbd975 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/ParameterRange.aidl @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +/** + * Represent a valid range of CameraParam + */ +@VintfStability +parcelable ParameterRange { + /** + * Lower bound of a valid value range + */ + int min; + /** + * Upper bound of a valid value range + */ + int max; + /** + * A value of unit increment + */ + int step; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/Rotation.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/Rotation.aidl new file mode 100644 index 0000000000..dede39e15e --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/Rotation.aidl @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +/** + * Rotation: + * + * The required counterclockwise rotation of EVS camera stream and display. + */ +@VintfStability +@Backing(type="int") +enum Rotation { + /** No rotation */ + ROTATION_0 = 0, + /** Rotate by 90 degree counterclockwise */ + ROTATION_90 = 1, + /** Rotate by 180 degree counterclockwise */ + ROTATION_180 = 2, + /** Rotate by 270 degree counterclockwise */ + ROTATION_270 = 3 + +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/RotationQuaternion.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/RotationQuaternion.aidl new file mode 100644 index 0000000000..b80343bf7c --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/RotationQuaternion.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +/** + * Structure for rotation expressed as quaternions. + * Convention used: Unit quaternion with hamilton convention. + */ +@VintfStability +parcelable RotationQuaternion { + float x; + float y; + float z; + float w; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/SensorPose.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/SensorPose.aidl new file mode 100644 index 0000000000..26c33399b8 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/SensorPose.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. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.RotationQuaternion; +import android.hardware.automotive.evs.Translation; + +/** + * Provides the orientation and location of a car sensor relative to the android automotive + * coordinate system: + * https://source.android.com/devices/sensors/sensor-types#auto_axes + * The sensor pose defines the transformation to be applied to the android automotive axes to + * obtain the sensor local axes. + * The pose consists of rotation, (specified as a quaternions) and translation + * (vector with x, y, z). + * This rotation and translation applied to the sensor data in the sensor's local coordinate + * system transform the data to the automotive coordinate system. + * i.e. loc = ( Rot * Psensor ) + Trans + * Here loc is a point in automotive coordinate system and Psensor is a point in the sensor's + * coordinate system. + * Example: + * For a sensor on the front bumper and on the left corner of the car with its X axis pointing to + * the front, the sensor is located at (-2, 4, 0) meters w.r.t android automotive axes and the + * sensor local axes has a rotation of 90 degrees counter-clockwise w.r.t android automotive axes + * when viewing the car from top on the +Z axis side: + * + * ↑X sensor + * Y←∘______ + * | | front + * | car | + * | ↑Y | + * | ∘→X | rear + * |______| + * + * For this example the rotation and translation will be: + * Rotation = + 90 degrees around Z axis = (0.7071, 0, 0, 0.7071) as a unit quaternion. + * Translation = (-2, 4, 0) in meters = (-2000, 4000, 0) in milli-meters. + * Note: Every sensor type must specify its own pose. + */ +@VintfStability +parcelable SensorPose { + /** + * Rotation part of the sensor pose, expressed as a unit quaternion. + */ + RotationQuaternion rotation; + /** + * Translation part of the sensor pose, in (x, y, z) format with milli-meter units. + */ + Translation translation; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/Stream.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/Stream.aidl new file mode 100644 index 0000000000..ae5c7f0748 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/Stream.aidl @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.Rotation; +import android.hardware.automotive.evs.StreamType; +import android.hardware.graphics.common.BufferUsage; +import android.hardware.graphics.common.PixelFormat; + +/** + * Stream: + * + * Structure that describes a EVS Camera stream + */ +@VintfStability +parcelable Stream { + /** + * Stream ID - a non-negative integer identifier for a stream. + * + * The identical stream ID must reference the same stream, with the same + * width/height/format, across consecutive calls to configureStreams. + * + * If previously-used stream ID is not used in a new call to + * configureStreams, then that stream is no longer active. Such a stream ID + * may be reused in a future configureStreams with a new + * width/height/format. + * + */ + int id; + /** + * The type of the stream (input vs output, etc). + */ + StreamType streamType; + /** + * The width in pixels of the buffers in this stream. + */ + int width; + /** + * The height in pixels of the buffers in this stream. + */ + int height; + /** + * The frame rate of this stream in frames-per-second + / + int framerate; + /** + * The pixel format form the buffers in this stream. + */ + PixelFormat format; + /** + * The gralloc usage flags for this stream, as needed by the consumer of + * the stream. + */ + BufferUsage usage; + /** + * The required output rotation of the stream. + * + * This must be inspected by HAL along with stream with and height. + */ + Rotation rotation; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/StreamType.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/StreamType.aidl new file mode 100644 index 0000000000..c028a5c43f --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/StreamType.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. + */ + +package android.hardware.automotive.evs; + +/** + * StreamType: + * + * The type of the camera stream, which defines whether the EVS client device is + * the producer or the consumer for that stream, and how the buffers of the + * stream relate to the other streams. + */ +@VintfStability +@Backing(type="int") +enum StreamType { + /** + * This stream is an output stream; the EVS HAL device must fill buffers + * from this stream with newly captured or reprocessed image data. + */ + OUTPUT = 0, + + /** + * This stream is an input stream; the EVS HAL device must read buffers + * from this stream and send them through the camera processing pipeline, + * as if the buffer was a newly captured image from the imager. + */ + INPUT = 1 +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/Translation.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/Translation.aidl new file mode 100644 index 0000000000..14b14db0c9 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/Translation.aidl @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +/** + * Structure for translation with x, y and z units. + */ +@VintfStability +parcelable Translation { + float x; + float y; + float z; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/UltrasonicSensor.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/UltrasonicSensor.aidl new file mode 100644 index 0000000000..712411bd6d --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/UltrasonicSensor.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. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.SensorPose; + +/** + * Structure that contains all information of an ultrasonic sensor. + */ +@VintfStability +parcelable UltrasonicSensor { + /** + * Pose provides the orientation and location of the ultrasonic sensor within the car. + * The +Y axis points along the center of the beam spread the X axis to the right and the Z + * axis in the up direction. + */ + SensorPose pose; + /** + * Maximum range of the sensor in milli-metres. + */ + float maxRangeMm; + /** + * Half-angle of the angle of measurement of the sensor, relative to the + * sensor’s x axis, in radians. + */ + float angleOfMeasurement; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/UltrasonicsArrayDesc.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/UltrasonicsArrayDesc.aidl new file mode 100644 index 0000000000..d4f0663b27 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/UltrasonicsArrayDesc.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. + */ + +package android.hardware.automotive.evs; + +import android.hardware.automotive.evs.UltrasonicSensor; + +/** + * Structure identifies and describes an ultrasonics array in the car. + * + * A ultrasonics array represents a group of ultrasonic sensors within the + * car. These may be sensors that are physically connected to the same hardware + * control unit or represent a logical group of sensors like front and back. + * The HAL is responsible for filling out this structure for each Ultrasonics + * Array. + */ +@VintfStability +parcelable UltrasonicsArrayDesc { + /** + * Unique identifier for the ultrasonic array. This may be a path or name of the + * physical control device or a string identifying a logical group of sensors forming an array + * such as "front_array" and "back_array". + */ + @utf8InCpp + String ultrasonicsArrayId; + /** + * Maximum number of readings (points on waveform) provided per sensor in + * each data frame. Used by client to pre-allocate required memory buffer for + * incoming data. + */ + int maxReadingsPerSensorCount; + /** + * Maximum number of receiver sensors in a data frame. Must be between 1 + * and sensorCount. Used by client to pre-allocate required memory buffer for + * incoming data. + */ + int maxReceiversCount; + /** + * The order of sensors specified must be in clockwise order around the car, starting + * from front left-most sensor. + */ + UltrasonicSensor[] sensors; +} diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.aidl new file mode 100644 index 0000000000..e546db92c2 --- /dev/null +++ b/automotive/evs/aidl/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.aidl @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.evs; + +import android.hardware.common.Ashmem; + +/** + * Structure that describes the data frame received from an ultrasonics array. + * + * Each data frame returned consists of received waveform signals from a subset + * of sensors in an array as indicated by the receiversIdList. The signal is + * transmitted at a particular time instant indicated by timestampNs from a + * subset of sensors in the array as provided in the transmittersIdList. + */ +@VintfStability +parcelable UltrasonicsDataFrameDesc { + /** + * Timestamp of the start of the transmit signal for this data frame. + * Timestamp unit is nanoseconds and is obtained from android::elapsedRealtimeNanos(). + * timeOfFlight readings are future-deltas to this timestamp. + */ + long timestampNs; + /** + * Identifier of data frame. Used by implementation for managing multiple frames in flight. + */ + int id; + /** + * List of indexes of sensors in range [0, sensorCount - 1] that + * transmitted the signal for this data frame. + */ + byte[] transmittersIdList; + /** + * List of indexes of sensors in range [0, sensorCount - 1] that received + * the signal. The order of ids must match the order of the waveforms in the + * waveformsData. + * Size of list is upper bound by maxReceiversCount. + */ + byte[] receiversIdList; + /** + * List of the number of readings corresponding to each ultrasonics sensor in + * the receiversIdList. Order of the readings count must match the order in + * receiversIdList. + * Size of list is upper bound by maxReadingsPerSensorCount. + */ + int[] receiversReadingsCountList; + /** + * Shared memory object containing the waveforms data. Contains one waveform + * for each sensor specified in receiversIdList, in order. + * Each waveform is represented by a number of readings, which are sample + * points on the waveform. The number of readings for each waveform is as + * specified in the receiversReadingsCountList. + * Each reading is a pair of time Of flight and resonance. + * Time of flight (float): Time between transmit and receive signal in nanoseconds. + * Resonance (float): Resonance at time on waveform in range [0.0, 1.0]. + * + * The structure of shared memory (example with 2 waveforms, each with 2 readings): + * + * Byte: | 0 | 1-4 | 5-8 | 9-12 | 13-16 || 17 | 18-21 | 22-25 | 26-29 | 30-33 | + * Data: | RecId1 | TOF1 | RES1 | TOF2 | RES2 || RecId2 | TOF1 | RES1 | TOF2 | RES2 | + * | Waveform1 || Waveform2 | + * Here: + * RecId : Receiver's Id. Order matches the receiversIdList, type uint8_t + * TOF : Time of flight, type float (4 bytes) + * RES : Resonance, type float (4 bytes) + * Note: All readings and waveforms are contigious with no padding. + */ + Ashmem waveformsData; +} diff --git a/automotive/evs/aidl/impl/Android.bp b/automotive/evs/aidl/impl/Android.bp new file mode 100644 index 0000000000..7eb01166c3 --- /dev/null +++ b/automotive/evs/aidl/impl/Android.bp @@ -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. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_defaults { + name: "EvsHalDefaults", + static_libs: [ + "android.hardware.automotive.evs-V1-ndk", + "android.hardware.common-V2-ndk", + "android.hardware.graphics.common-V3-ndk", + ], + shared_libs: [ + "libbase", + "liblog", + "libutils", + ], + cflags: [ + "-Wall", + "-Wextra", + "-Werror", + "-Wthread-safety", + ], +} diff --git a/automotive/evs/aidl/impl/default/Android.bp b/automotive/evs/aidl/impl/default/Android.bp new file mode 100644 index 0000000000..dbe0314118 --- /dev/null +++ b/automotive/evs/aidl/impl/default/Android.bp @@ -0,0 +1,36 @@ +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + // 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.automotive.evs-aidl-default-service", + defaults: ["EvsHalDefaults"], + local_include_dirs: ["include"], + vintf_fragments: ["evs-default-service.xml"], + init_rc: ["evs-default-service.rc"], + vendor: true, + relative_install_path: "hw", + srcs: ["src/*.cpp"], + shared_libs: [ + "libbinder_ndk", + ], +} diff --git a/automotive/evs/aidl/impl/default/evs-default-service.rc b/automotive/evs/aidl/impl/default/evs-default-service.rc new file mode 100644 index 0000000000..ea8e6892dc --- /dev/null +++ b/automotive/evs/aidl/impl/default/evs-default-service.rc @@ -0,0 +1,5 @@ +service vendor.evs-hal-default /vendor/bin/hw/android.hardware.automotive.evs-aidl-default-service + class early_hal + user automotive_evs + group automotive_evs + disabled diff --git a/automotive/evs/aidl/impl/default/evs-default-service.xml b/automotive/evs/aidl/impl/default/evs-default-service.xml new file mode 100644 index 0000000000..96ff9f6576 --- /dev/null +++ b/automotive/evs/aidl/impl/default/evs-default-service.xml @@ -0,0 +1,11 @@ + + + android.hardware.automotive.evs + hwbinder + 1 + + IEvsEnumerator + hw/0 + + + diff --git a/automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h b/automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h new file mode 100644 index 0000000000..8bcd867d48 --- /dev/null +++ b/automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h @@ -0,0 +1,66 @@ +/* + * 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 android_hardware_automotive_evs_aidl_impl_evshal_include_DefaultEvsHal_H_ +#define android_hardware_automotive_evs_aidl_impl_evshal_include_DefaultEvsHal_H_ + +#include + +namespace aidl::android::hardware::automotive::evs::implementation { + +class DefaultEvsEnumerator final + : public ::aidl::android::hardware::automotive::evs::BnEvsEnumerator { + ::ndk::ScopedAStatus isHardware(bool* flag) override; + ::ndk::ScopedAStatus openCamera( + const std::string& cameraId, + const ::aidl::android::hardware::automotive::evs::Stream& streamConfig, + std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsCamera>* obj) override; + ::ndk::ScopedAStatus closeCamera( + const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsCamera>& obj) + override; + ::ndk::ScopedAStatus getCameraList( + std::vector<::aidl::android::hardware::automotive::evs::CameraDesc>* list) override; + ::ndk::ScopedAStatus getStreamList( + const ::aidl::android::hardware::automotive::evs::CameraDesc& desc, + std::vector<::aidl::android::hardware::automotive::evs::Stream>* _aidl_return) override; + ::ndk::ScopedAStatus openDisplay( + int8_t displayId, + std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsDisplay>* obj) override; + ::ndk::ScopedAStatus closeDisplay( + const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsDisplay>& obj) + override; + ::ndk::ScopedAStatus getDisplayIdList(std::vector* list) override; + ::ndk::ScopedAStatus getDisplayState( + ::aidl::android::hardware::automotive::evs::DisplayState* state) override; + ::ndk::ScopedAStatus registerStatusCallback( + const std::shared_ptr< + ::aidl::android::hardware::automotive::evs::IEvsEnumeratorStatusCallback>& + callback) override; + ::ndk::ScopedAStatus openUltrasonicsArray( + const std::string& id, + std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsUltrasonicsArray>* obj) + override; + ::ndk::ScopedAStatus closeUltrasonicsArray( + const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsUltrasonicsArray>& + arr) override; + ::ndk::ScopedAStatus getUltrasonicsArrayList( + std::vector<::aidl::android::hardware::automotive::evs::UltrasonicsArrayDesc>* list) + override; +}; + +} // namespace aidl::android::hardware::automotive::evs::implementation + +#endif // android_hardware_automotive_evs_aidl_impl_evshal_include_DefaultEvsHal_H_ diff --git a/automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp b/automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp new file mode 100644 index 0000000000..2ff6d59af2 --- /dev/null +++ b/automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp @@ -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. + */ + +// TODO(b/203661081): Remove below lines to disable compiler warnings. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" + +#define LOG_TAG "DefaultEvsEnumerator" + +#include + +namespace aidl::android::hardware::automotive::evs::implementation { + +using ::ndk::ScopedAStatus; + +ScopedAStatus DefaultEvsEnumerator::isHardware(bool* flag) { + // This returns true always. + *flag = true; + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultEvsEnumerator::openCamera(const std::string& cameraId, + const Stream& streamConfig, + std::shared_ptr* obj) { + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultEvsEnumerator::closeCamera(const std::shared_ptr& obj) { + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultEvsEnumerator::getCameraList(std::vector* list) { + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultEvsEnumerator::getStreamList(const CameraDesc& desc, + std::vector* _aidl_return) { + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultEvsEnumerator::openDisplay(int8_t displayId, + std::shared_ptr* obj) { + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultEvsEnumerator::closeDisplay(const std::shared_ptr& state) { + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultEvsEnumerator::getDisplayIdList(std::vector* list) { + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultEvsEnumerator::getDisplayState(DisplayState* state) { + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultEvsEnumerator::registerStatusCallback( + const std::shared_ptr& callback) { + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultEvsEnumerator::openUltrasonicsArray( + const std::string& id, std::shared_ptr* obj) { + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultEvsEnumerator::closeUltrasonicsArray( + const std::shared_ptr& obj) { + return ScopedAStatus::ok(); +} + +ScopedAStatus DefaultEvsEnumerator::getUltrasonicsArrayList( + std::vector* list) { + return ScopedAStatus::ok(); +} + +} // namespace aidl::android::hardware::automotive::evs::implementation + +#pragma clang diagnostic pop diff --git a/automotive/evs/aidl/impl/default/src/service.cpp b/automotive/evs/aidl/impl/default/src/service.cpp new file mode 100644 index 0000000000..0a0913fd3c --- /dev/null +++ b/automotive/evs/aidl/impl/default/src/service.cpp @@ -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. + */ + +#define LOG_TAG "EvsService" + +#include + +#include +#include +#include + +using ::aidl::android::hardware::automotive::evs::implementation::DefaultEvsEnumerator; + +int main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) { + std::shared_ptr vhal = ndk::SharedRefBase::make(); + + ALOGI("Registering as service..."); + binder_exception_t err = + AServiceManager_addService(vhal->asBinder().get(), "android.hardware.automotive.evs"); + if (err != EX_NONE) { + ALOGE("failed to register android.hardware.automotive.evs service, exception: %d", err); + return 1; + } + + if (!ABinderProcess_setThreadPoolMaxThreadCount(1)) { + ALOGE("%s", "failed to set thread pool max thread count"); + return 1; + } + ABinderProcess_startThreadPool(); + + ALOGI("Evs Service Ready"); + + ABinderProcess_joinThreadPool(); + + ALOGI("Evs Service Exiting"); + + return 0; +} diff --git a/automotive/evs/aidl/vts/Android.bp b/automotive/evs/aidl/vts/Android.bp new file mode 100644 index 0000000000..980c6d5a5c --- /dev/null +++ b/automotive/evs/aidl/vts/Android.bp @@ -0,0 +1,53 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package{ + // 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: + "VtsHalEvsTargetTest", + srcs: [ + "*.cpp", + ], + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + shared_libs: [ + "libbinder_ndk", + "libcamera_metadata", + "libui", + "libutils", + ], + static_libs: [ + "android.hardware.automotive.evs@common-default-lib", + "android.hardware.automotive.evs-V1-ndk", + "android.hardware.common-V2-ndk", + "android.hardware.graphics.common-V3-ndk", + "libaidlcommonsupport", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/automotive/evs/aidl/vts/FrameHandler.cpp b/automotive/evs/aidl/vts/FrameHandler.cpp new file mode 100644 index 0000000000..bab832b09c --- /dev/null +++ b/automotive/evs/aidl/vts/FrameHandler.cpp @@ -0,0 +1,358 @@ +/* + * 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. + */ + +#define LOG_TAG "VtsHalEvsTest" + +#include "FrameHandler.h" +#include "FormatConvert.h" + +#include +#include +#include +#include +#include + +using ::aidl::android::hardware::automotive::evs::BufferDesc; +using ::aidl::android::hardware::automotive::evs::CameraDesc; +using ::aidl::android::hardware::automotive::evs::EvsEventDesc; +using ::aidl::android::hardware::automotive::evs::EvsEventType; +using ::aidl::android::hardware::automotive::evs::IEvsCamera; +using ::aidl::android::hardware::automotive::evs::IEvsDisplay; +using ::aidl::android::hardware::graphics::common::HardwareBufferDescription; +using ::ndk::ScopedAStatus; +using std::chrono_literals::operator""s; + +FrameHandler::FrameHandler(const std::shared_ptr& pCamera, const CameraDesc& cameraInfo, + const std::shared_ptr& pDisplay, BufferControlFlag mode) + : mCamera(pCamera), mCameraInfo(cameraInfo), mDisplay(pDisplay), mReturnMode(mode) { + // Nothing but member initialization here. +} + +void FrameHandler::shutdown() { + // Make sure we're not still streaming + blockingStopStream(); + + // At this point, the receiver thread is no longer running, so we can safely drop + // our remote object references so they can be freed + mCamera = nullptr; + mDisplay = nullptr; +} + +bool FrameHandler::startStream() { + // Tell the camera to start streaming + auto status = mCamera->startVideoStream(ref()); + if (!status.isOk()) { + return false; + } + + // Mark ourselves as running + mLock.lock(); + mRunning = true; + mLock.unlock(); + + return true; +} + +void FrameHandler::asyncStopStream() { + // Tell the camera to stop streaming. + // This will result in a null frame being delivered when the stream actually stops. + mCamera->stopVideoStream(); +} + +void FrameHandler::blockingStopStream() { + // Tell the stream to stop + asyncStopStream(); + + // Wait until the stream has actually stopped + std::unique_lock lock(mEventLock); + if (mRunning) { + mEventSignal.wait(lock, [this]() { return !mRunning; }); + } +} + +bool FrameHandler::returnHeldBuffer() { + std::lock_guard lock(mLock); + + // Return the oldest buffer we're holding + if (mHeldBuffers.empty()) { + // No buffers are currently held + return false; + } + + std::vector buffers = std::move(mHeldBuffers.front()); + mHeldBuffers.pop(); + mCamera->doneWithFrame(buffers); + + return true; +} + +bool FrameHandler::isRunning() { + std::lock_guard lock(mLock); + return mRunning; +} + +void FrameHandler::waitForFrameCount(unsigned frameCount) { + // Wait until we've seen at least the requested number of frames (could be more) + std::unique_lock lock(mLock); + mFrameSignal.wait(lock, [this, frameCount]() { return mFramesReceived >= frameCount; }); +} + +void FrameHandler::getFramesCounters(unsigned* received, unsigned* displayed) { + std::lock_guard lock(mLock); + + if (received) { + *received = mFramesReceived; + } + if (displayed) { + *displayed = mFramesDisplayed; + } +} + +ScopedAStatus FrameHandler::deliverFrame(const std::vector& buffers) { + mLock.lock(); + // For VTS tests, FrameHandler uses a single frame among delivered frames. + auto bufferIdx = mFramesDisplayed % buffers.size(); + auto& buffer = buffers[bufferIdx]; + mLock.unlock(); + + // Store a dimension of a received frame. + mFrameWidth = buffer.buffer.description.width; + mFrameHeight = buffer.buffer.description.height; + + // If we were given an opened display at construction time, then send the received + // image back down the camera. + bool displayed = false; + if (mDisplay) { + // Get the output buffer we'll use to display the imagery + BufferDesc tgtBuffer; + auto status = mDisplay->getTargetBuffer(&tgtBuffer); + if (!status.isOk()) { + printf("Didn't get target buffer - frame lost\n"); + LOG(ERROR) << "Didn't get requested output buffer -- skipping this frame."; + } else { + // Copy the contents of the of buffer.memHandle into tgtBuffer + copyBufferContents(tgtBuffer, buffer); + + // Send the target buffer back for display + auto status = mDisplay->returnTargetBufferForDisplay(tgtBuffer); + if (!status.isOk()) { + printf("AIDL error on display buffer (%d)- frame lost\n", + status.getServiceSpecificError()); + LOG(ERROR) << "Error making the remote function call. AIDL said " + << status.getServiceSpecificError(); + } else { + // Everything looks good! + // Keep track so tests or watch dogs can monitor progress + displayed = true; + } + } + } + + mLock.lock(); + // increases counters + ++mFramesReceived; + mFramesDisplayed += (int)displayed; + mLock.unlock(); + mFrameSignal.notify_all(); + + switch (mReturnMode) { + case eAutoReturn: + // Send the camera buffer back now that the client has seen it + LOG(DEBUG) << "Calling doneWithFrame"; + mCamera->doneWithFrame(buffers); + break; + case eNoAutoReturn: + // Hang onto the buffer handles for now -- the client will return it explicitly later + // mHeldBuffers.push(buffers); + break; + } + + LOG(DEBUG) << "Frame handling complete"; + return ScopedAStatus::ok(); +} + +ScopedAStatus FrameHandler::notify(const EvsEventDesc& event) { + // Local flag we use to keep track of when the stream is stopping + std::unique_lock lock(mEventLock); + mLatestEventDesc.aType = event.aType; + mLatestEventDesc.payload[0] = event.payload[0]; + mLatestEventDesc.payload[1] = event.payload[1]; + if (mLatestEventDesc.aType == EvsEventType::STREAM_STOPPED) { + // Signal that the last frame has been received and the stream is stopped + mRunning = false; + } else if (mLatestEventDesc.aType == EvsEventType::PARAMETER_CHANGED) { + LOG(DEBUG) << "Camera parameter " << mLatestEventDesc.payload[0] << " is changed to " + << mLatestEventDesc.payload[1]; + } else { + LOG(DEBUG) << "Received an event " << eventToString(mLatestEventDesc.aType); + } + lock.unlock(); + mEventSignal.notify_one(); + + return ScopedAStatus::ok(); +} + +bool FrameHandler::copyBufferContents(const BufferDesc& tgtBuffer, const BufferDesc& srcBuffer) { + bool success = true; + const HardwareBufferDescription* pSrcDesc = + reinterpret_cast(&srcBuffer.buffer.description); + const HardwareBufferDescription* pTgtDesc = + reinterpret_cast(&tgtBuffer.buffer.description); + + // Make sure we don't run off the end of either buffer + const unsigned width = std::min(pTgtDesc->width, pSrcDesc->width); + const unsigned height = std::min(pTgtDesc->height, pSrcDesc->height); + + // FIXME: We duplicate file descriptors twice below; consider using TAKE_HANDLE + // instead of CLONE_HANDLE. + buffer_handle_t target = ::android::dupFromAidl(tgtBuffer.buffer.handle); + ::android::sp tgt = new android::GraphicBuffer( + target, android::GraphicBuffer::CLONE_HANDLE, pTgtDesc->width, pTgtDesc->height, + static_cast(pTgtDesc->format), pTgtDesc->layers, + static_cast(pTgtDesc->usage), pTgtDesc->stride); + + buffer_handle_t source = ::android::dupFromAidl(srcBuffer.buffer.handle); + ::android::sp src = new android::GraphicBuffer( + source, android::GraphicBuffer::CLONE_HANDLE, pSrcDesc->width, pSrcDesc->height, + static_cast(pSrcDesc->format), pSrcDesc->layers, + static_cast(pSrcDesc->usage), pSrcDesc->stride); + + // Lock our source buffer for reading (current expectation are for this to be NV21 format) + uint8_t* srcPixels = nullptr; + src->lock(GRALLOC_USAGE_SW_READ_OFTEN, (void**)&srcPixels); + + // Lock our target buffer for writing (should be either RGBA8888 or BGRA8888 format) + uint32_t* tgtPixels = nullptr; + tgt->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)&tgtPixels); + + if (srcPixels && tgtPixels) { + using namespace ::android::hardware::automotive::evs::common; + if (static_cast(pTgtDesc->format) == HAL_PIXEL_FORMAT_RGBA_8888) { + if (static_cast(pSrcDesc->format) == + HAL_PIXEL_FORMAT_YCRCB_420_SP) { // 420SP == NV21 + Utils::copyNV21toRGB32(width, height, srcPixels, tgtPixels, pTgtDesc->stride); + } else if (static_cast(pSrcDesc->format) == + HAL_PIXEL_FORMAT_YV12) { // YUV_420P == YV12 + Utils::copyYV12toRGB32(width, height, srcPixels, tgtPixels, pTgtDesc->stride); + } else if (static_cast(pSrcDesc->format) == + HAL_PIXEL_FORMAT_YCBCR_422_I) { // YUYV + Utils::copyYUYVtoRGB32(width, height, srcPixels, pSrcDesc->stride, tgtPixels, + pTgtDesc->stride); + } else if (pSrcDesc->format == pTgtDesc->format) { // 32bit RGBA + Utils::copyMatchedInterleavedFormats(width, height, srcPixels, pSrcDesc->stride, + tgtPixels, pTgtDesc->stride, + tgtBuffer.pixelSizeBytes); + } else { + LOG(ERROR) << "Camera buffer format is not supported"; + success = false; + } + } else if (static_cast(pTgtDesc->format) == + HAL_PIXEL_FORMAT_BGRA_8888) { + if (static_cast(pSrcDesc->format) == + HAL_PIXEL_FORMAT_YCRCB_420_SP) { // 420SP == NV21 + Utils::copyNV21toBGR32(width, height, srcPixels, tgtPixels, pTgtDesc->stride); + } else if (static_cast(pSrcDesc->format) == + HAL_PIXEL_FORMAT_YV12) { // YUV_420P == YV12 + Utils::copyYV12toBGR32(width, height, srcPixels, tgtPixels, pTgtDesc->stride); + } else if (static_cast(pSrcDesc->format) == + HAL_PIXEL_FORMAT_YCBCR_422_I) { // YUYV + Utils::copyYUYVtoBGR32(width, height, srcPixels, pSrcDesc->stride, tgtPixels, + pTgtDesc->stride); + } else if (pSrcDesc->format == pTgtDesc->format) { // 32bit RGBA + Utils::copyMatchedInterleavedFormats(width, height, srcPixels, pSrcDesc->stride, + tgtPixels, pTgtDesc->stride, + tgtBuffer.pixelSizeBytes); + } else { + LOG(ERROR) << "Camera buffer format is not supported"; + success = false; + } + } else { + // We always expect 32 bit RGB for the display output for now. Is there a need for 565? + LOG(ERROR) << "Diplay buffer is always expected to be 32bit RGBA"; + success = false; + } + } else { + LOG(ERROR) << "Failed to lock buffer contents for contents transfer"; + success = false; + } + + if (srcPixels) { + src->unlock(); + } + if (tgtPixels) { + tgt->unlock(); + } + + return success; +} + +void FrameHandler::getFrameDimension(unsigned* width, unsigned* height) { + if (width) { + *width = mFrameWidth; + } + + if (height) { + *height = mFrameHeight; + } +} + +bool FrameHandler::waitForEvent(const EvsEventDesc& aTargetEvent, EvsEventDesc& aReceivedEvent, + bool ignorePayload) { + // Wait until we get an expected parameter change event. + std::unique_lock lock(mEventLock); + auto now = std::chrono::system_clock::now(); + bool found = false; + while (!found) { + bool result = mEventSignal.wait_until( + lock, now + 5s, [this, aTargetEvent, ignorePayload, &aReceivedEvent, &found]() { + found = (mLatestEventDesc.aType == aTargetEvent.aType) && + (ignorePayload || + (mLatestEventDesc.payload[0] == aTargetEvent.payload[0] && + mLatestEventDesc.payload[1] == aTargetEvent.payload[1])); + + aReceivedEvent.aType = mLatestEventDesc.aType; + aReceivedEvent.payload[0] = mLatestEventDesc.payload[0]; + aReceivedEvent.payload[1] = mLatestEventDesc.payload[1]; + return found; + }); + + if (!result) { + LOG(WARNING) << "A timer is expired before a target event has happened."; + break; + } + } + + return found; +} + +const char* FrameHandler::eventToString(const EvsEventType aType) { + switch (aType) { + case EvsEventType::STREAM_STARTED: + return "STREAM_STARTED"; + case EvsEventType::STREAM_STOPPED: + return "STREAM_STOPPED"; + case EvsEventType::FRAME_DROPPED: + return "FRAME_DROPPED"; + case EvsEventType::TIMEOUT: + return "TIMEOUT"; + case EvsEventType::PARAMETER_CHANGED: + return "PARAMETER_CHANGED"; + case EvsEventType::MASTER_RELEASED: + return "MASTER_RELEASED"; + default: + return "Unknown"; + } +} diff --git a/automotive/evs/aidl/vts/FrameHandler.h b/automotive/evs/aidl/vts/FrameHandler.h new file mode 100644 index 0000000000..0b959ab48d --- /dev/null +++ b/automotive/evs/aidl/vts/FrameHandler.h @@ -0,0 +1,105 @@ +/* + * 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 AUTOMOTIVE_EVS_VTS_FRAMEHANDLER_H +#define AUTOMOTIVE_EVS_VTS_FRAMEHANDLER_H + +#include +#include +#include +#include + +#include +#include + +/* + * FrameHandler: + * This class can be used to receive camera imagery from an IEvsCamera implementation. Given an + * IEvsDisplay instance at startup, it will forward the received imagery to the display, + * providing a trivial implementation of a rear vew camera type application. + * Note that the video frames are delivered on a background thread, while the control interface + * is actuated from the applications foreground thread. + */ +class FrameHandler : public ::aidl::android::hardware::automotive::evs::BnEvsCameraStream { + public: + enum BufferControlFlag { + eAutoReturn, + eNoAutoReturn, + }; + + FrameHandler( + const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsCamera>& pCamera, + const ::aidl::android::hardware::automotive::evs::CameraDesc& cameraInfo, + const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsDisplay>& + pDisplay, + BufferControlFlag mode = eAutoReturn); + virtual ~FrameHandler() { + if (mCamera != nullptr) { + /* shutdown a camera explicitly */ + shutdown(); + } + } + + void shutdown(); + bool startStream(); + void asyncStopStream(); + void blockingStopStream(); + bool returnHeldBuffer(); + bool isRunning(); + void waitForFrameCount(unsigned frameCount); + bool waitForEvent(const ::aidl::android::hardware::automotive::evs::EvsEventDesc& aTargetEvent, + ::aidl::android::hardware::automotive::evs::EvsEventDesc& aReceivedEvent, + bool ignorePayload = false); + void getFramesCounters(unsigned* received, unsigned* displayed); + void getFrameDimension(unsigned* width, unsigned* height); + + private: + // Methods from ::aidl::android::hardware::automotive::evs::IEvsCameraStream follow. + ::ndk::ScopedAStatus deliverFrame( + const std::vector<::aidl::android::hardware::automotive::evs::BufferDesc>& buffer) + override; + ::ndk::ScopedAStatus notify( + const ::aidl::android::hardware::automotive::evs::EvsEventDesc& event) override; + + // Local implementation details + bool copyBufferContents( + const ::aidl::android::hardware::automotive::evs::BufferDesc& tgtBuffer, + const ::aidl::android::hardware::automotive::evs::BufferDesc& srcBuffer); + const char* eventToString(const ::aidl::android::hardware::automotive::evs::EvsEventType aType); + + std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsCamera> mCamera; + ::aidl::android::hardware::automotive::evs::CameraDesc mCameraInfo; + std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsDisplay> mDisplay; + BufferControlFlag mReturnMode; + + // Since we get frames delivered to us asynchronously via the IEvsCameraStream interface, + // we need to protect all member variables that may be modified while we're streaming + // (ie: those below) + std::mutex mLock; + std::mutex mEventLock; + std::condition_variable mEventSignal; + std::condition_variable mFrameSignal; + std::queue> mHeldBuffers; + + bool mRunning = false; + unsigned mFramesReceived = 0; // Simple counter -- rolls over eventually! + unsigned mFramesDisplayed = 0; // Simple counter -- rolls over eventually! + unsigned mFrameWidth = 0; + unsigned mFrameHeight = 0; + ::aidl::android::hardware::automotive::evs::EvsEventDesc mLatestEventDesc; +}; + +#endif // AUTOMOTIVE_EVS_VTS_FRAMEHANDLER_H diff --git a/automotive/evs/aidl/vts/FrameHandlerUltrasonics.cpp b/automotive/evs/aidl/vts/FrameHandlerUltrasonics.cpp new file mode 100644 index 0000000000..650f0ed501 --- /dev/null +++ b/automotive/evs/aidl/vts/FrameHandlerUltrasonics.cpp @@ -0,0 +1,123 @@ +/* + * Copyright 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. + */ + +#include "FrameHandlerUltrasonics.h" + +#include +#include +#include +#include +#include + +using ::aidl::android::hardware::automotive::evs::EvsEventDesc; +using ::aidl::android::hardware::automotive::evs::EvsEventType; +using ::aidl::android::hardware::automotive::evs::IEvsUltrasonicsArray; +using ::aidl::android::hardware::automotive::evs::UltrasonicsDataFrameDesc; +using ::ndk::ScopedAStatus; + +namespace { + +// Struct used by SerializeWaveformData(). +struct WaveformData { + uint8_t receiverId; + std::vector> readings; +}; + +} // namespace + +FrameHandlerUltrasonics::FrameHandlerUltrasonics( + const std::shared_ptr& pArray) + : mEvsUltrasonicsArray(pArray), mReceiveFramesCount(0) { + // Nothing but member initialization +} + +ScopedAStatus FrameHandlerUltrasonics::notify(const EvsEventDesc& evsEvent) { + switch (evsEvent.aType) { + case EvsEventType::STREAM_STARTED: + case EvsEventType::STREAM_STOPPED: + case EvsEventType::FRAME_DROPPED: + case EvsEventType::TIMEOUT: + mReceivedEvents.emplace_back(evsEvent); + break; + default: + LOG(ERROR) << "Received unexpected event"; + } + + return ScopedAStatus::ok(); +} + +// De-serializes shared memory to vector of WaveformData. +// TODO(b/149950362): Add a common library for serializing and deserializing waveform data. +std::vector DeSerializeWaveformData(std::vector recvReadingsCountList, + uint8_t* pData) { + std::vector waveformDataList(recvReadingsCountList.size()); + + for (int i = 0; i < waveformDataList.size(); i++) { + // Set Id + memcpy(&waveformDataList[i].receiverId, pData, sizeof(uint8_t)); + pData += sizeof(uint8_t); + + waveformDataList[i].readings.resize(recvReadingsCountList[i]); + + for (auto& reading : waveformDataList[i].readings) { + // Set the time of flight. + memcpy(&reading.first, pData, sizeof(float)); + pData += sizeof(float); + + // Set the resonance. + memcpy(&reading.second, pData, sizeof(float)); + pData += sizeof(float); + } + } + return waveformDataList; +} + +bool DataFrameValidator(const UltrasonicsDataFrameDesc& /*dataFrameDesc*/) { + // TODO(b/214026378): implement a method to validate an ultrasonics data frame + (void)DeSerializeWaveformData; + return true; +} + +ScopedAStatus FrameHandlerUltrasonics::deliverDataFrame( + const UltrasonicsDataFrameDesc& dataFrameDesc) { + LOG(DEBUG) << "FrameHandlerUltrasonics::receiveFrames"; + + mReceiveFramesCount++; + + if (!DataFrameValidator(dataFrameDesc)) { + mAllFramesValid = false; + } + + // Send done with data frame. + mEvsUltrasonicsArray->doneWithDataFrame(dataFrameDesc); + return ScopedAStatus::ok(); +} + +bool FrameHandlerUltrasonics::checkEventReceived(const EvsEventDesc& evsEvent) { + LOG(DEBUG) << "FrameHandlerUltrasonics::checkEventReceived"; + int size = mReceivedEvents.size(); // work around + LOG(DEBUG) << "Received event number: " << size; + auto iter = find(mReceivedEvents.begin(), mReceivedEvents.end(), evsEvent); + return iter != mReceivedEvents.end(); +} + +int FrameHandlerUltrasonics::getReceiveFramesCount() { + return mReceiveFramesCount; +} + +bool FrameHandlerUltrasonics::areAllFramesValid() { + return mAllFramesValid; +} diff --git a/automotive/evs/aidl/vts/FrameHandlerUltrasonics.h b/automotive/evs/aidl/vts/FrameHandlerUltrasonics.h new file mode 100644 index 0000000000..f853a00a25 --- /dev/null +++ b/automotive/evs/aidl/vts/FrameHandlerUltrasonics.h @@ -0,0 +1,52 @@ +/* + * Copyright 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 AUTOMOTIVE_EVS_VTS_FRAMEHANDLERULTRASONICS_H +#define AUTOMOTIVE_EVS_VTS_FRAMEHANDLERULTRASONICS_H + +#include +#include + +#include + +class FrameHandlerUltrasonics + : public ::aidl::android::hardware::automotive::evs::BnEvsUltrasonicsArrayStream { + public: + FrameHandlerUltrasonics( + const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsUltrasonicsArray>& + pArray); + + // Implementation for ::aidl::android::hardware::automotive::evs::IEvsUltrasonicsArrayStream + ::ndk::ScopedAStatus notify( + const ::aidl::android::hardware::automotive::evs::EvsEventDesc& event) override; + ::ndk::ScopedAStatus deliverDataFrame( + const ::aidl::android::hardware::automotive::evs::UltrasonicsDataFrameDesc& desc) + override; + + bool checkEventReceived( + const ::aidl::android::hardware::automotive::evs::EvsEventDesc& evsEvent); + int getReceiveFramesCount(); + bool areAllFramesValid(); + + private: + std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsUltrasonicsArray> + mEvsUltrasonicsArray; + std::vector<::aidl::android::hardware::automotive::evs::EvsEventDesc> mReceivedEvents; + int mReceiveFramesCount; + bool mAllFramesValid = true; +}; + +#endif // AUTOMOTIVE_EVS_VTS_FRAMEHANDLERULTRASONICS_H diff --git a/automotive/evs/aidl/vts/OWNERS b/automotive/evs/aidl/vts/OWNERS new file mode 100644 index 0000000000..a104f509b2 --- /dev/null +++ b/automotive/evs/aidl/vts/OWNERS @@ -0,0 +1,3 @@ +#Bug component : 853002 +ankitarora@google.com +changyeon@google.com diff --git a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp new file mode 100644 index 0000000000..c709d40690 --- /dev/null +++ b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp @@ -0,0 +1,2170 @@ +/* + * 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. + */ + +#include "FrameHandler.h" +#include "FrameHandlerUltrasonics.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace { + +// These values are called out in the EVS design doc (as of Mar 8, 2017) +constexpr int kMaxStreamStartMilliseconds = 500; +constexpr int kMinimumFramesPerSecond = 10; +constexpr int kSecondsToMilliseconds = 1000; +constexpr int kMillisecondsToMicroseconds = 1000; +constexpr float kNanoToMilliseconds = 0.000001f; +constexpr float kNanoToSeconds = 0.000000001f; + +/* + * Please note that this is different from what is defined in + * libhardware/modules/camera/3_4/metadata/types.h; this has one additional + * field to store a framerate. + */ +typedef struct { + int32_t id; + int32_t width; + int32_t height; + int32_t format; + int32_t direction; + int32_t framerate; +} RawStreamConfig; +constexpr size_t kStreamCfgSz = sizeof(RawStreamConfig) / sizeof(int32_t); + +} // namespace + +using ::aidl::android::hardware::automotive::evs::BufferDesc; +using ::aidl::android::hardware::automotive::evs::CameraDesc; +using ::aidl::android::hardware::automotive::evs::CameraParam; +using ::aidl::android::hardware::automotive::evs::DisplayDesc; +using ::aidl::android::hardware::automotive::evs::DisplayState; +using ::aidl::android::hardware::automotive::evs::EvsEventDesc; +using ::aidl::android::hardware::automotive::evs::EvsEventType; +using ::aidl::android::hardware::automotive::evs::EvsResult; +using ::aidl::android::hardware::automotive::evs::IEvsCamera; +using ::aidl::android::hardware::automotive::evs::IEvsDisplay; +using ::aidl::android::hardware::automotive::evs::IEvsEnumerator; +using ::aidl::android::hardware::automotive::evs::IEvsUltrasonicsArray; +using ::aidl::android::hardware::automotive::evs::ParameterRange; +using ::aidl::android::hardware::automotive::evs::Stream; +using ::aidl::android::hardware::automotive::evs::UltrasonicsArrayDesc; +using ::aidl::android::hardware::graphics::common::BufferUsage; +using ::aidl::android::hardware::graphics::common::HardwareBufferDescription; +using ::aidl::android::hardware::graphics::common::PixelFormat; +using std::chrono_literals::operator""s; + +// The main test class for EVS +class EvsAidlTest : public ::testing::TestWithParam { + public: + virtual void SetUp() override { + // Make sure we can connect to the enumerator + std::string service_name = GetParam(); + AIBinder* binder = AServiceManager_waitForService(service_name.data()); + ASSERT_NE(binder, nullptr); + mEnumerator = IEvsEnumerator::fromBinder(::ndk::SpAIBinder(binder)); + LOG(INFO) << "Test target service: " << service_name; + + ASSERT_TRUE(mEnumerator->isHardware(&mIsHwModule).isOk()); + } + + virtual void TearDown() override { + // Attempt to close any active camera + for (auto&& cam : mActiveCameras) { + if (cam != nullptr) { + mEnumerator->closeCamera(cam); + } + } + mActiveCameras.clear(); + } + + protected: + void loadCameraList() { + // SetUp() must run first! + ASSERT_NE(mEnumerator, nullptr); + + // Get the camera list + ASSERT_TRUE(mEnumerator->getCameraList(&mCameraInfo).isOk()) + << "Failed to get a list of available cameras"; + LOG(INFO) << "We have " << mCameraInfo.size() << " cameras."; + } + + void loadUltrasonicsArrayList() { + // SetUp() must run first! + ASSERT_NE(mEnumerator, nullptr); + + // Get the ultrasonics array list + ASSERT_TRUE(mEnumerator->getUltrasonicsArrayList(&mUltrasonicsArraysInfo).isOk()) + << "Failed to get a list of available ultrasonics arrays"; + LOG(INFO) << "We have " << mCameraInfo.size() << " ultrasonics arrays."; + } + + bool isLogicalCamera(const camera_metadata_t* metadata) { + if (metadata == nullptr) { + // A logical camera device must have a valid camera metadata. + return false; + } + + // Looking for LOGICAL_MULTI_CAMERA capability from metadata. + camera_metadata_ro_entry_t entry; + int rc = find_camera_metadata_ro_entry(metadata, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + &entry); + if (rc != 0) { + // No capabilities are found. + return false; + } + + for (size_t i = 0; i < entry.count; ++i) { + uint8_t cap = entry.data.u8[i]; + if (cap == ANDROID_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA) { + return true; + } + } + + return false; + } + + std::unordered_set getPhysicalCameraIds(const std::string& id, bool& flag) { + std::unordered_set physicalCameras; + const auto it = std::find_if(mCameraInfo.begin(), mCameraInfo.end(), + [&id](const CameraDesc& desc) { return id == desc.id; }); + if (it == mCameraInfo.end()) { + // Unknown camera is requested. Return an empty list. + return physicalCameras; + } + + const camera_metadata_t* metadata = reinterpret_cast(&it->metadata[0]); + flag = isLogicalCamera(metadata); + if (!flag) { + // EVS assumes that the device w/o a valid metadata is a physical + // device. + LOG(INFO) << id << " is not a logical camera device."; + physicalCameras.insert(id); + return physicalCameras; + } + + // Look for physical camera identifiers + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry(metadata, ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS, + &entry); + if (rc != 0) { + LOG(ERROR) << "No physical camera ID is found for a logical camera device"; + } + + const uint8_t* ids = entry.data.u8; + size_t start = 0; + for (size_t i = 0; i < entry.count; ++i) { + if (ids[i] == '\0') { + if (start != i) { + std::string id(reinterpret_cast(ids + start)); + physicalCameras.insert(id); + } + start = i + 1; + } + } + + LOG(INFO) << id << " consists of " << physicalCameras.size() << " physical camera devices"; + return physicalCameras; + } + + Stream getFirstStreamConfiguration(camera_metadata_t* metadata) { + Stream targetCfg = {}; + camera_metadata_entry_t streamCfgs; + if (!find_camera_metadata_entry(metadata, ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, + &streamCfgs)) { + // Stream configurations are found in metadata + RawStreamConfig* ptr = reinterpret_cast(streamCfgs.data.i32); + for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) { + if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT && + ptr->format == HAL_PIXEL_FORMAT_RGBA_8888) { + targetCfg.width = ptr->width; + targetCfg.height = ptr->height; + targetCfg.format = static_cast(ptr->format); + break; + } + ++ptr; + } + } + + return targetCfg; + } + + // Every test needs access to the service + std::shared_ptr mEnumerator; + // Empty unless/util loadCameraList() is called + std::vector mCameraInfo; + // boolean to tell current module under testing is HW module implementation + // or not + bool mIsHwModule; + // A list of active camera handles that are need to be cleaned up + std::deque> mActiveCameras; + // Empty unless/util loadUltrasonicsArrayList() is called + std::vector mUltrasonicsArraysInfo; + // A list of active ultrasonics array handles that are to be cleaned up + std::deque> mActiveUltrasonicsArrays; +}; + +// Test cases, their implementations, and corresponding requirements are +// documented at go/aae-evs-public-api-test. + +/* + * CameraOpenClean: + * Opens each camera reported by the enumerator and then explicitly closes it via a + * call to closeCamera. Then repeats the test to ensure all cameras can be reopened. + */ +TEST_P(EvsAidlTest, CameraOpenClean) { + LOG(INFO) << "Starting CameraOpenClean test"; + + // Get the camera list + loadCameraList(); + + // Open and close each camera twice + for (auto&& cam : mCameraInfo) { + bool isLogicalCam = false; + auto devices = getPhysicalCameraIds(cam.id, isLogicalCam); + if (mIsHwModule && isLogicalCam) { + LOG(INFO) << "Skip a logical device, " << cam.id << " for HW target."; + continue; + } + + // Read a target resolution from the metadata + Stream targetCfg = getFirstStreamConfiguration( + reinterpret_cast(cam.metadata.data())); + ASSERT_GT(targetCfg.width, 0); + ASSERT_GT(targetCfg.height, 0); + + for (int pass = 0; pass < 2; pass++) { + std::shared_ptr pCam; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam).isOk()); + ASSERT_NE(pCam, nullptr); + + CameraDesc cameraInfo; + for (auto&& devName : devices) { + ASSERT_TRUE(pCam->getPhysicalCameraInfo(devName, &cameraInfo).isOk()); + EXPECT_EQ(devName, cameraInfo.id); + } + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pCam); + + // Verify that this camera self-identifies correctly + ASSERT_TRUE(pCam->getCameraInfo(&cameraInfo).isOk()); + EXPECT_EQ(cam.id, cameraInfo.id); + + // Verify methods for extended info + const auto id = 0xFFFFFFFF; // meaningless id + std::vector values; + auto status = pCam->setExtendedInfo(id, values); + if (isLogicalCam) { + EXPECT_TRUE(!status.isOk() && status.getServiceSpecificError() == + static_cast(EvsResult::NOT_SUPPORTED)); + } else { + EXPECT_TRUE(status.isOk()); + } + + status = pCam->getExtendedInfo(id, &values); + if (isLogicalCam) { + EXPECT_TRUE(!status.isOk() && status.getServiceSpecificError() == + static_cast(EvsResult::NOT_SUPPORTED)); + } else { + EXPECT_TRUE(status.isOk()); + } + + // Explicitly close the camera so resources are released right away + ASSERT_TRUE(mEnumerator->closeCamera(pCam).isOk()); + mActiveCameras.clear(); + } + } +} + +/* + * CameraOpenAggressive: + * Opens each camera reported by the enumerator twice in a row without an intervening closeCamera + * call. This ensures that the intended "aggressive open" behavior works. This is necessary for + * the system to be tolerant of shutdown/restart race conditions. + */ +TEST_P(EvsAidlTest, CameraOpenAggressive) { + LOG(INFO) << "Starting CameraOpenAggressive test"; + + // Get the camera list + loadCameraList(); + + // Open and close each camera twice + for (auto&& cam : mCameraInfo) { + bool isLogicalCam = false; + getPhysicalCameraIds(cam.id, isLogicalCam); + if (mIsHwModule && isLogicalCam) { + LOG(INFO) << "Skip a logical device, " << cam.id << " for HW target."; + continue; + } + + // Read a target resolution from the metadata + Stream targetCfg = getFirstStreamConfiguration( + reinterpret_cast(cam.metadata.data())); + ASSERT_GT(targetCfg.width, 0); + ASSERT_GT(targetCfg.height, 0); + + mActiveCameras.clear(); + std::shared_ptr pCam; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam).isOk()); + EXPECT_NE(pCam, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pCam); + + // Verify that this camera self-identifies correctly + CameraDesc cameraInfo; + ASSERT_TRUE(pCam->getCameraInfo(&cameraInfo).isOk()); + EXPECT_EQ(cam.id, cameraInfo.id); + + std::shared_ptr pCam2; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam2).isOk()); + EXPECT_NE(pCam2, nullptr); + EXPECT_NE(pCam, pCam2); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pCam2); + + auto status = pCam->setMaxFramesInFlight(2); + if (mIsHwModule) { + // Verify that the old camera rejects calls via HW module. + EXPECT_TRUE(!status.isOk() && status.getServiceSpecificError() == + static_cast(EvsResult::OWNERSHIP_LOST)); + } else { + // default implementation supports multiple clients. + EXPECT_TRUE(status.isOk()); + } + + // Close the superseded camera + ASSERT_TRUE(mEnumerator->closeCamera(pCam).isOk()); + mActiveCameras.pop_front(); + + // Verify that the second camera instance self-identifies correctly + ASSERT_TRUE(pCam2->getCameraInfo(&cameraInfo).isOk()); + EXPECT_EQ(cam.id, cameraInfo.id); + + // Close the second camera instance + ASSERT_TRUE(mEnumerator->closeCamera(pCam2).isOk()); + mActiveCameras.pop_front(); + } + + // Sleep here to ensure the destructor cleanup has time to run so we don't break follow on tests + sleep(1); // I hate that this is an arbitrary time to wait. :( b/36122635 +} + +/* + * CameraStreamPerformance: + * Measure and qualify the stream start up time and streaming frame rate of each reported camera + */ +TEST_P(EvsAidlTest, CameraStreamPerformance) { + LOG(INFO) << "Starting CameraStreamPerformance test"; + + // Get the camera list + loadCameraList(); + + // Test each reported camera + for (auto&& cam : mCameraInfo) { + bool isLogicalCam = false; + auto devices = getPhysicalCameraIds(cam.id, isLogicalCam); + if (mIsHwModule && isLogicalCam) { + LOG(INFO) << "Skip a logical device " << cam.id; + continue; + } + + // Read a target resolution from the metadata + Stream targetCfg = getFirstStreamConfiguration( + reinterpret_cast(cam.metadata.data())); + ASSERT_GT(targetCfg.width, 0); + ASSERT_GT(targetCfg.height, 0); + + std::shared_ptr pCam; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam).isOk()); + EXPECT_NE(pCam, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pCam); + + // Set up a frame receiver object which will fire up its own thread + std::shared_ptr frameHandler = + std::make_shared(pCam, cam, nullptr, FrameHandler::eAutoReturn); + EXPECT_NE(frameHandler, nullptr); + + // Start the camera's video stream + nsecs_t start = systemTime(SYSTEM_TIME_MONOTONIC); + ASSERT_TRUE(frameHandler->startStream()); + + // Ensure the first frame arrived within the expected time + frameHandler->waitForFrameCount(1); + nsecs_t firstFrame = systemTime(SYSTEM_TIME_MONOTONIC); + nsecs_t timeToFirstFrame = systemTime(SYSTEM_TIME_MONOTONIC) - start; + + // Extra delays are expected when we attempt to start a video stream on + // the logical camera device. The amount of delay is expected the + // number of physical camera devices multiplied by + // kMaxStreamStartMilliseconds at most. + EXPECT_LE(nanoseconds_to_milliseconds(timeToFirstFrame), + kMaxStreamStartMilliseconds * devices.size()); + printf("%s: Measured time to first frame %0.2f ms\n", cam.id.data(), + timeToFirstFrame * kNanoToMilliseconds); + LOG(INFO) << cam.id << ": Measured time to first frame " << std::scientific + << timeToFirstFrame * kNanoToMilliseconds << " ms."; + + // Check aspect ratio + unsigned width = 0, height = 0; + frameHandler->getFrameDimension(&width, &height); + EXPECT_GE(width, height); + + // Wait a bit, then ensure we get at least the required minimum number of frames + sleep(5); + nsecs_t end = systemTime(SYSTEM_TIME_MONOTONIC); + + // Even when the camera pointer goes out of scope, the FrameHandler object will + // keep the stream alive unless we tell it to shutdown. + // Also note that the FrameHandle and the Camera have a mutual circular reference, so + // we have to break that cycle in order for either of them to get cleaned up. + frameHandler->shutdown(); + + unsigned framesReceived = 0; + frameHandler->getFramesCounters(&framesReceived, nullptr); + framesReceived = framesReceived - 1; // Back out the first frame we already waited for + nsecs_t runTime = end - firstFrame; + float framesPerSecond = framesReceived / (runTime * kNanoToSeconds); + printf("Measured camera rate %3.2f fps\n", framesPerSecond); + LOG(INFO) << "Measured camera rate " << std::scientific << framesPerSecond << " fps."; + EXPECT_GE(framesPerSecond, kMinimumFramesPerSecond); + + // Explicitly release the camera + ASSERT_TRUE(mEnumerator->closeCamera(pCam).isOk()); + mActiveCameras.clear(); + } +} + +/* + * CameraStreamBuffering: + * Ensure the camera implementation behaves properly when the client holds onto buffers for more + * than one frame time. The camera must cleanly skip frames until the client is ready again. + */ +TEST_P(EvsAidlTest, CameraStreamBuffering) { + LOG(INFO) << "Starting CameraStreamBuffering test"; + + // Arbitrary constant (should be > 1 and not too big) + static const unsigned int kBuffersToHold = 6; + + // Get the camera list + loadCameraList(); + + // Test each reported camera + for (auto&& cam : mCameraInfo) { + bool isLogicalCam = false; + getPhysicalCameraIds(cam.id, isLogicalCam); + if (mIsHwModule && isLogicalCam) { + LOG(INFO) << "Skip a logical device " << cam.id << " for HW target."; + continue; + } + + // Read a target resolution from the metadata + Stream targetCfg = getFirstStreamConfiguration( + reinterpret_cast(cam.metadata.data())); + ASSERT_GT(targetCfg.width, 0); + ASSERT_GT(targetCfg.height, 0); + + std::shared_ptr pCam; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam).isOk()); + EXPECT_NE(pCam, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pCam); + + // Ask for a very large number of buffers in flight to ensure it errors correctly + auto badResult = pCam->setMaxFramesInFlight(0xFFFFFFFF); + EXPECT_TRUE(!badResult.isOk() && badResult.getServiceSpecificError() == + static_cast(EvsResult::BUFFER_NOT_AVAILABLE)); + + // Now ask for exactly two buffers in flight as we'll test behavior in that case + ASSERT_TRUE(pCam->setMaxFramesInFlight(kBuffersToHold).isOk()); + + // Set up a frame receiver object which will fire up its own thread. + std::shared_ptr frameHandler = + std::make_shared(pCam, cam, nullptr, FrameHandler::eNoAutoReturn); + EXPECT_NE(frameHandler, nullptr); + + // Start the camera's video stream + ASSERT_TRUE(frameHandler->startStream()); + + // Check that the video stream stalls once we've gotten exactly the number of buffers + // we requested since we told the frameHandler not to return them. + sleep(1); // 1 second should be enough for at least 5 frames to be delivered worst case + unsigned framesReceived = 0; + frameHandler->getFramesCounters(&framesReceived, nullptr); + ASSERT_EQ(kBuffersToHold, framesReceived) << "Stream didn't stall at expected buffer limit"; + + // Give back one buffer + ASSERT_TRUE(frameHandler->returnHeldBuffer()); + + // Once we return a buffer, it shouldn't take more than 1/10 second to get a new one + // filled since we require 10fps minimum -- but give a 10% allowance just in case. + usleep(110 * kMillisecondsToMicroseconds); + frameHandler->getFramesCounters(&framesReceived, nullptr); + EXPECT_EQ(kBuffersToHold + 1, framesReceived) << "Stream should've resumed"; + + // Even when the camera pointer goes out of scope, the FrameHandler object will + // keep the stream alive unless we tell it to shutdown. + // Also note that the FrameHandle and the Camera have a mutual circular reference, so + // we have to break that cycle in order for either of them to get cleaned up. + frameHandler->shutdown(); + + // Explicitly release the camera + ASSERT_TRUE(mEnumerator->closeCamera(pCam).isOk()); + mActiveCameras.clear(); + } +} + +/* + * CameraToDisplayRoundTrip: + * End to end test of data flowing from the camera to the display. Each delivered frame of camera + * imagery is simply copied to the display buffer and presented on screen. This is the one test + * which a human could observe to see the operation of the system on the physical display. + */ +TEST_P(EvsAidlTest, CameraToDisplayRoundTrip) { + LOG(INFO) << "Starting CameraToDisplayRoundTrip test"; + + // Get the camera list + loadCameraList(); + + // Request available display IDs + uint8_t targetDisplayId = 0; + std::vector displayIds; + ASSERT_TRUE(mEnumerator->getDisplayIdList(&displayIds).isOk()); + EXPECT_GT(displayIds.size(), 0); + targetDisplayId = displayIds[0]; + + // Request exclusive access to the first EVS display + std::shared_ptr pDisplay; + ASSERT_TRUE(mEnumerator->openDisplay(targetDisplayId, &pDisplay).isOk()); + EXPECT_NE(pDisplay, nullptr); + LOG(INFO) << "Display " << targetDisplayId << " is in use."; + + // Get the display descriptor + DisplayDesc displayDesc; + ASSERT_TRUE(pDisplay->getDisplayInfo(&displayDesc).isOk()); + LOG(INFO) << " Resolution: " << displayDesc.width << "x" << displayDesc.height; + ASSERT_GT(displayDesc.width, 0); + ASSERT_GT(displayDesc.height, 0); + + // Test each reported camera + for (auto&& cam : mCameraInfo) { + bool isLogicalCam = false; + getPhysicalCameraIds(cam.id, isLogicalCam); + if (mIsHwModule && isLogicalCam) { + LOG(INFO) << "Skip a logical device " << cam.id << " for HW target."; + continue; + } + + // Read a target resolution from the metadata + Stream targetCfg = getFirstStreamConfiguration( + reinterpret_cast(cam.metadata.data())); + ASSERT_GT(targetCfg.width, 0); + ASSERT_GT(targetCfg.height, 0); + + std::shared_ptr pCam; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam).isOk()); + EXPECT_NE(pCam, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pCam); + + // Set up a frame receiver object which will fire up its own thread. + std::shared_ptr frameHandler = + std::make_shared(pCam, cam, pDisplay, FrameHandler::eAutoReturn); + EXPECT_NE(frameHandler, nullptr); + + // Activate the display + ASSERT_TRUE(pDisplay->setDisplayState(DisplayState::VISIBLE_ON_NEXT_FRAME).isOk()); + + // Start the camera's video stream + ASSERT_TRUE(frameHandler->startStream()); + + // Wait a while to let the data flow + static const int kSecondsToWait = 5; + const int streamTimeMs = + kSecondsToWait * kSecondsToMilliseconds - kMaxStreamStartMilliseconds; + const unsigned minimumFramesExpected = + streamTimeMs * kMinimumFramesPerSecond / kSecondsToMilliseconds; + sleep(kSecondsToWait); + unsigned framesReceived = 0; + unsigned framesDisplayed = 0; + frameHandler->getFramesCounters(&framesReceived, &framesDisplayed); + EXPECT_EQ(framesReceived, framesDisplayed); + EXPECT_GE(framesDisplayed, minimumFramesExpected); + + // Turn off the display (yes, before the stream stops -- it should be handled) + ASSERT_TRUE(pDisplay->setDisplayState(DisplayState::NOT_VISIBLE).isOk()); + + // Shut down the streamer + frameHandler->shutdown(); + + // Explicitly release the camera + ASSERT_TRUE(mEnumerator->closeCamera(pCam).isOk()); + mActiveCameras.clear(); + } + + // Explicitly release the display + ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk()); +} + +/* + * MultiCameraStream: + * Verify that each client can start and stop video streams on the same + * underlying camera. + */ +TEST_P(EvsAidlTest, MultiCameraStream) { + LOG(INFO) << "Starting MultiCameraStream test"; + + if (mIsHwModule) { + // This test is not for HW module implementation. + return; + } + + // Get the camera list + loadCameraList(); + + // Test each reported camera + for (auto&& cam : mCameraInfo) { + // Read a target resolution from the metadata + Stream targetCfg = getFirstStreamConfiguration( + reinterpret_cast(cam.metadata.data())); + ASSERT_GT(targetCfg.width, 0); + ASSERT_GT(targetCfg.height, 0); + + // Create two camera clients. + std::shared_ptr pCam0; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam0).isOk()); + EXPECT_NE(pCam0, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pCam0); + + std::shared_ptr pCam1; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam1).isOk()); + EXPECT_NE(pCam1, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pCam1); + + // Set up per-client frame receiver objects which will fire up its own thread + std::shared_ptr frameHandler0 = + std::make_shared(pCam0, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandler1 = + std::make_shared(pCam1, cam, nullptr, FrameHandler::eAutoReturn); + EXPECT_NE(frameHandler0, nullptr); + EXPECT_NE(frameHandler1, nullptr); + + // Start the camera's video stream via client 0 + ASSERT_TRUE(frameHandler0->startStream()); + ASSERT_TRUE(frameHandler1->startStream()); + + // Ensure the stream starts + frameHandler0->waitForFrameCount(1); + frameHandler1->waitForFrameCount(1); + + nsecs_t firstFrame = systemTime(SYSTEM_TIME_MONOTONIC); + + // Wait a bit, then ensure both clients get at least the required minimum number of frames + sleep(5); + nsecs_t end = systemTime(SYSTEM_TIME_MONOTONIC); + unsigned framesReceived0 = 0, framesReceived1 = 0; + frameHandler0->getFramesCounters(&framesReceived0, nullptr); + frameHandler1->getFramesCounters(&framesReceived1, nullptr); + framesReceived0 = framesReceived0 - 1; // Back out the first frame we already waited for + framesReceived1 = framesReceived1 - 1; // Back out the first frame we already waited for + nsecs_t runTime = end - firstFrame; + float framesPerSecond0 = framesReceived0 / (runTime * kNanoToSeconds); + float framesPerSecond1 = framesReceived1 / (runTime * kNanoToSeconds); + LOG(INFO) << "Measured camera rate " << std::scientific << framesPerSecond0 << " fps and " + << framesPerSecond1 << " fps"; + EXPECT_GE(framesPerSecond0, kMinimumFramesPerSecond); + EXPECT_GE(framesPerSecond1, kMinimumFramesPerSecond); + + // Shutdown one client + frameHandler0->shutdown(); + + // Read frame counters again + frameHandler0->getFramesCounters(&framesReceived0, nullptr); + frameHandler1->getFramesCounters(&framesReceived1, nullptr); + + // Wait a bit again + sleep(5); + unsigned framesReceivedAfterStop0 = 0, framesReceivedAfterStop1 = 0; + frameHandler0->getFramesCounters(&framesReceivedAfterStop0, nullptr); + frameHandler1->getFramesCounters(&framesReceivedAfterStop1, nullptr); + EXPECT_EQ(framesReceived0, framesReceivedAfterStop0); + EXPECT_LT(framesReceived1, framesReceivedAfterStop1); + + // Shutdown another + frameHandler1->shutdown(); + + // Explicitly release the camera + ASSERT_TRUE(mEnumerator->closeCamera(pCam0).isOk()); + ASSERT_TRUE(mEnumerator->closeCamera(pCam1).isOk()); + mActiveCameras.clear(); + + // TODO(b/145459970, b/145457727): below sleep() is added to ensure the + // destruction of active camera objects; this may be related with two + // issues. + sleep(1); + } +} + +/* + * CameraParameter: + * Verify that a client can adjust a camera parameter. + */ +TEST_P(EvsAidlTest, CameraParameter) { + LOG(INFO) << "Starting CameraParameter test"; + + // Get the camera list + loadCameraList(); + + // Test each reported camera + for (auto&& cam : mCameraInfo) { + bool isLogicalCam = false; + getPhysicalCameraIds(cam.id, isLogicalCam); + if (isLogicalCam) { + // TODO(b/145465724): Support camera parameter programming on + // logical devices. + LOG(INFO) << "Skip a logical device " << cam.id; + continue; + } + + // Read a target resolution from the metadata + Stream targetCfg = getFirstStreamConfiguration( + reinterpret_cast(cam.metadata.data())); + ASSERT_GT(targetCfg.width, 0); + ASSERT_GT(targetCfg.height, 0); + + // Create a camera client + std::shared_ptr pCam; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam).isOk()); + EXPECT_NE(pCam, nullptr); + + // Store a camera + mActiveCameras.push_back(pCam); + + // Get the parameter list + std::vector cmds; + ASSERT_TRUE(pCam->getParameterList(&cmds).isOk()); + if (cmds.size() < 1) { + continue; + } + + // Set up per-client frame receiver objects which will fire up its own thread + std::shared_ptr frameHandler = + std::make_shared(pCam, cam, nullptr, FrameHandler::eAutoReturn); + EXPECT_NE(frameHandler, nullptr); + + // Start the camera's video stream + ASSERT_TRUE(frameHandler->startStream()); + + // Ensure the stream starts + frameHandler->waitForFrameCount(1); + + // Set current client is the primary client + ASSERT_TRUE(pCam->setPrimaryClient().isOk()); + for (auto& cmd : cmds) { + // Get a valid parameter value range + ParameterRange range; + ASSERT_TRUE(pCam->getIntParameterRange(cmd, &range).isOk()); + + std::vector values; + if (cmd == CameraParam::ABSOLUTE_FOCUS) { + // Try to turn off auto-focus + ASSERT_TRUE(pCam->setIntParameter(CameraParam::AUTO_FOCUS, 0, &values).isOk()); + for (auto&& v : values) { + EXPECT_EQ(v, 0); + } + } + + // Try to program a parameter with a random value [minVal, maxVal] + int32_t val0 = range.min + (std::rand() % (range.max - range.min)); + + // Rounding down + val0 = val0 - (val0 % range.step); + values.clear(); + ASSERT_TRUE(pCam->setIntParameter(cmd, val0, &values).isOk()); + + values.clear(); + ASSERT_TRUE(pCam->getIntParameter(cmd, &values).isOk()); + for (auto&& v : values) { + EXPECT_EQ(val0, v) << "Values are not matched."; + } + } + ASSERT_TRUE(pCam->unsetPrimaryClient().isOk()); + + // Shutdown + frameHandler->shutdown(); + + // Explicitly release the camera + ASSERT_TRUE(mEnumerator->closeCamera(pCam).isOk()); + mActiveCameras.clear(); + } +} + +/* + * CameraPrimaryClientRelease + * Verify that non-primary client gets notified when the primary client either + * terminates or releases a role. + */ +TEST_P(EvsAidlTest, CameraPrimaryClientRelease) { + LOG(INFO) << "Starting CameraPrimaryClientRelease test"; + + if (mIsHwModule) { + // This test is not for HW module implementation. + return; + } + + // Get the camera list + loadCameraList(); + + // Test each reported camera + for (auto&& cam : mCameraInfo) { + bool isLogicalCam = false; + getPhysicalCameraIds(cam.id, isLogicalCam); + if (isLogicalCam) { + // TODO(b/145465724): Support camera parameter programming on + // logical devices. + LOG(INFO) << "Skip a logical device " << cam.id; + continue; + } + + // Read a target resolution from the metadata + Stream targetCfg = getFirstStreamConfiguration( + reinterpret_cast(cam.metadata.data())); + ASSERT_GT(targetCfg.width, 0); + ASSERT_GT(targetCfg.height, 0); + + // Create two camera clients. + std::shared_ptr pPrimaryCam; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pPrimaryCam).isOk()); + EXPECT_NE(pPrimaryCam, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pPrimaryCam); + + std::shared_ptr pSecondaryCam; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pSecondaryCam).isOk()); + EXPECT_NE(pSecondaryCam, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pSecondaryCam); + + // Set up per-client frame receiver objects which will fire up its own thread + std::shared_ptr frameHandlerPrimary = std::make_shared( + pPrimaryCam, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandlerSecondary = std::make_shared( + pSecondaryCam, cam, nullptr, FrameHandler::eAutoReturn); + EXPECT_NE(frameHandlerPrimary, nullptr); + EXPECT_NE(frameHandlerSecondary, nullptr); + + // Set one client as the primary client + ASSERT_TRUE(pPrimaryCam->setPrimaryClient().isOk()); + + // Try to set another client as the primary client. + ASSERT_FALSE(pSecondaryCam->setPrimaryClient().isOk()); + + // Start the camera's video stream via a primary client client. + ASSERT_TRUE(frameHandlerPrimary->startStream()); + + // Ensure the stream starts + frameHandlerPrimary->waitForFrameCount(1); + + // Start the camera's video stream via another client + ASSERT_TRUE(frameHandlerSecondary->startStream()); + + // Ensure the stream starts + frameHandlerSecondary->waitForFrameCount(1); + + // Non-primary client expects to receive a primary client role relesed + // notification. + EvsEventDesc aTargetEvent = {}; + EvsEventDesc aNotification = {}; + + bool listening = false; + std::mutex eventLock; + std::condition_variable eventCond; + std::thread listener = + std::thread([&aNotification, &frameHandlerSecondary, &listening, &eventCond]() { + // Notify that a listening thread is running. + listening = true; + eventCond.notify_all(); + + EvsEventDesc aTargetEvent; + aTargetEvent.aType = EvsEventType::MASTER_RELEASED; + if (!frameHandlerSecondary->waitForEvent(aTargetEvent, aNotification, true)) { + LOG(WARNING) << "A timer is expired before a target event is fired."; + } + }); + + // Wait until a listening thread starts. + std::unique_lock lock(eventLock); + auto timer = std::chrono::system_clock::now(); + while (!listening) { + timer += 1s; + eventCond.wait_until(lock, timer); + } + lock.unlock(); + + // Release a primary client role. + ASSERT_TRUE(pPrimaryCam->unsetPrimaryClient().isOk()); + + // Join a listening thread. + if (listener.joinable()) { + listener.join(); + } + + // Verify change notifications. + ASSERT_EQ(EvsEventType::MASTER_RELEASED, static_cast(aNotification.aType)); + + // Non-primary becomes a primary client. + ASSERT_TRUE(pSecondaryCam->setPrimaryClient().isOk()); + + // Previous primary client fails to become a primary client. + ASSERT_FALSE(pPrimaryCam->setPrimaryClient().isOk()); + + listening = false; + listener = std::thread([&aNotification, &frameHandlerPrimary, &listening, &eventCond]() { + // Notify that a listening thread is running. + listening = true; + eventCond.notify_all(); + + EvsEventDesc aTargetEvent; + aTargetEvent.aType = EvsEventType::MASTER_RELEASED; + if (!frameHandlerPrimary->waitForEvent(aTargetEvent, aNotification, true)) { + LOG(WARNING) << "A timer is expired before a target event is fired."; + } + }); + + // Wait until a listening thread starts. + timer = std::chrono::system_clock::now(); + lock.lock(); + while (!listening) { + eventCond.wait_until(lock, timer + 1s); + } + lock.unlock(); + + // Closing current primary client. + frameHandlerSecondary->shutdown(); + + // Join a listening thread. + if (listener.joinable()) { + listener.join(); + } + + // Verify change notifications. + ASSERT_EQ(EvsEventType::MASTER_RELEASED, static_cast(aNotification.aType)); + + // Closing streams. + frameHandlerPrimary->shutdown(); + + // Explicitly release the camera + ASSERT_TRUE(mEnumerator->closeCamera(pPrimaryCam).isOk()); + ASSERT_TRUE(mEnumerator->closeCamera(pSecondaryCam).isOk()); + mActiveCameras.clear(); + } +} + +/* + * MultiCameraParameter: + * Verify that primary and non-primary clients behave as expected when they try to adjust + * camera parameters. + */ +TEST_P(EvsAidlTest, MultiCameraParameter) { + LOG(INFO) << "Starting MultiCameraParameter test"; + + if (mIsHwModule) { + // This test is not for HW module implementation. + return; + } + + // Get the camera list + loadCameraList(); + + // Test each reported camera + for (auto&& cam : mCameraInfo) { + bool isLogicalCam = false; + getPhysicalCameraIds(cam.id, isLogicalCam); + if (isLogicalCam) { + // TODO(b/145465724): Support camera parameter programming on + // logical devices. + LOG(INFO) << "Skip a logical device " << cam.id; + continue; + } + + // Read a target resolution from the metadata + Stream targetCfg = getFirstStreamConfiguration( + reinterpret_cast(cam.metadata.data())); + ASSERT_GT(targetCfg.width, 0); + ASSERT_GT(targetCfg.height, 0); + + // Create two camera clients. + std::shared_ptr pPrimaryCam; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pPrimaryCam).isOk()); + EXPECT_NE(pPrimaryCam, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pPrimaryCam); + + std::shared_ptr pSecondaryCam; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pSecondaryCam).isOk()); + EXPECT_NE(pSecondaryCam, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pSecondaryCam); + + // Get the parameter list + std::vector camPrimaryCmds, camSecondaryCmds; + ASSERT_TRUE(pPrimaryCam->getParameterList(&camPrimaryCmds).isOk()); + ASSERT_TRUE(pSecondaryCam->getParameterList(&camSecondaryCmds).isOk()); + if (camPrimaryCmds.size() < 1 || camSecondaryCmds.size() < 1) { + // Skip a camera device if it does not support any parameter. + continue; + } + + // Set up per-client frame receiver objects which will fire up its own thread + std::shared_ptr frameHandlerPrimary = std::make_shared( + pPrimaryCam, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandlerSecondary = std::make_shared( + pSecondaryCam, cam, nullptr, FrameHandler::eAutoReturn); + EXPECT_NE(frameHandlerPrimary, nullptr); + EXPECT_NE(frameHandlerSecondary, nullptr); + + // Set one client as the primary client. + ASSERT_TRUE(pPrimaryCam->setPrimaryClient().isOk()); + + // Try to set another client as the primary client. + ASSERT_FALSE(pSecondaryCam->setPrimaryClient().isOk()); + + // Start the camera's video stream via a primary client client. + ASSERT_TRUE(frameHandlerPrimary->startStream()); + + // Ensure the stream starts + frameHandlerPrimary->waitForFrameCount(1); + + // Start the camera's video stream via another client + ASSERT_TRUE(frameHandlerSecondary->startStream()); + + // Ensure the stream starts + frameHandlerSecondary->waitForFrameCount(1); + + int32_t val0 = 0; + std::vector values; + EvsEventDesc aNotification0 = {}; + EvsEventDesc aNotification1 = {}; + for (auto& cmd : camPrimaryCmds) { + // Get a valid parameter value range + ParameterRange range; + ASSERT_TRUE(pPrimaryCam->getIntParameterRange(cmd, &range).isOk()); + if (cmd == CameraParam::ABSOLUTE_FOCUS) { + // Try to turn off auto-focus + values.clear(); + ASSERT_TRUE( + pPrimaryCam->setIntParameter(CameraParam::AUTO_FOCUS, 0, &values).isOk()); + for (auto&& v : values) { + EXPECT_EQ(v, 0); + } + } + + // Calculate a parameter value to program. + val0 = range.min + (std::rand() % (range.max - range.min)); + val0 = val0 - (val0 % range.step); + + // Prepare and start event listeners. + bool listening0 = false; + bool listening1 = false; + std::condition_variable eventCond; + std::thread listener0 = std::thread([cmd, val0, &aNotification0, &frameHandlerPrimary, + &listening0, &listening1, &eventCond]() { + listening0 = true; + if (listening1) { + eventCond.notify_all(); + } + + EvsEventDesc aTargetEvent; + aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; + aTargetEvent.payload[0] = static_cast(cmd); + aTargetEvent.payload[1] = val0; + if (!frameHandlerPrimary->waitForEvent(aTargetEvent, aNotification0)) { + LOG(WARNING) << "A timer is expired before a target event is fired."; + } + }); + std::thread listener1 = std::thread([cmd, val0, &aNotification1, &frameHandlerSecondary, + &listening0, &listening1, &eventCond]() { + listening1 = true; + if (listening0) { + eventCond.notify_all(); + } + + EvsEventDesc aTargetEvent; + aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; + aTargetEvent.payload[0] = static_cast(cmd); + aTargetEvent.payload[1] = val0; + if (!frameHandlerSecondary->waitForEvent(aTargetEvent, aNotification1)) { + LOG(WARNING) << "A timer is expired before a target event is fired."; + } + }); + + // Wait until a listening thread starts. + std::mutex eventLock; + std::unique_lock lock(eventLock); + auto timer = std::chrono::system_clock::now(); + while (!listening0 || !listening1) { + eventCond.wait_until(lock, timer + 1s); + } + lock.unlock(); + + // Try to program a parameter + values.clear(); + ASSERT_TRUE(pPrimaryCam->setIntParameter(cmd, val0, &values).isOk()); + for (auto&& v : values) { + EXPECT_EQ(val0, v) << "Values are not matched."; + } + + // Join a listening thread. + if (listener0.joinable()) { + listener0.join(); + } + if (listener1.joinable()) { + listener1.join(); + } + + // Verify a change notification + ASSERT_EQ(EvsEventType::PARAMETER_CHANGED, + static_cast(aNotification0.aType)); + ASSERT_EQ(EvsEventType::PARAMETER_CHANGED, + static_cast(aNotification1.aType)); + ASSERT_EQ(cmd, static_cast(aNotification0.payload[0])); + ASSERT_EQ(cmd, static_cast(aNotification1.payload[0])); + for (auto&& v : values) { + ASSERT_EQ(v, static_cast(aNotification0.payload[1])); + ASSERT_EQ(v, static_cast(aNotification1.payload[1])); + } + + // Clients expects to receive a parameter change notification + // whenever a primary client client adjusts it. + values.clear(); + ASSERT_TRUE(pPrimaryCam->getIntParameter(cmd, &values).isOk()); + for (auto&& v : values) { + EXPECT_EQ(val0, v) << "Values are not matched."; + } + } + + // Try to adjust a parameter via non-primary client + values.clear(); + ASSERT_FALSE(pSecondaryCam->setIntParameter(camSecondaryCmds[0], val0, &values).isOk()); + + // Non-primary client attempts to be a primary client + ASSERT_FALSE(pSecondaryCam->setPrimaryClient().isOk()); + + // Primary client retires from a primary client role + bool listening = false; + std::condition_variable eventCond; + std::thread listener = + std::thread([&aNotification0, &frameHandlerSecondary, &listening, &eventCond]() { + listening = true; + eventCond.notify_all(); + + EvsEventDesc aTargetEvent; + aTargetEvent.aType = EvsEventType::MASTER_RELEASED; + if (!frameHandlerSecondary->waitForEvent(aTargetEvent, aNotification0, true)) { + LOG(WARNING) << "A timer is expired before a target event is fired."; + } + }); + + std::mutex eventLock; + auto timer = std::chrono::system_clock::now(); + std::unique_lock lock(eventLock); + while (!listening) { + eventCond.wait_until(lock, timer + 1s); + } + lock.unlock(); + + ASSERT_TRUE(pPrimaryCam->unsetPrimaryClient().isOk()); + + if (listener.joinable()) { + listener.join(); + } + ASSERT_EQ(EvsEventType::MASTER_RELEASED, static_cast(aNotification0.aType)); + + // Try to adjust a parameter after being retired + values.clear(); + ASSERT_FALSE(pPrimaryCam->setIntParameter(camPrimaryCmds[0], val0, &values).isOk()); + + // Non-primary client becomes a primary client + ASSERT_TRUE(pSecondaryCam->setPrimaryClient().isOk()); + + // Try to adjust a parameter via new primary client + for (auto& cmd : camSecondaryCmds) { + // Get a valid parameter value range + ParameterRange range; + ASSERT_TRUE(pSecondaryCam->getIntParameterRange(cmd, &range).isOk()); + + values.clear(); + if (cmd == CameraParam::ABSOLUTE_FOCUS) { + // Try to turn off auto-focus + values.clear(); + ASSERT_TRUE( + pSecondaryCam->setIntParameter(CameraParam::AUTO_FOCUS, 0, &values).isOk()); + for (auto&& v : values) { + EXPECT_EQ(v, 0); + } + } + + // Calculate a parameter value to program. This is being rounding down. + val0 = range.min + (std::rand() % (range.max - range.min)); + val0 = val0 - (val0 % range.step); + + // Prepare and start event listeners. + bool listening0 = false; + bool listening1 = false; + std::condition_variable eventCond; + std::thread listener0 = std::thread([&]() { + listening0 = true; + if (listening1) { + eventCond.notify_all(); + } + + EvsEventDesc aTargetEvent; + aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; + aTargetEvent.payload[0] = static_cast(cmd); + aTargetEvent.payload[1] = val0; + if (!frameHandlerPrimary->waitForEvent(aTargetEvent, aNotification0)) { + LOG(WARNING) << "A timer is expired before a target event is fired."; + } + }); + std::thread listener1 = std::thread([&]() { + listening1 = true; + if (listening0) { + eventCond.notify_all(); + } + + EvsEventDesc aTargetEvent; + aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; + aTargetEvent.payload[0] = static_cast(cmd); + aTargetEvent.payload[1] = val0; + if (!frameHandlerSecondary->waitForEvent(aTargetEvent, aNotification1)) { + LOG(WARNING) << "A timer is expired before a target event is fired."; + } + }); + + // Wait until a listening thread starts. + std::mutex eventLock; + std::unique_lock lock(eventLock); + auto timer = std::chrono::system_clock::now(); + while (!listening0 || !listening1) { + eventCond.wait_until(lock, timer + 1s); + } + lock.unlock(); + + // Try to program a parameter + values.clear(); + ASSERT_TRUE(pSecondaryCam->setIntParameter(cmd, val0, &values).isOk()); + + // Clients expects to receive a parameter change notification + // whenever a primary client client adjusts it. + values.clear(); + ASSERT_TRUE(pSecondaryCam->getIntParameter(cmd, &values).isOk()); + for (auto&& v : values) { + EXPECT_EQ(val0, v) << "Values are not matched."; + } + + // Join a listening thread. + if (listener0.joinable()) { + listener0.join(); + } + if (listener1.joinable()) { + listener1.join(); + } + + // Verify a change notification + ASSERT_EQ(EvsEventType::PARAMETER_CHANGED, + static_cast(aNotification0.aType)); + ASSERT_EQ(EvsEventType::PARAMETER_CHANGED, + static_cast(aNotification1.aType)); + ASSERT_EQ(cmd, static_cast(aNotification0.payload[0])); + ASSERT_EQ(cmd, static_cast(aNotification1.payload[0])); + for (auto&& v : values) { + ASSERT_EQ(v, static_cast(aNotification0.payload[1])); + ASSERT_EQ(v, static_cast(aNotification1.payload[1])); + } + } + + // New primary client retires from the role + ASSERT_TRUE(pSecondaryCam->unsetPrimaryClient().isOk()); + + // Shutdown + frameHandlerPrimary->shutdown(); + frameHandlerSecondary->shutdown(); + + // Explicitly release the camera + ASSERT_TRUE(mEnumerator->closeCamera(pPrimaryCam).isOk()); + ASSERT_TRUE(mEnumerator->closeCamera(pSecondaryCam).isOk()); + mActiveCameras.clear(); + } +} + +/* + * HighPriorityCameraClient: + * EVS client, which owns the display, is priortized and therefore can take over + * a primary client role from other EVS clients without the display. + */ +TEST_P(EvsAidlTest, HighPriorityCameraClient) { + LOG(INFO) << "Starting HighPriorityCameraClient test"; + + if (mIsHwModule) { + // This test is not for HW module implementation. + return; + } + + // Get the camera list + loadCameraList(); + + // Request available display IDs + uint8_t targetDisplayId = 0; + std::vector displayIds; + ASSERT_TRUE(mEnumerator->getDisplayIdList(&displayIds).isOk()); + EXPECT_GT(displayIds.size(), 0); + targetDisplayId = displayIds[0]; + + // Request exclusive access to the EVS display + std::shared_ptr pDisplay; + ASSERT_TRUE(mEnumerator->openDisplay(targetDisplayId, &pDisplay).isOk()); + EXPECT_NE(pDisplay, nullptr); + + // Test each reported camera + for (auto&& cam : mCameraInfo) { + // Read a target resolution from the metadata + Stream targetCfg = getFirstStreamConfiguration( + reinterpret_cast(cam.metadata.data())); + ASSERT_GT(targetCfg.width, 0); + ASSERT_GT(targetCfg.height, 0); + + // Create two clients + std::shared_ptr pCam0; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam0).isOk()); + EXPECT_NE(pCam0, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pCam0); + + std::shared_ptr pCam1; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam1).isOk()); + EXPECT_NE(pCam1, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pCam1); + + // Get the parameter list; this test will use the first command in both + // lists. + std::vector cam0Cmds, cam1Cmds; + ASSERT_TRUE(pCam0->getParameterList(&cam0Cmds).isOk()); + ASSERT_TRUE(pCam1->getParameterList(&cam1Cmds).isOk()); + if (cam0Cmds.size() < 1 || cam1Cmds.size() < 1) { + // Cannot execute this test. + return; + } + + // Set up a frame receiver object which will fire up its own thread. + std::shared_ptr frameHandler0 = + std::make_shared(pCam0, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandler1 = + std::make_shared(pCam1, cam, nullptr, FrameHandler::eAutoReturn); + EXPECT_NE(frameHandler0, nullptr); + EXPECT_NE(frameHandler1, nullptr); + + // Activate the display + ASSERT_TRUE(pDisplay->setDisplayState(DisplayState::VISIBLE_ON_NEXT_FRAME).isOk()); + + // Start the camera's video stream + ASSERT_TRUE(frameHandler0->startStream()); + ASSERT_TRUE(frameHandler1->startStream()); + + // Ensure the stream starts + frameHandler0->waitForFrameCount(1); + frameHandler1->waitForFrameCount(1); + + // Client 1 becomes a primary client and programs a parameter. + + // Get a valid parameter value range + ParameterRange range; + ASSERT_TRUE(pCam1->getIntParameterRange(cam1Cmds[0], &range).isOk()); + + // Client1 becomes a primary client + ASSERT_TRUE(pCam1->setPrimaryClient().isOk()); + + std::vector values; + EvsEventDesc aTargetEvent = {}; + EvsEventDesc aNotification = {}; + bool listening = false; + std::mutex eventLock; + std::condition_variable eventCond; + if (cam1Cmds[0] == CameraParam::ABSOLUTE_FOCUS) { + std::thread listener = + std::thread([&frameHandler0, &aNotification, &listening, &eventCond] { + listening = true; + eventCond.notify_all(); + + EvsEventDesc aTargetEvent; + aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; + aTargetEvent.payload[0] = static_cast(CameraParam::AUTO_FOCUS); + aTargetEvent.payload[1] = 0; + if (!frameHandler0->waitForEvent(aTargetEvent, aNotification)) { + LOG(WARNING) << "A timer is expired before a target event is fired."; + } + }); + + // Wait until a lister starts. + std::unique_lock lock(eventLock); + auto timer = std::chrono::system_clock::now(); + while (!listening) { + eventCond.wait_until(lock, timer + 1s); + } + lock.unlock(); + + // Try to turn off auto-focus + ASSERT_TRUE(pCam1->setIntParameter(CameraParam::AUTO_FOCUS, 0, &values).isOk()); + for (auto&& v : values) { + EXPECT_EQ(v, 0); + } + + // Join a listener + if (listener.joinable()) { + listener.join(); + } + + // Make sure AUTO_FOCUS is off. + ASSERT_EQ(static_cast(aNotification.aType), + EvsEventType::PARAMETER_CHANGED); + } + + // Try to program a parameter with a random value [minVal, maxVal] after + // rounding it down. + int32_t val0 = range.min + (std::rand() % (range.max - range.min)); + val0 = val0 - (val0 % range.step); + + std::thread listener = std::thread( + [&frameHandler1, &aNotification, &listening, &eventCond, &cam1Cmds, val0] { + listening = true; + eventCond.notify_all(); + + EvsEventDesc aTargetEvent; + aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; + aTargetEvent.payload[0] = static_cast(cam1Cmds[0]); + aTargetEvent.payload[1] = val0; + if (!frameHandler1->waitForEvent(aTargetEvent, aNotification)) { + LOG(WARNING) << "A timer is expired before a target event is fired."; + } + }); + + // Wait until a lister starts. + listening = false; + std::unique_lock lock(eventLock); + auto timer = std::chrono::system_clock::now(); + while (!listening) { + eventCond.wait_until(lock, timer + 1s); + } + lock.unlock(); + + values.clear(); + ASSERT_TRUE(pCam1->setIntParameter(cam1Cmds[0], val0, &values).isOk()); + for (auto&& v : values) { + EXPECT_EQ(val0, v); + } + + // Join a listener + if (listener.joinable()) { + listener.join(); + } + + // Verify a change notification + ASSERT_EQ(static_cast(aNotification.aType), EvsEventType::PARAMETER_CHANGED); + ASSERT_EQ(static_cast(aNotification.payload[0]), cam1Cmds[0]); + for (auto&& v : values) { + ASSERT_EQ(v, static_cast(aNotification.payload[1])); + } + + listener = std::thread([&frameHandler1, &aNotification, &listening, &eventCond] { + listening = true; + eventCond.notify_all(); + + EvsEventDesc aTargetEvent; + aTargetEvent.aType = EvsEventType::MASTER_RELEASED; + if (!frameHandler1->waitForEvent(aTargetEvent, aNotification, true)) { + LOG(WARNING) << "A timer is expired before a target event is fired."; + } + }); + + // Wait until a lister starts. + listening = false; + lock.lock(); + timer = std::chrono::system_clock::now(); + while (!listening) { + eventCond.wait_until(lock, timer + 1s); + } + lock.unlock(); + + // Client 0 steals a primary client role + ASSERT_TRUE(pCam0->forcePrimaryClient(pDisplay).isOk()); + + // Join a listener + if (listener.joinable()) { + listener.join(); + } + + ASSERT_EQ(static_cast(aNotification.aType), EvsEventType::MASTER_RELEASED); + + // Client 0 programs a parameter + val0 = range.min + (std::rand() % (range.max - range.min)); + + // Rounding down + val0 = val0 - (val0 % range.step); + + if (cam0Cmds[0] == CameraParam::ABSOLUTE_FOCUS) { + std::thread listener = + std::thread([&frameHandler1, &aNotification, &listening, &eventCond] { + listening = true; + eventCond.notify_all(); + + EvsEventDesc aTargetEvent; + aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; + aTargetEvent.payload[0] = static_cast(CameraParam::AUTO_FOCUS); + aTargetEvent.payload[1] = 0; + if (!frameHandler1->waitForEvent(aTargetEvent, aNotification)) { + LOG(WARNING) << "A timer is expired before a target event is fired."; + } + }); + + // Wait until a lister starts. + std::unique_lock lock(eventLock); + auto timer = std::chrono::system_clock::now(); + while (!listening) { + eventCond.wait_until(lock, timer + 1s); + } + lock.unlock(); + + // Try to turn off auto-focus + values.clear(); + ASSERT_TRUE(pCam0->setIntParameter(CameraParam::AUTO_FOCUS, 0, &values).isOk()); + for (auto&& v : values) { + EXPECT_EQ(v, 0); + } + + // Join a listener + if (listener.joinable()) { + listener.join(); + } + + // Make sure AUTO_FOCUS is off. + ASSERT_EQ(static_cast(aNotification.aType), + EvsEventType::PARAMETER_CHANGED); + } + + listener = std::thread( + [&frameHandler0, &aNotification, &listening, &eventCond, &cam0Cmds, val0] { + listening = true; + eventCond.notify_all(); + + EvsEventDesc aTargetEvent; + aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; + aTargetEvent.payload[0] = static_cast(cam0Cmds[0]); + aTargetEvent.payload[1] = val0; + if (!frameHandler0->waitForEvent(aTargetEvent, aNotification)) { + LOG(WARNING) << "A timer is expired before a target event is fired."; + } + }); + + // Wait until a lister starts. + listening = false; + timer = std::chrono::system_clock::now(); + lock.lock(); + while (!listening) { + eventCond.wait_until(lock, timer + 1s); + } + lock.unlock(); + + values.clear(); + ASSERT_TRUE(pCam0->setIntParameter(cam0Cmds[0], val0, &values).isOk()); + + // Join a listener + if (listener.joinable()) { + listener.join(); + } + // Verify a change notification + ASSERT_EQ(static_cast(aNotification.aType), EvsEventType::PARAMETER_CHANGED); + ASSERT_EQ(static_cast(aNotification.payload[0]), cam0Cmds[0]); + for (auto&& v : values) { + ASSERT_EQ(v, static_cast(aNotification.payload[1])); + } + + // Turn off the display (yes, before the stream stops -- it should be handled) + ASSERT_TRUE(pDisplay->setDisplayState(DisplayState::NOT_VISIBLE).isOk()); + + // Shut down the streamer + frameHandler0->shutdown(); + frameHandler1->shutdown(); + + // Explicitly release the camera + ASSERT_TRUE(mEnumerator->closeCamera(pCam0).isOk()); + ASSERT_TRUE(mEnumerator->closeCamera(pCam1).isOk()); + mActiveCameras.clear(); + } + + // Explicitly release the display + ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk()); +} + +/* + * CameraUseStreamConfigToDisplay: + * End to end test of data flowing from the camera to the display. Similar to + * CameraToDisplayRoundTrip test case but this case retrieves available stream + * configurations from EVS and uses one of them to start a video stream. + */ +TEST_P(EvsAidlTest, CameraUseStreamConfigToDisplay) { + LOG(INFO) << "Starting CameraUseStreamConfigToDisplay test"; + + // Get the camera list + loadCameraList(); + + // Request available display IDs + uint8_t targetDisplayId = 0; + std::vector displayIds; + ASSERT_TRUE(mEnumerator->getDisplayIdList(&displayIds).isOk()); + EXPECT_GT(displayIds.size(), 0); + targetDisplayId = displayIds[0]; + + // Request exclusive access to the EVS display + std::shared_ptr pDisplay; + ASSERT_TRUE(mEnumerator->openDisplay(targetDisplayId, &pDisplay).isOk()); + EXPECT_NE(pDisplay, nullptr); + + // Test each reported camera + for (auto&& cam : mCameraInfo) { + // choose a configuration that has a frame rate faster than minReqFps. + Stream targetCfg = {}; + const int32_t minReqFps = 15; + int32_t maxArea = 0; + camera_metadata_entry_t streamCfgs; + bool foundCfg = false; + if (!find_camera_metadata_entry(reinterpret_cast(cam.metadata.data()), + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, + &streamCfgs)) { + // Stream configurations are found in metadata + RawStreamConfig* ptr = reinterpret_cast(streamCfgs.data.i32); + for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) { + if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT && + ptr->format == HAL_PIXEL_FORMAT_RGBA_8888) { + if (ptr->width * ptr->height > maxArea && ptr->framerate >= minReqFps) { + targetCfg.width = ptr->width; + targetCfg.height = ptr->height; + + maxArea = ptr->width * ptr->height; + foundCfg = true; + } + } + ++ptr; + } + } + targetCfg.format = static_cast(HAL_PIXEL_FORMAT_RGBA_8888); + + if (!foundCfg) { + // Current EVS camera does not provide stream configurations in the + // metadata. + continue; + } + + std::shared_ptr pCam; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam).isOk()); + EXPECT_NE(pCam, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pCam); + + // Set up a frame receiver object which will fire up its own thread. + std::shared_ptr frameHandler = + std::make_shared(pCam, cam, pDisplay, FrameHandler::eAutoReturn); + EXPECT_NE(frameHandler, nullptr); + + // Activate the display + ASSERT_TRUE(pDisplay->setDisplayState(DisplayState::VISIBLE_ON_NEXT_FRAME).isOk()); + + // Start the camera's video stream + ASSERT_TRUE(frameHandler->startStream()); + + // Wait a while to let the data flow + static const int kSecondsToWait = 5; + const int streamTimeMs = + kSecondsToWait * kSecondsToMilliseconds - kMaxStreamStartMilliseconds; + const unsigned minimumFramesExpected = + streamTimeMs * kMinimumFramesPerSecond / kSecondsToMilliseconds; + sleep(kSecondsToWait); + unsigned framesReceived = 0; + unsigned framesDisplayed = 0; + frameHandler->getFramesCounters(&framesReceived, &framesDisplayed); + EXPECT_EQ(framesReceived, framesDisplayed); + EXPECT_GE(framesDisplayed, minimumFramesExpected); + + // Turn off the display (yes, before the stream stops -- it should be handled) + ASSERT_TRUE(pDisplay->setDisplayState(DisplayState::NOT_VISIBLE).isOk()); + + // Shut down the streamer + frameHandler->shutdown(); + + // Explicitly release the camera + ASSERT_TRUE(mEnumerator->closeCamera(pCam).isOk()); + mActiveCameras.clear(); + } + + // Explicitly release the display + ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk()); +} + +/* + * MultiCameraStreamUseConfig: + * Verify that each client can start and stop video streams on the same + * underlying camera with same configuration. + */ +TEST_P(EvsAidlTest, MultiCameraStreamUseConfig) { + LOG(INFO) << "Starting MultiCameraStream test"; + + if (mIsHwModule) { + // This test is not for HW module implementation. + return; + } + + // Get the camera list + loadCameraList(); + + // Test each reported camera + for (auto&& cam : mCameraInfo) { + // choose a configuration that has a frame rate faster than minReqFps. + Stream targetCfg = {}; + const int32_t minReqFps = 15; + int32_t maxArea = 0; + camera_metadata_entry_t streamCfgs; + bool foundCfg = false; + if (!find_camera_metadata_entry(reinterpret_cast(cam.metadata.data()), + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, + &streamCfgs)) { + // Stream configurations are found in metadata + RawStreamConfig* ptr = reinterpret_cast(streamCfgs.data.i32); + for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) { + if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT && + ptr->format == HAL_PIXEL_FORMAT_RGBA_8888) { + if (ptr->width * ptr->height > maxArea && ptr->framerate >= minReqFps) { + targetCfg.width = ptr->width; + targetCfg.height = ptr->height; + + maxArea = ptr->width * ptr->height; + foundCfg = true; + } + } + ++ptr; + } + } + targetCfg.format = static_cast(HAL_PIXEL_FORMAT_RGBA_8888); + + if (!foundCfg) { + LOG(INFO) << "Device " << cam.id + << " does not provide a list of supported stream configurations, skipped"; + continue; + } + + // Create the first camera client with a selected stream configuration. + std::shared_ptr pCam0; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam0).isOk()); + EXPECT_NE(pCam0, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pCam0); + + // Try to create the second camera client with different stream + // configuration. + int32_t id = targetCfg.id; + targetCfg.id += 1; // EVS manager sees only the stream id. + std::shared_ptr pCam1; + ASSERT_FALSE(mEnumerator->openCamera(cam.id, targetCfg, &pCam1).isOk()); + + // Try again with same stream configuration. + targetCfg.id = id; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam1).isOk()); + EXPECT_NE(pCam1, nullptr); + + // Set up per-client frame receiver objects which will fire up its own thread + std::shared_ptr frameHandler0 = + std::make_shared(pCam0, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandler1 = + std::make_shared(pCam1, cam, nullptr, FrameHandler::eAutoReturn); + EXPECT_NE(frameHandler0, nullptr); + EXPECT_NE(frameHandler1, nullptr); + + // Start the camera's video stream via client 0 + ASSERT_TRUE(frameHandler0->startStream()); + ASSERT_TRUE(frameHandler1->startStream()); + + // Ensure the stream starts + frameHandler0->waitForFrameCount(1); + frameHandler1->waitForFrameCount(1); + + nsecs_t firstFrame = systemTime(SYSTEM_TIME_MONOTONIC); + + // Wait a bit, then ensure both clients get at least the required minimum number of frames + sleep(5); + nsecs_t end = systemTime(SYSTEM_TIME_MONOTONIC); + unsigned framesReceived0 = 0, framesReceived1 = 0; + frameHandler0->getFramesCounters(&framesReceived0, nullptr); + frameHandler1->getFramesCounters(&framesReceived1, nullptr); + framesReceived0 = framesReceived0 - 1; // Back out the first frame we already waited for + framesReceived1 = framesReceived1 - 1; // Back out the first frame we already waited for + nsecs_t runTime = end - firstFrame; + float framesPerSecond0 = framesReceived0 / (runTime * kNanoToSeconds); + float framesPerSecond1 = framesReceived1 / (runTime * kNanoToSeconds); + LOG(INFO) << "Measured camera rate " << std::scientific << framesPerSecond0 << " fps and " + << framesPerSecond1 << " fps"; + EXPECT_GE(framesPerSecond0, kMinimumFramesPerSecond); + EXPECT_GE(framesPerSecond1, kMinimumFramesPerSecond); + + // Shutdown one client + frameHandler0->shutdown(); + + // Read frame counters again + frameHandler0->getFramesCounters(&framesReceived0, nullptr); + frameHandler1->getFramesCounters(&framesReceived1, nullptr); + + // Wait a bit again + sleep(5); + unsigned framesReceivedAfterStop0 = 0, framesReceivedAfterStop1 = 0; + frameHandler0->getFramesCounters(&framesReceivedAfterStop0, nullptr); + frameHandler1->getFramesCounters(&framesReceivedAfterStop1, nullptr); + EXPECT_EQ(framesReceived0, framesReceivedAfterStop0); + EXPECT_LT(framesReceived1, framesReceivedAfterStop1); + + // Shutdown another + frameHandler1->shutdown(); + + // Explicitly release the camera + ASSERT_TRUE(mEnumerator->closeCamera(pCam0).isOk()); + ASSERT_TRUE(mEnumerator->closeCamera(pCam1).isOk()); + mActiveCameras.clear(); + } +} + +/* + * LogicalCameraMetadata: + * Opens logical camera reported by the enumerator and validate its metadata by + * checking its capability and locating supporting physical camera device + * identifiers. + */ +TEST_P(EvsAidlTest, LogicalCameraMetadata) { + LOG(INFO) << "Starting LogicalCameraMetadata test"; + + // Get the camera list + loadCameraList(); + + // Open and close each camera twice + for (auto&& cam : mCameraInfo) { + bool isLogicalCam = false; + auto devices = getPhysicalCameraIds(cam.id, isLogicalCam); + if (isLogicalCam) { + ASSERT_GE(devices.size(), 1) << "Logical camera device must have at least one physical " + "camera device ID in its metadata."; + } + } +} + +/* + * CameraStreamExternalBuffering: + * This is same with CameraStreamBuffering except frame buffers are allocated by + * the test client and then imported by EVS framework. + */ +TEST_P(EvsAidlTest, CameraStreamExternalBuffering) { + LOG(INFO) << "Starting CameraStreamExternalBuffering test"; + + // Arbitrary constant (should be > 1 and not too big) + static const unsigned int kBuffersToHold = 3; + + // Get the camera list + loadCameraList(); + + // Acquire the graphics buffer allocator + android::GraphicBufferAllocator& alloc(android::GraphicBufferAllocator::get()); + const auto usage = + GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_SW_READ_RARELY | GRALLOC_USAGE_SW_WRITE_OFTEN; + + // Test each reported camera + for (auto&& cam : mCameraInfo) { + // Read a target resolution from the metadata + Stream targetCfg = getFirstStreamConfiguration( + reinterpret_cast(cam.metadata.data())); + ASSERT_GT(targetCfg.width, 0); + ASSERT_GT(targetCfg.height, 0); + + // Allocate buffers to use + std::vector buffers; + buffers.resize(kBuffersToHold); + for (auto i = 0; i < kBuffersToHold; ++i) { + unsigned pixelsPerLine; + buffer_handle_t memHandle = nullptr; + android::status_t result = + alloc.allocate(targetCfg.width, targetCfg.height, + static_cast(targetCfg.format), + /* layerCount = */ 1, usage, &memHandle, &pixelsPerLine, + /* graphicBufferId = */ 0, + /* requestorName = */ "CameraStreamExternalBufferingTest"); + if (result != android::NO_ERROR) { + LOG(ERROR) << __FUNCTION__ << " failed to allocate memory."; + // Release previous allocated buffers + for (auto j = 0; j < i; j++) { + alloc.free(::android::dupFromAidl(buffers[i].buffer.handle)); + } + return; + } else { + BufferDesc buf; + HardwareBufferDescription* pDesc = + reinterpret_cast(&buf.buffer.description); + pDesc->width = targetCfg.width; + pDesc->height = targetCfg.height; + pDesc->layers = 1; + pDesc->format = targetCfg.format; + pDesc->usage = static_cast(usage); + pDesc->stride = pixelsPerLine; + buf.buffer.handle = ::android::dupToAidl(memHandle); + buf.bufferId = i; // Unique number to identify this buffer + buffers[i] = std::move(buf); + } + } + + bool isLogicalCam = false; + getPhysicalCameraIds(cam.id, isLogicalCam); + + std::shared_ptr pCam; + ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam).isOk()); + EXPECT_NE(pCam, nullptr); + + // Store a camera handle for a clean-up + mActiveCameras.push_back(pCam); + + // Request to import buffers + int delta = 0; + auto status = pCam->importExternalBuffers(buffers, &delta); + if (isLogicalCam) { + ASSERT_FALSE(status.isOk()); + continue; + } + + ASSERT_TRUE(status.isOk()); + EXPECT_GE(delta, kBuffersToHold); + + // Set up a frame receiver object which will fire up its own thread. + std::shared_ptr frameHandler = + std::make_shared(pCam, cam, nullptr, FrameHandler::eNoAutoReturn); + EXPECT_NE(frameHandler, nullptr); + + // Start the camera's video stream + ASSERT_TRUE(frameHandler->startStream()); + + // Check that the video stream stalls once we've gotten exactly the number of buffers + // we requested since we told the frameHandler not to return them. + sleep(1); // 1 second should be enough for at least 5 frames to be delivered worst case + unsigned framesReceived = 0; + frameHandler->getFramesCounters(&framesReceived, nullptr); + ASSERT_LE(kBuffersToHold, framesReceived) << "Stream didn't stall at expected buffer limit"; + + // Give back one buffer + EXPECT_TRUE(frameHandler->returnHeldBuffer()); + + // Once we return a buffer, it shouldn't take more than 1/10 second to get a new one + // filled since we require 10fps minimum -- but give a 10% allowance just in case. + unsigned framesReceivedAfter = 0; + usleep(110 * kMillisecondsToMicroseconds); + frameHandler->getFramesCounters(&framesReceivedAfter, nullptr); + EXPECT_EQ(framesReceived + 1, framesReceivedAfter) << "Stream should've resumed"; + + // Even when the camera pointer goes out of scope, the FrameHandler object will + // keep the stream alive unless we tell it to shutdown. + // Also note that the FrameHandle and the Camera have a mutual circular reference, so + // we have to break that cycle in order for either of them to get cleaned up. + frameHandler->shutdown(); + + // Explicitly release the camera + ASSERT_TRUE(mEnumerator->closeCamera(pCam).isOk()); + mActiveCameras.clear(); + // Release buffers + for (auto& b : buffers) { + alloc.free(::android::dupFromAidl(b.buffer.handle)); + } + buffers.resize(0); + } +} + +/* + * UltrasonicsArrayOpenClean: + * Opens each ultrasonics arrays reported by the enumerator and then explicitly closes it via a + * call to closeUltrasonicsArray. Then repeats the test to ensure all ultrasonics arrays + * can be reopened. + */ +TEST_P(EvsAidlTest, UltrasonicsArrayOpenClean) { + LOG(INFO) << "Starting UltrasonicsArrayOpenClean test"; + + // Get the ultrasonics array list + loadUltrasonicsArrayList(); + + // Open and close each ultrasonics array twice + for (auto&& ultraInfo : mUltrasonicsArraysInfo) { + for (int pass = 0; pass < 2; pass++) { + std::shared_ptr pUltrasonicsArray; + ASSERT_TRUE( + mEnumerator + ->openUltrasonicsArray(ultraInfo.ultrasonicsArrayId, &pUltrasonicsArray) + .isOk()); + EXPECT_NE(pUltrasonicsArray, nullptr); + + // Verify that this ultrasonics array self-identifies correctly + UltrasonicsArrayDesc desc; + ASSERT_TRUE(pUltrasonicsArray->getUltrasonicArrayInfo(&desc).isOk()); + EXPECT_EQ(ultraInfo.ultrasonicsArrayId, desc.ultrasonicsArrayId); + LOG(DEBUG) << "Found ultrasonics array " << ultraInfo.ultrasonicsArrayId; + + // Explicitly close the ultrasonics array so resources are released right away + ASSERT_TRUE(mEnumerator->closeUltrasonicsArray(pUltrasonicsArray).isOk()); + } + } +} + +// Starts a stream and verifies all data received is valid. +TEST_P(EvsAidlTest, UltrasonicsVerifyStreamData) { + LOG(INFO) << "Starting UltrasonicsVerifyStreamData"; + + // Get the ultrasonics array list + loadUltrasonicsArrayList(); + + // For each ultrasonics array. + for (auto&& ultraInfo : mUltrasonicsArraysInfo) { + LOG(DEBUG) << "Testing ultrasonics array: " << ultraInfo.ultrasonicsArrayId; + + std::shared_ptr pUltrasonicsArray; + ASSERT_TRUE( + mEnumerator->openUltrasonicsArray(ultraInfo.ultrasonicsArrayId, &pUltrasonicsArray) + .isOk()); + EXPECT_NE(pUltrasonicsArray, nullptr); + + std::shared_ptr frameHandler = + std::make_shared(pUltrasonicsArray); + EXPECT_NE(frameHandler, nullptr); + + // Start stream. + ASSERT_TRUE(pUltrasonicsArray->startStream(frameHandler).isOk()); + + // Wait 5 seconds to receive frames. + sleep(5); + + // Stop stream. + ASSERT_TRUE(pUltrasonicsArray->stopStream().isOk()); + + EXPECT_GT(frameHandler->getReceiveFramesCount(), 0); + EXPECT_TRUE(frameHandler->areAllFramesValid()); + + // Explicitly close the ultrasonics array so resources are released right away + ASSERT_TRUE(mEnumerator->closeUltrasonicsArray(pUltrasonicsArray).isOk()); + } +} + +// Sets frames in flight before and after start of stream and verfies success. +TEST_P(EvsAidlTest, UltrasonicsSetFramesInFlight) { + LOG(INFO) << "Starting UltrasonicsSetFramesInFlight"; + + // Get the ultrasonics array list + loadUltrasonicsArrayList(); + + // For each ultrasonics array. + for (auto&& ultraInfo : mUltrasonicsArraysInfo) { + LOG(DEBUG) << "Testing ultrasonics array: " << ultraInfo.ultrasonicsArrayId; + + std::shared_ptr pUltrasonicsArray; + ASSERT_TRUE( + mEnumerator->openUltrasonicsArray(ultraInfo.ultrasonicsArrayId, &pUltrasonicsArray) + .isOk()); + EXPECT_NE(pUltrasonicsArray, nullptr); + + ASSERT_TRUE(pUltrasonicsArray->setMaxFramesInFlight(10).isOk()); + + std::shared_ptr frameHandler = + std::make_shared(pUltrasonicsArray); + EXPECT_NE(frameHandler, nullptr); + + // Start stream. + ASSERT_TRUE(pUltrasonicsArray->startStream(frameHandler).isOk()); + ASSERT_TRUE(pUltrasonicsArray->setMaxFramesInFlight(5).isOk()); + + // Stop stream. + ASSERT_TRUE(pUltrasonicsArray->stopStream().isOk()); + + // Explicitly close the ultrasonics array so resources are released right away + ASSERT_TRUE(mEnumerator->closeUltrasonicsArray(pUltrasonicsArray).isOk()); + } +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(EvsAidlTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, EvsAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IEvsEnumerator::descriptor)), + android::PrintInstanceNameToString); + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + ABinderProcess_setThreadPoolMaxThreadCount(1); + ABinderProcess_startThreadPool(); + return RUN_ALL_TESTS(); +} diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index b142d0cbf1..3d346c0ec4 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -60,6 +60,14 @@ .* + + android.hardware.automotive.evs + + IEvsEnumerator + default + [a-z]+/[0-9]+ + + android.hardware.automotive.evs 1.0-1 -- GitLab From 859200800c70a5780931abc8db40b7ade99eef12 Mon Sep 17 00:00:00 2001 From: Xusong Wang Date: Tue, 11 Jan 2022 14:25:55 -0800 Subject: [PATCH 442/825] Add VTS tests for reusable execution. - Modified generated tests and validation tests to exercise reusable execution. - Add a scoped trace to print the test config when an error occurs Bug: 202405342 Bug: 202431255 Test: VtsHalNeuralnetworksTargetTest Change-Id: I3e2346903e430080ec4d926bf08daf6825ea4dce --- .../vts/functional/GeneratedTestHarness.cpp | 451 ++++++++++-------- neuralnetworks/aidl/vts/functional/Utils.cpp | 11 + neuralnetworks/aidl/vts/functional/Utils.h | 2 + .../aidl/vts/functional/ValidateRequest.cpp | 53 ++ .../vts/functional/VtsHalNeuralnetworks.h | 2 + 5 files changed, 329 insertions(+), 190 deletions(-) diff --git a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp index f67fd34383..2460fbad86 100644 --- a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp +++ b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp @@ -58,25 +58,52 @@ struct TestConfig { bool measureTiming; OutputType outputType; MemoryType memoryType; + bool reusable; // `reportSkipping` indicates if a test should print an info message in case // it is skipped. The field is set to true by default and is set to false in // quantization coupling tests to suppress skipping a test bool reportSkipping; - TestConfig(Executor executor, bool measureTiming, OutputType outputType, MemoryType memoryType) + TestConfig(Executor executor, bool measureTiming, OutputType outputType, MemoryType memoryType, + bool reusable) : executor(executor), measureTiming(measureTiming), outputType(outputType), memoryType(memoryType), + reusable(reusable), reportSkipping(true) {} TestConfig(Executor executor, bool measureTiming, OutputType outputType, MemoryType memoryType, - bool reportSkipping) + bool reusable, bool reportSkipping) : executor(executor), measureTiming(measureTiming), outputType(outputType), memoryType(memoryType), + reusable(reusable), reportSkipping(reportSkipping) {} }; +std::string toString(OutputType type) { + switch (type) { + case OutputType::FULLY_SPECIFIED: + return "FULLY_SPECIFIED"; + case OutputType::UNSPECIFIED: + return "UNSPECIFIED"; + case OutputType::INSUFFICIENT: + return "INSUFFICIENT"; + case OutputType::MISSED_DEADLINE: + return "MISSED_DEADLINE"; + } +} + +std::string toString(const TestConfig& config) { + std::stringstream ss; + ss << "TestConfig{.executor=" << toString(config.executor) + << ", .measureTiming=" << (config.measureTiming ? "true" : "false") + << ", .outputType=" << toString(config.outputType) + << ", .memoryType=" << toString(config.memoryType) + << ", .reusable=" << (config.reusable ? "true" : "false") << "}"; + return ss.str(); +} + enum class IOType { INPUT, OUTPUT }; class DeviceMemoryAllocator { @@ -558,209 +585,241 @@ void EvaluatePreparedModel(const std::shared_ptr& device, loopTimeoutDurationNs = 1 * kMillisecond; } - ErrorStatus executionStatus; - std::vector outputShapes; - Timing timing = kNoTiming; - switch (testConfig.executor) { - case Executor::SYNC: { - SCOPED_TRACE("synchronous"); - - ExecutionResult executionResult; - // execute - const auto ret = preparedModel->executeSynchronously(request, testConfig.measureTiming, - kNoDeadline, loopTimeoutDurationNs, - &executionResult); - ASSERT_TRUE(ret.isOk() || ret.getExceptionCode() == EX_SERVICE_SPECIFIC) - << ret.getDescription(); - if (ret.isOk()) { - executionStatus = executionResult.outputSufficientSize - ? ErrorStatus::NONE - : ErrorStatus::OUTPUT_INSUFFICIENT_SIZE; - outputShapes = std::move(executionResult.outputShapes); - timing = executionResult.timing; - } else { - executionStatus = static_cast(ret.getServiceSpecificError()); - } - break; - } - case Executor::BURST: { - SCOPED_TRACE("burst"); - - // create burst - std::shared_ptr burst; - auto ret = preparedModel->configureExecutionBurst(&burst); - ASSERT_TRUE(ret.isOk()) << ret.getDescription(); - ASSERT_NE(nullptr, burst.get()); - - // associate a unique slot with each memory pool - int64_t currentSlot = 0; - std::vector slots; - slots.reserve(request.pools.size()); - for (const auto& pool : request.pools) { - if (pool.getTag() == RequestMemoryPool::Tag::pool) { - slots.push_back(currentSlot++); + std::shared_ptr execution; + if (testConfig.reusable) { + const auto ret = preparedModel->createReusableExecution(request, testConfig.measureTiming, + loopTimeoutDurationNs, &execution); + ASSERT_TRUE(ret.isOk()) << static_cast(ret.getServiceSpecificError()); + ASSERT_NE(nullptr, execution.get()); + } + + const auto executeAndCheckResults = [&preparedModel, &execution, &testConfig, &testModel, + &context, &request, loopTimeoutDurationNs, skipped]() { + ErrorStatus executionStatus; + std::vector outputShapes; + Timing timing = kNoTiming; + switch (testConfig.executor) { + case Executor::SYNC: { + SCOPED_TRACE("synchronous"); + + ExecutionResult executionResult; + // execute + ::ndk::ScopedAStatus ret; + if (testConfig.reusable) { + ret = execution->executeSynchronously(kNoDeadline, &executionResult); } else { - EXPECT_EQ(pool.getTag(), RequestMemoryPool::Tag::token); - slots.push_back(-1); + ret = preparedModel->executeSynchronously(request, testConfig.measureTiming, + kNoDeadline, loopTimeoutDurationNs, + &executionResult); } + ASSERT_TRUE(ret.isOk() || ret.getExceptionCode() == EX_SERVICE_SPECIFIC) + << ret.getDescription(); + if (ret.isOk()) { + executionStatus = executionResult.outputSufficientSize + ? ErrorStatus::NONE + : ErrorStatus::OUTPUT_INSUFFICIENT_SIZE; + outputShapes = std::move(executionResult.outputShapes); + timing = executionResult.timing; + } else { + executionStatus = static_cast(ret.getServiceSpecificError()); + } + break; } + case Executor::BURST: { + SCOPED_TRACE("burst"); - ExecutionResult executionResult; - // execute - ret = burst->executeSynchronously(request, slots, testConfig.measureTiming, kNoDeadline, - loopTimeoutDurationNs, &executionResult); - ASSERT_TRUE(ret.isOk() || ret.getExceptionCode() == EX_SERVICE_SPECIFIC) - << ret.getDescription(); - if (ret.isOk()) { - executionStatus = executionResult.outputSufficientSize - ? ErrorStatus::NONE - : ErrorStatus::OUTPUT_INSUFFICIENT_SIZE; - outputShapes = std::move(executionResult.outputShapes); - timing = executionResult.timing; - } else { - executionStatus = static_cast(ret.getServiceSpecificError()); - } - - // Mark each slot as unused after the execution. This is unnecessary because the burst - // is freed after this scope ends, but this is here to test the functionality. - for (int64_t slot : slots) { - ret = burst->releaseMemoryResource(slot); + // create burst + std::shared_ptr burst; + auto ret = preparedModel->configureExecutionBurst(&burst); ASSERT_TRUE(ret.isOk()) << ret.getDescription(); - } + ASSERT_NE(nullptr, burst.get()); + + // associate a unique slot with each memory pool + int64_t currentSlot = 0; + std::vector slots; + slots.reserve(request.pools.size()); + for (const auto& pool : request.pools) { + if (pool.getTag() == RequestMemoryPool::Tag::pool) { + slots.push_back(currentSlot++); + } else { + EXPECT_EQ(pool.getTag(), RequestMemoryPool::Tag::token); + slots.push_back(-1); + } + } - break; - } - case Executor::FENCED: { - SCOPED_TRACE("fenced"); - ErrorStatus result = ErrorStatus::NONE; - FencedExecutionResult executionResult; - auto ret = preparedModel->executeFenced(request, {}, testConfig.measureTiming, - kNoDeadline, loopTimeoutDurationNs, kNoDuration, - &executionResult); - ASSERT_TRUE(ret.isOk() || ret.getExceptionCode() == EX_SERVICE_SPECIFIC) - << ret.getDescription(); - if (!ret.isOk()) { - result = static_cast(ret.getServiceSpecificError()); - executionStatus = result; - } else if (executionResult.syncFence.get() != -1) { - std::vector waitFor; - auto dupFd = dup(executionResult.syncFence.get()); - ASSERT_NE(dupFd, -1); - waitFor.emplace_back(dupFd); - // If a sync fence is returned, try start another run waiting for the sync fence. - ret = preparedModel->executeFenced(request, waitFor, testConfig.measureTiming, - kNoDeadline, loopTimeoutDurationNs, kNoDuration, - &executionResult); - ASSERT_TRUE(ret.isOk()); - waitForSyncFence(executionResult.syncFence.get()); + ExecutionResult executionResult; + // execute + ret = burst->executeSynchronously(request, slots, testConfig.measureTiming, + kNoDeadline, loopTimeoutDurationNs, + &executionResult); + ASSERT_TRUE(ret.isOk() || ret.getExceptionCode() == EX_SERVICE_SPECIFIC) + << ret.getDescription(); + if (ret.isOk()) { + executionStatus = executionResult.outputSufficientSize + ? ErrorStatus::NONE + : ErrorStatus::OUTPUT_INSUFFICIENT_SIZE; + outputShapes = std::move(executionResult.outputShapes); + timing = executionResult.timing; + } else { + executionStatus = static_cast(ret.getServiceSpecificError()); + } + + // Mark each slot as unused after the execution. This is unnecessary because the + // burst is freed after this scope ends, but this is here to test the functionality. + for (int64_t slot : slots) { + ret = burst->releaseMemoryResource(slot); + ASSERT_TRUE(ret.isOk()) << ret.getDescription(); + } + + break; } - if (result == ErrorStatus::NONE) { - ASSERT_NE(executionResult.callback, nullptr); - Timing timingFenced; - auto ret = executionResult.callback->getExecutionInfo(&timing, &timingFenced, - &executionStatus); - ASSERT_TRUE(ret.isOk()); + case Executor::FENCED: { + SCOPED_TRACE("fenced"); + ErrorStatus result = ErrorStatus::NONE; + FencedExecutionResult executionResult; + ::ndk::ScopedAStatus ret; + if (testConfig.reusable) { + ret = execution->executeFenced({}, kNoDeadline, kNoDuration, &executionResult); + } else { + ret = preparedModel->executeFenced(request, {}, testConfig.measureTiming, + kNoDeadline, loopTimeoutDurationNs, + kNoDuration, &executionResult); + } + ASSERT_TRUE(ret.isOk() || ret.getExceptionCode() == EX_SERVICE_SPECIFIC) + << ret.getDescription(); + if (!ret.isOk()) { + result = static_cast(ret.getServiceSpecificError()); + executionStatus = result; + } else if (executionResult.syncFence.get() != -1) { + std::vector waitFor; + auto dupFd = dup(executionResult.syncFence.get()); + ASSERT_NE(dupFd, -1); + waitFor.emplace_back(dupFd); + // If a sync fence is returned, try start another run waiting for the sync + // fence. + ret = preparedModel->executeFenced(request, waitFor, testConfig.measureTiming, + kNoDeadline, loopTimeoutDurationNs, + kNoDuration, &executionResult); + ASSERT_TRUE(ret.isOk()); + waitForSyncFence(executionResult.syncFence.get()); + } + if (result == ErrorStatus::NONE) { + ASSERT_NE(executionResult.callback, nullptr); + Timing timingFenced; + auto ret = executionResult.callback->getExecutionInfo(&timing, &timingFenced, + &executionStatus); + ASSERT_TRUE(ret.isOk()); + } + break; + } + default: { + FAIL() << "Unsupported execution mode for AIDL interface."; } - break; - } - default: { - FAIL() << "Unsupported execution mode for AIDL interface."; - } - } - - if (testConfig.outputType != OutputType::FULLY_SPECIFIED && - executionStatus == ErrorStatus::GENERAL_FAILURE) { - if (skipped != nullptr) { - *skipped = true; - } - if (!testConfig.reportSkipping) { - return; - } - LOG(INFO) << "NN VTS: Early termination of test because vendor service cannot " - "execute model that it does not support."; - std::cout << "[ ] Early termination of test because vendor service cannot " - "execute model that it does not support." - << std::endl; - GTEST_SKIP(); - } - if (!testConfig.measureTiming) { - EXPECT_EQ(timing, kNoTiming); - } else { - if (timing.timeOnDeviceNs != -1 && timing.timeInDriverNs != -1) { - EXPECT_LE(timing.timeOnDeviceNs, timing.timeInDriverNs); } - } - switch (testConfig.outputType) { - case OutputType::FULLY_SPECIFIED: - if (testConfig.executor == Executor::FENCED && hasZeroSizedOutput(testModel)) { - // Executor::FENCED does not support zero-sized output. - ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, executionStatus); - return; + if (testConfig.outputType != OutputType::FULLY_SPECIFIED && + executionStatus == ErrorStatus::GENERAL_FAILURE) { + if (skipped != nullptr) { + *skipped = true; } - // If the model output operands are fully specified, outputShapes must be either - // either empty, or have the same number of elements as the number of outputs. - ASSERT_EQ(ErrorStatus::NONE, executionStatus); - ASSERT_TRUE(outputShapes.size() == 0 || - outputShapes.size() == testModel.main.outputIndexes.size()); - break; - case OutputType::UNSPECIFIED: - if (testConfig.executor == Executor::FENCED) { - // For Executor::FENCED, the output shape must be fully specified. - ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, executionStatus); + if (!testConfig.reportSkipping) { return; } - // If the model output operands are not fully specified, outputShapes must have - // the same number of elements as the number of outputs. - ASSERT_EQ(ErrorStatus::NONE, executionStatus); - ASSERT_EQ(outputShapes.size(), testModel.main.outputIndexes.size()); - break; - case OutputType::INSUFFICIENT: - if (testConfig.executor == Executor::FENCED) { - // For Executor::FENCED, the output shape must be fully specified. - ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, executionStatus); - return; + LOG(INFO) << "NN VTS: Early termination of test because vendor service cannot " + "execute model that it does not support."; + std::cout << "[ ] Early termination of test because vendor service cannot " + "execute model that it does not support." + << std::endl; + GTEST_SKIP(); + } + if (!testConfig.measureTiming) { + EXPECT_EQ(timing, kNoTiming); + } else { + if (timing.timeOnDeviceNs != -1 && timing.timeInDriverNs != -1) { + EXPECT_LE(timing.timeOnDeviceNs, timing.timeInDriverNs); } - ASSERT_EQ(ErrorStatus::OUTPUT_INSUFFICIENT_SIZE, executionStatus); - ASSERT_EQ(outputShapes.size(), testModel.main.outputIndexes.size()); - // Check that all returned output dimensions are at least as fully specified as the - // union of the information about the corresponding operand in the model and in the - // request. In this test, all model outputs have known rank with all dimensions - // unspecified, and no dimensional information is provided in the request. - for (uint32_t i = 0; i < outputShapes.size(); i++) { - ASSERT_EQ(outputShapes[i].isSufficient, i != kInsufficientOutputIndex); - const auto& actual = outputShapes[i].dimensions; - const auto& golden = - testModel.main.operands[testModel.main.outputIndexes[i]].dimensions; - ASSERT_EQ(actual.size(), golden.size()); - for (uint32_t j = 0; j < actual.size(); j++) { - if (actual[j] == 0) continue; - EXPECT_EQ(actual[j], golden[j]) << "index: " << j; + } + + switch (testConfig.outputType) { + case OutputType::FULLY_SPECIFIED: + if (testConfig.executor == Executor::FENCED && hasZeroSizedOutput(testModel)) { + // Executor::FENCED does not support zero-sized output. + ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, executionStatus); + return; } - } - return; - case OutputType::MISSED_DEADLINE: - ASSERT_TRUE(executionStatus == ErrorStatus::MISSED_DEADLINE_TRANSIENT || - executionStatus == ErrorStatus::MISSED_DEADLINE_PERSISTENT) - << "executionStatus = " << executionStatus; - return; - } + // If the model output operands are fully specified, outputShapes must be either + // either empty, or have the same number of elements as the number of outputs. + ASSERT_EQ(ErrorStatus::NONE, executionStatus); + ASSERT_TRUE(outputShapes.size() == 0 || + outputShapes.size() == testModel.main.outputIndexes.size()); + break; + case OutputType::UNSPECIFIED: + if (testConfig.executor == Executor::FENCED) { + // For Executor::FENCED, the output shape must be fully specified. + ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, executionStatus); + return; + } + // If the model output operands are not fully specified, outputShapes must have + // the same number of elements as the number of outputs. + ASSERT_EQ(ErrorStatus::NONE, executionStatus); + ASSERT_EQ(outputShapes.size(), testModel.main.outputIndexes.size()); + break; + case OutputType::INSUFFICIENT: + if (testConfig.executor == Executor::FENCED) { + // For Executor::FENCED, the output shape must be fully specified. + ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, executionStatus); + return; + } + ASSERT_EQ(ErrorStatus::OUTPUT_INSUFFICIENT_SIZE, executionStatus); + ASSERT_EQ(outputShapes.size(), testModel.main.outputIndexes.size()); + // Check that all returned output dimensions are at least as fully specified as the + // union of the information about the corresponding operand in the model and in the + // request. In this test, all model outputs have known rank with all dimensions + // unspecified, and no dimensional information is provided in the request. + for (uint32_t i = 0; i < outputShapes.size(); i++) { + ASSERT_EQ(outputShapes[i].isSufficient, i != kInsufficientOutputIndex); + const auto& actual = outputShapes[i].dimensions; + const auto& golden = + testModel.main.operands[testModel.main.outputIndexes[i]].dimensions; + ASSERT_EQ(actual.size(), golden.size()); + for (uint32_t j = 0; j < actual.size(); j++) { + if (actual[j] == 0) continue; + EXPECT_EQ(actual[j], golden[j]) << "index: " << j; + } + } + return; + case OutputType::MISSED_DEADLINE: + ASSERT_TRUE(executionStatus == ErrorStatus::MISSED_DEADLINE_TRANSIENT || + executionStatus == ErrorStatus::MISSED_DEADLINE_PERSISTENT) + << "executionStatus = " << executionStatus; + return; + } - // Go through all outputs, check returned output shapes. - for (uint32_t i = 0; i < outputShapes.size(); i++) { - EXPECT_TRUE(outputShapes[i].isSufficient); - const auto& expect = testModel.main.operands[testModel.main.outputIndexes[i]].dimensions; - const auto unsignedActual = nn::toUnsigned(outputShapes[i].dimensions); - ASSERT_TRUE(unsignedActual.has_value()); - const std::vector& actual = unsignedActual.value(); - EXPECT_EQ(expect, actual); - } + // Go through all outputs, check returned output shapes. + for (uint32_t i = 0; i < outputShapes.size(); i++) { + EXPECT_TRUE(outputShapes[i].isSufficient); + const auto& expect = + testModel.main.operands[testModel.main.outputIndexes[i]].dimensions; + const auto unsignedActual = nn::toUnsigned(outputShapes[i].dimensions); + ASSERT_TRUE(unsignedActual.has_value()); + const std::vector& actual = unsignedActual.value(); + EXPECT_EQ(expect, actual); + } + + // Retrieve execution results. + const std::vector outputs = context.getOutputBuffers(testModel, request); - // Retrieve execution results. - const std::vector outputs = context.getOutputBuffers(testModel, request); + // We want "close-enough" results. + checkResults(testModel, outputs); + }; - // We want "close-enough" results. - checkResults(testModel, outputs); + executeAndCheckResults(); + + // For reusable execution tests, run the execution twice. + if (testConfig.reusable) { + SCOPED_TRACE("Second execution"); + executeAndCheckResults(); + } } void EvaluatePreparedModel(const std::shared_ptr& device, @@ -770,6 +829,13 @@ void EvaluatePreparedModel(const std::shared_ptr& device, std::vector measureTimingList; std::vector executorList; std::vector memoryTypeList; + std::vector reusableList = {false}; + + int deviceVersion; + ASSERT_TRUE(device->getInterfaceVersion(&deviceVersion).isOk()); + if (deviceVersion >= kMinAidlLevelForFL8) { + reusableList.push_back(true); + } switch (testKind) { case TestKind::GENERAL: { @@ -812,8 +878,13 @@ void EvaluatePreparedModel(const std::shared_ptr& device, for (const bool measureTiming : measureTimingList) { for (const Executor executor : executorList) { for (const MemoryType memoryType : memoryTypeList) { - const TestConfig testConfig(executor, measureTiming, outputType, memoryType); - EvaluatePreparedModel(device, preparedModel, testModel, testConfig); + for (const bool reusable : reusableList) { + if (executor == Executor::BURST && reusable) continue; + const TestConfig testConfig(executor, measureTiming, outputType, memoryType, + reusable); + SCOPED_TRACE(toString(testConfig)); + EvaluatePreparedModel(device, preparedModel, testModel, testConfig); + } } } } @@ -833,7 +904,7 @@ void EvaluatePreparedCoupledModels(const std::shared_ptr& device, for (const bool measureTiming : measureTimingList) { for (const Executor executor : executorList) { const TestConfig testConfig(executor, measureTiming, outputType, MemoryType::ASHMEM, - /*reportSkipping=*/false); + /*reusable=*/false, /*reportSkipping=*/false); bool baseSkipped = false; EvaluatePreparedModel(device, preparedModel, testModel, testConfig, &baseSkipped); bool coupledSkipped = false; diff --git a/neuralnetworks/aidl/vts/functional/Utils.cpp b/neuralnetworks/aidl/vts/functional/Utils.cpp index 325a436f79..efd5bca517 100644 --- a/neuralnetworks/aidl/vts/functional/Utils.cpp +++ b/neuralnetworks/aidl/vts/functional/Utils.cpp @@ -177,6 +177,17 @@ std::string gtestCompliantName(std::string name) { return os << toString(errorStatus); } +std::string toString(MemoryType type) { + switch (type) { + case MemoryType::ASHMEM: + return "ASHMEM"; + case MemoryType::BLOB_AHWB: + return "BLOB_AHWB"; + case MemoryType::DEVICE: + return "DEVICE"; + } +} + Request ExecutionContext::createRequest(const TestModel& testModel, MemoryType memoryType) { CHECK(memoryType == MemoryType::ASHMEM || memoryType == MemoryType::BLOB_AHWB); diff --git a/neuralnetworks/aidl/vts/functional/Utils.h b/neuralnetworks/aidl/vts/functional/Utils.h index ca81418417..0db3f8c7f8 100644 --- a/neuralnetworks/aidl/vts/functional/Utils.h +++ b/neuralnetworks/aidl/vts/functional/Utils.h @@ -111,6 +111,8 @@ class TestBlobAHWB : public TestMemoryBase { enum class MemoryType { ASHMEM, BLOB_AHWB, DEVICE }; +std::string toString(MemoryType type); + // Manages the lifetime of memory resources used in an execution. class ExecutionContext { DISALLOW_COPY_AND_ASSIGN(ExecutionContext); diff --git a/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp b/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp index 29e2471777..e8debf704c 100644 --- a/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp +++ b/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp @@ -36,6 +36,51 @@ using ExecutionMutation = std::function; ///////////////////////// UTILITY FUNCTIONS ///////////////////////// +// Test request validation with reusable execution. +static void validateReusableExecution(const std::shared_ptr& preparedModel, + const std::string& message, const Request& request, + bool measure) { + // createReusableExecution + std::shared_ptr execution; + { + SCOPED_TRACE(message + " [createReusableExecution]"); + const auto createStatus = preparedModel->createReusableExecution( + request, measure, kOmittedTimeoutDuration, &execution); + if (!createStatus.isOk()) { + ASSERT_EQ(createStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(createStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); + ASSERT_EQ(nullptr, execution); + return; + } else { + ASSERT_NE(nullptr, execution); + } + } + + // synchronous + { + SCOPED_TRACE(message + " [executeSynchronously]"); + ExecutionResult executionResult; + const auto executeStatus = execution->executeSynchronously(kNoDeadline, &executionResult); + ASSERT_FALSE(executeStatus.isOk()); + ASSERT_EQ(executeStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(executeStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); + } + + // fenced + { + SCOPED_TRACE(message + " [executeFenced]"); + FencedExecutionResult executionResult; + const auto executeStatus = + execution->executeFenced({}, kNoDeadline, kNoDuration, &executionResult); + ASSERT_FALSE(executeStatus.isOk()); + ASSERT_EQ(executeStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(executeStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); + } +} + // Primary validation function. This function will take a valid request, apply a // mutation to it to invalidate the request, then pass it to interface calls // that use the request. @@ -101,6 +146,14 @@ static void validate(const std::shared_ptr& preparedModel, ASSERT_EQ(static_cast(executeStatus.getServiceSpecificError()), ErrorStatus::INVALID_ARGUMENT); } + + int32_t aidlVersion; + ASSERT_TRUE(preparedModel->getInterfaceVersion(&aidlVersion).isOk()); + + // validate reusable execution + if (aidlVersion >= kMinAidlLevelForFL8) { + validateReusableExecution(preparedModel, message, request, measure); + } } std::shared_ptr createBurst(const std::shared_ptr& preparedModel) { diff --git a/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h index 4312d3a4a1..a900590791 100644 --- a/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h +++ b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h @@ -30,6 +30,8 @@ namespace aidl::android::hardware::neuralnetworks::vts::functional { using NamedDevice = Named>; using NeuralNetworksAidlTestParam = NamedDevice; +constexpr int kMinAidlLevelForFL8 = 4; + class NeuralNetworksAidlTest : public testing::TestWithParam { protected: void SetUp() override; -- GitLab From 5cb52553df9d09a87d46d0655cf889b63d002797 Mon Sep 17 00:00:00 2001 From: Greg Kaiser Date: Tue, 18 Jan 2022 15:00:30 -0800 Subject: [PATCH 443/825] Fix copy() using iterators from different containers We fix up a std::copy that was using the wrong container for the end(). Test: TreeHugger Bug: 206867060 Change-Id: I5b7700029db6a513b6fdf03c3449be973d639df5 --- sensors/aidl/default/multihal/ConvertUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sensors/aidl/default/multihal/ConvertUtils.cpp b/sensors/aidl/default/multihal/ConvertUtils.cpp index 4d6697be3e..509bbb0e7b 100644 --- a/sensors/aidl/default/multihal/ConvertUtils.cpp +++ b/sensors/aidl/default/multihal/ConvertUtils.cpp @@ -131,7 +131,7 @@ void convertToHidlEvent(const AidlEvent& aidlEvent, V2_1Event* hidlEvent) { break; case AidlSensorType::POSE_6DOF: std::copy(std::begin(aidlEvent.payload.get().values), - std::end(aidlEvent.payload.get().values), + std::end(aidlEvent.payload.get().values), hidlEvent->u.pose6DOF.data()); break; case AidlSensorType::DYNAMIC_SENSOR_META: @@ -318,4 +318,4 @@ void convertToAidlEvent(const V2_1Event& hidlEvent, AidlEvent* aidlEvent) { } // namespace sensors } // namespace hardware } // namespace android -} // namespace aidl \ No newline at end of file +} // namespace aidl -- GitLab From ae12e389fde76d848c48035d062adbfcd74eae60 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Thu, 13 Jan 2022 18:06:21 -0800 Subject: [PATCH 444/825] composer: add getDisplayPhysicalOrientation Add an API to query the physical display orientation. Bug: 213237830 Test: VTS Change-Id: I4ea9ee5c8655be283e19156b0ce68e35674ac321 --- .../hardware/graphics/common/Transform.aidl | 1 + .../hardware/graphics/common/Transform.aidl | 5 ++++ .../graphics/composer3/IComposerClient.aidl | 1 + .../graphics/composer3/IComposerClient.aidl | 18 +++++++++++++ .../VtsHalGraphicsComposer3_TargetTest.cpp | 27 +++++++++++++++++++ 5 files changed, 52 insertions(+) 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 5c3d4cb16f..359c655e00 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 @@ -34,6 +34,7 @@ package android.hardware.graphics.common; @Backing(type="int") @VintfStability enum Transform { + NONE = 0, FLIP_H = 1, FLIP_V = 2, ROT_90 = 4, diff --git a/graphics/common/aidl/android/hardware/graphics/common/Transform.aidl b/graphics/common/aidl/android/hardware/graphics/common/Transform.aidl index 325816c98a..4b3a1b11fe 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/Transform.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/Transform.aidl @@ -22,6 +22,11 @@ package android.hardware.graphics.common; @VintfStability @Backing(type="int") enum Transform { + /** + * Identity transform (i.e. no rotation or flip). + */ + NONE = 0, + /** * Horizontal flip. FLIP_H/FLIP_V is applied before ROT_90. */ 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 e9d9745dff..37af84a44d 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 @@ -51,6 +51,7 @@ interface IComposerClient { int getDisplayVsyncPeriod(long display); android.hardware.graphics.composer3.DisplayContentSample getDisplayedContentSample(long display, long maxFrames, long timestamp); android.hardware.graphics.composer3.DisplayContentSamplingAttributes getDisplayedContentSamplingAttributes(long display); + android.hardware.graphics.common.Transform getDisplayPhysicalOrientation(long display); android.hardware.graphics.composer3.HdrCapabilities getHdrCapabilities(long display); int getMaxVirtualDisplayCount(); android.hardware.graphics.composer3.PerFrameMetadataKey[] getPerFrameMetadataKeys(long display); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 3ab6329bff..fd2627e353 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -16,6 +16,7 @@ package android.hardware.graphics.composer3; +import android.hardware.graphics.common.Transform; import android.hardware.graphics.composer3.ClientTargetProperty; import android.hardware.graphics.composer3.ColorMode; import android.hardware.graphics.composer3.CommandResultPayload; @@ -353,6 +354,23 @@ interface IComposerClient { */ DisplayContentSamplingAttributes getDisplayedContentSamplingAttributes(long display); + /** + * Queries the physical orientation of a display. Orientation 'Transform::NONE' + * represents a display that doesn't require any transformation on layers + * to be presented at their natural orientation. + * + * @param display is the display where the physical orientation is queried. + * + * @return is one of the below values: + * Transform::NONE + * Transform::ROT_90 + * Transform::ROT_180 + * Transform::ROT_270 + * + * @exception EX_BAD_DISPLAY when an invalid display was passed in. + */ + Transform getDisplayPhysicalOrientation(long display); + /** * Returns the high dynamic range (HDR) capabilities of the given display, * which are invariant with regard to the active configuration. diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index c61693e458..6e42e86b73 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -904,6 +904,33 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayName) { EXPECT_TRUE(mComposerClient->getDisplayName(mPrimaryDisplay, &displayName).isOk()); } +TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientationBadDisplay) { + Transform displayOrientation; + const auto error = + mComposerClient->getDisplayPhysicalOrientation(mInvalidDisplayId, &displayOrientation); + + EXPECT_FALSE(error.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +} + +TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientation) { + const auto allowedDisplayOrientations = std::array{ + Transform::NONE, + Transform::ROT_90, + Transform::ROT_180, + Transform::ROT_270, + }; + + Transform displayOrientation; + const auto error = + mComposerClient->getDisplayPhysicalOrientation(mPrimaryDisplay, &displayOrientation); + + EXPECT_TRUE(error.isOk()); + EXPECT_NE(std::find(allowedDisplayOrientations.begin(), allowedDisplayOrientations.end(), + displayOrientation), + allowedDisplayOrientations.end()); +} + TEST_P(GraphicsComposerAidlTest, SetClientTargetSlotCount) { EXPECT_TRUE( mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kBufferSlotCount).isOk()); -- GitLab From c552b141e3b965712b4d4edc18ec5492abac2c0e Mon Sep 17 00:00:00 2001 From: Ahmed ElArabawy Date: Thu, 16 Dec 2021 15:37:23 -0800 Subject: [PATCH 445/825] WiFi: Basic support for 11be to Hostapd HAL In this commit, basic support for 11be is added to HostApd HAL. That includes: 1. Adding 320MHz bandwidth channels 2. Adding 11be to list of standards 3. Add a flag to enable/disable 11be for SoftAp Bug: 198746544 Test: Pass VTS tests, and presubmit tests Change-Id: I14e1bd8ab00692e743a3a49096fbd66aca806730 --- .../current/android/hardware/wifi/hostapd/Bandwidth.aidl | 9 +++++---- .../android/hardware/wifi/hostapd/Generation.aidl | 1 + .../android/hardware/wifi/hostapd/HwModeParams.aidl | 1 + .../aidl/android/hardware/wifi/hostapd/Bandwidth.aidl | 9 +++++---- .../aidl/android/hardware/wifi/hostapd/Generation.aidl | 2 ++ .../aidl/android/hardware/wifi/hostapd/HwModeParams.aidl | 6 ++++++ 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Bandwidth.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Bandwidth.aidl index 890d986f77..4d78640fdb 100644 --- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Bandwidth.aidl +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Bandwidth.aidl @@ -41,8 +41,9 @@ enum Bandwidth { BANDWIDTH_80 = 4, BANDWIDTH_80P80 = 5, BANDWIDTH_160 = 6, - BANDWIDTH_2160 = 7, - BANDWIDTH_4320 = 8, - BANDWIDTH_6480 = 9, - BANDWIDTH_8640 = 10, + BANDWIDTH_320 = 7, + BANDWIDTH_2160 = 8, + BANDWIDTH_4320 = 9, + BANDWIDTH_6480 = 10, + BANDWIDTH_8640 = 11, } diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Generation.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Generation.aidl index 6b60d17400..af0e960df8 100644 --- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Generation.aidl +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Generation.aidl @@ -40,4 +40,5 @@ enum Generation { WIFI_STANDARD_11AC = 2, WIFI_STANDARD_11AX = 3, WIFI_STANDARD_11AD = 4, + WIFI_STANDARD_11BE = 5, } diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/HwModeParams.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/HwModeParams.aidl index 844c838c44..8d8d7bb0f6 100644 --- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/HwModeParams.aidl +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/HwModeParams.aidl @@ -43,4 +43,5 @@ parcelable HwModeParams { boolean enableHeMultiUserBeamformer; boolean enableHeTargetWakeTime; boolean enableEdmg; + boolean enable80211BE; } diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Bandwidth.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Bandwidth.aidl index c9824027e9..e605153b83 100644 --- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Bandwidth.aidl +++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Bandwidth.aidl @@ -29,8 +29,9 @@ enum Bandwidth { BANDWIDTH_80 = 4, BANDWIDTH_80P80 = 5, BANDWIDTH_160 = 6, - BANDWIDTH_2160 = 7, - BANDWIDTH_4320 = 8, - BANDWIDTH_6480 = 9, - BANDWIDTH_8640 = 10, + BANDWIDTH_320 = 7, + BANDWIDTH_2160 = 8, + BANDWIDTH_4320 = 9, + BANDWIDTH_6480 = 10, + BANDWIDTH_8640 = 11, } diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Generation.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Generation.aidl index 2cda55bd97..f4e3eb0668 100644 --- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Generation.aidl +++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Generation.aidl @@ -27,6 +27,7 @@ package android.hardware.wifi.hostapd; * WIFI_STANDARD_11AC = hw_mode is HOSTAPD_MODE_IEEE80211A and VHT is 1. * WIFI_STANDARD_11AX = hw_mode is HOSTAPD_MODE_IEEE80211A and High Efficiency supported. * WIFI_STANDARD_11AD = hw_mode is HOSTAPD_MODE_IEEE80211AD. + * WIFI_STANDARD_11BE = hw_mode is HOSTAPD_MODE_IEEE80211A and Extreme High Throughput supported. */ @VintfStability @Backing(type="int") @@ -37,4 +38,5 @@ enum Generation { WIFI_STANDARD_11AC = 2, WIFI_STANDARD_11AX = 3, WIFI_STANDARD_11AD = 4, + WIFI_STANDARD_11BE = 5, } diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/HwModeParams.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/HwModeParams.aidl index 210e99ff1f..e66a24af8c 100644 --- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/HwModeParams.aidl +++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/HwModeParams.aidl @@ -68,4 +68,10 @@ parcelable HwModeParams { * Enable EDMG (802.11ay), this option is only allowed for the 60GHz band. */ boolean enableEdmg; + /** + * Whether IEEE 802.11be (Extreme High Throughput) is enabled or not. + * Note: hw_mode=a is used to specify that 5 GHz band or 6 GHz band is + * used with Extreme High Throughput. + */ + boolean enable80211BE; } -- GitLab From 115180e95a548cd24d53d433fc67ae30e2bee753 Mon Sep 17 00:00:00 2001 From: Ahmed ElArabawy Date: Thu, 16 Dec 2021 16:03:43 -0800 Subject: [PATCH 446/825] WiFi: Basic support for 11be to Supplicant HAL In this commit, basic support for 11be is added to Supplicant HAL. That includes adding EHT to list of WifiTechnologies Bug: 198746544 Test: Build successful Change-Id: Ied553e502ab2dba9efbcaac80691a6d54195e942 --- .../android/hardware/wifi/supplicant/WifiTechnology.aidl | 1 + .../aidl/android/hardware/wifi/supplicant/WifiTechnology.aidl | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WifiTechnology.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WifiTechnology.aidl index ad36e68564..bf5081ea70 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WifiTechnology.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WifiTechnology.aidl @@ -39,4 +39,5 @@ enum WifiTechnology { HT = 2, VHT = 3, HE = 4, + EHT = 5, } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WifiTechnology.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WifiTechnology.aidl index 00c16b4278..d364c7509a 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WifiTechnology.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WifiTechnology.aidl @@ -39,4 +39,8 @@ enum WifiTechnology { * For 802.11ax */ HE = 4, + /** + * For 802.11be + */ + EHT = 5, } -- GitLab From a2b862a5276d97062492e13048b346515303da1f Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Mon, 17 Jan 2022 12:46:52 +0800 Subject: [PATCH 447/825] wifi: add API for setting roaming consortium selection Bug: 210879633 Test: atest VtsHalWifiSupplicantStaNetworkTargetTest Change-Id: I3eb89065ae7348d34ac09627af16d2d9460c9173 --- .../wifi/supplicant/ISupplicantStaNetwork.aidl | 1 + .../wifi/supplicant/ISupplicantStaNetwork.aidl | 13 +++++++++++++ .../functional/supplicant_sta_network_aidl_test.cpp | 8 ++++++++ 3 files changed, 22 insertions(+) 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 18baea6961..bdc5f3483c 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 @@ -125,6 +125,7 @@ interface ISupplicantStaNetwork { void setWapiCertSuite(in String suite); void setWepKey(in int keyIdx, in byte[] wepKey); void setWepTxKeyIdx(in int keyIdx); + void setRoamingConsortiumSelection(in byte[] selectedRcoi); 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/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl index 603e2add6e..1a2087dbe1 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl @@ -1092,4 +1092,17 @@ interface ISupplicantStaNetwork { * |SupplicantStatusCode.FAILURE_NETWORK_INVALID| */ void setWepTxKeyIdx(in int keyIdx); + + /** + * Set the roaming consortium selection. + * + * @param selectedRcoi Indicates the roaming consortium selection. This is a + * 3 or 5-octet long byte array that indicates the selected RCOI + * used for a Passpoint connection. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_ARGS_INVALID|, + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_NETWORK_INVALID| + */ + void setRoamingConsortiumSelection(in byte[] selectedRcoi); } 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 0a35f666f4..c6dd98152d 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 @@ -784,6 +784,14 @@ TEST_P(SupplicantStaNetworkAidlTest, GetWpsNfcConfigurationToken) { EXPECT_NE(retrievedToken.size(), 0); } +/* + * SetRoamingConsortiumSelection + */ +TEST_P(SupplicantStaNetworkAidlTest, SetRoamingConsortiumSelection) { + const std::vector testSelection = std::vector({0x11, 0x21, 0x33, 0x44}); + EXPECT_TRUE(sta_network_->setRoamingConsortiumSelection(testSelection).isOk()); +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SupplicantStaNetworkAidlTest); INSTANTIATE_TEST_SUITE_P(Supplicant, SupplicantStaNetworkAidlTest, testing::ValuesIn(android::getAidlHalInstanceNames( -- GitLab From 4a05294ae45c2e18a6e0bb0d5f4fcea66a78c4fc Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Thu, 6 Jan 2022 23:07:58 -0800 Subject: [PATCH 448/825] Add limited axes imu sensor type definitions. Includes changes for the following sensors: - ACCELEROMETER_LIMITED_AXES - GYROSCOPE_LIMITED_AXES - ACCELEROMETER_LIMITED_AXES_UNCALIBRATED - GYROSCOPE_LIMITED_AXES_UNCALIBRATED These new sensor types will help support varying sensor configurations for automotive devices. Bug: 187342209 Test: Compile only. Will be validated with other CLs. Change-Id: I3f01eb74c26ab58c051a58c4b5f1dfd90d7e853c --- .../android/hardware/sensors/Event.aidl | 23 ++++++ .../android/hardware/sensors/SensorType.aidl | 4 + .../aidl/android/hardware/sensors/Event.aidl | 76 +++++++++++++++++++ .../android/hardware/sensors/SensorType.aidl | 36 +++++++++ 4 files changed, 139 insertions(+) diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl index c92ab1ab0c..763cb8edc6 100644 --- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl +++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl @@ -52,6 +52,8 @@ parcelable Event { android.hardware.sensors.AdditionalInfo additional; android.hardware.sensors.Event.EventPayload.Data data; android.hardware.sensors.Event.EventPayload.HeadTracker headTracker; + android.hardware.sensors.Event.EventPayload.LimitedAxesImu limitedAxesImu; + android.hardware.sensors.Event.EventPayload.LimitedAxesImuUncal limitedAxesImuUncal; @FixedSize @VintfStability parcelable Vec4 { float x; @@ -86,6 +88,27 @@ parcelable Event { int discontinuityCount; } @FixedSize @VintfStability + parcelable LimitedAxesImu { + float x; + float y; + float z; + float xSupported; + float ySupported; + float zSupported; + } + @FixedSize @VintfStability + parcelable LimitedAxesImuUncal { + float x; + float y; + float z; + float xBias; + float yBias; + float zBias; + float xSupported; + float ySupported; + float zSupported; + } + @FixedSize @VintfStability parcelable HeartRate { float bpm; android.hardware.sensors.SensorStatus status; diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl index 3d7ab45cd8..896617beec 100644 --- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl +++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl @@ -71,5 +71,9 @@ enum SensorType { ACCELEROMETER_UNCALIBRATED = 35, HINGE_ANGLE = 36, HEAD_TRACKER = 37, + ACCELEROMETER_LIMITED_AXES = 38, + GYROSCOPE_LIMITED_AXES = 39, + ACCELEROMETER_LIMITED_AXES_UNCALIBRATED = 40, + GYROSCOPE_LIMITED_AXES_UNCALIBRATED = 41, DEVICE_PRIVATE_BASE = 65536, } diff --git a/sensors/aidl/android/hardware/sensors/Event.aidl b/sensors/aidl/android/hardware/sensors/Event.aidl index fd6a8cc4ba..8b7e4097bb 100644 --- a/sensors/aidl/android/hardware/sensors/Event.aidl +++ b/sensors/aidl/android/hardware/sensors/Event.aidl @@ -132,6 +132,18 @@ parcelable Event { */ HeadTracker headTracker; + /** + * SensorType::ACCELEROMETER_LIMITED_AXES + * SensorType::GYROSCOPE_LIMITED_AXES + */ + LimitedAxesImu limitedAxesImu; + + /** + * SensorType::ACCELEROMETER_LIMITED_AXES_UNCALIBRATED + * SensorType::GYROSCOPE_LIMITED_AXES_UNCALIBRATED + */ + LimitedAxesImuUncal limitedAxesImuUncal; + @FixedSize @VintfStability parcelable Vec4 { @@ -201,6 +213,70 @@ parcelable Event { int discontinuityCount; } + /** + * Payload of the ACCELEROMETER_LIMITED_AXES and GYROSCOPE_LIMITED_AXES + * sensor types. + */ + @FixedSize + @VintfStability + parcelable LimitedAxesImu { + /** + * Acceleration or angular speed values. If certain axes are not + * supported, the associated value must be set to 0. + */ + float x; + float y; + float z; + + /** + * Limited axes sensors must not be supported for all three axes. + * These values indicate which axes are supported with a 1.0 for + * supported, and a 0 for not supported. The supported axes should + * be determined at build time and these values must not change + * during runtime. + */ + float xSupported; + float ySupported; + float zSupported; + } + + /** + * Payload of the ACCELEROMETER_LIMITED_AXES_UNCALIBRATED and + * GYROSCOPE_LIMITED_AXES_UNCALIBRATED sensor types. + */ + @FixedSize + @VintfStability + parcelable LimitedAxesImuUncal { + /** + * Acceleration (without bias compensation) or angular (speed + * (without drift compensation) values. If certain axes are not + * supported, the associated value must be set to 0. + */ + float x; + float y; + float z; + + /** + * Estimated bias values for uncalibrated accelerometer or + * estimated drift values for uncalibrated gyroscope. If certain + * axes are not supported, the associated value must be set to 0. + */ + float xBias; + float yBias; + float zBias; + + /** + * Limited axes sensors must not be supported for all three axes. + * These values indicate which axes are supported with a 1.0 for + * supported, and a 0 for not supported. The supported axes should + * be determined at build time and these values must not change + * during runtime. + */ + float xSupported; + float ySupported; + float zSupported; + } + @FixedSize @VintfStability parcelable HeartRate { diff --git a/sensors/aidl/android/hardware/sensors/SensorType.aidl b/sensors/aidl/android/hardware/sensors/SensorType.aidl index 01e6bee1d5..000728c83e 100644 --- a/sensors/aidl/android/hardware/sensors/SensorType.aidl +++ b/sensors/aidl/android/hardware/sensors/SensorType.aidl @@ -666,6 +666,42 @@ enum SensorType { */ HEAD_TRACKER = 37, + /** + * ACCELEROMETER_LIMITED_AXES + * reporting-mode: continuous + * + * Equivalent to ACCELEROMETER, but supporting cases where one or two axes + * are not supported. + */ + ACCELEROMETER_LIMITED_AXES = 38, + + /** + * GYROSCOPE_LIMITED_AXES + * reporting-mode: continuous + * + * Equivalent to GYROSCOPE, but supporting cases where one or two axes are + * not supported. + */ + GYROSCOPE_LIMITED_AXES = 39, + + /** + * ACCELEROMETER_LIMITED_AXES_UNCALIBRATED + * reporting-mode: continuous + * + * Equivalent to ACCELEROMETER_UNCALIBRATED, but supporting cases where one + * or two axes are not supported. + */ + ACCELEROMETER_LIMITED_AXES_UNCALIBRATED = 40, + + /** + * GYROSCOPE_LIMITED_AXES_UNCALIBRATED + * reporting-mode: continuous + * + * Equivalent to GYROSCOPE_UNCALIBRATED, but supporting cases where one or + * two axes are not supported. + */ + GYROSCOPE_LIMITED_AXES_UNCALIBRATED = 41, + /** * Base for device manufacturers private sensor types. * These sensor types can't be exposed in the SDK. -- GitLab From bbf7fb9322e495608b3d38f69e50081030669092 Mon Sep 17 00:00:00 2001 From: Edwin Tung Date: Mon, 27 Dec 2021 12:13:02 +0800 Subject: [PATCH 449/825] Add MeasurementCorrections AIDL HAL (hardware/interfaces) Bug: 208728105 Test: atest VtsHalGnssTargetTest Change-Id: I2192670951a517bd229535a083997cc9bab31287 --- .../compatibility_matrix.current.xml | 8 ++ gnss/1.1/vts/functional/Android.bp | 1 + gnss/2.0/vts/functional/Android.bp | 6 +- gnss/2.1/vts/functional/Android.bp | 1 + gnss/aidl/Android.bp | 1 + .../current/android/hardware/gnss/IGnss.aidl | 1 + .../IMeasurementCorrectionsCallback.aidl | 41 +++++++ .../IMeasurementCorrectionsInterface.aidl | 39 +++++++ .../MeasurementCorrections.aidl | 47 ++++++++ .../ReflectingPlane.aidl | 41 +++++++ .../SingleSatCorrection.aidl | 49 +++++++++ gnss/aidl/android/hardware/gnss/IGnss.aidl | 8 ++ .../IMeasurementCorrectionsCallback.aidl | 57 ++++++++++ .../IMeasurementCorrectionsInterface.aidl | 48 +++++++++ .../MeasurementCorrections.aidl | 102 ++++++++++++++++++ .../ReflectingPlane.aidl | 43 ++++++++ .../SingleSatCorrection.aidl | 85 +++++++++++++++ gnss/aidl/default/Android.bp | 1 + gnss/aidl/default/Gnss.cpp | 11 ++ gnss/aidl/default/Gnss.h | 5 + .../MeasurementCorrectionsInterface.cpp | 68 ++++++++++++ .../default/MeasurementCorrectionsInterface.h | 36 +++++++ gnss/aidl/vts/Android.bp | 1 + .../vts/MeasurementCorrectionsCallback.cpp | 26 +++++ .../aidl/vts/MeasurementCorrectionsCallback.h | 31 ++++++ gnss/aidl/vts/gnss_hal_test_cases.cpp | 46 +++++++- gnss/common/utils/vts/Utils.cpp | 58 ++++++++++ gnss/common/utils/vts/include/Utils.h | 4 + 28 files changed, 863 insertions(+), 2 deletions(-) create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl create mode 100644 gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl create mode 100644 gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl create mode 100644 gnss/aidl/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl create mode 100644 gnss/aidl/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl create mode 100644 gnss/aidl/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl create mode 100644 gnss/aidl/default/MeasurementCorrectionsInterface.cpp create mode 100644 gnss/aidl/default/MeasurementCorrectionsInterface.h create mode 100644 gnss/aidl/vts/MeasurementCorrectionsCallback.cpp create mode 100644 gnss/aidl/vts/MeasurementCorrectionsCallback.h diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index a52fde458e..3d2ef2c80e 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -265,6 +265,14 @@ default + + android.hardware.gnss.measurement_corrections + 1 + + IMeasurementCorrectionsInterface + default + + android.hardware.graphics.allocator diff --git a/gnss/1.1/vts/functional/Android.bp b/gnss/1.1/vts/functional/Android.bp index c59d5e7a64..f8fad94a34 100644 --- a/gnss/1.1/vts/functional/Android.bp +++ b/gnss/1.1/vts/functional/Android.bp @@ -36,6 +36,7 @@ cc_test { "android.hardware.gnss@1.1", "android.hardware.gnss@2.0", "android.hardware.gnss@common-vts-lib", + "android.hardware.gnss-V2-cpp", ], shared_libs: [ "android.hardware.gnss.measurement_corrections@1.0", diff --git a/gnss/2.0/vts/functional/Android.bp b/gnss/2.0/vts/functional/Android.bp index 3bbd572841..2042dd9f17 100644 --- a/gnss/2.0/vts/functional/Android.bp +++ b/gnss/2.0/vts/functional/Android.bp @@ -39,6 +39,10 @@ cc_test { "android.hardware.gnss@2.0", "android.hardware.gnss@2.1", "android.hardware.gnss@common-vts-lib", + "android.hardware.gnss-V2-cpp", + ], + test_suites: [ + "general-tests", + "vts", ], - test_suites: ["general-tests", "vts"], } diff --git a/gnss/2.1/vts/functional/Android.bp b/gnss/2.1/vts/functional/Android.bp index aaddd96f8c..d7b6eebbe9 100644 --- a/gnss/2.1/vts/functional/Android.bp +++ b/gnss/2.1/vts/functional/Android.bp @@ -40,6 +40,7 @@ cc_test { "android.hardware.gnss@2.0", "android.hardware.gnss@2.1", "android.hardware.gnss@common-vts-lib", + "android.hardware.gnss-V2-cpp", ], shared_libs: [ "libvintf", diff --git a/gnss/aidl/Android.bp b/gnss/aidl/Android.bp index d90cf0b634..4d9c5cc231 100644 --- a/gnss/aidl/Android.bp +++ b/gnss/aidl/Android.bp @@ -28,6 +28,7 @@ aidl_interface { vendor_available: true, srcs: [ "android/hardware/gnss/*.aidl", + "android/hardware/gnss/measurement_corrections/*.aidl", "android/hardware/gnss/visibility_control/*.aidl", ], stability: "vintf", 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 281c531977..fb13e026bb 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 @@ -54,6 +54,7 @@ interface IGnss { void deleteAidingData(in android.hardware.gnss.IGnss.GnssAidingData aidingDataFlags); void setPositionMode(in android.hardware.gnss.IGnss.GnssPositionMode mode, in android.hardware.gnss.IGnss.GnssPositionRecurrence recurrence, in int minIntervalMs, in int preferredAccuracyMeters, in int preferredTimeMs, in boolean lowPowerMode); android.hardware.gnss.IGnssAntennaInfo getExtensionGnssAntennaInfo(); + @nullable android.hardware.gnss.measurement_corrections.IMeasurementCorrectionsInterface getExtensionMeasurementCorrections(); const int ERROR_INVALID_ARGUMENT = 1; const int ERROR_ALREADY_INIT = 2; const int ERROR_GENERIC = 3; 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 new file mode 100644 index 0000000000..c4cf13f406 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.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 -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.gnss.measurement_corrections; +@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; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl new file mode 100644 index 0000000000..5dc55960c5 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.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 -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.gnss.measurement_corrections; +@VintfStability +interface IMeasurementCorrectionsInterface { + void setCorrections(in android.hardware.gnss.measurement_corrections.MeasurementCorrections corrections); + void setCallback(in android.hardware.gnss.measurement_corrections.IMeasurementCorrectionsCallback callback); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl new file mode 100644 index 0000000000..f32c8c27bf --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/MeasurementCorrections.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 -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.gnss.measurement_corrections; +@VintfStability +parcelable MeasurementCorrections { + double latitudeDegrees; + double longitudeDegrees; + double altitudeMeters; + double horizontalPositionUncertaintyMeters; + double verticalPositionUncertaintyMeters; + long toaGpsNanosecondsOfWeek; + android.hardware.gnss.measurement_corrections.SingleSatCorrection[] satCorrections; + boolean hasEnvironmentBearing; + float environmentBearingDegrees; + float environmentBearingUncertaintyDegrees; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl new file mode 100644 index 0000000000..90c3818b1c --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/ReflectingPlane.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 -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.gnss.measurement_corrections; +@VintfStability +parcelable ReflectingPlane { + double latitudeDegrees; + double longitudeDegrees; + double altitudeMeters; + double azimuthDegrees; +} 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 new file mode 100644 index 0000000000..d18c1a7339 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl @@ -0,0 +1,49 @@ +/* + * 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 -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.gnss.measurement_corrections; +@VintfStability +parcelable SingleSatCorrection { + int singleSatCorrectionFlags; + android.hardware.gnss.GnssConstellationType constellation; + int svid; + long carrierFrequencyHz; + float probSatIsLos; + float excessPathLengthMeters; + float excessPathLengthUncertaintyMeters; + android.hardware.gnss.measurement_corrections.ReflectingPlane reflectingPlane; + const int SINGLE_SAT_CORRECTION_HAS_SAT_IS_LOS_PROBABILITY = 1; + const int SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH = 2; + const int SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH_UNC = 4; + const int SINGLE_SAT_CORRECTION_HAS_REFLECTING_PLANE = 8; +} diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl index e1d46703fa..1e1c0fab96 100644 --- a/gnss/aidl/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl @@ -28,6 +28,7 @@ import android.hardware.gnss.IGnssMeasurementInterface; import android.hardware.gnss.IGnssNavigationMessageInterface; import android.hardware.gnss.IGnssPowerIndication; import android.hardware.gnss.IGnssPsds; +import android.hardware.gnss.measurement_corrections.IMeasurementCorrectionsInterface; import android.hardware.gnss.visibility_control.IGnssVisibilityControl; /** @@ -285,4 +286,11 @@ interface IGnss { * @return Handle to the IGnssAntennaInfo. */ IGnssAntennaInfo getExtensionGnssAntennaInfo(); + + /** + * This method returns the IMeasurementCorrectionsInterface. + * + * @return Handle to the IMeasurementCorrectionsInterface. + */ + @nullable IMeasurementCorrectionsInterface getExtensionMeasurementCorrections(); } diff --git a/gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl b/gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl new file mode 100644 index 0000000000..d695e70451 --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.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. + */ + +package android.hardware.gnss.measurement_corrections; + +/** + * GNSS measurement corrections callback interface. + */ +@VintfStability +interface IMeasurementCorrectionsCallback { + /** + * Flags to indicate supported measurement corrections capabilities + * + * Either the LOS_SATS or the EXCESS_PATH_LENGTH capability must be supported. + */ + /** + * Capability bit flag indicating that GNSS supports line-of-sight satellite identification + * measurement corrections + */ + const int CAPABILITY_LOS_SATS = 1 << 0; + /** + * Capability bit flag indicating that GNSS supports per satellite excess-path-length + * measurement corrections + */ + const int CAPABILITY_EXCESS_PATH_LENGTH = 1 << 1; + /** + * Capability bit flag indicating that GNSS supports reflecting planes measurement + * corrections + */ + const int CAPABILITY_REFLECTING_PLANE = 1 << 2; + + /** + * Callback to inform framework the measurement correction specific capabilities of the GNSS + * HAL implementation. + * + * The GNSS HAL must call this method immediately after the framework opens the measurement + * corrections interface. + * + * @param capabilities A bit field of flags indicating the capabilities of measurement + * corrections. + * It is mandatory to support either LOS_STATS or EXCESS_PATH_LENGTH capability. + */ + void setCapabilitiesCb(in int capabilities); +} diff --git a/gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl b/gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl new file mode 100644 index 0000000000..eeabc6d399 --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.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. + */ + +package android.hardware.gnss.measurement_corrections; + +import android.hardware.gnss.measurement_corrections.IMeasurementCorrectionsCallback; +import android.hardware.gnss.measurement_corrections.MeasurementCorrections; + +/** + * Interface for measurement corrections support. + */ +@VintfStability +interface IMeasurementCorrectionsInterface { + /** + * Injects measurement corrections to be used by the HAL to improve the GNSS location output. + * + * These are NOT to be used to adjust the IGnssMeasurementCallback output values - + * those remain raw, uncorrected measurements. + * + * In general, these are injected when conditions defined by the platform are met, such as when + * GNSS Location is being requested at a sufficiently high accuracy, based on the capabilities + * of the GNSS chipset as reported in the IGnssCallback. + * + * @param corrections The computed corrections to be used by the HAL. + */ + void setCorrections(in MeasurementCorrections corrections); + + /** + * Opens the interface and provides the callback routines to the implementation of this + * interface. + * + * @param callback Callback interface for IMeasurementCorrections. + */ + void setCallback(in IMeasurementCorrectionsCallback callback); +} diff --git a/gnss/aidl/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl b/gnss/aidl/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl new file mode 100644 index 0000000000..285c7d4faa --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl @@ -0,0 +1,102 @@ +/* + * 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. + */ + +package android.hardware.gnss.measurement_corrections; + +import android.hardware.gnss.measurement_corrections.SingleSatCorrection; + +/** + * A struct containing a set of measurement corrections for all used GNSS satellites at the location + * specified by latitudeDegrees, longitudeDegrees, altitudeMeters and at the time of week specified + * toaGpsNanosecondsOfWeek + */ +@VintfStability +parcelable MeasurementCorrections { + /** Represents latitude in degrees at which the corrections are computed.. */ + double latitudeDegrees; + + /** Represents longitude in degrees at which the corrections are computed.. */ + double longitudeDegrees; + + /** + * Represents altitude in meters above the WGS 84 reference ellipsoid at which the corrections + * are computed. + */ + double altitudeMeters; + + /** + * Represents the horizontal uncertainty (63% to 68% confidence) in meters on the device + * position at which the corrections are provided. + * + * This value is useful for example to judge how accurate the provided corrections are. + */ + double horizontalPositionUncertaintyMeters; + + /** + * Represents the vertical uncertainty (63% to 68% confidence) in meters on the device position + * at which the corrections are provided. + * + * This value is useful for example to judge how accurate the provided corrections are. + */ + double verticalPositionUncertaintyMeters; + + /** Time Of Applicability, GPS time of week in nanoseconds. */ + long toaGpsNanosecondsOfWeek; + + /** + * A set of SingleSatCorrection each containing measurement corrections for a satellite in view + */ + SingleSatCorrection[] satCorrections; + + /** + * Boolean indicating if environment bearing is available. + */ + boolean hasEnvironmentBearing; + + /** + * Environment bearing in degrees clockwise from true North (0.0 to 360.0], in direction of + * user motion. Environment bearing is provided when it is known with high probability that + * velocity is aligned with an environment feature, such as a building or road. + * + * If user speed is zero, environmentBearingDegrees represents bearing of most recent speed + * that was > 0. + * + * As position approaches another road, environmentBearingUncertaintyDegrees will grow, and at + * some stage hasEnvironmentBearing = false. + * + * As position moves towards an open area, environmentBearingUncertaintyDegrees will grow, and + * at some stage hasEnvironmentBearing = false. + * + * If the road is curved in the vicinity of the user location, then + * environmentBearingUncertaintyDegrees will include the amount by which the road direction + * changes in the area of position uncertainty. + * + * hasEnvironmentBearing should be checked to verify the environment bearing is available + * before calling this method. The value is undefined if hasEnvironmentBearing is false. + */ + float environmentBearingDegrees; + + /** + * Environment bearing uncertainty [0 to 180]. It represents the standard deviation of the + * physical structure in the circle of position uncertainty. hasEnvironmentBearing becomes false + * as the uncertainty value passes a predefined threshold depending on the physical structure + * around the user. + * + * hasEnvironmentBearing should be checked to verify the environment bearing is available + * before calling this method. The value is undefined if hasEnvironmentBearing is false. + */ + float environmentBearingUncertaintyDegrees; +} diff --git a/gnss/aidl/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl b/gnss/aidl/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl new file mode 100644 index 0000000000..9bf2b4417d --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/measurement_corrections/ReflectingPlane.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. + */ + +package android.hardware.gnss.measurement_corrections; + +/** + * A struct containing the characteristics of the reflecting plane that the satellite signal has + * bounced from. + * + * The value is only valid if HAS_REFLECTING_PLANE flag is set. An invalid reflecting plane + * means either reflection planes serving is not supported or the satellite signal has gone + * through multiple reflections. + */ +@VintfStability +parcelable ReflectingPlane { + /** Represents latitude of the reflecting plane in degrees. */ + double latitudeDegrees; + + /** Represents longitude of the reflecting plane in degrees. */ + double longitudeDegrees; + + /** + * Represents altitude of the reflecting point in the plane in meters above the WGS 84 reference + * ellipsoid. + */ + double altitudeMeters; + + /** Represents azimuth clockwise from north of the reflecting plane in degrees. */ + double azimuthDegrees; +} diff --git a/gnss/aidl/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl b/gnss/aidl/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl new file mode 100644 index 0000000000..d9f7105170 --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl @@ -0,0 +1,85 @@ +/* + * 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. + */ + +package android.hardware.gnss.measurement_corrections; + +import android.hardware.gnss.GnssConstellationType; +import android.hardware.gnss.measurement_corrections.ReflectingPlane; + +/** + * A struct with measurement corrections for a single visible satellites + * + * The bit mask singleSatCorrectionFlags indicates which correction values are valid in the struct + */ +@VintfStability +parcelable SingleSatCorrection { + /** Bit mask to indicate which values are valid in a SingleSatCorrection object. */ + /** GnssSingleSatCorrectionFlags has valid satellite-is-line-of-sight-probability field. */ + const int SINGLE_SAT_CORRECTION_HAS_SAT_IS_LOS_PROBABILITY = 0x0001; + /** GnssSingleSatCorrectionFlags has valid Excess Path Length field. */ + const int SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH = 0x0002; + /** GnssSingleSatCorrectionFlags has valid Excess Path Length Uncertainty field. */ + const int SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH_UNC = 0x0004; + /** GnssSingleSatCorrectionFlags has valid Reflecting Plane field. */ + const int SINGLE_SAT_CORRECTION_HAS_REFLECTING_PLANE = 0x0008; + + /** Contains GnssSingleSatCorrectionFlags bits. */ + int singleSatCorrectionFlags; + + /** + * Defines the constellation of the given satellite. + */ + GnssConstellationType constellation; + + /** + * Satellite vehicle ID number, as defined in GnssSvInfo::svid + */ + int svid; + + /** + * Carrier frequency of the signal to be corrected, for example it can be the + * GPS center frequency for L1 = 1,575,420,000 Hz, varying GLO channels, etc. + * + * For a receiver with capabilities to track multiple frequencies for the same satellite, + * multiple corrections for the same satellite may be provided. + */ + long carrierFrequencyHz; + + /** + * The probability that the satellite is estimated to be in Line-of-Sight condition at the given + * location. + */ + float probSatIsLos; + + /** + * Excess path length to be subtracted from pseudorange before using it in calculating location. + * + * Note this value is NOT to be used to adjust the GnsseasurementCallback outputs. + */ + float excessPathLengthMeters; + + /** Error estimate (1-sigma) for the Excess path length estimate */ + float excessPathLengthUncertaintyMeters; + + /** + * Defines the reflecting plane characteristics such as location and azimuth + * + * The value is only valid if HAS_REFLECTING_PLANE flag is set. An invalid reflecting plane + * means either reflection planes serving is not supported or the satellite signal has gone + * through multiple reflections. + */ + ReflectingPlane reflectingPlane; +} diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index 0031dcf92a..3be7fb929e 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -68,6 +68,7 @@ cc_binary { "GnssConfiguration.cpp", "GnssMeasurementInterface.cpp", "GnssVisibilityControl.cpp", + "MeasurementCorrectionsInterface.cpp", "service.cpp", ], static_libs: [ diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 2c6df995f1..033088506b 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -30,6 +30,7 @@ #include "GnssNavigationMessageInterface.h" #include "GnssPsds.h" #include "GnssVisibilityControl.h" +#include "MeasurementCorrectionsInterface.h" #include "NmeaFixInfo.h" #include "Utils.h" @@ -289,4 +290,14 @@ ndk::ScopedAStatus Gnss::getExtensionGnssAntennaInfo( return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Gnss::getExtensionMeasurementCorrections( + std::shared_ptr* + iMeasurementCorrections) { + ALOGD("Gnss::getExtensionMeasurementCorrections"); + + *iMeasurementCorrections = + SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index b92f4fb9ba..478dc94e4d 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -72,6 +73,10 @@ class Gnss : public BnGnss { iGnssVisibilityControl) override; ndk::ScopedAStatus getExtensionGnssAntennaInfo( std::shared_ptr* iGnssAntennaInfo) override; + ndk::ScopedAStatus getExtensionMeasurementCorrections( + std::shared_ptr* iMeasurementCorrections) + override; std::shared_ptr mGnssConfiguration; std::shared_ptr mGnssPowerIndication; diff --git a/gnss/aidl/default/MeasurementCorrectionsInterface.cpp b/gnss/aidl/default/MeasurementCorrectionsInterface.cpp new file mode 100644 index 0000000000..0f1851cafe --- /dev/null +++ b/gnss/aidl/default/MeasurementCorrectionsInterface.cpp @@ -0,0 +1,68 @@ +/* + * 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. + */ + +#define LOG_TAG "MeasurementCorrectionsInterface" + +#include "MeasurementCorrectionsInterface.h" +#include +#include + +namespace aidl::android::hardware::gnss::measurement_corrections { + +std::shared_ptr MeasurementCorrectionsInterface::sCallback = + nullptr; + +ndk::ScopedAStatus MeasurementCorrectionsInterface::setCorrections( + const MeasurementCorrections& corrections) { + ALOGD("setCorrections"); + ALOGD("corrections = lat: %f, lng: %f, alt: %f, hUnc: %f, vUnc: %f, toa: %llu, " + "satCorrections.size: %d", + corrections.latitudeDegrees, corrections.longitudeDegrees, corrections.altitudeMeters, + corrections.horizontalPositionUncertaintyMeters, + corrections.verticalPositionUncertaintyMeters, + static_cast(corrections.toaGpsNanosecondsOfWeek), + static_cast(corrections.satCorrections.size())); + for (auto singleSatCorrection : corrections.satCorrections) { + ALOGD("singleSatCorrection = flags: %d, constellation: %d, svid: %d" + ", cfHz: %" PRId64 ", probLos: %f, epl: %f, eplUnc: %f", + singleSatCorrection.singleSatCorrectionFlags, singleSatCorrection.constellation, + singleSatCorrection.svid, singleSatCorrection.carrierFrequencyHz, + singleSatCorrection.probSatIsLos, singleSatCorrection.excessPathLengthMeters, + singleSatCorrection.excessPathLengthUncertaintyMeters); + ALOGD("reflecting plane = lat: %f, lng: %f, alt: %f, azm: %f", + singleSatCorrection.reflectingPlane.latitudeDegrees, + singleSatCorrection.reflectingPlane.longitudeDegrees, + singleSatCorrection.reflectingPlane.altitudeMeters, + singleSatCorrection.reflectingPlane.azimuthDegrees); + } + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus MeasurementCorrectionsInterface::setCallback( + const std::shared_ptr& callback) { + ALOGD("MeasurementCorrections::setCallback"); + std::unique_lock lock(mMutex); + sCallback = callback; + auto ret = sCallback->setCapabilitiesCb( + IMeasurementCorrectionsCallback::CAPABILITY_LOS_SATS | + IMeasurementCorrectionsCallback::CAPABILITY_EXCESS_PATH_LENGTH | + IMeasurementCorrectionsCallback::CAPABILITY_REFLECTING_PLANE); + if (!ret.isOk()) { + ALOGE("%s: Unable to invoke callback", __func__); + } + return ndk::ScopedAStatus::ok(); +} +} // namespace aidl::android::hardware::gnss::measurement_corrections diff --git a/gnss/aidl/default/MeasurementCorrectionsInterface.h b/gnss/aidl/default/MeasurementCorrectionsInterface.h new file mode 100644 index 0000000000..af58725050 --- /dev/null +++ b/gnss/aidl/default/MeasurementCorrectionsInterface.h @@ -0,0 +1,36 @@ +/* + * 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 + +namespace aidl::android::hardware::gnss::measurement_corrections { + +struct MeasurementCorrectionsInterface : public BnMeasurementCorrectionsInterface { + public: + ndk::ScopedAStatus setCorrections(const MeasurementCorrections& corrections) override; + ndk::ScopedAStatus setCallback( + const std::shared_ptr& callback) override; + + private: + // Synchronization lock for sCallback + mutable std::mutex mMutex; + // Guarded by mMutex + static std::shared_ptr sCallback; +}; + +} // namespace aidl::android::hardware::gnss::measurement_corrections diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp index b23a646ae1..4244ab354d 100644 --- a/gnss/aidl/vts/Android.bp +++ b/gnss/aidl/vts/Android.bp @@ -39,6 +39,7 @@ cc_test { "GnssNavigationMessageCallback.cpp", "GnssPowerIndicationCallback.cpp", "GnssVisibilityControlCallback.cpp", + "MeasurementCorrectionsCallback.cpp", "VtsHalGnssTargetTest.cpp", ], shared_libs: [ diff --git a/gnss/aidl/vts/MeasurementCorrectionsCallback.cpp b/gnss/aidl/vts/MeasurementCorrectionsCallback.cpp new file mode 100644 index 0000000000..db1f7a6893 --- /dev/null +++ b/gnss/aidl/vts/MeasurementCorrectionsCallback.cpp @@ -0,0 +1,26 @@ +/* + * 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. + */ + +#define LOG_TAG "MeasurementCorrectionsCallback" + +#include "MeasurementCorrectionsCallback.h" +#include + +android::binder::Status MeasurementCorrectionsCallback::setCapabilitiesCb(const int capabilities) { + ALOGI("Capabilities received %d", capabilities); + capabilities_cbq_.store(capabilities); + return android::binder::Status::ok(); +} diff --git a/gnss/aidl/vts/MeasurementCorrectionsCallback.h b/gnss/aidl/vts/MeasurementCorrectionsCallback.h new file mode 100644 index 0000000000..27e5b3cde2 --- /dev/null +++ b/gnss/aidl/vts/MeasurementCorrectionsCallback.h @@ -0,0 +1,31 @@ +/* + * 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 +#include "GnssCallbackEventQueue.h" + +class MeasurementCorrectionsCallback + : public android::hardware::gnss::measurement_corrections::BnMeasurementCorrectionsCallback { + public: + MeasurementCorrectionsCallback() : capabilities_cbq_("capabilities"){}; + ~MeasurementCorrectionsCallback(){}; + android::binder::Status setCapabilitiesCb(const int capabilities) override; + + android::hardware::gnss::common::GnssCallbackEventQueue capabilities_cbq_; + int last_capabilities_; +}; diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index f5f0aa4c52..6e363f9815 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include "AGnssCallbackAidl.h" @@ -35,6 +36,8 @@ #include "GnssNavigationMessageCallback.h" #include "GnssPowerIndicationCallback.h" #include "GnssVisibilityControlCallback.h" +#include "MeasurementCorrectionsCallback.h" +#include "Utils.h" #include "gnss_hal_test.h" using android::sp; @@ -62,6 +65,8 @@ using android::hardware::gnss::IGnssPowerIndication; using android::hardware::gnss::IGnssPsds; using android::hardware::gnss::PsdsType; using android::hardware::gnss::SatellitePvt; +using android::hardware::gnss::common::Utils; +using android::hardware::gnss::measurement_corrections::IMeasurementCorrectionsInterface; using android::hardware::gnss::visibility_control::IGnssVisibilityControl; using GnssConstellationTypeV2_0 = android::hardware::gnss::V2_0::GnssConstellationType; @@ -909,7 +914,6 @@ TEST_P(GnssHalTest, GnssDebugValuesSanityTest) { } /* - * TestAGnssExtension: * TestGnssVisibilityControlExtension: * 1. Gets the IGnssVisibilityControl extension. * 2. Sets GnssVisibilityControlCallback @@ -1095,3 +1099,43 @@ TEST_P(GnssHalTest, TestGnssAntennaInfo) { iGnssAntennaInfo->close(); } + +/* + * TestGnssMeasurementCorrections: + * If measurement corrections capability is supported, verifies that the measurement corrections + * capabilities are reported and the mandatory LOS_SATS or the EXCESS_PATH_LENGTH + * capability flag is set. + */ +TEST_P(GnssHalTest, TestGnssMeasurementCorrections) { + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + return; + } + if (!(aidl_gnss_cb_->last_capabilities_ & + (int)GnssCallbackAidl::CAPABILITY_MEASUREMENT_CORRECTIONS)) { + return; + } + + sp iMeasurementCorrectionsAidl; + auto status = aidl_gnss_hal_->getExtensionMeasurementCorrections(&iMeasurementCorrectionsAidl); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(iMeasurementCorrectionsAidl != nullptr); + + // Setup measurement corrections callback. + auto gnssMeasurementCorrectionsCallback = sp::make(); + status = iMeasurementCorrectionsAidl->setCallback(gnssMeasurementCorrectionsCallback); + ASSERT_TRUE(status.isOk()); + + const int kTimeoutSec = 5; + EXPECT_TRUE(gnssMeasurementCorrectionsCallback->capabilities_cbq_.retrieve( + gnssMeasurementCorrectionsCallback->last_capabilities_, kTimeoutSec)); + ASSERT_TRUE(gnssMeasurementCorrectionsCallback->capabilities_cbq_.calledCount() > 0); + + ASSERT_TRUE((gnssMeasurementCorrectionsCallback->last_capabilities_ & + (MeasurementCorrectionsCallback::CAPABILITY_LOS_SATS | + MeasurementCorrectionsCallback::CAPABILITY_EXCESS_PATH_LENGTH)) != 0); + + // Set a mock MeasurementCorrections. + status = iMeasurementCorrectionsAidl->setCorrections( + Utils::getMockMeasurementCorrections_aidl()); + ASSERT_TRUE(status.isOk()); +} diff --git a/gnss/common/utils/vts/Utils.cpp b/gnss/common/utils/vts/Utils.cpp index 06bce9d3a7..da4c07fc05 100644 --- a/gnss/common/utils/vts/Utils.cpp +++ b/gnss/common/utils/vts/Utils.cpp @@ -15,6 +15,7 @@ */ #include +#include #include #include "gtest/gtest.h" @@ -28,6 +29,12 @@ namespace common { using namespace measurement_corrections::V1_0; using V1_0::GnssLocationFlags; +using MeasurementCorrectionsAidl = + android::hardware::gnss::measurement_corrections::MeasurementCorrections; +using ReflectingPlaneAidl = android::hardware::gnss::measurement_corrections::ReflectingPlane; +using SingleSatCorrectionAidl = + android::hardware::gnss::measurement_corrections::SingleSatCorrection; + template <> int64_t Utils::getLocationTimestampMillis(const android::hardware::gnss::GnssLocation& location) { return location.timestampMillis; @@ -63,6 +70,7 @@ const MeasurementCorrections Utils::getMockMeasurementCorrections() { .singleSatCorrectionFlags = GnssSingleSatCorrectionFlags::HAS_SAT_IS_LOS_PROBABILITY | GnssSingleSatCorrectionFlags::HAS_EXCESS_PATH_LENGTH | GnssSingleSatCorrectionFlags::HAS_EXCESS_PATH_LENGTH_UNC, + .constellation = V1_0::GnssConstellationType::GPS, .svid = 9, .carrierFrequencyHz = 1.59975e+09, @@ -114,6 +122,56 @@ Utils::getMockMeasurementCorrections_1_1() { return mockCorrections_1_1; } +const MeasurementCorrectionsAidl Utils::getMockMeasurementCorrections_aidl() { + ReflectingPlaneAidl reflectingPlane; + reflectingPlane.latitudeDegrees = 37.4220039; + reflectingPlane.longitudeDegrees = -122.0840991; + reflectingPlane.altitudeMeters = 250.35; + reflectingPlane.azimuthDegrees = 203.0; + + SingleSatCorrectionAidl singleSatCorrection1; + singleSatCorrection1.singleSatCorrectionFlags = + SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_SAT_IS_LOS_PROBABILITY | + SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH | + SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH_UNC | + SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_REFLECTING_PLANE; + singleSatCorrection1.constellation = android::hardware::gnss::GnssConstellationType::GPS; + singleSatCorrection1.svid = 12; + singleSatCorrection1.carrierFrequencyHz = 1.59975e+09; + singleSatCorrection1.probSatIsLos = 0.50001; + singleSatCorrection1.excessPathLengthMeters = 137.4802; + singleSatCorrection1.excessPathLengthUncertaintyMeters = 25.5; + singleSatCorrection1.reflectingPlane = reflectingPlane; + + SingleSatCorrectionAidl singleSatCorrection2; + singleSatCorrection2.singleSatCorrectionFlags = + SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_SAT_IS_LOS_PROBABILITY | + SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH | + SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH_UNC; + singleSatCorrection2.constellation = GnssConstellationType::GPS; + singleSatCorrection2.svid = 9; + singleSatCorrection2.carrierFrequencyHz = 1.59975e+09; + singleSatCorrection2.probSatIsLos = 0.873; + singleSatCorrection2.excessPathLengthMeters = 26.294; + singleSatCorrection2.excessPathLengthUncertaintyMeters = 10.0; + + std::vector singleSatCorrections = {singleSatCorrection1, + singleSatCorrection2}; + MeasurementCorrectionsAidl mockCorrections; + mockCorrections.latitudeDegrees = 37.4219999; + mockCorrections.longitudeDegrees = -122.0840575; + mockCorrections.altitudeMeters = 30.60062531; + mockCorrections.horizontalPositionUncertaintyMeters = 9.23542; + mockCorrections.verticalPositionUncertaintyMeters = 15.02341; + mockCorrections.toaGpsNanosecondsOfWeek = 2935633453L; + mockCorrections.hasEnvironmentBearing = true; + mockCorrections.environmentBearingDegrees = 45.0; + mockCorrections.environmentBearingUncertaintyDegrees = 4.0; + mockCorrections.satCorrections = singleSatCorrections; + + return mockCorrections; +} + /* * MapConstellationType: * Given a GnssConstellationType_2_0 type constellation, maps to its equivalent diff --git a/gnss/common/utils/vts/include/Utils.h b/gnss/common/utils/vts/include/Utils.h index 40f31d288e..4ea6cd617d 100644 --- a/gnss/common/utils/vts/include/Utils.h +++ b/gnss/common/utils/vts/include/Utils.h @@ -21,6 +21,8 @@ #include #include #include +#include + #include namespace android { @@ -36,6 +38,8 @@ struct Utils { getMockMeasurementCorrections(); static const measurement_corrections::V1_1::MeasurementCorrections getMockMeasurementCorrections_1_1(); + static const android::hardware::gnss::measurement_corrections::MeasurementCorrections + getMockMeasurementCorrections_aidl(); static V1_0::GnssConstellationType mapConstellationType( V2_0::GnssConstellationType constellation); -- GitLab From ad5d0702b7f4f010ae29be91362444e0ec55a85f Mon Sep 17 00:00:00 2001 From: Joe Huang Date: Wed, 19 Jan 2022 19:01:44 +0800 Subject: [PATCH 450/825] Remove GnssAntennaInfo AIDL capability Since JNI is not ready yet, remove it to avoid cts fail. Bug: 215281989 Test: atest LocationManagerFineTest Change-Id: I69ced31e1de54ef9a325ba20020f1913fe3daddd --- gnss/aidl/default/Gnss.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 2c6df995f1..797570b1e2 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -57,8 +57,7 @@ ScopedAStatus Gnss::setCallback(const std::shared_ptr& callback) int capabilities = (int)(IGnssCallback::CAPABILITY_SATELLITE_BLOCKLIST | IGnssCallback::CAPABILITY_SATELLITE_PVT | - IGnssCallback::CAPABILITY_CORRELATION_VECTOR | - IGnssCallback::CAPABILITY_ANTENNA_INFO); + IGnssCallback::CAPABILITY_CORRELATION_VECTOR); auto status = sGnssCallback->gnssSetCapabilitiesCb(capabilities); if (!status.isOk()) { -- GitLab From 0cf627aed2fed5d38897473a063fb97fde527fdd Mon Sep 17 00:00:00 2001 From: Ahmed ElArabawy Date: Tue, 18 Jan 2022 18:07:54 -0800 Subject: [PATCH 451/825] Wifi: Add vendor hal 1.6 to rc and make files This CL adds ver 1.6 in Android.bp and rc file. Those were missed when the HAL version was uprev'd to 1.6 Bug: 214108561 Test: atest VtsHalWifiV1_0TargetTest VtsHalWifiNanV1_0TargetTest VtsHalWifiApV1_0TargetTest \ VtsHalWifiV1_1TargetTest \ VtsHalWifiV1_2TargetTest VtsHalWifiNanV1_2TargetTest \ VtsHalWifiV1_3TargetTest \ VtsHalWifiApV1_4TargetTest VtsHalWifiNanV1_4TargetTest VtsHalWifiRttV1_4TargetTest \ VtsHalWifiV1_5TargetTest VtsHalWifiNanV1_5TargetTest VtsHalWifiApV1_5TargetTest Change-Id: I5ce531b92af12b54b4a25548e6fef1198fb23716 --- wifi/1.6/default/Android.bp | 2 ++ wifi/1.6/default/android.hardware.wifi@1.0-service-lazy.rc | 1 + 2 files changed, 3 insertions(+) diff --git a/wifi/1.6/default/Android.bp b/wifi/1.6/default/Android.bp index 6333b6e265..d48d18332f 100644 --- a/wifi/1.6/default/Android.bp +++ b/wifi/1.6/default/Android.bp @@ -33,6 +33,7 @@ cc_defaults { "android.hardware.wifi@1.3", "android.hardware.wifi@1.4", "android.hardware.wifi@1.5", + "android.hardware.wifi@1.6", "libbase", "libcutils", "libhidlbase", @@ -84,6 +85,7 @@ cc_defaults { "android.hardware.wifi@1.3", "android.hardware.wifi@1.4", "android.hardware.wifi@1.5", + "android.hardware.wifi@1.6", "libbase", "libcutils", "libhidlbase", diff --git a/wifi/1.6/default/android.hardware.wifi@1.0-service-lazy.rc b/wifi/1.6/default/android.hardware.wifi@1.0-service-lazy.rc index bc6bb6a7e6..ee8c818d90 100644 --- a/wifi/1.6/default/android.hardware.wifi@1.0-service-lazy.rc +++ b/wifi/1.6/default/android.hardware.wifi@1.0-service-lazy.rc @@ -5,6 +5,7 @@ service vendor.wifi_hal_legacy /vendor/bin/hw/android.hardware.wifi@1.0-service- interface android.hardware.wifi@1.3::IWifi default interface android.hardware.wifi@1.4::IWifi default interface android.hardware.wifi@1.5::IWifi default + interface android.hardware.wifi@1.6::IWifi default oneshot disabled class hal -- GitLab From 0d91cbe39a81614f99f11cfa04d1a926bff18848 Mon Sep 17 00:00:00 2001 From: Shinru Han Date: Tue, 14 Dec 2021 12:06:02 +0800 Subject: [PATCH 452/825] Reland "Add IAGnssRil AIDL HAL (hardware/interfaces)" Bug: 205185251 Bug: 182975915 Test: atest VtsHalGnssTargetTest Change-Id: I7f8d0b367c68ba870d0a222aee4ee4b5b93cc936 --- .../android/hardware/gnss/IAGnssRil.aidl | 79 +++++++++ .../hardware/gnss/IAGnssRilCallback.aidl | 39 ++++ .../current/android/hardware/gnss/IGnss.aidl | 1 + .../aidl/android/hardware/gnss/IAGnssRil.aidl | 166 ++++++++++++++++++ .../hardware/gnss/IAGnssRilCallback.aidl | 38 ++++ gnss/aidl/android/hardware/gnss/IGnss.aidl | 8 + gnss/aidl/default/AGnssRil.cpp | 58 ++++++ gnss/aidl/default/AGnssRil.h | 37 ++++ gnss/aidl/default/Android.bp | 1 + gnss/aidl/default/Gnss.cpp | 9 +- gnss/aidl/default/Gnss.h | 2 + gnss/aidl/vts/AGnssRilCallbackAidl.cpp | 28 +++ gnss/aidl/vts/AGnssRilCallbackAidl.h | 28 +++ gnss/aidl/vts/Android.bp | 1 + gnss/aidl/vts/gnss_hal_test_cases.cpp | 38 ++++ 15 files changed, 532 insertions(+), 1 deletion(-) create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.aidl create mode 100644 gnss/aidl/android/hardware/gnss/IAGnssRil.aidl create mode 100644 gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl create mode 100644 gnss/aidl/default/AGnssRil.cpp create mode 100644 gnss/aidl/default/AGnssRil.h create mode 100644 gnss/aidl/vts/AGnssRilCallbackAidl.cpp create mode 100644 gnss/aidl/vts/AGnssRilCallbackAidl.h 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 new file mode 100644 index 0000000000..73df1950bf --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl @@ -0,0 +1,79 @@ +/* + * 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 -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.gnss; +@VintfStability +interface IAGnssRil { + void setCallback(in android.hardware.gnss.IAGnssRilCallback callback); + void setRefLocation(in android.hardware.gnss.IAGnssRil.AGnssRefLocation agnssReflocation); + void setSetId(in android.hardware.gnss.IAGnssRil.SetIDType type, in @utf8InCpp String setid); + void updateNetworkState(in android.hardware.gnss.IAGnssRil.NetworkAttributes attributes); + const int NETWORK_CAPABILITY_NOT_METERED = 1; + const int NETWORK_CAPABILITY_NOT_ROAMING = 2; + @Backing(type="int") @VintfStability + enum AGnssRefLocationType { + GSM_CELLID = 1, + UMTS_CELLID = 2, + LTE_CELLID = 4, + NR_CELLID = 8, + } + @Backing(type="int") @VintfStability + enum SetIDType { + NONE = 0, + IMSI = 1, + MSISDM = 2, + } + @VintfStability + parcelable AGnssRefLocationCellID { + android.hardware.gnss.IAGnssRil.AGnssRefLocationType type; + int mcc; + int mnc; + int lac; + long cid; + int tac; + int pcid; + int arfcn; + } + @VintfStability + parcelable AGnssRefLocation { + android.hardware.gnss.IAGnssRil.AGnssRefLocationType type; + android.hardware.gnss.IAGnssRil.AGnssRefLocationCellID cellID; + } + @VintfStability + parcelable NetworkAttributes { + long networkHandle; + boolean isConnected; + int capabilities; + @utf8InCpp String apn; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.aidl new file mode 100644 index 0000000000..152b10aea0 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.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 -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.gnss; +@VintfStability +interface IAGnssRilCallback { + void requestSetIdCb(in int setIdflag); + void requestRefLocCb(); +} 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 281c531977..45f37d2e7a 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 @@ -44,6 +44,7 @@ interface IGnss { @nullable android.hardware.gnss.IGnssGeofence getExtensionGnssGeofence(); @nullable android.hardware.gnss.IGnssNavigationMessageInterface getExtensionGnssNavigationMessage(); android.hardware.gnss.IAGnss getExtensionAGnss(); + android.hardware.gnss.IAGnssRil getExtensionAGnssRil(); android.hardware.gnss.IGnssDebug getExtensionGnssDebug(); android.hardware.gnss.visibility_control.IGnssVisibilityControl getExtensionGnssVisibilityControl(); void start(); diff --git a/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl b/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl new file mode 100644 index 0000000000..c506b04968 --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.gnss; + +import android.hardware.gnss.IAGnssRilCallback; +import android.hardware.gnss.IAGnssRilCallback.SetIDType; + +/** + * Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface + * Layer interface allows the GNSS chipset to request radio interface layer + * information from Android platform. Examples of such information are reference + * location, unique subscriber ID, phone number string and network availability changes. + */ +@VintfStability +interface IAGnssRil { + /** Network capability mode bitmask for not metered. */ + const int NETWORK_CAPABILITY_NOT_METERED = 0x01; + + /** Network capability mode bitmask for not roaming. */ + const int NETWORK_CAPABILITY_NOT_ROAMING = 0x02; + + /** AGNSS reference location type */ + @VintfStability + @Backing(type="int") + enum AGnssRefLocationType { + GSM_CELLID = 1, + UMTS_CELLID = 2, + LTE_CELLID = 4, + NR_CELLID = 8, + } + + /** SET ID type*/ + @VintfStability + @Backing(type="int") + enum SetIDType { + NONE = 0, + IMSI = 1, + MSISDM = 2, + } + + /** + * CellID for 2G, 3G ,LTE and NR used in AGNSS. This is defined in + * UserPlane Location Protocol (Version 2.0.4). + */ + @VintfStability + parcelable AGnssRefLocationCellID { + AGnssRefLocationType type; + + /** Mobile Country Code. */ + int mcc; + + /** Mobile Network Code .*/ + int mnc; + + /** + * Location Area Code in 2G, 3G and LTE. In 3G lac is discarded. In LTE, + * lac is populated with tac, to ensure that we don't break old clients that + * might rely on the old (wrong) behavior. + */ + int lac; + + /** + * Cell id in 2G. Utran Cell id in 3G. Cell Global Id EUTRA in LTE. + * Cell Global Id NR in 5G. + */ + long cid; + + /** Tracking Area Code in LTE and NR. */ + int tac; + + /** Physical Cell id in LTE and NR (not used in 2G and 3G) */ + int pcid; + + /** Absolute Radio Frequency Channel Number in NR. */ + int arfcn; + } + + /** Represents ref locations */ + @VintfStability + parcelable AGnssRefLocation { + AGnssRefLocationType type; + + AGnssRefLocationCellID cellID; + } + + /** Represents network connection status and capabilities. */ + @VintfStability + parcelable NetworkAttributes { + /** Network handle of the network for use with the NDK API. */ + long networkHandle; + + /** + * True indicates that network connectivity exists and it is possible to + * establish connections and pass data. If false, only the networkHandle field + * is populated to indicate that this network has just disconnected. + */ + boolean isConnected; + + /** + * A bitfield of flags indicating the capabilities of this network. The bit masks are + * defined in NETWORK_CAPABILITY_*. + */ + int capabilities; + + /** + * Telephony preferred Access Point Name to use for carrier data connection when + * connected to a cellular network. Empty string, otherwise. + */ + @utf8InCpp String apn; + } + + /** + * Opens the AGNSS interface and provides the callback routines + * to the implementation of this interface. + * + * @param callback Interface for AGnssRil callbacks. + * + */ + void setCallback(in IAGnssRilCallback callback); + + /** + * Sets the reference location. + * + * @param agnssReflocation AGNSS reference location CellID. + * + */ + void setRefLocation(in AGnssRefLocation agnssReflocation); + + /** + * Sets the SET ID. + * + * @param type Must be populated with either IMSI or MSISDN or NONE. + * @param setid If type is IMSI then setid is populated with + * a string representing the unique Subscriber ID, for example, the IMSI for + * a GMS phone. If type is MSISDN, then setid must contain + * the phone number string for line 1. For example, the MSISDN for a GSM phone. + * If the type is NONE, then the string must be empty. + * + */ + void setSetId(in SetIDType type, in @utf8InCpp String setid); + + /** + * Notifies GNSS of network status changes. + * + * The framework calls this method to update the GNSS HAL implementation of network + * state changes. + * + * @param attributes Updated network attributes. + * + */ + void updateNetworkState(in NetworkAttributes attributes); +} diff --git a/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl b/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl new file mode 100644 index 0000000000..6fb093e165 --- /dev/null +++ b/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.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. + */ + +package android.hardware.gnss; + +/** + * Callback for IAGnssRil interface. Used to request SET ID and + * Reference Location. + */ +@VintfStability +interface IAGnssRilCallback { + /** + * The Hal uses this API to request a SET ID. + * + * @param setIdflag A bitfield of IAGnssRil.SetIDType that is required by + * the HAL. The framework will inject an empty SET ID if the flag is NONE. + * + */ + void requestSetIdCb(in int setIdflag); + + /** + * The Hal uses this API to request a reference location. + */ + void requestRefLocCb(); +} diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl index e1d46703fa..d2fa07d362 100644 --- a/gnss/aidl/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl @@ -18,6 +18,7 @@ package android.hardware.gnss; import android.hardware.gnss.GnssLocation; import android.hardware.gnss.IAGnss; +import android.hardware.gnss.IAGnssRil; import android.hardware.gnss.IGnssAntennaInfo; import android.hardware.gnss.IGnssBatching; import android.hardware.gnss.IGnssCallback; @@ -186,6 +187,13 @@ interface IGnss { */ IAGnss getExtensionAGnss(); + /** + * This method returns the IAGnssRil interface. + * + * @return The IAGnssRil interface. + */ + IAGnssRil getExtensionAGnssRil(); + /** * This method returns the IGnssDebug interface. * diff --git a/gnss/aidl/default/AGnssRil.cpp b/gnss/aidl/default/AGnssRil.cpp new file mode 100644 index 0000000000..afe0039105 --- /dev/null +++ b/gnss/aidl/default/AGnssRil.cpp @@ -0,0 +1,58 @@ +/* + * 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. + */ + +#define LOG_TAG "AGnssRilAidl" + +#include "AGnssRil.h" +#include +#include + +namespace aidl::android::hardware::gnss { + +std::shared_ptr AGnssRil::sCallback = nullptr; + +ndk::ScopedAStatus AGnssRil::setCallback(const std::shared_ptr& callback) { + ALOGD("AGnssRil::setCallback"); + std::unique_lock lock(mMutex); + sCallback = callback; + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus AGnssRil::setRefLocation(const AGnssRefLocation& agnssReflocation) { + const AGnssRefLocationCellID& cellInfo = agnssReflocation.cellID; + ALOGD("AGnssRil::setRefLocation: type: %s, mcc: %d, mnc: %d, lac: %d, cid: %" PRId64 + ", tac: %d, pcid: " + "%d, arfcn: %d", + toString(agnssReflocation.type).c_str(), cellInfo.mcc, cellInfo.mnc, cellInfo.lac, + cellInfo.cid, cellInfo.tac, cellInfo.pcid, cellInfo.arfcn); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus AGnssRil::setSetId(SetIDType type, const std::string& setid) { + ALOGD("AGnssRil::setSetId: type:%s, setid: %s", toString(type).c_str(), setid.c_str()); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus AGnssRil::updateNetworkState(const NetworkAttributes& attributes) { + ALOGD("AGnssRil::updateNetworkState: networkHandle:%" PRId64 + ", isConnected: %d, capabilities: %d, " + "apn: %s", + attributes.networkHandle, attributes.isConnected, attributes.capabilities, + attributes.apn.c_str()); + return ndk::ScopedAStatus::ok(); +} + +} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/AGnssRil.h b/gnss/aidl/default/AGnssRil.h new file mode 100644 index 0000000000..7e429ee8f4 --- /dev/null +++ b/gnss/aidl/default/AGnssRil.h @@ -0,0 +1,37 @@ +/* + * 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 + +namespace aidl::android::hardware::gnss { + +struct AGnssRil : public BnAGnssRil { + public: + ndk::ScopedAStatus setCallback(const std::shared_ptr& callback) override; + ndk::ScopedAStatus setRefLocation(const AGnssRefLocation& agnssReflocation) override; + ndk::ScopedAStatus setSetId(SetIDType type, const std::string& setid) override; + ndk::ScopedAStatus updateNetworkState(const NetworkAttributes& attributes) override; + + private: + // Synchronization lock for sCallback + mutable std::mutex mMutex; + // Guarded by mMutex + static std::shared_ptr sCallback; +}; + +} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index 0031dcf92a..0707aaa97c 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -55,6 +55,7 @@ cc_binary { "android.hardware.gnss-V2-ndk", ], srcs: [ + "AGnssRil.cpp", "AGnss.cpp", "Gnss.cpp", "GnssAntennaInfo.cpp", diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 2c6df995f1..5867fe7429 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -20,6 +20,7 @@ #include #include #include "AGnss.h" +#include "AGnssRil.h" #include "DeviceFileReader.h" #include "GnssAntennaInfo.h" #include "GnssBatching.h" @@ -171,7 +172,7 @@ ScopedAStatus Gnss::close() { return ScopedAStatus::ok(); } -ndk::ScopedAStatus Gnss::getExtensionAGnss(std::shared_ptr* iAGnss) { +ScopedAStatus Gnss::getExtensionAGnss(std::shared_ptr* iAGnss) { ALOGD("Gnss::getExtensionAGnss"); *iAGnss = SharedRefBase::make(); return ndk::ScopedAStatus::ok(); @@ -183,6 +184,12 @@ ScopedAStatus Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs, int unce return ScopedAStatus::ok(); } +ScopedAStatus Gnss::getExtensionAGnssRil(std::shared_ptr* iAGnssRil) { + ALOGD("Gnss::getExtensionAGnssRil"); + *iAGnssRil = SharedRefBase::make(); + return ndk::ScopedAStatus::ok(); +} + ScopedAStatus Gnss::injectLocation(const GnssLocation& location) { ALOGD("injectLocation. lat:%lf, lng:%lf, acc:%f", location.latitudeDegrees, location.longitudeDegrees, location.horizontalAccuracyMeters); diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index b92f4fb9ba..b1fdac4a90 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -17,6 +17,7 @@ #pragma once #include +#include #include #include #include @@ -66,6 +67,7 @@ class Gnss : public BnGnss { ndk::ScopedAStatus getExtensionGnssNavigationMessage( std::shared_ptr* iGnssNavigationMessage) override; ndk::ScopedAStatus getExtensionAGnss(std::shared_ptr* iAGnss) override; + ndk::ScopedAStatus getExtensionAGnssRil(std::shared_ptr* iAGnssRil) override; ndk::ScopedAStatus getExtensionGnssDebug(std::shared_ptr* iGnssDebug) override; ndk::ScopedAStatus getExtensionGnssVisibilityControl( std::shared_ptr* diff --git a/gnss/aidl/vts/AGnssRilCallbackAidl.cpp b/gnss/aidl/vts/AGnssRilCallbackAidl.cpp new file mode 100644 index 0000000000..4e4166d61d --- /dev/null +++ b/gnss/aidl/vts/AGnssRilCallbackAidl.cpp @@ -0,0 +1,28 @@ +/* + * 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. + */ + +#include "AGnssRilCallbackAidl.h" +#include + +android::binder::Status AGnssRilCallbackAidl::requestSetIdCb(int setIdflag) { + ALOGI("requestSetIdCb setIdflag %d", setIdflag); + return android::binder::Status::ok(); +} + +android::binder::Status AGnssRilCallbackAidl::requestRefLocCb() { + ALOGI("requestRefLocCb"); + return android::binder::Status::ok(); +} diff --git a/gnss/aidl/vts/AGnssRilCallbackAidl.h b/gnss/aidl/vts/AGnssRilCallbackAidl.h new file mode 100644 index 0000000000..74b34eee94 --- /dev/null +++ b/gnss/aidl/vts/AGnssRilCallbackAidl.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +/** Implementation for IAGnssRilCallback. */ +class AGnssRilCallbackAidl : public android::hardware::gnss::BnAGnssRilCallback { + public: + AGnssRilCallbackAidl(){}; + ~AGnssRilCallbackAidl(){}; + android::binder::Status requestSetIdCb(int setIdflag) override; + android::binder::Status requestRefLocCb() override; +}; diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp index b23a646ae1..9e4b1c5609 100644 --- a/gnss/aidl/vts/Android.bp +++ b/gnss/aidl/vts/Android.bp @@ -31,6 +31,7 @@ cc_test { "gnss_hal_test.cpp", "gnss_hal_test_cases.cpp", "AGnssCallbackAidl.cpp", + "AGnssRilCallbackAidl.cpp", "GnssAntennaInfoCallbackAidl.cpp", "GnssBatchingCallback.cpp", "GnssCallbackAidl.cpp", diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index f5f0aa4c52..962d4bf261 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -28,6 +28,7 @@ #include #include #include "AGnssCallbackAidl.h" +#include "AGnssRilCallbackAidl.h" #include "GnssAntennaInfoCallbackAidl.h" #include "GnssBatchingCallback.h" #include "GnssGeofenceCallback.h" @@ -45,6 +46,7 @@ using android::hardware::gnss::GnssData; using android::hardware::gnss::GnssMeasurement; using android::hardware::gnss::GnssPowerStats; using android::hardware::gnss::IAGnss; +using android::hardware::gnss::IAGnssRil; using android::hardware::gnss::IGnss; using android::hardware::gnss::IGnssAntennaInfo; using android::hardware::gnss::IGnssAntennaInfoCallback; @@ -861,6 +863,42 @@ TEST_P(GnssHalTest, TestAGnssExtension) { ASSERT_TRUE(status.isOk()); } +/* + * TestAGnssRilExtension: + * 1. Gets the IAGnssRil extension. + * 2. Sets AGnssRilCallback. + * 3. Sets reference location. + */ +TEST_P(GnssHalTest, TestAGnssRilExtension) { + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + return; + } + sp iAGnssRil; + auto status = aidl_gnss_hal_->getExtensionAGnssRil(&iAGnssRil); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(iAGnssRil != nullptr); + + auto agnssRilCallback = sp::make(); + status = iAGnssRil->setCallback(agnssRilCallback); + ASSERT_TRUE(status.isOk()); + + // Set RefLocation + IAGnssRil::AGnssRefLocationCellID agnssReflocationCellId; + agnssReflocationCellId.type = IAGnssRil::AGnssRefLocationType::LTE_CELLID; + agnssReflocationCellId.mcc = 466; + agnssReflocationCellId.mnc = 97; + agnssReflocationCellId.lac = 46697; + agnssReflocationCellId.cid = 59168142; + agnssReflocationCellId.pcid = 420; + agnssReflocationCellId.tac = 11460; + IAGnssRil::AGnssRefLocation agnssReflocation; + agnssReflocation.type = IAGnssRil::AGnssRefLocationType::LTE_CELLID; + agnssReflocation.cellID = agnssReflocationCellId; + + status = iAGnssRil->setRefLocation(agnssReflocation); + ASSERT_TRUE(status.isOk()); +} + /* * GnssDebugValuesSanityTest: * Ensures that GnssDebug values make sense. -- GitLab From ea3ab4f3f37b7bd8c74a8d7c05516fce5d937430 Mon Sep 17 00:00:00 2001 From: Shuzhen Wang Date: Wed, 19 Jan 2022 00:01:04 +0000 Subject: [PATCH 453/825] Camera: VTS: Remove GRF MultiCamera for Android 12 Certain OEMs' new S launches with vendor freeze cannot implement multi-camera API. Test: Build Bug: 189053514 Bug: 211709637 Change-Id: I71b46f1e8343a5848cbe3fa55bbcd427c87b05dd (cherry picked from commit 30a198ded0bf3e03ac37470d8c2a58504c9b75d3) --- .../VtsHalCameraProviderV2_4TargetTest.cpp | 154 ------------------ 1 file changed, 154 deletions(-) diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index 01ec9cb2fc..ba61626dc5 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -949,7 +949,6 @@ public: void getPrivacyTestPatternModes( const camera_metadata_t* staticMetadata, std::unordered_set* privacyTestPatternModes/*out*/); - static bool isColorCamera(const camera_metadata_t *metadata); static V3_2::DataspaceFlags getDataspace(PixelFormat format); @@ -6419,142 +6418,6 @@ TEST_P(CameraHidlTest, configureInjectionStreamsWithSessionParameters) { } } -// Test the multi-camera API requirement for Google Requirement Freeze S -// Note that this requirement can only be partially tested. If a vendor -// device doesn't expose a physical camera in any shape or form, there is no way -// the test can catch it. -TEST_P(CameraHidlTest, grfSMultiCameraTest) { - const int socGrfApi = property_get_int32("ro.board.first_api_level", /*default*/ -1); - if (socGrfApi < 31 /*S*/) { - // Non-GRF devices, or version < 31 Skip - ALOGI("%s: socGrfApi level is %d. Skipping", __FUNCTION__, socGrfApi); - return; - } - - // Test that if more than one rear-facing color camera is - // supported, there must be at least one rear-facing logical camera. - hidl_vec cameraDeviceNames = getCameraDeviceNames(mProvider); - // Back facing non-logical color cameras - std::set rearColorCameras; - // Back facing logical cameras' physical camera Id sets - std::set> rearPhysicalIds; - for (const auto& name : cameraDeviceNames) { - std::string cameraId; - int deviceVersion = getCameraDeviceVersionAndId(name, mProviderType, &cameraId); - switch (deviceVersion) { - case CAMERA_DEVICE_API_VERSION_3_8: - case CAMERA_DEVICE_API_VERSION_3_7: - case CAMERA_DEVICE_API_VERSION_3_6: - case CAMERA_DEVICE_API_VERSION_3_5: - case CAMERA_DEVICE_API_VERSION_3_4: - case CAMERA_DEVICE_API_VERSION_3_3: - case CAMERA_DEVICE_API_VERSION_3_2: { - ::android::sp<::android::hardware::camera::device::V3_2::ICameraDevice> device3_x; - ALOGI("getCameraCharacteristics: Testing camera device %s", name.c_str()); - Return ret; - ret = mProvider->getCameraDeviceInterface_V3_x( - name, [&](auto status, const auto& device) { - ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status); - ASSERT_EQ(Status::OK, status); - ASSERT_NE(device, nullptr); - device3_x = device; - }); - ASSERT_TRUE(ret.isOk()); - - ret = device3_x->getCameraCharacteristics([&](auto status, const auto& chars) { - ASSERT_EQ(Status::OK, status); - const camera_metadata_t* metadata = (camera_metadata_t*)chars.data(); - - // Skip if this is not a color camera. - if (!CameraHidlTest::isColorCamera(metadata)) { - return; - } - - // Check camera facing. Skip if facing is not BACK. - // If this is not a logical camera, only note down - // the camera ID, and skip. - camera_metadata_ro_entry entry; - int retcode = find_camera_metadata_ro_entry( - metadata, ANDROID_LENS_FACING, &entry); - ASSERT_EQ(retcode, 0); - ASSERT_GT(entry.count, 0); - uint8_t facing = entry.data.u8[0]; - bool isLogicalCamera = (isLogicalMultiCamera(metadata) == Status::OK); - if (facing != ANDROID_LENS_FACING_BACK) { - // Not BACK facing. Skip. - return; - } - if (!isLogicalCamera) { - rearColorCameras.insert(cameraId); - return; - } - - // Check logical camera's physical camera IDs for color - // cameras. - std::unordered_set physicalCameraIds; - Status s = getPhysicalCameraIds(metadata, &physicalCameraIds); - ASSERT_EQ(Status::OK, s); - rearPhysicalIds.emplace(physicalCameraIds.begin(), physicalCameraIds.end()); - for (const auto& physicalId : physicalCameraIds) { - // Skip if the physicalId is publicly available - for (auto& deviceName : cameraDeviceNames) { - std::string publicVersion, publicId; - ASSERT_TRUE(::matchDeviceName(deviceName, mProviderType, - &publicVersion, &publicId)); - if (physicalId == publicId) { - // Skip because public Ids will be iterated in outer loop. - return; - } - } - - auto castResult = device::V3_5::ICameraDevice::castFrom(device3_x); - ASSERT_TRUE(castResult.isOk()); - ::android::sp<::android::hardware::camera::device::V3_5::ICameraDevice> - device3_5 = castResult; - ASSERT_NE(device3_5, nullptr); - - // Check camera characteristics for hidden camera id - Return ret = device3_5->getPhysicalCameraCharacteristics( - physicalId, [&](auto status, const auto& chars) { - ASSERT_EQ(Status::OK, status); - const camera_metadata_t* physicalMetadata = - (camera_metadata_t*)chars.data(); - - if (CameraHidlTest::isColorCamera(physicalMetadata)) { - rearColorCameras.insert(physicalId); - } - }); - ASSERT_TRUE(ret.isOk()); - } - }); - ASSERT_TRUE(ret.isOk()); - } break; - case CAMERA_DEVICE_API_VERSION_1_0: { - // Not applicable - } break; - default: { - ALOGE("%s: Unsupported device version %d", __func__, deviceVersion); - ADD_FAILURE(); - } break; - } - } - - // If there are more than one rear-facing color camera, a logical - // multi-camera must be defined consisting of all rear-facing color - // cameras. - if (rearColorCameras.size() > 1) { - bool hasRearLogical = false; - for (const auto& physicalIds : rearPhysicalIds) { - if (std::includes(physicalIds.begin(), physicalIds.end(), - rearColorCameras.begin(), rearColorCameras.end())) { - hasRearLogical = true; - break; - } - } - ASSERT_TRUE(hasRearLogical); - } -} - // Retrieve all valid output stream resolutions from the camera // static characteristics. Status CameraHidlTest::getAvailableOutputStreams(const camera_metadata_t* staticMeta, @@ -7062,23 +6925,6 @@ Status CameraHidlTest::isMonochromeCamera(const camera_metadata_t *staticMeta) { return ret; } -bool CameraHidlTest::isColorCamera(const camera_metadata_t *metadata) { - camera_metadata_ro_entry entry; - int retcode = find_camera_metadata_ro_entry( - metadata, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, &entry); - if ((0 == retcode) && (entry.count > 0)) { - bool isBackwardCompatible = (std::find(entry.data.u8, entry.data.u8 + entry.count, - ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE) != - entry.data.u8 + entry.count); - bool isMonochrome = (std::find(entry.data.u8, entry.data.u8 + entry.count, - ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME) != - entry.data.u8 + entry.count); - bool isColor = isBackwardCompatible && !isMonochrome; - return isColor; - } - return false; -} - // Retrieve the reprocess input-output format map from the static // camera characteristics. Status CameraHidlTest::getZSLInputOutputMap(camera_metadata_t *staticMeta, -- GitLab From 5f78f65e8fa07679c9b10b2137cda12abc94b2ab Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Tue, 18 Jan 2022 16:54:43 -0500 Subject: [PATCH 454/825] Test that R_8 can be allocated if it's supported Bug: 209458105 Test: atest VtsHalGraphicsMapperV4_0TargetTest (this) Change-Id: I927393bf9e4186d400e8b7cc0758095ec00ef13f --- .../VtsHalGraphicsMapperV4_0TargetTest.cpp | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp index 2ab9c01c5d..937115499e 100644 --- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp +++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -1204,6 +1205,40 @@ TEST_P(GraphicsMapperHidlTest, IsSupportedY16) { ASSERT_NO_FATAL_FAILURE(supported = mGralloc->isSupported(info)); } +/** + * Test IMapper::isSupported with optional format R_8 + */ +TEST_P(GraphicsMapperHidlTest, IsSupportedR8) { + auto info = mDummyDescriptorInfo; + info.format = static_cast( + aidl::android::hardware::graphics::common::PixelFormat::R_8); + bool supported = false; + + ASSERT_NO_FATAL_FAILURE(supported = mGralloc->isSupported(info)); + + if (!supported) { + GTEST_SUCCEED() << "R_8 is optional; unsupported so skipping allocation test"; + return; + } + + BufferDescriptor descriptor; + ASSERT_NO_FATAL_FAILURE(descriptor = mGralloc->createDescriptor(info)); + + constexpr uint32_t count = 1; + std::vector bufferHandles; + uint32_t stride; + ASSERT_NO_FATAL_FAILURE(bufferHandles = + mGralloc->allocate(descriptor, count, false, + Tolerance::kToleranceStrict, &stride)); + + EXPECT_LE(info.width, stride) << "invalid buffer stride"; + EXPECT_EQ(1u, bufferHandles.size()); + + for (auto bufferHandle : bufferHandles) { + mGralloc->freeBuffer(bufferHandle); + } +} + /** * Test IMapper::get(BufferId) */ -- GitLab From c23086038867d970904476822c2023f913615f34 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 26 Oct 2021 16:46:31 -0700 Subject: [PATCH 455/825] Manage pending requests in default VHAL. Use PendingRequestPool in default VHAL to manage pending requests. It would check for duplicate request IDs, call callbacks when request timeout. Test: atest DefaultVehicleHalTest Bug: 203713317 Change-Id: Ifa42e6f06036c48914c56e357714b6dfb7173538 --- .../aidl/impl/vhal/include/ConnectedClient.h | 27 ++ .../impl/vhal/include/DefaultVehicleHal.h | 16 + .../impl/vhal/include/PendingRequestPool.h | 6 +- .../aidl/impl/vhal/src/ConnectedClient.cpp | 102 +++++- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 89 +++++- .../aidl/impl/vhal/src/PendingRequestPool.cpp | 14 +- .../impl/vhal/test/ConnectedClientTest.cpp | 22 +- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 294 ++++++++++++++++++ .../impl/vhal/test/PendingRequestPoolTest.cpp | 18 +- 9 files changed, 557 insertions(+), 31 deletions(-) diff --git a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h index 43a96036cb..97c25e3c04 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h +++ b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h @@ -17,6 +17,8 @@ #ifndef android_hardware_automotive_vehicle_aidl_impl_vhal_include_ConnectedClient_H_ #define android_hardware_automotive_vehicle_aidl_impl_vhal_include_ConnectedClient_H_ +#include "PendingRequestPool.h" + #include #include @@ -40,12 +42,31 @@ namespace vehicle { class ConnectedClient { public: ConnectedClient( + std::shared_ptr requestPool, std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> callback); virtual ~ConnectedClient() = default; + // Gets the unique ID for this client. + const void* id(); + + // Add client requests. The requests would be registered as pending requests until + // {@code tryFinishRequests} is called for them. + // Returns {@code INVALID_ARG} error if any of the requestIds are duplicate with one of the + // pending request IDs or {@code TRY_AGAIN} error if the pending request pool is full and could + // no longer add requests. + ::android::base::Result addRequests(const std::unordered_set& requestIds); + + // Mark the requests as finished. Returns a list of request IDs that was pending and has been + // finished. It must be a set of the requested request IDs. + std::unordered_set tryFinishRequests(const std::unordered_set& requestIds); + protected: + // Gets the callback to be called when the request for this client has timeout. + virtual std::shared_ptr getTimeoutCallback() = 0; + + const std::shared_ptr mRequestPool; const std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> mCallback; }; @@ -56,6 +77,7 @@ template class GetSetValuesClient final : public ConnectedClient { public: GetSetValuesClient( + std::shared_ptr requestPool, std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> callback); @@ -69,8 +91,13 @@ class GetSetValuesClient final : public ConnectedClient { // Gets the callback to be called when the request for this client has finished. std::shared_ptr)>> getResultCallback(); + protected: + // Gets the callback to be called when the request for this client has timeout. + std::shared_ptr getTimeoutCallback() override; + private: // The following members are only initialized during construction. + std::shared_ptr mTimeoutCallback; std::shared_ptr)>> mResultCallback; }; diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index f6f7d80002..e3e77a3c3e 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -19,6 +19,7 @@ #include "ConnectedClient.h" #include "ParcelableUtils.h" +#include "PendingRequestPool.h" #include #include @@ -28,6 +29,7 @@ #include #include +#include #include #include @@ -100,6 +102,8 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve mConfigsByPropId; // Only modified in constructor, so thread-safe. std::unique_ptr<::ndk::ScopedFileDescriptor> mConfigFile; + // PendingRequestPool is thread-safe. + std::shared_ptr mPendingRequestPool; std::mutex mLock; std::unordered_map> mGetValuesClients @@ -114,6 +118,18 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve ::android::base::Result checkProperty( const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); + + ::android::base::Result> checkDuplicateRequests( + const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>& + requests); + + ::android::base::Result> checkDuplicateRequests( + const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>& + requests); + + // Test-only + // Set the default timeout for pending requests. + void setTimeout(int64_t timeoutInNano); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/include/PendingRequestPool.h b/automotive/vehicle/aidl/impl/vhal/include/PendingRequestPool.h index 6dcfaff5fa..efb33151bd 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/PendingRequestPool.h +++ b/automotive/vehicle/aidl/impl/vhal/include/PendingRequestPool.h @@ -51,7 +51,7 @@ class PendingRequestPool final { // seconds. android::base::Result addRequests(const void* clientId, const std::unordered_set& requestIds, - std::shared_ptr callback); + std::shared_ptr callback); // Checks whether the request is currently pending. bool isRequestPending(const void* clientId, int64_t requestId) const; @@ -66,6 +66,8 @@ class PendingRequestPool final { // Returns how many pending requests in the pool, for testing purpose. size_t countPendingRequests(const void* clientId) const; + size_t countPendingRequests() const; + private: // The maximum number of pending requests allowed per client. If exceeds this number, adding // more requests would fail. This is to prevent spamming from client. @@ -74,7 +76,7 @@ class PendingRequestPool final { struct PendingRequest { std::unordered_set requestIds; int64_t timeoutTimestamp; - std::shared_ptr callback; + std::shared_ptr callback; }; int64_t mTimeoutInNano; diff --git a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp index 656dfaf579..abc3eb0715 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp @@ -102,6 +102,53 @@ void sendGetOrSetValueResults(std::shared_ptr callback, sendGetOrSetValueResultsSeparately(callback, results); } +// The timeout callback for GetValues/SetValues. +template +void onTimeout( + std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> callback, + const std::unordered_set& timeoutIds) { + std::vector timeoutResults; + for (int64_t requestId : timeoutIds) { + ALOGD("hardware request timeout, request ID: %" PRId64, requestId); + timeoutResults.push_back({ + .requestId = requestId, + .status = StatusCode::TRY_AGAIN, + }); + } + sendGetOrSetValueResults(callback, timeoutResults); +} + +// The on-results callback for GetValues/SetValues. +template +void getOrSetValuesCallback( + const void* clientId, + std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> callback, + std::vector results, std::shared_ptr requestPool) { + std::unordered_set requestIds; + for (const auto& result : results) { + requestIds.insert(result.requestId); + } + + auto finishedRequests = requestPool->tryFinishRequests(clientId, requestIds); + + auto it = results.begin(); + while (it != results.end()) { + int64_t requestId = it->requestId; + if (finishedRequests.find(requestId) == finishedRequests.end()) { + ALOGD("no pending request for the result from hardware, " + "possibly already time-out, ID: %" PRId64, + requestId); + it = results.erase(it); + } else { + it++; + } + } + + if (!results.empty()) { + sendGetOrSetValueResults(callback, results); + } +} + // Specify the functions for GetValues and SetValues types. template void sendGetOrSetValueResult( std::shared_ptr callback, const GetValueResult& result); @@ -118,18 +165,55 @@ template void sendGetOrSetValueResultsSeparately( std::shared_ptr callback, const std::vector& results); +template void onTimeout( + std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> callback, + const std::unordered_set& timeoutIds); +template void onTimeout( + std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> callback, + const std::unordered_set& timeoutIds); + +template void getOrSetValuesCallback( + const void* clientId, + std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> callback, + std::vector results, std::shared_ptr requestPool); +template void getOrSetValuesCallback( + const void* clientId, + std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> callback, + std::vector results, std::shared_ptr requestPool); + } // namespace -ConnectedClient::ConnectedClient(std::shared_ptr callback) - : mCallback(callback) {} +ConnectedClient::ConnectedClient(std::shared_ptr requestPool, + std::shared_ptr callback) + : mRequestPool(requestPool), mCallback(callback) {} + +const void* ConnectedClient::id() { + return reinterpret_cast(this); +} + +Result ConnectedClient::addRequests(const std::unordered_set& requestIds) { + return mRequestPool->addRequests(id(), requestIds, getTimeoutCallback()); +} + +std::unordered_set ConnectedClient::tryFinishRequests( + const std::unordered_set& requestIds) { + return mRequestPool->tryFinishRequests(id(), requestIds); +} template GetSetValuesClient::GetSetValuesClient( - std::shared_ptr callback) - : ConnectedClient(callback) { + std::shared_ptr requestPool, std::shared_ptr callback) + : ConnectedClient(requestPool, callback) { + mTimeoutCallback = std::make_shared( + [callback](const std::unordered_set& timeoutIds) { + return onTimeout(callback, timeoutIds); + }); + auto requestPoolCopy = mRequestPool; + const void* clientId = id(); mResultCallback = std::make_shared)>>( - [callback](std::vector results) { - return sendGetOrSetValueResults(callback, results); + [clientId, callback, requestPoolCopy](std::vector results) { + return getOrSetValuesCallback( + clientId, callback, std::move(results), requestPoolCopy); }); } @@ -139,6 +223,12 @@ GetSetValuesClient::getResultCallback() { return mResultCallback; } +template +std::shared_ptr +GetSetValuesClient::getTimeoutCallback() { + return mTimeoutCallback; +} + template void GetSetValuesClient::sendResults( const std::vector& results) { diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index 7f09a59fbb..3c454f0a1a 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -25,6 +25,9 @@ #include #include +#include +#include + namespace android { namespace hardware { namespace automotive { @@ -52,7 +55,8 @@ using ::android::base::Result; using ::ndk::ScopedAStatus; DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) - : mVehicleHardware(std::move(hardware)) { + : mVehicleHardware(std::move(hardware)), + mPendingRequestPool(std::make_shared(TIMEOUT_IN_NANO)) { auto configs = mVehicleHardware->getAllPropertyConfigs(); for (auto& config : configs) { mConfigsByPropId[config.prop] = config; @@ -71,6 +75,10 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) } } +void DefaultVehicleHal::setTimeout(int64_t timeoutInNano) { + mPendingRequestPool = std::make_unique(timeoutInNano); +} + ScopedAStatus DefaultVehicleHal::getAllPropConfigs(VehiclePropConfigs* output) { if (mConfigFile != nullptr) { output->payloads.clear(); @@ -90,7 +98,7 @@ std::shared_ptr DefaultVehicleHal::getOrCreateClient( const CallbackType& callback) { if (clients->find(callback) == clients->end()) { // TODO(b/204943359): Remove client from clients when linkToDeath is implemented. - (*clients)[callback] = std::make_shared(callback); + (*clients)[callback] = std::make_shared(mPendingRequestPool, callback); } return (*clients)[callback]; } @@ -132,8 +140,6 @@ Result DefaultVehicleHal::checkProperty(const VehiclePropValue& propValue) ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, const GetValueRequests& requests) { - // TODO(b/203713317): check for duplicate properties and duplicate request IDs. - expected, ScopedAStatus> deserializedResults = fromStableLargeParcelable(requests); if (!deserializedResults.ok()) { @@ -143,26 +149,42 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, const std::vector& getValueRequests = deserializedResults.value().getObject()->payloads; + auto maybeRequestIds = checkDuplicateRequests(getValueRequests); + if (!maybeRequestIds.ok()) { + ALOGE("duplicate request ID"); + return toScopedAStatus(maybeRequestIds, StatusCode::INVALID_ARG); + } + // The set of request Ids that we would send to hardware. + std::unordered_set hardwareRequestIds(maybeRequestIds.value().begin(), + maybeRequestIds.value().end()); + std::shared_ptr client; { std::scoped_lock lockGuard(mLock); client = getOrCreateClient(&mGetValuesClients, callback); } + // Register the pending hardware requests and also check for duplicate request Ids. + if (auto addRequestResult = client->addRequests(hardwareRequestIds); !addRequestResult.ok()) { + ALOGE("failed to add pending requests, error: %s", + addRequestResult.error().message().c_str()); + return toScopedAStatus(addRequestResult); + } if (StatusCode status = mVehicleHardware->getValues(client->getResultCallback(), getValueRequests); status != StatusCode::OK) { + // If the hardware returns error, finish all the pending requests for this request because + // we never expect hardware to call callback for these requests. + client->tryFinishRequests(hardwareRequestIds); + ALOGE("failed to get value from VehicleHardware, status: %d", toInt(status)); return ScopedAStatus::fromServiceSpecificErrorWithMessage( toInt(status), "failed to get value from VehicleHardware"); } - return ScopedAStatus::ok(); } ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, const SetValueRequests& requests) { - // TODO(b/203713317): check for duplicate properties and duplicate request IDs. - expected, ScopedAStatus> deserializedResults = fromStableLargeParcelable(requests); if (!deserializedResults.ok()) { @@ -177,6 +199,12 @@ ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, // The list of requests that we would send to hardware. std::vector hardwareRequests; + auto maybeRequestIds = checkDuplicateRequests(setValueRequests); + if (!maybeRequestIds.ok()) { + ALOGE("duplicate request ID"); + return toScopedAStatus(maybeRequestIds, StatusCode::INVALID_ARG); + } + for (auto& request : setValueRequests) { int64_t requestId = request.requestId; if (auto result = checkProperty(request.value); !result.ok()) { @@ -187,22 +215,41 @@ ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, }); continue; } + hardwareRequests.push_back(request); } + // The set of request Ids that we would send to hardware. + std::unordered_set hardwareRequestIds; + for (const auto& request : hardwareRequests) { + hardwareRequestIds.insert(request.requestId); + } + std::shared_ptr client; { std::scoped_lock lockGuard(mLock); client = getOrCreateClient(&mSetValuesClients, callback); } + // Register the pending hardware requests and also check for duplicate request Ids. + if (auto addRequestResult = client->addRequests(hardwareRequestIds); !addRequestResult.ok()) { + ALOGE("failed to add pending requests, error: %s", + addRequestResult.error().message().c_str()); + return toScopedAStatus(addRequestResult, StatusCode::INVALID_ARG); + } + if (!failedResults.empty()) { + // First send the failed results we already know back to the client. client->sendResults(failedResults); } if (StatusCode status = mVehicleHardware->setValues(client->getResultCallback(), hardwareRequests); status != StatusCode::OK) { + // If the hardware returns error, finish all the pending requests for this request because + // we never expect hardware to call callback for these requests. + client->tryFinishRequests(hardwareRequestIds); + ALOGE("failed to set value to VehicleHardware, status: %d", toInt(status)); return ScopedAStatus::fromServiceSpecificErrorWithMessage( toInt(status), "failed to set value to VehicleHardware"); } @@ -210,6 +257,34 @@ ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, return ScopedAStatus::ok(); } +#define CHECK_DUPLICATE_REQUESTS(PROP_NAME) \ + do { \ + std::vector requestIds; \ + std::set<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> requestProps; \ + for (const auto& request : requests) { \ + const auto& prop = request.PROP_NAME; \ + if (requestProps.count(prop) != 0) { \ + return ::android::base::Error() \ + << "duplicate request for property: " << prop.toString(); \ + } \ + requestProps.insert(prop); \ + requestIds.push_back(request.requestId); \ + } \ + return requestIds; \ + } while (0); + +::android::base::Result> DefaultVehicleHal::checkDuplicateRequests( + const std::vector& requests) { + CHECK_DUPLICATE_REQUESTS(prop); +} + +::android::base::Result> DefaultVehicleHal::checkDuplicateRequests( + const std::vector& requests) { + CHECK_DUPLICATE_REQUESTS(value); +} + +#undef CHECK_DUPLICATE_REQUESTS + ScopedAStatus DefaultVehicleHal::getPropConfigs(const std::vector& props, VehiclePropConfigs* output) { std::vector configs; diff --git a/automotive/vehicle/aidl/impl/vhal/src/PendingRequestPool.cpp b/automotive/vehicle/aidl/impl/vhal/src/PendingRequestPool.cpp index c2d6f89c2d..23a540393a 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/PendingRequestPool.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/PendingRequestPool.cpp @@ -74,7 +74,7 @@ PendingRequestPool::~PendingRequestPool() { Result PendingRequestPool::addRequests(const void* clientId, const std::unordered_set& requestIds, - std::shared_ptr callback) { + std::shared_ptr callback) { std::scoped_lock lockGuard(mLock); std::list* pendingRequests; size_t pendingRequestCount = 0; @@ -117,6 +117,18 @@ bool PendingRequestPool::isRequestPending(const void* clientId, int64_t requestI return isRequestPendingLocked(clientId, requestId); } +size_t PendingRequestPool::countPendingRequests() const { + std::scoped_lock lockGuard(mLock); + + size_t count = 0; + for (const auto& [clientId, requests] : mPendingRequestsByClient) { + for (const auto& request : requests) { + count += request.requestIds.size(); + } + } + return count; +} + size_t PendingRequestPool::countPendingRequests(const void* clientId) const { std::scoped_lock lockGuard(mLock); diff --git a/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp index ddd0c65ec5..bd4a565df3 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp @@ -39,12 +39,17 @@ class ConnectedClientTest : public ::testing::Test { void SetUp() override { mCallback = ndk::SharedRefBase::make(); mCallbackClient = IVehicleCallback::fromBinder(mCallback->asBinder()); + // timeout: 1s. + int64_t timeout = 1000000000; + mPool = std::make_shared(timeout); } std::shared_ptr getCallbackClient() { return mCallbackClient; } MockVehicleCallback* getCallback() { return mCallback.get(); } + std::shared_ptr getPool() { return mPool; } + protected: using GetValuesClient = GetSetValuesClient; using SetValuesClient = GetSetValuesClient; @@ -52,6 +57,7 @@ class ConnectedClientTest : public ::testing::Test { private: std::shared_ptr mCallback; std::shared_ptr mCallbackClient; + std::shared_ptr mPool; }; TEST_F(ConnectedClientTest, testSendGetValueResults) { @@ -72,7 +78,7 @@ TEST_F(ConnectedClientTest, testSendGetValueResults) { }, }}; - GetValuesClient client(getCallbackClient()); + GetValuesClient client(getPool(), getCallbackClient()); client.sendResults(results); @@ -99,7 +105,7 @@ TEST_F(ConnectedClientTest, testSendGetValueResultsSeparately) { }, }}; - GetValuesClient client(getCallbackClient()); + GetValuesClient client(getPool(), getCallbackClient()); client.sendResultsSeparately(results); @@ -131,7 +137,9 @@ TEST_F(ConnectedClientTest, testGetValuesGnResultCallback) { }, }}; - GetValuesClient client(getCallbackClient()); + GetValuesClient client(getPool(), getCallbackClient()); + + client.addRequests({0, 1}); (*(client.getResultCallback()))(results); @@ -150,7 +158,7 @@ TEST_F(ConnectedClientTest, testSendSetValueResults) { .status = StatusCode::OK, }}; - SetValuesClient client(getCallbackClient()); + SetValuesClient client(getPool(), getCallbackClient()); client.sendResults(results); @@ -169,7 +177,7 @@ TEST_F(ConnectedClientTest, testSendSetValueResultsSeparately) { .status = StatusCode::OK, }}; - SetValuesClient client(getCallbackClient()); + SetValuesClient client(getPool(), getCallbackClient()); client.sendResultsSeparately(results); @@ -193,7 +201,9 @@ TEST_F(ConnectedClientTest, testSetValuesGetResultCallback) { .status = StatusCode::OK, }}; - SetValuesClient client(getCallbackClient()); + SetValuesClient client(getPool(), getCallbackClient()); + + client.addRequests({0, 1}); (*(client.getResultCallback()))(results); diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index ffc08a71b8..6970e48005 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -67,6 +68,7 @@ using ::ndk::ScopedAStatus; using ::ndk::ScopedFileDescriptor; using ::testing::Eq; +using ::testing::UnorderedElementsAreArray; using ::testing::WhenSortedBy; constexpr int32_t INVALID_PROP_ID = 0; @@ -356,6 +358,11 @@ class DefaultVehicleHalTest : public ::testing::Test { mCallbackClient = IVehicleCallback::fromBinder(mCallback->asBinder()); } + void TearDown() override { + ASSERT_EQ(countPendingRequests(), static_cast(0)) + << "must have no pending requests when test finishes"; + } + MockVehicleHardware* getHardware() { return mHardwarePtr; } std::shared_ptr getClient() { return mVhal; } @@ -364,6 +371,12 @@ class DefaultVehicleHalTest : public ::testing::Test { MockVehicleCallback* getCallback() { return mCallback.get(); } + void setTimeout(int64_t timeoutInNano) { mVhal->setTimeout(timeoutInNano); } + + size_t countPendingRequests() { return mVhal->mPendingRequestPool->countPendingRequests(); } + + std::shared_ptr getPool() { return mVhal->mPendingRequestPool; } + static Result getValuesTestCases(size_t size, GetValueRequests& requests, std::vector& expectedResults, std::vector& expectedHardwareRequests) { @@ -570,6 +583,145 @@ TEST_F(DefaultVehicleHalTest, testGetValuesInvalidLargeParcelableInput) { ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::INVALID_ARG)); } +TEST_F(DefaultVehicleHalTest, testGetValuesFinishBeforeTimeout) { + // timeout: 0.1s + int64_t timeout = 100000000; + setTimeout(timeout); + + GetValueRequests requests; + std::vector expectedResults; + std::vector expectedHardwareRequests; + + ASSERT_TRUE(getValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok()); + + // The response would be returned after 0.05s. + getHardware()->setSleepTime(timeout / 2); + getHardware()->addGetValueResponses(expectedResults); + + auto status = getClient()->getValues(getCallbackClient(), requests); + + ASSERT_TRUE(status.isOk()) << "getValues failed: " << status.getMessage(); + + // Wait for the response. + std::this_thread::sleep_for(std::chrono::nanoseconds(timeout)); + + auto maybeGetValueResults = getCallback()->nextGetValueResults(); + ASSERT_TRUE(maybeGetValueResults.has_value()) << "no results in callback"; + EXPECT_EQ(maybeGetValueResults.value().payloads, expectedResults) << "results mismatch"; + ASSERT_FALSE(getCallback()->nextGetValueResults().has_value()) << "more results than expected"; +} + +TEST_F(DefaultVehicleHalTest, testGetValuesFinishAfterTimeout) { + // timeout: 0.1s + int64_t timeout = 100000000; + setTimeout(timeout); + + GetValueRequests requests; + std::vector expectedResults; + std::vector expectedHardwareRequests; + + ASSERT_TRUE(getValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok()); + + // The response would be returned after 0.2s. + getHardware()->setSleepTime(timeout * 2); + getHardware()->addGetValueResponses(expectedResults); + + auto status = getClient()->getValues(getCallbackClient(), requests); + + ASSERT_TRUE(status.isOk()) << "getValues failed: " << status.getMessage(); + + // Wait for the response. + std::this_thread::sleep_for(std::chrono::nanoseconds(timeout * 5)); + + for (size_t i = 0; i < expectedResults.size(); i++) { + expectedResults[i] = { + .requestId = expectedResults[i].requestId, + .status = StatusCode::TRY_AGAIN, + .prop = std::nullopt, + }; + } + + auto maybeGetValueResults = getCallback()->nextGetValueResults(); + ASSERT_TRUE(maybeGetValueResults.has_value()) << "no results in callback"; + ASSERT_THAT(maybeGetValueResults.value().payloads, UnorderedElementsAreArray(expectedResults)) + << "results mismatch, expect TRY_AGAIN error."; + ASSERT_FALSE(getCallback()->nextGetValueResults().has_value()) << "more results than expected"; +} + +TEST_F(DefaultVehicleHalTest, testGetValuesDuplicateRequestIdsInTwoRequests) { + // timeout: 0.1s + int64_t timeout = 100000000; + setTimeout(timeout); + + GetValueRequests requests; + std::vector expectedResults; + std::vector expectedHardwareRequests; + + ASSERT_TRUE(getValuesTestCases(1, requests, expectedResults, expectedHardwareRequests).ok()); + + getHardware()->setSleepTime(timeout * 2); + getHardware()->addGetValueResponses(expectedResults); + + auto status = getClient()->getValues(getCallbackClient(), requests); + + ASSERT_TRUE(status.isOk()) << "getValues failed: " << status.getMessage(); + + // Use the same request ID again. + status = getClient()->getValues(getCallbackClient(), requests); + + ASSERT_FALSE(status.isOk()) + << "Use the same request ID before the previous request finishes must fail"; + + // Wait for the request to finish. + std::this_thread::sleep_for(std::chrono::nanoseconds(timeout * 5)); +} + +TEST_F(DefaultVehicleHalTest, testGetValuesDuplicateRequestIdsInOneRequest) { + GetValueRequests requests = {.payloads = { + { + .requestId = 0, + .prop = + VehiclePropValue{ + .prop = testInt32VecProp(0), + }, + }, + { + .requestId = 0, + .prop = + VehiclePropValue{ + .prop = testInt32VecProp(1), + }, + }, + }}; + + auto status = getClient()->getValues(getCallbackClient(), requests); + + ASSERT_FALSE(status.isOk()) << "duplicate Ids in one request must fail"; +} + +TEST_F(DefaultVehicleHalTest, testGetValuesDuplicateRequestProps) { + GetValueRequests requests = {.payloads = { + { + .requestId = 0, + .prop = + VehiclePropValue{ + .prop = testInt32VecProp(0), + }, + }, + { + .requestId = 1, + .prop = + VehiclePropValue{ + .prop = testInt32VecProp(0), + }, + }, + }}; + + auto status = getClient()->getValues(getCallbackClient(), requests); + + ASSERT_FALSE(status.isOk()) << "duplicate request properties in one request must fail"; +} + TEST_F(DefaultVehicleHalTest, testSetValuesSmall) { SetValueRequests requests; std::vector expectedResults; @@ -675,6 +827,148 @@ TEST_P(SetValuesInvalidRequestTest, testSetValuesInvalidRequest) { << "results from hardware mismatch"; } +TEST_F(DefaultVehicleHalTest, testSetValuesFinishBeforeTimeout) { + // timeout: 0.1s + int64_t timeout = 100000000; + setTimeout(timeout); + + SetValueRequests requests; + std::vector expectedResults; + std::vector expectedHardwareRequests; + + ASSERT_TRUE(setValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok()); + + // The response would be returned after 0.05s. + getHardware()->setSleepTime(timeout / 2); + getHardware()->addSetValueResponses(expectedResults); + + auto status = getClient()->setValues(getCallbackClient(), requests); + + ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage(); + + // Wait for the response. + std::this_thread::sleep_for(std::chrono::nanoseconds(timeout)); + + auto maybeSetValueResults = getCallback()->nextSetValueResults(); + ASSERT_TRUE(maybeSetValueResults.has_value()) << "no results in callback"; + EXPECT_EQ(maybeSetValueResults.value().payloads, expectedResults) << "results mismatch"; + ASSERT_FALSE(getCallback()->nextSetValueResults().has_value()) << "more results than expected"; +} + +TEST_F(DefaultVehicleHalTest, testSetValuesFinishAfterTimeout) { + // timeout: 0.1s + int64_t timeout = 100000000; + setTimeout(timeout); + + SetValueRequests requests; + std::vector expectedResults; + std::vector expectedHardwareRequests; + + ASSERT_TRUE(setValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok()); + + // The response would be returned after 0.2s. + getHardware()->setSleepTime(timeout * 2); + getHardware()->addSetValueResponses(expectedResults); + + auto status = getClient()->setValues(getCallbackClient(), requests); + + ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage(); + + // Wait for the response. + std::this_thread::sleep_for(std::chrono::nanoseconds(timeout * 5)); + + for (size_t i = 0; i < expectedResults.size(); i++) { + expectedResults[i] = { + .requestId = expectedResults[i].requestId, + .status = StatusCode::TRY_AGAIN, + }; + } + + auto maybeSetValueResults = getCallback()->nextSetValueResults(); + ASSERT_TRUE(maybeSetValueResults.has_value()) << "no results in callback"; + ASSERT_THAT(maybeSetValueResults.value().payloads, UnorderedElementsAreArray(expectedResults)) + << "results mismatch, expect TRY_AGAIN error."; + ASSERT_FALSE(getCallback()->nextSetValueResults().has_value()) << "more results than expected"; +} + +TEST_F(DefaultVehicleHalTest, testSetValuesDuplicateRequestIdsInTwoRequests) { + // timeout: 0.1s + int64_t timeout = 100000000; + setTimeout(timeout); + + SetValueRequests requests; + std::vector expectedResults; + std::vector expectedHardwareRequests; + + ASSERT_TRUE(setValuesTestCases(1, requests, expectedResults, expectedHardwareRequests).ok()); + + getHardware()->setSleepTime(timeout * 2); + getHardware()->addSetValueResponses(expectedResults); + + auto status = getClient()->setValues(getCallbackClient(), requests); + + ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage(); + + // Use the same request ID again. + status = getClient()->setValues(getCallbackClient(), requests); + + ASSERT_FALSE(status.isOk()) + << "Use the same request ID before the previous request finishes must fail"; + + // Wait for the request to finish. + std::this_thread::sleep_for(std::chrono::nanoseconds(timeout * 5)); +} + +TEST_F(DefaultVehicleHalTest, testSetValuesDuplicateRequestIdsInOneRequest) { + SetValueRequests requests = {.payloads = { + { + .requestId = 0, + .value = + VehiclePropValue{ + .prop = testInt32VecProp(0), + .value.int32Values = {0}, + }, + }, + { + .requestId = 0, + .value = + VehiclePropValue{ + .prop = testInt32VecProp(1), + .value.int32Values = {0}, + }, + }, + }}; + + auto status = getClient()->setValues(getCallbackClient(), requests); + + ASSERT_FALSE(status.isOk()) << "duplicate Ids in one request must fail"; +} + +TEST_F(DefaultVehicleHalTest, testSetValuesDuplicateRequestProps) { + SetValueRequests requests = {.payloads = { + { + .requestId = 0, + .value = + VehiclePropValue{ + .prop = testInt32VecProp(0), + .value.int32Values = {0}, + }, + }, + { + .requestId = 1, + .value = + VehiclePropValue{ + .prop = testInt32VecProp(0), + .value.int32Values = {0}, + }, + }, + }}; + + auto status = getClient()->setValues(getCallbackClient(), requests); + + ASSERT_FALSE(status.isOk()) << "duplicate request properties in one request must fail"; +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/test/PendingRequestPoolTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/PendingRequestPoolTest.cpp index 03d795beaa..9c9e4b90aa 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/PendingRequestPoolTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/PendingRequestPoolTest.cpp @@ -53,7 +53,7 @@ class PendingRequestPoolTest : public ::testing::Test { int64_t getTimeout() { return TEST_TIMEOUT; } - void* getTestClientId() { return reinterpret_cast(0); } + const void* getTestClientId() { return reinterpret_cast(0); } private: // Test timeout is 0.1s. @@ -239,12 +239,12 @@ TEST_F(PendingRequestPoolTest, testSameRequestIdForDifferentClient) { auto callback = std::make_shared( [](std::unordered_set) {}); - ASSERT_RESULT_OK(getPool()->addRequests(reinterpret_cast(0), {0}, callback)); - ASSERT_RESULT_OK(getPool()->addRequests(reinterpret_cast(1), {1, 2, 0}, callback)); + ASSERT_RESULT_OK(getPool()->addRequests(reinterpret_cast(0), {0}, callback)); + ASSERT_RESULT_OK(getPool()->addRequests(reinterpret_cast(1), {1, 2, 0}, callback)); - ASSERT_THAT(getPool()->tryFinishRequests(reinterpret_cast(0), {0}), + ASSERT_THAT(getPool()->tryFinishRequests(reinterpret_cast(0), {0}), UnorderedElementsAre(0)); - ASSERT_THAT(getPool()->tryFinishRequests(reinterpret_cast(1), {1, 2, 0}), + ASSERT_THAT(getPool()->tryFinishRequests(reinterpret_cast(1), {1, 2, 0}), UnorderedElementsAre(0, 1, 2)); } @@ -258,14 +258,14 @@ TEST_F(PendingRequestPoolTest, testPendingRequestCountLimit) { for (size_t i = 0; i < 10000; i++) { requests.insert(static_cast(i)); } - ASSERT_RESULT_OK(getPool()->addRequests(reinterpret_cast(0), requests, callback)); + ASSERT_RESULT_OK(getPool()->addRequests(reinterpret_cast(0), requests, callback)); - auto result = getPool()->addRequests(reinterpret_cast(0), {static_cast(10000)}, - callback); + auto result = getPool()->addRequests(reinterpret_cast(0), + {static_cast(10000)}, callback); ASSERT_FALSE(result.ok()) << "adding more pending requests than limit must fail"; ASSERT_EQ(result.error().code(), toInt(StatusCode::TRY_AGAIN)); - getPool()->tryFinishRequests(reinterpret_cast(0), requests); + getPool()->tryFinishRequests(reinterpret_cast(0), requests); } } // namespace vehicle -- GitLab From 5ad921ae275272ce5f76544f0ee35452884eb119 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 1 Nov 2021 13:59:01 -0700 Subject: [PATCH 456/825] Add RecurrentTimer for VHAL. Add a RecurrentTimer that allows registering recurrent actions. Test: atest DefaultVehicleHalTest Bug: 200737967 Change-Id: I0d62c554bb8de404d9e9634ff8118c64ebf3c864 --- automotive/vehicle/aidl/impl/vhal/Android.bp | 1 + .../aidl/impl/vhal/include/RecurrentTimer.h | 95 +++++++++ .../aidl/impl/vhal/src/RecurrentTimer.cpp | 177 ++++++++++++++++ .../impl/vhal/test/RecurrentTimerTest.cpp | 192 ++++++++++++++++++ 4 files changed, 465 insertions(+) create mode 100644 automotive/vehicle/aidl/impl/vhal/include/RecurrentTimer.h create mode 100644 automotive/vehicle/aidl/impl/vhal/src/RecurrentTimer.cpp create mode 100644 automotive/vehicle/aidl/impl/vhal/test/RecurrentTimerTest.cpp diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp index a54ab4bbe9..eaa23dc6da 100644 --- a/automotive/vehicle/aidl/impl/vhal/Android.bp +++ b/automotive/vehicle/aidl/impl/vhal/Android.bp @@ -57,6 +57,7 @@ cc_library { "src/ConnectedClient.cpp", "src/DefaultVehicleHal.cpp", "src/PendingRequestPool.cpp", + "src/RecurrentTimer.cpp", ], static_libs: [ "VehicleHalUtils", diff --git a/automotive/vehicle/aidl/impl/vhal/include/RecurrentTimer.h b/automotive/vehicle/aidl/impl/vhal/include/RecurrentTimer.h new file mode 100644 index 0000000000..5f0f7161c2 --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/include/RecurrentTimer.h @@ -0,0 +1,95 @@ +/* + * 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_aidl_impl_vhal_include_RecurrentTimer_H_ +#define android_hardware_automotive_vehicle_aidl_impl_vhal_include_RecurrentTimer_H_ + +#include + +#include +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +// A thread-safe recurrent timer. +class RecurrentTimer final { + public: + // The class for the function that would be called recurrently. + using Callback = std::function; + + RecurrentTimer(); + + ~RecurrentTimer(); + + // 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); + + // Unregisters a previously registered recurrent callback. + void unregisterTimerCallback(std::shared_ptr callback); + + private: + // friend class for unit testing. + friend class RecurrentTimerTest; + + struct CallbackInfo { + std::shared_ptr 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& lhs, + const std::unique_ptr& rhs); + }; + + 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, 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> mCallbackQueue GUARDED_BY(mLock); + + void loop(); + + // 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); + // Pops the next closest callback (must be valid) from the heap. + std::unique_ptr popNextCallbackLocked() REQUIRES(mLock); +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_aidl_impl_vhal_include_RecurrentTimer_H_ diff --git a/automotive/vehicle/aidl/impl/vhal/src/RecurrentTimer.cpp b/automotive/vehicle/aidl/impl/vhal/src/RecurrentTimer.cpp new file mode 100644 index 0000000000..8521c4db7c --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/src/RecurrentTimer.cpp @@ -0,0 +1,177 @@ +/* + * 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 "RecurrentTimer.h" + +#include +#include + +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +using ::android::base::ScopedLockAssertion; + +RecurrentTimer::RecurrentTimer() : mThread(&RecurrentTimer::loop, this) {} + +RecurrentTimer::~RecurrentTimer() { + { + std::scoped_lock lockGuard(mLock); + mStopRequested = true; + } + mCond.notify_one(); + if (mThread.joinable()) { + mThread.join(); + } +} + +void RecurrentTimer::registerTimerCallback(int64_t intervalInNano, + std::shared_ptr callback) { + { + std::scoped_lock lockGuard(mLock); + + // Aligns the nextTime to multiply of interval. + int64_t nextTime = ceil(elapsedRealtimeNano() / intervalInNano) * intervalInNano; + + std::unique_ptr info = std::make_unique(); + info->callback = callback; + info->interval = intervalInNano; + info->nextTime = nextTime; + + 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); + } + mCond.notify_one(); +} + +void RecurrentTimer::unregisterTimerCallback(std::shared_ptr callback) { + { + std::scoped_lock lockGuard(mLock); + + auto it = mCallbacks.find(callback); + if (it == mCallbacks.end()) { + 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(); + } +} + +std::unique_ptr RecurrentTimer::popNextCallbackLocked() { + std::pop_heap(mCallbackQueue.begin(), mCallbackQueue.end(), CallbackInfo::cmp); + std::unique_ptr info = std::move(mCallbackQueue[mCallbackQueue.size() - 1]); + mCallbackQueue.pop_back(); + // Make sure the first element is always valid. + removeInvalidCallbackLocked(); + return info; +} + +void RecurrentTimer::loop() { + std::unique_lock uniqueLock(mLock); + + while (true) { + // 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; + { + ScopedLockAssertion lockAssertion(mLock); + if (mStopRequested) { + return; + } + // The first element is the nearest next event. + int64_t nextTime = mCallbackQueue[0]->nextTime; + int64_t now = elapsedRealtimeNano(); + 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; + } + + { + ScopedLockAssertion lockAssertion(mLock); + int64_t now = elapsedRealtimeNano(); + while (mCallbackQueue.size() > 0) { + int64_t nextTime = mCallbackQueue[0]->nextTime; + if (nextTime > now) { + break; + } + + std::unique_ptr info = popNextCallbackLocked(); + info->nextTime += info->interval; + + auto callback = info->callback; + mCallbackQueue.push_back(std::move(info)); + std::push_heap(mCallbackQueue.begin(), mCallbackQueue.end(), CallbackInfo::cmp); + + (*callback)(); + } + } + } +} + +bool RecurrentTimer::CallbackInfo::cmp(const std::unique_ptr& lhs, + const std::unique_ptr& rhs) { + return lhs->nextTime > rhs->nextTime; +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/aidl/impl/vhal/test/RecurrentTimerTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/RecurrentTimerTest.cpp new file mode 100644 index 0000000000..d343cea5b0 --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/test/RecurrentTimerTest.cpp @@ -0,0 +1,192 @@ +/* + * 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 "RecurrentTimer.h" + +#include +#include + +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +class RecurrentTimerTest : public ::testing::Test { + public: + std::shared_ptr getCallback(size_t token) { + return std::make_shared([this, token] { + std::scoped_lock lockGuard(mLock); + + mCallbacks.push_back(token); + }); + } + + std::vector getCalledCallbacks() { + std::scoped_lock lockGuard(mLock); + return mCallbacks; + } + + void clearCalledCallbacks() { + std::scoped_lock lockGuard(mLock); + mCallbacks.clear(); + } + + size_t countTimerCallbackQueue(RecurrentTimer* timer) { + std::scoped_lock lockGuard(timer->mLock); + return timer->mCallbackQueue.size(); + } + + private: + std::mutex mLock; + std::vector mCallbacks GUARDED_BY(mLock); +}; + +TEST_F(RecurrentTimerTest, testRegisterCallback) { + RecurrentTimer timer; + // 0.1s + int64_t interval = 100000000; + + auto action = getCallback(0); + timer.registerTimerCallback(interval, action); + + std::this_thread::sleep_for(std::chrono::seconds(1)); + + timer.unregisterTimerCallback(action); + + // Theoretically trigger 10 times, but check for at least 9 times to be stable. + ASSERT_GE(getCalledCallbacks().size(), static_cast(9)); +} + +TEST_F(RecurrentTimerTest, testRegisterUnregisterRegister) { + RecurrentTimer timer; + // 0.1s + int64_t interval = 100000000; + + auto action = getCallback(0); + timer.registerTimerCallback(interval, action); + + std::this_thread::sleep_for(std::chrono::milliseconds(200)); + + timer.unregisterTimerCallback(action); + + std::this_thread::sleep_for(std::chrono::milliseconds(200)); + + clearCalledCallbacks(); + + timer.registerTimerCallback(interval, action); + + std::this_thread::sleep_for(std::chrono::seconds(1)); + + // Theoretically trigger 10 times, but check for at least 9 times to be stable. + ASSERT_GE(getCalledCallbacks().size(), static_cast(9)); +} + +TEST_F(RecurrentTimerTest, testDestroyTimerWithCallback) { + std::unique_ptr timer = std::make_unique(); + // 0.1s + int64_t interval = 100000000; + + auto action = getCallback(0); + timer->registerTimerCallback(interval, action); + + std::this_thread::sleep_for(std::chrono::milliseconds(200)); + + timer.reset(); + + clearCalledCallbacks(); + + std::this_thread::sleep_for(std::chrono::milliseconds(200)); + + ASSERT_TRUE(getCalledCallbacks().empty()); +} + +TEST_F(RecurrentTimerTest, testRegisterMultipleCallbacks) { + RecurrentTimer timer; + // 0.1s + int64_t interval1 = 100000000; + auto action1 = getCallback(1); + timer.registerTimerCallback(interval1, action1); + // 0.05s + int64_t interval2 = 50000000; + auto action2 = getCallback(2); + timer.registerTimerCallback(interval2, action2); + // 0.03s + int64_t interval3 = 30000000; + auto action3 = getCallback(3); + timer.registerTimerCallback(interval3, action3); + + std::this_thread::sleep_for(std::chrono::seconds(1)); + + timer.unregisterTimerCallback(action1); + timer.unregisterTimerCallback(action2); + timer.unregisterTimerCallback(action3); + + size_t action1Count = 0; + size_t action2Count = 0; + size_t action3Count = 0; + for (size_t token : getCalledCallbacks()) { + if (token == 1) { + action1Count++; + } + if (token == 2) { + action2Count++; + } + if (token == 3) { + action3Count++; + } + } + // Theoretically trigger 10 times, but check for at least 9 times to be stable. + ASSERT_GE(action1Count, static_cast(9)); + // Theoretically trigger 20 times, but check for at least 15 times to be stable. + ASSERT_GE(action2Count, static_cast(15)); + // Theoretically trigger 33 times, but check for at least 25 times to be stable. + ASSERT_GE(action3Count, static_cast(25)); +} + +TEST_F(RecurrentTimerTest, testRegisterSameCallbackMultipleTimes) { + RecurrentTimer timer; + // 0.02s + int64_t interval1 = 20000000; + // 0.01s + int64_t interval2 = 10000000; + + auto action = getCallback(0); + for (int i = 0; i < 10; i++) { + timer.registerTimerCallback(interval1, action); + timer.registerTimerCallback(interval2, action); + } + + clearCalledCallbacks(); + + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + + // Theoretically trigger 10 times, but check for at least 9 times to be stable. + ASSERT_GE(getCalledCallbacks().size(), static_cast(9)); + + timer.unregisterTimerCallback(action); + + // Make sure there is no item in the callback queue. + ASSERT_EQ(countTimerCallbackQueue(&timer), static_cast(0)); +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android -- GitLab From 686ec516bd61dfbaa7155780a71e28da40659377 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 1 Nov 2021 16:04:56 -0700 Subject: [PATCH 457/825] Add subscription manager. Add a class to manage VHAL subscription. It supports subscribing and unsubscribing to properties. For continuous property, it uses recurrent timer to recurrently calls the registered function. For on-change property, it would return all subscribed clients for a given property. Test: atest DefaultVehicleHalTest Bug: 200737967 Change-Id: I3e1a0401fd465dc31fe08ea77d5a6651fa7bbfaf --- .../utils/common/include/VehicleHalTypes.h | 1 + automotive/vehicle/aidl/impl/vhal/Android.bp | 1 + .../impl/vhal/include/SubscriptionManager.h | 151 ++++++ .../impl/vhal/src/SubscriptionManager.cpp | 240 +++++++++ .../vhal/test/SubscriptionManagerTest.cpp | 483 ++++++++++++++++++ 5 files changed, 876 insertions(+) create mode 100644 automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h create mode 100644 automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp create mode 100644 automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index 013d1773c8..a7fcdcf99d 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp index eaa23dc6da..0132e6f695 100644 --- a/automotive/vehicle/aidl/impl/vhal/Android.bp +++ b/automotive/vehicle/aidl/impl/vhal/Android.bp @@ -58,6 +58,7 @@ cc_library { "src/DefaultVehicleHal.cpp", "src/PendingRequestPool.cpp", "src/RecurrentTimer.cpp", + "src/SubscriptionManager.cpp", ], static_libs: [ "VehicleHalUtils", diff --git a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h new file mode 100644 index 0000000000..28809c61d1 --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h @@ -0,0 +1,151 @@ +/* + * 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_aidl_impl_vhal_include_SubscriptionManager_H_ +#define android_hardware_automotive_vehicle_aidl_impl_vhal_include_SubscriptionManager_H_ + +#include "RecurrentTimer.h" + +#include + +#include +#include +#include + +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +// A thread-safe subscription manager that manages all VHAL subscriptions. +class SubscriptionManager final { + public: + using CallbackType = + std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>; + using GetValueFunc = std::function; + + explicit SubscriptionManager(GetValueFunc&& action); + ~SubscriptionManager(); + + // Subscribes to properties according to {@code SubscribeOptions}. Note that all option must + // contain non-empty areaIds field, which contains all area IDs to subscribe. As a result, + // the options here is different from the options passed from VHAL client. + // Returns error if any of the subscribe options is not valid. If error is returned, no + // properties would be subscribed. + // Returns ok if all the options are parsed correctly and all the properties are subscribed. + ::android::base::Result subscribe( + const CallbackType& callback, + const std::vector<::aidl::android::hardware::automotive::vehicle::SubscribeOptions>& + options, + bool isContinuousProperty); + + // Unsubscribes from the properties for the callback. + // Returns error if the callback was not subscribed before or one of the given property was not + // subscribed. If error is returned, no property would be unsubscribed. + // Returns ok if all the requested properties for the callback are unsubscribed. + ::android::base::Result unsubscribe(const CallbackType& callback, + const std::vector& propIds); + + // Unsubscribes to all the properties for the callback. + // Returns error if the callback was not subscribed before. If error is returned, no property + // would be unsubscribed. + // Returns ok if all the properties for the callback are unsubscribed. + ::android::base::Result unsubscribe(const CallbackType& callback); + + // 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< + std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>, + std::vector> + getSubscribedClients( + const std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>& + updatedValues); + + // Checks whether the sample rate is valid. + static bool checkSampleRate(float sampleRate); + + private: + struct PropIdAreaId { + int32_t propId; + int32_t areaId; + + bool operator==(const PropIdAreaId& other) const; + }; + + struct PropIdAreaIdHash { + size_t operator()(const PropIdAreaId& propIdAreaId) const; + }; + + // A class to represent a registered subscription. + class Subscription { + public: + Subscription() = default; + + Subscription(const Subscription&) = delete; + + virtual ~Subscription() = default; + + virtual bool isOnChange(); + }; + + // A subscription for OnContinuous property. The registered action would be called recurrently + // until this class is destructed. + class RecurrentSubscription final : public Subscription { + public: + explicit RecurrentSubscription(std::shared_ptr timer, + std::function&& action, int64_t interval); + ~RecurrentSubscription(); + + bool isOnChange() override; + + private: + std::shared_ptr> mAction; + std::shared_ptr mTimer; + }; + + // A subscription for OnChange property. + class OnChangeSubscription final : public Subscription { + public: + bool isOnChange() override; + }; + + mutable std::mutex mLock; + std::unordered_map, PropIdAreaIdHash> + mClientsByPropIdArea GUARDED_BY(mLock); + std::unordered_map, + PropIdAreaIdHash>> + mSubscriptionsByClient GUARDED_BY(mLock); + // RecurrentTimer is thread-safe. + std::shared_ptr mTimer; + const GetValueFunc mGetValue; + + static ::android::base::Result getInterval(float sampleRate); +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_aidl_impl_vhal_include_SubscriptionManager_H_ diff --git a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp new file mode 100644 index 0000000000..dc9a6ce73e --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp @@ -0,0 +1,240 @@ +/* + * 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 "SubscriptionManager.h" + +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +namespace { + +constexpr float ONE_SECOND_IN_NANO = 1000000000.; + +} // namespace + +using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback; +using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; +using ::android::base::Error; +using ::android::base::Result; +using ::ndk::ScopedAStatus; + +bool SubscriptionManager::PropIdAreaId::operator==(const PropIdAreaId& other) const { + return areaId == other.areaId && propId == other.propId; +} + +size_t SubscriptionManager::PropIdAreaIdHash::operator()(PropIdAreaId const& propIdAreaId) const { + size_t res = 0; + hashCombine(res, propIdAreaId.propId); + hashCombine(res, propIdAreaId.areaId); + return res; +} + +SubscriptionManager::SubscriptionManager(GetValueFunc&& action) + : mTimer(std::make_shared()), mGetValue(std::move(action)) {} + +SubscriptionManager::~SubscriptionManager() { + std::scoped_lock lockGuard(mLock); + + mClientsByPropIdArea.clear(); + mSubscriptionsByClient.clear(); +} + +bool SubscriptionManager::checkSampleRate(float sampleRate) { + return getInterval(sampleRate).ok(); +} + +Result SubscriptionManager::getInterval(float sampleRate) { + int64_t interval = 0; + if (sampleRate <= 0) { + return Error() << "invalid sample rate, must be a positive number"; + } + if (sampleRate <= (ONE_SECOND_IN_NANO / static_cast(INT64_MAX))) { + return Error() << "invalid sample rate: " << sampleRate << ", too small"; + } + interval = static_cast(ONE_SECOND_IN_NANO / sampleRate); + return interval; +} + +Result SubscriptionManager::subscribe(const std::shared_ptr& callback, + const std::vector& options, + bool isContinuousProperty) { + std::scoped_lock lockGuard(mLock); + + std::vector intervals; + + for (const auto& option : options) { + float sampleRate = option.sampleRate; + + if (isContinuousProperty) { + auto intervalResult = getInterval(sampleRate); + if (!intervalResult.ok()) { + return intervalResult.error(); + } + intervals.push_back(intervalResult.value()); + } + + if (option.areaIds.empty()) { + ALOGE("area IDs to subscribe must not be empty"); + return Error() << "area IDs to subscribe must not be empty"; + } + } + + size_t intervalIndex = 0; + for (const auto& option : options) { + int32_t propId = option.propId; + const std::vector& areaIds = option.areaIds; + int64_t interval = 0; + if (isContinuousProperty) { + interval = intervals[intervalIndex]; + intervalIndex++; + } + for (int32_t areaId : areaIds) { + PropIdAreaId propIdAreaId = { + .propId = propId, + .areaId = areaId, + }; + if (isContinuousProperty) { + VehiclePropValue propValueRequest{ + .prop = propId, + .areaId = areaId, + }; + mSubscriptionsByClient[callback][propIdAreaId] = + std::make_unique( + mTimer, + [this, callback, propValueRequest] { + mGetValue(callback, propValueRequest); + }, + interval); + } else { + mSubscriptionsByClient[callback][propIdAreaId] = + std::make_unique(); + } + mClientsByPropIdArea[propIdAreaId].insert(callback); + } + } + return {}; +} + +Result SubscriptionManager::unsubscribe(const std::shared_ptr& callback, + const std::vector& propIds) { + std::scoped_lock lockGuard(mLock); + + if (mSubscriptionsByClient.find(callback) == mSubscriptionsByClient.end()) { + return Error() << "No property was subscribed for the callback"; + } + std::unordered_set subscribedPropIds; + for (auto const& [propIdAreaId, _] : mSubscriptionsByClient[callback]) { + subscribedPropIds.insert(propIdAreaId.propId); + } + + for (int32_t propId : propIds) { + if (subscribedPropIds.find(propId) == subscribedPropIds.end()) { + return Error() << "property ID: " << propId << " is not subscribed"; + } + } + + auto& subscriptions = mSubscriptionsByClient[callback]; + auto it = subscriptions.begin(); + while (it != subscriptions.end()) { + int32_t propId = it->first.propId; + if (std::find(propIds.begin(), propIds.end(), propId) != propIds.end()) { + auto& clients = mClientsByPropIdArea[it->first]; + clients.erase(callback); + if (clients.empty()) { + mClientsByPropIdArea.erase(it->first); + } + it = subscriptions.erase(it); + } else { + it++; + } + } + if (subscriptions.empty()) { + mSubscriptionsByClient.erase(callback); + } + return {}; +} + +Result SubscriptionManager::unsubscribe(const std::shared_ptr& callback) { + std::scoped_lock lockGuard(mLock); + + if (mSubscriptionsByClient.find(callback) == mSubscriptionsByClient.end()) { + return Error() << "No property was subscribed for the callback"; + } + + auto& subscriptions = mSubscriptionsByClient[callback]; + for (auto const& [propIdAreaId, _] : subscriptions) { + auto& clients = mClientsByPropIdArea[propIdAreaId]; + clients.erase(callback); + if (clients.empty()) { + mClientsByPropIdArea.erase(propIdAreaId); + } + } + mSubscriptionsByClient.erase(callback); + return {}; +} + +std::unordered_map, std::vector> +SubscriptionManager::getSubscribedClients(const std::vector& updatedValues) { + std::scoped_lock lockGuard(mLock); + std::unordered_map, std::vector> + clients; + + for (const auto& value : updatedValues) { + PropIdAreaId propIdAreaId{ + .propId = value.prop, + .areaId = value.areaId, + }; + if (mClientsByPropIdArea.find(propIdAreaId) == mClientsByPropIdArea.end()) { + continue; + } + for (const auto& client : mClientsByPropIdArea[propIdAreaId]) { + if (!mSubscriptionsByClient[client][propIdAreaId]->isOnChange()) { + continue; + } + clients[client].push_back(&value); + } + } + return clients; +} + +SubscriptionManager::RecurrentSubscription::RecurrentSubscription( + std::shared_ptr timer, std::function&& action, int64_t interval) + : mAction(std::make_shared>(action)), mTimer(timer) { + mTimer->registerTimerCallback(interval, mAction); +} + +SubscriptionManager::RecurrentSubscription::~RecurrentSubscription() { + mTimer->unregisterTimerCallback(mAction); +} + +bool SubscriptionManager::RecurrentSubscription::isOnChange() { + return false; +} + +bool SubscriptionManager::OnChangeSubscription::isOnChange() { + return true; +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp new file mode 100644 index 0000000000..fa08d6c3fa --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp @@ -0,0 +1,483 @@ +/* + * 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 "SubscriptionManager.h" + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +using ::aidl::android::hardware::automotive::vehicle::BnVehicleCallback; +using ::aidl::android::hardware::automotive::vehicle::GetValueResults; +using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback; +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::VehiclePropValue; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropValues; +using ::ndk::ScopedAStatus; +using ::testing::ElementsAre; +using ::testing::WhenSorted; + +class PropertyCallback final : public BnVehicleCallback { + public: + ScopedAStatus onGetValues(const GetValueResults&) override { return ScopedAStatus::ok(); } + + ScopedAStatus onSetValues(const SetValueResults&) override { return ScopedAStatus::ok(); } + + ScopedAStatus onPropertyEvent(const VehiclePropValues& values, int32_t) override { + std::scoped_lock lockGuard(mLock); + for (const auto& value : values.payloads) { + mEvents.push_back(value); + } + return ScopedAStatus::ok(); + } + + ScopedAStatus onPropertySetError(const VehiclePropErrors&) override { + return ScopedAStatus::ok(); + } + + // Test functions. + std::list getEvents() { + std::scoped_lock lockGuard(mLock); + return mEvents; + } + + void clearEvents() { + std::scoped_lock lockGuard(mLock); + mEvents.clear(); + } + + private: + std::mutex mLock; + std::list mEvents GUARDED_BY(mLock); +}; + +class SubscriptionManagerTest : public ::testing::Test { + public: + void SetUp() override { + mManager = std::make_unique( + [](const std::shared_ptr& callback, + const VehiclePropValue& value) { + callback->onPropertyEvent( + VehiclePropValues{ + .payloads = {value}, + }, + 0); + }); + mCallback = ::ndk::SharedRefBase::make(); + mCallbackClient = IVehicleCallback::fromBinder(mCallback->asBinder()); + } + + SubscriptionManager* getManager() { return mManager.get(); } + + std::shared_ptr getCallbackClient() { return mCallbackClient; } + + PropertyCallback* getCallback() { return mCallback.get(); } + + std::list getEvents() { return getCallback()->getEvents(); } + + void clearEvents() { return getCallback()->clearEvents(); } + + private: + std::unique_ptr mManager; + std::shared_ptr mCallback; + std::shared_ptr mCallbackClient; +}; + +TEST_F(SubscriptionManagerTest, testSubscribeGlobalContinuous) { + std::vector options = {{ + .propId = 0, + .areaIds = {0}, + .sampleRate = 10.0, + }}; + + auto result = getManager()->subscribe(getCallbackClient(), options, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + std::this_thread::sleep_for(std::chrono::seconds(1)); + + // Theoretically trigger 10 times, but check for at least 9 times to be stable. + ASSERT_GE(getEvents().size(), static_cast(9)); + EXPECT_EQ(getEvents().back().prop, 0); + EXPECT_EQ(getEvents().back().areaId, 0); +} + +TEST_F(SubscriptionManagerTest, testSubscribeMultiplePropsGlobalContinuous) { + std::vector options = {{ + .propId = 0, + .areaIds = {0}, + .sampleRate = 10.0, + }, + { + .propId = 1, + .areaIds = {0}, + .sampleRate = 20.0, + }}; + + auto result = getManager()->subscribe(getCallbackClient(), options, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + std::this_thread::sleep_for(std::chrono::seconds(1)); + + size_t event0Count = 0; + size_t event1Count = 0; + + for (const auto& event : getEvents()) { + if (event.prop == 0) { + event0Count++; + } else { + event1Count++; + } + } + + // Theoretically trigger 10 times, but check for at least 9 times to be stable. + EXPECT_GE(event0Count, static_cast(9)); + // Theoretically trigger 20 times, but check for at least 15 times to be stable. + EXPECT_GE(event1Count, static_cast(15)); +} + +TEST_F(SubscriptionManagerTest, testOverrideSubscriptionContinuous) { + std::vector options = {{ + .propId = 0, + .areaIds = {0}, + .sampleRate = 20.0, + }}; + + auto result = getManager()->subscribe(getCallbackClient(), options, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + // Override sample rate to be 10.0. + options[0].sampleRate = 10.0; + result = getManager()->subscribe(getCallbackClient(), options, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + std::this_thread::sleep_for(std::chrono::seconds(1)); + + // Theoretically trigger 10 times, but check for at least 9 times to be stable. + EXPECT_GE(getEvents().size(), static_cast(9)); + EXPECT_LE(getEvents().size(), static_cast(11)); +} + +TEST_F(SubscriptionManagerTest, testSubscribeMultipleAreasContinuous) { + std::vector options = { + { + .propId = 0, + .areaIds = {0, 1}, + .sampleRate = 10.0, + }, + }; + + auto result = getManager()->subscribe(getCallbackClient(), options, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + std::this_thread::sleep_for(std::chrono::seconds(1)); + + size_t area0Count = 0; + size_t area1Count = 0; + + for (const auto& event : getEvents()) { + if (event.areaId == 0) { + area0Count++; + } else { + area1Count++; + } + } + + // Theoretically trigger 10 times, but check for at least 9 times to be stable. + EXPECT_GE(area0Count, static_cast(9)); + // Theoretically trigger 10 times, but check for at least 9 times to be stable. + EXPECT_GE(area1Count, static_cast(9)); +} + +TEST_F(SubscriptionManagerTest, testUnsubscribeGlobalContinuous) { + std::vector options = {{ + .propId = 0, + .areaIds = {0}, + .sampleRate = 10.0, + }}; + + auto result = getManager()->subscribe(getCallbackClient(), options, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + result = getManager()->unsubscribe(getCallbackClient()); + ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message(); + + clearEvents(); + + std::this_thread::sleep_for(std::chrono::milliseconds(200)); + + // Theoretically trigger 10 times, but check for at least 9 times to be stable. + ASSERT_TRUE(getEvents().empty()); +} + +TEST_F(SubscriptionManagerTest, testUnsubscribeMultipleAreas) { + std::vector options = { + { + .propId = 0, + .areaIds = {0, 1, 2, 3, 4}, + .sampleRate = 10.0, + }, + { + .propId = 1, + .areaIds = {0}, + .sampleRate = 10.0, + }, + }; + + auto result = getManager()->subscribe(getCallbackClient(), options, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + result = getManager()->unsubscribe(getCallbackClient(), std::vector({0})); + ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message(); + + clearEvents(); + + std::this_thread::sleep_for(std::chrono::seconds(1)); + + // Theoretically trigger 10 times, but check for at least 9 times to be stable. + EXPECT_GE(getEvents().size(), static_cast(9)); + + for (const auto& event : getEvents()) { + EXPECT_EQ(event.prop, 1); + } +} + +TEST_F(SubscriptionManagerTest, testUnsubscribeByCallback) { + std::vector options = { + { + .propId = 0, + .areaIds = {0, 1, 2, 3, 4}, + .sampleRate = 10.0, + }, + { + .propId = 1, + .areaIds = {0}, + .sampleRate = 10.0, + }, + }; + + auto result = getManager()->subscribe(getCallbackClient(), options, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + result = getManager()->unsubscribe(getCallbackClient()); + ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message(); + + clearEvents(); + + std::this_thread::sleep_for(std::chrono::seconds(1)); + + EXPECT_TRUE(getEvents().empty()); +} + +TEST_F(SubscriptionManagerTest, testUnsubscribeFailure) { + std::vector options = { + { + .propId = 0, + .areaIds = {0, 1, 2, 3, 4}, + }, + { + .propId = 1, + .areaIds = {0}, + }, + }; + + auto result = getManager()->subscribe(getCallbackClient(), options, false); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + // Property ID: 2 was not subscribed. + result = getManager()->unsubscribe(getCallbackClient(), std::vector({0, 1, 2})); + ASSERT_FALSE(result.ok()) << "unsubscribe an unsubscribed property must fail"; + + // Since property 0 and property 1 was not unsubscribed successfully, we should be able to + // unsubscribe them again. + result = getManager()->unsubscribe(getCallbackClient(), std::vector({0, 1})); + ASSERT_TRUE(result.ok()) << "a failed unsubscription must not unsubscribe any properties" + << result.error().message(); +} + +TEST_F(SubscriptionManagerTest, testSubscribeOnchange) { + std::vector options1 = { + { + .propId = 0, + .areaIds = {0, 1}, + }, + { + .propId = 1, + .areaIds = {0}, + }, + }; + std::vector options2 = { + { + .propId = 0, + .areaIds = {0}, + }, + }; + + std::shared_ptr client1 = IVehicleCallback::fromBinder( + ::ndk::SharedRefBase::make()->asBinder()); + std::shared_ptr client2 = IVehicleCallback::fromBinder( + ::ndk::SharedRefBase::make()->asBinder()); + auto result = getManager()->subscribe(client1, options1, false); + 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(); + + std::vector updatedValues = { + { + .prop = 0, + .areaId = 0, + }, + { + .prop = 0, + .areaId = 1, + }, + { + .prop = 1, + .areaId = 0, + }, + { + .prop = 1, + .areaId = 1, + }, + }; + auto clients = getManager()->getSubscribedClients(updatedValues); + + ASSERT_THAT(clients[client1], + WhenSorted(ElementsAre(&updatedValues[0], &updatedValues[1], &updatedValues[2]))); + ASSERT_THAT(clients[client2], ElementsAre(&updatedValues[0])); +} + +TEST_F(SubscriptionManagerTest, testSubscribeInvalidOption) { + std::vector options = { + { + .propId = 0, + .areaIds = {0, 1, 2, 3, 4}, + // invalid sample rate. + .sampleRate = 0.0, + }, + { + .propId = 1, + .areaIds = {0}, + .sampleRate = 10.0, + }, + }; + + auto result = getManager()->subscribe(getCallbackClient(), options, true); + ASSERT_FALSE(result.ok()) << "subscribe with invalid sample rate must fail"; + ASSERT_TRUE(getManager() + ->getSubscribedClients({{ + .prop = 0, + .areaId = 0, + }, + { + .prop = 1, + .areaId = 0, + }}) + .empty()) + << "no property should be subscribed if error is returned"; +} + +TEST_F(SubscriptionManagerTest, testSubscribeNoAreaIds) { + std::vector options = { + { + .propId = 0, + .areaIds = {}, + .sampleRate = 1.0, + }, + { + .propId = 1, + .areaIds = {0}, + .sampleRate = 10.0, + }, + }; + + auto result = getManager()->subscribe(getCallbackClient(), options, true); + ASSERT_FALSE(result.ok()) << "subscribe with invalid sample rate must fail"; + ASSERT_TRUE(getManager() + ->getSubscribedClients({{ + .prop = 1, + .areaId = 0, + }}) + .empty()) + << "no property should be subscribed if error is returned"; +} + +TEST_F(SubscriptionManagerTest, testUnsubscribeOnchange) { + std::vector options = { + { + .propId = 0, + .areaIds = {0, 1}, + }, + { + .propId = 1, + .areaIds = {0}, + }, + }; + + auto result = getManager()->subscribe(getCallbackClient(), options, false); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + result = getManager()->unsubscribe(getCallbackClient(), std::vector({0})); + ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message(); + + std::vector updatedValues = { + { + .prop = 0, + .areaId = 0, + }, + { + .prop = 1, + .areaId = 0, + }, + }; + auto clients = getManager()->getSubscribedClients(updatedValues); + + ASSERT_THAT(clients[getCallbackClient()], ElementsAre(&updatedValues[1])); +} + +TEST_F(SubscriptionManagerTest, testCheckSampleRateValid) { + ASSERT_TRUE(SubscriptionManager::checkSampleRate(1.0)); +} + +TEST_F(SubscriptionManagerTest, testCheckSampleRateInvalidTooSmall) { + ASSERT_FALSE(SubscriptionManager::checkSampleRate(FLT_MIN)); +} + +TEST_F(SubscriptionManagerTest, testCheckSampleRateInvalidZero) { + ASSERT_FALSE(SubscriptionManager::checkSampleRate(0)); +} + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android -- GitLab From e032b15842873457c652d6640dc694215a80a77f Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 4 Nov 2021 16:37:08 -0700 Subject: [PATCH 458/825] Use subscription manager in VHAL. This CL renames GetSetValuesClient to ConnectedClient and add SubscribeClient to the supported client type. The SubscribeClient would provide a different timeout and on-results callback. This CL adds a map for subscribe clients in VHAL and initializes subscription manager. Test: None, will add after we implement subscribe. Bug: 200737967 Change-Id: I222b155e4365dcf0fa9344c7da5901142433f055 --- .../aidl/impl/vhal/include/ConnectedClient.h | 32 +++++ .../impl/vhal/include/DefaultVehicleHal.h | 13 ++ .../aidl/impl/vhal/src/ConnectedClient.cpp | 87 +++++++++++++ .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 114 ++++++++++++++---- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 1 + 5 files changed, 221 insertions(+), 26 deletions(-) diff --git a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h index 97c25e3c04..d8516b1a41 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h +++ b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h @@ -101,6 +101,38 @@ class GetSetValuesClient final : public ConnectedClient { std::shared_ptr)>> mResultCallback; }; +// A class to represent a client that calls {@code IVehicle.subscribe}. +class SubscriptionClient final : public ConnectedClient { + public: + SubscriptionClient( + std::shared_ptr requestPool, + std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> + callback); + + // Gets the callback to be called when the request for this client has finished. + std::shared_ptr)>> + getResultCallback(); + + protected: + // Gets the callback to be called when the request for this client has timeout. + std::shared_ptr getTimeoutCallback() override; + + private: + // The following members are only initialized during construction. + std::shared_ptr mTimeoutCallback; + std::shared_ptr)>> + mResultCallback; + + static void onGetValueResults( + const void* clientId, + std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> + callback, + std::shared_ptr requestPool, + std::vector<::aidl::android::hardware::automotive::vehicle::GetValueResult> results); +}; + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index e3e77a3c3e..b0423a39ef 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -20,6 +20,7 @@ #include "ConnectedClient.h" #include "ParcelableUtils.h" #include "PendingRequestPool.h" +#include "SubscriptionManager.h" #include #include @@ -52,6 +53,8 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve explicit DefaultVehicleHal(std::unique_ptr hardware); + ~DefaultVehicleHal(); + ::ndk::ScopedAStatus getAllPropConfigs( ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs) override; @@ -104,12 +107,18 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve std::unique_ptr<::ndk::ScopedFileDescriptor> mConfigFile; // PendingRequestPool is thread-safe. std::shared_ptr mPendingRequestPool; + // SubscriptionManager is thread-safe. + std::unique_ptr mSubscriptionManager; std::mutex mLock; std::unordered_map> mGetValuesClients GUARDED_BY(mLock); std::unordered_map> mSetValuesClients GUARDED_BY(mLock); + std::unordered_map> mSubscriptionClients + GUARDED_BY(mLock); + // An increasing request ID we keep for subscribe clients. + std::unordered_map mSubscribeIdByClient GUARDED_BY(mLock); template std::shared_ptr getOrCreateClient( @@ -127,6 +136,10 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>& requests); + void getValueFromHardwareCallCallback( + const CallbackType& callback, + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + // Test-only // Set the default timeout for pending requests. void setTimeout(int64_t timeoutInNano); diff --git a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp index abc3eb0715..7d02a0521d 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp @@ -244,6 +244,93 @@ void GetSetValuesClient::sendResultsSeparately( template class GetSetValuesClient; template class GetSetValuesClient; +SubscriptionClient::SubscriptionClient(std::shared_ptr requestPool, + std::shared_ptr callback) + : ConnectedClient(requestPool, callback) { + mTimeoutCallback = std::make_shared( + [](std::unordered_set 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(this); + mResultCallback = std::make_shared)>>( + [clientId, callback, requestPoolCopy](std::vector results) { + onGetValueResults(clientId, callback, requestPoolCopy, results); + }); +} + +std::shared_ptr)>> +SubscriptionClient::getResultCallback() { + return mResultCallback; +} + +std::shared_ptr +SubscriptionClient::getTimeoutCallback() { + return mTimeoutCallback; +} + +void SubscriptionClient::onGetValueResults(const void* clientId, + std::shared_ptr callback, + std::shared_ptr requestPool, + std::vector results) { + std::unordered_set requestIds; + for (const auto& result : results) { + requestIds.insert(result.requestId); + } + + auto finishedRequests = requestPool->tryFinishRequests(clientId, requestIds); + std::vector 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())); + } + + if (propValues.empty()) { + return; + } + // TODO(b/205189110): Use memory pool here and fill in sharedMemoryId. + VehiclePropValues vehiclePropValues; + int32_t sharedMemoryFileCount = 0; + ScopedAStatus status = vectorToStableLargeParcelable(propValues, &vehiclePropValues); + if (!status.isOk()) { + int statusCode = status.getServiceSpecificError(); + ALOGE("failed to marshal result into large parcelable, error: " + "%s, code: %d", + status.getMessage(), statusCode); + return; + } + + if (ScopedAStatus callbackStatus = + callback->onPropertyEvent(vehiclePropValues, sharedMemoryFileCount); + !callbackStatus.isOk()) { + ALOGE("failed to call callback, error: %s, code: %d", status.getMessage(), + status.getServiceSpecificError()); + } +} + } // 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 3c454f0a1a..1e76eb7211 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -33,6 +34,8 @@ namespace hardware { namespace automotive { namespace vehicle { +namespace { + using ::aidl::android::hardware::automotive::vehicle::GetValueRequest; using ::aidl::android::hardware::automotive::vehicle::GetValueRequests; using ::aidl::android::hardware::automotive::vehicle::GetValueResult; @@ -54,6 +57,19 @@ using ::android::base::expected; using ::android::base::Result; using ::ndk::ScopedAStatus; +std::string toString(const std::unordered_set& values) { + std::string str = ""; + for (auto it = values.begin(); it != values.end(); it++) { + str += std::to_string(*it); + if (std::next(it, 1) != values.end()) { + str += ", "; + } + } + return str; +} + +} // namespace + DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) : mVehicleHardware(std::move(hardware)), mPendingRequestPool(std::make_shared(TIMEOUT_IN_NANO)) { @@ -73,23 +89,16 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) if (result.value() != nullptr) { mConfigFile = std::move(result.value()); } -} -void DefaultVehicleHal::setTimeout(int64_t timeoutInNano) { - mPendingRequestPool = std::make_unique(timeoutInNano); + mSubscriptionManager = std::make_unique( + [this](const CallbackType& callback, const VehiclePropValue& value) { + getValueFromHardwareCallCallback(callback, value); + }); } -ScopedAStatus DefaultVehicleHal::getAllPropConfigs(VehiclePropConfigs* output) { - if (mConfigFile != nullptr) { - output->payloads.clear(); - output->sharedMemoryFd.set(dup(mConfigFile->get())); - return ScopedAStatus::ok(); - } - output->payloads.reserve(mConfigsByPropId.size()); - for (const auto& [_, config] : mConfigsByPropId) { - output->payloads.push_back(config); - } - return ScopedAStatus::ok(); +DefaultVehicleHal::~DefaultVehicleHal() { + // mSubscriptionManager has reference to this, so must be destroyed before other members. + mSubscriptionManager.reset(); } template @@ -107,11 +116,63 @@ template std::shared_ptr DefaultVehicleHal::getOrCreateClient( std::unordered_map>* clients, const CallbackType& callback); - template std::shared_ptr DefaultVehicleHal::getOrCreateClient( std::unordered_map>* clients, const CallbackType& callback); +template std::shared_ptr +DefaultVehicleHal::getOrCreateClient( + std::unordered_map>* clients, + const CallbackType& callback); + +void DefaultVehicleHal::getValueFromHardwareCallCallback(const CallbackType& callback, + const VehiclePropValue& value) { + int64_t subscribeId; + std::shared_ptr client; + { + std::scoped_lock lockGuard(mLock); + // This is initialized to 0 if callback does not exist in the map. + subscribeId = (mSubscribeIdByClient[callback])++; + client = getOrCreateClient(&mSubscriptionClients, callback); + } + if (auto addRequestResult = client->addRequests({subscribeId}); !addRequestResult.ok()) { + ALOGE("subscribe[%" PRId64 "]: too many pending requests, ignore the getValue request", + subscribeId); + return; + } + + std::vector hardwareRequests = {{ + .requestId = subscribeId, + .prop = value, + }}; + + if (StatusCode status = + mVehicleHardware->getValues(client->getResultCallback(), hardwareRequests); + status != StatusCode::OK) { + // If the hardware returns error, finish all the pending requests for this request because + // we never expect hardware to call callback for these requests. + client->tryFinishRequests({subscribeId}); + ALOGE("subscribe[%" PRId64 "]: failed to get value from VehicleHardware, code: %d", + subscribeId, toInt(status)); + } +} + +void DefaultVehicleHal::setTimeout(int64_t timeoutInNano) { + mPendingRequestPool = std::make_unique(timeoutInNano); +} + +ScopedAStatus DefaultVehicleHal::getAllPropConfigs(VehiclePropConfigs* output) { + if (mConfigFile != nullptr) { + output->payloads.clear(); + output->sharedMemoryFd.set(dup(mConfigFile->get())); + return ScopedAStatus::ok(); + } + output->payloads.reserve(mConfigsByPropId.size()); + for (const auto& [_, config] : mConfigsByPropId) { + output->payloads.push_back(config); + } + return ScopedAStatus::ok(); +} Result DefaultVehicleHal::checkProperty(const VehiclePropValue& propValue) { int32_t propId = propValue.prop; @@ -151,7 +212,7 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, auto maybeRequestIds = checkDuplicateRequests(getValueRequests); if (!maybeRequestIds.ok()) { - ALOGE("duplicate request ID"); + ALOGE("getValues: duplicate request ID"); return toScopedAStatus(maybeRequestIds, StatusCode::INVALID_ARG); } // The set of request Ids that we would send to hardware. @@ -165,8 +226,8 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, } // Register the pending hardware requests and also check for duplicate request Ids. if (auto addRequestResult = client->addRequests(hardwareRequestIds); !addRequestResult.ok()) { - ALOGE("failed to add pending requests, error: %s", - addRequestResult.error().message().c_str()); + ALOGE("getValues[%s]: failed to add pending requests, error: %s", + toString(hardwareRequestIds).c_str(), addRequestResult.error().message().c_str()); return toScopedAStatus(addRequestResult); } @@ -176,7 +237,8 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, // If the hardware returns error, finish all the pending requests for this request because // we never expect hardware to call callback for these requests. client->tryFinishRequests(hardwareRequestIds); - ALOGE("failed to get value from VehicleHardware, status: %d", toInt(status)); + ALOGE("getValues[%s]: failed to get value from VehicleHardware, status: %d", + toString(hardwareRequestIds).c_str(), toInt(status)); return ScopedAStatus::fromServiceSpecificErrorWithMessage( toInt(status), "failed to get value from VehicleHardware"); } @@ -201,14 +263,15 @@ ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, auto maybeRequestIds = checkDuplicateRequests(setValueRequests); if (!maybeRequestIds.ok()) { - ALOGE("duplicate request ID"); + ALOGE("setValues: duplicate request ID"); return toScopedAStatus(maybeRequestIds, StatusCode::INVALID_ARG); } for (auto& request : setValueRequests) { int64_t requestId = request.requestId; if (auto result = checkProperty(request.value); !result.ok()) { - ALOGW("property not valid: %s", result.error().message().c_str()); + ALOGW("setValues[%" PRId64 "]: property not valid: %s", requestId, + result.error().message().c_str()); failedResults.push_back(SetValueResult{ .requestId = requestId, .status = StatusCode::INVALID_ARG, @@ -233,8 +296,8 @@ ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, // Register the pending hardware requests and also check for duplicate request Ids. if (auto addRequestResult = client->addRequests(hardwareRequestIds); !addRequestResult.ok()) { - ALOGE("failed to add pending requests, error: %s", - addRequestResult.error().message().c_str()); + ALOGE("setValues[%s], failed to add pending requests, error: %s", + toString(hardwareRequestIds).c_str(), addRequestResult.error().message().c_str()); return toScopedAStatus(addRequestResult, StatusCode::INVALID_ARG); } @@ -249,7 +312,8 @@ ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, // If the hardware returns error, finish all the pending requests for this request because // we never expect hardware to call callback for these requests. client->tryFinishRequests(hardwareRequestIds); - ALOGE("failed to set value to VehicleHardware, status: %d", toInt(status)); + ALOGE("setValues[%s], failed to set value to VehicleHardware, status: %d", + toString(hardwareRequestIds).c_str(), toInt(status)); return ScopedAStatus::fromServiceSpecificErrorWithMessage( toInt(status), "failed to set value to VehicleHardware"); } @@ -298,12 +362,10 @@ ScopedAStatus DefaultVehicleHal::getPropConfigs(const std::vector& prop ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType&, const std::vector&, int32_t) { - // TODO(b/200737967): implement this. return ScopedAStatus::ok(); } ScopedAStatus DefaultVehicleHal::unsubscribe(const CallbackType&, const std::vector&) { - // TODO(b/200737967): implement this. return ScopedAStatus::ok(); } diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 6970e48005..d763f03889 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "ConnectedClient.h" #include "DefaultVehicleHal.h" #include "MockVehicleCallback.h" -- GitLab From c5a9283c0efdc867f3f6cf60decac79777686584 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 8 Nov 2021 13:45:24 -0800 Subject: [PATCH 459/825] Refactor MockVehicleHardware into separate files. Test: presubmit. Bug: 200737967 Change-Id: Id28357f8ccd692de1daa47a1bfa539e90826b02a --- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 189 +--------------- .../impl/vhal/test/MockVehicleCallback.cpp | 23 +- .../aidl/impl/vhal/test/MockVehicleCallback.h | 15 ++ .../impl/vhal/test/MockVehicleHardware.cpp | 207 ++++++++++++++++++ .../aidl/impl/vhal/test/MockVehicleHardware.h | 114 ++++++++++ 5 files changed, 348 insertions(+), 200 deletions(-) create mode 100644 automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp create mode 100644 automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index d763f03889..d3186fd9b9 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -17,6 +17,7 @@ #include "ConnectedClient.h" #include "DefaultVehicleHal.h" #include "MockVehicleCallback.h" +#include "MockVehicleHardware.h" #include #include @@ -76,199 +77,11 @@ constexpr int32_t INVALID_PROP_ID = 0; // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32 constexpr int32_t INT32_WINDOW_PROP = 10001 + 0x10000000 + 0x03000000 + 0x00400000; -template -std::optional pop(std::list& items) { - if (items.size() > 0) { - auto item = std::move(items.front()); - items.pop_front(); - return item; - } - return std::nullopt; -} - int32_t testInt32VecProp(size_t i) { // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC return static_cast(i) + 0x10000000 + 0x01000000 + 0x00410000; } -class MockVehicleHardware final : public IVehicleHardware { - public: - ~MockVehicleHardware() { - std::scoped_lock lockGuard(mLock); - for (auto& thread : mThreads) { - thread.join(); - } - } - - std::vector getAllPropertyConfigs() const override { - std::scoped_lock lockGuard(mLock); - return mPropertyConfigs; - } - - StatusCode setValues(std::shared_ptr callback, - const std::vector& requests) override { - std::scoped_lock lockGuard(mLock); - return handleRequests(__func__, callback, requests, &mSetValueRequests, - &mSetValueResponses); - } - - StatusCode getValues(std::shared_ptr callback, - const std::vector& requests) const override { - std::scoped_lock lockGuard(mLock); - return handleRequests(__func__, callback, requests, &mGetValueRequests, - &mGetValueResponses); - } - - DumpResult dump(const std::vector&) override { - // TODO(b/200737967): mock this. - return DumpResult{}; - } - - StatusCode checkHealth() override { - // TODO(b/200737967): mock this. - return StatusCode::OK; - } - - void registerOnPropertyChangeEvent(std::unique_ptr) override { - // TODO(b/200737967): mock this. - } - - void registerOnPropertySetErrorEvent(std::unique_ptr) override { - // TODO(b/200737967): mock this. - } - - // Test functions. - void setPropertyConfigs(const std::vector& configs) { - std::scoped_lock lockGuard(mLock); - mPropertyConfigs = configs; - } - - void addGetValueResponses(const std::vector& responses) { - std::scoped_lock lockGuard(mLock); - mGetValueResponses.push_back(responses); - } - - void addSetValueResponses(const std::vector& responses) { - std::scoped_lock lockGuard(mLock); - mSetValueResponses.push_back(responses); - } - - std::vector nextGetValueRequests() { - std::scoped_lock lockGuard(mLock); - std::optional> request = pop(mGetValueRequests); - if (!request.has_value()) { - return std::vector(); - } - return std::move(request.value()); - } - - std::vector nextSetValueRequests() { - std::scoped_lock lockGuard(mLock); - std::optional> request = pop(mSetValueRequests); - if (!request.has_value()) { - return std::vector(); - } - return std::move(request.value()); - } - - void setStatus(const char* functionName, StatusCode status) { - std::scoped_lock lockGuard(mLock); - mStatusByFunctions[functionName] = status; - } - - void setSleepTime(int64_t timeInNano) { - std::scoped_lock lockGuard(mLock); - mSleepTime = timeInNano; - } - - private: - mutable std::mutex mLock; - std::vector mPropertyConfigs GUARDED_BY(mLock); - mutable std::list> mGetValueRequests GUARDED_BY(mLock); - mutable std::list> mGetValueResponses GUARDED_BY(mLock); - mutable std::list> mSetValueRequests GUARDED_BY(mLock); - mutable std::list> mSetValueResponses GUARDED_BY(mLock); - std::unordered_map mStatusByFunctions GUARDED_BY(mLock); - int64_t mSleepTime GUARDED_BY(mLock) = 0; - mutable std::vector mThreads GUARDED_BY(mLock); - - template - StatusCode returnResponse( - std::shared_ptr)>> callback, - std::list>* storedResponses) const; - - template - StatusCode handleRequests( - const char* functionName, - std::shared_ptr)>> callback, - const std::vector& requests, - std::list>* storedRequests, - std::list>* storedResponses) const REQUIRES(mLock); -}; - -template -StatusCode MockVehicleHardware::returnResponse( - std::shared_ptr)>> callback, - std::list>* storedResponses) const { - if (storedResponses->size() > 0) { - (*callback)(std::move(storedResponses->front())); - storedResponses->pop_front(); - return StatusCode::OK; - } else { - ALOGE("no more response"); - return StatusCode::INTERNAL_ERROR; - } -} - -template StatusCode MockVehicleHardware::returnResponse( - std::shared_ptr)>> callback, - std::list>* storedResponses) const; - -template StatusCode MockVehicleHardware::returnResponse( - std::shared_ptr)>> callback, - std::list>* storedResponses) const; - -template -StatusCode MockVehicleHardware::handleRequests( - const char* functionName, - std::shared_ptr)>> callback, - const std::vector& requests, - std::list>* storedRequests, - std::list>* storedResponses) const { - storedRequests->push_back(requests); - if (auto it = mStatusByFunctions.find(functionName); it != mStatusByFunctions.end()) { - if (StatusCode status = it->second; status != StatusCode::OK) { - return status; - } - } - - if (mSleepTime != 0) { - int64_t sleepTime = mSleepTime; - mThreads.emplace_back([this, callback, sleepTime, storedResponses]() { - std::this_thread::sleep_for(std::chrono::nanoseconds(sleepTime)); - returnResponse(callback, storedResponses); - }); - return StatusCode::OK; - - } else { - return returnResponse(callback, storedResponses); - } -} - -template StatusCode MockVehicleHardware::handleRequests( - const char* functionName, - std::shared_ptr)>> callback, - const std::vector& requests, - std::list>* storedRequests, - std::list>* storedResponses) const; - -template StatusCode MockVehicleHardware::handleRequests( - const char* functionName, - std::shared_ptr)>> callback, - const std::vector& requests, - std::list>* storedRequests, - std::list>* storedResponses) const; - struct PropConfigCmp { bool operator()(const VehiclePropConfig& a, const VehiclePropConfig& b) const { return (a.prop < b.prop); diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp index ca366cd746..5e3e03c64a 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp @@ -30,16 +30,6 @@ using ::aidl::android::hardware::automotive::vehicle::VehiclePropValues; using ::ndk::ScopedAStatus; using ::ndk::ScopedFileDescriptor; -template -std::optional pop(std::list& items) { - if (items.size() > 0) { - auto item = std::move(items.front()); - items.pop_front(); - return item; - } - return std::nullopt; -} - template static ScopedAStatus storeResults(const T& results, std::list* storedResults) { T resultsCopy{ @@ -65,8 +55,12 @@ ScopedAStatus MockVehicleCallback::onSetValues(const SetValueResults& results) { return storeResults(results, &mSetValueResults); } -ScopedAStatus MockVehicleCallback::onPropertyEvent(const VehiclePropValues&, int32_t) { - return ScopedAStatus::ok(); +ScopedAStatus MockVehicleCallback::onPropertyEvent(const VehiclePropValues& results, + int32_t sharedMemoryFileCount) { + std::scoped_lock lockGuard(mLock); + + mSharedMemoryFileCount = sharedMemoryFileCount; + return storeResults(results, &mOnPropertyEventResults); } ScopedAStatus MockVehicleCallback::onPropertySetError(const VehiclePropErrors&) { @@ -83,6 +77,11 @@ std::optional MockVehicleCallback::nextSetValueResults() { return pop(mSetValueResults); } +std::optional MockVehicleCallback::nextOnPropertyEventResults() { + std::scoped_lock lockGuard(mLock); + return pop(mOnPropertyEventResults); +} + } // 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 916575abdc..c83164ff79 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h @@ -31,6 +31,16 @@ namespace hardware { namespace automotive { namespace vehicle { +template +std::optional pop(std::list& items) { + if (items.size() > 0) { + auto item = std::move(items.front()); + items.pop_front(); + return item; + } + return std::nullopt; +} + // MockVehicleCallback is a mock VehicleCallback implementation that simply stores the results. class MockVehicleCallback final : public ::aidl::android::hardware::automotive::vehicle::BnVehicleCallback { @@ -52,6 +62,8 @@ class MockVehicleCallback final nextGetValueResults(); std::optional<::aidl::android::hardware::automotive::vehicle::SetValueResults> nextSetValueResults(); + std::optional<::aidl::android::hardware::automotive::vehicle::VehiclePropValues> + nextOnPropertyEventResults(); private: std::mutex mLock; @@ -59,6 +71,9 @@ class MockVehicleCallback final GUARDED_BY(mLock); std::list<::aidl::android::hardware::automotive::vehicle::SetValueResults> mSetValueResults GUARDED_BY(mLock); + std::list<::aidl::android::hardware::automotive::vehicle::VehiclePropValues> + mOnPropertyEventResults GUARDED_BY(mLock); + int32_t mSharedMemoryFileCount GUARDED_BY(mLock); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp new file mode 100644 index 0000000000..7d992af0b4 --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp @@ -0,0 +1,207 @@ +/* + * 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 "MockVehicleHardware.h" +#include "MockVehicleCallback.h" + +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +using ::aidl::android::hardware::automotive::vehicle::GetValueRequest; +using ::aidl::android::hardware::automotive::vehicle::GetValueResult; +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::VehiclePropConfig; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; + +MockVehicleHardware::~MockVehicleHardware() { + std::unique_lock lk(mLock); + mCv.wait(lk, [this] { return mThreadCount == 0; }); +} + +std::vector MockVehicleHardware::getAllPropertyConfigs() const { + std::scoped_lock lockGuard(mLock); + return mPropertyConfigs; +} + +StatusCode MockVehicleHardware::setValues(std::shared_ptr callback, + const std::vector& requests) { + std::scoped_lock lockGuard(mLock); + if (StatusCode status = handleRequestsLocked(__func__, callback, requests, &mSetValueRequests, + &mSetValueResponses); + status != StatusCode::OK) { + return status; + } + if (mPropertyChangeCallback == nullptr) { + return StatusCode::OK; + } + std::vector values; + for (auto& request : requests) { + values.push_back(request.value); + } + (*mPropertyChangeCallback)(values); + return StatusCode::OK; +} + +StatusCode MockVehicleHardware::getValues(std::shared_ptr callback, + const std::vector& requests) const { + std::scoped_lock lockGuard(mLock); + return handleRequestsLocked(__func__, callback, requests, &mGetValueRequests, + &mGetValueResponses); +} + +DumpResult MockVehicleHardware::dump(const std::vector&) { + // TODO(b/200737967): mock this. + return DumpResult{}; +} + +StatusCode MockVehicleHardware::checkHealth() { + // TODO(b/200737967): mock this. + return StatusCode::OK; +} + +void MockVehicleHardware::registerOnPropertyChangeEvent( + std::unique_ptr callback) { + std::scoped_lock lockGuard(mLock); + mPropertyChangeCallback = std::move(callback); +} + +void MockVehicleHardware::registerOnPropertySetErrorEvent( + std::unique_ptr) { + // TODO(b/200737967): mock this. +} + +void MockVehicleHardware::setPropertyConfigs(const std::vector& configs) { + std::scoped_lock lockGuard(mLock); + mPropertyConfigs = configs; +} + +void MockVehicleHardware::addGetValueResponses(const std::vector& responses) { + std::scoped_lock lockGuard(mLock); + mGetValueResponses.push_back(responses); +} + +void MockVehicleHardware::addSetValueResponses(const std::vector& responses) { + std::scoped_lock lockGuard(mLock); + mSetValueResponses.push_back(responses); +} + +std::vector MockVehicleHardware::nextGetValueRequests() { + std::scoped_lock lockGuard(mLock); + std::optional> request = pop(mGetValueRequests); + if (!request.has_value()) { + return std::vector(); + } + return std::move(request.value()); +} + +std::vector MockVehicleHardware::nextSetValueRequests() { + std::scoped_lock lockGuard(mLock); + std::optional> request = pop(mSetValueRequests); + if (!request.has_value()) { + return std::vector(); + } + return std::move(request.value()); +} + +void MockVehicleHardware::setStatus(const char* functionName, StatusCode status) { + std::scoped_lock lockGuard(mLock); + mStatusByFunctions[functionName] = status; +} + +void MockVehicleHardware::setSleepTime(int64_t timeInNano) { + std::scoped_lock lockGuard(mLock); + mSleepTime = timeInNano; +} + +template +StatusCode MockVehicleHardware::returnResponse( + std::shared_ptr)>> callback, + std::list>* storedResponses) const { + if (storedResponses->size() > 0) { + (*callback)(std::move(storedResponses->front())); + storedResponses->pop_front(); + return StatusCode::OK; + } else { + ALOGE("no more response"); + return StatusCode::INTERNAL_ERROR; + } +} + +template StatusCode MockVehicleHardware::returnResponse( + std::shared_ptr)>> callback, + std::list>* storedResponses) const; + +template StatusCode MockVehicleHardware::returnResponse( + std::shared_ptr)>> callback, + std::list>* storedResponses) const; + +template +StatusCode MockVehicleHardware::handleRequestsLocked( + const char* functionName, + std::shared_ptr)>> callback, + const std::vector& requests, + std::list>* storedRequests, + std::list>* storedResponses) const { + storedRequests->push_back(requests); + if (auto it = mStatusByFunctions.find(functionName); it != mStatusByFunctions.end()) { + if (StatusCode status = it->second; status != StatusCode::OK) { + return status; + } + } + + if (mSleepTime != 0) { + int64_t sleepTime = mSleepTime; + mThreadCount++; + std::thread t([this, callback, sleepTime, storedResponses]() { + std::this_thread::sleep_for(std::chrono::nanoseconds(sleepTime)); + returnResponse(callback, storedResponses); + mThreadCount--; + mCv.notify_one(); + }); + // Detach the thread here so we do not have to maintain the thread object. mThreadCount + // and mCv make sure we wait for all threads to end before we exit. + t.detach(); + return StatusCode::OK; + + } else { + return returnResponse(callback, storedResponses); + } +} + +template StatusCode MockVehicleHardware::handleRequestsLocked( + const char* functionName, + std::shared_ptr)>> callback, + const std::vector& requests, + std::list>* storedRequests, + std::list>* storedResponses) const; + +template StatusCode MockVehicleHardware::handleRequestsLocked( + const char* functionName, + std::shared_ptr)>> callback, + const std::vector& requests, + std::list>* storedRequests, + std::list>* storedResponses) const; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h new file mode 100644 index 0000000000..283d1f96cd --- /dev/null +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h @@ -0,0 +1,114 @@ +/* + * 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_aidl_impl_vhal_test_MockVehicleHardware_H_ +#define android_hardware_automotive_vehicle_aidl_impl_vhal_test_MockVehicleHardware_H_ + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace automotive { +namespace vehicle { + +class MockVehicleHardware final : public IVehicleHardware { + public: + ~MockVehicleHardware(); + + std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig> + getAllPropertyConfigs() const override; + ::aidl::android::hardware::automotive::vehicle::StatusCode setValues( + std::shared_ptr callback, + const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>& + requests) override; + ::aidl::android::hardware::automotive::vehicle::StatusCode getValues( + std::shared_ptr callback, + const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>& + requests) const override; + DumpResult dump(const std::vector&) override; + ::aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() override; + void registerOnPropertyChangeEvent( + std::unique_ptr callback) override; + void registerOnPropertySetErrorEvent(std::unique_ptr) override; + + // Test functions. + void setPropertyConfigs( + const std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig>& + configs); + void addGetValueResponses( + const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueResult>& + responses); + void addSetValueResponses( + const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueResult>& + responses); + std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest> + nextGetValueRequests(); + std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest> + nextSetValueRequests(); + void setStatus(const char* functionName, + ::aidl::android::hardware::automotive::vehicle::StatusCode status); + void setSleepTime(int64_t timeInNano); + + private: + mutable std::mutex mLock; + mutable std::condition_variable mCv; + mutable std::atomic mThreadCount; + std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig> mPropertyConfigs + GUARDED_BY(mLock); + mutable std::list> + mGetValueRequests GUARDED_BY(mLock); + mutable std::list> + mGetValueResponses GUARDED_BY(mLock); + mutable std::list> + mSetValueRequests GUARDED_BY(mLock); + mutable std::list> + mSetValueResponses GUARDED_BY(mLock); + std::unordered_map + mStatusByFunctions GUARDED_BY(mLock); + int64_t mSleepTime GUARDED_BY(mLock) = 0; + std::unique_ptr mPropertyChangeCallback GUARDED_BY(mLock); + + template + ::aidl::android::hardware::automotive::vehicle::StatusCode returnResponse( + std::shared_ptr)>> callback, + std::list>* storedResponses) const; + template + ::aidl::android::hardware::automotive::vehicle::StatusCode handleRequestsLocked( + const char* functionName, + std::shared_ptr)>> callback, + const std::vector& requests, + std::list>* storedRequests, + std::list>* storedResponses) const REQUIRES(mLock); +}; + +} // namespace vehicle +} // namespace automotive +} // namespace hardware +} // namespace android + +#endif // android_hardware_automotive_vehicle_aidl_impl_vhal_test_MockVehicleHardware_H_ -- GitLab From a42956fbe8ed18dce9e69f47813f911c2f525376 Mon Sep 17 00:00:00 2001 From: Shinru Han Date: Wed, 29 Dec 2021 15:45:57 +0800 Subject: [PATCH 460/825] Add minDistance parameter to GnssBatching (hardware/interface) Test: atest VtsHalGnssTargetTest Bug: b/206670536 Change-Id: I982dd64d0cfe0f42c411e4df27d9fdd160c74d2e --- .../android/hardware/gnss/IGnssBatching.aidl | 8 ++++++- .../android/hardware/gnss/IGnssBatching.aidl | 24 ++++++++++++++++--- gnss/aidl/default/GnssBatching.cpp | 10 ++++---- gnss/aidl/default/GnssBatching.h | 3 ++- gnss/aidl/vts/gnss_hal_test_cases.cpp | 4 ++++ 5 files changed, 40 insertions(+), 9 deletions(-) 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 492edc3161..e1beed3b89 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 @@ -36,9 +36,15 @@ package android.hardware.gnss; interface IGnssBatching { void init(in android.hardware.gnss.IGnssBatchingCallback callback); int getBatchSize(); - void start(in long periodNanos, in int flags); + void start(in android.hardware.gnss.IGnssBatching.Options options); void flush(); void stop(); void cleanup(); const int WAKEUP_ON_FIFO_FULL = 1; + @VintfStability + parcelable Options { + long periodNanos; + float minDistanceMeters; + int flags; + } } diff --git a/gnss/aidl/android/hardware/gnss/IGnssBatching.aidl b/gnss/aidl/android/hardware/gnss/IGnssBatching.aidl index 0d48ee1c29..0d03a0f009 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssBatching.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssBatching.aidl @@ -46,6 +46,25 @@ interface IGnssBatching { */ const int WAKEUP_ON_FIFO_FULL = 0x01; + /** Options specifying the batching request. */ + @VintfStability + parcelable Options { + /** Time interval between samples in the location batch, in nanoseconds. */ + long periodNanos; + + /** + * The minimum distance in meters that the batching engine should + * accumulate before trying another GPS fix when in a challenging GPS environment. + * + * This is an optional field. If it is set as 0, the chipset can operate in an automatic + * mode. + */ + float minDistanceMeters; + + /** A bit field of Flags (WAKEUP_ON_FIFO_FULL) indicating the batching behavior. */ + int flags; + } + /** * Open the interface and provides the callback routines to the implementation of this * interface. @@ -83,10 +102,9 @@ interface IGnssBatching { * for using flushBatchedLocation to explicitly ask for the location as needed, to avoid it * being dropped. * - * @param periodNanos Time interval between samples in the location batch, in nanoseconds - * @param flags A bitfield of flags (WAKEUP_ON_FIFO_FULL) indicating the batching behavior + * @param options Options specifying the batching request. */ - void start(in long periodNanos, in int flags); + void start(in Options options); /** * Retrieve all batched locations currently stored. diff --git a/gnss/aidl/default/GnssBatching.cpp b/gnss/aidl/default/GnssBatching.cpp index b8be5e5baf..33e1fd500e 100644 --- a/gnss/aidl/default/GnssBatching.cpp +++ b/gnss/aidl/default/GnssBatching.cpp @@ -52,17 +52,19 @@ ndk::ScopedAStatus GnssBatching::getBatchSize(int* size) { return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus GnssBatching::start(int64_t periodNanos, int flags) { - ALOGD("start: periodNanos=%" PRId64 ", flags=%d", periodNanos, flags); +ndk::ScopedAStatus GnssBatching::start(const Options& options) { + ALOGD("start: periodNanos=%" PRId64 ", minDistanceMeters=%f, flags=%d", options.periodNanos, + options.minDistanceMeters, options.flags); if (mIsActive) { ALOGW("Gnss has started. Restarting..."); stop(); } - mWakeUpOnFifoFull = (flags & IGnssBatching::WAKEUP_ON_FIFO_FULL) ? true : false; // mMinIntervalMs is not smaller than 1 sec - periodNanos = (periodNanos < 1e9) ? 1e9 : periodNanos; + long periodNanos = (options.periodNanos < 1e9) ? 1e9 : options.periodNanos; mMinIntervalMs = periodNanos / 1e6; + mWakeUpOnFifoFull = (options.flags & IGnssBatching::WAKEUP_ON_FIFO_FULL) ? true : false; + mMinDistanceMeters = options.minDistanceMeters; mIsActive = true; mThread = std::thread([this]() { diff --git a/gnss/aidl/default/GnssBatching.h b/gnss/aidl/default/GnssBatching.h index 7cd6e85840..6d1d809230 100644 --- a/gnss/aidl/default/GnssBatching.h +++ b/gnss/aidl/default/GnssBatching.h @@ -28,7 +28,7 @@ struct GnssBatching : public BnGnssBatching { ~GnssBatching(); ndk::ScopedAStatus init(const std::shared_ptr& callback) override; ndk::ScopedAStatus getBatchSize(int* size) override; - ndk::ScopedAStatus start(int64_t periodNanos, int flags) override; + ndk::ScopedAStatus start(const Options& options) override; ndk::ScopedAStatus flush() override; ndk::ScopedAStatus stop() override; ndk::ScopedAStatus cleanup() override; @@ -42,6 +42,7 @@ struct GnssBatching : public BnGnssBatching { std::thread mThread; std::atomic mIsActive; std::atomic mMinIntervalMs; + std::atomic mMinDistanceMeters; std::atomic mWakeUpOnFifoFull; // Synchronization lock for sCallback diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index c5fea7ab5c..1fa68253c7 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -813,6 +813,10 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOn) { * TestAllExtensions. */ TEST_P(GnssHalTest, TestAllExtensions) { + if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + return; + } + sp iGnssBatching; auto status = aidl_gnss_hal_->getExtensionGnssBatching(&iGnssBatching); if (status.isOk() && iGnssBatching != nullptr) { -- GitLab From 0e671f3edb9d2c78658a4ef4169e3211e3f9bb00 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Tue, 26 Oct 2021 20:03:05 +0000 Subject: [PATCH 461/825] HAL interface for compilation and execution hints The following AIDL types are added: - TokenValuePair - PrepareModelConfig - ExecutionConfig The following AIDL methods are added: - IDevice::prepareModelWithConfig - IPreparedModel::executeSynchronouslyWithConfig - IPreparedModel::executeFencedWithConfig - IBurst::executeSynchronouslyWithConfig The compilation and execution hints are being stored as a list of token-value pairs as part of the PrepareModelConfig / ExecutionConfig. And the PrepareModelConfig / ExecutionConfig parcelables are created in order to make future extensions to the execution related interfaces easier. It is the drivers responsibility to verify the hints, and it is allowed for the driver to ignore them. Bug: 203248587 Test: neuralnetworks_utils_hal_aidl_test Change-Id: I98240fd75089fc85cdfcaa0be28aab8a6f0dfca5 --- .../1.0/utils/include/nnapi/hal/1.0/Burst.h | 9 +- .../1.0/utils/include/nnapi/hal/1.0/Device.h | 5 +- .../include/nnapi/hal/1.0/PreparedModel.h | 13 +- neuralnetworks/1.0/utils/src/Burst.cpp | 15 +- neuralnetworks/1.0/utils/src/Device.cpp | 4 +- .../1.0/utils/src/PreparedModel.cpp | 21 +- neuralnetworks/1.0/utils/test/DeviceTest.cpp | 14 +- .../1.0/utils/test/PreparedModelTest.cpp | 28 +- .../1.1/utils/include/nnapi/hal/1.1/Device.h | 5 +- neuralnetworks/1.1/utils/src/Device.cpp | 4 +- neuralnetworks/1.1/utils/test/DeviceTest.cpp | 14 +- .../1.2/utils/include/nnapi/hal/1.2/Burst.h | 9 +- .../utils/include/nnapi/hal/1.2/Conversions.h | 4 +- .../1.2/utils/include/nnapi/hal/1.2/Device.h | 5 +- .../include/nnapi/hal/1.2/PreparedModel.h | 13 +- neuralnetworks/1.2/utils/src/Burst.cpp | 16 +- neuralnetworks/1.2/utils/src/Conversions.cpp | 6 +- neuralnetworks/1.2/utils/src/Device.cpp | 4 +- .../1.2/utils/src/PreparedModel.cpp | 21 +- neuralnetworks/1.2/utils/test/DeviceTest.cpp | 14 +- .../1.2/utils/test/PreparedModelTest.cpp | 44 +-- .../1.3/utils/include/nnapi/hal/1.3/Device.h | 5 +- .../include/nnapi/hal/1.3/PreparedModel.h | 13 +- neuralnetworks/1.3/utils/src/Conversions.cpp | 2 +- neuralnetworks/1.3/utils/src/Device.cpp | 4 +- .../1.3/utils/src/PreparedModel.cpp | 20 +- neuralnetworks/1.3/utils/test/DeviceTest.cpp | 14 +- .../1.3/utils/test/PreparedModelTest.cpp | 60 ++-- .../neuralnetworks/ExecutionConfig.aidl | 41 +++ .../hardware/neuralnetworks/IBurst.aidl | 1 + .../hardware/neuralnetworks/IDevice.aidl | 1 + .../neuralnetworks/IPreparedModel.aidl | 4 +- .../neuralnetworks/PrepareModelConfig.aidl | 45 +++ .../neuralnetworks/TokenValuePair.aidl | 39 +++ .../neuralnetworks/ExecutionConfig.aidl | 60 ++++ .../hardware/neuralnetworks/Extension.aidl | 4 + .../ExtensionNameAndPrefix.aidl | 3 +- .../hardware/neuralnetworks/IBurst.aidl | 12 + .../hardware/neuralnetworks/IDevice.aidl | 41 ++- .../neuralnetworks/IPreparedModel.aidl | 77 ++++- .../neuralnetworks/PrepareModelConfig.aidl | 95 ++++++ .../neuralnetworks/TokenValuePair.aidl | 42 +++ .../aidl/utils/include/nnapi/hal/aidl/Burst.h | 18 +- .../include/nnapi/hal/aidl/Conversions.h | 31 +- .../utils/include/nnapi/hal/aidl/Device.h | 6 +- .../include/nnapi/hal/aidl/HalInterfaces.h | 2 + .../include/nnapi/hal/aidl/InvalidDevice.h | 3 + .../include/nnapi/hal/aidl/PreparedModel.h | 18 +- neuralnetworks/aidl/utils/src/Burst.cpp | 68 +++-- neuralnetworks/aidl/utils/src/Conversions.cpp | 39 ++- neuralnetworks/aidl/utils/src/Device.cpp | 21 +- neuralnetworks/aidl/utils/src/Execution.cpp | 8 +- .../aidl/utils/src/InvalidDevice.cpp | 25 ++ .../aidl/utils/src/PreparedModel.cpp | 87 ++++-- neuralnetworks/aidl/utils/test/DeviceTest.cpp | 191 +++++++++++- neuralnetworks/aidl/utils/test/MockBurst.h | 4 + neuralnetworks/aidl/utils/test/MockDevice.h | 4 + .../aidl/utils/test/MockPreparedModel.h | 11 +- .../aidl/utils/test/PreparedModelTest.cpp | 287 ++++++++++++++++-- .../vts/functional/GeneratedTestHarness.cpp | 83 ++++- .../aidl/vts/functional/MemoryDomainTests.cpp | 14 +- .../aidl/vts/functional/ValidateModel.cpp | 29 ++ .../aidl/vts/functional/ValidateRequest.cpp | 55 +++- .../vts/functional/VtsHalNeuralnetworks.cpp | 27 +- .../vts/functional/VtsHalNeuralnetworks.h | 4 +- .../aidl/include/nnapi/hal/aidl/Burst.h | 5 + .../aidl/include/nnapi/hal/aidl/Device.h | 4 + .../include/nnapi/hal/aidl/PreparedModel.h | 12 +- .../utils/adapter/aidl/src/Burst.cpp | 28 +- .../utils/adapter/aidl/src/Device.cpp | 47 ++- .../utils/adapter/aidl/src/PreparedModel.cpp | 77 ++++- .../utils/adapter/hidl/src/Burst.cpp | 2 +- .../utils/adapter/hidl/src/Device.cpp | 10 +- .../utils/adapter/hidl/src/PreparedModel.cpp | 19 +- .../common/include/nnapi/hal/InvalidBurst.h | 9 +- .../common/include/nnapi/hal/InvalidDevice.h | 5 +- .../include/nnapi/hal/InvalidPreparedModel.h | 13 +- .../common/include/nnapi/hal/ResilientBurst.h | 13 +- .../include/nnapi/hal/ResilientDevice.h | 9 +- .../nnapi/hal/ResilientPreparedModel.h | 17 +- .../utils/common/src/InvalidBurst.cpp | 8 +- .../utils/common/src/InvalidDevice.cpp | 4 +- .../utils/common/src/InvalidPreparedModel.cpp | 17 +- .../utils/common/src/ResilientBurst.cpp | 36 ++- .../utils/common/src/ResilientDevice.cpp | 22 +- .../common/src/ResilientPreparedModel.cpp | 59 ++-- neuralnetworks/utils/common/test/MockDevice.h | 4 +- .../utils/common/test/MockPreparedModel.h | 14 +- .../utils/common/test/ResilientDeviceTest.cpp | 20 +- .../test/ResilientPreparedModelTest.cpp | 46 +-- 90 files changed, 1913 insertions(+), 473 deletions(-) create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionConfig.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PrepareModelConfig.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/TokenValuePair.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/ExecutionConfig.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/PrepareModelConfig.aidl create mode 100644 neuralnetworks/aidl/android/hardware/neuralnetworks/TokenValuePair.aidl diff --git a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Burst.h b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Burst.h index 8bd2fbed7d..cef76c6065 100644 --- a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Burst.h +++ b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Burst.h @@ -45,12 +45,15 @@ class Burst final : public nn::IBurst { nn::ExecutionResult, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; private: const nn::SharedPreparedModel kPreparedModel; diff --git a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Device.h b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Device.h index 0a6ca3edce..d7c43ef281 100644 --- a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Device.h +++ b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/Device.h @@ -65,8 +65,9 @@ class Device final : public nn::IDevice { nn::GeneralResult prepareModel( const nn::Model& model, nn::ExecutionPreference preference, nn::Priority priority, nn::OptionalTimePoint deadline, const std::vector& modelCache, - const std::vector& dataCache, - const nn::CacheToken& token) const override; + const std::vector& dataCache, const nn::CacheToken& token, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult prepareModelFromCache( nn::OptionalTimePoint deadline, const std::vector& modelCache, diff --git a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/PreparedModel.h b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/PreparedModel.h index bdb5b54281..337c13267d 100644 --- a/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/PreparedModel.h +++ b/neuralnetworks/1.0/utils/include/nnapi/hal/1.0/PreparedModel.h @@ -49,18 +49,23 @@ class PreparedModel final : public nn::IPreparedModel, nn::ExecutionResult, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult> executeFenced( const nn::Request& request, const std::vector& waitFor, nn::MeasureTiming measure, const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, - const nn::OptionalDuration& timeoutDurationAfterFence) const override; + const nn::OptionalDuration& timeoutDurationAfterFence, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult configureExecutionBurst() const override; diff --git a/neuralnetworks/1.0/utils/src/Burst.cpp b/neuralnetworks/1.0/utils/src/Burst.cpp index 128472110d..3642bc608f 100644 --- a/neuralnetworks/1.0/utils/src/Burst.cpp +++ b/neuralnetworks/1.0/utils/src/Burst.cpp @@ -50,15 +50,20 @@ Burst::OptionalCacheHold Burst::cacheMemory(const nn::SharedMemory& /*memory*/) nn::ExecutionResult, nn::Timing>> Burst::execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const { - return kPreparedModel->execute(request, measure, deadline, loopTimeoutDuration); + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { + return kPreparedModel->execute(request, measure, deadline, loopTimeoutDuration, hints, + extensionNameToPrefix); } nn::GeneralResult Burst::createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const { - return kPreparedModel->createReusableExecution(request, measure, loopTimeoutDuration); + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { + return kPreparedModel->createReusableExecution(request, measure, loopTimeoutDuration, hints, + extensionNameToPrefix); } } // namespace android::hardware::neuralnetworks::V1_0::utils diff --git a/neuralnetworks/1.0/utils/src/Device.cpp b/neuralnetworks/1.0/utils/src/Device.cpp index b0c236efe8..620d04066f 100644 --- a/neuralnetworks/1.0/utils/src/Device.cpp +++ b/neuralnetworks/1.0/utils/src/Device.cpp @@ -143,7 +143,9 @@ nn::GeneralResult> Device::getSupportedOperations(const nn::Mo nn::GeneralResult Device::prepareModel( const nn::Model& model, nn::ExecutionPreference /*preference*/, nn::Priority /*priority*/, nn::OptionalTimePoint /*deadline*/, const std::vector& /*modelCache*/, - const std::vector& /*dataCache*/, const nn::CacheToken& /*token*/) const { + const std::vector& /*dataCache*/, const nn::CacheToken& /*token*/, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { // Ensure that model is ready for IPC. std::optional maybeModelInShared; const nn::Model& modelInShared = diff --git a/neuralnetworks/1.0/utils/src/PreparedModel.cpp b/neuralnetworks/1.0/utils/src/PreparedModel.cpp index 00e7d22916..b8055fc081 100644 --- a/neuralnetworks/1.0/utils/src/PreparedModel.cpp +++ b/neuralnetworks/1.0/utils/src/PreparedModel.cpp @@ -59,7 +59,9 @@ PreparedModel::PreparedModel(PrivateConstructorTag /*tag*/, sp, nn::Timing>> PreparedModel::execute( const nn::Request& request, nn::MeasureTiming /*measure*/, const nn::OptionalTimePoint& /*deadline*/, - const nn::OptionalDuration& /*loopTimeoutDuration*/) const { + const nn::OptionalDuration& /*loopTimeoutDuration*/, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { // Ensure that request is ready for IPC. std::optional maybeRequestInShared; hal::utils::RequestRelocation relocation; @@ -94,19 +96,22 @@ PreparedModel::executeInternal(const V1_0::Request& request, } nn::GeneralResult> -PreparedModel::executeFenced(const nn::Request& /*request*/, - const std::vector& /*waitFor*/, - nn::MeasureTiming /*measure*/, - const nn::OptionalTimePoint& /*deadline*/, - const nn::OptionalDuration& /*loopTimeoutDuration*/, - const nn::OptionalDuration& /*timeoutDurationAfterFence*/) const { +PreparedModel::executeFenced( + const nn::Request& /*request*/, const std::vector& /*waitFor*/, + nn::MeasureTiming /*measure*/, const nn::OptionalTimePoint& /*deadline*/, + const nn::OptionalDuration& /*loopTimeoutDuration*/, + const nn::OptionalDuration& /*timeoutDurationAfterFence*/, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) << "IPreparedModel::executeFenced is not supported on 1.0 HAL service"; } nn::GeneralResult PreparedModel::createReusableExecution( const nn::Request& request, nn::MeasureTiming /*measure*/, - const nn::OptionalDuration& /*loopTimeoutDuration*/) const { + const nn::OptionalDuration& /*loopTimeoutDuration*/, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { // Ensure that request is ready for IPC. std::optional maybeRequestInShared; hal::utils::RequestRelocation relocation; diff --git a/neuralnetworks/1.0/utils/test/DeviceTest.cpp b/neuralnetworks/1.0/utils/test/DeviceTest.cpp index 83e555fad5..9e9db1641d 100644 --- a/neuralnetworks/1.0/utils/test/DeviceTest.cpp +++ b/neuralnetworks/1.0/utils/test/DeviceTest.cpp @@ -380,7 +380,7 @@ TEST(DeviceTest, prepareModel) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -399,7 +399,7 @@ TEST(DeviceTest, prepareModelLaunchError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -417,7 +417,7 @@ TEST(DeviceTest, prepareModelReturnError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -435,7 +435,7 @@ TEST(DeviceTest, prepareModelNullptrError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -452,7 +452,7 @@ TEST(DeviceTest, prepareModelTransportFailure) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -469,7 +469,7 @@ TEST(DeviceTest, prepareModelDeadObject) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -488,7 +488,7 @@ TEST(DeviceTest, prepareModelAsyncCrash) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); diff --git a/neuralnetworks/1.0/utils/test/PreparedModelTest.cpp b/neuralnetworks/1.0/utils/test/PreparedModelTest.cpp index 7820c06746..e03a98de32 100644 --- a/neuralnetworks/1.0/utils/test/PreparedModelTest.cpp +++ b/neuralnetworks/1.0/utils/test/PreparedModelTest.cpp @@ -121,7 +121,7 @@ TEST(PreparedModelTest, execute) { .WillOnce(Invoke(makeExecute(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result EXPECT_TRUE(result.has_value()) @@ -138,7 +138,7 @@ TEST(PreparedModelTest, executeLaunchError) { V1_0::ErrorStatus::GENERAL_FAILURE))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -155,7 +155,7 @@ TEST(PreparedModelTest, executeReturnError) { makeExecute(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::GENERAL_FAILURE))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -171,7 +171,7 @@ TEST(PreparedModelTest, executeTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -187,7 +187,7 @@ TEST(PreparedModelTest, executeDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -205,7 +205,7 @@ TEST(PreparedModelTest, executeCrash) { EXPECT_CALL(*mockPreparedModel, execute(_, _)).Times(1).WillOnce(InvokeWithoutArgs(ret)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -218,7 +218,7 @@ TEST(PreparedModelTest, executeFencedNotSupported) { const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -235,7 +235,7 @@ TEST(PreparedModelTest, reusableExecute) { .WillRepeatedly(Invoke(makeExecute(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -258,7 +258,7 @@ TEST(PreparedModelTest, reusableExecuteLaunchError) { V1_0::ErrorStatus::GENERAL_FAILURE))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -279,7 +279,7 @@ TEST(PreparedModelTest, reusableExecuteReturnError) { makeExecute(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::GENERAL_FAILURE))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -299,7 +299,7 @@ TEST(PreparedModelTest, reusableExecuteTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -319,7 +319,7 @@ TEST(PreparedModelTest, reusableExecuteDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -341,7 +341,7 @@ TEST(PreparedModelTest, reusableExecuteCrash) { EXPECT_CALL(*mockPreparedModel, execute(_, _)).Times(1).WillOnce(InvokeWithoutArgs(ret)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -358,7 +358,7 @@ TEST(PreparedModelTest, reusableExecuteFencedNotSupported) { const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); diff --git a/neuralnetworks/1.1/utils/include/nnapi/hal/1.1/Device.h b/neuralnetworks/1.1/utils/include/nnapi/hal/1.1/Device.h index d6bd36a7fe..38ca1382be 100644 --- a/neuralnetworks/1.1/utils/include/nnapi/hal/1.1/Device.h +++ b/neuralnetworks/1.1/utils/include/nnapi/hal/1.1/Device.h @@ -64,8 +64,9 @@ class Device final : public nn::IDevice { nn::GeneralResult prepareModel( const nn::Model& model, nn::ExecutionPreference preference, nn::Priority priority, nn::OptionalTimePoint deadline, const std::vector& modelCache, - const std::vector& dataCache, - const nn::CacheToken& token) const override; + const std::vector& dataCache, const nn::CacheToken& token, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult prepareModelFromCache( nn::OptionalTimePoint deadline, const std::vector& modelCache, diff --git a/neuralnetworks/1.1/utils/src/Device.cpp b/neuralnetworks/1.1/utils/src/Device.cpp index 3effa8428d..28f3276389 100644 --- a/neuralnetworks/1.1/utils/src/Device.cpp +++ b/neuralnetworks/1.1/utils/src/Device.cpp @@ -143,7 +143,9 @@ nn::GeneralResult> Device::getSupportedOperations(const nn::Mo nn::GeneralResult Device::prepareModel( const nn::Model& model, nn::ExecutionPreference preference, nn::Priority /*priority*/, nn::OptionalTimePoint /*deadline*/, const std::vector& /*modelCache*/, - const std::vector& /*dataCache*/, const nn::CacheToken& /*token*/) const { + const std::vector& /*dataCache*/, const nn::CacheToken& /*token*/, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { // Ensure that model is ready for IPC. std::optional maybeModelInShared; const nn::Model& modelInShared = diff --git a/neuralnetworks/1.1/utils/test/DeviceTest.cpp b/neuralnetworks/1.1/utils/test/DeviceTest.cpp index 2248da6ffe..8ab87bc97a 100644 --- a/neuralnetworks/1.1/utils/test/DeviceTest.cpp +++ b/neuralnetworks/1.1/utils/test/DeviceTest.cpp @@ -390,7 +390,7 @@ TEST(DeviceTest, prepareModel) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -409,7 +409,7 @@ TEST(DeviceTest, prepareModelLaunchError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -427,7 +427,7 @@ TEST(DeviceTest, prepareModelReturnError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -445,7 +445,7 @@ TEST(DeviceTest, prepareModelNullptrError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -462,7 +462,7 @@ TEST(DeviceTest, prepareModelTransportFailure) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -479,7 +479,7 @@ TEST(DeviceTest, prepareModelDeadObject) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -498,7 +498,7 @@ TEST(DeviceTest, prepareModelAsyncCrash) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); diff --git a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Burst.h b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Burst.h index ac9411c462..1b28476a88 100644 --- a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Burst.h +++ b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Burst.h @@ -170,13 +170,16 @@ class Burst final : public nn::IBurst, public std::enable_shared_from_this, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; // See IBurst::createReusableExecution for information on this method. nn::GeneralResult createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; // If fallback is not nullptr, this method will invoke the fallback function to try another // execution path if the packet could not be sent. Otherwise, failing to send the packet will diff --git a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Conversions.h b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Conversions.h index c3348aa8f2..4f13adc0a3 100644 --- a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Conversions.h +++ b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Conversions.h @@ -37,7 +37,7 @@ GeneralResult unvalidatedConvert(const hal::V1_2::Operand& operand); GeneralResult unvalidatedConvert( const hal::V1_2::Operand::ExtraParams& extraParams); GeneralResult unvalidatedConvert(const hal::V1_2::Model& model); -GeneralResult unvalidatedConvert( +GeneralResult unvalidatedConvert( const hal::V1_2::Model::ExtensionNameAndPrefix& extensionNameAndPrefix); GeneralResult unvalidatedConvert(const hal::V1_2::OutputShape& outputShape); GeneralResult unvalidatedConvert(const hal::V1_2::MeasureTiming& measureTiming); @@ -78,7 +78,7 @@ nn::GeneralResult unvalidatedConvert( const nn::Operand::ExtraParams& extraParams); nn::GeneralResult unvalidatedConvert(const nn::Model& model); nn::GeneralResult unvalidatedConvert( - const nn::Model::ExtensionNameAndPrefix& extensionNameAndPrefix); + const nn::ExtensionNameAndPrefix& extensionNameAndPrefix); nn::GeneralResult unvalidatedConvert(const nn::OutputShape& outputShape); nn::GeneralResult unvalidatedConvert(const nn::MeasureTiming& measureTiming); nn::GeneralResult unvalidatedConvert(const nn::Timing& timing); diff --git a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Device.h b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Device.h index e7ac172211..d92cf50aa3 100644 --- a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Device.h +++ b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/Device.h @@ -83,8 +83,9 @@ class Device final : public nn::IDevice { nn::GeneralResult prepareModel( const nn::Model& model, nn::ExecutionPreference preference, nn::Priority priority, nn::OptionalTimePoint deadline, const std::vector& modelCache, - const std::vector& dataCache, - const nn::CacheToken& token) const override; + const std::vector& dataCache, const nn::CacheToken& token, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult prepareModelFromCache( nn::OptionalTimePoint deadline, const std::vector& modelCache, diff --git a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/PreparedModel.h b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/PreparedModel.h index 1150e5e79b..72a5b2f007 100644 --- a/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/PreparedModel.h +++ b/neuralnetworks/1.2/utils/include/nnapi/hal/1.2/PreparedModel.h @@ -49,18 +49,23 @@ class PreparedModel final : public nn::IPreparedModel, nn::ExecutionResult, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult> executeFenced( const nn::Request& request, const std::vector& waitFor, nn::MeasureTiming measure, const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, - const nn::OptionalDuration& timeoutDurationAfterFence) const override; + const nn::OptionalDuration& timeoutDurationAfterFence, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult configureExecutionBurst() const override; diff --git a/neuralnetworks/1.2/utils/src/Burst.cpp b/neuralnetworks/1.2/utils/src/Burst.cpp index 911fbfa981..23e80709a0 100644 --- a/neuralnetworks/1.2/utils/src/Burst.cpp +++ b/neuralnetworks/1.2/utils/src/Burst.cpp @@ -305,8 +305,9 @@ Burst::OptionalCacheHold Burst::cacheMemory(const nn::SharedMemory& memory) cons nn::ExecutionResult, nn::Timing>> Burst::execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const { + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { // This is the first point when we know an execution is occurring, so begin to collect // systraces. Note that the first point we can begin collecting systraces in // ExecutionBurstServer is when the RequestChannelReceiver realizes there is data in the FMQ, so @@ -317,7 +318,7 @@ nn::ExecutionResult, nn::Timing>> Burst:: // fall back to another execution path if (!compliantVersion(request).ok()) { // fallback to another execution path if the packet could not be sent - return kPreparedModel->execute(request, measure, deadline, loopTimeoutDuration); + return kPreparedModel->execute(request, measure, deadline, loopTimeoutDuration, {}, {}); } // ensure that request is ready for IPC @@ -346,7 +347,7 @@ nn::ExecutionResult, nn::Timing>> Burst:: // send request packet const auto requestPacket = serialize(hidlRequest, hidlMeasure, slots); const auto fallback = [this, &request, measure, &deadline, &loopTimeoutDuration] { - return kPreparedModel->execute(request, measure, deadline, loopTimeoutDuration); + return kPreparedModel->execute(request, measure, deadline, loopTimeoutDuration, {}, {}); }; return executeInternal(requestPacket, relocation, fallback); } @@ -354,14 +355,17 @@ nn::ExecutionResult, nn::Timing>> Burst:: // See IBurst::createReusableExecution for information on this method. nn::GeneralResult Burst::createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const { + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { NNTRACE_RT(NNTRACE_PHASE_EXECUTION, "Burst::createReusableExecution"); // if the request is valid but of a higher version than what's supported in burst execution, // fall back to another execution path if (!compliantVersion(request).ok()) { // fallback to another execution path if the packet could not be sent - return kPreparedModel->createReusableExecution(request, measure, loopTimeoutDuration); + return kPreparedModel->createReusableExecution(request, measure, loopTimeoutDuration, {}, + {}); } // ensure that request is ready for IPC diff --git a/neuralnetworks/1.2/utils/src/Conversions.cpp b/neuralnetworks/1.2/utils/src/Conversions.cpp index 838d9c4717..62ec2ed6c6 100644 --- a/neuralnetworks/1.2/utils/src/Conversions.cpp +++ b/neuralnetworks/1.2/utils/src/Conversions.cpp @@ -212,9 +212,9 @@ GeneralResult unvalidatedConvert(const hal::V1_2::Model& model) { }; } -GeneralResult unvalidatedConvert( +GeneralResult unvalidatedConvert( const hal::V1_2::Model::ExtensionNameAndPrefix& extensionNameAndPrefix) { - return Model::ExtensionNameAndPrefix{ + return ExtensionNameAndPrefix{ .name = extensionNameAndPrefix.name, .prefix = extensionNameAndPrefix.prefix, }; @@ -495,7 +495,7 @@ nn::GeneralResult unvalidatedConvert(const nn::Model& model) { } nn::GeneralResult unvalidatedConvert( - const nn::Model::ExtensionNameAndPrefix& extensionNameAndPrefix) { + const nn::ExtensionNameAndPrefix& extensionNameAndPrefix) { return Model::ExtensionNameAndPrefix{ .name = extensionNameAndPrefix.name, .prefix = extensionNameAndPrefix.prefix, diff --git a/neuralnetworks/1.2/utils/src/Device.cpp b/neuralnetworks/1.2/utils/src/Device.cpp index e7acecdf7a..3a58d2c7cc 100644 --- a/neuralnetworks/1.2/utils/src/Device.cpp +++ b/neuralnetworks/1.2/utils/src/Device.cpp @@ -236,7 +236,9 @@ nn::GeneralResult> Device::getSupportedOperations(const nn::Mo nn::GeneralResult Device::prepareModel( const nn::Model& model, nn::ExecutionPreference preference, nn::Priority /*priority*/, nn::OptionalTimePoint /*deadline*/, const std::vector& modelCache, - const std::vector& dataCache, const nn::CacheToken& token) const { + const std::vector& dataCache, const nn::CacheToken& token, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { // Ensure that model is ready for IPC. std::optional maybeModelInShared; const nn::Model& modelInShared = diff --git a/neuralnetworks/1.2/utils/src/PreparedModel.cpp b/neuralnetworks/1.2/utils/src/PreparedModel.cpp index 6df3df332a..feb3951a4a 100644 --- a/neuralnetworks/1.2/utils/src/PreparedModel.cpp +++ b/neuralnetworks/1.2/utils/src/PreparedModel.cpp @@ -91,7 +91,9 @@ PreparedModel::executeAsynchronously(const V1_0::Request& request, MeasureTiming nn::ExecutionResult, nn::Timing>> PreparedModel::execute( const nn::Request& request, nn::MeasureTiming measure, const nn::OptionalTimePoint& /*deadline*/, - const nn::OptionalDuration& /*loopTimeoutDuration*/) const { + const nn::OptionalDuration& /*loopTimeoutDuration*/, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { // Ensure that request is ready for IPC. std::optional maybeRequestInShared; hal::utils::RequestRelocation relocation; @@ -123,19 +125,22 @@ PreparedModel::executeInternal(const V1_0::Request& request, MeasureTiming measu } nn::GeneralResult> -PreparedModel::executeFenced(const nn::Request& /*request*/, - const std::vector& /*waitFor*/, - nn::MeasureTiming /*measure*/, - const nn::OptionalTimePoint& /*deadline*/, - const nn::OptionalDuration& /*loopTimeoutDuration*/, - const nn::OptionalDuration& /*timeoutDurationAfterFence*/) const { +PreparedModel::executeFenced( + const nn::Request& /*request*/, const std::vector& /*waitFor*/, + nn::MeasureTiming /*measure*/, const nn::OptionalTimePoint& /*deadline*/, + const nn::OptionalDuration& /*loopTimeoutDuration*/, + const nn::OptionalDuration& /*timeoutDurationAfterFence*/, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) << "IPreparedModel::executeFenced is not supported on 1.2 HAL service"; } nn::GeneralResult PreparedModel::createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& /*loopTimeoutDuration*/) const { + const nn::OptionalDuration& /*loopTimeoutDuration*/, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { // Ensure that request is ready for IPC. std::optional maybeRequestInShared; hal::utils::RequestRelocation relocation; diff --git a/neuralnetworks/1.2/utils/test/DeviceTest.cpp b/neuralnetworks/1.2/utils/test/DeviceTest.cpp index 1dc6285be5..0d8c141582 100644 --- a/neuralnetworks/1.2/utils/test/DeviceTest.cpp +++ b/neuralnetworks/1.2/utils/test/DeviceTest.cpp @@ -636,7 +636,7 @@ TEST(DeviceTest, prepareModel) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -655,7 +655,7 @@ TEST(DeviceTest, prepareModelLaunchError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -673,7 +673,7 @@ TEST(DeviceTest, prepareModelReturnError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -691,7 +691,7 @@ TEST(DeviceTest, prepareModelNullptrError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -708,7 +708,7 @@ TEST(DeviceTest, prepareModelTransportFailure) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -725,7 +725,7 @@ TEST(DeviceTest, prepareModelDeadObject) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -746,7 +746,7 @@ TEST(DeviceTest, prepareModelAsyncCrash) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); diff --git a/neuralnetworks/1.2/utils/test/PreparedModelTest.cpp b/neuralnetworks/1.2/utils/test/PreparedModelTest.cpp index 5e2ad79df5..a5ec9d36cd 100644 --- a/neuralnetworks/1.2/utils/test/PreparedModelTest.cpp +++ b/neuralnetworks/1.2/utils/test/PreparedModelTest.cpp @@ -154,7 +154,7 @@ TEST(PreparedModelTest, executeSync) { .WillOnce(Invoke(makeExecuteSynchronously(V1_0::ErrorStatus::NONE, {}, kNoTiming))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result EXPECT_TRUE(result.has_value()) @@ -172,7 +172,7 @@ TEST(PreparedModelTest, executeSyncError) { makeExecuteSynchronously(V1_0::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -189,7 +189,7 @@ TEST(PreparedModelTest, executeSyncTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -206,7 +206,7 @@ TEST(PreparedModelTest, executeSyncDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -224,7 +224,7 @@ TEST(PreparedModelTest, executeAsync) { V1_0::ErrorStatus::NONE, {}, kNoTiming))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result EXPECT_TRUE(result.has_value()) @@ -243,7 +243,7 @@ TEST(PreparedModelTest, executeAsyncLaunchError) { kNoTiming))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -261,7 +261,7 @@ TEST(PreparedModelTest, executeAsyncReturnError) { V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -278,7 +278,7 @@ TEST(PreparedModelTest, executeAsyncTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -295,7 +295,7 @@ TEST(PreparedModelTest, executeAsyncDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -314,7 +314,7 @@ TEST(PreparedModelTest, executeAsyncCrash) { EXPECT_CALL(*mockPreparedModel, execute_1_2(_, _, _)).Times(1).WillOnce(InvokeWithoutArgs(ret)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -328,7 +328,7 @@ TEST(PreparedModelTest, executeFencedNotSupported) { PreparedModel::create(mockPreparedModel, /*executeSynchronously=*/true).value(); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -347,7 +347,7 @@ TEST(PreparedModelTest, reusableExecuteSync) { Invoke(makeExecuteSynchronously(V1_0::ErrorStatus::NONE, {}, kNoTiming))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -371,7 +371,7 @@ TEST(PreparedModelTest, reusableExecuteSyncError) { makeExecuteSynchronously(V1_0::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -392,7 +392,7 @@ TEST(PreparedModelTest, reusableExecuteSyncTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -413,7 +413,7 @@ TEST(PreparedModelTest, reusableExecuteSyncDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -436,7 +436,7 @@ TEST(PreparedModelTest, reusableExecuteAsync) { V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE, {}, kNoTiming))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -461,7 +461,7 @@ TEST(PreparedModelTest, reusableExecuteAsyncLaunchError) { kNoTiming))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -483,7 +483,7 @@ TEST(PreparedModelTest, reusableExecuteAsyncReturnError) { V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -504,7 +504,7 @@ TEST(PreparedModelTest, reusableExecuteAsyncTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -525,7 +525,7 @@ TEST(PreparedModelTest, reusableExecuteAsyncDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -548,7 +548,7 @@ TEST(PreparedModelTest, reusableExecuteAsyncCrash) { EXPECT_CALL(*mockPreparedModel, execute_1_2(_, _, _)).Times(1).WillOnce(InvokeWithoutArgs(ret)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -566,7 +566,7 @@ TEST(PreparedModelTest, reusableExecuteFencedNotSupported) { PreparedModel::create(mockPreparedModel, /*executeSynchronously=*/true).value(); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); diff --git a/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Device.h b/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Device.h index c3c6fc4eb8..cf5e5ea018 100644 --- a/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Device.h +++ b/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/Device.h @@ -66,8 +66,9 @@ class Device final : public nn::IDevice { nn::GeneralResult prepareModel( const nn::Model& model, nn::ExecutionPreference preference, nn::Priority priority, nn::OptionalTimePoint deadline, const std::vector& modelCache, - const std::vector& dataCache, - const nn::CacheToken& token) const override; + const std::vector& dataCache, const nn::CacheToken& token, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult prepareModelFromCache( nn::OptionalTimePoint deadline, const std::vector& modelCache, diff --git a/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/PreparedModel.h b/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/PreparedModel.h index 480438d9f2..124cc43938 100644 --- a/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/PreparedModel.h +++ b/neuralnetworks/1.3/utils/include/nnapi/hal/1.3/PreparedModel.h @@ -48,18 +48,23 @@ class PreparedModel final : public nn::IPreparedModel, nn::ExecutionResult, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult> executeFenced( const nn::Request& request, const std::vector& waitFor, nn::MeasureTiming measure, const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, - const nn::OptionalDuration& timeoutDurationAfterFence) const override; + const nn::OptionalDuration& timeoutDurationAfterFence, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult configureExecutionBurst() const override; diff --git a/neuralnetworks/1.3/utils/src/Conversions.cpp b/neuralnetworks/1.3/utils/src/Conversions.cpp index a1d414c700..09e9d80d38 100644 --- a/neuralnetworks/1.3/utils/src/Conversions.cpp +++ b/neuralnetworks/1.3/utils/src/Conversions.cpp @@ -396,7 +396,7 @@ nn::GeneralResult unvalidatedConvert( } nn::GeneralResult unvalidatedConvert( - const nn::Model::ExtensionNameAndPrefix& extensionNameAndPrefix) { + const nn::ExtensionNameAndPrefix& extensionNameAndPrefix) { return V1_2::utils::unvalidatedConvert(extensionNameAndPrefix); } diff --git a/neuralnetworks/1.3/utils/src/Device.cpp b/neuralnetworks/1.3/utils/src/Device.cpp index 9517fda877..824cec61c8 100644 --- a/neuralnetworks/1.3/utils/src/Device.cpp +++ b/neuralnetworks/1.3/utils/src/Device.cpp @@ -187,7 +187,9 @@ nn::GeneralResult> Device::getSupportedOperations(const nn::Mo nn::GeneralResult Device::prepareModel( const nn::Model& model, nn::ExecutionPreference preference, nn::Priority priority, nn::OptionalTimePoint deadline, const std::vector& modelCache, - const std::vector& dataCache, const nn::CacheToken& token) const { + const std::vector& dataCache, const nn::CacheToken& token, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { // Ensure that model is ready for IPC. std::optional maybeModelInShared; const nn::Model& modelInShared = diff --git a/neuralnetworks/1.3/utils/src/PreparedModel.cpp b/neuralnetworks/1.3/utils/src/PreparedModel.cpp index ce977e55ed..b92f877a51 100644 --- a/neuralnetworks/1.3/utils/src/PreparedModel.cpp +++ b/neuralnetworks/1.3/utils/src/PreparedModel.cpp @@ -135,8 +135,9 @@ PreparedModel::executeAsynchronously(const Request& request, V1_2::MeasureTiming nn::ExecutionResult, nn::Timing>> PreparedModel::execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const { + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { // Ensure that request is ready for IPC. std::optional maybeRequestInShared; hal::utils::RequestRelocation relocation; @@ -174,10 +175,13 @@ PreparedModel::executeInternal(const Request& request, V1_2::MeasureTiming measu } nn::GeneralResult> -PreparedModel::executeFenced(const nn::Request& request, const std::vector& waitFor, - nn::MeasureTiming measure, const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration, - const nn::OptionalDuration& timeoutDurationAfterFence) const { +PreparedModel::executeFenced( + const nn::Request& request, const std::vector& waitFor, + nn::MeasureTiming measure, const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration, + const nn::OptionalDuration& timeoutDurationAfterFence, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { // Ensure that request is ready for IPC. std::optional maybeRequestInShared; hal::utils::RequestRelocation relocation; @@ -230,7 +234,9 @@ PreparedModel::executeFencedInternal(const Request& request, const hidl_vec PreparedModel::createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const { + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { // Ensure that request is ready for IPC. std::optional maybeRequestInShared; hal::utils::RequestRelocation relocation; diff --git a/neuralnetworks/1.3/utils/test/DeviceTest.cpp b/neuralnetworks/1.3/utils/test/DeviceTest.cpp index 7eba4bc935..6f488376a5 100644 --- a/neuralnetworks/1.3/utils/test/DeviceTest.cpp +++ b/neuralnetworks/1.3/utils/test/DeviceTest.cpp @@ -658,7 +658,7 @@ TEST(DeviceTest, prepareModel) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -677,7 +677,7 @@ TEST(DeviceTest, prepareModelLaunchError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -695,7 +695,7 @@ TEST(DeviceTest, prepareModelReturnError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -713,7 +713,7 @@ TEST(DeviceTest, prepareModelNullptrError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -730,7 +730,7 @@ TEST(DeviceTest, prepareModelTransportFailure) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -747,7 +747,7 @@ TEST(DeviceTest, prepareModelDeadObject) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -768,7 +768,7 @@ TEST(DeviceTest, prepareModelAsyncCrash) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); diff --git a/neuralnetworks/1.3/utils/test/PreparedModelTest.cpp b/neuralnetworks/1.3/utils/test/PreparedModelTest.cpp index 6dbbd6bd7e..51b5d29eac 100644 --- a/neuralnetworks/1.3/utils/test/PreparedModelTest.cpp +++ b/neuralnetworks/1.3/utils/test/PreparedModelTest.cpp @@ -182,7 +182,7 @@ TEST(PreparedModelTest, executeSync) { .WillOnce(Invoke(makeExecuteSynchronously(V1_3::ErrorStatus::NONE, {}, kNoTiming))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result EXPECT_TRUE(result.has_value()) @@ -200,7 +200,7 @@ TEST(PreparedModelTest, executeSyncError) { makeExecuteSynchronously(V1_3::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -217,7 +217,7 @@ TEST(PreparedModelTest, executeSyncTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -234,7 +234,7 @@ TEST(PreparedModelTest, executeSyncDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -252,7 +252,7 @@ TEST(PreparedModelTest, executeAsync) { V1_3::ErrorStatus::NONE, {}, kNoTiming))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result EXPECT_TRUE(result.has_value()) @@ -271,7 +271,7 @@ TEST(PreparedModelTest, executeAsyncLaunchError) { kNoTiming))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -289,7 +289,7 @@ TEST(PreparedModelTest, executeAsyncReturnError) { V1_3::ErrorStatus::NONE, V1_3::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -306,7 +306,7 @@ TEST(PreparedModelTest, executeAsyncTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -323,7 +323,7 @@ TEST(PreparedModelTest, executeAsyncDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -344,7 +344,7 @@ TEST(PreparedModelTest, executeAsyncCrash) { .WillOnce(InvokeWithoutArgs(ret)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -366,7 +366,7 @@ TEST(PreparedModelTest, executeFenced) { .WillOnce(Invoke(makeExecuteFencedReturn(V1_3::ErrorStatus::NONE, {}, mockCallback))); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -396,7 +396,7 @@ TEST(PreparedModelTest, executeFencedCallbackError) { .WillOnce(Invoke(makeExecuteFencedReturn(V1_3::ErrorStatus::NONE, {}, mockCallback))); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -422,7 +422,7 @@ TEST(PreparedModelTest, executeFencedError) { makeExecuteFencedReturn(V1_3::ErrorStatus::GENERAL_FAILURE, {}, nullptr))); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -439,7 +439,7 @@ TEST(PreparedModelTest, executeFencedTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -456,7 +456,7 @@ TEST(PreparedModelTest, executeFencedDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -475,7 +475,7 @@ TEST(PreparedModelTest, reusableExecuteSync) { Invoke(makeExecuteSynchronously(V1_3::ErrorStatus::NONE, {}, kNoTiming))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -499,7 +499,7 @@ TEST(PreparedModelTest, reusableExecuteSyncError) { makeExecuteSynchronously(V1_3::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -520,7 +520,7 @@ TEST(PreparedModelTest, reusableExecuteSyncTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -541,7 +541,7 @@ TEST(PreparedModelTest, reusableExecuteSyncDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -564,7 +564,7 @@ TEST(PreparedModelTest, reusableExecuteAsync) { V1_3::ErrorStatus::NONE, V1_3::ErrorStatus::NONE, {}, kNoTiming))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -589,7 +589,7 @@ TEST(PreparedModelTest, reusableExecuteAsyncLaunchError) { kNoTiming))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -611,7 +611,7 @@ TEST(PreparedModelTest, reusableExecuteAsyncReturnError) { V1_3::ErrorStatus::NONE, V1_3::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -628,7 +628,7 @@ TEST(PreparedModelTest, reusableExecuteAsyncTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -649,7 +649,7 @@ TEST(PreparedModelTest, reusableExecuteAsyncDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -674,7 +674,7 @@ TEST(PreparedModelTest, reusableExecuteAsyncCrash) { .WillOnce(InvokeWithoutArgs(ret)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -702,7 +702,7 @@ TEST(PreparedModelTest, reusableExecuteFenced) { Invoke(makeExecuteFencedReturn(V1_3::ErrorStatus::NONE, {}, mockCallback))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -738,7 +738,7 @@ TEST(PreparedModelTest, reusableExecuteFencedCallbackError) { .WillOnce(Invoke(makeExecuteFencedReturn(V1_3::ErrorStatus::NONE, {}, mockCallback))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -768,7 +768,7 @@ TEST(PreparedModelTest, reusableExecuteFencedError) { makeExecuteFencedReturn(V1_3::ErrorStatus::GENERAL_FAILURE, {}, nullptr))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -789,7 +789,7 @@ TEST(PreparedModelTest, reusableExecuteFencedTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -810,7 +810,7 @@ TEST(PreparedModelTest, reusableExecuteFencedDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionConfig.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionConfig.aidl new file mode 100644 index 0000000000..cb85743a01 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/ExecutionConfig.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 -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.neuralnetworks; +@VintfStability +parcelable ExecutionConfig { + boolean measureTiming; + long loopTimeoutDurationNs; + android.hardware.neuralnetworks.TokenValuePair[] executionHints; + android.hardware.neuralnetworks.ExtensionNameAndPrefix[] extensionNameToPrefix; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBurst.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBurst.aidl index eb3d0b004a..461fdfa2c6 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBurst.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IBurst.aidl @@ -36,4 +36,5 @@ package android.hardware.neuralnetworks; interface IBurst { android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in android.hardware.neuralnetworks.Request request, in long[] memoryIdentifierTokens, in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs); void releaseMemoryResource(in long memoryIdentifierToken); + android.hardware.neuralnetworks.ExecutionResult executeSynchronouslyWithConfig(in android.hardware.neuralnetworks.Request request, in long[] memoryIdentifierTokens, in android.hardware.neuralnetworks.ExecutionConfig config, in long deadlineNs); } diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IDevice.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IDevice.aidl index c9c67f2fcd..c0fba47d0e 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IDevice.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IDevice.aidl @@ -43,6 +43,7 @@ interface IDevice { String getVersionString(); void prepareModel(in android.hardware.neuralnetworks.Model model, in android.hardware.neuralnetworks.ExecutionPreference preference, in android.hardware.neuralnetworks.Priority priority, in long deadlineNs, in ParcelFileDescriptor[] modelCache, in ParcelFileDescriptor[] dataCache, in byte[] token, in android.hardware.neuralnetworks.IPreparedModelCallback callback); void prepareModelFromCache(in long deadlineNs, in ParcelFileDescriptor[] modelCache, in ParcelFileDescriptor[] dataCache, in byte[] token, in android.hardware.neuralnetworks.IPreparedModelCallback callback); + void prepareModelWithConfig(in android.hardware.neuralnetworks.Model model, in android.hardware.neuralnetworks.PrepareModelConfig config, in android.hardware.neuralnetworks.IPreparedModelCallback callback); const int BYTE_SIZE_OF_CACHE_TOKEN = 32; const int MAX_NUMBER_OF_CACHE_FILES = 32; const int EXTENSION_TYPE_HIGH_BITS_PREFIX = 15; diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl index f89956719e..fb0c372267 100644 --- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/IPreparedModel.aidl @@ -37,7 +37,9 @@ interface IPreparedModel { android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in android.hardware.neuralnetworks.Request request, in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs); android.hardware.neuralnetworks.FencedExecutionResult executeFenced(in android.hardware.neuralnetworks.Request request, in ParcelFileDescriptor[] waitFor, in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs, in long durationNs); android.hardware.neuralnetworks.IBurst configureExecutionBurst(); - android.hardware.neuralnetworks.IExecution createReusableExecution(in android.hardware.neuralnetworks.Request request, in boolean measureTiming, in long loopTimeoutDurationNs); + android.hardware.neuralnetworks.IExecution createReusableExecution(in android.hardware.neuralnetworks.Request request, in android.hardware.neuralnetworks.ExecutionConfig config); + android.hardware.neuralnetworks.ExecutionResult executeSynchronouslyWithConfig(in android.hardware.neuralnetworks.Request request, in android.hardware.neuralnetworks.ExecutionConfig config, in long deadlineNs); + android.hardware.neuralnetworks.FencedExecutionResult executeFencedWithConfig(in android.hardware.neuralnetworks.Request request, in ParcelFileDescriptor[] waitFor, in android.hardware.neuralnetworks.ExecutionConfig config, in long deadlineNs, in long durationNs); const long DEFAULT_LOOP_TIMEOUT_DURATION_NS = 2000000000; const long MAXIMUM_LOOP_TIMEOUT_DURATION_NS = 15000000000; } diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PrepareModelConfig.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PrepareModelConfig.aidl new file mode 100644 index 0000000000..85c924fe31 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PrepareModelConfig.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 -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.neuralnetworks; +@VintfStability +parcelable PrepareModelConfig { + android.hardware.neuralnetworks.ExecutionPreference preference; + android.hardware.neuralnetworks.Priority priority; + long deadlineNs; + ParcelFileDescriptor[] modelCache; + ParcelFileDescriptor[] dataCache; + byte[] cacheToken; + android.hardware.neuralnetworks.TokenValuePair[] compilationHints; + android.hardware.neuralnetworks.ExtensionNameAndPrefix[] extensionNameToPrefix; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/TokenValuePair.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/TokenValuePair.aidl new file mode 100644 index 0000000000..e477d6e555 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/TokenValuePair.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 -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.neuralnetworks; +@VintfStability +parcelable TokenValuePair { + int token; + byte[] value; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/ExecutionConfig.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/ExecutionConfig.aidl new file mode 100644 index 0000000000..00f1e11740 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/ExecutionConfig.aidl @@ -0,0 +1,60 @@ +/* + * 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. + */ + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.ExtensionNameAndPrefix; +import android.hardware.neuralnetworks.TokenValuePair; + +/** + * A type that is used to represent all configuration related to + * an Execution. + */ +@VintfStability +parcelable ExecutionConfig { + /** + * Specifies whether or not to measure duration of the execution. + * For {@link IPreparedModel::executeSynchronouslyWithConfig}, the duration runs from the time + * the driver sees the corresponding call to the execute function to the time the driver returns + * from the function. For {@link IPreparedModel::executeFencedWithConfig}, please refer to + * {@link IPreparedModelCallback} for details. + */ + boolean measureTiming; + /** + * The maximum amount of time in nanoseconds that should be spent + * executing a {@link OperationType::WHILE} operation. If a loop + * condition model does not output false within this duration, + * the execution must be aborted. If -1 is provided, the maximum + * amount of time is {@link DEFAULT_LOOP_TIMEOUT_DURATION_NS}. + * Other negative values are invalid. When provided, the duration + * must not exceed {@link MAXIMUM_LOOP_TIMEOUT_DURATION_NS}. + */ + long loopTimeoutDurationNs; + /** + * A vector of token / value pairs represent vendor specific + * execution hints or metadata. The provided TokenValuePairs must not + * contain the same token twice. The driver must validate the + * data and ignore invalid hints. It is up to the driver to + * decide whether to respect the provided hints or not. + */ + TokenValuePair[] executionHints; + /** + * The mapping between extension names and prefixes of token values. + * The driver must ignore the corresponding execution hint, if + * the extension is not supported. + */ + ExtensionNameAndPrefix[] extensionNameToPrefix; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/Extension.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/Extension.aidl index 20109bd584..9f70a53608 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/Extension.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/Extension.aidl @@ -20,6 +20,10 @@ import android.hardware.neuralnetworks.ExtensionOperandTypeInformation; /** * Information about an extension. + * + * The extension can provide zero or more operation types (which are not enumerated), zero or more + * operand types (which are enumerated in {@link Extension::operandTypes}, and compilation and + * execution hints (which are not enumerated). */ @VintfStability parcelable Extension { diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl index 29be93f549..6c296e0f64 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl @@ -17,7 +17,8 @@ package android.hardware.neuralnetworks; /** - * The mapping between extension names and prefixes of operand and operation type values. + * The mapping between extension names and prefixes of values like operand and operation type, and + * token in {@link TokenValuePair}. * * An operand or operation whose numeric type value is above {@link IDevice::OPERAND_TYPE_BASE_MAX} * or {@link IDevice::OPERATION_TYPE_BASE_MAX} respectively should be interpreted as an extension diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IBurst.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IBurst.aidl index b089c499c6..a05a7fb9c7 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/IBurst.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IBurst.aidl @@ -17,6 +17,7 @@ package android.hardware.neuralnetworks; import android.hardware.neuralnetworks.ErrorStatus; +import android.hardware.neuralnetworks.ExecutionConfig; import android.hardware.neuralnetworks.ExecutionResult; import android.hardware.neuralnetworks.Request; @@ -68,6 +69,8 @@ interface IBurst { * * Only a single execution on a given burst object may be active at any time. * + * Also see {@link IBurst::executeSynchronouslyWithConfig}. + * * @param request The input and output information on which the prepared model is to be * executed. * @param memoryIdentifierTokens A list of tokens where each token is a non-negative number @@ -117,4 +120,13 @@ interface IBurst { * - INVALID_ARGUMENT if one of the input arguments is invalid */ void releaseMemoryResource(in long memoryIdentifierToken); + + /** + * For detailed specification, please refer to {@link IBurst::executeSynchronously}. The + * difference between the two methods is that executeSynchronouslyWithConfig takes {@link + * ExecutionConfig} instead of a list of configuration parameters, and ExecutionConfig contains + * more configuration parameters than are passed to executeSynchronously. + */ + ExecutionResult executeSynchronouslyWithConfig(in Request request, + in long[] memoryIdentifierTokens, in ExecutionConfig config, in long deadlineNs); } diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl index 72e26237f8..821b9febfe 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl @@ -28,6 +28,7 @@ import android.hardware.neuralnetworks.IPreparedModelCallback; import android.hardware.neuralnetworks.IPreparedModelParcel; import android.hardware.neuralnetworks.Model; import android.hardware.neuralnetworks.NumberOfCacheFiles; +import android.hardware.neuralnetworks.PrepareModelConfig; import android.hardware.neuralnetworks.Priority; /** @@ -148,7 +149,7 @@ interface IDevice { * * If the device reports that caching is not supported, the user may avoid calling * IDevice::prepareModelFromCache or providing cache file descriptors to - * IDevice::prepareModel. + * IDevice::prepareModel or IDevice::prepareModelWithConfig. * * @return NumberOfCacheFiles structure indicating how many files for model and data cache the * driver needs to cache a single prepared model. It must be less than or equal to @@ -302,6 +303,8 @@ interface IDevice { * * Multiple threads may call prepareModel on the same model concurrently. * + * Also see {@link IDevice::prepareModelWithConfig}. + * * @param model The model to be prepared for execution. * @param preference Indicates the intended execution behavior of a prepared model. * @param priority The priority of the prepared model relative to other prepared models owned by @@ -403,17 +406,17 @@ interface IDevice { * @param modelCache A vector of file descriptors for the security-sensitive cache. The length * of the vector must match the numModelCache returned from * getNumberOfCacheFilesNeeded. The cache file descriptors will be provided in - * the same order as with prepareModel. + * the same order as with prepareModel or prepareModelWithConfig. * @param dataCache A vector of file descriptors for the constants' cache. The length of the * vector must match the numDataCache returned from * getNumberOfCacheFilesNeeded. The cache file descriptors will be provided in - * the same order as with prepareModel. + * the same order as with prepareModel or prepareModelWithConfig. * @param token A caching token of length BYTE_SIZE_OF_CACHE_TOKEN identifying the prepared * model. It is the same token provided when saving the cache files with - * prepareModel. Tokens should be chosen to have a low rate of collision for a - * particular application. The driver cannot detect a collision; a collision will - * result in a failed execution or in a successful execution that produces - * incorrect output values. + * prepareModel or prepareModelWithConfig. Tokens should be chosen to have a low + * rate of collision for a particular application. The driver cannot detect a + * collision; a collision will result in a failed execution or in a successful + * execution that produces incorrect output values. * @param callback A callback object used to return the error status of preparing the model for * execution and the prepared model if successful, nullptr otherwise. The * callback object's notify function must be called exactly once, even if the @@ -429,4 +432,28 @@ interface IDevice { void prepareModelFromCache(in long deadlineNs, in ParcelFileDescriptor[] modelCache, in ParcelFileDescriptor[] dataCache, in byte[] token, in IPreparedModelCallback callback); + + /** + * For detailed specification, please refer to {@link IDevice::prepareModel}. The only + * difference between the two methods is that prepareModelWithConfig takes {@link + * PrepareModelConfig} instead of standalone configuration parameters, which allows vendor + * specific compilation metadata to be passed. + * + * @param model The model to be prepared for execution. + * @param config Configuration parameters to prepare the model. + * @param callback A callback object used to return the error status of preparing the model for + * execution and the prepared model if successful, nullptr otherwise. The + * callback object's notify function must be called exactly once, even if the + * model could not be prepared. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - INVALID_ARGUMENT if one of the input arguments related to preparing the model is + * invalid + * - MISSED_DEADLINE_* if the preparation is aborted because the model cannot be prepared by + * the deadline + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + */ + void prepareModelWithConfig( + in Model model, in PrepareModelConfig config, in IPreparedModelCallback callback); } diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl index 79053e527f..949804ea59 100644 --- a/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl @@ -18,6 +18,7 @@ package android.hardware.neuralnetworks; import android.hardware.common.NativeHandle; import android.hardware.neuralnetworks.ErrorStatus; +import android.hardware.neuralnetworks.ExecutionConfig; import android.hardware.neuralnetworks.ExecutionResult; import android.hardware.neuralnetworks.FencedExecutionResult; import android.hardware.neuralnetworks.IBurst; @@ -68,6 +69,8 @@ interface IPreparedModel { * Any number of calls to the execute* functions, in any combination, may be made concurrently, * even on the same IPreparedModel object. * + * Also see {@link IPreparedModel::executeSynchronouslyWithConfig}. + * * @param request The input and output information on which the prepared model is to be * executed. * @param measure Specifies whether or not to measure duration of the execution. The duration @@ -134,6 +137,8 @@ interface IPreparedModel { * Any number of calls to the execute* functions, in any combination, may be made concurrently, * even on the same IPreparedModel object. * + * Also see {@link IPreparedModel::executeFencedWithConfig}. + * * @param request The input and output information on which the prepared model is to be * executed. The outputs in the request must have fully specified dimensions. * @param waitFor A vector of sync fence file descriptors. Execution must not start until all @@ -201,15 +206,7 @@ interface IPreparedModel { * * @param request The input and output information on which the prepared model is to be * executed. - * @param measure Specifies whether or not to measure duration of the execution. - * @param loopTimeoutDurationNs The maximum amount of time in nanoseconds that should be spent - * executing a {@link OperationType::WHILE} operation. If a loop - * condition model does not output false within this duration, the - * computation performed on the returned reusable execution object - * must be aborted. If -1 is provided, the maximum amount - * of time is {@link DEFAULT_LOOP_TIMEOUT_DURATION_NS}. Other - * negative values are invalid. When provided, the duration must - * not exceed {@link MAXIMUM_LOOP_TIMEOUT_DURATION_NS}. + * @param config Specifies the execution configuration parameters. * @return execution An IExecution object representing a reusable execution that has been * specialized for a fixed request. * @throws ServiceSpecificException with one of the following ErrorStatus values: @@ -218,6 +215,64 @@ interface IPreparedModel { * - INVALID_ARGUMENT if one of the input arguments is invalid * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver */ - IExecution createReusableExecution( - in Request request, in boolean measureTiming, in long loopTimeoutDurationNs); + IExecution createReusableExecution(in Request request, in ExecutionConfig config); + + /** + * For detailed specification, please refer to {@link IPreparedModel::executeSynchronously}. The + * difference between the two methods is that executeSynchronouslyWithConfig takes {@link + * ExecutionConfig} instead of a list of configuration parameters, and ExecutionConfig contains + * more configuration parameters than are passed to executeSynchronously. + * + * @param request The input and output information on which the prepared model is to be + * executed. + * @param config Specifies the execution configuration parameters. + * @param deadlineNs The time by which the execution is expected to complete. The time is + * measured in nanoseconds since boot (as from clock_gettime(CLOCK_BOOTTIME, + * &ts) or ::android::base::boot_clock). If the execution cannot be finished + * by the deadline, the execution may be aborted. Passing -1 means the + * deadline is omitted. Other negative valueggs are invalid. + * @return ExecutionResult parcelable, containing the status of the execution, output shapes and + * timing information. + * - MISSED_DEADLINE_* if the execution is aborted because it cannot be completed by the + * deadline + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + */ + ExecutionResult executeSynchronouslyWithConfig( + in Request request, in ExecutionConfig config, in long deadlineNs); + + /** + * For detailed specification, please refer to {@link IPreparedModel::executeFenced}. The + * difference between the two methods is that executeFencedWithConfig takes {@link + * ExecutionConfig} instead of a list of configuration parameters, and ExecutionConfig contains + * more configuration parameters than are passed to executeFenced. + * + * @param request The input and output information on which the prepared model is to be + * executed. The outputs in the request must have fully specified dimensions. + * @param waitFor A vector of sync fence file descriptors. Execution must not start until all + * sync fences have been signaled. + * @param config Specifies the execution configuration parameters. + * @param deadlineNs The time by which the execution is expected to complete. The time is + * measured in nanoseconds since boot (as from clock_gettime(CLOCK_BOOTTIME, + * &ts) or ::android::base::boot_clock). If the execution cannot be finished + * by the deadline, the execution may be aborted. Passing -1 means the + * deadline is omitted. Other negative values are invalid. + * @param durationNs The length of time in nanoseconds within which the execution is expected to + * complete after all sync fences in waitFor are signaled. If the execution + * cannot be finished within the duration, the execution may be aborted. + * Passing -1 means the duration is omitted. Other negative values are + * invalid. + * @return The FencedExecutionResult parcelable, containing IFencedExecutionCallback and the + * sync fence. + * @throws ServiceSpecificException with one of the following ErrorStatus values: + * - DEVICE_UNAVAILABLE if driver is offline or busy + * - GENERAL_FAILURE if there is an unspecified error + * - INVALID_ARGUMENT if one of the input arguments is invalid, including fences in error + * states. + * - MISSED_DEADLINE_* if the execution is aborted because it cannot be completed by the + * deadline + * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver + */ + FencedExecutionResult executeFencedWithConfig(in Request request, + in ParcelFileDescriptor[] waitFor, in ExecutionConfig config, in long deadlineNs, + in long durationNs); } diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/PrepareModelConfig.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/PrepareModelConfig.aidl new file mode 100644 index 0000000000..96df968464 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/PrepareModelConfig.aidl @@ -0,0 +1,95 @@ +/* + * 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. + */ + +package android.hardware.neuralnetworks; + +import android.hardware.neuralnetworks.ExecutionPreference; +import android.hardware.neuralnetworks.ExtensionNameAndPrefix; +import android.hardware.neuralnetworks.Priority; +import android.hardware.neuralnetworks.TokenValuePair; + +/** + * A type that is used to represent all configuration needed to + * prepare a model. + */ +@VintfStability +parcelable PrepareModelConfig { + /** + * Indicates the intended execution behavior of a prepared model. + */ + ExecutionPreference preference; + /** + * The priority of the prepared model relative to other prepared + * models owned by the client. + */ + Priority priority; + /** + * The time by which the model is expected to be prepared. The + * time is measured in nanoseconds since boot (as from + * clock_gettime(CLOCK_BOOTTIME, &ts) or + * ::android::base::boot_clock). If the model cannot be prepared + * by the deadline, the preparation may be aborted. Passing -1 + * means the deadline is omitted. Other negative values are + * invalid. + */ + long deadlineNs; + /** + * A vector of file descriptors for the security-sensitive cache. + * The length of the vector must either be 0 indicating that + * caching information is not provided, or match the + * numModelCache returned from IDevice::getNumberOfCacheFilesNeeded. The + * cache file descriptors will be provided in the same order when + * retrieving the preparedModel from cache files with + * IDevice::prepareModelFromCache. + */ + ParcelFileDescriptor[] modelCache; + /** + * A vector of file descriptors for the constants' cache. The + * length of the vector must either be 0 indicating that caching + * information is not provided, or match the numDataCache + * returned from IDevice::getNumberOfCacheFilesNeeded. The cache file + * descriptors will be provided in the same order when retrieving + * the preparedModel from cache files with IDevice::prepareModelFromCache. + */ + ParcelFileDescriptor[] dataCache; + /** + * A caching token of length IDevice::BYTE_SIZE_OF_CACHE_TOKEN identifying + * the prepared model. The same token will be provided when + * retrieving the prepared model from the cache files with + * IDevice::prepareModelFromCache. Tokens should be chosen to have a low + * rate of collision for a particular application. The driver + * cannot detect a collision; a collision will result in a failed + * execution or in a successful execution that produces incorrect + * output values. If both modelCache and dataCache are empty + * indicating that caching information is not provided, this + * token must be ignored. + */ + byte[] cacheToken; + /** + * A vector of token / value pairs represent vendor specific + * compilation hints or metadata. The provided TokenValuePairs must not + * contain the same token twice. The driver must validate the + * data and ignore invalid hints. It is up to the driver to + * decide whether to respect the provided hints or not. + */ + TokenValuePair[] compilationHints; + /** + * The mapping between extension names and prefixes of token values. + * The driver must ignore the corresponding compilation hint, if + * the extension is not supported. + */ + ExtensionNameAndPrefix[] extensionNameToPrefix; +} diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/TokenValuePair.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/TokenValuePair.aidl new file mode 100644 index 0000000000..ec665b4611 --- /dev/null +++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/TokenValuePair.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. + */ + +package android.hardware.neuralnetworks; + +/** + * A type that is used to represent a token / byte array data pair. + */ +@VintfStability +parcelable TokenValuePair { + /** + * A 32bit integer token. The token is created by combining the + * extension prefix and enum defined within the extension. + * The low {@link IDevice::EXTENSION_TYPE_LOW_BITS_TYPE} bits of the value + * correspond to the hint within the extension and the high + * {@link IDevice::EXTENSION_TYPE_HIGH_BITS_PREFIX} bits encode the "prefix", which maps + * uniquely to the extension name. The sign bit is always 0. + * + * For example, if a token value is 0x7AAA000B and the corresponding + * {@link ExtensionNameAndPrefix} contains an entry with prefix=0x7AAA and + * name="vendor.test.test_extension", then the token should be interpreted as the hint + * 0x000B of the extension named vendor.test.test_extension. + */ + int token; + /** + * A byte array containing the raw data. + */ + byte[] value; +} diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Burst.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Burst.h index 0cc78d4f5e..f2e6e75818 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Burst.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Burst.h @@ -86,10 +86,12 @@ class Burst final : public nn::IBurst, public std::enable_shared_from_this> create( - std::shared_ptr burst); + std::shared_ptr burst, nn::Version featureLevel); - Burst(PrivateConstructorTag tag, std::shared_ptr burst); + Burst(PrivateConstructorTag tag, std::shared_ptr burst, + nn::Version featureLevel); // See IBurst::cacheMemory for information. OptionalCacheHold cacheMemory(const nn::SharedMemory& memory) const override; @@ -97,23 +99,29 @@ class Burst final : public nn::IBurst, public std::enable_shared_from_this, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; // See IBurst::createReusableExecution for information. nn::GeneralResult createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::ExecutionResult, nn::Timing>> executeInternal( const aidl_hal::Request& request, const std::vector& memoryIdentifierTokens, bool measure, int64_t deadline, int64_t loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix, const hal::utils::RequestRelocation& relocation) const; private: mutable std::atomic_flag mExecutionInFlight = ATOMIC_FLAG_INIT; const std::shared_ptr kBurst; const std::shared_ptr kMemoryCache; + const nn::Version kFeatureLevel; }; } // namespace aidl::android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h index 477b311598..af587150b1 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h @@ -46,6 +46,10 @@ #include #include +#ifdef NN_AIDL_V4_OR_ABOVE +#include +#endif // NN_AIDL_V4_OR_ABOVE + #include #include #include @@ -74,7 +78,7 @@ GeneralResult unvalidatedConvert( const aidl_hal::SymmPerChannelQuantParams& symmPerChannelQuantParams); GeneralResult unvalidatedConvert(const aidl_hal::Operation& operation); GeneralResult unvalidatedConvert(const aidl_hal::Model& model); -GeneralResult unvalidatedConvert( +GeneralResult unvalidatedConvert( const aidl_hal::ExtensionNameAndPrefix& extensionNameAndPrefix); GeneralResult unvalidatedConvert(const std::vector& operandValues); GeneralResult unvalidatedConvert(const aidl_hal::Subgraph& subgraph); @@ -97,6 +101,10 @@ GeneralResult unvalidatedConvert( const aidl_hal::ExtensionOperandTypeInformation& operandTypeInformation); GeneralResult unvalidatedConvert(const ndk::ScopedFileDescriptor& handle); +#ifdef NN_AIDL_V4_OR_ABOVE +GeneralResult unvalidatedConvert(const aidl_hal::TokenValuePair& tokenValuePair); +#endif // NN_AIDL_V4_OR_ABOVE + GeneralResult> unvalidatedConvert( const std::vector& operations); @@ -116,6 +124,14 @@ GeneralResult convert(const aidl_hal::BufferDesc& bufferDesc); GeneralResult> convert(const std::vector& extension); GeneralResult> convert(const std::vector& memories); +GeneralResult> convert( + const std::vector& extensionNameAndPrefix); + +#ifdef NN_AIDL_V4_OR_ABOVE +GeneralResult> convert( + const std::vector& metaData); +#endif // NN_AIDL_V4_OR_ABOVE + GeneralResult> convert( const std::vector& outputShapes); GeneralResult> convert( @@ -152,7 +168,7 @@ nn::GeneralResult unvalidatedConvert(const nn::Model::Subgraph& subgra nn::GeneralResult> unvalidatedConvert( const nn::Model::OperandValues& operandValues); nn::GeneralResult unvalidatedConvert( - const nn::Model::ExtensionNameAndPrefix& extensionNameToPrefix); + const nn::ExtensionNameAndPrefix& extensionNameToPrefix); nn::GeneralResult unvalidatedConvert(const nn::Model& model); nn::GeneralResult unvalidatedConvert(const nn::Priority& priority); nn::GeneralResult unvalidatedConvert(const nn::Request& request); @@ -166,6 +182,10 @@ nn::GeneralResult unvalidatedConvert(const nn::Shared nn::GeneralResult unvalidatedConvert(const nn::Capabilities& capabilities); nn::GeneralResult unvalidatedConvert(const nn::Extension& extension); +#ifdef NN_AIDL_V4_OR_ABOVE +nn::GeneralResult unvalidatedConvert(const nn::TokenValuePair& tokenValuePair); +#endif // NN_AIDL_V4_OR_ABOVE + nn::GeneralResult> convert(const nn::CacheToken& cacheToken); nn::GeneralResult convert(const nn::BufferDesc& bufferDesc); nn::GeneralResult convert(const nn::DeviceType& deviceType); @@ -190,6 +210,13 @@ nn::GeneralResult> convert( nn::GeneralResult> convert( const std::vector& syncFences); nn::GeneralResult> convert(const std::vector& extensions); +nn::GeneralResult> convert( + const std::vector& extensionNameToPrefix); + +#ifdef NN_AIDL_V4_OR_ABOVE +nn::GeneralResult> convert( + const std::vector& metaData); +#endif // NN_AIDL_V4_OR_ABOVE nn::GeneralResult> toSigned(const std::vector& vec); diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Device.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Device.h index d558f66b6b..615c6deeba 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Device.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Device.h @@ -42,6 +42,7 @@ class Device final : public nn::IDevice { struct PrivateConstructorTag {}; public: + // featureLevel is for testing purposes. static nn::GeneralResult> create( std::string name, std::shared_ptr device, nn::Version featureLevel); @@ -67,8 +68,9 @@ class Device final : public nn::IDevice { nn::GeneralResult prepareModel( const nn::Model& model, nn::ExecutionPreference preference, nn::Priority priority, nn::OptionalTimePoint deadline, const std::vector& modelCache, - const std::vector& dataCache, - const nn::CacheToken& token) const override; + const std::vector& dataCache, const nn::CacheToken& token, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult prepareModelFromCache( nn::OptionalTimePoint deadline, const std::vector& modelCache, diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/HalInterfaces.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/HalInterfaces.h index 205d428cf4..cacdc2653f 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/HalInterfaces.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/HalInterfaces.h @@ -63,7 +63,9 @@ #ifdef NN_AIDL_V4_OR_ABOVE #include +#include #include +#include #endif // NN_AIDL_V4_OR_ABOVE namespace android::nn { diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/InvalidDevice.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/InvalidDevice.h index e66507aa17..9375c1d327 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/InvalidDevice.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/InvalidDevice.h @@ -53,6 +53,9 @@ class InvalidDevice : public BnDevice { const std::vector& dataCache, const std::vector& token, const std::shared_ptr& callback) override; + ndk::ScopedAStatus prepareModelWithConfig( + const Model& model, const PrepareModelConfig& config, + const std::shared_ptr& callback) override; ndk::ScopedAStatus prepareModelFromCache( int64_t deadline, const std::vector& modelCache, const std::vector& dataCache, diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h index 24cd681658..cb6a85b85f 100644 --- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h +++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/PreparedModel.h @@ -40,6 +40,7 @@ class PreparedModel final : public nn::IPreparedModel, struct PrivateConstructorTag {}; public: + // featureLevel is for testing purposes. static nn::GeneralResult> create( std::shared_ptr preparedModel, nn::Version featureLevel); @@ -49,18 +50,23 @@ class PreparedModel final : public nn::IPreparedModel, nn::ExecutionResult, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult> executeFenced( const nn::Request& request, const std::vector& waitFor, nn::MeasureTiming measure, const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, - const nn::OptionalDuration& timeoutDurationAfterFence) const override; + const nn::OptionalDuration& timeoutDurationAfterFence, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult configureExecutionBurst() const override; @@ -68,6 +74,8 @@ class PreparedModel final : public nn::IPreparedModel, nn::ExecutionResult, nn::Timing>> executeInternal( const Request& request, bool measure, int64_t deadline, int64_t loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix, const hal::utils::RequestRelocation& relocation) const; nn::GeneralResult> @@ -75,6 +83,8 @@ class PreparedModel final : public nn::IPreparedModel, const std::vector& waitFor, bool measure, int64_t deadline, int64_t loopTimeoutDuration, int64_t timeoutDurationAfterFence, + const std::vector& hints, + const std::vector& extensionNameToPrefix, const hal::utils::RequestRelocation& relocation) const; private: diff --git a/neuralnetworks/aidl/utils/src/Burst.cpp b/neuralnetworks/aidl/utils/src/Burst.cpp index fb00b264e3..6c7aa882e8 100644 --- a/neuralnetworks/aidl/utils/src/Burst.cpp +++ b/neuralnetworks/aidl/utils/src/Burst.cpp @@ -43,12 +43,16 @@ class BurstExecution final : public nn::IExecution, static nn::GeneralResult> create( std::shared_ptr burst, Request request, std::vector memoryIdentifierTokens, bool measure, int64_t loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix, hal::utils::RequestRelocation relocation, std::vector cacheHolds); BurstExecution(PrivateConstructorTag tag, std::shared_ptr burst, Request request, std::vector memoryIdentifierTokens, bool measure, - int64_t loopTimeoutDuration, hal::utils::RequestRelocation relocation, + int64_t loopTimeoutDuration, const std::vector& hints, + const std::vector& extensionNameToPrefix, + hal::utils::RequestRelocation relocation, std::vector cacheHolds); nn::ExecutionResult, nn::Timing>> compute( @@ -64,6 +68,8 @@ class BurstExecution final : public nn::IExecution, const std::vector kMemoryIdentifierTokens; const bool kMeasure; const int64_t kLoopTimeoutDuration; + const std::vector kHints; + const std::vector kExtensionNameToPrefix; const hal::utils::RequestRelocation kRelocation; const std::vector kCacheHolds; }; @@ -149,17 +155,20 @@ void Burst::MemoryCache::tryFreeMemory(const nn::SharedMemory& memory, int64_t i } nn::GeneralResult> Burst::create( - std::shared_ptr burst) { + std::shared_ptr burst, nn::Version featureLevel) { if (burst == nullptr) { return NN_ERROR(nn::ErrorStatus::GENERAL_FAILURE) << "aidl_hal::utils::Burst::create must have non-null burst"; } - return std::make_shared(PrivateConstructorTag{}, std::move(burst)); + return std::make_shared(PrivateConstructorTag{}, std::move(burst), featureLevel); } -Burst::Burst(PrivateConstructorTag /*tag*/, std::shared_ptr burst) - : kBurst(std::move(burst)), kMemoryCache(std::make_shared(kBurst)) { +Burst::Burst(PrivateConstructorTag /*tag*/, std::shared_ptr burst, + nn::Version featureLevel) + : kBurst(std::move(burst)), + kMemoryCache(std::make_shared(kBurst)), + kFeatureLevel(featureLevel) { CHECK(kBurst != nullptr); } @@ -170,8 +179,9 @@ Burst::OptionalCacheHold Burst::cacheMemory(const nn::SharedMemory& memory) cons nn::ExecutionResult, nn::Timing>> Burst::execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const { + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { // Ensure that request is ready for IPC. std::optional maybeRequestInShared; hal::utils::RequestRelocation relocation; @@ -200,14 +210,14 @@ nn::ExecutionResult, nn::Timing>> Burst:: memoryIdentifierTokens.push_back(-1); } CHECK_EQ(requestInShared.pools.size(), memoryIdentifierTokens.size()); - return executeInternal(aidlRequest, memoryIdentifierTokens, aidlMeasure, aidlDeadline, - aidlLoopTimeoutDuration, relocation); + aidlLoopTimeoutDuration, hints, extensionNameToPrefix, relocation); } nn::ExecutionResult, nn::Timing>> Burst::executeInternal( const Request& request, const std::vector& memoryIdentifierTokens, bool measure, - int64_t deadline, int64_t loopTimeoutDuration, + int64_t deadline, int64_t loopTimeoutDuration, const std::vector& hints, + const std::vector& extensionNameToPrefix, const hal::utils::RequestRelocation& relocation) const { // Ensure that at most one execution is in flight at any given time. const bool alreadyInFlight = mExecutionInFlight.test_and_set(); @@ -221,9 +231,21 @@ nn::ExecutionResult, nn::Timing>> Burst:: } ExecutionResult executionResult; - const auto ret = kBurst->executeSynchronously(request, memoryIdentifierTokens, measure, - deadline, loopTimeoutDuration, &executionResult); - HANDLE_ASTATUS(ret) << "execute failed"; + if (kFeatureLevel.level >= nn::Version::Level::FEATURE_LEVEL_8) { + auto aidlHints = NN_TRY(convert(hints)); + auto aidlExtensionPrefix = NN_TRY(convert(extensionNameToPrefix)); + const auto ret = kBurst->executeSynchronouslyWithConfig( + request, memoryIdentifierTokens, + {measure, loopTimeoutDuration, std::move(aidlHints), + std::move(aidlExtensionPrefix)}, + deadline, &executionResult); + HANDLE_ASTATUS(ret) << "execute failed"; + } else { + const auto ret = + kBurst->executeSynchronously(request, memoryIdentifierTokens, measure, deadline, + loopTimeoutDuration, &executionResult); + HANDLE_ASTATUS(ret) << "execute failed"; + } if (!executionResult.outputSufficientSize) { auto canonicalOutputShapes = nn::convert(executionResult.outputShapes).value_or(std::vector{}); @@ -241,7 +263,9 @@ nn::ExecutionResult, nn::Timing>> Burst:: nn::GeneralResult Burst::createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const { + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { // Ensure that request is ready for IPC. std::optional maybeRequestInShared; hal::utils::RequestRelocation relocation; @@ -272,12 +296,15 @@ nn::GeneralResult Burst::createReusableExecution( return BurstExecution::create(shared_from_this(), std::move(aidlRequest), std::move(memoryIdentifierTokens), aidlMeasure, - aidlLoopTimeoutDuration, std::move(relocation), std::move(holds)); + aidlLoopTimeoutDuration, hints, extensionNameToPrefix, + std::move(relocation), std::move(holds)); } nn::GeneralResult> BurstExecution::create( std::shared_ptr burst, Request request, std::vector memoryIdentifierTokens, bool measure, int64_t loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix, hal::utils::RequestRelocation relocation, std::vector cacheHolds) { if (burst == nullptr) { @@ -286,13 +313,15 @@ nn::GeneralResult> BurstExecution::create( return std::make_shared( PrivateConstructorTag{}, std::move(burst), std::move(request), - std::move(memoryIdentifierTokens), measure, loopTimeoutDuration, std::move(relocation), - std::move(cacheHolds)); + std::move(memoryIdentifierTokens), measure, loopTimeoutDuration, hints, + extensionNameToPrefix, std::move(relocation), std::move(cacheHolds)); } BurstExecution::BurstExecution(PrivateConstructorTag /*tag*/, std::shared_ptr burst, Request request, std::vector memoryIdentifierTokens, bool measure, int64_t loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix, hal::utils::RequestRelocation relocation, std::vector cacheHolds) : kBurst(std::move(burst)), @@ -300,6 +329,8 @@ BurstExecution::BurstExecution(PrivateConstructorTag /*tag*/, std::shared_ptr, nn::Timing>> BurstEx const nn::OptionalTimePoint& deadline) const { const auto aidlDeadline = NN_TRY(convert(deadline)); return kBurst->executeInternal(kRequest, kMemoryIdentifierTokens, kMeasure, aidlDeadline, - kLoopTimeoutDuration, kRelocation); + kLoopTimeoutDuration, kHints, kExtensionNameToPrefix, + kRelocation); } nn::GeneralResult> diff --git a/neuralnetworks/aidl/utils/src/Conversions.cpp b/neuralnetworks/aidl/utils/src/Conversions.cpp index 113d2da955..eb28db7587 100644 --- a/neuralnetworks/aidl/utils/src/Conversions.cpp +++ b/neuralnetworks/aidl/utils/src/Conversions.cpp @@ -302,9 +302,9 @@ GeneralResult unvalidatedConvert(const aidl_hal::Subgraph& subg }; } -GeneralResult unvalidatedConvert( +GeneralResult unvalidatedConvert( const aidl_hal::ExtensionNameAndPrefix& extensionNameAndPrefix) { - return Model::ExtensionNameAndPrefix{ + return ExtensionNameAndPrefix{ .name = extensionNameAndPrefix.name, .prefix = extensionNameAndPrefix.prefix, }; @@ -506,6 +506,12 @@ GeneralResult unvalidatedConvert(const ndk::ScopedFileDescriptor& return std::make_shared(std::move(duplicatedFd)); } +#ifdef NN_AIDL_V4_OR_ABOVE +GeneralResult unvalidatedConvert(const aidl_hal::TokenValuePair& tokenValuePair) { + return TokenValuePair{.token = tokenValuePair.token, .value = tokenValuePair.value}; +} +#endif // NN_AIDL_V4_OR_ABOVE + GeneralResult convert(const aidl_hal::Capabilities& capabilities) { return validatedConvert(capabilities); } @@ -562,6 +568,17 @@ GeneralResult> convert(const std::vector> convert(const std::vector& memories) { return validatedConvert(memories); } +GeneralResult> convert( + const std::vector& extensionNameAndPrefix) { + return unvalidatedConvert(extensionNameAndPrefix); +} + +#ifdef NN_AIDL_V4_OR_ABOVE +GeneralResult> convert( + const std::vector& metaData) { + return validatedConvert(metaData); +} +#endif // NN_AIDL_V4_OR_ABOVE GeneralResult> convert( const std::vector& outputShapes) { @@ -942,7 +959,7 @@ nn::GeneralResult> unvalidatedConvert( } nn::GeneralResult unvalidatedConvert( - const nn::Model::ExtensionNameAndPrefix& extensionNameToPrefix) { + const nn::ExtensionNameAndPrefix& extensionNameToPrefix) { return ExtensionNameAndPrefix{ .name = extensionNameToPrefix.name, .prefix = extensionNameToPrefix.prefix, @@ -1055,6 +1072,11 @@ nn::GeneralResult unvalidatedConvert(const nn::Extension& extension) return Extension{.name = extension.name, .operandTypes = NN_TRY(unvalidatedConvert(extension.operandTypes))}; } +#ifdef NN_AIDL_V4_OR_ABOVE +nn::GeneralResult unvalidatedConvert(const nn::TokenValuePair& tokenValuePair) { + return TokenValuePair{.token = tokenValuePair.token, .value = tokenValuePair.value}; +} +#endif // NN_AIDL_V4_OR_ABOVE nn::GeneralResult> convert(const nn::CacheToken& cacheToken) { return validatedConvert(cacheToken); @@ -1134,6 +1156,17 @@ nn::GeneralResult> convert( const std::vector& syncFences) { return validatedConvert(syncFences); } +nn::GeneralResult> convert( + const std::vector& extensionNameToPrefix) { + return unvalidatedConvert(extensionNameToPrefix); +} + +#ifdef NN_AIDL_V4_OR_ABOVE +nn::GeneralResult> convert( + const std::vector& metaData) { + return validatedConvert(metaData); +} +#endif // NN_AIDL_V4_OR_ABOVE nn::GeneralResult> convert(const std::vector& extensions) { return validatedConvert(extensions); diff --git a/neuralnetworks/aidl/utils/src/Device.cpp b/neuralnetworks/aidl/utils/src/Device.cpp index bad10ed347..f3f4fdbba1 100644 --- a/neuralnetworks/aidl/utils/src/Device.cpp +++ b/neuralnetworks/aidl/utils/src/Device.cpp @@ -215,7 +215,9 @@ nn::GeneralResult> Device::getSupportedOperations(const nn::Mo nn::GeneralResult Device::prepareModel( const nn::Model& model, nn::ExecutionPreference preference, nn::Priority priority, nn::OptionalTimePoint deadline, const std::vector& modelCache, - const std::vector& dataCache, const nn::CacheToken& token) const { + const std::vector& dataCache, const nn::CacheToken& token, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { // Ensure that model is ready for IPC. std::optional maybeModelInShared; const nn::Model& modelInShared = @@ -225,17 +227,28 @@ nn::GeneralResult Device::prepareModel( const auto aidlPreference = NN_TRY(convert(preference)); const auto aidlPriority = NN_TRY(convert(priority)); const auto aidlDeadline = NN_TRY(convert(deadline)); - const auto aidlModelCache = NN_TRY(convert(modelCache)); - const auto aidlDataCache = NN_TRY(convert(dataCache)); + auto aidlModelCache = NN_TRY(convert(modelCache)); + auto aidlDataCache = NN_TRY(convert(dataCache)); const auto aidlToken = NN_TRY(convert(token)); const auto cb = ndk::SharedRefBase::make(kFeatureLevel); const auto scoped = kDeathHandler.protectCallback(cb.get()); + if (kFeatureLevel.level >= nn::Version::Level::FEATURE_LEVEL_8) { + auto aidlHints = NN_TRY(convert(hints)); + auto aidlExtensionPrefix = NN_TRY(convert(extensionNameToPrefix)); + const auto ret = kDevice->prepareModelWithConfig( + aidlModel, + {aidlPreference, aidlPriority, aidlDeadline, std::move(aidlModelCache), + std::move(aidlDataCache), aidlToken, std::move(aidlHints), + std::move(aidlExtensionPrefix)}, + cb); + HANDLE_ASTATUS(ret) << "prepareModel failed"; + return cb->get(); + } const auto ret = kDevice->prepareModel(aidlModel, aidlPreference, aidlPriority, aidlDeadline, aidlModelCache, aidlDataCache, aidlToken, cb); HANDLE_ASTATUS(ret) << "prepareModel failed"; - return cb->get(); } diff --git a/neuralnetworks/aidl/utils/src/Execution.cpp b/neuralnetworks/aidl/utils/src/Execution.cpp index c4add636e5..2fd88aff36 100644 --- a/neuralnetworks/aidl/utils/src/Execution.cpp +++ b/neuralnetworks/aidl/utils/src/Execution.cpp @@ -63,7 +63,7 @@ nn::ExecutionResult, nn::Timing>> ExecutionWithCachedRequest::compute(const nn::OptionalTimePoint& deadline) const { const auto aidlDeadline = NN_TRY(convert(deadline)); return kPreparedModel->executeInternal(kRequest, kMeasure, aidlDeadline, kLoopTimeoutDuration, - kRelocation); + {}, {}, kRelocation); } nn::GeneralResult> @@ -73,9 +73,9 @@ ExecutionWithCachedRequest::computeFenced( const auto aidlWaitFor = NN_TRY(convert(waitFor)); const auto aidlDeadline = NN_TRY(convert(deadline)); const auto aidlTimeoutDurationAfterFence = NN_TRY(convert(timeoutDurationAfterFence)); - return kPreparedModel->executeFencedInternal(kRequest, aidlWaitFor, kMeasure, aidlDeadline, - kLoopTimeoutDuration, - aidlTimeoutDurationAfterFence, kRelocation); + return kPreparedModel->executeFencedInternal( + kRequest, aidlWaitFor, kMeasure, aidlDeadline, kLoopTimeoutDuration, + aidlTimeoutDurationAfterFence, {}, {}, kRelocation); } nn::GeneralResult> Execution::create( diff --git a/neuralnetworks/aidl/utils/src/InvalidDevice.cpp b/neuralnetworks/aidl/utils/src/InvalidDevice.cpp index c9d995590f..33270ff381 100644 --- a/neuralnetworks/aidl/utils/src/InvalidDevice.cpp +++ b/neuralnetworks/aidl/utils/src/InvalidDevice.cpp @@ -167,6 +167,31 @@ ndk::ScopedAStatus InvalidDevice::prepareModel( return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus InvalidDevice::prepareModelWithConfig( + const Model& model, const PrepareModelConfig& config, + const std::shared_ptr& callback) { + if (!utils::valid(config.extensionNameToPrefix)) { + callback->notify(ErrorStatus::INVALID_ARGUMENT, nullptr); + return toAStatus(ErrorStatus::INVALID_ARGUMENT, "Invalid extensionNameToPrefix"); + } + for (const auto& hint : config.compilationHints) { + auto result = std::find_if(config.extensionNameToPrefix.begin(), + config.extensionNameToPrefix.end(), + [&hint](const ExtensionNameAndPrefix& extension) { + uint16_t prefix = static_cast(hint.token) >> + IDevice::EXTENSION_TYPE_LOW_BITS_TYPE; + return prefix == extension.prefix; + }); + if (result == config.extensionNameToPrefix.end()) { + callback->notify(ErrorStatus::INVALID_ARGUMENT, nullptr); + return toAStatus(ErrorStatus::INVALID_ARGUMENT, + "Invalid token for compilation hints: " + std::to_string(hint.token)); + } + } + return prepareModel(model, config.preference, config.priority, config.deadlineNs, + config.modelCache, config.dataCache, config.cacheToken, callback); +} + ndk::ScopedAStatus InvalidDevice::prepareModelFromCache( int64_t /*deadline*/, const std::vector& /*modelCache*/, const std::vector& /*dataCache*/, diff --git a/neuralnetworks/aidl/utils/src/PreparedModel.cpp b/neuralnetworks/aidl/utils/src/PreparedModel.cpp index 6d1de569d0..7e3a31cac1 100644 --- a/neuralnetworks/aidl/utils/src/PreparedModel.cpp +++ b/neuralnetworks/aidl/utils/src/PreparedModel.cpp @@ -128,8 +128,9 @@ PreparedModel::PreparedModel(PrivateConstructorTag /*tag*/, nn::ExecutionResult, nn::Timing>> PreparedModel::execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const { + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { // Ensure that request is ready for IPC. std::optional maybeRequestInShared; hal::utils::RequestRelocation relocation; @@ -141,30 +142,46 @@ nn::ExecutionResult, nn::Timing>> Prepare const auto aidlMeasure = NN_TRY(convert(measure)); const auto aidlDeadline = NN_TRY(convert(deadline)); const auto aidlLoopTimeoutDuration = NN_TRY(convert(loopTimeoutDuration)); - return executeInternal(aidlRequest, aidlMeasure, aidlDeadline, aidlLoopTimeoutDuration, - relocation); + return executeInternal(aidlRequest, aidlMeasure, aidlDeadline, aidlLoopTimeoutDuration, hints, + extensionNameToPrefix, relocation); } nn::ExecutionResult, nn::Timing>> PreparedModel::executeInternal(const Request& request, bool measure, int64_t deadline, int64_t loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix, const hal::utils::RequestRelocation& relocation) const { if (relocation.input) { relocation.input->flush(); } ExecutionResult executionResult; - const auto ret = kPreparedModel->executeSynchronously(request, measure, deadline, - loopTimeoutDuration, &executionResult); - HANDLE_ASTATUS(ret) << "executeSynchronously failed"; + if (kFeatureLevel.level >= nn::Version::Level::FEATURE_LEVEL_8) { + auto aidlHints = NN_TRY(convert(hints)); + auto aidlExtensionPrefix = NN_TRY(convert(extensionNameToPrefix)); + const auto ret = kPreparedModel->executeSynchronouslyWithConfig( + request, + {measure, loopTimeoutDuration, std::move(aidlHints), + std::move(aidlExtensionPrefix)}, + deadline, &executionResult); + HANDLE_ASTATUS(ret) << "executeSynchronouslyWithConfig failed"; + } else { + const auto ret = kPreparedModel->executeSynchronously( + request, measure, deadline, loopTimeoutDuration, &executionResult); + HANDLE_ASTATUS(ret) << "executeSynchronously failed"; + } return handleExecutionResult(executionResult, relocation); } nn::GeneralResult> -PreparedModel::executeFenced(const nn::Request& request, const std::vector& waitFor, - nn::MeasureTiming measure, const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration, - const nn::OptionalDuration& timeoutDurationAfterFence) const { +PreparedModel::executeFenced( + const nn::Request& request, const std::vector& waitFor, + nn::MeasureTiming measure, const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration, + const nn::OptionalDuration& timeoutDurationAfterFence, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { // Ensure that request is ready for IPC. std::optional maybeRequestInShared; hal::utils::RequestRelocation relocation; @@ -179,31 +196,45 @@ PreparedModel::executeFenced(const nn::Request& request, const std::vector> -PreparedModel::executeFencedInternal(const Request& request, - const std::vector& waitFor, - bool measure, int64_t deadline, int64_t loopTimeoutDuration, - int64_t timeoutDurationAfterFence, - const hal::utils::RequestRelocation& relocation) const { +PreparedModel::executeFencedInternal( + const Request& request, const std::vector& waitFor, bool measure, + int64_t deadline, int64_t loopTimeoutDuration, int64_t timeoutDurationAfterFence, + const std::vector& hints, + const std::vector& extensionNameToPrefix, + const hal::utils::RequestRelocation& relocation) const { if (relocation.input) { relocation.input->flush(); } FencedExecutionResult result; - const auto ret = - kPreparedModel->executeFenced(request, waitFor, measure, deadline, loopTimeoutDuration, - timeoutDurationAfterFence, &result); - HANDLE_ASTATUS(ret) << "executeFenced failed"; + if (kFeatureLevel.level >= nn::Version::Level::FEATURE_LEVEL_8) { + auto aidlHints = NN_TRY(convert(hints)); + auto aidlExtensionPrefix = NN_TRY(convert(extensionNameToPrefix)); + const auto ret = kPreparedModel->executeFencedWithConfig( + request, waitFor, + {measure, loopTimeoutDuration, std::move(aidlHints), + std::move(aidlExtensionPrefix)}, + deadline, timeoutDurationAfterFence, &result); + HANDLE_ASTATUS(ret) << "executeFencedWithConfig failed"; + } else { + const auto ret = kPreparedModel->executeFenced(request, waitFor, measure, deadline, + loopTimeoutDuration, + timeoutDurationAfterFence, &result); + HANDLE_ASTATUS(ret) << "executeFenced failed"; + } return handleFencedExecutionResult(result, relocation); } nn::GeneralResult PreparedModel::createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const { + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { // Ensure that request is ready for IPC. std::optional maybeRequestInShared; hal::utils::RequestRelocation relocation; @@ -217,8 +248,14 @@ nn::GeneralResult PreparedModel::createReusableExecution( if (kFeatureLevel.level >= nn::Version::Level::FEATURE_LEVEL_8) { std::shared_ptr execution; + auto aidlHints = NN_TRY(convert(hints)); + auto aidlExtensionPrefix = NN_TRY(convert(extensionNameToPrefix)); + const auto ret = kPreparedModel->createReusableExecution( - aidlRequest, aidlMeasure, aidlLoopTimeoutDuration, &execution); + aidlRequest, + {aidlMeasure, aidlLoopTimeoutDuration, std::move(aidlHints), + std::move(aidlExtensionPrefix)}, + &execution); HANDLE_ASTATUS(ret) << "createReusableExecution failed"; return Execution::create(std::move(execution), std::move(relocation)); } @@ -232,7 +269,7 @@ nn::GeneralResult PreparedModel::configureExecutionBurst() cons std::shared_ptr burst; const auto ret = kPreparedModel->configureExecutionBurst(&burst); HANDLE_ASTATUS(ret) << "configureExecutionBurst failed"; - return Burst::create(std::move(burst)); + return Burst::create(std::move(burst), kFeatureLevel); } std::any PreparedModel::getUnderlyingResource() const { diff --git a/neuralnetworks/aidl/utils/test/DeviceTest.cpp b/neuralnetworks/aidl/utils/test/DeviceTest.cpp index fb13af8d9f..73727b3974 100644 --- a/neuralnetworks/aidl/utils/test/DeviceTest.cpp +++ b/neuralnetworks/aidl/utils/test/DeviceTest.cpp @@ -61,7 +61,6 @@ constexpr PerformanceInfo kNoPerformanceInfo = {.execTime = std::numeric_limits< .powerUsage = std::numeric_limits::max()}; constexpr NumberOfCacheFiles kNumberOfCacheFiles = {.numModelCache = nn::kMaxNumberOfCacheFiles - 1, .numDataCache = nn::kMaxNumberOfCacheFiles}; - constexpr auto makeStatusOk = [] { return ndk::ScopedAStatus::ok(); }; std::shared_ptr createMockDevice() { @@ -124,6 +123,18 @@ auto makePreparedModelReturn(ErrorStatus launchStatus, ErrorStatus returnStatus, }; } +const std::vector kHints = {nn::TokenValuePair{.token = 0, .value = {1}}}; +const std::vector kExtensionNameToPrefix = { + nn::ExtensionNameAndPrefix{.name = "com.android.nn_test", .prefix = 1}}; +auto makePreparedModelWithConfigReturn(ErrorStatus launchStatus, ErrorStatus returnStatus, + const std::shared_ptr& preparedModel) { + return [launchStatus, returnStatus, preparedModel]( + const Model& /*model*/, const PrepareModelConfig& /*config*/, + const std::shared_ptr& cb) -> ndk::ScopedAStatus { + return makePreparedModelReturnImpl(launchStatus, returnStatus, preparedModel, cb); + }; +} + auto makePreparedModelFromCacheReturn(ErrorStatus launchStatus, ErrorStatus returnStatus, const std::shared_ptr& preparedModel) { return [launchStatus, returnStatus, preparedModel]( @@ -560,6 +571,8 @@ TEST_P(DeviceTest, getSupportedOperationsDeadObject) { } TEST_P(DeviceTest, prepareModel) { + if (kVersion.level > nn::Version::Level::FEATURE_LEVEL_7) return; + // setup call const auto mockDevice = createMockDevice(); const auto device = Device::create(kName, mockDevice, kVersion).value(); @@ -571,7 +584,7 @@ TEST_P(DeviceTest, prepareModel) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -580,6 +593,8 @@ TEST_P(DeviceTest, prepareModel) { } TEST_P(DeviceTest, prepareModelLaunchError) { + if (kVersion.level > nn::Version::Level::FEATURE_LEVEL_7) return; + // setup call const auto mockDevice = createMockDevice(); const auto device = Device::create(kName, mockDevice, kVersion).value(); @@ -590,7 +605,7 @@ TEST_P(DeviceTest, prepareModelLaunchError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -598,6 +613,8 @@ TEST_P(DeviceTest, prepareModelLaunchError) { } TEST_P(DeviceTest, prepareModelReturnError) { + if (kVersion.level > nn::Version::Level::FEATURE_LEVEL_7) return; + // setup call const auto mockDevice = createMockDevice(); const auto device = Device::create(kName, mockDevice, kVersion).value(); @@ -608,7 +625,7 @@ TEST_P(DeviceTest, prepareModelReturnError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -616,6 +633,8 @@ TEST_P(DeviceTest, prepareModelReturnError) { } TEST_P(DeviceTest, prepareModelNullptrError) { + if (kVersion.level > nn::Version::Level::FEATURE_LEVEL_7) return; + // setup call const auto mockDevice = createMockDevice(); const auto device = Device::create(kName, mockDevice, kVersion).value(); @@ -626,7 +645,7 @@ TEST_P(DeviceTest, prepareModelNullptrError) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -634,6 +653,8 @@ TEST_P(DeviceTest, prepareModelNullptrError) { } TEST_P(DeviceTest, prepareModelTransportFailure) { + if (kVersion.level > nn::Version::Level::FEATURE_LEVEL_7) return; + // setup call const auto mockDevice = createMockDevice(); const auto device = Device::create(kName, mockDevice, kVersion).value(); @@ -643,7 +664,7 @@ TEST_P(DeviceTest, prepareModelTransportFailure) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -651,6 +672,8 @@ TEST_P(DeviceTest, prepareModelTransportFailure) { } TEST_P(DeviceTest, prepareModelDeadObject) { + if (kVersion.level > nn::Version::Level::FEATURE_LEVEL_7) return; + // setup call const auto mockDevice = createMockDevice(); const auto device = Device::create(kName, mockDevice, kVersion).value(); @@ -660,7 +683,7 @@ TEST_P(DeviceTest, prepareModelDeadObject) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -668,6 +691,8 @@ TEST_P(DeviceTest, prepareModelDeadObject) { } TEST_P(DeviceTest, prepareModelAsyncCrash) { + if (kVersion.level > nn::Version::Level::FEATURE_LEVEL_7) return; + // setup test const auto mockDevice = createMockDevice(); const auto device = Device::create(kName, mockDevice, kVersion).value(); @@ -681,7 +706,157 @@ TEST_P(DeviceTest, prepareModelAsyncCrash) { // run test const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST_P(DeviceTest, prepareModelWithConfig) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice, kVersion).value(); + const auto mockPreparedModel = MockPreparedModel::create(); + EXPECT_CALL(*mockDevice, prepareModelWithConfig(_, _, _)) + .Times(1) + .WillOnce(Invoke(makePreparedModelWithConfigReturn(ErrorStatus::NONE, ErrorStatus::NONE, + mockPreparedModel))); + + // run test + const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}, kHints, + kExtensionNameToPrefix); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + EXPECT_NE(result.value(), nullptr); +} + +TEST_P(DeviceTest, prepareModelWithConfigLaunchError) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice, kVersion).value(); + EXPECT_CALL(*mockDevice, prepareModelWithConfig(_, _, _)) + .Times(1) + .WillOnce(Invoke(makePreparedModelWithConfigReturn( + ErrorStatus::GENERAL_FAILURE, ErrorStatus::GENERAL_FAILURE, nullptr))); + + // run test + const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}, kHints, + kExtensionNameToPrefix); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST_P(DeviceTest, prepareModelWithConfigReturnError) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice, kVersion).value(); + EXPECT_CALL(*mockDevice, prepareModelWithConfig(_, _, _)) + .Times(1) + .WillOnce(Invoke(makePreparedModelWithConfigReturn( + ErrorStatus::NONE, ErrorStatus::GENERAL_FAILURE, nullptr))); + + // run test + const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}, kHints, + kExtensionNameToPrefix); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST_P(DeviceTest, prepareModelWithConfigNullptrError) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice, kVersion).value(); + EXPECT_CALL(*mockDevice, prepareModelWithConfig(_, _, _)) + .Times(1) + .WillOnce(Invoke(makePreparedModelWithConfigReturn(ErrorStatus::NONE, ErrorStatus::NONE, + nullptr))); + + // run test + const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}, kHints, + kExtensionNameToPrefix); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST_P(DeviceTest, prepareModelWithConfigTransportFailure) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice, kVersion).value(); + EXPECT_CALL(*mockDevice, prepareModelWithConfig(_, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}, kHints, + kExtensionNameToPrefix); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST_P(DeviceTest, prepareModelWithConfigDeadObject) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup call + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice, kVersion).value(); + EXPECT_CALL(*mockDevice, prepareModelWithConfig(_, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}, kHints, + kExtensionNameToPrefix); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST_P(DeviceTest, prepareModelWithConfigAsyncCrash) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup test + const auto mockDevice = createMockDevice(); + const auto device = Device::create(kName, mockDevice, kVersion).value(); + const auto ret = [&device]() { + DeathMonitor::serviceDied(device->getDeathMonitor()); + return ndk::ScopedAStatus::ok(); + }; + EXPECT_CALL(*mockDevice, prepareModelWithConfig(_, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(ret)); + + // run test + const auto result = device->prepareModel(kSimpleModel, nn::ExecutionPreference::DEFAULT, + nn::Priority::DEFAULT, {}, {}, {}, {}, kHints, + kExtensionNameToPrefix); // verify result ASSERT_FALSE(result.has_value()); diff --git a/neuralnetworks/aidl/utils/test/MockBurst.h b/neuralnetworks/aidl/utils/test/MockBurst.h index 5083bbdc86..4cf60b678b 100644 --- a/neuralnetworks/aidl/utils/test/MockBurst.h +++ b/neuralnetworks/aidl/utils/test/MockBurst.h @@ -32,6 +32,10 @@ class MockBurst final : public BnBurst { bool measureTiming, int64_t deadline, int64_t loopTimeoutDuration, ExecutionResult* executionResult), (override)); + MOCK_METHOD(ndk::ScopedAStatus, executeSynchronouslyWithConfig, + (const Request& request, const std::vector& memoryIdentifierTokens, + const ExecutionConfig& config, int64_t deadline, ExecutionResult* executionResult), + (override)); MOCK_METHOD(ndk::ScopedAStatus, releaseMemoryResource, (int64_t memoryIdentifierToken), (override)); }; diff --git a/neuralnetworks/aidl/utils/test/MockDevice.h b/neuralnetworks/aidl/utils/test/MockDevice.h index 3a28d55580..47b83460a1 100644 --- a/neuralnetworks/aidl/utils/test/MockDevice.h +++ b/neuralnetworks/aidl/utils/test/MockDevice.h @@ -50,6 +50,10 @@ class MockDevice final : public BnDevice { const std::vector& token, const std::shared_ptr& callback), (override)); + MOCK_METHOD(ndk::ScopedAStatus, prepareModelWithConfig, + (const Model& model, const PrepareModelConfig& config, + const std::shared_ptr& callback), + (override)); MOCK_METHOD(ndk::ScopedAStatus, prepareModelFromCache, (int64_t deadline, const std::vector& modelCache, const std::vector& dataCache, diff --git a/neuralnetworks/aidl/utils/test/MockPreparedModel.h b/neuralnetworks/aidl/utils/test/MockPreparedModel.h index 0ed9af9929..318acc23f2 100644 --- a/neuralnetworks/aidl/utils/test/MockPreparedModel.h +++ b/neuralnetworks/aidl/utils/test/MockPreparedModel.h @@ -40,10 +40,19 @@ class MockPreparedModel final : public BnPreparedModel { bool measureTiming, int64_t deadline, int64_t loopTimeoutDuration, int64_t duration, FencedExecutionResult* fencedExecutionResult), (override)); + MOCK_METHOD(ndk::ScopedAStatus, executeSynchronouslyWithConfig, + (const Request& request, const ExecutionConfig& config, int64_t deadline, + ExecutionResult* executionResult), + (override)); + MOCK_METHOD(ndk::ScopedAStatus, executeFencedWithConfig, + (const Request& request, const std::vector& waitFor, + const ExecutionConfig& config, int64_t deadline, int64_t duration, + FencedExecutionResult* fencedExecutionResult), + (override)); MOCK_METHOD(ndk::ScopedAStatus, configureExecutionBurst, (std::shared_ptr * burst), (override)); MOCK_METHOD(ndk::ScopedAStatus, createReusableExecution, - (const Request& request, bool measureTiming, int64_t loopTimeoutDuration, + (const Request& request, const ExecutionConfig& config, std::shared_ptr* execution), (override)); }; diff --git a/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp b/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp index 8cfb7c123a..bf6136dabb 100644 --- a/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp +++ b/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp @@ -70,6 +70,21 @@ auto makeFencedExecutionResult(const std::shared_ptr kHints = {nn::TokenValuePair{.token = 0, .value = {1}}}; +const std::vector kExtensionNameToPrefix = { + nn::ExtensionNameAndPrefix{.name = "com.android.nn_test", .prefix = 1}}; +auto makeFencedExecutionWithConfigResult( + const std::shared_ptr& callback) { + return [callback](const Request& /*request*/, + const std::vector& /*waitFor*/, + const ExecutionConfig& /*config*/, int64_t /*deadline*/, int64_t /*duration*/, + FencedExecutionResult* fencedExecutionResult) { + *fencedExecutionResult = FencedExecutionResult{.callback = callback, + .syncFence = ndk::ScopedFileDescriptor(-1)}; + return ndk::ScopedAStatus::ok(); + }; +} + } // namespace TEST_P(PreparedModelTest, invalidPreparedModel) { @@ -82,6 +97,8 @@ TEST_P(PreparedModelTest, invalidPreparedModel) { } TEST_P(PreparedModelTest, executeSync) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup call const auto mockPreparedModel = MockPreparedModel::create(); const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); @@ -96,7 +113,7 @@ TEST_P(PreparedModelTest, executeSync) { DoAll(SetArgPointee<4>(mockExecutionResult), InvokeWithoutArgs(makeStatusOk))); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result EXPECT_TRUE(result.has_value()) @@ -104,6 +121,8 @@ TEST_P(PreparedModelTest, executeSync) { } TEST_P(PreparedModelTest, executeSyncError) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup test const auto mockPreparedModel = MockPreparedModel::create(); const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); @@ -112,7 +131,7 @@ TEST_P(PreparedModelTest, executeSyncError) { .WillOnce(Invoke(makeGeneralFailure)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -120,6 +139,8 @@ TEST_P(PreparedModelTest, executeSyncError) { } TEST_P(PreparedModelTest, executeSyncTransportFailure) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup test const auto mockPreparedModel = MockPreparedModel::create(); const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); @@ -128,7 +149,7 @@ TEST_P(PreparedModelTest, executeSyncTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -136,6 +157,8 @@ TEST_P(PreparedModelTest, executeSyncTransportFailure) { } TEST_P(PreparedModelTest, executeSyncDeadObject) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup test const auto mockPreparedModel = MockPreparedModel::create(); const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); @@ -144,7 +167,7 @@ TEST_P(PreparedModelTest, executeSyncDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -152,6 +175,8 @@ TEST_P(PreparedModelTest, executeSyncDeadObject) { } TEST_P(PreparedModelTest, executeFenced) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup call const auto mockPreparedModel = MockPreparedModel::create(); const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); @@ -165,7 +190,7 @@ TEST_P(PreparedModelTest, executeFenced) { .WillOnce(Invoke(makeFencedExecutionResult(mockCallback))); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -181,6 +206,8 @@ TEST_P(PreparedModelTest, executeFenced) { } TEST_P(PreparedModelTest, executeFencedCallbackError) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup call const auto mockPreparedModel = MockPreparedModel::create(); const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); @@ -195,7 +222,7 @@ TEST_P(PreparedModelTest, executeFencedCallbackError) { .WillOnce(Invoke(makeFencedExecutionResult(mockCallback))); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -211,6 +238,8 @@ TEST_P(PreparedModelTest, executeFencedCallbackError) { } TEST_P(PreparedModelTest, executeFencedError) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup test const auto mockPreparedModel = MockPreparedModel::create(); const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); @@ -219,7 +248,7 @@ TEST_P(PreparedModelTest, executeFencedError) { .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -227,6 +256,8 @@ TEST_P(PreparedModelTest, executeFencedError) { } TEST_P(PreparedModelTest, executeFencedTransportFailure) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup test const auto mockPreparedModel = MockPreparedModel::create(); const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); @@ -235,7 +266,7 @@ TEST_P(PreparedModelTest, executeFencedTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -243,6 +274,8 @@ TEST_P(PreparedModelTest, executeFencedTransportFailure) { } TEST_P(PreparedModelTest, executeFencedDeadObject) { + if (kVersion.level >= nn::Version::Level::FEATURE_LEVEL_8) return; + // setup test const auto mockPreparedModel = MockPreparedModel::create(); const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); @@ -251,7 +284,7 @@ TEST_P(PreparedModelTest, executeFencedDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -276,7 +309,7 @@ TEST_P(PreparedModelTest, reusableExecuteSync) { DoAll(SetArgPointee<4>(mockExecutionResult), InvokeWithoutArgs(makeStatusOk))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -300,7 +333,7 @@ TEST_P(PreparedModelTest, reusableExecuteSyncError) { .WillOnce(Invoke(makeGeneralFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -322,7 +355,7 @@ TEST_P(PreparedModelTest, reusableExecuteSyncTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -344,7 +377,7 @@ TEST_P(PreparedModelTest, reusableExecuteSyncDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -372,7 +405,7 @@ TEST_P(PreparedModelTest, reusableExecuteFenced) { .WillRepeatedly(Invoke(makeFencedExecutionResult(mockCallback))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -410,7 +443,7 @@ TEST_P(PreparedModelTest, reusableExecuteFencedCallbackError) { .WillOnce(Invoke(makeFencedExecutionResult(mockCallback))); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -440,7 +473,7 @@ TEST_P(PreparedModelTest, reusableExecuteFencedError) { .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -462,7 +495,7 @@ TEST_P(PreparedModelTest, reusableExecuteFencedTransportFailure) { .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -484,7 +517,7 @@ TEST_P(PreparedModelTest, reusableExecuteFencedDeadObject) { .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); // create execution - const auto createResult = preparedModel->createReusableExecution({}, {}, {}); + const auto createResult = preparedModel->createReusableExecution({}, {}, {}, {}, {}); ASSERT_TRUE(createResult.has_value()) << "Failed with " << createResult.error().code << ": " << createResult.error().message; ASSERT_NE(createResult.value(), nullptr); @@ -495,6 +528,206 @@ TEST_P(PreparedModelTest, reusableExecuteFencedDeadObject) { EXPECT_EQ(computeResult.error().code, nn::ErrorStatus::DEAD_OBJECT); } +TEST_P(PreparedModelTest, executeSyncWithConfig) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup call + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); + const auto mockExecutionResult = ExecutionResult{ + .outputSufficientSize = true, + .outputShapes = {}, + .timing = kNoTiming, + }; + EXPECT_CALL(*mockPreparedModel, executeSynchronouslyWithConfig(_, _, _, _)) + .Times(1) + .WillOnce( + DoAll(SetArgPointee<3>(mockExecutionResult), InvokeWithoutArgs(makeStatusOk))); + + // run test + const auto result = preparedModel->execute({}, {}, {}, {}, kHints, kExtensionNameToPrefix); + + // verify result + EXPECT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; +} + +TEST_P(PreparedModelTest, executeSyncWithConfigError) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); + EXPECT_CALL(*mockPreparedModel, executeSynchronouslyWithConfig(_, _, _, _)) + .Times(1) + .WillOnce(Invoke(makeGeneralFailure)); + + // run test + const auto result = preparedModel->execute({}, {}, {}, {}, kHints, kExtensionNameToPrefix); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST_P(PreparedModelTest, executeSyncWithConfigTransportFailure) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); + EXPECT_CALL(*mockPreparedModel, executeSynchronouslyWithConfig(_, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = preparedModel->execute({}, {}, {}, {}, kHints, kExtensionNameToPrefix); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST_P(PreparedModelTest, executeSyncWithConfigDeadObject) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); + EXPECT_CALL(*mockPreparedModel, executeSynchronouslyWithConfig(_, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = preparedModel->execute({}, {}, {}, {}, kHints, kExtensionNameToPrefix); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + +TEST_P(PreparedModelTest, executeFencedWithConfig) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup call + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); + const auto mockCallback = MockFencedExecutionCallback::create(); + EXPECT_CALL(*mockCallback, getExecutionInfo(_, _, _)) + .Times(1) + .WillOnce(DoAll(SetArgPointee<0>(kNoTiming), SetArgPointee<1>(kNoTiming), + SetArgPointee<2>(ErrorStatus::NONE), Invoke(makeStatusOk))); + EXPECT_CALL(*mockPreparedModel, executeFencedWithConfig(_, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(makeFencedExecutionWithConfigResult(mockCallback))); + + // run test + const auto result = + preparedModel->executeFenced({}, {}, {}, {}, {}, {}, kHints, kExtensionNameToPrefix); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + const auto& [syncFence, callback] = result.value(); + EXPECT_EQ(syncFence.syncWait({}), nn::SyncFence::FenceState::SIGNALED); + ASSERT_NE(callback, nullptr); + + // get results from callback + const auto callbackResult = callback(); + ASSERT_TRUE(callbackResult.has_value()) << "Failed with " << callbackResult.error().code << ": " + << callbackResult.error().message; +} + +TEST_P(PreparedModelTest, executeFencedWithConfigCallbackError) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup call + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); + const auto mockCallback = MockFencedExecutionCallback::create(); + EXPECT_CALL(*mockCallback, getExecutionInfo(_, _, _)) + .Times(1) + .WillOnce(Invoke(DoAll(SetArgPointee<0>(kNoTiming), SetArgPointee<1>(kNoTiming), + SetArgPointee<2>(ErrorStatus::GENERAL_FAILURE), + Invoke(makeStatusOk)))); + EXPECT_CALL(*mockPreparedModel, executeFencedWithConfig(_, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(makeFencedExecutionWithConfigResult(mockCallback))); + + // run test + const auto result = + preparedModel->executeFenced({}, {}, {}, {}, {}, {}, kHints, kExtensionNameToPrefix); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + const auto& [syncFence, callback] = result.value(); + EXPECT_NE(syncFence.syncWait({}), nn::SyncFence::FenceState::ACTIVE); + ASSERT_NE(callback, nullptr); + + // verify callback failure + const auto callbackResult = callback(); + ASSERT_FALSE(callbackResult.has_value()); + EXPECT_EQ(callbackResult.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST_P(PreparedModelTest, executeFencedWithConfigError) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); + EXPECT_CALL(*mockPreparedModel, executeFencedWithConfig(_, _, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); + + // run test + const auto result = + preparedModel->executeFenced({}, {}, {}, {}, {}, {}, kHints, kExtensionNameToPrefix); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST_P(PreparedModelTest, executeFencedWithConfigTransportFailure) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); + EXPECT_CALL(*mockPreparedModel, executeFencedWithConfig(_, _, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto result = + preparedModel->executeFenced({}, {}, {}, {}, {}, {}, kHints, kExtensionNameToPrefix); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::GENERAL_FAILURE); +} + +TEST_P(PreparedModelTest, executeFencedWithConfigDeadObject) { + if (kVersion.level < nn::Version::Level::FEATURE_LEVEL_8) return; + + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); + EXPECT_CALL(*mockPreparedModel, executeFencedWithConfig(_, _, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto result = + preparedModel->executeFenced({}, {}, {}, {}, {}, {}, kHints, kExtensionNameToPrefix); + + // verify result + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); +} + TEST_P(PreparedModelTest, configureExecutionBurst) { // setup test const auto mockPreparedModel = MockPreparedModel::create(); @@ -567,13 +800,13 @@ TEST_P(PreparedModelTest, createReusableExecution) { // setup test const auto mockPreparedModel = MockPreparedModel::create(); const auto mockExecution = ndk::SharedRefBase::make(); - EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _, _)) + EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _)) .Times(1) - .WillOnce(DoAll(SetArgPointee<3>(mockExecution), Invoke(makeStatusOk))); + .WillOnce(DoAll(SetArgPointee<2>(mockExecution), Invoke(makeStatusOk))); const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); // run test - const auto result = preparedModel->createReusableExecution({}, {}, {}); + const auto result = preparedModel->createReusableExecution({}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -586,13 +819,13 @@ TEST_P(PreparedModelTest, createReusableExecutionError) { // setup test const auto mockPreparedModel = MockPreparedModel::create(); - EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _, _)) + EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _)) .Times(1) .WillOnce(InvokeWithoutArgs(makeGeneralFailure)); const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); // run test - const auto result = preparedModel->createReusableExecution({}, {}, {}); + const auto result = preparedModel->createReusableExecution({}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -604,13 +837,13 @@ TEST_P(PreparedModelTest, createReusableExecutionTransportFailure) { // setup test const auto mockPreparedModel = MockPreparedModel::create(); - EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _, _)) + EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _)) .Times(1) .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); // run test - const auto result = preparedModel->createReusableExecution({}, {}, {}); + const auto result = preparedModel->createReusableExecution({}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -622,13 +855,13 @@ TEST_P(PreparedModelTest, createReusableExecutionDeadObject) { // setup test const auto mockPreparedModel = MockPreparedModel::create(); - EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _, _)) + EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _)) .Times(1) .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); const auto preparedModel = PreparedModel::create(mockPreparedModel, kVersion).value(); // run test - const auto result = preparedModel->createReusableExecution({}, {}, {}); + const auto result = preparedModel->createReusableExecution({}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); diff --git a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp index 2460fbad86..8c8a87a376 100644 --- a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp +++ b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp @@ -63,6 +63,8 @@ struct TestConfig { // it is skipped. The field is set to true by default and is set to false in // quantization coupling tests to suppress skipping a test bool reportSkipping; + // `useConfig` indicates if a test should use execute*WithConfig functions for the execution. + bool useConfig; TestConfig(Executor executor, bool measureTiming, OutputType outputType, MemoryType memoryType, bool reusable) : executor(executor), @@ -70,7 +72,8 @@ struct TestConfig { outputType(outputType), memoryType(memoryType), reusable(reusable), - reportSkipping(true) {} + reportSkipping(true), + useConfig(false) {} TestConfig(Executor executor, bool measureTiming, OutputType outputType, MemoryType memoryType, bool reusable, bool reportSkipping) : executor(executor), @@ -78,7 +81,17 @@ struct TestConfig { outputType(outputType), memoryType(memoryType), reusable(reusable), - reportSkipping(reportSkipping) {} + reportSkipping(reportSkipping), + useConfig(false) {} + TestConfig(Executor executor, bool measureTiming, OutputType outputType, MemoryType memoryType, + bool reusable, bool reportSkipping, bool useConfig) + : executor(executor), + measureTiming(measureTiming), + outputType(outputType), + memoryType(memoryType), + reusable(reusable), + reportSkipping(reportSkipping), + useConfig(useConfig) {} }; std::string toString(OutputType type) { @@ -100,7 +113,8 @@ std::string toString(const TestConfig& config) { << ", .measureTiming=" << (config.measureTiming ? "true" : "false") << ", .outputType=" << toString(config.outputType) << ", .memoryType=" << toString(config.memoryType) - << ", .reusable=" << (config.reusable ? "true" : "false") << "}"; + << ", .reusable=" << (config.reusable ? "true" : "false") + << ", .useConfig=" << (config.useConfig ? "true" : "false") << "}"; return ss.str(); } @@ -587,8 +601,8 @@ void EvaluatePreparedModel(const std::shared_ptr& device, std::shared_ptr execution; if (testConfig.reusable) { - const auto ret = preparedModel->createReusableExecution(request, testConfig.measureTiming, - loopTimeoutDurationNs, &execution); + const auto ret = preparedModel->createReusableExecution( + request, {testConfig.measureTiming, loopTimeoutDurationNs, {}, {}}, &execution); ASSERT_TRUE(ret.isOk()) << static_cast(ret.getServiceSpecificError()); ASSERT_NE(nullptr, execution.get()); } @@ -607,6 +621,10 @@ void EvaluatePreparedModel(const std::shared_ptr& device, ::ndk::ScopedAStatus ret; if (testConfig.reusable) { ret = execution->executeSynchronously(kNoDeadline, &executionResult); + } else if (testConfig.useConfig) { + ret = preparedModel->executeSynchronouslyWithConfig( + request, {testConfig.measureTiming, loopTimeoutDurationNs, {}, {}}, + kNoDeadline, &executionResult); } else { ret = preparedModel->executeSynchronously(request, testConfig.measureTiming, kNoDeadline, loopTimeoutDurationNs, @@ -649,9 +667,16 @@ void EvaluatePreparedModel(const std::shared_ptr& device, ExecutionResult executionResult; // execute - ret = burst->executeSynchronously(request, slots, testConfig.measureTiming, - kNoDeadline, loopTimeoutDurationNs, - &executionResult); + if (testConfig.useConfig) { + ret = burst->executeSynchronouslyWithConfig( + request, slots, + {testConfig.measureTiming, loopTimeoutDurationNs, {}, {}}, kNoDeadline, + &executionResult); + } else { + ret = burst->executeSynchronously(request, slots, testConfig.measureTiming, + kNoDeadline, loopTimeoutDurationNs, + &executionResult); + } ASSERT_TRUE(ret.isOk() || ret.getExceptionCode() == EX_SERVICE_SPECIFIC) << ret.getDescription(); if (ret.isOk()) { @@ -680,6 +705,10 @@ void EvaluatePreparedModel(const std::shared_ptr& device, ::ndk::ScopedAStatus ret; if (testConfig.reusable) { ret = execution->executeFenced({}, kNoDeadline, kNoDuration, &executionResult); + } else if (testConfig.useConfig) { + ret = preparedModel->executeFencedWithConfig( + request, {}, {testConfig.measureTiming, loopTimeoutDurationNs, {}, {}}, + kNoDeadline, kNoDuration, &executionResult); } else { ret = preparedModel->executeFenced(request, {}, testConfig.measureTiming, kNoDeadline, loopTimeoutDurationNs, @@ -697,9 +726,19 @@ void EvaluatePreparedModel(const std::shared_ptr& device, waitFor.emplace_back(dupFd); // If a sync fence is returned, try start another run waiting for the sync // fence. - ret = preparedModel->executeFenced(request, waitFor, testConfig.measureTiming, - kNoDeadline, loopTimeoutDurationNs, - kNoDuration, &executionResult); + if (testConfig.reusable) { + ret = execution->executeFenced(waitFor, kNoDeadline, kNoDuration, + &executionResult); + } else if (testConfig.useConfig) { + ret = preparedModel->executeFencedWithConfig( + request, waitFor, + {testConfig.measureTiming, loopTimeoutDurationNs, {}, {}}, + kNoDeadline, kNoDuration, &executionResult); + } else { + ret = preparedModel->executeFenced( + request, waitFor, testConfig.measureTiming, kNoDeadline, + loopTimeoutDurationNs, kNoDuration, &executionResult); + } ASSERT_TRUE(ret.isOk()); waitForSyncFence(executionResult.syncFence.get()); } @@ -830,11 +869,13 @@ void EvaluatePreparedModel(const std::shared_ptr& device, std::vector executorList; std::vector memoryTypeList; std::vector reusableList = {false}; + std::vector useConfigList = {false}; int deviceVersion; ASSERT_TRUE(device->getInterfaceVersion(&deviceVersion).isOk()); if (deviceVersion >= kMinAidlLevelForFL8) { reusableList.push_back(true); + useConfigList.push_back(true); } switch (testKind) { @@ -879,11 +920,14 @@ void EvaluatePreparedModel(const std::shared_ptr& device, for (const Executor executor : executorList) { for (const MemoryType memoryType : memoryTypeList) { for (const bool reusable : reusableList) { - if (executor == Executor::BURST && reusable) continue; - const TestConfig testConfig(executor, measureTiming, outputType, memoryType, - reusable); - SCOPED_TRACE(toString(testConfig)); - EvaluatePreparedModel(device, preparedModel, testModel, testConfig); + for (const bool useConfig : useConfigList) { + if ((useConfig || executor == Executor::BURST) && reusable) continue; + const TestConfig testConfig(executor, measureTiming, outputType, + memoryType, reusable, + /*reportSkipping=*/true, useConfig); + SCOPED_TRACE(toString(testConfig)); + EvaluatePreparedModel(device, preparedModel, testModel, testConfig); + } } } } @@ -942,6 +986,13 @@ void Execute(const std::shared_ptr& device, const TestModel& testModel, createPreparedModel(device, model, &preparedModel); if (preparedModel == nullptr) return; EvaluatePreparedModel(device, preparedModel, testModel, testKind); + int32_t deviceVersion; + ASSERT_TRUE(device->getInterfaceVersion(&deviceVersion).isOk()); + if (deviceVersion >= kMinAidlLevelForFL8) { + createPreparedModel(device, model, &preparedModel, /*reportSkipping*/ true, + /*useConfig*/ true); + EvaluatePreparedModel(device, preparedModel, testModel, testKind); + } } break; case TestKind::QUANTIZATION_COUPLING: { ASSERT_TRUE(testModel.hasQuant8CoupledOperands()); diff --git a/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp b/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp index b3e9c633e3..97760ae97e 100644 --- a/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp +++ b/neuralnetworks/aidl/vts/functional/MemoryDomainTests.cpp @@ -204,11 +204,23 @@ class InvalidPreparedModel : public BnPreparedModel { return ndk::ScopedAStatus::fromServiceSpecificError( static_cast(ErrorStatus::GENERAL_FAILURE)); } + ndk::ScopedAStatus executeSynchronouslyWithConfig(const Request&, const ExecutionConfig&, + int64_t, ExecutionResult*) override { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(ErrorStatus::GENERAL_FAILURE)); + } + ndk::ScopedAStatus executeFencedWithConfig(const Request&, + const std::vector&, + const ExecutionConfig&, int64_t, int64_t, + FencedExecutionResult*) override { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(ErrorStatus::GENERAL_FAILURE)); + } ndk::ScopedAStatus configureExecutionBurst(std::shared_ptr*) override { return ndk::ScopedAStatus::fromServiceSpecificError( static_cast(ErrorStatus::GENERAL_FAILURE)); } - ndk::ScopedAStatus createReusableExecution(const aidl_hal::Request&, bool, int64_t, + ndk::ScopedAStatus createReusableExecution(const aidl_hal::Request&, const ExecutionConfig&, std::shared_ptr*) override { return ndk::ScopedAStatus::fromServiceSpecificError( static_cast(ErrorStatus::GENERAL_FAILURE)); diff --git a/neuralnetworks/aidl/vts/functional/ValidateModel.cpp b/neuralnetworks/aidl/vts/functional/ValidateModel.cpp index fdc7eff96f..931ba258b3 100644 --- a/neuralnetworks/aidl/vts/functional/ValidateModel.cpp +++ b/neuralnetworks/aidl/vts/functional/ValidateModel.cpp @@ -77,6 +77,28 @@ static void validatePrepareModel(const std::shared_ptr& device, const s ASSERT_EQ(nullptr, preparedModel.get()); } +static void validatePrepareModelWithConfig(const std::shared_ptr& device, + const std::string& message, const Model& model, + ExecutionPreference preference, Priority priority) { + SCOPED_TRACE(message + " [prepareModelWithConfig]"); + + std::shared_ptr preparedModelCallback = + ndk::SharedRefBase::make(); + const auto prepareLaunchStatus = device->prepareModelWithConfig( + model, {preference, priority, kNoDeadline, {}, {}, kEmptyCacheToken, {}, {}}, + preparedModelCallback); + ASSERT_FALSE(prepareLaunchStatus.isOk()); + ASSERT_EQ(prepareLaunchStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(prepareLaunchStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); + + preparedModelCallback->wait(); + ErrorStatus prepareReturnStatus = preparedModelCallback->getStatus(); + ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, prepareReturnStatus); + std::shared_ptr preparedModel = preparedModelCallback->getPreparedModel(); + ASSERT_EQ(nullptr, preparedModel.get()); +} + static bool validExecutionPreference(ExecutionPreference preference) { return preference == ExecutionPreference::LOW_POWER || preference == ExecutionPreference::FAST_SINGLE_ANSWER || @@ -103,6 +125,13 @@ static void validate(const std::shared_ptr& device, const std::string& } validatePrepareModel(device, message, model, preference, priority); + + int32_t aidlVersion; + ASSERT_TRUE(device->getInterfaceVersion(&aidlVersion).isOk()); + if (aidlVersion >= kMinAidlLevelForFL8) { + // prepareModelWithConfig must satisfy all requirements enforced by prepareModel. + validatePrepareModelWithConfig(device, message, model, preference, priority); + } } static uint32_t addOperand(Model* model) { diff --git a/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp b/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp index e8debf704c..d7498419a1 100644 --- a/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp +++ b/neuralnetworks/aidl/vts/functional/ValidateRequest.cpp @@ -45,7 +45,7 @@ static void validateReusableExecution(const std::shared_ptr& pre { SCOPED_TRACE(message + " [createReusableExecution]"); const auto createStatus = preparedModel->createReusableExecution( - request, measure, kOmittedTimeoutDuration, &execution); + request, {measure, kOmittedTimeoutDuration, {}, {}}, &execution); if (!createStatus.isOk()) { ASSERT_EQ(createStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); ASSERT_EQ(static_cast(createStatus.getServiceSpecificError()), @@ -149,10 +149,59 @@ static void validate(const std::shared_ptr& preparedModel, int32_t aidlVersion; ASSERT_TRUE(preparedModel->getInterfaceVersion(&aidlVersion).isOk()); + if (aidlVersion < kMinAidlLevelForFL8) { + return; + } // validate reusable execution - if (aidlVersion >= kMinAidlLevelForFL8) { - validateReusableExecution(preparedModel, message, request, measure); + validateReusableExecution(preparedModel, message, request, measure); + + // synchronous with empty hints + { + SCOPED_TRACE(message + " [executeSynchronouslyWithConfig]"); + ExecutionResult executionResult; + const auto executeStatus = preparedModel->executeSynchronouslyWithConfig( + request, {measure, kOmittedTimeoutDuration, {}, {}}, kNoDeadline, &executionResult); + ASSERT_FALSE(executeStatus.isOk()); + ASSERT_EQ(executeStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(executeStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); + } + + // fenced with empty hints + { + SCOPED_TRACE(message + " [executeFencedWithConfig]"); + FencedExecutionResult executionResult; + const auto executeStatus = preparedModel->executeFencedWithConfig( + request, {}, {false, kOmittedTimeoutDuration, {}, {}}, kNoDeadline, kNoDuration, + &executionResult); + ASSERT_FALSE(executeStatus.isOk()); + ASSERT_EQ(executeStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(executeStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); + } + + // burst with empty hints + { + SCOPED_TRACE(message + " [burst executeSynchronouslyWithConfig]"); + + // create burst + std::shared_ptr burst; + auto ret = preparedModel->configureExecutionBurst(&burst); + ASSERT_TRUE(ret.isOk()) << ret.getDescription(); + ASSERT_NE(nullptr, burst.get()); + + // use -1 for all memory identifier tokens + const std::vector slots(request.pools.size(), -1); + + ExecutionResult executionResult; + const auto executeStatus = burst->executeSynchronouslyWithConfig( + request, slots, {measure, kOmittedTimeoutDuration, {}, {}}, kNoDeadline, + &executionResult); + ASSERT_FALSE(executeStatus.isOk()); + ASSERT_EQ(executeStatus.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(static_cast(executeStatus.getServiceSpecificError()), + ErrorStatus::INVALID_ARGUMENT); } } diff --git a/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp index c417356005..ad93e6d791 100644 --- a/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp +++ b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp @@ -41,7 +41,8 @@ using implementation::PreparedModelCallback; // internal helper function void createPreparedModel(const std::shared_ptr& device, const Model& model, - std::shared_ptr* preparedModel, bool reportSkipping) { + std::shared_ptr* preparedModel, bool reportSkipping, + bool useConfig) { ASSERT_NE(nullptr, preparedModel); *preparedModel = nullptr; @@ -56,11 +57,25 @@ void createPreparedModel(const std::shared_ptr& device, const Model& mo // launch prepare model const std::shared_ptr preparedModelCallback = ndk::SharedRefBase::make(); - const auto prepareLaunchStatus = - device->prepareModel(model, ExecutionPreference::FAST_SINGLE_ANSWER, kDefaultPriority, - kNoDeadline, {}, {}, kEmptyCacheToken, preparedModelCallback); - ASSERT_TRUE(prepareLaunchStatus.isOk()) << prepareLaunchStatus.getDescription(); - + if (useConfig) { + const auto prepareLaunchStatus = + device->prepareModelWithConfig(model, + {ExecutionPreference::FAST_SINGLE_ANSWER, + kDefaultPriority, + kNoDeadline, + {}, + {}, + kEmptyCacheToken, + {}, + {}}, + preparedModelCallback); + ASSERT_TRUE(prepareLaunchStatus.isOk()) << prepareLaunchStatus.getDescription(); + } else { + const auto prepareLaunchStatus = device->prepareModel( + model, ExecutionPreference::FAST_SINGLE_ANSWER, kDefaultPriority, kNoDeadline, {}, + {}, kEmptyCacheToken, preparedModelCallback); + ASSERT_TRUE(prepareLaunchStatus.isOk()) << prepareLaunchStatus.getDescription(); + } // retrieve prepared model preparedModelCallback->wait(); const ErrorStatus prepareReturnStatus = preparedModelCallback->getStatus(); diff --git a/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h index a900590791..00d705c521 100644 --- a/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h +++ b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.h @@ -51,8 +51,8 @@ std::string printNeuralNetworksAidlTest( // Create an IPreparedModel object. If the model cannot be prepared, // "preparedModel" will be nullptr instead. void createPreparedModel(const std::shared_ptr& device, const Model& model, - std::shared_ptr* preparedModel, - bool reportSkipping = true); + std::shared_ptr* preparedModel, bool reportSkipping = true, + bool useConfig = false); enum class Executor { SYNC, BURST, FENCED }; diff --git a/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/Burst.h b/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/Burst.h index f2687c4a69..8d42e2fc7f 100644 --- a/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/Burst.h +++ b/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/Burst.h @@ -46,6 +46,11 @@ class Burst : public BnBurst { bool measureTiming, int64_t deadlineNs, int64_t loopTimeoutDurationNs, ExecutionResult* executionResult) override; + ndk::ScopedAStatus executeSynchronouslyWithConfig( + const Request& request, const std::vector& memoryIdentifierTokens, + const ExecutionConfig& config, int64_t deadlineNs, + ExecutionResult* executionResult) override; + ndk::ScopedAStatus releaseMemoryResource(int64_t memoryIdentifierToken) override; class ThreadSafeMemoryCache { diff --git a/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/Device.h b/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/Device.h index aa29d63b6b..c94f27085f 100644 --- a/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/Device.h +++ b/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/Device.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -72,6 +73,9 @@ class Device : public BnDevice { const std::vector& dataCache, const std::vector& token, const std::shared_ptr& callback) override; + ndk::ScopedAStatus prepareModelWithConfig( + const Model& model, const PrepareModelConfig& config, + const std::shared_ptr& callback) override; protected: const ::android::nn::SharedDevice kDevice; diff --git a/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/PreparedModel.h b/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/PreparedModel.h index f92b0bc783..d1359d6ac1 100644 --- a/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/PreparedModel.h +++ b/neuralnetworks/utils/adapter/aidl/include/nnapi/hal/aidl/PreparedModel.h @@ -51,9 +51,17 @@ class PreparedModel : public BnPreparedModel { int64_t loopTimeoutDurationNs, int64_t durationNs, FencedExecutionResult* executionResult) override; ndk::ScopedAStatus configureExecutionBurst(std::shared_ptr* burst) override; - ndk::ScopedAStatus createReusableExecution(const Request& request, bool measureTiming, - int64_t loopTimeoutDurationNs, + ndk::ScopedAStatus createReusableExecution(const Request& request, + const ExecutionConfig& config, std::shared_ptr* execution) override; + ndk::ScopedAStatus executeSynchronouslyWithConfig(const Request& request, + const ExecutionConfig& config, + int64_t deadlineNs, + ExecutionResult* executionResult) override; + ndk::ScopedAStatus executeFencedWithConfig( + const Request& request, const std::vector& waitFor, + const ExecutionConfig& config, int64_t deadlineNs, int64_t durationNs, + FencedExecutionResult* executionResult) override; ::android::nn::SharedPreparedModel getUnderlyingPreparedModel() const; diff --git a/neuralnetworks/utils/adapter/aidl/src/Burst.cpp b/neuralnetworks/utils/adapter/aidl/src/Burst.cpp index 4fabb20635..a4a80faf2a 100644 --- a/neuralnetworks/utils/adapter/aidl/src/Burst.cpp +++ b/neuralnetworks/utils/adapter/aidl/src/Burst.cpp @@ -93,7 +93,8 @@ std::vector ensureAllMemoriesAreCached( nn::ExecutionResult executeSynchronously( const nn::IBurst& burst, const Burst::ThreadSafeMemoryCache& cache, const Request& request, const std::vector& memoryIdentifierTokens, bool measureTiming, int64_t deadlineNs, - int64_t loopTimeoutDurationNs) { + int64_t loopTimeoutDurationNs, const std::vector& hints, + const std::vector& extensionNameToPrefix) { if (request.pools.size() != memoryIdentifierTokens.size()) { return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) << "request.pools.size() != memoryIdentifierTokens.size()"; @@ -107,11 +108,13 @@ nn::ExecutionResult executeSynchronously( const auto nnMeasureTiming = measureTiming ? nn::MeasureTiming::YES : nn::MeasureTiming::NO; const auto nnDeadline = NN_TRY(makeOptionalTimePoint(deadlineNs)); const auto nnLoopTimeoutDuration = NN_TRY(makeOptionalDuration(loopTimeoutDurationNs)); + auto nnHints = NN_TRY(convertInput(hints)); + auto nnExtensionNameToPrefix = NN_TRY(convertInput(extensionNameToPrefix)); const auto hold = ensureAllMemoriesAreCached(&nnRequest, memoryIdentifierTokens, burst, cache); - const auto result = - burst.execute(nnRequest, nnMeasureTiming, nnDeadline, nnLoopTimeoutDuration); + const auto result = burst.execute(nnRequest, nnMeasureTiming, nnDeadline, nnLoopTimeoutDuration, + nnHints, nnExtensionNameToPrefix); if (!result.ok() && result.error().code == nn::ErrorStatus::OUTPUT_INSUFFICIENT_SIZE) { const auto& [message, code, outputShapes] = result.error(); @@ -155,7 +158,24 @@ ndk::ScopedAStatus Burst::executeSynchronously(const Request& request, ExecutionResult* executionResult) { auto result = adapter::executeSynchronously(*kBurst, kMemoryCache, request, memoryIdentifierTokens, - measureTiming, deadlineNs, loopTimeoutDurationNs); + measureTiming, deadlineNs, loopTimeoutDurationNs, {}, {}); + if (!result.has_value()) { + auto [message, code, _] = std::move(result).error(); + const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); + return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( + static_cast(aidlCode), message.c_str()); + } + *executionResult = std::move(result).value(); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus Burst::executeSynchronouslyWithConfig( + const Request& request, const std::vector& memoryIdentifierTokens, + const ExecutionConfig& config, int64_t deadlineNs, ExecutionResult* executionResult) { + auto result = adapter::executeSynchronously( + *kBurst, kMemoryCache, request, memoryIdentifierTokens, config.measureTiming, + deadlineNs, config.loopTimeoutDurationNs, config.executionHints, + config.extensionNameToPrefix); if (!result.has_value()) { auto [message, code, _] = std::move(result).error(); const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); diff --git a/neuralnetworks/utils/adapter/aidl/src/Device.cpp b/neuralnetworks/utils/adapter/aidl/src/Device.cpp index 763be7f3fa..84aaddbe9d 100644 --- a/neuralnetworks/utils/adapter/aidl/src/Device.cpp +++ b/neuralnetworks/utils/adapter/aidl/src/Device.cpp @@ -148,13 +148,14 @@ void notify(IPreparedModelCallback* callback, PrepareModelResult result) { } } -nn::GeneralResult prepareModel(const nn::SharedDevice& device, const Executor& executor, - const Model& model, ExecutionPreference preference, - Priority priority, int64_t deadlineNs, - const std::vector& modelCache, - const std::vector& dataCache, - const std::vector& token, - const std::shared_ptr& callback) { +nn::GeneralResult prepareModel( + const nn::SharedDevice& device, const Executor& executor, const Model& model, + ExecutionPreference preference, Priority priority, int64_t deadlineNs, + const std::vector& modelCache, + const std::vector& dataCache, const std::vector& token, + const std::vector& hints, + const std::vector& extensionNameToPrefix, + const std::shared_ptr& callback) { if (callback.get() == nullptr) { return NN_ERROR(nn::ErrorStatus::INVALID_ARGUMENT) << "Invalid callback"; } @@ -166,12 +167,16 @@ nn::GeneralResult prepareModel(const nn::SharedDevice& device, const Execu auto nnModelCache = NN_TRY(convertInput(modelCache)); auto nnDataCache = NN_TRY(convertInput(dataCache)); const auto nnToken = NN_TRY(convertCacheToken(token)); + auto nnHints = NN_TRY(convertInput(hints)); + auto nnExtensionNameToPrefix = NN_TRY(convertInput(extensionNameToPrefix)); Task task = [device, nnModel = std::move(nnModel), nnPreference, nnPriority, nnDeadline, nnModelCache = std::move(nnModelCache), nnDataCache = std::move(nnDataCache), - nnToken, callback] { - auto result = device->prepareModel(nnModel, nnPreference, nnPriority, nnDeadline, - nnModelCache, nnDataCache, nnToken); + nnToken, nnHints = std::move(nnHints), + nnExtensionNameToPrefix = std::move(nnExtensionNameToPrefix), callback] { + auto result = + device->prepareModel(nnModel, nnPreference, nnPriority, nnDeadline, nnModelCache, + nnDataCache, nnToken, nnHints, nnExtensionNameToPrefix); notify(callback.get(), std::move(result)); }; executor(std::move(task), nnDeadline); @@ -273,8 +278,9 @@ ndk::ScopedAStatus Device::prepareModel(const Model& model, ExecutionPreference const std::vector& dataCache, const std::vector& token, const std::shared_ptr& callback) { - const auto result = adapter::prepareModel(kDevice, kExecutor, model, preference, priority, - deadlineNs, modelCache, dataCache, token, callback); + const auto result = + adapter::prepareModel(kDevice, kExecutor, model, preference, priority, deadlineNs, + modelCache, dataCache, token, {}, {}, callback); if (!result.has_value()) { const auto& [message, code] = result.error(); const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); @@ -301,4 +307,21 @@ ndk::ScopedAStatus Device::prepareModelFromCache( return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Device::prepareModelWithConfig( + const Model& model, const PrepareModelConfig& config, + const std::shared_ptr& callback) { + const auto result = adapter::prepareModel( + kDevice, kExecutor, model, config.preference, config.priority, config.deadlineNs, + config.modelCache, config.dataCache, config.cacheToken, config.compilationHints, + config.extensionNameToPrefix, callback); + if (!result.has_value()) { + const auto& [message, code] = result.error(); + const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); + callback->notify(aidlCode, nullptr); + return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( + static_cast(aidlCode), message.c_str()); + } + return ndk::ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::neuralnetworks::adapter diff --git a/neuralnetworks/utils/adapter/aidl/src/PreparedModel.cpp b/neuralnetworks/utils/adapter/aidl/src/PreparedModel.cpp index 5cab62c625..790558fde4 100644 --- a/neuralnetworks/utils/adapter/aidl/src/PreparedModel.cpp +++ b/neuralnetworks/utils/adapter/aidl/src/PreparedModel.cpp @@ -118,17 +118,20 @@ nn::GeneralResult makeOptionalTimePoint(int64_t durationN return durationNs < 0 ? nn::OptionalTimePoint{} : nn::TimePoint(makeDuration(durationNs)); } -nn::ExecutionResult executeSynchronously(const nn::IPreparedModel& preparedModel, - const Request& request, - bool measureTiming, int64_t deadlineNs, - int64_t loopTimeoutDurationNs) { +nn::ExecutionResult executeSynchronously( + const nn::IPreparedModel& preparedModel, const Request& request, bool measureTiming, + int64_t deadlineNs, int64_t loopTimeoutDurationNs, const std::vector& hints, + const std::vector& extensionNameToPrefix) { const auto nnRequest = NN_TRY(convertInput(request)); const auto nnMeasureTiming = measureTiming ? nn::MeasureTiming::YES : nn::MeasureTiming::NO; const auto nnDeadline = NN_TRY(makeOptionalTimePoint(deadlineNs)); const auto nnLoopTimeoutDuration = NN_TRY(makeOptionalDuration(loopTimeoutDurationNs)); + auto nnHints = NN_TRY(convertInput(hints)); + auto nnExtensionNameToPrefix = NN_TRY(convertInput(extensionNameToPrefix)); const auto result = - preparedModel.execute(nnRequest, nnMeasureTiming, nnDeadline, nnLoopTimeoutDuration); + preparedModel.execute(nnRequest, nnMeasureTiming, nnDeadline, nnLoopTimeoutDuration, + nnHints, nnExtensionNameToPrefix); if (!result.ok() && result.error().code == nn::ErrorStatus::OUTPUT_INSUFFICIENT_SIZE) { const auto& [message, code, outputShapes] = result.error(); @@ -147,16 +150,21 @@ nn::ExecutionResult executeSynchronously(const nn::IPreparedMod nn::GeneralResult executeFenced( const nn::IPreparedModel& preparedModel, const Request& request, const std::vector& waitFor, bool measureTiming, - int64_t deadlineNs, int64_t loopTimeoutDurationNs, int64_t durationNs) { + int64_t deadlineNs, int64_t loopTimeoutDurationNs, int64_t durationNs, + const std::vector& hints, + const std::vector& extensionNameToPrefix) { const auto nnRequest = NN_TRY(convertInput(request)); const auto nnWaitFor = NN_TRY(convertSyncFences(waitFor)); const auto nnMeasureTiming = measureTiming ? nn::MeasureTiming::YES : nn::MeasureTiming::NO; const auto nnDeadline = NN_TRY(makeOptionalTimePoint(deadlineNs)); const auto nnLoopTimeoutDuration = NN_TRY(makeOptionalDuration(loopTimeoutDurationNs)); const auto nnDuration = NN_TRY(makeOptionalDuration(durationNs)); + auto nnHints = NN_TRY(convertInput(hints)); + auto nnExtensionNameToPrefix = NN_TRY(convertInput(extensionNameToPrefix)); auto [syncFence, executeFencedInfoCallback] = NN_TRY(preparedModel.executeFenced( - nnRequest, nnWaitFor, nnMeasureTiming, nnDeadline, nnLoopTimeoutDuration, nnDuration)); + nnRequest, nnWaitFor, nnMeasureTiming, nnDeadline, nnLoopTimeoutDuration, nnDuration, + nnHints, nnExtensionNameToPrefix)); ndk::ScopedFileDescriptor fileDescriptor; if (syncFence.hasFd()) { @@ -171,11 +179,16 @@ nn::GeneralResult executeFenced( nn::GeneralResult createReusableExecution( const nn::IPreparedModel& preparedModel, const Request& request, bool measureTiming, - int64_t loopTimeoutDurationNs) { + int64_t loopTimeoutDurationNs, const std::vector& hints, + const std::vector& extensionNameToPrefix) { const auto nnRequest = NN_TRY(convertInput(request)); const auto nnMeasureTiming = measureTiming ? nn::MeasureTiming::YES : nn::MeasureTiming::NO; const auto nnLoopTimeoutDuration = NN_TRY(makeOptionalDuration(loopTimeoutDurationNs)); - return preparedModel.createReusableExecution(nnRequest, nnMeasureTiming, nnLoopTimeoutDuration); + auto nnHints = NN_TRY(convertInput(hints)); + auto nnExtensionNameToPrefix = NN_TRY(convertInput(extensionNameToPrefix)); + + return preparedModel.createReusableExecution(nnRequest, nnMeasureTiming, nnLoopTimeoutDuration, + nnHints, nnExtensionNameToPrefix); } nn::ExecutionResult executeSynchronously(const nn::IExecution& execution, @@ -231,7 +244,7 @@ ndk::ScopedAStatus PreparedModel::executeSynchronously(const Request& request, b int64_t loopTimeoutDurationNs, ExecutionResult* executionResult) { auto result = adapter::executeSynchronously(*kPreparedModel, request, measureTiming, deadlineNs, - loopTimeoutDurationNs); + loopTimeoutDurationNs, {}, {}); if (!result.has_value()) { const auto& [message, code, _] = result.error(); const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); @@ -247,7 +260,41 @@ ndk::ScopedAStatus PreparedModel::executeFenced( bool measureTiming, int64_t deadlineNs, int64_t loopTimeoutDurationNs, int64_t durationNs, FencedExecutionResult* executionResult) { auto result = adapter::executeFenced(*kPreparedModel, request, waitFor, measureTiming, - deadlineNs, loopTimeoutDurationNs, durationNs); + deadlineNs, loopTimeoutDurationNs, durationNs, {}, {}); + if (!result.has_value()) { + const auto& [message, code] = result.error(); + const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); + return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( + static_cast(aidlCode), message.c_str()); + } + *executionResult = std::move(result).value(); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus PreparedModel::executeSynchronouslyWithConfig(const Request& request, + const ExecutionConfig& config, + int64_t deadlineNs, + ExecutionResult* executionResult) { + auto result = adapter::executeSynchronously( + *kPreparedModel, request, config.measureTiming, deadlineNs, + config.loopTimeoutDurationNs, config.executionHints, config.extensionNameToPrefix); + if (!result.has_value()) { + const auto& [message, code, _] = result.error(); + const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); + return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( + static_cast(aidlCode), message.c_str()); + } + *executionResult = std::move(result).value(); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus PreparedModel::executeFencedWithConfig( + const Request& request, const std::vector& waitFor, + const ExecutionConfig& config, int64_t deadlineNs, int64_t durationNs, + FencedExecutionResult* executionResult) { + auto result = adapter::executeFenced(*kPreparedModel, request, waitFor, config.measureTiming, + deadlineNs, config.loopTimeoutDurationNs, durationNs, + config.executionHints, config.extensionNameToPrefix); if (!result.has_value()) { const auto& [message, code] = result.error(); const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); @@ -275,11 +322,11 @@ nn::SharedPreparedModel PreparedModel::getUnderlyingPreparedModel() const { } ndk::ScopedAStatus PreparedModel::createReusableExecution(const Request& request, - bool measureTiming, - int64_t loopTimeoutDurationNs, + const ExecutionConfig& config, std::shared_ptr* execution) { - auto result = adapter::createReusableExecution(*kPreparedModel, request, measureTiming, - loopTimeoutDurationNs); + auto result = adapter::createReusableExecution( + *kPreparedModel, request, config.measureTiming, config.loopTimeoutDurationNs, + config.executionHints, config.extensionNameToPrefix); if (!result.has_value()) { const auto& [message, code] = result.error(); const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); diff --git a/neuralnetworks/utils/adapter/hidl/src/Burst.cpp b/neuralnetworks/utils/adapter/hidl/src/Burst.cpp index 8b2e1dd465..e3b165b1a4 100644 --- a/neuralnetworks/utils/adapter/hidl/src/Burst.cpp +++ b/neuralnetworks/utils/adapter/hidl/src/Burst.cpp @@ -250,7 +250,7 @@ nn::ExecutionResult, V1_2::Timing>> Burst: nn::MeasureTiming canonicalMeasure = NN_TRY(nn::convert(measure)); const auto [outputShapes, timing] = - NN_TRY(mBurstExecutor->execute(canonicalRequest, canonicalMeasure, {}, {})); + NN_TRY(mBurstExecutor->execute(canonicalRequest, canonicalMeasure, {}, {}, {}, {})); return std::make_pair(NN_TRY(V1_2::utils::convert(outputShapes)), NN_TRY(V1_2::utils::convert(timing))); diff --git a/neuralnetworks/utils/adapter/hidl/src/Device.cpp b/neuralnetworks/utils/adapter/hidl/src/Device.cpp index 4993a80a93..0f44638722 100644 --- a/neuralnetworks/utils/adapter/hidl/src/Device.cpp +++ b/neuralnetworks/utils/adapter/hidl/src/Device.cpp @@ -135,7 +135,7 @@ nn::GeneralResult prepareModel(const nn::SharedDevice& device, const Execu Task task = [device, nnModel = std::move(nnModel), executor, callback] { auto result = device->prepareModel(nnModel, nn::ExecutionPreference::DEFAULT, - nn::Priority::DEFAULT, {}, {}, {}, {}); + nn::Priority::DEFAULT, {}, {}, {}, {}, {}, {}); notify(callback.get(), std::move(result), executor); }; executor(std::move(task), {}); @@ -155,8 +155,8 @@ nn::GeneralResult prepareModel_1_1(const nn::SharedDevice& device, const E const auto nnPreference = NN_TRY(convertInput(preference)); Task task = [device, nnModel = std::move(nnModel), nnPreference, executor, callback] { - auto result = - device->prepareModel(nnModel, nnPreference, nn::Priority::DEFAULT, {}, {}, {}, {}); + auto result = device->prepareModel(nnModel, nnPreference, nn::Priority::DEFAULT, {}, {}, {}, + {}, {}, {}); notify(callback.get(), std::move(result), executor); }; executor(std::move(task), {}); @@ -185,7 +185,7 @@ nn::GeneralResult prepareModel_1_2(const nn::SharedDevice& device, const E nnModelCache = std::move(nnModelCache), nnDataCache = std::move(nnDataCache), nnToken, executor, callback] { auto result = device->prepareModel(nnModel, nnPreference, nn::Priority::DEFAULT, {}, - nnModelCache, nnDataCache, nnToken); + nnModelCache, nnDataCache, nnToken, {}, {}); notify(callback.get(), std::move(result), executor); }; executor(std::move(task), {}); @@ -215,7 +215,7 @@ nn::GeneralResult prepareModel_1_3( nnModelCache = std::move(nnModelCache), nnDataCache = std::move(nnDataCache), nnToken, executor, callback] { auto result = device->prepareModel(nnModel, nnPreference, nnPriority, nnDeadline, - nnModelCache, nnDataCache, nnToken); + nnModelCache, nnDataCache, nnToken, {}, {}); notify(callback.get(), std::move(result), executor); }; executor(std::move(task), nnDeadline); diff --git a/neuralnetworks/utils/adapter/hidl/src/PreparedModel.cpp b/neuralnetworks/utils/adapter/hidl/src/PreparedModel.cpp index 71060d5ca7..c6055a6747 100644 --- a/neuralnetworks/utils/adapter/hidl/src/PreparedModel.cpp +++ b/neuralnetworks/utils/adapter/hidl/src/PreparedModel.cpp @@ -159,7 +159,7 @@ nn::GeneralResult execute(const nn::SharedPreparedModel& preparedModel, } Task task = [preparedModel, nnRequest = std::move(nnRequest), callback] { - auto result = preparedModel->execute(nnRequest, nn::MeasureTiming::NO, {}, {}); + auto result = preparedModel->execute(nnRequest, nn::MeasureTiming::NO, {}, {}, {}, {}); notify(callback.get(), std::move(result)); }; executor(std::move(task), {}); @@ -185,7 +185,7 @@ nn::GeneralResult execute_1_2(const nn::SharedPreparedModel& preparedModel } Task task = [preparedModel, nnRequest = std::move(nnRequest), nnMeasure, callback] { - auto result = preparedModel->execute(nnRequest, nnMeasure, {}, {}); + auto result = preparedModel->execute(nnRequest, nnMeasure, {}, {}, {}, {}); notify(callback.get(), std::move(result)); }; executor(std::move(task), {}); @@ -216,8 +216,8 @@ nn::GeneralResult execute_1_3(const nn::SharedPreparedModel& preparedModel Task task = [preparedModel, nnRequest = std::move(nnRequest), nnMeasure, nnDeadline, nnLoopTimeoutDuration, callback] { - auto result = - preparedModel->execute(nnRequest, nnMeasure, nnDeadline, nnLoopTimeoutDuration); + auto result = preparedModel->execute(nnRequest, nnMeasure, nnDeadline, + nnLoopTimeoutDuration, {}, {}); notify(callback.get(), std::move(result)); }; executor(std::move(task), nnDeadline); @@ -232,7 +232,7 @@ nn::ExecutionResult, V1_2::Timing>> execut const auto nnMeasure = NN_TRY(convertInput(measure)); const auto [outputShapes, timing] = - NN_TRY(preparedModel->execute(nnRequest, nnMeasure, {}, {})); + NN_TRY(preparedModel->execute(nnRequest, nnMeasure, {}, {}, {}, {})); auto hidlOutputShapes = NN_TRY(V1_2::utils::convert(outputShapes)); const auto hidlTiming = NN_TRY(V1_2::utils::convert(timing)); @@ -248,8 +248,8 @@ nn::ExecutionResult, V1_2::Timing>> execut const auto nnDeadline = NN_TRY(convertInput(deadline)); const auto nnLoopTimeoutDuration = NN_TRY(convertInput(loopTimeoutDuration)); - const auto [outputShapes, timing] = - NN_TRY(preparedModel->execute(nnRequest, nnMeasure, nnDeadline, nnLoopTimeoutDuration)); + const auto [outputShapes, timing] = NN_TRY(preparedModel->execute( + nnRequest, nnMeasure, nnDeadline, nnLoopTimeoutDuration, {}, {})); auto hidlOutputShapes = NN_TRY(V1_3::utils::convert(outputShapes)); const auto hidlTiming = NN_TRY(V1_3::utils::convert(timing)); @@ -293,8 +293,9 @@ nn::GeneralResult>> ex const auto nnLoopTimeoutDuration = NN_TRY(convertInput(loopTimeoutDuration)); const auto nnDuration = NN_TRY(convertInput(duration)); - auto [syncFence, executeFencedCallback] = NN_TRY(preparedModel->executeFenced( - nnRequest, nnWaitFor, nnMeasure, nnDeadline, nnLoopTimeoutDuration, nnDuration)); + auto [syncFence, executeFencedCallback] = + NN_TRY(preparedModel->executeFenced(nnRequest, nnWaitFor, nnMeasure, nnDeadline, + nnLoopTimeoutDuration, nnDuration, {}, {})); auto hidlSyncFence = NN_TRY(V1_3::utils::convert(syncFence.getSharedHandle())); auto hidlExecuteFencedCallback = sp::make(executeFencedCallback); diff --git a/neuralnetworks/utils/common/include/nnapi/hal/InvalidBurst.h b/neuralnetworks/utils/common/include/nnapi/hal/InvalidBurst.h index e86eddab88..1f1245f1bd 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/InvalidBurst.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/InvalidBurst.h @@ -33,12 +33,15 @@ class InvalidBurst final : public nn::IBurst { nn::ExecutionResult, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; }; } // namespace android::hardware::neuralnetworks::utils diff --git a/neuralnetworks/utils/common/include/nnapi/hal/InvalidDevice.h b/neuralnetworks/utils/common/include/nnapi/hal/InvalidDevice.h index 5e62b9ae0b..9582873009 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/InvalidDevice.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/InvalidDevice.h @@ -52,8 +52,9 @@ class InvalidDevice final : public nn::IDevice { nn::GeneralResult prepareModel( const nn::Model& model, nn::ExecutionPreference preference, nn::Priority priority, nn::OptionalTimePoint deadline, const std::vector& modelCache, - const std::vector& dataCache, - const nn::CacheToken& token) const override; + const std::vector& dataCache, const nn::CacheToken& token, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult prepareModelFromCache( nn::OptionalTimePoint deadline, const std::vector& modelCache, diff --git a/neuralnetworks/utils/common/include/nnapi/hal/InvalidPreparedModel.h b/neuralnetworks/utils/common/include/nnapi/hal/InvalidPreparedModel.h index de30aaefc9..3f1f2904d8 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/InvalidPreparedModel.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/InvalidPreparedModel.h @@ -31,18 +31,23 @@ class InvalidPreparedModel final : public nn::IPreparedModel { public: nn::ExecutionResult, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult> executeFenced( const nn::Request& request, const std::vector& waitFor, nn::MeasureTiming measure, const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, - const nn::OptionalDuration& timeoutDurationAfterFence) const override; + const nn::OptionalDuration& timeoutDurationAfterFence, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult configureExecutionBurst() const override; diff --git a/neuralnetworks/utils/common/include/nnapi/hal/ResilientBurst.h b/neuralnetworks/utils/common/include/nnapi/hal/ResilientBurst.h index fde2486a53..129431f3cf 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/ResilientBurst.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/ResilientBurst.h @@ -48,18 +48,23 @@ class ResilientBurst final : public nn::IBurst, nn::ExecutionResult, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; private: bool isValidInternal() const EXCLUDES(mMutex); nn::GeneralResult createReusableExecutionInternal( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const; + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const; const Factory kMakeBurst; mutable std::mutex mMutex; diff --git a/neuralnetworks/utils/common/include/nnapi/hal/ResilientDevice.h b/neuralnetworks/utils/common/include/nnapi/hal/ResilientDevice.h index 84ae799aad..267d6346cf 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/ResilientDevice.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/ResilientDevice.h @@ -65,8 +65,9 @@ class ResilientDevice final : public nn::IDevice, nn::GeneralResult prepareModel( const nn::Model& model, nn::ExecutionPreference preference, nn::Priority priority, nn::OptionalTimePoint deadline, const std::vector& modelCache, - const std::vector& dataCache, - const nn::CacheToken& token) const override; + const std::vector& dataCache, const nn::CacheToken& token, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult prepareModelFromCache( nn::OptionalTimePoint deadline, const std::vector& modelCache, @@ -83,7 +84,9 @@ class ResilientDevice final : public nn::IDevice, nn::GeneralResult prepareModelInternal( const nn::Model& model, nn::ExecutionPreference preference, nn::Priority priority, nn::OptionalTimePoint deadline, const std::vector& modelCache, - const std::vector& dataCache, const nn::CacheToken& token) const; + const std::vector& dataCache, const nn::CacheToken& token, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const; nn::GeneralResult prepareModelFromCacheInternal( nn::OptionalTimePoint deadline, const std::vector& modelCache, const std::vector& dataCache, const nn::CacheToken& token) const; diff --git a/neuralnetworks/utils/common/include/nnapi/hal/ResilientPreparedModel.h b/neuralnetworks/utils/common/include/nnapi/hal/ResilientPreparedModel.h index 86533edd12..bbfc220a3b 100644 --- a/neuralnetworks/utils/common/include/nnapi/hal/ResilientPreparedModel.h +++ b/neuralnetworks/utils/common/include/nnapi/hal/ResilientPreparedModel.h @@ -49,18 +49,23 @@ class ResilientPreparedModel final : public nn::IPreparedModel, nn::ExecutionResult, nn::Timing>> execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult> executeFenced( const nn::Request& request, const std::vector& waitFor, nn::MeasureTiming measure, const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, - const nn::OptionalDuration& timeoutDurationAfterFence) const override; + const nn::OptionalDuration& timeoutDurationAfterFence, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const override; + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const override; nn::GeneralResult configureExecutionBurst() const override; @@ -70,7 +75,9 @@ class ResilientPreparedModel final : public nn::IPreparedModel, bool isValidInternal() const EXCLUDES(mMutex); nn::GeneralResult createReusableExecutionInternal( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const; + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& metaData, + const std::vector& extensionNameToPrefix) const; nn::GeneralResult configureExecutionBurstInternal() const; const Factory kMakePreparedModel; diff --git a/neuralnetworks/utils/common/src/InvalidBurst.cpp b/neuralnetworks/utils/common/src/InvalidBurst.cpp index 01915337c4..3fdfb5cec3 100644 --- a/neuralnetworks/utils/common/src/InvalidBurst.cpp +++ b/neuralnetworks/utils/common/src/InvalidBurst.cpp @@ -34,13 +34,17 @@ InvalidBurst::OptionalCacheHold InvalidBurst::cacheMemory( nn::ExecutionResult, nn::Timing>> InvalidBurst::execute( const nn::Request& /*request*/, nn::MeasureTiming /*measure*/, const nn::OptionalTimePoint& /*deadline*/, - const nn::OptionalDuration& /*loopTimeoutDuration*/) const { + const nn::OptionalDuration& /*loopTimeoutDuration*/, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { return NN_ERROR() << "InvalidBurst"; } nn::GeneralResult InvalidBurst::createReusableExecution( const nn::Request& /*request*/, nn::MeasureTiming /*measure*/, - const nn::OptionalDuration& /*loopTimeoutDuration*/) const { + const nn::OptionalDuration& /*loopTimeoutDuration*/, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { return NN_ERROR() << "InvalidBurst"; } diff --git a/neuralnetworks/utils/common/src/InvalidDevice.cpp b/neuralnetworks/utils/common/src/InvalidDevice.cpp index 535ccb41c7..c8cc287573 100644 --- a/neuralnetworks/utils/common/src/InvalidDevice.cpp +++ b/neuralnetworks/utils/common/src/InvalidDevice.cpp @@ -84,7 +84,9 @@ nn::GeneralResult InvalidDevice::prepareModel( const nn::Model& /*model*/, nn::ExecutionPreference /*preference*/, nn::Priority /*priority*/, nn::OptionalTimePoint /*deadline*/, const std::vector& /*modelCache*/, - const std::vector& /*dataCache*/, const nn::CacheToken& /*token*/) const { + const std::vector& /*dataCache*/, const nn::CacheToken& /*token*/, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { return NN_ERROR() << "InvalidDevice"; } diff --git a/neuralnetworks/utils/common/src/InvalidPreparedModel.cpp b/neuralnetworks/utils/common/src/InvalidPreparedModel.cpp index 8195462ba8..f6f978d8c8 100644 --- a/neuralnetworks/utils/common/src/InvalidPreparedModel.cpp +++ b/neuralnetworks/utils/common/src/InvalidPreparedModel.cpp @@ -27,9 +27,12 @@ namespace android::hardware::neuralnetworks::utils { nn::ExecutionResult, nn::Timing>> -InvalidPreparedModel::execute(const nn::Request& /*request*/, nn::MeasureTiming /*measure*/, - const nn::OptionalTimePoint& /*deadline*/, - const nn::OptionalDuration& /*loopTimeoutDuration*/) const { +InvalidPreparedModel::execute( + const nn::Request& /*request*/, nn::MeasureTiming /*measure*/, + const nn::OptionalTimePoint& /*deadline*/, + const nn::OptionalDuration& /*loopTimeoutDuration*/, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { return NN_ERROR() << "InvalidPreparedModel"; } @@ -38,13 +41,17 @@ InvalidPreparedModel::executeFenced( const nn::Request& /*request*/, const std::vector& /*waitFor*/, nn::MeasureTiming /*measure*/, const nn::OptionalTimePoint& /*deadline*/, const nn::OptionalDuration& /*loopTimeoutDuration*/, - const nn::OptionalDuration& /*timeoutDurationAfterFence*/) const { + const nn::OptionalDuration& /*timeoutDurationAfterFence*/, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { return NN_ERROR() << "InvalidPreparedModel"; } nn::GeneralResult InvalidPreparedModel::createReusableExecution( const nn::Request& /*request*/, nn::MeasureTiming /*measure*/, - const nn::OptionalDuration& /*loopTimeoutDuration*/) const { + const nn::OptionalDuration& /*loopTimeoutDuration*/, + const std::vector& /*hints*/, + const std::vector& /*extensionNameToPrefix*/) const { return NN_ERROR() << "InvalidPreparedModel"; } diff --git a/neuralnetworks/utils/common/src/ResilientBurst.cpp b/neuralnetworks/utils/common/src/ResilientBurst.cpp index 79cbe3991f..bf7a8ea130 100644 --- a/neuralnetworks/utils/common/src/ResilientBurst.cpp +++ b/neuralnetworks/utils/common/src/ResilientBurst.cpp @@ -105,37 +105,49 @@ ResilientBurst::OptionalCacheHold ResilientBurst::cacheMemory( nn::ExecutionResult, nn::Timing>> ResilientBurst::execute( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const { - const auto fn = [&request, measure, deadline, loopTimeoutDuration](const nn::IBurst& burst) { - return burst.execute(request, measure, deadline, loopTimeoutDuration); + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { + const auto fn = [&request, measure, deadline, loopTimeoutDuration, &hints, + &extensionNameToPrefix](const nn::IBurst& burst) { + return burst.execute(request, measure, deadline, loopTimeoutDuration, hints, + extensionNameToPrefix); }; return protect(*this, fn); } nn::GeneralResult ResilientBurst::createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const { + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { #if 0 auto self = shared_from_this(); - ResilientExecution::Factory makeExecution = - [burst = std::move(self), request, measure, loopTimeoutDuration] { - return burst->createReusableExecutionInternal(request, measure, loopTimeoutDuration); + ResilientExecution::Factory makeExecution = [burst = std::move(self), request, measure, + loopTimeoutDuration, &hints, + &extensionNameToPrefix] { + return burst->createReusableExecutionInternal(request, measure, loopTimeoutDuration, hints, + extensionNameToPrefix); }; return ResilientExecution::create(std::move(makeExecution)); #else - return createReusableExecutionInternal(request, measure, loopTimeoutDuration); + return createReusableExecutionInternal(request, measure, loopTimeoutDuration, hints, + extensionNameToPrefix); #endif } nn::GeneralResult ResilientBurst::createReusableExecutionInternal( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const { + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { if (!isValidInternal()) { return std::make_shared(); } - const auto fn = [&request, measure, &loopTimeoutDuration](const nn::IBurst& burst) { - return burst.createReusableExecution(request, measure, loopTimeoutDuration); + const auto fn = [&request, measure, &loopTimeoutDuration, &hints, + &extensionNameToPrefix](const nn::IBurst& burst) { + return burst.createReusableExecution(request, measure, loopTimeoutDuration, hints, + extensionNameToPrefix); }; return protect(*this, fn); } diff --git a/neuralnetworks/utils/common/src/ResilientDevice.cpp b/neuralnetworks/utils/common/src/ResilientDevice.cpp index 2023c9af30..a5c2640b76 100644 --- a/neuralnetworks/utils/common/src/ResilientDevice.cpp +++ b/neuralnetworks/utils/common/src/ResilientDevice.cpp @@ -179,19 +179,21 @@ nn::GeneralResult> ResilientDevice::getSupportedOperations( nn::GeneralResult ResilientDevice::prepareModel( const nn::Model& model, nn::ExecutionPreference preference, nn::Priority priority, nn::OptionalTimePoint deadline, const std::vector& modelCache, - const std::vector& dataCache, const nn::CacheToken& token) const { + const std::vector& dataCache, const nn::CacheToken& token, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { #if 0 auto self = shared_from_this(); ResilientPreparedModel::Factory makePreparedModel = [device = std::move(self), model, preference, priority, deadline, modelCache, - dataCache, token] { + dataCache, token, hints, extensionNameToPrefix] { return device->prepareModelInternal(model, preference, priority, deadline, modelCache, - dataCache, token); + dataCache, token, hints, extensionNameToPrefix); }; return ResilientPreparedModel::create(std::move(makePreparedModel)); #else - return prepareModelInternal(model, preference, priority, deadline, modelCache, dataCache, - token); + return prepareModelInternal(model, preference, priority, deadline, modelCache, dataCache, token, + hints, extensionNameToPrefix); #endif } @@ -234,14 +236,16 @@ bool ResilientDevice::isValidInternal() const { nn::GeneralResult ResilientDevice::prepareModelInternal( const nn::Model& model, nn::ExecutionPreference preference, nn::Priority priority, nn::OptionalTimePoint deadline, const std::vector& modelCache, - const std::vector& dataCache, const nn::CacheToken& token) const { + const std::vector& dataCache, const nn::CacheToken& token, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { if (!isValidInternal()) { return std::make_shared(); } - const auto fn = [&model, preference, priority, &deadline, &modelCache, &dataCache, - &token](const nn::IDevice& device) { + const auto fn = [&model, preference, priority, &deadline, &modelCache, &dataCache, &token, + &hints, &extensionNameToPrefix](const nn::IDevice& device) { return device.prepareModel(model, preference, priority, deadline, modelCache, dataCache, - token); + token, hints, extensionNameToPrefix); }; return protect(*this, fn, /*blocking=*/false); } diff --git a/neuralnetworks/utils/common/src/ResilientPreparedModel.cpp b/neuralnetworks/utils/common/src/ResilientPreparedModel.cpp index 1ae19bc6ca..b5843c0fd4 100644 --- a/neuralnetworks/utils/common/src/ResilientPreparedModel.cpp +++ b/neuralnetworks/utils/common/src/ResilientPreparedModel.cpp @@ -104,43 +104,53 @@ nn::GeneralResult ResilientPreparedModel::recover( } nn::ExecutionResult, nn::Timing>> -ResilientPreparedModel::execute(const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration) const { - const auto fn = [&request, measure, &deadline, - &loopTimeoutDuration](const nn::IPreparedModel& preparedModel) { - return preparedModel.execute(request, measure, deadline, loopTimeoutDuration); +ResilientPreparedModel::execute( + const nn::Request& request, nn::MeasureTiming measure, + const nn::OptionalTimePoint& deadline, const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { + const auto fn = [&request, measure, &deadline, &loopTimeoutDuration, &hints, + &extensionNameToPrefix](const nn::IPreparedModel& preparedModel) { + return preparedModel.execute(request, measure, deadline, loopTimeoutDuration, hints, + extensionNameToPrefix); }; return protect(*this, fn); } nn::GeneralResult> -ResilientPreparedModel::executeFenced(const nn::Request& request, - const std::vector& waitFor, - nn::MeasureTiming measure, - const nn::OptionalTimePoint& deadline, - const nn::OptionalDuration& loopTimeoutDuration, - const nn::OptionalDuration& timeoutDurationAfterFence) const { +ResilientPreparedModel::executeFenced( + const nn::Request& request, const std::vector& waitFor, + nn::MeasureTiming measure, const nn::OptionalTimePoint& deadline, + const nn::OptionalDuration& loopTimeoutDuration, + const nn::OptionalDuration& timeoutDurationAfterFence, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { const auto fn = [&request, &waitFor, measure, &deadline, &loopTimeoutDuration, - &timeoutDurationAfterFence](const nn::IPreparedModel& preparedModel) { + &timeoutDurationAfterFence, &hints, + &extensionNameToPrefix](const nn::IPreparedModel& preparedModel) { return preparedModel.executeFenced(request, waitFor, measure, deadline, loopTimeoutDuration, - timeoutDurationAfterFence); + timeoutDurationAfterFence, hints, extensionNameToPrefix); }; return protect(*this, fn); } nn::GeneralResult ResilientPreparedModel::createReusableExecution( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const { + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { #if 0 auto self = shared_from_this(); - ResilientExecution::Factory makeExecution = - [preparedModel = std::move(self), request, measure, loopTimeoutDuration] { - return preparedModel->createReusableExecutionInternal(request, measure, loopTimeoutDuration); + ResilientExecution::Factory makeExecution = [preparedModel = std::move(self), request, measure, + loopTimeoutDuration, hints, + extensionNameToPrefix] { + return preparedModel->createReusableExecutionInternal(request, measure, loopTimeoutDuration, + hints, extensionNameToPrefix); }; return ResilientExecution::create(std::move(makeExecution)); #else - return createReusableExecutionInternal(request, measure, loopTimeoutDuration); + return createReusableExecutionInternal(request, measure, loopTimeoutDuration, hints, + extensionNameToPrefix); #endif } @@ -159,13 +169,16 @@ nn::GeneralResult ResilientPreparedModel::configureExecutionBur nn::GeneralResult ResilientPreparedModel::createReusableExecutionInternal( const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration) const { + const nn::OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix) const { if (!isValidInternal()) { return std::make_shared(); } - const auto fn = [&request, measure, - &loopTimeoutDuration](const nn::IPreparedModel& preparedModel) { - return preparedModel.createReusableExecution(request, measure, loopTimeoutDuration); + const auto fn = [&request, measure, &loopTimeoutDuration, &hints, + &extensionNameToPrefix](const nn::IPreparedModel& preparedModel) { + return preparedModel.createReusableExecution(request, measure, loopTimeoutDuration, hints, + extensionNameToPrefix); }; return protect(*this, fn); } diff --git a/neuralnetworks/utils/common/test/MockDevice.h b/neuralnetworks/utils/common/test/MockDevice.h index a9428bccfc..a0fc5c3de1 100644 --- a/neuralnetworks/utils/common/test/MockDevice.h +++ b/neuralnetworks/utils/common/test/MockDevice.h @@ -39,7 +39,9 @@ class MockDevice final : public IDevice { MOCK_METHOD(GeneralResult, prepareModel, (const Model& model, ExecutionPreference preference, Priority priority, OptionalTimePoint deadline, const std::vector& modelCache, - const std::vector& dataCache, const CacheToken& token), + const std::vector& dataCache, const CacheToken& token, + const std::vector& hints, + const std::vector& extensionNameToPrefix), (const, override)); MOCK_METHOD(GeneralResult, prepareModelFromCache, (OptionalTimePoint deadline, const std::vector& modelCache, diff --git a/neuralnetworks/utils/common/test/MockPreparedModel.h b/neuralnetworks/utils/common/test/MockPreparedModel.h index c8ce006171..b8613b226c 100644 --- a/neuralnetworks/utils/common/test/MockPreparedModel.h +++ b/neuralnetworks/utils/common/test/MockPreparedModel.h @@ -27,17 +27,23 @@ class MockPreparedModel final : public IPreparedModel { public: MOCK_METHOD((ExecutionResult, Timing>>), execute, (const Request& request, MeasureTiming measure, const OptionalTimePoint& deadline, - const OptionalDuration& loopTimeoutDuration), + const OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix), (const, override)); MOCK_METHOD((GeneralResult>), executeFenced, (const Request& request, const std::vector& waitFor, MeasureTiming measure, const OptionalTimePoint& deadline, const OptionalDuration& loopTimeoutDuration, - const OptionalDuration& timeoutDurationAfterFence), + const OptionalDuration& timeoutDurationAfterFence, + const std::vector& hints, + const std::vector& extensionNameToPrefix), (const, override)); MOCK_METHOD((GeneralResult), createReusableExecution, - (const nn::Request& request, nn::MeasureTiming measure, - const nn::OptionalDuration& loopTimeoutDuration), + (const Request& request, MeasureTiming measure, + const OptionalDuration& loopTimeoutDuration, + const std::vector& hints, + const std::vector& extensionNameToPrefix), (const, override)); MOCK_METHOD(GeneralResult, configureExecutionBurst, (), (const, override)); MOCK_METHOD(std::any, getUnderlyingResource, (), (const, override)); diff --git a/neuralnetworks/utils/common/test/ResilientDeviceTest.cpp b/neuralnetworks/utils/common/test/ResilientDeviceTest.cpp index 0488b6359b..d9b8505c0e 100644 --- a/neuralnetworks/utils/common/test/ResilientDeviceTest.cpp +++ b/neuralnetworks/utils/common/test/ResilientDeviceTest.cpp @@ -309,12 +309,12 @@ TEST(ResilientDeviceTest, prepareModel) { // setup call const auto [mockDevice, mockDeviceFactory, device] = setup(); const auto mockPreparedModel = std::make_shared(); - EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _)) + EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _, _, _)) .Times(1) .WillOnce(Return(mockPreparedModel)); // run test - const auto result = device->prepareModel({}, {}, {}, {}, {}, {}, {}); + const auto result = device->prepareModel({}, {}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -324,12 +324,12 @@ TEST(ResilientDeviceTest, prepareModel) { TEST(ResilientDeviceTest, prepareModelError) { // setup call const auto [mockDevice, mockDeviceFactory, device] = setup(); - EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _)) + EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _, _, _)) .Times(1) .WillOnce(kReturnGeneralFailure); // run test - const auto result = device->prepareModel({}, {}, {}, {}, {}, {}, {}); + const auto result = device->prepareModel({}, {}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -339,13 +339,13 @@ TEST(ResilientDeviceTest, prepareModelError) { TEST(ResilientDeviceTest, prepareModelDeadObjectFailedRecovery) { // setup call const auto [mockDevice, mockDeviceFactory, device] = setup(); - EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _)) + EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _, _, _)) .Times(1) .WillOnce(kReturnDeadObject); EXPECT_CALL(*mockDeviceFactory, Call(false)).Times(1).WillOnce(kReturnGeneralFailure); // run test - const auto result = device->prepareModel({}, {}, {}, {}, {}, {}, {}); + const auto result = device->prepareModel({}, {}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -355,18 +355,18 @@ TEST(ResilientDeviceTest, prepareModelDeadObjectFailedRecovery) { TEST(ResilientDeviceTest, prepareModelDeadObjectSuccessfulRecovery) { // setup call const auto [mockDevice, mockDeviceFactory, device] = setup(); - EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _)) + EXPECT_CALL(*mockDevice, prepareModel(_, _, _, _, _, _, _, _, _)) .Times(1) .WillOnce(kReturnDeadObject); const auto recoveredMockDevice = createConfiguredMockDevice(); const auto mockPreparedModel = std::make_shared(); - EXPECT_CALL(*recoveredMockDevice, prepareModel(_, _, _, _, _, _, _)) + EXPECT_CALL(*recoveredMockDevice, prepareModel(_, _, _, _, _, _, _, _, _)) .Times(1) .WillOnce(Return(mockPreparedModel)); EXPECT_CALL(*mockDeviceFactory, Call(false)).Times(1).WillOnce(Return(recoveredMockDevice)); // run test - const auto result = device->prepareModel({}, {}, {}, {}, {}, {}, {}); + const auto result = device->prepareModel({}, {}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -679,7 +679,7 @@ TEST(ResilientDeviceTest, recoverCacheMismatchInvalidPrepareModel) { device->recover(mockDevice.get(), /*blocking=*/false); // run test - auto result = device->prepareModel({}, {}, {}, {}, {}, {}, {}); + auto result = device->prepareModel({}, {}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) diff --git a/neuralnetworks/utils/common/test/ResilientPreparedModelTest.cpp b/neuralnetworks/utils/common/test/ResilientPreparedModelTest.cpp index d396ca88df..276bfba4ef 100644 --- a/neuralnetworks/utils/common/test/ResilientPreparedModelTest.cpp +++ b/neuralnetworks/utils/common/test/ResilientPreparedModelTest.cpp @@ -104,12 +104,12 @@ TEST(ResilientPreparedModelTest, getPreparedModel) { TEST(ResilientPreparedModelTest, execute) { // setup call const auto [mockPreparedModel, mockPreparedModelFactory, preparedModel] = setup(); - EXPECT_CALL(*mockPreparedModel, execute(_, _, _, _)) + EXPECT_CALL(*mockPreparedModel, execute(_, _, _, _, _, _)) .Times(1) .WillOnce(Return(kNoExecutionError)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -119,10 +119,12 @@ TEST(ResilientPreparedModelTest, execute) { TEST(ResilientPreparedModelTest, executeError) { // setup call const auto [mockPreparedModel, mockPreparedModelFactory, preparedModel] = setup(); - EXPECT_CALL(*mockPreparedModel, execute(_, _, _, _)).Times(1).WillOnce(kReturnGeneralFailure); + EXPECT_CALL(*mockPreparedModel, execute(_, _, _, _, _, _)) + .Times(1) + .WillOnce(kReturnGeneralFailure); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -132,12 +134,12 @@ TEST(ResilientPreparedModelTest, executeError) { TEST(ResilientPreparedModelTest, executeDeadObjectFailedRecovery) { // setup call const auto [mockPreparedModel, mockPreparedModelFactory, preparedModel] = setup(); - EXPECT_CALL(*mockPreparedModel, execute(_, _, _, _)).Times(1).WillOnce(kReturnDeadObject); + EXPECT_CALL(*mockPreparedModel, execute(_, _, _, _, _, _)).Times(1).WillOnce(kReturnDeadObject); constexpr auto ret = [] { return nn::error(nn::ErrorStatus::GENERAL_FAILURE); }; EXPECT_CALL(*mockPreparedModelFactory, Call()).Times(1).WillOnce(ret); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -147,9 +149,9 @@ TEST(ResilientPreparedModelTest, executeDeadObjectFailedRecovery) { TEST(ResilientPreparedModelTest, executeDeadObjectSuccessfulRecovery) { // setup call const auto [mockPreparedModel, mockPreparedModelFactory, preparedModel] = setup(); - EXPECT_CALL(*mockPreparedModel, execute(_, _, _, _)).Times(1).WillOnce(kReturnDeadObject); + EXPECT_CALL(*mockPreparedModel, execute(_, _, _, _, _, _)).Times(1).WillOnce(kReturnDeadObject); const auto recoveredMockPreparedModel = createConfiguredMockPreparedModel(); - EXPECT_CALL(*recoveredMockPreparedModel, execute(_, _, _, _)) + EXPECT_CALL(*recoveredMockPreparedModel, execute(_, _, _, _, _, _)) .Times(1) .WillOnce(Return(kNoExecutionError)); EXPECT_CALL(*mockPreparedModelFactory, Call()) @@ -157,7 +159,7 @@ TEST(ResilientPreparedModelTest, executeDeadObjectSuccessfulRecovery) { .WillOnce(Return(recoveredMockPreparedModel)); // run test - const auto result = preparedModel->execute({}, {}, {}, {}); + const auto result = preparedModel->execute({}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -167,12 +169,12 @@ TEST(ResilientPreparedModelTest, executeDeadObjectSuccessfulRecovery) { TEST(ResilientPreparedModelTest, executeFenced) { // setup call const auto [mockPreparedModel, mockPreparedModelFactory, preparedModel] = setup(); - EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _)) + EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _, _, _)) .Times(1) .WillOnce(Return(kNoFencedExecutionError)); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -182,12 +184,12 @@ TEST(ResilientPreparedModelTest, executeFenced) { TEST(ResilientPreparedModelTest, executeFencedError) { // setup call const auto [mockPreparedModel, mockPreparedModelFactory, preparedModel] = setup(); - EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _)) + EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _, _, _)) .Times(1) .WillOnce(kReturnGeneralFailure); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -197,13 +199,13 @@ TEST(ResilientPreparedModelTest, executeFencedError) { TEST(ResilientPreparedModelTest, executeFencedDeadObjectFailedRecovery) { // setup call const auto [mockPreparedModel, mockPreparedModelFactory, preparedModel] = setup(); - EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _)) + EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _, _, _)) .Times(1) .WillOnce(kReturnDeadObject); EXPECT_CALL(*mockPreparedModelFactory, Call()).Times(1).WillOnce(kReturnGeneralFailure); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); @@ -213,11 +215,11 @@ TEST(ResilientPreparedModelTest, executeFencedDeadObjectFailedRecovery) { TEST(ResilientPreparedModelTest, executeFencedDeadObjectSuccessfulRecovery) { // setup call const auto [mockPreparedModel, mockPreparedModelFactory, preparedModel] = setup(); - EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _)) + EXPECT_CALL(*mockPreparedModel, executeFenced(_, _, _, _, _, _, _, _)) .Times(1) .WillOnce(kReturnDeadObject); const auto recoveredMockPreparedModel = createConfiguredMockPreparedModel(); - EXPECT_CALL(*recoveredMockPreparedModel, executeFenced(_, _, _, _, _, _)) + EXPECT_CALL(*recoveredMockPreparedModel, executeFenced(_, _, _, _, _, _, _, _)) .Times(1) .WillOnce(Return(kNoFencedExecutionError)); EXPECT_CALL(*mockPreparedModelFactory, Call()) @@ -225,7 +227,7 @@ TEST(ResilientPreparedModelTest, executeFencedDeadObjectSuccessfulRecovery) { .WillOnce(Return(recoveredMockPreparedModel)); // run test - const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}); + const auto result = preparedModel->executeFenced({}, {}, {}, {}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -235,12 +237,12 @@ TEST(ResilientPreparedModelTest, executeFencedDeadObjectSuccessfulRecovery) { TEST(ResilientPreparedModelTest, createReusableExecution) { // setup call const auto [mockPreparedModel, mockPreparedModelFactory, preparedModel] = setup(); - EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _)) + EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _, _, _)) .Times(1) .WillOnce(Return(kNoCreateReusableExecutionError)); // run test - const auto result = preparedModel->createReusableExecution({}, {}, {}); + const auto result = preparedModel->createReusableExecution({}, {}, {}, {}, {}); // verify result ASSERT_TRUE(result.has_value()) @@ -250,12 +252,12 @@ TEST(ResilientPreparedModelTest, createReusableExecution) { TEST(ResilientPreparedModelTest, createReusableExecutionError) { // setup call const auto [mockPreparedModel, mockPreparedModelFactory, preparedModel] = setup(); - EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _)) + EXPECT_CALL(*mockPreparedModel, createReusableExecution(_, _, _, _, _)) .Times(1) .WillOnce(kReturnGeneralFailure); // run test - const auto result = preparedModel->createReusableExecution({}, {}, {}); + const auto result = preparedModel->createReusableExecution({}, {}, {}, {}, {}); // verify result ASSERT_FALSE(result.has_value()); -- GitLab From e531a092fcdf4e9d7311903058e3f9d5ca3ecc51 Mon Sep 17 00:00:00 2001 From: Jason Macnak Date: Thu, 20 Jan 2022 08:49:09 -0800 Subject: [PATCH 462/825] Check createComposer().isOk() in test setup Bug: b/193240715 Test: cvd start Test: vts -m VtsHalGraphicsComposer3_TargetTest Change-Id: I0a2b90bcb403fbf3454046d3e46bf972a4d149f7 --- .../vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index ff22817a74..abfcbe40f7 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -76,7 +76,10 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { ASSERT_NE(binder, nullptr); ASSERT_NO_FATAL_FAILURE(mComposer = IComposer::fromBinder(binder)); ASSERT_NE(mComposer, nullptr); - ASSERT_NO_FATAL_FAILURE(mComposer->createClient(&mComposerClient)); + + ndk::ScopedAStatus status; + ASSERT_NO_FATAL_FAILURE(status = mComposer->createClient(&mComposerClient)); + ASSERT_TRUE(status.isOk()); mComposerCallback = ::ndk::SharedRefBase::make(); EXPECT_TRUE(mComposerClient->registerCallback(mComposerCallback).isOk()); -- GitLab From 981bb666a2dbfa11d28e5a45d642f227779652a7 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 20 Jan 2022 18:39:10 +0000 Subject: [PATCH 463/825] uwb(hal): Set sdk to Tiramisu Bug: 215526504 Test: Compiles Change-Id: I4f3762545a22688d5432162c0fb2b1599f4d3758 --- uwb/aidl/Android.bp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/uwb/aidl/Android.bp b/uwb/aidl/Android.bp index 99fd094e67..2cc1e6a8f9 100755 --- a/uwb/aidl/Android.bp +++ b/uwb/aidl/Android.bp @@ -16,7 +16,7 @@ aidl_interface { stability: "vintf", backend: { java: { - sdk_version: "module_current", + sdk_version: "module_Tiramisu", enabled: false, }, ndk: { @@ -27,7 +27,7 @@ aidl_interface { "//apex_available:platform", "com.android.uwb", ], - min_sdk_version: "current", + min_sdk_version: "Tiramisu", }, rust: { enabled: true, @@ -35,7 +35,7 @@ aidl_interface { "//apex_available:platform", "com.android.uwb", ], - min_sdk_version: "current", + min_sdk_version: "Tiramisu", }, }, } @@ -47,7 +47,7 @@ aidl_interface { stability: "vintf", backend: { java: { - sdk_version: "module_current", + sdk_version: "module_Tiramisu", enabled: true, apex_available: [ "com.android.uwb", @@ -58,7 +58,7 @@ aidl_interface { "//apex_available:platform", "com.android.uwb", ], - min_sdk_version: "current", + min_sdk_version: "Tiramisu", }, }, } -- GitLab From 7b4d5ee452aa6406afaf626c0626c73c41278bed Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Thu, 20 Jan 2022 12:10:39 -0800 Subject: [PATCH 464/825] Cleanup for readback buffer management: * Tests exercising that a bad readback buffer is sent should actually use a native_handle from a deallocated buffer rather than a valid handle, since that would still work * Creating a readback buffer should not require passing in a buffer at construction. Instead ReadbackBuffer should always allocate its buffer internally whenever a new buffer needs to be generated. * Passing the readback buffer's fence to lockAsync should be a dup'd fd, as lockAsync takes ownership of the fence Bug: 213493262 Test: VtsHalGraphicsComposer3_TargetTest Change-Id: I73396f982cf9a67f0dd81eaed509cf9cc7b03314 --- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 77 ++++++++++--------- .../functional/composer-vts/ReadbackVts.cpp | 7 +- .../composer-vts/include/ReadbackVts.h | 3 +- 3 files changed, 45 insertions(+), 42 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 3e0992ed34..fc527ecb28 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -328,8 +328,8 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, coloredSquare, BLUE); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); @@ -364,8 +364,8 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { return; } - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, @@ -441,8 +441,8 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, coloredSquare, BLUE); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); @@ -467,8 +467,8 @@ TEST_P(GraphicsCompositionTest, SetReadbackBuffer) { return; } - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, + mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); } @@ -497,8 +497,13 @@ TEST_P(GraphicsCompositionTest, SetReadbackBufferBadParameter) { return; } - aidl::android::hardware::common::NativeHandle bufferHandle = - ::android::dupToAidl(mGraphicBuffer->handle); + aidl::android::hardware::common::NativeHandle bufferHandle; + { + ::android::sp<::android::GraphicBuffer> buffer = allocate(); + ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck()); + ::android::makeToAidl(mGraphicBuffer->handle); + } + ndk::ScopedFileDescriptor releaseFence = ndk::ScopedFileDescriptor(-1); const auto error = mComposerClient->setReadbackBuffer(mPrimaryDisplay, bufferHandle, releaseFence); @@ -552,8 +557,8 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { std::vector> layers = {layer}; - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -631,8 +636,8 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, RED); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); auto deviceLayer = std::make_shared( @@ -735,8 +740,8 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { std::vector> layers = {layer}; - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); @@ -798,8 +803,8 @@ TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) { std::vector> layers = {layer}; - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); @@ -859,8 +864,8 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { // update expected colors to match crop ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, {0, 0, mDisplayWidth, mDisplayHeight}, BLUE); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -912,8 +917,8 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, blueRect, BLUE); ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); @@ -1013,8 +1018,8 @@ TEST_P(GraphicsCompositionTest, SetLayerWhitePointDims) { ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, dimmerRedRect, DIM_RED); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); @@ -1135,8 +1140,8 @@ TEST_P(GraphicsBlendModeCompositionTest, None) { setUpLayers(BlendMode::NONE); setExpectedColors(expectedColors); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -1176,8 +1181,8 @@ TEST_P(GraphicsBlendModeCompositionTest, Coverage) { setUpLayers(BlendMode::COVERAGE); setExpectedColors(expectedColors); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -1212,8 +1217,8 @@ TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) { setUpLayers(BlendMode::PREMULTIPLIED); setExpectedColors(expectedColors); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -1282,8 +1287,8 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); mLayer->setTransform(Transform::FLIP_H); mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); @@ -1323,8 +1328,8 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); mLayer->setTransform(Transform::FLIP_V); @@ -1364,8 +1369,8 @@ TEST_P(GraphicsTransformCompositionTest, ROT_180) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer, - mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, + mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); mLayer->setTransform(Transform::ROT_180); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp index fa1b08d1bc..e05c32d9c4 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp @@ -187,7 +187,6 @@ void ReadbackHelper::compareColorBuffers(std::vector& expectedColors, voi int offset = (row * stride + col) * bytesPerPixel; uint8_t* pixelColor = (uint8_t*)bufferData + offset; const Color expectedColor = expectedColors[static_cast(pixel)]; - ASSERT_EQ(std::round(255.0f * expectedColor.r), pixelColor[0]); ASSERT_EQ(std::round(255.0f * expectedColor.g), pixelColor[1]); ASSERT_EQ(std::round(255.0f * expectedColor.b), pixelColor[2]); @@ -196,13 +195,11 @@ void ReadbackHelper::compareColorBuffers(std::vector& expectedColors, voi } ReadbackBuffer::ReadbackBuffer(int64_t display, const std::shared_ptr& client, - const ::android::sp<::android::GraphicBuffer>& graphicBuffer, int32_t width, int32_t height, common::PixelFormat pixelFormat, common::Dataspace dataspace) { mDisplay = display; mComposerClient = client; - mGraphicBuffer = graphicBuffer; mPixelFormat = pixelFormat; mDataspace = dataspace; @@ -236,6 +233,7 @@ void ReadbackBuffer::setReadbackBuffer() { } void ReadbackBuffer::checkReadbackBuffer(std::vector expectedColors) { + ASSERT_NE(nullptr, mGraphicBuffer); // lock buffer for reading ndk::ScopedFileDescriptor fenceHandle; EXPECT_TRUE(mComposerClient->getReadbackBufferFence(mDisplay, &fenceHandle).isOk()); @@ -243,7 +241,8 @@ void ReadbackBuffer::checkReadbackBuffer(std::vector expectedColors) { int outBytesPerPixel; int outBytesPerStride; void* bufData = nullptr; - auto status = mGraphicBuffer->lockAsync(mUsage, mAccessRegion, &bufData, fenceHandle.get(), + + auto status = mGraphicBuffer->lockAsync(mUsage, mAccessRegion, &bufData, dup(fenceHandle.get()), &outBytesPerPixel, &outBytesPerStride); EXPECT_EQ(::android::OK, status); ASSERT_TRUE(mPixelFormat == PixelFormat::RGB_888 || mPixelFormat == PixelFormat::RGBA_8888); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h index 8d84667527..8785513b59 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h @@ -196,8 +196,7 @@ class ReadbackHelper { class ReadbackBuffer { public: - ReadbackBuffer(int64_t display, const std::shared_ptr& client, - const ::android::sp<::android::GraphicBuffer>& graphicBuffer, int32_t width, + ReadbackBuffer(int64_t display, const std::shared_ptr& client, int32_t width, int32_t height, common::PixelFormat pixelFormat, common::Dataspace dataspace); void setReadbackBuffer(); -- GitLab From 88c6269a5878a847e6785f3cd87ec7f3ba715f64 Mon Sep 17 00:00:00 2001 From: Anthony Date: Thu, 20 Jan 2022 20:43:59 +0000 Subject: [PATCH 465/825] Add enum value for BT main / scanning toggle states Bug: 215574482 Test: compile Change-Id: Ic8160375f79acf4fb8b69e90478e86cb1cbf32d4 --- .../current/android/hardware/contexthub/Setting.aidl | 2 ++ contexthub/aidl/android/hardware/contexthub/Setting.aidl | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl index 41bc9ae881..d998478db6 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/Setting.aidl @@ -39,4 +39,6 @@ enum Setting { WIFI_SCANNING = 3, AIRPLANE_MODE = 4, MICROPHONE = 5, + BT_MAIN = 6, + BT_SCANNING = 7, } diff --git a/contexthub/aidl/android/hardware/contexthub/Setting.aidl b/contexthub/aidl/android/hardware/contexthub/Setting.aidl index f2e55dbeb7..91d4c3f0be 100644 --- a/contexthub/aidl/android/hardware/contexthub/Setting.aidl +++ b/contexthub/aidl/android/hardware/contexthub/Setting.aidl @@ -39,4 +39,12 @@ enum Setting { * by CHRE. */ MICROPHONE, + /** + * The main BT toggle in the Android settings for BT connectivity. + */ + BT_MAIN, + /** + * The "BT scanning" setting for location scans. + */ + BT_SCANNING, } -- GitLab From a6b650060990f86b1857db3a8492c0b3e05dca45 Mon Sep 17 00:00:00 2001 From: Anthony Date: Thu, 20 Jan 2022 20:49:10 +0000 Subject: [PATCH 466/825] Add VTS test for new settings enums Bug: 215574482 Test: Run VTS Change-Id: Idc817611156c0f0efd7562c176e9765266576fa0 --- contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp index a47f64e5be..f0583be581 100644 --- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp +++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp @@ -300,6 +300,14 @@ TEST_P(ContextHubAidl, TestOnMicrophoneSettingChanged) { testSettingChanged(Setting::MICROPHONE); } +TEST_P(ContextHubAidl, TestOnBtMainSettingChanged) { + testSettingChanged(Setting::BT_MAIN); +} + +TEST_P(ContextHubAidl, TestOnBtScanningSettingChanged) { + testSettingChanged(Setting::BT_SCANNING); +} + std::vector> generateContextHubMapping() { std::vector> tuples; auto contextHubAidlNames = android::getAidlHalInstanceNames(IContextHub::descriptor); -- GitLab From 0996ac8a4482c05a2f7d696e129cb81927bc19fa Mon Sep 17 00:00:00 2001 From: Ytai Ben-Tsvi Date: Thu, 20 Jan 2022 13:40:39 -0800 Subject: [PATCH 467/825] Organize imports and fix formatting Test: m Fixes: 215567445 Change-Id: I1077b3fb609acde6d6dbda92139f52ad8fed7784 --- .../soundtrigger3/ISoundTriggerHw.aidl | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/soundtrigger/aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl b/soundtrigger/aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl index 2a3fc644ee..618331b3aa 100644 --- a/soundtrigger/aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl +++ b/soundtrigger/aidl/android/hardware/soundtrigger3/ISoundTriggerHw.aidl @@ -18,15 +18,12 @@ package android.hardware.soundtrigger3; import android.hardware.soundtrigger3.ISoundTriggerHwCallback; import android.hardware.soundtrigger3.ISoundTriggerHwGlobalCallback; - -import android.media.soundtrigger.PhraseSoundModel; -import android.media.soundtrigger.Properties; -import android.media.soundtrigger.RecognitionConfig; -import android.media.soundtrigger.SoundModel; import android.media.soundtrigger.ModelParameter; import android.media.soundtrigger.ModelParameterRange; +import android.media.soundtrigger.PhraseSoundModel; import android.media.soundtrigger.Properties; import android.media.soundtrigger.RecognitionConfig; +import android.media.soundtrigger.SoundModel; /** * SoundTrigger HAL interface. Used for hardware recognition of hotwords @@ -196,12 +193,12 @@ interface ISoundTriggerHw { * an audio stream associated with this recognition session. * @param config A RecognitionConfig structure containing attributes of the recognition to * perform. - * @throws ServiceSpecificException(RESOURCE_CONTENTION) if the model cannot be started due + * @throws ServiceSpecificException(RESOURCE_CONTENTION) if the model cannot be started due * to resource constraints. This is typically a temporary condition and the client may * retry after the onResourcesAvailable() global callback is invoked. - */ - void startRecognition(in int modelHandle, in int deviceHandle, - in int ioHandle, in RecognitionConfig config); + */ + void startRecognition( + in int modelHandle, in int deviceHandle, in int ioHandle, in RecognitionConfig config); /** * Stop recognition on a given model. @@ -235,7 +232,8 @@ interface ISoundTriggerHw { * @return This structure indicates supported attributes of the parameter for the given model * handle. If the parameter is not supported, null is returned. */ - @nullable ModelParameterRange queryParameter(in int modelHandle, in ModelParameter modelParam); + @nullable ModelParameterRange queryParameter( + in int modelHandle, in ModelParameter modelParam); /** * Get a model specific parameter. -- GitLab From 4299bb3254420340bf44304ca3fe656320e818f7 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 4 Nov 2021 18:53:41 -0700 Subject: [PATCH 468/825] Support subscribe/unsubscribe in VHAL. Test: atest DefaultVehicleHalTest Bug: 200737967 Change-Id: I4e7b31af7fa2af445f9bac6ec71dad3bf6c0b8b3 --- .../impl/utils/common/include/VehicleUtils.h | 12 +- .../utils/common/src/VehiclePropertyStore.cpp | 7 +- .../aidl/impl/vhal/include/ConnectedClient.h | 22 +- .../impl/vhal/include/DefaultVehicleHal.h | 66 ++- .../aidl/impl/vhal/src/ConnectedClient.cpp | 50 +- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 199 ++++++- .../impl/vhal/src/SubscriptionManager.cpp | 3 +- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 554 +++++++++++++++++- .../impl/vhal/test/MockVehicleHardware.cpp | 10 + .../aidl/impl/vhal/test/MockVehicleHardware.h | 10 + 10 files changed, 850 insertions(+), 83 deletions(-) diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h index 49b33d594a..0f0ccf11a2 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h @@ -67,24 +67,30 @@ inline constexpr bool isSystemProp(int32_t prop) { } inline const ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* getAreaConfig( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue, + int32_t propId, int32_t areaId, const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config) { if (config.areaConfigs.size() == 0) { return nullptr; } - if (isGlobalProp(propValue.prop)) { + if (isGlobalProp(propId)) { return &(config.areaConfigs[0]); } for (const auto& c : config.areaConfigs) { - if (c.areaId == propValue.areaId) { + if (c.areaId == areaId) { return &c; } } return nullptr; } +inline const ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* getAreaConfig( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue, + const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config) { + return getAreaConfig(propValue.prop, propValue.areaId, config); +} + inline std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> createVehiclePropValueVec(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, size_t vecSize) { diff --git a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp index 1a79230143..c1fa89645c 100644 --- a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp @@ -21,9 +21,11 @@ #include #include -#include +#include #include +#include + namespace android { namespace hardware { namespace automotive { @@ -36,13 +38,14 @@ using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::base::Error; using ::android::base::Result; +using ::android::base::StringPrintf; bool VehiclePropertyStore::RecordId::operator==(const VehiclePropertyStore::RecordId& other) const { return area == other.area && token == other.token; } std::string VehiclePropertyStore::RecordId::toString() const { - return ::fmt::format("RecordID{{.areaId={:d}, .token={:d}}}", area, token); + return StringPrintf("RecordID{{.areaId=% " PRId32 ", .token=%" PRId64 "}", area, token); } size_t VehiclePropertyStore::RecordIdHash::operator()(RecordId const& recordId) const { diff --git a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h index d8516b1a41..4f0b74a853 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h +++ b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h @@ -19,6 +19,7 @@ #include "PendingRequestPool.h" +#include #include #include @@ -51,14 +52,14 @@ class ConnectedClient { // Gets the unique ID for this client. const void* id(); - // Add client requests. The requests would be registered as pending requests until + // Adds client requests. The requests would be registered as pending requests until // {@code tryFinishRequests} is called for them. // Returns {@code INVALID_ARG} error if any of the requestIds are duplicate with one of the // pending request IDs or {@code TRY_AGAIN} error if the pending request pool is full and could // no longer add requests. ::android::base::Result addRequests(const std::unordered_set& requestIds); - // Mark the requests as finished. Returns a list of request IDs that was pending and has been + // Marks the requests as finished. Returns a list of request IDs that was pending and has been // finished. It must be a set of the requested request IDs. std::unordered_set tryFinishRequests(const std::unordered_set& requestIds); @@ -110,9 +111,15 @@ class SubscriptionClient final : public ConnectedClient { callback); // Gets the callback to be called when the request for this client has finished. - std::shared_ptr)>> - getResultCallback(); + std::shared_ptr getResultCallback(); + + // Marshals the updated values into largeParcelable and sents it through {@code onPropertyEvent} + // callback. + static void sendUpdatedValues( + std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> + callback, + std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>&& + updatedValues); protected: // Gets the callback to be called when the request for this client has timeout. @@ -121,9 +128,8 @@ class SubscriptionClient final : public ConnectedClient { private: // The following members are only initialized during construction. std::shared_ptr mTimeoutCallback; - std::shared_ptr)>> - mResultCallback; + std::shared_ptr mResultCallback; + std::shared_ptr mPropertyChangeCallback; static void onGetValueResults( const void* clientId, diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index b0423a39ef..6becff844b 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -53,7 +53,7 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve explicit DefaultVehicleHal(std::unique_ptr hardware); - ~DefaultVehicleHal(); + ~DefaultVehicleHal() = default; ::ndk::ScopedAStatus getAllPropConfigs( ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs) @@ -93,11 +93,40 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve 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 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 pool) : mPendingRequestPool(pool) {} + + std::shared_ptr getClient(const CallbackType& callback); + + size_t countClients(); + + private: + std::mutex mLock; + std::unordered_map> mClients + GUARDED_BY(mLock); + // PendingRequestPool is thread-safe. + std::shared_ptr mPendingRequestPool; + }; + // The default timeout of get or set value requests is 30s. // TODO(b/214605968): define TIMEOUT_IN_NANO in IVehicle and allow getValues/setValues/subscribe // to specify custom timeouts. static constexpr int64_t TIMEOUT_IN_NANO = 30'000'000'000; - const std::unique_ptr mVehicleHardware; + const std::shared_ptr mVehicleHardware; // mConfigsByPropId and mConfigFile are only modified during initialization, so no need to // lock guard them. @@ -108,22 +137,15 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve // PendingRequestPool is thread-safe. std::shared_ptr mPendingRequestPool; // SubscriptionManager is thread-safe. - std::unique_ptr mSubscriptionManager; + std::shared_ptr mSubscriptionManager; std::mutex mLock; std::unordered_map> mGetValuesClients GUARDED_BY(mLock); std::unordered_map> mSetValuesClients GUARDED_BY(mLock); - std::unordered_map> mSubscriptionClients - GUARDED_BY(mLock); - // An increasing request ID we keep for subscribe clients. - std::unordered_map mSubscribeIdByClient GUARDED_BY(mLock); - - template - std::shared_ptr getOrCreateClient( - std::unordered_map>* clients, - const CallbackType& callback) REQUIRES(mLock); + // SubscriptionClients is thread-safe. + std::shared_ptr mSubscriptionClients; ::android::base::Result checkProperty( const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); @@ -136,10 +158,26 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>& requests); - void getValueFromHardwareCallCallback( - const CallbackType& callback, + ::android::base::Result checkSubscribeOptions( + const std::vector<::aidl::android::hardware::automotive::vehicle::SubscribeOptions>& + options); + + template + static std::shared_ptr getOrCreateClient( + std::unordered_map>* clients, + const CallbackType& callback, std::shared_ptr pendingRequestPool); + + static void getValueFromHardwareCallCallback( + std::weak_ptr vehicleHardware, + std::shared_ptr subscribeIdByClient, + std::shared_ptr subscriptionClients, const CallbackType& callback, const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + static void onPropertyChangeEvent( + std::weak_ptr subscriptionManager, + const std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>& + updatedValues); + // Test-only // Set the default timeout for pending requests. void setTimeout(int64_t timeoutInNano); diff --git a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp index 7d02a0521d..5ccef55a29 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp @@ -258,7 +258,7 @@ SubscriptionClient::SubscriptionClient(std::shared_ptr reque }); auto requestPoolCopy = mRequestPool; const void* clientId = reinterpret_cast(this); - mResultCallback = std::make_shared)>>( + mResultCallback = std::make_shared( [clientId, callback, requestPoolCopy](std::vector results) { onGetValueResults(clientId, callback, requestPoolCopy, results); }); @@ -274,6 +274,32 @@ SubscriptionClient::getTimeoutCallback() { return mTimeoutCallback; } +void SubscriptionClient::sendUpdatedValues(std::shared_ptr callback, + std::vector&& updatedValues) { + if (updatedValues.empty()) { + return; + } + + // TODO(b/205189110): Use memory pool here and fill in sharedMemoryId. + VehiclePropValues vehiclePropValues; + int32_t sharedMemoryFileCount = 0; + ScopedAStatus status = vectorToStableLargeParcelable(updatedValues, &vehiclePropValues); + if (!status.isOk()) { + int statusCode = status.getServiceSpecificError(); + ALOGE("subscribe: failed to marshal result into large parcelable, error: " + "%s, code: %d", + status.getMessage(), statusCode); + return; + } + + if (ScopedAStatus callbackStatus = + callback->onPropertyEvent(vehiclePropValues, sharedMemoryFileCount); + !callbackStatus.isOk()) { + ALOGE("subscribe: failed to call callback, error: %s, code: %d", status.getMessage(), + status.getServiceSpecificError()); + } +} + void SubscriptionClient::onGetValueResults(const void* clientId, std::shared_ptr callback, std::shared_ptr requestPool, @@ -308,27 +334,7 @@ void SubscriptionClient::onGetValueResults(const void* clientId, propValues.push_back(std::move(result.prop.value())); } - if (propValues.empty()) { - return; - } - // TODO(b/205189110): Use memory pool here and fill in sharedMemoryId. - VehiclePropValues vehiclePropValues; - int32_t sharedMemoryFileCount = 0; - ScopedAStatus status = vectorToStableLargeParcelable(propValues, &vehiclePropValues); - if (!status.isOk()) { - int statusCode = status.getServiceSpecificError(); - ALOGE("failed to marshal result into large parcelable, error: " - "%s, code: %d", - status.getMessage(), statusCode); - return; - } - - if (ScopedAStatus callbackStatus = - callback->onPropertyEvent(vehiclePropValues, sharedMemoryFileCount); - !callbackStatus.isOk()) { - ALOGE("failed to call callback, error: %s, code: %d", status.getMessage(), - status.getServiceSpecificError()); - } + sendUpdatedValues(callback, std::move(propValues)); } } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index 1e76eb7211..7549635983 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -50,11 +51,13 @@ using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyChangeMode; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::automotive::car_binder_lib::LargeParcelableBase; using ::android::base::Error; using ::android::base::expected; using ::android::base::Result; +using ::android::base::StringPrintf; using ::ndk::ScopedAStatus; std::string toString(const std::unordered_set& values) { @@ -70,6 +73,24 @@ std::string toString(const std::unordered_set& values) { } // namespace +std::shared_ptr DefaultVehicleHal::SubscriptionClients::getClient( + const CallbackType& callback) { + std::scoped_lock lockGuard(mLock); + return getOrCreateClient(&mClients, callback, mPendingRequestPool); +} + +int64_t DefaultVehicleHal::SubscribeIdByClient::getId(const CallbackType& callback) { + std::scoped_lock lockGuard(mLock); + // This would be initialized to 0 if callback does not exist in the map. + int64_t subscribeId = (mIds[callback])++; + return subscribeId; +} + +size_t DefaultVehicleHal::SubscriptionClients::countClients() { + std::scoped_lock lockGuard(mLock); + return mClients.size(); +} + DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) : mVehicleHardware(std::move(hardware)), mPendingRequestPool(std::make_shared(TIMEOUT_IN_NANO)) { @@ -90,24 +111,50 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) mConfigFile = std::move(result.value()); } - mSubscriptionManager = std::make_unique( - [this](const CallbackType& callback, const VehiclePropValue& value) { - getValueFromHardwareCallCallback(callback, value); - }); + mSubscriptionClients = std::make_shared(mPendingRequestPool); + + auto subscribeIdByClient = std::make_shared(); + // Make a weak copy of IVehicleHardware because subscriptionManager uses IVehicleHardware and + // IVehicleHardware uses subscriptionManager. We want to avoid cyclic reference. + std::weak_ptr hardwareCopy = mVehicleHardware; + SubscriptionManager::GetValueFunc getValueFunc = std::bind( + &DefaultVehicleHal::getValueFromHardwareCallCallback, hardwareCopy, subscribeIdByClient, + mSubscriptionClients, std::placeholders::_1, std::placeholders::_2); + mSubscriptionManager = std::make_shared(std::move(getValueFunc)); + + std::weak_ptr subscriptionManagerCopy = mSubscriptionManager; + mVehicleHardware->registerOnPropertyChangeEvent( + std::make_unique( + [subscriptionManagerCopy](std::vector updatedValues) { + onPropertyChangeEvent(subscriptionManagerCopy, updatedValues); + })); } -DefaultVehicleHal::~DefaultVehicleHal() { - // mSubscriptionManager has reference to this, so must be destroyed before other members. - mSubscriptionManager.reset(); +void DefaultVehicleHal::onPropertyChangeEvent( + std::weak_ptr subscriptionManager, + const std::vector& updatedValues) { + 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 values; + for (const VehiclePropValue* valuePtr : valuePtrs) { + values.push_back(*valuePtr); + } + SubscriptionClient::sendUpdatedValues(callback, std::move(values)); + } } template std::shared_ptr DefaultVehicleHal::getOrCreateClient( - std::unordered_map>* clients, - const CallbackType& callback) { + std::unordered_map>* clients, const CallbackType& callback, + std::shared_ptr pendingRequestPool) { if (clients->find(callback) == clients->end()) { // TODO(b/204943359): Remove client from clients when linkToDeath is implemented. - (*clients)[callback] = std::make_shared(mPendingRequestPool, callback); + (*clients)[callback] = std::make_shared(pendingRequestPool, callback); } return (*clients)[callback]; } @@ -115,26 +162,23 @@ std::shared_ptr DefaultVehicleHal::getOrCreateClient( template std::shared_ptr DefaultVehicleHal::getOrCreateClient( std::unordered_map>* clients, - const CallbackType& callback); + const CallbackType& callback, std::shared_ptr pendingRequestPool); template std::shared_ptr DefaultVehicleHal::getOrCreateClient( std::unordered_map>* clients, - const CallbackType& callback); + const CallbackType& callback, std::shared_ptr pendingRequestPool); template std::shared_ptr DefaultVehicleHal::getOrCreateClient( std::unordered_map>* clients, - const CallbackType& callback); - -void DefaultVehicleHal::getValueFromHardwareCallCallback(const CallbackType& callback, - const VehiclePropValue& value) { - int64_t subscribeId; - std::shared_ptr client; - { - std::scoped_lock lockGuard(mLock); - // This is initialized to 0 if callback does not exist in the map. - subscribeId = (mSubscribeIdByClient[callback])++; - client = getOrCreateClient(&mSubscriptionClients, callback); - } + const CallbackType& callback, std::shared_ptr pendingRequestPool); + +void DefaultVehicleHal::getValueFromHardwareCallCallback( + std::weak_ptr vehicleHardware, + std::shared_ptr subscribeIdByClient, + std::shared_ptr subscriptionClients, const CallbackType& callback, + const VehiclePropValue& value) { + int64_t subscribeId = subscribeIdByClient->getId(callback); + auto client = subscriptionClients->getClient(callback); if (auto addRequestResult = client->addRequests({subscribeId}); !addRequestResult.ok()) { ALOGE("subscribe[%" PRId64 "]: too many pending requests, ignore the getValue request", subscribeId); @@ -146,8 +190,12 @@ void DefaultVehicleHal::getValueFromHardwareCallCallback(const CallbackType& cal .prop = value, }}; - if (StatusCode status = - mVehicleHardware->getValues(client->getResultCallback(), hardwareRequests); + std::shared_ptr hardware = vehicleHardware.lock(); + if (hardware == nullptr) { + ALOGW("the IVehicleHardware is destroyed, DefaultVehicleHal is ending"); + return; + } + if (StatusCode status = hardware->getValues(client->getResultCallback(), hardwareRequests); status != StatusCode::OK) { // If the hardware returns error, finish all the pending requests for this request because // we never expect hardware to call callback for these requests. @@ -222,7 +270,7 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, std::shared_ptr client; { std::scoped_lock lockGuard(mLock); - client = getOrCreateClient(&mGetValuesClients, callback); + client = getOrCreateClient(&mGetValuesClients, callback, mPendingRequestPool); } // Register the pending hardware requests and also check for duplicate request Ids. if (auto addRequestResult = client->addRequests(hardwareRequestIds); !addRequestResult.ok()) { @@ -291,7 +339,7 @@ ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, std::shared_ptr client; { std::scoped_lock lockGuard(mLock); - client = getOrCreateClient(&mSetValuesClients, callback); + client = getOrCreateClient(&mSetValuesClients, callback, mPendingRequestPool); } // Register the pending hardware requests and also check for duplicate request Ids. @@ -360,15 +408,102 @@ ScopedAStatus DefaultVehicleHal::getPropConfigs(const std::vector& prop return vectorToStableLargeParcelable(std::move(configs), output); } -ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType&, - const std::vector&, int32_t) { - return ScopedAStatus::ok(); +Result DefaultVehicleHal::checkSubscribeOptions( + const std::vector& options) { + for (const auto& option : options) { + int32_t propId = option.propId; + if (mConfigsByPropId.find(propId) == mConfigsByPropId.end()) { + return Error() << StringPrintf("no config for property, ID: %" PRId32, propId); + } + const VehiclePropConfig& config = mConfigsByPropId[propId]; + + if (config.changeMode != VehiclePropertyChangeMode::ON_CHANGE && + config.changeMode != VehiclePropertyChangeMode::CONTINUOUS) { + return Error() << "only support subscribing to ON_CHANGE or CONTINUOUS property"; + } + + if (config.changeMode == VehiclePropertyChangeMode::CONTINUOUS) { + float sampleRate = option.sampleRate; + float minSampleRate = config.minSampleRate; + float maxSampleRate = config.maxSampleRate; + if (sampleRate < minSampleRate || sampleRate > maxSampleRate) { + return Error() << StringPrintf( + "sample rate: %f out of range, must be within %f and %f", sampleRate, + minSampleRate, maxSampleRate); + } + if (!SubscriptionManager::checkSampleRate(sampleRate)) { + return Error() << "invalid sample rate: " << sampleRate; + } + } + + if (isGlobalProp(propId)) { + continue; + } + + // Non-global property. + for (int32_t areaId : option.areaIds) { + if (auto areaConfig = getAreaConfig(propId, areaId, config); areaConfig == nullptr) { + return Error() << StringPrintf("invalid area ID: %" PRId32 " for prop ID: %" PRId32 + ", not listed in config", + areaId, propId); + } + } + } + return {}; } -ScopedAStatus DefaultVehicleHal::unsubscribe(const CallbackType&, const std::vector&) { +ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, + const std::vector& options, + [[maybe_unused]] int32_t maxSharedMemoryFileCount) { + // TODO(b/205189110): Use shared memory file count. + if (auto result = checkSubscribeOptions(options); !result.ok()) { + ALOGE("subscribe: invalid subscribe options: %s", result.error().message().c_str()); + return toScopedAStatus(result, StatusCode::INVALID_ARG); + } + + std::vector onChangeSubscriptions; + std::vector continuousSubscriptions; + for (const auto& option : options) { + int32_t propId = option.propId; + // We have already validate config exists. + const VehiclePropConfig& config = mConfigsByPropId[propId]; + + SubscribeOptions optionCopy = option; + // If areaIds is empty, subscribe to all areas. + if (optionCopy.areaIds.empty() && !isGlobalProp(propId)) { + for (const auto& areaConfig : config.areaConfigs) { + optionCopy.areaIds.push_back(areaConfig.areaId); + } + } + + if (isGlobalProp(propId)) { + optionCopy.areaIds = {0}; + } + + if (config.changeMode == VehiclePropertyChangeMode::CONTINUOUS) { + continuousSubscriptions.push_back(std::move(optionCopy)); + } else { + onChangeSubscriptions.push_back(std::move(optionCopy)); + } + } + // Since we have already check the sample rates, the following functions must succeed. + if (!onChangeSubscriptions.empty()) { + mSubscriptionManager->subscribe(callback, onChangeSubscriptions, + /*isContinuousProperty=*/false); + } + if (!continuousSubscriptions.empty()) { + mSubscriptionManager->subscribe(callback, continuousSubscriptions, + /*isContinuousProperty=*/true); + } return ScopedAStatus::ok(); } +ScopedAStatus DefaultVehicleHal::unsubscribe(const CallbackType& callback, + const std::vector& propIds) { + return toScopedAStatus(mSubscriptionManager->unsubscribe(callback, propIds), + StatusCode::INVALID_ARG); +} + ScopedAStatus DefaultVehicleHal::returnSharedMemory(const CallbackType&, int64_t) { // TODO(b/200737967): implement this. return ScopedAStatus::ok(); diff --git a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp index dc9a6ce73e..ff996fec3d 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp @@ -55,6 +55,8 @@ SubscriptionManager::~SubscriptionManager() { std::scoped_lock lockGuard(mLock); mClientsByPropIdArea.clear(); + // RecurrentSubscription has reference to mGetValue, so it must be destroyed before mGetValue is + // destroyed. mSubscriptionsByClient.clear(); } @@ -80,7 +82,6 @@ Result SubscriptionManager::subscribe(const std::shared_ptr lockGuard(mLock); std::vector intervals; - for (const auto& option : options) { float sampleRate = option.sampleRate; diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index d3186fd9b9..d8c9fa26ce 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -56,10 +56,12 @@ using ::aidl::android::hardware::automotive::vehicle::SetValueRequests; using ::aidl::android::hardware::automotive::vehicle::SetValueResult; 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::VehicleAreaWindow; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs; using ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyChangeMode; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValues; @@ -70,12 +72,21 @@ using ::ndk::ScopedAStatus; using ::ndk::ScopedFileDescriptor; using ::testing::Eq; +using ::testing::UnorderedElementsAre; using ::testing::UnorderedElementsAreArray; using ::testing::WhenSortedBy; constexpr int32_t INVALID_PROP_ID = 0; // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32 constexpr int32_t INT32_WINDOW_PROP = 10001 + 0x10000000 + 0x03000000 + 0x00400000; +// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 +constexpr int32_t GLOBAL_ON_CHANGE_PROP = 10002 + 0x10000000 + 0x01000000 + 0x00400000; +// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 +constexpr int32_t GLOBAL_CONTINUOUS_PROP = 10003 + 0x10000000 + 0x01000000 + 0x00400000; +// VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32 +constexpr int32_t AREA_ON_CHANGE_PROP = 10004 + 0x10000000 + 0x03000000 + 0x00400000; +// VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32 +constexpr int32_t AREA_CONTINUOUS_PROP = 10005 + 0x10000000 + 0x03000000 + 0x00400000; int32_t testInt32VecProp(size_t i) { // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC @@ -137,6 +148,53 @@ std::vector getSetValuesInvalidRequestTestCases }}; } +struct SubscribeInvalidOptionsTestCase { + std::string name; + SubscribeOptions option; +}; + +std::vector getSubscribeInvalidOptionsTestCases() { + return {{ + .name = "invalid_prop", + .option = + { + .propId = INVALID_PROP_ID, + }, + }, + { + .name = "invalid_area_ID", + .option = + { + .propId = AREA_ON_CHANGE_PROP, + .areaIds = {0}, + }, + }, + { + .name = "invalid_sample_rate", + .option = + { + .propId = GLOBAL_CONTINUOUS_PROP, + .sampleRate = 0.0, + }, + }, + { + .name = "sample_rate_out_of_range", + .option = + { + .propId = GLOBAL_CONTINUOUS_PROP, + .sampleRate = 1000.0, + }, + }, + { + .name = "static_property", + .option = + { + // Default change mode is static. + .propId = testInt32VecProp(0), + }, + }}; +} + } // namespace class DefaultVehicleHalTest : public ::testing::Test { @@ -157,6 +215,7 @@ class DefaultVehicleHalTest : public ::testing::Test { }, }); } + // A property with area config. testConfigs.push_back( VehiclePropConfig{.prop = INT32_WINDOW_PROP, .areaConfigs = {{ @@ -164,6 +223,58 @@ class DefaultVehicleHalTest : public ::testing::Test { .minInt32Value = 0, .maxInt32Value = 100, }}}); + // A global on-change property. + testConfigs.push_back(VehiclePropConfig{ + .prop = GLOBAL_ON_CHANGE_PROP, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }); + // A global continuous property. + testConfigs.push_back(VehiclePropConfig{ + .prop = GLOBAL_CONTINUOUS_PROP, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 0.0, + .maxSampleRate = 100.0, + }); + // A per-area on-change property. + testConfigs.push_back(VehiclePropConfig{ + .prop = AREA_ON_CHANGE_PROP, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = + { + { + + .areaId = toInt(VehicleAreaWindow::ROW_1_LEFT), + .minInt32Value = 0, + .maxInt32Value = 100, + }, + { + .areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT), + .minInt32Value = 0, + .maxInt32Value = 100, + }, + }, + }); + // A per-area continuous property. + testConfigs.push_back(VehiclePropConfig{ + .prop = AREA_CONTINUOUS_PROP, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 0.0, + .maxSampleRate = 1000.0, + .areaConfigs = + { + { + + .areaId = toInt(VehicleAreaWindow::ROW_1_LEFT), + .minInt32Value = 0, + .maxInt32Value = 100, + }, + { + .areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT), + .minInt32Value = 0, + .maxInt32Value = 100, + }, + }, + }); hardware->setPropertyConfigs(testConfigs); mHardwarePtr = hardware.get(); mVhal = ndk::SharedRefBase::make(std::move(hardware)); @@ -263,7 +374,8 @@ class DefaultVehicleHalTest : public ::testing::Test { size_t countClients() { std::scoped_lock lockGuard(mVhal->mLock); - return mVhal->mGetValuesClients.size() + mVhal->mSetValuesClients.size(); + return mVhal->mGetValuesClients.size() + mVhal->mSetValuesClients.size() + + mVhal->mSubscriptionClients->countClients(); } private: @@ -783,6 +895,446 @@ TEST_F(DefaultVehicleHalTest, testSetValuesDuplicateRequestProps) { ASSERT_FALSE(status.isOk()) << "duplicate request properties in one request must fail"; } +TEST_F(DefaultVehicleHalTest, testSubscribeUnsubscribe) { + std::vector options = { + { + .propId = GLOBAL_ON_CHANGE_PROP, + }, + }; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + + status = getClient()->unsubscribe(getCallbackClient(), + std::vector({GLOBAL_ON_CHANGE_PROP})); + + ASSERT_TRUE(status.isOk()) << "unsubscribe failed: " << status.getMessage(); +} + +TEST_F(DefaultVehicleHalTest, testSubscribeGlobalOnChangeNormal) { + std::vector options = { + { + .propId = GLOBAL_ON_CHANGE_PROP, + }, + }; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + + VehiclePropValue testValue{ + .prop = GLOBAL_ON_CHANGE_PROP, + .value.int32Values = {0}, + }; + SetValueRequests setValueRequests = { + .payloads = + { + SetValueRequest{ + .requestId = 0, + .value = testValue, + }, + }, + }; + std::vector setValueResults = {{ + .requestId = 0, + .status = StatusCode::OK, + }}; + + // Set the value to trigger a property change event. + getHardware()->addSetValueResponses(setValueResults); + status = getClient()->setValues(getCallbackClient(), setValueRequests); + + ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage(); + + auto maybeResults = getCallback()->nextOnPropertyEventResults(); + ASSERT_TRUE(maybeResults.has_value()) << "no results in callback"; + ASSERT_THAT(maybeResults.value().payloads, UnorderedElementsAre(testValue)) + << "results mismatch, expect on change event for the updated value"; + ASSERT_FALSE(getCallback()->nextOnPropertyEventResults().has_value()) + << "more results than expected"; + EXPECT_EQ(countClients(), static_cast(1)); +} + +TEST_F(DefaultVehicleHalTest, testSubscribeGlobalOnchangeUnrelatedEventIgnored) { + std::vector options = { + { + .propId = GLOBAL_ON_CHANGE_PROP, + }, + }; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + + VehiclePropValue testValue{ + .prop = GLOBAL_CONTINUOUS_PROP, + .value.int32Values = {0}, + }; + + // Set the value to trigger a property change event. This event should be ignored because we + // have not subscribed to it. + getHardware()->addSetValueResponses({{ + .requestId = 0, + .status = StatusCode::OK, + }}); + status = getClient()->setValues(getCallbackClient(), + { + .payloads = + { + SetValueRequest{ + .requestId = 0, + .value = testValue, + }, + }, + }); + + ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage(); + + ASSERT_FALSE(getCallback()->nextOnPropertyEventResults().has_value()) + << "must receive no property update event if the property is not subscribed"; +} + +TEST_F(DefaultVehicleHalTest, testSubscribeAreaOnChange) { + int testAreaId = toInt(VehicleAreaWindow::ROW_1_LEFT); + std::vector options = { + { + .propId = AREA_ON_CHANGE_PROP, + .areaIds = {testAreaId}, + }, + }; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + + VehiclePropValue testValue{ + .prop = AREA_ON_CHANGE_PROP, + .areaId = testAreaId, + .value.int32Values = {0}, + }; + + // Set the value to trigger a property change event. + getHardware()->addSetValueResponses({{ + .requestId = 0, + .status = StatusCode::OK, + }}); + status = getClient()->setValues(getCallbackClient(), + { + .payloads = + { + SetValueRequest{ + .requestId = 0, + .value = testValue, + }, + }, + }); + + ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage(); + + auto maybeResults = getCallback()->nextOnPropertyEventResults(); + ASSERT_TRUE(maybeResults.has_value()) << "no results in callback"; + ASSERT_THAT(maybeResults.value().payloads, UnorderedElementsAre(testValue)) + << "results mismatch, expect on change event for the updated value"; + ASSERT_FALSE(getCallback()->nextOnPropertyEventResults().has_value()) + << "more results than expected"; +} + +TEST_F(DefaultVehicleHalTest, testSubscribeAreaOnChangeAllAreas) { + std::vector options = { + { + .propId = AREA_ON_CHANGE_PROP, + // No areaIds means subscribing to all area IDs. + .areaIds = {}, + }, + }; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + + VehiclePropValue testValue1{ + .prop = AREA_ON_CHANGE_PROP, + .areaId = toInt(VehicleAreaWindow::ROW_1_LEFT), + .value.int32Values = {0}, + }; + VehiclePropValue testValue2{ + .prop = AREA_ON_CHANGE_PROP, + .areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT), + .value.int32Values = {0}, + }; + + // Set the values to trigger property change events for two areas. + getHardware()->addSetValueResponses({{ + .requestId = 0, + .status = StatusCode::OK, + }, + { + .requestId = 1, + .status = StatusCode::OK, + }}); + status = getClient()->setValues(getCallbackClient(), + { + .payloads = + { + SetValueRequest{ + .requestId = 0, + .value = testValue1, + }, + SetValueRequest{ + .requestId = 1, + .value = testValue2, + }, + }, + }); + + ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage(); + + 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_FALSE(getCallback()->nextOnPropertyEventResults().has_value()) + << "more results than expected"; +} + +TEST_F(DefaultVehicleHalTest, testSubscribeGlobalContinuous) { + VehiclePropValue testValue{ + .prop = GLOBAL_CONTINUOUS_PROP, + .value.int32Values = {0}, + }; + // Set responses for all the hardware getValues requests. + getHardware()->setGetValueResponder( + [](std::shared_ptr callback, + const std::vector& requests) { + std::vector results; + for (auto& request : requests) { + VehiclePropValue prop = request.prop; + prop.value.int32Values = {0}; + results.push_back({ + .requestId = request.requestId, + .status = StatusCode::OK, + .prop = prop, + }); + } + (*callback)(results); + return StatusCode::OK; + }); + + std::vector options = { + { + .propId = GLOBAL_CONTINUOUS_PROP, + .sampleRate = 20.0, + }, + }; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + + // Sleep for 1s, which should generate ~20 events. + std::this_thread::sleep_for(std::chrono::seconds(1)); + + // Should trigger about 20 times, check for at least 15 events to be safe. + for (size_t i = 0; i < 15; i++) { + auto maybeResults = getCallback()->nextOnPropertyEventResults(); + ASSERT_TRUE(maybeResults.has_value()) << "no results in callback"; + ASSERT_THAT(maybeResults.value().payloads, UnorderedElementsAre(testValue)) + << "results mismatch, expect to get the updated value"; + } + EXPECT_EQ(countClients(), static_cast(1)); +} + +TEST_F(DefaultVehicleHalTest, testSubscribeAreaContinuous) { + // Set responses for all the hardware getValues requests. + getHardware()->setGetValueResponder( + [](std::shared_ptr callback, + const std::vector& requests) { + std::vector results; + for (auto& request : requests) { + VehiclePropValue prop = request.prop; + prop.value.int32Values = {0}; + results.push_back({ + .requestId = request.requestId, + .status = StatusCode::OK, + .prop = prop, + }); + } + (*callback)(results); + return StatusCode::OK; + }); + + std::vector options = { + { + .propId = AREA_CONTINUOUS_PROP, + .sampleRate = 20.0, + .areaIds = {toInt(VehicleAreaWindow::ROW_1_LEFT)}, + }, + { + .propId = AREA_CONTINUOUS_PROP, + .sampleRate = 10.0, + .areaIds = {toInt(VehicleAreaWindow::ROW_1_RIGHT)}, + }, + }; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + + // Sleep for 1s, which should generate ~20 events. + std::this_thread::sleep_for(std::chrono::seconds(1)); + + std::vector events; + while (true) { + auto maybeResults = getCallback()->nextOnPropertyEventResults(); + if (!maybeResults.has_value()) { + break; + } + for (const auto& value : maybeResults.value().payloads) { + events.push_back(value); + } + } + + size_t leftCount = 0; + size_t rightCount = 0; + + for (const auto& event : events) { + ASSERT_EQ(event.prop, AREA_CONTINUOUS_PROP); + if (event.areaId == toInt(VehicleAreaWindow::ROW_1_LEFT)) { + leftCount++; + continue; + } + rightCount++; + } + + // Should trigger about 20 times, check for at least 15 events to be safe. + ASSERT_GE(leftCount, static_cast(15)); + // Should trigger about 10 times, check for at least 5 events to be safe. + ASSERT_GE(rightCount, static_cast(5)); +} + +TEST_F(DefaultVehicleHalTest, testUnsubscribeOnChange) { + std::vector options = { + { + .propId = GLOBAL_ON_CHANGE_PROP, + }, + }; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + + status = getClient()->unsubscribe(getCallbackClient(), + std::vector({GLOBAL_ON_CHANGE_PROP})); + + ASSERT_TRUE(status.isOk()) << "unsubscribe failed: " << status.getMessage(); + + VehiclePropValue testValue{ + .prop = GLOBAL_ON_CHANGE_PROP, + .value.int32Values = {0}, + }; + + // Set the value to trigger a property change event. + getHardware()->addSetValueResponses({{ + .requestId = 0, + .status = StatusCode::OK, + }}); + status = getClient()->setValues(getCallbackClient(), + { + .payloads = + { + SetValueRequest{ + .requestId = 0, + .value = testValue, + }, + }, + }); + + ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage(); + + ASSERT_FALSE(getCallback()->nextOnPropertyEventResults().has_value()) + << "No property event should be generated after unsubscription"; +} + +TEST_F(DefaultVehicleHalTest, testUnsubscribeContinuous) { + VehiclePropValue testValue{ + .prop = GLOBAL_CONTINUOUS_PROP, + .value.int32Values = {0}, + }; + // Set responses for all the hardware getValues requests. + getHardware()->setGetValueResponder( + [](std::shared_ptr callback, + const std::vector& requests) { + std::vector results; + for (auto& request : requests) { + VehiclePropValue prop = request.prop; + prop.value.int32Values = {0}; + results.push_back({ + .requestId = request.requestId, + .status = StatusCode::OK, + .prop = prop, + }); + } + (*callback)(results); + return StatusCode::OK; + }); + + std::vector options = { + { + .propId = GLOBAL_CONTINUOUS_PROP, + .sampleRate = 20.0, + }, + }; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + + status = getClient()->unsubscribe(getCallbackClient(), + std::vector({GLOBAL_CONTINUOUS_PROP})); + + ASSERT_TRUE(status.isOk()) << "unsubscribe failed: " << status.getMessage(); + + // Clear existing events. + while (getCallback()->nextOnPropertyEventResults().has_value()) { + // Do nothing. + } + + // Wait for a while, make sure no new events are generated. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + + ASSERT_FALSE(getCallback()->nextOnPropertyEventResults().has_value()) + << "No property event should be generated after unsubscription"; +} + +class SubscribeInvalidOptionsTest + : public DefaultVehicleHalTest, + public testing::WithParamInterface {}; + +INSTANTIATE_TEST_SUITE_P( + SubscribeInvalidOptionsTests, SubscribeInvalidOptionsTest, + ::testing::ValuesIn(getSubscribeInvalidOptionsTestCases()), + [](const testing::TestParamInfo& info) { + return info.param.name; + }); + +TEST_P(SubscribeInvalidOptionsTest, testSubscribeInvalidRequest) { + std::vector options = {GetParam().option}; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_FALSE(status.isOk()) << "invalid subscribe options must fail"; + ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::INVALID_ARG)); +} + +TEST_F(DefaultVehicleHalTest, testUnsubscribeFailure) { + auto status = getClient()->unsubscribe(getCallbackClient(), + std::vector({GLOBAL_ON_CHANGE_PROP})); + + ASSERT_FALSE(status.isOk()) << "unsubscribe to a not-subscribed property must fail"; + ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::INVALID_ARG)); +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp index 7d992af0b4..eec32ddfc2 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp @@ -64,6 +64,9 @@ StatusCode MockVehicleHardware::setValues(std::shared_ptr callback, const std::vector& requests) const { std::scoped_lock lockGuard(mLock); + if (mGetValueResponder != nullptr) { + return mGetValueResponder(callback, requests); + } return handleRequestsLocked(__func__, callback, requests, &mGetValueRequests, &mGetValueResponses); } @@ -104,6 +107,13 @@ void MockVehicleHardware::addSetValueResponses(const std::vector mSetValueResponses.push_back(responses); } +void MockVehicleHardware::setGetValueResponder( + std::function, + const std::vector&)>&& responder) { + std::scoped_lock lockGuard(mLock); + mGetValueResponder = responder; +} + std::vector MockVehicleHardware::nextGetValueRequests() { std::scoped_lock lockGuard(mLock); std::optional> request = pop(mGetValueRequests); diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h index 283d1f96cd..0844de1ab3 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h @@ -66,6 +66,12 @@ class MockVehicleHardware final : public IVehicleHardware { void addSetValueResponses( const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueResult>& responses); + void setGetValueResponder( + std::function<::aidl::android::hardware::automotive::vehicle::StatusCode( + std::shared_ptr, + const std::vector< + ::aidl::android::hardware::automotive::vehicle::GetValueRequest>&)>&& + responder); std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest> nextGetValueRequests(); std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest> @@ -92,6 +98,10 @@ class MockVehicleHardware final : public IVehicleHardware { mStatusByFunctions GUARDED_BY(mLock); int64_t mSleepTime GUARDED_BY(mLock) = 0; std::unique_ptr mPropertyChangeCallback GUARDED_BY(mLock); + std::function<::aidl::android::hardware::automotive::vehicle::StatusCode( + std::shared_ptr, + const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>&)> + mGetValueResponder GUARDED_BY(mLock); template ::aidl::android::hardware::automotive::vehicle::StatusCode returnResponse( -- GitLab From d110eda7019e24adf64811885c769e3adbd2552e Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 16 Nov 2021 19:23:44 -0800 Subject: [PATCH 469/825] Add permission check and heartbeat event to VHAL. Test: atest DefaultVehicleHalTest Bug: 200737967 Change-Id: I5ee4209a59dd63173060fb52a69a80bfbb3522c9 --- .../impl/vhal/include/DefaultVehicleHal.h | 17 ++ .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 176 +++++++++++++++--- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 112 ++++++++++- .../vhal/test/SubscriptionManagerTest.cpp | 2 +- 4 files changed, 280 insertions(+), 27 deletions(-) diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index 6becff844b..b9975bcfc8 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -126,6 +126,8 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve // TODO(b/214605968): define TIMEOUT_IN_NANO in IVehicle and allow getValues/setValues/subscribe // to specify custom timeouts. static constexpr int64_t TIMEOUT_IN_NANO = 30'000'000'000; + // heart beat event interval: 3s + static constexpr int64_t HEART_BEAT_INTERVAL_IN_NANO = 3'000'000'000; const std::shared_ptr mVehicleHardware; // mConfigsByPropId and mConfigFile are only modified during initialization, so no need to @@ -146,6 +148,8 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve GUARDED_BY(mLock); // SubscriptionClients is thread-safe. std::shared_ptr mSubscriptionClients; + // RecurrentTimer is thread-safe. + RecurrentTimer mRecurrentTimer; ::android::base::Result checkProperty( const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); @@ -162,6 +166,16 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve const std::vector<::aidl::android::hardware::automotive::vehicle::SubscribeOptions>& options); + ::android::base::Result checkReadPermission( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; + + ::android::base::Result checkWritePermission( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; + + ::android::base::Result< + const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig*> + getConfig(int32_t propId) const; + template static std::shared_ptr getOrCreateClient( std::unordered_map>* clients, @@ -178,6 +192,9 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve const std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>& updatedValues); + static void checkHealth(std::weak_ptr hardware, + std::weak_ptr subscriptionManager); + // Test-only // Set the default timeout for pending requests. void setTimeout(int64_t timeoutInNano); diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index 7549635983..c4cbc68c8c 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -51,7 +52,10 @@ using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs; +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::VehiclePropertyStatus; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::automotive::car_binder_lib::LargeParcelableBase; using ::android::base::Error; @@ -128,6 +132,13 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) [subscriptionManagerCopy](std::vector updatedValues) { onPropertyChangeEvent(subscriptionManagerCopy, updatedValues); })); + + // Register heartbeat event. + mRecurrentTimer.registerTimerCallback( + HEART_BEAT_INTERVAL_IN_NANO, + std::make_shared>([hardwareCopy, subscriptionManagerCopy]() { + checkHealth(hardwareCopy, subscriptionManagerCopy); + })); } void DefaultVehicleHal::onPropertyChangeEvent( @@ -222,27 +233,35 @@ ScopedAStatus DefaultVehicleHal::getAllPropConfigs(VehiclePropConfigs* output) { return ScopedAStatus::ok(); } -Result DefaultVehicleHal::checkProperty(const VehiclePropValue& propValue) { - int32_t propId = propValue.prop; +Result DefaultVehicleHal::getConfig(int32_t propId) const { auto it = mConfigsByPropId.find(propId); if (it == mConfigsByPropId.end()) { return Error() << "no config for property, ID: " << propId; } - const VehiclePropConfig& config = it->second; - const VehicleAreaConfig* areaConfig = getAreaConfig(propValue, config); + return &(it->second); +} + +Result DefaultVehicleHal::checkProperty(const VehiclePropValue& propValue) { + int32_t propId = propValue.prop; + auto result = getConfig(propId); + if (!result.ok()) { + return result.error(); + } + const VehiclePropConfig* config = result.value(); + const VehicleAreaConfig* areaConfig = getAreaConfig(propValue, *config); if (!isGlobalProp(propId) && areaConfig == nullptr) { // Ignore areaId for global property. For non global property, check whether areaId is // allowed. areaId must appear in areaConfig. return Error() << "invalid area ID: " << propValue.areaId << " for prop ID: " << propId << ", not listed in config"; } - if (auto result = checkPropValue(propValue, &config); !result.ok()) { + if (auto result = checkPropValue(propValue, config); !result.ok()) { return Error() << "invalid property value: " << propValue.toString() - << ", error: " << result.error().message(); + << ", error: " << getErrorMsg(result); } if (auto result = checkValueRange(propValue, areaConfig); !result.ok()) { return Error() << "property value out of range: " << propValue.toString() - << ", error: " << result.error().message(); + << ", error: " << getErrorMsg(result); } return {}; } @@ -263,9 +282,30 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, ALOGE("getValues: duplicate request ID"); return toScopedAStatus(maybeRequestIds, StatusCode::INVALID_ARG); } + + // A list of failed result we already know before sending to hardware. + std::vector failedResults; + // The list of requests that we would send to hardware. + std::vector hardwareRequests; + + for (const auto& request : getValueRequests) { + if (auto result = checkReadPermission(request.prop); !result.ok()) { + ALOGW("property does not support reading: %s", getErrorMsg(result).c_str()); + failedResults.push_back(GetValueResult{ + .requestId = request.requestId, + .status = getErrorCode(result), + .prop = {}, + }); + } else { + hardwareRequests.push_back(request); + } + } + // The set of request Ids that we would send to hardware. - std::unordered_set hardwareRequestIds(maybeRequestIds.value().begin(), - maybeRequestIds.value().end()); + std::unordered_set hardwareRequestIds; + for (const auto& request : hardwareRequests) { + hardwareRequestIds.insert(request.requestId); + } std::shared_ptr client; { @@ -275,12 +315,21 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, // Register the pending hardware requests and also check for duplicate request Ids. if (auto addRequestResult = client->addRequests(hardwareRequestIds); !addRequestResult.ok()) { ALOGE("getValues[%s]: failed to add pending requests, error: %s", - toString(hardwareRequestIds).c_str(), addRequestResult.error().message().c_str()); + toString(hardwareRequestIds).c_str(), getErrorMsg(addRequestResult).c_str()); return toScopedAStatus(addRequestResult); } + if (!failedResults.empty()) { + // First send the failed results we already know back to the client. + client->sendResults(failedResults); + } + + if (hardwareRequests.empty()) { + return ScopedAStatus::ok(); + } + if (StatusCode status = - mVehicleHardware->getValues(client->getResultCallback(), getValueRequests); + mVehicleHardware->getValues(client->getResultCallback(), hardwareRequests); status != StatusCode::OK) { // If the hardware returns error, finish all the pending requests for this request because // we never expect hardware to call callback for these requests. @@ -317,9 +366,17 @@ ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, for (auto& request : setValueRequests) { int64_t requestId = request.requestId; + if (auto result = checkWritePermission(request.value); !result.ok()) { + ALOGW("property does not support writing: %s", getErrorMsg(result).c_str()); + failedResults.push_back(SetValueResult{ + .requestId = requestId, + .status = getErrorCode(result), + }); + continue; + } if (auto result = checkProperty(request.value); !result.ok()) { - ALOGW("setValues[%" PRId64 "]: property not valid: %s", requestId, - result.error().message().c_str()); + ALOGW("setValues[%" PRId64 "]: property is not valid: %s", requestId, + getErrorMsg(result).c_str()); failedResults.push_back(SetValueResult{ .requestId = requestId, .status = StatusCode::INVALID_ARG, @@ -345,7 +402,7 @@ ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, // Register the pending hardware requests and also check for duplicate request Ids. if (auto addRequestResult = client->addRequests(hardwareRequestIds); !addRequestResult.ok()) { ALOGE("setValues[%s], failed to add pending requests, error: %s", - toString(hardwareRequestIds).c_str(), addRequestResult.error().message().c_str()); + toString(hardwareRequestIds).c_str(), getErrorMsg(addRequestResult).c_str()); return toScopedAStatus(addRequestResult, StatusCode::INVALID_ARG); } @@ -354,6 +411,10 @@ ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, client->sendResults(failedResults); } + if (hardwareRequests.empty()) { + return ScopedAStatus::ok(); + } + if (StatusCode status = mVehicleHardware->setValues(client->getResultCallback(), hardwareRequests); status != StatusCode::OK) { @@ -413,13 +474,21 @@ Result DefaultVehicleHal::checkSubscribeOptions( for (const auto& option : options) { int32_t propId = option.propId; if (mConfigsByPropId.find(propId) == mConfigsByPropId.end()) { - return Error() << StringPrintf("no config for property, ID: %" PRId32, propId); + return Error(toInt(StatusCode::INVALID_ARG)) + << StringPrintf("no config for property, ID: %" PRId32, propId); } const VehiclePropConfig& config = mConfigsByPropId[propId]; if (config.changeMode != VehiclePropertyChangeMode::ON_CHANGE && config.changeMode != VehiclePropertyChangeMode::CONTINUOUS) { - return Error() << "only support subscribing to ON_CHANGE or CONTINUOUS property"; + return Error(toInt(StatusCode::INVALID_ARG)) + << "only support subscribing to ON_CHANGE or CONTINUOUS property"; + } + + if (config.access != VehiclePropertyAccess::READ && + config.access != VehiclePropertyAccess::READ_WRITE) { + return Error(toInt(StatusCode::ACCESS_DENIED)) + << StringPrintf("Property %" PRId32 " has no read access", propId); } if (config.changeMode == VehiclePropertyChangeMode::CONTINUOUS) { @@ -427,12 +496,13 @@ Result DefaultVehicleHal::checkSubscribeOptions( float minSampleRate = config.minSampleRate; float maxSampleRate = config.maxSampleRate; if (sampleRate < minSampleRate || sampleRate > maxSampleRate) { - return Error() << StringPrintf( - "sample rate: %f out of range, must be within %f and %f", sampleRate, - minSampleRate, maxSampleRate); + return Error(toInt(StatusCode::INVALID_ARG)) + << StringPrintf("sample rate: %f out of range, must be within %f and %f", + sampleRate, minSampleRate, maxSampleRate); } if (!SubscriptionManager::checkSampleRate(sampleRate)) { - return Error() << "invalid sample rate: " << sampleRate; + return Error(toInt(StatusCode::INVALID_ARG)) + << "invalid sample rate: " << sampleRate; } } @@ -443,9 +513,10 @@ Result DefaultVehicleHal::checkSubscribeOptions( // Non-global property. for (int32_t areaId : option.areaIds) { if (auto areaConfig = getAreaConfig(propId, areaId, config); areaConfig == nullptr) { - return Error() << StringPrintf("invalid area ID: %" PRId32 " for prop ID: %" PRId32 - ", not listed in config", - areaId, propId); + return Error(toInt(StatusCode::INVALID_ARG)) + << StringPrintf("invalid area ID: %" PRId32 " for prop ID: %" PRId32 + ", not listed in config", + areaId, propId); } } } @@ -457,8 +528,8 @@ ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, [[maybe_unused]] int32_t maxSharedMemoryFileCount) { // TODO(b/205189110): Use shared memory file count. if (auto result = checkSubscribeOptions(options); !result.ok()) { - ALOGE("subscribe: invalid subscribe options: %s", result.error().message().c_str()); - return toScopedAStatus(result, StatusCode::INVALID_ARG); + ALOGE("subscribe: invalid subscribe options: %s", getErrorMsg(result).c_str()); + return toScopedAStatus(result); } std::vector onChangeSubscriptions; @@ -513,6 +584,61 @@ IVehicleHardware* DefaultVehicleHal::getHardware() { return mVehicleHardware.get(); } +Result DefaultVehicleHal::checkWritePermission(const VehiclePropValue& value) const { + int32_t propId = value.prop; + auto result = getConfig(propId); + if (!result.ok()) { + return Error(toInt(StatusCode::INVALID_ARG)) << getErrorMsg(result); + } + const VehiclePropConfig* config = result.value(); + + if (config->access != VehiclePropertyAccess::WRITE && + config->access != VehiclePropertyAccess::READ_WRITE) { + return Error(toInt(StatusCode::ACCESS_DENIED)) + << StringPrintf("Property %" PRId32 " has no write access", propId); + } + return {}; +} + +Result DefaultVehicleHal::checkReadPermission(const VehiclePropValue& value) const { + int32_t propId = value.prop; + auto result = getConfig(propId); + if (!result.ok()) { + return Error(toInt(StatusCode::INVALID_ARG)) << getErrorMsg(result); + } + const VehiclePropConfig* config = result.value(); + + if (config->access != VehiclePropertyAccess::READ && + config->access != VehiclePropertyAccess::READ_WRITE) { + return Error(toInt(StatusCode::ACCESS_DENIED)) + << StringPrintf("Property %" PRId32 " has no read access", propId); + } + return {}; +} + +void DefaultVehicleHal::checkHealth(std::weak_ptr hardware, + std::weak_ptr subscriptionManager) { + auto hardwarePtr = hardware.lock(); + if (hardwarePtr == nullptr) { + ALOGW("the VehicleHardware is destroyed, DefaultVehicleHal is ending"); + return; + } + + StatusCode status = hardwarePtr->checkHealth(); + if (status != StatusCode::OK) { + ALOGE("VHAL check health returns non-okay status"); + return; + } + std::vector values = {{ + .prop = toInt(VehicleProperty::VHAL_HEARTBEAT), + .areaId = 0, + .status = VehiclePropertyStatus::AVAILABLE, + .value.int64Values = {uptimeMillis()}, + }}; + onPropertyChangeEvent(subscriptionManager, values); + return; +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index d8c9fa26ce..54fc17d29c 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -61,6 +62,8 @@ using ::aidl::android::hardware::automotive::vehicle::VehicleAreaWindow; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs; using ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors; +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::VehiclePropValue; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValues; @@ -87,6 +90,10 @@ constexpr int32_t GLOBAL_CONTINUOUS_PROP = 10003 + 0x10000000 + 0x01000000 + 0x0 constexpr int32_t AREA_ON_CHANGE_PROP = 10004 + 0x10000000 + 0x03000000 + 0x00400000; // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32 constexpr int32_t AREA_CONTINUOUS_PROP = 10005 + 0x10000000 + 0x03000000 + 0x00400000; +// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 +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; int32_t testInt32VecProp(size_t i) { // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC @@ -145,6 +152,15 @@ std::vector getSetValuesInvalidRequestTestCases .areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT), }, .expectedStatus = StatusCode::INVALID_ARG, + }, + { + .name = "no_write_permission", + .request = + { + .prop = READ_ONLY_PROP, + .value.int32Values = {0}, + }, + .expectedStatus = StatusCode::ACCESS_DENIED, }}; } @@ -205,6 +221,7 @@ class DefaultVehicleHalTest : public ::testing::Test { for (size_t i = 0; i < 10000; i++) { testConfigs.push_back(VehiclePropConfig{ .prop = testInt32VecProp(i), + .access = VehiclePropertyAccess::READ_WRITE, .areaConfigs = { { @@ -218,6 +235,7 @@ class DefaultVehicleHalTest : public ::testing::Test { // A property with area config. testConfigs.push_back( VehiclePropConfig{.prop = INT32_WINDOW_PROP, + .access = VehiclePropertyAccess::READ_WRITE, .areaConfigs = {{ .areaId = toInt(VehicleAreaWindow::ROW_1_LEFT), .minInt32Value = 0, @@ -226,11 +244,13 @@ class DefaultVehicleHalTest : public ::testing::Test { // A global on-change property. testConfigs.push_back(VehiclePropConfig{ .prop = GLOBAL_ON_CHANGE_PROP, + .access = VehiclePropertyAccess::READ_WRITE, .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, @@ -238,6 +258,7 @@ class DefaultVehicleHalTest : public ::testing::Test { // A per-area on-change property. testConfigs.push_back(VehiclePropConfig{ .prop = AREA_ON_CHANGE_PROP, + .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .areaConfigs = { @@ -257,6 +278,7 @@ class DefaultVehicleHalTest : public ::testing::Test { // 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, @@ -275,6 +297,28 @@ class DefaultVehicleHalTest : public ::testing::Test { }, }, }); + // A read-only property. + testConfigs.push_back(VehiclePropConfig{ + .prop = READ_ONLY_PROP, + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 0.0, + .maxSampleRate = 1000.0, + }); + // A write-only property. + testConfigs.push_back(VehiclePropConfig{ + .prop = WRITE_ONLY_PROP, + .access = VehiclePropertyAccess::WRITE, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 0.0, + .maxSampleRate = 1000.0, + }); + // Register the heartbeat event property. + testConfigs.push_back(VehiclePropConfig{ + .prop = toInt(VehicleProperty::VHAL_HEARTBEAT), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }); hardware->setPropertyConfigs(testConfigs); mHardwarePtr = hardware.get(); mVhal = ndk::SharedRefBase::make(std::move(hardware)); @@ -509,6 +553,39 @@ TEST_F(DefaultVehicleHalTest, testGetValuesInvalidLargeParcelableInput) { ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::INVALID_ARG)); } +TEST_F(DefaultVehicleHalTest, testGetValuesNoReadPermission) { + GetValueRequests requests = { + .sharedMemoryFd = {}, + .payloads = + { + { + .requestId = 0, + .prop = + { + .prop = WRITE_ONLY_PROP, + }, + }, + }, + }; + + auto status = getClient()->getValues(getCallbackClient(), requests); + + ASSERT_TRUE(status.isOk()) << "getValue with no read permission should return okay with error " + "returned from callback" + << ", error: " << status.getMessage(); + EXPECT_TRUE(getHardware()->nextGetValueRequests().empty()) << "expect no request to hardware"; + + auto maybeResult = getCallback()->nextGetValueResults(); + ASSERT_TRUE(maybeResult.has_value()) << "no results in callback"; + EXPECT_EQ(maybeResult.value().payloads, std::vector({ + { + .requestId = 0, + .status = StatusCode::ACCESS_DENIED, + }, + })) + << "expect to get ACCESS_DENIED status if no read permission"; +} + TEST_F(DefaultVehicleHalTest, testGetValuesFinishBeforeTimeout) { // timeout: 0.1s int64_t timeout = 100000000; @@ -1318,7 +1395,7 @@ INSTANTIATE_TEST_SUITE_P( return info.param.name; }); -TEST_P(SubscribeInvalidOptionsTest, testSubscribeInvalidRequest) { +TEST_P(SubscribeInvalidOptionsTest, testSubscribeInvalidOptions) { std::vector options = {GetParam().option}; auto status = getClient()->subscribe(getCallbackClient(), options, 0); @@ -1327,6 +1404,17 @@ TEST_P(SubscribeInvalidOptionsTest, testSubscribeInvalidRequest) { ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::INVALID_ARG)); } +TEST_F(DefaultVehicleHalTest, testSubscribeNoReadPermission) { + std::vector options = {{ + .propId = WRITE_ONLY_PROP, + }}; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_FALSE(status.isOk()) << "subscribe to a write-only property must fail"; + ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::ACCESS_DENIED)); +} + TEST_F(DefaultVehicleHalTest, testUnsubscribeFailure) { auto status = getClient()->unsubscribe(getCallbackClient(), std::vector({GLOBAL_ON_CHANGE_PROP})); @@ -1335,6 +1423,28 @@ TEST_F(DefaultVehicleHalTest, testUnsubscribeFailure) { ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::INVALID_ARG)); } +TEST_F(DefaultVehicleHalTest, testHeartbeatEvent) { + std::vector options = {{ + .propId = toInt(VehicleProperty::VHAL_HEARTBEAT), + }}; + int64_t currentTime = uptimeMillis(); + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_TRUE(status.isOk()) << "unable to subscribe to heartbeat event: " << status.getMessage(); + + // We send out a heartbeat event every 3s, so sleep for 3s. + std::this_thread::sleep_for(std::chrono::seconds(3)); + + auto maybeResults = getCallback()->nextOnPropertyEventResults(); + ASSERT_TRUE(maybeResults.has_value()) << "no results in callback"; + ASSERT_EQ(maybeResults.value().payloads.size(), static_cast(1)); + VehiclePropValue gotValue = maybeResults.value().payloads[0]; + ASSERT_EQ(gotValue.prop, toInt(VehicleProperty::VHAL_HEARTBEAT)); + ASSERT_EQ(gotValue.value.int64Values.size(), static_cast(1)); + ASSERT_GE(gotValue.value.int64Values[0], currentTime) + << "expect to get the latest timestamp with the heartbeat event"; +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp index fa08d6c3fa..c14f4fdcc0 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp @@ -185,7 +185,7 @@ TEST_F(SubscriptionManagerTest, testOverrideSubscriptionContinuous) { // Theoretically trigger 10 times, but check for at least 9 times to be stable. EXPECT_GE(getEvents().size(), static_cast(9)); - EXPECT_LE(getEvents().size(), static_cast(11)); + EXPECT_LE(getEvents().size(), static_cast(15)); } TEST_F(SubscriptionManagerTest, testSubscribeMultipleAreasContinuous) { -- GitLab From 14829be2691102eeff5b395317b45aef79560c4f Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 3 Dec 2021 19:07:41 -0800 Subject: [PATCH 470/825] Implement linkToDeath, use binder as client ID. Implement linkToDeath for binders. Delete allocated resources for a binder when it died or unlinked. This CL also uses 'const AIBinder*' as client id type instead of the callback because the Binder object corresponds to the remote proxy and is guaranteed to be unique per client. Bug: 204943359 Test: atest DefaultVehicleHalTest Change-Id: If2e0c58e86a041a78b8ca69597aef4733ce1826c --- .../aidl/impl/vhal/include/ConnectedClient.h | 28 ++--- .../impl/vhal/include/DefaultVehicleHal.h | 58 ++++++++- .../impl/vhal/include/SubscriptionManager.h | 30 +++-- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 103 ++++++++++++++-- .../impl/vhal/src/SubscriptionManager.cpp | 42 ++++--- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 113 ++++++++++++++++-- .../vhal/test/SubscriptionManagerTest.cpp | 30 +++-- 7 files changed, 320 insertions(+), 84 deletions(-) diff --git a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h index 4f0b74a853..833707a580 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h +++ b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h @@ -42,10 +42,10 @@ namespace vehicle { // This class is thread-safe. class ConnectedClient { public: - ConnectedClient( - std::shared_ptr requestPool, - std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> - callback); + using CallbackType = + std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>; + + ConnectedClient(std::shared_ptr requestPool, CallbackType callback); virtual ~ConnectedClient() = default; @@ -68,8 +68,7 @@ class ConnectedClient { virtual std::shared_ptr getTimeoutCallback() = 0; const std::shared_ptr mRequestPool; - const std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> - mCallback; + const CallbackType mCallback; }; // A class to represent a client that calls {@code IVehicle.setValues} or {@code @@ -77,10 +76,7 @@ class ConnectedClient { template class GetSetValuesClient final : public ConnectedClient { public: - GetSetValuesClient( - std::shared_ptr requestPool, - std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> - callback); + GetSetValuesClient(std::shared_ptr requestPool, CallbackType callback); // Sends the results to this client. void sendResults(const std::vector& results); @@ -105,10 +101,7 @@ class GetSetValuesClient final : public ConnectedClient { // A class to represent a client that calls {@code IVehicle.subscribe}. class SubscriptionClient final : public ConnectedClient { public: - SubscriptionClient( - std::shared_ptr requestPool, - std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> - callback); + SubscriptionClient(std::shared_ptr requestPool, CallbackType callback); // Gets the callback to be called when the request for this client has finished. std::shared_ptr getResultCallback(); @@ -116,8 +109,7 @@ class SubscriptionClient final : public ConnectedClient { // Marshals the updated values into largeParcelable and sents it through {@code onPropertyEvent} // callback. static void sendUpdatedValues( - std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> - callback, + CallbackType callback, std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>&& updatedValues); @@ -132,9 +124,7 @@ class SubscriptionClient final : public ConnectedClient { std::shared_ptr mPropertyChangeCallback; static void onGetValueResults( - const void* clientId, - std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> - callback, + const void* clientId, CallbackType callback, std::shared_ptr requestPool, std::vector<::aidl::android::hardware::automotive::vehicle::GetValueResult> results); }; diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index b9975bcfc8..62b2627691 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -53,7 +53,7 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve explicit DefaultVehicleHal(std::unique_ptr hardware); - ~DefaultVehicleHal() = default; + ~DefaultVehicleHal(); ::ndk::ScopedAStatus getAllPropConfigs( ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs) @@ -101,7 +101,7 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve private: std::mutex mLock; - std::unordered_map mIds GUARDED_BY(mLock); + std::unordered_map mIds GUARDED_BY(mLock); }; // A thread safe class to store all subscribe clients. This class is safe to pass to async @@ -112,16 +112,42 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve std::shared_ptr getClient(const CallbackType& callback); + void removeClient(const AIBinder* clientId); + size_t countClients(); private: std::mutex mLock; - std::unordered_map> mClients + std::unordered_map> mClients GUARDED_BY(mLock); // PendingRequestPool is thread-safe. std::shared_ptr mPendingRequestPool; }; + // A wrapper for linkToDeath to enable stubbing for test. + class ILinkToDeath { + public: + virtual ~ILinkToDeath() = default; + + virtual binder_status_t linkToDeath(AIBinder* binder, AIBinder_DeathRecipient* recipient, + void* cookie) = 0; + }; + + // A real implementation for ILinkToDeath. + class AIBinderLinkToDeathImpl final : public ILinkToDeath { + public: + binder_status_t linkToDeath(AIBinder* binder, AIBinder_DeathRecipient* recipient, + void* cookie) override; + }; + + // OnBinderDiedContext is a type used as a cookie passed deathRecipient. The deathRecipient's + // onBinderDied function takes only a cookie as input and we have to store all the contexts + // as the cookie. + struct OnBinderDiedContext { + DefaultVehicleHal* vhal; + const AIBinder* clientId; + }; + // The default timeout of get or set value requests is 30s. // TODO(b/214605968): define TIMEOUT_IN_NANO in IVehicle and allow getValues/setValues/subscribe // to specify custom timeouts. @@ -142,15 +168,22 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve std::shared_ptr mSubscriptionManager; std::mutex mLock; - std::unordered_map> mGetValuesClients + std::unordered_map> mOnBinderDiedContexts GUARDED_BY(mLock); - std::unordered_map> mSetValuesClients + std::unordered_map> mGetValuesClients + GUARDED_BY(mLock); + std::unordered_map> mSetValuesClients GUARDED_BY(mLock); // SubscriptionClients is thread-safe. std::shared_ptr mSubscriptionClients; + // mLinkToDeathImpl is only going to be changed in test. + std::unique_ptr mLinkToDeathImpl; + // RecurrentTimer is thread-safe. RecurrentTimer mRecurrentTimer; + ::ndk::ScopedAIBinder_DeathRecipient mDeathRecipient; + ::android::base::Result checkProperty( const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); @@ -176,9 +209,15 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig*> getConfig(int32_t propId) const; + void onBinderDiedWithContext(const AIBinder* clientId); + + void onBinderUnlinkedWithContext(const AIBinder* clientId); + + void monitorBinderLifeCycle(const CallbackType& callback); + template static std::shared_ptr getOrCreateClient( - std::unordered_map>* clients, + std::unordered_map>* clients, const CallbackType& callback, std::shared_ptr pendingRequestPool); static void getValueFromHardwareCallCallback( @@ -195,9 +234,16 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve static void checkHealth(std::weak_ptr hardware, std::weak_ptr subscriptionManager); + static void onBinderDied(void* cookie); + + static void onBinderUnlinked(void* cookie); + // Test-only // Set the default timeout for pending requests. void setTimeout(int64_t timeoutInNano); + + // Test-only + void setLinkToDeathImpl(std::unique_ptr impl); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h index 28809c61d1..e739c8c3f2 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h +++ b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h @@ -38,6 +38,7 @@ namespace vehicle { // A thread-safe subscription manager that manages all VHAL subscriptions. class SubscriptionManager final { public: + using ClientIdType = const AIBinder*; using CallbackType = std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>; using GetValueFunc = std::function unsubscribe(const CallbackType& callback, + // Returns ok if all the requested properties for the client are unsubscribed. + ::android::base::Result unsubscribe(ClientIdType client, const std::vector& propIds); - // Unsubscribes to all the properties for the callback. - // Returns error if the callback was not subscribed before. If error is returned, no property + // Unsubscribes from all the properties for the client. + // Returns error if the client was not subscribed before. If error is returned, no property // would be unsubscribed. - // Returns ok if all the properties for the callback are unsubscribed. - ::android::base::Result unsubscribe(const CallbackType& callback); + // Returns ok if all the properties for the client are unsubscribed. + ::android::base::Result unsubscribe(ClientIdType client); // 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< - std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>, + CallbackType, std::vector> getSubscribedClients( const std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>& @@ -86,6 +87,9 @@ class SubscriptionManager final { static bool checkSampleRate(float sampleRate); private: + // Friend class for testing. + friend class DefaultVehicleHalTest; + struct PropIdAreaId { int32_t propId; int32_t areaId; @@ -131,9 +135,10 @@ class SubscriptionManager final { }; mutable std::mutex mLock; - std::unordered_map, PropIdAreaIdHash> + std::unordered_map, + PropIdAreaIdHash> mClientsByPropIdArea GUARDED_BY(mLock); - std::unordered_map, + std::unordered_map, PropIdAreaIdHash>> mSubscriptionsByClient GUARDED_BY(mLock); // RecurrentTimer is thread-safe. @@ -141,6 +146,9 @@ class SubscriptionManager final { const GetValueFunc mGetValue; static ::android::base::Result getInterval(float sampleRate); + + // Checks whether the manager is empty. For testing purpose. + bool isEmpty(); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index c4cbc68c8c..3e088c5ee8 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -42,7 +42,6 @@ using ::aidl::android::hardware::automotive::vehicle::GetValueRequest; using ::aidl::android::hardware::automotive::vehicle::GetValueRequests; using ::aidl::android::hardware::automotive::vehicle::GetValueResult; using ::aidl::android::hardware::automotive::vehicle::GetValueResults; -using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback; using ::aidl::android::hardware::automotive::vehicle::SetValueRequest; using ::aidl::android::hardware::automotive::vehicle::SetValueRequests; using ::aidl::android::hardware::automotive::vehicle::SetValueResult; @@ -62,6 +61,8 @@ using ::android::base::Error; using ::android::base::expected; using ::android::base::Result; using ::android::base::StringPrintf; + +using ::ndk::ScopedAIBinder_DeathRecipient; using ::ndk::ScopedAStatus; std::string toString(const std::unordered_set& values) { @@ -86,10 +87,15 @@ std::shared_ptr DefaultVehicleHal::SubscriptionClients::getC int64_t DefaultVehicleHal::SubscribeIdByClient::getId(const CallbackType& callback) { std::scoped_lock lockGuard(mLock); // This would be initialized to 0 if callback does not exist in the map. - int64_t subscribeId = (mIds[callback])++; + int64_t subscribeId = (mIds[callback->asBinder().get()])++; return subscribeId; } +void DefaultVehicleHal::SubscriptionClients::removeClient(const AIBinder* clientId) { + std::scoped_lock lockGuard(mLock); + mClients.erase(clientId); +} + size_t DefaultVehicleHal::SubscriptionClients::countClients() { std::scoped_lock lockGuard(mLock); return mClients.size(); @@ -139,6 +145,17 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) std::make_shared>([hardwareCopy, subscriptionManagerCopy]() { checkHealth(hardwareCopy, subscriptionManagerCopy); })); + + mLinkToDeathImpl = std::make_unique(); + mDeathRecipient = ScopedAIBinder_DeathRecipient( + AIBinder_DeathRecipient_new(&DefaultVehicleHal::onBinderDied)); + AIBinder_DeathRecipient_setOnUnlinked(mDeathRecipient.get(), + &DefaultVehicleHal::onBinderUnlinked); +} + +DefaultVehicleHal::~DefaultVehicleHal() { + // Delete the deathRecipient so that onBinderDied would not be called to reference 'this'. + mDeathRecipient = ScopedAIBinder_DeathRecipient(); } void DefaultVehicleHal::onPropertyChangeEvent( @@ -161,26 +178,73 @@ void DefaultVehicleHal::onPropertyChangeEvent( template std::shared_ptr DefaultVehicleHal::getOrCreateClient( - std::unordered_map>* clients, const CallbackType& callback, - std::shared_ptr pendingRequestPool) { - if (clients->find(callback) == clients->end()) { - // TODO(b/204943359): Remove client from clients when linkToDeath is implemented. - (*clients)[callback] = std::make_shared(pendingRequestPool, callback); + std::unordered_map>* clients, + const CallbackType& callback, std::shared_ptr pendingRequestPool) { + const AIBinder* clientId = callback->asBinder().get(); + if (clients->find(clientId) == clients->end()) { + (*clients)[clientId] = std::make_shared(pendingRequestPool, callback); } - return (*clients)[callback]; + return (*clients)[clientId]; +} + +void DefaultVehicleHal::monitorBinderLifeCycle(const CallbackType& callback) { + AIBinder* clientId = callback->asBinder().get(); + { + std::scoped_lock lockGuard(mLock); + if (mOnBinderDiedContexts.find(clientId) != mOnBinderDiedContexts.end()) { + // Already registered. + return; + } + } + + std::unique_ptr context = std::make_unique( + OnBinderDiedContext{.vhal = this, .clientId = clientId}); + binder_status_t status = mLinkToDeathImpl->linkToDeath(clientId, mDeathRecipient.get(), + static_cast(context.get())); + if (status == STATUS_OK) { + std::scoped_lock lockGuard(mLock); + // Insert into a map to keep the context object alive. + mOnBinderDiedContexts[clientId] = std::move(context); + } else { + ALOGE("failed to call linkToDeath on client binder, status: %d", static_cast(status)); + } +} + +void DefaultVehicleHal::onBinderDied(void* cookie) { + OnBinderDiedContext* context = reinterpret_cast(cookie); + context->vhal->onBinderDiedWithContext(context->clientId); +} + +void DefaultVehicleHal::onBinderDiedWithContext(const AIBinder* clientId) { + std::scoped_lock lockGuard(mLock); + mSetValuesClients.erase(clientId); + mGetValuesClients.erase(clientId); + mSubscriptionClients->removeClient(clientId); + mSubscriptionManager->unsubscribe(clientId); +} + +void DefaultVehicleHal::onBinderUnlinked(void* cookie) { + // Delete the context associated with this cookie. + OnBinderDiedContext* context = reinterpret_cast(cookie); + context->vhal->onBinderUnlinkedWithContext(context->clientId); +} + +void DefaultVehicleHal::onBinderUnlinkedWithContext(const AIBinder* clientId) { + std::scoped_lock lockGuard(mLock); + mOnBinderDiedContexts.erase(clientId); } template std::shared_ptr DefaultVehicleHal::getOrCreateClient( - std::unordered_map>* clients, + std::unordered_map>* clients, const CallbackType& callback, std::shared_ptr pendingRequestPool); template std::shared_ptr DefaultVehicleHal::getOrCreateClient( - std::unordered_map>* clients, + std::unordered_map>* clients, const CallbackType& callback, std::shared_ptr pendingRequestPool); template std::shared_ptr DefaultVehicleHal::getOrCreateClient( - std::unordered_map>* clients, + std::unordered_map>* clients, const CallbackType& callback, std::shared_ptr pendingRequestPool); void DefaultVehicleHal::getValueFromHardwareCallCallback( @@ -268,6 +332,8 @@ Result DefaultVehicleHal::checkProperty(const VehiclePropValue& propValue) ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, const GetValueRequests& requests) { + monitorBinderLifeCycle(callback); + expected, ScopedAStatus> deserializedResults = fromStableLargeParcelable(requests); if (!deserializedResults.ok()) { @@ -344,6 +410,8 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, const SetValueRequests& requests) { + monitorBinderLifeCycle(callback); + expected, ScopedAStatus> deserializedResults = fromStableLargeParcelable(requests); if (!deserializedResults.ok()) { @@ -526,6 +594,8 @@ Result DefaultVehicleHal::checkSubscribeOptions( ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, const std::vector& options, [[maybe_unused]] int32_t maxSharedMemoryFileCount) { + monitorBinderLifeCycle(callback); + // TODO(b/205189110): Use shared memory file count. if (auto result = checkSubscribeOptions(options); !result.ok()) { ALOGE("subscribe: invalid subscribe options: %s", getErrorMsg(result).c_str()); @@ -571,7 +641,7 @@ ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, ScopedAStatus DefaultVehicleHal::unsubscribe(const CallbackType& callback, const std::vector& propIds) { - return toScopedAStatus(mSubscriptionManager->unsubscribe(callback, propIds), + return toScopedAStatus(mSubscriptionManager->unsubscribe(callback->asBinder().get(), propIds), StatusCode::INVALID_ARG); } @@ -639,6 +709,15 @@ void DefaultVehicleHal::checkHealth(std::weak_ptr hardware, return; } +binder_status_t DefaultVehicleHal::AIBinderLinkToDeathImpl::linkToDeath( + AIBinder* binder, AIBinder_DeathRecipient* recipient, void* cookie) { + return AIBinder_linkToDeath(binder, recipient, cookie); +} + +void DefaultVehicleHal::setLinkToDeathImpl(std::unique_ptr impl) { + mLinkToDeathImpl = std::move(impl); +} + } // 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 ff996fec3d..21bfba6e3a 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp @@ -26,7 +26,7 @@ namespace vehicle { namespace { -constexpr float ONE_SECOND_IN_NANO = 1000000000.; +constexpr float ONE_SECOND_IN_NANO = 1'000'000'000.; } // namespace @@ -100,6 +100,7 @@ Result SubscriptionManager::subscribe(const std::shared_ptrasBinder().get(); for (const auto& option : options) { int32_t propId = option.propId; const std::vector& areaIds = option.areaIds; @@ -118,7 +119,7 @@ Result SubscriptionManager::subscribe(const std::shared_ptr( mTimer, [this, callback, propValueRequest] { @@ -126,24 +127,24 @@ Result SubscriptionManager::subscribe(const std::shared_ptr(); } - mClientsByPropIdArea[propIdAreaId].insert(callback); + mClientsByPropIdArea[propIdAreaId][clientId] = callback; } } return {}; } -Result SubscriptionManager::unsubscribe(const std::shared_ptr& callback, +Result SubscriptionManager::unsubscribe(SubscriptionManager::ClientIdType clientId, const std::vector& propIds) { std::scoped_lock lockGuard(mLock); - if (mSubscriptionsByClient.find(callback) == mSubscriptionsByClient.end()) { + if (mSubscriptionsByClient.find(clientId) == mSubscriptionsByClient.end()) { return Error() << "No property was subscribed for the callback"; } std::unordered_set subscribedPropIds; - for (auto const& [propIdAreaId, _] : mSubscriptionsByClient[callback]) { + for (auto const& [propIdAreaId, _] : mSubscriptionsByClient[clientId]) { subscribedPropIds.insert(propIdAreaId.propId); } @@ -153,13 +154,13 @@ Result SubscriptionManager::unsubscribe(const std::shared_ptrfirst.propId; if (std::find(propIds.begin(), propIds.end(), propId) != propIds.end()) { auto& clients = mClientsByPropIdArea[it->first]; - clients.erase(callback); + clients.erase(clientId); if (clients.empty()) { mClientsByPropIdArea.erase(it->first); } @@ -169,27 +170,27 @@ Result SubscriptionManager::unsubscribe(const std::shared_ptr SubscriptionManager::unsubscribe(const std::shared_ptr& callback) { +Result SubscriptionManager::unsubscribe(SubscriptionManager::ClientIdType clientId) { std::scoped_lock lockGuard(mLock); - if (mSubscriptionsByClient.find(callback) == mSubscriptionsByClient.end()) { - return Error() << "No property was subscribed for the callback"; + if (mSubscriptionsByClient.find(clientId) == mSubscriptionsByClient.end()) { + return Error() << "No property was subscribed for this client"; } - auto& subscriptions = mSubscriptionsByClient[callback]; + auto& subscriptions = mSubscriptionsByClient[clientId]; for (auto const& [propIdAreaId, _] : subscriptions) { auto& clients = mClientsByPropIdArea[propIdAreaId]; - clients.erase(callback); + clients.erase(clientId); if (clients.empty()) { mClientsByPropIdArea.erase(propIdAreaId); } } - mSubscriptionsByClient.erase(callback); + mSubscriptionsByClient.erase(clientId); return {}; } @@ -207,8 +208,8 @@ SubscriptionManager::getSubscribedClients(const std::vector& u if (mClientsByPropIdArea.find(propIdAreaId) == mClientsByPropIdArea.end()) { continue; } - for (const auto& client : mClientsByPropIdArea[propIdAreaId]) { - if (!mSubscriptionsByClient[client][propIdAreaId]->isOnChange()) { + for (const auto& [clientId, client] : mClientsByPropIdArea[propIdAreaId]) { + if (!mSubscriptionsByClient[clientId][propIdAreaId]->isOnChange()) { continue; } clients[client].push_back(&value); @@ -217,6 +218,11 @@ SubscriptionManager::getSubscribedClients(const std::vector& u return clients; } +bool SubscriptionManager::isEmpty() { + std::scoped_lock lockGuard(mLock); + return mSubscriptionsByClient.empty() && mClientsByPropIdArea.empty(); +} + SubscriptionManager::RecurrentSubscription::RecurrentSubscription( std::shared_ptr timer, std::function&& action, int64_t interval) : mAction(std::make_shared>(action)), mTimer(timer) { diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 54fc17d29c..ff355c33e1 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -73,6 +73,7 @@ using ::android::base::Result; using ::ndk::ScopedAStatus; using ::ndk::ScopedFileDescriptor; +using ::ndk::SpAIBinder; using ::testing::Eq; using ::testing::UnorderedElementsAre; @@ -324,7 +325,12 @@ class DefaultVehicleHalTest : public ::testing::Test { mVhal = ndk::SharedRefBase::make(std::move(hardware)); mVhalClient = IVehicle::fromBinder(mVhal->asBinder()); mCallback = ndk::SharedRefBase::make(); - mCallbackClient = IVehicleCallback::fromBinder(mCallback->asBinder()); + // Keep the local binder alive. + mBinder = mCallback->asBinder(); + mCallbackClient = IVehicleCallback::fromBinder(mBinder); + + // Set the linkToDeath to a fake implementation that always returns OK. + setTestLinkToDeathImpl(); } void TearDown() override { @@ -342,10 +348,36 @@ class DefaultVehicleHalTest : public ::testing::Test { void setTimeout(int64_t timeoutInNano) { mVhal->setTimeout(timeoutInNano); } + void setTestLinkToDeathImpl() { + mVhal->setLinkToDeathImpl(std::make_unique()); + } + size_t countPendingRequests() { return mVhal->mPendingRequestPool->countPendingRequests(); } + size_t countClients() { + std::scoped_lock lockGuard(mVhal->mLock); + return mVhal->mGetValuesClients.size() + mVhal->mSetValuesClients.size() + + mVhal->mSubscriptionClients->countClients(); + } + std::shared_ptr getPool() { return mVhal->mPendingRequestPool; } + void onBinderDied(void* cookie) { return mVhal->onBinderDied(cookie); } + + void onBinderUnlinked(void* cookie) { return mVhal->onBinderUnlinked(cookie); } + + void* getOnBinderDiedContexts(AIBinder* clientId) { + std::scoped_lock lockGuard(mVhal->mLock); + return mVhal->mOnBinderDiedContexts[clientId].get(); + } + + bool countOnBinderDiedContexts() { + std::scoped_lock lockGuard(mVhal->mLock); + return mVhal->mOnBinderDiedContexts.size(); + } + + bool hasNoSubscriptions() { return mVhal->mSubscriptionManager->isEmpty(); } + static Result getValuesTestCases(size_t size, GetValueRequests& requests, std::vector& expectedResults, std::vector& expectedHardwareRequests) { @@ -416,18 +448,20 @@ class DefaultVehicleHalTest : public ::testing::Test { return {}; } - size_t countClients() { - std::scoped_lock lockGuard(mVhal->mLock); - return mVhal->mGetValuesClients.size() + mVhal->mSetValuesClients.size() + - mVhal->mSubscriptionClients->countClients(); - } - private: std::shared_ptr mVhal; std::shared_ptr mVhalClient; MockVehicleHardware* mHardwarePtr; std::shared_ptr mCallback; std::shared_ptr mCallbackClient; + SpAIBinder mBinder; + + class TestLinkToDeathImpl final : public DefaultVehicleHal::ILinkToDeath { + public: + binder_status_t linkToDeath(AIBinder*, AIBinder_DeathRecipient*, void*) override { + return STATUS_OK; + } + }; }; TEST_F(DefaultVehicleHalTest, testGetAllPropConfigsSmall) { @@ -1445,6 +1479,71 @@ TEST_F(DefaultVehicleHalTest, testHeartbeatEvent) { << "expect to get the latest timestamp with the heartbeat event"; } +TEST_F(DefaultVehicleHalTest, testOnBinderDiedUnlinked) { + // First subscribe to a continuous property so that we register a death recipient for our + // client. + VehiclePropValue testValue{ + .prop = GLOBAL_CONTINUOUS_PROP, + .value.int32Values = {0}, + }; + // Set responses for all the hardware getValues requests. + getHardware()->setGetValueResponder( + [](std::shared_ptr callback, + const std::vector& requests) { + std::vector results; + for (auto& request : requests) { + VehiclePropValue prop = request.prop; + prop.value.int32Values = {0}; + results.push_back({ + .requestId = request.requestId, + .status = StatusCode::OK, + .prop = prop, + }); + } + (*callback)(results); + return StatusCode::OK; + }); + std::vector options = { + { + .propId = GLOBAL_CONTINUOUS_PROP, + .sampleRate = 20.0, + }, + }; + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + // Sleep for 100ms so that the subscriptionClient gets created because we would at least try to + // get value once. + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + + // Issue another getValue request on the same client. + GetValueRequests requests; + std::vector expectedResults; + std::vector expectedHardwareRequests; + ASSERT_TRUE(getValuesTestCases(1, requests, expectedResults, expectedHardwareRequests).ok()); + getHardware()->addGetValueResponses(expectedResults); + status = getClient()->getValues(getCallbackClient(), requests); + ASSERT_TRUE(status.isOk()) << "getValues failed: " << status.getMessage(); + + ASSERT_EQ(countOnBinderDiedContexts(), static_cast(1)) + << "expect one OnBinderDied context when one client is registered"; + + // Get the death recipient cookie for our callback that would be used in onBinderDied and + // onBinderUnlinked. + AIBinder* clientId = getCallbackClient()->asBinder().get(); + void* context = getOnBinderDiedContexts(clientId); + + onBinderDied(context); + + ASSERT_EQ(countClients(), static_cast(0)) + << "expect all clients to be removed when binder died"; + ASSERT_TRUE(hasNoSubscriptions()) << "expect no subscriptions when binder died"; + + onBinderUnlinked(context); + + ASSERT_EQ(countOnBinderDiedContexts(), static_cast(0)) + << "expect OnBinderDied context to be deleted when binder is unlinked"; +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp index c14f4fdcc0..f81b1a2998 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp @@ -45,6 +45,7 @@ using ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValues; using ::ndk::ScopedAStatus; +using ::ndk::SpAIBinder; using ::testing::ElementsAre; using ::testing::WhenSorted; @@ -95,7 +96,9 @@ class SubscriptionManagerTest : public ::testing::Test { 0); }); mCallback = ::ndk::SharedRefBase::make(); - mCallbackClient = IVehicleCallback::fromBinder(mCallback->asBinder()); + // Keep the local binder alive. + mBinder = mCallback->asBinder(); + mCallbackClient = IVehicleCallback::fromBinder(mBinder); } SubscriptionManager* getManager() { return mManager.get(); } @@ -112,6 +115,7 @@ class SubscriptionManagerTest : public ::testing::Test { std::unique_ptr mManager; std::shared_ptr mCallback; std::shared_ptr mCallbackClient; + SpAIBinder mBinder; }; TEST_F(SubscriptionManagerTest, testSubscribeGlobalContinuous) { @@ -229,7 +233,7 @@ TEST_F(SubscriptionManagerTest, testUnsubscribeGlobalContinuous) { auto result = getManager()->subscribe(getCallbackClient(), options, true); ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); - result = getManager()->unsubscribe(getCallbackClient()); + result = getManager()->unsubscribe(getCallbackClient()->asBinder().get()); ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message(); clearEvents(); @@ -257,7 +261,8 @@ TEST_F(SubscriptionManagerTest, testUnsubscribeMultipleAreas) { auto result = getManager()->subscribe(getCallbackClient(), options, true); ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); - result = getManager()->unsubscribe(getCallbackClient(), std::vector({0})); + result = getManager()->unsubscribe(getCallbackClient()->asBinder().get(), + std::vector({0})); ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message(); clearEvents(); @@ -289,7 +294,7 @@ TEST_F(SubscriptionManagerTest, testUnsubscribeByCallback) { auto result = getManager()->subscribe(getCallbackClient(), options, true); ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); - result = getManager()->unsubscribe(getCallbackClient()); + result = getManager()->unsubscribe(getCallbackClient()->asBinder().get()); ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message(); clearEvents(); @@ -315,12 +320,14 @@ TEST_F(SubscriptionManagerTest, testUnsubscribeFailure) { ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); // Property ID: 2 was not subscribed. - result = getManager()->unsubscribe(getCallbackClient(), std::vector({0, 1, 2})); + result = getManager()->unsubscribe(getCallbackClient()->asBinder().get(), + std::vector({0, 1, 2})); ASSERT_FALSE(result.ok()) << "unsubscribe an unsubscribed property must fail"; // Since property 0 and property 1 was not unsubscribed successfully, we should be able to // unsubscribe them again. - result = getManager()->unsubscribe(getCallbackClient(), std::vector({0, 1})); + result = getManager()->unsubscribe(getCallbackClient()->asBinder().get(), + std::vector({0, 1})); ASSERT_TRUE(result.ok()) << "a failed unsubscription must not unsubscribe any properties" << result.error().message(); } @@ -343,10 +350,10 @@ TEST_F(SubscriptionManagerTest, testSubscribeOnchange) { }, }; - std::shared_ptr client1 = IVehicleCallback::fromBinder( - ::ndk::SharedRefBase::make()->asBinder()); - std::shared_ptr client2 = IVehicleCallback::fromBinder( - ::ndk::SharedRefBase::make()->asBinder()); + SpAIBinder binder1 = ::ndk::SharedRefBase::make()->asBinder(); + std::shared_ptr client1 = IVehicleCallback::fromBinder(binder1); + SpAIBinder binder2 = ::ndk::SharedRefBase::make()->asBinder(); + std::shared_ptr client2 = IVehicleCallback::fromBinder(binder2); auto result = getManager()->subscribe(client1, options1, false); ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); result = getManager()->subscribe(client2, options2, false); @@ -447,7 +454,8 @@ TEST_F(SubscriptionManagerTest, testUnsubscribeOnchange) { auto result = getManager()->subscribe(getCallbackClient(), options, false); ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); - result = getManager()->unsubscribe(getCallbackClient(), std::vector({0})); + result = getManager()->unsubscribe(getCallbackClient()->asBinder().get(), + std::vector({0})); ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message(); std::vector updatedValues = { -- GitLab From a81deb0fbe90909a17a1a46f5ee9b199cff2d422 Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Mon, 10 Jan 2022 21:38:51 -0800 Subject: [PATCH 471/825] Add TYPE_HEADING sensor type definitions. Bug: 189983308 Test: Compile + Presubmits Change-Id: I6ea82097312d84dc0a3f957f936fec152b566bad --- .../android/hardware/sensors/Event.aidl | 6 +++++ .../android/hardware/sensors/SensorType.aidl | 1 + .../aidl/android/hardware/sensors/Event.aidl | 26 +++++++++++++++++++ .../android/hardware/sensors/SensorType.aidl | 15 +++++++++++ 4 files changed, 48 insertions(+) diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl index 763cb8edc6..4f49002fce 100644 --- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl +++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl @@ -54,6 +54,7 @@ parcelable Event { android.hardware.sensors.Event.EventPayload.HeadTracker headTracker; android.hardware.sensors.Event.EventPayload.LimitedAxesImu limitedAxesImu; android.hardware.sensors.Event.EventPayload.LimitedAxesImuUncal limitedAxesImuUncal; + android.hardware.sensors.Event.EventPayload.Heading heading; @FixedSize @VintfStability parcelable Vec4 { float x; @@ -114,6 +115,11 @@ parcelable Event { android.hardware.sensors.SensorStatus status; } @FixedSize @VintfStability + parcelable Heading { + float heading; + float accuracy; + } + @FixedSize @VintfStability parcelable MetaData { android.hardware.sensors.Event.EventPayload.MetaData.MetaDataEventType what; @Backing(type="int") @VintfStability diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl index 896617beec..8c864e90be 100644 --- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl +++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl @@ -75,5 +75,6 @@ enum SensorType { GYROSCOPE_LIMITED_AXES = 39, ACCELEROMETER_LIMITED_AXES_UNCALIBRATED = 40, GYROSCOPE_LIMITED_AXES_UNCALIBRATED = 41, + HEADING = 42, DEVICE_PRIVATE_BASE = 65536, } diff --git a/sensors/aidl/android/hardware/sensors/Event.aidl b/sensors/aidl/android/hardware/sensors/Event.aidl index 8b7e4097bb..e8550f184b 100644 --- a/sensors/aidl/android/hardware/sensors/Event.aidl +++ b/sensors/aidl/android/hardware/sensors/Event.aidl @@ -144,6 +144,11 @@ parcelable Event { */ LimitedAxesImuUncal limitedAxesImuUncal; + /** + * SensorType::HEADING + */ + Heading heading; + @FixedSize @VintfStability parcelable Vec4 { @@ -292,6 +297,27 @@ parcelable Event { SensorStatus status; } + @FixedSize + @VintfStability + parcelable Heading { + /** + * The direction in which the device is pointing relative to true + * north in degrees. The value must be between 0.0 (inclusive) and + * 360.0 (exclusive), with 0 indicating north, 90 east, 180 south, + * and 270 west. + */ + float heading; + /** + * Accuracy is defined at 68% confidence. In the case where the + * underlying distribution is assumed Gaussian normal, this would be + * considered one standard deviation. For example, if the heading + * returns 60 degrees, and accuracy returns 10 degrees, then there + * is a 68 percent probability of the true heading being between 50 + * degrees and 70 degrees. + */ + float accuracy; + } + @FixedSize @VintfStability parcelable MetaData { diff --git a/sensors/aidl/android/hardware/sensors/SensorType.aidl b/sensors/aidl/android/hardware/sensors/SensorType.aidl index 000728c83e..9098894cc7 100644 --- a/sensors/aidl/android/hardware/sensors/SensorType.aidl +++ b/sensors/aidl/android/hardware/sensors/SensorType.aidl @@ -702,6 +702,21 @@ enum SensorType { */ GYROSCOPE_LIMITED_AXES_UNCALIBRATED = 41, + /** + * HEADING + * reporting-mode: continuous + * + * A sensor of this type measures the direction in which the device is + * pointing relative to true north in degrees. + * + * This sensor was added for automotive form factors. Other devices with a + * clear forward direction might find it useful as well. However, devices + * with a more ambiguous orientation such as phones or wearables might want + * to consider using other sensors such as Sensor.TYPE_ROTATION_VECTOR + * which might be more suitable. + */ + HEADING = 42, + /** * Base for device manufacturers private sensor types. * These sensor types can't be exposed in the SDK. -- GitLab From 062bc9a3a6eff2de4e975e6f6a070bbf06135c08 Mon Sep 17 00:00:00 2001 From: Jason Macnak Date: Thu, 20 Jan 2022 15:00:09 -0800 Subject: [PATCH 472/825] Use IComposerClient::EX_UNSUPPORTED Bug: b/193240715 Test: cvd start Test: vts -m VtsHalGraphicsComposer3_TargetTest Change-Id: Ibf80a618dead09ffdea56d373a83a691124c7d2e --- .../vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index abfcbe40f7..1c75749f21 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1541,7 +1541,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerColorTransform) { execute(); const auto errors = mReader.takeErrors(); - if (errors.size() == 1 && errors[0].errorCode == EX_UNSUPPORTED_OPERATION) { + if (errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_UNSUPPORTED) { GTEST_SUCCEED() << "setLayerColorTransform is not supported"; return; } @@ -1558,7 +1558,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { execute(); const auto errors = mReader.takeErrors(); EXPECT_EQ(1, errors.size()); - EXPECT_EQ(EX_UNSUPPORTED_OPERATION, errors[0].errorCode); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, errors[0].errorCode); GTEST_SUCCEED() << "SetDisplayBrightness is not supported"; return; } -- GitLab From 090f16c0b8687d569aab0977885ef45ced5d25c4 Mon Sep 17 00:00:00 2001 From: Yuchen He Date: Thu, 20 Jan 2022 22:57:09 +0000 Subject: [PATCH 473/825] Supported synchronized fixed location and measurement from device files Replace NMEA by one row fixed location data Test: atest VtsHalGnssTargetTest Test: launch_cvd -cpus 16 -memory_mb 16192 --start_gnss_proxy --gnss_file_path=/usr/local/google/home/yuchenhe/Downloads/raw.txt --fixed_location_file_path=/google/data/rw/users/yu/yuchenhe/input.txt Bug: 213225295 Change-Id: Ide7bbb3e81a90414496084691227bd95a2e7af18 --- gnss/aidl/default/Gnss.cpp | 8 ++++--- .../common/utils/default/DeviceFileReader.cpp | 22 ++++++++++++++----- gnss/common/utils/default/GnssReplayUtils.cpp | 13 +++++++++++ gnss/common/utils/default/include/Constants.h | 1 + .../utils/default/include/GnssReplayUtils.h | 4 ++++ 5 files changed, 40 insertions(+), 8 deletions(-) diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 6331dfd8dc..73f4085dd2 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -22,6 +22,7 @@ #include "AGnss.h" #include "AGnssRil.h" #include "DeviceFileReader.h" +#include "FixLocationParser.h" #include "GnssAntennaInfo.h" #include "GnssBatching.h" #include "GnssConfiguration.h" @@ -32,11 +33,9 @@ #include "GnssPsds.h" #include "GnssVisibilityControl.h" #include "MeasurementCorrectionsInterface.h" -#include "NmeaFixInfo.h" #include "Utils.h" namespace aidl::android::hardware::gnss { -using ::android::hardware::gnss::common::NmeaFixInfo; using ::android::hardware::gnss::common::Utils; using ndk::ScopedAStatus; @@ -70,9 +69,12 @@ ScopedAStatus Gnss::setCallback(const std::shared_ptr& callback) } std::unique_ptr Gnss::getLocationFromHW() { + if (!::android::hardware::gnss::common::ReplayUtils::hasFixedLocationDeviceFile()) { + return nullptr; + } std::string inputStr = ::android::hardware::gnss::common::DeviceFileReader::Instance().getLocationData(); - return ::android::hardware::gnss::common::NmeaFixInfo::getAidlLocationFromInputStr(inputStr); + return ::android::hardware::gnss::common::FixLocationParser::getLocationFromInputStr(inputStr); } ScopedAStatus Gnss::start() { diff --git a/gnss/common/utils/default/DeviceFileReader.cpp b/gnss/common/utils/default/DeviceFileReader.cpp index 7d4fb04339..dfc086a8b8 100644 --- a/gnss/common/utils/default/DeviceFileReader.cpp +++ b/gnss/common/utils/default/DeviceFileReader.cpp @@ -22,8 +22,17 @@ namespace common { void DeviceFileReader::getDataFromDeviceFile(const std::string& command, int mMinIntervalMs) { char inputBuffer[INPUT_BUFFER_SIZE]; - int mGnssFd = open(ReplayUtils::getGnssPath().c_str(), - O_RDWR | O_NONBLOCK); + std::string deviceFilePath = ""; + if (command == CMD_GET_LOCATION) { + deviceFilePath = ReplayUtils::getFixedLocationPath(); + } else if (command == CMD_GET_RAWMEASUREMENT) { + deviceFilePath = ReplayUtils::getGnssPath(); + } else { + // Invalid command + return; + } + + int mGnssFd = open(deviceFilePath.c_str(), O_RDWR | O_NONBLOCK); if (mGnssFd == -1) { return; @@ -68,10 +77,13 @@ void DeviceFileReader::getDataFromDeviceFile(const std::string& command, int mMi } // Cache the injected data. - if (ReplayUtils::isGnssRawMeasurement(inputStr)) { - data_[CMD_GET_RAWMEASUREMENT] = inputStr; - } else if (ReplayUtils::isNMEA(inputStr)) { + if (command == CMD_GET_LOCATION) { + // TODO validate data data_[CMD_GET_LOCATION] = inputStr; + } else if (command == CMD_GET_RAWMEASUREMENT) { + if (ReplayUtils::isGnssRawMeasurement(inputStr)) { + data_[CMD_GET_RAWMEASUREMENT] = inputStr; + } } } diff --git a/gnss/common/utils/default/GnssReplayUtils.cpp b/gnss/common/utils/default/GnssReplayUtils.cpp index 535647716b..37da57171f 100644 --- a/gnss/common/utils/default/GnssReplayUtils.cpp +++ b/gnss/common/utils/default/GnssReplayUtils.cpp @@ -29,11 +29,24 @@ std::string ReplayUtils::getGnssPath() { return GNSS_PATH; } +std::string ReplayUtils::getFixedLocationPath() { + char devname_value[PROPERTY_VALUE_MAX] = ""; + if (property_get("debug.location.fixedlocation.devname", devname_value, NULL) > 0) { + return devname_value; + } + return FIXED_LOCATION_PATH; +} + bool ReplayUtils::hasGnssDeviceFile() { struct stat sb; return stat(getGnssPath().c_str(), &sb) != -1; } +bool ReplayUtils::hasFixedLocationDeviceFile() { + struct stat sb; + return stat(getFixedLocationPath().c_str(), &sb) != -1; +} + bool ReplayUtils::isGnssRawMeasurement(const std::string& inputStr) { // TODO: add more logic check to by pass invalid data. return !inputStr.empty() && (inputStr.find("Raw") != std::string::npos); diff --git a/gnss/common/utils/default/include/Constants.h b/gnss/common/utils/default/include/Constants.h index f205ba603c..489413e21d 100644 --- a/gnss/common/utils/default/include/Constants.h +++ b/gnss/common/utils/default/include/Constants.h @@ -36,6 +36,7 @@ const float kIrnssL5FreqHz = 1176.45 * 1e6; // Location replay constants constexpr char GNSS_PATH[] = "/dev/gnss0"; +constexpr char FIXED_LOCATION_PATH[] = "/dev/gnss1"; constexpr int INPUT_BUFFER_SIZE = 256; constexpr char CMD_GET_LOCATION[] = "CMD_GET_LOCATION"; constexpr char CMD_GET_RAWMEASUREMENT[] = "CMD_GET_RAWMEASUREMENT"; diff --git a/gnss/common/utils/default/include/GnssReplayUtils.h b/gnss/common/utils/default/include/GnssReplayUtils.h index 32c0e58c0c..d1bbed4b41 100644 --- a/gnss/common/utils/default/include/GnssReplayUtils.h +++ b/gnss/common/utils/default/include/GnssReplayUtils.h @@ -37,10 +37,14 @@ namespace common { struct ReplayUtils { static std::string getGnssPath(); + static std::string getFixedLocationPath(); + static std::string getDataFromDeviceFile(const std::string& command, int mMinIntervalMs); static bool hasGnssDeviceFile(); + static bool hasFixedLocationDeviceFile(); + static bool isGnssRawMeasurement(const std::string& inputStr); static bool isNMEA(const std::string& inputStr); -- GitLab From a0b56bde1100acfe383a3ea11c449516e36087ff Mon Sep 17 00:00:00 2001 From: Midas Chien Date: Thu, 13 Jan 2022 23:27:33 +0800 Subject: [PATCH 474/825] composer: add API to control display idle timer Add new functions to control display idle timer - Adding an API to r configure display idle timer. - Extend DisplayCapability to query display support idle timer. - Adding an callback for notify client the display is idle, the refresh rate changed to a lower setting to preserve power and vsync cadence changed. The client can enable vsync callback to learn the new vsync cadence before sending a new frame. Bug: 194068871 Bug: 198808492 Test: build, vts Change-Id: I47649d222022922926a05f2d700ca798f8f48b35 --- .../graphics/composer3/DisplayCapability.aidl | 1 + .../graphics/composer3/IComposerCallback.aidl | 1 + .../graphics/composer3/IComposerClient.aidl | 1 + .../graphics/composer3/DisplayCapability.aidl | 5 ++ .../graphics/composer3/IComposerCallback.aidl | 10 +++ .../graphics/composer3/IComposerClient.aidl | 21 +++++ .../VtsHalGraphicsComposer3_TargetTest.cpp | 76 +++++++++++++++++++ .../composer-vts/GraphicsComposerCallback.cpp | 20 +++++ .../include/GraphicsComposerCallback.h | 10 ++- 9 files changed, 144 insertions(+), 1 deletion(-) 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 fdf110032d..b41ac8a78a 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 @@ enum DisplayCapability { AUTO_LOW_LATENCY_MODE = 5, SUSPEND = 6, DISPLAY_DECORATION = 7, + DISPLAY_IDLE_TIMER = 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 f82d02eeed..21620e7f31 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 @@ -39,4 +39,5 @@ interface IComposerCallback { oneway void onSeamlessPossible(long display); oneway void onVsync(long display, long timestamp, int vsyncPeriodNanos); oneway void onVsyncPeriodTimingChanged(long display, in android.hardware.graphics.composer3.VsyncPeriodChangeTimeline updatedTimeline); + oneway void onVsyncIdle(long display); } 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 5593c57069..2de699b94a 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 @@ -73,6 +73,7 @@ interface IComposerClient { void setPowerMode(long display, android.hardware.graphics.composer3.PowerMode mode); void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, in @nullable ParcelFileDescriptor releaseFence); void setVsyncEnabled(long display, boolean enabled); + void setIdleTimerEnabled(long display, int timeoutMs); const int EX_BAD_CONFIG = 1; const int EX_BAD_DISPLAY = 2; const int EX_BAD_LAYER = 3; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl index 249fed03a0..85136c44d9 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl @@ -79,4 +79,9 @@ enum DisplayCapability { * Indicates that the display supports Composition.DISPLAY_DECORATION. */ DISPLAY_DECORATION = 7, + /** + * Indicates that the display supports IComposerClient.setIdleTimerEnabled and + * IComposerCallback.onVsyncIdle. + */ + DISPLAY_IDLE_TIMER = 8, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl index ac95b41a38..67954d4cc5 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl @@ -86,4 +86,14 @@ interface IComposerCallback { */ oneway void onVsyncPeriodTimingChanged( long display, in VsyncPeriodChangeTimeline updatedTimeline); + + /** + * Notifies the client that the display is idle, the refresh rate changed to a lower setting to + * preserve power and vsync cadence changed. When a new frame is queued for presentation, the + * client is expected to enable vsync callbacks to learn the new vsync cadence before sending + * a new frame. + * + * @param display is the display whose vsync cadence changed due to panel idle mode. + */ + oneway void onVsyncIdle(long display); } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index c86b9bdaec..2fe6656cb5 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -779,4 +779,25 @@ interface IComposerClient { * @exception EX_BAD_PARAMETER when enabled was an invalid value. */ void setVsyncEnabled(long display, boolean enabled); + + /** + * Enables or disables the idle timer on this display. + * + * Idle timer is used to allow the display to go into a panel idle mode after some + * idle period. + * + * This function should only be called if the display reports support for + * DisplayCapability.DISPLAY_IDLE from getDisplayCapabilities. + * + * @param display is the display to which the idle timer is set. + * @param timeoutMs is the minimum requirements of idle period in milliseconds. Panel + * should not go into the idle state within the minimum requirement after + * idle for a while. 0 means disabled, panel should not go into idle state. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_BAD_PARAMETER when timeout is a negative number. + * @exception EX_UNSUPPORTED when idle is not supported on this display. + * + */ + void setIdleTimerEnabled(long display, int timeoutMs); } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 1cfd3f95bb..1c84674d97 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1383,6 +1383,14 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { return layer; } + bool hasDisplayCapability(int64_t display, DisplayCapability cap) { + std::vector capabilities; + const auto error = mComposerClient->getDisplayCapabilities(display, &capabilities); + EXPECT_TRUE(error.isOk()); + + return std::find(capabilities.begin(), capabilities.end(), cap) != capabilities.end(); + } + void Test_setActiveConfigWithConstraints(const TestParameters& params) { for (VtsDisplay& display : mDisplays) { forEachTwoConfigs(display.get(), [&](int32_t config1, int32_t config2) { @@ -2134,6 +2142,74 @@ TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_5) { ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(5)); } +TEST_P(GraphicsComposerAidlCommandTest, setIdleTimerEnabled_Unsupported) { + const bool hasDisplayIdleTimerSupport = hasDisplayCapability(mPrimaryDisplay, + DisplayCapability::DISPLAY_IDLE_TIMER); + if (!hasDisplayIdleTimerSupport) { + const auto error = mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, 0); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + } +} + +TEST_P(GraphicsComposerAidlCommandTest, setIdleTimerEnabled_BadParameter) { + const bool hasDisplayIdleTimerSupport = hasDisplayCapability(mPrimaryDisplay, + DisplayCapability::DISPLAY_IDLE_TIMER); + if (!hasDisplayIdleTimerSupport) { + GTEST_SUCCEED() << "DisplayCapability::DISPLAY_IDLE_TIMER is not supported"; + return; + } + + const auto error = mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, -1); + EXPECT_FALSE(error.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError()); +} + +TEST_P(GraphicsComposerAidlCommandTest, setIdleTimerEnabled_Disable) { + const bool hasDisplayIdleTimerSupport = hasDisplayCapability(mPrimaryDisplay, + DisplayCapability::DISPLAY_IDLE_TIMER); + if (!hasDisplayIdleTimerSupport) { + GTEST_SUCCEED() << "DisplayCapability::DISPLAY_IDLE_TIMER is not supported"; + return; + } + + EXPECT_TRUE(mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, 0).isOk()); + std::this_thread::sleep_for(1s); + EXPECT_EQ(0, mComposerCallback->getVsyncIdleCount()); +} + +TEST_P(GraphicsComposerAidlCommandTest, setIdleTimerEnabled_Timeout_2) { + const bool hasDisplayIdleTimerSupport = hasDisplayCapability(mPrimaryDisplay, + DisplayCapability::DISPLAY_IDLE_TIMER); + if (!hasDisplayIdleTimerSupport) { + GTEST_SUCCEED() << "DisplayCapability::DISPLAY_IDLE_TIMER is not supported"; + return; + } + + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk()); + EXPECT_TRUE(mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, 0).isOk()); + + const auto buffer = allocate(); + ASSERT_NE(nullptr, buffer->handle); + + const auto layer = createOnScreenLayer(); + mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, buffer->handle, -1); + int32_t vsyncIdleCount = mComposerCallback->getVsyncIdleCount(); + auto earlyVsyncIdleTime = systemTime() + std::chrono::nanoseconds(2s).count(); + EXPECT_TRUE(mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, 2000).isOk()); + + const sp<::android::Fence> presentFence = + presentAndGetFence(ComposerClientWriter::kNoTimestamp); + presentFence->waitForever(LOG_TAG); + + std::this_thread::sleep_for(3s); + if (vsyncIdleCount < mComposerCallback->getVsyncIdleCount()) { + EXPECT_GE(mComposerCallback->getVsyncIdleTime(), earlyVsyncIdleTime); + } + + EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk()); +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest); INSTANTIATE_TEST_SUITE_P( PerInstance, GraphicsComposerAidlCommandTest, diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/GraphicsComposerCallback.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/GraphicsComposerCallback.cpp index 307fe158d1..22b5d796fc 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/GraphicsComposerCallback.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/GraphicsComposerCallback.cpp @@ -16,6 +16,7 @@ #include "include/GraphicsComposerCallback.h" #include +#include #pragma push_macro("LOG_TAG") #undef LOG_TAG @@ -58,6 +59,16 @@ int32_t GraphicsComposerCallback::getInvalidSeamlessPossibleCount() const { return mInvalidSeamlessPossibleCount; } +int32_t GraphicsComposerCallback::getVsyncIdleCount() const { + std::scoped_lock lock(mMutex); + return mVsyncIdleCount; +} + +int64_t GraphicsComposerCallback::getVsyncIdleTime() const { + std::scoped_lock lock(mMutex); + return mVsyncIdleTime; +} + std::optional GraphicsComposerCallback::takeLastVsyncPeriodChangeTimeline() { std::scoped_lock lock(mMutex); @@ -125,4 +136,13 @@ GraphicsComposerCallback::takeLastVsyncPeriodChangeTimeline() { return ::ndk::ScopedAStatus::ok(); } +::ndk::ScopedAStatus GraphicsComposerCallback::onVsyncIdle(int64_t in_display) { + std::scoped_lock lock(mMutex); + if (mDisplays.count(in_display)) { + mVsyncIdleCount++; + mVsyncIdleTime = systemTime(); + } + return ::ndk::ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::graphics::composer3::vts diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h index c359d5eaa2..f25f36d4a4 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h @@ -45,6 +45,10 @@ class GraphicsComposerCallback : public BnComposerCallback { int32_t getInvalidSeamlessPossibleCount() const; + int32_t getVsyncIdleCount() const; + + int64_t getVsyncIdleTime() const; + std::optional takeLastVsyncPeriodChangeTimeline(); private: @@ -57,6 +61,7 @@ class GraphicsComposerCallback : public BnComposerCallback { int64_t in_display, const ::aidl::android::hardware::graphics::composer3::VsyncPeriodChangeTimeline& in_updatedTimeline) override; + virtual ::ndk::ScopedAStatus onVsyncIdle(int64_t in_display) override; mutable std::mutex mMutex; // the set of all currently connected displays @@ -66,6 +71,9 @@ class GraphicsComposerCallback : public BnComposerCallback { std::optional mTimeline GUARDED_BY(mMutex); + int32_t mVsyncIdleCount GUARDED_BY(mMutex) = 0; + int64_t mVsyncIdleTime GUARDED_BY(mMutex) = 0; + // track invalid callbacks int32_t mInvalidHotplugCount GUARDED_BY(mMutex) = 0; int32_t mInvalidRefreshCount GUARDED_BY(mMutex) = 0; @@ -74,4 +82,4 @@ class GraphicsComposerCallback : public BnComposerCallback { int32_t mInvalidSeamlessPossibleCount GUARDED_BY(mMutex) = 0; }; -} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file +} // namespace aidl::android::hardware::graphics::composer3::vts -- GitLab From f68d9c42b8b16a114da625ad7f417e3fc27b1a03 Mon Sep 17 00:00:00 2001 From: Rios Kao Date: Fri, 21 Jan 2022 07:40:23 +0000 Subject: [PATCH 475/825] soundtrigger: add host_supported support host build for development. Test: build pass Bug: 206738138 Change-Id: I55d1b2bcdbf234efc9ca98aca00b9777327fe16c --- soundtrigger/aidl/Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/soundtrigger/aidl/Android.bp b/soundtrigger/aidl/Android.bp index fcccc27722..28e809047a 100644 --- a/soundtrigger/aidl/Android.bp +++ b/soundtrigger/aidl/Android.bp @@ -10,6 +10,7 @@ package { aidl_interface { name: "android.hardware.soundtrigger3", vendor_available: true, + host_supported: true, flags: ["-Werror", "-Weverything", ], srcs: [ "android/hardware/soundtrigger3/ISoundTriggerHw.aidl", -- GitLab From b9f69ea7763fe7e9ce1af933acb9b9aae9bbff8f Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Tue, 19 Oct 2021 13:09:44 -0700 Subject: [PATCH 476/825] Migrate IUsb to AIDL This change migrates android.hardware.usb.IUsb to AIDL and adds the default implementation. Compared to the HIDL interface, AIDL based interface adds transactionId argument to each of the interface method which is used while invoking the corresponding callback. Bug: 200993386 Bug: 199357330 Test: Ran new hal implementation on Pixel. Yet to run VTS. Change-Id: Id8aa40682d4c4b435c63b3ae249b176276dbb31d --- .../compatibility_matrix.current.xml | 7 + usb/aidl/Android.bp | 33 + .../usb/ContaminantDetectionStatus.aidl | 41 ++ .../usb/ContaminantProtectionMode.aidl | 41 ++ .../usb/ContaminantProtectionStatus.aidl | 42 ++ .../current/android/hardware/usb/IUsb.aidl | 42 ++ .../android/hardware/usb/IUsbCallback.aidl | 42 ++ .../android/hardware/usb/PortDataRole.aidl | 40 + .../android/hardware/usb/PortMode.aidl | 43 ++ .../android/hardware/usb/PortPowerRole.aidl | 40 + .../android/hardware/usb/PortRole.aidl | 40 + .../android/hardware/usb/PortStatus.aidl | 51 ++ .../current/android/hardware/usb/Status.aidl | 42 ++ .../usb/ContaminantDetectionStatus.aidl | 37 + .../usb/ContaminantProtectionMode.aidl | 43 ++ .../usb/ContaminantProtectionStatus.aidl | 51 ++ usb/aidl/android/hardware/usb/IUsb.aidl | 85 +++ .../android/hardware/usb/IUsbCallback.aidl | 86 +++ .../android/hardware/usb/PortDataRole.aidl | 35 + usb/aidl/android/hardware/usb/PortMode.aidl | 49 ++ .../android/hardware/usb/PortPowerRole.aidl | 35 + usb/aidl/android/hardware/usb/PortRole.aidl | 31 + usb/aidl/android/hardware/usb/PortStatus.aidl | 107 +++ usb/aidl/android/hardware/usb/Status.aidl | 39 + usb/aidl/conversion.log | 11 + usb/aidl/default/Android.bp | 35 + usb/aidl/default/Usb.cpp | 693 ++++++++++++++++++ usb/aidl/default/Usb.h | 76 ++ .../android.hardware.usb-service.example.rc | 4 + .../android.hardware.usb-service.example.xml | 10 + usb/aidl/default/service.cpp | 35 + 31 files changed, 1966 insertions(+) create mode 100644 usb/aidl/Android.bp create mode 100644 usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ContaminantDetectionStatus.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ContaminantProtectionMode.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ContaminantProtectionStatus.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortDataRole.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortMode.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortPowerRole.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortRole.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/Status.aidl create mode 100644 usb/aidl/android/hardware/usb/ContaminantDetectionStatus.aidl create mode 100644 usb/aidl/android/hardware/usb/ContaminantProtectionMode.aidl create mode 100644 usb/aidl/android/hardware/usb/ContaminantProtectionStatus.aidl create mode 100644 usb/aidl/android/hardware/usb/IUsb.aidl create mode 100644 usb/aidl/android/hardware/usb/IUsbCallback.aidl create mode 100644 usb/aidl/android/hardware/usb/PortDataRole.aidl create mode 100644 usb/aidl/android/hardware/usb/PortMode.aidl create mode 100644 usb/aidl/android/hardware/usb/PortPowerRole.aidl create mode 100644 usb/aidl/android/hardware/usb/PortRole.aidl create mode 100644 usb/aidl/android/hardware/usb/PortStatus.aidl create mode 100644 usb/aidl/android/hardware/usb/Status.aidl create mode 100644 usb/aidl/conversion.log create mode 100644 usb/aidl/default/Android.bp create mode 100644 usb/aidl/default/Usb.cpp create mode 100644 usb/aidl/default/Usb.h create mode 100644 usb/aidl/default/android.hardware.usb-service.example.rc create mode 100644 usb/aidl/default/android.hardware.usb-service.example.xml create mode 100644 usb/aidl/default/service.cpp diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 74d93b39ef..3a5f5eff0f 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -702,6 +702,13 @@ default + + android.hardware.usb + + IUsb + default + + android.hardware.usb.gadget 1.0-2 diff --git a/usb/aidl/Android.bp b/usb/aidl/Android.bp new file mode 100644 index 0000000000..d1e9e680e9 --- /dev/null +++ b/usb/aidl/Android.bp @@ -0,0 +1,33 @@ +// 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. + +aidl_interface { + name: "android.hardware.usb", + vendor_available: true, + srcs: ["android/hardware/usb/*.aidl"], + stability: "vintf", + backend: { + cpp: { + enabled: false, + }, + java: { + sdk_version: "module_current", + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ContaminantDetectionStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ContaminantDetectionStatus.aidl new file mode 100644 index 0000000000..24c69664f7 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ContaminantDetectionStatus.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 -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.usb; +@VintfStability +enum ContaminantDetectionStatus { + NOT_SUPPORTED = 0, + DISABLED = 1, + NOT_DETECTED = 2, + DETECTED = 3, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ContaminantProtectionMode.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ContaminantProtectionMode.aidl new file mode 100644 index 0000000000..99798693ff --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ContaminantProtectionMode.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 -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.usb; +@VintfStability +enum ContaminantProtectionMode { + NONE = 0, + FORCE_SINK = 1, + FORCE_SOURCE = 2, + FORCE_DISABLE = 3, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ContaminantProtectionStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ContaminantProtectionStatus.aidl new file mode 100644 index 0000000000..9642261444 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ContaminantProtectionStatus.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 -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.usb; +@VintfStability +enum ContaminantProtectionStatus { + NONE = 0, + FORCE_SINK = 1, + FORCE_SOURCE = 2, + FORCE_DISABLE = 3, + DISABLED = 4, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl new file mode 100644 index 0000000000..7513461afb --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.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 -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.usb; +@VintfStability +interface IUsb { + oneway void enableContaminantPresenceDetection(in String portName, in boolean enable, long transactionId); + oneway void enableUsbData(in String portName, boolean enable, long transactionId); + oneway void queryPortStatus(long transactionId); + oneway void setCallback(in android.hardware.usb.IUsbCallback callback); + oneway void switchRole(in String portName, in android.hardware.usb.PortRole role, long transactionId); +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl new file mode 100644 index 0000000000..57be590563 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.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 -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.usb; +@VintfStability +interface IUsbCallback { + oneway void notifyPortStatusChange(in android.hardware.usb.PortStatus[] currentPortStatus, in android.hardware.usb.Status retval); + oneway void notifyRoleSwitchStatus(in String portName, in android.hardware.usb.PortRole newRole, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyEnableUsbDataStatus(in String portName, boolean enable, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyContaminantEnabledStatus(in String portName, boolean enable, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyQueryPortStatus(in String portName, in android.hardware.usb.Status retval, long transactionId); +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortDataRole.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortDataRole.aidl new file mode 100644 index 0000000000..105b316775 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortDataRole.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 -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.usb; +@VintfStability +enum PortDataRole { + NONE = 0, + HOST = 1, + DEVICE = 2, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortMode.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortMode.aidl new file mode 100644 index 0000000000..34e43343ad --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortMode.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 -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.usb; +@VintfStability +enum PortMode { + NONE = 0, + UFP = 1, + DFP = 2, + DRP = 3, + AUDIO_ACCESSORY = 4, + DEBUG_ACCESSORY = 5, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortPowerRole.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortPowerRole.aidl new file mode 100644 index 0000000000..0e6f3fb426 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortPowerRole.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 -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.usb; +@VintfStability +enum PortPowerRole { + NONE = 0, + SOURCE = 1, + SINK = 2, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortRole.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortRole.aidl new file mode 100644 index 0000000000..c66aeccde9 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortRole.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 -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.usb; +@VintfStability +union PortRole { + android.hardware.usb.PortPowerRole powerRole = android.hardware.usb.PortPowerRole.NONE; + android.hardware.usb.PortDataRole dataRole; + android.hardware.usb.PortMode mode; +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl new file mode 100644 index 0000000000..78dcfacef9 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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.usb; +@VintfStability +parcelable PortStatus { + String portName; + android.hardware.usb.PortDataRole currentDataRole = android.hardware.usb.PortDataRole.NONE; + android.hardware.usb.PortPowerRole currentPowerRole = android.hardware.usb.PortPowerRole.NONE; + android.hardware.usb.PortMode currentMode = android.hardware.usb.PortMode.NONE; + boolean canChangeMode; + boolean canChangeDataRole; + boolean canChangePowerRole; + android.hardware.usb.PortMode[] supportedModes; + android.hardware.usb.ContaminantProtectionMode[] supportedContaminantProtectionModes; + boolean supportsEnableContaminantPresenceProtection; + android.hardware.usb.ContaminantProtectionStatus contaminantProtectionStatus = android.hardware.usb.ContaminantProtectionStatus.NONE; + boolean supportsEnableContaminantPresenceDetection; + android.hardware.usb.ContaminantDetectionStatus contaminantDetectionStatus = android.hardware.usb.ContaminantDetectionStatus.NOT_SUPPORTED; + boolean usbDataEnabled; +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/Status.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/Status.aidl new file mode 100644 index 0000000000..f28fc2a70e --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/Status.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 -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.usb; +@Backing(type="int") @VintfStability +enum Status { + SUCCESS = 0, + ERROR = 1, + INVALID_ARGUMENT = 2, + UNRECOGNIZED_ROLE = 3, + NOT_SUPPORTED = 4, +} diff --git a/usb/aidl/android/hardware/usb/ContaminantDetectionStatus.aidl b/usb/aidl/android/hardware/usb/ContaminantDetectionStatus.aidl new file mode 100644 index 0000000000..d9bc576f94 --- /dev/null +++ b/usb/aidl/android/hardware/usb/ContaminantDetectionStatus.aidl @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package android.hardware.usb; + +@VintfStability +enum ContaminantDetectionStatus { + /** + * Contaminant presence detection is not supported. + */ + NOT_SUPPORTED = 0, + /** + * Contaminant presence detection is supported but disabled. + */ + DISABLED = 1, + /** + * Contaminant presence detection is enabled and contaminant not detected. + */ + NOT_DETECTED = 2, + /** + * Contaminant presence detection is enabled and contaminant detected. + */ + DETECTED = 3, +} diff --git a/usb/aidl/android/hardware/usb/ContaminantProtectionMode.aidl b/usb/aidl/android/hardware/usb/ContaminantProtectionMode.aidl new file mode 100644 index 0000000000..47c073dcc4 --- /dev/null +++ b/usb/aidl/android/hardware/usb/ContaminantProtectionMode.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. + */ + +package android.hardware.usb; + +@VintfStability +enum ContaminantProtectionMode { + /** + * No action performed upon detection of contaminant presence. + */ + NONE = 0, + /** + * Upon detection of contaminant presence, Port is forced to sink only + * mode where a port shall only detect chargers until contaminant presence + * is no longer detected. + */ + FORCE_SINK = 1, + /** + * Upon detection of contaminant presence, Port is forced to source only + * mode where a port shall only detect usb accessories such as headsets + * until contaminant presence is no longer detected. + */ + FORCE_SOURCE = 2, + /** + * Upon detection of contaminant presence, port is disabled until contaminant + * presence is no longer detected. In the disabled state port will + * not respond to connection of chargers or usb accessories. + */ + FORCE_DISABLE = 3, +} diff --git a/usb/aidl/android/hardware/usb/ContaminantProtectionStatus.aidl b/usb/aidl/android/hardware/usb/ContaminantProtectionStatus.aidl new file mode 100644 index 0000000000..c4fa979698 --- /dev/null +++ b/usb/aidl/android/hardware/usb/ContaminantProtectionStatus.aidl @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package android.hardware.usb; + +import android.hardware.usb.ContaminantProtectionMode; + +@VintfStability +enum ContaminantProtectionStatus { + /** + * No action performed upon detection of contaminant presence. + */ + NONE = 0, + /** + * Upon detection of contaminant presence, Port is forced to sink only + * mode where a port shall only detect chargers until contaminant presence + * is no longer detected. + */ + FORCE_SINK = 1, + /** + * Upon detection of contaminant presence, Port is forced to source only + * mode where a port shall only detect usb accessories such as headsets + * until contaminant presence is no longer detected. + */ + FORCE_SOURCE = 2, + /** + * Upon detection of contaminant presence, port is disabled until contaminant + * presence is no longer detected. In the disabled state port will + * not respond to connection of chargers or usb accessories. + */ + FORCE_DISABLE = 3, + /** + * Client disabled cotaminant protection by calling + * enableContaminantPresencePortProtection set to false. Low level drivers should + * not autmomously take any corrective action when contaminant presence is detected. + */ + DISABLED = 4, +} diff --git a/usb/aidl/android/hardware/usb/IUsb.aidl b/usb/aidl/android/hardware/usb/IUsb.aidl new file mode 100644 index 0000000000..9a8f0006ee --- /dev/null +++ b/usb/aidl/android/hardware/usb/IUsb.aidl @@ -0,0 +1,85 @@ +/* + * 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. + */ + +package android.hardware.usb; + +import android.hardware.usb.IUsbCallback; +import android.hardware.usb.PortRole; + +@VintfStability +oneway interface IUsb { + /** + * When supportsEnableContaminantPresenceDetection is true, + * enableContaminantPresenceDetection enables/disables contaminant + * presence detection algorithm. Calling enableContaminantPresenceDetection + * when supportsEnableContaminantPresenceDetection is false does + * not have any effect. + * Change in contantaminant presence status should be notified to the + * client via notifyPortStatusChange through PortStatus. + * + * @param portName name of the port. + * @param enable true Enable contaminant presence detection algorithm. + * false Disable contaminant presence detection algorithm. + * @param transactionId ID to be used when invoking the callback. + */ + void enableContaminantPresenceDetection(in String portName, in boolean enable, long transactionId); + + /** + * This function is used to enable/disable USB data controller. + * + * @param portName Name of the port. + * @param enable true Enable USB data signaling. + * false Disable USB data signaling. + * @param transactionId ID to be used when invoking the callback. + * + */ + void enableUsbData(in String portName, boolean enable, long transactionId); + + /** + * This functions is used to request the hal for the current status + * status of the Type-C ports. The result of the query would be sent + * through the IUsbCallback object's notifyRoleSwitchStatus + * to the caller. This api would would let the caller know of the number + * of type-c ports that are present and their connection status through the + * PortStatus type. + * @param transactionId ID to be used when invoking the callback. + */ + void queryPortStatus(long transactionId); + + /** + * This function is used to register a callback function which is + * called by the HAL to inform the client of port status updates and + * result of the requested operation. Please refer IUsbCallback for + * complete description of when each of the IUsbCallback's interface + * methods is expected to be called. + * + * @param callback IUsbCallback object used to convey status to the + * userspace. + */ + void setCallback(in IUsbCallback callback); + + /** + * This function is used to change the port role of a specific port. + * For example, when DR_SWAP or PR_SWAP is supported. + * The status of the role switch will be informed through IUsbCallback + * object's notifyPortStatusChange method. + * + * @param portName name of the port for which the role has to be changed + * @param role the new port role. + * @param transactionId ID to be used when invoking the callback. + */ + void switchRole(in String portName, in PortRole role, long transactionId); +} diff --git a/usb/aidl/android/hardware/usb/IUsbCallback.aidl b/usb/aidl/android/hardware/usb/IUsbCallback.aidl new file mode 100644 index 0000000000..232a15babe --- /dev/null +++ b/usb/aidl/android/hardware/usb/IUsbCallback.aidl @@ -0,0 +1,86 @@ +/* + * 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. + */ +package android.hardware.usb; + +import android.hardware.usb.PortRole; +import android.hardware.usb.PortStatus; +import android.hardware.usb.Status; + +/** + * Callback object used for all the IUsb async methods which expects a result. + * Caller is expected to register the callback object using setCallback method + * to receive updates on the PortStatus. + */ +@VintfStability +oneway interface IUsbCallback { + /** + * Used to convey the current port status to the caller. + * Must be called either when PortState changes due to the port partner or + * when caller requested for the PortStatus update through queryPortStatus. + * + * @param currentPortStatus describes the status of all the USB ports in the + * device. + * @param retval SUCCESS when the required information was enquired form + * kernel and the PortStatus object was built. + * ERROR otherwise. + */ + void notifyPortStatusChange(in PortStatus[] currentPortStatus, in Status retval); + + /** + * Used to notify the result of the switchRole call to the caller. + * + * @param portName name of the port for which the roleswap is requested. + * @param newRole the new role requested by the caller. + * @param retval SUCCESS if the role switch succeeded. FAILURE otherwise. + * @param transactionId transactionId sent during switchRole request. + */ + void notifyRoleSwitchStatus(in String portName, in PortRole newRole, in Status retval, + long transactionId); + + /** + * Used to notify the result of notifyEnableUsbDataStatus call to the caller. + * + * @param portName name of the port for which the enableUsbData is requested. + * @param enable true when usb data is enabled. + * false when usb data is disabled. + * @param retval SUCCESS if current request succeeded. FAILURE otherwise. + * @param transactionId transactionId sent during enableUsbData request. + */ + void notifyEnableUsbDataStatus(in String portName, boolean enable, in Status retval, + long transactionId); + + /** + * Used to notify the result of enableContaminantPresenceDetection. + * + * @param portName name of the port for which contaminant detection is enabled/disabled. + * @param enable true when contaminant detection is enabled. + * false when disabled. + * @param retval SUCCESS if the request for enabling/disabling contamiant detection succeeds. + * FAILURE otherwise. + * @param transactionId transactionId sent during queryPortStatus request + */ + void notifyContaminantEnabledStatus(in String portName, boolean enable, in Status retval, + long transactionId); + + /** + * Used to notify the request to query port status. + * + * @param portName name of the port for which port status is queried. + * @param retval SUCCESS if the port query succeeded. FAILURE otherwise. + * @param transactionId transactionId sent during queryPortStatus request + */ + void notifyQueryPortStatus(in String portName, in Status retval, long transactionId); +} diff --git a/usb/aidl/android/hardware/usb/PortDataRole.aidl b/usb/aidl/android/hardware/usb/PortDataRole.aidl new file mode 100644 index 0000000000..a69f97719e --- /dev/null +++ b/usb/aidl/android/hardware/usb/PortDataRole.aidl @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package android.hardware.usb; + +@VintfStability +enum PortDataRole { + /** + * Indicates that the port does not have a data role. + * In case of DRP, the current data role of the port is only resolved + * when the type-c handshake happens. + */ + NONE = 0, + /** + * Indicates that the port is acting as a host for data. + */ + HOST = 1, + /** + * Indicated that the port is acting as a device for data. + */ + DEVICE = 2, +} diff --git a/usb/aidl/android/hardware/usb/PortMode.aidl b/usb/aidl/android/hardware/usb/PortMode.aidl new file mode 100644 index 0000000000..399f0ebaeb --- /dev/null +++ b/usb/aidl/android/hardware/usb/PortMode.aidl @@ -0,0 +1,49 @@ +/* + * 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. + */ + +package android.hardware.usb; + +import android.hardware.usb.PortMode; + +@VintfStability +enum PortMode { + /** + * Indicates that the port does not have a mode. + * In case of DRP, the current mode of the port is only resolved + * when the type-c handshake happens. + */ + NONE = 0, + /** + * Indicates that port can only act as device for data and sink for power. + */ + UFP = 1, + /** + * Indicates the port can only act as host for data and source for power. + */ + DFP = 2, + /** + * Indicates can either act as UFP or DFP at a given point of time. + */ + DRP = 3, + /* + * Indicates that the port supports Audio Accessory mode. + */ + AUDIO_ACCESSORY = 4, + /* + * Indicates that the port supports Debug Accessory mode. + */ + DEBUG_ACCESSORY = 5, +} diff --git a/usb/aidl/android/hardware/usb/PortPowerRole.aidl b/usb/aidl/android/hardware/usb/PortPowerRole.aidl new file mode 100644 index 0000000000..ae3dc47c45 --- /dev/null +++ b/usb/aidl/android/hardware/usb/PortPowerRole.aidl @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package android.hardware.usb; + +@VintfStability +enum PortPowerRole { + /** + * Indicates that the port does not have a power role. + * In case of DRP, the current power role of the port is only resolved + * when the type-c handshake happens. + */ + NONE = 0, + /** + * Indicates that the port is supplying power to the other port. + */ + SOURCE = 1, + /** + * Indicates that the port is sinking power from the other port. + */ + SINK = 2, +} diff --git a/usb/aidl/android/hardware/usb/PortRole.aidl b/usb/aidl/android/hardware/usb/PortRole.aidl new file mode 100644 index 0000000000..e0429c8b74 --- /dev/null +++ b/usb/aidl/android/hardware/usb/PortRole.aidl @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package android.hardware.usb; + +import android.hardware.usb.PortDataRole; +import android.hardware.usb.PortMode; +import android.hardware.usb.PortPowerRole; + +/** + * Used as a container to send port role information. + */ +@VintfStability +union PortRole { + PortPowerRole powerRole = PortPowerRole.NONE; + PortDataRole dataRole; + PortMode mode; +} diff --git a/usb/aidl/android/hardware/usb/PortStatus.aidl b/usb/aidl/android/hardware/usb/PortStatus.aidl new file mode 100644 index 0000000000..8afe00916c --- /dev/null +++ b/usb/aidl/android/hardware/usb/PortStatus.aidl @@ -0,0 +1,107 @@ +/* + * 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. + */ + +package android.hardware.usb; + +import android.hardware.usb.ContaminantDetectionStatus; +import android.hardware.usb.ContaminantProtectionMode; +import android.hardware.usb.ContaminantProtectionStatus; +import android.hardware.usb.PortDataRole; +import android.hardware.usb.PortMode; +import android.hardware.usb.PortPowerRole; + +@VintfStability +parcelable PortStatus { + /** + * Name of the port. + * Used as the port's id by the caller. + */ + String portName; + /** + * Data role of the port. + */ + PortDataRole currentDataRole = PortDataRole.NONE; + /** + * Power Role of thte port. + */ + PortPowerRole currentPowerRole = PortPowerRole.NONE; + /** + * Mode in which the port is connected. + * Can be UFP or DFP or AUDIO_ACCESSORY or + * DEBUG_ACCESSORY. + */ + PortMode currentMode = PortMode.NONE; + /** + * True indicates that the port's mode can + * be changed. False otherwise. + */ + boolean canChangeMode; + /** + * True indicates that the port's data role + * can be changed. False otherwise. + * For example, true if Type-C PD PD_SWAP + * is supported. + */ + boolean canChangeDataRole; + /** + * True indicates that the port's power role + * can be changed. False otherwise. + * For example, true if Type-C PD PR_SWAP + * is supported. + */ + boolean canChangePowerRole; + /** + * Identifies the type of the local port. + * + * UFP - Indicates that port can only act as device for + * data and sink for power. + * DFP - Indicates the port can only act as host for data + * and source for power. + * DRP - Indicates can either act as UFP or DFP at a + * given point of time. + * AUDIO_ACCESSORY - Indicates that the port supports + * Audio Accessory mode. + * DEBUG_ACCESSORY - Indicates that the port supports + * Debug Accessory mode. + */ + PortMode[] supportedModes; + /** + * Contaminant presence protection modes supported by the port. + */ + ContaminantProtectionMode[] supportedContaminantProtectionModes; + /** + * Client can enable/disable contaminant presence protection through + * enableContaminantPresenceProtection when true. + */ + boolean supportsEnableContaminantPresenceProtection; + /** + * Contaminant presence protection modes currently active for the port. + */ + ContaminantProtectionStatus contaminantProtectionStatus = ContaminantProtectionStatus.NONE; + /** + * Client can enable/disable contaminant presence detection through + * enableContaminantPresenceDetection when true. + */ + boolean supportsEnableContaminantPresenceDetection; + /** + * Current status of contaminant detection algorithm. + */ + ContaminantDetectionStatus contaminantDetectionStatus = ContaminantDetectionStatus.NOT_SUPPORTED; + /** + * UsbData status of the port. + */ + boolean usbDataEnabled; +} diff --git a/usb/aidl/android/hardware/usb/Status.aidl b/usb/aidl/android/hardware/usb/Status.aidl new file mode 100644 index 0000000000..468ba4a068 --- /dev/null +++ b/usb/aidl/android/hardware/usb/Status.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. + */ + +package android.hardware.usb; + +@VintfStability +@Backing(type="int") +enum Status { + SUCCESS = 0, + /** + * error value when the HAL operation fails for reasons not listed here. + */ + ERROR = 1, + /** + * error value returned when input argument is invalid. + */ + INVALID_ARGUMENT = 2, + /** + * error value returned when role string is unrecognized. + */ + UNRECOGNIZED_ROLE = 3, + /** + * Error value returned when the operation is not supported. + */ + NOT_SUPPORTED = 4, +} diff --git a/usb/aidl/conversion.log b/usb/aidl/conversion.log new file mode 100644 index 0000000000..c09044689f --- /dev/null +++ b/usb/aidl/conversion.log @@ -0,0 +1,11 @@ +Notes relating to hidl2aidl conversion of android.hardware.usb@1.3 to android.hardware.usb (if any) follow: +Unhandled comments from android.hardware.usb@1.1::types follow. Consider using hidl-lint to locate these and fixup as many as possible. + // NOTE: suffix '_1_1' is for legacy ABI compatibility. It cannot be + // changed to 'PortMode' which the convention dictates. + // NOTE: suffix '_1_1' is for legacy ABI compatibility. It cannot be + // changed to 'PortStatus' which the convention dictates. + +An unknown named type was found in translation: android.hardware.usb@1.0::PortStatus +An unknown named type was found in translation: android.hardware.usb@1.0::PortStatus +An unknown named type was found in translation: android.hardware.usb@1.0::PortStatus +END OF LOG diff --git a/usb/aidl/default/Android.bp b/usb/aidl/default/Android.bp new file mode 100644 index 0000000000..da0cff23c3 --- /dev/null +++ b/usb/aidl/default/Android.bp @@ -0,0 +1,35 @@ +// +// 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. +// + +cc_binary { + name: "android.hardware.usb-service.example", + relative_install_path: "hw", + init_rc: ["android.hardware.usb-service.example.rc"], + vintf_fragments: ["android.hardware.usb-service.example.xml"], + vendor: true, + srcs: [ + "service.cpp", + "Usb.cpp", + ], + shared_libs: [ + "android.hardware.usb-V1-ndk", + "libbase", + "libbinder_ndk", + "libcutils", + "liblog", + "libutils", + ], +} diff --git a/usb/aidl/default/Usb.cpp b/usb/aidl/default/Usb.cpp new file mode 100644 index 0000000000..1105376ad9 --- /dev/null +++ b/usb/aidl/default/Usb.cpp @@ -0,0 +1,693 @@ +/* + * 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. + */ + +#define LOG_TAG "android.hardware.usb.aidl-service" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "Usb.h" + +using android::base::GetProperty; +using android::base::Trim; + +namespace aidl { +namespace android { +namespace hardware { +namespace usb { + +constexpr char kTypecPath[] = "/sys/class/typec/"; +constexpr char kDataRoleNode[] = "/data_role"; +constexpr char kPowerRoleNode[] = "/power_role"; + +// Set by the signal handler to destroy the thread +volatile bool destroyThread; + +void queryVersionHelper(android::hardware::usb::Usb *usb, + std::vector *currentPortStatus); + +ScopedAStatus Usb::enableUsbData(const string& in_portName, bool in_enable, int64_t in_transactionId) { + std::vector currentPortStatus; + + pthread_mutex_lock(&mLock); + if (mCallback != NULL) { + ScopedAStatus ret = mCallback->notifyEnableUsbDataStatus( + in_portName, true, in_enable ? Status::SUCCESS : Status::ERROR, in_transactionId); + if (!ret.isOk()) + ALOGE("notifyEnableUsbDataStatus error %s", ret.getDescription().c_str()); + } else { + ALOGE("Not notifying the userspace. Callback is not set"); + } + pthread_mutex_unlock(&mLock); + queryVersionHelper(this, ¤tPortStatus); + + return ScopedAStatus::ok(); +} + +Status queryMoistureDetectionStatus(std::vector *currentPortStatus) { + string enabled, status, path, DetectedPath; + + for (int i = 0; i < currentPortStatus->size(); i++) { + (*currentPortStatus)[i].supportedContaminantProtectionModes + .push_back(ContaminantProtectionMode::NONE); + (*currentPortStatus)[i].contaminantProtectionStatus + = ContaminantProtectionStatus::NONE; + (*currentPortStatus)[i].contaminantDetectionStatus + = ContaminantDetectionStatus::NOT_SUPPORTED; + (*currentPortStatus)[i].supportsEnableContaminantPresenceDetection = false; + (*currentPortStatus)[i].supportsEnableContaminantPresenceProtection = false; + } + + return Status::SUCCESS; +} + +string appendRoleNodeHelper(const string &portName, PortRole::Tag tag) { + string node(kTypecPath + portName); + + switch (tag) { + case PortRole::dataRole: + return node + kDataRoleNode; + case PortRole::powerRole: + return node + kPowerRoleNode; + case PortRole::mode: + return node + "/port_type"; + default: + return ""; + } +} + +string convertRoletoString(PortRole role) { + if (role.getTag() == PortRole::powerRole) { + if (role.get() == PortPowerRole::SOURCE) + return "source"; + else if (role.get() == PortPowerRole::SINK) + return "sink"; + } else if (role.getTag() == PortRole::dataRole) { + if (role.get() == PortDataRole::HOST) + return "host"; + if (role.get() == PortDataRole::DEVICE) + return "device"; + } else if (role.getTag() == PortRole::mode) { + if (role.get() == PortMode::UFP) + return "sink"; + if (role.get() == PortMode::DFP) + return "source"; + } + return "none"; +} + +void extractRole(string *roleName) { + std::size_t first, last; + + first = roleName->find("["); + last = roleName->find("]"); + + if (first != string::npos && last != string::npos) { + *roleName = roleName->substr(first + 1, last - first - 1); + } +} + +void switchToDrp(const string &portName) { + string filename = appendRoleNodeHelper(string(portName.c_str()), PortRole::mode); + FILE *fp; + + if (filename != "") { + fp = fopen(filename.c_str(), "w"); + if (fp != NULL) { + int ret = fputs("dual", fp); + fclose(fp); + if (ret == EOF) + ALOGE("Fatal: Error while switching back to drp"); + } else { + ALOGE("Fatal: Cannot open file to switch back to drp"); + } + } else { + ALOGE("Fatal: invalid node type"); + } +} + +bool switchMode(const string &portName, const PortRole &in_role, struct Usb *usb) { + string filename = appendRoleNodeHelper(string(portName.c_str()), in_role.getTag()); + string written; + FILE *fp; + bool roleSwitch = false; + + if (filename == "") { + ALOGE("Fatal: invalid node type"); + return false; + } + + fp = fopen(filename.c_str(), "w"); + if (fp != NULL) { + // Hold the lock here to prevent loosing connected signals + // as once the file is written the partner added signal + // can arrive anytime. + pthread_mutex_lock(&usb->mPartnerLock); + usb->mPartnerUp = false; + int ret = fputs(convertRoletoString(in_role).c_str(), fp); + fclose(fp); + + if (ret != EOF) { + struct timespec to; + struct timespec now; + + wait_again: + clock_gettime(CLOCK_MONOTONIC, &now); + to.tv_sec = now.tv_sec + PORT_TYPE_TIMEOUT; + to.tv_nsec = now.tv_nsec; + + int err = pthread_cond_timedwait(&usb->mPartnerCV, &usb->mPartnerLock, &to); + // There are no uevent signals which implies role swap timed out. + if (err == ETIMEDOUT) { + ALOGI("uevents wait timedout"); + // Validity check. + } else if (!usb->mPartnerUp) { + goto wait_again; + // Role switch succeeded since usb->mPartnerUp is true. + } else { + roleSwitch = true; + } + } else { + ALOGI("Role switch failed while wrting to file"); + } + pthread_mutex_unlock(&usb->mPartnerLock); + } + + if (!roleSwitch) + switchToDrp(string(portName.c_str())); + + return roleSwitch; +} + +Usb::Usb() + : mLock(PTHREAD_MUTEX_INITIALIZER), + mRoleSwitchLock(PTHREAD_MUTEX_INITIALIZER), + mPartnerLock(PTHREAD_MUTEX_INITIALIZER), + mPartnerUp(false) +{ + pthread_condattr_t attr; + if (pthread_condattr_init(&attr)) { + ALOGE("pthread_condattr_init failed: %s", strerror(errno)); + abort(); + } + if (pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)) { + ALOGE("pthread_condattr_setclock failed: %s", strerror(errno)); + abort(); + } + if (pthread_cond_init(&mPartnerCV, &attr)) { + ALOGE("pthread_cond_init failed: %s", strerror(errno)); + abort(); + } + if (pthread_condattr_destroy(&attr)) { + ALOGE("pthread_condattr_destroy failed: %s", strerror(errno)); + abort(); + } +} + +ScopedAStatus Usb::switchRole(const string& in_portName, + const PortRole& in_role, int64_t in_transactionId) { + string filename = appendRoleNodeHelper(string(in_portName.c_str()), in_role.getTag()); + string written; + FILE *fp; + bool roleSwitch = false; + + if (filename == "") { + ALOGE("Fatal: invalid node type"); + return ScopedAStatus::ok(); + } + + pthread_mutex_lock(&mRoleSwitchLock); + + ALOGI("filename write: %s role:%s", filename.c_str(), convertRoletoString(in_role).c_str()); + + if (in_role.getTag() == PortRole::mode) { + roleSwitch = switchMode(in_portName, in_role, this); + } else { + fp = fopen(filename.c_str(), "w"); + if (fp != NULL) { + int ret = fputs(convertRoletoString(in_role).c_str(), fp); + fclose(fp); + if ((ret != EOF) && ReadFileToString(filename, &written)) { + written = Trim(written); + extractRole(&written); + ALOGI("written: %s", written.c_str()); + if (written == convertRoletoString(in_role)) { + roleSwitch = true; + } else { + ALOGE("Role switch failed"); + } + } else { + ALOGE("failed to update the new role"); + } + } else { + ALOGE("fopen failed"); + } + } + + pthread_mutex_lock(&mLock); + if (mCallback != NULL) { + ScopedAStatus ret = mCallback->notifyRoleSwitchStatus( + in_portName, in_role, roleSwitch ? Status::SUCCESS : Status::ERROR, in_transactionId); + if (!ret.isOk()) + ALOGE("RoleSwitchStatus error %s", ret.getDescription().c_str()); + } else { + ALOGE("Not notifying the userspace. Callback is not set"); + } + pthread_mutex_unlock(&mLock); + pthread_mutex_unlock(&mRoleSwitchLock); + + return ScopedAStatus::ok(); +} + +Status getAccessoryConnected(const string &portName, string *accessory) { + string filename = kTypecPath + portName + "-partner/accessory_mode"; + + if (!ReadFileToString(filename, accessory)) { + ALOGE("getAccessoryConnected: Failed to open filesystem node: %s", filename.c_str()); + return Status::ERROR; + } + *accessory = Trim(*accessory); + + return Status::SUCCESS; +} + +Status getCurrentRoleHelper(const string &portName, bool connected, PortRole *currentRole) { + string filename; + string roleName; + string accessory; + + // Mode + + if (currentRole->getTag() == PortRole::powerRole) { + filename = kTypecPath + portName + kPowerRoleNode; + currentRole->set(PortPowerRole::NONE); + } else if (currentRole->getTag() == PortRole::dataRole) { + filename = kTypecPath + portName + kDataRoleNode; + currentRole->set(PortDataRole::NONE); + } else if (currentRole->getTag() == PortRole::mode) { + filename = kTypecPath + portName + kDataRoleNode; + currentRole->set(PortMode::NONE); + } else { + return Status::ERROR; + } + + if (!connected) + return Status::SUCCESS; + + if (currentRole->getTag() == PortRole::mode) { + if (getAccessoryConnected(portName, &accessory) != Status::SUCCESS) { + return Status::ERROR; + } + if (accessory == "analog_audio") { + currentRole->set(PortMode::AUDIO_ACCESSORY); + return Status::SUCCESS; + } else if (accessory == "debug") { + currentRole->set(PortMode::DEBUG_ACCESSORY); + return Status::SUCCESS; + } + } + + if (!ReadFileToString(filename, &roleName)) { + ALOGE("getCurrentRole: Failed to open filesystem node: %s", filename.c_str()); + return Status::ERROR; + } + + roleName = Trim(roleName); + extractRole(&roleName); + + if (roleName == "source") { + currentRole->set(PortPowerRole::SOURCE); + } else if (roleName == "sink") { + currentRole->set(PortPowerRole::SINK); + } else if (roleName == "host") { + if (currentRole->getTag() == PortRole::dataRole) + currentRole->set(PortDataRole::HOST); + else + currentRole->set(PortMode::DFP); + } else if (roleName == "device") { + if (currentRole->getTag() == PortRole::dataRole) + currentRole->set(PortDataRole::DEVICE); + else + currentRole->set(PortMode::UFP); + } else if (roleName != "none") { + /* case for none has already been addressed. + * so we check if the role isn't none. + */ + return Status::UNRECOGNIZED_ROLE; + } + + return Status::SUCCESS; +} + +Status getTypeCPortNamesHelper(std::unordered_map *names) { + DIR *dp; + + dp = opendir(kTypecPath); + if (dp != NULL) { + struct dirent *ep; + + while ((ep = readdir(dp))) { + if (ep->d_type == DT_LNK) { + if (string::npos == string(ep->d_name).find("-partner")) { + std::unordered_map::const_iterator portName = + names->find(ep->d_name); + if (portName == names->end()) { + names->insert({ep->d_name, false}); + } + } else { + (*names)[std::strtok(ep->d_name, "-")] = true; + } + } + } + closedir(dp); + return Status::SUCCESS; + } + + ALOGE("Failed to open /sys/class/typec"); + return Status::ERROR; +} + +bool canSwitchRoleHelper(const string &portName) { + string filename = kTypecPath + portName + "-partner/supports_usb_power_delivery"; + string supportsPD; + + if (ReadFileToString(filename, &supportsPD)) { + supportsPD = Trim(supportsPD); + if (supportsPD == "yes") { + return true; + } + } + + return false; +} + +Status getPortStatusHelper(std::vector *currentPortStatus) { + std::unordered_map names; + Status result = getTypeCPortNamesHelper(&names); + int i = -1; + + if (result == Status::SUCCESS) { + currentPortStatus->resize(names.size()); + for (std::pair port : names) { + i++; + ALOGI("%s", port.first.c_str()); + (*currentPortStatus)[i].portName = port.first; + + PortRole currentRole; + currentRole.set(PortPowerRole::NONE); + if (getCurrentRoleHelper(port.first, port.second, ¤tRole) == Status::SUCCESS){ + (*currentPortStatus)[i].currentPowerRole = currentRole.get(); + } else { + ALOGE("Error while retrieving portNames"); + goto done; + } + + currentRole.set(PortDataRole::NONE); + if (getCurrentRoleHelper(port.first, port.second, ¤tRole) == Status::SUCCESS) { + (*currentPortStatus)[i].currentDataRole = currentRole.get(); + } else { + ALOGE("Error while retrieving current port role"); + goto done; + } + + currentRole.set(PortMode::NONE); + if (getCurrentRoleHelper(port.first, port.second, ¤tRole) == Status::SUCCESS) { + (*currentPortStatus)[i].currentMode = currentRole.get(); + } else { + ALOGE("Error while retrieving current data role"); + goto done; + } + + (*currentPortStatus)[i].canChangeMode = true; + (*currentPortStatus)[i].canChangeDataRole = + port.second ? canSwitchRoleHelper(port.first) : false; + (*currentPortStatus)[i].canChangePowerRole = + port.second ? canSwitchRoleHelper(port.first) : false; + + (*currentPortStatus)[i].supportedModes.push_back(PortMode::DRP); + (*currentPortStatus)[i].usbDataEnabled = true; + + ALOGI("%d:%s connected:%d canChangeMode:%d canChagedata:%d canChangePower:%d " + "usbDataEnabled:%d", + i, port.first.c_str(), port.second, + (*currentPortStatus)[i].canChangeMode, + (*currentPortStatus)[i].canChangeDataRole, + (*currentPortStatus)[i].canChangePowerRole, 0); + } + + return Status::SUCCESS; + } +done: + return Status::ERROR; +} + +void queryVersionHelper(android::hardware::usb::Usb *usb, + std::vector *currentPortStatus) { + Status status; + pthread_mutex_lock(&usb->mLock); + status = getPortStatusHelper(currentPortStatus); + queryMoistureDetectionStatus(currentPortStatus); + if (usb->mCallback != NULL) { + ScopedAStatus ret = usb->mCallback->notifyPortStatusChange(*currentPortStatus, + status); + if (!ret.isOk()) + ALOGE("queryPortStatus error %s", ret.getDescription().c_str()); + } else { + ALOGI("Notifying userspace skipped. Callback is NULL"); + } + pthread_mutex_unlock(&usb->mLock); +} + +ScopedAStatus Usb::queryPortStatus(int64_t in_transactionId) { + std::vector currentPortStatus; + + queryVersionHelper(this, ¤tPortStatus); + pthread_mutex_lock(&mLock); + if (mCallback != NULL) { + ScopedAStatus ret = mCallback->notifyQueryPortStatus( + "all", Status::SUCCESS, in_transactionId); + if (!ret.isOk()) + ALOGE("notifyQueryPortStatus error %s", ret.getDescription().c_str()); + } else { + ALOGE("Not notifying the userspace. Callback is not set"); + } + pthread_mutex_unlock(&mLock); + + return ScopedAStatus::ok(); +} + +ScopedAStatus Usb::enableContaminantPresenceDetection(const string& in_portName, + bool /*in_enable*/, int64_t in_transactionId) { + std::vector currentPortStatus; + + pthread_mutex_lock(&mLock); + if (mCallback != NULL) { + ScopedAStatus ret = mCallback->notifyContaminantEnabledStatus( + in_portName, false, Status::ERROR, in_transactionId); + if (!ret.isOk()) + ALOGE("enableContaminantPresenceDetection error %s", ret.getDescription().c_str()); + } else { + ALOGE("Not notifying the userspace. Callback is not set"); + } + pthread_mutex_unlock(&mLock); + + queryVersionHelper(this, ¤tPortStatus); + return ScopedAStatus::ok(); +} + + +struct data { + int uevent_fd; + ::aidl::android::hardware::usb::Usb *usb; +}; + +static void uevent_event(uint32_t /*epevents*/, struct data *payload) { + char msg[UEVENT_MSG_LEN + 2]; + char *cp; + int n; + + n = uevent_kernel_multicast_recv(payload->uevent_fd, msg, UEVENT_MSG_LEN); + if (n <= 0) + return; + if (n >= UEVENT_MSG_LEN) /* overflow -- discard */ + return; + + msg[n] = '\0'; + msg[n + 1] = '\0'; + cp = msg; + + while (*cp) { + if (std::regex_match(cp, std::regex("(add)(.*)(-partner)"))) { + ALOGI("partner added"); + pthread_mutex_lock(&payload->usb->mPartnerLock); + payload->usb->mPartnerUp = true; + pthread_cond_signal(&payload->usb->mPartnerCV); + pthread_mutex_unlock(&payload->usb->mPartnerLock); + } else if (!strncmp(cp, "DEVTYPE=typec_", strlen("DEVTYPE=typec_"))) { + std::vector currentPortStatus; + queryVersionHelper(payload->usb, ¤tPortStatus); + + // Role switch is not in progress and port is in disconnected state + if (!pthread_mutex_trylock(&payload->usb->mRoleSwitchLock)) { + for (unsigned long i = 0; i < currentPortStatus.size(); i++) { + DIR *dp = + opendir(string(kTypecPath + + string(currentPortStatus[i].portName.c_str()) + + "-partner").c_str()); + if (dp == NULL) { + switchToDrp(currentPortStatus[i].portName); + } else { + closedir(dp); + } + } + pthread_mutex_unlock(&payload->usb->mRoleSwitchLock); + } + break; + } /* advance to after the next \0 */ + while (*cp++) { + } + } +} + +void *work(void *param) { + int epoll_fd, uevent_fd; + struct epoll_event ev; + int nevents = 0; + struct data payload; + + uevent_fd = uevent_open_socket(UEVENT_MAX_EVENTS * UEVENT_MSG_LEN, true); + + if (uevent_fd < 0) { + ALOGE("uevent_init: uevent_open_socket failed\n"); + return NULL; + } + + payload.uevent_fd = uevent_fd; + payload.usb = (::aidl::android::hardware::usb::Usb *)param; + + fcntl(uevent_fd, F_SETFL, O_NONBLOCK); + + ev.events = EPOLLIN; + ev.data.ptr = (void *)uevent_event; + + epoll_fd = epoll_create(UEVENT_MAX_EVENTS); + if (epoll_fd == -1) { + ALOGE("epoll_create failed; errno=%d", errno); + goto error; + } + + if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, uevent_fd, &ev) == -1) { + ALOGE("epoll_ctl failed; errno=%d", errno); + goto error; + } + + while (!destroyThread) { + struct epoll_event events[UEVENT_MAX_EVENTS]; + + nevents = epoll_wait(epoll_fd, events, UEVENT_MAX_EVENTS, -1); + if (nevents == -1) { + if (errno == EINTR) + continue; + ALOGE("usb epoll_wait failed; errno=%d", errno); + break; + } + + for (int n = 0; n < nevents; ++n) { + if (events[n].data.ptr) + (*(void (*)(int, struct data *payload))events[n].data.ptr)(events[n].events, + &payload); + } + } + + ALOGI("exiting worker thread"); +error: + close(uevent_fd); + + if (epoll_fd >= 0) + close(epoll_fd); + + return NULL; +} + +void sighandler(int sig) { + if (sig == SIGUSR1) { + destroyThread = true; + ALOGI("destroy set"); + return; + } + signal(SIGUSR1, sighandler); +} + +ScopedAStatus Usb::setCallback( + const shared_ptr& in_callback) { + + pthread_mutex_lock(&mLock); + if ((mCallback == NULL && in_callback == NULL) || + (mCallback != NULL && in_callback != NULL)) { + mCallback = in_callback; + pthread_mutex_unlock(&mLock); + return ScopedAStatus::ok(); + } + + mCallback = in_callback; + ALOGI("registering callback"); + + if (mCallback == NULL) { + if (!pthread_kill(mPoll, SIGUSR1)) { + pthread_join(mPoll, NULL); + ALOGI("pthread destroyed"); + } + pthread_mutex_unlock(&mLock); + return ScopedAStatus::ok(); + } + + destroyThread = false; + signal(SIGUSR1, sighandler); + + /* + * Create a background thread if the old callback value is NULL + * and being updated with a new value. + */ + if (pthread_create(&mPoll, NULL, work, this)) { + ALOGE("pthread creation failed %d", errno); + mCallback = NULL; + } + + pthread_mutex_unlock(&mLock); + return ScopedAStatus::ok(); +} + +} // namespace usb +} // namespace hardware +} // namespace android +} // aidl diff --git a/usb/aidl/default/Usb.h b/usb/aidl/default/Usb.h new file mode 100644 index 0000000000..bca86ae06c --- /dev/null +++ b/usb/aidl/default/Usb.h @@ -0,0 +1,76 @@ +/* + * 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 +#include +#include +#include + +#define UEVENT_MSG_LEN 2048 +#define UEVENT_MAX_EVENTS 64 +// The type-c stack waits for 4.5 - 5.5 secs before declaring a port non-pd. +// The -partner directory would not be created until this is done. +// Having a margin of ~3 secs for the directory and other related bookeeping +// structures created and uvent fired. +#define PORT_TYPE_TIMEOUT 8 + +namespace aidl { +namespace android { +namespace hardware { +namespace usb { + +using ::aidl::android::hardware::usb::IUsbCallback; +using ::aidl::android::hardware::usb::PortRole; +using ::android::base::ReadFileToString; +using ::android::base::WriteStringToFile; +using ::android::sp; +using ::ndk::ScopedAStatus; +using ::std::shared_ptr; +using ::std::string; + +struct Usb : public BnUsb { + Usb(); + + ScopedAStatus enableContaminantPresenceDetection(const std::string& in_portName, + bool in_enable, int64_t in_transactionId) override; + ScopedAStatus queryPortStatus(int64_t in_transactionId) override; + ScopedAStatus setCallback(const shared_ptr& in_callback) override; + ScopedAStatus switchRole(const string& in_portName, const PortRole& in_role, + int64_t in_transactionId) override; + ScopedAStatus enableUsbData(const string& in_portName, bool in_enable, + int64_t in_transactionId) override; + + shared_ptr mCallback; + // Protects mCallback variable + pthread_mutex_t mLock; + // Protects roleSwitch operation + pthread_mutex_t mRoleSwitchLock; + // Threads waiting for the partner to come back wait here + pthread_cond_t mPartnerCV; + // lock protecting mPartnerCV + pthread_mutex_t mPartnerLock; + // Variable to signal partner coming back online after type switch + bool mPartnerUp; + private: + pthread_t mPoll; +}; + +} // namespace usb +} // namespace hardware +} // namespace android +} // aidl diff --git a/usb/aidl/default/android.hardware.usb-service.example.rc b/usb/aidl/default/android.hardware.usb-service.example.rc new file mode 100644 index 0000000000..335bca744d --- /dev/null +++ b/usb/aidl/default/android.hardware.usb-service.example.rc @@ -0,0 +1,4 @@ +service vendor.usb_default /vendor/bin/hw/android.hardware.usb-service.example + class hal + user system + group system diff --git a/usb/aidl/default/android.hardware.usb-service.example.xml b/usb/aidl/default/android.hardware.usb-service.example.xml new file mode 100644 index 0000000000..6088194890 --- /dev/null +++ b/usb/aidl/default/android.hardware.usb-service.example.xml @@ -0,0 +1,10 @@ + + + android.hardware.usb + 1 + + IUsb + default + + + diff --git a/usb/aidl/default/service.cpp b/usb/aidl/default/service.cpp new file mode 100644 index 0000000000..398458aff7 --- /dev/null +++ b/usb/aidl/default/service.cpp @@ -0,0 +1,35 @@ +/* + * 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 +#include +#include + +#include "Usb.h" + +using ::aidl::android::hardware::usb::Usb; + +int main() { + ABinderProcess_setThreadPoolMaxThreadCount(0); + std::shared_ptr usb = ndk::SharedRefBase::make(); + + const std::string instance = std::string() + Usb::descriptor + "/default"; + binder_status_t status = AServiceManager_addService(usb->asBinder().get(), instance.c_str()); + CHECK(status == STATUS_OK); + + ABinderProcess_joinThreadPool(); + return -1; // Should never be reached +} -- GitLab From aef9dec7dd394016caf42cd0287430f94b5d31ed Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Mon, 27 Dec 2021 14:02:56 -0800 Subject: [PATCH 477/825] VTS tests for USB AIDL interface Bug: 200993386 Bug: 199357330 Bug: 211677613 Change-Id: I49881d136697cd5f207a61e179779b532d0d8e76 --- usb/aidl/vts/Android.bp | 43 +++ usb/aidl/vts/VtsAidlUsbTargetTest.cpp | 424 ++++++++++++++++++++++++++ 2 files changed, 467 insertions(+) create mode 100644 usb/aidl/vts/Android.bp create mode 100644 usb/aidl/vts/VtsAidlUsbTargetTest.cpp diff --git a/usb/aidl/vts/Android.bp b/usb/aidl/vts/Android.bp new file mode 100644 index 0000000000..00a7c93ec3 --- /dev/null +++ b/usb/aidl/vts/Android.bp @@ -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. +// + +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: "VtsAidlUsbTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: ["VtsAidlUsbTargetTest.cpp"], + shared_libs: [ + "libbinder_ndk", + ], + static_libs: [ + "android.hardware.usb-V1-ndk", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/usb/aidl/vts/VtsAidlUsbTargetTest.cpp b/usb/aidl/vts/VtsAidlUsbTargetTest.cpp new file mode 100644 index 0000000000..09cb096702 --- /dev/null +++ b/usb/aidl/vts/VtsAidlUsbTargetTest.cpp @@ -0,0 +1,424 @@ +/* + * Copyright (C) 2021 The Android Open Source Probject + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 "UsbAidlTest" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#define TIMEOUT_PERIOD 10 + +using ::aidl::android::hardware::usb::BnUsbCallback; +using ::aidl::android::hardware::usb::IUsb; +using ::aidl::android::hardware::usb::IUsbCallback; +using ::aidl::android::hardware::usb::PortDataRole; +using ::aidl::android::hardware::usb::PortMode; +using ::aidl::android::hardware::usb::PortPowerRole; +using ::aidl::android::hardware::usb::PortRole; +using ::aidl::android::hardware::usb::PortStatus; +using ::aidl::android::hardware::usb::Status; + +using ::ndk::ScopedAStatus; +using ::ndk::SpAIBinder; +using std::vector; +using std::shared_ptr; +using std::string; + +// The main test class for the USB aidl hal +class UsbAidlTest : public testing::TestWithParam { + public: + // Callback class for the USB aidl hal. + // Usb Hal will call this object upon role switch or port query. + class UsbCallback : public BnUsbCallback { + UsbAidlTest& parent_; + int cookie; + + public: + UsbCallback(UsbAidlTest& parent, int cookie) + : parent_(parent), cookie(cookie){}; + + virtual ~UsbCallback() = default; + + // Callback method for the port status. + ScopedAStatus notifyPortStatusChange(const vector& currentPortStatus, + Status retval) override { + if (retval == Status::SUCCESS && currentPortStatus.size() > 0) { + parent_.usb_last_port_status.portName = + currentPortStatus[0].portName.c_str(); + parent_.usb_last_port_status.currentDataRole = + currentPortStatus[0].currentDataRole; + parent_.usb_last_port_status.currentPowerRole = + currentPortStatus[0].currentPowerRole; + parent_.usb_last_port_status.currentMode = + currentPortStatus[0].currentMode; + } + parent_.usb_last_cookie = cookie; + return ScopedAStatus::ok(); + } + + // Callback method for the status of role switch operation. + ScopedAStatus notifyRoleSwitchStatus(const string& /*portName*/, const PortRole& newRole, + Status retval, int64_t transactionId) override { + parent_.usb_last_status = retval; + parent_.usb_last_cookie = cookie; + parent_.usb_last_port_role = newRole; + parent_.usb_role_switch_done = true; + parent_.last_transactionId = transactionId; + parent_.notify(); + return ScopedAStatus::ok(); + } + + // Callback method for the status of enableUsbData operation + ScopedAStatus notifyEnableUsbDataStatus(const string& /*portName*/, bool /*enable*/, + Status /*retval*/, int64_t transactionId) override { + parent_.last_transactionId = transactionId; + parent_.usb_last_cookie = cookie; + parent_.enable_usb_data_done = true; + parent_.notify(); + return ScopedAStatus::ok(); + } + + // Callback method for the status of enableContaminantPresenceDetection + ScopedAStatus notifyContaminantEnabledStatus(const string& /*portName*/, bool /*enable*/, + Status /*retval*/, int64_t transactionId) override { + parent_.last_transactionId = transactionId; + parent_.usb_last_cookie = cookie; + parent_.enable_contaminant_done = true; + parent_.notify(); + return ScopedAStatus::ok(); + } + + // Callback method for the status of queryPortStatus operation + ScopedAStatus notifyQueryPortStatus(const string& /*portName*/, Status /*retval*/, + int64_t transactionId) override { + parent_.last_transactionId = transactionId; + parent_.notify(); + return ScopedAStatus::ok(); + } + }; + + virtual void SetUp() override { + ALOGI("Setup"); + usb = IUsb::fromBinder( + SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); + ASSERT_NE(usb, nullptr); + + usb_cb_2 = ::ndk::SharedRefBase::make(*this, 2); + ASSERT_NE(usb_cb_2, nullptr); + const auto& ret = usb->setCallback(usb_cb_2); + ASSERT_TRUE(ret.isOk()); + } + + virtual void TearDown() override { ALOGI("Teardown"); } + + // Used as a mechanism to inform the test about data/event callback. + inline void notify() { + std::unique_lock lock(usb_mtx); + usb_count++; + usb_cv.notify_one(); + } + + // Test code calls this function to wait for data/event callback. + inline std::cv_status wait() { + std::unique_lock lock(usb_mtx); + + std::cv_status status = std::cv_status::no_timeout; + auto now = std::chrono::system_clock::now(); + while (usb_count == 0) { + status = + usb_cv.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD)); + if (status == std::cv_status::timeout) { + ALOGI("timeout"); + return status; + } + } + usb_count--; + return status; + } + + // USB aidl hal Proxy + shared_ptr usb; + + // Callback objects for usb aidl + // Methods of these objects are called to notify port status updates. + shared_ptr usb_cb_1, usb_cb_2; + + // The last conveyed status of the USB ports. + // Stores information of currentt_data_role, power_role for all the USB ports + PortStatus usb_last_port_status; + + // Status of the last role switch operation. + Status usb_last_status; + + // Port role information of the last role switch operation. + PortRole usb_last_port_role; + + // Flag to indicate the invocation of role switch callback. + bool usb_role_switch_done; + + // Flag to indicate the invocation of notifyContaminantEnabledStatus callback. + bool enable_contaminant_done; + + // Flag to indicate the invocation of notifyEnableUsbDataStatus callback. + bool enable_usb_data_done; + + // Stores the cookie of the last invoked usb callback object. + int usb_last_cookie; + + // Last transaction ID that was recorded. + int64_t last_transactionId; + // synchronization primitives to coordinate between main test thread + // and the callback thread. + std::mutex usb_mtx; + std::condition_variable usb_cv; + int usb_count = 0; +}; + +/* + * Test to see if setCallback succeeds. + * Callback object is created and registered. + */ +TEST_P(UsbAidlTest, setCallback) { + ALOGI("UsbAidlTest setCallback start"); + usb_cb_1 = ::ndk::SharedRefBase::make(*this, 1); + ASSERT_NE(usb_cb_1, nullptr); + const auto& ret = usb->setCallback(usb_cb_1); + ASSERT_TRUE(ret.isOk()); + ALOGI("UsbAidlTest setCallback end"); +} + +/* + * Check to see if querying type-c + * port status succeeds. + * The callback parameters are checked to see if the transaction id + * matches. + */ +TEST_P(UsbAidlTest, queryPortStatus) { + ALOGI("UsbAidlTest queryPortStatus start"); + int64_t transactionId = rand() % 10000; + const auto& ret = usb->queryPortStatus(transactionId); + ASSERT_TRUE(ret.isOk()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + ALOGI("UsbAidlTest queryPortStatus end: %s", usb_last_port_status.portName.c_str()); +} + +/* + * Trying to switch a non-existent port should fail. + * This test case tried to switch the port with empty + * name which is expected to fail. + * The callback parameters are checked to see if the transaction id + * matches. + */ +TEST_P(UsbAidlTest, switchEmptyPort) { + ALOGI("UsbAidlTest switchEmptyPort start"); + PortRole role; + role.set(PortPowerRole::SOURCE); + int64_t transactionId = rand() % 10000; + const auto& ret = usb->switchRole("", role, transactionId); + ASSERT_TRUE(ret.isOk()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(Status::ERROR, usb_last_status); + EXPECT_EQ(transactionId, last_transactionId); + EXPECT_EQ(2, usb_last_cookie); + ALOGI("UsbAidlTest switchEmptyPort end"); +} + +/* + * Test switching the power role of usb port. + * Test case queries the usb ports present in device. + * If there is at least one usb port, a power role switch + * to SOURCE is attempted for the port. + * The callback parameters are checked to see if the transaction id + * matches. + */ +TEST_P(UsbAidlTest, switchPowerRole) { + ALOGI("UsbAidlTest switchPowerRole start"); + PortRole role; + role.set(PortPowerRole::SOURCE); + int64_t transactionId = rand() % 10000; + const auto& ret = usb->queryPortStatus(transactionId); + ASSERT_TRUE(ret.isOk()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + + if (!usb_last_port_status.portName.empty()) { + string portBeingSwitched = usb_last_port_status.portName; + ALOGI("switchPower role portname:%s", portBeingSwitched.c_str()); + usb_role_switch_done = false; + transactionId = rand() % 10000; + const auto& ret = usb->switchRole(portBeingSwitched, role, transactionId); + ASSERT_TRUE(ret.isOk()); + + std::cv_status waitStatus = wait(); + while (waitStatus == std::cv_status::no_timeout && + usb_role_switch_done == false) + waitStatus = wait(); + + EXPECT_EQ(std::cv_status::no_timeout, waitStatus); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + } + ALOGI("UsbAidlTest switchPowerRole end"); +} + +/* + * Test switching the data role of usb port. + * Test case queries the usb ports present in device. + * If there is at least one usb port, a data role switch + * to device is attempted for the port. + * The callback parameters are checked to see if transaction id + * matches. + */ +TEST_P(UsbAidlTest, switchDataRole) { + ALOGI("UsbAidlTest switchDataRole start"); + PortRole role; + role.set(PortDataRole::DEVICE); + int64_t transactionId = rand() % 10000; + const auto& ret = usb->queryPortStatus(transactionId); + ASSERT_TRUE(ret.isOk()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + + if (!usb_last_port_status.portName.empty()) { + string portBeingSwitched = usb_last_port_status.portName; + ALOGI("portname:%s", portBeingSwitched.c_str()); + usb_role_switch_done = false; + transactionId = rand() % 10000; + const auto& ret = usb->switchRole(portBeingSwitched, role, transactionId); + ASSERT_TRUE(ret.isOk()); + + std::cv_status waitStatus = wait(); + while (waitStatus == std::cv_status::no_timeout && + usb_role_switch_done == false) + waitStatus = wait(); + + EXPECT_EQ(std::cv_status::no_timeout, waitStatus); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + } + ALOGI("UsbAidlTest switchDataRole end"); +} + +/* + * Test enabling contaminant presence detection of the port. + * Test case queries the usb ports present in device. + * If there is at least one usb port, enabling contaminant detection + * is attempted for the port. + * The callback parameters are checked to see if transaction id + * matches. + */ +TEST_P(UsbAidlTest, enableContaminantPresenceDetection) { + ALOGI("UsbAidlTest enableContaminantPresenceDetection start"); + int64_t transactionId = rand() % 10000; + const auto& ret = usb->queryPortStatus(transactionId); + ASSERT_TRUE(ret.isOk()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + + if (!usb_last_port_status.portName.empty()) { + ALOGI("portname:%s", usb_last_port_status.portName.c_str()); + enable_contaminant_done = false; + transactionId = rand() % 10000; + const auto& ret = usb->enableContaminantPresenceDetection(usb_last_port_status.portName, + true, transactionId); + ASSERT_TRUE(ret.isOk()); + + std::cv_status waitStatus = wait(); + while (waitStatus == std::cv_status::no_timeout && + enable_contaminant_done == false) + waitStatus = wait(); + + EXPECT_EQ(std::cv_status::no_timeout, waitStatus); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + } + ALOGI("UsbAidlTest enableContaminantPresenceDetection end"); +} + +/* + * Test enabling Usb data of the port. + * Test case queries the usb ports present in device. + * If there is at least one usb port, enabling Usb data is attempted + * for the port. + * The callback parameters are checked to see if transaction id + * matches. + */ +TEST_P(UsbAidlTest, enableUsbData) { + ALOGI("UsbAidlTest enableUsbData start"); + int64_t transactionId = rand() % 10000; + const auto& ret = usb->queryPortStatus(transactionId); + ASSERT_TRUE(ret.isOk()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + + if (!usb_last_port_status.portName.empty()) { + ALOGI("portname:%s", usb_last_port_status.portName.c_str()); + enable_usb_data_done = false; + transactionId = rand() % 10000; + const auto& ret = usb->enableUsbData(usb_last_port_status.portName, true, transactionId); + ASSERT_TRUE(ret.isOk()); + + std::cv_status waitStatus = wait(); + while (waitStatus == std::cv_status::no_timeout && + enable_usb_data_done == false) + waitStatus = wait(); + + EXPECT_EQ(std::cv_status::no_timeout, waitStatus); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + } + ALOGI("UsbAidlTest enableUsbData end"); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(UsbAidlTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, UsbAidlTest, + testing::ValuesIn(::android::getAidlHalInstanceNames(IUsb::descriptor)), + ::android::PrintInstanceNameToString); + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + ABinderProcess_setThreadPoolMaxThreadCount(1); + ABinderProcess_startThreadPool(); + return RUN_ALL_TESTS(); +} -- GitLab From 623f13385f0e839c2c1d41e61f149a61f2e10e31 Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Thu, 25 Nov 2021 09:35:21 -0800 Subject: [PATCH 478/825] Add limitPowerTransfer API to IUsb limitPowerTransfer is invoked to limit power transfer in and out of the Usb port. Bug: 199357330 Signed-off-by: Badhri Jagan Sridharan Change-Id: I5f4991d024ad827ae8148fc143a44cc05bafdcb4 --- .../current/android/hardware/usb/IUsb.aidl | 1 + .../android/hardware/usb/IUsbCallback.aidl | 1 + .../android/hardware/usb/PortStatus.aidl | 1 + usb/aidl/android/hardware/usb/IUsb.aidl | 13 +++++++++++++ .../android/hardware/usb/IUsbCallback.aidl | 12 ++++++++++++ usb/aidl/android/hardware/usb/PortStatus.aidl | 4 ++++ usb/aidl/default/Usb.cpp | 18 ++++++++++++++++++ usb/aidl/default/Usb.h | 2 ++ 8 files changed, 52 insertions(+) diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl index 7513461afb..73c7b825e2 100644 --- a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl @@ -39,4 +39,5 @@ interface IUsb { oneway void queryPortStatus(long transactionId); oneway void setCallback(in android.hardware.usb.IUsbCallback callback); oneway void switchRole(in String portName, in android.hardware.usb.PortRole role, long transactionId); + oneway void limitPowerTransfer(in String portName, boolean limit, long transactionId); } diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl index 57be590563..85861e9d41 100644 --- a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl @@ -39,4 +39,5 @@ interface IUsbCallback { oneway void notifyEnableUsbDataStatus(in String portName, boolean enable, in android.hardware.usb.Status retval, long transactionId); oneway void notifyContaminantEnabledStatus(in String portName, boolean enable, in android.hardware.usb.Status retval, long transactionId); oneway void notifyQueryPortStatus(in String portName, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyLimitPowerTransferStatus(in String portName, boolean limit, in android.hardware.usb.Status retval, long transactionId); } diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl index 78dcfacef9..14bb90fd15 100644 --- a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl @@ -48,4 +48,5 @@ parcelable PortStatus { boolean supportsEnableContaminantPresenceDetection; android.hardware.usb.ContaminantDetectionStatus contaminantDetectionStatus = android.hardware.usb.ContaminantDetectionStatus.NOT_SUPPORTED; boolean usbDataEnabled; + boolean powerTransferLimited; } diff --git a/usb/aidl/android/hardware/usb/IUsb.aidl b/usb/aidl/android/hardware/usb/IUsb.aidl index 9a8f0006ee..1596d9ada5 100644 --- a/usb/aidl/android/hardware/usb/IUsb.aidl +++ b/usb/aidl/android/hardware/usb/IUsb.aidl @@ -82,4 +82,17 @@ oneway interface IUsb { * @param transactionId ID to be used when invoking the callback. */ void switchRole(in String portName, in PortRole role, long transactionId); + + /** + * This function is used to limit power transfer in and out of the port. + * When limited, the port does not charge from the partner port. + * Also, the port limits sourcing power to the partner port when the USB + * specification allows it to do so. + * + * @param portName name of the port for which power transfer is being limited. + * @param limit true limit power transfer. + * false relax limiting power transfer. + * @param transactionId ID to be used when invoking the callback. + */ + void limitPowerTransfer(in String portName, boolean limit, long transactionId); } diff --git a/usb/aidl/android/hardware/usb/IUsbCallback.aidl b/usb/aidl/android/hardware/usb/IUsbCallback.aidl index 232a15babe..b733fede3b 100644 --- a/usb/aidl/android/hardware/usb/IUsbCallback.aidl +++ b/usb/aidl/android/hardware/usb/IUsbCallback.aidl @@ -83,4 +83,16 @@ oneway interface IUsbCallback { * @param transactionId transactionId sent during queryPortStatus request */ void notifyQueryPortStatus(in String portName, in Status retval, long transactionId); + + /** + * Used to notify the result of requesting limitPowerTransfer. + * + * @param portName name of the port for which power transfer is being limited. + * @param limit true limit power transfer. + * false relax limiting power transfer. + * @param retval SUCCESS if the request to enable/disable limitPowerTransfer succeeds. + * FAILURE otherwise. + * @param transactionId ID sent during limitPowerTransfer request. + */ + void notifyLimitPowerTransferStatus(in String portName, boolean limit, in Status retval, long transactionId); } diff --git a/usb/aidl/android/hardware/usb/PortStatus.aidl b/usb/aidl/android/hardware/usb/PortStatus.aidl index 8afe00916c..fb979e5f62 100644 --- a/usb/aidl/android/hardware/usb/PortStatus.aidl +++ b/usb/aidl/android/hardware/usb/PortStatus.aidl @@ -104,4 +104,8 @@ parcelable PortStatus { * UsbData status of the port. */ boolean usbDataEnabled; + /** + * Denoted whether power transfer is limited in the port. + */ + boolean powerTransferLimited; } diff --git a/usb/aidl/default/Usb.cpp b/usb/aidl/default/Usb.cpp index 1105376ad9..0624963883 100644 --- a/usb/aidl/default/Usb.cpp +++ b/usb/aidl/default/Usb.cpp @@ -289,6 +289,24 @@ ScopedAStatus Usb::switchRole(const string& in_portName, return ScopedAStatus::ok(); } +ScopedAStatus Usb::limitPowerTransfer(const string& in_portName, bool /*in_limit*/, + int64_t in_transactionId) { + std::vector currentPortStatus; + + pthread_mutex_lock(&mLock); + if (mCallback != NULL && in_transactionId >= 0) { + ScopedAStatus ret = mCallback->notifyLimitPowerTransferStatus( + in_portName, false, Status::NOT_SUPPORTED, in_transactionId); + if (!ret.isOk()) + ALOGE("limitPowerTransfer error %s", ret.getDescription().c_str()); + } else { + ALOGE("Not notifying the userspace. Callback is not set"); + } + pthread_mutex_unlock(&mLock); + + return ScopedAStatus::ok(); +} + Status getAccessoryConnected(const string &portName, string *accessory) { string filename = kTypecPath + portName + "-partner/accessory_mode"; diff --git a/usb/aidl/default/Usb.h b/usb/aidl/default/Usb.h index bca86ae06c..71ec938a56 100644 --- a/usb/aidl/default/Usb.h +++ b/usb/aidl/default/Usb.h @@ -54,6 +54,8 @@ struct Usb : public BnUsb { int64_t in_transactionId) override; ScopedAStatus enableUsbData(const string& in_portName, bool in_enable, int64_t in_transactionId) override; + ScopedAStatus limitPowerTransfer(const std::string& in_portName, bool in_limit, + int64_t in_transactionId)override; shared_ptr mCallback; // Protects mCallback variable -- GitLab From 6f67c56a65257844d04fb82684cf9db687f484ee Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Mon, 17 Jan 2022 19:13:08 -0800 Subject: [PATCH 479/825] Add Vts test for limitPowerTransfer interface Bug: 199357330 Change-Id: I018e3ebf1b8a6d7e5b1ad2592695ab2541439a59 --- usb/aidl/vts/VtsAidlUsbTargetTest.cpp | 49 +++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/usb/aidl/vts/VtsAidlUsbTargetTest.cpp b/usb/aidl/vts/VtsAidlUsbTargetTest.cpp index 09cb096702..bab5a3af59 100644 --- a/usb/aidl/vts/VtsAidlUsbTargetTest.cpp +++ b/usb/aidl/vts/VtsAidlUsbTargetTest.cpp @@ -129,6 +129,16 @@ class UsbAidlTest : public testing::TestWithParam { parent_.notify(); return ScopedAStatus::ok(); } + + // Callback method for the status of limitPowerTransfer operation + ScopedAStatus notifyLimitPowerTransferStatus(const string& /*portName*/, bool /*limit*/, + Status /*retval*/, int64_t transactionId) override { + parent_.last_transactionId = transactionId; + parent_.usb_last_cookie = cookie; + parent_.limit_power_transfer_done = true; + parent_.notify(); + return ScopedAStatus::ok(); + } }; virtual void SetUp() override { @@ -196,6 +206,9 @@ class UsbAidlTest : public testing::TestWithParam { // Flag to indicate the invocation of notifyEnableUsbDataStatus callback. bool enable_usb_data_done; + // Flag to indicate the invocation of notifyLimitPowerTransferStatus callback. + bool limit_power_transfer_done; + // Stores the cookie of the last invoked usb callback object. int usb_last_cookie; @@ -410,6 +423,42 @@ TEST_P(UsbAidlTest, enableUsbData) { ALOGI("UsbAidlTest enableUsbData end"); } +/* + * Test enabling Usb data of the port. + * Test case queries the usb ports present in device. + * If there is at least one usb port, relaxing limit power transfer + * is attempted for the port. + * The callback parameters are checked to see if transaction id + * matches. + */ +TEST_P(UsbAidlTest, limitPowerTransfer) { + ALOGI("UsbAidlTest limitPowerTransfer start"); + int64_t transactionId = rand() % 10000; + const auto& ret = usb->queryPortStatus(transactionId); + ASSERT_TRUE(ret.isOk()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + + if (!usb_last_port_status.portName.empty()) { + ALOGI("portname:%s", usb_last_port_status.portName.c_str()); + limit_power_transfer_done = false; + transactionId = rand() % 10000; + const auto& ret = usb->limitPowerTransfer(usb_last_port_status.portName, false, transactionId); + ASSERT_TRUE(ret.isOk()); + + std::cv_status waitStatus = wait(); + while (waitStatus == std::cv_status::no_timeout && + limit_power_transfer_done == false) + waitStatus = wait(); + + EXPECT_EQ(std::cv_status::no_timeout, waitStatus); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + } + ALOGI("UsbAidlTest limitPowerTransfer end"); +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(UsbAidlTest); INSTANTIATE_TEST_SUITE_P( PerInstance, UsbAidlTest, -- GitLab From 754fcb8c33af62e618a8ab162cbec15d5fe27a9f Mon Sep 17 00:00:00 2001 From: Greg Kaiser Date: Fri, 21 Jan 2022 07:00:25 -0800 Subject: [PATCH 480/825] Avoid multiple map lookups We directly use erase(), and its return value, so we only need to look up 'deviceName' once. Test: TreeHugger Bug: 191248460 Change-Id: I7c229e7d1de5f76071f55f965eab447b6c868bcc --- .../provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp b/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp index c812d54a09..b63e3bb88b 100644 --- a/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp +++ b/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp @@ -292,8 +292,7 @@ void ExternalCameraProviderImpl_2_7::deviceRemoved(const char* devName) { } else { deviceName = std::string("device@3.4/external/") + cameraId; } - if (mCameraStatusMap.find(deviceName) != mCameraStatusMap.end()) { - mCameraStatusMap.erase(deviceName); + if (mCameraStatusMap.erase(deviceName) != 0) { if (mCallbacks != nullptr) { mCallbacks->cameraDeviceStatusChange(deviceName, CameraDeviceStatus::NOT_PRESENT); } @@ -391,4 +390,4 @@ Return ExternalCameraProviderImpl_2_7::isConcurrentStreamCombinationSuppor } // namespace provider } // namespace camera } // namespace hardware -} // namespace android \ No newline at end of file +} // namespace android -- GitLab From d97a3c3cd894d9cc012749ad15bdc264a31cb5a7 Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Fri, 21 Jan 2022 16:12:04 +0000 Subject: [PATCH 481/825] Relax assertion criteria in HIDL sensors convert code Because this code may be used to translate from/between subsequent sensor types (e.g. new AIDL sensor types), relax the assertion criteria to allow this generic conversion. Bug: 215702376 Test: Compile Change-Id: I40b67aa91d5e0d35199b561d32b2d7f7d59a4ac4 --- sensors/1.0/default/convert.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sensors/1.0/default/convert.cpp b/sensors/1.0/default/convert.cpp index 53ceb0d92f..43ee3276b9 100644 --- a/sensors/1.0/default/convert.cpp +++ b/sensors/1.0/default/convert.cpp @@ -190,8 +190,6 @@ void convertFromSensorEvent(const sensors_event_t &src, Event *dst) { } default: { - CHECK_GE((int32_t)dst->sensorType, (int32_t)SensorType::DEVICE_PRIVATE_BASE); - memcpy(dst->u.data.data(), src.data, 16 * sizeof(float)); break; } @@ -330,9 +328,6 @@ void convertToSensorEvent(const Event &src, sensors_event_t *dst) { } default: { - CHECK_GE((int32_t)src.sensorType, - (int32_t)SensorType::DEVICE_PRIVATE_BASE); - memcpy(dst->data, src.u.data.data(), 16 * sizeof(float)); break; } -- GitLab From 881190f81025643f4fb3622dc4f1eadc1fbba407 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Fri, 14 Jan 2022 13:23:37 -0800 Subject: [PATCH 482/825] Support frontend status readiness query. The caller could use it to check whether frontend status is ready to read or not. Bug: 171540820 Test: atest VtsHalTvTunerTargetTest Change-Id: I65521aacd8afe824342ad0b24f7d89006ceb5851 --- .../tv/tuner/FrontendStatusReadiness.aidl | 43 +++++ .../android/hardware/tv/tuner/IFrontend.aidl | 1 + .../tv/tuner/FrontendStatusReadiness.aidl | 54 ++++++ .../android/hardware/tv/tuner/IFrontend.aidl | 11 ++ tv/tuner/aidl/default/Frontend.cpp | 176 ++++++++++++++++++ tv/tuner/aidl/default/Frontend.h | 6 + tv/tuner/aidl/default/Tuner.cpp | 158 +--------------- tv/tuner/aidl/default/Tuner.h | 2 - .../aidl/vts/functional/FrontendTests.cpp | 44 +++++ tv/tuner/aidl/vts/functional/FrontendTests.h | 1 + .../functional/VtsHalTvTunerTargetTest.cpp | 8 + 11 files changed, 346 insertions(+), 158 deletions(-) create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusReadiness.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusReadiness.aidl diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusReadiness.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusReadiness.aidl new file mode 100644 index 0000000000..41944ce440 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusReadiness.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 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 -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.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendStatusReadiness { + UNDEFINED = 0, + UNAVAILABLE = 1, + UNSTABLE = 2, + STABLE = 3, + UNSUPPORTED = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl index e240e40666..3e3ff4fad6 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl @@ -47,4 +47,5 @@ interface IFrontend { void unlinkCiCam(in int ciCamId); String getHardwareInfo(); void removeOutputPid(int pid); + android.hardware.tv.tuner.FrontendStatusReadiness[] getFrontendStatusReadiness(in android.hardware.tv.tuner.FrontendStatusType[] statusTypes); } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusReadiness.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusReadiness.aidl new file mode 100644 index 0000000000..a9e3080c69 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusReadiness.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * FrontendStatus readiness status. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendStatusReadiness { + /** + * The FrontendStatus’ readiness status for the given FrontendStatusType is + * undefined. + */ + UNDEFINED, + + /** + * The FrontendStatus for the given FrontendStatusType is currently + * unavailable. + */ + UNAVAILABLE, + + /** + * The FrontendStatus for the given FrontendStatusType can be read, but it’s + * unstable. + */ + UNSTABLE, + + /** + * The FrontendStatus for the given FrontendStatusType can be ready, and it’s + * stable. + */ + STABLE, + + /** + * The FrontendStatus for the given FrontendStatusType is not supported. + */ + UNSUPPORTED, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl index f8248e660b..12f2692992 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl @@ -19,6 +19,7 @@ package android.hardware.tv.tuner; import android.hardware.tv.tuner.FrontendScanType; import android.hardware.tv.tuner.FrontendSettings; import android.hardware.tv.tuner.FrontendStatus; +import android.hardware.tv.tuner.FrontendStatusReadiness; import android.hardware.tv.tuner.FrontendStatusType; import android.hardware.tv.tuner.IFrontendCallback; @@ -155,4 +156,14 @@ interface IFrontend { * @return UNAVAILABLE if the frontend doesn’t support PID filtering out. */ void removeOutputPid(int pid); + + /** + * Gets FrontendStatus’ readiness statuses for given status types. + * + * @param statusTypes an array of status types. + * + * @return an array of current readiness statuses. The ith readiness status in + * the array presents fronted type statusTypes[i]’s readiness status. + */ + FrontendStatusReadiness[] getFrontendStatusReadiness(in FrontendStatusType[] statusTypes); } diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index f0bf0011ed..056d01468a 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -34,6 +34,140 @@ Frontend::Frontend(FrontendType type, int32_t id, std::shared_ptr tuner) mTuner = tuner; // Init callback to nullptr mCallback = nullptr; + + switch (mType) { + case FrontendType::ISDBS: { + mFrontendCaps.set(FrontendIsdbsCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::DEMOD_LOCK, + FrontendStatusType::SNR, + FrontendStatusType::FEC, + FrontendStatusType::MODULATION, + FrontendStatusType::MODULATIONS, + FrontendStatusType::ROLL_OFF, + FrontendStatusType::STREAM_ID_LIST, + }; + break; + } + case FrontendType::ATSC3: { + mFrontendCaps.set(FrontendAtsc3Capabilities()); + mFrontendStatusCaps = { + FrontendStatusType::BER, + FrontendStatusType::PER, + FrontendStatusType::ATSC3_PLP_INFO, + FrontendStatusType::MODULATIONS, + FrontendStatusType::BERS, + FrontendStatusType::INTERLEAVINGS, + FrontendStatusType::BANDWIDTH, + FrontendStatusType::ATSC3_ALL_PLP_INFO, + }; + break; + } + case FrontendType::DVBC: { + mFrontendCaps.set(FrontendDvbcCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::PRE_BER, FrontendStatusType::SIGNAL_QUALITY, + FrontendStatusType::MODULATION, FrontendStatusType::SPECTRAL, + FrontendStatusType::MODULATIONS, FrontendStatusType::CODERATES, + FrontendStatusType::INTERLEAVINGS, FrontendStatusType::BANDWIDTH, + }; + break; + } + case FrontendType::DVBS: { + mFrontendCaps.set(FrontendDvbsCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::SIGNAL_STRENGTH, FrontendStatusType::SYMBOL_RATE, + FrontendStatusType::MODULATION, FrontendStatusType::MODULATIONS, + FrontendStatusType::ROLL_OFF, FrontendStatusType::IS_MISO, + }; + break; + } + case FrontendType::DVBT: { + mFrontendCaps.set(FrontendDvbtCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::EWBS, + FrontendStatusType::PLP_ID, + FrontendStatusType::HIERARCHY, + FrontendStatusType::MODULATIONS, + FrontendStatusType::BANDWIDTH, + FrontendStatusType::GUARD_INTERVAL, + FrontendStatusType::TRANSMISSION_MODE, + FrontendStatusType::T2_SYSTEM_ID, + FrontendStatusType::DVBT_CELL_IDS, + }; + break; + } + case FrontendType::ISDBT: { + FrontendIsdbtCapabilities isdbtCaps{ + .modeCap = (int)FrontendIsdbtMode::MODE_1 | (int)FrontendIsdbtMode::MODE_2, + .bandwidthCap = (int)FrontendIsdbtBandwidth::BANDWIDTH_6MHZ, + .modulationCap = (int)FrontendIsdbtModulation::MOD_16QAM, + .coderateCap = (int)FrontendIsdbtCoderate::CODERATE_4_5 | + (int)FrontendIsdbtCoderate::CODERATE_6_7, + .guardIntervalCap = (int)FrontendIsdbtGuardInterval::INTERVAL_1_128, + .timeInterleaveCap = (int)FrontendIsdbtTimeInterleaveMode::AUTO | + (int)FrontendIsdbtTimeInterleaveMode::INTERLEAVE_1_0, + .isSegmentAuto = true, + .isFullSegment = true, + }; + mFrontendCaps.set(isdbtCaps); + mFrontendStatusCaps = { + FrontendStatusType::AGC, + FrontendStatusType::LNA, + FrontendStatusType::MODULATION, + FrontendStatusType::MODULATIONS, + FrontendStatusType::BANDWIDTH, + FrontendStatusType::GUARD_INTERVAL, + FrontendStatusType::TRANSMISSION_MODE, + FrontendStatusType::ISDBT_SEGMENTS, + FrontendStatusType::ISDBT_MODE, + FrontendStatusType::ISDBT_PARTIAL_RECEPTION_FLAG, + FrontendStatusType::INTERLEAVINGS, + }; + break; + } + case FrontendType::ANALOG: { + mFrontendCaps.set(FrontendAnalogCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::LAYER_ERROR, + FrontendStatusType::MER, + FrontendStatusType::UEC, + FrontendStatusType::TS_DATA_RATES, + }; + break; + } + case FrontendType::ATSC: { + mFrontendCaps.set(FrontendAtscCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::FREQ_OFFSET, + FrontendStatusType::RF_LOCK, + FrontendStatusType::MODULATIONS, + FrontendStatusType::IS_LINEAR, + }; + break; + } + case FrontendType::ISDBS3: { + mFrontendCaps.set(FrontendIsdbs3Capabilities()); + mFrontendStatusCaps = { + FrontendStatusType::DEMOD_LOCK, FrontendStatusType::MODULATION, + FrontendStatusType::MODULATIONS, FrontendStatusType::ROLL_OFF, + FrontendStatusType::IS_SHORT_FRAMES, FrontendStatusType::STREAM_ID_LIST, + }; + break; + } + case FrontendType::DTMB: { + mFrontendCaps.set(FrontendDtmbCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::MODULATIONS, FrontendStatusType::INTERLEAVINGS, + FrontendStatusType::BANDWIDTH, FrontendStatusType::GUARD_INTERVAL, + FrontendStatusType::TRANSMISSION_MODE, + }; + break; + } + default: { + break; + } + } } Frontend::~Frontend() {} @@ -763,6 +897,10 @@ binder_status_t Frontend::dump(int fd, const char** /* args */, uint32_t /* numA dprintf(fd, " mType: %d\n", mType); dprintf(fd, " mIsLocked: %d\n", mIsLocked); dprintf(fd, " mCiCamId: %d\n", mCiCamId); + dprintf(fd, " mFrontendStatusCaps:"); + for (int i = 0; i < mFrontendStatusCaps.size(); i++) { + dprintf(fd, " %d\n", mFrontendStatusCaps[i]); + } return STATUS_OK; } @@ -780,6 +918,29 @@ binder_status_t Frontend::dump(int fd, const char** /* args */, uint32_t /* numA static_cast(Result::UNAVAILABLE)); } +::ndk::ScopedAStatus Frontend::getFrontendStatusReadiness( + const std::vector& in_statusTypes, + std::vector* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + _aidl_return->resize(in_statusTypes.size()); + for (int i = 0; i < in_statusTypes.size(); i++) { + int j = 0; + while (j < mFrontendStatusCaps.size()) { + if (in_statusTypes[i] == mFrontendStatusCaps[j]) { + (*_aidl_return)[i] = FrontendStatusReadiness::STABLE; + break; + } + j++; + } + if (j >= mFrontendStatusCaps.size()) { + (*_aidl_return)[i] = FrontendStatusReadiness::UNSUPPORTED; + } + } + + return ::ndk::ScopedAStatus::ok(); +} + FrontendType Frontend::getFrontendType() { return mType; } @@ -797,6 +958,21 @@ bool Frontend::isLocked() { return mIsLocked; } +void Frontend::getFrontendInfo(FrontendInfo* _aidl_return) { + // assign randomly selected values for testing. + *_aidl_return = { + .type = mType, + .minFrequency = 139000000, + .maxFrequency = 1139000000, + .minSymbolRate = 45, + .maxSymbolRate = 1145, + .acquireRange = 30, + .exclusiveGroupId = 57, + .statusCaps = mFrontendStatusCaps, + .frontendCaps = mFrontendCaps, + }; +} + } // namespace tuner } // namespace tv } // namespace hardware diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h index 3df1aa1d78..1d9ab53a61 100644 --- a/tv/tuner/aidl/default/Frontend.h +++ b/tv/tuner/aidl/default/Frontend.h @@ -51,6 +51,9 @@ class Frontend : public BnFrontend { ::ndk::ScopedAStatus unlinkCiCam(int32_t in_ciCamId) override; ::ndk::ScopedAStatus getHardwareInfo(std::string* _aidl_return) override; ::ndk::ScopedAStatus removeOutputPid(int32_t in_pid) override; + ::ndk::ScopedAStatus getFrontendStatusReadiness( + const std::vector& in_statusTypes, + std::vector* _aidl_return) override; binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; @@ -58,6 +61,7 @@ class Frontend : public BnFrontend { int32_t getFrontendId(); string getSourceFile(); bool isLocked(); + void getFrontendInfo(FrontendInfo* _aidl_return); private: virtual ~Frontend(); @@ -74,6 +78,8 @@ class Frontend : public BnFrontend { FrontendSettings mFrontendSettings; FrontendScanType mFrontendScanType; std::ifstream mFrontendData; + FrontendCapabilities mFrontendCaps; + vector mFrontendStatusCaps; }; } // namespace tuner diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp index 7a5fa6ecad..fa74288b09 100644 --- a/tv/tuner/aidl/default/Tuner.cpp +++ b/tv/tuner/aidl/default/Tuner.cpp @@ -49,154 +49,15 @@ void Tuner::init() { mFrontends[8] = ndk::SharedRefBase::make(FrontendType::ISDBS3, 8, this->ref()); mFrontends[9] = ndk::SharedRefBase::make(FrontendType::DTMB, 9, this->ref()); - vector statusCaps; - - FrontendCapabilities capsIsdbs; - capsIsdbs.set(FrontendIsdbsCapabilities()); - mFrontendCaps[0] = capsIsdbs; - statusCaps = { - FrontendStatusType::DEMOD_LOCK, - FrontendStatusType::SNR, - FrontendStatusType::FEC, - FrontendStatusType::MODULATION, - FrontendStatusType::MODULATIONS, - FrontendStatusType::ROLL_OFF, - FrontendStatusType::STREAM_ID_LIST, - }; - mFrontendStatusCaps[0] = statusCaps; mMaxUsableFrontends[FrontendType::ISDBS] = 1; - - FrontendCapabilities capsAtsc3; - capsAtsc3.set(FrontendAtsc3Capabilities()); - mFrontendCaps[1] = capsAtsc3; - statusCaps = { - FrontendStatusType::BER, - FrontendStatusType::PER, - FrontendStatusType::ATSC3_PLP_INFO, - FrontendStatusType::MODULATIONS, - FrontendStatusType::BERS, - FrontendStatusType::INTERLEAVINGS, - FrontendStatusType::BANDWIDTH, - FrontendStatusType::ATSC3_ALL_PLP_INFO, - }; - mFrontendStatusCaps[1] = statusCaps; mMaxUsableFrontends[FrontendType::ATSC3] = 1; - - FrontendCapabilities capsDvbc; - capsDvbc.set(FrontendDvbcCapabilities()); - mFrontendCaps[2] = capsDvbc; - statusCaps = { - FrontendStatusType::PRE_BER, FrontendStatusType::SIGNAL_QUALITY, - FrontendStatusType::MODULATION, FrontendStatusType::SPECTRAL, - FrontendStatusType::MODULATIONS, FrontendStatusType::CODERATES, - FrontendStatusType::INTERLEAVINGS, FrontendStatusType::BANDWIDTH, - }; - mFrontendStatusCaps[2] = statusCaps; mMaxUsableFrontends[FrontendType::DVBC] = 1; - - FrontendCapabilities capsDvbs; - capsDvbs.set(FrontendDvbsCapabilities()); - mFrontendCaps[3] = capsDvbs; - statusCaps = { - FrontendStatusType::SIGNAL_STRENGTH, FrontendStatusType::SYMBOL_RATE, - FrontendStatusType::MODULATION, FrontendStatusType::MODULATIONS, - FrontendStatusType::ROLL_OFF, FrontendStatusType::IS_MISO, - }; - mFrontendStatusCaps[3] = statusCaps; mMaxUsableFrontends[FrontendType::DVBS] = 1; - - FrontendCapabilities capsDvbt; - capsDvbt.set(FrontendDvbtCapabilities()); - mFrontendCaps[4] = capsDvbt; - statusCaps = { - FrontendStatusType::EWBS, - FrontendStatusType::PLP_ID, - FrontendStatusType::HIERARCHY, - FrontendStatusType::MODULATIONS, - FrontendStatusType::BANDWIDTH, - FrontendStatusType::GUARD_INTERVAL, - FrontendStatusType::TRANSMISSION_MODE, - FrontendStatusType::T2_SYSTEM_ID, - FrontendStatusType::DVBT_CELL_IDS, - }; - mFrontendStatusCaps[4] = statusCaps; mMaxUsableFrontends[FrontendType::DVBT] = 1; - - FrontendCapabilities capsIsdbt; - FrontendIsdbtCapabilities isdbtCaps{ - .modeCap = (int)FrontendIsdbtMode::MODE_1 | (int)FrontendIsdbtMode::MODE_2, - .bandwidthCap = (int)FrontendIsdbtBandwidth::BANDWIDTH_6MHZ, - .modulationCap = (int)FrontendIsdbtModulation::MOD_16QAM, - .coderateCap = (int)FrontendIsdbtCoderate::CODERATE_4_5 | - (int)FrontendIsdbtCoderate::CODERATE_6_7, - .guardIntervalCap = (int)FrontendIsdbtGuardInterval::INTERVAL_1_128, - .timeInterleaveCap = (int)FrontendIsdbtTimeInterleaveMode::AUTO | - (int)FrontendIsdbtTimeInterleaveMode::INTERLEAVE_1_0, - .isSegmentAuto = true, - .isFullSegment = true, - }; - capsIsdbt.set(isdbtCaps); - mFrontendCaps[5] = capsIsdbt; - statusCaps = { - FrontendStatusType::AGC, - FrontendStatusType::LNA, - FrontendStatusType::MODULATION, - FrontendStatusType::MODULATIONS, - FrontendStatusType::BANDWIDTH, - FrontendStatusType::GUARD_INTERVAL, - FrontendStatusType::TRANSMISSION_MODE, - FrontendStatusType::ISDBT_SEGMENTS, - FrontendStatusType::ISDBT_MODE, - FrontendStatusType::ISDBT_PARTIAL_RECEPTION_FLAG, - FrontendStatusType::INTERLEAVINGS, - }; - mFrontendStatusCaps[5] = statusCaps; mMaxUsableFrontends[FrontendType::ISDBT] = 1; - - FrontendCapabilities capsAnalog; - capsAnalog.set(FrontendAnalogCapabilities()); - mFrontendCaps[6] = capsAnalog; - statusCaps = { - FrontendStatusType::LAYER_ERROR, - FrontendStatusType::MER, - FrontendStatusType::UEC, - FrontendStatusType::TS_DATA_RATES, - }; - mFrontendStatusCaps[6] = statusCaps; mMaxUsableFrontends[FrontendType::ANALOG] = 1; - - FrontendCapabilities capsAtsc; - capsAtsc.set(FrontendAtscCapabilities()); - mFrontendCaps[7] = capsAtsc; - statusCaps = { - FrontendStatusType::FREQ_OFFSET, - FrontendStatusType::RF_LOCK, - FrontendStatusType::MODULATIONS, - FrontendStatusType::IS_LINEAR, - }; - mFrontendStatusCaps[7] = statusCaps; mMaxUsableFrontends[FrontendType::ATSC] = 1; - - FrontendCapabilities capsIsdbs3; - capsIsdbs3.set(FrontendIsdbs3Capabilities()); - mFrontendCaps[8] = capsIsdbs3; - statusCaps = { - FrontendStatusType::DEMOD_LOCK, FrontendStatusType::MODULATION, - FrontendStatusType::MODULATIONS, FrontendStatusType::ROLL_OFF, - FrontendStatusType::IS_SHORT_FRAMES, FrontendStatusType::STREAM_ID_LIST, - }; - mFrontendStatusCaps[8] = statusCaps; mMaxUsableFrontends[FrontendType::ISDBS3] = 1; - - FrontendCapabilities capsDtmb; - capsDtmb.set(FrontendDtmbCapabilities()); - mFrontendCaps[9] = capsDtmb; - statusCaps = { - FrontendStatusType::MODULATIONS, FrontendStatusType::INTERLEAVINGS, - FrontendStatusType::BANDWIDTH, FrontendStatusType::GUARD_INTERVAL, - FrontendStatusType::TRANSMISSION_MODE, - }; - mFrontendStatusCaps[9] = statusCaps; mMaxUsableFrontends[FrontendType::DTMB] = 1; mLnbs.resize(2); @@ -267,24 +128,12 @@ Tuner::~Tuner() {} ::ndk::ScopedAStatus Tuner::getFrontendInfo(int32_t in_frontendId, FrontendInfo* _aidl_return) { ALOGV("%s", __FUNCTION__); - if (in_frontendId >= mFrontendSize) { + if (in_frontendId < 0 || in_frontendId >= mFrontendSize) { return ::ndk::ScopedAStatus::fromServiceSpecificError( static_cast(Result::INVALID_ARGUMENT)); } - // assign randomly selected values for testing. - *_aidl_return = { - .type = mFrontends[in_frontendId]->getFrontendType(), - .minFrequency = 139000000, - .maxFrequency = 1139000000, - .minSymbolRate = 45, - .maxSymbolRate = 1145, - .acquireRange = 30, - .exclusiveGroupId = 57, - .statusCaps = mFrontendStatusCaps[in_frontendId], - .frontendCaps = mFrontendCaps[in_frontendId], - }; - + mFrontends[in_frontendId]->getFrontendInfo(_aidl_return); return ::ndk::ScopedAStatus::ok(); } @@ -360,9 +209,6 @@ binder_status_t Tuner::dump(int fd, const char** args, uint32_t numArgs) { dprintf(fd, "Frontends:\n"); for (int i = 0; i < mFrontendSize; i++) { mFrontends[i]->dump(fd, args, numArgs); - for (int j = 0; j < mFrontendStatusCaps[i].size(); j++) { - dprintf(fd, " statusCap: %d\n", mFrontendStatusCaps[i][j]); - } } } { diff --git a/tv/tuner/aidl/default/Tuner.h b/tv/tuner/aidl/default/Tuner.h index 216a2b6280..ad73003eeb 100644 --- a/tv/tuner/aidl/default/Tuner.h +++ b/tv/tuner/aidl/default/Tuner.h @@ -75,8 +75,6 @@ class Tuner : public BnTuner { private: // Static mFrontends array to maintain local frontends information map> mFrontends; - map mFrontendCaps; - map> mFrontendStatusCaps; map mFrontendToDemux; map> mDemuxes; // To maintain how many Frontends we have diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp index 62d9b744b5..a1f51dfe1a 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp +++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp @@ -581,3 +581,47 @@ void FrontendTests::scanTest(FrontendConfig frontendConf, FrontendScanType scanT ASSERT_TRUE(stopScanFrontend()); ASSERT_TRUE(closeFrontend()); } + +void FrontendTests::statusReadinessTest(FrontendConfig frontendConf) { + int32_t feId; + vector allTypes; + vector readiness; + getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(openFrontendById(feId)); + ASSERT_TRUE(setFrontendCallback()); + if (frontendConf.canConnectToCiCam) { + ASSERT_TRUE(linkCiCam(frontendConf.ciCamId)); + ASSERT_TRUE(removeOutputPid(frontendConf.removePid)); + ASSERT_TRUE(unlinkCiCam(frontendConf.ciCamId)); + } + ASSERT_TRUE(getFrontendInfo(feId)); + ASSERT_TRUE(tuneFrontend(frontendConf, false /*testWithDemux*/)); + + // TODO: find a better way to push all frontend status types + for (int32_t i = 0; i < static_cast(FrontendStatusType::ATSC3_ALL_PLP_INFO); i++) { + allTypes.push_back(static_cast(i)); + } + ndk::ScopedAStatus status = mFrontend->getFrontendStatusReadiness(allTypes, &readiness); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(readiness.size() == allTypes.size()); + for (int32_t i = 0; i < readiness.size(); i++) { + int32_t j = 0; + while (j < mFrontendInfo.statusCaps.size()) { + if (allTypes[i] == mFrontendInfo.statusCaps[j]) { + ASSERT_TRUE(readiness[i] == FrontendStatusReadiness::UNAVAILABLE || + readiness[i] == FrontendStatusReadiness::UNSTABLE || + readiness[i] == FrontendStatusReadiness::STABLE); + break; + } + j++; + } + + if (j >= mFrontendInfo.statusCaps.size()) { + ASSERT_TRUE(readiness[i] == FrontendStatusReadiness::UNSUPPORTED); + } + } + + ASSERT_TRUE(stopTuneFrontend(false /*testWithDemux*/)); + ASSERT_TRUE(closeFrontend()); +} diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.h b/tv/tuner/aidl/vts/functional/FrontendTests.h index 537c419256..1746c8efcc 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.h +++ b/tv/tuner/aidl/vts/functional/FrontendTests.h @@ -102,6 +102,7 @@ class FrontendTests { void scanTest(FrontendConfig frontend, FrontendScanType type); void debugInfoTest(FrontendConfig frontendConf); void maxNumberOfFrontendsTest(); + void statusReadinessTest(FrontendConfig frontendConf); void setDvrTests(DvrTests* dvrTests) { mExternalDvrTests = dvrTests; } void setDemux(std::shared_ptr demux) { getDvrTests()->setDemux(demux); } diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp index 0566089833..c99da419ed 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp @@ -907,6 +907,14 @@ TEST_P(TunerFrontendAidlTest, maxNumberOfFrontends) { mFrontendTests.maxNumberOfFrontendsTest(); } +TEST_P(TunerFrontendAidlTest, statusReadinessTest) { + description("Test Max Frontend status readiness"); + if (!live.hasFrontendConnection) { + return; + } + mFrontendTests.statusReadinessTest(frontendMap[live.frontendId]); +} + TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowVideoFilterTest) { description("Test Video Filter functionality in Broadcast use case."); if (!live.hasFrontendConnection) { -- GitLab From 62ae37be3cbab314076c531435f52db91c3cc061 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Thu, 20 Jan 2022 17:16:38 -0800 Subject: [PATCH 483/825] Fix asserts for GetReadbackBufferFenceInactive If there's no readback buffer, then the status is NOT ok(), and the returned fence must be -1. Bug: 213493262 Test: VtsHalGraphicsComposer3_TargetTest Change-Id: Iff1b6e04126bfcc748f0f8d173f63244bfd83be4 --- .../vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index fc527ecb28..3f1e703031 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -521,8 +521,9 @@ TEST_P(GraphicsCompositionTest, GetReadbackBufferFenceInactive) { ndk::ScopedFileDescriptor releaseFence; const auto error = mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &releaseFence); - EXPECT_TRUE(error.isOk()); + ASSERT_FALSE(error.isOk()); EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + EXPECT_EQ(-1, releaseFence.get()); } TEST_P(GraphicsCompositionTest, ClientComposition) { -- GitLab From d73b64ccc583785a9872628c1cbce2a57f2c898d Mon Sep 17 00:00:00 2001 From: Ahmed ElArabawy Date: Thu, 13 Jan 2022 09:20:15 -0800 Subject: [PATCH 484/825] Wifi: Update wifi vendor hal API with changes for 11be support This commit adds the required changes for the support of 802.11be (WiFi-7) support to the wifi vendor hal API. Bug: 198746544 Test: Build Succeeds Test: VTS test Change-Id: I1f631aaa247ce4240dd398230b57c7edae55c141 --- wifi/1.6/Android.bp | 7 + wifi/1.6/IWifiChip.hal | 90 +++ wifi/1.6/IWifiNanIface.hal | 43 ++ wifi/1.6/IWifiNanIfaceEventCallback.hal | 48 ++ wifi/1.6/IWifiRttController.hal | 100 +++ wifi/1.6/IWifiRttControllerEventCallback.hal | 33 + wifi/1.6/IWifiStaIface.hal | 44 ++ wifi/1.6/types.hal | 670 +++++++++++++++++++ 8 files changed, 1035 insertions(+) create mode 100644 wifi/1.6/IWifiChip.hal create mode 100644 wifi/1.6/IWifiNanIface.hal create mode 100644 wifi/1.6/IWifiNanIfaceEventCallback.hal create mode 100644 wifi/1.6/IWifiRttController.hal create mode 100644 wifi/1.6/IWifiRttControllerEventCallback.hal create mode 100644 wifi/1.6/IWifiStaIface.hal create mode 100644 wifi/1.6/types.hal diff --git a/wifi/1.6/Android.bp b/wifi/1.6/Android.bp index d293c73a79..14cb2e0466 100644 --- a/wifi/1.6/Android.bp +++ b/wifi/1.6/Android.bp @@ -14,6 +14,13 @@ hidl_interface { root: "android.hardware", srcs: [ "IWifi.hal", + "IWifiChip.hal", + "IWifiNanIface.hal", + "IWifiNanIfaceEventCallback.hal", + "IWifiRttController.hal", + "IWifiRttControllerEventCallback.hal", + "IWifiStaIface.hal", + "types.hal", ], interfaces: [ "android.hardware.wifi@1.0", diff --git a/wifi/1.6/IWifiChip.hal b/wifi/1.6/IWifiChip.hal new file mode 100644 index 0000000000..301bd82ca5 --- /dev/null +++ b/wifi/1.6/IWifiChip.hal @@ -0,0 +1,90 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.0::IWifiIface; +import @1.0::WifiStatus; +import @1.5::WifiBand; +import @1.5::IWifiChip; +import @1.5::WifiIfaceMode; +import IWifiRttController; + +/** + * Interface that represents a chip that must be configured as a single unit. + */ +interface IWifiChip extends @1.5::IWifiChip { + + /** + * Create a RTTController instance. + * + * RTT controller can be either: + * a) Bound to a specific iface by passing in the corresponding |IWifiIface| + * object in |iface| param, OR + * b) Let the implementation decide the iface to use for RTT operations by + * passing null in |iface| param. + * + * @param boundIface HIDL interface object representing the iface if + * the responder must be bound to a specific iface, null otherwise. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| + */ + createRttController_1_6(IWifiIface boundIface) + generates (WifiStatus status, IWifiRttController rtt); + + /** + * Retrieve list of usable Wifi channels for the specified band & + * operational modes. + * + * The list of usable Wifi channels in a given band depends on factors + * like current country code, operational mode (e.g. STA, SAP, WFD-CLI, + * WFD-GO, TDLS, NAN) and other restrictons due to DFS, cellular coexistence + * and conncurency state of the device. + * + * @param band |WifiBand| for which list of usable channels is requested. + * @param ifaceModeMask Bitmask of the modes represented by |WifiIfaceMode| + * Bitmask respresents all the modes that the caller is interested + * in (e.g. STA, SAP, CLI, GO, TDLS, NAN). E.g. If the caller is + * interested in knowing usable channels for P2P CLI, P2P GO & NAN, + * ifaceModeMask would be set to + * IFACE_MODE_P2P_CLIENT|IFACE_MODE_P2P_GO|IFACE_MODE_NAN. + * @param filterMask Bitmask of filters represented by + * |UsableChannelFilter|. Specifies whether driver should filter + * channels based on additional criteria. If no filter is specified + * driver should return usable channels purely based on regulatory + * constraints. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.FAILURE_UNKNOWN| + * @return channels List of channels represented by |WifiUsableChannel| + * Each entry represents a channel frequency, bandwidth and + * bitmask of modes (e.g. STA, SAP, CLI, GO, TDLS, NAN) that are + * allowed on that channel. E.g. If only STA mode can be supported + * on an indoor channel, only the IFACE_MODE_STA bit would be set + * for that channel. If 5GHz SAP cannot be supported, then none of + * the 5GHz channels will have IFACE_MODE_SOFTAP bit set. + * Note: Bits do not represent concurrency state. Each bit only + * represents whether particular mode is allowed on that channel. + */ + getUsableChannels_1_6(WifiBand band, bitfield ifaceModeMask, + bitfield filterMask) + generates (WifiStatus status, vec channels); +}; diff --git a/wifi/1.6/IWifiNanIface.hal b/wifi/1.6/IWifiNanIface.hal new file mode 100644 index 0000000000..b92a880364 --- /dev/null +++ b/wifi/1.6/IWifiNanIface.hal @@ -0,0 +1,43 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.0::WifiStatus; +import @1.5::IWifiNanIface; +import IWifiNanIfaceEventCallback; + +/** + * Interface used to represent a single NAN (Neighbour Aware Network) iface. + * + * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness + * Networking (NAN) Technical Specification". + */ +interface IWifiNanIface extends @1.5::IWifiNanIface { + /** + * Requests notifications of significant events on this iface. Multiple calls + * to this must register multiple callbacks each of which must receive all + * events. + * + * @param callback An instance of the |IWifiNanIfaceEventCallback| HIDL interface + * object. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| + */ + registerEventCallback_1_6(IWifiNanIfaceEventCallback callback) generates (WifiStatus status); +}; diff --git a/wifi/1.6/IWifiNanIfaceEventCallback.hal b/wifi/1.6/IWifiNanIfaceEventCallback.hal new file mode 100644 index 0000000000..05b8ddfa52 --- /dev/null +++ b/wifi/1.6/IWifiNanIfaceEventCallback.hal @@ -0,0 +1,48 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.0::CommandIdShort; +import @1.0::WifiNanStatus; +import @1.5::IWifiNanIfaceEventCallback; + +/** + * NAN Response and Asynchronous Event Callbacks. + * + * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness + * Networking (NAN) Technical Specification". + */ +interface IWifiNanIfaceEventCallback extends @1.5::IWifiNanIfaceEventCallback { + /** + * Asynchronous callback indicating a data-path (NDP) setup has been completed: received by + * both Initiator and Responder. + * + * Note: supersedes the @1.0::IWifiNanIfaceEventCallback.eventDataPathConfirm() method which is + * deprecated as of HAL version 1.2. + * + * @param event: NanDataPathConfirmInd containing event details. + */ + oneway eventDataPathConfirm_1_6(NanDataPathConfirmInd event); + + /** + * Asynchronous callback indicating a data-path (NDP) schedule has been updated (e.g. channels + * have been changed). + * + * @param event: NanDataPathScheduleUpdateInd containing event details. + */ + oneway eventDataPathScheduleUpdate_1_6(NanDataPathScheduleUpdateInd event); +}; diff --git a/wifi/1.6/IWifiRttController.hal b/wifi/1.6/IWifiRttController.hal new file mode 100644 index 0000000000..0db1d2c72b --- /dev/null +++ b/wifi/1.6/IWifiRttController.hal @@ -0,0 +1,100 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.0::CommandId; +import @1.0::WifiStatus; +import @1.4::IWifiRttController; +import IWifiRttControllerEventCallback; +/** + * Interface used to perform RTT(Round trip time) operations. + */ +interface IWifiRttController extends @1.4::IWifiRttController { + /** + * Requests notifications of significant events on this rtt controller. + * Multiple calls to this must register multiple callbacks each of which must + * receive all events. + * + * @param callback An instance of the |IWifiRttControllerEventCallback| HIDL + * interface object. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| + */ + registerEventCallback_1_6(IWifiRttControllerEventCallback callback) + generates (WifiStatus status); + + /** + * API to request RTT measurement. + * + * @param cmdId command Id to use for this invocation. + * @param rttConfigs Vector of |RttConfig| parameters. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + rangeRequest_1_6(CommandId cmdId, vec rttConfigs) generates (WifiStatus status); + + /** + * Get RTT responder information e.g. WiFi channel to enable responder on. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return info Instance of |RttResponderInfo|. + */ + getResponderInfo_1_6() generates (WifiStatus status, RttResponder info); + + /** + * Enable RTT responder mode. + * + * @param cmdId command Id to use for this invocation. + * @parm channelHint Hint of the channel information where RTT responder must + * be enabled on. + * @param maxDurationInSeconds Timeout of responder mode. + * @param info Instance of |RttResponderInfo|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + enableResponder_1_6(CommandId cmdId, WifiChannelInfo channelHint, + uint32_t maxDurationInSeconds, RttResponder info) generates (WifiStatus status); + + /** + * RTT capabilities of the device. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return capabilities Instance of |RttCapabilities|. + */ + getCapabilities_1_6() generates (WifiStatus status, RttCapabilities capabilities); +}; diff --git a/wifi/1.6/IWifiRttControllerEventCallback.hal b/wifi/1.6/IWifiRttControllerEventCallback.hal new file mode 100644 index 0000000000..0857b66038 --- /dev/null +++ b/wifi/1.6/IWifiRttControllerEventCallback.hal @@ -0,0 +1,33 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.4::IWifiRttControllerEventCallback; +import @1.0::CommandId; + +/** + * RTT Response and Event Callbacks. + */ +interface IWifiRttControllerEventCallback extends @1.4::IWifiRttControllerEventCallback { + /* + * Invoked when an RTT result is available. + * + * @param cmdId command Id corresponding to the original request. + * @param results Vector of |RttResult| instances. + */ + oneway onResults_1_6(CommandId cmdId, vec results); +}; diff --git a/wifi/1.6/IWifiStaIface.hal b/wifi/1.6/IWifiStaIface.hal new file mode 100644 index 0000000000..c26e1a0981 --- /dev/null +++ b/wifi/1.6/IWifiStaIface.hal @@ -0,0 +1,44 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.0::WifiStatus; +import @1.5::IWifiStaIface; + +/** + * Interface used to represent a single STA iface. + * + * IWifiChip.createStaIface() must return a @1.6::IWifiStaIface when supported. + */ +interface IWifiStaIface extends @1.5::IWifiStaIface { + /** + * Retrieve the latest link layer stats. + * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set or if + * link layer stats collection hasn't been explicitly enabled. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_STARTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return stats Instance of |LinkLayerStats|. + */ + getLinkLayerStats_1_6() generates (WifiStatus status, StaLinkLayerStats stats); +}; diff --git a/wifi/1.6/types.hal b/wifi/1.6/types.hal new file mode 100644 index 0000000000..f1d9d458ee --- /dev/null +++ b/wifi/1.6/types.hal @@ -0,0 +1,670 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.0::MacAddress; +import @1.0::NanDataPathConfirmInd; +import @1.0::Rssi; +import @1.0::RttBw; +import @1.0::RttPeerType; +import @1.0::RttStatus; +import @1.0::RttType; +import @1.0::StaLinkLayerIfaceStats; +import @1.0::StaLinkLayerRadioStats; +import @1.0::TimeSpanInPs; +import @1.0::TimeStampInUs; +import @1.0::TimeStampInMs; +import @1.0::WifiChannelInMhz; +import @1.0::WifiChannelWidthInMhz; +import @1.0::WifiInformationElement; +import @1.0::WifiRateNss; +import @1.4::RttPreamble; +import @1.4::WifiRatePreamble; +import @1.5::StaLinkLayerIfaceContentionTimeStats; +import @1.5::WifiIfaceMode; + +/** + * Channel operating width in Mhz. + */ +enum WifiChannelWidthInMhz : @1.0::WifiChannelWidthInMhz { + /** + * 320 MHz + */ + WIDTH_320 = 7, +}; + +/** + * RTT Measurement Bandwidth. + */ +enum RttBw : @1.0::RttBw { + BW_320MHZ = 0x40, +}; + +/** + * RTT Measurement Preamble. + */ +enum RttPreamble : @1.4::RttPreamble { + /** + * Preamble type for 11be + */ + EHT = 0x10, +}; + +/** + * Wifi Rate Preamble + */ +enum WifiRatePreamble : @1.4::WifiRatePreamble { + /** + * Preamble type for 11be + */ + EHT = 6, +}; + +/** + * Channel information. + */ +struct WifiChannelInfo { + /** + * Channel width (20, 40, 80, 80+80, 160, 320). + */ + WifiChannelWidthInMhz width; + /** + * Primary 20 MHz channel. + */ + WifiChannelInMhz centerFreq; + /** + * Center frequency (MHz) first segment. + */ + WifiChannelInMhz centerFreq0; + /** + * Center frequency (MHz) second segment. + */ + WifiChannelInMhz centerFreq1; +}; + +/** + * RTT configuration. + */ +struct RttConfig { + /** + * Peer device mac address. + */ + MacAddress addr; + + /** + * 1-sided or 2-sided RTT. + */ + RttType type; + + /** + * Optional - peer device hint (STA, P2P, AP). + */ + RttPeerType peer; + + /** + * Required for STA-AP mode, optional for P2P, NBD etc. + */ + WifiChannelInfo channel; + + /** + * 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). + */ + uint32_t burstPeriod; + + /** + * 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) + */ + uint32_t numBurst; + + /** + * 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. + */ + uint32_t numFramesPerBurst; + + /** + * Number of retries for a failed RTT frame. + * Applies to 1-sided RTT only. Minimum value = 0, Maximum value = 3 + */ + uint32_t numRetriesPerRttFrame; + + /** + * Following fields are only valid for 2-side RTT. + * + * + * Maximum number of retries that the initiator can + * retry an FTMR frame. + * Minimum value = 0, Maximum value = 3 + */ + uint32_t numRetriesPerFtmr; + + /** + * Whether to request location civic info or not. + */ + bool mustRequestLci; + + /** + * Whether to request location civic records or not. + */ + bool 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 + * 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. + */ + uint32_t burstDuration; + + /** + * RTT preamble to be used in the RTT frames. + */ + RttPreamble preamble; + + /** + * RTT BW to be used in the RTT frames. + */ + RttBw bw; +}; + +/** + * RTT Responder information + */ +struct RttResponder { + WifiChannelInfo channel; + + RttPreamble preamble; +}; + +struct WifiChannelStats { + /** + * Channel information. + */ + WifiChannelInfo channel; + /** + * Total time for which the radio is awake on this channel. + */ + uint32_t onTimeInMs; + /** + * Total time for which CCA is held busy on this channel. + */ + uint32_t ccaBusyTimeInMs; +}; + +struct StaLinkLayerRadioStats { + /** + * Baseline information as defined in HAL 1.0. + */ + @1.0::StaLinkLayerRadioStats V1_0; + + /** + * Total time for which the radio is awake due to NAN scan since boot or crash. + */ + uint32_t onTimeInMsForNanScan; + + /** + * Total time for which the radio is awake due to background scan since boot or crash. + */ + uint32_t onTimeInMsForBgScan; + + /** + * Total time for which the radio is awake due to roam scan since boot or crash. + */ + uint32_t onTimeInMsForRoamScan; + + /** + * Total time for which the radio is awake due to PNO scan since boot or crash. + */ + uint32_t onTimeInMsForPnoScan; + + /** + * Total time for which the radio is awake due to Hotspot 2.0 scans and GAS exchange since boot + * or crash. + */ + uint32_t onTimeInMsForHs20Scan; + + /** + * List of channel stats associated with this radio + */ + vec channelStats; + + /** + * Radio ID: An implementation specific value identifying the radio interface for which the + * stats are produced. Framework must not interpret this value. It must use this value for + * persistently identifying the statistics between calls, + * e.g. if the HAL provides them in different order. + */ + int32_t radioId; +}; + +/** + * Per peer statistics. The types of peer include the Access Point (AP), the Tunneled Direct Link + * Setup (TDLS), the Group Owner (GO), the Neighbor Awareness Networking (NAN), etc. + */ +struct StaPeerInfo { + /** + * Station count: The total number of stations currently associated with the peer. + */ + uint16_t staCount; + /** + * Channel utilization: The percentage of time (normalized to 255, i.e., x% corresponds to + * (int) x * 255 / 100) that the medium is sensed as busy measured by either physical or + * virtual carrier sense (CS) mechanism. + */ + uint16_t chanUtil; + /** + * Per rate statistics + */ + vec rateStats; +}; + +/** + * Iface statistics for the current connection. + */ +struct StaLinkLayerIfaceStats { + /** + * Baseline information as defined in HAL 1.0. + */ + @1.0::StaLinkLayerIfaceStats V1_0; + + /** + * Duty cycle for the iface. + * 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. + */ + uint8_t timeSliceDutyCycleInPercent; + + /** + * WME Best Effort (BE) Access Category (AC) contention time statistics. + */ + StaLinkLayerIfaceContentionTimeStats wmeBeContentionTimeStats; + + /** + * WME Background (BK) Access Category (AC) contention time statistics. + */ + StaLinkLayerIfaceContentionTimeStats wmeBkContentionTimeStats; + + /** + * WME Video (VI) Access Category (AC) contention time statistics. + */ + StaLinkLayerIfaceContentionTimeStats wmeViContentionTimeStats; + + /** + * WME Voice (VO) Access Category (AC) contention time statistics. + */ + StaLinkLayerIfaceContentionTimeStats wmeVoContentionTimeStats; + + /** + * Per peer statistics. + */ + vec peers; +}; + +/** + * Link layer stats retrieved via |getLinkLayerStats|. + */ +struct StaLinkLayerStats { + StaLinkLayerIfaceStats iface; + + vec radios; + + /** + * TimeStamp for each stats sample. + * This is the absolute milliseconds from boot when these stats were + * sampled. + */ + TimeStampInMs timeStampInMs; +}; + +/** + * Wifi rate info. + */ +struct WifiRateInfo { + /** + * Preamble used for RTT measurements. + */ + WifiRatePreamble preamble; + + /** + * Number of spatial streams. + */ + WifiRateNss nss; + + /** + * Bandwidth of channel. + */ + WifiChannelWidthInMhz bw; + + /** + * 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. + */ + uint8_t rateMcsIdx; + + /** + * Bitrate in units of 100 Kbps. + */ + uint32_t bitRateInKbps; +}; + +/** + * Per rate statistics. The rate is characterized by the combination of preamble, number of spatial + * streams, transmission bandwidth, and modulation and coding scheme (MCS). + */ +struct StaRateStat{ + /** + * Wifi rate information: preamble, number of spatial streams, bandwidth, MCS, etc. + */ + WifiRateInfo rateInfo; + /** + * Number of successfully transmitted data packets (ACK received) + */ + uint32_t txMpdu; + /** + * Number of received data packets + */ + uint32_t rxMpdu; + /** + * Number of data packet losses (no ACK) + */ + uint32_t mpduLost; + /** + * Number of data packet retries + */ + uint32_t retries; +}; + +/** + * RTT results. + */ +struct RttResult { + /** + * Peer device mac address. + */ + MacAddress addr; + + /** + * Burst number in a multi-burst request. + */ + uint32_t burstNum; + + /** + * Total RTT measurement frames attempted. + */ + uint32_t measurementNumber; + + /** + * Total successful RTT measurement frames. + */ + uint32_t successNumber; + + /** + * 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. + */ + uint8_t numberPerBurstPeer; + + /** + * Ranging status. + */ + RttStatus status; + + /** + * 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. + */ + uint8_t retryAfterDuration; + + /** + * RTT type. + */ + RttType type; + + /** + * Average rssi in 0.5 dB steps e.g. 143 implies -71.5 dB. + */ + Rssi rssi; + + /** + * Rssi spread in 0.5 dB steps e.g. 5 implies 2.5 dB spread (optional). + */ + Rssi rssiSpread; + + /** + * 1-sided RTT: TX rate of RTT frame. + * 2-sided RTT: TX rate of initiator's Ack in response to FTM frame. + */ + WifiRateInfo txRate; + + /** + * 1-sided RTT: TX rate of Ack from other side. + * 2-sided RTT: TX rate of FTM frame coming from responder. + */ + WifiRateInfo rxRate; + + /** + * Round trip time in picoseconds + */ + TimeSpanInPs rtt; + + /** + * Rtt standard deviation in picoseconds. + */ + TimeSpanInPs rttSd; + + /** + * Difference between max and min rtt times recorded in picoseconds. + */ + TimeSpanInPs rttSpread; + + /** + * Distance in mm (optional). + */ + int32_t distanceInMm; + + /** + * Standard deviation in mm (optional). + */ + int32_t distanceSdInMm; + + /** + * Difference between max and min distance recorded in mm (optional). + */ + int32_t distanceSpreadInMm; + + /** + * Time of the measurement (in microseconds since boot). + */ + TimeStampInUs timeStampInUs; + + /** + * in ms, actual time taken by the FW to finish one burst + * measurement. Applies to 1-sided and 2-sided RTT. + */ + uint32_t burstDurationInMs; + + /** + * Number of bursts allowed by the responder. Applies + * to 2-sided RTT only. + */ + uint32_t negotiatedBurstNum; + + /** + * for 11mc only. + */ + WifiInformationElement lci; + + /** + * for 11mc only. + */ + WifiInformationElement lcr; +}; + +/** + * NAN data path channel information provided to the framework. + */ +struct NanDataPathChannelInfo { + /** + * Channel frequency in MHz. + */ + WifiChannelInMhz channelFreq; + /** + * Channel bandwidth in MHz. + */ + WifiChannelWidthInMhz channelBandwidth; + /** + * Number of spatial streams used in the channel. + */ + uint32_t numSpatialStreams; +}; + +/** + * NAN Data path confirmation Indication structure. + * Event indication is received on both initiator and responder side when negotiation for a + * data-path finish: on success or failure. + */ +struct NanDataPathConfirmInd { + /** + * Baseline information as defined in HAL 1.0. + */ + @1.0::NanDataPathConfirmInd V1_0; + /** + * The channel(s) on which the NDP is scheduled to operate. + * Updates to the operational channels are provided using the |eventDataPathScheduleUpdate| + * event. + */ + vec channelInfo; +}; + +/** + * NAN data path channel information update indication structure. + * Event indication is received by all NDP owners whenever the channels on which the NDP operates + * are updated. + * Note: multiple NDPs may share the same schedule, the indication specifies all NDPs to which it + * applies. + */ +struct NanDataPathScheduleUpdateInd { + /** + * The discovery address (NMI) of the peer to which the NDP is connected. + */ + MacAddress peerDiscoveryAddress; + /** + * The updated channel(s) information. + */ + vec channelInfo; + /** + * The list of NDPs to which this update applies. + */ + vec ndpInstanceIds; +}; + +/** + * Wifi usable channel information. + */ +struct WifiUsableChannel { + /** + * Wifi channel freqeuncy in MHz. + */ + WifiChannelInMhz channel; + + /** + * Wifi channel bandwidth in MHz. + */ + WifiChannelWidthInMhz channelBandwidth; + + /** + * Iface modes feasible on this channel. + */ + bitfield ifaceModeMask; +}; + +/** + * RTT Capabilities. + */ +struct RttCapabilities { + /** + * if 1-sided rtt data collection is supported. + */ + bool rttOneSidedSupported; + + /** + * if ftm rtt data collection is supported. + */ + bool rttFtmSupported; + + /** + * if initiator supports LCI request. Applies to 2-sided RTT. + */ + bool lciSupported; + + /** + * if initiator supports LCR request. Applies to 2-sided RTT. + */ + bool lcrSupported; + + /** + * if 11mc responder mode is supported. + */ + bool responderSupported; + + /** + * Bit mask indicates what preamble is supported by initiator. + * Combination of |RttPreamble| values. + */ + bitfield preambleSupport; + + /** + * Bit mask indicates what BW is supported by initiator. + * Combination of |RttBw| values. + */ + bitfield bwSupport; + + /** + * Draft 11mc spec version supported by chip. + * For instance, version 4.0 must be 40 and version 4.3 must be 43 etc. + */ + uint8_t mcVersion; +}; -- GitLab From 05571e471884f21ca53052449c19e30cf22b62d8 Mon Sep 17 00:00:00 2001 From: Ahmed ElArabawy Date: Wed, 19 Jan 2022 11:54:11 -0800 Subject: [PATCH 485/825] Wifi: Add implementation for vendor HAL for 11be support This commit adds the implementation for the HAL API changes to enable 11be support. Bug: 198746544 Test: Build Succeeds Test: VTS test Change-Id: I2d1f296856698951c2c0111200e7c7bf661da132 --- wifi/1.6/default/hidl_struct_util.cpp | 143 ++++++++++-------- wifi/1.6/default/hidl_struct_util.h | 28 ++-- .../tests/hidl_struct_util_unit_tests.cpp | 41 +++-- .../default/tests/wifi_chip_unit_tests.cpp | 4 +- .../tests/wifi_nan_iface_unit_tests.cpp | 9 +- wifi/1.6/default/wifi_chip.cpp | 65 +++++--- wifi/1.6/default/wifi_chip.h | 25 ++- wifi/1.6/default/wifi_legacy_hal.h | 3 + wifi/1.6/default/wifi_nan_iface.cpp | 43 +++++- wifi/1.6/default/wifi_nan_iface.h | 13 +- wifi/1.6/default/wifi_rtt_controller.cpp | 102 ++++++++++--- wifi/1.6/default/wifi_rtt_controller.h | 39 +++-- wifi/1.6/default/wifi_sta_iface.cpp | 11 +- wifi/1.6/default/wifi_sta_iface.h | 6 +- 14 files changed, 363 insertions(+), 169 deletions(-) diff --git a/wifi/1.6/default/hidl_struct_util.cpp b/wifi/1.6/default/hidl_struct_util.cpp index 3489c9e4d3..2a6b13199b 100644 --- a/wifi/1.6/default/hidl_struct_util.cpp +++ b/wifi/1.6/default/hidl_struct_util.cpp @@ -438,7 +438,7 @@ uint32_t convertHidlUsableChannelFilterToLegacy(uint32_t hidl_filter_mask) { bool convertLegacyWifiUsableChannelToHidl( const legacy_hal::wifi_usable_channel& legacy_usable_channel, - V1_5::WifiUsableChannel* hidl_usable_channel) { + V1_6::WifiUsableChannel* hidl_usable_channel) { if (!hidl_usable_channel) { return false; } @@ -454,13 +454,13 @@ bool convertLegacyWifiUsableChannelToHidl( bool convertLegacyWifiUsableChannelsToHidl( const std::vector& legacy_usable_channels, - std::vector* hidl_usable_channels) { + std::vector* hidl_usable_channels) { if (!hidl_usable_channels) { return false; } *hidl_usable_channels = {}; for (const auto& legacy_usable_channel : legacy_usable_channels) { - V1_5::WifiUsableChannel hidl_usable_channel; + V1_6::WifiUsableChannel hidl_usable_channel; if (!convertLegacyWifiUsableChannelToHidl(legacy_usable_channel, &hidl_usable_channel)) { return false; } @@ -894,28 +894,28 @@ bool convertLegacyVectorOfDebugRxPacketFateToHidl( bool convertLegacyLinkLayerRadioStatsToHidl( const legacy_hal::LinkLayerRadioStats& legacy_radio_stat, - V1_5::StaLinkLayerRadioStats* hidl_radio_stat) { + V1_6::StaLinkLayerRadioStats* hidl_radio_stat) { if (!hidl_radio_stat) { return false; } *hidl_radio_stat = {}; hidl_radio_stat->radioId = legacy_radio_stat.stats.radio; - hidl_radio_stat->V1_3.V1_0.onTimeInMs = legacy_radio_stat.stats.on_time; - hidl_radio_stat->V1_3.V1_0.txTimeInMs = legacy_radio_stat.stats.tx_time; - hidl_radio_stat->V1_3.V1_0.rxTimeInMs = legacy_radio_stat.stats.rx_time; - hidl_radio_stat->V1_3.V1_0.onTimeInMsForScan = legacy_radio_stat.stats.on_time_scan; - hidl_radio_stat->V1_3.V1_0.txTimeInMsPerLevel = legacy_radio_stat.tx_time_per_levels; - hidl_radio_stat->V1_3.onTimeInMsForNanScan = legacy_radio_stat.stats.on_time_nbd; - hidl_radio_stat->V1_3.onTimeInMsForBgScan = legacy_radio_stat.stats.on_time_gscan; - hidl_radio_stat->V1_3.onTimeInMsForRoamScan = legacy_radio_stat.stats.on_time_roam_scan; - hidl_radio_stat->V1_3.onTimeInMsForPnoScan = legacy_radio_stat.stats.on_time_pno_scan; - hidl_radio_stat->V1_3.onTimeInMsForHs20Scan = legacy_radio_stat.stats.on_time_hs20; - - std::vector hidl_channel_stats; + hidl_radio_stat->V1_0.onTimeInMs = legacy_radio_stat.stats.on_time; + hidl_radio_stat->V1_0.txTimeInMs = legacy_radio_stat.stats.tx_time; + hidl_radio_stat->V1_0.rxTimeInMs = legacy_radio_stat.stats.rx_time; + hidl_radio_stat->V1_0.onTimeInMsForScan = legacy_radio_stat.stats.on_time_scan; + hidl_radio_stat->V1_0.txTimeInMsPerLevel = legacy_radio_stat.tx_time_per_levels; + hidl_radio_stat->onTimeInMsForNanScan = legacy_radio_stat.stats.on_time_nbd; + hidl_radio_stat->onTimeInMsForBgScan = legacy_radio_stat.stats.on_time_gscan; + hidl_radio_stat->onTimeInMsForRoamScan = legacy_radio_stat.stats.on_time_roam_scan; + hidl_radio_stat->onTimeInMsForPnoScan = legacy_radio_stat.stats.on_time_pno_scan; + hidl_radio_stat->onTimeInMsForHs20Scan = legacy_radio_stat.stats.on_time_hs20; + + std::vector hidl_channel_stats; for (const auto& channel_stat : legacy_radio_stat.channel_stats) { - V1_3::WifiChannelStats hidl_channel_stat; + V1_6::WifiChannelStats hidl_channel_stat; hidl_channel_stat.onTimeInMs = channel_stat.on_time; hidl_channel_stat.ccaBusyTimeInMs = channel_stat.cca_busy_time; /* @@ -929,13 +929,13 @@ bool convertLegacyLinkLayerRadioStatsToHidl( hidl_channel_stats.push_back(hidl_channel_stat); } - hidl_radio_stat->V1_3.channelStats = hidl_channel_stats; + hidl_radio_stat->channelStats = hidl_channel_stats; return true; } bool convertLegacyLinkLayerStatsToHidl(const legacy_hal::LinkLayerStats& legacy_stats, - V1_5::StaLinkLayerStats* hidl_stats) { + V1_6::StaLinkLayerStats* hidl_stats) { if (!hidl_stats) { return false; } @@ -1010,9 +1010,9 @@ bool convertLegacyLinkLayerStatsToHidl(const legacy_hal::LinkLayerStats& legacy_ hidl_stats->iface.timeSliceDutyCycleInPercent = legacy_stats.iface.info.time_slicing_duty_cycle_percent; // peer info legacy_stats conversion. - std::vector hidl_peers_info_stats; + std::vector hidl_peers_info_stats; for (const auto& legacy_peer_info_stats : legacy_stats.peers) { - V1_5::StaPeerInfo hidl_peer_info_stats; + V1_6::StaPeerInfo hidl_peer_info_stats; if (!convertLegacyPeerInfoStatsToHidl(legacy_peer_info_stats, &hidl_peer_info_stats)) { return false; } @@ -1020,9 +1020,9 @@ bool convertLegacyLinkLayerStatsToHidl(const legacy_hal::LinkLayerStats& legacy_ } hidl_stats->iface.peers = hidl_peers_info_stats; // radio legacy_stats conversion. - std::vector hidl_radios_stats; + std::vector hidl_radios_stats; for (const auto& legacy_radio_stats : legacy_stats.radios) { - V1_5::StaLinkLayerRadioStats hidl_radio_stats; + V1_6::StaLinkLayerRadioStats hidl_radio_stats; if (!convertLegacyLinkLayerRadioStatsToHidl(legacy_radio_stats, &hidl_radio_stats)) { return false; } @@ -1036,7 +1036,7 @@ bool convertLegacyLinkLayerStatsToHidl(const legacy_hal::LinkLayerStats& legacy_ } bool convertLegacyPeerInfoStatsToHidl(const legacy_hal::WifiPeerInfo& legacy_peer_info_stats, - V1_5::StaPeerInfo* hidl_peer_info_stats) { + V1_6::StaPeerInfo* hidl_peer_info_stats) { if (!hidl_peer_info_stats) { return false; } @@ -1044,9 +1044,9 @@ bool convertLegacyPeerInfoStatsToHidl(const legacy_hal::WifiPeerInfo& legacy_pee hidl_peer_info_stats->staCount = legacy_peer_info_stats.peer_info.bssload.sta_count; hidl_peer_info_stats->chanUtil = legacy_peer_info_stats.peer_info.bssload.chan_util; - std::vector hidlRateStats; + std::vector hidlRateStats; for (const auto& legacy_rate_stats : legacy_peer_info_stats.rate_stats) { - V1_5::StaRateStat rateStat; + V1_6::StaRateStat rateStat; if (!convertLegacyWifiRateInfoToHidl(legacy_rate_stats.rate, &rateStat.rateInfo)) { return false; } @@ -2134,7 +2134,7 @@ bool convertLegacyNanDataPathRequestIndToHidl(const legacy_hal::NanDataPathReque } bool convertLegacyNdpChannelInfoToHidl(const legacy_hal::NanChannelInfo& legacy_struct, - V1_2::NanDataPathChannelInfo* hidl_struct) { + V1_6::NanDataPathChannelInfo* hidl_struct) { if (!hidl_struct) { LOG(ERROR) << "convertLegacyNdpChannelInfoToHidl: hidl_struct is null"; return false; @@ -2150,7 +2150,7 @@ bool convertLegacyNdpChannelInfoToHidl(const legacy_hal::NanChannelInfo& legacy_ } bool convertLegacyNanDataPathConfirmIndToHidl(const legacy_hal::NanDataPathConfirmInd& legacy_ind, - V1_2::NanDataPathConfirmInd* hidl_ind) { + V1_6::NanDataPathConfirmInd* hidl_ind) { if (!hidl_ind) { LOG(ERROR) << "convertLegacyNanDataPathConfirmIndToHidl: hidl_ind is null"; return false; @@ -2166,9 +2166,9 @@ bool convertLegacyNanDataPathConfirmIndToHidl(const legacy_hal::NanDataPathConfi hidl_ind->V1_0.status.status = convertLegacyNanStatusTypeToHidl(legacy_ind.reason_code); hidl_ind->V1_0.status.description = ""; // TODO: b/34059183 - std::vector channelInfo; + std::vector channelInfo; for (unsigned int i = 0; i < legacy_ind.num_channels; ++i) { - V1_2::NanDataPathChannelInfo hidl_struct; + V1_6::NanDataPathChannelInfo hidl_struct; if (!convertLegacyNdpChannelInfoToHidl(legacy_ind.channel_info[i], &hidl_struct)) { return false; } @@ -2181,7 +2181,7 @@ bool convertLegacyNanDataPathConfirmIndToHidl(const legacy_hal::NanDataPathConfi bool convertLegacyNanDataPathScheduleUpdateIndToHidl( const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind, - V1_2::NanDataPathScheduleUpdateInd* hidl_ind) { + V1_6::NanDataPathScheduleUpdateInd* hidl_ind) { if (!hidl_ind) { LOG(ERROR) << "convertLegacyNanDataPathScheduleUpdateIndToHidl: " "hidl_ind is null"; @@ -2190,9 +2190,9 @@ bool convertLegacyNanDataPathScheduleUpdateIndToHidl( *hidl_ind = {}; hidl_ind->peerDiscoveryAddress = hidl_array(legacy_ind.peer_mac_addr); - std::vector channelInfo; + std::vector channelInfo; for (unsigned int i = 0; i < legacy_ind.num_channels; ++i) { - V1_2::NanDataPathChannelInfo hidl_struct; + V1_6::NanDataPathChannelInfo hidl_struct; if (!convertLegacyNdpChannelInfoToHidl(legacy_ind.channel_info[i], &hidl_struct)) { return false; } @@ -2260,13 +2260,16 @@ legacy_hal::wifi_channel_width convertHidlWifiChannelWidthToLegacy(WifiChannelWi return legacy_hal::WIFI_CHAN_WIDTH_5; case WifiChannelWidthInMhz::WIDTH_10: return legacy_hal::WIFI_CHAN_WIDTH_10; + case V1_6::WifiChannelWidthInMhz::WIDTH_320: + return legacy_hal::WIFI_CHAN_WIDTH_320; case WifiChannelWidthInMhz::WIDTH_INVALID: return legacy_hal::WIFI_CHAN_WIDTH_INVALID; }; CHECK(false); } -WifiChannelWidthInMhz convertLegacyWifiChannelWidthToHidl(legacy_hal::wifi_channel_width type) { +V1_6::WifiChannelWidthInMhz convertLegacyWifiChannelWidthToHidl( + legacy_hal::wifi_channel_width type) { switch (type) { case legacy_hal::WIFI_CHAN_WIDTH_20: return WifiChannelWidthInMhz::WIDTH_20; @@ -2282,35 +2285,41 @@ WifiChannelWidthInMhz convertLegacyWifiChannelWidthToHidl(legacy_hal::wifi_chann return WifiChannelWidthInMhz::WIDTH_5; case legacy_hal::WIFI_CHAN_WIDTH_10: return WifiChannelWidthInMhz::WIDTH_10; + case legacy_hal::WIFI_CHAN_WIDTH_320: + return V1_6::WifiChannelWidthInMhz::WIDTH_320; default: return WifiChannelWidthInMhz::WIDTH_INVALID; }; } -legacy_hal::wifi_rtt_preamble convertHidlRttPreambleToLegacy(V1_4::RttPreamble type) { +legacy_hal::wifi_rtt_preamble convertHidlRttPreambleToLegacy(V1_6::RttPreamble type) { switch (type) { - case V1_4::RttPreamble::LEGACY: + case V1_6::RttPreamble::LEGACY: return legacy_hal::WIFI_RTT_PREAMBLE_LEGACY; - case V1_4::RttPreamble::HT: + case V1_6::RttPreamble::HT: return legacy_hal::WIFI_RTT_PREAMBLE_HT; - case V1_4::RttPreamble::VHT: + case V1_6::RttPreamble::VHT: return legacy_hal::WIFI_RTT_PREAMBLE_VHT; - case V1_4::RttPreamble::HE: + case V1_6::RttPreamble::HE: return legacy_hal::WIFI_RTT_PREAMBLE_HE; + case V1_6::RttPreamble::EHT: + return legacy_hal::WIFI_RTT_PREAMBLE_EHT; }; CHECK(false); } -V1_4::RttPreamble convertLegacyRttPreambleToHidl(legacy_hal::wifi_rtt_preamble type) { +V1_6::RttPreamble convertLegacyRttPreambleToHidl(legacy_hal::wifi_rtt_preamble type) { switch (type) { case legacy_hal::WIFI_RTT_PREAMBLE_LEGACY: - return V1_4::RttPreamble::LEGACY; + return V1_6::RttPreamble::LEGACY; case legacy_hal::WIFI_RTT_PREAMBLE_HT: - return V1_4::RttPreamble::HT; + return V1_6::RttPreamble::HT; case legacy_hal::WIFI_RTT_PREAMBLE_VHT: - return V1_4::RttPreamble::VHT; + return V1_6::RttPreamble::VHT; case legacy_hal::WIFI_RTT_PREAMBLE_HE: - return V1_4::RttPreamble::HE; + return V1_6::RttPreamble::HE; + case legacy_hal::WIFI_RTT_PREAMBLE_EHT: + return V1_6::RttPreamble::EHT; }; CHECK(false) << "Unknown legacy type: " << type; } @@ -2329,6 +2338,8 @@ legacy_hal::wifi_rtt_bw convertHidlRttBwToLegacy(RttBw type) { return legacy_hal::WIFI_RTT_BW_80; case RttBw::BW_160MHZ: return legacy_hal::WIFI_RTT_BW_160; + case RttBw::BW_320MHZ: + return legacy_hal::WIFI_RTT_BW_320; }; CHECK(false); } @@ -2347,6 +2358,8 @@ RttBw convertLegacyRttBwToHidl(legacy_hal::wifi_rtt_bw type) { return RttBw::BW_80MHZ; case legacy_hal::WIFI_RTT_BW_160: return RttBw::BW_160MHZ; + case legacy_hal::WIFI_RTT_BW_320: + return RttBw::BW_320MHZ; }; CHECK(false) << "Unknown legacy type: " << type; } @@ -2363,20 +2376,22 @@ legacy_hal::wifi_motion_pattern convertHidlRttMotionPatternToLegacy(RttMotionPat CHECK(false); } -V1_4::WifiRatePreamble convertLegacyWifiRatePreambleToHidl(uint8_t preamble) { +V1_6::WifiRatePreamble convertLegacyWifiRatePreambleToHidl(uint8_t preamble) { switch (preamble) { case 0: - return V1_4::WifiRatePreamble::OFDM; + return V1_6::WifiRatePreamble::OFDM; case 1: - return V1_4::WifiRatePreamble::CCK; + return V1_6::WifiRatePreamble::CCK; case 2: - return V1_4::WifiRatePreamble::HT; + return V1_6::WifiRatePreamble::HT; case 3: - return V1_4::WifiRatePreamble::VHT; + return V1_6::WifiRatePreamble::VHT; case 4: - return V1_4::WifiRatePreamble::HE; + return V1_6::WifiRatePreamble::HE; + case 5: + return V1_6::WifiRatePreamble::EHT; default: - return V1_4::WifiRatePreamble::RESERVED; + return V1_6::WifiRatePreamble::RESERVED; }; CHECK(false) << "Unknown legacy preamble: " << preamble; } @@ -2464,7 +2479,7 @@ bool convertLegacyWifiChannelInfoToHidl(const legacy_hal::wifi_channel_info& leg return true; } -bool convertHidlRttConfigToLegacy(const V1_4::RttConfig& hidl_config, +bool convertHidlRttConfigToLegacy(const V1_6::RttConfig& hidl_config, legacy_hal::wifi_rtt_config* legacy_config) { if (!legacy_config) { return false; @@ -2491,7 +2506,7 @@ bool convertHidlRttConfigToLegacy(const V1_4::RttConfig& hidl_config, } bool convertHidlVectorOfRttConfigToLegacy( - const std::vector& hidl_configs, + const std::vector& hidl_configs, std::vector* legacy_configs) { if (!legacy_configs) { return false; @@ -2542,7 +2557,7 @@ bool convertHidlRttLcrInformationToLegacy(const RttLcrInformation& hidl_info, return true; } -bool convertHidlRttResponderToLegacy(const V1_4::RttResponder& hidl_responder, +bool convertHidlRttResponderToLegacy(const V1_6::RttResponder& hidl_responder, legacy_hal::wifi_rtt_responder* legacy_responder) { if (!legacy_responder) { return false; @@ -2556,7 +2571,7 @@ bool convertHidlRttResponderToLegacy(const V1_4::RttResponder& hidl_responder, } bool convertLegacyRttResponderToHidl(const legacy_hal::wifi_rtt_responder& legacy_responder, - V1_4::RttResponder* hidl_responder) { + V1_6::RttResponder* hidl_responder) { if (!hidl_responder) { return false; } @@ -2570,7 +2585,7 @@ bool convertLegacyRttResponderToHidl(const legacy_hal::wifi_rtt_responder& legac bool convertLegacyRttCapabilitiesToHidl( const legacy_hal::wifi_rtt_capabilities& legacy_capabilities, - V1_4::RttCapabilities* hidl_capabilities) { + V1_6::RttCapabilities* hidl_capabilities) { if (!hidl_capabilities) { return false; } @@ -2582,17 +2597,19 @@ bool convertLegacyRttCapabilitiesToHidl( hidl_capabilities->responderSupported = legacy_capabilities.responder_supported; hidl_capabilities->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_VHT, legacy_hal::WIFI_RTT_PREAMBLE_HE, + legacy_hal::WIFI_RTT_PREAMBLE_EHT}) { if (legacy_capabilities.preamble_support & flag) { hidl_capabilities->preambleSupport |= - static_cast::type>( + static_cast::type>( convertLegacyRttPreambleToHidl(flag)); } } hidl_capabilities->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_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) { hidl_capabilities->bwSupport |= static_cast::type>(convertLegacyRttBwToHidl(flag)); @@ -2603,7 +2620,7 @@ bool convertLegacyRttCapabilitiesToHidl( } bool convertLegacyWifiRateInfoToHidl(const legacy_hal::wifi_rate& legacy_rate, - V1_4::WifiRateInfo* hidl_rate) { + V1_6::WifiRateInfo* hidl_rate) { if (!hidl_rate) { return false; } @@ -2618,7 +2635,7 @@ bool convertLegacyWifiRateInfoToHidl(const legacy_hal::wifi_rate& legacy_rate, } bool convertLegacyRttResultToHidl(const legacy_hal::wifi_rtt_result& legacy_result, - V1_4::RttResult* hidl_result) { + V1_6::RttResult* hidl_result) { if (!hidl_result) { return false; } @@ -2660,13 +2677,13 @@ bool convertLegacyRttResultToHidl(const legacy_hal::wifi_rtt_result& legacy_resu bool convertLegacyVectorOfRttResultToHidl( const std::vector& legacy_results, - std::vector* hidl_results) { + std::vector* hidl_results) { if (!hidl_results) { return false; } *hidl_results = {}; for (const auto legacy_result : legacy_results) { - V1_4::RttResult hidl_result; + V1_6::RttResult hidl_result; if (!convertLegacyRttResultToHidl(*legacy_result, &hidl_result)) { return false; } diff --git a/wifi/1.6/default/hidl_struct_util.h b/wifi/1.6/default/hidl_struct_util.h index 15a3205847..7f0266a478 100644 --- a/wifi/1.6/default/hidl_struct_util.h +++ b/wifi/1.6/default/hidl_struct_util.h @@ -25,8 +25,8 @@ #include #include #include -#include -#include +#include +#include #include "wifi_legacy_hal.h" @@ -95,7 +95,7 @@ bool convertLegacyVectorOfCachedGscanResultsToHidl( const std::vector& legacy_cached_scan_results, std::vector* hidl_scan_datas); bool convertLegacyLinkLayerStatsToHidl(const legacy_hal::LinkLayerStats& legacy_stats, - V1_5::StaLinkLayerStats* hidl_stats); + V1_6::StaLinkLayerStats* hidl_stats); bool convertLegacyRoamingCapabilitiesToHidl( const legacy_hal::wifi_roaming_capabilities& legacy_caps, StaRoamingCapabilities* hidl_caps); @@ -156,40 +156,40 @@ bool convertLegacyNanFollowupIndToHidl(const legacy_hal::NanFollowupInd& legacy_ bool convertLegacyNanDataPathRequestIndToHidl(const legacy_hal::NanDataPathRequestInd& legacy_ind, NanDataPathRequestInd* hidl_ind); bool convertLegacyNanDataPathConfirmIndToHidl(const legacy_hal::NanDataPathConfirmInd& legacy_ind, - V1_2::NanDataPathConfirmInd* hidl_ind); + V1_6::NanDataPathConfirmInd* hidl_ind); bool convertLegacyNanDataPathScheduleUpdateIndToHidl( const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind, - V1_2::NanDataPathScheduleUpdateInd* hidl_ind); + V1_6::NanDataPathScheduleUpdateInd* hidl_ind); // RTT controller conversion methods. -bool convertHidlVectorOfRttConfigToLegacy(const std::vector& hidl_configs, +bool convertHidlVectorOfRttConfigToLegacy(const std::vector& hidl_configs, std::vector* legacy_configs); bool convertHidlRttLciInformationToLegacy(const RttLciInformation& hidl_info, legacy_hal::wifi_lci_information* legacy_info); bool convertHidlRttLcrInformationToLegacy(const RttLcrInformation& hidl_info, legacy_hal::wifi_lcr_information* legacy_info); -bool convertHidlRttResponderToLegacy(const V1_4::RttResponder& hidl_responder, +bool convertHidlRttResponderToLegacy(const V1_6::RttResponder& hidl_responder, legacy_hal::wifi_rtt_responder* legacy_responder); -bool convertHidlWifiChannelInfoToLegacy(const WifiChannelInfo& hidl_info, +bool convertHidlWifiChannelInfoToLegacy(const V1_6::WifiChannelInfo& hidl_info, legacy_hal::wifi_channel_info* legacy_info); bool convertLegacyRttResponderToHidl(const legacy_hal::wifi_rtt_responder& legacy_responder, - V1_4::RttResponder* hidl_responder); + V1_6::RttResponder* hidl_responder); bool convertLegacyRttCapabilitiesToHidl( const legacy_hal::wifi_rtt_capabilities& legacy_capabilities, - V1_4::RttCapabilities* hidl_capabilities); + V1_6::RttCapabilities* hidl_capabilities); bool convertLegacyVectorOfRttResultToHidl( const std::vector& legacy_results, - std::vector* hidl_results); + std::vector* hidl_results); uint32_t convertHidlWifiBandToLegacyMacBand(V1_5::WifiBand band); uint32_t convertHidlWifiIfaceModeToLegacy(uint32_t hidl_iface_mask); uint32_t convertHidlUsableChannelFilterToLegacy(uint32_t hidl_filter_mask); bool convertLegacyWifiUsableChannelsToHidl( const std::vector& legacy_usable_channels, - std::vector* hidl_usable_channels); + std::vector* hidl_usable_channels); bool convertLegacyPeerInfoStatsToHidl(const legacy_hal::WifiPeerInfo& legacy_peer_info_stats, - V1_5::StaPeerInfo* hidl_peer_info_stats); + V1_6::StaPeerInfo* hidl_peer_info_stats); bool convertLegacyWifiRateInfoToHidl(const legacy_hal::wifi_rate& legacy_rate, - V1_4::WifiRateInfo* hidl_rate); + V1_6::WifiRateInfo* hidl_rate); } // namespace hidl_struct_util } // namespace implementation } // namespace V1_6 diff --git a/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp b/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp index 1182a58dbd..077c6cc8cd 100644 --- a/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp +++ b/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp @@ -37,7 +37,7 @@ namespace wifi { namespace V1_6 { namespace implementation { using namespace android::hardware::wifi::V1_0; -using ::android::hardware::wifi::V1_0::WifiChannelWidthInMhz; +using ::android::hardware::wifi::V1_6::WifiChannelWidthInMhz; class HidlStructUtilTest : public Test {}; @@ -216,7 +216,7 @@ TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { peer.rate_stats.push_back(rate_stat2); } - V1_5::StaLinkLayerStats converted{}; + V1_6::StaLinkLayerStats converted{}; hidl_struct_util::convertLegacyLinkLayerStatsToHidl(legacy_stats, &converted); EXPECT_EQ(legacy_stats.iface.beacon_rx, converted.iface.V1_0.beaconRx); EXPECT_EQ(legacy_stats.iface.rssi_mgmt, converted.iface.V1_0.avgRssiMgmt); @@ -294,43 +294,42 @@ TEST_F(HidlStructUtilTest, canConvertLegacyLinkLayerStatsToHidl) { EXPECT_EQ(legacy_stats.radios.size(), converted.radios.size()); for (size_t i = 0; i < legacy_stats.radios.size(); i++) { EXPECT_EQ(legacy_stats.radios[i].stats.radio, converted.radios[i].radioId); - EXPECT_EQ(legacy_stats.radios[i].stats.on_time, converted.radios[i].V1_3.V1_0.onTimeInMs); - EXPECT_EQ(legacy_stats.radios[i].stats.tx_time, converted.radios[i].V1_3.V1_0.txTimeInMs); - EXPECT_EQ(legacy_stats.radios[i].stats.rx_time, converted.radios[i].V1_3.V1_0.rxTimeInMs); + EXPECT_EQ(legacy_stats.radios[i].stats.on_time, converted.radios[i].V1_0.onTimeInMs); + EXPECT_EQ(legacy_stats.radios[i].stats.tx_time, converted.radios[i].V1_0.txTimeInMs); + EXPECT_EQ(legacy_stats.radios[i].stats.rx_time, converted.radios[i].V1_0.rxTimeInMs); EXPECT_EQ(legacy_stats.radios[i].stats.on_time_scan, - converted.radios[i].V1_3.V1_0.onTimeInMsForScan); + converted.radios[i].V1_0.onTimeInMsForScan); EXPECT_EQ(legacy_stats.radios[i].tx_time_per_levels.size(), - converted.radios[i].V1_3.V1_0.txTimeInMsPerLevel.size()); + converted.radios[i].V1_0.txTimeInMsPerLevel.size()); for (size_t j = 0; j < legacy_stats.radios[i].tx_time_per_levels.size(); j++) { EXPECT_EQ(legacy_stats.radios[i].tx_time_per_levels[j], - converted.radios[i].V1_3.V1_0.txTimeInMsPerLevel[j]); + converted.radios[i].V1_0.txTimeInMsPerLevel[j]); } EXPECT_EQ(legacy_stats.radios[i].stats.on_time_nbd, - converted.radios[i].V1_3.onTimeInMsForNanScan); + converted.radios[i].onTimeInMsForNanScan); EXPECT_EQ(legacy_stats.radios[i].stats.on_time_gscan, - converted.radios[i].V1_3.onTimeInMsForBgScan); + converted.radios[i].onTimeInMsForBgScan); EXPECT_EQ(legacy_stats.radios[i].stats.on_time_roam_scan, - converted.radios[i].V1_3.onTimeInMsForRoamScan); + converted.radios[i].onTimeInMsForRoamScan); EXPECT_EQ(legacy_stats.radios[i].stats.on_time_pno_scan, - converted.radios[i].V1_3.onTimeInMsForPnoScan); + converted.radios[i].onTimeInMsForPnoScan); EXPECT_EQ(legacy_stats.radios[i].stats.on_time_hs20, - converted.radios[i].V1_3.onTimeInMsForHs20Scan); + converted.radios[i].onTimeInMsForHs20Scan); EXPECT_EQ(legacy_stats.radios[i].channel_stats.size(), - converted.radios[i].V1_3.channelStats.size()); + converted.radios[i].channelStats.size()); for (size_t k = 0; k < legacy_stats.radios[i].channel_stats.size(); k++) { auto& legacy_channel_st = legacy_stats.radios[i].channel_stats[k]; EXPECT_EQ(WifiChannelWidthInMhz::WIDTH_20, - converted.radios[i].V1_3.channelStats[k].channel.width); + converted.radios[i].channelStats[k].channel.width); EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq), - converted.radios[i].V1_3.channelStats[k].channel.centerFreq); + converted.radios[i].channelStats[k].channel.centerFreq); EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq0), - converted.radios[i].V1_3.channelStats[k].channel.centerFreq0); + converted.radios[i].channelStats[k].channel.centerFreq0); EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq1), - converted.radios[i].V1_3.channelStats[k].channel.centerFreq1); + converted.radios[i].channelStats[k].channel.centerFreq1); EXPECT_EQ(legacy_channel_st.cca_busy_time, - converted.radios[i].V1_3.channelStats[k].ccaBusyTimeInMs); - EXPECT_EQ(legacy_channel_st.on_time, - converted.radios[i].V1_3.channelStats[k].onTimeInMs); + converted.radios[i].channelStats[k].ccaBusyTimeInMs); + EXPECT_EQ(legacy_channel_st.on_time, converted.radios[i].channelStats[k].onTimeInMs); } } diff --git a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp index 53904116cf..542b180482 100644 --- a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp +++ b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp @@ -238,7 +238,7 @@ class WifiChipTest : public Test { bool createRttController() { bool success = false; - chip_->createRttController_1_4( + chip_->createRttController_1_6( NULL, [&success](const WifiStatus& status, const sp& rtt) { if (WifiStatusCode::SUCCESS == status.code) { ASSERT_NE(rtt.get(), nullptr); @@ -716,7 +716,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveRttControllerOnS // Create RTT controller sp rtt_controller; - chip_->createRttController_1_4( + chip_->createRttController_1_6( NULL, [&rtt_controller](const WifiStatus& status, const sp& rtt) { if (WifiStatusCode::SUCCESS == status.code) { ASSERT_NE(rtt.get(), nullptr); diff --git a/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp b/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp index c7c566bec1..13b2849209 100644 --- a/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp +++ b/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp @@ -85,8 +85,13 @@ class MockNanIfaceEventCallback : public V1_5::IWifiNanIfaceEventCallback { MOCK_METHOD1(eventDataPathConfirm, Return(const android::hardware::wifi::V1_0::NanDataPathConfirmInd&)); MOCK_METHOD1(eventDataPathTerminated, Return(uint32_t)); - MOCK_METHOD1(eventDataPathConfirm_1_2, Return(const NanDataPathConfirmInd&)); - MOCK_METHOD1(eventDataPathScheduleUpdate, Return(const NanDataPathScheduleUpdateInd&)); + MOCK_METHOD1(eventDataPathConfirm_1_2, + Return(const android::hardware::wifi::V1_2::NanDataPathConfirmInd&)); + MOCK_METHOD1(eventDataPathConfirm_1_6, Return(const NanDataPathConfirmInd&)); + MOCK_METHOD1(eventDataPathScheduleUpdate, + Return(const android::hardware::wifi::V1_2::NanDataPathScheduleUpdateInd&)); + MOCK_METHOD1(eventDataPathScheduleUpdate_1_6, + Return(const NanDataPathScheduleUpdateInd&)); MOCK_METHOD3(notifyCapabilitiesResponse_1_5, Return(uint16_t, const WifiNanStatus&, const V1_5::NanCapabilities&)); }; diff --git a/wifi/1.6/default/wifi_chip.cpp b/wifi/1.6/default/wifi_chip.cpp index c1ce766a4f..11512f46e0 100644 --- a/wifi/1.6/default/wifi_chip.cpp +++ b/wifi/1.6/default/wifi_chip.cpp @@ -707,6 +707,21 @@ Return WifiChip::triggerSubsystemRestart(triggerSubsystemRestart_cb hidl_s &WifiChip::triggerSubsystemRestartInternal, hidl_status_cb); } +Return WifiChip::createRttController_1_6(const sp& bound_iface, + createRttController_1_6_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::createRttControllerInternal_1_6, hidl_status_cb, bound_iface); +} + +Return WifiChip::getUsableChannels_1_6( + WifiBand band, hidl_bitfield ifaceModeMask, + hidl_bitfield filterMask, + getUsableChannels_1_6_cb _hidl_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getUsableChannelsInternal_1_6, _hidl_cb, band, ifaceModeMask, + filterMask); +} + void WifiChip::invalidateAndRemoveAllIfaces() { invalidateAndClearBridgedApAll(); invalidateAndClearAll(ap_ifaces_); @@ -1114,7 +1129,7 @@ WifiStatus WifiChip::removeP2pIfaceInternal(const std::string& ifname) { return createWifiStatus(WifiStatusCode::SUCCESS); } -std::pair> WifiChip::createStaIfaceInternal() { +std::pair> WifiChip::createStaIfaceInternal() { if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::STA)) { return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } @@ -1144,7 +1159,7 @@ std::pair> WifiChip::getStaIfaceNamesIntern return {createWifiStatus(WifiStatusCode::SUCCESS), getNames(sta_ifaces_)}; } -std::pair> WifiChip::getStaIfaceInternal( +std::pair> WifiChip::getStaIfaceInternal( const std::string& ifname) { const auto iface = findUsingName(sta_ifaces_, ifname); if (!iface.get()) { @@ -1351,16 +1366,9 @@ std::pair WifiChip::getCapabilitiesInternal_1_5() { } std::pair> WifiChip::createRttControllerInternal_1_4( - const sp& bound_iface) { - if (sta_ifaces_.size() == 0 && !canCurrentModeSupportIfaceOfType(IfaceType::STA)) { - LOG(ERROR) << "createRttControllerInternal_1_4: Chip cannot support STAs " - "(and RTT by extension)"; - return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; - } - sp rtt = - new WifiRttController(getFirstActiveWlanIfaceName(), bound_iface, legacy_hal_); - rtt_controllers_.emplace_back(rtt); - return {createWifiStatus(WifiStatusCode::SUCCESS), rtt}; + const sp& /*bound_iface*/) { + LOG(ERROR) << "createRttController_1_4 is not supported on this HAL"; + return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; } WifiStatus WifiChip::registerEventCallbackInternal_1_4( @@ -1409,7 +1417,31 @@ WifiStatus WifiChip::setCountryCodeInternal(const std::array& code) { return createWifiStatusFromLegacyError(legacy_status); } -std::pair> WifiChip::getUsableChannelsInternal( +std::pair> WifiChip::getUsableChannelsInternal( + WifiBand /*band*/, uint32_t /*ifaceModeMask*/, uint32_t /*filterMask*/) { + LOG(ERROR) << "getUsableChannels is not supported on this HAL"; + return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; +} + +WifiStatus WifiChip::triggerSubsystemRestartInternal() { + auto legacy_status = legacy_hal_.lock()->triggerSubsystemRestart(); + return createWifiStatusFromLegacyError(legacy_status); +} + +std::pair> WifiChip::createRttControllerInternal_1_6( + const sp& bound_iface) { + if (sta_ifaces_.size() == 0 && !canCurrentModeSupportIfaceOfType(IfaceType::STA)) { + LOG(ERROR) << "createRttControllerInternal_1_6: Chip cannot support STAs " + "(and RTT by extension)"; + return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; + } + sp rtt = + new WifiRttController(getFirstActiveWlanIfaceName(), bound_iface, legacy_hal_); + rtt_controllers_.emplace_back(rtt); + return {createWifiStatus(WifiStatusCode::SUCCESS), rtt}; +} + +std::pair> WifiChip::getUsableChannelsInternal_1_6( WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask) { legacy_hal::wifi_error legacy_status; std::vector legacy_usable_channels; @@ -1421,7 +1453,7 @@ std::pair> WifiChip::getUsableChannel if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {createWifiStatusFromLegacyError(legacy_status), {}}; } - std::vector hidl_usable_channels; + std::vector hidl_usable_channels; if (!hidl_struct_util::convertLegacyWifiUsableChannelsToHidl(legacy_usable_channels, &hidl_usable_channels)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; @@ -1429,11 +1461,6 @@ std::pair> WifiChip::getUsableChannel return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_usable_channels}; } -WifiStatus WifiChip::triggerSubsystemRestartInternal() { - auto legacy_status = legacy_hal_.lock()->triggerSubsystemRestart(); - return createWifiStatusFromLegacyError(legacy_status); -} - WifiStatus WifiChip::handleChipConfiguration( /* NONNULL */ std::unique_lock* lock, ChipModeId mode_id) { // If the chip is already configured in a different mode, stop diff --git a/wifi/1.6/default/wifi_chip.h b/wifi/1.6/default/wifi_chip.h index 8a068985d1..73bdf3ada1 100644 --- a/wifi/1.6/default/wifi_chip.h +++ b/wifi/1.6/default/wifi_chip.h @@ -22,8 +22,9 @@ #include #include -#include -#include +#include +#include +#include #include "hidl_callback_util.h" #include "ringbuffer.h" @@ -43,14 +44,13 @@ namespace V1_6 { namespace implementation { using namespace android::hardware::wifi::V1_0; using V1_5::WifiBand; -using V1_5::WifiUsableChannel; /** * HIDL interface object used to control a Wifi HAL chip instance. * Since there is only a single chip instance used today, there is no * identifying handle information stored here. */ -class WifiChip : public V1_5::IWifiChip { +class WifiChip : public V1_6::IWifiChip { public: WifiChip(ChipId chip_id, bool is_primary, const std::weak_ptr legacy_hal, @@ -154,6 +154,12 @@ class WifiChip : public V1_5::IWifiChip { hidl_bitfield filterMask, getUsableChannels_cb _hidl_cb) override; Return triggerSubsystemRestart(triggerSubsystemRestart_cb hidl_status_cb) override; + Return createRttController_1_6(const sp& bound_iface, + createRttController_1_6_cb hidl_status_cb) override; + Return getUsableChannels_1_6(WifiBand band, + hidl_bitfield ifaceModeMask, + hidl_bitfield filterMask, + getUsableChannels_1_6_cb _hidl_cb) override; private: void invalidateAndRemoveAllIfaces(); @@ -191,9 +197,9 @@ class WifiChip : public V1_5::IWifiChip { std::pair> getP2pIfaceNamesInternal(); std::pair> getP2pIfaceInternal(const std::string& ifname); WifiStatus removeP2pIfaceInternal(const std::string& ifname); - std::pair> createStaIfaceInternal(); + std::pair> createStaIfaceInternal(); std::pair> getStaIfaceNamesInternal(); - std::pair> getStaIfaceInternal(const std::string& ifname); + std::pair> getStaIfaceInternal(const std::string& ifname); WifiStatus removeStaIfaceInternal(const std::string& ifname); std::pair> createRttControllerInternal( const sp& bound_iface); @@ -225,13 +231,12 @@ class WifiChip : public V1_5::IWifiChip { WifiStatus setCoexUnsafeChannelsInternal(std::vector unsafe_channels, uint32_t restrictions); WifiStatus setCountryCodeInternal(const std::array& code); - std::pair> getUsableChannelsInternal( + std::pair> getUsableChannelsInternal( WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask); WifiStatus handleChipConfiguration(std::unique_lock* lock, ChipModeId mode_id); WifiStatus registerDebugRingBufferCallback(); WifiStatus registerRadioModeChangeCallback(); - std::vector getCurrentModeIfaceCombinations(); std::map getCurrentIfaceCombination(); std::vector> expandIfaceCombinations( @@ -258,6 +263,10 @@ class WifiChip : public V1_5::IWifiChip { void invalidateAndClearBridgedAp(const std::string& br_name); bool findUsingNameFromBridgedApInstances(const std::string& name); WifiStatus triggerSubsystemRestartInternal(); + std::pair> createRttControllerInternal_1_6( + const sp& bound_iface); + std::pair> getUsableChannelsInternal_1_6( + WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask); ChipId chip_id_; std::weak_ptr legacy_hal_; diff --git a/wifi/1.6/default/wifi_legacy_hal.h b/wifi/1.6/default/wifi_legacy_hal.h index d87242cdd5..7dc6bd643e 100644 --- a/wifi/1.6/default/wifi_legacy_hal.h +++ b/wifi/1.6/default/wifi_legacy_hal.h @@ -216,6 +216,7 @@ using ::wifi_cached_scan_results; using ::WIFI_CHAN_WIDTH_10; using ::WIFI_CHAN_WIDTH_160; using ::WIFI_CHAN_WIDTH_20; +using ::WIFI_CHAN_WIDTH_320; using ::WIFI_CHAN_WIDTH_40; using ::WIFI_CHAN_WIDTH_5; using ::WIFI_CHAN_WIDTH_80; @@ -289,12 +290,14 @@ using ::wifi_rtt_bw; using ::WIFI_RTT_BW_10; using ::WIFI_RTT_BW_160; using ::WIFI_RTT_BW_20; +using ::WIFI_RTT_BW_320; using ::WIFI_RTT_BW_40; using ::WIFI_RTT_BW_5; using ::WIFI_RTT_BW_80; using ::wifi_rtt_capabilities; using ::wifi_rtt_config; using ::wifi_rtt_preamble; +using ::WIFI_RTT_PREAMBLE_EHT; using ::WIFI_RTT_PREAMBLE_HE; using ::WIFI_RTT_PREAMBLE_HT; using ::WIFI_RTT_PREAMBLE_LEGACY; diff --git a/wifi/1.6/default/wifi_nan_iface.cpp b/wifi/1.6/default/wifi_nan_iface.cpp index 236cb64e32..1add6dce5c 100644 --- a/wifi/1.6/default/wifi_nan_iface.cpp +++ b/wifi/1.6/default/wifi_nan_iface.cpp @@ -378,15 +378,15 @@ WifiNanIface::WifiNanIface(const std::string& ifname, bool is_dedicated_iface, LOG(ERROR) << "Callback invoked on an invalid object"; return; } - V1_2::NanDataPathConfirmInd hidl_struct; + V1_6::NanDataPathConfirmInd hidl_struct; if (!hidl_struct_util::convertLegacyNanDataPathConfirmIndToHidl(msg, &hidl_struct)) { LOG(ERROR) << "Failed to convert nan capabilities response"; return; } - for (const auto& callback : shared_ptr_this->getEventCallbacks_1_2()) { - if (!callback->eventDataPathConfirm_1_2(hidl_struct).isOk()) { + for (const auto& callback : shared_ptr_this->getEventCallbacks_1_6()) { + if (!callback->eventDataPathConfirm_1_6(hidl_struct).isOk()) { LOG(ERROR) << "Failed to invoke the callback"; } } @@ -430,15 +430,15 @@ WifiNanIface::WifiNanIface(const std::string& ifname, bool is_dedicated_iface, LOG(ERROR) << "Callback invoked on an invalid object"; return; } - V1_2::NanDataPathScheduleUpdateInd hidl_struct; + V1_6::NanDataPathScheduleUpdateInd hidl_struct; if (!hidl_struct_util::convertLegacyNanDataPathScheduleUpdateIndToHidl( msg, &hidl_struct)) { LOG(ERROR) << "Failed to convert nan capabilities response"; return; } - for (const auto& callback : shared_ptr_this->getEventCallbacks_1_2()) { - if (!callback->eventDataPathScheduleUpdate(hidl_struct).isOk()) { + for (const auto& callback : shared_ptr_this->getEventCallbacks_1_6()) { + if (!callback->eventDataPathScheduleUpdate_1_6(hidl_struct).isOk()) { LOG(ERROR) << "Failed to invoke the callback"; } } @@ -510,6 +510,10 @@ std::set> WifiNanIface::getEventCallbacks_1 return event_cb_handler_1_5_.getCallbacks(); } +std::set> WifiNanIface::getEventCallbacks_1_6() { + return event_cb_handler_1_6_.getCallbacks(); +} + Return WifiNanIface::getName(getName_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, &WifiNanIface::getNameInternal, hidl_status_cb); @@ -703,6 +707,14 @@ std::pair WifiNanIface::getTypeInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::NAN}; } +Return WifiNanIface::registerEventCallback_1_6( + const sp& callback, + registerEventCallback_1_6_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::registerEventCallback_1_6Internal, hidl_status_cb, + callback); +} + WifiStatus WifiNanIface::registerEventCallbackInternal( const sp& callback) { if (!event_cb_handler_.addCallback(callback)) { @@ -898,6 +910,25 @@ WifiStatus WifiNanIface::configRequest_1_5Internal(uint16_t cmd_id, return createWifiStatusFromLegacyError(legacy_status); } +WifiStatus WifiNanIface::registerEventCallback_1_6Internal( + const sp& callback) { + sp callback_1_0 = callback; + if (!event_cb_handler_.addCallback(callback_1_0)) { + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); + } + sp callback_1_2 = callback; + if (!event_cb_handler_1_2_.addCallback(callback_1_2)) { + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); + } + sp callback_1_5 = callback; + if (!event_cb_handler_1_5_.addCallback(callback_1_5)) { + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); + } + if (!event_cb_handler_1_6_.addCallback(callback)) { + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN); + } + return createWifiStatus(WifiStatusCode::SUCCESS); +} } // namespace implementation } // namespace V1_6 } // namespace wifi diff --git a/wifi/1.6/default/wifi_nan_iface.h b/wifi/1.6/default/wifi_nan_iface.h index c445afc541..b732ef1371 100644 --- a/wifi/1.6/default/wifi_nan_iface.h +++ b/wifi/1.6/default/wifi_nan_iface.h @@ -18,8 +18,8 @@ #define WIFI_NAN_IFACE_H_ #include -#include -#include +#include +#include #include "hidl_callback_util.h" #include "wifi_iface_util.h" @@ -36,7 +36,7 @@ using namespace android::hardware::wifi::V1_2; /** * HIDL interface object used to control a NAN Iface instance. */ -class WifiNanIface : public V1_5::IWifiNanIface { +class WifiNanIface : public V1_6::IWifiNanIface { public: WifiNanIface(const std::string& ifname, bool is_dedicated_iface, const std::weak_ptr legacy_hal, @@ -104,6 +104,8 @@ class WifiNanIface : public V1_5::IWifiNanIface { configRequest_1_4_cb hidl_status_cb) override; Return getCapabilitiesRequest_1_5(uint16_t cmd_id, getCapabilitiesRequest_cb hidl_status_cb) override; + Return registerEventCallback_1_6(const sp& callback, + registerEventCallback_1_6_cb hidl_status_cb) override; private: // Corresponding worker functions for the HIDL methods. @@ -145,6 +147,8 @@ class WifiNanIface : public V1_5::IWifiNanIface { WifiStatus configRequest_1_5Internal(uint16_t cmd_id, const V1_4::NanConfigRequest& msg, const V1_5::NanConfigRequestSupplemental& msg2); WifiStatus getCapabilitiesRequest_1_5Internal(uint16_t cmd_id); + WifiStatus registerEventCallback_1_6Internal( + const sp& callback); // all 1_0 and descendant callbacks std::set> getEventCallbacks(); @@ -152,6 +156,8 @@ class WifiNanIface : public V1_5::IWifiNanIface { std::set> getEventCallbacks_1_2(); // all 1_5 and descendant callbacks std::set> getEventCallbacks_1_5(); + // all 1_6 and descendant callbacks + std::set> getEventCallbacks_1_6(); std::string ifname_; bool is_dedicated_iface_; @@ -161,6 +167,7 @@ class WifiNanIface : public V1_5::IWifiNanIface { hidl_callback_util::HidlCallbackHandler event_cb_handler_; hidl_callback_util::HidlCallbackHandler event_cb_handler_1_2_; hidl_callback_util::HidlCallbackHandler event_cb_handler_1_5_; + hidl_callback_util::HidlCallbackHandler event_cb_handler_1_6_; DISALLOW_COPY_AND_ASSIGN(WifiNanIface); }; diff --git a/wifi/1.6/default/wifi_rtt_controller.cpp b/wifi/1.6/default/wifi_rtt_controller.cpp index f5e1d5aafc..b328f311ab 100644 --- a/wifi/1.6/default/wifi_rtt_controller.cpp +++ b/wifi/1.6/default/wifi_rtt_controller.cpp @@ -43,7 +43,7 @@ bool WifiRttController::isValid() { return is_valid_; } -std::vector> WifiRttController::getEventCallbacks() { +std::vector> WifiRttController::getEventCallbacks() { return event_callbacks_; } @@ -102,7 +102,7 @@ Return WifiRttController::getResponderInfo(getResponderInfo_cb hidl_status } Return WifiRttController::enableResponder(uint32_t cmd_id, - const WifiChannelInfo& channel_hint, + const V1_0::WifiChannelInfo& channel_hint, uint32_t max_duration_seconds, const V1_0::RttResponder& info, enableResponder_cb hidl_status_cb) { @@ -144,7 +144,7 @@ Return WifiRttController::getResponderInfo_1_4(getResponderInfo_1_4_cb hid } Return WifiRttController::enableResponder_1_4(uint32_t cmd_id, - const WifiChannelInfo& channel_hint, + const V1_0::WifiChannelInfo& channel_hint, uint32_t max_duration_seconds, const V1_4::RttResponder& info, enableResponder_1_4_cb hidl_status_cb) { @@ -153,6 +153,42 @@ Return WifiRttController::enableResponder_1_4(uint32_t cmd_id, channel_hint, max_duration_seconds, info); } +Return WifiRttController::registerEventCallback_1_6( + const sp& callback, + registerEventCallback_1_6_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::registerEventCallbackInternal_1_6, hidl_status_cb, + callback); +} + +Return WifiRttController::rangeRequest_1_6(uint32_t cmd_id, + const hidl_vec& rtt_configs, + rangeRequest_1_6_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::rangeRequestInternal_1_6, hidl_status_cb, cmd_id, + rtt_configs); +} + +Return WifiRttController::getCapabilities_1_6(getCapabilities_1_6_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::getCapabilitiesInternal_1_6, hidl_status_cb); +} + +Return WifiRttController::getResponderInfo_1_6(getResponderInfo_1_6_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::getResponderInfoInternal_1_6, hidl_status_cb); +} + +Return WifiRttController::enableResponder_1_6(uint32_t cmd_id, + const V1_6::WifiChannelInfo& channel_hint, + uint32_t max_duration_seconds, + const V1_6::RttResponder& info, + enableResponder_1_6_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::enableResponderInternal_1_6, hidl_status_cb, cmd_id, + channel_hint, max_duration_seconds, info); +} + std::pair> WifiRttController::getBoundIfaceInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), bound_iface_}; } @@ -210,10 +246,9 @@ std::pair WifiRttController::getResponderInfoInt return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; } -WifiStatus WifiRttController::enableResponderInternal(uint32_t /* cmd_id */, - const WifiChannelInfo& /* channel_hint */, - uint32_t /* max_duration_seconds */, - const V1_0::RttResponder& /* info */) { +WifiStatus WifiRttController::enableResponderInternal( + uint32_t /* cmd_id */, const V1_0::WifiChannelInfo& /* channel_hint */, + uint32_t /* max_duration_seconds */, const V1_0::RttResponder& /* info */) { // Deprecated support for this api return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED)}; } @@ -224,14 +259,43 @@ WifiStatus WifiRttController::disableResponderInternal(uint32_t cmd_id) { } WifiStatus WifiRttController::registerEventCallbackInternal_1_4( - const sp& callback) { + const sp& /* callback */) { + // Deprecated support for this api + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); +} + +WifiStatus WifiRttController::rangeRequestInternal_1_4( + uint32_t /* cmd_id */, const std::vector& /* rtt_configs */) { + // Deprecated support for this api + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); +} + +std::pair WifiRttController::getCapabilitiesInternal_1_4() { + // Deprecated support for this api + return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; +} + +std::pair WifiRttController::getResponderInfoInternal_1_4() { + // Deprecated support for this api + return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; +} + +WifiStatus WifiRttController::enableResponderInternal_1_4( + uint32_t /* cmd_id */, const V1_0::WifiChannelInfo& /* channel_hint */, + uint32_t /* max_duration_seconds */, const V1_4::RttResponder& /* info */) { + // Deprecated support for this api + return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED)}; +} + +WifiStatus WifiRttController::registerEventCallbackInternal_1_6( + const sp& callback) { // TODO(b/31632518): remove the callback when the client is destroyed event_callbacks_.emplace_back(callback); return createWifiStatus(WifiStatusCode::SUCCESS); } -WifiStatus WifiRttController::rangeRequestInternal_1_4( - uint32_t cmd_id, const std::vector& rtt_configs) { +WifiStatus WifiRttController::rangeRequestInternal_1_6( + uint32_t cmd_id, const std::vector& rtt_configs) { std::vector legacy_configs; if (!hidl_struct_util::convertHidlVectorOfRttConfigToLegacy(rtt_configs, &legacy_configs)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); @@ -245,14 +309,14 @@ WifiStatus WifiRttController::rangeRequestInternal_1_4( LOG(ERROR) << "Callback invoked on an invalid object"; return; } - std::vector hidl_results; + std::vector hidl_results; if (!hidl_struct_util::convertLegacyVectorOfRttResultToHidl(results, &hidl_results)) { LOG(ERROR) << "Failed to convert rtt results to HIDL structs"; return; } for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - callback->onResults_1_4(id, hidl_results); + callback->onResults_1_6(id, hidl_results); } }; legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRttRangeRequest( @@ -260,38 +324,38 @@ WifiStatus WifiRttController::rangeRequestInternal_1_4( return createWifiStatusFromLegacyError(legacy_status); } -std::pair WifiRttController::getCapabilitiesInternal_1_4() { +std::pair WifiRttController::getCapabilitiesInternal_1_6() { legacy_hal::wifi_error legacy_status; 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 {createWifiStatusFromLegacyError(legacy_status), {}}; } - V1_4::RttCapabilities hidl_caps; + V1_6::RttCapabilities hidl_caps; if (!hidl_struct_util::convertLegacyRttCapabilitiesToHidl(legacy_caps, &hidl_caps)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; } return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps}; } -std::pair WifiRttController::getResponderInfoInternal_1_4() { +std::pair WifiRttController::getResponderInfoInternal_1_6() { legacy_hal::wifi_error legacy_status; legacy_hal::wifi_rtt_responder legacy_responder; std::tie(legacy_status, legacy_responder) = legacy_hal_.lock()->getRttResponderInfo(ifname_); if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {createWifiStatusFromLegacyError(legacy_status), {}}; } - V1_4::RttResponder hidl_responder; + V1_6::RttResponder hidl_responder; if (!hidl_struct_util::convertLegacyRttResponderToHidl(legacy_responder, &hidl_responder)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; } return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_responder}; } -WifiStatus WifiRttController::enableResponderInternal_1_4(uint32_t cmd_id, - const WifiChannelInfo& channel_hint, +WifiStatus WifiRttController::enableResponderInternal_1_6(uint32_t cmd_id, + const V1_6::WifiChannelInfo& channel_hint, uint32_t max_duration_seconds, - const V1_4::RttResponder& info) { + const V1_6::RttResponder& info) { legacy_hal::wifi_channel_info legacy_channel_info; if (!hidl_struct_util::convertHidlWifiChannelInfoToLegacy(channel_hint, &legacy_channel_info)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); diff --git a/wifi/1.6/default/wifi_rtt_controller.h b/wifi/1.6/default/wifi_rtt_controller.h index b4a2116f2b..fd5f68b6a8 100644 --- a/wifi/1.6/default/wifi_rtt_controller.h +++ b/wifi/1.6/default/wifi_rtt_controller.h @@ -19,8 +19,8 @@ #include #include -#include -#include +#include +#include #include "wifi_legacy_hal.h" @@ -33,14 +33,14 @@ namespace implementation { /** * HIDL interface object used to control all RTT operations. */ -class WifiRttController : public V1_4::IWifiRttController { +class WifiRttController : public V1_6::IWifiRttController { public: WifiRttController(const std::string& iface_name, const sp& bound_iface, const std::weak_ptr legacy_hal); // Refer to |WifiChip::invalidate()|. void invalidate(); bool isValid(); - std::vector> getEventCallbacks(); + std::vector> getEventCallbacks(); std::string getIfaceName(); // HIDL methods exposed. @@ -57,7 +57,7 @@ class WifiRttController : public V1_4::IWifiRttController { Return setLcr(uint32_t cmd_id, const RttLcrInformation& lcr, setLcr_cb hidl_status_cb) override; Return getResponderInfo(getResponderInfo_cb hidl_status_cb) override; - Return enableResponder(uint32_t cmd_id, const WifiChannelInfo& channel_hint, + Return enableResponder(uint32_t cmd_id, const V1_0::WifiChannelInfo& channel_hint, uint32_t max_duration_seconds, const V1_0::RttResponder& info, enableResponder_cb hidl_status_cb) override; Return disableResponder(uint32_t cmd_id, disableResponder_cb hidl_status_cb) override; @@ -68,9 +68,19 @@ class WifiRttController : public V1_4::IWifiRttController { rangeRequest_1_4_cb hidl_status_cb) override; Return getCapabilities_1_4(getCapabilities_1_4_cb hidl_status_cb) override; Return getResponderInfo_1_4(getResponderInfo_1_4_cb hidl_status_cb) override; - Return enableResponder_1_4(uint32_t cmd_id, const WifiChannelInfo& channel_hint, + Return enableResponder_1_4(uint32_t cmd_id, const V1_0::WifiChannelInfo& channel_hint, uint32_t max_duration_seconds, const V1_4::RttResponder& info, enableResponder_1_4_cb hidl_status_cb) override; + Return registerEventCallback_1_6( + const sp& callback, + registerEventCallback_1_6_cb hidl_status_cb) override; + Return rangeRequest_1_6(uint32_t cmd_id, const hidl_vec& rtt_configs, + rangeRequest_1_6_cb hidl_status_cb) override; + Return getCapabilities_1_6(getCapabilities_1_6_cb hidl_status_cb) override; + Return getResponderInfo_1_6(getResponderInfo_1_6_cb hidl_status_cb) override; + Return enableResponder_1_6(uint32_t cmd_id, const V1_6::WifiChannelInfo& channel_hint, + uint32_t max_duration_seconds, const V1_6::RttResponder& info, + enableResponder_1_6_cb hidl_status_cb) override; private: // Corresponding worker functions for the HIDL methods. @@ -85,7 +95,7 @@ class WifiRttController : public V1_4::IWifiRttController { WifiStatus setLciInternal(uint32_t cmd_id, const RttLciInformation& lci); WifiStatus setLcrInternal(uint32_t cmd_id, const RttLcrInformation& lcr); std::pair getResponderInfoInternal(); - WifiStatus enableResponderInternal(uint32_t cmd_id, const WifiChannelInfo& channel_hint, + WifiStatus enableResponderInternal(uint32_t cmd_id, const V1_0::WifiChannelInfo& channel_hint, uint32_t max_duration_seconds, const V1_0::RttResponder& info); WifiStatus disableResponderInternal(uint32_t cmd_id); @@ -95,14 +105,25 @@ class WifiRttController : public V1_4::IWifiRttController { const std::vector& rtt_configs); std::pair getCapabilitiesInternal_1_4(); std::pair getResponderInfoInternal_1_4(); - WifiStatus enableResponderInternal_1_4(uint32_t cmd_id, const WifiChannelInfo& channel_hint, + WifiStatus enableResponderInternal_1_4(uint32_t cmd_id, + const V1_0::WifiChannelInfo& channel_hint, uint32_t max_duration_seconds, const V1_4::RttResponder& info); + WifiStatus registerEventCallbackInternal_1_6( + const sp& callback); + WifiStatus rangeRequestInternal_1_6(uint32_t cmd_id, + const std::vector& rtt_configs); + std::pair getCapabilitiesInternal_1_6(); + std::pair getResponderInfoInternal_1_6(); + WifiStatus enableResponderInternal_1_6(uint32_t cmd_id, + const V1_6::WifiChannelInfo& channel_hint, + uint32_t max_duration_seconds, + const V1_6::RttResponder& info); std::string ifname_; sp bound_iface_; std::weak_ptr legacy_hal_; - std::vector> event_callbacks_; + std::vector> event_callbacks_; bool is_valid_; DISALLOW_COPY_AND_ASSIGN(WifiRttController); diff --git a/wifi/1.6/default/wifi_sta_iface.cpp b/wifi/1.6/default/wifi_sta_iface.cpp index f852d36689..dd11839c97 100644 --- a/wifi/1.6/default/wifi_sta_iface.cpp +++ b/wifi/1.6/default/wifi_sta_iface.cpp @@ -150,6 +150,11 @@ Return WifiStaIface::getLinkLayerStats_1_5(getLinkLayerStats_1_5_cb hidl_s &WifiStaIface::getLinkLayerStatsInternal_1_5, hidl_status_cb); } +Return WifiStaIface::getLinkLayerStats_1_6(getLinkLayerStats_1_6_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getLinkLayerStatsInternal_1_6, hidl_status_cb); +} + Return WifiStaIface::startRssiMonitoring(uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi, startRssiMonitoring_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, @@ -422,13 +427,17 @@ std::pair WifiStaIface::getLinkLayerStatsIn } std::pair WifiStaIface::getLinkLayerStatsInternal_1_5() { + return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; +} + +std::pair WifiStaIface::getLinkLayerStatsInternal_1_6() { legacy_hal::wifi_error legacy_status; legacy_hal::LinkLayerStats legacy_stats; std::tie(legacy_status, legacy_stats) = legacy_hal_.lock()->getLinkLayerStats(ifname_); if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {createWifiStatusFromLegacyError(legacy_status), {}}; } - V1_5::StaLinkLayerStats hidl_stats; + V1_6::StaLinkLayerStats hidl_stats; if (!hidl_struct_util::convertLegacyLinkLayerStatsToHidl(legacy_stats, &hidl_stats)) { return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}}; } diff --git a/wifi/1.6/default/wifi_sta_iface.h b/wifi/1.6/default/wifi_sta_iface.h index 37358a5fb0..c01c50b612 100644 --- a/wifi/1.6/default/wifi_sta_iface.h +++ b/wifi/1.6/default/wifi_sta_iface.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include "hidl_callback_util.h" #include "wifi_iface_util.h" @@ -35,7 +35,7 @@ using namespace android::hardware::wifi::V1_0; /** * HIDL interface object used to control a STA Iface instance. */ -class WifiStaIface : public V1_5::IWifiStaIface { +class WifiStaIface : public V1_6::IWifiStaIface { public: WifiStaIface(const std::string& ifname, const std::weak_ptr legacy_hal, @@ -71,6 +71,7 @@ class WifiStaIface : public V1_5::IWifiStaIface { Return getLinkLayerStats(getLinkLayerStats_cb hidl_status_cb) override; Return getLinkLayerStats_1_3(getLinkLayerStats_1_3_cb hidl_status_cb) override; Return getLinkLayerStats_1_5(getLinkLayerStats_1_5_cb hidl_status_cb) override; + Return getLinkLayerStats_1_6(getLinkLayerStats_1_6_cb hidl_status_cb) override; Return startRssiMonitoring(uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi, startRssiMonitoring_cb hidl_status_cb) override; Return stopRssiMonitoring(uint32_t cmd_id, stopRssiMonitoring_cb hidl_status_cb) override; @@ -116,6 +117,7 @@ class WifiStaIface : public V1_5::IWifiStaIface { std::pair getLinkLayerStatsInternal(); std::pair getLinkLayerStatsInternal_1_3(); std::pair getLinkLayerStatsInternal_1_5(); + std::pair getLinkLayerStatsInternal_1_6(); WifiStatus startRssiMonitoringInternal(uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi); WifiStatus stopRssiMonitoringInternal(uint32_t cmd_id); std::pair getRoamingCapabilitiesInternal(); -- GitLab From 26a3150b71079851182f260eb7622c36ca668b45 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 23 Dec 2021 14:55:30 -0800 Subject: [PATCH 486/825] Optimize some code path to move instead of copy data. Test: atest DefaultVehicleHalTest Bug: 210063973 Change-Id: Ia6a75df7098fae23797571bb59dad3696239ab87 --- .../aidl/impl/vhal/include/ConnectedClient.h | 2 +- .../impl/vhal/include/DefaultVehicleHal.h | 7 ----- .../aidl/impl/vhal/include/ParcelableUtils.h | 6 ++++ .../aidl/impl/vhal/src/ConnectedClient.cpp | 29 ++++++++++--------- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 4 +-- .../impl/vhal/test/ConnectedClientTest.cpp | 6 ++-- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 3 +- 7 files changed, 30 insertions(+), 27 deletions(-) diff --git a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h index 833707a580..15a6278f38 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h +++ b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h @@ -79,7 +79,7 @@ class GetSetValuesClient final : public ConnectedClient { GetSetValuesClient(std::shared_ptr requestPool, CallbackType callback); // Sends the results to this client. - void sendResults(const std::vector& results); + void sendResults(std::vector&& results); // Sends each result separately to this client. Each result would be sent through one callback // invocation. diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index 62b2627691..e3267ddc24 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -39,13 +39,6 @@ namespace hardware { namespace automotive { namespace vehicle { -// private namespace -namespace defaultvehiclehal_impl { - -constexpr int INVALID_MEMORY_FD = -1; - -} // namespace defaultvehiclehal_impl - class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::vehicle::BnVehicle { public: using CallbackType = diff --git a/automotive/vehicle/aidl/impl/vhal/include/ParcelableUtils.h b/automotive/vehicle/aidl/impl/vhal/include/ParcelableUtils.h index 4b7c2f3221..7b2111b96b 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/ParcelableUtils.h +++ b/automotive/vehicle/aidl/impl/vhal/include/ParcelableUtils.h @@ -29,6 +29,9 @@ namespace hardware { namespace automotive { namespace vehicle { +// Turns the values into a stable large parcelable that could be sent via binder. +// If values is small enough, it would be put into output.payloads, otherwise a shared memory file +// would be created and output.sharedMemoryFd would be filled in. template ::ndk::ScopedAStatus vectorToStableLargeParcelable(std::vector&& values, T2* output) { output->payloads = std::move(values); @@ -44,6 +47,9 @@ template // 'sharedMemoryFd' field. output->payloads.clear(); output->sharedMemoryFd = std::move(*fd); + } else { + output->sharedMemoryFd = ::ndk::ScopedFileDescriptor(); + // Do not modify payloads. } return ::ndk::ScopedAStatus::ok(); } diff --git a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp index 5ccef55a29..098bfee1bb 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp @@ -84,9 +84,9 @@ void sendGetOrSetValueResultsSeparately(std::shared_ptr callba // Send all the GetValue/SetValue results through callback in a single callback invocation. template void sendGetOrSetValueResults(std::shared_ptr callback, - const std::vector& results) { + std::vector&& results) { ResultsType parcelableResults; - ScopedAStatus status = vectorToStableLargeParcelable(results, &parcelableResults); + ScopedAStatus status = vectorToStableLargeParcelable(std::move(results), &parcelableResults); if (status.isOk()) { if (ScopedAStatus callbackStatus = callCallback(callback, parcelableResults); !callbackStatus.isOk()) { @@ -99,7 +99,8 @@ void sendGetOrSetValueResults(std::shared_ptr callback, ALOGE("failed to marshal result into large parcelable, error: " "%s, code: %d", status.getMessage(), statusCode); - sendGetOrSetValueResultsSeparately(callback, results); + sendGetOrSetValueResultsSeparately(callback, + parcelableResults.payloads); } // The timeout callback for GetValues/SetValues. @@ -115,7 +116,7 @@ void onTimeout( .status = StatusCode::TRY_AGAIN, }); } - sendGetOrSetValueResults(callback, timeoutResults); + sendGetOrSetValueResults(callback, std::move(timeoutResults)); } // The on-results callback for GetValues/SetValues. @@ -123,7 +124,7 @@ template void getOrSetValuesCallback( const void* clientId, std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> callback, - std::vector results, std::shared_ptr requestPool) { + std::vector&& results, std::shared_ptr requestPool) { std::unordered_set requestIds; for (const auto& result : results) { requestIds.insert(result.requestId); @@ -145,7 +146,7 @@ void getOrSetValuesCallback( } if (!results.empty()) { - sendGetOrSetValueResults(callback, results); + sendGetOrSetValueResults(callback, std::move(results)); } } @@ -156,9 +157,9 @@ template void sendGetOrSetValueResult( std::shared_ptr callback, const SetValueResult& result); template void sendGetOrSetValueResults( - std::shared_ptr callback, const std::vector& results); + std::shared_ptr callback, std::vector&& results); template void sendGetOrSetValueResults( - std::shared_ptr callback, const std::vector& results); + std::shared_ptr callback, std::vector&& results); template void sendGetOrSetValueResultsSeparately( std::shared_ptr callback, const std::vector& results); @@ -175,11 +176,11 @@ template void onTimeout( template void getOrSetValuesCallback( const void* clientId, std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> callback, - std::vector results, std::shared_ptr requestPool); + std::vector&& results, std::shared_ptr requestPool); template void getOrSetValuesCallback( const void* clientId, std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback> callback, - std::vector results, std::shared_ptr requestPool); + std::vector&& results, std::shared_ptr requestPool); } // namespace @@ -230,9 +231,8 @@ GetSetValuesClient::getTimeoutCallback() { } template -void GetSetValuesClient::sendResults( - const std::vector& results) { - return sendGetOrSetValueResults(mCallback, results); +void GetSetValuesClient::sendResults(std::vector&& results) { + return sendGetOrSetValueResults(mCallback, std::move(results)); } template @@ -283,7 +283,8 @@ void SubscriptionClient::sendUpdatedValues(std::shared_ptr cal // TODO(b/205189110): Use memory pool here and fill in sharedMemoryId. VehiclePropValues vehiclePropValues; int32_t sharedMemoryFileCount = 0; - ScopedAStatus status = vectorToStableLargeParcelable(updatedValues, &vehiclePropValues); + ScopedAStatus status = + vectorToStableLargeParcelable(std::move(updatedValues), &vehiclePropValues); if (!status.isOk()) { int statusCode = status.getServiceSpecificError(); ALOGE("subscribe: failed to marshal result into large parcelable, error: " diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index 3e088c5ee8..dd8897966e 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -387,7 +387,7 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, if (!failedResults.empty()) { // First send the failed results we already know back to the client. - client->sendResults(failedResults); + client->sendResults(std::move(failedResults)); } if (hardwareRequests.empty()) { @@ -476,7 +476,7 @@ ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, if (!failedResults.empty()) { // First send the failed results we already know back to the client. - client->sendResults(failedResults); + client->sendResults(std::move(failedResults)); } if (hardwareRequests.empty()) { diff --git a/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp index bd4a565df3..bdb0d31cdb 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp @@ -80,7 +80,8 @@ TEST_F(ConnectedClientTest, testSendGetValueResults) { GetValuesClient client(getPool(), getCallbackClient()); - client.sendResults(results); + auto resultsCopy = results; + client.sendResults(std::move(resultsCopy)); auto maybeGetValueResults = getCallback()->nextGetValueResults(); ASSERT_TRUE(maybeGetValueResults.has_value()); @@ -160,7 +161,8 @@ TEST_F(ConnectedClientTest, testSendSetValueResults) { SetValuesClient client(getPool(), getCallbackClient()); - client.sendResults(results); + auto resultsCopy = results; + client.sendResults(std::move(resultsCopy)); auto maybeSetValueResults = getCallback()->nextSetValueResults(); ASSERT_TRUE(maybeSetValueResults.has_value()); diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index ff355c33e1..566f0bdf23 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -371,7 +371,7 @@ class DefaultVehicleHalTest : public ::testing::Test { return mVhal->mOnBinderDiedContexts[clientId].get(); } - bool countOnBinderDiedContexts() { + size_t countOnBinderDiedContexts() { std::scoped_lock lockGuard(mVhal->mLock); return mVhal->mOnBinderDiedContexts.size(); } @@ -444,6 +444,7 @@ class DefaultVehicleHalTest : public ::testing::Test { if (result.value() != nullptr) { requests.payloads.clear(); requests.sharedMemoryFd = std::move(*result.value()); + requests.payloads.clear(); } return {}; } -- GitLab From 2e6d900f3ad1eb85bce738142e19028de114377f Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 23 Dec 2021 17:46:08 -0800 Subject: [PATCH 487/825] Prevent log spam. Add a macro guard for log messages to prevent spam. Test: Manually test on emulator. Bug: 200737967 Change-Id: I27a270fe70cf706307a0908d6d4aae8e5197a3e5 --- .../fake_impl/hardware/src/FakeVehicleHardware.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 e75f0e7c2c..9c97a2c85c 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -14,6 +14,9 @@ * limitations under the License. */ +#define LOG_TAG "FakeVehicleHardware" +#define FAKE_VEHICLEHARDWARE_DEBUG false // STOPSHIP if true. + #include "FakeVehicleHardware.h" #include @@ -387,7 +390,9 @@ StatusCode FakeVehicleHardware::setValues(std::shared_ptr results; for (auto& request : requests) { const VehiclePropValue& value = request.prop; - ALOGD("getValues(%d)", value.prop); + + if (FAKE_VEHICLEHARDWARE_DEBUG) { + ALOGD("getValues(%d)", value.prop); + } GetValueResult getValueResult; getValueResult.requestId = request.requestId; -- GitLab From 93d36287e61cf25a78e1477cba24520332edc948 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 11 Jan 2022 19:22:58 -0800 Subject: [PATCH 488/825] Support debug dump Test: atest FakeVehicleHardwareTest Bug: 199314530 Change-Id: Ied0d1cd7c21e62a7db085f3b5be465cb0d576e73 --- .../hardware/include/FakeVehicleHardware.h | 24 +++ .../hardware/src/FakeVehicleHardware.cpp | 143 +++++++++++++++++- .../hardware/test/FakeVehicleHardwareTest.cpp | 79 ++++++++++ .../impl/vhal/include/DefaultVehicleHal.h | 3 + .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 35 +++++ .../impl/vhal/test/DefaultVehicleHalTest.cpp | 41 +++++ .../impl/vhal/test/MockVehicleHardware.cpp | 8 +- .../aidl/impl/vhal/test/MockVehicleHardware.h | 3 + 8 files changed, 330 insertions(+), 6 deletions(-) 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 cab184bb49..e7010788a8 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -23,7 +23,9 @@ #include #include #include +#include #include +#include #include #include @@ -120,6 +122,28 @@ class FakeVehicleHardware final : public IVehicleHardware { ::android::base::Result getUserHalProp( const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; bool isHvacPropAndHvacNotAvailable(int32_t propId); + + std::string dumpAllProperties(); + std::string dumpOnePropertyByConfig( + int rowNumber, + const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config); + std::string dumpOnePropertyById(int32_t propId, int32_t areaId); + std::string dumpHelp(); + std::string dumpListProperties(); + std::string dumpSpecificProperty(const std::vector& options); + + template + ::android::base::Result safelyParseInt(int index, const std::string& s) { + T out; + if (!::android::base::ParseInt(s, &out)) { + return ::android::base::Error() << ::android::base::StringPrintf( + "non-integer argument at index %d: %s\n", index, s.c_str()); + } + return out; + } + + ::android::base::Result checkArgumentsSize(const std::vector& options, + size_t minSize); }; } // 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 9c97a2c85c..1f8e436b30 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -59,8 +60,10 @@ using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; +using ::android::base::EqualsIgnoreCase; using ::android::base::Error; using ::android::base::Result; +using ::android::base::StringPrintf; const char* VENDOR_OVERRIDE_DIR = "/vendor/etc/automotive/vhaloverride/"; const char* OVERRIDE_PROPERTY = "persist.vendor.vhal_init_value_override"; @@ -484,14 +487,148 @@ StatusCode FakeVehicleHardware::getValues(std::shared_ptr&) { +DumpResult FakeVehicleHardware::dump(const std::vector& options) { DumpResult result; - // TODO(b/201830716): Implement this. + result.callerShouldDumpState = false; + if (options.size() == 0) { + // We only want caller to dump default state when there is no options. + result.callerShouldDumpState = true; + result.buffer = dumpAllProperties(); + return result; + } + std::string option = options[0]; + if (EqualsIgnoreCase(option, "--help")) { + result.buffer = dumpHelp(); + return result; + } else if (EqualsIgnoreCase(option, "--list")) { + result.buffer = dumpListProperties(); + } else if (EqualsIgnoreCase(option, "--get")) { + result.buffer = dumpSpecificProperty(options); + } else if (EqualsIgnoreCase(option, "--set")) { + // TODO(b/214613918): Support debug set values. + } else { + result.buffer = StringPrintf("Invalid option: %s\n", option.c_str()); + } return result; } +std::string FakeVehicleHardware::dumpHelp() { + return "Usage: \n\n" + "[no args]: dumps (id and value) all supported properties \n" + "--help: shows this help\n" + "--list: lists the ids of all supported properties\n" + "--get [PROP2] [PROPN]: dumps the value of specific properties \n" + "--set [-i INT_VALUE [INT_VALUE ...]] [-i64 INT64_VALUE [INT64_VALUE ...]] " + "[-f FLOAT_VALUE [FLOAT_VALUE ...]] [-s STR_VALUE] " + "[-b BYTES_VALUE] [-a AREA_ID] : sets the value of property PROP. " + "Notice that the string, bytes and area value can be set just once, while the other can" + " have multiple values (so they're used in the respective array), " + "BYTES_VALUE is in the form of 0xXXXX, e.g. 0xdeadbeef.\n"; +} + +std::string FakeVehicleHardware::dumpAllProperties() { + auto configs = mServerSidePropStore->getAllConfigs(); + if (configs.size() == 0) { + return "no properties to dump\n"; + } + std::string msg = StringPrintf("dumping %zu properties\n", configs.size()); + int rowNumber = 1; + for (const VehiclePropConfig& config : configs) { + msg += dumpOnePropertyByConfig(rowNumber++, config); + } + return msg; +} + +std::string FakeVehicleHardware::dumpOnePropertyByConfig(int rowNumber, + const VehiclePropConfig& config) { + size_t numberAreas = config.areaConfigs.size(); + std::string msg = ""; + if (numberAreas == 0) { + msg += StringPrintf("%d: ", rowNumber); + msg += dumpOnePropertyById(config.prop, /* areaId= */ 0); + return msg; + } + for (size_t j = 0; j < numberAreas; ++j) { + if (numberAreas > 1) { + msg += StringPrintf("%d-%zu: ", rowNumber, j); + } else { + msg += StringPrintf("%d: ", rowNumber); + } + msg += dumpOnePropertyById(config.prop, config.areaConfigs[j].areaId); + } + return msg; +} + +std::string FakeVehicleHardware::dumpOnePropertyById(int32_t propId, int32_t areaId) { + VehiclePropValue value = { + .prop = propId, + .areaId = areaId, + }; + bool isSpecialValue = false; + auto result = maybeGetSpecialValue(value, &isSpecialValue); + if (!isSpecialValue) { + result = mServerSidePropStore->readValue(value); + } + if (!result.ok()) { + return StringPrintf("failed to read property value: %d, error: %s, code: %d\n", propId, + getErrorMsg(result).c_str(), getIntErrorCode(result)); + + } else { + return result.value()->toString() + "\n"; + } +} + +std::string FakeVehicleHardware::dumpListProperties() { + auto configs = mServerSidePropStore->getAllConfigs(); + if (configs.size() == 0) { + return "no properties to list\n"; + } + int rowNumber = 1; + std::string msg = StringPrintf("listing %zu properties\n", configs.size()); + for (const auto& config : configs) { + msg += StringPrintf("%d: %d\n", rowNumber++, config.prop); + } + return msg; +} + +Result FakeVehicleHardware::checkArgumentsSize(const std::vector& options, + size_t minSize) { + size_t size = options.size(); + if (size >= minSize) { + return {}; + } + return Error() << StringPrintf("Invalid number of arguments: required at least %zu, got %zu\n", + minSize, size); +} + +std::string FakeVehicleHardware::dumpSpecificProperty(const std::vector& options) { + if (auto result = checkArgumentsSize(options, /*minSize=*/2); !result.ok()) { + return getErrorMsg(result); + } + + // options[0] is the command itself... + int rowNumber = 1; + size_t size = options.size(); + std::string msg = ""; + for (size_t i = 1; i < size; ++i) { + auto propResult = safelyParseInt(i, options[i]); + if (!propResult.ok()) { + msg += getErrorMsg(propResult); + continue; + } + int32_t prop = propResult.value(); + auto result = mServerSidePropStore->getConfig(prop); + if (!result.ok()) { + msg += StringPrintf("No property %d\n", prop); + continue; + } + msg += dumpOnePropertyByConfig(rowNumber++, *result.value()); + } + return msg; +} + StatusCode FakeVehicleHardware::checkHealth() { - // TODO(b/201830716): Implement this. + // Always return OK for checkHealth. return StatusCode::OK; } 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 970d044d43..f821dfe7d9 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -52,8 +53,10 @@ using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::base::expected; +using ::android::base::StringPrintf; using ::android::base::unexpected; using ::testing::ContainerEq; +using ::testing::ContainsRegex; using ::testing::Eq; using ::testing::IsSubsetOf; using ::testing::WhenSortedBy; @@ -1203,6 +1206,82 @@ TEST_F(FakeVehicleHardwareTest, testInitialUserInfo) { })); } +TEST_F(FakeVehicleHardwareTest, testDumpAllProperties) { + std::vector options; + DumpResult result = getHardware()->dump(options); + ASSERT_TRUE(result.callerShouldDumpState); + ASSERT_NE(result.buffer, ""); + ASSERT_THAT(result.buffer, ContainsRegex("dumping .+ properties")); +} + +TEST_F(FakeVehicleHardwareTest, testDumpHelp) { + std::vector options; + options.push_back("--help"); + DumpResult result = getHardware()->dump(options); + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_NE(result.buffer, ""); + ASSERT_THAT(result.buffer, ContainsRegex("Usage: ")); +} + +TEST_F(FakeVehicleHardwareTest, testDumpListProperties) { + std::vector options; + options.push_back("--list"); + DumpResult result = getHardware()->dump(options); + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_NE(result.buffer, ""); + ASSERT_THAT(result.buffer, ContainsRegex("listing .+ properties")); +} + +TEST_F(FakeVehicleHardwareTest, testDumpSpecificProperties) { + std::vector options; + options.push_back("--get"); + std::string prop1 = std::to_string(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); + std::string prop2 = std::to_string(toInt(VehicleProperty::TIRE_PRESSURE)); + options.push_back(prop1); + options.push_back(prop2); + DumpResult result = getHardware()->dump(options); + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_NE(result.buffer, ""); + ASSERT_THAT(result.buffer, + ContainsRegex(StringPrintf("1:.*prop: %s.*\n2-0:.*prop: %s.*\n2-1:.*prop: %s.*\n", + prop1.c_str(), prop2.c_str(), prop2.c_str()))); +} + +TEST_F(FakeVehicleHardwareTest, testDumpSpecificPropertiesInvalidProp) { + std::vector options; + options.push_back("--get"); + std::string prop1 = std::to_string(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); + std::string prop2 = std::to_string(INVALID_PROP_ID); + options.push_back(prop1); + options.push_back(prop2); + DumpResult result = getHardware()->dump(options); + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_NE(result.buffer, ""); + ASSERT_THAT(result.buffer, ContainsRegex(StringPrintf("1:.*prop: %s.*\nNo property %d\n", + prop1.c_str(), INVALID_PROP_ID))); +} + +TEST_F(FakeVehicleHardwareTest, testDumpSpecificPropertiesNoArg) { + std::vector options; + options.push_back("--get"); + + // No arguments. + DumpResult result = getHardware()->dump(options); + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_NE(result.buffer, ""); + ASSERT_THAT(result.buffer, ContainsRegex("Invalid number of arguments")); +} + +TEST_F(FakeVehicleHardwareTest, testDumpInvalidOptions) { + std::vector options; + options.push_back("--invalid"); + + DumpResult result = getHardware()->dump(options); + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_NE(result.buffer, ""); + ASSERT_THAT(result.buffer, ContainsRegex("Invalid option: --invalid")); +} + } // namespace fake } // namespace vehicle } // namespace automotive diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index e3267ddc24..5e7adfca6d 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -72,6 +72,7 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve const std::vector& propIds) override; ::ndk::ScopedAStatus returnSharedMemory(const CallbackType& callback, int64_t sharedMemoryId) override; + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; IVehicleHardware* getHardware(); @@ -208,6 +209,8 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve void monitorBinderLifeCycle(const CallbackType& callback); + bool checkDumpPermission(); + template static std::shared_ptr getOrCreateClient( std::unordered_map>* clients, diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index dd8897966e..c0a66daf75 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -24,6 +24,8 @@ #include #include +#include +#include #include #include @@ -718,6 +720,39 @@ void DefaultVehicleHal::setLinkToDeathImpl(std::unique_ptr impl) { mLinkToDeathImpl = std::move(impl); } +bool DefaultVehicleHal::checkDumpPermission() { + uid_t uid = AIBinder_getCallingUid(); + return uid == AID_ROOT || uid == AID_SHELL || uid == AID_SYSTEM; +} + +binder_status_t DefaultVehicleHal::dump(int fd, const char** args, uint32_t numArgs) { + if (!checkDumpPermission()) { + dprintf(fd, "Caller must be root, system or shell"); + return STATUS_PERMISSION_DENIED; + } + + std::vector options; + for (uint32_t i = 0; i < numArgs; i++) { + options.push_back(args[i]); + } + DumpResult result = mVehicleHardware->dump(options); + dprintf(fd, "%s", (result.buffer + "\n").c_str()); + if (!result.callerShouldDumpState) { + dprintf(fd, "Skip dumping Vehicle HAL State.\n"); + return STATUS_OK; + } + dprintf(fd, "Vehicle HAL State: \n"); + { + std::scoped_lock lockGuard(mLock); + 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()); + } + return STATUS_OK; +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 566f0bdf23..7443d5bc6d 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -75,6 +76,7 @@ using ::ndk::ScopedAStatus; using ::ndk::ScopedFileDescriptor; using ::ndk::SpAIBinder; +using ::testing::ContainsRegex; using ::testing::Eq; using ::testing::UnorderedElementsAre; using ::testing::UnorderedElementsAreArray; @@ -1545,6 +1547,45 @@ TEST_F(DefaultVehicleHalTest, testOnBinderDiedUnlinked) { << "expect OnBinderDied context to be deleted when binder is unlinked"; } +TEST_F(DefaultVehicleHalTest, testDumpCallerShouldDump) { + std::string buffer = "Dump from hardware"; + getHardware()->setDumpResult({ + .callerShouldDumpState = true, + .buffer = buffer, + }); + int fd = memfd_create("memfile", 0); + getClient()->dump(fd, nullptr, 0); + + lseek(fd, 0, SEEK_SET); + char buf[10240] = {}; + read(fd, buf, sizeof(buf)); + close(fd); + + std::string msg(buf); + + ASSERT_THAT(msg, ContainsRegex(buffer + "\nVehicle HAL State: \n")); +} + +TEST_F(DefaultVehicleHalTest, testDumpCallerShouldNotDump) { + std::string buffer = "Dump from hardware"; + getHardware()->setDumpResult({ + .callerShouldDumpState = false, + .buffer = buffer, + }); + int fd = memfd_create("memfile", 0); + getClient()->dump(fd, nullptr, 0); + + lseek(fd, 0, SEEK_SET); + char buf[10240] = {}; + read(fd, buf, sizeof(buf)); + close(fd); + + std::string msg(buf); + + ASSERT_THAT(msg, ContainsRegex(buffer)); + ASSERT_EQ(msg.find("Vehicle HAL State: "), std::string::npos); +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp index eec32ddfc2..66aef7c2da 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp @@ -71,13 +71,15 @@ StatusCode MockVehicleHardware::getValues(std::shared_ptr&) { - // TODO(b/200737967): mock this. - return DumpResult{}; + return mDumpResult; } StatusCode MockVehicleHardware::checkHealth() { - // TODO(b/200737967): mock this. return StatusCode::OK; } diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h index 0844de1ab3..74d4fae337 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h @@ -79,6 +79,7 @@ class MockVehicleHardware final : public IVehicleHardware { void setStatus(const char* functionName, ::aidl::android::hardware::automotive::vehicle::StatusCode status); void setSleepTime(int64_t timeInNano); + void setDumpResult(DumpResult result); private: mutable std::mutex mLock; @@ -114,6 +115,8 @@ class MockVehicleHardware final : public IVehicleHardware { const std::vector& requests, std::list>* storedRequests, std::list>* storedResponses) const REQUIRES(mLock); + + DumpResult mDumpResult; }; } // namespace vehicle -- GitLab From 73446f49587e2bdc1b10b6ab3c2a6bd2c9092f50 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 14 Jan 2022 16:53:42 -0800 Subject: [PATCH 489/825] Support set property in dump. Support debug interface to set property value in FakeVehicleHardware. Test: atest FakeVehicleHardwareTest. Bug: 214613918 Change-Id: I64ef532274e20db1444e8583d71e0c0955c5b460 --- .../hardware/include/FakeVehicleHardware.h | 7 + .../hardware/src/FakeVehicleHardware.cpp | 205 +++++++++++++++++- .../hardware/test/FakeVehicleHardwareTest.cpp | 180 +++++++++++++++ 3 files changed, 391 insertions(+), 1 deletion(-) 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 e7010788a8..3c38025577 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -131,6 +131,7 @@ class FakeVehicleHardware final : public IVehicleHardware { std::string dumpHelp(); std::string dumpListProperties(); std::string dumpSpecificProperty(const std::vector& options); + std::string dumpSetProperties(const std::vector& options); template ::android::base::Result safelyParseInt(int index, const std::string& s) { @@ -141,6 +142,12 @@ class FakeVehicleHardware final : public IVehicleHardware { } return out; } + ::android::base::Result safelyParseFloat(int index, const std::string& s); + std::vector getOptionValues(const std::vector& options, + size_t* index); + ::android::base::Result<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> + parseSetPropOptions(const std::vector& options); + ::android::base::Result> parseHexString(const std::string& s); ::android::base::Result checkArgumentsSize(const std::vector& options, size_t minSize); 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 1f8e436b30..96607937b8 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -62,12 +63,29 @@ using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::base::EqualsIgnoreCase; using ::android::base::Error; +using ::android::base::ParseFloat; using ::android::base::Result; +using ::android::base::StartsWith; using ::android::base::StringPrintf; const char* VENDOR_OVERRIDE_DIR = "/vendor/etc/automotive/vhaloverride/"; const char* OVERRIDE_PROPERTY = "persist.vendor.vhal_init_value_override"; +// A list of supported options for "--set" command. +const std::unordered_set SET_PROP_OPTIONS = { + // integer. + "-i", + // 64bit integer. + "-i64", + // float. + "-f", + // string. + "-s", + // bytes in hex format, e.g. 0xDEADBEEF. + "-b", + // Area id in integer. + "-a"}; + } // namespace void FakeVehicleHardware::storePropInitialValue(const defaultconfig::ConfigDeclaration& config) { @@ -505,7 +523,7 @@ DumpResult FakeVehicleHardware::dump(const std::vector& options) { } else if (EqualsIgnoreCase(option, "--get")) { result.buffer = dumpSpecificProperty(options); } else if (EqualsIgnoreCase(option, "--set")) { - // TODO(b/214613918): Support debug set values. + result.buffer = dumpSetProperties(options); } else { result.buffer = StringPrintf("Invalid option: %s\n", option.c_str()); } @@ -627,6 +645,148 @@ std::string FakeVehicleHardware::dumpSpecificProperty(const std::vector FakeVehicleHardware::getOptionValues( + const std::vector& options, size_t* index) { + std::vector values; + while (*index < options.size()) { + std::string option = options[*index]; + if (SET_PROP_OPTIONS.find(option) != SET_PROP_OPTIONS.end()) { + return std::move(values); + } + values.push_back(option); + (*index)++; + } + return std::move(values); +} + +Result FakeVehicleHardware::parseSetPropOptions( + const std::vector& options) { + // Options format: + // --set PROP [-f f1 f2...] [-i i1 i2...] [-i64 i1 i2...] [-s s1 s2...] [-b b1 b2...] [-a a] + size_t optionIndex = 1; + auto result = safelyParseInt(optionIndex, options[optionIndex]); + if (!result.ok()) { + return Error() << StringPrintf("Property value: \"%s\" is not a valid int: %s\n", + options[optionIndex].c_str(), getErrorMsg(result).c_str()); + } + VehiclePropValue prop = {}; + prop.prop = result.value(); + prop.status = VehiclePropertyStatus::AVAILABLE; + optionIndex++; + std::unordered_set parsedOptions; + + while (optionIndex < options.size()) { + std::string type = options[optionIndex]; + optionIndex++; + size_t currentIndex = optionIndex; + std::vector values = getOptionValues(options, &optionIndex); + if (parsedOptions.find(type) != parsedOptions.end()) { + return Error() << StringPrintf("Duplicate \"%s\" options\n", type.c_str()); + } + parsedOptions.insert(type); + if (EqualsIgnoreCase(type, "-i")) { + if (values.size() == 0) { + return Error() << "No values specified when using \"-i\"\n"; + } + prop.value.int32Values.resize(values.size()); + for (size_t i = 0; i < values.size(); i++) { + auto int32Result = safelyParseInt(currentIndex + i, values[i]); + if (!int32Result.ok()) { + return Error() + << StringPrintf("Value: \"%s\" is not a valid int: %s\n", + values[i].c_str(), getErrorMsg(int32Result).c_str()); + } + prop.value.int32Values[i] = int32Result.value(); + } + } else if (EqualsIgnoreCase(type, "-i64")) { + if (values.size() == 0) { + return Error() << "No values specified when using \"-i64\"\n"; + } + prop.value.int64Values.resize(values.size()); + for (size_t i = 0; i < values.size(); i++) { + auto int64Result = safelyParseInt(currentIndex + i, values[i]); + if (!int64Result.ok()) { + return Error() + << StringPrintf("Value: \"%s\" is not a valid int64: %s\n", + values[i].c_str(), getErrorMsg(int64Result).c_str()); + } + prop.value.int64Values[i] = int64Result.value(); + } + } else if (EqualsIgnoreCase(type, "-f")) { + if (values.size() == 0) { + return Error() << "No values specified when using \"-f\"\n"; + } + prop.value.floatValues.resize(values.size()); + for (size_t i = 0; i < values.size(); i++) { + auto floatResult = safelyParseFloat(currentIndex + i, values[i]); + if (!floatResult.ok()) { + return Error() + << StringPrintf("Value: \"%s\" is not a valid float: %s\n", + values[i].c_str(), getErrorMsg(floatResult).c_str()); + } + prop.value.floatValues[i] = floatResult.value(); + } + } else if (EqualsIgnoreCase(type, "-s")) { + if (values.size() != 1) { + return Error() << "Expect exact one value when using \"-s\"\n"; + } + prop.value.stringValue = values[0]; + } else if (EqualsIgnoreCase(type, "-b")) { + if (values.size() != 1) { + return Error() << "Expect exact one value when using \"-b\"\n"; + } + auto bytesResult = parseHexString(values[0]); + if (!bytesResult.ok()) { + return Error() << StringPrintf("value: \"%s\" is not a valid hex string: %s\n", + values[0].c_str(), getErrorMsg(bytesResult).c_str()); + } + prop.value.byteValues = std::move(bytesResult.value()); + } else if (EqualsIgnoreCase(type, "-a")) { + if (values.size() != 1) { + return Error() << "Expect exact one value when using \"-a\"\n"; + } + auto int32Result = safelyParseInt(currentIndex, values[0]); + if (!int32Result.ok()) { + return Error() << StringPrintf("Area ID: \"%s\" is not a valid int: %s\n", + values[0].c_str(), getErrorMsg(int32Result).c_str()); + } + prop.areaId = int32Result.value(); + } else { + return Error() << StringPrintf("Unknown option: %s\n", type.c_str()); + } + } + + return prop; +} + +std::string FakeVehicleHardware::dumpSetProperties(const std::vector& options) { + if (auto result = checkArgumentsSize(options, 3); !result.ok()) { + return getErrorMsg(result); + } + + auto parseResult = parseSetPropOptions(options); + if (!parseResult.ok()) { + return getErrorMsg(parseResult); + } + VehiclePropValue prop = std::move(parseResult.value()); + ALOGD("Dump: Setting property: %s", prop.toString().c_str()); + + bool isSpecialValue = false; + auto setResult = maybeSetSpecialValue(prop, &isSpecialValue); + + if (!isSpecialValue) { + auto updatedValue = mValuePool->obtain(prop); + updatedValue->timestamp = elapsedRealtimeNano(); + setResult = mServerSidePropStore->writeValue(std::move(updatedValue)); + } + + if (setResult.ok()) { + return StringPrintf("Set property: %s\n", prop.toString().c_str()); + } + return StringPrintf("failed to set property: %s, error: %s\n", prop.toString().c_str(), + getErrorMsg(setResult).c_str()); +} + StatusCode FakeVehicleHardware::checkHealth() { // Always return OK for checkHealth. return StatusCode::OK; @@ -689,6 +849,49 @@ void FakeVehicleHardware::overrideProperties(const char* overrideDir) { } } +Result FakeVehicleHardware::safelyParseFloat(int index, const std::string& s) { + float out; + if (!ParseFloat(s, &out)) { + return Error() << StringPrintf("non-float argument at index %d: %s\n", index, s.c_str()); + } + return out; +} + +Result> FakeVehicleHardware::parseHexString(const std::string& s) { + std::vector bytes; + if (s.size() % 2 != 0) { + return Error() << StringPrintf("invalid hex string: %s, should have even size\n", + s.c_str()); + } + if (!StartsWith(s, "0x")) { + return Error() << StringPrintf("hex string should start with \"0x\", got %s\n", s.c_str()); + } + std::string subs = s.substr(2); + std::transform(subs.begin(), subs.end(), subs.begin(), + [](unsigned char c) { return std::tolower(c); }); + + bool highDigit = true; + for (size_t i = 0; i < subs.size(); i++) { + char c = subs[i]; + uint8_t v; + if (c >= '0' && c <= '9') { + v = c - '0'; + } else if (c >= 'a' && c <= 'f') { + v = c - 'a' + 10; + } else { + return Error() << StringPrintf("invalid character %c in hex string %s\n", c, + subs.c_str()); + } + if (highDigit) { + bytes.push_back(v * 16); + } else { + bytes[bytes.size() - 1] += v; + } + highDigit = !highDigit; + } + return bytes; +} + } // namespace fake } // namespace vehicle } // namespace automotive 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 f821dfe7d9..0812c2a062 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -62,6 +62,7 @@ using ::testing::IsSubsetOf; using ::testing::WhenSortedBy; constexpr int INVALID_PROP_ID = 0; +constexpr char CAR_MAKE[] = "Default Car"; } // namespace @@ -1282,6 +1283,185 @@ TEST_F(FakeVehicleHardwareTest, testDumpInvalidOptions) { ASSERT_THAT(result.buffer, ContainsRegex("Invalid option: --invalid")); } +struct SetPropTestCase { + std::string test_name; + std::vector options; + bool success; + std::string errorMsg = ""; +}; + +class FakeVehicleHardwareSetPropTest : public FakeVehicleHardwareTest, + public testing::WithParamInterface {}; + +TEST_P(FakeVehicleHardwareSetPropTest, cmdSetOneProperty) { + const SetPropTestCase& tc = GetParam(); + + DumpResult result = getHardware()->dump(tc.options); + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_NE(result.buffer, ""); + if (tc.success) { + ASSERT_THAT(result.buffer, ContainsRegex("Set property:")); + } else { + ASSERT_THAT(result.buffer, ContainsRegex(tc.errorMsg)); + } +} + +std::vector GenSetPropParams() { + std::string infoMakeProperty = std::to_string(toInt(VehicleProperty::INFO_MAKE)); + return { + {"success_set_string", {"--set", infoMakeProperty, "-s", CAR_MAKE}, true}, + {"success_set_bytes", {"--set", infoMakeProperty, "-b", "0xdeadbeef"}, true}, + {"success_set_bytes_caps", {"--set", infoMakeProperty, "-b", "0xDEADBEEF"}, true}, + {"success_set_int", {"--set", infoMakeProperty, "-i", "2147483647"}, true}, + {"success_set_ints", + {"--set", infoMakeProperty, "-i", "2147483647", "0", "-2147483648"}, + true}, + {"success_set_int64", + {"--set", infoMakeProperty, "-i64", "-9223372036854775808"}, + true}, + {"success_set_int64s", + {"--set", infoMakeProperty, "-i64", "-9223372036854775808", "0", + "9223372036854775807"}, + true}, + {"success_set_float", {"--set", infoMakeProperty, "-f", "1.175494351E-38"}, true}, + {"success_set_floats", + {"--set", infoMakeProperty, "-f", "-3.402823466E+38", "0", "3.402823466E+38"}, + true}, + {"success_set_area", {"--set", infoMakeProperty, "-a", "2147483647"}, true}, + {"fail_no_options", {"--set", infoMakeProperty}, false, "Invalid number of arguments"}, + {"fail_less_than_4_options", + {"--set", infoMakeProperty, "-i"}, + false, + "No values specified"}, + {"fail_unknown_options", {"--set", infoMakeProperty, "-abcd"}, false, "Unknown option"}, + {"fail_invalid_property", + {"--set", "not valid", "-s", CAR_MAKE}, + false, + "not a valid int"}, + {"fail_duplicate_string", + {"--set", infoMakeProperty, "-s", CAR_MAKE, "-s", CAR_MAKE}, + false, + "Duplicate \"-s\" options"}, + {"fail_multiple_strings", + {"--set", infoMakeProperty, "-s", CAR_MAKE, CAR_MAKE}, + false, + "Expect exact one value"}, + {"fail_no_string_value", + {"--set", infoMakeProperty, "-s", "-a", "1234"}, + false, + "Expect exact one value"}, + {"fail_duplicate_bytes", + {"--set", infoMakeProperty, "-b", "0xdeadbeef", "-b", "0xdeadbeef"}, + false, + "Duplicate \"-b\" options"}, + {"fail_multiple_bytes", + {"--set", infoMakeProperty, "-b", "0xdeadbeef", "0xdeadbeef"}, + false, + "Expect exact one value"}, + {"fail_invalid_bytes", + {"--set", infoMakeProperty, "-b", "0xgood"}, + false, + "not a valid hex string"}, + {"fail_invalid_bytes_no_prefix", + {"--set", infoMakeProperty, "-b", "deadbeef"}, + false, + "not a valid hex string"}, + {"fail_invalid_int", + {"--set", infoMakeProperty, "-i", "abc"}, + false, + "not a valid int"}, + {"fail_int_out_of_range", + {"--set", infoMakeProperty, "-i", "2147483648"}, + false, + "not a valid int"}, + {"fail_no_int_value", + {"--set", infoMakeProperty, "-i", "-s", CAR_MAKE}, + false, + "No values specified"}, + {"fail_invalid_int64", + {"--set", infoMakeProperty, "-i64", "abc"}, + false, + "not a valid int64"}, + {"fail_int64_out_of_range", + {"--set", infoMakeProperty, "-i64", "-9223372036854775809"}, + false, + "not a valid int64"}, + {"fail_no_int64_value", + {"--set", infoMakeProperty, "-i64", "-s", CAR_MAKE}, + false, + "No values specified"}, + {"fail_invalid_float", + {"--set", infoMakeProperty, "-f", "abc"}, + false, + "not a valid float"}, + {"fail_float_out_of_range", + {"--set", infoMakeProperty, "-f", "-3.402823466E+39"}, + false, + "not a valid float"}, + {"fail_no_float_value", + {"--set", infoMakeProperty, "-f", "-s", CAR_MAKE}, + false, + "No values specified"}, + {"fail_multiple_areas", + {"--set", infoMakeProperty, "-a", "2147483648", "0"}, + false, + "Expect exact one value"}, + {"fail_invalid_area", + {"--set", infoMakeProperty, "-a", "abc"}, + false, + "not a valid int"}, + {"fail_area_out_of_range", + {"--set", infoMakeProperty, "-a", "2147483648"}, + false, + "not a valid int"}, + {"fail_no_area_value", + {"--set", infoMakeProperty, "-a", "-s", CAR_MAKE}, + false, + "Expect exact one value"}, + }; +} + +INSTANTIATE_TEST_SUITE_P( + FakeVehicleHardwareSetPropTests, FakeVehicleHardwareSetPropTest, + testing::ValuesIn(GenSetPropParams()), + [](const testing::TestParamInfo& info) { + return info.param.test_name; + }); + +TEST_F(FakeVehicleHardwareTest, SetComplexPropTest) { + std::string infoMakeProperty = std::to_string(toInt(VehicleProperty::INFO_MAKE)); + getHardware()->dump({"--set", infoMakeProperty, "-s", CAR_MAKE, + "-b", "0xdeadbeef", "-i", "2147483647", + "0", "-2147483648", "-i64", "-9223372036854775808", + "0", "9223372036854775807", "-f", "-3.402823466E+38", + "0", "3.402823466E+38", "-a", "123"}); + VehiclePropValue requestProp; + requestProp.prop = toInt(VehicleProperty::INFO_MAKE); + requestProp.areaId = 123; + auto result = getValue(requestProp); + ASSERT_TRUE(result.ok()); + VehiclePropValue value = result.value(); + ASSERT_EQ(value.prop, toInt(VehicleProperty::INFO_MAKE)); + ASSERT_EQ(value.areaId, 123); + ASSERT_STREQ(CAR_MAKE, value.value.stringValue.c_str()); + uint8_t bytes[] = {0xde, 0xad, 0xbe, 0xef}; + ASSERT_FALSE(memcmp(bytes, value.value.byteValues.data(), sizeof(bytes))); + ASSERT_EQ(3u, value.value.int32Values.size()); + ASSERT_EQ(2147483647, value.value.int32Values[0]); + ASSERT_EQ(0, value.value.int32Values[1]); + ASSERT_EQ(-2147483648, value.value.int32Values[2]); + ASSERT_EQ(3u, value.value.int64Values.size()); + // -9223372036854775808 is not a valid literal since '-' and '9223372036854775808' would be two + // tokens and the later does not fit in unsigned long long. + ASSERT_EQ(-9223372036854775807 - 1, value.value.int64Values[0]); + ASSERT_EQ(0, value.value.int64Values[1]); + ASSERT_EQ(9223372036854775807, value.value.int64Values[2]); + ASSERT_EQ(3u, value.value.floatValues.size()); + ASSERT_EQ(-3.402823466E+38f, value.value.floatValues[0]); + ASSERT_EQ(0.0f, value.value.floatValues[1]); + ASSERT_EQ(3.402823466E+38f, value.value.floatValues[2]); +} + } // namespace fake } // namespace vehicle } // namespace automotive -- GitLab From 6cd2fd7e5f159dab6788bef1ee0726f495f3676e Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 19 Jan 2022 15:05:31 -0800 Subject: [PATCH 490/825] Move VehicleHalProto out from vhal_v2_0. VehicleHalProto would be used by AIDL Vhal as well so move it to a common place. Test: Presubmit Bug: 215419573 Change-Id: I1e886a64a6c5ef76f7dc918feccc9cf63b8bca0c --- .../vhal_v2_0/proto/VehicleHalProto.proto | 110 ------------------ .../hardware/include/FakeVehicleHardware.h | 10 +- .../impl/vhal_v2_0 => }/proto/Android.bp | 4 +- .../vehicle/proto/VehicleHalProto.proto | 110 ++++++++++++++++++ 4 files changed, 118 insertions(+), 116 deletions(-) delete mode 100644 automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/VehicleHalProto.proto rename automotive/vehicle/{2.0/default/impl/vhal_v2_0 => }/proto/Android.bp (94%) create mode 100644 automotive/vehicle/proto/VehicleHalProto.proto diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/VehicleHalProto.proto b/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/VehicleHalProto.proto deleted file mode 100644 index 58daca619c..0000000000 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/VehicleHalProto.proto +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 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. - */ - -syntax = "proto2"; - -package vhal_proto; - -// CMD messages are from workstation --> VHAL -// RESP messages are from VHAL --> workstation -enum MsgType { - GET_CONFIG_CMD = 0; - GET_CONFIG_RESP = 1; - GET_CONFIG_ALL_CMD = 2; - GET_CONFIG_ALL_RESP = 3; - GET_PROPERTY_CMD = 4; - GET_PROPERTY_RESP = 5; - GET_PROPERTY_ALL_CMD = 6; - GET_PROPERTY_ALL_RESP = 7; - SET_PROPERTY_CMD = 8; - SET_PROPERTY_RESP = 9; - SET_PROPERTY_ASYNC = 10; - DEBUG_CMD = 11; - DEBUG_RESP = 12; -} -enum Status { - RESULT_OK = 0; - ERROR_UNKNOWN = 1; - ERROR_UNIMPLEMENTED_CMD = 2; - ERROR_INVALID_PROPERTY = 3; - ERROR_INVALID_AREA_ID = 4; - ERROR_PROPERTY_UNINITIALIZED = 5; - ERROR_WRITE_ONLY_PROPERTY = 6; - ERROR_MEMORY_ALLOC_FAILED = 7; - ERROR_INVALID_OPERATION = 8; -} - -enum VehiclePropStatus { - AVAILABLE = 0; - UNAVAILABLE = 1; - ERROR = 2; -} - -message VehicleAreaConfig { - required int32 area_id = 1; - optional sint32 min_int32_value = 2; - optional sint32 max_int32_value = 3; - optional sint64 min_int64_value = 4; - optional sint64 max_int64_value = 5; - optional float min_float_value = 6; - optional float max_float_value = 7; -} - -message VehiclePropConfig { - required int32 prop = 1; - optional int32 access = 2; - optional int32 change_mode = 3; - optional int32 value_type = 4; - optional int32 supported_areas = 5; // Deprecated - DO NOT USE - repeated VehicleAreaConfig area_configs = 6; - optional int32 config_flags = 7; - repeated int32 config_array = 8; - optional string config_string = 9; - optional float min_sample_rate = 10; - optional float max_sample_rate = 11; -}; - -message VehiclePropValue { - // common data - required int32 prop = 1; - optional int32 value_type = 2; - optional int64 timestamp = 3; // required for valid data from HAL, skipped for set - optional VehiclePropStatus status = 10; // required for valid data from HAL, skipped for set - - // values - optional int32 area_id = 4; - repeated sint32 int32_values = 5; // this also covers boolean value. - repeated sint64 int64_values = 6; - repeated float float_values = 7; - optional string string_value = 8; - optional bytes bytes_value = 9; -}; - -// This structure is used to notify what values to get from the Vehicle HAL -message VehiclePropGet { - required int32 prop = 1; - optional int32 area_id = 2; -}; - -message EmulatorMessage { - required MsgType msg_type = 1; - optional Status status = 2; // Only for RESP messages - repeated VehiclePropGet prop = 3; // Provided for getConfig, getProperty commands - repeated VehiclePropConfig config = 4; - repeated VehiclePropValue value = 5; - repeated string debug_commands = 6; // Required for debug command - optional string debug_result = 7; // Required for debug RESP messages -}; 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 3c38025577..1c452710d8 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -39,7 +39,7 @@ namespace automotive { namespace vehicle { namespace fake { -class FakeVehicleHardware final : public IVehicleHardware { +class FakeVehicleHardware : public IVehicleHardware { public: FakeVehicleHardware(); @@ -80,13 +80,15 @@ class FakeVehicleHardware final : public IVehicleHardware { void registerOnPropertySetErrorEvent( std::unique_ptr callback) override; + protected: + // mValuePool is also used in mServerSidePropStore. + const std::shared_ptr mValuePool; + const std::shared_ptr mServerSidePropStore; + private: // Expose private methods to unit test. friend class FakeVehicleHardwareTestHelper; - // mValuePool is also used in mServerSidePropStore. - const std::shared_ptr mValuePool; - const std::shared_ptr mServerSidePropStore; const std::unique_ptr mFakeObd2Frame; const std::unique_ptr mFakeUserHal; std::mutex mCallbackLock; diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/Android.bp b/automotive/vehicle/proto/Android.bp similarity index 94% rename from automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/Android.bp rename to automotive/vehicle/proto/Android.bp index 3307bd62a3..683f1281c4 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/Android.bp +++ b/automotive/vehicle/proto/Android.bp @@ -25,8 +25,8 @@ package { cc_library_static { name: "android.hardware.automotive.vehicle@2.0-libproto-native", visibility: [ - "//hardware/interfaces/automotive/vehicle/2.0/default:__subpackages__", - "//device/generic/car/emulator/vhal_v2_0:__subpackages__", + "//hardware/interfaces/automotive/vehicle:__subpackages__", + "//device/generic/car/emulator:__subpackages__", ], vendor: true, host_supported: true, diff --git a/automotive/vehicle/proto/VehicleHalProto.proto b/automotive/vehicle/proto/VehicleHalProto.proto new file mode 100644 index 0000000000..0dafe8c4a6 --- /dev/null +++ b/automotive/vehicle/proto/VehicleHalProto.proto @@ -0,0 +1,110 @@ +/* + * Copyright (C) 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. + */ + +syntax = "proto2"; + +package vhal_proto; + +// CMD messages are from workstation --> VHAL +// RESP messages are from VHAL --> workstation +enum MsgType { + GET_CONFIG_CMD = 0; + GET_CONFIG_RESP = 1; + GET_CONFIG_ALL_CMD = 2; + GET_CONFIG_ALL_RESP = 3; + GET_PROPERTY_CMD = 4; + GET_PROPERTY_RESP = 5; + GET_PROPERTY_ALL_CMD = 6; + GET_PROPERTY_ALL_RESP = 7; + SET_PROPERTY_CMD = 8; + SET_PROPERTY_RESP = 9; + SET_PROPERTY_ASYNC = 10; + DEBUG_CMD = 11; + DEBUG_RESP = 12; +} +enum Status { + RESULT_OK = 0; + ERROR_UNKNOWN = 1; + ERROR_UNIMPLEMENTED_CMD = 2; + ERROR_INVALID_PROPERTY = 3; + ERROR_INVALID_AREA_ID = 4; + ERROR_PROPERTY_UNINITIALIZED = 5; + ERROR_WRITE_ONLY_PROPERTY = 6; + ERROR_MEMORY_ALLOC_FAILED = 7; + ERROR_INVALID_OPERATION = 8; +} + +enum VehiclePropStatus { + AVAILABLE = 0; + UNAVAILABLE = 1; + ERROR = 2; +} + +message VehicleAreaConfig { + required int32 area_id = 1; + optional sint32 min_int32_value = 2; + optional sint32 max_int32_value = 3; + optional sint64 min_int64_value = 4; + optional sint64 max_int64_value = 5; + optional float min_float_value = 6; + optional float max_float_value = 7; +} + +message VehiclePropConfig { + required int32 prop = 1; + optional int32 access = 2; + optional int32 change_mode = 3; + optional int32 value_type = 4; + optional int32 supported_areas = 5; // Deprecated - DO NOT USE + repeated VehicleAreaConfig area_configs = 6; + optional int32 config_flags = 7; + repeated int32 config_array = 8; + optional string config_string = 9; + optional float min_sample_rate = 10; + optional float max_sample_rate = 11; +}; + +message VehiclePropValue { + // common data + required int32 prop = 1; + optional int32 value_type = 2; + optional int64 timestamp = 3; // required for valid data from HAL, skipped for set + optional VehiclePropStatus status = 10; // required for valid data from HAL, skipped for set + + // values + optional int32 area_id = 4; + repeated sint32 int32_values = 5; // this also covers boolean value. + repeated sint64 int64_values = 6; + repeated float float_values = 7; + optional string string_value = 8; + optional bytes bytes_value = 9; +}; + +// This structure is used to notify what values to get from the Vehicle HAL +message VehiclePropGet { + required int32 prop = 1; + optional int32 area_id = 2; +}; + +message EmulatorMessage { + required MsgType msg_type = 1; + optional Status status = 2; // Only for RESP messages + repeated VehiclePropGet prop = 3; // Provided for getConfig, getProperty commands + repeated VehiclePropConfig config = 4; + repeated VehiclePropValue value = 5; + repeated string debug_commands = 6; // Required for debug command + optional string debug_result = 7; // Required for debug RESP messages +}; -- GitLab From 92ee56024e74e41310aca219bc25fb95b8eb65cc Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 19 Jan 2022 18:29:56 -0800 Subject: [PATCH 491/825] Add some helper functions for Emulator. Add some helper function for EmulatedVehicleHardware to use. Test: atest FakeVehicleHardwareTest Bug: 215419573 Change-Id: I64da5a0eae3872c608da925d68756a823299672c --- .../hardware/include/FakeVehicleHardware.h | 6 + .../hardware/src/FakeVehicleHardware.cpp | 122 ++++++++++-------- 2 files changed, 76 insertions(+), 52 deletions(-) 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 1c452710d8..578d045376 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -85,6 +85,12 @@ class FakeVehicleHardware : public IVehicleHardware { const std::shared_ptr mValuePool; const std::shared_ptr mServerSidePropStore; + ::android::base::Result getValue( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; + + ::android::base::Result setValue( + const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + private: // Expose private methods to unit test. friend class FakeVehicleHardwareTestHelper; 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 96607937b8..097257e3c0 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -405,7 +405,6 @@ Result FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValue& v StatusCode FakeVehicleHardware::setValues(std::shared_ptr callback, const std::vector& requests) { - std::vector updatedValues; std::vector results; for (auto& request : requests) { const VehiclePropValue& value = request.value; @@ -417,34 +416,15 @@ StatusCode FakeVehicleHardware::setValues(std::shared_ptrobtain(value); - int64_t timestamp = elapsedRealtimeNano(); - updatedValue->timestamp = timestamp; - - auto writeResult = mServerSidePropStore->writeValue(std::move(updatedValue)); - if (!writeResult.ok()) { - ALOGE("failed to write value into property store, error: %s, code: %d", - getErrorMsg(writeResult).c_str(), getIntErrorCode(writeResult)); - setValueResult.status = getErrorCode(writeResult); - } results.push_back(std::move(setValueResult)); } @@ -455,6 +435,33 @@ StatusCode FakeVehicleHardware::setValues(std::shared_ptr FakeVehicleHardware::setValue(const VehiclePropValue& value) { + bool isSpecialValue = false; + auto setSpecialValueResult = maybeSetSpecialValue(value, &isSpecialValue); + + if (isSpecialValue) { + if (!setSpecialValueResult.ok()) { + return Error(getIntErrorCode(setSpecialValueResult)) + << StringPrintf("failed to set special value for property ID: %d, error: %s", + value.prop, getErrorMsg(setSpecialValueResult).c_str()); + } + return {}; + } + + auto updatedValue = mValuePool->obtain(value); + int64_t timestamp = elapsedRealtimeNano(); + updatedValue->timestamp = timestamp; + + auto writeResult = mServerSidePropStore->writeValue(std::move(updatedValue)); + if (!writeResult.ok()) { + return Error(getIntErrorCode(writeResult)) + << StringPrintf("failed to write value into property store, error: %s", + getErrorMsg(writeResult).c_str()); + } + + return {}; +} + StatusCode FakeVehicleHardware::getValues(std::shared_ptr callback, const std::vector& requests) const { std::vector results; @@ -467,44 +474,55 @@ StatusCode FakeVehicleHardware::getValues(std::shared_ptrreadValue(value); - if (!readResult.ok()) { - StatusCode errorCode = getErrorCode(readResult); - if (errorCode == StatusCode::NOT_AVAILABLE) { - ALOGW("%s", "value has not been set yet"); - } else { - ALOGE("failed to get value, error: %s, code: %d", getErrorMsg(readResult).c_str(), - toInt(errorCode)); - } - getValueResult.status = errorCode; + auto result = getValue(value); + if (!result.ok()) { + ALOGE("failed to get value, error: %s, code: %d", getErrorMsg(result).c_str(), + getIntErrorCode(result)); + getValueResult.status = getErrorCode(result); } else { getValueResult.status = StatusCode::OK; - getValueResult.prop = *readResult.value(); + getValueResult.prop = *result.value(); } results.push_back(std::move(getValueResult)); } + // In a real VHAL implementation, getValue would be async and we would call the callback after + // we actually received the values from vehicle bus. Here we are getting the result + // synchronously so we could call the callback here. (*callback)(std::move(results)); return StatusCode::OK; } +Result FakeVehicleHardware::getValue( + const VehiclePropValue& value) const { + bool isSpecialValue = false; + auto result = maybeGetSpecialValue(value, &isSpecialValue); + if (isSpecialValue) { + if (!result.ok()) { + return Error(getIntErrorCode(result)) + << StringPrintf("failed to get special value: %d, error: %s", value.prop, + getErrorMsg(result).c_str()); + } else { + return std::move(result); + } + } + + auto readResult = mServerSidePropStore->readValue(value); + if (!readResult.ok()) { + StatusCode errorCode = getErrorCode(readResult); + if (errorCode == StatusCode::NOT_AVAILABLE) { + return Error(toInt(errorCode)) << "value has not been set yet"; + } else { + return Error(toInt(errorCode)) + << "failed to get value, error: " << getErrorMsg(readResult); + } + } + + return std::move(readResult); +} + DumpResult FakeVehicleHardware::dump(const std::vector& options) { DumpResult result; result.callerShouldDumpState = false; -- GitLab From e745058f702b4ca65b9d7aa394596a285d183db2 Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Mon, 27 Dec 2021 03:42:19 -0800 Subject: [PATCH 492/825] Add fields to infer UsbPortStatus and allow enabling usb while docked Adding two fields to UsbPortStatus to infer the following: a. usbDataStatus: To infer the current USB data status of the port. b. powerBrickStatus: To infer whether a power brick is connected to the USB port. The change also adds a new method, enableUsbDataWhileDocked to allow enabling Usb port while being docked. Bug: 211677613 Signed-off-by: Badhri Jagan Sridharan Change-Id: I4fb352679a52326bf4b0fc5aa3d218a0f34cecdb --- .../current/android/hardware/usb/IUsb.aidl | 1 + .../android/hardware/usb/IUsbCallback.aidl | 1 + .../android/hardware/usb/PortStatus.aidl | 3 +- .../hardware/usb/PowerBrickStatus.aidl | 40 +++++++++++++++ .../android/hardware/usb/UsbDataStatus.aidl | 44 +++++++++++++++++ usb/aidl/android/hardware/usb/IUsb.aidl | 9 ++++ .../android/hardware/usb/IUsbCallback.aidl | 10 ++++ usb/aidl/android/hardware/usb/PortStatus.aidl | 9 +++- .../hardware/usb/PowerBrickStatus.aidl | 33 +++++++++++++ .../android/hardware/usb/UsbDataStatus.aidl | 49 +++++++++++++++++++ usb/aidl/default/Usb.cpp | 18 ++++++- usb/aidl/default/Usb.h | 2 + 12 files changed, 216 insertions(+), 3 deletions(-) create mode 100644 usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PowerBrickStatus.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/UsbDataStatus.aidl create mode 100644 usb/aidl/android/hardware/usb/PowerBrickStatus.aidl create mode 100644 usb/aidl/android/hardware/usb/UsbDataStatus.aidl diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl index 73c7b825e2..4ba9ff8dff 100644 --- a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl @@ -36,6 +36,7 @@ package android.hardware.usb; interface IUsb { oneway void enableContaminantPresenceDetection(in String portName, in boolean enable, long transactionId); oneway void enableUsbData(in String portName, boolean enable, long transactionId); + oneway void enableUsbDataWhileDocked(in String portName, long transactionId); oneway void queryPortStatus(long transactionId); oneway void setCallback(in android.hardware.usb.IUsbCallback callback); oneway void switchRole(in String portName, in android.hardware.usb.PortRole role, long transactionId); diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl index 85861e9d41..57f02c548c 100644 --- a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl @@ -37,6 +37,7 @@ interface IUsbCallback { oneway void notifyPortStatusChange(in android.hardware.usb.PortStatus[] currentPortStatus, in android.hardware.usb.Status retval); oneway void notifyRoleSwitchStatus(in String portName, in android.hardware.usb.PortRole newRole, in android.hardware.usb.Status retval, long transactionId); oneway void notifyEnableUsbDataStatus(in String portName, boolean enable, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyEnableUsbDataWhileDockedStatus(in String portName, in android.hardware.usb.Status retval, long transactionId); oneway void notifyContaminantEnabledStatus(in String portName, boolean enable, in android.hardware.usb.Status retval, long transactionId); oneway void notifyQueryPortStatus(in String portName, in android.hardware.usb.Status retval, long transactionId); oneway void notifyLimitPowerTransferStatus(in String portName, boolean limit, in android.hardware.usb.Status retval, long transactionId); diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl index 14bb90fd15..dfd99fb249 100644 --- a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PortStatus.aidl @@ -47,6 +47,7 @@ parcelable PortStatus { android.hardware.usb.ContaminantProtectionStatus contaminantProtectionStatus = android.hardware.usb.ContaminantProtectionStatus.NONE; boolean supportsEnableContaminantPresenceDetection; android.hardware.usb.ContaminantDetectionStatus contaminantDetectionStatus = android.hardware.usb.ContaminantDetectionStatus.NOT_SUPPORTED; - boolean usbDataEnabled; + android.hardware.usb.UsbDataStatus[] usbDataStatus; boolean powerTransferLimited; + android.hardware.usb.PowerBrickStatus powerBrickStatus; } diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PowerBrickStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PowerBrickStatus.aidl new file mode 100644 index 0000000000..01d2fdd9f7 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/PowerBrickStatus.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 -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.usb; +@VintfStability +enum PowerBrickStatus { + UNKNOWN = 0, + CONNECTED = 1, + NOT_CONNECTED = 2, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/UsbDataStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/UsbDataStatus.aidl new file mode 100644 index 0000000000..e2c0cfbef1 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/UsbDataStatus.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 -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.usb; +@VintfStability +enum UsbDataStatus { + UNKNOWN = 0, + ENABLED = 1, + DISABLED_OVERHEAT = 2, + DISABLED_CONTAMINANT = 3, + DISABLED_DOCK = 4, + DISABLED_FORCE = 5, + DISABLED_DEBUG = 6, +} diff --git a/usb/aidl/android/hardware/usb/IUsb.aidl b/usb/aidl/android/hardware/usb/IUsb.aidl index 1596d9ada5..d296fbb209 100644 --- a/usb/aidl/android/hardware/usb/IUsb.aidl +++ b/usb/aidl/android/hardware/usb/IUsb.aidl @@ -48,6 +48,15 @@ oneway interface IUsb { */ void enableUsbData(in String portName, boolean enable, long transactionId); + /** + * This function is used to enable USB controller if and when the controller + * disabled due to docking event. + * + * @param portName Name of the port. + * @param transactionId ID to be used when invoking the callback. + */ + void enableUsbDataWhileDocked(in String portName, long transactionId); + /** * This functions is used to request the hal for the current status * status of the Type-C ports. The result of the query would be sent diff --git a/usb/aidl/android/hardware/usb/IUsbCallback.aidl b/usb/aidl/android/hardware/usb/IUsbCallback.aidl index b733fede3b..e33672aa2b 100644 --- a/usb/aidl/android/hardware/usb/IUsbCallback.aidl +++ b/usb/aidl/android/hardware/usb/IUsbCallback.aidl @@ -62,6 +62,16 @@ oneway interface IUsbCallback { void notifyEnableUsbDataStatus(in String portName, boolean enable, in Status retval, long transactionId); + /** + * Used to notify the result of enableUsbDataWhileDocked call to the caller. + * + * @param portName name of the port for which the enableUsbDataWhileDocked is requested. + * @param retval SUCCESS if current request succeeded. FAILURE otherwise. + * @param transactionId transactionId sent during enableUsbDataWhileDocked request. + */ + void notifyEnableUsbDataWhileDockedStatus(in String portName, in Status retval, + long transactionId); + /** * Used to notify the result of enableContaminantPresenceDetection. * diff --git a/usb/aidl/android/hardware/usb/PortStatus.aidl b/usb/aidl/android/hardware/usb/PortStatus.aidl index fb979e5f62..51bee71389 100644 --- a/usb/aidl/android/hardware/usb/PortStatus.aidl +++ b/usb/aidl/android/hardware/usb/PortStatus.aidl @@ -22,6 +22,8 @@ import android.hardware.usb.ContaminantProtectionStatus; import android.hardware.usb.PortDataRole; import android.hardware.usb.PortMode; import android.hardware.usb.PortPowerRole; +import android.hardware.usb.PowerBrickStatus; +import android.hardware.usb.UsbDataStatus; @VintfStability parcelable PortStatus { @@ -102,10 +104,15 @@ parcelable PortStatus { ContaminantDetectionStatus contaminantDetectionStatus = ContaminantDetectionStatus.NOT_SUPPORTED; /** * UsbData status of the port. + * Lists reasons for USB data being disabled. */ - boolean usbDataEnabled; + UsbDataStatus[] usbDataStatus; /** * Denoted whether power transfer is limited in the port. */ boolean powerTransferLimited; + /** + * Denotes whether Power brick is connected. + */ + PowerBrickStatus powerBrickStatus; } diff --git a/usb/aidl/android/hardware/usb/PowerBrickStatus.aidl b/usb/aidl/android/hardware/usb/PowerBrickStatus.aidl new file mode 100644 index 0000000000..620fb25922 --- /dev/null +++ b/usb/aidl/android/hardware/usb/PowerBrickStatus.aidl @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package android.hardware.usb; + +@VintfStability +enum PowerBrickStatus { + /** + * Status not known. + */ + UNKNOWN = 0, + /** + * Port partner is power brick. + */ + CONNECTED = 1, + /** + * Port partner is not power brick. + */ + NOT_CONNECTED = 2, +} diff --git a/usb/aidl/android/hardware/usb/UsbDataStatus.aidl b/usb/aidl/android/hardware/usb/UsbDataStatus.aidl new file mode 100644 index 0000000000..4b6a41a01e --- /dev/null +++ b/usb/aidl/android/hardware/usb/UsbDataStatus.aidl @@ -0,0 +1,49 @@ +/* + * 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. + */ + +package android.hardware.usb; + +@VintfStability +enum UsbDataStatus { + /** + * USB data status not known. + */ + UNKNOWN = 0, + /** + * USB data is enabled. + */ + ENABLED = 1, + /** + * USB data is disabled as the port is hot. + */ + DISABLED_OVERHEAT = 2, + /** + * USB data is disabled as port is contaminated. + */ + DISABLED_CONTAMINANT = 3, + /** + * USB data is disabled due to dock. + */ + DISABLED_DOCK = 4, + /** + * USB data is disabled by USB Service. + */ + DISABLED_FORCE = 5, + /** + * USB data disabled for debug. + */ + DISABLED_DEBUG = 6 +} diff --git a/usb/aidl/default/Usb.cpp b/usb/aidl/default/Usb.cpp index 0624963883..92b09a2b44 100644 --- a/usb/aidl/default/Usb.cpp +++ b/usb/aidl/default/Usb.cpp @@ -74,6 +74,22 @@ ScopedAStatus Usb::enableUsbData(const string& in_portName, bool in_enable, int6 return ScopedAStatus::ok(); } +ScopedAStatus Usb::enableUsbDataWhileDocked(const string& in_portName, int64_t in_transactionId) { + + pthread_mutex_lock(&mLock); + if (mCallback != NULL) { + ScopedAStatus ret = mCallback->notifyEnableUsbDataWhileDockedStatus( + in_portName, Status::NOT_SUPPORTED, in_transactionId); + if (!ret.isOk()) + ALOGE("notifyEnableUsbDataWhileDockedStatus error %s", ret.getDescription().c_str()); + } else { + ALOGE("Not notifying the userspace. Callback is not set"); + } + pthread_mutex_unlock(&mLock); + + return ScopedAStatus::ok(); +} + Status queryMoistureDetectionStatus(std::vector *currentPortStatus) { string enabled, status, path, DetectedPath; @@ -473,7 +489,7 @@ Status getPortStatusHelper(std::vector *currentPortStatus) { port.second ? canSwitchRoleHelper(port.first) : false; (*currentPortStatus)[i].supportedModes.push_back(PortMode::DRP); - (*currentPortStatus)[i].usbDataEnabled = true; + (*currentPortStatus)[i].usbDataStatus.push_back(UsbDataStatus::ENABLED); ALOGI("%d:%s connected:%d canChangeMode:%d canChagedata:%d canChangePower:%d " "usbDataEnabled:%d", diff --git a/usb/aidl/default/Usb.h b/usb/aidl/default/Usb.h index 71ec938a56..7e8422e39b 100644 --- a/usb/aidl/default/Usb.h +++ b/usb/aidl/default/Usb.h @@ -54,6 +54,8 @@ struct Usb : public BnUsb { int64_t in_transactionId) override; ScopedAStatus enableUsbData(const string& in_portName, bool in_enable, int64_t in_transactionId) override; + ScopedAStatus enableUsbDataWhileDocked(const string& in_portName, + int64_t in_transactionId) override; ScopedAStatus limitPowerTransfer(const std::string& in_portName, bool in_limit, int64_t in_transactionId)override; -- GitLab From f883235915244d50bdbe59fa6317ed71094a3fe9 Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Sun, 23 Jan 2022 09:17:04 -0800 Subject: [PATCH 493/825] Add Vts test for enableUsbDataWhileDocked interface The test validates that transactionId passed by the callback matches the requeest transactionId. Bug: 211677613 Change-Id: I79e58502edfb36c30e42bcde8a79525a6046c859 --- usb/aidl/vts/VtsAidlUsbTargetTest.cpp | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/usb/aidl/vts/VtsAidlUsbTargetTest.cpp b/usb/aidl/vts/VtsAidlUsbTargetTest.cpp index bab5a3af59..ed3bd6e7db 100644 --- a/usb/aidl/vts/VtsAidlUsbTargetTest.cpp +++ b/usb/aidl/vts/VtsAidlUsbTargetTest.cpp @@ -112,6 +112,17 @@ class UsbAidlTest : public testing::TestWithParam { return ScopedAStatus::ok(); } + // Callback method for the status of enableUsbData operation + ScopedAStatus notifyEnableUsbDataWhileDockedStatus(const string& /*portName*/, + Status /*retval*/, + int64_t transactionId) override { + parent_.last_transactionId = transactionId; + parent_.usb_last_cookie = cookie; + parent_.enable_usb_data_while_docked_done = true; + parent_.notify(); + return ScopedAStatus::ok(); + } + // Callback method for the status of enableContaminantPresenceDetection ScopedAStatus notifyContaminantEnabledStatus(const string& /*portName*/, bool /*enable*/, Status /*retval*/, int64_t transactionId) override { @@ -206,6 +217,9 @@ class UsbAidlTest : public testing::TestWithParam { // Flag to indicate the invocation of notifyEnableUsbDataStatus callback. bool enable_usb_data_done; + // Flag to indicate the invocation of notifyEnableUsbDataWhileDockedStatus callback. + bool enable_usb_data_while_docked_done; + // Flag to indicate the invocation of notifyLimitPowerTransferStatus callback. bool limit_power_transfer_done; @@ -423,6 +437,42 @@ TEST_P(UsbAidlTest, enableUsbData) { ALOGI("UsbAidlTest enableUsbData end"); } +/* + * Test enabling Usb data while being docked. + * Test case queries the usb ports present in device. + * If there is at least one usb port, enabling Usb data while docked + * is attempted for the port. + * The callback parameters are checked to see if transaction id + * matches. + */ +TEST_P(UsbAidlTest, enableUsbDataWhileDocked) { + ALOGI("UsbAidlTest enableUsbDataWhileDocked start"); + int64_t transactionId = rand() % 10000; + const auto& ret = usb->queryPortStatus(transactionId); + ASSERT_TRUE(ret.isOk()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + + if (!usb_last_port_status.portName.empty()) { + ALOGI("portname:%s", usb_last_port_status.portName.c_str()); + enable_usb_data_while_docked_done = false; + transactionId = rand() % 10000; + const auto& ret = usb->enableUsbDataWhileDocked(usb_last_port_status.portName, transactionId); + ASSERT_TRUE(ret.isOk()); + + std::cv_status waitStatus = wait(); + while (waitStatus == std::cv_status::no_timeout && + enable_usb_data_while_docked_done == false) + waitStatus = wait(); + + EXPECT_EQ(std::cv_status::no_timeout, waitStatus); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + } + ALOGI("UsbAidlTest enableUsbDataWhileDocked end"); +} + /* * Test enabling Usb data of the port. * Test case queries the usb ports present in device. -- GitLab From 45131a73095f00b9598c677d3270fb8fe41d0584 Mon Sep 17 00:00:00 2001 From: Ricky Niu Date: Tue, 7 Dec 2021 20:27:37 +0800 Subject: [PATCH 494/825] Add resetUsbPort in USB HAL interface Bug: 197300598 Test: Verify the API working manually Signed-off-by: Ricky Niu Change-Id: I52de859244145cb8699f6138ee73a7fe47fdd67b --- .../current/android/hardware/usb/IUsb.aidl | 1 + .../android/hardware/usb/IUsbCallback.aidl | 1 + usb/aidl/android/hardware/usb/IUsb.aidl | 9 +++++++++ usb/aidl/android/hardware/usb/IUsbCallback.aidl | 9 +++++++++ usb/aidl/default/Usb.cpp | 16 ++++++++++++++++ usb/aidl/default/Usb.h | 2 ++ 6 files changed, 38 insertions(+) diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl index 4ba9ff8dff..f866c1eb5b 100644 --- a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsb.aidl @@ -41,4 +41,5 @@ interface IUsb { oneway void setCallback(in android.hardware.usb.IUsbCallback callback); oneway void switchRole(in String portName, in android.hardware.usb.PortRole role, long transactionId); oneway void limitPowerTransfer(in String portName, boolean limit, long transactionId); + oneway void resetUsbPort(in String portName,long transactionId); } diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl index 57f02c548c..4abfaec53b 100644 --- a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl +++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/IUsbCallback.aidl @@ -41,4 +41,5 @@ interface IUsbCallback { oneway void notifyContaminantEnabledStatus(in String portName, boolean enable, in android.hardware.usb.Status retval, long transactionId); oneway void notifyQueryPortStatus(in String portName, in android.hardware.usb.Status retval, long transactionId); oneway void notifyLimitPowerTransferStatus(in String portName, boolean limit, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyResetUsbPortStatus(in String portName, in android.hardware.usb.Status retval, long transactionId); } diff --git a/usb/aidl/android/hardware/usb/IUsb.aidl b/usb/aidl/android/hardware/usb/IUsb.aidl index d296fbb209..90ad115731 100644 --- a/usb/aidl/android/hardware/usb/IUsb.aidl +++ b/usb/aidl/android/hardware/usb/IUsb.aidl @@ -104,4 +104,13 @@ oneway interface IUsb { * @param transactionId ID to be used when invoking the callback. */ void limitPowerTransfer(in String portName, boolean limit, long transactionId); + + /** + * This function is used to reset the port role of a specific port. + * For instance, when data transfer through the port fails. + * + * @param portName name of the port that is being reset + * @param transactionId ID to be used when invoking the callback. + */ + void resetUsbPort(in String portName, long transactionId); } diff --git a/usb/aidl/android/hardware/usb/IUsbCallback.aidl b/usb/aidl/android/hardware/usb/IUsbCallback.aidl index e33672aa2b..2ae10d975f 100644 --- a/usb/aidl/android/hardware/usb/IUsbCallback.aidl +++ b/usb/aidl/android/hardware/usb/IUsbCallback.aidl @@ -105,4 +105,13 @@ oneway interface IUsbCallback { * @param transactionId ID sent during limitPowerTransfer request. */ void notifyLimitPowerTransferStatus(in String portName, boolean limit, in Status retval, long transactionId); + + /** + * Used to notify the result of requesting resetUsbPort. + * + * @param portName name of the port that was being reset. + * @param retval SUCCESS if current request succeeded. FAILURE otherwise. + * @param transactionId current transactionId sent during resetUsbPort request. + */ + void notifyResetUsbPortStatus(in String portName, in Status retval, long transactionId); } diff --git a/usb/aidl/default/Usb.cpp b/usb/aidl/default/Usb.cpp index 92b09a2b44..7e738c477f 100644 --- a/usb/aidl/default/Usb.cpp +++ b/usb/aidl/default/Usb.cpp @@ -90,6 +90,22 @@ ScopedAStatus Usb::enableUsbDataWhileDocked(const string& in_portName, int64_t i return ScopedAStatus::ok(); } +ScopedAStatus Usb::resetUsbPort(const string& in_portName, int64_t in_transactionId) { + + pthread_mutex_lock(&mLock); + if (mCallback != NULL) { + ScopedAStatus ret = mCallback->notifyResetUsbPortStatus( + in_portName, Status::NOT_SUPPORTED, in_transactionId); + if (!ret.isOk()) + ALOGE("notifyResetUsbPortStatus error %s", ret.getDescription().c_str()); + } else { + ALOGE("Not notifying the userspace. Callback is not set"); + } + pthread_mutex_unlock(&mLock); + + return ScopedAStatus::ok(); +} + Status queryMoistureDetectionStatus(std::vector *currentPortStatus) { string enabled, status, path, DetectedPath; diff --git a/usb/aidl/default/Usb.h b/usb/aidl/default/Usb.h index 7e8422e39b..d507af6f53 100644 --- a/usb/aidl/default/Usb.h +++ b/usb/aidl/default/Usb.h @@ -58,6 +58,8 @@ struct Usb : public BnUsb { int64_t in_transactionId) override; ScopedAStatus limitPowerTransfer(const std::string& in_portName, bool in_limit, int64_t in_transactionId)override; + ScopedAStatus resetUsbPort(const std::string& in_portName, + int64_t in_transactionId)override; shared_ptr mCallback; // Protects mCallback variable -- GitLab From 3e037cf683ce58d1a1b3af73e2791359ff0d46dc Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Mon, 24 Jan 2022 08:58:28 -0800 Subject: [PATCH 495/825] Remove stride from VTS classes Stride must be retrieved from the graphic buffer immediately prior to CPU access. The previous code was tripped up by an error-prone situation where stride was never initialized, causing UB. Also this patch sneaks in a couple of const modifiers for methods that pass-by-ref. Bug: 213493262 Test: VtsHalGraphicsComposer3_TargetTest Change-Id: Ic601cca128b71d36876ed25bd55140b02cb0ad0f --- .../functional/composer-vts/ReadbackVts.cpp | 35 +++++++++++-------- .../composer-vts/RenderEngineVts.cpp | 17 +++++---- .../composer-vts/include/ReadbackVts.h | 6 ++-- .../composer-vts/include/RenderEngineVts.h | 2 +- 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp index d99903df75..587c523d19 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp @@ -177,15 +177,15 @@ bool ReadbackHelper::readbackSupported(const common::PixelFormat& pixelFormat, return true; } -void ReadbackHelper::compareColorBuffers(std::vector& expectedColors, void* bufferData, - const int32_t stride, const uint32_t width, +void ReadbackHelper::compareColorBuffers(const std::vector& expectedColors, void* bufferData, + 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++) { auto pixel = row * static_cast(width) + col; - int offset = (row * stride + col) * bytesPerPixel; + int offset = (row * static_cast(stride) + col) * bytesPerPixel; uint8_t* pixelColor = (uint8_t*)bufferData + offset; const Color expectedColor = expectedColors[static_cast(pixel)]; ASSERT_EQ(std::round(255.0f * expectedColor.r), pixelColor[0]); @@ -239,16 +239,19 @@ void ReadbackBuffer::checkReadbackBuffer(std::vector expectedColors) { ndk::ScopedFileDescriptor fenceHandle; EXPECT_TRUE(mComposerClient->getReadbackBufferFence(mDisplay, &fenceHandle).isOk()); - int outBytesPerPixel; - int outBytesPerStride; + int bytesPerPixel = -1; + int bytesPerStride = -1; void* bufData = nullptr; auto status = mGraphicBuffer->lockAsync(mUsage, mAccessRegion, &bufData, dup(fenceHandle.get()), - &outBytesPerPixel, &outBytesPerStride); + &bytesPerPixel, &bytesPerStride); EXPECT_EQ(::android::OK, status); ASSERT_TRUE(mPixelFormat == PixelFormat::RGB_888 || mPixelFormat == PixelFormat::RGBA_8888); - ReadbackHelper::compareColorBuffers(expectedColors, bufData, static_cast(mStride), - mWidth, mHeight, mPixelFormat); + const uint32_t stride = (bytesPerPixel > 0 && bytesPerStride > 0) + ? static_cast(bytesPerStride / bytesPerPixel) + : mGraphicBuffer->getStride(); + ReadbackHelper::compareColorBuffers(expectedColors, bufData, stride, mWidth, mHeight, + mPixelFormat); status = mGraphicBuffer->unlock(); EXPECT_EQ(::android::OK, status); } @@ -304,10 +307,7 @@ LayerSettings TestBufferLayer::toRenderEngineLayerSettings() { LayerSettings layerSettings = TestLayer::toRenderEngineLayerSettings(); layerSettings.source.buffer.buffer = std::make_shared<::android::renderengine::impl::ExternalTexture>( - ::android::sp<::android::GraphicBuffer>::make( - mGraphicBuffer->handle, ::android::GraphicBuffer::CLONE_HANDLE, mWidth, - mHeight, static_cast(mPixelFormat), 1, mUsage, mStride), - mRenderEngine.getInternalRenderEngine(), + mGraphicBuffer, mRenderEngine.getInternalRenderEngine(), ::android::renderengine::impl::ExternalTexture::Usage::READABLE); layerSettings.source.buffer.usePremultipliedAlpha = mBlendMode == BlendMode::PREMULTIPLIED; @@ -318,7 +318,7 @@ LayerSettings TestBufferLayer::toRenderEngineLayerSettings() { const float translateY = mSourceCrop.top / (static_cast(mHeight)); layerSettings.source.buffer.textureTransform = - ::android::mat4::translate(::android::vec4(translateX, translateY, 0, 1)) * + ::android::mat4::translate(::android::vec4(translateX, translateY, 0, 1.0)) * ::android::mat4::scale(::android::vec4(scaleX, scaleY, 1.0, 1.0)); return layerSettings; @@ -326,9 +326,14 @@ LayerSettings TestBufferLayer::toRenderEngineLayerSettings() { void TestBufferLayer::fillBuffer(std::vector& expectedColors) { void* bufData; - auto status = mGraphicBuffer->lock(mUsage, &bufData); + int32_t bytesPerPixel = -1; + int32_t bytesPerStride = -1; + auto status = mGraphicBuffer->lock(mUsage, &bufData, &bytesPerPixel, &bytesPerStride); + const uint32_t stride = (bytesPerPixel > 0 && bytesPerStride > 0) + ? static_cast(bytesPerStride / bytesPerPixel) + : mGraphicBuffer->getStride(); EXPECT_EQ(::android::OK, status); - ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(mWidth, mHeight, mStride, bufData, + ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(mWidth, mHeight, stride, bufData, mPixelFormat, expectedColors)); EXPECT_EQ(::android::OK, mGraphicBuffer->unlock()); } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp index 6ff064f93c..0a55484c78 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp @@ -77,13 +77,18 @@ void TestRenderEngine::drawLayers() { } } -void TestRenderEngine::checkColorBuffer(std::vector& expectedColors) { +void TestRenderEngine::checkColorBuffer(const std::vector& expectedColors) { void* bufferData; - ASSERT_EQ(0, - mGraphicBuffer->lock(static_cast(mGraphicBuffer->getUsage()), &bufferData)); - ReadbackHelper::compareColorBuffers( - expectedColors, bufferData, static_cast(mGraphicBuffer->getStride()), - mGraphicBuffer->getWidth(), mGraphicBuffer->getHeight(), mFormat); + int32_t bytesPerPixel = -1; + int32_t bytesPerStride = -1; + ASSERT_EQ(0, mGraphicBuffer->lock(static_cast(mGraphicBuffer->getUsage()), + &bufferData, &bytesPerPixel, &bytesPerStride)); + const uint32_t stride = (bytesPerPixel > 0 && bytesPerStride > 0) + ? static_cast(bytesPerStride / bytesPerPixel) + : mGraphicBuffer->getStride(); + ReadbackHelper::compareColorBuffers(expectedColors, bufferData, stride, + mGraphicBuffer->getWidth(), mGraphicBuffer->getHeight(), + mFormat); ASSERT_EQ(::android::OK, mGraphicBuffer->unlock()); } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h index 8785513b59..a3ce795db1 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h @@ -161,7 +161,6 @@ class TestBufferLayer : public TestLayer { uint32_t mLayerCount; PixelFormat mPixelFormat; uint32_t mUsage; - uint32_t mStride; ::android::Rect mAccessRegion; }; @@ -189,8 +188,8 @@ class ReadbackHelper { static const std::vector colorModes; static const std::vector dataspaces; - static void compareColorBuffers(std::vector& expectedColors, void* bufferData, - const int32_t stride, const uint32_t width, + static void compareColorBuffers(const std::vector& expectedColors, void* bufferData, + const uint32_t stride, const uint32_t width, const uint32_t height, PixelFormat pixelFormat); }; @@ -210,7 +209,6 @@ class ReadbackBuffer { uint32_t mHeight; uint32_t mLayerCount; uint32_t mUsage; - uint32_t mStride; PixelFormat mPixelFormat; Dataspace mDataspace; int64_t mDisplay; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h index 2798e092a0..a776a279c4 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h @@ -54,7 +54,7 @@ class TestRenderEngine { mDisplaySettings = displaySettings; }; void drawLayers(); - void checkColorBuffer(std::vector& expectedColors); + void checkColorBuffer(const std::vector& expectedColors); ::android::renderengine::RenderEngine& getInternalRenderEngine() { return *mRenderEngine; } -- GitLab From 44def7c8605506c189c1512ba305abfd63fdbd7f Mon Sep 17 00:00:00 2001 From: Kiran Rachuri Date: Thu, 20 Jan 2022 20:28:05 +0000 Subject: [PATCH 496/825] Add properties for front and rear fog lights Bug: 196103754 Test: Build Change-Id: Id6049514917dd5f3a8375b0479c972a04c2caaf3 --- .../automotive/vehicle/VehicleProperty.aidl | 4 + .../automotive/vehicle/VehicleProperty.aidl | 87 +++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl index 12126eab12..bcb63b6c05 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -194,4 +194,8 @@ enum VehicleProperty { CLUSTER_NAVIGATION_STATE = 292556600, ELECTRONIC_TOLL_COLLECTION_CARD_TYPE = 289410873, ELECTRONIC_TOLL_COLLECTION_CARD_STATUS = 289410874, + FRONT_FOG_LIGHTS_STATE = 289410875, + FRONT_FOG_LIGHTS_SWITCH = 289410876, + REAR_FOG_LIGHTS_STATE = 289410877, + REAR_FOG_LIGHTS_SWITCH = 289410878, } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl index fe2de8fc12..533c7a280d 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -1888,6 +1888,22 @@ enum VehicleProperty { * * Return the current state of fog lights. * + * If the car has both front and rear fog lights: + * If front and rear fog lights can only be controlled together: FOG_LIGHTS_STATE must be + * implemented. FRONT_FOG_LIGHTS_STATE and REAR_FOG_LIGHTS_STATE must not be implemented. + * + * If the front and rear fog lights can only be controlled independently: FOG_LIGHTS_STATE + * must not be implemented. FRONT_FOG_LIGHTS_STATE and REAR_FOG_LIGHTS_STATE must be + * implemented. + * + * If the car has only front fog lights: + * Only one of FOG_LIGHTS_STATE or FRONT_FOG_LIGHTS_STATE must be implemented and not both. + * REAR_FOG_LIGHTS_STATE must not be implemented. + * + * If the car has only rear fog lights: + * Only one of FOG_LIGHTS_STATE or REAR_FOG_LIGHTS_STATE must be implemented and not both. + * FRONT_FOG_LIGHTS_STATE must not be implemented. + * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ * @data_enum VehicleLightState @@ -1932,6 +1948,22 @@ enum VehicleProperty { * * The setting that the user wants. * + * If the car has both front and rear fog lights: + * If front and rear fog lights can only be controlled together: FOG_LIGHTS_SWITCH must be + * implemented. FRONT_FOG_LIGHTS_SWITCH and REAR_FOG_LIGHTS_SWITCH must not be implemented. + * + * If the front and rear fog lights can only be controlled independently: FOG_LIGHTS_SWITCH + * must not be implemented. FRONT_FOG_LIGHTS_SWITCH and REAR_FOG_LIGHTS_SWITCH must be + * implemented. + * + * If the car has only front fog lights: + * Only one of FOG_LIGHTS_SWITCH or FRONT_FOG_LIGHTS_SWITCH must be implemented and not both. + * REAR_FOG_LIGHTS_SWITCH must not be implemented. + * + * If the car has only rear fog lights: + * Only one of FOG_LIGHTS_SWITCH or REAR_FOG_LIGHTS_SWITCH must be implemented and not both. + * FRONT_FOG_LIGHTS_SWITCH must not be implemented. + * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE * @data_enum VehicleLightSwitch @@ -2637,4 +2669,59 @@ enum VehicleProperty { */ ELECTRONIC_TOLL_COLLECTION_CARD_STATUS = 0x0F3A + 0x10000000 + 0x01000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Front fog lights state + * + * Return the current state of the front fog lights. + * Only one of FOG_LIGHTS_STATE or FRONT_FOG_LIGHTS_STATE must be implemented. Please refer to + * the documentation on FOG_LIGHTS_STATE for more information. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleLightState + */ + FRONT_FOG_LIGHTS_STATE = 0x0F3B + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Front fog lights switch + * + * The setting that the user wants. + * Only one of FOG_LIGHTS_SWITCH or FRONT_FOG_LIGHTS_SWITCH must be implemented. Please refer to + * the documentation on FOG_LIGHTS_SWITCH for more information. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleLightSwitch + */ + FRONT_FOG_LIGHTS_SWITCH = 0x0F3C + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Rear fog lights state + * + * Return the current state of the rear fog lights. + * Only one of FOG_LIGHTS_STATE or REAR_FOG_LIGHTS_STATE must be implemented. Please refer to + * the documentation on FOG_LIGHTS_STATE for more information. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleLightState + */ + REAR_FOG_LIGHTS_STATE = 0x0F3D + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Rear fog lights switch + * + * The setting that the user wants. + * Only one of FOG_LIGHTS_SWITCH or REAR_FOG_LIGHTS_SWITCH must be implemented. Please refer to + * the documentation on FOG_LIGHTS_SWITCH for more information. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleLightSwitch + */ + REAR_FOG_LIGHTS_SWITCH = 0x0F3E + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 } -- GitLab From 9324749747651c838a41afabf42a81e9f0dd9e78 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Thu, 6 Jan 2022 14:16:27 -0800 Subject: [PATCH 497/825] Make retrieving SMPTE2094-10 metadata optional. Devices that do not support this metadata are not required to support getting or setting it on gralloc buffers, as SMPTE2094-10 is only used for some HDR standards that are not guaranteed to be supported. Bug: 205245993 Test: builds Change-Id: Ic3501230015ddce49ce977963356c0578af7c50f --- .../hardware/graphics/common/StandardMetadataType.aidl | 5 +++-- .../vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl b/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl index 7719d6e61d..74a9ce309b 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl @@ -22,8 +22,9 @@ package android.hardware.graphics.common; * This is an enum that defines the common types of gralloc 4 buffer metadata. The comments for * each enum include a description of the metadata that is associated with the type. * - * IMapper@4.x must support getting the following standard buffer metadata types. IMapper@4.x may - * support setting these standard buffer metadata types as well. + * IMapper@4.x must support getting the following standard buffer metadata types, with the exception + * of SMPTE 2094-10 metadata. IMapper@4.x may support setting these standard buffer metadata types + * as well. * * When encoding these StandardMetadataTypes into a byte stream, the associated MetadataType is * is first encoded followed by the StandardMetadataType value. The MetadataType is encoded by diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp index 2ab9c01c5d..4b8549b702 100644 --- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp +++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp @@ -92,7 +92,13 @@ class GraphicsMapperHidlTest ASSERT_NO_FATAL_FAILURE(bufferHandle = mGralloc->allocate(descriptorInfo, true)); hidl_vec vec; - ASSERT_EQ(Error::NONE, mGralloc->get(bufferHandle, metadataType, &vec)); + const auto result = mGralloc->get(bufferHandle, metadataType, &vec); + + if (metadataType == gralloc4::MetadataType_Smpte2094_10 && result == Error::UNSUPPORTED) { + GTEST_SKIP() << "getting metadata for Smpte2094-10 is unsupported"; + } + + ASSERT_EQ(Error::NONE, result); ASSERT_NO_FATAL_FAILURE(decode(descriptorInfo, vec)); } -- GitLab From 325e8235c3779db5d6dacad5dd0a2bee8c2aa878 Mon Sep 17 00:00:00 2001 From: Jason Macnak Date: Mon, 24 Jan 2022 14:48:55 -0800 Subject: [PATCH 498/825] Skip expectedPresentTime_* tests when unreliable fences cap present ... as these tests depends on present fence signal times. Bug: b/193240715 Test: cvd start Test: vts -m VtsHalGraphicsComposer3_TargetTest Change-Id: Iad0b89daa85e01a287f045a91b1cbdb890fee05d --- .../VtsHalGraphicsComposer3_TargetTest.cpp | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 1c75749f21..0a12f1a592 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -191,6 +191,14 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { resourceIt->second.layers.erase(layer); } + bool hasCapability(Capability capability) { + std::vector capabilities; + EXPECT_TRUE(mComposer->getCapabilities(&capabilities).isOk()); + return std::any_of( + capabilities.begin(), capabilities.end(), + [&](const Capability& activeCapability) { return activeCapability == capability; }); + } + // returns an invalid display id (one that has not been registered to a // display. Currently assuming that a device will never have close to // std::numeric_limit::max() displays registered while running tests @@ -1477,6 +1485,11 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { } void Test_expectedPresentTime(std::optional framesDelay) { + if (hasCapability(Capability::PRESENT_FENCE_IS_NOT_RELIABLE)) { + GTEST_SUCCEED() << "Device has unreliable present fences capability, skipping"; + return; + } + ASSERT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk()); const auto vsyncPeriod = getVsyncPeriod(); @@ -1653,10 +1666,7 @@ TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY) { */ // TODO(b/208441745) fix the test failure TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) { - std::vector capabilities; - EXPECT_TRUE(mComposer->getCapabilities(&capabilities).isOk()); - if (none_of(capabilities.begin(), capabilities.end(), - [&](auto item) { return item == Capability::SKIP_VALIDATE; })) { + if (!hasCapability(Capability::SKIP_VALIDATE)) { GTEST_SUCCEED() << "Device does not have skip validate capability, skipping"; return; } @@ -1884,10 +1894,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_PLANE_ALPHA) { } TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SIDEBAND_STREAM) { - std::vector capabilities; - EXPECT_TRUE(mComposer->getCapabilities(&capabilities).isOk()); - if (none_of(capabilities.begin(), capabilities.end(), - [&](auto& item) { return item == Capability::SIDEBAND_STREAM; })) { + if (!hasCapability(Capability::SIDEBAND_STREAM)) { GTEST_SUCCEED() << "no sideband stream support"; return; } -- GitLab From 25e9823f6304fa2b5c7efb6a16207326d7688078 Mon Sep 17 00:00:00 2001 From: Joe Bolinger Date: Mon, 24 Jan 2022 18:56:23 +0000 Subject: [PATCH 499/825] Add update context method to face and fingerprint HAL. This is needed for changes that occur mid-operation and was lost from the previous changes when switching from the single context method to the overloaded approach. Bug: 204584403 Test: atest VtsHalBiometricsFingerprintTargetTest VtsHalBiometricsFaceTargetTest Change-Id: Ie917bce9de910a421e19130b6e518bd6fc85298e --- .../current/android/hardware/biometrics/face/ISession.aidl | 1 + .../aidl/android/hardware/biometrics/face/ISession.aidl | 6 ++++++ biometrics/face/aidl/default/Session.cpp | 4 ++++ biometrics/face/aidl/default/Session.h | 2 ++ .../android/hardware/biometrics/fingerprint/ISession.aidl | 1 + .../android/hardware/biometrics/fingerprint/ISession.aidl | 6 ++++++ biometrics/fingerprint/aidl/default/Session.cpp | 4 ++++ biometrics/fingerprint/aidl/default/include/Session.h | 2 ++ 8 files changed, 26 insertions(+) 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 4b51bb17cc..366553485a 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 @@ -51,4 +51,5 @@ interface ISession { android.hardware.biometrics.common.ICancellationSignal authenticateWithContext(in long operationId, in android.hardware.biometrics.common.OperationContext context); 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); } diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl index bbe3632b6b..a92b3667fe 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl @@ -461,4 +461,10 @@ interface ISession { /* See ISession#detectInteraction() */ ICancellationSignal detectInteractionWithContext(in OperationContext context); + + /** + * This may be called while an authenticate, detect interaction, or enrollment operation is + * running when the context changes. + */ + void onContextChanged(in OperationContext context); } diff --git a/biometrics/face/aidl/default/Session.cpp b/biometrics/face/aidl/default/Session.cpp index 9e753e5c33..984a1a99dc 100644 --- a/biometrics/face/aidl/default/Session.cpp +++ b/biometrics/face/aidl/default/Session.cpp @@ -172,4 +172,8 @@ ndk::ScopedAStatus Session::detectInteractionWithContext( return detectInteraction(out); } +ndk::ScopedAStatus Session::onContextChanged(const common::OperationContext& /*context*/) { + return ndk::ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::biometrics::face diff --git a/biometrics/face/aidl/default/Session.h b/biometrics/face/aidl/default/Session.h index 0ce9e2060e..9db17d2df9 100644 --- a/biometrics/face/aidl/default/Session.h +++ b/biometrics/face/aidl/default/Session.h @@ -82,6 +82,8 @@ class Session : public BnSession { const common::OperationContext& context, std::shared_ptr* out) override; + ndk::ScopedAStatus onContextChanged(const common::OperationContext& context) override; + private: std::shared_ptr cb_; std::mt19937 mRandom; diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl index 4e7b3b451e..30f299d1fc 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl @@ -53,4 +53,5 @@ interface ISession { android.hardware.biometrics.common.ICancellationSignal detectInteractionWithContext(in android.hardware.biometrics.common.OperationContext context); void onPointerDownWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); void onPointerUpWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); + void onContextChanged(in android.hardware.biometrics.common.OperationContext context); } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl index ea8c6aa869..db0114514e 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl @@ -473,4 +473,10 @@ interface ISession { /** See ISession#onPointerUp(int) */ void onPointerUpWithContext(in PointerContext context); + + /** + * This may be called while an authenticate, detect interaction, or enrollment operation is + * running when the context changes. + */ + void onContextChanged(in OperationContext context); } diff --git a/biometrics/fingerprint/aidl/default/Session.cpp b/biometrics/fingerprint/aidl/default/Session.cpp index 8cbcfc77c5..452ed12b95 100644 --- a/biometrics/fingerprint/aidl/default/Session.cpp +++ b/biometrics/fingerprint/aidl/default/Session.cpp @@ -270,4 +270,8 @@ ndk::ScopedAStatus Session::onPointerUpWithContext(const PointerContext& context return onPointerUp(context.pointerId); } +ndk::ScopedAStatus Session::onContextChanged(const common::OperationContext& /*context*/) { + return ndk::ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/include/Session.h b/biometrics/fingerprint/aidl/default/include/Session.h index 584cb27b96..acd5def832 100644 --- a/biometrics/fingerprint/aidl/default/include/Session.h +++ b/biometrics/fingerprint/aidl/default/include/Session.h @@ -95,6 +95,8 @@ class Session : public BnSession { ndk::ScopedAStatus onPointerUpWithContext(const PointerContext& context) override; + ndk::ScopedAStatus onContextChanged(const common::OperationContext& context) override; + bool isClosed(); private: -- GitLab From a0cd944914f30aed36c8891bd22e825aee312fdc Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Sat, 15 Jan 2022 01:14:46 +0000 Subject: [PATCH 500/825] Audio HAL V7.1: Interfaces & types Introduced V7.1 of the core HAL. The only added methods of the interfaces are those for creating objects implementing the new version. HIDL types are from V7.0. APM XSD is cloned for adding new enums. Provided the minor update for the enums utility library. CTS-Coverage-Bug: 215647214 Bug: 214426419 Test: m Change-Id: I3caa2fda2fb5d7d8e8292e23fb2cf0e32e05c146 --- audio/7.1/Android.bp | 30 + audio/7.1/IDevice.hal | 88 ++ audio/7.1/IDevicesFactory.hal | 73 ++ audio/7.1/IPrimaryDevice.hal | 34 + audio/7.1/IStreamIn.hal | 22 + audio/7.1/IStreamOut.hal | 22 + audio/7.1/config/Android.bp | 31 + audio/7.1/config/api/current.txt | 592 +++++++++++++ audio/7.1/config/api/last_current.txt | 0 audio/7.1/config/api/last_removed.txt | 0 audio/7.1/config/api/removed.txt | 1 + .../7.1/config/audio_policy_configuration.xsd | 815 ++++++++++++++++++ audio/common/7.1/Android.bp | 23 + audio/common/7.1/enums/OWNERS | 2 + ...id_audio_policy_configuration_V7_1-enums.h | 300 +++++++ 15 files changed, 2033 insertions(+) create mode 100644 audio/7.1/Android.bp create mode 100644 audio/7.1/IDevice.hal create mode 100644 audio/7.1/IDevicesFactory.hal create mode 100644 audio/7.1/IPrimaryDevice.hal create mode 100644 audio/7.1/IStreamIn.hal create mode 100644 audio/7.1/IStreamOut.hal create mode 100644 audio/7.1/config/Android.bp create mode 100644 audio/7.1/config/api/current.txt create mode 100644 audio/7.1/config/api/last_current.txt create mode 100644 audio/7.1/config/api/last_removed.txt create mode 100644 audio/7.1/config/api/removed.txt create mode 100644 audio/7.1/config/audio_policy_configuration.xsd create mode 100644 audio/common/7.1/Android.bp create mode 100644 audio/common/7.1/enums/OWNERS create mode 100644 audio/common/7.1/enums/include/android_audio_policy_configuration_V7_1-enums.h diff --git a/audio/7.1/Android.bp b/audio/7.1/Android.bp new file mode 100644 index 0000000000..d0d96b6cf6 --- /dev/null +++ b/audio/7.1/Android.bp @@ -0,0 +1,30 @@ +// This file is autogenerated by hidl-gen -Landroidbp. + +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"], +} + +hidl_interface { + name: "android.hardware.audio@7.1", + root: "android.hardware", + srcs: [ + "IDevice.hal", + "IDevicesFactory.hal", + "IPrimaryDevice.hal", + "IStreamIn.hal", + "IStreamOut.hal", + ], + interfaces: [ + "android.hardware.audio@7.0", + "android.hardware.audio.common@7.0", + "android.hidl.base@1.0", + "android.hidl.safe_union@1.0", + ], + gen_java: false, + gen_java_constants: false, +} diff --git a/audio/7.1/IDevice.hal b/audio/7.1/IDevice.hal new file mode 100644 index 0000000000..373d17f4f9 --- /dev/null +++ b/audio/7.1/IDevice.hal @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.audio@7.1; + +import android.hardware.audio.common@7.0; +import @7.0::AudioInOutFlag; +import @7.0::IDevice; +import @7.0::Result; +import IStreamIn; +import IStreamOut; + +interface IDevice extends @7.0::IDevice { + /** + * This method creates and opens the audio hardware output stream. + * If the stream can not be opened with the proposed audio config, + * HAL must provide suggested values for the audio config. + * + * Note: INVALID_ARGUMENTS is returned both in the case when the + * HAL can not use the provided config and in the case when + * the value of any argument is invalid. In the latter case the + * HAL must provide a default initialized suggested config. + * + * @param ioHandle handle assigned by AudioFlinger. + * @param device device type and (if needed) address. + * @param config stream configuration. + * @param flags additional flags. + * @param sourceMetadata Description of the audio that will be played. + May be used by implementations to configure hardware effects. + * @return retval operation completion status. + * @return outStream created output stream. + * @return suggestedConfig in the case of rejection of the proposed config, + * a config suggested by the HAL. + */ + openOutputStream_7_1( + AudioIoHandle ioHandle, + DeviceAddress device, + AudioConfig config, + vec flags, + SourceMetadata sourceMetadata) generates ( + Result retval, + IStreamOut outStream, + AudioConfig suggestedConfig); + + /** + * This method creates and opens the audio hardware input stream. + * If the stream can not be opened with the proposed audio config, + * HAL must provide suggested values for the audio config. + * + * Note: INVALID_ARGUMENTS is returned both in the case when the + * HAL can not use the provided config and in the case when + * the value of any argument is invalid. In the latter case the + * HAL must provide a default initialized suggested config. + * + * @param ioHandle handle assigned by AudioFlinger. + * @param device device type and (if needed) address. + * @param config stream configuration. + * @param flags additional flags. + * @param sinkMetadata Description of the audio that is suggested by the client. + * May be used by implementations to configure processing effects. + * @return retval operation completion status. + * @return inStream in case of success, created input stream. + * @return suggestedConfig in the case of rejection of the proposed config, + * a config suggested by the HAL. + */ + openInputStream_7_1( + AudioIoHandle ioHandle, + DeviceAddress device, + AudioConfig config, + vec flags, + SinkMetadata sinkMetadata) generates ( + Result retval, + IStreamIn inStream, + AudioConfig suggestedConfig); +}; diff --git a/audio/7.1/IDevicesFactory.hal b/audio/7.1/IDevicesFactory.hal new file mode 100644 index 0000000000..7669614e59 --- /dev/null +++ b/audio/7.1/IDevicesFactory.hal @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.audio@7.1; + +import @7.0::IDevicesFactory; +import @7.0::Result; +import IDevice; +import IPrimaryDevice; + +/** + * This factory allows a HAL implementation to be split in multiple independent + * devices (called module in the pre-treble API). Note that this division is + * arbitrary and implementation are free to only have a Primary. The framework + * will query the devices according to audio_policy_configuration.xml + * + * Each device name is arbitrary, provided by the vendor's audio_policy_configuration.xml + * and only used to identify a device in this factory. + * The framework must not interpret the name, treating it as a vendor opaque data + * with the following exception: + * - the "r_submix" device that must be present to support policyMixes (Eg: Android projected). + * Note that this Device is included by default in a build derived from AOSP. + */ +interface IDevicesFactory extends @7.0::IDevicesFactory { + + /** + * Opens an audio device. To close the device, it is necessary to call + * 'close' method on the returned device object. + * + * Important note: due to rules of HIDL, @7.1::IPrimaryDevice extends + * @7.0::IPrimaryDevice, rather than @7.1::IDevice. Thus the returned + * IDevice interface can not be up-casted to @7.1::IPrimaryDevice for the + * primary device. The client needs to use IPrimaryDevice instead of this + * method if it needs full functionality of the IPrimaryDevice interface. + * + * @param device device name. + * @return retval operation completion status. Returns INVALID_ARGUMENTS + * if there is no corresponding hardware module found, + * NOT_INITIALIZED if an error occurred while opening the hardware + * module. + * @return result the interface for the created device. + */ + openDevice_7_1(string device) generates (Result retval, IDevice result); + + /** + * Opens the Primary audio device that must be present. + * This function is not optional and must return successfully the primary device. + * + * This device must have the name "primary". + * + * The telephony stack uses this device to control the audio during a voice call. + * + * @return retval operation completion status. Must be SUCCESS. + * For debugging, return INVALID_ARGUMENTS if there is no corresponding + * hardware module found, NOT_INITIALIZED if an error occurred + * while opening the hardware module. + * @return result the interface for the created device. + */ + openPrimaryDevice_7_1() generates (Result retval, IPrimaryDevice result); +}; diff --git a/audio/7.1/IPrimaryDevice.hal b/audio/7.1/IPrimaryDevice.hal new file mode 100644 index 0000000000..16596716f5 --- /dev/null +++ b/audio/7.1/IPrimaryDevice.hal @@ -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. + */ + +package android.hardware.audio@7.1; + +import android.hardware.audio.common@7.0; +import @7.0::IPrimaryDevice; +import IDevice; + +interface IPrimaryDevice extends @7.0::IPrimaryDevice { + /** + * Retrieve the generic @7.1::IDevice interface. + * + * Since @7.1::IPrimaryDevice extends @7.0::IPrimaryDevice, the interface + * reference can not be downcasted to @7.1::IDevice using standard methods. + * For this reason a dedicated interface method is provided. + * + * @return result the generic part of the interface. + */ + getDevice() generates (IDevice result); +}; diff --git a/audio/7.1/IStreamIn.hal b/audio/7.1/IStreamIn.hal new file mode 100644 index 0000000000..abebe6a062 --- /dev/null +++ b/audio/7.1/IStreamIn.hal @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.audio@7.1; + +import @7.0::IStreamIn; + +interface IStreamIn extends @7.0::IStreamIn { +}; diff --git a/audio/7.1/IStreamOut.hal b/audio/7.1/IStreamOut.hal new file mode 100644 index 0000000000..092a9a0f40 --- /dev/null +++ b/audio/7.1/IStreamOut.hal @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.audio@7.1; + +import @7.0::IStreamOut; + +interface IStreamOut extends @7.0::IStreamOut { +}; diff --git a/audio/7.1/config/Android.bp b/audio/7.1/config/Android.bp new file mode 100644 index 0000000000..70c8fd4a77 --- /dev/null +++ b/audio/7.1/config/Android.bp @@ -0,0 +1,31 @@ +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"], +} + +xsd_config { + name: "audio_policy_configuration_V7_1", + srcs: ["audio_policy_configuration.xsd"], + package_name: "android.audio.policy.configuration.V7_1", + nullability: true, +} + +xsd_config { + name: "audio_policy_configuration_V7_1_enums", + srcs: ["audio_policy_configuration.xsd"], + package_name: "android.audio.policy.configuration.V7_1", + nullability: true, + enums_only: true, +} + +xsd_config { + name: "audio_policy_configuration_V7_1_parser", + srcs: ["audio_policy_configuration.xsd"], + package_name: "android.audio.policy.configuration.V7_1", + nullability: true, + parser_only: true, +} diff --git a/audio/7.1/config/api/current.txt b/audio/7.1/config/api/current.txt new file mode 100644 index 0000000000..01c2e4bbd5 --- /dev/null +++ b/audio/7.1/config/api/current.txt @@ -0,0 +1,592 @@ +// Signature format: 2.0 +package android.audio.policy.configuration.V7_1 { + + public class AttachedDevices { + ctor public AttachedDevices(); + method @Nullable public java.util.List getItem(); + } + + public enum AudioChannelMask { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_1; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_10; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_11; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_12; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_13; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_14; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_15; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_16; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_17; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_18; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_19; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_20; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_21; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_22; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_23; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_24; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_3; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_4; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_5; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_6; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_7; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_8; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_INDEX_MASK_9; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_IN_2POINT0POINT2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_IN_2POINT1POINT2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_IN_3POINT0POINT2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_IN_3POINT1POINT2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_IN_5POINT1; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_IN_6; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_IN_FRONT_BACK; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_IN_MONO; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_IN_STEREO; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_IN_VOICE_CALL_MONO; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_IN_VOICE_DNLINK_MONO; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_IN_VOICE_UPLINK_MONO; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_NONE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_13POINT_360RA; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_22POINT2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_2POINT0POINT2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_2POINT1; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_2POINT1POINT2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_3POINT0POINT2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_3POINT1; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_3POINT1POINT2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_5POINT1; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_5POINT1POINT2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_5POINT1POINT4; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_5POINT1_BACK; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_5POINT1_SIDE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_6POINT1; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_7POINT1; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_7POINT1POINT2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_7POINT1POINT4; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_HAPTIC_AB; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_MONO; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_MONO_HAPTIC_A; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_PENTA; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_QUAD; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_QUAD_BACK; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_QUAD_SIDE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_STEREO; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_SURROUND; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_TRI; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_TRI_BACK; + } + + public enum AudioContentType { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_MOVIE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_MUSIC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_SONIFICATION; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_SPEECH; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_UNKNOWN; + } + + public enum AudioDevice { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_AMBIENT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_AUX_DIGITAL; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_BACK_MIC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_BLE_HEADSET; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_BLUETOOTH_A2DP; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_BLUETOOTH_BLE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_BUILTIN_MIC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_BUS; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_COMMUNICATION; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_DEFAULT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_ECHO_REFERENCE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_FM_TUNER; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_HDMI; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_HDMI_ARC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_HDMI_EARC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_IP; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_LINE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_LOOPBACK; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_PROXY; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_REMOTE_SUBMIX; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_SPDIF; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_STUB; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_TELEPHONY_RX; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_TV_TUNER; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_USB_ACCESSORY; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_USB_DEVICE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_USB_HEADSET; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_VOICE_CALL; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_IN_WIRED_HEADSET; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_NONE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_AUX_DIGITAL; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_AUX_LINE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLE_HEADSET; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLE_SPEAKER; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_A2DP; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_SCO; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BUS; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_DEFAULT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_EARPIECE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_ECHO_CANCELLER; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_FM; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_HDMI; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_HDMI_ARC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_HDMI_EARC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_HEARING_AID; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_IP; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_LINE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_PROXY; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_REMOTE_SUBMIX; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_SPDIF; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_SPEAKER; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_SPEAKER_SAFE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_STUB; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_TELEPHONY_TX; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_USB_ACCESSORY; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_USB_DEVICE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_USB_HEADSET; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_WIRED_HEADPHONE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_WIRED_HEADSET; + } + + public enum AudioEncapsulationType { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.AudioEncapsulationType AUDIO_ENCAPSULATION_TYPE_IEC61937; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioEncapsulationType AUDIO_ENCAPSULATION_TYPE_NONE; + } + + public enum AudioFormat { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ADIF; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ADTS; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ADTS_ELD; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ADTS_ERLC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ADTS_HE_V1; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ADTS_HE_V2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ADTS_LC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ADTS_LD; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ADTS_LTP; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ADTS_MAIN; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ADTS_SCALABLE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ADTS_SSR; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ADTS_XHE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ELD; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_ERLC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_HE_V1; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_HE_V2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_LATM; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_LATM_HE_V1; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_LATM_HE_V2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_LATM_LC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_LC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_LD; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_LTP; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_MAIN; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_SCALABLE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_SSR; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AAC_XHE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AC3; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AC4; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_ALAC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AMR_NB; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AMR_WB; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_AMR_WB_PLUS; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_APE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_APTX; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_APTX_ADAPTIVE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_APTX_HD; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_APTX_TWSP; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_CELT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_DEFAULT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_DOLBY_TRUEHD; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_DRA; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_DSD; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_DTS; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_DTS_HD; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_DTS_UHD; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_EVRC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_EVRCB; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_EVRCNW; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_EVRCWB; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_E_AC3; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_E_AC3_JOC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_FLAC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_HE_AAC_V1; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_HE_AAC_V2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_IEC60958; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_IEC61937; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_LC3; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_LDAC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_LHDC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_LHDC_LL; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_MAT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_MAT_1_0; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_MAT_2_0; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_MAT_2_1; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_MP2; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_MP3; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_MPEGH_BL_L3; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_MPEGH_BL_L4; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_MPEGH_LC_L3; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_MPEGH_LC_L4; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_OPUS; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_PCM_16_BIT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_PCM_24_BIT_PACKED; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_PCM_32_BIT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_PCM_8_24_BIT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_PCM_8_BIT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_PCM_FLOAT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_QCELP; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_SBC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_VORBIS; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_WMA; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioFormat AUDIO_FORMAT_WMA_PRO; + } + + public enum AudioGainMode { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.AudioGainMode AUDIO_GAIN_MODE_CHANNELS; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioGainMode AUDIO_GAIN_MODE_JOINT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioGainMode AUDIO_GAIN_MODE_RAMP; + } + + public enum AudioInOutFlag { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_DIRECT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_FAST; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_HW_AV_SYNC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_HW_HOTWORD; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_MMAP_NOIRQ; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_RAW; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_SYNC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_VOIP_TX; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_DEEP_BUFFER; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_DIRECT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_DIRECT_PCM; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_FAST; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_GAPLESS_OFFLOAD; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_HW_AV_SYNC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_IEC958_NONAUDIO; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_INCALL_MUSIC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_MMAP_NOIRQ; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_NON_BLOCKING; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_PRIMARY; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_RAW; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_SYNC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_TTS; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_VOIP_RX; + } + + public class AudioPolicyConfiguration { + ctor public AudioPolicyConfiguration(); + method @Nullable public android.audio.policy.configuration.V7_1.GlobalConfiguration getGlobalConfiguration(); + method @Nullable public java.util.List getModules(); + method @Nullable public android.audio.policy.configuration.V7_1.SurroundSound getSurroundSound(); + method @Nullable public android.audio.policy.configuration.V7_1.Version getVersion(); + method @Nullable public java.util.List getVolumes(); + method public void setGlobalConfiguration(@Nullable android.audio.policy.configuration.V7_1.GlobalConfiguration); + method public void setSurroundSound(@Nullable android.audio.policy.configuration.V7_1.SurroundSound); + method public void setVersion(@Nullable android.audio.policy.configuration.V7_1.Version); + } + + public enum AudioSource { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_CAMCORDER; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_DEFAULT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_ECHO_REFERENCE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_FM_TUNER; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_HOTWORD; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_MIC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_REMOTE_SUBMIX; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_UNPROCESSED; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_VOICE_CALL; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_VOICE_COMMUNICATION; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_VOICE_DOWNLINK; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_VOICE_PERFORMANCE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_VOICE_RECOGNITION; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_VOICE_UPLINK; + } + + public enum AudioStreamType { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_ACCESSIBILITY; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_ALARM; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_ASSISTANT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_BLUETOOTH_SCO; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_CALL_ASSISTANT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_DTMF; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_ENFORCED_AUDIBLE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_MUSIC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_NOTIFICATION; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_PATCH; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_REROUTING; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_RING; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_SYSTEM; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_TTS; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioStreamType AUDIO_STREAM_VOICE_CALL; + } + + public enum AudioUsage { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_ALARM; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_ANNOUNCEMENT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_ASSISTANCE_NAVIGATION_GUIDANCE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_ASSISTANCE_SONIFICATION; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_ASSISTANT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_CALL_ASSISTANT; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_EMERGENCY; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_GAME; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_MEDIA; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_NOTIFICATION; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_NOTIFICATION_TELEPHONY_RINGTONE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_SAFETY; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_UNKNOWN; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_VEHICLE_STATUS; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_VIRTUAL_SOURCE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_VOICE_COMMUNICATION; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioUsage AUDIO_USAGE_VOICE_COMMUNICATION_SIGNALLING; + } + + public enum DeviceCategory { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.DeviceCategory DEVICE_CATEGORY_EARPIECE; + enum_constant public static final android.audio.policy.configuration.V7_1.DeviceCategory DEVICE_CATEGORY_EXT_MEDIA; + enum_constant public static final android.audio.policy.configuration.V7_1.DeviceCategory DEVICE_CATEGORY_HEADSET; + enum_constant public static final android.audio.policy.configuration.V7_1.DeviceCategory DEVICE_CATEGORY_HEARING_AID; + enum_constant public static final android.audio.policy.configuration.V7_1.DeviceCategory DEVICE_CATEGORY_SPEAKER; + } + + public class DevicePorts { + ctor public DevicePorts(); + method @Nullable public java.util.List getDevicePort(); + } + + public static class DevicePorts.DevicePort { + ctor public DevicePorts.DevicePort(); + method @Nullable public String getAddress(); + method @Nullable public java.util.List getEncodedFormats(); + method @Nullable public android.audio.policy.configuration.V7_1.Gains getGains(); + method @Nullable public java.util.List getProfile(); + method @Nullable public android.audio.policy.configuration.V7_1.Role getRole(); + method @Nullable public String getTagName(); + method @Nullable public String getType(); + method @Nullable public boolean get_default(); + method public void setAddress(@Nullable String); + method public void setEncodedFormats(@Nullable java.util.List); + method public void setGains(@Nullable android.audio.policy.configuration.V7_1.Gains); + method public void setRole(@Nullable android.audio.policy.configuration.V7_1.Role); + method public void setTagName(@Nullable String); + method public void setType(@Nullable String); + method public void set_default(@Nullable boolean); + } + + public enum EngineSuffix { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.EngineSuffix _default; + enum_constant public static final android.audio.policy.configuration.V7_1.EngineSuffix configurable; + } + + public class Gains { + ctor public Gains(); + method @Nullable public java.util.List getGain(); + } + + public static class Gains.Gain { + ctor public Gains.Gain(); + method @Nullable public android.audio.policy.configuration.V7_1.AudioChannelMask getChannel_mask(); + method @Nullable public int getDefaultValueMB(); + method @Nullable public int getMaxRampMs(); + method @Nullable public int getMaxValueMB(); + method @Nullable public int getMinRampMs(); + method @Nullable public int getMinValueMB(); + method @Nullable public java.util.List getMode(); + method @Nullable public String getName(); + method @Nullable public int getStepValueMB(); + method @Nullable public boolean getUseForVolume(); + method public void setChannel_mask(@Nullable android.audio.policy.configuration.V7_1.AudioChannelMask); + method public void setDefaultValueMB(@Nullable int); + method public void setMaxRampMs(@Nullable int); + method public void setMaxValueMB(@Nullable int); + method public void setMinRampMs(@Nullable int); + method public void setMinValueMB(@Nullable int); + method public void setMode(@Nullable java.util.List); + method public void setName(@Nullable String); + method public void setStepValueMB(@Nullable int); + method public void setUseForVolume(@Nullable boolean); + } + + public class GlobalConfiguration { + ctor public GlobalConfiguration(); + method @Nullable public boolean getCall_screen_mode_supported(); + method @Nullable public android.audio.policy.configuration.V7_1.EngineSuffix getEngine_library(); + method @Nullable public boolean getSpeaker_drc_enabled(); + method public void setCall_screen_mode_supported(@Nullable boolean); + method public void setEngine_library(@Nullable android.audio.policy.configuration.V7_1.EngineSuffix); + method public void setSpeaker_drc_enabled(@Nullable boolean); + } + + public enum HalVersion { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.HalVersion _2_0; + enum_constant public static final android.audio.policy.configuration.V7_1.HalVersion _3_0; + } + + public class MixPorts { + ctor public MixPorts(); + method @Nullable public java.util.List getMixPort(); + } + + public static class MixPorts.MixPort { + ctor public MixPorts.MixPort(); + method @Nullable public java.util.List getFlags(); + method @Nullable public android.audio.policy.configuration.V7_1.Gains getGains(); + method @Nullable public long getMaxActiveCount(); + method @Nullable public long getMaxOpenCount(); + method @Nullable public String getName(); + method @Nullable public java.util.List getPreferredUsage(); + method @Nullable public java.util.List getProfile(); + method @Nullable public android.audio.policy.configuration.V7_1.Role getRole(); + method public void setFlags(@Nullable java.util.List); + method public void setGains(@Nullable android.audio.policy.configuration.V7_1.Gains); + method public void setMaxActiveCount(@Nullable long); + method public void setMaxOpenCount(@Nullable long); + method public void setName(@Nullable String); + method public void setPreferredUsage(@Nullable java.util.List); + method public void setRole(@Nullable android.audio.policy.configuration.V7_1.Role); + } + + public enum MixType { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.MixType mix; + enum_constant public static final android.audio.policy.configuration.V7_1.MixType mux; + } + + public class Modules { + ctor public Modules(); + method @Nullable public java.util.List getModule(); + } + + public static class Modules.Module { + ctor public Modules.Module(); + method @Nullable public android.audio.policy.configuration.V7_1.AttachedDevices getAttachedDevices(); + method @Nullable public String getDefaultOutputDevice(); + method @Nullable public android.audio.policy.configuration.V7_1.DevicePorts getDevicePorts(); + method @Nullable public android.audio.policy.configuration.V7_1.HalVersion getHalVersion(); + method @Nullable public android.audio.policy.configuration.V7_1.MixPorts getMixPorts(); + method @Nullable public String getName(); + method @Nullable public android.audio.policy.configuration.V7_1.Routes getRoutes(); + method public void setAttachedDevices(@Nullable android.audio.policy.configuration.V7_1.AttachedDevices); + method public void setDefaultOutputDevice(@Nullable String); + method public void setDevicePorts(@Nullable android.audio.policy.configuration.V7_1.DevicePorts); + method public void setHalVersion(@Nullable android.audio.policy.configuration.V7_1.HalVersion); + method public void setMixPorts(@Nullable android.audio.policy.configuration.V7_1.MixPorts); + method public void setName(@Nullable String); + method public void setRoutes(@Nullable android.audio.policy.configuration.V7_1.Routes); + } + + public class Profile { + ctor public Profile(); + method @Nullable public java.util.List getChannelMasks(); + method @Nullable public android.audio.policy.configuration.V7_1.AudioEncapsulationType getEncapsulationType(); + method @Nullable public String getFormat(); + method @Nullable public String getName(); + method @Nullable public java.util.List getSamplingRates(); + method public void setChannelMasks(@Nullable java.util.List); + method public void setEncapsulationType(@Nullable android.audio.policy.configuration.V7_1.AudioEncapsulationType); + method public void setFormat(@Nullable String); + method public void setName(@Nullable String); + method public void setSamplingRates(@Nullable java.util.List); + } + + public class Reference { + ctor public Reference(); + method @Nullable public String getName(); + method @Nullable public java.util.List getPoint(); + method public void setName(@Nullable String); + } + + public enum Role { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.Role sink; + enum_constant public static final android.audio.policy.configuration.V7_1.Role source; + } + + public class Routes { + ctor public Routes(); + method @Nullable public java.util.List getRoute(); + } + + public static class Routes.Route { + ctor public Routes.Route(); + method @Nullable public String getSink(); + method @Nullable public String getSources(); + method @Nullable public android.audio.policy.configuration.V7_1.MixType getType(); + method public void setSink(@Nullable String); + method public void setSources(@Nullable String); + method public void setType(@Nullable android.audio.policy.configuration.V7_1.MixType); + } + + public class SurroundFormats { + ctor public SurroundFormats(); + method @Nullable public java.util.List getFormat(); + } + + public static class SurroundFormats.Format { + ctor public SurroundFormats.Format(); + method @Nullable public String getName(); + method @Nullable public java.util.List getSubformats(); + method public void setName(@Nullable String); + method public void setSubformats(@Nullable java.util.List); + } + + public class SurroundSound { + ctor public SurroundSound(); + method @Nullable public android.audio.policy.configuration.V7_1.SurroundFormats getFormats(); + method public void setFormats(@Nullable android.audio.policy.configuration.V7_1.SurroundFormats); + } + + public enum Version { + method @NonNull public String getRawName(); + enum_constant public static final android.audio.policy.configuration.V7_1.Version _7_0; + enum_constant public static final android.audio.policy.configuration.V7_1.Version _7_1; + } + + public class Volume { + ctor public Volume(); + method @Nullable public android.audio.policy.configuration.V7_1.DeviceCategory getDeviceCategory(); + method @Nullable public java.util.List getPoint(); + method @Nullable public String getRef(); + method @Nullable public android.audio.policy.configuration.V7_1.AudioStreamType getStream(); + method public void setDeviceCategory(@Nullable android.audio.policy.configuration.V7_1.DeviceCategory); + method public void setRef(@Nullable String); + method public void setStream(@Nullable android.audio.policy.configuration.V7_1.AudioStreamType); + } + + public class Volumes { + ctor public Volumes(); + method @Nullable public java.util.List getReference(); + method @Nullable public java.util.List getVolume(); + } + + public class XmlParser { + ctor public XmlParser(); + method @Nullable public static android.audio.policy.configuration.V7_1.AudioPolicyConfiguration read(@NonNull java.io.InputStream) throws javax.xml.datatype.DatatypeConfigurationException, java.io.IOException, org.xmlpull.v1.XmlPullParserException; + method @Nullable public static String readText(@NonNull org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException; + method public static void skip(@NonNull org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException; + } + +} + diff --git a/audio/7.1/config/api/last_current.txt b/audio/7.1/config/api/last_current.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/audio/7.1/config/api/last_removed.txt b/audio/7.1/config/api/last_removed.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/audio/7.1/config/api/removed.txt b/audio/7.1/config/api/removed.txt new file mode 100644 index 0000000000..d802177e24 --- /dev/null +++ b/audio/7.1/config/api/removed.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/audio/7.1/config/audio_policy_configuration.xsd b/audio/7.1/config/audio_policy_configuration.xsd new file mode 100644 index 0000000000..731bb7c75f --- /dev/null +++ b/audio/7.1/config/audio_policy_configuration.xsd @@ -0,0 +1,815 @@ + + + + + + + + + + + + + + Version of the interface the hal implements. Note that this + relates to legacy HAL API versions since HIDL APIs are versioned + using other mechanisms. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + There should be one section per audio HW module present on the platform. + Each contains two mandatory tags: “halVersion” and “name”. + The module "name" is the same as in previous .conf file. + Each module must contain the following sections: + - : a list of device descriptors for all + input and output devices accessible via this module. + This contains both permanently attached devices and removable devices. + - : listing all output and input streams exposed by the audio HAL + - : list of possible connections between input + and output devices or between stream and devices. + A is defined by a set of 3 attributes: + -"type": mux|mix means all sources are mutual exclusive (mux) or can be mixed (mix) + -"sink": the sink involved in this route + -"sources": all the sources than can be connected to the sink via this route + - : permanently attached devices. + The attachedDevices section is a list of devices names. + Their names correspond to device names defined in "devicePorts" section. + - is the device to be used when no policy rule applies + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The flags indicate suggested stream attributes supported by the profile. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + When choosing the mixPort of an audio track, the audioPolicy + first considers the mixPorts with a preferredUsage including + the track AudioUsage preferred . + If non support the track format, the other mixPorts are considered. + Eg: a will receive + the audio of all apps playing with a MEDIA usage. + It may receive audio from ALARM if there are no audio compatible + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Audio usage specifies the intended use case for the sound being played. + Please consult frameworks/base/media/java/android/media/AudioAttributes.java + for the description of each value. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Audio content type expresses the general category of the content. + Please consult frameworks/base/media/java/android/media/AudioAttributes.java + for the description of each value. + + + + + + + + + + + + + + + + + Audio channel mask specifies presence of particular channels. + There are two representations: + - representation position (traditional discrete channel specification, + e.g. "left", "right"); + - indexed (this is similar to "tracks" in audio mixing, channels + are represented using numbers). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The default device will be used if multiple have the same type + and no explicit route request exists for a specific device of + that type. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + List all available sources for a given sink. + + + + + + + + + + + + + + + + + + + + + + Comma separated pair of number. + The fist one is the framework level (between 0 and 100). + The second one is the volume to send to the HAL. + The framework will interpolate volumes not specified. + Their MUST be at least 2 points specified. + + + + + + + + + + Audio stream type describing the intended use case of a stream. + Please consult frameworks/base/media/java/android/media/AudioSystem.java + for the description of each value. + + + + + + + + + + + + + + + + + + + + + + + + An audio source defines the intended use case for the sound being recorded. + Please consult frameworks/base/media/java/android/media/MediaRecorder.java + for the description of each value. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Volume section defines a volume curve for a given use case and device category. + It contains a list of points of this curve expressing the attenuation in Millibels + for a given volume index from 0 to 100. + + 0,-9600 + 100,0 + + + It may also reference a reference/@name to avoid duplicating curves. + + + 0,-9600 + 100,0 + + + + + + + + + + + + + + + + + + + + Surround Sound section provides configuration related to handling of + multi-channel formats. + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/audio/common/7.1/Android.bp b/audio/common/7.1/Android.bp new file mode 100644 index 0000000000..a2575104e6 --- /dev/null +++ b/audio/common/7.1/Android.bp @@ -0,0 +1,23 @@ +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_library { + name: "android.hardware.audio.common@7.1-enums", + vendor_available: true, + generated_headers: ["audio_policy_configuration_V7_1_enums"], + generated_sources: ["audio_policy_configuration_V7_1_enums"], + header_libs: ["libxsdc-utils"], + export_generated_headers: ["audio_policy_configuration_V7_1_enums"], + export_header_lib_headers: ["libxsdc-utils"], + export_include_dirs: ["enums/include"], + shared_libs: [ + "libbase", + "liblog", + ], +} diff --git a/audio/common/7.1/enums/OWNERS b/audio/common/7.1/enums/OWNERS new file mode 100644 index 0000000000..24071af220 --- /dev/null +++ b/audio/common/7.1/enums/OWNERS @@ -0,0 +1,2 @@ +elaurent@google.com +mnaganov@google.com diff --git a/audio/common/7.1/enums/include/android_audio_policy_configuration_V7_1-enums.h b/audio/common/7.1/enums/include/android_audio_policy_configuration_V7_1-enums.h new file mode 100644 index 0000000000..815f869e93 --- /dev/null +++ b/audio/common/7.1/enums/include/android_audio_policy_configuration_V7_1-enums.h @@ -0,0 +1,300 @@ +/* + * 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 ANDROID_AUDIO_POLICY_CONFIGURATION_V7_1__ENUMS_H +#define ANDROID_AUDIO_POLICY_CONFIGURATION_V7_1__ENUMS_H + +#include +#include +#include + +#include + +namespace android::audio::policy::configuration::V7_1 { + +static inline size_t getChannelCount(AudioChannelMask mask) { + switch (mask) { + case AudioChannelMask::AUDIO_CHANNEL_NONE: + return 0; + case AudioChannelMask::AUDIO_CHANNEL_OUT_MONO: + case AudioChannelMask::AUDIO_CHANNEL_IN_MONO: + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_1: + return 1; + case AudioChannelMask::AUDIO_CHANNEL_OUT_STEREO: + case AudioChannelMask::AUDIO_CHANNEL_OUT_MONO_HAPTIC_A: + case AudioChannelMask::AUDIO_CHANNEL_OUT_HAPTIC_AB: + case AudioChannelMask::AUDIO_CHANNEL_IN_STEREO: + case AudioChannelMask::AUDIO_CHANNEL_IN_FRONT_BACK: + case AudioChannelMask::AUDIO_CHANNEL_IN_VOICE_UPLINK_MONO: + case AudioChannelMask::AUDIO_CHANNEL_IN_VOICE_DNLINK_MONO: + case AudioChannelMask::AUDIO_CHANNEL_IN_VOICE_CALL_MONO: + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_2: + return 2; + case AudioChannelMask::AUDIO_CHANNEL_OUT_2POINT1: + case AudioChannelMask::AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A: + case AudioChannelMask::AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB: + case AudioChannelMask::AUDIO_CHANNEL_OUT_TRI: + case AudioChannelMask::AUDIO_CHANNEL_OUT_TRI_BACK: + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_3: + return 3; + case AudioChannelMask::AUDIO_CHANNEL_OUT_2POINT0POINT2: + case AudioChannelMask::AUDIO_CHANNEL_OUT_3POINT1: + case AudioChannelMask::AUDIO_CHANNEL_OUT_QUAD: + case AudioChannelMask::AUDIO_CHANNEL_OUT_QUAD_BACK: + case AudioChannelMask::AUDIO_CHANNEL_OUT_QUAD_SIDE: + case AudioChannelMask::AUDIO_CHANNEL_OUT_SURROUND: + case AudioChannelMask::AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB: + case AudioChannelMask::AUDIO_CHANNEL_IN_2POINT0POINT2: + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_4: + return 4; + case AudioChannelMask::AUDIO_CHANNEL_OUT_2POINT1POINT2: + case AudioChannelMask::AUDIO_CHANNEL_OUT_3POINT0POINT2: + case AudioChannelMask::AUDIO_CHANNEL_OUT_PENTA: + case AudioChannelMask::AUDIO_CHANNEL_IN_2POINT1POINT2: + case AudioChannelMask::AUDIO_CHANNEL_IN_3POINT0POINT2: + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_5: + return 5; + case AudioChannelMask::AUDIO_CHANNEL_OUT_3POINT1POINT2: + case AudioChannelMask::AUDIO_CHANNEL_OUT_5POINT1: + case AudioChannelMask::AUDIO_CHANNEL_OUT_5POINT1_BACK: + case AudioChannelMask::AUDIO_CHANNEL_OUT_5POINT1_SIDE: + case AudioChannelMask::AUDIO_CHANNEL_IN_6: + case AudioChannelMask::AUDIO_CHANNEL_IN_3POINT1POINT2: + case AudioChannelMask::AUDIO_CHANNEL_IN_5POINT1: + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_6: + return 6; + case AudioChannelMask::AUDIO_CHANNEL_OUT_6POINT1: + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_7: + return 7; + case AudioChannelMask::AUDIO_CHANNEL_OUT_5POINT1POINT2: + case AudioChannelMask::AUDIO_CHANNEL_OUT_7POINT1: + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_8: + return 8; + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_9: + return 9; + case AudioChannelMask::AUDIO_CHANNEL_OUT_5POINT1POINT4: + case AudioChannelMask::AUDIO_CHANNEL_OUT_7POINT1POINT2: + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_10: + return 10; + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_11: + return 11; + case AudioChannelMask::AUDIO_CHANNEL_OUT_7POINT1POINT4: + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_12: + return 12; + case AudioChannelMask::AUDIO_CHANNEL_OUT_13POINT_360RA: + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_13: + return 13; + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_14: + return 14; + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_15: + return 15; + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_16: + return 16; + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_17: + return 17; + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_18: + return 18; + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_19: + return 19; + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_20: + return 20; + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_21: + return 21; + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_22: + return 22; + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_23: + return 23; + case AudioChannelMask::AUDIO_CHANNEL_OUT_22POINT2: + case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_24: + return 24; + case AudioChannelMask::UNKNOWN: + return 0; + // No default to make sure all cases are covered. + } + // This is to avoid undefined behavior if 'mask' isn't a valid enum value. + return 0; +} + +static inline ssize_t getChannelCount(const std::string& mask) { + return getChannelCount(stringToAudioChannelMask(mask)); +} + +static inline bool isOutputDevice(AudioDevice device) { + switch (device) { + case AudioDevice::UNKNOWN: + case AudioDevice::AUDIO_DEVICE_NONE: + return false; + case AudioDevice::AUDIO_DEVICE_OUT_EARPIECE: + case AudioDevice::AUDIO_DEVICE_OUT_SPEAKER: + case AudioDevice::AUDIO_DEVICE_OUT_WIRED_HEADSET: + case AudioDevice::AUDIO_DEVICE_OUT_WIRED_HEADPHONE: + case AudioDevice::AUDIO_DEVICE_OUT_BLUETOOTH_SCO: + case AudioDevice::AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET: + case AudioDevice::AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT: + case AudioDevice::AUDIO_DEVICE_OUT_BLUETOOTH_A2DP: + case AudioDevice::AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES: + case AudioDevice::AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER: + case AudioDevice::AUDIO_DEVICE_OUT_AUX_DIGITAL: + case AudioDevice::AUDIO_DEVICE_OUT_HDMI: + case AudioDevice::AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET: + case AudioDevice::AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET: + case AudioDevice::AUDIO_DEVICE_OUT_USB_ACCESSORY: + case AudioDevice::AUDIO_DEVICE_OUT_USB_DEVICE: + case AudioDevice::AUDIO_DEVICE_OUT_REMOTE_SUBMIX: + case AudioDevice::AUDIO_DEVICE_OUT_TELEPHONY_TX: + case AudioDevice::AUDIO_DEVICE_OUT_LINE: + case AudioDevice::AUDIO_DEVICE_OUT_HDMI_ARC: + case AudioDevice::AUDIO_DEVICE_OUT_HDMI_EARC: + case AudioDevice::AUDIO_DEVICE_OUT_SPDIF: + case AudioDevice::AUDIO_DEVICE_OUT_FM: + case AudioDevice::AUDIO_DEVICE_OUT_AUX_LINE: + case AudioDevice::AUDIO_DEVICE_OUT_SPEAKER_SAFE: + case AudioDevice::AUDIO_DEVICE_OUT_IP: + case AudioDevice::AUDIO_DEVICE_OUT_BUS: + case AudioDevice::AUDIO_DEVICE_OUT_PROXY: + case AudioDevice::AUDIO_DEVICE_OUT_USB_HEADSET: + case AudioDevice::AUDIO_DEVICE_OUT_HEARING_AID: + case AudioDevice::AUDIO_DEVICE_OUT_ECHO_CANCELLER: + case AudioDevice::AUDIO_DEVICE_OUT_BLE_HEADSET: + case AudioDevice::AUDIO_DEVICE_OUT_BLE_SPEAKER: + case AudioDevice::AUDIO_DEVICE_OUT_DEFAULT: + case AudioDevice::AUDIO_DEVICE_OUT_STUB: + return true; + case AudioDevice::AUDIO_DEVICE_IN_COMMUNICATION: + case AudioDevice::AUDIO_DEVICE_IN_AMBIENT: + case AudioDevice::AUDIO_DEVICE_IN_BUILTIN_MIC: + case AudioDevice::AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET: + case AudioDevice::AUDIO_DEVICE_IN_WIRED_HEADSET: + case AudioDevice::AUDIO_DEVICE_IN_AUX_DIGITAL: + case AudioDevice::AUDIO_DEVICE_IN_HDMI: + case AudioDevice::AUDIO_DEVICE_IN_VOICE_CALL: + case AudioDevice::AUDIO_DEVICE_IN_TELEPHONY_RX: + case AudioDevice::AUDIO_DEVICE_IN_BACK_MIC: + case AudioDevice::AUDIO_DEVICE_IN_REMOTE_SUBMIX: + case AudioDevice::AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET: + case AudioDevice::AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET: + case AudioDevice::AUDIO_DEVICE_IN_USB_ACCESSORY: + case AudioDevice::AUDIO_DEVICE_IN_USB_DEVICE: + case AudioDevice::AUDIO_DEVICE_IN_FM_TUNER: + case AudioDevice::AUDIO_DEVICE_IN_TV_TUNER: + case AudioDevice::AUDIO_DEVICE_IN_LINE: + case AudioDevice::AUDIO_DEVICE_IN_SPDIF: + case AudioDevice::AUDIO_DEVICE_IN_BLUETOOTH_A2DP: + case AudioDevice::AUDIO_DEVICE_IN_LOOPBACK: + case AudioDevice::AUDIO_DEVICE_IN_IP: + case AudioDevice::AUDIO_DEVICE_IN_BUS: + case AudioDevice::AUDIO_DEVICE_IN_PROXY: + case AudioDevice::AUDIO_DEVICE_IN_USB_HEADSET: + case AudioDevice::AUDIO_DEVICE_IN_BLUETOOTH_BLE: + case AudioDevice::AUDIO_DEVICE_IN_HDMI_ARC: + case AudioDevice::AUDIO_DEVICE_IN_HDMI_EARC: + case AudioDevice::AUDIO_DEVICE_IN_ECHO_REFERENCE: + case AudioDevice::AUDIO_DEVICE_IN_BLE_HEADSET: + case AudioDevice::AUDIO_DEVICE_IN_DEFAULT: + case AudioDevice::AUDIO_DEVICE_IN_STUB: + return false; + // No default to make sure all cases are covered. + } + // This is to avoid undefined behavior if 'device' isn't a valid enum value. + return false; +} + +static inline bool isOutputDevice(const std::string& device) { + return isOutputDevice(stringToAudioDevice(device)); +} + +static inline bool isTelephonyDevice(AudioDevice device) { + return device == AudioDevice::AUDIO_DEVICE_OUT_TELEPHONY_TX || + device == AudioDevice::AUDIO_DEVICE_IN_TELEPHONY_RX; +} + +static inline bool isTelephonyDevice(const std::string& device) { + return isTelephonyDevice(stringToAudioDevice(device)); +} + +static inline bool maybeVendorExtension(const std::string& s) { + // Only checks whether the string starts with the "vendor prefix". + static const std::string vendorPrefix = "VX_"; + return s.size() > vendorPrefix.size() && s.substr(0, vendorPrefix.size()) == vendorPrefix; +} + +static inline bool isVendorExtension(const std::string& s) { + // Must be the same as the "vendorExtension" rule from the XSD file. + static const std::regex vendorExtension("VX_[A-Z0-9]{3,}_[_A-Z0-9]+"); + return std::regex_match(s.begin(), s.end(), vendorExtension); +} + +static inline bool isUnknownAudioChannelMask(const std::string& mask) { + return stringToAudioChannelMask(mask) == AudioChannelMask::UNKNOWN; +} + +static inline bool isUnknownAudioContentType(const std::string& contentType) { + return stringToAudioContentType(contentType) == AudioContentType::UNKNOWN; +} + +static inline bool isUnknownAudioDevice(const std::string& device) { + return stringToAudioDevice(device) == AudioDevice::UNKNOWN && !isVendorExtension(device); +} + +static inline bool isUnknownAudioFormat(const std::string& format) { + return stringToAudioFormat(format) == AudioFormat::UNKNOWN && !isVendorExtension(format); +} + +static inline bool isUnknownAudioGainMode(const std::string& mode) { + return stringToAudioGainMode(mode) == AudioGainMode::UNKNOWN; +} + +static inline bool isUnknownAudioInOutFlag(const std::string& flag) { + return stringToAudioInOutFlag(flag) == AudioInOutFlag::UNKNOWN; +} + +static inline bool isUnknownAudioSource(const std::string& source) { + return stringToAudioSource(source) == AudioSource::UNKNOWN; +} + +static inline bool isUnknownAudioStreamType(const std::string& streamType) { + return stringToAudioStreamType(streamType) == AudioStreamType::UNKNOWN; +} + +static inline bool isUnknownAudioUsage(const std::string& usage) { + return stringToAudioUsage(usage) == AudioUsage::UNKNOWN; +} + +static inline bool isLinearPcm(AudioFormat format) { + switch (format) { + case AudioFormat::AUDIO_FORMAT_PCM_16_BIT: + case AudioFormat::AUDIO_FORMAT_PCM_8_BIT: + case AudioFormat::AUDIO_FORMAT_PCM_32_BIT: + case AudioFormat::AUDIO_FORMAT_PCM_8_24_BIT: + case AudioFormat::AUDIO_FORMAT_PCM_FLOAT: + case AudioFormat::AUDIO_FORMAT_PCM_24_BIT_PACKED: + return true; + default: + return false; + } +} + +static inline bool isLinearPcm(const std::string& format) { + return isLinearPcm(stringToAudioFormat(format)); +} + +static inline bool isUnknownAudioEncapsulationType(const std::string& encapsulationType) { + return stringToAudioEncapsulationType(encapsulationType) == AudioEncapsulationType::UNKNOWN; +} + +} // namespace android::audio::policy::configuration::V7_1 + +#endif // ANDROID_AUDIO_POLICY_CONFIGURATION_V7_1__ENUMS_H -- GitLab From 7d01538eeccf81aa57da61b4abba830d34582195 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Sat, 15 Jan 2022 01:15:12 +0000 Subject: [PATCH 501/825] Audio HAL V7.1: Update the default implementation Split versions of "common" and "core" types from the version of the interfaces. "Common" and "core" versions are set to 7.0. Implemented new methods of V7.1 interfaces. Bug: 214426419 Test: m android.hardware.audio@7.1-impl Test: m android.hardware.audio@7.0-impl Test: m android.hardware.audio.effect@7.0-impl Test: m android.hardware.audio@6.0-impl Change-Id: Ic4c44d4ac9bbfa7b62695866b9aa7473658390b2 --- .../all-versions/default/7.0/HidlUtils.cpp | 8 +- audio/common/all-versions/default/HidlUtils.h | 10 +- audio/common/all-versions/default/UuidUtils.h | 4 +- .../all-versions/default/VersionUtils.h | 25 ++++- .../all-versions/default/service/service.cpp | 1 + .../common/all-versions/VersionMacro.h | 28 +++++ audio/core/all-versions/default/Android.bp | 26 +++++ audio/core/all-versions/default/Device.cpp | 103 +++++++++++++----- .../all-versions/default/DevicesFactory.cpp | 38 ++++++- .../all-versions/default/ParametersUtil.cpp | 4 +- .../all-versions/default/PrimaryDevice.cpp | 8 +- audio/core/all-versions/default/Stream.cpp | 6 +- audio/core/all-versions/default/StreamIn.cpp | 8 +- audio/core/all-versions/default/StreamOut.cpp | 8 +- .../default/include/core/default/Device.h | 38 ++++++- .../include/core/default/DevicesFactory.h | 8 +- .../include/core/default/ParametersUtil.h | 13 ++- .../include/core/default/PrimaryDevice.h | 9 +- .../default/include/core/default/Stream.h | 11 +- .../default/include/core/default/StreamIn.h | 3 +- .../default/include/core/default/StreamOut.h | 3 +- .../default/include/core/default/Util.h | 16 +-- .../all-versions/default/util/CoreUtils.cpp | 12 +- .../default/util/include/util/CoreUtils.h | 12 +- audio/effect/all-versions/default/Effect.cpp | 5 +- audio/effect/all-versions/default/Effect.h | 5 +- .../all-versions/default/EffectsFactory.cpp | 2 +- .../all-versions/default/EffectsFactory.h | 2 +- .../default/EnvironmentalReverbEffect.h | 2 +- .../all-versions/default/EqualizerEffect.h | 2 +- .../default/LoudnessEnhancerEffect.h | 2 +- .../default/NoiseSuppressionEffect.h | 2 +- .../all-versions/default/PresetReverbEffect.h | 2 +- .../default/VirtualizerEffect.cpp | 2 +- .../all-versions/default/VirtualizerEffect.h | 5 +- .../all-versions/default/VisualizerEffect.h | 2 +- .../all-versions/default/util/EffectUtils.cpp | 6 +- .../compatibility_matrix.current.xml | 2 +- 38 files changed, 336 insertions(+), 107 deletions(-) diff --git a/audio/common/all-versions/default/7.0/HidlUtils.cpp b/audio/common/all-versions/default/7.0/HidlUtils.cpp index 5a5b5d276a..218d7c06b7 100644 --- a/audio/common/all-versions/default/7.0/HidlUtils.cpp +++ b/audio/common/all-versions/default/7.0/HidlUtils.cpp @@ -21,7 +21,7 @@ #define LOG_TAG "HidlUtils" #include -#include +#include PATH(APM_XSD_ENUMS_H_FILENAME) #include #include @@ -31,11 +31,11 @@ namespace android { namespace hardware { namespace audio { namespace common { -namespace CPP_VERSION { +namespace COMMON_TYPES_CPP_VERSION { namespace implementation { namespace xsd { -using namespace ::android::audio::policy::configuration::V7_0; +using namespace ::android::audio::policy::configuration::CPP_VERSION; } #define CONVERT_CHECKED(expr, result) \ @@ -1151,7 +1151,7 @@ status_t HidlUtils::deviceAddressToHal(const DeviceAddress& device, audio_device } } // namespace implementation -} // namespace CPP_VERSION +} // namespace COMMON_TYPES_CPP_VERSION } // namespace common } // namespace audio } // namespace hardware diff --git a/audio/common/all-versions/default/HidlUtils.h b/audio/common/all-versions/default/HidlUtils.h index 98ecc0754e..ad9dee22c1 100644 --- a/audio/common/all-versions/default/HidlUtils.h +++ b/audio/common/all-versions/default/HidlUtils.h @@ -17,7 +17,9 @@ #ifndef android_hardware_audio_Hidl_Utils_H_ #define android_hardware_audio_Hidl_Utils_H_ -#include PATH(android/hardware/audio/common/FILE_VERSION/types.h) +// clang-format off +#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h) +// clang-format on #include #include @@ -29,11 +31,11 @@ namespace android { namespace hardware { namespace audio { namespace common { -namespace CPP_VERSION { +namespace COMMON_TYPES_CPP_VERSION { namespace implementation { using ::android::hardware::hidl_vec; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; struct HidlUtils { static status_t audioConfigFromHal(const audio_config_t& halConfig, bool isInput, @@ -267,7 +269,7 @@ status_t HidlUtils::deviceAddressFromHalImpl(audio_devices_t halDeviceType, #endif // MAJOR_VERSION <= 6 } // namespace implementation -} // namespace CPP_VERSION +} // namespace COMMON_TYPES_CPP_VERSION } // namespace common } // namespace audio } // namespace hardware diff --git a/audio/common/all-versions/default/UuidUtils.h b/audio/common/all-versions/default/UuidUtils.h index cd04fb039a..4a64f0a570 100644 --- a/audio/common/all-versions/default/UuidUtils.h +++ b/audio/common/all-versions/default/UuidUtils.h @@ -20,7 +20,7 @@ #include // clang-format off -#include PATH(android/hardware/audio/common/FILE_VERSION/types.h) +#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h) // clang-format on #include @@ -32,7 +32,7 @@ namespace common { namespace CPP_VERSION { namespace implementation { -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; class UuidUtils { public: diff --git a/audio/common/all-versions/default/VersionUtils.h b/audio/common/all-versions/default/VersionUtils.h index 9bfca0cdcc..9771374c33 100644 --- a/audio/common/all-versions/default/VersionUtils.h +++ b/audio/common/all-versions/default/VersionUtils.h @@ -17,7 +17,30 @@ #ifndef ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H #define ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H -#include PATH(android/hardware/audio/common/FILE_VERSION/types.h) +// A workaround for b/216149583 (vendor code having its own copy of VersionMacro.h) +#ifndef COMMON_TYPES_MINOR_VERSION +#define COMMON_TYPES_MINOR_VERSION MINOR_VERSION +#endif +#ifndef CORE_TYPES_MINOR_VERSION +#define CORE_TYPES_MINOR_VERSION MINOR_VERSION +#endif +#ifndef COMMON_TYPES_FILE_VERSION +#define COMMON_TYPES_FILE_VERSION EXPAND_CONCAT_3(MAJOR_VERSION, ., COMMON_TYPES_MINOR_VERSION) +#endif +#ifndef CORE_TYPES_FILE_VERSION +#define CORE_TYPES_FILE_VERSION EXPAND_CONCAT_3(MAJOR_VERSION, ., CORE_TYPES_MINOR_VERSION) +#endif +#ifndef COMMON_TYPES_CPP_VERSION +#define COMMON_TYPES_CPP_VERSION EXPAND_CONCAT_4(V, MAJOR_VERSION, _, COMMON_TYPES_MINOR_VERSION) +#endif +#ifndef CORE_TYPES_CPP_VERSION +#define CORE_TYPES_CPP_VERSION EXPAND_CONCAT_4(V, MAJOR_VERSION, _, CORE_TYPES_MINOR_VERSION) +#endif +// End of workaround + +// clang-format off +#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h) +// clang-format on namespace android { namespace hardware { diff --git a/audio/common/all-versions/default/service/service.cpp b/audio/common/all-versions/default/service/service.cpp index 89585b0620..e26369fd70 100644 --- a/audio/common/all-versions/default/service/service.cpp +++ b/audio/common/all-versions/default/service/service.cpp @@ -66,6 +66,7 @@ int main(int /* argc */, char* /* argv */ []) { const std::vector mandatoryInterfaces = { { "Audio Core API", + "android.hardware.audio@7.1::IDevicesFactory", "android.hardware.audio@7.0::IDevicesFactory", "android.hardware.audio@6.0::IDevicesFactory", "android.hardware.audio@5.0::IDevicesFactory", diff --git a/audio/common/all-versions/util/include/common/all-versions/VersionMacro.h b/audio/common/all-versions/util/include/common/all-versions/VersionMacro.h index dc54cee206..875e167f38 100644 --- a/audio/common/all-versions/util/include/common/all-versions/VersionMacro.h +++ b/audio/common/all-versions/util/include/common/all-versions/VersionMacro.h @@ -21,6 +21,14 @@ #error "MAJOR_VERSION and MINOR_VERSION must be defined" #endif +#ifndef COMMON_TYPES_MINOR_VERSION +#define COMMON_TYPES_MINOR_VERSION MINOR_VERSION +#endif + +#ifndef CORE_TYPES_MINOR_VERSION +#define CORE_TYPES_MINOR_VERSION MINOR_VERSION +#endif + /** Allows macro expansion for x and add surrounding `<>`. * Is intended to be used for version dependant includes as * `#include` do not macro expand if starting with < or " @@ -34,10 +42,30 @@ #define EXPAND_CONCAT_3(a, b, c) CONCAT_3(a, b, c) /** The directory name of the version: . */ #define FILE_VERSION EXPAND_CONCAT_3(MAJOR_VERSION, ., MINOR_VERSION) +#define COMMON_TYPES_FILE_VERSION EXPAND_CONCAT_3(MAJOR_VERSION, ., COMMON_TYPES_MINOR_VERSION) +#define CORE_TYPES_FILE_VERSION EXPAND_CONCAT_3(MAJOR_VERSION, ., CORE_TYPES_MINOR_VERSION) #define CONCAT_4(a, b, c, d) a##b##c##d #define EXPAND_CONCAT_4(a, b, c, d) CONCAT_4(a, b, c, d) /** The c++ namespace of the version: V_ */ #define CPP_VERSION EXPAND_CONCAT_4(V, MAJOR_VERSION, _, MINOR_VERSION) +#define COMMON_TYPES_CPP_VERSION EXPAND_CONCAT_4(V, MAJOR_VERSION, _, COMMON_TYPES_MINOR_VERSION) +#define CORE_TYPES_CPP_VERSION EXPAND_CONCAT_4(V, MAJOR_VERSION, _, CORE_TYPES_MINOR_VERSION) + +/* Gluing these file names from macros is non-trivial due to "illegal tokens" + occurring during expansion. The XSD and enums always use the minor version. */ +// clang-format off +#if MAJOR_VERSION >= 7 +#if MINOR_VERSION == 0 +#define APM_XSD_H_FILENAME android_audio_policy_configuration_V7_0.h +#define APM_XSD_ENUMS_H_FILENAME android_audio_policy_configuration_V7_0-enums.h +#elif MINOR_VERSION == 1 +#define APM_XSD_H_FILENAME android_audio_policy_configuration_V7_1.h +#define APM_XSD_ENUMS_H_FILENAME android_audio_policy_configuration_V7_1-enums.h +#else +#error "Unsupported minor version" +#endif +#endif +// clang-format on #endif // ANDROID_HARDWARE_VERSION_MACRO_H diff --git a/audio/core/all-versions/default/Android.bp b/audio/core/all-versions/default/Android.bp index 6a0d0a08cd..df688fd909 100644 --- a/audio/core/all-versions/default/Android.bp +++ b/audio/core/all-versions/default/Android.bp @@ -161,3 +161,29 @@ cc_library_shared { name: "android.hardware.audio@7.0-impl", defaults: ["android.hardware.audio@7.0-impl_default"], } + +cc_defaults { + name: "android.hardware.audio@7.1-impl_default", + defaults: ["android.hardware.audio-impl_default"], + shared_libs: [ + "android.hardware.audio@7.0", + "android.hardware.audio@7.1", + "android.hardware.audio@7.0-util", + "android.hardware.audio.common@7.0", + "android.hardware.audio.common@7.1-enums", + "android.hardware.audio.common@7.0-util", + "libbase", + ], + cflags: [ + "-DMAJOR_VERSION=7", + "-DMINOR_VERSION=1", + "-DCOMMON_TYPES_MINOR_VERSION=0", + "-DCORE_TYPES_MINOR_VERSION=0", + "-include common/all-versions/VersionMacro.h", + ], +} + +cc_library_shared { + name: "android.hardware.audio@7.1-impl", + defaults: ["android.hardware.audio@7.1-impl_default"], +} diff --git a/audio/core/all-versions/default/Device.cpp b/audio/core/all-versions/default/Device.cpp index c33e6f30fa..ac5a3ba8ef 100644 --- a/audio/core/all-versions/default/Device.cpp +++ b/audio/core/all-versions/default/Device.cpp @@ -41,7 +41,10 @@ namespace audio { namespace CPP_VERSION { namespace implementation { -using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils; +namespace util { +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::util; +} Device::Device(audio_hw_device_t* device) : mIsClosed(false), mDevice(device) {} @@ -84,7 +87,7 @@ Return Device::setMasterVolume(float volume) { if (mDevice->set_master_volume == NULL) { return Result::NOT_SUPPORTED; } - if (!isGainNormalized(volume)) { + if (!util::isGainNormalized(volume)) { ALOGW("Can not set a master volume (%f) outside [0,1]", volume); return Result::INVALID_ARGUMENTS; } @@ -150,7 +153,7 @@ Return Device::getInputBufferSize(const AudioConfig& config, getInputBuffe return Void(); } -std::tuple> Device::openOutputStreamImpl(int32_t ioHandle, +std::tuple> Device::openOutputStreamCore(int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config, const AudioOutputFlags& flags, @@ -187,7 +190,7 @@ std::tuple> Device::openOutputStreamImpl(int32_t ioHandle return {analyzeStatus("open_output_stream", status, {EINVAL} /*ignore*/), streamOut}; } -std::tuple> Device::openInputStreamImpl( +std::tuple> Device::openInputStreamCore( int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config, const AudioInputFlags& flags, AudioSource source, AudioConfig* suggestedConfig) { audio_config_t halConfig; @@ -230,7 +233,7 @@ Return Device::openOutputStream(int32_t ioHandle, const DeviceAddress& dev openOutputStream_cb _hidl_cb) { AudioConfig suggestedConfig; auto [result, streamOut] = - openOutputStreamImpl(ioHandle, device, config, flags, &suggestedConfig); + openOutputStreamCore(ioHandle, device, config, flags, &suggestedConfig); _hidl_cb(result, streamOut, suggestedConfig); return Void(); } @@ -240,57 +243,64 @@ Return Device::openInputStream(int32_t ioHandle, const DeviceAddress& devi AudioSource source, openInputStream_cb _hidl_cb) { AudioConfig suggestedConfig; auto [result, streamIn] = - openInputStreamImpl(ioHandle, device, config, flags, source, &suggestedConfig); + openInputStreamCore(ioHandle, device, config, flags, source, &suggestedConfig); _hidl_cb(result, streamIn, suggestedConfig); return Void(); } #elif MAJOR_VERSION >= 4 -Return Device::openOutputStream(int32_t ioHandle, const DeviceAddress& device, - const AudioConfig& config, -#if MAJOR_VERSION <= 6 - AudioOutputFlags flags, -#else - const AudioOutputFlags& flags, -#endif - const SourceMetadata& sourceMetadata, - openOutputStream_cb _hidl_cb) { +std::tuple, AudioConfig> Device::openOutputStreamImpl( + int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config, + const SourceMetadata& sourceMetadata, #if MAJOR_VERSION <= 6 + AudioOutputFlags flags) { if (status_t status = CoreUtils::sourceMetadataToHal(sourceMetadata, nullptr); status != NO_ERROR) { #else + const AudioOutputFlags& flags) { if (status_t status = CoreUtils::sourceMetadataToHalV7(sourceMetadata, false /*ignoreNonVendorTags*/, nullptr); status != NO_ERROR) { #endif - _hidl_cb(analyzeStatus("sourceMetadataToHal", status), nullptr, AudioConfig{}); - return Void(); + return {analyzeStatus("sourceMetadataToHal", status), nullptr, {}}; } AudioConfig suggestedConfig; auto [result, streamOut] = - openOutputStreamImpl(ioHandle, device, config, flags, &suggestedConfig); + openOutputStreamCore(ioHandle, device, config, flags, &suggestedConfig); if (streamOut) { streamOut->updateSourceMetadata(sourceMetadata); } + return {result, streamOut, suggestedConfig}; +} + +Return Device::openOutputStream(int32_t ioHandle, const DeviceAddress& device, + const AudioConfig& config, +#if MAJOR_VERSION <= 6 + AudioOutputFlags flags, +#else + const AudioOutputFlags& flags, +#endif + const SourceMetadata& sourceMetadata, + openOutputStream_cb _hidl_cb) { + auto [result, streamOut, suggestedConfig] = + openOutputStreamImpl(ioHandle, device, config, sourceMetadata, flags); _hidl_cb(result, streamOut, suggestedConfig); return Void(); } -Return Device::openInputStream(int32_t ioHandle, const DeviceAddress& device, - const AudioConfig& config, +std::tuple, AudioConfig> Device::openInputStreamImpl( + int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config, #if MAJOR_VERSION <= 6 - AudioInputFlags flags, + AudioInputFlags flags, #else - const AudioInputFlags& flags, + const AudioInputFlags& flags, #endif - const SinkMetadata& sinkMetadata, - openInputStream_cb _hidl_cb) { + const SinkMetadata& sinkMetadata) { if (sinkMetadata.tracks.size() == 0) { // This should never happen, the framework must not create as stream // if there is no client ALOGE("openInputStream called without tracks connected"); - _hidl_cb(Result::INVALID_ARGUMENTS, nullptr, AudioConfig{}); - return Void(); + return {Result::INVALID_ARGUMENTS, nullptr, AudioConfig{}}; } #if MAJOR_VERSION <= 6 if (status_t status = CoreUtils::sinkMetadataToHal(sinkMetadata, nullptr); status != NO_ERROR) { @@ -299,22 +309,57 @@ Return Device::openInputStream(int32_t ioHandle, const DeviceAddress& devi false /*ignoreNonVendorTags*/, nullptr); status != NO_ERROR) { #endif - _hidl_cb(analyzeStatus("sinkMetadataToHal", status), nullptr, AudioConfig{}); - return Void(); + return {analyzeStatus("sinkMetadataToHal", status), nullptr, AudioConfig{}}; } // Pick the first one as the main. AudioSource source = sinkMetadata.tracks[0].source; AudioConfig suggestedConfig; auto [result, streamIn] = - openInputStreamImpl(ioHandle, device, config, flags, source, &suggestedConfig); + openInputStreamCore(ioHandle, device, config, flags, source, &suggestedConfig); if (streamIn) { streamIn->updateSinkMetadata(sinkMetadata); } + return {result, streamIn, suggestedConfig}; +} + +Return Device::openInputStream(int32_t ioHandle, const DeviceAddress& device, + const AudioConfig& config, +#if MAJOR_VERSION <= 6 + AudioInputFlags flags, +#else + const AudioInputFlags& flags, +#endif + const SinkMetadata& sinkMetadata, + openInputStream_cb _hidl_cb) { + auto [result, streamIn, suggestedConfig] = + openInputStreamImpl(ioHandle, device, config, flags, sinkMetadata); _hidl_cb(result, streamIn, suggestedConfig); return Void(); } #endif /* MAJOR_VERSION */ +#if MAJOR_VERSION == 7 && MINOR_VERSION == 1 +Return Device::openOutputStream_7_1(int32_t ioHandle, const DeviceAddress& device, + const AudioConfig& config, const AudioOutputFlags& flags, + const SourceMetadata& sourceMetadata, + openOutputStream_7_1_cb _hidl_cb) { + auto [result, streamOut, suggestedConfig] = + openOutputStreamImpl(ioHandle, device, config, sourceMetadata, flags); + _hidl_cb(result, streamOut, suggestedConfig); + return Void(); +} + +Return Device::openInputStream_7_1(int32_t ioHandle, const DeviceAddress& device, + const AudioConfig& config, const AudioInputFlags& flags, + const SinkMetadata& sinkMetadata, + openInputStream_7_1_cb _hidl_cb) { + auto [result, streamIn, suggestedConfig] = + openInputStreamImpl(ioHandle, device, config, flags, sinkMetadata); + _hidl_cb(result, streamIn, suggestedConfig); + return Void(); +} +#endif // V7.1 + Return Device::supportsAudioPatches() { return version() >= AUDIO_DEVICE_API_VERSION_3_0; } diff --git a/audio/core/all-versions/default/DevicesFactory.cpp b/audio/core/all-versions/default/DevicesFactory.cpp index 729f18cf91..f44daf0b0e 100644 --- a/audio/core/all-versions/default/DevicesFactory.cpp +++ b/audio/core/all-versions/default/DevicesFactory.cpp @@ -47,21 +47,53 @@ Return DevicesFactory::openDevice(IDevicesFactory::Device device, openDevi _hidl_cb(Result::INVALID_ARGUMENTS, nullptr); return Void(); } + +Return DevicesFactory::openDevice(const char* moduleName, openDevice_cb _hidl_cb) { + return openDevice(moduleName, _hidl_cb); +} #elif MAJOR_VERSION >= 4 Return DevicesFactory::openDevice(const hidl_string& moduleName, openDevice_cb _hidl_cb) { if (moduleName == AUDIO_HARDWARE_MODULE_ID_PRIMARY) { return openDevice(moduleName.c_str(), _hidl_cb); } - return openDevice(moduleName.c_str(), _hidl_cb); + return openDevice(moduleName.c_str(), _hidl_cb); } Return DevicesFactory::openPrimaryDevice(openPrimaryDevice_cb _hidl_cb) { return openDevice(AUDIO_HARDWARE_MODULE_ID_PRIMARY, _hidl_cb); } #endif -Return DevicesFactory::openDevice(const char* moduleName, openDevice_cb _hidl_cb) { - return openDevice(moduleName, _hidl_cb); +#if MAJOR_VERSION == 7 && MINOR_VERSION == 1 +Return DevicesFactory::openDevice_7_1(const hidl_string& moduleName, + openDevice_7_1_cb _hidl_cb) { + if (moduleName == AUDIO_HARDWARE_MODULE_ID_PRIMARY) { + Result result; + sp primary; + auto ret = openDevice( + AUDIO_HARDWARE_MODULE_ID_PRIMARY, + [&result, &primary](Result r, const sp& p) { + result = r; + primary = p; + }); + if (ret.isOk() && result == Result::OK && primary != nullptr) { + auto getDeviceRet = primary->getDevice(); + if (getDeviceRet.isOk()) { + _hidl_cb(result, getDeviceRet); + } else { + _hidl_cb(Result::NOT_INITIALIZED, nullptr); + } + } else { + _hidl_cb(result, nullptr); + } + return Void(); + } + return openDevice(moduleName.c_str(), _hidl_cb); +} + +Return DevicesFactory::openPrimaryDevice_7_1(openPrimaryDevice_7_1_cb _hidl_cb) { + return openDevice(AUDIO_HARDWARE_MODULE_ID_PRIMARY, _hidl_cb); } +#endif // V7.1 template Return DevicesFactory::openDevice(const char* moduleName, Callback _hidl_cb) { diff --git a/audio/core/all-versions/default/ParametersUtil.cpp b/audio/core/all-versions/default/ParametersUtil.cpp index 4d536455d4..e21eff2845 100644 --- a/audio/core/all-versions/default/ParametersUtil.cpp +++ b/audio/core/all-versions/default/ParametersUtil.cpp @@ -24,7 +24,7 @@ namespace android { namespace hardware { namespace audio { -namespace CPP_VERSION { +namespace CORE_TYPES_CPP_VERSION { namespace implementation { /** Converts a status_t in Result according to the rules of AudioParameter::get* @@ -168,7 +168,7 @@ Result ParametersUtil::setParams(const AudioParameter& param) { } } // namespace implementation -} // namespace CPP_VERSION +} // namespace CORE_TYPES_CPP_VERSION } // namespace audio } // namespace hardware } // namespace android diff --git a/audio/core/all-versions/default/PrimaryDevice.cpp b/audio/core/all-versions/default/PrimaryDevice.cpp index fe56177975..cf162f1463 100644 --- a/audio/core/all-versions/default/PrimaryDevice.cpp +++ b/audio/core/all-versions/default/PrimaryDevice.cpp @@ -29,6 +29,10 @@ namespace audio { namespace CPP_VERSION { namespace implementation { +namespace util { +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::util; +} + PrimaryDevice::PrimaryDevice(audio_hw_device_t* device) : mDevice(new Device(device)) {} PrimaryDevice::~PrimaryDevice() { @@ -195,7 +199,7 @@ Return PrimaryDevice::updateAudioPatch(int32_t previousPatch, // Methods from ::android::hardware::audio::CPP_VERSION::IPrimaryDevice follow. Return PrimaryDevice::setVoiceVolume(float volume) { - if (!isGainNormalized(volume)) { + if (!util::isGainNormalized(volume)) { ALOGW("Can not set a voice volume (%f) outside [0,1]", volume); return Result::INVALID_ARGUMENTS; } @@ -326,7 +330,7 @@ Return PrimaryDevice::setBtHfpSampleRate(uint32_t sampleRateHz) { return mDevice->setParam(AUDIO_PARAMETER_KEY_HFP_SET_SAMPLING_RATE, int(sampleRateHz)); } Return PrimaryDevice::setBtHfpVolume(float volume) { - if (!isGainNormalized(volume)) { + if (!util::isGainNormalized(volume)) { ALOGW("Can not set BT HFP volume (%f) outside [0,1]", volume); return Result::INVALID_ARGUMENTS; } diff --git a/audio/core/all-versions/default/Stream.cpp b/audio/core/all-versions/default/Stream.cpp index 7e3257399c..8e85a8b255 100644 --- a/audio/core/all-versions/default/Stream.cpp +++ b/audio/core/all-versions/default/Stream.cpp @@ -37,8 +37,12 @@ namespace audio { namespace CPP_VERSION { namespace implementation { -using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils; using ::android::hardware::audio::common::utils::splitString; +using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::CoreUtils; +namespace util { +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::util; +} Stream::Stream(bool isInput, audio_stream_t* stream) : mIsInput(isInput), mStream(stream) { (void)mIsInput; // prevent 'unused field' warnings in pre-V7 versions. diff --git a/audio/core/all-versions/default/StreamIn.cpp b/audio/core/all-versions/default/StreamIn.cpp index 2aeee43c59..2bea425f26 100644 --- a/audio/core/all-versions/default/StreamIn.cpp +++ b/audio/core/all-versions/default/StreamIn.cpp @@ -37,7 +37,11 @@ namespace audio { namespace CPP_VERSION { namespace implementation { -using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils; +using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::CoreUtils; +namespace util { +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::util; +} namespace { @@ -348,7 +352,7 @@ Return StreamIn::getAudioSource(getAudioSource_cb _hidl_cb) { } Return StreamIn::setGain(float gain) { - if (!isGainNormalized(gain)) { + if (!util::isGainNormalized(gain)) { ALOGW("Can not set a stream input gain (%f) outside [0,1]", gain); return Result::INVALID_ARGUMENTS; } diff --git a/audio/core/all-versions/default/StreamOut.cpp b/audio/core/all-versions/default/StreamOut.cpp index d027231f11..d4a89d7bf9 100644 --- a/audio/core/all-versions/default/StreamOut.cpp +++ b/audio/core/all-versions/default/StreamOut.cpp @@ -39,7 +39,11 @@ namespace audio { namespace CPP_VERSION { namespace implementation { -using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils; +using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::CoreUtils; +namespace util { +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::util; +} namespace { @@ -334,7 +338,7 @@ Return StreamOut::setVolume(float left, float right) { if (mStream->set_volume == NULL) { return Result::NOT_SUPPORTED; } - if (!isGainNormalized(left)) { + if (!util::isGainNormalized(left)) { ALOGW("Can not set a stream output volume {%f, %f} outside [0,1]", left, right); return Result::INVALID_ARGUMENTS; } diff --git a/audio/core/all-versions/default/include/core/default/Device.h b/audio/core/all-versions/default/include/core/default/Device.h index 94cad53581..0aeb6b32cb 100644 --- a/audio/core/all-versions/default/include/core/default/Device.h +++ b/audio/core/all-versions/default/include/core/default/Device.h @@ -44,7 +44,10 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::CoreUtils; +using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::ParametersUtil; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::CPP_VERSION; using AudioInputFlags = CoreUtils::AudioInputFlags; using AudioOutputFlags = CoreUtils::AudioOutputFlags; @@ -63,14 +66,32 @@ struct Device : public IDevice, public ParametersUtil { Return getInputBufferSize(const AudioConfig& config, getInputBufferSize_cb _hidl_cb) override; - std::tuple> openOutputStreamImpl(int32_t ioHandle, + std::tuple> openOutputStreamCore(int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config, const AudioOutputFlags& flags, AudioConfig* suggestedConfig); - std::tuple> openInputStreamImpl( + std::tuple> openInputStreamCore( int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config, const AudioInputFlags& flags, AudioSource source, AudioConfig* suggestedConfig); +#if MAJOR_VERSION >= 4 + std::tuple, AudioConfig> openOutputStreamImpl( + int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config, + const SourceMetadata& sourceMetadata, +#if MAJOR_VERSION <= 6 + AudioOutputFlags flags); +#else + const AudioOutputFlags& flags); +#endif + std::tuple, AudioConfig> openInputStreamImpl( + int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config, +#if MAJOR_VERSION <= 6 + AudioInputFlags flags, +#else + const AudioInputFlags& flags, +#endif + const SinkMetadata& sinkMetadata); +#endif // MAJOR_VERSION >= 4 Return openOutputStream(int32_t ioHandle, const DeviceAddress& device, const AudioConfig& config, @@ -97,6 +118,17 @@ struct Device : public IDevice, public ParametersUtil { #endif openInputStream_cb _hidl_cb) override; +#if MAJOR_VERSION == 7 && MINOR_VERSION == 1 + Return openOutputStream_7_1(int32_t ioHandle, const DeviceAddress& device, + const AudioConfig& config, const AudioOutputFlags& flags, + const SourceMetadata& sourceMetadata, + openOutputStream_7_1_cb _hidl_cb) override; + Return openInputStream_7_1(int32_t ioHandle, const DeviceAddress& device, + const AudioConfig& config, const AudioInputFlags& flags, + const SinkMetadata& sinkMetadata, + openInputStream_7_1_cb _hidl_cb) override; +#endif + Return supportsAudioPatches() override; Return createAudioPatch(const hidl_vec& sources, const hidl_vec& sinks, diff --git a/audio/core/all-versions/default/include/core/default/DevicesFactory.h b/audio/core/all-versions/default/include/core/default/DevicesFactory.h index 9f93a38a0e..566bc8ad79 100644 --- a/audio/core/all-versions/default/include/core/default/DevicesFactory.h +++ b/audio/core/all-versions/default/include/core/default/DevicesFactory.h @@ -44,11 +44,17 @@ struct DevicesFactory : public IDevicesFactory { Return openDevice(const hidl_string& device, openDevice_cb _hidl_cb) override; Return openPrimaryDevice(openPrimaryDevice_cb _hidl_cb) override; #endif +#if MAJOR_VERSION == 7 && MINOR_VERSION == 1 + Return openDevice_7_1(const hidl_string& device, openDevice_7_1_cb _hidl_cb) override; + Return openPrimaryDevice_7_1(openPrimaryDevice_7_1_cb _hidl_cb) override; +#endif - private: + private: template Return openDevice(const char* moduleName, Callback _hidl_cb); +#if MAJOR_VERSION == 2 Return openDevice(const char* moduleName, openDevice_cb _hidl_cb); +#endif static int loadAudioInterface(const char* if_name, audio_hw_device_t** dev); }; diff --git a/audio/core/all-versions/default/include/core/default/ParametersUtil.h b/audio/core/all-versions/default/include/core/default/ParametersUtil.h index 45d9b2140d..25c193aedd 100644 --- a/audio/core/all-versions/default/include/core/default/ParametersUtil.h +++ b/audio/core/all-versions/default/include/core/default/ParametersUtil.h @@ -17,7 +17,10 @@ #ifndef ANDROID_HARDWARE_AUDIO_PARAMETERS_UTIL_H_ #define ANDROID_HARDWARE_AUDIO_PARAMETERS_UTIL_H_ -#include PATH(android/hardware/audio/FILE_VERSION/types.h) +// clang-format off +#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h) +#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h) +// clang-format on #include #include @@ -28,13 +31,13 @@ namespace android { namespace hardware { namespace audio { -namespace CPP_VERSION { +namespace CORE_TYPES_CPP_VERSION { namespace implementation { using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; -using namespace ::android::hardware::audio::common::CPP_VERSION; -using namespace ::android::hardware::audio::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION; class ParametersUtil { public: @@ -62,7 +65,7 @@ class ParametersUtil { }; } // namespace implementation -} // namespace CPP_VERSION +} // namespace CORE_TYPES_CPP_VERSION } // namespace audio } // namespace hardware } // namespace android diff --git a/audio/core/all-versions/default/include/core/default/PrimaryDevice.h b/audio/core/all-versions/default/include/core/default/PrimaryDevice.h index 5f65acfcf1..8b37e014b5 100644 --- a/audio/core/all-versions/default/include/core/default/PrimaryDevice.h +++ b/audio/core/all-versions/default/include/core/default/PrimaryDevice.h @@ -36,7 +36,8 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::CPP_VERSION; struct PrimaryDevice : public IPrimaryDevice { @@ -135,8 +136,10 @@ struct PrimaryDevice : public IPrimaryDevice { Return setBtHfpVolume(float volume) override; Return updateRotation(IPrimaryDevice::Rotation rotation) override; #endif - - private: +#if MAJOR_VERSION == 7 && MINOR_VERSION == 1 + Return> getDevice() override { return mDevice; } +#endif + private: sp mDevice; virtual ~PrimaryDevice(); diff --git a/audio/core/all-versions/default/include/core/default/Stream.h b/audio/core/all-versions/default/include/core/default/Stream.h index 66d60e3aa7..4e7988401e 100644 --- a/audio/core/all-versions/default/include/core/default/Stream.h +++ b/audio/core/all-versions/default/include/core/default/Stream.h @@ -17,7 +17,9 @@ #ifndef ANDROID_HARDWARE_AUDIO_STREAM_H #define ANDROID_HARDWARE_AUDIO_STREAM_H -#include PATH(android/hardware/audio/FILE_VERSION/IStream.h) +// clang-format off +#include PATH(android/hardware/audio/COMMON_TYPES_FILE_VERSION/IStream.h) +// clang-format on #include "ParametersUtil.h" @@ -41,10 +43,13 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; +using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::ParametersUtil; #if MAJOR_VERSION <= 6 -using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioChannelBitfield; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation:: + AudioChannelBitfield; #endif -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::CPP_VERSION; struct Stream : public IStream, public ParametersUtil { diff --git a/audio/core/all-versions/default/include/core/default/StreamIn.h b/audio/core/all-versions/default/include/core/default/StreamIn.h index a980f3f999..a6346e5db4 100644 --- a/audio/core/all-versions/default/include/core/default/StreamIn.h +++ b/audio/core/all-versions/default/include/core/default/StreamIn.h @@ -42,7 +42,8 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::CPP_VERSION; struct StreamIn : public IStreamIn { diff --git a/audio/core/all-versions/default/include/core/default/StreamOut.h b/audio/core/all-versions/default/include/core/default/StreamOut.h index 0b07972810..60ad5d5ea1 100644 --- a/audio/core/all-versions/default/include/core/default/StreamOut.h +++ b/audio/core/all-versions/default/include/core/default/StreamOut.h @@ -43,7 +43,8 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::CPP_VERSION; struct StreamOut : public IStreamOut { diff --git a/audio/core/all-versions/default/include/core/default/Util.h b/audio/core/all-versions/default/include/core/default/Util.h index 78ae03eab2..abf531732a 100644 --- a/audio/core/all-versions/default/include/core/default/Util.h +++ b/audio/core/all-versions/default/include/core/default/Util.h @@ -17,7 +17,9 @@ #ifndef ANDROID_HARDWARE_AUDIO_UTIL_H #define ANDROID_HARDWARE_AUDIO_UTIL_H -#include PATH(android/hardware/audio/FILE_VERSION/types.h) +// clang-format off +#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h) +// clang-format on #include #include @@ -27,19 +29,19 @@ namespace android { namespace hardware { namespace audio { -namespace CPP_VERSION { +namespace CORE_TYPES_CPP_VERSION { namespace implementation { -using namespace ::android::hardware::audio::common::CPP_VERSION; -using namespace ::android::hardware::audio::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION; + +namespace util { /** @return true if gain is between 0 and 1 included. */ constexpr bool isGainNormalized(float gain) { return gain >= 0.0 && gain <= 1.0; } -namespace util { - template inline bool element_in(T e, const std::vector& v) { return std::find(v.begin(), v.end(), e) != v.end(); @@ -72,7 +74,7 @@ static inline Result analyzeStatus(const char* className, const char* funcName, } // namespace util } // namespace implementation -} // namespace CPP_VERSION +} // namespace CORE_TYPES_CPP_VERSION } // namespace audio } // namespace hardware } // namespace android diff --git a/audio/core/all-versions/default/util/CoreUtils.cpp b/audio/core/all-versions/default/util/CoreUtils.cpp index 773be21962..8e83ea1fbc 100644 --- a/audio/core/all-versions/default/util/CoreUtils.cpp +++ b/audio/core/all-versions/default/util/CoreUtils.cpp @@ -15,24 +15,24 @@ */ #if MAJOR_VERSION >= 7 -#include +#include PATH(APM_XSD_ENUMS_H_FILENAME) #endif #include #include #include "util/CoreUtils.h" -using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils; #if MAJOR_VERSION >= 7 namespace xsd { -using namespace ::android::audio::policy::configuration::V7_0; +using namespace ::android::audio::policy::configuration::CPP_VERSION; } #endif namespace android { namespace hardware { namespace audio { -namespace CPP_VERSION { +namespace CORE_TYPES_CPP_VERSION { namespace implementation { #define CONVERT_CHECKED(expr, result) \ @@ -389,7 +389,7 @@ status_t CoreUtils::sourceMetadataToHalV7(const SourceMetadata& sourceMetadata, #if MAJOR_VERSION >= 7 namespace xsd { -using namespace ::android::audio::policy::configuration::V7_0; +using namespace ::android::audio::policy::configuration::CPP_VERSION; } status_t CoreUtils::audioInputFlagsFromHal(audio_input_flags_t halFlagMask, @@ -470,7 +470,7 @@ status_t CoreUtils::audioOutputFlagsToHal(const AudioOutputFlags& flags, #endif } // namespace implementation -} // namespace CPP_VERSION +} // namespace CORE_TYPES_CPP_VERSION } // namespace audio } // namespace hardware } // namespace android diff --git a/audio/core/all-versions/default/util/include/util/CoreUtils.h b/audio/core/all-versions/default/util/include/util/CoreUtils.h index 1e5272a479..dc35772882 100644 --- a/audio/core/all-versions/default/util/include/util/CoreUtils.h +++ b/audio/core/all-versions/default/util/include/util/CoreUtils.h @@ -17,7 +17,7 @@ #pragma once // clang-format off -#include PATH(android/hardware/audio/FILE_VERSION/types.h) +#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h) // clang-format off #include @@ -30,13 +30,13 @@ namespace android { namespace hardware { namespace audio { -namespace CPP_VERSION { +namespace CORE_TYPES_CPP_VERSION { namespace implementation { using ::android::hardware::audio::common::utils::EnumBitfield; using ::android::hardware::hidl_vec; -using namespace ::android::hardware::audio::common::CPP_VERSION; -using namespace ::android::hardware::audio::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION; struct CoreUtils { // Note: the converters for DeviceAddress have to be in CoreUtils for HAL V4 @@ -93,8 +93,8 @@ struct CoreUtils { return NO_ERROR; } #else - using AudioInputFlags = hidl_vec<::android::hardware::audio::CPP_VERSION::AudioInOutFlag>; - using AudioOutputFlags = hidl_vec<::android::hardware::audio::CPP_VERSION::AudioInOutFlag>; + using AudioInputFlags = hidl_vec<::android::hardware::audio::CORE_TYPES_CPP_VERSION::AudioInOutFlag>; + using AudioOutputFlags = hidl_vec<::android::hardware::audio::CORE_TYPES_CPP_VERSION::AudioInOutFlag>; static status_t audioInputFlagsFromHal(audio_input_flags_t halFlagMask, AudioInputFlags* flags); static status_t audioInputFlagsToHal(const AudioInputFlags& flags, audio_input_flags_t* halFlagMask); static status_t audioOutputFlagsFromHal(audio_output_flags_t halFlagMask, AudioOutputFlags* flags); diff --git a/audio/effect/all-versions/default/Effect.cpp b/audio/effect/all-versions/default/Effect.cpp index ccfc6b22c9..49f6bf2ece 100644 --- a/audio/effect/all-versions/default/Effect.cpp +++ b/audio/effect/all-versions/default/Effect.cpp @@ -42,9 +42,10 @@ namespace CPP_VERSION { namespace implementation { #if MAJOR_VERSION <= 6 -using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioChannelBitfield; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation:: + AudioChannelBitfield; #endif -using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils; namespace { diff --git a/audio/effect/all-versions/default/Effect.h b/audio/effect/all-versions/default/Effect.h index d5218f7240..f9a6796e8f 100644 --- a/audio/effect/all-versions/default/Effect.h +++ b/audio/effect/all-versions/default/Effect.h @@ -48,9 +48,10 @@ using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; #if MAJOR_VERSION <= 6 -using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioDeviceBitfield; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation:: + AudioDeviceBitfield; #endif -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::effect::CPP_VERSION; struct Effect : public IEffect { diff --git a/audio/effect/all-versions/default/EffectsFactory.cpp b/audio/effect/all-versions/default/EffectsFactory.cpp index eb1cb4971c..e93ad893a8 100644 --- a/audio/effect/all-versions/default/EffectsFactory.cpp +++ b/audio/effect/all-versions/default/EffectsFactory.cpp @@ -53,7 +53,7 @@ namespace effect { namespace CPP_VERSION { namespace implementation { -using ::android::hardware::audio::common::CPP_VERSION::implementation::UuidUtils; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::UuidUtils; // static sp EffectsFactory::dispatchEffectInstanceCreation(const effect_descriptor_t& halDescriptor, diff --git a/audio/effect/all-versions/default/EffectsFactory.h b/audio/effect/all-versions/default/EffectsFactory.h index 0b86836e4b..da16923b1e 100644 --- a/audio/effect/all-versions/default/EffectsFactory.h +++ b/audio/effect/all-versions/default/EffectsFactory.h @@ -41,7 +41,7 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::effect::CPP_VERSION; struct EffectsFactory : public IEffectsFactory { diff --git a/audio/effect/all-versions/default/EnvironmentalReverbEffect.h b/audio/effect/all-versions/default/EnvironmentalReverbEffect.h index 9694b5d8c1..001774d7fe 100644 --- a/audio/effect/all-versions/default/EnvironmentalReverbEffect.h +++ b/audio/effect/all-versions/default/EnvironmentalReverbEffect.h @@ -43,7 +43,7 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::effect::CPP_VERSION; struct EnvironmentalReverbEffect : public IEnvironmentalReverbEffect { diff --git a/audio/effect/all-versions/default/EqualizerEffect.h b/audio/effect/all-versions/default/EqualizerEffect.h index 7a6bc0a8b0..c4d76c1c18 100644 --- a/audio/effect/all-versions/default/EqualizerEffect.h +++ b/audio/effect/all-versions/default/EqualizerEffect.h @@ -43,7 +43,7 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::effect::CPP_VERSION; struct EqualizerEffect : public IEqualizerEffect { diff --git a/audio/effect/all-versions/default/LoudnessEnhancerEffect.h b/audio/effect/all-versions/default/LoudnessEnhancerEffect.h index 6d80207dc3..122ec364c9 100644 --- a/audio/effect/all-versions/default/LoudnessEnhancerEffect.h +++ b/audio/effect/all-versions/default/LoudnessEnhancerEffect.h @@ -39,7 +39,7 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::effect::CPP_VERSION; struct LoudnessEnhancerEffect : public ILoudnessEnhancerEffect { diff --git a/audio/effect/all-versions/default/NoiseSuppressionEffect.h b/audio/effect/all-versions/default/NoiseSuppressionEffect.h index 6cc45b983c..96b9ecfd62 100644 --- a/audio/effect/all-versions/default/NoiseSuppressionEffect.h +++ b/audio/effect/all-versions/default/NoiseSuppressionEffect.h @@ -41,7 +41,7 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::effect::CPP_VERSION; struct NoiseSuppressionEffect : public INoiseSuppressionEffect { diff --git a/audio/effect/all-versions/default/PresetReverbEffect.h b/audio/effect/all-versions/default/PresetReverbEffect.h index eb55e20fe2..9d82c08abd 100644 --- a/audio/effect/all-versions/default/PresetReverbEffect.h +++ b/audio/effect/all-versions/default/PresetReverbEffect.h @@ -39,7 +39,7 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::effect::CPP_VERSION; struct PresetReverbEffect : public IPresetReverbEffect { diff --git a/audio/effect/all-versions/default/VirtualizerEffect.cpp b/audio/effect/all-versions/default/VirtualizerEffect.cpp index 1dce1810ea..6efc4eaa12 100644 --- a/audio/effect/all-versions/default/VirtualizerEffect.cpp +++ b/audio/effect/all-versions/default/VirtualizerEffect.cpp @@ -34,7 +34,7 @@ namespace effect { namespace CPP_VERSION { namespace implementation { -using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils; VirtualizerEffect::VirtualizerEffect(effect_handle_t handle) : mEffect(new Effect(false /*isInput*/, handle)) {} diff --git a/audio/effect/all-versions/default/VirtualizerEffect.h b/audio/effect/all-versions/default/VirtualizerEffect.h index 3ed06d147f..f26e4fa215 100644 --- a/audio/effect/all-versions/default/VirtualizerEffect.h +++ b/audio/effect/all-versions/default/VirtualizerEffect.h @@ -40,9 +40,10 @@ using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; #if MAJOR_VERSION <= 6 -using ::android::hardware::audio::common::CPP_VERSION::implementation::AudioChannelBitfield; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation:: + AudioChannelBitfield; #endif -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::effect::CPP_VERSION; struct VirtualizerEffect : public IVirtualizerEffect { diff --git a/audio/effect/all-versions/default/VisualizerEffect.h b/audio/effect/all-versions/default/VisualizerEffect.h index 3ae4b08193..b8424c418d 100644 --- a/audio/effect/all-versions/default/VisualizerEffect.h +++ b/audio/effect/all-versions/default/VisualizerEffect.h @@ -39,7 +39,7 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::effect::CPP_VERSION; struct VisualizerEffect : public IVisualizerEffect { diff --git a/audio/effect/all-versions/default/util/EffectUtils.cpp b/audio/effect/all-versions/default/util/EffectUtils.cpp index 1156d211a1..296f84d2db 100644 --- a/audio/effect/all-versions/default/util/EffectUtils.cpp +++ b/audio/effect/all-versions/default/util/EffectUtils.cpp @@ -25,8 +25,8 @@ #include "util/EffectUtils.h" -using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils; -using ::android::hardware::audio::common::CPP_VERSION::implementation::UuidUtils; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::UuidUtils; using ::android::hardware::audio::common::utils::EnumBitfield; namespace android { @@ -36,7 +36,7 @@ namespace effect { namespace CPP_VERSION { namespace implementation { -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; #define CONVERT_CHECKED(expr, result) \ if (status_t status = (expr); status != NO_ERROR) { \ diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 1731c9cda3..1b8cf1b16e 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -10,7 +10,7 @@ android.hardware.audio 6.0 - 7.0 + 7.0-1 IDevicesFactory default -- GitLab From 40fde0bc07be50644705a708a522c941840f35c7 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Tue, 18 Jan 2022 23:54:27 +0000 Subject: [PATCH 502/825] Audio HAL V7.1: Update VTS Mechanical updates from global greps. Updated test code to use new methods from V7.1. Added missing checks for null pointers in PcmOnlyConfig...StreamTest::releasePatchIfNeeded for V7. Bug: 214426419 Test: atest VtsHalAudioV7_1TargetTest Change-Id: Id3a99993bf2ee0c87d44f668d759f7c10db9a435 --- .../default/tests/hidlutils6_tests.cpp | 8 +- .../default/tests/hidlutils_tests.cpp | 4 +- .../default/util/tests/coreutils_tests.cpp | 2 +- .../functional/2.0/AudioPrimaryHidlHalUtils.h | 10 ++- .../4.0/AudioPrimaryHidlHalTest.cpp | 47 ++++++++--- .../functional/4.0/AudioPrimaryHidlHalUtils.h | 31 +++---- .../6.0/AudioPrimaryHidlHalTest.cpp | 9 +- .../vts/functional/6.0/Generators.cpp | 6 +- .../7.0/AudioPrimaryHidlHalTest.cpp | 20 +++-- .../vts/functional/7.0/Generators.cpp | 12 +-- .../vts/functional/7.0/PolicyConfig.cpp | 6 +- .../vts/functional/7.0/PolicyConfig.h | 12 +-- .../7.1/AudioPrimaryHidlHalTest.cpp | 18 ++++ .../all-versions/vts/functional/Android.bp | 33 ++++++++ .../vts/functional/AudioPrimaryHidlHalTest.h | 69 ++++++++++----- .../vts/functional/AudioTestDefinitions.h | 16 ++-- .../vts/functional/ConfigHelper.h | 4 +- .../vts/functional/DeviceManager.h | 83 +++++++++++++++---- .../functional/VtsHalAudioV7_1TargetTest.xml | 39 +++++++++ .../vts/functional/tests/generators_tests.cpp | 2 +- .../default/util/tests/effectutils_tests.cpp | 2 +- .../VtsHalAudioEffectTargetTest.cpp | 2 +- 22 files changed, 318 insertions(+), 117 deletions(-) create mode 100644 audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp create mode 100644 audio/core/all-versions/vts/functional/VtsHalAudioV7_1TargetTest.xml diff --git a/audio/common/all-versions/default/tests/hidlutils6_tests.cpp b/audio/common/all-versions/default/tests/hidlutils6_tests.cpp index 3a24e752bc..ca59b9de6c 100644 --- a/audio/common/all-versions/default/tests/hidlutils6_tests.cpp +++ b/audio/common/all-versions/default/tests/hidlutils6_tests.cpp @@ -23,14 +23,14 @@ #include using namespace android; -using namespace ::android::hardware::audio::common::CPP_VERSION; -using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils; // Not generated automatically because DeviceAddress contains // an union. // // operator== must be defined in the same namespace as the data type. -namespace android::hardware::audio::common::CPP_VERSION { +namespace android::hardware::audio::common::COMMON_TYPES_CPP_VERSION { inline bool operator==(const DeviceAddress& lhs, const DeviceAddress& rhs) { if (lhs.device != rhs.device) return false; @@ -49,7 +49,7 @@ inline bool operator==(const DeviceAddress& lhs, const DeviceAddress& rhs) { return lhs.busAddress == rhs.busAddress; } -} // namespace android::hardware::audio::common::CPP_VERSION +} // namespace android::hardware::audio::common::COMMON_TYPES_CPP_VERSION static void ConvertDeviceAddress(const DeviceAddress& device) { audio_devices_t halDeviceType; diff --git a/audio/common/all-versions/default/tests/hidlutils_tests.cpp b/audio/common/all-versions/default/tests/hidlutils_tests.cpp index c9e6fac7b2..2749cce748 100644 --- a/audio/common/all-versions/default/tests/hidlutils_tests.cpp +++ b/audio/common/all-versions/default/tests/hidlutils_tests.cpp @@ -29,8 +29,8 @@ using namespace android; using ::android::hardware::hidl_vec; -using namespace ::android::hardware::audio::common::CPP_VERSION; -using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils; namespace xsd { using namespace ::android::audio::policy::configuration::V7_0; } diff --git a/audio/core/all-versions/default/util/tests/coreutils_tests.cpp b/audio/core/all-versions/default/util/tests/coreutils_tests.cpp index 0c18482632..3976b088e4 100644 --- a/audio/core/all-versions/default/util/tests/coreutils_tests.cpp +++ b/audio/core/all-versions/default/util/tests/coreutils_tests.cpp @@ -28,7 +28,7 @@ #include using namespace android; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::CPP_VERSION; using ::android::hardware::hidl_vec; using ::android::hardware::audio::CPP_VERSION::implementation::CoreUtils; diff --git a/audio/core/all-versions/vts/functional/2.0/AudioPrimaryHidlHalUtils.h b/audio/core/all-versions/vts/functional/2.0/AudioPrimaryHidlHalUtils.h index 1cffd41831..dd80dd6fbc 100644 --- a/audio/core/all-versions/vts/functional/2.0/AudioPrimaryHidlHalUtils.h +++ b/audio/core/all-versions/vts/functional/2.0/AudioPrimaryHidlHalUtils.h @@ -14,16 +14,18 @@ * limitations under the License. */ +// clang-format off #include PATH(android/hardware/audio/FILE_VERSION/IStream.h) -#include PATH(android/hardware/audio/FILE_VERSION/types.h) -#include PATH(android/hardware/audio/common/FILE_VERSION/types.h) +#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h) +#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h) +// clang-format on #include using ::android::hardware::hidl_handle; using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; -using ::android::hardware::audio::common::CPP_VERSION::AudioChannelMask; -using ::android::hardware::audio::common::CPP_VERSION::AudioFormat; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::AudioChannelMask; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::AudioFormat; using ::android::hardware::audio::CPP_VERSION::IStream; using ::android::hardware::audio::CPP_VERSION::ParameterValue; using ::android::hardware::audio::CPP_VERSION::Result; diff --git a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp index 787654bdd3..a9797bbfbd 100644 --- a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp +++ b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp @@ -17,7 +17,7 @@ #include "AudioPrimaryHidlHalTest.h" #if MAJOR_VERSION >= 7 -#include +#include PATH(APM_XSD_H_FILENAME) #include using android::xsdc_enum_range; @@ -28,17 +28,37 @@ TEST_P(AudioHidlTest, OpenPrimaryDeviceUsingGetDevice) { if (getDeviceName() != DeviceManager::kPrimaryDevice) { GTEST_SKIP() << "No primary device on this factory"; // returns } + EXPECT_TRUE( + DeviceManager::getInstance().reset(getFactoryName(), DeviceManager::kPrimaryDevice)); - { // Scope for device SPs - sp baseDevice = - DeviceManager::getInstance().get(getFactoryName(), DeviceManager::kPrimaryDevice); - ASSERT_TRUE(baseDevice != nullptr); - Return> primaryDevice = IPrimaryDevice::castFrom(baseDevice); + // Must use IDevicesFactory directly because DeviceManager always uses + // the latest interfaces version and corresponding methods for opening + // them. However, in minor package uprevs IPrimaryDevice does not inherit + // IDevice from the same package and thus IDevice can not be upcasted + // (see the interfaces in V7.1). + auto factory = DevicesFactoryManager::getInstance().get(getFactoryName()); + ASSERT_TRUE(factory != nullptr); + sp<::android::hardware::audio::CORE_TYPES_CPP_VERSION::IDevice> baseDevice; + Result result; + auto ret = factory->openDevice(DeviceManager::kPrimaryDevice, returnIn(result, baseDevice)); + ASSERT_TRUE(ret.isOk()) << ret.description(); + ASSERT_EQ(Result::OK, result); + ASSERT_TRUE(baseDevice != nullptr); + { + Return> + primaryDevice = ::android::hardware::audio::CORE_TYPES_CPP_VERSION::IPrimaryDevice:: + castFrom(baseDevice); EXPECT_TRUE(primaryDevice.isOk()); - EXPECT_TRUE(sp(primaryDevice) != nullptr); + EXPECT_TRUE(sp<::android::hardware::audio::CORE_TYPES_CPP_VERSION::IPrimaryDevice>( + primaryDevice) != nullptr); } - EXPECT_TRUE( - DeviceManager::getInstance().reset(getFactoryName(), DeviceManager::kPrimaryDevice)); +#if MAJOR_VERSION < 6 + baseDevice.clear(); + DeviceManager::waitForInstanceDestruction(); +#else + auto closeRet = baseDevice->close(); + EXPECT_TRUE(closeRet.isOk()); +#endif } ////////////////////////////////////////////////////////////////////////////// @@ -183,7 +203,7 @@ TEST_IO_STREAM(SetDevices, "Check that the stream can be rerouted to SPEAKER or areAudioPatchesSupported() ? doc::partialTest("Audio patches are supported") : testSetDevices(stream.get(), address)) -static void checkGetHwAVSync(IDevice* device) { +static void checkGetHwAVSync(::android::hardware::audio::CPP_VERSION::IDevice* device) { Result res; AudioHwSync sync; ASSERT_OK(device->getHwAvSync(returnIn(res, sync))); @@ -215,7 +235,7 @@ TEST_P(InputStreamTest, updateSinkMetadata) { ASSERT_OK(stream->updateSinkMetadata(initMetadata)); #elif MAJOR_VERSION >= 7 - xsdc_enum_range range; + xsdc_enum_range range; // Test all possible track configuration for (auto source : range) { for (float volume : {0.0, 0.5, 1.0}) { @@ -272,8 +292,9 @@ TEST_P(OutputStreamTest, updateSourceMetadata) { // Restore initial ASSERT_OK(stream->updateSourceMetadata(initMetadata)); #elif MAJOR_VERSION >= 7 - xsdc_enum_range usageRange; - xsdc_enum_range contentRange; + xsdc_enum_range usageRange; + xsdc_enum_range + contentRange; // Test all possible track configuration for (auto usage : usageRange) { for (auto content : contentRange) { diff --git a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalUtils.h b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalUtils.h index 81a1f7b4b7..a567cf90e2 100644 --- a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalUtils.h +++ b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalUtils.h @@ -14,33 +14,36 @@ * limitations under the License. */ -#include PATH(android/hardware/audio/FILE_VERSION/IStream.h) -#include PATH(android/hardware/audio/FILE_VERSION/types.h) -#include PATH(android/hardware/audio/common/FILE_VERSION/types.h) +// clang-format off +#include PATH(android/hardware/audio/FILE_VERSION/IStreamIn.h) +#include PATH(android/hardware/audio/FILE_VERSION/IStreamOut.h) +#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h) +#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h) +// clang-format on #include using ::android::hardware::hidl_bitfield; using ::android::hardware::hidl_handle; using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; -using ::android::hardware::audio::common::CPP_VERSION::AudioChannelMask; -using ::android::hardware::audio::common::CPP_VERSION::AudioFormat; -using ::android::hardware::audio::CPP_VERSION::IStream; -using ::android::hardware::audio::CPP_VERSION::ParameterValue; -using ::android::hardware::audio::CPP_VERSION::Result; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::AudioChannelMask; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::AudioFormat; +using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStream; +using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::ParameterValue; +using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::Result; using namespace ::android::hardware::audio::common::test::utility; -using Rotation = ::android::hardware::audio::CPP_VERSION::IPrimaryDevice::Rotation; -using ::android::hardware::audio::common::CPP_VERSION::AudioContentType; -using ::android::hardware::audio::common::CPP_VERSION::AudioUsage; -using ::android::hardware::audio::CPP_VERSION::MicrophoneInfo; +using Rotation = ::android::hardware::audio::CORE_TYPES_CPP_VERSION::IPrimaryDevice::Rotation; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::AudioContentType; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::AudioUsage; +using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::MicrophoneInfo; #if MAJOR_VERSION < 5 using ::android::hardware::audio::CPP_VERSION::SinkMetadata; using ::android::hardware::audio::CPP_VERSION::SourceMetadata; #else -using ::android::hardware::audio::common::CPP_VERSION::SinkMetadata; -using ::android::hardware::audio::common::CPP_VERSION::SourceMetadata; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::SinkMetadata; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::SourceMetadata; #endif struct Parameters { diff --git a/audio/core/all-versions/vts/functional/6.0/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/6.0/AudioPrimaryHidlHalTest.cpp index 8af4c7855a..aef94da6eb 100644 --- a/audio/core/all-versions/vts/functional/6.0/AudioPrimaryHidlHalTest.cpp +++ b/audio/core/all-versions/vts/functional/6.0/AudioPrimaryHidlHalTest.cpp @@ -59,7 +59,8 @@ TEST_P(DualMonoModeAccessorHidlTest, DualMonoModeTest) { testAccessors(&OutputStreamTest::getStream, "dual mono mode", Initial{DualMonoMode::OFF}, {DualMonoMode::LR, DualMonoMode::LL, DualMonoMode::RR}, - &IStreamOut::setDualMonoMode, &IStreamOut::getDualMonoMode); + &::android::hardware::audio::CPP_VERSION::IStreamOut::setDualMonoMode, + &::android::hardware::audio::CPP_VERSION::IStreamOut::getDualMonoMode); } GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DualMonoModeAccessorHidlTest); @@ -73,7 +74,8 @@ TEST_P(AudioDescriptionMixLevelHidlTest, AudioDescriptionMixLevelTest) { testAccessors( &OutputStreamTest::getStream, "audio description mix level", Initial{-std::numeric_limits::infinity()}, {-48.0f, -1.0f, 0.0f, 1.0f, 48.0f}, - &IStreamOut::setAudioDescriptionMixLevel, &IStreamOut::getAudioDescriptionMixLevel, + &::android::hardware::audio::CPP_VERSION::IStreamOut::setAudioDescriptionMixLevel, + &::android::hardware::audio::CPP_VERSION::IStreamOut::getAudioDescriptionMixLevel, {48.5f, 1000.0f, std::numeric_limits::infinity()}); } @@ -105,7 +107,8 @@ TEST_P(PlaybackRateParametersHidlTest, PlaybackRateParametersTest) { PlaybackRate{0.5f, 0.5f, TimestretchMode::VOICE, TimestretchFallbackMode::MUTE}, PlaybackRate{1000.0f, 1000.0f, TimestretchMode::VOICE, TimestretchFallbackMode::MUTE}, PlaybackRate{1.0f, 1.0f, TimestretchMode::VOICE, TimestretchFallbackMode::FAIL}}, - &IStreamOut::setPlaybackRateParameters, &IStreamOut::getPlaybackRateParameters, + &::android::hardware::audio::CPP_VERSION::IStreamOut::setPlaybackRateParameters, + &::android::hardware::audio::CPP_VERSION::IStreamOut::getPlaybackRateParameters, {PlaybackRate{1000.0f, 1000.0f, TimestretchMode::DEFAULT, TimestretchFallbackMode::FAIL}, PlaybackRate{1000.0f, 1000.0f, TimestretchMode::VOICE, diff --git a/audio/core/all-versions/vts/functional/6.0/Generators.cpp b/audio/core/all-versions/vts/functional/6.0/Generators.cpp index e3b98c909f..dafd32697b 100644 --- a/audio/core/all-versions/vts/functional/6.0/Generators.cpp +++ b/audio/core/all-versions/vts/functional/6.0/Generators.cpp @@ -21,8 +21,8 @@ #include "PolicyConfig.h" // clang-format off -#include PATH(android/hardware/audio/FILE_VERSION/types.h) -#include PATH(android/hardware/audio/common/FILE_VERSION/types.h) +#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h) +#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h) // clang-format on // Forward declaration for functions that are substituted @@ -30,7 +30,7 @@ const PolicyConfig& getCachedPolicyConfig(); const std::vector& getDeviceParameters(); -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::CPP_VERSION; std::vector generateOutputDeviceConfigParameters(bool oneProfilePerDevice) { diff --git a/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp index 27598012fe..96cd52716a 100644 --- a/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp +++ b/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp @@ -381,13 +381,13 @@ TEST_P(StreamOpenTest, OpenInputOrOutputStreamTest) { "IDevice::open{Input|Output}Stream method."); AudioConfig suggestedConfig{}; if (isParamForInputStream()) { - sp stream; + sp<::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn> stream; ASSERT_OK(getDevice()->openInputStream(AudioIoHandle{}, getDeviceAddress(), getConfig(), getFlags(), getSinkMetadata(), returnIn(res, stream, suggestedConfig))); ASSERT_TRUE(stream == nullptr); } else { - sp stream; + sp<::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamOut> stream; ASSERT_OK(getDevice()->openOutputStream(AudioIoHandle{}, getDeviceAddress(), getConfig(), getFlags(), getSourceMetadata(), returnIn(res, stream, suggestedConfig))); @@ -551,13 +551,15 @@ class PcmOnlyConfigOutputStreamTest : public OutputStreamTest { } void releasePatchIfNeeded() { - if (areAudioPatchesSupported()) { - if (mHasPatch) { + if (getDevice()) { + if (areAudioPatchesSupported() && mHasPatch) { EXPECT_OK(getDevice()->releaseAudioPatch(mPatchHandle)); mHasPatch = false; } } else { - EXPECT_OK(stream->setDevices({address})); + if (stream) { + EXPECT_OK(stream->setDevices({address})); + } } } @@ -724,13 +726,15 @@ class PcmOnlyConfigInputStreamTest : public InputStreamTest { } void releasePatchIfNeeded() { - if (areAudioPatchesSupported()) { - if (mHasPatch) { + if (getDevice()) { + if (areAudioPatchesSupported() && mHasPatch) { EXPECT_OK(getDevice()->releaseAudioPatch(mPatchHandle)); mHasPatch = false; } } else { - EXPECT_OK(stream->setDevices({address})); + if (stream) { + EXPECT_OK(stream->setDevices({address})); + } } } diff --git a/audio/core/all-versions/vts/functional/7.0/Generators.cpp b/audio/core/all-versions/vts/functional/7.0/Generators.cpp index 42bf1d341d..f936d0afbf 100644 --- a/audio/core/all-versions/vts/functional/7.0/Generators.cpp +++ b/audio/core/all-versions/vts/functional/7.0/Generators.cpp @@ -20,20 +20,20 @@ #include "7.0/PolicyConfig.h" // clang-format off -#include PATH(android/hardware/audio/FILE_VERSION/types.h) -#include PATH(android/hardware/audio/common/FILE_VERSION/types.h) +#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h) +#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h) // clang-format on -#include -#include +#include PATH(APM_XSD_ENUMS_H_FILENAME) +#include PATH(APM_XSD_H_FILENAME) // Forward declaration for functions that are substituted // in generator unit tests. const PolicyConfig& getCachedPolicyConfig(); const std::vector& getDeviceParameters(); -using namespace ::android::hardware::audio::common::CPP_VERSION; -using namespace ::android::hardware::audio::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION; namespace xsd { using namespace ::android::audio::policy::configuration::CPP_VERSION; } diff --git a/audio/core/all-versions/vts/functional/7.0/PolicyConfig.cpp b/audio/core/all-versions/vts/functional/7.0/PolicyConfig.cpp index 29882077d1..d674403a2c 100644 --- a/audio/core/all-versions/vts/functional/7.0/PolicyConfig.cpp +++ b/audio/core/all-versions/vts/functional/7.0/PolicyConfig.cpp @@ -30,9 +30,9 @@ using ::android::NO_ERROR; using ::android::OK; -using namespace ::android::hardware::audio::common::CPP_VERSION; -using namespace ::android::hardware::audio::CPP_VERSION; -using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION; +using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils; using ::android::hardware::audio::common::utils::splitString; namespace xsd { using namespace ::android::audio::policy::configuration::CPP_VERSION; diff --git a/audio/core/all-versions/vts/functional/7.0/PolicyConfig.h b/audio/core/all-versions/vts/functional/7.0/PolicyConfig.h index f798839cb8..4aea503938 100644 --- a/audio/core/all-versions/vts/functional/7.0/PolicyConfig.h +++ b/audio/core/all-versions/vts/functional/7.0/PolicyConfig.h @@ -25,15 +25,15 @@ #include // clang-format off -#include PATH(android/hardware/audio/FILE_VERSION/types.h) -#include PATH(android/hardware/audio/common/FILE_VERSION/types.h) +#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h) +#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h) // clang-format on -#include -#include +#include PATH(APM_XSD_ENUMS_H_FILENAME) +#include PATH(APM_XSD_H_FILENAME) -using namespace ::android::hardware::audio::common::CPP_VERSION; -using namespace ::android::hardware::audio::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION; namespace xsd { using namespace ::android::audio::policy::configuration::CPP_VERSION; using Module = Modules::Module; diff --git a/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp new file mode 100644 index 0000000000..b750f56ca2 --- /dev/null +++ b/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp @@ -0,0 +1,18 @@ +/* + * 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. + */ + +// pull in all the <= 7.0 tests +#include "7.0/AudioPrimaryHidlHalTest.cpp" diff --git a/audio/core/all-versions/vts/functional/Android.bp b/audio/core/all-versions/vts/functional/Android.bp index b280d7c3ae..61ab1bbb6d 100644 --- a/audio/core/all-versions/vts/functional/Android.bp +++ b/audio/core/all-versions/vts/functional/Android.bp @@ -184,6 +184,39 @@ cc_test { test_config: "VtsHalAudioV7_0TargetTest.xml", } +cc_test { + name: "VtsHalAudioV7_1TargetTest", + defaults: ["VtsHalAudioTargetTest_defaults"], + srcs: [ + "7.1/AudioPrimaryHidlHalTest.cpp", + "7.0/Generators.cpp", + "7.0/PolicyConfig.cpp", + ], + generated_headers: ["audio_policy_configuration_V7_1_parser"], + generated_sources: ["audio_policy_configuration_V7_1_parser"], + static_libs: [ + "android.hardware.audio@7.0", + "android.hardware.audio@7.1", + "android.hardware.audio.common@7.0", + "android.hardware.audio.common@7.0-enums", + "android.hardware.audio.common@7.1-enums", + "android.hardware.audio.common@7.0-util", + ], + cflags: [ + "-DMAJOR_VERSION=7", + "-DMINOR_VERSION=1", + "-DCOMMON_TYPES_MINOR_VERSION=0", + "-DCORE_TYPES_MINOR_VERSION=0", + "-include common/all-versions/VersionMacro.h", + ], + data: [ + ":audio_policy_configuration_V7_1", + ], + // Use test_config for vts suite. + // TODO(b/146104851): Add auto-gen rules and remove it. + test_config: "VtsHalAudioV7_1TargetTest.xml", +} + // Note: the following aren't VTS tests, but rather unit tests // to verify correctness of test utilities. cc_test { diff --git a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h index 340903a4ea..404532a6fa 100644 --- a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h +++ b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h @@ -37,15 +37,17 @@ #include #include +// clang-format off #include PATH(android/hardware/audio/FILE_VERSION/IDevice.h) #include PATH(android/hardware/audio/FILE_VERSION/IDevicesFactory.h) #include PATH(android/hardware/audio/FILE_VERSION/IPrimaryDevice.h) -#include PATH(android/hardware/audio/FILE_VERSION/types.h) -#include PATH(android/hardware/audio/common/FILE_VERSION/types.h) +#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h) +#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h) #if MAJOR_VERSION >= 7 -#include -#include +#include PATH(APM_XSD_ENUMS_H_FILENAME) +#include PATH(APM_XSD_H_FILENAME) #endif +// clang-format on #include #include @@ -86,7 +88,7 @@ using ::android::hardware::audio::common::utils::EnumBitfield; using ::android::hardware::audio::common::utils::mkEnumBitfield; using ::android::hardware::details::toHexString; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::common::test::utility; using namespace ::android::hardware::audio::CPP_VERSION; using ReadParameters = ::android::hardware::audio::CPP_VERSION::IStreamIn::ReadParameters; @@ -124,6 +126,9 @@ static auto invalidStateOrNotSupported = {Result::INVALID_STATE, Result::NOT_SUP class HidlTest : public ::testing::Test { public: + using IDevice = ::android::hardware::audio::CPP_VERSION::IDevice; + using IDevicesFactory = ::android::hardware::audio::CPP_VERSION::IDevicesFactory; + virtual ~HidlTest() = default; // public access to avoid annoyances when using this method in template classes // derived from test classes @@ -168,7 +173,8 @@ const PolicyConfig& getCachedPolicyConfig() { } TEST(CheckConfig, audioPolicyConfigurationValidation) { - const auto factories = ::android::hardware::getAllHalInstanceNames(IDevicesFactory::descriptor); + const auto factories = ::android::hardware::getAllHalInstanceNames( + ::android::hardware::audio::CPP_VERSION::IDevicesFactory::descriptor); if (factories.size() == 0) { GTEST_SKIP() << "Skipping audioPolicyConfigurationValidation because no factory instances " "are found."; @@ -198,8 +204,8 @@ static inline std::string DeviceParameterToString( const std::vector& getDeviceParameters() { static std::vector parameters = [] { std::vector result; - const auto factories = - ::android::hardware::getAllHalInstanceNames(IDevicesFactory::descriptor); + const auto factories = ::android::hardware::getAllHalInstanceNames( + ::android::hardware::audio::CPP_VERSION::IDevicesFactory::descriptor); const auto devices = getCachedPolicyConfig().getModulesWithDevicesNames(); result.reserve(devices.size()); for (const auto& factoryName : factories) { @@ -217,8 +223,8 @@ const std::vector& getDeviceParameters() { const std::vector& getDeviceParametersForFactoryTests() { static std::vector parameters = [] { std::vector result; - const auto factories = - ::android::hardware::getAllHalInstanceNames(IDevicesFactory::descriptor); + const auto factories = ::android::hardware::getAllHalInstanceNames( + ::android::hardware::audio::CPP_VERSION::IDevicesFactory::descriptor); for (const auto& factoryName : factories) { result.emplace_back(factoryName, DeviceManager::getInstance().getPrimary(factoryName) != nullptr @@ -288,6 +294,8 @@ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AudioPolicyConfigTest); // Test audio devices factory class AudioHidlTest : public AudioHidlTestWithDeviceParameter { public: + using IPrimaryDevice = ::android::hardware::audio::CPP_VERSION::IPrimaryDevice; + void SetUp() override { ASSERT_NO_FATAL_FAILURE(AudioHidlTestWithDeviceParameter::SetUp()); // setup base ASSERT_TRUE(getDevicesFactory() != nullptr); @@ -301,7 +309,7 @@ TEST_P(AudioHidlTest, GetAudioDevicesFactoryService) { TEST_P(AudioHidlTest, OpenDeviceInvalidParameter) { doc::test("Test passing an invalid parameter to openDevice"); Result result; - sp device; + sp<::android::hardware::audio::CORE_TYPES_CPP_VERSION::IDevice> device; #if MAJOR_VERSION == 2 auto invalidDevice = IDevicesFactory::Device(-1); #elif MAJOR_VERSION >= 4 @@ -572,8 +580,8 @@ static std::string DeviceConfigParameterToString( [](auto&& arg) -> std::string { using T = std::decay_t; // Need to use FQN of toString to avoid confusing the compiler - return ::android::hardware::audio::common::CPP_VERSION::toString( - hidl_bitfield(arg)); + return ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION:: + toString(hidl_bitfield(arg)); }, std::get(info.param))); #elif MAJOR_VERSION >= 7 @@ -890,6 +898,8 @@ class OpenStreamTest : public AudioHidlTestWithDeviceConfigParameter { class StreamWriter : public StreamWorker { public: + using IStreamOut = ::android::hardware::audio::CPP_VERSION::IStreamOut; + StreamWriter(IStreamOut* stream, size_t bufferSize) : mStream(stream), mBufferSize(bufferSize), mData(mBufferSize) {} ~StreamWriter() { @@ -998,7 +1008,8 @@ class StreamWriter : public StreamWorker { EventFlag* mEfGroup = nullptr; }; -class OutputStreamTest : public OpenStreamTest { +class OutputStreamTest + : public OpenStreamTest<::android::hardware::audio::CPP_VERSION::IStreamOut> { void SetUp() override { ASSERT_NO_FATAL_FAILURE(OpenStreamTest::SetUp()); // setup base #if MAJOR_VERSION <= 6 @@ -1012,9 +1023,12 @@ class OutputStreamTest : public OpenStreamTest { [&](AudioIoHandle handle, AudioConfig config, auto cb) { #if MAJOR_VERSION == 2 return getDevice()->openOutputStream(handle, address, config, flags, cb); -#elif MAJOR_VERSION >= 4 +#elif MAJOR_VERSION >= 4 && (MAJOR_VERSION < 7 || (MAJOR_VERSION == 7 && MINOR_VERSION == 0)) return getDevice()->openOutputStream(handle, address, config, flags, initMetadata, cb); +#elif MAJOR_VERSION == 7 && MINOR_VERSION == 1 + return getDevice()->openOutputStream_7_1(handle, address, config, flags, + initMetadata, cb); #endif }, config); @@ -1075,6 +1089,8 @@ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(OutputStreamTest); class StreamReader : public StreamWorker { public: + using IStreamIn = ::android::hardware::audio::CPP_VERSION::IStreamIn; + StreamReader(IStreamIn* stream, size_t bufferSize) : mStream(stream), mBufferSize(bufferSize), mData(mBufferSize) {} ~StreamReader() { @@ -1188,7 +1204,7 @@ class StreamReader : public StreamWorker { EventFlag* mEfGroup = nullptr; }; -class InputStreamTest : public OpenStreamTest { +class InputStreamTest : public OpenStreamTest<::android::hardware::audio::CPP_VERSION::IStreamIn> { void SetUp() override { ASSERT_NO_FATAL_FAILURE(OpenStreamTest::SetUp()); // setup base #if MAJOR_VERSION <= 6 @@ -1210,8 +1226,13 @@ class InputStreamTest : public OpenStreamTest { auto flags = getInputFlags(); testOpen( [&](AudioIoHandle handle, AudioConfig config, auto cb) { +#if MAJOR_VERSION < 7 || (MAJOR_VERSION == 7 && MINOR_VERSION == 0) return getDevice()->openInputStream(handle, address, config, flags, initMetadata, cb); +#elif MAJOR_VERSION == 7 && MINOR_VERSION == 1 + return getDevice()->openInputStream_7_1(handle, address, config, flags, + initMetadata, cb); +#endif }, config); } @@ -1584,7 +1605,8 @@ TEST_P(InputStreamTest, SetGain) { "InputStream::setGain"); } -static void testPrepareForReading(IStreamIn* stream, uint32_t frameSize, uint32_t framesCount) { +static void testPrepareForReading(::android::hardware::audio::CPP_VERSION::IStreamIn* stream, + uint32_t frameSize, uint32_t framesCount) { Result res; // Ignore output parameters as the call should fail ASSERT_OK(stream->prepareForReading(frameSize, framesCount, @@ -1655,7 +1677,8 @@ TEST_P(OutputStreamTest, setVolume) { "setVolume"); } -static void testPrepareForWriting(IStreamOut* stream, uint32_t frameSize, uint32_t framesCount) { +static void testPrepareForWriting(::android::hardware::audio::CPP_VERSION::IStreamOut* stream, + uint32_t frameSize, uint32_t framesCount) { Result res; // Ignore output parameters as the call should fail ASSERT_OK(stream->prepareForWriting(frameSize, framesCount, @@ -1682,6 +1705,8 @@ TEST_P(OutputStreamTest, PrepareForWritingCheckOverflow) { } struct Capability { + using IStreamOut = ::android::hardware::audio::CPP_VERSION::IStreamOut; + Capability(IStreamOut* stream) { EXPECT_OK(stream->supportsPauseAndResume(returnIn(pause, resume))); drain = extract(stream->supportsDrain()); @@ -1725,7 +1750,7 @@ class MockOutCallbacks : public IStreamOutCallback { Return onError() override { return {}; } }; -static bool isAsyncModeSupported(IStreamOut* stream) { +static bool isAsyncModeSupported(::android::hardware::audio::CPP_VERSION::IStreamOut* stream) { auto res = stream->setCallback(new MockOutCallbacks); stream->clearCallback(); // try to restore the no callback state, ignore // any error @@ -1780,7 +1805,8 @@ TEST_P(OutputStreamTest, Pause) { ASSERT_RESULT(Result::INVALID_STATE, stream->pause()); } -static void testDrain(IStreamOut* stream, AudioDrain type) { +static void testDrain(::android::hardware::audio::CPP_VERSION::IStreamOut* stream, + AudioDrain type) { if (!Capability(stream).drain) { doc::partialTest("The output stream does not support drain"); return; @@ -1866,7 +1892,8 @@ TEST_P(BoolAccessorPrimaryHidlTest, setGetBtScoWidebandEnabled) { } using TtyModeAccessorPrimaryHidlTest = - AccessorHidlTest; + AccessorHidlTest<::android::hardware::audio::CPP_VERSION::IPrimaryDevice::TtyMode, + AudioPrimaryHidlTest>; TEST_P(TtyModeAccessorPrimaryHidlTest, setGetTtyMode) { doc::test("Query and set the TTY mode state"); testAccessors( diff --git a/audio/core/all-versions/vts/functional/AudioTestDefinitions.h b/audio/core/all-versions/vts/functional/AudioTestDefinitions.h index aa676308cb..802b87bc36 100644 --- a/audio/core/all-versions/vts/functional/AudioTestDefinitions.h +++ b/audio/core/all-versions/vts/functional/AudioTestDefinitions.h @@ -22,8 +22,8 @@ #include // clang-format off -#include PATH(android/hardware/audio/FILE_VERSION/types.h) -#include PATH(android/hardware/audio/common/FILE_VERSION/types.h) +#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h) +#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h) // clang-format on enum { PARAM_FACTORY_NAME, PARAM_DEVICE_NAME }; @@ -34,14 +34,14 @@ using DeviceParameter = std::tuple; #if MAJOR_VERSION <= 6 enum { PARAM_DEVICE, PARAM_CONFIG, PARAM_FLAGS }; enum { INDEX_INPUT, INDEX_OUTPUT }; -using DeviceConfigParameter = - std::tuple>; +using DeviceConfigParameter = std::tuple< + DeviceParameter, android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::AudioConfig, + std::variant>; #elif MAJOR_VERSION >= 7 enum { PARAM_DEVICE, PARAM_PORT_NAME, PARAM_CONFIG, PARAM_FLAGS }; using DeviceConfigParameter = std::tuple>; + android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::AudioConfig, + std::vector>; #endif diff --git a/audio/core/all-versions/vts/functional/ConfigHelper.h b/audio/core/all-versions/vts/functional/ConfigHelper.h index a2bb1eecf0..e4008cf046 100644 --- a/audio/core/all-versions/vts/functional/ConfigHelper.h +++ b/audio/core/all-versions/vts/functional/ConfigHelper.h @@ -21,8 +21,8 @@ #include "PolicyConfig.h" // clang-format off -#include PATH(android/hardware/audio/FILE_VERSION/types.h) -#include PATH(android/hardware/audio/common/FILE_VERSION/types.h) +#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h) +#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h) // clang-format on using ::android::hardware::audio::common::utils::EnumBitfield; diff --git a/audio/core/all-versions/vts/functional/DeviceManager.h b/audio/core/all-versions/vts/functional/DeviceManager.h index 6db78a77d6..c8e016731d 100644 --- a/audio/core/all-versions/vts/functional/DeviceManager.h +++ b/audio/core/all-versions/vts/functional/DeviceManager.h @@ -22,19 +22,21 @@ #include #include +#include // clang-format off #include PATH(android/hardware/audio/FILE_VERSION/IDevice.h) #include PATH(android/hardware/audio/FILE_VERSION/IDevicesFactory.h) #include PATH(android/hardware/audio/FILE_VERSION/IPrimaryDevice.h) -#include PATH(android/hardware/audio/FILE_VERSION/types.h) -#include PATH(android/hardware/audio/common/FILE_VERSION/types.h) +#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h) +#include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h) // clang-format on #include "utility/ReturnIn.h" using ::android::sp; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::Result; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::common::test::utility; using namespace ::android::hardware::audio::CPP_VERSION; @@ -104,21 +106,30 @@ class DeviceManager : public InterfaceManager createInterfaceInstance(const FactoryAndDevice& factoryAndDevice) { auto [factoryName, name] = factoryAndDevice; sp factory = DevicesFactoryManager::getInstance().get(factoryName); - return name == kPrimaryDevice ? openPrimaryDevice(factory) : openDevice(factory, name); + return openDevice(factory, name); } using InterfaceManager::reset; static constexpr const char* kPrimaryDevice = "primary"; sp get(const std::string& factoryName, const std::string& name) { + if (name == kPrimaryDevice) { + (void)getPrimary(factoryName); // for initializing primaryDevice if needed. + } return InterfaceManager::get(std::make_tuple(factoryName, name)); } sp getPrimary(const std::string& factoryName) { - sp device = get(factoryName, kPrimaryDevice); - return device != nullptr ? IPrimaryDevice::castFrom(device) : nullptr; + if (primaryDevice == nullptr) { + sp factory = DevicesFactoryManager::getInstance().get(factoryName); + primaryDevice = openPrimaryDevice(factory); + } + return primaryDevice; } bool reset(const std::string& factoryName, const std::string& name) __attribute__((warn_unused_result)) { + if (name == kPrimaryDevice) { + primaryDevice.clear(); + } #if MAJOR_VERSION <= 5 return InterfaceManager::reset(std::make_tuple(factoryName, name), true); #elif MAJOR_VERSION >= 6 @@ -140,35 +151,75 @@ class DeviceManager : public InterfaceManager openDevice(const sp& factory, const std::string& name) { if (factory == nullptr) return nullptr; - sp device; -#if MAJOR_VERSION >= 4 Result result; + sp device; +#if MAJOR_VERSION == 2 + IDevicesFactory::Device dev = IDevicesFactory::IDevicesFactory::Device(-1); + if (name == AUDIO_HARDWARE_MODULE_ID_PRIMARY) { + dev = IDevicesFactory::Device::PRIMARY; + } else if (name == AUDIO_HARDWARE_MODULE_ID_A2DP) { + dev = IDevicesFactory::Device::A2DP; + } else if (name == AUDIO_HARDWARE_MODULE_ID_USB) { + dev = IDevicesFactory::Device::USB; + } else if (name == AUDIO_HARDWARE_MODULE_ID_REMOTE_SUBMIX) { + dev = IDevicesFactory::Device::R_SUBMIX; + } else if (name == AUDIO_HARDWARE_MODULE_ID_STUB) { + dev = IDevicesFactory::Device::STUB; + } + auto ret = factory->openDevice(dev, returnIn(result, device)); +#elif MAJOR_VERSION >= 4 && (MAJOR_VERSION < 7 || (MAJOR_VERSION == 7 && MINOR_VERSION == 0)) auto ret = factory->openDevice(name, returnIn(result, device)); +#elif MAJOR_VERSION == 7 && MINOR_VERSION == 1 + auto ret = factory->openDevice_7_1(name, returnIn(result, device)); +#endif if (!ret.isOk() || result != Result::OK || device == nullptr) { ALOGW("Device %s can not be opened, transaction: %s, result %d, device %p", name.c_str(), ret.description().c_str(), result, device.get()); return nullptr; } -#else - (void)name; -#endif return device; } - static sp openPrimaryDevice(const sp& factory) { - if (factory == nullptr) return nullptr; + static sp openPrimaryDevice(const sp& factory) { + if (factory == nullptr) return {}; Result result; sp device; + sp primaryDevice; #if MAJOR_VERSION == 2 auto ret = factory->openDevice(IDevicesFactory::Device::PRIMARY, returnIn(result, device)); -#elif MAJOR_VERSION >= 4 + if (ret.isOk() && result == Result::OK && device != nullptr) { + primaryDevice = IPrimaryDevice::castFrom(device); + } +#elif MAJOR_VERSION >= 4 && (MAJOR_VERSION < 7 || (MAJOR_VERSION == 7 && MINOR_VERSION == 0)) auto ret = factory->openPrimaryDevice(returnIn(result, device)); + if (ret.isOk() && result == Result::OK && device != nullptr) { + primaryDevice = IPrimaryDevice::castFrom(device); + } +#elif MAJOR_VERSION == 7 && MINOR_VERSION == 1 + auto ret = factory->openPrimaryDevice_7_1(returnIn(result, primaryDevice)); + if (ret.isOk() && result == Result::OK && primaryDevice != nullptr) { + auto getDeviceRet = primaryDevice->getDevice(); + if (getDeviceRet.isOk()) { + device = getDeviceRet; + } else { + primaryDevice.clear(); + ALOGW("Primary device can not downcast, transaction: %s, primary %p", + getDeviceRet.description().c_str(), primaryDevice.get()); + return {}; + } + } #endif if (!ret.isOk() || result != Result::OK || device == nullptr) { ALOGW("Primary device can not be opened, transaction: %s, result %d, device %p", ret.description().c_str(), result, device.get()); - return nullptr; + return {}; } - return device; + return primaryDevice; } + + private: + // There can only be one primary device across all HAL modules. + // A reference to a complete interface is used because in V7.1 IDevice can not + // be upcasted to IPrimaryDevice. + sp primaryDevice; }; diff --git a/audio/core/all-versions/vts/functional/VtsHalAudioV7_1TargetTest.xml b/audio/core/all-versions/vts/functional/VtsHalAudioV7_1TargetTest.xml new file mode 100644 index 0000000000..7b33a8f340 --- /dev/null +++ b/audio/core/all-versions/vts/functional/VtsHalAudioV7_1TargetTest.xml @@ -0,0 +1,39 @@ + + + + diff --git a/audio/core/all-versions/vts/functional/tests/generators_tests.cpp b/audio/core/all-versions/vts/functional/tests/generators_tests.cpp index 3fdd8e6086..76bf93e2d7 100644 --- a/audio/core/all-versions/vts/functional/tests/generators_tests.cpp +++ b/audio/core/all-versions/vts/functional/tests/generators_tests.cpp @@ -33,7 +33,7 @@ #endif using namespace android; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; #if MAJOR_VERSION == 7 namespace xsd { using namespace ::android::audio::policy::configuration::CPP_VERSION; diff --git a/audio/effect/all-versions/default/util/tests/effectutils_tests.cpp b/audio/effect/all-versions/default/util/tests/effectutils_tests.cpp index d021fa0b92..adfa167e46 100644 --- a/audio/effect/all-versions/default/util/tests/effectutils_tests.cpp +++ b/audio/effect/all-versions/default/util/tests/effectutils_tests.cpp @@ -27,7 +27,7 @@ #include using namespace android; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::effect::CPP_VERSION; using ::android::hardware::audio::effect::CPP_VERSION::implementation::EffectUtils; namespace xsd { diff --git a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp index 23e77867a5..e59423fa98 100644 --- a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp +++ b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp @@ -50,7 +50,7 @@ using ::android::hardware::Void; using ::android::hardware::audio::common::utils::mkEnumBitfield; using ::android::hidl::allocator::V1_0::IAllocator; using ::android::hidl::memory::V1_0::IMemory; -using namespace ::android::hardware::audio::common::CPP_VERSION; +using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::effect::CPP_VERSION; #if MAJOR_VERSION >= 7 // Make an alias for enumerations generated from the APM config XSD. -- GitLab From 5904a72fc3e095602e6766b49af59f807055afaf Mon Sep 17 00:00:00 2001 From: Robert Shih Date: Fri, 14 Jan 2022 12:43:22 -0800 Subject: [PATCH 503/825] Add vts tests to verify DRM AIDL interface The DRM AIDL interface is in change 15329852. The default implementation of the interface is in the clearkey HAL in change 15958954. [TODO] APIs pending vts coverage: + ICryptoFactory + isCryptoSchemeSupported + ICryptoPlugin + getLogMessages + notifyResolution + requiresSecureDecoderComponent + IDrmFactory + getSupportedCryptoSchemes + isContentTypeSupported + IDrmPlugin + decrypt + encrypt + getLogMessages + getMetrics + getNumberOfSessions + getPropertyByteArray + getPropertyString + getSecureStop + getSecureStopIds + getSecureStops + queryKeyStatus + releaseAllSecureStops + releaseSecureStop + releaseSecureStops + removeAllSecureStops + removeKeys + removeSecureStop + requiresSecureDecoder + requiresSecureDecoderDefault + restoreKeys + setCipherAlgorithm + setMacAlgorithm + setPlaybackId + setPropertyByteArray + sign + signRSA + verify Bug: 170964303 Bug: 200055138 Test: atest VtsAidlHalDrmTargetTest Change-Id: If8b582796fdbc34d3d7720fa45df8291f72cd46a --- drm/1.0/vts/functional/Android.bp | 9 + drm/1.2/vts/functional/Android.bp | 13 + drm/aidl/vts/Android.bp | 73 ++++ drm/aidl/vts/AndroidTest.xml | 38 ++ drm/aidl/vts/OWNERS | 4 + drm/aidl/vts/drm_hal_common.cpp | 602 ++++++++++++++++++++++++++ drm/aidl/vts/drm_hal_test.cpp | 551 +++++++++++++++++++++++ drm/aidl/vts/drm_hal_test_main.cpp | 92 ++++ drm/aidl/vts/include/drm_hal_common.h | 214 +++++++++ 9 files changed, 1596 insertions(+) create mode 100644 drm/aidl/vts/Android.bp create mode 100644 drm/aidl/vts/AndroidTest.xml create mode 100644 drm/aidl/vts/OWNERS create mode 100644 drm/aidl/vts/drm_hal_common.cpp create mode 100644 drm/aidl/vts/drm_hal_test.cpp create mode 100644 drm/aidl/vts/drm_hal_test_main.cpp create mode 100644 drm/aidl/vts/include/drm_hal_common.h diff --git a/drm/1.0/vts/functional/Android.bp b/drm/1.0/vts/functional/Android.bp index 5ea6ad3c66..a35d41d4ab 100644 --- a/drm/1.0/vts/functional/Android.bp +++ b/drm/1.0/vts/functional/Android.bp @@ -23,6 +23,14 @@ package { default_applicable_licenses: ["hardware_interfaces_license"], } +cc_library_headers { + name: "drm_hal_vendor_module_headers", + vendor_available: true, + export_include_dirs: [ + "include", + ], +} + cc_library_static { name: "libdrmvtshelper", defaults: ["VtsHalTargetTestDefaults"], @@ -36,6 +44,7 @@ cc_library_static { "android.hardware.drm@1.0-helper", ], export_include_dirs: ["include"], + export_static_lib_headers: ["android.hardware.drm@1.0-helper"], } cc_library_static { diff --git a/drm/1.2/vts/functional/Android.bp b/drm/1.2/vts/functional/Android.bp index ca90ee9e30..5a655e79af 100644 --- a/drm/1.2/vts/functional/Android.bp +++ b/drm/1.2/vts/functional/Android.bp @@ -23,6 +23,19 @@ package { default_applicable_licenses: ["hardware_interfaces_license"], } +cc_library_static { + name: "libvtsclearkey", + srcs: [ + "drm_hal_clearkey_module.cpp", + ], + static_libs: [ + "libgtest", + ], + header_libs: ["drm_hal_vendor_module_headers"], + export_header_lib_headers: ["drm_hal_vendor_module_headers"], + export_include_dirs: ["."], +} + cc_library_static { name: "android.hardware.drm@1.2-vts", defaults: ["VtsHalTargetTestDefaults"], diff --git a/drm/aidl/vts/Android.bp b/drm/aidl/vts/Android.bp new file mode 100644 index 0000000000..5b41830d68 --- /dev/null +++ b/drm/aidl/vts/Android.bp @@ -0,0 +1,73 @@ +// +// 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. +// +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: "VtsAidlHalDrmTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: [ + "drm_hal_common.cpp", + "drm_hal_test.cpp", + "drm_hal_test_main.cpp", + ], + local_include_dirs: [ + "include", + ], + header_libs: [ + "drm_hal_vendor_module_headers", + ], + shared_libs: [ + "libandroid", + "libbinder_ndk", + "libcrypto", + "libnativehelper", + ], + static_libs: [ + "android.hardware.drm@1.0-helper", + "android.hardware.drm-V1-ndk", + "android.hardware.common-V2-ndk", + "libdrmvtshelper", + "libvtsclearkey", + ], + arch: { + arm: { + data: [":libvtswidevine-arm-prebuilts"], + }, + arm64: { + data: [":libvtswidevine-arm64-prebuilts"], + }, + x86: { + data: [":libvtswidevine-x86-prebuilts"], + }, + x86_64: { + data: [":libvtswidevine-x86_64-prebuilts"], + }, + }, + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/drm/aidl/vts/AndroidTest.xml b/drm/aidl/vts/AndroidTest.xml new file mode 100644 index 0000000000..9e5b41a048 --- /dev/null +++ b/drm/aidl/vts/AndroidTest.xml @@ -0,0 +1,38 @@ + + + + diff --git a/drm/aidl/vts/OWNERS b/drm/aidl/vts/OWNERS new file mode 100644 index 0000000000..e44b93eef9 --- /dev/null +++ b/drm/aidl/vts/OWNERS @@ -0,0 +1,4 @@ +edwinwong@google.com +jtinker@google.com +kelzhan@google.com +robertshih@google.com diff --git a/drm/aidl/vts/drm_hal_common.cpp b/drm/aidl/vts/drm_hal_common.cpp new file mode 100644 index 0000000000..751c25b4ad --- /dev/null +++ b/drm/aidl/vts/drm_hal_common.cpp @@ -0,0 +1,602 @@ +/* + * 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. + */ + +#define LOG_TAG "drm_hal_common" + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "drm_hal_clearkey_module.h" +#include "drm_hal_common.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace drm { +namespace vts { + +namespace clearkeydrm = ::android::hardware::drm::V1_2::vts; + +using std::vector; +using ::aidl::android::hardware::common::Ashmem; +using ::aidl::android::hardware::drm::BufferType; +using ::aidl::android::hardware::drm::DecryptResult; +using ::aidl::android::hardware::drm::DestinationBuffer; +using ::aidl::android::hardware::drm::EventType; +using ::aidl::android::hardware::drm::ICryptoPlugin; +using ::aidl::android::hardware::drm::IDrmPlugin; +using ::aidl::android::hardware::drm::KeyRequest; +using ::aidl::android::hardware::drm::KeyRequestType; +using ::aidl::android::hardware::drm::KeySetId; +using ::aidl::android::hardware::drm::KeyType; +using ::aidl::android::hardware::drm::KeyValue; +using ::aidl::android::hardware::drm::Mode; +using ::aidl::android::hardware::drm::Pattern; +using ::aidl::android::hardware::drm::ProvisionRequest; +using ::aidl::android::hardware::drm::ProvideProvisionResponseResult; +using ::aidl::android::hardware::drm::SecurityLevel; +using ::aidl::android::hardware::drm::Status; +using ::aidl::android::hardware::drm::SubSample; +using ::aidl::android::hardware::drm::Uuid; + +Status DrmErr(const ::ndk::ScopedAStatus& ret) { + return static_cast(ret.getServiceSpecificError()); +} + +std::string HalBaseName(const std::string& fullname) { + auto idx = fullname.find('/'); + if (idx == std::string::npos) { + return fullname; + } + return fullname.substr(idx + 1); +} + +const char* kDrmIface = "android.hardware.drm.IDrmFactory"; +const char* kCryptoIface = "android.hardware.drm.ICryptoFactory"; + +std::string HalFullName(const std::string& iface, const std::string& basename) { + return iface + '/' + basename; +} + +testing::AssertionResult IsOk(const ::ndk::ScopedAStatus& ret) { + if (ret.isOk()) { + return testing::AssertionSuccess(); + } + return testing::AssertionFailure() << "ex: " << ret.getExceptionCode() + << "; svc err: " << ret.getServiceSpecificError() + << "; desc: " << ret.getDescription(); +} + +const char* kCallbackLostState = "LostState"; +const char* kCallbackKeysChange = "KeysChange"; + +drm_vts::VendorModules* DrmHalTest::gVendorModules = nullptr; + +/** + * DrmHalPluginListener + */ +::ndk::ScopedAStatus DrmHalPluginListener::onEvent( + EventType eventType, + const vector& sessionId, + const vector& data) { + ListenerArgs args{}; + args.eventType = eventType; + args.sessionId = sessionId; + args.data = data; + eventPromise.set_value(args); + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus DrmHalPluginListener::onExpirationUpdate( + const vector& sessionId, + int64_t expiryTimeInMS) { + ListenerArgs args{}; + args.sessionId = sessionId; + args.expiryTimeInMS = expiryTimeInMS; + expirationUpdatePromise.set_value(args); + return ::ndk::ScopedAStatus::ok(); + +} + +::ndk::ScopedAStatus DrmHalPluginListener::onSessionLostState(const vector& sessionId) { + ListenerArgs args{}; + args.sessionId = sessionId; + sessionLostStatePromise.set_value(args); + return ::ndk::ScopedAStatus::ok(); +} + +::ndk::ScopedAStatus DrmHalPluginListener::onKeysChange( + const std::vector& sessionId, + const std::vector<::aidl::android::hardware::drm::KeyStatus>& keyStatusList, + bool hasNewUsableKey) { + ListenerArgs args{}; + args.sessionId = sessionId; + args.keyStatusList = keyStatusList; + args.hasNewUsableKey = hasNewUsableKey; + keysChangePromise.set_value(args); + return ::ndk::ScopedAStatus::ok(); +} + +ListenerArgs DrmHalPluginListener::getListenerArgs(std::promise& promise) { + auto future = promise.get_future(); + auto timeout = std::chrono::milliseconds(500); + EXPECT_EQ(future.wait_for(timeout), std::future_status::ready); + return future.get(); +} + +ListenerArgs DrmHalPluginListener::getEventArgs() { + return getListenerArgs(eventPromise); +} + +ListenerArgs DrmHalPluginListener::getExpirationUpdateArgs() { + return getListenerArgs(expirationUpdatePromise); +} + +ListenerArgs DrmHalPluginListener::getSessionLostStateArgs() { + return getListenerArgs(sessionLostStatePromise); +} + +ListenerArgs DrmHalPluginListener::getKeysChangeArgs() { + return getListenerArgs(keysChangePromise); +} + +static DrmHalVTSVendorModule_V1* getModuleForInstance(const std::string& instance) { + if (instance.find("clearkey") != std::string::npos || + instance.find("default") != std::string::npos) { + return new clearkeydrm::DrmHalVTSClearkeyModule(); + } + + return static_cast( + DrmHalTest::gVendorModules->getModuleByName(instance)); +} + +/** + * DrmHalTest + */ + +DrmHalTest::DrmHalTest() : vendorModule(getModuleForInstance(GetParamService())) {} + +void DrmHalTest::SetUp() { + const ::testing::TestInfo* const test_info = + ::testing::UnitTest::GetInstance()->current_test_info(); + + ALOGD("Running test %s.%s from (vendor) module %s", test_info->test_case_name(), + test_info->name(), GetParamService().c_str()); + + auto svc = GetParamService(); + const string cryptoInstance = HalFullName(kCryptoIface, svc); + const string drmInstance = HalFullName(kDrmIface, svc); + + if (drmInstance.find("IDrmFactory") != std::string::npos) { + drmFactory = IDrmFactory::fromBinder( + ::ndk::SpAIBinder(AServiceManager_waitForService(drmInstance.c_str()))); + ASSERT_NE(drmFactory, nullptr); + drmPlugin = createDrmPlugin(); + } + + if (cryptoInstance.find("ICryptoFactory") != std::string::npos) { + cryptoFactory = ICryptoFactory::fromBinder( + ::ndk::SpAIBinder(AServiceManager_waitForService(cryptoInstance.c_str()))); + ASSERT_NE(cryptoFactory, nullptr); + cryptoPlugin = createCryptoPlugin(); + } + + if (!vendorModule) { + ASSERT_NE(drmInstance, "widevine") << "Widevine requires vendor module."; + ASSERT_NE(drmInstance, "clearkey") << "Clearkey requires vendor module."; + GTEST_SKIP() << "No vendor module installed"; + } + + ASSERT_EQ(HalBaseName(drmInstance), vendorModule->getServiceName()); + contentConfigurations = vendorModule->getContentConfigurations(); + + // If drm scheme not installed skip subsequent tests + bool result = false; + drmFactory->isCryptoSchemeSupported({getUUID()}, "cenc", SecurityLevel::SW_SECURE_CRYPTO, + &result); + if (!result) { + if (GetParamUUID() == std::array()) { + GTEST_SKIP() << "vendor module drm scheme not supported"; + } else { + FAIL() << "param scheme must not supported"; + } + } + + ASSERT_NE(nullptr, drmPlugin.get()) + << "Can't find " << vendorModule->getServiceName() << " drm aidl plugin"; + ASSERT_NE(nullptr, cryptoPlugin.get()) + << "Can't find " << vendorModule->getServiceName() << " crypto aidl plugin"; +} + +std::shared_ptr<::aidl::android::hardware::drm::IDrmPlugin> DrmHalTest::createDrmPlugin() { + if (drmFactory == nullptr) { + return nullptr; + } + std::string packageName("aidl.android.hardware.drm.test"); + std::shared_ptr<::aidl::android::hardware::drm::IDrmPlugin> result; + auto ret = drmFactory->createPlugin({getUUID()}, packageName, &result); + EXPECT_OK(ret) << "createDrmPlugin remote call failed"; + return result; +} + +std::shared_ptr<::aidl::android::hardware::drm::ICryptoPlugin> DrmHalTest::createCryptoPlugin() { + if (cryptoFactory == nullptr) { + return nullptr; + } + vector initVec; + std::shared_ptr<::aidl::android::hardware::drm::ICryptoPlugin> result; + auto ret = cryptoFactory->createPlugin({getUUID()}, initVec, &result); + EXPECT_OK(ret) << "createCryptoPlugin remote call failed"; + return result; +} + +::aidl::android::hardware::drm::Uuid DrmHalTest::getAidlUUID() { + return toAidlUuid(getUUID()); +} + +std::vector DrmHalTest::getUUID() { + auto paramUUID = GetParamUUID(); + if (paramUUID == std::array()) { + return getVendorUUID(); + } + return std::vector(paramUUID.begin(), paramUUID.end()); +} + +std::vector DrmHalTest::getVendorUUID() { + if (vendorModule == nullptr) { + ALOGW("vendor module for %s not found", GetParamService().c_str()); + return {}; + } + return vendorModule->getUUID(); +} + +void DrmHalTest::provision() { + std::string certificateType; + std::string certificateAuthority; + vector provisionRequest; + std::string defaultUrl; + ProvisionRequest result; + auto ret = drmPlugin->getProvisionRequest(certificateType, certificateAuthority, &result); + + EXPECT_TXN(ret); + if (ret.isOk()) { + EXPECT_NE(result.request.size(), 0u); + provisionRequest = result.request; + defaultUrl = result.defaultUrl; + } else if (DrmErr(ret) == Status::ERROR_DRM_CANNOT_HANDLE) { + EXPECT_EQ(0u, result.request.size()); + } + + if (provisionRequest.size() > 0) { + vector response = + vendorModule->handleProvisioningRequest(provisionRequest, defaultUrl); + ASSERT_NE(0u, response.size()); + + ProvideProvisionResponseResult result; + auto ret = drmPlugin->provideProvisionResponse(response, &result); + EXPECT_TXN(ret); + } +} + +SessionId DrmHalTest::openSession(SecurityLevel level, Status* err) { + SessionId sessionId; + auto ret = drmPlugin->openSession(level, &sessionId); + EXPECT_TXN(ret); + *err = DrmErr(ret); + return sessionId; +} + +/** + * Helper method to open a session and verify that a non-empty + * session ID is returned + */ +SessionId DrmHalTest::openSession() { + SessionId sessionId; + auto ret = drmPlugin->openSession(SecurityLevel::DEFAULT, &sessionId); + EXPECT_OK(ret); + EXPECT_NE(0u, sessionId.size()); + return sessionId; +} + +/** + * Helper method to close a session + */ +void DrmHalTest::closeSession(const SessionId& sessionId) { + auto ret = drmPlugin->closeSession(sessionId); + EXPECT_OK(ret); +} + +vector DrmHalTest::getKeyRequest( + const SessionId& sessionId, + const DrmHalVTSVendorModule_V1::ContentConfiguration& configuration, + const KeyType& type = KeyType::STREAMING) { + KeyRequest result; + auto ret = drmPlugin->getKeyRequest(sessionId, configuration.initData, configuration.mimeType, + type, toAidlKeyedVector(configuration.optionalParameters), + &result); + EXPECT_OK(ret) << "Failed to get key request for configuration " + << configuration.name << " for key type " + << static_cast(type); + if (type == KeyType::RELEASE) { + EXPECT_EQ(KeyRequestType::RELEASE, result.requestType); + } else { + EXPECT_EQ(KeyRequestType::INITIAL, result.requestType); + } + EXPECT_NE(result.request.size(), 0u) << "Expected key request size" + " to have length > 0 bytes"; + return result.request; +} + +DrmHalVTSVendorModule_V1::ContentConfiguration DrmHalTest::getContent(const KeyType& type) const { + for (const auto& config : contentConfigurations) { + if (type != KeyType::OFFLINE || config.policy.allowOffline) { + return config; + } + } + ADD_FAILURE() << "no content configurations found"; + return {}; +} + +vector DrmHalTest::provideKeyResponse(const SessionId& sessionId, + const vector& keyResponse) { + KeySetId result; + auto ret = drmPlugin->provideKeyResponse(sessionId, keyResponse, &result); + EXPECT_OK(ret) << "Failure providing key response for configuration "; + return result.keySetId; +} + +/** + * Helper method to load keys for subsequent decrypt tests. + * These tests use predetermined key request/response to + * avoid requiring a round trip to a license server. + */ +vector DrmHalTest::loadKeys( + const SessionId& sessionId, + const DrmHalVTSVendorModule_V1::ContentConfiguration& configuration, const KeyType& type) { + vector keyRequest = getKeyRequest(sessionId, configuration, type); + + /** + * Get key response from vendor module + */ + vector keyResponse = + vendorModule->handleKeyRequest(keyRequest, configuration.serverUrl); + EXPECT_NE(keyResponse.size(), 0u) << "Expected key response size " + "to have length > 0 bytes"; + + return provideKeyResponse(sessionId, keyResponse); +} + +vector DrmHalTest::loadKeys(const SessionId& sessionId, const KeyType& type) { + return loadKeys(sessionId, getContent(type), type); +} + +std::array DrmHalTest::toStdArray(const vector& vec) { + EXPECT_EQ(16u, vec.size()); + std::array arr; + std::copy_n(vec.begin(), vec.size(), arr.begin()); + return arr; +} + +KeyedVector DrmHalTest::toAidlKeyedVector(const map& params) { + std::vector stdKeyedVector; + for (auto it = params.begin(); it != params.end(); ++it) { + KeyValue keyValue; + keyValue.key = it->first; + keyValue.value = it->second; + stdKeyedVector.push_back(keyValue); + } + return KeyedVector(stdKeyedVector); +} + +/** + * getDecryptMemory allocates memory for decryption, then sets it + * as a shared buffer base in the crypto hal. A parcelable Ashmem + * is returned. + * + * @param size the size of the memory segment to allocate + * @param the index of the memory segment which will be used + * to refer to it for decryption. + */ +Ashmem DrmHalTest::getDecryptMemory(size_t size, size_t index) { + int fd = ASharedMemory_create("drmVtsSharedMemory", size); + EXPECT_GE(fd, 0); + EXPECT_EQ(size, ASharedMemory_getSize(fd)); + + Ashmem ashmem; + ashmem.fd = ::ndk::ScopedFileDescriptor(fd); + ashmem.size = size; + EXPECT_OK(cryptoPlugin->setSharedBufferBase(ashmem, index)); + return ashmem; +} + +void DrmHalTest::fillRandom(const Ashmem& ashmem) { + std::random_device rd; + std::mt19937 rand(rd()); + + ::ndk::ScopedFileDescriptor fd = ashmem.fd.dup(); + size_t size = ashmem.size; + uint8_t* base = static_cast( + mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0)); + EXPECT_NE(MAP_FAILED, base); + for (size_t i = 0; i < size / sizeof(uint32_t); i++) { + auto p = static_cast(static_cast(base)); + p[i] = rand(); + } +} + +uint32_t DrmHalTest::decrypt(Mode mode, bool isSecure, const std::array& keyId, + uint8_t* iv, const vector& subSamples, + const Pattern& pattern, const vector& key, + Status expectedStatus) { + const size_t kSegmentIndex = 0; + + uint8_t localIv[AES_BLOCK_SIZE]; + memcpy(localIv, iv, AES_BLOCK_SIZE); + vector ivVec(localIv, localIv + AES_BLOCK_SIZE); + + int64_t totalSize = 0; + for (size_t i = 0; i < subSamples.size(); i++) { + totalSize += subSamples[i].numBytesOfClearData; + totalSize += subSamples[i].numBytesOfEncryptedData; + } + + // The first totalSize bytes of shared memory is the encrypted + // input, the second totalSize bytes (if exists) is the decrypted output. + size_t factor = expectedStatus == Status::ERROR_DRM_FRAME_TOO_LARGE ? 1 : 2; + Ashmem sharedMemory = getDecryptMemory(totalSize * factor, kSegmentIndex); + + const SharedBuffer sourceBuffer = {.bufferId = kSegmentIndex, .offset = 0, .size = totalSize}; + fillRandom(sharedMemory); + + const DestinationBuffer destBuffer = { + .type = BufferType::SHARED_MEMORY, + .nonsecureMemory = {.bufferId = kSegmentIndex, .offset = totalSize, .size = totalSize}, + .secureMemory = {.fds = {}, .ints = {}}}; + const uint64_t offset = 0; + uint32_t bytesWritten = 0; + vector keyIdVec(keyId.begin(), keyId.end()); + DecryptResult result; + auto ret = cryptoPlugin->decrypt(isSecure, keyIdVec, ivVec, mode, pattern, subSamples, + sourceBuffer, offset, destBuffer, &result); + EXPECT_TXN(ret); + EXPECT_EQ(expectedStatus, DrmErr(ret)) << "Unexpected decrypt status " << result.detailedError; + bytesWritten = result.bytesWritten; + + if (bytesWritten != totalSize) { + return bytesWritten; + } + ::ndk::ScopedFileDescriptor fd = sharedMemory.fd.dup(); + uint8_t* base = static_cast( + mmap(nullptr, totalSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0)); + EXPECT_NE(MAP_FAILED, base); + + // generate reference vector + vector reference(totalSize); + + memcpy(localIv, iv, AES_BLOCK_SIZE); + switch (mode) { + case Mode::UNENCRYPTED: + memcpy(&reference[0], base, totalSize); + break; + case Mode::AES_CTR: + aes_ctr_decrypt(&reference[0], base, localIv, subSamples, key); + break; + case Mode::AES_CBC: + aes_cbc_decrypt(&reference[0], base, localIv, subSamples, key); + break; + case Mode::AES_CBC_CTS: + ADD_FAILURE() << "AES_CBC_CTS mode not supported"; + break; + } + + // compare reference to decrypted data which is at base + total size + EXPECT_EQ(0, memcmp(static_cast(&reference[0]), static_cast(base + totalSize), + totalSize)) + << "decrypt data mismatch"; + return totalSize; +} + +/** + * Decrypt a list of clear+encrypted subsamples using the specified key + * in AES-CTR mode + */ +void DrmHalTest::aes_ctr_decrypt(uint8_t* dest, uint8_t* src, uint8_t* iv, + const vector& subSamples, const vector& key) { + AES_KEY decryptionKey; + AES_set_encrypt_key(&key[0], 128, &decryptionKey); + + size_t offset = 0; + unsigned int blockOffset = 0; + uint8_t previousEncryptedCounter[AES_BLOCK_SIZE]; + memset(previousEncryptedCounter, 0, AES_BLOCK_SIZE); + + for (size_t i = 0; i < subSamples.size(); i++) { + const SubSample& subSample = subSamples[i]; + + if (subSample.numBytesOfClearData > 0) { + memcpy(dest + offset, src + offset, subSample.numBytesOfClearData); + offset += subSample.numBytesOfClearData; + } + + if (subSample.numBytesOfEncryptedData > 0) { + AES_ctr128_encrypt(src + offset, dest + offset, subSample.numBytesOfEncryptedData, + &decryptionKey, iv, previousEncryptedCounter, &blockOffset); + offset += subSample.numBytesOfEncryptedData; + } + } +} + +/** + * Decrypt a list of clear+encrypted subsamples using the specified key + * in AES-CBC mode + */ +void DrmHalTest::aes_cbc_decrypt(uint8_t* dest, uint8_t* src, uint8_t* iv, + const vector& subSamples, const vector& key) { + AES_KEY decryptionKey; + AES_set_encrypt_key(&key[0], 128, &decryptionKey); + + size_t offset = 0; + for (size_t i = 0; i < subSamples.size(); i++) { + memcpy(dest + offset, src + offset, subSamples[i].numBytesOfClearData); + offset += subSamples[i].numBytesOfClearData; + + AES_cbc_encrypt(src + offset, dest + offset, subSamples[i].numBytesOfEncryptedData, + &decryptionKey, iv, 0 /* decrypt */); + offset += subSamples[i].numBytesOfEncryptedData; + } +} + +/** + * Helper method to test decryption with invalid keys is returned + */ +void DrmHalClearkeyTest::decryptWithInvalidKeys(vector& invalidResponse, + vector& iv, const Pattern& noPattern, + const vector& subSamples) { + DrmHalVTSVendorModule_V1::ContentConfiguration content = getContent(); + if (content.keys.empty()) { + FAIL() << "no keys"; + } + + const auto& key = content.keys[0]; + auto sessionId = openSession(); + KeySetId result; + auto ret = drmPlugin->provideKeyResponse(sessionId, invalidResponse, &result); + + EXPECT_OK(ret); + EXPECT_EQ(0u, result.keySetId.size()); + + EXPECT_OK(cryptoPlugin->setMediaDrmSession(sessionId)); + + uint32_t byteCount = + decrypt(Mode::AES_CTR, key.isSecure, toStdArray(key.keyId), &iv[0], subSamples, + noPattern, key.clearContentKey, Status::ERROR_DRM_NO_LICENSE); + EXPECT_EQ(0u, byteCount); + + closeSession(sessionId); +} + +} // namespace vts +} // namespace drm +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/drm/aidl/vts/drm_hal_test.cpp b/drm/aidl/vts/drm_hal_test.cpp new file mode 100644 index 0000000000..3ac9f5cc41 --- /dev/null +++ b/drm/aidl/vts/drm_hal_test.cpp @@ -0,0 +1,551 @@ +/* + * 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. + */ + +#define LOG_TAG "drm_hal_test" + +#include +#include +#include + +#include +#include + +#include "drm_hal_common.h" + +using ::aidl::android::hardware::drm::EventType; +using ::aidl::android::hardware::drm::HdcpLevels; +using ::aidl::android::hardware::drm::KeyRequest; +using ::aidl::android::hardware::drm::HdcpLevel; +using ::aidl::android::hardware::drm::IDrmPluginListener; +using ::aidl::android::hardware::drm::KeyRequestType; +using ::aidl::android::hardware::drm::KeySetId; +using ::aidl::android::hardware::drm::KeyStatus; +using ::aidl::android::hardware::drm::KeyStatusType; +using ::aidl::android::hardware::drm::KeyType; +using ::aidl::android::hardware::drm::Mode; +using ::aidl::android::hardware::drm::OfflineLicenseState; +using ::aidl::android::hardware::drm::Pattern; +using ::aidl::android::hardware::drm::SecurityLevel; +using ::aidl::android::hardware::drm::Status; +using ::aidl::android::hardware::drm::SubSample; +using ::aidl::android::hardware::drm::Uuid; + +using ::aidl::android::hardware::drm::vts::DrmErr; +using ::aidl::android::hardware::drm::vts::DrmHalClearkeyTest; +using ::aidl::android::hardware::drm::vts::DrmHalPluginListener; +using ::aidl::android::hardware::drm::vts::DrmHalTest; +using ::aidl::android::hardware::drm::vts::ListenerArgs; +using ::aidl::android::hardware::drm::vts::kCallbackKeysChange; +using ::aidl::android::hardware::drm::vts::kCallbackLostState; + +using std::string; +using std::vector; + +static const char* const kVideoMp4 = "video/mp4"; +static const char* const kBadMime = "video/unknown"; +static const char* const kDrmErrorTestKey = "drmErrorTest"; +static const char* const kDrmErrorInvalidState = "invalidState"; +static const char* const kDrmErrorResourceContention = "resourceContention"; +static constexpr SecurityLevel kSwSecureCrypto = SecurityLevel::SW_SECURE_CRYPTO; +static constexpr SecurityLevel kHwSecureAll = SecurityLevel::HW_SECURE_ALL; + +/** + * Ensure drm factory supports module UUID Scheme + */ +TEST_P(DrmHalTest, VendorUuidSupported) { + bool result = false; + auto ret = + drmFactory->isCryptoSchemeSupported(getAidlUUID(), kVideoMp4, kSwSecureCrypto, &result); + ALOGI("kVideoMp4 = %s res %d", kVideoMp4, static_cast(result)); + EXPECT_OK(ret); + EXPECT_TRUE(result); +} + +/** + * Ensure drm factory doesn't support an invalid scheme UUID + */ +TEST_P(DrmHalTest, InvalidPluginNotSupported) { + const vector kInvalidUUID = {0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, + 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80}; + bool result = false; + auto ret = drmFactory->isCryptoSchemeSupported(toAidlUuid(kInvalidUUID), kVideoMp4, + kSwSecureCrypto, &result); + EXPECT_OK(ret); + EXPECT_FALSE(result); +} + +/** + * Ensure drm factory doesn't support an empty UUID + */ +TEST_P(DrmHalTest, EmptyPluginUUIDNotSupported) { + vector emptyUUID(16); + memset(emptyUUID.data(), 0, 16); + bool result = false; + auto ret = drmFactory->isCryptoSchemeSupported(toAidlUuid(emptyUUID), kVideoMp4, + kSwSecureCrypto, &result); + EXPECT_OK(ret); + EXPECT_FALSE(result); +} + +/** + * Ensure drm factory doesn't support an invalid mime type + */ +TEST_P(DrmHalTest, BadMimeNotSupported) { + bool result = false; + auto ret = + drmFactory->isCryptoSchemeSupported(getAidlUUID(), kBadMime, kSwSecureCrypto, &result); + EXPECT_OK(ret); + EXPECT_FALSE(result); +} + +/** + * DrmPlugin tests + */ + +/** + * Test that a DRM plugin can handle provisioning. While + * it is not required that a DRM scheme require provisioning, + * it should at least return appropriate status values. If + * a provisioning request is returned, it is passed to the + * vendor module which should provide a provisioning response + * that is delivered back to the HAL. + */ +TEST_P(DrmHalTest, DoProvisioning) { + for (auto level : {kHwSecureAll, kSwSecureCrypto}) { + Status err = Status::OK; + auto sid = openSession(level, &err); + if (err == Status::OK) { + closeSession(sid); + } else if (err == Status::ERROR_DRM_CANNOT_HANDLE) { + continue; + } else { + EXPECT_EQ(Status::ERROR_DRM_NOT_PROVISIONED, err); + provision(); + } + } +} + +/** + * A get key request should fail if no sessionId is provided + */ +TEST_P(DrmHalTest, GetKeyRequestNoSession) { + SessionId invalidSessionId; + vector initData; + KeyedVector optionalParameters; + KeyRequest result; + auto ret = drmPlugin->getKeyRequest(invalidSessionId, initData, kVideoMp4, KeyType::STREAMING, + optionalParameters, &result); + EXPECT_TXN(ret); + EXPECT_EQ(Status::BAD_VALUE, DrmErr(ret)); +} + +/** + * Test that the plugin returns the documented error for the + * case of attempting to generate a key request using an + * invalid mime type + */ +TEST_P(DrmHalTest, GetKeyRequestBadMime) { + auto sessionId = openSession(); + vector initData; + KeyedVector optionalParameters; + KeyRequest result; + auto ret = drmPlugin->getKeyRequest(sessionId, initData, kBadMime, KeyType::STREAMING, + optionalParameters, &result); + EXPECT_EQ(EX_SERVICE_SPECIFIC, ret.getExceptionCode()); + closeSession(sessionId); +} + +/** + * Test drm plugin offline key support + */ +TEST_P(DrmHalTest, OfflineLicenseTest) { + auto sessionId = openSession(); + vector keySetId = loadKeys(sessionId, KeyType::OFFLINE); + closeSession(sessionId); + + vector result; + auto ret = drmPlugin->getOfflineLicenseKeySetIds(&result); + EXPECT_OK(ret); + bool found = false; + for (KeySetId keySetId2 : result) { + if (keySetId == keySetId2.keySetId) { + found = true; + break; + } + } + EXPECT_TRUE(found) << "keySetId not found"; + + ret = drmPlugin->removeOfflineLicense({keySetId}); + EXPECT_OK(ret); + + ret = drmPlugin->getOfflineLicenseKeySetIds(&result); + EXPECT_OK(ret); + for (KeySetId keySetId2 : result) { + EXPECT_NE(keySetId, keySetId2.keySetId); + } + + ret = drmPlugin->removeOfflineLicense({keySetId}); + EXPECT_TXN(ret); + EXPECT_EQ(Status::BAD_VALUE, DrmErr(ret)); +} + +/** + * Test drm plugin offline key state + */ +TEST_P(DrmHalTest, OfflineLicenseStateTest) { + auto sessionId = openSession(); + DrmHalVTSVendorModule_V1::ContentConfiguration content = getContent(KeyType::OFFLINE); + vector keySetId = loadKeys(sessionId, content, KeyType::OFFLINE); + closeSession(sessionId); + + OfflineLicenseState result{}; + auto ret = drmPlugin->getOfflineLicenseState({keySetId}, &result); + EXPECT_OK(ret); + EXPECT_EQ(OfflineLicenseState::USABLE, result); + + vector keyRequest = getKeyRequest(keySetId, content, KeyType::RELEASE); + ret = drmPlugin->getOfflineLicenseState({keySetId}, &result); + EXPECT_OK(ret); + EXPECT_EQ(OfflineLicenseState::INACTIVE, result); + + /** + * Get key response from vendor module + */ + vector keyResponse = vendorModule->handleKeyRequest(keyRequest, content.serverUrl); + EXPECT_GT(keyResponse.size(), 0u); + + result = OfflineLicenseState::UNKNOWN; + provideKeyResponse(keySetId, keyResponse); + ret = drmPlugin->getOfflineLicenseState({keySetId}, &result); + EXPECT_TXN(ret); + EXPECT_EQ(Status::BAD_VALUE, DrmErr(ret)); + EXPECT_EQ(OfflineLicenseState::UNKNOWN, result); +} + +/** + * Negative offline license test. Remove empty keySetId + */ +TEST_P(DrmHalTest, RemoveEmptyKeySetId) { + KeySetId emptyKeySetId; + auto ret = drmPlugin->removeOfflineLicense(emptyKeySetId); + EXPECT_TXN(ret); + EXPECT_EQ(Status::BAD_VALUE, DrmErr(ret)); +} + +/** + * Negative offline license test. Get empty keySetId state + */ +TEST_P(DrmHalTest, GetEmptyKeySetIdState) { + KeySetId emptyKeySetId; + OfflineLicenseState result; + auto ret = drmPlugin->getOfflineLicenseState(emptyKeySetId, &result); + EXPECT_TXN(ret); + EXPECT_EQ(Status::BAD_VALUE, DrmErr(ret)); + EXPECT_EQ(OfflineLicenseState::UNKNOWN, result); +} + +/** + * Test that the plugin returns valid connected and max HDCP levels + */ +TEST_P(DrmHalTest, GetHdcpLevels) { + HdcpLevels result; + auto ret = drmPlugin->getHdcpLevels(&result); + EXPECT_OK(ret); + EXPECT_GE(result.connectedLevel, HdcpLevel::HDCP_NONE); + EXPECT_LE(result.maxLevel, HdcpLevel::HDCP_V2_3); +} + +/** + * CryptoPlugin Decrypt tests + */ + +/** + * Positive decrypt test. "Decrypt" a single clear segment + */ +TEST_P(DrmHalTest, ClearSegmentTest) { + for (const auto& config : contentConfigurations) { + for (const auto& key : config.keys) { + const size_t kSegmentSize = 1024; + vector iv(AES_BLOCK_SIZE, 0); + const Pattern noPattern = {0, 0}; + const vector subSamples = { + {.numBytesOfClearData = kSegmentSize, .numBytesOfEncryptedData = 0}}; + auto sessionId = openSession(); + loadKeys(sessionId, config); + + auto ret = cryptoPlugin->setMediaDrmSession(sessionId); + EXPECT_OK(ret); + + uint32_t byteCount = + decrypt(Mode::UNENCRYPTED, key.isSecure, toStdArray(key.keyId), &iv[0], + subSamples, noPattern, key.clearContentKey, Status::OK); + EXPECT_EQ(kSegmentSize, byteCount); + + closeSession(sessionId); + } + } +} + +/** + * Positive decrypt test. Decrypt a single segment using aes_ctr. + * Verify data matches. + */ +TEST_P(DrmHalTest, EncryptedAesCtrSegmentTest) { + for (const auto& config : contentConfigurations) { + for (const auto& key : config.keys) { + const size_t kSegmentSize = 1024; + vector iv(AES_BLOCK_SIZE, 0); + const Pattern noPattern = {0, 0}; + const vector subSamples = { + {.numBytesOfClearData = kSegmentSize, .numBytesOfEncryptedData = 0}}; + auto sessionId = openSession(); + loadKeys(sessionId, config); + + auto ret = cryptoPlugin->setMediaDrmSession(sessionId); + EXPECT_OK(ret); + + uint32_t byteCount = decrypt(Mode::AES_CTR, key.isSecure, toStdArray(key.keyId), &iv[0], + subSamples, noPattern, key.clearContentKey, Status::OK); + EXPECT_EQ(kSegmentSize, byteCount); + + closeSession(sessionId); + } + } +} + +/** + * Negative decrypt test. Decrypted frame too large to fit in output buffer + */ +TEST_P(DrmHalTest, ErrorFrameTooLarge) { + for (const auto& config : contentConfigurations) { + for (const auto& key : config.keys) { + const size_t kSegmentSize = 1024; + vector iv(AES_BLOCK_SIZE, 0); + const Pattern noPattern = {0, 0}; + const vector subSamples = { + {.numBytesOfClearData = kSegmentSize, .numBytesOfEncryptedData = 0}}; + auto sessionId = openSession(); + loadKeys(sessionId, config); + + auto ret = cryptoPlugin->setMediaDrmSession(sessionId); + EXPECT_OK(ret); + + decrypt(Mode::UNENCRYPTED, key.isSecure, toStdArray(key.keyId), &iv[0], subSamples, + noPattern, key.clearContentKey, Status::ERROR_DRM_FRAME_TOO_LARGE); + + closeSession(sessionId); + } + } +} + +/** + * Negative decrypt test. Decrypt without loading keys. + */ +TEST_P(DrmHalTest, EncryptedAesCtrSegmentTestNoKeys) { + for (const auto& config : contentConfigurations) { + for (const auto& key : config.keys) { + vector iv(AES_BLOCK_SIZE, 0); + const Pattern noPattern = {0, 0}; + const vector subSamples = { + {.numBytesOfClearData = 256, .numBytesOfEncryptedData = 256}}; + auto sessionId = openSession(); + + auto ret = cryptoPlugin->setMediaDrmSession(sessionId); + EXPECT_OK(ret); + + uint32_t byteCount = + decrypt(Mode::AES_CTR, key.isSecure, toStdArray(key.keyId), &iv[0], subSamples, + noPattern, key.clearContentKey, Status::ERROR_DRM_NO_LICENSE); + EXPECT_EQ(0u, byteCount); + + closeSession(sessionId); + } + } +} + +/** + * Ensure clearkey drm factory doesn't support security level higher than supported + */ +TEST_P(DrmHalClearkeyTest, BadLevelNotSupported) { + bool result = false; + auto ret = drmFactory->isCryptoSchemeSupported(getAidlUUID(), kVideoMp4, kHwSecureAll, &result); + EXPECT_OK(ret); + EXPECT_FALSE(result); +} + +/** + * Test resource contention during attempt to generate key request + */ +TEST_P(DrmHalClearkeyTest, GetKeyRequestResourceContention) { + auto ret = drmPlugin->setPropertyString(kDrmErrorTestKey, kDrmErrorResourceContention); + EXPECT_OK(ret); + + auto sessionId = openSession(); + vector initData; + KeyedVector optionalParameters; + KeyRequest result; + ret = drmPlugin->getKeyRequest(sessionId, initData, kVideoMp4, KeyType::STREAMING, + optionalParameters, &result); + EXPECT_TXN(ret); + EXPECT_EQ(Status::ERROR_DRM_RESOURCE_CONTENTION, DrmErr(ret)); + + ret = drmPlugin->closeSession(sessionId); + EXPECT_TXN(ret); + EXPECT_NE(Status::OK, DrmErr(ret)); +} + +/** + * Test clearkey plugin offline key with mock error + */ +TEST_P(DrmHalClearkeyTest, OfflineLicenseInvalidState) { + auto sessionId = openSession(); + vector keySetId = loadKeys(sessionId, KeyType::OFFLINE); + auto ret = drmPlugin->setPropertyString(kDrmErrorTestKey, kDrmErrorInvalidState); + EXPECT_OK(ret); + + // everything should start failing + const Status kInvalidState = Status::ERROR_DRM_INVALID_STATE; + vector result; + ret = drmPlugin->getOfflineLicenseKeySetIds(&result); + EXPECT_TXN(ret); + EXPECT_EQ(kInvalidState, DrmErr(ret)); + EXPECT_EQ(0u, result.size()); + + OfflineLicenseState state = OfflineLicenseState::UNKNOWN; + ret = drmPlugin->getOfflineLicenseState({keySetId}, &state); + EXPECT_TXN(ret); + EXPECT_EQ(kInvalidState, DrmErr(ret)); + EXPECT_EQ(OfflineLicenseState::UNKNOWN, state); + + ret = drmPlugin->removeOfflineLicense({keySetId}); + EXPECT_TXN(ret); + EXPECT_EQ(kInvalidState, DrmErr(ret)); + closeSession(sessionId); +} + +/** + * Test listener is triggered on key response + */ +TEST_P(DrmHalClearkeyTest, ListenerCallbacks) { + auto listener = ndk::SharedRefBase::make(); + auto res = drmPlugin->setListener(listener); + EXPECT_OK(res); + + auto sessionId = openSession(); + loadKeys(sessionId, KeyType::STREAMING); + closeSession(sessionId); + + auto args = listener->getEventArgs(); + EXPECT_EQ(EventType::VENDOR_DEFINED, args.eventType); + EXPECT_EQ(sessionId, args.data); + EXPECT_EQ(sessionId, args.sessionId); + + args = listener->getExpirationUpdateArgs(); + EXPECT_EQ(sessionId, args.sessionId); + EXPECT_EQ(100, args.expiryTimeInMS); + + args = listener->getKeysChangeArgs(); + const vector keyStatusList = { + {{0xa, 0xb, 0xc}, KeyStatusType::USABLE}, + {{0xd, 0xe, 0xf}, KeyStatusType::EXPIRED}, + {{0x0, 0x1, 0x2}, KeyStatusType::USABLEINFUTURE}, + }; + EXPECT_EQ(sessionId, args.sessionId); + EXPECT_EQ(keyStatusList, args.keyStatusList); + EXPECT_TRUE(args.hasNewUsableKey); +} + +/** + * Test SessionLostState is triggered on error + */ +TEST_P(DrmHalClearkeyTest, SessionLostState) { + auto listener = ndk::SharedRefBase::make(); + auto res = drmPlugin->setListener(listener); + EXPECT_OK(res); + + res = drmPlugin->setPropertyString(kDrmErrorTestKey, kDrmErrorInvalidState); + EXPECT_OK(res); + + auto sessionId = openSession(); + auto ret = drmPlugin->closeSession(sessionId); + + auto args = listener->getSessionLostStateArgs(); + EXPECT_EQ(sessionId, args.sessionId); +} + +/** + * Negative decrypt test. Decrypt with invalid key. + */ +TEST_P(DrmHalClearkeyTest, DecryptWithEmptyKey) { + vector iv(AES_BLOCK_SIZE, 0); + const Pattern noPattern = {0, 0}; + const uint32_t kClearBytes = 512; + const uint32_t kEncryptedBytes = 512; + const vector subSamples = { + {.numBytesOfClearData = kClearBytes, .numBytesOfEncryptedData = kEncryptedBytes}}; + + // base 64 encoded JSON response string, must not contain padding character '=' + const string emptyKeyResponse = + "{\"keys\":[" + "{" + "\"kty\":\"oct\"" + "\"alg\":\"A128KW2\"" + "\"k\":\"SGVsbG8gRnJpZW5kIQ\"" + "\"kid\":\"Y2xlYXJrZXlrZXlpZDAyAy\"" + "}" + "{" + "\"kty\":\"oct\"," + "\"alg\":\"A128KW2\"" + "\"kid\":\"Y2xlYXJrZXlrZXlpZDAzAy\"," // empty key follows + "\"k\":\"R\"" + "}]" + "}"; + const size_t kEmptyKeyResponseSize = emptyKeyResponse.size(); + + vector invalidResponse; + invalidResponse.resize(kEmptyKeyResponseSize); + memcpy(invalidResponse.data(), emptyKeyResponse.c_str(), kEmptyKeyResponseSize); + decryptWithInvalidKeys(invalidResponse, iv, noPattern, subSamples); +} + +/** + * Negative decrypt test. Decrypt with a key exceeds AES_BLOCK_SIZE. + */ +TEST_P(DrmHalClearkeyTest, DecryptWithKeyTooLong) { + vector iv(AES_BLOCK_SIZE, 0); + const Pattern noPattern = {0, 0}; + const uint32_t kClearBytes = 512; + const uint32_t kEncryptedBytes = 512; + const vector subSamples = { + {.numBytesOfClearData = kClearBytes, .numBytesOfEncryptedData = kEncryptedBytes}}; + + // base 64 encoded JSON response string, must not contain padding character '=' + const string keyTooLongResponse = + "{\"keys\":[" + "{" + "\"kty\":\"oct\"," + "\"alg\":\"A128KW2\"" + "\"kid\":\"Y2xlYXJrZXlrZXlpZDAzAy\"," // key too long + "\"k\":\"V2lubmllIHRoZSBwb29oIVdpbm5pZSB0aGUgcG9vaCE=\"" + "}]" + "}"; + const size_t kKeyTooLongResponseSize = keyTooLongResponse.size(); + + vector invalidResponse; + invalidResponse.resize(kKeyTooLongResponseSize); + memcpy(invalidResponse.data(), keyTooLongResponse.c_str(), kKeyTooLongResponseSize); + decryptWithInvalidKeys(invalidResponse, iv, noPattern, subSamples); +} diff --git a/drm/aidl/vts/drm_hal_test_main.cpp b/drm/aidl/vts/drm_hal_test_main.cpp new file mode 100644 index 0000000000..dc0f6d7d5f --- /dev/null +++ b/drm/aidl/vts/drm_hal_test_main.cpp @@ -0,0 +1,92 @@ +/* + * 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. + */ + +/** + * Instantiate the set of test cases for each vendor module + */ + +#define LOG_TAG "drm_hal_test_main" + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include "drm_hal_common.h" + +using ::aidl::android::hardware::drm::vts::DrmHalClearkeyTest; +using ::aidl::android::hardware::drm::vts::DrmHalTest; +using ::aidl::android::hardware::drm::vts::HalBaseName; +using drm_vts::DrmHalTestParam; +using drm_vts::PrintParamInstanceToString; + +static const std::vector getAllInstances() { + using ::aidl::android::hardware::drm::ICryptoFactory; + using ::aidl::android::hardware::drm::IDrmFactory; + + std::vector drmInstances = + android::getAidlHalInstanceNames(IDrmFactory::descriptor); + std::vector cryptoInstances = + android::getAidlHalInstanceNames(ICryptoFactory::descriptor); + + std::set allInstances; + for (auto svc : drmInstances) { + allInstances.insert(HalBaseName(svc)); + } + for (auto svc : cryptoInstances) { + allInstances.insert(HalBaseName(svc)); + } + + std::vector allInstanceUuidCombos; + auto noUUID = [](std::string s) { return DrmHalTestParam(s); }; + std::transform(allInstances.begin(), allInstances.end(), + std::back_inserter(allInstanceUuidCombos), noUUID); + return allInstanceUuidCombos; +}; + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DrmHalTest); +INSTANTIATE_TEST_SUITE_P(PerInstance, DrmHalTest, testing::ValuesIn(getAllInstances()), + PrintParamInstanceToString); +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DrmHalClearkeyTest); +INSTANTIATE_TEST_SUITE_P(PerInstance, DrmHalClearkeyTest, testing::ValuesIn(getAllInstances()), + PrintParamInstanceToString); + +int main(int argc, char** argv) { +#if defined(__LP64__) + const char* kModulePath = "/data/local/tmp/64/lib"; +#else + const char* kModulePath = "/data/local/tmp/32/lib"; +#endif + DrmHalTest::gVendorModules = new drm_vts::VendorModules(kModulePath); + if (DrmHalTest::gVendorModules->getPathList().size() == 0) { + std::cerr << "WARNING: No vendor modules found in " << kModulePath + << ", all vendor tests will be skipped" << std::endl; + } + ABinderProcess_setThreadPoolMaxThreadCount(1); + ABinderProcess_startThreadPool(); + ::testing::InitGoogleTest(&argc, argv); + int status = RUN_ALL_TESTS(); + ALOGI("Test result = %d", status); + return status; +} diff --git a/drm/aidl/vts/include/drm_hal_common.h b/drm/aidl/vts/include/drm_hal_common.h new file mode 100644 index 0000000000..4aac48bbb8 --- /dev/null +++ b/drm/aidl/vts/include/drm_hal_common.h @@ -0,0 +1,214 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "VtsHalHidlTargetCallbackBase.h" +#include "drm_hal_vendor_module_api.h" +#include "drm_vts_helper.h" +#include "vendor_modules.h" + +using drm_vts::DrmHalTestParam; + +namespace { +typedef vector<::aidl::android::hardware::drm::KeyValue> KeyedVector; +typedef std::vector SessionId; +} // namespace + +#define EXPECT_OK(ret) EXPECT_TRUE(::aidl::android::hardware::drm::vts::IsOk(ret)) +#define EXPECT_TXN(ret) EXPECT_TRUE(ret.isOk() || ret.getExceptionCode() == EX_SERVICE_SPECIFIC) + +namespace aidl { +namespace android { +namespace hardware { +namespace drm { +namespace vts { + +::aidl::android::hardware::drm::Status DrmErr(const ::ndk::ScopedAStatus& ret); +std::string HalBaseName(const std::string& fullname); +std::string HalFullName(const std::string& iface, const std::string& basename); +testing::AssertionResult IsOk(const ::ndk::ScopedAStatus& ret); + +extern const char* kDrmIface; +extern const char* kCryptoIface; + +class DrmHalTest : public ::testing::TestWithParam { + public: + static drm_vts::VendorModules* gVendorModules; + DrmHalTest(); + virtual void SetUp() override; + virtual void TearDown() override {} + + protected: + ::aidl::android::hardware::drm::Uuid getAidlUUID(); + std::vector getUUID(); + std::vector getVendorUUID(); + std::array GetParamUUID() { return GetParam().scheme_; } + std::string GetParamService() { return GetParam().instance_; } + ::aidl::android::hardware::drm::Uuid toAidlUuid(const std::vector& in_uuid) { + ::aidl::android::hardware::drm::Uuid uuid; + uuid.uuid = in_uuid; + return uuid; + } + + void provision(); + SessionId openSession(::aidl::android::hardware::drm::SecurityLevel level, + ::aidl::android::hardware::drm::Status* err); + SessionId openSession(); + void closeSession(const SessionId& sessionId); + std::vector loadKeys( + const SessionId& sessionId, + const ::aidl::android::hardware::drm::KeyType& type = KeyType::STREAMING); + std::vector loadKeys( + const SessionId& sessionId, const DrmHalVTSVendorModule_V1::ContentConfiguration&, + const ::aidl::android::hardware::drm::KeyType& type = KeyType::STREAMING); + std::vector getKeyRequest(const SessionId& sessionId, + const DrmHalVTSVendorModule_V1::ContentConfiguration&, + const ::aidl::android::hardware::drm::KeyType& type); + std::vector provideKeyResponse(const SessionId& sessionId, + const std::vector& keyResponse); + DrmHalVTSVendorModule_V1::ContentConfiguration getContent( + const ::aidl::android::hardware::drm::KeyType& type = KeyType::STREAMING) const; + + KeyedVector toAidlKeyedVector(const std::map& params); + std::array toStdArray(const std::vector& vec); + void fillRandom(const ::aidl::android::hardware::common::Ashmem& ashmem); + ::aidl::android::hardware::common::Ashmem getDecryptMemory(size_t size, size_t index); + + uint32_t decrypt(::aidl::android::hardware::drm::Mode mode, bool isSecure, + const std::array& keyId, uint8_t* iv, + const std::vector<::aidl::android::hardware::drm::SubSample>& subSamples, + const ::aidl::android::hardware::drm::Pattern& pattern, + const std::vector& key, + ::aidl::android::hardware::drm::Status expectedStatus); + void aes_ctr_decrypt(uint8_t* dest, uint8_t* src, uint8_t* iv, + const std::vector<::aidl::android::hardware::drm::SubSample>& subSamples, + const std::vector& key); + void aes_cbc_decrypt(uint8_t* dest, uint8_t* src, uint8_t* iv, + const std::vector<::aidl::android::hardware::drm::SubSample>& subSamples, + const std::vector& key); + + std::shared_ptr<::aidl::android::hardware::drm::IDrmFactory> drmFactory; + std::shared_ptr<::aidl::android::hardware::drm::ICryptoFactory> cryptoFactory; + std::shared_ptr<::aidl::android::hardware::drm::IDrmPlugin> drmPlugin; + std::shared_ptr<::aidl::android::hardware::drm::ICryptoPlugin> cryptoPlugin; + + unique_ptr vendorModule; + std::vector contentConfigurations; + + private: + std::shared_ptr<::aidl::android::hardware::drm::IDrmPlugin> createDrmPlugin(); + std::shared_ptr<::aidl::android::hardware::drm::ICryptoPlugin> createCryptoPlugin(); +}; + +class DrmHalClearkeyTest : public DrmHalTest { + public: + virtual void SetUp() override { + DrmHalTest::SetUp(); + const std::vector kClearKeyUUID = {0xE2, 0x71, 0x9D, 0x58, 0xA9, 0x85, 0xB3, 0xC9, + 0x78, 0x1A, 0xB0, 0x30, 0xAF, 0x78, 0xD3, 0x0E}; + static const std::string kMimeType = "video/mp4"; + static constexpr ::aidl::android::hardware::drm::SecurityLevel kSecurityLevel = + ::aidl::android::hardware::drm::SecurityLevel::SW_SECURE_CRYPTO; + + bool drmClearkey = false; + auto ret = drmFactory->isCryptoSchemeSupported(toAidlUuid(kClearKeyUUID), kMimeType, + kSecurityLevel, &drmClearkey); + if (!drmClearkey) { + GTEST_SKIP() << "ClearKey not supported by " << GetParamService(); + } + } + virtual void TearDown() override {} + void decryptWithInvalidKeys( + std::vector& invalidResponse, std::vector& iv, + const ::aidl::android::hardware::drm::Pattern& noPattern, + const std::vector<::aidl::android::hardware::drm::SubSample>& subSamples); +}; + +/** + * Event Handling tests + */ +extern const char* kCallbackLostState; +extern const char* kCallbackKeysChange; + +struct ListenerArgs { + EventType eventType; + SessionId sessionId; + int64_t expiryTimeInMS; + std::vector data; + std::vector keyStatusList; + bool hasNewUsableKey; +}; + +class DrmHalPluginListener : public BnDrmPluginListener { + public: + DrmHalPluginListener() {} + virtual ~DrmHalPluginListener() {} + + virtual ::ndk::ScopedAStatus onEvent( + ::aidl::android::hardware::drm::EventType in_eventType, + const std::vector& in_sessionId, + const std::vector& in_data) override; + + virtual ::ndk::ScopedAStatus onExpirationUpdate( + const std::vector& in_sessionId, + int64_t in_expiryTimeInMS) override; + + virtual ::ndk::ScopedAStatus onSessionLostState( + const std::vector& in_sessionId) override; + + virtual ::ndk::ScopedAStatus onKeysChange( + const std::vector& in_sessionId, + const std::vector<::aidl::android::hardware::drm::KeyStatus>& in_keyStatusList, + bool in_hasNewUsableKey) override; + + ListenerArgs getEventArgs(); + ListenerArgs getExpirationUpdateArgs(); + ListenerArgs getSessionLostStateArgs(); + ListenerArgs getKeysChangeArgs(); + + private: + ListenerArgs getListenerArgs(std::promise& promise); + std::promise eventPromise, expirationUpdatePromise, + sessionLostStatePromise, keysChangePromise; +}; + +} // namespace vts +} // namespace drm +} // namespace hardware +} // namespace android +} // namespace aidl -- GitLab From 02c7bb3df958471cf100727899aa1ec1ceb9ae15 Mon Sep 17 00:00:00 2001 From: Chris Ye Date: Thu, 13 Jan 2022 12:13:48 -0800 Subject: [PATCH 504/825] Get bridged AP interface name from Wifi HAL. In bridged AP VTS test, need to get the interface name from bridged AP from Wifi HAL. As Wifi HAL is still in HIDL interface, need to use HIDL API to obtain the bridged AP interface name. Test: atest VtsHalHostapdTargetTest Bug: 211073349 Change-Id: Ib594877899ff0fe3ef0a7f01fdb169204dff6a74 --- wifi/hostapd/aidl/vts/functional/Android.bp | 14 ++++++++ .../functional/VtsHalHostapdTargetTest.cpp | 36 +++++++++++++++++-- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/wifi/hostapd/aidl/vts/functional/Android.bp b/wifi/hostapd/aidl/vts/functional/Android.bp index e58cf5ede3..e61d3975bb 100644 --- a/wifi/hostapd/aidl/vts/functional/Android.bp +++ b/wifi/hostapd/aidl/vts/functional/Android.bp @@ -17,9 +17,23 @@ cc_test { shared_libs: [ "libbinder", "libbinder_ndk", + "libvndksupport", ], static_libs: [ "android.hardware.wifi.hostapd-V1-ndk", + "VtsHalWifiV1_0TargetTestUtil", + "VtsHalWifiV1_5TargetTestUtil", + "VtsHalWifiHostapdV1_0TargetTestUtil", + "android.hardware.wifi.hostapd@1.0", + "android.hardware.wifi.hostapd@1.1", + "android.hardware.wifi.hostapd@1.2", + "android.hardware.wifi.hostapd@1.3", + "android.hardware.wifi@1.0", + "android.hardware.wifi@1.1", + "android.hardware.wifi@1.2", + "android.hardware.wifi@1.3", + "android.hardware.wifi@1.4", + "android.hardware.wifi@1.5", ], test_suites: [ "general-tests", diff --git a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp index cd7ff82156..c1f2bb7280 100644 --- a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp +++ b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp @@ -13,6 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include +#include + #include #include #include @@ -21,6 +24,11 @@ #include #include #include +#include +#include +#include +#include +#include using aidl::android::hardware::wifi::hostapd::BandMask; using aidl::android::hardware::wifi::hostapd::BnHostapdCallback; @@ -69,19 +77,42 @@ class HostapdAidl : public testing::TestWithParam { isBridgedSupport = testing::checkSubstringInCommandOutput( "/system/bin/cmd wifi get-softap-supported-features", "wifi_softap_bridged_ap_supported"); + const std::vector instances = android::hardware::getAllHalInstanceNames( + ::android::hardware::wifi::V1_0::IWifi::descriptor); + EXPECT_NE(0, instances.size()); + wifiInstanceName = instances[0]; } virtual void TearDown() override { + if (getWifi(wifiInstanceName) != nullptr) { + stopWifi(wifiInstanceName); + } hostapd->terminate(); // Wait 3 seconds to allow terminate to complete sleep(3); } std::shared_ptr hostapd; + std::string wifiInstanceName; bool isAcsSupport; bool isWpa3SaeSupport; bool isBridgedSupport; + std::string setupApIfaceAndGetName(bool isBridged) { + android::sp<::android::hardware::wifi::V1_0::IWifiApIface> wifi_ap_iface; + if (isBridged) { + wifi_ap_iface = getBridgedWifiApIface_1_5(wifiInstanceName); + } else { + wifi_ap_iface = getWifiApIface_1_5(wifiInstanceName); + } + EXPECT_NE(nullptr, wifi_ap_iface.get()); + + const auto& status_and_name = HIDL_INVOKE(wifi_ap_iface, getName); + EXPECT_EQ(android::hardware::wifi::V1_0::WifiStatusCode::SUCCESS, + status_and_name.first.code); + return status_and_name.second; + } + IfaceParams getIfaceParamsWithoutAcs(std::string iface_name) { IfaceParams iface_params; ChannelParams channelParams; @@ -426,8 +457,9 @@ TEST_P(HostapdAidl, DisconnectClientWhenIfacAvailable) { */ TEST_P(HostapdAidl, AddAccessPointWithDualBandConfig) { if (!isBridgedSupport) GTEST_SKIP() << "Missing Bridged AP support"; - auto status = hostapd->addAccessPoint( - getIfaceParamsWithBridgedModeACS(kIfaceName), getOpenNwParams()); + std::string ifname = setupApIfaceAndGetName(true); + auto status = + hostapd->addAccessPoint(getIfaceParamsWithBridgedModeACS(ifname), getOpenNwParams()); EXPECT_TRUE(status.isOk()); } -- GitLab From 59559857411c4e655079b9404f7d35ecd105d966 Mon Sep 17 00:00:00 2001 From: Sunil Ravi Date: Mon, 24 Jan 2022 17:33:24 -0800 Subject: [PATCH 505/825] Wifi: API to set the indoor state of device If set, it indicates that the device is operating in an indoor environment. When driver receives this indication, it can safely enable WFD GO operation on indoor channels. Bug: 207671411 Test: Manual basic wifi tests Change-Id: I4cc4c22444f0796c280220534d43c4ae8cae0899 --- wifi/1.6/default/wifi_legacy_hal.cpp | 4 ++++ wifi/1.6/default/wifi_legacy_hal.h | 2 ++ wifi/1.6/default/wifi_legacy_hal_stubs.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/wifi/1.6/default/wifi_legacy_hal.cpp b/wifi/1.6/default/wifi_legacy_hal.cpp index e6e8141603..64dde9576e 100644 --- a/wifi/1.6/default/wifi_legacy_hal.cpp +++ b/wifi/1.6/default/wifi_legacy_hal.cpp @@ -1533,6 +1533,10 @@ wifi_error WifiLegacyHal::triggerSubsystemRestart() { return global_func_table_.wifi_trigger_subsystem_restart(global_handle_); } +wifi_error WifiLegacyHal::setIndoorState(bool isIndoor) { + return global_func_table_.wifi_set_indoor_state(global_handle_, isIndoor); +} + void WifiLegacyHal::invalidate() { global_handle_ = nullptr; iface_name_to_handle_.clear(); diff --git a/wifi/1.6/default/wifi_legacy_hal.h b/wifi/1.6/default/wifi_legacy_hal.h index 7dc6bd643e..1d85d2e0b1 100644 --- a/wifi/1.6/default/wifi_legacy_hal.h +++ b/wifi/1.6/default/wifi_legacy_hal.h @@ -658,6 +658,8 @@ class WifiLegacyHal { wifi_error triggerSubsystemRestart(); + wifi_error setIndoorState(bool isIndoor); + private: // Retrieve interface handles for all the available interfaces. wifi_error retrieveIfaceHandles(); diff --git a/wifi/1.6/default/wifi_legacy_hal_stubs.cpp b/wifi/1.6/default/wifi_legacy_hal_stubs.cpp index e03e1ae1a1..7e66fab863 100644 --- a/wifi/1.6/default/wifi_legacy_hal_stubs.cpp +++ b/wifi/1.6/default/wifi_legacy_hal_stubs.cpp @@ -161,6 +161,7 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) { populateStubFor(&hal_fn->wifi_set_dtim_config); populateStubFor(&hal_fn->wifi_get_usable_channels); populateStubFor(&hal_fn->wifi_trigger_subsystem_restart); + populateStubFor(&hal_fn->wifi_set_indoor_state); return true; } } // namespace legacy_hal -- GitLab From 549e7f542321c0d725bc18614ace55bebfa52a4d Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Mon, 24 Jan 2022 17:22:52 -0800 Subject: [PATCH 506/825] Add OWNERS for IUsb aidl interface Bug: 200993386 Signed-off-by: Badhri Jagan Sridharan Change-Id: I7fd3c3466d81f125f970ef0cbb9a121655d6dde5 --- usb/aidl/OWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 usb/aidl/OWNERS diff --git a/usb/aidl/OWNERS b/usb/aidl/OWNERS new file mode 100644 index 0000000000..fefae560a5 --- /dev/null +++ b/usb/aidl/OWNERS @@ -0,0 +1 @@ +badhri@google.com -- GitLab From 5b320fb72d79b658b89e79aa6a095673f1ad363d Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 21 Jan 2022 20:02:16 -0800 Subject: [PATCH 507/825] Move PendingRequestPool and ParcelableUtils. Move PendingRequestPool and ParcelableUtils to utils so that we could reuse it for cpp VHAL client. This CL also fixes a bug that the comment for PendingRequestPool timeout unit is incorrect. Test: atest VehicleHalVehicleUtilsTest Bug: 214635003 Change-Id: Ie8ac1e0c4f49ae70caff7b680a7352fc23d4e680 --- automotive/vehicle/aidl/impl/Android.bp | 4 ++++ .../impl/{vhal => utils/common}/include/ParcelableUtils.h | 0 .../impl/{vhal => utils/common}/include/PendingRequestPool.h | 2 +- .../impl/{vhal => utils/common}/src/PendingRequestPool.cpp | 0 .../{vhal => utils/common}/test/PendingRequestPoolTest.cpp | 0 automotive/vehicle/aidl/impl/vhal/Android.bp | 4 ---- automotive/vehicle/aidl/impl/vhal/test/Android.bp | 2 -- 7 files changed, 5 insertions(+), 7 deletions(-) rename automotive/vehicle/aidl/impl/{vhal => utils/common}/include/ParcelableUtils.h (100%) rename automotive/vehicle/aidl/impl/{vhal => utils/common}/include/PendingRequestPool.h (98%) rename automotive/vehicle/aidl/impl/{vhal => utils/common}/src/PendingRequestPool.cpp (100%) rename automotive/vehicle/aidl/impl/{vhal => utils/common}/test/PendingRequestPoolTest.cpp (100%) diff --git a/automotive/vehicle/aidl/impl/Android.bp b/automotive/vehicle/aidl/impl/Android.bp index 94f590dd3e..16b6fde178 100644 --- a/automotive/vehicle/aidl/impl/Android.bp +++ b/automotive/vehicle/aidl/impl/Android.bp @@ -21,6 +21,7 @@ package { cc_defaults { name: "VehicleHalDefaults", static_libs: [ + "android-automotive-large-parcelable-vendor-lib", "android.hardware.automotive.vehicle-V1-ndk", "libmath", ], @@ -35,4 +36,7 @@ cc_defaults { "-Werror", "-Wthread-safety", ], + defaults: [ + "android-automotive-large-parcelable-defaults", + ], } diff --git a/automotive/vehicle/aidl/impl/vhal/include/ParcelableUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/ParcelableUtils.h similarity index 100% rename from automotive/vehicle/aidl/impl/vhal/include/ParcelableUtils.h rename to automotive/vehicle/aidl/impl/utils/common/include/ParcelableUtils.h diff --git a/automotive/vehicle/aidl/impl/vhal/include/PendingRequestPool.h b/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h similarity index 98% rename from automotive/vehicle/aidl/impl/vhal/include/PendingRequestPool.h rename to automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h index efb33151bd..dcf5057fcc 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/PendingRequestPool.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h @@ -37,7 +37,7 @@ class PendingRequestPool final { public: using TimeoutCallbackFunc = std::function&)>; - explicit PendingRequestPool(int64_t timeoutInSec); + explicit PendingRequestPool(int64_t timeoutInNano); ~PendingRequestPool(); diff --git a/automotive/vehicle/aidl/impl/vhal/src/PendingRequestPool.cpp b/automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp similarity index 100% rename from automotive/vehicle/aidl/impl/vhal/src/PendingRequestPool.cpp rename to automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp diff --git a/automotive/vehicle/aidl/impl/vhal/test/PendingRequestPoolTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/PendingRequestPoolTest.cpp similarity index 100% rename from automotive/vehicle/aidl/impl/vhal/test/PendingRequestPoolTest.cpp rename to automotive/vehicle/aidl/impl/utils/common/test/PendingRequestPoolTest.cpp diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp index 0132e6f695..49f48f7aa8 100644 --- a/automotive/vehicle/aidl/impl/vhal/Android.bp +++ b/automotive/vehicle/aidl/impl/vhal/Android.bp @@ -34,7 +34,6 @@ cc_binary { "DefaultVehicleHal", "FakeVehicleHardware", "VehicleHalUtils", - "android-automotive-large-parcelable-vendor-lib", ], header_libs: [ "IVehicleHardware", @@ -49,20 +48,17 @@ cc_library { vendor: true, defaults: [ "VehicleHalDefaults", - "android-automotive-large-parcelable-defaults", ], local_include_dirs: ["include"], export_include_dirs: ["include"], srcs: [ "src/ConnectedClient.cpp", "src/DefaultVehicleHal.cpp", - "src/PendingRequestPool.cpp", "src/RecurrentTimer.cpp", "src/SubscriptionManager.cpp", ], static_libs: [ "VehicleHalUtils", - "android-automotive-large-parcelable-vendor-lib", ], header_libs: [ "IVehicleHardware", diff --git a/automotive/vehicle/aidl/impl/vhal/test/Android.bp b/automotive/vehicle/aidl/impl/vhal/test/Android.bp index bf16475ab0..7122aa5230 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/Android.bp +++ b/automotive/vehicle/aidl/impl/vhal/test/Android.bp @@ -25,7 +25,6 @@ cc_test { static_libs: [ "DefaultVehicleHal", "VehicleHalUtils", - "android-automotive-large-parcelable-vendor-lib", "libgtest", "libgmock", ], @@ -40,7 +39,6 @@ cc_test { ], defaults: [ "VehicleHalDefaults", - "android-automotive-large-parcelable-defaults", ], test_suites: ["device-tests"], } -- GitLab From 5ee4de588bf761fe39cba368805e2334c80c61c8 Mon Sep 17 00:00:00 2001 From: John Reck Date: Mon, 24 Jan 2022 19:50:21 -0500 Subject: [PATCH 508/825] Clarify FRONT_BUFFER requirements Bug: 193558894 Test: N/A Change-Id: I9c22df7b6a7a5facb37ab6fc37f926c484c2792b --- .../hardware/graphics/common/BufferUsage.aidl | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl b/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl index 4b5a306881..60dfbfb319 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl @@ -107,7 +107,24 @@ enum BufferUsage { /* Bits 28-31 are reserved for vendor usage */ /** - * Buffer is used for front-buffer rendering + * 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. */ FRONT_BUFFER = 1L << 32, -- GitLab From 50c001dd21719c07daca314a560c62b347eaca48 Mon Sep 17 00:00:00 2001 From: Nate Jiang Date: Wed, 12 Jan 2022 16:06:01 -0800 Subject: [PATCH 509/825] Wifi: Add support for Wifi Aware 3.1 Bug: 203220137 Test: pass vts test Change-Id: I576e03b7cb94466c094a7e4ca1714dddd81ddd5f --- wifi/1.6/IWifiChip.hal | 3 +- wifi/1.6/IWifiNanIface.hal | 112 ++++ wifi/1.6/IWifiNanIfaceEventCallback.hal | 26 + wifi/1.6/IWifiRttController.hal | 1 + wifi/1.6/default/hidl_struct_util.cpp | 299 ++++++--- wifi/1.6/default/hidl_struct_util.h | 35 +- .../tests/wifi_nan_iface_unit_tests.cpp | 3 +- wifi/1.6/default/wifi_nan_iface.cpp | 138 +++- wifi/1.6/default/wifi_nan_iface.h | 47 +- wifi/1.6/types.hal | 634 +++++++++++++++++- 10 files changed, 1142 insertions(+), 156 deletions(-) diff --git a/wifi/1.6/IWifiChip.hal b/wifi/1.6/IWifiChip.hal index 301bd82ca5..b252a053e8 100644 --- a/wifi/1.6/IWifiChip.hal +++ b/wifi/1.6/IWifiChip.hal @@ -27,7 +27,6 @@ import IWifiRttController; * Interface that represents a chip that must be configured as a single unit. */ interface IWifiChip extends @1.5::IWifiChip { - /** * Create a RTTController instance. * @@ -85,6 +84,6 @@ interface IWifiChip extends @1.5::IWifiChip { * represents whether particular mode is allowed on that channel. */ getUsableChannels_1_6(WifiBand band, bitfield ifaceModeMask, - bitfield filterMask) + bitfield filterMask) generates (WifiStatus status, vec channels); }; diff --git a/wifi/1.6/IWifiNanIface.hal b/wifi/1.6/IWifiNanIface.hal index b92a880364..7ffd2785a0 100644 --- a/wifi/1.6/IWifiNanIface.hal +++ b/wifi/1.6/IWifiNanIface.hal @@ -17,8 +17,15 @@ package android.hardware.wifi@1.6; import @1.0::WifiStatus; +import @1.0::CommandIdShort; +import @1.4::NanConfigRequest; +import @1.4::NanEnableRequest; import @1.5::IWifiNanIface; import IWifiNanIfaceEventCallback; +import NanConfigRequestSupplemental; +import NanInitiateDataPathRequest; +import NanPublishRequest; +import NanRespondToDataPathIndicationRequest; /** * Interface used to represent a single NAN (Neighbour Aware Network) iface. @@ -40,4 +47,109 @@ interface IWifiNanIface extends @1.5::IWifiNanIface { * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| */ registerEventCallback_1_6(IWifiNanIfaceEventCallback callback) generates (WifiStatus status); + + /** + * Initiate a data-path (NDP) setup operation: Initiator. + * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyInitiateDataPathResponse|. + * + * Note: supersedes the @1.0::IWifiNanIface.respondToDataPathIndicationRequest() method which is + * deprecated as of HAL version 1.6. + * + * @param cmdId command Id to use for this invocation. + * @param msg Instance of |NanInitiateDataPathRequest|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + initiateDataPathRequest_1_6(CommandIdShort cmdId, NanInitiateDataPathRequest msg) + generates (WifiStatus status); + + /** + * Respond to a received data indication as part of a data-path (NDP) setup operation. An + * indication is received by the Responder from the Initiator. + * Asynchronous response is with + * |IWifiNanIfaceEventCallback.notifyRespondToDataPathIndicationResponse|. + * + * Note: supersedes the @1.0::IWifiNanIface.respondToDataPathIndicationRequest() method which is + * deprecated as of HAL version 1.6. + * + * @param cmdId command Id to use for this invocation. + * @param msg Instance of |NanRespondToDataPathIndicationRequest|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + respondToDataPathIndicationRequest_1_6(CommandIdShort cmdId, + NanRespondToDataPathIndicationRequest msg) generates (WifiStatus status); + + /** + * Enable NAN: configures and activates NAN clustering (does not start + * a discovery session or set up data-interfaces or data-paths). Use the + * |IWifiNanIface.configureRequest| method to change the configuration of an already enabled + * NAN interface. + * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyEnableResponse|. + * + * Note: supersedes the @1.5::IWifiNanIface.enableRequest() method which is deprecated as of + * HAL version 1.6. + * + * @param cmdId command Id to use for this invocation. + * @param msg1 Instance of |NanEnableRequest|. + * @param msg2 Instance of |NanConfigRequestSupplemental|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + enableRequest_1_6(CommandIdShort cmdId, NanEnableRequest msg1, + NanConfigRequestSupplemental msg2) generates (WifiStatus status); + + /** + * Configure NAN: configures an existing NAN functionality (i.e. assumes + * |IWifiNanIface.enableRequest| already submitted and succeeded). + * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyConfigResponse|. + * + * Note: supersedes the @1.5::IWifiNanIface.configRequest() method which is deprecated as of + * HAL version 1.6. + * + * @param cmdId command Id to use for this invocation. + * @param msg1 Instance of |NanConfigRequest|. + * @param msg2 Instance of |NanConfigRequestSupplemental|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + configRequest_1_6(CommandIdShort cmdId, NanConfigRequest msg1, + NanConfigRequestSupplemental msg2) generates (WifiStatus status); + + /** + * Publish request to start advertising a discovery service. + * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyStartPublishResponse|. + * + * Note: supersedes the @1.0::IWifiNanIface.startPublishRequest() method which is deprecated as + * of HAL version 1.6. + * + * @param cmdId command Id to use for this invocation. + * @param msg Instance of |NanPublishRequest|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + startPublishRequest_1_6(CommandIdShort cmdId, NanPublishRequest msg) + generates (WifiStatus status); }; diff --git a/wifi/1.6/IWifiNanIfaceEventCallback.hal b/wifi/1.6/IWifiNanIfaceEventCallback.hal index 05b8ddfa52..f19f900fb8 100644 --- a/wifi/1.6/IWifiNanIfaceEventCallback.hal +++ b/wifi/1.6/IWifiNanIfaceEventCallback.hal @@ -45,4 +45,30 @@ interface IWifiNanIfaceEventCallback extends @1.5::IWifiNanIfaceEventCallback { * @param event: NanDataPathScheduleUpdateInd containing event details. */ oneway eventDataPathScheduleUpdate_1_6(NanDataPathScheduleUpdateInd event); + + /** + * Asynchronous callback indicating that a match has occurred: i.e. a service has been + * discovered. + * + * Note: supersedes the @1.0::IWifiNanIfaceEventCallback.eventMatch(NanMatchInd event) method + * which is deprecated as of HAL version 1.6. + * + * @param event: NanMatchInd containing event details. + */ + oneway eventMatch_1_6(NanMatchInd event); + + /** + * Asynchronous callback invoked in response to a capability request + * |IWifiNanIface.getCapabilitiesRequest|. + * + * Note: supersedes the @1.5::IWifiNanIfaceEventCallback.notifyCapabilitiesResponse() method + * which is deprecated as of HAL version 1.6. + * + * @param cmdId command Id corresponding to the original request. + * @param status WifiNanStatus of the operation. Possible status codes are: + * |NanStatusType.SUCCESS| + * @param capabilities Capability data. + */ + oneway notifyCapabilitiesResponse_1_6(CommandIdShort id, WifiNanStatus status, + NanCapabilities capabilities); }; diff --git a/wifi/1.6/IWifiRttController.hal b/wifi/1.6/IWifiRttController.hal index 0db1d2c72b..a08f7e4148 100644 --- a/wifi/1.6/IWifiRttController.hal +++ b/wifi/1.6/IWifiRttController.hal @@ -20,6 +20,7 @@ import @1.0::CommandId; import @1.0::WifiStatus; import @1.4::IWifiRttController; import IWifiRttControllerEventCallback; + /** * Interface used to perform RTT(Round trip time) operations. */ diff --git a/wifi/1.6/default/hidl_struct_util.cpp b/wifi/1.6/default/hidl_struct_util.cpp index 2a6b13199b..eeea6ef3fb 100644 --- a/wifi/1.6/default/hidl_struct_util.cpp +++ b/wifi/1.6/default/hidl_struct_util.cpp @@ -26,7 +26,7 @@ namespace V1_6 { namespace implementation { namespace hidl_struct_util { -using V1_5::NanConfigRequestSupplemental; +using V1_6::NanConfigRequestSupplemental; WifiChannelWidthInMhz convertLegacyWifiChannelWidthToHidl(legacy_hal::wifi_channel_width type); @@ -1363,11 +1363,11 @@ bool convertHidlNanEnableRequestToLegacy(const V1_4::NanEnableRequest& hidl_requ return true; } -bool convertHidlNanEnableRequest_1_4ToLegacy(const V1_4::NanEnableRequest& hidl_request1, +bool convertHidlNanEnableRequest_1_6ToLegacy(const V1_4::NanEnableRequest& hidl_request1, const NanConfigRequestSupplemental& hidl_request2, legacy_hal::NanEnableRequest* legacy_request) { if (!legacy_request) { - LOG(ERROR) << "convertHidlNanEnableRequest_1_4ToLegacy: null legacy_request"; + LOG(ERROR) << "convertHidlNanEnableRequest_1_6ToLegacy: null legacy_request"; return false; } @@ -1377,57 +1377,57 @@ bool convertHidlNanEnableRequest_1_4ToLegacy(const V1_4::NanEnableRequest& hidl_ } legacy_request->config_discovery_beacon_int = 1; - legacy_request->discovery_beacon_interval = hidl_request2.V1_2.discoveryBeaconIntervalMs; + legacy_request->discovery_beacon_interval = hidl_request2.V1_5.V1_2.discoveryBeaconIntervalMs; legacy_request->config_nss = 1; - legacy_request->nss = hidl_request2.V1_2.numberOfSpatialStreamsInDiscovery; + legacy_request->nss = hidl_request2.V1_5.V1_2.numberOfSpatialStreamsInDiscovery; legacy_request->config_dw_early_termination = 1; legacy_request->enable_dw_termination = - hidl_request2.V1_2.enableDiscoveryWindowEarlyTermination; + hidl_request2.V1_5.V1_2.enableDiscoveryWindowEarlyTermination; legacy_request->config_enable_ranging = 1; - legacy_request->enable_ranging = hidl_request2.V1_2.enableRanging; - - return true; -} - -bool convertHidlNanEnableRequest_1_5ToLegacy(const V1_4::NanEnableRequest& hidl_request1, - const NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanEnableRequest* legacy_request) { - if (!legacy_request) { - LOG(ERROR) << "convertHidlNanEnableRequest_1_5ToLegacy: null legacy_request"; - return false; - } - - *legacy_request = {}; - if (!convertHidlNanEnableRequest_1_4ToLegacy(hidl_request1, hidl_request2, legacy_request)) { - return false; - } + legacy_request->enable_ranging = hidl_request2.V1_5.V1_2.enableRanging; legacy_request->config_enable_instant_mode = 1; - legacy_request->enable_instant_mode = hidl_request2.enableInstantCommunicationMode; + legacy_request->enable_instant_mode = hidl_request2.V1_5.enableInstantCommunicationMode; + legacy_request->config_instant_mode_channel = 1; + legacy_request->instant_mode_channel = hidl_request2.instantModeChannel; return true; } -bool convertHidlNanConfigRequest_1_5ToLegacy(const V1_4::NanConfigRequest& hidl_request1, +bool convertHidlNanConfigRequest_1_6ToLegacy(const V1_4::NanConfigRequest& hidl_request1, const NanConfigRequestSupplemental& hidl_request2, legacy_hal::NanConfigRequest* legacy_request) { if (!legacy_request) { - LOG(ERROR) << "convertHidlNanConfigRequest_1_5ToLegacy: null legacy_request"; + LOG(ERROR) << "convertHidlNanConfigRequest_1_6ToLegacy: null legacy_request"; return false; } *legacy_request = {}; - if (!convertHidlNanConfigRequest_1_4ToLegacy(hidl_request1, hidl_request2, legacy_request)) { + if (!convertHidlNanConfigRequestToLegacy(hidl_request1, legacy_request)) { return false; } + legacy_request->config_discovery_beacon_int = 1; + legacy_request->discovery_beacon_interval = hidl_request2.V1_5.V1_2.discoveryBeaconIntervalMs; + legacy_request->config_nss = 1; + legacy_request->nss = hidl_request2.V1_5.V1_2.numberOfSpatialStreamsInDiscovery; + legacy_request->config_dw_early_termination = 1; + legacy_request->enable_dw_termination = + hidl_request2.V1_5.V1_2.enableDiscoveryWindowEarlyTermination; + legacy_request->config_enable_ranging = 1; + legacy_request->enable_ranging = hidl_request2.V1_5.V1_2.enableRanging; + + return true; + legacy_request->config_enable_instant_mode = 1; - legacy_request->enable_instant_mode = hidl_request2.enableInstantCommunicationMode; + legacy_request->enable_instant_mode = hidl_request2.V1_5.enableInstantCommunicationMode; + legacy_request->config_instant_mode_channel = 1; + legacy_request->instant_mode_channel = hidl_request2.instantModeChannel; return true; } -bool convertHidlNanPublishRequestToLegacy(const NanPublishRequest& hidl_request, +bool convertHidlNanPublishRequestToLegacy(const V1_6::NanPublishRequest& hidl_request, legacy_hal::NanPublishRequest* legacy_request) { if (!legacy_request) { LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: null legacy_request"; @@ -1494,6 +1494,15 @@ bool convertHidlNanPublishRequestToLegacy(const NanPublishRequest& hidl_request, hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0; legacy_request->recv_indication_cfg |= 0x8; legacy_request->cipher_type = (unsigned int)hidl_request.baseConfigs.securityConfig.cipherType; + + legacy_request->scid_len = hidl_request.baseConfigs.securityConfig.scid.size(); + if (legacy_request->scid_len > NAN_MAX_SCID_BUF_LEN) { + LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: scid_len too large"; + return false; + } + memcpy(legacy_request->scid, hidl_request.baseConfigs.securityConfig.scid.data(), + legacy_request->scid_len); + if (hidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PMK) { legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; legacy_request->key_info.body.pmk_info.pmk_len = @@ -1531,6 +1540,7 @@ bool convertHidlNanPublishRequestToLegacy(const NanPublishRequest& hidl_request, (hidl_request.baseConfigs.securityConfig.securityType != NanDataPathSecurityType::OPEN) ? legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; + legacy_request->sdea_params.ranging_state = hidl_request.baseConfigs.rangingRequired ? legacy_hal::NAN_RANGING_ENABLE : legacy_hal::NAN_RANGING_DISABLE; @@ -1554,7 +1564,7 @@ bool convertHidlNanPublishRequestToLegacy(const NanPublishRequest& hidl_request, return true; } -bool convertHidlNanSubscribeRequestToLegacy(const NanSubscribeRequest& hidl_request, +bool convertHidlNanSubscribeRequestToLegacy(const V1_0::NanSubscribeRequest& hidl_request, legacy_hal::NanSubscribeRequest* legacy_request) { if (!legacy_request) { LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: legacy_request is null"; @@ -1835,38 +1845,88 @@ bool convertHidlNanConfigRequestToLegacy(const V1_4::NanConfigRequest& hidl_requ return true; } -bool convertHidlNanConfigRequest_1_4ToLegacy(const V1_4::NanConfigRequest& hidl_request1, - const NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanConfigRequest* legacy_request) { +bool convertHidlNanDataPathInitiatorRequestToLegacy( + const V1_0::NanInitiateDataPathRequest& hidl_request, + legacy_hal::NanDataPathInitiatorRequest* legacy_request) { if (!legacy_request) { - LOG(ERROR) << "convertHidlNanConfigRequest_1_4ToLegacy: legacy_request " - "is null"; + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " + "legacy_request is null"; return false; } - *legacy_request = {}; - if (!convertHidlNanConfigRequestToLegacy(hidl_request1, legacy_request)) { + + legacy_request->requestor_instance_id = hidl_request.peerId; + memcpy(legacy_request->peer_disc_mac_addr, hidl_request.peerDiscMacAddr.data(), 6); + legacy_request->channel_request_type = + convertHidlNanDataPathChannelCfgToLegacy(hidl_request.channelRequestType); + legacy_request->channel = hidl_request.channel; + if (strnlen(hidl_request.ifaceName.c_str(), IFNAMSIZ + 1) == IFNAMSIZ + 1) { + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " + "ifaceName too long"; return false; } - - legacy_request->config_discovery_beacon_int = 1; - legacy_request->discovery_beacon_interval = hidl_request2.V1_2.discoveryBeaconIntervalMs; - legacy_request->config_nss = 1; - legacy_request->nss = hidl_request2.V1_2.numberOfSpatialStreamsInDiscovery; - legacy_request->config_dw_early_termination = 1; - legacy_request->enable_dw_termination = - hidl_request2.V1_2.enableDiscoveryWindowEarlyTermination; - legacy_request->config_enable_ranging = 1; - legacy_request->enable_ranging = hidl_request2.V1_2.enableRanging; + strncpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); + legacy_request->ndp_cfg.security_cfg = + (hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN) + ? legacy_hal::NAN_DP_CONFIG_SECURITY + : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; + legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size(); + if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) { + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " + "ndp_app_info_len too large"; + return false; + } + memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(), + legacy_request->app_info.ndp_app_info_len); + legacy_request->cipher_type = (unsigned int)hidl_request.securityConfig.cipherType; + if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; + legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size(); + if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " + "invalid pmk_len"; + return false; + } + memcpy(legacy_request->key_info.body.pmk_info.pmk, hidl_request.securityConfig.pmk.data(), + legacy_request->key_info.body.pmk_info.pmk_len); + } + if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; + legacy_request->key_info.body.passphrase_info.passphrase_len = + hidl_request.securityConfig.passphrase.size(); + if (legacy_request->key_info.body.passphrase_info.passphrase_len < + NAN_SECURITY_MIN_PASSPHRASE_LEN) { + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " + "passphrase_len too small"; + return false; + } + if (legacy_request->key_info.body.passphrase_info.passphrase_len > + NAN_SECURITY_MAX_PASSPHRASE_LEN) { + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " + "passphrase_len too large"; + return false; + } + memcpy(legacy_request->key_info.body.passphrase_info.passphrase, + hidl_request.securityConfig.passphrase.data(), + legacy_request->key_info.body.passphrase_info.passphrase_len); + } + legacy_request->service_name_len = hidl_request.serviceNameOutOfBand.size(); + if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " + "service_name_len too large"; + return false; + } + memcpy(legacy_request->service_name, hidl_request.serviceNameOutOfBand.data(), + legacy_request->service_name_len); return true; } -bool convertHidlNanDataPathInitiatorRequestToLegacy( - const NanInitiateDataPathRequest& hidl_request, +bool convertHidlNanDataPathInitiatorRequest_1_6ToLegacy( + const V1_6::NanInitiateDataPathRequest& hidl_request, legacy_hal::NanDataPathInitiatorRequest* legacy_request) { if (!legacy_request) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: " "legacy_request is null"; return false; } @@ -1878,7 +1938,7 @@ bool convertHidlNanDataPathInitiatorRequestToLegacy( convertHidlNanDataPathChannelCfgToLegacy(hidl_request.channelRequestType); legacy_request->channel = hidl_request.channel; if (strnlen(hidl_request.ifaceName.c_str(), IFNAMSIZ + 1) == IFNAMSIZ + 1) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: " "ifaceName too long"; return false; } @@ -1889,7 +1949,7 @@ bool convertHidlNanDataPathInitiatorRequestToLegacy( : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size(); if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: " "ndp_app_info_len too large"; return false; } @@ -1900,7 +1960,7 @@ bool convertHidlNanDataPathInitiatorRequestToLegacy( legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size(); if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: " "invalid pmk_len"; return false; } @@ -1913,13 +1973,13 @@ bool convertHidlNanDataPathInitiatorRequestToLegacy( hidl_request.securityConfig.passphrase.size(); if (legacy_request->key_info.body.passphrase_info.passphrase_len < NAN_SECURITY_MIN_PASSPHRASE_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: " "passphrase_len too small"; return false; } if (legacy_request->key_info.body.passphrase_info.passphrase_len > NAN_SECURITY_MAX_PASSPHRASE_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: " "passphrase_len too large"; return false; } @@ -1929,18 +1989,24 @@ bool convertHidlNanDataPathInitiatorRequestToLegacy( } legacy_request->service_name_len = hidl_request.serviceNameOutOfBand.size(); if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: " + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: " "service_name_len too large"; return false; } memcpy(legacy_request->service_name, hidl_request.serviceNameOutOfBand.data(), legacy_request->service_name_len); + legacy_request->scid_len = hidl_request.securityConfig.scid.size(); + if (legacy_request->scid_len > NAN_MAX_SCID_BUF_LEN) { + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequest_1_6ToLegacy: scid_len too large"; + return false; + } + memcpy(legacy_request->scid, hidl_request.securityConfig.scid.data(), legacy_request->scid_len); return true; } bool convertHidlNanDataPathIndicationResponseToLegacy( - const NanRespondToDataPathIndicationRequest& hidl_request, + const V1_0::NanRespondToDataPathIndicationRequest& hidl_request, legacy_hal::NanDataPathIndicationResponse* legacy_request) { if (!legacy_request) { LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: " @@ -2014,6 +2080,87 @@ bool convertHidlNanDataPathIndicationResponseToLegacy( return true; } +bool convertHidlNanDataPathIndicationResponse_1_6ToLegacy( + const V1_6::NanRespondToDataPathIndicationRequest& hidl_request, + legacy_hal::NanDataPathIndicationResponse* legacy_request) { + if (!legacy_request) { + LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: " + "legacy_request is null"; + return false; + } + *legacy_request = {}; + + legacy_request->rsp_code = hidl_request.acceptRequest ? legacy_hal::NAN_DP_REQUEST_ACCEPT + : legacy_hal::NAN_DP_REQUEST_REJECT; + legacy_request->ndp_instance_id = hidl_request.ndpInstanceId; + if (strnlen(hidl_request.ifaceName.c_str(), IFNAMSIZ + 1) == IFNAMSIZ + 1) { + LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: " + "ifaceName too long"; + return false; + } + strncpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); + legacy_request->ndp_cfg.security_cfg = + (hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN) + ? legacy_hal::NAN_DP_CONFIG_SECURITY + : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; + legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size(); + if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) { + LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: " + "ndp_app_info_len too large"; + return false; + } + memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(), + legacy_request->app_info.ndp_app_info_len); + legacy_request->cipher_type = (unsigned int)hidl_request.securityConfig.cipherType; + if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK; + legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size(); + if (legacy_request->key_info.body.pmk_info.pmk_len != NAN_PMK_INFO_LEN) { + LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: " + "invalid pmk_len"; + return false; + } + memcpy(legacy_request->key_info.body.pmk_info.pmk, hidl_request.securityConfig.pmk.data(), + legacy_request->key_info.body.pmk_info.pmk_len); + } + if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) { + legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE; + legacy_request->key_info.body.passphrase_info.passphrase_len = + hidl_request.securityConfig.passphrase.size(); + if (legacy_request->key_info.body.passphrase_info.passphrase_len < + NAN_SECURITY_MIN_PASSPHRASE_LEN) { + LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: " + "passphrase_len too small"; + return false; + } + if (legacy_request->key_info.body.passphrase_info.passphrase_len > + NAN_SECURITY_MAX_PASSPHRASE_LEN) { + LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: " + "passphrase_len too large"; + return false; + } + memcpy(legacy_request->key_info.body.passphrase_info.passphrase, + hidl_request.securityConfig.passphrase.data(), + legacy_request->key_info.body.passphrase_info.passphrase_len); + } + legacy_request->service_name_len = hidl_request.serviceNameOutOfBand.size(); + if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) { + LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: " + "service_name_len too large"; + return false; + } + memcpy(legacy_request->service_name, hidl_request.serviceNameOutOfBand.data(), + legacy_request->service_name_len); + legacy_request->scid_len = hidl_request.securityConfig.scid.size(); + if (legacy_request->scid_len > NAN_MAX_SCID_BUF_LEN) { + LOG(ERROR) << "convertHidlNanDataPathIndicationResponse_1_6ToLegacy: scid_len too large"; + return false; + } + memcpy(legacy_request->scid, hidl_request.securityConfig.scid.data(), legacy_request->scid_len); + + return true; +} + bool convertLegacyNanResponseHeaderToHidl(const legacy_hal::NanResponseMsg& legacy_response, WifiNanStatus* wifiNanStatus) { if (!wifiNanStatus) { @@ -2028,7 +2175,7 @@ bool convertLegacyNanResponseHeaderToHidl(const legacy_hal::NanResponseMsg& lega } bool convertLegacyNanCapabilitiesResponseToHidl(const legacy_hal::NanCapabilities& legacy_response, - V1_5::NanCapabilities* hidl_response) { + V1_6::NanCapabilities* hidl_response) { if (!hidl_response) { LOG(ERROR) << "convertLegacyNanCapabilitiesResponseToHidl: " "hidl_response is null"; @@ -2036,29 +2183,29 @@ bool convertLegacyNanCapabilitiesResponseToHidl(const legacy_hal::NanCapabilitie } *hidl_response = {}; - hidl_response->V1_0.maxConcurrentClusters = legacy_response.max_concurrent_nan_clusters; - hidl_response->V1_0.maxPublishes = legacy_response.max_publishes; - hidl_response->V1_0.maxSubscribes = legacy_response.max_subscribes; - hidl_response->V1_0.maxServiceNameLen = legacy_response.max_service_name_len; - hidl_response->V1_0.maxMatchFilterLen = legacy_response.max_match_filter_len; - hidl_response->V1_0.maxTotalMatchFilterLen = legacy_response.max_total_match_filter_len; - hidl_response->V1_0.maxServiceSpecificInfoLen = legacy_response.max_service_specific_info_len; - hidl_response->V1_0.maxExtendedServiceSpecificInfoLen = + hidl_response->maxConcurrentClusters = legacy_response.max_concurrent_nan_clusters; + hidl_response->maxPublishes = legacy_response.max_publishes; + hidl_response->maxSubscribes = legacy_response.max_subscribes; + hidl_response->maxServiceNameLen = legacy_response.max_service_name_len; + hidl_response->maxMatchFilterLen = legacy_response.max_match_filter_len; + hidl_response->maxTotalMatchFilterLen = legacy_response.max_total_match_filter_len; + hidl_response->maxServiceSpecificInfoLen = legacy_response.max_service_specific_info_len; + hidl_response->maxExtendedServiceSpecificInfoLen = legacy_response.max_sdea_service_specific_info_len; - hidl_response->V1_0.maxNdiInterfaces = legacy_response.max_ndi_interfaces; - hidl_response->V1_0.maxNdpSessions = legacy_response.max_ndp_sessions; - hidl_response->V1_0.maxAppInfoLen = legacy_response.max_app_info_len; - hidl_response->V1_0.maxQueuedTransmitFollowupMsgs = + hidl_response->maxNdiInterfaces = legacy_response.max_ndi_interfaces; + hidl_response->maxNdpSessions = legacy_response.max_ndp_sessions; + hidl_response->maxAppInfoLen = legacy_response.max_app_info_len; + hidl_response->maxQueuedTransmitFollowupMsgs = legacy_response.max_queued_transmit_followup_msgs; - hidl_response->V1_0.maxSubscribeInterfaceAddresses = legacy_response.max_subscribe_address; - hidl_response->V1_0.supportedCipherSuites = legacy_response.cipher_suites_supported; + hidl_response->maxSubscribeInterfaceAddresses = legacy_response.max_subscribe_address; + hidl_response->supportedCipherSuites = legacy_response.cipher_suites_supported; hidl_response->instantCommunicationModeSupportFlag = legacy_response.is_instant_mode_supported; return true; } bool convertLegacyNanMatchIndToHidl(const legacy_hal::NanMatchInd& legacy_ind, - NanMatchInd* hidl_ind) { + V1_6::NanMatchInd* hidl_ind) { if (!hidl_ind) { LOG(ERROR) << "convertLegacyNanMatchIndToHidl: hidl_ind is null"; return false; @@ -2080,14 +2227,14 @@ bool convertLegacyNanMatchIndToHidl(const legacy_hal::NanMatchInd& legacy_ind, hidl_ind->matchOccuredInBeaconFlag = legacy_ind.match_occured_flag == 1; hidl_ind->outOfResourceFlag = legacy_ind.out_of_resource_flag == 1; hidl_ind->rssiValue = legacy_ind.rssi_value; - hidl_ind->peerCipherType = (NanCipherSuiteType)legacy_ind.peer_cipher_type; + hidl_ind->peerCipherType = (V1_6::NanCipherSuiteType)legacy_ind.peer_cipher_type; hidl_ind->peerRequiresSecurityEnabledInNdp = legacy_ind.peer_sdea_params.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY; hidl_ind->peerRequiresRanging = legacy_ind.peer_sdea_params.ranging_state == legacy_hal::NAN_RANGING_ENABLE; - hidl_ind->rangingMeasurementInCm = legacy_ind.range_info.range_measurement_mm / 10; + hidl_ind->rangingMeasurementInMm = legacy_ind.range_info.range_measurement_mm; hidl_ind->rangingIndicationType = legacy_ind.range_info.ranging_event_type; - + hidl_ind->scid = std::vector(legacy_ind.scid, legacy_ind.scid + legacy_ind.scid_len); return true; } diff --git a/wifi/1.6/default/hidl_struct_util.h b/wifi/1.6/default/hidl_struct_util.h index 7f0266a478..26a6ebc85e 100644 --- a/wifi/1.6/default/hidl_struct_util.h +++ b/wifi/1.6/default/hidl_struct_util.h @@ -116,41 +116,40 @@ bool convertHidlNanEnableRequestToLegacy(const V1_4::NanEnableRequest& hidl_requ legacy_hal::NanEnableRequest* legacy_request); bool convertHidlNanConfigRequestToLegacy(const V1_4::NanConfigRequest& hidl_request, legacy_hal::NanConfigRequest* legacy_request); -bool convertHidlNanEnableRequest_1_4ToLegacy( +bool convertHidlNanEnableRequest_1_6ToLegacy( const V1_4::NanEnableRequest& hidl_request1, - const V1_5::NanConfigRequestSupplemental& hidl_request2, + const V1_6::NanConfigRequestSupplemental& hidl_request2, legacy_hal::NanEnableRequest* legacy_request); -bool convertHidlNanConfigRequest_1_4ToLegacy( +bool convertHidlNanConfigRequest_1_6ToLegacy( const V1_4::NanConfigRequest& hidl_request1, - const V1_5::NanConfigRequestSupplemental& hidl_request2, + const V1_6::NanConfigRequestSupplemental& hidl_request2, legacy_hal::NanConfigRequest* legacy_request); -bool convertHidlNanEnableRequest_1_5ToLegacy( - const V1_4::NanEnableRequest& hidl_request1, - const V1_5::NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanEnableRequest* legacy_request); -bool convertHidlNanConfigRequest_1_5ToLegacy( - const V1_4::NanConfigRequest& hidl_request1, - const V1_5::NanConfigRequestSupplemental& hidl_request2, - legacy_hal::NanConfigRequest* legacy_request); -bool convertHidlNanPublishRequestToLegacy(const NanPublishRequest& hidl_request, +bool convertHidlNanPublishRequestToLegacy(const V1_6::NanPublishRequest& hidl_request, legacy_hal::NanPublishRequest* legacy_request); -bool convertHidlNanSubscribeRequestToLegacy(const NanSubscribeRequest& hidl_request, +bool convertHidlNanSubscribeRequestToLegacy(const V1_0::NanSubscribeRequest& hidl_request, legacy_hal::NanSubscribeRequest* legacy_request); bool convertHidlNanTransmitFollowupRequestToLegacy( const NanTransmitFollowupRequest& hidl_request, legacy_hal::NanTransmitFollowupRequest* legacy_request); bool convertHidlNanDataPathInitiatorRequestToLegacy( - const NanInitiateDataPathRequest& hidl_request, + const V1_0::NanInitiateDataPathRequest& hidl_request, legacy_hal::NanDataPathInitiatorRequest* legacy_request); bool convertHidlNanDataPathIndicationResponseToLegacy( - const NanRespondToDataPathIndicationRequest& hidl_response, + const V1_0::NanRespondToDataPathIndicationRequest& hidl_response, legacy_hal::NanDataPathIndicationResponse* legacy_response); +bool convertHidlNanDataPathInitiatorRequest_1_6ToLegacy( + const V1_6::NanInitiateDataPathRequest& hidl_request, + legacy_hal::NanDataPathInitiatorRequest* legacy_request); +bool convertHidlNanDataPathIndicationResponse_1_6ToLegacy( + const V1_6::NanRespondToDataPathIndicationRequest& hidl_response, + legacy_hal::NanDataPathIndicationResponse* legacy_response); + bool convertLegacyNanResponseHeaderToHidl(const legacy_hal::NanResponseMsg& legacy_response, WifiNanStatus* wifiNanStatus); bool convertLegacyNanCapabilitiesResponseToHidl(const legacy_hal::NanCapabilities& legacy_response, - V1_5::NanCapabilities* hidl_response); + V1_6::NanCapabilities* hidl_response); bool convertLegacyNanMatchIndToHidl(const legacy_hal::NanMatchInd& legacy_ind, - NanMatchInd* hidl_ind); + V1_6::NanMatchInd* hidl_ind); bool convertLegacyNanFollowupIndToHidl(const legacy_hal::NanFollowupInd& legacy_ind, NanFollowupReceivedInd* hidl_ind); bool convertLegacyNanDataPathRequestIndToHidl(const legacy_hal::NanDataPathRequestInd& legacy_ind, diff --git a/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp b/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp index 13b2849209..8a5ddcd998 100644 --- a/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp +++ b/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp @@ -77,7 +77,8 @@ class MockNanIfaceEventCallback : public V1_5::IWifiNanIfaceEventCallback { MOCK_METHOD1(eventDisabled, Return(const WifiNanStatus&)); MOCK_METHOD2(eventPublishTerminated, Return(uint8_t, const WifiNanStatus&)); MOCK_METHOD2(eventSubscribeTerminated, Return(uint8_t, const WifiNanStatus&)); - MOCK_METHOD1(eventMatch, Return(const NanMatchInd&)); + MOCK_METHOD1(eventMatch, Return(const V1_0::NanMatchInd&)); + MOCK_METHOD1(eventMatch_1_6, Return(const NanMatchInd&)); MOCK_METHOD2(eventMatchExpired, Return(uint8_t, uint32_t)); MOCK_METHOD1(eventFollowupReceived, Return(const NanFollowupReceivedInd&)); MOCK_METHOD2(eventTransmitFollowup, Return(uint16_t, const WifiNanStatus&)); diff --git a/wifi/1.6/default/wifi_nan_iface.cpp b/wifi/1.6/default/wifi_nan_iface.cpp index 1add6dce5c..ac2ebc940e 100644 --- a/wifi/1.6/default/wifi_nan_iface.cpp +++ b/wifi/1.6/default/wifi_nan_iface.cpp @@ -135,14 +135,14 @@ WifiNanIface::WifiNanIface(const std::string& ifname, bool is_dedicated_iface, break; } case legacy_hal::NAN_GET_CAPABILITIES: { - V1_5::NanCapabilities hidl_struct; + V1_6::NanCapabilities hidl_struct; if (!hidl_struct_util::convertLegacyNanCapabilitiesResponseToHidl( msg.body.nan_capabilities, &hidl_struct)) { LOG(ERROR) << "Failed to convert nan capabilities response"; return; } - for (const auto& callback : shared_ptr_this->getEventCallbacks_1_5()) { - if (!callback->notifyCapabilitiesResponse_1_5(id, wifiNanStatus, hidl_struct) + for (const auto& callback : shared_ptr_this->getEventCallbacks_1_6()) { + if (!callback->notifyCapabilitiesResponse_1_6(id, wifiNanStatus, hidl_struct) .isOk()) { LOG(ERROR) << "Failed to invoke the callback"; } @@ -285,14 +285,14 @@ WifiNanIface::WifiNanIface(const std::string& ifname, bool is_dedicated_iface, LOG(ERROR) << "Callback invoked on an invalid object"; return; } - NanMatchInd hidl_struct; + V1_6::NanMatchInd hidl_struct; if (!hidl_struct_util::convertLegacyNanMatchIndToHidl(msg, &hidl_struct)) { LOG(ERROR) << "Failed to convert nan capabilities response"; return; } - for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->eventMatch(hidl_struct).isOk()) { + for (const auto& callback : shared_ptr_this->getEventCallbacks_1_6()) { + if (!callback->eventMatch_1_6(hidl_struct).isOk()) { LOG(ERROR) << "Failed to invoke the callback"; } } @@ -554,7 +554,7 @@ Return WifiNanIface::disableRequest(uint16_t cmd_id, disableRequest_cb hid &WifiNanIface::disableRequestInternal, hidl_status_cb, cmd_id); } -Return WifiNanIface::startPublishRequest(uint16_t cmd_id, const NanPublishRequest& msg, +Return WifiNanIface::startPublishRequest(uint16_t cmd_id, const V1_0::NanPublishRequest& msg, startPublishRequest_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, &WifiNanIface::startPublishRequestInternal, hidl_status_cb, cmd_id, msg); @@ -567,7 +567,8 @@ Return WifiNanIface::stopPublishRequest(uint16_t cmd_id, uint8_t sessionId sessionId); } -Return WifiNanIface::startSubscribeRequest(uint16_t cmd_id, const NanSubscribeRequest& msg, +Return WifiNanIface::startSubscribeRequest(uint16_t cmd_id, + const V1_0::NanSubscribeRequest& msg, startSubscribeRequest_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, &WifiNanIface::startSubscribeRequestInternal, hidl_status_cb, cmd_id, @@ -606,7 +607,7 @@ Return WifiNanIface::deleteDataInterfaceRequest( } Return WifiNanIface::initiateDataPathRequest(uint16_t cmd_id, - const NanInitiateDataPathRequest& msg, + const V1_0::NanInitiateDataPathRequest& msg, initiateDataPathRequest_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, &WifiNanIface::initiateDataPathRequestInternal, hidl_status_cb, cmd_id, @@ -614,7 +615,7 @@ Return WifiNanIface::initiateDataPathRequest(uint16_t cmd_id, } Return WifiNanIface::respondToDataPathIndicationRequest( - uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg, + uint16_t cmd_id, const V1_0::NanRespondToDataPathIndicationRequest& msg, respondToDataPathIndicationRequest_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, &WifiNanIface::respondToDataPathIndicationRequestInternal, @@ -699,6 +700,46 @@ Return WifiNanIface::getCapabilitiesRequest_1_5( cmd_id); } +Return WifiNanIface::enableRequest_1_6(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, + const V1_6::NanConfigRequestSupplemental& msg2, + enableRequest_1_5_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::enableRequest_1_6Internal, hidl_status_cb, cmd_id, msg1, + msg2); +} + +Return WifiNanIface::configRequest_1_6(uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, + const V1_6::NanConfigRequestSupplemental& msg2, + configRequest_1_5_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::configRequest_1_6Internal, hidl_status_cb, cmd_id, msg1, + msg2); +} + +Return WifiNanIface::initiateDataPathRequest_1_6(uint16_t cmd_id, + const V1_6::NanInitiateDataPathRequest& msg, + initiateDataPathRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::initiateDataPathRequest_1_6Internal, hidl_status_cb, + cmd_id, msg); +} + +Return WifiNanIface::respondToDataPathIndicationRequest_1_6( + uint16_t cmd_id, const V1_6::NanRespondToDataPathIndicationRequest& msg, + respondToDataPathIndicationRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::respondToDataPathIndicationRequest_1_6Internal, + hidl_status_cb, cmd_id, msg); +} + +Return WifiNanIface::startPublishRequest_1_6(uint16_t cmd_id, + const V1_6::NanPublishRequest& msg, + startPublishRequest_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::startPublishRequest_1_6Internal, hidl_status_cb, cmd_id, + msg); +} + std::pair WifiNanIface::getNameInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_}; } @@ -742,15 +783,9 @@ WifiStatus WifiNanIface::disableRequestInternal(uint16_t cmd_id) { return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiNanIface::startPublishRequestInternal(uint16_t cmd_id, - const NanPublishRequest& msg) { - legacy_hal::NanPublishRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanPublishRequestToLegacy(msg, &legacy_msg)) { - return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); - } - legacy_hal::wifi_error legacy_status = - legacy_hal_.lock()->nanPublishRequest(ifname_, cmd_id, legacy_msg); - return createWifiStatusFromLegacyError(legacy_status); +WifiStatus WifiNanIface::startPublishRequestInternal(uint16_t /* cmd_id */, + const V1_0::NanPublishRequest& /* msg */) { + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); } WifiStatus WifiNanIface::stopPublishRequestInternal(uint16_t cmd_id, uint8_t sessionId) { @@ -762,7 +797,7 @@ WifiStatus WifiNanIface::stopPublishRequestInternal(uint16_t cmd_id, uint8_t ses } WifiStatus WifiNanIface::startSubscribeRequestInternal(uint16_t cmd_id, - const NanSubscribeRequest& msg) { + const V1_0::NanSubscribeRequest& msg) { legacy_hal::NanSubscribeRequest legacy_msg; if (!hidl_struct_util::convertHidlNanSubscribeRequestToLegacy(msg, &legacy_msg)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); @@ -803,8 +838,8 @@ WifiStatus WifiNanIface::deleteDataInterfaceRequestInternal(uint16_t cmd_id, legacy_hal_.lock()->nanDataInterfaceDelete(ifname_, cmd_id, iface_name); return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiNanIface::initiateDataPathRequestInternal(uint16_t cmd_id, - const NanInitiateDataPathRequest& msg) { +WifiStatus WifiNanIface::initiateDataPathRequestInternal( + uint16_t cmd_id, const V1_0::NanInitiateDataPathRequest& msg) { legacy_hal::NanDataPathInitiatorRequest legacy_msg; if (!hidl_struct_util::convertHidlNanDataPathInitiatorRequestToLegacy(msg, &legacy_msg)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); @@ -814,7 +849,7 @@ WifiStatus WifiNanIface::initiateDataPathRequestInternal(uint16_t cmd_id, return createWifiStatusFromLegacyError(legacy_status); } WifiStatus WifiNanIface::respondToDataPathIndicationRequestInternal( - uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg) { + uint16_t cmd_id, const V1_0::NanRespondToDataPathIndicationRequest& msg) { legacy_hal::NanDataPathIndicationResponse legacy_msg; if (!hidl_struct_util::convertHidlNanDataPathIndicationResponseToLegacy(msg, &legacy_msg)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); @@ -886,11 +921,23 @@ WifiStatus WifiNanIface::getCapabilitiesRequest_1_5Internal(uint16_t cmd_id) { return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiNanIface::enableRequest_1_5Internal(uint16_t cmd_id, +WifiStatus WifiNanIface::enableRequest_1_5Internal( + uint16_t /* cmd_id */, const V1_4::NanEnableRequest& /* msg1 */, + const V1_5::NanConfigRequestSupplemental& /* msg2 */) { + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); +} + +WifiStatus WifiNanIface::configRequest_1_5Internal( + uint16_t /* cmd_id */, const V1_4::NanConfigRequest& /* msg1 */, + const V1_5::NanConfigRequestSupplemental& /* msg2 */) { + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED); +} + +WifiStatus WifiNanIface::enableRequest_1_6Internal(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, - const V1_5::NanConfigRequestSupplemental& msg2) { + const V1_6::NanConfigRequestSupplemental& msg2) { legacy_hal::NanEnableRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanEnableRequest_1_5ToLegacy(msg1, msg2, &legacy_msg)) { + if (!hidl_struct_util::convertHidlNanEnableRequest_1_6ToLegacy(msg1, msg2, &legacy_msg)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); } legacy_hal::wifi_error legacy_status = @@ -898,11 +945,11 @@ WifiStatus WifiNanIface::enableRequest_1_5Internal(uint16_t cmd_id, return createWifiStatusFromLegacyError(legacy_status); } -WifiStatus WifiNanIface::configRequest_1_5Internal(uint16_t cmd_id, +WifiStatus WifiNanIface::configRequest_1_6Internal(uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, - const V1_5::NanConfigRequestSupplemental& msg2) { + const V1_6::NanConfigRequestSupplemental& msg2) { legacy_hal::NanConfigRequest legacy_msg; - if (!hidl_struct_util::convertHidlNanConfigRequest_1_5ToLegacy(msg1, msg2, &legacy_msg)) { + if (!hidl_struct_util::convertHidlNanConfigRequest_1_6ToLegacy(msg1, msg2, &legacy_msg)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); } legacy_hal::wifi_error legacy_status = @@ -910,6 +957,39 @@ WifiStatus WifiNanIface::configRequest_1_5Internal(uint16_t cmd_id, return createWifiStatusFromLegacyError(legacy_status); } +WifiStatus WifiNanIface::initiateDataPathRequest_1_6Internal( + uint16_t cmd_id, const V1_6::NanInitiateDataPathRequest& msg) { + legacy_hal::NanDataPathInitiatorRequest legacy_msg; + if (!hidl_struct_util::convertHidlNanDataPathInitiatorRequest_1_6ToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanDataRequestInitiator(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +WifiStatus WifiNanIface::respondToDataPathIndicationRequest_1_6Internal( + uint16_t cmd_id, const V1_6::NanRespondToDataPathIndicationRequest& msg) { + legacy_hal::NanDataPathIndicationResponse legacy_msg; + if (!hidl_struct_util::convertHidlNanDataPathIndicationResponse_1_6ToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanDataIndicationResponse(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + +WifiStatus WifiNanIface::startPublishRequest_1_6Internal(uint16_t cmd_id, + const V1_6::NanPublishRequest& msg) { + legacy_hal::NanPublishRequest legacy_msg; + if (!hidl_struct_util::convertHidlNanPublishRequestToLegacy(msg, &legacy_msg)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->nanPublishRequest(ifname_, cmd_id, legacy_msg); + return createWifiStatusFromLegacyError(legacy_status); +} + WifiStatus WifiNanIface::registerEventCallback_1_6Internal( const sp& callback) { sp callback_1_0 = callback; diff --git a/wifi/1.6/default/wifi_nan_iface.h b/wifi/1.6/default/wifi_nan_iface.h index b732ef1371..15bf57298c 100644 --- a/wifi/1.6/default/wifi_nan_iface.h +++ b/wifi/1.6/default/wifi_nan_iface.h @@ -32,6 +32,8 @@ namespace V1_6 { namespace implementation { using namespace android::hardware::wifi::V1_0; using namespace android::hardware::wifi::V1_2; +using namespace android::hardware::wifi::V1_4; +using namespace android::hardware::wifi::V1_6; /** * HIDL interface object used to control a NAN Iface instance. @@ -58,11 +60,11 @@ class WifiNanIface : public V1_6::IWifiNanIface { Return configRequest(uint16_t cmd_id, const V1_0::NanConfigRequest& msg, configRequest_cb hidl_status_cb) override; Return disableRequest(uint16_t cmd_id, disableRequest_cb hidl_status_cb) override; - Return startPublishRequest(uint16_t cmd_id, const NanPublishRequest& msg, + Return startPublishRequest(uint16_t cmd_id, const V1_0::NanPublishRequest& msg, startPublishRequest_cb hidl_status_cb) override; Return stopPublishRequest(uint16_t cmd_id, uint8_t sessionId, stopPublishRequest_cb hidl_status_cb) override; - Return startSubscribeRequest(uint16_t cmd_id, const NanSubscribeRequest& msg, + Return startSubscribeRequest(uint16_t cmd_id, const V1_0::NanSubscribeRequest& msg, startSubscribeRequest_cb hidl_status_cb) override; Return stopSubscribeRequest(uint16_t cmd_id, uint8_t sessionId, stopSubscribeRequest_cb hidl_status_cb) override; @@ -72,10 +74,11 @@ class WifiNanIface : public V1_6::IWifiNanIface { createDataInterfaceRequest_cb hidl_status_cb) override; Return deleteDataInterfaceRequest(uint16_t cmd_id, const hidl_string& iface_name, deleteDataInterfaceRequest_cb hidl_status_cb) override; - Return initiateDataPathRequest(uint16_t cmd_id, const NanInitiateDataPathRequest& msg, + Return initiateDataPathRequest(uint16_t cmd_id, + const V1_0::NanInitiateDataPathRequest& msg, initiateDataPathRequest_cb hidl_status_cb) override; Return respondToDataPathIndicationRequest( - uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg, + uint16_t cmd_id, const V1_0::NanRespondToDataPathIndicationRequest& msg, respondToDataPathIndicationRequest_cb hidl_status_cb) override; Return terminateDataPathRequest(uint16_t cmd_id, uint32_t ndpInstanceId, terminateDataPathRequest_cb hidl_status_cb) override; @@ -98,14 +101,28 @@ class WifiNanIface : public V1_6::IWifiNanIface { registerEventCallback_1_5_cb hidl_status_cb) override; Return enableRequest_1_5(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, const V1_5::NanConfigRequestSupplemental& msg2, - enableRequest_1_4_cb hidl_status_cb) override; + enableRequest_1_5_cb hidl_status_cb) override; Return configRequest_1_5(uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, const V1_5::NanConfigRequestSupplemental& msg2, - configRequest_1_4_cb hidl_status_cb) override; + configRequest_1_5_cb hidl_status_cb) override; Return getCapabilitiesRequest_1_5(uint16_t cmd_id, getCapabilitiesRequest_cb hidl_status_cb) override; Return registerEventCallback_1_6(const sp& callback, registerEventCallback_1_6_cb hidl_status_cb) override; + Return initiateDataPathRequest_1_6( + uint16_t cmd_id, const V1_6::NanInitiateDataPathRequest& msg, + initiateDataPathRequest_1_6_cb hidl_status_cb) override; + Return respondToDataPathIndicationRequest_1_6( + uint16_t cmd_id, const V1_6::NanRespondToDataPathIndicationRequest& msg, + respondToDataPathIndicationRequest_1_6_cb hidl_status_cb) override; + Return enableRequest_1_6(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, + const V1_6::NanConfigRequestSupplemental& msg2, + enableRequest_1_6_cb hidl_status_cb) override; + Return configRequest_1_6(uint16_t cmd_id, const V1_4::NanConfigRequest& msg1, + const V1_6::NanConfigRequestSupplemental& msg2, + configRequest_1_6_cb hidl_status_cb) override; + Return startPublishRequest_1_6(uint16_t cmd_id, const V1_6::NanPublishRequest& msg, + startPublishRequest_cb hidl_status_cb) override; private: // Corresponding worker functions for the HIDL methods. @@ -116,18 +133,18 @@ class WifiNanIface : public V1_6::IWifiNanIface { WifiStatus enableRequestInternal(uint16_t cmd_id, const V1_0::NanEnableRequest& msg); WifiStatus configRequestInternal(uint16_t cmd_id, const V1_0::NanConfigRequest& msg); WifiStatus disableRequestInternal(uint16_t cmd_id); - WifiStatus startPublishRequestInternal(uint16_t cmd_id, const NanPublishRequest& msg); + WifiStatus startPublishRequestInternal(uint16_t cmd_id, const V1_0::NanPublishRequest& msg); WifiStatus stopPublishRequestInternal(uint16_t cmd_id, uint8_t sessionId); - WifiStatus startSubscribeRequestInternal(uint16_t cmd_id, const NanSubscribeRequest& msg); + WifiStatus startSubscribeRequestInternal(uint16_t cmd_id, const V1_0::NanSubscribeRequest& msg); WifiStatus stopSubscribeRequestInternal(uint16_t cmd_id, uint8_t sessionId); WifiStatus transmitFollowupRequestInternal(uint16_t cmd_id, const NanTransmitFollowupRequest& msg); WifiStatus createDataInterfaceRequestInternal(uint16_t cmd_id, const std::string& iface_name); WifiStatus deleteDataInterfaceRequestInternal(uint16_t cmd_id, const std::string& iface_name); WifiStatus initiateDataPathRequestInternal(uint16_t cmd_id, - const NanInitiateDataPathRequest& msg); + const V1_0::NanInitiateDataPathRequest& msg); WifiStatus respondToDataPathIndicationRequestInternal( - uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg); + uint16_t cmd_id, const V1_0::NanRespondToDataPathIndicationRequest& msg); WifiStatus terminateDataPathRequestInternal(uint16_t cmd_id, uint32_t ndpInstanceId); WifiStatus registerEventCallback_1_2Internal( @@ -150,6 +167,16 @@ class WifiNanIface : public V1_6::IWifiNanIface { WifiStatus registerEventCallback_1_6Internal( const sp& callback); + WifiStatus enableRequest_1_6Internal(uint16_t cmd_id, const V1_4::NanEnableRequest& msg1, + const V1_6::NanConfigRequestSupplemental& msg2); + WifiStatus configRequest_1_6Internal(uint16_t cmd_id, const V1_4::NanConfigRequest& msg, + const V1_6::NanConfigRequestSupplemental& msg2); + WifiStatus startPublishRequest_1_6Internal(uint16_t cmd_id, const V1_6::NanPublishRequest& msg); + WifiStatus initiateDataPathRequest_1_6Internal(uint16_t cmd_id, + const V1_6::NanInitiateDataPathRequest& msg); + WifiStatus respondToDataPathIndicationRequest_1_6Internal( + uint16_t cmd_id, const V1_6::NanRespondToDataPathIndicationRequest& msg); + // all 1_0 and descendant callbacks std::set> getEventCallbacks(); // all 1_2 and descendant callbacks diff --git a/wifi/1.6/types.hal b/wifi/1.6/types.hal index f1d9d458ee..2a49d0888b 100644 --- a/wifi/1.6/types.hal +++ b/wifi/1.6/types.hal @@ -17,7 +17,18 @@ package android.hardware.wifi@1.6; import @1.0::MacAddress; +import @1.0::NanCipherSuiteType; +import @1.0::NanDataPathChannelCfg; import @1.0::NanDataPathConfirmInd; +import @1.0::NanDataPathSecurityConfig; +import @1.0::NanDataPathSecurityType; +import @1.0::NanDiscoveryCommonConfig; +import @1.0::NanInitiateDataPathRequest; +import @1.0::NanMatchAlg; +import @1.0::NanRangingIndication; +import @1.0::NanRespondToDataPathIndicationRequest; +import @1.0::NanPublishType; +import @1.0::NanTxType; import @1.0::Rssi; import @1.0::RttBw; import @1.0::RttPeerType; @@ -34,6 +45,7 @@ import @1.0::WifiInformationElement; import @1.0::WifiRateNss; import @1.4::RttPreamble; import @1.4::WifiRatePreamble; +import @1.5::NanConfigRequestSupplemental; import @1.5::StaLinkLayerIfaceContentionTimeStats; import @1.5::WifiIfaceMode; @@ -78,22 +90,25 @@ enum WifiRatePreamble : @1.4::WifiRatePreamble { * Channel information. */ struct WifiChannelInfo { - /** - * Channel width (20, 40, 80, 80+80, 160, 320). - */ - WifiChannelWidthInMhz width; - /** - * Primary 20 MHz channel. - */ - WifiChannelInMhz centerFreq; - /** - * Center frequency (MHz) first segment. - */ - WifiChannelInMhz centerFreq0; - /** - * Center frequency (MHz) second segment. - */ - WifiChannelInMhz centerFreq1; + /** + * Channel width (20, 40, 80, 80+80, 160, 320). + */ + WifiChannelWidthInMhz width; + + /** + * Primary 20 MHz channel. + */ + WifiChannelInMhz centerFreq; + + /** + * Center frequency (MHz) first segment. + */ + WifiChannelInMhz centerFreq0; + + /** + * Center frequency (MHz) second segment. + */ + WifiChannelInMhz centerFreq1; }; /** @@ -211,14 +226,16 @@ struct RttResponder { }; struct WifiChannelStats { - /** - * Channel information. - */ + /** + * Channel information. + */ WifiChannelInfo channel; + /** * Total time for which the radio is awake on this channel. */ uint32_t onTimeInMs; + /** * Total time for which CCA is held busy on this channel. */ @@ -280,12 +297,14 @@ struct StaPeerInfo { * Station count: The total number of stations currently associated with the peer. */ uint16_t staCount; + /** * Channel utilization: The percentage of time (normalized to 255, i.e., x% corresponds to * (int) x * 255 / 100) that the medium is sensed as busy measured by either physical or * virtual carrier sense (CS) mechanism. */ uint16_t chanUtil; + /** * Per rate statistics */ @@ -386,23 +405,27 @@ struct WifiRateInfo { * Per rate statistics. The rate is characterized by the combination of preamble, number of spatial * streams, transmission bandwidth, and modulation and coding scheme (MCS). */ -struct StaRateStat{ +struct StaRateStat { /** * Wifi rate information: preamble, number of spatial streams, bandwidth, MCS, etc. */ WifiRateInfo rateInfo; + /** * Number of successfully transmitted data packets (ACK received) */ uint32_t txMpdu; + /** * Number of received data packets */ uint32_t rxMpdu; + /** * Number of data packet losses (no ACK) */ uint32_t mpduLost; + /** * Number of data packet retries */ @@ -551,10 +574,12 @@ struct NanDataPathChannelInfo { * Channel frequency in MHz. */ WifiChannelInMhz channelFreq; + /** * Channel bandwidth in MHz. */ WifiChannelWidthInMhz channelBandwidth; + /** * Number of spatial streams used in the channel. */ @@ -571,6 +596,7 @@ struct NanDataPathConfirmInd { * Baseline information as defined in HAL 1.0. */ @1.0::NanDataPathConfirmInd V1_0; + /** * The channel(s) on which the NDP is scheduled to operate. * Updates to the operational channels are provided using the |eventDataPathScheduleUpdate| @@ -591,10 +617,12 @@ struct NanDataPathScheduleUpdateInd { * The discovery address (NMI) of the peer to which the NDP is connected. */ MacAddress peerDiscoveryAddress; + /** * The updated channel(s) information. */ vec channelInfo; + /** * The list of NDPs to which this update applies. */ @@ -668,3 +696,569 @@ struct RttCapabilities { */ uint8_t mcVersion; }; + +/** + * Cipher suite flags. + */ +enum NanCipherSuiteType : @1.0::NanCipherSuiteType { + /** + * NCS-PK-128 + */ + PUBLIC_KEY_128_MASK = 1 << 2, + /** + * NCS-PK-256 + */ + PUBLIC_KEY_256_MASK = 1 << 3, +}; + +/** + * NAN configuration request parameters added in the 1.2 HAL. These are supplemental to previous + * versions. + */ +struct NanConfigRequestSupplemental { + /** + * Baseline information as defined in HAL 1.5. + */ + @1.5::NanConfigRequestSupplemental V1_5; + + /** + * Controls NAN instant communication mode operate on which channel + */ + uint32_t instantModeChannel; +}; + +/** + * Configuration of NAN data-path security. + */ +struct NanDataPathSecurityConfig { + /** + * Security configuration of the data-path (NDP). Security is enabled if not equal to + * |NanDataPathSecurityType.OPEN|. + * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Security Required + */ + NanDataPathSecurityType securityType; + + /** + * Cipher type for data-paths. If |securityType| is |NanDataPathSecurityType.OPEN| then must + * be set to |NanCipherSuiteType.NONE|, otherwise a non-|NanCipherSuiteType.NONE| cipher suite + * must be specified. + */ + NanCipherSuiteType cipherType; + + /** + * Optional Pairwise Master Key (PMK). Must be specified (and is only used) if |securityType| is + * set to |NanDataPathSecurityType.PMK|. + * Ref: IEEE 802.11i + */ + uint8_t[32] pmk; + + /** + * Optional Passphrase. Must be specified (and is only used) if |securityType| is set to + * |NanDataPathSecurityType.PASSPHRASE|. + * Min length: |MIN_PASSPHRASE_LENGTH| + * Max length: |MAX_PASSPHRASE_LENGTH| + * NAN Spec: Appendix: Mapping passphrase to PMK for NCS-SK Cipher Suites + */ + vec passphrase; + + /** + * Security Context Identifier attribute contains PMKID shall be included in NDP setup and + * response messages. Security Context Identifier, Identifies the Security Context. When + * security is enabled This field contains the 16 octet PMKID identifying the PMK used for + * setting up the Secure Data Path. + */ + uint8_t[16] scid; +}; + +/** + * Response to a data-path request from a peer. + */ +struct NanRespondToDataPathIndicationRequest { + /** + * Accept (true) or reject (false) the request. + * NAN Spec: Data Path Attributes / NDP Attribute / Type and Status + */ + bool acceptRequest; + + /** + * ID of the data-path (NDP) for which we're responding - obtained as part of the request in + * |IWifiNanIfaceEventCallback.eventDataPathRequest|. + */ + uint32_t ndpInstanceId; + + /** + * NAN data interface name on which this data-path session is to be started. + * This must be an interface created using |IWifiNanIface.createDataInterfaceRequest|. + */ + string ifaceName; + + /** + * Security configuration of the requested data-path. + */ + NanDataPathSecurityConfig securityConfig; + + /** + * Arbitrary information communicated to the peer as part of the data-path setup process - there + * is no semantic meaning to these bytes. They are passed-through from sender to receiver as-is + * with no parsing. + * Max length: |NanCapabilities.maxAppInfoLen|. + * NAN Spec: Data Path Attributes / NDP Attribute / NDP Specific Info + */ + vec appInfo; + + /** + * A service name to be used with |passphrase| to construct a Pairwise Master Key (PMK) for the + * data-path. Only relevant when a data-path is requested which is not associated with a NAN + * discovery session - e.g. using out-of-band discovery. + * Constraints: same as |NanDiscoveryCommonConfig.serviceName| + * NAN Spec: Appendix: Mapping pass-phrase to PMK for NCS-SK Cipher Suites + */ + vec serviceNameOutOfBand; +}; + +/** + * Data Path Initiator requesting a data-path. + */ +struct NanInitiateDataPathRequest { + /** + * ID of the peer. Obtained as part of an earlier |IWifiNanIfaceEventCallback.eventMatch| or + * |IWifiNanIfaceEventCallback.eventFollowupReceived|. + */ + uint32_t peerId; + + /** + * NAN management interface MAC address of the peer. Obtained as part of an earlier + * |IWifiNanIfaceEventCallback.eventMatch| or |IWifiNanIfaceEventCallback.eventFollowupReceived|. + */ + MacAddress peerDiscMacAddr; + + /** + * Config flag for channel request. + */ + NanDataPathChannelCfg channelRequestType; + + /** + * Channel frequency in MHz to start data-path. Not relevant if |channelRequestType| is + * |NanDataPathChannelCfg.CHANNEL_NOT_REQUESTED|. + */ + WifiChannelInMhz channel; + + /** + * NAN data interface name on which this data-path session is to be initiated. + * This must be an interface created using |IWifiNanIface.createDataInterfaceRequest|. + */ + string ifaceName; + + /** + * Security configuration of the requested data-path. + */ + NanDataPathSecurityConfig securityConfig; + + /** + * Arbitrary information communicated to the peer as part of the data-path setup process - there + * is no semantic meaning to these bytes. They are passed-through from sender to receiver as-is + * with no parsing. + * Max length: |NanCapabilities.maxAppInfoLen|. + * NAN Spec: Data Path Attributes / NDP Attribute / NDP Specific Info + */ + vec appInfo; + + /** + * A service name to be used with |passphrase| to construct a Pairwise Master Key (PMK) for the + * data-path. Only relevant when a data-path is requested which is not associated with a NAN + * discovery session - e.g. using out-of-band discovery. + * Constraints: same as |NanDiscoveryCommonConfig.serviceName| + * NAN Spec: Appendix: Mapping pass-phrase to PMK for NCS-SK Cipher Suites + */ + vec serviceNameOutOfBand; +}; + +/** + * Configurations of NAN discovery sessions: common to publish and subscribe discovery. + */ +struct NanDiscoveryCommonConfig { + /** + * The ID of the discovery session being configured. A value of 0 specifies a request to create + * a new discovery session. The new discovery session ID is returned with + * |IWifiNanIfaceEventCallback.notifyStartPublishResponse| or + * |IWifiNanIfaceEventCallback.notifyStartSubscribeResponse|. + * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID + */ + uint8_t sessionId; + + /** + * The lifetime of the discovery session in seconds. A value of 0 means run forever or until + * canceled using |IWifiIface.stopPublishRequest| or |IWifiIface.stopSubscribeRequest|. + */ + uint16_t ttlSec; + + /** + * 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. A value of 0 will default to 1. Does not override + * |NanBandSpecificConfig.discoveryWindowIntervalVal| configurations if those are specified. + */ + uint16_t discoveryWindowPeriod; + + /** + * The lifetime of the discovery session in number of transmitted SDF discovery packets. A value + * of 0 means forever or until canceled using |IWifiIface.stopPublishRequest| or + * |IWifiIface.stopSubscribeRequest|. + */ + uint8_t discoveryCount; + + /** + * UTF-8 encoded string identifying the service. + * Max length: |NanCapabilities.maxServiceNameLen|. + * NAN Spec: The only acceptable single-byte UTF-8 symbols for a Service Name are alphanumeric + * values (A-Z, a-z, 0-9), the hyphen ('-'), and the period ('.'). All valid multi-byte UTF-8 + * characters are acceptable in a Service Name. + */ + vec serviceName; + + /** + * Specifies how often to trigger |IWifiNanIfaceEventCallback.eventMatch| when continuously + * discovering the same discovery session (with no changes). + */ + NanMatchAlg discoveryMatchIndicator; + + /** + * 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.maxServiceSpecificInfoLen|. + * NAN Spec: Service Descriptor Attribute (SDA) / Service Info + */ + vec serviceSpecificInfo; + + /** + * 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 + */ + vec extendedServiceSpecificInfo; + + /** + * Ordered sequence of pairs (|length| uses 1 byte and contains the number of + * bytes in the |value| field) which specify further match criteria (beyond the service name). + * The match behavior is specified in details in the NAN spec. + * Publisher: used in SOLICITED or SOLICITED_UNSOLICITED sessions. + * Subscriber: used in ACTIVE or PASSIVE sessions. + * Max length: |NanCapabilities.maxMatchFilterLen|. + * NAN Spec: matching_filter_rx + */ + vec rxMatchFilter; + + /** + * Ordered sequence of pairs (|length| uses 1 byte and contains the number of + * bytes in the |value| field) which specify further match criteria (beyond the service name). + * The match behavior is specified in details in the NAN spec. + * Publisher: used if provided. + * Subscriber: used (if provided) only in ACTIVE sessions. + * Max length: |NanCapabilities.maxMatchFilterLen|. + * NAN Spec: matching_filter_tx and Service Descriptor Attribute (SDA) / Matching Filter + */ + vec txMatchFilter; + + /** + * Specifies whether or not the discovery session uses the + * |NanBandSpecificConfig.rssiCloseProximity| value (configured in enable/configure requests) to + * filter out matched discovered peers. + * NAN Spec: Service Descriptor Attribute / Service Control / Discovery Range Limited. + */ + bool useRssiThreshold; + + /** + * Controls whether or not the |IWifiNanIfaceEventCallback.eventPublishTerminated| (for publish + * discovery sessions) or |IWifiNanIfaceEventCallback.eventSubscribeTerminated| (for subscribe + * discovery sessions) will be delivered. + */ + bool disableDiscoveryTerminationIndication; + + /** + * Controls whether or not the |IWifiNanIfaceEventCallback.eventMatchExpired| will be delivered. + */ + bool disableMatchExpirationIndication; + + /** + * Controls whether or not the |IWifiNanIfaceEventCallback.eventFollowupReceived| will be + * delivered. + */ + bool disableFollowupReceivedIndication; + + /** + * Security configuration of data-paths created in the context of this discovery session. Security + * parameters can be overridden during the actual construction of the data-path - allowing + * individual data-paths to have unique PMKs or Passphrases. + */ + NanDataPathSecurityConfig securityConfig; + + /** + * Specifies whether or not there is a ranging requirement in this discovery session. + * Ranging is only performed if all other match criteria with the peer are met. Ranging must + * be performed if both peers in the discovery session (publisher and subscriber) set this + * flag to true. Otherwise, if either peer sets this flag to false, ranging must not be performed + * and must not impact discovery decisions. + * Note: specifying that ranging is required also implies that this device must automatically + * accept ranging requests from peers. + * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Ranging Require. + */ + bool rangingRequired; + + /** + * Interval in msec between two ranging measurements. Only relevant if |rangingRequired| is true. + * If the Awake DW interval specified either in |discoveryWindowPeriod| or in + * |NanBandSpecificConfig.discoveryWindowIntervalVal| is larger than the ranging interval then + * priority is given to Awake DW interval. + */ + uint32_t rangingIntervalMsec; + + /** + * The type of ranging feedback to be provided by discovery session matches + * |IWifiNanIfaceEventCallback.eventMatch|. Only relevant if |rangingRequired| is true. + */ + bitfield configRangingIndications; + + /** + * The ingress and egress distance in cm. If ranging is enabled (|rangingEnabled| is true) then + * |configRangingIndications| is used to determine whether ingress and/or egress (or neither) + * are used to determine whether a match has occurred. + * NAN Spec: Service Discovery Extension Attribute (SDEA) / Ingress & Egress Range Limit + */ + uint16_t distanceIngressCm; + + uint16_t distanceEgressCm; +}; + +/** + * Publish request: specifies a publish discovery operation. + */ +struct NanPublishRequest { + /** + * Common configuration of discovery sessions. + */ + NanDiscoveryCommonConfig baseConfigs; + + /** + * The type of the publish discovery session. + */ + NanPublishType publishType; + + /** + * For publishType of |NanPublishType.SOLICITED| or |NanPublishType.UNSOLICITED_SOLICITED| + * specifies the type of transmission used for responding to the probing subscribe discovery + * peer. + */ + NanTxType txType; + + /** + * Specifies whether data-path requests |IWifiNanIfaceEventCallback.eventDataPathRequest| (in + * the context of this discovery session) are automatically accepted (if true) - in which case + * the Responder must not call the |IWifiNanIface.respondToDataPathIndicationRequest| method and + * the device must automatically accept the data-path request and complete the negotiation. + */ + bool autoAcceptDataPathRequests; +}; + +/** + * Match indication structure + */ +struct NanMatchInd { + /** + * Publish or subscribe discovery session ID of an existing discovery session. + * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID + */ + uint8_t discoverySessionId; + + /** + * A unique ID of the peer. Can be subsequently used in |IWifiNanIface.transmitFollowupRequest| or + * to set up a data-path. + */ + uint32_t peerId; + + /** + * The NAN Discovery (management) MAC address of the peer. + */ + MacAddress addr; + + /** + * The arbitrary information contained in the |NanDiscoveryCommonConfig.serviceSpecificInfo| of + * the peer's discovery session configuration. + * Max length: |NanCapabilities.maxServiceSpecificInfoLen|. + * NAN Spec: Service Descriptor Attribute (SDA) / Service Info + */ + vec serviceSpecificInfo; + + /** + * 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 + */ + vec extendedServiceSpecificInfo; + + /** + * The match filter from the discovery packet (publish or subscribe) which caused service + * discovery. Matches the |NanDiscoveryCommonConfig.txMatchFilter| of the peer's Unsolicited + * publish message or of the local device's Active subscribe message. + * Max length: |NanCapabilities.maxMatchFilterLen|. + * NAN Spec: Service Descriptor Attribute (SDA) / Matching Filter + */ + vec matchFilter; + + /** + * Indicates the type of discovery: true if match occurred on a Beacon frame, false if the match + * occurred on a Service Discovery Frames (SDF). + */ + bool matchOccuredInBeaconFlag; + + /** + * Flag to indicate firmware is out of resource and that it can no longer track this Service Name. + * Indicates that while |IWifiNanIfaceEventCallback.eventMatch| will be received, the + * |NanDiscoveryCommonConfig.discoveryMatchIndicator| configuration will not be honored. + */ + bool outOfResourceFlag; + + /** + * If RSSI filtering was enabled using |NanDiscoveryCommonConfig.useRssiThreshold| in discovery + * session setup then this field contains the received RSSI value. It will contain 0 if RSSI + * filtering was not enabled. + * RSSI values are returned without sign, e.g. -70dBm will be returned as 70. + */ + uint8_t rssiValue; + + /** + * Cipher type for data-paths constructed in the context of this discovery session. Valid if + * |peerRequiresSecurityEnabledInNdp| is true. + */ + NanCipherSuiteType peerCipherType; + + /** + * Indicates whether or not the peer requires security enabled in any data-path (NDP) constructed + * in the context of this discovery session. The |cipherType| specifies the cipher type for such + * data-paths. + * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Security Required + */ + bool peerRequiresSecurityEnabledInNdp; + + /** + * Indicates whether or not the peer requires (and hence allows) ranging in the context of this + * discovery session. + * Note that ranging is only performed if all other match criteria with the peer are met. + * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Ranging Require. + */ + bool peerRequiresRanging; + + /** + * Ranging indication supersedes the NanMatchAlg specification. + * Ex: If NanMatchAlg is MATCH_ONCE, but ranging indications is continuous then continuous + * match notifications will be received (with ranging information). + * Ranging indication data is provided if Ranging required is enabled in the discovery + * specification and: + * 1) continuous ranging specified. + * 2) ingress/egress specified and: + * - notify once for ingress >= ingress_distance and egress <= egress_distance, + * - same for ingress_egress_both + * If the Awake DW intervals are larger than the ranging intervals then priority is given to the + * device DW intervals. + * + * If ranging was required and executed contains the distance to the peer in MM. The + * |rangingIndicationType| field specifies the event which triggered ranging. + */ + uint32_t rangingMeasurementInMm; + + /** + * The ranging event(s) which triggered the ranging. E.g. can indicate that continuous ranging was + * requested, or else that an ingress event occurred. + */ + bitfield rangingIndicationType; + + /** + * 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. + */ + vec scid; +}; + +/** + * NDP Capabilities response. + */ +struct NanCapabilities { + /** + * Maximum number of clusters which the device can join concurrently. + */ + uint32_t maxConcurrentClusters; + + /** + * Maximum number of concurrent publish discovery sessions. + */ + uint32_t maxPublishes; + + /** + * Maximum number of concurrent subscribe discovery sessions. + */ + uint32_t maxSubscribes; + + /** + * Maximum length (in bytes) of service name. + */ + uint32_t maxServiceNameLen; + + /** + * Maximum length (in bytes) of individual match filters. + */ + uint32_t maxMatchFilterLen; + + /** + * Maximum length (in bytes) of aggregate match filters across all active sessions. + */ + uint32_t maxTotalMatchFilterLen; + + /** + * Maximum length (in bytes) of the service specific info field. + */ + uint32_t maxServiceSpecificInfoLen; + + /** + * Maximum length (in bytes) of the extended service specific info field. + */ + uint32_t maxExtendedServiceSpecificInfoLen; + + /** + * Maximum number of data interfaces (NDI) which can be created concurrently on the device. + */ + uint32_t maxNdiInterfaces; + + /** + * Maximum number of data paths (NDP) which can be created concurrently on the device, across all + * data interfaces (NDI). + */ + uint32_t maxNdpSessions; + + /** + * Maximum length (in bytes) of application info field (used in data-path negotiations). + */ + uint32_t maxAppInfoLen; + + /** + * Maximum number of transmitted followup messages which can be queued by the firmware. + */ + uint32_t maxQueuedTransmitFollowupMsgs; + + /** + * Maximum number MAC interface addresses which can be specified to a subscribe discovery session. + */ + uint32_t maxSubscribeInterfaceAddresses; + + /** + * The set of supported Cipher suites. The |NanCipherSuiteType| bit fields are used. + */ + bitfield supportedCipherSuites; + + /** + * Flag to indicate id instant communication mode is supported. + */ + bool instantCommunicationModeSupportFlag; +}; -- GitLab From 6e13599d959ceb54be47b6da8e2da03de7592222 Mon Sep 17 00:00:00 2001 From: Nate Jiang Date: Mon, 24 Jan 2022 12:14:23 -0800 Subject: [PATCH 510/825] Wifi: Add HAL API and implementation for instant mode filter Bug: 203220137 Test: pass vts test Change-Id: I7f4d9d4390ad69bcfdb2419c2e172c4df2d6863b --- wifi/1.6/IWifiChip.hal | 13 +++++++++++++ wifi/1.6/default/hidl_struct_util.cpp | 3 +++ wifi/1.6/default/wifi_chip.cpp | 2 +- wifi/1.6/default/wifi_chip.h | 2 +- wifi/1.6/types.hal | 2 +- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/wifi/1.6/IWifiChip.hal b/wifi/1.6/IWifiChip.hal index b252a053e8..eaa2400466 100644 --- a/wifi/1.6/IWifiChip.hal +++ b/wifi/1.6/IWifiChip.hal @@ -27,6 +27,19 @@ import IWifiRttController; * Interface that represents a chip that must be configured as a single unit. */ interface IWifiChip extends @1.5::IWifiChip { + /** + * Usable Wifi channels filter masks. + */ + enum UsableChannelFilter : @1.5::IWifiChip.UsableChannelFilter { + /** + * Filter Wifi channels 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. + */ + NAN_INSTANT_MODE = 1 << 2, + }; + /** * Create a RTTController instance. * diff --git a/wifi/1.6/default/hidl_struct_util.cpp b/wifi/1.6/default/hidl_struct_util.cpp index eeea6ef3fb..76341ffd7e 100644 --- a/wifi/1.6/default/hidl_struct_util.cpp +++ b/wifi/1.6/default/hidl_struct_util.cpp @@ -433,6 +433,9 @@ uint32_t convertHidlUsableChannelFilterToLegacy(uint32_t hidl_filter_mask) { if (hidl_filter_mask & V1_5::IWifiChip::UsableChannelFilter::CONCURRENCY) { legacy_filter_mask |= legacy_hal::WIFI_USABLE_CHANNEL_FILTER_CONCURRENCY; } + if (hidl_filter_mask & V1_6::IWifiChip::UsableChannelFilter::NAN_INSTANT_MODE) { + legacy_filter_mask |= WIFI_USABLE_CHANNEL_FILTER_NAN_INSTANT_MODE; + } return legacy_filter_mask; } diff --git a/wifi/1.6/default/wifi_chip.cpp b/wifi/1.6/default/wifi_chip.cpp index 11512f46e0..a1857246a7 100644 --- a/wifi/1.6/default/wifi_chip.cpp +++ b/wifi/1.6/default/wifi_chip.cpp @@ -715,7 +715,7 @@ Return WifiChip::createRttController_1_6(const sp& bound_iface Return WifiChip::getUsableChannels_1_6( WifiBand band, hidl_bitfield ifaceModeMask, - hidl_bitfield filterMask, + hidl_bitfield filterMask, getUsableChannels_1_6_cb _hidl_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, &WifiChip::getUsableChannelsInternal_1_6, _hidl_cb, band, ifaceModeMask, diff --git a/wifi/1.6/default/wifi_chip.h b/wifi/1.6/default/wifi_chip.h index 73bdf3ada1..61ac03da83 100644 --- a/wifi/1.6/default/wifi_chip.h +++ b/wifi/1.6/default/wifi_chip.h @@ -151,7 +151,7 @@ class WifiChip : public V1_6::IWifiChip { Return setCountryCode(const hidl_array& code, setCountryCode_cb _hidl_cb) override; Return getUsableChannels(WifiBand band, hidl_bitfield ifaceModeMask, - hidl_bitfield filterMask, + hidl_bitfield filterMask, getUsableChannels_cb _hidl_cb) override; Return triggerSubsystemRestart(triggerSubsystemRestart_cb hidl_status_cb) override; Return createRttController_1_6(const sp& bound_iface, diff --git a/wifi/1.6/types.hal b/wifi/1.6/types.hal index 2a49d0888b..ef6965d4cf 100644 --- a/wifi/1.6/types.hal +++ b/wifi/1.6/types.hal @@ -764,7 +764,7 @@ struct NanDataPathSecurityConfig { /** * Security Context Identifier attribute contains PMKID shall be included in NDP setup and * response messages. Security Context Identifier, Identifies the Security Context. When - * security is enabled This field contains the 16 octet PMKID identifying the PMK used for + * security is enabled this field contains the 16 octet PMKID identifying the PMK used for * setting up the Secure Data Path. */ uint8_t[16] scid; -- GitLab From ce255a31768a1f7b750bb243f1ec4e091a77d5b6 Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Fri, 21 Jan 2022 19:13:21 +0000 Subject: [PATCH 511/825] Add head tracking to multi-HAL conversion code Also adds OWNERS file. Bug: 215702376 Test: Compile Change-Id: Ib0bbb312aae66ab6130a8677ec8e0e82d0db48bb --- sensors/aidl/default/OWNERS | 3 ++ .../aidl/default/multihal/ConvertUtils.cpp | 51 ++++++++++++++++--- 2 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 sensors/aidl/default/OWNERS diff --git a/sensors/aidl/default/OWNERS b/sensors/aidl/default/OWNERS new file mode 100644 index 0000000000..e9556700d6 --- /dev/null +++ b/sensors/aidl/default/OWNERS @@ -0,0 +1,3 @@ +arthuri@google.com +bduddie@google.com +stange@google.com \ No newline at end of file diff --git a/sensors/aidl/default/multihal/ConvertUtils.cpp b/sensors/aidl/default/multihal/ConvertUtils.cpp index 509bbb0e7b..7751fd2994 100644 --- a/sensors/aidl/default/multihal/ConvertUtils.cpp +++ b/sensors/aidl/default/multihal/ConvertUtils.cpp @@ -58,6 +58,7 @@ AidlSensorInfo convertSensorInfo(const V2_1SensorInfo& sensorInfo) { } void convertToHidlEvent(const AidlEvent& aidlEvent, V2_1Event* hidlEvent) { + static_assert(decltype(hidlEvent->u.data)::elementCount() == 16); hidlEvent->timestamp = aidlEvent.timestamp; hidlEvent->sensorHandle = aidlEvent.sensorHandle; hidlEvent->sensorType = (V2_1SensorType)aidlEvent.sensorType; @@ -177,16 +178,33 @@ void convertToHidlEvent(const AidlEvent& aidlEvent, V2_1Event* hidlEvent) { } break; } - default: + case AidlSensorType::HEAD_TRACKER: { + const auto& ht = aidlEvent.payload.get(); + hidlEvent->u.data[0] = ht.rx; + hidlEvent->u.data[1] = ht.ry; + hidlEvent->u.data[2] = ht.rz; + hidlEvent->u.data[3] = ht.vx; + hidlEvent->u.data[4] = ht.vy; + hidlEvent->u.data[5] = ht.vz; + + // IMPORTANT: Because we want to preserve the data range of discontinuityCount, + // we assume the data can be interpreted as an int32_t directly (e.g. the underlying + // HIDL HAL must be using memcpy or equivalent to store this value). + *(reinterpret_cast(&hidlEvent->u.data[6])) = ht.discontinuityCount; + break; + } + default: { CHECK_GE((int32_t)aidlEvent.sensorType, (int32_t)SensorType::DEVICE_PRIVATE_BASE); std::copy(std::begin(aidlEvent.payload.get().values), std::end(aidlEvent.payload.get().values), hidlEvent->u.data.data()); break; + } } } void convertToAidlEvent(const V2_1Event& hidlEvent, AidlEvent* aidlEvent) { + static_assert(decltype(hidlEvent.u.data)::elementCount() == 16); aidlEvent->timestamp = hidlEvent.timestamp; aidlEvent->sensorHandle = hidlEvent.sensorHandle; aidlEvent->sensorType = (AidlSensorType)hidlEvent.sensorType; @@ -304,11 +322,32 @@ void convertToAidlEvent(const V2_1Event& hidlEvent, AidlEvent* aidlEvent) { break; } default: { - CHECK_GE((int32_t)hidlEvent.sensorType, (int32_t)V2_1SensorType::DEVICE_PRIVATE_BASE); - AidlEvent::EventPayload::Data data; - std::copy(hidlEvent.u.data.data(), hidlEvent.u.data.data() + hidlEvent.u.data.size(), - std::begin(data.values)); - aidlEvent->payload.set(data); + if (static_cast(hidlEvent.sensorType) == + static_cast(AidlSensorType::HEAD_TRACKER)) { + Event::EventPayload::HeadTracker headTracker; + headTracker.rx = hidlEvent.u.data[0]; + headTracker.ry = hidlEvent.u.data[1]; + headTracker.rz = hidlEvent.u.data[2]; + headTracker.vx = hidlEvent.u.data[3]; + headTracker.vy = hidlEvent.u.data[4]; + headTracker.vz = hidlEvent.u.data[5]; + + // IMPORTANT: Because we want to preserve the data range of discontinuityCount, + // we assume the data can be interpreted as an int32_t directly (e.g. the underlying + // HIDL HAL must be using memcpy or equivalent to store this value). + headTracker.discontinuityCount = + *(reinterpret_cast(&hidlEvent.u.data[6])); + + aidlEvent->payload.set(headTracker); + } else { + CHECK_GE((int32_t)hidlEvent.sensorType, + (int32_t)V2_1SensorType::DEVICE_PRIVATE_BASE); + AidlEvent::EventPayload::Data data; + std::copy(hidlEvent.u.data.data(), + hidlEvent.u.data.data() + hidlEvent.u.data.size(), + std::begin(data.values)); + aidlEvent->payload.set(data); + } break; } } -- GitLab From 38e65b13d68bbab821048e0796ddf66f4208bc7e Mon Sep 17 00:00:00 2001 From: Tyler Trephan Date: Tue, 25 Jan 2022 23:04:55 +0000 Subject: [PATCH 512/825] Updated VTS to support limited axes IMU sensors. Test: atest VtsAidlHalSensorsTargetTest Bug: 188012758 Change-Id: If0a2051eb0d39d8afdf7011da1371a48e4b12c44 --- sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp index 1bc7263048..105cb97eda 100644 --- a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp +++ b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp @@ -60,6 +60,8 @@ static void assertTypeMatchStringType(SensorType type, const std::string& string ASSERT_STREQ(SENSOR_STRING_TYPE_##type, stringType.c_str()); \ break; CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ACCELEROMETER); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ACCELEROMETER_LIMITED_AXES); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ACCELEROMETER_LIMITED_AXES_UNCALIBRATED); CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ACCELEROMETER_UNCALIBRATED); CHECK_TYPE_STRING_FOR_SENSOR_TYPE(ADDITIONAL_INFO); CHECK_TYPE_STRING_FOR_SENSOR_TYPE(AMBIENT_TEMPERATURE); @@ -70,6 +72,8 @@ static void assertTypeMatchStringType(SensorType type, const std::string& string CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GLANCE_GESTURE); CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GRAVITY); CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GYROSCOPE); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GYROSCOPE_LIMITED_AXES); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GYROSCOPE_LIMITED_AXES_UNCALIBRATED); CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GYROSCOPE_UNCALIBRATED); CHECK_TYPE_STRING_FOR_SENSOR_TYPE(HEART_BEAT); CHECK_TYPE_STRING_FOR_SENSOR_TYPE(HEART_RATE); @@ -122,8 +126,11 @@ bool isDirectReportRateSupported(SensorInfo sensor, ISensors::RateLevel rate) { int expectedReportModeForType(SensorType type) { switch (type) { case SensorType::ACCELEROMETER: + case SensorType::ACCELEROMETER_LIMITED_AXES: case SensorType::ACCELEROMETER_UNCALIBRATED: + case SensorType::ACCELEROMETER_LIMITED_AXES_UNCALIBRATED: case SensorType::GYROSCOPE: + case SensorType::GYROSCOPE_LIMITED_AXES: case SensorType::MAGNETIC_FIELD: case SensorType::ORIENTATION: case SensorType::PRESSURE: @@ -133,6 +140,7 @@ int expectedReportModeForType(SensorType type) { case SensorType::MAGNETIC_FIELD_UNCALIBRATED: case SensorType::GAME_ROTATION_VECTOR: case SensorType::GYROSCOPE_UNCALIBRATED: + case SensorType::GYROSCOPE_LIMITED_AXES_UNCALIBRATED: case SensorType::GEOMAGNETIC_ROTATION_VECTOR: case SensorType::POSE_6DOF: case SensorType::HEART_BEAT: -- GitLab From a9040400c723551e918abb275ba13f305bb16c24 Mon Sep 17 00:00:00 2001 From: Ricky Niu Date: Wed, 5 Jan 2022 20:03:09 +0800 Subject: [PATCH 513/825] Implement VTS for resetUsbPort and notifyResetUsbPort Because resetUSBPort API will disconnect the device, disabled the test for temporary. Write another VTS on the host side. Create the b/216387845 to trace. Bug: 197300598 Test: atest VtsAidlUsbTargetTest Signed-off-by: Ricky Niu Change-Id: I17d66c2e9ec55b4ebd9edbb153b7f6bd7166d847 --- usb/aidl/vts/VtsAidlUsbTargetTest.cpp | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/usb/aidl/vts/VtsAidlUsbTargetTest.cpp b/usb/aidl/vts/VtsAidlUsbTargetTest.cpp index ed3bd6e7db..ea2f985766 100644 --- a/usb/aidl/vts/VtsAidlUsbTargetTest.cpp +++ b/usb/aidl/vts/VtsAidlUsbTargetTest.cpp @@ -150,6 +150,17 @@ class UsbAidlTest : public testing::TestWithParam { parent_.notify(); return ScopedAStatus::ok(); } + + // Callback method for the status of resetUsbPortStatus operation + ScopedAStatus notifyResetUsbPortStatus(const string& /*portName*/, Status /*retval*/, + int64_t transactionId) override { + ALOGI("enter notifyResetUsbPortStatus"); + parent_.last_transactionId = transactionId; + parent_.usb_last_cookie = cookie; + parent_.reset_usb_port_done = true; + parent_.notify(); + return ScopedAStatus::ok(); + } }; virtual void SetUp() override { @@ -223,6 +234,9 @@ class UsbAidlTest : public testing::TestWithParam { // Flag to indicate the invocation of notifyLimitPowerTransferStatus callback. bool limit_power_transfer_done; + // Flag to indicate the invocation of notifyResetUsbPort callback. + bool reset_usb_port_done; + // Stores the cookie of the last invoked usb callback object. int usb_last_cookie; @@ -509,6 +523,43 @@ TEST_P(UsbAidlTest, limitPowerTransfer) { ALOGI("UsbAidlTest limitPowerTransfer end"); } +/* + * Test reset Usb data of the port. + * Test case queries the usb ports present in device. + * If there is at least one usb port, reset Usb data for the port. + * The callback parameters are checked to see if transaction id + * matches. + */ +TEST_P(UsbAidlTest, DISABLED_resetUsbPort) { + ALOGI("UsbAidlTest resetUsbPort start"); + int64_t transactionId = rand() % 10000; + const auto& ret = usb->queryPortStatus(transactionId); + ASSERT_TRUE(ret.isOk()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + + if (!usb_last_port_status.portName.empty()) { + ALOGI("portname:%s", usb_last_port_status.portName.c_str()); + reset_usb_port_done = false; + transactionId = rand() % 10000; + const auto& ret = usb->resetUsbPort(usb_last_port_status.portName, transactionId); + ASSERT_TRUE(ret.isOk()); + ALOGI("UsbAidlTest resetUsbPort ret.isOk"); + + std::cv_status waitStatus = wait(); + while (waitStatus == std::cv_status::no_timeout && + reset_usb_port_done == false) + waitStatus = wait(); + + ALOGI("UsbAidlTest resetUsbPort wait()"); + EXPECT_EQ(std::cv_status::no_timeout, waitStatus); + EXPECT_EQ(2, usb_last_cookie); + EXPECT_EQ(transactionId, last_transactionId); + } + ALOGI("UsbAidlTest resetUsbPort end"); +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(UsbAidlTest); INSTANTIATE_TEST_SUITE_P( PerInstance, UsbAidlTest, -- GitLab From 425df50402834f8b634ce33feee783dfb3df3907 Mon Sep 17 00:00:00 2001 From: jimblackler Date: Wed, 19 Jan 2022 15:45:11 +0000 Subject: [PATCH 514/825] VTS tests for Game Loading Time improvement by boosting CPU via ADPF Bug: 201769701 Test: atest VtsHalPowerTargetTest Change-Id: Ic6e4542001563391b232dca15d3ae74dbee4c665 --- power/aidl/vts/Android.bp | 2 +- power/aidl/vts/VtsHalPowerTargetTest.cpp | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/power/aidl/vts/Android.bp b/power/aidl/vts/Android.bp index eccd872716..ea398ac6b2 100644 --- a/power/aidl/vts/Android.bp +++ b/power/aidl/vts/Android.bp @@ -32,7 +32,7 @@ cc_test { "libbinder_ndk", ], static_libs: [ - "android.hardware.power-V2-ndk", + "android.hardware.power-V3-ndk", ], test_suites: [ "vts", diff --git a/power/aidl/vts/VtsHalPowerTargetTest.cpp b/power/aidl/vts/VtsHalPowerTargetTest.cpp index ffab66c312..e0ca87f496 100644 --- a/power/aidl/vts/VtsHalPowerTargetTest.cpp +++ b/power/aidl/vts/VtsHalPowerTargetTest.cpp @@ -201,10 +201,7 @@ TEST_P(PowerAidl, updateAndReportDurations) { // FIXED_PERFORMANCE mode is required for all devices which ship on Android 11 // or later TEST_P(PowerAidl, hasFixedPerformance) { - auto apiLevel = GetUintProperty("ro.product.first_api_level", 0); - if (apiLevel == 0) { - apiLevel = GetUintProperty("ro.build.version.sdk", 0); - } + auto apiLevel = GetUintProperty("ro.vendor.api_level", 0); ASSERT_NE(apiLevel, 0); if (apiLevel >= 30) { @@ -214,6 +211,19 @@ TEST_P(PowerAidl, hasFixedPerformance) { } } +// GAME_LOADING mode is required for all devices which ship on Android T +// or later +TEST_P(PowerAidl, hasGameLoading) { + auto apiLevel = GetUintProperty("ro.vendor.api_level", 0); + ASSERT_NE(apiLevel, 0); + + if (apiLevel >= 33) { + bool supported; + ASSERT_TRUE(power->isModeSupported(Mode::GAME_LOADING, &supported).isOk()); + ASSERT_TRUE(supported); + } +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(PowerAidl); INSTANTIATE_TEST_SUITE_P(Power, PowerAidl, testing::ValuesIn(::android::getAidlHalInstanceNames(IPower::descriptor)), -- GitLab From 51c7bd47abeb3f24ad53342a9609a8f263d04ded Mon Sep 17 00:00:00 2001 From: Greg Kaiser Date: Wed, 26 Jan 2022 07:13:18 -0800 Subject: [PATCH 515/825] Wifi: Remove premature 'return' We want to fill in more fields in our conversion method, so we let the logic proceed to all of them. Test: TreeHugger Bug: 203220137 Change-Id: Ia7a9c978ec778eebd17b9ce74f43cc320e92b971 --- wifi/1.6/default/hidl_struct_util.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/wifi/1.6/default/hidl_struct_util.cpp b/wifi/1.6/default/hidl_struct_util.cpp index 76341ffd7e..71f98b9ef5 100644 --- a/wifi/1.6/default/hidl_struct_util.cpp +++ b/wifi/1.6/default/hidl_struct_util.cpp @@ -1420,8 +1420,6 @@ bool convertHidlNanConfigRequest_1_6ToLegacy(const V1_4::NanConfigRequest& hidl_ legacy_request->config_enable_ranging = 1; legacy_request->enable_ranging = hidl_request2.V1_5.V1_2.enableRanging; - return true; - legacy_request->config_enable_instant_mode = 1; legacy_request->enable_instant_mode = hidl_request2.V1_5.enableInstantCommunicationMode; legacy_request->config_instant_mode_channel = 1; -- GitLab From e13c7b20e24d637f81a6b30cbab9eb4ce5c108c9 Mon Sep 17 00:00:00 2001 From: Purushottam Kushwaha Date: Fri, 17 Dec 2021 10:50:09 +0530 Subject: [PATCH 516/825] IHostapd: Add support for OWE_TRANSITION security encryption type. This commit is to add the EncryptionType:OWE_TRANSITION to allow setup of OWE-Transition Soft-AP. Bug: 181736011 Test: VTS tests Change-Id: Ibfcadfc6fd9c4d0d88755f6d07de72c78efc5968 Signed-off-by: Purushottam Kushwaha --- .../current/android/hardware/wifi/hostapd/EncryptionType.aidl | 1 + .../aidl/android/hardware/wifi/hostapd/EncryptionType.aidl | 1 + 2 files changed, 2 insertions(+) diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/EncryptionType.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/EncryptionType.aidl index cec0c14f49..ae3dccb63b 100644 --- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/EncryptionType.aidl +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/EncryptionType.aidl @@ -39,4 +39,5 @@ enum EncryptionType { WPA2 = 2, WPA3_SAE_TRANSITION = 3, WPA3_SAE = 4, + OWE_TRANSITION = 5, } diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/EncryptionType.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/EncryptionType.aidl index bfc634d9d4..a8f3252d3b 100644 --- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/EncryptionType.aidl +++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/EncryptionType.aidl @@ -29,4 +29,5 @@ enum EncryptionType { WPA2, WPA3_SAE_TRANSITION, WPA3_SAE, + OWE_TRANSITION, } -- GitLab From be6963a27959f254c0514a01da7cd226076cd468 Mon Sep 17 00:00:00 2001 From: Ray Essick Date: Wed, 26 Jan 2022 09:50:04 -0800 Subject: [PATCH 517/825] Add explicit apex_available clauses So we can start deleting the lists embedded in the build tools Bug: 215589022 Test: build Change-Id: Ibea376e172d4def6d1dbb2b8e7a170afc356f59e --- cas/1.0/Android.bp | 4 ++++ cas/1.1/Android.bp | 4 ++++ cas/1.2/Android.bp | 4 ++++ cas/native/1.0/Android.bp | 4 ++++ graphics/bufferqueue/1.0/Android.bp | 5 +++++ graphics/bufferqueue/2.0/Android.bp | 5 +++++ media/1.0/Android.bp | 4 ++++ media/bufferpool/2.0/Android.bp | 4 ++++ media/c2/1.0/Android.bp | 5 +++++ media/c2/1.1/Android.bp | 5 +++++ media/omx/1.0/Android.bp | 4 ++++ 11 files changed, 48 insertions(+) diff --git a/cas/1.0/Android.bp b/cas/1.0/Android.bp index 368156ad76..e27695c89a 100644 --- a/cas/1.0/Android.bp +++ b/cas/1.0/Android.bp @@ -23,4 +23,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.media", + ], } diff --git a/cas/1.1/Android.bp b/cas/1.1/Android.bp index f5b1cc9564..1bf9c5f030 100644 --- a/cas/1.1/Android.bp +++ b/cas/1.1/Android.bp @@ -22,4 +22,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.media", + ], } diff --git a/cas/1.2/Android.bp b/cas/1.2/Android.bp index 6c94020464..5468ed0c65 100644 --- a/cas/1.2/Android.bp +++ b/cas/1.2/Android.bp @@ -24,4 +24,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.media", + ], } diff --git a/cas/native/1.0/Android.bp b/cas/native/1.0/Android.bp index 3bb74c107e..ef77ab4f29 100644 --- a/cas/native/1.0/Android.bp +++ b/cas/native/1.0/Android.bp @@ -21,4 +21,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: false, + apex_available: [ + "//apex_available:platform", + "com.android.media", + ], } diff --git a/graphics/bufferqueue/1.0/Android.bp b/graphics/bufferqueue/1.0/Android.bp index eda80d7a0d..c3d38d0a31 100644 --- a/graphics/bufferqueue/1.0/Android.bp +++ b/graphics/bufferqueue/1.0/Android.bp @@ -25,4 +25,9 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.media", + "com.android.media.swcodec", + ], } diff --git a/graphics/bufferqueue/2.0/Android.bp b/graphics/bufferqueue/2.0/Android.bp index 13feeb1548..33d9104211 100644 --- a/graphics/bufferqueue/2.0/Android.bp +++ b/graphics/bufferqueue/2.0/Android.bp @@ -27,4 +27,9 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.media", + "com.android.media.swcodec", + ], } diff --git a/media/1.0/Android.bp b/media/1.0/Android.bp index 6e823f6e4d..22a6d59f6f 100644 --- a/media/1.0/Android.bp +++ b/media/1.0/Android.bp @@ -22,4 +22,8 @@ hidl_interface { "android.hardware.graphics.common@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + ], } diff --git a/media/bufferpool/2.0/Android.bp b/media/bufferpool/2.0/Android.bp index 01273c11d6..56597db396 100644 --- a/media/bufferpool/2.0/Android.bp +++ b/media/bufferpool/2.0/Android.bp @@ -26,4 +26,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: false, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + ], } diff --git a/media/c2/1.0/Android.bp b/media/c2/1.0/Android.bp index dc56fef7d8..a591dc7702 100644 --- a/media/c2/1.0/Android.bp +++ b/media/c2/1.0/Android.bp @@ -36,4 +36,9 @@ hidl_interface { "android.hidl.safe_union@1.0", ], gen_java: false, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + "test_com.android.media.swcodec", + ], } diff --git a/media/c2/1.1/Android.bp b/media/c2/1.1/Android.bp index 885a4c8845..bec3a068f3 100644 --- a/media/c2/1.1/Android.bp +++ b/media/c2/1.1/Android.bp @@ -30,4 +30,9 @@ hidl_interface { "android.hidl.safe_union@1.0", ], gen_java: false, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + "test_com.android.media.swcodec", + ], } diff --git a/media/omx/1.0/Android.bp b/media/omx/1.0/Android.bp index e33bab39dd..ea6346758d 100644 --- a/media/omx/1.0/Android.bp +++ b/media/omx/1.0/Android.bp @@ -31,4 +31,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: false, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + ], } -- GitLab From 1c0febea78230f2f44b91cfa6d46ebf6e6aba9ed Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 26 Jan 2022 10:22:46 -0800 Subject: [PATCH 518/825] uwb(hal): Add 2 new CCC param ids under vendor interface Bug: 208678993 Test: Compiles Change-Id: I3043d30b1c1566786faf0dfbe6df74d7e3119720 --- .../UwbVendorSessionSetAppConfigCmdParams.aidl | 2 ++ .../UwbVendorSessionSetAppConfigCmdParams.aidl | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl index f449c60212..0d53431d4d 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl @@ -34,6 +34,8 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability enum UwbVendorSessionSetAppConfigCmdParams { + CCC_HOP_MODE_KEY = 160, + CCC_UWB_TIME0 = 161, CCC_RANGING_PROTOCOL_VER = 163, CCC_UWB_CONFIG_ID = 164, CCC_PULSESHAPE_COMBO = 165, diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl index f5e02c07c1..eb1f5ac408 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl @@ -33,9 +33,17 @@ enum UwbVendorSessionSetAppConfigCmdParams { * Added in vendor version 0. * Range 0xA0 - 0xDF reserved for CCC use. */ + /** 16 byte data */ + CCC_HOP_MODE_KEY = 0xA0, + /** 8 byte data */ + CCC_UWB_TIME0 = 0xA1, + /** 2 byte data */ CCC_RANGING_PROTOCOL_VER = 0xA3, + /** 2 byte data */ CCC_UWB_CONFIG_ID = 0xA4, + /** 1 byte data */ CCC_PULSESHAPE_COMBO = 0xA5, + /** 2 byte data */ CCC_URSK_TTL = 0xA6, /** @@ -51,7 +59,10 @@ enum UwbVendorSessionSetAppConfigCmdParams { * Supported only if the value returned by getSupportedAndroidCapabilities() * has the bit of UwbAndroidCapabilities.ANTENNAE_INTERLEAVING set to 1. */ + /** 2 byte data */ NB_OF_RANGE_MEASUREMENTS = 0xE3, + /** 2 byte data */ NB_OF_AZIMUTH_MEASUREMENTS = 0xE4, + /** 2 byte data */ NB_OF_ELEVATION_MEASUREMENTS = 0xE5, } -- GitLab From 75934f7a0235246774724d151924b561c873ead5 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Mon, 24 Jan 2022 15:35:25 -0800 Subject: [PATCH 519/825] Fix ANAPIC review comments (hardware/interfaces) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use "GnssAgc[] gnssAgcs = {};" for backwards compatibility * Add comments on AgnssTypes * Rename SetIDType -> SetIdType * Update the comment on NetworkAttributes -> networkHandle * Remove the “DELETE_” prefix in the GnssAidingData * Make a parcelable for setPositionMode parameters Bug: 215566115 Test: atest VtsHalGnssTargetTest Change-Id: Ifc2de451a43cd1f32267e74dc288a3821b75f0cb --- .../android/hardware/gnss/GnssData.aidl | 2 +- .../android/hardware/gnss/IAGnssRil.aidl | 4 +- .../current/android/hardware/gnss/IGnss.aidl | 37 +++++--- gnss/aidl/android/hardware/gnss/GnssData.aidl | 6 +- .../android/hardware/gnss/IAGnssCallback.aidl | 4 + .../aidl/android/hardware/gnss/IAGnssRil.aidl | 7 +- .../hardware/gnss/IAGnssRilCallback.aidl | 2 +- gnss/aidl/android/hardware/gnss/IGnss.aidl | 89 +++++++++++-------- gnss/aidl/default/AGnssRil.cpp | 2 +- gnss/aidl/default/AGnssRil.h | 2 +- gnss/aidl/default/Gnss.cpp | 9 +- gnss/aidl/default/Gnss.h | 4 +- gnss/aidl/vts/gnss_hal_test.cpp | 11 ++- gnss/aidl/vts/gnss_hal_test_cases.cpp | 7 +- gnss/common/utils/default/Utils.cpp | 3 +- 15 files changed, 112 insertions(+), 77 deletions(-) diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl index aa514da38c..01a3b3a19e 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl @@ -37,7 +37,7 @@ parcelable GnssData { android.hardware.gnss.GnssMeasurement[] measurements; android.hardware.gnss.GnssClock clock; android.hardware.gnss.ElapsedRealtime elapsedRealtime; - @nullable android.hardware.gnss.GnssData.GnssAgc[] gnssAgcs; + android.hardware.gnss.GnssData.GnssAgc[] gnssAgcs = {}; @VintfStability parcelable GnssAgc { double agcLevelDb; 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 73df1950bf..69fa32b21e 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 @@ -36,7 +36,7 @@ package android.hardware.gnss; interface IAGnssRil { void setCallback(in android.hardware.gnss.IAGnssRilCallback callback); void setRefLocation(in android.hardware.gnss.IAGnssRil.AGnssRefLocation agnssReflocation); - void setSetId(in android.hardware.gnss.IAGnssRil.SetIDType type, in @utf8InCpp String setid); + void setSetId(in android.hardware.gnss.IAGnssRil.SetIdType type, in @utf8InCpp String setid); void updateNetworkState(in android.hardware.gnss.IAGnssRil.NetworkAttributes attributes); const int NETWORK_CAPABILITY_NOT_METERED = 1; const int NETWORK_CAPABILITY_NOT_ROAMING = 2; @@ -48,7 +48,7 @@ interface IAGnssRil { NR_CELLID = 8, } @Backing(type="int") @VintfStability - enum SetIDType { + enum SetIdType { NONE = 0, IMSI = 1, MSISDM = 2, 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 a16d27ba2d..affef2bf9b 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 @@ -53,7 +53,7 @@ interface IGnss { void injectLocation(in android.hardware.gnss.GnssLocation location); void injectBestLocation(in android.hardware.gnss.GnssLocation location); void deleteAidingData(in android.hardware.gnss.IGnss.GnssAidingData aidingDataFlags); - void setPositionMode(in android.hardware.gnss.IGnss.GnssPositionMode mode, in android.hardware.gnss.IGnss.GnssPositionRecurrence recurrence, in int minIntervalMs, in int preferredAccuracyMeters, in int preferredTimeMs, in boolean lowPowerMode); + void setPositionMode(in android.hardware.gnss.IGnss.PositionModeOptions options); android.hardware.gnss.IGnssAntennaInfo getExtensionGnssAntennaInfo(); @nullable android.hardware.gnss.measurement_corrections.IMeasurementCorrectionsInterface getExtensionMeasurementCorrections(); const int ERROR_INVALID_ARGUMENT = 1; @@ -72,18 +72,27 @@ interface IGnss { } @Backing(type="int") @VintfStability enum GnssAidingData { - DELETE_EPHEMERIS = 1, - DELETE_ALMANAC = 2, - DELETE_POSITION = 4, - DELETE_TIME = 8, - DELETE_IONO = 16, - DELETE_UTC = 32, - DELETE_HEALTH = 64, - DELETE_SVDIR = 128, - DELETE_SVSTEER = 256, - DELETE_SADATA = 512, - DELETE_RTI = 1024, - DELETE_CELLDB_INFO = 32768, - DELETE_ALL = 65535, + 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, + } + @VintfStability + parcelable PositionModeOptions { + android.hardware.gnss.IGnss.GnssPositionMode mode; + android.hardware.gnss.IGnss.GnssPositionRecurrence recurrence; + int minIntervalMs; + int preferredAccuracyMeters; + int preferredTimeMs; + boolean lowPowerMode; } } diff --git a/gnss/aidl/android/hardware/gnss/GnssData.aidl b/gnss/aidl/android/hardware/gnss/GnssData.aidl index 204eb65e6b..6b2068e700 100644 --- a/gnss/aidl/android/hardware/gnss/GnssData.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssData.aidl @@ -76,6 +76,10 @@ parcelable GnssData { * is the primary common use central frequency, e.g. L1 = 1575.45 MHz * for GPS. * + * If all the GLO frequencies have a common AGC, the FC0 (frequency + * channel number 0) of the individual GLO bands is used to represent + * all the GLO frequencies. + * * For an L1, L5 receiver tracking a satellite on L1 and L5 at the same * time, two raw measurement structs must be reported for this same * satellite, in one of the measurement structs, all the values related @@ -92,5 +96,5 @@ parcelable GnssData { * GnssMeasurement or GnssClock fields are not reported yet. E.g., when a GNSS signal is too * weak to be acquired, the AGC value must still be reported. */ - @nullable GnssAgc[] gnssAgcs; + GnssAgc[] gnssAgcs = {}; } diff --git a/gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl b/gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl index 7c2593720e..8f881b7887 100644 --- a/gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl @@ -23,9 +23,13 @@ interface IAGnssCallback { @VintfStability @Backing(type="int") enum AGnssType { + // Secure User Plane Location SUPL = 1, + // CDMA2000 C2K = 2, + // SUPL, Emergency call over IP Multimedia Subsystem SUPL_EIMS = 3, + // SUPL, IP Multimedia Subsystem SUPL_IMS = 4, } diff --git a/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl b/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl index c506b04968..b505d81c62 100644 --- a/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl +++ b/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl @@ -17,7 +17,6 @@ package android.hardware.gnss; import android.hardware.gnss.IAGnssRilCallback; -import android.hardware.gnss.IAGnssRilCallback.SetIDType; /** * Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface @@ -46,7 +45,7 @@ interface IAGnssRil { /** SET ID type*/ @VintfStability @Backing(type="int") - enum SetIDType { + enum SetIdType { NONE = 0, IMSI = 1, MSISDM = 2, @@ -100,7 +99,7 @@ interface IAGnssRil { /** Represents network connection status and capabilities. */ @VintfStability parcelable NetworkAttributes { - /** Network handle of the network for use with the NDK API. */ + /** A handle representing this Network. */ long networkHandle; /** @@ -151,7 +150,7 @@ interface IAGnssRil { * If the type is NONE, then the string must be empty. * */ - void setSetId(in SetIDType type, in @utf8InCpp String setid); + void setSetId(in SetIdType type, in @utf8InCpp String setid); /** * Notifies GNSS of network status changes. diff --git a/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl b/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl index 6fb093e165..485626dc40 100644 --- a/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl @@ -25,7 +25,7 @@ interface IAGnssRilCallback { /** * The Hal uses this API to request a SET ID. * - * @param setIdflag A bitfield of IAGnssRil.SetIDType that is required by + * @param setIdflag A bitfield of IAGnssRil.SetIdType that is required by * the HAL. The framework will inject an empty SET ID if the flag is NONE. * */ diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl index 99f2ee4b26..79950adad3 100644 --- a/gnss/aidl/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl @@ -81,19 +81,19 @@ interface IGnss { @VintfStability @Backing(type="int") enum GnssAidingData { - DELETE_EPHEMERIS = 0x0001, - DELETE_ALMANAC = 0x0002, - DELETE_POSITION = 0x0004, - DELETE_TIME = 0x0008, - DELETE_IONO = 0x0010, - DELETE_UTC = 0x0020, - DELETE_HEALTH = 0x0040, - DELETE_SVDIR = 0x0080, - DELETE_SVSTEER = 0x0100, - DELETE_SADATA = 0x0200, - DELETE_RTI = 0x0400, - DELETE_CELLDB_INFO = 0x8000, - DELETE_ALL = 0xFFFF + 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 } /** @@ -256,37 +256,56 @@ interface IGnss { /** * Specifies that the next call to start will not use the information defined in the flags. - * GnssAidingData value of DELETE_ALL is passed for a cold start. + * GnssAidingData value of GnssAidingData::ALL is passed for a cold start. * * @param aidingDataFlags Flags specifying the aiding data to be deleted. */ void deleteAidingData(in GnssAidingData aidingDataFlags); + /** + * Options used in the setPositionMode() call for specifying the GNSS engine behavior. + */ + @VintfStability + parcelable PositionModeOptions { + /** + * Must be one of MS_BASED or STANDALONE. It is allowed by the platform (and it is + * recommended) to fallback to MS_BASED if MS_ASSISTED is passed in, and MS_BASED is + * supported. + */ + GnssPositionMode mode; + + /* Recurrence GNSS position recurrence value, either periodic or single. */ + GnssPositionRecurrence recurrence; + + /* Represents the time between fixes in milliseconds. */ + int minIntervalMs; + + /* Represents the requested fix accuracy in meters. */ + int preferredAccuracyMeters; + + /* Represents the requested time to first fix in milliseconds. */ + int preferredTimeMs; + + /** + * When true, and IGnss is the only client to the GNSS hardware, the GNSS hardware must make + * strong tradeoffs to substantially restrict power use. Specifically, in the case of a + * several second long minIntervalMs, the GNSS hardware must not, on average, run power + * hungry operations like RF and signal searches for more than one second per interval, and + * must make exactly one call to gnssSvStatusCb(), and either zero or one call to + * GnssLocationCb() at each interval. When false, HAL must operate in the nominal mode and + * is expected to make power and performance tradoffs such as duty-cycling when signal + * conditions are good and more active searches to reacquire GNSS signals when no signals + * are present. When there are additional clients using the GNSS hardware other than IGnss, + * the GNSS hardware may operate in a higher power mode, on behalf of those clients. + */ + boolean lowPowerMode; + } + /** * Sets the GnssPositionMode parameter, its associated recurrence value, the time between fixes, * requested fix accuracy, time to first fix. - * - * @param mode Parameter must be one of MS_BASED or STANDALONE. It is allowed by the platform - * (and it is recommended) to fallback to MS_BASED if MS_ASSISTED is passed in, and MS_BASED - * is supported. - * @param recurrence GNSS position recurrence value, either periodic or single. - * @param minIntervalMs Represents the time between fixes in milliseconds. - * @param preferredAccuracyMeters Represents the requested fix accuracy in meters. - * @param preferredTimeMs Represents the requested time to first fix in milliseconds. - * @param lowPowerMode When true, and IGnss is the only client to the GNSS hardware, the GNSS - * hardware must make strong tradeoffs to substantially restrict power use. Specifically, in - * the case of a several second long minIntervalMs, the GNSS hardware must not, on average, - * run power hungry operations like RF and signal searches for more than one second per - * interval, and must make exactly one call to gnssSvStatusCb(), and either zero or one call - * to GnssLocationCb() at each interval. When false, HAL must operate in the nominal mode - * and is expected to make power and performance tradoffs such as duty-cycling when signal - * conditions are good and more active searches to reacquire GNSS signals when no signals - * are present. When there are additional clients using the GNSS hardware other than IGnss, - * the GNSS hardware may operate in a higher power mode, on behalf of those clients. */ - void setPositionMode(in GnssPositionMode mode, in GnssPositionRecurrence recurrence, - in int minIntervalMs, in int preferredAccuracyMeters, in int preferredTimeMs, - in boolean lowPowerMode); + void setPositionMode(in PositionModeOptions options); /* * This method returns the IGnssAntennaInfo. diff --git a/gnss/aidl/default/AGnssRil.cpp b/gnss/aidl/default/AGnssRil.cpp index afe0039105..2aa1abcb98 100644 --- a/gnss/aidl/default/AGnssRil.cpp +++ b/gnss/aidl/default/AGnssRil.cpp @@ -41,7 +41,7 @@ ndk::ScopedAStatus AGnssRil::setRefLocation(const AGnssRefLocation& agnssRefloca return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus AGnssRil::setSetId(SetIDType type, const std::string& setid) { +ndk::ScopedAStatus AGnssRil::setSetId(SetIdType type, const std::string& setid) { ALOGD("AGnssRil::setSetId: type:%s, setid: %s", toString(type).c_str(), setid.c_str()); return ndk::ScopedAStatus::ok(); } diff --git a/gnss/aidl/default/AGnssRil.h b/gnss/aidl/default/AGnssRil.h index 7e429ee8f4..e205b69763 100644 --- a/gnss/aidl/default/AGnssRil.h +++ b/gnss/aidl/default/AGnssRil.h @@ -24,7 +24,7 @@ struct AGnssRil : public BnAGnssRil { public: ndk::ScopedAStatus setCallback(const std::shared_ptr& callback) override; ndk::ScopedAStatus setRefLocation(const AGnssRefLocation& agnssReflocation) override; - ndk::ScopedAStatus setSetId(SetIDType type, const std::string& setid) override; + ndk::ScopedAStatus setSetId(SetIdType type, const std::string& setid) override; ndk::ScopedAStatus updateNetworkState(const NetworkAttributes& attributes) override; private: diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 6331dfd8dc..150a3941c4 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -208,11 +208,10 @@ ScopedAStatus Gnss::deleteAidingData(GnssAidingData aidingDataFlags) { return ScopedAStatus::ok(); } -ScopedAStatus Gnss::setPositionMode(GnssPositionMode, GnssPositionRecurrence, int minIntervalMs, - int /* preferredAccuracyMeters */, int /* preferredTimeMs */, - bool lowPowerMode) { - ALOGD("setPositionMode. minIntervalMs:%d, lowPowerMode:%d", minIntervalMs, (int)lowPowerMode); - mMinIntervalMs = minIntervalMs; +ScopedAStatus Gnss::setPositionMode(const PositionModeOptions& options) { + ALOGD("setPositionMode. minIntervalMs:%d, lowPowerMode:%d", options.minIntervalMs, + (int)options.lowPowerMode); + mMinIntervalMs = options.minIntervalMs; return ScopedAStatus::ok(); } diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index 36874b897c..b50a1aeb7a 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -50,9 +50,7 @@ class Gnss : public BnGnss { ndk::ScopedAStatus injectLocation(const GnssLocation& location) override; ndk::ScopedAStatus injectBestLocation(const GnssLocation& location) override; ndk::ScopedAStatus deleteAidingData(GnssAidingData aidingDataFlags) override; - ndk::ScopedAStatus setPositionMode(GnssPositionMode mode, GnssPositionRecurrence recurrence, - int minIntervalMs, int preferredAccuracyMeters, - int preferredTimeMs, bool lowPowerMode) override; + ndk::ScopedAStatus setPositionMode(const PositionModeOptions& options) override; ndk::ScopedAStatus getExtensionPsds(std::shared_ptr* iGnssPsds) override; ndk::ScopedAStatus getExtensionGnssConfiguration( diff --git a/gnss/aidl/vts/gnss_hal_test.cpp b/gnss/aidl/vts/gnss_hal_test.cpp index 13c32ee8c4..4828f19f7d 100644 --- a/gnss/aidl/vts/gnss_hal_test.cpp +++ b/gnss/aidl/vts/gnss_hal_test.cpp @@ -79,9 +79,14 @@ void GnssHalTest::SetPositionMode(const int min_interval_msec, const bool low_po const int kPreferredAccuracy = 0; // Ideally perfect (matches GnssLocationProvider) const int kPreferredTimeMsec = 0; // Ideally immediate - auto status = aidl_gnss_hal_->setPositionMode( - IGnss::GnssPositionMode::MS_BASED, IGnss::GnssPositionRecurrence::RECURRENCE_PERIODIC, - min_interval_msec, kPreferredAccuracy, kPreferredTimeMsec, low_power_mode); + IGnss::PositionModeOptions options; + options.mode = IGnss::GnssPositionMode::MS_BASED; + options.recurrence = IGnss::GnssPositionRecurrence::RECURRENCE_PERIODIC; + options.minIntervalMs = min_interval_msec; + options.preferredAccuracyMeters = kPreferredAccuracy; + options.preferredTimeMs = kPreferredTimeMsec; + options.lowPowerMode = low_power_mode; + auto status = aidl_gnss_hal_->setPositionMode(options); ASSERT_TRUE(status.isOk()); } diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 1fa68253c7..1b6948876f 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -1050,10 +1050,9 @@ TEST_P(GnssHalTest, TestGnssAgcInGnssMeasurement) { // Validity check GnssData fields CheckGnssMeasurementClockFields(lastMeasurement); - ASSERT_TRUE(lastMeasurement.gnssAgcs.has_value()); - for (const auto& gnssAgc : lastMeasurement.gnssAgcs.value()) { - ASSERT_TRUE(gnssAgc.has_value()); - ASSERT_TRUE(gnssAgc.value().carrierFrequencyHz >= 0); + ASSERT_TRUE(lastMeasurement.gnssAgcs.size() > 0); + for (const auto& gnssAgc : lastMeasurement.gnssAgcs) { + ASSERT_TRUE(gnssAgc.carrierFrequencyHz >= 0); } } diff --git a/gnss/common/utils/default/Utils.cpp b/gnss/common/utils/default/Utils.cpp index 1ff84eb9a5..122a293b72 100644 --- a/gnss/common/utils/default/Utils.cpp +++ b/gnss/common/utils/default/Utils.cpp @@ -247,8 +247,7 @@ GnssData Utils::getMockMeasurement(const bool enableCorrVecOutputs) { GnssData gnssData = {.measurements = {measurement}, .clock = clock, .elapsedRealtime = timestamp, - .gnssAgcs = std::make_optional(std::vector( - {std::make_optional(gnssAgc1), std::make_optional(gnssAgc2)}))}; + .gnssAgcs = std::vector({gnssAgc1, gnssAgc2})}; return gnssData; } -- GitLab From 05e636413bc3242c1d4413ee55ad740e476dc2ed Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 23 Dec 2021 23:50:20 +0800 Subject: [PATCH 520/825] p2p: support find a specific channel Bug: 159094739 Test: atest VtsHalWifiSupplicantStaIfaceTargetTest \ VtsHalWifiSupplicantStaNetworkTargetTest \ VtsHalWifiSupplicantP2pIfaceTargetTest Change-Id: Ia55b0b13588f9df39a53ccc945c43f2ba7c962f1 --- .../wifi/supplicant/ISupplicantP2pIface.aidl | 2 ++ .../wifi/supplicant/ISupplicantP2pIface.aidl | 34 ++++++++++++++++++- .../supplicant_p2p_iface_aidl_test.cpp | 14 ++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) 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 ca7be7311f..7fdc1f3b31 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 @@ -92,4 +92,6 @@ interface ISupplicantP2pIface { String startWpsPinDisplay(in String groupIfName, in byte[] bssid); void startWpsPinKeypad(in String groupIfName, in String pin); void stopFind(); + void findOnSocialChannels(in int timeoutInSec); + void findOnSpecificFrequency(in int freqInHz, in int timeoutInSec); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl index 64839e7cc8..e26842a75a 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl @@ -237,7 +237,7 @@ interface ISupplicantP2pIface { * Initiate a P2P service discovery with an optional timeout. * * @param timeoutInSec Max time to be spent is performing discovery. - * Set to 0 to indefinely continue discovery until an explicit + * Set to 0 to indefinitely continue discovery until an explicit * |stopFind| is sent. * @throws ServiceSpecificException with one of the following values: * |SupplicantStatusCode.FAILURE_UNKNOWN|, @@ -767,4 +767,36 @@ interface ISupplicantP2pIface { * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| */ void stopFind(); + + /** + * Initiate a P2P device discovery only on social channels. + * + * Full P2P discovery is performed through |ISupplicantP2pIface.find| method. + * + * @param timeoutInSec The maximum amount of time that should be spent in performing device + * discovery. + * Set to 0 to indefinitely continue discovery until an explicit + * |stopFind| is sent. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_IFACE_INVALID| + * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| + */ + void findOnSocialChannels(in int timeoutInSec); + + /** + * Initiate a P2P device discovery on a specific frequency. + * + * Full P2P discovery is performed through |ISupplicantP2pIface.find| method. + * + * @param freqInHz the frequency to be scanned. + * @param timeoutInSec Max time to be spent is performing discovery. + * Set to 0 to indefinitely continue discovery until an explicit + * |stopFind| is sent. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_IFACE_INVALID| + * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| + */ + void findOnSpecificFrequency(in int freqInHz, in int timeoutInSec); } 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 10aab4d414..470a9b017f 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 @@ -480,6 +480,20 @@ TEST_P(SupplicantP2pIfaceAidlTest, Find) { EXPECT_TRUE(p2p_iface_->find(kTestFindTimeout).isOk()); } +/* + * FindSocialChannelsOnly + */ +TEST_P(SupplicantP2pIfaceAidlTest, FindSocialChannelsOnly) { + EXPECT_TRUE(p2p_iface_->findOnSocialChannels(kTestFindTimeout).isOk()); +} + +/* + * FindSpecificFrequency + */ +TEST_P(SupplicantP2pIfaceAidlTest, FindSpecificFrequency) { + EXPECT_TRUE(p2p_iface_->findOnSpecificFrequency(2412, kTestFindTimeout).isOk()); +} + /* * StopFind */ -- GitLab From ef97d23f885d61bb85fa4d9e95633d7b4faf5e5f Mon Sep 17 00:00:00 2001 From: Sunil Ravi Date: Mon, 24 Jan 2022 10:39:56 -0800 Subject: [PATCH 521/825] wifi: Get the supported radio combinations matrix Added API to get the supported radio combinations of the chip. This is mainly to check if the chip is capable of multi band simultaneous operation. 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 Bug: 208877624 Test: vts test Change-Id: I4c90f80002ca138133a575bca80dfdef2a593ab2 --- wifi/1.6/IWifiChip.hal | 31 ++++++ wifi/1.6/default/hidl_struct_util.cpp | 94 ++++++++++++++++ wifi/1.6/default/hidl_struct_util.h | 5 + .../tests/hidl_struct_util_unit_tests.cpp | 102 ++++++++++++++++++ wifi/1.6/default/wifi_chip.cpp | 28 +++++ wifi/1.6/default/wifi_chip.h | 3 + wifi/1.6/default/wifi_legacy_hal.cpp | 14 +++ wifi/1.6/default/wifi_legacy_hal.h | 10 ++ wifi/1.6/default/wifi_legacy_hal_stubs.cpp | 1 + wifi/1.6/types.hal | 50 +++++++++ 10 files changed, 338 insertions(+) diff --git a/wifi/1.6/IWifiChip.hal b/wifi/1.6/IWifiChip.hal index eaa2400466..555ec918ac 100644 --- a/wifi/1.6/IWifiChip.hal +++ b/wifi/1.6/IWifiChip.hal @@ -99,4 +99,35 @@ interface IWifiChip extends @1.5::IWifiChip { getUsableChannels_1_6(WifiBand band, bitfield ifaceModeMask, bitfield filterMask) generates (WifiStatus status, vec channels); + + /** + * Retrieve the list of all the possible radio combinations supported by this + * chip. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.FAILURE_UNKNOWN| + * @return radioCombinationMatrix + * A list of all the possible radio combinations represented by + * |WifiRadioCombinationMatrix|. + * 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 bands, 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). + */ + getSupportedRadioCombinationsMatrix() + generates (WifiStatus status, WifiRadioCombinationMatrix radioCombinationMatrix); }; diff --git a/wifi/1.6/default/hidl_struct_util.cpp b/wifi/1.6/default/hidl_struct_util.cpp index 71f98b9ef5..45459e2cd3 100644 --- a/wifi/1.6/default/hidl_struct_util.cpp +++ b/wifi/1.6/default/hidl_struct_util.cpp @@ -367,6 +367,21 @@ uint32_t convertHidlWifiBandToLegacyMacBand(V1_5::WifiBand hidl_band) { } } +V1_5::WifiBand convertLegacyMacBandToHidlWifiBand(uint32_t band) { + switch (band) { + case legacy_hal::WLAN_MAC_2_4_BAND: + return V1_5::WifiBand::BAND_24GHZ; + case legacy_hal::WLAN_MAC_5_0_BAND: + return V1_5::WifiBand::BAND_5GHZ; + case legacy_hal::WLAN_MAC_6_0_BAND: + return V1_5::WifiBand::BAND_6GHZ; + case legacy_hal::WLAN_MAC_60_0_BAND: + return V1_5::WifiBand::BAND_60GHZ; + default: + return V1_5::WifiBand::BAND_UNSPECIFIED; + } +} + uint32_t convertHidlWifiIfaceModeToLegacy(uint32_t hidl_iface_mask) { uint32_t legacy_iface_mask = 0; if (hidl_iface_mask & V1_5::WifiIfaceMode::IFACE_MODE_STA) { @@ -2905,6 +2920,85 @@ bool convertHidlVectorOfCoexUnsafeChannelToLegacy( return true; } +V1_6::WifiAntennaMode convertLegacyAntennaConfigurationToHidl(uint32_t antenna_cfg) { + switch (antenna_cfg) { + case legacy_hal::WIFI_ANTENNA_1X1: + return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_1X1; + case legacy_hal::WIFI_ANTENNA_2X2: + return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_2X2; + case legacy_hal::WIFI_ANTENNA_3X3: + return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_3X3; + case legacy_hal::WIFI_ANTENNA_4X4: + return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_4X4; + default: + return V1_6::WifiAntennaMode::WIFI_ANTENNA_MODE_UNSPECIFIED; + } +} + +bool convertLegacyWifiRadioConfigurationToHidl( + legacy_hal::wifi_radio_configuration* radio_configuration, + V1_6::WifiRadioConfiguration* hidl_radio_configuration) { + if (!hidl_radio_configuration) { + return false; + } + *hidl_radio_configuration = {}; + hidl_radio_configuration->bandInfo = + hidl_struct_util::convertLegacyMacBandToHidlWifiBand(radio_configuration->band); + if (hidl_radio_configuration->bandInfo == V1_5::WifiBand::BAND_UNSPECIFIED) { + LOG(ERROR) << "Unspecified band"; + return false; + } + hidl_radio_configuration->antennaMode = + hidl_struct_util::convertLegacyAntennaConfigurationToHidl( + radio_configuration->antenna_cfg); + return true; +} + +bool convertLegacyRadioCombinationsMatrixToHidl( + legacy_hal::wifi_radio_combination_matrix* legacy_matrix, + WifiRadioCombinationMatrix* hidl_matrix) { + if (!hidl_matrix || !legacy_matrix) { + return false; + } + *hidl_matrix = {}; + + int num_combinations = legacy_matrix->num_radio_combinations; + std::vector radio_combinations_vec; + if (!num_combinations) { + LOG(ERROR) << "zero radio combinations"; + return false; + } + wifi_radio_combination* l_radio_combinations_ptr = legacy_matrix->radio_combinations; + for (int i = 0; i < num_combinations; i++) { + int num_configurations = l_radio_combinations_ptr->num_radio_configurations; + WifiRadioCombination radioCombination; + std::vector radio_configurations_vec; + if (!num_configurations) { + LOG(ERROR) << "zero radio configurations"; + return false; + } + for (int j = 0; j < num_configurations; j++) { + WifiRadioConfiguration radioConfiguration; + wifi_radio_configuration* l_radio_configurations_ptr = + &l_radio_combinations_ptr->radio_configurations[j]; + if (!hidl_struct_util::convertLegacyWifiRadioConfigurationToHidl( + l_radio_configurations_ptr, &radioConfiguration)) { + LOG(ERROR) << "Error converting wifi radio configuration"; + return false; + } + radio_configurations_vec.push_back(radioConfiguration); + } + radioCombination.radioConfigurations = radio_configurations_vec; + radio_combinations_vec.push_back(radioCombination); + l_radio_combinations_ptr = + (wifi_radio_combination*)((u8*)l_radio_combinations_ptr + + sizeof(wifi_radio_combination) + + (sizeof(wifi_radio_configuration) * num_configurations)); + } + hidl_matrix->radioCombinations = radio_combinations_vec; + return true; +} + } // namespace hidl_struct_util } // namespace implementation } // namespace V1_6 diff --git a/wifi/1.6/default/hidl_struct_util.h b/wifi/1.6/default/hidl_struct_util.h index 26a6ebc85e..2d4a5f13f4 100644 --- a/wifi/1.6/default/hidl_struct_util.h +++ b/wifi/1.6/default/hidl_struct_util.h @@ -74,6 +74,11 @@ bool convertHidlCoexUnsafeChannelToLegacy( bool convertHidlVectorOfCoexUnsafeChannelToLegacy( const std::vector& hidl_unsafe_channels, std::vector* legacy_unsafe_channels); +bool convertLegacyRadioCombinationsMatrixToHidl( + legacy_hal::wifi_radio_combination_matrix* legacy_matrix, + V1_6::WifiRadioCombinationMatrix* hidl_matrix); +V1_5::WifiBand convertLegacyMacBandToHidlWifiBand(uint32_t band); +V1_6::WifiAntennaMode convertLegacyAntennaConfigurationToHidl(uint32_t antenna_cfg); // STA iface conversion methods. bool convertLegacyFeaturesToHidlStaCapabilities(uint64_t legacy_feature_set, diff --git a/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp b/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp index 077c6cc8cd..0dd0aa15bb 100644 --- a/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp +++ b/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp @@ -377,6 +377,108 @@ TEST_F(HidlStructUtilTest, CanConvertLegacyFeaturesToHidl) { HidlChipCaps::SET_LATENCY_MODE | HidlChipCaps::DEBUG_MEMORY_DRIVER_DUMP, hidle_caps); } + +void insertRadioCombination(legacy_hal::wifi_radio_combination* dst_radio_combination_ptr, + int num_radio_configurations, + legacy_hal::wifi_radio_configuration* radio_configuration) { + dst_radio_combination_ptr->num_radio_configurations = num_radio_configurations; + memcpy(dst_radio_combination_ptr->radio_configurations, radio_configuration, + num_radio_configurations * sizeof(legacy_hal::wifi_radio_configuration)); +} + +void verifyRadioCombination(WifiRadioCombination* radioCombination, size_t num_radio_configurations, + legacy_hal::wifi_radio_configuration* radio_configuration) { + EXPECT_EQ(num_radio_configurations, radioCombination->radioConfigurations.size()); + for (size_t i = 0; i < num_radio_configurations; i++) { + EXPECT_EQ(hidl_struct_util::convertLegacyMacBandToHidlWifiBand(radio_configuration->band), + radioCombination->radioConfigurations[i].bandInfo); + EXPECT_EQ(hidl_struct_util::convertLegacyAntennaConfigurationToHidl( + radio_configuration->antenna_cfg), + radioCombination->radioConfigurations[i].antennaMode); + radio_configuration++; + } +} + +TEST_F(HidlStructUtilTest, canConvertLegacyRadioCombinationsMatrixToHidl) { + legacy_hal::wifi_radio_configuration radio_configurations_array1[] = { + {.band = legacy_hal::WLAN_MAC_2_4_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_1X1}, + }; + legacy_hal::wifi_radio_configuration radio_configurations_array2[] = { + {.band = legacy_hal::WLAN_MAC_2_4_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_2X2}, + {.band = legacy_hal::WLAN_MAC_5_0_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_3X3}, + }; + legacy_hal::wifi_radio_configuration radio_configurations_array3[] = { + {.band = legacy_hal::WLAN_MAC_2_4_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_2X2}, + {.band = legacy_hal::WLAN_MAC_6_0_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_1X1}, + {.band = legacy_hal::WLAN_MAC_5_0_BAND, .antenna_cfg = legacy_hal::WIFI_ANTENNA_4X4}, + }; + + int num_radio_configs = 0; + int num_combinations = 0; + std::array buffer; + buffer.fill(0); + legacy_hal::wifi_radio_combination_matrix* legacy_matrix = + reinterpret_cast(buffer.data()); + legacy_hal::wifi_radio_combination* radio_combinations; + + // Prepare a legacy wifi_radio_combination_matrix + legacy_matrix->num_radio_combinations = 3; + // Insert first combination + radio_combinations = + (legacy_hal::wifi_radio_combination*)((char*)legacy_matrix->radio_combinations); + insertRadioCombination( + radio_combinations, + sizeof(radio_configurations_array1) / sizeof(radio_configurations_array1[0]), + radio_configurations_array1); + num_combinations++; + num_radio_configs += + sizeof(radio_configurations_array1) / sizeof(radio_configurations_array1[0]); + + // Insert second combination + radio_combinations = + (legacy_hal::wifi_radio_combination*)((char*)legacy_matrix->radio_combinations + + (num_combinations * + sizeof(legacy_hal::wifi_radio_combination)) + + (num_radio_configs * + sizeof(wifi_radio_configuration))); + insertRadioCombination( + radio_combinations, + sizeof(radio_configurations_array2) / sizeof(radio_configurations_array2[0]), + radio_configurations_array2); + num_combinations++; + num_radio_configs += + sizeof(radio_configurations_array2) / sizeof(radio_configurations_array2[0]); + + // Insert third combination + radio_combinations = + (legacy_hal::wifi_radio_combination*)((char*)legacy_matrix->radio_combinations + + (num_combinations * + sizeof(legacy_hal::wifi_radio_combination)) + + (num_radio_configs * + sizeof(wifi_radio_configuration))); + insertRadioCombination( + radio_combinations, + sizeof(radio_configurations_array3) / sizeof(radio_configurations_array3[0]), + radio_configurations_array3); + + V1_6::WifiRadioCombinationMatrix converted_matrix{}; + hidl_struct_util::convertLegacyRadioCombinationsMatrixToHidl(legacy_matrix, &converted_matrix); + + // Verify the conversion + EXPECT_EQ(legacy_matrix->num_radio_combinations, converted_matrix.radioCombinations.size()); + verifyRadioCombination( + &converted_matrix.radioCombinations[0], + sizeof(radio_configurations_array1) / sizeof(radio_configurations_array1[0]), + radio_configurations_array1); + verifyRadioCombination( + &converted_matrix.radioCombinations[1], + sizeof(radio_configurations_array2) / sizeof(radio_configurations_array2[0]), + radio_configurations_array2); + verifyRadioCombination( + &converted_matrix.radioCombinations[2], + sizeof(radio_configurations_array3) / sizeof(radio_configurations_array3[0]), + radio_configurations_array3); +} } // namespace implementation } // namespace V1_6 } // namespace wifi diff --git a/wifi/1.6/default/wifi_chip.cpp b/wifi/1.6/default/wifi_chip.cpp index a1857246a7..4fff770dd2 100644 --- a/wifi/1.6/default/wifi_chip.cpp +++ b/wifi/1.6/default/wifi_chip.cpp @@ -722,6 +722,12 @@ Return WifiChip::getUsableChannels_1_6( filterMask); } +Return WifiChip::getSupportedRadioCombinationsMatrix( + getSupportedRadioCombinationsMatrix_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getSupportedRadioCombinationsMatrixInternal, hidl_status_cb); +} + void WifiChip::invalidateAndRemoveAllIfaces() { invalidateAndClearBridgedApAll(); invalidateAndClearAll(ap_ifaces_); @@ -1461,6 +1467,28 @@ std::pair> WifiChip::getUsableC return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_usable_channels}; } +std::pair +WifiChip::getSupportedRadioCombinationsMatrixInternal() { + legacy_hal::wifi_error legacy_status; + legacy_hal::wifi_radio_combination_matrix* legacy_matrix; + + std::tie(legacy_status, legacy_matrix) = + legacy_hal_.lock()->getSupportedRadioCombinationsMatrix(); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + LOG(ERROR) << "Failed to get SupportedRadioCombinations matrix from legacy HAL: " + << legacyErrorToString(legacy_status); + return {createWifiStatusFromLegacyError(legacy_status), {}}; + } + + V1_6::WifiRadioCombinationMatrix hidl_matrix; + if (!hidl_struct_util::convertLegacyRadioCombinationsMatrixToHidl(legacy_matrix, + &hidl_matrix)) { + LOG(ERROR) << "Failed convertLegacyRadioCombinationsMatrixToHidl() "; + return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), {}}; + } + return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_matrix}; +} + WifiStatus WifiChip::handleChipConfiguration( /* NONNULL */ std::unique_lock* lock, ChipModeId mode_id) { // If the chip is already configured in a different mode, stop diff --git a/wifi/1.6/default/wifi_chip.h b/wifi/1.6/default/wifi_chip.h index 61ac03da83..13d62fb8dc 100644 --- a/wifi/1.6/default/wifi_chip.h +++ b/wifi/1.6/default/wifi_chip.h @@ -160,6 +160,8 @@ class WifiChip : public V1_6::IWifiChip { hidl_bitfield ifaceModeMask, hidl_bitfield filterMask, getUsableChannels_1_6_cb _hidl_cb) override; + Return getSupportedRadioCombinationsMatrix( + getSupportedRadioCombinationsMatrix_cb hidl_status_cb) override; private: void invalidateAndRemoveAllIfaces(); @@ -267,6 +269,7 @@ class WifiChip : public V1_6::IWifiChip { const sp& bound_iface); std::pair> getUsableChannelsInternal_1_6( WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask); + std::pair getSupportedRadioCombinationsMatrixInternal(); ChipId chip_id_; std::weak_ptr legacy_hal_; diff --git a/wifi/1.6/default/wifi_legacy_hal.cpp b/wifi/1.6/default/wifi_legacy_hal.cpp index 64dde9576e..b006e4596e 100644 --- a/wifi/1.6/default/wifi_legacy_hal.cpp +++ b/wifi/1.6/default/wifi_legacy_hal.cpp @@ -37,6 +37,7 @@ static constexpr uint32_t kLinkLayerStatsDataMpduSizeThreshold = 128; static constexpr uint32_t kMaxWakeReasonStatsArraySize = 32; static constexpr uint32_t kMaxRingBuffers = 10; static constexpr uint32_t kMaxWifiUsableChannels = 256; +static constexpr uint32_t kMaxSupportedRadioCombinationsMatrixLength = 256; // need a long timeout (1000ms) for chips that unload their driver. static constexpr uint32_t kMaxStopCompleteWaitMs = 1000; static constexpr char kDriverPropName[] = "wlan.driver.status"; @@ -1537,6 +1538,19 @@ wifi_error WifiLegacyHal::setIndoorState(bool isIndoor) { return global_func_table_.wifi_set_indoor_state(global_handle_, isIndoor); } +std::pair +WifiLegacyHal::getSupportedRadioCombinationsMatrix() { + std::array buffer; + buffer.fill(0); + uint32_t size = 0; + wifi_radio_combination_matrix* radio_combination_matrix_ptr = + reinterpret_cast(buffer.data()); + wifi_error status = global_func_table_.wifi_get_supported_radio_combinations_matrix( + global_handle_, buffer.size(), &size, radio_combination_matrix_ptr); + CHECK(size >= 0 && size <= kMaxSupportedRadioCombinationsMatrixLength); + return {status, radio_combination_matrix_ptr}; +} + void WifiLegacyHal::invalidate() { global_handle_ = nullptr; iface_name_to_handle_.clear(); diff --git a/wifi/1.6/default/wifi_legacy_hal.h b/wifi/1.6/default/wifi_legacy_hal.h index 1d85d2e0b1..638bfa1598 100644 --- a/wifi/1.6/default/wifi_legacy_hal.h +++ b/wifi/1.6/default/wifi_legacy_hal.h @@ -204,6 +204,11 @@ using ::WIFI_AC_BE; using ::WIFI_AC_BK; using ::WIFI_AC_VI; using ::WIFI_AC_VO; +using ::WIFI_ANTENNA_1X1; +using ::WIFI_ANTENNA_2X2; +using ::WIFI_ANTENNA_3X3; +using ::WIFI_ANTENNA_4X4; +using ::WIFI_ANTENNA_UNSPECIFIED; using ::wifi_band; using ::WIFI_BAND_A; using ::WIFI_BAND_A_DFS; @@ -281,6 +286,9 @@ using ::WIFI_POWER_SCENARIO_ON_BODY_CELL_ON; using ::WIFI_POWER_SCENARIO_ON_HEAD_CELL_OFF; using ::WIFI_POWER_SCENARIO_ON_HEAD_CELL_ON; using ::WIFI_POWER_SCENARIO_VOICE_CALL; +using ::wifi_radio_combination; +using ::wifi_radio_combination_matrix; +using ::wifi_radio_configuration; using ::wifi_rate; using ::wifi_request_id; using ::wifi_ring_buffer_status; @@ -660,6 +668,8 @@ class WifiLegacyHal { wifi_error setIndoorState(bool isIndoor); + std::pair getSupportedRadioCombinationsMatrix(); + private: // Retrieve interface handles for all the available interfaces. wifi_error retrieveIfaceHandles(); diff --git a/wifi/1.6/default/wifi_legacy_hal_stubs.cpp b/wifi/1.6/default/wifi_legacy_hal_stubs.cpp index 7e66fab863..05a27cf33e 100644 --- a/wifi/1.6/default/wifi_legacy_hal_stubs.cpp +++ b/wifi/1.6/default/wifi_legacy_hal_stubs.cpp @@ -162,6 +162,7 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) { populateStubFor(&hal_fn->wifi_get_usable_channels); populateStubFor(&hal_fn->wifi_trigger_subsystem_restart); populateStubFor(&hal_fn->wifi_set_indoor_state); + populateStubFor(&hal_fn->wifi_get_supported_radio_combinations_matrix); return true; } } // namespace legacy_hal diff --git a/wifi/1.6/types.hal b/wifi/1.6/types.hal index ef6965d4cf..80fdbd1541 100644 --- a/wifi/1.6/types.hal +++ b/wifi/1.6/types.hal @@ -46,6 +46,7 @@ import @1.0::WifiRateNss; import @1.4::RttPreamble; import @1.4::WifiRatePreamble; import @1.5::NanConfigRequestSupplemental; +import @1.5::WifiBand; import @1.5::StaLinkLayerIfaceContentionTimeStats; import @1.5::WifiIfaceMode; @@ -86,6 +87,17 @@ enum WifiRatePreamble : @1.4::WifiRatePreamble { EHT = 6, }; +/** + * Antenna configuration + */ +enum WifiAntennaMode : uint32_t { + WIFI_ANTENNA_MODE_UNSPECIFIED = 0, + WIFI_ANTENNA_MODE_1X1 = 1, + WIFI_ANTENNA_MODE_2X2 = 2, + WIFI_ANTENNA_MODE_3X3 = 3, + WIFI_ANTENNA_MODE_4X4 = 4, +}; + /** * Channel information. */ @@ -1262,3 +1274,41 @@ struct NanCapabilities { */ bool instantCommunicationModeSupportFlag; }; + +/** + * Wifi radio configuration + */ +struct WifiRadioConfiguration { + /** + * Band on which this radio chain is operating. + * Valid values of bandInfo are: BAND_24GHZ, BAND_5GHZ, BAND_6GHZ and + * BAND_60GHZ. + * + */ + WifiBand bandInfo; + + /** + * Wifi Antenna configuration. + */ + WifiAntennaMode antennaMode; +}; + +/** + * Wifi radio combination + */ +struct WifiRadioCombination { + /** + * A list of radio configurations in this combination. + */ + vec radioConfigurations; +}; + +/** + * Wifi radio combinations matrix retrieved via |getSupportedRadioCombinationsMatrix|. + */ +struct WifiRadioCombinationMatrix { + /** + * A list of all the possible radio combinations that the chip can operate. + */ + vec radioCombinations; +}; -- GitLab From 8d34c5179c1cc9eeb8eb21190e3c6e1a0f05a2f5 Mon Sep 17 00:00:00 2001 From: Mia Date: Thu, 2 Dec 2021 05:52:01 +0000 Subject: [PATCH 522/825] wifi: add an api route for removing a P2P client Bug: 159098347 Test: atest FrameworksWifiTests Change-Id: I83b1febb6e56965806a4cc18c0eba9520cce6ce3 --- .../hardware/wifi/supplicant/ISupplicantP2pIface.aidl | 1 + .../hardware/wifi/supplicant/ISupplicantP2pIface.aidl | 11 +++++++++++ 2 files changed, 12 insertions(+) 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 ca7be7311f..f1332d905d 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 @@ -81,6 +81,7 @@ interface ISupplicantP2pIface { void setSsidPostfix(in byte[] postfix); void setWfdDeviceInfo(in byte[] info); void setWfdR2DeviceInfo(in byte[] info); + void removeClient(in byte[] peerAddress, in boolean isLegacyClient); void setWpsConfigMethods(in android.hardware.wifi.supplicant.WpsConfigMethods configMethods); void setWpsDeviceName(in String name); void setWpsDeviceType(in byte[] type); diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl index 64839e7cc8..11cdc8b71e 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl @@ -642,6 +642,17 @@ interface ISupplicantP2pIface { */ void setWfdR2DeviceInfo(in byte[] info); + /** + * Remove the client with the MAC address from the group. + * + * @param peerAddress Mac address of the client. + * @param isLegacyClient Indicate if client is a legacy client or not. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_IFACE_INVALID| + */ + void removeClient(in byte[/*6*/] peerAddress, in boolean isLegacyClient); + /** * Set the list of supported config methods for WPS operations. * -- GitLab From d40304b574e19a7a458e365d4b8bdf495363179b Mon Sep 17 00:00:00 2001 From: ramindani Date: Tue, 14 Dec 2021 16:48:42 +0000 Subject: [PATCH 523/825] composer: adds BufferAhead for the LayerCommand.aidl Adds a Capability param as BUFFER_AHEAD to check if BufferAhead is supported. Test: Device boots after these changes. BUG: 198186628 Change-Id: Ic0f3e602635a2519f4e90c546dfca1af985116f9 --- .../graphics/composer3/BufferAheadResult.aidl | 44 ++++++++++++++++++ .../graphics/composer3/Capability.aidl | 1 + .../composer3/CommandResultPayload.aidl | 1 + .../graphics/composer3/LayerCommand.aidl | 1 + .../graphics/composer3/BufferAheadResult.aidl | 46 +++++++++++++++++++ .../graphics/composer3/Capability.aidl | 5 ++ .../composer3/CommandResultPayload.aidl | 8 ++++ .../graphics/composer3/LayerCommand.aidl | 24 ++++++++++ .../VtsHalGraphicsComposer3_TargetTest.cpp | 1 + .../graphics/composer3/ComposerClientReader.h | 20 ++++++++ .../graphics/composer3/ComposerClientWriter.h | 5 ++ 11 files changed, 156 insertions(+) create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BufferAheadResult.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/BufferAheadResult.aidl diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BufferAheadResult.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BufferAheadResult.aidl new file mode 100644 index 0000000000..94fd91b2fa --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BufferAheadResult.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 -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 BufferAheadResult { + long display; + android.hardware.graphics.composer3.BufferAheadResult.Layer[] layers; + @VintfStability + parcelable Layer { + long layer; + boolean presented; + } +} 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 9c49583fd2..e989b6c24d 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 @@ -39,4 +39,5 @@ enum Capability { SKIP_CLIENT_COLOR_TRANSFORM = 2, PRESENT_FENCE_IS_NOT_RELIABLE = 3, SKIP_VALIDATE = 4, + BUFFER_AHEAD = 5, } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl index ebbb31e59f..fb39172dd9 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl @@ -39,6 +39,7 @@ union CommandResultPayload { android.hardware.graphics.composer3.DisplayRequest displayRequest; android.hardware.graphics.composer3.PresentFence presentFence; android.hardware.graphics.composer3.ReleaseFences releaseFences; + android.hardware.graphics.composer3.BufferAheadResult bufferAheadResult; android.hardware.graphics.composer3.PresentOrValidate presentOrValidateResult; android.hardware.graphics.composer3.ClientTargetPropertyWithNits clientTargetProperty; } 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 c1c01172c1..1429c3511f 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 @@ -37,6 +37,7 @@ parcelable LayerCommand { long layer; @nullable android.hardware.graphics.common.Point cursorPosition; @nullable android.hardware.graphics.composer3.Buffer buffer; + @nullable android.hardware.graphics.composer3.Buffer bufferAhead; @nullable android.hardware.graphics.common.Rect[] damage; @nullable android.hardware.graphics.composer3.ParcelableBlendMode blendMode; @nullable android.hardware.graphics.composer3.Color color; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/BufferAheadResult.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/BufferAheadResult.aidl new file mode 100644 index 0000000000..7ca45784ec --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/BufferAheadResult.aidl @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +parcelable BufferAheadResult { + /** + * The display which this commands refers to. + * @see IComposer.createDisplay + */ + long display; + + @VintfStability + parcelable Layer { + /** + * The layer which this commands refers to. + * @see IComposer.createLayer + */ + long layer; + + /** + * Represents whether BufferAhead was presented as part of the last + * present or not. + */ + boolean presented; + } + + /** + * The layers which has BufferAheadResult populated. + */ + Layer[] layers; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl index ea619aeaf3..77ad1e0645 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl @@ -57,4 +57,9 @@ enum Capability { * validateDisplay step is needed. */ SKIP_VALIDATE = 4, + /** + * Specifies that a device is able to use the LayerCommand.bufferAhead + * when provided. + */ + BUFFER_AHEAD = 5 } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl index f2de68e025..fd1e4cc30b 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl @@ -16,6 +16,7 @@ package android.hardware.graphics.composer3; +import android.hardware.graphics.composer3.BufferAheadResult; import android.hardware.graphics.composer3.ChangedCompositionTypes; import android.hardware.graphics.composer3.ClientTargetPropertyWithNits; import android.hardware.graphics.composer3.CommandError; @@ -77,6 +78,13 @@ union CommandResultPayload { */ ReleaseFences releaseFences; + /** + * Represents the result of the LayerCommand.bufferAhead that was + * sent in the last presentDisplay call. That is, the presentDisplay + * call prior to this presentDisplay. + */ + BufferAheadResult bufferAheadResult; + /** * Sets the state of PRESENT_OR_VALIDATE_DISPLAY command. */ diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index 0a2711b056..b7b45e287d 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl @@ -78,6 +78,30 @@ parcelable LayerCommand { */ @nullable Buffer buffer; + /** + * Sets a buffer handle to be displayed for this layer and a file descriptor + * referring to an acquire sync fence object, which must be signaled when it is + * safe to read from the given buffer. + * + * When bufferAhead is provided, the implementation should try to + * present it on the next scanout as long as its acquire sync fence + * is signaled by that time. Otherwise the bufferAhead should be dropped. + * This allows the client to set an + * unsignaled buffer on the layer without causing the entire display to miss + * an update if the buffer is not ready by the next scanout time. + * + * In case bufferAhead is dropped and LayerCommand.buffer is provided, LayerCommand.buffer + * should be used as the next layer buffer. + * + * The implementation is expected to populate the CommandResultPayload.bufferAheadResult + * with information about whether bufferAhead was presented or dropped. + * Since this information is not known at the current presentDisplay call + * of frame N (as the scanout happens after the call returns), + * the implementation should populate it when presentDisplay is + * called for frame N+1. + */ + @nullable Buffer bufferAhead; + /** * Provides the region of the source buffer which has been modified since * the last frame. This region does not need to be validated before diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 1c75749f21..f5e54313d4 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1197,6 +1197,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { const auto errors = mReader.takeErrors(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()); + ASSERT_TRUE(mReader.takeBufferAheadResultLayers(mPrimaryDisplay).empty()); ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::TearDown()); } diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h index f9e35e94e0..8f8c98f7f0 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h @@ -77,6 +77,10 @@ class ComposerClientReader { parseSetClientTargetProperty(std::move( result.get())); break; + case CommandResultPayload::Tag::bufferAheadResult: + parseSetBufferAheadResultLayers( + result.get()); + break; } } } @@ -168,6 +172,16 @@ class ComposerClientReader { return std::move(data.clientTargetProperty); } + std::vector takeBufferAheadResultLayers(int64_t display) { + const auto found = mReturnData.find(display); + + if (found == mReturnData.end()) { + return {}; + } + + return std::move(found->second.bufferAheadResultLayers); + } + private: void resetData() { mErrors.clear(); @@ -206,12 +220,18 @@ class ComposerClientReader { data.clientTargetProperty = std::move(clientTargetProperty); } + void parseSetBufferAheadResultLayers(const BufferAheadResult& bufferAheadResult) { + auto& data = mReturnData[bufferAheadResult.display]; + data.bufferAheadResultLayers = std::move(bufferAheadResult.layers); + } + struct ReturnData { DisplayRequest displayRequests; std::vector changedLayers; ndk::ScopedFileDescriptor presentFence; std::vector releasedLayers; PresentOrValidate::Result presentOrValidateState; + std::vector bufferAheadResultLayers; ClientTargetPropertyWithNits clientTargetProperty = { .clientTargetProperty = {common::PixelFormat::RGBA_8888, Dataspace::UNKNOWN}, 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 d3266e7623..d429b76f63 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -131,6 +131,11 @@ class ComposerClientWriter { getLayerCommand(display, layer).buffer = getBuffer(slot, buffer, acquireFence); } + void setLayerBufferAhead(int64_t display, int64_t layer, uint32_t slot, + const native_handle_t* buffer, int acquireFence) { + getLayerCommand(display, layer).bufferAhead = getBuffer(slot, buffer, acquireFence); + } + void setLayerSurfaceDamage(int64_t display, int64_t layer, const std::vector& damage) { getLayerCommand(display, layer).damage.emplace(damage.begin(), damage.end()); } -- GitLab From 5b8529a1da6a2fe9c5732215dd29b337da88e7ac Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 27 Jan 2022 11:50:46 +0100 Subject: [PATCH 524/825] audio: add new enums for 7.1 HAL Add the following enums to 7.1 audio HAL: - Spatial audio: spatializer output flag front wide channel masks - Bluetooth LE broadcast audio device Bug: 187446271 Test: m android.hardware.audio.common@7.1-enums Change-Id: I9bfb937ece3a07a7844877de5f355ece1141f92d --- audio/7.1/config/api/current.txt | 4 ++++ audio/7.1/config/audio_policy_configuration.xsd | 4 ++++ .../include/android_audio_policy_configuration_V7_1-enums.h | 3 +++ 3 files changed, 11 insertions(+) diff --git a/audio/7.1/config/api/current.txt b/audio/7.1/config/api/current.txt index 01c2e4bbd5..0a0eb02e19 100644 --- a/audio/7.1/config/api/current.txt +++ b/audio/7.1/config/api/current.txt @@ -62,6 +62,8 @@ package android.audio.policy.configuration.V7_1 { enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_7POINT1; enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_7POINT1POINT2; enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_7POINT1POINT4; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_9POINT1POINT4; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_9POINT1POINT6; enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_HAPTIC_AB; enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_MONO; enum_constant public static final android.audio.policy.configuration.V7_1.AudioChannelMask AUDIO_CHANNEL_OUT_MONO_HAPTIC_A; @@ -125,6 +127,7 @@ package android.audio.policy.configuration.V7_1 { enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET; enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_AUX_DIGITAL; enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_AUX_LINE; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLE_BROADCAST; enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLE_HEADSET; enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLE_SPEAKER; enum_constant public static final android.audio.policy.configuration.V7_1.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_A2DP; @@ -284,6 +287,7 @@ package android.audio.policy.configuration.V7_1 { enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_NON_BLOCKING; enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_PRIMARY; enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_RAW; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_SPATIALIZER; enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_SYNC; enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_TTS; enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_VOIP_RX; diff --git a/audio/7.1/config/audio_policy_configuration.xsd b/audio/7.1/config/audio_policy_configuration.xsd index 731bb7c75f..defb50651d 100644 --- a/audio/7.1/config/audio_policy_configuration.xsd +++ b/audio/7.1/config/audio_policy_configuration.xsd @@ -179,6 +179,7 @@ + @@ -276,6 +277,7 @@ + @@ -510,6 +512,8 @@ + + diff --git a/audio/common/7.1/enums/include/android_audio_policy_configuration_V7_1-enums.h b/audio/common/7.1/enums/include/android_audio_policy_configuration_V7_1-enums.h index 815f869e93..6f6a0ca0c1 100644 --- a/audio/common/7.1/enums/include/android_audio_policy_configuration_V7_1-enums.h +++ b/audio/common/7.1/enums/include/android_audio_policy_configuration_V7_1-enums.h @@ -97,10 +97,12 @@ static inline size_t getChannelCount(AudioChannelMask mask) { case AudioChannelMask::AUDIO_CHANNEL_OUT_13POINT_360RA: case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_13: return 13; + case AudioChannelMask::AUDIO_CHANNEL_OUT_9POINT1POINT4: case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_14: return 14; case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_15: return 15; + case AudioChannelMask::AUDIO_CHANNEL_OUT_9POINT1POINT6: case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_16: return 16; case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_17: @@ -170,6 +172,7 @@ static inline bool isOutputDevice(AudioDevice device) { case AudioDevice::AUDIO_DEVICE_OUT_ECHO_CANCELLER: case AudioDevice::AUDIO_DEVICE_OUT_BLE_HEADSET: case AudioDevice::AUDIO_DEVICE_OUT_BLE_SPEAKER: + case AudioDevice::AUDIO_DEVICE_OUT_BLE_BROADCAST: case AudioDevice::AUDIO_DEVICE_OUT_DEFAULT: case AudioDevice::AUDIO_DEVICE_OUT_STUB: return true; -- GitLab From 040984fd449ae13ad5a9908e84c0848afbdd8aa2 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 27 Jan 2022 15:07:15 +0100 Subject: [PATCH 525/825] Audio HAL V7.1: Add latency mode APIs Add APis for controlling the latency mode on an output stream. Latency mode control is optional but mandated if spatial audio with head tracking is supported over Bluetooth classic audio link. Bug: 187446271 Test: m android.hardware.audio@7.1-impl Change-Id: I363db3bf7f7b6439e326d0f6f4becc10b3947e7d --- audio/7.1/Android.bp | 2 + audio/7.1/IStreamOut.hal | 47 +++++++++++++ audio/7.1/IStreamOutLatencyModeCallback.hal | 28 ++++++++ audio/7.1/types.hal | 30 +++++++++ audio/core/all-versions/default/StreamOut.cpp | 67 +++++++++++++++++++ .../default/include/core/default/StreamOut.h | 12 ++++ 6 files changed, 186 insertions(+) create mode 100644 audio/7.1/IStreamOutLatencyModeCallback.hal create mode 100644 audio/7.1/types.hal diff --git a/audio/7.1/Android.bp b/audio/7.1/Android.bp index d0d96b6cf6..52980e2626 100644 --- a/audio/7.1/Android.bp +++ b/audio/7.1/Android.bp @@ -13,11 +13,13 @@ hidl_interface { name: "android.hardware.audio@7.1", root: "android.hardware", srcs: [ + "types.hal", "IDevice.hal", "IDevicesFactory.hal", "IPrimaryDevice.hal", "IStreamIn.hal", "IStreamOut.hal", + "IStreamOutLatencyModeCallback.hal", ], interfaces: [ "android.hardware.audio@7.0", diff --git a/audio/7.1/IStreamOut.hal b/audio/7.1/IStreamOut.hal index 092a9a0f40..b2013cff8c 100644 --- a/audio/7.1/IStreamOut.hal +++ b/audio/7.1/IStreamOut.hal @@ -16,7 +16,54 @@ package android.hardware.audio@7.1; +import @7.0::Result; import @7.0::IStreamOut; +import IStreamOutLatencyModeCallback; + interface IStreamOut extends @7.0::IStreamOut { + /** + * Indicates the requested latency mode for this output stream. + * + * The requested mode can be one of the modes returned by + * getRecommendedLatencyModes() API. + * + * Optional method. + * Mandated only on specific spatial audio streams indicated by + * AUDIO_OUTPUT_FLAG_SPATIALIZER flag if they can be routed to a BT classic sink. + * + * @return retval operation completion status. + */ + setLatencyMode(LatencyMode mode) generates (Result retval); + + /** + * Indicates which latency modes are currently supported on this output stream. + * If the transport protocol (e.g Bluetooth A2DP) used by this output stream to reach + * the output device supports variable latency modes, the HAL indicates which + * modes are currently supported. + * The framework can then call setLatencyMode() with one of the supported modes to select + * the desired operation mode. + * + * Optional method. + * Mandated only on specific spatial audio streams indicated by + * AUDIO_OUTPUT_FLAG_SPATIALIZER flag if they can be routed to a BT classic sink. + * + * @return retval operation completion status. + * @return modes currrently supported latency modes. + */ + getRecommendedLatencyModes() generates (Result retval, vec modes); + + /** + * Set the callback interface for notifying changes in supported latency modes. + * + * Calling this method with a null pointer will result in releasing + * the callback. + * + * Optional method. + * Mandated only on specific spatial audio streams indicated by + * AUDIO_OUTPUT_FLAG_SPATIALIZER flag if they can be routed to a BT classic sink. + * + * @return retval operation completion status. + */ + setLatencyModeCallback(IStreamOutLatencyModeCallback callback) generates (Result retval); }; diff --git a/audio/7.1/IStreamOutLatencyModeCallback.hal b/audio/7.1/IStreamOutLatencyModeCallback.hal new file mode 100644 index 0000000000..45b453f12f --- /dev/null +++ b/audio/7.1/IStreamOutLatencyModeCallback.hal @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package android.hardware.audio@7.1; + +/** + * Callback interface for output stream variable latency mode feature. + */ +interface IStreamOutLatencyModeCallback { + /** + * Called with the new list of supported latency modes when a change occurs. + */ + oneway onRecommendedLatencyModeChanged(vec modes); +}; diff --git a/audio/7.1/types.hal b/audio/7.1/types.hal new file mode 100644 index 0000000000..9d8ee4def2 --- /dev/null +++ b/audio/7.1/types.hal @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.audio@7.1; + +/** + * Latency modes used for the variable latency feature on output streams. + * Used by setLatencyMode() and getRecommendedLatencyModes() methods. + */ + +@export(name="audio_latency_mode_t", value_prefix="AUDIO_LATENCY_MODE_") +enum LatencyMode : int32_t { + /** No specific constraint on the latency */ + FREE = 0, + /** A relatively low latency compatible with head tracking operation (e.g less than 100ms) */ + LOW = 1, +}; diff --git a/audio/core/all-versions/default/StreamOut.cpp b/audio/core/all-versions/default/StreamOut.cpp index d4a89d7bf9..09df4ed43d 100644 --- a/audio/core/all-versions/default/StreamOut.cpp +++ b/audio/core/all-versions/default/StreamOut.cpp @@ -761,6 +761,73 @@ int StreamOut::asyncEventCallback(stream_event_callback_type_t event, void* para ALOGW_IF(!result.isOk(), "Client callback failed: %s", result.description().c_str()); return 0; } + +#if MAJOR_VERSION == 7 && MINOR_VERSION == 1 +Return StreamOut::setLatencyMode(LatencyMode mode) { + return mStream->set_latency_mode != nullptr + ? Stream::analyzeStatus( + "set_latency_mode", + mStream->set_latency_mode(mStream, + static_cast(mode))) + : Result::NOT_SUPPORTED; +}; + +Return StreamOut::getRecommendedLatencyModes(getRecommendedLatencyModes_cb _hidl_cb) { + Result retval = Result::NOT_SUPPORTED; + hidl_vec hidlModes; + size_t num_modes = AUDIO_LATENCY_MODE_CNT; + audio_latency_mode_t modes[AUDIO_LATENCY_MODE_CNT]; + + if (mStream->get_recommended_latency_modes != nullptr && + mStream->get_recommended_latency_modes(mStream, &modes[0], &num_modes) == 0) { + if (num_modes == 0 || num_modes > AUDIO_LATENCY_MODE_CNT) { + ALOGW("%s invalid number of modes returned: %zu", __func__, num_modes); + retval = Result::INVALID_STATE; + } else { + hidlModes.resize(num_modes); + for (size_t i = 0; i < num_modes; ++i) { + hidlModes[i] = static_cast(modes[i]); + } + retval = Result::OK; + } + } + _hidl_cb(retval, hidlModes); + return Void(); +}; + +// static +void StreamOut::latencyModeCallback(audio_latency_mode_t* modes, size_t num_modes, void* cookie) { + StreamOut* self = reinterpret_cast(cookie); + sp callback = self->mLatencyModeCallback.load(); + if (callback.get() == nullptr) return; + + ALOGV("%s", __func__); + + if (num_modes == 0 || num_modes > AUDIO_LATENCY_MODE_CNT) { + ALOGW("%s invalid number of modes returned: %zu", __func__, num_modes); + return; + } + + hidl_vec hidlModes(num_modes); + for (size_t i = 0; i < num_modes; ++i) { + hidlModes[i] = static_cast(modes[i]); + } + Return result = callback->onRecommendedLatencyModeChanged(hidlModes); + ALOGW_IF(!result.isOk(), "Client callback failed: %s", result.description().c_str()); +} + +Return StreamOut::setLatencyModeCallback( + const sp& callback) { + if (mStream->set_latency_mode_callback == nullptr) return Result::NOT_SUPPORTED; + int result = mStream->set_latency_mode_callback(mStream, StreamOut::latencyModeCallback, this); + if (result == 0) { + mLatencyModeCallback = callback; + } + return Stream::analyzeStatus("set_latency_mode_callback", result, {ENOSYS} /*ignore*/); +}; + +#endif + #endif } // namespace implementation diff --git a/audio/core/all-versions/default/include/core/default/StreamOut.h b/audio/core/all-versions/default/include/core/default/StreamOut.h index 60ad5d5ea1..ce5253fe79 100644 --- a/audio/core/all-versions/default/include/core/default/StreamOut.h +++ b/audio/core/all-versions/default/include/core/default/StreamOut.h @@ -153,6 +153,12 @@ struct StreamOut : public IStreamOut { Result doUpdateSourceMetadata(const SourceMetadata& sourceMetadata); #if MAJOR_VERSION >= 7 Result doUpdateSourceMetadataV7(const SourceMetadata& sourceMetadata); +#if MAJOR_VERSION == 7 && MINOR_VERSION == 1 + Return setLatencyMode(LatencyMode mode) override; + Return getRecommendedLatencyModes(getRecommendedLatencyModes_cb _hidl_cb) override; + Return setLatencyModeCallback( + const sp& callback) override; +#endif #endif #endif // MAJOR_VERSION >= 4 @@ -163,6 +169,9 @@ struct StreamOut : public IStreamOut { mediautils::atomic_sp mCallback; // for non-blocking write and drain #if MAJOR_VERSION >= 6 mediautils::atomic_sp mEventCallback; +#if MAJOR_VERSION == 7 && MINOR_VERSION == 1 + mediautils::atomic_sp mLatencyModeCallback; +#endif #endif std::unique_ptr mCommandMQ; std::unique_ptr mDataMQ; @@ -177,6 +186,9 @@ struct StreamOut : public IStreamOut { #if MAJOR_VERSION >= 6 static int asyncEventCallback(stream_event_callback_type_t event, void* param, void* cookie); +#if MAJOR_VERSION == 7 && MINOR_VERSION == 1 + static void latencyModeCallback(audio_latency_mode_t* modes, size_t num_modes, void* cookie); +#endif #endif }; -- GitLab From ac1125cb984b8bd32193adfc56700cbcb2758fc3 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Thu, 27 Jan 2022 21:13:43 +0000 Subject: [PATCH 526/825] composer3: update cursorPosition documentation Remove the word asynchronous and insteam explain that the cursor position can be updated without a validate/present. Change-Id: Ia01bc097bc335779dba4e06577c285ca133dfd02 Fixes: 209711877 Test: make --- .../graphics/composer3/LayerCommand.aidl | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index 0a2711b056..6f6894fcdd 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl @@ -41,20 +41,11 @@ parcelable LayerCommand { long layer; /** - * Asynchronously sets the position of a cursor layer. + * Sets the position of a cursor layer. * - * Prior to validateDisplay, a layer may be marked as Composition.CURSOR. - * If validation succeeds (i.e., the device does not request a composition - * change for that layer), then once a buffer has been set for the layer - * and it has been presented, its position may be set by this function at - * any time between presentDisplay and any subsequent validateDisplay - * calls for this display. - * - * Once validateDisplay is called, this function must not be called again - * until the validate/present sequence is completed. - * - * May be called from any thread so long as it is not interleaved with the - * validate/present sequence as described above. + * The position of a cursor layer can be updated without a validate/present display + * sequence if that layer was marked as Composition.CURSOR and validation previously succeeded + * (i.e., the device didn't request a composition). */ @nullable Point cursorPosition; -- GitLab From 19c2d9b2c4947327da6b31e6c9ae4df595aeb1af Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Fri, 14 Jan 2022 14:45:30 -0800 Subject: [PATCH 527/825] Add ephSource, toc, toe, IODC, IODE to SatellitePvt (hardware/interfaces) Bug: 206670536 Test: atest VtsHalGnssTargetTest Change-Id: I564e9e0f48d5a22d40f103286d0d7553006be1de --- .../android/hardware/gnss/IGnssDebug.aidl | 9 +-- .../android/hardware/gnss/SatellitePvt.aidl | 12 ++++ .../android/hardware/gnss/IGnssDebug.aidl | 11 +--- .../android/hardware/gnss/SatellitePvt.aidl | 58 +++++++++++++++++++ gnss/aidl/vts/gnss_hal_test_cases.cpp | 12 +++- gnss/common/utils/default/Utils.cpp | 40 ++++++++----- 6 files changed, 107 insertions(+), 35 deletions(-) diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl index 27d9887083..8e4b5f2c73 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl @@ -42,13 +42,6 @@ interface IGnssDebug { NOT_AVAILABLE = 2, } @Backing(type="int") @VintfStability - enum SatelliteEphemerisSource { - DEMODULATED = 0, - SUPL_PROVIDED = 1, - OTHER_SERVER_PROVIDED = 2, - OTHER = 3, - } - @Backing(type="int") @VintfStability enum SatelliteEphemerisHealth { GOOD = 0, BAD = 1, @@ -79,7 +72,7 @@ interface IGnssDebug { int svid; android.hardware.gnss.GnssConstellationType constellation; android.hardware.gnss.IGnssDebug.SatelliteEphemerisType ephemerisType; - android.hardware.gnss.IGnssDebug.SatelliteEphemerisSource ephemerisSource; + android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource ephemerisSource; android.hardware.gnss.IGnssDebug.SatelliteEphemerisHealth ephemerisHealth; float ephemerisAgeSeconds; boolean serverPredictionIsAvailable; 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 8c1784174d..21a2520b4e 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 @@ -40,7 +40,19 @@ parcelable SatellitePvt { android.hardware.gnss.SatelliteClockInfo satClockInfo; double ionoDelayMeters; double tropoDelayMeters; + int TOC; + int IODC; + int TOE; + int IODE; + 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; + @Backing(type="int") @VintfStability + enum SatelliteEphemerisSource { + DEMODULATED = 0, + SERVER_NORMAL = 1, + SERVER_LONG_TERM = 2, + OTHER = 3, + } } diff --git a/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl b/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl index 475a4a3a7f..3071dce569 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl @@ -17,6 +17,7 @@ package android.hardware.gnss; import android.hardware.gnss.GnssConstellationType; +import android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource; /** * Extended interface for GNSS Debug support @@ -35,16 +36,6 @@ interface IGnssDebug { NOT_AVAILABLE = 2, } - /** Satellite's ephemeris source */ - @VintfStability - @Backing(type="int") - enum SatelliteEphemerisSource { - DEMODULATED = 0, - SUPL_PROVIDED = 1, - OTHER_SERVER_PROVIDED = 2, - OTHER = 3, - } - /** Satellite's ephemeris health */ @VintfStability @Backing(type="int") diff --git a/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl b/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl index a238e3fc26..e79249df63 100644 --- a/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl +++ b/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl @@ -74,4 +74,62 @@ parcelable SatellitePvt { /** Tropospheric delay in meters. */ double tropoDelayMeters; + + /** + * Time of Clock. + * + * This is defined in GPS ICD200 documentation + * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf). + */ + int TOC; + + /** + * Issue of Data, Clock. + * + * This is defined in GPS ICD200 documentation + * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf). + * + * The field must be set to 0 if it is not supported. + */ + int IODC; + + /** + * Time of Ephemeris. + * + * This is defined in GPS ICD200 documentation + * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf). + */ + int TOE; + + /** + * Issue of Data, Ephemeris. + * + * This is defined in GPS ICD200 documentation + * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf). + * + * The field must be set to 0 if it is not supported. + */ + int IODE; + + /** Satellite's ephemeris source */ + @VintfStability + @Backing(type="int") + enum SatelliteEphemerisSource { + // Demodulated from broadcast signals + DEMODULATED = 0, + // Server provided Normal type ephemeris data, which is similar to broadcast ephemeris in + // longevity (e.g. SUPL) - lasting for few hours and providing satellite orbit and clock + // with accuracy of 1 - 2 meters. + SERVER_NORMAL = 1, + // Server provided Long-Term type ephemeris data, which lasts for many hours to several days + // and often provides satellite orbit and clock accuracy of 2 - 20 meters. + SERVER_LONG_TERM = 2, + // Other source + OTHER = 3, + } + + /** + * Source of the ephemeris. + */ + SatelliteEphemerisSource ephemerisSource = SatelliteEphemerisSource.OTHER; } diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 1fa68253c7..cbd9d8eef9 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -102,7 +102,7 @@ TEST_P(GnssHalTest, TestPsdsExtension) { } } -void CheckSatellitePvt(const SatellitePvt& satellitePvt) { +void CheckSatellitePvt(const SatellitePvt& satellitePvt, const int interfaceVersion) { const double kMaxOrbitRadiusMeters = 43000000.0; const double kMaxVelocityMps = 4000.0; // The below values are determined using GPS ICD Table 20-1 @@ -147,6 +147,14 @@ void CheckSatellitePvt(const SatellitePvt& satellitePvt) { ALOGD("Found HAS_TROPO"); ASSERT_TRUE(satellitePvt.tropoDelayMeters > 0 && satellitePvt.tropoDelayMeters < 100); } + if (interfaceVersion >= 2) { + ASSERT_TRUE(satellitePvt.TOC >= 0 && satellitePvt.TOC <= 604784); + ASSERT_TRUE(satellitePvt.TOE >= 0 && satellitePvt.TOE <= 604784); + // IODC has 10 bits + ASSERT_TRUE(satellitePvt.IODC >= 0 && satellitePvt.IODC <= 1023); + // IODE has 8 bits + ASSERT_TRUE(satellitePvt.IODE >= 0 && satellitePvt.IODE <= 255); + } } void CheckGnssMeasurementClockFields(const GnssData& measurement) { @@ -226,7 +234,7 @@ TEST_P(GnssHalTest, TestGnssMeasurementExtensionAndSatellitePvt) { kIsSatellitePvtSupported == true) { ALOGD("Found a measurement with SatellitePvt"); satellitePvtFound = true; - CheckSatellitePvt(measurement.satellitePvt); + CheckSatellitePvt(measurement.satellitePvt, aidl_gnss_hal_->getInterfaceVersion()); } } } diff --git a/gnss/common/utils/default/Utils.cpp b/gnss/common/utils/default/Utils.cpp index 1ff84eb9a5..65b62a9aeb 100644 --- a/gnss/common/utils/default/Utils.cpp +++ b/gnss/common/utils/default/Utils.cpp @@ -32,6 +32,7 @@ using aidl::android::hardware::gnss::GnssData; using aidl::android::hardware::gnss::GnssLocation; using aidl::android::hardware::gnss::GnssMeasurement; using aidl::android::hardware::gnss::IGnss; +using aidl::android::hardware::gnss::IGnssDebug; using aidl::android::hardware::gnss::IGnssMeasurementCallback; using aidl::android::hardware::gnss::SatellitePvt; using GnssSvInfo = aidl::android::hardware::gnss::IGnssCallback::GnssSvInfo; @@ -181,21 +182,30 @@ GnssData Utils::getMockMeasurement(const bool enableCorrVecOutputs) { .fullInterSignalBiasUncertaintyNs = 792.0, .satelliteInterSignalBiasNs = 233.9, .satelliteInterSignalBiasUncertaintyNs = 921.2, - .satellitePvt = {.flags = SatellitePvt::HAS_POSITION_VELOCITY_CLOCK_INFO | - SatellitePvt::HAS_IONO | SatellitePvt::HAS_TROPO, - .satPosEcef = {.posXMeters = 10442993.1153328, - .posYMeters = -19926932.8051666, - .posZMeters = -12034295.0216203, - .ureMeters = 1000.2345678}, - .satVelEcef = {.velXMps = -478.667183715732, - .velYMps = 1580.68371984114, - .velZMps = -3030.52994449997, - .ureRateMps = 10.2345678}, - .satClockInfo = {.satHardwareCodeBiasMeters = 1.396983861923e-09, - .satTimeCorrectionMeters = -7113.08964331, - .satClkDriftMps = 0}, - .ionoDelayMeters = 3.069949602639317e-08, - .tropoDelayMeters = 3.882265204404031}, + .satellitePvt = + { + .flags = SatellitePvt::HAS_POSITION_VELOCITY_CLOCK_INFO | + SatellitePvt::HAS_IONO | SatellitePvt::HAS_TROPO, + .satPosEcef = {.posXMeters = 10442993.1153328, + .posYMeters = -19926932.8051666, + .posZMeters = -12034295.0216203, + .ureMeters = 1000.2345678}, + .satVelEcef = {.velXMps = -478.667183715732, + .velYMps = 1580.68371984114, + .velZMps = -3030.52994449997, + .ureRateMps = 10.2345678}, + .satClockInfo = {.satHardwareCodeBiasMeters = 1.396983861923e-09, + .satTimeCorrectionMeters = -7113.08964331, + .satClkDriftMps = 0}, + .ionoDelayMeters = 3.069949602639317e-08, + .tropoDelayMeters = 3.882265204404031, + .ephemerisSource = + SatellitePvt::SatelliteEphemerisSource::SERVER_LONG_TERM, + .TOC = 12345, + .IODC = 143, + .TOE = 9876, + .IODE = 48, + }, .correlationVectors = {}}; GnssClock clock = {.gnssClockFlags = GnssClock::HAS_FULL_BIAS | GnssClock::HAS_BIAS | -- GitLab From 9184178f58c315c31c171456cffef9257471fd41 Mon Sep 17 00:00:00 2001 From: Edwin Date: Wed, 26 Jan 2022 08:24:45 -0800 Subject: [PATCH 528/825] Make interface linkable for libmediadrm Add build flag to fix aidl converted libmediadrm link error. Test: CtsMediaDrmTestCases, GtsMediaTestCases Bug: 200055138 Bug: 170964303 Change-Id: Ifa0cfbb269e768dadf3ff69d7c0c2f17ad1eb540 --- drm/aidl/Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/drm/aidl/Android.bp b/drm/aidl/Android.bp index d8500ec3b2..1d97e80aca 100644 --- a/drm/aidl/Android.bp +++ b/drm/aidl/Android.bp @@ -29,4 +29,5 @@ aidl_interface { min_sdk_version: "current", }, }, + double_loadable: true, } -- GitLab From d43080da7aea142fabd9d27de421a4ed02d88459 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 27 Jan 2022 13:30:58 -0800 Subject: [PATCH 529/825] uwb(hal): Add device capability TLV types Also, rename UwbVendorSessionSetAppConfigCmdParams to a more generic UwbVendorSessionAppConfigTlvTypes because it used in SET_APP_CONFIG & GET_APP_CONFIG cmds. Bug: 208678993 Test: Compiles Change-Id: Iaad3788eee1948feb369b5f8fb4076c2f2479d10 --- .../UwbVendorCapabilityTlvTypes.aidl | 64 ++++++ ...=> UwbVendorSessionAppConfigTlvTypes.aidl} | 2 +- .../UwbVendorCapabilityTlvTypes.aidl | 208 ++++++++++++++++++ ...=> UwbVendorSessionAppConfigTlvTypes.aidl} | 5 +- 4 files changed, 276 insertions(+), 3 deletions(-) create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl rename uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/{UwbVendorSessionSetAppConfigCmdParams.aidl => UwbVendorSessionAppConfigTlvTypes.aidl} (97%) create mode 100644 uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl rename uwb/aidl/android/hardware/uwb/fira_android/{UwbVendorSessionSetAppConfigCmdParams.aidl => UwbVendorSessionAppConfigTlvTypes.aidl} (93%) diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl new file mode 100644 index 0000000000..dd673e2398 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -0,0 +1,64 @@ +/* + * 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 -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.uwb.fira_android; +@Backing(type="int") @VintfStability +enum UwbVendorCapabilityTlvTypes { + SUPPORTED_CHANNELS = 0, + SUPPORTED_AOA_MODES = 1, + SUPPORTED_DEVICE_ROLES = 2, + SUPPORTS_BLOCK_STRIDING = 3, + SUPPORTS_NON_DEFERRED_MODE = 4, + SUPPORTS_ADAPTIVE_PAYLOAD_POWER = 5, + INITIATION_TIME_MS = 6, + SUPPORTED_MAC_FCS_CRC_TYPES = 7, + SUPPORTED_MULTI_NODE_MODES = 8, + SUPPORTED_PREAMBLE_MODES = 9, + SUPPORTED_PRF_MODES = 10, + SUPPORTED_RANGING_ROUND_USAGE_MODES = 11, + SUPPORTED_RFRAME_MODES = 12, + SUPPORTED_SFD_IDS = 13, + SUPPORTED_STS_MODES = 14, + SUPPORTED_STS_SEGEMENTS = 15, + SUPPORTED_BPRF_PHR_DATA_RATES = 16, + SUPPORTED_PSDU_DATA_RATES = 17, + CCC_SUPPORTED_VERSIONS = 160, + CCC_SUPPORTED_UWB_CONFIGS = 161, + CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 162, + CCC_SUPPORTED_RAN_MULTIPLIER = 163, + CCC_SUPPORTED_CHAPS_PER_SLOT = 164, + CCC_SUPPORTED_SYNC_CODES = 165, + CCC_SUPPORTED_CHANNELS = 166, + CCC_SUPPORTED_HOPPING_SEQUENCES = 167, + CCC_SUPPORTED_HOPPING_CONFIG_MODES = 168, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl similarity index 97% rename from uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl rename to uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl index 0d53431d4d..d35728fbef 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl @@ -33,7 +33,7 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability -enum UwbVendorSessionSetAppConfigCmdParams { +enum UwbVendorSessionAppConfigTlvTypes { CCC_HOP_MODE_KEY = 160, CCC_UWB_TIME0 = 161, CCC_RANGING_PROTOCOL_VER = 163, diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl new file mode 100644 index 0000000000..6f3c1bb768 --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -0,0 +1,208 @@ +/* + * 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. + */ + +package android.hardware.uwb.fira_android; + +/** + * Android specific capability params expected in UCI command: + * GID: 0000b (UWB Core Group) + * OID: 000011b (CORE_GET_CAPS_INFO_CMD) + * Values expected for each type should correspond to values used in the FIRA UCI specification. + * + * For ex, If the device supports responder and initiator device roles. Use this TLV to + * indicate that: * {SUPPORTED_DEVICE_ROLES, 2, [0x0 // responder, 0x1 // initiator]}} + */ +@VintfStability +@Backing(type="int") +enum UwbVendorCapabilityTlvTypes { + /** byte array with list of supported channels */ + SUPPORTED_CHANNELS = 0x0, + /** + * int bitmask of supported AOA modes + * Values: + * HAS_AZIMUTH_SUPPORT = 1, + * HAS_ELEVATION_SUPPORT = (1 << 1) + * HAS_FOM_SUPPORT = (1 << 2) + * HAS_FULL_AZIMUTH_SUPPORT = (1 << 3) + */ + SUPPORTED_AOA_MODES = 0x1, + /** + * int bitmask of supported device roles + * Values: + * HAS_CONTROLEE_INITIATOR_SUPPORT = 1 + * HAS_CONTROLEE_RESPONDER_SUPPORT = (1 << 1) + * HAS_CONTROLLER_INITIATOR_SUPPORT = (1 << 2) + * HAS_CONTROLLER_RESPONDER_SUPPORT= (1 << 3) + */ + SUPPORTED_DEVICE_ROLES = 0x2, + /** byte value of 1 to indicate support for block striding */ + SUPPORTS_BLOCK_STRIDING = 0x3, + /** byte value of 1 to indicate support for non deferred mode */ + SUPPORTS_NON_DEFERRED_MODE = 0x4, + /** byte value of 1 to indicate support for adaptive payload power */ + SUPPORTS_ADAPTIVE_PAYLOAD_POWER = 0x5, + /** Int value for indicating initiation time */ + INITIATION_TIME_MS = 0x6, + /** + * int bitmask of supported mac fcs crc types + * Values: + * HAS_CRC_16_SUPPORT = 1 + * HAS_CRC_32_SUPPORT = (1 << 1) + */ + SUPPORTED_MAC_FCS_CRC_TYPES = 0x7, + /** + * int bitmask of supported multi node modes + * Values: + * HAS_UNICAST_SUPPORT = 1 + * HAS_ONE_TO_MANY_SUPPORT = (1 << 1) + * HAS_MANY_TO_MANY_SUPPORT = (1 << 2) + */ + SUPPORTED_MULTI_NODE_MODES = 0x8, + /** + * int bitmask of supported preamble modes + * Values: + * HAS_32_SYMBOLS_SUPPORT = 1 + * HAS_64_SYMBOLS_SUPPORT = (1 << 1) + */ + SUPPORTED_PREAMBLE_MODES = 0x9, + /** + * int bitmask of supported prf modes + * Values: + * HAS_BPRF_SUPPORT = 1 + * HAS_HPRF_SUPPORT = (1 << 1) + */ + SUPPORTED_PRF_MODES = 0xA, + /** + * int bitmask of supported ranging round usage modes + * Values: + * HAS_DS_TWR_SUPPORT = 1 + * HAS_SS_TWR_SUPPORT = (1 << 1) + */ + SUPPORTED_RANGING_ROUND_USAGE_MODES = 0xB, + /** + * int bitmask of supported rframe modes + * Values: + * HAS_SP0_RFRAME_SUPPORT = 1 + * HAS_SP1_RFRAME_SUPPORT = (1 << 1), + * HAS_SP3_RFRAME_SUPPORT = (1 << 3) + */ + SUPPORTED_RFRAME_MODES = 0xC, + /** + * int bitmask of supported sfd ids + * Values: + * HAS_SFD0_SUPPORT = 1 + * HAS_SFD1_SUPPORT = (1 << 1) + * HAS_SFD2_SUPPORT = (1 << 2) + * HAS_SFD3_SUPPORT = (1 << 3) + * HAS_SFD4_SUPPORT = (1 << 4) + */ + SUPPORTED_SFD_IDS = 0xD, + /** + * int bitmask of supported sts modes + * Values: + * HAS_STATIC_STS_SUPPORT = 1 + * HAS_DYNAMIC_STS_SUPPORT = (1 << 1) + * HAS_DYNAMIC_STS_INDIVIDUAL_CONTROLEE_KEY_SUPPORT = (1 << 2) + */ + SUPPORTED_STS_MODES = 0xE, + /** + * int bitmask of supported sts segments + * Values: + * HAS_0_SEGMENT_SUPPORT = 1 + * HAS_1_SEGMENT_SUPPORT = (1 << 1) + * HAS_2_SEGMENT_SUPPORT = (1 << 2) + */ + SUPPORTED_STS_SEGEMENTS = 0xF, + /** + * int bitmask of supported bprf phr data rates + * Values: + * HAS_6M81_SUPPORT = 1 + * HAS_850K_SUPPORT = (1 << 1) + */ + SUPPORTED_BPRF_PHR_DATA_RATES = 0x10, + /** + * int bitmask of supported psdu data rates + * Values: + * HAS_6M81_SUPPORT = 1 + * HAS_7M80_SUPPORT = (1 << 1) + * HAS_27M2_SUPPORT = (1 << 2) + * HAS_31M2_SUPPORT = (1 << 3) + */ + SUPPORTED_PSDU_DATA_RATES = 0x11, + + /********************************************* + * CCC specific + ********************************************/ + + /** + * 2 byte tuple {major_version (1 byte), minor_version (1 byte)} array with list of supported + * CCC versions + */ + CCC_SUPPORTED_VERSIONS = 0xA0, + /** + * byte array with a list of supported UWB configs + * Values: + * UWB_CONFIG_0 = 0 + * UWB_CONFIG_1 = 1 + */ + CCC_SUPPORTED_UWB_CONFIGS = 0xA1, + /** + * 1 byte tuple {initiator_tx (4 bits), responder_tx (4 bits)} array with list of supported + * pulse shape combos + * Values: + * PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 1 + * PULSE_SHAPE_PRECURSOR_FREE = 2 + * PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 3 + */ + /** */ + CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 0xA2, + /** Int value for indicating supported ran multiplier */ + CCC_SUPPORTED_RAN_MULTIPLIER = 0xA3, + /** + * byte array with a list of supported chaps per slot + * Values: + * CHAPS_PER_SLOT_3 = 3 + * CHAPS_PER_SLOT_4 = 4 + * CHAPS_PER_SLOT_6 = 6 + * CHAPS_PER_SLOT_8 = 8 + * CHAPS_PER_SLOT_9 = 9 + * CHAPS_PER_SLOT_12 = 12 + * CHAPS_PER_SLOT_24 = 24 + */ + CCC_SUPPORTED_CHAPS_PER_SLOT = 0xA4, + /** + * byte array with a list of supported sync codes + * Values: 1 - 32 + */ + CCC_SUPPORTED_SYNC_CODES = 0xA5, + /** byte array with list of supported channels */ + CCC_SUPPORTED_CHANNELS = 0xA6, + /** + * byte array with a list of supported hopping sequences + * Values: + HOPPING_SEQUENCE_DEFAULT = 0 + HOPPING_SEQUENCE_AES = 1 + */ + CCC_SUPPORTED_HOPPING_SEQUENCES = 0xA7, + /** + * byte array with a list of supported hopping config modes + * Values: + * HOPPING_CONFIG_MODE_NONE = 0 + * HOPPING_CONFIG_MODE_CONTINUOUS = 1 + * HOPPING_CONFIG_MODE_ADAPTIVE = 2 + */ + CCC_SUPPORTED_HOPPING_CONFIG_MODES = 0xA8, +} diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl similarity index 93% rename from uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl rename to uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl index eb1f5ac408..b770ee0145 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionSetAppConfigCmdParams.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl @@ -17,16 +17,17 @@ package android.hardware.uwb.fira_android; /** - * Android specific vendor app params set in UCI command: + * Android specific vendor app params set/expected in UCI command: * GID: 0001b (UWB Session config Group) * OID: 000011b (SESSION_SET_APP_CONFIG_CMD) + * OID: 000100b (SESSION_GET_APP_CONFIG_CMD) * * Note: Refer to Table 34 of the UCI specification for the other params * expected in this command. */ @VintfStability @Backing(type="int") -enum UwbVendorSessionSetAppConfigCmdParams { +enum UwbVendorSessionAppConfigTlvTypes { /** CCC params for ranging start */ /** -- GitLab From 13d1d10666be152a8e7471b2fd1c28b071e620ac Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Thu, 27 Jan 2022 21:32:28 -0800 Subject: [PATCH 530/825] Fix a data type of the display ID The valid display ID ranges from 0 to 255 so this changes its data type from a 8-bit signed integer to 32-bit signed integer. Bug: 170401743 Test: Successful build Change-Id: Ic4cb38d2d0446e169652689a3d3c71f1d7240455 --- .../current/android/hardware/automotive/evs/IEvsEnumerator.aidl | 2 +- .../aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl | 2 +- automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h | 2 +- automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl index a79c68d898..225b5041b8 100644 --- a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/IEvsEnumerator.aidl @@ -44,7 +44,7 @@ interface IEvsEnumerator { android.hardware.automotive.evs.UltrasonicsArrayDesc[] getUltrasonicsArrayList(); boolean isHardware(); android.hardware.automotive.evs.IEvsCamera openCamera(in String cameraId, in android.hardware.automotive.evs.Stream streamCfg); - android.hardware.automotive.evs.IEvsDisplay openDisplay(in byte id); + android.hardware.automotive.evs.IEvsDisplay openDisplay(in int id); android.hardware.automotive.evs.IEvsUltrasonicsArray openUltrasonicsArray(in String ultrasonicsArrayId); void registerStatusCallback(in android.hardware.automotive.evs.IEvsEnumeratorStatusCallback callback); } diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl index 8e380e0bd4..86987008c5 100644 --- a/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl +++ b/automotive/evs/aidl/android/hardware/automotive/evs/IEvsEnumerator.aidl @@ -146,7 +146,7 @@ interface IEvsEnumerator { * @return EvsDisplay object to be used. * @throws EvsResult::INVALID_ARG if no display with a given id exists */ - IEvsDisplay openDisplay(in byte id); + IEvsDisplay openDisplay(in int id); /** * Gets the IEvsUltrasonicsArray associated with a ultrasonicsArrayId from a diff --git a/automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h b/automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h index 8bcd867d48..03a578d954 100644 --- a/automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h +++ b/automotive/evs/aidl/impl/default/include/DefaultEvsEnumerator.h @@ -37,7 +37,7 @@ class DefaultEvsEnumerator final const ::aidl::android::hardware::automotive::evs::CameraDesc& desc, std::vector<::aidl::android::hardware::automotive::evs::Stream>* _aidl_return) override; ::ndk::ScopedAStatus openDisplay( - int8_t displayId, + int32_t displayId, std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsDisplay>* obj) override; ::ndk::ScopedAStatus closeDisplay( const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsDisplay>& obj) diff --git a/automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp b/automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp index 2ff6d59af2..5a81d05850 100644 --- a/automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp +++ b/automotive/evs/aidl/impl/default/src/DefaultEvsEnumerator.cpp @@ -51,7 +51,7 @@ ScopedAStatus DefaultEvsEnumerator::getStreamList(const CameraDesc& desc, return ScopedAStatus::ok(); } -ScopedAStatus DefaultEvsEnumerator::openDisplay(int8_t displayId, +ScopedAStatus DefaultEvsEnumerator::openDisplay(int32_t displayId, std::shared_ptr* obj) { return ScopedAStatus::ok(); } -- GitLab From 262c7739ccd3c2a056469e8b8e1dd7559da46fbc Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 22 Dec 2021 18:45:04 +0800 Subject: [PATCH 531/825] p2p: add new HAL API to pass vendor-specific data Bug: 197695047 Test: atest VtsHalWifiSupplicantStaIfaceTargetTest \ VtsHalWifiSupplicantStaNetworkTargetTest \ VtsHalWifiSupplicantP2pIfaceTargetTest Change-Id: Ie746deb74c08307b70bd7959e5950c5f3c1679c5 --- .../wifi/supplicant/ISupplicantP2pIface.aidl | 1 + .../ISupplicantP2pIfaceCallback.aidl | 1 + .../wifi/supplicant/P2pFrameTypeMask.aidl | 50 ++++++++++++++++++ .../wifi/supplicant/ISupplicantP2pIface.aidl | 17 +++++++ .../ISupplicantP2pIfaceCallback.aidl | 31 +++++++++++ .../wifi/supplicant/P2pFrameTypeMask.aidl | 51 +++++++++++++++++++ .../supplicant_p2p_iface_aidl_test.cpp | 27 ++++++++++ 7 files changed, 178 insertions(+) create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl 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 f709aefb8e..d7eff76144 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 @@ -95,4 +95,5 @@ interface ISupplicantP2pIface { void stopFind(); void findOnSocialChannels(in int timeoutInSec); void findOnSpecificFrequency(in int freqInHz, in int timeoutInSec); + void setVendorElements(in android.hardware.wifi.supplicant.P2pFrameTypeMask frameTypeMask, in byte[] vendorElemBytes); } 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 826d9167b9..8d9f498abb 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 @@ -51,4 +51,5 @@ interface ISupplicantP2pIfaceCallback { oneway void onStaAuthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress); oneway void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress); oneway void onGroupFrequencyChanged(in String groupIfname, in int frequency); + 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); } 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 new file mode 100644 index 0000000000..6e1b957941 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pFrameTypeMask.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 -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 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, +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl index 7588c743a2..9021bf5635 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl @@ -21,6 +21,7 @@ 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.P2pFrameTypeMask; import android.hardware.wifi.supplicant.P2pGroupCapabilityMask; import android.hardware.wifi.supplicant.WpsConfigMethods; import android.hardware.wifi.supplicant.WpsProvisionMethod; @@ -810,4 +811,20 @@ interface ISupplicantP2pIface { * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| */ void findOnSpecificFrequency(in int freqInHz, in int timeoutInSec); + + /** + * Set vendor-specific information elements to P2P frames. + * + * @param frameTypeMask The bit mask of P2P frame type represented by + * P2pFrameTypeMask. + * @param vendorElemBytes 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. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_IFACE_INVALID| + */ + void setVendorElements(in P2pFrameTypeMask frameTypeMask, in byte[] vendorElemBytes); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl index 2b58cc2c82..da17c7bf47 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl @@ -213,4 +213,35 @@ interface ISupplicantP2pIfaceCallback { * @param frequency New operating frequency in MHz. */ oneway void onGroupFrequencyChanged(in String groupIfname, in int frequency); + + /** + * Used to indicate that a P2P device has been found. + * + * @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, + * or the P2P interface address for a peer which is a Group Owner. + * @param p2pDeviceAddress P2P device address. + * @param primaryDeviceType Type of device. Refer to section B.1 of Wifi P2P + * Technical specification v1.2. + * @param deviceName Name of the device. + * @param configMethods Mask of WPS configuration methods supported by the + * device. + * @param deviceCapabilities Refer to section 4.1.4 of Wifi P2P Technical + * specification v1.2. + * @param groupCapabilites Refer to section 4.1.4 of Wifi P2P Technical + * specification v1.2. + * @param wfdDeviceInfo WFD device info as described in section 5.1.2 of WFD + * technical specification v1.0.0. + * @param wfdR2DeviceInfo WFD R2 device info as described in section 5.1.12 of WFD + * technical specification v2.1. + * @param vendorElemBytes 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. + */ + oneway void onDeviceFoundWithVendorElements(in byte[] srcAddress, in byte[] p2pDeviceAddress, + in byte[] primaryDeviceType, in String deviceName, in WpsConfigMethods configMethods, + in byte deviceCapabilities, in P2pGroupCapabilityMask groupCapabilities, + in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo, in byte[] vendorElemBytes); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl new file mode 100644 index 0000000000..06e834b944 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pFrameTypeMask.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. + */ + +package android.hardware.wifi.supplicant; + +/** + * Bitmask of P2P frame types. + */ +@VintfStability +@Backing(type="int") +enum P2pFrameTypeMask { + /** P2P probe request frame */ + P2P_FRAME_PROBE_REQ_P2P = 1 << 0, + /** P2P probe response frame */ + P2P_FRAME_PROBE_RESP_P2P = 1 << 1, + /** P2P probe response frame from the group owner */ + P2P_FRAME_PROBE_RESP_P2P_GO = 1 << 2, + /** Beacon frame from the group owner */ + P2P_FRAME_BEACON_P2P_GO = 1 << 3, + /** Provision discovery request frame */ + P2P_FRAME_P2P_PD_REQ = 1 << 4, + /** Provision discovery response frame */ + P2P_FRAME_P2P_PD_RESP = 1 << 5, + /** Group negotiation request frame */ + P2P_FRAME_P2P_GO_NEG_REQ = 1 << 6, + /** Group negotiation response frame */ + P2P_FRAME_P2P_GO_NEG_RESP = 1 << 7, + /** Group negotiation confirm frame */ + P2P_FRAME_P2P_GO_NEG_CONF = 1 << 8, + /** Invitation request frame */ + P2P_FRAME_P2P_INV_REQ = 1 << 9, + /** Invitation response frame */ + P2P_FRAME_P2P_INV_RESP = 1 << 10, + /** P2P Association request frame */ + P2P_FRAME_P2P_ASSOC_REQ = 1 << 11, + /** P2P Association response frame */ + P2P_FRAME_P2P_ASSOC_RESP = 1 << 12, +} 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 470a9b017f..8c7018d4df 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 @@ -34,6 +34,7 @@ using aidl::android::hardware::wifi::supplicant::IfaceType; 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::P2pFrameTypeMask; using aidl::android::hardware::wifi::supplicant::P2pGroupCapabilityMask; using aidl::android::hardware::wifi::supplicant::P2pProvDiscStatusCode; using aidl::android::hardware::wifi::supplicant::P2pStatusCode; @@ -163,6 +164,17 @@ class SupplicantP2pIfaceCallback : public BnSupplicantP2pIfaceCallback { int32_t /* frequency */) override { return ndk::ScopedAStatus::ok(); } + ::ndk::ScopedAStatus onDeviceFoundWithVendorElements( + const std::vector& /* srcAddress */, + const std::vector& /* p2pDeviceAddress */, + const std::vector& /* primaryDeviceType */, + const std::string& /* deviceName */, WpsConfigMethods /* configMethods */, + int8_t /* deviceCapabilities */, P2pGroupCapabilityMask /* groupCapabilities */, + const std::vector& /* wfdDeviceInfo */, + const std::vector& /* wfdR2DeviceInfo */, + const std::vector& /* vendorElemBytes */) override { + return ndk::ScopedAStatus::ok(); + } }; class SupplicantP2pIfaceAidlTest : public testing::TestWithParam { @@ -638,6 +650,21 @@ TEST_P(SupplicantP2pIfaceAidlTest, AddAndRemoveUpnpService) { p2p_iface_->removeUpnpService(0 /* version */, upnpServiceName).isOk()); } +/* + * SetVendorElements + */ +TEST_P(SupplicantP2pIfaceAidlTest, SetVendorElements) { + LOG(INFO) << "SupplicantP2pIfaceAidlTest::SetVendorElements start"; + + std::vector vendorElemBytes; + EXPECT_TRUE( + p2p_iface_ + ->setVendorElements(P2pFrameTypeMask::P2P_FRAME_PROBE_RESP_P2P, vendorElemBytes) + .isOk()); + + LOG(INFO) << "SupplicantP2pIfaceAidlTest::SetVendorElements end"; +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SupplicantP2pIfaceAidlTest); INSTANTIATE_TEST_SUITE_P(Supplicant, SupplicantP2pIfaceAidlTest, testing::ValuesIn(android::getAidlHalInstanceNames( -- GitLab From 912bdf343cc8ccee8e2ab1769030ca9af137ccc0 Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Fri, 28 Jan 2022 01:02:16 -0800 Subject: [PATCH 532/825] Add all prior VTS tests Test: atest VtsHalRadioTargetTest Bug: 210712359 Change-Id: Ib7ace442ee2bf8d203df9899d8e8331b26af74ad --- radio/aidl/vts/radio_config_response.cpp | 23 +- radio/aidl/vts/radio_config_test.cpp | 99 ++ radio/aidl/vts/radio_data_response.cpp | 26 +- radio/aidl/vts/radio_data_test.cpp | 277 ++++ radio/aidl/vts/radio_messaging_response.cpp | 81 +- radio/aidl/vts/radio_messaging_test.cpp | 571 +++++++ radio/aidl/vts/radio_modem_response.cpp | 59 +- radio/aidl/vts/radio_modem_test.cpp | 298 ++++ radio/aidl/vts/radio_network_response.cpp | 111 +- radio/aidl/vts/radio_network_test.cpp | 1489 +++++++++++++++++++ radio/aidl/vts/radio_network_utils.h | 5 +- radio/aidl/vts/radio_sim_response.cpp | 130 +- radio/aidl/vts/radio_sim_test.cpp | 769 ++++++++++ radio/aidl/vts/radio_sim_utils.h | 1 + radio/aidl/vts/radio_voice_response.cpp | 134 +- radio/aidl/vts/radio_voice_test.cpp | 637 ++++++++ 16 files changed, 4549 insertions(+), 161 deletions(-) diff --git a/radio/aidl/vts/radio_config_response.cpp b/radio/aidl/vts/radio_config_response.cpp index 1a152fb712..8d8160519a 100644 --- a/radio/aidl/vts/radio_config_response.cpp +++ b/radio/aidl/vts/radio_config_response.cpp @@ -19,12 +19,15 @@ RadioConfigResponse::RadioConfigResponse(RadioServiceTest& parent) : parent_config(parent) {} ndk::ScopedAStatus RadioConfigResponse::getSimSlotsStatusResponse( - const RadioResponseInfo& /* info */, const std::vector& /* slotStatus */) { + const RadioResponseInfo& info, const std::vector& /* slotStatus */) { + rspInfo = info; + parent_config.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioConfigResponse::setSimSlotsMappingResponse( - const RadioResponseInfo& /* info */) { +ndk::ScopedAStatus RadioConfigResponse::setSimSlotsMappingResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_config.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -37,22 +40,28 @@ ndk::ScopedAStatus RadioConfigResponse::getPhoneCapabilityResponse( } ndk::ScopedAStatus RadioConfigResponse::setPreferredDataModemResponse( - const RadioResponseInfo& /* info */) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_config.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioConfigResponse::getNumOfLiveModemsResponse( - const RadioResponseInfo& /* info */, const int8_t /* numOfLiveModems */) { + const RadioResponseInfo& info, const int8_t /* numOfLiveModems */) { + rspInfo = info; + parent_config.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioConfigResponse::setNumOfLiveModemsResponse( - const RadioResponseInfo& /* info */) { +ndk::ScopedAStatus RadioConfigResponse::setNumOfLiveModemsResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_config.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioConfigResponse::getHalDeviceCapabilitiesResponse( const RadioResponseInfo& info, bool modemReducedFeatures) { + rspInfo = info; modemReducedFeatureSet1 = modemReducedFeatures; parent_config.notify(info.serial); return ndk::ScopedAStatus::ok(); diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp index 2d7fe01575..a271b8af52 100644 --- a/radio/aidl/vts/radio_config_test.cpp +++ b/radio/aidl/vts/radio_config_test.cpp @@ -54,3 +54,102 @@ TEST_P(RadioConfigTest, getHalDeviceCapabilities) { ALOGI("getHalDeviceCapabilities, rspInfo.error = %s\n", toString(radioRsp_config->rspInfo.error).c_str()); } + +/* + * Test IRadioConfig.getSimSlotsStatus() for the response returned. + */ +TEST_P(RadioConfigTest, getSimSlotsStatus) { + serial = GetRandomSerialNumber(); + ndk::ScopedAStatus res = radio_config->getSimSlotsStatus(serial); + ASSERT_OK(res); + ALOGI("getSimSlotsStatus, rspInfo.error = %s\n", + toString(radioRsp_config->rspInfo.error).c_str()); +} + +/* + * Test IRadioConfig.getPhoneCapability() for the response returned. + */ +TEST_P(RadioConfigTest, getPhoneCapability) { + serial = GetRandomSerialNumber(); + ndk::ScopedAStatus res = radio_config->getPhoneCapability(serial); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type); + EXPECT_EQ(serial, radioRsp_config->rspInfo.serial); + ALOGI("getPhoneCapability, rspInfo.error = %s\n", + toString(radioRsp_config->rspInfo.error).c_str()); + + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_config->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR})); + + if (radioRsp_config->rspInfo.error == RadioError ::NONE) { + // maxActiveData should be greater than or equal to maxActiveInternetData. + EXPECT_GE(radioRsp_config->phoneCap.maxActiveData, + radioRsp_config->phoneCap.maxActiveInternetData); + // maxActiveData and maxActiveInternetData should be 0 or positive numbers. + EXPECT_GE(radioRsp_config->phoneCap.maxActiveInternetData, 0); + } +} + +/* + * Test IRadioConfig.setPreferredDataModem() for the response returned. + */ +TEST_P(RadioConfigTest, setPreferredDataModem) { + serial = GetRandomSerialNumber(); + ndk::ScopedAStatus res = radio_config->getPhoneCapability(serial); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type); + EXPECT_EQ(serial, radioRsp_config->rspInfo.serial); + ALOGI("getPhoneCapability, rspInfo.error = %s\n", + toString(radioRsp_config->rspInfo.error).c_str()); + + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_config->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR})); + + if (radioRsp_config->rspInfo.error != RadioError ::NONE) { + return; + } + + if (radioRsp_config->phoneCap.logicalModemIds.size() == 0) { + return; + } + + // We get phoneCapability. Send setPreferredDataModem command + serial = GetRandomSerialNumber(); + uint8_t modemId = radioRsp_config->phoneCap.logicalModemIds[0]; + res = radio_config->setPreferredDataModem(serial, modemId); + + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type); + EXPECT_EQ(serial, radioRsp_config->rspInfo.serial); + ALOGI("setPreferredDataModem, rspInfo.error = %s\n", + toString(radioRsp_config->rspInfo.error).c_str()); + + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_config->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR})); +} + +/* + * Test IRadioConfig.setPreferredDataModem() with invalid arguments. + */ +TEST_P(RadioConfigTest, setPreferredDataModem_invalidArgument) { + serial = GetRandomSerialNumber(); + uint8_t modemId = -1; + ndk::ScopedAStatus res = radio_config->setPreferredDataModem(serial, modemId); + + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type); + EXPECT_EQ(serial, radioRsp_config->rspInfo.serial); + ALOGI("setPreferredDataModem, rspInfo.error = %s\n", + toString(radioRsp_config->rspInfo.error).c_str()); + + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_config->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::RADIO_NOT_AVAILABLE, + RadioError::INTERNAL_ERR})); +} diff --git a/radio/aidl/vts/radio_data_response.cpp b/radio/aidl/vts/radio_data_response.cpp index 9b17bfb380..8d51760295 100644 --- a/radio/aidl/vts/radio_data_response.cpp +++ b/radio/aidl/vts/radio_data_response.cpp @@ -36,8 +36,9 @@ ndk::ScopedAStatus RadioDataResponse::cancelHandoverResponse(const RadioResponse return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioDataResponse::deactivateDataCallResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioDataResponse::deactivateDataCallResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_data.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -61,11 +62,15 @@ ndk::ScopedAStatus RadioDataResponse::releasePduSessionIdResponse(const RadioRes return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioDataResponse::setDataAllowedResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioDataResponse::setDataAllowedResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_data.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioDataResponse::setDataProfileResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioDataResponse::setDataProfileResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_data.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -75,8 +80,9 @@ ndk::ScopedAStatus RadioDataResponse::setDataThrottlingResponse(const RadioRespo return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioDataResponse::setInitialAttachApnResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioDataResponse::setInitialAttachApnResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_data.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -94,11 +100,15 @@ ndk::ScopedAStatus RadioDataResponse::startHandoverResponse(const RadioResponseI return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioDataResponse::startKeepaliveResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioDataResponse::startKeepaliveResponse(const RadioResponseInfo& info, const KeepaliveStatus& /*status*/) { + rspInfo = info; + parent_data.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioDataResponse::stopKeepaliveResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioDataResponse::stopKeepaliveResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_data.notify(info.serial); return ndk::ScopedAStatus::ok(); } diff --git a/radio/aidl/vts/radio_data_test.cpp b/radio/aidl/vts/radio_data_test.cpp index 8547e9d4db..616e3391a3 100644 --- a/radio/aidl/vts/radio_data_test.cpp +++ b/radio/aidl/vts/radio_data_test.cpp @@ -309,3 +309,280 @@ TEST_P(RadioDataTest, setDataThrottling) { sleep(1); } + +/* + * Test IRadioData.setInitialAttachApn() for the response returned. + */ +TEST_P(RadioDataTest, setInitialAttachApn) { + serial = GetRandomSerialNumber(); + + // Create a dataProfileInfo + DataProfileInfo dataProfileInfo; + memset(&dataProfileInfo, 0, sizeof(dataProfileInfo)); + dataProfileInfo.profileId = DataProfileInfo::ID_DEFAULT; + dataProfileInfo.apn = std::string("internet"); + dataProfileInfo.protocol = PdpProtocolType::IPV4V6; + dataProfileInfo.roamingProtocol = PdpProtocolType::IPV4V6; + dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP; + dataProfileInfo.user = std::string("username"); + dataProfileInfo.password = std::string("password"); + dataProfileInfo.type = DataProfileInfo::TYPE_THREE_GPP; + dataProfileInfo.maxConnsTime = 300; + dataProfileInfo.maxConns = 20; + dataProfileInfo.waitTime = 0; + dataProfileInfo.enabled = true; + dataProfileInfo.supportedApnTypesBitmap = 320; + dataProfileInfo.bearerBitmap = 161543; + dataProfileInfo.mtuV4 = 0; + dataProfileInfo.mtuV6 = 0; + dataProfileInfo.preferred = true; + dataProfileInfo.persistent = false; + + radio_data->setInitialAttachApn(serial, dataProfileInfo); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type); + EXPECT_EQ(serial, radioRsp_data->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE})); + } +} + +/* + * Test IRadioData.setDataProfile() for the response returned. + */ +TEST_P(RadioDataTest, setDataProfile) { + serial = GetRandomSerialNumber(); + + // Create a dataProfileInfo + DataProfileInfo dataProfileInfo; + memset(&dataProfileInfo, 0, sizeof(dataProfileInfo)); + dataProfileInfo.profileId = DataProfileInfo::ID_DEFAULT; + dataProfileInfo.apn = std::string("internet"); + dataProfileInfo.protocol = PdpProtocolType::IPV4V6; + dataProfileInfo.roamingProtocol = PdpProtocolType::IPV4V6; + dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP; + dataProfileInfo.user = std::string("username"); + dataProfileInfo.password = std::string("password"); + dataProfileInfo.type = DataProfileInfo::TYPE_THREE_GPP; + dataProfileInfo.maxConnsTime = 300; + dataProfileInfo.maxConns = 20; + dataProfileInfo.waitTime = 0; + dataProfileInfo.enabled = true; + dataProfileInfo.supportedApnTypesBitmap = 320; + dataProfileInfo.bearerBitmap = 161543; + dataProfileInfo.mtuV4 = 0; + dataProfileInfo.mtuV6 = 0; + dataProfileInfo.preferred = true; + dataProfileInfo.persistent = true; + + // Create a dataProfileInfoList + std::vector dataProfileInfoList = {dataProfileInfo}; + + radio_data->setDataProfile(serial, dataProfileInfoList); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type); + EXPECT_EQ(serial, radioRsp_data->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE})); + } +} + +/* + * Test IRadioData.deactivateDataCall() for the response returned. + */ +TEST_P(RadioDataTest, deactivateDataCall) { + serial = GetRandomSerialNumber(); + int cid = 1; + DataRequestReason reason = DataRequestReason::NORMAL; + + ndk::ScopedAStatus res = radio_data->deactivateDataCall(serial, cid, reason); + ASSERT_OK(res); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type); + EXPECT_EQ(serial, radioRsp_data->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE( + CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, + RadioError::INVALID_CALL_ID, RadioError::INVALID_STATE, + RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED, + RadioError::CANCELLED, RadioError::SIM_ABSENT})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_data->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_CALL_ID, + RadioError::INVALID_STATE, RadioError::INVALID_ARGUMENTS, + RadioError::REQUEST_NOT_SUPPORTED, RadioError::CANCELLED})); + } +} + +/* + * Test IRadioData.startKeepalive() for the response returned. + */ +TEST_P(RadioDataTest, startKeepalive) { + std::vector requests = { + { + // Invalid IPv4 source address + KeepaliveRequest::TYPE_NATT_IPV4, + {192, 168, 0 /*, 100*/}, + 1234, + {8, 8, 4, 4}, + 4500, + 20000, + 0xBAD, + }, + { + // Invalid IPv4 destination address + KeepaliveRequest::TYPE_NATT_IPV4, + {192, 168, 0, 100}, + 1234, + {8, 8, 4, 4, 1, 2, 3, 4}, + 4500, + 20000, + 0xBAD, + }, + { + // Invalid Keepalive Type + -1, + {192, 168, 0, 100}, + 1234, + {8, 8, 4, 4}, + 4500, + 20000, + 0xBAD, + }, + { + // Invalid IPv6 source address + KeepaliveRequest::TYPE_NATT_IPV6, + {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, + 0xED, 0xBE, 0xEF, 0xBD}, + 1234, + {0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x88, 0x44}, + 4500, + 20000, + 0xBAD, + }, + { + // Invalid IPv6 destination address + KeepaliveRequest::TYPE_NATT_IPV6, + {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, + 0xED, 0xBE, 0xEF}, + 1234, + {0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x88, + /*0x44*/}, + 4500, + 20000, + 0xBAD, + }, + { + // Invalid Context ID (cid), this should survive the initial + // range checking and fail in the modem data layer + KeepaliveRequest::TYPE_NATT_IPV4, + {192, 168, 0, 100}, + 1234, + {8, 8, 4, 4}, + 4500, + 20000, + 0xBAD, + }, + { + // Invalid Context ID (cid), this should survive the initial + // range checking and fail in the modem data layer + KeepaliveRequest::TYPE_NATT_IPV6, + {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, + 0xED, 0xBE, 0xEF}, + 1234, + {0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x88, 0x44}, + 4500, + 20000, + 0xBAD, + }}; + + for (auto req = requests.begin(); req != requests.end(); req++) { + serial = GetRandomSerialNumber(); + radio_data->startKeepalive(serial, *req); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type); + EXPECT_EQ(serial, radioRsp_data->rspInfo.serial); + + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_data->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_ARGUMENTS, + RadioError::REQUEST_NOT_SUPPORTED})); + } +} + +/* + * Test IRadioData.stopKeepalive() for the response returned. + */ +TEST_P(RadioDataTest, stopKeepalive) { + serial = GetRandomSerialNumber(); + + radio_data->stopKeepalive(serial, 0xBAD); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type); + EXPECT_EQ(serial, radioRsp_data->rspInfo.serial); + + ASSERT_TRUE( + CheckAnyOfErrors(radioRsp_data->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, + RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); +} + +/* + * Test IRadioData.getDataCallList() for the response returned. + */ +TEST_P(RadioDataTest, getDataCallList) { + LOG(DEBUG) << "getDataCallList"; + serial = GetRandomSerialNumber(); + + radio_data->getDataCallList(serial); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type); + EXPECT_EQ(serial, radioRsp_data->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_data->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ABSENT})); + } + LOG(DEBUG) << "getDataCallList finished"; +} + +/* + * Test IRadioData.setDataAllowed() for the response returned. + */ +TEST_P(RadioDataTest, setDataAllowed) { + LOG(DEBUG) << "setDataAllowed"; + serial = GetRandomSerialNumber(); + bool allow = true; + + radio_data->setDataAllowed(serial, allow); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type); + EXPECT_EQ(serial, radioRsp_data->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + EXPECT_EQ(RadioError::NONE, radioRsp_data->rspInfo.error); + } + LOG(DEBUG) << "setDataAllowed finished"; +} diff --git a/radio/aidl/vts/radio_messaging_response.cpp b/radio/aidl/vts/radio_messaging_response.cpp index 718df7e60b..451a10c8cf 100644 --- a/radio/aidl/vts/radio_messaging_response.cpp +++ b/radio/aidl/vts/radio_messaging_response.cpp @@ -20,17 +20,23 @@ RadioMessagingResponse::RadioMessagingResponse(RadioServiceTest& parent) : parent_messaging(parent) {} ndk::ScopedAStatus RadioMessagingResponse::acknowledgeIncomingGsmSmsWithPduResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingCdmaSmsResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingGsmSmsResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -39,39 +45,49 @@ ndk::ScopedAStatus RadioMessagingResponse::acknowledgeRequest(int32_t /*serial*/ } ndk::ScopedAStatus RadioMessagingResponse::cancelPendingUssdResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnRuimResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnRuimResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnSimResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnSimResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioMessagingResponse::getCdmaBroadcastConfigResponse( - const RadioResponseInfo& /*info*/, - const std::vector& /*configs*/) { + const RadioResponseInfo& info, const std::vector& /*configs*/) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioMessagingResponse::getGsmBroadcastConfigResponse( - const RadioResponseInfo& /*info*/, - const std::vector& /*configs*/) { + const RadioResponseInfo& info, const std::vector& /*configs*/) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioMessagingResponse::getSmscAddressResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioMessagingResponse::getSmscAddressResponse(const RadioResponseInfo& info, const std::string& /*smsc*/) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioMessagingResponse::reportSmsMemoryStatusResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -91,8 +107,10 @@ ndk::ScopedAStatus RadioMessagingResponse::sendCdmaSmsResponse(const RadioRespon return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioMessagingResponse::sendImsSmsResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioMessagingResponse::sendImsSmsResponse(const RadioResponseInfo& info, const SendSmsResult& /*sms*/) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -112,41 +130,56 @@ ndk::ScopedAStatus RadioMessagingResponse::sendSmsResponse(const RadioResponseIn return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioMessagingResponse::sendUssdResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioMessagingResponse::sendUssdResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastActivationResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastConfigResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastActivationResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastConfigResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioMessagingResponse::setSmscAddressResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioMessagingResponse::setSmscAddressResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioMessagingResponse::writeSmsToRuimResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioMessagingResponse::writeSmsToRuimResponse(const RadioResponseInfo& info, int32_t /*index*/) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioMessagingResponse::writeSmsToSimResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioMessagingResponse::writeSmsToSimResponse(const RadioResponseInfo& info, int32_t /*index*/) { + rspInfo = info; + parent_messaging.notify(info.serial); return ndk::ScopedAStatus::ok(); } diff --git a/radio/aidl/vts/radio_messaging_test.cpp b/radio/aidl/vts/radio_messaging_test.cpp index 8abd91d709..0abdfbc435 100644 --- a/radio/aidl/vts/radio_messaging_test.cpp +++ b/radio/aidl/vts/radio_messaging_test.cpp @@ -197,3 +197,574 @@ TEST_P(RadioMessagingTest, sendCdmaSmsExpectMore) { CHECK_GENERAL_ERROR)); } } + +/* + * Test IRadioMessaging.setGsmBroadcastConfig() for the response returned. + */ +TEST_P(RadioMessagingTest, setGsmBroadcastConfig) { + LOG(DEBUG) << "setGsmBroadcastConfig"; + serial = GetRandomSerialNumber(); + + // Create GsmBroadcastSmsConfigInfo #1 + GsmBroadcastSmsConfigInfo gbSmsConfig1; + gbSmsConfig1.fromServiceId = 4352; + gbSmsConfig1.toServiceId = 4354; + gbSmsConfig1.fromCodeScheme = 0; + gbSmsConfig1.toCodeScheme = 255; + gbSmsConfig1.selected = true; + + // Create GsmBroadcastSmsConfigInfo #2 + GsmBroadcastSmsConfigInfo gbSmsConfig2; + gbSmsConfig2.fromServiceId = 4356; + gbSmsConfig2.toServiceId = 4356; + gbSmsConfig2.fromCodeScheme = 0; + gbSmsConfig2.toCodeScheme = 255; + gbSmsConfig2.selected = true; + + // Create GsmBroadcastSmsConfigInfo #3 + GsmBroadcastSmsConfigInfo gbSmsConfig3; + gbSmsConfig3.fromServiceId = 4370; + gbSmsConfig3.toServiceId = 4379; + gbSmsConfig3.fromCodeScheme = 0; + gbSmsConfig3.toCodeScheme = 255; + gbSmsConfig3.selected = true; + + // Create GsmBroadcastSmsConfigInfo #4 + GsmBroadcastSmsConfigInfo gbSmsConfig4; + gbSmsConfig4.fromServiceId = 4383; + gbSmsConfig4.toServiceId = 4391; + gbSmsConfig4.fromCodeScheme = 0; + gbSmsConfig4.toCodeScheme = 255; + gbSmsConfig4.selected = true; + + // Create GsmBroadcastSmsConfigInfo #5 + GsmBroadcastSmsConfigInfo gbSmsConfig5; + gbSmsConfig5.fromServiceId = 4392; + gbSmsConfig5.toServiceId = 4392; + gbSmsConfig5.fromCodeScheme = 0; + gbSmsConfig5.toCodeScheme = 255; + gbSmsConfig5.selected = true; + + std::vector gsmBroadcastSmsConfigsInfoList = { + gbSmsConfig1, gbSmsConfig2, gbSmsConfig3, gbSmsConfig4, gbSmsConfig5}; + + radio_messaging->setGsmBroadcastConfig(serial, gsmBroadcastSmsConfigsInfoList); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, + RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "setGsmBroadcastConfig finished"; +} + +/* + * Test IRadioMessaging.getGsmBroadcastConfig() for the response returned. + */ +TEST_P(RadioMessagingTest, getGsmBroadcastConfig) { + LOG(DEBUG) << "getGsmBroadcastConfig"; + serial = GetRandomSerialNumber(); + + radio_messaging->getGsmBroadcastConfig(serial); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_messaging->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "getGsmBroadcastConfig finished"; +} + +/* + * Test IRadioMessaging.setCdmaBroadcastConfig() for the response returned. + */ +TEST_P(RadioMessagingTest, setCdmaBroadcastConfig) { + LOG(DEBUG) << "setCdmaBroadcastConfig"; + serial = GetRandomSerialNumber(); + + CdmaBroadcastSmsConfigInfo cbSmsConfig; + cbSmsConfig.serviceCategory = 4096; + cbSmsConfig.language = 1; + cbSmsConfig.selected = true; + + std::vector cdmaBroadcastSmsConfigInfoList = {cbSmsConfig}; + + radio_messaging->setCdmaBroadcastConfig(serial, cdmaBroadcastSmsConfigInfoList); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_MODEM_STATE}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "setCdmaBroadcastConfig finished"; +} + +/* + * Test IRadioMessaging.getCdmaBroadcastConfig() for the response returned. + */ +TEST_P(RadioMessagingTest, getCdmaBroadcastConfig) { + LOG(DEBUG) << "getCdmaBroadcastConfig"; + serial = GetRandomSerialNumber(); + + radio_messaging->getCdmaBroadcastConfig(serial); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, {RadioError::NONE}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "getCdmaBroadcastConfig finished"; +} + +/* + * Test IRadioMessaging.setCdmaBroadcastActivation() for the response returned. + */ +TEST_P(RadioMessagingTest, setCdmaBroadcastActivation) { + LOG(DEBUG) << "setCdmaBroadcastActivation"; + serial = GetRandomSerialNumber(); + bool activate = false; + + radio_messaging->setCdmaBroadcastActivation(serial, activate); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "setCdmaBroadcastActivation finished"; +} + +/* + * Test IRadioMessaging.setGsmBroadcastActivation() for the response returned. + */ +TEST_P(RadioMessagingTest, setGsmBroadcastActivation) { + LOG(DEBUG) << "setGsmBroadcastActivation"; + serial = GetRandomSerialNumber(); + bool activate = false; + + radio_messaging->setGsmBroadcastActivation(serial, activate); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_messaging->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::INVALID_MODEM_STATE, + RadioError::INVALID_STATE, RadioError::OPERATION_NOT_ALLOWED}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "setGsmBroadcastActivation finished"; +} + +/* + * Test IRadioMessaging.acknowledgeLastIncomingGsmSms() for the response returned. + */ +TEST_P(RadioMessagingTest, acknowledgeLastIncomingGsmSms) { + LOG(DEBUG) << "acknowledgeLastIncomingGsmSms"; + serial = GetRandomSerialNumber(); + bool success = true; + + radio_messaging->acknowledgeLastIncomingGsmSms( + serial, success, SmsAcknowledgeFailCause::MEMORY_CAPACITY_EXCEEDED); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "acknowledgeLastIncomingGsmSms finished"; +} + +/* + * Test IRadioMessaging.acknowledgeIncomingGsmSmsWithPdu() for the response returned. + */ +TEST_P(RadioMessagingTest, acknowledgeIncomingGsmSmsWithPdu) { + LOG(DEBUG) << "acknowledgeIncomingGsmSmsWithPdu"; + serial = GetRandomSerialNumber(); + bool success = true; + std::string ackPdu = ""; + + radio_messaging->acknowledgeIncomingGsmSmsWithPdu(serial, success, ackPdu); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + // TODO(shuoq): Will add error check when we know the expected error from QC + } + LOG(DEBUG) << "acknowledgeIncomingGsmSmsWithPdu finished"; +} + +/* + * Test IRadioMessaging.acknowledgeLastIncomingCdmaSms() for the response returned. + */ +TEST_P(RadioMessagingTest, acknowledgeLastIncomingCdmaSms) { + LOG(DEBUG) << "acknowledgeLastIncomingCdmaSms"; + serial = GetRandomSerialNumber(); + + // Create a CdmaSmsAck + CdmaSmsAck cdmaSmsAck; + cdmaSmsAck.errorClass = false; + cdmaSmsAck.smsCauseCode = 1; + + radio_messaging->acknowledgeLastIncomingCdmaSms(serial, cdmaSmsAck); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::NO_SMS_TO_ACK}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "acknowledgeLastIncomingCdmaSms finished"; +} + +/* + * Test IRadioMessaging.sendImsSms() for the response returned. + */ +TEST_P(RadioMessagingTest, sendImsSms) { + LOG(DEBUG) << "sendImsSms"; + serial = GetRandomSerialNumber(); + + // Create a CdmaSmsAddress + CdmaSmsAddress cdmaSmsAddress; + cdmaSmsAddress.digitMode = CdmaSmsAddress::DIGIT_MODE_FOUR_BIT; + cdmaSmsAddress.isNumberModeDataNetwork = false; + cdmaSmsAddress.numberType = CdmaSmsAddress::NUMBER_TYPE_UNKNOWN; + cdmaSmsAddress.numberPlan = CdmaSmsAddress::NUMBER_PLAN_UNKNOWN; + cdmaSmsAddress.digits = (std::vector){11, 1, 6, 5, 10, 7, 7, 2, 10, 3, 10, 3}; + + // Create a CdmaSmsSubAddress + CdmaSmsSubaddress cdmaSmsSubaddress; + cdmaSmsSubaddress.subaddressType = CdmaSmsSubaddress::SUBADDRESS_TYPE_NSAP; + cdmaSmsSubaddress.odd = false; + cdmaSmsSubaddress.digits = (std::vector){}; + + // Create a CdmaSmsMessage + CdmaSmsMessage cdmaSmsMessage; + cdmaSmsMessage.teleserviceId = 4098; + cdmaSmsMessage.isServicePresent = false; + cdmaSmsMessage.serviceCategory = 0; + cdmaSmsMessage.address = cdmaSmsAddress; + cdmaSmsMessage.subAddress = cdmaSmsSubaddress; + cdmaSmsMessage.bearerData = + (std::vector){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0}; + + // Creata an ImsSmsMessage + ImsSmsMessage msg; + msg.tech = RadioTechnologyFamily::THREE_GPP2; + msg.retry = false; + msg.messageRef = 0; + msg.cdmaMessage = (std::vector){cdmaSmsMessage}; + msg.gsmMessage = (std::vector){}; + + radio_messaging->sendImsSms(serial, msg); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, + {RadioError::INVALID_ARGUMENTS}, CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "sendImsSms finished"; +} + +/* + * Test IRadioMessaging.getSmscAddress() for the response returned. + */ +TEST_P(RadioMessagingTest, getSmscAddress) { + LOG(DEBUG) << "getSmscAddress"; + serial = GetRandomSerialNumber(); + + radio_messaging->getSmscAddress(serial); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, + {RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE, + RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "getSmscAddress finished"; +} + +/* + * Test IRadioMessaging.setSmscAddress() for the response returned. + */ +TEST_P(RadioMessagingTest, setSmscAddress) { + LOG(DEBUG) << "setSmscAddress"; + serial = GetRandomSerialNumber(); + std::string address = std::string("smscAddress"); + + radio_messaging->setSmscAddress(serial, address); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_SMS_FORMAT, + RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "setSmscAddress finished"; +} + +/* + * Test IRadioMessaging.writeSmsToSim() for the response returned. + */ +TEST_P(RadioMessagingTest, writeSmsToSim) { + LOG(DEBUG) << "writeSmsToSim"; + serial = GetRandomSerialNumber(); + SmsWriteArgs smsWriteArgs; + smsWriteArgs.status = SmsWriteArgs::STATUS_REC_UNREAD; + smsWriteArgs.smsc = ""; + smsWriteArgs.pdu = "01000b916105770203f3000006d4f29c3e9b01"; + + radio_messaging->writeSmsToSim(serial, smsWriteArgs); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_messaging->rspInfo.error, + {RadioError::NONE, RadioError::ENCODING_ERR, RadioError::INVALID_ARGUMENTS, + RadioError::INVALID_SMSC_ADDRESS, RadioError::MODEM_ERR, + RadioError::NETWORK_NOT_READY, RadioError::NO_RESOURCES, RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "writeSmsToSim finished"; +} + +/* + * Test IRadioMessaging.deleteSmsOnSim() for the response returned. + */ +TEST_P(RadioMessagingTest, deleteSmsOnSim) { + LOG(DEBUG) << "deleteSmsOnSim"; + serial = GetRandomSerialNumber(); + int index = 1; + + radio_messaging->deleteSmsOnSim(serial, index); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_messaging->rspInfo.error, + {RadioError::NONE, RadioError::ENCODING_ERR, RadioError::INVALID_ARGUMENTS, + RadioError::INVALID_MODEM_STATE, RadioError::NO_SUCH_ENTRY, RadioError::MODEM_ERR, + RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "deleteSmsOnSim finished"; +} + +/* + * Test IRadioMessaging.writeSmsToRuim() for the response returned. + */ +TEST_P(RadioMessagingTest, writeSmsToRuim) { + LOG(DEBUG) << "writeSmsToRuim"; + serial = GetRandomSerialNumber(); + + // Create a CdmaSmsAddress + CdmaSmsAddress cdmaSmsAddress; + cdmaSmsAddress.digitMode = CdmaSmsAddress::DIGIT_MODE_FOUR_BIT; + cdmaSmsAddress.isNumberModeDataNetwork = false; + cdmaSmsAddress.numberType = CdmaSmsAddress::NUMBER_TYPE_UNKNOWN; + cdmaSmsAddress.numberPlan = CdmaSmsAddress::NUMBER_PLAN_UNKNOWN; + cdmaSmsAddress.digits = (std::vector){11, 1, 6, 5, 10, 7, 7, 2, 10, 3, 10, 3}; + + // Create a CdmaSmsSubAddress + CdmaSmsSubaddress cdmaSmsSubaddress; + cdmaSmsSubaddress.subaddressType = CdmaSmsSubaddress::SUBADDRESS_TYPE_NSAP; + cdmaSmsSubaddress.odd = false; + cdmaSmsSubaddress.digits = (std::vector){}; + + // Create a CdmaSmsMessage + CdmaSmsMessage cdmaSmsMessage; + cdmaSmsMessage.teleserviceId = 4098; + cdmaSmsMessage.isServicePresent = false; + cdmaSmsMessage.serviceCategory = 0; + cdmaSmsMessage.address = cdmaSmsAddress; + cdmaSmsMessage.subAddress = cdmaSmsSubaddress; + cdmaSmsMessage.bearerData = + (std::vector){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0}; + + // Create a CdmaSmsWriteArgs + CdmaSmsWriteArgs cdmaSmsWriteArgs; + cdmaSmsWriteArgs.status = CdmaSmsWriteArgs::STATUS_REC_UNREAD; + cdmaSmsWriteArgs.message = cdmaSmsMessage; + + radio_messaging->writeSmsToRuim(serial, cdmaSmsWriteArgs); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_messaging->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::INVALID_SMS_FORMAT, + RadioError::INVALID_SMSC_ADDRESS, RadioError::INVALID_STATE, RadioError::MODEM_ERR, + RadioError::NO_SUCH_ENTRY, RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "writeSmsToRuim finished"; +} + +/* + * Test IRadioMessaging.deleteSmsOnRuim() for the response returned. + */ +TEST_P(RadioMessagingTest, deleteSmsOnRuim) { + LOG(DEBUG) << "deleteSmsOnRuim"; + serial = GetRandomSerialNumber(); + int index = 1; + + // Create a CdmaSmsAddress + CdmaSmsAddress cdmaSmsAddress; + cdmaSmsAddress.digitMode = CdmaSmsAddress::DIGIT_MODE_FOUR_BIT; + cdmaSmsAddress.isNumberModeDataNetwork = false; + cdmaSmsAddress.numberType = CdmaSmsAddress::NUMBER_TYPE_UNKNOWN; + cdmaSmsAddress.numberPlan = CdmaSmsAddress::NUMBER_PLAN_UNKNOWN; + cdmaSmsAddress.digits = (std::vector){11, 1, 6, 5, 10, 7, 7, 2, 10, 3, 10, 3}; + + // Create a CdmaSmsSubAddress + CdmaSmsSubaddress cdmaSmsSubaddress; + cdmaSmsSubaddress.subaddressType = CdmaSmsSubaddress::SUBADDRESS_TYPE_NSAP; + cdmaSmsSubaddress.odd = false; + cdmaSmsSubaddress.digits = (std::vector){}; + + // Create a CdmaSmsMessage + CdmaSmsMessage cdmaSmsMessage; + cdmaSmsMessage.teleserviceId = 4098; + cdmaSmsMessage.isServicePresent = false; + cdmaSmsMessage.serviceCategory = 0; + cdmaSmsMessage.address = cdmaSmsAddress; + cdmaSmsMessage.subAddress = cdmaSmsSubaddress; + cdmaSmsMessage.bearerData = + (std::vector){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0}; + + // Create a CdmaSmsWriteArgs + CdmaSmsWriteArgs cdmaSmsWriteArgs; + cdmaSmsWriteArgs.status = CdmaSmsWriteArgs::STATUS_REC_UNREAD; + cdmaSmsWriteArgs.message = cdmaSmsMessage; + + radio_messaging->deleteSmsOnRuim(serial, index); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_messaging->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::INVALID_MODEM_STATE, + RadioError::MODEM_ERR, RadioError::NO_SUCH_ENTRY, RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "deleteSmsOnRuim finished"; +} + +/* + * Test IRadioMessaging.reportSmsMemoryStatus() for the response returned. + */ +TEST_P(RadioMessagingTest, reportSmsMemoryStatus) { + LOG(DEBUG) << "reportSmsMemoryStatus"; + serial = GetRandomSerialNumber(); + bool available = true; + + radio_messaging->reportSmsMemoryStatus(serial, available); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, + RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "reportSmsMemoryStatus finished"; +} + +/* + * Test IRadioMessaging.sendUssd() for the response returned. + */ +TEST_P(RadioMessagingTest, sendUssd) { + LOG(DEBUG) << "sendUssd"; + serial = GetRandomSerialNumber(); + radio_messaging->sendUssd(serial, std::string("test")); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_messaging->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "sendUssd finished"; +} + +/* + * Test IRadioMessaging.cancelPendingUssd() for the response returned. + */ +TEST_P(RadioMessagingTest, cancelPendingUssd) { + LOG(DEBUG) << "cancelPendingUssd"; + serial = GetRandomSerialNumber(); + + radio_messaging->cancelPendingUssd(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); + EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_messaging->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "cancelPendingUssd finished"; +} diff --git a/radio/aidl/vts/radio_modem_response.cpp b/radio/aidl/vts/radio_modem_response.cpp index 53bfab40a9..d2715a8198 100644 --- a/radio/aidl/vts/radio_modem_response.cpp +++ b/radio/aidl/vts/radio_modem_response.cpp @@ -22,70 +22,99 @@ ndk::ScopedAStatus RadioModemResponse::acknowledgeRequest(int32_t /*serial*/) { return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioModemResponse::enableModemResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioModemResponse::enableModemResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioModemResponse::getBasebandVersionResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioModemResponse::getBasebandVersionResponse(const RadioResponseInfo& info, const std::string& /*version*/) { + rspInfo = info; + parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioModemResponse::getDeviceIdentityResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioModemResponse::getDeviceIdentityResponse(const RadioResponseInfo& info, const std::string& /*imei*/, const std::string& /*imeisv*/, const std::string& /*esn*/, const std::string& /*meid*/) { + rspInfo = info; + parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioModemResponse::getHardwareConfigResponse( - const RadioResponseInfo& /*info*/, const std::vector& /*config*/) { + const RadioResponseInfo& info, const std::vector& /*config*/) { + rspInfo = info; + parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioModemResponse::getModemActivityInfoResponse( - const RadioResponseInfo& /*info*/, const ActivityStatsInfo& /*activityInfo*/) { + const RadioResponseInfo& info, const ActivityStatsInfo& /*activityInfo*/) { + rspInfo = info; + parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioModemResponse::getModemStackStatusResponse( - const RadioResponseInfo& /*info*/, const bool /*enabled*/) { +ndk::ScopedAStatus RadioModemResponse::getModemStackStatusResponse(const RadioResponseInfo& info, + const bool enabled) { + rspInfo = info; + isModemEnabled = enabled; + parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioModemResponse::getRadioCapabilityResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioModemResponse::getRadioCapabilityResponse(const RadioResponseInfo& info, const RadioCapability& /*rc*/) { + rspInfo = info; + parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioModemResponse::nvReadItemResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioModemResponse::nvReadItemResponse(const RadioResponseInfo& info, const std::string& /*result*/) { + rspInfo = info; + parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioModemResponse::nvResetConfigResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioModemResponse::nvResetConfigResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioModemResponse::nvWriteCdmaPrlResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioModemResponse::nvWriteCdmaPrlResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioModemResponse::nvWriteItemResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioModemResponse::nvWriteItemResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioModemResponse::requestShutdownResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioModemResponse::requestShutdownResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioModemResponse::sendDeviceStateResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioModemResponse::sendDeviceStateResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioModemResponse::setRadioCapabilityResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioModemResponse::setRadioCapabilityResponse(const RadioResponseInfo& info, const RadioCapability& /*rc*/) { + rspInfo = info; + parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } diff --git a/radio/aidl/vts/radio_modem_test.cpp b/radio/aidl/vts/radio_modem_test.cpp index b40bb7b573..f88da13af1 100644 --- a/radio/aidl/vts/radio_modem_test.cpp +++ b/radio/aidl/vts/radio_modem_test.cpp @@ -87,3 +87,301 @@ TEST_P(RadioModemTest, setRadioPower_emergencyCall_cancelled) { EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error); } + +/* + * Test IRadioModem.enableModem() for the response returned. + */ +TEST_P(RadioModemTest, enableModem) { + serial = GetRandomSerialNumber(); + + if (isSsSsEnabled()) { + ALOGI("enableModem, no need to test in single SIM mode"); + return; + } + + bool responseToggle = radioRsp_modem->enableModemResponseToggle; + ndk::ScopedAStatus res = radio_modem->enableModem(serial, true); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + ALOGI("getModemStackStatus, rspInfo.error = %s\n", + toString(radioRsp_modem->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, + RadioError::MODEM_ERR, RadioError::INVALID_STATE})); + + // checking if getModemStackStatus returns true, as modem was enabled above + if (RadioError::NONE == radioRsp_modem->rspInfo.error) { + // wait until modem enabling is finished + while (responseToggle == radioRsp_modem->enableModemResponseToggle) { + sleep(1); + } + ndk::ScopedAStatus resEnabled = radio_modem->getModemStackStatus(serial); + ASSERT_OK(resEnabled); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + ALOGI("getModemStackStatus, rspInfo.error = %s\n", + toString(radioRsp_modem->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, + RadioError::MODEM_ERR, RadioError::INVALID_STATE})); + // verify that enableModem did set isEnabled correctly + EXPECT_EQ(true, radioRsp_modem->isModemEnabled); + } +} + +/* + * Test IRadioModem.getModemStackStatus() for the response returned. + */ +TEST_P(RadioModemTest, getModemStackStatus) { + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_modem->getModemStackStatus(serial); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + ALOGI("getModemStackStatus, rspInfo.error = %s\n", + toString(radioRsp_modem->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_modem->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR})); +} + +/* + * Test IRadioModem.getBasebandVersion() for the response returned. + */ +TEST_P(RadioModemTest, getBasebandVersion) { + LOG(DEBUG) << "getBasebandVersion"; + serial = GetRandomSerialNumber(); + + radio_modem->getBasebandVersion(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error); + } + LOG(DEBUG) << "getBasebandVersion finished"; +} + +/* + * Test IRadioModem.getDeviceIdentity() for the response returned. + */ +TEST_P(RadioModemTest, getDeviceIdentity) { + LOG(DEBUG) << "getDeviceIdentity"; + serial = GetRandomSerialNumber(); + + radio_modem->getDeviceIdentity(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, + {RadioError::NONE, RadioError::EMPTY_RECORD})); + } + LOG(DEBUG) << "getDeviceIdentity finished"; +} + +/* + * Test IRadioModem.nvReadItem() for the response returned. + */ +TEST_P(RadioModemTest, nvReadItem) { + LOG(DEBUG) << "nvReadItem"; + serial = GetRandomSerialNumber(); + + radio_modem->nvReadItem(serial, NvItem::LTE_BAND_ENABLE_25); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "nvReadItem finished"; +} + +/* + * Test IRadioModem.nvWriteItem() for the response returned. + */ +TEST_P(RadioModemTest, nvWriteItem) { + LOG(DEBUG) << "nvWriteItem"; + serial = GetRandomSerialNumber(); + NvWriteItem item; + memset(&item, 0, sizeof(item)); + item.value = std::string(); + + radio_modem->nvWriteItem(serial, item); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "nvWriteItem finished"; +} + +/* + * Test IRadioModem.nvWriteCdmaPrl() for the response returned. + */ +TEST_P(RadioModemTest, nvWriteCdmaPrl) { + LOG(DEBUG) << "nvWriteCdmaPrl"; + serial = GetRandomSerialNumber(); + std::vector prl = {1, 2, 3, 4, 5}; + + radio_modem->nvWriteCdmaPrl(serial, std::vector(prl)); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "nvWriteCdmaPrl finished"; +} + +/* + * Test IRadioModem.nvResetConfig() for the response returned. + */ +TEST_P(RadioModemTest, nvResetConfig) { + LOG(DEBUG) << "nvResetConfig"; + serial = GetRandomSerialNumber(); + + radio_modem->nvResetConfig(serial, ResetNvType::FACTORY_RESET); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); + } + LOG(DEBUG) << "nvResetConfig finished"; +} + +/* + * Test IRadioModem.getHardwareConfig() for the response returned. + */ +TEST_P(RadioModemTest, getHardwareConfig) { + LOG(DEBUG) << "getHardwareConfig"; + serial = GetRandomSerialNumber(); + + radio_modem->getHardwareConfig(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "getHardwareConfig finished"; +} + +/* + * The following test is disabled due to b/64734869 + * + * Test IRadioModem.requestShutdown() for the response returned. + */ +TEST_P(RadioModemTest, DISABLED_requestShutdown) { + serial = GetRandomSerialNumber(); + + radio_modem->requestShutdown(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE}, + CHECK_GENERAL_ERROR)); + } +} + +/* + * Test IRadioModem.getRadioCapability() for the response returned. + */ +TEST_P(RadioModemTest, getRadioCapability) { + LOG(DEBUG) << "getRadioCapability"; + serial = GetRandomSerialNumber(); + + radio_modem->getRadioCapability(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error); + } + LOG(DEBUG) << "getRadioCapability finished"; +} + +/* + * Test IRadioModem.setRadioCapability() for the response returned. + */ +TEST_P(RadioModemTest, setRadioCapability) { + LOG(DEBUG) << "setRadioCapability"; + serial = GetRandomSerialNumber(); + RadioCapability rc; + memset(&rc, 0, sizeof(rc)); + rc.logicalModemUuid = std::string(); + + radio_modem->setRadioCapability(serial, rc); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "setRadioCapability finished"; +} + +/* + * Test IRadioModem.getModemActivityInfo() for the response returned. + */ +TEST_P(RadioModemTest, getModemActivityInfo) { + LOG(DEBUG) << "getModemActivityInfo"; + serial = GetRandomSerialNumber(); + + radio_modem->getModemActivityInfo(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); + } + LOG(DEBUG) << "getModemActivityInfo finished"; +} + +/* + * Test IRadioModem.sendDeviceState() for the response returned. + */ +TEST_P(RadioModemTest, sendDeviceState) { + LOG(DEBUG) << "sendDeviceState"; + serial = GetRandomSerialNumber(); + + radio_modem->sendDeviceState(serial, DeviceStateType::POWER_SAVE_MODE, true); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type); + EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial); + + std::cout << static_cast(radioRsp_modem->rspInfo.error) << std::endl; + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); + } + LOG(DEBUG) << "sendDeviceState finished"; +} diff --git a/radio/aidl/vts/radio_network_response.cpp b/radio/aidl/vts/radio_network_response.cpp index ccae0f3458..666d617771 100644 --- a/radio/aidl/vts/radio_network_response.cpp +++ b/radio/aidl/vts/radio_network_response.cpp @@ -31,7 +31,10 @@ ndk::ScopedAStatus RadioNetworkResponse::getAllowedNetworkTypesBitmapResponse( } ndk::ScopedAStatus RadioNetworkResponse::getAvailableBandModesResponse( - const RadioResponseInfo& /*info*/, const std::vector& /*bandModes*/) { + const RadioResponseInfo& info, const std::vector& bandModes) { + rspInfo = info; + radioBandModes = bandModes; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -44,48 +47,64 @@ ndk::ScopedAStatus RadioNetworkResponse::getAvailableNetworksResponse( } ndk::ScopedAStatus RadioNetworkResponse::getBarringInfoResponse( - const RadioResponseInfo& /*info*/, const CellIdentity& /*cellIdentity*/, - const std::vector& /*barringInfos*/) { + const RadioResponseInfo& info, const CellIdentity& cellIdentity, + const std::vector& barringInfos) { + rspInfo = info; + barringCellIdentity = cellIdentity; + barringInfoList = barringInfos; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::getCdmaRoamingPreferenceResponse( - const RadioResponseInfo& /*info*/, CdmaRoamingType /*type*/) { + const RadioResponseInfo& info, CdmaRoamingType /*type*/) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::getCellInfoListResponse( - const RadioResponseInfo& /*info*/, const std::vector& /*cellInfo*/) { + const RadioResponseInfo& info, const std::vector& /*cellInfo*/) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::getDataRegistrationStateResponse( - const RadioResponseInfo& info, const RegStateResult& /*regResponse*/) { + const RadioResponseInfo& info, const RegStateResult& regResponse) { rspInfo = info; + dataRegResp = regResponse; parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::getImsRegistrationStateResponse( - const RadioResponseInfo& /*info*/, bool /*isRegistered*/, - RadioTechnologyFamily /*ratFamily*/) { + const RadioResponseInfo& info, bool /*isRegistered*/, RadioTechnologyFamily /*ratFamily*/) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::getNetworkSelectionModeResponse( - const RadioResponseInfo& /*info*/, bool /*manual*/) { + const RadioResponseInfo& info, bool /*manual*/) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioNetworkResponse::getOperatorResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioNetworkResponse::getOperatorResponse(const RadioResponseInfo& info, const std::string& /*longName*/, const std::string& /*shortName*/, const std::string& /*numeric*/) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::getSignalStrengthResponse( - const RadioResponseInfo& /*info*/, const SignalStrength& /*sig_strength*/) { + const RadioResponseInfo& info, const SignalStrength& /*sig_strength*/) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -105,14 +124,16 @@ ndk::ScopedAStatus RadioNetworkResponse::getUsageSettingResponse(const RadioResp } ndk::ScopedAStatus RadioNetworkResponse::getVoiceRadioTechnologyResponse( - const RadioResponseInfo& /*info*/, RadioTechnology /*rat*/) { + const RadioResponseInfo& info, RadioTechnology /*rat*/) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::getVoiceRegistrationStateResponse( const RadioResponseInfo& info, const RegStateResult& regResponse) { rspInfo = info; - voiceRegResp.regState = regResponse.regState; + voiceRegResp = regResponse; parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -132,47 +153,63 @@ ndk::ScopedAStatus RadioNetworkResponse::setAllowedNetworkTypesBitmapResponse( return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioNetworkResponse::setBandModeResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioNetworkResponse::setBandModeResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioNetworkResponse::setBarringPasswordResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioNetworkResponse::setBarringPasswordResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::setCdmaRoamingPreferenceResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::setCellInfoListRateResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::setIndicationFilterResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::setLinkCapacityReportingCriteriaResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioNetworkResponse::setLocationUpdatesResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioNetworkResponse::setLocationUpdatesResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::setNetworkSelectionModeAutomaticResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::setNetworkSelectionModeManualResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -184,17 +221,23 @@ ndk::ScopedAStatus RadioNetworkResponse::setNrDualConnectivityStateResponse( } ndk::ScopedAStatus RadioNetworkResponse::setSignalStrengthReportingCriteriaResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::setSuppServiceNotificationsResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::setSystemSelectionChannelsResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -204,17 +247,21 @@ ndk::ScopedAStatus RadioNetworkResponse::setUsageSettingResponse(const RadioResp return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioNetworkResponse::startNetworkScanResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioNetworkResponse::startNetworkScanResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioNetworkResponse::stopNetworkScanResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioNetworkResponse::stopNetworkScanResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioNetworkResponse::supplyNetworkDepersonalizationResponse( - const RadioResponseInfo& /*info*/, int32_t /*remainingRetries*/) { + const RadioResponseInfo& info, int32_t /*remainingRetries*/) { + rspInfo = info; + 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 93c4c35686..1c2d50fd9b 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -58,6 +59,12 @@ void RadioNetworkTest::SetUp() { ASSERT_NE(nullptr, radio_config.get()); } +void RadioNetworkTest::stopNetworkScan() { + serial = GetRandomSerialNumber(); + radio_network->stopNetworkScan(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); +} + /* * Test IRadioNetwork.setAllowedNetworkTypesBitmap for the response returned. */ @@ -263,3 +270,1485 @@ TEST_P(RadioNetworkTest, setUsageSetting) { // Check that indeed the original setting was reset. ASSERT_TRUE(originalSetting == radioRsp_network->usageSetting); } + +/* + * Test IRadioNetwork.setSignalStrengthReportingCriteria() with invalid hysteresisDb + */ +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_invalidHysteresisDb) { + serial = GetRandomSerialNumber(); + + SignalThresholdInfo signalThresholdInfo; + signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSI; + signalThresholdInfo.hysteresisMs = 5000; + signalThresholdInfo.hysteresisDb = 10; // hysteresisDb too large given threshold list deltas + signalThresholdInfo.thresholds = {-109, -103, -97, -89}; + signalThresholdInfo.isEnabled = true; + signalThresholdInfo.ran = AccessNetwork::GERAN; + + ndk::ScopedAStatus res = + radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo}); + 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); + + ALOGI("setSignalStrengthReportingCriteria_invalidHysteresisDb, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::INVALID_ARGUMENTS})); +} + +/* + * Test IRadioNetwork.setSignalStrengthReportingCriteria() with empty thresholds + */ +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_EmptyThresholds) { + serial = GetRandomSerialNumber(); + + SignalThresholdInfo signalThresholdInfo; + signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSI; + signalThresholdInfo.hysteresisMs = 0; + signalThresholdInfo.hysteresisDb = 0; + signalThresholdInfo.isEnabled = true; + signalThresholdInfo.ran = AccessNetwork::GERAN; + + ndk::ScopedAStatus res = + radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo}); + 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); + + ALOGI("setSignalStrengthReportingCriteria_EmptyParams, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE})); +} + +/* + * Test IRadioNetwork.setSignalStrengthReportingCriteria() for GERAN + */ +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Geran) { + serial = GetRandomSerialNumber(); + + SignalThresholdInfo signalThresholdInfo; + signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSI; + signalThresholdInfo.hysteresisMs = 5000; + signalThresholdInfo.hysteresisDb = 2; + signalThresholdInfo.thresholds = {-109, -103, -97, -89}; + signalThresholdInfo.isEnabled = true; + signalThresholdInfo.ran = AccessNetwork::GERAN; + + ndk::ScopedAStatus res = + radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo}); + 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); + + ALOGI("setSignalStrengthReportingCriteria_Geran, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE})); +} + +/* + * Test IRadioNetwork.setSignalStrengthReportingCriteria() for UTRAN + */ +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Utran) { + serial = GetRandomSerialNumber(); + + SignalThresholdInfo signalThresholdInfo; + signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSCP; + signalThresholdInfo.hysteresisMs = 5000; + signalThresholdInfo.hysteresisDb = 2; + signalThresholdInfo.thresholds = {-110, -97, -73, -49, -25}; + signalThresholdInfo.isEnabled = true; + signalThresholdInfo.ran = AccessNetwork::UTRAN; + + ndk::ScopedAStatus res = + radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo}); + 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); + + ALOGI("setSignalStrengthReportingCriteria_Utran, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE})); +} + +/* + * Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN + */ +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Eutran_RSRP) { + serial = GetRandomSerialNumber(); + + SignalThresholdInfo signalThresholdInfo; + signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSRP; + signalThresholdInfo.hysteresisMs = 5000; + signalThresholdInfo.hysteresisDb = 2; + signalThresholdInfo.thresholds = {-128, -108, -88, -68}; + signalThresholdInfo.isEnabled = true; + signalThresholdInfo.ran = AccessNetwork::EUTRAN; + + ndk::ScopedAStatus res = + radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo}); + 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); + + ALOGI("setSignalStrengthReportingCriteria_Eutran, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE})); +} + +/* + * Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN + */ +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Eutran_RSRQ) { + serial = GetRandomSerialNumber(); + + SignalThresholdInfo signalThresholdInfo; + signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSRQ; + signalThresholdInfo.hysteresisMs = 5000; + signalThresholdInfo.hysteresisDb = 2; + signalThresholdInfo.thresholds = {-27, -20, -13, -6}; + signalThresholdInfo.isEnabled = true; + signalThresholdInfo.ran = AccessNetwork::EUTRAN; + + ndk::ScopedAStatus res = + radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo}); + 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); + + ALOGI("setSignalStrengthReportingCriteria_Eutran, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE})); +} + +/* + * Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN + */ +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Eutran_RSSNR) { + serial = GetRandomSerialNumber(); + + SignalThresholdInfo signalThresholdInfo; + signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSNR; + signalThresholdInfo.hysteresisMs = 5000; + signalThresholdInfo.hysteresisDb = 2; + signalThresholdInfo.thresholds = {-10, 0, 10, 20}; + signalThresholdInfo.isEnabled = true; + signalThresholdInfo.ran = AccessNetwork::EUTRAN; + + ndk::ScopedAStatus res = + radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo}); + 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); +} + +/* + * Test IRadioNetwork.setSignalStrengthReportingCriteria() for CDMA2000 + */ +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Cdma2000) { + serial = GetRandomSerialNumber(); + + SignalThresholdInfo signalThresholdInfo; + signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSI; + signalThresholdInfo.hysteresisMs = 5000; + signalThresholdInfo.hysteresisDb = 2; + signalThresholdInfo.thresholds = {-105, -90, -75, -65}; + signalThresholdInfo.isEnabled = true; + signalThresholdInfo.ran = AccessNetwork::CDMA2000; + + ndk::ScopedAStatus res = + radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo}); + 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); + + ALOGI("setSignalStrengthReportingCriteria_Cdma2000, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE})); +} + +/* + * Test IRadioNetwork.setSignalStrengthReportingCriteria() for NGRAN_SSRSRP + */ +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_NGRAN_SSRSRP) { + serial = GetRandomSerialNumber(); + + SignalThresholdInfo signalThresholdInfo; + signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_SSRSRP; + signalThresholdInfo.hysteresisMs = 5000; + signalThresholdInfo.hysteresisDb = 0; + signalThresholdInfo.thresholds = {-105, -90, -75, -65}; + signalThresholdInfo.isEnabled = true; + signalThresholdInfo.ran = AccessNetwork::NGRAN; + + ndk::ScopedAStatus res = + radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo}); + 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); + + ALOGI("setSignalStrengthReportingCriteria_NGRAN_SSRSRP, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + + // Allow REQUEST_NOT_SUPPORTED because some non-5G device may not support NGRAN for + // setSignalStrengthReportingCriteria() + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); +} + +/* + * Test IRadioNetwork.setSignalStrengthReportingCriteria() for NGRAN_SSRSRQ + */ +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_NGRAN_SSRSRQ) { + serial = GetRandomSerialNumber(); + + SignalThresholdInfo signalThresholdInfo; + signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_SSRSRQ; + signalThresholdInfo.hysteresisMs = 5000; + signalThresholdInfo.hysteresisDb = 0; + signalThresholdInfo.thresholds = {-43, -20, 0, 20}; + signalThresholdInfo.isEnabled = true; + signalThresholdInfo.ran = AccessNetwork::NGRAN; + + ndk::ScopedAStatus res = + radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo}); + 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); + + ALOGI("setSignalStrengthReportingCriteria_NGRAN_SSRSRQ, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + + // Allow REQUEST_NOT_SUPPORTED because some non-5G device may not support NGRAN for + // setSignalStrengthReportingCriteria() + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); +} + +/* + * Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN + */ +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Disable_RSSNR) { + serial = GetRandomSerialNumber(); + + SignalThresholdInfo signalThresholdInfo; + signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSNR; + signalThresholdInfo.hysteresisMs = 5000; + signalThresholdInfo.hysteresisDb = 2; + signalThresholdInfo.thresholds = {-10, 0, 10, 20}; + signalThresholdInfo.isEnabled = false; + signalThresholdInfo.ran = AccessNetwork::EUTRAN; + + ndk::ScopedAStatus res = + radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo}); + 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); +} + +/* + * Test IRadioNetwork.setSignalStrengthReportingCriteria() for NGRAN_SSSINR + */ +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_NGRAN_SSSINR) { + serial = GetRandomSerialNumber(); + + SignalThresholdInfo signalThresholdInfo; + signalThresholdInfo.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_SSSINR; + signalThresholdInfo.hysteresisMs = 5000; + signalThresholdInfo.hysteresisDb = 0; + signalThresholdInfo.thresholds = {-10, 3, 16, 18}; + signalThresholdInfo.isEnabled = true; + signalThresholdInfo.ran = AccessNetwork::NGRAN; + + ndk::ScopedAStatus res = + radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo}); + 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); + + ALOGI("setSignalStrengthReportingCriteria_NGRAN_SSSINR, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + + // Allow REQUEST_NOT_SUPPORTED because some non-5G device may not support NGRAN for + // setSignalStrengthReportingCriteria() + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); +} + +/* + * Test IRadioNetwork.setLinkCapacityReportingCriteria() invalid hysteresisDlKbps + */ +TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_invalidHysteresisDlKbps) { + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria( + serial, 5000, + 5000, // hysteresisDlKbps too big for thresholds delta + 100, {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000}, AccessNetwork::GERAN); + 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); + + ALOGI("setLinkCapacityReportingCriteria_invalidHysteresisDlKbps, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + // Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria() may not be supported + // for GERAN + ASSERT_TRUE( + CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); +} + +/* + * Test IRadioNetwork.setLinkCapacityReportingCriteria() invalid hysteresisUlKbps + */ +TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_invalidHysteresisUlKbps) { + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria( + serial, 5000, 500, 1000, // hysteresisUlKbps too big for thresholds delta + {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000}, AccessNetwork::GERAN); + 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); + + ALOGI("setLinkCapacityReportingCriteria_invalidHysteresisUlKbps, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + // Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria() may not be supported + // for GERAN + ASSERT_TRUE( + CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); +} + +/* + * Test IRadioNetwork.setLinkCapacityReportingCriteria() empty params + */ +TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_emptyParams) { + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria( + serial, 0, 0, 0, {}, {}, AccessNetwork::GERAN); + 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); + + ALOGI("setLinkCapacityReportingCriteria_emptyParams, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + // Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria() may not be supported + // for GERAN + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); +} + +/* + * Test IRadioNetwork.setLinkCapacityReportingCriteria() for GERAN + */ +TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_Geran) { + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria( + serial, 5000, 500, 100, {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000}, + AccessNetwork::GERAN); + 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); + + ALOGI("setLinkCapacityReportingCriteria_Geran, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + // Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria() may not be supported + // for GERAN + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); +} + +/* + * Test IRadioNetwork.setSystemSelectionChannels() for the response returned. + */ +TEST_P(RadioNetworkTest, setSystemSelectionChannels) { + serial = GetRandomSerialNumber(); + + RadioAccessSpecifierBands bandP900 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_P900}); + RadioAccessSpecifierBands band850 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_850}); + RadioAccessSpecifier specifierP900 = { + .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}}; + RadioAccessSpecifier specifier850 = { + .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}}; + + ndk::ScopedAStatus res = + radio_network->setSystemSelectionChannels(serial, true, {specifierP900, specifier850}); + 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); + ALOGI("setSystemSelectionChannels, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR})); + + if (radioRsp_network->rspInfo.error == RadioError::NONE) { + serial = GetRandomSerialNumber(); + ndk::ScopedAStatus res = radio_network->setSystemSelectionChannels( + serial, false, {specifierP900, specifier850}); + 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); + ALOGI("setSystemSelectionChannels, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error); + } +} + +/* + * Test IRadioNetwork.startNetworkScan() for the response returned. + */ +TEST_P(RadioNetworkTest, startNetworkScan) { + serial = GetRandomSerialNumber(); + + RadioAccessSpecifierBands bandP900 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_P900}); + RadioAccessSpecifierBands band850 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_850}); + RadioAccessSpecifier specifierP900 = { + .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}}; + RadioAccessSpecifier specifier850 = { + .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}}; + + NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT, + .interval = 60, + .specifiers = {specifierP900, specifier850}, + .maxSearchTime = 60, + .incrementalResults = false, + .incrementalResultsPeriodicity = 1}; + + ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request); + 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); + ALOGI("startNetworkScan, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::SIM_ABSENT})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + // OPERATION_NOT_ALLOWED should not be allowed; however, some vendors do + // not support the required manual GSM search functionality. This is + // tracked in b/112206766. Modems have "GSM" rat scan need to + // support scanning requests combined with some parameters. + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED})); + } + + if (radioRsp_network->rspInfo.error == RadioError::NONE) { + ALOGI("Stop Network Scan"); + stopNetworkScan(); + } +} + +/* + * Test IRadioNetwork.startNetworkScan() with invalid specifier. + */ +TEST_P(RadioNetworkTest, startNetworkScan_InvalidArgument) { + serial = GetRandomSerialNumber(); + + NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT, .interval = 60}; + + ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request); + 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); + ALOGI("startNetworkScan_InvalidArgument, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); + } +} + +/* + * Test IRadioNetwork.startNetworkScan() with invalid interval (lower boundary). + */ +TEST_P(RadioNetworkTest, startNetworkScan_InvalidInterval1) { + serial = GetRandomSerialNumber(); + + RadioAccessSpecifierBands bandP900 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_P900}); + RadioAccessSpecifierBands band850 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_850}); + RadioAccessSpecifier specifierP900 = { + .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}}; + RadioAccessSpecifier specifier850 = { + .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}}; + + NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT, + .interval = 4, + .specifiers = {specifierP900, specifier850}, + .maxSearchTime = 60, + .incrementalResults = false, + .incrementalResultsPeriodicity = 1}; + + ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request); + 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); + ALOGI("startNetworkScan_InvalidInterval1, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); + } +} + +/* + * Test IRadioNetwork.startNetworkScan() with invalid interval (upper boundary). + */ +TEST_P(RadioNetworkTest, startNetworkScan_InvalidInterval2) { + serial = GetRandomSerialNumber(); + + RadioAccessSpecifierBands bandP900 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_P900}); + RadioAccessSpecifierBands band850 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_850}); + RadioAccessSpecifier specifierP900 = { + .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}}; + RadioAccessSpecifier specifier850 = { + .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}}; + + NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT, + .interval = 301, + .specifiers = {specifierP900, specifier850}, + .maxSearchTime = 60, + .incrementalResults = false, + .incrementalResultsPeriodicity = 1}; + + ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request); + 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); + ALOGI("startNetworkScan_InvalidInterval2, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); + } +} + +/* + * Test IRadioNetwork.startNetworkScan() with invalid max search time (lower boundary). + */ +TEST_P(RadioNetworkTest, startNetworkScan_InvalidMaxSearchTime1) { + serial = GetRandomSerialNumber(); + + RadioAccessSpecifierBands bandP900 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_P900}); + RadioAccessSpecifierBands band850 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_850}); + RadioAccessSpecifier specifierP900 = { + .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}}; + RadioAccessSpecifier specifier850 = { + .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}}; + + NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT, + .interval = 60, + .specifiers = {specifierP900, specifier850}, + .maxSearchTime = 59, + .incrementalResults = false, + .incrementalResultsPeriodicity = 1}; + + ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request); + 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); + ALOGI("startNetworkScan_InvalidMaxSearchTime1, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); + } +} + +/* + * Test IRadioNetwork.startNetworkScan() with invalid max search time (upper boundary). + */ +TEST_P(RadioNetworkTest, startNetworkScan_InvalidMaxSearchTime2) { + serial = GetRandomSerialNumber(); + + RadioAccessSpecifierBands bandP900 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_P900}); + RadioAccessSpecifierBands band850 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_850}); + RadioAccessSpecifier specifierP900 = { + .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}}; + RadioAccessSpecifier specifier850 = { + .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}}; + + NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT, + .interval = 60, + .specifiers = {specifierP900, specifier850}, + .maxSearchTime = 3601, + .incrementalResults = false, + .incrementalResultsPeriodicity = 1}; + + ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request); + 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); + ALOGI("startNetworkScan_InvalidMaxSearchTime2, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); + } +} + +/* + * Test IRadioNetwork.startNetworkScan() with invalid periodicity (lower boundary). + */ +TEST_P(RadioNetworkTest, startNetworkScan_InvalidPeriodicity1) { + serial = GetRandomSerialNumber(); + + RadioAccessSpecifierBands bandP900 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_P900}); + RadioAccessSpecifierBands band850 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_850}); + RadioAccessSpecifier specifierP900 = { + .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}}; + RadioAccessSpecifier specifier850 = { + .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}}; + + NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT, + .interval = 60, + .specifiers = {specifierP900, specifier850}, + .maxSearchTime = 600, + .incrementalResults = true, + .incrementalResultsPeriodicity = 0}; + + ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request); + 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); + ALOGI("startNetworkScan_InvalidPeriodicity1, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); + } +} + +/* + * Test IRadioNetwork.startNetworkScan() with invalid periodicity (upper boundary). + */ +TEST_P(RadioNetworkTest, startNetworkScan_InvalidPeriodicity2) { + serial = GetRandomSerialNumber(); + + RadioAccessSpecifierBands bandP900 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_P900}); + RadioAccessSpecifierBands band850 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_850}); + RadioAccessSpecifier specifierP900 = { + .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}}; + RadioAccessSpecifier specifier850 = { + .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}}; + + NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT, + .interval = 60, + .specifiers = {specifierP900, specifier850}, + .maxSearchTime = 600, + .incrementalResults = true, + .incrementalResultsPeriodicity = 11}; + + ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request); + 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); + ALOGI("startNetworkScan_InvalidPeriodicity2, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); + } +} + +/* + * Test IRadioNetwork.startNetworkScan() with valid periodicity + */ +TEST_P(RadioNetworkTest, startNetworkScan_GoodRequest1) { + serial = GetRandomSerialNumber(); + + RadioAccessSpecifierBands bandP900 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_P900}); + RadioAccessSpecifierBands band850 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_850}); + RadioAccessSpecifier specifierP900 = { + .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}}; + RadioAccessSpecifier specifier850 = { + .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}}; + + NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT, + .interval = 60, + .specifiers = {specifierP900, specifier850}, + .maxSearchTime = 360, + .incrementalResults = false, + .incrementalResultsPeriodicity = 10}; + + ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request); + 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); + ALOGI("startNetworkScan_GoodRequest1, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::SIM_ABSENT})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, + RadioError::REQUEST_NOT_SUPPORTED})); + } + + if (radioRsp_network->rspInfo.error == RadioError::NONE) { + ALOGI("Stop Network Scan"); + stopNetworkScan(); + } +} + +/* + * Test IRadioNetwork.startNetworkScan() with valid periodicity and plmns + */ +TEST_P(RadioNetworkTest, startNetworkScan_GoodRequest2) { + serial = GetRandomSerialNumber(); + + RadioAccessSpecifierBands bandP900 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_P900}); + RadioAccessSpecifierBands band850 = + RadioAccessSpecifierBands::make( + {GeranBands::BAND_850}); + RadioAccessSpecifier specifierP900 = { + .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}}; + RadioAccessSpecifier specifier850 = { + .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}}; + + NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT, + .interval = 60, + .specifiers = {specifierP900, specifier850}, + .maxSearchTime = 360, + .incrementalResults = false, + .incrementalResultsPeriodicity = 10, + .mccMncs = {"310410"}}; + + ndk::ScopedAStatus res = radio_network->startNetworkScan(serial, request); + 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); + ALOGI("startNetworkScan_GoodRequest2, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::SIM_ABSENT})); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, + RadioError::REQUEST_NOT_SUPPORTED})); + } + + if (radioRsp_network->rspInfo.error == RadioError::NONE) { + ALOGI("Stop Network Scan"); + stopNetworkScan(); + } +} + +/* + * Test IRadioNetwork.setNetworkSelectionModeManual() for the response returned. + */ +TEST_P(RadioNetworkTest, setNetworkSelectionModeManual) { + serial = GetRandomSerialNumber(); + + // can't camp on nonexistent MCCMNC, so we expect this to fail. + ndk::ScopedAStatus res = + radio_network->setNetworkSelectionModeManual(serial, "123456", AccessNetwork::GERAN); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::ILLEGAL_SIM_OR_ME, + RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE}, + CHECK_GENERAL_ERROR)); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, + RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE}, + CHECK_GENERAL_ERROR)); + } +} + +/* + * Test IRadioNetwork.getBarringInfo() for the response returned. + */ +TEST_P(RadioNetworkTest, getBarringInfo) { + serial = GetRandomSerialNumber(); + ndk::ScopedAStatus res = radio_network->getBarringInfo(serial); + 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(radioRsp_network->barringInfoList.size() > 0); + + std::set reportedServices; + + // validate that the service types are in range + for (const auto& info : radioRsp_network->barringInfoList) { + ASSERT_TRUE((info.serviceType >= BarringInfo::SERVICE_TYPE_CS_SERVICE && + info.serviceType <= BarringInfo::SERVICE_TYPE_SMS) || + (info.serviceType >= BarringInfo::SERVICE_TYPE_OPERATOR_1 && + info.serviceType <= BarringInfo::SERVICE_TYPE_OPERATOR_32)); + reportedServices.insert(info.serviceType); + + // Any type that is "conditional" must have valid values for conditional barring + // factor and time. + switch (info.barringType) { + case BarringInfo::BARRING_TYPE_NONE: // fall through + case BarringInfo::BARRING_TYPE_UNCONDITIONAL: + break; + case BarringInfo::BARRING_TYPE_CONDITIONAL: { + const int32_t barringFactor = info.barringTypeSpecificInfo->factor; + ASSERT_TRUE(barringFactor >= 0 && barringFactor <= 100); + ASSERT_TRUE(info.barringTypeSpecificInfo->timeSeconds > 0); + break; + } + default: + FAIL(); + } + } + + // Certain types of barring are relevant for certain RANs. Ensure that only the right + // types are reported. Note that no types are required, simply that for a given technology + // only certain types are valid. This is one way to check that implementations are + // not providing information that they don't have. + static const std::set UTRA_SERVICES{ + BarringInfo::SERVICE_TYPE_CS_SERVICE, BarringInfo::SERVICE_TYPE_PS_SERVICE, + BarringInfo::SERVICE_TYPE_CS_VOICE, BarringInfo::SERVICE_TYPE_EMERGENCY, + BarringInfo::SERVICE_TYPE_SMS, + }; + + static const std::set EUTRA_SERVICES{ + BarringInfo::SERVICE_TYPE_MO_SIGNALLING, BarringInfo::SERVICE_TYPE_MO_DATA, + BarringInfo::SERVICE_TYPE_CS_FALLBACK, BarringInfo::SERVICE_TYPE_MMTEL_VOICE, + BarringInfo::SERVICE_TYPE_MMTEL_VIDEO, BarringInfo::SERVICE_TYPE_EMERGENCY, + BarringInfo::SERVICE_TYPE_SMS, + }; + + static const std::set NGRA_SERVICES = { + BarringInfo::SERVICE_TYPE_MO_SIGNALLING, BarringInfo::SERVICE_TYPE_MO_DATA, + BarringInfo::SERVICE_TYPE_CS_FALLBACK, BarringInfo::SERVICE_TYPE_MMTEL_VOICE, + BarringInfo::SERVICE_TYPE_MMTEL_VIDEO, BarringInfo::SERVICE_TYPE_EMERGENCY, + BarringInfo::SERVICE_TYPE_SMS, BarringInfo::SERVICE_TYPE_OPERATOR_1, + BarringInfo::SERVICE_TYPE_OPERATOR_2, BarringInfo::SERVICE_TYPE_OPERATOR_3, + BarringInfo::SERVICE_TYPE_OPERATOR_4, BarringInfo::SERVICE_TYPE_OPERATOR_5, + BarringInfo::SERVICE_TYPE_OPERATOR_6, BarringInfo::SERVICE_TYPE_OPERATOR_7, + BarringInfo::SERVICE_TYPE_OPERATOR_8, BarringInfo::SERVICE_TYPE_OPERATOR_9, + BarringInfo::SERVICE_TYPE_OPERATOR_10, BarringInfo::SERVICE_TYPE_OPERATOR_11, + BarringInfo::SERVICE_TYPE_OPERATOR_12, BarringInfo::SERVICE_TYPE_OPERATOR_13, + BarringInfo::SERVICE_TYPE_OPERATOR_14, BarringInfo::SERVICE_TYPE_OPERATOR_15, + BarringInfo::SERVICE_TYPE_OPERATOR_16, BarringInfo::SERVICE_TYPE_OPERATOR_17, + BarringInfo::SERVICE_TYPE_OPERATOR_18, BarringInfo::SERVICE_TYPE_OPERATOR_19, + BarringInfo::SERVICE_TYPE_OPERATOR_20, BarringInfo::SERVICE_TYPE_OPERATOR_21, + BarringInfo::SERVICE_TYPE_OPERATOR_22, BarringInfo::SERVICE_TYPE_OPERATOR_23, + BarringInfo::SERVICE_TYPE_OPERATOR_24, BarringInfo::SERVICE_TYPE_OPERATOR_25, + BarringInfo::SERVICE_TYPE_OPERATOR_26, BarringInfo::SERVICE_TYPE_OPERATOR_27, + BarringInfo::SERVICE_TYPE_OPERATOR_28, BarringInfo::SERVICE_TYPE_OPERATOR_29, + BarringInfo::SERVICE_TYPE_OPERATOR_30, BarringInfo::SERVICE_TYPE_OPERATOR_31, + }; + + const std::set* compareTo = nullptr; + + switch (radioRsp_network->barringCellIdentity.getTag()) { + case CellIdentity::Tag::wcdma: + // fall through + case CellIdentity::Tag::tdscdma: + compareTo = &UTRA_SERVICES; + break; + case CellIdentity::Tag::lte: + compareTo = &EUTRA_SERVICES; + break; + case CellIdentity::Tag::nr: + compareTo = &NGRA_SERVICES; + break; + case CellIdentity::Tag::cdma: + // fall through + default: + FAIL(); + break; + } + + std::set diff; + + std::set_difference(reportedServices.begin(), reportedServices.end(), compareTo->begin(), + compareTo->end(), std::inserter(diff, diff.begin())); +} + +/* + * Test IRadioNetwork.getSignalStrength() for the response returned. + */ +TEST_P(RadioNetworkTest, getSignalStrength) { + serial = GetRandomSerialNumber(); + + radio_network->getSignalStrength(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE})); + } +} + +/* + * Test IRadioNetwork.getCellInfoList() for the response returned. + */ +TEST_P(RadioNetworkTest, getCellInfoList) { + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_network->getCellInfoList(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); + + ALOGI("getCellInfoList, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::NO_NETWORK_FOUND})); +} + +/* + * Test IRadioNetwork.getVoiceRegistrationState() for the response returned. + */ +TEST_P(RadioNetworkTest, getVoiceRegistrationState) { + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_network->getVoiceRegistrationState(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); + + ALOGI("getVoiceRegistrationStateResponse, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE})); +} + +/* + * Test IRadioNetwork.getDataRegistrationState() for the response returned. + */ +TEST_P(RadioNetworkTest, getDataRegistrationState) { + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_network->getDataRegistrationState(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); + + ALOGI("getDataRegistrationStateResponse, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::NOT_PROVISIONED})); + + // Check the mcc [0, 999] and mnc [0, 999]. + std::string mcc; + std::string mnc; + bool checkMccMnc = true; + CellIdentity cellIdentity = radioRsp_network->dataRegResp.cellIdentity; + switch (cellIdentity.getTag()) { + case CellIdentity::noinit: { + checkMccMnc = false; + break; + } + case CellIdentity::gsm: { + CellIdentityGsm cig = cellIdentity.get(); + mcc = cig.mcc; + mnc = cig.mnc; + break; + } + case CellIdentity::wcdma: { + CellIdentityWcdma ciw = cellIdentity.get(); + mcc = ciw.mcc; + mnc = ciw.mnc; + break; + } + case CellIdentity::tdscdma: { + CellIdentityTdscdma cit = cellIdentity.get(); + mcc = cit.mcc; + mnc = cit.mnc; + break; + } + case CellIdentity::cdma: { + // CellIdentityCdma has no mcc/mnc + CellIdentityCdma cic = cellIdentity.get(); + checkMccMnc = false; + break; + } + case CellIdentity::lte: { + CellIdentityLte cil = cellIdentity.get(); + mcc = cil.mcc; + mnc = cil.mnc; + break; + } + case CellIdentity::nr: { + CellIdentityNr cin = cellIdentity.get(); + mcc = cin.mcc; + mnc = cin.mnc; + break; + } + } + + // 32 bit system might return invalid mcc and mnc string "\xff\xff..." + if (checkMccMnc && mcc.size() < 4 && mnc.size() < 4) { + int mcc_int = stoi(mcc); + int mnc_int = stoi(mnc); + EXPECT_TRUE(mcc_int >= 0 && mcc_int <= 999); + EXPECT_TRUE(mnc_int >= 0 && mnc_int <= 999); + } + + // Check for access technology specific info + AccessTechnologySpecificInfo info = radioRsp_network->dataRegResp.accessTechnologySpecificInfo; + RadioTechnology rat = radioRsp_network->dataRegResp.rat; + // TODO: add logic for cdmaInfo + if (rat == RadioTechnology::LTE || rat == RadioTechnology::LTE_CA) { + ASSERT_EQ(info.getTag(), AccessTechnologySpecificInfo::eutranInfo); + } else if (rat == RadioTechnology::NR) { + ASSERT_EQ(info.getTag(), AccessTechnologySpecificInfo::ngranNrVopsInfo); + } +} + +/* + * Test IRadioNetwork.getAvailableBandModes() for the response returned. + */ +TEST_P(RadioNetworkTest, getAvailableBandModes) { + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_network->getAvailableBandModes(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); + ALOGI("getAvailableBandModes, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, + RadioError::MODEM_ERR, RadioError::INTERNAL_ERR, + // If REQUEST_NOT_SUPPORTED is returned, then it should also be + // returned for setBandMode(). + RadioError::REQUEST_NOT_SUPPORTED})); + bool hasUnspecifiedBandMode = false; + if (radioRsp_network->rspInfo.error == RadioError::NONE) { + for (const RadioBandMode& mode : radioRsp_network->radioBandModes) { + // Automatic mode selection must be supported + if (mode == RadioBandMode::BAND_MODE_UNSPECIFIED) hasUnspecifiedBandMode = true; + } + ASSERT_TRUE(hasUnspecifiedBandMode); + } +} + +/* + * Test IRadioNetwork.setIndicationFilter() + */ +TEST_P(RadioNetworkTest, setIndicationFilter) { + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = + radio_network->setIndicationFilter(serial, static_cast(IndicationFilter::ALL)); + 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); + + ALOGI("setIndicationFilter, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE})); +} + +/* + * Test IRadioNetwork.setBarringPassword() for the response returned. + */ +TEST_P(RadioNetworkTest, setBarringPassword) { + serial = GetRandomSerialNumber(); + std::string facility = ""; + std::string oldPassword = ""; + std::string newPassword = ""; + + radio_network->setBarringPassword(serial, facility, oldPassword, newPassword); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::FDN_CHECK_FAILURE, + RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } +} + +/* + * Test IRadioNetwork.setSuppServiceNotifications() for the response returned. + */ +TEST_P(RadioNetworkTest, setSuppServiceNotifications) { + serial = GetRandomSerialNumber(); + bool enable = false; + + radio_network->setSuppServiceNotifications(serial, enable); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::SIM_ABSENT})); + } +} + +/* + * Test IRadioNetwork.getImsRegistrationState() for the response returned. + */ +TEST_P(RadioNetworkTest, getImsRegistrationState) { + serial = GetRandomSerialNumber(); + + radio_network->getImsRegistrationState(serial); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::MODEM_ERR, RadioError::INVALID_MODEM_STATE}, + CHECK_GENERAL_ERROR)); + } +} + +/* + * Test IRadioNetwork.getOperator() for the response returned. + */ +TEST_P(RadioNetworkTest, getOperator) { + LOG(DEBUG) << "getOperator"; + serial = GetRandomSerialNumber(); + + radio_network->getOperator(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error); + } + LOG(DEBUG) << "getOperator finished"; +} +/* + * Test IRadioNetwork.getNetworkSelectionMode() for the response returned. + */ +TEST_P(RadioNetworkTest, getNetworkSelectionMode) { + LOG(DEBUG) << "getNetworkSelectionMode"; + serial = GetRandomSerialNumber(); + + radio_network->getNetworkSelectionMode(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error); + } + LOG(DEBUG) << "getNetworkSelectionMode finished"; +} + +/* + * Test IRadioNetwork.setNetworkSelectionModeAutomatic() for the response returned. + */ +TEST_P(RadioNetworkTest, setNetworkSelectionModeAutomatic) { + LOG(DEBUG) << "setNetworkSelectionModeAutomatic"; + serial = GetRandomSerialNumber(); + + radio_network->setNetworkSelectionModeAutomatic(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::ILLEGAL_SIM_OR_ME, + RadioError::OPERATION_NOT_ALLOWED}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "setNetworkSelectionModeAutomatic finished"; +} + +/* + * Test IRadioNetwork.getAvailableNetworks() for the response returned. + */ +TEST_P(RadioNetworkTest, getAvailableNetworks) { + LOG(DEBUG) << "getAvailableNetworks"; + serial = GetRandomSerialNumber(); + + radio_network->getAvailableNetworks(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + ASSERT_TRUE(radioRsp_network->rspInfo.type == RadioResponseType::SOLICITED || + radioRsp_network->rspInfo.type == RadioResponseType::SOLICITED_ACK_EXP); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::CANCELLED, RadioError::DEVICE_IN_USE, + RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "getAvailableNetworks finished"; +} + +/* + * Test IRadioNetwork.setBandMode() for the response returned. + */ +TEST_P(RadioNetworkTest, setBandMode) { + LOG(DEBUG) << "setBandMode"; + serial = GetRandomSerialNumber(); + + radio_network->setBandMode(serial, RadioBandMode::BAND_MODE_USA); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "setBandMode finished"; +} + +/* + * Test IRadioNetwork.getNeighboringCids() for the response returned. + */ +TEST_P(RadioNetworkTest, getNeighboringCids) { + // TODO: add API for getNeighboringCids + /** + LOG(DEBUG) << "getNeighboringCids"; + serial = GetRandomSerialNumber(); + + radio_network->getNeighboringCids(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "getNeighboringCids finished"; + **/ +} + +/* + * Test IRadioNetwork.setLocationUpdates() for the response returned. + */ +TEST_P(RadioNetworkTest, setLocationUpdates) { + LOG(DEBUG) << "setLocationUpdates"; + serial = GetRandomSerialNumber(); + + radio_network->setLocationUpdates(serial, true); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::SIM_ABSENT})); + } + LOG(DEBUG) << "setLocationUpdates finished"; +} + +/* + * Test IRadioNetwork.setCdmaRoamingPreference() for the response returned. + */ +TEST_P(RadioNetworkTest, setCdmaRoamingPreference) { + LOG(DEBUG) << "setCdmaRoamingPreference"; + serial = GetRandomSerialNumber(); + + radio_network->setCdmaRoamingPreference(serial, CdmaRoamingType::HOME_NETWORK); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::REQUEST_NOT_SUPPORTED})); + } + LOG(DEBUG) << "setCdmaRoamingPreference finished"; +} + +/* + * Test IRadioNetwork.getCdmaRoamingPreference() for the response returned. + */ +TEST_P(RadioNetworkTest, getCdmaRoamingPreference) { + LOG(DEBUG) << "getCdmaRoamingPreference"; + serial = GetRandomSerialNumber(); + + radio_network->getCdmaRoamingPreference(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE( + CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "getCdmaRoamingPreference finished"; +} + +/* + * Test IRadioNetwork.getVoiceRadioTechnology() for the response returned. + */ +TEST_P(RadioNetworkTest, getVoiceRadioTechnology) { + LOG(DEBUG) << "getVoiceRadioTechnology"; + serial = GetRandomSerialNumber(); + + radio_network->getVoiceRadioTechnology(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error); + } + LOG(DEBUG) << "getVoiceRadioTechnology finished"; +} + +/* + * Test IRadioNetwork.setCellInfoListRate() for the response returned. + */ +TEST_P(RadioNetworkTest, setCellInfoListRate) { + LOG(DEBUG) << "setCellInfoListRate"; + serial = GetRandomSerialNumber(); + + // TODO(sanketpadawe): RIL crashes with value of rate = 10 + radio_network->setCellInfoListRate(serial, 10); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); + } + LOG(DEBUG) << "setCellInfoListRate finished"; +} + +/* + * Test IRadioNetwork.supplyNetworkDepersonalization() for the response returned. + */ +TEST_P(RadioNetworkTest, supplyNetworkDepersonalization) { + LOG(DEBUG) << "supplyNetworkDepersonalization"; + serial = GetRandomSerialNumber(); + + radio_network->supplyNetworkDepersonalization(serial, std::string("test")); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::INTERNAL_ERR, + RadioError::INVALID_SIM_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY, + RadioError::PASSWORD_INCORRECT, RadioError::SIM_ABSENT, RadioError::SYSTEM_ERR})); + } + LOG(DEBUG) << "supplyNetworkDepersonalization finished"; +} \ No newline at end of file diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h index 9f7676969d..29ba2f282e 100644 --- a/radio/aidl/vts/radio_network_utils.h +++ b/radio/aidl/vts/radio_network_utils.h @@ -41,8 +41,9 @@ class RadioNetworkResponse : public BnRadioNetworkResponse { bool isNrDualConnectivityEnabled; int networkTypeBitmapResponse; RegStateResult voiceRegResp; + RegStateResult dataRegResp; CellIdentity barringCellIdentity; - std::vector barringInfos; + std::vector barringInfoList; UsageSetting usageSetting; virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; @@ -218,4 +219,6 @@ class RadioNetworkTest : public ::testing::TestWithParam, public Ra // Helper function to reduce copy+paste void testSetUsageSetting_InvalidValues(std::vector errors); + + void stopNetworkScan(); }; diff --git a/radio/aidl/vts/radio_sim_response.cpp b/radio/aidl/vts/radio_sim_response.cpp index a783f43e0a..391c9cb12d 100644 --- a/radio/aidl/vts/radio_sim_response.cpp +++ b/radio/aidl/vts/radio_sim_response.cpp @@ -23,44 +23,62 @@ ndk::ScopedAStatus RadioSimResponse::acknowledgeRequest(int32_t /*serial*/) { } ndk::ScopedAStatus RadioSimResponse::areUiccApplicationsEnabledResponse( - const RadioResponseInfo& /*info*/, bool /*enabled*/) { + const RadioResponseInfo& info, bool enabled) { + rspInfo = info; + areUiccApplicationsEnabled = enabled; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::changeIccPin2ForAppResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioSimResponse::changeIccPin2ForAppResponse(const RadioResponseInfo& info, int32_t /*remainingRetries*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::changeIccPinForAppResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioSimResponse::changeIccPinForAppResponse(const RadioResponseInfo& info, int32_t /*remainingRetries*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::enableUiccApplicationsResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioSimResponse::enableUiccApplicationsResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioSimResponse::getAllowedCarriersResponse( - const RadioResponseInfo& /*info*/, const CarrierRestrictions& /*carriers*/, - SimLockMultiSimPolicy /*multiSimPolicy*/) { + const RadioResponseInfo& info, const CarrierRestrictions& carriers, + SimLockMultiSimPolicy multiSimPolicy) { + rspInfo = info; + carrierRestrictionsResp = carriers; + multiSimPolicyResp = multiSimPolicy; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioSimResponse::getCdmaSubscriptionResponse( - const RadioResponseInfo& /*info*/, const std::string& /*mdn*/, const std::string& /*hSid*/, + const RadioResponseInfo& info, const std::string& /*mdn*/, const std::string& /*hSid*/, const std::string& /*hNid*/, const std::string& /*min*/, const std::string& /*prl*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioSimResponse::getCdmaSubscriptionSourceResponse( - const RadioResponseInfo& /*info*/, CdmaSubscriptionSource /*source*/) { + const RadioResponseInfo& info, CdmaSubscriptionSource /*source*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::getFacilityLockForAppResponse( - const RadioResponseInfo& /*info*/, int32_t /*response*/) { +ndk::ScopedAStatus RadioSimResponse::getFacilityLockForAppResponse(const RadioResponseInfo& info, + int32_t /*response*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -72,8 +90,11 @@ ndk::ScopedAStatus RadioSimResponse::getIccCardStatusResponse(const RadioRespons return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::getImsiForAppResponse(const RadioResponseInfo& /*info*/, - const std::string& /*imsi*/) { +ndk::ScopedAStatus RadioSimResponse::getImsiForAppResponse(const RadioResponseInfo& info, + const std::string& imsi_str) { + rspInfo = info; + imsi = imsi_str; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -91,58 +112,79 @@ ndk::ScopedAStatus RadioSimResponse::getSimPhonebookRecordsResponse(const RadioR return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::iccCloseLogicalChannelResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioSimResponse::iccCloseLogicalChannelResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::iccIoForAppResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioSimResponse::iccIoForAppResponse(const RadioResponseInfo& info, const IccIoResult& /*iccIo*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioSimResponse::iccOpenLogicalChannelResponse( - const RadioResponseInfo& /*info*/, int32_t /*channelId*/, + const RadioResponseInfo& info, int32_t /*channelId*/, const std::vector& /*selectResponse*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioSimResponse::iccTransmitApduBasicChannelResponse( - const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) { + const RadioResponseInfo& info, const IccIoResult& /*result*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioSimResponse::iccTransmitApduLogicalChannelResponse( - const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) { + const RadioResponseInfo& info, const IccIoResult& /*result*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioSimResponse::reportStkServiceIsRunningResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioSimResponse::requestIccSimAuthenticationResponse( - const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) { + const RadioResponseInfo& info, const IccIoResult& /*result*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::sendEnvelopeResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioSimResponse::sendEnvelopeResponse(const RadioResponseInfo& info, const std::string& /*commandResponse*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::sendEnvelopeWithStatusResponse( - const RadioResponseInfo& /*info*/, const IccIoResult& /*iccIo*/) { +ndk::ScopedAStatus RadioSimResponse::sendEnvelopeWithStatusResponse(const RadioResponseInfo& info, + const IccIoResult& /*iccIo*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioSimResponse::sendTerminalResponseToSimResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::setAllowedCarriersResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioSimResponse::setAllowedCarriersResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -154,12 +196,16 @@ ndk::ScopedAStatus RadioSimResponse::setCarrierInfoForImsiEncryptionResponse( } ndk::ScopedAStatus RadioSimResponse::setCdmaSubscriptionSourceResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::setFacilityLockForAppResponse( - const RadioResponseInfo& /*info*/, int32_t /*retry*/) { +ndk::ScopedAStatus RadioSimResponse::setFacilityLockForAppResponse(const RadioResponseInfo& info, + int32_t /*retry*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -169,34 +215,44 @@ ndk::ScopedAStatus RadioSimResponse::setSimCardPowerResponse(const RadioResponse return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::setUiccSubscriptionResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioSimResponse::setUiccSubscriptionResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::supplyIccPin2ForAppResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioSimResponse::supplyIccPin2ForAppResponse(const RadioResponseInfo& info, int32_t /*remainingRetries*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::supplyIccPinForAppResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioSimResponse::supplyIccPinForAppResponse(const RadioResponseInfo& info, int32_t /*remainingRetries*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::supplyIccPuk2ForAppResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioSimResponse::supplyIccPuk2ForAppResponse(const RadioResponseInfo& info, int32_t /*remainingRetries*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioSimResponse::supplyIccPukForAppResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioSimResponse::supplyIccPukForAppResponse(const RadioResponseInfo& info, int32_t /*remainingRetries*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioSimResponse::supplySimDepersonalizationResponse( - const RadioResponseInfo& /*info*/, PersoSubstate /*persoType*/, - int32_t /*remainingRetries*/) { + const RadioResponseInfo& info, PersoSubstate /*persoType*/, int32_t /*remainingRetries*/) { + rspInfo = info; + parent_sim.notify(info.serial); return ndk::ScopedAStatus::ok(); } diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp index 5db77f6600..146e86c785 100644 --- a/radio/aidl/vts/radio_sim_test.cpp +++ b/radio/aidl/vts/radio_sim_test.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include #include #include @@ -260,3 +261,771 @@ TEST_P(RadioSimTest, updateSimPhonebookRecords) { } } } + +/* + * Test IRadioSim.enableUiccApplications() for the response returned. + * For SIM ABSENT case. + */ +TEST_P(RadioSimTest, togglingUiccApplicationsSimAbsent) { + // This test case only test SIM ABSENT case. + if (cardStatus.cardState != CardStatus::STATE_ABSENT) return; + + // Disable Uicc applications. + serial = GetRandomSerialNumber(); + radio_sim->enableUiccApplications(serial, false); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + // As SIM is absent, RadioError::SIM_ABSENT should be thrown. + EXPECT_EQ(RadioError::SIM_ABSENT, radioRsp_sim->rspInfo.error); + + // Query Uicc application enablement. + serial = GetRandomSerialNumber(); + radio_sim->areUiccApplicationsEnabled(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + // As SIM is absent, RadioError::SIM_ABSENT should be thrown. + EXPECT_EQ(RadioError::SIM_ABSENT, radioRsp_sim->rspInfo.error); +} + +/* + * Test IRadioSim.enableUiccApplications() for the response returned. + * For SIM PRESENT case. + */ +TEST_P(RadioSimTest, togglingUiccApplicationsSimPresent) { + // This test case only test SIM ABSENT case. + if (cardStatus.cardState != CardStatus::STATE_PRESENT) return; + if (cardStatus.applications.size() == 0) return; + + // Disable Uicc applications. + serial = GetRandomSerialNumber(); + radio_sim->enableUiccApplications(serial, false); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + // As SIM is present, there shouldn't be error. + EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error); + + // Query Uicc application enablement. + serial = GetRandomSerialNumber(); + radio_sim->areUiccApplicationsEnabled(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + // As SIM is present, there shouldn't be error. + EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error); + ASSERT_FALSE(radioRsp_sim->areUiccApplicationsEnabled); + + // Enable Uicc applications. + serial = GetRandomSerialNumber(); + radio_sim->enableUiccApplications(serial, true); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + // As SIM is present, there shouldn't be error. + EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error); + + // Query Uicc application enablement. + serial = GetRandomSerialNumber(); + radio_sim->areUiccApplicationsEnabled(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + // As SIM is present, there shouldn't be error. + EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error); + ASSERT_TRUE(radioRsp_sim->areUiccApplicationsEnabled); +} + +/* + * Test IRadioSim.areUiccApplicationsEnabled() for the response returned. + */ +TEST_P(RadioSimTest, areUiccApplicationsEnabled) { + // Disable Uicc applications. + serial = GetRandomSerialNumber(); + radio_sim->areUiccApplicationsEnabled(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + // If SIM is absent, RadioError::SIM_ABSENT should be thrown. Otherwise there shouldn't be any + // error. + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + EXPECT_EQ(RadioError::SIM_ABSENT, radioRsp_sim->rspInfo.error); + } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) { + EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error); + } +} + +/* + * Test IRadioSim.getAllowedCarriers() for the response returned. + */ +TEST_P(RadioSimTest, getAllowedCarriers) { + serial = GetRandomSerialNumber(); + + radio_sim->getAllowedCarriers(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); +} + +/** + * Test IRadioSim.setAllowedCarriers() for the response returned. + */ +TEST_P(RadioSimTest, setAllowedCarriers) { + // TODO (b/210712359): remove once shim supports 1.4 or alternative is found + GTEST_SKIP(); + serial = GetRandomSerialNumber(); + CarrierRestrictions carrierRestrictions; + memset(&carrierRestrictions, 0, sizeof(carrierRestrictions)); + carrierRestrictions.allowedCarriers.resize(1); + carrierRestrictions.excludedCarriers.resize(0); + carrierRestrictions.allowedCarriers[0].mcc = std::string("123"); + carrierRestrictions.allowedCarriers[0].mnc = std::string("456"); + carrierRestrictions.allowedCarriers[0].matchType = Carrier::MATCH_TYPE_ALL; + carrierRestrictions.allowedCarriers[0].matchData = std::string(); + carrierRestrictions.priority = true; + carrierRestrictions.allowedCarriersPrioritized = true; + SimLockMultiSimPolicy multisimPolicy = SimLockMultiSimPolicy::NO_MULTISIM_POLICY; + + radio_sim->setAllowedCarriers(serial, carrierRestrictions, multisimPolicy); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); + + if (radioRsp_sim->rspInfo.error == RadioError::NONE) { + /* Verify the update of the SIM status. This might need some time */ + if (cardStatus.cardState != CardStatus::STATE_ABSENT) { + updateSimCardStatus(); + auto startTime = std::chrono::system_clock::now(); + while (cardStatus.cardState != CardStatus::STATE_RESTRICTED && + std::chrono::duration_cast( + std::chrono::system_clock::now() - startTime) + .count() < 30) { + /* Set 2 seconds as interval to check card status */ + sleep(2); + updateSimCardStatus(); + } + EXPECT_EQ(CardStatus::STATE_RESTRICTED, cardStatus.cardState); + } + + /* Verify that configuration was set correctly, retrieving it from the modem */ + serial = GetRandomSerialNumber(); + + radio_sim->getAllowedCarriers(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error); + + EXPECT_EQ(1, radioRsp_sim->carrierRestrictionsResp.allowedCarriers.size()); + EXPECT_EQ(0, radioRsp_sim->carrierRestrictionsResp.excludedCarriers.size()); + ASSERT_TRUE(std::string("123") == + radioRsp_sim->carrierRestrictionsResp.allowedCarriers[0].mcc); + ASSERT_TRUE(std::string("456") == + radioRsp_sim->carrierRestrictionsResp.allowedCarriers[0].mnc); + EXPECT_EQ(Carrier::MATCH_TYPE_ALL, + radioRsp_sim->carrierRestrictionsResp.allowedCarriers[0].matchType); + ASSERT_TRUE(radioRsp_sim->carrierRestrictionsResp.allowedCarriersPrioritized); + EXPECT_EQ(SimLockMultiSimPolicy::NO_MULTISIM_POLICY, radioRsp_sim->multiSimPolicyResp); + + sleep(10); + + /** + * Another test case of the API to cover to allow carrier. + * If the API is supported, this is also used to reset to no carrier restriction + * status for cardStatus. + */ + memset(&carrierRestrictions, 0, sizeof(carrierRestrictions)); + carrierRestrictions.allowedCarriers.resize(0); + carrierRestrictions.excludedCarriers.resize(0); + carrierRestrictions.allowedCarriersPrioritized = false; + + serial = GetRandomSerialNumber(); + radio_sim->setAllowedCarriers(serial, carrierRestrictions, multisimPolicy); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error); + + if (cardStatus.cardState != CardStatus::STATE_ABSENT) { + /* Resetting back to no carrier restriction needs some time */ + updateSimCardStatus(); + auto startTime = std::chrono::system_clock::now(); + while (cardStatus.cardState == CardStatus::STATE_RESTRICTED && + std::chrono::duration_cast( + std::chrono::system_clock::now() - startTime) + .count() < 10) { + /* Set 2 seconds as interval to check card status */ + sleep(2); + updateSimCardStatus(); + } + EXPECT_NE(CardStatus::STATE_RESTRICTED, cardStatus.cardState); + sleep(10); + } + } +} + +/* + * Test IRadioSim.getIccCardStatus() for the response returned. + */ +TEST_P(RadioSimTest, getIccCardStatus) { + LOG(DEBUG) << "getIccCardStatus"; + 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); + EXPECT_LT(cardStatus.imsSubscriptionAppIndex, RadioConst::CARD_MAX_APPS); + LOG(DEBUG) << "getIccCardStatus finished"; +} + +/* + * Test IRadioSim.supplyIccPinForApp() for the response returned + */ +TEST_P(RadioSimTest, supplyIccPinForApp) { + LOG(DEBUG) << "supplyIccPinForApp"; + serial = GetRandomSerialNumber(); + + // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and + // 3GPP2 apps only + for (int i = 0; i < (int)cardStatus.applications.size(); i++) { + if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) { + radio_sim->supplyIccPinForApp(serial, std::string("test1"), + cardStatus.applications[i].aidPtr); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_sim->rspInfo.error, + {RadioError::PASSWORD_INCORRECT, RadioError::REQUEST_NOT_SUPPORTED})); + } + } + LOG(DEBUG) << "supplyIccPinForApp finished"; +} + +/* + * Test IRadioSim.supplyIccPukForApp() for the response returned. + */ +TEST_P(RadioSimTest, supplyIccPukForApp) { + LOG(DEBUG) << "supplyIccPukForApp"; + serial = GetRandomSerialNumber(); + + // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and + // 3GPP2 apps only + for (int i = 0; i < (int)cardStatus.applications.size(); i++) { + if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) { + radio_sim->supplyIccPukForApp(serial, std::string("test1"), std::string("test2"), + cardStatus.applications[i].aidPtr); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_sim->rspInfo.error, + {RadioError::PASSWORD_INCORRECT, RadioError::INVALID_SIM_STATE})); + } + } + LOG(DEBUG) << "supplyIccPukForApp finished"; +} + +/* + * Test IRadioSim.supplyIccPin2ForApp() for the response returned. + */ +TEST_P(RadioSimTest, supplyIccPin2ForApp) { + LOG(DEBUG) << "supplyIccPin2ForApp"; + serial = GetRandomSerialNumber(); + + // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and + // 3GPP2 apps only + for (int i = 0; i < (int)cardStatus.applications.size(); i++) { + if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) { + radio_sim->supplyIccPin2ForApp(serial, std::string("test1"), + cardStatus.applications[i].aidPtr); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + ASSERT_TRUE( + CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::PASSWORD_INCORRECT, + RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_PUK2})); + } + } + LOG(DEBUG) << "supplyIccPin2ForApp finished"; +} + +/* + * Test IRadioSim.supplyIccPuk2ForApp() for the response returned. + */ +TEST_P(RadioSimTest, supplyIccPuk2ForApp) { + LOG(DEBUG) << "supplyIccPuk2ForApp"; + serial = GetRandomSerialNumber(); + + // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and + // 3GPP2 apps only + for (int i = 0; i < (int)cardStatus.applications.size(); i++) { + if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) { + radio_sim->supplyIccPuk2ForApp(serial, std::string("test1"), std::string("test2"), + cardStatus.applications[i].aidPtr); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_sim->rspInfo.error, + {RadioError::PASSWORD_INCORRECT, RadioError::INVALID_SIM_STATE})); + } + } + LOG(DEBUG) << "supplyIccPuk2ForApp finished"; +} + +/* + * Test IRadioSim.changeIccPinForApp() for the response returned. + */ +TEST_P(RadioSimTest, changeIccPinForApp) { + LOG(DEBUG) << "changeIccPinForApp"; + serial = GetRandomSerialNumber(); + + // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and + // 3GPP2 apps only + for (int i = 0; i < (int)cardStatus.applications.size(); i++) { + if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) { + radio_sim->changeIccPinForApp(serial, std::string("test1"), std::string("test2"), + cardStatus.applications[i].aidPtr); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_sim->rspInfo.error, + {RadioError::PASSWORD_INCORRECT, RadioError::REQUEST_NOT_SUPPORTED})); + } + } + LOG(DEBUG) << "changeIccPinForApp finished"; +} + +/* + * Test IRadioSim.changeIccPin2ForApp() for the response returned. + */ +TEST_P(RadioSimTest, changeIccPin2ForApp) { + LOG(DEBUG) << "changeIccPin2ForApp"; + serial = GetRandomSerialNumber(); + + // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and + // 3GPP2 apps only + for (int i = 0; i < (int)cardStatus.applications.size(); i++) { + if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) { + radio_sim->changeIccPin2ForApp(serial, std::string("test1"), std::string("test2"), + cardStatus.applications[i].aidPtr); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + ASSERT_TRUE( + CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::PASSWORD_INCORRECT, + RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_PUK2})); + } + } + LOG(DEBUG) << "changeIccPin2ForApp finished"; +} + +/* + * The following test is disabled due to b/109889468 + * + * Test IRadioSim.getImsiForApp() for the response returned. + */ +TEST_P(RadioSimTest, DISABLED_getImsiForApp) { + LOG(DEBUG) << "DISABLED_getImsiForApp"; + serial = GetRandomSerialNumber(); + + // Check success returned while getting imsi for 3GPP and 3GPP2 apps only + for (int i = 0; i < (int)cardStatus.applications.size(); i++) { + if (cardStatus.applications[i].appType == AppStatus::APP_TYPE_SIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_USIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_RUIM || + cardStatus.applications[i].appType == AppStatus::APP_TYPE_CSIM) { + radio_sim->getImsiForApp(serial, cardStatus.applications[i].aidPtr); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, {RadioError::NONE}, + CHECK_GENERAL_ERROR)); + + // IMSI (MCC+MNC+MSIN) is at least 6 digits, but not more than 15 + if (radioRsp_sim->rspInfo.error == RadioError::NONE) { + EXPECT_NE(radioRsp_sim->imsi, std::string()); + EXPECT_GE((int)(radioRsp_sim->imsi).size(), 6); + EXPECT_LE((int)(radioRsp_sim->imsi).size(), 15); + } + } + } + LOG(DEBUG) << "DISABLED_getImsiForApp finished"; +} + +/* + * Test IRadioSim.iccIoForApp() for the response returned. + */ +TEST_P(RadioSimTest, iccIoForApp) { + LOG(DEBUG) << "iccIoForApp"; + serial = GetRandomSerialNumber(); + + for (int i = 0; i < (int)cardStatus.applications.size(); i++) { + IccIo iccIo; + iccIo.command = 0xc0; + iccIo.fileId = 0x6f11; + iccIo.path = std::string("3F007FFF"); + iccIo.p1 = 0; + iccIo.p2 = 0; + iccIo.p3 = 0; + iccIo.data = std::string(); + iccIo.pin2 = std::string(); + iccIo.aid = cardStatus.applications[i].aidPtr; + + radio_sim->iccIoForApp(serial, iccIo); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + } + LOG(DEBUG) << "iccIoForApp finished"; +} + +/* + * Test IRadioSim.iccTransmitApduBasicChannel() for the response returned. + */ +TEST_P(RadioSimTest, iccTransmitApduBasicChannel) { + LOG(DEBUG) << "iccTransmitApduBasicChannel"; + serial = GetRandomSerialNumber(); + SimApdu msg; + memset(&msg, 0, sizeof(msg)); + msg.data = std::string(); + + radio_sim->iccTransmitApduBasicChannel(serial, msg); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + // TODO(sanketpadawe): Add test for error code + LOG(DEBUG) << "iccTransmitApduBasicChannel finished"; +} + +/* + * Test IRadioSim.iccOpenLogicalChannel() for the response returned. + */ +TEST_P(RadioSimTest, iccOpenLogicalChannel) { + LOG(DEBUG) << "iccOpenLogicalChannel"; + serial = GetRandomSerialNumber(); + int p2 = 0x04; + // Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested. + for (int i = 0; i < (int)cardStatus.applications.size(); i++) { + radio_sim->iccOpenLogicalChannel(serial, cardStatus.applications[i].aidPtr, p2); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + } + LOG(DEBUG) << "iccOpenLogicalChannel finished"; +} + +/* + * Test IRadioSim.iccCloseLogicalChannel() for the response returned. + */ +TEST_P(RadioSimTest, iccCloseLogicalChannel) { + LOG(DEBUG) << "iccCloseLogicalChannel"; + serial = GetRandomSerialNumber(); + // Try closing invalid channel and check INVALID_ARGUMENTS returned as error + radio_sim->iccCloseLogicalChannel(serial, 0); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp_sim->rspInfo.error); + LOG(DEBUG) << "iccCloseLogicalChannel finished"; +} + +/* + * Test IRadioSim.iccTransmitApduLogicalChannel() for the response returned. + */ +TEST_P(RadioSimTest, iccTransmitApduLogicalChannel) { + LOG(DEBUG) << "iccTransmitApduLogicalChannel"; + serial = GetRandomSerialNumber(); + SimApdu msg; + memset(&msg, 0, sizeof(msg)); + msg.data = std::string(); + + radio_sim->iccTransmitApduLogicalChannel(serial, msg); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + // TODO(sanketpadawe): Add test for error code + LOG(DEBUG) << "iccTransmitApduLogicalChannel finished"; +} + +/* + * Test IRadioSim.requestIccSimAuthentication() for the response returned. + */ +TEST_P(RadioSimTest, requestIccSimAuthentication) { + LOG(DEBUG) << "requestIccSimAuthentication"; + serial = GetRandomSerialNumber(); + + // Pass wrong challenge string and check RadioError::INVALID_ARGUMENTS + // or REQUEST_NOT_SUPPORTED returned as error. + for (int i = 0; i < (int)cardStatus.applications.size(); i++) { + radio_sim->requestIccSimAuthentication(serial, 0, std::string("test"), + cardStatus.applications[i].aidPtr); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_sim->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); + } + LOG(DEBUG) << "requestIccSimAuthentication finished"; +} + +/* + * Test IRadioSim.getFacilityLockForApp() for the response returned. + */ +TEST_P(RadioSimTest, getFacilityLockForApp) { + serial = GetRandomSerialNumber(); + std::string facility = ""; + std::string password = ""; + int32_t serviceClass = 1; + std::string appId = ""; + + radio_sim->getFacilityLockForApp(serial, facility, password, serviceClass, appId); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } +} + +/* + * Test IRadioSim.setFacilityLockForApp() for the response returned. + */ +TEST_P(RadioSimTest, setFacilityLockForApp) { + serial = GetRandomSerialNumber(); + std::string facility = ""; + bool lockState = false; + std::string password = ""; + int32_t serviceClass = 1; + std::string appId = ""; + + radio_sim->setFacilityLockForApp(serial, facility, lockState, password, serviceClass, appId); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } +} + +/* + * Test IRadioSim.getCdmaSubscription() for the response returned. + */ +TEST_P(RadioSimTest, getCdmaSubscription) { + LOG(DEBUG) << "getCdmaSubscription"; + serial = GetRandomSerialNumber(); + + radio_sim->getCdmaSubscription(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT})); + } + LOG(DEBUG) << "getCdmaSubscription finished"; +} + +/* + * Test IRadioSim.getCdmaSubscriptionSource() for the response returned. + */ +TEST_P(RadioSimTest, getCdmaSubscriptionSource) { + LOG(DEBUG) << "getCdmaSubscriptionSource"; + serial = GetRandomSerialNumber(); + + radio_sim->getCdmaSubscriptionSource(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT})); + } + LOG(DEBUG) << "getCdmaSubscriptionSource finished"; +} + +/* + * Test IRadioSim.setCdmaSubscriptionSource() for the response returned. + */ +TEST_P(RadioSimTest, setCdmaSubscriptionSource) { + LOG(DEBUG) << "setCdmaSubscriptionSource"; + serial = GetRandomSerialNumber(); + + radio_sim->setCdmaSubscriptionSource(serial, CdmaSubscriptionSource::RUIM_SIM); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::SUBSCRIPTION_NOT_AVAILABLE}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "setCdmaSubscriptionSource finished"; +} + +/* + * Test IRadioSim.setUiccSubscription() for the response returned. + */ +TEST_P(RadioSimTest, setUiccSubscription) { + LOG(DEBUG) << "setUiccSubscription"; + serial = GetRandomSerialNumber(); + SelectUiccSub item; + memset(&item, 0, sizeof(item)); + + radio_sim->setUiccSubscription(serial, item); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE( + CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, + RadioError::MODEM_ERR, RadioError::SUBSCRIPTION_NOT_SUPPORTED}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "setUiccSubscription finished"; +} + +/* + * Test IRadioSim.sendEnvelope() for the response returned. + */ +TEST_P(RadioSimTest, sendEnvelope) { + LOG(DEBUG) << "sendEnvelope"; + serial = GetRandomSerialNumber(); + + // Test with sending empty string + std::string content = ""; + + radio_sim->sendEnvelope(serial, content); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, + RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "sendEnvelope finished"; +} + +/* + * Test IRadioSim.sendTerminalResponseToSim() for the response returned. + */ +TEST_P(RadioSimTest, sendTerminalResponseToSim) { + LOG(DEBUG) << "sendTerminalResponseToSim"; + serial = GetRandomSerialNumber(); + + // Test with sending empty string + std::string commandResponse = ""; + + radio_sim->sendTerminalResponseToSim(serial, commandResponse); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_sim->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "sendTerminalResponseToSim finished"; +} + +/* + * Test IRadioSim.reportStkServiceIsRunning() for the response returned. + */ +TEST_P(RadioSimTest, reportStkServiceIsRunning) { + LOG(DEBUG) << "reportStkServiceIsRunning"; + serial = GetRandomSerialNumber(); + + radio_sim->reportStkServiceIsRunning(serial); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, {RadioError::NONE}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "reportStkServiceIsRunning finished"; +} + +/* + * Test IRadioSim.sendEnvelopeWithStatus() for the response returned with empty + * string. + */ +TEST_P(RadioSimTest, sendEnvelopeWithStatus) { + LOG(DEBUG) << "sendEnvelopeWithStatus"; + serial = GetRandomSerialNumber(); + + // Test with sending empty string + std::string contents = ""; + + radio_sim->sendEnvelopeWithStatus(serial, contents); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); + EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_sim->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "sendEnvelopeWithStatus finished"; +} diff --git a/radio/aidl/vts/radio_sim_utils.h b/radio/aidl/vts/radio_sim_utils.h index b5e365d436..83f1cbc1ae 100644 --- a/radio/aidl/vts/radio_sim_utils.h +++ b/radio/aidl/vts/radio_sim_utils.h @@ -42,6 +42,7 @@ class RadioSimResponse : public BnRadioSimResponse { bool areUiccApplicationsEnabled; PhonebookCapacity capacity; int32_t updatedRecordIndex; + std::string imsi; virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; diff --git a/radio/aidl/vts/radio_voice_response.cpp b/radio/aidl/vts/radio_voice_response.cpp index a491613b60..95b2d4e72e 100644 --- a/radio/aidl/vts/radio_voice_response.cpp +++ b/radio/aidl/vts/radio_voice_response.cpp @@ -18,7 +18,9 @@ RadioVoiceResponse::RadioVoiceResponse(RadioServiceTest& parent) : parent_voice(parent) {} -ndk::ScopedAStatus RadioVoiceResponse::acceptCallResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::acceptCallResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -26,11 +28,15 @@ ndk::ScopedAStatus RadioVoiceResponse::acknowledgeRequest(int32_t /*serial*/) { return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::conferenceResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::conferenceResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::dialResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::dialResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -41,34 +47,44 @@ ndk::ScopedAStatus RadioVoiceResponse::emergencyDialResponse(const RadioResponse } ndk::ScopedAStatus RadioVoiceResponse::exitEmergencyCallbackModeResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::explicitCallTransferResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::explicitCallTransferResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioVoiceResponse::getCallForwardStatusResponse( - const RadioResponseInfo& /*info*/, - const std::vector& /*callForwardInfos*/) { + const RadioResponseInfo& info, const std::vector& /*callForwardInfos*/) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::getCallWaitingResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioVoiceResponse::getCallWaitingResponse(const RadioResponseInfo& info, bool /*enable*/, int32_t /*serviceClass*/) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::getClipResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioVoiceResponse::getClipResponse(const RadioResponseInfo& info, ClipStatus /*status*/) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::getClirResponse(const RadioResponseInfo& /*info*/, - int32_t /*n*/, int32_t /*m*/) { +ndk::ScopedAStatus RadioVoiceResponse::getClirResponse(const RadioResponseInfo& info, int32_t /*n*/, + int32_t /*m*/) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -81,27 +97,37 @@ ndk::ScopedAStatus RadioVoiceResponse::getCurrentCallsResponse(const RadioRespon } ndk::ScopedAStatus RadioVoiceResponse::getLastCallFailCauseResponse( - const RadioResponseInfo& /*info*/, const LastCallFailCauseInfo& /*failCauseInfo*/) { + const RadioResponseInfo& info, const LastCallFailCauseInfo& /*failCauseInfo*/) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::getMuteResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioVoiceResponse::getMuteResponse(const RadioResponseInfo& info, bool /*enable*/) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioVoiceResponse::getPreferredVoicePrivacyResponse( - const RadioResponseInfo& /*info*/, bool /*enable*/) { + const RadioResponseInfo& info, bool /*enable*/) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::getTtyModeResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioVoiceResponse::getTtyModeResponse(const RadioResponseInfo& info, TtyMode /*mode*/) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioVoiceResponse::handleStkCallSetupRequestFromSimResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } @@ -112,80 +138,114 @@ ndk::ScopedAStatus RadioVoiceResponse::hangupConnectionResponse(const RadioRespo } ndk::ScopedAStatus RadioVoiceResponse::hangupForegroundResumeBackgroundResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioVoiceResponse::hangupWaitingOrBackgroundResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::isVoNrEnabledResponse(const RadioResponseInfo& /*info*/, +ndk::ScopedAStatus RadioVoiceResponse::isVoNrEnabledResponse(const RadioResponseInfo& info, bool /*enabled*/) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::rejectCallResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::rejectCallResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::sendBurstDtmfResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::sendBurstDtmfResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::sendCdmaFeatureCodeResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::sendCdmaFeatureCodeResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::sendDtmfResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::sendDtmfResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::separateConnectionResponse( - const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::separateConnectionResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::setCallForwardResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::setCallForwardResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::setCallWaitingResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::setCallWaitingResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::setClirResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::setClirResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::setMuteResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::setMuteResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioVoiceResponse::setPreferredVoicePrivacyResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::setTtyModeResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::setTtyModeResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::setVoNrEnabledResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::setVoNrEnabledResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::startDtmfResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::startDtmfResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioVoiceResponse::stopDtmfResponse(const RadioResponseInfo& /*info*/) { +ndk::ScopedAStatus RadioVoiceResponse::stopDtmfResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus RadioVoiceResponse::switchWaitingOrHoldingAndActiveResponse( - const RadioResponseInfo& /*info*/) { + const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); return ndk::ScopedAStatus::ok(); } diff --git a/radio/aidl/vts/radio_voice_test.cpp b/radio/aidl/vts/radio_voice_test.cpp index 717f3f0be9..0556938620 100644 --- a/radio/aidl/vts/radio_voice_test.cpp +++ b/radio/aidl/vts/radio_voice_test.cpp @@ -265,3 +265,640 @@ TEST_P(RadioVoiceTest, getCurrentCalls) { EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error); } + +/* + * Test IRadioVoice.getClir() for the response returned. + */ +TEST_P(RadioVoiceTest, getClir) { + serial = GetRandomSerialNumber(); + + radio_voice->getClir(serial); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } +} + +/* + * Test IRadioVoice.setClir() for the response returned. + */ +TEST_P(RadioVoiceTest, setClir) { + serial = GetRandomSerialNumber(); + int32_t status = 1; + + radio_voice->setClir(serial, status); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error); + } +} + +/* + * Test IRadioVoice.getClip() for the response returned. + */ +TEST_P(RadioVoiceTest, getClip) { + serial = GetRandomSerialNumber(); + + radio_voice->getClip(serial); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } +} + +/* + * Test IRadioVoice.getTtyMode() for the response returned. + */ +TEST_P(RadioVoiceTest, getTtyMode) { + LOG(DEBUG) << "getTTYMode"; + serial = GetRandomSerialNumber(); + + radio_voice->getTtyMode(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error); + } + LOG(DEBUG) << "getTTYMode finished"; +} + +/* + * Test IRadioVoice.setTtyMode() for the response returned. + */ +TEST_P(RadioVoiceTest, setTtyMode) { + LOG(DEBUG) << "setTtyMode"; + serial = GetRandomSerialNumber(); + + radio_voice->setTtyMode(serial, TtyMode::OFF); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error); + } + LOG(DEBUG) << "setTtyMode finished"; +} + +/* + * Test IRadioVoice.setPreferredVoicePrivacy() for the response returned. + */ +TEST_P(RadioVoiceTest, setPreferredVoicePrivacy) { + LOG(DEBUG) << "setPreferredVoicePrivacy"; + serial = GetRandomSerialNumber(); + + radio_voice->setPreferredVoicePrivacy(serial, true); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); + } + LOG(DEBUG) << "setPreferredVoicePrivacy finished"; +} + +/* + * Test IRadioVoice.getPreferredVoicePrivacy() for the response returned. + */ +TEST_P(RadioVoiceTest, getPreferredVoicePrivacy) { + LOG(DEBUG) << "getPreferredVoicePrivacy"; + serial = GetRandomSerialNumber(); + + radio_voice->getPreferredVoicePrivacy(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); + } + LOG(DEBUG) << "getPreferredVoicePrivacy finished"; +} + +/* + * Test IRadioVoice.exitEmergencyCallbackMode() for the response returned. + */ +TEST_P(RadioVoiceTest, exitEmergencyCallbackMode) { + LOG(DEBUG) << "exitEmergencyCallbackMode"; + serial = GetRandomSerialNumber(); + + radio_voice->exitEmergencyCallbackMode(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_voice->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT})); + } + LOG(DEBUG) << "exitEmergencyCallbackMode finished"; +} + +/* + * Test IRadioVoice.handleStkCallSetupRequestFromSim() for the response returned. + */ +TEST_P(RadioVoiceTest, handleStkCallSetupRequestFromSim) { + LOG(DEBUG) << "handleStkCallSetupRequestFromSim"; + serial = GetRandomSerialNumber(); + bool accept = false; + + radio_voice->handleStkCallSetupRequestFromSim(serial, accept); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, + RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "handleStkCallSetupRequestFromSim finished"; +} + +/* + * Test IRadioVoice.dial() for the response returned. + */ +TEST_P(RadioVoiceTest, dial) { + LOG(DEBUG) << "dial"; + serial = GetRandomSerialNumber(); + + Dial dialInfo; + memset(&dialInfo, 0, sizeof(dialInfo)); + dialInfo.address = std::string("123456789"); + + radio_voice->dial(serial, dialInfo); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_voice->rspInfo.error, + {RadioError::CANCELLED, RadioError::DEVICE_IN_USE, RadioError::FDN_CHECK_FAILURE, + RadioError::INVALID_ARGUMENTS, RadioError::INVALID_CALL_ID, + RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE, RadioError::MODEM_ERR, + RadioError::NO_NETWORK_FOUND, RadioError::NO_SUBSCRIPTION, + RadioError::OPERATION_NOT_ALLOWED}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "dial finished"; +} + +/* + * Test IRadioVoice.hangup() for the response returned. + */ +TEST_P(RadioVoiceTest, hangup) { + LOG(DEBUG) << "hangup"; + serial = GetRandomSerialNumber(); + + radio_voice->hangup(serial, 1); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_voice->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "hangup finished"; +} + +/* + * Test IRadioVoice.hangupWaitingOrBackground() for the response returned. + */ +TEST_P(RadioVoiceTest, hangupWaitingOrBackground) { + LOG(DEBUG) << "hangupWaitingOrBackground"; + serial = GetRandomSerialNumber(); + + radio_voice->hangupWaitingOrBackground(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, + {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "hangupWaitingOrBackground finished"; +} + +/* + * Test IRadioVoice.hangupForegroundResumeBackground() for the response returned. + */ +TEST_P(RadioVoiceTest, hangupForegroundResumeBackground) { + LOG(DEBUG) << "hangupForegroundResumeBackground"; + serial = GetRandomSerialNumber(); + + radio_voice->hangupForegroundResumeBackground(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, + {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "hangupForegroundResumeBackground finished"; +} + +/* + * Test IRadioVoice.switchWaitingOrHoldingAndActive() for the response returned. + */ +TEST_P(RadioVoiceTest, switchWaitingOrHoldingAndActive) { + LOG(DEBUG) << "switchWaitingOrHoldingAndActive"; + serial = GetRandomSerialNumber(); + + radio_voice->switchWaitingOrHoldingAndActive(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, + {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "switchWaitingOrHoldingAndActive finished"; +} + +/* + * Test IRadioVoice.conference() for the response returned. + */ +TEST_P(RadioVoiceTest, conference) { + LOG(DEBUG) << "conference"; + serial = GetRandomSerialNumber(); + + radio_voice->conference(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, + {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "conference finished"; +} + +/* + * Test IRadioVoice.rejectCall() for the response returned. + */ +TEST_P(RadioVoiceTest, rejectCall) { + LOG(DEBUG) << "rejectCall"; + serial = GetRandomSerialNumber(); + + radio_voice->rejectCall(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, + {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "rejectCall finished"; +} + +/* + * Test IRadioVoice.getLastCallFailCause() for the response returned. + */ +TEST_P(RadioVoiceTest, getLastCallFailCause) { + LOG(DEBUG) << "getLastCallFailCause"; + serial = GetRandomSerialNumber(); + + radio_voice->getLastCallFailCause(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::NONE}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "getLastCallFailCause finished"; +} + +/* + * Test IRadioVoice.getCallForwardStatus() for the response returned. + */ +TEST_P(RadioVoiceTest, getCallForwardStatus) { + LOG(DEBUG) << "getCallForwardStatus"; + serial = GetRandomSerialNumber(); + CallForwardInfo callInfo; + memset(&callInfo, 0, sizeof(callInfo)); + callInfo.number = std::string(); + + radio_voice->getCallForwardStatus(serial, callInfo); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_voice->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "getCallForwardStatus finished"; +} + +/* + * Test IRadioVoice.setCallForward() for the response returned. + */ +TEST_P(RadioVoiceTest, setCallForward) { + LOG(DEBUG) << "setCallForward"; + serial = GetRandomSerialNumber(); + CallForwardInfo callInfo; + memset(&callInfo, 0, sizeof(callInfo)); + callInfo.number = std::string(); + + radio_voice->setCallForward(serial, callInfo); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_voice->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "setCallForward finished"; +} + +/* + * Test IRadioVoice.getCallWaiting() for the response returned. + */ +TEST_P(RadioVoiceTest, getCallWaiting) { + LOG(DEBUG) << "getCallWaiting"; + serial = GetRandomSerialNumber(); + + radio_voice->getCallWaiting(serial, 1); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_voice->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "getCallWaiting finished"; +} + +/* + * Test IRadioVoice.setCallWaiting() for the response returned. + */ +TEST_P(RadioVoiceTest, setCallWaiting) { + LOG(DEBUG) << "setCallWaiting"; + serial = GetRandomSerialNumber(); + + radio_voice->setCallWaiting(serial, true, 1); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_voice->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "setCallWaiting finished"; +} + +/* + * Test IRadioVoice.acceptCall() for the response returned. + */ +TEST_P(RadioVoiceTest, acceptCall) { + LOG(DEBUG) << "acceptCall"; + serial = GetRandomSerialNumber(); + + radio_voice->acceptCall(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, + {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "acceptCall finished"; +} + +/* + * Test IRadioVoice.separateConnection() for the response returned. + */ +TEST_P(RadioVoiceTest, separateConnection) { + LOG(DEBUG) << "separateConnection"; + serial = GetRandomSerialNumber(); + + radio_voice->separateConnection(serial, 1); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_voice->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "separateConnection finished"; +} + +/* + * Test IRadioVoice.explicitCallTransfer() for the response returned. + */ +TEST_P(RadioVoiceTest, explicitCallTransfer) { + LOG(DEBUG) << "explicitCallTransfer"; + serial = GetRandomSerialNumber(); + + radio_voice->explicitCallTransfer(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, + {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "explicitCallTransfer finished"; +} + +/* + * Test IRadioVoice.sendCdmaFeatureCode() for the response returned. + */ +TEST_P(RadioVoiceTest, sendCdmaFeatureCode) { + LOG(DEBUG) << "sendCdmaFeatureCode"; + serial = GetRandomSerialNumber(); + + radio_voice->sendCdmaFeatureCode(serial, std::string()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, + RadioError::INVALID_CALL_ID, RadioError::INVALID_MODEM_STATE, + RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "sendCdmaFeatureCode finished"; +} + +/* + * Test IRadioVoice.sendDtmf() for the response returned. + */ +TEST_P(RadioVoiceTest, sendDtmf) { + LOG(DEBUG) << "sendDtmf"; + serial = GetRandomSerialNumber(); + + radio_voice->sendDtmf(serial, "1"); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_voice->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::INVALID_CALL_ID, + RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "sendDtmf finished"; +} + +/* + * Test IRadioVoice.startDtmf() for the response returned. + */ +TEST_P(RadioVoiceTest, startDtmf) { + LOG(DEBUG) << "startDtmf"; + serial = GetRandomSerialNumber(); + + radio_voice->startDtmf(serial, "1"); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_voice->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::INVALID_CALL_ID, + RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "startDtmf finished"; +} + +/* + * Test IRadioVoice.stopDtmf() for the response returned. + */ +TEST_P(RadioVoiceTest, stopDtmf) { + LOG(DEBUG) << "stopDtmf"; + serial = GetRandomSerialNumber(); + + radio_voice->stopDtmf(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_CALL_ID, + RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "stopDtmf finished"; +} + +/* + * Test IRadioVoice.setMute() for the response returned. + */ +TEST_P(RadioVoiceTest, setMute) { + LOG(DEBUG) << "setMute"; + serial = GetRandomSerialNumber(); + + radio_voice->setMute(serial, true); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_ARGUMENTS}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "setMute finished"; +} + +/* + * Test IRadioVoice.getMute() for the response returned. + */ +TEST_P(RadioVoiceTest, getMute) { + LOG(DEBUG) << "getMute"; + serial = GetRandomSerialNumber(); + + radio_voice->getMute(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error); + } + LOG(DEBUG) << "getMute finished"; +} + +/* + * Test IRadioVoice.sendBurstDtmf() for the response returned. + */ +TEST_P(RadioVoiceTest, sendBurstDtmf) { + LOG(DEBUG) << "sendBurstDtmf"; + serial = GetRandomSerialNumber(); + + radio_voice->sendBurstDtmf(serial, "1", 0, 0); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, + RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "sendBurstDtmf finished"; +} -- GitLab From fbc5d731cabe993fa1c71bd028f5a297b26d0a6e Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Tue, 25 Jan 2022 14:24:43 -0800 Subject: [PATCH 533/825] Allow null DataProfileInfo for IA APN to clear Test: build Bug: 216357727 Change-Id: If003316192f579a3970ac48eaf50cb714cf757e6 --- .../hardware/radio/data/IRadioData.aidl | 2 +- .../hardware/radio/data/IRadioData.aidl | 7 +++--- .../compat/libradiocompat/data/RadioData.cpp | 22 ++++++++++--------- .../include/libradiocompat/RadioData.h | 3 ++- 4 files changed, 19 insertions(+), 15 deletions(-) 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 dc6092a066..7b572f1f8e 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 @@ -44,7 +44,7 @@ interface IRadioData { oneway void setDataAllowed(in int serial, in boolean allow); oneway void setDataProfile(in int serial, in android.hardware.radio.data.DataProfileInfo[] profiles); oneway void setDataThrottling(in int serial, in android.hardware.radio.data.DataThrottlingAction dataThrottlingAction, in long completionDurationMillis); - oneway void setInitialAttachApn(in int serial, in android.hardware.radio.data.DataProfileInfo dataProfileInfo); + oneway void setInitialAttachApn(in int serial, in @nullable android.hardware.radio.data.DataProfileInfo dataProfileInfo); oneway void setResponseFunctions(in android.hardware.radio.data.IRadioDataResponse radioDataResponse, in android.hardware.radio.data.IRadioDataIndication radioDataIndication); oneway void setupDataCall(in int serial, in android.hardware.radio.AccessNetwork accessNetwork, in android.hardware.radio.data.DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in android.hardware.radio.data.DataRequestReason reason, in android.hardware.radio.data.LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in @nullable android.hardware.radio.data.SliceInfo sliceInfo, in boolean matchAllRuleAllowed); oneway void startHandover(in int serial, in int callId); diff --git a/radio/aidl/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/android/hardware/radio/data/IRadioData.aidl index 54a045c35d..e1ba56828f 100644 --- a/radio/aidl/android/hardware/radio/data/IRadioData.aidl +++ b/radio/aidl/android/hardware/radio/data/IRadioData.aidl @@ -159,14 +159,15 @@ oneway interface IRadioData { in long completionDurationMillis); /** - * Set an APN to initial attach network. + * Set an APN to initial attach network or clear the existing initial attach APN. * * @param serial Serial number of request. - * @param dataProfileInfo data profile containing APN settings + * @param dataProfileInfo Data profile containing APN settings or null to clear the existing + * initial attach APN. * * Response function is IRadioDataResponse.setInitialAttachApnResponse() */ - void setInitialAttachApn(in int serial, in DataProfileInfo dataProfileInfo); + void setInitialAttachApn(in int serial, in @nullable DataProfileInfo dataProfileInfo); /** * Set response functions for data radio requests and indications. diff --git a/radio/aidl/compat/libradiocompat/data/RadioData.cpp b/radio/aidl/compat/libradiocompat/data/RadioData.cpp index d2f368778f..51f5543420 100644 --- a/radio/aidl/compat/libradiocompat/data/RadioData.cpp +++ b/radio/aidl/compat/libradiocompat/data/RadioData.cpp @@ -122,9 +122,10 @@ ScopedAStatus RadioData::setDataThrottling(int32_t serial, aidl::DataThrottlingA return ok(); } -ScopedAStatus RadioData::setInitialAttachApn(int32_t serial, const aidl::DataProfileInfo& info) { +ScopedAStatus RadioData::setInitialAttachApn(int32_t serial, + const std::optional& info) { LOG_CALL << serial; - mHal1_5->setInitialAttachApn_1_5(serial, toHidl(info)); + mHal1_5->setInitialAttachApn_1_5(serial, toHidl(info.value())); return ok(); } @@ -136,14 +137,15 @@ ScopedAStatus RadioData::setResponseFunctions( return ok(); } -ScopedAStatus RadioData::setupDataCall( // - int32_t serial, aidlCommon::AccessNetwork accessNetwork, - const aidl::DataProfileInfo& dataProfileInfo, bool roamingAllowed, - aidl::DataRequestReason reason, const std::vector& addresses, - const std::vector& dnses, int32_t pduSessId, - const std::optional& sliceInfo, bool matchAllRuleAllowed) { +ScopedAStatus RadioData::setupDataCall(int32_t serial, aidlCommon::AccessNetwork accessNetwork, + const aidl::DataProfileInfo& dataProfileInfo, + bool roamingAllowed, aidl::DataRequestReason reason, + const std::vector& addresses, + const std::vector& dnses, int32_t pduSessId, + const std::optional& sliceInfo, + bool matchAllRuleAllowed) { if (mHal1_6) { - mHal1_6->setupDataCall_1_6( // + mHal1_6->setupDataCall_1_6( serial, V1_5::AccessNetwork(accessNetwork), toHidl(dataProfileInfo), roamingAllowed, V1_2::DataRequestReason(reason), toHidl(addresses), toHidl(dnses), pduSessId, toHidl(sliceInfo), @@ -151,7 +153,7 @@ ScopedAStatus RadioData::setupDataCall( // matchAllRuleAllowed); mContext->addDataProfile(dataProfileInfo); } else { - mHal1_5->setupDataCall_1_5( // + mHal1_5->setupDataCall_1_5( serial, V1_5::AccessNetwork(accessNetwork), toHidl(dataProfileInfo), roamingAllowed, V1_2::DataRequestReason(reason), toHidl(addresses), toHidl(dnses)); } diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h index c617ec24ea..c2c0de3b05 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h @@ -44,7 +44,8 @@ class RadioData : public RadioCompatBase, public aidl::android::hardware::radio: int64_t completionDurationMillis) override; ::ndk::ScopedAStatus setInitialAttachApn( int32_t serial, - const ::aidl::android::hardware::radio::data::DataProfileInfo& dpInfo) override; + const std::optional<::aidl::android::hardware::radio::data::DataProfileInfo>& dpInfo) + override; ::ndk::ScopedAStatus setResponseFunctions( const std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse>& radioDataResponse, -- GitLab From 88d18bf4bde504220312a3726002aa6dc0298270 Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Thu, 20 Jan 2022 09:58:24 -0800 Subject: [PATCH 534/825] Convert InputClassifier HAL to AIDL No changes to the HAL are made in this change, we are only updating the interface to use AIDL. At the same time, the HAL is getting renamed to 'InputProcessor', which will mean that it's more general-purpose than just classification. We will be adding more stuff to this HAL in the future. Bug: 167946763 Bug: 205761620 Test: integration tested with other framework changes on top Change-Id: I8046cd5c74e1b69f85f21b28d5c4c3b88a61bb33 --- .../compatibility_matrix.current.xml | 8 +++ input/classifier/README.md | 1 + input/common/aidl/Android.bp | 1 + input/processor/aidl/Android.bp | 26 +++++++++ .../input/processor/IInputProcessor.aidl | 40 ++++++++++++++ .../input/processor/IInputProcessor.aidl | 40 ++++++++++++++ input/processor/aidl/default/Android.bp | 54 +++++++++++++++++++ .../processor/aidl/default/InputProcessor.cpp | 44 +++++++++++++++ .../android.hardware.input.processor.xml | 7 +++ .../inputprocessor-impl/InputProcessor.h | 40 ++++++++++++++ .../aidl/default/inputprocessor-default.rc | 4 ++ input/processor/aidl/default/main.cpp | 36 +++++++++++++ 12 files changed, 301 insertions(+) create mode 100644 input/classifier/README.md create mode 100644 input/processor/aidl/Android.bp create mode 100644 input/processor/aidl/aidl_api/android.hardware.input.processor/current/android/hardware/input/processor/IInputProcessor.aidl create mode 100644 input/processor/aidl/android/hardware/input/processor/IInputProcessor.aidl create mode 100644 input/processor/aidl/default/Android.bp create mode 100644 input/processor/aidl/default/InputProcessor.cpp create mode 100644 input/processor/aidl/default/android.hardware.input.processor.xml create mode 100644 input/processor/aidl/default/include/inputprocessor-impl/InputProcessor.h create mode 100644 input/processor/aidl/default/inputprocessor-default.rc create mode 100644 input/processor/aidl/default/main.cpp diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index dc716bbdc0..dacc846a67 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -382,6 +382,14 @@ default + + android.hardware.input.processor + 1 + + IInputProcessor + default + + android.hardware.keymaster 3.0 diff --git a/input/classifier/README.md b/input/classifier/README.md new file mode 100644 index 0000000000..a68d726318 --- /dev/null +++ b/input/classifier/README.md @@ -0,0 +1 @@ +This HAL is deprecated. Do not use this HAL. Use IInputProcessor instead, located in `hardware/interfaces/input/processor`. \ No newline at end of file diff --git a/input/common/aidl/Android.bp b/input/common/aidl/Android.bp index 6cf64a6fdd..b96f4d0635 100644 --- a/input/common/aidl/Android.bp +++ b/input/common/aidl/Android.bp @@ -9,6 +9,7 @@ package { aidl_interface { name: "android.hardware.input.common", + vendor_available: true, srcs: ["android/hardware/input/common/*.aidl"], stability: "vintf", backend: { diff --git a/input/processor/aidl/Android.bp b/input/processor/aidl/Android.bp new file mode 100644 index 0000000000..f848a5706a --- /dev/null +++ b/input/processor/aidl/Android.bp @@ -0,0 +1,26 @@ +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.input.processor", + vendor_available: true, + srcs: ["android/hardware/input/processor/*.aidl"], + imports: [ + "android.hardware.input.common", + ], + stability: "vintf", + backend: { + cpp: { + enabled: false, + }, + java: { + enabled: false, + }, + }, +} diff --git a/input/processor/aidl/aidl_api/android.hardware.input.processor/current/android/hardware/input/processor/IInputProcessor.aidl b/input/processor/aidl/aidl_api/android.hardware.input.processor/current/android/hardware/input/processor/IInputProcessor.aidl new file mode 100644 index 0000000000..9d00c70ec2 --- /dev/null +++ b/input/processor/aidl/aidl_api/android.hardware.input.processor/current/android/hardware/input/processor/IInputProcessor.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 -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.input.processor; +@VintfStability +interface IInputProcessor { + android.hardware.input.common.Classification classify(in android.hardware.input.common.MotionEvent event); + void reset(); + void resetDevice(in int deviceId); +} diff --git a/input/processor/aidl/android/hardware/input/processor/IInputProcessor.aidl b/input/processor/aidl/android/hardware/input/processor/IInputProcessor.aidl new file mode 100644 index 0000000000..635ff0aca7 --- /dev/null +++ b/input/processor/aidl/android/hardware/input/processor/IInputProcessor.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. + */ + +package android.hardware.input.processor; + +@VintfStability +interface IInputProcessor { + /** + * Upon receiving the current motion event, return the classification based on the current + * sequence of motion events. + * Once the classification has been determined, it should not change until a new gesture is + * started. + */ + android.hardware.input.common.Classification classify( + in android.hardware.input.common.MotionEvent event); + + /** + * Reset the HAL internal state. The reset may be called to prevent an inconsistent + * stream of events to be sent to the HAL. + */ + void reset(); + + /** + * Called when an input device has been reset. + */ + void resetDevice(in int deviceId); +} diff --git a/input/processor/aidl/default/Android.bp b/input/processor/aidl/default/Android.bp new file mode 100644 index 0000000000..f4855976e6 --- /dev/null +++ b/input/processor/aidl/default/Android.bp @@ -0,0 +1,54 @@ +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_library_static { + name: "libinputprocessorexampleimpl", + vendor: true, + shared_libs: [ + "libbase", + "libbinder_ndk", + "liblog", + "libutils", + "android.hardware.input.common-V1-ndk", + "android.hardware.input.processor-V1-ndk", + ], + export_include_dirs: ["include"], + srcs: [ + "InputProcessor.cpp", + ], + visibility: [ + ":__subpackages__", + "//hardware/interfaces/tests/extension/input/processor:__subpackages__", + ], +} + +filegroup { + name: "android.hardware.input.processor.xml", + srcs: ["android.hardware.input.processor.xml"], +} + +cc_binary { + name: "android.hardware.input.processor-service.example", + relative_install_path: "hw", + init_rc: ["inputprocessor-default.rc"], + vintf_fragments: [":android.hardware.input.processor.xml"], + vendor: true, + shared_libs: [ + "libbase", + "libbinder_ndk", + "liblog", + "libutils", + "android.hardware.input.common-V1-ndk", + "android.hardware.input.processor-V1-ndk", + ], + static_libs: [ + "libinputprocessorexampleimpl", + ], + srcs: ["main.cpp"], +} diff --git a/input/processor/aidl/default/InputProcessor.cpp b/input/processor/aidl/default/InputProcessor.cpp new file mode 100644 index 0000000000..fb6bbd5f4d --- /dev/null +++ b/input/processor/aidl/default/InputProcessor.cpp @@ -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. + */ + +#include "inputprocessor-impl/InputProcessor.h" + +namespace aidl { +namespace android { +namespace hardware { +namespace input { +namespace processor { + +using ::aidl::android::hardware::input::common::Classification; +using aidl::android::hardware::input::common::MotionEvent; + +::ndk::ScopedAStatus InputProcessor::classify(const MotionEvent& /*in_event*/, + Classification* _aidl_return) { + *_aidl_return = Classification::NONE; + return ndk::ScopedAStatus::ok(); +} +::ndk::ScopedAStatus InputProcessor::reset() { + return ndk::ScopedAStatus::ok(); +} +::ndk::ScopedAStatus InputProcessor::resetDevice(int32_t /*in_deviceId*/) { + return ndk::ScopedAStatus::ok(); +} + +} // namespace processor +} // namespace input +} // namespace hardware +} // namespace android +} // namespace aidl \ No newline at end of file diff --git a/input/processor/aidl/default/android.hardware.input.processor.xml b/input/processor/aidl/default/android.hardware.input.processor.xml new file mode 100644 index 0000000000..5ecbd2af0c --- /dev/null +++ b/input/processor/aidl/default/android.hardware.input.processor.xml @@ -0,0 +1,7 @@ + + + android.hardware.input.processor + 1 + IInputProcessor/default + + \ No newline at end of file diff --git a/input/processor/aidl/default/include/inputprocessor-impl/InputProcessor.h b/input/processor/aidl/default/include/inputprocessor-impl/InputProcessor.h new file mode 100644 index 0000000000..0d6bc58599 --- /dev/null +++ b/input/processor/aidl/default/include/inputprocessor-impl/InputProcessor.h @@ -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. + */ + +#pragma once + +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace input { +namespace processor { + +class InputProcessor : public ::aidl::android::hardware::input::processor::BnInputProcessor { + public: + ::ndk::ScopedAStatus classify( + const ::aidl::android::hardware::input::common::MotionEvent& in_event, + ::aidl::android::hardware::input::common::Classification* _aidl_return) override; + ::ndk::ScopedAStatus reset() override; + ::ndk::ScopedAStatus resetDevice(int32_t in_deviceId) override; +}; + +} // namespace processor +} // namespace input +} // namespace hardware +} // namespace android +} // namespace aidl \ No newline at end of file diff --git a/input/processor/aidl/default/inputprocessor-default.rc b/input/processor/aidl/default/inputprocessor-default.rc new file mode 100644 index 0000000000..bcc6c02435 --- /dev/null +++ b/input/processor/aidl/default/inputprocessor-default.rc @@ -0,0 +1,4 @@ +service vendor.inputprocessor-default /vendor/bin/hw/android.hardware.input.processor-service.example + class hal + user nobody + group nobody \ No newline at end of file diff --git a/input/processor/aidl/default/main.cpp b/input/processor/aidl/default/main.cpp new file mode 100644 index 0000000000..7b519dd667 --- /dev/null +++ b/input/processor/aidl/default/main.cpp @@ -0,0 +1,36 @@ +/* + * 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. + */ + +#include "inputprocessor-impl/InputProcessor.h" + +#include +#include +#include + +using ::aidl::android::hardware::input::processor::IInputProcessor; +using ::aidl::android::hardware::input::processor::InputProcessor; + +int main() { + ABinderProcess_setThreadPoolMaxThreadCount(0); + + auto processor = ndk::SharedRefBase::make(); + const std::string name = std::string() + InputProcessor::descriptor + "/default"; + binder_status_t status = AServiceManager_addService(processor->asBinder().get(), name.c_str()); + CHECK_EQ(status, STATUS_OK); + + ABinderProcess_joinThreadPool(); + return EXIT_FAILURE; // should not reach +} \ No newline at end of file -- GitLab From 70ac10680d30a68c7f7eaf83d350537fc9784012 Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Wed, 26 Jan 2022 21:26:52 -0800 Subject: [PATCH 535/825] Add HDMI to Source HDMI was actually part of InputDevice.java API, and it was later added into native as part of another CL. This got left out of the original input.common HAL because the history of the API was unclear at the time. Bug: 214604719 Test: none Change-Id: If9855ed6aea1848b646fe8b34e3f8da29a73b632 --- .../current/android/hardware/input/common/Source.aidl | 1 + input/common/aidl/android/hardware/input/common/Source.aidl | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Source.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Source.aidl index 24d02cdbdc..396e06de97 100644 --- a/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Source.aidl +++ b/input/common/aidl/aidl_api/android.hardware.input.common/current/android/hardware/input/common/Source.aidl @@ -48,6 +48,7 @@ enum Source { TOUCH_NAVIGATION = 2097152, ROTARY_ENCODER = 4194304, JOYSTICK = 16777232, + HDMI = 33554433, SENSOR = 67108864, ANY = -256, } diff --git a/input/common/aidl/android/hardware/input/common/Source.aidl b/input/common/aidl/android/hardware/input/common/Source.aidl index 7eb6d66d64..c6a825a4d6 100644 --- a/input/common/aidl/android/hardware/input/common/Source.aidl +++ b/input/common/aidl/android/hardware/input/common/Source.aidl @@ -38,6 +38,11 @@ enum Source { TOUCH_NAVIGATION = (1 << 21) | SourceClass.NONE, ROTARY_ENCODER = (1 << 22) | SourceClass.NONE, JOYSTICK = (1 << 24) | SourceClass.JOYSTICK, + /** + * The input source is a device connected through HDMI-based bus. + * The keys come in through HDMI-CEC or MHL signal line. + */ + HDMI = (1 << 25) | SourceClass.BUTTON, SENSOR = (1 << 26) | SourceClass.NONE, ANY = 0xFFFFFF00, } -- GitLab From 12cf91d7f6af0816d33b8e4591f8e35f2e72c2cb Mon Sep 17 00:00:00 2001 From: Tyler Trephan Date: Fri, 28 Jan 2022 21:09:35 +0000 Subject: [PATCH 536/825] Updated VTS to support heading sensors. Test: atest VtsAidlHalSensorsTargetTest Bug: 214096235 Change-Id: Id8c589c010ebd66cc33f66e08b6bdee1f7612ba3 --- sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp index 105cb97eda..83d0dc97e1 100644 --- a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp +++ b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp @@ -75,6 +75,7 @@ static void assertTypeMatchStringType(SensorType type, const std::string& string CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GYROSCOPE_LIMITED_AXES); CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GYROSCOPE_LIMITED_AXES_UNCALIBRATED); CHECK_TYPE_STRING_FOR_SENSOR_TYPE(GYROSCOPE_UNCALIBRATED); + CHECK_TYPE_STRING_FOR_SENSOR_TYPE(HEADING); CHECK_TYPE_STRING_FOR_SENSOR_TYPE(HEART_BEAT); CHECK_TYPE_STRING_FOR_SENSOR_TYPE(HEART_RATE); CHECK_TYPE_STRING_FOR_SENSOR_TYPE(LIGHT); @@ -144,6 +145,7 @@ int expectedReportModeForType(SensorType type) { case SensorType::GEOMAGNETIC_ROTATION_VECTOR: case SensorType::POSE_6DOF: case SensorType::HEART_BEAT: + case SensorType::HEADING: return SensorInfo::SENSOR_FLAG_BITS_CONTINUOUS_MODE; case SensorType::LIGHT: -- GitLab From b0a6c0bd2047c6808eae7666c91f0c46b0c97c88 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 28 Jan 2022 13:30:42 -0800 Subject: [PATCH 537/825] uwb(hal): Add device capability TLV values Resolving a review comment from ag/16739541. Bug: 208678993 Test: Compiles Change-Id: I19ae20e37ab6ef0bf8f7db473b977e8dac872d0d --- .../UwbVendorCapabilityTlvValues.aidl | 91 ++++++++++++++++ .../UwbVendorCapabilityTlvTypes.aidl | 8 +- .../UwbVendorCapabilityTlvValues.aidl | 100 ++++++++++++++++++ 3 files changed, 194 insertions(+), 5 deletions(-) create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl create mode 100644 uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl new file mode 100644 index 0000000000..9966d55427 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl @@ -0,0 +1,91 @@ +/* + * 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 -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.uwb.fira_android; +@Backing(type="long") @VintfStability +enum UwbVendorCapabilityTlvValues { + HAS_AZIMUTH_SUPPORT = 1, + HAS_ELEVATION_SUPPORT = 2, + HAS_FOM_SUPPORT = 4, + HAS_FULL_AZIMUTH_SUPPORT = 8, + HAS_CONTROLEE_INITIATOR_SUPPORT = 1, + HAS_CONTROLEE_RESPONDER_SUPPORT = 2, + HAS_CONTROLLER_INITIATOR_SUPPORT = 4, + HAS_CONTROLLER_RESPONDER_SUPPORT = 8, + HAS_CRC_16_SUPPORT = 1, + HAS_CRC_32_SUPPORT = 2, + HAS_UNICAST_SUPPORT = 1, + HAS_ONE_TO_MANY_SUPPORT = 2, + HAS_MANY_TO_MANY_SUPPORT = 4, + SUPPORTED_PREAMBLE_HAS_32_SYMBOLS_SUPPORT = 1, + SUPPORTED_PREAMBLE_HAS_64_SYMBOLS_SUPPORT = 2, + HAS_BPRF_SUPPORT = 1, + HAS_HPRF_SUPPORT = 2, + HAS_DS_TWR_SUPPORT = 1, + HAS_SS_TWR_SUPPORT = 2, + HAS_SP0_RFRAME_SUPPORT = 1, + HAS_SP1_RFRAME_SUPPORT = 2, + HAS_SP3_RFRAME_SUPPORT = 8, + HAS_SFD0_SUPPORT = 1, + HAS_SFD1_SUPPORT = 2, + HAS_SFD2_SUPPORT = 4, + HAS_SFD3_SUPPORT = 8, + HAS_SFD4_SUPPORT = 16, + HAS_STATIC_STS_SUPPORT = 1, + HAS_DYNAMIC_STS_SUPPORT = 2, + HAS_DYNAMIC_STS_INDIVIDUAL_CONTROLEE_KEY_SUPPORT = 4, + HAS_0_SEGMENT_SUPPORT = 1, + HAS_1_SEGMENT_SUPPORT = 2, + HAS_2_SEGMENT_SUPPORT = 4, + HAS_6M81_SUPPORT = 1, + HAS_850K_SUPPORT = 2, + HAS_27M2_SUPPORT = 4, + HAS_31M2_SUPPORT = 8, + UWB_CONFIG_0 = 0, + UWB_CONFIG_1 = 1, + PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 1, + PULSE_SHAPE_PRECURSOR_FREE = 2, + PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 3, + CHAPS_PER_SLOT_3 = 3, + CHAPS_PER_SLOT_4 = 4, + CHAPS_PER_SLOT_6 = 6, + CHAPS_PER_SLOT_8 = 8, + CHAPS_PER_SLOT_9 = 9, + CHAPS_PER_SLOT_12 = 12, + CHAPS_PER_SLOT_24 = 24, + HOPPING_SEQUENCE_DEFAULT = 0, + HOPPING_SEQUENCE_AES = 1, + HOPPING_CONFIG_MODE_NONE = 0, + HOPPING_CONFIG_MODE_CONTINUOUS = 1, + HOPPING_CONFIG_MODE_ADAPTIVE = 2, +} diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index 6f3c1bb768..7001842f00 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -17,13 +17,11 @@ package android.hardware.uwb.fira_android; /** - * Android specific capability params expected in UCI command: + * Android specific capability TLV types in UCI command: * GID: 0000b (UWB Core Group) * OID: 000011b (CORE_GET_CAPS_INFO_CMD) - * Values expected for each type should correspond to values used in the FIRA UCI specification. - * - * For ex, If the device supports responder and initiator device roles. Use this TLV to - * indicate that: * {SUPPORTED_DEVICE_ROLES, 2, [0x0 // responder, 0x1 // initiator]}} + * Values expected for each type are mentioned in the docs below and the constants + * used are defined in UwbVendorCapabilityTlvValues enum. */ @VintfStability @Backing(type="int") diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl new file mode 100644 index 0000000000..208096965b --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl @@ -0,0 +1,100 @@ +/* + * 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. + */ + +package android.hardware.uwb.fira_android; + +/** + * Android specific capability TLV values expected in UCI command: + * GID: 0000b (UWB Core Group), + * OID: 000011b (CORE_GET_CAPS_INFO_CMD), + */ +@VintfStability +@Backing(type="long") +enum UwbVendorCapabilityTlvValues { + HAS_AZIMUTH_SUPPORT = 1, + HAS_ELEVATION_SUPPORT = (1 << 1), + HAS_FOM_SUPPORT = (1 << 2), + HAS_FULL_AZIMUTH_SUPPORT = (1 << 3), + + HAS_CONTROLEE_INITIATOR_SUPPORT = 1, + HAS_CONTROLEE_RESPONDER_SUPPORT = (1 << 1), + HAS_CONTROLLER_INITIATOR_SUPPORT = (1 << 2), + HAS_CONTROLLER_RESPONDER_SUPPORT = (1 << 3), + + HAS_CRC_16_SUPPORT = 1, + HAS_CRC_32_SUPPORT = (1 << 1), + + HAS_UNICAST_SUPPORT = 1, + HAS_ONE_TO_MANY_SUPPORT = (1 << 1), + HAS_MANY_TO_MANY_SUPPORT = (1 << 2), + + SUPPORTED_PREAMBLE_HAS_32_SYMBOLS_SUPPORT = 1, + SUPPORTED_PREAMBLE_HAS_64_SYMBOLS_SUPPORT = (1 << 1), + + HAS_BPRF_SUPPORT = 1, + HAS_HPRF_SUPPORT = (1 << 1), + + HAS_DS_TWR_SUPPORT = 1, + HAS_SS_TWR_SUPPORT = (1 << 1), + + HAS_SP0_RFRAME_SUPPORT = 1, + HAS_SP1_RFRAME_SUPPORT = (1 << 1), + HAS_SP3_RFRAME_SUPPORT = (1 << 3), + + HAS_SFD0_SUPPORT = 1, + HAS_SFD1_SUPPORT = (1 << 1), + HAS_SFD2_SUPPORT = (1 << 2), + HAS_SFD3_SUPPORT = (1 << 3), + HAS_SFD4_SUPPORT = (1 << 4), + + HAS_STATIC_STS_SUPPORT = 1, + HAS_DYNAMIC_STS_SUPPORT = (1 << 1), + HAS_DYNAMIC_STS_INDIVIDUAL_CONTROLEE_KEY_SUPPORT = (1 << 2), + + HAS_0_SEGMENT_SUPPORT = 1, + HAS_1_SEGMENT_SUPPORT = (1 << 1), + HAS_2_SEGMENT_SUPPORT = (1 << 2), + + HAS_6M81_SUPPORT = 1, + HAS_850K_SUPPORT = (1 << 1), + HAS_27M2_SUPPORT = (1 << 2), + HAS_31M2_SUPPORT = (1 << 3), + + /********************************************* + * CCC specific + ********************************************/ + UWB_CONFIG_0 = 0, + UWB_CONFIG_1 = 1, + + PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 1, + PULSE_SHAPE_PRECURSOR_FREE = 2, + PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 3, + + CHAPS_PER_SLOT_3 = 3, + CHAPS_PER_SLOT_4 = 4, + CHAPS_PER_SLOT_6 = 6, + CHAPS_PER_SLOT_8 = 8, + CHAPS_PER_SLOT_9 = 9, + CHAPS_PER_SLOT_12 = 12, + CHAPS_PER_SLOT_24 = 24, + + HOPPING_SEQUENCE_DEFAULT = 0, + HOPPING_SEQUENCE_AES = 1, + + HOPPING_CONFIG_MODE_NONE = 0, + HOPPING_CONFIG_MODE_CONTINUOUS = 1, + HOPPING_CONFIG_MODE_ADAPTIVE = 2, +} -- GitLab From 634340d6a8e34c3688227b88ba8ccde341076b2b Mon Sep 17 00:00:00 2001 From: ramindani Date: Fri, 7 Jan 2022 00:04:23 +0000 Subject: [PATCH 538/825] IComposerClient wrapper for VTS tests A wrapper helps with implementation details of IComposerClient and improves re-usability with readback and base tests. BUG: 199413815 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I627748d1c779eaacf92ff6fb5ccf3138a3024681 --- .../composer3/vts/functional/Android.bp | 9 +- .../vts/functional/composer-vts/Android.bp | 78 --- .../composer-vts/VtsComposerClient.cpp | 471 ++++++++++++++++++ .../include/GraphicsComposerCallback.h | 7 - .../composer-vts/include/ReadbackVts.h | 10 +- .../composer-vts/include/RenderEngineVts.h | 9 +- .../composer-vts/include/VtsComposerClient.h | 232 +++++++++ .../graphics/composer3/ComposerClientWriter.h | 6 +- 8 files changed, 716 insertions(+), 106 deletions(-) delete mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp index bd2c3b1248..139b5e8512 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp @@ -35,6 +35,9 @@ cc_test { "VtsHalGraphicsComposer3_TargetTest.cpp", "VtsHalGraphicsComposer3_ReadbackTest.cpp", "composer-vts/GraphicsComposerCallback.cpp", + "composer-vts/ReadbackVts.cpp", + "composer-vts/RenderEngineVts.cpp", + "composer-vts/VtsComposerClient.cpp", ], shared_libs: [ @@ -72,15 +75,19 @@ cc_test { "android.hardware.graphics.allocator@2.0", "android.hardware.graphics.allocator@3.0", "android.hardware.graphics.allocator@4.0", - "android.hardware.graphics.composer@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", + "libarect", + "libbase", + "libfmq", "libgtest", + "libmath", "librenderengine", "libshaders", + "libsync", "libtonemap", ], cflags: [ diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp deleted file mode 100644 index df038db47b..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp +++ /dev/null @@ -1,78 +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. - */ - -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_library_static { - name: "android.hardware.graphics.composer@3-vts", - defaults: ["hidl_defaults"], - srcs: [ - "GraphicsComposerCallback.cpp", - "ReadbackVts.cpp", - "RenderEngineVts.cpp", - ], - header_libs: [ - "android.hardware.graphics.composer3-command-buffer", - ], - static_libs: [ - "android.hardware.graphics.composer3-V1-ndk", - "android.hardware.graphics.common-V3-ndk", - "android.hardware.common-V2-ndk", - "android.hardware.common.fmq-V1-ndk", - "libarect", - "libgtest", - "libbase", - "libfmq", - "libsync", - "libmath", - "libaidlcommonsupport", - "libnativewindow", - "librenderengine", - "libshaders", - "libtonemap", - "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", - ], - shared_libs: [ - "libbinder_ndk", - "libhidlbase", - "libui", - "android.hardware.graphics.composer3-V1-ndk", - ], - export_static_lib_headers: [ - "android.hardware.graphics.mapper@2.1-vts", - "librenderengine", - ], - cflags: [ - "-O0", - "-g", - "-DLOG_TAG=\"ComposerVts\"", - "-Wconversion", - ], - export_header_lib_headers: [ - "android.hardware.graphics.composer3-command-buffer", - ], - export_include_dirs: ["include"], -} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp new file mode 100644 index 0000000000..9eb2ef55ff --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp @@ -0,0 +1,471 @@ +/** + * 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. + */ + +#include "include/VtsComposerClient.h" +#include +#include +#include + +#undef LOG_TAG +#define LOG_TAG "VtsComposerClient" + +using namespace std::chrono_literals; + +namespace aidl::android::hardware::graphics::composer3::vts { + +VtsComposerClient::VtsComposerClient(const std::string& name) { + SpAIBinder binder(AServiceManager_waitForService(name.c_str())); + ALOGE_IF(binder == nullptr, "Could not initialize the service binder"); + if (binder != nullptr) { + mComposer = IComposer::fromBinder(binder); + ALOGE_IF(mComposer == nullptr, "Failed to acquire the composer from the binder"); + } +} + +bool VtsComposerClient::createClient() { + if (mComposer == nullptr) { + ALOGE("IComposer not initialized"); + return false; + } + auto error = mComposer->createClient(&mComposerClient); + if (!error.isOk() || mComposerClient == nullptr) { + ALOGE("Failed to create client for IComposerClient with %s", + error.getDescription().c_str()); + return false; + } + mComposerCallback = SharedRefBase::make(); + if (mComposerCallback == nullptr) { + ALOGE("Unable to create ComposerCallback"); + return false; + } + error = mComposerClient->registerCallback(mComposerCallback); + if (!error.isOk()) { + ALOGE("Unable to register the callback with IComposerClient, failed with %s", + error.getDescription().c_str()); + return false; + } + return true; +} + +bool VtsComposerClient::tearDown() { + return verifyComposerCallbackParams() && destroyAllLayers(); +} + +std::pair VtsComposerClient::createVirtualDisplay( + int32_t width, int32_t height, PixelFormat pixelFormat, int32_t bufferSlotCount) { + VirtualDisplay outVirtualDisplay; + auto error = mComposerClient->createVirtualDisplay(width, height, pixelFormat, bufferSlotCount, + &outVirtualDisplay); + if (!error.isOk()) { + return {std::move(error), outVirtualDisplay}; + } + return {addDisplayToDisplayResources(outVirtualDisplay.display, /*isVirtual*/ true), + outVirtualDisplay}; +} + +ScopedAStatus VtsComposerClient::destroyVirtualDisplay(int64_t display) { + auto error = mComposerClient->destroyVirtualDisplay(display); + if (!error.isOk()) { + return error; + } + mDisplayResources.erase(display); + return error; +} + +std::pair VtsComposerClient::createLayer(int64_t display, + int32_t bufferSlotCount) { + int64_t outLayer; + auto error = mComposerClient->createLayer(display, bufferSlotCount, &outLayer); + + if (!error.isOk()) { + return {std::move(error), outLayer}; + } + return {addLayerToDisplayResources(display, outLayer), outLayer}; +} + +ScopedAStatus VtsComposerClient::destroyLayer(int64_t display, int64_t layer) { + auto error = mComposerClient->destroyLayer(display, layer); + + if (!error.isOk()) { + return error; + } + removeLayerFromDisplayResources(display, layer); + return error; +} + +std::pair VtsComposerClient::getActiveConfig(int64_t display) { + int32_t outConfig; + return {mComposerClient->getActiveConfig(display, &outConfig), outConfig}; +} + +ScopedAStatus VtsComposerClient::setActiveConfig(VtsDisplay& vtsDisplay, int32_t config) { + auto error = mComposerClient->setActiveConfig(vtsDisplay.get(), config); + if (!error.isOk()) { + return error; + } + return updateDisplayProperties(vtsDisplay, config); +} + +std::pair VtsComposerClient::getDisplayAttribute( + int64_t display, int32_t config, DisplayAttribute displayAttribute) { + int32_t outDisplayAttribute; + return {mComposerClient->getDisplayAttribute(display, config, displayAttribute, + &outDisplayAttribute), + outDisplayAttribute}; +} + +ScopedAStatus VtsComposerClient::setPowerMode(int64_t display, PowerMode powerMode) { + return mComposerClient->setPowerMode(display, powerMode); +} + +ScopedAStatus VtsComposerClient::setVsync(int64_t display, bool enable) { + return mComposerClient->setVsyncEnabled(display, enable); +} + +void VtsComposerClient::setVsyncAllowed(bool isAllowed) { + mComposerCallback->setVsyncAllowed(isAllowed); +} + +std::pair> VtsComposerClient::getDataspaceSaturationMatrix( + Dataspace dataspace) { + std::vector outMatrix; + return {mComposerClient->getDataspaceSaturationMatrix(dataspace, &outMatrix), outMatrix}; +} + +std::pair> VtsComposerClient::executeCommands( + const std::vector& commands) { + std::vector outResultPayload; + return {mComposerClient->executeCommands(commands, &outResultPayload), + std::move(outResultPayload)}; +} + +std::optional VtsComposerClient::takeLastVsyncPeriodChangeTimeline() { + return mComposerCallback->takeLastVsyncPeriodChangeTimeline(); +} + +ScopedAStatus VtsComposerClient::setContentType(int64_t display, ContentType contentType) { + return mComposerClient->setContentType(display, contentType); +} + +std::pair +VtsComposerClient::setActiveConfigWithConstraints(VtsDisplay& vtsDisplay, int32_t config, + const VsyncPeriodChangeConstraints& constraints) { + VsyncPeriodChangeTimeline outTimeline; + auto error = mComposerClient->setActiveConfigWithConstraints(vtsDisplay.get(), config, + constraints, &outTimeline); + if (!error.isOk()) { + return {std::move(error), outTimeline}; + } + return {updateDisplayProperties(vtsDisplay, config), outTimeline}; +} + +std::pair> VtsComposerClient::getDisplayCapabilities( + int64_t display) { + std::vector outCapabilities; + return {mComposerClient->getDisplayCapabilities(display, &outCapabilities), outCapabilities}; +} + +ScopedAStatus VtsComposerClient::dumpDebugInfo() { + std::string debugInfo; + return mComposer->dumpDebugInfo(&debugInfo); +} + +std::pair VtsComposerClient::getDisplayIdentificationData( + int64_t display) { + DisplayIdentification outDisplayIdentification; + return {mComposerClient->getDisplayIdentificationData(display, &outDisplayIdentification), + outDisplayIdentification}; +} + +std::pair VtsComposerClient::getHdrCapabilities(int64_t display) { + HdrCapabilities outHdrCapabilities; + return {mComposerClient->getHdrCapabilities(display, &outHdrCapabilities), outHdrCapabilities}; +} + +std::pair> +VtsComposerClient::getPerFrameMetadataKeys(int64_t display) { + std::vector outPerFrameMetadataKeys; + return {mComposerClient->getPerFrameMetadataKeys(display, &outPerFrameMetadataKeys), + outPerFrameMetadataKeys}; +} + +std::pair VtsComposerClient::getReadbackBufferAttributes( + int64_t display) { + ReadbackBufferAttributes outReadbackBufferAttributes; + return {mComposerClient->getReadbackBufferAttributes(display, &outReadbackBufferAttributes), + outReadbackBufferAttributes}; +} + +ScopedAStatus VtsComposerClient::setReadbackBuffer(int64_t display, const native_handle* buffer, + const ScopedFileDescriptor& releaseFence) { + return mComposerClient->setReadbackBuffer(display, ::android::dupToAidl(buffer), releaseFence); +} + +std::pair VtsComposerClient::getReadbackBufferFence( + int64_t display) { + ScopedFileDescriptor outReleaseFence; + return {mComposerClient->getReadbackBufferFence(display, &outReleaseFence), + std::move(outReleaseFence)}; +} + +std::pair> VtsComposerClient::getColorModes(int64_t display) { + std::vector outColorModes; + return {mComposerClient->getColorModes(display, &outColorModes), outColorModes}; +} + +std::pair> VtsComposerClient::getRenderIntents( + int64_t display, ColorMode colorMode) { + std::vector outRenderIntents; + return {mComposerClient->getRenderIntents(display, colorMode, &outRenderIntents), + outRenderIntents}; +} + +ScopedAStatus VtsComposerClient::setColorMode(int64_t display, ColorMode colorMode, + RenderIntent renderIntent) { + return mComposerClient->setColorMode(display, colorMode, renderIntent); +} + +std::pair +VtsComposerClient::getDisplayedContentSamplingAttributes(int64_t display) { + DisplayContentSamplingAttributes outAttributes; + return {mComposerClient->getDisplayedContentSamplingAttributes(display, &outAttributes), + outAttributes}; +} + +ScopedAStatus VtsComposerClient::setDisplayedContentSamplingEnabled( + int64_t display, bool isEnabled, FormatColorComponent formatColorComponent, + int64_t maxFrames) { + return mComposerClient->setDisplayedContentSamplingEnabled(display, isEnabled, + formatColorComponent, maxFrames); +} + +std::pair VtsComposerClient::getDisplayedContentSample( + int64_t display, int64_t maxFrames, int64_t timestamp) { + DisplayContentSample outDisplayContentSample; + return {mComposerClient->getDisplayedContentSample(display, maxFrames, timestamp, + &outDisplayContentSample), + outDisplayContentSample}; +} + +std::pair VtsComposerClient::getDisplayConnectionType( + int64_t display) { + DisplayConnectionType outDisplayConnectionType; + return {mComposerClient->getDisplayConnectionType(display, &outDisplayConnectionType), + outDisplayConnectionType}; +} + +std::pair> VtsComposerClient::getDisplayConfigs( + int64_t display) { + std::vector outConfigs; + return {mComposerClient->getDisplayConfigs(display, &outConfigs), outConfigs}; +} + +std::pair VtsComposerClient::getDisplayVsyncPeriod(int64_t display) { + int32_t outVsyncPeriodNanos; + return {mComposerClient->getDisplayVsyncPeriod(display, &outVsyncPeriodNanos), + outVsyncPeriodNanos}; +} + +ScopedAStatus VtsComposerClient::setAutoLowLatencyMode(int64_t display, bool isEnabled) { + return mComposerClient->setAutoLowLatencyMode(display, isEnabled); +} + +std::pair> VtsComposerClient::getSupportedContentTypes( + int64_t display) { + std::vector outContentTypes; + return {mComposerClient->getSupportedContentTypes(display, &outContentTypes), outContentTypes}; +} + +std::pair VtsComposerClient::getMaxVirtualDisplayCount() { + int32_t outMaxVirtualDisplayCount; + return {mComposerClient->getMaxVirtualDisplayCount(&outMaxVirtualDisplayCount), + outMaxVirtualDisplayCount}; +} + +std::pair VtsComposerClient::getDisplayName(int64_t display) { + std::string outDisplayName; + return {mComposerClient->getDisplayName(display, &outDisplayName), outDisplayName}; +} + +ScopedAStatus VtsComposerClient::setClientTargetSlotCount(int64_t display, + int32_t bufferSlotCount) { + return mComposerClient->setClientTargetSlotCount(display, bufferSlotCount); +} + +std::pair> VtsComposerClient::getCapabilities() { + std::vector outCapabilities; + return {mComposer->getCapabilities(&outCapabilities), outCapabilities}; +} + +ScopedAStatus VtsComposerClient::setBootDisplayConfig(int64_t display, int32_t config) { + return mComposerClient->setBootDisplayConfig(display, config); +} + +ScopedAStatus VtsComposerClient::clearBootDisplayConfig(int64_t display) { + return mComposerClient->clearBootDisplayConfig(display); +} + +std::pair VtsComposerClient::getPreferredBootDisplayConfig( + int64_t display) { + int32_t outConfig; + return {mComposerClient->getPreferredBootDisplayConfig(display, &outConfig), outConfig}; +} + +std::pair VtsComposerClient::getDisplayPhysicalOrientation( + int64_t display) { + common::Transform outDisplayOrientation; + return {mComposerClient->getDisplayPhysicalOrientation(display, &outDisplayOrientation), + outDisplayOrientation}; +} + +std::pair> VtsComposerClient::getDisplays() { + while (true) { + // Sleep for a small period of time to allow all built-in displays + // to post hotplug events + std::this_thread::sleep_for(5ms); + std::vector displays = mComposerCallback->getDisplays(); + if (displays.empty()) { + continue; + } + + std::vector vtsDisplays; + vtsDisplays.reserve(displays.size()); + for (int64_t display : displays) { + auto activeConfig = getActiveConfig(display); + if (!activeConfig.first.isOk()) { + ALOGE("Unable to get the displays for test, failed to get the active config " + "for display %" PRId64, + display); + return {std::move(activeConfig.first), vtsDisplays}; + } + auto vtsDisplay = VtsDisplay{display}; + auto error = updateDisplayProperties(vtsDisplay, activeConfig.second); + if (!error.isOk()) { + ALOGE("Unable to get the displays for test, failed to update the properties " + "for display %" PRId64, + display); + return {std::move(error), vtsDisplays}; + } + vtsDisplays.emplace_back(vtsDisplay); + addDisplayToDisplayResources(display, /*isVirtual*/ false); + } + + return {ScopedAStatus::ok(), vtsDisplays}; + } +} + +ScopedAStatus VtsComposerClient::updateDisplayProperties(VtsDisplay& vtsDisplay, int32_t config) { + const auto width = getDisplayAttribute(vtsDisplay.get(), config, DisplayAttribute::WIDTH); + const auto height = getDisplayAttribute(vtsDisplay.get(), config, DisplayAttribute::HEIGHT); + const auto vsyncPeriod = + getDisplayAttribute(vtsDisplay.get(), config, DisplayAttribute::VSYNC_PERIOD); + const auto configGroup = + getDisplayAttribute(vtsDisplay.get(), config, DisplayAttribute::CONFIG_GROUP); + if (width.first.isOk() && height.first.isOk() && vsyncPeriod.first.isOk() && + configGroup.first.isOk()) { + vtsDisplay.setDimensions(width.second, height.second); + 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() + << ", config: " << configGroup.first.isOk(); + return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_CONFIG); +} + +ScopedAStatus VtsComposerClient::addDisplayToDisplayResources(int64_t display, bool isVirtual) { + if (mDisplayResources.insert({display, DisplayResource(isVirtual)}).second) { + return ScopedAStatus::ok(); + } + + ALOGE("Duplicate display id %" PRId64, display); + return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_DISPLAY); +} + +ScopedAStatus VtsComposerClient::addLayerToDisplayResources(int64_t display, int64_t layer) { + auto resource = mDisplayResources.find(display); + if (resource == mDisplayResources.end()) { + resource = mDisplayResources.insert({display, DisplayResource(false)}).first; + } + + if (!resource->second.layers.insert(layer).second) { + ALOGE("Duplicate layer id %" PRId64, layer); + return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_LAYER); + } + return ScopedAStatus::ok(); +} + +void VtsComposerClient::removeLayerFromDisplayResources(int64_t display, int64_t layer) { + auto resource = mDisplayResources.find(display); + if (resource != mDisplayResources.end()) { + resource->second.layers.erase(layer); + } +} + +bool VtsComposerClient::verifyComposerCallbackParams() { + bool isValid = true; + if (mComposerCallback != nullptr) { + if (mComposerCallback->getInvalidHotplugCount() != 0) { + ALOGE("Invalid hotplug count"); + isValid = false; + } + if (mComposerCallback->getInvalidRefreshCount() != 0) { + ALOGE("Invalid refresh count"); + isValid = false; + } + if (mComposerCallback->getInvalidVsyncCount() != 0) { + ALOGE("Invalid vsync count"); + isValid = false; + } + if (mComposerCallback->getInvalidVsyncPeriodChangeCount() != 0) { + ALOGE("Invalid vsync period change count"); + isValid = false; + } + if (mComposerCallback->getInvalidSeamlessPossibleCount() != 0) { + ALOGE("Invalid seamless possible count"); + isValid = false; + } + } + return isValid; +} + +bool VtsComposerClient::destroyAllLayers() { + for (const auto& it : mDisplayResources) { + const auto& [display, resource] = it; + + for (auto layer : resource.layers) { + const auto error = destroyLayer(display, layer); + if (!error.isOk()) { + ALOGE("Unable to destroy all the layers, failed at layer %" PRId64 " with error %s", + layer, error.getDescription().c_str()); + return false; + } + } + + if (resource.isVirtual) { + const auto error = destroyVirtualDisplay(display); + if (!error.isOk()) { + ALOGE("Unable to destroy the display %" PRId64 " failed with error %s", display, + error.getDescription().c_str()); + return false; + } + } + } + mDisplayResources.clear(); + return true; +} +} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h index c359d5eaa2..d3b391f67c 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h @@ -15,18 +15,11 @@ */ #pragma once -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wconversion" - #include #include #include #include -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic pop // ignored "-Wconversion - namespace aidl::android::hardware::graphics::composer3::vts { class GraphicsComposerCallback : public BnComposerCallback { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h index a3ce795db1..c36306bd05 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h @@ -16,11 +16,6 @@ #pragma once -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wconversion" - -#include #include #include #include @@ -28,11 +23,8 @@ #include #include #include - #include - -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic pop // ignored "-Wconversion +#include "GraphicsComposerCallback.h" namespace aidl::android::hardware::graphics::composer3::vts { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h index a776a279c4..43d3a42808 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h @@ -15,11 +15,6 @@ */ #pragma once -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wconversion" - -#include #include #include #include @@ -30,9 +25,7 @@ #include #include #include - -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic pop // ignored "-Wconversion +#include "ReadbackVts.h" namespace aidl::android::hardware::graphics::composer3::vts { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h new file mode 100644 index 0000000000..26be138c02 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h @@ -0,0 +1,232 @@ +/** + * Copyright (c) 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "GraphicsComposerCallback.h" + +using aidl::android::hardware::graphics::common::Dataspace; +using aidl::android::hardware::graphics::common::FRect; +using aidl::android::hardware::graphics::common::PixelFormat; +using aidl::android::hardware::graphics::common::Rect; +using namespace ::ndk; + +namespace aidl::android::hardware::graphics::composer3::vts { + +class VtsDisplay; +/** + * A wrapper to IComposerClient. + * This wrapper manages the IComposerClient instance and manages the resources for + * the tests with respect to the IComposerClient calls. + */ +class VtsComposerClient { + public: + VtsComposerClient(const std::string& name); + + bool createClient(); + + bool tearDown(); + + std::pair createVirtualDisplay(int32_t width, int32_t height, + PixelFormat pixelFormat, + int32_t bufferSlotCount); + + ScopedAStatus destroyVirtualDisplay(int64_t display); + + std::pair createLayer(int64_t display, int32_t bufferSlotCount); + + ScopedAStatus destroyLayer(int64_t display, int64_t layer); + + std::pair getActiveConfig(int64_t display); + + ScopedAStatus setActiveConfig(VtsDisplay& vtsDisplay, int32_t config); + + std::pair getDisplayAttribute(int64_t display, int32_t config, + DisplayAttribute displayAttribute); + + ScopedAStatus setPowerMode(int64_t display, PowerMode powerMode); + + ScopedAStatus setVsync(int64_t display, bool enable); + + void setVsyncAllowed(bool isAllowed); + + std::pair> getDataspaceSaturationMatrix(Dataspace dataspace); + + std::pair> executeCommands( + const std::vector& commands); + + std::optional takeLastVsyncPeriodChangeTimeline(); + + ScopedAStatus setContentType(int64_t display, ContentType contentType); + + std::pair setActiveConfigWithConstraints( + VtsDisplay& vtsDisplay, int32_t config, + const VsyncPeriodChangeConstraints& constraints); + + std::pair> getDisplayCapabilities( + int64_t display); + + ScopedAStatus dumpDebugInfo(); + + std::pair getDisplayIdentificationData(int64_t display); + + std::pair getHdrCapabilities(int64_t display); + + std::pair> getPerFrameMetadataKeys( + int64_t display); + + std::pair getReadbackBufferAttributes(int64_t display); + + ScopedAStatus setReadbackBuffer(int64_t display, const native_handle* buffer, + const ScopedFileDescriptor& releaseFence); + + std::pair getReadbackBufferFence(int64_t display); + + std::pair> getColorModes(int64_t display); + + std::pair> getRenderIntents(int64_t display, + ColorMode colorMode); + + ScopedAStatus setColorMode(int64_t display, ColorMode colorMode, RenderIntent renderIntent); + + std::pair + getDisplayedContentSamplingAttributes(int64_t display); + + ScopedAStatus setDisplayedContentSamplingEnabled(int64_t display, bool isEnabled, + FormatColorComponent formatColorComponent, + int64_t maxFrames); + + std::pair getDisplayedContentSample(int64_t display, + int64_t maxFrames, + int64_t timestamp); + + std::pair getDisplayConnectionType(int64_t display); + + std::pair> getDisplayConfigs(int64_t display); + + std::pair getDisplayVsyncPeriod(int64_t display); + + ScopedAStatus setAutoLowLatencyMode(int64_t display, bool isEnabled); + + std::pair> getSupportedContentTypes(int64_t display); + + std::pair getMaxVirtualDisplayCount(); + + std::pair getDisplayName(int64_t display); + + ScopedAStatus setClientTargetSlotCount(int64_t display, int32_t bufferSlotCount); + + std::pair> getCapabilities(); + + ScopedAStatus setBootDisplayConfig(int64_t display, int32_t config); + + ScopedAStatus clearBootDisplayConfig(int64_t display); + + std::pair getPreferredBootDisplayConfig(int64_t display); + + std::pair getDisplayPhysicalOrientation(int64_t display); + + std::pair> getDisplays(); + + private: + ScopedAStatus updateDisplayProperties(VtsDisplay& vtsDisplay, int32_t config); + + ScopedAStatus addDisplayToDisplayResources(int64_t display, bool isVirtual); + + ScopedAStatus addLayerToDisplayResources(int64_t display, int64_t layer); + + void removeLayerFromDisplayResources(int64_t display, int64_t layer); + + bool destroyAllLayers(); + + bool verifyComposerCallbackParams(); + + // Keep track of displays and layers. When a test fails/ends, + // the VtsComposerClient::tearDown should be called from the + // test tearDown to clean up the resources for the test. + struct DisplayResource { + DisplayResource(bool isVirtual_) : isVirtual(isVirtual_) {} + + bool isVirtual; + std::unordered_set layers; + }; + + std::shared_ptr mComposer; + std::shared_ptr mComposerClient; + std::shared_ptr mComposerCallback; + std::unordered_map mDisplayResources; +}; + +class VtsDisplay { + public: + VtsDisplay(int64_t displayId) : mDisplayId(displayId) {} + + int64_t get() const { return mDisplayId; } + + FRect getCrop() const { + return {0, 0, static_cast(mDisplayWidth), static_cast(mDisplayHeight)}; + } + + Rect getFrameRect() const { return {0, 0, mDisplayWidth, mDisplayHeight}; } + + void setDimensions(int32_t displayWidth, int32_t displayHeight) { + mDisplayWidth = displayWidth; + mDisplayHeight = displayHeight; + } + + int32_t getDisplayWidth() const { return mDisplayWidth; } + + int32_t getDisplayHeight() const { return mDisplayHeight; } + + struct DisplayConfig { + DisplayConfig(int32_t vsyncPeriod_, int32_t configGroup_) + : vsyncPeriod(vsyncPeriod_), configGroup(configGroup_) {} + int32_t vsyncPeriod; + int32_t configGroup; + }; + + void addDisplayConfig(int32_t config, DisplayConfig displayConfig) { + displayConfigs.insert({config, displayConfig}); + } + + DisplayConfig getDisplayConfig(int32_t config) { return displayConfigs.find(config)->second; } + + private: + const int64_t mDisplayId; + int32_t mDisplayWidth; + int32_t mDisplayHeight; + std::unordered_map displayConfigs; +}; +} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file 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 d3266e7623..a04b9824c4 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -189,7 +189,7 @@ class ComposerClientWriter { void setLayerZOrder(int64_t display, int64_t layer, uint32_t z) { ZOrder zorder; - zorder.z = z; + zorder.z = static_cast(z); getLayerCommand(display, layer).z.emplace(std::move(zorder)); } @@ -228,9 +228,9 @@ class ComposerClientWriter { std::optional mLayerCommand; std::vector mCommands; - Buffer getBuffer(int slot, const native_handle_t* bufferHandle, int fence) { + Buffer getBuffer(uint32_t slot, const native_handle_t* bufferHandle, int fence) { Buffer bufferCommand; - bufferCommand.slot = slot; + bufferCommand.slot = static_cast(slot); if (bufferHandle) bufferCommand.handle.emplace(::android::dupToAidl(bufferHandle)); if (fence > 0) bufferCommand.fence = ::ndk::ScopedFileDescriptor(fence); return bufferCommand; -- GitLab From 9cf44590f207f6c509b321f169b9792820139fd0 Mon Sep 17 00:00:00 2001 From: Isaac Chiou Date: Mon, 17 Jan 2022 13:37:35 +0800 Subject: [PATCH 539/825] Add HAL APIs for WiFi CHRE NAN RTT 1. Add new APIs to enable/disable CHRE NAN RTT 2. Add a new API to register callback. This callback should report events from WLAN driver for CHRE. Test: New APIs work fine Bug: 206614765 Change-Id: I8c8ab002064a9556be2e7d3972703bb3255a3a41 --- wifi/1.6/default/hidl_callback_util.h | 9 ++++-- wifi/1.6/default/wifi_legacy_hal.cpp | 34 ++++++++++++++++++++++ wifi/1.6/default/wifi_legacy_hal.h | 13 +++++++++ wifi/1.6/default/wifi_legacy_hal_stubs.cpp | 3 ++ 4 files changed, 56 insertions(+), 3 deletions(-) diff --git a/wifi/1.6/default/hidl_callback_util.h b/wifi/1.6/default/hidl_callback_util.h index 3ac54c1666..aab0ae5393 100644 --- a/wifi/1.6/default/hidl_callback_util.h +++ b/wifi/1.6/default/hidl_callback_util.h @@ -20,6 +20,7 @@ #include #include +#include namespace { // Type of callback invoked by the death handler. @@ -68,9 +69,11 @@ class HidlCallbackHandler { // (callback proxy's raw pointer) to track the death of individual // clients. uint64_t cookie = reinterpret_cast(cb.get()); - if (cb_set_.find(cb) != cb_set_.end()) { - LOG(WARNING) << "Duplicate death notification registration"; - return true; + for (const auto& s : cb_set_) { + if (interfacesEqual(cb, s)) { + LOG(ERROR) << "Duplicate death notification registration"; + return true; + } } if (!cb->linkToDeath(death_handler_, cookie)) { LOG(ERROR) << "Failed to register death notification"; diff --git a/wifi/1.6/default/wifi_legacy_hal.cpp b/wifi/1.6/default/wifi_legacy_hal.cpp index b006e4596e..8a75fd83e3 100644 --- a/wifi/1.6/default/wifi_legacy_hal.cpp +++ b/wifi/1.6/default/wifi_legacy_hal.cpp @@ -357,6 +357,15 @@ void onAsyncTwtEventDeviceNotify(TwtDeviceNotify* event) { } } +// Callback to report current CHRE NAN state +std::function on_chre_nan_rtt_internal_callback; +void onAsyncChreNanRttState(chre_nan_rtt_state state) { + const auto lock = hidl_sync_util::acquireGlobalLock(); + if (on_chre_nan_rtt_internal_callback) { + on_chre_nan_rtt_internal_callback(state); + } +} + // End of the free-standing "C" style callbacks. WifiLegacyHal::WifiLegacyHal(const std::weak_ptr iface_tool, @@ -1551,6 +1560,30 @@ WifiLegacyHal::getSupportedRadioCombinationsMatrix() { return {status, radio_combination_matrix_ptr}; } +wifi_error WifiLegacyHal::chreNanRttRequest(const std::string& iface_name, bool enable) { + if (enable) + return global_func_table_.wifi_nan_rtt_chre_enable_request(0, getIfaceHandle(iface_name), + NULL); + else + return global_func_table_.wifi_nan_rtt_chre_disable_request(0, getIfaceHandle(iface_name)); +} + +wifi_error WifiLegacyHal::chreRegisterHandler(const std::string& iface_name, + const ChreCallbackHandlers& handler) { + if (on_chre_nan_rtt_internal_callback) { + return WIFI_ERROR_NOT_AVAILABLE; + } + + on_chre_nan_rtt_internal_callback = handler.on_wifi_chre_nan_rtt_state; + + wifi_error status = global_func_table_.wifi_chre_register_handler(getIfaceHandle(iface_name), + {onAsyncChreNanRttState}); + if (status != WIFI_SUCCESS) { + on_chre_nan_rtt_internal_callback = nullptr; + } + return status; +} + void WifiLegacyHal::invalidate() { global_handle_ = nullptr; iface_name_to_handle_.clear(); @@ -1586,6 +1619,7 @@ void WifiLegacyHal::invalidate() { on_twt_event_teardown_completion_callback = nullptr; on_twt_event_info_frame_received_callback = nullptr; on_twt_event_device_notify_callback = nullptr; + on_chre_nan_rtt_internal_callback = nullptr; } } // namespace legacy_hal diff --git a/wifi/1.6/default/wifi_legacy_hal.h b/wifi/1.6/default/wifi_legacy_hal.h index 638bfa1598..ab21e8e31f 100644 --- a/wifi/1.6/default/wifi_legacy_hal.h +++ b/wifi/1.6/default/wifi_legacy_hal.h @@ -36,6 +36,7 @@ namespace implementation { namespace legacy_hal { // Import all the types defined inside the legacy HAL header files into this // namespace. +using ::chre_nan_rtt_state; using ::frame_info; using ::frame_type; using ::FRAME_TYPE_80211_MGMT; @@ -458,6 +459,12 @@ struct TwtCallbackHandlers { std::function on_device_notify; }; +// CHRE response and event callbacks struct. +struct ChreCallbackHandlers { + // Callback for CHRE NAN RTT + std::function on_wifi_chre_nan_rtt_state; +}; + /** * Class that encapsulates all legacy HAL interactions. * This class manages the lifetime of the event loop thread used by legacy HAL. @@ -670,6 +677,12 @@ class WifiLegacyHal { std::pair getSupportedRadioCombinationsMatrix(); + // CHRE NAN RTT function + wifi_error chreNanRttRequest(const std::string& iface_name, bool enable); + + wifi_error chreRegisterHandler(const std::string& iface_name, + const ChreCallbackHandlers& handler); + private: // Retrieve interface handles for all the available interfaces. wifi_error retrieveIfaceHandles(); diff --git a/wifi/1.6/default/wifi_legacy_hal_stubs.cpp b/wifi/1.6/default/wifi_legacy_hal_stubs.cpp index 05a27cf33e..5ad22f5803 100644 --- a/wifi/1.6/default/wifi_legacy_hal_stubs.cpp +++ b/wifi/1.6/default/wifi_legacy_hal_stubs.cpp @@ -163,6 +163,9 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) { populateStubFor(&hal_fn->wifi_trigger_subsystem_restart); populateStubFor(&hal_fn->wifi_set_indoor_state); populateStubFor(&hal_fn->wifi_get_supported_radio_combinations_matrix); + populateStubFor(&hal_fn->wifi_nan_rtt_chre_enable_request); + populateStubFor(&hal_fn->wifi_nan_rtt_chre_disable_request); + populateStubFor(&hal_fn->wifi_chre_register_handler); return true; } } // namespace legacy_hal -- GitLab From ca421a6c70c38ff00e4b98bc9d126aca415c6767 Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Fri, 28 Jan 2022 15:54:36 -0800 Subject: [PATCH 540/825] Final API changes for IRadio Remove CarrierRestrictions#priority Move USSD from messaging -> voice Rename DataProfileInfo#TYPE_THREE_GPP/2 -> TYPE_3GPP2 Remove neighboring CID APIs Test: atest VtsHalRadioTargetTest Bug: 199433581 Bug: 216688606 Change-Id: I621d99b8024f92709bcb675b667bcba678eede9b --- .../hardware/radio/data/DataProfileInfo.aidl | 4 +- .../radio/messaging/IRadioMessaging.aidl | 2 - .../messaging/IRadioMessagingIndication.aidl | 1 - .../messaging/IRadioMessagingResponse.aidl | 2 - .../radio/network/NeighboringCell.aidl | 39 --------------- .../radio/sim/CarrierRestrictions.aidl | 1 - .../hardware/radio/voice/IRadioVoice.aidl | 2 + .../radio/voice/IRadioVoiceIndication.aidl | 1 + .../radio/voice/IRadioVoiceResponse.aidl | 2 + .../hardware/radio/voice}/UssdModeType.aidl | 2 +- .../hardware/radio/data/DataProfileInfo.aidl | 6 +-- .../radio/messaging/IRadioMessaging.aidl | 26 ---------- .../messaging/IRadioMessagingIndication.aidl | 11 ----- .../messaging/IRadioMessagingResponse.aidl | 47 ------------------- .../hardware/radio/modem/RadioCapability.aidl | 2 - .../hardware/radio/network/IRadioNetwork.aidl | 1 - .../network/IRadioNetworkIndication.aidl | 1 - .../radio/network/IRadioNetworkResponse.aidl | 3 -- .../radio/network/NeighboringCell.aidl | 30 ------------ .../radio/sim/CarrierRestrictions.aidl | 5 -- .../hardware/radio/voice/EmergencyNumber.aidl | 2 - .../hardware/radio/voice/IRadioVoice.aidl | 27 ++++++++++- .../radio/voice/IRadioVoiceIndication.aidl | 11 +++++ .../radio/voice/IRadioVoiceResponse.aidl | 47 +++++++++++++++++++ .../{messaging => voice}/UssdModeType.aidl | 2 +- .../include/libradiocompat/RadioMessaging.h | 2 - .../include/libradiocompat/RadioVoice.h | 2 + .../messaging/RadioIndication-messaging.cpp | 7 --- .../messaging/RadioMessaging.cpp | 12 ----- .../messaging/RadioResponse-messaging.cpp | 12 ----- .../compat/libradiocompat/network/structs.cpp | 7 --- .../compat/libradiocompat/network/structs.h | 3 -- .../voice/RadioIndication-voice.cpp | 7 +++ .../voice/RadioResponse-voice.cpp | 12 +++++ .../libradiocompat/voice/RadioVoice.cpp | 12 +++++ radio/aidl/vts/radio_data_test.cpp | 8 ++-- radio/aidl/vts/radio_messaging_indication.cpp | 6 --- radio/aidl/vts/radio_messaging_response.cpp | 13 ----- radio/aidl/vts/radio_messaging_test.cpp | 45 ++---------------- radio/aidl/vts/radio_messaging_utils.h | 7 --- radio/aidl/vts/radio_network_test.cpp | 25 +--------- radio/aidl/vts/radio_sim_test.cpp | 13 ++--- radio/aidl/vts/radio_voice_indication.cpp | 6 +++ radio/aidl/vts/radio_voice_response.cpp | 12 +++++ radio/aidl/vts/radio_voice_test.cpp | 45 +++++++++++++++++- radio/aidl/vts/radio_voice_utils.h | 7 +++ 46 files changed, 207 insertions(+), 333 deletions(-) delete mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl rename radio/aidl/aidl_api/{android.hardware.radio.messaging/current/android/hardware/radio/messaging => android.hardware.radio.voice/current/android/hardware/radio/voice}/UssdModeType.aidl (97%) delete mode 100644 radio/aidl/android/hardware/radio/network/NeighboringCell.aidl rename radio/aidl/android/hardware/radio/{messaging => voice}/UssdModeType.aidl (96%) 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 c8efea02d0..e21afc93c3 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 @@ -62,6 +62,6 @@ parcelable DataProfileInfo { const int ID_OEM_BASE = 1000; const int ID_INVALID = -1; const int TYPE_COMMON = 0; - const int TYPE_THREE_GPP = 1; - const int TYPE_THREE_GPP2 = 2; + const int TYPE_3GPP = 1; + const int TYPE_3GPP2 = 2; } 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 b0fc349ab8..dfec59ae45 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 @@ -37,7 +37,6 @@ interface IRadioMessaging { oneway void acknowledgeIncomingGsmSmsWithPdu(in int serial, in boolean success, in String ackPdu); oneway void acknowledgeLastIncomingCdmaSms(in int serial, in android.hardware.radio.messaging.CdmaSmsAck smsAck); oneway void acknowledgeLastIncomingGsmSms(in int serial, in boolean success, in android.hardware.radio.messaging.SmsAcknowledgeFailCause cause); - oneway void cancelPendingUssd(in int serial); oneway void deleteSmsOnRuim(in int serial, in int index); oneway void deleteSmsOnSim(in int serial, in int index); oneway void getCdmaBroadcastConfig(in int serial); @@ -50,7 +49,6 @@ interface IRadioMessaging { oneway void sendImsSms(in int serial, in android.hardware.radio.messaging.ImsSmsMessage message); oneway void sendSms(in int serial, in android.hardware.radio.messaging.GsmSmsMessage message); oneway void sendSmsExpectMore(in int serial, in android.hardware.radio.messaging.GsmSmsMessage message); - oneway void sendUssd(in int serial, in String ussd); oneway void setCdmaBroadcastActivation(in int serial, in boolean activate); oneway void setCdmaBroadcastConfig(in int serial, in android.hardware.radio.messaging.CdmaBroadcastSmsConfigInfo[] configInfo); oneway void setGsmBroadcastActivation(in int serial, in boolean activate); 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 89a0f3b656..8f7824f515 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 @@ -40,6 +40,5 @@ interface IRadioMessagingIndication { oneway void newSms(in android.hardware.radio.RadioIndicationType type, in byte[] pdu); oneway void newSmsOnSim(in android.hardware.radio.RadioIndicationType type, in int recordNumber); oneway void newSmsStatusReport(in android.hardware.radio.RadioIndicationType type, in byte[] pdu); - oneway void onUssd(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.messaging.UssdModeType modeType, in String msg); oneway void simSmsStorageFull(in android.hardware.radio.RadioIndicationType type); } 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 156f24b653..c3af7a684c 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 @@ -38,7 +38,6 @@ interface IRadioMessagingResponse { oneway void acknowledgeLastIncomingCdmaSmsResponse(in android.hardware.radio.RadioResponseInfo info); oneway void acknowledgeLastIncomingGsmSmsResponse(in android.hardware.radio.RadioResponseInfo info); oneway void acknowledgeRequest(in int serial); - oneway void cancelPendingUssdResponse(in android.hardware.radio.RadioResponseInfo info); oneway void deleteSmsOnRuimResponse(in android.hardware.radio.RadioResponseInfo info); oneway void deleteSmsOnSimResponse(in android.hardware.radio.RadioResponseInfo info); oneway void getCdmaBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.CdmaBroadcastSmsConfigInfo[] configs); @@ -50,7 +49,6 @@ interface IRadioMessagingResponse { oneway void sendImsSmsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms); oneway void sendSmsExpectMoreResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms); oneway void sendSmsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms); - oneway void sendUssdResponse(in android.hardware.radio.RadioResponseInfo info); oneway void setCdmaBroadcastActivationResponse(in android.hardware.radio.RadioResponseInfo info); oneway void setCdmaBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info); oneway void setGsmBroadcastActivationResponse(in android.hardware.radio.RadioResponseInfo info); diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl deleted file mode 100644 index 4f29c0b95b..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NeighboringCell.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio.network; -@VintfStability -parcelable NeighboringCell { - String cid; - int rssi; -} 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 ef9c779d56..85cf86e41f 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 @@ -36,6 +36,5 @@ package android.hardware.radio.sim; parcelable CarrierRestrictions { android.hardware.radio.sim.Carrier[] allowedCarriers; android.hardware.radio.sim.Carrier[] excludedCarriers; - boolean priority; boolean allowedCarriersPrioritized; } 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 34d155aa79..603b1d67aa 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 @@ -35,6 +35,7 @@ package android.hardware.radio.voice; @VintfStability interface IRadioVoice { oneway void acceptCall(in int serial); + oneway void cancelPendingUssd(in int serial); oneway void conference(in int serial); oneway void dial(in int serial, in android.hardware.radio.voice.Dial dialInfo); oneway void emergencyDial(in int serial, in android.hardware.radio.voice.Dial dialInfo, in int categories, in String[] urns, in android.hardware.radio.voice.EmergencyCallRouting routing, in boolean hasKnownUserIntentEmergency, in boolean isTesting); @@ -59,6 +60,7 @@ interface IRadioVoice { oneway void sendBurstDtmf(in int serial, in String dtmf, in int on, in int off); oneway void sendCdmaFeatureCode(in int serial, in String featureCode); oneway void sendDtmf(in int serial, in String s); + oneway void sendUssd(in int serial, in String ussd); oneway void separateConnection(in int serial, in int gsmIndex); oneway void setCallForward(in int serial, in android.hardware.radio.voice.CallForwardInfo callInfo); oneway void setCallWaiting(in int serial, in boolean enable, in int serviceClass); 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 af3417d1e2..189ed43cf9 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 @@ -44,6 +44,7 @@ interface IRadioVoiceIndication { oneway void exitEmergencyCallbackMode(in android.hardware.radio.RadioIndicationType type); oneway void indicateRingbackTone(in android.hardware.radio.RadioIndicationType type, in boolean start); oneway void onSupplementaryServiceIndication(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.StkCcUnsolSsResult ss); + oneway void onUssd(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.UssdModeType modeType, in String msg); oneway void resendIncallMute(in android.hardware.radio.RadioIndicationType type); oneway void srvccStateNotify(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.SrvccState state); oneway void stkCallControlAlphaNotify(in android.hardware.radio.RadioIndicationType type, in String alpha); 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 a3b5e58aed..7acc0446dd 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 @@ -36,6 +36,7 @@ package android.hardware.radio.voice; interface IRadioVoiceResponse { oneway void acceptCallResponse(in android.hardware.radio.RadioResponseInfo info); oneway void acknowledgeRequest(in int serial); + oneway void cancelPendingUssdResponse(in android.hardware.radio.RadioResponseInfo info); oneway void conferenceResponse(in android.hardware.radio.RadioResponseInfo info); oneway void dialResponse(in android.hardware.radio.RadioResponseInfo info); oneway void emergencyDialResponse(in android.hardware.radio.RadioResponseInfo info); @@ -59,6 +60,7 @@ interface IRadioVoiceResponse { oneway void sendBurstDtmfResponse(in android.hardware.radio.RadioResponseInfo info); oneway void sendCdmaFeatureCodeResponse(in android.hardware.radio.RadioResponseInfo info); oneway void sendDtmfResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendUssdResponse(in android.hardware.radio.RadioResponseInfo info); oneway void separateConnectionResponse(in android.hardware.radio.RadioResponseInfo info); oneway void setCallForwardResponse(in android.hardware.radio.RadioResponseInfo info); oneway void setCallWaitingResponse(in android.hardware.radio.RadioResponseInfo info); diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl similarity index 97% rename from radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl rename to radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl index 5395b11781..9a9d723ada 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/UssdModeType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl @@ -31,7 +31,7 @@ // 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.messaging; +package android.hardware.radio.voice; @Backing(type="int") @VintfStability enum UssdModeType { NOTIFY = 0, diff --git a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl index 7360202aaf..840f6e9573 100644 --- a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl +++ b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl @@ -16,9 +16,7 @@ package android.hardware.radio.data; -import android.hardware.radio.RadioAccessFamily; import android.hardware.radio.data.ApnAuthType; -import android.hardware.radio.data.ApnTypes; import android.hardware.radio.data.PdpProtocolType; import android.hardware.radio.data.TrafficDescriptor; @@ -36,8 +34,8 @@ parcelable DataProfileInfo { const int ID_INVALID = 0xFFFFFFFF; const int TYPE_COMMON = 0; - const int TYPE_THREE_GPP = 1; - const int TYPE_THREE_GPP2 = 2; + const int TYPE_3GPP = 1; + const int TYPE_3GPP2 = 2; /** * ID of the data profile. diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl index 1dbaed3787..8bd84a301a 100644 --- a/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl +++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl @@ -78,15 +78,6 @@ oneway interface IRadioMessaging { void acknowledgeLastIncomingGsmSms( in int serial, in boolean success, in SmsAcknowledgeFailCause cause); - /** - * Cancel the current USSD session if one exists. - * - * @param serial Serial number of request. - * - * Response function is IRadioMessagingResponse.cancelPendingUssdResponse() - */ - void cancelPendingUssd(in int serial); - /** * Deletes a CDMA SMS message from RUIM memory. * @@ -211,23 +202,6 @@ oneway interface IRadioMessaging { */ void sendSmsExpectMore(in int serial, in GsmSmsMessage message); - /** - * Send a USSD message. If a USSD session already exists, the message must be sent in the - * context of that session. Otherwise, a new session must be created. The network reply must be - * reported via unsolOnUssd. - * - * Only one USSD session must exist at a time, and the session is assumed to exist until: - * a) The android system invokes cancelUssd() - * b) The implementation sends a unsolOnUssd() with a type code of - * "0" (USSD-Notify/no further action) or "2" (session terminated) - * - * @param serial Serial number of request. - * @param ussd string containing the USSD request in UTF-8 format - * - * Response function is IRadioMessagingResponse.sendUssdResponse() - */ - void sendUssd(in int serial, in String ussd); - /** * Enable or disable the reception of CDMA Cell Broadcast SMS * diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl index 4b40bfb6c1..8834cd91c0 100644 --- a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl +++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl @@ -18,7 +18,6 @@ package android.hardware.radio.messaging; import android.hardware.radio.RadioIndicationType; import android.hardware.radio.messaging.CdmaSmsMessage; -import android.hardware.radio.messaging.UssdModeType; /** * Interface declaring unsolicited radio indications for messaging APIs. @@ -85,16 +84,6 @@ oneway interface IRadioMessagingIndication { */ void newSmsStatusReport(in RadioIndicationType type, in byte[] pdu); - /** - * Indicates when a new USSD message is received. The USSD session is assumed to persist if the - * type code is REQUEST, otherwise the current session (if any) is assumed to have terminated. - * - * @param type Type of radio indication - * @param modeType USSD type code - * @param msg Message string in UTF-8, if applicable - */ - void onUssd(in RadioIndicationType type, in UssdModeType modeType, in String msg); - /** * Indicates that SMS storage on the SIM is full. Sent when the network attempts to deliver a * new SMS message. Messages cannot be saved on the SIM until space is freed. In particular, diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl index 75fa390cba..492755f6a1 100644 --- a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl +++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl @@ -86,27 +86,6 @@ oneway interface IRadioMessagingResponse { */ void acknowledgeRequest(in int serial); - /** - * @param info Response info struct containing response type, serial no. and error - * - * Valid errors returned: - * RadioError:NONE - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:SIM_BUSY - * RadioError:OPERATION_NOT_ALLOWED - * RadioError:MODEM_ERR - * RadioError:INTERNAL_ERR - * RadioError:NO_MEMORY - * RadioError:INVALID_STATE - * RadioError:INVALID_ARGUMENTS - * RadioError:SYSTEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:INVALID_MODEM_STATE - * RadioError:NO_RESOURCES - * RadioError:CANCELLED - */ - void cancelPendingUssdResponse(in RadioResponseInfo info); - /** * @param info Response info struct containing response type, serial no. and error * @@ -401,32 +380,6 @@ oneway interface IRadioMessagingResponse { */ void sendSmsResponse(in RadioResponseInfo info, in SendSmsResult sms); - /** - * @param info Response info struct containing response type, serial no. and error - * - * Valid errors returned: - * RadioError:NONE - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:FDN_CHECK_FAILURE - * RadioError:USSD_MODIFIED_TO_DIAL - * RadioError:USSD_MODIFIED_TO_SS - * RadioError:USSD_MODIFIED_TO_USSD - * RadioError:SIM_BUSY - * RadioError:OPERATION_NOT_ALLOWED - * RadioError:INVALID_ARGUMENTS - * RadioError:NO_MEMORY - * RadioError:MODEM_ERR - * RadioError:INTERNAL_ERR - * RadioError:ABORTED - * RadioError:SYSTEM_ERR - * RadioError:INVALID_STATE - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:INVALID_MODEM_STATE - * RadioError:NO_RESOURCES - * RadioError:CANCELLED - */ - void sendUssdResponse(in RadioResponseInfo info); - /** * @param info Response info struct containing response type, serial no. and error * diff --git a/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl b/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl index 9bd5f21a7f..96b9d0de48 100644 --- a/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl +++ b/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl @@ -16,8 +16,6 @@ package android.hardware.radio.modem; -import android.hardware.radio.RadioAccessFamily; - @VintfStability parcelable RadioCapability { /** diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl index 7a22a9a68f..cce52ffe52 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl @@ -17,7 +17,6 @@ package android.hardware.radio.network; import android.hardware.radio.AccessNetwork; -import android.hardware.radio.RadioAccessFamily; import android.hardware.radio.network.CdmaRoamingType; import android.hardware.radio.network.IRadioNetworkIndication; import android.hardware.radio.network.IRadioNetworkResponse; diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl index 6863ac3acd..f471433780 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl @@ -21,7 +21,6 @@ import android.hardware.radio.RadioTechnology; import android.hardware.radio.network.BarringInfo; import android.hardware.radio.network.CellIdentity; import android.hardware.radio.network.CellInfo; -import android.hardware.radio.network.Domain; import android.hardware.radio.network.LinkCapacityEstimate; import android.hardware.radio.network.NetworkScanResult; import android.hardware.radio.network.PhoneRestrictedState; diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl index e650321ef9..dcf0004d6c 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl @@ -16,7 +16,6 @@ package android.hardware.radio.network; -import android.hardware.radio.RadioAccessFamily; import android.hardware.radio.RadioResponseInfo; import android.hardware.radio.RadioTechnology; import android.hardware.radio.RadioTechnologyFamily; @@ -24,8 +23,6 @@ import android.hardware.radio.network.BarringInfo; import android.hardware.radio.network.CdmaRoamingType; import android.hardware.radio.network.CellIdentity; import android.hardware.radio.network.CellInfo; -import android.hardware.radio.network.LceDataInfo; -import android.hardware.radio.network.NeighboringCell; import android.hardware.radio.network.OperatorInfo; import android.hardware.radio.network.RadioAccessSpecifier; import android.hardware.radio.network.RadioBandMode; diff --git a/radio/aidl/android/hardware/radio/network/NeighboringCell.aidl b/radio/aidl/android/hardware/radio/network/NeighboringCell.aidl deleted file mode 100644 index 270bdee021..0000000000 --- a/radio/aidl/android/hardware/radio/network/NeighboringCell.aidl +++ /dev/null @@ -1,30 +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. - */ - -package android.hardware.radio.network; - -@VintfStability -parcelable NeighboringCell { - /** - * Combination of LAC and cell ID in 32 bits in GSM. Upper 16 bits is LAC and lower 16 bits is - * CID (as described in TS 27.005). - */ - String cid; - /** - * Received RSSI in GSM, level index of CPICH Received Signal Code Power in UMTS - */ - int rssi; -} diff --git a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl index 12df138b5f..ef38fdc171 100644 --- a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl +++ b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl @@ -30,11 +30,6 @@ parcelable CarrierRestrictions { * is ABCD, all carriers with the same mcc/mnc are allowed. */ Carrier[] excludedCarriers; - /** - * Whether this is a carrier restriction with priority or not. - * If this is false, allowedCarriersPrioritized is not applicable. - */ - boolean priority; /** * True means that only carriers included in the allowed list and not in the excluded list * are permitted. Eg. allowedCarriers match mcc/mnc, excludedCarriers has same mcc/mnc and diff --git a/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl b/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl index ddc5d765a0..9fed78e2cb 100644 --- a/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl +++ b/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl @@ -16,8 +16,6 @@ package android.hardware.radio.voice; -import android.hardware.radio.voice.EmergencyServiceCategory; - /** * Emergency number contains information of number, one or more service category(s), zero or more * emergency uniform resource names, mobile country code (mcc), mobile network country (mnc) and diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl index b25e63dff6..c05d2378af 100644 --- a/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl +++ b/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl @@ -19,7 +19,6 @@ package android.hardware.radio.voice; import android.hardware.radio.voice.CallForwardInfo; import android.hardware.radio.voice.Dial; import android.hardware.radio.voice.EmergencyCallRouting; -import android.hardware.radio.voice.EmergencyServiceCategory; import android.hardware.radio.voice.IRadioVoiceIndication; import android.hardware.radio.voice.IRadioVoiceResponse; import android.hardware.radio.voice.TtyMode; @@ -44,6 +43,15 @@ oneway interface IRadioVoice { */ void acceptCall(in int serial); + /** + * Cancel the current USSD session if one exists. + * + * @param serial Serial number of request. + * + * Response function is IRadioVoiceResponse.cancelPendingUssdResponse() + */ + void cancelPendingUssd(in int serial); + /** * Conference holding and active (like AT+CHLD=3) * @@ -324,6 +332,23 @@ oneway interface IRadioVoice { */ void sendDtmf(in int serial, in String s); + /** + * Send a USSD message. If a USSD session already exists, the message must be sent in the + * context of that session. Otherwise, a new session must be created. The network reply must be + * reported via unsolOnUssd. + * + * Only one USSD session must exist at a time, and the session is assumed to exist until: + * a) The android system invokes cancelUssd() + * b) The implementation sends a unsolOnUssd() with a type code of + * "0" (USSD-Notify/no further action) or "2" (session terminated) + * + * @param serial Serial number of request. + * @param ussd string containing the USSD request in UTF-8 format + * + * Response function is IRadioVoiceResponse.sendUssdResponse() + */ + void sendUssd(in int serial, in String ussd); + /** * Separate a party from a multiparty call placing the multiparty call (less the specified * party) on hold and leaving the specified party as the only other member of the current diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl index 25e87b3671..437fef6c59 100644 --- a/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl +++ b/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl @@ -24,6 +24,7 @@ import android.hardware.radio.voice.CdmaSignalInfoRecord; import android.hardware.radio.voice.EmergencyNumber; import android.hardware.radio.voice.SrvccState; import android.hardware.radio.voice.StkCcUnsolSsResult; +import android.hardware.radio.voice.UssdModeType; /** * Interface declaring unsolicited radio indications for voice APIs. @@ -137,6 +138,16 @@ oneway interface IRadioVoiceIndication { */ void onSupplementaryServiceIndication(in RadioIndicationType type, in StkCcUnsolSsResult ss); + /** + * Indicates when a new USSD message is received. The USSD session is assumed to persist if the + * type code is REQUEST, otherwise the current session (if any) is assumed to have terminated. + * + * @param type Type of radio indication + * @param modeType USSD type code + * @param msg Message string in UTF-8, if applicable + */ + void onUssd(in RadioIndicationType type, in UssdModeType modeType, in String msg); + /** * Indicates that framework/application must reset the uplink mute state. * diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl index d126fc1905..cf1b953fc6 100644 --- a/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl +++ b/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl @@ -57,6 +57,27 @@ oneway interface IRadioVoiceResponse { */ void acknowledgeRequest(in int serial); + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:SIM_BUSY + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:NO_MEMORY + * RadioError:INVALID_STATE + * RadioError:INVALID_ARGUMENTS + * RadioError:SYSTEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + void cancelPendingUssdResponse(in RadioResponseInfo info); + /** * @param info Response info struct containing response type, serial no. and error * @@ -563,6 +584,32 @@ oneway interface IRadioVoiceResponse { */ void sendDtmfResponse(in RadioResponseInfo info); + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:FDN_CHECK_FAILURE + * RadioError:USSD_MODIFIED_TO_DIAL + * RadioError:USSD_MODIFIED_TO_SS + * RadioError:USSD_MODIFIED_TO_USSD + * RadioError:SIM_BUSY + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:INVALID_ARGUMENTS + * RadioError:NO_MEMORY + * RadioError:MODEM_ERR + * RadioError:INTERNAL_ERR + * RadioError:ABORTED + * RadioError:SYSTEM_ERR + * RadioError:INVALID_STATE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_MODEM_STATE + * RadioError:NO_RESOURCES + * RadioError:CANCELLED + */ + void sendUssdResponse(in RadioResponseInfo info); + /** * @param info Response info struct containing response type, serial no. and error * diff --git a/radio/aidl/android/hardware/radio/messaging/UssdModeType.aidl b/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl similarity index 96% rename from radio/aidl/android/hardware/radio/messaging/UssdModeType.aidl rename to radio/aidl/android/hardware/radio/voice/UssdModeType.aidl index c3c111ea77..48d1fca37d 100644 --- a/radio/aidl/android/hardware/radio/messaging/UssdModeType.aidl +++ b/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware.radio.messaging; +package android.hardware.radio.voice; @VintfStability @Backing(type="int") diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h index 419e9fb3a4..047f836163 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h @@ -33,7 +33,6 @@ class RadioMessaging : public RadioCompatBase, ::ndk::ScopedAStatus acknowledgeLastIncomingGsmSms( int32_t serial, bool success, ::aidl::android::hardware::radio::messaging::SmsAcknowledgeFailCause cause) override; - ::ndk::ScopedAStatus cancelPendingUssd(int32_t serial) override; ::ndk::ScopedAStatus deleteSmsOnRuim(int32_t serial, int32_t index) override; ::ndk::ScopedAStatus deleteSmsOnSim(int32_t serial, int32_t index) override; ::ndk::ScopedAStatus getCdmaBroadcastConfig(int32_t serial) override; @@ -56,7 +55,6 @@ class RadioMessaging : public RadioCompatBase, ::ndk::ScopedAStatus sendSmsExpectMore( int32_t serial, const ::aidl::android::hardware::radio::messaging::GsmSmsMessage& message) override; - ::ndk::ScopedAStatus sendUssd(int32_t serial, const std::string& ussd) override; ::ndk::ScopedAStatus setCdmaBroadcastActivation(int32_t serial, bool activate) override; ::ndk::ScopedAStatus setCdmaBroadcastConfig( int32_t serial, diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h index a0e1e82f5f..0f1d5fda61 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h @@ -26,6 +26,7 @@ class RadioVoice : public RadioCompatBase, std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> respond(); ::ndk::ScopedAStatus acceptCall(int32_t serial) override; + ::ndk::ScopedAStatus cancelPendingUssd(int32_t serial) override; ::ndk::ScopedAStatus conference(int32_t serial) override; ::ndk::ScopedAStatus dial( int32_t serial, const ::aidl::android::hardware::radio::voice::Dial& dialInfo) override; @@ -58,6 +59,7 @@ class RadioVoice : public RadioCompatBase, int32_t off) override; ::ndk::ScopedAStatus sendCdmaFeatureCode(int32_t serial, const std::string& fcode) override; ::ndk::ScopedAStatus sendDtmf(int32_t serial, const std::string& s) override; + ::ndk::ScopedAStatus sendUssd(int32_t serial, const std::string& ussd) override; ::ndk::ScopedAStatus separateConnection(int32_t serial, int32_t gsmIndex) override; ::ndk::ScopedAStatus setCallForward( int32_t serial, diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp index e5c33b300f..eb87828dde 100644 --- a/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp +++ b/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp @@ -73,13 +73,6 @@ Return RadioIndication::newSmsStatusReport(V1_0::RadioIndicationType type, return {}; } -Return RadioIndication::onUssd(V1_0::RadioIndicationType type, V1_0::UssdModeType modeType, - const hidl_string& msg) { - LOG_CALL << type; - messagingCb()->onUssd(toAidl(type), aidl::UssdModeType(modeType), msg); - return {}; -} - Return RadioIndication::simSmsStorageFull(V1_0::RadioIndicationType type) { LOG_CALL << type; messagingCb()->simSmsStorageFull(toAidl(type)); diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp index 4d94e17e99..56d49f1bb9 100644 --- a/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp +++ b/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp @@ -54,12 +54,6 @@ ScopedAStatus RadioMessaging::acknowledgeLastIncomingGsmSms( // return ok(); } -ScopedAStatus RadioMessaging::cancelPendingUssd(int32_t serial) { - LOG_CALL << serial; - mHal1_5->cancelPendingUssd(serial); - return ok(); -} - ScopedAStatus RadioMessaging::deleteSmsOnRuim(int32_t serial, int32_t index) { LOG_CALL << serial << ' ' << index; mHal1_5->deleteSmsOnRuim(serial, index); @@ -148,12 +142,6 @@ ScopedAStatus RadioMessaging::sendSmsExpectMore(int32_t serial, const aidl::GsmS return ok(); } -ScopedAStatus RadioMessaging::sendUssd(int32_t serial, const std::string& ussd) { - LOG_CALL << serial << ' ' << ussd; - mHal1_5->sendUssd(serial, ussd); - return ok(); -} - ScopedAStatus RadioMessaging::setCdmaBroadcastActivation(int32_t serial, bool activate) { LOG_CALL << serial << ' ' << activate; mHal1_5->setCdmaBroadcastActivation(serial, activate); diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp index 24ad3d7c9b..7a9273fbb4 100644 --- a/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp +++ b/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp @@ -57,12 +57,6 @@ Return RadioResponse::acknowledgeLastIncomingGsmSmsResponse( return {}; } -Return RadioResponse::cancelPendingUssdResponse(const V1_0::RadioResponseInfo& info) { - LOG_CALL << info.serial; - messagingCb()->cancelPendingUssdResponse(toAidl(info)); - return {}; -} - Return RadioResponse::deleteSmsOnRuimResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; messagingCb()->deleteSmsOnRuimResponse(toAidl(info)); @@ -166,12 +160,6 @@ Return RadioResponse::sendSmsResponse_1_6(const V1_6::RadioResponseInfo& i return {}; } -Return RadioResponse::sendUssdResponse(const V1_0::RadioResponseInfo& info) { - LOG_CALL << info.serial; - messagingCb()->sendUssdResponse(toAidl(info)); - return {}; -} - Return RadioResponse::setCdmaBroadcastActivationResponse( const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; diff --git a/radio/aidl/compat/libradiocompat/network/structs.cpp b/radio/aidl/compat/libradiocompat/network/structs.cpp index 87a021f03d..c1d9b35dd6 100644 --- a/radio/aidl/compat/libradiocompat/network/structs.cpp +++ b/radio/aidl/compat/libradiocompat/network/structs.cpp @@ -650,13 +650,6 @@ aidl::RegStateResult toAidl(const V1_6::RegStateResult& res) { }; } -aidl::NeighboringCell toAidl(const V1_0::NeighboringCell& cell) { - return { - .cid = cell.cid, - .rssi = cell.rssi, - }; -} - aidl::LceDataInfo toAidl(const V1_0::LceDataInfo& info) { return { .lastHopCapacityKbps = static_cast(info.lastHopCapacityKbps), diff --git a/radio/aidl/compat/libradiocompat/network/structs.h b/radio/aidl/compat/libradiocompat/network/structs.h index 854cb38058..aaa49a07e6 100644 --- a/radio/aidl/compat/libradiocompat/network/structs.h +++ b/radio/aidl/compat/libradiocompat/network/structs.h @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -92,8 +91,6 @@ toAidl(const V1_0::SuppSvcNotification& svc); ::aidl::android::hardware::radio::network::RegStateResult toAidl(const V1_5::RegStateResult& res); ::aidl::android::hardware::radio::network::RegStateResult toAidl(const V1_6::RegStateResult& res); -::aidl::android::hardware::radio::network::NeighboringCell toAidl(const V1_0::NeighboringCell& c); - ::aidl::android::hardware::radio::network::LceDataInfo toAidl(const V1_0::LceDataInfo& info); } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp index 359fce0321..23878ed849 100644 --- a/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp +++ b/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp @@ -102,6 +102,13 @@ Return RadioIndication::onSupplementaryServiceIndication(V1_0::RadioIndica return {}; } +Return RadioIndication::onUssd(V1_0::RadioIndicationType type, V1_0::UssdModeType modeType, + const hidl_string& msg) { + LOG_CALL << type; + voiceCb()->onUssd(toAidl(type), aidl::UssdModeType(modeType), msg); + return {}; +} + Return RadioIndication::resendIncallMute(V1_0::RadioIndicationType type) { LOG_CALL << type; voiceCb()->resendIncallMute(toAidl(type)); diff --git a/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp index d233548233..5307e11183 100644 --- a/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp +++ b/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp @@ -42,6 +42,12 @@ Return RadioResponse::acceptCallResponse(const V1_0::RadioResponseInfo& in return {}; } +Return RadioResponse::cancelPendingUssdResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + voiceCb()->cancelPendingUssdResponse(toAidl(info)); + return {}; +} + Return RadioResponse::conferenceResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; voiceCb()->conferenceResponse(toAidl(info)); @@ -198,6 +204,12 @@ Return RadioResponse::sendDtmfResponse(const V1_0::RadioResponseInfo& info return {}; } +Return RadioResponse::sendUssdResponse(const V1_0::RadioResponseInfo& info) { + LOG_CALL << info.serial; + voiceCb()->sendUssdResponse(toAidl(info)); + return {}; +} + Return RadioResponse::separateConnectionResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; voiceCb()->separateConnectionResponse(toAidl(info)); diff --git a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp index 71d1a568a4..9088f01f3d 100644 --- a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp +++ b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp @@ -40,6 +40,12 @@ ScopedAStatus RadioVoice::acceptCall(int32_t serial) { return ok(); } +ScopedAStatus RadioVoice::cancelPendingUssd(int32_t serial) { + LOG_CALL << serial; + mHal1_5->cancelPendingUssd(serial); + return ok(); +} + ScopedAStatus RadioVoice::conference(int32_t serial) { LOG_CALL << serial; mHal1_5->conference(serial); @@ -201,6 +207,12 @@ ScopedAStatus RadioVoice::sendDtmf(int32_t serial, const std::string& s) { return ok(); } +ScopedAStatus RadioVoice::sendUssd(int32_t serial, const std::string& ussd) { + LOG_CALL << serial << ' ' << ussd; + mHal1_5->sendUssd(serial, ussd); + return ok(); +} + ScopedAStatus RadioVoice::separateConnection(int32_t serial, int32_t gsmIndex) { LOG_CALL << serial; mHal1_5->separateConnection(serial, gsmIndex); diff --git a/radio/aidl/vts/radio_data_test.cpp b/radio/aidl/vts/radio_data_test.cpp index 616e3391a3..f38a958896 100644 --- a/radio/aidl/vts/radio_data_test.cpp +++ b/radio/aidl/vts/radio_data_test.cpp @@ -83,7 +83,7 @@ TEST_P(RadioDataTest, setupDataCall) { dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP; dataProfileInfo.user = std::string("username"); dataProfileInfo.password = std::string("password"); - dataProfileInfo.type = DataProfileInfo::TYPE_THREE_GPP; + dataProfileInfo.type = DataProfileInfo::TYPE_3GPP; dataProfileInfo.maxConnsTime = 300; dataProfileInfo.maxConns = 20; dataProfileInfo.waitTime = 0; @@ -157,7 +157,7 @@ TEST_P(RadioDataTest, setupDataCall_osAppId) { dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP; dataProfileInfo.user = std::string("username"); dataProfileInfo.password = std::string("password"); - dataProfileInfo.type = DataProfileInfo::TYPE_THREE_GPP; + dataProfileInfo.type = DataProfileInfo::TYPE_3GPP; dataProfileInfo.maxConnsTime = 300; dataProfileInfo.maxConns = 20; dataProfileInfo.waitTime = 0; @@ -326,7 +326,7 @@ TEST_P(RadioDataTest, setInitialAttachApn) { dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP; dataProfileInfo.user = std::string("username"); dataProfileInfo.password = std::string("password"); - dataProfileInfo.type = DataProfileInfo::TYPE_THREE_GPP; + dataProfileInfo.type = DataProfileInfo::TYPE_3GPP; dataProfileInfo.maxConnsTime = 300; dataProfileInfo.maxConns = 20; dataProfileInfo.waitTime = 0; @@ -369,7 +369,7 @@ TEST_P(RadioDataTest, setDataProfile) { dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP; dataProfileInfo.user = std::string("username"); dataProfileInfo.password = std::string("password"); - dataProfileInfo.type = DataProfileInfo::TYPE_THREE_GPP; + dataProfileInfo.type = DataProfileInfo::TYPE_3GPP; dataProfileInfo.maxConnsTime = 300; dataProfileInfo.maxConns = 20; dataProfileInfo.waitTime = 0; diff --git a/radio/aidl/vts/radio_messaging_indication.cpp b/radio/aidl/vts/radio_messaging_indication.cpp index c69611f74d..481239e647 100644 --- a/radio/aidl/vts/radio_messaging_indication.cpp +++ b/radio/aidl/vts/radio_messaging_indication.cpp @@ -48,12 +48,6 @@ ndk::ScopedAStatus RadioMessagingIndication::newSmsStatusReport( return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioMessagingIndication::onUssd(RadioIndicationType /*type*/, - UssdModeType /*modeType*/, - const std::string& /*msg*/) { - return ndk::ScopedAStatus::ok(); -} - ndk::ScopedAStatus RadioMessagingIndication::simSmsStorageFull(RadioIndicationType /*type*/) { return ndk::ScopedAStatus::ok(); } diff --git a/radio/aidl/vts/radio_messaging_response.cpp b/radio/aidl/vts/radio_messaging_response.cpp index 451a10c8cf..49c08061ac 100644 --- a/radio/aidl/vts/radio_messaging_response.cpp +++ b/radio/aidl/vts/radio_messaging_response.cpp @@ -44,13 +44,6 @@ ndk::ScopedAStatus RadioMessagingResponse::acknowledgeRequest(int32_t /*serial*/ return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioMessagingResponse::cancelPendingUssdResponse( - const RadioResponseInfo& info) { - rspInfo = info; - parent_messaging.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnRuimResponse(const RadioResponseInfo& info) { rspInfo = info; parent_messaging.notify(info.serial); @@ -130,12 +123,6 @@ ndk::ScopedAStatus RadioMessagingResponse::sendSmsResponse(const RadioResponseIn return ndk::ScopedAStatus::ok(); } -ndk::ScopedAStatus RadioMessagingResponse::sendUssdResponse(const RadioResponseInfo& info) { - rspInfo = info; - parent_messaging.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastActivationResponse( const RadioResponseInfo& info) { rspInfo = info; diff --git a/radio/aidl/vts/radio_messaging_test.cpp b/radio/aidl/vts/radio_messaging_test.cpp index 0abdfbc435..9f1718b1a0 100644 --- a/radio/aidl/vts/radio_messaging_test.cpp +++ b/radio/aidl/vts/radio_messaging_test.cpp @@ -418,7 +418,9 @@ TEST_P(RadioMessagingTest, acknowledgeIncomingGsmSmsWithPdu) { EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); if (cardStatus.cardState == CardStatus::STATE_ABSENT) { - // TODO(shuoq): Will add error check when we know the expected error from QC + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::NO_SMS_TO_ACK}, + CHECK_GENERAL_ERROR)); } LOG(DEBUG) << "acknowledgeIncomingGsmSmsWithPdu finished"; } @@ -727,44 +729,3 @@ TEST_P(RadioMessagingTest, reportSmsMemoryStatus) { } LOG(DEBUG) << "reportSmsMemoryStatus finished"; } - -/* - * Test IRadioMessaging.sendUssd() for the response returned. - */ -TEST_P(RadioMessagingTest, sendUssd) { - LOG(DEBUG) << "sendUssd"; - serial = GetRandomSerialNumber(); - radio_messaging->sendUssd(serial, std::string("test")); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); - EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); - - if (cardStatus.cardState == CardStatus::STATE_ABSENT) { - ASSERT_TRUE(CheckAnyOfErrors( - radioRsp_messaging->rspInfo.error, - {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, - CHECK_GENERAL_ERROR)); - } - LOG(DEBUG) << "sendUssd finished"; -} - -/* - * Test IRadioMessaging.cancelPendingUssd() for the response returned. - */ -TEST_P(RadioMessagingTest, cancelPendingUssd) { - LOG(DEBUG) << "cancelPendingUssd"; - serial = GetRandomSerialNumber(); - - radio_messaging->cancelPendingUssd(serial); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type); - EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial); - - if (cardStatus.cardState == CardStatus::STATE_ABSENT) { - ASSERT_TRUE(CheckAnyOfErrors( - radioRsp_messaging->rspInfo.error, - {RadioError::NONE, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, - CHECK_GENERAL_ERROR)); - } - LOG(DEBUG) << "cancelPendingUssd finished"; -} diff --git a/radio/aidl/vts/radio_messaging_utils.h b/radio/aidl/vts/radio_messaging_utils.h index 7bb99cdcab..7b66192679 100644 --- a/radio/aidl/vts/radio_messaging_utils.h +++ b/radio/aidl/vts/radio_messaging_utils.h @@ -49,8 +49,6 @@ class RadioMessagingResponse : public BnRadioMessagingResponse { virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; - virtual ndk::ScopedAStatus cancelPendingUssdResponse(const RadioResponseInfo& info) override; - virtual ndk::ScopedAStatus deleteSmsOnRuimResponse(const RadioResponseInfo& info) override; virtual ndk::ScopedAStatus deleteSmsOnSimResponse(const RadioResponseInfo& info) override; @@ -84,8 +82,6 @@ class RadioMessagingResponse : public BnRadioMessagingResponse { virtual ndk::ScopedAStatus sendSmsResponse(const RadioResponseInfo& info, const SendSmsResult& sms) override; - virtual ndk::ScopedAStatus sendUssdResponse(const RadioResponseInfo& info) override; - virtual ndk::ScopedAStatus setCdmaBroadcastActivationResponse( const RadioResponseInfo& info) override; @@ -132,9 +128,6 @@ class RadioMessagingIndication : public BnRadioMessagingIndication { virtual ndk::ScopedAStatus newSmsStatusReport(RadioIndicationType type, const std::vector& pdu) override; - virtual ndk::ScopedAStatus onUssd(RadioIndicationType type, UssdModeType modeType, - const std::string& msg) override; - virtual ndk::ScopedAStatus simSmsStorageFull(RadioIndicationType type) override; }; diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp index 1c2d50fd9b..391d63c2b6 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -1529,6 +1529,7 @@ TEST_P(RadioNetworkTest, getOperator) { } LOG(DEBUG) << "getOperator finished"; } + /* * Test IRadioNetwork.getNetworkSelectionMode() for the response returned. */ @@ -1610,29 +1611,6 @@ TEST_P(RadioNetworkTest, setBandMode) { LOG(DEBUG) << "setBandMode finished"; } -/* - * Test IRadioNetwork.getNeighboringCids() for the response returned. - */ -TEST_P(RadioNetworkTest, getNeighboringCids) { - // TODO: add API for getNeighboringCids - /** - LOG(DEBUG) << "getNeighboringCids"; - serial = GetRandomSerialNumber(); - - radio_network->getNeighboringCids(serial); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); - EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); - - if (cardStatus.cardState == CardStatus::STATE_ABSENT) { - ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, - {RadioError::NONE, RadioError::SIM_ABSENT}, - CHECK_GENERAL_ERROR)); - } - LOG(DEBUG) << "getNeighboringCids finished"; - **/ -} - /* * Test IRadioNetwork.setLocationUpdates() for the response returned. */ @@ -1718,7 +1696,6 @@ TEST_P(RadioNetworkTest, setCellInfoListRate) { LOG(DEBUG) << "setCellInfoListRate"; serial = GetRandomSerialNumber(); - // TODO(sanketpadawe): RIL crashes with value of rate = 10 radio_network->setCellInfoListRate(serial, 10); EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp index 146e86c785..64474c95a8 100644 --- a/radio/aidl/vts/radio_sim_test.cpp +++ b/radio/aidl/vts/radio_sim_test.cpp @@ -387,7 +387,6 @@ TEST_P(RadioSimTest, setAllowedCarriers) { carrierRestrictions.allowedCarriers[0].mnc = std::string("456"); carrierRestrictions.allowedCarriers[0].matchType = Carrier::MATCH_TYPE_ALL; carrierRestrictions.allowedCarriers[0].matchData = std::string(); - carrierRestrictions.priority = true; carrierRestrictions.allowedCarriersPrioritized = true; SimLockMultiSimPolicy multisimPolicy = SimLockMultiSimPolicy::NO_MULTISIM_POLICY; @@ -650,12 +649,10 @@ TEST_P(RadioSimTest, changeIccPin2ForApp) { } /* - * The following test is disabled due to b/109889468 - * * Test IRadioSim.getImsiForApp() for the response returned. */ -TEST_P(RadioSimTest, DISABLED_getImsiForApp) { - LOG(DEBUG) << "DISABLED_getImsiForApp"; +TEST_P(RadioSimTest, getImsiForApp) { + LOG(DEBUG) << "getImsiForApp"; serial = GetRandomSerialNumber(); // Check success returned while getting imsi for 3GPP and 3GPP2 apps only @@ -679,7 +676,7 @@ TEST_P(RadioSimTest, DISABLED_getImsiForApp) { } } } - LOG(DEBUG) << "DISABLED_getImsiForApp finished"; + LOG(DEBUG) << "getImsiForApp finished"; } /* @@ -723,8 +720,6 @@ TEST_P(RadioSimTest, iccTransmitApduBasicChannel) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); - - // TODO(sanketpadawe): Add test for error code LOG(DEBUG) << "iccTransmitApduBasicChannel finished"; } @@ -775,8 +770,6 @@ TEST_P(RadioSimTest, iccTransmitApduLogicalChannel) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); - - // TODO(sanketpadawe): Add test for error code LOG(DEBUG) << "iccTransmitApduLogicalChannel finished"; } diff --git a/radio/aidl/vts/radio_voice_indication.cpp b/radio/aidl/vts/radio_voice_indication.cpp index d814c1857e..3fee32681d 100644 --- a/radio/aidl/vts/radio_voice_indication.cpp +++ b/radio/aidl/vts/radio_voice_indication.cpp @@ -65,6 +65,12 @@ ndk::ScopedAStatus RadioVoiceIndication::onSupplementaryServiceIndication( return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus RadioVoiceIndication::onUssd(RadioIndicationType /*type*/, + UssdModeType /*modeType*/, + const std::string& /*msg*/) { + return ndk::ScopedAStatus::ok(); +} + ndk::ScopedAStatus RadioVoiceIndication::resendIncallMute(RadioIndicationType /*type*/) { return ndk::ScopedAStatus::ok(); } diff --git a/radio/aidl/vts/radio_voice_response.cpp b/radio/aidl/vts/radio_voice_response.cpp index 95b2d4e72e..dd7b1bf261 100644 --- a/radio/aidl/vts/radio_voice_response.cpp +++ b/radio/aidl/vts/radio_voice_response.cpp @@ -28,6 +28,12 @@ ndk::ScopedAStatus RadioVoiceResponse::acknowledgeRequest(int32_t /*serial*/) { return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus RadioVoiceResponse::cancelPendingUssdResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + ndk::ScopedAStatus RadioVoiceResponse::conferenceResponse(const RadioResponseInfo& info) { rspInfo = info; parent_voice.notify(info.serial); @@ -182,6 +188,12 @@ ndk::ScopedAStatus RadioVoiceResponse::sendDtmfResponse(const RadioResponseInfo& return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus RadioVoiceResponse::sendUssdResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_voice.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + ndk::ScopedAStatus RadioVoiceResponse::separateConnectionResponse(const RadioResponseInfo& info) { rspInfo = info; parent_voice.notify(info.serial); diff --git a/radio/aidl/vts/radio_voice_test.cpp b/radio/aidl/vts/radio_voice_test.cpp index 0556938620..eec28b16af 100644 --- a/radio/aidl/vts/radio_voice_test.cpp +++ b/radio/aidl/vts/radio_voice_test.cpp @@ -324,7 +324,7 @@ TEST_P(RadioVoiceTest, getClip) { * Test IRadioVoice.getTtyMode() for the response returned. */ TEST_P(RadioVoiceTest, getTtyMode) { - LOG(DEBUG) << "getTTYMode"; + LOG(DEBUG) << "getTtyMode"; serial = GetRandomSerialNumber(); radio_voice->getTtyMode(serial); @@ -335,7 +335,7 @@ TEST_P(RadioVoiceTest, getTtyMode) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error); } - LOG(DEBUG) << "getTTYMode finished"; + LOG(DEBUG) << "getTtyMode finished"; } /* @@ -902,3 +902,44 @@ TEST_P(RadioVoiceTest, sendBurstDtmf) { } LOG(DEBUG) << "sendBurstDtmf finished"; } + +/* + * Test IRadioVoice.sendUssd() for the response returned. + */ +TEST_P(RadioVoiceTest, sendUssd) { + LOG(DEBUG) << "sendUssd"; + serial = GetRandomSerialNumber(); + radio_voice->sendUssd(serial, std::string("test")); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_voice->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "sendUssd finished"; +} + +/* + * Test IRadioVoice.cancelPendingUssd() for the response returned. + */ +TEST_P(RadioVoiceTest, cancelPendingUssd) { + LOG(DEBUG) << "cancelPendingUssd"; + serial = GetRandomSerialNumber(); + + radio_voice->cancelPendingUssd(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type); + EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial); + + if (cardStatus.cardState == CardStatus::STATE_ABSENT) { + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_voice->rspInfo.error, + {RadioError::NONE, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, + CHECK_GENERAL_ERROR)); + } + LOG(DEBUG) << "cancelPendingUssd finished"; +} diff --git a/radio/aidl/vts/radio_voice_utils.h b/radio/aidl/vts/radio_voice_utils.h index d61bf1eee8..0c3df7fbbf 100644 --- a/radio/aidl/vts/radio_voice_utils.h +++ b/radio/aidl/vts/radio_voice_utils.h @@ -43,6 +43,8 @@ class RadioVoiceResponse : public BnRadioVoiceResponse { virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; + virtual ndk::ScopedAStatus cancelPendingUssdResponse(const RadioResponseInfo& info) override; + virtual ndk::ScopedAStatus conferenceResponse(const RadioResponseInfo& info) override; virtual ndk::ScopedAStatus dialResponse(const RadioResponseInfo& info) override; @@ -103,6 +105,8 @@ class RadioVoiceResponse : public BnRadioVoiceResponse { virtual ndk::ScopedAStatus sendDtmfResponse(const RadioResponseInfo& info) override; + virtual ndk::ScopedAStatus sendUssdResponse(const RadioResponseInfo& info) override; + virtual ndk::ScopedAStatus separateConnectionResponse(const RadioResponseInfo& info) override; virtual ndk::ScopedAStatus setCallForwardResponse(const RadioResponseInfo& info) override; @@ -164,6 +168,9 @@ class RadioVoiceIndication : public BnRadioVoiceIndication { virtual ndk::ScopedAStatus onSupplementaryServiceIndication( RadioIndicationType type, const StkCcUnsolSsResult& ss) override; + virtual ndk::ScopedAStatus onUssd(RadioIndicationType type, UssdModeType modeType, + const std::string& msg) override; + virtual ndk::ScopedAStatus resendIncallMute(RadioIndicationType type) override; virtual ndk::ScopedAStatus srvccStateNotify(RadioIndicationType type, -- GitLab From b6800fc7154c51f462a80d7d202e6646e50ef666 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Sat, 29 Jan 2022 00:39:13 +0000 Subject: [PATCH 541/825] audio: Add recommended mute duration attribute to APM XSD Add 'recommendedMuteDurationMs' optional attribute to 'mixPort' element. This attribute specifies customized mute duration while switching device's audio path to avoid truncated sound at the beginning. The framework is already aware of this attribute, only need to allow it in the XSD. Bug: 183344508 Bug: 197823000 Test: m CTS-Coverage-bug: 215647214 Change-Id: I3be36009d1b5db218c846efe96f078e858283992 --- audio/7.1/config/api/current.txt | 2 ++ audio/7.1/config/audio_policy_configuration.xsd | 1 + 2 files changed, 3 insertions(+) diff --git a/audio/7.1/config/api/current.txt b/audio/7.1/config/api/current.txt index 01c2e4bbd5..a4e4b86ab6 100644 --- a/audio/7.1/config/api/current.txt +++ b/audio/7.1/config/api/current.txt @@ -458,6 +458,7 @@ package android.audio.policy.configuration.V7_1 { method @Nullable public String getName(); method @Nullable public java.util.List getPreferredUsage(); method @Nullable public java.util.List getProfile(); + method @Nullable public long getRecommendedMuteDurationMs(); method @Nullable public android.audio.policy.configuration.V7_1.Role getRole(); method public void setFlags(@Nullable java.util.List); method public void setGains(@Nullable android.audio.policy.configuration.V7_1.Gains); @@ -465,6 +466,7 @@ package android.audio.policy.configuration.V7_1 { method public void setMaxOpenCount(@Nullable long); method public void setName(@Nullable String); method public void setPreferredUsage(@Nullable java.util.List); + method public void setRecommendedMuteDurationMs(@Nullable long); method public void setRole(@Nullable android.audio.policy.configuration.V7_1.Role); } diff --git a/audio/7.1/config/audio_policy_configuration.xsd b/audio/7.1/config/audio_policy_configuration.xsd index 731bb7c75f..5ac49f0837 100644 --- a/audio/7.1/config/audio_policy_configuration.xsd +++ b/audio/7.1/config/audio_policy_configuration.xsd @@ -225,6 +225,7 @@ + -- GitLab From 22884acd6af5abb0030bd5fc7bd6639c8873fa73 Mon Sep 17 00:00:00 2001 From: Ram Indani Date: Sat, 29 Jan 2022 02:00:21 +0000 Subject: [PATCH 542/825] Revert "IComposerClient wrapper for VTS tests" This reverts commit 634340d6a8e34c3688227b88ba8ccde341076b2b. Reason for revert: No one is using it, I will make a cl with usage of the wrapper along side this and reupload it. Change-Id: I3ff3427fc9e81d53fd47a082ab027441f5dc8a66 --- .../composer3/vts/functional/Android.bp | 9 +- .../vts/functional/composer-vts/Android.bp | 78 +++ .../composer-vts/VtsComposerClient.cpp | 471 ------------------ .../include/GraphicsComposerCallback.h | 7 + .../composer-vts/include/ReadbackVts.h | 10 +- .../composer-vts/include/RenderEngineVts.h | 9 +- .../composer-vts/include/VtsComposerClient.h | 232 --------- .../graphics/composer3/ComposerClientWriter.h | 6 +- 8 files changed, 106 insertions(+), 716 deletions(-) create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp delete mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp delete mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp index 139b5e8512..bd2c3b1248 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp @@ -35,9 +35,6 @@ cc_test { "VtsHalGraphicsComposer3_TargetTest.cpp", "VtsHalGraphicsComposer3_ReadbackTest.cpp", "composer-vts/GraphicsComposerCallback.cpp", - "composer-vts/ReadbackVts.cpp", - "composer-vts/RenderEngineVts.cpp", - "composer-vts/VtsComposerClient.cpp", ], shared_libs: [ @@ -75,19 +72,15 @@ cc_test { "android.hardware.graphics.allocator@2.0", "android.hardware.graphics.allocator@3.0", "android.hardware.graphics.allocator@4.0", + "android.hardware.graphics.composer@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", - "libarect", - "libbase", - "libfmq", "libgtest", - "libmath", "librenderengine", "libshaders", - "libsync", "libtonemap", ], cflags: [ diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp new file mode 100644 index 0000000000..df038db47b --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp @@ -0,0 +1,78 @@ +/** + * 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. + */ + +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_library_static { + name: "android.hardware.graphics.composer@3-vts", + defaults: ["hidl_defaults"], + srcs: [ + "GraphicsComposerCallback.cpp", + "ReadbackVts.cpp", + "RenderEngineVts.cpp", + ], + header_libs: [ + "android.hardware.graphics.composer3-command-buffer", + ], + static_libs: [ + "android.hardware.graphics.composer3-V1-ndk", + "android.hardware.graphics.common-V3-ndk", + "android.hardware.common-V2-ndk", + "android.hardware.common.fmq-V1-ndk", + "libarect", + "libgtest", + "libbase", + "libfmq", + "libsync", + "libmath", + "libaidlcommonsupport", + "libnativewindow", + "librenderengine", + "libshaders", + "libtonemap", + "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", + ], + shared_libs: [ + "libbinder_ndk", + "libhidlbase", + "libui", + "android.hardware.graphics.composer3-V1-ndk", + ], + export_static_lib_headers: [ + "android.hardware.graphics.mapper@2.1-vts", + "librenderengine", + ], + cflags: [ + "-O0", + "-g", + "-DLOG_TAG=\"ComposerVts\"", + "-Wconversion", + ], + export_header_lib_headers: [ + "android.hardware.graphics.composer3-command-buffer", + ], + export_include_dirs: ["include"], +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp deleted file mode 100644 index 9eb2ef55ff..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp +++ /dev/null @@ -1,471 +0,0 @@ -/** - * Copyright (c) 2022, The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "include/VtsComposerClient.h" -#include -#include -#include - -#undef LOG_TAG -#define LOG_TAG "VtsComposerClient" - -using namespace std::chrono_literals; - -namespace aidl::android::hardware::graphics::composer3::vts { - -VtsComposerClient::VtsComposerClient(const std::string& name) { - SpAIBinder binder(AServiceManager_waitForService(name.c_str())); - ALOGE_IF(binder == nullptr, "Could not initialize the service binder"); - if (binder != nullptr) { - mComposer = IComposer::fromBinder(binder); - ALOGE_IF(mComposer == nullptr, "Failed to acquire the composer from the binder"); - } -} - -bool VtsComposerClient::createClient() { - if (mComposer == nullptr) { - ALOGE("IComposer not initialized"); - return false; - } - auto error = mComposer->createClient(&mComposerClient); - if (!error.isOk() || mComposerClient == nullptr) { - ALOGE("Failed to create client for IComposerClient with %s", - error.getDescription().c_str()); - return false; - } - mComposerCallback = SharedRefBase::make(); - if (mComposerCallback == nullptr) { - ALOGE("Unable to create ComposerCallback"); - return false; - } - error = mComposerClient->registerCallback(mComposerCallback); - if (!error.isOk()) { - ALOGE("Unable to register the callback with IComposerClient, failed with %s", - error.getDescription().c_str()); - return false; - } - return true; -} - -bool VtsComposerClient::tearDown() { - return verifyComposerCallbackParams() && destroyAllLayers(); -} - -std::pair VtsComposerClient::createVirtualDisplay( - int32_t width, int32_t height, PixelFormat pixelFormat, int32_t bufferSlotCount) { - VirtualDisplay outVirtualDisplay; - auto error = mComposerClient->createVirtualDisplay(width, height, pixelFormat, bufferSlotCount, - &outVirtualDisplay); - if (!error.isOk()) { - return {std::move(error), outVirtualDisplay}; - } - return {addDisplayToDisplayResources(outVirtualDisplay.display, /*isVirtual*/ true), - outVirtualDisplay}; -} - -ScopedAStatus VtsComposerClient::destroyVirtualDisplay(int64_t display) { - auto error = mComposerClient->destroyVirtualDisplay(display); - if (!error.isOk()) { - return error; - } - mDisplayResources.erase(display); - return error; -} - -std::pair VtsComposerClient::createLayer(int64_t display, - int32_t bufferSlotCount) { - int64_t outLayer; - auto error = mComposerClient->createLayer(display, bufferSlotCount, &outLayer); - - if (!error.isOk()) { - return {std::move(error), outLayer}; - } - return {addLayerToDisplayResources(display, outLayer), outLayer}; -} - -ScopedAStatus VtsComposerClient::destroyLayer(int64_t display, int64_t layer) { - auto error = mComposerClient->destroyLayer(display, layer); - - if (!error.isOk()) { - return error; - } - removeLayerFromDisplayResources(display, layer); - return error; -} - -std::pair VtsComposerClient::getActiveConfig(int64_t display) { - int32_t outConfig; - return {mComposerClient->getActiveConfig(display, &outConfig), outConfig}; -} - -ScopedAStatus VtsComposerClient::setActiveConfig(VtsDisplay& vtsDisplay, int32_t config) { - auto error = mComposerClient->setActiveConfig(vtsDisplay.get(), config); - if (!error.isOk()) { - return error; - } - return updateDisplayProperties(vtsDisplay, config); -} - -std::pair VtsComposerClient::getDisplayAttribute( - int64_t display, int32_t config, DisplayAttribute displayAttribute) { - int32_t outDisplayAttribute; - return {mComposerClient->getDisplayAttribute(display, config, displayAttribute, - &outDisplayAttribute), - outDisplayAttribute}; -} - -ScopedAStatus VtsComposerClient::setPowerMode(int64_t display, PowerMode powerMode) { - return mComposerClient->setPowerMode(display, powerMode); -} - -ScopedAStatus VtsComposerClient::setVsync(int64_t display, bool enable) { - return mComposerClient->setVsyncEnabled(display, enable); -} - -void VtsComposerClient::setVsyncAllowed(bool isAllowed) { - mComposerCallback->setVsyncAllowed(isAllowed); -} - -std::pair> VtsComposerClient::getDataspaceSaturationMatrix( - Dataspace dataspace) { - std::vector outMatrix; - return {mComposerClient->getDataspaceSaturationMatrix(dataspace, &outMatrix), outMatrix}; -} - -std::pair> VtsComposerClient::executeCommands( - const std::vector& commands) { - std::vector outResultPayload; - return {mComposerClient->executeCommands(commands, &outResultPayload), - std::move(outResultPayload)}; -} - -std::optional VtsComposerClient::takeLastVsyncPeriodChangeTimeline() { - return mComposerCallback->takeLastVsyncPeriodChangeTimeline(); -} - -ScopedAStatus VtsComposerClient::setContentType(int64_t display, ContentType contentType) { - return mComposerClient->setContentType(display, contentType); -} - -std::pair -VtsComposerClient::setActiveConfigWithConstraints(VtsDisplay& vtsDisplay, int32_t config, - const VsyncPeriodChangeConstraints& constraints) { - VsyncPeriodChangeTimeline outTimeline; - auto error = mComposerClient->setActiveConfigWithConstraints(vtsDisplay.get(), config, - constraints, &outTimeline); - if (!error.isOk()) { - return {std::move(error), outTimeline}; - } - return {updateDisplayProperties(vtsDisplay, config), outTimeline}; -} - -std::pair> VtsComposerClient::getDisplayCapabilities( - int64_t display) { - std::vector outCapabilities; - return {mComposerClient->getDisplayCapabilities(display, &outCapabilities), outCapabilities}; -} - -ScopedAStatus VtsComposerClient::dumpDebugInfo() { - std::string debugInfo; - return mComposer->dumpDebugInfo(&debugInfo); -} - -std::pair VtsComposerClient::getDisplayIdentificationData( - int64_t display) { - DisplayIdentification outDisplayIdentification; - return {mComposerClient->getDisplayIdentificationData(display, &outDisplayIdentification), - outDisplayIdentification}; -} - -std::pair VtsComposerClient::getHdrCapabilities(int64_t display) { - HdrCapabilities outHdrCapabilities; - return {mComposerClient->getHdrCapabilities(display, &outHdrCapabilities), outHdrCapabilities}; -} - -std::pair> -VtsComposerClient::getPerFrameMetadataKeys(int64_t display) { - std::vector outPerFrameMetadataKeys; - return {mComposerClient->getPerFrameMetadataKeys(display, &outPerFrameMetadataKeys), - outPerFrameMetadataKeys}; -} - -std::pair VtsComposerClient::getReadbackBufferAttributes( - int64_t display) { - ReadbackBufferAttributes outReadbackBufferAttributes; - return {mComposerClient->getReadbackBufferAttributes(display, &outReadbackBufferAttributes), - outReadbackBufferAttributes}; -} - -ScopedAStatus VtsComposerClient::setReadbackBuffer(int64_t display, const native_handle* buffer, - const ScopedFileDescriptor& releaseFence) { - return mComposerClient->setReadbackBuffer(display, ::android::dupToAidl(buffer), releaseFence); -} - -std::pair VtsComposerClient::getReadbackBufferFence( - int64_t display) { - ScopedFileDescriptor outReleaseFence; - return {mComposerClient->getReadbackBufferFence(display, &outReleaseFence), - std::move(outReleaseFence)}; -} - -std::pair> VtsComposerClient::getColorModes(int64_t display) { - std::vector outColorModes; - return {mComposerClient->getColorModes(display, &outColorModes), outColorModes}; -} - -std::pair> VtsComposerClient::getRenderIntents( - int64_t display, ColorMode colorMode) { - std::vector outRenderIntents; - return {mComposerClient->getRenderIntents(display, colorMode, &outRenderIntents), - outRenderIntents}; -} - -ScopedAStatus VtsComposerClient::setColorMode(int64_t display, ColorMode colorMode, - RenderIntent renderIntent) { - return mComposerClient->setColorMode(display, colorMode, renderIntent); -} - -std::pair -VtsComposerClient::getDisplayedContentSamplingAttributes(int64_t display) { - DisplayContentSamplingAttributes outAttributes; - return {mComposerClient->getDisplayedContentSamplingAttributes(display, &outAttributes), - outAttributes}; -} - -ScopedAStatus VtsComposerClient::setDisplayedContentSamplingEnabled( - int64_t display, bool isEnabled, FormatColorComponent formatColorComponent, - int64_t maxFrames) { - return mComposerClient->setDisplayedContentSamplingEnabled(display, isEnabled, - formatColorComponent, maxFrames); -} - -std::pair VtsComposerClient::getDisplayedContentSample( - int64_t display, int64_t maxFrames, int64_t timestamp) { - DisplayContentSample outDisplayContentSample; - return {mComposerClient->getDisplayedContentSample(display, maxFrames, timestamp, - &outDisplayContentSample), - outDisplayContentSample}; -} - -std::pair VtsComposerClient::getDisplayConnectionType( - int64_t display) { - DisplayConnectionType outDisplayConnectionType; - return {mComposerClient->getDisplayConnectionType(display, &outDisplayConnectionType), - outDisplayConnectionType}; -} - -std::pair> VtsComposerClient::getDisplayConfigs( - int64_t display) { - std::vector outConfigs; - return {mComposerClient->getDisplayConfigs(display, &outConfigs), outConfigs}; -} - -std::pair VtsComposerClient::getDisplayVsyncPeriod(int64_t display) { - int32_t outVsyncPeriodNanos; - return {mComposerClient->getDisplayVsyncPeriod(display, &outVsyncPeriodNanos), - outVsyncPeriodNanos}; -} - -ScopedAStatus VtsComposerClient::setAutoLowLatencyMode(int64_t display, bool isEnabled) { - return mComposerClient->setAutoLowLatencyMode(display, isEnabled); -} - -std::pair> VtsComposerClient::getSupportedContentTypes( - int64_t display) { - std::vector outContentTypes; - return {mComposerClient->getSupportedContentTypes(display, &outContentTypes), outContentTypes}; -} - -std::pair VtsComposerClient::getMaxVirtualDisplayCount() { - int32_t outMaxVirtualDisplayCount; - return {mComposerClient->getMaxVirtualDisplayCount(&outMaxVirtualDisplayCount), - outMaxVirtualDisplayCount}; -} - -std::pair VtsComposerClient::getDisplayName(int64_t display) { - std::string outDisplayName; - return {mComposerClient->getDisplayName(display, &outDisplayName), outDisplayName}; -} - -ScopedAStatus VtsComposerClient::setClientTargetSlotCount(int64_t display, - int32_t bufferSlotCount) { - return mComposerClient->setClientTargetSlotCount(display, bufferSlotCount); -} - -std::pair> VtsComposerClient::getCapabilities() { - std::vector outCapabilities; - return {mComposer->getCapabilities(&outCapabilities), outCapabilities}; -} - -ScopedAStatus VtsComposerClient::setBootDisplayConfig(int64_t display, int32_t config) { - return mComposerClient->setBootDisplayConfig(display, config); -} - -ScopedAStatus VtsComposerClient::clearBootDisplayConfig(int64_t display) { - return mComposerClient->clearBootDisplayConfig(display); -} - -std::pair VtsComposerClient::getPreferredBootDisplayConfig( - int64_t display) { - int32_t outConfig; - return {mComposerClient->getPreferredBootDisplayConfig(display, &outConfig), outConfig}; -} - -std::pair VtsComposerClient::getDisplayPhysicalOrientation( - int64_t display) { - common::Transform outDisplayOrientation; - return {mComposerClient->getDisplayPhysicalOrientation(display, &outDisplayOrientation), - outDisplayOrientation}; -} - -std::pair> VtsComposerClient::getDisplays() { - while (true) { - // Sleep for a small period of time to allow all built-in displays - // to post hotplug events - std::this_thread::sleep_for(5ms); - std::vector displays = mComposerCallback->getDisplays(); - if (displays.empty()) { - continue; - } - - std::vector vtsDisplays; - vtsDisplays.reserve(displays.size()); - for (int64_t display : displays) { - auto activeConfig = getActiveConfig(display); - if (!activeConfig.first.isOk()) { - ALOGE("Unable to get the displays for test, failed to get the active config " - "for display %" PRId64, - display); - return {std::move(activeConfig.first), vtsDisplays}; - } - auto vtsDisplay = VtsDisplay{display}; - auto error = updateDisplayProperties(vtsDisplay, activeConfig.second); - if (!error.isOk()) { - ALOGE("Unable to get the displays for test, failed to update the properties " - "for display %" PRId64, - display); - return {std::move(error), vtsDisplays}; - } - vtsDisplays.emplace_back(vtsDisplay); - addDisplayToDisplayResources(display, /*isVirtual*/ false); - } - - return {ScopedAStatus::ok(), vtsDisplays}; - } -} - -ScopedAStatus VtsComposerClient::updateDisplayProperties(VtsDisplay& vtsDisplay, int32_t config) { - const auto width = getDisplayAttribute(vtsDisplay.get(), config, DisplayAttribute::WIDTH); - const auto height = getDisplayAttribute(vtsDisplay.get(), config, DisplayAttribute::HEIGHT); - const auto vsyncPeriod = - getDisplayAttribute(vtsDisplay.get(), config, DisplayAttribute::VSYNC_PERIOD); - const auto configGroup = - getDisplayAttribute(vtsDisplay.get(), config, DisplayAttribute::CONFIG_GROUP); - if (width.first.isOk() && height.first.isOk() && vsyncPeriod.first.isOk() && - configGroup.first.isOk()) { - vtsDisplay.setDimensions(width.second, height.second); - 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() - << ", config: " << configGroup.first.isOk(); - return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_CONFIG); -} - -ScopedAStatus VtsComposerClient::addDisplayToDisplayResources(int64_t display, bool isVirtual) { - if (mDisplayResources.insert({display, DisplayResource(isVirtual)}).second) { - return ScopedAStatus::ok(); - } - - ALOGE("Duplicate display id %" PRId64, display); - return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_DISPLAY); -} - -ScopedAStatus VtsComposerClient::addLayerToDisplayResources(int64_t display, int64_t layer) { - auto resource = mDisplayResources.find(display); - if (resource == mDisplayResources.end()) { - resource = mDisplayResources.insert({display, DisplayResource(false)}).first; - } - - if (!resource->second.layers.insert(layer).second) { - ALOGE("Duplicate layer id %" PRId64, layer); - return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_LAYER); - } - return ScopedAStatus::ok(); -} - -void VtsComposerClient::removeLayerFromDisplayResources(int64_t display, int64_t layer) { - auto resource = mDisplayResources.find(display); - if (resource != mDisplayResources.end()) { - resource->second.layers.erase(layer); - } -} - -bool VtsComposerClient::verifyComposerCallbackParams() { - bool isValid = true; - if (mComposerCallback != nullptr) { - if (mComposerCallback->getInvalidHotplugCount() != 0) { - ALOGE("Invalid hotplug count"); - isValid = false; - } - if (mComposerCallback->getInvalidRefreshCount() != 0) { - ALOGE("Invalid refresh count"); - isValid = false; - } - if (mComposerCallback->getInvalidVsyncCount() != 0) { - ALOGE("Invalid vsync count"); - isValid = false; - } - if (mComposerCallback->getInvalidVsyncPeriodChangeCount() != 0) { - ALOGE("Invalid vsync period change count"); - isValid = false; - } - if (mComposerCallback->getInvalidSeamlessPossibleCount() != 0) { - ALOGE("Invalid seamless possible count"); - isValid = false; - } - } - return isValid; -} - -bool VtsComposerClient::destroyAllLayers() { - for (const auto& it : mDisplayResources) { - const auto& [display, resource] = it; - - for (auto layer : resource.layers) { - const auto error = destroyLayer(display, layer); - if (!error.isOk()) { - ALOGE("Unable to destroy all the layers, failed at layer %" PRId64 " with error %s", - layer, error.getDescription().c_str()); - return false; - } - } - - if (resource.isVirtual) { - const auto error = destroyVirtualDisplay(display); - if (!error.isOk()) { - ALOGE("Unable to destroy the display %" PRId64 " failed with error %s", display, - error.getDescription().c_str()); - return false; - } - } - } - mDisplayResources.clear(); - return true; -} -} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h index d3b391f67c..c359d5eaa2 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h @@ -15,11 +15,18 @@ */ #pragma once +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include #include +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion + namespace aidl::android::hardware::graphics::composer3::vts { class GraphicsComposerCallback : public BnComposerCallback { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h index c36306bd05..a3ce795db1 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h @@ -16,6 +16,11 @@ #pragma once +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + +#include #include #include #include @@ -23,8 +28,11 @@ #include #include #include + #include -#include "GraphicsComposerCallback.h" + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion namespace aidl::android::hardware::graphics::composer3::vts { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h index 43d3a42808..a776a279c4 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h @@ -15,6 +15,11 @@ */ #pragma once +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + +#include #include #include #include @@ -25,7 +30,9 @@ #include #include #include -#include "ReadbackVts.h" + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion namespace aidl::android::hardware::graphics::composer3::vts { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h deleted file mode 100644 index 26be138c02..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h +++ /dev/null @@ -1,232 +0,0 @@ -/** - * Copyright (c) 2022, The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "GraphicsComposerCallback.h" - -using aidl::android::hardware::graphics::common::Dataspace; -using aidl::android::hardware::graphics::common::FRect; -using aidl::android::hardware::graphics::common::PixelFormat; -using aidl::android::hardware::graphics::common::Rect; -using namespace ::ndk; - -namespace aidl::android::hardware::graphics::composer3::vts { - -class VtsDisplay; -/** - * A wrapper to IComposerClient. - * This wrapper manages the IComposerClient instance and manages the resources for - * the tests with respect to the IComposerClient calls. - */ -class VtsComposerClient { - public: - VtsComposerClient(const std::string& name); - - bool createClient(); - - bool tearDown(); - - std::pair createVirtualDisplay(int32_t width, int32_t height, - PixelFormat pixelFormat, - int32_t bufferSlotCount); - - ScopedAStatus destroyVirtualDisplay(int64_t display); - - std::pair createLayer(int64_t display, int32_t bufferSlotCount); - - ScopedAStatus destroyLayer(int64_t display, int64_t layer); - - std::pair getActiveConfig(int64_t display); - - ScopedAStatus setActiveConfig(VtsDisplay& vtsDisplay, int32_t config); - - std::pair getDisplayAttribute(int64_t display, int32_t config, - DisplayAttribute displayAttribute); - - ScopedAStatus setPowerMode(int64_t display, PowerMode powerMode); - - ScopedAStatus setVsync(int64_t display, bool enable); - - void setVsyncAllowed(bool isAllowed); - - std::pair> getDataspaceSaturationMatrix(Dataspace dataspace); - - std::pair> executeCommands( - const std::vector& commands); - - std::optional takeLastVsyncPeriodChangeTimeline(); - - ScopedAStatus setContentType(int64_t display, ContentType contentType); - - std::pair setActiveConfigWithConstraints( - VtsDisplay& vtsDisplay, int32_t config, - const VsyncPeriodChangeConstraints& constraints); - - std::pair> getDisplayCapabilities( - int64_t display); - - ScopedAStatus dumpDebugInfo(); - - std::pair getDisplayIdentificationData(int64_t display); - - std::pair getHdrCapabilities(int64_t display); - - std::pair> getPerFrameMetadataKeys( - int64_t display); - - std::pair getReadbackBufferAttributes(int64_t display); - - ScopedAStatus setReadbackBuffer(int64_t display, const native_handle* buffer, - const ScopedFileDescriptor& releaseFence); - - std::pair getReadbackBufferFence(int64_t display); - - std::pair> getColorModes(int64_t display); - - std::pair> getRenderIntents(int64_t display, - ColorMode colorMode); - - ScopedAStatus setColorMode(int64_t display, ColorMode colorMode, RenderIntent renderIntent); - - std::pair - getDisplayedContentSamplingAttributes(int64_t display); - - ScopedAStatus setDisplayedContentSamplingEnabled(int64_t display, bool isEnabled, - FormatColorComponent formatColorComponent, - int64_t maxFrames); - - std::pair getDisplayedContentSample(int64_t display, - int64_t maxFrames, - int64_t timestamp); - - std::pair getDisplayConnectionType(int64_t display); - - std::pair> getDisplayConfigs(int64_t display); - - std::pair getDisplayVsyncPeriod(int64_t display); - - ScopedAStatus setAutoLowLatencyMode(int64_t display, bool isEnabled); - - std::pair> getSupportedContentTypes(int64_t display); - - std::pair getMaxVirtualDisplayCount(); - - std::pair getDisplayName(int64_t display); - - ScopedAStatus setClientTargetSlotCount(int64_t display, int32_t bufferSlotCount); - - std::pair> getCapabilities(); - - ScopedAStatus setBootDisplayConfig(int64_t display, int32_t config); - - ScopedAStatus clearBootDisplayConfig(int64_t display); - - std::pair getPreferredBootDisplayConfig(int64_t display); - - std::pair getDisplayPhysicalOrientation(int64_t display); - - std::pair> getDisplays(); - - private: - ScopedAStatus updateDisplayProperties(VtsDisplay& vtsDisplay, int32_t config); - - ScopedAStatus addDisplayToDisplayResources(int64_t display, bool isVirtual); - - ScopedAStatus addLayerToDisplayResources(int64_t display, int64_t layer); - - void removeLayerFromDisplayResources(int64_t display, int64_t layer); - - bool destroyAllLayers(); - - bool verifyComposerCallbackParams(); - - // Keep track of displays and layers. When a test fails/ends, - // the VtsComposerClient::tearDown should be called from the - // test tearDown to clean up the resources for the test. - struct DisplayResource { - DisplayResource(bool isVirtual_) : isVirtual(isVirtual_) {} - - bool isVirtual; - std::unordered_set layers; - }; - - std::shared_ptr mComposer; - std::shared_ptr mComposerClient; - std::shared_ptr mComposerCallback; - std::unordered_map mDisplayResources; -}; - -class VtsDisplay { - public: - VtsDisplay(int64_t displayId) : mDisplayId(displayId) {} - - int64_t get() const { return mDisplayId; } - - FRect getCrop() const { - return {0, 0, static_cast(mDisplayWidth), static_cast(mDisplayHeight)}; - } - - Rect getFrameRect() const { return {0, 0, mDisplayWidth, mDisplayHeight}; } - - void setDimensions(int32_t displayWidth, int32_t displayHeight) { - mDisplayWidth = displayWidth; - mDisplayHeight = displayHeight; - } - - int32_t getDisplayWidth() const { return mDisplayWidth; } - - int32_t getDisplayHeight() const { return mDisplayHeight; } - - struct DisplayConfig { - DisplayConfig(int32_t vsyncPeriod_, int32_t configGroup_) - : vsyncPeriod(vsyncPeriod_), configGroup(configGroup_) {} - int32_t vsyncPeriod; - int32_t configGroup; - }; - - void addDisplayConfig(int32_t config, DisplayConfig displayConfig) { - displayConfigs.insert({config, displayConfig}); - } - - DisplayConfig getDisplayConfig(int32_t config) { return displayConfigs.find(config)->second; } - - private: - const int64_t mDisplayId; - int32_t mDisplayWidth; - int32_t mDisplayHeight; - std::unordered_map displayConfigs; -}; -} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file 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 a04b9824c4..d3266e7623 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -189,7 +189,7 @@ class ComposerClientWriter { void setLayerZOrder(int64_t display, int64_t layer, uint32_t z) { ZOrder zorder; - zorder.z = static_cast(z); + zorder.z = z; getLayerCommand(display, layer).z.emplace(std::move(zorder)); } @@ -228,9 +228,9 @@ class ComposerClientWriter { std::optional mLayerCommand; std::vector mCommands; - Buffer getBuffer(uint32_t slot, const native_handle_t* bufferHandle, int fence) { + Buffer getBuffer(int slot, const native_handle_t* bufferHandle, int fence) { Buffer bufferCommand; - bufferCommand.slot = static_cast(slot); + bufferCommand.slot = slot; if (bufferHandle) bufferCommand.handle.emplace(::android::dupToAidl(bufferHandle)); if (fence > 0) bufferCommand.fence = ::ndk::ScopedFileDescriptor(fence); return bufferCommand; -- GitLab From 69f0f8bae08637abf248ecb200de0a0d610d38a2 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Fri, 21 Jan 2022 13:03:32 -0800 Subject: [PATCH 543/825] Add register/unregister methods for SvStatus and NMEA (hardware/interfaces) Bug: 213375506 Test: atest VtsHalGnssTargetTest Change-Id: I7468336b5e1759f4ce90a42fbfd19e3bb17baaa9 --- .../current/android/hardware/gnss/IGnss.aidl | 4 +++ gnss/aidl/android/hardware/gnss/IGnss.aidl | 21 +++++++++++ .../android/hardware/gnss/IGnssCallback.aidl | 4 +++ gnss/aidl/default/Gnss.cpp | 36 ++++++++++++++++--- gnss/aidl/default/Gnss.h | 8 ++++- gnss/aidl/vts/gnss_hal_test.cpp | 10 ++++-- 6 files changed, 74 insertions(+), 9 deletions(-) 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 affef2bf9b..56574344a8 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 @@ -56,6 +56,10 @@ interface IGnss { void setPositionMode(in android.hardware.gnss.IGnss.PositionModeOptions options); android.hardware.gnss.IGnssAntennaInfo getExtensionGnssAntennaInfo(); @nullable android.hardware.gnss.measurement_corrections.IMeasurementCorrectionsInterface getExtensionMeasurementCorrections(); + void startSvStatus(); + void stopSvStatus(); + void startNmea(); + void stopNmea(); const int ERROR_INVALID_ARGUMENT = 1; const int ERROR_ALREADY_INIT = 2; const int ERROR_GENERIC = 3; diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl index 79950adad3..12fdbb4b7b 100644 --- a/gnss/aidl/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl @@ -320,4 +320,25 @@ interface IGnss { * @return Handle to the IMeasurementCorrectionsInterface. */ @nullable IMeasurementCorrectionsInterface getExtensionMeasurementCorrections(); + + /** + * Starts a SvStatus output stream using the IGnssCallback gnssSvStatusCb(). + */ + void startSvStatus(); + + /** + * Stops the SvStatus output stream. + */ + void stopSvStatus(); + + /** + * Starts an NMEA (National Marine Electronics Association) output stream using the + * IGnssCallback gnssNmeaCb(). + */ + void startNmea(); + + /** + * Stops the NMEA output stream. + */ + void stopNmea(); } diff --git a/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl index a74d097ad6..866606fcf7 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl @@ -202,6 +202,10 @@ interface IGnssCallback { /** * Callback for the HAL to pass a vector of GnssSvInfo back to the client. * + * If GnssMeasurement is registered, the SvStatus report interval is the same as the measurement + * interval, i.e., the interval the measurement engine runs at. If GnssMeasurement is not + * registered, the SvStatus interval is the same as the location interval. + * * @param svInfo SV status information from HAL. */ void gnssSvStatusCb(in GnssSvInfo[] svInfoList); diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index eb17bbfed3..af1dd5c538 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -87,15 +87,13 @@ ScopedAStatus Gnss::start() { mIsActive = true; this->reportGnssStatusValue(IGnssCallback::GnssStatusValue::SESSION_BEGIN); mThread = std::thread([this]() { - auto svStatus = filterBlocklistedSatellites(Utils::getMockSvInfoList()); - this->reportSvStatus(svStatus); + this->reportSvStatus(); if (!mFirstFixReceived) { std::this_thread::sleep_for(std::chrono::milliseconds(TTFF_MILLIS)); mFirstFixReceived = true; } while (mIsActive == true) { - auto svStatus = filterBlocklistedSatellites(Utils::getMockSvInfoList()); - this->reportSvStatus(svStatus); + this->reportSvStatus(); auto currentLocation = getLocationFromHW(); mGnssPowerIndication->notePowerConsumption(); @@ -124,6 +122,13 @@ void Gnss::reportLocation(const GnssLocation& location) const { return; } +void Gnss::reportSvStatus() const { + if (mIsSvStatusActive) { + auto svStatus = filterBlocklistedSatellites(Utils::getMockSvInfoList()); + reportSvStatus(svStatus); + } +} + void Gnss::reportSvStatus(const std::vector& svInfoList) const { std::unique_lock lock(mMutex); if (sGnssCallback == nullptr) { @@ -136,7 +141,8 @@ void Gnss::reportSvStatus(const std::vector& svInfoList) const { } } -std::vector Gnss::filterBlocklistedSatellites(std::vector gnssSvInfoList) { +std::vector Gnss::filterBlocklistedSatellites( + std::vector gnssSvInfoList) const { ALOGD("filterBlocklistedSatellites"); for (uint32_t i = 0; i < gnssSvInfoList.size(); i++) { if (mGnssConfiguration->isBlocklisted(gnssSvInfoList[i])) { @@ -168,6 +174,26 @@ ScopedAStatus Gnss::stop() { return ScopedAStatus::ok(); } +ScopedAStatus Gnss::startSvStatus() { + ALOGD("startSvStatus"); + mIsSvStatusActive = true; + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::stopSvStatus() { + ALOGD("stopSvStatus"); + mIsSvStatusActive = false; + return ScopedAStatus::ok(); +} +ScopedAStatus Gnss::startNmea() { + ALOGD("startNmea"); + return ScopedAStatus::ok(); +} +ScopedAStatus Gnss::stopNmea() { + ALOGD("stopNmea"); + return ScopedAStatus::ok(); +} + ScopedAStatus Gnss::close() { ALOGD("close"); sGnssCallback = nullptr; diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index b50a1aeb7a..1489b4b5e2 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -51,6 +51,10 @@ class Gnss : public BnGnss { ndk::ScopedAStatus injectBestLocation(const GnssLocation& location) override; ndk::ScopedAStatus deleteAidingData(GnssAidingData aidingDataFlags) override; ndk::ScopedAStatus setPositionMode(const PositionModeOptions& options) override; + ndk::ScopedAStatus startSvStatus() override; + ndk::ScopedAStatus stopSvStatus() override; + ndk::ScopedAStatus startNmea() override; + ndk::ScopedAStatus stopNmea() override; ndk::ScopedAStatus getExtensionPsds(std::shared_ptr* iGnssPsds) override; ndk::ScopedAStatus getExtensionGnssConfiguration( @@ -83,9 +87,10 @@ class Gnss : public BnGnss { private: void reportLocation(const GnssLocation&) const; + void reportSvStatus() const; void reportSvStatus(const std::vector& svInfoList) const; std::vector filterBlocklistedSatellites( - std::vector gnssSvInfoList); + std::vector gnssSvInfoList) const; void reportGnssStatusValue(const IGnssCallback::GnssStatusValue gnssStatusValue) const; std::unique_ptr getLocationFromHW(); @@ -93,6 +98,7 @@ class Gnss : public BnGnss { std::atomic mMinIntervalMs; std::atomic mIsActive; + std::atomic mIsSvStatusActive; std::atomic mFirstFixReceived; std::thread mThread; diff --git a/gnss/aidl/vts/gnss_hal_test.cpp b/gnss/aidl/vts/gnss_hal_test.cpp index 4828f19f7d..c1128ba28d 100644 --- a/gnss/aidl/vts/gnss_hal_test.cpp +++ b/gnss/aidl/vts/gnss_hal_test.cpp @@ -100,9 +100,11 @@ bool GnssHalTest::StartAndCheckFirstLocation(const int min_interval_msec, } SetPositionMode(min_interval_msec, low_power_mode); - auto result = aidl_gnss_hal_->start(); + auto status = aidl_gnss_hal_->start(); + EXPECT_TRUE(status.isOk()); - EXPECT_TRUE(result.isOk()); + status = aidl_gnss_hal_->startSvStatus(); + EXPECT_TRUE(status.isOk()); /* * GnssLocationProvider support of AGPS SUPL & XtraDownloader is not available in VTS, @@ -129,8 +131,10 @@ void GnssHalTest::StopAndClearLocations() { // Invoke the super method. return GnssHalTestTemplate::StopAndClearLocations(); } + auto status = aidl_gnss_hal_->stopSvStatus(); + EXPECT_TRUE(status.isOk()); - auto status = aidl_gnss_hal_->stop(); + status = aidl_gnss_hal_->stop(); EXPECT_TRUE(status.isOk()); /* -- GitLab From c8438c0702ef86aa14583f61984e86a72ac60558 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Fri, 28 Jan 2022 19:05:34 -0800 Subject: [PATCH 544/825] Send a unlocked message for test coverage Bug: 215435869 Test: atest VtsHalTvTunerTargetTest Test: atest android.media.tv.tuner.cts Change-Id: I8e63eac1e96ab9a638f3aa04dc0bfd39cbdd52fa --- tv/tuner/aidl/default/Frontend.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index 056d01468a..3f7797cead 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -391,6 +391,13 @@ void Frontend::scanThreadLoop() { mCallback->onScanMessage(FrontendScanMessageType::DVBT_CELL_IDS, msg); } + { + FrontendScanMessage msg; + msg.set(false); + mCallback->onScanMessage(FrontendScanMessageType::LOCKED, msg); + mIsLocked = false; + } + { FrontendScanMessage msg; msg.set(true); -- GitLab From 33ba66bba7d9ad1a25a0c02d146ad7e8a9a1cf37 Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Sun, 16 Jan 2022 16:33:52 -0800 Subject: [PATCH 545/825] Update a default HIDL EVS HAL implementation This CL modifies a default implementation of HIDL EVS HAL v1.1 to properly emulate IEvsCamera and generate a test pattern (SMPTE color bars) on the cuttlefish. Bug: 147743625 Test: launch_cvd --gpu_mode=gfxstream && atest VtsHalEvsV1_1TargetTest Change-Id: I36b141c250efcc27e9a455d504fe897c69349ad9 --- automotive/evs/1.1/default/Android.bp | 34 +- automotive/evs/1.1/default/ConfigManager.cpp | 246 ++++----- automotive/evs/1.1/default/ConfigManager.h | 130 ++--- .../evs/1.1/default/ConfigManagerUtil.cpp | 80 ++- .../evs/1.1/default/ConfigManagerUtil.h | 39 +- automotive/evs/1.1/default/EvsCamera.cpp | 489 +++++++++--------- automotive/evs/1.1/default/EvsCamera.h | 146 +++--- automotive/evs/1.1/default/EvsDisplay.cpp | 208 ++++---- automotive/evs/1.1/default/EvsDisplay.h | 70 +-- automotive/evs/1.1/default/EvsEnumerator.cpp | 304 +++++------ automotive/evs/1.1/default/EvsEnumerator.h | 96 ++-- .../evs/1.1/default/EvsUltrasonicsArray.cpp | 7 +- .../evs/1.1/default/EvsUltrasonicsArray.h | 2 +- automotive/evs/1.1/default/GlWrapper.cpp | 450 ++++++++++++++++ automotive/evs/1.1/default/GlWrapper.h | 78 +++ ...oid.hardware.automotive.evs@1.1-service.rc | 9 +- ...id.hardware.automotive.evs@1.1-service.xml | 8 +- .../resources/evs_default_configuration.xml | 25 +- automotive/evs/1.1/default/service.cpp | 38 +- 19 files changed, 1420 insertions(+), 1039 deletions(-) create mode 100644 automotive/evs/1.1/default/GlWrapper.cpp create mode 100644 automotive/evs/1.1/default/GlWrapper.h diff --git a/automotive/evs/1.1/default/Android.bp b/automotive/evs/1.1/default/Android.bp index ea1851f607..4c08ef364e 100644 --- a/automotive/evs/1.1/default/Android.bp +++ b/automotive/evs/1.1/default/Android.bp @@ -13,48 +13,46 @@ cc_binary { proprietary: true, relative_install_path: "hw", srcs: [ - "service.cpp", - "EvsCamera.cpp", - "EvsEnumerator.cpp", - "EvsDisplay.cpp", - "ConfigManager.cpp", - "ConfigManagerUtil.cpp", - "EvsUltrasonicsArray.cpp", + "*.cpp", ], init_rc: ["android.hardware.automotive.evs@1.1-service.rc"], - shared_libs: [ + "android.frameworks.automotive.display@1.0", "android.hardware.automotive.evs@1.0", "android.hardware.automotive.evs@1.1", "android.hardware.camera.device@3.3", + "android.hardware.graphics.bufferqueue@1.0", + "android.hardware.graphics.bufferqueue@2.0", "android.hidl.allocator@1.0", "android.hidl.memory@1.0", + "android.hidl.token@1.0-utils", + "libEGL", + "libGLESv2", "libbase", "libbinder", - "liblog", + "libbufferqueueconverter", + "libcamera_metadata", "libhardware", "libhidlbase", "libhidlmemory", "liblog", + "libtinyxml2", "libui", "libutils", - "libcamera_metadata", - "libtinyxml2", - "android.hidl.token@1.0-utils", - "android.frameworks.automotive.display@1.0", - "android.hardware.graphics.bufferqueue@1.0", - "android.hardware.graphics.bufferqueue@2.0", ], - cflags: [ "-O0", "-g", + "-DLOG_TAG=\"MockEvsDriver\"", + "-DGL_GLEXT_PROTOTYPES", + "-DEGL_EGLEXT_PROTOTYPES", + ], + include_dirs: [ + "frameworks/native/include/", ], - required: [ "evs_default_configuration.xml", ], - vintf_fragments: [ "manifest_android.hardware.automotive.evs@1.1-service.xml", ], diff --git a/automotive/evs/1.1/default/ConfigManager.cpp b/automotive/evs/1.1/default/ConfigManager.cpp index 986793e8a8..ca8cfae150 100644 --- a/automotive/evs/1.1/default/ConfigManager.cpp +++ b/automotive/evs/1.1/default/ConfigManager.cpp @@ -14,38 +14,40 @@ * limitations under the License. */ -#include -#include -#include +#include "ConfigManager.h" +#include #include #include -#include -#include "ConfigManager.h" +#include +#include +#include -using ::android::hardware::camera::device::V3_2::StreamRotation; +namespace android::hardware::automotive::evs::V1_1::implementation { +using namespace std; +using namespace tinyxml2; +using hardware::camera::device::V3_2::StreamRotation; ConfigManager::~ConfigManager() { /* Nothing to do */ } - -void ConfigManager::readCameraInfo(const XMLElement * const aCameraElem) { +void ConfigManager::readCameraInfo(const XMLElement* const aCameraElem) { if (aCameraElem == nullptr) { ALOGW("XML file does not have required camera element"); return; } - const XMLElement *curElem = aCameraElem->FirstChildElement(); + const XMLElement* curElem = aCameraElem->FirstChildElement(); while (curElem != nullptr) { if (!strcmp(curElem->Name(), "group")) { /* camera group identifier */ - const char *id = curElem->FindAttribute("id")->Value(); + const char* id = curElem->FindAttribute("id")->Value(); /* create a camera group to be filled */ - CameraGroupInfo *aCamera = new CameraGroupInfo(); + CameraGroupInfo* aCamera = new CameraGroupInfo(); /* read camera device information */ if (!readCameraDeviceInfo(aCamera, curElem)) { @@ -55,28 +57,26 @@ void ConfigManager::readCameraInfo(const XMLElement * const aCameraElem) { } /* camera group synchronization */ - const char *sync = curElem->FindAttribute("synchronized")->Value(); + const char* sync = curElem->FindAttribute("synchronized")->Value(); if (!strcmp(sync, "CALIBRATED")) { - aCamera->synchronized = - ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED; + aCamera->synchronized = ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED; } else if (!strcmp(sync, "APPROXIMATE")) { - aCamera->synchronized = - ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE; + aCamera->synchronized = ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE; } else { - aCamera->synchronized = 0; // Not synchronized + aCamera->synchronized = 0; // Not synchronized } /* add a group to hash map */ mCameraGroupInfos.insert_or_assign(id, unique_ptr(aCamera)); } else if (!strcmp(curElem->Name(), "device")) { /* camera unique identifier */ - const char *id = curElem->FindAttribute("id")->Value(); + const char* id = curElem->FindAttribute("id")->Value(); /* camera mount location */ - const char *pos = curElem->FindAttribute("position")->Value(); + const char* pos = curElem->FindAttribute("position")->Value(); /* create a camera device to be filled */ - CameraInfo *aCamera = new CameraInfo(); + CameraInfo* aCamera = new CameraInfo(); /* read camera device information */ if (!readCameraDeviceInfo(aCamera, curElem)) { @@ -99,10 +99,7 @@ void ConfigManager::readCameraInfo(const XMLElement * const aCameraElem) { } } - -bool -ConfigManager::readCameraDeviceInfo(CameraInfo *aCamera, - const XMLElement *aDeviceElem) { +bool ConfigManager::readCameraDeviceInfo(CameraInfo* aCamera, const XMLElement* aDeviceElem) { if (aCamera == nullptr || aDeviceElem == nullptr) { return false; } @@ -113,16 +110,11 @@ ConfigManager::readCameraDeviceInfo(CameraInfo *aCamera, /* read device capabilities */ totalEntries += - readCameraCapabilities(aDeviceElem->FirstChildElement("caps"), - aCamera, - totalDataSize); - + readCameraCapabilities(aDeviceElem->FirstChildElement("caps"), aCamera, totalDataSize); /* read camera metadata */ - totalEntries += - readCameraMetadata(aDeviceElem->FirstChildElement("characteristics"), - aCamera, - totalDataSize); + totalEntries += readCameraMetadata(aDeviceElem->FirstChildElement("characteristics"), aCamera, + totalDataSize); /* construct camera_metadata_t */ if (!constructCameraMetadata(aCamera, totalEntries, totalDataSize)) { @@ -133,40 +125,34 @@ ConfigManager::readCameraDeviceInfo(CameraInfo *aCamera, return true; } - -size_t -ConfigManager::readCameraCapabilities(const XMLElement * const aCapElem, - CameraInfo *aCamera, - size_t &dataSize) { +size_t ConfigManager::readCameraCapabilities(const XMLElement* const aCapElem, CameraInfo* aCamera, + size_t& dataSize) { if (aCapElem == nullptr || aCamera == nullptr) { return 0; } string token; - const XMLElement *curElem = nullptr; + const XMLElement* curElem = nullptr; /* a list of supported camera parameters/controls */ curElem = aCapElem->FirstChildElement("supported_controls"); if (curElem != nullptr) { - const XMLElement *ctrlElem = curElem->FirstChildElement("control"); + const XMLElement* ctrlElem = curElem->FirstChildElement("control"); while (ctrlElem != nullptr) { - const char *nameAttr = ctrlElem->FindAttribute("name")->Value();; + const char* nameAttr = ctrlElem->FindAttribute("name")->Value(); + ; const int32_t minVal = stoi(ctrlElem->FindAttribute("min")->Value()); const int32_t maxVal = stoi(ctrlElem->FindAttribute("max")->Value()); int32_t stepVal = 1; - const XMLAttribute *stepAttr = ctrlElem->FindAttribute("step"); + const XMLAttribute* stepAttr = ctrlElem->FindAttribute("step"); if (stepAttr != nullptr) { stepVal = stoi(stepAttr->Value()); } CameraParam aParam; - if (ConfigManagerUtil::convertToEvsCameraParam(nameAttr, - aParam)) { - aCamera->controls.emplace( - aParam, - make_tuple(minVal, maxVal, stepVal) - ); + if (ConfigManagerUtil::convertToEvsCameraParam(nameAttr, aParam)) { + aCamera->controls.emplace(aParam, make_tuple(minVal, maxVal, stepVal)); } ctrlElem = ctrlElem->NextSiblingElement("control"); @@ -177,11 +163,11 @@ ConfigManager::readCameraCapabilities(const XMLElement * const aCapElem, curElem = aCapElem->FirstChildElement("stream"); while (curElem != nullptr) { /* read 5 attributes */ - const XMLAttribute *idAttr = curElem->FindAttribute("id"); - const XMLAttribute *widthAttr = curElem->FindAttribute("width"); - const XMLAttribute *heightAttr = curElem->FindAttribute("height"); - const XMLAttribute *fmtAttr = curElem->FindAttribute("format"); - const XMLAttribute *fpsAttr = curElem->FindAttribute("framerate"); + const XMLAttribute* idAttr = curElem->FindAttribute("id"); + const XMLAttribute* widthAttr = curElem->FindAttribute("width"); + const XMLAttribute* heightAttr = curElem->FindAttribute("height"); + const XMLAttribute* fmtAttr = curElem->FindAttribute("format"); + const XMLAttribute* fpsAttr = curElem->FindAttribute("framerate"); const int32_t id = stoi(idAttr->Value()); int32_t framerate = 0; @@ -190,16 +176,13 @@ ConfigManager::readCameraCapabilities(const XMLElement * const aCapElem, } int32_t pixFormat; - if (ConfigManagerUtil::convertToPixelFormat(fmtAttr->Value(), - pixFormat)) { - RawStreamConfiguration cfg = { - id, - stoi(widthAttr->Value()), - stoi(heightAttr->Value()), - pixFormat, - ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT, - framerate - }; + if (ConfigManagerUtil::convertToPixelFormat(fmtAttr->Value(), pixFormat)) { + RawStreamConfiguration cfg = {id, + stoi(widthAttr->Value()), + stoi(heightAttr->Value()), + pixFormat, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT, + framerate}; aCamera->streamConfigurations.insert_or_assign(id, cfg); } @@ -207,70 +190,58 @@ ConfigManager::readCameraCapabilities(const XMLElement * const aCapElem, } dataSize = calculate_camera_metadata_entry_data_size( - get_camera_metadata_tag_type( - ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS - ), - aCamera->streamConfigurations.size() * kStreamCfgSz - ); + get_camera_metadata_tag_type(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS), + aCamera->streamConfigurations.size() * kStreamCfgSz); /* a single camera metadata entry contains multiple stream configurations */ return dataSize > 0 ? 1 : 0; } - -size_t -ConfigManager::readCameraMetadata(const XMLElement * const aParamElem, - CameraInfo *aCamera, - size_t &dataSize) { +size_t ConfigManager::readCameraMetadata(const XMLElement* const aParamElem, CameraInfo* aCamera, + size_t& dataSize) { if (aParamElem == nullptr || aCamera == nullptr) { return 0; } - const XMLElement *curElem = aParamElem->FirstChildElement("parameter"); + const XMLElement* curElem = aParamElem->FirstChildElement("parameter"); size_t numEntries = 0; camera_metadata_tag_t tag; while (curElem != nullptr) { if (!ConfigManagerUtil::convertToMetadataTag(curElem->FindAttribute("name")->Value(), tag)) { - switch(tag) { + switch (tag) { case ANDROID_LENS_DISTORTION: case ANDROID_LENS_POSE_ROTATION: case ANDROID_LENS_POSE_TRANSLATION: case ANDROID_LENS_INTRINSIC_CALIBRATION: { /* float[] */ size_t count = 0; - void *data = ConfigManagerUtil::convertFloatArray( - curElem->FindAttribute("size")->Value(), - curElem->FindAttribute("value")->Value(), - count - ); + void* data = ConfigManagerUtil::convertFloatArray( + curElem->FindAttribute("size")->Value(), + curElem->FindAttribute("value")->Value(), count); aCamera->cameraMetadata.insert_or_assign( - tag, make_pair(make_unique(data), count) - ); + tag, make_pair(make_unique(data), count)); ++numEntries; dataSize += calculate_camera_metadata_entry_data_size( - get_camera_metadata_tag_type(tag), count - ); + get_camera_metadata_tag_type(tag), count); break; } case ANDROID_REQUEST_AVAILABLE_CAPABILITIES: { - camera_metadata_enum_android_request_available_capabilities_t *data = - new camera_metadata_enum_android_request_available_capabilities_t[1]; + camera_metadata_enum_android_request_available_capabilities_t* data = + new camera_metadata_enum_android_request_available_capabilities_t[1]; if (ConfigManagerUtil::convertToCameraCapability( - curElem->FindAttribute("value")->Value(), *data)) { - curElem->FindAttribute("value")->Value(), - aCamera->cameraMetadata.insert_or_assign( - tag, make_pair(make_unique(data), 1) - ); + curElem->FindAttribute("value")->Value(), *data)) { + curElem->FindAttribute("value")->Value(), + aCamera->cameraMetadata.insert_or_assign( + tag, make_pair(make_unique(data), 1)); ++numEntries; dataSize += calculate_camera_metadata_entry_data_size( - get_camera_metadata_tag_type(tag), 1 - ); + get_camera_metadata_tag_type(tag), 1); } break; } @@ -278,13 +249,11 @@ ConfigManager::readCameraMetadata(const XMLElement * const aParamElem, case ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS: { /* a comma-separated list of physical camera devices */ size_t len = strlen(curElem->FindAttribute("value")->Value()); - char *data = new char[len + 1]; - memcpy(data, - curElem->FindAttribute("value")->Value(), - len * sizeof(char)); + char* data = new char[len + 1]; + memcpy(data, curElem->FindAttribute("value")->Value(), len * sizeof(char)); /* replace commas with null char */ - char *p = data; + char* p = data; while (*p != '\0') { if (*p == ',') { *p = '\0'; @@ -293,19 +262,16 @@ ConfigManager::readCameraMetadata(const XMLElement * const aParamElem, } aCamera->cameraMetadata.insert_or_assign( - tag, make_pair(make_unique(data), len) - ); + tag, make_pair(make_unique(data), len)); ++numEntries; dataSize += calculate_camera_metadata_entry_data_size( - get_camera_metadata_tag_type(tag), len - ); + get_camera_metadata_tag_type(tag), len); break; } default: - ALOGW("Parameter %s is not supported", - curElem->FindAttribute("name")->Value()); + ALOGW("Parameter %s is not supported", curElem->FindAttribute("name")->Value()); break; } } @@ -316,11 +282,8 @@ ConfigManager::readCameraMetadata(const XMLElement * const aParamElem, return numEntries; } - -bool -ConfigManager::constructCameraMetadata(CameraInfo *aCamera, - const size_t totalEntries, - const size_t totalDataSize) { +bool ConfigManager::constructCameraMetadata(CameraInfo* aCamera, const size_t totalEntries, + const size_t totalDataSize) { if (aCamera == nullptr || !aCamera->allocate(totalEntries, totalDataSize)) { ALOGE("Failed to allocate memory for camera metadata"); return false; @@ -328,16 +291,15 @@ ConfigManager::constructCameraMetadata(CameraInfo *aCamera, const size_t numStreamConfigs = aCamera->streamConfigurations.size(); unique_ptr data(new int32_t[kStreamCfgSz * numStreamConfigs]); - int32_t *ptr = data.get(); - for (auto &cfg : aCamera->streamConfigurations) { + int32_t* ptr = data.get(); + for (auto& cfg : aCamera->streamConfigurations) { for (auto i = 0; i < kStreamCfgSz; ++i) { - *ptr++ = cfg.second[i]; + *ptr++ = cfg.second[i]; } } int32_t err = add_camera_metadata_entry(aCamera->characteristics, ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, - data.get(), - numStreamConfigs * kStreamCfgSz); + data.get(), numStreamConfigs * kStreamCfgSz); if (err) { ALOGE("Failed to add stream configurations to metadata, ignored"); @@ -345,11 +307,9 @@ ConfigManager::constructCameraMetadata(CameraInfo *aCamera, } bool success = true; - for (auto &[tag, entry] : aCamera->cameraMetadata) { + for (auto& [tag, entry] : aCamera->cameraMetadata) { /* try to add new camera metadata entry */ - int32_t err = add_camera_metadata_entry(aCamera->characteristics, - tag, - entry.first.get(), + int32_t err = add_camera_metadata_entry(aCamera->characteristics, tag, entry.first.get(), entry.second); if (err) { ALOGE("Failed to add an entry with a tag 0x%X", tag); @@ -376,8 +336,7 @@ ConfigManager::constructCameraMetadata(CameraInfo *aCamera, return success; } - -void ConfigManager::readSystemInfo(const XMLElement * const aSysElem) { +void ConfigManager::readSystemInfo(const XMLElement* const aSysElem) { if (aSysElem == nullptr) { return; } @@ -389,24 +348,22 @@ void ConfigManager::readSystemInfo(const XMLElement * const aSysElem) { */ /* read number of cameras available in the system */ - const XMLElement *xmlElem = aSysElem->FirstChildElement("num_cameras"); + const XMLElement* xmlElem = aSysElem->FirstChildElement("num_cameras"); if (xmlElem != nullptr) { - mSystemInfo.numCameras = - stoi(xmlElem->FindAttribute("value")->Value()); + mSystemInfo.numCameras = stoi(xmlElem->FindAttribute("value")->Value()); } } - -void ConfigManager::readDisplayInfo(const XMLElement * const aDisplayElem) { +void ConfigManager::readDisplayInfo(const XMLElement* const aDisplayElem) { if (aDisplayElem == nullptr) { ALOGW("XML file does not have required camera element"); return; } - const XMLElement *curDev = aDisplayElem->FirstChildElement("device"); + const XMLElement* curDev = aDisplayElem->FirstChildElement("device"); while (curDev != nullptr) { - const char *id = curDev->FindAttribute("id")->Value(); - //const char *pos = curDev->FirstAttribute("position")->Value(); + const char* id = curDev->FindAttribute("id")->Value(); + // const char *pos = curDev->FirstAttribute("position")->Value(); unique_ptr dpy(new DisplayInfo()); if (dpy == nullptr) { @@ -414,27 +371,26 @@ void ConfigManager::readDisplayInfo(const XMLElement * const aDisplayElem) { return; } - const XMLElement *cap = curDev->FirstChildElement("caps"); + const XMLElement* cap = curDev->FirstChildElement("caps"); if (cap != nullptr) { - const XMLElement *curStream = cap->FirstChildElement("stream"); + const XMLElement* curStream = cap->FirstChildElement("stream"); while (curStream != nullptr) { /* read 4 attributes */ - const XMLAttribute *idAttr = curStream->FindAttribute("id"); - const XMLAttribute *widthAttr = curStream->FindAttribute("width"); - const XMLAttribute *heightAttr = curStream->FindAttribute("height"); - const XMLAttribute *fmtAttr = curStream->FindAttribute("format"); + const XMLAttribute* idAttr = curStream->FindAttribute("id"); + const XMLAttribute* widthAttr = curStream->FindAttribute("width"); + const XMLAttribute* heightAttr = curStream->FindAttribute("height"); + const XMLAttribute* fmtAttr = curStream->FindAttribute("format"); const int32_t id = stoi(idAttr->Value()); int32_t pixFormat; - if (ConfigManagerUtil::convertToPixelFormat(fmtAttr->Value(), - pixFormat)) { + if (ConfigManagerUtil::convertToPixelFormat(fmtAttr->Value(), pixFormat)) { RawStreamConfiguration cfg = { - id, - stoi(widthAttr->Value()), - stoi(heightAttr->Value()), - pixFormat, - ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT, - 0 // unused + id, + stoi(widthAttr->Value()), + stoi(heightAttr->Value()), + pixFormat, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT, + 0 // unused }; dpy->streamConfigurations.insert_or_assign(id, cfg); } @@ -450,7 +406,6 @@ void ConfigManager::readDisplayInfo(const XMLElement * const aDisplayElem) { return; } - bool ConfigManager::readConfigDataFromXML() noexcept { XMLDocument xmlDoc; @@ -464,7 +419,7 @@ bool ConfigManager::readConfigDataFromXML() noexcept { } /* retrieve the root element */ - const XMLElement *rootElem = xmlDoc.RootElement(); + const XMLElement* rootElem = xmlDoc.RootElement(); if (strcmp(rootElem->Name(), "configuration")) { ALOGE("A configuration file is not in the required format. " "See /etc/automotive/evs/evs_configuration.dtd"); @@ -487,12 +442,10 @@ bool ConfigManager::readConfigDataFromXML() noexcept { ALOGI("Parsing configuration file takes %lf (ms)", (double)(parsingEnd - parsingStart) / 1000000.0); - return true; } - -std::unique_ptr ConfigManager::Create(const char *path) { +std::unique_ptr ConfigManager::Create(const char* path) { unique_ptr cfgMgr(new ConfigManager(path)); /* @@ -510,3 +463,4 @@ std::unique_ptr ConfigManager::Create(const char *path) { } } +} // namespace android::hardware::automotive::evs::V1_1::implementation diff --git a/automotive/evs/1.1/default/ConfigManager.h b/automotive/evs/1.1/default/ConfigManager.h index b0b2670fb6..0a1536010b 100644 --- a/automotive/evs/1.1/default/ConfigManager.h +++ b/automotive/evs/1.1/default/ConfigManager.h @@ -13,28 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef CONFIG_MANAGER_H -#define CONFIG_MANAGER_H +#ifndef ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_CONFIGMANAGER_H +#define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_CONFIGMANAGER_H -#include -#include -#include -#include - -#include +#include "ConfigManagerUtil.h" -#include -#include #include +#include +#include +#include -#include "ConfigManagerUtil.h" +#include +#include +#include +#include -using namespace std; -using namespace tinyxml2; +namespace android::hardware::automotive::evs::V1_1::implementation { -using ::android::hardware::hidl_vec; -using ::android::hardware::camera::device::V3_2::Stream; -using ::android::hardware::automotive::evs::V1_1::CameraParam; +using hardware::hidl_vec; +using hardware::automotive::evs::V1_1::CameraParam; +using hardware::camera::device::V3_2::Stream; /* * Plese note that this is different from what is defined in @@ -45,8 +43,8 @@ const size_t kStreamCfgSz = 6; typedef std::array RawStreamConfiguration; class ConfigManager { -public: - static std::unique_ptr Create(const char *path = ""); + public: + static std::unique_ptr Create(const char* path = ""); ConfigManager(const ConfigManager&) = delete; ConfigManager& operator=(const ConfigManager&) = delete; @@ -54,15 +52,11 @@ public: /* Camera device's capabilities and metadata */ class CameraInfo { - public: - CameraInfo() : - characteristics(nullptr) { - /* Nothing to do */ + public: + CameraInfo() : characteristics(nullptr) { /* Nothing to do */ } - virtual ~CameraInfo() { - free_camera_metadata(characteristics); - } + virtual ~CameraInfo() { free_camera_metadata(characteristics); } /* Allocate memory for camera_metadata_t */ bool allocate(size_t entry_cap, size_t data_cap) { @@ -79,50 +73,49 @@ public: * List of supported controls that the primary client can program. * Paraemters are stored with its valid range */ - unordered_map> controls; + std::unordered_map> controls; /* * List of supported output stream configurations; each array stores * format, width, height, and direction values in the order. */ - unordered_map streamConfigurations; + std::unordered_map streamConfigurations; /* * Internal storage for camera metadata. Each entry holds a pointer to * data and number of elements */ - unordered_map, size_t>> cameraMetadata; + std::unordered_map, size_t>> + cameraMetadata; /* Camera module characteristics */ - camera_metadata_t *characteristics; + camera_metadata_t* characteristics; }; class CameraGroupInfo : public CameraInfo { - public: + public: CameraGroupInfo() {} /* ID of member camera devices */ - unordered_set devices; + std::unordered_set devices; /* The capture operation of member camera devices are synchronized */ bool synchronized = false; }; class SystemInfo { - public: + public: /* number of available cameras */ int32_t numCameras = 0; }; class DisplayInfo { - public: + public: /* * List of supported input stream configurations; each array stores * format, width, height, and direction values in the order. */ - unordered_map streamConfigurations; + std::unordered_map streamConfigurations; }; /* @@ -131,80 +124,74 @@ public: * @return SystemInfo * Constant reference of SystemInfo. */ - const SystemInfo &getSystemInfo() { - return mSystemInfo; - } + const SystemInfo& getSystemInfo() { return mSystemInfo; } /* * Return a list of cameras * * This function assumes that it is not being called frequently. * - * @return vector + * @return std::vector * A vector that contains unique camera device identifiers. */ - vector getCameraList() { - vector aList; - for (auto &v : mCameraInfo) { - aList.emplace_back(v.first); + std::vector getCameraList() { + std::vector aList; + for (auto& v : mCameraInfo) { + aList.push_back(v.first); } return aList; } - /* * Return a list of cameras * * @return CameraGroupInfo * A pointer to a camera group identified by a given id. */ - unique_ptr& getCameraGroupInfo(const string& gid) { + std::unique_ptr& getCameraGroupInfo(const std::string& gid) { return mCameraGroupInfos[gid]; } - /* * Return a camera metadata * * @param cameraId - * Unique camera node identifier in string + * Unique camera node identifier in std::string * - * @return unique_ptr + * @return std::unique_ptr * A pointer to CameraInfo that is associated with a given camera * ID. This returns a null pointer if this does not recognize a * given camera identifier. */ - unique_ptr& getCameraInfo(const string cameraId) noexcept { + std::unique_ptr& getCameraInfo(const std::string cameraId) noexcept { return mCameraInfo[cameraId]; } -private: + private: /* Constructors */ - ConfigManager(const char *xmlPath) : - mConfigFilePath(xmlPath) { - } + ConfigManager(const char* xmlPath) : mConfigFilePath(xmlPath) {} /* System configuration */ SystemInfo mSystemInfo; /* Internal data structure for camera device information */ - unordered_map> mCameraInfo; + std::unordered_map> mCameraInfo; /* Internal data structure for camera device information */ - unordered_map> mDisplayInfo; + std::unordered_map> mDisplayInfo; /* Camera groups are stored in hash map */ - unordered_map> mCameraGroupInfos; + std::unordered_map> mCameraGroupInfos; /* * Camera positions are stored in hash map. * The position must be one of front, rear, left, and right. */ - unordered_map> mCameraPosition; + std::unordered_map> mCameraPosition; /* A path to XML configuration file */ - const char *mConfigFilePath; + const char* mConfigFilePath; /* * Parse a given EVS configuration file and store the information @@ -221,7 +208,7 @@ private: * @param aSysElem * A pointer to "system" XML element. */ - void readSystemInfo(const XMLElement * const aSysElem); + void readSystemInfo(const tinyxml2::XMLElement* const aSysElem); /* * read the information of camera devices @@ -230,7 +217,7 @@ private: * A pointer to "camera" XML element that may contain multiple * "device" elements. */ - void readCameraInfo(const XMLElement * const aCameraElem); + void readCameraInfo(const tinyxml2::XMLElement* const aCameraElem); /* * read display device information @@ -239,7 +226,7 @@ private: * A pointer to "display" XML element that may contain multiple * "device" elements. */ - void readDisplayInfo(const XMLElement * const aDisplayElem); + void readDisplayInfo(const tinyxml2::XMLElement* const aDisplayElem); /* * read camera device information @@ -255,8 +242,7 @@ private: * Return false upon any failure in reading and processing camera * device information. */ - bool readCameraDeviceInfo(CameraInfo *aCamera, - const XMLElement *aDeviceElem); + bool readCameraDeviceInfo(CameraInfo* aCamera, const tinyxml2::XMLElement* aDeviceElem); /* * read camera metadata @@ -273,9 +259,8 @@ private: * @return size_t * Number of camera metadata entries */ - size_t readCameraCapabilities(const XMLElement * const aCapElem, - CameraInfo *aCamera, - size_t &dataSize); + size_t readCameraCapabilities(const tinyxml2::XMLElement* const aCapElem, CameraInfo* aCamera, + size_t& dataSize); /* * read camera metadata @@ -291,9 +276,8 @@ private: * @return size_t * Number of camera metadata entries */ - size_t readCameraMetadata(const XMLElement * const aParamElem, - CameraInfo *aCamera, - size_t &dataSize); + size_t readCameraMetadata(const tinyxml2::XMLElement* const aParamElem, CameraInfo* aCamera, + size_t& dataSize); /* * construct camera_metadata_t from camera capabilities and metadata @@ -310,9 +294,9 @@ private: * or its size is not large enough to add all found camera metadata * entries. */ - bool constructCameraMetadata(CameraInfo *aCamera, - const size_t totalEntries, + bool constructCameraMetadata(CameraInfo* aCamera, const size_t totalEntries, const size_t totalDataSize); }; -#endif // CONFIG_MANAGER_H +} // namespace android::hardware::automotive::evs::V1_1::implementation +#endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_CONFIGMANAGER_H diff --git a/automotive/evs/1.1/default/ConfigManagerUtil.cpp b/automotive/evs/1.1/default/ConfigManagerUtil.cpp index d10f236bd4..5edd405e2f 100644 --- a/automotive/evs/1.1/default/ConfigManagerUtil.cpp +++ b/automotive/evs/1.1/default/ConfigManagerUtil.cpp @@ -16,43 +16,45 @@ #include "ConfigManagerUtil.h" -#include -#include -#include - #include #include +#include +#include +#include + +namespace android::hardware::automotive::evs::V1_1::implementation { -bool ConfigManagerUtil::convertToEvsCameraParam(const string &id, - CameraParam &camParam) { +using namespace std; + +bool ConfigManagerUtil::convertToEvsCameraParam(const string& id, CameraParam& camParam) { string trimmed = ConfigManagerUtil::trimString(id); bool success = true; if (!trimmed.compare("BRIGHTNESS")) { - camParam = CameraParam::BRIGHTNESS; + camParam = CameraParam::BRIGHTNESS; } else if (!trimmed.compare("CONTRAST")) { - camParam = CameraParam::CONTRAST; + camParam = CameraParam::CONTRAST; } else if (!trimmed.compare("AUTOGAIN")) { - camParam = CameraParam::AUTOGAIN; + camParam = CameraParam::AUTOGAIN; } else if (!trimmed.compare("GAIN")) { - camParam = CameraParam::GAIN; + camParam = CameraParam::GAIN; } else if (!trimmed.compare("AUTO_WHITE_BALANCE")) { - camParam = CameraParam::AUTO_WHITE_BALANCE; + camParam = CameraParam::AUTO_WHITE_BALANCE; } else if (!trimmed.compare("WHITE_BALANCE_TEMPERATURE")) { - camParam = CameraParam::WHITE_BALANCE_TEMPERATURE; + camParam = CameraParam::WHITE_BALANCE_TEMPERATURE; } else if (!trimmed.compare("SHARPNESS")) { - camParam = CameraParam::SHARPNESS; + camParam = CameraParam::SHARPNESS; } else if (!trimmed.compare("AUTO_EXPOSURE")) { - camParam = CameraParam::AUTO_EXPOSURE; + camParam = CameraParam::AUTO_EXPOSURE; } else if (!trimmed.compare("ABSOLUTE_EXPOSURE")) { - camParam = CameraParam::ABSOLUTE_EXPOSURE; + camParam = CameraParam::ABSOLUTE_EXPOSURE; } else if (!trimmed.compare("ABSOLUTE_FOCUS")) { - camParam = CameraParam::ABSOLUTE_FOCUS; + camParam = CameraParam::ABSOLUTE_FOCUS; } else if (!trimmed.compare("AUTO_FOCUS")) { - camParam = CameraParam::AUTO_FOCUS; + camParam = CameraParam::AUTO_FOCUS; } else if (!trimmed.compare("ABSOLUTE_ZOOM")) { - camParam = CameraParam::ABSOLUTE_ZOOM; + camParam = CameraParam::ABSOLUTE_ZOOM; } else { success = false; } @@ -60,18 +62,16 @@ bool ConfigManagerUtil::convertToEvsCameraParam(const string &id, return success; } - -bool ConfigManagerUtil::convertToPixelFormat(const string &format, - int32_t &pixFormat) { +bool ConfigManagerUtil::convertToPixelFormat(const string& format, int32_t& pixFormat) { string trimmed = ConfigManagerUtil::trimString(format); bool success = true; if (!trimmed.compare("RGBA_8888")) { - pixFormat = HAL_PIXEL_FORMAT_RGBA_8888; + pixFormat = HAL_PIXEL_FORMAT_RGBA_8888; } else if (!trimmed.compare("YCRCB_420_SP")) { - pixFormat = HAL_PIXEL_FORMAT_YCRCB_420_SP; + pixFormat = HAL_PIXEL_FORMAT_YCRCB_420_SP; } else if (!trimmed.compare("YCBCR_422_I")) { - pixFormat = HAL_PIXEL_FORMAT_YCBCR_422_I; + pixFormat = HAL_PIXEL_FORMAT_YCBCR_422_I; } else { success = false; } @@ -79,21 +79,19 @@ bool ConfigManagerUtil::convertToPixelFormat(const string &format, return success; } - -bool ConfigManagerUtil::convertToMetadataTag(const char *name, - camera_metadata_tag &aTag) { +bool ConfigManagerUtil::convertToMetadataTag(const char* name, camera_metadata_tag& aTag) { if (!strcmp(name, "LENS_DISTORTION")) { - aTag = ANDROID_LENS_DISTORTION; + aTag = ANDROID_LENS_DISTORTION; } else if (!strcmp(name, "LENS_INTRINSIC_CALIBRATION")) { - aTag = ANDROID_LENS_INTRINSIC_CALIBRATION; + aTag = ANDROID_LENS_INTRINSIC_CALIBRATION; } else if (!strcmp(name, "LENS_POSE_ROTATION")) { - aTag = ANDROID_LENS_POSE_ROTATION; + aTag = ANDROID_LENS_POSE_ROTATION; } else if (!strcmp(name, "LENS_POSE_TRANSLATION")) { - aTag = ANDROID_LENS_POSE_TRANSLATION; + aTag = ANDROID_LENS_POSE_TRANSLATION; } else if (!strcmp(name, "REQUEST_AVAILABLE_CAPABILITIES")) { - aTag = ANDROID_REQUEST_AVAILABLE_CAPABILITIES; + aTag = ANDROID_REQUEST_AVAILABLE_CAPABILITIES; } else if (!strcmp(name, "LOGICAL_MULTI_CAMERA_PHYSICAL_IDS")) { - aTag = ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS; + aTag = ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS; } else { return false; } @@ -101,11 +99,8 @@ bool ConfigManagerUtil::convertToMetadataTag(const char *name, return true; } - bool ConfigManagerUtil::convertToCameraCapability( - const char *name, - camera_metadata_enum_android_request_available_capabilities_t &cap) { - + const char* name, camera_metadata_enum_android_request_available_capabilities_t& cap) { if (!strcmp(name, "DEPTH_OUTPUT")) { cap = ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT; } else if (!strcmp(name, "LOGICAL_MULTI_CAMERA")) { @@ -121,14 +116,13 @@ bool ConfigManagerUtil::convertToCameraCapability( return true; } - -float *ConfigManagerUtil::convertFloatArray(const char *sz, const char *vals, - size_t &count, const char delimiter) { +float* ConfigManagerUtil::convertFloatArray(const char* sz, const char* vals, size_t& count, + const char delimiter) { string size_string(sz); string value_string(vals); count = stoi(size_string); - float *result = new float[count]; + float* result = new float[count]; stringstream values(value_string); int32_t idx = 0; @@ -140,8 +134,7 @@ float *ConfigManagerUtil::convertFloatArray(const char *sz, const char *vals, return result; } - -string ConfigManagerUtil::trimString(const string &src, const string &ws) { +string ConfigManagerUtil::trimString(const string& src, const string& ws) { const auto s = src.find_first_not_of(ws); if (s == string::npos) { return ""; @@ -153,3 +146,4 @@ string ConfigManagerUtil::trimString(const string &src, const string &ws) { return src.substr(s, r); } +} // namespace android::hardware::automotive::evs::V1_1::implementation diff --git a/automotive/evs/1.1/default/ConfigManagerUtil.h b/automotive/evs/1.1/default/ConfigManagerUtil.h index 1710cac4f2..9d42ec1880 100644 --- a/automotive/evs/1.1/default/ConfigManagerUtil.h +++ b/automotive/evs/1.1/default/ConfigManagerUtil.h @@ -13,57 +13,48 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef CONFIG_MANAGER_UTIL_H -#define CONFIG_MANAGER_UTIL_H +#ifndef ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_CONFIGMANAGERUTIL_H +#define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_CONFIGMANAGERUTIL_H -#include -#include -#include #include +#include +#include +#include -using namespace std; -using ::android::hardware::automotive::evs::V1_1::CameraParam; - +namespace android::hardware::automotive::evs::V1_1::implementation { class ConfigManagerUtil { -public: + public: /** * Convert a given string into V4L2_CID_* */ - static bool convertToEvsCameraParam(const string &id, - CameraParam &camParam); + static bool convertToEvsCameraParam(const std::string& id, CameraParam& camParam); /** * Convert a given string into android.hardware.graphics.common.PixelFormat */ - static bool convertToPixelFormat(const string &format, - int32_t &pixelFormat); + static bool convertToPixelFormat(const std::string& format, int32_t& pixelFormat); /** * Convert a given string into corresponding camera metadata data tag defined in * system/media/camera/include/system/camera_metadta_tags.h */ - static bool convertToMetadataTag(const char *name, - camera_metadata_tag &aTag); + static bool convertToMetadataTag(const char* name, camera_metadata_tag& aTag); /** * Convert a given string into a floating value array */ - static float *convertFloatArray(const char *sz, - const char *vals, - size_t &count, + static float* convertFloatArray(const char* sz, const char* vals, size_t& count, const char delimiter = ','); /** * Trim a string */ - static string trimString(const string &src, - const string &ws = " \n\r\t\f\v"); + static std::string trimString(const std::string& src, const std::string& ws = " \n\r\t\f\v"); /** * Convert a given string to corresponding camera capabilities */ static bool convertToCameraCapability( - const char *name, - camera_metadata_enum_android_request_available_capabilities_t &cap); - + const char* name, camera_metadata_enum_android_request_available_capabilities_t& cap); }; -#endif // CONFIG_MANAGER_UTIL_H +} // namespace android::hardware::automotive::evs::V1_1::implementation +#endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_CONFIGMANAGERUTIL_H diff --git a/automotive/evs/1.1/default/EvsCamera.cpp b/automotive/evs/1.1/default/EvsCamera.cpp index 0e69ed408b..b671c23252 100644 --- a/automotive/evs/1.1/default/EvsCamera.cpp +++ b/automotive/evs/1.1/default/EvsCamera.cpp @@ -14,69 +14,69 @@ * limitations under the License. */ -#define LOG_TAG "android.hardware.automotive.evs@1.1-service" - #include "EvsCamera.h" +#include "ConfigManager.h" #include "EvsEnumerator.h" #include #include #include -namespace android { -namespace hardware { -namespace automotive { -namespace evs { -namespace V1_1 { -namespace implementation { +namespace { +// 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; -// Special camera names for which we'll initialize alternate test data -const char EvsCamera::kCameraName_Backup[] = "backup"; +// 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 + 0xFF00FFFF, // yellow + 0xFFFFFF00, // cyan + 0xFF00FF00, // green + 0xFFFF00FF, // fuchsia + 0xFF0000FF, // red + 0xFFFF0000, // blue + 0xFF000000, // black +}; +constexpr uint32_t kNumColors = sizeof(kColors) / sizeof(kColors[0]); -// Arbitrary limit on number of graphics buffers allowed to be allocated -// Safeguards against unreasonable resource consumption and provides a testable limit -const unsigned MAX_BUFFERS_IN_FLIGHT = 100; +} // namespace +namespace android::hardware::automotive::evs::V1_1::implementation { -EvsCamera::EvsCamera(const char *id, - unique_ptr &camInfo) : - mFramesAllowed(0), - mFramesInUse(0), - mStreamState(STOPPED), - mCameraInfo(camInfo) { +using V1_0::EvsResult; - ALOGD("EvsCamera instantiated"); +EvsCamera::EvsCamera(const char* id, std::unique_ptr& camInfo) + : mFramesAllowed(0), mFramesInUse(0), mStreamState(STOPPED), mCameraInfo(camInfo) { + ALOGD("%s", __FUNCTION__); /* set a camera id */ mDescription.v1.cameraId = id; /* set camera metadata */ - mDescription.metadata.setToExternal((uint8_t *)camInfo->characteristics, + mDescription.metadata.setToExternal((uint8_t*)camInfo->characteristics, get_camera_metadata_size(camInfo->characteristics)); } - EvsCamera::~EvsCamera() { - ALOGD("EvsCamera being destroyed"); + ALOGD("%s", __FUNCTION__); forceShutdown(); } - -// // This gets called if another caller "steals" ownership of the camera -// -void EvsCamera::forceShutdown() -{ - ALOGD("EvsCamera forceShutdown"); +void EvsCamera::forceShutdown() { + ALOGD("%s", __FUNCTION__); // Make sure our output stream is cleaned up // (It really should be already) stopVideoStream(); // Claim the lock while we work on internal state - std::lock_guard lock(mAccessLock); + std::lock_guard lock(mAccessLock); // Drop all the graphics buffers we've been using if (mBuffers.size() > 0) { @@ -96,19 +96,18 @@ void EvsCamera::forceShutdown() mStreamState = DEAD; } - // Methods from ::android::hardware::automotive::evs::V1_0::IEvsCamera follow. Return EvsCamera::getCameraInfo(getCameraInfo_cb _hidl_cb) { - ALOGD("getCameraInfo"); + ALOGD("%s", __FUNCTION__); // Send back our self description _hidl_cb(mDescription.v1); - return Void(); + return {}; } - Return EvsCamera::setMaxFramesInFlight(uint32_t bufferCount) { - ALOGD("setMaxFramesInFlight"); + ALOGD("%s, bufferCount = %u", __FUNCTION__, bufferCount); + std::lock_guard lock(mAccessLock); // If we've been displaced by another owner of the camera, then we can't do anything else @@ -131,9 +130,9 @@ Return EvsCamera::setMaxFramesInFlight(uint32_t bufferCount) { } } +Return EvsCamera::startVideoStream(const ::android::sp& stream) { + ALOGD("%s", __FUNCTION__); -Return EvsCamera::startVideoStream(const ::android::sp& stream) { - ALOGD("startVideoStream"); std::lock_guard lock(mAccessLock); // If we've been displaced by another owner of the camera, then we can't do anything else @@ -141,82 +140,86 @@ Return EvsCamera::startVideoStream(const ::android::sp EvsCamera::doneWithFrame(const V1_0::BufferDesc& buffer) { + std::lock_guard lock(mAccessLock); + returnBufferLocked(buffer.bufferId, buffer.memHandle); -Return EvsCamera::doneWithFrame(const BufferDesc_1_0& buffer) { - std::lock_guard lock(mAccessLock); - returnBuffer(buffer.bufferId, buffer.memHandle); - - return Void(); + return {}; } +Return EvsCamera::stopVideoStream() { + ALOGD("%s", __FUNCTION__); + + std::unique_lock lock(mAccessLock); -Return EvsCamera::stopVideoStream() { - ALOGD("stopVideoStream"); - std::unique_lock lock(mAccessLock); + if (mStreamState != RUNNING) { + return {}; + } - if (mStreamState == RUNNING) { - // Tell the GenerateFrames loop we want it to stop - mStreamState = STOPPING; + // 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 - ALOGD("Waiting for stream thread to end..."); - lock.unlock(); + // 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 + ALOGD("Waiting for stream thread to end..."); + lock.unlock(); + if (mCaptureThread.joinable()) { mCaptureThread.join(); - lock.lock(); - - mStreamState = STOPPED; - mStream = nullptr; - ALOGD("Stream marked STOPPED."); } + lock.lock(); + + mStreamState = STOPPED; + mStream = nullptr; + ALOGD("Stream marked STOPPED."); - return Void(); + return {}; } +Return EvsCamera::getExtendedInfo(uint32_t opaqueIdentifier) { + ALOGD("%s", __FUNCTION__); -Return EvsCamera::getExtendedInfo(uint32_t opaqueIdentifier) { - ALOGD("getExtendedInfo"); std::lock_guard lock(mAccessLock); - - // For any single digit value, return the index itself as a test value - if (opaqueIdentifier <= 9) { - return opaqueIdentifier; + const auto it = mExtInfo.find(opaqueIdentifier); + if (it == mExtInfo.end()) { + // Return zero by default as required by the spec + return 0; + } else { + return it->second[0]; } - - // Return zero by default as required by the spec - return 0; } +Return EvsCamera::setExtendedInfo([[maybe_unused]] uint32_t opaqueIdentifier, + [[maybe_unused]] int32_t opaqueValue) { + ALOGD("%s", __FUNCTION__); -Return EvsCamera::setExtendedInfo(uint32_t /*opaqueIdentifier*/, int32_t /*opaqueValue*/) { - ALOGD("setExtendedInfo"); std::lock_guard lock(mAccessLock); // If we've been displaced by another owner of the camera, then we can't do anything else @@ -225,76 +228,73 @@ Return EvsCamera::setExtendedInfo(uint32_t /*opaqueIdentifier*/, int3 return EvsResult::OWNERSHIP_LOST; } - // We don't store any device specific information in this implementation - return EvsResult::INVALID_ARG; + mExtInfo.insert_or_assign(opaqueIdentifier, opaqueValue); + return EvsResult::OK; } - // Methods from ::android::hardware::automotive::evs::V1_1::IEvsCamera follow. Return EvsCamera::getCameraInfo_1_1(getCameraInfo_1_1_cb _hidl_cb) { - ALOGD("getCameraInfo_1_1"); + ALOGD("%s", __FUNCTION__); // Send back our self description _hidl_cb(mDescription); - return Void(); + return {}; } - -Return EvsCamera::getPhysicalCameraInfo(const hidl_string& id, +Return EvsCamera::getPhysicalCameraInfo([[maybe_unused]] const hidl_string& id, getCameraInfo_1_1_cb _hidl_cb) { ALOGD("%s", __FUNCTION__); // This works exactly same as getCameraInfo_1_1() in default implementation. - (void)id; _hidl_cb(mDescription); - return Void(); + return {}; } +Return EvsCamera::doneWithFrame_1_1(const hidl_vec& buffers) { + ALOGD("%s", __FUNCTION__); -Return EvsCamera::doneWithFrame_1_1(const hidl_vec& buffers) { - std::lock_guard lock(mAccessLock); - + std::lock_guard lock(mAccessLock); for (auto&& buffer : buffers) { - returnBuffer(buffer.bufferId, buffer.buffer.nativeHandle); + returnBufferLocked(buffer.bufferId, buffer.buffer.nativeHandle); } - return EvsResult::OK; } - Return EvsCamera::pauseVideoStream() { + ALOGD("%s", __FUNCTION__); // Default implementation does not support this. return EvsResult::UNDERLYING_SERVICE_ERROR; } - Return EvsCamera::resumeVideoStream() { + ALOGD("%s", __FUNCTION__); // Default implementation does not support this. return EvsResult::UNDERLYING_SERVICE_ERROR; } - Return EvsCamera::setMaster() { + ALOGD("%s", __FUNCTION__); // Default implementation does not expect multiple subscribers and therefore // return a success code always. return EvsResult::OK; } -Return EvsCamera::forceMaster(const sp& ) { +Return EvsCamera::forceMaster(const sp&) { + ALOGD("%s", __FUNCTION__); // Default implementation does not expect multiple subscribers and therefore // return a success code always. return EvsResult::OK; } - Return EvsCamera::unsetMaster() { + ALOGD("%s", __FUNCTION__); // Default implementation does not expect multiple subscribers and therefore // return a success code always. return EvsResult::OK; } - Return EvsCamera::getParameterList(getParameterList_cb _hidl_cb) { + ALOGD("%s", __FUNCTION__); hidl_vec hidlCtrls; hidlCtrls.resize(mCameraInfo->controls.size()); unsigned idx = 0; @@ -303,72 +303,132 @@ Return EvsCamera::getParameterList(getParameterList_cb _hidl_cb) { } _hidl_cb(hidlCtrls); - return Void(); + return {}; } - -Return EvsCamera::getIntParameterRange(CameraParam id, - getIntParameterRange_cb _hidl_cb) { - auto range = mCameraInfo->controls[id]; - _hidl_cb(get<0>(range), get<1>(range), get<2>(range)); - return Void(); +Return EvsCamera::getIntParameterRange(CameraParam id, getIntParameterRange_cb _hidl_cb) { + ALOGD("%s", __FUNCTION__); + auto it = mCameraInfo->controls.find(id); + if (it == mCameraInfo->controls.end()) { + _hidl_cb(0, 0, 0); + } else { + _hidl_cb(std::get<0>(it->second), std::get<1>(it->second), std::get<2>(it->second)); + } + return {}; } - Return EvsCamera::setIntParameter(CameraParam id, int32_t value, setIntParameter_cb _hidl_cb) { - // Default implementation does not support this. - (void)id; - (void)value; - _hidl_cb(EvsResult::INVALID_ARG, 0); - return Void(); + ALOGD("%s", __FUNCTION__); + mParams.insert_or_assign(id, value); + _hidl_cb(EvsResult::OK, {value}); + return {}; } - -Return EvsCamera::getIntParameter(CameraParam id, +Return EvsCamera::getIntParameter([[maybe_unused]] CameraParam id, getIntParameter_cb _hidl_cb) { - // Default implementation does not support this. - (void)id; - _hidl_cb(EvsResult::INVALID_ARG, 0); - return Void(); + ALOGD("%s", __FUNCTION__); + auto it = mParams.find(id); + std::vector values; + if (it == mParams.end()) { + _hidl_cb(EvsResult::INVALID_ARG, values); + } else { + values.push_back(it->second); + _hidl_cb(EvsResult::OK, values); + } + return {}; } - Return EvsCamera::setExtendedInfo_1_1(uint32_t opaqueIdentifier, const hidl_vec& opaqueValue) { - // Default implementation does not use an extended info. - (void)opaqueIdentifier; - (void)opaqueValue; - return EvsResult::INVALID_ARG; + ALOGD("%s", __FUNCTION__); + mExtInfo.insert_or_assign(opaqueIdentifier, opaqueValue); + return EvsResult::OK; } - Return EvsCamera::getExtendedInfo_1_1(uint32_t opaqueIdentifier, getExtendedInfo_1_1_cb _hidl_cb) { - // Default implementation does not use an extended info. - (void)opaqueIdentifier; - + ALOGD("%s", __FUNCTION__); + auto status = EvsResult::OK; hidl_vec value; - _hidl_cb(EvsResult::INVALID_ARG, value); - return Void(); + const auto it = mExtInfo.find(opaqueIdentifier); + if (it == mExtInfo.end()) { + status = EvsResult::INVALID_ARG; + } else { + value = it->second; + } + _hidl_cb(status, value); + return {}; } +Return EvsCamera::importExternalBuffers([[maybe_unused]] const hidl_vec& buffers, + importExternalBuffers_cb _hidl_cb) { + auto numBuffersToAdd = buffers.size(); + if (numBuffersToAdd < 1) { + ALOGD("No buffers to add"); + _hidl_cb(EvsResult::OK, mFramesAllowed); + return {}; + } -Return -EvsCamera::importExternalBuffers(const hidl_vec& /* buffers */, - importExternalBuffers_cb _hidl_cb) { - ALOGW("%s is not implemented yet.", __FUNCTION__); - _hidl_cb(EvsResult::UNDERLYING_SERVICE_ERROR, 0); - return {}; -} + { + std::scoped_lock lock(mAccessLock); + + if (numBuffersToAdd > (kMaxBuffersInFlight - mFramesAllowed)) { + numBuffersToAdd -= (kMaxBuffersInFlight - mFramesAllowed); + ALOGW("Exceed the limit on number of buffers. %" PRIu64 " buffers will be added only.", + numBuffersToAdd); + } + GraphicBufferMapper& mapper = GraphicBufferMapper::get(); + const auto before = mFramesAllowed; + for (auto i = 0; i < numBuffersToAdd; ++i) { + // TODO: reject if external buffer is configured differently. + auto& b = buffers[i]; + const AHardwareBuffer_Desc* pDesc = + reinterpret_cast(&b.buffer.description); + + // Import a buffer to add + buffer_handle_t memHandle = nullptr; + status_t result = + mapper.importBuffer(b.buffer.nativeHandle, pDesc->width, pDesc->height, 1, + pDesc->format, pDesc->usage, pDesc->stride, &memHandle); + if (result != android::NO_ERROR || !memHandle) { + ALOGW("Failed to import a buffer %d", b.bufferId); + continue; + } + + 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.emplace_back(memHandle); + } + + ++mFramesAllowed; + } + + _hidl_cb(EvsResult::OK, mFramesAllowed - before); + return {}; + } +} bool EvsCamera::setAvailableFrames_Locked(unsigned bufferCount) { - if (bufferCount < 1) { - ALOGE("Ignoring request to set buffer count to zero"); + if (bufferCount < kMinimumBuffersInFlight) { + ALOGE("Ignoring request to set buffer count below the minimum number of buffers to run a " + "video stream"); return false; } - if (bufferCount > MAX_BUFFERS_IN_FLIGHT) { + if (bufferCount > kMaxBuffersInFlight) { ALOGE("Rejecting buffer request in excess of internal limit"); return false; } @@ -403,17 +463,16 @@ bool EvsCamera::setAvailableFrames_Locked(unsigned bufferCount) { return true; } - unsigned EvsCamera::increaseAvailableFrames_Locked(unsigned numToAdd) { // Acquire the graphics buffer allocator - GraphicBufferAllocator &alloc(GraphicBufferAllocator::get()); + GraphicBufferAllocator& alloc(GraphicBufferAllocator::get()); unsigned added = 0; while (added < numToAdd) { buffer_handle_t memHandle = nullptr; - status_t result = alloc.allocate(mWidth, mHeight, mFormat, 1, mUsage, - &memHandle, &mStride, 0, "EvsCamera"); + status_t result = alloc.allocate(mWidth, mHeight, mFormat, 1, mUsage, &memHandle, &mStride, + 0, "EvsCamera"); if (result != NO_ERROR) { ALOGE("Error %d allocating %d x %d graphics buffer", result, mWidth, mHeight); break; @@ -436,7 +495,7 @@ unsigned EvsCamera::increaseAvailableFrames_Locked(unsigned numToAdd) { } if (!stored) { // Add a BufferRecord wrapping this handle to our set of available buffers - mBuffers.emplace_back(memHandle); + mBuffers.push_back(std::move(BufferRecord(memHandle))); } mFramesAllowed++; @@ -446,10 +505,9 @@ unsigned EvsCamera::increaseAvailableFrames_Locked(unsigned numToAdd) { return added; } - unsigned EvsCamera::decreaseAvailableFrames_Locked(unsigned numToRemove) { // Acquire the graphics buffer allocator - GraphicBufferAllocator &alloc(GraphicBufferAllocator::get()); + GraphicBufferAllocator& alloc(GraphicBufferAllocator::get()); unsigned removed = 0; @@ -472,14 +530,12 @@ unsigned EvsCamera::decreaseAvailableFrames_Locked(unsigned numToRemove) { 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 EvsCamera::generateFrames() { ALOGD("Frame generation loop started"); unsigned idx; - while (true) { bool timeForFrame = false; nsecs_t startTime = systemTime(SYSTEM_TIME_MONOTONIC); @@ -521,9 +577,9 @@ void EvsCamera::generateFrames() { if (timeForFrame) { // Assemble the buffer description we'll transmit below - BufferDesc_1_1 newBuffer = {}; + BufferDesc newBuffer = {}; AHardwareBuffer_Desc* pDesc = - reinterpret_cast(&newBuffer.buffer.description); + reinterpret_cast(&newBuffer.buffer.description); pDesc->width = mWidth; pDesc->height = mHeight; pDesc->layers = 1; @@ -534,19 +590,16 @@ void EvsCamera::generateFrames() { newBuffer.pixelSize = sizeof(uint32_t); newBuffer.bufferId = idx; newBuffer.deviceId = mDescription.v1.cameraId; - newBuffer.timestamp = elapsedRealtimeNano(); + newBuffer.timestamp = elapsedRealtimeNano() * 1e+3; // timestamps is in microseconds // Write test data into the image buffer fillTestFrame(newBuffer); // Issue the (asynchronous) callback to the client -- can't be holding the lock - hidl_vec frames; - frames.resize(1); - frames[0] = newBuffer; - auto result = mStream->deliverFrame_1_1(frames); + auto result = mStream->deliverFrame_1_1({newBuffer}); if (result.isOk()) { - ALOGD("Delivered %p as id %d", - newBuffer.buffer.nativeHandle.getNativeHandle(), newBuffer.bufferId); + ALOGD("Delivered %p as id %d", newBuffer.buffer.nativeHandle.getNativeHandle(), + newBuffer.bufferId); } else { // This can happen if the client dies and is likely unrecoverable. // To avoid consuming resources generating failing calls, we stop sending @@ -563,63 +616,50 @@ void EvsCamera::generateFrames() { } } - // We arbitrarily choose to generate frames at 12 fps to ensure we pass the 10fps test requirement - static const int kTargetFrameRate = 12; - static const nsecs_t kTargetFrameTimeUs = 1000*1000 / kTargetFrameRate; + // We arbitrarily choose to generate frames at 15 fps to ensure we pass the 10fps test + // requirement + static const int kTargetFrameRate = 15; + static const nsecs_t kTargetFrameIntervalUs = 1000 * 1000 / kTargetFrameRate; const nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); - const nsecs_t workTimeUs = (now - startTime) / 1000; - const nsecs_t sleepDurationUs = kTargetFrameTimeUs - workTimeUs; + const nsecs_t elapsedTimeUs = (now - startTime) / 1000; + const nsecs_t sleepDurationUs = kTargetFrameIntervalUs - elapsedTimeUs; if (sleepDurationUs > 0) { usleep(sleepDurationUs); } } // If we've been asked to stop, send an event to signal the actual end of stream - EvsEventDesc event; - event.aType = EvsEventType::STREAM_STOPPED; - auto result = mStream->notify(event); - if (!result.isOk()) { + EvsEventDesc event = { + .aType = EvsEventType::STREAM_STOPPED, + }; + if (!mStream->notify(event).isOk()) { ALOGE("Error delivering end of stream marker"); } return; } - -void EvsCamera::fillTestFrame(const BufferDesc_1_1& buff) { +void EvsCamera::fillTestFrame(const BufferDesc& buff) { // Lock our output buffer for writing - uint32_t *pixels = nullptr; + uint32_t* pixels = nullptr; const AHardwareBuffer_Desc* pDesc = - reinterpret_cast(&buff.buffer.description); - GraphicBufferMapper &mapper = GraphicBufferMapper::get(); + reinterpret_cast(&buff.buffer.description); + GraphicBufferMapper& mapper = GraphicBufferMapper::get(); mapper.lock(buff.buffer.nativeHandle, GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_NEVER, - android::Rect(pDesc->width, pDesc->height), - (void **) &pixels); + android::Rect(pDesc->width, pDesc->height), (void**)&pixels); // If we failed to lock the pixel buffer, we're about to crash, but log it first if (!pixels) { ALOGE("Camera failed to gain access to image buffer for writing"); + return; } - // Fill in the test pixels + // Fill in the test pixels; the colorbar in ABGR format for (unsigned row = 0; row < pDesc->height; row++) { for (unsigned col = 0; col < pDesc->width; col++) { - // Index into the row to check the pixel at this column. - // We expect 0xFF in the LSB channel, a vertical gradient in the - // second channel, a horitzontal gradient in the third channel, and - // 0xFF in the MSB. - // The exception is the very first 32 bits which is used for the - // time varying frame signature to avoid getting fooled by a static image. - uint32_t expectedPixel = 0xFF0000FF | // MSB and LSB - ((row & 0xFF) << 8) | // vertical gradient - ((col & 0xFF) << 16); // horizontal gradient - if ((row | col) == 0) { - static uint32_t sFrameTicker = 0; - expectedPixel = (sFrameTicker) & 0xFF; - sFrameTicker++; - } - pixels[col] = expectedPixel; + const uint32_t index = col * kNumColors / pDesc->width; + pixels[col] = kColors[index]; } // Point to the next row // NOTE: stride retrieved from gralloc is in units of pixels @@ -630,39 +670,35 @@ void EvsCamera::fillTestFrame(const BufferDesc_1_1& buff) { mapper.unlock(buff.buffer.nativeHandle); } - -void EvsCamera::fillTestFrame(const BufferDesc_1_0& buff) { - BufferDesc_1_1 newBufDesc = {}; - AHardwareBuffer_Desc desc = { - buff.width, // width - buff.height, // height - 1, // layers, always 1 for EVS - buff.format, // One of AHardwareBuffer_Format - buff.usage, // Combination of AHardwareBuffer_UsageFlags - buff.stride, // Row stride in pixels - 0, // Reserved - 0 // Reserved +void EvsCamera::fillTestFrame(const V1_0::BufferDesc& buff) { + BufferDesc newBuffer = { + .buffer.nativeHandle = buff.memHandle, + .pixelSize = buff.pixelSize, + .bufferId = buff.bufferId, }; - memcpy(&desc, &newBufDesc.buffer.description, sizeof(desc)); - newBufDesc.buffer.nativeHandle = buff.memHandle; - newBufDesc.pixelSize = buff.pixelSize; - newBufDesc.bufferId = buff.bufferId; - - return fillTestFrame(newBufDesc); + AHardwareBuffer_Desc* pDesc = + reinterpret_cast(&newBuffer.buffer.description); + *pDesc = { + buff.width, // width + buff.height, // height + 1, // layers, always 1 for EVS + buff.format, // One of AHardwareBuffer_Format + buff.usage, // Combination of AHardwareBuffer_UsageFlags + buff.stride, // Row stride in pixels + 0, // Reserved + 0 // Reserved + }; + return fillTestFrame(newBuffer); } - -void EvsCamera::returnBuffer(const uint32_t bufferId, const buffer_handle_t memHandle) { - std::lock_guard lock(mAccessLock); - +void EvsCamera::returnBufferLocked(const uint32_t bufferId, const buffer_handle_t memHandle) { if (memHandle == nullptr) { ALOGE("ignoring doneWithFrame called with null handle"); } else if (bufferId >= mBuffers.size()) { - ALOGE("ignoring doneWithFrame called with invalid bufferId %d (max is %zu)", - bufferId, mBuffers.size()-1); + ALOGE("ignoring doneWithFrame called with invalid bufferId %d (max is %zu)", bufferId, + mBuffers.size() - 1); } else if (!mBuffers[bufferId].inUse) { - ALOGE("ignoring doneWithFrame called on frame %d which is already free", - bufferId); + ALOGE("ignoring doneWithFrame called on frame %d which is already free", bufferId); } else { // Mark the frame as available mBuffers[bufferId].inUse = false; @@ -683,42 +719,33 @@ void EvsCamera::returnBuffer(const uint32_t bufferId, const buffer_handle_t memH } } - -sp EvsCamera::Create(const char *deviceName) { - unique_ptr nullCamInfo = nullptr; +sp EvsCamera::Create(const char* deviceName) { + std::unique_ptr nullCamInfo = nullptr; return Create(deviceName, nullCamInfo); } - -sp EvsCamera::Create(const char *deviceName, - unique_ptr &camInfo, - const Stream *streamCfg) { +sp EvsCamera::Create(const char* deviceName, + std::unique_ptr& camInfo, + [[maybe_unused]] const Stream* streamCfg) { sp evsCamera = new EvsCamera(deviceName, camInfo); if (evsCamera == nullptr) { return nullptr; } - /* default implementation does not use a given configuration */ - (void)streamCfg; - - /* Use the first resolution from the list for the testing */ + // Use the first resolution from the list for the testing + // TODO(b/214835237): Uses a given Stream configuration to choose the best + // stream configuration. auto it = camInfo->streamConfigurations.begin(); evsCamera->mWidth = it->second[1]; evsCamera->mHeight = it->second[2]; - evsCamera->mDescription.v1.vendorFlags = 0xFFFFFFFF; // Arbitrary test value + evsCamera->mDescription.v1.vendorFlags = 0xFFFFFFFF; // Arbitrary test value evsCamera->mFormat = HAL_PIXEL_FORMAT_RGBA_8888; - evsCamera->mUsage = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_CAMERA_WRITE | - GRALLOC_USAGE_SW_READ_RARELY | GRALLOC_USAGE_SW_WRITE_RARELY; + evsCamera->mUsage = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_CAMERA_WRITE | + GRALLOC_USAGE_SW_READ_RARELY | GRALLOC_USAGE_SW_WRITE_RARELY; return evsCamera; } - -} // namespace implementation -} // namespace V1_0 -} // namespace evs -} // namespace automotive -} // namespace hardware -} // namespace android +} // namespace android::hardware::automotive::evs::V1_1::implementation diff --git a/automotive/evs/1.1/default/EvsCamera.h b/automotive/evs/1.1/default/EvsCamera.h index 6163a34e08..1ea11869aa 100644 --- a/automotive/evs/1.1/default/EvsCamera.h +++ b/automotive/evs/1.1/default/EvsCamera.h @@ -17,91 +17,70 @@ #ifndef ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSCAMERA_H #define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSCAMERA_H -#include +#include "ConfigManager.h" + #include #include #include +#include #include #include -#include "ConfigManager.h" - -using BufferDesc_1_0 = ::android::hardware::automotive::evs::V1_0::BufferDesc; -using BufferDesc_1_1 = ::android::hardware::automotive::evs::V1_1::BufferDesc; -using IEvsCameraStream_1_0 = ::android::hardware::automotive::evs::V1_0::IEvsCameraStream; -using IEvsCameraStream_1_1 = ::android::hardware::automotive::evs::V1_1::IEvsCameraStream; -using ::android::hardware::automotive::evs::V1_0::EvsResult; -using ::android::hardware::automotive::evs::V1_0::CameraDesc; -using IEvsDisplay_1_0 = ::android::hardware::automotive::evs::V1_0::IEvsDisplay; -using IEvsDisplay_1_1 = ::android::hardware::automotive::evs::V1_1::IEvsDisplay; - - -namespace android { -namespace hardware { -namespace automotive { -namespace evs { -namespace V1_1 { -namespace implementation { - +namespace android::hardware::automotive::evs::V1_1::implementation { // From EvsEnumerator.h class EvsEnumerator; - class EvsCamera : public IEvsCamera { -public: + public: // Methods from ::android::hardware::automotive::evs::V1_0::IEvsCamera follow. - Return getCameraInfo(getCameraInfo_cb _hidl_cb) override; - Return setMaxFramesInFlight(uint32_t bufferCount) override; - Return startVideoStream(const ::android::sp& stream) override; - Return stopVideoStream() override; - Return doneWithFrame(const BufferDesc_1_0& buffer) override; + Return getCameraInfo(getCameraInfo_cb _hidl_cb) override; + Return setMaxFramesInFlight(uint32_t bufferCount) override; + Return startVideoStream(const sp& stream) override; + Return stopVideoStream() override; + Return doneWithFrame(const V1_0::BufferDesc& buffer) override; - Return getExtendedInfo(uint32_t opaqueIdentifier) override; - Return setExtendedInfo(uint32_t opaqueIdentifier, int32_t opaqueValue) override; + Return getExtendedInfo(uint32_t opaqueIdentifier) override; + Return setExtendedInfo(uint32_t opaqueIdentifier, + int32_t opaqueValue) override; // Methods from ::android::hardware::automotive::evs::V1_1::IEvsCamera follow. - Return getCameraInfo_1_1(getCameraInfo_1_1_cb _hidl_cb) override; - Return getPhysicalCameraInfo(const hidl_string& id, - getPhysicalCameraInfo_cb _hidl_cb) override; - Return pauseVideoStream() override; - Return resumeVideoStream() override; - Return doneWithFrame_1_1(const hidl_vec& buffer) override; - Return setMaster() override; - Return forceMaster(const sp& display) override; - Return unsetMaster() override; - Return getParameterList(getParameterList_cb _hidl_cb) override; - Return getIntParameterRange(CameraParam id, - getIntParameterRange_cb _hidl_cb) override; - Return setIntParameter(CameraParam id, int32_t value, - setIntParameter_cb _hidl_cb) override; - Return getIntParameter(CameraParam id, - getIntParameter_cb _hidl_cb) override; - Return setExtendedInfo_1_1(uint32_t opaqueIdentifier, - const hidl_vec& opaqueValue) override; - Return getExtendedInfo_1_1(uint32_t opaqueIdentifier, - getExtendedInfo_1_1_cb _hidl_cb) override; - Return importExternalBuffers(const hidl_vec& buffers, - importExternalBuffers_cb _hidl_cb) override; - - static sp Create(const char *deviceName); - static sp Create(const char *deviceName, - unique_ptr &camInfo, - const Stream *streamCfg = nullptr); + Return getCameraInfo_1_1(getCameraInfo_1_1_cb _hidl_cb) override; + Return getPhysicalCameraInfo(const hidl_string& id, + getPhysicalCameraInfo_cb _hidl_cb) override; + Return pauseVideoStream() override; + Return resumeVideoStream() override; + Return doneWithFrame_1_1(const hidl_vec& buffer) override; + Return setMaster() override; + Return forceMaster(const sp& display) override; + Return unsetMaster() override; + Return getParameterList(getParameterList_cb _hidl_cb) override; + Return getIntParameterRange(CameraParam id, getIntParameterRange_cb _hidl_cb) override; + Return setIntParameter(CameraParam id, int32_t value, + setIntParameter_cb _hidl_cb) override; + Return getIntParameter(CameraParam id, getIntParameter_cb _hidl_cb) override; + Return setExtendedInfo_1_1(uint32_t opaqueIdentifier, + const hidl_vec& opaqueValue) override; + Return getExtendedInfo_1_1(uint32_t opaqueIdentifier, + getExtendedInfo_1_1_cb _hidl_cb) override; + Return importExternalBuffers(const hidl_vec& buffers, + importExternalBuffers_cb _hidl_cb) override; + + static sp Create(const char* deviceName); + static sp Create(const char* deviceName, + std::unique_ptr& camInfo, + const Stream* streamCfg = nullptr); EvsCamera(const EvsCamera&) = delete; EvsCamera& operator=(const EvsCamera&) = delete; virtual ~EvsCamera() override; - void forceShutdown(); // This gets called if another caller "steals" ownership of the camera + void forceShutdown(); // This gets called if another caller "steals" ownership of the camera const CameraDesc& getDesc() { return mDescription; }; - static const char kCameraName_Backup[]; - -private: - EvsCamera(const char *id, - unique_ptr &camInfo); + private: + EvsCamera(const char* id, std::unique_ptr& camInfo); // These three functions are expected to be called while mAccessLock is held // bool setAvailableFrames_Locked(unsigned bufferCount); @@ -109,34 +88,34 @@ private: unsigned decreaseAvailableFrames_Locked(unsigned numToRemove); void generateFrames(); - void fillTestFrame(const BufferDesc_1_0& buff); - void fillTestFrame(const BufferDesc_1_1& buff); - void returnBuffer(const uint32_t bufferId, const buffer_handle_t memHandle); + void fillTestFrame(const V1_0::BufferDesc& buff); + void fillTestFrame(const BufferDesc& buff); + void returnBufferLocked(const uint32_t bufferId, const buffer_handle_t memHandle); sp mEnumerator; // The enumerator object that created this camera - CameraDesc mDescription = {}; // The properties of this camera + CameraDesc mDescription = {}; // The properties of this camera - std::thread mCaptureThread; // The thread we'll use to synthesize frames + std::thread mCaptureThread; // The thread we'll use to synthesize frames - uint32_t mWidth = 0; // Horizontal pixel count in the buffers - uint32_t mHeight = 0; // Vertical pixel count in the buffers - uint32_t mFormat = 0; // Values from android_pixel_format_t - uint64_t mUsage = 0; // Values from from Gralloc.h - uint32_t mStride = 0; // Bytes per line in the buffers + uint32_t mWidth = 0; // Horizontal pixel count in the buffers + uint32_t mHeight = 0; // Vertical pixel count in the buffers + uint32_t mFormat = 0; // Values from android_pixel_format_t + uint64_t mUsage = 0; // Values from from Gralloc.h + uint32_t mStride = 0; // Bytes per line in the buffers - sp mStream = nullptr; // The callback used to deliver each frame + sp mStream = nullptr; // The callback used to deliver each frame struct BufferRecord { buffer_handle_t handle; bool inUse; - explicit BufferRecord(buffer_handle_t h) : handle(h), inUse(false) {}; + explicit BufferRecord(buffer_handle_t h) : handle(h), inUse(false){}; }; - std::vector mBuffers; // Graphics buffers to transfer images - unsigned mFramesAllowed; // How many buffers are we currently using - unsigned mFramesInUse; // How many buffers are currently outstanding + std::vector 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, @@ -150,14 +129,13 @@ private: std::mutex mAccessLock; // Static camera module information - unique_ptr &mCameraInfo; + std::unique_ptr& mCameraInfo; + + // For the extended info + std::unordered_map> mExtInfo; + std::unordered_map mParams; }; -} // namespace implementation -} // namespace V1_1 -} // namespace evs -} // namespace automotive -} // namespace hardware -} // namespace android +} // namespace android::hardware::automotive::evs::V1_1::implementation #endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSCAMERA_H diff --git a/automotive/evs/1.1/default/EvsDisplay.cpp b/automotive/evs/1.1/default/EvsDisplay.cpp index 2b5a4a977c..f7169e5859 100644 --- a/automotive/evs/1.1/default/EvsDisplay.cpp +++ b/automotive/evs/1.1/default/EvsDisplay.cpp @@ -14,8 +14,6 @@ * limitations under the License. */ -#define LOG_TAG "android.hardware.automotive.evs@1.1-service" - #include "EvsDisplay.h" #include @@ -23,51 +21,53 @@ using ::android::frameworks::automotive::display::V1_0::HwDisplayConfig; using ::android::frameworks::automotive::display::V1_0::HwDisplayState; +using ::android::frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService; +using ::android::hardware::automotive::evs::V1_0::DisplayDesc; +using ::android::hardware::automotive::evs::V1_0::DisplayState; +using ::android::hardware::automotive::evs::V1_0::EvsResult; + +namespace { + + // Arbitrary magic number for self-recognition + constexpr uint32_t kDefaultDisplayBufferId = 0x3870; -namespace android { -namespace hardware { -namespace automotive { -namespace evs { -namespace V1_1 { -namespace implementation { +} // namespace +namespace android::hardware::automotive::evs::V1_1::implementation { EvsDisplay::EvsDisplay() { EvsDisplay(nullptr, 0); } - EvsDisplay::EvsDisplay(sp pDisplayProxy, uint64_t displayId) : mDisplayProxy(pDisplayProxy), - mDisplayId(displayId) { + mDisplayId(displayId), + mGlWrapper(std::make_unique()) { ALOGD("EvsDisplay instantiated"); // Set up our self description // NOTE: These are arbitrary values chosen for testing - mInfo.displayId = "Mock Display"; - mInfo.vendorFlags = 3870; + mInfo.displayId = "Mock Display"; + mInfo.vendorFlags = 3870; // Assemble the buffer description we'll use for our render target - mBuffer.width = 320; - mBuffer.height = 240; - mBuffer.format = HAL_PIXEL_FORMAT_RGBA_8888; - mBuffer.usage = GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER; - mBuffer.bufferId = 0x3870; // Arbitrary magic number for self recognition - mBuffer.pixelSize = 4; + mBuffer.width = 640; + mBuffer.height = 360; + mBuffer.format = HAL_PIXEL_FORMAT_RGBA_8888; + mBuffer.usage = GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER; + mBuffer.bufferId = kDefaultDisplayBufferId; + mBuffer.pixelSize = 4; } - EvsDisplay::~EvsDisplay() { ALOGD("EvsDisplay being destroyed"); forceShutdown(); } - /** * This gets called if another caller "steals" ownership of the display */ -void EvsDisplay::forceShutdown() -{ +void EvsDisplay::forceShutdown() { ALOGD("EvsDisplay forceShutdown"); std::lock_guard lock(mAccessLock); @@ -84,6 +84,11 @@ void EvsDisplay::forceShutdown() GraphicBufferAllocator& alloc(GraphicBufferAllocator::get()); alloc.free(mBuffer.memHandle); mBuffer.memHandle = nullptr; + + if (mGlWrapper) { + mGlWrapper->hideWindow(mDisplayProxy, mDisplayId); + mGlWrapper->shutdown(); + } } // Put this object into an unrecoverable error state since somebody else @@ -91,20 +96,18 @@ void EvsDisplay::forceShutdown() mRequestedState = DisplayState::DEAD; } - /** * Returns basic information about the EVS display provided by the system. * See the description of the DisplayDesc structure for details. */ -Return EvsDisplay::getDisplayInfo(getDisplayInfo_cb _hidl_cb) { +Return EvsDisplay::getDisplayInfo(getDisplayInfo_cb _hidl_cb) { ALOGD("getDisplayInfo"); // Send back our self description _hidl_cb(mInfo); - return Void(); + return {}; } - /** * Clients may set the display state to express their desired state. * The HAL implementation must gracefully accept a request for any state @@ -124,18 +127,28 @@ Return EvsDisplay::setDisplayState(DisplayState state) { } // Ensure we recognize the requested state so we don't go off the rails - if (state < DisplayState::NUM_STATES) { - // Record the requested state - mRequestedState = state; - return EvsResult::OK; - } - else { - // Turn off the display if asked for an unrecognized state - mRequestedState = DisplayState::NOT_VISIBLE; + if (state >= DisplayState::NUM_STATES) { return EvsResult::INVALID_ARG; } -} + if (!mGlWrapper) { + switch (state) { + case DisplayState::NOT_VISIBLE: + mGlWrapper->hideWindow(mDisplayProxy, mDisplayId); + break; + case DisplayState::VISIBLE: + mGlWrapper->showWindow(mDisplayProxy, mDisplayId); + break; + default: + break; + } + } + + // Record the requested state + mRequestedState = state; + + return EvsResult::OK; +} /** * The HAL implementation should report the actual current state, which might @@ -144,14 +157,13 @@ Return EvsDisplay::setDisplayState(DisplayState state) { * the device layer, making it undesirable for the HAL implementation to * spontaneously change display states. */ -Return EvsDisplay::getDisplayState() { +Return EvsDisplay::getDisplayState() { ALOGD("getDisplayState"); std::lock_guard lock(mAccessLock); return mRequestedState; } - /** * This call returns a handle to a frame buffer associated with the display. * This buffer may be locked and written to by software and/or GL. This buffer @@ -159,43 +171,55 @@ Return EvsDisplay::getDisplayState() { * display is no longer visible. */ // TODO: We need to know if/when our client dies so we can get the buffer back! (blocked b/31632518) -Return EvsDisplay::getTargetBuffer(getTargetBuffer_cb _hidl_cb) { +Return EvsDisplay::getTargetBuffer(getTargetBuffer_cb _hidl_cb) { ALOGD("getTargetBuffer"); std::lock_guard lock(mAccessLock); if (mRequestedState == DisplayState::DEAD) { ALOGE("Rejecting buffer request from object that lost ownership of the display."); - BufferDesc_1_0 nullBuff = {}; - _hidl_cb(nullBuff); - return Void(); + _hidl_cb({}); + return {}; } // If we don't already have a buffer, allocate one now if (!mBuffer.memHandle) { + // Initialize our display window + // NOTE: This will cause the display to become "VISIBLE" before a frame is actually + // returned, which is contrary to the spec and will likely result in a black frame being + // (briefly) shown. + if (mGlWrapper->initialize(mDisplayProxy, mDisplayId)) { + // Assemble the buffer description we'll use for our render target + mBuffer.width = mGlWrapper->getWidth(); + mBuffer.height = mGlWrapper->getHeight(); + mBuffer.format = HAL_PIXEL_FORMAT_RGBA_8888; + mBuffer.usage = GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER; + mBuffer.bufferId = kDefaultDisplayBufferId; + mBuffer.pixelSize = 4; + } else { + // If we failed to initialize a EGL, then we're not going to display + // any. + mGlWrapper = nullptr; + } + // Allocate the buffer that will hold our displayable image buffer_handle_t handle = nullptr; GraphicBufferAllocator& alloc(GraphicBufferAllocator::get()); - status_t result = alloc.allocate( - mBuffer.width, mBuffer.height, mBuffer.format, 1, mBuffer.usage, - &handle, &mBuffer.stride, 0, "EvsDisplay"); - if (result != NO_ERROR) { - ALOGE("Error %d allocating %d x %d graphics buffer", - result, mBuffer.width, mBuffer.height); - BufferDesc_1_0 nullBuff = {}; - _hidl_cb(nullBuff); - return Void(); - } - if (!handle) { - ALOGE("We didn't get a buffer handle back from the allocator"); - BufferDesc_1_0 nullBuff = {}; - _hidl_cb(nullBuff); - return Void(); + status_t result = alloc.allocate(mBuffer.width, mBuffer.height, mBuffer.format, 1, + mBuffer.usage, &handle, &mBuffer.stride, 0, "EvsDisplay"); + if (result != NO_ERROR || !handle) { + ALOGE("Error %d allocating %d x %d graphics buffer", result, mBuffer.width, + mBuffer.height); + if (mGlWrapper) { + mGlWrapper->shutdown(); + } + _hidl_cb({}); + return {}; } mBuffer.memHandle = handle; mFrameBusy = false; - ALOGD("Allocated new buffer %p with stride %u", - mBuffer.memHandle.getNativeHandle(), mBuffer.stride); + ALOGD("Allocated new buffer %p with stride %u", mBuffer.memHandle.getNativeHandle(), + mBuffer.stride); } // Do we have a frame available? @@ -205,41 +229,40 @@ Return EvsDisplay::getTargetBuffer(getTargetBuffer_cb _hidl_cb) { // a previously issued buffer yet (they're behaving badly). // NOTE: We have to make the callback even if we have nothing to provide ALOGE("getTargetBuffer called while no buffers available."); - BufferDesc_1_0 nullBuff = {}; - _hidl_cb(nullBuff); - return Void(); + _hidl_cb({}); + return {}; } else { // Mark our buffer as busy mFrameBusy = true; // Send the buffer to the client - ALOGD("Providing display buffer handle %p as id %d", - mBuffer.memHandle.getNativeHandle(), mBuffer.bufferId); + ALOGD("Providing display buffer handle %p as id %d", mBuffer.memHandle.getNativeHandle(), + mBuffer.bufferId); _hidl_cb(mBuffer); - return Void(); + return {}; } } - /** * This call tells the display that the buffer is ready for display. * The buffer is no longer valid for use by the client after this call. */ -Return EvsDisplay::returnTargetBufferForDisplayImpl(const uint32_t bufferId, const buffer_handle_t memHandle) { +Return EvsDisplay::returnTargetBufferForDisplayImpl(const uint32_t bufferId, + const buffer_handle_t memHandle) { ALOGD("returnTargetBufferForDisplay %p", memHandle); std::lock_guard lock(mAccessLock); // Nobody should call us with a null handle if (!memHandle) { - ALOGE ("returnTargetBufferForDisplay called without a valid buffer handle.\n"); + ALOGE("returnTargetBufferForDisplay called without a valid buffer handle.\n"); return EvsResult::INVALID_ARG; } if (bufferId != mBuffer.bufferId) { - ALOGE ("Got an unrecognized frame returned.\n"); + ALOGE("Got an unrecognized frame returned.\n"); return EvsResult::INVALID_ARG; } if (!mFrameBusy) { - ALOGE ("A frame was returned with no outstanding frames.\n"); + ALOGE("A frame was returned with no outstanding frames.\n"); return EvsResult::BUFFER_NOT_AVAILABLE; } @@ -253,23 +276,32 @@ Return EvsDisplay::returnTargetBufferForDisplayImpl(const uint32_t bu // If we were waiting for a new frame, this is it! if (mRequestedState == DisplayState::VISIBLE_ON_NEXT_FRAME) { mRequestedState = DisplayState::VISIBLE; + if (mGlWrapper) { + mGlWrapper->showWindow(mDisplayProxy, mDisplayId); + } } // Validate we're in an expected state if (mRequestedState != DisplayState::VISIBLE) { // We shouldn't get frames back when we're not visible. - ALOGE ("Got an unexpected frame returned while not visible - ignoring.\n"); - } else { + ALOGE("Got an unexpected frame returned while not visible - ignoring.\n"); + } else if (mGlWrapper) { // This is where the buffer would be made visible. - // For now we simply validate it has the data we expect in it by reading it back + if (!mGlWrapper->updateImageTexture(mBuffer)) { + return EvsResult::UNDERLYING_SERVICE_ERROR; + } + // Put the image on the screen + mGlWrapper->renderImageToScreen(); + } else { + // TODO: Move below validation logic to somewhere else +#if 0 + // For now we simply validate it has the data we expect in it by reading it back // Lock our display buffer for reading uint32_t* pixels = nullptr; - GraphicBufferMapper &mapper = GraphicBufferMapper::get(); - mapper.lock(mBuffer.memHandle, - GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_NEVER, - android::Rect(mBuffer.width, mBuffer.height), - (void **)&pixels); + GraphicBufferMapper& mapper = GraphicBufferMapper::get(); + mapper.lock(mBuffer.memHandle, GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_NEVER, + android::Rect(mBuffer.width, mBuffer.height), (void**)&pixels); // If we failed to lock the pixel buffer, we're about to crash, but log it first if (!pixels) { @@ -286,8 +318,8 @@ Return EvsDisplay::returnTargetBufferForDisplayImpl(const uint32_t bu // 0xFF in the MSB. // The exception is the very first 32 bits which is used for the // time varying frame signature to avoid getting fooled by a static image. - uint32_t expectedPixel = 0xFF0000FF | // MSB and LSB - ((row & 0xFF) << 8) | // vertical gradient + uint32_t expectedPixel = 0xFF0000FF | // MSB and LSB + ((row & 0xFF) << 8) | // vertical gradient ((col & 0xFF) << 16); // horizontal gradient if ((row | col) == 0) { // we'll check the "uniqueness" of the frame signature below @@ -318,39 +350,31 @@ Return EvsDisplay::returnTargetBufferForDisplayImpl(const uint32_t bu ALOGE("Duplicate, likely stale frame buffer detected"); } - // Release our output buffer mapper.unlock(mBuffer.memHandle); if (!frameLooksGood) { return EvsResult::UNDERLYING_SERVICE_ERROR; } +#endif } return EvsResult::OK; } - -Return EvsDisplay::returnTargetBufferForDisplay(const BufferDesc_1_0& buffer) { +Return EvsDisplay::returnTargetBufferForDisplay(const V1_0::BufferDesc& buffer) { return returnTargetBufferForDisplayImpl(buffer.bufferId, buffer.memHandle); } - Return EvsDisplay::getDisplayInfo_1_1(getDisplayInfo_1_1_cb _info_cb) { if (mDisplayProxy != nullptr) { return mDisplayProxy->getDisplayInfo(mDisplayId, _info_cb); } else { HwDisplayConfig nullConfig; - HwDisplayState nullState; + HwDisplayState nullState; _info_cb(nullConfig, nullState); - return Void(); + return {}; } } - -} // namespace implementation -} // namespace V1_1 -} // namespace evs -} // namespace automotive -} // namespace hardware -} // namespace android +} // namespace android::hardware::automotive::evs::V1_1::implementation diff --git a/automotive/evs/1.1/default/EvsDisplay.h b/automotive/evs/1.1/default/EvsDisplay.h index 9b2ed90128..b2ec3e82c4 100644 --- a/automotive/evs/1.1/default/EvsDisplay.h +++ b/automotive/evs/1.1/default/EvsDisplay.h @@ -17,64 +17,48 @@ #ifndef ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSDISPLAY_H #define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSDISPLAY_H -#include +#include "GlWrapper.h" + #include +#include #include -using ::android::hardware::automotive::evs::V1_1::IEvsDisplay; -using ::android::hardware::automotive::evs::V1_0::DisplayDesc; -using ::android::hardware::automotive::evs::V1_0::DisplayState; -using ::android::hardware::automotive::evs::V1_0::EvsResult; -using BufferDesc_1_0 = ::android::hardware::automotive::evs::V1_0::BufferDesc; -using android::frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService; - -namespace android { -namespace hardware { -namespace automotive { -namespace evs { -namespace V1_1 { -namespace implementation { - +namespace android::hardware::automotive::evs::V1_1::implementation { class EvsDisplay : public IEvsDisplay { -public: + public: // Methods from ::android::hardware::automotive::evs::V1_0::IEvsDisplay follow. - Return getDisplayInfo(getDisplayInfo_cb _hidl_cb) override; - Return setDisplayState(DisplayState state) override; - Return getDisplayState() override; - Return getTargetBuffer(getTargetBuffer_cb _hidl_cb) override; - Return returnTargetBufferForDisplay(const BufferDesc_1_0& buffer) override; + Return getDisplayInfo(getDisplayInfo_cb _hidl_cb) override; + Return setDisplayState(V1_0::DisplayState state) override; + Return getDisplayState() override; + Return getTargetBuffer(getTargetBuffer_cb _hidl_cb) override; + Return returnTargetBufferForDisplay(const V1_0::BufferDesc& buffer) override; // Methods from ::android::hardware::automotive::evs::V1_1::IEvsDisplay follow. - Return getDisplayInfo_1_1(getDisplayInfo_1_1_cb _info_cb) override; + Return getDisplayInfo_1_1(getDisplayInfo_1_1_cb _info_cb) override; // Implementation details EvsDisplay(); - EvsDisplay(sp pDisplayProxy, uint64_t displayId); + EvsDisplay( + sp pDisplayProxy, + uint64_t displayId); virtual ~EvsDisplay() override; - void forceShutdown(); // This gets called if another caller "steals" ownership of the display - Return returnTargetBufferForDisplayImpl(const uint32_t bufferId, - const buffer_handle_t memHandle); - -private: - DisplayDesc mInfo = {}; - BufferDesc_1_0 mBuffer = {}; // A graphics buffer into which we'll store images - - bool mFrameBusy = false; // A flag telling us our buffer is in use - DisplayState mRequestedState = DisplayState::NOT_VISIBLE; - - std::mutex mAccessLock; + void forceShutdown(); // This gets called if another caller "steals" ownership of the display + Return returnTargetBufferForDisplayImpl(const uint32_t bufferId, + const buffer_handle_t memHandle); - sp mDisplayProxy; - uint64_t mDisplayId; + private: + V1_0::DisplayDesc mInfo = {}; + V1_0::BufferDesc mBuffer = {}; // A graphics buffer into which we'll store images + V1_0::DisplayState mRequestedState = V1_0::DisplayState::NOT_VISIBLE; + bool mFrameBusy = false; // A flag telling us our buffer is in use + std::mutex mAccessLock; + sp mDisplayProxy; + uint64_t mDisplayId; + std::unique_ptr mGlWrapper; }; -} // namespace implementation -} // namespace V1_1 -} // namespace evs -} // namespace automotive -} // namespace hardware -} // namespace android +} // namespace android::hardware::automotive::evs::V1_1::implementation #endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSDISPLAY_H diff --git a/automotive/evs/1.1/default/EvsEnumerator.cpp b/automotive/evs/1.1/default/EvsEnumerator.cpp index d06647166f..b84268a15c 100644 --- a/automotive/evs/1.1/default/EvsEnumerator.cpp +++ b/automotive/evs/1.1/default/EvsEnumerator.cpp @@ -14,184 +14,171 @@ * limitations under the License. */ -#define LOG_TAG "android.hardware.automotive.evs@1.1-service" - #include "EvsEnumerator.h" #include "EvsCamera.h" #include "EvsDisplay.h" #include "EvsUltrasonicsArray.h" -namespace android { -namespace hardware { -namespace automotive { -namespace evs { -namespace V1_1 { -namespace implementation { +using android::frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService; +using android::hardware::automotive::evs::V1_0::EvsResult; + +namespace android::hardware::automotive::evs::V1_1::implementation { +namespace evs_v1_0 = ::android::hardware::automotive::evs::V1_0; // NOTE: All members values are static so that all clients operate on the same state // That is to say, this is effectively a singleton despite the fact that HIDL // constructs a new instance for each client. -std::list EvsEnumerator::sCameraList; -wp EvsEnumerator::sActiveDisplay; -unique_ptr EvsEnumerator::sConfigManager; -sp EvsEnumerator::sDisplayProxyService; -std::unordered_map EvsEnumerator::sDisplayPortList; -std::list EvsEnumerator::sUltrasonicsArrayRecordList; - -EvsEnumerator::EvsEnumerator(sp windowService) { - ALOGD("EvsEnumerator created"); +std::list EvsEnumerator::sCameraList; +wp EvsEnumerator::sActiveDisplay; +std::unique_ptr EvsEnumerator::sConfigManager; +sp EvsEnumerator::sDisplayProxyService; +std::unordered_map EvsEnumerator::sDisplayPortList; +std::list EvsEnumerator::sUltrasonicsArrayRecordList; +uint64_t EvsEnumerator::sInternalDisplayId; + +EvsEnumerator::EvsEnumerator(sp& windowService) { + ALOGD("%s", __FUNCTION__); // Add sample camera data to our list of cameras // In a real driver, this would be expected to can the available hardware sConfigManager = - ConfigManager::Create("/vendor/etc/automotive/evs/evs_default_configuration.xml"); + ConfigManager::Create("/vendor/etc/automotive/evs/evs_default_configuration.xml"); // Add available cameras for (auto v : sConfigManager->getCameraList()) { - sCameraList.emplace_back(v.c_str()); + CameraRecord rec(v.data()); + std::unique_ptr& pInfo = sConfigManager->getCameraInfo(v); + if (pInfo) { + rec.desc.metadata.setToExternal(reinterpret_cast(pInfo->characteristics), + get_camera_metadata_size(pInfo->characteristics)); + } + sCameraList.push_back(std::move(rec)); } - if (sDisplayProxyService == nullptr) { + if (!sDisplayProxyService) { /* sets a car-window service handle */ sDisplayProxyService = windowService; } // Add available displays - if (sDisplayProxyService != nullptr) { + if (sDisplayProxyService) { // Get a display ID list. - sDisplayProxyService->getDisplayIdList([](const auto& displayIds) { - for (const auto& id : displayIds) { - const auto port = id & 0xF; - sDisplayPortList.insert_or_assign(port, id); + auto status = sDisplayProxyService->getDisplayIdList([](const auto& displayIds) { + if (displayIds.size() > 0) { + sInternalDisplayId = displayIds[0]; + for (const auto& id : displayIds) { + const auto port = id & 0xF; + sDisplayPortList.insert_or_assign(port, id); + } } }); + + if (!status.isOk()) { + ALOGE("Failed to read a display list"); + } } // Add ultrasonics array desc. - sUltrasonicsArrayRecordList.emplace_back( - EvsUltrasonicsArray::GetMockArrayDesc("front_array")); + sUltrasonicsArrayRecordList.emplace_back(EvsUltrasonicsArray::GetMockArrayDesc("front_array")); } - // Methods from ::android::hardware::automotive::evs::V1_0::IEvsEnumerator follow. -Return EvsEnumerator::getCameraList(getCameraList_cb _hidl_cb) { - ALOGD("getCameraList"); +Return EvsEnumerator::getCameraList(getCameraList_cb _hidl_cb) { + ALOGD("%s", __FUNCTION__); - const unsigned numCameras = sCameraList.size(); + const auto numCameras = sCameraList.size(); // Build up a packed array of CameraDesc for return // NOTE: Only has to live until the callback returns - std::vector descriptions; + std::vector descriptions; descriptions.reserve(numCameras); for (const auto& cam : sCameraList) { - descriptions.push_back( cam.desc.v1 ); + descriptions.push_back(cam.desc.v1); } // Encapsulate our camera descriptions in the HIDL vec type - hidl_vec hidlCameras(descriptions); + hidl_vec hidlCameras(descriptions); // Send back the results ALOGD("reporting %zu cameras available", hidlCameras.size()); _hidl_cb(hidlCameras); - - // HIDL convention says we return Void if we sent our result back via callback - return Void(); + return {}; } - -Return> EvsEnumerator::openCamera(const hidl_string& cameraId) { - ALOGD("openCamera"); +Return> EvsEnumerator::openCamera(const hidl_string& cameraId) { + ALOGD("%s", __FUNCTION__); // Find the named camera - CameraRecord *pRecord = nullptr; - for (auto &&cam : sCameraList) { - if (cam.desc.v1.cameraId == cameraId) { - // Found a match! - pRecord = &cam; - break; - } - } - - // Is this a recognized camera id? - if (!pRecord) { + auto it = std::find_if(sCameraList.begin(), sCameraList.end(), [&cameraId](const auto& cam) { + return cameraId == cam.desc.v1.cameraId; + }); + if (it == sCameraList.end()) { ALOGE("Requested camera %s not found", cameraId.c_str()); return nullptr; } // Has this camera already been instantiated by another caller? - sp pActiveCamera = pRecord->activeInstance.promote(); + sp pActiveCamera = it->activeInstance.promote(); if (pActiveCamera != nullptr) { ALOGW("Killing previous camera because of new caller"); closeCamera(pActiveCamera); } // Construct a camera instance for the caller - if (sConfigManager == nullptr) { + if (!sConfigManager) { pActiveCamera = EvsCamera::Create(cameraId.c_str()); } else { - pActiveCamera = EvsCamera::Create(cameraId.c_str(), - sConfigManager->getCameraInfo(cameraId)); + pActiveCamera = + EvsCamera::Create(cameraId.c_str(), sConfigManager->getCameraInfo(cameraId)); } - pRecord->activeInstance = pActiveCamera; - if (pActiveCamera == nullptr) { + it->activeInstance = pActiveCamera; + if (!pActiveCamera) { ALOGE("Failed to allocate new EvsCamera object for %s\n", cameraId.c_str()); } return pActiveCamera; } +Return EvsEnumerator::closeCamera(const ::android::sp& pCamera) { + ALOGD("%s", __FUNCTION__); -Return EvsEnumerator::closeCamera(const ::android::sp& pCamera) { - ALOGD("closeCamera"); - - auto pCamera_1_1 = IEvsCamera_1_1::castFrom(pCamera).withDefault(nullptr); - if (pCamera_1_1 == nullptr) { + auto pCamera_1_1 = IEvsCamera::castFrom(pCamera).withDefault(nullptr); + if (!pCamera_1_1) { ALOGE("Ignoring call to closeCamera with null camera ptr"); - return Void(); + return {}; } // Get the camera id so we can find it in our list std::string cameraId; - pCamera_1_1->getCameraInfo_1_1([&cameraId](CameraDesc desc) { - cameraId = desc.v1.cameraId; - } - ); + pCamera_1_1->getCameraInfo_1_1([&cameraId](CameraDesc desc) { cameraId = desc.v1.cameraId; }); // Find the named camera - CameraRecord *pRecord = nullptr; - for (auto &&cam : sCameraList) { - if (cam.desc.v1.cameraId == cameraId) { - // Found a match! - pRecord = &cam; - break; - } + auto it = std::find_if(sCameraList.begin(), sCameraList.end(), [&cameraId](const auto& cam) { + return cameraId == cam.desc.v1.cameraId; + }); + if (it == sCameraList.end()) { + ALOGE("Ignores a request to close unknown camera, %s", cameraId.data()); + return {}; } - // Is the display being destroyed actually the one we think is active? - if (!pRecord) { - ALOGE("Asked to close a camera who's name isn't recognized"); + sp pActiveCamera = it->activeInstance.promote(); + if (!pActiveCamera) { + ALOGE("Somehow a camera is being destroyed when the enumerator didn't know one existed"); + } else if (pActiveCamera != pCamera_1_1) { + // This can happen if the camera was aggressively reopened, orphaning this previous instance + ALOGW("Ignoring close of previously orphaned camera - why did a client steal?"); } else { - sp pActiveCamera = pRecord->activeInstance.promote(); - - if (pActiveCamera == nullptr) { - ALOGE("Somehow a camera is being destroyed when the enumerator didn't know one existed"); - } else if (pActiveCamera != pCamera_1_1) { - // This can happen if the camera was aggressively reopened, orphaning this previous instance - ALOGW("Ignoring close of previously orphaned camera - why did a client steal?"); - } else { - // Drop the active camera - pActiveCamera->forceShutdown(); - pRecord->activeInstance = nullptr; - } + // Drop the active camera + pActiveCamera->forceShutdown(); + it->activeInstance = nullptr; } - return Void(); + return {}; } - -Return> EvsEnumerator::openDisplay() { - ALOGD("openDisplay"); +Return> EvsEnumerator::openDisplay() { + ALOGD("%s", __FUNCTION__); // If we already have a display active, then we need to shut it down so we can // give exclusive access to the new caller. @@ -202,28 +189,25 @@ Return> EvsEnumerator::openDisplay() { } // Create a new display interface and return it - pActiveDisplay = new EvsDisplay(); + pActiveDisplay = new EvsDisplay(sDisplayProxyService, sInternalDisplayId); sActiveDisplay = pActiveDisplay; ALOGD("Returning new EvsDisplay object %p", pActiveDisplay.get()); return pActiveDisplay; } - Return EvsEnumerator::getDisplayIdList(getDisplayIdList_cb _list_cb) { hidl_vec ids; - ids.resize(sDisplayPortList.size()); + unsigned i = 0; - for (const auto& [port, id] : sDisplayPortList) { - ids[i++] = port; - } + std::for_each(sDisplayPortList.begin(), sDisplayPortList.end(), + [&](const auto& element) { ids[i++] = element.first; }); _list_cb(ids); - return Void(); + return {}; } - Return> EvsEnumerator::openDisplay_1_1(uint8_t port) { ALOGD("%s", __FUNCTION__); @@ -243,10 +227,8 @@ Return> EvsEnumerator::openDisplay_1_1(uint8_t port) { return pActiveDisplay; } - - -Return EvsEnumerator::closeDisplay(const ::android::sp& pDisplay) { - ALOGD("closeDisplay"); +Return EvsEnumerator::closeDisplay(const ::android::sp& pDisplay) { + ALOGD("%s", __FUNCTION__); // Do we still have a display object we think should be active? sp pActiveDisplay = sActiveDisplay.promote(); @@ -260,123 +242,111 @@ Return EvsEnumerator::closeDisplay(const ::android::sp& p sActiveDisplay = nullptr; } - return Void(); + return {}; } - -Return EvsEnumerator::getDisplayState() { - ALOGD("getDisplayState"); +Return EvsEnumerator::getDisplayState() { + ALOGD("%s", __FUNCTION__); // Do we still have a display object we think should be active? sp pActiveDisplay = sActiveDisplay.promote(); if (pActiveDisplay != nullptr) { return pActiveDisplay->getDisplayState(); } else { - return DisplayState::NOT_OPEN; + return V1_0::DisplayState::NOT_OPEN; } } - // Methods from ::android::hardware::automotive::evs::V1_1::IEvsEnumerator follow. -Return EvsEnumerator::getCameraList_1_1(getCameraList_1_1_cb _hidl_cb) { - ALOGD("getCameraList"); +Return EvsEnumerator::getCameraList_1_1(getCameraList_1_1_cb _hidl_cb) { + ALOGD("%s", __FUNCTION__); - const unsigned numCameras = sCameraList.size(); + const auto numCameras = sCameraList.size(); // Build up a packed array of CameraDesc for return // NOTE: Only has to live until the callback returns - std::vector descriptions; + std::vector descriptions; descriptions.reserve(numCameras); - for (const auto& cam : sCameraList) { - descriptions.push_back( cam.desc ); - } + std::for_each(sCameraList.begin(), sCameraList.end(), + [&](const auto& cam) { descriptions.push_back(cam.desc); }); // Encapsulate our camera descriptions in the HIDL vec type - hidl_vec hidlCameras(descriptions); + hidl_vec hidlCameras(descriptions); // Send back the results ALOGD("reporting %zu cameras available", hidlCameras.size()); _hidl_cb(hidlCameras); - - // HIDL convention says we return Void if we sent our result back via callback - return Void(); + return {}; } -Return> -EvsEnumerator::openCamera_1_1(const hidl_string& cameraId, - const Stream& streamCfg) { - // Find the named camera - CameraRecord *pRecord = nullptr; - for (auto &&cam : sCameraList) { - if (cam.desc.v1.cameraId == cameraId) { - // Found a match! - pRecord = &cam; - break; - } - } +Return> EvsEnumerator::openCamera_1_1(const hidl_string& cameraId, + const Stream& streamCfg) { + ALOGD("%s", __FUNCTION__); - // Is this a recognized camera id? - if (!pRecord) { + // Find the named camera + auto it = std::find_if(sCameraList.begin(), sCameraList.end(), [&cameraId](const auto& cam) { + return cameraId == cam.desc.v1.cameraId; + }); + if (it == sCameraList.end()) { ALOGE("Requested camera %s not found", cameraId.c_str()); return nullptr; } // Has this camera already been instantiated by another caller? - sp pActiveCamera = pRecord->activeInstance.promote(); + sp pActiveCamera = it->activeInstance.promote(); if (pActiveCamera != nullptr) { ALOGW("Killing previous camera because of new caller"); closeCamera(pActiveCamera); } // Construct a camera instance for the caller - if (sConfigManager == nullptr) { + if (!sConfigManager) { pActiveCamera = EvsCamera::Create(cameraId.c_str()); } else { - pActiveCamera = EvsCamera::Create(cameraId.c_str(), - sConfigManager->getCameraInfo(cameraId), + pActiveCamera = EvsCamera::Create(cameraId.c_str(), sConfigManager->getCameraInfo(cameraId), &streamCfg); } - pRecord->activeInstance = pActiveCamera; - if (pActiveCamera == nullptr) { + it->activeInstance = pActiveCamera; + if (!pActiveCamera) { ALOGE("Failed to allocate new EvsCamera object for %s\n", cameraId.c_str()); } return pActiveCamera; } - EvsEnumerator::CameraRecord* EvsEnumerator::findCameraById(const std::string& cameraId) { - // Find the named camera - CameraRecord *pRecord = nullptr; - for (auto &&cam : sCameraList) { - if (cam.desc.v1.cameraId == cameraId) { - // Found a match! - pRecord = &cam; - break; - } - } + ALOGD("%s", __FUNCTION__); - return pRecord; + // Find the named camera + auto it = std::find_if(sCameraList.begin(), sCameraList.end(), [&cameraId](const auto& cam) { + return cameraId == cam.desc.v1.cameraId; + }); + return (it != sCameraList.end()) ? &*it : nullptr; } EvsEnumerator::UltrasonicsArrayRecord* EvsEnumerator::findUltrasonicsArrayById( const std::string& ultrasonicsArrayId) { - auto recordIt = std::find_if( - sUltrasonicsArrayRecordList.begin(), sUltrasonicsArrayRecordList.end(), - [&ultrasonicsArrayId](const UltrasonicsArrayRecord& record) { - return ultrasonicsArrayId == record.desc.ultrasonicsArrayId;}); + ALOGD("%s", __FUNCTION__); + + auto recordIt = + std::find_if(sUltrasonicsArrayRecordList.begin(), sUltrasonicsArrayRecordList.end(), + [&ultrasonicsArrayId](const UltrasonicsArrayRecord& record) { + return ultrasonicsArrayId == record.desc.ultrasonicsArrayId; + }); return (recordIt != sUltrasonicsArrayRecordList.end()) ? &*recordIt : nullptr; } Return EvsEnumerator::getUltrasonicsArrayList(getUltrasonicsArrayList_cb _hidl_cb) { + ALOGD("%s", __FUNCTION__); + hidl_vec desc; desc.resize(sUltrasonicsArrayRecordList.size()); // Copy over desc from sUltrasonicsArrayRecordList. for (auto p = std::make_pair(sUltrasonicsArrayRecordList.begin(), desc.begin()); - p.first != sUltrasonicsArrayRecordList.end(); p.first++, p.second++) { + p.first != sUltrasonicsArrayRecordList.end(); p.first++, p.second++) { *p.second = p.first->desc; } @@ -385,11 +355,13 @@ Return EvsEnumerator::getUltrasonicsArrayList(getUltrasonicsArrayList_cb _ _hidl_cb(desc); // HIDL convention says we return Void if we sent our result back via callback - return Void(); + return {}; } Return> EvsEnumerator::openUltrasonicsArray( const hidl_string& ultrasonicsArrayId) { + ALOGD("%s", __FUNCTION__); + // Find the named ultrasonic array. UltrasonicsArrayRecord* pRecord = findUltrasonicsArrayById(ultrasonicsArrayId); @@ -419,10 +391,11 @@ Return> EvsEnumerator::openUltrasonicsArray( Return EvsEnumerator::closeUltrasonicsArray( const sp& pEvsUltrasonicsArray) { + ALOGD("%s", __FUNCTION__); if (pEvsUltrasonicsArray.get() == nullptr) { ALOGE("Ignoring call to closeUltrasonicsArray with null ultrasonics array"); - return Void(); + return {}; } // Get the ultrasonics array id so we can find it in our list. @@ -435,7 +408,7 @@ Return EvsEnumerator::closeUltrasonicsArray( UltrasonicsArrayRecord* pRecord = findUltrasonicsArrayById(ultrasonicsArrayId); if (!pRecord) { ALOGE("Asked to close a ultrasonics array whose name isnt not found"); - return Void(); + return {}; } sp pActiveUltrasonicsArray = pRecord->activeInstance.promote(); @@ -453,12 +426,7 @@ Return EvsEnumerator::closeUltrasonicsArray( pRecord->activeInstance = nullptr; } - return Void(); + return {}; } -} // namespace implementation -} // namespace V1_1 -} // namespace evs -} // namespace automotive -} // namespace hardware -} // namespace android +} // namespace android::hardware::automotive::evs::V1_1::implementation diff --git a/automotive/evs/1.1/default/EvsEnumerator.h b/automotive/evs/1.1/default/EvsEnumerator.h index d80124b94e..513fc8dd02 100644 --- a/automotive/evs/1.1/default/EvsEnumerator.h +++ b/automotive/evs/1.1/default/EvsEnumerator.h @@ -17,56 +17,41 @@ #ifndef ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSCAMERAENUMERATOR_H #define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSCAMERAENUMERATOR_H -#include +#include "ConfigManager.h" + +#include #include #include -#include +#include #include #include -#include "ConfigManager.h" +namespace android::hardware::automotive::evs::V1_1::implementation { -using ::android::hardware::automotive::evs::V1_0::EvsResult; -using ::android::hardware::automotive::evs::V1_0::DisplayState; -using IEvsCamera_1_0 = ::android::hardware::automotive::evs::V1_0::IEvsCamera; -using IEvsCamera_1_1 = ::android::hardware::automotive::evs::V1_1::IEvsCamera; -using CameraDesc_1_0 = ::android::hardware::automotive::evs::V1_0::CameraDesc; -using CameraDesc_1_1 = ::android::hardware::automotive::evs::V1_1::CameraDesc; -using IEvsDisplay_1_0 = ::android::hardware::automotive::evs::V1_0::IEvsDisplay; -using IEvsDisplay_1_1 = ::android::hardware::automotive::evs::V1_1::IEvsDisplay; -using android::frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService; - -namespace android { -namespace hardware { -namespace automotive { -namespace evs { -namespace V1_1 { -namespace implementation { - - -class EvsCamera; // from EvsCamera.h -class EvsDisplay; // from EvsDisplay.h -class EvsUltrasonicsArray; // from EvsUltrasonicsArray.h +namespace evs_v1_0 = ::android::hardware::automotive::evs::V1_0; +class EvsCamera; // from EvsCamera.h +class EvsDisplay; // from EvsDisplay.h +class EvsUltrasonicsArray; // from EvsUltrasonicsArray.h class EvsEnumerator : public IEvsEnumerator { -public: + public: // Methods from ::android::hardware::automotive::evs::V1_0::IEvsEnumerator follow. - Return getCameraList(getCameraList_cb _hidl_cb) override; - Return> openCamera(const hidl_string& cameraId) override; - Return closeCamera(const ::android::sp& carCamera) override; - Return> openDisplay() override; - Return closeDisplay(const ::android::sp& display) override; - Return getDisplayState() override; + Return getCameraList(getCameraList_cb _hidl_cb) override; + Return> openCamera(const hidl_string& cameraId) override; + Return closeCamera(const ::android::sp& carCamera) override; + Return> openDisplay() override; + Return closeDisplay(const ::android::sp& display) override; + Return getDisplayState() override; // Methods from ::android::hardware::automotive::evs::V1_1::IEvsEnumerator follow. - Return getCameraList_1_1(getCameraList_1_1_cb _hidl_cb) override; - Return> openCamera_1_1(const hidl_string& cameraId, - const Stream& streamCfg) override; + Return getCameraList_1_1(getCameraList_1_1_cb _hidl_cb) override; + Return> openCamera_1_1(const hidl_string& cameraId, + const Stream& streamCfg) override; Return isHardware() override { return true; } - Return getDisplayIdList(getDisplayIdList_cb _list_cb) override; - Return> openDisplay_1_1(uint8_t port) override; + Return getDisplayIdList(getDisplayIdList_cb _list_cb) override; + Return> openDisplay_1_1(uint8_t port) override; Return getUltrasonicsArrayList(getUltrasonicsArrayList_cb _hidl_cb) override; Return> openUltrasonicsArray( const hidl_string& ultrasonicsArrayId) override; @@ -74,49 +59,40 @@ public: const ::android::sp& evsUltrasonicsArray) override; // Implementation details - EvsEnumerator(sp windowService = nullptr); + EvsEnumerator(sp& + windowService); -private: + private: // NOTE: All members values are static so that all clients operate on the same state // That is to say, this is effectively a singleton despite the fact that HIDL // constructs a new instance for each client. struct CameraRecord { - CameraDesc_1_1 desc; - wp activeInstance; + CameraDesc desc; + wp activeInstance; - CameraRecord(const char *cameraId) : desc() { desc.v1.cameraId = cameraId; } + CameraRecord(const char* cameraId) : desc() { desc.v1.cameraId = cameraId; } }; struct UltrasonicsArrayRecord { UltrasonicsArrayDesc desc; wp activeInstance; - UltrasonicsArrayRecord(const UltrasonicsArrayDesc& arrayDesc) : desc(arrayDesc) {}; + UltrasonicsArrayRecord(const UltrasonicsArrayDesc& arrayDesc) : desc(arrayDesc){}; }; static CameraRecord* findCameraById(const std::string& cameraId); - - static std::list sCameraList; - + static std::list sCameraList; static UltrasonicsArrayRecord* findUltrasonicsArrayById(const std::string& ultrasonicsArrayId); - static std::list sUltrasonicsArrayRecordList; - // Weak pointer. Object destructs if client dies. - static wp sActiveDisplay; - - static unique_ptr sConfigManager; - - static sp sDisplayProxyService; - static std::unordered_map sDisplayPortList; + static wp sActiveDisplay; // Weak pointer. Object destructs if client dies. + static uint64_t sInternalDisplayId; + static sp + sDisplayProxyService; + static std::unordered_map sDisplayPortList; + static std::unique_ptr sConfigManager; }; -} // namespace implementation -} // namespace V1_1 -} // namespace evs -} // namespace automotive -} // namespace hardware -} // namespace android +} // namespace android::hardware::automotive::evs::V1_1::implementation #endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_EVSCAMERAENUMERATOR_H diff --git a/automotive/evs/1.1/default/EvsUltrasonicsArray.cpp b/automotive/evs/1.1/default/EvsUltrasonicsArray.cpp index ebd47c618b..951937a147 100644 --- a/automotive/evs/1.1/default/EvsUltrasonicsArray.cpp +++ b/automotive/evs/1.1/default/EvsUltrasonicsArray.cpp @@ -113,10 +113,9 @@ bool fillMockDataFrame(UltrasonicsDataFrameDesc& dataFrameDesc, sp pIMe dataFrameDesc.receiversReadingsCountList = receiversReadingsCountList; const std::vector waveformDataList = { - {recvIdList[0], { {1000, 0.1f}, {2000, 0.8f} }}, - {recvIdList[1], { {1000, 0.1f}, {2000, 1.0f} }}, - {recvIdList[2], { {1000, 0.1f}, {2000, 0.2f}, {4000, 0.2f}, {5000, 0.1f} }} - }; + {recvIdList[0], {{1000, 0.1f}, {2000, 0.8f}}}, + {recvIdList[1], {{1000, 0.1f}, {2000, 1.0f}}}, + {recvIdList[2], {{1000, 0.1f}, {2000, 0.2f}, {4000, 0.2f}, {5000, 0.1f}}}}; if (pIMemory.get() == nullptr) { return false; diff --git a/automotive/evs/1.1/default/EvsUltrasonicsArray.h b/automotive/evs/1.1/default/EvsUltrasonicsArray.h index 88aa6003f6..681f68f721 100644 --- a/automotive/evs/1.1/default/EvsUltrasonicsArray.h +++ b/automotive/evs/1.1/default/EvsUltrasonicsArray.h @@ -119,7 +119,7 @@ class EvsUltrasonicsArray : public IEvsUltrasonicsArray { std::mutex mAccessLock; std::vector mDataFrames GUARDED_BY(mAccessLock); // Shared memory buffers. unsigned mFramesAllowed GUARDED_BY(mAccessLock); // How many buffers are we currently using. - unsigned mFramesInUse GUARDED_BY(mAccessLock); // How many buffers are currently outstanding. + unsigned mFramesInUse GUARDED_BY(mAccessLock); // How many buffers are currently outstanding. StreamStateValues mStreamState GUARDED_BY(mAccessLock); }; diff --git a/automotive/evs/1.1/default/GlWrapper.cpp b/automotive/evs/1.1/default/GlWrapper.cpp new file mode 100644 index 0000000000..357b67c48a --- /dev/null +++ b/automotive/evs/1.1/default/GlWrapper.cpp @@ -0,0 +1,450 @@ +/* + * 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. + */ + +#include "GlWrapper.h" + +#include +#include +#include + +#include +#include +#include +#include + +using android::GraphicBuffer; +using android::sp; + +namespace { + +// Defines a default color to clear the screen in RGBA format +constexpr float kDefaultColorInRgba[] = {0.1f, 0.5f, 0.1f, 1.0f}; + +// Defines the size of the preview area relative to the entire display +constexpr float kDisplayAreaRatio = 0.8f; + +constexpr const char vertexShaderSource[] = + "" + "#version 300 es \n" + "layout(location = 0) in vec4 pos; \n" + "layout(location = 1) in vec2 tex; \n" + "out vec2 uv; \n" + "void main() \n" + "{ \n" + " gl_Position = pos; \n" + " uv = tex; \n" + "} \n"; + +constexpr const char pixelShaderSource[] = + "#version 300 es \n" + "precision mediump float; \n" + "uniform sampler2D tex; \n" + "in vec2 uv; \n" + "out vec4 color; \n" + "void main() \n" + "{ \n" + " vec4 texel = texture(tex, uv); \n" + " color = texel; \n" + "} \n"; + +const char* getEGLError(void) { + switch (eglGetError()) { + case EGL_SUCCESS: + return "EGL_SUCCESS"; + case EGL_NOT_INITIALIZED: + return "EGL_NOT_INITIALIZED"; + case EGL_BAD_ACCESS: + return "EGL_BAD_ACCESS"; + case EGL_BAD_ALLOC: + return "EGL_BAD_ALLOC"; + case EGL_BAD_ATTRIBUTE: + return "EGL_BAD_ATTRIBUTE"; + case EGL_BAD_CONTEXT: + return "EGL_BAD_CONTEXT"; + case EGL_BAD_CONFIG: + return "EGL_BAD_CONFIG"; + case EGL_BAD_CURRENT_SURFACE: + return "EGL_BAD_CURRENT_SURFACE"; + case EGL_BAD_DISPLAY: + return "EGL_BAD_DISPLAY"; + case EGL_BAD_SURFACE: + return "EGL_BAD_SURFACE"; + case EGL_BAD_MATCH: + return "EGL_BAD_MATCH"; + case EGL_BAD_PARAMETER: + return "EGL_BAD_PARAMETER"; + case EGL_BAD_NATIVE_PIXMAP: + return "EGL_BAD_NATIVE_PIXMAP"; + case EGL_BAD_NATIVE_WINDOW: + return "EGL_BAD_NATIVE_WINDOW"; + case EGL_CONTEXT_LOST: + return "EGL_CONTEXT_LOST"; + default: + return "Unknown error"; + } +} + +// Given shader source, load and compile it +GLuint loadShader(GLenum type, const char* shaderSrc) { + // Create the shader object + GLuint shader = glCreateShader(type); + if (shader == 0) { + LOG(ERROR) << "glCreateSharder() failed with error = " << glGetError(); + return 0; + } + + // Load and compile the shader + glShaderSource(shader, 1, &shaderSrc, nullptr); + glCompileShader(shader); + + // Verify the compilation worked as expected + GLint compiled = 0; + glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled); + if (!compiled) { + LOG(ERROR) << "Error compiling shader"; + + GLint size = 0; + glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &size); + if (size > 0) { + // Get and report the error message + char infoLog[size]; + glGetShaderInfoLog(shader, size, nullptr, infoLog); + LOG(ERROR) << " msg:" << std::endl << infoLog; + } + + glDeleteShader(shader); + return 0; + } + + return shader; +} + +// Create a program object given vertex and pixels shader source +GLuint buildShaderProgram(const char* vtxSrc, const char* pxlSrc) { + GLuint program = glCreateProgram(); + if (program == 0) { + LOG(ERROR) << "Failed to allocate program object"; + return 0; + } + + // Compile the shaders and bind them to this program + GLuint vertexShader = loadShader(GL_VERTEX_SHADER, vtxSrc); + if (vertexShader == 0) { + LOG(ERROR) << "Failed to load vertex shader"; + glDeleteProgram(program); + return 0; + } + GLuint pixelShader = loadShader(GL_FRAGMENT_SHADER, pxlSrc); + if (pixelShader == 0) { + LOG(ERROR) << "Failed to load pixel shader"; + glDeleteProgram(program); + glDeleteShader(vertexShader); + return 0; + } + glAttachShader(program, vertexShader); + glAttachShader(program, pixelShader); + + // Link the program + glLinkProgram(program); + GLint linked = 0; + glGetProgramiv(program, GL_LINK_STATUS, &linked); + if (!linked) { + LOG(ERROR) << "Error linking program"; + GLint size = 0; + glGetProgramiv(program, GL_INFO_LOG_LENGTH, &size); + if (size > 0) { + // Get and report the error message + char* infoLog = (char*)malloc(size); + glGetProgramInfoLog(program, size, nullptr, infoLog); + LOG(ERROR) << " msg: " << infoLog; + free(infoLog); + } + + glDeleteProgram(program); + glDeleteShader(vertexShader); + glDeleteShader(pixelShader); + return 0; + } + + return program; +} + +} // namespace + +namespace android::hardware::automotive::evs::V1_1::implementation { + +// Main entry point +bool GlWrapper::initialize(const sp& service, uint64_t displayId) { + LOG(DEBUG) << __FUNCTION__; + + if (!service) { + LOG(WARNING) << "IAutomotiveDisplayProxyService is invalid."; + return false; + } + + // We will use the first display in the list as the primary. + service->getDisplayInfo(displayId, [this](auto dpyConfig, auto dpyState) { + ui::DisplayMode* pConfig = reinterpret_cast(dpyConfig.data()); + mWidth = pConfig->resolution.getWidth(); + mHeight = pConfig->resolution.getHeight(); + + ui::DisplayState* pState = reinterpret_cast(dpyState.data()); + if (pState->orientation != ui::ROTATION_0 && pState->orientation != ui::ROTATION_180) { + // rotate + std::swap(mWidth, mHeight); + } + + LOG(DEBUG) << "Display resolution is " << mWidth << " x " << mHeight; + }); + + mGfxBufferProducer = service->getIGraphicBufferProducer(displayId); + if (mGfxBufferProducer == nullptr) { + LOG(ERROR) << "Failed to get IGraphicBufferProducer from IAutomotiveDisplayProxyService."; + return false; + } + + mSurfaceHolder = getSurfaceFromHGBP(mGfxBufferProducer); + if (mSurfaceHolder == nullptr) { + LOG(ERROR) << "Failed to get a Surface from HGBP."; + return false; + } + + mWindow = getNativeWindow(mSurfaceHolder.get()); + if (mWindow == nullptr) { + LOG(ERROR) << "Failed to get a native window from Surface."; + return false; + } + + // Set up our OpenGL ES context associated with the default display + mDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); + if (mDisplay == EGL_NO_DISPLAY) { + LOG(ERROR) << "Failed to get egl display"; + return false; + } + + EGLint major = 3; + EGLint minor = 0; + if (!eglInitialize(mDisplay, &major, &minor)) { + LOG(ERROR) << "Failed to initialize EGL: " << getEGLError(); + return false; + } + + const EGLint config_attribs[] = { + // Tag Value + EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_DEPTH_SIZE, 0, EGL_NONE}; + + // Pick the default configuration without constraints (is this good enough?) + EGLConfig egl_config = {0}; + EGLint numConfigs = -1; + eglChooseConfig(mDisplay, config_attribs, &egl_config, 1, &numConfigs); + if (numConfigs != 1) { + LOG(ERROR) << "Didn't find a suitable format for our display window"; + return false; + } + + // Create the EGL render target surface + mSurface = eglCreateWindowSurface(mDisplay, egl_config, mWindow, nullptr); + if (mSurface == EGL_NO_SURFACE) { + LOG(ERROR) << "eglCreateWindowSurface failed: " << getEGLError(); + ; + return false; + } + + // Create the EGL context + // NOTE: Our shader is (currently at least) written to require version 3, so this + // is required. + const EGLint context_attribs[] = {EGL_CONTEXT_CLIENT_VERSION, 3, EGL_NONE}; + mContext = eglCreateContext(mDisplay, egl_config, EGL_NO_CONTEXT, context_attribs); + if (mContext == EGL_NO_CONTEXT) { + LOG(ERROR) << "Failed to create OpenGL ES Context: " << getEGLError(); + return false; + } + + // Activate our render target for drawing + if (!eglMakeCurrent(mDisplay, mSurface, mSurface, mContext)) { + LOG(ERROR) << "Failed to make the OpenGL ES Context current: " << getEGLError(); + return false; + } + + // Create the shader program for our simple pipeline + mShaderProgram = buildShaderProgram(vertexShaderSource, pixelShaderSource); + if (!mShaderProgram) { + LOG(ERROR) << "Failed to build shader program: " << getEGLError(); + return false; + } + + // Create a GL texture that will eventually wrap our externally created texture surface(s) + glGenTextures(1, &mTextureMap); + if (mTextureMap <= 0) { + LOG(ERROR) << "Didn't get a texture handle allocated: " << getEGLError(); + return false; + } + + // Turn off mip-mapping for the created texture surface + // (the inbound camera imagery doesn't have MIPs) + glBindTexture(GL_TEXTURE_2D, mTextureMap); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glBindTexture(GL_TEXTURE_2D, 0); + + return true; +} + +void GlWrapper::shutdown() { + // Drop our device textures + if (mKHRimage != EGL_NO_IMAGE_KHR) { + eglDestroyImageKHR(mDisplay, mKHRimage); + mKHRimage = EGL_NO_IMAGE_KHR; + } + + // Release all GL resources + eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + eglDestroySurface(mDisplay, mSurface); + eglDestroyContext(mDisplay, mContext); + eglTerminate(mDisplay); + mSurface = EGL_NO_SURFACE; + mContext = EGL_NO_CONTEXT; + mDisplay = EGL_NO_DISPLAY; + + // Release the window + mSurfaceHolder = nullptr; +} + +void GlWrapper::showWindow(sp& service, uint64_t id) { + if (service != nullptr) { + service->showWindow(id); + } else { + LOG(ERROR) << "IAutomotiveDisplayProxyService is not available."; + } +} + +void GlWrapper::hideWindow(sp& service, uint64_t id) { + if (service != nullptr) { + service->hideWindow(id); + } else { + LOG(ERROR) << "IAutomotiveDisplayProxyService is not available."; + } +} + +bool GlWrapper::updateImageTexture(const V1_0::BufferDesc& buffer) { + BufferDesc newBuffer = { + .buffer = + { + .nativeHandle = buffer.memHandle, + }, + .pixelSize = buffer.pixelSize, + .bufferId = buffer.bufferId, + }; + AHardwareBuffer_Desc* pDesc = + reinterpret_cast(&newBuffer.buffer.description); + *pDesc = { + .width = buffer.width, + .height = buffer.height, + .layers = 1, + .format = buffer.format, + .usage = buffer.usage, + }; + return updateImageTexture(newBuffer); +} + +bool GlWrapper::updateImageTexture(const BufferDesc& aFrame) { + // If we haven't done it yet, create an "image" object to wrap the gralloc buffer + if (mKHRimage == EGL_NO_IMAGE_KHR) { + // create a temporary GraphicBuffer to wrap the provided handle + const AHardwareBuffer_Desc* pDesc = + reinterpret_cast(&aFrame.buffer.description); + sp pGfxBuffer = new GraphicBuffer( + pDesc->width, pDesc->height, pDesc->format, pDesc->layers, pDesc->usage, + pDesc->stride, + const_cast(aFrame.buffer.nativeHandle.getNativeHandle()), + false /* keep ownership */ + ); + if (pGfxBuffer.get() == nullptr) { + LOG(ERROR) << "Failed to allocate GraphicBuffer to wrap our native handle"; + return false; + } + + // Get a GL compatible reference to the graphics buffer we've been given + EGLint eglImageAttributes[] = {EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE}; + EGLClientBuffer cbuf = static_cast(pGfxBuffer->getNativeBuffer()); + mKHRimage = eglCreateImageKHR(mDisplay, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID, cbuf, + eglImageAttributes); + if (mKHRimage == EGL_NO_IMAGE_KHR) { + LOG(ERROR) << "Error creating EGLImage: " << getEGLError(); + return false; + } + + // Update the texture handle we already created to refer to this gralloc buffer + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, mTextureMap); + glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, static_cast(mKHRimage)); + } + + return true; +} + +void GlWrapper::renderImageToScreen() { + // Set the viewport + glViewport(0, 0, mWidth, mHeight); + + // Clear the color buffer + glClearColor(kDefaultColorInRgba[0], kDefaultColorInRgba[1], + kDefaultColorInRgba[2], kDefaultColorInRgba[3]); + glClear(GL_COLOR_BUFFER_BIT); + + // Select our screen space simple texture shader + glUseProgram(mShaderProgram); + + // Bind the texture and assign it to the shader's sampler + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, mTextureMap); + GLint sampler = glGetUniformLocation(mShaderProgram, "tex"); + glUniform1i(sampler, 0); + + // We want our image to show up opaque regardless of alpha values + glDisable(GL_BLEND); + + // Draw a rectangle on the screen + GLfloat vertsCarPos[] = { + -kDisplayAreaRatio, kDisplayAreaRatio, 0.0f, // left top in window space + kDisplayAreaRatio, kDisplayAreaRatio, 0.0f, // right top + -kDisplayAreaRatio, -kDisplayAreaRatio, 0.0f, // left bottom + kDisplayAreaRatio, -kDisplayAreaRatio, 0.0f // right bottom + }; + + // NOTE: We didn't flip the image in the texture, so V=0 is actually the top of the image + GLfloat vertsCarTex[] = { + 0.0f, 0.0f, // left top + 1.0f, 0.0f, // right top + 0.0f, 1.0f, // left bottom + 1.0f, 1.0f // right bottom + }; + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, vertsCarPos); + glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, vertsCarTex); + glEnableVertexAttribArray(0); + glEnableVertexAttribArray(1); + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + // Clean up and flip the rendered result to the front so it is visible + glDisableVertexAttribArray(0); + glDisableVertexAttribArray(1); + + glFinish(); + + eglSwapBuffers(mDisplay, mSurface); +} + +} // namespace android::hardware::automotive::evs::V1_1::implementation diff --git a/automotive/evs/1.1/default/GlWrapper.h b/automotive/evs/1.1/default/GlWrapper.h new file mode 100644 index 0000000000..44c206f8a6 --- /dev/null +++ b/automotive/evs/1.1/default/GlWrapper.h @@ -0,0 +1,78 @@ +/* + * 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 ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_DISPLAY_GLWRAPPER_H +#define ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_DISPLAY_GLWRAPPER_H + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace android::hardware::automotive::evs::V1_1::implementation { + +using frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService; +using hardware::graphics::bufferqueue::V2_0::IGraphicBufferProducer; + +class GlWrapper { + public: + GlWrapper() : mSurfaceHolder(android::SurfaceHolderUniquePtr(nullptr, nullptr)) {} + bool initialize(const sp& service, uint64_t displayId); + void shutdown(); + + bool updateImageTexture(const V1_0::BufferDesc& buffer); + bool updateImageTexture(const BufferDesc& buffer); + void renderImageToScreen(); + + void showWindow(sp& service, uint64_t id); + void hideWindow(sp& service, uint64_t id); + + unsigned getWidth() { return mWidth; }; + unsigned getHeight() { return mHeight; }; + + private: + sp mGfxBufferProducer; + + EGLDisplay mDisplay; + EGLSurface mSurface; + EGLContext mContext; + + unsigned mWidth = 0; + unsigned mHeight = 0; + + EGLImageKHR mKHRimage = EGL_NO_IMAGE_KHR; + + GLuint mTextureMap = 0; + GLuint mShaderProgram = 0; + + // 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 android::hardware::automotive::evs::V1_1::implementation + +#endif // ANDROID_HARDWARE_AUTOMOTIVE_EVS_V1_1_DISPLAY_GLWRAPPER_H diff --git a/automotive/evs/1.1/default/android.hardware.automotive.evs@1.1-service.rc b/automotive/evs/1.1/default/android.hardware.automotive.evs@1.1-service.rc index 284b3fda4e..5d4daf93cc 100644 --- a/automotive/evs/1.1/default/android.hardware.automotive.evs@1.1-service.rc +++ b/automotive/evs/1.1/default/android.hardware.automotive.evs@1.1-service.rc @@ -1,5 +1,8 @@ service vendor.evs-hal-mock /vendor/bin/hw/android.hardware.automotive.evs@1.1-service class hal - user automotive_evs - group automotive_evs - disabled + priority -20 + user graphics + group automotive_evs camera + onrestart restart automotive_display + onrestart restart evs_manager + disabled # will not automatically start with its class; must be explicitly started. diff --git a/automotive/evs/1.1/default/manifest_android.hardware.automotive.evs@1.1-service.xml b/automotive/evs/1.1/default/manifest_android.hardware.automotive.evs@1.1-service.xml index d4d9b17c05..d9757010e0 100644 --- a/automotive/evs/1.1/default/manifest_android.hardware.automotive.evs@1.1-service.xml +++ b/automotive/evs/1.1/default/manifest_android.hardware.automotive.evs@1.1-service.xml @@ -15,12 +15,8 @@ --> - android.hardware.automotive.evs hwbinder - 1.1 - - IEvsEnumerator - hw/0 - + android.hardware.automotive.evs + @1.1::IEvsEnumerator/hw/0 diff --git a/automotive/evs/1.1/default/resources/evs_default_configuration.xml b/automotive/evs/1.1/default/resources/evs_default_configuration.xml index a79e7c2b2d..6cbc18eacf 100644 --- a/automotive/evs/1.1/default/resources/evs_default_configuration.xml +++ b/automotive/evs/1.1/default/resources/evs_default_configuration.xml @@ -30,31 +30,8 @@ - - - - - - - - - - - - - - + diff --git a/automotive/evs/1.1/default/service.cpp b/automotive/evs/1.1/default/service.cpp index 374b646812..2764a26cc1 100644 --- a/automotive/evs/1.1/default/service.cpp +++ b/automotive/evs/1.1/default/service.cpp @@ -14,42 +14,42 @@ * limitations under the License. */ -#define LOG_TAG "android.hardware.automotive.evs@1.1-service" - -#include +#include "EvsDisplay.h" +#include "EvsEnumerator.h" +#include "ServiceNames.h" #include #include #include #include -#include "ServiceNames.h" -#include "EvsEnumerator.h" -#include "EvsDisplay.h" - +#include -// libhidl: +using android::frameworks::automotive::display::V1_0::IAutomotiveDisplayProxyService; using android::hardware::configureRpcThreadpool; using android::hardware::joinRpcThreadpool; - -// Generated HIDL files +using android::hardware::automotive::evs::V1_0::DisplayState; using android::hardware::automotive::evs::V1_1::IEvsEnumerator; - -// The namespace in which all our implementation code lives -using namespace android::hardware::automotive::evs::V1_1::implementation; -using namespace android; - +using android::hardware::automotive::evs::V1_1::implementation::EvsEnumerator; int main() { ALOGI("EVS Hardware Enumerator service is starting"); - android::sp service = new EvsEnumerator(); + + android::sp carWindowService = + IAutomotiveDisplayProxyService::getService("default"); + if (carWindowService == nullptr) { + ALOGE("Cannot use AutomotiveDisplayProxyService. Exiting."); + return EXIT_FAILURE; + } + + android::sp service = new EvsEnumerator(carWindowService); configureRpcThreadpool(1, true /* callerWillJoin */); // Register our service -- if somebody is already registered by our name, // they will be killed (their thread pool will throw an exception). - status_t status = service->registerAsService(kEnumeratorServiceName); - if (status == OK) { + auto status = service->registerAsService(kEnumeratorServiceName); + if (status == android::OK) { ALOGD("%s is ready.", kEnumeratorServiceName); joinRpcThreadpool(); } else { @@ -58,5 +58,5 @@ int main() { // In normal operation, we don't expect the thread pool to exit ALOGE("EVS Hardware Enumerator is shutting down"); - return 1; + return EXIT_SUCCESS; } -- GitLab From 339f0aca2067ac51b162c55ab7655603960f5fe3 Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Sun, 30 Jan 2022 22:19:32 -0800 Subject: [PATCH 546/825] Explicitly type cast a variable Fix: 217126594 Test: Successful build aosp_x86-eng target Change-Id: I8b9b4051c4296fd3ecf0b89b1d1352020db02d5a --- automotive/evs/1.1/default/EvsCamera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automotive/evs/1.1/default/EvsCamera.cpp b/automotive/evs/1.1/default/EvsCamera.cpp index b671c23252..520670a5d6 100644 --- a/automotive/evs/1.1/default/EvsCamera.cpp +++ b/automotive/evs/1.1/default/EvsCamera.cpp @@ -376,7 +376,7 @@ Return EvsCamera::importExternalBuffers([[maybe_unused]] const hidl_vec (kMaxBuffersInFlight - mFramesAllowed)) { numBuffersToAdd -= (kMaxBuffersInFlight - mFramesAllowed); ALOGW("Exceed the limit on number of buffers. %" PRIu64 " buffers will be added only.", - numBuffersToAdd); + static_cast(numBuffersToAdd)); } GraphicBufferMapper& mapper = GraphicBufferMapper::get(); -- GitLab From 795025ebd9fffa5acd8c2ce95004e0b05c9923d5 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Mon, 31 Jan 2022 08:47:32 -0800 Subject: [PATCH 547/825] Require Power HAL v2 Test: build Signed-off-by: Wei Wang Change-Id: Ib6c4012afaa1f4544d8c11bc613e9c30adc3398d --- compatibility_matrices/compatibility_matrix.current.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index dacc846a67..95ba217fb0 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -511,7 +511,7 @@ android.hardware.power - 1-3 + 2-3 IPower default -- GitLab From 1b538f53638fd60ebf831c4f0dc9dd641cc7ab49 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Mon, 31 Jan 2022 10:25:08 -0800 Subject: [PATCH 548/825] uwb(hal): Remove FIRA params from the HAL interface Reworking based on vendor feedback. There is already some FIRA standards body activity to add this in the FIRA specifications. So, defer to that spec instead of redefinining it in the HAL interface. Bug: 208678993 Bug: 209053358 Test: Compiles Change-Id: I20c4ecb84d2efbecac76c40864d9f97cf9987da6 --- .../UwbVendorCapabilityTlvTypes.aidl | 18 --- .../UwbVendorCapabilityTlvValues.aidl | 37 ------ .../UwbVendorCapabilityTlvTypes.aidl | 118 +----------------- .../UwbVendorCapabilityTlvValues.aidl | 49 -------- 4 files changed, 3 insertions(+), 219 deletions(-) diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index dd673e2398..bc73b89ced 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -34,24 +34,6 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability enum UwbVendorCapabilityTlvTypes { - SUPPORTED_CHANNELS = 0, - SUPPORTED_AOA_MODES = 1, - SUPPORTED_DEVICE_ROLES = 2, - SUPPORTS_BLOCK_STRIDING = 3, - SUPPORTS_NON_DEFERRED_MODE = 4, - SUPPORTS_ADAPTIVE_PAYLOAD_POWER = 5, - INITIATION_TIME_MS = 6, - SUPPORTED_MAC_FCS_CRC_TYPES = 7, - SUPPORTED_MULTI_NODE_MODES = 8, - SUPPORTED_PREAMBLE_MODES = 9, - SUPPORTED_PRF_MODES = 10, - SUPPORTED_RANGING_ROUND_USAGE_MODES = 11, - SUPPORTED_RFRAME_MODES = 12, - SUPPORTED_SFD_IDS = 13, - SUPPORTED_STS_MODES = 14, - SUPPORTED_STS_SEGEMENTS = 15, - SUPPORTED_BPRF_PHR_DATA_RATES = 16, - SUPPORTED_PSDU_DATA_RATES = 17, CCC_SUPPORTED_VERSIONS = 160, CCC_SUPPORTED_UWB_CONFIGS = 161, CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 162, diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl index 9966d55427..ee47a138f7 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl @@ -34,43 +34,6 @@ package android.hardware.uwb.fira_android; @Backing(type="long") @VintfStability enum UwbVendorCapabilityTlvValues { - HAS_AZIMUTH_SUPPORT = 1, - HAS_ELEVATION_SUPPORT = 2, - HAS_FOM_SUPPORT = 4, - HAS_FULL_AZIMUTH_SUPPORT = 8, - HAS_CONTROLEE_INITIATOR_SUPPORT = 1, - HAS_CONTROLEE_RESPONDER_SUPPORT = 2, - HAS_CONTROLLER_INITIATOR_SUPPORT = 4, - HAS_CONTROLLER_RESPONDER_SUPPORT = 8, - HAS_CRC_16_SUPPORT = 1, - HAS_CRC_32_SUPPORT = 2, - HAS_UNICAST_SUPPORT = 1, - HAS_ONE_TO_MANY_SUPPORT = 2, - HAS_MANY_TO_MANY_SUPPORT = 4, - SUPPORTED_PREAMBLE_HAS_32_SYMBOLS_SUPPORT = 1, - SUPPORTED_PREAMBLE_HAS_64_SYMBOLS_SUPPORT = 2, - HAS_BPRF_SUPPORT = 1, - HAS_HPRF_SUPPORT = 2, - HAS_DS_TWR_SUPPORT = 1, - HAS_SS_TWR_SUPPORT = 2, - HAS_SP0_RFRAME_SUPPORT = 1, - HAS_SP1_RFRAME_SUPPORT = 2, - HAS_SP3_RFRAME_SUPPORT = 8, - HAS_SFD0_SUPPORT = 1, - HAS_SFD1_SUPPORT = 2, - HAS_SFD2_SUPPORT = 4, - HAS_SFD3_SUPPORT = 8, - HAS_SFD4_SUPPORT = 16, - HAS_STATIC_STS_SUPPORT = 1, - HAS_DYNAMIC_STS_SUPPORT = 2, - HAS_DYNAMIC_STS_INDIVIDUAL_CONTROLEE_KEY_SUPPORT = 4, - HAS_0_SEGMENT_SUPPORT = 1, - HAS_1_SEGMENT_SUPPORT = 2, - HAS_2_SEGMENT_SUPPORT = 4, - HAS_6M81_SUPPORT = 1, - HAS_850K_SUPPORT = 2, - HAS_27M2_SUPPORT = 4, - HAS_31M2_SUPPORT = 8, UWB_CONFIG_0 = 0, UWB_CONFIG_1 = 1, PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 1, diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index 7001842f00..968cd17884 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -20,127 +20,15 @@ package android.hardware.uwb.fira_android; * Android specific capability TLV types in UCI command: * GID: 0000b (UWB Core Group) * OID: 000011b (CORE_GET_CAPS_INFO_CMD) + * + * For FIRA params, please refer to params mentioned in CR 287. + * * Values expected for each type are mentioned in the docs below and the constants * used are defined in UwbVendorCapabilityTlvValues enum. */ @VintfStability @Backing(type="int") enum UwbVendorCapabilityTlvTypes { - /** byte array with list of supported channels */ - SUPPORTED_CHANNELS = 0x0, - /** - * int bitmask of supported AOA modes - * Values: - * HAS_AZIMUTH_SUPPORT = 1, - * HAS_ELEVATION_SUPPORT = (1 << 1) - * HAS_FOM_SUPPORT = (1 << 2) - * HAS_FULL_AZIMUTH_SUPPORT = (1 << 3) - */ - SUPPORTED_AOA_MODES = 0x1, - /** - * int bitmask of supported device roles - * Values: - * HAS_CONTROLEE_INITIATOR_SUPPORT = 1 - * HAS_CONTROLEE_RESPONDER_SUPPORT = (1 << 1) - * HAS_CONTROLLER_INITIATOR_SUPPORT = (1 << 2) - * HAS_CONTROLLER_RESPONDER_SUPPORT= (1 << 3) - */ - SUPPORTED_DEVICE_ROLES = 0x2, - /** byte value of 1 to indicate support for block striding */ - SUPPORTS_BLOCK_STRIDING = 0x3, - /** byte value of 1 to indicate support for non deferred mode */ - SUPPORTS_NON_DEFERRED_MODE = 0x4, - /** byte value of 1 to indicate support for adaptive payload power */ - SUPPORTS_ADAPTIVE_PAYLOAD_POWER = 0x5, - /** Int value for indicating initiation time */ - INITIATION_TIME_MS = 0x6, - /** - * int bitmask of supported mac fcs crc types - * Values: - * HAS_CRC_16_SUPPORT = 1 - * HAS_CRC_32_SUPPORT = (1 << 1) - */ - SUPPORTED_MAC_FCS_CRC_TYPES = 0x7, - /** - * int bitmask of supported multi node modes - * Values: - * HAS_UNICAST_SUPPORT = 1 - * HAS_ONE_TO_MANY_SUPPORT = (1 << 1) - * HAS_MANY_TO_MANY_SUPPORT = (1 << 2) - */ - SUPPORTED_MULTI_NODE_MODES = 0x8, - /** - * int bitmask of supported preamble modes - * Values: - * HAS_32_SYMBOLS_SUPPORT = 1 - * HAS_64_SYMBOLS_SUPPORT = (1 << 1) - */ - SUPPORTED_PREAMBLE_MODES = 0x9, - /** - * int bitmask of supported prf modes - * Values: - * HAS_BPRF_SUPPORT = 1 - * HAS_HPRF_SUPPORT = (1 << 1) - */ - SUPPORTED_PRF_MODES = 0xA, - /** - * int bitmask of supported ranging round usage modes - * Values: - * HAS_DS_TWR_SUPPORT = 1 - * HAS_SS_TWR_SUPPORT = (1 << 1) - */ - SUPPORTED_RANGING_ROUND_USAGE_MODES = 0xB, - /** - * int bitmask of supported rframe modes - * Values: - * HAS_SP0_RFRAME_SUPPORT = 1 - * HAS_SP1_RFRAME_SUPPORT = (1 << 1), - * HAS_SP3_RFRAME_SUPPORT = (1 << 3) - */ - SUPPORTED_RFRAME_MODES = 0xC, - /** - * int bitmask of supported sfd ids - * Values: - * HAS_SFD0_SUPPORT = 1 - * HAS_SFD1_SUPPORT = (1 << 1) - * HAS_SFD2_SUPPORT = (1 << 2) - * HAS_SFD3_SUPPORT = (1 << 3) - * HAS_SFD4_SUPPORT = (1 << 4) - */ - SUPPORTED_SFD_IDS = 0xD, - /** - * int bitmask of supported sts modes - * Values: - * HAS_STATIC_STS_SUPPORT = 1 - * HAS_DYNAMIC_STS_SUPPORT = (1 << 1) - * HAS_DYNAMIC_STS_INDIVIDUAL_CONTROLEE_KEY_SUPPORT = (1 << 2) - */ - SUPPORTED_STS_MODES = 0xE, - /** - * int bitmask of supported sts segments - * Values: - * HAS_0_SEGMENT_SUPPORT = 1 - * HAS_1_SEGMENT_SUPPORT = (1 << 1) - * HAS_2_SEGMENT_SUPPORT = (1 << 2) - */ - SUPPORTED_STS_SEGEMENTS = 0xF, - /** - * int bitmask of supported bprf phr data rates - * Values: - * HAS_6M81_SUPPORT = 1 - * HAS_850K_SUPPORT = (1 << 1) - */ - SUPPORTED_BPRF_PHR_DATA_RATES = 0x10, - /** - * int bitmask of supported psdu data rates - * Values: - * HAS_6M81_SUPPORT = 1 - * HAS_7M80_SUPPORT = (1 << 1) - * HAS_27M2_SUPPORT = (1 << 2) - * HAS_31M2_SUPPORT = (1 << 3) - */ - SUPPORTED_PSDU_DATA_RATES = 0x11, - /********************************************* * CCC specific ********************************************/ diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl index 208096965b..380089fabc 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl @@ -24,55 +24,6 @@ package android.hardware.uwb.fira_android; @VintfStability @Backing(type="long") enum UwbVendorCapabilityTlvValues { - HAS_AZIMUTH_SUPPORT = 1, - HAS_ELEVATION_SUPPORT = (1 << 1), - HAS_FOM_SUPPORT = (1 << 2), - HAS_FULL_AZIMUTH_SUPPORT = (1 << 3), - - HAS_CONTROLEE_INITIATOR_SUPPORT = 1, - HAS_CONTROLEE_RESPONDER_SUPPORT = (1 << 1), - HAS_CONTROLLER_INITIATOR_SUPPORT = (1 << 2), - HAS_CONTROLLER_RESPONDER_SUPPORT = (1 << 3), - - HAS_CRC_16_SUPPORT = 1, - HAS_CRC_32_SUPPORT = (1 << 1), - - HAS_UNICAST_SUPPORT = 1, - HAS_ONE_TO_MANY_SUPPORT = (1 << 1), - HAS_MANY_TO_MANY_SUPPORT = (1 << 2), - - SUPPORTED_PREAMBLE_HAS_32_SYMBOLS_SUPPORT = 1, - SUPPORTED_PREAMBLE_HAS_64_SYMBOLS_SUPPORT = (1 << 1), - - HAS_BPRF_SUPPORT = 1, - HAS_HPRF_SUPPORT = (1 << 1), - - HAS_DS_TWR_SUPPORT = 1, - HAS_SS_TWR_SUPPORT = (1 << 1), - - HAS_SP0_RFRAME_SUPPORT = 1, - HAS_SP1_RFRAME_SUPPORT = (1 << 1), - HAS_SP3_RFRAME_SUPPORT = (1 << 3), - - HAS_SFD0_SUPPORT = 1, - HAS_SFD1_SUPPORT = (1 << 1), - HAS_SFD2_SUPPORT = (1 << 2), - HAS_SFD3_SUPPORT = (1 << 3), - HAS_SFD4_SUPPORT = (1 << 4), - - HAS_STATIC_STS_SUPPORT = 1, - HAS_DYNAMIC_STS_SUPPORT = (1 << 1), - HAS_DYNAMIC_STS_INDIVIDUAL_CONTROLEE_KEY_SUPPORT = (1 << 2), - - HAS_0_SEGMENT_SUPPORT = 1, - HAS_1_SEGMENT_SUPPORT = (1 << 1), - HAS_2_SEGMENT_SUPPORT = (1 << 2), - - HAS_6M81_SUPPORT = 1, - HAS_850K_SUPPORT = (1 << 1), - HAS_27M2_SUPPORT = (1 << 2), - HAS_31M2_SUPPORT = (1 << 3), - /********************************************* * CCC specific ********************************************/ -- GitLab From 50a73bca752bc137f89c9c16d03cdf0491ae4545 Mon Sep 17 00:00:00 2001 From: Jason Macnak Date: Wed, 26 Jan 2022 13:16:30 -0800 Subject: [PATCH 549/825] composer: AIDL HAL may replace HIDL HAL. Relax the requirement on compatibility matrices that the HIDL composer HAL must exist on devices with target level 7 as they may have the AIDL composer HAL instead. Use DeviceManifestTest.ComposerHal to enforce the requirement instead. Bug: b/216514585 Test: vts_treble_vintf_vendor_test Change-Id: I7fc85b3c8841d9686863ab52c8b5bb88e1f5ee0a --- compatibility_matrices/compatibility_matrix.current.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index dc716bbdc0..cd20615d37 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -300,7 +300,10 @@ default - + + android.hardware.graphics.composer 2.1-4 -- GitLab From 22c5b648942687622a93677080da34857ebd173b Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Mon, 31 Jan 2022 19:52:35 +0000 Subject: [PATCH 550/825] -= src_available (internal) Default now. To Remove. Bug: 215754978 Test: N/A Change-Id: Ie83df828ea2ec892c6586ffa32e9f6c42d83a2fe --- biometrics/face/aidl/Android.bp | 1 - tv/tuner/aidl/Android.bp | 1 - 2 files changed, 2 deletions(-) diff --git a/biometrics/face/aidl/Android.bp b/biometrics/face/aidl/Android.bp index fff2c1d3d4..174f1da197 100644 --- a/biometrics/face/aidl/Android.bp +++ b/biometrics/face/aidl/Android.bp @@ -22,7 +22,6 @@ aidl_interface { backend: { java: { platform_apis: true, - srcs_available: true, }, cpp: { enabled: false, diff --git a/tv/tuner/aidl/Android.bp b/tv/tuner/aidl/Android.bp index c33572deb0..63f91accdb 100644 --- a/tv/tuner/aidl/Android.bp +++ b/tv/tuner/aidl/Android.bp @@ -19,7 +19,6 @@ aidl_interface { backend: { java: { sdk_version: "module_current", - srcs_available: true, }, cpp: { enabled: false, -- GitLab From 533f78f411b4e9c5156d6b252c99415df9441cb1 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Mon, 31 Jan 2022 22:40:16 +0000 Subject: [PATCH 551/825] audio: Add IDevice.setConnectedState_7_1 method This is an updated version of IDevice.setConnectedState which accepts a full AudioPort so that additional data like extra audio descriptors can be passed to the audio HAL. Bug: 211601178 Test: atest VtsHalAudioV7_1TargetTest Change-Id: Id746caa32122dabfb83feb5b515bed7717bcb67c --- audio/7.1/IDevice.hal | 12 +++++++ audio/core/all-versions/default/Device.cpp | 15 +++++++++ .../default/include/core/default/Device.h | 3 ++ .../7.1/AudioPrimaryHidlHalTest.cpp | 31 +++++++++++++++++++ 4 files changed, 61 insertions(+) diff --git a/audio/7.1/IDevice.hal b/audio/7.1/IDevice.hal index 373d17f4f9..e0b1e92359 100644 --- a/audio/7.1/IDevice.hal +++ b/audio/7.1/IDevice.hal @@ -85,4 +85,16 @@ interface IDevice extends @7.0::IDevice { Result retval, IStreamIn inStream, AudioConfig suggestedConfig); + + /** + * Notifies the device module about the connection state of an input/output + * device attached to it. The devicePort identifies the device and may also + * provide extra information such as raw audio descriptors. + * + * @param devicePort audio device port. + * @param connected whether the device is connected. + * @return retval operation completion status. + */ + setConnectedState_7_1(AudioPort devicePort, bool connected) + generates (Result retval); }; diff --git a/audio/core/all-versions/default/Device.cpp b/audio/core/all-versions/default/Device.cpp index ac5a3ba8ef..ca8c03df36 100644 --- a/audio/core/all-versions/default/Device.cpp +++ b/audio/core/all-versions/default/Device.cpp @@ -616,6 +616,21 @@ Return Device::updateAudioPatch(int32_t previousPatch, #endif +#if MAJOR_VERSION == 7 && MINOR_VERSION == 1 +Return Device::setConnectedState_7_1(const AudioPort& devicePort, bool connected) { + if (version() >= AUDIO_DEVICE_API_VERSION_3_2 && + mDevice->set_device_connected_state_v7 != nullptr) { + audio_port_v7 halPort; + if (status_t status = HidlUtils::audioPortToHal(devicePort, &halPort); status != NO_ERROR) { + return analyzeStatus("audioPortToHal", status); + } + return analyzeStatus("set_device_connected_state_v7", + mDevice->set_device_connected_state_v7(mDevice, &halPort, connected)); + } + return Result::NOT_SUPPORTED; +} +#endif + } // namespace implementation } // namespace CPP_VERSION } // namespace audio diff --git a/audio/core/all-versions/default/include/core/default/Device.h b/audio/core/all-versions/default/include/core/default/Device.h index 0aeb6b32cb..8cde3e0a06 100644 --- a/audio/core/all-versions/default/include/core/default/Device.h +++ b/audio/core/all-versions/default/include/core/default/Device.h @@ -162,6 +162,9 @@ struct Device : public IDevice, public ParametersUtil { Return updateAudioPatch(int32_t previousPatch, const hidl_vec& sources, const hidl_vec& sinks, createAudioPatch_cb _hidl_cb) override; +#endif +#if MAJOR_VERSION == 7 && MINOR_VERSION == 1 + Return setConnectedState_7_1(const AudioPort& devicePort, bool connected) override; #endif Return debug(const hidl_handle& fd, const hidl_vec& options) override; diff --git a/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp index b750f56ca2..d82d4adb51 100644 --- a/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp +++ b/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp @@ -16,3 +16,34 @@ // pull in all the <= 7.0 tests #include "7.0/AudioPrimaryHidlHalTest.cpp" + +TEST_P(AudioHidlDeviceTest, SetConnectedState_7_1) { + doc::test("Check that the HAL can be notified of device connection and disconnection"); + using AD = xsd::AudioDevice; + for (auto deviceType : {AD::AUDIO_DEVICE_OUT_HDMI, AD::AUDIO_DEVICE_OUT_WIRED_HEADPHONE, + AD::AUDIO_DEVICE_IN_USB_HEADSET}) { + SCOPED_TRACE("device=" + toString(deviceType)); + for (bool state : {true, false}) { + SCOPED_TRACE("state=" + ::testing::PrintToString(state)); + DeviceAddress address = {}; + address.deviceType = toString(deviceType); + if (deviceType == AD::AUDIO_DEVICE_IN_USB_HEADSET) { + address.address.alsa({0, 0}); + } + AudioPort devicePort; + devicePort.ext.device(address); + auto ret = getDevice()->setConnectedState_7_1(devicePort, state); + ASSERT_TRUE(ret.isOk()); + if (ret == Result::NOT_SUPPORTED) { + doc::partialTest("setConnectedState_7_1 is not supported"); + break; // other deviceType might be supported + } + ASSERT_OK(ret); + } + } + + // Because there is no way of knowing if the devices were connected before + // calling setConnectedState, there is no way to restore the HAL to its + // initial state. To workaround this, destroy the HAL at the end of this test. + ASSERT_TRUE(resetDevice()); +} -- GitLab From b819484c472ed7dd33bc67cf534ae77c8c5e6442 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 27 Jan 2022 17:23:28 -0800 Subject: [PATCH 552/825] Rename VehicleHalUtils to VehicleHalUtilsVendor. Rename the existing vendor version VehicleHalUtils to VehicleHalUtils vendor and then create a non-vendor version of VehicleHalUtils. Test: Presubmit Bug: 214635003 Change-Id: I7717d2e9527b9dd8592bbdff152aab4ef1b80a10 --- automotive/vehicle/aidl/aidl_test/Android.bp | 2 +- .../aidl/impl/default_config/Android.bp | 4 +-- .../aidl/impl/default_config/test/Android.bp | 2 +- .../impl/fake_impl/GeneratorHub/Android.bp | 2 +- .../fake_impl/GeneratorHub/test/Android.bp | 2 +- .../aidl/impl/fake_impl/hardware/Android.bp | 4 +-- .../impl/fake_impl/hardware/test/Android.bp | 2 +- .../aidl/impl/fake_impl/obd2frame/Android.bp | 4 +-- .../impl/fake_impl/obd2frame/test/Android.bp | 2 +- .../aidl/impl/fake_impl/userhal/Android.bp | 4 +-- .../impl/fake_impl/userhal/test/Android.bp | 2 +- .../utils/proto_message_converter/Android.bp | 6 ++-- .../vehicle/aidl/impl/utils/common/Android.bp | 29 ++++++++++++++++++- .../aidl/impl/utils/common/test/Android.bp | 4 +-- automotive/vehicle/aidl/impl/vhal/Android.bp | 4 +-- .../vehicle/aidl/impl/vhal/test/Android.bp | 2 +- 16 files changed, 51 insertions(+), 24 deletions(-) diff --git a/automotive/vehicle/aidl/aidl_test/Android.bp b/automotive/vehicle/aidl/aidl_test/Android.bp index 5284a0a8e1..cb92c6bfa3 100644 --- a/automotive/vehicle/aidl/aidl_test/Android.bp +++ b/automotive/vehicle/aidl/aidl_test/Android.bp @@ -26,7 +26,7 @@ cc_test { "libhidlbase", ], static_libs: [ - "VehicleHalUtils", + "VehicleHalUtilsVendor", "android.hardware.automotive.vehicle@2.0", "libgtest", "libgmock", diff --git a/automotive/vehicle/aidl/impl/default_config/Android.bp b/automotive/vehicle/aidl/impl/default_config/Android.bp index 0feaf23a73..7a98b6465a 100644 --- a/automotive/vehicle/aidl/impl/default_config/Android.bp +++ b/automotive/vehicle/aidl/impl/default_config/Android.bp @@ -24,8 +24,8 @@ cc_library_headers { local_include_dirs: ["include"], export_include_dirs: ["include"], defaults: ["VehicleHalDefaults"], - static_libs: ["VehicleHalUtils"], + static_libs: ["VehicleHalUtilsVendor"], header_libs: ["VehicleHalTestUtilHeaders"], - export_static_lib_headers: ["VehicleHalUtils"], + export_static_lib_headers: ["VehicleHalUtilsVendor"], export_header_lib_headers: ["VehicleHalTestUtilHeaders"], } diff --git a/automotive/vehicle/aidl/impl/default_config/test/Android.bp b/automotive/vehicle/aidl/impl/default_config/test/Android.bp index 771472c8c1..0c4a3a43d4 100644 --- a/automotive/vehicle/aidl/impl/default_config/test/Android.bp +++ b/automotive/vehicle/aidl/impl/default_config/test/Android.bp @@ -24,7 +24,7 @@ cc_test { defaults: ["VehicleHalDefaults"], srcs: ["*.cpp"], static_libs: [ - "VehicleHalUtils", + "VehicleHalUtilsVendor", "libgtest", ], header_libs: [ diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/Android.bp index ab223d3f94..e6c4ee9955 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/Android.bp @@ -26,7 +26,7 @@ cc_library { export_include_dirs: ["include"], defaults: ["VehicleHalDefaults"], static_libs: [ - "VehicleHalUtils", + "VehicleHalUtilsVendor", "FakeObd2Frame", ], shared_libs: [ diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp index ac8db44e59..58f0e9848d 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp @@ -24,7 +24,7 @@ cc_test { srcs: ["*.cpp"], defaults: ["VehicleHalDefaults"], static_libs: [ - "VehicleHalUtils", + "VehicleHalUtilsVendor", "FakeVehicleHalValueGenerators", "FakeObd2Frame", ], diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp index dcd9208cab..49f76718ee 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp @@ -39,7 +39,7 @@ cc_defaults { ], export_header_lib_headers: ["IVehicleHardware"], static_libs: [ - "VehicleHalUtils", + "VehicleHalUtilsVendor", "FakeVehicleHalValueGenerators", "FakeObd2Frame", "FakeUserHal", @@ -47,5 +47,5 @@ cc_defaults { shared_libs: [ "libjsoncpp", ], - export_static_lib_headers: ["VehicleHalUtils"], + export_static_lib_headers: ["VehicleHalUtilsVendor"], } 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 90d1516a21..9f679bcf11 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp @@ -29,7 +29,7 @@ cc_test { "VehicleHalTestUtilHeaders", ], static_libs: [ - "VehicleHalUtils", + "VehicleHalUtilsVendor", "FakeVehicleHardware", "FakeVehicleHalValueGenerators", "FakeObd2Frame", diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/Android.bp index c1cee84e63..c21ad535c5 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/Android.bp @@ -26,7 +26,7 @@ cc_library { export_include_dirs: ["include"], defaults: ["VehicleHalDefaults"], static_libs: [ - "VehicleHalUtils", + "VehicleHalUtilsVendor", ], - export_static_lib_headers: ["VehicleHalUtils"], + export_static_lib_headers: ["VehicleHalUtilsVendor"], } diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp index 55b8c9399e..a16185b5e2 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp @@ -25,7 +25,7 @@ cc_test { defaults: ["VehicleHalDefaults"], static_libs: [ "FakeObd2Frame", - "VehicleHalUtils", + "VehicleHalUtilsVendor", ], test_suites: ["device-tests"], } diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/userhal/Android.bp index 2e955315cd..16891029f7 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/userhal/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/Android.bp @@ -26,7 +26,7 @@ cc_library { export_include_dirs: ["include"], defaults: ["VehicleHalDefaults"], static_libs: [ - "VehicleHalUtils", + "VehicleHalUtilsVendor", ], - export_static_lib_headers: ["VehicleHalUtils"], + export_static_lib_headers: ["VehicleHalUtilsVendor"], } diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp index 7d0a534b85..1471ea6396 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp @@ -25,7 +25,7 @@ cc_test { defaults: ["VehicleHalDefaults"], static_libs: [ "FakeUserHal", - "VehicleHalUtils", + "VehicleHalUtilsVendor", "libgtest", "libgmock", ], diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp index 7670c25418..6209880958 100644 --- a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp +++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp @@ -34,10 +34,10 @@ cc_library { shared_libs: ["libprotobuf-cpp-full"], static_libs: [ "VehicleHalProtos", - "VehicleHalUtils", + "VehicleHalUtilsVendor", ], defaults: ["VehicleHalDefaults"], - export_static_lib_headers: ["VehicleHalUtils"], + export_static_lib_headers: ["VehicleHalUtilsVendor"], } cc_test { @@ -51,7 +51,7 @@ cc_test { static_libs: [ "VehicleHalProtoMessageConverter", "VehicleHalProtos", - "VehicleHalUtils", + "VehicleHalUtilsVendor", "libgtest", ], header_libs: ["VehicleHalDefaultConfig"], diff --git a/automotive/vehicle/aidl/impl/utils/common/Android.bp b/automotive/vehicle/aidl/impl/utils/common/Android.bp index ace505d88c..88713f1245 100644 --- a/automotive/vehicle/aidl/impl/utils/common/Android.bp +++ b/automotive/vehicle/aidl/impl/utils/common/Android.bp @@ -19,7 +19,7 @@ package { } cc_library { - name: "VehicleHalUtils", + name: "VehicleHalUtilsVendor", srcs: ["src/*.cpp"], vendor: true, local_include_dirs: ["include"], @@ -27,6 +27,33 @@ cc_library { defaults: ["VehicleHalDefaults"], } +// This is a non-vendor version for VehicleHalUtilsVendor. +cc_library { + name: "VehicleHalUtils", + srcs: ["src/*.cpp"], + local_include_dirs: ["include"], + export_include_dirs: ["include"], + static_libs: [ + "android-automotive-large-parcelable-lib", + "android.hardware.automotive.vehicle-V1-ndk", + "libmath", + ], + shared_libs: [ + "libbase", + "liblog", + "libutils", + ], + cflags: [ + "-Wall", + "-Wextra", + "-Werror", + "-Wthread-safety", + ], + defaults: [ + "android-automotive-large-parcelable-defaults", + ], +} + cc_library_headers { name: "VehicleHalUtilHeaders", export_include_dirs: ["include"], diff --git a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp index 250b33135b..bcb3c8d512 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp +++ b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp @@ -19,11 +19,11 @@ package { } cc_test { - name: "VehicleHalVehicleUtilsTest", + name: "VehicleHalVehicleUtilsVendorTest", srcs: ["*.cpp"], vendor: true, static_libs: [ - "VehicleHalUtils", + "VehicleHalUtilsVendor", "libgtest", "libgmock", ], diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp index 49f48f7aa8..295cbb746b 100644 --- a/automotive/vehicle/aidl/impl/vhal/Android.bp +++ b/automotive/vehicle/aidl/impl/vhal/Android.bp @@ -33,7 +33,7 @@ cc_binary { static_libs: [ "DefaultVehicleHal", "FakeVehicleHardware", - "VehicleHalUtils", + "VehicleHalUtilsVendor", ], header_libs: [ "IVehicleHardware", @@ -58,7 +58,7 @@ cc_library { "src/SubscriptionManager.cpp", ], static_libs: [ - "VehicleHalUtils", + "VehicleHalUtilsVendor", ], header_libs: [ "IVehicleHardware", diff --git a/automotive/vehicle/aidl/impl/vhal/test/Android.bp b/automotive/vehicle/aidl/impl/vhal/test/Android.bp index 7122aa5230..d89f2c152d 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/Android.bp +++ b/automotive/vehicle/aidl/impl/vhal/test/Android.bp @@ -24,7 +24,7 @@ cc_test { srcs: ["*.cpp"], static_libs: [ "DefaultVehicleHal", - "VehicleHalUtils", + "VehicleHalUtilsVendor", "libgtest", "libgmock", ], -- GitLab From 5dba921320aa294538b4bed47e80ec4f17bb6ee9 Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Tue, 1 Feb 2022 17:03:32 +0000 Subject: [PATCH 553/825] Remove use of ILLEGAL_ARGUMENT in hostEndpointDisconnected Since an invalid argument to hostEndpointDisconnected should be ignored by the HAL (and the Context Hub service), remove the EX_ILLEGAL_ARGUMENT requirement in the Context Hub AIDL HAL. Bug: 216798253 Test: Compile Change-Id: I83f08ccb998e6b494307de51f8709f3e0fbd2c99 --- contexthub/aidl/android/hardware/contexthub/IContextHub.aidl | 5 ++--- contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl index 2135041ed7..16666efd95 100644 --- a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl +++ b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl @@ -189,9 +189,8 @@ interface IContextHub { * called, the HAL is expected to clean up any resources attached to the messaging channel * associated with this host endpoint ID. * - * @param hostEndPointId The ID of the host that has disconnected. - * - * @throws EX_ILLEGAL_ARGUMENT if hostEndpointId is not associated with a connected host. + * @param hostEndPointId The ID of the host that has disconnected. Any invalid values for this + * parameter should be ignored (no-op). */ void onHostEndpointDisconnected(char hostEndpointId); diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp index f0583be581..3c01c6bac2 100644 --- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp +++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp @@ -338,8 +338,7 @@ TEST_P(ContextHubAidl, TestHostConnection) { TEST_P(ContextHubAidl, TestInvalidHostConnection) { constexpr char16_t kHostEndpointId = 1; - Status status = contextHub->onHostEndpointDisconnected(kHostEndpointId); - ASSERT_EQ(status.exceptionCode(), android::binder::Status::EX_ILLEGAL_ARGUMENT); + ASSERT_TRUE(contextHub->onHostEndpointDisconnected(kHostEndpointId).isOk()); } std::string PrintGeneratedTest(const testing::TestParamInfo& info) { -- GitLab From ad6d0949328a61f39bc40cefe3a9cbe40ead8f02 Mon Sep 17 00:00:00 2001 From: Veerendranath Jakkam Date: Mon, 10 Jan 2022 15:25:20 +0530 Subject: [PATCH 554/825] wifi: Add support for AP initiated QoS policy feature This commit defines supplicant AIDL APIs needed for QoS policy feature. Bug: 191426881 Test: VTS test Change-Id: Iab9c78d716da6c263ac7c6d49e257ee2e794a648 (cherry-picked from commit 4f43701bd12994f7bbaacf6b547ae7d7093b6c38) Change-Id: Ifb7a58192723d2d9135f4c5fffe192780c8bb482 --- .../wifi/supplicant/ISupplicantStaIface.aidl | 3 + .../ISupplicantStaIfaceCallback.aidl | 2 + .../hardware/wifi/supplicant/IpVersion.aidl | 39 +++++++++++ .../hardware/wifi/supplicant/PortRange.aidl | 39 +++++++++++ .../wifi/supplicant/ProtocolNextHeader.aidl | 40 ++++++++++++ .../supplicant/QosPolicyClassifierParams.aidl | 46 +++++++++++++ .../QosPolicyClassifierParamsMask.aidl | 44 +++++++++++++ .../wifi/supplicant/QosPolicyData.aidl | 41 ++++++++++++ .../wifi/supplicant/QosPolicyRequestType.aidl | 39 +++++++++++ .../wifi/supplicant/QosPolicyStatus.aidl | 39 +++++++++++ .../wifi/supplicant/QosPolicyStatusCode.aidl | 41 ++++++++++++ .../wifi/supplicant/ISupplicantStaIface.aidl | 32 +++++++++ .../ISupplicantStaIfaceCallback.aidl | 14 ++++ .../hardware/wifi/supplicant/IpVersion.aidl | 27 ++++++++ .../hardware/wifi/supplicant/PortRange.aidl | 26 ++++++++ .../wifi/supplicant/ProtocolNextHeader.aidl | 28 ++++++++ .../supplicant/QosPolicyClassifierParams.aidl | 65 +++++++++++++++++++ .../QosPolicyClassifierParamsMask.aidl | 32 +++++++++ .../wifi/supplicant/QosPolicyData.aidl | 44 +++++++++++++ .../wifi/supplicant/QosPolicyRequestType.aidl | 31 +++++++++ .../wifi/supplicant/QosPolicyStatus.aidl | 28 ++++++++ .../wifi/supplicant/QosPolicyStatusCode.aidl | 29 +++++++++ .../supplicant_sta_iface_aidl_test.cpp | 6 ++ 23 files changed, 735 insertions(+) create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IpVersion.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PortRange.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyData.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatus.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/IpVersion.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/PortRange.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyData.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyStatus.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl 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 ca40379710..5c0aacd423 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 @@ -61,6 +61,9 @@ interface ISupplicantStaIface { void reassociate(); void reconnect(); void registerCallback(in android.hardware.wifi.supplicant.ISupplicantStaIfaceCallback callback); + void setQosPolicyFeatureEnabled(in boolean enable); + void sendQosPolicyResponse(in boolean morePolicies, in android.hardware.wifi.supplicant.QosPolicyStatus[] qosPolicyStatusList); + void removeAllQosPolicies(); void removeDppUri(in int id); void removeExtRadioWork(in int id); void removeNetwork(in int id); 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 37b34cf3f7..c17c624eb1 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 @@ -60,4 +60,6 @@ interface ISupplicantStaIfaceCallback { oneway void onWpsEventFail(in byte[] bssid, in android.hardware.wifi.supplicant.WpsConfigError configError, in android.hardware.wifi.supplicant.WpsErrorIndication errorInd); oneway void onWpsEventPbcOverlap(); oneway void onWpsEventSuccess(); + oneway void onQosPolicyReset(); + oneway void onQosPolicyRequest(in android.hardware.wifi.supplicant.QosPolicyData[] qosPolicyData); } 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 new file mode 100644 index 0000000000..f571b44eb2 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IpVersion.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 -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="byte") @VintfStability +enum IpVersion { + VERSION_4 = 0, + VERSION_6 = 1, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PortRange.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PortRange.aidl new file mode 100644 index 0000000000..b2004f242b --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PortRange.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 -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 PortRange { + int startPort; + int endPort; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl new file mode 100644 index 0000000000..8fb91d0511 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtocolNextHeader.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 -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="byte") @VintfStability +enum ProtocolNextHeader { + TCP = 6, + UDP = 17, + ESP = 50, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl new file mode 100644 index 0000000000..8bf5fd836d --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 QosPolicyClassifierParams { + android.hardware.wifi.supplicant.IpVersion ipVersion; + android.hardware.wifi.supplicant.QosPolicyClassifierParamsMask classifierParamMask; + byte[] srcIp; + byte[] dstIp; + int srcPort; + android.hardware.wifi.supplicant.PortRange dstPortRange; + android.hardware.wifi.supplicant.ProtocolNextHeader protocolNextHdr; + byte[] flowLabelIpv6; + String domainName; +} 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 new file mode 100644 index 0000000000..280ddbe3b2 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.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 -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 QosPolicyClassifierParamsMask { + SRC_IP = 1, + DST_IP = 2, + SRC_PORT = 4, + DST_PORT_RANGE = 8, + PROTOCOL_NEXT_HEADER = 16, + FLOW_LABEL = 32, + DOMAIN_NAME = 64, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyData.aidl new file mode 100644 index 0000000000..1719565a81 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyData.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 -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 QosPolicyData { + byte policyId; + android.hardware.wifi.supplicant.QosPolicyRequestType requestType; + byte dscp; + android.hardware.wifi.supplicant.QosPolicyClassifierParams classifierParams; +} 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 new file mode 100644 index 0000000000..4c1e4fad5b --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyRequestType.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 -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="byte") @VintfStability +enum QosPolicyRequestType { + QOS_POLICY_ADD = 0, + QOS_POLICY_REMOVE = 1, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatus.aidl new file mode 100644 index 0000000000..61278c5fe5 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatus.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 -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 QosPolicyStatus { + byte policyId; + android.hardware.wifi.supplicant.QosPolicyStatusCode status; +} 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 new file mode 100644 index 0000000000..4d40edcc17 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatusCode.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 -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="byte") @VintfStability +enum QosPolicyStatusCode { + QOS_POLICY_SUCCESS = 0, + QOS_POLICY_REQUEST_DECLINED = 1, + QOS_POLICY_CLASSIFIER_NOT_SUPPORTED = 2, + QOS_POLICY_INSUFFICIENT_RESOURCES = 3, +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl index b48fa04910..a48a9917b5 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl @@ -28,6 +28,7 @@ import android.hardware.wifi.supplicant.ISupplicantStaIfaceCallback; import android.hardware.wifi.supplicant.ISupplicantStaNetwork; import android.hardware.wifi.supplicant.IfaceType; import android.hardware.wifi.supplicant.KeyMgmtMask; +import android.hardware.wifi.supplicant.QosPolicyStatus; import android.hardware.wifi.supplicant.RxFilterType; import android.hardware.wifi.supplicant.WpaDriverCapabilitiesMask; import android.hardware.wifi.supplicant.WpsConfigMethods; @@ -376,6 +377,37 @@ interface ISupplicantStaIface { */ void registerCallback(in ISupplicantStaIfaceCallback callback); + /** + * Enable/disable QoS policy feature. + * @param enable true to enable, false to disable. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN| + */ + void setQosPolicyFeatureEnabled(in boolean enable); + + /** + * Send a DSCP policy response to the AP. If a DSCP request is ongoing, + * sends a solicited (uses the ongoing DSCP request as dialog token) DSCP + * response. Otherwise, sends an unsolicited DSCP response. + * + * @param morePolicies Flag to indicate more QoS policies can be accommodated. + * @param qosPolicyStatusList QoS policy status info for each QoS policy id. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_ARGS_INVALID|, + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_UNSUPPORTED| + */ + void sendQosPolicyResponse(in boolean morePolicies, in QosPolicyStatus[] qosPolicyStatusList); + + /** + * Indicate removal of all active QoS policies configured by the AP. + * + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_UNSUPPORTED| + */ + void removeAllQosPolicies(); + /** * Remove a DPP peer URI. * diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index 594fef9277..ca63f5c40d 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -26,6 +26,7 @@ import android.hardware.wifi.supplicant.DppFailureCode; import android.hardware.wifi.supplicant.DppProgressCode; import android.hardware.wifi.supplicant.Hs20AnqpData; import android.hardware.wifi.supplicant.OsuMethod; +import android.hardware.wifi.supplicant.QosPolicyData; import android.hardware.wifi.supplicant.StaIfaceCallbackState; import android.hardware.wifi.supplicant.StaIfaceReasonCode; import android.hardware.wifi.supplicant.WpsConfigError; @@ -275,4 +276,17 @@ interface ISupplicantStaIfaceCallback { * Used to indicate the success of a WPS connection attempt. */ oneway void onWpsEventSuccess(); + + /** + * Used to indicate that the AP has cleared all DSCP requests + * associated with this device. + */ + oneway void onQosPolicyReset(); + + /** + * Used to indicate a DSCP request was received from the AP. + * + * @param qosPolicyData QoS policies info requested by the AP. + */ + oneway void onQosPolicyRequest(in QosPolicyData[] qosPolicyData); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/IpVersion.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/IpVersion.aidl new file mode 100644 index 0000000000..ad83fd783b --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/IpVersion.aidl @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * Enum values for IP version. + */ +@VintfStability +@Backing(type="byte") +enum IpVersion { + VERSION_4, + VERSION_6, +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/PortRange.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/PortRange.aidl new file mode 100644 index 0000000000..0b8385e37a --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/PortRange.aidl @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * Port range to indicate start port and end port number. + */ +@VintfStability +parcelable PortRange { + int startPort; + int endPort; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl new file mode 100644 index 0000000000..643405b19e --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * Enum values for Protocol/Next Header. + */ +@VintfStability +@Backing(type="byte") +enum ProtocolNextHeader { + TCP = 6, + UDP = 17, + ESP = 50, +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl new file mode 100644 index 0000000000..d95d18dd27 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.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. + */ + +package android.hardware.wifi.supplicant; + +import android.hardware.wifi.supplicant.IpVersion; +import android.hardware.wifi.supplicant.PortRange; +import android.hardware.wifi.supplicant.ProtocolNextHeader; +import android.hardware.wifi.supplicant.QosPolicyClassifierParamsMask; + +/** + * QoS policy classifier parameters. Refer section 5.4 of the + * WFA (WiFi Alliance) QoS Management Specification v2.0. + */ +@VintfStability +parcelable QosPolicyClassifierParams { + IpVersion ipVersion; + + /** + * Classifier bit mask to identify filled fields. Setting a bit + * in the mask to 1 means the corresponding field in this struct + * has a value. Otherwise, that field should be ignored. + */ + QosPolicyClassifierParamsMask classifierParamMask; + + /** Source IP address. */ + byte[] srcIp; + + /** Destination IP address. */ + byte[] dstIp; + + /** Source port. */ + int srcPort; + + /** + * Destination port range. In the case of a single destination port, + * both startPort and endPort will have the same values. + */ + PortRange dstPortRange; + + /** Represents protocol for IPv4 and Next Header for IPv6. */ + ProtocolNextHeader protocolNextHdr; + + /** Applicable only for IPv6. */ + byte[/* 3 */] flowLabelIpv6; + + /** + * Domain Name encoded and formatted in accordance with the rules for + * "reg-name" in RFC 3986. + */ + String domainName; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl new file mode 100644 index 0000000000..51bc14c25e --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * Enum values for QoS policy classifier params mask bits. + */ +@VintfStability +@Backing(type="int") +enum QosPolicyClassifierParamsMask { + SRC_IP = 1 << 0, + DST_IP = 1 << 1, + SRC_PORT = 1 << 2, + DST_PORT_RANGE = 1 << 3, + PROTOCOL_NEXT_HEADER = 1 << 4, + FLOW_LABEL = 1 << 5, + DOMAIN_NAME = 1 << 6, +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyData.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyData.aidl new file mode 100644 index 0000000000..0ae0deff3b --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyData.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. + */ + +package android.hardware.wifi.supplicant; + +import android.hardware.wifi.supplicant.QosPolicyClassifierParams; +import android.hardware.wifi.supplicant.QosPolicyRequestType; + +/** + * QoS policy information in DSCP request. + */ +@VintfStability +parcelable QosPolicyData { + /** QoS Policy identifier. */ + byte policyId; + + QosPolicyRequestType requestType; + + /** + * DSCP value to be set for uplink traffic streams matched with + * |classifierParams|. Applicable only when |requestType| is + * |QOS_POLICY_ADD|. + */ + byte dscp; + + /** + * QoS policy classifier params. Applicable only when |requestType| + * is |QOS_POLICY_ADD|. + */ + QosPolicyClassifierParams classifierParams; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl new file mode 100644 index 0000000000..fd9a8d0a6b --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * Enum values for QoS Policy request type. + */ +@VintfStability +@Backing(type="byte") +enum QosPolicyRequestType { + /** + * If an Add request includes an existing policy, + * it should be considered an update request by the handler. + */ + QOS_POLICY_ADD, + QOS_POLICY_REMOVE, +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyStatus.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyStatus.aidl new file mode 100644 index 0000000000..9087048615 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyStatus.aidl @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +import android.hardware.wifi.supplicant.QosPolicyStatusCode; + +/** + * QoS policy status tuple. + */ +@VintfStability +parcelable QosPolicyStatus { + byte policyId; + QosPolicyStatusCode status; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl new file mode 100644 index 0000000000..8ab60ad356 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * Enum values for QoS policy response status. + */ +@VintfStability +@Backing(type="byte") +enum QosPolicyStatusCode { + QOS_POLICY_SUCCESS, + QOS_POLICY_REQUEST_DECLINED, + QOS_POLICY_CLASSIFIER_NOT_SUPPORTED, + QOS_POLICY_INSUFFICIENT_RESOURCES, +} 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 6e6955fd75..2f7a6de303 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 @@ -191,6 +191,12 @@ class SupplicantStaIfaceCallback : public BnSupplicantStaIfaceCallback { ::ndk::ScopedAStatus onWpsEventSuccess() override { return ndk::ScopedAStatus::ok(); } + ::ndk::ScopedAStatus onQosPolicyReset() override { return ndk::ScopedAStatus::ok(); } + ::ndk::ScopedAStatus onQosPolicyRequest( + const std::vector<::aidl::android::hardware::wifi::supplicant :: + QosPolicyData /* qosPolicyData */>&) override { + return ndk::ScopedAStatus::ok(); + } }; class SupplicantStaIfaceAidlTest : public testing::TestWithParam { -- GitLab From c47bc672abc999dab10fd078e220736cf9f7ec7c Mon Sep 17 00:00:00 2001 From: Joe Huang Date: Wed, 2 Feb 2022 13:45:34 +0800 Subject: [PATCH 555/825] Add GnssAntennaInfo AIDL capability Enable GnssAntennaInfo capability as JNI AIDL is ready. Bug: 205185369 Test: atest VtsHalGnssTargetTest Change-Id: I89d559ea4e95bc19815497c46d9ef96f32883293 --- gnss/aidl/default/Gnss.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index af1dd5c538..a861957e75 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -58,7 +58,8 @@ ScopedAStatus Gnss::setCallback(const std::shared_ptr& callback) int capabilities = (int)(IGnssCallback::CAPABILITY_SATELLITE_BLOCKLIST | IGnssCallback::CAPABILITY_SATELLITE_PVT | - IGnssCallback::CAPABILITY_CORRELATION_VECTOR); + IGnssCallback::CAPABILITY_CORRELATION_VECTOR | + IGnssCallback::CAPABILITY_ANTENNA_INFO); auto status = sGnssCallback->gnssSetCapabilitiesCb(capabilities); if (!status.isOk()) { -- GitLab From b32b544106078c9ff33ab28ab292277d304fad66 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Wed, 2 Feb 2022 10:16:41 -0800 Subject: [PATCH 556/825] Make contexthub aidl available host side Bug: 158007175 Test: running atest --host event_logger_test Change-Id: I9f5f50ebc07d500dd4ffc51af8f1d39e9576e1db --- contexthub/aidl/Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/contexthub/aidl/Android.bp b/contexthub/aidl/Android.bp index e9143b5256..5926b776e1 100644 --- a/contexthub/aidl/Android.bp +++ b/contexthub/aidl/Android.bp @@ -24,6 +24,7 @@ package { aidl_interface { name: "android.hardware.contexthub", vendor_available: true, + host_supported: true, srcs: ["android/hardware/contexthub/*.aidl"], stability: "vintf", backend: { -- GitLab From 09fd0129388bb348fcaee28cb8c79c0fd5f078a4 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Wed, 2 Feb 2022 16:24:30 -0800 Subject: [PATCH 557/825] Update getInterfaceVersion checks to include -1 getInterfaceVersion() returns -1 if it is unknown. V1 of the HAL doesn't implement getInterfaceVersion due to ABI reasons for regular, unversioned, AIDL interfaces. Bug: 206670536 Test: on device Change-Id: Id63b65b8a03488a6f179c7f64bd9d457e28eb30a --- gnss/aidl/vts/gnss_hal_test_cases.cpp | 56 +++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index a4a0044f8c..8e51b44427 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -345,7 +345,7 @@ TEST_P(GnssHalTest, TestGnssPowerIndication) { auto powerStats1 = gnssPowerIndicationCallback->last_gnss_power_stats_; // Get a location and request another GnssPowerStats - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { gnss_cb_->location_cbq_.reset(); } else { aidl_gnss_cb_->location_cbq_.reset(); @@ -424,18 +424,18 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { const int kLocationsToAwait = 3; const int kRetriesToUnBlocklist = 10; - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { gnss_cb_->location_cbq_.reset(); } else { aidl_gnss_cb_->location_cbq_.reset(); } StartAndCheckLocations(kLocationsToAwait); - int location_called_count = (aidl_gnss_hal_->getInterfaceVersion() == 1) + int location_called_count = (aidl_gnss_hal_->getInterfaceVersion() <= 1) ? gnss_cb_->location_cbq_.calledCount() : aidl_gnss_cb_->location_cbq_.calledCount(); // Tolerate 1 less sv status to handle edge cases in reporting. - int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1) + int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() <= 1) ? gnss_cb_->sv_info_list_cbq_.size() : aidl_gnss_cb_->sv_info_list_cbq_.size(); EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait); @@ -450,7 +450,7 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { const int kGnssSvInfoListTimeout = 2; BlocklistedSource source_to_blocklist; - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { std::list> sv_info_vec_list; int count = gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec_list, sv_info_list_cbq_size, kGnssSvInfoListTimeout); @@ -488,7 +488,7 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { ASSERT_TRUE(status.isOk()); // retry and ensure satellite not used - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { gnss_cb_->sv_info_list_cbq_.reset(); gnss_cb_->location_cbq_.reset(); } else { @@ -499,7 +499,7 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { StartAndCheckLocations(kLocationsToAwait); // early exit if test is being run with insufficient signal - location_called_count = (aidl_gnss_hal_->getInterfaceVersion() == 1) + location_called_count = (aidl_gnss_hal_->getInterfaceVersion() <= 1) ? gnss_cb_->location_cbq_.calledCount() : aidl_gnss_cb_->location_cbq_.calledCount(); if (location_called_count == 0) { @@ -508,14 +508,14 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { ASSERT_TRUE(location_called_count > 0); // Tolerate 1 less sv status to handle edge cases in reporting. - sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1) + sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() <= 1) ? gnss_cb_->sv_info_list_cbq_.size() : aidl_gnss_cb_->sv_info_list_cbq_.size(); EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait); ALOGD("Observed %d GnssSvInfo, while awaiting %d Locations (%d received)", sv_info_list_cbq_size, kLocationsToAwait, location_called_count); for (int i = 0; i < sv_info_list_cbq_size; ++i) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { hidl_vec sv_info_vec; gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { @@ -550,7 +550,7 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { while (!strongest_sv_is_reobserved && (unblocklist_loops_remaining-- > 0)) { StopAndClearLocations(); - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { gnss_cb_->sv_info_list_cbq_.reset(); gnss_cb_->location_cbq_.reset(); } else { @@ -560,7 +560,7 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { StartAndCheckLocations(kLocationsToAwait); // early exit loop if test is being run with insufficient signal - location_called_count = (aidl_gnss_hal_->getInterfaceVersion() == 1) + location_called_count = (aidl_gnss_hal_->getInterfaceVersion() <= 1) ? gnss_cb_->location_cbq_.calledCount() : aidl_gnss_cb_->location_cbq_.calledCount(); if (location_called_count == 0) { @@ -569,7 +569,7 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { ASSERT_TRUE(location_called_count > 0); // Tolerate 1 less sv status to handle edge cases in reporting. - sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1) + sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() <= 1) ? gnss_cb_->sv_info_list_cbq_.size() : aidl_gnss_cb_->sv_info_list_cbq_.size(); EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait); @@ -578,7 +578,7 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { sv_info_list_cbq_size, kLocationsToAwait, unblocklist_loops_remaining); for (int i = 0; i < sv_info_list_cbq_size; ++i) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { hidl_vec sv_info_vec; gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { @@ -663,7 +663,7 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOff) { ASSERT_TRUE(status.isOk()); // retry and ensure constellation not used - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { gnss_cb_->sv_info_list_cbq_.reset(); gnss_cb_->location_cbq_.reset(); } else { @@ -673,14 +673,14 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOff) { StartAndCheckLocations(kLocationsToAwait); // Tolerate 1 less sv status to handle edge cases in reporting. - int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1) + int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() <= 1) ? gnss_cb_->sv_info_list_cbq_.size() : aidl_gnss_cb_->sv_info_list_cbq_.size(); EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait); ALOGD("Observed %d GnssSvInfo, while awaiting %d Locations", sv_info_list_cbq_size, kLocationsToAwait); for (int i = 0; i < sv_info_list_cbq_size; ++i) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { hidl_vec sv_info_vec; gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { @@ -766,7 +766,7 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOn) { StopAndClearLocations(); // retry and ensure constellation not used - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { gnss_cb_->sv_info_list_cbq_.reset(); gnss_cb_->location_cbq_.reset(); } else { @@ -776,14 +776,14 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOn) { StartAndCheckLocations(kLocationsToAwait); // Tolerate 1 less sv status to handle edge cases in reporting. - int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() == 1) + int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() <= 1) ? gnss_cb_->sv_info_list_cbq_.size() : aidl_gnss_cb_->sv_info_list_cbq_.size(); EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait); ALOGD("Observed %d GnssSvInfo, while awaiting %d Locations", sv_info_list_cbq_size, kLocationsToAwait); for (int i = 0; i < sv_info_list_cbq_size; ++i) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { hidl_vec sv_info_vec; gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout); for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { @@ -821,7 +821,7 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOn) { * TestAllExtensions. */ TEST_P(GnssHalTest, TestAllExtensions) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { return; } @@ -863,7 +863,7 @@ TEST_P(GnssHalTest, TestAllExtensions) { * 3. Sets SUPL server host/port. */ TEST_P(GnssHalTest, TestAGnssExtension) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { return; } sp iAGnss; @@ -887,7 +887,7 @@ TEST_P(GnssHalTest, TestAGnssExtension) { * 3. Sets reference location. */ TEST_P(GnssHalTest, TestAGnssRilExtension) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { return; } sp iAGnssRil; @@ -921,7 +921,7 @@ TEST_P(GnssHalTest, TestAGnssRilExtension) { * Ensures that GnssDebug values make sense. */ TEST_P(GnssHalTest, GnssDebugValuesSanityTest) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { return; } sp iGnssDebug; @@ -970,7 +970,7 @@ TEST_P(GnssHalTest, GnssDebugValuesSanityTest) { * 3. Sets proxy apps */ TEST_P(GnssHalTest, TestGnssVisibilityControlExtension) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { return; } sp iGnssVisibilityControl; @@ -994,7 +994,7 @@ TEST_P(GnssHalTest, TestGnssVisibilityControlExtension) { * and verifies mandatory fields are valid. */ TEST_P(GnssHalTest, TestGnssMeasurementSetCallbackWithOptions) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { return; } const int kFirstGnssMeasurementTimeoutSeconds = 10; @@ -1032,7 +1032,7 @@ TEST_P(GnssHalTest, TestGnssMeasurementSetCallbackWithOptions) { * 2. Sets a GnssMeasurementCallback, waits for a measurement. */ TEST_P(GnssHalTest, TestGnssAgcInGnssMeasurement) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { return; } const int kFirstGnssMeasurementTimeoutSeconds = 10; @@ -1078,7 +1078,7 @@ TEST_P(GnssHalTest, TestGnssAgcInGnssMeasurement) { TEST_P(GnssHalTest, TestGnssAntennaInfo) { const int kAntennaInfoTimeoutSeconds = 2; - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { return; } @@ -1156,7 +1156,7 @@ TEST_P(GnssHalTest, TestGnssAntennaInfo) { * capability flag is set. */ TEST_P(GnssHalTest, TestGnssMeasurementCorrections) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { return; } if (!(aidl_gnss_cb_->last_capabilities_ & -- GitLab From 8f1f1503c5bcd189bc5f03d569e98c993f7262b8 Mon Sep 17 00:00:00 2001 From: Kiran Rachuri Date: Wed, 2 Feb 2022 15:56:33 +0000 Subject: [PATCH 558/825] Add properties for EV charging Bug: 209021366 Test: Build Change-Id: Iec82501e478830ff7f1830750394ad5b0ecc9735 --- .../automotive/vehicle/EvChargeState.aidl | 42 ++++++++++ .../vehicle/EvRegenerativeBrakingState.aidl | 41 ++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 6 ++ .../automotive/vehicle/VehicleUnit.aidl | 1 + .../automotive/vehicle/EvChargeState.aidl | 33 ++++++++ .../vehicle/EvRegenerativeBrakingState.aidl | 30 +++++++ .../automotive/vehicle/VehicleProperty.aidl | 79 +++++++++++++++++++ .../automotive/vehicle/VehicleUnit.aidl | 1 + 8 files changed, 233 insertions(+) create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvChargeState.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvChargeState.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvChargeState.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvChargeState.aidl new file mode 100644 index 0000000000..fe1c240a2d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvChargeState.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 -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 EvChargeState { + UNKNOWN = 0, + CHARGING = 1, + FULLY_CHARGED = 2, + NOT_CHARGING = 3, + ERROR = 4, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl new file mode 100644 index 0000000000..b8695623fb --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.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 -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 EvRegenerativeBrakingState { + UNKNOWN = 0, + DISABLED = 1, + PARTIALLY_ENABLED = 2, + FULLY_ENABLED = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl index bcb63b6c05..2505dbd6a7 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -198,4 +198,10 @@ enum VehicleProperty { FRONT_FOG_LIGHTS_SWITCH = 289410876, REAR_FOG_LIGHTS_STATE = 289410877, REAR_FOG_LIGHTS_SWITCH = 289410878, + EV_CHARGE_CURRENT_DRAW_LIMIT = 291508031, + EV_CHARGE_PERCENT_LIMIT = 291508032, + EV_CHARGE_STATE = 289410881, + EV_CHARGE_SWITCH = 287313730, + EV_CHARGE_TIME_REMAINING = 289410883, + EV_REGENERATIVE_BRAKING_STATE = 289410884, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl index 034dec540b..c80fdbbdbe 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleUnit.aidl @@ -60,6 +60,7 @@ enum VehicleUnit { MILLIWATTS = 99, AMPERE_HOURS = 100, KILOWATT_HOUR = 101, + AMPERE = 102, KILOPASCAL = 112, PSI = 113, BAR = 114, diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvChargeState.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvChargeState.aidl new file mode 100644 index 0000000000..e095fc4959 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvChargeState.aidl @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by EV charging properties to enumerate the current state of the battery charging. + */ +@VintfStability +@Backing(type="int") +enum EvChargeState { + UNKNOWN = 0, + CHARGING = 1, + FULLY_CHARGED = 2, + NOT_CHARGING = 3, + /** + * Vehicle not charging due to an error + */ + ERROR = 4, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl new file mode 100644 index 0000000000..438228719a --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by the regenerative braking property to enumerate the current state + * of the regenerative braking. + */ +@VintfStability +@Backing(type="int") +enum EvRegenerativeBrakingState { + UNKNOWN = 0, + DISABLED = 1, + PARTIALLY_ENABLED = 2, + FULLY_ENABLED = 3, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl index 533c7a280d..87b480235f 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -2724,4 +2724,83 @@ enum VehicleProperty { */ REAR_FOG_LIGHTS_SWITCH = 0x0F3E + 0x10000000 + 0x01000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Indicates the maximum current draw threshold for charging set by the user + * + * configArray[0] is used to specify the max current draw allowed by + * the vehicle in Amperes. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @unit VehicleUnit:AMPERE + */ + EV_CHARGE_CURRENT_DRAW_LIMIT = 0x0F3F + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + + /** + * Indicates the maximum charge percent threshold set by the user + * + * Returns a float value from 0 to 100. + * + * configArray is used to specify the valid values. + * For example, if the vehicle supports the following charge percent limit values: + * [20, 40, 60, 80, 100] + * then the configArray should be {20, 40, 60, 80, 100} + * If the configArray is empty then all values from 0 to 100 must be valid. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + EV_CHARGE_PERCENT_LIMIT = 0x0F40 + 0x10000000 + 0x01000000 + + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + + /** + * Charging state of the car + * + * Returns the current charging state of the car. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum EvChargeState + */ + EV_CHARGE_STATE = 0x0F41 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Start or stop charging the EV battery + * + * The setting that the user wants. Setting this property to true starts the battery charging + * and setting to false stops charging. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + EV_CHARGE_SWITCH = 0x0F42 + 0x10000000 + 0x01000000 + + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN + + /** + * Estimated charge time remaining in seconds + * + * Returns 0 if the vehicle is not charging. + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:SECS + */ + EV_CHARGE_TIME_REMAINING = 0x0F43 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Regenerative braking or one-pedal drive state of the car + * + * Returns the current state associated with the regenerative braking + * setting in the car + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum EvRegenerativeBrakingState + */ + EV_REGENERATIVE_BRAKING_STATE = 0x0F44 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl index 9c3f8f9852..3817b74ce9 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleUnit.aidl @@ -51,6 +51,7 @@ enum VehicleUnit { MILLIWATTS = 0x63, AMPERE_HOURS = 0x64, KILOWATT_HOUR = 0x65, + AMPERE = 0x66, KILOPASCAL = 0x70, PSI = 0x71, BAR = 0x72, -- GitLab From b30f4556fc5013abcd01254632e8a1de3ca5c2f8 Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Thu, 3 Feb 2022 19:33:13 +0000 Subject: [PATCH 559/825] Update documentation of SensorInfo.aidl Bug: 217750786 Test: None, comments only Change-Id: I8c5e6c15b398ea5935bdcac08605f3f7e7399d3a --- .../android/hardware/sensors/SensorInfo.aidl | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/sensors/aidl/android/hardware/sensors/SensorInfo.aidl b/sensors/aidl/android/hardware/sensors/SensorInfo.aidl index 35caf8bd67..065642ae86 100644 --- a/sensors/aidl/android/hardware/sensors/SensorInfo.aidl +++ b/sensors/aidl/android/hardware/sensors/SensorInfo.aidl @@ -21,7 +21,7 @@ import android.hardware.sensors.SensorType; @VintfStability parcelable SensorInfo { /** - * handle that identifies this sensors. This handle is used to reference + * Handle that identifies this sensors. This handle is used to reference * this sensor throughout the HAL API. */ int sensorHandle; @@ -33,25 +33,25 @@ parcelable SensorInfo { String name; /** - * vendor of the hardware part + * Vendor of the hardware part. */ String vendor; /** - * version of the hardware part + driver. The value of this field - * must increase when the driver is updated in a way that changes the - * output of this sensor. This is important for fused sensors when the - * fusion algorithm is updated. + * Version of the hardware part + driver, used for informational purposes. + * The value of this field must increase when the driver is updated in a + * way that changes the output of this sensor. This is important for fused + * sensors when the fusion algorithm is updated. */ int version; /** - * this sensor's type. + * This sensor's type. */ SensorType type; /** - * type of this sensor as a string. + * Type of this sensor as a string. * * When defining an OEM specific sensor or sensor manufacturer specific * sensor, use your reserve domain name as a prefix. @@ -63,22 +63,22 @@ parcelable SensorInfo { String typeAsString; /** - * maximum range of this sensor's value in SI units + * Maximum range of this sensor's value in SI units */ float maxRange; /** - * smallest difference between two values reported by this sensor + * Smallest difference between two values reported by this sensor */ float resolution; /** - * rough estimate of this sensor's power consumption in mA + * Rough estimate of this sensor's power consumption in mA */ float power; /** - * this value depends on the reporting mode: + * This value depends on the reporting mode: * * continuous: minimum sample period allowed in microseconds * on-change : 0 @@ -88,7 +88,7 @@ parcelable SensorInfo { int minDelayUs; /** - * number of events reserved for this sensor in the batch mode FIFO. + * Number of events reserved for this sensor in the batch mode FIFO. * If there is a dedicated FIFO for this sensor, then this is the * size of this FIFO. If the FIFO is shared with other sensors, * this is the size reserved for that sensor and it can be zero. @@ -96,14 +96,14 @@ parcelable SensorInfo { int fifoReservedEventCount; /** - * maximum number of events of this sensor that could be batched. + * Maximum number of events of this sensor that could be batched. * This is especially relevant when the FIFO is shared between * several sensors; this value is then set to the size of that FIFO. */ int fifoMaxEventCount; /** - * permission required to see this sensor, register to it and receive data. + * Permission required to see this sensor, register to it and receive data. * Set to "" if no permission is required. Some sensor types like the * heart rate monitor have a mandatory require_permission. * For sensors that always require a specific permission, like the heart -- GitLab From 6c4bb0aae66c7f1bec6c84403206f5be2d4bc0a3 Mon Sep 17 00:00:00 2001 From: Kiran Rachuri Date: Thu, 3 Feb 2022 19:24:06 +0000 Subject: [PATCH 560/825] Add trailer present property Bug: 197026083 Test: Build Change-Id: I734f35e3d7ef17aa47c2c2cc57ba87e6e7944e79 --- .../automotive/vehicle/TrailerState.aidl | 41 +++++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/TrailerState.aidl | 30 ++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 12 ++++++ 4 files changed, 84 insertions(+) create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/TrailerState.aidl create mode 100644 automotive/vehicle/aidl/android/hardware/automotive/vehicle/TrailerState.aidl diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/TrailerState.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/TrailerState.aidl new file mode 100644 index 0000000000..2491340acd --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/TrailerState.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 -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 TrailerState { + UNKNOWN = 0, + NOT_PRESENT = 1, + PRESENT = 2, + ERROR = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl index 2505dbd6a7..5cd814c259 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -204,4 +204,5 @@ enum VehicleProperty { EV_CHARGE_SWITCH = 287313730, EV_CHARGE_TIME_REMAINING = 289410883, EV_REGENERATIVE_BRAKING_STATE = 289410884, + TRAILER_PRESENT = 289410885, } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/TrailerState.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/TrailerState.aidl new file mode 100644 index 0000000000..fd420626d6 --- /dev/null +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/TrailerState.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by the trailer present property to enumerate the current state + * of the trailer. + */ +@VintfStability +@Backing(type="int") +enum TrailerState { + UNKNOWN = 0, + NOT_PRESENT = 1, + PRESENT = 2, + ERROR = 3, +} diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl index 87b480235f..9dbeae2c43 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -2803,4 +2803,16 @@ enum VehicleProperty { */ EV_REGENERATIVE_BRAKING_STATE = 0x0F44 + 0x10000000 + 0x01000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Indicates if there is a trailer present or not. + * + * Returns the trailer state of the car. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum TrailerState + */ + TRAILER_PRESENT = 0x0F45 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 } -- GitLab From 893ea216812749d3e22a9d94a8f4d92288431458 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Fri, 4 Feb 2022 00:00:11 +0000 Subject: [PATCH 561/825] audio: Remove IStreamIn@7.1 This has turned out to be an empty interface. By removing it we save about 100 kB in the interface code. Bug: 217752112 Test: atest VtsHalAudioV7_1TargetTest Change-Id: I2522653600a254ddcf2c4eac8bed1df69ac11d3d --- audio/7.1/Android.bp | 1 - audio/7.1/IDevice.hal | 32 ------------------- audio/7.1/IStreamIn.hal | 22 ------------- audio/core/all-versions/default/Device.cpp | 10 ------ .../default/include/core/default/Device.h | 4 --- .../default/include/core/default/StreamIn.h | 4 ++- .../functional/4.0/AudioPrimaryHidlHalUtils.h | 4 +-- .../vts/functional/AudioPrimaryHidlHalTest.h | 20 ++++++------ 8 files changed, 14 insertions(+), 83 deletions(-) delete mode 100644 audio/7.1/IStreamIn.hal diff --git a/audio/7.1/Android.bp b/audio/7.1/Android.bp index 52980e2626..cede72a321 100644 --- a/audio/7.1/Android.bp +++ b/audio/7.1/Android.bp @@ -17,7 +17,6 @@ hidl_interface { "IDevice.hal", "IDevicesFactory.hal", "IPrimaryDevice.hal", - "IStreamIn.hal", "IStreamOut.hal", "IStreamOutLatencyModeCallback.hal", ], diff --git a/audio/7.1/IDevice.hal b/audio/7.1/IDevice.hal index e0b1e92359..c158e7ec79 100644 --- a/audio/7.1/IDevice.hal +++ b/audio/7.1/IDevice.hal @@ -20,7 +20,6 @@ import android.hardware.audio.common@7.0; import @7.0::AudioInOutFlag; import @7.0::IDevice; import @7.0::Result; -import IStreamIn; import IStreamOut; interface IDevice extends @7.0::IDevice { @@ -55,37 +54,6 @@ interface IDevice extends @7.0::IDevice { IStreamOut outStream, AudioConfig suggestedConfig); - /** - * This method creates and opens the audio hardware input stream. - * If the stream can not be opened with the proposed audio config, - * HAL must provide suggested values for the audio config. - * - * Note: INVALID_ARGUMENTS is returned both in the case when the - * HAL can not use the provided config and in the case when - * the value of any argument is invalid. In the latter case the - * HAL must provide a default initialized suggested config. - * - * @param ioHandle handle assigned by AudioFlinger. - * @param device device type and (if needed) address. - * @param config stream configuration. - * @param flags additional flags. - * @param sinkMetadata Description of the audio that is suggested by the client. - * May be used by implementations to configure processing effects. - * @return retval operation completion status. - * @return inStream in case of success, created input stream. - * @return suggestedConfig in the case of rejection of the proposed config, - * a config suggested by the HAL. - */ - openInputStream_7_1( - AudioIoHandle ioHandle, - DeviceAddress device, - AudioConfig config, - vec flags, - SinkMetadata sinkMetadata) generates ( - Result retval, - IStreamIn inStream, - AudioConfig suggestedConfig); - /** * Notifies the device module about the connection state of an input/output * device attached to it. The devicePort identifies the device and may also diff --git a/audio/7.1/IStreamIn.hal b/audio/7.1/IStreamIn.hal deleted file mode 100644 index abebe6a062..0000000000 --- a/audio/7.1/IStreamIn.hal +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.audio@7.1; - -import @7.0::IStreamIn; - -interface IStreamIn extends @7.0::IStreamIn { -}; diff --git a/audio/core/all-versions/default/Device.cpp b/audio/core/all-versions/default/Device.cpp index ca8c03df36..b954fcd6f8 100644 --- a/audio/core/all-versions/default/Device.cpp +++ b/audio/core/all-versions/default/Device.cpp @@ -348,16 +348,6 @@ Return Device::openOutputStream_7_1(int32_t ioHandle, const DeviceAddress& _hidl_cb(result, streamOut, suggestedConfig); return Void(); } - -Return Device::openInputStream_7_1(int32_t ioHandle, const DeviceAddress& device, - const AudioConfig& config, const AudioInputFlags& flags, - const SinkMetadata& sinkMetadata, - openInputStream_7_1_cb _hidl_cb) { - auto [result, streamIn, suggestedConfig] = - openInputStreamImpl(ioHandle, device, config, flags, sinkMetadata); - _hidl_cb(result, streamIn, suggestedConfig); - return Void(); -} #endif // V7.1 Return Device::supportsAudioPatches() { diff --git a/audio/core/all-versions/default/include/core/default/Device.h b/audio/core/all-versions/default/include/core/default/Device.h index 8cde3e0a06..0696f97983 100644 --- a/audio/core/all-versions/default/include/core/default/Device.h +++ b/audio/core/all-versions/default/include/core/default/Device.h @@ -123,10 +123,6 @@ struct Device : public IDevice, public ParametersUtil { const AudioConfig& config, const AudioOutputFlags& flags, const SourceMetadata& sourceMetadata, openOutputStream_7_1_cb _hidl_cb) override; - Return openInputStream_7_1(int32_t ioHandle, const DeviceAddress& device, - const AudioConfig& config, const AudioInputFlags& flags, - const SinkMetadata& sinkMetadata, - openInputStream_7_1_cb _hidl_cb) override; #endif Return supportsAudioPatches() override; diff --git a/audio/core/all-versions/default/include/core/default/StreamIn.h b/audio/core/all-versions/default/include/core/default/StreamIn.h index a6346e5db4..4627eecae6 100644 --- a/audio/core/all-versions/default/include/core/default/StreamIn.h +++ b/audio/core/all-versions/default/include/core/default/StreamIn.h @@ -17,7 +17,9 @@ #ifndef ANDROID_HARDWARE_AUDIO_STREAMIN_H #define ANDROID_HARDWARE_AUDIO_STREAMIN_H -#include PATH(android/hardware/audio/FILE_VERSION/IStreamIn.h) +// clang-format off +#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/IStreamIn.h) +// clang-format on #include "Device.h" #include "Stream.h" diff --git a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalUtils.h b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalUtils.h index a567cf90e2..83ca9eba17 100644 --- a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalUtils.h +++ b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalUtils.h @@ -15,9 +15,9 @@ */ // clang-format off -#include PATH(android/hardware/audio/FILE_VERSION/IStreamIn.h) -#include PATH(android/hardware/audio/FILE_VERSION/IStreamOut.h) +#include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/IStreamIn.h) #include PATH(android/hardware/audio/CORE_TYPES_FILE_VERSION/types.h) +#include PATH(android/hardware/audio/FILE_VERSION/IStreamOut.h) #include PATH(android/hardware/audio/common/COMMON_TYPES_FILE_VERSION/types.h) // clang-format on #include diff --git a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h index 404532a6fa..fa3ee7fdb5 100644 --- a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h +++ b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h @@ -91,8 +91,9 @@ using ::android::hardware::details::toHexString; using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using namespace ::android::hardware::audio::common::test::utility; using namespace ::android::hardware::audio::CPP_VERSION; -using ReadParameters = ::android::hardware::audio::CPP_VERSION::IStreamIn::ReadParameters; -using ReadStatus = ::android::hardware::audio::CPP_VERSION::IStreamIn::ReadStatus; +using ReadParameters = + ::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn::ReadParameters; +using ReadStatus = ::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn::ReadStatus; using WriteCommand = ::android::hardware::audio::CPP_VERSION::IStreamOut::WriteCommand; using WriteStatus = ::android::hardware::audio::CPP_VERSION::IStreamOut::WriteStatus; #if MAJOR_VERSION >= 7 @@ -1089,7 +1090,7 @@ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(OutputStreamTest); class StreamReader : public StreamWorker { public: - using IStreamIn = ::android::hardware::audio::CPP_VERSION::IStreamIn; + using IStreamIn = ::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn; StreamReader(IStreamIn* stream, size_t bufferSize) : mStream(stream), mBufferSize(bufferSize), mData(mBufferSize) {} @@ -1204,7 +1205,8 @@ class StreamReader : public StreamWorker { EventFlag* mEfGroup = nullptr; }; -class InputStreamTest : public OpenStreamTest<::android::hardware::audio::CPP_VERSION::IStreamIn> { +class InputStreamTest + : public OpenStreamTest<::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn> { void SetUp() override { ASSERT_NO_FATAL_FAILURE(OpenStreamTest::SetUp()); // setup base #if MAJOR_VERSION <= 6 @@ -1226,13 +1228,8 @@ class InputStreamTest : public OpenStreamTest<::android::hardware::audio::CPP_VE auto flags = getInputFlags(); testOpen( [&](AudioIoHandle handle, AudioConfig config, auto cb) { -#if MAJOR_VERSION < 7 || (MAJOR_VERSION == 7 && MINOR_VERSION == 0) return getDevice()->openInputStream(handle, address, config, flags, initMetadata, cb); -#elif MAJOR_VERSION == 7 && MINOR_VERSION == 1 - return getDevice()->openInputStream_7_1(handle, address, config, flags, - initMetadata, cb); -#endif }, config); } @@ -1605,8 +1602,9 @@ TEST_P(InputStreamTest, SetGain) { "InputStream::setGain"); } -static void testPrepareForReading(::android::hardware::audio::CPP_VERSION::IStreamIn* stream, - uint32_t frameSize, uint32_t framesCount) { +static void testPrepareForReading( + ::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn* stream, uint32_t frameSize, + uint32_t framesCount) { Result res; // Ignore output parameters as the call should fail ASSERT_OK(stream->prepareForReading(frameSize, framesCount, -- GitLab From d1431859b36977605e1a0b5aa5278b5699211357 Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 3 Feb 2022 20:28:12 -0500 Subject: [PATCH 562/825] Add minimal IAllocator AIDL VTS test Bug: 217776226 Test: this Change-Id: I3cca43b435e05e3909a943991b5dad69c1e4e56e --- graphics/allocator/aidl/vts/Android.bp | 62 ++++++ ...VtsHalGraphicsAllocatorAidl_TargetTest.cpp | 189 ++++++++++++++++++ 2 files changed, 251 insertions(+) create mode 100644 graphics/allocator/aidl/vts/Android.bp create mode 100644 graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp diff --git a/graphics/allocator/aidl/vts/Android.bp b/graphics/allocator/aidl/vts/Android.bp new file mode 100644 index 0000000000..d74129b059 --- /dev/null +++ b/graphics/allocator/aidl/vts/Android.bp @@ -0,0 +1,62 @@ +/** + * 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. + */ + +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: "VtsHalGraphicsAllocatorAidl_TargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: [ + "VtsHalGraphicsAllocatorAidl_TargetTest.cpp", + ], + + shared_libs: [ + "android.hardware.graphics.allocator-V1-ndk", + "android.hardware.graphics.common-V3-ndk", + "android.hardware.graphics.mapper@4.0", + "libEGL", + "libGLESv2", + "libbinder_ndk", + "libbase", + "libsync", + "libui", + "libgui", + "libhidlbase", + "libvndksupport", + ], + static_libs: [ + "libaidlcommonsupport", + "libgtest", + ], + cflags: [ + "-Wall", + "-Werror", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp b/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp new file mode 100644 index 0000000000..784bc66cc5 --- /dev/null +++ b/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp @@ -0,0 +1,189 @@ +/* + * Copyright 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. + */ + +#define LOG_TAG "VtsHalGraphicsAllocatorAidl_TargetTest" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace aidl::android::hardware::graphics::allocator; +using namespace aidl::android::hardware::graphics::common; +using namespace android; +using namespace android::hardware; +using namespace android::hardware::graphics::mapper::V4_0; + +static constexpr uint64_t pack(const std::initializer_list& usages) { + uint64_t ret = 0; + for (const auto u : usages) { + ret |= static_cast(u); + } + return ret; +} + +static constexpr hardware::graphics::common::V1_2::PixelFormat cast(PixelFormat format) { + return static_cast(format); +} + +class BufferHandle { + sp mMapper; + native_handle_t* mRawHandle; + bool mImported = false; + uint32_t mStride; + + BufferHandle(const BufferHandle&) = delete; + void operator=(const BufferHandle&) = delete; + + public: + BufferHandle(const sp mapper, native_handle_t* handle, bool imported, uint32_t stride) + : mMapper(mapper), mRawHandle(handle), mImported(imported), mStride(stride) {} + + ~BufferHandle() { + if (mRawHandle == nullptr) return; + + if (mImported) { + Error error = mMapper->freeBuffer(mRawHandle); + EXPECT_EQ(Error::NONE, error) << "failed to free buffer " << mRawHandle; + } else { + native_handle_close(mRawHandle); + native_handle_delete(mRawHandle); + } + } + + uint32_t stride() const { return mStride; } +}; + +class GraphicsAllocatorAidlTests + : public ::testing::TestWithParam> { + private: + std::shared_ptr mAllocator; + sp mMapper; + + public: + void SetUp() override { + mAllocator = IAllocator::fromBinder( + ndk::SpAIBinder(AServiceManager_checkService(std::get<0>(GetParam()).c_str()))); + mMapper = IMapper::getService(std::get<1>(GetParam())); + + ASSERT_NE(nullptr, mAllocator.get()) << "failed to get allocator service"; + ASSERT_NE(nullptr, mMapper.get()) << "failed to get mapper service"; + ASSERT_FALSE(mMapper->isRemote()) << "mapper is not in passthrough mode"; + } + + void TearDown() override {} + + BufferDescriptor createDescriptor(const IMapper::BufferDescriptorInfo& descriptorInfo) { + BufferDescriptor descriptor; + mMapper->createDescriptor( + descriptorInfo, [&](const auto& tmpError, const auto& tmpDescriptor) { + ASSERT_EQ(Error::NONE, tmpError) << "failed to create descriptor"; + descriptor = tmpDescriptor; + }); + + return descriptor; + } + + native_handle_t* importBuffer(const hidl_handle& rawHandle) { + native_handle_t* bufferHandle = nullptr; + mMapper->importBuffer(rawHandle, [&](const auto& tmpError, const auto& tmpBuffer) { + ASSERT_EQ(Error::NONE, tmpError) + << "failed to import buffer %p" << rawHandle.getNativeHandle(); + bufferHandle = static_cast(tmpBuffer); + }); + return bufferHandle; + } + + std::unique_ptr allocate(const IMapper::BufferDescriptorInfo& descriptorInfo, + bool import = false) { + auto descriptor = createDescriptor(descriptorInfo); + if (::testing::Test::HasFatalFailure()) { + return nullptr; + } + + AllocationResult result; + auto status = mAllocator->allocate(descriptor, 1, &result); + if (!status.isOk()) { + status_t error = status.getExceptionCode(); + if (error == EX_SERVICE_SPECIFIC) { + error = status.getServiceSpecificError(); + EXPECT_NE(OK, error) << "Failed to set error properly"; + EXPECT_EQ(OK, error) << "Failed to allocate"; + } else { + EXPECT_EQ(OK, error) << "Allocation transport failure"; + } + return nullptr; + } else { + if (import) { + native_handle_t* importedHandle = importBuffer(makeFromAidl(result.buffers[0])); + if (importedHandle) { + return std::make_unique(mMapper, importedHandle, true, + result.stride); + } else { + return nullptr; + } + } else { + return std::make_unique(mMapper, dupFromAidl(result.buffers[0]), + false, result.stride); + } + } + } +}; + +TEST_P(GraphicsAllocatorAidlTests, CreateDescriptorBasic) { + ASSERT_NO_FATAL_FAILURE(createDescriptor({ + .name = "CPU_8888", + .width = 64, + .height = 64, + .layerCount = 1, + .format = cast(PixelFormat::RGBA_8888), + .usage = pack({BufferUsage::CPU_WRITE_OFTEN, BufferUsage::CPU_READ_OFTEN}), + .reservedSize = 0, + })); +} + +TEST_P(GraphicsAllocatorAidlTests, CanAllocate) { + auto buffer = allocate({ + .name = "CPU_8888", + .width = 64, + .height = 64, + .layerCount = 1, + .format = cast(PixelFormat::RGBA_8888), + .usage = pack({BufferUsage::CPU_WRITE_OFTEN, BufferUsage::CPU_READ_OFTEN}), + .reservedSize = 0, + }); + ASSERT_NE(nullptr, buffer.get()); + EXPECT_GE(buffer->stride(), 64); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsAllocatorAidlTests); +INSTANTIATE_TEST_CASE_P( + PerInstance, GraphicsAllocatorAidlTests, + testing::Combine(testing::ValuesIn(getAidlHalInstanceNames(IAllocator::descriptor)), + testing::ValuesIn(getAllHalInstanceNames(IMapper::descriptor))), + PrintInstanceTupleNameToString<>); \ No newline at end of file -- GitLab From 7267abff252f63c76a5390dba4a3ab8d14c3bafc Mon Sep 17 00:00:00 2001 From: Shuzhen Wang Date: Tue, 14 Dec 2021 20:12:08 -0800 Subject: [PATCH 563/825] Camera: Add stream use case API - Add availableStreamUseCase static metadata tag - Add STREAM_USE_CASE camera capability - Add useCase flag in camera stream interface Test: atest VtsHalCameraProviderV2_4TargetTest Bug: 200307880 Change-Id: I4e473edcb52a97fa0e1b27cf94603cf9f9984f82 --- camera/device/3.8/ICameraDevice.hal | 3 +- camera/device/3.8/ICameraDeviceSession.hal | 3 + camera/device/3.8/types.hal | 37 ++-- camera/metadata/3.8/types.hal | 23 +++ .../VtsHalCameraProviderV2_4TargetTest.cpp | 182 ++++++++++++++++++ 5 files changed, 234 insertions(+), 14 deletions(-) diff --git a/camera/device/3.8/ICameraDevice.hal b/camera/device/3.8/ICameraDevice.hal index 8832c68098..09edb8ba20 100644 --- a/camera/device/3.8/ICameraDevice.hal +++ b/camera/device/3.8/ICameraDevice.hal @@ -113,7 +113,8 @@ interface ICameraDevice extends @3.7::ICameraDevice { * * Identical to @3.7::ICameraDevice.isStreamCombinationSupported, except * that it takes a @3.8::StreamConfiguration parameter, which could contain - * additional information about a specific 10-bit dynamic range profile. + * additional information about a specific 10-bit dynamic range profile or + * stream use case. * */ isStreamCombinationSupported_3_8(StreamConfiguration streams) diff --git a/camera/device/3.8/ICameraDeviceSession.hal b/camera/device/3.8/ICameraDeviceSession.hal index 88e4338209..c3aa836ec1 100644 --- a/camera/device/3.8/ICameraDeviceSession.hal +++ b/camera/device/3.8/ICameraDeviceSession.hal @@ -35,6 +35,8 @@ interface ICameraDeviceSession extends @3.7::ICameraDeviceSession { * * - The requestedConfiguration allows the camera framework to configure * 10-bit dynamic range profile. + * - The requestedConfiguration allows the camera framework to configure + * stream use cases. * * @return status Status code for the operation, one of: * OK: @@ -61,6 +63,7 @@ interface ICameraDeviceSession extends @3.7::ICameraDeviceSession { * input stream. * - Invalid combination between a 10-bit dynamic range profile * and none impl. defined 8-bit format for a particular stream. + * - Unsupported stream use case * The camera service cannot filter out all possible illegal stream * configurations, since some devices may support more simultaneous * streams or larger stream resolutions than the minimum required diff --git a/camera/device/3.8/types.hal b/camera/device/3.8/types.hal index 9d1ac22f5a..04a245085b 100644 --- a/camera/device/3.8/types.hal +++ b/camera/device/3.8/types.hal @@ -17,6 +17,7 @@ package android.hardware.camera.device@3.8; import @3.2::ErrorMsg; +import @3.2::CameraMetadata; import @3.2::MsgType; import @3.2::ShutterMsg; import @3.2::CameraMetadata; @@ -24,6 +25,7 @@ import @3.2::StreamConfigurationMode; import @3.7::Stream; import android.hardware.camera.metadata@3.8::CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap; +import android.hardware.camera.metadata@3.8::CameraMetadataEnumAndroidScalerAvailableStreamUseCases; /** * ShutterMsg: @@ -80,7 +82,8 @@ struct NotifyMsg { * by the framework by its buffer resolution and format, and additionally by the * HAL with the gralloc usage flags and the maximum in-flight buffer count. * - * This version extends the @3.7 Stream with the dynamic range profile field. + * This version extends the @3.7 Stream with the dynamic range profile and the + * stream use case field. */ struct Stream { /** @@ -98,6 +101,25 @@ struct Stream { * */ CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap dynamicRangeProfile; + + /** + * The stream use case describing the stream's purpose + * + * This flag provides the camera device a hint on what user scenario this + * stream is intended for. With this flag, the camera device can optimize + * camera pipeline parameters, such as tuning, sensor mode, and ISP settings, + * for the intended use case. + * + * When this field is set to DEFAULT, the camera device should behave in + * the same way as in previous HAL versions, and optimize the camera pipeline + * based on stream format, data space, usage flag, and other stream properties. + * + * The HAL reports supported stream use cases in + * ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES. If the HAL doesn't support + * setting stream use cases, the camera framework leaves this field as + * DEFAULT. + */ + CameraMetadataEnumAndroidScalerAvailableStreamUseCases useCase; }; /** @@ -115,7 +137,6 @@ struct StreamConfiguration { /** * The definition of operation mode from prior version. - * */ @3.2::StreamConfigurationMode operationMode; @@ -130,17 +151,7 @@ struct StreamConfiguration { uint32_t streamConfigCounter; /** - * If an input stream is configured, whether the input stream is expected to - * receive variable resolution images. - * - * This flag can only be set to true if the camera device supports - * multi-resolution input streams by advertising input stream configurations in - * physicalCameraMultiResolutionStreamConfigurations in its physical cameras' - * characteristics. - * - * When this flag is set to true, the input stream's width and height can be - * any one of the supported multi-resolution input stream sizes. + * The definition of multi-resolution input image flag from prior version. */ bool multiResolutionInputImage; }; - diff --git a/camera/metadata/3.8/types.hal b/camera/metadata/3.8/types.hal index 4c70eb9528..488bf9d3cc 100644 --- a/camera/metadata/3.8/types.hal +++ b/camera/metadata/3.8/types.hal @@ -68,6 +68,14 @@ enum CameraMetadataTag : @3.7::CameraMetadataTag { ANDROID_REQUEST_END_3_8, + /** android.scaler.availableStreamUseCases [static, enum[], public] + * + *

The stream use cases supported by this camera device.

+ */ + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES = android.hardware.camera.metadata@3.6::CameraMetadataTag:ANDROID_SCALER_END_3_6, + + ANDROID_SCALER_END_3_8, + }; /* @@ -88,6 +96,7 @@ enum CameraMetadataEnumAndroidControlVideoStabilizationMode : enum CameraMetadataEnumAndroidRequestAvailableCapabilities : @3.6::CameraMetadataEnumAndroidRequestAvailableCapabilities { ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE, }; /** android.request.availableDynamicRangeProfilesMap enumeration values @@ -129,3 +138,17 @@ enum CameraMetadataEnumAndroidScalerAvailableRecommendedStreamConfigurations : ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END_3_8 = 0x9, }; + +/** android.scaler.availableStreamUseCases enumeration values + * @see ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES + */ +enum CameraMetadataEnumAndroidScalerAvailableStreamUseCases : uint32_t { + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0x0, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 0x1, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE = 0x2, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD = 0x3, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL + = 0x4, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL = 0x5, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START = 0x10000, +}; diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index 8c44010441..3254cf2a21 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -135,6 +136,8 @@ using ::android::hardware::camera::metadata::V3_4::CameraMetadataTag; using ::android::hardware::camera::metadata::V3_6::CameraMetadataEnumAndroidSensorPixelMode; using ::android::hardware::camera::metadata::V3_8:: CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap; +using ::android::hardware::camera::metadata::V3_8:: + CameraMetadataEnumAndroidScalerAvailableStreamUseCases; using ::android::hardware::camera::provider::V2_4::ICameraProvider; using ::android::hardware::camera::provider::V2_4::ICameraProviderCallback; using ::android::hardware::camera::provider::V2_6::CameraIdAndStreamCombination; @@ -198,6 +201,15 @@ enum SystemCameraKind { HIDDEN_SECURE_CAMERA }; +const static std::vector kMandatoryUseCases = { + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL +}; + namespace { // "device@/legacy/" const char *kDeviceNameRE = "device@([0-9]+\\.[0-9]+)/%s/(.+)"; @@ -879,6 +891,7 @@ public: void verifyCameraCharacteristics(Status status, const CameraMetadata& chars); void verifyExtendedSceneModeCharacteristics(const camera_metadata_t* metadata); void verifyZoomCharacteristics(const camera_metadata_t* metadata); + void verifyStreamUseCaseCharacteristics(const camera_metadata_t* metadata); void verifyRecommendedConfigs(const CameraMetadata& metadata); void verifyMonochromeCharacteristics(const CameraMetadata& chars, int deviceVersion); void verifyMonochromeCameraResult( @@ -6879,6 +6892,134 @@ TEST_P(CameraHidlTest, configureInjectionStreamsWithSessionParameters) { } } +// Verify that valid stream use cases can be configured successfully, and invalid use cases +// fail stream configuration. +TEST_P(CameraHidlTest, configureStreamsUseCases) { + hidl_vec cameraDeviceNames = getCameraDeviceNames(mProvider); + + for (const auto& name : cameraDeviceNames) { + int deviceVersion = getCameraDeviceVersion(name, mProviderType); + if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_8) { + continue; + } + + camera_metadata_t* staticMeta; + Return ret; + sp session; + sp session3_3; + sp session3_4; + sp session3_5; + sp session3_6; + sp session3_7; + sp session3_8; + sp cameraDevice; + sp cameraDevice3_5; + sp cameraDevice3_7; + sp cameraDevice3_8; + openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/, + &cameraDevice /*out*/); + castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, + &session3_6, &session3_7, &session3_8); + ASSERT_NE(nullptr, session3_8); + castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, + &cameraDevice3_8); + ASSERT_NE(nullptr, cameraDevice3_8); + + // Check if camera support depth only + if (isDepthOnly(staticMeta)) { + free_camera_metadata(staticMeta); + ret = session->close(); + ASSERT_TRUE(ret.isOk()); + continue; + } + + std::vector outputPreviewStreams; + AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::YCBCR_420_888)}; + ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputPreviewStreams, + &previewThreshold)); + ASSERT_NE(0u, outputPreviewStreams.size()); + + // Combine valid and invalid stream use cases + std::vector useCases(kMandatoryUseCases); + useCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL + 1); + + std::vector supportedUseCases; + camera_metadata_ro_entry entry; + auto retcode = find_camera_metadata_ro_entry(staticMeta, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, &entry); + if ((0 == retcode) && (entry.count > 0)) { + supportedUseCases.insert(supportedUseCases.end(), entry.data.i32, + entry.data.i32 + entry.count); + } else { + supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT); + } + free_camera_metadata(staticMeta); + + ::android::hardware::hidl_vec streams3_8(1); + streams3_8[0].v3_7.groupId = -1; + streams3_8[0].v3_7.sensorPixelModesUsed = { + CameraMetadataEnumAndroidSensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}; + streams3_8[0].v3_7.v3_4.bufferSize = 0; + streams3_8[0].v3_7.v3_4.v3_2.id = 0; + streams3_8[0].v3_7.v3_4.v3_2.streamType = StreamType::OUTPUT; + streams3_8[0].v3_7.v3_4.v3_2.width = static_cast(outputPreviewStreams[0].width); + streams3_8[0].v3_7.v3_4.v3_2.height = static_cast(outputPreviewStreams[0].height); + streams3_8[0].v3_7.v3_4.v3_2.format = + static_cast(outputPreviewStreams[0].format); + streams3_8[0].v3_7.v3_4.v3_2.usage = GRALLOC1_CONSUMER_USAGE_CPU_READ; + streams3_8[0].v3_7.v3_4.v3_2.dataSpace = 0; + streams3_8[0].v3_7.v3_4.v3_2.rotation = StreamRotation::ROTATION_0; + streams3_8[0].dynamicRangeProfile = + static_cast( + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD); + + uint32_t streamConfigCounter = 0; + ::android::hardware::camera::device::V3_8::StreamConfiguration config3_8; + RequestTemplate reqTemplate = RequestTemplate::STILL_CAPTURE; + ret = session3_8->constructDefaultRequestSettings(reqTemplate, + [&config3_8](auto status, const auto& req) { + ASSERT_EQ(Status::OK, status); + config3_8.sessionParams = req; + }); + ASSERT_TRUE(ret.isOk()); + + for (int32_t useCase : useCases) { + bool useCaseSupported = std::find(supportedUseCases.begin(), + supportedUseCases.end(), useCase) != supportedUseCases.end(); + + streams3_8[0].useCase = + static_cast(useCase); + config3_8.streams = streams3_8; + config3_8.operationMode = StreamConfigurationMode::NORMAL_MODE; + config3_8.streamConfigCounter = streamConfigCounter; + config3_8.multiResolutionInputImage = false; + ret = cameraDevice3_8->isStreamCombinationSupported_3_8( + config3_8, [&useCaseSupported](Status s, bool combStatus) { + ASSERT_TRUE((Status::OK == s) || (Status::METHOD_NOT_SUPPORTED == s)); + if (Status::OK == s) { + ASSERT_EQ(combStatus, useCaseSupported); + } + }); + ASSERT_TRUE(ret.isOk()); + + ret = session3_8->configureStreams_3_8( + config3_8, + [&](Status s, device::V3_6::HalStreamConfiguration halConfig) { + if (useCaseSupported) { + ASSERT_EQ(Status::OK, s); + ASSERT_EQ(1u, halConfig.streams.size()); + } else { + ASSERT_EQ(Status::ILLEGAL_ARGUMENT, s); + } + }); + ASSERT_TRUE(ret.isOk()); + } + ret = session3_8->close(); + ASSERT_TRUE(ret.isOk()); + } +} + // Retrieve all valid output stream resolutions from the camera // static characteristics. Status CameraHidlTest::getAvailableOutputStreams(const camera_metadata_t* staticMeta, @@ -9042,6 +9183,7 @@ void CameraHidlTest::verifyCameraCharacteristics(Status status, const CameraMeta verifyExtendedSceneModeCharacteristics(metadata); verifyZoomCharacteristics(metadata); + verifyStreamUseCaseCharacteristics(metadata); } void CameraHidlTest::verifyExtendedSceneModeCharacteristics(const camera_metadata_t* metadata) { @@ -9272,6 +9414,46 @@ void CameraHidlTest::verifyZoomCharacteristics(const camera_metadata_t* metadata } } +void CameraHidlTest::verifyStreamUseCaseCharacteristics(const camera_metadata_t* metadata) { + camera_metadata_ro_entry entry; + // Check capabilities + int retcode = find_camera_metadata_ro_entry(metadata, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES, &entry); + bool hasStreamUseCaseCap = false; + if ((0 == retcode) && (entry.count > 0)) { + if (std::find(entry.data.u8, entry.data.u8 + entry.count, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE) != + entry.data.u8 + entry.count) { + hasStreamUseCaseCap = true; + } + } + + bool supportMandatoryUseCases = false; + retcode = find_camera_metadata_ro_entry(metadata, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, &entry); + if ((0 == retcode) && (entry.count > 0)) { + supportMandatoryUseCases = true; + for (size_t i = 0; i < kMandatoryUseCases.size(); i++) { + if (std::find(entry.data.i32, entry.data.i32 + entry.count, kMandatoryUseCases[i]) + == entry.data.i32 + entry.count) { + supportMandatoryUseCases = false; + break; + } + } + bool supportDefaultUseCase = false; + for (size_t i = 0; i < entry.count; i++) { + if (entry.data.i32[i] == ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT) { + supportDefaultUseCase = true; + } + ASSERT_TRUE(entry.data.i32[i] <= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL || + entry.data.i32[i] >= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START); + } + ASSERT_TRUE(supportDefaultUseCase); + } + + ASSERT_EQ(hasStreamUseCaseCap, supportMandatoryUseCases); +} + void CameraHidlTest::verifyMonochromeCharacteristics(const CameraMetadata& chars, int deviceVersion) { const camera_metadata_t* metadata = (camera_metadata_t*)chars.data(); -- GitLab From d0c0bbb6ce0c4b75bc241ad1c176eabc8f55b497 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 3 Feb 2022 17:32:28 -0800 Subject: [PATCH 564/825] Remove full namespace in header file. Test: Presubmit. Bug: 215443397 Change-Id: If8d3556e06119d12f515dc68a591e0f342761d6f --- .../GeneratorHub/include/FakeValueGenerator.h | 2 +- .../GeneratorHub/include/GeneratorHub.h | 4 +- .../include/JsonFakeValueGenerator.h | 8 +- .../include/LinearFakeValueGenerator.h | 4 +- .../hardware/include/FakeVehicleHardware.h | 60 +++---- .../obd2frame/include/FakeObd2Frame.h | 16 +- .../obd2frame/include/Obd2SensorStore.h | 22 +-- .../fake_impl/userhal/include/FakeUserHal.h | 16 +- .../fake_impl/userhal/include/UserHalHelper.h | 40 +++-- .../impl/hardware/include/IVehicleHardware.h | 20 +-- .../utils/common/include/ConcurrentQueue.h | 2 +- .../utils/common/include/ParcelableUtils.h | 24 +-- .../utils/common/include/VehicleObjectPool.h | 47 +++--- .../common/include/VehiclePropertyStore.h | 38 ++--- .../impl/utils/common/include/VehicleUtils.h | 149 +++++++++--------- .../utils/test/include/TestPropertyUtils.h | 2 +- .../aidl/impl/vhal/include/ConnectedClient.h | 8 +- .../impl/vhal/include/DefaultVehicleHal.h | 77 +++++---- .../impl/vhal/include/SubscriptionManager.h | 20 +-- .../impl/vhal/test/ConnectedClientTest.cpp | 2 +- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 10 +- .../aidl/impl/vhal/test/MockVehicleCallback.h | 32 ++-- .../aidl/impl/vhal/test/MockVehicleHardware.h | 48 +++--- .../impl/vhal/test/RecurrentTimerTest.cpp | 2 +- .../vhal/test/SubscriptionManagerTest.cpp | 8 +- 25 files changed, 326 insertions(+), 335 deletions(-) diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/FakeValueGenerator.h b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/FakeValueGenerator.h index 93ffebfc6b..5c90c301bc 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/FakeValueGenerator.h +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/FakeValueGenerator.h @@ -33,7 +33,7 @@ class FakeValueGenerator { virtual ~FakeValueGenerator() = default; // Returns the next event if there is one or {@code std::nullopt} if there is none. - virtual std::optional<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> + virtual std::optional nextEvent() = 0; }; diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/GeneratorHub.h b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/GeneratorHub.h index ad04d2385c..9f112ae794 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/GeneratorHub.h +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/GeneratorHub.h @@ -44,7 +44,7 @@ namespace fake { class GeneratorHub { public: using OnHalEvent = std::function; + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& event)>; explicit GeneratorHub(OnHalEvent&& onHalEvent); ~GeneratorHub(); @@ -60,7 +60,7 @@ class GeneratorHub { private: struct VhalEvent { int32_t generatorId; - ::aidl::android::hardware::automotive::vehicle::VehiclePropValue val; + aidl::android::hardware::automotive::vehicle::VehiclePropValue val; }; // Comparator used by priority queue to keep track of soonest event. diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h index 8116ed205b..947eb4f748 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h @@ -37,7 +37,7 @@ class JsonFakeValueGenerator : public FakeValueGenerator { // {@code int32Values} has less than 2 elements, number of iterations would be set to -1, which // means iterate indefinitely. explicit JsonFakeValueGenerator( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& request); + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& request); // Create a new JSON fake value generator using the specified JSON file path. All the events // in the JSON file would be generated for number of {@code iteration}. If iteration is 0, no // value would be generated. If iteration is less than 0, it would iterate indefinitely. @@ -48,14 +48,14 @@ class JsonFakeValueGenerator : public FakeValueGenerator { ~JsonFakeValueGenerator() = default; - std::optional<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> nextEvent() + std::optional nextEvent() override; - const std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>& + const std::vector& getAllEvents(); private: size_t mEventIndex = 0; - std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> mEvents; + std::vector mEvents; long mLastEventTimestamp = 0; int32_t mNumOfIterations = 0; diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/LinearFakeValueGenerator.h b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/LinearFakeValueGenerator.h index bd004f3483..d2b701d9a5 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/LinearFakeValueGenerator.h +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/LinearFakeValueGenerator.h @@ -35,7 +35,7 @@ class LinearFakeValueGenerator : public FakeValueGenerator { // int64Values[0]: interval // {@code propId} must be INT32 or INT64 or FLOAT type. explicit LinearFakeValueGenerator( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& request); + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& request); // A linear value generator in range [middleValue - dispersion, middleValue + dispersion), // starts at 'currentValue' and at each 'interval', increase by 'increment' and loop back if // exceeds middleValue + dispersion. {@code propId} must be INT32 or INT64 or FLOAT type. @@ -43,7 +43,7 @@ class LinearFakeValueGenerator : public FakeValueGenerator { float dispersion, float increment, int64_t interval); ~LinearFakeValueGenerator() = default; - std::optional<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> nextEvent() + std::optional nextEvent() override; private: 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 578d045376..9634c80bfc 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -46,30 +46,30 @@ class FakeVehicleHardware : public IVehicleHardware { explicit FakeVehicleHardware(std::unique_ptr valuePool); // Get all the property configs. - std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig> + std::vector getAllPropertyConfigs() const override; // Set property values asynchronously. Server could return before the property set requests // are sent to vehicle bus or before property set confirmation is received. The callback is // safe to be called after the function returns and is safe to be called in a different thread. - ::aidl::android::hardware::automotive::vehicle::StatusCode setValues( + aidl::android::hardware::automotive::vehicle::StatusCode setValues( std::shared_ptr callback, - const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>& + const std::vector& requests) override; // Get property values asynchronously. Server could return before the property values are ready. // The callback is safe to be called after the function returns and is safe to be called in a // different thread. - ::aidl::android::hardware::automotive::vehicle::StatusCode getValues( + aidl::android::hardware::automotive::vehicle::StatusCode getValues( std::shared_ptr callback, - const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>& + const std::vector& requests) const override; // Dump debug information in the server. DumpResult dump(const std::vector& options) override; // Check whether the system is healthy, return {@code StatusCode::OK} for healthy. - ::aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() override; + aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() override; // Register a callback that would be called when there is a property change event from vehicle. void registerOnPropertyChangeEvent( @@ -85,11 +85,11 @@ class FakeVehicleHardware : public IVehicleHardware { const std::shared_ptr mValuePool; const std::shared_ptr mServerSidePropStore; - ::android::base::Result getValue( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; + android::base::Result getValue( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; - ::android::base::Result setValue( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + android::base::Result setValue( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); private: // Expose private methods to unit test. @@ -108,33 +108,33 @@ class FakeVehicleHardware : public IVehicleHardware { void storePropInitialValue(const defaultconfig::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); // If property "persist.vendor.vhal_init_value_override" is set to true, override the properties // using config files in 'overrideDir'. void maybeOverrideProperties(const char* overrideDir); // Override the properties using config files in 'overrideDir'. void overrideProperties(const char* overrideDir); - ::android::base::Result maybeSetSpecialValue( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, + android::base::Result maybeSetSpecialValue( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, bool* isSpecialValue); - ::android::base::Result maybeGetSpecialValue( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, + android::base::Result maybeGetSpecialValue( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, bool* isSpecialValue) const; - ::android::base::Result setApPowerStateReport( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + android::base::Result setApPowerStateReport( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); VehiclePropValuePool::RecyclableType createApPowerStateReq( - ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq state); - ::android::base::Result setUserHalProp( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); - ::android::base::Result getUserHalProp( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; + aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq state); + android::base::Result setUserHalProp( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + android::base::Result getUserHalProp( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; bool isHvacPropAndHvacNotAvailable(int32_t propId); std::string dumpAllProperties(); std::string dumpOnePropertyByConfig( int rowNumber, - const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config); + const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config); std::string dumpOnePropertyById(int32_t propId, int32_t areaId); std::string dumpHelp(); std::string dumpListProperties(); @@ -142,23 +142,23 @@ class FakeVehicleHardware : public IVehicleHardware { std::string dumpSetProperties(const std::vector& options); template - ::android::base::Result safelyParseInt(int index, const std::string& s) { + android::base::Result safelyParseInt(int index, const std::string& s) { T out; if (!::android::base::ParseInt(s, &out)) { - return ::android::base::Error() << ::android::base::StringPrintf( + return android::base::Error() << android::base::StringPrintf( "non-integer argument at index %d: %s\n", index, s.c_str()); } return out; } - ::android::base::Result safelyParseFloat(int index, const std::string& s); + android::base::Result safelyParseFloat(int index, const std::string& s); std::vector getOptionValues(const std::vector& options, size_t* index); - ::android::base::Result<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> + android::base::Result parseSetPropOptions(const std::vector& options); - ::android::base::Result> parseHexString(const std::string& s); + android::base::Result> parseHexString(const std::string& s); - ::android::base::Result checkArgumentsSize(const std::vector& options, - size_t minSize); + android::base::Result checkArgumentsSize(const std::vector& options, + size_t minSize); }; } // namespace fake diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h index 118bb34e38..fa6d8f9dc6 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h +++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h @@ -35,17 +35,17 @@ class FakeObd2Frame final { : mPropStore(propStore) {} void initObd2LiveFrame( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig); + const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig); void initObd2FreezeFrame( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig); - ::android::base::Result getObd2FreezeFrame( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& + const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig); + android::base::Result getObd2FreezeFrame( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& requestedPropValue) const; - ::android::base::Result getObd2DtcInfo() const; - ::android::base::Result clearObd2FreezeFrames( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); + android::base::Result getObd2DtcInfo() const; + android::base::Result clearObd2FreezeFrames( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); static bool isDiagnosticProperty( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig); + const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig); private: std::shared_ptr mPropStore; diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/Obd2SensorStore.h b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/Obd2SensorStore.h index f6075cb561..1395eae3e1 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/Obd2SensorStore.h +++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/Obd2SensorStore.h @@ -45,7 +45,7 @@ class Obd2SensorStore final { template static int getLastIndex() { - auto range = ::ndk::enum_range(); + auto range = ndk::enum_range(); auto it = range.begin(); while (std::next(it) != range.end()) { it++; @@ -54,19 +54,19 @@ class Obd2SensorStore final { } // Stores an integer-valued sensor. - ::aidl::android::hardware::automotive::vehicle::StatusCode setIntegerSensor( - ::aidl::android::hardware::automotive::vehicle::DiagnosticIntegerSensorIndex index, + aidl::android::hardware::automotive::vehicle::StatusCode setIntegerSensor( + aidl::android::hardware::automotive::vehicle::DiagnosticIntegerSensorIndex index, int32_t value); // Stores an integer-valued sensor. - ::aidl::android::hardware::automotive::vehicle::StatusCode setIntegerSensor(size_t index, - int32_t value); + aidl::android::hardware::automotive::vehicle::StatusCode setIntegerSensor(size_t index, + int32_t value); // Stores a float-valued sensor. - ::aidl::android::hardware::automotive::vehicle::StatusCode setFloatSensor( - ::aidl::android::hardware::automotive::vehicle::DiagnosticFloatSensorIndex index, + aidl::android::hardware::automotive::vehicle::StatusCode setFloatSensor( + aidl::android::hardware::automotive::vehicle::DiagnosticFloatSensorIndex index, float value); // Stores a float-valued sensor. - ::aidl::android::hardware::automotive::vehicle::StatusCode setFloatSensor(size_t index, - float value); + aidl::android::hardware::automotive::vehicle::StatusCode setFloatSensor(size_t index, + float value); // Returns a sensor property value using the given DTC. VehiclePropValuePool::RecyclableType getSensorProperty(const std::string& dtc) const; @@ -76,8 +76,8 @@ class Obd2SensorStore final { public: explicit BitmaskInVector(size_t numBits = 0); void resize(size_t numBits); - ::android::base::Result get(size_t index) const; - ::android::base::Result set(size_t index, bool value); + android::base::Result get(size_t index) const; + android::base::Result set(size_t index, bool value); const std::vector& getBitmask() const; diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h b/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h index 1424c81884..a220146c63 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h +++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h @@ -49,13 +49,13 @@ class FakeUserHal final { // // @return updated property and StatusCode android::base::Result onSetProperty( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); // Gets the property value from the emulator. // // @return property value and StatusCode android::base::Result onGetProperty( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; // Shows the User HAL emulation help. std::string showDumpHelp() const; @@ -94,30 +94,30 @@ class FakeUserHal final { // test this error scenario) // - if it's 3, then don't send a property change (so Android can emulate a timeout) android::base::Result onSetInitialUserInfoResponse( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); // Used to emulate SWITCH_USER - see onSetInitialUserInfoResponse() for usage. android::base::Result onSetSwitchUserResponse( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); // Used to emulate CREATE_USER - see onSetInitialUserInfoResponse() for usage. android::base::Result onSetCreateUserResponse( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); // Used to emulate set USER_IDENTIFICATION_ASSOCIATION - see onSetInitialUserInfoResponse() for // usage. android::base::Result onSetUserIdentificationAssociation( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); // Used to emulate get USER_IDENTIFICATION_ASSOCIATION - see onSetInitialUserInfoResponse() for // usage. android::base::Result onGetUserIdentificationAssociation( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; // Creates a default USER_IDENTIFICATION_ASSOCIATION when it was not set by lshal. static android::base::Result defaultUserIdentificationAssociation( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& request); + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& request); android::base::Result sendUserHalResponse( VehiclePropValuePool::RecyclableType response, int32_t requestId); diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/include/UserHalHelper.h b/automotive/vehicle/aidl/impl/fake_impl/userhal/include/UserHalHelper.h index 5be13be5c4..104876c430 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/userhal/include/UserHalHelper.h +++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/include/UserHalHelper.h @@ -35,48 +35,46 @@ namespace user_hal_helper { // Verify whether the |value| can be casted to the type |T| and return the casted value on success. // Otherwise, return the error. template -::android::base::Result verifyAndCast(int32_t value); +android::base::Result verifyAndCast(int32_t value); // Below functions parse VehiclePropValues to the respective User HAL request structs. On success, // these functions return the User HAL struct. Otherwise, they return the error. -::android::base::Result<::aidl::android::hardware::automotive::vehicle::InitialUserInfoRequest> +android::base::Result toInitialUserInfoRequest( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); -::android::base::Result<::aidl::android::hardware::automotive::vehicle::SwitchUserRequest> + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); +android::base::Result toSwitchUserRequest( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); -::android::base::Result<::aidl::android::hardware::automotive::vehicle::CreateUserRequest> + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); +android::base::Result toCreateUserRequest( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); -::android::base::Result<::aidl::android::hardware::automotive::vehicle::RemoveUserRequest> + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); +android::base::Result toRemoveUserRequest( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); -::android::base::Result< - ::aidl::android::hardware::automotive::vehicle::UserIdentificationGetRequest> + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); +android::base::Result toUserIdentificationGetRequest( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); -::android::base::Result< - ::aidl::android::hardware::automotive::vehicle::UserIdentificationSetRequest> + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); +android::base::Result toUserIdentificationSetRequest( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); // Below functions convert the User HAL structs to VehiclePropValues. On success, these functions // return the pointer to VehiclePropValue. Otherwise, they return the error. -::android::base::Result toVehiclePropValue( +android::base::Result toVehiclePropValue( VehiclePropValuePool& pool, - const ::aidl::android::hardware::automotive::vehicle::SwitchUserRequest& request); + const aidl::android::hardware::automotive::vehicle::SwitchUserRequest& request); VehiclePropValuePool::RecyclableType toVehiclePropValue( VehiclePropValuePool& pool, - const ::aidl::android::hardware::automotive::vehicle::InitialUserInfoResponse& response); + const aidl::android::hardware::automotive::vehicle::InitialUserInfoResponse& response); VehiclePropValuePool::RecyclableType toVehiclePropValue( VehiclePropValuePool& pool, - const ::aidl::android::hardware::automotive::vehicle::SwitchUserResponse& response); + const aidl::android::hardware::automotive::vehicle::SwitchUserResponse& response); VehiclePropValuePool::RecyclableType toVehiclePropValue( VehiclePropValuePool& pool, - const ::aidl::android::hardware::automotive::vehicle::CreateUserResponse& response); + const aidl::android::hardware::automotive::vehicle::CreateUserResponse& response); VehiclePropValuePool::RecyclableType toVehiclePropValue( VehiclePropValuePool& pool, - const ::aidl::android::hardware::automotive::vehicle::UserIdentificationResponse& response); + const aidl::android::hardware::automotive::vehicle::UserIdentificationResponse& response); } // namespace user_hal_helper } // namespace fake diff --git a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h index 4b9de2d2a9..4a38827574 100644 --- a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h @@ -39,7 +39,7 @@ struct DumpResult { // A structure to represent a set value error event reported from vehicle. struct SetValueErrorEvent { - ::aidl::android::hardware::automotive::vehicle::StatusCode errorCode; + aidl::android::hardware::automotive::vehicle::StatusCode errorCode; int32_t propId; int32_t areaId; }; @@ -51,40 +51,40 @@ struct SetValueErrorEvent { class IVehicleHardware { public: using SetValuesCallback = std::function)>; + std::vector)>; using GetValuesCallback = std::function)>; + std::vector)>; using PropertyChangeCallback = std::function)>; + std::vector)>; using PropertySetErrorCallback = std::function)>; virtual ~IVehicleHardware() = default; // Get all the property configs. - virtual std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig> + virtual std::vector getAllPropertyConfigs() const = 0; // Set property values asynchronously. Server could return before the property set requests // are sent to vehicle bus or before property set confirmation is received. The callback is // safe to be called after the function returns and is safe to be called in a different thread. - virtual ::aidl::android::hardware::automotive::vehicle::StatusCode setValues( + virtual aidl::android::hardware::automotive::vehicle::StatusCode setValues( std::shared_ptr callback, - const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>& + const std::vector& requests) = 0; // Get property values asynchronously. Server could return before the property values are ready. // The callback is safe to be called after the function returns and is safe to be called in a // different thread. - virtual ::aidl::android::hardware::automotive::vehicle::StatusCode getValues( + virtual aidl::android::hardware::automotive::vehicle::StatusCode getValues( std::shared_ptr callback, - const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>& + const std::vector& requests) const = 0; // Dump debug information in the server. virtual DumpResult dump(const std::vector& options) = 0; // Check whether the system is healthy, return {@code StatusCode::OK} for healthy. - virtual ::aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() = 0; + 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. virtual void registerOnPropertyChangeEvent( diff --git a/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h b/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h index 9a8f19be57..08b56a6a9f 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h @@ -35,7 +35,7 @@ class ConcurrentQueue { public: void waitForItems() { std::unique_lock lockGuard(mLock); - ::android::base::ScopedLockAssertion lockAssertion(mLock); + android::base::ScopedLockAssertion lockAssertion(mLock); while (mQueue.empty() && mIsActive) { mCond.wait(lockGuard); } diff --git a/automotive/vehicle/aidl/impl/utils/common/include/ParcelableUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/ParcelableUtils.h index 7b2111b96b..ab7b895f20 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/ParcelableUtils.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/ParcelableUtils.h @@ -33,13 +33,13 @@ namespace vehicle { // If values is small enough, it would be put into output.payloads, otherwise a shared memory file // would be created and output.sharedMemoryFd would be filled in. template -::ndk::ScopedAStatus vectorToStableLargeParcelable(std::vector&& values, T2* output) { +ndk::ScopedAStatus vectorToStableLargeParcelable(std::vector&& values, T2* output) { output->payloads = std::move(values); - auto result = ::android::automotive::car_binder_lib::LargeParcelableBase:: + auto result = android::automotive::car_binder_lib::LargeParcelableBase:: parcelableToStableLargeParcelable(*output); if (!result.ok()) { return toScopedAStatus( - result, ::aidl::android::hardware::automotive::vehicle::StatusCode::INTERNAL_ERROR); + result, aidl::android::hardware::automotive::vehicle::StatusCode::INTERNAL_ERROR); } auto& fd = result.value(); if (fd != nullptr) { @@ -48,14 +48,14 @@ template output->payloads.clear(); output->sharedMemoryFd = std::move(*fd); } else { - output->sharedMemoryFd = ::ndk::ScopedFileDescriptor(); + output->sharedMemoryFd = ndk::ScopedFileDescriptor(); // Do not modify payloads. } - return ::ndk::ScopedAStatus::ok(); + return ndk::ScopedAStatus::ok(); } template -::ndk::ScopedAStatus vectorToStableLargeParcelable(const std::vector& values, T2* output) { +ndk::ScopedAStatus vectorToStableLargeParcelable(const std::vector& values, T2* output) { // Because 'values' is passed in as const reference, we have to do a copy here. std::vector valuesCopy = values; @@ -63,16 +63,16 @@ template } template -::android::base::expected< - ::android::automotive::car_binder_lib::LargeParcelableBase::BorrowedOwnedObject, - ::ndk::ScopedAStatus> +android::base::expected< + android::automotive::car_binder_lib::LargeParcelableBase::BorrowedOwnedObject, + ndk::ScopedAStatus> fromStableLargeParcelable(const T& largeParcelable) { - auto result = ::android::automotive::car_binder_lib::LargeParcelableBase:: + auto result = android::automotive::car_binder_lib::LargeParcelableBase:: stableLargeParcelableToParcelable(largeParcelable); if (!result.ok()) { - return ::android::base::unexpected(toScopedAStatus( - result, ::aidl::android::hardware::automotive::vehicle::StatusCode::INVALID_ARG, + return android::base::unexpected(toScopedAStatus( + result, aidl::android::hardware::automotive::vehicle::StatusCode::INVALID_ARG, "failed to parse large parcelable")); } diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h index 4b2a11a116..6e812d1d40 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h @@ -168,7 +168,7 @@ class ObjectPool { class VehiclePropValuePool { public: using RecyclableType = - recyclable_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>; + recyclable_ptr; // Creates VehiclePropValuePool // @@ -188,20 +188,20 @@ class VehiclePropValuePool { // given type is not MIXED or STRING, the internal value vector size would be set to 1. // If the given type is MIXED or STRING, all the internal vector sizes would be initialized to // 0. - RecyclableType obtain(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type); + RecyclableType obtain(aidl::android::hardware::automotive::vehicle::VehiclePropertyType type); // Obtain a recyclable VehiclePropertyValue object from the pool for the given type. If the // given type is *_VEC or BYTES, the internal value vector size would be set to vectorSize. If // the given type is BOOLEAN, INT32, FLOAT, or INT64, the internal value vector size would be // set to 1. If the given type is MIXED or STRING, all the internal value vector sizes would be // set to 0. vectorSize must be larger than 0. - RecyclableType obtain(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, + RecyclableType obtain(aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, size_t vectorSize); // Obtain a recyclable VehicePropertyValue object that is a copy of src. If src does not contain // any value or the src property type is not valid, this function would return an empty // VehiclePropValue. RecyclableType obtain( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& src); + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& src); // Obtain a recyclable boolean object. RecyclableType obtainBoolean(bool value); // Obtain a recyclable int32 object. @@ -220,36 +220,35 @@ class VehiclePropValuePool { private: static inline bool isSingleValueType( - ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) { - return type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType:: - BOOLEAN || - type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32 || - type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64 || - type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT; + aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) { + return type == aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BOOLEAN || + type == aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32 || + type == aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64 || + type == aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT; } static inline bool isComplexType( - ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) { - return type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED || - type == ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING; + aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) { + return type == aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED || + type == aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING; } - bool isDisposable(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, + bool isDisposable(aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, size_t vectorSize) const { return vectorSize > mMaxRecyclableVectorSize || isComplexType(type); } RecyclableType obtainDisposable( - ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType valueType, + aidl::android::hardware::automotive::vehicle::VehiclePropertyType valueType, size_t vectorSize) const; RecyclableType obtainRecyclable( - ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, + aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, size_t vectorSize); class InternalPool - : public ObjectPool<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> { + : public ObjectPool { public: - InternalPool(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, + InternalPool(aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, size_t vectorSize, size_t maxPoolObjectsSize, ObjectPool::GetSizeFunc getSizeFunc) : ObjectPool(maxPoolObjectsSize, getSizeFunc), @@ -257,11 +256,11 @@ class VehiclePropValuePool { mVectorSize(vectorSize) {} protected: - ::aidl::android::hardware::automotive::vehicle::VehiclePropValue* createObject() override; - void recycle(::aidl::android::hardware::automotive::vehicle::VehiclePropValue* o) override; + aidl::android::hardware::automotive::vehicle::VehiclePropValue* createObject() override; + void recycle(aidl::android::hardware::automotive::vehicle::VehiclePropValue* o) override; private: - bool check(::aidl::android::hardware::automotive::vehicle::RawPropValues* v); + bool check(aidl::android::hardware::automotive::vehicle::RawPropValues* v); template bool check(std::vector* vec, bool isVectorType) { @@ -269,12 +268,12 @@ class VehiclePropValuePool { } private: - ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType mPropType; + aidl::android::hardware::automotive::vehicle::VehiclePropertyType mPropType; size_t mVectorSize; }; - const Deleter<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> + const Deleter mDisposableDeleter{ - [](::aidl::android::hardware::automotive::vehicle::VehiclePropValue* v) { + [](aidl::android::hardware::automotive::vehicle::VehiclePropValue* v) { delete v; }}; diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h index 63129e798e..2c7aa97acd 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h @@ -49,18 +49,18 @@ class VehiclePropertyStore final { // Callback when a property value has been updated or a new value added. using OnValueChangeCallback = std::function; + const aidl::android::hardware::automotive::vehicle::VehiclePropValue&)>; // Function that used to calculate unique token for given VehiclePropValue. - using TokenFunction = ::std::function; + using TokenFunction = std::function; // Register the given property according to the config. A property has to be registered first // before write/read. If tokenFunc is not nullptr, it would be used to generate a unique // property token to act as the key the property store. Otherwise, {propertyID, areaID} would be // used as the key. void registerProperty( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config, + const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config, TokenFunction tokenFunc = nullptr); // Stores provided value. Returns error if config wasn't registered. If 'updateStatus' is @@ -68,13 +68,13 @@ class VehiclePropertyStore final { // '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. - ::android::base::Result writeValue(VehiclePropValuePool::RecyclableType propValue, - bool updateStatus = false); + android::base::Result writeValue(VehiclePropValuePool::RecyclableType propValue, + bool updateStatus = false); // 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); // Remove all the values for the property. void removeValuesForProperty(int32_t propId); @@ -83,28 +83,28 @@ class VehiclePropertyStore final { std::vector readAllValues() const; // Read all the values for the property. - ::android::base::Result> - readValuesForProperty(int32_t propId) const; + android::base::Result> readValuesForProperty( + int32_t propId) const; // 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. - ::android::base::Result readValue( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& request) const; + android::base::Result readValue( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& request) const; // 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. - ::android::base::Result readValue( - int32_t prop, int32_t area = 0, int64_t token = 0) const; + android::base::Result readValue(int32_t prop, + int32_t area = 0, + int64_t token = 0) const; // Get all property configs. - std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig> getAllConfigs() + std::vector getAllConfigs() const; // Get the property config for the requested property. - ::android::base::Result< - const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig*> + android::base::Result getConfig(int32_t propId) const; // Set a callback that would be called when a property value has been updated. @@ -127,7 +127,7 @@ class VehiclePropertyStore final { }; struct Record { - ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig propConfig; + aidl::android::hardware::automotive::vehicle::VehiclePropConfig propConfig; TokenFunction tokenFunction; std::unordered_map values; }; @@ -143,10 +143,10 @@ class VehiclePropertyStore final { Record* getRecordLocked(int32_t propId); RecordId getRecordIdLocked( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue, + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue, const Record& record) const; - ::android::base::Result readValueLocked( + android::base::Result readValueLocked( const RecordId& recId, const Record& record) const; }; diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h index 0f0ccf11a2..1fc5613a71 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h @@ -37,38 +37,36 @@ inline constexpr U toInt(ENUM const value) { return static_cast(value); } -inline constexpr ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType getPropType( +inline constexpr aidl::android::hardware::automotive::vehicle::VehiclePropertyType getPropType( int32_t prop) { - return static_cast<::aidl::android::hardware::automotive::vehicle::VehiclePropertyType>( - prop & - toInt(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MASK)); + return static_cast( + prop & toInt(aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MASK)); } -inline constexpr ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup getPropGroup( +inline constexpr aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup getPropGroup( int32_t prop) { - return static_cast<::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup>( - prop & - toInt(::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup::MASK)); + return static_cast( + prop & toInt(aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup::MASK)); } -inline constexpr ::aidl::android::hardware::automotive::vehicle::VehicleArea getPropArea( +inline constexpr aidl::android::hardware::automotive::vehicle::VehicleArea getPropArea( int32_t prop) { - return static_cast<::aidl::android::hardware::automotive::vehicle::VehicleArea>( - prop & toInt(::aidl::android::hardware::automotive::vehicle::VehicleArea::MASK)); + return static_cast( + prop & toInt(aidl::android::hardware::automotive::vehicle::VehicleArea::MASK)); } inline constexpr bool isGlobalProp(int32_t prop) { - return getPropArea(prop) == ::aidl::android::hardware::automotive::vehicle::VehicleArea::GLOBAL; + return getPropArea(prop) == aidl::android::hardware::automotive::vehicle::VehicleArea::GLOBAL; } inline constexpr bool isSystemProp(int32_t prop) { - return ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup::SYSTEM == + return aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup::SYSTEM == getPropGroup(prop); } -inline const ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* getAreaConfig( +inline const aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* getAreaConfig( int32_t propId, int32_t areaId, - const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config) { + const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config) { if (config.areaConfigs.size() == 0) { return nullptr; } @@ -85,43 +83,43 @@ inline const ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* return nullptr; } -inline const ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* getAreaConfig( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue, - const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config) { +inline const aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* getAreaConfig( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue, + const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config) { return getAreaConfig(propValue.prop, propValue.areaId, config); } -inline std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> -createVehiclePropValueVec(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, +inline std::unique_ptr +createVehiclePropValueVec(aidl::android::hardware::automotive::vehicle::VehiclePropertyType type, size_t vecSize) { - auto val = std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>( - new ::aidl::android::hardware::automotive::vehicle::VehiclePropValue); + auto val = std::unique_ptr( + new aidl::android::hardware::automotive::vehicle::VehiclePropValue); switch (type) { - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32: [[fallthrough]]; - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BOOLEAN: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BOOLEAN: vecSize = 1; [[fallthrough]]; - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32_VEC: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32_VEC: val->value.int32Values.resize(vecSize); break; - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT: vecSize = 1; [[fallthrough]]; - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT_VEC: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT_VEC: val->value.floatValues.resize(vecSize); break; - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64: vecSize = 1; [[fallthrough]]; - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64_VEC: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64_VEC: val->value.int64Values.resize(vecSize); break; - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BYTES: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BYTES: val->value.byteValues.resize(vecSize); break; - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING: - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED: break; // Valid, but nothing to do. default: ALOGE("createVehiclePropValue: unknown type: %d", toInt(type)); @@ -130,34 +128,34 @@ createVehiclePropValueVec(::aidl::android::hardware::automotive::vehicle::Vehicl return val; } -inline std::unique_ptr<::aidl::android::hardware::automotive::vehicle::VehiclePropValue> -createVehiclePropValue(::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) { +inline std::unique_ptr +createVehiclePropValue(aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) { return createVehiclePropValueVec(type, 1); } inline size_t getVehicleRawValueVectorSize( - const ::aidl::android::hardware::automotive::vehicle::RawPropValues& value, - ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) { + const aidl::android::hardware::automotive::vehicle::RawPropValues& value, + aidl::android::hardware::automotive::vehicle::VehiclePropertyType type) { switch (type) { - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32: [[fallthrough]]; - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BOOLEAN: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BOOLEAN: return std::min(value.int32Values.size(), static_cast(1)); - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT: return std::min(value.floatValues.size(), static_cast(1)); - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64: return std::min(value.int64Values.size(), static_cast(1)); - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32_VEC: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT32_VEC: return value.int32Values.size(); - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT_VEC: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::FLOAT_VEC: return value.floatValues.size(); - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64_VEC: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::INT64_VEC: return value.int64Values.size(); - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BYTES: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::BYTES: return value.byteValues.size(); - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::STRING: [[fallthrough]]; - case ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED: + case aidl::android::hardware::automotive::vehicle::VehiclePropertyType::MIXED: return 0; default: ALOGE("getVehicleRawValueVectorSize: unknown type: %d", toInt(type)); @@ -166,8 +164,8 @@ inline size_t getVehicleRawValueVectorSize( } inline void copyVehicleRawValue( - ::aidl::android::hardware::automotive::vehicle::RawPropValues* dest, - const ::aidl::android::hardware::automotive::vehicle::RawPropValues& src) { + aidl::android::hardware::automotive::vehicle::RawPropValues* dest, + const aidl::android::hardware::automotive::vehicle::RawPropValues& src) { dest->int32Values = src.int32Values; dest->floatValues = src.floatValues; dest->int64Values = src.int64Values; @@ -178,7 +176,7 @@ inline void copyVehicleRawValue( // getVehiclePropValueSize returns approximately how much memory 'value' would take. This should // only be used in a limited-size memory pool to set an upper bound for memory consumption. inline size_t getVehiclePropValueSize( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& prop) { + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& prop) { size_t size = 0; size += sizeof(prop.timestamp); size += sizeof(prop.areaId); @@ -193,22 +191,22 @@ inline size_t getVehiclePropValueSize( } template -::aidl::android::hardware::automotive::vehicle::StatusCode getErrorCode( - const ::android::base::Result& result) { +aidl::android::hardware::automotive::vehicle::StatusCode getErrorCode( + const android::base::Result& result) { if (result.ok()) { - return ::aidl::android::hardware::automotive::vehicle::StatusCode::OK; + return aidl::android::hardware::automotive::vehicle::StatusCode::OK; } - return static_cast<::aidl::android::hardware::automotive::vehicle::StatusCode>( + return static_cast( result.error().code()); } template -int getIntErrorCode(const ::android::base::Result& result) { +int getIntErrorCode(const android::base::Result& result) { return toInt(getErrorCode(result)); } template -std::string getErrorMsg(const ::android::base::Result& result) { +std::string getErrorMsg(const android::base::Result& result) { if (result.ok()) { return ""; } @@ -216,33 +214,32 @@ std::string getErrorMsg(const ::android::base::Result& result) { } template -::ndk::ScopedAStatus toScopedAStatus( - const ::android::base::Result& result, - ::aidl::android::hardware::automotive::vehicle::StatusCode status, - const std::string& additionalErrorMsg) { +ndk::ScopedAStatus toScopedAStatus(const android::base::Result& result, + aidl::android::hardware::automotive::vehicle::StatusCode status, + const std::string& additionalErrorMsg) { if (result.ok()) { - return ::ndk::ScopedAStatus::ok(); + return ndk::ScopedAStatus::ok(); } - return ::ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( + return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( toInt(status), fmt::format("{}, error: {}", additionalErrorMsg, getErrorMsg(result)).c_str()); } template -::ndk::ScopedAStatus toScopedAStatus( - const ::android::base::Result& result, - ::aidl::android::hardware::automotive::vehicle::StatusCode status) { +ndk::ScopedAStatus toScopedAStatus( + const android::base::Result& result, + aidl::android::hardware::automotive::vehicle::StatusCode status) { return toScopedAStatus(result, status, ""); } template -::ndk::ScopedAStatus toScopedAStatus(const ::android::base::Result& result) { +ndk::ScopedAStatus toScopedAStatus(const android::base::Result& result) { return toScopedAStatus(result, getErrorCode(result)); } template -::ndk::ScopedAStatus toScopedAStatus(const ::android::base::Result& result, - const std::string& additionalErrorMsg) { +ndk::ScopedAStatus toScopedAStatus(const android::base::Result& result, + const std::string& additionalErrorMsg) { return toScopedAStatus(result, getErrorCode(result), additionalErrorMsg); } @@ -255,9 +252,9 @@ template // * If the type is FLOAT, {@code value.floatValues} must contain one element. // * If the type is FLOAT_VEC, {@code value.floatValues} must contain at least one element. // * If the type is MIXED, see checkVendorMixedPropValue. -::android::base::Result checkPropValue( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, - const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig* config); +android::base::Result checkPropValue( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, + const aidl::android::hardware::automotive::vehicle::VehiclePropConfig* config); // Check whether the Mixed type value is valid according to config. // We check for the following: @@ -268,9 +265,9 @@ template // * configArray[6] + configArray[7] must be equal to the number of {@code value.floatValues} // elements. // * configArray[8] must be equal to the number of {@code value.byteValues} elements. -::android::base::Result checkVendorMixedPropValue( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, - const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig* config); +android::base::Result checkVendorMixedPropValue( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, + const aidl::android::hardware::automotive::vehicle::VehiclePropConfig* config); // Check whether the value is within the configured range. // We check for the following types: @@ -282,9 +279,9 @@ template // {@code minFloatValues} and {@code maxFloatValues} if either of them is not 0. // We don't check other types. If more checks are required, they should be added in VehicleHardware // implementation. -::android::base::Result checkValueRange( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, - const ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* config); +android::base::Result checkValueRange( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, + const aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* config); } // namespace vehicle } // namespace automotive diff --git a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h index f80d1e6d61..42135011d3 100644 --- a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h +++ b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h @@ -39,7 +39,7 @@ using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; // 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) { + const aidl::android::hardware::automotive::vehicle::VehicleProperty& prop) { return (toInt(prop) & ~toInt(testpropertyutils_impl::VehiclePropertyGroup::MASK)) | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR); } diff --git a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h index 15a6278f38..5d88f7c74d 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h +++ b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h @@ -43,7 +43,7 @@ namespace vehicle { class ConnectedClient { public: using CallbackType = - std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>; + std::shared_ptr; ConnectedClient(std::shared_ptr requestPool, CallbackType callback); @@ -57,7 +57,7 @@ class ConnectedClient { // Returns {@code INVALID_ARG} error if any of the requestIds are duplicate with one of the // pending request IDs or {@code TRY_AGAIN} error if the pending request pool is full and could // no longer add requests. - ::android::base::Result addRequests(const std::unordered_set& requestIds); + android::base::Result addRequests(const std::unordered_set& requestIds); // Marks the requests as finished. Returns a list of request IDs that was pending and has been // finished. It must be a set of the requested request IDs. @@ -110,7 +110,7 @@ class SubscriptionClient final : public ConnectedClient { // callback. static void sendUpdatedValues( CallbackType callback, - std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>&& + std::vector&& updatedValues); protected: @@ -126,7 +126,7 @@ class SubscriptionClient final : public ConnectedClient { static void onGetValueResults( const void* clientId, CallbackType callback, std::shared_ptr requestPool, - std::vector<::aidl::android::hardware::automotive::vehicle::GetValueResult> results); + std::vector results); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index 5e7adfca6d..9735ed3012 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -39,39 +39,39 @@ namespace hardware { namespace automotive { namespace vehicle { -class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::vehicle::BnVehicle { +class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehicle::BnVehicle { public: using CallbackType = - std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>; + std::shared_ptr; explicit DefaultVehicleHal(std::unique_ptr hardware); ~DefaultVehicleHal(); - ::ndk::ScopedAStatus getAllPropConfigs( - ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs) + ndk::ScopedAStatus getAllPropConfigs( + aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs) override; - ::ndk::ScopedAStatus getValues( + ndk::ScopedAStatus getValues( const CallbackType& callback, - const ::aidl::android::hardware::automotive::vehicle::GetValueRequests& requests) + const aidl::android::hardware::automotive::vehicle::GetValueRequests& requests) override; - ::ndk::ScopedAStatus setValues( + ndk::ScopedAStatus setValues( const CallbackType& callback, - const ::aidl::android::hardware::automotive::vehicle::SetValueRequests& requests) + const aidl::android::hardware::automotive::vehicle::SetValueRequests& requests) override; - ::ndk::ScopedAStatus getPropConfigs( + ndk::ScopedAStatus getPropConfigs( const std::vector& props, - ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs) + aidl::android::hardware::automotive::vehicle::VehiclePropConfigs* returnConfigs) override; - ::ndk::ScopedAStatus subscribe( + ndk::ScopedAStatus subscribe( const CallbackType& callback, - const std::vector<::aidl::android::hardware::automotive::vehicle::SubscribeOptions>& + const std::vector& options, int32_t maxSharedMemoryFileCount) override; - ::ndk::ScopedAStatus unsubscribe(const CallbackType& callback, - const std::vector& propIds) override; - ::ndk::ScopedAStatus returnSharedMemory(const CallbackType& callback, - int64_t sharedMemoryId) override; + ndk::ScopedAStatus unsubscribe(const CallbackType& callback, + const std::vector& propIds) override; + ndk::ScopedAStatus returnSharedMemory(const CallbackType& callback, + int64_t sharedMemoryId) override; binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; IVehicleHardware* getHardware(); @@ -81,11 +81,11 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve friend class DefaultVehicleHalTest; using GetValuesClient = - GetSetValuesClient<::aidl::android::hardware::automotive::vehicle::GetValueResult, - ::aidl::android::hardware::automotive::vehicle::GetValueResults>; + GetSetValuesClient; using SetValuesClient = - GetSetValuesClient<::aidl::android::hardware::automotive::vehicle::SetValueResult, - ::aidl::android::hardware::automotive::vehicle::SetValueResults>; + GetSetValuesClient; // A thread safe class to maintain an increasing request ID for each subscribe client. This // class is safe to pass to async callbacks. @@ -152,10 +152,10 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve // mConfigsByPropId and mConfigFile are only modified during initialization, so no need to // lock guard them. - std::unordered_map + std::unordered_map mConfigsByPropId; // Only modified in constructor, so thread-safe. - std::unique_ptr<::ndk::ScopedFileDescriptor> mConfigFile; + std::unique_ptr mConfigFile; // PendingRequestPool is thread-safe. std::shared_ptr mPendingRequestPool; // SubscriptionManager is thread-safe. @@ -176,31 +176,30 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve // RecurrentTimer is thread-safe. RecurrentTimer mRecurrentTimer; - ::ndk::ScopedAIBinder_DeathRecipient mDeathRecipient; + ndk::ScopedAIBinder_DeathRecipient mDeathRecipient; - ::android::base::Result checkProperty( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); + android::base::Result checkProperty( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); - ::android::base::Result> checkDuplicateRequests( - const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>& + android::base::Result> checkDuplicateRequests( + const std::vector& requests); - ::android::base::Result> checkDuplicateRequests( - const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>& + android::base::Result> checkDuplicateRequests( + const std::vector& requests); - ::android::base::Result checkSubscribeOptions( - const std::vector<::aidl::android::hardware::automotive::vehicle::SubscribeOptions>& + android::base::Result checkSubscribeOptions( + const std::vector& options); - ::android::base::Result checkReadPermission( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; + android::base::Result checkReadPermission( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; - ::android::base::Result checkWritePermission( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; + android::base::Result checkWritePermission( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; - ::android::base::Result< - const ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig*> + android::base::Result getConfig(int32_t propId) const; void onBinderDiedWithContext(const AIBinder* clientId); @@ -220,11 +219,11 @@ class DefaultVehicleHal final : public ::aidl::android::hardware::automotive::ve std::weak_ptr vehicleHardware, std::shared_ptr subscribeIdByClient, std::shared_ptr subscriptionClients, const CallbackType& callback, - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); static void onPropertyChangeEvent( std::weak_ptr subscriptionManager, - const std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>& + const std::vector& updatedValues); static void checkHealth(std::weak_ptr hardware, diff --git a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h index e739c8c3f2..b0d67010b1 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h +++ b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h @@ -40,10 +40,10 @@ class SubscriptionManager final { public: using ClientIdType = const AIBinder*; using CallbackType = - std::shared_ptr<::aidl::android::hardware::automotive::vehicle::IVehicleCallback>; + std::shared_ptr; using GetValueFunc = std::function; + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value)>; explicit SubscriptionManager(GetValueFunc&& action); ~SubscriptionManager(); @@ -54,9 +54,9 @@ class SubscriptionManager final { // Returns error if any of the subscribe options is not valid. If error is returned, no // properties would be subscribed. // Returns ok if all the options are parsed correctly and all the properties are subscribed. - ::android::base::Result subscribe( + android::base::Result subscribe( const CallbackType& callback, - const std::vector<::aidl::android::hardware::automotive::vehicle::SubscribeOptions>& + const std::vector& options, bool isContinuousProperty); @@ -64,23 +64,23 @@ class SubscriptionManager final { // Returns error if the client was not subscribed before or one of the given property was not // subscribed. If error is returned, no property would be unsubscribed. // Returns ok if all the requested properties for the client are unsubscribed. - ::android::base::Result unsubscribe(ClientIdType client, - const std::vector& propIds); + android::base::Result unsubscribe(ClientIdType client, + const std::vector& propIds); // Unsubscribes from all the properties for the client. // Returns error if the client was not subscribed before. If error is returned, no property // would be unsubscribed. // Returns ok if all the properties for the client are unsubscribed. - ::android::base::Result unsubscribe(ClientIdType client); + android::base::Result unsubscribe(ClientIdType client); // 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> + std::vector> getSubscribedClients( - const std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>& + const std::vector& updatedValues); // Checks whether the sample rate is valid. @@ -145,7 +145,7 @@ class SubscriptionManager final { std::shared_ptr mTimer; const GetValueFunc mGetValue; - static ::android::base::Result getInterval(float sampleRate); + static android::base::Result getInterval(float sampleRate); // Checks whether the manager is empty. For testing purpose. bool isEmpty(); diff --git a/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp index bdb0d31cdb..682e9e6a06 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/ConnectedClientTest.cpp @@ -34,7 +34,7 @@ using ::aidl::android::hardware::automotive::vehicle::SetValueResults; using ::aidl::android::hardware::automotive::vehicle::StatusCode; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; -class ConnectedClientTest : public ::testing::Test { +class ConnectedClientTest : public testing::Test { public: void SetUp() override { mCallback = ndk::SharedRefBase::make(); diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 7443d5bc6d..178498ba83 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -216,7 +216,7 @@ std::vector getSubscribeInvalidOptionsTestCases } // namespace -class DefaultVehicleHalTest : public ::testing::Test { +class DefaultVehicleHalTest : public testing::Test { public: void SetUp() override { auto hardware = std::make_unique(); @@ -479,7 +479,7 @@ TEST_F(DefaultVehicleHalTest, testGetAllPropConfigsSmall) { auto hardware = std::make_unique(); hardware->setPropertyConfigs(testConfigs); - auto vhal = ::ndk::SharedRefBase::make(std::move(hardware)); + auto vhal = ndk::SharedRefBase::make(std::move(hardware)); std::shared_ptr client = IVehicle::fromBinder(vhal->asBinder()); VehiclePropConfigs output; @@ -500,7 +500,7 @@ TEST_F(DefaultVehicleHalTest, testGetAllPropConfigsLarge) { auto hardware = std::make_unique(); hardware->setPropertyConfigs(testConfigs); - auto vhal = ::ndk::SharedRefBase::make(std::move(hardware)); + auto vhal = ndk::SharedRefBase::make(std::move(hardware)); std::shared_ptr client = IVehicle::fromBinder(vhal->asBinder()); VehiclePropConfigs output; @@ -818,7 +818,7 @@ class SetValuesInvalidRequestTest INSTANTIATE_TEST_SUITE_P( SetValuesInvalidRequestTests, SetValuesInvalidRequestTest, - ::testing::ValuesIn(getSetValuesInvalidRequestTestCases()), + testing::ValuesIn(getSetValuesInvalidRequestTestCases()), [](const testing::TestParamInfo& info) { return info.param.name; }); @@ -1427,7 +1427,7 @@ class SubscribeInvalidOptionsTest INSTANTIATE_TEST_SUITE_P( SubscribeInvalidOptionsTests, SubscribeInvalidOptionsTest, - ::testing::ValuesIn(getSubscribeInvalidOptionsTestCases()), + testing::ValuesIn(getSubscribeInvalidOptionsTestCases()), [](const testing::TestParamInfo& info) { return info.param.name; }); diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h index c83164ff79..03bfd5be9c 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h @@ -43,35 +43,33 @@ std::optional pop(std::list& items) { // MockVehicleCallback is a mock VehicleCallback implementation that simply stores the results. class MockVehicleCallback final - : public ::aidl::android::hardware::automotive::vehicle::BnVehicleCallback { + : public aidl::android::hardware::automotive::vehicle::BnVehicleCallback { public: - ::ndk::ScopedAStatus onGetValues( - const ::aidl::android::hardware::automotive::vehicle::GetValueResults& results) - override; - ::ndk::ScopedAStatus onSetValues( - const ::aidl::android::hardware::automotive::vehicle::SetValueResults& results) - override; - ::ndk::ScopedAStatus onPropertyEvent( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropValues&, + ndk::ScopedAStatus onGetValues( + const aidl::android::hardware::automotive::vehicle::GetValueResults& results) override; + ndk::ScopedAStatus onSetValues( + const aidl::android::hardware::automotive::vehicle::SetValueResults& results) override; + ndk::ScopedAStatus onPropertyEvent( + const aidl::android::hardware::automotive::vehicle::VehiclePropValues&, int32_t) override; - ::ndk::ScopedAStatus onPropertySetError( - const ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors&) override; + ndk::ScopedAStatus onPropertySetError( + const aidl::android::hardware::automotive::vehicle::VehiclePropErrors&) override; // Test functions - std::optional<::aidl::android::hardware::automotive::vehicle::GetValueResults> + std::optional nextGetValueResults(); - std::optional<::aidl::android::hardware::automotive::vehicle::SetValueResults> + std::optional nextSetValueResults(); - std::optional<::aidl::android::hardware::automotive::vehicle::VehiclePropValues> + std::optional nextOnPropertyEventResults(); private: std::mutex mLock; - std::list<::aidl::android::hardware::automotive::vehicle::GetValueResults> mGetValueResults + std::list mGetValueResults GUARDED_BY(mLock); - std::list<::aidl::android::hardware::automotive::vehicle::SetValueResults> mSetValueResults + std::list mSetValueResults GUARDED_BY(mLock); - std::list<::aidl::android::hardware::automotive::vehicle::VehiclePropValues> + std::list mOnPropertyEventResults GUARDED_BY(mLock); int32_t mSharedMemoryFileCount GUARDED_BY(mLock); }; diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h index 74d4fae337..cb8b6a03f3 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h @@ -40,44 +40,44 @@ class MockVehicleHardware final : public IVehicleHardware { public: ~MockVehicleHardware(); - std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig> + std::vector getAllPropertyConfigs() const override; - ::aidl::android::hardware::automotive::vehicle::StatusCode setValues( + aidl::android::hardware::automotive::vehicle::StatusCode setValues( std::shared_ptr callback, - const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>& + const std::vector& requests) override; - ::aidl::android::hardware::automotive::vehicle::StatusCode getValues( + aidl::android::hardware::automotive::vehicle::StatusCode getValues( std::shared_ptr callback, - const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>& + const std::vector& requests) const override; DumpResult dump(const std::vector&) override; - ::aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() override; + aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() override; void registerOnPropertyChangeEvent( std::unique_ptr callback) override; void registerOnPropertySetErrorEvent(std::unique_ptr) override; // Test functions. void setPropertyConfigs( - const std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig>& + const std::vector& configs); void addGetValueResponses( - const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueResult>& + const std::vector& responses); void addSetValueResponses( - const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueResult>& + const std::vector& responses); void setGetValueResponder( - std::function<::aidl::android::hardware::automotive::vehicle::StatusCode( + std::function, const std::vector< - ::aidl::android::hardware::automotive::vehicle::GetValueRequest>&)>&& + aidl::android::hardware::automotive::vehicle::GetValueRequest>&)>&& responder); - std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest> + std::vector nextGetValueRequests(); - std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest> + std::vector nextSetValueRequests(); void setStatus(const char* functionName, - ::aidl::android::hardware::automotive::vehicle::StatusCode status); + aidl::android::hardware::automotive::vehicle::StatusCode status); void setSleepTime(int64_t timeInNano); void setDumpResult(DumpResult result); @@ -85,31 +85,31 @@ class MockVehicleHardware final : public IVehicleHardware { mutable std::mutex mLock; mutable std::condition_variable mCv; mutable std::atomic mThreadCount; - std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropConfig> mPropertyConfigs + std::vector mPropertyConfigs GUARDED_BY(mLock); - mutable std::list> + mutable std::list> mGetValueRequests GUARDED_BY(mLock); - mutable std::list> + mutable std::list> mGetValueResponses GUARDED_BY(mLock); - mutable std::list> + mutable std::list> mSetValueRequests GUARDED_BY(mLock); - mutable std::list> + mutable std::list> mSetValueResponses GUARDED_BY(mLock); - std::unordered_map + std::unordered_map mStatusByFunctions GUARDED_BY(mLock); int64_t mSleepTime GUARDED_BY(mLock) = 0; std::unique_ptr mPropertyChangeCallback GUARDED_BY(mLock); - std::function<::aidl::android::hardware::automotive::vehicle::StatusCode( + std::function, - const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>&)> + const std::vector&)> mGetValueResponder GUARDED_BY(mLock); template - ::aidl::android::hardware::automotive::vehicle::StatusCode returnResponse( + aidl::android::hardware::automotive::vehicle::StatusCode returnResponse( std::shared_ptr)>> callback, std::list>* storedResponses) const; template - ::aidl::android::hardware::automotive::vehicle::StatusCode handleRequestsLocked( + aidl::android::hardware::automotive::vehicle::StatusCode handleRequestsLocked( const char* functionName, std::shared_ptr)>> callback, const std::vector& requests, diff --git a/automotive/vehicle/aidl/impl/vhal/test/RecurrentTimerTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/RecurrentTimerTest.cpp index d343cea5b0..a033a248cd 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/RecurrentTimerTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/RecurrentTimerTest.cpp @@ -28,7 +28,7 @@ namespace hardware { namespace automotive { namespace vehicle { -class RecurrentTimerTest : public ::testing::Test { +class RecurrentTimerTest : public testing::Test { public: std::shared_ptr getCallback(size_t token) { return std::make_shared([this, token] { diff --git a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp index f81b1a2998..2a468f608f 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp @@ -83,7 +83,7 @@ class PropertyCallback final : public BnVehicleCallback { std::list mEvents GUARDED_BY(mLock); }; -class SubscriptionManagerTest : public ::testing::Test { +class SubscriptionManagerTest : public testing::Test { public: void SetUp() override { mManager = std::make_unique( @@ -95,7 +95,7 @@ class SubscriptionManagerTest : public ::testing::Test { }, 0); }); - mCallback = ::ndk::SharedRefBase::make(); + mCallback = ndk::SharedRefBase::make(); // Keep the local binder alive. mBinder = mCallback->asBinder(); mCallbackClient = IVehicleCallback::fromBinder(mBinder); @@ -350,9 +350,9 @@ TEST_F(SubscriptionManagerTest, testSubscribeOnchange) { }, }; - SpAIBinder binder1 = ::ndk::SharedRefBase::make()->asBinder(); + SpAIBinder binder1 = ndk::SharedRefBase::make()->asBinder(); std::shared_ptr client1 = IVehicleCallback::fromBinder(binder1); - SpAIBinder binder2 = ::ndk::SharedRefBase::make()->asBinder(); + SpAIBinder binder2 = ndk::SharedRefBase::make()->asBinder(); std::shared_ptr client2 = IVehicleCallback::fromBinder(binder2); auto result = getManager()->subscribe(client1, options1, false); ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); -- GitLab From ef2da6da7f08513f50f389d2ebc831f2c85e6489 Mon Sep 17 00:00:00 2001 From: Chungjui Fan Date: Wed, 19 Jan 2022 12:08:40 +0800 Subject: [PATCH 565/825] Add CAMERA in light type for android.hardware.light Bug: 199718333 Test: VTS pass Change-Id: I3c5c30ae557b3e35b2a995bfd9a75a86192651ba --- .../compatibility_matrix.current.xml | 2 +- .../hardware/light/BrightnessMode.aidl | 28 ++++++++++++++---- .../android/hardware/light/FlashMode.aidl | 28 ++++++++++++++---- .../android/hardware/light/HwLight.aidl | 28 ++++++++++++++---- .../android/hardware/light/HwLightState.aidl | 28 ++++++++++++++---- .../android/hardware/light/ILights.aidl | 28 ++++++++++++++---- .../android/hardware/light/LightType.aidl | 29 +++++++++++++++---- .../android/hardware/light/LightType.aidl | 1 + light/aidl/default/Android.bp | 2 +- light/aidl/default/lights-default.xml | 1 + 10 files changed, 137 insertions(+), 38 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index dc716bbdc0..0cc63a6c1d 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -427,7 +427,7 @@
android.hardware.light - 1 + 2 ILights default diff --git a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/BrightnessMode.aidl b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/BrightnessMode.aidl index c4c6d64786..881390764f 100644 --- a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/BrightnessMode.aidl +++ b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/BrightnessMode.aidl @@ -1,14 +1,30 @@ +/* + * 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. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/FlashMode.aidl b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/FlashMode.aidl index 349f9f321c..0411f82904 100644 --- a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/FlashMode.aidl +++ b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/FlashMode.aidl @@ -1,14 +1,30 @@ +/* + * 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. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLight.aidl b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLight.aidl index c397f91060..25a2dce37d 100644 --- a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLight.aidl +++ b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLight.aidl @@ -1,14 +1,30 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLightState.aidl b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLightState.aidl index 44a088234f..40e520b796 100644 --- a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLightState.aidl +++ b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/HwLightState.aidl @@ -1,14 +1,30 @@ +/* + * 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. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/ILights.aidl b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/ILights.aidl index fc6c6265af..30bb3c3d8b 100644 --- a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/ILights.aidl +++ b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/ILights.aidl @@ -1,14 +1,30 @@ +/* + * 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. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/LightType.aidl b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/LightType.aidl index 77ab98c1cf..2b978ab8d5 100644 --- a/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/LightType.aidl +++ b/light/aidl/aidl_api/android.hardware.light/current/android/hardware/light/LightType.aidl @@ -1,14 +1,30 @@ +/* + * 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. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 @@ -27,4 +43,5 @@ enum LightType { BLUETOOTH = 6, WIFI = 7, MICROPHONE = 8, + CAMERA = 9, } diff --git a/light/aidl/android/hardware/light/LightType.aidl b/light/aidl/android/hardware/light/LightType.aidl index 9a7f65619d..f7161d04d3 100644 --- a/light/aidl/android/hardware/light/LightType.aidl +++ b/light/aidl/android/hardware/light/LightType.aidl @@ -32,4 +32,5 @@ enum LightType { BLUETOOTH = 6, WIFI = 7, MICROPHONE = 8, + CAMERA = 9, } diff --git a/light/aidl/default/Android.bp b/light/aidl/default/Android.bp index 2ccf1407fd..7920503ac5 100644 --- a/light/aidl/default/Android.bp +++ b/light/aidl/default/Android.bp @@ -16,7 +16,7 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.light-V1-ndk", + "android.hardware.light-V2-ndk", ], srcs: [ "Lights.cpp", diff --git a/light/aidl/default/lights-default.xml b/light/aidl/default/lights-default.xml index db604d61f0..abdd74e491 100644 --- a/light/aidl/default/lights-default.xml +++ b/light/aidl/default/lights-default.xml @@ -1,6 +1,7 @@ android.hardware.light + 2 ILights/default -- GitLab From cd883bc17a138ffa7392ec6f65a0787e07c503ac Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 3 Feb 2022 20:38:26 -0500 Subject: [PATCH 566/825] Address ANAPIC feedback Also adds recommended combination for FRONT_BUFFER as that was feedback from implementers Fixes: 217752219 Test: N/A doc only change Change-Id: I086597d14cc7d9d1a0b620b73297aaa3e6288773 --- .../android/hardware/graphics/allocator/IAllocator.aidl | 4 ++-- .../android/hardware/graphics/common/BufferUsage.aidl | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl b/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl index 8c3ca9601e..92dfd4f8ab 100644 --- a/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl +++ b/graphics/allocator/aidl/android/hardware/graphics/allocator/IAllocator.aidl @@ -29,8 +29,8 @@ interface IAllocator { * @param descriptor Properties of the buffers to allocate. This must be * obtained from IMapper::createDescriptor(). * @param count The number of buffers to allocate. - * @return An AllocationResult containing the result of an error, or - * an AllocationError status + * @return An AllocationResult containing the result of the allocation + * @throws AllocationError on failure */ AllocationResult allocate(in byte[] descriptor, in int count); } diff --git a/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl b/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl index 60dfbfb319..17f4684379 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl @@ -125,6 +125,14 @@ enum BufferUsage { * 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, -- GitLab From bb2fe3f4d557cf1034287f3c1c2360673dc2f401 Mon Sep 17 00:00:00 2001 From: Carter Hsu Date: Thu, 27 Jan 2022 09:58:16 +0800 Subject: [PATCH 567/825] audio: add Ultrasound materials to 7.1 Bug: 200256985 Test: build pass Signed-off-by: Carter Hsu Change-Id: I50ba1272c0b29e482532010f1aca0b6ec83e925c --- audio/7.1/config/api/current.txt | 4 ++++ audio/7.1/config/audio_policy_configuration.xsd | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/audio/7.1/config/api/current.txt b/audio/7.1/config/api/current.txt index 2963904fea..3a08b71d86 100644 --- a/audio/7.1/config/api/current.txt +++ b/audio/7.1/config/api/current.txt @@ -86,6 +86,7 @@ package android.audio.policy.configuration.V7_1 { enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_MUSIC; enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_SONIFICATION; enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_SPEECH; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_ULTRASOUND; enum_constant public static final android.audio.policy.configuration.V7_1.AudioContentType AUDIO_CONTENT_TYPE_UNKNOWN; } @@ -273,6 +274,7 @@ package android.audio.policy.configuration.V7_1 { enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_MMAP_NOIRQ; enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_RAW; enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_SYNC; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_ULTRASOUND; enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_INPUT_FLAG_VOIP_TX; enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD; enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_DEEP_BUFFER; @@ -290,6 +292,7 @@ package android.audio.policy.configuration.V7_1 { enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_SPATIALIZER; enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_SYNC; enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_TTS; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_ULTRASOUND; enum_constant public static final android.audio.policy.configuration.V7_1.AudioInOutFlag AUDIO_OUTPUT_FLAG_VOIP_RX; } @@ -314,6 +317,7 @@ package android.audio.policy.configuration.V7_1 { enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_HOTWORD; enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_MIC; enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_REMOTE_SUBMIX; + enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_ULTRASOUND; enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_UNPROCESSED; enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_VOICE_CALL; enum_constant public static final android.audio.policy.configuration.V7_1.AudioSource AUDIO_SOURCE_VOICE_COMMUNICATION; diff --git a/audio/7.1/config/audio_policy_configuration.xsd b/audio/7.1/config/audio_policy_configuration.xsd index 414552e89f..ebc23edff2 100644 --- a/audio/7.1/config/audio_policy_configuration.xsd +++ b/audio/7.1/config/audio_policy_configuration.xsd @@ -180,6 +180,7 @@ + @@ -188,6 +189,7 @@ + @@ -471,6 +473,7 @@ + @@ -742,6 +745,7 @@ + -- GitLab From bcfa0f45b9207d23a598869bb63c31d11ec65457 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Wed, 2 Feb 2022 14:34:13 +0100 Subject: [PATCH 568/825] audio VTS: add tests for latency mode APIs Add test cases for latency mode control APIs in V7.1 VTS. Bug: 210803914 Test: atest VtsHalAudioV7_1TargetTest Change-Id: I22691f97a5c9b54f4fdec0c5cd2bd64486d0dd76 --- .../7.1/AudioPrimaryHidlHalTest.cpp | 48 +++++++++++++++++++ .../vts/functional/AudioPrimaryHidlHalTest.h | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp index d82d4adb51..6b9b32ded0 100644 --- a/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp +++ b/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp @@ -47,3 +47,51 @@ TEST_P(AudioHidlDeviceTest, SetConnectedState_7_1) { // initial state. To workaround this, destroy the HAL at the end of this test. ASSERT_TRUE(resetDevice()); } +class LatencyModeOutputStreamTest : public OutputStreamTest { + protected: + void SetUp() override { + OutputStreamTest::SetUp(); + + Result res; + EXPECT_OK(stream->getRecommendedLatencyModes(returnIn(res, mSupportedLatencyModes))); + EXPECT_RESULT(okOrNotSupported, res); + if (res == Result::NOT_SUPPORTED) { + GTEST_SKIP() << "latency mode is not supported"; // returns + } + } + hidl_vec mSupportedLatencyModes; +}; + +TEST_P(LatencyModeOutputStreamTest, GetRecommendedLatencyModes) { + doc::test("Verify that reported latency modes are valid when supported"); + for (auto mode : mSupportedLatencyModes) { + ASSERT_TRUE(mode >= LatencyMode::FREE && mode <= LatencyMode::LOW); + } +} + +TEST_P(LatencyModeOutputStreamTest, SetValidLatencyMode) { + doc::test("Verify that setting valid latency modes works when supported"); + for (auto mode : mSupportedLatencyModes) { + EXPECT_OK(stream->setLatencyMode(mode)); + } +} + +TEST_P(LatencyModeOutputStreamTest, SetInValidLatencyMode) { + doc::test("Verify that setting invalid latency modes fails"); + EXPECT_RESULT(invalidArgsOrNotSupported, + stream->setLatencyMode(static_cast(1977))); +} + +/** Stub implementation of IStreamOutEventCallback **/ +class MockOutLatencyModeCallback : public IStreamOutLatencyModeCallback { + Return onRecommendedLatencyModeChanged( + const hidl_vec& hidlModes __unused) override { + return {}; + } +}; + +TEST_P(LatencyModeOutputStreamTest, SetLatencyModeCallback) { + doc::test("Verify that setting a latency mode callback works when supported"); + EXPECT_OK(stream->setLatencyModeCallback(new MockOutLatencyModeCallback)); + EXPECT_OK(stream->setLatencyModeCallback(nullptr)); +} diff --git a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h index 404532a6fa..c093b37778 100644 --- a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h +++ b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h @@ -1010,6 +1010,7 @@ class StreamWriter : public StreamWorker { class OutputStreamTest : public OpenStreamTest<::android::hardware::audio::CPP_VERSION::IStreamOut> { + protected: void SetUp() override { ASSERT_NO_FATAL_FAILURE(OpenStreamTest::SetUp()); // setup base #if MAJOR_VERSION <= 6 @@ -1035,7 +1036,6 @@ class OutputStreamTest } #if MAJOR_VERSION >= 4 && MAJOR_VERSION <= 6 - protected: const SourceMetadata initMetadata = { { { AudioUsage::MEDIA, AudioContentType::MUSIC, -- GitLab From 33e7fef887d792a769d5ff69329f56e9c5b8fc30 Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Wed, 3 Nov 2021 12:06:08 -0700 Subject: [PATCH 569/825] Add AIDL interfaces for camera metadata. Bug: 196432585 Test: build; Implementation will be submitted later. Change-Id: I1fe9488bb34ef5c0a755d7bb8f284cc1fbc8f298 Signed-off-by: Jayant Chowdhary --- camera/metadata/aidl/Android.bp | 19 + .../camera/metadata/BlackLevelLock.aidl | 43 + .../metadata/CameraMetadataSection.aidl | 72 + .../metadata/CameraMetadataSectionStart.aidl | 73 + .../camera/metadata/CameraMetadataTag.aidl | 327 +++ .../ColorCorrectionAberrationMode.aidl | 44 + .../camera/metadata/ColorCorrectionMode.aidl | 44 + .../metadata/ControlAeAntibandingMode.aidl | 45 + .../camera/metadata/ControlAeLock.aidl | 43 + .../metadata/ControlAeLockAvailable.aidl | 43 + .../camera/metadata/ControlAeMode.aidl | 47 + .../metadata/ControlAePrecaptureTrigger.aidl | 44 + .../camera/metadata/ControlAeState.aidl | 47 + .../camera/metadata/ControlAfMode.aidl | 47 + .../camera/metadata/ControlAfSceneChange.aidl | 43 + .../camera/metadata/ControlAfState.aidl | 48 + .../camera/metadata/ControlAfTrigger.aidl | 44 + .../camera/metadata/ControlAwbLock.aidl | 43 + .../metadata/ControlAwbLockAvailable.aidl | 43 + .../camera/metadata/ControlAwbMode.aidl | 50 + .../camera/metadata/ControlAwbState.aidl | 45 + .../camera/metadata/ControlCaptureIntent.aidl | 49 + .../camera/metadata/ControlEffectMode.aidl | 50 + .../camera/metadata/ControlEnableZsl.aidl | 43 + .../metadata/ControlExtendedSceneMode.aidl | 45 + .../hardware/camera/metadata/ControlMode.aidl | 46 + .../camera/metadata/ControlSceneMode.aidl | 63 + .../ControlVideoStabilizationMode.aidl | 44 + .../camera/metadata/DemosaicMode.aidl | 43 + ...pthAvailableDepthStreamConfigurations.aidl | 43 + ...StreamConfigurationsMaximumResolution.aidl | 43 + ...lableDynamicDepthStreamConfigurations.aidl | 43 + ...StreamConfigurationsMaximumResolution.aidl | 43 + .../metadata/DepthDepthIsExclusive.aidl | 43 + .../metadata/DistortionCorrectionMode.aidl | 44 + .../hardware/camera/metadata/EdgeMode.aidl | 45 + .../camera/metadata/FlashInfoAvailable.aidl | 43 + .../hardware/camera/metadata/FlashMode.aidl | 44 + .../hardware/camera/metadata/FlashState.aidl | 46 + ...HeicAvailableHeicStreamConfigurations.aidl | 43 + ...StreamConfigurationsMaximumResolution.aidl | 43 + .../camera/metadata/HeicInfoSupported.aidl | 43 + .../camera/metadata/HotPixelMode.aidl | 44 + .../InfoSupportedBufferManagementVersion.aidl | 42 + .../metadata/InfoSupportedHardwareLevel.aidl | 46 + .../camera/metadata/LedAvailableLeds.aidl | 42 + .../hardware/camera/metadata/LedTransmit.aidl | 43 + .../hardware/camera/metadata/LensFacing.aidl | 44 + .../LensInfoFocusDistanceCalibration.aidl | 44 + .../LensOpticalStabilizationMode.aidl | 43 + .../camera/metadata/LensPoseReference.aidl | 44 + .../hardware/camera/metadata/LensState.aidl | 43 + .../LogicalMultiCameraSensorSyncType.aidl | 43 + .../camera/metadata/NoiseReductionMode.aidl | 46 + .../camera/metadata/QuirksPartialResult.aidl | 43 + .../RequestAvailableCapabilities.aidl | 60 + ...questAvailableDynamicRangeProfilesMap.aidl | 54 + .../camera/metadata/RequestMetadataMode.aidl | 43 + .../hardware/camera/metadata/RequestType.aidl | 43 + .../metadata/ScalerAvailableFormats.aidl | 51 + ...ilableRecommendedStreamConfigurations.aidl | 50 + .../ScalerAvailableStreamConfigurations.aidl | 43 + ...StreamConfigurationsMaximumResolution.aidl | 43 + .../camera/metadata/ScalerCroppingType.aidl | 43 + .../ScalerMultiResolutionStreamSupported.aidl | 43 + ...raMultiResolutionStreamConfigurations.aidl | 43 + .../camera/metadata/ScalerRotateAndCrop.aidl | 46 + .../SensorInfoColorFilterArrangement.aidl | 48 + .../SensorInfoLensShadingApplied.aidl | 43 + .../metadata/SensorInfoTimestampSource.aidl | 43 + .../camera/metadata/SensorPixelMode.aidl | 43 + .../metadata/SensorRawBinningFactorUsed.aidl | 43 + .../metadata/SensorReferenceIlluminant1.aidl | 60 + .../metadata/SensorTestPatternMode.aidl | 48 + .../hardware/camera/metadata/ShadingMode.aidl | 44 + .../metadata/StatisticsFaceDetectMode.aidl | 44 + .../metadata/StatisticsHistogramMode.aidl | 43 + .../metadata/StatisticsHotPixelMapMode.aidl | 43 + .../StatisticsLensShadingMapMode.aidl | 43 + .../metadata/StatisticsOisDataMode.aidl | 43 + .../metadata/StatisticsSceneFlicker.aidl | 44 + .../metadata/StatisticsSharpnessMapMode.aidl | 43 + .../camera/metadata/SyncFrameNumber.aidl | 43 + .../camera/metadata/SyncMaxLatency.aidl | 43 + .../hardware/camera/metadata/TonemapMode.aidl | 46 + .../camera/metadata/TonemapPresetCurve.aidl | 43 + .../camera/metadata/BlackLevelLock.aidl | 34 + .../metadata/CameraMetadataSection.aidl | 63 + .../metadata/CameraMetadataSectionStart.aidl | 66 + .../camera/metadata/CameraMetadataTag.aidl | 2229 +++++++++++++++++ .../ColorCorrectionAberrationMode.aidl | 35 + .../camera/metadata/ColorCorrectionMode.aidl | 38 + .../metadata/ControlAeAntibandingMode.aidl | 36 + .../camera/metadata/ControlAeLock.aidl | 34 + .../metadata/ControlAeLockAvailable.aidl | 34 + .../camera/metadata/ControlAeMode.aidl | 41 + .../metadata/ControlAePrecaptureTrigger.aidl | 35 + .../camera/metadata/ControlAeState.aidl | 38 + .../camera/metadata/ControlAfMode.aidl | 38 + .../camera/metadata/ControlAfSceneChange.aidl | 34 + .../camera/metadata/ControlAfState.aidl | 39 + .../camera/metadata/ControlAfTrigger.aidl | 35 + .../camera/metadata/ControlAwbLock.aidl | 34 + .../metadata/ControlAwbLockAvailable.aidl | 34 + .../camera/metadata/ControlAwbMode.aidl | 41 + .../camera/metadata/ControlAwbState.aidl | 36 + .../camera/metadata/ControlCaptureIntent.aidl | 40 + .../camera/metadata/ControlEffectMode.aidl | 41 + .../camera/metadata/ControlEnableZsl.aidl | 34 + .../metadata/ControlExtendedSceneMode.aidl | 36 + .../hardware/camera/metadata/ControlMode.aidl | 40 + .../camera/metadata/ControlSceneMode.aidl | 54 + .../ControlVideoStabilizationMode.aidl | 38 + .../camera/metadata/DemosaicMode.aidl | 34 + ...pthAvailableDepthStreamConfigurations.aidl | 34 + ...StreamConfigurationsMaximumResolution.aidl | 34 + ...lableDynamicDepthStreamConfigurations.aidl | 34 + ...StreamConfigurationsMaximumResolution.aidl | 34 + .../metadata/DepthDepthIsExclusive.aidl | 34 + .../metadata/DistortionCorrectionMode.aidl | 35 + .../hardware/camera/metadata/EdgeMode.aidl | 36 + .../camera/metadata/FlashInfoAvailable.aidl | 34 + .../hardware/camera/metadata/FlashMode.aidl | 35 + .../hardware/camera/metadata/FlashState.aidl | 37 + ...HeicAvailableHeicStreamConfigurations.aidl | 34 + ...StreamConfigurationsMaximumResolution.aidl | 34 + .../camera/metadata/HeicInfoSupported.aidl | 34 + .../camera/metadata/HotPixelMode.aidl | 35 + .../InfoSupportedBufferManagementVersion.aidl | 33 + .../metadata/InfoSupportedHardwareLevel.aidl | 37 + .../camera/metadata/LedAvailableLeds.aidl | 33 + .../hardware/camera/metadata/LedTransmit.aidl | 34 + .../hardware/camera/metadata/LensFacing.aidl | 35 + .../LensInfoFocusDistanceCalibration.aidl | 35 + .../LensOpticalStabilizationMode.aidl | 34 + .../camera/metadata/LensPoseReference.aidl | 35 + .../hardware/camera/metadata/LensState.aidl | 34 + .../LogicalMultiCameraSensorSyncType.aidl | 34 + .../camera/metadata/NoiseReductionMode.aidl | 37 + .../camera/metadata/QuirksPartialResult.aidl | 34 + .../RequestAvailableCapabilities.aidl | 51 + ...questAvailableDynamicRangeProfilesMap.aidl | 45 + .../camera/metadata/RequestMetadataMode.aidl | 34 + .../hardware/camera/metadata/RequestType.aidl | 34 + .../metadata/ScalerAvailableFormats.aidl | 42 + ...ilableRecommendedStreamConfigurations.aidl | 41 + .../ScalerAvailableStreamConfigurations.aidl | 34 + ...StreamConfigurationsMaximumResolution.aidl | 34 + .../camera/metadata/ScalerCroppingType.aidl | 34 + .../ScalerMultiResolutionStreamSupported.aidl | 34 + ...raMultiResolutionStreamConfigurations.aidl | 34 + .../camera/metadata/ScalerRotateAndCrop.aidl | 37 + .../SensorInfoColorFilterArrangement.aidl | 39 + .../SensorInfoLensShadingApplied.aidl | 34 + .../metadata/SensorInfoTimestampSource.aidl | 34 + .../camera/metadata/SensorPixelMode.aidl | 34 + .../metadata/SensorRawBinningFactorUsed.aidl | 34 + .../metadata/SensorReferenceIlluminant1.aidl | 51 + .../metadata/SensorTestPatternMode.aidl | 39 + .../hardware/camera/metadata/ShadingMode.aidl | 35 + .../metadata/StatisticsFaceDetectMode.aidl | 35 + .../metadata/StatisticsHistogramMode.aidl | 34 + .../metadata/StatisticsHotPixelMapMode.aidl | 34 + .../StatisticsLensShadingMapMode.aidl | 34 + .../metadata/StatisticsOisDataMode.aidl | 34 + .../metadata/StatisticsSceneFlicker.aidl | 35 + .../metadata/StatisticsSharpnessMapMode.aidl | 34 + .../camera/metadata/SyncFrameNumber.aidl | 34 + .../camera/metadata/SyncMaxLatency.aidl | 34 + .../hardware/camera/metadata/TonemapMode.aidl | 37 + .../camera/metadata/TonemapPresetCurve.aidl | 34 + .../exclude/fcm_exclude.cpp | 3 +- 172 files changed, 9507 insertions(+), 1 deletion(-) create mode 100644 camera/metadata/aidl/Android.bp create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/BlackLevelLock.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ColorCorrectionMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeLock.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeLockAvailable.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeState.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfSceneChange.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfState.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfTrigger.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbLock.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbState.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlCaptureIntent.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlEffectMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlEnableZsl.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlSceneMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DemosaicMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DistortionCorrectionMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/EdgeMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashInfoAvailable.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashState.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicInfoSupported.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HotPixelMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LedAvailableLeds.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LedTransmit.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensFacing.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensPoseReference.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensState.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/NoiseReductionMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/QuirksPartialResult.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestMetadataMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestType.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableFormats.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerCroppingType.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorPixelMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorTestPatternMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ShadingMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsHistogramMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsOisDataMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SyncFrameNumber.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SyncMaxLatency.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/TonemapMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/TonemapPresetCurve.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/BlackLevelLock.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLock.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLockAvailable.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlAeState.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlAfMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlAfSceneChange.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlAfState.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlAfTrigger.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLock.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbState.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlCaptureIntent.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlEffectMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlEnableZsl.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlSceneMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/DemosaicMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/DistortionCorrectionMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/EdgeMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/FlashInfoAvailable.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/FlashMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/FlashState.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/HeicInfoSupported.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/HotPixelMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/LedAvailableLeds.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/LedTransmit.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/LensFacing.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/LensState.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/NoiseReductionMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/QuirksPartialResult.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/RequestMetadataMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/RequestType.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableFormats.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ScalerCroppingType.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/SensorPixelMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ShadingMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHistogramMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/StatisticsOisDataMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/SyncFrameNumber.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/SyncMaxLatency.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/TonemapMode.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/TonemapPresetCurve.aidl diff --git a/camera/metadata/aidl/Android.bp b/camera/metadata/aidl/Android.bp new file mode 100644 index 0000000000..05f280c6f1 --- /dev/null +++ b/camera/metadata/aidl/Android.bp @@ -0,0 +1,19 @@ +aidl_interface { + name: "android.hardware.camera.metadata", + vendor_available: true, + srcs: ["android/hardware/camera/metadata/*.aidl"], + stability: "vintf", + backend: { + cpp: { + enabled: false, + }, + java: { + enabled: false, + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/BlackLevelLock.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/BlackLevelLock.aidl new file mode 100644 index 0000000000..dcefa2f697 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/BlackLevelLock.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 -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 BlackLevelLock { + ANDROID_BLACK_LEVEL_LOCK_OFF = 0, + ANDROID_BLACK_LEVEL_LOCK_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl new file mode 100644 index 0000000000..dc3383692d --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl @@ -0,0 +1,72 @@ +/* + * 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 -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 CameraMetadataSection { + ANDROID_COLOR_CORRECTION = 0, + ANDROID_CONTROL = 1, + ANDROID_DEMOSAIC = 2, + ANDROID_EDGE = 3, + ANDROID_FLASH = 4, + ANDROID_FLASH_INFO = 5, + ANDROID_HOT_PIXEL = 6, + ANDROID_JPEG = 7, + ANDROID_LENS = 8, + ANDROID_LENS_INFO = 9, + ANDROID_NOISE_REDUCTION = 10, + ANDROID_QUIRKS = 11, + ANDROID_REQUEST = 12, + ANDROID_SCALER = 13, + ANDROID_SENSOR = 14, + ANDROID_SENSOR_INFO = 15, + ANDROID_SHADING = 16, + ANDROID_STATISTICS = 17, + ANDROID_STATISTICS_INFO = 18, + ANDROID_TONEMAP = 19, + ANDROID_LED = 20, + ANDROID_INFO = 21, + ANDROID_BLACK_LEVEL = 22, + ANDROID_SYNC = 23, + ANDROID_REPROCESS = 24, + ANDROID_DEPTH = 25, + ANDROID_LOGICAL_MULTI_CAMERA = 26, + ANDROID_DISTORTION_CORRECTION = 27, + ANDROID_HEIC = 28, + ANDROID_HEIC_INFO = 29, + VENDOR_SECTION = 32768, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl new file mode 100644 index 0000000000..0c355c8664 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl @@ -0,0 +1,73 @@ +/* + * 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 -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 CameraMetadataSectionStart { + ANDROID_COLOR_CORRECTION_START = 0, + ANDROID_CONTROL_START = 65536, + ANDROID_DEMOSAIC_START = 131072, + ANDROID_EDGE_START = 196608, + ANDROID_FLASH_START = 262144, + ANDROID_FLASH_INFO_START = 327680, + ANDROID_HOT_PIXEL_START = 393216, + ANDROID_JPEG_START = 458752, + ANDROID_LENS_START = 524288, + ANDROID_LENS_INFO_START = 589824, + ANDROID_NOISE_REDUCTION_START = 655360, + ANDROID_QUIRKS_START = 720896, + ANDROID_REQUEST_START = 786432, + ANDROID_SCALER_START = 851968, + ANDROID_SENSOR_START = 917504, + ANDROID_SENSOR_INFO_START = 983040, + ANDROID_SHADING_START = 1048576, + ANDROID_STATISTICS_START = 1114112, + ANDROID_STATISTICS_INFO_START = 1179648, + ANDROID_TONEMAP_START = 1245184, + ANDROID_LED_START = 1310720, + ANDROID_INFO_START = 1376256, + ANDROID_BLACK_LEVEL_START = 1441792, + ANDROID_SYNC_START = 1507328, + ANDROID_REPROCESS_START = 1572864, + ANDROID_DEPTH_START = 1638400, + VENDOR_SECTION_START = -2147483648, + ANDROID_LOGICAL_MULTI_CAMERA_START = 1703936, + ANDROID_DISTORTION_CORRECTION_START = 1769472, + ANDROID_HEIC_START = 1835008, + ANDROID_HEIC_INFO_START = 1900544, + VENDOR_SECTION_START = -2147483648, +} 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 new file mode 100644 index 0000000000..34a1211d31 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl @@ -0,0 +1,327 @@ +/* + * 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 -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 CameraMetadataTag { + ANDROID_COLOR_CORRECTION_MODE = 0, + ANDROID_COLOR_CORRECTION_TRANSFORM = 1, + ANDROID_COLOR_CORRECTION_GAINS = 2, + ANDROID_COLOR_CORRECTION_ABERRATION_MODE = 3, + ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES = 4, + ANDROID_CONTROL_AE_ANTIBANDING_MODE = 65536, + ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION = 65537, + ANDROID_CONTROL_AE_LOCK = 65538, + ANDROID_CONTROL_AE_MODE = 65539, + ANDROID_CONTROL_AE_REGIONS = 65540, + ANDROID_CONTROL_AE_TARGET_FPS_RANGE = 65541, + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER = 65542, + ANDROID_CONTROL_AF_MODE = 65543, + ANDROID_CONTROL_AF_REGIONS = 65544, + ANDROID_CONTROL_AF_TRIGGER = 65545, + ANDROID_CONTROL_AWB_LOCK = 65546, + ANDROID_CONTROL_AWB_MODE = 65547, + ANDROID_CONTROL_AWB_REGIONS = 65548, + ANDROID_CONTROL_CAPTURE_INTENT = 65549, + ANDROID_CONTROL_EFFECT_MODE = 65550, + ANDROID_CONTROL_MODE = 65551, + ANDROID_CONTROL_SCENE_MODE = 65552, + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE = 65553, + ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES = 65554, + ANDROID_CONTROL_AE_AVAILABLE_MODES = 65555, + ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES = 65556, + ANDROID_CONTROL_AE_COMPENSATION_RANGE = 65557, + ANDROID_CONTROL_AE_COMPENSATION_STEP = 65558, + ANDROID_CONTROL_AF_AVAILABLE_MODES = 65559, + ANDROID_CONTROL_AVAILABLE_EFFECTS = 65560, + ANDROID_CONTROL_AVAILABLE_SCENE_MODES = 65561, + ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES = 65562, + ANDROID_CONTROL_AWB_AVAILABLE_MODES = 65563, + ANDROID_CONTROL_MAX_REGIONS = 65564, + ANDROID_CONTROL_SCENE_MODE_OVERRIDES = 65565, + ANDROID_CONTROL_AE_PRECAPTURE_ID = 65566, + ANDROID_CONTROL_AE_STATE = 65567, + ANDROID_CONTROL_AF_STATE = 65568, + ANDROID_CONTROL_AF_TRIGGER_ID = 65569, + ANDROID_CONTROL_AWB_STATE = 65570, + ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS = 65571, + ANDROID_CONTROL_AE_LOCK_AVAILABLE = 65572, + ANDROID_CONTROL_AWB_LOCK_AVAILABLE = 65573, + ANDROID_CONTROL_AVAILABLE_MODES = 65574, + ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE = 65575, + ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST = 65576, + ANDROID_CONTROL_ENABLE_ZSL = 65577, + ANDROID_CONTROL_AF_SCENE_CHANGE = 65578, + ANDROID_CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_MAX_SIZES = 65579, + ANDROID_CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_ZOOM_RATIO_RANGES = 65580, + ANDROID_CONTROL_EXTENDED_SCENE_MODE = 65581, + ANDROID_CONTROL_ZOOM_RATIO_RANGE = 65582, + ANDROID_CONTROL_ZOOM_RATIO = 65583, + ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS_MAXIMUM_RESOLUTION = 65584, + ANDROID_DEMOSAIC_MODE = 131072, + ANDROID_EDGE_MODE = 196608, + ANDROID_EDGE_STRENGTH = 196609, + ANDROID_EDGE_AVAILABLE_EDGE_MODES = 196610, + ANDROID_FLASH_FIRING_POWER = 262144, + ANDROID_FLASH_FIRING_TIME = 262145, + ANDROID_FLASH_MODE = 262146, + ANDROID_FLASH_COLOR_TEMPERATURE = 262147, + ANDROID_FLASH_MAX_ENERGY = 262148, + ANDROID_FLASH_STATE = 262149, + ANDROID_FLASH_INFO_AVAILABLE = 327680, + ANDROID_FLASH_INFO_CHARGE_DURATION = 327681, + ANDROID_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL = 327682, + ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL = 327683, + ANDROID_HOT_PIXEL_MODE = 393216, + ANDROID_HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES = 393217, + ANDROID_JPEG_GPS_COORDINATES = 458752, + ANDROID_JPEG_GPS_PROCESSING_METHOD = 458753, + ANDROID_JPEG_GPS_TIMESTAMP = 458754, + ANDROID_JPEG_ORIENTATION = 458755, + ANDROID_JPEG_QUALITY = 458756, + ANDROID_JPEG_THUMBNAIL_QUALITY = 458757, + ANDROID_JPEG_THUMBNAIL_SIZE = 458758, + ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES = 458759, + ANDROID_JPEG_MAX_SIZE = 458760, + ANDROID_JPEG_SIZE = 458761, + ANDROID_LENS_APERTURE = 524288, + ANDROID_LENS_FILTER_DENSITY = 524289, + ANDROID_LENS_FOCAL_LENGTH = 524290, + ANDROID_LENS_FOCUS_DISTANCE = 524291, + ANDROID_LENS_OPTICAL_STABILIZATION_MODE = 524292, + ANDROID_LENS_FACING = 524293, + ANDROID_LENS_POSE_ROTATION = 524294, + ANDROID_LENS_POSE_TRANSLATION = 524295, + ANDROID_LENS_FOCUS_RANGE = 524296, + ANDROID_LENS_STATE = 524297, + ANDROID_LENS_INTRINSIC_CALIBRATION = 524298, + ANDROID_LENS_RADIAL_DISTORTION = 524299, + ANDROID_LENS_POSE_REFERENCE = 524300, + ANDROID_LENS_DISTORTION = 524301, + ANDROID_LENS_DISTORTION_MAXIMUM_RESOLUTION = 524302, + ANDROID_LENS_INTRINSIC_CALIBRATION_MAXIMUM_RESOLUTION = 524303, + ANDROID_LENS_INFO_AVAILABLE_APERTURES = 589824, + ANDROID_LENS_INFO_AVAILABLE_FILTER_DENSITIES = 589825, + ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS = 589826, + ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION = 589827, + ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE = 589828, + ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE = 589829, + ANDROID_LENS_INFO_SHADING_MAP_SIZE = 589830, + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION = 589831, + ANDROID_NOISE_REDUCTION_MODE = 655360, + ANDROID_NOISE_REDUCTION_STRENGTH = 655361, + ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES = 655362, + ANDROID_QUIRKS_METERING_CROP_REGION = 720896, + ANDROID_QUIRKS_TRIGGER_AF_WITH_AUTO = 720897, + ANDROID_QUIRKS_USE_ZSL_FORMAT = 720898, + ANDROID_QUIRKS_USE_PARTIAL_RESULT = 720899, + ANDROID_QUIRKS_PARTIAL_RESULT = 720900, + ANDROID_REQUEST_FRAME_COUNT = 786432, + ANDROID_REQUEST_ID = 786433, + ANDROID_REQUEST_INPUT_STREAMS = 786434, + ANDROID_REQUEST_METADATA_MODE = 786435, + ANDROID_REQUEST_OUTPUT_STREAMS = 786436, + ANDROID_REQUEST_TYPE = 786437, + ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS = 786438, + ANDROID_REQUEST_MAX_NUM_REPROCESS_STREAMS = 786439, + ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS = 786440, + ANDROID_REQUEST_PIPELINE_DEPTH = 786441, + ANDROID_REQUEST_PIPELINE_MAX_DEPTH = 786442, + ANDROID_REQUEST_PARTIAL_RESULT_COUNT = 786443, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES = 786444, + ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS = 786445, + ANDROID_REQUEST_AVAILABLE_RESULT_KEYS = 786446, + ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS = 786447, + ANDROID_REQUEST_AVAILABLE_SESSION_KEYS = 786448, + ANDROID_REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS = 786449, + ANDROID_REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION = 786450, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP = 786451, + ANDROID_REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE = 786452, + ANDROID_SCALER_CROP_REGION = 851968, + ANDROID_SCALER_AVAILABLE_FORMATS = 851969, + ANDROID_SCALER_AVAILABLE_JPEG_MIN_DURATIONS = 851970, + ANDROID_SCALER_AVAILABLE_JPEG_SIZES = 851971, + ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM = 851972, + ANDROID_SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS = 851973, + ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES = 851974, + ANDROID_SCALER_AVAILABLE_RAW_MIN_DURATIONS = 851975, + ANDROID_SCALER_AVAILABLE_RAW_SIZES = 851976, + ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP = 851977, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS = 851978, + ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS = 851979, + ANDROID_SCALER_AVAILABLE_STALL_DURATIONS = 851980, + ANDROID_SCALER_CROPPING_TYPE = 851981, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS = 851982, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP = 851983, + ANDROID_SCALER_AVAILABLE_ROTATE_AND_CROP_MODES = 851984, + ANDROID_SCALER_DEFAULT_SECURE_IMAGE_SIZE = 851985, + ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS = 851986, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = 851987, + ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION = 851988, + ANDROID_SCALER_AVAILABLE_STALL_DURATIONS_MAXIMUM_RESOLUTION = 851989, + ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP_MAXIMUM_RESOLUTION = 851990, + ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED = 851991, + ANDROID_SENSOR_EXPOSURE_TIME = 917504, + ANDROID_SENSOR_FRAME_DURATION = 917505, + ANDROID_SENSOR_SENSITIVITY = 917506, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1 = 917507, + ANDROID_SENSOR_REFERENCE_ILLUMINANT2 = 917508, + ANDROID_SENSOR_CALIBRATION_TRANSFORM1 = 917509, + ANDROID_SENSOR_CALIBRATION_TRANSFORM2 = 917510, + ANDROID_SENSOR_COLOR_TRANSFORM1 = 917511, + ANDROID_SENSOR_COLOR_TRANSFORM2 = 917512, + ANDROID_SENSOR_FORWARD_MATRIX1 = 917513, + ANDROID_SENSOR_FORWARD_MATRIX2 = 917514, + ANDROID_SENSOR_BASE_GAIN_FACTOR = 917515, + ANDROID_SENSOR_BLACK_LEVEL_PATTERN = 917516, + ANDROID_SENSOR_MAX_ANALOG_SENSITIVITY = 917517, + ANDROID_SENSOR_ORIENTATION = 917518, + ANDROID_SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS = 917519, + ANDROID_SENSOR_TIMESTAMP = 917520, + ANDROID_SENSOR_TEMPERATURE = 917521, + ANDROID_SENSOR_NEUTRAL_COLOR_POINT = 917522, + ANDROID_SENSOR_NOISE_PROFILE = 917523, + ANDROID_SENSOR_PROFILE_HUE_SAT_MAP = 917524, + ANDROID_SENSOR_PROFILE_TONE_CURVE = 917525, + ANDROID_SENSOR_GREEN_SPLIT = 917526, + ANDROID_SENSOR_TEST_PATTERN_DATA = 917527, + ANDROID_SENSOR_TEST_PATTERN_MODE = 917528, + ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES = 917529, + ANDROID_SENSOR_ROLLING_SHUTTER_SKEW = 917530, + ANDROID_SENSOR_OPTICAL_BLACK_REGIONS = 917531, + ANDROID_SENSOR_DYNAMIC_BLACK_LEVEL = 917532, + ANDROID_SENSOR_DYNAMIC_WHITE_LEVEL = 917533, + ANDROID_SENSOR_OPAQUE_RAW_SIZE = 917534, + ANDROID_SENSOR_OPAQUE_RAW_SIZE_MAXIMUM_RESOLUTION = 917535, + ANDROID_SENSOR_PIXEL_MODE = 917536, + ANDROID_SENSOR_RAW_BINNING_FACTOR_USED = 917537, + ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE = 983040, + ANDROID_SENSOR_INFO_SENSITIVITY_RANGE = 983041, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT = 983042, + ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE = 983043, + ANDROID_SENSOR_INFO_MAX_FRAME_DURATION = 983044, + ANDROID_SENSOR_INFO_PHYSICAL_SIZE = 983045, + ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE = 983046, + ANDROID_SENSOR_INFO_WHITE_LEVEL = 983047, + ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE = 983048, + ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED = 983049, + ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE = 983050, + ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION = 983051, + ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE_MAXIMUM_RESOLUTION = 983052, + ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION = 983053, + ANDROID_SENSOR_INFO_BINNING_FACTOR = 983054, + ANDROID_SHADING_MODE = 1048576, + ANDROID_SHADING_STRENGTH = 1048577, + ANDROID_SHADING_AVAILABLE_MODES = 1048578, + ANDROID_STATISTICS_FACE_DETECT_MODE = 1114112, + ANDROID_STATISTICS_HISTOGRAM_MODE = 1114113, + ANDROID_STATISTICS_SHARPNESS_MAP_MODE = 1114114, + ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE = 1114115, + ANDROID_STATISTICS_FACE_IDS = 1114116, + ANDROID_STATISTICS_FACE_LANDMARKS = 1114117, + ANDROID_STATISTICS_FACE_RECTANGLES = 1114118, + ANDROID_STATISTICS_FACE_SCORES = 1114119, + ANDROID_STATISTICS_HISTOGRAM = 1114120, + ANDROID_STATISTICS_SHARPNESS_MAP = 1114121, + ANDROID_STATISTICS_LENS_SHADING_CORRECTION_MAP = 1114122, + ANDROID_STATISTICS_LENS_SHADING_MAP = 1114123, + ANDROID_STATISTICS_PREDICTED_COLOR_GAINS = 1114124, + ANDROID_STATISTICS_PREDICTED_COLOR_TRANSFORM = 1114125, + ANDROID_STATISTICS_SCENE_FLICKER = 1114126, + ANDROID_STATISTICS_HOT_PIXEL_MAP = 1114127, + ANDROID_STATISTICS_LENS_SHADING_MAP_MODE = 1114128, + ANDROID_STATISTICS_OIS_DATA_MODE = 1114129, + ANDROID_STATISTICS_OIS_TIMESTAMPS = 1114130, + ANDROID_STATISTICS_OIS_X_SHIFTS = 1114131, + ANDROID_STATISTICS_OIS_Y_SHIFTS = 1114132, + ANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES = 1179648, + ANDROID_STATISTICS_INFO_HISTOGRAM_BUCKET_COUNT = 1179649, + ANDROID_STATISTICS_INFO_MAX_FACE_COUNT = 1179650, + ANDROID_STATISTICS_INFO_MAX_HISTOGRAM_COUNT = 1179651, + ANDROID_STATISTICS_INFO_MAX_SHARPNESS_MAP_VALUE = 1179652, + ANDROID_STATISTICS_INFO_SHARPNESS_MAP_SIZE = 1179653, + ANDROID_STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES = 1179654, + ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES = 1179655, + ANDROID_STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES = 1179656, + ANDROID_TONEMAP_CURVE_BLUE = 1245184, + ANDROID_TONEMAP_CURVE_GREEN = 1245185, + ANDROID_TONEMAP_CURVE_RED = 1245186, + ANDROID_TONEMAP_MODE = 1245187, + ANDROID_TONEMAP_MAX_CURVE_POINTS = 1245188, + ANDROID_TONEMAP_AVAILABLE_TONE_MAP_MODES = 1245189, + ANDROID_TONEMAP_GAMMA = 1245190, + ANDROID_TONEMAP_PRESET_CURVE = 1245191, + ANDROID_LED_TRANSMIT = 1310720, + ANDROID_LED_AVAILABLE_LEDS = 1310721, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL = 1376256, + ANDROID_INFO_VERSION = 1376257, + ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION = 1376258, + ANDROID_INFO_DEVICE_STATE_ORIENTATIONS = 1376259, + ANDROID_BLACK_LEVEL_LOCK = 1441792, + ANDROID_SYNC_FRAME_NUMBER = 1507328, + ANDROID_SYNC_MAX_LATENCY = 1507329, + ANDROID_REPROCESS_EFFECTIVE_EXPOSURE_FACTOR = 1572864, + ANDROID_REPROCESS_MAX_CAPTURE_STALL = 1572865, + ANDROID_DEPTH_MAX_DEPTH_SAMPLES = 1638400, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS = 1638401, + ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS = 1638402, + ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS = 1638403, + ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE = 1638404, + ANDROID_DEPTH_AVAILABLE_RECOMMENDED_DEPTH_STREAM_CONFIGURATIONS = 1638405, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS = 1638406, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS = 1638407, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS = 1638408, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = 1638409, + ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION = 1638410, + ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS_MAXIMUM_RESOLUTION = 1638411, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = 1638412, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION = 1638413, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS_MAXIMUM_RESOLUTION = 1638414, + ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS = 1703936, + ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE = 1703937, + ANDROID_LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID = 1703938, + ANDROID_DISTORTION_CORRECTION_MODE = 1769472, + ANDROID_DISTORTION_CORRECTION_AVAILABLE_MODES = 1769473, + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS = 1835008, + ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS = 1835009, + ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS = 1835010, + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = 1835011, + ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION = 1835012, + ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS_MAXIMUM_RESOLUTION = 1835013, + ANDROID_HEIC_INFO_SUPPORTED = 1900544, + ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT = 1900545, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl new file mode 100644 index 0000000000..d04ffe3906 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ColorCorrectionAberrationMode.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. + *//* + * 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 -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 ColorCorrectionAberrationMode { + ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF = 0, + ANDROID_COLOR_CORRECTION_ABERRATION_MODE_FAST = 1, + ANDROID_COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ColorCorrectionMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ColorCorrectionMode.aidl new file mode 100644 index 0000000000..219c802bb8 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ColorCorrectionMode.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. + *//* + * 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 -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 ColorCorrectionMode { + ANDROID_COLOR_CORRECTION_MODE_TRANSFORM_MATRIX = 0, + ANDROID_COLOR_CORRECTION_MODE_FAST = 1, + ANDROID_COLOR_CORRECTION_MODE_HIGH_QUALITY = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl new file mode 100644 index 0000000000..84fd718c53 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeAntibandingMode.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. + *//* + * 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 -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 ControlAeAntibandingMode { + ANDROID_CONTROL_AE_ANTIBANDING_MODE_OFF = 0, + ANDROID_CONTROL_AE_ANTIBANDING_MODE_50HZ = 1, + ANDROID_CONTROL_AE_ANTIBANDING_MODE_60HZ = 2, + ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO = 3, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeLock.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeLock.aidl new file mode 100644 index 0000000000..f825f112a1 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeLock.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 -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 ControlAeLock { + ANDROID_CONTROL_AE_LOCK_OFF = 0, + ANDROID_CONTROL_AE_LOCK_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeLockAvailable.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeLockAvailable.aidl new file mode 100644 index 0000000000..df7924ed49 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeLockAvailable.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 -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 ControlAeLockAvailable { + ANDROID_CONTROL_AE_LOCK_AVAILABLE_FALSE = 0, + ANDROID_CONTROL_AE_LOCK_AVAILABLE_TRUE = 1, +} 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 new file mode 100644 index 0000000000..75a3486b37 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeMode.aidl @@ -0,0 +1,47 @@ +/* + * 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 -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 ControlAeMode { + ANDROID_CONTROL_AE_MODE_OFF = 0, + ANDROID_CONTROL_AE_MODE_ON = 1, + ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH = 2, + ANDROID_CONTROL_AE_MODE_ON_ALWAYS_FLASH = 3, + ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE = 4, + ANDROID_CONTROL_AE_MODE_ON_EXTERNAL_FLASH = 5, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl new file mode 100644 index 0000000000..4678e01880 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAePrecaptureTrigger.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. + *//* + * 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 -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 ControlAePrecaptureTrigger { + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_IDLE = 0, + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_START = 1, + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeState.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeState.aidl new file mode 100644 index 0000000000..3be64ea802 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeState.aidl @@ -0,0 +1,47 @@ +/* + * 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 -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 ControlAeState { + ANDROID_CONTROL_AE_STATE_INACTIVE = 0, + ANDROID_CONTROL_AE_STATE_SEARCHING = 1, + ANDROID_CONTROL_AE_STATE_CONVERGED = 2, + ANDROID_CONTROL_AE_STATE_LOCKED = 3, + ANDROID_CONTROL_AE_STATE_FLASH_REQUIRED = 4, + ANDROID_CONTROL_AE_STATE_PRECAPTURE = 5, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfMode.aidl new file mode 100644 index 0000000000..155d3c9f92 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfMode.aidl @@ -0,0 +1,47 @@ +/* + * 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 -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 ControlAfMode { + ANDROID_CONTROL_AF_MODE_OFF = 0, + ANDROID_CONTROL_AF_MODE_AUTO = 1, + ANDROID_CONTROL_AF_MODE_MACRO = 2, + ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO = 3, + ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE = 4, + ANDROID_CONTROL_AF_MODE_EDOF = 5, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfSceneChange.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfSceneChange.aidl new file mode 100644 index 0000000000..4b31c84fb2 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfSceneChange.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 -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 ControlAfSceneChange { + ANDROID_CONTROL_AF_SCENE_CHANGE_NOT_DETECTED = 0, + ANDROID_CONTROL_AF_SCENE_CHANGE_DETECTED = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfState.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfState.aidl new file mode 100644 index 0000000000..4aac8c8a9d --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfState.aidl @@ -0,0 +1,48 @@ +/* + * 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 -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 ControlAfState { + ANDROID_CONTROL_AF_STATE_INACTIVE = 0, + ANDROID_CONTROL_AF_STATE_PASSIVE_SCAN = 1, + ANDROID_CONTROL_AF_STATE_PASSIVE_FOCUSED = 2, + ANDROID_CONTROL_AF_STATE_ACTIVE_SCAN = 3, + ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED = 4, + ANDROID_CONTROL_AF_STATE_NOT_FOCUSED_LOCKED = 5, + ANDROID_CONTROL_AF_STATE_PASSIVE_UNFOCUSED = 6, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfTrigger.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfTrigger.aidl new file mode 100644 index 0000000000..3fbf94b724 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAfTrigger.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. + *//* + * 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 -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 ControlAfTrigger { + ANDROID_CONTROL_AF_TRIGGER_IDLE = 0, + ANDROID_CONTROL_AF_TRIGGER_START = 1, + ANDROID_CONTROL_AF_TRIGGER_CANCEL = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbLock.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbLock.aidl new file mode 100644 index 0000000000..0e297a51a3 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbLock.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 -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 ControlAwbLock { + ANDROID_CONTROL_AWB_LOCK_OFF = 0, + ANDROID_CONTROL_AWB_LOCK_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl new file mode 100644 index 0000000000..d471d190bd --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbLockAvailable.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 -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 ControlAwbLockAvailable { + ANDROID_CONTROL_AWB_LOCK_AVAILABLE_FALSE = 0, + ANDROID_CONTROL_AWB_LOCK_AVAILABLE_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbMode.aidl new file mode 100644 index 0000000000..a3463f835f --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbMode.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. + *//* + * 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 -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 ControlAwbMode { + ANDROID_CONTROL_AWB_MODE_OFF = 0, + ANDROID_CONTROL_AWB_MODE_AUTO = 1, + ANDROID_CONTROL_AWB_MODE_INCANDESCENT = 2, + ANDROID_CONTROL_AWB_MODE_FLUORESCENT = 3, + ANDROID_CONTROL_AWB_MODE_WARM_FLUORESCENT = 4, + ANDROID_CONTROL_AWB_MODE_DAYLIGHT = 5, + ANDROID_CONTROL_AWB_MODE_CLOUDY_DAYLIGHT = 6, + ANDROID_CONTROL_AWB_MODE_TWILIGHT = 7, + ANDROID_CONTROL_AWB_MODE_SHADE = 8, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbState.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbState.aidl new file mode 100644 index 0000000000..f1b0e40d2b --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAwbState.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. + *//* + * 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 -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 ControlAwbState { + ANDROID_CONTROL_AWB_STATE_INACTIVE = 0, + ANDROID_CONTROL_AWB_STATE_SEARCHING = 1, + ANDROID_CONTROL_AWB_STATE_CONVERGED = 2, + ANDROID_CONTROL_AWB_STATE_LOCKED = 3, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlCaptureIntent.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlCaptureIntent.aidl new file mode 100644 index 0000000000..283bb1be02 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlCaptureIntent.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. + *//* + * 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 -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 ControlCaptureIntent { + ANDROID_CONTROL_CAPTURE_INTENT_CUSTOM = 0, + ANDROID_CONTROL_CAPTURE_INTENT_PREVIEW = 1, + ANDROID_CONTROL_CAPTURE_INTENT_STILL_CAPTURE = 2, + ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_RECORD = 3, + ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4, + ANDROID_CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG = 5, + ANDROID_CONTROL_CAPTURE_INTENT_MANUAL = 6, + ANDROID_CONTROL_CAPTURE_INTENT_MOTION_TRACKING = 7, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlEffectMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlEffectMode.aidl new file mode 100644 index 0000000000..911223dcf3 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlEffectMode.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. + *//* + * 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 -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 ControlEffectMode { + ANDROID_CONTROL_EFFECT_MODE_OFF = 0, + ANDROID_CONTROL_EFFECT_MODE_MONO = 1, + ANDROID_CONTROL_EFFECT_MODE_NEGATIVE = 2, + ANDROID_CONTROL_EFFECT_MODE_SOLARIZE = 3, + ANDROID_CONTROL_EFFECT_MODE_SEPIA = 4, + ANDROID_CONTROL_EFFECT_MODE_POSTERIZE = 5, + ANDROID_CONTROL_EFFECT_MODE_WHITEBOARD = 6, + ANDROID_CONTROL_EFFECT_MODE_BLACKBOARD = 7, + ANDROID_CONTROL_EFFECT_MODE_AQUA = 8, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlEnableZsl.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlEnableZsl.aidl new file mode 100644 index 0000000000..920def7c20 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlEnableZsl.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 -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 ControlEnableZsl { + ANDROID_CONTROL_ENABLE_ZSL_FALSE = 0, + ANDROID_CONTROL_ENABLE_ZSL_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl new file mode 100644 index 0000000000..2655d6144a --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlExtendedSceneMode.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. + *//* + * 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 -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 ControlExtendedSceneMode { + ANDROID_CONTROL_EXTENDED_SCENE_MODE_DISABLED = 0, + ANDROID_CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE = 1, + ANDROID_CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS = 2, + ANDROID_CONTROL_EXTENDED_SCENE_MODE_VENDOR_START = 64, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlMode.aidl new file mode 100644 index 0000000000..f58491e536 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlMode.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 ControlMode { + ANDROID_CONTROL_MODE_OFF = 0, + ANDROID_CONTROL_MODE_AUTO = 1, + ANDROID_CONTROL_MODE_USE_SCENE_MODE = 2, + ANDROID_CONTROL_MODE_OFF_KEEP_STATE = 3, + ANDROID_CONTROL_MODE_USE_EXTENDED_SCENE_MODE = 4, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlSceneMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlSceneMode.aidl new file mode 100644 index 0000000000..994bbf3aa7 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlSceneMode.aidl @@ -0,0 +1,63 @@ +/* + * 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 -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 ControlSceneMode { + ANDROID_CONTROL_SCENE_MODE_DISABLED = 0, + ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY = 1, + ANDROID_CONTROL_SCENE_MODE_ACTION = 2, + ANDROID_CONTROL_SCENE_MODE_PORTRAIT = 3, + ANDROID_CONTROL_SCENE_MODE_LANDSCAPE = 4, + ANDROID_CONTROL_SCENE_MODE_NIGHT = 5, + ANDROID_CONTROL_SCENE_MODE_NIGHT_PORTRAIT = 6, + ANDROID_CONTROL_SCENE_MODE_THEATRE = 7, + ANDROID_CONTROL_SCENE_MODE_BEACH = 8, + ANDROID_CONTROL_SCENE_MODE_SNOW = 9, + ANDROID_CONTROL_SCENE_MODE_SUNSET = 10, + ANDROID_CONTROL_SCENE_MODE_STEADYPHOTO = 11, + ANDROID_CONTROL_SCENE_MODE_FIREWORKS = 12, + ANDROID_CONTROL_SCENE_MODE_SPORTS = 13, + ANDROID_CONTROL_SCENE_MODE_PARTY = 14, + ANDROID_CONTROL_SCENE_MODE_CANDLELIGHT = 15, + ANDROID_CONTROL_SCENE_MODE_BARCODE = 16, + ANDROID_CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO = 17, + ANDROID_CONTROL_SCENE_MODE_HDR = 18, + ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY_LOW_LIGHT = 19, + ANDROID_CONTROL_SCENE_MODE_DEVICE_CUSTOM_START = 100, + ANDROID_CONTROL_SCENE_MODE_DEVICE_CUSTOM_END = 127, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl new file mode 100644 index 0000000000..b3b24f750b --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlVideoStabilizationMode.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. + *//* + * 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 -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 ControlVideoStabilizationMode { + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF = 0, + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_ON = 1, + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DemosaicMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DemosaicMode.aidl new file mode 100644 index 0000000000..26874a2f85 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DemosaicMode.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 -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 DemosaicMode { + ANDROID_DEMOSAIC_MODE_FAST = 0, + ANDROID_DEMOSAIC_MODE_HIGH_QUALITY = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl new file mode 100644 index 0000000000..6a154ca0c9 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.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 -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 DepthAvailableDepthStreamConfigurations { + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT = 0, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl new file mode 100644 index 0000000000..23d6589a1c --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.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 -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 DepthAvailableDepthStreamConfigurationsMaximumResolution { + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT = 0, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl new file mode 100644 index 0000000000..f3ca03964f --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.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 -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 DepthAvailableDynamicDepthStreamConfigurations { + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_OUTPUT = 0, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl new file mode 100644 index 0000000000..46a4ce61e6 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.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 -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 DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution { + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT = 0, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl new file mode 100644 index 0000000000..f5fc218318 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DepthDepthIsExclusive.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 -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 DepthDepthIsExclusive { + ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE_FALSE = 0, + ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DistortionCorrectionMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DistortionCorrectionMode.aidl new file mode 100644 index 0000000000..46327e0bea --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/DistortionCorrectionMode.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. + *//* + * 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 -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 DistortionCorrectionMode { + ANDROID_DISTORTION_CORRECTION_MODE_OFF = 0, + ANDROID_DISTORTION_CORRECTION_MODE_FAST = 1, + ANDROID_DISTORTION_CORRECTION_MODE_HIGH_QUALITY = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/EdgeMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/EdgeMode.aidl new file mode 100644 index 0000000000..4b02e194bc --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/EdgeMode.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. + *//* + * 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 -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 EdgeMode { + ANDROID_EDGE_MODE_OFF = 0, + ANDROID_EDGE_MODE_FAST = 1, + ANDROID_EDGE_MODE_HIGH_QUALITY = 2, + ANDROID_EDGE_MODE_ZERO_SHUTTER_LAG = 3, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashInfoAvailable.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashInfoAvailable.aidl new file mode 100644 index 0000000000..10d07a5c96 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashInfoAvailable.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 -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 FlashInfoAvailable { + ANDROID_FLASH_INFO_AVAILABLE_FALSE = 0, + ANDROID_FLASH_INFO_AVAILABLE_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashMode.aidl new file mode 100644 index 0000000000..1ab056067e --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashMode.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. + *//* + * 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 -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 FlashMode { + ANDROID_FLASH_MODE_OFF = 0, + ANDROID_FLASH_MODE_SINGLE = 1, + ANDROID_FLASH_MODE_TORCH = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashState.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashState.aidl new file mode 100644 index 0000000000..a571e6608d --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/FlashState.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 FlashState { + ANDROID_FLASH_STATE_UNAVAILABLE = 0, + ANDROID_FLASH_STATE_CHARGING = 1, + ANDROID_FLASH_STATE_READY = 2, + ANDROID_FLASH_STATE_FIRED = 3, + ANDROID_FLASH_STATE_PARTIAL = 4, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl new file mode 100644 index 0000000000..d92c2db86d --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.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 -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 HeicAvailableHeicStreamConfigurations { + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_OUTPUT = 0, + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl new file mode 100644 index 0000000000..f02cf588bf --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.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 -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 HeicAvailableHeicStreamConfigurationsMaximumResolution { + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT = 0, + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicInfoSupported.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicInfoSupported.aidl new file mode 100644 index 0000000000..ae5a8e784e --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HeicInfoSupported.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 -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 HeicInfoSupported { + ANDROID_HEIC_INFO_SUPPORTED_FALSE = 0, + ANDROID_HEIC_INFO_SUPPORTED_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HotPixelMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HotPixelMode.aidl new file mode 100644 index 0000000000..1248c6040f --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/HotPixelMode.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. + *//* + * 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 -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 HotPixelMode { + ANDROID_HOT_PIXEL_MODE_OFF = 0, + ANDROID_HOT_PIXEL_MODE_FAST = 1, + ANDROID_HOT_PIXEL_MODE_HIGH_QUALITY = 2, +} 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 new file mode 100644 index 0000000000..1272f27944 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.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. + *//* + * 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 -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 InfoSupportedBufferManagementVersion { + ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_AIDL_DEVICE = 0, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl new file mode 100644 index 0000000000..8ae39b0984 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 InfoSupportedHardwareLevel { + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY = 2, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_3 = 3, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL = 4, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LedAvailableLeds.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LedAvailableLeds.aidl new file mode 100644 index 0000000000..da558d2056 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LedAvailableLeds.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. + *//* + * 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 -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 LedAvailableLeds { + ANDROID_LED_AVAILABLE_LEDS_TRANSMIT = 0, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LedTransmit.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LedTransmit.aidl new file mode 100644 index 0000000000..658b3cd3b2 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LedTransmit.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 -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 LedTransmit { + ANDROID_LED_TRANSMIT_OFF = 0, + ANDROID_LED_TRANSMIT_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensFacing.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensFacing.aidl new file mode 100644 index 0000000000..4db987bc67 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensFacing.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. + *//* + * 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 -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 LensFacing { + ANDROID_LENS_FACING_FRONT = 0, + ANDROID_LENS_FACING_BACK = 1, + ANDROID_LENS_FACING_EXTERNAL = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl new file mode 100644 index 0000000000..d83d67f103 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.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. + *//* + * 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 -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 LensInfoFocusDistanceCalibration { + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED = 0, + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE = 1, + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl new file mode 100644 index 0000000000..f2f039c39a --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensOpticalStabilizationMode.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 -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 LensOpticalStabilizationMode { + ANDROID_LENS_OPTICAL_STABILIZATION_MODE_OFF = 0, + ANDROID_LENS_OPTICAL_STABILIZATION_MODE_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensPoseReference.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensPoseReference.aidl new file mode 100644 index 0000000000..275d77ba0c --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensPoseReference.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. + *//* + * 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 -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 LensPoseReference { + ANDROID_LENS_POSE_REFERENCE_PRIMARY_CAMERA = 0, + ANDROID_LENS_POSE_REFERENCE_GYROSCOPE = 1, + ANDROID_LENS_POSE_REFERENCE_UNDEFINED = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensState.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensState.aidl new file mode 100644 index 0000000000..4b15b0fe20 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensState.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 -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 LensState { + ANDROID_LENS_STATE_STATIONARY = 0, + ANDROID_LENS_STATE_MOVING = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl new file mode 100644 index 0000000000..224a7fab64 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.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 -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 LogicalMultiCameraSensorSyncType { + ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE = 0, + ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/NoiseReductionMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/NoiseReductionMode.aidl new file mode 100644 index 0000000000..ed0ebc164a --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/NoiseReductionMode.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 NoiseReductionMode { + ANDROID_NOISE_REDUCTION_MODE_OFF = 0, + ANDROID_NOISE_REDUCTION_MODE_FAST = 1, + ANDROID_NOISE_REDUCTION_MODE_HIGH_QUALITY = 2, + ANDROID_NOISE_REDUCTION_MODE_MINIMAL = 3, + ANDROID_NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG = 4, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/QuirksPartialResult.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/QuirksPartialResult.aidl new file mode 100644 index 0000000000..d217fe8055 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/QuirksPartialResult.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 -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 QuirksPartialResult { + ANDROID_QUIRKS_PARTIAL_RESULT_FINAL = 0, + ANDROID_QUIRKS_PARTIAL_RESULT_PARTIAL = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl new file mode 100644 index 0000000000..4462936468 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl @@ -0,0 +1,60 @@ +/* + * 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 -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 RequestAvailableCapabilities { + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE = 0, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 1, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW = 3, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING = 4, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS = 5, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE = 6, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING = 7, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT = 8, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO = 9, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING = 10, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA = 11, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME = 12, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA = 13, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA = 14, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_OFFLINE_PROCESSING = 15, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR = 16, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_REMOSAIC_REPROCESSING = 17, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT = 18, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl new file mode 100644 index 0000000000..cec4ac16ab --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.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. + *//* + * 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 -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 RequestAvailableDynamicRangeProfilesMap { + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD = 1, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10 = 2, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10 = 4, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS = 8, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF = 16, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO = 32, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM = 64, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO = 128, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF = 256, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO = 512, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM = 1024, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO = 2048, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_MAX = 4096, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestMetadataMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestMetadataMode.aidl new file mode 100644 index 0000000000..90fba00fe0 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestMetadataMode.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 -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 RequestMetadataMode { + ANDROID_REQUEST_METADATA_MODE_NONE = 0, + ANDROID_REQUEST_METADATA_MODE_FULL = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestType.aidl new file mode 100644 index 0000000000..4f38cfbb4d --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestType.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 -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 RequestType { + ANDROID_REQUEST_TYPE_CAPTURE = 0, + ANDROID_REQUEST_TYPE_REPROCESS = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableFormats.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableFormats.aidl new file mode 100644 index 0000000000..41fd2c2340 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableFormats.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. + *//* + * 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 -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 ScalerAvailableFormats { + ANDROID_SCALER_AVAILABLE_FORMATS_RAW16 = 32, + ANDROID_SCALER_AVAILABLE_FORMATS_RAW_OPAQUE = 36, + ANDROID_SCALER_AVAILABLE_FORMATS_YV12 = 842094169, + ANDROID_SCALER_AVAILABLE_FORMATS_YCrCb_420_SP = 17, + ANDROID_SCALER_AVAILABLE_FORMATS_IMPLEMENTATION_DEFINED = 34, + ANDROID_SCALER_AVAILABLE_FORMATS_YCbCr_420_888 = 35, + ANDROID_SCALER_AVAILABLE_FORMATS_BLOB = 33, + ANDROID_SCALER_AVAILABLE_FORMATS_RAW10 = 37, + ANDROID_SCALER_AVAILABLE_FORMATS_RAW12 = 38, + ANDROID_SCALER_AVAILABLE_FORMATS_Y8 = 538982489, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl new file mode 100644 index 0000000000..85daa85849 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.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. + *//* + * 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 -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 ScalerAvailableRecommendedStreamConfigurations { + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PREVIEW = 0, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RECORD = 1, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VIDEO_SNAPSHOT = 2, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_SNAPSHOT = 3, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_ZSL = 4, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RAW = 5, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_LOW_LATENCY_SNAPSHOT = 6, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_10BIT_OUTPUT = 8, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VENDOR_START = 24, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl new file mode 100644 index 0000000000..1515ad5552 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.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 -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 ScalerAvailableStreamConfigurations { + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT = 0, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl new file mode 100644 index 0000000000..b9c3374e90 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.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 -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 ScalerAvailableStreamConfigurationsMaximumResolution { + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT = 0, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerCroppingType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerCroppingType.aidl new file mode 100644 index 0000000000..0487196937 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerCroppingType.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 -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 ScalerCroppingType { + ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY = 0, + ANDROID_SCALER_CROPPING_TYPE_FREEFORM = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl new file mode 100644 index 0000000000..711243f58c --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.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 -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 ScalerMultiResolutionStreamSupported { + ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED_FALSE = 0, + ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl new file mode 100644 index 0000000000..50bc09780e --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.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 -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 ScalerPhysicalCameraMultiResolutionStreamConfigurations { + ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS_OUTPUT = 0, + ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl new file mode 100644 index 0000000000..3b9c5b8ef9 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 ScalerRotateAndCrop { + ANDROID_SCALER_ROTATE_AND_CROP_NONE = 0, + ANDROID_SCALER_ROTATE_AND_CROP_90 = 1, + ANDROID_SCALER_ROTATE_AND_CROP_180 = 2, + ANDROID_SCALER_ROTATE_AND_CROP_270 = 3, + ANDROID_SCALER_ROTATE_AND_CROP_AUTO = 4, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl new file mode 100644 index 0000000000..3400233f0c --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl @@ -0,0 +1,48 @@ +/* + * 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 -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 SensorInfoColorFilterArrangement { + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB = 0, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG = 1, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG = 2, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR = 3, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB = 4, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO = 5, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR = 6, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl new file mode 100644 index 0000000000..c8faaee8bc --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoLensShadingApplied.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 -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 SensorInfoLensShadingApplied { + ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED_FALSE = 0, + ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl new file mode 100644 index 0000000000..2a4b3dd08b --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorInfoTimestampSource.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 -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 SensorInfoTimestampSource { + ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN = 0, + ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorPixelMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorPixelMode.aidl new file mode 100644 index 0000000000..e0214341cf --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorPixelMode.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 -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 SensorPixelMode { + ANDROID_SENSOR_PIXEL_MODE_DEFAULT = 0, + ANDROID_SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl new file mode 100644 index 0000000000..a1f0c5fed5 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorRawBinningFactorUsed.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 -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 SensorRawBinningFactorUsed { + ANDROID_SENSOR_RAW_BINNING_FACTOR_USED_TRUE = 0, + ANDROID_SENSOR_RAW_BINNING_FACTOR_USED_FALSE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl new file mode 100644 index 0000000000..cd22d2e35d --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl @@ -0,0 +1,60 @@ +/* + * 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 -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 SensorReferenceIlluminant1 { + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT = 1, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT = 2, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN = 3, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FLASH = 4, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER = 9, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER = 10, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_SHADE = 11, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT = 12, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT = 13, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT = 14, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT = 15, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A = 17, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B = 18, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C = 19, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D55 = 20, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D65 = 21, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D75 = 22, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D50 = 23, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN = 24, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorTestPatternMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorTestPatternMode.aidl new file mode 100644 index 0000000000..d013bf431e --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorTestPatternMode.aidl @@ -0,0 +1,48 @@ +/* + * 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 -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 SensorTestPatternMode { + ANDROID_SENSOR_TEST_PATTERN_MODE_OFF = 0, + ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR = 1, + ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS = 2, + ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY = 3, + ANDROID_SENSOR_TEST_PATTERN_MODE_PN9 = 4, + ANDROID_SENSOR_TEST_PATTERN_MODE_CUSTOM1 = 256, + ANDROID_SENSOR_TEST_PATTERN_MODE_BLACK = 257, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ShadingMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ShadingMode.aidl new file mode 100644 index 0000000000..a2d2a320fc --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ShadingMode.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. + *//* + * 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 -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 ShadingMode { + ANDROID_SHADING_MODE_OFF = 0, + ANDROID_SHADING_MODE_FAST = 1, + ANDROID_SHADING_MODE_HIGH_QUALITY = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl new file mode 100644 index 0000000000..1c65f990be --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsFaceDetectMode.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. + *//* + * 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 -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 StatisticsFaceDetectMode { + ANDROID_STATISTICS_FACE_DETECT_MODE_OFF = 0, + ANDROID_STATISTICS_FACE_DETECT_MODE_SIMPLE = 1, + ANDROID_STATISTICS_FACE_DETECT_MODE_FULL = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsHistogramMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsHistogramMode.aidl new file mode 100644 index 0000000000..39a013e32f --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsHistogramMode.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 -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 StatisticsHistogramMode { + ANDROID_STATISTICS_HISTOGRAM_MODE_OFF = 0, + ANDROID_STATISTICS_HISTOGRAM_MODE_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl new file mode 100644 index 0000000000..3a8c6c2a03 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsHotPixelMapMode.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 -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 StatisticsHotPixelMapMode { + ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE_OFF = 0, + ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl new file mode 100644 index 0000000000..cc280caca6 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsLensShadingMapMode.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 -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 StatisticsLensShadingMapMode { + ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF = 0, + ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsOisDataMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsOisDataMode.aidl new file mode 100644 index 0000000000..6607037cb9 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsOisDataMode.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 -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 StatisticsOisDataMode { + ANDROID_STATISTICS_OIS_DATA_MODE_OFF = 0, + ANDROID_STATISTICS_OIS_DATA_MODE_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl new file mode 100644 index 0000000000..bc286c36cd --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsSceneFlicker.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. + *//* + * 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 -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 StatisticsSceneFlicker { + ANDROID_STATISTICS_SCENE_FLICKER_NONE = 0, + ANDROID_STATISTICS_SCENE_FLICKER_50HZ = 1, + ANDROID_STATISTICS_SCENE_FLICKER_60HZ = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl new file mode 100644 index 0000000000..774a43a76d --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/StatisticsSharpnessMapMode.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 -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 StatisticsSharpnessMapMode { + ANDROID_STATISTICS_SHARPNESS_MAP_MODE_OFF = 0, + ANDROID_STATISTICS_SHARPNESS_MAP_MODE_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SyncFrameNumber.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SyncFrameNumber.aidl new file mode 100644 index 0000000000..12ccbb9479 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SyncFrameNumber.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 -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 SyncFrameNumber { + ANDROID_SYNC_FRAME_NUMBER_CONVERGING = -1, + ANDROID_SYNC_FRAME_NUMBER_UNKNOWN = -2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SyncMaxLatency.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SyncMaxLatency.aidl new file mode 100644 index 0000000000..e0116e7117 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SyncMaxLatency.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 -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 SyncMaxLatency { + ANDROID_SYNC_MAX_LATENCY_PER_FRAME_CONTROL = 0, + ANDROID_SYNC_MAX_LATENCY_UNKNOWN = -1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/TonemapMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/TonemapMode.aidl new file mode 100644 index 0000000000..728b2987ee --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/TonemapMode.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 TonemapMode { + ANDROID_TONEMAP_MODE_CONTRAST_CURVE = 0, + ANDROID_TONEMAP_MODE_FAST = 1, + ANDROID_TONEMAP_MODE_HIGH_QUALITY = 2, + ANDROID_TONEMAP_MODE_GAMMA_VALUE = 3, + ANDROID_TONEMAP_MODE_PRESET_CURVE = 4, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/TonemapPresetCurve.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/TonemapPresetCurve.aidl new file mode 100644 index 0000000000..fc2e39bc3e --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/TonemapPresetCurve.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 -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 TonemapPresetCurve { + ANDROID_TONEMAP_PRESET_CURVE_SRGB = 0, + ANDROID_TONEMAP_PRESET_CURVE_REC709 = 1, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/BlackLevelLock.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/BlackLevelLock.aidl new file mode 100644 index 0000000000..4746cf3e4d --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/BlackLevelLock.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.blackLevel.lock enumeration values + * @see ANDROID_BLACK_LEVEL_LOCK + */ +@VintfStability +@Backing(type="int") +enum BlackLevelLock { + ANDROID_BLACK_LEVEL_LOCK_OFF, + ANDROID_BLACK_LEVEL_LOCK_ON, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl new file mode 100644 index 0000000000..cc3d3b38ce --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl @@ -0,0 +1,63 @@ +/* + * 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; + +/** + * Top level hierarchy definitions for camera metadata. *_INFO sections are for + * the static metadata that can be retrieved without opening the camera device. + */ +@VintfStability +@Backing(type="int") +enum CameraMetadataSection { + ANDROID_COLOR_CORRECTION, + ANDROID_CONTROL, + ANDROID_DEMOSAIC, + ANDROID_EDGE, + ANDROID_FLASH, + ANDROID_FLASH_INFO, + ANDROID_HOT_PIXEL, + ANDROID_JPEG, + ANDROID_LENS, + ANDROID_LENS_INFO, + ANDROID_NOISE_REDUCTION, + ANDROID_QUIRKS, + ANDROID_REQUEST, + ANDROID_SCALER, + ANDROID_SENSOR, + ANDROID_SENSOR_INFO, + ANDROID_SHADING, + ANDROID_STATISTICS, + ANDROID_STATISTICS_INFO, + ANDROID_TONEMAP, + ANDROID_LED, + ANDROID_INFO, + ANDROID_BLACK_LEVEL, + ANDROID_SYNC, + ANDROID_REPROCESS, + ANDROID_DEPTH, + ANDROID_LOGICAL_MULTI_CAMERA, + ANDROID_DISTORTION_CORRECTION, + ANDROID_HEIC, + ANDROID_HEIC_INFO, + VENDOR_SECTION = 0x8000, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl new file mode 100644 index 0000000000..d5cd0b4b5d --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl @@ -0,0 +1,66 @@ +/* + * 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; + +import android.hardware.camera.metadata.CameraMetadataSection; + +/** + * Hierarchy positions in enum space. All vendor extension sections must be + * defined with tag >= VENDOR_SECTION_START + */ +@VintfStability +@Backing(type="int") +enum CameraMetadataSectionStart { + ANDROID_COLOR_CORRECTION_START = CameraMetadataSection.ANDROID_COLOR_CORRECTION << 16, + ANDROID_CONTROL_START = CameraMetadataSection.ANDROID_CONTROL << 16, + ANDROID_DEMOSAIC_START = CameraMetadataSection.ANDROID_DEMOSAIC << 16, + ANDROID_EDGE_START = CameraMetadataSection.ANDROID_EDGE << 16, + ANDROID_FLASH_START = CameraMetadataSection.ANDROID_FLASH << 16, + ANDROID_FLASH_INFO_START = CameraMetadataSection.ANDROID_FLASH_INFO << 16, + ANDROID_HOT_PIXEL_START = CameraMetadataSection.ANDROID_HOT_PIXEL << 16, + ANDROID_JPEG_START = CameraMetadataSection.ANDROID_JPEG << 16, + ANDROID_LENS_START = CameraMetadataSection.ANDROID_LENS << 16, + ANDROID_LENS_INFO_START = CameraMetadataSection.ANDROID_LENS_INFO << 16, + ANDROID_NOISE_REDUCTION_START = CameraMetadataSection.ANDROID_NOISE_REDUCTION << 16, + ANDROID_QUIRKS_START = CameraMetadataSection.ANDROID_QUIRKS << 16, + ANDROID_REQUEST_START = CameraMetadataSection.ANDROID_REQUEST << 16, + ANDROID_SCALER_START = CameraMetadataSection.ANDROID_SCALER << 16, + ANDROID_SENSOR_START = CameraMetadataSection.ANDROID_SENSOR << 16, + ANDROID_SENSOR_INFO_START = CameraMetadataSection.ANDROID_SENSOR_INFO << 16, + ANDROID_SHADING_START = CameraMetadataSection.ANDROID_SHADING << 16, + ANDROID_STATISTICS_START = CameraMetadataSection.ANDROID_STATISTICS << 16, + ANDROID_STATISTICS_INFO_START = CameraMetadataSection.ANDROID_STATISTICS_INFO << 16, + ANDROID_TONEMAP_START = CameraMetadataSection.ANDROID_TONEMAP << 16, + ANDROID_LED_START = CameraMetadataSection.ANDROID_LED << 16, + ANDROID_INFO_START = CameraMetadataSection.ANDROID_INFO << 16, + ANDROID_BLACK_LEVEL_START = CameraMetadataSection.ANDROID_BLACK_LEVEL << 16, + ANDROID_SYNC_START = CameraMetadataSection.ANDROID_SYNC << 16, + ANDROID_REPROCESS_START = CameraMetadataSection.ANDROID_REPROCESS << 16, + ANDROID_DEPTH_START = CameraMetadataSection.ANDROID_DEPTH << 16, + VENDOR_SECTION_START = CameraMetadataSection.VENDOR_SECTION << 16, + ANDROID_LOGICAL_MULTI_CAMERA_START = CameraMetadataSection.ANDROID_LOGICAL_MULTI_CAMERA << 16, + ANDROID_DISTORTION_CORRECTION_START = CameraMetadataSection.ANDROID_DISTORTION_CORRECTION << 16, + ANDROID_HEIC_START = CameraMetadataSection.ANDROID_HEIC << 16, + ANDROID_HEIC_INFO_START = CameraMetadataSection.ANDROID_HEIC_INFO << 16, + VENDOR_SECTION_START = CameraMetadataSection.VENDOR_SECTION << 16, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl new file mode 100644 index 0000000000..fb7ca1241d --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl @@ -0,0 +1,2229 @@ +/* + * 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; + +import android.hardware.camera.metadata.CameraMetadataSectionStart; + +/** + * Main enumeration for defining camera metadata tags added in this revision + * + *

Partial documentation is included for each tag; for complete documentation, reference + * '/system/media/camera/docs/docs.html' in the corresponding Android source tree.

+ */ +@VintfStability +@Backing(type="int") +enum CameraMetadataTag { + /** + * android.colorCorrection.mode [dynamic, enum, public] + * + *

The mode control selects how the image data is converted from the + * sensor's native color into linear sRGB color.

+ */ + ANDROID_COLOR_CORRECTION_MODE = CameraMetadataSectionStart.ANDROID_COLOR_CORRECTION_START, + /** + * android.colorCorrection.transform [dynamic, rational[], public] + * + *

A color transform matrix to use to transform + * from sensor RGB color space to output linear sRGB color space.

+ */ + ANDROID_COLOR_CORRECTION_TRANSFORM, + /** + * android.colorCorrection.gains [dynamic, float[], public] + * + *

Gains applying to Bayer raw color channels for + * white-balance.

+ */ + ANDROID_COLOR_CORRECTION_GAINS, + /** + * android.colorCorrection.aberrationMode [dynamic, enum, public] + * + *

Mode of operation for the chromatic aberration correction algorithm.

+ */ + ANDROID_COLOR_CORRECTION_ABERRATION_MODE, + /** + * android.colorCorrection.availableAberrationModes [static, byte[], public] + * + *

List of aberration correction modes for ANDROID_COLOR_CORRECTION_ABERRATION_MODE that are + * supported by this camera device.

+ * + * @see ANDROID_COLOR_CORRECTION_ABERRATION_MODE + */ + ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES, + /** + * android.control.aeAntibandingMode [dynamic, enum, public] + * + *

The desired setting for the camera device's auto-exposure + * algorithm's antibanding compensation.

+ */ + ANDROID_CONTROL_AE_ANTIBANDING_MODE = CameraMetadataSectionStart.ANDROID_CONTROL_START, + /** + * android.control.aeExposureCompensation [dynamic, int32, public] + * + *

Adjustment to auto-exposure (AE) target image + * brightness.

+ */ + ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION, + /** + * android.control.aeLock [dynamic, enum, public] + * + *

Whether auto-exposure (AE) is currently locked to its latest + * calculated values.

+ */ + ANDROID_CONTROL_AE_LOCK, + /** + * android.control.aeMode [dynamic, enum, public] + * + *

The desired mode for the camera device's + * auto-exposure routine.

+ */ + ANDROID_CONTROL_AE_MODE, + /** + * android.control.aeRegions [dynamic, int32[], public] + * + *

List of metering areas to use for auto-exposure adjustment.

+ */ + ANDROID_CONTROL_AE_REGIONS, + /** + * android.control.aeTargetFpsRange [dynamic, int32[], public] + * + *

Range over which the auto-exposure routine can + * adjust the capture frame rate to maintain good + * exposure.

+ */ + ANDROID_CONTROL_AE_TARGET_FPS_RANGE, + /** + * android.control.aePrecaptureTrigger [dynamic, enum, public] + * + *

Whether the camera device will trigger a precapture + * metering sequence when it processes this request.

+ */ + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER, + /** + * android.control.afMode [dynamic, enum, public] + * + *

Whether auto-focus (AF) is currently enabled, and what + * mode it is set to.

+ */ + ANDROID_CONTROL_AF_MODE, + /** + * android.control.afRegions [dynamic, int32[], public] + * + *

List of metering areas to use for auto-focus.

+ */ + ANDROID_CONTROL_AF_REGIONS, + /** + * android.control.afTrigger [dynamic, enum, public] + * + *

Whether the camera device will trigger autofocus for this request.

+ */ + ANDROID_CONTROL_AF_TRIGGER, + /** + * android.control.awbLock [dynamic, enum, public] + * + *

Whether auto-white balance (AWB) is currently locked to its + * latest calculated values.

+ */ + ANDROID_CONTROL_AWB_LOCK, + /** + * android.control.awbMode [dynamic, enum, public] + * + *

Whether auto-white balance (AWB) is currently setting the color + * transform fields, and what its illumination target + * is.

+ */ + ANDROID_CONTROL_AWB_MODE, + /** + * android.control.awbRegions [dynamic, int32[], public] + * + *

List of metering areas to use for auto-white-balance illuminant + * estimation.

+ */ + ANDROID_CONTROL_AWB_REGIONS, + /** + * android.control.captureIntent [dynamic, enum, public] + * + *

Information to the camera device 3A (auto-exposure, + * auto-focus, auto-white balance) routines about the purpose + * of this capture, to help the camera device to decide optimal 3A + * strategy.

+ */ + ANDROID_CONTROL_CAPTURE_INTENT, + /** + * android.control.effectMode [dynamic, enum, public] + * + *

A special color effect to apply.

+ */ + ANDROID_CONTROL_EFFECT_MODE, + /** + * android.control.mode [dynamic, enum, public] + * + *

Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control + * routines.

+ */ + ANDROID_CONTROL_MODE, + /** + * android.control.sceneMode [dynamic, enum, public] + * + *

Control for which scene mode is currently active.

+ */ + ANDROID_CONTROL_SCENE_MODE, + /** + * android.control.videoStabilizationMode [dynamic, enum, public] + * + *

Whether video stabilization is + * active.

+ */ + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, + /** + * android.control.aeAvailableAntibandingModes [static, byte[], public] + * + *

List of auto-exposure antibanding modes for ANDROID_CONTROL_AE_ANTIBANDING_MODE that are + * supported by this camera device.

+ * + * @see ANDROID_CONTROL_AE_ANTIBANDING_MODE + */ + ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES, + /** + * android.control.aeAvailableModes [static, byte[], public] + * + *

List of auto-exposure modes for ANDROID_CONTROL_AE_MODE that are supported by this camera + * device.

+ * + * @see ANDROID_CONTROL_AE_MODE + */ + ANDROID_CONTROL_AE_AVAILABLE_MODES, + /** + * android.control.aeAvailableTargetFpsRanges [static, int32[], public] + * + *

List of frame rate ranges for ANDROID_CONTROL_AE_TARGET_FPS_RANGE supported by + * this camera device.

+ * + * @see ANDROID_CONTROL_AE_TARGET_FPS_RANGE + */ + ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES, + /** + * android.control.aeCompensationRange [static, int32[], public] + * + *

Maximum and minimum exposure compensation values for + * ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION, in counts of ANDROID_CONTROL_AE_COMPENSATION_STEP, + * that are supported by this camera device.

+ * + * @see ANDROID_CONTROL_AE_COMPENSATION_STEP + * @see ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION + */ + ANDROID_CONTROL_AE_COMPENSATION_RANGE, + /** + * android.control.aeCompensationStep [static, rational, public] + * + *

Smallest step by which the exposure compensation + * can be changed.

+ */ + ANDROID_CONTROL_AE_COMPENSATION_STEP, + /** + * android.control.afAvailableModes [static, byte[], public] + * + *

List of auto-focus (AF) modes for ANDROID_CONTROL_AF_MODE that are + * supported by this camera device.

+ * + * @see ANDROID_CONTROL_AF_MODE + */ + ANDROID_CONTROL_AF_AVAILABLE_MODES, + /** + * android.control.availableEffects [static, byte[], public] + * + *

List of color effects for ANDROID_CONTROL_EFFECT_MODE that are supported by this camera + * device.

+ * + * @see ANDROID_CONTROL_EFFECT_MODE + */ + ANDROID_CONTROL_AVAILABLE_EFFECTS, + /** + * android.control.availableSceneModes [static, byte[], public] + * + *

List of scene modes for ANDROID_CONTROL_SCENE_MODE that are supported by this camera + * device.

+ * + * @see ANDROID_CONTROL_SCENE_MODE + */ + ANDROID_CONTROL_AVAILABLE_SCENE_MODES, + /** + * android.control.availableVideoStabilizationModes [static, byte[], public] + * + *

List of video stabilization modes for ANDROID_CONTROL_VIDEO_STABILIZATION_MODE + * that are supported by this camera device.

+ * + * @see ANDROID_CONTROL_VIDEO_STABILIZATION_MODE + */ + ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES, + /** + * android.control.awbAvailableModes [static, byte[], public] + * + *

List of auto-white-balance modes for ANDROID_CONTROL_AWB_MODE that are supported by this + * camera device.

+ * + * @see ANDROID_CONTROL_AWB_MODE + */ + ANDROID_CONTROL_AWB_AVAILABLE_MODES, + /** + * android.control.maxRegions [static, int32[], ndk_public] + * + *

List of the maximum number of regions that can be used for metering in + * auto-exposure (AE), auto-white balance (AWB), and auto-focus (AF); + * this corresponds to the maximum number of elements in + * ANDROID_CONTROL_AE_REGIONS, ANDROID_CONTROL_AWB_REGIONS, + * and ANDROID_CONTROL_AF_REGIONS.

+ * + * @see ANDROID_CONTROL_AE_REGIONS + * @see ANDROID_CONTROL_AF_REGIONS + * @see ANDROID_CONTROL_AWB_REGIONS + */ + ANDROID_CONTROL_MAX_REGIONS, + /** + * android.control.sceneModeOverrides [static, byte[], system] + * + *

Ordered list of auto-exposure, auto-white balance, and auto-focus + * settings to use with each available scene mode.

+ */ + ANDROID_CONTROL_SCENE_MODE_OVERRIDES, + /** + * android.control.aePrecaptureId [dynamic, int32, system] + * + *

The ID sent with the latest + * CAMERA2_TRIGGER_PRECAPTURE_METERING call

+ */ + ANDROID_CONTROL_AE_PRECAPTURE_ID, + /** + * android.control.aeState [dynamic, enum, public] + * + *

Current state of the auto-exposure (AE) algorithm.

+ */ + ANDROID_CONTROL_AE_STATE, + /** + * android.control.afState [dynamic, enum, public] + * + *

Current state of auto-focus (AF) algorithm.

+ */ + ANDROID_CONTROL_AF_STATE, + /** + * android.control.afTriggerId [dynamic, int32, system] + * + *

The ID sent with the latest + * CAMERA2_TRIGGER_AUTOFOCUS call

+ */ + ANDROID_CONTROL_AF_TRIGGER_ID, + /** + * android.control.awbState [dynamic, enum, public] + * + *

Current state of auto-white balance (AWB) algorithm.

+ */ + ANDROID_CONTROL_AWB_STATE, + /** + * android.control.availableHighSpeedVideoConfigurations [static, int32[], hidden] + * + *

List of available high speed video size, fps range and max batch size configurations + * supported by the camera device, in the format of (width, height, fps_min, fps_max, batch_size_max).

+ */ + ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS, + /** + * android.control.aeLockAvailable [static, enum, public] + * + *

Whether the camera device supports ANDROID_CONTROL_AE_LOCK

+ * + * @see ANDROID_CONTROL_AE_LOCK + */ + ANDROID_CONTROL_AE_LOCK_AVAILABLE, + /** + * android.control.awbLockAvailable [static, enum, public] + * + *

Whether the camera device supports ANDROID_CONTROL_AWB_LOCK

+ * + * @see ANDROID_CONTROL_AWB_LOCK + */ + ANDROID_CONTROL_AWB_LOCK_AVAILABLE, + /** + * android.control.availableModes [static, byte[], public] + * + *

List of control modes for ANDROID_CONTROL_MODE that are supported by this camera + * device.

+ * + * @see ANDROID_CONTROL_MODE + */ + ANDROID_CONTROL_AVAILABLE_MODES, + /** + * android.control.postRawSensitivityBoostRange [static, int32[], public] + * + *

Range of boosts for ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST supported + * by this camera device.

+ * + * @see ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST + */ + ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE, + /** + * android.control.postRawSensitivityBoost [dynamic, int32, public] + * + *

The amount of additional sensitivity boost applied to output images + * after RAW sensor data is captured.

+ */ + ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST, + /** + * android.control.enableZsl [dynamic, enum, public] + * + *

Allow camera device to enable zero-shutter-lag mode for requests with + * ANDROID_CONTROL_CAPTURE_INTENT == STILL_CAPTURE.

+ * + * @see ANDROID_CONTROL_CAPTURE_INTENT + */ + ANDROID_CONTROL_ENABLE_ZSL, + /** + * android.control.afSceneChange [dynamic, enum, public] + * + *

Whether a significant scene change is detected within the currently-set AF + * region(s).

+ */ + ANDROID_CONTROL_AF_SCENE_CHANGE, + /** + * android.control.availableExtendedSceneModeMaxSizes [static, int32[], ndk_public] + * + *

The list of extended scene modes for ANDROID_CONTROL_EXTENDED_SCENE_MODE that are supported + * by this camera device, and each extended scene mode's maximum streaming (non-stall) size + * with effect.

+ * + * @see ANDROID_CONTROL_EXTENDED_SCENE_MODE + */ + ANDROID_CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_MAX_SIZES, + /** + * android.control.availableExtendedSceneModeZoomRatioRanges [static, float[], ndk_public] + * + *

The ranges of supported zoom ratio for non-DISABLED ANDROID_CONTROL_EXTENDED_SCENE_MODE.

+ * + * @see ANDROID_CONTROL_EXTENDED_SCENE_MODE + */ + ANDROID_CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_ZOOM_RATIO_RANGES, + /** + * android.control.extendedSceneMode [dynamic, enum, public] + * + *

Whether extended scene mode is enabled for a particular capture request.

+ */ + ANDROID_CONTROL_EXTENDED_SCENE_MODE, + /** + * android.control.zoomRatioRange [static, float[], public] + * + *

Minimum and maximum zoom ratios supported by this camera device.

+ */ + ANDROID_CONTROL_ZOOM_RATIO_RANGE, + /** + * android.control.zoomRatio [dynamic, float, public] + * + *

The desired zoom ratio

+ */ + ANDROID_CONTROL_ZOOM_RATIO, + /** + * android.control.availableHighSpeedVideoConfigurationsMaximumResolution [static, int32[], hidden] + * + *

List of available high speed video size, fps range and max batch size configurations + * supported by the camera device, in the format of + * (width, height, fps_min, fps_max, batch_size_max), + * when ANDROID_SENSOR_PIXEL_MODE is set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS_MAXIMUM_RESOLUTION, + /** + * android.demosaic.mode [controls, enum, system] + * + *

Controls the quality of the demosaicing + * processing.

+ */ + ANDROID_DEMOSAIC_MODE = CameraMetadataSectionStart.ANDROID_DEMOSAIC_START, + /** + * android.edge.mode [dynamic, enum, public] + * + *

Operation mode for edge + * enhancement.

+ */ + ANDROID_EDGE_MODE = CameraMetadataSectionStart.ANDROID_EDGE_START, + /** + * android.edge.strength [controls, byte, system] + * + *

Control the amount of edge enhancement + * applied to the images

+ */ + ANDROID_EDGE_STRENGTH, + /** + * android.edge.availableEdgeModes [static, byte[], public] + * + *

List of edge enhancement modes for ANDROID_EDGE_MODE that are supported by this camera + * device.

+ * + * @see ANDROID_EDGE_MODE + */ + ANDROID_EDGE_AVAILABLE_EDGE_MODES, + /** + * android.flash.firingPower [dynamic, byte, system] + * + *

Power for flash firing/torch

+ */ + ANDROID_FLASH_FIRING_POWER = CameraMetadataSectionStart.ANDROID_FLASH_START, + /** + * android.flash.firingTime [dynamic, int64, system] + * + *

Firing time of flash relative to start of + * exposure

+ */ + ANDROID_FLASH_FIRING_TIME, + /** + * android.flash.mode [dynamic, enum, public] + * + *

The desired mode for for the camera device's flash control.

+ */ + ANDROID_FLASH_MODE, + /** + * android.flash.colorTemperature [static, byte, system] + * + *

The x,y whitepoint of the + * flash

+ */ + ANDROID_FLASH_COLOR_TEMPERATURE, + /** + * android.flash.maxEnergy [static, byte, system] + * + *

Max energy output of the flash for a full + * power single flash

+ */ + ANDROID_FLASH_MAX_ENERGY, + /** + * android.flash.state [dynamic, enum, public] + * + *

Current state of the flash + * unit.

+ */ + ANDROID_FLASH_STATE, + /** + * android.flash.info.available [static, enum, public] + * + *

Whether this camera device has a + * flash unit.

+ */ + ANDROID_FLASH_INFO_AVAILABLE = CameraMetadataSectionStart.ANDROID_FLASH_INFO_START, + /** + * android.flash.info.chargeDuration [static, int64, system] + * + *

Time taken before flash can fire + * again

+ */ + ANDROID_FLASH_INFO_CHARGE_DURATION, + /** + * android.flash.info.strengthMaximumLevel [static, int32, public] + * + *

Maximum flashlight brightness level.

+ */ + ANDROID_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL, + /** + * android.flash.info.strengthDefaultLevel [static, int32, public] + * + *

Default flashlight brightness level to be set via + * {android.hardware.camera2.CameraManager#turnOnTorchWithStrengthLevel}.

+ */ + ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL, + /** + * android.hotPixel.mode [dynamic, enum, public] + * + *

Operational mode for hot pixel correction.

+ */ + ANDROID_HOT_PIXEL_MODE = CameraMetadataSectionStart.ANDROID_HOT_PIXEL_START, + /** + * android.hotPixel.availableHotPixelModes [static, byte[], public] + * + *

List of hot pixel correction modes for ANDROID_HOT_PIXEL_MODE that are supported by this + * camera device.

+ * + * @see ANDROID_HOT_PIXEL_MODE + */ + ANDROID_HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES, + /** + * android.jpeg.gpsCoordinates [dynamic, double[], ndk_public] + * + *

GPS coordinates to include in output JPEG + * EXIF.

+ */ + ANDROID_JPEG_GPS_COORDINATES = CameraMetadataSectionStart.ANDROID_JPEG_START, + /** + * android.jpeg.gpsProcessingMethod [dynamic, byte, ndk_public] + * + *

32 characters describing GPS algorithm to + * include in EXIF.

+ */ + ANDROID_JPEG_GPS_PROCESSING_METHOD, + /** + * android.jpeg.gpsTimestamp [dynamic, int64, ndk_public] + * + *

Time GPS fix was made to include in + * EXIF.

+ */ + ANDROID_JPEG_GPS_TIMESTAMP, + /** + * android.jpeg.orientation [dynamic, int32, public] + * + *

The orientation for a JPEG image.

+ */ + ANDROID_JPEG_ORIENTATION, + /** + * android.jpeg.quality [dynamic, byte, public] + * + *

Compression quality of the final JPEG + * image.

+ */ + ANDROID_JPEG_QUALITY, + /** + * android.jpeg.thumbnailQuality [dynamic, byte, public] + * + *

Compression quality of JPEG + * thumbnail.

+ */ + ANDROID_JPEG_THUMBNAIL_QUALITY, + /** + * android.jpeg.thumbnailSize [dynamic, int32[], public] + * + *

Resolution of embedded JPEG thumbnail.

+ */ + ANDROID_JPEG_THUMBNAIL_SIZE, + /** + * android.jpeg.availableThumbnailSizes [static, int32[], public] + * + *

List of JPEG thumbnail sizes for ANDROID_JPEG_THUMBNAIL_SIZE supported by this + * camera device.

+ * + * @see ANDROID_JPEG_THUMBNAIL_SIZE + */ + ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES, + /** + * android.jpeg.maxSize [static, int32, system] + * + *

Maximum size in bytes for the compressed + * JPEG buffer, in default sensor pixel mode (see ANDROID_SENSOR_PIXEL_MODE)

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_JPEG_MAX_SIZE, + /** + * android.jpeg.size [dynamic, int32, system] + * + *

The size of the compressed JPEG image, in + * bytes

+ */ + ANDROID_JPEG_SIZE, + /** + * android.lens.aperture [dynamic, float, public] + * + *

The desired lens aperture size, as a ratio of lens focal length to the + * effective aperture diameter.

+ */ + ANDROID_LENS_APERTURE = CameraMetadataSectionStart.ANDROID_LENS_START, + /** + * android.lens.filterDensity [dynamic, float, public] + * + *

The desired setting for the lens neutral density filter(s).

+ */ + ANDROID_LENS_FILTER_DENSITY, + /** + * android.lens.focalLength [dynamic, float, public] + * + *

The desired lens focal length; used for optical zoom.

+ */ + ANDROID_LENS_FOCAL_LENGTH, + /** + * android.lens.focusDistance [dynamic, float, public] + * + *

Desired distance to plane of sharpest focus, + * measured from frontmost surface of the lens.

+ */ + ANDROID_LENS_FOCUS_DISTANCE, + /** + * android.lens.opticalStabilizationMode [dynamic, enum, public] + * + *

Sets whether the camera device uses optical image stabilization (OIS) + * when capturing images.

+ */ + ANDROID_LENS_OPTICAL_STABILIZATION_MODE, + /** + * android.lens.facing [static, enum, public] + * + *

Direction the camera faces relative to + * device screen.

+ */ + ANDROID_LENS_FACING, + /** + * android.lens.poseRotation [dynamic, float[], public] + * + *

The orientation of the camera relative to the sensor + * coordinate system.

+ */ + ANDROID_LENS_POSE_ROTATION, + /** + * android.lens.poseTranslation [dynamic, float[], public] + * + *

Position of the camera optical center.

+ */ + ANDROID_LENS_POSE_TRANSLATION, + /** + * android.lens.focusRange [dynamic, float[], public] + * + *

The range of scene distances that are in + * sharp focus (depth of field).

+ */ + ANDROID_LENS_FOCUS_RANGE, + /** + * android.lens.state [dynamic, enum, public] + * + *

Current lens status.

+ */ + ANDROID_LENS_STATE, + /** + * android.lens.intrinsicCalibration [dynamic, float[], public] + * + *

The parameters for this camera device's intrinsic + * calibration.

+ */ + ANDROID_LENS_INTRINSIC_CALIBRATION, + /** + * android.lens.radialDistortion [dynamic, float[], public] + * + *

The correction coefficients to correct for this camera device's + * radial and tangential lens distortion.

+ */ + ANDROID_LENS_RADIAL_DISTORTION, + /** + * android.lens.poseReference [static, enum, public] + * + *

The origin for ANDROID_LENS_POSE_TRANSLATION, and the accuracy of + * ANDROID_LENS_POSE_TRANSLATION and ANDROID_LENS_POSE_ROTATION.

+ * + * @see ANDROID_LENS_POSE_ROTATION + * @see ANDROID_LENS_POSE_TRANSLATION + */ + ANDROID_LENS_POSE_REFERENCE, + /** + * android.lens.distortion [dynamic, float[], public] + * + *

The correction coefficients to correct for this camera device's + * radial and tangential lens distortion.

+ *

Replaces the deprecated ANDROID_LENS_RADIAL_DISTORTION field, which was + * inconsistently defined.

+ * + * @see ANDROID_LENS_RADIAL_DISTORTION + */ + ANDROID_LENS_DISTORTION, + /** + * android.lens.distortionMaximumResolution [static, float[], public] + * + *

The correction coefficients to correct for this camera device's + * radial and tangential lens distortion for a + * CaptureRequest with ANDROID_SENSOR_PIXEL_MODE set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_LENS_DISTORTION_MAXIMUM_RESOLUTION, + /** + * android.lens.intrinsicCalibrationMaximumResolution [static, float[], public] + * + *

The parameters for this camera device's intrinsic + * calibration when ANDROID_SENSOR_PIXEL_MODE is set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_LENS_INTRINSIC_CALIBRATION_MAXIMUM_RESOLUTION, + /** + * android.lens.info.availableApertures [static, float[], public] + * + *

List of aperture size values for ANDROID_LENS_APERTURE that are + * supported by this camera device.

+ * + * @see ANDROID_LENS_APERTURE + */ + ANDROID_LENS_INFO_AVAILABLE_APERTURES = CameraMetadataSectionStart.ANDROID_LENS_INFO_START, + /** + * android.lens.info.availableFilterDensities [static, float[], public] + * + *

List of neutral density filter values for + * ANDROID_LENS_FILTER_DENSITY that are supported by this camera device.

+ * + * @see ANDROID_LENS_FILTER_DENSITY + */ + ANDROID_LENS_INFO_AVAILABLE_FILTER_DENSITIES, + /** + * android.lens.info.availableFocalLengths [static, float[], public] + * + *

List of focal lengths for ANDROID_LENS_FOCAL_LENGTH that are supported by this camera + * device.

+ * + * @see ANDROID_LENS_FOCAL_LENGTH + */ + ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS, + /** + * android.lens.info.availableOpticalStabilization [static, byte[], public] + * + *

List of optical image stabilization (OIS) modes for + * ANDROID_LENS_OPTICAL_STABILIZATION_MODE that are supported by this camera device.

+ * + * @see ANDROID_LENS_OPTICAL_STABILIZATION_MODE + */ + ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION, + /** + * android.lens.info.hyperfocalDistance [static, float, public] + * + *

Hyperfocal distance for this lens.

+ */ + ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE, + /** + * android.lens.info.minimumFocusDistance [static, float, public] + * + *

Shortest distance from frontmost surface + * of the lens that can be brought into sharp focus.

+ */ + ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE, + /** + * android.lens.info.shadingMapSize [static, int32[], ndk_public] + * + *

Dimensions of lens shading map.

+ */ + ANDROID_LENS_INFO_SHADING_MAP_SIZE, + /** + * android.lens.info.focusDistanceCalibration [static, enum, public] + * + *

The lens focus distance calibration quality.

+ */ + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION, + /** + * android.noiseReduction.mode [dynamic, enum, public] + * + *

Mode of operation for the noise reduction algorithm.

+ */ + ANDROID_NOISE_REDUCTION_MODE = CameraMetadataSectionStart.ANDROID_NOISE_REDUCTION_START, + /** + * android.noiseReduction.strength [controls, byte, system] + * + *

Control the amount of noise reduction + * applied to the images

+ */ + ANDROID_NOISE_REDUCTION_STRENGTH, + /** + * android.noiseReduction.availableNoiseReductionModes [static, byte[], public] + * + *

List of noise reduction modes for ANDROID_NOISE_REDUCTION_MODE that are supported + * by this camera device.

+ * + * @see ANDROID_NOISE_REDUCTION_MODE + */ + ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES, + /** + * android.quirks.meteringCropRegion [static, byte, system] + * + *

If set to 1, the camera service does not + * scale 'normalized' coordinates with respect to the crop + * region. This applies to metering input (a{e,f,wb}Region + * and output (face rectangles).

+ */ + ANDROID_QUIRKS_METERING_CROP_REGION = CameraMetadataSectionStart.ANDROID_QUIRKS_START, + /** + * android.quirks.triggerAfWithAuto [static, byte, system] + * + *

If set to 1, then the camera service always + * switches to FOCUS_MODE_AUTO before issuing a AF + * trigger.

+ */ + ANDROID_QUIRKS_TRIGGER_AF_WITH_AUTO, + /** + * android.quirks.useZslFormat [static, byte, system] + * + *

If set to 1, the camera service uses + * CAMERA2_PIXEL_FORMAT_ZSL instead of + * HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED for the zero + * shutter lag stream

+ */ + ANDROID_QUIRKS_USE_ZSL_FORMAT, + /** + * android.quirks.usePartialResult [static, byte, hidden] + * + *

If set to 1, the HAL will always split result + * metadata for a single capture into multiple buffers, + * returned using multiple process_capture_result calls.

+ */ + ANDROID_QUIRKS_USE_PARTIAL_RESULT, + /** + * android.quirks.partialResult [dynamic, enum, hidden] + * + *

Whether a result given to the framework is the + * final one for the capture, or only a partial that contains a + * subset of the full set of dynamic metadata + * values.

+ */ + ANDROID_QUIRKS_PARTIAL_RESULT, + /** + * android.request.frameCount [dynamic, int32, hidden] + * + *

A frame counter set by the framework. This value monotonically + * increases with every new result (that is, each new result has a unique + * frameCount value).

+ */ + ANDROID_REQUEST_FRAME_COUNT = CameraMetadataSectionStart.ANDROID_REQUEST_START, + /** + * android.request.id [dynamic, int32, hidden] + * + *

An application-specified ID for the current + * request. Must be maintained unchanged in output + * frame

+ */ + ANDROID_REQUEST_ID, + /** + * android.request.inputStreams [controls, int32[], system] + * + *

List which camera reprocess stream is used + * for the source of reprocessing data.

+ */ + ANDROID_REQUEST_INPUT_STREAMS, + /** + * android.request.metadataMode [dynamic, enum, system] + * + *

How much metadata to produce on + * output

+ */ + ANDROID_REQUEST_METADATA_MODE, + /** + * android.request.outputStreams [dynamic, int32[], system] + * + *

Lists which camera output streams image data + * from this capture must be sent to

+ */ + ANDROID_REQUEST_OUTPUT_STREAMS, + /** + * android.request.type [controls, enum, system] + * + *

The type of the request; either CAPTURE or + * REPROCESS. For legacy HAL3, this tag is redundant.

+ */ + ANDROID_REQUEST_TYPE, + /** + * android.request.maxNumOutputStreams [static, int32[], ndk_public] + * + *

The maximum numbers of different types of output streams + * that can be configured and used simultaneously by a camera device.

+ */ + ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS, + /** + * android.request.maxNumReprocessStreams [static, int32[], system] + * + *

How many reprocessing streams of any type + * can be allocated at the same time.

+ */ + ANDROID_REQUEST_MAX_NUM_REPROCESS_STREAMS, + /** + * android.request.maxNumInputStreams [static, int32, java_public] + * + *

The maximum numbers of any type of input streams + * that can be configured and used simultaneously by a camera device.

+ */ + ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS, + /** + * android.request.pipelineDepth [dynamic, byte, public] + * + *

Specifies the number of pipeline stages the frame went + * through from when it was exposed to when the final completed result + * was available to the framework.

+ */ + ANDROID_REQUEST_PIPELINE_DEPTH, + /** + * android.request.pipelineMaxDepth [static, byte, public] + * + *

Specifies the number of maximum pipeline stages a frame + * has to go through from when it's exposed to when it's available + * to the framework.

+ */ + ANDROID_REQUEST_PIPELINE_MAX_DEPTH, + /** + * android.request.partialResultCount [static, int32, public] + * + *

Defines how many sub-components + * a result will be composed of.

+ */ + ANDROID_REQUEST_PARTIAL_RESULT_COUNT, + /** + * android.request.availableCapabilities [static, enum[], public] + * + *

List of capabilities that this camera device + * advertises as fully supporting.

+ */ + ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + /** + * android.request.availableRequestKeys [static, int32[], ndk_public] + * + *

A list of all keys that the camera device has available + * to use with {@link ACaptureRequest }.

+ */ + ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS, + /** + * android.request.availableResultKeys [static, int32[], ndk_public] + * + *

A list of all keys that the camera device has available to use with {@link ACameraCaptureSession_captureCallback_result }.

+ */ + ANDROID_REQUEST_AVAILABLE_RESULT_KEYS, + /** + * android.request.availableCharacteristicsKeys [static, int32[], ndk_public] + * + *

A list of all keys that the camera device has available to use with {@link ACameraManager_getCameraCharacteristics }.

+ */ + ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, + /** + * android.request.availableSessionKeys [static, int32[], ndk_public] + * + *

A subset of the available request keys that the camera device + * can pass as part of the capture session initialization.

+ */ + ANDROID_REQUEST_AVAILABLE_SESSION_KEYS, + /** + * android.request.availablePhysicalCameraRequestKeys [static, int32[], ndk_public] + * + *

A subset of the available request keys that can be overridden for + * physical devices backing a logical multi-camera.

+ */ + ANDROID_REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS, + /** + * android.request.characteristicKeysNeedingPermission [static, int32[], hidden] + * + *

A list of camera characteristics keys that are only available + * in case the camera client has camera permission.

+ */ + ANDROID_REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION, + /** + * android.request.availableDynamicRangeProfilesMap [static, enum[], ndk_public] + * + *

A map of all available 10-bit dynamic range profiles along with their + * capture request constraints.

+ */ + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP, + /** + * android.request.recommendedTenBitDynamicRangeProfile [static, int32, java_public] + * + *

Recommended 10-bit dynamic range profile.

+ */ + ANDROID_REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE, + /** + * android.scaler.cropRegion [dynamic, int32[], public] + * + *

The desired region of the sensor to read out for this capture.

+ */ + ANDROID_SCALER_CROP_REGION = CameraMetadataSectionStart.ANDROID_SCALER_START, + /** + * android.scaler.availableFormats [static, enum[], hidden] + * + *

The list of image formats that are supported by this + * camera device for output streams.

+ */ + ANDROID_SCALER_AVAILABLE_FORMATS, + /** + * android.scaler.availableJpegMinDurations [static, int64[], hidden] + * + *

The minimum frame duration that is supported + * for each resolution in ANDROID_SCALER_AVAILABLE_JPEG_SIZES.

+ * + * @see ANDROID_SCALER_AVAILABLE_JPEG_SIZES + */ + ANDROID_SCALER_AVAILABLE_JPEG_MIN_DURATIONS, + /** + * android.scaler.availableJpegSizes [static, int32[], hidden] + * + *

The JPEG resolutions that are supported by this camera device.

+ */ + ANDROID_SCALER_AVAILABLE_JPEG_SIZES, + /** + * android.scaler.availableMaxDigitalZoom [static, float, public] + * + *

The maximum ratio between both active area width + * and crop region width, and active area height and + * crop region height, for ANDROID_SCALER_CROP_REGION.

+ * + * @see ANDROID_SCALER_CROP_REGION + */ + ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM, + /** + * android.scaler.availableProcessedMinDurations [static, int64[], hidden] + * + *

For each available processed output size (defined in + * ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES), this property lists the + * minimum supportable frame duration for that size.

+ * + * @see ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES + */ + ANDROID_SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS, + /** + * android.scaler.availableProcessedSizes [static, int32[], hidden] + * + *

The resolutions available for use with + * processed output streams, such as YV12, NV12, and + * platform opaque YUV/RGB streams to the GPU or video + * encoders.

+ */ + ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES, + /** + * android.scaler.availableRawMinDurations [static, int64[], system] + * + *

For each available raw output size (defined in + * ANDROID_SCALER_AVAILABLE_RAW_SIZES), this property lists the minimum + * supportable frame duration for that size.

+ * + * @see ANDROID_SCALER_AVAILABLE_RAW_SIZES + */ + ANDROID_SCALER_AVAILABLE_RAW_MIN_DURATIONS, + /** + * android.scaler.availableRawSizes [static, int32[], system] + * + *

The resolutions available for use with raw + * sensor output streams, listed as width, + * height

+ */ + ANDROID_SCALER_AVAILABLE_RAW_SIZES, + /** + * android.scaler.availableInputOutputFormatsMap [static, int32, hidden] + * + *

The mapping of image formats that are supported by this + * camera device for input streams, to their corresponding output formats.

+ */ + ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP, + /** + * android.scaler.availableStreamConfigurations [static, enum[], ndk_public] + * + *

The available stream configurations that this + * camera device supports + * (i.e. format, width, height, output/input stream).

+ */ + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, + /** + * android.scaler.availableMinFrameDurations [static, int64[], ndk_public] + * + *

This lists the minimum frame duration for each + * format/size combination.

+ */ + ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS, + /** + * android.scaler.availableStallDurations [static, int64[], ndk_public] + * + *

This lists the maximum stall duration for each + * output format/size combination.

+ */ + ANDROID_SCALER_AVAILABLE_STALL_DURATIONS, + /** + * android.scaler.croppingType [static, enum, public] + * + *

The crop type that this camera device supports.

+ */ + ANDROID_SCALER_CROPPING_TYPE, + /** + * android.scaler.availableRecommendedStreamConfigurations [static, enum[], ndk_public] + * + *

Recommended stream configurations for common client use cases.

+ */ + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS, + /** + * android.scaler.availableRecommendedInputOutputFormatsMap [static, int32, ndk_public] + * + *

Recommended mappings of image formats that are supported by this + * camera device for input streams, to their corresponding output formats.

+ */ + ANDROID_SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP, + /** + * android.scaler.availableRotateAndCropModes [static, byte[], public] + * + *

List of rotate-and-crop modes for ANDROID_SCALER_ROTATE_AND_CROP that are supported by this camera device.

+ * + * @see ANDROID_SCALER_ROTATE_AND_CROP + */ + ANDROID_SCALER_AVAILABLE_ROTATE_AND_CROP_MODES, + /** + * android.scaler.defaultSecureImageSize [static, int32[], public] + * + *

Default YUV/PRIVATE size to use for requesting secure image buffers.

+ */ + ANDROID_SCALER_DEFAULT_SECURE_IMAGE_SIZE, + /** + * android.scaler.physicalCameraMultiResolutionStreamConfigurations [static, enum[], ndk_public] + * + *

The available multi-resolution stream configurations that this + * physical camera device supports + * (i.e. format, width, height, output/input stream).

+ */ + ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS, + /** + * android.scaler.availableStreamConfigurationsMaximumResolution [static, enum[], ndk_public] + * + *

The available stream configurations that this + * camera device supports (i.e. format, width, height, output/input stream) for a + * CaptureRequest with ANDROID_SENSOR_PIXEL_MODE set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION, + /** + * android.scaler.availableMinFrameDurationsMaximumResolution [static, int64[], ndk_public] + * + *

This lists the minimum frame duration for each + * format/size combination when the camera device is sent a CaptureRequest with + * ANDROID_SENSOR_PIXEL_MODE set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION, + /** + * android.scaler.availableStallDurationsMaximumResolution [static, int64[], ndk_public] + * + *

This lists the maximum stall duration for each + * output format/size combination when CaptureRequests are submitted with + * ANDROID_SENSOR_PIXEL_MODE set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_SCALER_AVAILABLE_STALL_DURATIONS_MAXIMUM_RESOLUTION, + /** + * android.scaler.availableInputOutputFormatsMapMaximumResolution [static, int32, hidden] + * + *

The mapping of image formats that are supported by this + * camera device for input streams, to their corresponding output formats, when + * ANDROID_SENSOR_PIXEL_MODE is set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP_MAXIMUM_RESOLUTION, + /** + * android.scaler.multiResolutionStreamSupported [static, enum, ndk_public] + * + *

Whether the camera device supports multi-resolution input or output streams

+ */ + ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED, + /** + * android.sensor.exposureTime [dynamic, int64, public] + * + *

Duration each pixel is exposed to + * light.

+ */ + ANDROID_SENSOR_EXPOSURE_TIME = CameraMetadataSectionStart.ANDROID_SENSOR_START, + /** + * android.sensor.frameDuration [dynamic, int64, public] + * + *

Duration from start of frame exposure to + * start of next frame exposure.

+ */ + ANDROID_SENSOR_FRAME_DURATION, + /** + * android.sensor.sensitivity [dynamic, int32, public] + * + *

The amount of gain applied to sensor data + * before processing.

+ */ + ANDROID_SENSOR_SENSITIVITY, + /** + * android.sensor.referenceIlluminant1 [static, enum, public] + * + *

The standard reference illuminant used as the scene light source when + * calculating the ANDROID_SENSOR_COLOR_TRANSFORM1, + * ANDROID_SENSOR_CALIBRATION_TRANSFORM1, and + * ANDROID_SENSOR_FORWARD_MATRIX1 matrices.

+ * + * @see ANDROID_SENSOR_CALIBRATION_TRANSFORM1 + * @see ANDROID_SENSOR_COLOR_TRANSFORM1 + * @see ANDROID_SENSOR_FORWARD_MATRIX1 + */ + ANDROID_SENSOR_REFERENCE_ILLUMINANT1, + /** + * android.sensor.referenceIlluminant2 [static, byte, public] + * + *

The standard reference illuminant used as the scene light source when + * calculating the ANDROID_SENSOR_COLOR_TRANSFORM2, + * ANDROID_SENSOR_CALIBRATION_TRANSFORM2, and + * ANDROID_SENSOR_FORWARD_MATRIX2 matrices.

+ * + * @see ANDROID_SENSOR_CALIBRATION_TRANSFORM2 + * @see ANDROID_SENSOR_COLOR_TRANSFORM2 + * @see ANDROID_SENSOR_FORWARD_MATRIX2 + */ + ANDROID_SENSOR_REFERENCE_ILLUMINANT2, + /** + * android.sensor.calibrationTransform1 [static, rational[], public] + * + *

A per-device calibration transform matrix that maps from the + * reference sensor colorspace to the actual device sensor colorspace.

+ */ + ANDROID_SENSOR_CALIBRATION_TRANSFORM1, + /** + * android.sensor.calibrationTransform2 [static, rational[], public] + * + *

A per-device calibration transform matrix that maps from the + * reference sensor colorspace to the actual device sensor colorspace + * (this is the colorspace of the raw buffer data).

+ */ + ANDROID_SENSOR_CALIBRATION_TRANSFORM2, + /** + * android.sensor.colorTransform1 [static, rational[], public] + * + *

A matrix that transforms color values from CIE XYZ color space to + * reference sensor color space.

+ */ + ANDROID_SENSOR_COLOR_TRANSFORM1, + /** + * android.sensor.colorTransform2 [static, rational[], public] + * + *

A matrix that transforms color values from CIE XYZ color space to + * reference sensor color space.

+ */ + ANDROID_SENSOR_COLOR_TRANSFORM2, + /** + * android.sensor.forwardMatrix1 [static, rational[], public] + * + *

A matrix that transforms white balanced camera colors from the reference + * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.

+ */ + ANDROID_SENSOR_FORWARD_MATRIX1, + /** + * android.sensor.forwardMatrix2 [static, rational[], public] + * + *

A matrix that transforms white balanced camera colors from the reference + * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.

+ */ + ANDROID_SENSOR_FORWARD_MATRIX2, + /** + * android.sensor.baseGainFactor [static, rational, system] + * + *

Gain factor from electrons to raw units when + * ISO=100

+ */ + ANDROID_SENSOR_BASE_GAIN_FACTOR, + /** + * android.sensor.blackLevelPattern [static, int32[], public] + * + *

A fixed black level offset for each of the color filter arrangement + * (CFA) mosaic channels.

+ */ + ANDROID_SENSOR_BLACK_LEVEL_PATTERN, + /** + * android.sensor.maxAnalogSensitivity [static, int32, public] + * + *

Maximum sensitivity that is implemented + * purely through analog gain.

+ */ + ANDROID_SENSOR_MAX_ANALOG_SENSITIVITY, + /** + * android.sensor.orientation [static, int32, public] + * + *

Clockwise angle through which the output image needs to be rotated to be + * upright on the device screen in its native orientation.

+ */ + ANDROID_SENSOR_ORIENTATION, + /** + * android.sensor.profileHueSatMapDimensions [static, int32[], system] + * + *

The number of input samples for each dimension of + * ANDROID_SENSOR_PROFILE_HUE_SAT_MAP.

+ * + * @see ANDROID_SENSOR_PROFILE_HUE_SAT_MAP + */ + ANDROID_SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS, + /** + * android.sensor.timestamp [dynamic, int64, public] + * + *

Time at start of exposure of first + * row of the image sensor active array, in nanoseconds.

+ */ + ANDROID_SENSOR_TIMESTAMP, + /** + * android.sensor.temperature [dynamic, float, system] + * + *

The temperature of the sensor, sampled at the time + * exposure began for this frame.

+ *

The thermal diode being queried should be inside the sensor PCB, or + * somewhere close to it.

+ */ + ANDROID_SENSOR_TEMPERATURE, + /** + * android.sensor.neutralColorPoint [dynamic, rational[], public] + * + *

The estimated camera neutral color in the native sensor colorspace at + * the time of capture.

+ */ + ANDROID_SENSOR_NEUTRAL_COLOR_POINT, + /** + * android.sensor.noiseProfile [dynamic, double[], public] + * + *

Noise model coefficients for each CFA mosaic channel.

+ */ + ANDROID_SENSOR_NOISE_PROFILE, + /** + * android.sensor.profileHueSatMap [dynamic, float[], system] + * + *

A mapping containing a hue shift, saturation scale, and value scale + * for each pixel.

+ */ + ANDROID_SENSOR_PROFILE_HUE_SAT_MAP, + /** + * android.sensor.profileToneCurve [dynamic, float[], system] + * + *

A list of x,y samples defining a tone-mapping curve for gamma adjustment.

+ */ + ANDROID_SENSOR_PROFILE_TONE_CURVE, + /** + * android.sensor.greenSplit [dynamic, float, public] + * + *

The worst-case divergence between Bayer green channels.

+ */ + ANDROID_SENSOR_GREEN_SPLIT, + /** + * android.sensor.testPatternData [dynamic, int32[], public] + * + *

A pixel [R, G_even, G_odd, B] that supplies the test pattern + * when ANDROID_SENSOR_TEST_PATTERN_MODE is SOLID_COLOR.

+ * + * @see ANDROID_SENSOR_TEST_PATTERN_MODE + */ + ANDROID_SENSOR_TEST_PATTERN_DATA, + /** + * android.sensor.testPatternMode [dynamic, enum, public] + * + *

When enabled, the sensor sends a test pattern instead of + * doing a real exposure from the camera.

+ */ + ANDROID_SENSOR_TEST_PATTERN_MODE, + /** + * android.sensor.availableTestPatternModes [static, int32[], public] + * + *

List of sensor test pattern modes for ANDROID_SENSOR_TEST_PATTERN_MODE + * supported by this camera device.

+ * + * @see ANDROID_SENSOR_TEST_PATTERN_MODE + */ + ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES, + /** + * android.sensor.rollingShutterSkew [dynamic, int64, public] + * + *

Duration between the start of exposure for the first row of the image sensor, + * and the start of exposure for one past the last row of the image sensor.

+ */ + ANDROID_SENSOR_ROLLING_SHUTTER_SKEW, + /** + * android.sensor.opticalBlackRegions [static, int32[], public] + * + *

List of disjoint rectangles indicating the sensor + * optically shielded black pixel regions.

+ */ + ANDROID_SENSOR_OPTICAL_BLACK_REGIONS, + /** + * android.sensor.dynamicBlackLevel [dynamic, float[], public] + * + *

A per-frame dynamic black level offset for each of the color filter + * arrangement (CFA) mosaic channels.

+ */ + ANDROID_SENSOR_DYNAMIC_BLACK_LEVEL, + /** + * android.sensor.dynamicWhiteLevel [dynamic, int32, public] + * + *

Maximum raw value output by sensor for this frame.

+ */ + ANDROID_SENSOR_DYNAMIC_WHITE_LEVEL, + /** + * android.sensor.opaqueRawSize [static, int32[], system] + * + *

Size in bytes for all the listed opaque RAW buffer sizes

+ */ + ANDROID_SENSOR_OPAQUE_RAW_SIZE, + /** + * android.sensor.opaqueRawSizeMaximumResolution [static, int32[], system] + * + *

Size in bytes for all the listed opaque RAW buffer sizes when + * ANDROID_SENSOR_PIXEL_MODE is set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_SENSOR_OPAQUE_RAW_SIZE_MAXIMUM_RESOLUTION, + /** + * android.sensor.pixelMode [dynamic, enum, public] + * + *

Switches sensor pixel mode between maximum resolution mode and default mode.

+ */ + ANDROID_SENSOR_PIXEL_MODE, + /** + * android.sensor.rawBinningFactorUsed [dynamic, enum, public] + * + *

Whether RAW images requested have their bayer pattern as described by + * ANDROID_SENSOR_INFO_BINNING_FACTOR.

+ * + * @see ANDROID_SENSOR_INFO_BINNING_FACTOR + */ + ANDROID_SENSOR_RAW_BINNING_FACTOR_USED, + /** + * android.sensor.info.activeArraySize [static, int32[], public] + * + *

The area of the image sensor which corresponds to active pixels after any geometric + * distortion correction has been applied.

+ */ + ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE = CameraMetadataSectionStart.ANDROID_SENSOR_INFO_START, + /** + * android.sensor.info.sensitivityRange [static, int32[], public] + * + *

Range of sensitivities for ANDROID_SENSOR_SENSITIVITY supported by this + * camera device.

+ * + * @see ANDROID_SENSOR_SENSITIVITY + */ + ANDROID_SENSOR_INFO_SENSITIVITY_RANGE, + /** + * android.sensor.info.colorFilterArrangement [static, enum, public] + * + *

The arrangement of color filters on sensor; + * represents the colors in the top-left 2x2 section of + * the sensor, in reading order, for a Bayer camera, or the + * light spectrum it captures for MONOCHROME camera.

+ */ + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT, + /** + * android.sensor.info.exposureTimeRange [static, int64[], public] + * + *

The range of image exposure times for ANDROID_SENSOR_EXPOSURE_TIME supported + * by this camera device.

+ * + * @see ANDROID_SENSOR_EXPOSURE_TIME + */ + ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE, + /** + * android.sensor.info.maxFrameDuration [static, int64, public] + * + *

The maximum possible frame duration (minimum frame rate) for + * ANDROID_SENSOR_FRAME_DURATION that is supported this camera device.

+ * + * @see ANDROID_SENSOR_FRAME_DURATION + */ + ANDROID_SENSOR_INFO_MAX_FRAME_DURATION, + /** + * android.sensor.info.physicalSize [static, float[], public] + * + *

The physical dimensions of the full pixel + * array.

+ */ + ANDROID_SENSOR_INFO_PHYSICAL_SIZE, + /** + * android.sensor.info.pixelArraySize [static, int32[], public] + * + *

Dimensions of the full pixel array, possibly + * including black calibration pixels.

+ */ + ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, + /** + * android.sensor.info.whiteLevel [static, int32, public] + * + *

Maximum raw value output by sensor.

+ */ + ANDROID_SENSOR_INFO_WHITE_LEVEL, + /** + * android.sensor.info.timestampSource [static, enum, public] + * + *

The time base source for sensor capture start timestamps.

+ */ + ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE, + /** + * android.sensor.info.lensShadingApplied [static, enum, public] + * + *

Whether the RAW images output from this camera device are subject to + * lens shading correction.

+ */ + ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED, + /** + * android.sensor.info.preCorrectionActiveArraySize [static, int32[], public] + * + *

The area of the image sensor which corresponds to active pixels prior to the + * application of any geometric distortion correction.

+ */ + ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE, + /** + * android.sensor.info.activeArraySizeMaximumResolution [static, int32[], public] + * + *

The area of the image sensor which corresponds to active pixels after any geometric + * distortion correction has been applied, when the sensor runs in maximum resolution mode.

+ */ + ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION, + /** + * android.sensor.info.pixelArraySizeMaximumResolution [static, int32[], public] + * + *

Dimensions of the full pixel array, possibly + * including black calibration pixels, when the sensor runs in maximum resolution mode. + * Analogous to ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, when ANDROID_SENSOR_PIXEL_MODE is + * set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE_MAXIMUM_RESOLUTION, + /** + * android.sensor.info.preCorrectionActiveArraySizeMaximumResolution [static, int32[], public] + * + *

The area of the image sensor which corresponds to active pixels prior to the + * application of any geometric distortion correction, when the sensor runs in maximum + * resolution mode. This key must be used for crop / metering regions, only when + * ANDROID_SENSOR_PIXEL_MODE is set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION, + /** + * android.sensor.info.binningFactor [static, int32[], public] + * + *

Dimensions of the group of pixels which are under the same color filter. + * This specifies the width and height (pair of integers) of the group of pixels which fall + * under the same color filter for ULTRA_HIGH_RESOLUTION sensors.

+ */ + ANDROID_SENSOR_INFO_BINNING_FACTOR, + /** + * android.shading.mode [dynamic, enum, public] + * + *

Quality of lens shading correction applied + * to the image data.

+ */ + ANDROID_SHADING_MODE = CameraMetadataSectionStart.ANDROID_SHADING_START, + /** + * android.shading.strength [controls, byte, system] + * + *

Control the amount of shading correction + * applied to the images

+ */ + ANDROID_SHADING_STRENGTH, + /** + * android.shading.availableModes [static, byte[], public] + * + *

List of lens shading modes for ANDROID_SHADING_MODE that are supported by this camera device.

+ * + * @see ANDROID_SHADING_MODE + */ + ANDROID_SHADING_AVAILABLE_MODES, + /** + * android.statistics.faceDetectMode [dynamic, enum, public] + * + *

Operating mode for the face detector + * unit.

+ */ + ANDROID_STATISTICS_FACE_DETECT_MODE = CameraMetadataSectionStart.ANDROID_STATISTICS_START, + /** + * android.statistics.histogramMode [dynamic, enum, system] + * + *

Operating mode for histogram + * generation

+ */ + ANDROID_STATISTICS_HISTOGRAM_MODE, + /** + * android.statistics.sharpnessMapMode [dynamic, enum, system] + * + *

Operating mode for sharpness map + * generation

+ */ + ANDROID_STATISTICS_SHARPNESS_MAP_MODE, + /** + * android.statistics.hotPixelMapMode [dynamic, enum, public] + * + *

Operating mode for hot pixel map generation.

+ */ + ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE, + /** + * android.statistics.faceIds [dynamic, int32[], ndk_public] + * + *

List of unique IDs for detected faces.

+ */ + ANDROID_STATISTICS_FACE_IDS, + /** + * android.statistics.faceLandmarks [dynamic, int32[], ndk_public] + * + *

List of landmarks for detected + * faces.

+ */ + ANDROID_STATISTICS_FACE_LANDMARKS, + /** + * android.statistics.faceRectangles [dynamic, int32[], ndk_public] + * + *

List of the bounding rectangles for detected + * faces.

+ */ + ANDROID_STATISTICS_FACE_RECTANGLES, + /** + * android.statistics.faceScores [dynamic, byte[], ndk_public] + * + *

List of the face confidence scores for + * detected faces

+ */ + ANDROID_STATISTICS_FACE_SCORES, + /** + * android.statistics.histogram [dynamic, int32[], system] + * + *

A 3-channel histogram based on the raw + * sensor data

+ */ + ANDROID_STATISTICS_HISTOGRAM, + /** + * android.statistics.sharpnessMap [dynamic, int32[], system] + * + *

A 3-channel sharpness map, based on the raw + * sensor data

+ */ + ANDROID_STATISTICS_SHARPNESS_MAP, + /** + * android.statistics.lensShadingCorrectionMap [dynamic, byte, java_public] + * + *

The shading map is a low-resolution floating-point map + * that lists the coefficients used to correct for vignetting, for each + * Bayer color channel.

+ */ + ANDROID_STATISTICS_LENS_SHADING_CORRECTION_MAP, + /** + * android.statistics.lensShadingMap [dynamic, float[], ndk_public] + * + *

The shading map is a low-resolution floating-point map + * that lists the coefficients used to correct for vignetting and color shading, + * for each Bayer color channel of RAW image data.

+ */ + ANDROID_STATISTICS_LENS_SHADING_MAP, + /** + * android.statistics.predictedColorGains [dynamic, float[], hidden] + * + *

The best-fit color channel gains calculated + * by the camera device's statistics units for the current output frame.

+ */ + ANDROID_STATISTICS_PREDICTED_COLOR_GAINS, + /** + * android.statistics.predictedColorTransform [dynamic, rational[], hidden] + * + *

The best-fit color transform matrix estimate + * calculated by the camera device's statistics units for the current + * output frame.

+ */ + ANDROID_STATISTICS_PREDICTED_COLOR_TRANSFORM, + /** + * android.statistics.sceneFlicker [dynamic, enum, public] + * + *

The camera device estimated scene illumination lighting + * frequency.

+ */ + ANDROID_STATISTICS_SCENE_FLICKER, + /** + * android.statistics.hotPixelMap [dynamic, int32[], public] + * + *

List of (x, y) coordinates of hot/defective pixels on the sensor.

+ */ + ANDROID_STATISTICS_HOT_PIXEL_MAP, + /** + * android.statistics.lensShadingMapMode [dynamic, enum, public] + * + *

Whether the camera device will output the lens + * shading map in output result metadata.

+ */ + ANDROID_STATISTICS_LENS_SHADING_MAP_MODE, + /** + * android.statistics.oisDataMode [dynamic, enum, public] + * + *

A control for selecting whether optical stabilization (OIS) position + * information is included in output result metadata.

+ */ + ANDROID_STATISTICS_OIS_DATA_MODE, + /** + * android.statistics.oisTimestamps [dynamic, int64[], ndk_public] + * + *

An array of timestamps of OIS samples, in nanoseconds.

+ */ + ANDROID_STATISTICS_OIS_TIMESTAMPS, + /** + * android.statistics.oisXShifts [dynamic, float[], ndk_public] + * + *

An array of shifts of OIS samples, in x direction.

+ */ + ANDROID_STATISTICS_OIS_X_SHIFTS, + /** + * android.statistics.oisYShifts [dynamic, float[], ndk_public] + * + *

An array of shifts of OIS samples, in y direction.

+ */ + ANDROID_STATISTICS_OIS_Y_SHIFTS, + /** + * android.statistics.info.availableFaceDetectModes [static, byte[], public] + * + *

List of face detection modes for ANDROID_STATISTICS_FACE_DETECT_MODE that are + * supported by this camera device.

+ * + * @see ANDROID_STATISTICS_FACE_DETECT_MODE + */ + ANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES = CameraMetadataSectionStart.ANDROID_STATISTICS_INFO_START, + /** + * android.statistics.info.histogramBucketCount [static, int32, system] + * + *

Number of histogram buckets + * supported

+ */ + ANDROID_STATISTICS_INFO_HISTOGRAM_BUCKET_COUNT, + /** + * android.statistics.info.maxFaceCount [static, int32, public] + * + *

The maximum number of simultaneously detectable + * faces.

+ */ + ANDROID_STATISTICS_INFO_MAX_FACE_COUNT, + /** + * android.statistics.info.maxHistogramCount [static, int32, system] + * + *

Maximum value possible for a histogram + * bucket

+ */ + ANDROID_STATISTICS_INFO_MAX_HISTOGRAM_COUNT, + /** + * android.statistics.info.maxSharpnessMapValue [static, int32, system] + * + *

Maximum value possible for a sharpness map + * region.

+ */ + ANDROID_STATISTICS_INFO_MAX_SHARPNESS_MAP_VALUE, + /** + * android.statistics.info.sharpnessMapSize [static, int32[], system] + * + *

Dimensions of the sharpness + * map

+ */ + ANDROID_STATISTICS_INFO_SHARPNESS_MAP_SIZE, + /** + * android.statistics.info.availableHotPixelMapModes [static, byte[], public] + * + *

List of hot pixel map output modes for ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE that are + * supported by this camera device.

+ * + * @see ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE + */ + ANDROID_STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES, + /** + * android.statistics.info.availableLensShadingMapModes [static, byte[], public] + * + *

List of lens shading map output modes for ANDROID_STATISTICS_LENS_SHADING_MAP_MODE that + * are supported by this camera device.

+ * + * @see ANDROID_STATISTICS_LENS_SHADING_MAP_MODE + */ + ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES, + /** + * android.statistics.info.availableOisDataModes [static, byte[], public] + * + *

List of OIS data output modes for ANDROID_STATISTICS_OIS_DATA_MODE that + * are supported by this camera device.

+ * + * @see ANDROID_STATISTICS_OIS_DATA_MODE + */ + ANDROID_STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES, + /** + * android.tonemap.curveBlue [dynamic, float[], ndk_public] + * + *

Tonemapping / contrast / gamma curve for the blue + * channel, to use when ANDROID_TONEMAP_MODE is + * CONTRAST_CURVE.

+ * + * @see ANDROID_TONEMAP_MODE + */ + ANDROID_TONEMAP_CURVE_BLUE = CameraMetadataSectionStart.ANDROID_TONEMAP_START, + /** + * android.tonemap.curveGreen [dynamic, float[], ndk_public] + * + *

Tonemapping / contrast / gamma curve for the green + * channel, to use when ANDROID_TONEMAP_MODE is + * CONTRAST_CURVE.

+ * + * @see ANDROID_TONEMAP_MODE + */ + ANDROID_TONEMAP_CURVE_GREEN, + /** + * android.tonemap.curveRed [dynamic, float[], ndk_public] + * + *

Tonemapping / contrast / gamma curve for the red + * channel, to use when ANDROID_TONEMAP_MODE is + * CONTRAST_CURVE.

+ * + * @see ANDROID_TONEMAP_MODE + */ + ANDROID_TONEMAP_CURVE_RED, + /** + * android.tonemap.mode [dynamic, enum, public] + * + *

High-level global contrast/gamma/tonemapping control.

+ */ + ANDROID_TONEMAP_MODE, + /** + * android.tonemap.maxCurvePoints [static, int32, public] + * + *

Maximum number of supported points in the + * tonemap curve that can be used for ANDROID_TONEMAP_CURVE.

+ * + * @see ANDROID_TONEMAP_CURVE + */ + ANDROID_TONEMAP_MAX_CURVE_POINTS, + /** + * android.tonemap.availableToneMapModes [static, byte[], public] + * + *

List of tonemapping modes for ANDROID_TONEMAP_MODE that are supported by this camera + * device.

+ * + * @see ANDROID_TONEMAP_MODE + */ + ANDROID_TONEMAP_AVAILABLE_TONE_MAP_MODES, + /** + * android.tonemap.gamma [dynamic, float, public] + * + *

Tonemapping curve to use when ANDROID_TONEMAP_MODE is + * GAMMA_VALUE

+ * + * @see ANDROID_TONEMAP_MODE + */ + ANDROID_TONEMAP_GAMMA, + /** + * android.tonemap.presetCurve [dynamic, enum, public] + * + *

Tonemapping curve to use when ANDROID_TONEMAP_MODE is + * PRESET_CURVE

+ * + * @see ANDROID_TONEMAP_MODE + */ + ANDROID_TONEMAP_PRESET_CURVE, + /** + * android.led.transmit [dynamic, enum, hidden] + * + *

This LED is nominally used to indicate to the user + * that the camera is powered on and may be streaming images back to the + * Application Processor. In certain rare circumstances, the OS may + * disable this when video is processed locally and not transmitted to + * any untrusted applications.

+ *

In particular, the LED must always be on when the data could be + * transmitted off the device. The LED should always be on whenever + * data is stored locally on the device.

+ *

The LED may be off if a trusted application is using the data that + * doesn't violate the above rules.

+ */ + ANDROID_LED_TRANSMIT = CameraMetadataSectionStart.ANDROID_LED_START, + /** + * android.led.availableLeds [static, enum[], hidden] + * + *

A list of camera LEDs that are available on this system.

+ */ + ANDROID_LED_AVAILABLE_LEDS, + /** + * android.info.supportedHardwareLevel [static, enum, public] + * + *

Generally classifies the overall set of the camera device functionality.

+ */ + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL = CameraMetadataSectionStart.ANDROID_INFO_START, + /** + * android.info.version [static, byte, public] + * + *

A short string for manufacturer version information about the camera device, such as + * ISP hardware, sensors, etc.

+ */ + ANDROID_INFO_VERSION, + /** + * android.info.supportedBufferManagementVersion [static, enum, system] + * + *

The version of buffer management API this camera device supports and opts into.

+ */ + ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION, + /** + * android.info.deviceStateOrientations [static, int64[], ndk_public] + */ + ANDROID_INFO_DEVICE_STATE_ORIENTATIONS, + /** + * android.blackLevel.lock [dynamic, enum, public] + * + *

Whether black-level compensation is locked + * to its current values, or is free to vary.

+ */ + ANDROID_BLACK_LEVEL_LOCK = CameraMetadataSectionStart.ANDROID_BLACK_LEVEL_START, + /** + * android.sync.frameNumber [dynamic, enum, ndk_public] + * + *

The frame number corresponding to the last request + * with which the output result (metadata + buffers) has been fully + * synchronized.

+ */ + ANDROID_SYNC_FRAME_NUMBER = CameraMetadataSectionStart.ANDROID_SYNC_START, + /** + * android.sync.maxLatency [static, enum, public] + * + *

The maximum number of frames that can occur after a request + * (different than the previous) has been submitted, and before the + * result's state becomes synchronized.

+ */ + ANDROID_SYNC_MAX_LATENCY, + /** + * android.reprocess.effectiveExposureFactor [dynamic, float, java_public] + * + *

The amount of exposure time increase factor applied to the original output + * frame by the application processing before sending for reprocessing.

+ */ + ANDROID_REPROCESS_EFFECTIVE_EXPOSURE_FACTOR = CameraMetadataSectionStart.ANDROID_REPROCESS_START, + /** + * android.reprocess.maxCaptureStall [static, int32, java_public] + * + *

The maximal camera capture pipeline stall (in unit of frame count) introduced by a + * reprocess capture request.

+ */ + ANDROID_REPROCESS_MAX_CAPTURE_STALL, + /** + * android.depth.maxDepthSamples [static, int32, system] + * + *

Maximum number of points that a depth point cloud may contain.

+ */ + ANDROID_DEPTH_MAX_DEPTH_SAMPLES = CameraMetadataSectionStart.ANDROID_DEPTH_START, + /** + * android.depth.availableDepthStreamConfigurations [static, enum[], ndk_public] + * + *

The available depth dataspace stream + * configurations that this camera device supports + * (i.e. format, width, height, output/input stream).

+ */ + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS, + /** + * android.depth.availableDepthMinFrameDurations [static, int64[], ndk_public] + * + *

This lists the minimum frame duration for each + * format/size combination for depth output formats.

+ */ + ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS, + /** + * android.depth.availableDepthStallDurations [static, int64[], ndk_public] + * + *

This lists the maximum stall duration for each + * output format/size combination for depth streams.

+ */ + ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS, + /** + * android.depth.depthIsExclusive [static, enum, public] + * + *

Indicates whether a capture request may target both a + * DEPTH16 / DEPTH_POINT_CLOUD output, and normal color outputs (such as + * YUV_420_888, JPEG, or RAW) simultaneously.

+ */ + ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE, + /** + * android.depth.availableRecommendedDepthStreamConfigurations [static, int32[], ndk_public] + * + *

Recommended depth stream configurations for common client use cases.

+ */ + ANDROID_DEPTH_AVAILABLE_RECOMMENDED_DEPTH_STREAM_CONFIGURATIONS, + /** + * android.depth.availableDynamicDepthStreamConfigurations [static, enum[], ndk_public] + * + *

The available dynamic depth dataspace stream + * configurations that this camera device supports + * (i.e. format, width, height, output/input stream).

+ */ + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS, + /** + * android.depth.availableDynamicDepthMinFrameDurations [static, int64[], ndk_public] + * + *

This lists the minimum frame duration for each + * format/size combination for dynamic depth output streams.

+ */ + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS, + /** + * android.depth.availableDynamicDepthStallDurations [static, int64[], ndk_public] + * + *

This lists the maximum stall duration for each + * output format/size combination for dynamic depth streams.

+ */ + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS, + /** + * android.depth.availableDepthStreamConfigurationsMaximumResolution [static, enum[], ndk_public] + * + *

The available depth dataspace stream + * configurations that this camera device supports + * (i.e. format, width, height, output/input stream) when a CaptureRequest is submitted with + * ANDROID_SENSOR_PIXEL_MODE set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION, + /** + * android.depth.availableDepthMinFrameDurationsMaximumResolution [static, int64[], ndk_public] + * + *

This lists the minimum frame duration for each + * format/size combination for depth output formats when a CaptureRequest is submitted with + * ANDROID_SENSOR_PIXEL_MODE set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION, + /** + * android.depth.availableDepthStallDurationsMaximumResolution [static, int64[], ndk_public] + * + *

This lists the maximum stall duration for each + * output format/size combination for depth streams for CaptureRequests where + * ANDROID_SENSOR_PIXEL_MODE is set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS_MAXIMUM_RESOLUTION, + /** + * android.depth.availableDynamicDepthStreamConfigurationsMaximumResolution [static, enum[], ndk_public] + * + *

The available dynamic depth dataspace stream + * configurations that this camera device supports (i.e. format, width, height, + * output/input stream) for CaptureRequests where ANDROID_SENSOR_PIXEL_MODE is set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION, + /** + * android.depth.availableDynamicDepthMinFrameDurationsMaximumResolution [static, int64[], ndk_public] + * + *

This lists the minimum frame duration for each + * format/size combination for dynamic depth output streams for CaptureRequests where + * ANDROID_SENSOR_PIXEL_MODE is set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION, + /** + * android.depth.availableDynamicDepthStallDurationsMaximumResolution [static, int64[], ndk_public] + * + *

This lists the maximum stall duration for each + * output format/size combination for dynamic depth streams for CaptureRequests where + * ANDROID_SENSOR_PIXEL_MODE is set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS_MAXIMUM_RESOLUTION, + /** + * android.logicalMultiCamera.physicalIds [static, byte[], ndk_public] + * + *

String containing the ids of the underlying physical cameras.

+ */ + ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS = CameraMetadataSectionStart.ANDROID_LOGICAL_MULTI_CAMERA_START, + /** + * android.logicalMultiCamera.sensorSyncType [static, enum, public] + * + *

The accuracy of frame timestamp synchronization between physical cameras

+ */ + ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE, + /** + * android.logicalMultiCamera.activePhysicalId [dynamic, byte, public] + * + *

String containing the ID of the underlying active physical camera.

+ */ + ANDROID_LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID, + /** + * android.distortionCorrection.mode [dynamic, enum, public] + * + *

Mode of operation for the lens distortion correction block.

+ */ + ANDROID_DISTORTION_CORRECTION_MODE = CameraMetadataSectionStart.ANDROID_DISTORTION_CORRECTION_START, + /** + * android.distortionCorrection.availableModes [static, byte[], public] + * + *

List of distortion correction modes for ANDROID_DISTORTION_CORRECTION_MODE that are + * supported by this camera device.

+ * + * @see ANDROID_DISTORTION_CORRECTION_MODE + */ + ANDROID_DISTORTION_CORRECTION_AVAILABLE_MODES, + /** + * android.heic.availableHeicStreamConfigurations [static, enum[], ndk_public] + * + *

The available HEIC (ISO/IEC 23008-12) stream + * configurations that this camera device supports + * (i.e. format, width, height, output/input stream).

+ */ + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS = CameraMetadataSectionStart.ANDROID_HEIC_START, + /** + * android.heic.availableHeicMinFrameDurations [static, int64[], ndk_public] + * + *

This lists the minimum frame duration for each + * format/size combination for HEIC output formats.

+ */ + ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS, + /** + * android.heic.availableHeicStallDurations [static, int64[], ndk_public] + * + *

This lists the maximum stall duration for each + * output format/size combination for HEIC streams.

+ */ + ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS, + /** + * android.heic.availableHeicStreamConfigurationsMaximumResolution [static, enum[], ndk_public] + * + *

The available HEIC (ISO/IEC 23008-12) stream + * configurations that this camera device supports + * (i.e. format, width, height, output/input stream).

+ */ + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION, + /** + * android.heic.availableHeicMinFrameDurationsMaximumResolution [static, int64[], ndk_public] + * + *

This lists the minimum frame duration for each + * format/size combination for HEIC output formats for CaptureRequests where + * ANDROID_SENSOR_PIXEL_MODE is set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION, + /** + * android.heic.availableHeicStallDurationsMaximumResolution [static, int64[], ndk_public] + * + *

This lists the maximum stall duration for each + * output format/size combination for HEIC streams for CaptureRequests where + * ANDROID_SENSOR_PIXEL_MODE is set to + * CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION.

+ * + * @see ANDROID_SENSOR_PIXEL_MODE + */ + ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS_MAXIMUM_RESOLUTION, + /** + * android.heic.info.supported [static, enum, system] + * + *

Whether this camera device can support identical set of stream combinations + * involving HEIC image format, compared to the + * table of combinations + * involving JPEG image format required for the device's hardware level and capabilities.

+ */ + ANDROID_HEIC_INFO_SUPPORTED = CameraMetadataSectionStart.ANDROID_HEIC_INFO_START, + /** + * android.heic.info.maxJpegAppSegmentsCount [static, byte, system] + * + *

The maximum number of Jpeg APP segments supported by the camera HAL device.

+ */ + ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl new file mode 100644 index 0000000000..890ac0eac0 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl @@ -0,0 +1,35 @@ +/* + * 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.colorCorrection.aberrationMode enumeration values + * @see ANDROID_COLOR_CORRECTION_ABERRATION_MODE + */ +@VintfStability +@Backing(type="int") +enum ColorCorrectionAberrationMode { + ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF, + ANDROID_COLOR_CORRECTION_ABERRATION_MODE_FAST, + ANDROID_COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.aidl new file mode 100644 index 0000000000..33a0879457 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.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. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/* + * Enumeration definitions for the various entries that need them + * + * + * android.colorCorrection.mode enumeration values + * @see ANDROID_COLOR_CORRECTION_MODE + */ +@VintfStability +@Backing(type="int") +enum ColorCorrectionMode { + ANDROID_COLOR_CORRECTION_MODE_TRANSFORM_MATRIX, + ANDROID_COLOR_CORRECTION_MODE_FAST, + ANDROID_COLOR_CORRECTION_MODE_HIGH_QUALITY, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl new file mode 100644 index 0000000000..8a2f501d81 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl @@ -0,0 +1,36 @@ +/* + * 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.aeAntibandingMode enumeration values + * @see ANDROID_CONTROL_AE_ANTIBANDING_MODE + */ +@VintfStability +@Backing(type="int") +enum ControlAeAntibandingMode { + ANDROID_CONTROL_AE_ANTIBANDING_MODE_OFF, + ANDROID_CONTROL_AE_ANTIBANDING_MODE_50HZ, + ANDROID_CONTROL_AE_ANTIBANDING_MODE_60HZ, + ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLock.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLock.aidl new file mode 100644 index 0000000000..ab56fdc5f2 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLock.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.aeLock enumeration values + * @see ANDROID_CONTROL_AE_LOCK + */ +@VintfStability +@Backing(type="int") +enum ControlAeLock { + ANDROID_CONTROL_AE_LOCK_OFF, + ANDROID_CONTROL_AE_LOCK_ON, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLockAvailable.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLockAvailable.aidl new file mode 100644 index 0000000000..b846fc182a --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLockAvailable.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.aeLockAvailable enumeration values + * @see ANDROID_CONTROL_AE_LOCK_AVAILABLE + */ +@VintfStability +@Backing(type="int") +enum ControlAeLockAvailable { + ANDROID_CONTROL_AE_LOCK_AVAILABLE_FALSE, + ANDROID_CONTROL_AE_LOCK_AVAILABLE_TRUE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl new file mode 100644 index 0000000000..9a9d5bcf12 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.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. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/* + * Enumeration definitions for the various entries that need them + * + * + * android.control.aeMode enumeration values added + * @see ANDROID_CONTROL_AE_MODE + */ +@VintfStability +@Backing(type="int") +enum ControlAeMode { + ANDROID_CONTROL_AE_MODE_OFF, + ANDROID_CONTROL_AE_MODE_ON, + ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH, + ANDROID_CONTROL_AE_MODE_ON_ALWAYS_FLASH, + ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE, + ANDROID_CONTROL_AE_MODE_ON_EXTERNAL_FLASH, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl new file mode 100644 index 0000000000..2229712d9a --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl @@ -0,0 +1,35 @@ +/* + * 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.aePrecaptureTrigger enumeration values + * @see ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER + */ +@VintfStability +@Backing(type="int") +enum ControlAePrecaptureTrigger { + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_IDLE, + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_START, + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeState.aidl new file mode 100644 index 0000000000..af8c2cf38d --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeState.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. + */ + +/* + * 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.aeState enumeration values + * @see ANDROID_CONTROL_AE_STATE + */ +@VintfStability +@Backing(type="int") +enum ControlAeState { + ANDROID_CONTROL_AE_STATE_INACTIVE, + ANDROID_CONTROL_AE_STATE_SEARCHING, + ANDROID_CONTROL_AE_STATE_CONVERGED, + ANDROID_CONTROL_AE_STATE_LOCKED, + ANDROID_CONTROL_AE_STATE_FLASH_REQUIRED, + ANDROID_CONTROL_AE_STATE_PRECAPTURE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfMode.aidl new file mode 100644 index 0000000000..344f2de3f9 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfMode.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. + */ + +/* + * 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.afMode enumeration values + * @see ANDROID_CONTROL_AF_MODE + */ +@VintfStability +@Backing(type="int") +enum ControlAfMode { + ANDROID_CONTROL_AF_MODE_OFF, + ANDROID_CONTROL_AF_MODE_AUTO, + ANDROID_CONTROL_AF_MODE_MACRO, + ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO, + ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE, + ANDROID_CONTROL_AF_MODE_EDOF, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfSceneChange.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfSceneChange.aidl new file mode 100644 index 0000000000..153611a028 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfSceneChange.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.afSceneChange enumeration values + * @see ANDROID_CONTROL_AF_SCENE_CHANGE + */ +@VintfStability +@Backing(type="int") +enum ControlAfSceneChange { + ANDROID_CONTROL_AF_SCENE_CHANGE_NOT_DETECTED, + ANDROID_CONTROL_AF_SCENE_CHANGE_DETECTED, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfState.aidl new file mode 100644 index 0000000000..2c8d60201b --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfState.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. + */ + +/* + * 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.afState enumeration values + * @see ANDROID_CONTROL_AF_STATE + */ +@VintfStability +@Backing(type="int") +enum ControlAfState { + ANDROID_CONTROL_AF_STATE_INACTIVE, + ANDROID_CONTROL_AF_STATE_PASSIVE_SCAN, + ANDROID_CONTROL_AF_STATE_PASSIVE_FOCUSED, + ANDROID_CONTROL_AF_STATE_ACTIVE_SCAN, + ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED, + ANDROID_CONTROL_AF_STATE_NOT_FOCUSED_LOCKED, + ANDROID_CONTROL_AF_STATE_PASSIVE_UNFOCUSED, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfTrigger.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfTrigger.aidl new file mode 100644 index 0000000000..b68d4c7528 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfTrigger.aidl @@ -0,0 +1,35 @@ +/* + * 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.afTrigger enumeration values + * @see ANDROID_CONTROL_AF_TRIGGER + */ +@VintfStability +@Backing(type="int") +enum ControlAfTrigger { + ANDROID_CONTROL_AF_TRIGGER_IDLE, + ANDROID_CONTROL_AF_TRIGGER_START, + ANDROID_CONTROL_AF_TRIGGER_CANCEL, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLock.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLock.aidl new file mode 100644 index 0000000000..f7229f2034 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLock.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.awbLock enumeration values + * @see ANDROID_CONTROL_AWB_LOCK + */ +@VintfStability +@Backing(type="int") +enum ControlAwbLock { + ANDROID_CONTROL_AWB_LOCK_OFF, + ANDROID_CONTROL_AWB_LOCK_ON, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl new file mode 100644 index 0000000000..0cb6ebed7f --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLockAvailable.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.awbLockAvailable enumeration values + * @see ANDROID_CONTROL_AWB_LOCK_AVAILABLE + */ +@VintfStability +@Backing(type="int") +enum ControlAwbLockAvailable { + ANDROID_CONTROL_AWB_LOCK_AVAILABLE_FALSE, + ANDROID_CONTROL_AWB_LOCK_AVAILABLE_TRUE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbMode.aidl new file mode 100644 index 0000000000..2f9b801eec --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbMode.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. + */ + +/* + * 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.awbMode enumeration values + * @see ANDROID_CONTROL_AWB_MODE + */ +@VintfStability +@Backing(type="int") +enum ControlAwbMode { + ANDROID_CONTROL_AWB_MODE_OFF, + ANDROID_CONTROL_AWB_MODE_AUTO, + ANDROID_CONTROL_AWB_MODE_INCANDESCENT, + ANDROID_CONTROL_AWB_MODE_FLUORESCENT, + ANDROID_CONTROL_AWB_MODE_WARM_FLUORESCENT, + ANDROID_CONTROL_AWB_MODE_DAYLIGHT, + ANDROID_CONTROL_AWB_MODE_CLOUDY_DAYLIGHT, + ANDROID_CONTROL_AWB_MODE_TWILIGHT, + ANDROID_CONTROL_AWB_MODE_SHADE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbState.aidl new file mode 100644 index 0000000000..1a93191487 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbState.aidl @@ -0,0 +1,36 @@ +/* + * 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.awbState enumeration values + * @see ANDROID_CONTROL_AWB_STATE + */ +@VintfStability +@Backing(type="int") +enum ControlAwbState { + ANDROID_CONTROL_AWB_STATE_INACTIVE, + ANDROID_CONTROL_AWB_STATE_SEARCHING, + ANDROID_CONTROL_AWB_STATE_CONVERGED, + ANDROID_CONTROL_AWB_STATE_LOCKED, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlCaptureIntent.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlCaptureIntent.aidl new file mode 100644 index 0000000000..132d98c1d7 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlCaptureIntent.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. + */ + +/* + * 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.captureIntent enumeration values + * @see ANDROID_CONTROL_CAPTURE_INTENT + */ +@VintfStability +@Backing(type="int") +enum ControlCaptureIntent { + ANDROID_CONTROL_CAPTURE_INTENT_CUSTOM, + ANDROID_CONTROL_CAPTURE_INTENT_PREVIEW, + ANDROID_CONTROL_CAPTURE_INTENT_STILL_CAPTURE, + ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_RECORD, + ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT, + ANDROID_CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG, + ANDROID_CONTROL_CAPTURE_INTENT_MANUAL, + ANDROID_CONTROL_CAPTURE_INTENT_MOTION_TRACKING, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlEffectMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlEffectMode.aidl new file mode 100644 index 0000000000..1668cb390b --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlEffectMode.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. + */ + +/* + * 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.effectMode enumeration values + * @see ANDROID_CONTROL_EFFECT_MODE + */ +@VintfStability +@Backing(type="int") +enum ControlEffectMode { + ANDROID_CONTROL_EFFECT_MODE_OFF, + ANDROID_CONTROL_EFFECT_MODE_MONO, + ANDROID_CONTROL_EFFECT_MODE_NEGATIVE, + ANDROID_CONTROL_EFFECT_MODE_SOLARIZE, + ANDROID_CONTROL_EFFECT_MODE_SEPIA, + ANDROID_CONTROL_EFFECT_MODE_POSTERIZE, + ANDROID_CONTROL_EFFECT_MODE_WHITEBOARD, + ANDROID_CONTROL_EFFECT_MODE_BLACKBOARD, + ANDROID_CONTROL_EFFECT_MODE_AQUA, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlEnableZsl.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlEnableZsl.aidl new file mode 100644 index 0000000000..a83c05164c --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlEnableZsl.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.enableZsl enumeration values + * @see ANDROID_CONTROL_ENABLE_ZSL + */ +@VintfStability +@Backing(type="int") +enum ControlEnableZsl { + ANDROID_CONTROL_ENABLE_ZSL_FALSE, + ANDROID_CONTROL_ENABLE_ZSL_TRUE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl new file mode 100644 index 0000000000..2fe66cffd7 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl @@ -0,0 +1,36 @@ +/* + * 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.extendedSceneMode enumeration values + * @see ANDROID_CONTROL_EXTENDED_SCENE_MODE + */ +@VintfStability +@Backing(type="int") +enum ControlExtendedSceneMode { + ANDROID_CONTROL_EXTENDED_SCENE_MODE_DISABLED = 0, + ANDROID_CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE, + ANDROID_CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS, + ANDROID_CONTROL_EXTENDED_SCENE_MODE_VENDOR_START = 0x40, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.aidl new file mode 100644 index 0000000000..047556dc73 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.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. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/* + * Enumeration definitions for the various entries that need them + * + * + * android.control.mode enumeration values + * @see ANDROID_CONTROL_MODE + */ +@VintfStability +@Backing(type="int") +enum ControlMode { + ANDROID_CONTROL_MODE_OFF, + ANDROID_CONTROL_MODE_AUTO, + ANDROID_CONTROL_MODE_USE_SCENE_MODE, + ANDROID_CONTROL_MODE_OFF_KEEP_STATE, + ANDROID_CONTROL_MODE_USE_EXTENDED_SCENE_MODE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlSceneMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlSceneMode.aidl new file mode 100644 index 0000000000..0f90aaad2b --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlSceneMode.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. + */ + +/* + * 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.sceneMode enumeration values + * @see ANDROID_CONTROL_SCENE_MODE + */ +@VintfStability +@Backing(type="int") +enum ControlSceneMode { + ANDROID_CONTROL_SCENE_MODE_DISABLED = 0, + ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY, + ANDROID_CONTROL_SCENE_MODE_ACTION, + ANDROID_CONTROL_SCENE_MODE_PORTRAIT, + ANDROID_CONTROL_SCENE_MODE_LANDSCAPE, + ANDROID_CONTROL_SCENE_MODE_NIGHT, + ANDROID_CONTROL_SCENE_MODE_NIGHT_PORTRAIT, + ANDROID_CONTROL_SCENE_MODE_THEATRE, + ANDROID_CONTROL_SCENE_MODE_BEACH, + ANDROID_CONTROL_SCENE_MODE_SNOW, + ANDROID_CONTROL_SCENE_MODE_SUNSET, + ANDROID_CONTROL_SCENE_MODE_STEADYPHOTO, + ANDROID_CONTROL_SCENE_MODE_FIREWORKS, + ANDROID_CONTROL_SCENE_MODE_SPORTS, + ANDROID_CONTROL_SCENE_MODE_PARTY, + ANDROID_CONTROL_SCENE_MODE_CANDLELIGHT, + ANDROID_CONTROL_SCENE_MODE_BARCODE, + ANDROID_CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO, + ANDROID_CONTROL_SCENE_MODE_HDR, + ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY_LOW_LIGHT, + ANDROID_CONTROL_SCENE_MODE_DEVICE_CUSTOM_START = 100, + ANDROID_CONTROL_SCENE_MODE_DEVICE_CUSTOM_END = 127, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl new file mode 100644 index 0000000000..4046c4e926 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.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. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/* + * Enumeration definitions for the various entries that need them + * + * + * android.control.videoStabilizationMode enumeration values + * @see ANDROID_CONTROL_VIDEO_STABILIZATION_MODE + */ +@VintfStability +@Backing(type="int") +enum ControlVideoStabilizationMode { + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF, + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_ON, + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DemosaicMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DemosaicMode.aidl new file mode 100644 index 0000000000..7d8cdcf588 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/DemosaicMode.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.demosaic.mode enumeration values + * @see ANDROID_DEMOSAIC_MODE + */ +@VintfStability +@Backing(type="int") +enum DemosaicMode { + ANDROID_DEMOSAIC_MODE_FAST, + ANDROID_DEMOSAIC_MODE_HIGH_QUALITY, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl new file mode 100644 index 0000000000..7deb350045 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.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.depth.availableDepthStreamConfigurations enumeration values + * @see ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS + */ +@VintfStability +@Backing(type="int") +enum DepthAvailableDepthStreamConfigurations { + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_INPUT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl new file mode 100644 index 0000000000..5d06be1782 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.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.depth.availableDepthStreamConfigurationsMaximumResolution enumeration values + * @see ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION + */ +@VintfStability +@Backing(type="int") +enum DepthAvailableDepthStreamConfigurationsMaximumResolution { + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl new file mode 100644 index 0000000000..39a99b963e --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.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.depth.availableDynamicDepthStreamConfigurations enumeration values + * @see ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS + */ +@VintfStability +@Backing(type="int") +enum DepthAvailableDynamicDepthStreamConfigurations { + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_OUTPUT, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_INPUT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl new file mode 100644 index 0000000000..30ea9b71b5 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.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.depth.availableDynamicDepthStreamConfigurationsMaximumResolution enumeration values + * @see ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION + */ +@VintfStability +@Backing(type="int") +enum DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution { + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl new file mode 100644 index 0000000000..4af81d9c89 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthDepthIsExclusive.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.depth.depthIsExclusive enumeration values + * @see ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE + */ +@VintfStability +@Backing(type="int") +enum DepthDepthIsExclusive { + ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE_FALSE, + ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE_TRUE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DistortionCorrectionMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DistortionCorrectionMode.aidl new file mode 100644 index 0000000000..3456207757 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/DistortionCorrectionMode.aidl @@ -0,0 +1,35 @@ +/* + * 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.distortionCorrection.mode enumeration values + * @see ANDROID_DISTORTION_CORRECTION_MODE + */ +@VintfStability +@Backing(type="int") +enum DistortionCorrectionMode { + ANDROID_DISTORTION_CORRECTION_MODE_OFF, + ANDROID_DISTORTION_CORRECTION_MODE_FAST, + ANDROID_DISTORTION_CORRECTION_MODE_HIGH_QUALITY, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/EdgeMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/EdgeMode.aidl new file mode 100644 index 0000000000..1e155233a3 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/EdgeMode.aidl @@ -0,0 +1,36 @@ +/* + * 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.edge.mode enumeration values + * @see ANDROID_EDGE_MODE + */ +@VintfStability +@Backing(type="int") +enum EdgeMode { + ANDROID_EDGE_MODE_OFF, + ANDROID_EDGE_MODE_FAST, + ANDROID_EDGE_MODE_HIGH_QUALITY, + ANDROID_EDGE_MODE_ZERO_SHUTTER_LAG, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/FlashInfoAvailable.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/FlashInfoAvailable.aidl new file mode 100644 index 0000000000..05280377c7 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/FlashInfoAvailable.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.flash.info.available enumeration values + * @see ANDROID_FLASH_INFO_AVAILABLE + */ +@VintfStability +@Backing(type="int") +enum FlashInfoAvailable { + ANDROID_FLASH_INFO_AVAILABLE_FALSE, + ANDROID_FLASH_INFO_AVAILABLE_TRUE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/FlashMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/FlashMode.aidl new file mode 100644 index 0000000000..e17559699d --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/FlashMode.aidl @@ -0,0 +1,35 @@ +/* + * 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.flash.mode enumeration values + * @see ANDROID_FLASH_MODE + */ +@VintfStability +@Backing(type="int") +enum FlashMode { + ANDROID_FLASH_MODE_OFF, + ANDROID_FLASH_MODE_SINGLE, + ANDROID_FLASH_MODE_TORCH, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/FlashState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/FlashState.aidl new file mode 100644 index 0000000000..fc398f8f06 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/FlashState.aidl @@ -0,0 +1,37 @@ +/* + * 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.flash.state enumeration values + * @see ANDROID_FLASH_STATE + */ +@VintfStability +@Backing(type="int") +enum FlashState { + ANDROID_FLASH_STATE_UNAVAILABLE, + ANDROID_FLASH_STATE_CHARGING, + ANDROID_FLASH_STATE_READY, + ANDROID_FLASH_STATE_FIRED, + ANDROID_FLASH_STATE_PARTIAL, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl new file mode 100644 index 0000000000..fc9b6ecc4f --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.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.heic.availableHeicStreamConfigurations enumeration values + * @see ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS + */ +@VintfStability +@Backing(type="int") +enum HeicAvailableHeicStreamConfigurations { + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_OUTPUT, + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_INPUT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl new file mode 100644 index 0000000000..13b50ab5ad --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.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.heic.availableHeicStreamConfigurationsMaximumResolution enumeration values + * @see ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION + */ +@VintfStability +@Backing(type="int") +enum HeicAvailableHeicStreamConfigurationsMaximumResolution { + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT, + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/HeicInfoSupported.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/HeicInfoSupported.aidl new file mode 100644 index 0000000000..c4e04f1ac0 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/HeicInfoSupported.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.heic.info.supported enumeration values + * @see ANDROID_HEIC_INFO_SUPPORTED + */ +@VintfStability +@Backing(type="int") +enum HeicInfoSupported { + ANDROID_HEIC_INFO_SUPPORTED_FALSE, + ANDROID_HEIC_INFO_SUPPORTED_TRUE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/HotPixelMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/HotPixelMode.aidl new file mode 100644 index 0000000000..7b7aa215a9 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/HotPixelMode.aidl @@ -0,0 +1,35 @@ +/* + * 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.hotPixel.mode enumeration values + * @see ANDROID_HOT_PIXEL_MODE + */ +@VintfStability +@Backing(type="int") +enum HotPixelMode { + ANDROID_HOT_PIXEL_MODE_OFF, + ANDROID_HOT_PIXEL_MODE_FAST, + ANDROID_HOT_PIXEL_MODE_HIGH_QUALITY, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl new file mode 100644 index 0000000000..9522377c6c --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl @@ -0,0 +1,33 @@ +/* + * 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.info.supportedBufferManagementVersion enumeration values + * @see ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION + */ +@VintfStability +@Backing(type="int") +enum InfoSupportedBufferManagementVersion { + ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_AIDL_DEVICE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl new file mode 100644 index 0000000000..f242009943 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl @@ -0,0 +1,37 @@ +/* + * 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.info.supportedHardwareLevel enumeration values + * @see ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL + */ +@VintfStability +@Backing(type="int") +enum InfoSupportedHardwareLevel { + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_3, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LedAvailableLeds.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LedAvailableLeds.aidl new file mode 100644 index 0000000000..f26fcde890 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/LedAvailableLeds.aidl @@ -0,0 +1,33 @@ +/* + * 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.led.availableLeds enumeration values + * @see ANDROID_LED_AVAILABLE_LEDS + */ +@VintfStability +@Backing(type="int") +enum LedAvailableLeds { + ANDROID_LED_AVAILABLE_LEDS_TRANSMIT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LedTransmit.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LedTransmit.aidl new file mode 100644 index 0000000000..62c9bd7875 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/LedTransmit.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.led.transmit enumeration values + * @see ANDROID_LED_TRANSMIT + */ +@VintfStability +@Backing(type="int") +enum LedTransmit { + ANDROID_LED_TRANSMIT_OFF, + ANDROID_LED_TRANSMIT_ON, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensFacing.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensFacing.aidl new file mode 100644 index 0000000000..0677ea9372 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensFacing.aidl @@ -0,0 +1,35 @@ +/* + * 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.lens.facing enumeration values + * @see ANDROID_LENS_FACING + */ +@VintfStability +@Backing(type="int") +enum LensFacing { + ANDROID_LENS_FACING_FRONT, + ANDROID_LENS_FACING_BACK, + ANDROID_LENS_FACING_EXTERNAL, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl new file mode 100644 index 0000000000..1c82bb03e4 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl @@ -0,0 +1,35 @@ +/* + * 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.lens.info.focusDistanceCalibration enumeration values + * @see ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION + */ +@VintfStability +@Backing(type="int") +enum LensInfoFocusDistanceCalibration { + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED, + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE, + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl new file mode 100644 index 0000000000..e350e1599d --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensOpticalStabilizationMode.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.lens.opticalStabilizationMode enumeration values + * @see ANDROID_LENS_OPTICAL_STABILIZATION_MODE + */ +@VintfStability +@Backing(type="int") +enum LensOpticalStabilizationMode { + ANDROID_LENS_OPTICAL_STABILIZATION_MODE_OFF, + ANDROID_LENS_OPTICAL_STABILIZATION_MODE_ON, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl new file mode 100644 index 0000000000..ca18676303 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl @@ -0,0 +1,35 @@ +/* + * 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.lens.poseReference enumeration values + * @see ANDROID_LENS_POSE_REFERENCE + */ +@VintfStability +@Backing(type="int") +enum LensPoseReference { + ANDROID_LENS_POSE_REFERENCE_PRIMARY_CAMERA, + ANDROID_LENS_POSE_REFERENCE_GYROSCOPE, + ANDROID_LENS_POSE_REFERENCE_UNDEFINED, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensState.aidl new file mode 100644 index 0000000000..0e5a04c45c --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensState.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.lens.state enumeration values + * @see ANDROID_LENS_STATE + */ +@VintfStability +@Backing(type="int") +enum LensState { + ANDROID_LENS_STATE_STATIONARY, + ANDROID_LENS_STATE_MOVING, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl new file mode 100644 index 0000000000..623a15cc0f --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.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.logicalMultiCamera.sensorSyncType enumeration values + * @see ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE + */ +@VintfStability +@Backing(type="int") +enum LogicalMultiCameraSensorSyncType { + ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE, + ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/NoiseReductionMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/NoiseReductionMode.aidl new file mode 100644 index 0000000000..947361d41c --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/NoiseReductionMode.aidl @@ -0,0 +1,37 @@ +/* + * 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.noiseReduction.mode enumeration values + * @see ANDROID_NOISE_REDUCTION_MODE + */ +@VintfStability +@Backing(type="int") +enum NoiseReductionMode { + ANDROID_NOISE_REDUCTION_MODE_OFF, + ANDROID_NOISE_REDUCTION_MODE_FAST, + ANDROID_NOISE_REDUCTION_MODE_HIGH_QUALITY, + ANDROID_NOISE_REDUCTION_MODE_MINIMAL, + ANDROID_NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/QuirksPartialResult.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/QuirksPartialResult.aidl new file mode 100644 index 0000000000..15a79b0969 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/QuirksPartialResult.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.quirks.partialResult enumeration values + * @see ANDROID_QUIRKS_PARTIAL_RESULT + */ +@VintfStability +@Backing(type="int") +enum QuirksPartialResult { + ANDROID_QUIRKS_PARTIAL_RESULT_FINAL, + ANDROID_QUIRKS_PARTIAL_RESULT_PARTIAL, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl new file mode 100644 index 0000000000..89f14add1c --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.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. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.request.availableCapabilities enumeration values + * @see ANDROID_REQUEST_AVAILABLE_CAPABILITIES + */ +@VintfStability +@Backing(type="int") +enum RequestAvailableCapabilities { + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_OFFLINE_PROCESSING, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_REMOSAIC_REPROCESSING, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl new file mode 100644 index 0000000000..c0ef8c663a --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.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. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.request.availableDynamicRangeProfilesMap enumeration values + * @see ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP + */ +@VintfStability +@Backing(type="int") +enum RequestAvailableDynamicRangeProfilesMap { + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD = 0x1, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10 = 0x2, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10 = 0x4, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS = 0x8, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF = 0x10, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO = 0x20, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM = 0x40, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO = 0x80, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF = 0x100, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO = 0x200, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM = 0x400, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO = 0x800, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_MAX = 0x1000, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestMetadataMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestMetadataMode.aidl new file mode 100644 index 0000000000..37d40957e5 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestMetadataMode.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.request.metadataMode enumeration values + * @see ANDROID_REQUEST_METADATA_MODE + */ +@VintfStability +@Backing(type="int") +enum RequestMetadataMode { + ANDROID_REQUEST_METADATA_MODE_NONE, + ANDROID_REQUEST_METADATA_MODE_FULL, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestType.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestType.aidl new file mode 100644 index 0000000000..5010a37c93 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestType.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.request.type enumeration values + * @see ANDROID_REQUEST_TYPE + */ +@VintfStability +@Backing(type="int") +enum RequestType { + ANDROID_REQUEST_TYPE_CAPTURE, + ANDROID_REQUEST_TYPE_REPROCESS, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableFormats.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableFormats.aidl new file mode 100644 index 0000000000..a8e67bbab9 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableFormats.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. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.scaler.availableFormats enumeration values + * @see ANDROID_SCALER_AVAILABLE_FORMATS + */ +@VintfStability +@Backing(type="int") +enum ScalerAvailableFormats { + ANDROID_SCALER_AVAILABLE_FORMATS_RAW16 = 0x20, + ANDROID_SCALER_AVAILABLE_FORMATS_RAW_OPAQUE = 0x24, + ANDROID_SCALER_AVAILABLE_FORMATS_YV12 = 0x32315659, + ANDROID_SCALER_AVAILABLE_FORMATS_YCrCb_420_SP = 0x11, + ANDROID_SCALER_AVAILABLE_FORMATS_IMPLEMENTATION_DEFINED = 0x22, + ANDROID_SCALER_AVAILABLE_FORMATS_YCbCr_420_888 = 0x23, + ANDROID_SCALER_AVAILABLE_FORMATS_BLOB = 0x21, + ANDROID_SCALER_AVAILABLE_FORMATS_RAW10 = 0x25, + ANDROID_SCALER_AVAILABLE_FORMATS_RAW12 = 0x26, + ANDROID_SCALER_AVAILABLE_FORMATS_Y8 = 0x20203859, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl new file mode 100644 index 0000000000..57c398928a --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.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. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.scaler.availableRecommendedStreamConfigurations enumeration values + * @see ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS + */ +@VintfStability +@Backing(type="int") +enum ScalerAvailableRecommendedStreamConfigurations { + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PREVIEW = 0x0, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RECORD = 0x1, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VIDEO_SNAPSHOT = 0x2, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_SNAPSHOT = 0x3, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_ZSL = 0x4, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RAW = 0x5, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_LOW_LATENCY_SNAPSHOT = 0x6, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_10BIT_OUTPUT = 0x8, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VENDOR_START = 0x18, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl new file mode 100644 index 0000000000..2b493ae6eb --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.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.scaler.availableStreamConfigurations enumeration values + * @see ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS + */ +@VintfStability +@Backing(type="int") +enum ScalerAvailableStreamConfigurations { + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl new file mode 100644 index 0000000000..4f6cb5eedc --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.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.scaler.availableStreamConfigurationsMaximumResolution enumeration values + * @see ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION + */ +@VintfStability +@Backing(type="int") +enum ScalerAvailableStreamConfigurationsMaximumResolution { + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerCroppingType.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerCroppingType.aidl new file mode 100644 index 0000000000..e44eff16e4 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerCroppingType.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.scaler.croppingType enumeration values + * @see ANDROID_SCALER_CROPPING_TYPE + */ +@VintfStability +@Backing(type="int") +enum ScalerCroppingType { + ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY, + ANDROID_SCALER_CROPPING_TYPE_FREEFORM, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl new file mode 100644 index 0000000000..f7cbc0fe16 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.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.scaler.multiResolutionStreamSupported enumeration values + * @see ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED + */ +@VintfStability +@Backing(type="int") +enum ScalerMultiResolutionStreamSupported { + ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED_FALSE, + ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED_TRUE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl new file mode 100644 index 0000000000..9427854a63 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.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.scaler.physicalCameraMultiResolutionStreamConfigurations enumeration values + * @see ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS + */ +@VintfStability +@Backing(type="int") +enum ScalerPhysicalCameraMultiResolutionStreamConfigurations { + ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS_OUTPUT, + ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS_INPUT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl new file mode 100644 index 0000000000..905015374c --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl @@ -0,0 +1,37 @@ +/* + * 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.scaler.rotateAndCrop enumeration values + * @see ANDROID_SCALER_ROTATE_AND_CROP + */ +@VintfStability +@Backing(type="int") +enum ScalerRotateAndCrop { + ANDROID_SCALER_ROTATE_AND_CROP_NONE, + ANDROID_SCALER_ROTATE_AND_CROP_90, + ANDROID_SCALER_ROTATE_AND_CROP_180, + ANDROID_SCALER_ROTATE_AND_CROP_270, + ANDROID_SCALER_ROTATE_AND_CROP_AUTO, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl new file mode 100644 index 0000000000..59a4038ea0 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.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. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.sensor.info.colorFilterArrangement enumeration values + * @see ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT + */ +@VintfStability +@Backing(type="int") +enum SensorInfoColorFilterArrangement { + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl new file mode 100644 index 0000000000..8892ad33d1 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoLensShadingApplied.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.sensor.info.lensShadingApplied enumeration values + * @see ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED + */ +@VintfStability +@Backing(type="int") +enum SensorInfoLensShadingApplied { + ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED_FALSE, + ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED_TRUE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl new file mode 100644 index 0000000000..2a5860b023 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoTimestampSource.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.sensor.info.timestampSource enumeration values + * @see ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE + */ +@VintfStability +@Backing(type="int") +enum SensorInfoTimestampSource { + ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN, + ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorPixelMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorPixelMode.aidl new file mode 100644 index 0000000000..3dda07ba1e --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorPixelMode.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.sensor.pixelMode enumeration values + * @see ANDROID_SENSOR_PIXEL_MODE + */ +@VintfStability +@Backing(type="int") +enum SensorPixelMode { + ANDROID_SENSOR_PIXEL_MODE_DEFAULT, + ANDROID_SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl new file mode 100644 index 0000000000..20e92e4311 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorRawBinningFactorUsed.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.sensor.rawBinningFactorUsed enumeration values + * @see ANDROID_SENSOR_RAW_BINNING_FACTOR_USED + */ +@VintfStability +@Backing(type="int") +enum SensorRawBinningFactorUsed { + ANDROID_SENSOR_RAW_BINNING_FACTOR_USED_TRUE, + ANDROID_SENSOR_RAW_BINNING_FACTOR_USED_FALSE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl new file mode 100644 index 0000000000..c8c92167d5 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorReferenceIlluminant1.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. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.sensor.referenceIlluminant1 enumeration values + * @see ANDROID_SENSOR_REFERENCE_ILLUMINANT1 + */ +@VintfStability +@Backing(type="int") +enum SensorReferenceIlluminant1 { + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT = 1, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT = 2, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN = 3, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FLASH = 4, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER = 9, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER = 10, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_SHADE = 11, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT = 12, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT = 13, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT = 14, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT = 15, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A = 17, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B = 18, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C = 19, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D55 = 20, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D65 = 21, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D75 = 22, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D50 = 23, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN = 24, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.aidl new file mode 100644 index 0000000000..c9ca70aa48 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.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. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.sensor.testPatternMode enumeration values + * @see ANDROID_SENSOR_TEST_PATTERN_MODE + */ +@VintfStability +@Backing(type="int") +enum SensorTestPatternMode { + ANDROID_SENSOR_TEST_PATTERN_MODE_OFF, + ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR, + ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS, + ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY, + ANDROID_SENSOR_TEST_PATTERN_MODE_PN9, + ANDROID_SENSOR_TEST_PATTERN_MODE_CUSTOM1 = 256, + ANDROID_SENSOR_TEST_PATTERN_MODE_BLACK, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ShadingMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ShadingMode.aidl new file mode 100644 index 0000000000..6939b72fdc --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ShadingMode.aidl @@ -0,0 +1,35 @@ +/* + * 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.shading.mode enumeration values + * @see ANDROID_SHADING_MODE + */ +@VintfStability +@Backing(type="int") +enum ShadingMode { + ANDROID_SHADING_MODE_OFF, + ANDROID_SHADING_MODE_FAST, + ANDROID_SHADING_MODE_HIGH_QUALITY, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl new file mode 100644 index 0000000000..0d177919d6 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl @@ -0,0 +1,35 @@ +/* + * 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.statistics.faceDetectMode enumeration values + * @see ANDROID_STATISTICS_FACE_DETECT_MODE + */ +@VintfStability +@Backing(type="int") +enum StatisticsFaceDetectMode { + ANDROID_STATISTICS_FACE_DETECT_MODE_OFF, + ANDROID_STATISTICS_FACE_DETECT_MODE_SIMPLE, + ANDROID_STATISTICS_FACE_DETECT_MODE_FULL, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHistogramMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHistogramMode.aidl new file mode 100644 index 0000000000..a9b6f68dad --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHistogramMode.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.statistics.histogramMode enumeration values + * @see ANDROID_STATISTICS_HISTOGRAM_MODE + */ +@VintfStability +@Backing(type="int") +enum StatisticsHistogramMode { + ANDROID_STATISTICS_HISTOGRAM_MODE_OFF, + ANDROID_STATISTICS_HISTOGRAM_MODE_ON, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl new file mode 100644 index 0000000000..286291a851 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHotPixelMapMode.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.statistics.hotPixelMapMode enumeration values + * @see ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE + */ +@VintfStability +@Backing(type="int") +enum StatisticsHotPixelMapMode { + ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE_OFF, + ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE_ON, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl new file mode 100644 index 0000000000..d21b2227f9 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsLensShadingMapMode.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.statistics.lensShadingMapMode enumeration values + * @see ANDROID_STATISTICS_LENS_SHADING_MAP_MODE + */ +@VintfStability +@Backing(type="int") +enum StatisticsLensShadingMapMode { + ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF, + ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_ON, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsOisDataMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsOisDataMode.aidl new file mode 100644 index 0000000000..afb281f909 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsOisDataMode.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.statistics.oisDataMode enumeration values + * @see ANDROID_STATISTICS_OIS_DATA_MODE + */ +@VintfStability +@Backing(type="int") +enum StatisticsOisDataMode { + ANDROID_STATISTICS_OIS_DATA_MODE_OFF, + ANDROID_STATISTICS_OIS_DATA_MODE_ON, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl new file mode 100644 index 0000000000..da2402af07 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl @@ -0,0 +1,35 @@ +/* + * 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.statistics.sceneFlicker enumeration values + * @see ANDROID_STATISTICS_SCENE_FLICKER + */ +@VintfStability +@Backing(type="int") +enum StatisticsSceneFlicker { + ANDROID_STATISTICS_SCENE_FLICKER_NONE, + ANDROID_STATISTICS_SCENE_FLICKER_50HZ, + ANDROID_STATISTICS_SCENE_FLICKER_60HZ, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl new file mode 100644 index 0000000000..ed6c65ccb3 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSharpnessMapMode.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.statistics.sharpnessMapMode enumeration values + * @see ANDROID_STATISTICS_SHARPNESS_MAP_MODE + */ +@VintfStability +@Backing(type="int") +enum StatisticsSharpnessMapMode { + ANDROID_STATISTICS_SHARPNESS_MAP_MODE_OFF, + ANDROID_STATISTICS_SHARPNESS_MAP_MODE_ON, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SyncFrameNumber.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SyncFrameNumber.aidl new file mode 100644 index 0000000000..e33319e3d0 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/SyncFrameNumber.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.sync.frameNumber enumeration values + * @see ANDROID_SYNC_FRAME_NUMBER + */ +@VintfStability +@Backing(type="int") +enum SyncFrameNumber { + ANDROID_SYNC_FRAME_NUMBER_CONVERGING = -1, + ANDROID_SYNC_FRAME_NUMBER_UNKNOWN = -2, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SyncMaxLatency.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SyncMaxLatency.aidl new file mode 100644 index 0000000000..cb0668fcab --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/SyncMaxLatency.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.sync.maxLatency enumeration values + * @see ANDROID_SYNC_MAX_LATENCY + */ +@VintfStability +@Backing(type="int") +enum SyncMaxLatency { + ANDROID_SYNC_MAX_LATENCY_PER_FRAME_CONTROL = 0, + ANDROID_SYNC_MAX_LATENCY_UNKNOWN = -1, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/TonemapMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/TonemapMode.aidl new file mode 100644 index 0000000000..d4b7e0ebce --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/TonemapMode.aidl @@ -0,0 +1,37 @@ +/* + * 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.tonemap.mode enumeration values + * @see ANDROID_TONEMAP_MODE + */ +@VintfStability +@Backing(type="int") +enum TonemapMode { + ANDROID_TONEMAP_MODE_CONTRAST_CURVE, + ANDROID_TONEMAP_MODE_FAST, + ANDROID_TONEMAP_MODE_HIGH_QUALITY, + ANDROID_TONEMAP_MODE_GAMMA_VALUE, + ANDROID_TONEMAP_MODE_PRESET_CURVE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/TonemapPresetCurve.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/TonemapPresetCurve.aidl new file mode 100644 index 0000000000..2da3704348 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/TonemapPresetCurve.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.tonemap.presetCurve enumeration values + * @see ANDROID_TONEMAP_PRESET_CURVE + */ +@VintfStability +@Backing(type="int") +enum TonemapPresetCurve { + ANDROID_TONEMAP_PRESET_CURVE_SRGB, + ANDROID_TONEMAP_PRESET_CURVE_REC709, +} diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp index 414c502fd7..8eed19532f 100644 --- a/compatibility_matrices/exclude/fcm_exclude.cpp +++ b/compatibility_matrices/exclude/fcm_exclude.cpp @@ -53,7 +53,8 @@ bool ShouldCheckMissingHalsInFcm(const std::string& package) { // AIDL "android.hardware.audio.common", "android.hardware.biometrics.common", - "android.hardware.common", + "android.hardware.biometrics.common", + "android.hardware.camera.metadata", "android.hardware.common.fmq", "android.hardware.graphics.common", "android.hardware.input.common", -- GitLab From 75aec9028aa76bab37ebd62bf791595a8e930cd4 Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Wed, 3 Nov 2021 12:16:37 -0700 Subject: [PATCH 570/825] Add AIDL interfaces for camera HAL provider. Bug: 196432585 Test: build; Implementation will be submitted later. Change-Id: Ia50fe0502c811dddd706781c653f038e0415eb4d Signed-off-by: Jayant Chowdhary --- camera/provider/aidl/Android.bp | 34 ++ .../CameraIdAndStreamCombination.aidl | 39 +++ .../ConcurrentCameraIdCombination.aidl | 38 +++ .../camera/provider/ICameraProvider.aidl | 48 +++ .../provider/ICameraProviderCallback.aidl | 40 +++ .../CameraIdAndStreamCombination.aidl | 26 ++ .../ConcurrentCameraIdCombination.aidl | 22 ++ .../camera/provider/ICameraProvider.aidl | 308 ++++++++++++++++++ .../provider/ICameraProviderCallback.aidl | 85 +++++ .../compatibility_matrix.current.xml | 8 + 10 files changed, 648 insertions(+) create mode 100644 camera/provider/aidl/Android.bp create mode 100644 camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl create mode 100644 camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl create mode 100644 camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ICameraProvider.aidl create mode 100644 camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ICameraProviderCallback.aidl create mode 100644 camera/provider/aidl/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl create mode 100644 camera/provider/aidl/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl create mode 100644 camera/provider/aidl/android/hardware/camera/provider/ICameraProvider.aidl create mode 100644 camera/provider/aidl/android/hardware/camera/provider/ICameraProviderCallback.aidl diff --git a/camera/provider/aidl/Android.bp b/camera/provider/aidl/Android.bp new file mode 100644 index 0000000000..6f1b7815b3 --- /dev/null +++ b/camera/provider/aidl/Android.bp @@ -0,0 +1,34 @@ +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.camera.provider", + vendor_available: true, + srcs: [ + "android/hardware/camera/provider/*.aidl", + ], + imports: [ + "android.hardware.camera.device", + "android.hardware.camera.common" + ], + stability: "vintf", + backend: { + java: { + enabled: false, + }, + cpp: { + enabled: false, + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, +} diff --git a/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl new file mode 100644 index 0000000000..df77c40a28 --- /dev/null +++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/CameraIdAndStreamCombination.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 -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.provider; +@VintfStability +parcelable CameraIdAndStreamCombination { + String cameraId; + android.hardware.camera.device.StreamConfiguration streamConfiguration; +} diff --git a/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl new file mode 100644 index 0000000000..334fb2c827 --- /dev/null +++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ConcurrentCameraIdCombination.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 -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.provider; +@VintfStability +parcelable ConcurrentCameraIdCombination { + List combination; +} diff --git a/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ICameraProvider.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ICameraProvider.aidl new file mode 100644 index 0000000000..c15bdee62b --- /dev/null +++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ICameraProvider.aidl @@ -0,0 +1,48 @@ +/* + * 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 -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.provider; +@VintfStability +interface ICameraProvider { + void setCallback(android.hardware.camera.provider.ICameraProviderCallback callback); + android.hardware.camera.common.VendorTagSection[] getVendorTags(); + String[] getCameraIdList(); + android.hardware.camera.device.ICameraDevice getCameraDeviceInterface(String cameraDeviceName); + void notifyDeviceStateChange(long deviceState); + android.hardware.camera.provider.ConcurrentCameraIdCombination[] getConcurrentCameraIds(); + boolean isConcurrentStreamCombinationSupported(in android.hardware.camera.provider.CameraIdAndStreamCombination[] configs); + const long DEVICE_STATE_NORMAL = 0; + const long DEVICE_STATE_BACK_COVERED = 1; + const long DEVICE_STATE_FRONT_COVERED = 2; + const long DEVICE_STATE_FOLDED = 4; +} diff --git a/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ICameraProviderCallback.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ICameraProviderCallback.aidl new file mode 100644 index 0000000000..d3c53f5bc2 --- /dev/null +++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/current/android/hardware/camera/provider/ICameraProviderCallback.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 -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.provider; +@VintfStability +interface ICameraProviderCallback { + void cameraDeviceStatusChange(String cameraDeviceName, android.hardware.camera.common.CameraDeviceStatus newStatus); + void torchModeStatusChange(String cameraDeviceName, android.hardware.camera.common.TorchModeStatus newStatus); + void physicalCameraDeviceStatusChange(String cameraDeviceName, String physicalCameraDeviceName, android.hardware.camera.common.CameraDeviceStatus newStatus); +} diff --git a/camera/provider/aidl/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl b/camera/provider/aidl/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl new file mode 100644 index 0000000000..36b48e1dd8 --- /dev/null +++ b/camera/provider/aidl/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.provider; + +import android.hardware.camera.device.StreamConfiguration; + +@VintfStability +parcelable CameraIdAndStreamCombination { + String cameraId; + + StreamConfiguration streamConfiguration; +} diff --git a/camera/provider/aidl/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl b/camera/provider/aidl/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl new file mode 100644 index 0000000000..7d8e48635e --- /dev/null +++ b/camera/provider/aidl/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.provider; + +@VintfStability +parcelable ConcurrentCameraIdCombination { + List combination; +} diff --git a/camera/provider/aidl/android/hardware/camera/provider/ICameraProvider.aidl b/camera/provider/aidl/android/hardware/camera/provider/ICameraProvider.aidl new file mode 100644 index 0000000000..7a4e01020a --- /dev/null +++ b/camera/provider/aidl/android/hardware/camera/provider/ICameraProvider.aidl @@ -0,0 +1,308 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.provider; + +import android.hardware.camera.common.VendorTagSection; +import android.hardware.camera.device.ICameraDevice; +import android.hardware.camera.provider.CameraIdAndStreamCombination; +import android.hardware.camera.provider.ConcurrentCameraIdCombination; +import android.hardware.camera.provider.ICameraProviderCallback; + +/** + * Camera provider HAL, which enumerates the available individual camera devices + * known to the provider, and provides updates about changes to device status, + * such as connection, disconnection, or torch mode enable/disable. + * + * The provider is responsible for generating a list of camera device service + * names that can then be opened via the hardware service manager. + * + * Multiple camera provider HALs may be present in a single system. + * For discovery, the service names, and process names, must be of the form + * "android.hardware.camera.provider.ICameraProvider//" + * where + * - is the type of devices this provider knows about, such as + * "internal", "external", "remote" etc. The camera framework + * must not differentiate or chage its behavior based on the specific type. + * - is a non-negative integer starting from 0 to disambiguate + * between multiple HALs of the same type. + * + * The device instance names enumerated by the provider in getCameraIdList() or + * ICameraProviderCallback::cameraDeviceStatusChange() must be of the form + * "device@.//" where + * / is the AIDL version of the interface. Major version is the version baked into the + * name of the device interface. Minor version is the version that would be returned by calling + * getInterfaceVersion on the interface binder returned getCameraDeviceInterface. + * is either a small incrementing integer for "internal" device types, with 0 being the main + * back-facing camera and 1 being the main front-facing camera, if they exist. + * Or, for external devices, a unique serial number (if possible) that can be + * used to identify the device reliably when it is disconnected and reconnected. + * + * Multiple providers must not enumerate the same device ID. + */ + +@VintfStability +interface ICameraProvider { + + /** + * Device states to be passed to notifyDeviceStateChange(). + */ + const long DEVICE_STATE_NORMAL = 0; + const long DEVICE_STATE_BACK_COVERED = 1 << 0; + const long DEVICE_STATE_FRONT_COVERED = 1 << 1; + const long DEVICE_STATE_FOLDED = 1 << 2; + + /** + * setCallback: + * + * Provide a callback interface to the HAL provider to inform framework of + * asynchronous camera events. The framework must call this function once + * during camera service startup, before any other calls to the provider + * (note that in case the camera service restarts, this method must be + * invoked again during its startup). + * + * @param callback + * A non-null callback interface to invoke when camera events occur. + * A service specific error will be returned on the following conditions + * INTERNAL_ERROR: + * An unexpected internal error occurred while setting the callbacks + * ILLEGAL_ARGUMENT: + * The callback argument is invalid (for example, null). + * + */ + void setCallback(ICameraProviderCallback callback); + + /** + * getVendorTags: + * + * Retrieve all vendor tags supported by devices discoverable through this + * provider. The tags are grouped into sections. + * + * A service specific error will be returned on the following conditions + * INTERNAL_ERROR: + * An unexpected internal error occurred while setting the callbacks + * @return + * The supported vendor tag sections; empty if there are no supported + * vendor tags. + * + */ + VendorTagSection[] getVendorTags(); + + /** + * getCameraIdList: + * + * Returns the list of internal camera device interfaces known to this + * camera provider. These devices can then be accessed via the service manager. + * + * External camera devices (camera facing EXTERNAL) must be reported through + * the device status change callback, not in this list. Only devices with + * facing BACK or FRONT must be listed here. + * + * A service specific error will be returned on the following conditions + * INTERNAL_ERROR: + * A camera ID list cannot be created. This may be due to + * a failure to initialize the camera subsystem, for example. + * @return The list of internal camera device names known to this provider. + */ + String[] getCameraIdList(); + + /** + * getCameraDeviceInterface: + * + * Return a android.hardware.camera.device/ICameraDevice interface for + * the requested device name. This does not power on the camera device, but + * simply acquires the interface for querying the device static information, + * or to additionally open the device for active use. + * + * Valid device names for this provider can be obtained via either + * getCameraIdList(), or via availability callbacks from + * ICameraProviderCallback::cameraDeviceStatusChange(). + * + * @param cameraDeviceName the name of the device to get an interface to. + * + * A service specific error will be returned on the following conditions + * ILLEGAL_ARGUMENT: + * This device name is unknown, or has been disconnected + * OPERATION_NOT_SUPPORTED: + * The specified device does not support this major version of the + * HAL interface. + * INTERNAL_ERROR: + * A camera interface cannot be returned due to an unexpected + * internal error. + * @return device The interface to this camera device, or null in case of + * error. + */ + ICameraDevice getCameraDeviceInterface(String cameraDeviceName); + + /** + * notifyDeviceStateChange: + * + * Notify the HAL provider that the state of the overall device has + * changed in some way that the HAL may want to know about. + * + * For example, a physical shutter may have been uncovered or covered, + * or a camera may have been covered or uncovered by an add-on keyboard + * or other accessory. + * + * The state is a bitfield of potential states, and some physical configurations + * could plausibly correspond to multiple different combinations of state bits. + * The HAL must ignore any state bits it is not actively using to determine + * the appropriate camera configuration. + * + * For example, on some devices the FOLDED state could mean that + * backward-facing cameras are covered by the fold, so FOLDED by itself implies + * BACK_COVERED. But other devices may support folding but not cover any cameras + * when folded, so for those FOLDED would not imply any of the other flags. + * Since these relationships are very device-specific, it is difficult to specify + * a comprehensive policy. But as a recommendation, it is suggested that if a flag + * necessarily implies other flags are set as well, then those flags should be set. + * So even though FOLDED would be enough to infer BACK_COVERED on some devices, the + * BACK_COVERED flag should also be set for clarity. + * + * This method may be invoked by the HAL client at any time. It must not + * cause any active camera device sessions to be closed, but may dynamically + * change which physical camera a logical multi-camera is using for its + * active and future output. + * + * The method must be invoked by the HAL client at least once before the + * client calls ICameraDevice::open on any camera device interfaces listed + * by this provider, to establish the initial device state. + * + * @param newState + * The new state of the device. + */ + void notifyDeviceStateChange(long deviceState); + + /** + * getConcurrentStreamingCameraIds + * + * Get a vector of combinations of camera device ids that are able to + * configure streams concurrently. Each camera device advertised in a + * combination MUST at the very least support the following streams while + * streaming concurrently with the other camera ids in the combination. + * + * Target 1 Target 2 + * ----------------------------------------------------- + * | Type | Size | Type | Size | + * ----------------------------------------------------- + * | YUV | s1440p | | + * ----------------------------------------------------- + * | JPEG | s1440p | | + * ----------------------------------------------------- + * | PRIV | s1440p | | + * ----------------------------------------------------- + * | YUV / PRIV | s720p | YUV / PRIV | s1440p | + * ----------------------------------------------------- + * | YUV / PRIV | s720p | JPEG | s1440p | + * ----------------------------------------------------- + * + * where: + * s720p - min (max output resolution for the given format, 1280 X 720) + * s1440p - min (max output resolution for the given format, 1920 X 1440) + * + * If a device has MONOCHROME capability (device's capabilities include + * ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME) and therefore supports Y8 + * outputs, stream combinations mentioned above, where YUV is substituted by + * Y8 must be also supported. + * + * Devices whose capabilities do not include + * ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE, must support + * at least a single Y16 stream, Dataspace::DEPTH with sVGA resolution, + * during concurrent operation. + * Where sVGA - min (max output resolution for the given format, 640 X 480) + * + * The camera framework must call this method whenever it gets a + * cameraDeviceStatusChange callback adding a new camera device or removing + * a camera device known to it. This is so that the camera framework can get new combinations + * of camera ids that can stream concurrently, that might have potentially appeared. + * + * For each combination (and their subsets) of camera device ids returned by + * getConcurrentStreamingCameraIds(): If only the mandatory combinations can + * be supported concurrently by each device, then the resource costs must + * sum up to > 100 for the concurrent set, to ensure arbitration between + * camera applications work as expected. Only if resources are sufficient + * to run a set of cameras at full capability (maximally + * resource-consuming framerate and stream size settings available in the + * configuration settings exposed through camera metadata), should the sum + * of resource costs for the combination be <= 100. + * + * For guaranteed concurrent camera operation, the camera framework must call + * ICameraDevice.open() on all devices (intended for concurrent operation), before configuring + * any streams on them. This gives the camera HAL process an opportunity to potentially + * distribute hardware resources better before stream configuration. + * + * Due to potential hardware constraints around internal switching of physical camera devices, + * a device's complete ZOOM_RATIO_RANGE(if supported), may not apply during concurrent + * operation. If ZOOM_RATIO is supported, camera HALs must ensure ZOOM_RATIO_RANGE of + * [1.0, ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM] is supported by that device, during + * concurrent operation. + * + * A service specific error will be returned in the following case : + * + * INTERNAL_ERROR: the hal has encountered an internal error + * + * @return a list of camera id combinations that support + * concurrent stream configurations with the minimum guarantees + * specified. + */ + ConcurrentCameraIdCombination[] getConcurrentCameraIds(); + + /** + * isConcurrentStreamCombinationSupported: + * + * Check for device support of specific camera stream combinations while + * streaming concurrently with other devices. + * + * The per device streamList must contain at least one output-capable stream, and may + * not contain more than one input-capable stream. + * In contrast to regular stream configuration the framework does not create + * or initialize any actual streams. This means that Hal must not use or + * consider the stream "id" value. + * + * ------------------------------------------------------------------------ + * + * Preconditions: + * + * The framework can call this method at any time before, during and + * after active session configuration per device. This means that calls must not + * impact the performance of pending camera requests in any way. In + * particular there must not be any glitches or delays during normal + * camera streaming. + * + * The framework must not call this method with any combination of camera + * ids that is not a subset of the camera ids advertised by getConcurrentStreamingCameraIds of + * the same provider. + * + * Performance requirements: + * This call is expected to be significantly faster than stream + * configuration. In general HW and SW camera settings must not be + * changed and there must not be a user-visible impact on camera performance. + * + * @param configs a vector of camera ids and their corresponding stream + * configurations that need to be queried for support. + * + * On error, the service specific error for the operation will be, one of: + * METHOD_NOT_SUPPORTED: + * The camera provider does not support stream combination query. + * INTERNAL_ERROR: + * The stream combination query cannot complete due to internal + * error. + * @return true in case the stream combination is supported, false otherwise. + * + * + */ + boolean isConcurrentStreamCombinationSupported(in CameraIdAndStreamCombination[] configs); +} diff --git a/camera/provider/aidl/android/hardware/camera/provider/ICameraProviderCallback.aidl b/camera/provider/aidl/android/hardware/camera/provider/ICameraProviderCallback.aidl new file mode 100644 index 0000000000..a877637c28 --- /dev/null +++ b/camera/provider/aidl/android/hardware/camera/provider/ICameraProviderCallback.aidl @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.provider; + +import android.hardware.camera.common.CameraDeviceStatus; +import android.hardware.camera.common.TorchModeStatus; + +@VintfStability +interface ICameraProviderCallback { + /** + * cameraDeviceStatusChange: + * + * Callback to the camera service to indicate that the state of a specific + * camera device has changed. + * + * On camera service startup, when ICameraProvider::setCallback is invoked, + * the camera service must assume that all internal camera devices are in + * the CAMERA_DEVICE_STATUS_PRESENT state. + * + * The provider must call this method to inform the camera service of any + * initially NOT_PRESENT devices, and of any external camera devices that + * are already present, as soon as the callbacks are available through + * setCallback. + * + * @param cameraDeviceName The name of the camera device that has a new status. + * @param newStatus The new status that device is in. + * + */ + void cameraDeviceStatusChange(String cameraDeviceName, CameraDeviceStatus newStatus); + + /** + * torchModeStatusChange: + * + * Callback to the camera service to indicate that the state of the torch + * mode of the flash unit associated with a specific camera device has + * changed. At provider registration time, the camera service must assume + * the torch modes are in the TORCH_MODE_STATUS_AVAILABLE_OFF state if + * android.flash.info.available is reported as true via the + * ICameraDevice::getCameraCharacteristics call. + * + * @param cameraDeviceName The name of the camera device that has a + * new status. + * @param newStatus The new status that the torch is in. + * + */ + void torchModeStatusChange(String cameraDeviceName, TorchModeStatus newStatus); + + /** + * cameraPhysicalDeviceStatusChange: + * + * Callback to the camera service to indicate that the state of a physical + * camera device of a logical multi-camera has changed. + * + * On camera service startup, when ICameraProvider::setCallback is invoked, + * the camera service must assume that all physical devices backing internal + * multi-camera devices are in the CAMERA_DEVICE_STATUS_PRESENT state. + * + * The provider must call this method to inform the camera service of any + * initially NOT_PRESENT physical devices, as soon as the callbacks are available + * through setCallback. + * + * @param cameraDeviceName The name of the logical multi-camera whose + * physical camera has a new status. + * @param physicalCameraDeviceName The name of the physical camera device + * that has a new status. + * @param newStatus The new status that device is in. + * + */ + void physicalCameraDeviceStatusChange( + String cameraDeviceName, String physicalCameraDeviceName, CameraDeviceStatus newStatus); +} diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 95ba217fb0..3cda353dc3 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -187,6 +187,14 @@ [^/]+/[0-9]+
+ + android.hardware.camera.provider + 1 + + ICameraProvider + [^/]+/[0-9]+ + + android.hardware.cas 1.1-2 -- GitLab From fd3b3c6c7222f3e6090c169adacddb43efcd7027 Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Wed, 3 Nov 2021 12:23:41 -0700 Subject: [PATCH 571/825] Add AIDL interfaces for camera device hal functionality. Bug: 196432585 Test: build; Implementation will submitted later. Change-Id: Ibc9477a6b088e85822087776e93e65f3243ea0bb Signed-off-by: Jayant Chowdhary --- camera/device/aidl/Android.bp | 27 + .../hardware/camera/device/BufferCache.aidl | 39 ++ .../hardware/camera/device/BufferRequest.aidl | 39 ++ .../camera/device/BufferRequestStatus.aidl | 42 ++ .../hardware/camera/device/BufferStatus.aidl | 39 ++ .../hardware/camera/device/CameraBlob.aidl | 39 ++ .../hardware/camera/device/CameraBlobId.aidl | 39 ++ .../camera/device/CameraMetadata.aidl | 38 ++ .../device/CameraOfflineSessionInfo.aidl | 39 ++ .../camera/device/CaptureRequest.aidl | 45 ++ .../hardware/camera/device/CaptureResult.aidl | 44 ++ .../hardware/camera/device/ErrorCode.aidl | 41 ++ .../hardware/camera/device/ErrorMsg.aidl | 40 ++ .../hardware/camera/device/HalStream.aidl | 45 ++ .../hardware/camera/device/ICameraDevice.aidl | 47 ++ .../camera/device/ICameraDeviceCallback.aidl | 41 ++ .../camera/device/ICameraDeviceSession.aidl | 48 ++ .../device/ICameraInjectionSession.aidl | 39 ++ .../camera/device/ICameraOfflineSession.aidl | 40 ++ .../hardware/camera/device/NotifyMsg.aidl | 39 ++ .../camera/device/OfflineRequest.aidl | 39 ++ .../hardware/camera/device/OfflineStream.aidl | 40 ++ .../camera/device/PhysicalCameraMetadata.aidl | 40 ++ .../camera/device/PhysicalCameraSetting.aidl | 40 ++ .../camera/device/RequestTemplate.aidl | 44 ++ .../hardware/camera/device/ShutterMsg.aidl | 40 ++ .../hardware/camera/device/Stream.aidl | 50 ++ .../hardware/camera/device/StreamBuffer.aidl | 43 ++ .../device/StreamBufferRequestError.aidl | 41 ++ .../camera/device/StreamBufferRet.aidl | 39 ++ .../camera/device/StreamBuffersVal.aidl | 39 ++ .../camera/device/StreamConfiguration.aidl | 42 ++ .../device/StreamConfigurationMode.aidl | 47 ++ .../camera/device/StreamRotation.aidl | 41 ++ .../hardware/camera/device/StreamType.aidl | 39 ++ .../hardware/camera/device/BufferCache.aidl | 40 ++ .../hardware/camera/device/BufferRequest.aidl | 24 + .../camera/device/BufferRequestStatus.aidl | 51 ++ .../hardware/camera/device/BufferStatus.aidl | 38 ++ .../hardware/camera/device/CameraBlob.aidl | 26 + .../hardware/camera/device/CameraBlobId.aidl | 67 ++ .../camera/device/CameraMetadata.aidl | 29 + .../device/CameraOfflineSessionInfo.aidl | 45 ++ .../camera/device/CaptureRequest.aidl | 128 ++++ .../hardware/camera/device/CaptureResult.aidl | 209 +++++++ .../hardware/camera/device/ErrorCode.aidl | 59 ++ .../hardware/camera/device/ErrorMsg.aidl | 44 ++ .../hardware/camera/device/HalStream.aidl | 127 ++++ .../hardware/camera/device/ICameraDevice.aidl | 372 +++++++++++ .../camera/device/ICameraDeviceCallback.aidl | 202 ++++++ .../camera/device/ICameraDeviceSession.aidl | 579 ++++++++++++++++++ .../device/ICameraInjectionSession.aidl | 81 +++ .../camera/device/ICameraOfflineSession.aidl | 83 +++ .../hardware/camera/device/NotifyMsg.aidl | 39 ++ .../camera/device/OfflineRequest.aidl | 42 ++ .../hardware/camera/device/OfflineStream.aidl | 50 ++ .../camera/device/PhysicalCameraMetadata.aidl | 53 ++ .../camera/device/PhysicalCameraSetting.aidl | 61 ++ .../camera/device/RequestTemplate.aidl | 73 +++ .../hardware/camera/device/ShutterMsg.aidl | 45 ++ .../hardware/camera/device/Stream.aidl | 206 +++++++ .../hardware/camera/device/StreamBuffer.aidl | 114 ++++ .../device/StreamBufferRequestError.aidl | 54 ++ .../camera/device/StreamBufferRet.aidl | 26 + .../camera/device/StreamBuffersVal.aidl | 33 + .../camera/device/StreamConfiguration.aidl | 86 +++ .../device/StreamConfigurationMode.aidl | 122 ++++ .../camera/device/StreamRotation.aidl | 46 ++ .../hardware/camera/device/StreamType.aidl | 56 ++ .../exclude/fcm_exclude.cpp | 3 +- 70 files changed, 4746 insertions(+), 1 deletion(-) create mode 100644 camera/device/aidl/Android.bp create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferCache.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferRequest.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferRequestStatus.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferStatus.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlob.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraMetadata.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraOfflineSessionInfo.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CaptureRequest.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CaptureResult.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ErrorCode.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ErrorMsg.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/HalStream.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceCallback.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceSession.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraInjectionSession.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraOfflineSession.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/NotifyMsg.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/OfflineRequest.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/OfflineStream.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/PhysicalCameraMetadata.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/PhysicalCameraSetting.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ShutterMsg.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBuffer.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBufferRequestError.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBufferRet.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBuffersVal.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamRotation.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamType.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/BufferCache.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/BufferRequest.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/BufferRequestStatus.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/BufferStatus.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/CameraBlob.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/CameraBlobId.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/CameraMetadata.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/CameraOfflineSessionInfo.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/CaptureRequest.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/CaptureResult.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/ErrorCode.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/ErrorMsg.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/HalStream.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/ICameraDeviceCallback.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/ICameraInjectionSession.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/ICameraOfflineSession.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/NotifyMsg.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/OfflineRequest.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/OfflineStream.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/PhysicalCameraMetadata.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/PhysicalCameraSetting.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/RequestTemplate.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/ShutterMsg.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/Stream.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/StreamBuffer.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/StreamBufferRequestError.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/StreamBufferRet.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/StreamBuffersVal.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/StreamConfigurationMode.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/StreamRotation.aidl create mode 100644 camera/device/aidl/android/hardware/camera/device/StreamType.aidl diff --git a/camera/device/aidl/Android.bp b/camera/device/aidl/Android.bp new file mode 100644 index 0000000000..b6cbea4b83 --- /dev/null +++ b/camera/device/aidl/Android.bp @@ -0,0 +1,27 @@ +aidl_interface { + name: "android.hardware.camera.device", + vendor_available: true, + srcs: ["android/hardware/camera/device/*.aidl"], + stability: "vintf", + imports: [ + "android.hardware.common-V2", + "android.hardware.common.fmq-V1", + "android.hardware.camera.common", + "android.hardware.camera.metadata", + "android.hardware.graphics.common" + ], + backend: { + cpp: { + enabled: false, + }, + java: { + sdk_version: "module_current", + enabled: false, + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferCache.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferCache.aidl new file mode 100644 index 0000000000..9439172d6b --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferCache.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 -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 BufferCache { + int streamId; + long bufferId; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferRequest.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferRequest.aidl new file mode 100644 index 0000000000..c40a24aa79 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferRequest.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 -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 BufferRequest { + int streamId; + int numBuffersRequested; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferRequestStatus.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferRequestStatus.aidl new file mode 100644 index 0000000000..72fb61ba29 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferRequestStatus.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 -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; +@Backing(type="int") @VintfStability +enum BufferRequestStatus { + OK = 0, + FAILED_PARTIAL = 1, + FAILED_CONFIGURING = 2, + FAILED_ILLEGAL_ARGUMENTS = 3, + FAILED_UNKNOWN = 4, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferStatus.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferStatus.aidl new file mode 100644 index 0000000000..43a2b35e74 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/BufferStatus.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 -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; +@Backing(type="int") @VintfStability +enum BufferStatus { + OK = 0, + ERROR = 1, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlob.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlob.aidl new file mode 100644 index 0000000000..520181c87f --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlob.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 -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 CameraBlob { + android.hardware.camera.device.CameraBlobId blobId; + int blobSizeBytes; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.aidl new file mode 100644 index 0000000000..632499d55d --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.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 -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; +@Backing(type="int") @VintfStability +enum CameraBlobId { + JPEG = 255, + JPEG_APP_SEGMENTS = 256, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraMetadata.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraMetadata.aidl new file mode 100644 index 0000000000..b96d69e1b8 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraMetadata.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 -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 CameraMetadata { + byte[] metadata; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraOfflineSessionInfo.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraOfflineSessionInfo.aidl new file mode 100644 index 0000000000..1ad8e115c8 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraOfflineSessionInfo.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 -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 CameraOfflineSessionInfo { + android.hardware.camera.device.OfflineStream[] offlineStreams; + android.hardware.camera.device.OfflineRequest[] offlineRequests; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CaptureRequest.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CaptureRequest.aidl new file mode 100644 index 0000000000..6b5b256571 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CaptureRequest.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 -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 CaptureRequest { + int frameNumber; + long fmqSettingsSize; + android.hardware.camera.device.CameraMetadata settings; + android.hardware.camera.device.StreamBuffer inputBuffer; + int inputWidth; + int inputHeight; + android.hardware.camera.device.StreamBuffer[] outputBuffers; + android.hardware.camera.device.PhysicalCameraSetting[] physicalCameraSettings; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CaptureResult.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CaptureResult.aidl new file mode 100644 index 0000000000..a820e2c463 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CaptureResult.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 -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 CaptureResult { + int frameNumber; + long fmqResultSize; + android.hardware.camera.device.CameraMetadata result; + android.hardware.camera.device.StreamBuffer[] outputBuffers; + android.hardware.camera.device.StreamBuffer inputBuffer; + int partialResult; + android.hardware.camera.device.PhysicalCameraMetadata[] physicalCameraMetadata; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ErrorCode.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ErrorCode.aidl new file mode 100644 index 0000000000..2f9887a7a5 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ErrorCode.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 -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; +@Backing(type="int") @VintfStability +enum ErrorCode { + ERROR_DEVICE = 1, + ERROR_REQUEST = 2, + ERROR_RESULT = 3, + ERROR_BUFFER = 4, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ErrorMsg.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ErrorMsg.aidl new file mode 100644 index 0000000000..b2e9512bbf --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ErrorMsg.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 -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 ErrorMsg { + int frameNumber; + int errorStreamId; + android.hardware.camera.device.ErrorCode errorCode; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/HalStream.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/HalStream.aidl new file mode 100644 index 0000000000..a5784bcf32 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/HalStream.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 -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 HalStream { + int id; + android.hardware.graphics.common.PixelFormat overrideFormat; + android.hardware.graphics.common.BufferUsage producerUsage; + android.hardware.graphics.common.BufferUsage consumerUsage; + int maxBuffers; + android.hardware.graphics.common.Dataspace overrideDataSpace; + String physicalCameraId; + boolean supportOffline; +} 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 new file mode 100644 index 0000000000..80bfc3c906 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl @@ -0,0 +1,47 @@ +/* + * 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 -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 +interface ICameraDevice { + void dumpState(in ParcelFileDescriptor fd); + android.hardware.camera.device.CameraMetadata getCameraCharacteristics(); + android.hardware.camera.device.CameraMetadata getPhysicalCameraCharacteristics(in String physicalCameraId); + android.hardware.camera.common.CameraResourceCost getResourceCost(); + boolean isStreamCombinationSupported(in android.hardware.camera.device.StreamConfiguration streams); + android.hardware.camera.device.ICameraDeviceSession open(in android.hardware.camera.device.ICameraDeviceCallback callback); + android.hardware.camera.device.ICameraInjectionSession openInjectionSession(in android.hardware.camera.device.ICameraDeviceCallback callback); + void setTorchMode(boolean on); + void turnOnTorchWithStrengthLevel(int torchStrength); + int getTorchStrengthLevel(); +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceCallback.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceCallback.aidl new file mode 100644 index 0000000000..7b79c6c87a --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceCallback.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 -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 +interface ICameraDeviceCallback { + void notify(in android.hardware.camera.device.NotifyMsg[] msgs); + void processCaptureResult(in android.hardware.camera.device.CaptureResult[] results); + android.hardware.camera.device.BufferRequestStatus requestStreamBuffers(in android.hardware.camera.device.BufferRequest[] bufReqs, out android.hardware.camera.device.StreamBufferRet[] buffers); + void returnStreamBuffers(in android.hardware.camera.device.StreamBuffer[] buffers); +} 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 new file mode 100644 index 0000000000..2196d37a6c --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceSession.aidl @@ -0,0 +1,48 @@ +/* + * 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 -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 +interface ICameraDeviceSession { + void close(); + android.hardware.camera.device.HalStream[] configureStreams(in android.hardware.camera.device.StreamConfiguration requestedConfiguration); + android.hardware.camera.device.CameraMetadata constructDefaultRequestSettings(in android.hardware.camera.device.RequestTemplate type); + void flush(); + android.hardware.common.fmq.MQDescriptor getCaptureRequestMetadataQueue(); + android.hardware.common.fmq.MQDescriptor getCaptureResultMetadataQueue(); + boolean isReconfigurationRequired(in android.hardware.camera.device.CameraMetadata oldSessionParams, in android.hardware.camera.device.CameraMetadata newSessionParams); + int processCaptureRequest(in android.hardware.camera.device.CaptureRequest[] requests, in android.hardware.camera.device.BufferCache[] cachesToRemove); + 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); +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraInjectionSession.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraInjectionSession.aidl new file mode 100644 index 0000000000..80f74f331c --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraInjectionSession.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 -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 +interface ICameraInjectionSession { + void configureInjectionStreams(in android.hardware.camera.device.StreamConfiguration requestedConfiguration, in android.hardware.camera.device.CameraMetadata characteristics); + android.hardware.camera.device.ICameraDeviceSession getCameraDeviceSession(); +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraOfflineSession.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraOfflineSession.aidl new file mode 100644 index 0000000000..727d856fc8 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraOfflineSession.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 -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 +interface ICameraOfflineSession { + void close(); + android.hardware.common.fmq.MQDescriptor getCaptureResultMetadataQueue(); + void setCallback(in android.hardware.camera.device.ICameraDeviceCallback cb); +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/NotifyMsg.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/NotifyMsg.aidl new file mode 100644 index 0000000000..3ad7e52e63 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/NotifyMsg.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 -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 +union NotifyMsg { + android.hardware.camera.device.ErrorMsg error; + android.hardware.camera.device.ShutterMsg shutter; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/OfflineRequest.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/OfflineRequest.aidl new file mode 100644 index 0000000000..6e6f29d6fc --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/OfflineRequest.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 -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 OfflineRequest { + int frameNumber; + int[] pendingStreams; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/OfflineStream.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/OfflineStream.aidl new file mode 100644 index 0000000000..54cb1fed0e --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/OfflineStream.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 -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 OfflineStream { + int id; + int numOutstandingBuffers; + long[] circulatingBufferIds; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/PhysicalCameraMetadata.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/PhysicalCameraMetadata.aidl new file mode 100644 index 0000000000..3d66ab8713 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/PhysicalCameraMetadata.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 -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 PhysicalCameraMetadata { + long fmqMetadataSize; + String physicalCameraId; + android.hardware.camera.device.CameraMetadata metadata; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/PhysicalCameraSetting.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/PhysicalCameraSetting.aidl new file mode 100644 index 0000000000..a6c241d453 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/PhysicalCameraSetting.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 -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 PhysicalCameraSetting { + long fmqSettingsSize; + String physicalCameraId; + android.hardware.camera.device.CameraMetadata settings; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.aidl new file mode 100644 index 0000000000..b70b8997d9 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.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 -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; +@Backing(type="int") @VintfStability +enum RequestTemplate { + PREVIEW = 1, + STILL_CAPTURE = 2, + VIDEO_RECORD = 3, + VIDEO_SNAPSHOT = 4, + ZERO_SHUTTER_LAG = 5, + MANUAL = 6, + VENDOR_TEMPLATE_START = 1073741824, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ShutterMsg.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ShutterMsg.aidl new file mode 100644 index 0000000000..ce059ac0db --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ShutterMsg.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 -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 ShutterMsg { + int frameNumber; + long timestamp; + long readoutTimestamp; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl new file mode 100644 index 0000000000..9263a0391c --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.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 -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 Stream { + int id; + android.hardware.camera.device.StreamType streamType; + int width; + int height; + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.BufferUsage usage; + android.hardware.graphics.common.Dataspace dataSpace; + android.hardware.camera.device.StreamRotation rotation; + String physicalCameraId; + int bufferSize; + int groupId; + android.hardware.camera.metadata.SensorPixelMode[] sensorPixelModesUsed; + android.hardware.camera.metadata.RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBuffer.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBuffer.aidl new file mode 100644 index 0000000000..8fabf032db --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBuffer.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 -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 StreamBuffer { + int streamId; + long bufferId; + android.hardware.common.NativeHandle buffer; + android.hardware.camera.device.BufferStatus status; + android.hardware.common.NativeHandle acquireFence; + android.hardware.common.NativeHandle releaseFence; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBufferRequestError.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBufferRequestError.aidl new file mode 100644 index 0000000000..f450149635 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBufferRequestError.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 -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; +@Backing(type="int") @VintfStability +enum StreamBufferRequestError { + NO_BUFFER_AVAILABLE = 1, + MAX_BUFFER_EXCEEDED = 2, + STREAM_DISCONNECTED = 3, + UNKNOWN_ERROR = 4, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBufferRet.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBufferRet.aidl new file mode 100644 index 0000000000..3998cc34fa --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBufferRet.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 -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 StreamBufferRet { + int streamId; + android.hardware.camera.device.StreamBuffersVal val; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBuffersVal.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBuffersVal.aidl new file mode 100644 index 0000000000..bebc9fcced --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamBuffersVal.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 -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 +union StreamBuffersVal { + android.hardware.camera.device.StreamBufferRequestError error = android.hardware.camera.device.StreamBufferRequestError.UNKNOWN_ERROR; + android.hardware.camera.device.StreamBuffer[] buffers; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.aidl new file mode 100644 index 0000000000..f3405780be --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.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 -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 StreamConfiguration { + android.hardware.camera.device.Stream[] streams; + android.hardware.camera.device.StreamConfigurationMode operationMode; + android.hardware.camera.device.CameraMetadata sessionParams; + int streamConfigCounter; + boolean multiResolutionInputImage; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl new file mode 100644 index 0000000000..bdef41209d --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl @@ -0,0 +1,47 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum StreamConfigurationMode { + NORMAL_MODE = 0, + CONSTRAINED_HIGH_SPEED_MODE = 1, + VENDOR_MODE_0 = 32768, + VENDOR_MODE_1 = 32769, + VENDOR_MODE_2 = 32770, + VENDOR_MODE_3 = 32771, + VENDOR_MODE_4 = 32772, + VENDOR_MODE_5 = 32773, + VENDOR_MODE_6 = 32774, + VENDOR_MODE_7 = 32775, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamRotation.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamRotation.aidl new file mode 100644 index 0000000000..2ef4274f88 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamRotation.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 -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; +@Backing(type="int") @VintfStability +enum StreamRotation { + ROTATION_0 = 0, + ROTATION_90 = 1, + ROTATION_180 = 2, + ROTATION_270 = 3, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamType.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamType.aidl new file mode 100644 index 0000000000..0f13fe8be7 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamType.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 -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; +@Backing(type="int") @VintfStability +enum StreamType { + OUTPUT = 0, + INPUT = 1, +} diff --git a/camera/device/aidl/android/hardware/camera/device/BufferCache.aidl b/camera/device/aidl/android/hardware/camera/device/BufferCache.aidl new file mode 100644 index 0000000000..660250db24 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/BufferCache.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. + */ + +package android.hardware.camera.device; + +/** + * BufferCache: + * + * A bufferId associated with a certain stream. + * Buffers are passed between camera service and camera HAL via bufferId except + * the first time a new buffer is being passed to HAL in CaptureRequest. Camera + * service and camera HAL therefore need to maintain a cached map of bufferId + * and corresponing native handle. + * + */ +@VintfStability +parcelable BufferCache { + /** + * The ID of the stream this list is associated with. + */ + + int streamId; + /** + * A cached buffer ID associated with streamId. + */ + long bufferId; +} diff --git a/camera/device/aidl/android/hardware/camera/device/BufferRequest.aidl b/camera/device/aidl/android/hardware/camera/device/BufferRequest.aidl new file mode 100644 index 0000000000..4a26db97df --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/BufferRequest.aidl @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +@VintfStability +parcelable BufferRequest { + int streamId; + + int numBuffersRequested; +} diff --git a/camera/device/aidl/android/hardware/camera/device/BufferRequestStatus.aidl b/camera/device/aidl/android/hardware/camera/device/BufferRequestStatus.aidl new file mode 100644 index 0000000000..0530173f25 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/BufferRequestStatus.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. + */ + +package android.hardware.camera.device; + +@VintfStability +@Backing(type="int") +enum BufferRequestStatus { + /** + * Method call succeeded and all requested buffers are returned. + */ + OK = 0, + /** + * Method call failed for some streams. Check per stream status for each + * returned StreamBufferRet. + */ + FAILED_PARTIAL = 1, + /** + * Method call failed for all streams and no buffers are returned at all. + * Camera service is about to or is performing configureStreams. HAL must + * wait until next configureStreams call is finished before requesting + * buffers again. + */ + FAILED_CONFIGURING = 2, + /** + * Method call failed for all streams and no buffers are returned at all. + * Failure due to bad BufferRequest input, eg: unknown streamId or repeated + * streamId. + */ + FAILED_ILLEGAL_ARGUMENTS = 3, + /** + * Method call failed for all streams and no buffers are returned at all. + * Failure due to unknown reason, or all streams has individual failing + * reason. For the latter case, check per stream status for each returned + * StreamBufferRet. + */ + FAILED_UNKNOWN = 4, +} diff --git a/camera/device/aidl/android/hardware/camera/device/BufferStatus.aidl b/camera/device/aidl/android/hardware/camera/device/BufferStatus.aidl new file mode 100644 index 0000000000..9439e703ff --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/BufferStatus.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. + */ + +package android.hardware.camera.device; + +/** + * BufferStatus: + * + * The current status of a single stream buffer. + */ +@VintfStability +@Backing(type="int") +enum BufferStatus { + /** + * The buffer is in a normal state, and can be used after waiting on its + * sync fence. + */ + OK = 0, + + /** + * The buffer does not contain valid data, and the data in it must not be + * used. The sync fence must still be waited on before reusing the buffer. + */ + ERROR = 1, +} diff --git a/camera/device/aidl/android/hardware/camera/device/CameraBlob.aidl b/camera/device/aidl/android/hardware/camera/device/CameraBlob.aidl new file mode 100644 index 0000000000..085efa6a50 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/CameraBlob.aidl @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.CameraBlobId; + +@VintfStability +parcelable CameraBlob { + CameraBlobId blobId; + + int blobSizeBytes; +} diff --git a/camera/device/aidl/android/hardware/camera/device/CameraBlobId.aidl b/camera/device/aidl/android/hardware/camera/device/CameraBlobId.aidl new file mode 100644 index 0000000000..8c303d9191 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/CameraBlobId.aidl @@ -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. + */ + +package android.hardware.camera.device; + +/** + * CameraBlob: + * + * Transport header for camera blob types; generally compressed JPEG buffers in + * output streams. + * + * To capture JPEG images, a stream is created using the pixel format + * HAL_PIXEL_FORMAT_BLOB and dataspace HAL_DATASPACE_V0_JFIF. The buffer size + * for the stream is calculated by the framework, based on the static metadata + * field android.jpeg.maxSize. Since compressed JPEG images are of variable + * size, the HAL needs to include the final size of the compressed image using + * this structure inside the output stream buffer. The camera blob ID field must + * be set to CameraBlobId::JPEG. + * + * The transport header must be at the end of the JPEG output stream + * buffer. That means the jpegBlobId must start at byte[buffer_size - + * sizeof(CameraBlob)], where the buffer_size is the size of gralloc + * buffer. Any HAL using this transport header must account for it in + * android.jpeg.maxSize. The JPEG data itself starts at the beginning of the + * buffer and must be blobSize bytes long. + * + * It also supports transport of JPEG APP segments blob, which contains JPEG APP1 to + * APPn (Application Marker) segments as specified in JEITA CP-3451. + * + * To capture a JPEG APP segments blob, a stream is created using the pixel format + * HAL_PIXEL_FORMAT_BLOB and dataspace HAL_DATASPACE_JPEG_APP_SEGMENTS. The buffer + * size for the stream is calculated by the framework, based on the static + * metadata field android.heic.maxAppSegmentsCount, and is assigned to both + * Stream width and Stream bufferSize. Camera framework sets + * Stream height to 1. + * + * Similar to JPEG image, the JPEG APP segment images can be of variable size, + * so the HAL needs to include the final size of all APP segments using this + * structure inside the output stream buffer. The camera blob ID field must be + * set to CameraBlobId::JPEG_APP_SEGMENTS. + * + * The transport header must be at the end of the JPEG APP segments output stream + * buffer. That means the blobId must start at byte[buffer_size - + * sizeof(CameraBlob)], where the buffer_size is the size of gralloc + * buffer. The JPEG APP segments data itself starts at the beginning of the + * buffer and must be blobSize bytes long. + */ +@VintfStability +@Backing(type="int") +enum CameraBlobId { + JPEG = 0x00FF, + + JPEG_APP_SEGMENTS = 0x100, +} diff --git a/camera/device/aidl/android/hardware/camera/device/CameraMetadata.aidl b/camera/device/aidl/android/hardware/camera/device/CameraMetadata.aidl new file mode 100644 index 0000000000..dd8bb545fd --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/CameraMetadata.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +/** + * Wrapper parcelable for CameraMetadata + */ +@VintfStability +parcelable CameraMetadata { + /** + * A serialized metadata buffer created by libcamera_metadata. + * Access by casting to a camera_metadata* and using libcamera_metadata methods + */ + byte[] metadata; +} diff --git a/camera/device/aidl/android/hardware/camera/device/CameraOfflineSessionInfo.aidl b/camera/device/aidl/android/hardware/camera/device/CameraOfflineSessionInfo.aidl new file mode 100644 index 0000000000..f635fe29f8 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/CameraOfflineSessionInfo.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. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.OfflineRequest; +import android.hardware.camera.device.OfflineStream; + +/** + * CameraOfflineSessionInfo: + * + * Information about pending outputs that's being transferred to an offline + * session from an active session using the + * ICameraDeviceSession#switchToOffline method. + * + */ +@VintfStability +parcelable CameraOfflineSessionInfo { + /** + * Information on what streams will be preserved in offline session. + * Streams not listed here will be removed by camera service after + * switchToOffline call returns. + */ + OfflineStream[] offlineStreams; + + /** + * Information for requests that will be handled by offline session + * Camera service will validate this matches what camera service has on + * record. + */ + OfflineRequest[] offlineRequests; +} diff --git a/camera/device/aidl/android/hardware/camera/device/CaptureRequest.aidl b/camera/device/aidl/android/hardware/camera/device/CaptureRequest.aidl new file mode 100644 index 0000000000..1dad07a4ac --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/CaptureRequest.aidl @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.CameraMetadata; +import android.hardware.camera.device.PhysicalCameraSetting; +import android.hardware.camera.device.StreamBuffer; + +/** + * CaptureRequest: + * + * A single request for image capture/buffer reprocessing, sent to the Camera + * HAL device by the framework in processCaptureRequest(). + * + * The request contains the settings to be used for this capture, and the set of + * output buffers to write the resulting image data in. It may optionally + * contain an input buffer, in which case the request is for reprocessing that + * input buffer instead of capturing a new image with the camera sensor. The + * capture is identified by the frameNumber. + * + * In response, the camera HAL device must send a CaptureResult + * structure asynchronously to the framework, using the processCaptureResult() + * callback. + */ +@VintfStability +parcelable CaptureRequest { + /** + * The frame number is an incrementing integer set by the framework to + * uniquely identify this capture. It needs to be returned in the result + * call, and is also used to identify the request in asynchronous + * notifications sent to ICameraDevice3Callback::notify(). + */ + int frameNumber; + + /** + * If non-zero, read settings from request queue instead + * (see ICameraDeviceSession.getCaptureRequestMetadataQueue). + * If zero, read settings from .settings field. + */ + long fmqSettingsSize; + + /** + * If fmqSettingsSize is zero, + * the settings buffer contains the capture and processing parameters for + * the request. As a special case, an empty settings buffer indicates that + * the settings are identical to the most-recently submitted capture + * request. A empty buffer cannot be used as the first submitted request + * after a configureStreams() call. + * + * This field must be used if fmqSettingsSize is zero. It must not be used + * if fmqSettingsSize is non-zero. + */ + CameraMetadata settings; + + /** + * The input stream buffer to use for this request, if any. + * + * An invalid inputBuffer is signified by a null inputBuffer::buffer, in + * which case the value of all other members of inputBuffer must be ignored. + * + * If inputBuffer is invalid, then the request is for a new capture from the + * imager. If inputBuffer is valid, the request is for reprocessing the + * image contained in inputBuffer, and the HAL must release the inputBuffer + * back to the client in a subsequent processCaptureResult call. + * + * The HAL is required to wait on the acquire sync fence of the input buffer + * before accessing it. + * + */ + StreamBuffer inputBuffer; + /** + * The width and height of the input buffer for this capture request. + * + * These fields will be [0, 0] if no input buffer exists in the capture + * request. + * + * If the stream configuration contains an input stream and has the + * multiResolutionInputImage flag set to true, the camera client may submit a + * reprocessing request with input buffer size different than the + * configured input stream size. In that case, the inputWith and inputHeight + * fields will be the actual size of the input image. + * + * If the stream configuration contains an input stream and the + * multiResolutionInputImage flag is false, the inputWidth and inputHeight must + * match the input stream size. + */ + int inputWidth; + + int inputHeight; + + /** + * An array of at least 1 stream buffers, to be filled with image + * data from this capture/reprocess. The HAL must wait on the acquire fences + * of each stream buffer before writing to them. + * + * The HAL takes ownership of the handles in outputBuffers; the client + * must not access them until they are returned in a CaptureResult. + * + * Any or all of the buffers included here may be brand new in this + * request (having never before seen by the HAL). + */ + StreamBuffer[] outputBuffers; + + /** + * A vector containing individual camera settings for logical camera backed by multiple physical + * devices. In case the vector is empty, Hal should use the settings field. The + * individual settings should only be honored for physical devices that have respective Hal + * stream. Physical devices that have a corresponding Hal stream but don't have attached + * settings here should use the settings field. + * If any of the physical settings in the array are applied on one or more devices, then the + * visual effect on any Hal streams attached to the logical camera is undefined. + */ + PhysicalCameraSetting[] physicalCameraSettings; +} diff --git a/camera/device/aidl/android/hardware/camera/device/CaptureResult.aidl b/camera/device/aidl/android/hardware/camera/device/CaptureResult.aidl new file mode 100644 index 0000000000..1522439c04 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/CaptureResult.aidl @@ -0,0 +1,209 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.CameraMetadata; +import android.hardware.camera.device.PhysicalCameraMetadata; +import android.hardware.camera.device.StreamBuffer; + +/** + * CaptureResult: + * + * The result of a single capture/reprocess by the camera HAL device. This is + * sent to the framework asynchronously with processCaptureResult(), in + * response to a single capture request sent to the HAL with + * processCaptureRequest(). Multiple processCaptureResult() calls may be + * performed by the HAL for each request. + * + * Each call, all with the same frame + * number, may contain some subset of the output buffers, and/or the result + * metadata. + * + * The result structure contains the output metadata from this capture, and the + * set of output buffers that have been/will be filled for this capture. Each + * output buffer may come with a release sync fence that the framework must wait + * on before reading, in case the buffer has not yet been filled by the HAL. + * + * The metadata may be provided multiple times for a single frame number. The + * framework must accumulate together the final result set by combining each + * partial result together into the total result set. + * + * If an input buffer is given in a request, the HAL must return it in one of + * the processCaptureResult calls, and the call may be to just return the + * input buffer, without metadata and output buffers; the sync fences must be + * handled the same way they are done for output buffers. + * + * Performance considerations: + * + * Applications receive these partial results immediately, so sending partial + * results is a highly recommended performance optimization to avoid the total + * pipeline latency before sending the results for what is known very early on + * in the pipeline. + * + * A typical use case might be calculating the AF state halfway through the + * pipeline; by sending the state back to the framework immediately, we get a + * 50% performance increase and perceived responsiveness of the auto-focus. + * + * Physical camera metadata needs to be generated if and only if a + * request is pending on a stream from that physical camera. For example, + * if the processCaptureRequest call doesn't request on physical camera + * streams, the physicalCameraMetadata field of the CaptureResult being returned + * should be an 0-size vector. If the processCaptureRequest call requests on + * streams from one of the physical camera, the physicalCameraMetadata field + * should contain one metadata describing the capture from that physical camera. + * + * For a CaptureResult that contains physical camera metadata, its + * partialResult field must be android.request.partialResultCount. In other + * words, the physicalCameraMetadata must only be contained in a final capture + * result. + */ +@VintfStability +parcelable CaptureResult { + /** + * The frame number is an incrementing integer set by the framework in the + * submitted request to uniquely identify this capture. It is also used to + * identify the request in asynchronous notifications sent to + * ICameraDevice3Callback::notify(). + */ + int frameNumber; + + /** + * If non-zero, read result from result queue instead + * (see ICameraDeviceSession.getCaptureResultMetadataQueue). + * If zero, read result from .result field. + */ + long fmqResultSize; + + /** + * The result metadata for this capture. This contains information about the + * final capture parameters, the state of the capture and post-processing + * hardware, the state of the 3A algorithms, if enabled, and the output of + * any enabled statistics units. + * + * If there was an error producing the result metadata, result must be an + * empty metadata buffer, and notify() must be called with + * ErrorCode::ERROR_RESULT. + * + * Multiple calls to processCaptureResult() with a given frameNumber + * may include (partial) result metadata. + * + * Partial metadata submitted must not include any metadata key returned + * in a previous partial result for a given frame. Each new partial result + * for that frame must also set a distinct partialResult value. + * + * If notify has been called with ErrorCode::ERROR_RESULT, all further + * partial results for that frame are ignored by the framework. + */ + CameraMetadata result; + + /** + * The completed output stream buffers for this capture. + * + * They may not yet be filled at the time the HAL calls + * processCaptureResult(); the framework must wait on the release sync + * fences provided by the HAL before reading the buffers. + * + * The StreamBuffer::buffer handle must be null for all returned buffers; + * the client must cache the handle and look it up via the combination of + * frame number and stream ID. + * + * The number of output buffers returned must be less than or equal to the + * matching capture request's count. If this is less than the buffer count + * in the capture request, at least one more call to processCaptureResult + * with the same frameNumber must be made, to return the remaining output + * buffers to the framework. This may only be zero if the structure includes + * valid result metadata or an input buffer is returned in this result. + * + * The HAL must set the stream buffer's release sync fence to a valid sync + * fd, or to null if the buffer has already been filled. + * + * If the HAL encounters an error while processing the buffer, and the + * buffer is not filled, the buffer's status field must be set to ERROR. If + * the HAL did not wait on the acquire fence before encountering the error, + * the acquire fence must be copied into the release fence, to allow the + * framework to wait on the fence before reusing the buffer. + * + * The acquire fence must be set to null for all output buffers. + * + * This vector may be empty; if so, at least one other processCaptureResult + * call must be made (or have been made) by the HAL to provide the filled + * output buffers. + * + * When processCaptureResult is called with a new buffer for a frame, + * all previous frames' buffers for that corresponding stream must have been + * already delivered (the fences need not have yet been signaled). + * + * Buffers for a frame may be sent to framework before the corresponding + * SHUTTER-notify call is made by the HAL. + * + * Performance considerations: + * + * Buffers delivered to the framework are not dispatched to the + * application layer until a start of exposure timestamp has been received + * via a SHUTTER notify() call. It is highly recommended to + * dispatch that call as early as possible. + */ + StreamBuffer[] outputBuffers; + + /** + * The handle for the input stream buffer for this capture, if any. + * + * It may not yet be consumed at the time the HAL calls + * processCaptureResult(); the framework must wait on the release sync fence + * provided by the HAL before reusing the buffer. + * + * The HAL must handle the sync fences the same way they are done for + * outputBuffers. + * + * Only one input buffer is allowed to be sent per request. Similarly to + * output buffers, the ordering of returned input buffers must be + * maintained by the HAL. + * + * Performance considerations: + * + * The input buffer should be returned as early as possible. If the HAL + * supports sync fences, it can call processCaptureResult to hand it back + * with sync fences being set appropriately. If the sync fences are not + * supported, the buffer can only be returned when it is consumed, which + * may take long time; the HAL may choose to copy this input buffer to make + * the buffer return sooner. + */ + StreamBuffer inputBuffer; + + /** + * In order to take advantage of partial results, the HAL must set the + * static metadata android.request.partialResultCount to the number of + * partial results it sends for each frame. + * + * Each new capture result with a partial result must set + * this field to a distinct inclusive value between + * 1 and android.request.partialResultCount. + * + * HALs not wishing to take advantage of this feature must not + * set an android.request.partialResultCount or partial_result to a value + * other than 1. + * + * This value must be set to 0 when a capture result contains buffers only + * and no metadata. + */ + int partialResult; + + /** + * The physical metadata for logical multi-camera. + */ + PhysicalCameraMetadata[] physicalCameraMetadata; +} diff --git a/camera/device/aidl/android/hardware/camera/device/ErrorCode.aidl b/camera/device/aidl/android/hardware/camera/device/ErrorCode.aidl new file mode 100644 index 0000000000..9a0f26c19d --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/ErrorCode.aidl @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +/** + * Defined error codes for the NotifyMsg union in ICameraDeviceCallback.notify callbacks. + */ +@VintfStability +@Backing(type="int") +enum ErrorCode { + /** + * A serious failure occurred. No further frames or buffer streams must + * be produced by the device. Device must be treated as closed. The + * client must reopen the device to use it again. The frameNumber field + * is unused. + */ + ERROR_DEVICE = 1, + + /** + * An error has occurred in processing a request. No output (metadata or + * buffers) must be produced for this request. The frameNumber field + * specifies which request has been dropped. Subsequent requests are + * unaffected, and the device remains operational. + */ + ERROR_REQUEST = 2, + + /** + * An error has occurred in producing an output result metadata buffer + * for a request, but output stream buffers for it must still be + * available. Subsequent requests are unaffected, and the device remains + * operational. The frameNumber field specifies the request for which + * result metadata won't be available. + */ + ERROR_RESULT = 3, + + /** + * An error has occurred in placing an output buffer into a stream for a + * request. The frame metadata and other buffers may still be + * available. Subsequent requests are unaffected, and the device remains + * operational. The frameNumber field specifies the request for which the + * buffer was dropped, and errorStreamId indicates the stream + * that dropped the frame. + */ + ERROR_BUFFER = 4, +} diff --git a/camera/device/aidl/android/hardware/camera/device/ErrorMsg.aidl b/camera/device/aidl/android/hardware/camera/device/ErrorMsg.aidl new file mode 100644 index 0000000000..56bc9f1256 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/ErrorMsg.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. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.ErrorCode; + +/** + * ErrorMsg: + * + * Message contents for MsgType::ERROR + */ +@VintfStability +parcelable ErrorMsg { + /** + * Frame number of the request the error applies to. 0 if the frame number + * isn't applicable to the error. + */ + int frameNumber; + + /** + * Pointer to the stream that had a failure. -1 if the stream isn't + * applicable to the error. + */ + int errorStreamId; + + /** + * The code for this error. + */ + ErrorCode errorCode; +} diff --git a/camera/device/aidl/android/hardware/camera/device/HalStream.aidl b/camera/device/aidl/android/hardware/camera/device/HalStream.aidl new file mode 100644 index 0000000000..b8ec3deec5 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/HalStream.aidl @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +/** + * HalStream: + * + * The camera HAL's response to each requested stream configuration. + * + * The HAL may specify the desired format, maximum buffers, usage flags, physical camera id for + * each stream. + * + */ +@VintfStability +parcelable HalStream { + /** + * Stream ID - a nonnegative integer identifier for a stream. + * + * The ID must be one of the stream IDs passed into configureStreams. + */ + int id; + + /** + * An override pixel format for the buffers in this stream. + * + * The HAL must respect the requested format in Stream unless it is + * IMPLEMENTATION_DEFINED, in which case the override format here must be + * used by the client instead, for this stream. This allows cross-platform + * HALs to use a standard format since IMPLEMENTATION_DEFINED formats often + * require device-specific information. In all other cases, the + * overrideFormat must match the requested format. + * + * When HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform + * gralloc module must select a format based on the usage flags provided by + * the camera device and the other endpoint of the stream. + */ + android.hardware.graphics.common.PixelFormat overrideFormat; + + /** + * The bitfield gralloc usage flags for this stream, as needed by the HAL. + * + * For output streams, these are the HAL's producer usage flags. For input + * streams, these are the HAL's consumer usage flags. The usage flags from + * the producer and the consumer must be combined together and then passed + * to the platform graphics allocator HAL for allocating the gralloc buffers + * for each stream. + * + * If the stream's type is INPUT, then producerUsage must be 0, and + * consumerUsage must be set. For other types, producerUsage must be set, + * and consumerUsage must be 0. + */ + android.hardware.graphics.common.BufferUsage producerUsage; + + android.hardware.graphics.common.BufferUsage consumerUsage; + + /** + * The maximum number of buffers the HAL device may need to have dequeued at + * the same time. The HAL device may not have more buffers in-flight from + * this stream than this value. + */ + int maxBuffers; + + /** + * A bitfield override dataSpace for the buffers in this stream. + * + * The HAL must respect the requested dataSpace in Stream unless it is + * IMPLEMENTATION_DEFINED, in which case the override dataSpace here must be + * used by the client instead, for this stream. This allows cross-platform + * HALs to use a specific dataSpace since IMPLEMENTATION_DEFINED formats often + * require device-specific information for correct selection. In all other cases, the + * overrideFormat must match the requested format. + */ + android.hardware.graphics.common.Dataspace overrideDataSpace; + + /** + * The physical camera id the current Hal stream belongs to. + * + * If current camera device isn't a logical camera, or the Hal stream isn't + * from a physical camera of the logical camera, this must be an empty + * string. + * + * A logical camera is a camera device backed by multiple physical camera + * devices. + * + * When not empty, this field is the field of one of the full-qualified device + * instance names returned by getCameraIdList(). + */ + String physicalCameraId; + + /** + * Whether this stream can be switch to offline mode. + * + * For devices that does not support the OFFLINE_PROCESSING capability, this + * fields will always be false. + * + * For backward compatible camera devices that support the + * OFFLINE_PROCESSING capability: any input stream and any output stream + * that can be output of the input stream must set this field to true. Also + * any stream of YUV420_888 format or JPEG format, with CPU_READ usage flag, + * must set this field to true. + * + * For depth only camera devices that support the OFFLINE_PROCESSING + * capability: any DEPTH16 output stream must set this field to true. + * + * All other streams are up to camera HAL to advertise support or not, + * though it is not recommended to list support for streams with + * hardware composer or video encoder usage flags as these streams tend + * to be targeted continuously and can lead to long latency when trying to + * switch to offline. + * + */ + boolean supportOffline; +} diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl new file mode 100644 index 0000000000..f1f26d8331 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl @@ -0,0 +1,372 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.common.CameraResourceCost; +import android.hardware.camera.device.CameraMetadata; +import android.hardware.camera.device.ICameraDeviceCallback; +import android.hardware.camera.device.ICameraDeviceSession; +import android.hardware.camera.device.ICameraInjectionSession; +import android.hardware.camera.device.StreamConfiguration; + +import android.os.ParcelFileDescriptor; + +/** + * Camera device interface + * + * Supports the android.hardware.Camera API, and the android.hardware.camera2 + * API at LIMITED or better hardware level. + * + */ +@VintfStability +interface ICameraDevice { + /** + * dumpState: + * + * Print out debugging state for the camera device. This may be called by + * the framework when the camera service is asked for a debug dump, which + * happens when using the dumpsys tool, or when capturing a bugreport. + * + * The passed-in file descriptor can be used to write debugging text using + * dprintf() or write(). + * + * In case this camera device has been disconnected, the dump must not fail, + * but may simply print out 'Device disconnected' or equivalent. + * + * Performance requirements: + * + * This must be a non-blocking call. The HAL should return from this call + * in 1ms, must return from this call in 10ms. This call must avoid + * deadlocks, as it may be called at any point during camera operation. + * Any synchronization primitives used (such as mutex locks or semaphores) + * must be acquired with a timeout. + * + * @param fd The file descriptor to which the camera HAL must write any dumpState information. + */ + void dumpState(in ParcelFileDescriptor fd); + + /** + * getCameraCharacteristics: + * + * Return the static camera information for this camera device. This + * information may not change between consecutive calls. + * + * When an external camera is disconnected, its camera id becomes + * invalid. Calling this method with this invalid camera id must result in an + * ILLEGAL_ARGUMENT ServiceSpecificException on returning; this may happen even before the + * device status callback is invoked by the HAL. + * + * 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. + * + * @return The static metadata for this camera device, or an empty metadata + * structure if status is not OK. + * + */ + CameraMetadata getCameraCharacteristics(); + + /** + * getPhysicalCameraCharacteristics: + * + * Return the static camera information for a physical camera ID backing + * this logical camera device. This information may not change between consecutive calls. + * + * The characteristics of all cameras returned by + * ICameraProvider::getCameraIdList() must be queried via + * getCameraCharacteristics(). Calling getPhysicalCameraCharacteristics() on + * those cameras must return ILLEGAL_ARGUMENT ServiceSpecificException. + * + * @param physicalCameraId The physical camera id parsed from the logical + * camera's ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS static metadata + * key. The framework assumes that this ID is just the part of fully + * qualified camera device name "device@.//". And + * the physical camera must be of the same version and type as the parent + * logical camera device. + * + * 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 physicalCameraId is not a valid physical camera Id outside + * of ICameraProvider::getCameraIdList(). + * + * @return The static metadata for this logical camera device's physical device, or an empty + * metadata structure if a service specific error is returned. + * + */ + CameraMetadata getPhysicalCameraCharacteristics(in String physicalCameraId); + + /** + * Get camera device resource cost information. + * + * A service specific error will be returned on the following conditions + * INTERNAL_ERROR: + * An unexpected internal camera HAL error occurred, and the + * resource cost is not available. + * 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. + * @return resourceCost + * The resources required to open this camera device, or unspecified + * values if status is not OK. + */ + CameraResourceCost getResourceCost(); + + /** + * isStreamCombinationSupported: + * + * Check for device support of specific camera stream combination. + * + * The streamList must contain at least one output-capable stream, and may + * not contain more than one input-capable stream. + * In contrast to regular stream configuration the framework does not create + * or initialize any actual streams. This means that Hal must not use or + * consider the stream "id" value. + * + * ------------------------------------------------------------------------ + * + * Preconditions: + * + * The framework can call this method at any time before, during and + * after active session configuration. This means that calls must not + * impact the performance of pending camera requests in any way. In + * particular there must not be any glitches or delays during normal + * camera streaming. + * + * Performance requirements: + * This call is expected to be significantly faster than stream + * configuration. In general HW and SW camera settings must not be + * changed and there must not be a user-visible impact on camera performance. + * + * + * A service specific error will be returned on the following conditions + * + * INTERNAL_ERROR: + * The stream combination query cannot complete due to internal + * error. + * @param streams The StreamConfiguration to be tested for support. + * @return true in case the stream combination is supported, false otherwise. + * + */ + boolean isStreamCombinationSupported(in StreamConfiguration streams); + + /** + * open: + * + * Power on and initialize this camera device for active use, returning a + * session handle for active operations. + * + * @param callback Interface to invoke by the HAL for device asynchronous + * events. + * + * A service specific error will be returned on the following conditions + * INTERNAL_ERROR: + * The camera device cannot be opened due to an internal + * error. + * ILLEGAL_ARGUMENT: + * The callbacks handle is invalid (for example, it is null). + * CAMERA_IN_USE: + * This camera device is already open. + * MAX_CAMERAS_IN_USE: + * The maximal number of camera devices that can be + * opened concurrently were opened already. + * CAMERA_DISCONNECTED: + * This external camera device has been disconnected, and is no + * longer available. This 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. + * @return The interface to the newly-opened camera session, + * or null if status is not OK. + */ + ICameraDeviceSession open(in ICameraDeviceCallback callback); + + /** + * openInjection: + * + * Similar to open, except that this return an ICameraInjectionSession instead. + * Details about ICameraInjectionSession can be found in ICameraInjectionSession.aidl + * + * @param callback Interface to invoke by the HAL for device asynchronous + * events. + * + * A service specific error will be returned on the following conditions + * INTERNAL_ERROR: + * The camera device cannot be opened due to an internal + * error. + * ILLEGAL_ARGUMENT: + * The callbacks handle is invalid (for example, it is null). + * CAMERA_IN_USE: + * This camera device is already open. + * MAX_CAMERAS_IN_USE: + * The maximal number of camera devices that can be + * opened concurrently were opened already. + * CAMERA_DISCONNECTED: + * This external camera device has been disconnected, and is no + * longer available. This 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. + * @return The interface to the newly-opened camera session, + * or null if status is not OK. + */ + ICameraInjectionSession openInjectionSession(in ICameraDeviceCallback callback); + + /** + * setTorchMode: + * + * Turn on or off the torch mode of the flash unit associated with this + * camera device. If the operation is successful, HAL must notify the + * framework torch state by invoking + * ICameraProviderCallback::torchModeStatusChange() with the new state. + * + * An active camera session has a higher priority accessing the flash + * unit. When there are any resource conflicts, such as when open() is + * called to fully activate a camera device, the provider must notify the + * framework through ICameraProviderCallback::torchModeStatusChange() that + * the torch mode has been turned off and the torch mode state has become + * TORCH_MODE_STATUS_NOT_AVAILABLE. When resources to turn on torch mode + * become available again, the provider must notify the framework through + * ICameraProviderCallback::torchModeStatusChange() that the torch mode + * state has become TORCH_MODE_STATUS_AVAILABLE_OFF for set_torch_mode() to + * be called. + * + * When the client calls setTorchMode() to turn on the torch mode of a flash + * unit, if the HAL cannot keep multiple torch modes on simultaneously, the + * HAL must turn off the torch mode(s) that were turned on by previous + * setTorchMode() calls and notify the framework that the torch mode state + * of those flash unit(s) has become TORCH_MODE_STATUS_AVAILABLE_OFF. + * + * @param on Whether to turn the turn mode ON - specified by true or OFF, specified by false + * + * A service specific error will be returned on the following conditions + * + * INTERNAL_ERROR: + * The flash unit cannot be operated due to an unexpected internal + * error. + * ILLEGAL_ARGUMENT: + * The camera ID is unknown. + * CAMERA_IN_USE: + * This camera device has been opened, so the torch cannot be + * controlled until it is closed. + * MAX_CAMERAS_IN_USE: + * Due to other camera devices being open, or due to other + * resource constraints, the torch cannot be controlled currently. + * OPERATION_NOT_SUPPORTED: + * This camera device does not have a flash unit. This can + * be returned if and only if android.flash.info.available is + * false. + * 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. + * + */ + void setTorchMode(boolean on); + + /** + * turnOnTorchWithStrengthLevel: + * + * Change the brightness level of the flash unit associated with this camera device + * and set it to value in torchStrength. This function also turns ON the torch + * with specified torchStrength if the torch is OFF. + * + * The torchStrength value must be within the valid range i.e. >=1 and + * <= FLASH_INFO_STRENGTH_MAXIMUM_LEVEL. Whenever the torch is turned OFF, + * the brightness level will reset to FLASH_INFO_STRENGTH_DEFAULT_LEVEL. + * When the client calls setTorchMode(ON) after turnOnTorchWithStrengthLevel(N), + * the flash unit will have brightness level equal to N. This level does not + * represent the real brightness units. It is linear in nature i.e. flashlight + * at level 10 is twice as bright as at level 5. + * + * @param torchStrength Brightness level to be set for the flashlight. + * + * A service specific error will be returned on the following conditions + * INTERNAL_ERROR: + * The flash unit cannot be operated due to an unexpected internal + * error. + * CAMERA_IN_USE: + * This status code is returned when: + * - This camera device has been opened, so the torch cannot be + * controlled until it is closed. + * - Due to other camera devices being open, or due to other + * resource constraints, the torch cannot be controlled currently. + * ILLEGAL_ARGUMENT: + * If the torchStrength value is not within the range i.e. < 1 or + * > FLASH_INFO_STRENGTH_MAXIMUM_LEVEL. + * OPERATION_NOT_SUPPORTED: + * This status code is returned when: + * - This camera device does not support direct operation of flashlight + * torch mode. The framework must open the camera device and turn + * the torch on through the device interface. + * - This camera device does not have a flash unit. + * - This camera device has flash unit but does not support torch + * strength control. + * 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. + * + */ + void turnOnTorchWithStrengthLevel(int torchStrength); + + /** + * getTorchStrengthLevel: + * + * Get current torch strength level. + * If the device supports torch strength control, when the torch is OFF the + * strength level will reset to default level, so the return + * value in this case will be equal to FLASH_INFO_STRENGTH_DEFAULT_LEVEL. + * + * A service specific error will be returned on the following conditions + * INTERNAL_ERROR: + * An unexpected error occurred and the information is not + * available. + * OPERATION_NOT_SUPPORTED: + * This status code is returned when: + * - This camera device does not support direct operation of flashlight + * torch mode. The framework must open the camera device and turn + * the torch on through the device interface. + * - This camera device does not have a flash unit. + * - This camera device has flash unit but does not support torch + * strength control. + * + * @return torchStrength Current torch strength level. + * + */ + int getTorchStrengthLevel(); +} diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraDeviceCallback.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraDeviceCallback.aidl new file mode 100644 index 0000000000..83ff823af6 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/ICameraDeviceCallback.aidl @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.BufferRequest; +import android.hardware.camera.device.BufferRequestStatus; +import android.hardware.camera.device.CaptureResult; +import android.hardware.camera.device.NotifyMsg; +import android.hardware.camera.device.StreamBuffer; +import android.hardware.camera.device.StreamBufferRet; + +/** + * Callback methods for the HAL to call into the framework. + */ +@VintfStability +interface ICameraDeviceCallback { + /** + * notify: + * + * Asynchronous notification callback from the HAL, fired for various + * reasons. Only for information independent of frame capture, or that + * require specific timing. Multiple messages may be sent in one call; a + * message with a higher index must be considered to have occurred after a + * message with a lower index. + * + * Multiple threads may call notify() simultaneously. + * + * Buffers delivered to the framework must not be dispatched to the + * application layer until a start of exposure timestamp (or input image's + * start of exposure timestamp for a reprocess request) has been received + * via a SHUTTER notify() call. It is highly recommended to dispatch this + * call as early as possible. + * + * The SHUTTER notify calls for requests with android.control.enableZsl + * set to TRUE and ANDROID_CONTROL_CAPTURE_INTENT == STILL_CAPTURE may be + * out-of-order compared to SHUTTER notify for other kinds of requests + * (including regular, reprocess, or zero-shutter-lag requests with + * different capture intents). + * + * As a result, the capture results of zero-shutter-lag requests with + * ANDROID_CONTROL_CAPTURE_INTENT == STILL_CAPTURE may be out-of-order + * compared to capture results for other kinds of requests. + * + * Different SHUTTER notify calls for zero-shutter-lag requests with + * ANDROID_CONTROL_CAPTURE_INTENT == STILL_CAPTURE must be in order between + * them, as is for other kinds of requests. SHUTTER notify calls for + * zero-shutter-lag requests with non STILL_CAPTURE intent must be in order + * with SHUTTER notify calls for regular requests. + * ------------------------------------------------------------------------ + * Performance requirements: + * + * This is a non-blocking call. The framework must handle each message in 5ms. + * @param msgs List of notification msgs to be processed by camera framework + */ + void notify(in NotifyMsg[] msgs); + + /** + * processCaptureResult: + * + * Send results from one or more completed or partially completed captures + * to the framework. + * processCaptureResult() may be invoked multiple times by the HAL in + * response to a single capture request. This allows, for example, the + * metadata and low-resolution buffers to be returned in one call, and + * post-processed JPEG buffers in a later call, once it is available. Each + * call must include the frame number of the request it is returning + * metadata or buffers for. Only one call to processCaptureResult + * may be made at a time by the HAL although the calls may come from + * different threads in the HAL. + * + * A component (buffer or metadata) of the complete result may only be + * included in one process_capture_result call. A buffer for each stream, + * and the result metadata, must be returned by the HAL for each request in + * one of the processCaptureResult calls, even in case of errors producing + * some of the output. A call to processCaptureResult() with neither + * output buffers or result metadata is not allowed. + * + * The order of returning metadata and buffers for a single result does not + * matter, but buffers for a given stream must be returned in FIFO order. So + * the buffer for request 5 for stream A must always be returned before the + * buffer for request 6 for stream A. This also applies to the result + * metadata; the metadata for request 5 must be returned before the metadata + * for request 6. + * + * However, different streams are independent of each other, so it is + * acceptable and expected that the buffer for request 5 for stream A may be + * returned after the buffer for request 6 for stream B is. And it is + * acceptable that the result metadata for request 6 for stream B is + * returned before the buffer for request 5 for stream A is. If multiple + * capture results are included in a single call, camera framework must + * process results sequentially from lower index to higher index, as if + * these results were sent to camera framework one by one, from lower index + * to higher index. + * + * The HAL retains ownership of result structure, which only needs to be + * valid to access during this call. + * + * The output buffers do not need to be filled yet; the framework must wait + * on the stream buffer release sync fence before reading the buffer + * data. Therefore, this method should be called by the HAL as soon as + * possible, even if some or all of the output buffers are still in + * being filled. The HAL must include valid release sync fences into each + * output_buffers stream buffer entry, or -1 if that stream buffer is + * already filled. + * + * If the result buffer cannot be constructed for a request, the HAL must + * return an empty metadata buffer, but still provide the output buffers and + * their sync fences. In addition, notify() must be called with an + * ERROR_RESULT message. + * + * If an output buffer cannot be filled, its status field must be set to + * STATUS_ERROR. In this case, notify() isn't required to be called with + * an ERROR_BUFFER message. The framework will simply treat the notify() + * call with ERROR_BUFFER as a no-op, and derive whether and when to notify + * the application of buffer loss based on the buffer status and whether or not + * the entire capture has failed. + * + * If the entire capture has failed, then this method still needs to be + * called to return the output buffers to the framework. All the buffer + * statuses must be STATUS_ERROR, and the result metadata must be an + * empty buffer. In addition, notify() must be called with a ERROR_REQUEST + * message. In this case, individual ERROR_RESULT/ERROR_BUFFER messages + * must not be sent. Note that valid partial results are still allowed + * as long as the final result metadata fails to be generated. + * + * Performance requirements: + * + * This is a non-blocking call. The framework must handle each CaptureResult + * within 5ms. + * + * The pipeline latency (see ICameraDeviceSession for definition) should be less than or equal + * to 4 frame intervals, and must be less than or equal to 8 frame intervals. + * + * @param results to be processed by the camera framework + * + */ + void processCaptureResult(in CaptureResult[] results); + + /** + * requestStreamBuffers: + * + * Synchronous callback for HAL to ask for output buffers from camera service. + * + * This call may be serialized in camera service so it is strongly + * recommended to only call this method from one thread. + * + * When camera device advertises + * InfoSupportedBufferManagementVersion == + * ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5), HAL + * can use this method to request buffers from camera service. + * + * A BufferRequestStatus will be returned + * OK: All the requests succeeded + * FAILED_PARTIAL: some streams failed while some succeeds. Check + * individual StreamBufferRet for details. + * FAILED_CONFIGURING: the request failed because camera servicve is + * performing configureStreams and no buffers are returned. + * FAILED_UNKNOWN: the request failed for unknown reason and no buffers + * are returned. + * A service specific exception will be returned in the following case: + * + * ILLEGAL_ARGUMENT: If the buffer requests through bufReqs are not legal, do not correspond + * to a configured stream. + * + * Performance requirements: + * This is a blocking call that takes more time with more buffers requested. + * HAL must not request large amount of buffers on a latency critical code + * path. It is highly recommended to use a dedicated thread to perform + * all requestStreamBuffers calls, and adjust the thread priority and/or + * timing of making the call in order for buffers to arrive before HAL is + * ready to fill the buffer. + * @param bufReqs Buffers requested by the camera HAL + * @param buffers the buffers returned to the camera HAL by the camera framework + */ + BufferRequestStatus requestStreamBuffers( + in BufferRequest[] bufReqs, out StreamBufferRet[] buffers); + + /** + * returnStreamBuffers: + * + * Synchronous callback for HAL to return output buffers to camera service. + * + * If this method is called during a configureStreams call, it must be blocked + * until camera service finishes the ongoing configureStreams call. + * @param buffers The stream buffers returned to the camera framework + */ + void returnStreamBuffers(in StreamBuffer[] buffers); +} diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl new file mode 100644 index 0000000000..885c71a848 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl @@ -0,0 +1,579 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.BufferCache; +import android.hardware.camera.device.CameraMetadata; +import android.hardware.camera.device.CameraOfflineSessionInfo; +import android.hardware.camera.device.CaptureRequest; +import android.hardware.camera.device.HalStream; +import android.hardware.camera.device.ICameraOfflineSession; +import android.hardware.camera.device.RequestTemplate; +import android.hardware.camera.device.StreamConfiguration; +import android.hardware.common.fmq.MQDescriptor; +import android.hardware.common.fmq.SynchronizedReadWrite; + +/** + * Camera device active session interface. + * + * Obtained via ICameraDevice::open(), this interface contains the methods to + * configure and request captures from an active camera device. + */ +@VintfStability +interface ICameraDeviceSession { + /** + * close: + * + * Shut down the camera device. + * + * After this call, all calls to this session instance must set a + * INTERNAL_ERROR ServiceSpecificException. + * + * This method must always succeed, even if the device has encountered a + * serious error. + */ + void close(); + + /** + * + * configureStreams: + * + * Reset the HAL camera device processing pipeline and set up new input and + * output streams. This call replaces any existing stream configuration with + * the streams defined in the streamList. This method must be called at + * least once before a request is submitted with processCaptureRequest(). + * + * The streamList must contain at least one output-capable stream, and may + * not contain more than one input-capable stream. + * + * The streamList may contain streams that are also in the currently-active + * set of streams (from the previous call to configureStreams()). These + * streams must already have valid values for usage, maxBuffers, and the + * private pointer. + * + * If the HAL needs to change the stream configuration for an existing + * stream due to the new configuration, it may rewrite the values of usage + * and/or maxBuffers during the configure call. + * + * The framework must detect such a change, and may then reallocate the + * stream buffers before using buffers from that stream in a request. + * + * If a currently-active stream is not included in streamList, the HAL may + * safely remove any references to that stream. It must not be reused in a + * later configureStreams() call by the framework, and all the gralloc + * buffers for it must be freed after the configureStreams() call returns. + * + * If the stream is new, the client must set the consumer usage flags in + * requestedConfiguration. Upon return, the HAL device must set producerUsage, + * maxBuffers, and other fields in the configureStreams() return values. These + * fields are then used by the framework and the platform gralloc module to + * allocate the gralloc buffers for each stream. + * + * Newly allocated buffers may be included in a capture request at any time + * by the framework. Once a gralloc buffer is returned to the framework + * with processCaptureResult (and its respective releaseFence has been + * signaled) the framework may free or reuse it at any time. + * + * ------------------------------------------------------------------------ + * + * Preconditions: + * + * The framework must only call this method when no captures are being + * processed. That is, all results have been returned to the framework, and + * all in-flight input and output buffers have been returned and their + * release sync fences have been signaled by the HAL. The framework must not + * submit new requests for capture while the configureStreams() call is + * underway. + * + * Postconditions: + * + * The HAL device must configure itself to provide maximum possible output + * frame rate given the sizes and formats of the output streams, as + * documented in the camera device's static metadata. + * + * Performance requirements: + * + * This call is expected to be heavyweight and possibly take several hundred + * milliseconds to complete, since it may require resetting and + * reconfiguring the image sensor and the camera processing pipeline. + * Nevertheless, the HAL device should attempt to minimize the + * reconfiguration delay to minimize the user-visible pauses during + * application operational mode changes (such as switching from still + * capture to video recording). + * + * The HAL should return from this call in 500ms, and must return from this + * call in 1000ms. + * + * A service specific error will be returned on the following conditions + * + * INTERNAL_ERROR: + * If there has been a fatal error and the device is no longer + * operational. Only close() can be called successfully by the + * framework after this error is returned. + * ILLEGAL_ARGUMENT: + * If the requested stream configuration is invalid. Some examples + * of invalid stream configurations include: + * - Including more than 1 INPUT stream + * - Not including any OUTPUT streams + * - Including streams with unsupported formats, or an unsupported + * size for that format. + * - Including too many output streams of a certain format. + * - Unsupported rotation configuration + * - Stream sizes/formats don't satisfy the + * StreamConfigurationMode requirements for non-NORMAL mode, or + * the requested operation_mode is not supported by the HAL. + * - Unsupported usage flag + * The camera service cannot filter out all possible illegal stream + * configurations, since some devices may support more simultaneous + * streams or larger stream resolutions than the minimum required + * for a given camera device hardware level. The HAL must return an + * ILLEGAL_ARGUMENT for any unsupported stream set, and then be + * ready to accept a future valid stream configuration in a later + * configureStreams call. + * @param requestedConfiguration The stream configuration requested by the camera framework to + * be configured by the camera HAL. + * @return A list of the stream parameters desired by the HAL for + * each stream, including maximum buffers, the usage flags, and the + * override format. + * + */ + HalStream[] configureStreams(in StreamConfiguration requestedConfiguration); + + /** + * constructDefaultRequestSettings: + * + * Create capture settings for standard camera use cases. + * + * The device must return a settings buffer that is configured to meet the + * requested use case, which must be one of the RequestTemplate enums. + * All request control fields must be included. + * + * Performance requirements: + * + * This must be a non-blocking call. The HAL should return from this call + * in 1ms, and must return from this call in 5ms. + * + * A service specific error will be returned on the following conditions + * Return values: + * + * INTERNAL_ERROR: + * An unexpected internal error occurred, and the default settings + * are not available. + * ILLEGAL_ARGUMENT: + * The camera HAL does not support the input template type + * 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. + * @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); + + /** + * flush: + * + * Flush all currently in-process captures and all buffers in the pipeline + * on the given device. Generally, this method is used to dump all state as + * quickly as possible in order to prepare for a configure_streams() call. + * + * No buffers are required to be successfully returned, so every buffer + * held at the time of flush() (whether successfully filled or not) may be + * returned with BufferStatus.ERROR. Note the HAL is still allowed + * to return valid (BufferStatus.OK) buffers during this call, + * provided they are successfully filled. + * + * All requests currently in the HAL are expected to be returned as soon as + * possible. Not-in-process requests must return errors immediately. Any + * interruptible hardware blocks must be stopped, and any uninterruptible + * blocks must be waited on. + * + * flush() may be called concurrently to processCaptureRequest(), with the + * expectation that processCaptureRequest returns quickly and the + * request submitted in that processCaptureRequest call is treated like + * all other in-flight requests. Due to concurrency issues, it is possible + * that from the HAL's point of view, a processCaptureRequest() call may + * be started after flush has been invoked but has not returned yet. If such + * a call happens before flush() returns, the HAL must treat the new + * capture request like other in-flight pending requests (see #4 below). + * + * More specifically, the HAL must follow below requirements for various + * cases: + * + * 1. For captures that are too late for the HAL to cancel/stop, and must be + * completed normally by the HAL; i.e. the HAL can send shutter/notify + * and processCaptureResult and buffers as normal. + * + * 2. For pending requests that have not done any processing, the HAL must + * call notify with ErrorMsg set, and return all the output + * buffers with processCaptureResult in the error state + * (BufferStatus.ERROR). The HAL must not place the release + * fence into an error state, instead, the release fences must be set to + * the acquire fences passed by the framework, or -1 if they have been + * waited on by the HAL already. This is also the path to follow for any + * captures for which the HAL already called notify() with + * ShutterMsg set, but won't be producing any metadata/valid buffers + * for. After ErrorMsg is set, for a given frame, only + * processCaptureResults with buffers in BufferStatus.ERROR + * are allowed. No further notifys or processCaptureResult with + * non-empty metadata is allowed. + * + * 3. For partially completed pending requests that do not have all the + * output buffers or perhaps missing metadata, the HAL must follow + * below: + * + * 3.1. Call notify with ErrorMsg set with ErrorCode.ERROR_RESULT if some of the expected + * result metadata (i.e. one or more partial metadata) won't be + * available for the capture. + * + * 3.2. Call notify with ErrorMsg set with ErrorCode.ERROR_BUFFER for every buffer that + * won't be produced for the capture. + * + * 3.3. Call notify with ShutterMsg with the capture timestamp + * before any buffers/metadata are returned with + * processCaptureResult. + * + * 3.4. For captures that will produce some results, the HAL must not + * call notify with ErrorCode.ERROR_REQUEST, since that indicates complete + * failure. + * + * 3.5. Valid buffers/metadata must be passed to the framework as + * normal. + * + * 3.6. Failed buffers must be returned to the framework as described + * for case 2. But failed buffers do not have to follow the strict + * ordering valid buffers do, and may be out-of-order with respect + * to valid buffers. For example, if buffers A, B, C, D, E are sent, + * D and E are failed, then A, E, B, D, C is an acceptable return + * order. + * + * 3.7. For fully-missing metadata, calling ErrorCode.ERROR_RESULT is + * sufficient, no need to call processCaptureResult with empty + * metadata or equivalent. + * + * 4. If a flush() is invoked while a processCaptureRequest() invocation + * is active, that process call must return as soon as possible. In + * addition, if a processCaptureRequest() call is made after flush() + * has been invoked but before flush() has returned, the capture request + * provided by the late processCaptureRequest call must be treated + * like a pending request in case #2 above. + * + * flush() must only return when there are no more outstanding buffers or + * requests left in the HAL. The framework may call configure_streams (as + * the HAL state is now quiesced) or may issue new requests. + * + * Note that it's sufficient to only support fully-succeeded and + * fully-failed result cases. However, it is highly desirable to support + * the partial failure cases as well, as it could help improve the flush + * call overall performance. + * + * Performance requirements: + * + * The HAL should return from this call in 100ms, and must return from this + * call in 1000ms. And this call must not be blocked longer than pipeline + * latency (see below for definition). + * + * Pipeline Latency: + * For a given capture request, the duration from the framework calling + * process_capture_request to the HAL sending capture result and all buffers + * back by process_capture_result call. To make the Pipeline Latency measure + * independent of frame rate, it is measured by frame count. + * + * For example, when frame rate is 30 (fps), the frame duration (time interval + * between adjacent frame capture time) is 33 (ms). + * If it takes 5 frames for framework to get the result and buffers back for + * a given request, then the Pipeline Latency is 5 (frames), instead of + * 5 x 33 = 165 (ms). + * + * The Pipeline Latency is determined by android.request.pipelineDepth and + * android.request.pipelineMaxDepth, see their definitions for more details. + * + * A service specific error will be returned on the following conditions + * INTERNAL_ERROR: + * If the camera device has encountered a serious error. After this + * error is returned, only the close() method can be successfully + * called by the framework. + */ + void flush(); + + /** + * getCaptureRequestMetadataQueue: + * + * Retrieves the queue used along with processCaptureRequest. If + * client decides to use fast message queue to pass request metadata, + * it must: + * - Call getCaptureRequestMetadataQueue to retrieve the fast message queue; + * - In each of the requests sent in processCaptureRequest, set + * fmqSettingsSize field of CaptureRequest to be the size to read from the + * fast message queue; leave settings field of CaptureRequest empty. + * + * @return the queue that client writes request metadata to. + */ + MQDescriptor getCaptureRequestMetadataQueue(); + + /** + * getCaptureResultMetadataQueue: + * + * Retrieves the queue used along with + * ICameraDeviceCallback.processCaptureResult. + * + * Clients to ICameraDeviceSession must: + * - Call getCaptureRequestMetadataQueue to retrieve the fast message queue; + * - In implementation of ICameraDeviceCallback, test whether + * .fmqResultSize field is zero. + * - If .fmqResultSize != 0, read result metadata from the fast message + * queue; + * - otherwise, read result metadata in CaptureResult.result. + * + * @return the queue that implementation writes result metadata to. + */ + MQDescriptor getCaptureResultMetadataQueue(); + + /** + * isReconfigurationRequired: + * + * Check whether complete stream reconfiguration is required for possible new session + * parameter values. + * + * This method must be called by the camera framework in case the client changes + * the value of any advertised session parameters. Depending on the specific values + * the HAL can decide whether a complete stream reconfiguration is required. In case + * the HAL returns false, the camera framework must skip the internal reconfiguration. + * In case Hal returns true, the framework must reconfigure the streams and pass the + * new session parameter values accordingly. + * This call may be done by the framework some time before the request with new parameters + * is submitted to the HAL, and the request may be cancelled before it ever gets submitted. + * Therefore, the HAL must not use this query as an indication to change its behavior in any + * way. + * ------------------------------------------------------------------------ + * + * Preconditions: + * + * The framework can call this method at any time after active + * session configuration. There must be no impact on the performance of + * pending camera requests in any way. In particular there must not be + * any glitches or delays during normal camera streaming. + * + * Performance requirements: + * HW and SW camera settings must not be changed and there must not be + * a user-visible impact on camera performance. + * + * @param oldSessionParams Before session parameters, usually the current session parameters. + * @param newSessionParams The new session parameters which may be set by client. + * A service specific error will be returned in the following case: + * + * INTERNAL_ERROR: + * The reconfiguration query cannot complete due to internal + * error. + * @return true in case the stream reconfiguration is required, false otherwise. + */ + boolean isReconfigurationRequired(in CameraMetadata oldSessionParams, + in CameraMetadata newSessionParams); + + /** + * processCaptureRequest: + * + * Send a list of capture requests to the HAL. The HAL must not return from + * this call until it is ready to accept the next set of requests to + * process. Only one call to processCaptureRequest() must be made at a time + * by the framework, and the calls must all be from the same thread. The + * next call to processCaptureRequest() must be made as soon as a new + * request and its associated buffers are available. In a normal preview + * scenario, this means the function is generally called again by the + * framework almost instantly. If more than one request is provided by the + * client, the HAL must process the requests in order of lowest index to + * highest index. + * + * The cachesToRemove argument contains a list of buffer caches (see + * StreamBuffer document for more information on buffer cache) to be removed + * by camera HAL. Camera HAL must remove these cache entries whether or not + * this method returns OK. + * + * The actual request processing is asynchronous, with the results of + * capture being returned by the HAL through the processCaptureResult() + * call. This call requires the result metadata to be available, but output + * buffers may simply provide sync fences to wait on. Multiple requests are + * expected to be in flight at once, to maintain full output frame rate. + * + * The framework retains ownership of the request structure. It is only + * guaranteed to be valid during this call. The HAL device must make copies + * of the information it needs to retain for the capture processing. The HAL + * is responsible for waiting on and closing the buffers' fences and + * returning the buffer handles to the framework. + * + * The HAL must write the file descriptor for the input buffer's release + * sync fence into input_buffer->release_fence, if input_buffer is not + * valid. If the HAL returns -1 for the input buffer release sync fence, the + * framework is free to immediately reuse the input buffer. Otherwise, the + * framework must wait on the sync fence before refilling and reusing the + * input buffer. + * + * The input/output buffers provided by the framework in each request + * may be brand new (having never before seen by the HAL). + * + * ------------------------------------------------------------------------ + * Performance considerations: + * + * Handling a new buffer should be extremely lightweight and there must be + * no frame rate degradation or frame jitter introduced. + * + * This call must return fast enough to ensure that the requested frame + * rate can be sustained, especially for streaming cases (post-processing + * quality settings set to FAST). The HAL should return this call in 1 + * frame interval, and must return from this call in 4 frame intervals. + * + * - The capture request can include individual settings for physical camera devices + * backing a logical multi-camera. + * + * - The capture request can include width and height of the input buffer for + * a reprocessing request. + * + * A service specific error will be returned on the following conditions + * ILLEGAL_ARGUMENT: + * If the input is malformed (the settings are empty when not + * allowed, the physical camera settings are invalid, there are 0 + * output buffers, etc) and capture processing + * cannot start. Failures during request processing must be + * handled by calling ICameraDeviceCallback::notify(). In case of + * this error, the framework retains responsibility for the + * stream buffers' fences and the buffer handles; the HAL must not + * close the fences or return these buffers with + * ICameraDeviceCallback::processCaptureResult(). + * In case of multi-resolution input image, this error must be returned + * if the caller passes in a CaptureRequest with an invalid + * [inputWith, inputHeight]. + * INTERNAL_ERROR: + * If the camera device has encountered a serious error. After this + * error is returned, only the close() method can be successfully + * called by the framework. + * + * @param requests The capture requests to be processed by the camera HAL + * @param cachesToRemove list of buffer caches to be removed by the camera HAL + * @return Number of requests successfully processed by + * camera HAL. On success, this must be equal to the size of + * requests. When the call fails, this number is the number of requests + * that HAL processed successfully before HAL runs into an error and a service specific + * error is also set. + * + */ + int processCaptureRequest(in CaptureRequest[] requests, in BufferCache[] cachesToRemove); + + /** + * signalStreamFlush: + * + * Signaling to the HAL, camera service is about to perform configureStreams and + * HAL must return all buffers of designated streams. HAL must finish + * inflight requests normally and return all buffers that belongs to the + * designated streams through processCaptureResult or returnStreamBuffer + * API in a timely manner, or camera service will run into a fatal error. + * + * Note that this call serves as an optional hint and camera service may + * skip sending this call if all buffers are already returned. + * + * @param streamIds The ID of streams camera service need all of its + * buffers returned. + * + * @param streamConfigCounter Note that due to concurrency nature, it is + * possible the signalStreamFlush call arrives later than the + * corresponding configureStreams() call, HAL must check + * streamConfigCounter for such race condition. If the counter is less + * than the counter in the last configureStreams() call HAL last + * received, the call is stale and HAL should just return this call. + */ + oneway void signalStreamFlush(in int[] streamIds, in int streamConfigCounter); + + /** + * switchToOffline: + * + * Switch the current running session from actively streaming mode to the + * offline mode. See ICameraOfflineSession for more details. + * + * The streamsToKeep argument contains list of streams IDs where application + * still needs its output. For all streams application does not need anymore, + * camera HAL can send ERROR_BUFFER to speed up the transition, or even send + * ERROR_REQUEST if all output targets of a request is not needed. By the + * time this call returns, camera HAL must have returned all buffers coming + * from streams no longer needed and have erased buffer caches of such streams. + * + * For all requests that are going to be transferred to offline session, + * the ICameraDeviceSession is responsible to capture all input buffers from + * the image sensor before the switchToOffline call returns. Before + * switchToOffline returns, camera HAL must have completed all requests not + * switching to offline mode, and collected information on what streams and + * requests are going to continue in the offline session, in the + * offlineSessionInfo output argument. + * + * If there are no requests qualified to be transferred to offline session, + * the camera HAL must return a null ICameraOfflineSession object with OK + * status. In this scenario, the camera HAL still must flush all inflight + * requests and unconfigure all streams before returning this call. + * + * After switchToOffline returns, the ICameraDeviceSession must be back to + * unconfigured state as if it is just created and no streams are configured. + * Also, camera HAL must not call any methods in ICameraDeviceCallback since + * all unfinished requests are now transferred to the offline session. + * After the call returns, camera service may then call close to close + * the camera device, or call configureStream* again to reconfigure the + * camera and then send new capture requests with processCaptureRequest. In + * the latter case, it is legitimate for camera HAL to call methods in + * ICameraDeviceCallback again in response to the newly submitted capture + * requests. + * + * A service specific error will be returned on the following conditions + * ILLEGAL_ARGUMENT: + * If camera does not support offline mode in any one of streams + * in streamsToKeep argument. Note that the camera HAL must report + * if a stream supports offline mode in HalStreamConfiguration + * output of configureStreams_3_6 method. If all streams in + * streamsToKeep argument support offline mode, then the camera HAL + * must not return this error. + * + * @param in streamsToKeep The streamIds of the streams that will continue in the offline + * session + * @param out offlineSessionInfo Information on what streams and requests will + * be transferred to offline session to continue processing. + * + * @return offlineSession The offline session object camera service will use + * to interact with. + */ + ICameraOfflineSession switchToOffline( + in int[] streamsToKeep, out CameraOfflineSessionInfo offlineSessionInfo); + + /** + * repeatingRequestEnd: + * + * Notification about the last frame number in a repeating request along with the + * ids of all streams included in the repeating request. + * + * This can be called at any point after 'processCaptureRequest' in response + * to camera clients disabling an active repeating request. + * + * Performance requirements: + * The call must not be blocked for extensive periods and should be extremely lightweight. There + * must be no frame rate degradation or frame jitter introduced. + * + * This method must always succeed, even if the device has encountered a + * serious error. + */ + void repeatingRequestEnd(in int frameNumber, in int[] streamIds); + +} diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraInjectionSession.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraInjectionSession.aidl new file mode 100644 index 0000000000..ecb8a27d3b --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/ICameraInjectionSession.aidl @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.CameraMetadata; +import android.hardware.camera.device.ICameraDeviceSession; +import android.hardware.camera.device.StreamConfiguration; + +/** + * Camera device active session interface. + * + * Obtained via ICameraDevice::open(), this interface contains the methods to + * configure and request captures from an active camera device. + */ +@VintfStability +interface ICameraInjectionSession { + /** + * configureInjectionStreams: + * + * Identical to ICameraDeviceSession.configureStreams, except that: + * + * @param requestedConfiguration + * The current stream configuration of the internal camera session and + * the injection camera must follow the configuration without overriding + * any part of it. + * @param characteristics + * The characteristics of internal camera contains a list of keys so that + * the stream continuity can be maintained after the external camera is + * injected. + * + * A service specific error will be returned on the following conditions + * + * INTERNAL_ERROR: + * If there has been a fatal error and the device is no longer + * operational. Only close() can be called successfully by the + * framework after this error is returned. + * ILLEGAL_ARGUMENT: + * If the requested stream configuration is invalid. Some examples + * of invalid stream configurations include: + * - Not including any OUTPUT streams + * - Including streams with unsupported formats, or an unsupported + * size for that format. + * - Including too many output streams of a certain format. + * - Unsupported rotation configuration + * - Stream sizes/formats don't satisfy the + * StreamConfigurationMode requirements + * for non-NORMAL mode, or the requested operation_mode is not + * supported by the HAL. + * - Unsupported usage flag + * The camera service cannot filter out all possible illegal stream + * configurations, since some devices may support more simultaneous + * streams or larger stream resolutions than the minimum required + * for a given camera device hardware level. The HAL must return an + * ILLEGAL_ARGUMENT for any unsupported stream set, and then be + * ready to accept a future valid stream configuration in a later + * configureInjectionStreams call. + */ + void configureInjectionStreams( + in StreamConfiguration requestedConfiguration, in CameraMetadata characteristics); + + /** + * Retrieves the ICameraDeviceSession interface in order for the camera framework to be able + * to use the injection session for all of the operations that a non-injected + * ICameraDeviceSession would be able to perform. + */ + ICameraDeviceSession getCameraDeviceSession(); +} diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraOfflineSession.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraOfflineSession.aidl new file mode 100644 index 0000000000..ec35b36d75 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/ICameraOfflineSession.aidl @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.ICameraDeviceCallback; +import android.hardware.common.fmq.MQDescriptor; +import android.hardware.common.fmq.SynchronizedReadWrite; + +/** + * Camera device offline session interface. + * + * Obtained via ICameraDeviceSession::switchToOffline(), this interface contains + * the methods and callback interfaces that define how camera service interacts + * with an offline session. + * + * An offline session contains some unfinished capture requests that were submitted + * to the parent ICameraDeviceSession before calling switchToOffline, and is + * responsible for delivering these capture results back to camera service regardless + * of whether the parent camera device is still opened or not. An offline session must + * not have access to the camera device's image sensor. During switchToOffline + * call, camera HAL must capture all necessary frames from the image sensor that + * is needed for completing the requests offline later. + */ +@VintfStability +interface ICameraOfflineSession { + /** + * Close the offline session and release all resources. + * + * Camera service may call this method before or after the offline session + * has finished all requests it needs to handle. If there are still unfinished + * requests when close is called, camera HAL must send ERROR_REQUEST for + * all unfinished requests and return all buffers via + * ICameraDeviceCallback#processCaptureResult or + * ICameraDeviceCallback#returnStreamBuffers. + * Also, all buffer caches maintained by the offline session must be erased + * before the close call returns. + */ + void close(); + + /** + * getCaptureResultMetadataQueue: + * + * Retrieves the queue used along with + * ICameraDeviceCallback#processCaptureResult. + * + * Clients to ICameraOfflineSession must: + * - Call getCaptureRequestMetadataQueue to retrieve the fast message queue; + * - In implementation of ICameraDeviceCallback, test whether + * .fmqResultSize field is zero. + * - If .fmqResultSize != 0, read result metadata from the fast message + * queue; + * - otherwise, read result metadata in CaptureResult.result. + * + * @return the queue that implementation writes result metadata to. + */ + MQDescriptor getCaptureResultMetadataQueue(); + + /** + * Set the callbacks for offline session to communicate with camera service. + * + * Offline session is responsible to store all callbacks the camera HAL + * generated after the return of ICameraDeviceSession::switchToOffline, and + * send them to camera service once this method is called. + * + * Camera service must not call this method more than once, so these + * callbacks can be assumed to be constant after the first setCallback call. + */ + void setCallback(in ICameraDeviceCallback cb); +} diff --git a/camera/device/aidl/android/hardware/camera/device/NotifyMsg.aidl b/camera/device/aidl/android/hardware/camera/device/NotifyMsg.aidl new file mode 100644 index 0000000000..79109673be --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/NotifyMsg.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. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.ErrorMsg; +import android.hardware.camera.device.ShutterMsg; + +/** + * NotifyMsg: + * + * The message structure sent to ICameraDeviceCallback::notify() + */ +@VintfStability +union NotifyMsg { + /** + * Error message contents. + */ + ErrorMsg error; + + /** + * Shutter message contents. + */ + ShutterMsg shutter; + +} diff --git a/camera/device/aidl/android/hardware/camera/device/OfflineRequest.aidl b/camera/device/aidl/android/hardware/camera/device/OfflineRequest.aidl new file mode 100644 index 0000000000..ccfc50f90d --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/OfflineRequest.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. + */ + +package android.hardware.camera.device; + +/** + * OfflineRequest: + * + * Information about a capture request being switched to offline mode via the + * ICameraDeviceSession#switchToOffline method. + * + */ +@VintfStability +parcelable OfflineRequest { + /** + * Must match a inflight CaptureRequest sent by camera service + */ + int frameNumber; + + /** + * Stream IDs for outputs that will be returned via ICameraDeviceCallback. + * The stream ID must be within one of offline stream listed in + * CameraOfflineSessionInfo. + * Camera service will validate these pending buffers are matching camera + * service's record to make sure no buffers are leaked during the + * switchToOffline call. + */ + int[] pendingStreams; +} diff --git a/camera/device/aidl/android/hardware/camera/device/OfflineStream.aidl b/camera/device/aidl/android/hardware/camera/device/OfflineStream.aidl new file mode 100644 index 0000000000..0b954492fc --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/OfflineStream.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. + */ + +package android.hardware.camera.device; + +/** + * OfflineStream: + * + * Information about a stream being switched to offline mode via the + * ICameraDeviceSession#switchToOffline method. + * + */ +@VintfStability +parcelable OfflineStream { + /** + * IDs of a stream to be transferred to offline session. + * + * For devices that do not support HAL buffer management, this must be + * one of stream ID listed in streamsToKeep argument of the + * switchToOffline call. + * For devices that support HAL buffer management, this could be any stream + * that was configured right before calling switchToOffline. + */ + int id; + + /** + * Number of outstanding buffers that will be returned via offline session + */ + int numOutstandingBuffers; + + /** + * Buffer ID of buffers currently cached between camera service and this + * stream, which may or may not be owned by the camera HAL right now. + * See StreamBuffer#bufferId for more details. + */ + long[] circulatingBufferIds; +} diff --git a/camera/device/aidl/android/hardware/camera/device/PhysicalCameraMetadata.aidl b/camera/device/aidl/android/hardware/camera/device/PhysicalCameraMetadata.aidl new file mode 100644 index 0000000000..ea888021b9 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/PhysicalCameraMetadata.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.CameraMetadata; + +/** + * PhysicalCameraMetadata: + * + * Individual camera metadata for a physical camera as part of a logical + * multi-camera. Camera HAL should return one such metadata for each physical + * camera being requested on. + */ +@VintfStability +parcelable PhysicalCameraMetadata { + /** + * If non-zero, read metadata from result metadata queue instead + * (see ICameraDeviceSession.getCaptureResultMetadataQueue). + * If zero, read metadata from .metadata field. + * + * The logical CaptureResult metadata is read first from the FMQ, followed by + * the physical cameras' metadata starting from index 0. + */ + long fmqMetadataSize; + + /** + * Contains the physical device camera id. As long as the corresponding + * processCaptureRequest requests on a particular physical camera stream, + * the metadata for that physical camera should be generated for the capture + * result. + */ + String physicalCameraId; + + /** + * If fmqMetadataSize is zero, the metadata buffer contains the metadata + * for the physical device with physicalCameraId. + */ + CameraMetadata metadata; +} diff --git a/camera/device/aidl/android/hardware/camera/device/PhysicalCameraSetting.aidl b/camera/device/aidl/android/hardware/camera/device/PhysicalCameraSetting.aidl new file mode 100644 index 0000000000..a8c235fb57 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/PhysicalCameraSetting.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. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.CameraMetadata; + +/** + * PhysicalCameraSetting: + * + * Individual camera settings for logical camera backed by multiple physical devices. + * Clients are allowed to pass separate settings for each physical device that has + * corresponding configured HalStream and the respective stream id is present in the + * output buffers of the capture request. + */ +@VintfStability +parcelable PhysicalCameraSetting { + /** + * If non-zero, read settings from request queue instead + * (see ICameraDeviceSession.getCaptureRequestMetadataQueue). + * If zero, read settings from .settings field. + * + * The logical settings metadata is read first from the FMQ, followed by + * the physical cameras' settings metadata starting from index 0. + */ + long fmqSettingsSize; + + /** + * Contains the physical device camera id. Any settings passed by client here + * should be applied for this physical device. In case the physical id is invalid or + * it is not present among the last configured streams, Hal should fail the process + * request and return Status::ILLEGAL_ARGUMENT. + */ + String physicalCameraId; + + /** + * If fmqSettingsSize is zero, the settings buffer contains the capture and + * processing parameters for the physical device with id 'physicalCameraId'. + * As a special case, an empty settings buffer indicates that the + * settings are identical to the most-recently submitted capture request. + * An empty buffer cannot be used as the first submitted request after + * a configureStreams() call. + * + * This field must be used if fmqSettingsSize is zero. It must not be used + * if fmqSettingsSize is non-zero. + */ + CameraMetadata settings; +} diff --git a/camera/device/aidl/android/hardware/camera/device/RequestTemplate.aidl b/camera/device/aidl/android/hardware/camera/device/RequestTemplate.aidl new file mode 100644 index 0000000000..0235d8a465 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/RequestTemplate.aidl @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +/** + * RequestTemplate: + * + * Available template types for + * ICameraDevice::constructDefaultRequestSettings() + */ +@VintfStability +@Backing(type="int") +enum RequestTemplate { + /** + * Standard camera preview operation with 3A on auto. + */ + PREVIEW = 1, + + /** + * Standard camera high-quality still capture with 3A and flash on auto. + */ + STILL_CAPTURE = 2, + + /** + * Standard video recording plus preview with 3A on auto, torch off. + */ + VIDEO_RECORD = 3, + + /** + * High-quality still capture while recording video. Applications typically + * include preview, video record, and full-resolution YUV or JPEG streams in + * request. Must not cause stuttering on video stream. 3A on auto. + */ + VIDEO_SNAPSHOT = 4, + + /** + * Zero-shutter-lag mode. Application typically request preview and + * full-resolution data for each frame, and reprocess it to JPEG when a + * still image is requested by user. Settings must provide highest-quality + * full-resolution images without compromising preview frame rate. 3A on + * auto. + */ + ZERO_SHUTTER_LAG = 5, + + /** + * A basic template for direct application control of capture + * parameters. All automatic control is disabled (auto-exposure, auto-white + * balance, auto-focus), and post-processing parameters are set to preview + * quality. The manual capture parameters (exposure, sensitivity, etc.) + * are set to reasonable defaults, but may be overridden by the + * application depending on the intended use case. + */ + MANUAL = 6, + + /** + * First value for vendor-defined request templates + */ + VENDOR_TEMPLATE_START = 0x40000000, +} diff --git a/camera/device/aidl/android/hardware/camera/device/ShutterMsg.aidl b/camera/device/aidl/android/hardware/camera/device/ShutterMsg.aidl new file mode 100644 index 0000000000..24ae1a0292 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/ShutterMsg.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. + */ + +package android.hardware.camera.device; + +/** + * ShutterMsg: + * + * Message contents for MsgType::SHUTTER + */ +@VintfStability +parcelable ShutterMsg { + /** + * Frame number of the request that has begun exposure or reprocessing. + */ + int frameNumber; + + /** + * Timestamp for the start of capture. For a reprocess request, this must + * be input image's start of capture. This must match the capture result + * metadata's sensor exposure start timestamp. + */ + long timestamp; + + /** + * Timestamp for the capture readout. This must be in the same time domain + * as timestamp, and for a rolling shutter sensor, the value must be + * timestamp + exposureTime + t_crop_top where t_crop_top is the exposure time + * skew of the cropped lines on the top. + */ + long readoutTimestamp; +} diff --git a/camera/device/aidl/android/hardware/camera/device/Stream.aidl b/camera/device/aidl/android/hardware/camera/device/Stream.aidl new file mode 100644 index 0000000000..b3291b0fdd --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/Stream.aidl @@ -0,0 +1,206 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.StreamRotation; +import android.hardware.camera.device.StreamType; + +/** + * Stream: + * + * A descriptor for a single camera input or output stream. A stream is defined + * by the framework by its buffer resolution and format, and additionally by the + * HAL with the gralloc usage flags and the maximum in-flight buffer count. + * + * Also contains the multi-resolution output surface group Id field, sensor pixel modes and + * dynamic range profile. + */ +@VintfStability +parcelable Stream { + /** + * Stream ID - a nonnegative integer identifier for a stream. + * + * The identical stream ID must reference the same stream, with the same + * width/height/format, across consecutive calls to configureStreams. + * + * If previously-used stream ID is not used in a new call to + * configureStreams, then that stream is no longer active. Such a stream ID + * may be reused in a future configureStreams with a new + * width/height/format. + * + */ + int id; + + /** + * The type of the stream (input vs output, etc). + */ + StreamType streamType; + + /** + * The width in pixels of the buffers in this stream + */ + int width; + + /** + * The height in pixels of the buffers in this stream + */ + int height; + + /** + * The pixel format for the buffers in this stream. + * + * If IMPLEMENTATION_DEFINED is used, then the platform + * gralloc module must select a format based on the usage flags provided by + * the camera device and the other endpoint of the stream. + * + */ + android.hardware.graphics.common.PixelFormat format; + + /** + * The bitfield of gralloc usage flags for this stream, as needed by the consumer of + * the stream. + * + * The usage flags from the producer and the consumer must be combined + * together and then passed to the platform gralloc HAL module for + * allocating the gralloc buffers for each stream. + * + * The HAL may use these consumer flags to decide stream configuration. For + * streamType INPUT, the value of this field is always 0. For all streams + * passed via configureStreams(), the HAL must set its own + * additional usage flags in its output HalStreamConfiguration. + * + * The usage flag for an output stream may be bitwise combination of usage + * flags for multiple consumers, for the purpose of sharing one camera + * stream between those consumers. The HAL must fail configureStreams call + * with ILLEGAL_ARGUMENT if the combined flags cannot be supported due to + * imcompatible buffer format, dataSpace, or other hardware limitations. + */ + android.hardware.graphics.common.BufferUsage usage; + + /** + * A bitfield that describes the contents of the buffer. The format and buffer + * dimensions define the memory layout and structure of the stream buffers, + * while dataSpace defines the meaning of the data within the buffer. + * + * For most formats, dataSpace defines the color space of the image data. + * In addition, for some formats, dataSpace indicates whether image- or + * depth-based data is requested. See + * android.hardware.graphics.common@1.0::types for details of formats and + * valid dataSpace values for each format. + * + * The HAL must use this dataSpace to configure the stream to the correct + * colorspace, or to select between color and depth outputs if + * supported. The dataspace values are set using the V0 dataspace + * definitions. + */ + android.hardware.graphics.common.Dataspace dataSpace; + + /** + * The required output rotation of the stream. + * + * This must be inspected by HAL along with stream width and height. For + * example, if the rotation is 90 degree and the stream width and height is + * 720 and 1280 respectively, camera service must supply buffers of size + * 720x1280, and HAL must capture a 1280x720 image and rotate the image by + * 90 degree counterclockwise. The rotation field must be ignored when the + * stream type is input. + * + * The HAL must inspect this field during stream configuration and return + * IllegalArgument if HAL cannot perform such rotation. HAL must always + * support ROTATION_0, so a configureStreams() call must not fail for + * unsupported rotation if rotation field of all streams is ROTATION_0. + * + */ + StreamRotation rotation; + + /** + * The physical camera id this stream belongs to. + * + * If the camera device is not a logical multi camera, or if the camera is a logical + * multi camera but the stream is not a physical output stream, this field will point to a + * 0-length string. + * + * A logical multi camera is a camera device backed by multiple physical cameras that + * are also exposed to the application. And for a logical multi camera, a physical output + * stream is an output stream specifically requested on an underlying physical camera. + * + * A logical camera is a camera device backed by multiple physical camera + * devices. And a physical stream is a stream specifically requested on a + * underlying physical camera device. + * + * For an input stream, this field is guaranteed to be a 0-length string. + * + * When not empty, this field is the field of one of the full-qualified device + * instance names returned by getCameraIdList(). + */ + String physicalCameraId; + + /** + * The size of a buffer from this Stream, in bytes. + * + * For non PixelFormat::BLOB formats, this entry must be 0 and HAL should use + * android.hardware.graphics.mapper lockYCbCr API to get buffer layout. + * + * For BLOB format with dataSpace Dataspace::DEPTH, this must be zero and HAL must + * determine the buffer size based on ANDROID_DEPTH_MAX_DEPTH_SAMPLES. + * + * For BLOB format with dataSpace Dataspace::JFIF, this must be non-zero and represent the + * maximal size HAL can lock using android.hardware.graphics.mapper lock API. + * + */ + int bufferSize; + + /** + * The surface group id used for multi-resolution output streams. + * + * This works similar to the surfaceGroupId of OutputConfiguration in the + * public API, with the exception that this is for multi-resolution image + * reader and is used by the camera HAL to choose a target stream within + * the same group to which images are written. All streams in the same group + * will have the same image format, data space, and usage flag. + * + * The framework must only call processCaptureRequest on at most one of the + * streams within a surface group. Depending on current active physical + * camera backing the logical multi-camera, or the pixel mode the camera is + * running in, the HAL can choose to request and return a buffer from any + * stream within the same group. -1 means that this stream is an input + * stream, or is an output stream which doesn't belong to any group. + * + * Streams with the same non-negative group id must have the same format and + * usage flag. + */ + int groupId; + + /** + * The sensor pixel modes used by this stream. This can assist the camera + * HAL in decision making about stream combination support. + * If this is empty, the HAL must assume that this stream will only be used + * with ANDROID_SENSOR_PIXEL_MODE set to ANDROID_SENSOR_PIXEL_MODE_DEFAULT. + */ + android.hardware.camera.metadata.SensorPixelMode[] sensorPixelModesUsed; + + /** + * The dynamic range profile for this stream. + * + * This field is valid and must only be considered for streams with format + * android.hardware.graphics.common.PixelFormat.YCBCR_P010 or + * android.hardware.graphics.common.PixelFormat.IMPLEMENTATION_DEFINED on devices supporting the + * ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_10_BIT capability. + * + */ + android.hardware.camera.metadata.RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile; +} diff --git a/camera/device/aidl/android/hardware/camera/device/StreamBuffer.aidl b/camera/device/aidl/android/hardware/camera/device/StreamBuffer.aidl new file mode 100644 index 0000000000..e487494ee6 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/StreamBuffer.aidl @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.BufferStatus; +import android.hardware.common.NativeHandle; + +/** + * StreamBuffer: + * + * A single buffer from a camera HAL stream. It includes a handle to its parent + * stream, the handle to the gralloc buffer itself, and sync fences + * + * The buffer does not specify whether it is to be used for input or output; + * that is determined by its parent stream type and how the buffer is passed to + * the HAL device. + */ +@VintfStability +parcelable StreamBuffer { + /** + * The ID of the stream this buffer is associated with. -1 indicates an + * invalid (empty) StreamBuffer, in which case buffer must also point to + * null and bufferId must be 0. + */ + int streamId; + + /** + * The unique ID of the buffer within this StreamBuffer. 0 indicates this + * StreamBuffer contains no buffer. + * For StreamBuffers sent to the HAL in a CaptureRequest, this ID uniquely + * identifies a buffer. When a buffer is sent to HAL for the first time, + * both bufferId and buffer handle must be filled. HAL must keep track of + * the mapping between bufferId and corresponding buffer until the + * corresponding stream is removed from stream configuration or until camera + * device session is closed. After the first time a buffer is introduced to + * HAL, in the future camera service must refer to the same buffer using + * only bufferId, and keep the buffer handle null. + */ + long bufferId; + + /** + * The graphics buffer handle to the buffer. + * + * For StreamBuffers sent to the HAL in a CaptureRequest, if the bufferId + * is not seen by the HAL before, this buffer handle is guaranteed to be a + * valid handle to a graphics buffer, with dimensions and format matching + * that of the stream. If the bufferId has been sent to the HAL before, this + * buffer handle must be null and HAL must look up the actual buffer handle + * to use from its own bufferId to buffer handle map. + * + * For StreamBuffers returned in a CaptureResult, this must be null, since + * the handle to the buffer is already known to the client (since the client + * sent it in the matching CaptureRequest), and the handle can be identified + * by the combination of frame number and stream ID. + */ + NativeHandle buffer; + + /** + * Current state of the buffer. The framework must not pass buffers to the + * HAL that are in an error state. In case a buffer could not be filled by + * the HAL, it must have its status set to ERROR when returned to the + * framework with processCaptureResult(). + */ + BufferStatus status; + + /** + * The acquire sync fence for this buffer. The HAL must wait on this fence + * fd before attempting to read from or write to this buffer. + * + * In a buffer included in a CaptureRequest, the client may set this to null + * to indicate that no waiting is necessary for this buffer. + * + * When the HAL returns an input or output buffer to the framework with + * processCaptureResult(), the acquireFence must be set to null. If the HAL + * never waits on the acquireFence due to an error in filling or reading a + * buffer, when calling processCaptureResult() the HAL must set the + * releaseFence of the buffer to be the acquireFence passed to it by the + * client. This allows the client to wait on the fence before reusing the + * buffer. + */ + NativeHandle acquireFence; + + /** + * The release sync fence for this buffer. The HAL must set this to a valid + * fence fd when returning the input buffer or output buffers to the client + * in a CaptureResult, or set it to null to indicate that no waiting is + * required for this buffer. + * + * The client must set this to be null for all buffers included in a + * processCaptureRequest call. + * + * After signaling the releaseFence for this buffer, the HAL + * must not make any further attempts to access this buffer as the + * ownership has been fully transferred back to the client. + * + * If this is null, then the ownership of this buffer is transferred back + * immediately upon the call of processCaptureResult. + */ + NativeHandle releaseFence; +} diff --git a/camera/device/aidl/android/hardware/camera/device/StreamBufferRequestError.aidl b/camera/device/aidl/android/hardware/camera/device/StreamBufferRequestError.aidl new file mode 100644 index 0000000000..4ba0045900 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/StreamBufferRequestError.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. + */ + +package android.hardware.camera.device; + +@VintfStability +@Backing(type="int") +enum StreamBufferRequestError { + /** + * Get buffer failed due to timeout waiting for an available buffer. This is + * likely due to the client application holding too many buffers, or the + * system is under memory pressure. + * This is not a fatal error. HAL may try to request buffer for this stream + * later. If HAL cannot get a buffer for certain capture request in time + * due to this error, HAL can send an ERROR_REQUEST to camera service and + * drop processing that request. + */ + NO_BUFFER_AVAILABLE = 1, + /** + * Get buffer failed due to HAL has reached its maxBuffer count. This is not + * a fatal error. HAL may try to request buffer for this stream again after + * it returns at least one buffer of that stream to camera service. + */ + MAX_BUFFER_EXCEEDED = 2, + /** + * Get buffer failed due to the stream is disconnected by client + * application, has been removed, or not recognized by camera service. + * This means application is no longer interested in this stream. + * Requesting buffer for this stream must never succeed after this error is + * returned. HAL must safely return all buffers of this stream after + * getting this error. If HAL gets another capture request later targeting + * a disconnected stream, HAL must send an ERROR_REQUEST to camera service + * and drop processing that request. + */ + STREAM_DISCONNECTED = 3, + /** + * Get buffer failed for unknown reasons. This is a fatal error and HAL must + * send ERROR_DEVICE to camera service and be ready to be closed. + */ + UNKNOWN_ERROR = 4, +} diff --git a/camera/device/aidl/android/hardware/camera/device/StreamBufferRet.aidl b/camera/device/aidl/android/hardware/camera/device/StreamBufferRet.aidl new file mode 100644 index 0000000000..b6d85c252c --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/StreamBufferRet.aidl @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.StreamBuffersVal; + +@VintfStability +parcelable StreamBufferRet { + int streamId; + + StreamBuffersVal val; +} diff --git a/camera/device/aidl/android/hardware/camera/device/StreamBuffersVal.aidl b/camera/device/aidl/android/hardware/camera/device/StreamBuffersVal.aidl new file mode 100644 index 0000000000..125d9c76d3 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/StreamBuffersVal.aidl @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.StreamBuffer; +import android.hardware.camera.device.StreamBufferRequestError; + +/** + * Per-stream return value for requestStreamBuffers. + * For each stream, either an StreamBufferRequestError error code, or all + * requested buffers for this stream is returned, so buffers.size() must be + * equal to BufferRequest::numBuffersRequested of corresponding stream. + */ +@VintfStability +union StreamBuffersVal { + StreamBufferRequestError error = StreamBufferRequestError.UNKNOWN_ERROR; + + StreamBuffer[] buffers; +} diff --git a/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl b/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl new file mode 100644 index 0000000000..cacd32c171 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +import android.hardware.camera.device.CameraMetadata; +import android.hardware.camera.device.Stream; +import android.hardware.camera.device.StreamConfigurationMode; + +/** + * StreamConfiguration: + * + * A structure of stream definitions, used by configureStreams(). This + * structure defines all the output streams and the reprocessing input + * stream for the current camera use case. + */ +@VintfStability +parcelable StreamConfiguration { + /** + * An array of camera stream pointers, defining the input/output + * configuration for the camera HAL device. + */ + Stream[] streams; + + /** + * The operation mode of streams in this configuration. The HAL can use this + * mode as an indicator to set the stream property (e.g., + * HalStream.maxBuffers) appropriately. For example, if the + * configuration is + * CONSTRAINED_HIGH_SPEED_MODE, the HAL may + * want to set aside more buffers for batch mode operation (see + * android.control.availableHighSpeedVideoConfigurations for batch mode + * definition). + * + */ + StreamConfigurationMode operationMode; + + /** + * Session wide camera parameters. + * + * The session parameters contain the initial values of any request keys that were + * made available via ANDROID_REQUEST_AVAILABLE_SESSION_KEYS. The Hal implementation + * can advertise any settings that can potentially introduce unexpected delays when + * their value changes during active process requests. Typical examples are + * parameters that trigger time-consuming HW re-configurations or internal camera + * pipeline updates. The field is optional, clients can choose to ignore it and avoid + * including any initial settings. If parameters are present, then hal must examine + * their values and configure the internal camera pipeline accordingly. + */ + CameraMetadata sessionParams; + + /** + * An incrementing counter used for HAL to keep track of the stream + * configuration and the paired oneway signalStreamFlush call. When the + * counter in signalStreamFlush call is less than the counter here, that + * signalStreamFlush call is stale. + */ + int streamConfigCounter; + + /** + * If an input stream is configured, whether the input stream is expected to + * receive variable resolution images. + * + * This flag can only be set to true if the camera device supports + * multi-resolution input streams by advertising input stream configurations in + * physicalCameraMultiResolutionStreamConfigurations in its physical cameras' + * characteristics. + * + * When this flag is set to true, the input stream's width and height can be + * any one of the supported multi-resolution input stream sizes. + */ + boolean multiResolutionInputImage; +} diff --git a/camera/device/aidl/android/hardware/camera/device/StreamConfigurationMode.aidl b/camera/device/aidl/android/hardware/camera/device/StreamConfigurationMode.aidl new file mode 100644 index 0000000000..10feecb294 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/StreamConfigurationMode.aidl @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +/** + * StreamConfigurationMode: + * + * This defines the general operation mode for the HAL (for a given stream + * configuration) where modes besides NORMAL have different semantics, and + * usually limit the generality of the API in exchange for higher performance in + * some particular area. + */ +@VintfStability +@Backing(type="int") +enum StreamConfigurationMode { + /** + * Normal stream configuration operation mode. This is the default camera + * operation mode, where all semantics of HAL APIs and metadata controls + * apply. + */ + NORMAL_MODE = 0, + + /** + * Special constrained high speed operation mode for devices that can not + * support high speed output in NORMAL mode. All streams in this + * configuration are operating at high speed mode and have different + * characteristics and limitations to achieve high speed output. The NORMAL + * mode can still be used for high speed output if the HAL can support high + * speed output while satisfying all the semantics of HAL APIs and metadata + * controls. It is recommended for the HAL to support high speed output in + * NORMAL mode (by advertising the high speed FPS ranges in + * android.control.aeAvailableTargetFpsRanges) if possible. + * + * This mode has below limitations/requirements: + * + * 1. The HAL must support up to 2 streams with sizes reported by + * android.control.availableHighSpeedVideoConfigurations. + * 2. In this mode, the HAL is expected to output up to 120fps or + * higher. This mode must support the targeted FPS range and size + * configurations reported by + * android.control.availableHighSpeedVideoConfigurations. + * 3. The HAL must support IMPLEMENTATION_DEFINED output + * stream format. + * 4. To achieve efficient high speed streaming, the HAL may have to + * aggregate multiple frames together and send to camera device for + * processing where the request controls are same for all the frames in + * this batch (batch mode). The HAL must support max batch size and the + * max batch size requirements defined by + * android.control.availableHighSpeedVideoConfigurations. + * 5. In this mode, the HAL must override aeMode, awbMode, and afMode to + * ON, ON, and CONTINUOUS_VIDEO, respectively. All post-processing + * block mode controls must be overridden to be FAST. Therefore, no + * manual control of capture and post-processing parameters is + * possible. All other controls operate the same as when + * android.control.mode == AUTO. This means that all other + * android.control.* fields must continue to work, such as + * + * android.control.aeTargetFpsRange + * android.control.aeExposureCompensation + * android.control.aeLock + * android.control.awbLock + * android.control.effectMode + * android.control.aeRegions + * android.control.afRegions + * android.control.awbRegions + * android.control.afTrigger + * android.control.aePrecaptureTrigger + * + * Outside of android.control.*, the following controls must work: + * + * android.flash.mode (TORCH mode only, automatic flash for still + * capture must not work since aeMode is ON) + * android.lens.opticalStabilizationMode (if it is supported) + * android.scaler.cropRegion + * android.statistics.faceDetectMode (if it is supported) + * 6. To reduce the amount of data passed across process boundaries at + * high frame rate, within one batch, camera framework only propagates + * the last shutter notify and the last capture results (including partial + * results and final result) to the app. The shutter notifies and capture + * results for the other requests in the batch are derived by + * the camera framework. As a result, the HAL can return empty metadata + * except for the last result in the batch. + * + * For more details about high speed stream requirements, see + * android.control.availableHighSpeedVideoConfigurations and + * CONSTRAINED_HIGH_SPEED_VIDEO capability defined in + * android.request.availableCapabilities. + * + * This mode only needs to be supported by HALs that include + * CONSTRAINED_HIGH_SPEED_VIDEO in the android.request.availableCapabilities + * static metadata. + */ + CONSTRAINED_HIGH_SPEED_MODE = 1, + + /** + * A set of vendor-defined operating modes, for custom default camera + * application features that can't be implemented in the fully flexible fashion + * required for NORMAL_MODE. + */ + VENDOR_MODE_0 = 0x8000, + VENDOR_MODE_1, + VENDOR_MODE_2, + VENDOR_MODE_3, + VENDOR_MODE_4, + VENDOR_MODE_5, + VENDOR_MODE_6, + VENDOR_MODE_7, +} diff --git a/camera/device/aidl/android/hardware/camera/device/StreamRotation.aidl b/camera/device/aidl/android/hardware/camera/device/StreamRotation.aidl new file mode 100644 index 0000000000..1eee97c5fd --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/StreamRotation.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.camera.device; + +/** + * StreamRotation: + * + * The required counterclockwise rotation of camera stream. + */ +@VintfStability +@Backing(type="int") +enum StreamRotation { + /** + * No rotation + */ + ROTATION_0 = 0, + + /** + * Rotate by 90 degree counterclockwise + */ + ROTATION_90 = 1, + + /** + * Rotate by 180 degree counterclockwise + */ + ROTATION_180 = 2, + + /** + * Rotate by 270 degree counterclockwise + */ + ROTATION_270 = 3, +} diff --git a/camera/device/aidl/android/hardware/camera/device/StreamType.aidl b/camera/device/aidl/android/hardware/camera/device/StreamType.aidl new file mode 100644 index 0000000000..4a876c7a15 --- /dev/null +++ b/camera/device/aidl/android/hardware/camera/device/StreamType.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. + */ + +package android.hardware.camera.device; + +/** + * StreamType: + * + * The type of the camera stream, which defines whether the camera HAL device is + * the producer or the consumer for that stream, and how the buffers of the + * stream relate to the other streams. + */ +@VintfStability +@Backing(type="int") +enum StreamType { + /** + * This stream is an output stream; the camera HAL device must fill buffers + * from this stream with newly captured or reprocessed image data. + */ + OUTPUT = 0, + + /** + * This stream is an input stream; the camera HAL device must read buffers + * from this stream and send them through the camera processing pipeline, + * as if the buffer was a newly captured image from the imager. + * + * The pixel format for input stream can be any format reported by + * android.scaler.availableInputOutputFormatsMap. The pixel format of the + * output stream that is used to produce the reprocessing data may be any + * format reported by android.scaler.availableStreamConfigurations. The + * supported input/output stream combinations depends the camera device + * capabilities, see android.scaler.availableInputOutputFormatsMap for + * stream map details. + * + * This kind of stream is generally used to reprocess data into higher + * quality images (that otherwise would cause a frame rate performance + * loss), or to do off-line reprocessing. + * + * The typical use cases are OPAQUE (typically ZSL) and YUV reprocessing, + * see S8.2, S8.3 and S10 for more details. + */ + INPUT = 1, +} diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp index 8eed19532f..9e6285756d 100644 --- a/compatibility_matrices/exclude/fcm_exclude.cpp +++ b/compatibility_matrices/exclude/fcm_exclude.cpp @@ -53,8 +53,9 @@ bool ShouldCheckMissingHalsInFcm(const std::string& package) { // AIDL "android.hardware.audio.common", "android.hardware.biometrics.common", - "android.hardware.biometrics.common", "android.hardware.camera.metadata", + "android.hardware.camera.device", + "android.hardware.common", "android.hardware.common.fmq", "android.hardware.graphics.common", "android.hardware.input.common", -- GitLab From 0b0d7332f146ba94cf00d8afa8ce655c4ba1c773 Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Wed, 3 Nov 2021 12:41:32 -0700 Subject: [PATCH 572/825] Add AIDL interface files for android.hardware.camera.common . Bug: 196432585 Test: build; implementation will be submitted later. Change-Id: Ic7577c557195464d9ef99506d8ceba172db14e0b Signed-off-by: Jayant Chowdhary --- camera/common/aidl/Android.bp | 19 ++ .../camera/common/CameraDeviceStatus.aidl | 40 ++++ .../camera/common/CameraMetadataType.aidl | 43 +++++ .../camera/common/CameraResourceCost.aidl | 39 ++++ .../hardware/camera/common/Status.aidl | 45 +++++ .../hardware/camera/common/TagBoundaryId.aidl | 39 ++++ .../camera/common/TorchModeStatus.aidl | 40 ++++ .../hardware/camera/common/VendorTag.aidl | 40 ++++ .../camera/common/VendorTagSection.aidl | 39 ++++ .../camera/common/CameraDeviceStatus.aidl | 64 +++++++ .../camera/common/CameraMetadataType.aidl | 32 ++++ .../camera/common/CameraResourceCost.aidl | 172 ++++++++++++++++++ .../hardware/camera/common/Status.aidl | 64 +++++++ .../hardware/camera/common/TagBoundaryId.aidl | 24 +++ .../camera/common/TorchModeStatus.aidl | 104 +++++++++++ .../hardware/camera/common/VendorTag.aidl | 30 +++ .../camera/common/VendorTagSection.aidl | 28 +++ .../exclude/fcm_exclude.cpp | 1 + 18 files changed, 863 insertions(+) create mode 100644 camera/common/aidl/Android.bp create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraDeviceStatus.aidl create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraMetadataType.aidl create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraResourceCost.aidl create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/Status.aidl create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TagBoundaryId.aidl create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TorchModeStatus.aidl create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/VendorTag.aidl create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/VendorTagSection.aidl create mode 100644 camera/common/aidl/android/hardware/camera/common/CameraDeviceStatus.aidl create mode 100644 camera/common/aidl/android/hardware/camera/common/CameraMetadataType.aidl create mode 100644 camera/common/aidl/android/hardware/camera/common/CameraResourceCost.aidl create mode 100644 camera/common/aidl/android/hardware/camera/common/Status.aidl create mode 100644 camera/common/aidl/android/hardware/camera/common/TagBoundaryId.aidl create mode 100644 camera/common/aidl/android/hardware/camera/common/TorchModeStatus.aidl create mode 100644 camera/common/aidl/android/hardware/camera/common/VendorTag.aidl create mode 100644 camera/common/aidl/android/hardware/camera/common/VendorTagSection.aidl diff --git a/camera/common/aidl/Android.bp b/camera/common/aidl/Android.bp new file mode 100644 index 0000000000..eca70aa170 --- /dev/null +++ b/camera/common/aidl/Android.bp @@ -0,0 +1,19 @@ +aidl_interface { + name: "android.hardware.camera.common", + vendor_available: true, + srcs: ["android/hardware/camera/common/*.aidl"], + stability: "vintf", + backend: { + cpp: { + enabled: false, + }, + java: { + enabled: false, + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraDeviceStatus.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraDeviceStatus.aidl new file mode 100644 index 0000000000..a53a914884 --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraDeviceStatus.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 -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.common; +@Backing(type="int") @VintfStability +enum CameraDeviceStatus { + NOT_PRESENT = 0, + PRESENT = 1, + ENUMERATING = 2, +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraMetadataType.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraMetadataType.aidl new file mode 100644 index 0000000000..287dea3ffc --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraMetadataType.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 -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.common; +@Backing(type="int") @VintfStability +enum CameraMetadataType { + BYTE = 0, + INT32 = 1, + FLOAT = 2, + INT64 = 3, + DOUBLE = 4, + RATIONAL = 5, +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraResourceCost.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraResourceCost.aidl new file mode 100644 index 0000000000..467f4510af --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/CameraResourceCost.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 -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.common; +@VintfStability +parcelable CameraResourceCost { + int resourceCost; + String[] conflictingDevices; +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/Status.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/Status.aidl new file mode 100644 index 0000000000..e1ec1896e9 --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/Status.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 -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.common; +@Backing(type="int") @VintfStability +enum Status { + OK = 0, + ILLEGAL_ARGUMENT = 1, + CAMERA_IN_USE = 2, + MAX_CAMERAS_IN_USE = 3, + METHOD_NOT_SUPPORTED = 4, + OPERATION_NOT_SUPPORTED = 5, + CAMERA_DISCONNECTED = 6, + INTERNAL_ERROR = 7, +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TagBoundaryId.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TagBoundaryId.aidl new file mode 100644 index 0000000000..2c6b500061 --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TagBoundaryId.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 -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.common; +@Backing(type="long") @VintfStability +enum TagBoundaryId { + AOSP = 0, + VENDOR = -2147483648, +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TorchModeStatus.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TorchModeStatus.aidl new file mode 100644 index 0000000000..cb1a2ae3d3 --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TorchModeStatus.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 -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.common; +@Backing(type="int") @VintfStability +enum TorchModeStatus { + NOT_AVAILABLE = 0, + AVAILABLE_OFF = 1, + AVAILABLE_ON = 2, +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/VendorTag.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/VendorTag.aidl new file mode 100644 index 0000000000..b8b4ef4a38 --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/VendorTag.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 -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.common; +@VintfStability +parcelable VendorTag { + int tagId; + String tagName; + android.hardware.camera.common.CameraMetadataType tagType; +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/VendorTagSection.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/VendorTagSection.aidl new file mode 100644 index 0000000000..140fba4545 --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/VendorTagSection.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 -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.common; +@VintfStability +parcelable VendorTagSection { + String sectionName; + android.hardware.camera.common.VendorTag[] tags; +} diff --git a/camera/common/aidl/android/hardware/camera/common/CameraDeviceStatus.aidl b/camera/common/aidl/android/hardware/camera/common/CameraDeviceStatus.aidl new file mode 100644 index 0000000000..0e88ea8930 --- /dev/null +++ b/camera/common/aidl/android/hardware/camera/common/CameraDeviceStatus.aidl @@ -0,0 +1,64 @@ +/* + * 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. + */ + +package android.hardware.camera.common; + +/** + * CameraDeviceStatus + * + * The current status of a camera device, as sent by a camera provider HAL + * through the ICameraProviderCallback::cameraDeviceStatusChange() call. + * + * At startup, the camera service must assume all internal camera devices listed + * by ICameraProvider::getCameraIdList() are in the PRESENT state. The provider + * must invoke ICameraProviderCallback::cameraDeviceStatusChange to inform the + * service of any initially NOT_PRESENT internal devices, and of any PRESENT + * external camera devices, as soon as the camera service has called + * ICameraProvider::setCallback(). + * + * Allowed state transitions: + * PRESENT -> NOT_PRESENT + * NOT_PRESENT -> ENUMERATING + * NOT_PRESENT -> PRESENT + * ENUMERATING -> PRESENT + * ENUMERATING -> NOT_PRESENT + */ +@VintfStability +@Backing(type="int") +enum CameraDeviceStatus { + /** + * The camera device is not currently connected, and trying to reference it + * in provider method calls must return status code ILLEGAL_ARGUMENT. + * + */ + NOT_PRESENT = 0, + /** + * The camera device is connected, and opening it is possible, as long as + * sufficient resources are available. + * + * By default, the framework must assume all devices returned by + * ICameraProvider::getCameraIdList() are in this state. + */ + PRESENT = 1, + /** + * The camera device is connected, but it is undergoing enumeration and + * startup, and so opening the device must return CAMERA_IN_USE. + * + * Attempting to call ICameraProvider::getCameraCharacteristics() must + * succeed, however. + */ + ENUMERATING = 2, +} diff --git a/camera/common/aidl/android/hardware/camera/common/CameraMetadataType.aidl b/camera/common/aidl/android/hardware/camera/common/CameraMetadataType.aidl new file mode 100644 index 0000000000..522bf9c32f --- /dev/null +++ b/camera/common/aidl/android/hardware/camera/common/CameraMetadataType.aidl @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package android.hardware.camera.common; + +/** + * Camera metadata type - duplicated from VNDK libcamera_metadata for vendor tag + * definitions. + */ +@VintfStability +@Backing(type="int") +enum CameraMetadataType { + BYTE = 0, + INT32 = 1, + FLOAT = 2, + INT64 = 3, + DOUBLE = 4, + RATIONAL = 5, +} diff --git a/camera/common/aidl/android/hardware/camera/common/CameraResourceCost.aidl b/camera/common/aidl/android/hardware/camera/common/CameraResourceCost.aidl new file mode 100644 index 0000000000..a471c994de --- /dev/null +++ b/camera/common/aidl/android/hardware/camera/common/CameraResourceCost.aidl @@ -0,0 +1,172 @@ +/* + * 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. + */ + +package android.hardware.camera.common; + +/** + * CameraResourceCost: + * + * Structure defining the abstract resource cost of opening a camera device, + * and any usage conflicts between multiple camera devices. + * + * Obtainable via ICameraDevice::getResourceCost() + */ +@VintfStability +parcelable CameraResourceCost { + /** + * The total resource "cost" of using this camera, represented as an integer + * value in the range [0, 100] where 100 represents total usage of the + * shared resource that is the limiting bottleneck of the camera subsystem. + * This may be a very rough estimate, and is used as a hint to the camera + * service to determine when to disallow multiple applications from + * simultaneously opening different cameras advertised by the camera + * service. + * + * The camera service must be able to simultaneously open and use any + * combination of camera devices exposed by the HAL where the sum of + * the resource costs of these cameras is <= 100. For determining cost, + * each camera device must be assumed to be configured and operating at + * the maximally resource-consuming framerate and stream size settings + * available in the configuration settings exposed for that device through + * the camera metadata. + * + * The camera service may still attempt to simultaneously open combinations + * of camera devices with a total resource cost > 100. This may succeed or + * fail. If this succeeds, combinations of configurations that are not + * supported due to resource constraints from having multiple open devices + * must fail during the configure calls. If the total resource cost is <= + * 100, open and configure must never fail for any stream configuration + * settings or other device capabilities that would normally succeed for a + * device when it is the only open camera device. + * + * This field may be used to determine whether background applications are + * allowed to use this camera device while other applications are using + * other camera devices. Note: multiple applications must never be allowed + * by the camera service to simultaneously open the same camera device. + * + * Example use cases: + * + * Ex. 1: Camera Device 0 = Back Camera + * Camera Device 1 = Front Camera + * - Using both camera devices causes a large framerate slowdown due to + * limited ISP bandwidth. + * + * Configuration: + * + * Camera Device 0 - resourceCost = 51 + * conflicting_devices = empty + * Camera Device 1 - resourceCost = 51 + * conflicting_devices = empty + * + * Result: + * + * Since the sum of the resource costs is > 100, if a higher-priority + * application has either device open, no lower-priority applications must + * be allowed by the camera service to open either device. If a + * lower-priority application is using a device that a higher-priority + * subsequently attempts to open, the lower-priority application must be + * forced to disconnect the device. + * + * If the highest-priority application chooses, it may still attempt to + * open both devices (since these devices are not listed as conflicting in + * the conflicting_devices fields), but usage of these devices may fail in + * the open or configure calls. + * + * Ex. 2: Camera Device 0 = Left Back Camera + * Camera Device 1 = Right Back Camera + * Camera Device 2 = Combined stereo camera using both right and left + * back camera sensors used by devices 0, and 1 + * Camera Device 3 = Front Camera + * - Due to do hardware constraints, up to two cameras may be open at + * once. The combined stereo camera may never be used at the same time + * as either of the two back camera devices (device 0, 1), and typically + * requires too much bandwidth to use at the same time as the front + * camera (device 3). + * + * Configuration: + * + * Camera Device 0 - resourceCost = 50 + * conflicting_devices = { 2 } + * Camera Device 1 - resourceCost = 50 + * conflicting_devices = { 2 } + * Camera Device 2 - resourceCost = 100 + * conflicting_devices = { 0, 1 } + * Camera Device 3 - resourceCost = 50 + * conflicting_devices = empty + * + * Result: + * + * Based on the conflicting_devices fields, the camera service guarantees + * that the following sets of open devices must never be allowed: { 1, 2 + * }, { 0, 2 }. + * + * Based on the resourceCost fields, if a high-priority foreground + * application is using camera device 0, a background application would be + * allowed to open camera device 1 or 3 (but would be forced to disconnect + * it again if the foreground application opened another device). + * + * The highest priority application may still attempt to simultaneously + * open devices 0, 2, and 3, but the HAL may fail in open or configure + * calls for this combination. + * + * Ex. 3: Camera Device 0 = Back Camera + * Camera Device 1 = Front Camera + * Camera Device 2 = Low-power Front Camera that uses the same sensor + * as device 1, but only exposes image stream + * resolutions that can be used in low-power mode + * - Using both front cameras (device 1, 2) at the same time is impossible + * due a shared physical sensor. Using the back and "high-power" front + * camera (device 1) may be impossible for some stream configurations due + * to hardware limitations, but the "low-power" front camera option may + * always be used as it has special dedicated hardware. + * + * Configuration: + * + * Camera Device 0 - resourceCost = 100 + * conflicting_devices = empty + * Camera Device 1 - resourceCost = 100 + * conflicting_devices = { 2 } + * Camera Device 2 - resourceCost = 0 + * conflicting_devices = { 1 } + * Result: + * + * Based on the conflicting_devices fields, the camera service guarantees + * that the following sets of open devices must never be allowed: + * { 1, 2 }. + * + * Based on the resourceCost fields, only the highest priority application + * may attempt to open both device 0 and 1 at the same time. If a + * higher-priority application is not using device 1 or 2, a low-priority + * background application may open device 2 (but must be forced to + * disconnect it if a higher-priority application subsequently opens + * device 1 or 2). + */ + int resourceCost; + /** + * An array of camera device IDs indicating other devices that cannot be + * simultaneously opened while this camera device is in use. + * + * This field is intended to be used to indicate that this camera device + * is a composite of several other camera devices, or otherwise has + * hardware dependencies that prohibit simultaneous usage. If there are no + * dependencies, an empty list may be returned to indicate this. + * + * The camera service must never simultaneously open any of the devices + * in this list while this camera device is open. + * + */ + String[] conflictingDevices; +} diff --git a/camera/common/aidl/android/hardware/camera/common/Status.aidl b/camera/common/aidl/android/hardware/camera/common/Status.aidl new file mode 100644 index 0000000000..1ea6ee8c16 --- /dev/null +++ b/camera/common/aidl/android/hardware/camera/common/Status.aidl @@ -0,0 +1,64 @@ +/* + * 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. + */ + +package android.hardware.camera.common; + +/** + * Common enumeration and structure definitions for all HALs under + * android.hardware.camera + * + * + * Status codes for camera HAL method service specific errors. + * + */ +@VintfStability +@Backing(type="int") +enum Status { + /** + * Method call succeeded + */ + OK = 0, + /** + * One of the arguments to the method call is invalid. For example, + * the camera ID is unknown. + */ + ILLEGAL_ARGUMENT = 1, + /** + * The specified camera device is already in use + */ + CAMERA_IN_USE = 2, + /** + * The HAL cannot support more simultaneous cameras in use. + */ + MAX_CAMERAS_IN_USE = 3, + /** + * This HAL does not support this method. + */ + METHOD_NOT_SUPPORTED = 4, + /** + * The specified camera device does not support this operation. + */ + OPERATION_NOT_SUPPORTED = 5, + /** + * This camera device is no longer connected or otherwise available for use + */ + CAMERA_DISCONNECTED = 6, + /** + * The HAL has encountered an internal error and cannot complete the + * request. + */ + INTERNAL_ERROR = 7, +} diff --git a/camera/common/aidl/android/hardware/camera/common/TagBoundaryId.aidl b/camera/common/aidl/android/hardware/camera/common/TagBoundaryId.aidl new file mode 100644 index 0000000000..f81e5b67b3 --- /dev/null +++ b/camera/common/aidl/android/hardware/camera/common/TagBoundaryId.aidl @@ -0,0 +1,24 @@ +/* + * 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. + */ + +package android.hardware.camera.common; + +@VintfStability +@Backing(type="long") +enum TagBoundaryId { + AOSP = 0x0, + VENDOR = 0x80000000, +} diff --git a/camera/common/aidl/android/hardware/camera/common/TorchModeStatus.aidl b/camera/common/aidl/android/hardware/camera/common/TorchModeStatus.aidl new file mode 100644 index 0000000000..42a8816a6c --- /dev/null +++ b/camera/common/aidl/android/hardware/camera/common/TorchModeStatus.aidl @@ -0,0 +1,104 @@ +/* + * 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. + */ + +package android.hardware.camera.common; + +/** + * TorchModeStatus: + * + * The current status of the torch mode on a given camera device, sent by a + * camera provider HAL via the ICameraProviderCallback::TorchModeStatusChange() + * call. + * + * The torch mode status of a camera device is applicable only when the camera + * device is present. The camera service must not call + * ICameraProvider::setTorchMode() to turn on torch mode of a camera device if + * the camera device is not present. At camera service startup time, the + * framework must assume torch modes are in the AVAILABLE_OFF state if the + * camera device is present and the camera characteristics entry + * android.flash.info.available is reported as true via + * ICameraProvider::getCameraCharacteristics() call. The same is assumed for + * external camera devices when they are initially connected. + * + * The camera service requires the following behaviors from the camera provider + * HAL when a camera device's status changes: + * + * 1. A previously-disconnected camera device becomes connected. After + * ICameraProviderCallback::CameraDeviceStatusChange() is invoked to inform + * the camera service that the camera device is present, the framework must + * assume the camera device's torch mode is in AVAILABLE_OFF state if it + * has a flash unit. The camera provider HAL does not need to invoke + * ICameraProviderCallback::TorchModeStatusChange() unless the flash unit + * is unavailable to use by ICameraProvider::setTorchMode(). + * + * 2. A previously-connected camera becomes disconnected. After + * ICameraProviderCallback::CameraDeviceStatusChange() is invoked to inform + * the camera service that the camera device is not present, the framework + * must not call ICameraProvider::setTorchMode() for the disconnected camera + * device until it is connected again. The camera provider HAL does not + * need to invoke ICameraProviderCallback::TorchModeStatusChange() + * separately to inform that the flash unit has become NOT_AVAILABLE. + * + * 3. openCameraDevice() or openCameraDeviceVersion() is called to open a + * camera device. The camera provider HAL must invoke + * ICameraProviderCallback::TorchModeStatusChange() for all flash units + * that have entered NOT_AVAILABLE state and can not be turned on by + * calling ICameraProvider::setTorchMode() due to this open() call. + * openCameraDevice() must not trigger AVAILABLE_OFF before NOT_AVAILABLE + * for all flash units that have become unavailable. + * + * 4. ICameraDevice.close() is called to close a camera device. The camera + * provider HAL must call ICameraProviderCallback::torchModeStatusChange() + * for all flash units that have now entered the AVAILABLE_OFF state and + * can be turned on by calling ICameraProvider::setTorchMode() again because + * of sufficient new camera resources being freed up by this close() call. + * + * Note that the camera service calling ICameraProvider::setTorchMode() + * successfully must trigger AVAILABLE_OFF or AVAILABLE_ON callback for the + * given camera device. Additionally it must trigger AVAILABLE_OFF callbacks + * for other previously-on torch modes if HAL cannot keep multiple devices' + * flashlights on simultaneously. + */ +@VintfStability +@Backing(type="int") +enum TorchModeStatus { + /** + * The flash unit is no longer available and the torch mode can not be + * turned on by calling setTorchMode(). If the torch mode was AVAILABLE_ON, + * the flashlight must be turned off by the provider HAL before the provider + * HAL calls torchModeStatusChange(). + */ + NOT_AVAILABLE = 0, + /** + * A torch mode has become off and is available to be turned on via + * ICameraProvider::setTorchMode(). This may happen in the following + * cases: + * 1. After the resources to turn on the torch mode have become available. + * 2. After ICameraProvider::setTorchMode() is called to turn off the torch + * mode. + * 3. After the camera service turned on the torch mode for some other + * camera device and the provider HAL had to turn off the torch modes + * of other camera device(s) that were previously on, due to lack of + * resources to keep them all on. + */ + AVAILABLE_OFF = 1, + /** + * A torch mode has become on and is available to be turned off via + * ICameraProvider::setTorchMode(). This can happen only after + * ICameraProvider::setTorchMode() has been called to turn on the torch mode. + */ + AVAILABLE_ON = 2, +} diff --git a/camera/common/aidl/android/hardware/camera/common/VendorTag.aidl b/camera/common/aidl/android/hardware/camera/common/VendorTag.aidl new file mode 100644 index 0000000000..1de2fbfda2 --- /dev/null +++ b/camera/common/aidl/android/hardware/camera/common/VendorTag.aidl @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package android.hardware.camera.common; + +import android.hardware.camera.common.CameraMetadataType; + +/** + * A single vendor-unique metadata tag. + * The full name of the tag is . + */ +@VintfStability +parcelable VendorTag { + int tagId; + String tagName; + CameraMetadataType tagType; +} diff --git a/camera/common/aidl/android/hardware/camera/common/VendorTagSection.aidl b/camera/common/aidl/android/hardware/camera/common/VendorTagSection.aidl new file mode 100644 index 0000000000..010eebcbd0 --- /dev/null +++ b/camera/common/aidl/android/hardware/camera/common/VendorTagSection.aidl @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package android.hardware.camera.common; + +import android.hardware.camera.common.VendorTag; + +/** + * A set of related vendor tags. + */ +@VintfStability +parcelable VendorTagSection { + String sectionName; + VendorTag[] tags; +} diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp index 9e6285756d..6de9d03683 100644 --- a/compatibility_matrices/exclude/fcm_exclude.cpp +++ b/compatibility_matrices/exclude/fcm_exclude.cpp @@ -55,6 +55,7 @@ bool ShouldCheckMissingHalsInFcm(const std::string& package) { "android.hardware.biometrics.common", "android.hardware.camera.metadata", "android.hardware.camera.device", + "android.hardware.camera.common", "android.hardware.common", "android.hardware.common.fmq", "android.hardware.graphics.common", -- GitLab From bab1ba54ede32520a5042d616a3af46ad4f55d5f Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Tue, 1 Feb 2022 17:54:20 -0500 Subject: [PATCH 573/825] Add a Java backend for android.hardware.graphics.common AIDL This will allow SysUI to access the same struct (in I27f119f927b23052c5fd8f068cbca75338fe7b91) that HWC uses to describe its support for DISPLAY_DECORATION. @hide each API individually. SysUI can access hidden APIs. Otherwise leave the AIDL files are unchanged. Bug: 216644902 Test: make Change-Id: Id33f76e4c55b22d007c7e2314a4dfb778562bace --- graphics/common/aidl/Android.bp | 3 ++- .../current/android/hardware/graphics/common/BlendMode.aidl | 1 + .../current/android/hardware/graphics/common/BufferUsage.aidl | 1 + .../current/android/hardware/graphics/common/ChromaSiting.aidl | 1 + .../android/hardware/graphics/common/ColorTransform.aidl | 1 + .../current/android/hardware/graphics/common/Compression.aidl | 1 + .../current/android/hardware/graphics/common/Cta861_3.aidl | 1 + .../current/android/hardware/graphics/common/Dataspace.aidl | 1 + .../android/hardware/graphics/common/ExtendableType.aidl | 1 + .../current/android/hardware/graphics/common/FRect.aidl | 1 + .../android/hardware/graphics/common/HardwareBuffer.aidl | 1 + .../hardware/graphics/common/HardwareBufferDescription.aidl | 1 + .../current/android/hardware/graphics/common/Hdr.aidl | 1 + .../current/android/hardware/graphics/common/Interlaced.aidl | 1 + .../current/android/hardware/graphics/common/PixelFormat.aidl | 1 + .../current/android/hardware/graphics/common/PlaneLayout.aidl | 1 + .../android/hardware/graphics/common/PlaneLayoutComponent.aidl | 1 + .../hardware/graphics/common/PlaneLayoutComponentType.aidl | 1 + .../current/android/hardware/graphics/common/Point.aidl | 1 + .../current/android/hardware/graphics/common/Rect.aidl | 1 + .../current/android/hardware/graphics/common/Smpte2086.aidl | 1 + .../android/hardware/graphics/common/StandardMetadataType.aidl | 1 + .../current/android/hardware/graphics/common/Transform.aidl | 1 + .../current/android/hardware/graphics/common/XyColor.aidl | 1 + .../aidl/android/hardware/graphics/common/BlendMode.aidl | 1 + .../aidl/android/hardware/graphics/common/BufferUsage.aidl | 1 + .../aidl/android/hardware/graphics/common/ChromaSiting.aidl | 1 + .../aidl/android/hardware/graphics/common/ColorTransform.aidl | 1 + .../aidl/android/hardware/graphics/common/Compression.aidl | 1 + .../common/aidl/android/hardware/graphics/common/Cta861_3.aidl | 1 + .../aidl/android/hardware/graphics/common/Dataspace.aidl | 1 + .../aidl/android/hardware/graphics/common/ExtendableType.aidl | 1 + .../common/aidl/android/hardware/graphics/common/FRect.aidl | 1 + .../aidl/android/hardware/graphics/common/HardwareBuffer.aidl | 1 + .../hardware/graphics/common/HardwareBufferDescription.aidl | 1 + graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl | 1 + .../aidl/android/hardware/graphics/common/Interlaced.aidl | 1 + .../aidl/android/hardware/graphics/common/PixelFormat.aidl | 1 + .../aidl/android/hardware/graphics/common/PlaneLayout.aidl | 1 + .../android/hardware/graphics/common/PlaneLayoutComponent.aidl | 1 + .../hardware/graphics/common/PlaneLayoutComponentType.aidl | 1 + .../common/aidl/android/hardware/graphics/common/Point.aidl | 1 + .../common/aidl/android/hardware/graphics/common/Rect.aidl | 1 + .../aidl/android/hardware/graphics/common/Smpte2086.aidl | 1 + .../android/hardware/graphics/common/StandardMetadataType.aidl | 1 + .../aidl/android/hardware/graphics/common/Transform.aidl | 1 + .../common/aidl/android/hardware/graphics/common/XyColor.aidl | 1 + 47 files changed, 48 insertions(+), 1 deletion(-) diff --git a/graphics/common/aidl/Android.bp b/graphics/common/aidl/Android.bp index 69ee49897a..d44252a61b 100644 --- a/graphics/common/aidl/Android.bp +++ b/graphics/common/aidl/Android.bp @@ -25,7 +25,8 @@ aidl_interface { ], backend: { java: { - enabled: false, + enabled: true, + platform_apis: true, }, cpp: { enabled: false, diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BlendMode.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BlendMode.aidl index 1c1938105e..d1f61beee8 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BlendMode.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BlendMode.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @Backing(type="int") @VintfStability enum BlendMode { INVALID = 0, 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 e1edb17793..d3ab44f2ce 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @Backing(type="long") @VintfStability enum BufferUsage { CPU_READ_MASK = 15, 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 7f0d73460a..b8af644604 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @Backing(type="long") @VintfStability enum ChromaSiting { NONE = 0, diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ColorTransform.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ColorTransform.aidl index 255a42f61e..f74859b788 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ColorTransform.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ColorTransform.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @Backing(type="int") @VintfStability enum ColorTransform { IDENTITY = 0, diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Compression.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Compression.aidl index 5b76376a2e..4f155e19a9 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Compression.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Compression.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @Backing(type="long") @VintfStability enum Compression { NONE = 0, diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Cta861_3.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Cta861_3.aidl index fbe4b2a4d2..ec90c9c64f 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Cta861_3.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Cta861_3.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @VintfStability parcelable Cta861_3 { float maxContentLightLevel; 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 3d97cff0d2..668b033174 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @Backing(type="int") @VintfStability enum Dataspace { UNKNOWN = 0, diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ExtendableType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ExtendableType.aidl index 3ada312a5c..5ff17752f7 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ExtendableType.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ExtendableType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @VintfStability parcelable ExtendableType { @utf8InCpp String name; diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/FRect.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/FRect.aidl index cb8190b424..7972e111e2 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/FRect.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/FRect.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @VintfStability parcelable FRect { float left; 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 4d8f78d77c..1817769af2 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,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @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/HardwareBufferDescription.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBufferDescription.aidl index 495504931d..70f46a1e6c 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBufferDescription.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBufferDescription.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @VintfStability parcelable HardwareBufferDescription { int width; diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl index 0320a66f56..7bae45e949 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Hdr.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @Backing(type="int") @VintfStability enum Hdr { DOLBY_VISION = 1, diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Interlaced.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Interlaced.aidl index 30b4e03c45..e04d2ab2bd 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Interlaced.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Interlaced.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @Backing(type="long") @VintfStability enum Interlaced { NONE = 0, 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 512fecbd86..59d6468d54 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @Backing(type="int") @VintfStability enum PixelFormat { UNSPECIFIED = 0, diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayout.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayout.aidl index 75fac9f3db..a09097511b 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayout.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayout.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @VintfStability parcelable PlaneLayout { android.hardware.graphics.common.PlaneLayoutComponent[] components; diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponent.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponent.aidl index 20c0a0bb01..0768240bf5 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponent.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponent.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @VintfStability parcelable PlaneLayoutComponent { android.hardware.graphics.common.ExtendableType type; 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 2f7d414aac..8ba93811a4 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @Backing(type="long") @VintfStability enum PlaneLayoutComponentType { Y = 1, diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl index 3722803cfe..af4705a1e4 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @VintfStability parcelable Point { int x; diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Rect.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Rect.aidl index eb42027f16..463a68f973 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Rect.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Rect.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @VintfStability parcelable Rect { int left; diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Smpte2086.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Smpte2086.aidl index 2be31d8e99..dce9226c09 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Smpte2086.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Smpte2086.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @VintfStability parcelable Smpte2086 { android.hardware.graphics.common.XyColor primaryRed; diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl index 150215c6f1..06b31a2036 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @Backing(type="long") @VintfStability enum StandardMetadataType { INVALID = 0, 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 359c655e00..986d089027 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @Backing(type="int") @VintfStability enum Transform { NONE = 0, diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/XyColor.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/XyColor.aidl index b42de183dd..e300f25dad 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/XyColor.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/XyColor.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; +/* @hide */ @VintfStability parcelable XyColor { float x; diff --git a/graphics/common/aidl/android/hardware/graphics/common/BlendMode.aidl b/graphics/common/aidl/android/hardware/graphics/common/BlendMode.aidl index 242813555b..fa3f9e3364 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/BlendMode.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/BlendMode.aidl @@ -18,6 +18,7 @@ package android.hardware.graphics.common; /** * Blend modes, settable per layer. + * @hide */ @VintfStability @Backing(type="int") diff --git a/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl b/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl index 60dfbfb319..03a71bdf75 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl @@ -18,6 +18,7 @@ package android.hardware.graphics.common; /** * Buffer usage definitions. + * @hide */ @VintfStability @Backing(type="long") diff --git a/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl b/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl index 562a664587..ac448535e8 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl @@ -18,6 +18,7 @@ package android.hardware.graphics.common; /** * Used by IAllocator/IMapper (gralloc) to describe standard chroma siting + * @hide */ @VintfStability @Backing(type="long") diff --git a/graphics/common/aidl/android/hardware/graphics/common/ColorTransform.aidl b/graphics/common/aidl/android/hardware/graphics/common/ColorTransform.aidl index a8784f5ee9..24ed8274fc 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/ColorTransform.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/ColorTransform.aidl @@ -19,6 +19,7 @@ package android.hardware.graphics.common; /** * Color transforms that may be applied by hardware composer to the whole * display. + * @hide */ @VintfStability @Backing(type="int") diff --git a/graphics/common/aidl/android/hardware/graphics/common/Compression.aidl b/graphics/common/aidl/android/hardware/graphics/common/Compression.aidl index 4cca1baff0..57afa14cbb 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/Compression.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/Compression.aidl @@ -18,6 +18,7 @@ package android.hardware.graphics.common; /** * Used by IAllocator/IMapper (gralloc) to describe standard compression strategies + * @hide */ @VintfStability @Backing(type="long") diff --git a/graphics/common/aidl/android/hardware/graphics/common/Cta861_3.aidl b/graphics/common/aidl/android/hardware/graphics/common/Cta861_3.aidl index 4fbc6b2344..9b90a2bfe6 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/Cta861_3.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/Cta861_3.aidl @@ -20,6 +20,7 @@ package android.hardware.graphics.common; * HDR static metadata extension as specified by CTA-861.3. * * This is an AIDL counterpart of the NDK struct `AHdrMetadata_cta861_3`. + * @hide */ @VintfStability parcelable Cta861_3 { diff --git a/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl index 42cdd8128c..5e9360fced 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl @@ -16,6 +16,7 @@ package android.hardware.graphics.common; +/** @hide */ @VintfStability @Backing(type="int") enum Dataspace { diff --git a/graphics/common/aidl/android/hardware/graphics/common/ExtendableType.aidl b/graphics/common/aidl/android/hardware/graphics/common/ExtendableType.aidl index 495693c9bd..3f70c1ab0a 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/ExtendableType.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/ExtendableType.aidl @@ -22,6 +22,7 @@ package android.hardware.graphics.common; * proprietary vendor compression strategy. Instead, compression is represented using this * ExtendableType that can support standard compression strategies while still allowing * every vendor to easily add their own non-standard definitions. + * @hide */ @VintfStability parcelable ExtendableType { diff --git a/graphics/common/aidl/android/hardware/graphics/common/FRect.aidl b/graphics/common/aidl/android/hardware/graphics/common/FRect.aidl index f9f2b6003c..64595a2a77 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/FRect.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/FRect.aidl @@ -17,6 +17,7 @@ package android.hardware.graphics.common; /** * General purpose definition of a rectangle with floating point corners. + * @hide */ @VintfStability diff --git a/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl b/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl index 5a22c0f8d4..50306dcadd 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl @@ -24,6 +24,7 @@ import android.hardware.graphics.common.HardwareBufferDescription; * * @note This is different from the public HardwareBuffer. * @sa +ndk libnativewindow#AHardwareBuffer + * @hide */ @VintfStability parcelable HardwareBuffer { diff --git a/graphics/common/aidl/android/hardware/graphics/common/HardwareBufferDescription.aidl b/graphics/common/aidl/android/hardware/graphics/common/HardwareBufferDescription.aidl index 078c5126fa..cc53da4cab 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/HardwareBufferDescription.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/HardwareBufferDescription.aidl @@ -23,6 +23,7 @@ import android.hardware.graphics.common.PixelFormat; * Stable AIDL counterpart of AHardwareBuffer_Desc. * * @sa +ndk libnativewindow#AHardwareBuffer_Desc + * @hide */ @VintfStability parcelable HardwareBufferDescription { diff --git a/graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl b/graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl index f6d02ddf9f..f543780d65 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/Hdr.aidl @@ -18,6 +18,7 @@ package android.hardware.graphics.common; /** * Supported HDR formats. Must be kept in sync with equivalents in Display.java. + * @hide */ @VintfStability @Backing(type="int") diff --git a/graphics/common/aidl/android/hardware/graphics/common/Interlaced.aidl b/graphics/common/aidl/android/hardware/graphics/common/Interlaced.aidl index a3f1baa53a..26252a5029 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/Interlaced.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/Interlaced.aidl @@ -18,6 +18,7 @@ package android.hardware.graphics.common; /** * Used by IAllocator/IMapper (gralloc) to describe standard interlaced strategies + * @hide */ @VintfStability @Backing(type="long") diff --git a/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl b/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl index 4e891f6f9d..ccf437bdb2 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/PixelFormat.aidl @@ -18,6 +18,7 @@ package android.hardware.graphics.common; /** * Pixel formats for graphics buffers. + * @hide */ @VintfStability @Backing(type="int") diff --git a/graphics/common/aidl/android/hardware/graphics/common/PlaneLayout.aidl b/graphics/common/aidl/android/hardware/graphics/common/PlaneLayout.aidl index b329cb2d3c..bbbcf09911 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/PlaneLayout.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/PlaneLayout.aidl @@ -32,6 +32,7 @@ import android.hardware.graphics.common.Rect; * - Pixel - a pixel is comprised of all the (non-metadata/raw) components in buffer across * all planes. For example, a buffer with a plane of Y and a plane of CbCr has a pixel * of YCbCr. + * @hide */ @VintfStability diff --git a/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponent.aidl b/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponent.aidl index c04cef021b..ccf8fe39e3 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponent.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponent.aidl @@ -32,6 +32,7 @@ import android.hardware.graphics.common.ExtendableType; * - Pixel - a pixel is comprised of all the (non-metadata/raw) components in buffer across * all planes. For example, a buffer with a plane of Y and a plane of CbCr has a pixel * of YCbCr. + * @hide */ @VintfStability diff --git a/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponentType.aidl b/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponentType.aidl index ce083966fe..1a11400df3 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponentType.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/PlaneLayoutComponentType.aidl @@ -23,6 +23,7 @@ package android.hardware.graphics.common; * reasons. However, unlike gralloc1's android_flex_component, this field is NOT a bit field. * A plane's components should NOT be expressed by bitwise OR-ing different * PlaneLayoutComponentTypes together. + * @hide */ @VintfStability @Backing(type="long") diff --git a/graphics/common/aidl/android/hardware/graphics/common/Point.aidl b/graphics/common/aidl/android/hardware/graphics/common/Point.aidl index b3ede44ad6..92372ebc2f 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/Point.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/Point.aidl @@ -18,6 +18,7 @@ package android.hardware.graphics.common; /** * General purpose definition of a point. + * @hide */ @VintfStability diff --git a/graphics/common/aidl/android/hardware/graphics/common/Rect.aidl b/graphics/common/aidl/android/hardware/graphics/common/Rect.aidl index 1a3bc11e4f..5820261b39 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/Rect.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/Rect.aidl @@ -18,6 +18,7 @@ package android.hardware.graphics.common; /** * General purpose definition of a rectangle. + * @hide */ @VintfStability diff --git a/graphics/common/aidl/android/hardware/graphics/common/Smpte2086.aidl b/graphics/common/aidl/android/hardware/graphics/common/Smpte2086.aidl index 60614cd9bb..d83a35d34d 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/Smpte2086.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/Smpte2086.aidl @@ -21,6 +21,7 @@ import android.hardware.graphics.common.XyColor; * Mastering display metadata as specified by SMPTE ST 2086. * * This is an AIDL counterpart of the NDK struct `AHdrMetadata_smpte2086`. + * @hide */ @VintfStability parcelable Smpte2086 { diff --git a/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl b/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl index 74a9ce309b..8126143dd0 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl @@ -34,6 +34,7 @@ package android.hardware.graphics.common; * * The StandardMetadataType encode/decode support library can be found in: * frameworks/native/libs/gralloc/types/include/gralloctypes/Gralloc4.h. + * @hide */ @VintfStability @Backing(type="long") diff --git a/graphics/common/aidl/android/hardware/graphics/common/Transform.aidl b/graphics/common/aidl/android/hardware/graphics/common/Transform.aidl index 4b3a1b11fe..8df82b5b01 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/Transform.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/Transform.aidl @@ -18,6 +18,7 @@ package android.hardware.graphics.common; /** * Transformation definitions + * @hide */ @VintfStability @Backing(type="int") diff --git a/graphics/common/aidl/android/hardware/graphics/common/XyColor.aidl b/graphics/common/aidl/android/hardware/graphics/common/XyColor.aidl index 9571273d7d..6885abaaa1 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/XyColor.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/XyColor.aidl @@ -22,6 +22,7 @@ package android.hardware.graphics.common; * This is an AIDL counterpart of the NDK struct `AColor_xy`. * * @note This can be used to represent any 2-dimensional chromaticity. + * @hide */ @VintfStability parcelable XyColor { -- GitLab From 5ea2d1799ce1d20f1d39b8538a8d9e5b82545005 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 4 Feb 2022 04:50:21 +0000 Subject: [PATCH 574/825] uwb(hal): Add an android specifci aoa_result_req value This is needed for supporting antenna interleaving feature. Bug: 205730040 Test: Compiles Change-Id: I06696c1624cbe5af67124ae5f807ef0bcc983194 --- .../fira_android/UwbAndroidCapabilities.aidl | 2 +- .../UwbVendorCapabilityTlvTypes.aidl | 1 + .../UwbVendorSessionAppConfigTlvValues.aidl | 38 ++++++++++++++++++ .../fira_android/UwbAndroidCapabilities.aidl | 2 +- .../UwbVendorCapabilityTlvTypes.aidl | 12 ++++++ .../UwbVendorSessionAppConfigTlvTypes.aidl | 2 +- .../UwbVendorSessionAppConfigTlvValues.aidl | 39 +++++++++++++++++++ 7 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl create mode 100644 uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl index 7e3be56d64..61a5548301 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl @@ -35,5 +35,5 @@ package android.hardware.uwb.fira_android; @Backing(type="long") @VintfStability enum UwbAndroidCapabilities { POWER_STATS_QUERY = 1, - ANTENNAE_INTERLEAVING = 2, + ANTENNA_INTERLEAVING = 2, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index bc73b89ced..f5cf8a388f 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -43,4 +43,5 @@ enum UwbVendorCapabilityTlvTypes { CCC_SUPPORTED_CHANNELS = 166, CCC_SUPPORTED_HOPPING_SEQUENCES = 167, CCC_SUPPORTED_HOPPING_CONFIG_MODES = 168, + SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 227, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl new file mode 100644 index 0000000000..a7f487bcd2 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.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 -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.uwb.fira_android; +@Backing(type="int") @VintfStability +enum UwbVendorSessionAppConfigTlvValues { + AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 240, +} diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl index 0af99e0f29..1f9c9bbce7 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl @@ -27,5 +27,5 @@ package android.hardware.uwb.fira_android; @Backing(type="long") enum UwbAndroidCapabilities { POWER_STATS_QUERY = 0x1, - ANTENNAE_INTERLEAVING = 0x2, + ANTENNA_INTERLEAVING = 0x2, } diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index 968cd17884..1f502c3835 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -91,4 +91,16 @@ enum UwbVendorCapabilityTlvTypes { * HOPPING_CONFIG_MODE_ADAPTIVE = 2 */ CCC_SUPPORTED_HOPPING_CONFIG_MODES = 0xA8, + + /********************************************* + * FIRA specific + ********************************************/ + /** + * 1 byte value to indicate support for antennare interleaving + * feature. + * Values: + * 1 - Feature supported. + * 0 - Feature not supported. + */ + SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 0xE3, } diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl index b770ee0145..2b21f35f8b 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl @@ -58,7 +58,7 @@ enum UwbVendorSessionAppConfigTlvTypes { * Added in vendor version 0. * Interleaving ratio if AOA_RESULT_REQ is set to 0xF0. * Supported only if the value returned by getSupportedAndroidCapabilities() - * has the bit of UwbAndroidCapabilities.ANTENNAE_INTERLEAVING set to 1. + * has the bit of UwbAndroidCapabilities.ANTENNA_INTERLEAVING set to 1. */ /** 2 byte data */ NB_OF_RANGE_MEASUREMENTS = 0xE3, diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl new file mode 100644 index 0000000000..33932bb120 --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.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. + */ + +package android.hardware.uwb.fira_android; + +/** + * Android specific vendor app config values set/expected in UCI command: + * GID: 0001b (UWB Session config Group) + * OID: 000011b (SESSION_SET_APP_CONFIG_CMD) + * OID: 000100b (SESSION_GET_APP_CONFIG_CMD) + * + * Note: Refer to Table 34 of the UCI specification for the other values + * expected in this command. + */ +@VintfStability +@Backing(type="int") +enum UwbVendorSessionAppConfigTlvValues { + /** + * Added in vendor version 0. + * Supported only if the value returned by getSupportedAndroidCapabilities() + * has the bit of UwbAndroidCapabilities.ANTENNA_INTERLEAVING set to 1. + * Set AOA_RESULT_REQ (Config ID - 0x0D) to this value to turn on antenna + * interleaving feature. + */ + AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 0xF0, +} -- GitLab From cb39dd0514783979bde7492f7d93f11377bf0d2f Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Fri, 4 Feb 2022 14:10:53 -0800 Subject: [PATCH 575/825] Remove InputClassifier from current compatibility We don't need InputClassifier because it was converted to aidl InputProcessor. New usages should all be on aidl. Bug: 205761620 Test: tested deep touch on device Change-Id: Id6b3c1db30f218e4cc1fa1653817a458f5ab56bf --- compatibility_matrices/compatibility_matrix.current.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 95ba217fb0..28c673aeaa 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -374,14 +374,6 @@ default - - android.hardware.input.classifier - 1.0 - - IInputClassifier - default - - android.hardware.input.processor 1 -- GitLab From f815455af5a3fcc6e03a32db3849bb183c86ae70 Mon Sep 17 00:00:00 2001 From: Ahmed ElArabawy Date: Fri, 4 Feb 2022 15:29:00 -0800 Subject: [PATCH 576/825] IHostapd: Add support for OWE security encryption type. This commit is to add the EncryptionType:WPA3_OWE to allow setup of OWE Soft-AP. Bug: 217669241 Test: VTS tests Change-Id: Ib862ba014eacaf4429bd3e44def3f7394643f98e --- .../current/android/hardware/wifi/hostapd/EncryptionType.aidl | 3 ++- .../aidl/android/hardware/wifi/hostapd/EncryptionType.aidl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/EncryptionType.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/EncryptionType.aidl index ae3dccb63b..a7b20fa053 100644 --- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/EncryptionType.aidl +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/EncryptionType.aidl @@ -39,5 +39,6 @@ enum EncryptionType { WPA2 = 2, WPA3_SAE_TRANSITION = 3, WPA3_SAE = 4, - OWE_TRANSITION = 5, + WPA3_OWE_TRANSITION = 5, + WPA3_OWE = 6, } diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/EncryptionType.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/EncryptionType.aidl index a8f3252d3b..eb06b4a389 100644 --- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/EncryptionType.aidl +++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/EncryptionType.aidl @@ -29,5 +29,6 @@ enum EncryptionType { WPA2, WPA3_SAE_TRANSITION, WPA3_SAE, - OWE_TRANSITION, + WPA3_OWE_TRANSITION, + WPA3_OWE, } -- GitLab From 7853416a07c925bac59554b5546d5b7ef96b52c7 Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Wed, 19 Jan 2022 22:22:22 -0800 Subject: [PATCH 577/825] Camera: Add automotive metadata section This CL adds a new automotive metadata section with below fields: - AUTOMOTIVE_LOCATION describes where the camera exists. - AUTOMOTIVE_LENS_FACING tells where the camera's lens is facing toward. Bug: 205156620 Test: m -j Change-Id: Idc88d26a6834f30bbfd66d5a1ae74409dcf7b0dd --- camera/metadata/3.8/types.hal | 92 ++++++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 1 deletion(-) diff --git a/camera/metadata/3.8/types.hal b/camera/metadata/3.8/types.hal index 488bf9d3cc..1b1a7a263b 100644 --- a/camera/metadata/3.8/types.hal +++ b/camera/metadata/3.8/types.hal @@ -29,7 +29,34 @@ import android.hardware.camera.metadata@3.5; import android.hardware.camera.metadata@3.6; import android.hardware.camera.metadata@3.7; -// No new metadata sections added in this revision +/** + * Top level hierarchy definitions for camera metadata. *_INFO sections are for + * the static metadata that can be retrieved without opening the camera device. + */ +enum CameraMetadataSection : @3.4::CameraMetadataSection { + ANDROID_AUTOMOTIVE = + android.hardware.camera.metadata@3.4::CameraMetadataSection:ANDROID_SECTION_COUNT, + + ANDROID_AUTOMOTIVE_LENS, + + ANDROID_SECTION_COUNT_3_8, + + VENDOR_SECTION_3_8 = 0x8000, + +}; + +/** + * Hierarchy positions in enum space. All vendor extension sections must be + * defined with tag >= VENDOR_SECTION_START + */ +enum CameraMetadataSectionStart : android.hardware.camera.metadata@3.4::CameraMetadataSectionStart { + ANDROID_AUTOMOTIVE_START = CameraMetadataSection:ANDROID_AUTOMOTIVE << 16, + + ANDROID_AUTOMOTIVE_LENS_START = CameraMetadataSection:ANDROID_AUTOMOTIVE_LENS << 16, + + VENDOR_SECTION_START_3_8 = CameraMetadataSection:VENDOR_SECTION_3_8 << 16, + +}; /** * Main enumeration for defining camera metadata tags added in this revision @@ -76,6 +103,23 @@ enum CameraMetadataTag : @3.7::CameraMetadataTag { ANDROID_SCALER_END_3_8, + /** android.automotive.location [static, enum, public] + * + *

Location of the cameras on the automotive devices.

+ */ + ANDROID_AUTOMOTIVE_LOCATION = CameraMetadataSectionStart:ANDROID_AUTOMOTIVE_START, + + ANDROID_AUTOMOTIVE_END_3_8, + + /** android.automotive.lens.facing [static, enum[], public] + * + *

The direction of the camera faces relative to the vehicle body frame and the + * passenger seats.

+ */ + ANDROID_AUTOMOTIVE_LENS_FACING = CameraMetadataSectionStart:ANDROID_AUTOMOTIVE_LENS_START, + + ANDROID_AUTOMOTIVE_LENS_END_3_8, + }; /* @@ -90,6 +134,14 @@ enum CameraMetadataEnumAndroidControlVideoStabilizationMode : ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION, }; +/** android.lens.poseReference enumeration values added since v3.5 + * @see ANDROID_LENS_POSE_REFERENCE + */ +enum CameraMetadataEnumAndroidLensPoseReference : + @3.5::CameraMetadataEnumAndroidLensPoseReference { + ANDROID_LENS_POSE_REFERENCE_AUTOMOTIVE, +}; + /** android.request.availableCapabilities enumeration values added since v3.6 * @see ANDROID_REQUEST_AVAILABLE_CAPABILITIES */ @@ -152,3 +204,41 @@ enum CameraMetadataEnumAndroidScalerAvailableStreamUseCases : uint32_t { ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL = 0x5, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START = 0x10000, }; + +/** android.automotive.location enumeration values + * @see ANDROID_AUTOMOTIVE_LOCATION + */ +enum CameraMetadataEnumAndroidAutomotiveLocation : uint32_t { + ANDROID_AUTOMOTIVE_LOCATION_INTERIOR, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_OTHER, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_FRONT, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_REAR, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_LEFT, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_RIGHT, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_OTHER, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_FRONT, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_REAR, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_LEFT, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_RIGHT, +}; + +/** android.automotive.lens.facing enumeration values + * @see ANDROID_AUTOMOTIVE_LENS_FACING + */ +enum CameraMetadataEnumAndroidAutomotiveLensFacing : uint32_t { + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_OTHER, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_FRONT, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_REAR, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_LEFT, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_RIGHT, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_OTHER, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_LEFT, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_CENTER, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_RIGHT, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_LEFT, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_CENTER, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_RIGHT, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_LEFT, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_CENTER, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_RIGHT, +}; -- GitLab From 9ca871ae24fbf7c5131c15d1acd38c9e8b840a5a Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Sat, 5 Feb 2022 15:37:52 -0800 Subject: [PATCH 578/825] Add stream use cases to camera aidl interfaces. Bug: 196432585 Test: build Change-Id: I1b2628056949d05aa553bdbba7983628ec54d65b Signed-off-by: Jayant Chowdhary --- .../hardware/camera/device/Stream.aidl | 1 + .../hardware/camera/device/Stream.aidl | 19 ++++++++ .../camera/metadata/CameraMetadataTag.aidl | 1 + .../ScalerAvailableStreamUseCases.aidl | 48 +++++++++++++++++++ .../camera/metadata/CameraMetadataTag.aidl | 6 +++ .../ScalerAvailableStreamUseCases.aidl | 39 +++++++++++++++ 6 files changed, 114 insertions(+) create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl index 9263a0391c..d2f295a160 100644 --- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/Stream.aidl @@ -47,4 +47,5 @@ parcelable Stream { int groupId; android.hardware.camera.metadata.SensorPixelMode[] sensorPixelModesUsed; android.hardware.camera.metadata.RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile; + android.hardware.camera.metadata.ScalerAvailableStreamUseCases useCase; } diff --git a/camera/device/aidl/android/hardware/camera/device/Stream.aidl b/camera/device/aidl/android/hardware/camera/device/Stream.aidl index b3291b0fdd..e35e4ff6e6 100644 --- a/camera/device/aidl/android/hardware/camera/device/Stream.aidl +++ b/camera/device/aidl/android/hardware/camera/device/Stream.aidl @@ -203,4 +203,23 @@ parcelable Stream { * */ android.hardware.camera.metadata.RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile; + + /** + * The stream use case describing the stream's purpose + * + * This flag provides the camera device a hint on what user scenario this + * stream is intended for. With this flag, the camera device can optimize + * camera pipeline parameters, such as tuning, sensor mode, and ISP settings, + * for the intended use case. + * + * When this field is set to DEFAULT, the camera device should behave in + * the same way as in previous HAL versions, and optimize the camera pipeline + * based on stream format, data space, usage flag, and other stream properties. + * + * The HAL reports supported stream use cases in + * ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES. If the HAL doesn't support + * setting stream use cases, the camera framework leaves this field as + * DEFAULT. + */ + android.hardware.camera.metadata.ScalerAvailableStreamUseCases useCase; } 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 34a1211d31..432c9fd2ac 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 @@ -195,6 +195,7 @@ enum CameraMetadataTag { ANDROID_SCALER_AVAILABLE_STALL_DURATIONS_MAXIMUM_RESOLUTION = 851989, ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP_MAXIMUM_RESOLUTION = 851990, ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED = 851991, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES = 851992, ANDROID_SENSOR_EXPOSURE_TIME = 917504, ANDROID_SENSOR_FRAME_DURATION = 917505, ANDROID_SENSOR_SENSITIVITY = 917506, diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl new file mode 100644 index 0000000000..0ed55a325e --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl @@ -0,0 +1,48 @@ +/* + * 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 -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 ScalerAvailableStreamUseCases { + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 1, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE = 2, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD = 3, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL = 4, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL = 5, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START = 65536, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl index fb7ca1241d..1f388d9c38 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl @@ -1224,6 +1224,12 @@ enum CameraMetadataTag { *

Whether the camera device supports multi-resolution input or output streams

*/ ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED, + /** + * android.scaler.availableStreamUseCases [static, enum[], public] + * + *

The stream use cases supported by this camera device.

+ */ + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, /** * android.sensor.exposureTime [dynamic, int64, public] * diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl new file mode 100644 index 0000000000..19ebab5a0a --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.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. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.scaler.availableStreamUseCases enumeration values + * @see ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES + */ +@VintfStability +@Backing(type="int") +enum ScalerAvailableStreamUseCases { + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0x0, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 0x1, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE = 0x2, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD = 0x3, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL = 0x4, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL = 0x5, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START = 0x10000, +} -- GitLab From b44de0093bd66d358bd790b90e5fbc9ab7755574 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Mon, 7 Feb 2022 08:02:56 -0800 Subject: [PATCH 579/825] uwb(hal): Remove getAndroidCapabilities HAL API This is unnecessary since we are anyway using GET_CAPS_INFO for querying non-fira capabilities. Bug: 208678993 Bug: 209053358 Test: Compiles Change-Id: Id9af03b313ceaf00fb6d5231c454dc7c74a6287a --- .../fira_android/UwbAndroidCapabilities.aidl | 39 ------------------- .../UwbVendorCapabilityTlvTypes.aidl | 1 + .../android/hardware/uwb/IUwbChip.aidl | 1 - uwb/aidl/android/hardware/uwb/IUwbChip.aidl | 10 ----- .../fira_android/UwbAndroidCapabilities.aidl | 31 --------------- .../UwbVendorCapabilityTlvTypes.aidl | 14 ++++++- .../fira_android/UwbVendorGidAndroidOids.aidl | 4 +- .../UwbVendorSessionAppConfigTlvTypes.aidl | 4 +- .../UwbVendorSessionAppConfigTlvValues.aidl | 4 +- uwb/aidl/default/uwb_chip.cpp | 6 --- uwb/aidl/default/uwb_chip.h | 1 - uwb/aidl/vts/VtsHalUwbTargetTest.cpp | 8 ---- 12 files changed, 20 insertions(+), 103 deletions(-) delete mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl delete mode 100644 uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl deleted file mode 100644 index 61a5548301..0000000000 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.uwb.fira_android; -@Backing(type="long") @VintfStability -enum UwbAndroidCapabilities { - POWER_STATS_QUERY = 1, - ANTENNA_INTERLEAVING = 2, -} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index f5cf8a388f..fec044eb6c 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -34,6 +34,7 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability enum UwbVendorCapabilityTlvTypes { + SUPPORTED_POWER_STATS_QUERY = 192, CCC_SUPPORTED_VERSIONS = 160, CCC_SUPPORTED_UWB_CONFIGS = 161, CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 162, diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl index c7708f1e93..0e640be2dd 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl @@ -42,6 +42,5 @@ interface IUwbChip { void coreInit(); void sessionInit(int sessionId); int getSupportedAndroidUciVersion(); - long getSupportedAndroidCapabilities(); int sendUciMessage(in byte[] data); } diff --git a/uwb/aidl/android/hardware/uwb/IUwbChip.aidl b/uwb/aidl/android/hardware/uwb/IUwbChip.aidl index f2bb0f114f..00cb8e0772 100644 --- a/uwb/aidl/android/hardware/uwb/IUwbChip.aidl +++ b/uwb/aidl/android/hardware/uwb/IUwbChip.aidl @@ -66,16 +66,6 @@ interface IUwbChip { */ int getSupportedAndroidUciVersion(); - /** - * Mechanism to allow HAL implementation to optionally expose features that are defined - * in the "android.hardware.uwb.fira_android" types-only package. - * - * @return Returns the bitmask of capabilities - * (android.hardware.uwb.fira_android.UwbAndroidCapabilities) that is supported by the - * HAL implementation. - */ - long getSupportedAndroidCapabilities(); - /** * Write the UCI message to the UWB Subsystem. * The UCI message format is as per UCI protocol and it is diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl deleted file mode 100644 index 1f9c9bbce7..0000000000 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbAndroidCapabilities.aidl +++ /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. - */ - -package android.hardware.uwb.fira_android; - -/** - * Android specific capabilities should be defined here. - * - * For any features enabled via the FIRA vendor commands for Android, use this bitmask - * to allow devices to expose the features supported by the HAL implementation. - * - */ -@VintfStability -@Backing(type="long") -enum UwbAndroidCapabilities { - POWER_STATS_QUERY = 0x1, - ANTENNA_INTERLEAVING = 0x2, -} diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index 1f502c3835..4591dda0ee 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -29,6 +29,18 @@ package android.hardware.uwb.fira_android; @VintfStability @Backing(type="int") enum UwbVendorCapabilityTlvTypes { + + /********************************************* + * Protocol agnostic + ********************************************/ + /** + * 1 byte value to indicate support for power stats query + * Values: + * 1 - Feature supported. + * 0 - Feature not supported. + */ + SUPPORTED_POWER_STATS_QUERY = 0xC0, + /********************************************* * CCC specific ********************************************/ @@ -96,7 +108,7 @@ enum UwbVendorCapabilityTlvTypes { * FIRA specific ********************************************/ /** - * 1 byte value to indicate support for antennare interleaving + * 1 byte value to indicate support for antenna interleaving * feature. * Values: * 1 - Feature supported. diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl index 1dfcd6ff5d..c04bdcfcd9 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl @@ -24,8 +24,8 @@ package android.hardware.uwb.fira_android; @Backing(type="byte") enum UwbVendorGidAndroidOids { // Used by the command and response to get UWB power related stats. - // Supported only if the value returned by getSupportedAndroidCapabilities() - // has the bit of UwbAndroidCapabilities.POWER_STATS_QUERY set to 1. + // Supported only if the UwbVendorCapabilityTlvTypes.SUPPORTED_POWER_STATS_QUERY + // set to 1. ANDROID_GET_POWER_STATS = 0x0, // Used to set the current regulatory country code (determined usinag // SIM or hardcoded by OEM). diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl index 2b21f35f8b..8547567ddf 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl @@ -57,8 +57,8 @@ enum UwbVendorSessionAppConfigTlvTypes { /** * Added in vendor version 0. * Interleaving ratio if AOA_RESULT_REQ is set to 0xF0. - * Supported only if the value returned by getSupportedAndroidCapabilities() - * has the bit of UwbAndroidCapabilities.ANTENNA_INTERLEAVING set to 1. + * Supported only if the UwbVendorCapabilityTlvTypes + * .SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING set to 1. */ /** 2 byte data */ NB_OF_RANGE_MEASUREMENTS = 0xE3, diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl index 33932bb120..bd4ad6e93f 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl @@ -30,8 +30,8 @@ package android.hardware.uwb.fira_android; enum UwbVendorSessionAppConfigTlvValues { /** * Added in vendor version 0. - * Supported only if the value returned by getSupportedAndroidCapabilities() - * has the bit of UwbAndroidCapabilities.ANTENNA_INTERLEAVING set to 1. + * Supported only if the UwbVendorCapabilityTlvTypes + * .SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING set to 1. * Set AOA_RESULT_REQ (Config ID - 0x0D) to this value to turn on antenna * interleaving feature. */ diff --git a/uwb/aidl/default/uwb_chip.cpp b/uwb/aidl/default/uwb_chip.cpp index a5a3f4a123..41f14fd894 100644 --- a/uwb/aidl/default/uwb_chip.cpp +++ b/uwb/aidl/default/uwb_chip.cpp @@ -18,7 +18,6 @@ namespace { constexpr static int32_t kAndroidUciVersion = 1; -constexpr static int64_t kAndroidCapabilities = 0; } namespace android { @@ -60,11 +59,6 @@ UwbChip::~UwbChip() {} return ndk::ScopedAStatus::ok(); } -::ndk::ScopedAStatus UwbChip::getSupportedAndroidCapabilities(int64_t* capabilities) { - *capabilities = kAndroidCapabilities; - return ndk::ScopedAStatus::ok(); -} - ::ndk::ScopedAStatus UwbChip::sendUciMessage(const std::vector& /* data */, int32_t* /* bytes_written */) { // TODO(b/195992658): Need emulator support for UCI stack. diff --git a/uwb/aidl/default/uwb_chip.h b/uwb/aidl/default/uwb_chip.h index 46cecd4739..e900cbe123 100644 --- a/uwb/aidl/default/uwb_chip.h +++ b/uwb/aidl/default/uwb_chip.h @@ -39,7 +39,6 @@ class UwbChip : public BnUwbChip { ::ndk::ScopedAStatus coreInit() override; ::ndk::ScopedAStatus sessionInit(int sesionId) override; ::ndk::ScopedAStatus getSupportedAndroidUciVersion(int32_t* version) override; - ::ndk::ScopedAStatus getSupportedAndroidCapabilities(int64_t* capabilities) override; ::ndk::ScopedAStatus sendUciMessage(const std::vector& data, int32_t* bytes_written) override; diff --git a/uwb/aidl/vts/VtsHalUwbTargetTest.cpp b/uwb/aidl/vts/VtsHalUwbTargetTest.cpp index 1da4432e47..edd8dd6608 100644 --- a/uwb/aidl/vts/VtsHalUwbTargetTest.cpp +++ b/uwb/aidl/vts/VtsHalUwbTargetTest.cpp @@ -180,14 +180,6 @@ TEST_P(UwbAidl, ChipGetSupportedAndroidUciVersion) { EXPECT_GT(version, 0); } -TEST_P(UwbAidl, ChipGetSupportedAndroidCapabilities) { - const auto iuwb_chip = getAnyChipAndOpen(); - EXPECT_TRUE(iuwb_chip->coreInit().isOk()); - - int64_t capabilities; - EXPECT_TRUE(iuwb_chip->getSupportedAndroidCapabilities(&capabilities).isOk()); -} - TEST_P(UwbAidl, ChipGetName) { std::string chip_name = getAnyChipName(); std::shared_ptr iuwb_chip; -- GitLab From e5c038e9ef662abcc3414ddf4ffe27196a5ae0c6 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Mon, 31 Jan 2022 10:10:55 -0500 Subject: [PATCH 580/825] Add a more detailed HAL for DISPLAY_DECORATION Different hardware may prefer different formats for DISPLAY_DECORATION layers. Add a new struct with two enums: one for the format, and one for how to interpret the alpha. These two properties are orthogonal. Add IComposerClient.getDisplayDecorationSupport for retrieving the struct. I0c2fbc78cf5e4e97cede4762699a1ecc98620919 demonstrates a sample implementation. Remove the DisplayCapability.DISPLAY_DECORATION, which is replaced by this. Bug: 216644902 Test: manual Change-Id: I27f119f927b23052c5fd8f068cbca75338fe7b91 --- .../graphics/common/AlphaInterpretation.aidl | 40 ++++++++++++++++++ .../common/DisplayDecorationSupport.aidl | 40 ++++++++++++++++++ .../graphics/common/AlphaInterpretation.aidl | 42 +++++++++++++++++++ .../common/DisplayDecorationSupport.aidl | 42 +++++++++++++++++++ .../graphics/composer3/DisplayCapability.aidl | 3 +- .../graphics/composer3/IComposerClient.aidl | 1 + .../graphics/composer3/Composition.aidl | 9 ++-- .../graphics/composer3/DisplayCapability.aidl | 6 +-- .../graphics/composer3/IComposerClient.aidl | 11 +++++ 9 files changed, 182 insertions(+), 12 deletions(-) create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/AlphaInterpretation.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/DisplayDecorationSupport.aidl create mode 100644 graphics/common/aidl/android/hardware/graphics/common/AlphaInterpretation.aidl create mode 100644 graphics/common/aidl/android/hardware/graphics/common/DisplayDecorationSupport.aidl diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/AlphaInterpretation.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/AlphaInterpretation.aidl new file mode 100644 index 0000000000..ea60283fe1 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/AlphaInterpretation.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 -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; +/* @hide */ +@Backing(type="int") @VintfStability +enum AlphaInterpretation { + COVERAGE = 0, + MASK = 1, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/DisplayDecorationSupport.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/DisplayDecorationSupport.aidl new file mode 100644 index 0000000000..27eff76432 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/DisplayDecorationSupport.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 -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; +/* @hide */ +@VintfStability +parcelable DisplayDecorationSupport { + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.AlphaInterpretation alphaInterpretation; +} diff --git a/graphics/common/aidl/android/hardware/graphics/common/AlphaInterpretation.aidl b/graphics/common/aidl/android/hardware/graphics/common/AlphaInterpretation.aidl new file mode 100644 index 0000000000..e994cf237f --- /dev/null +++ b/graphics/common/aidl/android/hardware/graphics/common/AlphaInterpretation.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. + */ + +package android.hardware.graphics.common; + +/** + * How to interperet alpha values when it may be ambiguous. + * @hide + */ +@VintfStability +@Backing(type="int") +enum AlphaInterpretation { + /** + * Alpha values are treated as coverage. + * + * Pixels in the buffer with an alpha of 0 (transparent) will be rendered in + * black, and pixels with a max value will show the content underneath. An + * alpha in between will show the content blended with black. + */ + COVERAGE = 0, + /** + * Alpha values are treated as a mask. + * + * Pixels in the buffer with an alpha of 0 (transparent) will show the + * content underneath, and pixels with a max value will be rendered in + * black. An alpha in between will show the content blended with black. + */ + MASK = 1, +} diff --git a/graphics/common/aidl/android/hardware/graphics/common/DisplayDecorationSupport.aidl b/graphics/common/aidl/android/hardware/graphics/common/DisplayDecorationSupport.aidl new file mode 100644 index 0000000000..42c23921b4 --- /dev/null +++ b/graphics/common/aidl/android/hardware/graphics/common/DisplayDecorationSupport.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. + */ + +package android.hardware.graphics.common; + +import android.hardware.graphics.common.PixelFormat; +import android.hardware.graphics.common.AlphaInterpretation; + +/** + * A description of how a device supports Composition.DISPLAY_DECORATION. + * + * If the device supports Composition.DISPLAY_DECORATION, a call to + * IComposerClient.getDisplayDecorationSupport should return an instance of this + * parcelable. Otherwise the method should return null. + * @hide + */ +@VintfStability +parcelable DisplayDecorationSupport { + /** + * The format to use for DISPLAY_DECORATION layers. Other formats are not + * supported. If other formats are used with DISPLAY_DECORATION, the result + * is undefined. + */ + PixelFormat format; + /** + * How the device intreprets the alpha in the pixel buffer. + */ + AlphaInterpretation alphaInterpretation; +} 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 b41ac8a78a..6eba887aef 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 @@ -41,6 +41,5 @@ enum DisplayCapability { PROTECTED_CONTENTS = 4, AUTO_LOW_LATENCY_MODE = 5, SUSPEND = 6, - DISPLAY_DECORATION = 7, - DISPLAY_IDLE_TIMER = 8, + DISPLAY_IDLE_TIMER = 7, } 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 2de699b94a..b49f239ed0 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 @@ -59,6 +59,7 @@ interface IComposerClient { @nullable ParcelFileDescriptor getReadbackBufferFence(long display); android.hardware.graphics.composer3.RenderIntent[] getRenderIntents(long display, android.hardware.graphics.composer3.ColorMode mode); android.hardware.graphics.composer3.ContentType[] getSupportedContentTypes(long display); + @nullable android.hardware.graphics.common.DisplayDecorationSupport getDisplayDecorationSupport(long display); void registerCallback(in android.hardware.graphics.composer3.IComposerCallback callback); void setActiveConfig(long display, int config); android.hardware.graphics.composer3.VsyncPeriodChangeTimeline setActiveConfigWithConstraints(long display, int config, in android.hardware.graphics.composer3.VsyncPeriodChangeConstraints vsyncPeriodChangeConstraints); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl index 803de0656a..adcc9f6a31 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl @@ -75,13 +75,12 @@ enum Composition { SIDEBAND = 5, /** * A display decoration layer contains a buffer which is used to provide - * anti-aliasing on the cutout region/rounded corners on the top and + * anti-aliasing on the cutout region and rounded corners on the top and * bottom of a display. * - * Pixels in the buffer with an alpha of 0 (transparent) will show the - * content underneath, and pixels with a max alpha value will be rendered in - * black. An alpha in between will show the underlying content blended with - * black. + * Only supported if the device returns a valid struct from + * getDisplayDecorationSupport. Pixels in the buffer are interpreted + * according to the DisplayDecorationSupport.alphInterpretation. * * Upon validateDisplay, the device may request a change from this type * to either DEVICE or CLIENT. diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl index 85136c44d9..f4b29843b8 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl @@ -75,13 +75,9 @@ enum DisplayCapability { * PowerMode.ON_SUSPEND and PowerMode.DOZE_SUSPEND must be supported. */ SUSPEND = 6, - /** - * Indicates that the display supports Composition.DISPLAY_DECORATION. - */ - DISPLAY_DECORATION = 7, /** * Indicates that the display supports IComposerClient.setIdleTimerEnabled and * IComposerCallback.onVsyncIdle. */ - DISPLAY_IDLE_TIMER = 8, + DISPLAY_IDLE_TIMER = 7, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 2fe6656cb5..769f803905 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -16,6 +16,7 @@ package android.hardware.graphics.composer3; +import android.hardware.graphics.common.DisplayDecorationSupport; import android.hardware.graphics.common.Transform; import android.hardware.graphics.composer3.ClientTargetProperty; import android.hardware.graphics.composer3.ColorMode; @@ -515,6 +516,16 @@ interface IComposerClient { */ ContentType[] getSupportedContentTypes(long display); + /** + * Report whether and how this display supports Composition.DISPLAY_DECORATION. + * + * @return A description of how the display supports DISPLAY_DECORATION, or null + * if it is unsupported. + * + * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + */ + @nullable DisplayDecorationSupport getDisplayDecorationSupport(long display); + /** * Provides a IComposerCallback object for the device to call. * -- GitLab From 896b7ab730edd9d9acb3bb7e8b99ad629a533cd7 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Fri, 4 Feb 2022 12:31:50 -0800 Subject: [PATCH 581/825] Expose response methods for services using compat library Bug: 211819471 Test: it builds Change-Id: I1fecf05fa8c5c862f18cbc6c974bb9d6a6d39892 --- .../libradiocompat/include/libradiocompat/RadioConfig.h | 5 +++-- .../compat/libradiocompat/include/libradiocompat/RadioData.h | 5 +++-- .../libradiocompat/include/libradiocompat/RadioMessaging.h | 5 +++-- .../libradiocompat/include/libradiocompat/RadioModem.h | 5 +++-- .../libradiocompat/include/libradiocompat/RadioNetwork.h | 5 +++-- .../compat/libradiocompat/include/libradiocompat/RadioSim.h | 5 +++-- .../libradiocompat/include/libradiocompat/RadioVoice.h | 5 +++-- 7 files changed, 21 insertions(+), 14 deletions(-) diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h index bbfff61ec3..89ddea0d49 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h @@ -39,8 +39,6 @@ class RadioConfig : public aidl::android::hardware::radio::config::BnRadioConfig const sp mRadioConfigResponse; const sp mRadioConfigIndication; - std::shared_ptr<::aidl::android::hardware::radio::config::IRadioConfigResponse> respond(); - ::ndk::ScopedAStatus getHalDeviceCapabilities(int32_t serial) override; ::ndk::ScopedAStatus getNumOfLiveModems(int32_t serial) override; ::ndk::ScopedAStatus getPhoneCapability(int32_t serial) override; @@ -57,6 +55,9 @@ class RadioConfig : public aidl::android::hardware::radio::config::BnRadioConfig const std::vector& slotMap) override; + protected: + std::shared_ptr<::aidl::android::hardware::radio::config::IRadioConfigResponse> respond(); + public: /** * Constructs AIDL IRadioConfig instance wrapping existing HIDL IRadioConfig instance. diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h index c2c0de3b05..da19811605 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h @@ -22,8 +22,6 @@ namespace android::hardware::radio::compat { class RadioData : public RadioCompatBase, public aidl::android::hardware::radio::data::BnRadioData { - std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> respond(); - ::ndk::ScopedAStatus allocatePduSessionId(int32_t serial) override; ::ndk::ScopedAStatus cancelHandover(int32_t serial, int32_t callId) override; ::ndk::ScopedAStatus deactivateDataCall( @@ -65,6 +63,9 @@ class RadioData : public RadioCompatBase, public aidl::android::hardware::radio: const ::aidl::android::hardware::radio::data::KeepaliveRequest& keepalive) override; ::ndk::ScopedAStatus stopKeepalive(int32_t serial, int32_t sessionHandle) override; + protected: + std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> respond(); + public: using RadioCompatBase::RadioCompatBase; }; diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h index 047f836163..1af406aa03 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h @@ -23,8 +23,6 @@ namespace android::hardware::radio::compat { class RadioMessaging : public RadioCompatBase, public aidl::android::hardware::radio::messaging::BnRadioMessaging { - std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> respond(); - ::ndk::ScopedAStatus acknowledgeIncomingGsmSmsWithPdu(int32_t serial, bool success, const std::string& ackPdu) override; ::ndk::ScopedAStatus acknowledgeLastIncomingCdmaSms( @@ -82,6 +80,9 @@ class RadioMessaging : public RadioCompatBase, int32_t serial, const ::aidl::android::hardware::radio::messaging::SmsWriteArgs& smsWriteArgs) override; + protected: + std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> respond(); + public: using RadioCompatBase::RadioCompatBase; }; diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h index fdca1244ae..beb1fb0b49 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h @@ -23,8 +23,6 @@ namespace android::hardware::radio::compat { class RadioModem : public RadioCompatBase, public aidl::android::hardware::radio::modem::BnRadioModem { - std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> respond(); - ::ndk::ScopedAStatus enableModem(int32_t serial, bool on) override; ::ndk::ScopedAStatus getBasebandVersion(int32_t serial) override; ::ndk::ScopedAStatus getDeviceIdentity(int32_t serial) override; @@ -54,6 +52,9 @@ class RadioModem : public RadioCompatBase, const std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemIndication>& radioModemIndication) override; + protected: + std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> respond(); + public: using RadioCompatBase::RadioCompatBase; }; diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h index 1731b78851..9784665ef7 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h @@ -23,8 +23,6 @@ namespace android::hardware::radio::compat { class RadioNetwork : public RadioCompatBase, public aidl::android::hardware::radio::network::BnRadioNetwork { - std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> respond(); - ::ndk::ScopedAStatus getAllowedNetworkTypesBitmap(int32_t serial) override; ::ndk::ScopedAStatus getAvailableBandModes(int32_t serial) override; ::ndk::ScopedAStatus getAvailableNetworks(int32_t serial) override; @@ -92,6 +90,9 @@ class RadioNetwork : public RadioCompatBase, ::aidl::android::hardware::radio::network::UsageSetting usageSetting) override; ::ndk::ScopedAStatus getUsageSetting(int32_t serial) override; + protected: + std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> respond(); + public: using RadioCompatBase::RadioCompatBase; }; diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h index 84bb68b57f..ff91aef5fa 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h @@ -22,8 +22,6 @@ namespace android::hardware::radio::compat { class RadioSim : public RadioCompatBase, public aidl::android::hardware::radio::sim::BnRadioSim { - std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> respond(); - ::ndk::ScopedAStatus areUiccApplicationsEnabled(int32_t serial) override; ::ndk::ScopedAStatus changeIccPin2ForApp(int32_t serial, const std::string& oldPin2, const std::string& newPin2, @@ -102,6 +100,9 @@ class RadioSim : public RadioCompatBase, public aidl::android::hardware::radio:: int32_t serial, const ::aidl::android::hardware::radio::sim::PhonebookRecordInfo& recordInfo) override; + protected: + std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> respond(); + public: using RadioCompatBase::RadioCompatBase; }; diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h index 0f1d5fda61..7bc998e176 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h @@ -23,8 +23,6 @@ namespace android::hardware::radio::compat { class RadioVoice : public RadioCompatBase, public aidl::android::hardware::radio::voice::BnRadioVoice { - std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> respond(); - ::ndk::ScopedAStatus acceptCall(int32_t serial) override; ::ndk::ScopedAStatus cancelPendingUssd(int32_t serial) override; ::ndk::ScopedAStatus conference(int32_t serial) override; @@ -80,6 +78,9 @@ class RadioVoice : public RadioCompatBase, ::ndk::ScopedAStatus stopDtmf(int32_t serial) override; ::ndk::ScopedAStatus switchWaitingOrHoldingAndActive(int32_t serial) override; + protected: + std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> respond(); + public: using RadioCompatBase::RadioCompatBase; }; -- GitLab From f6e0f39cde58daa4d104ac9c99eb7f4d307a48d8 Mon Sep 17 00:00:00 2001 From: Ilya Matyukhin Date: Mon, 7 Feb 2022 15:40:21 -0800 Subject: [PATCH 582/825] Add new fields to fingerprint PointerContext The new fields provide additional information to the HAL about the touch events originating from the framework. Bug: 205915651 Test: m android.hardware.biometrics.common-update-api Test: m android.hardware.biometrics.fingerprint-update-api Test: lunch cf_x86_phone-userdebug && m Change-Id: I987e26ac03e3268eea30feb9bbddffe6ca8d0035 --- .../biometrics/common/OperationContext.aidl | 2 +- .../biometrics/common/OperationContext.aidl | 4 +- .../fingerprint/PointerContext.aidl | 11 ++-- .../fingerprint/PointerContext.aidl | 63 ++++++++++++++++--- 4 files changed, 65 insertions(+), 15 deletions(-) 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 3a6461ed91..9d1cb8ff86 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 @@ -36,6 +36,6 @@ package android.hardware.biometrics.common; parcelable OperationContext { int id = 0; android.hardware.biometrics.common.OperationReason reason = android.hardware.biometrics.common.OperationReason.UNKNOWN; - boolean isAoD = false; + boolean isAod = false; boolean isCrypto = false; } diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl index 390e6985e4..72fe660126 100644 --- a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl +++ b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl @@ -41,8 +41,8 @@ parcelable OperationContext { */ OperationReason reason = OperationReason.UNKNOWN; - /* Flag indicating that the display is in AoD mode. */ - boolean isAoD = false; + /* Flag indicating that the display is in AOD mode. */ + boolean isAod = false; /** Flag indicating that crypto was requested. */ boolean isCrypto = false; diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl index e383330b69..43db6cfb51 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl @@ -34,10 +34,13 @@ package android.hardware.biometrics.fingerprint; @VintfStability parcelable PointerContext { - int pointerId = 0; - int x = 0; - int y = 0; + int pointerId = -1; + float x = 0.000000f; + float y = 0.000000f; float minor = 0.000000f; float major = 0.000000f; - boolean isAoD = false; + float orientation = 0.000000f; + boolean isAod = false; + long time = 0; + long gestureStart = 0; } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl index 4975175d8c..e025d3440d 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl @@ -21,14 +21,35 @@ package android.hardware.biometrics.fingerprint; */ @VintfStability parcelable PointerContext { - /* See android.view.MotionEvent#getPointerId. */ - int pointerId = 0; + /** + * Pointer ID obtained from MotionEvent#getPointerId or -1 if the ID cannot be obtained, for + * example if this event originated from a low-level wake-up gesture. + * + * See android.view.MotionEvent#getPointerId. + */ + int pointerId = -1; - /* The distance in pixels from the left edge of the display. */ - int x = 0; + /** + * The distance in pixels from the left edge of the display. + * + * This is obtained from MotionEvent#getRawX and translated relative to Surface#ROTATION_0. + * Meaning, this value is always reported as if the device is in its natural (e.g. portrait) + * orientation. + * + * See android.view.MotionEvent#getRawX. + */ + float x = 0f; - /* The distance in pixels from the top edge of the display. */ - int y = 0; + /** + * The distance in pixels from the top edge of the display. + * + * This is obtained from MotionEvent#getRawY and translated relative to Surface#ROTATION_0. + * Meaning, this value is always reported as if the device is in its natural (e.g. portrait) + * orientation. + * + * See android.view.MotionEvent#getRawY. + */ + float y = 0f; /* See android.view.MotionEvent#getTouchMinor. */ float minor = 0f; @@ -36,6 +57,32 @@ parcelable PointerContext { /* See android.view.MotionEvent#getTouchMajor. */ float major = 0f; - /* Flag indicating that the display is in AoD mode. */ - boolean isAoD = false; + /* See android.view.MotionEvent#getOrientation. */ + float orientation = 0f; + + /* Flag indicating that the display is in AOD mode. */ + boolean isAod = false; + + /** + * The time of the user interaction that produced this event, in milliseconds. + * + * This is obtained from MotionEvent#getEventTime, which uses SystemClock.uptimeMillis() as + * the clock. + * + * See android.view.MotionEvent#getEventTime + */ + long time = 0; + + /** + * The time of the first user interaction in this gesture, in milliseconds. + * + * If this event is MotionEvent#ACTION_DOWN, it means it's the first event in this gesture, + * and `gestureStart` will be equal to `time`. + * + * This is obtained from MotionEvent#getDownTime, which uses SystemClock.uptimeMillis() as + * the clock. + * + * See android.view.MotionEvent#getDownTime + */ + long gestureStart = 0; } -- GitLab From 20014dab39b25ece90379654456caec17f7f77eb Mon Sep 17 00:00:00 2001 From: Kiran Rachuri Date: Mon, 7 Feb 2022 19:05:00 +0000 Subject: [PATCH 583/825] Add vehicle curb weight property Bug: 197026083 Test: Build Change-Id: I8c621b355e3d199dbac7a6170c1281fa2d7e03ad --- .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl index 5cd814c259..04f8fa3b80 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -205,4 +205,5 @@ enum VehicleProperty { EV_CHARGE_TIME_REMAINING = 289410883, EV_REGENERATIVE_BRAKING_STATE = 289410884, TRAILER_PRESENT = 289410885, + VEHICLE_CURB_WEIGHT = 289410886, } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl index 9dbeae2c43..727b949a37 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -2815,4 +2815,29 @@ enum VehicleProperty { */ TRAILER_PRESENT = 0x0F45 + 0x10000000 + 0x01000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + + /** + * Vehicle’s curb weight + * + * Returns the vehicle's curb weight in kilograms. Curb weight is + * the total weight of the vehicle with standard equipment and all + * necessary operating consumables such as motor oil,transmission oil, + * brake fluid, coolant, air conditioning refrigerant, and weight of + * fuel at nominal tank capacity, while not loaded with either passengers + * or cargo. + * + * configArray[0] is used to specify the vehicle’s gross weight in kilograms. + * The vehicle’s gross weight is the maximum operating weight of the vehicle + * as specified by the manufacturer including the vehicle's chassis, body, engine, + * engine fluids, fuel, accessories, driver, passengers and cargo but excluding + * that of any trailers. + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:KILOGRAM + */ + + VEHICLE_CURB_WEIGHT = 0x0F46 + 0x10000000 + 0x01000000 + + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + } -- GitLab From 5d8805e25aed40a7e0057ba5bffeae98c9fcf962 Mon Sep 17 00:00:00 2001 From: Quang Luong Date: Fri, 28 Jan 2022 15:46:40 -0800 Subject: [PATCH 584/825] Add IfaceConcurrencyType and related methods for AP_BRIDGED concurrency Add IfaceConcurrencyType to represent Iface implementations that have different concurrency implications for the same IfaceType, such as Bridged AP and Single AP for IWifiApIface. Add a new IWifiChip HAL API, getAvailableModes_1_6 to return the new concurrency type combos. Bug: 207055799 Test: 1.6/default/tests/runtests.sh Change-Id: Iad20a3d95d54dd8b624db912fd3153c2a3372f45 --- wifi/1.6/IWifiChip.hal | 102 ++++++++++ .../default/tests/mock_wifi_feature_flags.h | 2 +- .../default/tests/wifi_chip_unit_tests.cpp | 185 +++++++++--------- wifi/1.6/default/wifi_chip.cpp | 172 +++++++++------- wifi/1.6/default/wifi_chip.h | 37 ++-- wifi/1.6/default/wifi_feature_flags.cpp | 138 +++++++------ wifi/1.6/default/wifi_feature_flags.h | 6 +- wifi/1.6/types.hal | 26 +++ 8 files changed, 427 insertions(+), 241 deletions(-) diff --git a/wifi/1.6/IWifiChip.hal b/wifi/1.6/IWifiChip.hal index 555ec918ac..726839d456 100644 --- a/wifi/1.6/IWifiChip.hal +++ b/wifi/1.6/IWifiChip.hal @@ -16,6 +16,7 @@ package android.hardware.wifi@1.6; +import @1.0::ChipModeId; import @1.0::IWifiIface; import @1.0::WifiStatus; import @1.5::WifiBand; @@ -100,6 +101,107 @@ interface IWifiChip extends @1.5::IWifiChip { bitfield filterMask) generates (WifiStatus status, vec channels); + /** + * Set of interface concurrency types with the maximum number of interfaces that can have + * one of the specified concurrency types for a given ChipConcurrencyCombination. See + * ChipConcurrencyCombination for examples. + */ + struct ChipConcurrencyCombinationLimit { + // Each IfaceConcurrencyType must occur at most once. + vec types; + uint32_t maxIfaces; + }; + + /** + * Set of interfaces that can operate concurrently when in a given mode. See + * ChipMode below. + * + * For example: + * [{STA} <= 2] + * At most two STA interfaces are supported + * [], [STA], [STA+STA] + * + * [{STA} <= 1, {NAN} <= 1, {AP_BRIDGED} <= 1] + * Any combination of STA, NAN, AP_BRIDGED + * [], [STA], [NAN], [AP_BRIDGED], [STA+NAN], [STA+AP_BRIDGED], [NAN+AP_BRIDGED], + * [STA+NAN+AP_BRIDGED] + * + * [{STA} <= 1, {NAN,P2P} <= 1] + * Optionally a STA and either NAN or P2P + * [], [STA], [STA+NAN], [STA+P2P], [NAN], [P2P] + * Not included [NAN+P2P], [STA+NAN+P2P] + * + * [{STA} <= 1, {STA,NAN} <= 1] + * Optionally a STA and either a second STA or a NAN + * [], [STA], [STA+NAN], [STA+STA], [NAN] + * Not included [STA+STA+NAN] + */ + struct ChipConcurrencyCombination { + vec limits; + }; + + /** + * A mode that the chip can be put in. A mode defines a set of constraints on + * the interfaces that can exist while in that mode. Modes define a unit of + * configuration where all interfaces must be torn down to switch to a + * different mode. Some HALs may only have a single mode, but an example where + * multiple modes would be required is if a chip has different firmwares with + * different capabilities. + * + * When in a mode, it must be possible to perform any combination of creating + * and removing interfaces as long as at least one of the + * ChipConcurrencyCombinations is satisfied. This means that if a chip has two + * available combinations, [{STA} <= 1] and [{AP_BRIDGED} <= 1] then it is expected + * that exactly one STA type or one AP_BRIDGED type can be created, but it + * is not expected that both a STA and AP_BRIDGED type could be created. If it + * was then there would be a single available combination + * [{STA} <=1, {AP_BRIDGED} <= 1]. + * + * When switching between two available combinations it is expected that + * interfaces only supported by the initial combination must be removed until + * the target combination is also satisfied. At that point new interfaces + * satisfying only the target combination can be added (meaning the initial + * combination limits will no longer satisfied). The addition of these new + * interfaces must not impact the existence of interfaces that satisfy both + * combinations. + * + * For example, a chip with available combinations: + * [{STA} <= 2, {NAN} <=1] and [{STA} <=1, {NAN} <= 1, {AP_BRIDGED} <= 1}] + * If the chip currently has 3 interfaces STA, STA and NAN and wants to add an + * AP_BRIDGED interface in place of one of the STAs then first one of the STA + * interfaces must be removed and then the AP interface can be created after + * the STA had been torn down. During this process the remaining STA and NAN + * interfaces must not be removed/recreated. + * + * If a chip does not support this kind of reconfiguration in this mode then + * the combinations must be separated into two separate modes. Before + * switching modes all interfaces must be torn down, the mode switch must be + * enacted and when it completes the new interfaces must be brought up. + */ + struct ChipMode { + /** + * Id that can be used to put the chip in this mode. + */ + ChipModeId id; + + /** + * A list of the possible interface concurrency type combinations that the chip can have + * while in this mode. + */ + vec availableCombinations; + }; + + /** + * Get the set of operation modes that the chip supports. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| + * @return modes List of modes supported by the device. + */ + getAvailableModes_1_6() generates (WifiStatus status, vec modes); + /** * Retrieve the list of all the possible radio combinations supported by this * chip. diff --git a/wifi/1.6/default/tests/mock_wifi_feature_flags.h b/wifi/1.6/default/tests/mock_wifi_feature_flags.h index fa3600a4b1..fbe1f7a5ac 100644 --- a/wifi/1.6/default/tests/mock_wifi_feature_flags.h +++ b/wifi/1.6/default/tests/mock_wifi_feature_flags.h @@ -33,7 +33,7 @@ class MockWifiFeatureFlags : public WifiFeatureFlags { public: MockWifiFeatureFlags(); - MOCK_METHOD1(getChipModes, std::vector(bool is_primary)); + MOCK_METHOD1(getChipModes, std::vector(bool is_primary)); MOCK_METHOD0(isApMacRandomizationDisabled, bool()); }; diff --git a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp index 542b180482..48c006519f 100644 --- a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp +++ b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp @@ -48,13 +48,13 @@ class WifiChipTest : public Test { protected: void setupV1IfaceCombination() { // clang-format off - const hidl_vec combinationsSta = { - {{{{IfaceType::STA}, 1}, {{IfaceType::P2P}, 1}}} + const hidl_vec combinationsSta = { + {{{{IfaceConcurrencyType::STA}, 1}, {{IfaceConcurrencyType::P2P}, 1}}} }; - const hidl_vec combinationsAp = { - {{{{IfaceType::AP}, 1}}} + const hidl_vec combinationsAp = { + {{{{IfaceConcurrencyType::AP}, 1}}} }; - const std::vector modes = { + const std::vector modes = { {feature_flags::chip_mode_ids::kV1Sta, combinationsSta}, {feature_flags::chip_mode_ids::kV1Ap, combinationsAp} }; @@ -64,13 +64,14 @@ class WifiChipTest : public Test { void setupV1_AwareIfaceCombination() { // clang-format off - const hidl_vec combinationsSta = { - {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}} + const hidl_vec combinationsSta = { + {{{{IfaceConcurrencyType::STA}, 1}, + {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}} }; - const hidl_vec combinationsAp = { - {{{{IfaceType::AP}, 1}}} + const hidl_vec combinationsAp = { + {{{{IfaceConcurrencyType::AP}, 1}}} }; - const std::vector modes = { + const std::vector modes = { {feature_flags::chip_mode_ids::kV1Sta, combinationsSta}, {feature_flags::chip_mode_ids::kV1Ap, combinationsAp} }; @@ -80,10 +81,11 @@ class WifiChipTest : public Test { void setupV1_AwareDisabledApIfaceCombination() { // clang-format off - const hidl_vec combinationsSta = { - {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}} + const hidl_vec combinationsSta = { + {{{{IfaceConcurrencyType::STA}, 1}, + {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}} }; - const std::vector modes = { + const std::vector modes = { {feature_flags::chip_mode_ids::kV1Sta, combinationsSta} }; // clang-format on @@ -92,11 +94,12 @@ class WifiChipTest : public Test { void setupV2_AwareIfaceCombination() { // clang-format off - const hidl_vec combinations = { - {{{{IfaceType::STA}, 1}, {{IfaceType::AP}, 1}}}, - {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}} + const hidl_vec combinations = { + {{{{IfaceConcurrencyType::STA}, 1}, {{IfaceConcurrencyType::AP}, 1}}}, + {{{{IfaceConcurrencyType::STA}, 1}, + {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}} }; - const std::vector modes = { + const std::vector modes = { {feature_flags::chip_mode_ids::kV3, combinations} }; // clang-format on @@ -105,10 +108,11 @@ class WifiChipTest : public Test { void setupV2_AwareDisabledApIfaceCombination() { // clang-format off - const hidl_vec combinations = { - {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}} + const hidl_vec combinations = { + {{{{IfaceConcurrencyType::STA}, 1}, + {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}} }; - const std::vector modes = { + const std::vector modes = { {feature_flags::chip_mode_ids::kV3, combinations} }; // clang-format on @@ -117,10 +121,10 @@ class WifiChipTest : public Test { void setup_MultiIfaceCombination() { // clang-format off - const hidl_vec combinations = { - {{{{IfaceType::STA}, 3}, {{IfaceType::AP}, 1}}} + const hidl_vec combinations = { + {{{{IfaceConcurrencyType::STA}, 3}, {{IfaceConcurrencyType::AP}, 1}}} }; - const std::vector modes = { + const std::vector modes = { {feature_flags::chip_mode_ids::kV3, combinations} }; // clang-format on @@ -128,19 +132,20 @@ class WifiChipTest : public Test { } void assertNumberOfModes(uint32_t num_modes) { - chip_->getAvailableModes([num_modes](const WifiStatus& status, - const std::vector& modes) { + chip_->getAvailableModes_1_6([num_modes](const WifiStatus& status, + const std::vector& modes) { ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); // V2_Aware has 1 mode of operation. ASSERT_EQ(num_modes, modes.size()); }); } - void findModeAndConfigureForIfaceType(const IfaceType& type) { + void findModeAndConfigureForIfaceType(const IfaceConcurrencyType& type) { // This should be aligned with kInvalidModeId in wifi_chip.cpp. ChipModeId mode_id = UINT32_MAX; - chip_->getAvailableModes([&mode_id, &type](const WifiStatus& status, - const std::vector& modes) { + chip_->getAvailableModes_1_6([&mode_id, &type]( + const WifiStatus& status, + const std::vector& modes) { ASSERT_EQ(WifiStatusCode::SUCCESS, status.code); for (const auto& mode : modes) { for (const auto& combination : mode.availableCombinations) { @@ -298,48 +303,48 @@ class WifiChipV1IfaceCombinationTest : public WifiChipTest { }; TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateSta_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); } TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateP2p_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); } TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateNan_ShouldFail) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_TRUE(createIface(IfaceType::NAN).empty()); } TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateAp_ShouldFail) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_TRUE(createIface(IfaceType::AP).empty()); } TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateStaP2p_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); } TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateAp_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_EQ(createIface(IfaceType::AP), "wlan0"); } TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateSta_ShouldFail) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_TRUE(createIface(IfaceType::STA).empty()); } TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateP2p_ShouldFail) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_TRUE(createIface(IfaceType::STA).empty()); } TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateNan_ShouldFail) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_TRUE(createIface(IfaceType::NAN).empty()); } @@ -357,46 +362,46 @@ class WifiChipV1_AwareIfaceCombinationTest : public WifiChipTest { }; TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateSta_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateP2p_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateNan_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::NAN).empty()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateAp_ShouldFail) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_TRUE(createIface(IfaceType::AP).empty()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2p_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaNan_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::NAN).empty()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2PNan_ShouldFail) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); ASSERT_TRUE(createIface(IfaceType::NAN).empty()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaNan_AfterP2pRemove_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); const auto p2p_iface_name = createIface(IfaceType::P2P); ASSERT_FALSE(p2p_iface_name.empty()); @@ -408,7 +413,7 @@ TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaNan_AfterP2pRemove } TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2p_AfterNanRemove_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); const auto nan_iface_name = createIface(IfaceType::NAN); ASSERT_FALSE(nan_iface_name.empty()); @@ -420,50 +425,50 @@ TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2p_AfterNanRemove } TEST_F(WifiChipV1_AwareIfaceCombinationTest, ApMode_CreateAp_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_EQ(createIface(IfaceType::AP), "wlan0"); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, ApMode_CreateSta_ShouldFail) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_TRUE(createIface(IfaceType::STA).empty()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, ApMode_CreateP2p_ShouldFail) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_TRUE(createIface(IfaceType::STA).empty()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, ApMode_CreateNan_ShouldFail) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_TRUE(createIface(IfaceType::NAN).empty()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, RttControllerFlowStaModeNoSta) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_TRUE(createRttController()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, RttControllerFlowStaModeWithSta) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_TRUE(createRttController()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, RttControllerFlowApToSta) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); const auto ap_iface_name = createIface(IfaceType::AP); ASSERT_FALSE(ap_iface_name.empty()); ASSERT_FALSE(createRttController()); removeIface(IfaceType::AP, ap_iface_name); - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_TRUE(createRttController()); } TEST_F(WifiChipV1_AwareIfaceCombinationTest, SelectTxScenarioWithOnlySta) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_)) .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); @@ -473,7 +478,7 @@ TEST_F(WifiChipV1_AwareIfaceCombinationTest, SelectTxScenarioWithOnlySta) { } TEST_F(WifiChipV1_AwareIfaceCombinationTest, SelectTxScenarioWithOnlyAp) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_EQ(createIface(IfaceType::AP), "wlan0"); EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_)) .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); @@ -496,45 +501,45 @@ class WifiChipV2_AwareIfaceCombinationTest : public WifiChipTest { }; TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateSta_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateP2p_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNan_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::NAN).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateAp_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_EQ(createIface(IfaceType::AP), "wlan1"); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaSta_ShouldFail) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); ASSERT_TRUE(createIface(IfaceType::STA).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaAp_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); ASSERT_EQ(createIface(IfaceType::AP), "wlan1"); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApSta_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_EQ(createIface(IfaceType::AP), "wlan1"); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateSta_AfterStaApRemove_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); const auto sta_iface_name = createIface(IfaceType::STA); ASSERT_FALSE(sta_iface_name.empty()); const auto ap_iface_name = createIface(IfaceType::AP); @@ -549,26 +554,26 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateSta_AfterStaApRemove_ShouldSu } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2p_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaNan_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::NAN).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2PNan_ShouldFail) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::P2P).empty()); ASSERT_TRUE(createIface(IfaceType::NAN).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaNan_AfterP2pRemove_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); const auto p2p_iface_name = createIface(IfaceType::P2P); ASSERT_FALSE(p2p_iface_name.empty()); @@ -580,7 +585,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaNan_AfterP2pRemove_ShouldS } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2p_AfterNanRemove_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); const auto nan_iface_name = createIface(IfaceType::NAN); ASSERT_FALSE(nan_iface_name.empty()); @@ -592,19 +597,19 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2p_AfterNanRemove_ShouldS } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApNan_ShouldFail) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_FALSE(createIface(IfaceType::AP).empty()); ASSERT_TRUE(createIface(IfaceType::NAN).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApP2p_ShouldFail) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_FALSE(createIface(IfaceType::AP).empty()); ASSERT_TRUE(createIface(IfaceType::P2P).empty()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, StaMode_CreateStaNan_AfterP2pRemove_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); const auto p2p_iface_name = createIface(IfaceType::P2P); ASSERT_FALSE(p2p_iface_name.empty()); @@ -616,7 +621,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, StaMode_CreateStaNan_AfterP2pRemove } TEST_F(WifiChipV2_AwareIfaceCombinationTest, StaMode_CreateStaP2p_AfterNanRemove_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); const auto nan_iface_name = createIface(IfaceType::NAN); ASSERT_FALSE(nan_iface_name.empty()); @@ -628,7 +633,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, StaMode_CreateStaP2p_AfterNanRemove } TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaAp_EnsureDifferentIfaceNames) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); const auto sta_iface_name = createIface(IfaceType::STA); const auto ap_iface_name = createIface(IfaceType::AP); ASSERT_FALSE(sta_iface_name.empty()); @@ -637,25 +642,25 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaAp_EnsureDifferentIfaceNam } TEST_F(WifiChipV2_AwareIfaceCombinationTest, RttControllerFlowStaModeNoSta) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_TRUE(createRttController()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, RttControllerFlowStaModeWithSta) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_TRUE(createRttController()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, RttControllerFlow) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::AP).empty()); ASSERT_TRUE(createRttController()); } TEST_F(WifiChipV2_AwareIfaceCombinationTest, SelectTxScenarioWithOnlySta) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_)) .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); @@ -665,7 +670,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, SelectTxScenarioWithOnlySta) { } TEST_F(WifiChipV2_AwareIfaceCombinationTest, SelectTxScenarioWithOnlyAp) { - findModeAndConfigureForIfaceType(IfaceType::AP); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP); ASSERT_EQ(createIface(IfaceType::AP), "wlan1"); EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan1", testing::_)) .WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS)); @@ -675,7 +680,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, SelectTxScenarioWithOnlyAp) { } TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveNanOnStaRemove) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); // Create NAN iface @@ -711,7 +716,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveNanOnStaRemove) } TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveRttControllerOnStaRemove) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); // Create RTT controller @@ -735,7 +740,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveRttControllerOnS TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNanWithSharedNanIface) { property_set("wifi.aware.interface", nullptr); - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); ASSERT_EQ(createIface(IfaceType::NAN), "wlan0"); removeIface(IfaceType::NAN, "wlan0"); @@ -744,7 +749,7 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNanWithSharedNanIface) { TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNanWithDedicatedNanIface) { property_set("wifi.aware.interface", "aware0"); - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); EXPECT_CALL(*iface_util_, ifNameToIndex("aware0")).WillOnce(testing::Return(4)); EXPECT_CALL(*iface_util_, setUpState("aware0", true)).WillOnce(testing::Return(true)); @@ -764,7 +769,7 @@ class WifiChipV1_AwareDisabledApIfaceCombinationTest : public WifiChipTest { }; TEST_F(WifiChipV1_AwareDisabledApIfaceCombinationTest, StaMode_CreateSta_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_TRUE(createIface(IfaceType::AP).empty()); } @@ -779,7 +784,7 @@ class WifiChipV2_AwareDisabledApIfaceCombinationTest : public WifiChipTest { }; TEST_F(WifiChipV2_AwareDisabledApIfaceCombinationTest, CreateSta_ShouldSucceed) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_TRUE(createIface(IfaceType::AP).empty()); } @@ -794,7 +799,7 @@ class WifiChip_MultiIfaceTest : public WifiChipTest { }; TEST_F(WifiChip_MultiIfaceTest, Create3Sta) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::STA).empty()); ASSERT_FALSE(createIface(IfaceType::STA).empty()); @@ -807,7 +812,7 @@ TEST_F(WifiChip_MultiIfaceTest, CreateStaWithDefaultNames) { property_set("wifi.interface.2", ""); property_set("wifi.interface", ""); property_set("wifi.concurrent.interface", ""); - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); ASSERT_EQ(createIface(IfaceType::STA), "wlan1"); ASSERT_EQ(createIface(IfaceType::STA), "wlan2"); @@ -819,7 +824,7 @@ TEST_F(WifiChip_MultiIfaceTest, CreateStaWithCustomNames) { property_set("wifi.interface.2", "test2"); property_set("wifi.interface", "bad0"); property_set("wifi.concurrent.interface", "bad1"); - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_EQ(createIface(IfaceType::STA), "bad0"); ASSERT_EQ(createIface(IfaceType::STA), "bad1"); ASSERT_EQ(createIface(IfaceType::STA), "test2"); @@ -831,14 +836,14 @@ TEST_F(WifiChip_MultiIfaceTest, CreateStaWithCustomAltNames) { property_set("wifi.interface.2", ""); property_set("wifi.interface", "testA0"); property_set("wifi.concurrent.interface", "testA1"); - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); ASSERT_EQ(createIface(IfaceType::STA), "testA0"); ASSERT_EQ(createIface(IfaceType::STA), "testA1"); ASSERT_EQ(createIface(IfaceType::STA), "wlan2"); } TEST_F(WifiChip_MultiIfaceTest, CreateApStartsWithIdx1) { - findModeAndConfigureForIfaceType(IfaceType::STA); + findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); // First AP will be slotted to wlan1. ASSERT_EQ(createIface(IfaceType::AP), "wlan1"); // First STA will be slotted to wlan0. diff --git a/wifi/1.6/default/wifi_chip.cpp b/wifi/1.6/default/wifi_chip.cpp index 4fff770dd2..0e2accf510 100644 --- a/wifi/1.6/default/wifi_chip.cpp +++ b/wifi/1.6/default/wifi_chip.cpp @@ -728,6 +728,11 @@ Return WifiChip::getSupportedRadioCombinationsMatrix( &WifiChip::getSupportedRadioCombinationsMatrixInternal, hidl_status_cb); } +Return WifiChip::getAvailableModes_1_6(getAvailableModes_1_6_cb hidl_status_cb) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getAvailableModesInternal_1_6, hidl_status_cb); +} + void WifiChip::invalidateAndRemoveAllIfaces() { invalidateAndClearBridgedApAll(); invalidateAndClearAll(ap_ifaces_); @@ -784,9 +789,10 @@ std::pair WifiChip::getCapabilitiesInternal() { return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), 0}; } -std::pair> +std::pair> WifiChip::getAvailableModesInternal() { - return {createWifiStatus(WifiStatusCode::SUCCESS), modes_}; + // Deprecated support -- use getAvailableModes_1_6. + return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; } WifiStatus WifiChip::configureChipInternal( @@ -910,7 +916,7 @@ sp WifiChip::newWifiApIface(std::string& ifname) { } std::pair> WifiChip::createApIfaceInternal() { - if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::AP)) { + if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::AP)) { return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } std::string ifname = allocateApIfaceName(); @@ -923,7 +929,7 @@ std::pair> WifiChip::createApIfaceInternal() } std::pair> WifiChip::createBridgedApIfaceInternal() { - if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::AP)) { + if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::AP_BRIDGED)) { return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } std::vector ap_instances = allocateBridgedApInstanceNames(); @@ -1040,7 +1046,7 @@ WifiStatus WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal( } std::pair> WifiChip::createNanIfaceInternal() { - if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::NAN)) { + if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::NAN)) { return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } bool is_dedicated_iface = true; @@ -1092,7 +1098,7 @@ WifiStatus WifiChip::removeNanIfaceInternal(const std::string& ifname) { } std::pair> WifiChip::createP2pIfaceInternal() { - if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::P2P)) { + if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::P2P)) { return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } std::string ifname = getPredefinedP2pIfaceName(); @@ -1136,7 +1142,7 @@ WifiStatus WifiChip::removeP2pIfaceInternal(const std::string& ifname) { } std::pair> WifiChip::createStaIfaceInternal() { - if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::STA)) { + if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::STA)) { return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } std::string ifname = allocateStaIfaceName(); @@ -1436,7 +1442,8 @@ WifiStatus WifiChip::triggerSubsystemRestartInternal() { std::pair> WifiChip::createRttControllerInternal_1_6( const sp& bound_iface) { - if (sta_ifaces_.size() == 0 && !canCurrentModeSupportIfaceOfType(IfaceType::STA)) { + if (sta_ifaces_.size() == 0 && + !canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::STA)) { LOG(ERROR) << "createRttControllerInternal_1_6: Chip cannot support STAs " "(and RTT by extension)"; return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; @@ -1489,6 +1496,11 @@ WifiChip::getSupportedRadioCombinationsMatrixInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_matrix}; } +std::pair> +WifiChip::getAvailableModesInternal_1_6() { + return {createWifiStatus(WifiStatusCode::SUCCESS), modes_}; +} + WifiStatus WifiChip::handleChipConfiguration( /* NONNULL */ std::unique_lock* lock, ChipModeId mode_id) { // If the chip is already configured in a different mode, stop @@ -1606,7 +1618,8 @@ WifiStatus WifiChip::registerRadioModeChangeCallback() { return createWifiStatusFromLegacyError(legacy_status); } -std::vector WifiChip::getCurrentModeIfaceCombinations() { +std::vector +WifiChip::getCurrentModeConcurrencyCombinations() { if (!isValidModeId(current_mode_id_)) { LOG(ERROR) << "Chip not configured in a mode yet"; return {}; @@ -1616,27 +1629,39 @@ std::vector WifiChip::getCurrentModeIface return mode.availableCombinations; } } - CHECK(0) << "Expected to find iface combinations for current mode!"; + CHECK(0) << "Expected to find concurrency combinations for current mode!"; return {}; } -// Returns a map indexed by IfaceType with the number of ifaces currently -// created of the corresponding type. -std::map WifiChip::getCurrentIfaceCombination() { - std::map iface_counts; - iface_counts[IfaceType::AP] = ap_ifaces_.size(); - iface_counts[IfaceType::NAN] = nan_ifaces_.size(); - iface_counts[IfaceType::P2P] = p2p_ifaces_.size(); - iface_counts[IfaceType::STA] = sta_ifaces_.size(); +// Returns a map indexed by IfaceConcurrencyType with the number of ifaces currently +// created of the corresponding concurrency type. +std::map WifiChip::getCurrentConcurrencyCombination() { + std::map iface_counts; + uint32_t num_ap = 0; + uint32_t num_ap_bridged = 0; + for (const auto& ap_iface : ap_ifaces_) { + std::string ap_iface_name = ap_iface->getName(); + if (br_ifaces_ap_instances_.count(ap_iface_name) > 0 && + br_ifaces_ap_instances_[ap_iface_name].size() > 1) { + num_ap_bridged++; + } else { + num_ap++; + } + } + iface_counts[IfaceConcurrencyType::AP] = num_ap; + iface_counts[IfaceConcurrencyType::AP_BRIDGED] = num_ap_bridged; + iface_counts[IfaceConcurrencyType::NAN] = nan_ifaces_.size(); + iface_counts[IfaceConcurrencyType::P2P] = p2p_ifaces_.size(); + iface_counts[IfaceConcurrencyType::STA] = sta_ifaces_.size(); return iface_counts; } -// This expands the provided iface combinations to a more parseable +// This expands the provided concurrency combinations to a more parseable // form. Returns a vector of available combinations possible with the number -// of ifaces of each type in the combination. -// This method is a port of HalDeviceManager.expandIfaceCombos() from framework. -std::vector> WifiChip::expandIfaceCombinations( - const V1_4::IWifiChip::ChipIfaceCombination& combination) { +// of each concurrency type in the combination. +// This method is a port of HalDeviceManager.expandConcurrencyCombos() from framework. +std::vector> WifiChip::expandConcurrencyCombinations( + const V1_6::IWifiChip::ChipConcurrencyCombination& combination) { uint32_t num_expanded_combos = 1; for (const auto& limit : combination.limits) { for (uint32_t i = 0; i < limit.maxIfaces; i++) { @@ -1644,12 +1669,14 @@ std::vector> WifiChip::expandIfaceCombinations( } } - // Allocate the vector of expanded combos and reset all iface counts to 0 + // Allocate the vector of expanded combos and reset all concurrency type counts to 0 // in each combo. - std::vector> expanded_combos; + std::vector> expanded_combos; expanded_combos.resize(num_expanded_combos); for (auto& expanded_combo : expanded_combos) { - for (const auto type : {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) { + for (const auto type : + {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, IfaceConcurrencyType::NAN, + IfaceConcurrencyType::P2P, IfaceConcurrencyType::STA}) { expanded_combo[type] = 0; } } @@ -1666,12 +1693,15 @@ std::vector> WifiChip::expandIfaceCombinations( return expanded_combos; } -bool WifiChip::canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces( - const std::map& expanded_combo, IfaceType requested_type) { - const auto current_combo = getCurrentIfaceCombination(); +bool WifiChip::canExpandedConcurrencyComboSupportConcurrencyTypeWithCurrentTypes( + const std::map& expanded_combo, + IfaceConcurrencyType requested_type) { + const auto current_combo = getCurrentConcurrencyCombination(); // Check if we have space for 1 more iface of |type| in this combo - for (const auto type : {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) { + for (const auto type : + {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, IfaceConcurrencyType::NAN, + IfaceConcurrencyType::P2P, IfaceConcurrencyType::STA}) { size_t num_ifaces_needed = current_combo.at(type); if (type == requested_type) { num_ifaces_needed++; @@ -1685,21 +1715,22 @@ bool WifiChip::canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces( } // This method does the following: -// a) Enumerate all possible iface combos by expanding the current -// ChipIfaceCombination. -// b) Check if the requested iface type can be added to the current mode -// with the iface combination that is already active. -bool WifiChip::canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType requested_type) { +// a) Enumerate all possible concurrency combos by expanding the current +// ChipConcurrencyCombination. +// b) Check if the requested concurrency type can be added to the current mode +// with the concurrency combination that is already active. +bool WifiChip::canCurrentModeSupportConcurrencyTypeWithCurrentTypes( + IfaceConcurrencyType requested_type) { if (!isValidModeId(current_mode_id_)) { LOG(ERROR) << "Chip not configured in a mode yet"; return false; } - const auto combinations = getCurrentModeIfaceCombinations(); + const auto combinations = getCurrentModeConcurrencyCombinations(); for (const auto& combination : combinations) { - const auto expanded_combos = expandIfaceCombinations(combination); + const auto expanded_combos = expandConcurrencyCombinations(combination); for (const auto& expanded_combo : expanded_combos) { - if (canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces(expanded_combo, - requested_type)) { + if (canExpandedConcurrencyComboSupportConcurrencyTypeWithCurrentTypes(expanded_combo, + requested_type)) { return true; } } @@ -1707,15 +1738,17 @@ bool WifiChip::canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType reque return false; } -// Note: This does not consider ifaces already active. It only checks if the -// provided expanded iface combination can support the requested combo. -bool WifiChip::canExpandedIfaceComboSupportIfaceCombo( - const std::map& expanded_combo, - const std::map& req_combo) { - // Check if we have space for 1 more iface of |type| in this combo - for (const auto type : {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) { +// Note: This does not consider concurrency types already active. It only checks if the +// provided expanded concurrency combination can support the requested combo. +bool WifiChip::canExpandedConcurrencyComboSupportConcurrencyCombo( + const std::map& expanded_combo, + const std::map& req_combo) { + // Check if we have space for 1 more |type| in this combo + for (const auto type : + {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, IfaceConcurrencyType::NAN, + IfaceConcurrencyType::P2P, IfaceConcurrencyType::STA}) { if (req_combo.count(type) == 0) { - // Iface of "type" not in the req_combo. + // Concurrency type not in the req_combo. continue; } size_t num_ifaces_needed = req_combo.at(type); @@ -1727,21 +1760,22 @@ bool WifiChip::canExpandedIfaceComboSupportIfaceCombo( return true; } // This method does the following: -// a) Enumerate all possible iface combos by expanding the current -// ChipIfaceCombination. -// b) Check if the requested iface combo can be added to the current mode. -// Note: This does not consider ifaces already active. It only checks if the +// a) Enumerate all possible concurrency combos by expanding the current +// ChipConcurrencyCombination. +// b) Check if the requested concurrency combo can be added to the current mode. +// Note: This does not consider concurrency types already active. It only checks if the // current mode can support the requested combo. -bool WifiChip::canCurrentModeSupportIfaceCombo(const std::map& req_combo) { +bool WifiChip::canCurrentModeSupportConcurrencyCombo( + const std::map& req_combo) { if (!isValidModeId(current_mode_id_)) { LOG(ERROR) << "Chip not configured in a mode yet"; return false; } - const auto combinations = getCurrentModeIfaceCombinations(); + const auto combinations = getCurrentModeConcurrencyCombinations(); for (const auto& combination : combinations) { - const auto expanded_combos = expandIfaceCombinations(combination); + const auto expanded_combos = expandConcurrencyCombinations(combination); for (const auto& expanded_combo : expanded_combos) { - if (canExpandedIfaceComboSupportIfaceCombo(expanded_combo, req_combo)) { + if (canExpandedConcurrencyComboSupportConcurrencyCombo(expanded_combo, req_combo)) { return true; } } @@ -1750,14 +1784,14 @@ bool WifiChip::canCurrentModeSupportIfaceCombo(const std::map } // This method does the following: -// a) Enumerate all possible iface combos by expanding the current -// ChipIfaceCombination. -// b) Check if the requested iface type can be added to the current mode. -bool WifiChip::canCurrentModeSupportIfaceOfType(IfaceType requested_type) { - // Check if we can support at least 1 iface of type. - std::map req_iface_combo; +// a) Enumerate all possible concurrency combos by expanding the current +// ChipConcurrencyCombination. +// b) Check if the requested concurrency type can be added to the current mode. +bool WifiChip::canCurrentModeSupportConcurrencyType(IfaceConcurrencyType requested_type) { + // Check if we can support at least 1 of the requested concurrency type. + std::map req_iface_combo; req_iface_combo[requested_type] = 1; - return canCurrentModeSupportIfaceCombo(req_iface_combo); + return canCurrentModeSupportConcurrencyCombo(req_iface_combo); } bool WifiChip::isValidModeId(ChipModeId mode_id) { @@ -1771,17 +1805,17 @@ bool WifiChip::isValidModeId(ChipModeId mode_id) { bool WifiChip::isStaApConcurrencyAllowedInCurrentMode() { // Check if we can support at least 1 STA & 1 AP concurrently. - std::map req_iface_combo; - req_iface_combo[IfaceType::AP] = 1; - req_iface_combo[IfaceType::STA] = 1; - return canCurrentModeSupportIfaceCombo(req_iface_combo); + std::map req_iface_combo; + req_iface_combo[IfaceConcurrencyType::STA] = 1; + req_iface_combo[IfaceConcurrencyType::AP] = 1; + return canCurrentModeSupportConcurrencyCombo(req_iface_combo); } bool WifiChip::isDualStaConcurrencyAllowedInCurrentMode() { // Check if we can support at least 2 STA concurrently. - std::map req_iface_combo; - req_iface_combo[IfaceType::STA] = 2; - return canCurrentModeSupportIfaceCombo(req_iface_combo); + std::map req_iface_combo; + req_iface_combo[IfaceConcurrencyType::STA] = 2; + return canCurrentModeSupportConcurrencyCombo(req_iface_combo); } std::string WifiChip::getFirstActiveWlanIfaceName() { diff --git a/wifi/1.6/default/wifi_chip.h b/wifi/1.6/default/wifi_chip.h index 13d62fb8dc..f952a68654 100644 --- a/wifi/1.6/default/wifi_chip.h +++ b/wifi/1.6/default/wifi_chip.h @@ -17,6 +17,11 @@ #ifndef WIFI_CHIP_H_ #define WIFI_CHIP_H_ +// HACK: NAN is a macro defined in math.h, which can be included in various +// headers. This wifi HAL uses an enum called NAN, which does not compile when +// the macro is defined. Undefine NAN to work around it. +#undef NAN + #include #include #include @@ -162,6 +167,7 @@ class WifiChip : public V1_6::IWifiChip { getUsableChannels_1_6_cb _hidl_cb) override; Return getSupportedRadioCombinationsMatrix( getSupportedRadioCombinationsMatrix_cb hidl_status_cb) override; + Return getAvailableModes_1_6(getAvailableModes_1_6_cb hidl_status_cb) override; private: void invalidateAndRemoveAllIfaces(); @@ -175,7 +181,7 @@ class WifiChip : public V1_6::IWifiChip { WifiStatus registerEventCallbackInternal( const sp& event_callback); std::pair getCapabilitiesInternal(); - std::pair> getAvailableModesInternal(); + std::pair> getAvailableModesInternal(); WifiStatus configureChipInternal(std::unique_lock* lock, ChipModeId mode_id); std::pair getModeInternal(); @@ -239,17 +245,21 @@ class WifiChip : public V1_6::IWifiChip { ChipModeId mode_id); WifiStatus registerDebugRingBufferCallback(); WifiStatus registerRadioModeChangeCallback(); - std::vector getCurrentModeIfaceCombinations(); - std::map getCurrentIfaceCombination(); - std::vector> expandIfaceCombinations( - const V1_4::IWifiChip::ChipIfaceCombination& combination); - bool canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces( - const std::map& expanded_combo, IfaceType requested_type); - bool canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType requested_type); - bool canExpandedIfaceComboSupportIfaceCombo(const std::map& expanded_combo, - const std::map& req_combo); - bool canCurrentModeSupportIfaceCombo(const std::map& req_combo); - bool canCurrentModeSupportIfaceOfType(IfaceType requested_type); + std::vector + getCurrentModeConcurrencyCombinations(); + std::map getCurrentConcurrencyCombination(); + std::vector> expandConcurrencyCombinations( + const V1_6::IWifiChip::ChipConcurrencyCombination& combination); + bool canExpandedConcurrencyComboSupportConcurrencyTypeWithCurrentTypes( + const std::map& expanded_combo, + IfaceConcurrencyType requested_type); + bool canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType requested_type); + bool canExpandedConcurrencyComboSupportConcurrencyCombo( + const std::map& expanded_combo, + const std::map& req_combo); + bool canCurrentModeSupportConcurrencyCombo( + const std::map& req_combo); + bool canCurrentModeSupportConcurrencyType(IfaceConcurrencyType requested_type); bool isValidModeId(ChipModeId mode_id); bool isStaApConcurrencyAllowedInCurrentMode(); bool isDualStaConcurrencyAllowedInCurrentMode(); @@ -270,6 +280,7 @@ class WifiChip : public V1_6::IWifiChip { std::pair> getUsableChannelsInternal_1_6( WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask); std::pair getSupportedRadioCombinationsMatrixInternal(); + std::pair> getAvailableModesInternal_1_6(); ChipId chip_id_; std::weak_ptr legacy_hal_; @@ -285,7 +296,7 @@ class WifiChip : public V1_6::IWifiChip { // Members pertaining to chip configuration. uint32_t current_mode_id_; std::mutex lock_t; - std::vector modes_; + std::vector modes_; // The legacy ring buffer callback API has only a global callback // registration mechanism. Use this to check if we have already // registered a callback. diff --git a/wifi/1.6/default/wifi_feature_flags.cpp b/wifi/1.6/default/wifi_feature_flags.cpp index 71319e1e90..e80a3cdcb6 100644 --- a/wifi/1.6/default/wifi_feature_flags.cpp +++ b/wifi/1.6/default/wifi_feature_flags.cpp @@ -29,8 +29,8 @@ namespace implementation { namespace feature_flags { using V1_0::ChipModeId; -using V1_0::IfaceType; using V1_0::IWifiChip; +using V1_6::IfaceConcurrencyType; /* The chip may either have a single mode supporting any number of combinations, * or a fixed dual-mode (so it involves firmware loading to switch between @@ -42,9 +42,9 @@ using V1_0::IWifiChip; * WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA, AP}, 1}, {{P2P, NAN}, 1}}, * WIFI_HAL_INTERFACE_COMBINATIONS += {{{STA}, 1}, {{AP}, 2}} * What means: - * Interface combination 1: 1 STA or AP and 1 P2P or NAN concurrent iface + * Interface concurrency combination 1: 1 STA or AP and 1 P2P or NAN concurrent iface * operations. - * Interface combination 2: 1 STA and 2 AP concurrent iface operations. + * Interface concurrency combination 2: 1 STA and 2 AP concurrent iface operations. * * For backward compatibility, the following makefile flags can be used to * generate combinations list: @@ -53,20 +53,20 @@ using V1_0::IWifiChip; * - WIFI_HIDL_FEATURE_AWARE * However, they are ignored if WIFI_HAL_INTERFACE_COMBINATIONS was provided. * With WIFI_HIDL_FEATURE_DUAL_INTERFACE flag set, there is a single mode with - * two interface combinations: - * Interface Combination 1: Will support 1 STA and 1 P2P or NAN (optional) + * two concurrency combinations: + * Interface Concurrency Combination 1: Will support 1 STA and 1 P2P or NAN (optional) * concurrent iface operations. - * Interface Combination 2: Will support 1 STA and 1 AP concurrent + * Interface Concurrency Combination 2: Will support 1 STA and 1 AP concurrent * iface operations. * * The only dual-mode configuration supported is for alternating STA and AP * mode, that may involve firmware reloading. In such case, there are 2 separate - * modes of operation with 1 interface combination each: + * modes of operation with 1 concurrency combination each: * Mode 1 (STA mode): Will support 1 STA and 1 P2P or NAN (optional) * concurrent iface operations. * Mode 2 (AP mode): Will support 1 AP iface operation. * - * If Aware is enabled, the iface combination will be modified to support either + * If Aware is enabled, the concurrency combination will be modified to support either * P2P or NAN in place of just P2P. */ // clang-format off @@ -117,79 +117,87 @@ constexpr ChipModeId kMainModeId = chip_mode_ids::kV1Sta; * The main point here is to simplify the syntax required by * WIFI_HAL_INTERFACE_COMBINATIONS. */ -struct ChipIfaceCombination : public hidl_vec { - ChipIfaceCombination(const std::initializer_list list) +struct ChipConcurrencyCombination + : public hidl_vec { + ChipConcurrencyCombination( + const std::initializer_list list) : hidl_vec(list) {} - operator IWifiChip::ChipIfaceCombination() const { return {*this}; } + operator V1_6::IWifiChip::ChipConcurrencyCombination() const { return {*this}; } - static hidl_vec make_vec( - const std::initializer_list list) { - return hidl_vec( // + static hidl_vec make_vec( + const std::initializer_list list) { + return hidl_vec( // std::begin(list), std::end(list)); } }; -#define STA IfaceType::STA -#define AP IfaceType::AP -#define P2P IfaceType::P2P -#define NAN IfaceType::NAN -static const std::vector kChipModesPrimary{ - {kMainModeId, ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS})}, +#define STA IfaceConcurrencyType::STA +#define AP IfaceConcurrencyType::AP +#define AP_BRIDGED IfaceConcurrencyType::AP_BRIDGED +#define P2P IfaceConcurrencyType::P2P +#define NAN IfaceConcurrencyType::NAN +static const std::vector kChipModesPrimary{ + {kMainModeId, ChipConcurrencyCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS})}, #ifdef WIFI_HAL_INTERFACE_COMBINATIONS_AP {chip_mode_ids::kV1Ap, - ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_AP})}, + ChipConcurrencyCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_AP})}, #endif }; -static const std::vector kChipModesSecondary{ +static const std::vector kChipModesSecondary{ #ifdef WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP {chip_mode_ids::kV3, - ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP})}, + ChipConcurrencyCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP})}, #endif }; constexpr char kDebugPresetInterfaceCombinationIdxProperty[] = "persist.vendor.debug.wifi.hal.preset_interface_combination_idx"; -// List of pre-defined interface combinations that can be enabled at runtime via +// List of pre-defined concurrency combinations that can be enabled at runtime via // setting the property: "kDebugPresetInterfaceCombinationIdxProperty" to the // corresponding index value. -static const std::vector>> kDebugChipModes{ - // Legacy combination - No STA/AP concurrencies. - // 0 - (1 AP) or (1 STA + 1 of (P2P or NAN)) - {"No STA/AP Concurrency", - {{kMainModeId, - ChipIfaceCombination::make_vec({{{{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, - - // STA + AP concurrency - // 1 - (1 STA + 1 AP) or (1 STA + 1 of (P2P or NAN)) - {"STA + AP Concurrency", - {{kMainModeId, ChipIfaceCombination::make_vec( - {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, - - // STA + STA concurrency - // 2 - (1 STA + 1 AP) or (2 STA + 1 of (P2P or NAN)) - {"Dual STA Concurrency", - {{kMainModeId, ChipIfaceCombination::make_vec( - {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}}, - - // AP + AP + STA concurrency - // 3 - (1 STA + 2 AP) or (1 STA + 1 of (P2P or NAN)) - {"Dual AP Concurrency", - {{kMainModeId, ChipIfaceCombination::make_vec( - {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, - - // STA + STA concurrency and AP + AP + STA concurrency - // 4 - (1 STA + 2 AP) or (2 STA + 1 of (P2P or NAN)) - {"Dual STA & Dual AP Concurrency", - {{kMainModeId, ChipIfaceCombination::make_vec( - {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}}, - - // STA + STA concurrency - // 5 - (1 STA + 1 AP (bridged or single) | P2P | NAN), or (2 STA)) - {"Dual STA or STA plus single other interface", - {{kMainModeId, - ChipIfaceCombination::make_vec({{{{STA}, 1}, {{P2P, NAN, AP}, 1}}, {{{STA}, 2}}})}}}}; +static const std::vector>> + kDebugChipModes{// Legacy combination - No STA/AP concurrencies. + // 0 - (1 AP) or (1 STA + 1 of (P2P or NAN)) + {"No STA/AP Concurrency", + {{kMainModeId, ChipConcurrencyCombination::make_vec( + {{{{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, + + // STA + AP concurrency + // 1 - (1 STA + 1 AP) or (1 STA + 1 of (P2P or NAN)) + {"STA + AP Concurrency", + {{kMainModeId, + ChipConcurrencyCombination::make_vec( + {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, + + // STA + STA concurrency + // 2 - (1 STA + 1 AP) or (2 STA + 1 of (P2P or NAN)) + {"Dual STA Concurrency", + {{kMainModeId, + ChipConcurrencyCombination::make_vec( + {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}}, + + // AP + AP + STA concurrency + // 3 - (1 STA + 2 AP) or (1 STA + 1 of (P2P or NAN)) + {"Dual AP Concurrency", + {{kMainModeId, + ChipConcurrencyCombination::make_vec( + {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}}, + + // STA + STA concurrency and AP + AP + STA concurrency + // 4 - (1 STA + 2 AP) or (2 STA + 1 of (P2P or NAN)) + {"Dual STA & Dual AP Concurrency", + {{kMainModeId, + ChipConcurrencyCombination::make_vec( + {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}}, + + // STA + STA concurrency + // 5 - (1 STA + 1 AP (bridged or single) | P2P | NAN), or (2 STA)) + {"Dual STA or STA plus single other interface", + {{kMainModeId, ChipConcurrencyCombination::make_vec( + {{{{STA}, 1}, {{P2P, NAN, AP, AP_BRIDGED}, 1}}, + {{{STA}, 2}}})}}}}; #undef STA #undef AP @@ -206,13 +214,13 @@ static const std::vector WifiFeatureFlags::WifiFeatureFlags() {} -std::vector WifiFeatureFlags::getChipModesForPrimary() { +std::vector WifiFeatureFlags::getChipModesForPrimary() { std::array buffer; auto res = property_get(kDebugPresetInterfaceCombinationIdxProperty, buffer.data(), nullptr); - // Debug propety not set, use the device preset interface combination. + // Debug property not set, use the device preset concurrency combination. if (res <= 0) return kChipModesPrimary; - // Debug propety set, use one of the debug preset interface combination. + // Debug property set, use one of the debug preset concurrency combination. unsigned long idx = std::stoul(buffer.data()); if (idx >= kDebugChipModes.size()) { LOG(ERROR) << "Invalid index set in property: " @@ -220,14 +228,14 @@ std::vector WifiFeatureFlags::getChipModesForPrimary() { return kChipModesPrimary; } std::string name; - std::vector chip_modes; + std::vector chip_modes; std::tie(name, chip_modes) = kDebugChipModes[idx]; LOG(INFO) << "Using debug chip mode: <" << name << "> set via property: " << kDebugPresetInterfaceCombinationIdxProperty; return chip_modes; } -std::vector WifiFeatureFlags::getChipModes(bool is_primary) { +std::vector WifiFeatureFlags::getChipModes(bool is_primary) { return (is_primary) ? getChipModesForPrimary() : kChipModesSecondary; } diff --git a/wifi/1.6/default/wifi_feature_flags.h b/wifi/1.6/default/wifi_feature_flags.h index d5844d99b3..1635341e3f 100644 --- a/wifi/1.6/default/wifi_feature_flags.h +++ b/wifi/1.6/default/wifi_feature_flags.h @@ -17,7 +17,7 @@ #ifndef WIFI_FEATURE_FLAGS_H_ #define WIFI_FEATURE_FLAGS_H_ -#include +#include namespace android { namespace hardware { @@ -42,10 +42,10 @@ class WifiFeatureFlags { WifiFeatureFlags(); virtual ~WifiFeatureFlags() = default; - virtual std::vector getChipModes(bool is_primary); + virtual std::vector getChipModes(bool is_primary); private: - std::vector getChipModesForPrimary(); + std::vector getChipModesForPrimary(); }; } // namespace feature_flags diff --git a/wifi/1.6/types.hal b/wifi/1.6/types.hal index 80fdbd1541..aed37fad0d 100644 --- a/wifi/1.6/types.hal +++ b/wifi/1.6/types.hal @@ -1312,3 +1312,29 @@ struct WifiRadioCombinationMatrix { */ vec radioCombinations; }; + +/** + * List of interface concurrency types, used in reporting device concurrency capabilities. + */ +enum IfaceConcurrencyType : uint32_t { + /** + * Concurrency type for station mode. + */ + STA, + /** + * Concurrency type of single-port AP mode. + */ + AP, + /** + * Concurrency type of two-port bridged AP mode. + */ + AP_BRIDGED, + /** + * Concurrency type of peer-to-peer mode. + */ + P2P, + /** + * Concurrency type of neighborhood area network mode. + */ + NAN, +}; -- GitLab From edf3ef9f932376b9074a30c08b0a2d8302151872 Mon Sep 17 00:00:00 2001 From: ramindani Date: Fri, 7 Jan 2022 00:04:23 +0000 Subject: [PATCH 585/825] IComposerClient wrapper for VTS tests A wrapper helps with implementation details of IComposerClient and improves re-usability with readback and base tests. Changes from the original wrapper (ag/16578214): Changed the createClient to return ScopedAStatus as it helps more with the singleton test. And updated getDisplays to go through all the configurations and save it in the DisplayResources as we use the properties like width, height, vsync later in the test and we avoid querying to the composerClient for this. With readback tests updated setReadbackBuffer method to use const native_handle_t* buffer instead of const native_handle* buffer BUG: 199413815 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: Ia33c9489bf15a52edcae55a91ec56666df3726c1 --- .../composer3/vts/functional/Android.bp | 9 +- .../vts/functional/composer-vts/Android.bp | 78 --- .../composer-vts/VtsComposerClient.cpp | 502 ++++++++++++++++++ .../include/GraphicsComposerCallback.h | 7 - .../composer-vts/include/ReadbackVts.h | 4 +- .../composer-vts/include/RenderEngineVts.h | 2 +- .../composer-vts/include/VtsComposerClient.h | 240 +++++++++ .../graphics/composer3/ComposerClientWriter.h | 6 +- 8 files changed, 756 insertions(+), 92 deletions(-) delete mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp index bd2c3b1248..139b5e8512 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp @@ -35,6 +35,9 @@ cc_test { "VtsHalGraphicsComposer3_TargetTest.cpp", "VtsHalGraphicsComposer3_ReadbackTest.cpp", "composer-vts/GraphicsComposerCallback.cpp", + "composer-vts/ReadbackVts.cpp", + "composer-vts/RenderEngineVts.cpp", + "composer-vts/VtsComposerClient.cpp", ], shared_libs: [ @@ -72,15 +75,19 @@ cc_test { "android.hardware.graphics.allocator@2.0", "android.hardware.graphics.allocator@3.0", "android.hardware.graphics.allocator@4.0", - "android.hardware.graphics.composer@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", + "libarect", + "libbase", + "libfmq", "libgtest", + "libmath", "librenderengine", "libshaders", + "libsync", "libtonemap", ], cflags: [ diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp deleted file mode 100644 index df038db47b..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp +++ /dev/null @@ -1,78 +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. - */ - -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_library_static { - name: "android.hardware.graphics.composer@3-vts", - defaults: ["hidl_defaults"], - srcs: [ - "GraphicsComposerCallback.cpp", - "ReadbackVts.cpp", - "RenderEngineVts.cpp", - ], - header_libs: [ - "android.hardware.graphics.composer3-command-buffer", - ], - static_libs: [ - "android.hardware.graphics.composer3-V1-ndk", - "android.hardware.graphics.common-V3-ndk", - "android.hardware.common-V2-ndk", - "android.hardware.common.fmq-V1-ndk", - "libarect", - "libgtest", - "libbase", - "libfmq", - "libsync", - "libmath", - "libaidlcommonsupport", - "libnativewindow", - "librenderengine", - "libshaders", - "libtonemap", - "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", - ], - shared_libs: [ - "libbinder_ndk", - "libhidlbase", - "libui", - "android.hardware.graphics.composer3-V1-ndk", - ], - export_static_lib_headers: [ - "android.hardware.graphics.mapper@2.1-vts", - "librenderengine", - ], - cflags: [ - "-O0", - "-g", - "-DLOG_TAG=\"ComposerVts\"", - "-Wconversion", - ], - export_header_lib_headers: [ - "android.hardware.graphics.composer3-command-buffer", - ], - export_include_dirs: ["include"], -} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp new file mode 100644 index 0000000000..8c882d0af6 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp @@ -0,0 +1,502 @@ +/** + * 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. + */ + +#include "include/VtsComposerClient.h" +#include +#include +#include + +#undef LOG_TAG +#define LOG_TAG "VtsComposerClient" + +using namespace std::chrono_literals; + +namespace aidl::android::hardware::graphics::composer3::vts { + +VtsComposerClient::VtsComposerClient(const std::string& name) { + SpAIBinder binder(AServiceManager_waitForService(name.c_str())); + ALOGE_IF(binder == nullptr, "Could not initialize the service binder"); + if (binder != nullptr) { + mComposer = IComposer::fromBinder(binder); + ALOGE_IF(mComposer == nullptr, "Failed to acquire the composer from the binder"); + } +} + +ScopedAStatus VtsComposerClient::createClient() { + if (mComposer == nullptr) { + ALOGE("IComposer not initialized"); + return ScopedAStatus::fromServiceSpecificError(IComposerClient::INVALID_CONFIGURATION); + } + auto status = mComposer->createClient(&mComposerClient); + if (!status.isOk() || mComposerClient == nullptr) { + ALOGE("Failed to create client for IComposerClient with %s", + status.getDescription().c_str()); + return status; + } + mComposerCallback = SharedRefBase::make(); + if (mComposerCallback == nullptr) { + ALOGE("Unable to create ComposerCallback"); + return ScopedAStatus::fromServiceSpecificError(IComposerClient::INVALID_CONFIGURATION); + } + return mComposerClient->registerCallback(mComposerCallback); +} + +bool VtsComposerClient::tearDown() { + return verifyComposerCallbackParams() && destroyAllLayers(); +} + +std::pair VtsComposerClient::createVirtualDisplay( + int32_t width, int32_t height, PixelFormat pixelFormat, int32_t bufferSlotCount) { + VirtualDisplay outVirtualDisplay; + auto status = mComposerClient->createVirtualDisplay(width, height, pixelFormat, bufferSlotCount, + &outVirtualDisplay); + if (!status.isOk()) { + return {std::move(status), outVirtualDisplay}; + } + return {addDisplayToDisplayResources(outVirtualDisplay.display, /*isVirtual*/ true), + outVirtualDisplay}; +} + +ScopedAStatus VtsComposerClient::destroyVirtualDisplay(int64_t display) { + auto status = mComposerClient->destroyVirtualDisplay(display); + if (!status.isOk()) { + return status; + } + mDisplayResources.erase(display); + return status; +} + +std::pair VtsComposerClient::createLayer(int64_t display, + int32_t bufferSlotCount) { + int64_t outLayer; + auto status = mComposerClient->createLayer(display, bufferSlotCount, &outLayer); + + if (!status.isOk()) { + return {std::move(status), outLayer}; + } + 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; + } + removeLayerFromDisplayResources(display, layer); + return status; +} + +std::pair VtsComposerClient::getActiveConfig(int64_t display) { + int32_t outConfig; + return {mComposerClient->getActiveConfig(display, &outConfig), outConfig}; +} + +ScopedAStatus VtsComposerClient::setActiveConfig(VtsDisplay* vtsDisplay, int32_t config) { + auto status = mComposerClient->setActiveConfig(vtsDisplay->getDisplayId(), config); + if (!status.isOk()) { + return status; + } + return updateDisplayProperties(vtsDisplay, config); +} + +std::pair VtsComposerClient::getDisplayAttribute( + int64_t display, int32_t config, DisplayAttribute displayAttribute) { + int32_t outDisplayAttribute; + return {mComposerClient->getDisplayAttribute(display, config, displayAttribute, + &outDisplayAttribute), + outDisplayAttribute}; +} + +ScopedAStatus VtsComposerClient::setPowerMode(int64_t display, PowerMode powerMode) { + return mComposerClient->setPowerMode(display, powerMode); +} + +ScopedAStatus VtsComposerClient::setVsync(int64_t display, bool enable) { + return mComposerClient->setVsyncEnabled(display, enable); +} + +void VtsComposerClient::setVsyncAllowed(bool isAllowed) { + mComposerCallback->setVsyncAllowed(isAllowed); +} + +std::pair> VtsComposerClient::getDataspaceSaturationMatrix( + Dataspace dataspace) { + std::vector outMatrix; + return {mComposerClient->getDataspaceSaturationMatrix(dataspace, &outMatrix), outMatrix}; +} + +std::pair> VtsComposerClient::executeCommands( + const std::vector& commands) { + std::vector outResultPayload; + return {mComposerClient->executeCommands(commands, &outResultPayload), + std::move(outResultPayload)}; +} + +std::optional VtsComposerClient::takeLastVsyncPeriodChangeTimeline() { + return mComposerCallback->takeLastVsyncPeriodChangeTimeline(); +} + +ScopedAStatus VtsComposerClient::setContentType(int64_t display, ContentType contentType) { + return mComposerClient->setContentType(display, contentType); +} + +std::pair +VtsComposerClient::setActiveConfigWithConstraints(VtsDisplay* vtsDisplay, int32_t config, + const VsyncPeriodChangeConstraints& constraints) { + VsyncPeriodChangeTimeline outTimeline; + auto status = mComposerClient->setActiveConfigWithConstraints( + vtsDisplay->getDisplayId(), config, constraints, &outTimeline); + if (!status.isOk()) { + return {std::move(status), outTimeline}; + } + return {updateDisplayProperties(vtsDisplay, config), outTimeline}; +} + +std::pair> VtsComposerClient::getDisplayCapabilities( + int64_t display) { + std::vector outCapabilities; + return {mComposerClient->getDisplayCapabilities(display, &outCapabilities), outCapabilities}; +} + +ScopedAStatus VtsComposerClient::dumpDebugInfo() { + std::string debugInfo; + return mComposer->dumpDebugInfo(&debugInfo); +} + +std::pair VtsComposerClient::getDisplayIdentificationData( + int64_t display) { + DisplayIdentification outDisplayIdentification; + return {mComposerClient->getDisplayIdentificationData(display, &outDisplayIdentification), + outDisplayIdentification}; +} + +std::pair VtsComposerClient::getHdrCapabilities(int64_t display) { + HdrCapabilities outHdrCapabilities; + return {mComposerClient->getHdrCapabilities(display, &outHdrCapabilities), outHdrCapabilities}; +} + +std::pair> +VtsComposerClient::getPerFrameMetadataKeys(int64_t display) { + std::vector outPerFrameMetadataKeys; + return {mComposerClient->getPerFrameMetadataKeys(display, &outPerFrameMetadataKeys), + outPerFrameMetadataKeys}; +} + +std::pair VtsComposerClient::getReadbackBufferAttributes( + int64_t display) { + ReadbackBufferAttributes outReadbackBufferAttributes; + return {mComposerClient->getReadbackBufferAttributes(display, &outReadbackBufferAttributes), + outReadbackBufferAttributes}; +} + +ScopedAStatus VtsComposerClient::setReadbackBuffer(int64_t display, const native_handle_t* buffer, + const ScopedFileDescriptor& releaseFence) { + return mComposerClient->setReadbackBuffer(display, ::android::dupToAidl(buffer), releaseFence); +} + +std::pair VtsComposerClient::getReadbackBufferFence( + int64_t display) { + ScopedFileDescriptor outReleaseFence; + return {mComposerClient->getReadbackBufferFence(display, &outReleaseFence), + std::move(outReleaseFence)}; +} + +std::pair> VtsComposerClient::getColorModes(int64_t display) { + std::vector outColorModes; + return {mComposerClient->getColorModes(display, &outColorModes), outColorModes}; +} + +std::pair> VtsComposerClient::getRenderIntents( + int64_t display, ColorMode colorMode) { + std::vector outRenderIntents; + return {mComposerClient->getRenderIntents(display, colorMode, &outRenderIntents), + outRenderIntents}; +} + +ScopedAStatus VtsComposerClient::setColorMode(int64_t display, ColorMode colorMode, + RenderIntent renderIntent) { + return mComposerClient->setColorMode(display, colorMode, renderIntent); +} + +std::pair +VtsComposerClient::getDisplayedContentSamplingAttributes(int64_t display) { + DisplayContentSamplingAttributes outAttributes; + return {mComposerClient->getDisplayedContentSamplingAttributes(display, &outAttributes), + outAttributes}; +} + +ScopedAStatus VtsComposerClient::setDisplayedContentSamplingEnabled( + int64_t display, bool isEnabled, FormatColorComponent formatColorComponent, + int64_t maxFrames) { + return mComposerClient->setDisplayedContentSamplingEnabled(display, isEnabled, + formatColorComponent, maxFrames); +} + +std::pair VtsComposerClient::getDisplayedContentSample( + int64_t display, int64_t maxFrames, int64_t timestamp) { + DisplayContentSample outDisplayContentSample; + return {mComposerClient->getDisplayedContentSample(display, maxFrames, timestamp, + &outDisplayContentSample), + outDisplayContentSample}; +} + +std::pair VtsComposerClient::getDisplayConnectionType( + int64_t display) { + DisplayConnectionType outDisplayConnectionType; + return {mComposerClient->getDisplayConnectionType(display, &outDisplayConnectionType), + outDisplayConnectionType}; +} + +std::pair> VtsComposerClient::getDisplayConfigs( + int64_t display) { + std::vector outConfigs; + return {mComposerClient->getDisplayConfigs(display, &outConfigs), outConfigs}; +} + +std::pair VtsComposerClient::getDisplayVsyncPeriod(int64_t display) { + int32_t outVsyncPeriodNanos; + return {mComposerClient->getDisplayVsyncPeriod(display, &outVsyncPeriodNanos), + outVsyncPeriodNanos}; +} + +ScopedAStatus VtsComposerClient::setAutoLowLatencyMode(int64_t display, bool isEnabled) { + return mComposerClient->setAutoLowLatencyMode(display, isEnabled); +} + +std::pair> VtsComposerClient::getSupportedContentTypes( + int64_t display) { + std::vector outContentTypes; + return {mComposerClient->getSupportedContentTypes(display, &outContentTypes), outContentTypes}; +} + +std::pair VtsComposerClient::getMaxVirtualDisplayCount() { + int32_t outMaxVirtualDisplayCount; + return {mComposerClient->getMaxVirtualDisplayCount(&outMaxVirtualDisplayCount), + outMaxVirtualDisplayCount}; +} + +std::pair VtsComposerClient::getDisplayName(int64_t display) { + std::string outDisplayName; + return {mComposerClient->getDisplayName(display, &outDisplayName), outDisplayName}; +} + +ScopedAStatus VtsComposerClient::setClientTargetSlotCount(int64_t display, + int32_t bufferSlotCount) { + return mComposerClient->setClientTargetSlotCount(display, bufferSlotCount); +} + +std::pair> VtsComposerClient::getCapabilities() { + std::vector outCapabilities; + return {mComposer->getCapabilities(&outCapabilities), outCapabilities}; +} + +ScopedAStatus VtsComposerClient::setBootDisplayConfig(int64_t display, int32_t config) { + return mComposerClient->setBootDisplayConfig(display, config); +} + +ScopedAStatus VtsComposerClient::clearBootDisplayConfig(int64_t display) { + return mComposerClient->clearBootDisplayConfig(display); +} + +std::pair VtsComposerClient::getPreferredBootDisplayConfig( + int64_t display) { + int32_t outConfig; + return {mComposerClient->getPreferredBootDisplayConfig(display, &outConfig), outConfig}; +} + +std::pair VtsComposerClient::getDisplayPhysicalOrientation( + int64_t display) { + common::Transform outDisplayOrientation; + return {mComposerClient->getDisplayPhysicalOrientation(display, &outDisplayOrientation), + outDisplayOrientation}; +} + +ScopedAStatus VtsComposerClient::setIdleTimerEnabled(int64_t display, int32_t timeoutMs) { + return mComposerClient->setIdleTimerEnabled(display, timeoutMs); +} + +int32_t VtsComposerClient::getVsyncIdleCount() { + return mComposerCallback->getVsyncIdleCount(); +} + +int64_t VtsComposerClient::getVsyncIdleTime() { + return mComposerCallback->getVsyncIdleTime(); +} + +int64_t VtsComposerClient::getInvalidDisplayId() { + // returns an invalid display id (one that has not been registered to a + // display. Currently assuming that a device will never have close to + // std::numeric_limit::max() displays registered while running tests + int64_t id = std::numeric_limits::max(); + std::vector displays = mComposerCallback->getDisplays(); + while (id > 0) { + if (std::none_of(displays.begin(), displays.end(), + [id](const auto& display) { return id == display; })) { + return id; + } + id--; + } + + // Although 0 could be an invalid display, a return value of 0 + // from getInvalidDisplayId means all other ids are in use, a condition which + // we are assuming a device will never have + EXPECT_NE(0, id); + return id; +} + +std::pair> VtsComposerClient::getDisplays() { + while (true) { + // Sleep for a small period of time to allow all built-in displays + // to post hotplug events + std::this_thread::sleep_for(5ms); + std::vector displays = mComposerCallback->getDisplays(); + if (displays.empty()) { + continue; + } + + std::vector vtsDisplays; + 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 = updateDisplayProperties(&vtsDisplay, config); + if (!status.isOk()) { + ALOGE("Unable to get the displays for test, failed to update the properties " + "for display %" PRId64, + display); + return {std::move(status), vtsDisplays}; + } + } + vtsDisplays.emplace_back(vtsDisplay); + addDisplayToDisplayResources(display, /*isVirtual*/ false); + } + + return {ScopedAStatus::ok(), vtsDisplays}; + } +} + +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); + 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()) { + vtsDisplay->setDimensions(width.second, height.second); + 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() + << ", config: " << configGroup.first.isOk(); + return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_CONFIG); +} + +ScopedAStatus VtsComposerClient::addDisplayToDisplayResources(int64_t display, bool isVirtual) { + if (mDisplayResources.insert({display, DisplayResource(isVirtual)}).second) { + return ScopedAStatus::ok(); + } + + ALOGE("Duplicate display id %" PRId64, display); + return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_DISPLAY); +} + +ScopedAStatus VtsComposerClient::addLayerToDisplayResources(int64_t display, int64_t layer) { + auto resource = mDisplayResources.find(display); + if (resource == mDisplayResources.end()) { + resource = mDisplayResources.insert({display, DisplayResource(false)}).first; + } + + if (!resource->second.layers.insert(layer).second) { + ALOGE("Duplicate layer id %" PRId64, layer); + return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_LAYER); + } + return ScopedAStatus::ok(); +} + +void VtsComposerClient::removeLayerFromDisplayResources(int64_t display, int64_t layer) { + auto resource = mDisplayResources.find(display); + if (resource != mDisplayResources.end()) { + resource->second.layers.erase(layer); + } +} + +bool VtsComposerClient::verifyComposerCallbackParams() { + bool isValid = true; + if (mComposerCallback != nullptr) { + if (mComposerCallback->getInvalidHotplugCount() != 0) { + ALOGE("Invalid hotplug count"); + isValid = false; + } + if (mComposerCallback->getInvalidRefreshCount() != 0) { + ALOGE("Invalid refresh count"); + isValid = false; + } + if (mComposerCallback->getInvalidVsyncCount() != 0) { + ALOGE("Invalid vsync count"); + isValid = false; + } + if (mComposerCallback->getInvalidVsyncPeriodChangeCount() != 0) { + ALOGE("Invalid vsync period change count"); + isValid = false; + } + if (mComposerCallback->getInvalidSeamlessPossibleCount() != 0) { + ALOGE("Invalid seamless possible count"); + isValid = false; + } + } + return isValid; +} + +bool VtsComposerClient::destroyAllLayers() { + for (const auto& it : mDisplayResources) { + const auto& [display, resource] = it; + + for (auto layer : resource.layers) { + const auto status = destroyLayer(display, layer); + if (!status.isOk()) { + ALOGE("Unable to destroy all the layers, failed at layer %" PRId64 " with error %s", + layer, status.getDescription().c_str()); + return false; + } + } + + if (resource.isVirtual) { + const auto status = destroyVirtualDisplay(display); + if (!status.isOk()) { + ALOGE("Unable to destroy the display %" PRId64 " failed with error %s", display, + status.getDescription().c_str()); + return false; + } + } + } + mDisplayResources.clear(); + return true; +} +} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h index f25f36d4a4..ced1020dc7 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h @@ -15,18 +15,11 @@ */ #pragma once -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wconversion" - #include #include #include #include -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic pop // ignored "-Wconversion - namespace aidl::android::hardware::graphics::composer3::vts { class GraphicsComposerCallback : public BnComposerCallback { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h index a3ce795db1..da2e5c140d 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h @@ -20,7 +20,6 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wconversion" -#include #include #include #include @@ -28,8 +27,9 @@ #include #include #include - #include +#include "GraphicsComposerCallback.h" +#include "VtsComposerClient.h" // TODO(b/129481165): remove the #pragma below and fix conversion issues #pragma clang diagnostic pop // ignored "-Wconversion diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h index a776a279c4..4afac681e7 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h @@ -19,7 +19,6 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wconversion" -#include #include #include #include @@ -30,6 +29,7 @@ #include #include #include +#include "ReadbackVts.h" // TODO(b/129481165): remove the #pragma below and fix conversion issues #pragma clang diagnostic pop // ignored "-Wconversion diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h new file mode 100644 index 0000000000..b53edf812a --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h @@ -0,0 +1,240 @@ +/** + * Copyright (c) 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "GraphicsComposerCallback.h" + +using aidl::android::hardware::graphics::common::Dataspace; +using aidl::android::hardware::graphics::common::FRect; +using aidl::android::hardware::graphics::common::PixelFormat; +using aidl::android::hardware::graphics::common::Rect; +using namespace ::ndk; + +namespace aidl::android::hardware::graphics::composer3::vts { + +class VtsDisplay; +/** + * A wrapper to IComposerClient. + * This wrapper manages the IComposerClient instance and manages the resources for + * the tests with respect to the IComposerClient calls. + */ +class VtsComposerClient { + public: + VtsComposerClient(const std::string& name); + + ScopedAStatus createClient(); + + bool tearDown(); + + std::pair createVirtualDisplay(int32_t width, int32_t height, + PixelFormat pixelFormat, + int32_t bufferSlotCount); + + ScopedAStatus destroyVirtualDisplay(int64_t display); + + std::pair createLayer(int64_t display, int32_t bufferSlotCount); + + ScopedAStatus destroyLayer(int64_t display, int64_t layer); + + std::pair getActiveConfig(int64_t display); + + ScopedAStatus setActiveConfig(VtsDisplay* vtsDisplay, int32_t config); + + std::pair getDisplayAttribute(int64_t display, int32_t config, + DisplayAttribute displayAttribute); + + ScopedAStatus setPowerMode(int64_t display, PowerMode powerMode); + + ScopedAStatus setVsync(int64_t display, bool enable); + + void setVsyncAllowed(bool isAllowed); + + std::pair> getDataspaceSaturationMatrix(Dataspace dataspace); + + std::pair> executeCommands( + const std::vector& commands); + + std::optional takeLastVsyncPeriodChangeTimeline(); + + ScopedAStatus setContentType(int64_t display, ContentType contentType); + + std::pair setActiveConfigWithConstraints( + VtsDisplay* vtsDisplay, int32_t config, + const VsyncPeriodChangeConstraints& constraints); + + std::pair> getDisplayCapabilities( + int64_t display); + + ScopedAStatus dumpDebugInfo(); + + std::pair getDisplayIdentificationData(int64_t display); + + std::pair getHdrCapabilities(int64_t display); + + std::pair> getPerFrameMetadataKeys( + int64_t display); + + std::pair getReadbackBufferAttributes(int64_t display); + + ScopedAStatus setReadbackBuffer(int64_t display, const native_handle_t* buffer, + const ScopedFileDescriptor& releaseFence); + + std::pair getReadbackBufferFence(int64_t display); + + std::pair> getColorModes(int64_t display); + + std::pair> getRenderIntents(int64_t display, + ColorMode colorMode); + + ScopedAStatus setColorMode(int64_t display, ColorMode colorMode, RenderIntent renderIntent); + + std::pair + getDisplayedContentSamplingAttributes(int64_t display); + + ScopedAStatus setDisplayedContentSamplingEnabled(int64_t display, bool isEnabled, + FormatColorComponent formatColorComponent, + int64_t maxFrames); + + std::pair getDisplayedContentSample(int64_t display, + int64_t maxFrames, + int64_t timestamp); + + std::pair getDisplayConnectionType(int64_t display); + + std::pair> getDisplayConfigs(int64_t display); + + std::pair getDisplayVsyncPeriod(int64_t display); + + ScopedAStatus setAutoLowLatencyMode(int64_t display, bool isEnabled); + + std::pair> getSupportedContentTypes(int64_t display); + + std::pair getMaxVirtualDisplayCount(); + + std::pair getDisplayName(int64_t display); + + ScopedAStatus setClientTargetSlotCount(int64_t display, int32_t bufferSlotCount); + + std::pair> getCapabilities(); + + ScopedAStatus setBootDisplayConfig(int64_t display, int32_t config); + + ScopedAStatus clearBootDisplayConfig(int64_t display); + + std::pair getPreferredBootDisplayConfig(int64_t display); + + std::pair getDisplayPhysicalOrientation(int64_t display); + + ScopedAStatus setIdleTimerEnabled(int64_t display, int32_t timeoutMs); + + int32_t getVsyncIdleCount(); + + int64_t getVsyncIdleTime(); + + int64_t getInvalidDisplayId(); + + std::pair> getDisplays(); + + private: + ScopedAStatus updateDisplayProperties(VtsDisplay* vtsDisplay, int32_t config); + + ScopedAStatus addDisplayToDisplayResources(int64_t display, bool isVirtual); + + ScopedAStatus addLayerToDisplayResources(int64_t display, int64_t layer); + + void removeLayerFromDisplayResources(int64_t display, int64_t layer); + + bool destroyAllLayers(); + + bool verifyComposerCallbackParams(); + + // Keep track of displays and layers. When a test fails/ends, + // the VtsComposerClient::tearDown should be called from the + // test tearDown to clean up the resources for the test. + struct DisplayResource { + DisplayResource(bool isVirtual_) : isVirtual(isVirtual_) {} + + bool isVirtual; + std::unordered_set layers; + }; + + std::shared_ptr mComposer; + std::shared_ptr mComposerClient; + std::shared_ptr mComposerCallback; + std::unordered_map mDisplayResources; +}; + +class VtsDisplay { + public: + VtsDisplay(int64_t displayId) : mDisplayId(displayId) {} + + int64_t getDisplayId() const { return mDisplayId; } + + FRect getCrop() const { + return {0, 0, static_cast(mDisplayWidth), static_cast(mDisplayHeight)}; + } + + Rect getFrameRect() const { return {0, 0, mDisplayWidth, mDisplayHeight}; } + + void setDimensions(int32_t displayWidth, int32_t displayHeight) { + mDisplayWidth = displayWidth; + mDisplayHeight = displayHeight; + } + + int32_t getDisplayWidth() const { return mDisplayWidth; } + + int32_t getDisplayHeight() const { return mDisplayHeight; } + + struct DisplayConfig { + DisplayConfig(int32_t vsyncPeriod_, int32_t configGroup_) + : vsyncPeriod(vsyncPeriod_), configGroup(configGroup_) {} + int32_t vsyncPeriod; + int32_t configGroup; + }; + + void addDisplayConfig(int32_t config, DisplayConfig displayConfig) { + displayConfigs.insert({config, displayConfig}); + } + + DisplayConfig getDisplayConfig(int32_t config) { return displayConfigs.find(config)->second; } + + private: + int64_t mDisplayId; + int32_t mDisplayWidth; + int32_t mDisplayHeight; + std::unordered_map displayConfigs; +}; +} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file 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 d429b76f63..02405ba70a 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -194,7 +194,7 @@ class ComposerClientWriter { void setLayerZOrder(int64_t display, int64_t layer, uint32_t z) { ZOrder zorder; - zorder.z = z; + zorder.z = static_cast(z); getLayerCommand(display, layer).z.emplace(std::move(zorder)); } @@ -233,9 +233,9 @@ class ComposerClientWriter { std::optional mLayerCommand; std::vector mCommands; - Buffer getBuffer(int slot, const native_handle_t* bufferHandle, int fence) { + Buffer getBuffer(uint32_t slot, const native_handle_t* bufferHandle, int fence) { Buffer bufferCommand; - bufferCommand.slot = slot; + bufferCommand.slot = static_cast(slot); if (bufferHandle) bufferCommand.handle.emplace(::android::dupToAidl(bufferHandle)); if (fence > 0) bufferCommand.fence = ::ndk::ScopedFileDescriptor(fence); return bufferCommand; -- GitLab From 431aad4a6551a213b9dfe898b014f1bb9e215101 Mon Sep 17 00:00:00 2001 From: ramindani Date: Tue, 1 Feb 2022 21:44:29 +0000 Subject: [PATCH 586/825] Use VtsComposerClient in Base test Makes corrections to the code such as checking EXPECT_TRUE, ASSERT_TRUE in certain cases, test name corrections, consolidate layer configurations. See comments in ag/16465080 for change refrences. BUG: 199413815 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I73c4621d8c525fdfbcd301d78a1ad97c142b2864 --- .../VtsHalGraphicsComposer3_TargetTest.cpp | 1828 ++++++++--------- 1 file changed, 814 insertions(+), 1014 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 026a43143a..359282ede9 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1,7 +1,18 @@ -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wconversion" - +/** + * 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. + */ #include #include #include @@ -11,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -22,16 +32,10 @@ #include #include #include -#include #include #include -#include -#include -#include #include "composer-vts/include/GraphicsComposerCallback.h" - -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic pop // ignored "-Wconversion +#include "composer-vts/include/VtsComposerClient.h" #undef LOG_TAG #define LOG_TAG "VtsHalGraphicsComposer3_TargetTest" @@ -44,90 +48,39 @@ using namespace std::chrono_literals; using ::android::GraphicBuffer; using ::android::sp; -class VtsDisplay { - public: - VtsDisplay(int64_t displayId, int32_t displayWidth, int32_t displayHeight) - : mDisplayId(displayId), mDisplayWidth(displayWidth), mDisplayHeight(displayHeight) {} - - int64_t get() const { return mDisplayId; } - - FRect getCrop() const { - return {0, 0, static_cast(mDisplayWidth), static_cast(mDisplayHeight)}; - } - - Rect getFrameRect() const { return {0, 0, mDisplayWidth, mDisplayHeight}; } - - void setDimensions(int32_t displayWidth, int32_t displayHeight) { - mDisplayWidth = displayWidth; - mDisplayHeight = displayHeight; - } - - private: - const int64_t mDisplayId; - int32_t mDisplayWidth; - int32_t mDisplayHeight; -}; - class GraphicsComposerAidlTest : public ::testing::TestWithParam { protected: void SetUp() override { - std::string name = GetParam(); - ndk::SpAIBinder binder(AServiceManager_waitForService(name.c_str())); - ASSERT_NE(binder, nullptr); - ASSERT_NO_FATAL_FAILURE(mComposer = IComposer::fromBinder(binder)); - ASSERT_NE(mComposer, nullptr); - - ndk::ScopedAStatus status; - ASSERT_NO_FATAL_FAILURE(status = mComposer->createClient(&mComposerClient)); - ASSERT_TRUE(status.isOk()); - - mComposerCallback = ::ndk::SharedRefBase::make(); - EXPECT_TRUE(mComposerClient->registerCallback(mComposerCallback).isOk()); + mComposerClient = std::make_unique(GetParam()); + ASSERT_TRUE(mComposerClient->createClient().isOk()); - // assume the first displays are built-in and are never removed - mDisplays = waitForDisplays(); - mPrimaryDisplay = mDisplays[0].get(); - ASSERT_NO_FATAL_FAILURE(mInvalidDisplayId = GetInvalidDisplayId()); - - int32_t activeConfig; - EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &activeConfig).isOk()); - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(mPrimaryDisplay, activeConfig, - DisplayAttribute::WIDTH, &mDisplayWidth) - .isOk()); - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(mPrimaryDisplay, activeConfig, - DisplayAttribute::HEIGHT, &mDisplayHeight) - .isOk()); + const auto& [status, displays] = mComposerClient->getDisplays(); + ASSERT_TRUE(status.isOk()); + mDisplays = displays; // explicitly disable vsync for (const auto& display : mDisplays) { - EXPECT_TRUE(mComposerClient->setVsyncEnabled(display.get(), false).isOk()); + EXPECT_TRUE(mComposerClient->setVsync(display.getDisplayId(), false).isOk()); } - mComposerCallback->setVsyncAllowed(false); + mComposerClient->setVsyncAllowed(false); } void TearDown() override { - destroyAllLayers(); - if (mComposerCallback != nullptr) { - EXPECT_EQ(0, mComposerCallback->getInvalidHotplugCount()); - EXPECT_EQ(0, mComposerCallback->getInvalidRefreshCount()); - EXPECT_EQ(0, mComposerCallback->getInvalidVsyncCount()); - EXPECT_EQ(0, mComposerCallback->getInvalidVsyncPeriodChangeCount()); - EXPECT_EQ(0, mComposerCallback->getInvalidSeamlessPossibleCount()); - } + ASSERT_TRUE(mComposerClient->tearDown()); + mComposerClient.reset(); } - void Test_setContentTypeForDisplay(const int64_t& display, - const std::vector& capabilities, - const ContentType& contentType, const char* contentTypeStr) { - const bool contentTypeSupport = std::find(capabilities.begin(), capabilities.end(), - contentType) != capabilities.end(); + void Test_setContentTypeForDisplay(int64_t display, + const std::vector& supportedContentTypes, + ContentType contentType, const char* contentTypeStr) { + const bool contentTypeSupport = + std::find(supportedContentTypes.begin(), supportedContentTypes.end(), + contentType) != supportedContentTypes.end(); if (!contentTypeSupport) { - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, - mComposerClient->setContentType(display, contentType) - .getServiceSpecificError()); + const auto& status = mComposerClient->setContentType(display, contentType); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); GTEST_SUCCEED() << contentTypeStr << " content type is not supported on display " << std::to_string(display) << ", skipping test"; return; @@ -137,209 +90,79 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { EXPECT_TRUE(mComposerClient->setContentType(display, ContentType::NONE).isOk()); } - void Test_setContentType(const ContentType& contentType, const char* contentTypeStr) { + void Test_setContentType(ContentType contentType, const char* contentTypeStr) { for (const auto& display : mDisplays) { - std::vector supportedContentTypes; - const auto error = mComposerClient->getSupportedContentTypes(display.get(), - &supportedContentTypes); - EXPECT_TRUE(error.isOk()); - - Test_setContentTypeForDisplay(display.get(), supportedContentTypes, contentType, - contentTypeStr); + const auto& [status, supportedContentTypes] = + mComposerClient->getSupportedContentTypes(display.getDisplayId()); + EXPECT_TRUE(status.isOk()); + Test_setContentTypeForDisplay(display.getDisplayId(), supportedContentTypes, + contentType, contentTypeStr); } } - int64_t createLayer(const VtsDisplay& display) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(display.get(), kBufferSlotCount, &layer).isOk()); - - auto resourceIt = mDisplayResources.find(display.get()); - if (resourceIt == mDisplayResources.end()) { - resourceIt = mDisplayResources.insert({display.get(), DisplayResource(false)}).first; - } - - EXPECT_TRUE(resourceIt->second.layers.insert(layer).second) - << "duplicated layer id " << layer; - - return layer; - } - - void destroyAllLayers() { - for (const auto& it : mDisplayResources) { - auto display = it.first; - const DisplayResource& resource = it.second; - - for (auto layer : resource.layers) { - const auto error = mComposerClient->destroyLayer(display, layer); - EXPECT_TRUE(error.isOk()); - } - - if (resource.isVirtual) { - const auto error = mComposerClient->destroyVirtualDisplay(display); - EXPECT_TRUE(error.isOk()); - } - } - mDisplayResources.clear(); - } - - void destroyLayer(const VtsDisplay& display, int64_t layer) { - auto const error = mComposerClient->destroyLayer(display.get(), layer); - ASSERT_TRUE(error.isOk()) << "failed to destroy layer " << layer; - - auto resourceIt = mDisplayResources.find(display.get()); - ASSERT_NE(mDisplayResources.end(), resourceIt); - resourceIt->second.layers.erase(layer); - } - bool hasCapability(Capability capability) { - std::vector capabilities; - EXPECT_TRUE(mComposer->getCapabilities(&capabilities).isOk()); + const auto& [status, capabilities] = mComposerClient->getCapabilities(); + EXPECT_TRUE(status.isOk()); return std::any_of( capabilities.begin(), capabilities.end(), [&](const Capability& activeCapability) { return activeCapability == capability; }); } - // returns an invalid display id (one that has not been registered to a - // display. Currently assuming that a device will never have close to - // std::numeric_limit::max() displays registered while running tests - int64_t GetInvalidDisplayId() { - int64_t id = std::numeric_limits::max(); - while (id > 0) { - if (std::none_of(mDisplays.begin(), mDisplays.end(), - [&](const VtsDisplay& display) { return id == display.get(); })) { - return id; - } - id--; - } - - // Although 0 could be an invalid display, a return value of 0 - // from GetInvalidDisplayId means all other ids are in use, a condition which - // we are assuming a device will never have - EXPECT_NE(0, id); - return id; - } + const VtsDisplay& getPrimaryDisplay() const { return mDisplays[0]; } - std::vector waitForDisplays() { - while (true) { - // Sleep for a small period of time to allow all built-in displays - // to post hotplug events - std::this_thread::sleep_for(5ms); - std::vector displays = mComposerCallback->getDisplays(); - if (displays.empty()) { - continue; - } + int64_t getPrimaryDisplayId() const { return getPrimaryDisplay().getDisplayId(); } - std::vector vtsDisplays; - vtsDisplays.reserve(displays.size()); - for (int64_t display : displays) { - int32_t activeConfig; - EXPECT_TRUE(mComposerClient->getActiveConfig(display, &activeConfig).isOk()); - int32_t displayWidth; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display, activeConfig, - DisplayAttribute::WIDTH, &displayWidth) - .isOk()); - int32_t displayHeight; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display, activeConfig, - DisplayAttribute::HEIGHT, &displayHeight) - .isOk()); - vtsDisplays.emplace_back(VtsDisplay{display, displayWidth, displayHeight}); - } + int64_t getInvalidDisplayId() const { return mComposerClient->getInvalidDisplayId(); } - return vtsDisplays; - } - } - - // returns an invalid config id which is std::numeric_limit::max() - int32_t GetInvalidConfigId() { return IComposerClient::INVALID_CONFIGURATION; } - - ndk::ScopedAStatus setActiveConfigWithConstraints( - VtsDisplay& display, int32_t config, const VsyncPeriodChangeConstraints& constraints, - VsyncPeriodChangeTimeline* timeline) { - auto error = mComposerClient->setActiveConfigWithConstraints(display.get(), config, - constraints, timeline); - if (error.isOk()) { - int32_t displayWidth; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, - DisplayAttribute::WIDTH, &displayWidth) - .isOk()); - int32_t displayHeight; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, - DisplayAttribute::HEIGHT, &displayHeight) - .isOk()); - display.setDimensions(displayWidth, displayHeight); - } - return error; - } + VtsDisplay& getEditablePrimaryDisplay() { return mDisplays[0]; } struct TestParameters { nsecs_t delayForChange; bool refreshMiss; }; - // Keep track of all virtual displays and layers. When a test fails with - // ASSERT_*, the destructor will clean up the resources for the test. - struct DisplayResource { - DisplayResource(bool isVirtual_) : isVirtual(isVirtual_) {} - - bool isVirtual; - std::unordered_set layers; - }; - - std::shared_ptr mComposer; - std::shared_ptr mComposerClient; - int64_t mInvalidDisplayId; - int64_t mPrimaryDisplay; + std::unique_ptr mComposerClient; std::vector mDisplays; - std::shared_ptr mComposerCallback; // use the slot count usually set by SF static constexpr uint32_t kBufferSlotCount = 64; - std::unordered_map mDisplayResources; - int32_t mDisplayWidth; - int32_t mDisplayHeight; }; -TEST_P(GraphicsComposerAidlTest, getDisplayCapabilitiesBadDisplay) { - std::vector capabilities; - const auto error = mComposerClient->getDisplayCapabilities(mInvalidDisplayId, &capabilities); +TEST_P(GraphicsComposerAidlTest, GetDisplayCapabilities_BadDisplay) { + const auto& [status, _] = mComposerClient->getDisplayCapabilities(getInvalidDisplayId()); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, getDisplayCapabilities) { +TEST_P(GraphicsComposerAidlTest, GetDisplayCapabilities) { for (const auto& display : mDisplays) { - std::vector capabilities; + const auto& [status, capabilities] = + mComposerClient->getDisplayCapabilities(display.getDisplayId()); - EXPECT_TRUE(mComposerClient->getDisplayCapabilities(display.get(), &capabilities).isOk()); + EXPECT_TRUE(status.isOk()); } } TEST_P(GraphicsComposerAidlTest, DumpDebugInfo) { - std::string debugInfo; - EXPECT_TRUE(mComposer->dumpDebugInfo(&debugInfo).isOk()); + ASSERT_TRUE(mComposerClient->dumpDebugInfo().isOk()); } TEST_P(GraphicsComposerAidlTest, CreateClientSingleton) { std::shared_ptr composerClient; - const auto error = mComposer->createClient(&composerClient); + const auto& status = mComposerClient->createClient(); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_NO_RESOURCES, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_NO_RESOURCES, status.getServiceSpecificError()); } TEST_P(GraphicsComposerAidlTest, GetDisplayIdentificationData) { - DisplayIdentification displayIdentification0; - - const auto error = - mComposerClient->getDisplayIdentificationData(mPrimaryDisplay, &displayIdentification0); - if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + const auto& [status0, displayIdentification0] = + mComposerClient->getDisplayIdentificationData(getPrimaryDisplayId()); + if (!status0.isOk() && status0.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + GTEST_SUCCEED() << "Display identification data not supported, skipping test"; return; } - ASSERT_TRUE(error.isOk()) << "failed to get display identification data"; + ASSERT_TRUE(status0.isOk()) << "failed to get display identification data"; ASSERT_FALSE(displayIdentification0.data.empty()); constexpr size_t kEdidBlockSize = 128; @@ -355,10 +178,9 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayIdentificationData) { static_cast(0))) << "EDID base block doesn't checksum"; - DisplayIdentification displayIdentification1; - ASSERT_TRUE( - mComposerClient->getDisplayIdentificationData(mPrimaryDisplay, &displayIdentification1) - .isOk()); + const auto& [status1, displayIdentification1] = + mComposerClient->getDisplayIdentificationData(getPrimaryDisplayId()); + ASSERT_TRUE(status1.isOk()); ASSERT_EQ(displayIdentification0.port, displayIdentification1.port) << "ports are not stable"; ASSERT_TRUE(displayIdentification0.data.size() == displayIdentification1.data.size() && @@ -368,42 +190,42 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayIdentificationData) { } TEST_P(GraphicsComposerAidlTest, GetHdrCapabilities) { - HdrCapabilities hdrCapabilities; - const auto error = mComposerClient->getHdrCapabilities(mPrimaryDisplay, &hdrCapabilities); + const auto& [status, hdrCapabilities] = + mComposerClient->getHdrCapabilities(getPrimaryDisplayId()); - ASSERT_TRUE(error.isOk()); - ASSERT_TRUE(hdrCapabilities.maxLuminance >= hdrCapabilities.minLuminance); + ASSERT_TRUE(status.isOk()); + EXPECT_TRUE(hdrCapabilities.maxLuminance >= hdrCapabilities.minLuminance); } TEST_P(GraphicsComposerAidlTest, GetPerFrameMetadataKeys) { - std::vector keys; - const auto error = mComposerClient->getPerFrameMetadataKeys(mPrimaryDisplay, &keys); - - if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + const auto& [status, keys] = mComposerClient->getPerFrameMetadataKeys(getPrimaryDisplayId()); + if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { GTEST_SUCCEED() << "getPerFrameMetadataKeys is not supported"; return; } - EXPECT_TRUE(error.isOk()); - ASSERT_TRUE(keys.size() >= 0); + + ASSERT_TRUE(status.isOk()); + EXPECT_TRUE(keys.size() >= 0); } TEST_P(GraphicsComposerAidlTest, GetReadbackBufferAttributes) { - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - - if (error.isOk()) { - EXPECT_EQ(EX_NONE, error.getServiceSpecificError()); + const auto& [status, _] = mComposerClient->getReadbackBufferAttributes(getPrimaryDisplayId()); + if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + GTEST_SUCCEED() << "getReadbackBufferAttributes is not supported"; + return; } + + ASSERT_TRUE(status.isOk()); } TEST_P(GraphicsComposerAidlTest, GetRenderIntents) { - std::vector modes; - EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &modes).isOk()); - for (auto mode : modes) { - std::vector intents; - EXPECT_TRUE(mComposerClient->getRenderIntents(mPrimaryDisplay, mode, &intents).isOk()); + const auto& [status, modes] = mComposerClient->getColorModes(getPrimaryDisplayId()); + EXPECT_TRUE(status.isOk()); + for (auto mode : modes) { + const auto& [intentStatus, intents] = + mComposerClient->getRenderIntents(getPrimaryDisplayId(), mode); + EXPECT_TRUE(intentStatus.isOk()); bool isHdr; switch (mode) { case ColorMode::BT2100_PQ: @@ -417,158 +239,157 @@ TEST_P(GraphicsComposerAidlTest, GetRenderIntents) { RenderIntent requiredIntent = isHdr ? RenderIntent::TONE_MAP_COLORIMETRIC : RenderIntent::COLORIMETRIC; - auto iter = std::find(intents.cbegin(), intents.cend(), requiredIntent); + const auto iter = std::find(intents.cbegin(), intents.cend(), requiredIntent); EXPECT_NE(intents.cend(), iter); } } -TEST_P(GraphicsComposerAidlTest, GetRenderIntentsBadDisplay) { - std::vector modes; - EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &modes).isOk()); +TEST_P(GraphicsComposerAidlTest, GetRenderIntents_BadDisplay) { + const auto& [status, modes] = mComposerClient->getColorModes(getPrimaryDisplayId()); + ASSERT_TRUE(status.isOk()); + for (auto mode : modes) { - std::vector renderIntents; - const auto error = - mComposerClient->getRenderIntents(mInvalidDisplayId, mode, &renderIntents); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + const auto& [intentStatus, _] = + mComposerClient->getRenderIntents(getInvalidDisplayId(), mode); + + EXPECT_FALSE(intentStatus.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, intentStatus.getServiceSpecificError()); } } -TEST_P(GraphicsComposerAidlTest, GetRenderIntentsBadParameter) { - std::vector renderIntents; - const auto error = mComposerClient->getRenderIntents( - mPrimaryDisplay, static_cast(-1), &renderIntents); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError()); +TEST_P(GraphicsComposerAidlTest, GetRenderIntents_BadParameter) { + const auto& [status, _] = + mComposerClient->getRenderIntents(getPrimaryDisplayId(), static_cast(-1)); + + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); } TEST_P(GraphicsComposerAidlTest, GetColorModes) { - std::vector colorModes; - EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &colorModes).isOk()); + const auto& [status, colorModes] = mComposerClient->getColorModes(getPrimaryDisplayId()); + ASSERT_TRUE(status.isOk()); - auto native = std::find(colorModes.cbegin(), colorModes.cend(), ColorMode::NATIVE); - ASSERT_NE(colorModes.cend(), native); + const auto native = std::find(colorModes.cbegin(), colorModes.cend(), ColorMode::NATIVE); + EXPECT_NE(colorModes.cend(), native); } -TEST_P(GraphicsComposerAidlTest, GetColorModeBadDisplay) { - std::vector colorModes; - const auto error = mComposerClient->getColorModes(mInvalidDisplayId, &colorModes); +TEST_P(GraphicsComposerAidlTest, GetColorMode_BadDisplay) { + const auto& [status, _] = mComposerClient->getColorModes(getInvalidDisplayId()); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } TEST_P(GraphicsComposerAidlTest, SetColorMode) { - std::vector colorModes; - EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &colorModes).isOk()); + const auto& [status, colorModes] = mComposerClient->getColorModes(getPrimaryDisplayId()); + EXPECT_TRUE(status.isOk()); + for (auto mode : colorModes) { - std::vector intents; - EXPECT_TRUE(mComposerClient->getRenderIntents(mPrimaryDisplay, mode, &intents).isOk()) - << "failed to get render intents"; + const auto& [intentStatus, intents] = + mComposerClient->getRenderIntents(getPrimaryDisplayId(), mode); + EXPECT_TRUE(intentStatus.isOk()) << "failed to get render intents"; + for (auto intent : intents) { - const auto error = mComposerClient->setColorMode(mPrimaryDisplay, mode, intent); - EXPECT_TRUE(error.isOk() || - IComposerClient::EX_UNSUPPORTED == error.getServiceSpecificError()) + const auto modeStatus = + mComposerClient->setColorMode(getPrimaryDisplayId(), mode, intent); + EXPECT_TRUE(modeStatus.isOk() || + IComposerClient::EX_UNSUPPORTED == modeStatus.getServiceSpecificError()) << "failed to set color mode"; } } - const auto error = mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE, - RenderIntent::COLORIMETRIC); - EXPECT_TRUE(error.isOk() || IComposerClient::EX_UNSUPPORTED == error.getServiceSpecificError()) + const auto modeStatus = mComposerClient->setColorMode(getPrimaryDisplayId(), ColorMode::NATIVE, + RenderIntent::COLORIMETRIC); + EXPECT_TRUE(modeStatus.isOk() || + IComposerClient::EX_UNSUPPORTED == modeStatus.getServiceSpecificError()) << "failed to set color mode"; } -TEST_P(GraphicsComposerAidlTest, SetColorModeBadDisplay) { - std::vector colorModes; - EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &colorModes).isOk()); +TEST_P(GraphicsComposerAidlTest, SetColorMode_BadDisplay) { + const auto& [status, colorModes] = mComposerClient->getColorModes(getPrimaryDisplayId()); + ASSERT_TRUE(status.isOk()); + for (auto mode : colorModes) { - std::vector intents; - EXPECT_TRUE(mComposerClient->getRenderIntents(mPrimaryDisplay, mode, &intents).isOk()) - << "failed to get render intents"; + const auto& [intentStatus, intents] = + mComposerClient->getRenderIntents(getPrimaryDisplayId(), mode); + ASSERT_TRUE(intentStatus.isOk()) << "failed to get render intents"; + for (auto intent : intents) { - auto const error = mComposerClient->setColorMode(mInvalidDisplayId, mode, intent); + auto const modeStatus = + mComposerClient->setColorMode(getInvalidDisplayId(), mode, intent); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(modeStatus.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, modeStatus.getServiceSpecificError()); } } } -TEST_P(GraphicsComposerAidlTest, SetColorModeBadParameter) { - const auto colorModeError = mComposerClient->setColorMode( - mPrimaryDisplay, static_cast(-1), RenderIntent::COLORIMETRIC); +TEST_P(GraphicsComposerAidlTest, SetColorMode_BadParameter) { + auto status = mComposerClient->setColorMode(getPrimaryDisplayId(), static_cast(-1), + RenderIntent::COLORIMETRIC); - EXPECT_FALSE(colorModeError.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, colorModeError.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); - const auto renderIntentError = mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE, - static_cast(-1)); + status = mComposerClient->setColorMode(getPrimaryDisplayId(), ColorMode::NATIVE, + static_cast(-1)); - EXPECT_FALSE(renderIntentError.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, renderIntentError.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); } TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSamplingAttributes) { - int constexpr invalid = -1; + int constexpr kInvalid = -1; + const auto& [status, format] = + mComposerClient->getDisplayedContentSamplingAttributes(getPrimaryDisplayId()); - DisplayContentSamplingAttributes format; - auto error = mComposerClient->getDisplayedContentSamplingAttributes(mPrimaryDisplay, &format); - - if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { SUCCEED() << "Device does not support optional extension. Test skipped"; return; } - EXPECT_TRUE(error.isOk()); - EXPECT_NE(format.format, static_cast(invalid)); - EXPECT_NE(format.dataspace, static_cast(invalid)); - EXPECT_NE(format.componentMask, static_cast(invalid)); + ASSERT_TRUE(status.isOk()); + EXPECT_NE(kInvalid, static_cast(format.format)); + EXPECT_NE(kInvalid, static_cast(format.dataspace)); + EXPECT_NE(kInvalid, static_cast(format.componentMask)); }; TEST_P(GraphicsComposerAidlTest, SetDisplayedContentSamplingEnabled) { - auto const maxFrames = 10; + int constexpr kMaxFrames = 10; FormatColorComponent enableAllComponents = FormatColorComponent::FORMAT_COMPONENT_0; - auto error = mComposerClient->setDisplayedContentSamplingEnabled( - mPrimaryDisplay, true, enableAllComponents, maxFrames); - if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + auto status = mComposerClient->setDisplayedContentSamplingEnabled( + getPrimaryDisplayId(), /*isEnabled*/ true, enableAllComponents, kMaxFrames); + if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { SUCCEED() << "Device does not support optional extension. Test skipped"; return; } - EXPECT_TRUE(error.isOk()); + EXPECT_TRUE(status.isOk()); - error = mComposerClient->setDisplayedContentSamplingEnabled(mPrimaryDisplay, false, - enableAllComponents, maxFrames); - EXPECT_TRUE(error.isOk()); + status = mComposerClient->setDisplayedContentSamplingEnabled( + getPrimaryDisplayId(), /*isEnabled*/ false, enableAllComponents, kMaxFrames); + EXPECT_TRUE(status.isOk()); } TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSample) { - DisplayContentSamplingAttributes displayContentSamplingAttributes; - int constexpr invalid = -1; - displayContentSamplingAttributes.format = static_cast(invalid); - displayContentSamplingAttributes.dataspace = static_cast(invalid); - displayContentSamplingAttributes.componentMask = static_cast(invalid); - auto error = mComposerClient->getDisplayedContentSamplingAttributes( - mPrimaryDisplay, &displayContentSamplingAttributes); - if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + const auto& [status, displayContentSamplingAttributes] = + mComposerClient->getDisplayedContentSamplingAttributes(getPrimaryDisplayId()); + if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { SUCCEED() << "Sampling attributes aren't supported on this device, test skipped"; return; } - int64_t maxFrames = 10; - int64_t timestamp = 0; - int64_t frameCount = 0; - DisplayContentSample displayContentSample; - error = mComposerClient->getDisplayedContentSample(mPrimaryDisplay, maxFrames, timestamp, - &displayContentSample); - if (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + int64_t constexpr kMaxFrames = 10; + int64_t constexpr kTimestamp = 0; + const auto& [sampleStatus, displayContentSample] = mComposerClient->getDisplayedContentSample( + getPrimaryDisplayId(), kMaxFrames, kTimestamp); + if (!sampleStatus.isOk() && + sampleStatus.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { SUCCEED() << "Device does not support optional extension. Test skipped"; return; } - EXPECT_TRUE(error.isOk()); - EXPECT_LE(frameCount, maxFrames); - std::vector> histogram = { + EXPECT_TRUE(sampleStatus.isOk()); + const std::vector> histogram = { displayContentSample.sampleComponent0, displayContentSample.sampleComponent1, displayContentSample.sampleComponent2, displayContentSample.sampleComponent3}; @@ -579,18 +400,24 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSample) { } } -TEST_P(GraphicsComposerAidlTest, getDisplayConnectionType) { - DisplayConnectionType type; - EXPECT_FALSE(mComposerClient->getDisplayConnectionType(mInvalidDisplayId, &type).isOk()); +TEST_P(GraphicsComposerAidlTest, GetDisplayConnectionType) { + const auto& [status, type] = mComposerClient->getDisplayConnectionType(getInvalidDisplayId()); + + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + for (const auto& display : mDisplays) { - EXPECT_TRUE(mComposerClient->getDisplayConnectionType(display.get(), &type).isOk()); + const auto& [connectionTypeStatus, _] = + mComposerClient->getDisplayConnectionType(display.getDisplayId()); + EXPECT_TRUE(connectionTypeStatus.isOk()); } } -TEST_P(GraphicsComposerAidlTest, getDisplayAttribute) { +TEST_P(GraphicsComposerAidlTest, GetDisplayAttribute) { for (const auto& display : mDisplays) { - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk()); + const auto& [status, configs] = mComposerClient->getDisplayConfigs(display.getDisplayId()); + EXPECT_TRUE(status.isOk()); + for (const auto& config : configs) { const std::array requiredAttributes = {{ DisplayAttribute::WIDTH, @@ -598,11 +425,10 @@ TEST_P(GraphicsComposerAidlTest, getDisplayAttribute) { DisplayAttribute::VSYNC_PERIOD, DisplayAttribute::CONFIG_GROUP, }}; - int32_t value; for (const auto& attribute : requiredAttributes) { - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, attribute, &value) - .isOk()); + const auto& [attribStatus, value] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), config, attribute); + EXPECT_TRUE(attribStatus.isOk()); EXPECT_NE(-1, value); } @@ -611,22 +437,19 @@ TEST_P(GraphicsComposerAidlTest, getDisplayAttribute) { DisplayAttribute::DPI_Y, }}; for (const auto& attribute : optionalAttributes) { - const auto error = mComposerClient->getDisplayAttribute(display.get(), config, - attribute, &value); - if (error.isOk()) { - EXPECT_EQ(EX_NONE, error.getServiceSpecificError()); - } else { - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); - } + const auto& [attribStatus, value] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), config, attribute); + EXPECT_TRUE(attribStatus.isOk() || IComposerClient::EX_UNSUPPORTED == + attribStatus.getServiceSpecificError()); } } } } -TEST_P(GraphicsComposerAidlTest, checkConfigsAreValid) { +TEST_P(GraphicsComposerAidlTest, CheckConfigsAreValid) { for (const auto& display : mDisplays) { - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk()); + const auto& [status, configs] = mComposerClient->getDisplayConfigs(display.getDisplayId()); + EXPECT_TRUE(status.isOk()); EXPECT_FALSE(std::any_of(configs.begin(), configs.end(), [](auto config) { return config == IComposerClient::INVALID_CONFIGURATION; @@ -634,7 +457,7 @@ TEST_P(GraphicsComposerAidlTest, checkConfigsAreValid) { } } -TEST_P(GraphicsComposerAidlTest, getDisplayAttributeConfigsInAGroupDifferOnlyByVsyncPeriod) { +TEST_P(GraphicsComposerAidlTest, GetDisplayAttributeConfigsInAGroupDifferOnlyByVsyncPeriod) { struct Resolution { int32_t width; int32_t height; @@ -643,40 +466,31 @@ TEST_P(GraphicsComposerAidlTest, getDisplayAttributeConfigsInAGroupDifferOnlyByV int32_t x; int32_t y; }; - for (const auto& display : mDisplays) { - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk()); + for (VtsDisplay display : mDisplays) { + const auto& [status, configs] = mComposerClient->getDisplayConfigs(display.getDisplayId()); + EXPECT_TRUE(status.isOk()); std::unordered_map configGroupToResolutionMap; std::unordered_map configGroupToDpiMap; for (const auto& config : configs) { - int32_t configGroup = -1; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, - DisplayAttribute::CONFIG_GROUP, &configGroup) - .isOk()); - int32_t width = -1; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, - DisplayAttribute::WIDTH, &width) - .isOk()); - int32_t height = -1; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, - DisplayAttribute::HEIGHT, &height) - .isOk()); + const auto displayConfigGroup = display.getDisplayConfig(config); + + int32_t configGroup = displayConfigGroup.configGroup; + int32_t width = display.getDisplayWidth(); + int32_t height = display.getDisplayHeight(); + if (configGroupToResolutionMap.find(configGroup) == configGroupToResolutionMap.end()) { configGroupToResolutionMap[configGroup] = {width, height}; } EXPECT_EQ(configGroupToResolutionMap[configGroup].width, width); EXPECT_EQ(configGroupToResolutionMap[configGroup].height, height); - int32_t dpiX = -1; - mComposerClient->getDisplayAttribute(display.get(), config, DisplayAttribute::DPI_X, - &dpiX); + const auto& [dpiXStatus, dpiX] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), config, DisplayAttribute::DPI_X); + EXPECT_TRUE(dpiXStatus.isOk()); - int32_t dpiY = -1; - mComposerClient->getDisplayAttribute(display.get(), config, DisplayAttribute::DPI_Y, - &dpiY); + const auto& [dpiYStatus, dpiY] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), config, DisplayAttribute::DPI_Y); + EXPECT_TRUE(dpiYStatus.isOk()); if (dpiX == -1 && dpiY == -1) { continue; } @@ -690,293 +504,287 @@ TEST_P(GraphicsComposerAidlTest, getDisplayAttributeConfigsInAGroupDifferOnlyByV } } -TEST_P(GraphicsComposerAidlTest, getDisplayVsyncPeriod_BadDisplay) { - int32_t vsyncPeriodNanos; - const auto error = mComposerClient->getDisplayVsyncPeriod(mInvalidDisplayId, &vsyncPeriodNanos); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +TEST_P(GraphicsComposerAidlTest, GetDisplayVsyncPeriod_BadDisplay) { + const auto& [status, vsyncPeriodNanos] = + mComposerClient->getDisplayVsyncPeriod(getInvalidDisplayId()); + + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, setActiveConfigWithConstraints_BadDisplay) { - VsyncPeriodChangeTimeline timeline; +TEST_P(GraphicsComposerAidlTest, SetActiveConfigWithConstraints_BadDisplay) { VsyncPeriodChangeConstraints constraints; - constraints.seamlessRequired = false; constraints.desiredTimeNanos = systemTime(); - int32_t config = 0; - auto const error = mComposerClient->setActiveConfigWithConstraints(mInvalidDisplayId, config, - constraints, &timeline); + auto invalidDisplay = VtsDisplay(getInvalidDisplayId()); + + const auto& [status, timeline] = mComposerClient->setActiveConfigWithConstraints( + &invalidDisplay, /*config*/ 0, constraints); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, setActiveConfigWithConstraints_BadConfig) { - VsyncPeriodChangeTimeline timeline; +TEST_P(GraphicsComposerAidlTest, SetActiveConfigWithConstraints_BadConfig) { VsyncPeriodChangeConstraints constraints; - constraints.seamlessRequired = false; constraints.desiredTimeNanos = systemTime(); for (VtsDisplay& display : mDisplays) { - int32_t invalidConfigId = GetInvalidConfigId(); - const auto error = - setActiveConfigWithConstraints(display, invalidConfigId, constraints, &timeline); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_CONFIG, error.getServiceSpecificError()); + int32_t constexpr kInvalidConfigId = IComposerClient::INVALID_CONFIGURATION; + const auto& [status, _] = mComposerClient->setActiveConfigWithConstraints( + &display, kInvalidConfigId, constraints); + + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_CONFIG, status.getServiceSpecificError()); } } -TEST_P(GraphicsComposerAidlTest, setBootDisplayConfig_BadDisplay) { - int32_t config = 0; - auto const error = mComposerClient->setBootDisplayConfig(mInvalidDisplayId, config); +TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadDisplay) { + const auto& status = mComposerClient->setBootDisplayConfig(getInvalidDisplayId(), /*config*/ 0); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, setBootDisplayConfig_BadConfig) { +TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadConfig) { for (VtsDisplay& display : mDisplays) { - int32_t invalidConfigId = GetInvalidConfigId(); - const auto error = mComposerClient->setBootDisplayConfig(display.get(), invalidConfigId); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_CONFIG, error.getServiceSpecificError()); + int32_t constexpr kInvalidConfigId = IComposerClient::INVALID_CONFIGURATION; + const auto& status = + mComposerClient->setBootDisplayConfig(display.getDisplayId(), kInvalidConfigId); + + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_CONFIG, status.getServiceSpecificError()); } } -TEST_P(GraphicsComposerAidlTest, setBootDisplayConfig) { - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); - for (auto config : configs) { - EXPECT_TRUE(mComposerClient->setBootDisplayConfig(mPrimaryDisplay, config).isOk()); +TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig) { + const auto& [status, configs] = mComposerClient->getDisplayConfigs(getPrimaryDisplayId()); + EXPECT_TRUE(status.isOk()); + for (const auto& config : configs) { + EXPECT_TRUE(mComposerClient->setBootDisplayConfig(getPrimaryDisplayId(), config).isOk()); } } -TEST_P(GraphicsComposerAidlTest, clearBootDisplayConfig_BadDisplay) { - auto const error = mComposerClient->clearBootDisplayConfig(mInvalidDisplayId); +TEST_P(GraphicsComposerAidlTest, ClearBootDisplayConfig_BadDisplay) { + const auto& status = mComposerClient->clearBootDisplayConfig(getInvalidDisplayId()); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, clearBootDisplayConfig) { - EXPECT_TRUE(mComposerClient->clearBootDisplayConfig(mPrimaryDisplay).isOk()); +TEST_P(GraphicsComposerAidlTest, ClearBootDisplayConfig) { + EXPECT_TRUE(mComposerClient->clearBootDisplayConfig(getPrimaryDisplayId()).isOk()); } -TEST_P(GraphicsComposerAidlTest, getPreferredBootDisplayConfig_BadDisplay) { - int32_t config; - auto const error = mComposerClient->getPreferredBootDisplayConfig(mInvalidDisplayId, &config); +TEST_P(GraphicsComposerAidlTest, GetPreferredBootDisplayConfig_BadDisplay) { + const auto& [status, _] = mComposerClient->getPreferredBootDisplayConfig(getInvalidDisplayId()); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, getPreferredBootDisplayConfig) { - int32_t preferredDisplayConfig = 0; - auto const error = mComposerClient->getPreferredBootDisplayConfig(mPrimaryDisplay, - &preferredDisplayConfig); - EXPECT_TRUE(error.isOk()); +TEST_P(GraphicsComposerAidlTest, GetPreferredBootDisplayConfig) { + const auto& [status, preferredDisplayConfig] = + mComposerClient->getPreferredBootDisplayConfig(getPrimaryDisplayId()); + EXPECT_TRUE(status.isOk()); + + const auto& [configStatus, configs] = mComposerClient->getDisplayConfigs(getPrimaryDisplayId()); - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); + EXPECT_TRUE(configStatus.isOk()); EXPECT_NE(configs.end(), std::find(configs.begin(), configs.end(), preferredDisplayConfig)); } -TEST_P(GraphicsComposerAidlTest, setAutoLowLatencyModeBadDisplay) { - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, - mComposerClient->setAutoLowLatencyMode(mInvalidDisplayId, true) - .getServiceSpecificError()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, - mComposerClient->setAutoLowLatencyMode(mInvalidDisplayId, false) - .getServiceSpecificError()); +TEST_P(GraphicsComposerAidlTest, SetAutoLowLatencyMode_BadDisplay) { + auto status = mComposerClient->setAutoLowLatencyMode(getInvalidDisplayId(), /*isEnabled*/ true); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + + status = mComposerClient->setAutoLowLatencyMode(getInvalidDisplayId(), /*isEnabled*/ false); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, setAutoLowLatencyMode) { +TEST_P(GraphicsComposerAidlTest, SetAutoLowLatencyMode) { for (const auto& display : mDisplays) { - std::vector capabilities; - const auto error = mComposerClient->getDisplayCapabilities(display.get(), &capabilities); - EXPECT_TRUE(error.isOk()); + const auto& [status, capabilities] = + mComposerClient->getDisplayCapabilities(display.getDisplayId()); + ASSERT_TRUE(status.isOk()); const bool allmSupport = std::find(capabilities.begin(), capabilities.end(), DisplayCapability::AUTO_LOW_LATENCY_MODE) != capabilities.end(); if (!allmSupport) { - const auto errorIsOn = mComposerClient->setAutoLowLatencyMode(display.get(), true); - EXPECT_FALSE(errorIsOn.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, errorIsOn.getServiceSpecificError()); - const auto errorIsOff = mComposerClient->setAutoLowLatencyMode(display.get(), false); - EXPECT_FALSE(errorIsOff.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, errorIsOff.getServiceSpecificError()); + const auto& statusIsOn = mComposerClient->setAutoLowLatencyMode(display.getDisplayId(), + /*isEnabled*/ true); + EXPECT_FALSE(statusIsOn.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, statusIsOn.getServiceSpecificError()); + const auto& statusIsOff = mComposerClient->setAutoLowLatencyMode(display.getDisplayId(), + /*isEnabled*/ false); + EXPECT_FALSE(statusIsOff.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, statusIsOff.getServiceSpecificError()); GTEST_SUCCEED() << "Auto Low Latency Mode is not supported on display " - << std::to_string(display.get()) << ", skipping test"; + << std::to_string(display.getDisplayId()) << ", skipping test"; return; } - EXPECT_TRUE(mComposerClient->setAutoLowLatencyMode(display.get(), true).isOk()); - EXPECT_TRUE(mComposerClient->setAutoLowLatencyMode(display.get(), false).isOk()); + EXPECT_TRUE(mComposerClient->setAutoLowLatencyMode(display.getDisplayId(), true).isOk()); + EXPECT_TRUE(mComposerClient->setAutoLowLatencyMode(display.getDisplayId(), false).isOk()); } } -TEST_P(GraphicsComposerAidlTest, getSupportedContentTypesBadDisplay) { - std::vector supportedContentTypes; - const auto error = - mComposerClient->getSupportedContentTypes(mInvalidDisplayId, &supportedContentTypes); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); +TEST_P(GraphicsComposerAidlTest, GetSupportedContentTypes_BadDisplay) { + const auto& [status, _] = mComposerClient->getSupportedContentTypes(getInvalidDisplayId()); + + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, getSupportedContentTypes) { - std::vector supportedContentTypes; +TEST_P(GraphicsComposerAidlTest, GetSupportedContentTypes) { for (const auto& display : mDisplays) { - supportedContentTypes.clear(); - const auto error = - mComposerClient->getSupportedContentTypes(display.get(), &supportedContentTypes); - - ASSERT_TRUE(error.isOk()); + const auto& [status, supportedContentTypes] = + mComposerClient->getSupportedContentTypes(display.getDisplayId()); + ASSERT_TRUE(status.isOk()); const bool noneSupported = std::find(supportedContentTypes.begin(), supportedContentTypes.end(), ContentType::NONE) != supportedContentTypes.end(); + EXPECT_FALSE(noneSupported); } } -TEST_P(GraphicsComposerAidlTest, setContentTypeNoneAlwaysAccepted) { +TEST_P(GraphicsComposerAidlTest, SetContentTypeNoneAlwaysAccepted) { for (const auto& display : mDisplays) { - const auto error = mComposerClient->setContentType(display.get(), ContentType::NONE); - EXPECT_TRUE(error.isOk()); + EXPECT_TRUE( + mComposerClient->setContentType(display.getDisplayId(), ContentType::NONE).isOk()); } } -TEST_P(GraphicsComposerAidlTest, setContentTypeBadDisplay) { +TEST_P(GraphicsComposerAidlTest, SetContentType_BadDisplay) { constexpr ContentType types[] = {ContentType::NONE, ContentType::GRAPHICS, ContentType::PHOTO, ContentType::CINEMA, ContentType::GAME}; for (const auto& type : types) { - auto const error = mComposerClient->setContentType(mInvalidDisplayId, type); + const auto& status = mComposerClient->setContentType(getInvalidDisplayId(), type); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } } -TEST_P(GraphicsComposerAidlTest, setGraphicsContentType) { +TEST_P(GraphicsComposerAidlTest, SetGraphicsContentType) { Test_setContentType(ContentType::GRAPHICS, "GRAPHICS"); } -TEST_P(GraphicsComposerAidlTest, setPhotoContentType) { +TEST_P(GraphicsComposerAidlTest, SetPhotoContentType) { Test_setContentType(ContentType::PHOTO, "PHOTO"); } -TEST_P(GraphicsComposerAidlTest, setCinemaContentType) { +TEST_P(GraphicsComposerAidlTest, SetCinemaContentType) { Test_setContentType(ContentType::CINEMA, "CINEMA"); } -TEST_P(GraphicsComposerAidlTest, setGameContentType) { +TEST_P(GraphicsComposerAidlTest, SetGameContentType) { Test_setContentType(ContentType::GAME, "GAME"); } TEST_P(GraphicsComposerAidlTest, CreateVirtualDisplay) { - int32_t maxVirtualDisplayCount; - EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&maxVirtualDisplayCount).isOk()); + const auto& [status, maxVirtualDisplayCount] = mComposerClient->getMaxVirtualDisplayCount(); + EXPECT_TRUE(status.isOk()); + if (maxVirtualDisplayCount == 0) { GTEST_SUCCEED() << "no virtual display support"; return; } - VirtualDisplay virtualDisplay; - - EXPECT_TRUE(mComposerClient - ->createVirtualDisplay(64, 64, common::PixelFormat::IMPLEMENTATION_DEFINED, - kBufferSlotCount, &virtualDisplay) - .isOk()); - - ASSERT_TRUE(mDisplayResources.insert({virtualDisplay.display, DisplayResource(true)}).second) - << "duplicated virtual display id " << virtualDisplay.display; + const auto& [virtualDisplayStatus, virtualDisplay] = mComposerClient->createVirtualDisplay( + /*width*/ 64, /*height*/ 64, common::PixelFormat::IMPLEMENTATION_DEFINED, + kBufferSlotCount); + ASSERT_TRUE(virtualDisplayStatus.isOk()); EXPECT_TRUE(mComposerClient->destroyVirtualDisplay(virtualDisplay.display).isOk()); } -TEST_P(GraphicsComposerAidlTest, DestroyVirtualDisplayBadDisplay) { - int32_t maxDisplayCount = 0; - EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&maxDisplayCount).isOk()); +TEST_P(GraphicsComposerAidlTest, DestroyVirtualDisplay_BadDisplay) { + const auto& [status, maxDisplayCount] = mComposerClient->getMaxVirtualDisplayCount(); + EXPECT_TRUE(status.isOk()); + if (maxDisplayCount == 0) { GTEST_SUCCEED() << "no virtual display support"; return; } - const auto error = mComposerClient->destroyVirtualDisplay(mInvalidDisplayId); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + const auto& destroyStatus = mComposerClient->destroyVirtualDisplay(getInvalidDisplayId()); + + EXPECT_FALSE(destroyStatus.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, destroyStatus.getServiceSpecificError()); } TEST_P(GraphicsComposerAidlTest, CreateLayer) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); + const auto& [status, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); - EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk()); + EXPECT_TRUE(status.isOk()); + EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk()); } -TEST_P(GraphicsComposerAidlTest, CreateLayerBadDisplay) { - int64_t layer; - const auto error = mComposerClient->createLayer(mInvalidDisplayId, kBufferSlotCount, &layer); +TEST_P(GraphicsComposerAidlTest, CreateLayer_BadDisplay) { + const auto& [status, _] = mComposerClient->createLayer(getInvalidDisplayId(), kBufferSlotCount); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, DestroyLayerBadDisplay) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlTest, DestroyLayer_BadDisplay) { + const auto& [status, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(status.isOk()); - const auto error = mComposerClient->destroyLayer(mInvalidDisplayId, layer); + const auto& destroyStatus = mComposerClient->destroyLayer(getInvalidDisplayId(), layer); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); - EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk()); + EXPECT_FALSE(destroyStatus.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, destroyStatus.getServiceSpecificError()); + ASSERT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk()); } -TEST_P(GraphicsComposerAidlTest, DestroyLayerBadLayerError) { +TEST_P(GraphicsComposerAidlTest, DestroyLayer_BadLayerError) { // We haven't created any layers yet, so any id should be invalid - const auto error = mComposerClient->destroyLayer(mPrimaryDisplay, 1); + const auto& status = mComposerClient->destroyLayer(getPrimaryDisplayId(), /*layer*/ 1); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_LAYER, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_LAYER, status.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, GetActiveConfigBadDisplay) { - int32_t config; - const auto error = mComposerClient->getActiveConfig(mInvalidDisplayId, &config); +TEST_P(GraphicsComposerAidlTest, GetActiveConfig_BadDisplay) { + const auto& [status, _] = mComposerClient->getActiveConfig(getInvalidDisplayId()); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } TEST_P(GraphicsComposerAidlTest, GetDisplayConfig) { - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); + const auto& [status, _] = mComposerClient->getDisplayConfigs(getPrimaryDisplayId()); + EXPECT_TRUE(status.isOk()); } -TEST_P(GraphicsComposerAidlTest, GetDisplayConfigBadDisplay) { - std::vector configs; - const auto error = mComposerClient->getDisplayConfigs(mInvalidDisplayId, &configs); +TEST_P(GraphicsComposerAidlTest, GetDisplayConfig_BadDisplay) { + const auto& [status, _] = mComposerClient->getDisplayConfigs(getInvalidDisplayId()); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } TEST_P(GraphicsComposerAidlTest, GetDisplayName) { - std::string displayName; - EXPECT_TRUE(mComposerClient->getDisplayName(mPrimaryDisplay, &displayName).isOk()); + const auto& [status, _] = mComposerClient->getDisplayName(getPrimaryDisplayId()); + EXPECT_TRUE(status.isOk()); } -TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientationBadDisplay) { - Transform displayOrientation; - const auto error = - mComposerClient->getDisplayPhysicalOrientation(mInvalidDisplayId, &displayOrientation); +TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientation_BadDisplay) { + const auto& [status, _] = mComposerClient->getDisplayPhysicalOrientation(getInvalidDisplayId()); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientation) { @@ -987,94 +795,111 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientation) { Transform::ROT_270, }; - Transform displayOrientation; - const auto error = - mComposerClient->getDisplayPhysicalOrientation(mPrimaryDisplay, &displayOrientation); + const auto& [status, displayOrientation] = + mComposerClient->getDisplayPhysicalOrientation(getPrimaryDisplayId()); - EXPECT_TRUE(error.isOk()); + EXPECT_TRUE(status.isOk()); EXPECT_NE(std::find(allowedDisplayOrientations.begin(), allowedDisplayOrientations.end(), displayOrientation), allowedDisplayOrientations.end()); } TEST_P(GraphicsComposerAidlTest, SetClientTargetSlotCount) { - EXPECT_TRUE( - mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kBufferSlotCount).isOk()); + EXPECT_TRUE(mComposerClient->setClientTargetSlotCount(getPrimaryDisplayId(), kBufferSlotCount) + .isOk()); } TEST_P(GraphicsComposerAidlTest, SetActiveConfig) { - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); - for (auto config : configs) { - EXPECT_TRUE(mComposerClient->setActiveConfig(mPrimaryDisplay, config).isOk()); - int32_t config1; - EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk()); + const auto& [status, configs] = mComposerClient->getDisplayConfigs(getPrimaryDisplayId()); + EXPECT_TRUE(status.isOk()); + + for (const auto& config : configs) { + auto display = getEditablePrimaryDisplay(); + EXPECT_TRUE(mComposerClient->setActiveConfig(&display, config).isOk()); + const auto& [configStatus, config1] = + mComposerClient->getActiveConfig(getPrimaryDisplayId()); + EXPECT_TRUE(configStatus.isOk()); EXPECT_EQ(config, config1); } } TEST_P(GraphicsComposerAidlTest, SetActiveConfigPowerCycle) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk()); - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk()); - - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(mPrimaryDisplay, &configs).isOk()); - for (auto config : configs) { - EXPECT_TRUE(mComposerClient->setActiveConfig(mPrimaryDisplay, config).isOk()); - int32_t config1; - EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk()); + + const auto& [status, configs] = mComposerClient->getDisplayConfigs(getPrimaryDisplayId()); + EXPECT_TRUE(status.isOk()); + + for (const auto& config : configs) { + auto display = getEditablePrimaryDisplay(); + EXPECT_TRUE(mComposerClient->setActiveConfig(&display, config).isOk()); + const auto& [config1Status, config1] = + mComposerClient->getActiveConfig(getPrimaryDisplayId()); + EXPECT_TRUE(config1Status.isOk()); EXPECT_EQ(config, config1); - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk()); - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk()); - EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &config1).isOk()); - EXPECT_EQ(config, config1); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk()); + const auto& [config2Status, config2] = + mComposerClient->getActiveConfig(getPrimaryDisplayId()); + EXPECT_TRUE(config2Status.isOk()); + EXPECT_EQ(config, config2); } } TEST_P(GraphicsComposerAidlTest, SetPowerModeUnsupported) { - std::vector capabilities; - auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); - ASSERT_TRUE(error.isOk()); + const auto& [status, capabilities] = + mComposerClient->getDisplayCapabilities(getPrimaryDisplayId()); + ASSERT_TRUE(status.isOk()); + const bool isDozeSupported = std::find(capabilities.begin(), capabilities.end(), DisplayCapability::DOZE) != capabilities.end(); const bool isSuspendSupported = std::find(capabilities.begin(), capabilities.end(), DisplayCapability::SUSPEND) != capabilities.end(); + if (!isDozeSupported) { - error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + const auto& powerModeDozeStatus = + mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::DOZE); + EXPECT_FALSE(powerModeDozeStatus.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, powerModeDozeStatus.getServiceSpecificError()); - error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE_SUSPEND); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + const auto& powerModeDozeSuspendStatus = + mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::DOZE_SUSPEND); + EXPECT_FALSE(powerModeDozeSuspendStatus.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, + powerModeDozeSuspendStatus.getServiceSpecificError()); } if (!isSuspendSupported) { - error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON_SUSPEND); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + const auto& powerModeSuspendStatus = + mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON_SUSPEND); + EXPECT_FALSE(powerModeSuspendStatus.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, + powerModeSuspendStatus.getServiceSpecificError()); - error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE_SUSPEND); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + const auto& powerModeDozeSuspendStatus = + mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::DOZE_SUSPEND); + EXPECT_FALSE(powerModeDozeSuspendStatus.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, + powerModeDozeSuspendStatus.getServiceSpecificError()); } } TEST_P(GraphicsComposerAidlTest, SetVsyncEnabled) { - mComposerCallback->setVsyncAllowed(true); + mComposerClient->setVsyncAllowed(true); - EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, true).isOk()); + EXPECT_TRUE(mComposerClient->setVsync(getPrimaryDisplayId(), true).isOk()); usleep(60 * 1000); - EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, false).isOk()); + EXPECT_TRUE(mComposerClient->setVsync(getPrimaryDisplayId(), false).isOk()); - mComposerCallback->setVsyncAllowed(false); + mComposerClient->setVsyncAllowed(false); } TEST_P(GraphicsComposerAidlTest, SetPowerMode) { - std::vector capabilities; - const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); - ASSERT_TRUE(error.isOk()); + const auto& [status, capabilities] = + mComposerClient->getDisplayCapabilities(getPrimaryDisplayId()); + ASSERT_TRUE(status.isOk()); + const bool isDozeSupported = std::find(capabilities.begin(), capabilities.end(), DisplayCapability::DOZE) != capabilities.end(); const bool isSuspendSupported = std::find(capabilities.begin(), capabilities.end(), @@ -1097,14 +922,15 @@ TEST_P(GraphicsComposerAidlTest, SetPowerMode) { } for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), mode).isOk()); } } TEST_P(GraphicsComposerAidlTest, SetPowerModeVariations) { - std::vector capabilities; - const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); - ASSERT_TRUE(error.isOk()); + const auto& [status, capabilities] = + mComposerClient->getDisplayCapabilities(getPrimaryDisplayId()); + ASSERT_TRUE(status.isOk()); + const bool isDozeSupported = std::find(capabilities.begin(), capabilities.end(), DisplayCapability::DOZE) != capabilities.end(); const bool isSuspendSupported = std::find(capabilities.begin(), capabilities.end(), @@ -1116,21 +942,21 @@ TEST_P(GraphicsComposerAidlTest, SetPowerModeVariations) { modes.push_back(PowerMode::ON); modes.push_back(PowerMode::OFF); for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), mode).isOk()); } modes.clear(); modes.push_back(PowerMode::OFF); modes.push_back(PowerMode::OFF); for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), mode).isOk()); } modes.clear(); modes.push_back(PowerMode::ON); modes.push_back(PowerMode::ON); for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), mode).isOk()); } modes.clear(); @@ -1138,7 +964,7 @@ TEST_P(GraphicsComposerAidlTest, SetPowerModeVariations) { modes.push_back(PowerMode::ON_SUSPEND); modes.push_back(PowerMode::ON_SUSPEND); for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), mode).isOk()); } modes.clear(); } @@ -1147,7 +973,7 @@ TEST_P(GraphicsComposerAidlTest, SetPowerModeVariations) { modes.push_back(PowerMode::DOZE); modes.push_back(PowerMode::DOZE); for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), mode).isOk()); } modes.clear(); } @@ -1156,46 +982,46 @@ TEST_P(GraphicsComposerAidlTest, SetPowerModeVariations) { modes.push_back(PowerMode::DOZE_SUSPEND); modes.push_back(PowerMode::DOZE_SUSPEND); for (auto mode : modes) { - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), mode).isOk()); } modes.clear(); } } -TEST_P(GraphicsComposerAidlTest, SetPowerModeBadDisplay) { - const auto error = mComposerClient->setPowerMode(mInvalidDisplayId, PowerMode::ON); +TEST_P(GraphicsComposerAidlTest, SetPowerMode_BadDisplay) { + const auto& status = mComposerClient->setPowerMode(getInvalidDisplayId(), PowerMode::ON); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlTest, SetPowerModeBadParameter) { - const auto error = mComposerClient->setPowerMode(mPrimaryDisplay, static_cast(-1)); +TEST_P(GraphicsComposerAidlTest, SetPowerMode_BadParameter) { + const auto& status = + mComposerClient->setPowerMode(getPrimaryDisplayId(), static_cast(-1)); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); } TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrix) { - std::vector matrix; - EXPECT_TRUE( - mComposerClient->getDataspaceSaturationMatrix(common::Dataspace::SRGB_LINEAR, &matrix) - .isOk()); + const auto& [status, matrix] = + mComposerClient->getDataspaceSaturationMatrix(common::Dataspace::SRGB_LINEAR); + ASSERT_TRUE(status.isOk()); + ASSERT_EQ(16, matrix.size()); // matrix should not be empty if call succeeded. // the last row is known - ASSERT_EQ(0.0f, matrix[12]); - ASSERT_EQ(0.0f, matrix[13]); - ASSERT_EQ(0.0f, matrix[14]); - ASSERT_EQ(1.0f, matrix[15]); + EXPECT_EQ(0.0f, matrix[12]); + EXPECT_EQ(0.0f, matrix[13]); + EXPECT_EQ(0.0f, matrix[14]); + EXPECT_EQ(1.0f, matrix[15]); } -TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrixBadParameter) { - std::vector matrix; - const auto error = - mComposerClient->getDataspaceSaturationMatrix(common::Dataspace::UNKNOWN, &matrix); +TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrix_BadParameter) { + const auto& [status, matrix] = + mComposerClient->getDataspaceSaturationMatrix(common::Dataspace::UNKNOWN); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); } // Tests for Command. @@ -1204,8 +1030,8 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { void TearDown() override { const auto errors = mReader.takeErrors(); ASSERT_TRUE(mReader.takeErrors().empty()); - ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()); - ASSERT_TRUE(mReader.takeBufferAheadResultLayers(mPrimaryDisplay).empty()); + ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()); + ASSERT_TRUE(mReader.takeBufferAheadResultLayers(getPrimaryDisplayId()).empty()); ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::TearDown()); } @@ -1217,8 +1043,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { return; } - std::vector results; - const auto status = mComposerClient->executeCommands(commands, &results); + auto [status, results] = mComposerClient->executeCommands(commands); ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); mReader.parse(std::move(results)); @@ -1229,24 +1054,9 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { return std::chrono::time_point(std::chrono::nanoseconds(time)); } - void setActiveConfig(VtsDisplay& display, int32_t config) { - EXPECT_TRUE(mComposerClient->setActiveConfig(display.get(), config).isOk()); - int32_t displayWidth; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, DisplayAttribute::WIDTH, - &displayWidth) - .isOk()); - int32_t displayHeight; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, DisplayAttribute::HEIGHT, - &displayHeight) - .isOk()); - display.setDimensions(displayWidth, displayHeight); - } - void forEachTwoConfigs(int64_t display, std::function func) { - std::vector displayConfigs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(display, &displayConfigs).isOk()); + const auto& [status, displayConfigs] = mComposerClient->getDisplayConfigs(display); + ASSERT_TRUE(status.isOk()); for (const int32_t config1 : displayConfigs) { for (const int32_t config2 : displayConfigs) { if (config1 != config2) { @@ -1261,8 +1071,9 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { int64_t newPeriodNanos) { const auto kChangeDeadline = toTimePoint(timeline.newVsyncAppliedTimeNanos) + 100ms; while (std::chrono::steady_clock::now() <= kChangeDeadline) { - int32_t vsyncPeriodNanos; - EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display, &vsyncPeriodNanos).isOk()); + const auto& [status, vsyncPeriodNanos] = + mComposerClient->getDisplayVsyncPeriod(display); + EXPECT_TRUE(status.isOk()); if (systemTime() <= desiredTimeNanos) { EXPECT_EQ(vsyncPeriodNanos, oldPeriodNanos); } else if (vsyncPeriodNanos == newPeriodNanos) { @@ -1274,9 +1085,10 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { sp allocate() { return sp::make( - static_cast(mDisplayWidth), static_cast(mDisplayHeight), + static_cast(getPrimaryDisplay().getDisplayWidth()), + static_cast(getPrimaryDisplay().getDisplayHeight()), ::android::PIXEL_FORMAT_RGBA_8888, - /*layerCount*/ 1, + /*layerCount*/ 1U, (static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | static_cast(common::BufferUsage::CPU_READ_OFTEN) | static_cast(common::BufferUsage::COMPOSER_OVERLAY)), @@ -1291,39 +1103,32 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { std::this_thread::sleep_until(toTimePoint(timeline->refreshTimeNanos)); } - EXPECT_TRUE(mComposerClient->setPowerMode(display.get(), PowerMode::ON).isOk()); - EXPECT_TRUE( - mComposerClient - ->setColorMode(display.get(), ColorMode::NATIVE, RenderIntent::COLORIMETRIC) - .isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(display.getDisplayId(), PowerMode::ON).isOk()); + EXPECT_TRUE(mComposerClient + ->setColorMode(display.getDisplayId(), ColorMode::NATIVE, + RenderIntent::COLORIMETRIC) + .isOk()); - int64_t layer = 0; - ASSERT_NO_FATAL_FAILURE(layer = createLayer(display)); + const auto& [status, layer] = + mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount); + EXPECT_TRUE(status.isOk()); { const auto buffer = allocate(); ASSERT_NE(nullptr, buffer); ASSERT_EQ(::android::OK, buffer->initCheck()); ASSERT_NE(nullptr, buffer->handle); - mWriter.setLayerCompositionType(display.get(), layer, Composition::DEVICE); - mWriter.setLayerDisplayFrame(display.get(), layer, display.getFrameRect()); - mWriter.setLayerPlaneAlpha(display.get(), layer, 1); - mWriter.setLayerSourceCrop(display.get(), layer, display.getCrop()); - mWriter.setLayerTransform(display.get(), layer, static_cast(0)); - mWriter.setLayerVisibleRegion(display.get(), layer, - std::vector(1, display.getFrameRect())); - mWriter.setLayerZOrder(display.get(), layer, 10); - mWriter.setLayerBlendMode(display.get(), layer, BlendMode::NONE); - mWriter.setLayerSurfaceDamage(display.get(), layer, - std::vector(1, display.getFrameRect())); - mWriter.setLayerBuffer(display.get(), layer, 0, buffer->handle, -1); - mWriter.setLayerDataspace(display.get(), layer, common::Dataspace::UNKNOWN); - - mWriter.validateDisplay(display.get(), ComposerClientWriter::kNoTimestamp); + configureLayer(display, layer, Composition::DEVICE, display.getFrameRect(), + display.getCrop()); + mWriter.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, buffer->handle, + /*acquireFence*/ -1); + mWriter.setLayerDataspace(display.getDisplayId(), layer, common::Dataspace::UNKNOWN); + + mWriter.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(display.get()); + mWriter.presentDisplay(display.getDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } @@ -1332,31 +1137,32 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { const auto buffer = allocate(); ASSERT_NE(nullptr, buffer->handle); - mWriter.setLayerBuffer(display.get(), layer, 0, buffer->handle, -1); - mWriter.setLayerSurfaceDamage(display.get(), layer, + mWriter.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, buffer->handle, + /*acquireFence*/ -1); + mWriter.setLayerSurfaceDamage(display.getDisplayId(), layer, std::vector(1, {0, 0, 10, 10})); - mWriter.validateDisplay(display.get(), ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(display.get()); + mWriter.presentDisplay(display.getDisplayId()); execute(); } - ASSERT_NO_FATAL_FAILURE(destroyLayer(display, layer)); + EXPECT_TRUE(mComposerClient->destroyLayer(display.getDisplayId(), layer).isOk()); } sp<::android::Fence> presentAndGetFence( std::optional expectedPresentTime) { - mWriter.validateDisplay(mPrimaryDisplay, expectedPresentTime); + mWriter.validateDisplay(getPrimaryDisplayId(), expectedPresentTime); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - auto presentFence = mReader.takePresentFence(mPrimaryDisplay); + auto presentFence = mReader.takePresentFence(getPrimaryDisplayId()); // take ownership const int fenceOwner = presentFence.get(); *presentFence.getR() = -1; @@ -1365,74 +1171,49 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { } int32_t getVsyncPeriod() { - int32_t activeConfig; - EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &activeConfig).isOk()); + const auto& [status, activeConfig] = + mComposerClient->getActiveConfig(getPrimaryDisplayId()); + EXPECT_TRUE(status.isOk()); - int32_t vsyncPeriod; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(mPrimaryDisplay, activeConfig, - DisplayAttribute::VSYNC_PERIOD, &vsyncPeriod) - .isOk()); + const auto& [vsyncPeriodStatus, vsyncPeriod] = mComposerClient->getDisplayAttribute( + getPrimaryDisplayId(), activeConfig, DisplayAttribute::VSYNC_PERIOD); + EXPECT_TRUE(vsyncPeriodStatus.isOk()); return vsyncPeriod; } int64_t createOnScreenLayer() { - const int64_t layer = createLayer(mDisplays[0]); - mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::DEVICE); - mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, {0, 0, mDisplayWidth, mDisplayHeight}); - mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1); - mWriter.setLayerSourceCrop( - mPrimaryDisplay, layer, - {0, 0, static_cast(mDisplayWidth), static_cast(mDisplayHeight)}); - mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast(0)); - mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, - std::vector(1, {0, 0, mDisplayWidth, mDisplayHeight})); - mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10); - mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE); - mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, - std::vector(1, {0, 0, mDisplayWidth, mDisplayHeight})); - mWriter.setLayerDataspace(mPrimaryDisplay, layer, common::Dataspace::UNKNOWN); + const auto& [status, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + 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::DEVICE, displayFrame, cropRect); + mWriter.setLayerDataspace(getPrimaryDisplayId(), layer, common::Dataspace::UNKNOWN); return layer; } bool hasDisplayCapability(int64_t display, DisplayCapability cap) { - std::vector capabilities; - const auto error = mComposerClient->getDisplayCapabilities(display, &capabilities); - EXPECT_TRUE(error.isOk()); + const auto& [status, capabilities] = mComposerClient->getDisplayCapabilities(display); + EXPECT_TRUE(status.isOk()); return std::find(capabilities.begin(), capabilities.end(), cap) != capabilities.end(); } void Test_setActiveConfigWithConstraints(const TestParameters& params) { for (VtsDisplay& display : mDisplays) { - forEachTwoConfigs(display.get(), [&](int32_t config1, int32_t config2) { - setActiveConfig(display, config1); + forEachTwoConfigs(display.getDisplayId(), [&](int32_t config1, int32_t config2) { + EXPECT_TRUE(mComposerClient->setActiveConfig(&display, config1).isOk()); sendRefreshFrame(display, nullptr); - int32_t vsyncPeriod1; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config1, - DisplayAttribute::VSYNC_PERIOD, - &vsyncPeriod1) - .isOk()); - int32_t configGroup1; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config1, - DisplayAttribute::CONFIG_GROUP, - &configGroup1) - .isOk()); - int32_t vsyncPeriod2; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config2, - DisplayAttribute::VSYNC_PERIOD, - &vsyncPeriod2) - .isOk()); - int32_t configGroup2; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config2, - DisplayAttribute::CONFIG_GROUP, - &configGroup2) - .isOk()); + const auto displayConfigGroup1 = display.getDisplayConfig(config1); + int32_t vsyncPeriod1 = displayConfigGroup1.vsyncPeriod; + int32_t configGroup1 = displayConfigGroup1.configGroup; + + const auto displayConfigGroup2 = display.getDisplayConfig(config2); + int32_t vsyncPeriod2 = displayConfigGroup2.vsyncPeriod; + int32_t configGroup2 = displayConfigGroup2.configGroup; if (vsyncPeriod1 == vsyncPeriod2) { return; // continue @@ -1443,12 +1224,12 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { return; // continue } - VsyncPeriodChangeTimeline timeline; VsyncPeriodChangeConstraints constraints = { .desiredTimeNanos = systemTime() + params.delayForChange, .seamlessRequired = false}; - EXPECT_TRUE(setActiveConfigWithConstraints(display, config2, constraints, &timeline) - .isOk()); + const auto& [status, timeline] = mComposerClient->setActiveConfigWithConstraints( + &display, config2, constraints); + EXPECT_TRUE(status.isOk()); EXPECT_TRUE(timeline.newVsyncAppliedTimeNanos >= constraints.desiredTimeNanos); // Refresh rate should change within a reasonable time @@ -1465,13 +1246,13 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { } sendRefreshFrame(display, &timeline); } - waitForVsyncPeriodChange(display.get(), timeline, constraints.desiredTimeNanos, - vsyncPeriod1, vsyncPeriod2); + waitForVsyncPeriodChange(display.getDisplayId(), timeline, + constraints.desiredTimeNanos, vsyncPeriod1, vsyncPeriod2); // At this point the refresh rate should have changed already, however in rare // cases the implementation might have missed the deadline. In this case a new // timeline should have been provided. - auto newTimeline = mComposerCallback->takeLastVsyncPeriodChangeTimeline(); + auto newTimeline = mComposerClient->takeLastVsyncPeriodChangeTimeline(); if (timeline.refreshRequired && params.refreshMiss) { EXPECT_TRUE(newTimeline.has_value()); } @@ -1480,14 +1261,14 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { if (newTimeline->refreshRequired) { sendRefreshFrame(display, &newTimeline.value()); } - waitForVsyncPeriodChange(display.get(), newTimeline.value(), + waitForVsyncPeriodChange(display.getDisplayId(), newTimeline.value(), constraints.desiredTimeNanos, vsyncPeriod1, vsyncPeriod2); } - int32_t vsyncPeriodNanos; - EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display.get(), &vsyncPeriodNanos) - .isOk()); + const auto& [vsyncPeriodNanosStatus, vsyncPeriodNanos] = + mComposerClient->getDisplayVsyncPeriod(display.getDisplayId()); + EXPECT_TRUE(vsyncPeriodNanosStatus.isOk()); EXPECT_EQ(vsyncPeriodNanos, vsyncPeriod2); }); } @@ -1499,7 +1280,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { return; } - ASSERT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk()); + ASSERT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk()); const auto vsyncPeriod = getVsyncPeriod(); @@ -1509,7 +1290,8 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { ASSERT_NE(nullptr, buffer2); const auto layer = createOnScreenLayer(); - mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, buffer1->handle, -1); + mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, buffer1->handle, + /*acquireFence*/ -1); const sp<::android::Fence> presentFence1 = presentAndGetFence(ComposerClientWriter::kNoTimestamp); presentFence1->waitForever(LOG_TAG); @@ -1519,7 +1301,8 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { expectedPresentTime += *framesDelay * vsyncPeriod; } - mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, buffer2->handle, -1); + mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, buffer2->handle, + /*acquireFence*/ -1); const auto setExpectedPresentTime = [&]() -> std::optional { if (!framesDelay.has_value()) { return ComposerClientWriter::kNoTimestamp; @@ -1535,9 +1318,23 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { const auto actualPresentTime = presentFence2->getSignalTime(); EXPECT_GE(actualPresentTime, expectedPresentTime - vsyncPeriod / 2); - ASSERT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk()); + ASSERT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk()); } + void configureLayer(const VtsDisplay& display, int64_t layer, Composition composition, + const Rect& displayFrame, const FRect& cropRect) { + mWriter.setLayerCompositionType(display.getDisplayId(), layer, composition); + mWriter.setLayerDisplayFrame(display.getDisplayId(), layer, displayFrame); + mWriter.setLayerPlaneAlpha(display.getDisplayId(), layer, /*alpha*/ 1); + mWriter.setLayerSourceCrop(display.getDisplayId(), layer, cropRect); + mWriter.setLayerTransform(display.getDisplayId(), layer, static_cast(0)); + mWriter.setLayerVisibleRegion(display.getDisplayId(), layer, + std::vector(1, displayFrame)); + mWriter.setLayerZOrder(display.getDisplayId(), layer, /*z*/ 10); + mWriter.setLayerBlendMode(display.getDisplayId(), layer, BlendMode::NONE); + mWriter.setLayerSurfaceDamage(display.getDisplayId(), layer, + std::vector(1, displayFrame)); + } // clang-format off const std::array kIdentity = {{ 1.0f, 0.0f, 0.0f, 0.0f, @@ -1551,15 +1348,16 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { ComposerClientReader mReader; }; -TEST_P(GraphicsComposerAidlCommandTest, SET_COLOR_TRANSFORM) { - mWriter.setColorTransform(mPrimaryDisplay, kIdentity.data()); +TEST_P(GraphicsComposerAidlCommandTest, SetColorTransform) { + mWriter.setColorTransform(getPrimaryDisplayId(), kIdentity.data()); execute(); } TEST_P(GraphicsComposerAidlCommandTest, SetLayerColorTransform) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter.setLayerColorTransform(mPrimaryDisplay, layer, kIdentity.data()); + const auto& [status, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(status.isOk()); + mWriter.setLayerColorTransform(getPrimaryDisplayId(), layer, kIdentity.data()); execute(); const auto errors = mReader.takeErrors(); @@ -1570,13 +1368,13 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerColorTransform) { } TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { - std::vector capabilities; - auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); - ASSERT_TRUE(error.isOk()); + const auto& [status, capabilities] = + mComposerClient->getDisplayCapabilities(getPrimaryDisplayId()); + ASSERT_TRUE(status.isOk()); bool brightnessSupport = std::find(capabilities.begin(), capabilities.end(), DisplayCapability::BRIGHTNESS) != capabilities.end(); if (!brightnessSupport) { - mWriter.setDisplayBrightness(mPrimaryDisplay, 0.5f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f); execute(); const auto errors = mReader.takeErrors(); EXPECT_EQ(1, errors.size()); @@ -1585,23 +1383,23 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { return; } - mWriter.setDisplayBrightness(mPrimaryDisplay, 0.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.0f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(mPrimaryDisplay, 0.5f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(mPrimaryDisplay, 1.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.0f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(mPrimaryDisplay, -1.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -1.0f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(mPrimaryDisplay, 2.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 2.0f); execute(); { const auto errors = mReader.takeErrors(); @@ -1609,7 +1407,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode); } - mWriter.setDisplayBrightness(mPrimaryDisplay, -2.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -2.0f); execute(); { const auto errors = mReader.takeErrors(); @@ -1618,51 +1416,49 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { } } -TEST_P(GraphicsComposerAidlCommandTest, SET_CLIENT_TARGET) { - EXPECT_TRUE( - mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kBufferSlotCount).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetClientTarget) { + EXPECT_TRUE(mComposerClient->setClientTargetSlotCount(getPrimaryDisplayId(), kBufferSlotCount) + .isOk()); - mWriter.setClientTarget(mPrimaryDisplay, 0, nullptr, -1, Dataspace::UNKNOWN, - std::vector()); + mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, nullptr, /*acquireFence*/ -1, + Dataspace::UNKNOWN, std::vector()); execute(); } -TEST_P(GraphicsComposerAidlCommandTest, SET_OUTPUT_BUFFER) { - int32_t virtualDisplayCount; - EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&virtualDisplayCount).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetOutputBuffer) { + const auto& [status, virtualDisplayCount] = mComposerClient->getMaxVirtualDisplayCount(); + EXPECT_TRUE(status.isOk()); if (virtualDisplayCount == 0) { GTEST_SUCCEED() << "no virtual display support"; return; } - VirtualDisplay display; - EXPECT_TRUE(mComposerClient - ->createVirtualDisplay(64, 64, common::PixelFormat::IMPLEMENTATION_DEFINED, - kBufferSlotCount, &display) - .isOk()); + const auto& [displayStatus, display] = mComposerClient->createVirtualDisplay( + /*width*/ 64, /*height*/ 64, common::PixelFormat::IMPLEMENTATION_DEFINED, + kBufferSlotCount); + EXPECT_TRUE(displayStatus.isOk()); const auto buffer = allocate(); const auto handle = buffer->handle; - mWriter.setOutputBuffer(display.display, 0, handle, -1); + mWriter.setOutputBuffer(display.display, /*slot*/ 0, handle, /*releaseFence*/ -1); execute(); } -TEST_P(GraphicsComposerAidlCommandTest, VALIDATE_DISPLAY) { - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); +TEST_P(GraphicsComposerAidlCommandTest, ValidDisplay) { + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); } -TEST_P(GraphicsComposerAidlCommandTest, ACCEPT_DISPLAY_CHANGES) { - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); - mWriter.acceptDisplayChanges(mPrimaryDisplay); +TEST_P(GraphicsComposerAidlCommandTest, AcceptDisplayChanges) { + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter.acceptDisplayChanges(getPrimaryDisplayId()); execute(); } -// TODO(b/208441745) fix the test failure -TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY) { - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); - mWriter.presentDisplay(mPrimaryDisplay); +TEST_P(GraphicsComposerAidlCommandTest, PresentDisplay) { + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); } @@ -1673,236 +1469,237 @@ TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY) { * additional call to validateDisplay when only the layer buffer handle and * surface damage have been set */ -// TODO(b/208441745) fix the test failure -TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) { +TEST_P(GraphicsComposerAidlCommandTest, PresentDisplayNoLayerStateChanges) { if (!hasCapability(Capability::SKIP_VALIDATE)) { GTEST_SUCCEED() << "Device does not have skip validate capability, skipping"; return; } - mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk()); - std::vector renderIntents; - mComposerClient->getRenderIntents(mPrimaryDisplay, ColorMode::NATIVE, &renderIntents); + const auto& [renderIntentsStatus, renderIntents] = + mComposerClient->getRenderIntents(getPrimaryDisplayId(), ColorMode::NATIVE); + EXPECT_TRUE(renderIntentsStatus.isOk()); for (auto intent : renderIntents) { - mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE, intent); + EXPECT_TRUE(mComposerClient->setColorMode(getPrimaryDisplayId(), ColorMode::NATIVE, intent) + .isOk()); const auto buffer = allocate(); const auto handle = buffer->handle; ASSERT_NE(nullptr, handle); - Rect displayFrame{0, 0, mDisplayWidth, mDisplayHeight}; - - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::DEVICE); - mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, displayFrame); - mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1); - mWriter.setLayerSourceCrop(mPrimaryDisplay, layer, - {0, 0, (float)mDisplayWidth, (float)mDisplayHeight}); - mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast(0)); - mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector(1, displayFrame)); - mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10); - mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE); - mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector(1, displayFrame)); - mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle, -1); - mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN); - - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); + + Rect displayFrame{0, 0, getPrimaryDisplay().getDisplayWidth(), + getPrimaryDisplay().getDisplayHeight()}; + FRect cropRect{0, 0, (float)getPrimaryDisplay().getDisplayWidth(), + (float)getPrimaryDisplay().getDisplayHeight()}; + configureLayer(getPrimaryDisplay(), layer, Composition::CURSOR, displayFrame, cropRect); + mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, + /*acquireFence*/ -1); + mWriter.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED() << "Composition change requested, skipping test"; return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); const auto buffer2 = allocate(); const auto handle2 = buffer2->handle; ASSERT_NE(nullptr, handle2); - mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle2, -1); - mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector(1, {0, 0, 10, 10})); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle2, + /*acquireFence*/ -1); + mWriter.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, + std::vector(1, {0, 0, 10, 10})); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); } } -// TODO(b/208441745) fix the test failure -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_CURSOR_POSITION) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerCursorPosition) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); const auto buffer = allocate(); const auto handle = buffer->handle; ASSERT_NE(nullptr, handle); - Rect displayFrame{0, 0, mDisplayWidth, mDisplayHeight}; - - mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle, -1); - mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::CURSOR); - mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, displayFrame); - mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1); - mWriter.setLayerSourceCrop(mPrimaryDisplay, layer, - {0, 0, (float)mDisplayWidth, (float)mDisplayHeight}); - mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast(0)); - mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector(1, displayFrame)); - mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10); - mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE); - mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector(1, displayFrame)); - mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + + mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, /*acquireFence*/ -1); + + Rect displayFrame{0, 0, getPrimaryDisplay().getDisplayWidth(), + getPrimaryDisplay().getDisplayHeight()}; + FRect cropRect{0, 0, (float)getPrimaryDisplay().getDisplayWidth(), + (float)getPrimaryDisplay().getDisplayHeight()}; + configureLayer(getPrimaryDisplay(), layer, Composition::CURSOR, displayFrame, cropRect); + mWriter.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED() << "Composition change requested, skipping test"; return; } - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerCursorPosition(mPrimaryDisplay, layer, 1, 1); + mWriter.setLayerCursorPosition(getPrimaryDisplayId(), layer, /*x*/ 1, /*y*/ 1); execute(); - mWriter.setLayerCursorPosition(mPrimaryDisplay, layer, 0, 0); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.setLayerCursorPosition(getPrimaryDisplayId(), layer, /*x*/ 0, /*y*/ 0); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BUFFER) { +TEST_P(GraphicsComposerAidlCommandTest, SetLayerBuffer) { const auto buffer = allocate(); const auto handle = buffer->handle; ASSERT_NE(nullptr, handle); - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); - mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle, -1); + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); + mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, /*acquireFence*/ -1); execute(); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SURFACE_DAMAGE) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerSurfaceDamage) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); Rect empty{0, 0, 0, 0}; Rect unit{0, 0, 1, 1}; - mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector(1, empty)); + mWriter.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, std::vector(1, empty)); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector(1, unit)); + mWriter.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, std::vector(1, unit)); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector()); + mWriter.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, std::vector()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BLOCKING_REGION) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerBlockingRegion) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); Rect empty{0, 0, 0, 0}; Rect unit{0, 0, 1, 1}; - mWriter.setLayerBlockingRegion(mPrimaryDisplay, layer, std::vector(1, empty)); + mWriter.setLayerBlockingRegion(getPrimaryDisplayId(), layer, std::vector(1, empty)); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerBlockingRegion(mPrimaryDisplay, layer, std::vector(1, unit)); + mWriter.setLayerBlockingRegion(getPrimaryDisplayId(), layer, std::vector(1, unit)); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerBlockingRegion(mPrimaryDisplay, layer, std::vector()); + mWriter.setLayerBlockingRegion(getPrimaryDisplayId(), layer, std::vector()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BLEND_MODE) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerBlendMode) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE); + mWriter.setLayerBlendMode(getPrimaryDisplayId(), layer, BlendMode::NONE); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::PREMULTIPLIED); + mWriter.setLayerBlendMode(getPrimaryDisplayId(), layer, BlendMode::PREMULTIPLIED); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::COVERAGE); + mWriter.setLayerBlendMode(getPrimaryDisplayId(), layer, BlendMode::COVERAGE); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_COLOR) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerColor) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerColor(mPrimaryDisplay, layer, Color{1.0f, 1.0f, 1.0f, 1.0f}); + mWriter.setLayerColor(getPrimaryDisplayId(), layer, Color{1.0f, 1.0f, 1.0f, 1.0f}); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerColor(mPrimaryDisplay, layer, Color{0.0f, 0.0f, 0.0f, 0.0f}); + mWriter.setLayerColor(getPrimaryDisplayId(), layer, Color{0.0f, 0.0f, 0.0f, 0.0f}); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_COMPOSITION_TYPE) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerCompositionType) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::CLIENT); + mWriter.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::CLIENT); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::DEVICE); + mWriter.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::DEVICE); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::SOLID_COLOR); + mWriter.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::SOLID_COLOR); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::CURSOR); + mWriter.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::CURSOR); execute(); - ASSERT_TRUE(mReader.takeErrors().empty()); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_DATASPACE) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerDataspace) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN); + mWriter.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN); execute(); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_DISPLAY_FRAME) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerDisplayFrame) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, Rect{0, 0, 1, 1}); + mWriter.setLayerDisplayFrame(getPrimaryDisplayId(), layer, Rect{0, 0, 1, 1}); execute(); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_PLANE_ALPHA) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerPlaneAlpha) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 0.0f); + mWriter.setLayerPlaneAlpha(getPrimaryDisplayId(), layer, /*alpha*/ 0.0f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1.0f); + mWriter.setLayerPlaneAlpha(getPrimaryDisplayId(), layer, /*alpha*/ 1.0f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SIDEBAND_STREAM) { +TEST_P(GraphicsComposerAidlCommandTest, SetLayerSidebandStream) { if (!hasCapability(Capability::SIDEBAND_STREAM)) { GTEST_SUCCEED() << "no sideband stream support"; return; @@ -1912,98 +1709,104 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SIDEBAND_STREAM) { const auto handle = buffer->handle; ASSERT_NE(nullptr, handle); - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerSidebandStream(mPrimaryDisplay, layer, handle); + mWriter.setLayerSidebandStream(getPrimaryDisplayId(), layer, handle); execute(); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SOURCE_CROP) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerSourceCrop) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerSourceCrop(mPrimaryDisplay, layer, FRect{0.0f, 0.0f, 1.0f, 1.0f}); + mWriter.setLayerSourceCrop(getPrimaryDisplayId(), layer, FRect{0.0f, 0.0f, 1.0f, 1.0f}); execute(); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_TRANSFORM) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerTransform) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast(0)); + mWriter.setLayerTransform(getPrimaryDisplayId(), layer, static_cast(0)); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::FLIP_H); + mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::FLIP_H); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::FLIP_V); + mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::FLIP_V); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::ROT_90); + mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::ROT_90); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::ROT_180); + mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::ROT_180); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::ROT_270); + mWriter.setLayerTransform(getPrimaryDisplayId(), layer, Transform::ROT_270); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerTransform(mPrimaryDisplay, layer, + mWriter.setLayerTransform(getPrimaryDisplayId(), layer, static_cast(static_cast(Transform::FLIP_H) | static_cast(Transform::ROT_90))); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerTransform(mPrimaryDisplay, layer, + mWriter.setLayerTransform(getPrimaryDisplayId(), layer, static_cast(static_cast(Transform::FLIP_V) | static_cast(Transform::ROT_90))); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_VISIBLE_REGION) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerVisibleRegion) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); Rect empty{0, 0, 0, 0}; Rect unit{0, 0, 1, 1}; - mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector(1, empty)); + mWriter.setLayerVisibleRegion(getPrimaryDisplayId(), layer, std::vector(1, empty)); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector(1, unit)); + mWriter.setLayerVisibleRegion(getPrimaryDisplayId(), layer, std::vector(1, unit)); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector()); + mWriter.setLayerVisibleRegion(getPrimaryDisplayId(), layer, std::vector()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_Z_ORDER) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerZOrder) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10); + mWriter.setLayerZOrder(getPrimaryDisplayId(), layer, /*z*/ 10); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerZOrder(mPrimaryDisplay, layer, 0); + mWriter.setLayerZOrder(getPrimaryDisplayId(), layer, /*z*/ 0); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } -TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_PER_FRAME_METADATA) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerPerFrameMetadata) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); /** * DISPLAY_P3 is a color space that uses the DCI_P3 primaries, @@ -2030,88 +1833,86 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_PER_FRAME_METADATA) { aidlMetadata.push_back({PerFrameMetadataKey::MIN_LUMINANCE, 0.1f}); aidlMetadata.push_back({PerFrameMetadataKey::MAX_CONTENT_LIGHT_LEVEL, 78.0}); aidlMetadata.push_back({PerFrameMetadataKey::MAX_FRAME_AVERAGE_LIGHT_LEVEL, 62.0}); - mWriter.setLayerPerFrameMetadata(mPrimaryDisplay, layer, aidlMetadata); + mWriter.setLayerPerFrameMetadata(getPrimaryDisplayId(), layer, aidlMetadata); execute(); 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(mPrimaryDisplay, layer).isOk()); + EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk()); return; } - EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk()); + EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk()); } -TEST_P(GraphicsComposerAidlCommandTest, setLayerWhitePointNits) { - int64_t layer; - EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk()); +TEST_P(GraphicsComposerAidlCommandTest, SetLayerWhitePointNits) { + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerWhitePointNits(mPrimaryDisplay, layer, 200.f); + mWriter.setLayerWhitePointNits(getPrimaryDisplayId(), layer, /*whitePointNits*/ 200.f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerWhitePointNits(mPrimaryDisplay, layer, 1000.f); + mWriter.setLayerWhitePointNits(getPrimaryDisplayId(), layer, /*whitePointNits*/ 1000.f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerWhitePointNits(mPrimaryDisplay, layer, 0.f); + mWriter.setLayerWhitePointNits(getPrimaryDisplayId(), layer, /*whitePointNits*/ 0.f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerWhitePointNits(mPrimaryDisplay, layer, -1.f); + mWriter.setLayerWhitePointNits(getPrimaryDisplayId(), layer, /*whitePointNits*/ -1.f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); } -TEST_P(GraphicsComposerAidlCommandTest, setActiveConfigWithConstraints) { +TEST_P(GraphicsComposerAidlCommandTest, SetActiveConfigWithConstraints) { Test_setActiveConfigWithConstraints({.delayForChange = 0, .refreshMiss = false}); } -TEST_P(GraphicsComposerAidlCommandTest, setActiveConfigWithConstraints_Delayed) { +TEST_P(GraphicsComposerAidlCommandTest, SetActiveConfigWithConstraints_Delayed) { Test_setActiveConfigWithConstraints({.delayForChange = 300'000'000, // 300ms .refreshMiss = false}); } -TEST_P(GraphicsComposerAidlCommandTest, setActiveConfigWithConstraints_MissRefresh) { +TEST_P(GraphicsComposerAidlCommandTest, SetActiveConfigWithConstraints_MissRefresh) { Test_setActiveConfigWithConstraints({.delayForChange = 0, .refreshMiss = true}); } -TEST_P(GraphicsComposerAidlCommandTest, getDisplayVsyncPeriod) { +TEST_P(GraphicsComposerAidlCommandTest, GetDisplayVsyncPeriod) { for (VtsDisplay& display : mDisplays) { - std::vector configs; - EXPECT_TRUE(mComposerClient->getDisplayConfigs(display.get(), &configs).isOk()); + const auto& [status, configs] = mComposerClient->getDisplayConfigs(display.getDisplayId()); + EXPECT_TRUE(status.isOk()); + for (int32_t config : configs) { - int32_t expectedVsyncPeriodNanos = -1; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config, - DisplayAttribute::VSYNC_PERIOD, - &expectedVsyncPeriodNanos) - .isOk()); - - VsyncPeriodChangeTimeline timeline; + int32_t expectedVsyncPeriodNanos = display.getDisplayConfig(config).vsyncPeriod; + VsyncPeriodChangeConstraints constraints; constraints.desiredTimeNanos = systemTime(); constraints.seamlessRequired = false; - EXPECT_TRUE(mComposerClient - ->setActiveConfigWithConstraints(display.get(), config, constraints, - &timeline) - .isOk()); + + const auto& [timelineStatus, timeline] = + mComposerClient->setActiveConfigWithConstraints(&display, config, constraints); + EXPECT_TRUE(timelineStatus.isOk()); if (timeline.refreshRequired) { sendRefreshFrame(display, &timeline); } - waitForVsyncPeriodChange(display.get(), timeline, constraints.desiredTimeNanos, 0, - expectedVsyncPeriodNanos); + waitForVsyncPeriodChange(display.getDisplayId(), timeline, constraints.desiredTimeNanos, + /*odPeriodNanos*/ 0, expectedVsyncPeriodNanos); int32_t vsyncPeriodNanos; int retryCount = 100; do { std::this_thread::sleep_for(10ms); - vsyncPeriodNanos = 0; - EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display.get(), &vsyncPeriodNanos) - .isOk()); + const auto& [vsyncPeriodNanosStatus, vsyncPeriodNanosValue] = + mComposerClient->getDisplayVsyncPeriod(display.getDisplayId()); + + EXPECT_TRUE(vsyncPeriodNanosStatus.isOk()); + vsyncPeriodNanos = vsyncPeriodNanosValue; --retryCount; } while (vsyncPeriodNanos != expectedVsyncPeriodNanos && retryCount > 0); @@ -2124,122 +1925,121 @@ TEST_P(GraphicsComposerAidlCommandTest, getDisplayVsyncPeriod) { std::this_thread::sleep_for(timeout); timeout *= 2; vsyncPeriodNanos = 0; - EXPECT_TRUE(mComposerClient->getDisplayVsyncPeriod(display.get(), &vsyncPeriodNanos) - .isOk()); + const auto& [vsyncPeriodNanosStatus, vsyncPeriodNanosValue] = + mComposerClient->getDisplayVsyncPeriod(display.getDisplayId()); + + EXPECT_TRUE(vsyncPeriodNanosStatus.isOk()); + vsyncPeriodNanos = vsyncPeriodNanosValue; EXPECT_EQ(vsyncPeriodNanos, expectedVsyncPeriodNanos); } } } } -TEST_P(GraphicsComposerAidlCommandTest, setActiveConfigWithConstraints_SeamlessNotAllowed) { - VsyncPeriodChangeTimeline timeline; +TEST_P(GraphicsComposerAidlCommandTest, SetActiveConfigWithConstraints_SeamlessNotAllowed) { VsyncPeriodChangeConstraints constraints; - constraints.seamlessRequired = true; constraints.desiredTimeNanos = systemTime(); for (VtsDisplay& display : mDisplays) { - forEachTwoConfigs(display.get(), [&](int32_t config1, int32_t config2) { - int32_t configGroup1; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config1, - DisplayAttribute::CONFIG_GROUP, &configGroup1) - .isOk()); - int32_t configGroup2; - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(display.get(), config2, - DisplayAttribute::CONFIG_GROUP, &configGroup2) - .isOk()); + forEachTwoConfigs(display.getDisplayId(), [&](int32_t config1, int32_t config2) { + int32_t configGroup1 = display.getDisplayConfig(config1).configGroup; + int32_t configGroup2 = display.getDisplayConfig(config2).configGroup; if (configGroup1 != configGroup2) { - setActiveConfig(display, config1); + EXPECT_TRUE(mComposerClient->setActiveConfig(&display, config1).isOk()); sendRefreshFrame(display, nullptr); + const auto& [status, _] = mComposerClient->setActiveConfigWithConstraints( + &display, config2, constraints); + EXPECT_FALSE(status.isOk()); EXPECT_EQ(IComposerClient::EX_SEAMLESS_NOT_ALLOWED, - setActiveConfigWithConstraints(display, config2, constraints, &timeline) - .getServiceSpecificError()); + status.getServiceSpecificError()); } }); } } -TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_NoTimestamp) { - ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(std::nullopt)); +TEST_P(GraphicsComposerAidlCommandTest, ExpectedPresentTime_NoTimestamp) { + ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(/*framesDelay*/ std::nullopt)); } -TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_0) { - ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(0)); +TEST_P(GraphicsComposerAidlCommandTest, ExpectedPresentTime_0) { + ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(/*framesDelay*/ 0)); } -TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_5) { - ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(5)); +TEST_P(GraphicsComposerAidlCommandTest, ExpectedPresentTime_5) { + ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(/*framesDelay*/ 5)); } -TEST_P(GraphicsComposerAidlCommandTest, setIdleTimerEnabled_Unsupported) { - const bool hasDisplayIdleTimerSupport = hasDisplayCapability(mPrimaryDisplay, - DisplayCapability::DISPLAY_IDLE_TIMER); +TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_Unsupported) { + const bool hasDisplayIdleTimerSupport = + hasDisplayCapability(getPrimaryDisplayId(), DisplayCapability::DISPLAY_IDLE_TIMER); if (!hasDisplayIdleTimerSupport) { - const auto error = mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, 0); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + const auto& status = + mComposerClient->setIdleTimerEnabled(getPrimaryDisplayId(), /*timeout*/ 0); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); } } -TEST_P(GraphicsComposerAidlCommandTest, setIdleTimerEnabled_BadParameter) { - const bool hasDisplayIdleTimerSupport = hasDisplayCapability(mPrimaryDisplay, - DisplayCapability::DISPLAY_IDLE_TIMER); +TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_BadParameter) { + const bool hasDisplayIdleTimerSupport = + hasDisplayCapability(getPrimaryDisplayId(), DisplayCapability::DISPLAY_IDLE_TIMER); if (!hasDisplayIdleTimerSupport) { GTEST_SUCCEED() << "DisplayCapability::DISPLAY_IDLE_TIMER is not supported"; return; } - const auto error = mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, -1); - EXPECT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError()); + const auto& status = + mComposerClient->setIdleTimerEnabled(getPrimaryDisplayId(), /*timeout*/ -1); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); } -TEST_P(GraphicsComposerAidlCommandTest, setIdleTimerEnabled_Disable) { - const bool hasDisplayIdleTimerSupport = hasDisplayCapability(mPrimaryDisplay, - DisplayCapability::DISPLAY_IDLE_TIMER); +TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_Disable) { + const bool hasDisplayIdleTimerSupport = + hasDisplayCapability(getPrimaryDisplayId(), DisplayCapability::DISPLAY_IDLE_TIMER); if (!hasDisplayIdleTimerSupport) { GTEST_SUCCEED() << "DisplayCapability::DISPLAY_IDLE_TIMER is not supported"; return; } - EXPECT_TRUE(mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, 0).isOk()); + EXPECT_TRUE(mComposerClient->setIdleTimerEnabled(getPrimaryDisplayId(), /*timeout*/ 0).isOk()); std::this_thread::sleep_for(1s); - EXPECT_EQ(0, mComposerCallback->getVsyncIdleCount()); + EXPECT_EQ(0, mComposerClient->getVsyncIdleCount()); } -TEST_P(GraphicsComposerAidlCommandTest, setIdleTimerEnabled_Timeout_2) { - const bool hasDisplayIdleTimerSupport = hasDisplayCapability(mPrimaryDisplay, - DisplayCapability::DISPLAY_IDLE_TIMER); +TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_Timeout_2) { + const bool hasDisplayIdleTimerSupport = + hasDisplayCapability(getPrimaryDisplayId(), DisplayCapability::DISPLAY_IDLE_TIMER); if (!hasDisplayIdleTimerSupport) { GTEST_SUCCEED() << "DisplayCapability::DISPLAY_IDLE_TIMER is not supported"; return; } - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk()); - EXPECT_TRUE(mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, 0).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk()); + EXPECT_TRUE(mComposerClient->setIdleTimerEnabled(getPrimaryDisplayId(), /*timeout*/ 0).isOk()); const auto buffer = allocate(); ASSERT_NE(nullptr, buffer->handle); const auto layer = createOnScreenLayer(); - mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, buffer->handle, -1); - int32_t vsyncIdleCount = mComposerCallback->getVsyncIdleCount(); + mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, buffer->handle, + /*acquireFence*/ -1); + int32_t vsyncIdleCount = mComposerClient->getVsyncIdleCount(); auto earlyVsyncIdleTime = systemTime() + std::chrono::nanoseconds(2s).count(); - EXPECT_TRUE(mComposerClient->setIdleTimerEnabled(mPrimaryDisplay, 2000).isOk()); + EXPECT_TRUE( + mComposerClient->setIdleTimerEnabled(getPrimaryDisplayId(), /*timeout*/ 2000).isOk()); const sp<::android::Fence> presentFence = - presentAndGetFence(ComposerClientWriter::kNoTimestamp); + presentAndGetFence(ComposerClientWriter::kNoTimestamp); presentFence->waitForever(LOG_TAG); std::this_thread::sleep_for(3s); - if (vsyncIdleCount < mComposerCallback->getVsyncIdleCount()) { - EXPECT_GE(mComposerCallback->getVsyncIdleTime(), earlyVsyncIdleTime); + if (vsyncIdleCount < mComposerClient->getVsyncIdleCount()) { + EXPECT_GE(mComposerClient->getVsyncIdleTime(), earlyVsyncIdleTime); } - EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk()); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk()); } GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest); -- GitLab From dcecfd46a1723b58f59b5a77028cc06aab345048 Mon Sep 17 00:00:00 2001 From: ramindani Date: Thu, 3 Feb 2022 23:52:19 +0000 Subject: [PATCH 587/825] Use Wrapper in the readback tests. BUG: 199413815 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I3a7e81f8c04971b178ae703a3eb83de50ae0810f --- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 856 +++++++++--------- .../functional/composer-vts/ReadbackVts.cpp | 31 +- .../composer-vts/include/ReadbackVts.h | 28 +- .../composer-vts/include/RenderEngineVts.h | 7 - 4 files changed, 469 insertions(+), 453 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 3f1e703031..45a8f6f359 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -20,14 +20,12 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include @@ -37,6 +35,7 @@ #include #pragma clang diagnostic pop #include "composer-vts/include/GraphicsComposerCallback.h" +#include "composer-vts/include/VtsComposerClient.h" namespace aidl::android::hardware::graphics::composer3::vts { namespace { @@ -48,40 +47,25 @@ using common::PixelFormat; class GraphicsCompositionTestBase : public ::testing::Test { protected: void SetUpBase(const std::string& name) { - ndk::SpAIBinder binder(AServiceManager_waitForService(name.c_str())); - ASSERT_NE(binder, nullptr); - ASSERT_NO_FATAL_FAILURE(mComposer = IComposer::fromBinder(binder)); - ASSERT_NE(mComposer, nullptr); - ASSERT_NO_FATAL_FAILURE(mComposer->createClient(&mComposerClient)); - mComposerCallback = ::ndk::SharedRefBase::make(); - mComposerClient->registerCallback(mComposerCallback); + mComposerClient = std::make_shared(name); + ASSERT_TRUE(mComposerClient->createClient().isOk()); - // assume the first display is primary and is never removed - mPrimaryDisplay = waitForFirstDisplay(); - - ASSERT_NO_FATAL_FAILURE(mInvalidDisplayId = GetInvalidDisplayId()); - - int32_t activeConfig; - EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &activeConfig).isOk()); - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(mPrimaryDisplay, activeConfig, - DisplayAttribute::WIDTH, &mDisplayWidth) - .isOk()); - EXPECT_TRUE(mComposerClient - ->getDisplayAttribute(mPrimaryDisplay, activeConfig, - DisplayAttribute::HEIGHT, &mDisplayHeight) - .isOk()); + const auto& [status, displays] = mComposerClient->getDisplays(); + ASSERT_TRUE(status.isOk()); + mDisplays = displays; setTestColorModes(); // explicitly disable vsync - EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, false).isOk()); - mComposerCallback->setVsyncAllowed(false); + for (const auto& display : mDisplays) { + EXPECT_TRUE(mComposerClient->setVsync(display.getDisplayId(), /*enable*/ false).isOk()); + } + mComposerClient->setVsyncAllowed(/*isAllowed*/ false); // set up gralloc mGraphicBuffer = allocate(); - ASSERT_NO_FATAL_FAILURE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON)); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk()); ASSERT_NO_FATAL_FAILURE( mTestRenderEngine = std::unique_ptr(new TestRenderEngine( @@ -96,11 +80,12 @@ class GraphicsCompositionTestBase : public ::testing::Test { .build()))); ::android::renderengine::DisplaySettings clientCompositionDisplay; - clientCompositionDisplay.physicalDisplay = Rect(mDisplayWidth, mDisplayHeight); + clientCompositionDisplay.physicalDisplay = Rect(getDisplayWidth(), getDisplayHeight()); clientCompositionDisplay.clip = clientCompositionDisplay.physicalDisplay; mTestRenderEngine->initGraphicBuffer( - static_cast(mDisplayWidth), static_cast(mDisplayHeight), 1, + static_cast(getDisplayWidth()), static_cast(getDisplayHeight()), + /*layerCount*/ 1U, static_cast( static_cast(common::BufferUsage::CPU_READ_OFTEN) | static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | @@ -109,21 +94,27 @@ class GraphicsCompositionTestBase : public ::testing::Test { } void TearDown() override { - ASSERT_NO_FATAL_FAILURE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF)); + ASSERT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk()); + ASSERT_TRUE(mComposerClient->tearDown()); + mComposerClient.reset(); const auto errors = mReader.takeErrors(); ASSERT_TRUE(mReader.takeErrors().empty()); - ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()); - - if (mComposerCallback != nullptr) { - EXPECT_EQ(0, mComposerCallback->getInvalidHotplugCount()); - EXPECT_EQ(0, mComposerCallback->getInvalidRefreshCount()); - EXPECT_EQ(0, mComposerCallback->getInvalidVsyncCount()); - } + ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()); } + const VtsDisplay& getPrimaryDisplay() const { return mDisplays[0]; } + + int64_t getPrimaryDisplayId() const { return getPrimaryDisplay().getDisplayId(); } + + int64_t getInvalidDisplayId() const { return mComposerClient->getInvalidDisplayId(); } + + int32_t getDisplayWidth() const { return getPrimaryDisplay().getDisplayWidth(); } + + int32_t getDisplayHeight() const { return getPrimaryDisplay().getDisplayHeight(); } + ::android::sp<::android::GraphicBuffer> allocate() { - const auto width = static_cast(mDisplayWidth); - const auto height = static_cast(mDisplayHeight); + const auto width = static_cast(getDisplayWidth()); + const auto height = static_cast(getDisplayHeight()); const auto usage = static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | static_cast(common::BufferUsage::CPU_READ_OFTEN); @@ -133,9 +124,9 @@ class GraphicsCompositionTestBase : public ::testing::Test { } uint64_t getStableDisplayId(int64_t display) { - DisplayIdentification identification; - const auto error = mComposerClient->getDisplayIdentificationData(display, &identification); - EXPECT_TRUE(error.isOk()); + const auto& [status, identification] = + mComposerClient->getDisplayIdentificationData(display); + EXPECT_TRUE(status.isOk()); if (const auto info = ::android::parseDisplayIdentificationData( static_cast(identification.port), identification.data)) { @@ -203,7 +194,7 @@ class GraphicsCompositionTestBase : public ::testing::Test { } void writeLayers(const std::vector>& layers) { - for (auto layer : layers) { + for (const auto& layer : layers) { layer->write(mWriter); } execute(); @@ -216,59 +207,42 @@ class GraphicsCompositionTestBase : public ::testing::Test { return; } - std::vector results; - auto status = mComposerClient->executeCommands(commands, &results); + auto [status, results] = mComposerClient->executeCommands(commands); ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); mReader.parse(std::move(results)); mWriter.reset(); } - bool getHasReadbackBuffer() { - ReadbackBufferAttributes readBackBufferAttributes; - const auto error = mComposerClient->getReadbackBufferAttributes(mPrimaryDisplay, - &readBackBufferAttributes); - mPixelFormat = readBackBufferAttributes.format; - mDataspace = readBackBufferAttributes.dataspace; - return error.isOk() && ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); + std::pair getHasReadbackBuffer() { + auto [status, readBackBufferAttributes] = + mComposerClient->getReadbackBufferAttributes(getPrimaryDisplayId()); + if (status.isOk()) { + mPixelFormat = readBackBufferAttributes.format; + mDataspace = readBackBufferAttributes.dataspace; + return {std::move(status), ReadbackHelper::readbackSupported(mPixelFormat, mDataspace)}; + } + return {std::move(status), false}; } - std::shared_ptr mComposer; - std::shared_ptr mComposerClient; - - std::shared_ptr mComposerCallback; - // the first display and is assumed never to be removed - int64_t mPrimaryDisplay; - int64_t mInvalidDisplayId; - int32_t mDisplayWidth; - int32_t mDisplayHeight; + std::shared_ptr mComposerClient; + std::vector mDisplays; + // use the slot count usually set by SF std::vector mTestColorModes; ComposerClientWriter mWriter; ComposerClientReader mReader; ::android::sp<::android::GraphicBuffer> mGraphicBuffer; std::unique_ptr mTestRenderEngine; - common::PixelFormat mPixelFormat; common::Dataspace mDataspace; static constexpr uint32_t kClientTargetSlotCount = 64; private: - int64_t waitForFirstDisplay() { - while (true) { - std::vector displays = mComposerCallback->getDisplays(); - if (displays.empty()) { - usleep(5 * 1000); - continue; - } - return displays[0]; - } - } - void setTestColorModes() { mTestColorModes.clear(); - std::vector modes; - EXPECT_TRUE(mComposerClient->getColorModes(mPrimaryDisplay, &modes).isOk()); + const auto& [status, modes] = mComposerClient->getColorModes(getPrimaryDisplayId()); + ASSERT_TRUE(status.isOk()); for (ColorMode mode : modes) { if (std::find(ReadbackHelper::colorModes.begin(), ReadbackHelper::colorModes.end(), @@ -277,27 +251,6 @@ class GraphicsCompositionTestBase : public ::testing::Test { } } } - - // returns an invalid display id (one that has not been registered to a - // display. Currently assuming that a device will never have close to - // std::numeric_limit::max() displays registered while running tests - int64_t GetInvalidDisplayId() { - int64_t id = std::numeric_limits::max(); - std::vector displays = mComposerCallback->getDisplays(); - while (id > 0) { - if (std::none_of(displays.begin(), displays.end(), - [&](const auto& display) { return id == display; })) { - return id; - } - id--; - } - - // Although 0 could be an invalid display, a return value of 0 - // from GetInvalidDisplayId means all other ids are in use, a condition which - // we are assuming a device will never have - EXPECT_NE(0, id); - return id; - } }; class GraphicsCompositionTest : public GraphicsCompositionTestBase, @@ -308,16 +261,19 @@ class GraphicsCompositionTest : public GraphicsCompositionTestBase, TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { for (ColorMode mode : mTestColorModes) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - auto layer = std::make_shared(mComposerClient, mPrimaryDisplay); - common::Rect coloredSquare({0, 0, mDisplayWidth, mDisplayHeight}); + auto layer = std::make_shared(mComposerClient, getPrimaryDisplayId()); + common::Rect coloredSquare({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setColor(BLUE); layer->setDisplayFrame(coloredSquare); layer->setZOrder(10); @@ -325,25 +281,26 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { std::vector> layers = {layer}; // expected color for each pixel - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, coloredSquare, BLUE); + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), coloredSquare, BLUE); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); // if hwc cannot handle and asks for composition change, // just succeed the test - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -356,31 +313,35 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { TEST_P(GraphicsCompositionTest, SetLayerBuffer) { for (ColorMode mode : mTestColorModes) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, - {0, 0, mDisplayWidth, mDisplayHeight / 4}, RED); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, - {0, mDisplayHeight / 4, mDisplayWidth, mDisplayHeight / 2}, - GREEN); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, - {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, - BLUE); + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), + {0, 0, getDisplayWidth(), getDisplayHeight() / 4}, RED); + ReadbackHelper::fillColorsArea( + expectedColors, getDisplayWidth(), + {0, getDisplayHeight() / 4, getDisplayWidth(), getDisplayHeight() / 2}, GREEN); + ReadbackHelper::fillColorsArea( + expectedColors, getDisplayWidth(), + {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE); auto layer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, common::PixelFormat::RGBA_8888); - layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), + getDisplayWidth(), getDisplayHeight(), common::PixelFormat::RGBA_8888); + layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors)); @@ -389,16 +350,16 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -412,16 +373,19 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { for (ColorMode mode : mTestColorModes) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - auto layer = std::make_shared(mComposerClient, mPrimaryDisplay); - common::Rect coloredSquare({0, 0, mDisplayWidth, mDisplayHeight}); + auto layer = std::make_shared(mComposerClient, getPrimaryDisplayId()); + common::Rect coloredSquare({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setColor(BLUE); layer->setDisplayFrame(coloredSquare); layer->setZOrder(10); @@ -432,28 +396,31 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { static_cast(static_cast(common::BufferUsage::CPU_READ_OFTEN) | static_cast(common::BufferUsage::CPU_WRITE_OFTEN)); - mGraphicBuffer->reallocate(static_cast(mDisplayWidth), - static_cast(mDisplayHeight), 1, + mGraphicBuffer->reallocate(static_cast(getDisplayWidth()), + static_cast(getDisplayHeight()), 1, static_cast(common::PixelFormat::RGBA_8888), usage); - mWriter.setLayerBuffer(mPrimaryDisplay, layer->getLayer(), 0, mGraphicBuffer->handle, -1); + mWriter.setLayerBuffer(getPrimaryDisplayId(), layer->getLayer(), /*slot*/ 0, + mGraphicBuffer->handle, + /*acquireFence*/ -1); // expected color for each pixel - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, coloredSquare, BLUE); + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), coloredSquare, BLUE); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -462,111 +429,118 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { } TEST_P(GraphicsCompositionTest, SetReadbackBuffer) { - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, - mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); } -TEST_P(GraphicsCompositionTest, SetReadbackBufferBadDisplay) { - if (!getHasReadbackBuffer()) { +TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadDisplay) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } ASSERT_NE(nullptr, mGraphicBuffer); ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck()); - aidl::android::hardware::common::NativeHandle bufferHandle = - ::android::dupToAidl(mGraphicBuffer->handle); + const auto& bufferHandle = mGraphicBuffer->handle; ::ndk::ScopedFileDescriptor fence = ::ndk::ScopedFileDescriptor(-1); - const auto error = mComposerClient->setReadbackBuffer(mInvalidDisplayId, bufferHandle, fence); + const auto status = + mComposerClient->setReadbackBuffer(getInvalidDisplayId(), bufferHandle, fence); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); } -TEST_P(GraphicsCompositionTest, SetReadbackBufferBadParameter) { - if (!getHasReadbackBuffer()) { +TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadParameter) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - aidl::android::hardware::common::NativeHandle bufferHandle; - { - ::android::sp<::android::GraphicBuffer> buffer = allocate(); - ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck()); - ::android::makeToAidl(mGraphicBuffer->handle); - } - + const native_handle_t bufferHandle{}; ndk::ScopedFileDescriptor releaseFence = ndk::ScopedFileDescriptor(-1); - const auto error = - mComposerClient->setReadbackBuffer(mPrimaryDisplay, bufferHandle, releaseFence); + const auto status = + mComposerClient->setReadbackBuffer(getPrimaryDisplayId(), &bufferHandle, releaseFence); - EXPECT_FALSE(error.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); } TEST_P(GraphicsCompositionTest, GetReadbackBufferFenceInactive) { - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - ndk::ScopedFileDescriptor releaseFence; - const auto error = mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &releaseFence); + const auto& [status, releaseFence] = + mComposerClient->getReadbackBufferFence(getPrimaryDisplayId()); - ASSERT_FALSE(error.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError()); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); EXPECT_EQ(-1, releaseFence.get()); } TEST_P(GraphicsCompositionTest, ClientComposition) { - EXPECT_TRUE(mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kClientTargetSlotCount) - .isOk()); + EXPECT_TRUE( + mComposerClient->setClientTargetSlotCount(getPrimaryDisplayId(), kClientTargetSlotCount) + .isOk()); for (ColorMode mode : mTestColorModes) { - EXPECT_TRUE(mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC) + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, - {0, 0, mDisplayWidth, mDisplayHeight / 4}, RED); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, - {0, mDisplayHeight / 4, mDisplayWidth, mDisplayHeight / 2}, - GREEN); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, - {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, - BLUE); + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), + {0, 0, getDisplayWidth(), getDisplayHeight() / 4}, RED); + ReadbackHelper::fillColorsArea( + expectedColors, getDisplayWidth(), + {0, getDisplayHeight() / 4, getDisplayWidth(), getDisplayHeight() / 2}, GREEN); + ReadbackHelper::fillColorsArea( + expectedColors, getDisplayWidth(), + {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE); auto layer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, PixelFormat::RGBA_FP16); - layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), + getDisplayWidth(), getDisplayHeight(), PixelFormat::RGBA_FP16); + layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); std::vector> layers = {layer}; - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - auto changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay); + auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId()); if (!changedCompositionTypes.empty()) { ASSERT_EQ(1, changedCompositionTypes.size()); ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition); @@ -577,7 +551,7 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | static_cast(common::BufferUsage::COMPOSER_CLIENT_TARGET)); Dataspace clientDataspace = ReadbackHelper::getDataspaceForColorMode(mode); - common::Rect damage{0, 0, mDisplayWidth, mDisplayHeight}; + common::Rect damage{0, 0, getDisplayWidth(), getDisplayHeight()}; // create client target buffer mGraphicBuffer->reallocate(layer->getWidth(), layer->getHeight(), @@ -595,21 +569,22 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { clientBufData, clientFormat, expectedColors)); EXPECT_EQ(::android::OK, mGraphicBuffer->unlock()); - ndk::ScopedFileDescriptor fenceHandle; - EXPECT_TRUE( - mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fenceHandle).isOk()); + const auto& [status, bufferFence] = + mComposerClient->getReadbackBufferFence(getPrimaryDisplayId()); + EXPECT_TRUE(status.isOk()); layer->setToClientComposition(mWriter); - mWriter.acceptDisplayChanges(mPrimaryDisplay); - mWriter.setClientTarget(mPrimaryDisplay, 0, mGraphicBuffer->handle, fenceHandle.get(), - clientDataspace, std::vector(1, damage)); + mWriter.acceptDisplayChanges(getPrimaryDisplayId()); + mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, mGraphicBuffer->handle, + bufferFence.get(), clientDataspace, + std::vector(1, damage)); execute(); - changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay); + changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId()); ASSERT_TRUE(changedCompositionTypes.empty()); } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -619,31 +594,37 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { } TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kClientTargetSlotCount)); + ASSERT_TRUE( + mComposerClient->setClientTargetSlotCount(getPrimaryDisplayId(), kClientTargetSlotCount) + .isOk()); for (ColorMode mode : mTestColorModes) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, - {0, 0, mDisplayWidth, mDisplayHeight / 2}, GREEN); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, - {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, RED); + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), + {0, 0, getDisplayWidth(), getDisplayHeight() / 2}, GREEN); + ReadbackHelper::fillColorsArea( + expectedColors, getDisplayWidth(), + {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, RED); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); auto deviceLayer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight / 2, PixelFormat::RGBA_8888); + mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), + getDisplayWidth(), getDisplayHeight() / 2, PixelFormat::RGBA_8888); std::vector deviceColors(deviceLayer->getWidth() * deviceLayer->getHeight()); ReadbackHelper::fillColorsArea(deviceColors, static_cast(deviceLayer->getWidth()), {0, 0, static_cast(deviceLayer->getWidth()), @@ -662,54 +643,59 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | static_cast(common::BufferUsage::COMPOSER_CLIENT_TARGET)); Dataspace clientDataspace = ReadbackHelper::getDataspaceForColorMode(mode); - int32_t clientWidth = mDisplayWidth; - int32_t clientHeight = mDisplayHeight / 2; + int32_t clientWidth = getDisplayWidth(); + int32_t clientHeight = getDisplayHeight() / 2; auto clientLayer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, clientWidth, - clientHeight, PixelFormat::RGBA_FP16, Composition::DEVICE); - common::Rect clientFrame = {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}; + mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), + clientWidth, clientHeight, PixelFormat::RGBA_FP16, Composition::DEVICE); + common::Rect clientFrame = {0, getDisplayHeight() / 2, getDisplayWidth(), + getDisplayHeight()}; clientLayer->setDisplayFrame(clientFrame); clientLayer->setZOrder(0); clientLayer->write(mWriter); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - auto changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay); + auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId()); if (changedCompositionTypes.size() != 1) { continue; } // create client target buffer ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition); - mGraphicBuffer->reallocate(static_cast(mDisplayWidth), - static_cast(mDisplayHeight), + mGraphicBuffer->reallocate(static_cast(getDisplayWidth()), + static_cast(getDisplayHeight()), static_cast(common::PixelFormat::RGBA_8888), clientLayer->getLayerCount(), clientUsage); ASSERT_NE(nullptr, mGraphicBuffer->handle); void* clientBufData; - mGraphicBuffer->lock(clientUsage, {0, 0, mDisplayWidth, mDisplayHeight}, &clientBufData); + mGraphicBuffer->lock(clientUsage, {0, 0, getDisplayWidth(), getDisplayHeight()}, + &clientBufData); - std::vector clientColors(static_cast(mDisplayWidth * mDisplayHeight)); - ReadbackHelper::fillColorsArea(clientColors, mDisplayWidth, clientFrame, RED); + std::vector clientColors( + static_cast(getDisplayWidth() * getDisplayHeight())); + ReadbackHelper::fillColorsArea(clientColors, getDisplayWidth(), clientFrame, RED); ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer( - static_cast(mDisplayWidth), static_cast(mDisplayHeight), + static_cast(getDisplayWidth()), static_cast(getDisplayHeight()), mGraphicBuffer->getStride(), clientBufData, clientFormat, clientColors)); EXPECT_EQ(::android::OK, mGraphicBuffer->unlock()); - ndk::ScopedFileDescriptor fenceHandle; - EXPECT_TRUE(mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fenceHandle).isOk()); + const auto& [status, bufferFence] = + mComposerClient->getReadbackBufferFence(getPrimaryDisplayId()); + EXPECT_TRUE(status.isOk()); clientLayer->setToClientComposition(mWriter); - mWriter.acceptDisplayChanges(mPrimaryDisplay); - mWriter.setClientTarget(mPrimaryDisplay, 0, mGraphicBuffer->handle, fenceHandle.get(), - clientDataspace, std::vector(1, clientFrame)); + mWriter.acceptDisplayChanges(getPrimaryDisplayId()); + mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, mGraphicBuffer->handle, + bufferFence.get(), clientDataspace, + std::vector(1, clientFrame)); execute(); - changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay); + changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId()); ASSERT_TRUE(changedCompositionTypes.empty()); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); @@ -718,66 +704,72 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { TEST_P(GraphicsCompositionTest, SetLayerDamage) { for (ColorMode mode : mTestColorModes) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - common::Rect redRect = {0, 0, mDisplayWidth / 4, mDisplayHeight / 4}; + common::Rect redRect = {0, 0, getDisplayWidth() / 4, getDisplayHeight() / 4}; - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED); auto layer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, PixelFormat::RGBA_8888); - layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), + getDisplayWidth(), getDisplayHeight(), PixelFormat::RGBA_8888); + layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors)); std::vector> layers = {layer}; - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); // update surface damage and recheck - redRect = {mDisplayWidth / 4, mDisplayHeight / 4, mDisplayWidth / 2, mDisplayHeight / 2}; - ReadbackHelper::clearColors(expectedColors, mDisplayWidth, mDisplayHeight, mDisplayWidth); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); + redRect = {getDisplayWidth() / 4, getDisplayHeight() / 4, getDisplayWidth() / 2, + getDisplayHeight() / 2}; + ReadbackHelper::clearColors(expectedColors, getDisplayWidth(), getDisplayHeight(), + getDisplayWidth()); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED); ASSERT_NO_FATAL_FAILURE(layer->fillBuffer(expectedColors)); layer->setSurfaceDamage( - std::vector(1, {0, 0, mDisplayWidth / 2, mDisplayWidth / 2})); + std::vector(1, {0, 0, getDisplayWidth() / 2, getDisplayWidth() / 2})); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()); - mWriter.presentDisplay(mPrimaryDisplay); + ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -787,43 +779,47 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) { for (ColorMode mode : mTestColorModes) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - auto layer = std::make_shared(mComposerClient, mPrimaryDisplay); + auto layer = std::make_shared(mComposerClient, getPrimaryDisplayId()); layer->setColor(RED); - layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); layer->setAlpha(0); layer->setBlendMode(BlendMode::PREMULTIPLIED); std::vector> layers = {layer}; - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); mTestRenderEngine->setRenderLayers(layers); @@ -834,50 +830,54 @@ TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) { TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { for (ColorMode mode : mTestColorModes) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, - {0, 0, mDisplayWidth, mDisplayHeight / 4}, RED); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, - {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, - BLUE); + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), + {0, 0, getDisplayWidth(), getDisplayHeight() / 4}, RED); + ReadbackHelper::fillColorsArea( + expectedColors, getDisplayWidth(), + {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE); auto layer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, PixelFormat::RGBA_8888); - layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), + getDisplayWidth(), getDisplayHeight(), PixelFormat::RGBA_8888); + layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); - layer->setSourceCrop({0, static_cast(mDisplayHeight / 2), - static_cast(mDisplayWidth), - static_cast(mDisplayHeight)}); + layer->setSourceCrop({0, static_cast(getDisplayHeight() / 2), + static_cast(getDisplayWidth()), + static_cast(getDisplayHeight())}); ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors)); std::vector> layers = {layer}; // update expected colors to match crop - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, - {0, 0, mDisplayWidth, mDisplayHeight}, BLUE); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), + {0, 0, getDisplayWidth(), getDisplayHeight()}, BLUE); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); @@ -889,67 +889,72 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { TEST_P(GraphicsCompositionTest, SetLayerZOrder) { for (ColorMode mode : mTestColorModes) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - common::Rect redRect = {0, 0, mDisplayWidth, mDisplayHeight / 2}; - common::Rect blueRect = {0, mDisplayHeight / 4, mDisplayWidth, mDisplayHeight}; - auto redLayer = std::make_shared(mComposerClient, mPrimaryDisplay); + common::Rect redRect = {0, 0, getDisplayWidth(), getDisplayHeight() / 2}; + common::Rect blueRect = {0, getDisplayHeight() / 4, getDisplayWidth(), getDisplayHeight()}; + auto redLayer = std::make_shared(mComposerClient, getPrimaryDisplayId()); redLayer->setColor(RED); redLayer->setDisplayFrame(redRect); - auto blueLayer = std::make_shared(mComposerClient, mPrimaryDisplay); + auto blueLayer = std::make_shared(mComposerClient, getPrimaryDisplayId()); blueLayer->setColor(BLUE); blueLayer->setDisplayFrame(blueRect); blueLayer->setZOrder(5); std::vector> layers = {redLayer, blueLayer}; - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); // red in front of blue redLayer->setZOrder(10); // fill blue first so that red will overwrite on overlap - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, blueRect, BLUE); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), blueRect, BLUE); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); redLayer->setZOrder(1); - ReadbackHelper::clearColors(expectedColors, mDisplayWidth, mDisplayHeight, mDisplayWidth); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, blueRect, BLUE); + ReadbackHelper::clearColors(expectedColors, getDisplayWidth(), getDisplayHeight(), + getDisplayWidth()); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), blueRect, BLUE); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()); + ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -961,9 +966,9 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { } TEST_P(GraphicsCompositionTest, SetLayerWhitePointDims) { - std::vector capabilities; - const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities); - ASSERT_TRUE(error.isOk()); + const auto& [status, capabilities] = + mComposerClient->getDisplayCapabilities(getPrimaryDisplayId()); + ASSERT_TRUE(status.isOk()); const bool brightnessSupport = std::find(capabilities.begin(), capabilities.end(), DisplayCapability::BRIGHTNESS) != capabilities.end(); @@ -974,7 +979,7 @@ TEST_P(GraphicsCompositionTest, SetLayerWhitePointDims) { } const std::optional maxBrightnessNitsOptional = - getMaxDisplayBrightnessNits(mPrimaryDisplay); + getMaxDisplayBrightnessNits(getPrimaryDisplayId()); ASSERT_TRUE(maxBrightnessNitsOptional.has_value()); @@ -983,29 +988,34 @@ TEST_P(GraphicsCompositionTest, SetLayerWhitePointDims) { // Preconditions to successfully run are knowing the max brightness and successfully applying // the max brightness ASSERT_GT(maxBrightnessNits, 0.f); - mWriter.setDisplayBrightness(mPrimaryDisplay, 1.f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); for (ColorMode mode : mTestColorModes) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace for " "color mode: " << toString(mode); continue; } - const common::Rect redRect = {0, 0, mDisplayWidth, mDisplayHeight / 2}; - const common::Rect dimmerRedRect = {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}; - const auto redLayer = std::make_shared(mComposerClient, mPrimaryDisplay); + const common::Rect redRect = {0, 0, getDisplayWidth(), getDisplayHeight() / 2}; + const common::Rect dimmerRedRect = {0, getDisplayHeight() / 2, getDisplayWidth(), + getDisplayHeight()}; + const auto redLayer = + std::make_shared(mComposerClient, getPrimaryDisplayId()); redLayer->setColor(RED); redLayer->setDisplayFrame(redRect); redLayer->setWhitePointNits(maxBrightnessNits); const auto dimmerRedLayer = - std::make_shared(mComposerClient, mPrimaryDisplay); + std::make_shared(mComposerClient, getPrimaryDisplayId()); dimmerRedLayer->setColor(RED); dimmerRedLayer->setDisplayFrame(dimmerRedRect); // Intentionally use a small dimming ratio as some implementations may be more likely to @@ -1014,26 +1024,27 @@ TEST_P(GraphicsCompositionTest, SetLayerWhitePointDims) { dimmerRedLayer->setWhitePointNits(maxBrightnessNits * kDimmingRatio); const std::vector> layers = {redLayer, dimmerRedLayer}; - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, dimmerRedRect, DIM_RED); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), dimmerRedRect, DIM_RED); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED() << "Readback verification not supported for GPU composition for color mode: " << toString(mode); continue; } - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -1060,19 +1071,22 @@ class GraphicsBlendModeCompositionTest void setUpLayers(BlendMode blendMode) { mLayers.clear(); - std::vector topLayerPixelColors(static_cast(mDisplayWidth * mDisplayHeight)); - ReadbackHelper::fillColorsArea(topLayerPixelColors, mDisplayWidth, - {0, 0, mDisplayWidth, mDisplayHeight}, mTopLayerColor); - - auto backgroundLayer = std::make_shared(mComposerClient, mPrimaryDisplay); - backgroundLayer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + std::vector topLayerPixelColors( + static_cast(getDisplayWidth() * getDisplayHeight())); + ReadbackHelper::fillColorsArea(topLayerPixelColors, getDisplayWidth(), + {0, 0, getDisplayWidth(), getDisplayHeight()}, + mTopLayerColor); + + auto backgroundLayer = + std::make_shared(mComposerClient, getPrimaryDisplayId()); + backgroundLayer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); backgroundLayer->setZOrder(0); backgroundLayer->setColor(mBackgroundColor); auto layer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, PixelFormat::RGBA_8888); - layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), + getDisplayWidth(), getDisplayHeight(), PixelFormat::RGBA_8888); + layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); layer->setDataspace(Dataspace::UNKNOWN, mWriter); ASSERT_NO_FATAL_FAILURE(layer->setBuffer(topLayerPixelColors)); @@ -1086,7 +1100,8 @@ class GraphicsBlendModeCompositionTest void setExpectedColors(std::vector& expectedColors) { ASSERT_EQ(2, mLayers.size()); - ReadbackHelper::clearColors(expectedColors, mDisplayWidth, mDisplayHeight, mDisplayWidth); + ReadbackHelper::clearColors(expectedColors, getDisplayWidth(), getDisplayHeight(), + getDisplayWidth()); auto layer = mLayers[1]; BlendMode blendMode = layer->getBlendMode(); @@ -1126,34 +1141,38 @@ class GraphicsBlendModeCompositionTest TEST_P(GraphicsBlendModeCompositionTest, None) { for (ColorMode mode : mTestColorModes) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); setBackgroundColor(BLACK); setTopLayerColor(TRANSLUCENT_RED); setUpLayers(BlendMode::NONE); setExpectedColors(expectedColors); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -1166,15 +1185,19 @@ TEST_P(GraphicsBlendModeCompositionTest, None) { TEST_P(GraphicsBlendModeCompositionTest, Coverage) { for (ColorMode mode : mTestColorModes) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); setBackgroundColor(BLACK); setTopLayerColor(TRANSLUCENT_RED); @@ -1182,19 +1205,19 @@ TEST_P(GraphicsBlendModeCompositionTest, Coverage) { setUpLayers(BlendMode::COVERAGE); setExpectedColors(expectedColors); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); @@ -1203,34 +1226,38 @@ TEST_P(GraphicsBlendModeCompositionTest, Coverage) { TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) { for (ColorMode mode : mTestColorModes) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); setBackgroundColor(BLACK); setTopLayerColor(TRANSLUCENT_RED); setUpLayers(BlendMode::PREMULTIPLIED); setExpectedColors(expectedColors); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); @@ -1245,18 +1272,20 @@ class GraphicsTransformCompositionTest : public GraphicsCompositionTest { void SetUp() override { GraphicsCompositionTest::SetUp(); - auto backgroundLayer = std::make_shared(mComposerClient, mPrimaryDisplay); + auto backgroundLayer = + std::make_shared(mComposerClient, getPrimaryDisplayId()); backgroundLayer->setColor({0.0f, 0.0f, 0.0f, 0.0f}); - backgroundLayer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); + backgroundLayer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); backgroundLayer->setZOrder(0); - mSideLength = mDisplayWidth < mDisplayHeight ? mDisplayWidth : mDisplayHeight; + mSideLength = + getDisplayWidth() < getDisplayHeight() ? getDisplayWidth() : getDisplayHeight(); common::Rect redRect = {0, 0, mSideLength / 2, mSideLength / 2}; common::Rect blueRect = {mSideLength / 2, mSideLength / 2, mSideLength, mSideLength}; - mLayer = std::make_shared(mComposerClient, mGraphicBuffer, - *mTestRenderEngine, mPrimaryDisplay, mSideLength, - mSideLength, PixelFormat::RGBA_8888); + mLayer = std::make_shared( + mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), + mSideLength, mSideLength, PixelFormat::RGBA_8888); mLayer->setDisplayFrame({0, 0, mSideLength, mSideLength}); mLayer->setZOrder(10); @@ -1275,41 +1304,44 @@ class GraphicsTransformCompositionTest : public GraphicsCompositionTest { TEST_P(GraphicsTransformCompositionTest, FLIP_H) { for (ColorMode mode : mTestColorModes) { - auto error = - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC); - if (!error.isOk() && - (error.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED || - error.getServiceSpecificError() == IComposerClient::EX_BAD_PARAMETER)) { + auto status = mComposerClient->setColorMode(getPrimaryDisplayId(), mode, + RenderIntent::COLORIMETRIC); + if (!status.isOk() && + (status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED || + status.getServiceSpecificError() == IComposerClient::EX_BAD_PARAMETER)) { SUCCEED() << "ColorMode not supported, skip test"; return; } - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); mLayer->setTransform(Transform::FLIP_H); mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), {mSideLength / 2, 0, mSideLength, mSideLength / 2}, RED); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), {0, mSideLength / 2, mSideLength / 2, mSideLength}, BLUE); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); @@ -1322,36 +1354,40 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { TEST_P(GraphicsTransformCompositionTest, FLIP_V) { for (ColorMode mode : mTestColorModes) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); mLayer->setTransform(Transform::FLIP_V); mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), {0, mSideLength / 2, mSideLength / 2, mSideLength}, RED); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), {mSideLength / 2, 0, mSideLength, mSideLength / 2}, BLUE); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); @@ -1363,37 +1399,41 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) { TEST_P(GraphicsTransformCompositionTest, ROT_180) { for (ColorMode mode : mTestColorModes) { - ASSERT_NO_FATAL_FAILURE( - mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)); + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); - if (!getHasReadbackBuffer()) { + const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); + EXPECT_TRUE(readbackStatus.isOk()); + if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, - mDisplayHeight, mPixelFormat, mDataspace); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); mLayer->setTransform(Transform::ROT_180); mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); - std::vector expectedColors(static_cast(mDisplayWidth * mDisplayHeight)); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + std::vector expectedColors( + static_cast(getDisplayWidth() * getDisplayHeight())); + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), {mSideLength / 2, mSideLength / 2, mSideLength, mSideLength}, RED); - ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, + ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), {0, 0, mSideLength / 2, mSideLength / 2}, BLUE); writeLayers(mLayers); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); - if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) { + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { GTEST_SUCCEED(); return; } ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.presentDisplay(mPrimaryDisplay); + mWriter.presentDisplay(getPrimaryDisplayId()); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors)); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp index 587c523d19..1aca76f3c8 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp @@ -14,19 +14,12 @@ * limitations under the License. */ -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wconversion" - #include "include/ReadbackVts.h" #include #include "include/RenderEngineVts.h" #include "renderengine/ExternalTexture.h" #include "renderengine/impl/ExternalTexture.h" -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic pop // ignored "-Wconversion - namespace aidl::android::hardware::graphics::composer3::vts { const std::vector ReadbackHelper::colorModes = {ColorMode::SRGB, ColorMode::DISPLAY_P3}; @@ -195,13 +188,12 @@ void ReadbackHelper::compareColorBuffers(const std::vector& expectedColor } } -ReadbackBuffer::ReadbackBuffer(int64_t display, const std::shared_ptr& client, +ReadbackBuffer::ReadbackBuffer(int64_t display, const std::shared_ptr& client, int32_t width, int32_t height, common::PixelFormat pixelFormat, - common::Dataspace dataspace) { + common::Dataspace dataspace) + : mComposerClient(client) { mDisplay = display; - mComposerClient = client; - mPixelFormat = pixelFormat; mDataspace = dataspace; @@ -227,23 +219,22 @@ void ReadbackBuffer::setReadbackBuffer() { mGraphicBuffer = allocate(); ASSERT_NE(nullptr, mGraphicBuffer); ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck()); - aidl::android::hardware::common::NativeHandle bufferHandle = - ::android::dupToAidl(mGraphicBuffer->handle); + const auto& bufferHandle = mGraphicBuffer->handle; ::ndk::ScopedFileDescriptor fence = ::ndk::ScopedFileDescriptor(-1); EXPECT_TRUE(mComposerClient->setReadbackBuffer(mDisplay, bufferHandle, fence).isOk()); } -void ReadbackBuffer::checkReadbackBuffer(std::vector expectedColors) { +void ReadbackBuffer::checkReadbackBuffer(const std::vector& expectedColors) { ASSERT_NE(nullptr, mGraphicBuffer); // lock buffer for reading - ndk::ScopedFileDescriptor fenceHandle; - EXPECT_TRUE(mComposerClient->getReadbackBufferFence(mDisplay, &fenceHandle).isOk()); + const auto& [fenceStatus, bufferFence] = mComposerClient->getReadbackBufferFence(mDisplay); + EXPECT_TRUE(fenceStatus.isOk()); int bytesPerPixel = -1; int bytesPerStride = -1; void* bufData = nullptr; - auto status = mGraphicBuffer->lockAsync(mUsage, mAccessRegion, &bufData, dup(fenceHandle.get()), + auto status = mGraphicBuffer->lockAsync(mUsage, mAccessRegion, &bufData, dup(bufferFence.get()), &bytesPerPixel, &bytesPerStride); EXPECT_EQ(::android::OK, status); ASSERT_TRUE(mPixelFormat == PixelFormat::RGB_888 || mPixelFormat == PixelFormat::RGBA_8888); @@ -270,7 +261,7 @@ LayerSettings TestColorLayer::toRenderEngineLayerSettings() { return layerSettings; } -TestBufferLayer::TestBufferLayer(const std::shared_ptr& client, +TestBufferLayer::TestBufferLayer(const std::shared_ptr& client, const ::android::sp<::android::GraphicBuffer>& graphicBuffer, TestRenderEngine& renderEngine, int64_t display, uint32_t width, uint32_t height, common::PixelFormat format, @@ -318,8 +309,8 @@ LayerSettings TestBufferLayer::toRenderEngineLayerSettings() { const float translateY = mSourceCrop.top / (static_cast(mHeight)); layerSettings.source.buffer.textureTransform = - ::android::mat4::translate(::android::vec4(translateX, translateY, 0, 1.0)) * - ::android::mat4::scale(::android::vec4(scaleX, scaleY, 1.0, 1.0)); + ::android::mat4::translate(::android::vec4(translateX, translateY, 0.0f, 1.0f)) * + ::android::mat4::scale(::android::vec4(scaleX, scaleY, 1.0f, 1.0f)); return layerSettings; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h index da2e5c140d..7135dcae77 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h @@ -16,10 +16,6 @@ #pragma once -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wconversion" - #include #include #include @@ -31,9 +27,6 @@ #include "GraphicsComposerCallback.h" #include "VtsComposerClient.h" -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic pop // ignored "-Wconversion - namespace aidl::android::hardware::graphics::composer3::vts { using ::android::renderengine::LayerSettings; @@ -56,9 +49,11 @@ class TestRenderEngine; class TestLayer { public: - TestLayer(const std::shared_ptr& client, int64_t display) - : mDisplay(display), mComposerClient(client) { - client->createLayer(display, kBufferSlotCount, &mLayer); + TestLayer(const std::shared_ptr& client, int64_t display) + : mDisplay(display) { + const auto& [status, layer] = client->createLayer(display, kBufferSlotCount); + EXPECT_TRUE(status.isOk()); + mLayer = layer; } // ComposerClient will take care of destroying layers, no need to explicitly @@ -103,14 +98,11 @@ class TestLayer { float mAlpha = 1.0; BlendMode mBlendMode = BlendMode::NONE; uint32_t mZOrder = 0; - - private: - std::shared_ptr const mComposerClient; }; class TestColorLayer : public TestLayer { public: - TestColorLayer(const std::shared_ptr& client, int64_t display) + TestColorLayer(const std::shared_ptr& client, int64_t display) : TestLayer{client, display} {} void write(ComposerClientWriter& writer) override; @@ -125,7 +117,7 @@ class TestColorLayer : public TestLayer { class TestBufferLayer : public TestLayer { public: - TestBufferLayer(const std::shared_ptr& client, + TestBufferLayer(const std::shared_ptr& client, const ::android::sp<::android::GraphicBuffer>& graphicBuffer, TestRenderEngine& renderEngine, int64_t display, uint32_t width, uint32_t height, common::PixelFormat format, @@ -195,12 +187,12 @@ class ReadbackHelper { class ReadbackBuffer { public: - ReadbackBuffer(int64_t display, const std::shared_ptr& client, int32_t width, + ReadbackBuffer(int64_t display, const std::shared_ptr& client, int32_t width, int32_t height, common::PixelFormat pixelFormat, common::Dataspace dataspace); void setReadbackBuffer(); - void checkReadbackBuffer(std::vector expectedColors); + void checkReadbackBuffer(const std::vector& expectedColors); ::android::sp<::android::GraphicBuffer> allocate(); @@ -213,7 +205,7 @@ class ReadbackBuffer { Dataspace mDataspace; int64_t mDisplay; ::android::sp<::android::GraphicBuffer> mGraphicBuffer; - std::shared_ptr mComposerClient; + std::shared_ptr mComposerClient; ::android::Rect mAccessRegion; native_handle_t mBufferHandle; }; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h index 4afac681e7..43d3a42808 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h @@ -15,10 +15,6 @@ */ #pragma once -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wconversion" - #include #include #include @@ -31,9 +27,6 @@ #include #include "ReadbackVts.h" -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic pop // ignored "-Wconversion - namespace aidl::android::hardware::graphics::composer3::vts { using ::android::hardware::graphics::mapper::V2_1::IMapper; -- GitLab From 8bb4ce13a27a5f06dda2615aa52babf2aef7ccc9 Mon Sep 17 00:00:00 2001 From: ramindani Date: Tue, 8 Feb 2022 03:02:33 +0000 Subject: [PATCH 588/825] Remove test `GetDisplayAttributeConfigsInAGroupDifferOnlyByVsyncPeriod` The test is removed from aosp so won't be required in HWC3.0 BUG: 200184776 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I21f0ccf94d1d92a730a41b579bf111fa0553f609 --- .../VtsHalGraphicsComposer3_TargetTest.cpp | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 359282ede9..404b548dbf 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -457,53 +457,6 @@ TEST_P(GraphicsComposerAidlTest, CheckConfigsAreValid) { } } -TEST_P(GraphicsComposerAidlTest, GetDisplayAttributeConfigsInAGroupDifferOnlyByVsyncPeriod) { - struct Resolution { - int32_t width; - int32_t height; - }; - struct Dpi { - int32_t x; - int32_t y; - }; - for (VtsDisplay display : mDisplays) { - const auto& [status, configs] = mComposerClient->getDisplayConfigs(display.getDisplayId()); - EXPECT_TRUE(status.isOk()); - std::unordered_map configGroupToResolutionMap; - std::unordered_map configGroupToDpiMap; - for (const auto& config : configs) { - const auto displayConfigGroup = display.getDisplayConfig(config); - - int32_t configGroup = displayConfigGroup.configGroup; - int32_t width = display.getDisplayWidth(); - int32_t height = display.getDisplayHeight(); - - if (configGroupToResolutionMap.find(configGroup) == configGroupToResolutionMap.end()) { - configGroupToResolutionMap[configGroup] = {width, height}; - } - EXPECT_EQ(configGroupToResolutionMap[configGroup].width, width); - EXPECT_EQ(configGroupToResolutionMap[configGroup].height, height); - - const auto& [dpiXStatus, dpiX] = mComposerClient->getDisplayAttribute( - display.getDisplayId(), config, DisplayAttribute::DPI_X); - EXPECT_TRUE(dpiXStatus.isOk()); - - const auto& [dpiYStatus, dpiY] = mComposerClient->getDisplayAttribute( - display.getDisplayId(), config, DisplayAttribute::DPI_Y); - EXPECT_TRUE(dpiYStatus.isOk()); - if (dpiX == -1 && dpiY == -1) { - continue; - } - - if (configGroupToDpiMap.find(configGroup) == configGroupToDpiMap.end()) { - configGroupToDpiMap[configGroup] = {dpiX, dpiY}; - } - EXPECT_EQ(configGroupToDpiMap[configGroup].x, dpiX); - EXPECT_EQ(configGroupToDpiMap[configGroup].y, dpiY); - } - } -} - TEST_P(GraphicsComposerAidlTest, GetDisplayVsyncPeriod_BadDisplay) { const auto& [status, vsyncPeriodNanos] = mComposerClient->getDisplayVsyncPeriod(getInvalidDisplayId()); -- GitLab From 7f620e3a86624b3d2db9549d2189b714f2280654 Mon Sep 17 00:00:00 2001 From: Ahmed ElArabawy Date: Fri, 4 Feb 2022 09:12:46 -0800 Subject: [PATCH 589/825] Wifi: add maximum channel bandwidth limit to softAp This commit adds the maximum bandwidth limit on softAp connection. Bug: 215120219 Test: VTS test Change-Id: Ic364ad13ec2787080f99479e00bce5aacf88022d --- .../android/hardware/wifi/hostapd/ApInfo.aidl | 2 +- .../{Bandwidth.aidl => ChannelBandwidth.aidl} | 25 +++--- .../hardware/wifi/hostapd/HwModeParams.aidl | 1 + .../android/hardware/wifi/hostapd/ApInfo.aidl | 6 +- .../hardware/wifi/hostapd/Bandwidth.aidl | 37 --------- .../wifi/hostapd/ChannelBandwidth.aidl | 77 +++++++++++++++++++ .../hardware/wifi/hostapd/HwModeParams.aidl | 7 ++ 7 files changed, 102 insertions(+), 53 deletions(-) rename wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/{Bandwidth.aidl => ChannelBandwidth.aidl} (86%) delete mode 100644 wifi/hostapd/aidl/android/hardware/wifi/hostapd/Bandwidth.aidl create mode 100644 wifi/hostapd/aidl/android/hardware/wifi/hostapd/ChannelBandwidth.aidl 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 bdbaadd16e..ca20f377be 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 @@ -37,7 +37,7 @@ parcelable ApInfo { String ifaceName; String apIfaceInstance; int freqMhz; - android.hardware.wifi.hostapd.Bandwidth bandwidth; + android.hardware.wifi.hostapd.ChannelBandwidth channelBandwidth; android.hardware.wifi.hostapd.Generation generation; byte[] apIfaceInstanceMacAddress; } diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Bandwidth.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ChannelBandwidth.aidl similarity index 86% rename from wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Bandwidth.aidl rename to wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ChannelBandwidth.aidl index 4d78640fdb..6c1fd22266 100644 --- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Bandwidth.aidl +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ChannelBandwidth.aidl @@ -33,17 +33,18 @@ package android.hardware.wifi.hostapd; @Backing(type="int") @VintfStability -enum Bandwidth { +enum ChannelBandwidth { BANDWIDTH_INVALID = 0, - BANDWIDTH_20_NOHT = 1, - BANDWIDTH_20 = 2, - BANDWIDTH_40 = 3, - BANDWIDTH_80 = 4, - BANDWIDTH_80P80 = 5, - BANDWIDTH_160 = 6, - BANDWIDTH_320 = 7, - BANDWIDTH_2160 = 8, - BANDWIDTH_4320 = 9, - BANDWIDTH_6480 = 10, - BANDWIDTH_8640 = 11, + BANDWIDTH_AUTO = 1, + BANDWIDTH_20_NOHT = 2, + BANDWIDTH_20 = 3, + BANDWIDTH_40 = 4, + BANDWIDTH_80 = 5, + BANDWIDTH_80P80 = 6, + BANDWIDTH_160 = 7, + BANDWIDTH_320 = 8, + BANDWIDTH_2160 = 9, + BANDWIDTH_4320 = 10, + BANDWIDTH_6480 = 11, + BANDWIDTH_8640 = 12, } diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/HwModeParams.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/HwModeParams.aidl index 8d8d7bb0f6..d732bcbcd8 100644 --- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/HwModeParams.aidl +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/HwModeParams.aidl @@ -44,4 +44,5 @@ parcelable HwModeParams { boolean enableHeTargetWakeTime; boolean enableEdmg; boolean enable80211BE; + android.hardware.wifi.hostapd.ChannelBandwidth maximumChannelBandwidth; } diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl index bf506b296b..a6fe63b50a 100644 --- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl +++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl @@ -16,7 +16,7 @@ package android.hardware.wifi.hostapd; -import android.hardware.wifi.hostapd.Bandwidth; +import android.hardware.wifi.hostapd.ChannelBandwidth; import android.hardware.wifi.hostapd.Generation; /** @@ -44,9 +44,9 @@ parcelable ApInfo { int freqMhz; /** - * The operational bandwidth of the AP. + * The operational channel bandwidth of the AP. */ - Bandwidth bandwidth; + ChannelBandwidth channelBandwidth; /** * The operational mode of the AP (e.g. 11ac, 11ax). diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Bandwidth.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Bandwidth.aidl deleted file mode 100644 index e605153b83..0000000000 --- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Bandwidth.aidl +++ /dev/null @@ -1,37 +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. - */ - -package android.hardware.wifi.hostapd; - -/** - * The channel bandwidth of the AP. - */ -@VintfStability -@Backing(type="int") -enum Bandwidth { - BANDWIDTH_INVALID = 0, - BANDWIDTH_20_NOHT = 1, - BANDWIDTH_20 = 2, - BANDWIDTH_40 = 3, - BANDWIDTH_80 = 4, - BANDWIDTH_80P80 = 5, - BANDWIDTH_160 = 6, - BANDWIDTH_320 = 7, - BANDWIDTH_2160 = 8, - BANDWIDTH_4320 = 9, - BANDWIDTH_6480 = 10, - BANDWIDTH_8640 = 11, -} diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ChannelBandwidth.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ChannelBandwidth.aidl new file mode 100644 index 0000000000..8ea39525ef --- /dev/null +++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ChannelBandwidth.aidl @@ -0,0 +1,77 @@ +/* + * 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. + */ + +package android.hardware.wifi.hostapd; + +/** + * The channel bandwidth of the AP. + */ +@VintfStability +@Backing(type="int") +enum ChannelBandwidth { + /** + * Invalid bandwidth value for AP + */ + BANDWIDTH_INVALID = 0, + /** + * Channel bandwidth is auto-selected by the chip + */ + BANDWIDTH_AUTO = 1, + /** + * AP channel bandwidth is 20 MHz but not HT + */ + BANDWIDTH_20_NOHT = 2, + /** + * AP channel bandwidth is 20 MHz + */ + BANDWIDTH_20 = 3, + /** + * AP channel bandwidth is 40 MHz + */ + BANDWIDTH_40 = 4, + /** + * AP channel bandwidth is 80 MHz + */ + BANDWIDTH_80 = 5, + /** + * AP channel bandwidth is 80+80 MHz + */ + BANDWIDTH_80P80 = 6, + /** + * AP channel bandwidth is 160 MHz + */ + BANDWIDTH_160 = 7, + /** + * AP channel bandwidth is 320 MHz + */ + BANDWIDTH_320 = 8, + /** + * AP channel bandwidth is 2160 MHz + */ + BANDWIDTH_2160 = 9, + /** + * AP channel bandwidth is 4320 MHz + */ + BANDWIDTH_4320 = 10, + /** + * AP channel bandwidth is 6480 MHz + */ + BANDWIDTH_6480 = 11, + /** + * AP channel bandwidth is 8640 MHz + */ + BANDWIDTH_8640 = 12, +} diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/HwModeParams.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/HwModeParams.aidl index e66a24af8c..320db9c970 100644 --- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/HwModeParams.aidl +++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/HwModeParams.aidl @@ -16,6 +16,8 @@ package android.hardware.wifi.hostapd; +import android.hardware.wifi.hostapd.ChannelBandwidth; + /** * Parameters to control the HW mode for the interface. */ @@ -74,4 +76,9 @@ parcelable HwModeParams { * used with Extreme High Throughput. */ boolean enable80211BE; + /** + * Limit on maximum channel bandwidth for the softAp. + * For automatic selection with no limit use BANDWIDTH_AUTO + */ + ChannelBandwidth maximumChannelBandwidth; } -- GitLab From 62b89b1670e289ce4ce7c5002bfd8af27edf878a Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 8 Feb 2022 21:12:29 +0000 Subject: [PATCH 590/825] uwb(hal): Some changes to the CCC capabilities to align with latest proposals in standards body Bug: 208678993 Bug: 209053358 Change-Id: I6610b106323db4ceab047b34b91aaa13a1a7f83d Test: Compiles --- .../UwbVendorCapabilityTlvTypes.aidl | 17 ++- .../UwbVendorCapabilityTlvValues.aidl | 30 ++--- .../UwbVendorCapabilityTlvTypes.aidl | 117 ++++++++++++------ .../UwbVendorCapabilityTlvValues.aidl | 33 ++--- 4 files changed, 118 insertions(+), 79 deletions(-) diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index fec044eb6c..cbe20688ad 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -35,14 +35,13 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability enum UwbVendorCapabilityTlvTypes { SUPPORTED_POWER_STATS_QUERY = 192, - CCC_SUPPORTED_VERSIONS = 160, - CCC_SUPPORTED_UWB_CONFIGS = 161, - CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 162, - CCC_SUPPORTED_RAN_MULTIPLIER = 163, - CCC_SUPPORTED_CHAPS_PER_SLOT = 164, - CCC_SUPPORTED_SYNC_CODES = 165, - CCC_SUPPORTED_CHANNELS = 166, - CCC_SUPPORTED_HOPPING_SEQUENCES = 167, - CCC_SUPPORTED_HOPPING_CONFIG_MODES = 168, + CCC_SUPPORTED_CHAPS_PER_SLOT = 160, + CCC_SUPPORTED_SYNC_CODES = 161, + CCC_SUPPORTED_HOPPING_CONFIG_MODES_AND_SEQUENCES = 162, + CCC_SUPPORTED_CHANNELS = 163, + CCC_SUPPORTED_VERSIONS = 164, + CCC_SUPPORTED_UWB_CONFIGS = 165, + CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 166, + CCC_SUPPORTED_RAN_MULTIPLIER = 167, SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 227, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl index ee47a138f7..0e33f70221 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl @@ -36,19 +36,21 @@ package android.hardware.uwb.fira_android; enum UwbVendorCapabilityTlvValues { UWB_CONFIG_0 = 0, UWB_CONFIG_1 = 1, - PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 1, - PULSE_SHAPE_PRECURSOR_FREE = 2, - PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 3, - CHAPS_PER_SLOT_3 = 3, - CHAPS_PER_SLOT_4 = 4, - CHAPS_PER_SLOT_6 = 6, + PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 0, + PULSE_SHAPE_PRECURSOR_FREE = 1, + PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 2, + CHAPS_PER_SLOT_3 = 1, + CHAPS_PER_SLOT_4 = 2, + CHAPS_PER_SLOT_6 = 4, CHAPS_PER_SLOT_8 = 8, - CHAPS_PER_SLOT_9 = 9, - CHAPS_PER_SLOT_12 = 12, - CHAPS_PER_SLOT_24 = 24, - HOPPING_SEQUENCE_DEFAULT = 0, - HOPPING_SEQUENCE_AES = 1, - HOPPING_CONFIG_MODE_NONE = 0, - HOPPING_CONFIG_MODE_CONTINUOUS = 1, - HOPPING_CONFIG_MODE_ADAPTIVE = 2, + CHAPS_PER_SLOT_9 = 16, + CHAPS_PER_SLOT_12 = 32, + CHAPS_PER_SLOT_24 = 64, + HOPPING_SEQUENCE_DEFAULT = 16, + HOPPING_SEQUENCE_AES = 8, + HOPPING_CONFIG_MODE_NONE = 128, + HOPPING_CONFIG_MODE_CONTINUOUS = 64, + HOPPING_CONFIG_MODE_ADAPTIVE = 32, + CCC_CHANNEL_5 = 1, + CCC_CHANNEL_9 = 2, } diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index 4591dda0ee..97f801078a 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -45,18 +45,86 @@ enum UwbVendorCapabilityTlvTypes { * CCC specific ********************************************/ + /** + * 1 byte bitmask with a list of supported chaps per slot + * Bitmap of supported values of Slot durations as a multiple of TChap, + * NChap_per_Slot as defined in CCC Specification. + * Each “1” in this bit map corresponds to a specific + * value of NChap_per_Slot where: + * 0x01 = “3”, + * 0x02 = “4”, + * 0x04= “6”, + * 0x08 =“8”, + * 0x10 =“9”, + * 0x20 = “12”, + * 0x40 = “24”, + * 0x80 is reserved. + */ + CCC_SUPPORTED_CHAPS_PER_SLOT = 0xA0, + + /** + * 4 byte bitmask with a list of supported sync codes + * Bitmap of SYNC code indices that can be used. + * The position of each “1” in this bit pattern + * corresponds to the index of a SYNC code that + * can be used, where: + * 0x00000001 = “1”, + * 0x00000002 = “2”, + * 0x00000004 = “3”, + * 0x00000008 = “4”, + * …. + * 0x40000000 = “31”, + * 0x80000000 = “32” + * Refer to IEEE 802.15.4-2015 and CCC + * Specification for SYNC code index definition + */ + CCC_SUPPORTED_SYNC_CODES = 0xA1, + + /** + * 1 byte bitmask with a list of supported hopping config modes and sequences. + * [b7 b6 b5] : bitmask of hopping modes the + * device offers to use in the ranging session + * 100 - No Hopping + * 010 - Continuous Hopping + * 001 - Adaptive Hopping + * [b4 b3 b2 b1 b0] : bit mask of hopping + * sequences the device offers to use in the + * ranging session + * b4=1 is always set because of the default + * hopping sequence. Support for it is mandatory. + * b3=1 is set when the optional AES based + * hopping sequence is supported. + */ + CCC_SUPPORTED_HOPPING_CONFIG_MODES_AND_SEQUENCES = 0xA2, + + /** + * 1 byte bitmask with list of supported channels + * Bitmap of supported UWB channels. Each “1” in + * this bit map corresponds to a specific value of + * UWB channel where: + * 0x01 = "Channel 5" + * 0x02 = "Channel 9" + */ + CCC_SUPPORTED_CHANNELS = 0xA3, + /** * 2 byte tuple {major_version (1 byte), minor_version (1 byte)} array with list of supported * CCC versions */ - CCC_SUPPORTED_VERSIONS = 0xA0, + CCC_SUPPORTED_VERSIONS = 0xA4, + /** * byte array with a list of supported UWB configs - * Values: - * UWB_CONFIG_0 = 0 - * UWB_CONFIG_1 = 1 + * + * UWB configurations are define in chapter + * "21.4 UWB Frame Elements" of the CCC + * specification. Configuration 0x0000 is + * mandatory for device and vehicle, configuration + * 0x0001 is mandatory for the device, optional for + * the vehicle. */ - CCC_SUPPORTED_UWB_CONFIGS = 0xA1, + CCC_SUPPORTED_UWB_CONFIGS = 0xA5, + /** * 1 byte tuple {initiator_tx (4 bits), responder_tx (4 bits)} array with list of supported * pulse shape combos @@ -66,43 +134,10 @@ enum UwbVendorCapabilityTlvTypes { * PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 3 */ /** */ - CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 0xA2, + CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 0xA6, + /** Int value for indicating supported ran multiplier */ - CCC_SUPPORTED_RAN_MULTIPLIER = 0xA3, - /** - * byte array with a list of supported chaps per slot - * Values: - * CHAPS_PER_SLOT_3 = 3 - * CHAPS_PER_SLOT_4 = 4 - * CHAPS_PER_SLOT_6 = 6 - * CHAPS_PER_SLOT_8 = 8 - * CHAPS_PER_SLOT_9 = 9 - * CHAPS_PER_SLOT_12 = 12 - * CHAPS_PER_SLOT_24 = 24 - */ - CCC_SUPPORTED_CHAPS_PER_SLOT = 0xA4, - /** - * byte array with a list of supported sync codes - * Values: 1 - 32 - */ - CCC_SUPPORTED_SYNC_CODES = 0xA5, - /** byte array with list of supported channels */ - CCC_SUPPORTED_CHANNELS = 0xA6, - /** - * byte array with a list of supported hopping sequences - * Values: - HOPPING_SEQUENCE_DEFAULT = 0 - HOPPING_SEQUENCE_AES = 1 - */ - CCC_SUPPORTED_HOPPING_SEQUENCES = 0xA7, - /** - * byte array with a list of supported hopping config modes - * Values: - * HOPPING_CONFIG_MODE_NONE = 0 - * HOPPING_CONFIG_MODE_CONTINUOUS = 1 - * HOPPING_CONFIG_MODE_ADAPTIVE = 2 - */ - CCC_SUPPORTED_HOPPING_CONFIG_MODES = 0xA8, + CCC_SUPPORTED_RAN_MULTIPLIER = 0xA7, /********************************************* * FIRA specific diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl index 380089fabc..7c86b79327 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl @@ -30,22 +30,25 @@ enum UwbVendorCapabilityTlvValues { UWB_CONFIG_0 = 0, UWB_CONFIG_1 = 1, - PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 1, - PULSE_SHAPE_PRECURSOR_FREE = 2, - PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 3, + PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 0, + PULSE_SHAPE_PRECURSOR_FREE = 1, + PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 2, - CHAPS_PER_SLOT_3 = 3, - CHAPS_PER_SLOT_4 = 4, - CHAPS_PER_SLOT_6 = 6, - CHAPS_PER_SLOT_8 = 8, - CHAPS_PER_SLOT_9 = 9, - CHAPS_PER_SLOT_12 = 12, - CHAPS_PER_SLOT_24 = 24, + CHAPS_PER_SLOT_3 = 1, + CHAPS_PER_SLOT_4 = 1 << 1, + CHAPS_PER_SLOT_6 = 1 << 2, + CHAPS_PER_SLOT_8 = 1 << 3, + CHAPS_PER_SLOT_9 = 1 << 4, + CHAPS_PER_SLOT_12 = 1 << 5, + CHAPS_PER_SLOT_24 = 1 << 6, - HOPPING_SEQUENCE_DEFAULT = 0, - HOPPING_SEQUENCE_AES = 1, + HOPPING_SEQUENCE_DEFAULT = 1 << 4, + HOPPING_SEQUENCE_AES = 1 << 3, - HOPPING_CONFIG_MODE_NONE = 0, - HOPPING_CONFIG_MODE_CONTINUOUS = 1, - HOPPING_CONFIG_MODE_ADAPTIVE = 2, + HOPPING_CONFIG_MODE_NONE = 1 << 7, + HOPPING_CONFIG_MODE_CONTINUOUS = 1 << 6, + HOPPING_CONFIG_MODE_ADAPTIVE = 1 << 5, + + CCC_CHANNEL_5 = 1, + CCC_CHANNEL_9 = 1 << 1, } -- GitLab From 9a30ec87a3c7a1f7fce0e53dfe49c0f67dda9842 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Tue, 8 Feb 2022 23:33:10 +0000 Subject: [PATCH 591/825] audio VTS: A follow-up to latency mode APIs tests Provide instantiation statements for the new tests. Bug: 210803914 Test: atest VtsHalAudioV7_1TargetTest Change-Id: I4ed95be6e50a9dcd1362a87ec120e66abea659b6 --- .../vts/functional/7.1/AudioPrimaryHidlHalTest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp index 6b9b32ded0..09b25d9cd4 100644 --- a/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp +++ b/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp @@ -47,6 +47,7 @@ TEST_P(AudioHidlDeviceTest, SetConnectedState_7_1) { // initial state. To workaround this, destroy the HAL at the end of this test. ASSERT_TRUE(resetDevice()); } + class LatencyModeOutputStreamTest : public OutputStreamTest { protected: void SetUp() override { @@ -95,3 +96,8 @@ TEST_P(LatencyModeOutputStreamTest, SetLatencyModeCallback) { EXPECT_OK(stream->setLatencyModeCallback(new MockOutLatencyModeCallback)); EXPECT_OK(stream->setLatencyModeCallback(nullptr)); } + +INSTANTIATE_TEST_CASE_P(LatencyModeOutputStream, LatencyModeOutputStreamTest, + ::testing::ValuesIn(getOutputDeviceSingleConfigParameters()), + &DeviceConfigParameterToString); +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(LatencyModeOutputStreamTest); -- GitLab From fa4a4f8da7d8a8ba74b781e96a515f6049cd5073 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Wed, 9 Feb 2022 00:23:14 +0000 Subject: [PATCH 592/825] audio: Add android.hardware.audio[.common]@7.1-util modules android.hardware.audio.common@7.1-util and android.hardware.audio@7.1-util utilize the 7.1 XSD enums conversion library and thus can work with the new enum strings added in 7.1 Bug: 218504031 Test: atest VtsHalAudioV7_1TargetTest Test: atest android.hardware.audio.common@7.0-util_tests Test: atest android.hardware.audio.common@7.1-util_tests Test: atest android.hardware.audio@7.0-util_tests Test: atest android.hardware.audio@7.1-util_tests Change-Id: Icc5a354cdc2e377a2a2424c28377bcb0ba05bf4e --- audio/common/all-versions/default/Android.bp | 54 +++++++++++++++++++ .../all-versions/default/HidlUtilsCommon.cpp | 4 +- .../common/all-versions/default/TEST_MAPPING | 3 ++ .../default/tests/hidlutils_tests.cpp | 4 +- audio/core/all-versions/default/Android.bp | 4 +- audio/core/all-versions/default/TEST_MAPPING | 3 ++ .../core/all-versions/default/util/Android.bp | 53 ++++++++++++++++++ .../default/util/tests/coreutils_tests.cpp | 8 +-- .../all-versions/vts/functional/Android.bp | 2 +- 9 files changed, 124 insertions(+), 11 deletions(-) diff --git a/audio/common/all-versions/default/Android.bp b/audio/common/all-versions/default/Android.bp index 8f557449f1..a25565d40c 100644 --- a/audio/common/all-versions/default/Android.bp +++ b/audio/common/all-versions/default/Android.bp @@ -157,6 +157,28 @@ cc_library { ], } +cc_library { + name: "android.hardware.audio.common@7.1-util", + defaults: ["android.hardware.audio.common-util_default"], + srcs: [ + "7.0/HidlUtils.cpp", + "HidlUtilsCommon.cpp", + "UuidUtils.cpp", + ], + shared_libs: [ + "android.hardware.audio.common@7.0", + "android.hardware.audio.common@7.1-enums", + "libbase", + ], + cflags: [ + "-DMAJOR_VERSION=7", + "-DMINOR_VERSION=1", + "-DCOMMON_TYPES_MINOR_VERSION=0", + "-DCORE_TYPES_MINOR_VERSION=0", + "-include common/all-versions/VersionMacro.h", + ], +} + // Note: this isn't a VTS test, but rather a unit test // to verify correctness of conversion utilities. cc_test { @@ -214,3 +236,35 @@ cc_test { test_suites: ["device-tests"], } + +cc_test { + name: "android.hardware.audio.common@7.1-util_tests", + defaults: ["android.hardware.audio.common-util_default"], + + srcs: ["tests/hidlutils_tests.cpp"], + + // Use static linking to allow running in presubmit on + // targets that don't have HAL V7.1. + static_libs: [ + "android.hardware.audio.common@7.1-enums", + "android.hardware.audio.common@7.1-util", + "android.hardware.audio.common@7.0", + ], + + shared_libs: [ + "libbase", + "libxml2", + ], + + cflags: [ + "-Werror", + "-Wall", + "-DMAJOR_VERSION=7", + "-DMINOR_VERSION=1", + "-DCOMMON_TYPES_MINOR_VERSION=0", + "-DCORE_TYPES_MINOR_VERSION=0", + "-include common/all-versions/VersionMacro.h", + ], + + test_suites: ["device-tests"], +} diff --git a/audio/common/all-versions/default/HidlUtilsCommon.cpp b/audio/common/all-versions/default/HidlUtilsCommon.cpp index d2da1939f5..bc3d8702c9 100644 --- a/audio/common/all-versions/default/HidlUtilsCommon.cpp +++ b/audio/common/all-versions/default/HidlUtilsCommon.cpp @@ -20,7 +20,7 @@ namespace android { namespace hardware { namespace audio { namespace common { -namespace CPP_VERSION { +namespace COMMON_TYPES_CPP_VERSION { namespace implementation { status_t HidlUtils::audioPortConfigsFromHal(unsigned int numHalConfigs, @@ -51,7 +51,7 @@ status_t HidlUtils::audioPortConfigsToHal(const hidl_vec& confi } } // namespace implementation -} // namespace CPP_VERSION +} // namespace COMMON_TYPES_CPP_VERSION } // namespace common } // namespace audio } // namespace hardware diff --git a/audio/common/all-versions/default/TEST_MAPPING b/audio/common/all-versions/default/TEST_MAPPING index c96511393f..780beeab0d 100644 --- a/audio/common/all-versions/default/TEST_MAPPING +++ b/audio/common/all-versions/default/TEST_MAPPING @@ -5,6 +5,9 @@ }, { "name": "android.hardware.audio.common@7.0-util_tests" + }, + { + "name": "android.hardware.audio.common@7.1-util_tests" } ] } diff --git a/audio/common/all-versions/default/tests/hidlutils_tests.cpp b/audio/common/all-versions/default/tests/hidlutils_tests.cpp index 2749cce748..ec16b0252f 100644 --- a/audio/common/all-versions/default/tests/hidlutils_tests.cpp +++ b/audio/common/all-versions/default/tests/hidlutils_tests.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include PATH(APM_XSD_ENUMS_H_FILENAME) #include #include @@ -32,7 +32,7 @@ using ::android::hardware::hidl_vec; using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils; namespace xsd { -using namespace ::android::audio::policy::configuration::V7_0; +using namespace ::android::audio::policy::configuration::CPP_VERSION; } static constexpr audio_channel_mask_t kInvalidHalChannelMask = AUDIO_CHANNEL_INVALID; diff --git a/audio/core/all-versions/default/Android.bp b/audio/core/all-versions/default/Android.bp index df688fd909..3536561fd3 100644 --- a/audio/core/all-versions/default/Android.bp +++ b/audio/core/all-versions/default/Android.bp @@ -168,10 +168,10 @@ cc_defaults { shared_libs: [ "android.hardware.audio@7.0", "android.hardware.audio@7.1", - "android.hardware.audio@7.0-util", + "android.hardware.audio@7.1-util", "android.hardware.audio.common@7.0", "android.hardware.audio.common@7.1-enums", - "android.hardware.audio.common@7.0-util", + "android.hardware.audio.common@7.1-util", "libbase", ], cflags: [ diff --git a/audio/core/all-versions/default/TEST_MAPPING b/audio/core/all-versions/default/TEST_MAPPING index 1e2944060b..07e98f37d2 100644 --- a/audio/core/all-versions/default/TEST_MAPPING +++ b/audio/core/all-versions/default/TEST_MAPPING @@ -3,6 +3,9 @@ { "name": "android.hardware.audio@7.0-util_tests" }, + { + "name": "android.hardware.audio@7.1-util_tests" + }, { "name": "HalAudioV6_0GeneratorTest" }, diff --git a/audio/core/all-versions/default/util/Android.bp b/audio/core/all-versions/default/util/Android.bp index 7caf18ddfd..b96f2d2b87 100644 --- a/audio/core/all-versions/default/util/Android.bp +++ b/audio/core/all-versions/default/util/Android.bp @@ -112,6 +112,25 @@ cc_library { ], } +cc_library { + name: "android.hardware.audio@7.1-util", + defaults: ["android.hardware.audio-util_default"], + shared_libs: [ + "android.hardware.audio.common@7.0", + "android.hardware.audio.common@7.1-enums", + "android.hardware.audio.common@7.1-util", + "android.hardware.audio@7.1", + "libbase", + ], + cflags: [ + "-DMAJOR_VERSION=7", + "-DMINOR_VERSION=1", + "-DCOMMON_TYPES_MINOR_VERSION=0", + "-DCORE_TYPES_MINOR_VERSION=0", + "-include common/all-versions/VersionMacro.h", + ], +} + // Note: this isn't a VTS test, but rather a unit test // to verify correctness of conversion utilities. cc_test { @@ -145,3 +164,37 @@ cc_test { test_suites: ["device-tests"], } + +cc_test { + name: "android.hardware.audio@7.1-util_tests", + defaults: ["android.hardware.audio-util_default"], + + srcs: ["tests/coreutils_tests.cpp"], + + // Use static linking to allow running in presubmit on + // targets that don't have HAL V7.1. + static_libs: [ + "android.hardware.audio.common@7.0", + "android.hardware.audio.common@7.1-enums", + "android.hardware.audio.common@7.1-util", + "android.hardware.audio@7.1", + "android.hardware.audio@7.1-util", + ], + + shared_libs: [ + "libbase", + "libxml2", + ], + + cflags: [ + "-Werror", + "-Wall", + "-DMAJOR_VERSION=7", + "-DMINOR_VERSION=1", + "-DCOMMON_TYPES_MINOR_VERSION=0", + "-DCORE_TYPES_MINOR_VERSION=0", + "-include common/all-versions/VersionMacro.h", + ], + + test_suites: ["device-tests"], +} diff --git a/audio/core/all-versions/default/util/tests/coreutils_tests.cpp b/audio/core/all-versions/default/util/tests/coreutils_tests.cpp index 3976b088e4..0e15960792 100644 --- a/audio/core/all-versions/default/util/tests/coreutils_tests.cpp +++ b/audio/core/all-versions/default/util/tests/coreutils_tests.cpp @@ -22,18 +22,18 @@ #define LOG_TAG "CoreUtils_Test" #include -#include +#include PATH(APM_XSD_ENUMS_H_FILENAME) #include #include #include using namespace android; using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; -using namespace ::android::hardware::audio::CPP_VERSION; +using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION; using ::android::hardware::hidl_vec; -using ::android::hardware::audio::CPP_VERSION::implementation::CoreUtils; +using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::CoreUtils; namespace xsd { -using namespace ::android::audio::policy::configuration::V7_0; +using namespace ::android::audio::policy::configuration::CPP_VERSION; } static constexpr audio_channel_mask_t kInvalidHalChannelMask = AUDIO_CHANNEL_INVALID; diff --git a/audio/core/all-versions/vts/functional/Android.bp b/audio/core/all-versions/vts/functional/Android.bp index 61ab1bbb6d..87063a77b6 100644 --- a/audio/core/all-versions/vts/functional/Android.bp +++ b/audio/core/all-versions/vts/functional/Android.bp @@ -200,7 +200,7 @@ cc_test { "android.hardware.audio.common@7.0", "android.hardware.audio.common@7.0-enums", "android.hardware.audio.common@7.1-enums", - "android.hardware.audio.common@7.0-util", + "android.hardware.audio.common@7.1-util", ], cflags: [ "-DMAJOR_VERSION=7", -- GitLab From fac554445564c38b9c7b3032aac58b3ded685e98 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Wed, 9 Feb 2022 03:01:01 +0000 Subject: [PATCH 593/825] Revert "composer: adds BufferAhead for the LayerCommand.aidl" This reverts commit d40304b574e19a7a458e365d4b8bdf495363179b. Reason for revert: Punting hal changes to future release Change-Id: I0980ac2d36962998472f46ece93f88f28fac4232 --- .../graphics/composer3/BufferAheadResult.aidl | 44 ------------------ .../graphics/composer3/Capability.aidl | 1 - .../composer3/CommandResultPayload.aidl | 1 - .../graphics/composer3/LayerCommand.aidl | 1 - .../graphics/composer3/BufferAheadResult.aidl | 46 ------------------- .../graphics/composer3/Capability.aidl | 5 -- .../composer3/CommandResultPayload.aidl | 8 ---- .../graphics/composer3/LayerCommand.aidl | 24 ---------- .../VtsHalGraphicsComposer3_TargetTest.cpp | 1 - .../graphics/composer3/ComposerClientReader.h | 20 -------- .../graphics/composer3/ComposerClientWriter.h | 5 -- 11 files changed, 156 deletions(-) delete mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BufferAheadResult.aidl delete mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/BufferAheadResult.aidl diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BufferAheadResult.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BufferAheadResult.aidl deleted file mode 100644 index 94fd91b2fa..0000000000 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BufferAheadResult.aidl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2022, The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.graphics.composer3; -@VintfStability -parcelable BufferAheadResult { - long display; - android.hardware.graphics.composer3.BufferAheadResult.Layer[] layers; - @VintfStability - parcelable Layer { - long layer; - boolean presented; - } -} 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 e989b6c24d..9c49583fd2 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 @@ -39,5 +39,4 @@ enum Capability { SKIP_CLIENT_COLOR_TRANSFORM = 2, PRESENT_FENCE_IS_NOT_RELIABLE = 3, SKIP_VALIDATE = 4, - BUFFER_AHEAD = 5, } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl index fb39172dd9..ebbb31e59f 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl @@ -39,7 +39,6 @@ union CommandResultPayload { android.hardware.graphics.composer3.DisplayRequest displayRequest; android.hardware.graphics.composer3.PresentFence presentFence; android.hardware.graphics.composer3.ReleaseFences releaseFences; - android.hardware.graphics.composer3.BufferAheadResult bufferAheadResult; android.hardware.graphics.composer3.PresentOrValidate presentOrValidateResult; android.hardware.graphics.composer3.ClientTargetPropertyWithNits clientTargetProperty; } 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 1429c3511f..c1c01172c1 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 @@ -37,7 +37,6 @@ parcelable LayerCommand { long layer; @nullable android.hardware.graphics.common.Point cursorPosition; @nullable android.hardware.graphics.composer3.Buffer buffer; - @nullable android.hardware.graphics.composer3.Buffer bufferAhead; @nullable android.hardware.graphics.common.Rect[] damage; @nullable android.hardware.graphics.composer3.ParcelableBlendMode blendMode; @nullable android.hardware.graphics.composer3.Color color; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/BufferAheadResult.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/BufferAheadResult.aidl deleted file mode 100644 index 7ca45784ec..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/BufferAheadResult.aidl +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (c) 2022, The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.graphics.composer3; - -@VintfStability -parcelable BufferAheadResult { - /** - * The display which this commands refers to. - * @see IComposer.createDisplay - */ - long display; - - @VintfStability - parcelable Layer { - /** - * The layer which this commands refers to. - * @see IComposer.createLayer - */ - long layer; - - /** - * Represents whether BufferAhead was presented as part of the last - * present or not. - */ - boolean presented; - } - - /** - * The layers which has BufferAheadResult populated. - */ - Layer[] layers; -} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl index 77ad1e0645..ea619aeaf3 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl @@ -57,9 +57,4 @@ enum Capability { * validateDisplay step is needed. */ SKIP_VALIDATE = 4, - /** - * Specifies that a device is able to use the LayerCommand.bufferAhead - * when provided. - */ - BUFFER_AHEAD = 5 } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl index fd1e4cc30b..f2de68e025 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl @@ -16,7 +16,6 @@ package android.hardware.graphics.composer3; -import android.hardware.graphics.composer3.BufferAheadResult; import android.hardware.graphics.composer3.ChangedCompositionTypes; import android.hardware.graphics.composer3.ClientTargetPropertyWithNits; import android.hardware.graphics.composer3.CommandError; @@ -78,13 +77,6 @@ union CommandResultPayload { */ ReleaseFences releaseFences; - /** - * Represents the result of the LayerCommand.bufferAhead that was - * sent in the last presentDisplay call. That is, the presentDisplay - * call prior to this presentDisplay. - */ - BufferAheadResult bufferAheadResult; - /** * Sets the state of PRESENT_OR_VALIDATE_DISPLAY command. */ diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index ab937948ab..6f6894fcdd 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl @@ -69,30 +69,6 @@ parcelable LayerCommand { */ @nullable Buffer buffer; - /** - * Sets a buffer handle to be displayed for this layer and a file descriptor - * referring to an acquire sync fence object, which must be signaled when it is - * safe to read from the given buffer. - * - * When bufferAhead is provided, the implementation should try to - * present it on the next scanout as long as its acquire sync fence - * is signaled by that time. Otherwise the bufferAhead should be dropped. - * This allows the client to set an - * unsignaled buffer on the layer without causing the entire display to miss - * an update if the buffer is not ready by the next scanout time. - * - * In case bufferAhead is dropped and LayerCommand.buffer is provided, LayerCommand.buffer - * should be used as the next layer buffer. - * - * The implementation is expected to populate the CommandResultPayload.bufferAheadResult - * with information about whether bufferAhead was presented or dropped. - * Since this information is not known at the current presentDisplay call - * of frame N (as the scanout happens after the call returns), - * the implementation should populate it when presentDisplay is - * called for frame N+1. - */ - @nullable Buffer bufferAhead; - /** * Provides the region of the source buffer which has been modified since * the last frame. This region does not need to be validated before diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 404b548dbf..17ec8854e9 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -984,7 +984,6 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { const auto errors = mReader.takeErrors(); ASSERT_TRUE(mReader.takeErrors().empty()); ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()); - ASSERT_TRUE(mReader.takeBufferAheadResultLayers(getPrimaryDisplayId()).empty()); ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::TearDown()); } diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h index 8f8c98f7f0..f9e35e94e0 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h @@ -77,10 +77,6 @@ class ComposerClientReader { parseSetClientTargetProperty(std::move( result.get())); break; - case CommandResultPayload::Tag::bufferAheadResult: - parseSetBufferAheadResultLayers( - result.get()); - break; } } } @@ -172,16 +168,6 @@ class ComposerClientReader { return std::move(data.clientTargetProperty); } - std::vector takeBufferAheadResultLayers(int64_t display) { - const auto found = mReturnData.find(display); - - if (found == mReturnData.end()) { - return {}; - } - - return std::move(found->second.bufferAheadResultLayers); - } - private: void resetData() { mErrors.clear(); @@ -220,18 +206,12 @@ class ComposerClientReader { data.clientTargetProperty = std::move(clientTargetProperty); } - void parseSetBufferAheadResultLayers(const BufferAheadResult& bufferAheadResult) { - auto& data = mReturnData[bufferAheadResult.display]; - data.bufferAheadResultLayers = std::move(bufferAheadResult.layers); - } - struct ReturnData { DisplayRequest displayRequests; std::vector changedLayers; ndk::ScopedFileDescriptor presentFence; std::vector releasedLayers; PresentOrValidate::Result presentOrValidateState; - std::vector bufferAheadResultLayers; ClientTargetPropertyWithNits clientTargetProperty = { .clientTargetProperty = {common::PixelFormat::RGBA_8888, Dataspace::UNKNOWN}, 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 02405ba70a..a04b9824c4 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -131,11 +131,6 @@ class ComposerClientWriter { getLayerCommand(display, layer).buffer = getBuffer(slot, buffer, acquireFence); } - void setLayerBufferAhead(int64_t display, int64_t layer, uint32_t slot, - const native_handle_t* buffer, int acquireFence) { - getLayerCommand(display, layer).bufferAhead = getBuffer(slot, buffer, acquireFence); - } - void setLayerSurfaceDamage(int64_t display, int64_t layer, const std::vector& damage) { getLayerCommand(display, layer).damage.emplace(damage.begin(), damage.end()); } -- GitLab From c20d70e09f6e8d7b7a51584ec38406b8277b71ed Mon Sep 17 00:00:00 2001 From: Greg Kaiser Date: Wed, 9 Feb 2022 07:11:33 -0800 Subject: [PATCH 594/825] Assure width and height are always initialized In case a user fails to call setDimensions() prior to several other methods on this class, we at least want to have consistent behavior that's easy to debug. Test: TreeHugger BUG: 199413815 Change-Id: Iee7681ed855cf6ebf9e436e0d2864e0fc9cb4025 --- .../vts/functional/composer-vts/include/VtsComposerClient.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h index b53edf812a..9af867c89d 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h @@ -199,7 +199,7 @@ class VtsComposerClient { class VtsDisplay { public: - VtsDisplay(int64_t displayId) : mDisplayId(displayId) {} + VtsDisplay(int64_t displayId) : mDisplayId(displayId), mDisplayWidth(0), mDisplayHeight(0) {} int64_t getDisplayId() const { return mDisplayId; } @@ -237,4 +237,4 @@ class VtsDisplay { int32_t mDisplayHeight; std::unordered_map displayConfigs; }; -} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file +} // namespace aidl::android::hardware::graphics::composer3::vts -- GitLab From 5d7af1e971042c12a70a3cab412a4b7c6b622069 Mon Sep 17 00:00:00 2001 From: Francois Gaffie Date: Wed, 2 Feb 2022 11:12:08 +0100 Subject: [PATCH 595/825] Adding AIDL version 2 of AudioControl HAL - Updated APIs to use PlaybackTrackMetadata (aka AudioAttributes) instead of usage to get rid of usages list limitation. - Add Gain Callback to notify unexpected gain changed from HAL (as currently done for Audio Focus). - Aggregate Callbacks within a unique IAudioControlCallback interface Bug: b/218682011 Test: build Signed-off-by: Francois Gaffie Change-Id: If74d575fad3888b698250a8ec9a6918f7cb294d7 --- audio/aidl/Android.bp | 7 +- automotive/audiocontrol/aidl/Android.bp | 8 +- .../audiocontrol/AudioFocusChange.aidl | 28 ++++- .../audiocontrol/AudioGainConfigInfo.aidl | 40 +++++++ .../automotive/audiocontrol/DuckingInfo.aidl | 29 ++++- .../audiocontrol/IAudioControl.aidl | 34 +++++- .../audiocontrol/IAudioGainCallback.aidl | 38 ++++++ .../audiocontrol/IFocusListener.aidl | 30 ++++- .../automotive/audiocontrol/MutingInfo.aidl | 28 ++++- .../automotive/audiocontrol/Reasons.aidl | 47 ++++++++ .../audiocontrol/AudioGainConfigInfo.aidl | 49 ++++++++ .../automotive/audiocontrol/DuckingInfo.aidl | 78 ++++++------ .../audiocontrol/IAudioControl.aidl | 112 +++++++++++++++--- .../audiocontrol/IAudioGainCallback.aidl | 65 ++++++++++ .../audiocontrol/IFocusListener.aidl | 35 +++++- .../automotive/audiocontrol/Reasons.aidl | 85 +++++++++++++ 16 files changed, 632 insertions(+), 81 deletions(-) create mode 100644 automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl create mode 100644 automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl create mode 100644 automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/Reasons.aidl create mode 100644 automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl create mode 100644 automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl create mode 100644 automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/Reasons.aidl diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp index 6a0cfa55cd..a8846b0ac5 100644 --- a/audio/aidl/Android.bp +++ b/audio/aidl/Android.bp @@ -41,7 +41,12 @@ aidl_interface { enabled: true, }, java: { - platform_apis: true, + sdk_version: "module_current", + min_sdk_version: "31", + apex_available: [ + "//apex_available:platform", + "com.android.car.framework", + ], }, ndk: { vndk: { diff --git a/automotive/audiocontrol/aidl/Android.bp b/automotive/audiocontrol/aidl/Android.bp index 5e69429b16..890d7a0d89 100644 --- a/automotive/audiocontrol/aidl/Android.bp +++ b/automotive/audiocontrol/aidl/Android.bp @@ -13,6 +13,10 @@ aidl_interface { name: "android.hardware.automotive.audiocontrol", vendor_available: true, srcs: ["android/hardware/automotive/audiocontrol/*.aidl"], + imports: [ + "android.hardware.audio.common", + "android.media.audio.common.types", + ], stability: "vintf", backend: { java: { @@ -24,5 +28,7 @@ aidl_interface { ], }, }, - versions: ["1"], + versions: [ + "1", + ], } diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl index 3dc393a580..58a36673cd 100644 --- a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl @@ -1,14 +1,30 @@ +/* + * 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. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl new file mode 100644 index 0000000000..91ce035229 --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.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 -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.audiocontrol; +@VintfStability +parcelable AudioGainConfigInfo { + int zoneId; + String devicePortAddress; + int volumeIndex; +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/DuckingInfo.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/DuckingInfo.aidl index 6d729e2205..23abb46bd7 100644 --- a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/DuckingInfo.aidl +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/DuckingInfo.aidl @@ -1,14 +1,30 @@ +/* + * 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. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 @@ -22,4 +38,5 @@ parcelable DuckingInfo { String[] deviceAddressesToDuck; String[] deviceAddressesToUnduck; String[] usagesHoldingFocus; + @nullable android.hardware.audio.common.PlaybackTrackMetadata[] playbackMetaDataHoldingFocus; } diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl index bc4162bc8b..8dc5ffe2eb 100644 --- a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl @@ -1,14 +1,30 @@ +/* + * 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. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 @@ -18,10 +34,16 @@ package android.hardware.automotive.audiocontrol; @VintfStability interface IAudioControl { + /** + * @deprecated use {@link android.hardware.audio.common.PlaybackTrackMetadata} instead. + */ oneway void onAudioFocusChange(in String usage, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusChange); oneway void onDevicesToDuckChange(in android.hardware.automotive.audiocontrol.DuckingInfo[] duckingInfos); oneway void onDevicesToMuteChange(in android.hardware.automotive.audiocontrol.MutingInfo[] mutingInfos); oneway void registerFocusListener(in android.hardware.automotive.audiocontrol.IFocusListener listener); oneway void setBalanceTowardRight(in float value); oneway void setFadeTowardFront(in float value); + oneway void onAudioFocusChangeWithMetaData(in android.hardware.audio.common.PlaybackTrackMetadata playbackMetaData, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusChange); + oneway void setAudioDeviceGainsChanged(in android.hardware.automotive.audiocontrol.Reasons[] reasons, in android.hardware.automotive.audiocontrol.AudioGainConfigInfo[] gains); + oneway void registerGainCallback(in android.hardware.automotive.audiocontrol.IAudioGainCallback callback); } diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl new file mode 100644 index 0000000000..17a087f20c --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioGainCallback.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 -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.audiocontrol; +@VintfStability +interface IAudioGainCallback { + oneway void onAudioDeviceGainsChanged(in android.hardware.automotive.audiocontrol.Reasons[] reasons, in android.hardware.automotive.audiocontrol.AudioGainConfigInfo[] gains); +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IFocusListener.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IFocusListener.aidl index f00f042a02..3e175529fa 100644 --- a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IFocusListener.aidl +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IFocusListener.aidl @@ -1,14 +1,30 @@ +/* + * 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. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 @@ -20,4 +36,6 @@ package android.hardware.automotive.audiocontrol; interface IFocusListener { oneway void abandonAudioFocus(in String usage, in int zoneId); oneway void requestAudioFocus(in String usage, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusGain); + oneway void abandonAudioFocusWithMetaData(in android.hardware.audio.common.PlaybackTrackMetadata playbackMetaData, in int zoneId); + oneway void requestAudioFocusWithMetaData(in android.hardware.audio.common.PlaybackTrackMetadata playbackMetaData, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusGain); } diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/MutingInfo.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/MutingInfo.aidl index ab902ec971..b25ed0f1e9 100644 --- a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/MutingInfo.aidl +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/MutingInfo.aidl @@ -1,14 +1,30 @@ +/* + * 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. + */ /////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// 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 diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/Reasons.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/Reasons.aidl new file mode 100644 index 0000000000..c1e22d44a7 --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/Reasons.aidl @@ -0,0 +1,47 @@ +/* + * 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 -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.audiocontrol; +@Backing(type="int") @VintfStability +enum Reasons { + FORCED_MASTER_MUTE = 1, + REMOTE_MUTE = 2, + TCU_MUTE = 4, + ADAS_DUCKING = 8, + NAV_DUCKING = 16, + PROJECTION_DUCKING = 32, + THERMAL_LIMITATION = 64, + SUSPEND_EXIT_VOL_LIMITATION = 128, + EXTERNAL_AMP_VOL_FEEDBACK = 256, + OTHER = -2147483648, +} diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl new file mode 100644 index 0000000000..68bfeab990 --- /dev/null +++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.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. + */ + +package android.hardware.automotive.audiocontrol; + +/** + * NOTE: + * Was expecting to reuse android.media.audio types... Limit info to minimum to prevent + * duplicating aidl_api. Will follow up if AudioGainConfig is exposed by android.media AIDL API. + */ +@VintfStability +parcelable AudioGainConfigInfo { + /** + * The identifier for the audio zone the audio device port associated to this gain belongs to. + * + */ + int zoneId; + + /** + * The Audio Output Device Port Address. + * + * This is the address that can be retrieved at JAVA layer using the introspection + * {@link android.media.AudioManager#listAudioDevicePorts} API then + * {@link audio.media.AudioDeviceInfo#getAddress} API. + * + * At HAL layer, it corresponds to audio_port_v7.audio_port_device_ext.address. + * + * Devices that does not have an address will indicate an empty string "". + */ + String devicePortAddress; + + /** + * UI Index of the corresponding AudioGain in AudioPort.gains. + */ + int volumeIndex; +} diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/DuckingInfo.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/DuckingInfo.aidl index e95fe9bb2e..513af4707e 100644 --- a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/DuckingInfo.aidl +++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/DuckingInfo.aidl @@ -14,41 +14,51 @@ * limitations under the License. */ - package android.hardware.automotive.audiocontrol; +package android.hardware.automotive.audiocontrol; - /** - * The current ducking information for a single audio zone. - * - *

This includes devices to duck, as well as unduck based on the contents of a previous - * {@link DuckingInfo}. Additionally, the current usages holding focus in the specified zone are - * included, which were used to determine which addresses to duck. - */ - @VintfStability - parcelable DuckingInfo { - /** - * ID of the associated audio zone - */ - int zoneId; +import android.hardware.audio.common.PlaybackTrackMetadata; - /** - * List of addresses for audio output devices that should be ducked. - * - *

The provided address strings are defined in audio_policy_configuration.xml. - */ - String[] deviceAddressesToDuck; +/** + * The current ducking information for a single audio zone. + * + *

This includes devices to duck, as well as unduck based on the contents of a previous + * {@link DuckingInfo}. Additionally, the current usages holding focus in the specified zone are + * included, which were used to determine which addresses to duck. + */ +@VintfStability +parcelable DuckingInfo { + /** + * ID of the associated audio zone + */ + int zoneId; + + /** + * List of addresses for audio output devices that should be ducked. + * + *

The provided address strings are defined in audio_policy_configuration.xml. + */ + String[] deviceAddressesToDuck; + + /** + * List of addresses for audio output devices that were previously be ducked and should now be + * unducked. + * + *

The provided address strings are defined in audio_policy_configuration.xml. + */ + String[] deviceAddressesToUnduck; - /** - * List of addresses for audio output devices that were previously be ducked and should now be - * unducked. - * - *

The provided address strings are defined in audio_policy_configuration.xml. - */ - String[] deviceAddressesToUnduck; + /** + * List of usages currently holding focus for this audio zone. + * + * This field was deprecated in version 2. + * Use playbackMetaDataHoldingFocus instead. + * + *

See {@code audioUsage} in audio_policy_configuration.xsd for the list of allowed values. + */ + String[] usagesHoldingFocus; - /** - * List of usages currently holding focus for this audio zone. - * - *

See {@code audioUsage} in audio_policy_configuration.xsd for the list of allowed values. - */ - String[] usagesHoldingFocus; - } \ No newline at end of file + /** + * List of output stream metadata associated with the current focus holder for this audio zone + */ + @nullable PlaybackTrackMetadata[] playbackMetaDataHoldingFocus; +} diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl index 3a0224557f..0ffcd5e19f 100644 --- a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl +++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl @@ -16,10 +16,43 @@ package android.hardware.automotive.audiocontrol; +/** + * Important note on Metadata: + * Metadata qualifies a playback track for an output stream. + * This is highly closed to {@link android.media.AudioAttributes}. + * It allows to identify the audio stream rendered / requesting / abandonning the focus. + * + * AudioControl 1.0 was limited to identification through {@code AttributeUsage} listed as + * {@code audioUsage} in audio_policy_configuration.xsd. + * + * Any new OEM needs would not be possible without extension. + * + * Relying on {@link android.hardware.automotive.audiocontrol.PlaybackTrackMetadata} allows + * to use a combination of {@code AttributeUsage}, {@code AttributeContentType} and + * {@code AttributeTags} to identify the use case / routing thanks to + * {@link android.media.audiopolicy.AudioProductStrategy}. + * The belonging to a strategy is deduced by an AOSP logic (in sync at native and java layer). + * + * IMPORTANT NOTE ON TAGS: + * To limit the possibilies and prevent from confusion, we expect the String to follow + * a given formalism that will be enforced. + * + * 1 / By convention, tags shall be a "key=value" pair. + * Vendor must namespace their tag's key (for example com.google.strategy=VR) to avoid conflicts. + * vendor specific applications and must be prefixed by "VX_". Vendor must + * + * 2 / Tags reported here shall be the same as the tags used to define a given + * {@link android.media.audiopolicy.AudioProductStrategy} and so in + * audio_policy_engine_configuration.xml file. + */ +import android.hardware.audio.common.PlaybackTrackMetadata; import android.hardware.automotive.audiocontrol.AudioFocusChange; +import android.hardware.automotive.audiocontrol.AudioGainConfigInfo; import android.hardware.automotive.audiocontrol.DuckingInfo; -import android.hardware.automotive.audiocontrol.MutingInfo; +import android.hardware.automotive.audiocontrol.IAudioGainCallback; import android.hardware.automotive.audiocontrol.IFocusListener; +import android.hardware.automotive.audiocontrol.MutingInfo; +import android.hardware.automotive.audiocontrol.Reasons; /** * Interacts with the car's audio subsystem to manage audio sources and volumes @@ -36,8 +69,12 @@ interface IAudioControl { * The HAL is not required to wait for an callback of AUDIOFOCUS_GAIN before playing audio, nor * is it required to stop playing audio in the event of a AUDIOFOCUS_LOSS callback is received. * + * This method was deprecated in version 2 to allow getting rid of usages limitation. + * Use {@link IAudioControl#onAudioFocusChangeWithMetaData} instead. + * * @param usage The audio usage associated with the focus change {@code AttributeUsage}. See * {@code audioUsage} in audio_policy_configuration.xsd for the list of allowed values. + * @deprecated use {@link android.hardware.audio.common.PlaybackTrackMetadata} instead. * @param zoneId The identifier for the audio zone that the HAL is playing the stream in * @param focusChange the AudioFocusChange that has occurred. */ @@ -52,19 +89,19 @@ interface IAudioControl { * @param duckingInfos an array of {@link DuckingInfo} objects for the audio zones where audio * focus has changed. */ - oneway void onDevicesToDuckChange(in DuckingInfo[] duckingInfos); + oneway void onDevicesToDuckChange(in DuckingInfo[] duckingInfos); - /** - * Notifies HAL of changes in output devices that the HAL should apply muting to. - * - * This will be called in response to changes in audio mute state for each volume group - * and will include a {@link MutingInfo} object per audio zone that experienced a mute state - * event. - * - * @param mutingInfos an array of {@link MutingInfo} objects for the audio zones where audio - * mute state has changed. - */ - oneway void onDevicesToMuteChange(in MutingInfo[] mutingInfos); + /** + * Notifies HAL of changes in output devices that the HAL should apply muting to. + * + * This will be called in response to changes in audio mute state for each volume group + * and will include a {@link MutingInfo} object per audio zone that experienced a mute state + * event. + * + * @param mutingInfos an array of {@link MutingInfo} objects for the audio zones where audio + * mute state has changed. + */ + oneway void onDevicesToMuteChange(in MutingInfo[] mutingInfos); /** * Registers focus listener to be used by HAL for requesting and abandoning audio focus. @@ -99,4 +136,51 @@ interface IAudioControl { * range. */ oneway void setFadeTowardFront(in float value); -} \ No newline at end of file + + /** + * Notifies HAL of changes in audio focus status for focuses requested or abandoned by the HAL. + * + * This will be called in response to IFocusListener's requestAudioFocus and + * abandonAudioFocus, as well as part of any change in focus being held by the HAL due focus + * request from other activities or services. + * + * The HAL is not required to wait for an callback of AUDIOFOCUS_GAIN before playing audio, nor + * is it required to stop playing audio in the event of a AUDIOFOCUS_LOSS callback is received. + * + * @param playbackMetaData The output stream metadata associated with the focus request + * @param zoneId The identifier for the audio zone that the HAL is playing the stream in + * @param focusChange the AudioFocusChange that has occurred. + */ + oneway void onAudioFocusChangeWithMetaData(in PlaybackTrackMetadata playbackMetaData, + in int zoneId, in AudioFocusChange focusChange); + + /** + * Notifies HAL of changes in output devices that the HAL should apply gain change to + * and the reason(s) why + * + * This may be called in response to changes in audio focus, and will include a list of + * {@link android.hardware.automotive.audiocontrol.AudioGainConfigInfo} objects per audio zone + * that experienced a change in audo focus. + * + * @param reasons List of reasons that triggered the given gains changed. + * This must be one or more of the + * {@link android.hardware.automotive.audiocontrol.Reasons} constants. + * + * @param gains List of gains the change is intended to. + */ + oneway void setAudioDeviceGainsChanged(in Reasons[] reasons, in AudioGainConfigInfo[] gains); + + /** + * Registers callback to be used by HAL for reporting unexpected gain(s) changed and the + * reason(s) why. + * + * It is expected that there will only ever be a single callback registered. If the + * observer dies, the HAL implementation must unregister observer automatically. If called when + * a listener is already registered, the existing one should be unregistered and replaced with + * the new callback. + * + * @param callback The {@link android.hardware.automotive.audiocontrol.IAudioGainCallback} + * interface. + */ + oneway void registerGainCallback(in IAudioGainCallback callback); +} diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl new file mode 100644 index 0000000000..17b4341e59 --- /dev/null +++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioGainCallback.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. + */ + +package android.hardware.automotive.audiocontrol; + +import android.hardware.automotive.audiocontrol.AudioGainConfigInfo; +import android.hardware.automotive.audiocontrol.Reasons; + +/** + * Interface definition for a callback to be invoked when the gain(s) of the device port(s) is(are) + * updated at HAL layer. + * + *

This defines counter part API of + * {@link android.hardware.automotive.audiocontrol.IAudioControl#onDevicesToDuckChange}, + * {@link android.hardware.automotive.audiocontrol.IAudioControl#onDevicesToMuteChange} and + * {@link android.hardware.automotive.audiocontrol.IAudioControl#setAudioDeviceGainsChanged} APIs. + * + * The previous API defines Mute/Duck order decided by the client (e.g. CarAudioService) + * and delegated to AudioControl for application. + * + * This callback interface defines Mute/Duck notification decided by AudioControl HAL (due to + * e.g. - external conditions from Android IVI subsystem + * - regulation / need faster decision rather than using + * {@link android.hardware.automotive.audiocontrol.IAudioControl#onAudioFocusChange} to + * report the use case and then waiting for CarAudioService decision to Mute/Duck. + */ +@VintfStability +oneway interface IAudioGainCallback { + /** + * Used to indicated the one or more audio device port gains have changed unexpectidely, i.e. + * initiated by HAL, not by CarAudioService. + * This is the counter part of the + * {@link android.hardware.automotive.audiocontrol.onDevicesToDuckChange}, + * {@link android.hardware.automotive.audiocontrol.onDevicesToMuteChange} and + * {@link android.hardware.automotive.audiocontrol.setAudioDeviceGainsChanged} APIs. + * + * Flexibility is given to OEM to mute/duck in HAL or in CarAudioService. + * For critical use cases (i.e. when regulation is required), better to handle mute/duck in + * HAL layer and informs upper layer. + * Non critical use case may report gain and focus and CarAudioService to decide of duck/mute. + * + * @param reasons List of reasons that triggered the given gains changed. + * This must be one or more of the + * {@link android.hardware.automotive.audiocontrol.Reasons} constants. + * It will define if the port has been muted/ducked or must now affected + * by gain limitation that shall be notified/enforced at CarAudioService + * layer. + * + * @param gains List of gains affected by the change. + */ + void onAudioDeviceGainsChanged(in Reasons[] reasons, in AudioGainConfigInfo[] gains); +} diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IFocusListener.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IFocusListener.aidl index b79295a6da..ac9ac01834 100644 --- a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IFocusListener.aidl +++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IFocusListener.aidl @@ -16,12 +16,14 @@ package android.hardware.automotive.audiocontrol; +import android.hardware.audio.common.PlaybackTrackMetadata; import android.hardware.automotive.audiocontrol.AudioFocusChange; /** * Callback interface for audio focus listener. * * For typical configuration, the listener the car audio service. + * */ @VintfStability interface IFocusListener { @@ -33,6 +35,9 @@ interface IFocusListener { * interaction is oneway to avoid blocking HAL so that it is not required to wait for a response * before stopping audio playback. * + * Deprecated in version 2 to allow generic interface callback listener. + * Use {@link IFocusListener#abandonHalAudioFocusWithMetaData} instead. + * * @param usage The audio usage for which the HAL is abandoning focus {@code AttributeUsage}. * See {@code audioUsage} in audio_policy_configuration.xsd for the list of allowed values. * @param zoneId The identifier for the audio zone that the HAL abandoning focus @@ -47,6 +52,9 @@ interface IFocusListener { * interaction is oneway to avoid blocking HAL so that it is not required to wait for a response * before playing audio. * + * Deprecated in version 2 to allow generic interface callback listener. + * Use {@link IFocusListener#requestAudioFocusWithMetaData} instead. + * * @param usage The audio usage associated with the focus request {@code AttributeUsage}. See * {@code audioUsage} in audio_policy_configuration.xsd for the list of allowed values. * @param zoneId The identifier for the audio zone where the HAL is requesting focus @@ -54,4 +62,29 @@ interface IFocusListener { * following: GAIN, GAIN_TRANSIENT, GAIN_TRANSIENT_MAY_DUCK, GAIN_TRANSIENT_EXCLUSIVE. */ oneway void requestAudioFocus(in String usage, in int zoneId, in AudioFocusChange focusGain); -} \ No newline at end of file + + /** + * Used to indicate that the audio output stream associated with + * {@link android.hardware.audio.common.PlaybackTrackMetadata} has released + * the focus. + * + * @param playbackMetaData The output stream metadata associated with the focus request + * @param zoneId The identifier for the audio zone that the HAL abandoning focus + */ + oneway void abandonAudioFocusWithMetaData( + in PlaybackTrackMetadata playbackMetaData, in int zoneId); + + /** + * Used to indicate that the audio output stream associated with + * {@link android.hardware.audio.common.PlaybackTrackMetadata} has taken the focus. + * + * @param playbackMetaData The output stream metadata associated with the focus request + * @param zoneId The identifier for the audio zone that the HAL abandoning focus + * @param focusGain The focus type requested. + * This must be one of the + * {@link android.hardware.automotive.audiocontrol.AudioFocusChange} + * constants. + */ + oneway void requestAudioFocusWithMetaData(in PlaybackTrackMetadata playbackMetaData, + in int zoneId, in AudioFocusChange focusGain); +} diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/Reasons.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/Reasons.aidl new file mode 100644 index 0000000000..860bf015f2 --- /dev/null +++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/Reasons.aidl @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.audiocontrol; + +/** + * Enum to identify the reason(s) of + * {@link android.hardware.automotive.audiocontrol.AudioGainConfigInfo} changed event + */ +@Backing(type="int") +@VintfStability +enum Reasons { + /** + * Magic Key Code (may be SWRC button combination) to force muting all audio sources. + * This may be used for example in case of cyber attach to ensure driver can safely drive back + * to garage to restore sw. + */ + FORCED_MASTER_MUTE = 0x1, + /** + * Reports a mute request outside the IVI (Android) system. + * It may target to mute the list of + * {@link android.hardware.automotive.audiocontrol.AudioGainConfigInfo}. + * A focus request may also be reported in addition if the use case that initiates the mute + * has matching {@link android.hardware.automotive.audiocontrol.PlaybackTrackMetadata} + * For regulation issue, the action of mute could be managed by HAL itself. + */ + REMOTE_MUTE = 0x2, + /** + * Reports a mute initiated by the TCU. It may be applied to all audio source (no + * associated {@link android.hardware.automotive.audiocontrol.AudioGainConfigInfo} reported, or + * it may target to mute only the given list of ports. + * A focus request may also be reported in addition. + * For regulation issue, the action of mute could be managed by HAL itself. + */ + TCU_MUTE = 0x4, + /** + * Reports a duck due to ADAS use case. A focus request may also be reported in addition. + * For regulation issue, the action of duck could be managed by HAL itself. + * It gives a chance to CarAudioService to decide whether contextual volume change may be + * applied from the ducked index base or not. + */ + ADAS_DUCKING = 0x8, + /** + * Reports a duck due to navigation use case. It gives a chance to CarAudioService to decide + * whether contextual volume change may be applied from the ducked index base or not. + */ + NAV_DUCKING = 0x10, + /** + * Some device projection stack may send signal to IVI to duck / unduck main audio stream. + * In this case, Contextual Volume Policy may be adapted to control the alternate / secondary + * audio stream. + */ + PROJECTION_DUCKING = 0x20, + /** + * When the amplifier is overheating, it may be recovered by limiting the volume. + */ + THERMAL_LIMITATION = 0x40, + /** + * Before the system enters suspend, it may ensure while exiting suspend or during cold boot + * that the volume is limited to prevent from sound explosion. + */ + SUSPEND_EXIT_VOL_LIMITATION = 0x80, + /** + * When using an external amplifier, it may be required to keep volume in sync and have + * asynchronous notification of effective volume change. + */ + EXTERNAL_AMP_VOL_FEEDBACK = 0x100, + /** + * For other OEM use. + */ + OTHER = 0x80000000, +} -- GitLab From d1374e051c759d0f38a288d50f730a366f550ebc Mon Sep 17 00:00:00 2001 From: Ray Essick Date: Wed, 9 Feb 2022 09:21:13 -0800 Subject: [PATCH 596/825] Add explicit apex_available clauses add apex_available clauses to interfaces which were being allowed by list stored within the apex toools Bug: 215589022 Test: build Change-Id: Iaf5d1b80e6b35f765d6b7a59ce7f28d4fa5098a4 --- graphics/allocator/2.0/Android.bp | 5 +++++ graphics/allocator/3.0/Android.bp | 5 +++++ graphics/allocator/4.0/Android.bp | 5 +++++ graphics/common/1.0/Android.bp | 5 +++++ graphics/common/1.1/Android.bp | 5 +++++ graphics/common/1.2/Android.bp | 5 +++++ graphics/mapper/2.0/Android.bp | 5 +++++ graphics/mapper/2.1/Android.bp | 5 +++++ graphics/mapper/3.0/Android.bp | 5 +++++ graphics/mapper/4.0/Android.bp | 5 +++++ 10 files changed, 50 insertions(+) diff --git a/graphics/allocator/2.0/Android.bp b/graphics/allocator/2.0/Android.bp index 6ec4e645c1..40db81d3e4 100644 --- a/graphics/allocator/2.0/Android.bp +++ b/graphics/allocator/2.0/Android.bp @@ -24,4 +24,9 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: false, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + "test_com.android.media.swcodec", + ], } diff --git a/graphics/allocator/3.0/Android.bp b/graphics/allocator/3.0/Android.bp index 768baba987..800632c59d 100644 --- a/graphics/allocator/3.0/Android.bp +++ b/graphics/allocator/3.0/Android.bp @@ -26,4 +26,9 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: false, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + "test_com.android.media.swcodec", + ], } diff --git a/graphics/allocator/4.0/Android.bp b/graphics/allocator/4.0/Android.bp index 0df9b390f5..5c5fb37c48 100644 --- a/graphics/allocator/4.0/Android.bp +++ b/graphics/allocator/4.0/Android.bp @@ -26,4 +26,9 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: false, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + "test_com.android.media.swcodec", + ], } diff --git a/graphics/common/1.0/Android.bp b/graphics/common/1.0/Android.bp index 74a0d9b9ea..ac158d96d1 100644 --- a/graphics/common/1.0/Android.bp +++ b/graphics/common/1.0/Android.bp @@ -21,4 +21,9 @@ hidl_interface { ], gen_java: true, gen_java_constants: true, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + "test_com.android.media.swcodec", + ], } diff --git a/graphics/common/1.1/Android.bp b/graphics/common/1.1/Android.bp index a120278a86..e45d6ddf27 100644 --- a/graphics/common/1.1/Android.bp +++ b/graphics/common/1.1/Android.bp @@ -24,4 +24,9 @@ hidl_interface { ], gen_java: true, gen_java_constants: true, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + "test_com.android.media.swcodec", + ], } diff --git a/graphics/common/1.2/Android.bp b/graphics/common/1.2/Android.bp index fe149e4225..c23085d4a9 100644 --- a/graphics/common/1.2/Android.bp +++ b/graphics/common/1.2/Android.bp @@ -25,4 +25,9 @@ hidl_interface { ], gen_java: true, gen_java_constants: true, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + "test_com.android.media.swcodec", + ], } diff --git a/graphics/mapper/2.0/Android.bp b/graphics/mapper/2.0/Android.bp index 63fdfa6cc5..6c3ef543fb 100644 --- a/graphics/mapper/2.0/Android.bp +++ b/graphics/mapper/2.0/Android.bp @@ -25,4 +25,9 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: false, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + "test_com.android.media.swcodec", + ], } diff --git a/graphics/mapper/2.1/Android.bp b/graphics/mapper/2.1/Android.bp index 4011650d85..cc74156cbe 100644 --- a/graphics/mapper/2.1/Android.bp +++ b/graphics/mapper/2.1/Android.bp @@ -26,4 +26,9 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: false, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + "test_com.android.media.swcodec", + ], } diff --git a/graphics/mapper/3.0/Android.bp b/graphics/mapper/3.0/Android.bp index 401a3a22b5..88992a3923 100644 --- a/graphics/mapper/3.0/Android.bp +++ b/graphics/mapper/3.0/Android.bp @@ -27,4 +27,9 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: false, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + "test_com.android.media.swcodec", + ], } diff --git a/graphics/mapper/4.0/Android.bp b/graphics/mapper/4.0/Android.bp index 4084dcda91..0cffce4508 100644 --- a/graphics/mapper/4.0/Android.bp +++ b/graphics/mapper/4.0/Android.bp @@ -27,4 +27,9 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: false, + apex_available: [ + "//apex_available:platform", + "com.android.media.swcodec", + "test_com.android.media.swcodec", + ], } -- GitLab From 75d311d54eaf93b2df03dc0bb55eb9de2ea265c1 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 9 Feb 2022 12:01:43 -0800 Subject: [PATCH 597/825] Make VehicleHalUtils vendor available. Test: Presubmit Bug: 214635003 Change-Id: I402725599ec22574ed2bd5620e9b9328ff1800f4 --- automotive/vehicle/aidl/aidl_test/Android.bp | 2 +- automotive/vehicle/aidl/impl/Android.bp | 2 +- .../aidl/impl/default_config/Android.bp | 4 +-- .../aidl/impl/default_config/test/Android.bp | 2 +- .../impl/fake_impl/GeneratorHub/Android.bp | 2 +- .../fake_impl/GeneratorHub/test/Android.bp | 2 +- .../aidl/impl/fake_impl/hardware/Android.bp | 4 +-- .../impl/fake_impl/hardware/test/Android.bp | 2 +- .../aidl/impl/fake_impl/obd2frame/Android.bp | 4 +-- .../impl/fake_impl/obd2frame/test/Android.bp | 2 +- .../aidl/impl/fake_impl/userhal/Android.bp | 4 +-- .../impl/fake_impl/userhal/test/Android.bp | 2 +- .../utils/proto_message_converter/Android.bp | 6 ++-- .../vehicle/aidl/impl/utils/common/Android.bp | 31 ++----------------- .../aidl/impl/utils/common/test/Android.bp | 2 +- automotive/vehicle/aidl/impl/vhal/Android.bp | 4 +-- .../vehicle/aidl/impl/vhal/test/Android.bp | 2 +- 17 files changed, 25 insertions(+), 52 deletions(-) diff --git a/automotive/vehicle/aidl/aidl_test/Android.bp b/automotive/vehicle/aidl/aidl_test/Android.bp index cb92c6bfa3..5284a0a8e1 100644 --- a/automotive/vehicle/aidl/aidl_test/Android.bp +++ b/automotive/vehicle/aidl/aidl_test/Android.bp @@ -26,7 +26,7 @@ cc_test { "libhidlbase", ], static_libs: [ - "VehicleHalUtilsVendor", + "VehicleHalUtils", "android.hardware.automotive.vehicle@2.0", "libgtest", "libgmock", diff --git a/automotive/vehicle/aidl/impl/Android.bp b/automotive/vehicle/aidl/impl/Android.bp index 16b6fde178..d24a73902b 100644 --- a/automotive/vehicle/aidl/impl/Android.bp +++ b/automotive/vehicle/aidl/impl/Android.bp @@ -21,7 +21,7 @@ package { cc_defaults { name: "VehicleHalDefaults", static_libs: [ - "android-automotive-large-parcelable-vendor-lib", + "android-automotive-large-parcelable-lib", "android.hardware.automotive.vehicle-V1-ndk", "libmath", ], diff --git a/automotive/vehicle/aidl/impl/default_config/Android.bp b/automotive/vehicle/aidl/impl/default_config/Android.bp index 7a98b6465a..0feaf23a73 100644 --- a/automotive/vehicle/aidl/impl/default_config/Android.bp +++ b/automotive/vehicle/aidl/impl/default_config/Android.bp @@ -24,8 +24,8 @@ cc_library_headers { local_include_dirs: ["include"], export_include_dirs: ["include"], defaults: ["VehicleHalDefaults"], - static_libs: ["VehicleHalUtilsVendor"], + static_libs: ["VehicleHalUtils"], header_libs: ["VehicleHalTestUtilHeaders"], - export_static_lib_headers: ["VehicleHalUtilsVendor"], + export_static_lib_headers: ["VehicleHalUtils"], export_header_lib_headers: ["VehicleHalTestUtilHeaders"], } diff --git a/automotive/vehicle/aidl/impl/default_config/test/Android.bp b/automotive/vehicle/aidl/impl/default_config/test/Android.bp index 0c4a3a43d4..771472c8c1 100644 --- a/automotive/vehicle/aidl/impl/default_config/test/Android.bp +++ b/automotive/vehicle/aidl/impl/default_config/test/Android.bp @@ -24,7 +24,7 @@ cc_test { defaults: ["VehicleHalDefaults"], srcs: ["*.cpp"], static_libs: [ - "VehicleHalUtilsVendor", + "VehicleHalUtils", "libgtest", ], header_libs: [ diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/Android.bp index e6c4ee9955..ab223d3f94 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/Android.bp @@ -26,7 +26,7 @@ cc_library { export_include_dirs: ["include"], defaults: ["VehicleHalDefaults"], static_libs: [ - "VehicleHalUtilsVendor", + "VehicleHalUtils", "FakeObd2Frame", ], shared_libs: [ diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp index 58f0e9848d..ac8db44e59 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp @@ -24,7 +24,7 @@ cc_test { srcs: ["*.cpp"], defaults: ["VehicleHalDefaults"], static_libs: [ - "VehicleHalUtilsVendor", + "VehicleHalUtils", "FakeVehicleHalValueGenerators", "FakeObd2Frame", ], diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp index 49f76718ee..dcd9208cab 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp @@ -39,7 +39,7 @@ cc_defaults { ], export_header_lib_headers: ["IVehicleHardware"], static_libs: [ - "VehicleHalUtilsVendor", + "VehicleHalUtils", "FakeVehicleHalValueGenerators", "FakeObd2Frame", "FakeUserHal", @@ -47,5 +47,5 @@ cc_defaults { shared_libs: [ "libjsoncpp", ], - export_static_lib_headers: ["VehicleHalUtilsVendor"], + export_static_lib_headers: ["VehicleHalUtils"], } 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 9f679bcf11..90d1516a21 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp @@ -29,7 +29,7 @@ cc_test { "VehicleHalTestUtilHeaders", ], static_libs: [ - "VehicleHalUtilsVendor", + "VehicleHalUtils", "FakeVehicleHardware", "FakeVehicleHalValueGenerators", "FakeObd2Frame", diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/Android.bp index c21ad535c5..c1cee84e63 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/Android.bp @@ -26,7 +26,7 @@ cc_library { export_include_dirs: ["include"], defaults: ["VehicleHalDefaults"], static_libs: [ - "VehicleHalUtilsVendor", + "VehicleHalUtils", ], - export_static_lib_headers: ["VehicleHalUtilsVendor"], + export_static_lib_headers: ["VehicleHalUtils"], } diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp index a16185b5e2..55b8c9399e 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/test/Android.bp @@ -25,7 +25,7 @@ cc_test { defaults: ["VehicleHalDefaults"], static_libs: [ "FakeObd2Frame", - "VehicleHalUtilsVendor", + "VehicleHalUtils", ], test_suites: ["device-tests"], } diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/userhal/Android.bp index 16891029f7..2e955315cd 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/userhal/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/Android.bp @@ -26,7 +26,7 @@ cc_library { export_include_dirs: ["include"], defaults: ["VehicleHalDefaults"], static_libs: [ - "VehicleHalUtilsVendor", + "VehicleHalUtils", ], - export_static_lib_headers: ["VehicleHalUtilsVendor"], + export_static_lib_headers: ["VehicleHalUtils"], } diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp index 1471ea6396..7d0a534b85 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/test/Android.bp @@ -25,7 +25,7 @@ cc_test { defaults: ["VehicleHalDefaults"], static_libs: [ "FakeUserHal", - "VehicleHalUtilsVendor", + "VehicleHalUtils", "libgtest", "libgmock", ], diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp index 6209880958..7670c25418 100644 --- a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp +++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp @@ -34,10 +34,10 @@ cc_library { shared_libs: ["libprotobuf-cpp-full"], static_libs: [ "VehicleHalProtos", - "VehicleHalUtilsVendor", + "VehicleHalUtils", ], defaults: ["VehicleHalDefaults"], - export_static_lib_headers: ["VehicleHalUtilsVendor"], + export_static_lib_headers: ["VehicleHalUtils"], } cc_test { @@ -51,7 +51,7 @@ cc_test { static_libs: [ "VehicleHalProtoMessageConverter", "VehicleHalProtos", - "VehicleHalUtilsVendor", + "VehicleHalUtils", "libgtest", ], header_libs: ["VehicleHalDefaultConfig"], diff --git a/automotive/vehicle/aidl/impl/utils/common/Android.bp b/automotive/vehicle/aidl/impl/utils/common/Android.bp index 88713f1245..e5d9346da4 100644 --- a/automotive/vehicle/aidl/impl/utils/common/Android.bp +++ b/automotive/vehicle/aidl/impl/utils/common/Android.bp @@ -18,40 +18,13 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } -cc_library { - name: "VehicleHalUtilsVendor", - srcs: ["src/*.cpp"], - vendor: true, - local_include_dirs: ["include"], - export_include_dirs: ["include"], - defaults: ["VehicleHalDefaults"], -} - -// This is a non-vendor version for VehicleHalUtilsVendor. cc_library { name: "VehicleHalUtils", srcs: ["src/*.cpp"], + vendor_available: true, local_include_dirs: ["include"], export_include_dirs: ["include"], - static_libs: [ - "android-automotive-large-parcelable-lib", - "android.hardware.automotive.vehicle-V1-ndk", - "libmath", - ], - shared_libs: [ - "libbase", - "liblog", - "libutils", - ], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - "-Wthread-safety", - ], - defaults: [ - "android-automotive-large-parcelable-defaults", - ], + defaults: ["VehicleHalDefaults"], } cc_library_headers { diff --git a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp index bcb3c8d512..5b41ff4df0 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp +++ b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp @@ -23,7 +23,7 @@ cc_test { srcs: ["*.cpp"], vendor: true, static_libs: [ - "VehicleHalUtilsVendor", + "VehicleHalUtils", "libgtest", "libgmock", ], diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp index 295cbb746b..49f48f7aa8 100644 --- a/automotive/vehicle/aidl/impl/vhal/Android.bp +++ b/automotive/vehicle/aidl/impl/vhal/Android.bp @@ -33,7 +33,7 @@ cc_binary { static_libs: [ "DefaultVehicleHal", "FakeVehicleHardware", - "VehicleHalUtilsVendor", + "VehicleHalUtils", ], header_libs: [ "IVehicleHardware", @@ -58,7 +58,7 @@ cc_library { "src/SubscriptionManager.cpp", ], static_libs: [ - "VehicleHalUtilsVendor", + "VehicleHalUtils", ], header_libs: [ "IVehicleHardware", diff --git a/automotive/vehicle/aidl/impl/vhal/test/Android.bp b/automotive/vehicle/aidl/impl/vhal/test/Android.bp index d89f2c152d..7122aa5230 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/Android.bp +++ b/automotive/vehicle/aidl/impl/vhal/test/Android.bp @@ -24,7 +24,7 @@ cc_test { srcs: ["*.cpp"], static_libs: [ "DefaultVehicleHal", - "VehicleHalUtilsVendor", + "VehicleHalUtils", "libgtest", "libgmock", ], -- GitLab From af1169fbf9960b420598ebe86da170ac5ce27d40 Mon Sep 17 00:00:00 2001 From: Ahmed ElArabawy Date: Wed, 9 Feb 2022 10:13:57 -0800 Subject: [PATCH 598/825] Wifi: Add Supplicant HAL APIs to get MLO Links Info This commit adds the Supplicant HAL API to get MLO (Multi-Link Operation) links info Bug: 198746544 Test: VTS test Change-Id: I4a40ddd402124d56571e97ad143eb2eb6fdc7cc2 --- .../wifi/supplicant/ISupplicantStaIface.aidl | 1 + .../hardware/wifi/supplicant/MloLink.aidl | 39 +++++++++++++++++++ .../wifi/supplicant/MloLinksInfo.aidl | 38 ++++++++++++++++++ .../wifi/supplicant/ISupplicantStaIface.aidl | 10 +++++ .../hardware/wifi/supplicant/MloLink.aidl | 33 ++++++++++++++++ .../wifi/supplicant/MloLinksInfo.aidl | 31 +++++++++++++++ 6 files changed, 152 insertions(+) create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLinksInfo.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLinksInfo.aidl 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 5c0aacd423..ed6e7c9f3f 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 @@ -45,6 +45,7 @@ interface ISupplicantStaIface { void filsHlpFlushRequest(); android.hardware.wifi.supplicant.DppResponderBootstrapInfo generateDppBootstrapInfoForResponder(in byte[] macAddress, in String deviceInfo, in android.hardware.wifi.supplicant.DppCurve curve); android.hardware.wifi.supplicant.ConnectionCapabilities getConnectionCapabilities(); + android.hardware.wifi.supplicant.MloLinksInfo getConnectionMloLinksInfo(); android.hardware.wifi.supplicant.KeyMgmtMask getKeyMgmtCapabilities(); byte[] getMacAddress(); String getName(); diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.aidl new file mode 100644 index 0000000000..5e2c47bdb5 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.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 -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 MloLink { + byte linkId; + byte[] staLinkMacAddress; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLinksInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLinksInfo.aidl new file mode 100644 index 0000000000..14fcb9178d --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLinksInfo.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 -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 MloLinksInfo { + android.hardware.wifi.supplicant.MloLink[] links; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl index a48a9917b5..95e087f530 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl @@ -28,6 +28,7 @@ import android.hardware.wifi.supplicant.ISupplicantStaIfaceCallback; import android.hardware.wifi.supplicant.ISupplicantStaNetwork; import android.hardware.wifi.supplicant.IfaceType; import android.hardware.wifi.supplicant.KeyMgmtMask; +import android.hardware.wifi.supplicant.MloLinksInfo; import android.hardware.wifi.supplicant.QosPolicyStatus; import android.hardware.wifi.supplicant.RxFilterType; import android.hardware.wifi.supplicant.WpaDriverCapabilitiesMask; @@ -187,6 +188,15 @@ interface ISupplicantStaIface { */ ConnectionCapabilities getConnectionCapabilities(); + /** + * Get Connection MLO links Info + * + * @return Connection MLO Links Info. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN| + */ + MloLinksInfo getConnectionMloLinksInfo(); + /** * Get Key management capabilities of the device * diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl new file mode 100644 index 0000000000..0e23728168 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * Multi-Link Operation (MLO) Link IEEE Std 802.11-be. + * The information for MLO link needed by 802.11be standard. + */ +@VintfStability +parcelable MloLink { + /** + * Link ID + */ + byte linkId; + /** + * STA Link MAC Address + */ + byte[/* 6 */] staLinkMacAddress; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLinksInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLinksInfo.aidl new file mode 100644 index 0000000000..2f14717209 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLinksInfo.aidl @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +import android.hardware.wifi.supplicant.MloLink; + +/** + * Multi-Link Operation (MLO) Links info. + * The information for MLO links needed by 802.11be standard. + */ +@VintfStability +parcelable MloLinksInfo { + /** + * List of MLO links + */ + MloLink[] links; +} -- GitLab From 91b4835adaaba1ea8d3b25f383a85d5044332e07 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Wed, 9 Feb 2022 15:47:54 -0800 Subject: [PATCH 599/825] Fix cert-dcl16-c warnings Bug: 120614316 Test: make tidy-hardware-interfaces-sensors-aidl_subset Change-Id: Ia9f5a9153b1591623aff0df4e185f445762bcbaf --- sensors/aidl/default/Sensor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sensors/aidl/default/Sensor.cpp b/sensors/aidl/default/Sensor.cpp index 50d8841b2a..62193d6c9b 100644 --- a/sensors/aidl/default/Sensor.cpp +++ b/sensors/aidl/default/Sensor.cpp @@ -52,10 +52,10 @@ const SensorInfo& Sensor::getSensorInfo() const { } void Sensor::batch(int64_t samplingPeriodNs) { - if (samplingPeriodNs < mSensorInfo.minDelayUs * 1000ll) { - samplingPeriodNs = mSensorInfo.minDelayUs * 1000ll; - } else if (samplingPeriodNs > mSensorInfo.maxDelayUs * 1000ll) { - samplingPeriodNs = mSensorInfo.maxDelayUs * 1000ll; + if (samplingPeriodNs < mSensorInfo.minDelayUs * 1000LL) { + samplingPeriodNs = mSensorInfo.minDelayUs * 1000LL; + } else if (samplingPeriodNs > mSensorInfo.maxDelayUs * 1000LL) { + samplingPeriodNs = mSensorInfo.maxDelayUs * 1000LL; } if (mSamplingPeriodNs != samplingPeriodNs) { -- GitLab From 4165ed1605aa0c2ef045f35e907b01e275d4b9f6 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Wed, 9 Feb 2022 14:47:50 -0800 Subject: [PATCH 600/825] Add GNSS AIDL VTS tests Copy existing VTS tests from HIDL HALs to AIDL, to make sure AIDL has at least the same API coverage. Bug: 216523795 Test: atest VtsHalGnssTargetTest Change-Id: I0f09ba2b5541e19f28b8689ec93ce6c2ba6798ff --- gnss/aidl/default/Gnss.cpp | 23 +- gnss/aidl/vts/gnss_hal_test.cpp | 20 +- gnss/aidl/vts/gnss_hal_test_cases.cpp | 307 +++++++++++++++++++++++--- gnss/common/utils/default/Utils.cpp | 3 +- gnss/common/utils/vts/Utils.cpp | 48 ++++ gnss/common/utils/vts/include/Utils.h | 14 ++ 6 files changed, 374 insertions(+), 41 deletions(-) diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index a861957e75..7855b5196a 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -53,17 +53,26 @@ ScopedAStatus Gnss::setCallback(const std::shared_ptr& callback) ALOGE("%s: Null callback ignored", __func__); return ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION); } - sGnssCallback = callback; - int capabilities = (int)(IGnssCallback::CAPABILITY_SATELLITE_BLOCKLIST | - IGnssCallback::CAPABILITY_SATELLITE_PVT | - IGnssCallback::CAPABILITY_CORRELATION_VECTOR | - IGnssCallback::CAPABILITY_ANTENNA_INFO); - + int capabilities = + (int)(IGnssCallback::CAPABILITY_MEASUREMENTS | IGnssCallback::CAPABILITY_SCHEDULING | + IGnssCallback::CAPABILITY_SATELLITE_BLOCKLIST | + IGnssCallback::CAPABILITY_SATELLITE_PVT | + IGnssCallback::CAPABILITY_CORRELATION_VECTOR | + IGnssCallback::CAPABILITY_ANTENNA_INFO); auto status = sGnssCallback->gnssSetCapabilitiesCb(capabilities); if (!status.isOk()) { - ALOGE("%s: Unable to invoke callback.gnssSetCapabilities", __func__); + ALOGE("%s: Unable to invoke callback.gnssSetCapabilitiesCb", __func__); + } + + IGnssCallback::GnssSystemInfo systemInfo = { + .yearOfHw = 2022, + .name = "Google Mock GNSS Implementation AIDL v2", + }; + status = sGnssCallback->gnssSetSystemInfoCb(systemInfo); + if (!status.isOk()) { + ALOGE("%s: Unable to invoke callback.gnssSetSystemInfoCb", __func__); } return ScopedAStatus::ok(); diff --git a/gnss/aidl/vts/gnss_hal_test.cpp b/gnss/aidl/vts/gnss_hal_test.cpp index c1128ba28d..f184f8132d 100644 --- a/gnss/aidl/vts/gnss_hal_test.cpp +++ b/gnss/aidl/vts/gnss_hal_test.cpp @@ -33,7 +33,7 @@ void GnssHalTest::SetUp() { ASSERT_NE(aidl_gnss_hal_, nullptr); ALOGD("AIDL Interface Version = %d", aidl_gnss_hal_->getInterfaceVersion()); - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { const auto& hidlInstanceNames = android::hardware::getAllHalInstanceNames( android::hardware::gnss::V2_1::IGnss::descriptor); gnss_hal_ = IGnss_V2_1::getService(hidlInstanceNames[0]); @@ -60,9 +60,15 @@ void GnssHalTest::SetUpGnssCallback() { TIMEOUT_SEC)); EXPECT_EQ(aidl_gnss_cb_->capabilities_cbq_.calledCount(), 1); - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { // Invoke the super method. GnssHalTestTemplate::SetUpGnssCallback(); + } else { + /* + * SystemInfo callback should trigger + */ + EXPECT_TRUE(aidl_gnss_cb_->info_cbq_.retrieve(aidl_gnss_cb_->last_info_, TIMEOUT_SEC)); + EXPECT_EQ(aidl_gnss_cb_->info_cbq_.calledCount(), 1); } } @@ -71,7 +77,7 @@ void GnssHalTest::CheckLocation(const GnssLocation& location, bool check_speed) } void GnssHalTest::SetPositionMode(const int min_interval_msec, const bool low_power_mode) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { // Invoke the super method. return GnssHalTestTemplate::SetPositionMode(min_interval_msec, low_power_mode); } @@ -93,7 +99,7 @@ void GnssHalTest::SetPositionMode(const int min_interval_msec, const bool low_po bool GnssHalTest::StartAndCheckFirstLocation(const int min_interval_msec, const bool low_power_mode) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { // Invoke the super method. return GnssHalTestTemplate::StartAndCheckFirstLocation(min_interval_msec, low_power_mode); @@ -127,7 +133,7 @@ bool GnssHalTest::StartAndCheckFirstLocation(const int min_interval_msec, void GnssHalTest::StopAndClearLocations() { ALOGD("StopAndClearLocations"); - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { // Invoke the super method. return GnssHalTestTemplate::StopAndClearLocations(); } @@ -148,7 +154,7 @@ void GnssHalTest::StopAndClearLocations() { } void GnssHalTest::StartAndCheckLocations(int count) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { // Invoke the super method. return GnssHalTestTemplate::StartAndCheckLocations(count); } @@ -264,7 +270,7 @@ BlocklistedSource GnssHalTest::FindStrongFrequentNonGpsSource( GnssConstellationType GnssHalTest::startLocationAndGetNonGpsConstellation( const int locations_to_await, const int gnss_sv_info_list_timeout) { - if (aidl_gnss_hal_->getInterfaceVersion() == 1) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { return static_cast( GnssHalTestTemplate::startLocationAndGetNonGpsConstellation( locations_to_await, gnss_sv_info_list_timeout)); diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 8e51b44427..365f9d355e 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include "AGnssCallbackAidl.h" #include "AGnssRilCallbackAidl.h" #include "GnssAntennaInfoCallbackAidl.h" @@ -45,7 +46,9 @@ using android::sp; using android::hardware::gnss::BlocklistedSource; using android::hardware::gnss::ElapsedRealtime; using android::hardware::gnss::GnssClock; +using android::hardware::gnss::GnssConstellationType; using android::hardware::gnss::GnssData; +using android::hardware::gnss::GnssLocation; using android::hardware::gnss::GnssMeasurement; using android::hardware::gnss::GnssPowerStats; using android::hardware::gnss::IAGnss; @@ -72,7 +75,6 @@ using android::hardware::gnss::measurement_corrections::IMeasurementCorrectionsI using android::hardware::gnss::visibility_control::IGnssVisibilityControl; using GnssConstellationTypeV2_0 = android::hardware::gnss::V2_0::GnssConstellationType; -using GnssConstellationTypeAidl = android::hardware::gnss::GnssConstellationType; static bool IsAutomotiveDevice() { char buffer[PROPERTY_VALUE_MAX] = {0}; @@ -88,6 +90,222 @@ static bool IsAutomotiveDevice() { */ TEST_P(GnssHalTest, SetupTeardownCreateCleanup) {} +/* + * GetLocation: + * Turns on location, waits 75 second for at least 5 locations, + * and checks them for reasonable validity. + */ +TEST_P(GnssHalTest, GetLocations) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { + return; + } + const int kMinIntervalMsec = 500; + const int kLocationsToCheck = 5; + + SetPositionMode(kMinIntervalMsec, /* low_power_mode= */ false); + StartAndCheckLocations(kLocationsToCheck); + StopAndClearLocations(); +} + +/* + * InjectDelete: + * Ensures that calls to inject and/or delete information state are handled. + */ +TEST_P(GnssHalTest, InjectDelete) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { + return; + } + // Confidently, well north of Alaska + auto status = aidl_gnss_hal_->injectLocation(Utils::getMockLocation(80.0, -170.0, 150.0)); + ASSERT_TRUE(status.isOk()); + + // Fake time, but generally reasonable values (time in Aug. 2018) + status = + aidl_gnss_hal_->injectTime(/* timeMs= */ 1534567890123L, + /* timeReferenceMs= */ 123456L, /* uncertaintyMs= */ 10000L); + ASSERT_TRUE(status.isOk()); + + status = aidl_gnss_hal_->deleteAidingData(IGnss::GnssAidingData::POSITION); + ASSERT_TRUE(status.isOk()); + + status = aidl_gnss_hal_->deleteAidingData(IGnss::GnssAidingData::TIME); + ASSERT_TRUE(status.isOk()); + + // Ensure we can get a good location after a bad injection has been deleted + StartAndCheckFirstLocation(/* min_interval_msec= */ 1000, /* low_power_mode= */ false); + StopAndClearLocations(); +} + +/* + * InjectSeedLocation: + * Injects a seed location and ensures the injected seed location is not fused in the resulting + * GNSS location. + */ +TEST_P(GnssHalTest, InjectSeedLocation) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { + return; + } + // An arbitrary position in North Pacific Ocean (where no VTS labs will ever likely be located). + const double seedLatDegrees = 32.312894; + const double seedLngDegrees = -172.954117; + const float seedAccuracyMeters = 150.0; + + auto status = aidl_gnss_hal_->injectLocation( + Utils::getMockLocation(seedLatDegrees, seedLngDegrees, seedAccuracyMeters)); + ASSERT_TRUE(status.isOk()); + + StartAndCheckFirstLocation(/* min_interval_msec= */ 1000, /* low_power_mode= */ false); + + // Ensure we don't get a location anywhere within 111km (1 degree of lat or lng) of the seed + // location. + EXPECT_TRUE(std::abs(aidl_gnss_cb_->last_location_.latitudeDegrees - seedLatDegrees) > 1.0 || + std::abs(aidl_gnss_cb_->last_location_.longitudeDegrees - seedLngDegrees) > 1.0); + + StopAndClearLocations(); + + status = aidl_gnss_hal_->deleteAidingData(IGnss::GnssAidingData::POSITION); + ASSERT_TRUE(status.isOk()); +} + +/* + * GnssCapabilities: + * 1. Verifies that GNSS hardware supports measurement capabilities. + * 2. Verifies that GNSS hardware supports Scheduling capabilities. + */ +TEST_P(GnssHalTest, GnssCapabilites) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { + return; + } + if (!IsAutomotiveDevice()) { + EXPECT_TRUE(aidl_gnss_cb_->last_capabilities_ & IGnssCallback::CAPABILITY_MEASUREMENTS); + } + EXPECT_TRUE(aidl_gnss_cb_->last_capabilities_ & IGnssCallback::CAPABILITY_SCHEDULING); +} + +/* + * GetLocationLowPower: + * Turns on location, waits for at least 5 locations allowing max of LOCATION_TIMEOUT_SUBSEQUENT_SEC + * between one location and the next. Also ensure that MIN_INTERVAL_MSEC is respected by waiting + * NO_LOCATION_PERIOD_SEC and verfiy that no location is received. Also perform validity checks on + * each received location. + */ +TEST_P(GnssHalTest, GetLocationLowPower) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { + return; + } + + const int kMinIntervalMsec = 5000; + const int kLocationTimeoutSubsequentSec = (kMinIntervalMsec / 1000) * 2; + const int kNoLocationPeriodSec = (kMinIntervalMsec / 1000) / 2; + const int kLocationsToCheck = 5; + const bool kLowPowerMode = true; + + // Warmup period - VTS doesn't have AGPS access via GnssLocationProvider + aidl_gnss_cb_->location_cbq_.reset(); + StartAndCheckLocations(kLocationsToCheck); + StopAndClearLocations(); + aidl_gnss_cb_->location_cbq_.reset(); + + // Start of Low Power Mode test + // Don't expect true - as without AGPS access + if (!StartAndCheckFirstLocation(kMinIntervalMsec, kLowPowerMode)) { + ALOGW("GetLocationLowPower test - no first low power location received."); + } + + for (int i = 1; i < kLocationsToCheck; i++) { + // Verify that kMinIntervalMsec is respected by waiting kNoLocationPeriodSec and + // ensure that no location is received yet + + aidl_gnss_cb_->location_cbq_.retrieve(aidl_gnss_cb_->last_location_, kNoLocationPeriodSec); + const int location_called_count = aidl_gnss_cb_->location_cbq_.calledCount(); + // Tolerate (ignore) one extra location right after the first one + // to handle startup edge case scheduling limitations in some implementations + if ((i == 1) && (location_called_count == 2)) { + CheckLocation(aidl_gnss_cb_->last_location_, true); + continue; // restart the quiet wait period after this too-fast location + } + EXPECT_LE(location_called_count, i); + if (location_called_count != i) { + ALOGW("GetLocationLowPower test - not enough locations received. %d vs. %d expected ", + location_called_count, i); + } + + if (!aidl_gnss_cb_->location_cbq_.retrieve( + aidl_gnss_cb_->last_location_, + kLocationTimeoutSubsequentSec - kNoLocationPeriodSec)) { + ALOGW("GetLocationLowPower test - timeout awaiting location %d", i); + } else { + CheckLocation(aidl_gnss_cb_->last_location_, true); + } + } + + StopAndClearLocations(); +} + +/* + * InjectBestLocation + * + * Ensure successfully injecting a location. + */ +TEST_P(GnssHalTest, InjectBestLocation) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { + return; + } + StartAndCheckLocations(1); + GnssLocation gnssLocation = aidl_gnss_cb_->last_location_; + CheckLocation(gnssLocation, true); + + auto status = aidl_gnss_hal_->injectBestLocation(gnssLocation); + + ASSERT_TRUE(status.isOk()); + + status = aidl_gnss_hal_->deleteAidingData(IGnss::GnssAidingData::POSITION); + + ASSERT_TRUE(status.isOk()); +} + +/* + * TestGnssSvInfoFields: + * Gets 1 location and a (non-empty) GnssSvInfo, and verifies basebandCN0DbHz is valid. + */ +TEST_P(GnssHalTest, TestGnssSvInfoFields) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { + return; + } + aidl_gnss_cb_->location_cbq_.reset(); + aidl_gnss_cb_->sv_info_list_cbq_.reset(); + StartAndCheckFirstLocation(/* min_interval_msec= */ 1000, /* low_power_mode= */ false); + int location_called_count = aidl_gnss_cb_->location_cbq_.calledCount(); + ALOGD("Observed %d GnssSvStatus, while awaiting one location (%d received)", + aidl_gnss_cb_->sv_info_list_cbq_.size(), location_called_count); + + // Wait for up to kNumSvInfoLists events for kTimeoutSeconds for each event. + int kTimeoutSeconds = 2; + int kNumSvInfoLists = 4; + std::list> sv_info_lists; + std::vector last_sv_info_list; + + do { + EXPECT_GT(aidl_gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_lists, kNumSvInfoLists, + kTimeoutSeconds), + 0); + last_sv_info_list = sv_info_lists.back(); + } while (last_sv_info_list.size() == 0); + + ALOGD("last_sv_info size = %d", (int)last_sv_info_list.size()); + bool nonZeroCn0Found = false; + for (auto sv_info : last_sv_info_list) { + EXPECT_TRUE(sv_info.basebandCN0DbHz >= 0.0 && sv_info.basebandCN0DbHz <= 65.0); + if (sv_info.basebandCN0DbHz > 0.0) { + nonZeroCn0Found = true; + } + } + // Assert at least one value is non-zero. Zero is ok in status as it's possibly + // reporting a searched but not found satellite. + EXPECT_TRUE(nonZeroCn0Found); + StopAndClearLocations(); +} + /* * TestPsdsExtension: * 1. Gets the PsdsExtension @@ -158,15 +376,7 @@ void CheckSatellitePvt(const SatellitePvt& satellitePvt, const int interfaceVers } void CheckGnssMeasurementClockFields(const GnssData& measurement) { - ASSERT_TRUE(measurement.elapsedRealtime.flags >= 0 && - measurement.elapsedRealtime.flags <= (ElapsedRealtime::HAS_TIMESTAMP_NS | - ElapsedRealtime::HAS_TIME_UNCERTAINTY_NS)); - if (measurement.elapsedRealtime.flags & ElapsedRealtime::HAS_TIMESTAMP_NS) { - ASSERT_TRUE(measurement.elapsedRealtime.timestampNs > 0); - } - if (measurement.elapsedRealtime.flags & ElapsedRealtime::HAS_TIME_UNCERTAINTY_NS) { - ASSERT_TRUE(measurement.elapsedRealtime.timeUncertaintyNs > 0); - } + Utils::checkElapsedRealtime(measurement.elapsedRealtime); ASSERT_TRUE(measurement.clock.gnssClockFlags >= 0 && measurement.clock.gnssClockFlags <= (GnssClock::HAS_LEAP_SECOND | GnssClock::HAS_TIME_UNCERTAINTY | @@ -189,6 +399,34 @@ void CheckGnssMeasurementFlags(const GnssMeasurement& measurement) { GnssMeasurement::HAS_CORRELATION_VECTOR)); } +void CheckGnssMeasurementFields(const GnssMeasurement& measurement, const GnssData& data) { + CheckGnssMeasurementFlags(measurement); + // Verify CodeType is valid. + ASSERT_NE(measurement.signalType.codeType, ""); + // Verify basebandCn0DbHz is valid. + ASSERT_TRUE(measurement.basebandCN0DbHz > 0.0 && measurement.basebandCN0DbHz <= 65.0); + + if (((measurement.flags & GnssMeasurement::HAS_FULL_ISB) > 0) && + ((measurement.flags & GnssMeasurement::HAS_FULL_ISB_UNCERTAINTY) > 0) && + ((measurement.flags & GnssMeasurement::HAS_SATELLITE_ISB) > 0) && + ((measurement.flags & GnssMeasurement::HAS_SATELLITE_ISB_UNCERTAINTY) > 0)) { + GnssConstellationType referenceConstellation = + data.clock.referenceSignalTypeForIsb.constellation; + double carrierFrequencyHz = data.clock.referenceSignalTypeForIsb.carrierFrequencyHz; + std::string codeType = data.clock.referenceSignalTypeForIsb.codeType; + + ASSERT_TRUE(referenceConstellation >= GnssConstellationType::UNKNOWN && + referenceConstellation <= GnssConstellationType::IRNSS); + ASSERT_TRUE(carrierFrequencyHz > 0); + ASSERT_NE(codeType, ""); + + ASSERT_TRUE(std::abs(measurement.fullInterSignalBiasNs) < 1.0e6); + ASSERT_TRUE(measurement.fullInterSignalBiasUncertaintyNs >= 0); + ASSERT_TRUE(std::abs(measurement.satelliteInterSignalBiasNs) < 1.0e6); + ASSERT_TRUE(measurement.satelliteInterSignalBiasUncertaintyNs >= 0); + } +} + /* * TestGnssMeasurementExtensionAndSatellitePvt: * 1. Gets the GnssMeasurementExtension and verifies that it returns a non-null extension. @@ -229,7 +467,7 @@ TEST_P(GnssHalTest, TestGnssMeasurementExtensionAndSatellitePvt) { CheckGnssMeasurementClockFields(lastMeasurement); for (const auto& measurement : lastMeasurement.measurements) { - CheckGnssMeasurementFlags(measurement); + CheckGnssMeasurementFields(measurement, lastMeasurement); if (measurement.flags & GnssMeasurement::HAS_SATELLITE_PVT && kIsSatellitePvtSupported == true) { ALOGD("Found a measurement with SatellitePvt"); @@ -289,7 +527,7 @@ TEST_P(GnssHalTest, TestCorrelationVector) { CheckGnssMeasurementClockFields(lastMeasurement); for (const auto& measurement : lastMeasurement.measurements) { - CheckGnssMeasurementFlags(measurement); + CheckGnssMeasurementFields(measurement, lastMeasurement); if (measurement.flags & GnssMeasurement::HAS_CORRELATION_VECTOR) { correlationVectorFound = true; ASSERT_TRUE(measurement.correlationVectors.size() > 0); @@ -466,7 +704,7 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { FindStrongFrequentNonGpsSource(sv_info_vec_list, kLocationsToAwait - 1); } - if (source_to_blocklist.constellation == GnssConstellationTypeAidl::UNKNOWN) { + if (source_to_blocklist.constellation == GnssConstellationType::UNKNOWN) { // Cannot find a non-GPS satellite. Let the test pass. ALOGD("Cannot find a non-GPS satellite. Letting the test pass."); return; @@ -522,7 +760,7 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { auto& gnss_sv = sv_info_vec[iSv]; EXPECT_FALSE( (gnss_sv.v2_0.v1_0.svid == source_to_blocklist.svid) && - (static_cast(gnss_sv.v2_0.constellation) == + (static_cast(gnss_sv.v2_0.constellation) == source_to_blocklist.constellation) && (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); } @@ -584,7 +822,7 @@ TEST_P(GnssHalTest, BlocklistIndividualSatellites) { for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { auto& gnss_sv = sv_info_vec[iSv]; if ((gnss_sv.v2_0.v1_0.svid == source_to_blocklist.svid) && - (static_cast(gnss_sv.v2_0.constellation) == + (static_cast(gnss_sv.v2_0.constellation) == source_to_blocklist.constellation) && (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)) { strongest_sv_is_reobserved = true; @@ -633,7 +871,7 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOff) { const int kGnssSvInfoListTimeout = 2; // Find first non-GPS constellation to blocklist - GnssConstellationTypeAidl constellation_to_blocklist = static_cast( + GnssConstellationType constellation_to_blocklist = static_cast( startLocationAndGetNonGpsConstellation(kLocationsToAwait, kGnssSvInfoListTimeout)); // Turns off location @@ -646,7 +884,7 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOff) { // IRNSS was added in 2.0. Always attempt to blocklist IRNSS to verify that the new enum is // supported. BlocklistedSource source_to_blocklist_2; - source_to_blocklist_2.constellation = GnssConstellationTypeAidl::IRNSS; + source_to_blocklist_2.constellation = GnssConstellationType::IRNSS; source_to_blocklist_2.svid = 0; // documented wildcard for all satellites in this constellation sp gnss_configuration_hal; @@ -686,11 +924,11 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOff) { for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { const auto& gnss_sv = sv_info_vec[iSv]; EXPECT_FALSE( - (static_cast(gnss_sv.v2_0.constellation) == + (static_cast(gnss_sv.v2_0.constellation) == source_to_blocklist_1.constellation) && (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); EXPECT_FALSE( - (static_cast(gnss_sv.v2_0.constellation) == + (static_cast(gnss_sv.v2_0.constellation) == source_to_blocklist_2.constellation) && (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); } @@ -736,7 +974,7 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOn) { const int kGnssSvInfoListTimeout = 2; // Find first non-GPS constellation to blocklist - GnssConstellationTypeAidl constellation_to_blocklist = static_cast( + GnssConstellationType constellation_to_blocklist = static_cast( startLocationAndGetNonGpsConstellation(kLocationsToAwait, kGnssSvInfoListTimeout)); BlocklistedSource source_to_blocklist_1; @@ -746,7 +984,7 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOn) { // IRNSS was added in 2.0. Always attempt to blocklist IRNSS to verify that the new enum is // supported. BlocklistedSource source_to_blocklist_2; - source_to_blocklist_2.constellation = GnssConstellationTypeAidl::IRNSS; + source_to_blocklist_2.constellation = GnssConstellationType::IRNSS; source_to_blocklist_2.svid = 0; // documented wildcard for all satellites in this constellation sp gnss_configuration_hal; @@ -789,11 +1027,11 @@ TEST_P(GnssHalTest, BlocklistConstellationLocationOn) { for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) { const auto& gnss_sv = sv_info_vec[iSv]; EXPECT_FALSE( - (static_cast(gnss_sv.v2_0.constellation) == + (static_cast(gnss_sv.v2_0.constellation) == source_to_blocklist_1.constellation) && (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); EXPECT_FALSE( - (static_cast(gnss_sv.v2_0.constellation) == + (static_cast(gnss_sv.v2_0.constellation) == source_to_blocklist_2.constellation) && (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)); } @@ -884,7 +1122,8 @@ TEST_P(GnssHalTest, TestAGnssExtension) { * TestAGnssRilExtension: * 1. Gets the IAGnssRil extension. * 2. Sets AGnssRilCallback. - * 3. Sets reference location. + * 3. Update network state to connected and then disconnected. + * 4. Sets reference location. */ TEST_P(GnssHalTest, TestAGnssRilExtension) { if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { @@ -899,6 +1138,20 @@ TEST_P(GnssHalTest, TestAGnssRilExtension) { status = iAGnssRil->setCallback(agnssRilCallback); ASSERT_TRUE(status.isOk()); + // Update GNSS HAL that a network has connected. + IAGnssRil::NetworkAttributes networkAttributes; + networkAttributes.networkHandle = 7700664333L; + networkAttributes.isConnected = true; + networkAttributes.capabilities = IAGnssRil::NETWORK_CAPABILITY_NOT_ROAMING; + networkAttributes.apn = "placeholder-apn"; + status = iAGnssRil->updateNetworkState(networkAttributes); + ASSERT_TRUE(status.isOk()); + + // Update GNSS HAL that network has disconnected. + networkAttributes.isConnected = false; + status = iAGnssRil->updateNetworkState(networkAttributes); + ASSERT_TRUE(status.isOk()); + // Set RefLocation IAGnssRil::AGnssRefLocationCellID agnssReflocationCellId; agnssReflocationCellId.type = IAGnssRil::AGnssRefLocationType::LTE_CELLID; @@ -1020,6 +1273,9 @@ TEST_P(GnssHalTest, TestGnssMeasurementSetCallbackWithOptions) { // Validity check GnssData fields CheckGnssMeasurementClockFields(lastMeasurement); + for (const auto& measurement : lastMeasurement.measurements) { + CheckGnssMeasurementFields(measurement, lastMeasurement); + } } status = iGnssMeasurement->close(); @@ -1076,12 +1332,11 @@ TEST_P(GnssHalTest, TestGnssAgcInGnssMeasurement) { * PhaseCenterVariationCorrections and SignalGainCorrections are optional. */ TEST_P(GnssHalTest, TestGnssAntennaInfo) { - const int kAntennaInfoTimeoutSeconds = 2; - if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { return; } + const int kAntennaInfoTimeoutSeconds = 2; sp iGnssAntennaInfo; auto status = aidl_gnss_hal_->getExtensionGnssAntennaInfo(&iGnssAntennaInfo); ASSERT_TRUE(status.isOk()); diff --git a/gnss/common/utils/default/Utils.cpp b/gnss/common/utils/default/Utils.cpp index 4e6a7184b3..a519d3acfb 100644 --- a/gnss/common/utils/default/Utils.cpp +++ b/gnss/common/utils/default/Utils.cpp @@ -217,7 +217,8 @@ GnssData Utils::getMockMeasurement(const bool enableCorrVecOutputs) { .biasUncertaintyNs = 47514.989972114563, .driftNsps = -51.757811607455452, .driftUncertaintyNsps = 310.64968328491528, - .hwClockDiscontinuityCount = 1}; + .hwClockDiscontinuityCount = 1, + .referenceSignalTypeForIsb = signalType}; ElapsedRealtime timestamp = { .flags = ElapsedRealtime::HAS_TIMESTAMP_NS | ElapsedRealtime::HAS_TIME_UNCERTAINTY_NS, diff --git a/gnss/common/utils/vts/Utils.cpp b/gnss/common/utils/vts/Utils.cpp index da4c07fc05..4c725a855b 100644 --- a/gnss/common/utils/vts/Utils.cpp +++ b/gnss/common/utils/vts/Utils.cpp @@ -20,12 +20,16 @@ #include "gtest/gtest.h" #include +#include namespace android { namespace hardware { namespace gnss { namespace common { +using android::hardware::gnss::ElapsedRealtime; +using android::hardware::gnss::GnssLocation; + using namespace measurement_corrections::V1_0; using V1_0::GnssLocationFlags; @@ -45,6 +49,50 @@ int64_t Utils::getLocationTimestampMillis(const V1_0::GnssLocation& location) { return location.timestamp; } +template <> +void Utils::checkLocationElapsedRealtime(const V1_0::GnssLocation&) {} + +template <> +void Utils::checkLocationElapsedRealtime(const android::hardware::gnss::GnssLocation& location) { + checkElapsedRealtime(location.elapsedRealtime); +} + +void Utils::checkElapsedRealtime(const ElapsedRealtime& elapsedRealtime) { + ASSERT_TRUE(elapsedRealtime.flags >= 0 && + elapsedRealtime.flags <= (ElapsedRealtime::HAS_TIMESTAMP_NS | + ElapsedRealtime::HAS_TIME_UNCERTAINTY_NS)); + if (elapsedRealtime.flags & ElapsedRealtime::HAS_TIMESTAMP_NS) { + ASSERT_TRUE(elapsedRealtime.timestampNs > 0); + } + if (elapsedRealtime.flags & ElapsedRealtime::HAS_TIME_UNCERTAINTY_NS) { + ASSERT_TRUE(elapsedRealtime.timeUncertaintyNs > 0); + } +} + +const GnssLocation Utils::getMockLocation(double latitudeDegrees, double longitudeDegrees, + double horizontalAccuracyMeters) { + ElapsedRealtime elapsedRealtime; + elapsedRealtime.flags = + ElapsedRealtime::HAS_TIMESTAMP_NS | ElapsedRealtime::HAS_TIME_UNCERTAINTY_NS; + elapsedRealtime.timestampNs = ::android::elapsedRealtimeNano(); + elapsedRealtime.timeUncertaintyNs = 1000; + GnssLocation location; + location.gnssLocationFlags = 0xFF; + location.latitudeDegrees = latitudeDegrees; + location.longitudeDegrees = longitudeDegrees; + location.altitudeMeters = 500.0; + location.speedMetersPerSec = 0.0; + location.bearingDegrees = 0.0; + location.horizontalAccuracyMeters = horizontalAccuracyMeters; + location.verticalAccuracyMeters = 1000.0; + location.speedAccuracyMetersPerSecond = 1000.0; + location.bearingAccuracyDegrees = 90.0; + location.timestampMillis = + static_cast(kMockTimestamp + ::android::elapsedRealtimeNano() * 1e-6); + location.elapsedRealtime = elapsedRealtime; + return location; +} + const MeasurementCorrections Utils::getMockMeasurementCorrections() { ReflectingPlane reflectingPlane = { .latitudeDegrees = 37.4220039, diff --git a/gnss/common/utils/vts/include/Utils.h b/gnss/common/utils/vts/include/Utils.h index 4ea6cd617d..7b890781db 100644 --- a/gnss/common/utils/vts/include/Utils.h +++ b/gnss/common/utils/vts/include/Utils.h @@ -19,11 +19,13 @@ #include #include +#include #include #include #include #include +#include namespace android { namespace hardware { @@ -32,8 +34,18 @@ namespace common { struct Utils { public: + static const int64_t kMockTimestamp = 1519930775453L; + template static void checkLocation(const T& location, bool check_speed, bool check_more_accuracies); + template + static void checkLocationElapsedRealtime(const T& location); + + static void checkElapsedRealtime( + const android::hardware::gnss::ElapsedRealtime& elapsedRealtime); + + static const android::hardware::gnss::GnssLocation getMockLocation( + double latitudeDegrees, double longitudeDegrees, double horizontalAccuracyMeters); static const measurement_corrections::V1_0::MeasurementCorrections getMockMeasurementCorrections(); static const measurement_corrections::V1_1::MeasurementCorrections @@ -117,6 +129,8 @@ void Utils::checkLocation(const T& location, bool check_speed, bool check_more_a // Check timestamp > 1.48e12 (47 years in msec - 1970->2017+) EXPECT_GT(getLocationTimestampMillis(location), 1.48e12); + + checkLocationElapsedRealtime(location); } } // namespace common -- GitLab From fe6d6b122c87e7cb9fb6547f07671e223f505f09 Mon Sep 17 00:00:00 2001 From: Robert Shih Date: Mon, 7 Feb 2022 16:43:42 -0800 Subject: [PATCH 601/825] drm hal aidl API cleanup * Merge IDrmFactory / ICryptoFactory * Simplify isContentTypeSupported / isCryptoSchemeSupported * Remove requiresSecureDecoderDefault * DecryptArgs * DestinationBuffer union * byte[16] Uuid * KeyStatusType underscores * setSharedBufferBase generic buffer type Bug: 214410088 Test: VtsAidlHalDrmTargetTest Change-Id: Ic30100af9bdb95aff9d140e093edb083c1b49592 --- .../compatibility_matrix.current.xml | 4 - .../android/hardware/drm/BufferType.aidl | 39 --------- ...{DecryptResult.aidl => CryptoSchemes.aidl} | 10 ++- .../{ICryptoFactory.aidl => DecryptArgs.aidl} | 15 +++- .../hardware/drm/DestinationBuffer.aidl | 3 +- .../android/hardware/drm/ICryptoPlugin.aidl | 4 +- .../android/hardware/drm/IDrmFactory.aidl | 7 +- .../android/hardware/drm/IDrmPlugin.aidl | 1 - .../android/hardware/drm/KeyStatusType.aidl | 8 +- .../android/hardware/drm/SharedBuffer.aidl | 1 + .../current/android/hardware/drm/Uuid.aidl | 2 +- drm/aidl/android/hardware/drm/BufferType.aidl | 24 ----- ...{DecryptResult.aidl => CryptoSchemes.aidl} | 34 +++++--- .../android/hardware/drm/DecryptArgs.aidl | 87 +++++++++++++++++++ .../hardware/drm/DestinationBuffer.aidl | 19 ++-- .../android/hardware/drm/ICryptoFactory.aidl | 51 ----------- .../android/hardware/drm/ICryptoPlugin.aidl | 32 ++----- .../android/hardware/drm/IDrmFactory.aidl | 38 ++++---- drm/aidl/android/hardware/drm/IDrmPlugin.aidl | 11 --- .../android/hardware/drm/KeyStatusType.aidl | 8 +- .../android/hardware/drm/SharedBuffer.aidl | 6 ++ drm/aidl/android/hardware/drm/Uuid.aidl | 2 +- 22 files changed, 179 insertions(+), 227 deletions(-) delete mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/BufferType.aidl rename drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/{DecryptResult.aidl => CryptoSchemes.aidl} (87%) rename drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/{ICryptoFactory.aidl => DecryptArgs.aidl} (82%) delete mode 100644 drm/aidl/android/hardware/drm/BufferType.aidl rename drm/aidl/android/hardware/drm/{DecryptResult.aidl => CryptoSchemes.aidl} (56%) create mode 100644 drm/aidl/android/hardware/drm/DecryptArgs.aidl delete mode 100644 drm/aidl/android/hardware/drm/ICryptoFactory.aidl diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 18b3885de9..541c1bb2a5 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -221,10 +221,6 @@ android.hardware.drm 1 - - ICryptoFactory - .* - IDrmFactory .* diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/BufferType.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/BufferType.aidl deleted file mode 100644 index b6ec34d897..0000000000 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/BufferType.aidl +++ /dev/null @@ -1,39 +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. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.drm; -@Backing(type="int") @VintfStability -enum BufferType { - SHARED_MEMORY = 0, - NATIVE_HANDLE = 1, -} diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DecryptResult.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/CryptoSchemes.aidl similarity index 87% rename from drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DecryptResult.aidl rename to drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/CryptoSchemes.aidl index d2b48d2b98..ea736cf373 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DecryptResult.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/CryptoSchemes.aidl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 The Android Open Source Project + * 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. @@ -33,7 +33,9 @@ package android.hardware.drm; @VintfStability -parcelable DecryptResult { - int bytesWritten; - String detailedError; +parcelable CryptoSchemes { + List uuids; + android.hardware.drm.SecurityLevel minLevel; + android.hardware.drm.SecurityLevel maxLevel; + List mimeTypes; } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoFactory.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DecryptArgs.aidl similarity index 82% rename from drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoFactory.aidl rename to drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DecryptArgs.aidl index 0d4296ec1f..9c574a48ef 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoFactory.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DecryptArgs.aidl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 The Android Open Source Project + * 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. @@ -33,7 +33,14 @@ package android.hardware.drm; @VintfStability -interface ICryptoFactory { - @nullable android.hardware.drm.ICryptoPlugin createPlugin(in android.hardware.drm.Uuid uuid, in byte[] initData); - boolean isCryptoSchemeSupported(in android.hardware.drm.Uuid uuid); +parcelable DecryptArgs { + boolean secure; + byte[] keyId; + byte[] iv; + android.hardware.drm.Mode mode; + android.hardware.drm.Pattern pattern; + android.hardware.drm.SubSample[] subSamples; + android.hardware.drm.SharedBuffer source; + long offset; + android.hardware.drm.DestinationBuffer destination; } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DestinationBuffer.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DestinationBuffer.aidl index 4f2d133cae..8c3ba7d0b7 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DestinationBuffer.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/DestinationBuffer.aidl @@ -33,8 +33,7 @@ package android.hardware.drm; @VintfStability -parcelable DestinationBuffer { - android.hardware.drm.BufferType type; +union DestinationBuffer { android.hardware.drm.SharedBuffer nonsecureMemory; android.hardware.common.NativeHandle secureMemory; } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoPlugin.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoPlugin.aidl index 2224795198..31c45e0e1f 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoPlugin.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/ICryptoPlugin.aidl @@ -34,10 +34,10 @@ package android.hardware.drm; @VintfStability interface ICryptoPlugin { - android.hardware.drm.DecryptResult decrypt(in boolean secure, in byte[] keyId, in byte[] iv, in android.hardware.drm.Mode mode, in android.hardware.drm.Pattern pattern, in android.hardware.drm.SubSample[] subSamples, in android.hardware.drm.SharedBuffer source, in long offset, in android.hardware.drm.DestinationBuffer destination); + int decrypt(in android.hardware.drm.DecryptArgs args); List getLogMessages(); void notifyResolution(in int width, in int height); boolean requiresSecureDecoderComponent(in String mime); void setMediaDrmSession(in byte[] sessionId); - void setSharedBufferBase(in android.hardware.common.Ashmem base, in int bufferId); + void setSharedBufferBase(in android.hardware.drm.SharedBuffer base); } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmFactory.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmFactory.aidl index af48737892..82efbb7ea0 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmFactory.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmFactory.aidl @@ -34,8 +34,7 @@ package android.hardware.drm; @VintfStability interface IDrmFactory { - @nullable android.hardware.drm.IDrmPlugin createPlugin(in android.hardware.drm.Uuid uuid, in String appPackageName); - List getSupportedCryptoSchemes(); - boolean isContentTypeSupported(in String mimeType); - boolean isCryptoSchemeSupported(in android.hardware.drm.Uuid uuid, in String mimeType, in android.hardware.drm.SecurityLevel securityLevel); + @nullable android.hardware.drm.IDrmPlugin createDrmPlugin(in android.hardware.drm.Uuid uuid, in String appPackageName); + @nullable android.hardware.drm.ICryptoPlugin createCryptoPlugin(in android.hardware.drm.Uuid uuid, in byte[] initData); + android.hardware.drm.CryptoSchemes getSupportedCryptoSchemes(); } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPlugin.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPlugin.aidl index 5f839d763c..ae10062c81 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPlugin.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/IDrmPlugin.aidl @@ -63,7 +63,6 @@ interface IDrmPlugin { void removeOfflineLicense(in android.hardware.drm.KeySetId keySetId); void removeSecureStop(in android.hardware.drm.SecureStopId secureStopId); boolean requiresSecureDecoder(in String mime, in android.hardware.drm.SecurityLevel level); - boolean requiresSecureDecoderDefault(in String mime); void restoreKeys(in byte[] sessionId, in android.hardware.drm.KeySetId keySetId); void setCipherAlgorithm(in byte[] sessionId, in String algorithm); void setListener(in android.hardware.drm.IDrmPluginListener listener); diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatusType.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatusType.aidl index e88d3886a2..261516f8ef 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatusType.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/KeyStatusType.aidl @@ -36,8 +36,8 @@ package android.hardware.drm; enum KeyStatusType { USABLE = 0, EXPIRED = 1, - OUTPUTNOTALLOWED = 2, - STATUSPENDING = 3, - INTERNALERROR = 4, - USABLEINFUTURE = 5, + OUTPUT_NOT_ALLOWED = 2, + STATUS_PENDING = 3, + INTERNAL_ERROR = 4, + USABLE_IN_FUTURE = 5, } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SharedBuffer.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SharedBuffer.aidl index 973ef0db3d..314fe7cf00 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SharedBuffer.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SharedBuffer.aidl @@ -37,4 +37,5 @@ parcelable SharedBuffer { int bufferId; long offset; long size; + android.hardware.common.NativeHandle handle; } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Uuid.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Uuid.aidl index ec2eb164c9..3c2cfa2037 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Uuid.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/Uuid.aidl @@ -34,5 +34,5 @@ package android.hardware.drm; @VintfStability parcelable Uuid { - byte[] uuid; + byte[16] uuid; } diff --git a/drm/aidl/android/hardware/drm/BufferType.aidl b/drm/aidl/android/hardware/drm/BufferType.aidl deleted file mode 100644 index 089c950656..0000000000 --- a/drm/aidl/android/hardware/drm/BufferType.aidl +++ /dev/null @@ -1,24 +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. - */ - -package android.hardware.drm; - -@VintfStability -@Backing(type="int") -enum BufferType { - SHARED_MEMORY = 0, - NATIVE_HANDLE = 1, -} diff --git a/drm/aidl/android/hardware/drm/DecryptResult.aidl b/drm/aidl/android/hardware/drm/CryptoSchemes.aidl similarity index 56% rename from drm/aidl/android/hardware/drm/DecryptResult.aidl rename to drm/aidl/android/hardware/drm/CryptoSchemes.aidl index 17e939bc95..b4b34ec17e 100644 --- a/drm/aidl/android/hardware/drm/DecryptResult.aidl +++ b/drm/aidl/android/hardware/drm/CryptoSchemes.aidl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 The Android Open Source Project + * 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. @@ -16,18 +16,30 @@ package android.hardware.drm; -/** - * The DecryptResult parcelable contains the result of - * ICryptoPlugin decrypt method. - */ +import android.hardware.drm.SecurityLevel; +import android.hardware.drm.Uuid; + @VintfStability -parcelable DecryptResult { - /** The number of decrypted bytes. */ - int bytesWritten; +parcelable CryptoSchemes { + + /** + * Supported crypto schemes + */ + List uuids; + + /** + * Minimum supported security level (inclusive) + */ + SecurityLevel minLevel; + + /** + * Maximum supported security level (inclusive) + */ + SecurityLevel maxLevel; /** - * Vendor-specific error message if provided by the vendor's - * crypto HAL. + * Supported mime types */ - String detailedError; + List mimeTypes; + } diff --git a/drm/aidl/android/hardware/drm/DecryptArgs.aidl b/drm/aidl/android/hardware/drm/DecryptArgs.aidl new file mode 100644 index 0000000000..5ec1b7154e --- /dev/null +++ b/drm/aidl/android/hardware/drm/DecryptArgs.aidl @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.drm; + +import android.hardware.drm.DestinationBuffer; +import android.hardware.drm.KeyStatusType; +import android.hardware.drm.Mode; +import android.hardware.drm.Pattern; +import android.hardware.drm.SharedBuffer; +import android.hardware.drm.SubSample; + +/** + * Arguments to ICryptoPlugin decrypt + */ +@VintfStability +parcelable DecryptArgs { + + /** + * A flag to indicate if a secure decoder is being used. + * + * This enables the plugin to configure buffer modes to work consistently + * with a secure decoder. + */ + boolean secure; + + /** + * The keyId for the key that is used to do the decryption. + * + * The keyId refers to a key in the associated MediaDrm instance. + */ + byte[] keyId; + + /** + * The initialization vector + */ + byte[] iv; + + /** + * Crypto mode + */ + Mode mode; + + /** + * Crypto pattern + */ + Pattern pattern; + + /** + * A vector of subsamples indicating the number of clear and encrypted + * bytes to process. + * + * This allows the decrypt call to operate on a range of subsamples in a + * single call + */ + SubSample[] subSamples; + + /** + * Input buffer for the decryption + */ + SharedBuffer source; + + /** + * The offset of the first byte of encrypted data from the base of the + * source buffer + */ + long offset; + + /** + * Output buffer for the decryption + */ + DestinationBuffer destination; + +} diff --git a/drm/aidl/android/hardware/drm/DestinationBuffer.aidl b/drm/aidl/android/hardware/drm/DestinationBuffer.aidl index 0f1e3f5398..7fc61e1676 100644 --- a/drm/aidl/android/hardware/drm/DestinationBuffer.aidl +++ b/drm/aidl/android/hardware/drm/DestinationBuffer.aidl @@ -17,29 +17,24 @@ package android.hardware.drm; import android.hardware.common.NativeHandle; -import android.hardware.drm.BufferType; import android.hardware.drm.SharedBuffer; /** * A decrypt destination buffer can be either normal user-space shared * memory for the non-secure decrypt case, or it can be a secure buffer - * which is referenced by a native-handle. The native handle is allocated - * by the vendor's buffer allocator. + * which is referenced by a native-handle. + * + * The native handle is allocated by the vendor's buffer allocator. */ @VintfStability -parcelable DestinationBuffer { - /** - * The type of the buffer - */ - BufferType type; +union DestinationBuffer { /** - * If type == SHARED_MEMORY, the decrypted data must be written - * to user-space non-secure shared memory. + * decrypted data written to user-space non-secure shared memory. */ SharedBuffer nonsecureMemory; /** - * If type == NATIVE_HANDLE, the decrypted data must be written - * to secure memory referenced by the vendor's buffer allocator. + * decrypted data written to secure memory referenced by the vendor's + * buffer allocator. */ NativeHandle secureMemory; } diff --git a/drm/aidl/android/hardware/drm/ICryptoFactory.aidl b/drm/aidl/android/hardware/drm/ICryptoFactory.aidl deleted file mode 100644 index 202bd3dbfe..0000000000 --- a/drm/aidl/android/hardware/drm/ICryptoFactory.aidl +++ /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. - */ - -package android.hardware.drm; - -import android.hardware.drm.Uuid; - -/** - * ICryptoFactory is the main entry point for interacting with a vendor's - * crypto HAL to create crypto plugins. - - * Crypto plugins create crypto sessions which are used by a codec to decrypt - * protected video content. - */ -@VintfStability -interface ICryptoFactory { - /** - * Create a crypto plugin for the specified uuid and scheme-specific - * initialization data. - * - * @param uuid uniquely identifies the drm scheme. See - * http://dashif.org/identifiers/protection for uuid assignments - * - * @param initData scheme-specific init data. - * - * @return A crypto plugin instance if successful, or null if not created. - */ - @nullable android.hardware.drm.ICryptoPlugin createPlugin( - in Uuid uuid, in byte[] initData); - - /** - * Determine if a crypto scheme is supported by this HAL. - * - * @param uuid identifies the crypto scheme in question - * @return must be true only if the scheme is supported - */ - boolean isCryptoSchemeSupported(in Uuid uuid); -} diff --git a/drm/aidl/android/hardware/drm/ICryptoPlugin.aidl b/drm/aidl/android/hardware/drm/ICryptoPlugin.aidl index 80a63dfdae..d344b62a7a 100644 --- a/drm/aidl/android/hardware/drm/ICryptoPlugin.aidl +++ b/drm/aidl/android/hardware/drm/ICryptoPlugin.aidl @@ -17,7 +17,7 @@ package android.hardware.drm; import android.hardware.common.Ashmem; -import android.hardware.drm.DecryptResult; +import android.hardware.drm.DecryptArgs; import android.hardware.drm.DestinationBuffer; import android.hardware.drm.LogMessage; import android.hardware.drm.Mode; @@ -38,23 +38,7 @@ interface ICryptoPlugin { * Decrypt an array of subsamples from the source memory buffer to the * destination memory buffer. * - * @param secure a flag to indicate if a secure decoder is being used. - * This enables the plugin to configure buffer modes to work - * consistently with a secure decoder. - * @param the keyId for the key that is used to do the decryption. The - * keyId refers to a key in the associated MediaDrm instance. - * @param iv the initialization vector to use - * @param mode the crypto mode to use - * @param pattern the crypto pattern to use - * @param subSamples a vector of subsamples indicating the number - * of clear and encrypted bytes to process. This allows the decrypt - * call to operate on a range of subsamples in a single call - * @param source the input buffer for the decryption - * @param offset the offset of the first byte of encrypted data from - * the base of the source buffer - * @param destination the output buffer for the decryption - * - * @return DecryptResult parcelable + * @return number of decrypted bytes * Implicit error codes: * + ERROR_DRM_CANNOT_HANDLE in other failure cases * + ERROR_DRM_DECRYPT if the decrypt operation fails @@ -74,9 +58,7 @@ interface ICryptoPlugin { * + ERROR_DRM_SESSION_NOT_OPENED if the decrypt session is not * opened */ - DecryptResult decrypt(in boolean secure, in byte[] keyId, in byte[] iv, in Mode mode, - in Pattern pattern, in SubSample[] subSamples, in SharedBuffer source, in long offset, - in DestinationBuffer destination); + int decrypt(in DecryptArgs args); /** * Get OEMCrypto or plugin error messages. @@ -129,10 +111,8 @@ interface ICryptoPlugin { * There can be multiple shared buffers per crypto plugin. The buffers * are distinguished by the bufferId. * - * @param base the base of the memory buffer identified by - * bufferId - * @param bufferId identifies the specific shared buffer for which - * the base is being set. + * @param base the base of the memory buffer abstracted by + * SharedBuffer parcelable (bufferId, size, handle) */ - void setSharedBufferBase(in Ashmem base, in int bufferId); + void setSharedBufferBase(in SharedBuffer base); } diff --git a/drm/aidl/android/hardware/drm/IDrmFactory.aidl b/drm/aidl/android/hardware/drm/IDrmFactory.aidl index b9622a427b..86c3f21a10 100644 --- a/drm/aidl/android/hardware/drm/IDrmFactory.aidl +++ b/drm/aidl/android/hardware/drm/IDrmFactory.aidl @@ -16,6 +16,7 @@ package android.hardware.drm; +import android.hardware.drm.CryptoSchemes; import android.hardware.drm.SecurityLevel; import android.hardware.drm.Uuid; @@ -40,37 +41,30 @@ interface IDrmFactory { * Implicit error codes: * + ERROR_DRM_CANNOT_HANDLE if the plugin cannot be created. */ - @nullable android.hardware.drm.IDrmPlugin createPlugin( + @nullable android.hardware.drm.IDrmPlugin createDrmPlugin( in Uuid uuid, in String appPackageName); /** - * Return vector of uuids identifying crypto schemes supported by - * this HAL. + * Create a crypto plugin for the specified uuid and scheme-specific + * initialization data. * - * @return List of uuids for which isCryptoSchemeSupported is true; - * each uuid can be used as input to createPlugin. - */ - List getSupportedCryptoSchemes(); - - /** - * Determine if the HAL factory is able to construct plugins that - * support a given media container format specified by mimeType + * @param uuid uniquely identifies the drm scheme. See + * http://dashif.org/identifiers/protection for uuid assignments * - * @param mimeType identifies the mime type in question + * @param initData scheme-specific init data. * - * @return must be true only if the scheme is supported + * @return A crypto plugin instance if successful, or null if not created. */ - boolean isContentTypeSupported(in String mimeType); + @nullable android.hardware.drm.ICryptoPlugin createCryptoPlugin( + in Uuid uuid, in byte[] initData); /** - * Determine if a specific security level is supported by the device. - * - * @param uuid identifies the crypto scheme in question - * @param mimeType identifies the mime type in question - * @param securityLevel specifies the security level required + * Return vector of uuids identifying crypto schemes supported by + * this HAL. * - * @return must be true only if the scheme is supported + * @return List of uuids for which isCryptoSchemeSupported is true; + * each uuid can be used as input to createPlugin. */ - boolean isCryptoSchemeSupported( - in Uuid uuid, in String mimeType, in SecurityLevel securityLevel); + CryptoSchemes getSupportedCryptoSchemes(); + } diff --git a/drm/aidl/android/hardware/drm/IDrmPlugin.aidl b/drm/aidl/android/hardware/drm/IDrmPlugin.aidl index e649f264ea..11ca8b6491 100644 --- a/drm/aidl/android/hardware/drm/IDrmPlugin.aidl +++ b/drm/aidl/android/hardware/drm/IDrmPlugin.aidl @@ -576,17 +576,6 @@ interface IDrmPlugin { */ boolean requiresSecureDecoder(in String mime, in SecurityLevel level); - /** - * Check if the specified mime-type requires a secure decoder component - * at the highest security level supported on the device. - * - * @param mime The content mime-type - * - * @return must be true if and only if a secure decoder is required - * for the specified mime-type - */ - boolean requiresSecureDecoderDefault(in String mime); - /** * Restore persisted offline keys into a new session * diff --git a/drm/aidl/android/hardware/drm/KeyStatusType.aidl b/drm/aidl/android/hardware/drm/KeyStatusType.aidl index 6902d8708c..6c3c6a2363 100644 --- a/drm/aidl/android/hardware/drm/KeyStatusType.aidl +++ b/drm/aidl/android/hardware/drm/KeyStatusType.aidl @@ -32,20 +32,20 @@ enum KeyStatusType { * The key is not currently usable to decrypt media data because its output * requirements cannot currently be met. */ - OUTPUTNOTALLOWED, + OUTPUT_NOT_ALLOWED, /** * The status of the key is not yet known and is being determined. */ - STATUSPENDING, + STATUS_PENDING, /** * The key is not currently usable to decrypt media data because of an * internal error in processing unrelated to input parameters. */ - INTERNALERROR, + INTERNAL_ERROR, /** * The key is not yet usable to decrypt media because the start * time is in the future. The key must become usable when * its start time is reached. */ - USABLEINFUTURE, + USABLE_IN_FUTURE, } diff --git a/drm/aidl/android/hardware/drm/SharedBuffer.aidl b/drm/aidl/android/hardware/drm/SharedBuffer.aidl index 69772840ba..2b2610f4bc 100644 --- a/drm/aidl/android/hardware/drm/SharedBuffer.aidl +++ b/drm/aidl/android/hardware/drm/SharedBuffer.aidl @@ -16,6 +16,8 @@ package android.hardware.drm; +import android.hardware.common.NativeHandle; + /** * SharedBuffer describes a decrypt buffer which is defined by a bufferId, an * offset and a size. The offset is relative to the shared memory base for the @@ -36,4 +38,8 @@ parcelable SharedBuffer { * The size of the shared buffer in bytes */ long size; + /** + * Handle to shared memory + */ + NativeHandle handle; } diff --git a/drm/aidl/android/hardware/drm/Uuid.aidl b/drm/aidl/android/hardware/drm/Uuid.aidl index b36c409c66..db5a70d349 100644 --- a/drm/aidl/android/hardware/drm/Uuid.aidl +++ b/drm/aidl/android/hardware/drm/Uuid.aidl @@ -18,5 +18,5 @@ package android.hardware.drm; @VintfStability parcelable Uuid { - byte[] uuid; + byte[16] uuid; } -- GitLab From 285c0a041cb21bd72e4971702cd28fd2d1253e9a Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Thu, 10 Feb 2022 04:28:41 +0000 Subject: [PATCH 602/825] audio VTS: Fix HAL device management Straighten out logic in DeviceManager for proper handling of IPrimaryDevice and IDevice instances across all supported HAL versions. This fixes a recently introduced bug which was causing the same HAL device to be opened twice in a row, and then closed twice. Bug: 218610286 Test: atest VtsHalAudioV7_0TargetTest Test: atest VtsHalAudioV7_1TargetTest Change-Id: I415cbadae9d325ac63160e49e5e638906c8c63fd --- .../4.0/AudioPrimaryHidlHalTest.cpp | 3 +- .../vts/functional/DeviceManager.h | 181 +++++++++++------- 2 files changed, 118 insertions(+), 66 deletions(-) diff --git a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp index a9797bbfbd..7f4a777d7f 100644 --- a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp +++ b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp @@ -28,8 +28,7 @@ TEST_P(AudioHidlTest, OpenPrimaryDeviceUsingGetDevice) { if (getDeviceName() != DeviceManager::kPrimaryDevice) { GTEST_SKIP() << "No primary device on this factory"; // returns } - EXPECT_TRUE( - DeviceManager::getInstance().reset(getFactoryName(), DeviceManager::kPrimaryDevice)); + EXPECT_TRUE(DeviceManager::getInstance().resetPrimary(getFactoryName())); // Must use IDevicesFactory directly because DeviceManager always uses // the latest interfaces version and corresponding methods for opening diff --git a/audio/core/all-versions/vts/functional/DeviceManager.h b/audio/core/all-versions/vts/functional/DeviceManager.h index c8e016731d..6bb39ed3ce 100644 --- a/audio/core/all-versions/vts/functional/DeviceManager.h +++ b/audio/core/all-versions/vts/functional/DeviceManager.h @@ -96,40 +96,83 @@ class DevicesFactoryManager } }; -using FactoryAndDevice = std::tuple; -class DeviceManager : public InterfaceManager { +namespace impl { + +class PrimaryDeviceManager + : public InterfaceManager { public: - static DeviceManager& getInstance() { - static DeviceManager instance; - return instance; + static sp createInterfaceInstance(const std::string& factoryName) { + sp factory = DevicesFactoryManager::getInstance().get(factoryName); + return openPrimaryDevice(factory); + } + + bool reset(const std::string& factoryName) __attribute__((warn_unused_result)) { +#if MAJOR_VERSION <= 5 + return InterfaceManager::reset(factoryName, true); +#elif MAJOR_VERSION >= 6 + { + sp device = getExisting(factoryName); + if (device != nullptr) { + auto ret = device->close(); + ALOGE_IF(!ret.isOk(), "PrimaryDevice %s close failed: %s", factoryName.c_str(), + ret.description().c_str()); + } + } + return InterfaceManager::reset(factoryName, false); +#endif + } + + private: + static sp openPrimaryDevice(const sp& factory) { + if (factory == nullptr) return {}; + Result result; + sp primaryDevice; +#if !(MAJOR_VERSION == 7 && MINOR_VERSION == 1) + sp device; +#if MAJOR_VERSION == 2 + auto ret = factory->openDevice(IDevicesFactory::Device::PRIMARY, returnIn(result, device)); + if (ret.isOk() && result == Result::OK && device != nullptr) { + primaryDevice = IPrimaryDevice::castFrom(device); + } +#elif MAJOR_VERSION >= 4 + auto ret = factory->openPrimaryDevice(returnIn(result, device)); + if (ret.isOk() && result == Result::OK && device != nullptr) { + primaryDevice = IPrimaryDevice::castFrom(device); + } +#endif + if (!ret.isOk() || result != Result::OK || primaryDevice == nullptr) { + ALOGW("Primary device can not be opened, transaction: %s, result %d, device %p", + ret.description().c_str(), result, device.get()); + return nullptr; + } +#else // V7.1 + auto ret = factory->openPrimaryDevice_7_1(returnIn(result, primaryDevice)); + if (!ret.isOk() || result != Result::OK) { + ALOGW("Primary device can not be opened, transaction: %s, result %d", + ret.description().c_str(), result); + return nullptr; + } +#endif + return primaryDevice; } +}; + +using FactoryAndDevice = std::tuple; +class RegularDeviceManager + : public InterfaceManager { + public: static sp createInterfaceInstance(const FactoryAndDevice& factoryAndDevice) { auto [factoryName, name] = factoryAndDevice; sp factory = DevicesFactoryManager::getInstance().get(factoryName); return openDevice(factory, name); } - using InterfaceManager::reset; - - static constexpr const char* kPrimaryDevice = "primary"; sp get(const std::string& factoryName, const std::string& name) { - if (name == kPrimaryDevice) { - (void)getPrimary(factoryName); // for initializing primaryDevice if needed. - } return InterfaceManager::get(std::make_tuple(factoryName, name)); } - sp getPrimary(const std::string& factoryName) { - if (primaryDevice == nullptr) { - sp factory = DevicesFactoryManager::getInstance().get(factoryName); - primaryDevice = openPrimaryDevice(factory); - } - return primaryDevice; - } + bool reset(const std::string& factoryName, const std::string& name) __attribute__((warn_unused_result)) { - if (name == kPrimaryDevice) { - primaryDevice.clear(); - } #if MAJOR_VERSION <= 5 return InterfaceManager::reset(std::make_tuple(factoryName, name), true); #elif MAJOR_VERSION >= 6 @@ -144,9 +187,6 @@ class DeviceManager : public InterfaceManager openDevice(const sp& factory, const std::string& name) { @@ -155,9 +195,7 @@ class DeviceManager : public InterfaceManager device; #if MAJOR_VERSION == 2 IDevicesFactory::Device dev = IDevicesFactory::IDevicesFactory::Device(-1); - if (name == AUDIO_HARDWARE_MODULE_ID_PRIMARY) { - dev = IDevicesFactory::Device::PRIMARY; - } else if (name == AUDIO_HARDWARE_MODULE_ID_A2DP) { + if (name == AUDIO_HARDWARE_MODULE_ID_A2DP) { dev = IDevicesFactory::Device::A2DP; } else if (name == AUDIO_HARDWARE_MODULE_ID_USB) { dev = IDevicesFactory::Device::USB; @@ -179,47 +217,62 @@ class DeviceManager : public InterfaceManager openPrimaryDevice(const sp& factory) { - if (factory == nullptr) return {}; - Result result; - sp device; - sp primaryDevice; -#if MAJOR_VERSION == 2 - auto ret = factory->openDevice(IDevicesFactory::Device::PRIMARY, returnIn(result, device)); - if (ret.isOk() && result == Result::OK && device != nullptr) { - primaryDevice = IPrimaryDevice::castFrom(device); - } -#elif MAJOR_VERSION >= 4 && (MAJOR_VERSION < 7 || (MAJOR_VERSION == 7 && MINOR_VERSION == 0)) - auto ret = factory->openPrimaryDevice(returnIn(result, device)); - if (ret.isOk() && result == Result::OK && device != nullptr) { - primaryDevice = IPrimaryDevice::castFrom(device); +} // namespace impl + +class DeviceManager { + public: + static DeviceManager& getInstance() { + static DeviceManager instance; + return instance; + } + + static constexpr const char* kPrimaryDevice = "primary"; + + sp get(const std::string& factoryName, const std::string& name) { + if (name == kPrimaryDevice) { + auto primary = getPrimary(factoryName); + return primary ? deviceFromPrimary(primary) : nullptr; } -#elif MAJOR_VERSION == 7 && MINOR_VERSION == 1 - auto ret = factory->openPrimaryDevice_7_1(returnIn(result, primaryDevice)); - if (ret.isOk() && result == Result::OK && primaryDevice != nullptr) { - auto getDeviceRet = primaryDevice->getDevice(); - if (getDeviceRet.isOk()) { - device = getDeviceRet; - } else { - primaryDevice.clear(); - ALOGW("Primary device can not downcast, transaction: %s, primary %p", - getDeviceRet.description().c_str(), primaryDevice.get()); - return {}; - } + return mDevices.get(factoryName, name); + } + + sp getPrimary(const std::string& factoryName) { + return mPrimary.get(factoryName); + } + + bool reset(const std::string& factoryName, const std::string& name) + __attribute__((warn_unused_result)) { + return name == kPrimaryDevice ? resetPrimary(factoryName) + : mDevices.reset(factoryName, name); + } + + bool resetPrimary(const std::string& factoryName) __attribute__((warn_unused_result)) { + return mPrimary.reset(factoryName); + } + + static void waitForInstanceDestruction() { + // Does not matter which device manager to use. + impl::RegularDeviceManager::waitForInstanceDestruction(); + } + + private: + sp deviceFromPrimary(const sp& primary) { +#if MAJOR_VERSION == 7 && MINOR_VERSION == 1 + auto ret = primary->getDevice(); + if (ret.isOk()) { + return ret; + } else { + ALOGW("Error retrieving IDevice from primary: transaction: %s, primary %p", + ret.description().c_str(), primary.get()); + return nullptr; } +#else + return primary; #endif - if (!ret.isOk() || result != Result::OK || device == nullptr) { - ALOGW("Primary device can not be opened, transaction: %s, result %d, device %p", - ret.description().c_str(), result, device.get()); - return {}; - } - return primaryDevice; } - private: - // There can only be one primary device across all HAL modules. - // A reference to a complete interface is used because in V7.1 IDevice can not - // be upcasted to IPrimaryDevice. - sp primaryDevice; + impl::PrimaryDeviceManager mPrimary; + impl::RegularDeviceManager mDevices; }; -- GitLab From f75da44f15c21eb37de787fa9aee66a62abef2b3 Mon Sep 17 00:00:00 2001 From: Chungjui Fan Date: Thu, 10 Feb 2022 12:34:00 +0800 Subject: [PATCH 603/825] Bump VTS of android.hardware.light to V2 Test: atest VtsHalLightTargetTest Bug: 218782124 Change-Id: I3687290755f10de6bf84c10ad97480f163f21005 --- light/aidl/vts/functional/Android.bp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/light/aidl/vts/functional/Android.bp b/light/aidl/vts/functional/Android.bp index c5a85620d2..16804ea09f 100644 --- a/light/aidl/vts/functional/Android.bp +++ b/light/aidl/vts/functional/Android.bp @@ -36,7 +36,7 @@ cc_test { "libbinder", ], static_libs: [ - "android.hardware.light-V1-cpp", + "android.hardware.light-V2-cpp", ], test_suites: [ "vts", -- GitLab From 2389ce2f9f9e941be6b0c4b7af30dbd3535afd6d Mon Sep 17 00:00:00 2001 From: Robert Shih Date: Wed, 9 Feb 2022 14:14:25 -0800 Subject: [PATCH 604/825] drm aidl vts: address ANAPIC review Interface update in change 16810770 Bug: 214410088 Test: atest VtsAidlHalDrmTargetTest Change-Id: Ibab87c0ab1d4019a470bbb4f0a2e2932e597e681 --- drm/aidl/vts/Android.bp | 2 + drm/aidl/vts/drm_hal_common.cpp | 125 +++++++++++++++----------- drm/aidl/vts/drm_hal_test.cpp | 28 ++---- drm/aidl/vts/drm_hal_test_main.cpp | 6 -- drm/aidl/vts/include/drm_hal_common.h | 30 +++---- 5 files changed, 99 insertions(+), 92 deletions(-) diff --git a/drm/aidl/vts/Android.bp b/drm/aidl/vts/Android.bp index 5b41830d68..190f60d29b 100644 --- a/drm/aidl/vts/Android.bp +++ b/drm/aidl/vts/Android.bp @@ -49,6 +49,8 @@ cc_test { "android.hardware.drm@1.0-helper", "android.hardware.drm-V1-ndk", "android.hardware.common-V2-ndk", + "libaidlcommonsupport", + "libgmock_ndk", "libdrmvtshelper", "libvtsclearkey", ], diff --git a/drm/aidl/vts/drm_hal_common.cpp b/drm/aidl/vts/drm_hal_common.cpp index 751c25b4ad..9b315f4f55 100644 --- a/drm/aidl/vts/drm_hal_common.cpp +++ b/drm/aidl/vts/drm_hal_common.cpp @@ -22,9 +22,11 @@ #include #include +#include #include #include #include +#include #include "drm_hal_clearkey_module.h" #include "drm_hal_common.h" @@ -39,8 +41,7 @@ namespace clearkeydrm = ::android::hardware::drm::V1_2::vts; using std::vector; using ::aidl::android::hardware::common::Ashmem; -using ::aidl::android::hardware::drm::BufferType; -using ::aidl::android::hardware::drm::DecryptResult; +using ::aidl::android::hardware::drm::DecryptArgs; using ::aidl::android::hardware::drm::DestinationBuffer; using ::aidl::android::hardware::drm::EventType; using ::aidl::android::hardware::drm::ICryptoPlugin; @@ -72,7 +73,6 @@ std::string HalBaseName(const std::string& fullname) { } const char* kDrmIface = "android.hardware.drm.IDrmFactory"; -const char* kCryptoIface = "android.hardware.drm.ICryptoFactory"; std::string HalFullName(const std::string& iface, const std::string& basename) { return iface + '/' + basename; @@ -184,7 +184,6 @@ void DrmHalTest::SetUp() { test_info->name(), GetParamService().c_str()); auto svc = GetParamService(); - const string cryptoInstance = HalFullName(kCryptoIface, svc); const string drmInstance = HalFullName(kDrmIface, svc); if (drmInstance.find("IDrmFactory") != std::string::npos) { @@ -192,12 +191,6 @@ void DrmHalTest::SetUp() { ::ndk::SpAIBinder(AServiceManager_waitForService(drmInstance.c_str()))); ASSERT_NE(drmFactory, nullptr); drmPlugin = createDrmPlugin(); - } - - if (cryptoInstance.find("ICryptoFactory") != std::string::npos) { - cryptoFactory = ICryptoFactory::fromBinder( - ::ndk::SpAIBinder(AServiceManager_waitForService(cryptoInstance.c_str()))); - ASSERT_NE(cryptoFactory, nullptr); cryptoPlugin = createCryptoPlugin(); } @@ -211,14 +204,12 @@ void DrmHalTest::SetUp() { contentConfigurations = vendorModule->getContentConfigurations(); // If drm scheme not installed skip subsequent tests - bool result = false; - drmFactory->isCryptoSchemeSupported({getUUID()}, "cenc", SecurityLevel::SW_SECURE_CRYPTO, - &result); + bool result = isCryptoSchemeSupported(getAidlUUID(), SecurityLevel::SW_SECURE_CRYPTO, "cenc"); if (!result) { if (GetParamUUID() == std::array()) { GTEST_SKIP() << "vendor module drm scheme not supported"; } else { - FAIL() << "param scheme must not supported"; + FAIL() << "param scheme must be supported"; } } @@ -234,18 +225,18 @@ std::shared_ptr<::aidl::android::hardware::drm::IDrmPlugin> DrmHalTest::createDr } std::string packageName("aidl.android.hardware.drm.test"); std::shared_ptr<::aidl::android::hardware::drm::IDrmPlugin> result; - auto ret = drmFactory->createPlugin({getUUID()}, packageName, &result); + auto ret = drmFactory->createDrmPlugin(getAidlUUID(), packageName, &result); EXPECT_OK(ret) << "createDrmPlugin remote call failed"; return result; } std::shared_ptr<::aidl::android::hardware::drm::ICryptoPlugin> DrmHalTest::createCryptoPlugin() { - if (cryptoFactory == nullptr) { + if (drmFactory == nullptr) { return nullptr; } vector initVec; std::shared_ptr<::aidl::android::hardware::drm::ICryptoPlugin> result; - auto ret = cryptoFactory->createPlugin({getUUID()}, initVec, &result); + auto ret = drmFactory->createCryptoPlugin(getAidlUUID(), initVec, &result); EXPECT_OK(ret) << "createCryptoPlugin remote call failed"; return result; } @@ -270,6 +261,26 @@ std::vector DrmHalTest::getVendorUUID() { return vendorModule->getUUID(); } +bool DrmHalTest::isCryptoSchemeSupported(Uuid uuid, SecurityLevel level, std::string mime) { + CryptoSchemes schemes{}; + auto ret = drmFactory->getSupportedCryptoSchemes(&schemes); + EXPECT_OK(ret); + if (!ret.isOk() || !std::count(schemes.uuids.begin(), schemes.uuids.end(), uuid)) { + return false; + } + if (level > schemes.maxLevel || level < schemes.minLevel) { + if (level != SecurityLevel::DEFAULT && level != SecurityLevel::UNKNOWN) { + return false; + } + } + if (!mime.empty()) { + if (!std::count(schemes.mimeTypes.begin(), schemes.mimeTypes.end(), mime)) { + return false; + } + } + return true; +} + void DrmHalTest::provision() { std::string certificateType; std::string certificateAuthority; @@ -410,38 +421,43 @@ KeyedVector DrmHalTest::toAidlKeyedVector(const map& params) { /** * getDecryptMemory allocates memory for decryption, then sets it - * as a shared buffer base in the crypto hal. A parcelable Ashmem - * is returned. + * as a shared buffer base in the crypto hal. An output SharedBuffer + * is updated via reference. * * @param size the size of the memory segment to allocate * @param the index of the memory segment which will be used * to refer to it for decryption. */ -Ashmem DrmHalTest::getDecryptMemory(size_t size, size_t index) { +void DrmHalTest::getDecryptMemory(size_t size, size_t index, SharedBuffer& out) { + out.bufferId = static_cast(index); + out.offset = 0; + out.size = static_cast(size); + int fd = ASharedMemory_create("drmVtsSharedMemory", size); EXPECT_GE(fd, 0); EXPECT_EQ(size, ASharedMemory_getSize(fd)); + auto handle = native_handle_create(1, 0); + handle->data[0] = fd; + out.handle = ::android::makeToAidl(handle); - Ashmem ashmem; - ashmem.fd = ::ndk::ScopedFileDescriptor(fd); - ashmem.size = size; - EXPECT_OK(cryptoPlugin->setSharedBufferBase(ashmem, index)); - return ashmem; + EXPECT_OK(cryptoPlugin->setSharedBufferBase(out)); + native_handle_delete(handle); } -void DrmHalTest::fillRandom(const Ashmem& ashmem) { +uint8_t* DrmHalTest::fillRandom(const ::aidl::android::hardware::drm::SharedBuffer& buf) { std::random_device rd; std::mt19937 rand(rd()); - ::ndk::ScopedFileDescriptor fd = ashmem.fd.dup(); - size_t size = ashmem.size; + auto fd = buf.handle.fds[0].get(); + size_t size = buf.size; uint8_t* base = static_cast( - mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0)); + mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)); EXPECT_NE(MAP_FAILED, base); for (size_t i = 0; i < size / sizeof(uint32_t); i++) { auto p = static_cast(static_cast(base)); p[i] = rand(); } + return base; } uint32_t DrmHalTest::decrypt(Mode mode, bool isSecure, const std::array& keyId, @@ -453,6 +469,7 @@ uint32_t DrmHalTest::decrypt(Mode mode, bool isSecure, const std::array ivVec(localIv, localIv + AES_BLOCK_SIZE); + vector keyIdVec(keyId.begin(), keyId.end()); int64_t totalSize = 0; for (size_t i = 0; i < subSamples.size(); i++) { @@ -463,32 +480,39 @@ uint32_t DrmHalTest::decrypt(Mode mode, bool isSecure, const std::array keyIdVec(keyId.begin(), keyId.end()); - DecryptResult result; - auto ret = cryptoPlugin->decrypt(isSecure, keyIdVec, ivVec, mode, pattern, subSamples, - sourceBuffer, offset, destBuffer, &result); + SharedBuffer sourceBuffer; + getDecryptMemory(totalSize * factor, kSegmentIndex, sourceBuffer); + auto base = fillRandom(sourceBuffer); + + SharedBuffer sourceRange; + sourceRange.bufferId = kSegmentIndex; + sourceRange.offset = 0; + sourceRange.size = totalSize; + + SharedBuffer destRange; + destRange.bufferId = kSegmentIndex; + destRange.offset = totalSize; + destRange.size = totalSize; + + DecryptArgs args; + args.secure = isSecure; + args.keyId = keyIdVec; + args.iv = ivVec; + args.mode = mode; + args.pattern = pattern; + args.subSamples = subSamples; + args.source = std::move(sourceRange); + args.offset = 0; + args.destination = std::move(destRange); + + int32_t bytesWritten = 0; + auto ret = cryptoPlugin->decrypt(args, &bytesWritten); EXPECT_TXN(ret); - EXPECT_EQ(expectedStatus, DrmErr(ret)) << "Unexpected decrypt status " << result.detailedError; - bytesWritten = result.bytesWritten; + EXPECT_EQ(expectedStatus, DrmErr(ret)) << "Unexpected decrypt status " << ret.getMessage(); if (bytesWritten != totalSize) { return bytesWritten; } - ::ndk::ScopedFileDescriptor fd = sharedMemory.fd.dup(); - uint8_t* base = static_cast( - mmap(nullptr, totalSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0)); - EXPECT_NE(MAP_FAILED, base); // generate reference vector vector reference(totalSize); @@ -513,6 +537,7 @@ uint32_t DrmHalTest::decrypt(Mode mode, bool isSecure, const std::array(&reference[0]), static_cast(base + totalSize), totalSize)) << "decrypt data mismatch"; + munmap(base, totalSize * factor); return totalSize; } diff --git a/drm/aidl/vts/drm_hal_test.cpp b/drm/aidl/vts/drm_hal_test.cpp index 3ac9f5cc41..266ea395e2 100644 --- a/drm/aidl/vts/drm_hal_test.cpp +++ b/drm/aidl/vts/drm_hal_test.cpp @@ -66,11 +66,8 @@ static constexpr SecurityLevel kHwSecureAll = SecurityLevel::HW_SECURE_ALL; * Ensure drm factory supports module UUID Scheme */ TEST_P(DrmHalTest, VendorUuidSupported) { - bool result = false; - auto ret = - drmFactory->isCryptoSchemeSupported(getAidlUUID(), kVideoMp4, kSwSecureCrypto, &result); - ALOGI("kVideoMp4 = %s res %d", kVideoMp4, static_cast(result)); - EXPECT_OK(ret); + bool result = isCryptoSchemeSupported(getAidlUUID(), kSwSecureCrypto, kVideoMp4); + ALOGI("kVideoMp4 = %s res %d", kVideoMp4, result); EXPECT_TRUE(result); } @@ -80,10 +77,7 @@ TEST_P(DrmHalTest, VendorUuidSupported) { TEST_P(DrmHalTest, InvalidPluginNotSupported) { const vector kInvalidUUID = {0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80}; - bool result = false; - auto ret = drmFactory->isCryptoSchemeSupported(toAidlUuid(kInvalidUUID), kVideoMp4, - kSwSecureCrypto, &result); - EXPECT_OK(ret); + auto result = isCryptoSchemeSupported(toAidlUuid(kInvalidUUID), kSwSecureCrypto, kVideoMp4); EXPECT_FALSE(result); } @@ -93,10 +87,7 @@ TEST_P(DrmHalTest, InvalidPluginNotSupported) { TEST_P(DrmHalTest, EmptyPluginUUIDNotSupported) { vector emptyUUID(16); memset(emptyUUID.data(), 0, 16); - bool result = false; - auto ret = drmFactory->isCryptoSchemeSupported(toAidlUuid(emptyUUID), kVideoMp4, - kSwSecureCrypto, &result); - EXPECT_OK(ret); + auto result = isCryptoSchemeSupported(toAidlUuid(emptyUUID), kSwSecureCrypto, kVideoMp4); EXPECT_FALSE(result); } @@ -104,10 +95,7 @@ TEST_P(DrmHalTest, EmptyPluginUUIDNotSupported) { * Ensure drm factory doesn't support an invalid mime type */ TEST_P(DrmHalTest, BadMimeNotSupported) { - bool result = false; - auto ret = - drmFactory->isCryptoSchemeSupported(getAidlUUID(), kBadMime, kSwSecureCrypto, &result); - EXPECT_OK(ret); + auto result = isCryptoSchemeSupported(getAidlUUID(), kSwSecureCrypto, kBadMime); EXPECT_FALSE(result); } @@ -380,9 +368,7 @@ TEST_P(DrmHalTest, EncryptedAesCtrSegmentTestNoKeys) { * Ensure clearkey drm factory doesn't support security level higher than supported */ TEST_P(DrmHalClearkeyTest, BadLevelNotSupported) { - bool result = false; - auto ret = drmFactory->isCryptoSchemeSupported(getAidlUUID(), kVideoMp4, kHwSecureAll, &result); - EXPECT_OK(ret); + auto result = isCryptoSchemeSupported(getAidlUUID(), kHwSecureAll, kVideoMp4); EXPECT_FALSE(result); } @@ -461,7 +447,7 @@ TEST_P(DrmHalClearkeyTest, ListenerCallbacks) { const vector keyStatusList = { {{0xa, 0xb, 0xc}, KeyStatusType::USABLE}, {{0xd, 0xe, 0xf}, KeyStatusType::EXPIRED}, - {{0x0, 0x1, 0x2}, KeyStatusType::USABLEINFUTURE}, + {{0x0, 0x1, 0x2}, KeyStatusType::USABLE_IN_FUTURE}, }; EXPECT_EQ(sessionId, args.sessionId); EXPECT_EQ(keyStatusList, args.keyStatusList); diff --git a/drm/aidl/vts/drm_hal_test_main.cpp b/drm/aidl/vts/drm_hal_test_main.cpp index dc0f6d7d5f..833a51aeed 100644 --- a/drm/aidl/vts/drm_hal_test_main.cpp +++ b/drm/aidl/vts/drm_hal_test_main.cpp @@ -42,21 +42,15 @@ using drm_vts::DrmHalTestParam; using drm_vts::PrintParamInstanceToString; static const std::vector getAllInstances() { - using ::aidl::android::hardware::drm::ICryptoFactory; using ::aidl::android::hardware::drm::IDrmFactory; std::vector drmInstances = android::getAidlHalInstanceNames(IDrmFactory::descriptor); - std::vector cryptoInstances = - android::getAidlHalInstanceNames(ICryptoFactory::descriptor); std::set allInstances; for (auto svc : drmInstances) { allInstances.insert(HalBaseName(svc)); } - for (auto svc : cryptoInstances) { - allInstances.insert(HalBaseName(svc)); - } std::vector allInstanceUuidCombos; auto noUUID = [](std::string s) { return DrmHalTestParam(s); }; diff --git a/drm/aidl/vts/include/drm_hal_common.h b/drm/aidl/vts/include/drm_hal_common.h index 4aac48bbb8..2c7e514291 100644 --- a/drm/aidl/vts/include/drm_hal_common.h +++ b/drm/aidl/vts/include/drm_hal_common.h @@ -18,14 +18,17 @@ #include #include -#include #include #include #include #include #include +#include + +#include #include +#include #include #include #include @@ -35,8 +38,6 @@ #include #include -#include - #include "VtsHalHidlTargetCallbackBase.h" #include "drm_hal_vendor_module_api.h" #include "drm_vts_helper.h" @@ -80,11 +81,14 @@ class DrmHalTest : public ::testing::TestWithParam { std::array GetParamUUID() { return GetParam().scheme_; } std::string GetParamService() { return GetParam().instance_; } ::aidl::android::hardware::drm::Uuid toAidlUuid(const std::vector& in_uuid) { - ::aidl::android::hardware::drm::Uuid uuid; - uuid.uuid = in_uuid; - return uuid; + std::array a; + std::copy_n(in_uuid.begin(), a.size(), a.begin()); + return {a}; } + bool isCryptoSchemeSupported(::aidl::android::hardware::drm::Uuid uuid, + ::aidl::android::hardware::drm::SecurityLevel level, + std::string mime); void provision(); SessionId openSession(::aidl::android::hardware::drm::SecurityLevel level, ::aidl::android::hardware::drm::Status* err); @@ -106,8 +110,8 @@ class DrmHalTest : public ::testing::TestWithParam { KeyedVector toAidlKeyedVector(const std::map& params); std::array toStdArray(const std::vector& vec); - void fillRandom(const ::aidl::android::hardware::common::Ashmem& ashmem); - ::aidl::android::hardware::common::Ashmem getDecryptMemory(size_t size, size_t index); + uint8_t* fillRandom(const ::aidl::android::hardware::drm::SharedBuffer& buf); + void getDecryptMemory(size_t size, size_t index, SharedBuffer& buf); uint32_t decrypt(::aidl::android::hardware::drm::Mode mode, bool isSecure, const std::array& keyId, uint8_t* iv, @@ -123,7 +127,6 @@ class DrmHalTest : public ::testing::TestWithParam { const std::vector& key); std::shared_ptr<::aidl::android::hardware::drm::IDrmFactory> drmFactory; - std::shared_ptr<::aidl::android::hardware::drm::ICryptoFactory> cryptoFactory; std::shared_ptr<::aidl::android::hardware::drm::IDrmPlugin> drmPlugin; std::shared_ptr<::aidl::android::hardware::drm::ICryptoPlugin> cryptoPlugin; @@ -139,16 +142,13 @@ class DrmHalClearkeyTest : public DrmHalTest { public: virtual void SetUp() override { DrmHalTest::SetUp(); - const std::vector kClearKeyUUID = {0xE2, 0x71, 0x9D, 0x58, 0xA9, 0x85, 0xB3, 0xC9, - 0x78, 0x1A, 0xB0, 0x30, 0xAF, 0x78, 0xD3, 0x0E}; + auto kClearKeyUUID = toAidlUuid({0xE2, 0x71, 0x9D, 0x58, 0xA9, 0x85, 0xB3, 0xC9, + 0x78, 0x1A, 0xB0, 0x30, 0xAF, 0x78, 0xD3, 0x0E}); static const std::string kMimeType = "video/mp4"; static constexpr ::aidl::android::hardware::drm::SecurityLevel kSecurityLevel = ::aidl::android::hardware::drm::SecurityLevel::SW_SECURE_CRYPTO; - bool drmClearkey = false; - auto ret = drmFactory->isCryptoSchemeSupported(toAidlUuid(kClearKeyUUID), kMimeType, - kSecurityLevel, &drmClearkey); - if (!drmClearkey) { + if (!isCryptoSchemeSupported(kClearKeyUUID, kSecurityLevel, kMimeType)) { GTEST_SKIP() << "ClearKey not supported by " << GetParamService(); } } -- GitLab From 014246544450b1f79a1dc8a7f956d1152cb61493 Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Thu, 10 Feb 2022 18:16:34 +0000 Subject: [PATCH 605/825] Remove hostapd and supplicant HIDL HALs from the current compatibility matrix. Bug: 196235436 Test: Build Change-Id: Id4cca2932b03023ba45e0a5773bf703dcd78b9f7 --- .../compatibility_matrix.current.xml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 95ba217fb0..7c689d8b1e 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -830,14 +830,6 @@ default - - android.hardware.wifi.hostapd - 1.0-3 - - IHostapd - default - - android.hardware.wifi.hostapd 1 @@ -846,14 +838,6 @@ default - - android.hardware.wifi.supplicant - 1.2-4 - - ISupplicant - default - - android.hardware.wifi.supplicant -- GitLab From 8db34352b72106e73a52425901be648e1daa3bf8 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 10 Feb 2022 10:54:31 -0800 Subject: [PATCH 606/825] uwb(hal): Switch ANDROID GID to 0xC Based on vendor feedback since 0xE is already being used for a bunch of vendor specific stuff. Bug: 210933436 Bug: 218883784 Test: Compiles Change-Id: I49b5018569164a52fa7c9f78ca9c69a181747f44 --- .../android/hardware/uwb/fira_android/UwbVendorGids.aidl | 2 +- .../hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl | 1 + uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGids.aidl | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl index b0d88e0c94..5515c67961 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl @@ -34,5 +34,5 @@ package android.hardware.uwb.fira_android; @Backing(type="byte") @VintfStability enum UwbVendorGids { - ANDROID = 14, + ANDROID = 12, } diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl index c04bdcfcd9..e389a2dd23 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl @@ -19,6 +19,7 @@ package android.hardware.uwb.fira_android; /** * Android specific vendor command OIDs should be defined here. * + * For use with Android GID - 0xC. */ @VintfStability @Backing(type="byte") diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGids.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGids.aidl index c7bc6b051c..dbe00cbcd7 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGids.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGids.aidl @@ -32,5 +32,5 @@ enum UwbVendorGids { */ /** All Android specific commands/response/notification should use this GID */ - ANDROID = 0xE, + ANDROID = 0xC, } -- GitLab From 13cb922a0542cd211c19fddb1f936bb39743a676 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Thu, 10 Feb 2022 13:39:55 -0800 Subject: [PATCH 607/825] [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces Added SPDX-license-identifier-Apache-2.0 to: camera/common/aidl/Android.bp camera/device/aidl/Android.bp camera/metadata/aidl/Android.bp usb/aidl/Android.bp usb/aidl/default/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Change-Id: Ie530a51faa37d782428a20238e78573658697be8 --- camera/common/aidl/Android.bp | 9 +++++++++ camera/device/aidl/Android.bp | 9 +++++++++ camera/metadata/aidl/Android.bp | 9 +++++++++ usb/aidl/Android.bp | 9 +++++++++ usb/aidl/default/Android.bp | 9 +++++++++ 5 files changed, 45 insertions(+) diff --git a/camera/common/aidl/Android.bp b/camera/common/aidl/Android.bp index eca70aa170..39857efc95 100644 --- a/camera/common/aidl/Android.bp +++ b/camera/common/aidl/Android.bp @@ -1,3 +1,12 @@ +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.camera.common", vendor_available: true, diff --git a/camera/device/aidl/Android.bp b/camera/device/aidl/Android.bp index b6cbea4b83..b6f4c58ae7 100644 --- a/camera/device/aidl/Android.bp +++ b/camera/device/aidl/Android.bp @@ -1,3 +1,12 @@ +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.camera.device", vendor_available: true, diff --git a/camera/metadata/aidl/Android.bp b/camera/metadata/aidl/Android.bp index 05f280c6f1..c5f16e64d9 100644 --- a/camera/metadata/aidl/Android.bp +++ b/camera/metadata/aidl/Android.bp @@ -1,3 +1,12 @@ +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.camera.metadata", vendor_available: true, diff --git a/usb/aidl/Android.bp b/usb/aidl/Android.bp index d1e9e680e9..f71cacb686 100644 --- a/usb/aidl/Android.bp +++ b/usb/aidl/Android.bp @@ -12,6 +12,15 @@ // 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.usb", vendor_available: true, diff --git a/usb/aidl/default/Android.bp b/usb/aidl/default/Android.bp index da0cff23c3..7cb2822312 100644 --- a/usb/aidl/default/Android.bp +++ b/usb/aidl/default/Android.bp @@ -14,6 +14,15 @@ // 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.usb-service.example", relative_install_path: "hw", -- GitLab From b1f16725cc7c872f01ba291f9d3b26ecb718e4a9 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Mon, 7 Feb 2022 13:03:44 -0800 Subject: [PATCH 608/825] Provide dimming ratio instead of white point nits in composer There are several reasons for limiting the notion of white point nits in the composer interface: 1. Some KMS apis exposed by drivers only expose a notion of a per-plane brightness. While these are non-mobile drivers, e.g., nouveau, this does indicate that white point is not directly going to be understood by typical hardware 2. Changing the brightness without requiring a frame update introduces implicit state in composer. If the brightness and white point nits for a set of SDR layers are 200 nits, and the brightness changes to 205 nits to respond to ambient conditions, then composer must not dim the layers, and in fact DisplayManager will tell SurfaceFlinger that the SDR white point will be 205 nits. But SurfaceFlinger will not tell composer that the SDR white point changed as that would otherwise introduce a re-composition cycle, meaning that HW Composer must track somehow that the layer white point changed without a corresponding change on the layer data structure, which is confusing. 3. It's poorly defined what the dimming ratio should be if SurfaceFlinger provides the following inputs: Layer A has a white point of 200 nits, Layer B has a white point of 400 nits, and display brightness is 300 nits. Current implementations may clamp the brightness of Layer B to be 300 nits and dim layer A by 2/3s, but there is an equally valid interpretation which is just dim Layer A to be 50% of Layer B's brightness. 4. The problem indicated by (2) and (3) suggests that layer white point is really an up-stack concept, that SurfaceFlinger can be aware of for properly computing the dimming ratios it can send to composer, but the composer hal shouldn't really be speaking in terms of nits. Note that this patch does not yet change the interface for ClientTargetWithNits, which may be done in a follow-up patch. Bug: 217961164 Test: builds, boots Change-Id: I4a1b4e8c300d22599a5683bd44b7b8afa9a29425 --- .../{Luminance.aidl => LayerBrightness.aidl} | 4 +-- .../graphics/composer3/LayerCommand.aidl | 2 +- .../graphics/composer3/DisplayCommand.aidl | 10 +------- .../{Luminance.aidl => LayerBrightness.aidl} | 8 +++--- .../graphics/composer3/LayerCommand.aidl | 12 ++++----- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 4 ++- .../VtsHalGraphicsComposer3_TargetTest.cpp | 25 +++++++++++++------ .../functional/composer-vts/ReadbackVts.cpp | 2 +- .../composer-vts/include/ReadbackVts.h | 4 ++- .../graphics/composer3/ComposerClientWriter.h | 7 +++--- 10 files changed, 43 insertions(+), 35 deletions(-) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{Luminance.aidl => LayerBrightness.aidl} (97%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{Luminance.aidl => LayerBrightness.aidl} (76%) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Luminance.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerBrightness.aidl similarity index 97% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Luminance.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerBrightness.aidl index adb49a81b4..a726cc12bf 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Luminance.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerBrightness.aidl @@ -33,6 +33,6 @@ package android.hardware.graphics.composer3; @VintfStability -parcelable Luminance { - float nits; +parcelable LayerBrightness { + float brightness; } 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 c1c01172c1..0c5fac9640 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 @@ -50,7 +50,7 @@ parcelable LayerCommand { @nullable android.hardware.graphics.common.Rect[] visibleRegion; @nullable android.hardware.graphics.composer3.ZOrder z; @nullable float[] colorTransform; - @nullable android.hardware.graphics.composer3.Luminance whitePointNits; + @nullable android.hardware.graphics.composer3.LayerBrightness brightness; @nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata; @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob; @nullable android.hardware.graphics.common.Rect[] blockingRegion; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl index f1ce1a7dad..b6df147df8 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl @@ -77,15 +77,7 @@ parcelable DisplayCommand { * the display brightness, for example when internally switching the display between multiple * power modes to achieve higher luminance. In those cases, the underlying display panel's real * brightness may not be applied atomically; however, layer dimming when mixing HDR and SDR - * content must be synchronized. - * - * As an illustrative example: suppose two layers have white - * points of 200 nits and 1000 nits respectively, the old display luminance is 200 nits, and the - * new display luminance is 1000 nits. If the new display luminance takes two frames to apply, - * then: In the first frame, there must not be any relative dimming of layers (treat both layers - * as 200 nits as the maximum luminance of the display is 200 nits). In the second frame, there - * dimming should be applied to ensure that the first layer does not become perceptually - * brighter during the transition. + * content must be synchronized to ensure that there is no user-perceptable flicker. * * The display luminance must be updated by this command even if there is not pending validate * or present command. diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Luminance.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerBrightness.aidl similarity index 76% rename from graphics/composer/aidl/android/hardware/graphics/composer3/Luminance.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/LayerBrightness.aidl index 5b1c1b40fe..146e0127df 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Luminance.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerBrightness.aidl @@ -17,10 +17,10 @@ package android.hardware.graphics.composer3; @VintfStability -parcelable Luminance { +parcelable LayerBrightness { /** - * Photometric measure of luminous intensity per unit area of light. - * Units are nits, or cd/m^2. + * Brightness of the current layer, ranging from 0 to 1, where 0 is the minimum brightness of + * the display, and 1 is the current brightness of the display. */ - float nits; + float brightness; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index 6f6894fcdd..f3b67a99b3 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl @@ -22,7 +22,7 @@ import android.hardware.graphics.common.Point; import android.hardware.graphics.common.Rect; import android.hardware.graphics.composer3.Buffer; import android.hardware.graphics.composer3.Color; -import android.hardware.graphics.composer3.Luminance; +import android.hardware.graphics.composer3.LayerBrightness; import android.hardware.graphics.composer3.ParcelableBlendMode; import android.hardware.graphics.composer3.ParcelableComposition; import android.hardware.graphics.composer3.ParcelableDataspace; @@ -221,12 +221,12 @@ parcelable LayerCommand { @nullable float[] colorTransform; /** - * Sets the desired white point for the layer. This is intended to be used when presenting - * an SDR layer alongside HDR content. The HDR content will be presented at the display - * brightness in nits, and accordingly SDR content shall be dimmed to the desired white point - * provided. + * Sets the desired brightness for the layer. This is intended to be used for instance when + * presenting an SDR layer alongside HDR content. The HDR content will be presented at the + * display brightness in nits, and accordingly SDR content shall be dimmed according to the + * provided brightness ratio. */ - @nullable Luminance whitePointNits; + @nullable LayerBrightness brightness; /** * Sets the PerFrameMetadata for the display. This metadata must be used diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 45a8f6f359..a179f1bcbf 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -965,7 +965,7 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { } } -TEST_P(GraphicsCompositionTest, SetLayerWhitePointDims) { +TEST_P(GraphicsCompositionTest, SetLayerBrightnessDims) { const auto& [status, capabilities] = mComposerClient->getDisplayCapabilities(getPrimaryDisplayId()); ASSERT_TRUE(status.isOk()); @@ -1013,6 +1013,7 @@ TEST_P(GraphicsCompositionTest, SetLayerWhitePointDims) { redLayer->setColor(RED); redLayer->setDisplayFrame(redRect); redLayer->setWhitePointNits(maxBrightnessNits); + redLayer->setBrightness(1.f); const auto dimmerRedLayer = std::make_shared(mComposerClient, getPrimaryDisplayId()); @@ -1022,6 +1023,7 @@ TEST_P(GraphicsCompositionTest, SetLayerWhitePointDims) { // kick into GPU composition to apply dithering when the dimming ratio is high. static constexpr float kDimmingRatio = 0.9f; dimmerRedLayer->setWhitePointNits(maxBrightnessNits * kDimmingRatio); + dimmerRedLayer->setBrightness(kDimmingRatio); const std::vector> layers = {redLayer, dimmerRedLayer}; std::vector expectedColors( diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 17ec8854e9..8d4bc11950 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1798,26 +1798,37 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerPerFrameMetadata) { EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk()); } -TEST_P(GraphicsComposerAidlCommandTest, SetLayerWhitePointNits) { +TEST_P(GraphicsComposerAidlCommandTest, setLayerBrightness) { const auto& [layerStatus, layer] = mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); - EXPECT_TRUE(layerStatus.isOk()); - mWriter.setLayerWhitePointNits(getPrimaryDisplayId(), layer, /*whitePointNits*/ 200.f); + mWriter.setLayerBrightness(getPrimaryDisplayId(), layer, 0.2f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerWhitePointNits(getPrimaryDisplayId(), layer, /*whitePointNits*/ 1000.f); + mWriter.setLayerBrightness(getPrimaryDisplayId(), layer, 1.f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerWhitePointNits(getPrimaryDisplayId(), layer, /*whitePointNits*/ 0.f); + mWriter.setLayerBrightness(getPrimaryDisplayId(), layer, 0.f); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - mWriter.setLayerWhitePointNits(getPrimaryDisplayId(), layer, /*whitePointNits*/ -1.f); + mWriter.setLayerBrightness(getPrimaryDisplayId(), layer, -1.f); execute(); - ASSERT_TRUE(mReader.takeErrors().empty()); + { + const auto errors = mReader.takeErrors(); + ASSERT_EQ(1, errors.size()); + EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode); + } + + mWriter.setLayerBrightness(getPrimaryDisplayId(), layer, std::nanf("")); + execute(); + { + const auto errors = mReader.takeErrors(); + ASSERT_EQ(1, errors.size()); + EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode); + } } TEST_P(GraphicsComposerAidlCommandTest, SetActiveConfigWithConstraints) { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp index 1aca76f3c8..f163e09fb7 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp @@ -34,7 +34,7 @@ void TestLayer::write(ComposerClientWriter& writer) { writer.setLayerTransform(mDisplay, mLayer, mTransform); writer.setLayerPlaneAlpha(mDisplay, mLayer, mAlpha); writer.setLayerBlendMode(mDisplay, mLayer, mBlendMode); - writer.setLayerWhitePointNits(mDisplay, mLayer, mWhitePointNits); + writer.setLayerBrightness(mDisplay, mLayer, mBrightness); } std::string ReadbackHelper::getColorModeString(ColorMode mode) { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h index 7135dcae77..ce30db0704 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h @@ -67,6 +67,7 @@ class TestLayer { void setSourceCrop(FRect crop) { mSourceCrop = crop; } void setZOrder(uint32_t z) { mZOrder = z; } void setWhitePointNits(float whitePointNits) { mWhitePointNits = whitePointNits; } + void setBrightness(float brightness) { mBrightness = brightness; } void setSurfaceDamage(std::vector surfaceDamage) { mSurfaceDamage = std::move(surfaceDamage); @@ -84,12 +85,13 @@ class TestLayer { int64_t getLayer() const { return mLayer; } - float getWhitePointNits() const { return mWhitePointNits; } + float getBrightness() const { return mBrightness; } protected: int64_t mDisplay; int64_t mLayer; Rect mDisplayFrame = {0, 0, 0, 0}; + float mBrightness = 1.f; float mWhitePointNits = -1.f; std::vector mSurfaceDamage; Transform mTransform = static_cast(0); 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 a04b9824c4..ae17c51ea2 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include @@ -209,8 +209,9 @@ class ComposerClientWriter { .perFrameMetadataBlob.emplace(metadata.begin(), metadata.end()); } - void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) { - getLayerCommand(display, layer).whitePointNits.emplace(Luminance{.nits = whitePointNits}); + void setLayerBrightness(int64_t display, int64_t layer, float brightness) { + getLayerCommand(display, layer) + .brightness.emplace(LayerBrightness{.brightness = brightness}); } void setLayerBlockingRegion(int64_t display, int64_t layer, const std::vector& blocking) { -- GitLab From e8f2f7ccf98c7796a0238eea5fc46332f90c7523 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Thu, 10 Feb 2022 12:27:04 -0800 Subject: [PATCH 609/825] Clarify getHardwareInfo() beavhior Bug: 184017033 Bug: 218911006 Fix: 218911006 Test: make Change-Id: Ica02177f4804fcb9b71062912f6c44836a7044f5 --- tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl index 12f2692992..9cbd3dda87 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl @@ -142,7 +142,9 @@ interface IFrontend { * Request Hardware information about the frontend. * * The client may use this to collect vendor specific hardware information, e.g. RF - * chip version, Demod chip version, detailed status of dvbs blind scan, etc. + * chip version, Demod chip version, detailed status of dvbs blind scan, etc. The + * client shouldn’t parse things or rely on any format or change their behavior + * based on results. * * @return the frontend hardware information. */ -- GitLab From f335be12c6920f792c1d2a5a129a9e8ce9f7ceaf Mon Sep 17 00:00:00 2001 From: Purushottam Kushwaha Date: Fri, 7 Jan 2022 19:12:05 +0530 Subject: [PATCH 610/825] Supplicant: Add support for DPP AKM configuration and connection. This commit adds HAL interfaces needed to facilitate DPP AKM based configuration and connection to DPP network. Bug: 207732665 Test: vts test Change-Id: Ibea85c9c50b6ce7da77477c399e95f45d924fcb6 Signed-off-by: Purushottam Kushwaha --- .../wifi/supplicant/DppConnectionKeys.aidl | 40 +++++++++++++++++++ .../wifi/supplicant/ISupplicantStaIface.aidl | 3 +- .../ISupplicantStaIfaceCallback.aidl | 2 +- .../supplicant/ISupplicantStaNetwork.aidl | 1 + .../wifi/supplicant/DppConnectionKeys.aidl | 36 +++++++++++++++++ .../wifi/supplicant/ISupplicantStaIface.aidl | 31 ++++++++++++-- .../ISupplicantStaIfaceCallback.aidl | 9 +++-- .../supplicant/ISupplicantStaNetwork.aidl | 13 ++++++ .../supplicant_sta_iface_aidl_test.cpp | 21 +++++----- 9 files changed, 139 insertions(+), 17 deletions(-) create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppConnectionKeys.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppConnectionKeys.aidl diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppConnectionKeys.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppConnectionKeys.aidl new file mode 100644 index 0000000000..559d1c94ce --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppConnectionKeys.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 -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 DppConnectionKeys { + byte[] connector; + byte[] cSign; + byte[] netAccessKey; +} 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 5c0aacd423..3368a00a3c 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 @@ -44,6 +44,7 @@ interface ISupplicantStaIface { void filsHlpAddRequest(in byte[] dst_mac, in byte[] pkt); void filsHlpFlushRequest(); android.hardware.wifi.supplicant.DppResponderBootstrapInfo generateDppBootstrapInfoForResponder(in byte[] macAddress, in String deviceInfo, in android.hardware.wifi.supplicant.DppCurve curve); + void generateSelfDppConfiguration(in String ssid, in byte[] privEcKey); android.hardware.wifi.supplicant.ConnectionCapabilities getConnectionCapabilities(); android.hardware.wifi.supplicant.KeyMgmtMask getKeyMgmtCapabilities(); byte[] getMacAddress(); @@ -82,7 +83,7 @@ interface ISupplicantStaIface { void setWpsModelName(in String modelName); void setWpsModelNumber(in String modelNumber); void setWpsSerialNumber(in String serialNumber); - void startDppConfiguratorInitiator(in int peerBootstrapId, in int ownBootstrapId, in String ssid, in String password, in String psk, in android.hardware.wifi.supplicant.DppNetRole netRole, in android.hardware.wifi.supplicant.DppAkm securityAkm); + byte[] startDppConfiguratorInitiator(in int peerBootstrapId, in int ownBootstrapId, in String ssid, in String password, in String psk, in android.hardware.wifi.supplicant.DppNetRole netRole, in android.hardware.wifi.supplicant.DppAkm securityAkm, in byte[] privEcKey); void startDppEnrolleeInitiator(in int peerBootstrapId, in int ownBootstrapId); void startDppEnrolleeResponder(in int listenChannel); void startRxFilter(); 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 c17c624eb1..8d11d414dc 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 @@ -43,7 +43,7 @@ interface ISupplicantStaIfaceCallback { oneway void onDppFailure(in android.hardware.wifi.supplicant.DppFailureCode code, in String ssid, in String channelList, in char[] bandList); oneway void onDppProgress(in android.hardware.wifi.supplicant.DppProgressCode code); oneway void onDppSuccess(in android.hardware.wifi.supplicant.DppEventType event); - oneway void onDppSuccessConfigReceived(in byte[] ssid, in String password, in byte[] psk, in android.hardware.wifi.supplicant.DppAkm securityAkm); + oneway void onDppSuccessConfigReceived(in byte[] ssid, in String password, in byte[] psk, in android.hardware.wifi.supplicant.DppAkm securityAkm, in android.hardware.wifi.supplicant.DppConnectionKeys dppConnectionKeys); oneway void onDppSuccessConfigSent(); oneway void onEapFailure(in int errorCode); oneway void onExtRadioWorkStart(in int id); 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 bdc5f3483c..0b3cb8156e 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 @@ -87,6 +87,7 @@ interface ISupplicantStaNetwork { void sendNetworkEapSimUmtsAutsResponse(in byte[] auts); void setAuthAlg(in android.hardware.wifi.supplicant.AuthAlgMask authAlgMask); void setBssid(in byte[] bssid); + void setDppKeys(in android.hardware.wifi.supplicant.DppConnectionKeys keys); void setEapAltSubjectMatch(in String match); void setEapAnonymousIdentity(in byte[] identity); void setEapCACert(in String path); diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppConnectionKeys.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppConnectionKeys.aidl new file mode 100644 index 0000000000..056756b365 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppConnectionKeys.aidl @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * connection keys that are used for DPP network connection. + */ +@VintfStability +parcelable DppConnectionKeys { + /** + * DPP Connector (signedConnector) + */ + byte[] connector; + /** + * C-sign-key (Configurator public key) + */ + byte[] cSign; + /** + * DPP net access key (own private key) + */ + byte[] netAccessKey; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl index a48a9917b5..c88a92cfe4 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl @@ -178,6 +178,24 @@ interface ISupplicantStaIface { DppResponderBootstrapInfo generateDppBootstrapInfoForResponder( in byte[] macAddress, in String deviceInfo, in DppCurve curve); + /** + * To Onboard / Configure self with DPP credentials. + * + * This is used to generate DppConnectionKeys for self. Thus a configurator + * can use the credentials to connect to an AP which it has configured for + * DPP AKM. This should be called before initiating first DPP connection + * on Configurator side. This API generates onDppSuccessConfigReceived() + * callback event asynchronously with DppConnectionKeys. + * + * @param ssid Network SSID configured profile + * @param privEcKey Private EC keys for this profile which was used to + * configure other enrollee in network. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN| + * |SupplicantStatusCode.FAILURE_UNSUPPORTED| + */ + void generateSelfDppConfiguration(in String ssid, in byte[] privEcKey); + /** * Get Connection capabilities * @@ -620,20 +638,27 @@ interface ISupplicantStaIface { * * @param peerBootstrapId Peer device's URI ID. * @param ownBootstrapId Local device's URI ID (0 for none, optional). - * @param ssid Network SSID to send to peer (SAE/PSK mode). + * @param ssid Network SSID to send to peer (SAE/PSK/DPP mode). * @param password Network password to send to peer (SAE/PSK mode). * @param psk Network PSK to send to peer (PSK mode only). Either password or psk should be set. * @param netRole Role to configure the peer, |DppNetRole.DPP_NET_ROLE_STA| or * |DppNetRole.DPP_NET_ROLE_AP|. * @param securityAkm Security AKM to use (See DppAkm). + * @param privEcKey Private EC keys for this profile which was used to + * configure other enrollee in network. This param is valid only for DPP AKM. + * This param is set to Null by configurator to indicate first DPP-AKM based + * configuration to an Enrollee. non-Null value indicates configurator had + * previously configured an enrollee. + * @return Return the Private EC key when securityAkm is DPP and privEcKey was Null. + * Otherwise return Null. * @throws ServiceSpecificException with one of the following values: * |SupplicantStatusCode.FAILURE_ARGS_INVALID|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_NETWORK_INVALID| */ - void startDppConfiguratorInitiator(in int peerBootstrapId, in int ownBootstrapId, + byte[] startDppConfiguratorInitiator(in int peerBootstrapId, in int ownBootstrapId, in String ssid, in String password, in String psk, in DppNetRole netRole, - in DppAkm securityAkm); + in DppAkm securityAkm, in byte[] privEcKey); /** * Start DPP in Enrollee-Initiator mode. diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index ca63f5c40d..369d0dac16 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -21,6 +21,7 @@ import android.hardware.wifi.supplicant.AssociationRejectionData; import android.hardware.wifi.supplicant.BssTmData; import android.hardware.wifi.supplicant.BssidChangeReason; import android.hardware.wifi.supplicant.DppAkm; +import android.hardware.wifi.supplicant.DppConnectionKeys; import android.hardware.wifi.supplicant.DppEventType; import android.hardware.wifi.supplicant.DppFailureCode; import android.hardware.wifi.supplicant.DppProgressCode; @@ -128,10 +129,12 @@ interface ISupplicantStaIfaceCallback { oneway void onDppSuccess(in DppEventType event); /** - * Indicates DPP configuration received success event (Enrolee mode). + * Indicates DPP configuration received success event in Enrolee mode. + * This is also triggered when Configurator generates credentials for itself + * using generateSelfDppConfiguration() API */ - oneway void onDppSuccessConfigReceived( - in byte[] ssid, in String password, in byte[] psk, in DppAkm securityAkm); + oneway void onDppSuccessConfigReceived(in byte[] ssid, in String password, in byte[] psk, + in DppAkm securityAkm, in DppConnectionKeys dppConnectionKeys); /** * Indicates DPP configuration sent success event (Configurator mode). diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl index 1a2087dbe1..267f1e876a 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl @@ -17,6 +17,7 @@ package android.hardware.wifi.supplicant; import android.hardware.wifi.supplicant.AuthAlgMask; +import android.hardware.wifi.supplicant.DppConnectionKeys; import android.hardware.wifi.supplicant.EapMethod; import android.hardware.wifi.supplicant.EapPhase2Method; import android.hardware.wifi.supplicant.GroupCipherMask; @@ -638,6 +639,18 @@ interface ISupplicantStaNetwork { */ void setBssid(in byte[] bssid); + /** + * Set DPP keys for network which supports DPP AKM. + * + * @param keys connection keys needed to make DPP + * AKM based network connection. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_ARGS_INVALID|, + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_NETWORK_INVALID| + */ + void setDppKeys(in DppConnectionKeys keys); + /** * Set EAP Alt subject match for this network. * 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 c163864c4d..fdafe08704 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 @@ -33,6 +33,7 @@ using aidl::android::hardware::wifi::supplicant::BtCoexistenceMode; using aidl::android::hardware::wifi::supplicant::ConnectionCapabilities; using aidl::android::hardware::wifi::supplicant::DebugLevel; using aidl::android::hardware::wifi::supplicant::DppAkm; +using aidl::android::hardware::wifi::supplicant::DppConnectionKeys; using aidl::android::hardware::wifi::supplicant::DppCurve; using aidl::android::hardware::wifi::supplicant::DppNetRole; using aidl::android::hardware::wifi::supplicant::DppResponderBootstrapInfo; @@ -112,11 +113,11 @@ class SupplicantStaIfaceCallback : public BnSupplicantStaIfaceCallback { return ndk::ScopedAStatus::ok(); } ::ndk::ScopedAStatus onDppSuccessConfigReceived( - const std::vector& /* ssid */, - const std::string& /* password */, - const std::vector& /* psk */, - ::aidl::android::hardware::wifi::supplicant::DppAkm /* securityAkm */) - override { + const std::vector& /* ssid */, const std::string& /* password */, + const std::vector& /* psk */, + ::aidl::android::hardware::wifi::supplicant::DppAkm /* securityAkm */, + const ::aidl::android::hardware::wifi::supplicant:: + DppConnectionKeys& /* DppConnectionKeys */) override { return ndk::ScopedAStatus::ok(); } ::ndk::ScopedAStatus onDppSuccessConfigSent() override { @@ -755,14 +756,16 @@ TEST_P(SupplicantStaIfaceAidlTest, StartDppConfiguratorInitiator) { "6D795F746573745F73736964"; // 'my_test_ssid' encoded in hex const std::string password = "746F70736563726574"; // 'topsecret' encoded in hex + const std::vector eckey_in = {0x2, 0x3, 0x4}; + std::vector eckey_out = {}; // Start DPP as Configurator-Initiator. Since this operation requires two // devices, we start the operation and expect a timeout. EXPECT_TRUE(sta_iface_ - ->startDppConfiguratorInitiator(peer_id, 0, ssid, password, - "", DppNetRole::STA, - DppAkm::PSK) - .isOk()); + ->startDppConfiguratorInitiator(peer_id, 0, ssid, password, "", + DppNetRole::STA, DppAkm::PSK, eckey_in, + &eckey_out) + .isOk()); // Wait for the timeout callback ASSERT_EQ(std::cv_status::no_timeout, -- GitLab From f730788ee9fe41dca23db79d49534ee57fa6609f Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Fri, 11 Feb 2022 07:50:45 -0800 Subject: [PATCH 611/825] Fix EVS Stream definition Bug: 170401743 Test: Manually confirmed a framerate from EVS app Change-Id: I1c78949cb7dac4f6282a95dc9d5201d29b108677 --- .../current/android/hardware/automotive/evs/Stream.aidl | 1 + automotive/evs/aidl/android/hardware/automotive/evs/Stream.aidl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Stream.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Stream.aidl index a7804121b3..154a693a51 100644 --- a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Stream.aidl +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/current/android/hardware/automotive/evs/Stream.aidl @@ -38,6 +38,7 @@ parcelable Stream { android.hardware.automotive.evs.StreamType streamType; int width; int height; + int framerate; android.hardware.graphics.common.PixelFormat format; android.hardware.graphics.common.BufferUsage usage; android.hardware.automotive.evs.Rotation rotation; diff --git a/automotive/evs/aidl/android/hardware/automotive/evs/Stream.aidl b/automotive/evs/aidl/android/hardware/automotive/evs/Stream.aidl index ae5c7f0748..663ba229df 100644 --- a/automotive/evs/aidl/android/hardware/automotive/evs/Stream.aidl +++ b/automotive/evs/aidl/android/hardware/automotive/evs/Stream.aidl @@ -55,7 +55,7 @@ parcelable Stream { int height; /** * The frame rate of this stream in frames-per-second - / + */ int framerate; /** * The pixel format form the buffers in this stream. -- GitLab From 67534538672bff19b220a02570505ee53d50df26 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 11 Feb 2022 21:55:31 +0000 Subject: [PATCH 612/825] Remove default value for AP_POWER_STATE_REQ. Remove the default value for AP_POWER_STATE_REQ because initially the device should be in an OFF state, but there is no such AP_POWER_STATE_REQ. If we set the default value to ON, then when VHAL set the value to ON, it would cause no value update event to inform CarService. Test: atest FakeVehicleHardwareTest. Manually run audio test on cf target. Bug: 218924258 Change-Id: I3552a38bf2433015767c2254e42871cee5c9e716 --- .../default_config/include/DefaultConfig.h | 3 +- .../hardware/test/FakeVehicleHardwareTest.cpp | 73 +++++++++---------- 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h index d2b69af483..6ecac704f4 100644 --- a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +++ b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h @@ -754,8 +754,7 @@ const std::vector kVehicleProperties = { {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .configArray = {3}}, - .initialValue = {.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}}}, + .configArray = {3}}}, {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), .access = VehiclePropertyAccess::READ_WRITE, 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 0812c2a062..3dae9fc189 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -58,7 +58,6 @@ using ::android::base::unexpected; using ::testing::ContainerEq; using ::testing::ContainsRegex; using ::testing::Eq; -using ::testing::IsSubsetOf; using ::testing::WhenSortedBy; constexpr int INVALID_PROP_ID = 0; @@ -634,17 +633,17 @@ std::vector setSpecialValueTestCases() { }, .expectedValuesToGet = { - VehiclePropValue{ - .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), - .value.int32Values = {toInt( - VehicleApPowerStateReport::DEEP_SLEEP_EXIT)}, - }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, }, + VehiclePropValue{ + .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), + .value.int32Values = {toInt( + VehicleApPowerStateReport::DEEP_SLEEP_EXIT)}, + }, }, }, SetSpecialValueTestCase{ @@ -659,17 +658,17 @@ std::vector setSpecialValueTestCases() { }, .expectedValuesToGet = { - VehiclePropValue{ - .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), - .value.int32Values = {toInt( - VehicleApPowerStateReport::HIBERNATION_EXIT)}, - }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, }, + VehiclePropValue{ + .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), + .value.int32Values = {toInt( + VehicleApPowerStateReport::HIBERNATION_EXIT)}, + }, }, }, SetSpecialValueTestCase{ @@ -684,17 +683,17 @@ std::vector setSpecialValueTestCases() { }, .expectedValuesToGet = { - VehiclePropValue{ - .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), - .value.int32Values = {toInt( - VehicleApPowerStateReport::SHUTDOWN_CANCELLED)}, - }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, }, + VehiclePropValue{ + .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), + .value.int32Values = {toInt( + VehicleApPowerStateReport::SHUTDOWN_CANCELLED)}, + }, }, }, SetSpecialValueTestCase{ @@ -709,17 +708,17 @@ std::vector setSpecialValueTestCases() { }, .expectedValuesToGet = { - VehiclePropValue{ - .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), - .value.int32Values = {toInt( - VehicleApPowerStateReport::WAIT_FOR_VHAL)}, - }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, }, + VehiclePropValue{ + .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), + .value.int32Values = {toInt( + VehicleApPowerStateReport::WAIT_FOR_VHAL)}, + }, }, }, SetSpecialValueTestCase{ @@ -734,17 +733,17 @@ std::vector setSpecialValueTestCases() { }, .expectedValuesToGet = { - VehiclePropValue{ - .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), - .value.int32Values = {toInt( - VehicleApPowerStateReport::DEEP_SLEEP_ENTRY)}, - }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::FINISHED), 0}, }, + VehiclePropValue{ + .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), + .value.int32Values = {toInt( + VehicleApPowerStateReport::DEEP_SLEEP_ENTRY)}, + }, }, }, SetSpecialValueTestCase{ @@ -759,17 +758,17 @@ std::vector setSpecialValueTestCases() { }, .expectedValuesToGet = { - VehiclePropValue{ - .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), - .value.int32Values = {toInt( - VehicleApPowerStateReport::HIBERNATION_ENTRY)}, - }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::FINISHED), 0}, }, + VehiclePropValue{ + .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), + .value.int32Values = {toInt( + VehicleApPowerStateReport::HIBERNATION_ENTRY)}, + }, }, }, SetSpecialValueTestCase{ @@ -784,17 +783,17 @@ std::vector setSpecialValueTestCases() { }, .expectedValuesToGet = { - VehiclePropValue{ - .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), - .value.int32Values = {toInt( - VehicleApPowerStateReport::SHUTDOWN_START)}, - }, VehiclePropValue{ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::FINISHED), 0}, }, + VehiclePropValue{ + .prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), + .value.int32Values = {toInt( + VehicleApPowerStateReport::SHUTDOWN_START)}, + }, }, }, SetSpecialValueTestCase{ @@ -915,7 +914,7 @@ TEST_P(FakeVehicleHardwareSpecialValuesTest, testSetSpecialProperties) { // Some of the updated properties might be the same as default config, thus not causing // a property change event. So the changed properties should be a subset of all the updated // properties. - ASSERT_THAT(getChangedProperties(), WhenSortedBy(mPropValueCmp, IsSubsetOf(gotValues))); + ASSERT_THAT(getChangedProperties(), WhenSortedBy(mPropValueCmp, Eq(gotValues))); } INSTANTIATE_TEST_SUITE_P( -- GitLab From 05e2e84c609ce523dbeaac06e6c3b0d0b5e93c21 Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Sun, 13 Feb 2022 00:11:11 +0000 Subject: [PATCH 613/825] Update supplicant callbacks with reccomendations from the ANAPIC review. - Declare entire callback interfaces as oneway rather than each individual function. - Remove onTerminating() method from ISupplicantCallback. Bug: 215566635 Test: atest VtsHalWifiSupplicantStaIfaceTargetTest \ VtsHalWifiSupplicantStaNetworkTargetTest \ VtsHalWifiSupplicantP2pIfaceTargetTest Change-Id: Ia9c95ef1ad7ada99a7f778ea063b9036cb4e3b42 --- .../wifi/supplicant/ISupplicantCallback.aidl | 1 - .../wifi/supplicant/ISupplicantCallback.aidl | 11 +--- .../ISupplicantP2pIfaceCallback.aidl | 41 +++++++------ .../wifi/supplicant/ISupplicantStaIface.aidl | 4 +- .../ISupplicantStaIfaceCallback.aidl | 60 +++++++++---------- .../ISupplicantStaNetworkCallback.aidl | 12 ++-- 6 files changed, 60 insertions(+), 69 deletions(-) diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantCallback.aidl index 72ab3b9502..7281053cdb 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantCallback.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantCallback.aidl @@ -36,5 +36,4 @@ package android.hardware.wifi.supplicant; interface ISupplicantCallback { oneway void onInterfaceCreated(in String ifaceName); oneway void onInterfaceRemoved(in String ifaceName); - oneway void onTerminating(); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantCallback.aidl index 6f15900a24..8e59ec958d 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantCallback.aidl @@ -24,23 +24,18 @@ package android.hardware.wifi.supplicant; * |ISupplicant.registerCallback| method. */ @VintfStability -interface ISupplicantCallback { +oneway interface ISupplicantCallback { /** * Used to indicate that a new interface has been created. * * @param ifaceName Name of the network interface, e.g., wlan0 */ - oneway void onInterfaceCreated(in String ifaceName); + void onInterfaceCreated(in String ifaceName); /** * Used to indicate that an interface has been removed. * * @param ifaceName Name of the network interface, e.g., wlan0 */ - oneway void onInterfaceRemoved(in String ifaceName); - - /** - * Used to indicate that the supplicant daemon is terminating. - */ - oneway void onTerminating(); + void onInterfaceRemoved(in String ifaceName); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl index da17c7bf47..7c8c1f28ae 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl @@ -31,7 +31,7 @@ import android.hardware.wifi.supplicant.WpsDevPasswordId; * corresponding |ISupplicantP2pIface.registerCallback| method. */ @VintfStability -interface ISupplicantP2pIfaceCallback { +oneway interface ISupplicantP2pIfaceCallback { /** * Used to indicate that a P2P device has been found. * @@ -50,7 +50,7 @@ interface ISupplicantP2pIfaceCallback { * @param wfdDeviceInfo WFD device info as described in section 5.1.2 of WFD * technical specification v1.0.0. */ - oneway void onDeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress, + void onDeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in WpsConfigMethods configMethods, in byte deviceCapabilities, in P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo); @@ -60,19 +60,19 @@ interface ISupplicantP2pIfaceCallback { * * @param p2pDeviceAddress P2P device address. */ - oneway void onDeviceLost(in byte[] p2pDeviceAddress); + void onDeviceLost(in byte[] p2pDeviceAddress); /** * Used to indicate the termination of P2P find operation. */ - oneway void onFindStopped(); + void onFindStopped(); /** * Used to indicate the completion of a P2P Group Owner negotiation request. * * @param status Status of the GO negotiation. */ - oneway void onGoNegotiationCompleted(in P2pStatusCode status); + void onGoNegotiationCompleted(in P2pStatusCode status); /** * Used to indicate the reception of a P2P Group Owner negotiation request. @@ -81,19 +81,19 @@ interface ISupplicantP2pIfaceCallback { * negotiation request. * @param passwordId Type of password. */ - oneway void onGoNegotiationRequest(in byte[] srcAddress, in WpsDevPasswordId passwordId); + void onGoNegotiationRequest(in byte[] srcAddress, in WpsDevPasswordId passwordId); /** * Used to indicate a failure to form a P2P group. * * @param failureReason Failure reason string for debug purposes. */ - oneway void onGroupFormationFailure(in String failureReason); + void onGroupFormationFailure(in String failureReason); /** * Used to indicate a successful formation of a P2P group. */ - oneway void onGroupFormationSuccess(); + void onGroupFormationSuccess(); /** * Used to indicate the removal of a P2P group. @@ -101,7 +101,7 @@ interface ISupplicantP2pIfaceCallback { * @param groupIfName Interface name of the group. (For ex: p2p-p2p0-1) * @param isGroupOwner Whether this device is owner of the group. */ - oneway void onGroupRemoved(in String groupIfname, in boolean isGroupOwner); + void onGroupRemoved(in String groupIfname, in boolean isGroupOwner); /** * Used to indicate the start of a P2P group. @@ -115,7 +115,7 @@ interface ISupplicantP2pIfaceCallback { * @param goDeviceAddress MAC Address of the owner of this group. * @param isPersistent Whether this group is persisted or not. */ - oneway void onGroupStarted(in String groupIfname, in boolean isGroupOwner, in byte[] ssid, + 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); @@ -128,8 +128,8 @@ interface ISupplicantP2pIfaceCallback { * @param persistentNetworkId Persistent network Id of the group. * @param operatingFrequency Frequency on which the invitation was received. */ - oneway void onInvitationReceived(in byte[] srcAddress, in byte[] goDeviceAddress, - in byte[] bssid, in int persistentNetworkId, in int operatingFrequency); + void onInvitationReceived(in byte[] srcAddress, in byte[] goDeviceAddress, in byte[] bssid, + in int persistentNetworkId, in int operatingFrequency); /** * Used to indicate the result of the P2P invitation request. @@ -137,7 +137,7 @@ interface ISupplicantP2pIfaceCallback { * @param bssid Bssid of the group. * @param status Status of the invitation. */ - oneway void onInvitationResult(in byte[] bssid, in P2pStatusCode status); + void onInvitationResult(in byte[] bssid, in P2pStatusCode status); /** * Used to indicate the completion of a P2P provision discovery request. @@ -148,7 +148,7 @@ interface ISupplicantP2pIfaceCallback { * @param configMethods Mask of WPS configuration methods supported. * @param generatedPin 8 digit pin generated. */ - oneway void onProvisionDiscoveryCompleted(in byte[] p2pDeviceAddress, in boolean isRequest, + void onProvisionDiscoveryCompleted(in byte[] p2pDeviceAddress, in boolean isRequest, in P2pProvDiscStatusCode status, in WpsConfigMethods configMethods, in String generatedPin); @@ -174,7 +174,7 @@ interface ISupplicantP2pIfaceCallback { * @param wfdR2DeviceInfo WFD R2 device info as described in section 5.1.12 of WFD * technical specification v2.1. */ - oneway void onR2DeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress, + void onR2DeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in WpsConfigMethods configMethods, in byte deviceCapabilities, in P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo); @@ -187,8 +187,7 @@ interface ISupplicantP2pIfaceCallback { * Wifi P2P Technical specification v1.2. * @parm tlvs Refer to section 3.1.3.1 of Wifi P2P Technical specification v1.2. */ - oneway void onServiceDiscoveryResponse( - in byte[] srcAddress, in char updateIndicator, in byte[] tlvs); + void onServiceDiscoveryResponse(in byte[] srcAddress, in char updateIndicator, in byte[] tlvs); /** * Used to indicate when a STA device is connected to this device. @@ -196,7 +195,7 @@ interface ISupplicantP2pIfaceCallback { * @param srcAddress MAC address of the device that was authorized. * @param p2pDeviceAddress P2P device address. */ - oneway void onStaAuthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress); + void onStaAuthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress); /** * Used to indicate when a STA device is disconnected from this device. @@ -204,7 +203,7 @@ interface ISupplicantP2pIfaceCallback { * @param srcAddress MAC address of the device that was deauthorized. * @param p2pDeviceAddress P2P device address. */ - oneway void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress); + void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress); /** * Used to indicate that operating frequency has changed for this P2P group interface. @@ -212,7 +211,7 @@ interface ISupplicantP2pIfaceCallback { * @param groupIfName Interface name of the group. (For ex: p2p-p2p0-1) * @param frequency New operating frequency in MHz. */ - oneway void onGroupFrequencyChanged(in String groupIfname, in int frequency); + void onGroupFrequencyChanged(in String groupIfname, in int frequency); /** * Used to indicate that a P2P device has been found. @@ -240,7 +239,7 @@ interface ISupplicantP2pIfaceCallback { * Information technology. The length indicates the size of the payload. * Multiple information elements may be appended within the byte array. */ - oneway void onDeviceFoundWithVendorElements(in byte[] srcAddress, in byte[] p2pDeviceAddress, + void onDeviceFoundWithVendorElements(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in WpsConfigMethods configMethods, in byte deviceCapabilities, in P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo, in byte[] vendorElemBytes); diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl index 1b7f5bdab4..8ab0c826f7 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl @@ -452,12 +452,12 @@ interface ISupplicantStaIface { * This allows other radio works to be performed. If this method is not * invoked (e.g., due to the external program terminating), supplicant * must time out the radio work item on the iface and send - * |ISupplicantCallback.onExtRadioWorkTimeout| event to indicate + * |ISupplicantStaIfaceCallback.onExtRadioWorkTimeout| event to indicate * that this has happened. * * This method may also be used to cancel items that have been scheduled * via |addExtRadioWork|, but have not yet been started (notified via - * |ISupplicantCallback.onExtRadioWorkStart|). + * |ISupplicantStaIfaceCallback.onExtRadioWorkStart|). * * @param id Identifier generated for the radio work addition * (using |addExtRadioWork|). diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index 369d0dac16..ade68f0fe2 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -42,7 +42,7 @@ import android.hardware.wifi.supplicant.WpsErrorIndication; * corresponding |ISupplicantStaIface.registerCallback| method. */ @VintfStability -interface ISupplicantStaIfaceCallback { +oneway interface ISupplicantStaIfaceCallback { /** * Used to indicate the result of ANQP (either for IEEE 802.11u Interworking * or Hotspot 2.0) query. @@ -53,7 +53,7 @@ interface ISupplicantStaIfaceCallback { * @param hs20Data ANQP data fetched from the Hotspot 2.0 access point. * All the fields in this struct must be empty if the query failed. */ - oneway void onAnqpQueryDone(in byte[] bssid, in AnqpData data, in Hs20AnqpData hs20Data); + void onAnqpQueryDone(in byte[] bssid, in AnqpData data, in Hs20AnqpData hs20Data); /** * Used to indicate an association rejection received from the AP @@ -61,14 +61,14 @@ interface ISupplicantStaIfaceCallback { * * @param assocRejectData Association Rejection related information. */ - oneway void onAssociationRejected(in AssociationRejectionData assocRejectData); + void onAssociationRejected(in AssociationRejectionData assocRejectData); /** * Used to indicate the timeout of authentication to an AP. * * @param bssid BSSID of the corresponding AP. */ - oneway void onAuthenticationTimeout(in byte[] bssid); + void onAuthenticationTimeout(in byte[] bssid); /** * Indicates BTM request frame handling status. @@ -76,7 +76,7 @@ interface ISupplicantStaIfaceCallback { * @param tmData Data retrieved from received BSS transition management * request frame. */ - oneway void onBssTmHandlingDone(in BssTmData tmData); + void onBssTmHandlingDone(in BssTmData tmData); /** * Used to indicate the change of active bssid. @@ -86,7 +86,7 @@ interface ISupplicantStaIfaceCallback { * @param reason Reason why the bssid changed. * @param bssid BSSID of the corresponding AP. */ - oneway void onBssidChanged(in BssidChangeReason reason, in byte[] bssid); + void onBssidChanged(in BssidChangeReason reason, in byte[] bssid); /** * Used to indicate the disconnection from the currently connected @@ -98,7 +98,7 @@ interface ISupplicantStaIfaceCallback { * @param reasonCode 802.11 code to indicate the disconnect reason * from access point. Refer to section 8.4.1.7 of IEEE802.11 spec. */ - oneway void onDisconnected( + void onDisconnected( in byte[] bssid, in boolean locallyGenerated, in StaIfaceReasonCode reasonCode); /** @@ -115,31 +115,31 @@ interface ISupplicantStaIfaceCallback { * bandList: A list of band parameters that are supported by the Enrollee expressed as the * Operating Class. */ - oneway void onDppFailure( + void onDppFailure( in DppFailureCode code, in String ssid, in String channelList, in char[] bandList); /** * Indicates a DPP progress event. */ - oneway void onDppProgress(in DppProgressCode code); + void onDppProgress(in DppProgressCode code); /** * Indicates a DPP success event. */ - oneway void onDppSuccess(in DppEventType event); + void onDppSuccess(in DppEventType event); /** * Indicates DPP configuration received success event in Enrolee mode. * This is also triggered when Configurator generates credentials for itself * using generateSelfDppConfiguration() API */ - oneway void onDppSuccessConfigReceived(in byte[] ssid, in String password, in byte[] psk, + void onDppSuccessConfigReceived(in byte[] ssid, in String password, in byte[] psk, in DppAkm securityAkm, in DppConnectionKeys dppConnectionKeys); /** * Indicates DPP configuration sent success event (Configurator mode). */ - oneway void onDppSuccessConfigSent(); + void onDppSuccessConfigSent(); /** * Indicates an EAP authentication failure. @@ -147,21 +147,21 @@ interface ISupplicantStaIfaceCallback { * Either standard error code (enum EapErrorCode) or * private error code defined by network provider. */ - oneway void onEapFailure(in int errorCode); + void onEapFailure(in int errorCode); /** * Used to indicate that the external radio work can start now. * * @param id Identifier generated for the radio work request. */ - oneway void onExtRadioWorkStart(in int id); + void onExtRadioWorkStart(in int id); /** * Used to indicate that the external radio work request has timed out. * * @param id Identifier generated for the radio work request. */ - oneway void onExtRadioWorkTimeout(in int id); + void onExtRadioWorkTimeout(in int id); /** * Used to indicate a Hotspot 2.0 imminent deauth notice. @@ -172,7 +172,7 @@ interface ISupplicantStaIfaceCallback { * @param reAuthDelayInSec Delay before reauthenticating. * @param url URL of the server. */ - oneway void onHs20DeauthImminentNotice( + void onHs20DeauthImminentNotice( in byte[] bssid, in int reasonCode, in int reAuthDelayInSec, in String url); /** @@ -183,7 +183,7 @@ interface ISupplicantStaIfaceCallback { * @param data Icon data fetched from the access point. * Must be empty if the query failed. */ - oneway void onHs20IconQueryDone(in byte[] bssid, in String fileName, in byte[] data); + void onHs20IconQueryDone(in byte[] bssid, in String fileName, in byte[] data); /** * Used to indicate a Hotspot 2.0 subscription remediation event. @@ -192,8 +192,7 @@ interface ISupplicantStaIfaceCallback { * @param osuMethod OSU method. * @param url URL of the server. */ - oneway void onHs20SubscriptionRemediation( - in byte[] bssid, in OsuMethod osuMethod, in String url); + void onHs20SubscriptionRemediation(in byte[] bssid, in OsuMethod osuMethod, in String url); /** * Used to indicate a Hotspot 2.0 terms and conditions acceptance is requested from the user @@ -202,15 +201,14 @@ interface ISupplicantStaIfaceCallback { * @param bssid BSSID of the access point. * @param url URL of the T&C server. */ - oneway void onHs20TermsAndConditionsAcceptanceRequestedNotification( - in byte[] bssid, in String url); + void onHs20TermsAndConditionsAcceptanceRequestedNotification(in byte[] bssid, in String url); /** * Used to indicate that a new network has been added. * * @param id Network ID allocated to the corresponding network. */ - oneway void onNetworkAdded(in int id); + void onNetworkAdded(in int id); /** * Used to indicate that the supplicant failed to find a network in scan result @@ -219,14 +217,14 @@ interface ISupplicantStaIfaceCallback { * * @param ssid network name supplicant tried to connect. */ - oneway void onNetworkNotFound(in byte[] ssid); + void onNetworkNotFound(in byte[] ssid); /** * Used to indicate that a network has been removed. * * @param id Network ID allocated to the corresponding network. */ - oneway void onNetworkRemoved(in int id); + void onNetworkRemoved(in int id); /** * Indicates pairwise master key (PMK) cache added event. @@ -235,7 +233,7 @@ interface ISupplicantStaIfaceCallback { * @param serializedEntry is serialized PMK cache entry, the content is * opaque for the framework and depends on the native implementation. */ - oneway void onPmkCacheAdded(in long expirationTimeInSec, in byte[] serializedEntry); + void onPmkCacheAdded(in long expirationTimeInSec, in byte[] serializedEntry); /** * Used to indicate a state change event on this particular iface. If this @@ -256,7 +254,7 @@ interface ISupplicantStaIfaceCallback { * to a particular network. * @param filsHlpSent If FILS HLP IEs were included in this association. */ - oneway void onStateChanged(in StaIfaceCallbackState newState, in byte[] bssid, in int id, + void onStateChanged(in StaIfaceCallbackState newState, in byte[] bssid, in int id, in byte[] ssid, in boolean filsHlpSent); /** @@ -267,29 +265,29 @@ interface ISupplicantStaIfaceCallback { * @param configError Configuration error code. * @param errorInd Error indication code. */ - oneway void onWpsEventFail( + void onWpsEventFail( in byte[] bssid, in WpsConfigError configError, in WpsErrorIndication errorInd); /** * Used to indicate the overlap of a WPS PBC connection attempt. */ - oneway void onWpsEventPbcOverlap(); + void onWpsEventPbcOverlap(); /** * Used to indicate the success of a WPS connection attempt. */ - oneway void onWpsEventSuccess(); + void onWpsEventSuccess(); /** * Used to indicate that the AP has cleared all DSCP requests * associated with this device. */ - oneway void onQosPolicyReset(); + void onQosPolicyReset(); /** * Used to indicate a DSCP request was received from the AP. * * @param qosPolicyData QoS policies info requested by the AP. */ - oneway void onQosPolicyRequest(in QosPolicyData[] qosPolicyData); + void onQosPolicyRequest(in QosPolicyData[] qosPolicyData); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl index 4024c35fed..de7b675036 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl @@ -29,14 +29,14 @@ import android.hardware.wifi.supplicant.TransitionDisableIndication; * corresponding |ISupplicantStaNetwork.registerCallback| method. */ @VintfStability -interface ISupplicantStaNetworkCallback { +oneway interface ISupplicantStaNetworkCallback { /** * Used to request EAP Identity for this particular network. * * The response for the request must be sent using the corresponding * |ISupplicantNetwork.sendNetworkEapIdentityResponse| call. */ - oneway void onNetworkEapIdentityRequest(); + void onNetworkEapIdentityRequest(); /** * Used to request EAP GSM SIM authentication for this particular network. @@ -46,7 +46,7 @@ interface ISupplicantStaNetworkCallback { * * @param params Params associated with the request. */ - oneway void onNetworkEapSimGsmAuthRequest(in NetworkRequestEapSimGsmAuthParams params); + void onNetworkEapSimGsmAuthRequest(in NetworkRequestEapSimGsmAuthParams params); /** * Used to request EAP UMTS SIM authentication for this particular network. @@ -56,12 +56,12 @@ interface ISupplicantStaNetworkCallback { * * @param params Params associated with the request. */ - oneway void onNetworkEapSimUmtsAuthRequest(in NetworkRequestEapSimUmtsAuthParams params); + void onNetworkEapSimUmtsAuthRequest(in NetworkRequestEapSimUmtsAuthParams params); /** * Used to notify WPA3 transition disable. */ - oneway void onTransitionDisable(in TransitionDisableIndication ind); + void onTransitionDisable(in TransitionDisableIndication ind); /** * Used to notify EAP certificate event. @@ -69,6 +69,6 @@ interface ISupplicantStaNetworkCallback { * On receiving a server certifidate from TLS handshake, send this certificate * to the framework for Trust On First Use. */ - oneway void onServerCertificateAvailable( + void onServerCertificateAvailable( in int depth, in byte[] subject, in byte[] certHash, in byte[] certBlob); } -- GitLab From af798d4d2c5a3688ca4a62977fe282854fff3dff Mon Sep 17 00:00:00 2001 From: Tai Kuo Date: Mon, 14 Feb 2022 12:25:15 +0800 Subject: [PATCH 614/825] vibrator: aidl: update OWNERS file Remove leungv@ and add taikuo@ into the OWNERS file. Bug: 219384042 Test: Presubmit Change-Id: I191fdf2500a1bec54f2f55671c99b7b1120aee74 --- vibrator/aidl/OWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vibrator/aidl/OWNERS b/vibrator/aidl/OWNERS index ae10db6b3a..3982c7bdc8 100644 --- a/vibrator/aidl/OWNERS +++ b/vibrator/aidl/OWNERS @@ -1,4 +1,4 @@ # Bug component: 345036 include platform/frameworks/base:/services/core/java/com/android/server/vibrator/OWNERS chasewu@google.com -leungv@google.com +taikuo@google.com -- GitLab From 0a2bee4ebab7c207b6db7433dd50915a2d131bd1 Mon Sep 17 00:00:00 2001 From: ramindani Date: Thu, 10 Feb 2022 01:27:42 +0000 Subject: [PATCH 615/825] Clean up the GraphicBuffer. HIDL tests don't have any buffer created when test execution starts and with GraphicBuffer that wasn't the case. We only initialize the buffer when required the way gralloc implementation did. BUG: 199413815 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I3aeec5b00e30e636de2e58cf7e6ced5539ae19b6 --- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 123 ++++++++---------- .../functional/composer-vts/ReadbackVts.cpp | 33 +++-- .../composer-vts/include/ReadbackVts.h | 9 +- 3 files changed, 84 insertions(+), 81 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 45a8f6f359..68956b0140 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -62,9 +62,6 @@ class GraphicsCompositionTestBase : public ::testing::Test { } mComposerClient->setVsyncAllowed(/*isAllowed*/ false); - // set up gralloc - mGraphicBuffer = allocate(); - EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk()); ASSERT_NO_FATAL_FAILURE( @@ -112,15 +109,18 @@ class GraphicsCompositionTestBase : public ::testing::Test { int32_t getDisplayHeight() const { return getPrimaryDisplay().getDisplayHeight(); } - ::android::sp<::android::GraphicBuffer> allocate() { + std::pair> allocateBuffer(uint32_t usage) { const auto width = static_cast(getDisplayWidth()); const auto height = static_cast(getDisplayHeight()); - const auto usage = static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | - static_cast(common::BufferUsage::CPU_READ_OFTEN); - return ::android::sp<::android::GraphicBuffer>::make( + const auto& graphicBuffer = ::android::sp<::android::GraphicBuffer>::make( width, height, ::android::PIXEL_FORMAT_RGBA_8888, /*layerCount*/ 1u, usage, "VtsHalGraphicsComposer3_ReadbackTest"); + + if (graphicBuffer && ::android::OK == graphicBuffer->initCheck()) { + return {true, graphicBuffer}; + } + return {false, graphicBuffer}; } uint64_t getStableDisplayId(int64_t display) { @@ -231,7 +231,6 @@ class GraphicsCompositionTestBase : public ::testing::Test { std::vector mTestColorModes; ComposerClientWriter mWriter; ComposerClientReader mReader; - ::android::sp<::android::GraphicBuffer> mGraphicBuffer; std::unique_ptr mTestRenderEngine; common::PixelFormat mPixelFormat; common::Dataspace mDataspace; @@ -339,8 +338,8 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE); auto layer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), - getDisplayWidth(), getDisplayHeight(), common::PixelFormat::RGBA_8888); + mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(), + getDisplayHeight(), common::PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); @@ -392,15 +391,12 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { layer->write(mWriter); // This following buffer call should have no effect - uint64_t usage = - static_cast(static_cast(common::BufferUsage::CPU_READ_OFTEN) | - static_cast(common::BufferUsage::CPU_WRITE_OFTEN)); - - mGraphicBuffer->reallocate(static_cast(getDisplayWidth()), - static_cast(getDisplayHeight()), 1, - static_cast(common::PixelFormat::RGBA_8888), usage); - mWriter.setLayerBuffer(getPrimaryDisplayId(), layer->getLayer(), /*slot*/ 0, - mGraphicBuffer->handle, + const auto usage = static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | + static_cast(common::BufferUsage::CPU_READ_OFTEN); + const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(usage); + ASSERT_TRUE(graphicBufferStatus); + const auto& buffer = graphicBuffer->handle; + mWriter.setLayerBuffer(getPrimaryDisplayId(), layer->getLayer(), /*slot*/ 0, buffer, /*acquireFence*/ -1); // expected color for each pixel @@ -450,9 +446,11 @@ TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadDisplay) { return; } - ASSERT_NE(nullptr, mGraphicBuffer); - ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck()); - const auto& bufferHandle = mGraphicBuffer->handle; + const auto usage = static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | + static_cast(common::BufferUsage::CPU_READ_OFTEN); + const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(usage); + ASSERT_TRUE(graphicBufferStatus); + const auto& bufferHandle = graphicBuffer->handle; ::ndk::ScopedFileDescriptor fence = ::ndk::ScopedFileDescriptor(-1); const auto status = @@ -523,9 +521,9 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { expectedColors, getDisplayWidth(), {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE); - auto layer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), - getDisplayWidth(), getDisplayHeight(), PixelFormat::RGBA_FP16); + auto layer = std::make_shared(mComposerClient, *mTestRenderEngine, + getPrimaryDisplayId(), getDisplayWidth(), + getDisplayHeight(), PixelFormat::RGBA_FP16); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); @@ -554,20 +552,17 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { common::Rect damage{0, 0, getDisplayWidth(), getDisplayHeight()}; // create client target buffer - mGraphicBuffer->reallocate(layer->getWidth(), layer->getHeight(), - static_cast(common::PixelFormat::RGBA_8888), - layer->getLayerCount(), clientUsage); - - ASSERT_NE(nullptr, mGraphicBuffer->handle); - + const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(clientUsage); + ASSERT_TRUE(graphicBufferStatus); + const auto& buffer = graphicBuffer->handle; void* clientBufData; - mGraphicBuffer->lock(clientUsage, layer->getAccessRegion(), &clientBufData); + const auto stride = static_cast(graphicBuffer->stride); + graphicBuffer->lock(clientUsage, layer->getAccessRegion(), &clientBufData); ASSERT_NO_FATAL_FAILURE( - ReadbackHelper::fillBuffer(layer->getWidth(), layer->getHeight(), - static_cast(mGraphicBuffer->stride), + ReadbackHelper::fillBuffer(layer->getWidth(), layer->getHeight(), stride, clientBufData, clientFormat, expectedColors)); - EXPECT_EQ(::android::OK, mGraphicBuffer->unlock()); + EXPECT_EQ(::android::OK, graphicBuffer->unlock()); const auto& [status, bufferFence] = mComposerClient->getReadbackBufferFence(getPrimaryDisplayId()); @@ -575,9 +570,8 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { layer->setToClientComposition(mWriter); mWriter.acceptDisplayChanges(getPrimaryDisplayId()); - mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, mGraphicBuffer->handle, - bufferFence.get(), clientDataspace, - std::vector(1, damage)); + mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, bufferFence.get(), + clientDataspace, std::vector(1, damage)); execute(); changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId()); ASSERT_TRUE(changedCompositionTypes.empty()); @@ -623,8 +617,8 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); auto deviceLayer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), - getDisplayWidth(), getDisplayHeight() / 2, PixelFormat::RGBA_8888); + mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(), + getDisplayHeight() / 2, PixelFormat::RGBA_8888); std::vector deviceColors(deviceLayer->getWidth() * deviceLayer->getHeight()); ReadbackHelper::fillColorsArea(deviceColors, static_cast(deviceLayer->getWidth()), {0, 0, static_cast(deviceLayer->getWidth()), @@ -647,8 +641,8 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { int32_t clientHeight = getDisplayHeight() / 2; auto clientLayer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), - clientWidth, clientHeight, PixelFormat::RGBA_FP16, Composition::DEVICE); + mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), clientWidth, + clientHeight, PixelFormat::RGBA_FP16, Composition::DEVICE); common::Rect clientFrame = {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}; clientLayer->setDisplayFrame(clientFrame); @@ -663,23 +657,21 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { } // create client target buffer ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition); - mGraphicBuffer->reallocate(static_cast(getDisplayWidth()), - static_cast(getDisplayHeight()), - static_cast(common::PixelFormat::RGBA_8888), - clientLayer->getLayerCount(), clientUsage); - ASSERT_NE(nullptr, mGraphicBuffer->handle); + const auto& [graphicBufferStatus, graphicBuffer] = allocateBuffer(clientUsage); + ASSERT_TRUE(graphicBufferStatus); + const auto& buffer = graphicBuffer->handle; void* clientBufData; - mGraphicBuffer->lock(clientUsage, {0, 0, getDisplayWidth(), getDisplayHeight()}, - &clientBufData); + graphicBuffer->lock(clientUsage, {0, 0, getDisplayWidth(), getDisplayHeight()}, + &clientBufData); std::vector clientColors( static_cast(getDisplayWidth() * getDisplayHeight())); ReadbackHelper::fillColorsArea(clientColors, getDisplayWidth(), clientFrame, RED); ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer( static_cast(getDisplayWidth()), static_cast(getDisplayHeight()), - mGraphicBuffer->getStride(), clientBufData, clientFormat, clientColors)); - EXPECT_EQ(::android::OK, mGraphicBuffer->unlock()); + graphicBuffer->getStride(), clientBufData, clientFormat, clientColors)); + EXPECT_EQ(::android::OK, graphicBuffer->unlock()); const auto& [status, bufferFence] = mComposerClient->getReadbackBufferFence(getPrimaryDisplayId()); @@ -687,9 +679,8 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { clientLayer->setToClientComposition(mWriter); mWriter.acceptDisplayChanges(getPrimaryDisplayId()); - mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, mGraphicBuffer->handle, - bufferFence.get(), clientDataspace, - std::vector(1, clientFrame)); + mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, bufferFence.get(), + clientDataspace, std::vector(1, clientFrame)); execute(); changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId()); ASSERT_TRUE(changedCompositionTypes.empty()); @@ -721,9 +712,9 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { static_cast(getDisplayWidth() * getDisplayHeight())); ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED); - auto layer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), - getDisplayWidth(), getDisplayHeight(), PixelFormat::RGBA_8888); + auto layer = std::make_shared(mComposerClient, *mTestRenderEngine, + getPrimaryDisplayId(), getDisplayWidth(), + getDisplayHeight(), PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); @@ -849,9 +840,9 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { expectedColors, getDisplayWidth(), {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE); - auto layer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), - getDisplayWidth(), getDisplayHeight(), PixelFormat::RGBA_8888); + auto layer = std::make_shared(mComposerClient, *mTestRenderEngine, + getPrimaryDisplayId(), getDisplayWidth(), + getDisplayHeight(), PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); @@ -1083,9 +1074,9 @@ class GraphicsBlendModeCompositionTest backgroundLayer->setZOrder(0); backgroundLayer->setColor(mBackgroundColor); - auto layer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), - getDisplayWidth(), getDisplayHeight(), PixelFormat::RGBA_8888); + auto layer = std::make_shared(mComposerClient, *mTestRenderEngine, + getPrimaryDisplayId(), getDisplayWidth(), + getDisplayHeight(), PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); layer->setDataspace(Dataspace::UNKNOWN, mWriter); @@ -1283,9 +1274,9 @@ class GraphicsTransformCompositionTest : public GraphicsCompositionTest { common::Rect redRect = {0, 0, mSideLength / 2, mSideLength / 2}; common::Rect blueRect = {mSideLength / 2, mSideLength / 2, mSideLength, mSideLength}; - mLayer = std::make_shared( - mComposerClient, mGraphicBuffer, *mTestRenderEngine, getPrimaryDisplayId(), - mSideLength, mSideLength, PixelFormat::RGBA_8888); + mLayer = std::make_shared(mComposerClient, *mTestRenderEngine, + getPrimaryDisplayId(), mSideLength, mSideLength, + PixelFormat::RGBA_8888); mLayer->setDisplayFrame({0, 0, mSideLength, mSideLength}); mLayer->setZOrder(10); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp index 1aca76f3c8..ea432ef5f5 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp @@ -209,14 +209,14 @@ ReadbackBuffer::ReadbackBuffer(int64_t display, const std::shared_ptr(height); } -::android::sp<::android::GraphicBuffer> ReadbackBuffer::allocate() { +::android::sp<::android::GraphicBuffer> ReadbackBuffer::allocateBuffer() { return ::android::sp<::android::GraphicBuffer>::make( mWidth, mHeight, static_cast<::android::PixelFormat>(mPixelFormat), mLayerCount, mUsage, - "ReadbackVts"); + "ReadbackBuffer"); } void ReadbackBuffer::setReadbackBuffer() { - mGraphicBuffer = allocate(); + mGraphicBuffer = allocateBuffer(); ASSERT_NE(nullptr, mGraphicBuffer); ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck()); const auto& bufferHandle = mGraphicBuffer->handle; @@ -262,12 +262,10 @@ LayerSettings TestColorLayer::toRenderEngineLayerSettings() { } TestBufferLayer::TestBufferLayer(const std::shared_ptr& client, - const ::android::sp<::android::GraphicBuffer>& graphicBuffer, TestRenderEngine& renderEngine, int64_t display, uint32_t width, uint32_t height, common::PixelFormat format, Composition composition) : TestLayer{client, display}, mRenderEngine(renderEngine) { - mGraphicBuffer = graphicBuffer; mComposition = composition; mWidth = width; mHeight = height; @@ -290,8 +288,9 @@ void TestBufferLayer::write(ComposerClientWriter& writer) { TestLayer::write(writer); writer.setLayerCompositionType(mDisplay, mLayer, mComposition); writer.setLayerVisibleRegion(mDisplay, mLayer, std::vector(1, mDisplayFrame)); - if (mGraphicBuffer->handle != nullptr) - writer.setLayerBuffer(mDisplay, mLayer, 0, mGraphicBuffer->handle, mFillFence); + if (mGraphicBuffer) { + writer.setLayerBuffer(mDisplay, mLayer, /*slot*/ 0, mGraphicBuffer->handle, mFillFence); + } } LayerSettings TestBufferLayer::toRenderEngineLayerSettings() { @@ -326,16 +325,26 @@ void TestBufferLayer::fillBuffer(std::vector& expectedColors) { EXPECT_EQ(::android::OK, status); ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(mWidth, mHeight, stride, bufData, mPixelFormat, expectedColors)); - EXPECT_EQ(::android::OK, mGraphicBuffer->unlock()); + + const auto unlockStatus = mGraphicBuffer->unlockAsync(&mFillFence); + ASSERT_EQ(::android::OK, unlockStatus); + if (mFillFence >= 0) { + sync_wait(mFillFence, -1); + close(mFillFence); + } } void TestBufferLayer::setBuffer(std::vector colors) { - mGraphicBuffer->reallocate(mWidth, mHeight, static_cast<::android::PixelFormat>(mPixelFormat), - mLayerCount, mUsage); + mGraphicBuffer = allocateBuffer(); ASSERT_NE(nullptr, mGraphicBuffer); - ASSERT_NE(nullptr, mGraphicBuffer->handle); - ASSERT_NO_FATAL_FAILURE(fillBuffer(colors)); ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck()); + ASSERT_NO_FATAL_FAILURE(fillBuffer(colors)); +} + +::android::sp<::android::GraphicBuffer> TestBufferLayer::allocateBuffer() { + return ::android::sp<::android::GraphicBuffer>::make( + mWidth, mHeight, static_cast<::android::PixelFormat>(mPixelFormat), mLayerCount, mUsage, + "TestBufferLayer"); } void TestBufferLayer::setDataspace(common::Dataspace dataspace, ComposerClientWriter& writer) { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h index 7135dcae77..f9fab4fef2 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h @@ -118,7 +118,6 @@ class TestColorLayer : public TestLayer { class TestBufferLayer : public TestLayer { public: TestBufferLayer(const std::shared_ptr& client, - const ::android::sp<::android::GraphicBuffer>& graphicBuffer, TestRenderEngine& renderEngine, int64_t display, uint32_t width, uint32_t height, common::PixelFormat format, Composition composition = Composition::DEVICE); @@ -154,6 +153,9 @@ class TestBufferLayer : public TestLayer { PixelFormat mPixelFormat; uint32_t mUsage; ::android::Rect mAccessRegion; + + private: + ::android::sp<::android::GraphicBuffer> allocateBuffer(); }; class ReadbackHelper { @@ -194,8 +196,6 @@ class ReadbackBuffer { void checkReadbackBuffer(const std::vector& expectedColors); - ::android::sp<::android::GraphicBuffer> allocate(); - protected: uint32_t mWidth; uint32_t mHeight; @@ -208,6 +208,9 @@ class ReadbackBuffer { std::shared_ptr mComposerClient; ::android::Rect mAccessRegion; native_handle_t mBufferHandle; + + private: + ::android::sp<::android::GraphicBuffer> allocateBuffer(); }; } // namespace aidl::android::hardware::graphics::composer3::vts -- GitLab From b1144219bf4b29e8bf227d70f35d461e20a8fdfa Mon Sep 17 00:00:00 2001 From: ramindani Date: Thu, 10 Feb 2022 01:51:24 +0000 Subject: [PATCH 616/825] ClientComposition test fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Client composition test was broken because there was a buffer created at the test creation and this is not how this test works for client composition trigger. And for the fence that was used is different from what it needs previously fence was acquired through gralloc but now it's internal to the Graphic Buffer and we no longer have to  wait for the fence to signal it's taken care by the graphicBuffer->unlock call, the unlock call waits for us. See for unlock https://source.corp.google.com/android/frameworks/native/libs/ui/GraphicBufferMapper.cpp;rcl=HEAD;l=139 BUG: 216170021 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I8fa25d8910a4e2b1df2f0e2270445a658e3b1a39 --- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 68956b0140..92fa20c1a9 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -562,16 +562,18 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { ASSERT_NO_FATAL_FAILURE( ReadbackHelper::fillBuffer(layer->getWidth(), layer->getHeight(), stride, clientBufData, clientFormat, expectedColors)); - EXPECT_EQ(::android::OK, graphicBuffer->unlock()); - - const auto& [status, bufferFence] = - mComposerClient->getReadbackBufferFence(getPrimaryDisplayId()); - EXPECT_TRUE(status.isOk()); + int32_t clientFence; + const auto unlockStatus = graphicBuffer->unlockAsync(&clientFence); + ASSERT_EQ(::android::OK, unlockStatus); + if (clientFence >= 0) { + sync_wait(clientFence, -1); + close(clientFence); + } - layer->setToClientComposition(mWriter); - mWriter.acceptDisplayChanges(getPrimaryDisplayId()); - mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, bufferFence.get(), + mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence, clientDataspace, std::vector(1, damage)); + layer->setToClientComposition(mWriter); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId()); ASSERT_TRUE(changedCompositionTypes.empty()); @@ -671,16 +673,18 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer( static_cast(getDisplayWidth()), static_cast(getDisplayHeight()), graphicBuffer->getStride(), clientBufData, clientFormat, clientColors)); - EXPECT_EQ(::android::OK, graphicBuffer->unlock()); - - const auto& [status, bufferFence] = - mComposerClient->getReadbackBufferFence(getPrimaryDisplayId()); - EXPECT_TRUE(status.isOk()); + int32_t clientFence; + const auto unlockStatus = graphicBuffer->unlockAsync(&clientFence); + ASSERT_EQ(::android::OK, unlockStatus); + if (clientFence >= 0) { + sync_wait(clientFence, -1); + close(clientFence); + } - clientLayer->setToClientComposition(mWriter); - mWriter.acceptDisplayChanges(getPrimaryDisplayId()); - mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, bufferFence.get(), + mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence, clientDataspace, std::vector(1, clientFrame)); + clientLayer->setToClientComposition(mWriter); + mWriter.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId()); ASSERT_TRUE(changedCompositionTypes.empty()); -- GitLab From b636af2820aca231774ddea16cd3f5f6e2f75452 Mon Sep 17 00:00:00 2001 From: ramindani Date: Thu, 10 Feb 2022 02:55:56 +0000 Subject: [PATCH 617/825] BlendMode VTS tests BlendMode::Coverage and BlendMode::Premultiplied test fix HIDL only worked on SRGB for this test and as HIDL this also passes just the Coverage and Premultiplied with the colorMode SRGB see: https://source.corp.google.com/android/hardware/interfaces/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp;rcl=ddbbf784a80979fd0b2d926a1e3cdb68d0a49b61;l=938 BUG: 216172840 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: Iec16fc112d3ab6ee37e55ca9f3fa760a439e52eb --- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 92fa20c1a9..55a8c70ccb 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -1056,6 +1056,9 @@ class GraphicsBlendModeCompositionTest public: void SetUp() override { SetUpBase(std::get<0>(GetParam())); + // TODO(b/219590743) we should remove the below SRGB color mode + // once we have the BlendMode test fix for all the versions of the ColorMode + mTestColorModes = {ColorMode::SRGB}; mBackgroundColor = BLACK; mTopLayerColor = RED; } @@ -1133,8 +1136,8 @@ class GraphicsBlendModeCompositionTest Color mBackgroundColor; Color mTopLayerColor; }; - -TEST_P(GraphicsBlendModeCompositionTest, None) { +// TODO(b/219576457) Enable tests once we have fixed the bug on composer. +TEST_P(GraphicsBlendModeCompositionTest, DISABLED_None) { for (ColorMode mode : mTestColorModes) { EXPECT_TRUE(mComposerClient ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) @@ -1178,7 +1181,8 @@ TEST_P(GraphicsBlendModeCompositionTest, None) { } } -TEST_P(GraphicsBlendModeCompositionTest, Coverage) { +// TODO(b/219737571) Enable test for HWC3.0 after we matched with 2.4 +TEST_P(GraphicsBlendModeCompositionTest, DISABLED_Coverage) { for (ColorMode mode : mTestColorModes) { EXPECT_TRUE(mComposerClient ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) -- GitLab From 7ce70fea34e29df5849a3d6ca7167ae48eefc961 Mon Sep 17 00:00:00 2001 From: ramindani Date: Thu, 10 Feb 2022 18:08:09 +0000 Subject: [PATCH 618/825] Use Vector instead of unordered_map for hotplug displays For multi-display order of the hotplug matters, and vector maintains the order that we need for the multi-display. see: ag/1921760 for partner cl on HIDL. BUG: 210920960 BUG: 209409863 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I4f9a86413f20c860fc0bc3850a14335d62de881a --- .../composer-vts/GraphicsComposerCallback.cpp | 33 ++++++++++++++----- .../include/GraphicsComposerCallback.h | 4 +-- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/GraphicsComposerCallback.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/GraphicsComposerCallback.cpp index 22b5d796fc..8f329b3b4c 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/GraphicsComposerCallback.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/GraphicsComposerCallback.cpp @@ -31,7 +31,7 @@ void GraphicsComposerCallback::setVsyncAllowed(bool allowed) { std::vector GraphicsComposerCallback::getDisplays() const { std::scoped_lock lock(mMutex); - return std::vector(mDisplays.begin(), mDisplays.end()); + return mDisplays; } int32_t GraphicsComposerCallback::getInvalidHotplugCount() const { @@ -81,22 +81,29 @@ GraphicsComposerCallback::takeLastVsyncPeriodChangeTimeline() { ::ndk::ScopedAStatus GraphicsComposerCallback::onHotplug(int64_t in_display, bool in_connected) { std::scoped_lock lock(mMutex); + + const auto it = std::find(mDisplays.begin(), mDisplays.end(), in_display); if (in_connected) { - if (!mDisplays.insert(in_display).second) { + if (it == mDisplays.end()) { + mDisplays.push_back(in_display); + } else { mInvalidHotplugCount++; } } else { - if (!mDisplays.erase(in_display)) { + if (it != mDisplays.end()) { + mDisplays.erase(it); + } else { mInvalidHotplugCount++; } } return ::ndk::ScopedAStatus::ok(); } -::ndk::ScopedAStatus GraphicsComposerCallback::onRefresh(int64_t display) { +::ndk::ScopedAStatus GraphicsComposerCallback::onRefresh(int64_t in_display) { std::scoped_lock lock(mMutex); - if (mDisplays.count(display) == 0) { + const auto it = std::find(mDisplays.begin(), mDisplays.end(), in_display); + if (it == mDisplays.end()) { mInvalidRefreshCount++; } @@ -106,7 +113,9 @@ GraphicsComposerCallback::takeLastVsyncPeriodChangeTimeline() { ::ndk::ScopedAStatus GraphicsComposerCallback::onVsync(int64_t in_display, int64_t in_timestamp, int32_t in_vsyncPeriodNanos) { std::scoped_lock lock(mMutex); - if (!mVsyncAllowed || mDisplays.count(in_display) == 0) { + + const auto it = std::find(mDisplays.begin(), mDisplays.end(), in_display); + if (!mVsyncAllowed || it == mDisplays.end()) { mInvalidVsyncCount++; } @@ -120,7 +129,9 @@ GraphicsComposerCallback::takeLastVsyncPeriodChangeTimeline() { const ::aidl::android::hardware::graphics::composer3::VsyncPeriodChangeTimeline& in_updatedTimeline) { std::scoped_lock lock(mMutex); - if (mDisplays.count(in_display) == 0) { + + const auto it = std::find(mDisplays.begin(), mDisplays.end(), in_display); + if (it == mDisplays.end()) { mInvalidVsyncPeriodChangeCount++; } mTimeline = in_updatedTimeline; @@ -130,7 +141,9 @@ GraphicsComposerCallback::takeLastVsyncPeriodChangeTimeline() { ::ndk::ScopedAStatus GraphicsComposerCallback::onSeamlessPossible(int64_t in_display) { std::scoped_lock lock(mMutex); - if (mDisplays.count(in_display)) { + + const auto it = std::find(mDisplays.begin(), mDisplays.end(), in_display); + if (it != mDisplays.end()) { mInvalidSeamlessPossibleCount++; } return ::ndk::ScopedAStatus::ok(); @@ -138,7 +151,9 @@ GraphicsComposerCallback::takeLastVsyncPeriodChangeTimeline() { ::ndk::ScopedAStatus GraphicsComposerCallback::onVsyncIdle(int64_t in_display) { std::scoped_lock lock(mMutex); - if (mDisplays.count(in_display)) { + + const auto it = std::find(mDisplays.begin(), mDisplays.end(), in_display); + if (it != mDisplays.end()) { mVsyncIdleCount++; mVsyncIdleTime = systemTime(); } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h index ced1020dc7..e54da346f5 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h @@ -18,7 +18,7 @@ #include #include #include -#include +#include namespace aidl::android::hardware::graphics::composer3::vts { @@ -58,7 +58,7 @@ class GraphicsComposerCallback : public BnComposerCallback { mutable std::mutex mMutex; // the set of all currently connected displays - std::unordered_set mDisplays GUARDED_BY(mMutex); + std::vector mDisplays GUARDED_BY(mMutex); // true only when vsync is enabled bool mVsyncAllowed GUARDED_BY(mMutex) = true; -- GitLab From 03e15d8e8f46467aeec1eeabde352364079d7b51 Mon Sep 17 00:00:00 2001 From: Brian Duddie Date: Mon, 14 Feb 2022 10:40:17 -0800 Subject: [PATCH 619/825] Clarify optionality of head tracker velocity Bug: 218911221 Test: n/a, comment change only Change-Id: I2645114727c452df8d53ad015736f9f2d8d5b6e2 --- sensors/aidl/android/hardware/sensors/Event.aidl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sensors/aidl/android/hardware/sensors/Event.aidl b/sensors/aidl/android/hardware/sensors/Event.aidl index e8550f184b..b95299c506 100644 --- a/sensors/aidl/android/hardware/sensors/Event.aidl +++ b/sensors/aidl/android/hardware/sensors/Event.aidl @@ -204,6 +204,8 @@ parcelable Event { * velocity of the head (relative to itself), in radians per second. * The direction of this vector indicates the axis of rotation, and * the magnitude indicates the rate of rotation. + * If this head tracker sensor instance does not support detecting + * velocity, then these fields must be set to 0. */ float vx; float vy; -- GitLab From 18aa2d952b440d761538133d5f7e8ef3ebb1753f Mon Sep 17 00:00:00 2001 From: Rucha Katakwar Date: Fri, 4 Feb 2022 11:23:10 -0800 Subject: [PATCH 620/825] Camera: Update constrained HFR VTS test. Added a check that HAL does not advertise multiple preview rates for the same recording rate and size. Bug: 200310682 Change-Id: Ia213f152ad00c846a533577e552b668efdde6f3d --- .../VtsHalCameraProviderV2_4TargetTest.cpp | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index 3254cf2a21..7e5e8b2bae 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -171,6 +171,27 @@ struct AvailableStream { int32_t format; }; +struct RecordingRateSizePair { + int32_t recordingRate; + int32_t width; + int32_t height; + + bool operator==(const RecordingRateSizePair &p) const{ + return p.recordingRate == recordingRate && + p.width == width && + p.height == height; + } +}; + +struct RecordingRateSizePairHasher { + size_t operator()(const RecordingRateSizePair& p) const { + std::size_t p1 = std::hash()(p.recordingRate); + std::size_t p2 = std::hash()(p.width); + std::size_t p3 = std::hash()(p.height); + return p1 ^ p2 ^ p3; + } +}; + struct AvailableZSLInputOutput { int32_t inputFormat; int32_t outputFormat; @@ -4540,6 +4561,39 @@ TEST_P(CameraHidlTest, configureStreamsConstrainedOutputs) { rc = pickConstrainedModeSize(staticMeta, hfrStream); ASSERT_EQ(Status::OK, rc); + // Check that HAL does not advertise multiple preview rates + // for the same recording rate and size. + camera_metadata_ro_entry entry; + + std::unordered_map fpsRangeMap; + + auto retCode = find_camera_metadata_ro_entry(staticMeta, + ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS, &entry); + ASSERT_EQ(retCode, 0); + ASSERT_GT(entry.count, 0); + + for (size_t i = 0; i < entry.count; i+=5) { + RecordingRateSizePair recordingRateSizePair; + recordingRateSizePair.width = entry.data.i32[i]; + recordingRateSizePair.height = entry.data.i32[i+1]; + + int32_t previewFps = entry.data.i32[i+2]; + int32_t recordingFps = entry.data.i32[i+3]; + recordingRateSizePair.recordingRate = recordingFps; + + if (recordingFps != previewFps) { + auto it = fpsRangeMap.find(recordingRateSizePair); + if (it == fpsRangeMap.end()) { + fpsRangeMap.insert(std::make_pair(recordingRateSizePair,previewFps)); + ALOGV("Added RecordingRateSizePair:%d , %d, %d PreviewRate: %d", + recordingFps, recordingRateSizePair.width, recordingRateSizePair.height, + previewFps); + } else { + ASSERT_EQ(previewFps, it->second); + } + } + } + int32_t streamId = 0; uint32_t streamConfigCounter = 0; V3_2::Stream stream = {streamId, -- GitLab From 9ab4ffb43e66ca331f6e9aa4efebcf6408322ce3 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 15 Feb 2022 19:28:20 -0800 Subject: [PATCH 621/825] Add AndroidCarApiTest to presubmit. Add AndroidCarApiTest to presubmit because it is using VHAL. Test: None Bug: None Change-Id: I4be1e2bb10a8a1f59cbc36b029083a7781fde5fa --- automotive/vehicle/TEST_MAPPING | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/automotive/vehicle/TEST_MAPPING b/automotive/vehicle/TEST_MAPPING index ff6f3be52b..92cab96a87 100644 --- a/automotive/vehicle/TEST_MAPPING +++ b/automotive/vehicle/TEST_MAPPING @@ -24,5 +24,10 @@ { "name": "DefaultVehicleHalTest" } + ], + "auto-postsubmit": [ + { + "name": "AndroidCarApiTest" + } ] } -- GitLab From b62be4dbacae2f8fb803ba4d144ba85d739bddd1 Mon Sep 17 00:00:00 2001 From: Antonio Kantek Date: Fri, 11 Feb 2022 16:47:13 -0800 Subject: [PATCH 622/825] Update CustomInputType AIDL documentation OEMs are now free to pick any input code to represent their custom input event. Bug: 217288618 Test: atest CarServiceUnitTest Change-Id: I48c967f0b2692bedef32cfae5435c8d4624e353f --- .../hardware/automotive/vehicle/CustomInputType.aidl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl index 10dbfd061e..0f4855e7b4 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/CustomInputType.aidl @@ -23,10 +23,11 @@ package android.hardware.automotive.vehicle; @Backing(type="int") enum CustomInputType { /** - * Ten functions representing the custom input code to be defined and implemented by OEM - * partners. + * Ten optional functions to be used in case OEM don't need more than 10 input code values. * - * OEMs need to formally contact Android team if more than 10 functions are required. + * OEMs are free to use any signed 32 bits number to represent the input code value. + * The following function keys are only for convenience and any other integer values are + * also allowed. */ CUSTOM_EVENT_F1 = 1001, CUSTOM_EVENT_F2 = 1002, -- GitLab From 07e6f8499b10d5fb640642f8339dd9096aeef74e Mon Sep 17 00:00:00 2001 From: ramindani Date: Tue, 15 Feb 2022 15:28:33 +0000 Subject: [PATCH 623/825] [VTS] BlendMode::Coverage test Enable BlendMode::Coverage test. Test pass: BlendMode/GraphicsBlendModeCompositionTest#Premultiplied/0: PASSED (930ms) BlendMode/GraphicsBlendModeCompositionTest#Premultiplied/1: PASSED (933ms) BUG: 219737571 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I5f5bbf371c26933457eec0f3710d47ddadd06cdb --- .../vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 55a8c70ccb..8098961eef 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -1181,8 +1181,7 @@ TEST_P(GraphicsBlendModeCompositionTest, DISABLED_None) { } } -// TODO(b/219737571) Enable test for HWC3.0 after we matched with 2.4 -TEST_P(GraphicsBlendModeCompositionTest, DISABLED_Coverage) { +TEST_P(GraphicsBlendModeCompositionTest, Coverage) { for (ColorMode mode : mTestColorModes) { EXPECT_TRUE(mComposerClient ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) -- GitLab From 58ced4f54e48a960af6c7643a2ca4a49a7f45060 Mon Sep 17 00:00:00 2001 From: ramindani Date: Tue, 15 Feb 2022 16:51:47 +0000 Subject: [PATCH 624/825] [VTS] Removes wait on buffer fence When we have a fence created with GraphicBuffer We don't need to wait on it in VTS tests, the composer should be able to handle the fence in this case BUG: 219589185 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I688d695bb562dd1fe86cdceb642e746cbafe8b30 --- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 10 ---------- .../vts/functional/composer-vts/ReadbackVts.cpp | 4 ---- 2 files changed, 14 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp index 8098961eef..c8cf7b5e7d 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -565,11 +565,6 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { int32_t clientFence; const auto unlockStatus = graphicBuffer->unlockAsync(&clientFence); ASSERT_EQ(::android::OK, unlockStatus); - if (clientFence >= 0) { - sync_wait(clientFence, -1); - close(clientFence); - } - mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence, clientDataspace, std::vector(1, damage)); layer->setToClientComposition(mWriter); @@ -676,11 +671,6 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { int32_t clientFence; const auto unlockStatus = graphicBuffer->unlockAsync(&clientFence); ASSERT_EQ(::android::OK, unlockStatus); - if (clientFence >= 0) { - sync_wait(clientFence, -1); - close(clientFence); - } - mWriter.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence, clientDataspace, std::vector(1, clientFrame)); clientLayer->setToClientComposition(mWriter); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp index ea432ef5f5..8ec38860f7 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp @@ -328,10 +328,6 @@ void TestBufferLayer::fillBuffer(std::vector& expectedColors) { const auto unlockStatus = mGraphicBuffer->unlockAsync(&mFillFence); ASSERT_EQ(::android::OK, unlockStatus); - if (mFillFence >= 0) { - sync_wait(mFillFence, -1); - close(mFillFence); - } } void TestBufferLayer::setBuffer(std::vector colors) { -- GitLab From 0623bdd5fca56c62b62372eff58031f20a273878 Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Wed, 16 Feb 2022 11:09:26 -0800 Subject: [PATCH 625/825] Enable IRadio AIDL VTS tests Fix failing SIM tests so test suite can be enabled Test: atest VtsHalRadioTargetTest passes Bug: 217574863 Change-Id: Id7ac87ca6da799df4af983cd295a4234e75565d2 --- radio/aidl/vts/Android.bp | 9 ++++----- radio/aidl/vts/radio_sim_test.cpp | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/radio/aidl/vts/Android.bp b/radio/aidl/vts/Android.bp index 8060e4bcc3..d5bf21c460 100644 --- a/radio/aidl/vts/Android.bp +++ b/radio/aidl/vts/Android.bp @@ -66,9 +66,8 @@ cc_test { "android.hardware.radio.sim-V1-ndk", "android.hardware.radio.voice-V1-ndk", ], - // TODO(b/210712359): enable after b/207695009 is resolved. - //test_suites: [ - // "general-tests", - // "vts", - //], + test_suites: [ + "general-tests", + "vts", + ], } diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp index 64474c95a8..e82235c2b6 100644 --- a/radio/aidl/vts/radio_sim_test.cpp +++ b/radio/aidl/vts/radio_sim_test.cpp @@ -376,8 +376,6 @@ TEST_P(RadioSimTest, getAllowedCarriers) { * Test IRadioSim.setAllowedCarriers() for the response returned. */ TEST_P(RadioSimTest, setAllowedCarriers) { - // TODO (b/210712359): remove once shim supports 1.4 or alternative is found - GTEST_SKIP(); serial = GetRandomSerialNumber(); CarrierRestrictions carrierRestrictions; memset(&carrierRestrictions, 0, sizeof(carrierRestrictions)); @@ -411,7 +409,8 @@ TEST_P(RadioSimTest, setAllowedCarriers) { sleep(2); updateSimCardStatus(); } - EXPECT_EQ(CardStatus::STATE_RESTRICTED, cardStatus.cardState); + // TODO: uncomment once CF fully supports setAllowedCarriers + // EXPECT_EQ(CardStatus::STATE_RESTRICTED, cardStatus.cardState); } /* Verify that configuration was set correctly, retrieving it from the modem */ -- GitLab From f4e067b600933f4a37dab4e5055ae77e7e06e2ce Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Wed, 16 Feb 2022 16:32:17 -0800 Subject: [PATCH 626/825] Update compatibility matrices for IRadio AIDL Test: build Bug: 205355625 Change-Id: I5fb37f2e05a1b6697eb27e1f3340c7d6b3f409b5 --- .../compatibility_matrix.current.xml | 45 ++++--------------- 1 file changed, 8 insertions(+), 37 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 2390f9d9cc..18ff1fb1dc 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -523,6 +523,14 @@ default + + android.hardware.radio.config + 1 + + IRadioConfig + default + + android.hardware.radio.data 1 @@ -583,16 +591,6 @@ slot3 - - android.hardware.radio - 1.6 - - IRadio - slot1 - slot2 - slot3 - - android.hardware.radio 1.2 @@ -601,33 +599,6 @@ slot1 - - android.hardware.radio.config - - 1.1 - - IRadioConfig - default - - - - android.hardware.radio.config - 1 - - IRadioConfig - default - - - - android.hardware.radio.config - 1.3 - - IRadioConfig - default - - android.hardware.renderscript 1.0 -- GitLab From de0575882c543d4c8668f5b70be8c1894167a8f8 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Thu, 13 Jan 2022 12:26:00 -0500 Subject: [PATCH 627/825] Add a VTS test for DISPLAY_DECORATION Check for support via getDisplayDecorationSupport. If it is supported, verify that we can allocate a buffer of the correct format and that Composition.DISPLAY_DECORATION can be used without error. If it's not supported, expect an error of EX_UNSUPPORTED_OPERATION. Bug: 209458568 Fixes: 209458568 Test: atest VtsHalGraphicsComposer3_TargetTest (this) Change-Id: I0a62a0ce3f8fd3a2d6088f94ce1ad0840d9c6faa --- .../VtsHalGraphicsComposer3_TargetTest.cpp | 76 +++++++++++++++---- .../composer-vts/VtsComposerClient.cpp | 8 +- .../composer-vts/include/VtsComposerClient.h | 4 + 3 files changed, 73 insertions(+), 15 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 17ec8854e9..0dcef27a33 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -1035,11 +1036,10 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { } } - sp allocate() { + sp allocate(::android::PixelFormat pixelFormat) { return sp::make( static_cast(getPrimaryDisplay().getDisplayWidth()), - static_cast(getPrimaryDisplay().getDisplayHeight()), - ::android::PIXEL_FORMAT_RGBA_8888, + static_cast(getPrimaryDisplay().getDisplayHeight()), pixelFormat, /*layerCount*/ 1U, (static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | static_cast(common::BufferUsage::CPU_READ_OFTEN) | @@ -1065,7 +1065,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount); EXPECT_TRUE(status.isOk()); { - const auto buffer = allocate(); + const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888); ASSERT_NE(nullptr, buffer); ASSERT_EQ(::android::OK, buffer->initCheck()); ASSERT_NE(nullptr, buffer->handle); @@ -1086,7 +1086,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { } { - const auto buffer = allocate(); + const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888); ASSERT_NE(nullptr, buffer->handle); mWriter.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, buffer->handle, @@ -1236,8 +1236,8 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { const auto vsyncPeriod = getVsyncPeriod(); - const auto buffer1 = allocate(); - const auto buffer2 = allocate(); + const auto buffer1 = allocate(::android::PIXEL_FORMAT_RGBA_8888); + const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888); ASSERT_NE(nullptr, buffer1); ASSERT_NE(nullptr, buffer2); @@ -1391,7 +1391,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetOutputBuffer) { kBufferSlotCount); EXPECT_TRUE(displayStatus.isOk()); - const auto buffer = allocate(); + const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888); const auto handle = buffer->handle; mWriter.setOutputBuffer(display.display, /*slot*/ 0, handle, /*releaseFence*/ -1); execute(); @@ -1435,7 +1435,7 @@ TEST_P(GraphicsComposerAidlCommandTest, PresentDisplayNoLayerStateChanges) { EXPECT_TRUE(mComposerClient->setColorMode(getPrimaryDisplayId(), ColorMode::NATIVE, intent) .isOk()); - const auto buffer = allocate(); + const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888); const auto handle = buffer->handle; ASSERT_NE(nullptr, handle); @@ -1463,7 +1463,7 @@ TEST_P(GraphicsComposerAidlCommandTest, PresentDisplayNoLayerStateChanges) { execute(); ASSERT_TRUE(mReader.takeErrors().empty()); - const auto buffer2 = allocate(); + const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888); const auto handle2 = buffer2->handle; ASSERT_NE(nullptr, handle2); mWriter.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle2, @@ -1480,7 +1480,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerCursorPosition) { mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); EXPECT_TRUE(layerStatus.isOk()); - const auto buffer = allocate(); + const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888); const auto handle = buffer->handle; ASSERT_NE(nullptr, handle); @@ -1513,7 +1513,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerCursorPosition) { } TEST_P(GraphicsComposerAidlCommandTest, SetLayerBuffer) { - const auto buffer = allocate(); + const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888); const auto handle = buffer->handle; ASSERT_NE(nullptr, handle); @@ -1619,6 +1619,54 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerCompositionType) { execute(); } +TEST_P(GraphicsComposerAidlCommandTest, DisplayDecoration) { + for (VtsDisplay& display : mDisplays) { + const auto [layerStatus, layer] = + mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); + + const auto [error, support] = + mComposerClient->getDisplayDecorationSupport(display.getDisplayId()); + EXPECT_TRUE(error.isOk()); + + const auto format = + support ? support->format + : aidl::android::hardware::graphics::common::PixelFormat::RGBA_8888; + const auto decorBuffer = allocate(static_cast<::android::PixelFormat>(format)); + ASSERT_NE(nullptr, decorBuffer); + if (::android::OK != decorBuffer->initCheck()) { + if (support) { + FAIL() << "Device advertised display decoration support with format " + << aidl::android::hardware::graphics::common::toString(format) + << " but failed to allocate it!"; + } else { + FAIL() << "Device advertised NO display decoration support, but it should " + << "still be able to allocate " + << aidl::android::hardware::graphics::common::toString(format); + } + } + + mWriter.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, decorBuffer->handle, + /*acquireFence*/ -1); + mWriter.setLayerCompositionType(display.getDisplayId(), layer, + Composition::DISPLAY_DECORATION); + mWriter.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp); + execute(); + if (support) { + ASSERT_TRUE(mReader.takeErrors().empty()); + } else { + const auto errors = mReader.takeErrors(); + ASSERT_EQ(1, errors.size()); + EXPECT_EQ(EX_UNSUPPORTED_OPERATION, errors[0].errorCode); + + const auto changedTypes = mReader.takeChangedCompositionTypes(display.getDisplayId()); + ASSERT_EQ(1u, changedTypes.size()); + const auto changedType = changedTypes[0].composition; + EXPECT_TRUE(changedType == Composition::DEVICE || changedType == Composition::CLIENT); + } + } +} + TEST_P(GraphicsComposerAidlCommandTest, SetLayerDataspace) { const auto& [layerStatus, layer] = mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); @@ -1657,7 +1705,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerSidebandStream) { return; } - const auto buffer = allocate(); + const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888); const auto handle = buffer->handle; ASSERT_NE(nullptr, handle); @@ -1971,7 +2019,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_Timeout_2) { EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk()); EXPECT_TRUE(mComposerClient->setIdleTimerEnabled(getPrimaryDisplayId(), /*timeout*/ 0).isOk()); - const auto buffer = allocate(); + const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888); ASSERT_NE(nullptr, buffer->handle); const auto layer = createOnScreenLayer(); diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp index 8c882d0af6..b3b10d0092 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp @@ -283,6 +283,12 @@ std::pair> VtsComposerClient::getSupport return {mComposerClient->getSupportedContentTypes(display, &outContentTypes), outContentTypes}; } +std::pair> +VtsComposerClient::getDisplayDecorationSupport(int64_t display) { + std::optional outSupport; + return {mComposerClient->getDisplayDecorationSupport(display, &outSupport), outSupport}; +} + std::pair VtsComposerClient::getMaxVirtualDisplayCount() { int32_t outMaxVirtualDisplayCount; return {mComposerClient->getMaxVirtualDisplayCount(&outMaxVirtualDisplayCount), @@ -499,4 +505,4 @@ bool VtsComposerClient::destroyAllLayers() { mDisplayResources.clear(); return true; } -} // namespace aidl::android::hardware::graphics::composer3::vts \ No newline at end of file +} // namespace aidl::android::hardware::graphics::composer3::vts diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h index 9af867c89d..3625c8ccfe 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h @@ -38,6 +38,7 @@ #include "GraphicsComposerCallback.h" using aidl::android::hardware::graphics::common::Dataspace; +using aidl::android::hardware::graphics::common::DisplayDecorationSupport; using aidl::android::hardware::graphics::common::FRect; using aidl::android::hardware::graphics::common::PixelFormat; using aidl::android::hardware::graphics::common::Rect; @@ -142,6 +143,9 @@ class VtsComposerClient { std::pair> getSupportedContentTypes(int64_t display); + std::pair> getDisplayDecorationSupport( + int64_t display); + std::pair getMaxVirtualDisplayCount(); std::pair getDisplayName(int64_t display); -- GitLab From cd5e4698319ac9805ea0d468bae172e224574d63 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Wed, 16 Feb 2022 16:36:27 -0500 Subject: [PATCH 628/825] Add isSupportedNoFailure and call in IsSupportedR8 The upper layers will treat this failure as a lack of support, so make the test do the same. This allows the test to pass on flame. Bug: 219606432 Test: atest VtsHalGraphicsMapperV4_0TargetTest Change-Id: I57eab60de81989cae59baa8c25b53a1c94229187 --- graphics/mapper/4.0/utils/vts/MapperVts.cpp | 8 ++++++++ .../4.0/utils/vts/include/mapper-vts/4.0/MapperVts.h | 4 ++++ .../vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/graphics/mapper/4.0/utils/vts/MapperVts.cpp b/graphics/mapper/4.0/utils/vts/MapperVts.cpp index 5b2a94e65d..901f0e3ae7 100644 --- a/graphics/mapper/4.0/utils/vts/MapperVts.cpp +++ b/graphics/mapper/4.0/utils/vts/MapperVts.cpp @@ -303,6 +303,14 @@ bool Gralloc::isSupported(const IMapper::BufferDescriptorInfo& descriptorInfo) { return supported; } +bool Gralloc::isSupportedNoFailure(const IMapper::BufferDescriptorInfo& descriptorInfo) { + bool supported = false; + mMapper->isSupported(descriptorInfo, [&](const auto& tmpError, const auto& tmpSupported) { + supported = tmpSupported && tmpError == Error::NONE; + }); + return supported; +} + Error Gralloc::get(const native_handle_t* bufferHandle, const IMapper::MetadataType& metadataType, hidl_vec* outVec) { Error err; diff --git a/graphics/mapper/4.0/utils/vts/include/mapper-vts/4.0/MapperVts.h b/graphics/mapper/4.0/utils/vts/include/mapper-vts/4.0/MapperVts.h index 22a935f260..c5406c90b0 100644 --- a/graphics/mapper/4.0/utils/vts/include/mapper-vts/4.0/MapperVts.h +++ b/graphics/mapper/4.0/utils/vts/include/mapper-vts/4.0/MapperVts.h @@ -111,6 +111,10 @@ class Gralloc { bool isSupported(const IMapper::BufferDescriptorInfo& descriptorInfo); + // A version of isSupported that simply treats failure as no support, so it + // does not fail the test. + bool isSupportedNoFailure(const IMapper::BufferDescriptorInfo& descriptorInfo); + Error get(const native_handle_t* bufferHandle, const IMapper::MetadataType& metadataType, hidl_vec* outVec); diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp index 5e012f6ef7..463b565c2c 100644 --- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp +++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp @@ -1220,7 +1220,7 @@ TEST_P(GraphicsMapperHidlTest, IsSupportedR8) { aidl::android::hardware::graphics::common::PixelFormat::R_8); bool supported = false; - ASSERT_NO_FATAL_FAILURE(supported = mGralloc->isSupported(info)); + supported = mGralloc->isSupportedNoFailure(info); if (!supported) { GTEST_SUCCEED() << "R_8 is optional; unsupported so skipping allocation test"; -- GitLab From 6d66167031e397e624b33ae951fb26ff5ca4d90f Mon Sep 17 00:00:00 2001 From: Quang Luong Date: Wed, 16 Feb 2022 13:08:39 -0800 Subject: [PATCH 629/825] Reinstate functionality of IWifiChip.getAvailableModes() IWifiChip.getAvailableModes() is needed as a dependency for VTS tests. Reinstate the API to avoid breaking old tests, ignoring the new AP_BRIDGED concurrency type. Bug: 219617823 Test: atest VtsHalWifiV1_0TargetTest VtsHalWifiV1_1TargetTest VtsHalWifiV1_2TargetTest VtsHalWifiV1_3TargetTest VtsHalWifiV1_4TargetTest VtsHalWifiV1_5TargetTest Change-Id: Ide5b251b20f1ea56a76c2ce3b04c4e28fc29624c --- wifi/1.6/default/wifi_chip.cpp | 53 ++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/wifi/1.6/default/wifi_chip.cpp b/wifi/1.6/default/wifi_chip.cpp index 0e2accf510..6cc12358e5 100644 --- a/wifi/1.6/default/wifi_chip.cpp +++ b/wifi/1.6/default/wifi_chip.cpp @@ -791,8 +791,57 @@ std::pair WifiChip::getCapabilitiesInternal() { std::pair> WifiChip::getAvailableModesInternal() { - // Deprecated support -- use getAvailableModes_1_6. - return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}}; + // Deprecated support -- use getAvailableModes_1_6 for more granular concurrency combinations. + std::vector modes_1_0 = {}; + for (const auto& mode_1_6 : modes_) { + std::vector combos_1_0; + for (const auto& combo_1_6 : mode_1_6.availableCombinations) { + std::vector limits_1_0; + for (const auto& limit_1_6 : combo_1_6.limits) { + std::vector types_1_0; + for (IfaceConcurrencyType type_1_6 : limit_1_6.types) { + switch (type_1_6) { + case IfaceConcurrencyType::STA: + types_1_0.push_back(IfaceType::STA); + break; + case IfaceConcurrencyType::AP: + types_1_0.push_back(IfaceType::AP); + break; + case IfaceConcurrencyType::AP_BRIDGED: + // Ignore AP_BRIDGED + break; + case IfaceConcurrencyType::P2P: + types_1_0.push_back(IfaceType::P2P); + break; + case IfaceConcurrencyType::NAN: + types_1_0.push_back(IfaceType::NAN); + break; + } + } + if (types_1_0.empty()) { + continue; + } + V1_0::IWifiChip::ChipIfaceCombinationLimit limit_1_0; + limit_1_0.types = hidl_vec(types_1_0); + limit_1_0.maxIfaces = limit_1_6.maxIfaces; + limits_1_0.push_back(limit_1_0); + } + if (limits_1_0.empty()) { + continue; + } + V1_0::IWifiChip::ChipIfaceCombination combo_1_0; + combo_1_0.limits = hidl_vec(limits_1_0); + combos_1_0.push_back(combo_1_0); + } + if (combos_1_0.empty()) { + continue; + } + V1_0::IWifiChip::ChipMode mode_1_0; + mode_1_0.id = mode_1_6.id; + mode_1_0.availableCombinations = hidl_vec(combos_1_0); + modes_1_0.push_back(mode_1_0); + } + return {createWifiStatus(WifiStatusCode::SUCCESS), modes_1_0}; } WifiStatus WifiChip::configureChipInternal( -- GitLab From 7f40eee6125dccf3853fcb6cdafecbfbeb785095 Mon Sep 17 00:00:00 2001 From: Ahmed ElArabawy Date: Thu, 17 Feb 2022 18:25:51 -0800 Subject: [PATCH 630/825] Wifi: Fix VTS tests broken due to uprev to Vendor HAL 1.6 This commit skips the tests for the deprecated HAL APIs due to the addition of the Vendor HAL ver. 1.6 Bug: 220201314 Test: atest VtsHalWifiRttV1_4TargetTest Test: atest VtsHalWifiV1_5TargetTest Change-Id: I9c15249effa9a678115bf644012c0047ad13c66b --- .../vts/functional/wifi_rtt_controller_hidl_test.cpp | 11 +++++++++-- wifi/1.5/vts/functional/wifi_sta_iface_hidl_test.cpp | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/wifi/1.4/vts/functional/wifi_rtt_controller_hidl_test.cpp b/wifi/1.4/vts/functional/wifi_rtt_controller_hidl_test.cpp index 72cde3ca71..8918997920 100644 --- a/wifi/1.4/vts/functional/wifi_rtt_controller_hidl_test.cpp +++ b/wifi/1.4/vts/functional/wifi_rtt_controller_hidl_test.cpp @@ -66,7 +66,9 @@ class WifiRttControllerHidlTest : public ::testing::TestWithParam { stopWifi(GetInstanceName()); wifi_rtt_controller_ = getWifiRttController(); - ASSERT_NE(nullptr, wifi_rtt_controller_.get()); + if (wifi_rtt_controller_.get() == nullptr) { + GTEST_SKIP() << "Skipping this test since API is deprecated."; + } // Check RTT support before we run the test. std::pair status_and_caps; @@ -79,7 +81,7 @@ class WifiRttControllerHidlTest : public ::testing::TestWithParam { virtual void TearDown() override { stopWifi(GetInstanceName()); } - // A simple test implementation of WifiChipEventCallback. + // A simple test implementation of WifiRttControllerEventCallback. class WifiRttControllerEventCallback : public ::testing::VtsHalHidlTargetCallbackBase< WifiRttControllerHidlTest>, @@ -122,6 +124,11 @@ class WifiRttControllerHidlTest : public ::testing::TestWithParam { const auto& status_and_controller = HIDL_INVOKE(wifi_chip, createRttController_1_4, wifi_sta_iface); + + if (status_and_controller.first.code == WifiStatusCode::ERROR_NOT_SUPPORTED) { + return nullptr; + } + EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_controller.first.code); EXPECT_NE(nullptr, status_and_controller.second.get()); diff --git a/wifi/1.5/vts/functional/wifi_sta_iface_hidl_test.cpp b/wifi/1.5/vts/functional/wifi_sta_iface_hidl_test.cpp index 399307ecdc..7a0eb1f06f 100644 --- a/wifi/1.5/vts/functional/wifi_sta_iface_hidl_test.cpp +++ b/wifi/1.5/vts/functional/wifi_sta_iface_hidl_test.cpp @@ -94,6 +94,11 @@ TEST_P(WifiStaIfaceHidlTest, GetLinkLayerStats_1_5) { // Retrieve link layer stats. const auto& status_and_stats = HIDL_INVOKE(wifi_sta_iface_, getLinkLayerStats_1_5); + + if (status_and_stats.first.code == WifiStatusCode::ERROR_NOT_SUPPORTED) { + GTEST_SKIP() << "Skipping this test since API is deprecated."; + } + EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_stats.first.code); EXPECT_GT(status_and_stats.second.timeStampInMs, 0u); // Try to create 2nd iface. If yes, it should fill in the duty cycle field. -- GitLab From fea031e81d9577a9efcd8d8390842ec3d7f97d0d Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Wed, 16 Feb 2022 20:43:52 +0000 Subject: [PATCH 631/825] Reorder the hostapd Generation enum to list the WiFi generations chronologically. Bug: 213475388 Test: Build the interface (mm -j) Change-Id: I9f501c021956a376c03884dadade473ab0953bd3 (cherry picked from commit 04deb64be1cb1fdc4242babf6eddb240d16bfd39) --- .../current/android/hardware/wifi/hostapd/Generation.aidl | 4 ++-- .../aidl/android/hardware/wifi/hostapd/Generation.aidl | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Generation.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Generation.aidl index af0e960df8..5bb0d32869 100644 --- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Generation.aidl +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Generation.aidl @@ -38,7 +38,7 @@ enum Generation { WIFI_STANDARD_LEGACY = 0, WIFI_STANDARD_11N = 1, WIFI_STANDARD_11AC = 2, - WIFI_STANDARD_11AX = 3, - WIFI_STANDARD_11AD = 4, + WIFI_STANDARD_11AD = 3, + WIFI_STANDARD_11AX = 4, WIFI_STANDARD_11BE = 5, } diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Generation.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Generation.aidl index f4e3eb0668..5b74732bda 100644 --- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Generation.aidl +++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Generation.aidl @@ -25,8 +25,8 @@ package android.hardware.wifi.hostapd; * WIFI_STANDARD_11N = [hw_mode is HOSTAPD_MODE_IEEE80211G and (HT is 1 or HT40 is 1)] or * [hw_mode is HOSTAPD_MODE_IEEE80211A and VHT is 0]. * WIFI_STANDARD_11AC = hw_mode is HOSTAPD_MODE_IEEE80211A and VHT is 1. - * WIFI_STANDARD_11AX = hw_mode is HOSTAPD_MODE_IEEE80211A and High Efficiency supported. * WIFI_STANDARD_11AD = hw_mode is HOSTAPD_MODE_IEEE80211AD. + * WIFI_STANDARD_11AX = hw_mode is HOSTAPD_MODE_IEEE80211A and High Efficiency supported. * WIFI_STANDARD_11BE = hw_mode is HOSTAPD_MODE_IEEE80211A and Extreme High Throughput supported. */ @VintfStability @@ -36,7 +36,7 @@ enum Generation { WIFI_STANDARD_LEGACY = 0, WIFI_STANDARD_11N = 1, WIFI_STANDARD_11AC = 2, - WIFI_STANDARD_11AX = 3, - WIFI_STANDARD_11AD = 4, + WIFI_STANDARD_11AD = 3, + WIFI_STANDARD_11AX = 4, WIFI_STANDARD_11BE = 5, } -- GitLab From b2c8852cbaf8c134f1af9a7cd53463923ad27086 Mon Sep 17 00:00:00 2001 From: Ahmed ElArabawy Date: Wed, 16 Feb 2022 16:04:20 -0800 Subject: [PATCH 632/825] Wifi: Add VTS tests for Vendor HAL 1.6 This commit adds the VTS tests for the Wifi Vendor HAL 1.6 Bug: 220014236 Test: atest VtsHalWifiV1_6TargetTest Test: atest VtsHalWifiNanV1_6TargetTest Test: atest VtsHalWifiRttV1_6TargetTest Change-Id: Id9f034c25029ef7a7f437185082abef67776ac8f --- wifi/1.6/vts/OWNERS | 2 + wifi/1.6/vts/functional/Android.bp | 98 +++ .../vts/functional/wifi_chip_hidl_test.cpp | 102 +++ .../functional/wifi_nan_iface_hidl_test.cpp | 611 ++++++++++++++++++ .../wifi_rtt_controller_hidl_test.cpp | 295 +++++++++ .../functional/wifi_sta_iface_hidl_test.cpp | 107 +++ 6 files changed, 1215 insertions(+) create mode 100644 wifi/1.6/vts/OWNERS create mode 100644 wifi/1.6/vts/functional/Android.bp create mode 100644 wifi/1.6/vts/functional/wifi_chip_hidl_test.cpp create mode 100644 wifi/1.6/vts/functional/wifi_nan_iface_hidl_test.cpp create mode 100644 wifi/1.6/vts/functional/wifi_rtt_controller_hidl_test.cpp create mode 100644 wifi/1.6/vts/functional/wifi_sta_iface_hidl_test.cpp diff --git a/wifi/1.6/vts/OWNERS b/wifi/1.6/vts/OWNERS new file mode 100644 index 0000000000..294fc82c70 --- /dev/null +++ b/wifi/1.6/vts/OWNERS @@ -0,0 +1,2 @@ +# Bug component: 33618 +include ../../1.0/vts/OWNERS diff --git a/wifi/1.6/vts/functional/Android.bp b/wifi/1.6/vts/functional/Android.bp new file mode 100644 index 0000000000..2d126c7e8d --- /dev/null +++ b/wifi/1.6/vts/functional/Android.bp @@ -0,0 +1,98 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // 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: "VtsHalWifiV1_6TargetTest", + defaults: ["VtsHalTargetTestDefaults"], + srcs: [ + "wifi_chip_hidl_test.cpp", + "wifi_sta_iface_hidl_test.cpp", + ], + static_libs: [ + "VtsHalWifiV1_0TargetTestUtil", + "android.hardware.wifi@1.0", + "android.hardware.wifi@1.1", + "android.hardware.wifi@1.2", + "android.hardware.wifi@1.3", + "android.hardware.wifi@1.4", + "android.hardware.wifi@1.5", + "android.hardware.wifi@1.6", + "libwifi-system-iface", + ], + test_suites: [ + "general-tests", + "vts", + ], +} + +// These tests are split out so that they can be conditioned on presence of the +// "android.hardware.wifi.rtt" feature. +cc_test { + name: "VtsHalWifiRttV1_6TargetTest", + defaults: ["VtsHalTargetTestDefaults"], + srcs: [ + "wifi_rtt_controller_hidl_test.cpp", + ], + static_libs: [ + "VtsHalWifiV1_0TargetTestUtil", + "android.hardware.wifi@1.0", + "android.hardware.wifi@1.1", + "android.hardware.wifi@1.2", + "android.hardware.wifi@1.3", + "android.hardware.wifi@1.4", + "android.hardware.wifi@1.5", + "android.hardware.wifi@1.6", + "libwifi-system-iface", + ], + test_suites: [ + "general-tests", + "vts", + ], +} + +// These tests are split out so that they can be conditioned on presence of the +// "android.hardware.wifi.aware" feature. +cc_test { + name: "VtsHalWifiNanV1_6TargetTest", + defaults: ["VtsHalTargetTestDefaults"], + srcs: [ + "wifi_nan_iface_hidl_test.cpp", + ], + static_libs: [ + "VtsHalWifiV1_0TargetTestUtil", + "android.hardware.wifi@1.0", + "android.hardware.wifi@1.1", + "android.hardware.wifi@1.2", + "android.hardware.wifi@1.3", + "android.hardware.wifi@1.4", + "android.hardware.wifi@1.5", + "android.hardware.wifi@1.6", + "libwifi-system-iface", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/wifi/1.6/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.6/vts/functional/wifi_chip_hidl_test.cpp new file mode 100644 index 0000000000..54fb7216fa --- /dev/null +++ b/wifi/1.6/vts/functional/wifi_chip_hidl_test.cpp @@ -0,0 +1,102 @@ +/* + * 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. + */ + +#include +#include + +#undef NAN // NAN is defined in bionic/libc/include/math.h:38 + +#include +#include +#include +#include +#include +#include +#include + +#include "wifi_hidl_call_util.h" +#include "wifi_hidl_test_utils.h" + +using ::android::sp; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::wifi::V1_0::ChipModeId; +using ::android::hardware::wifi::V1_0::IfaceType; +using ::android::hardware::wifi::V1_0::IWifiIface; +using ::android::hardware::wifi::V1_0::IWifiStaIface; +using ::android::hardware::wifi::V1_0::WifiDebugRingBufferStatus; +using ::android::hardware::wifi::V1_0::WifiStatus; +using ::android::hardware::wifi::V1_0::WifiStatusCode; +using ::android::hardware::wifi::V1_4::IWifiChipEventCallback; +using ::android::hardware::wifi::V1_5::WifiBand; +using ::android::hardware::wifi::V1_5::WifiIfaceMode; +using ::android::hardware::wifi::V1_6::IWifiChip; + +/** + * Fixture to use for all Wifi chip HIDL interface tests. + */ +class WifiChipHidlTest : public ::testing::TestWithParam { + public: + virtual void SetUp() override { + // Make sure to start with a clean state + stopWifi(GetInstanceName()); + + wifi_chip_ = IWifiChip::castFrom(getWifiChip(GetInstanceName())); + ASSERT_NE(nullptr, wifi_chip_.get()); + } + + virtual void TearDown() override { stopWifi(GetInstanceName()); } + + protected: + // Helper function to configure the Chip in one of the supported modes. + // Most of the non-mode-configuration-related methods require chip + // to be first configured. + ChipModeId configureChipForIfaceType(IfaceType type, bool expectSuccess) { + ChipModeId mode_id; + EXPECT_EQ(expectSuccess, configureChipToSupportIfaceType(wifi_chip_, type, &mode_id)); + return mode_id; + } + + sp wifi_chip_; + + private: + std::string GetInstanceName() { return GetParam(); } +}; + +/* getUsableChannels_1_6: + * Ensure that a call to getUsableChannels_1_6 will return with a success + * status for valid inputs. + */ +TEST_P(WifiChipHidlTest, getUsableChannels_1_6) { + uint32_t ifaceModeMask = + WifiIfaceMode::IFACE_MODE_P2P_CLIENT | WifiIfaceMode::IFACE_MODE_P2P_GO; + uint32_t filterMask = IWifiChip::UsableChannelFilter::CELLULAR_COEXISTENCE | + IWifiChip::UsableChannelFilter::CONCURRENCY; + configureChipForIfaceType(IfaceType::STA, true); + WifiBand band = WifiBand::BAND_24GHZ_5GHZ_6GHZ; + const auto& statusNonEmpty = + HIDL_INVOKE(wifi_chip_, getUsableChannels_1_6, band, ifaceModeMask, filterMask); + + EXPECT_EQ(WifiStatusCode::SUCCESS, statusNonEmpty.first.code); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiChipHidlTest); +INSTANTIATE_TEST_SUITE_P(PerInstance, WifiChipHidlTest, + testing::ValuesIn(android::hardware::getAllHalInstanceNames( + ::android::hardware::wifi::V1_6::IWifi::descriptor)), + android::hardware::PrintInstanceNameToString); diff --git a/wifi/1.6/vts/functional/wifi_nan_iface_hidl_test.cpp b/wifi/1.6/vts/functional/wifi_nan_iface_hidl_test.cpp new file mode 100644 index 0000000000..bf9e2307fd --- /dev/null +++ b/wifi/1.6/vts/functional/wifi_nan_iface_hidl_test.cpp @@ -0,0 +1,611 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Nanache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wifi_hidl_call_util.h" +#include "wifi_hidl_test_utils.h" + +using namespace ::android::hardware::wifi::V1_0; +using namespace ::android::hardware::wifi::V1_2; +using namespace ::android::hardware::wifi::V1_4; +using namespace ::android::hardware::wifi::V1_5; +using namespace ::android::hardware::wifi::V1_6; + +using ::android::sp; +using ::android::hardware::Return; +using ::android::hardware::Void; + +#define TIMEOUT_PERIOD 10 + +android::sp getWifiNanIface_1_6( + const std::string& instance_name) { + return android::hardware::wifi::V1_6::IWifiNanIface::castFrom(getWifiNanIface(instance_name)); +} + +/** + * Fixture to use for all NAN Iface HIDL interface tests. + */ +class WifiNanIfaceHidlTest : public ::testing::TestWithParam { + public: + virtual void SetUp() override { + if (!::testing::deviceSupportsFeature("android.hardware.wifi.aware")) + GTEST_SKIP() << "Skipping this test since NAN is not supported."; + // Make sure to start with a clean state + stopWifi(GetInstanceName()); + + iwifiNanIface = getWifiNanIface_1_6(GetInstanceName()); + ASSERT_NE(nullptr, iwifiNanIface.get()); + ASSERT_EQ(WifiStatusCode::SUCCESS, HIDL_INVOKE(iwifiNanIface, registerEventCallback_1_6, + new WifiNanIfaceEventCallback(*this)) + .code); + } + + virtual void TearDown() override { stopWifi(GetInstanceName()); } + + /* Used as a mechanism to inform the test about data/event callback */ + inline void notify() { + std::unique_lock lock(mtx_); + count_++; + cv_.notify_one(); + } + + enum CallbackType { + INVALID = -2, + ANY_CALLBACK = -1, + + NOTIFY_CAPABILITIES_RESPONSE = 0, + NOTIFY_ENABLE_RESPONSE, + NOTIFY_CONFIG_RESPONSE, + NOTIFY_DISABLE_RESPONSE, + NOTIFY_START_PUBLISH_RESPONSE, + NOTIFY_STOP_PUBLISH_RESPONSE, + NOTIFY_START_SUBSCRIBE_RESPONSE, + NOTIFY_STOP_SUBSCRIBE_RESPONSE, + NOTIFY_TRANSMIT_FOLLOWUP_RESPONSE, + NOTIFY_CREATE_DATA_INTERFACE_RESPONSE, + NOTIFY_DELETE_DATA_INTERFACE_RESPONSE, + NOTIFY_INITIATE_DATA_PATH_RESPONSE, + NOTIFY_RESPOND_TO_DATA_PATH_INDICATION_RESPONSE, + NOTIFY_TERMINATE_DATA_PATH_RESPONSE, + NOTIFY_CAPABILITIES_RESPONSE_1_5, + NOTIFY_CAPABILITIES_RESPONSE_1_6, + + EVENT_CLUSTER_EVENT, + EVENT_DISABLED, + EVENT_PUBLISH_TERMINATED, + EVENT_SUBSCRIBE_TERMINATED, + EVENT_MATCH, + EVENT_MATCH_EXPIRED, + EVENT_FOLLOWUP_RECEIVED, + EVENT_TRANSMIT_FOLLOWUP, + EVENT_DATA_PATH_REQUEST, + EVENT_DATA_PATH_CONFIRM, + EVENT_DATA_PATH_TERMINATED, + EVENT_DATA_PATH_CONFIRM_1_2, + EVENT_DATA_PATH_SCHEDULE_UPDATE, + EVENT_MATCH_1_6, + EVENT_DATA_PATH_SCHEDULE_UPDATE_1_6, + EVENT_DATA_PATH_CONFIRM_1_6, + }; + + /* Test code calls this function to wait for data/event callback */ + /* Must set callbackType = INVALID before call this function */ + inline std::cv_status wait(CallbackType waitForCallbackType) { + std::unique_lock lock(mtx_); + + EXPECT_NE(INVALID, waitForCallbackType); // can't ASSERT in a + // non-void-returning method + + std::cv_status status = std::cv_status::no_timeout; + auto now = std::chrono::system_clock::now(); + while (count_ == 0) { + status = cv_.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD)); + if (status == std::cv_status::timeout) return status; + if (waitForCallbackType != ANY_CALLBACK && callbackType != INVALID && + callbackType != waitForCallbackType) { + count_--; + } + } + count_--; + return status; + } + + class WifiNanIfaceEventCallback + : public ::android::hardware::wifi::V1_6::IWifiNanIfaceEventCallback { + WifiNanIfaceHidlTest& parent_; + + public: + WifiNanIfaceEventCallback(WifiNanIfaceHidlTest& parent) : parent_(parent){}; + + virtual ~WifiNanIfaceEventCallback() = default; + + Return notifyCapabilitiesResponse( + uint16_t id, const WifiNanStatus& status, + const ::android::hardware::wifi::V1_0::NanCapabilities& capabilities) override { + parent_.callbackType = NOTIFY_CAPABILITIES_RESPONSE; + + parent_.id = id; + parent_.status = status; + parent_.capabilities = capabilities; + + parent_.notify(); + return Void(); + } + + Return notifyCapabilitiesResponse_1_5( + uint16_t id, const WifiNanStatus& status, + const ::android::hardware::wifi::V1_5::NanCapabilities& capabilities) override { + parent_.callbackType = NOTIFY_CAPABILITIES_RESPONSE_1_5; + + parent_.id = id; + parent_.status = status; + parent_.capabilities_1_5 = capabilities; + + parent_.notify(); + return Void(); + } + + Return notifyEnableResponse(uint16_t id, const WifiNanStatus& status) override { + parent_.callbackType = NOTIFY_ENABLE_RESPONSE; + + parent_.id = id; + parent_.status = status; + + parent_.notify(); + return Void(); + } + + Return notifyConfigResponse(uint16_t id, const WifiNanStatus& status) override { + parent_.callbackType = NOTIFY_CONFIG_RESPONSE; + + parent_.id = id; + parent_.status = status; + + parent_.notify(); + return Void(); + } + + Return notifyDisableResponse(uint16_t id, const WifiNanStatus& status) override { + parent_.callbackType = NOTIFY_DISABLE_RESPONSE; + + parent_.id = id; + parent_.status = status; + + parent_.notify(); + return Void(); + } + + Return notifyStartPublishResponse(uint16_t id, const WifiNanStatus& status, + uint8_t sessionId) override { + parent_.callbackType = NOTIFY_START_PUBLISH_RESPONSE; + + parent_.id = id; + parent_.status = status; + parent_.sessionId = sessionId; + + parent_.notify(); + return Void(); + } + + Return notifyStopPublishResponse(uint16_t id, const WifiNanStatus& status) override { + parent_.callbackType = NOTIFY_STOP_PUBLISH_RESPONSE; + + parent_.id = id; + parent_.status = status; + + parent_.notify(); + return Void(); + } + + Return notifyStartSubscribeResponse(uint16_t id, const WifiNanStatus& status, + uint8_t sessionId) override { + parent_.callbackType = NOTIFY_START_SUBSCRIBE_RESPONSE; + + parent_.id = id; + parent_.status = status; + parent_.sessionId = sessionId; + + parent_.notify(); + return Void(); + } + + Return notifyStopSubscribeResponse(uint16_t id, + const WifiNanStatus& status) override { + parent_.callbackType = NOTIFY_STOP_SUBSCRIBE_RESPONSE; + + parent_.id = id; + parent_.status = status; + + parent_.notify(); + return Void(); + } + + Return notifyTransmitFollowupResponse(uint16_t id, + const WifiNanStatus& status) override { + parent_.callbackType = NOTIFY_TRANSMIT_FOLLOWUP_RESPONSE; + + parent_.id = id; + parent_.status = status; + + parent_.notify(); + return Void(); + } + + Return notifyCreateDataInterfaceResponse(uint16_t id, + const WifiNanStatus& status) override { + parent_.callbackType = NOTIFY_CREATE_DATA_INTERFACE_RESPONSE; + + parent_.id = id; + parent_.status = status; + + parent_.notify(); + return Void(); + } + + Return notifyDeleteDataInterfaceResponse(uint16_t id, + const WifiNanStatus& status) override { + parent_.callbackType = NOTIFY_DELETE_DATA_INTERFACE_RESPONSE; + + parent_.id = id; + parent_.status = status; + + parent_.notify(); + return Void(); + } + + Return notifyInitiateDataPathResponse(uint16_t id, const WifiNanStatus& status, + uint32_t ndpInstanceId) override { + parent_.callbackType = NOTIFY_INITIATE_DATA_PATH_RESPONSE; + + parent_.id = id; + parent_.status = status; + parent_.ndpInstanceId = ndpInstanceId; + + parent_.notify(); + return Void(); + } + + Return notifyRespondToDataPathIndicationResponse( + uint16_t id, const WifiNanStatus& status) override { + parent_.callbackType = NOTIFY_RESPOND_TO_DATA_PATH_INDICATION_RESPONSE; + + parent_.id = id; + parent_.status = status; + + parent_.notify(); + return Void(); + } + + Return notifyTerminateDataPathResponse(uint16_t id, + const WifiNanStatus& status) override { + parent_.callbackType = NOTIFY_TERMINATE_DATA_PATH_RESPONSE; + + parent_.id = id; + parent_.status = status; + + parent_.notify(); + return Void(); + } + + Return eventClusterEvent(const NanClusterEventInd& event) override { + parent_.callbackType = EVENT_CLUSTER_EVENT; + + parent_.nanClusterEventInd = event; + + parent_.notify(); + return Void(); + } + + Return eventDisabled(const WifiNanStatus& status) override { + parent_.callbackType = EVENT_DISABLED; + + parent_.status = status; + + parent_.notify(); + return Void(); + } + + Return eventPublishTerminated(uint8_t sessionId, + const WifiNanStatus& status) override { + parent_.callbackType = EVENT_PUBLISH_TERMINATED; + + parent_.sessionId = sessionId; + parent_.status = status; + + parent_.notify(); + return Void(); + } + + Return eventSubscribeTerminated(uint8_t sessionId, + const WifiNanStatus& status) override { + parent_.callbackType = EVENT_SUBSCRIBE_TERMINATED; + + parent_.sessionId = sessionId; + parent_.status = status; + + parent_.notify(); + return Void(); + } + + Return eventMatch( + const ::android::hardware::wifi::V1_0::NanMatchInd& event) override { + parent_.callbackType = EVENT_MATCH; + + parent_.nanMatchInd = event; + + parent_.notify(); + return Void(); + } + + Return eventMatchExpired(uint8_t discoverySessionId, uint32_t peerId) override { + parent_.callbackType = EVENT_MATCH_EXPIRED; + + parent_.sessionId = discoverySessionId; + parent_.peerId = peerId; + + parent_.notify(); + return Void(); + } + + Return eventFollowupReceived(const NanFollowupReceivedInd& event) override { + parent_.callbackType = EVENT_FOLLOWUP_RECEIVED; + + parent_.nanFollowupReceivedInd = event; + + parent_.notify(); + return Void(); + } + + Return eventTransmitFollowup(uint16_t id, const WifiNanStatus& status) override { + parent_.callbackType = EVENT_TRANSMIT_FOLLOWUP; + + parent_.id = id; + parent_.status = status; + + parent_.notify(); + return Void(); + } + + Return eventDataPathRequest(const NanDataPathRequestInd& event) override { + parent_.callbackType = EVENT_DATA_PATH_REQUEST; + + parent_.nanDataPathRequestInd = event; + + parent_.notify(); + return Void(); + } + + Return eventDataPathConfirm( + const ::android::hardware::wifi::V1_0::NanDataPathConfirmInd& event) override { + parent_.callbackType = EVENT_DATA_PATH_CONFIRM; + + parent_.nanDataPathConfirmInd = event; + + parent_.notify(); + return Void(); + } + + Return eventDataPathTerminated(uint32_t ndpInstanceId) override { + parent_.callbackType = EVENT_DATA_PATH_TERMINATED; + + parent_.ndpInstanceId = ndpInstanceId; + + parent_.notify(); + return Void(); + } + + Return eventDataPathConfirm_1_2( + const ::android::hardware::wifi::V1_2::NanDataPathConfirmInd& event) override { + parent_.callbackType = EVENT_DATA_PATH_CONFIRM_1_2; + + parent_.nanDataPathConfirmInd_1_2 = event; + + parent_.notify(); + return Void(); + } + + Return eventDataPathScheduleUpdate( + const ::android::hardware::wifi::V1_2::NanDataPathScheduleUpdateInd& event) + override { + parent_.callbackType = EVENT_DATA_PATH_SCHEDULE_UPDATE; + + parent_.nanDataPathScheduleUpdateInd_1_2 = event; + + parent_.notify(); + return Void(); + } + + Return eventMatch_1_6( + const ::android::hardware::wifi::V1_6::NanMatchInd& event) override { + parent_.callbackType = EVENT_MATCH_1_6; + + parent_.nanMatchInd_1_6 = event; + + parent_.notify(); + return Void(); + } + + Return notifyCapabilitiesResponse_1_6( + uint16_t id, const WifiNanStatus& status, + const ::android::hardware::wifi::V1_6::NanCapabilities& capabilities) override { + parent_.callbackType = NOTIFY_CAPABILITIES_RESPONSE_1_6; + + parent_.id = id; + parent_.status = status; + parent_.capabilities_1_6 = capabilities; + + parent_.notify(); + return Void(); + } + + Return eventDataPathScheduleUpdate_1_6( + const ::android::hardware::wifi::V1_6::NanDataPathScheduleUpdateInd& event) + override { + parent_.callbackType = EVENT_DATA_PATH_SCHEDULE_UPDATE_1_6; + + parent_.nanDataPathScheduleUpdateInd_1_6 = event; + + parent_.notify(); + return Void(); + } + + Return eventDataPathConfirm_1_6( + const ::android::hardware::wifi::V1_6::NanDataPathConfirmInd& event) override { + parent_.callbackType = EVENT_DATA_PATH_CONFIRM_1_6; + + parent_.nanDataPathConfirmInd_1_6 = event; + + parent_.notify(); + return Void(); + } + }; + + private: + // synchronization objects + std::mutex mtx_; + std::condition_variable cv_; + int count_ = 0; + + protected: + android::sp<::android::hardware::wifi::V1_6::IWifiNanIface> iwifiNanIface; + + // Data from IWifiNanIfaceEventCallback callbacks: this is the collection of + // all arguments to all callbacks. They are set by the callback + // (notifications or events) and can be retrieved by tests. + CallbackType callbackType; + uint16_t id; + WifiNanStatus status; + uint8_t sessionId; + uint32_t ndpInstanceId; + NanClusterEventInd nanClusterEventInd; + ::android::hardware::wifi::V1_0::NanMatchInd nanMatchInd; + ::android::hardware::wifi::V1_6::NanMatchInd nanMatchInd_1_6; + uint32_t peerId; + NanFollowupReceivedInd nanFollowupReceivedInd; + NanDataPathRequestInd nanDataPathRequestInd; + ::android::hardware::wifi::V1_0::NanCapabilities capabilities; + ::android::hardware::wifi::V1_5::NanCapabilities capabilities_1_5; + ::android::hardware::wifi::V1_6::NanCapabilities capabilities_1_6; + ::android::hardware::wifi::V1_0::NanDataPathConfirmInd nanDataPathConfirmInd; + ::android::hardware::wifi::V1_2::NanDataPathConfirmInd nanDataPathConfirmInd_1_2; + ::android::hardware::wifi::V1_6::NanDataPathConfirmInd nanDataPathConfirmInd_1_6; + ::android::hardware::wifi::V1_2::NanDataPathScheduleUpdateInd nanDataPathScheduleUpdateInd_1_2; + ::android::hardware::wifi::V1_6::NanDataPathScheduleUpdateInd nanDataPathScheduleUpdateInd_1_6; + + std::string GetInstanceName() { return GetParam(); } +}; + +/* + * Create: + * Ensures that an instance of the IWifiNanIface proxy object is + * successfully created. + */ +TEST_P(WifiNanIfaceHidlTest, Create) { + // The creation of a proxy object is tested as part of SetUp method. +} + +/* + * enableRequest_1_6InvalidArgs: validate that fails with invalid arguments + */ +TEST_P(WifiNanIfaceHidlTest, enableRequest_1_6InvalidArgs) { + uint16_t inputCmdId = 10; + callbackType = INVALID; + ::android::hardware::wifi::V1_4::NanEnableRequest nanEnableRequest = {}; + ::android::hardware::wifi::V1_6::NanConfigRequestSupplemental nanConfigRequestSupp = {}; + const auto& halStatus = HIDL_INVOKE(iwifiNanIface, enableRequest_1_6, inputCmdId, + nanEnableRequest, nanConfigRequestSupp); + if (halStatus.code != WifiStatusCode::ERROR_NOT_SUPPORTED) { + ASSERT_EQ(WifiStatusCode::SUCCESS, halStatus.code); + + // wait for a callback + ASSERT_EQ(std::cv_status::no_timeout, wait(NOTIFY_ENABLE_RESPONSE)); + ASSERT_EQ(NOTIFY_ENABLE_RESPONSE, callbackType); + ASSERT_EQ(id, inputCmdId); + ASSERT_EQ(status.status, NanStatusType::INVALID_ARGS); + } +} + +/* + * enableRequest_1_6ShimInvalidArgs: validate that fails with invalid arguments + * to the shim + */ +TEST_P(WifiNanIfaceHidlTest, enableRequest_1_6ShimInvalidArgs) { + uint16_t inputCmdId = 10; + ::android::hardware::wifi::V1_4::NanEnableRequest nanEnableRequest = {}; + nanEnableRequest.configParams.numberOfPublishServiceIdsInBeacon = 128; // must be <= 127 + ::android::hardware::wifi::V1_6::NanConfigRequestSupplemental nanConfigRequestSupp = {}; + const auto& halStatus = HIDL_INVOKE(iwifiNanIface, enableRequest_1_6, inputCmdId, + nanEnableRequest, nanConfigRequestSupp); + if (halStatus.code != WifiStatusCode::ERROR_NOT_SUPPORTED) { + ASSERT_EQ(WifiStatusCode::ERROR_INVALID_ARGS, halStatus.code); + } +} + +/* + * configRequest_1_6InvalidArgs: validate that fails with invalid arguments + */ +TEST_P(WifiNanIfaceHidlTest, configRequest_1_6InvalidArgs) { + uint16_t inputCmdId = 10; + callbackType = INVALID; + ::android::hardware::wifi::V1_4::NanConfigRequest nanConfigRequest = {}; + ::android::hardware::wifi::V1_6::NanConfigRequestSupplemental nanConfigRequestSupp = {}; + const auto& halStatus = HIDL_INVOKE(iwifiNanIface, configRequest_1_6, inputCmdId, + nanConfigRequest, nanConfigRequestSupp); + + if (halStatus.code != WifiStatusCode::ERROR_NOT_SUPPORTED) { + ASSERT_EQ(WifiStatusCode::SUCCESS, halStatus.code); + + // wait for a callback + ASSERT_EQ(std::cv_status::no_timeout, wait(NOTIFY_CONFIG_RESPONSE)); + ASSERT_EQ(NOTIFY_CONFIG_RESPONSE, callbackType); + ASSERT_EQ(id, inputCmdId); + ASSERT_EQ(status.status, NanStatusType::INVALID_ARGS); + } +} + +/* + * configRequest_1_6ShimInvalidArgs: validate that fails with invalid arguments + * to the shim + */ +TEST_P(WifiNanIfaceHidlTest, configRequest_1_6ShimInvalidArgs) { + uint16_t inputCmdId = 10; + ::android::hardware::wifi::V1_4::NanConfigRequest nanConfigRequest = {}; + nanConfigRequest.numberOfPublishServiceIdsInBeacon = 128; // must be <= 127 + ::android::hardware::wifi::V1_6::NanConfigRequestSupplemental nanConfigRequestSupp = {}; + const auto& halStatus = HIDL_INVOKE(iwifiNanIface, configRequest_1_6, inputCmdId, + nanConfigRequest, nanConfigRequestSupp); + if (halStatus.code != WifiStatusCode::ERROR_NOT_SUPPORTED) { + ASSERT_EQ(WifiStatusCode::ERROR_INVALID_ARGS, halStatus.code); + } +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiNanIfaceHidlTest); +INSTANTIATE_TEST_SUITE_P(PerInstance, WifiNanIfaceHidlTest, + testing::ValuesIn(android::hardware::getAllHalInstanceNames( + ::android::hardware::wifi::V1_6::IWifi::descriptor)), + android::hardware::PrintInstanceNameToString); diff --git a/wifi/1.6/vts/functional/wifi_rtt_controller_hidl_test.cpp b/wifi/1.6/vts/functional/wifi_rtt_controller_hidl_test.cpp new file mode 100644 index 0000000000..5b5e62364a --- /dev/null +++ b/wifi/1.6/vts/functional/wifi_rtt_controller_hidl_test.cpp @@ -0,0 +1,295 @@ +/* + * 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. + */ + +#include +#include + +#undef NAN // NAN is defined in bionic/libc/include/math.h:38 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wifi_hidl_call_util.h" +#include "wifi_hidl_test_utils.h" + +using ::android::sp; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::wifi::V1_0::CommandId; +using ::android::hardware::wifi::V1_0::RttPeerType; +using ::android::hardware::wifi::V1_0::RttType; +using ::android::hardware::wifi::V1_0::WifiStatus; +using ::android::hardware::wifi::V1_0::WifiStatusCode; +using ::android::hardware::wifi::V1_6::IWifiChip; +using ::android::hardware::wifi::V1_6::IWifiRttController; +using ::android::hardware::wifi::V1_6::IWifiRttControllerEventCallback; +using ::android::hardware::wifi::V1_6::IWifiStaIface; +using ::android::hardware::wifi::V1_6::RttBw; +using ::android::hardware::wifi::V1_6::RttCapabilities; +using ::android::hardware::wifi::V1_6::RttConfig; +using ::android::hardware::wifi::V1_6::RttPreamble; +using ::android::hardware::wifi::V1_6::RttResponder; +using ::android::hardware::wifi::V1_6::RttResult; +using ::android::hardware::wifi::V1_6::WifiChannelInfo; +using ::android::hardware::wifi::V1_6::WifiChannelWidthInMhz; + +/** + * Fixture to use for all RTT controller HIDL interface tests. + */ +class WifiRttControllerHidlTest : public ::testing::TestWithParam { + public: + virtual void SetUp() override { + if (!::testing::deviceSupportsFeature("android.hardware.wifi.rtt")) + GTEST_SKIP() << "Skipping this test since RTT is not supported."; + // Make sure to start with a clean state + stopWifi(GetInstanceName()); + + wifi_rtt_controller_ = getWifiRttController(); + ASSERT_NE(nullptr, wifi_rtt_controller_.get()); + + // Check RTT support before we run the test. + std::pair status_and_caps; + status_and_caps = HIDL_INVOKE(wifi_rtt_controller_, getCapabilities_1_6); + if (status_and_caps.first.code == WifiStatusCode::ERROR_NOT_SUPPORTED) { + GTEST_SKIP() << "Skipping this test since RTT is not supported."; + } + } + + virtual void TearDown() override { stopWifi(GetInstanceName()); } + + // A simple test implementation of WifiRttControllerEventCallback. + class WifiRttControllerEventCallback + : public ::testing::VtsHalHidlTargetCallbackBase, + public IWifiRttControllerEventCallback { + public: + WifiRttControllerEventCallback(){}; + + virtual ~WifiRttControllerEventCallback() = default; + + Return onResults(CommandId cmdId __unused, + const hidl_vec<::android::hardware::wifi::V1_0::RttResult>& results + __unused) { + return Void(); + }; + + Return onResults_1_4( + CommandId cmdId __unused, + const hidl_vec<::android::hardware::wifi::V1_4::RttResult>& results __unused) { + return Void(); + }; + + Return onResults_1_6(CommandId cmdId __unused, + const hidl_vec& results __unused) { + return Void(); + }; + }; + + protected: + sp wifi_rtt_controller_; + + private: + std::string GetInstanceName() { return GetParam(); } + + sp getWifiRttController() { + const std::string& instance_name = GetInstanceName(); + + sp wifi_chip = IWifiChip::castFrom(getWifiChip(instance_name)); + EXPECT_NE(nullptr, wifi_chip.get()); + + sp wifi_sta_iface = IWifiStaIface::castFrom(getWifiStaIface(instance_name)); + EXPECT_NE(nullptr, wifi_sta_iface.get()); + + const auto& status_and_controller = + HIDL_INVOKE(wifi_chip, createRttController_1_6, wifi_sta_iface); + EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_controller.first.code); + EXPECT_NE(nullptr, status_and_controller.second.get()); + + return status_and_controller.second.get(); + } +}; + +/* + * registerEventCallback_1_6 + * This test case tests the registerEventCallback_1_6() API which registers + * a call back function with the hal implementation + * + * Note: it is not feasible to test the invocation of the call back function + * since event is triggered internally in the HAL implementation, and can not be + * triggered from the test case + */ +TEST_P(WifiRttControllerHidlTest, RegisterEventCallback_1_6) { + sp wifiRttControllerEventCallback = + new WifiRttControllerEventCallback(); + const auto& status = HIDL_INVOKE(wifi_rtt_controller_, registerEventCallback_1_6, + wifiRttControllerEventCallback); + EXPECT_EQ(WifiStatusCode::SUCCESS, status.code); +} + +/* + * Request2SidedRangeMeasurement + * This test case tests the two sided ranging - 802.11mc FTM protocol. + */ +TEST_P(WifiRttControllerHidlTest, Request2SidedRangeMeasurement) { + std::pair status_and_caps; + + // Get the Capabilities + status_and_caps = HIDL_INVOKE(wifi_rtt_controller_, getCapabilities_1_6); + EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code); + if (!status_and_caps.second.rttFtmSupported) { + GTEST_SKIP() << "Skipping two sided RTT since driver/fw doesn't support"; + } + std::vector configs; + RttConfig config; + int cmdId = 55; + // Set the config with test data + for (int i = 0; i < 6; i++) { + config.addr[i] = i; + } + config.type = RttType::TWO_SIDED; + config.peer = RttPeerType::AP; + config.channel.width = WifiChannelWidthInMhz::WIDTH_80; + config.channel.centerFreq = 5180; + config.channel.centerFreq0 = 5210; + config.channel.centerFreq1 = 0; + config.bw = RttBw::BW_20MHZ; + config.preamble = RttPreamble::HT; + config.mustRequestLci = false; + config.mustRequestLcr = false; + config.burstPeriod = 0; + config.numBurst = 0; + config.numFramesPerBurst = 8; + config.numRetriesPerRttFrame = 0; + config.numRetriesPerFtmr = 0; + config.burstDuration = 9; + // Insert config in the vector + configs.push_back(config); + + // Invoke the call + const auto& status = HIDL_INVOKE(wifi_rtt_controller_, rangeRequest_1_6, cmdId, configs); + EXPECT_EQ(WifiStatusCode::SUCCESS, status.code); + // sleep for 2 seconds to wait for driver/firmware to complete RTT + sleep(2); +} + +/* + * rangeRequest_1_6 + */ +TEST_P(WifiRttControllerHidlTest, RangeRequest_1_6) { + std::pair status_and_caps; + + // Get the Capabilities + status_and_caps = HIDL_INVOKE(wifi_rtt_controller_, getCapabilities_1_6); + EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code); + if (!status_and_caps.second.rttOneSidedSupported) { + GTEST_SKIP() << "Skipping one sided RTT since driver/fw doesn't support"; + } + // Get the highest support preamble + int preamble = 1; + status_and_caps.second.preambleSupport >>= 1; + while (status_and_caps.second.preambleSupport != 0) { + status_and_caps.second.preambleSupport >>= 1; + preamble <<= 1; + } + std::vector configs; + RttConfig config; + int cmdId = 55; + // Set the config with test data + for (int i = 0; i < 6; i++) { + config.addr[i] = i; + } + config.type = RttType::ONE_SIDED; + config.peer = RttPeerType::AP; + config.channel.width = WifiChannelWidthInMhz::WIDTH_80; + config.channel.centerFreq = 5765; + config.channel.centerFreq0 = 5775; + config.channel.centerFreq1 = 0; + config.bw = RttBw::BW_80MHZ; + config.preamble = (RttPreamble)preamble; + config.mustRequestLci = false; + config.mustRequestLcr = false; + config.burstPeriod = 0; + config.numBurst = 0; + config.numFramesPerBurst = 8; + config.numRetriesPerRttFrame = 3; + config.numRetriesPerFtmr = 3; + config.burstDuration = 9; + // Insert config in the vector + configs.push_back(config); + + // Invoke the call + const auto& status = HIDL_INVOKE(wifi_rtt_controller_, rangeRequest_1_6, cmdId, configs); + EXPECT_EQ(WifiStatusCode::SUCCESS, status.code); + // sleep for 2 seconds to wait for driver/firmware to complete RTT + sleep(2); +} + +/* + * getCapabilities_1_6 + */ +TEST_P(WifiRttControllerHidlTest, GetCapabilities_1_6) { + std::pair status_and_caps; + + // Invoke the call + status_and_caps = HIDL_INVOKE(wifi_rtt_controller_, getCapabilities_1_6); + EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code); +} + +/* + * getResponderInfo_1_6 + */ +TEST_P(WifiRttControllerHidlTest, GetResponderInfo_1_6) { + std::pair status_and_info; + + // Invoke the call + status_and_info = HIDL_INVOKE(wifi_rtt_controller_, getResponderInfo_1_6); + EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_info.first.code); +} + +/* + * enableResponder_1_6 + */ +TEST_P(WifiRttControllerHidlTest, EnableResponder_1_6) { + std::pair status_and_info; + int cmdId = 55; + WifiChannelInfo channelInfo; + channelInfo.width = WifiChannelWidthInMhz::WIDTH_80; + channelInfo.centerFreq = 5660; + channelInfo.centerFreq0 = 5660; + channelInfo.centerFreq1 = 0; + + // Get the responder first + status_and_info = HIDL_INVOKE(wifi_rtt_controller_, getResponderInfo_1_6); + EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_info.first.code); + + // Invoke the call + const auto& status = HIDL_INVOKE(wifi_rtt_controller_, enableResponder_1_6, cmdId, channelInfo, + 10, status_and_info.second); + EXPECT_EQ(WifiStatusCode::SUCCESS, status.code); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiRttControllerHidlTest); +INSTANTIATE_TEST_SUITE_P(PerInstance, WifiRttControllerHidlTest, + testing::ValuesIn(android::hardware::getAllHalInstanceNames( + ::android::hardware::wifi::V1_6::IWifi::descriptor)), + android::hardware::PrintInstanceNameToString); diff --git a/wifi/1.6/vts/functional/wifi_sta_iface_hidl_test.cpp b/wifi/1.6/vts/functional/wifi_sta_iface_hidl_test.cpp new file mode 100644 index 0000000000..4a6fd27200 --- /dev/null +++ b/wifi/1.6/vts/functional/wifi_sta_iface_hidl_test.cpp @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Staache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include "wifi_hidl_call_util.h" +#include "wifi_hidl_test_utils.h" + +using ::android::sp; +using ::android::hardware::hidl_array; +using ::android::hardware::wifi::V1_0::WifiStatus; +using ::android::hardware::wifi::V1_0::WifiStatusCode; +using ::android::hardware::wifi::V1_6::IWifiChip; +using ::android::hardware::wifi::V1_6::IWifiStaIface; + +/** + * Fixture to use for all STA Iface HIDL interface tests. + */ +class WifiStaIfaceHidlTest : public ::testing::TestWithParam { + public: + virtual void SetUp() override { + // Make sure to start with a clean state + stopWifi(GetInstanceName()); + + wifi_sta_iface_ = IWifiStaIface::castFrom(getWifiStaIface(GetInstanceName())); + ASSERT_NE(nullptr, wifi_sta_iface_.get()); + } + + virtual void TearDown() override { stopWifi(GetInstanceName()); } + + protected: + bool isCapabilitySupported(IWifiStaIface::StaIfaceCapabilityMask cap_mask) { + const auto& status_and_caps = HIDL_INVOKE(wifi_sta_iface_, getCapabilities); + EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code); + return (status_and_caps.second & cap_mask) != 0; + } + + WifiStatusCode createStaIface(sp* sta_iface) { + sp wifi_chip = IWifiChip::castFrom(getWifiChip(GetInstanceName())); + EXPECT_NE(nullptr, wifi_chip.get()); + const auto& status_and_iface = HIDL_INVOKE(wifi_chip, createStaIface); + *sta_iface = IWifiStaIface::castFrom(status_and_iface.second); + return status_and_iface.first.code; + } + + sp wifi_sta_iface_; + + private: + std::string GetInstanceName() { return GetParam(); } +}; + +/* + * GetLinkLayerStats_1_6 + * Ensures that calls to get link layer stats V1_6 will retrieve a non-empty + * StaLinkLayerStats after link layer stats collection is enabled. + */ +TEST_P(WifiStaIfaceHidlTest, GetLinkLayerStats_1_6) { + if (!isCapabilitySupported(IWifiStaIface::StaIfaceCapabilityMask::LINK_LAYER_STATS)) { + GTEST_SKIP() << "Skipping this test since link layer stats are not supported."; + } + + // Enable link layer stats collection. + EXPECT_EQ(WifiStatusCode::SUCCESS, + HIDL_INVOKE(wifi_sta_iface_, enableLinkLayerStatsCollection, true).code); + // Retrieve link layer stats. + const auto& status_and_stats = HIDL_INVOKE(wifi_sta_iface_, getLinkLayerStats_1_6); + EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_stats.first.code); + EXPECT_GT(status_and_stats.second.timeStampInMs, 0u); + // Try to create 2nd iface. If yes, it should fill in the duty cycle field. + sp iface; + auto status = createStaIface(&iface); + if (status == WifiStatusCode::SUCCESS) { + EXPECT_GT(status_and_stats.second.iface.timeSliceDutyCycleInPercent, 0u); + } + // Disable link layer stats collection. + EXPECT_EQ(WifiStatusCode::SUCCESS, + HIDL_INVOKE(wifi_sta_iface_, disableLinkLayerStatsCollection).code); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiStaIfaceHidlTest); +INSTANTIATE_TEST_SUITE_P(PerInstance, WifiStaIfaceHidlTest, + testing::ValuesIn(android::hardware::getAllHalInstanceNames( + ::android::hardware::wifi::V1_6::IWifi::descriptor)), + android::hardware::PrintInstanceNameToString); -- GitLab From 832cfea94c90d712448c5015d2d71ede60a444c7 Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Wed, 16 Feb 2022 01:46:24 +0000 Subject: [PATCH 633/825] Create callback to call on auxiliary supplicant events, namely EAP_METHOD_SELECTED, SSID_TEMP_DISABLED, and OPEN_SSL_FAILURE. Bug: 165342942 Test: m Change-Id: I28ccd513bba937041ae8be1c5eff1fa6cb491c97 --- .../AuxiliarySupplicantEventCode.aidl | 40 +++++++++++++++++++ .../ISupplicantStaIfaceCallback.aidl | 1 + .../AuxiliarySupplicantEventCode.aidl | 31 ++++++++++++++ .../ISupplicantStaIfaceCallback.aidl | 11 +++++ .../supplicant_sta_iface_aidl_test.cpp | 7 ++++ 5 files changed, 90 insertions(+) create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl 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 new file mode 100644 index 0000000000..471cfff906 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.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 -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 AuxiliarySupplicantEventCode { + EAP_METHOD_SELECTED = 0, + SSID_TEMP_DISABLED = 1, + OPEN_SSL_FAILURE = 2, +} 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 8d11d414dc..b36cd84fc9 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 @@ -37,6 +37,7 @@ interface ISupplicantStaIfaceCallback { oneway void onAnqpQueryDone(in byte[] bssid, in android.hardware.wifi.supplicant.AnqpData data, in android.hardware.wifi.supplicant.Hs20AnqpData hs20Data); oneway void onAssociationRejected(in android.hardware.wifi.supplicant.AssociationRejectionData assocRejectData); oneway void onAuthenticationTimeout(in byte[] bssid); + oneway void onAuxiliarySupplicantEvent(in android.hardware.wifi.supplicant.AuxiliarySupplicantEventCode eventCode, in byte[] bssid, in String reasonString); oneway void onBssTmHandlingDone(in android.hardware.wifi.supplicant.BssTmData tmData); oneway void onBssidChanged(in android.hardware.wifi.supplicant.BssidChangeReason reason, in byte[] bssid); oneway void onDisconnected(in byte[] bssid, in boolean locallyGenerated, in android.hardware.wifi.supplicant.StaIfaceReasonCode reasonCode); diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl new file mode 100644 index 0000000000..c0035c4bed --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * Event codes for auxiliary events that can be generated by + * the supplicant. This includes events that are not major + * state changes (e.g. Connected, Disconnected), but that the + * client may still want to be alerted about. + */ +@VintfStability +@Backing(type="int") +enum AuxiliarySupplicantEventCode { + EAP_METHOD_SELECTED, + SSID_TEMP_DISABLED, + OPEN_SSL_FAILURE +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index ade68f0fe2..5479441052 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -18,6 +18,7 @@ package android.hardware.wifi.supplicant; import android.hardware.wifi.supplicant.AnqpData; import android.hardware.wifi.supplicant.AssociationRejectionData; +import android.hardware.wifi.supplicant.AuxiliarySupplicantEventCode; import android.hardware.wifi.supplicant.BssTmData; import android.hardware.wifi.supplicant.BssidChangeReason; import android.hardware.wifi.supplicant.DppAkm; @@ -70,6 +71,16 @@ oneway interface ISupplicantStaIfaceCallback { */ void onAuthenticationTimeout(in byte[] bssid); + /** + * Indicates that an auxiliary event was generated by the supplicant. + * + * @param eventCode |AuxiliarySupplicantEventCode| for the event that occurred. + * @param bssid BSSID of the AP which caused the event. + * @param reasonString Additional information about why the event occurred. + */ + void onAuxiliarySupplicantEvent( + in AuxiliarySupplicantEventCode eventCode, in byte[] bssid, in String reasonString); + /** * Indicates BTM request frame handling status. * 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 fdafe08704..d991e39081 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 @@ -79,6 +79,13 @@ class SupplicantStaIfaceCallback : public BnSupplicantStaIfaceCallback { const std::vector& /* bssid */) override { return ndk::ScopedAStatus::ok(); } + ::ndk::ScopedAStatus onAuxiliarySupplicantEvent( + ::aidl::android::hardware::wifi::supplicant :: + AuxiliarySupplicantEventCode /* eventCode */, + const std::vector& /* bssid */, + const std::string& /* reasonString */) override { + return ndk::ScopedAStatus::ok(); + } ::ndk::ScopedAStatus onBssTmHandlingDone( const ::aidl::android::hardware::wifi::supplicant:: BssTmData& /* tmData */) override { -- GitLab From 1cfe08149119dd43625a10753f250c7c57db4568 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 16 Feb 2022 18:31:37 +0800 Subject: [PATCH 634/825] wifi: fix NULL pointer in unit tests getSupportedIfaceName() should be mocked to avoid NULL pointer exception. Bug: 217267980 Test: atest android.hardware.wifi@1.0-service-tests Change-Id: I97a9cb8430ea77a6fe068f20586ab27df9291400 --- wifi/1.6/default/tests/mock_wifi_legacy_hal.h | 4 ++++ wifi/1.6/default/tests/wifi_chip_unit_tests.cpp | 3 +++ wifi/1.6/default/wifi_legacy_hal.h | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/wifi/1.6/default/tests/mock_wifi_legacy_hal.h b/wifi/1.6/default/tests/mock_wifi_legacy_hal.h index b1f53273ba..85dbf0fe49 100644 --- a/wifi/1.6/default/tests/mock_wifi_legacy_hal.h +++ b/wifi/1.6/default/tests/mock_wifi_legacy_hal.h @@ -56,6 +56,10 @@ class MockWifiLegacyHal : public WifiLegacyHal { wifi_error(const std::string& ifname, wifi_interface_type iftype)); MOCK_METHOD1(deleteVirtualInterface, wifi_error(const std::string& ifname)); MOCK_METHOD0(waitForDriverReady, wifi_error()); + MOCK_METHOD2(getSupportedIfaceName, wifi_error(uint32_t, std::string&)); + MOCK_METHOD1(registerSubsystemRestartCallbackHandler, + wifi_error(const on_subsystem_restart_callback&)); + MOCK_METHOD1(getSupportedFeatureSet, std::pair(const std::string&)); }; } // namespace legacy_hal } // namespace implementation diff --git a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp index 48c006519f..eaab211219 100644 --- a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp +++ b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp @@ -278,6 +278,9 @@ class WifiChipTest : public Test { .WillRepeatedly(testing::Return(true)); EXPECT_CALL(*legacy_hal_, start()) .WillRepeatedly(testing::Return(legacy_hal::WIFI_SUCCESS)); + // Vendor HAL does not override the name by default. + EXPECT_CALL(*legacy_hal_, getSupportedIfaceName(testing::_, testing::_)) + .WillRepeatedly(testing::Return(legacy_hal::WIFI_ERROR_UNKNOWN)); } void TearDown() override { diff --git a/wifi/1.6/default/wifi_legacy_hal.h b/wifi/1.6/default/wifi_legacy_hal.h index ab21e8e31f..6f42f70359 100644 --- a/wifi/1.6/default/wifi_legacy_hal.h +++ b/wifi/1.6/default/wifi_legacy_hal.h @@ -496,7 +496,7 @@ class WifiLegacyHal { const std::string& iface_name); std::pair> requestFirmwareMemoryDump( const std::string& iface_name); - std::pair getSupportedFeatureSet(const std::string& iface_name); + virtual std::pair getSupportedFeatureSet(const std::string& iface_name); // APF functions. std::pair getPacketFilterCapabilities( const std::string& iface_name); @@ -564,7 +564,7 @@ class WifiLegacyHal { wifi_error registerRingBufferCallbackHandler( const std::string& iface_name, const on_ring_buffer_data_callback& on_data_callback); wifi_error deregisterRingBufferCallbackHandler(const std::string& iface_name); - wifi_error registerSubsystemRestartCallbackHandler( + virtual wifi_error registerSubsystemRestartCallbackHandler( const on_subsystem_restart_callback& on_restart_callback); std::pair> getRingBuffersStatus( const std::string& iface_name); @@ -637,7 +637,7 @@ class WifiLegacyHal { virtual wifi_error createVirtualInterface(const std::string& ifname, wifi_interface_type iftype); virtual wifi_error deleteVirtualInterface(const std::string& ifname); - wifi_error getSupportedIfaceName(uint32_t iface_type, std::string& ifname); + virtual wifi_error getSupportedIfaceName(uint32_t iface_type, std::string& ifname); // STA + STA functions virtual wifi_error multiStaSetPrimaryConnection(const std::string& ifname); -- GitLab From c2fb31847191cbdc47a7d2861a23b237c7dc8f88 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Mon, 14 Feb 2022 14:20:14 -0800 Subject: [PATCH 635/825] Change TOC and TOE to long Change TOC and TOE definition to 1. long 2. time in seconds since GPS epoch, regardless of constellation 3. must not be encoded 4. rename to timeOfClockSeconds and timeOfEphemerisSeconds Bug: 219575003 Test: on device Change-Id: Icb75a3397d3bf41c91e2a19bbec8a95a97100a07 (cherry picked from commit f20e55cf4654662b8ab730bca3ded1c3e26c55c1) --- .../android/hardware/gnss/SatellitePvt.aidl | 8 +++---- .../android/hardware/gnss/SatellitePvt.aidl | 22 ++++++++++--------- gnss/aidl/vts/gnss_hal_test_cases.cpp | 9 ++++---- gnss/common/utils/default/Utils.cpp | 8 +++---- 4 files changed, 25 insertions(+), 22 deletions(-) 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 21a2520b4e..dc875fae8b 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 @@ -40,10 +40,10 @@ parcelable SatellitePvt { android.hardware.gnss.SatelliteClockInfo satClockInfo; double ionoDelayMeters; double tropoDelayMeters; - int TOC; - int IODC; - int TOE; - int IODE; + long timeOfClockSeconds; + int issueOfDataClock; + 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; diff --git a/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl b/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl index e79249df63..d9f767ab05 100644 --- a/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl +++ b/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl @@ -76,12 +76,13 @@ parcelable SatellitePvt { double tropoDelayMeters; /** - * Time of Clock. + * Time of Clock in seconds. * - * This is defined in GPS ICD200 documentation - * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf). + * This value is defined in seconds since GPS epoch, regardless of the constellation. + * + * The value must not be encoded as in GPS ICD200 documentation. */ - int TOC; + long timeOfClockSeconds; /** * Issue of Data, Clock. @@ -91,15 +92,16 @@ parcelable SatellitePvt { * * The field must be set to 0 if it is not supported. */ - int IODC; + int issueOfDataClock; /** - * Time of Ephemeris. + * Time of Ephemeris in seconds. * - * This is defined in GPS ICD200 documentation - * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf). + * This value is defined in seconds since GPS epoch, regardless of the constellation. + * + * The value must not be encoded as in GPS ICD200 documentation. */ - int TOE; + long timeOfEphemerisSeconds; /** * Issue of Data, Ephemeris. @@ -109,7 +111,7 @@ parcelable SatellitePvt { * * The field must be set to 0 if it is not supported. */ - int IODE; + int issueOfDataEphemeris; /** Satellite's ephemeris source */ @VintfStability diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 365f9d355e..54946fb64f 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -366,12 +366,13 @@ void CheckSatellitePvt(const SatellitePvt& satellitePvt, const int interfaceVers ASSERT_TRUE(satellitePvt.tropoDelayMeters > 0 && satellitePvt.tropoDelayMeters < 100); } if (interfaceVersion >= 2) { - ASSERT_TRUE(satellitePvt.TOC >= 0 && satellitePvt.TOC <= 604784); - ASSERT_TRUE(satellitePvt.TOE >= 0 && satellitePvt.TOE <= 604784); + ASSERT_TRUE(satellitePvt.timeOfClockSeconds >= 0); + ASSERT_TRUE(satellitePvt.timeOfEphemerisSeconds >= 0); // IODC has 10 bits - ASSERT_TRUE(satellitePvt.IODC >= 0 && satellitePvt.IODC <= 1023); + ASSERT_TRUE(satellitePvt.issueOfDataClock >= 0 && satellitePvt.issueOfDataClock <= 1023); // IODE has 8 bits - ASSERT_TRUE(satellitePvt.IODE >= 0 && satellitePvt.IODE <= 255); + ASSERT_TRUE(satellitePvt.issueOfDataEphemeris >= 0 && + satellitePvt.issueOfDataEphemeris <= 255); } } diff --git a/gnss/common/utils/default/Utils.cpp b/gnss/common/utils/default/Utils.cpp index a519d3acfb..4de49f376c 100644 --- a/gnss/common/utils/default/Utils.cpp +++ b/gnss/common/utils/default/Utils.cpp @@ -201,10 +201,10 @@ GnssData Utils::getMockMeasurement(const bool enableCorrVecOutputs) { .tropoDelayMeters = 3.882265204404031, .ephemerisSource = SatellitePvt::SatelliteEphemerisSource::SERVER_LONG_TERM, - .TOC = 12345, - .IODC = 143, - .TOE = 9876, - .IODE = 48, + .timeOfClockSeconds = 12345, + .issueOfDataClock = 143, + .timeOfEphemerisSeconds = 9876, + .issueOfDataEphemeris = 48, }, .correlationVectors = {}}; -- GitLab From 12030279996c7a9a02ee2f3372127b94f70241b2 Mon Sep 17 00:00:00 2001 From: Robert Shih Date: Mon, 14 Feb 2022 16:08:06 -0800 Subject: [PATCH 636/825] aidl drm: independent min/max SecurityLevel for each supported mime Bug: 219528925 Test: atest MediaDrmTest.testIsCryptoSchemeSupportedForSecurityLevels Change-Id: I9dcd786fe921c6ed4ac49bba5a6dddf887404df3 Merged-In: I9dcd786fe921c6ed4ac49bba5a6dddf887404df3 --- .../android/hardware/drm/CryptoSchemes.aidl | 4 +- .../hardware/drm/SupportedContentType.aidl | 40 +++++++++++++++++++ .../android/hardware/drm/CryptoSchemes.aidl | 16 ++------ .../hardware/drm/SupportedContentType.aidl | 31 ++++++++++++++ drm/aidl/vts/drm_hal_common.cpp | 23 ++++++----- drm/aidl/vts/drm_hal_test.cpp | 13 ++++++ drm/aidl/vts/include/drm_hal_common.h | 3 ++ 7 files changed, 105 insertions(+), 25 deletions(-) create mode 100644 drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SupportedContentType.aidl create mode 100644 drm/aidl/android/hardware/drm/SupportedContentType.aidl diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/CryptoSchemes.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/CryptoSchemes.aidl index ea736cf373..1d3c293eca 100644 --- a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/CryptoSchemes.aidl +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/CryptoSchemes.aidl @@ -35,7 +35,5 @@ package android.hardware.drm; @VintfStability parcelable CryptoSchemes { List uuids; - android.hardware.drm.SecurityLevel minLevel; - android.hardware.drm.SecurityLevel maxLevel; - List mimeTypes; + List mimeTypes; } diff --git a/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SupportedContentType.aidl b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SupportedContentType.aidl new file mode 100644 index 0000000000..6ef5db860a --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/current/android/hardware/drm/SupportedContentType.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 -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.drm; +@VintfStability +parcelable SupportedContentType { + String mime; + android.hardware.drm.SecurityLevel minLevel; + android.hardware.drm.SecurityLevel maxLevel; +} diff --git a/drm/aidl/android/hardware/drm/CryptoSchemes.aidl b/drm/aidl/android/hardware/drm/CryptoSchemes.aidl index b4b34ec17e..1f251d8a75 100644 --- a/drm/aidl/android/hardware/drm/CryptoSchemes.aidl +++ b/drm/aidl/android/hardware/drm/CryptoSchemes.aidl @@ -16,7 +16,7 @@ package android.hardware.drm; -import android.hardware.drm.SecurityLevel; +import android.hardware.drm.SupportedContentType; import android.hardware.drm.Uuid; @VintfStability @@ -28,18 +28,8 @@ parcelable CryptoSchemes { List uuids; /** - * Minimum supported security level (inclusive) + * Supported mime types, and supported SecurityLevels for each mime */ - SecurityLevel minLevel; - - /** - * Maximum supported security level (inclusive) - */ - SecurityLevel maxLevel; - - /** - * Supported mime types - */ - List mimeTypes; + List mimeTypes; } diff --git a/drm/aidl/android/hardware/drm/SupportedContentType.aidl b/drm/aidl/android/hardware/drm/SupportedContentType.aidl new file mode 100644 index 0000000000..f4fabad554 --- /dev/null +++ b/drm/aidl/android/hardware/drm/SupportedContentType.aidl @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.drm; + +import android.hardware.drm.SecurityLevel; + +@VintfStability +parcelable SupportedContentType { + /** Supported mime type. E.g. cenc, video/mp4, etc */ + String mime; + + /** Minimum supported security level (inclusive) */ + SecurityLevel minLevel; + + /** Maximum supported security level (inclusive) */ + SecurityLevel maxLevel; +} diff --git a/drm/aidl/vts/drm_hal_common.cpp b/drm/aidl/vts/drm_hal_common.cpp index 9b315f4f55..de7dc288ec 100644 --- a/drm/aidl/vts/drm_hal_common.cpp +++ b/drm/aidl/vts/drm_hal_common.cpp @@ -256,7 +256,7 @@ std::vector DrmHalTest::getUUID() { std::vector DrmHalTest::getVendorUUID() { if (vendorModule == nullptr) { ALOGW("vendor module for %s not found", GetParamService().c_str()); - return {}; + return std::vector(16); } return vendorModule->getUUID(); } @@ -268,17 +268,22 @@ bool DrmHalTest::isCryptoSchemeSupported(Uuid uuid, SecurityLevel level, std::st if (!ret.isOk() || !std::count(schemes.uuids.begin(), schemes.uuids.end(), uuid)) { return false; } - if (level > schemes.maxLevel || level < schemes.minLevel) { - if (level != SecurityLevel::DEFAULT && level != SecurityLevel::UNKNOWN) { - return false; - } + if (mime.empty()) { + EXPECT_THAT(level, AnyOf(Eq(SecurityLevel::DEFAULT), Eq(SecurityLevel::UNKNOWN))); + return true; } - if (!mime.empty()) { - if (!std::count(schemes.mimeTypes.begin(), schemes.mimeTypes.end(), mime)) { - return false; + for (auto ct : schemes.mimeTypes) { + if (ct.mime != mime) { + continue; + } + if (level == SecurityLevel::DEFAULT || level == SecurityLevel::UNKNOWN) { + return true; + } + if (level <= ct.maxLevel && level >= ct.minLevel) { + return true; } } - return true; + return false; } void DrmHalTest::provision() { diff --git a/drm/aidl/vts/drm_hal_test.cpp b/drm/aidl/vts/drm_hal_test.cpp index 266ea395e2..14b3acfc7f 100644 --- a/drm/aidl/vts/drm_hal_test.cpp +++ b/drm/aidl/vts/drm_hal_test.cpp @@ -99,6 +99,19 @@ TEST_P(DrmHalTest, BadMimeNotSupported) { EXPECT_FALSE(result); } +/** + * getSupportedCryptoSchemes confidence check + */ +TEST_P(DrmHalTest, SupportedCryptoSchemes) { + aidl::android::hardware::drm::CryptoSchemes schemes{}; + auto result = drmFactory->getSupportedCryptoSchemes(&schemes); + EXPECT_FALSE(schemes.uuids.empty()); + for(auto ct : schemes.mimeTypes) { + EXPECT_LE(ct.minLevel, ct.maxLevel); + } + EXPECT_OK(result); +} + /** * DrmPlugin tests */ diff --git a/drm/aidl/vts/include/drm_hal_common.h b/drm/aidl/vts/include/drm_hal_common.h index 2c7e514291..d493bed05a 100644 --- a/drm/aidl/vts/include/drm_hal_common.h +++ b/drm/aidl/vts/include/drm_hal_common.h @@ -59,6 +59,9 @@ namespace hardware { namespace drm { namespace vts { +using ::testing::AnyOf; +using ::testing::Eq; + ::aidl::android::hardware::drm::Status DrmErr(const ::ndk::ScopedAStatus& ret); std::string HalBaseName(const std::string& fullname); std::string HalFullName(const std::string& iface, const std::string& basename); -- GitLab From 89d7270dcd13d6ef05c8f7f5cc4cc1660825410a Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Fri, 18 Feb 2022 17:04:55 -0800 Subject: [PATCH 637/825] composer: remove IComposer.dumpDebugInfo aidl already have a dump funciton, so there is no need to expose a custom dumpDebugInfo from IComposer. Bug: 220171623 Test: atest VtsHalGraphicsComposer3_TargetTest Test: adb shell dumpsys SurfaceFlinger Test: adb shell dumpsys android.hardware.graphics.composer3.IComposer/default Change-Id: I5036193c06ba9fdd8aa5f79cd756541d9edc146c --- .../hardware/graphics/composer3/IComposer.aidl | 1 - .../hardware/graphics/composer3/IComposer.aidl | 8 -------- .../vts/functional/composer-vts/VtsComposerClient.cpp | 11 +++++++++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposer.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposer.aidl index 9abc6083e2..21b9ad88cd 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposer.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposer.aidl @@ -35,7 +35,6 @@ package android.hardware.graphics.composer3; @VintfStability interface IComposer { android.hardware.graphics.composer3.IComposerClient createClient(); - String dumpDebugInfo(); android.hardware.graphics.composer3.Capability[] getCapabilities(); const int EX_NO_RESOURCES = 6; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl index b8edd8071d..0ebc2b7c0c 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl @@ -35,14 +35,6 @@ interface IComposer { */ IComposerClient createClient(); - /** - * Retrieves implementation-defined debug information, which will be - * displayed during, for example, `dumpsys SurfaceFlinger`. - * - * @return is a string of debug information. - */ - String dumpDebugInfo(); - /** * Provides a list of supported capabilities (as described in the * definition of Capability above). This list must not change after diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp index b3b10d0092..468a69ddf4 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp @@ -173,8 +173,15 @@ std::pair> VtsComposerClient::getD } ScopedAStatus VtsComposerClient::dumpDebugInfo() { - std::string debugInfo; - return mComposer->dumpDebugInfo(&debugInfo); + int pipefds[2]; + if (pipe(pipefds) < 0) { + return ScopedAStatus::fromServiceSpecificError(IComposer::EX_NO_RESOURCES); + } + + const auto status = mComposer->dump(pipefds[1], /*args*/ nullptr, /*numArgs*/ 0); + close(pipefds[0]); + close(pipefds[1]); + return ScopedAStatus::fromStatus(status); } std::pair VtsComposerClient::getDisplayIdentificationData( -- GitLab From 65f6167f5f4d9bb845cea25a69d86b69b257ed8e Mon Sep 17 00:00:00 2001 From: Shivani Baranwal Date: Thu, 3 Feb 2022 12:24:24 +0530 Subject: [PATCH 638/825] wifi: Add qosPolicyRequestId in definition of supplicant AIDL APIs This CL is to add param qosPolicyRequestId in the supplicant AIDL APIs needed for QoS policy feature. This param contains the dialog token information of the Qos Policies. Bug: 191426881 Test: atest VtsHalWifiSupplicantStaIfaceTargetTest Change-Id: I31f9bf6006652ac8c75cbdfba231535bfd676ecd --- .../android/hardware/wifi/supplicant/ISupplicantStaIface.aidl | 2 +- .../hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl | 2 +- .../android/hardware/wifi/supplicant/ISupplicantStaIface.aidl | 4 +++- .../hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl | 3 ++- .../aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) 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 9293bfdbff..7a29bbacd1 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 @@ -64,7 +64,7 @@ interface ISupplicantStaIface { void reconnect(); void registerCallback(in android.hardware.wifi.supplicant.ISupplicantStaIfaceCallback callback); void setQosPolicyFeatureEnabled(in boolean enable); - void sendQosPolicyResponse(in boolean morePolicies, in android.hardware.wifi.supplicant.QosPolicyStatus[] qosPolicyStatusList); + void sendQosPolicyResponse(in int qosPolicyRequestId, in boolean morePolicies, in android.hardware.wifi.supplicant.QosPolicyStatus[] qosPolicyStatusList); void removeAllQosPolicies(); void removeDppUri(in int id); void removeExtRadioWork(in int id); 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 8d11d414dc..7053c6e371 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 @@ -61,5 +61,5 @@ interface ISupplicantStaIfaceCallback { oneway void onWpsEventPbcOverlap(); oneway void onWpsEventSuccess(); oneway void onQosPolicyReset(); - oneway void onQosPolicyRequest(in android.hardware.wifi.supplicant.QosPolicyData[] qosPolicyData); + oneway void onQosPolicyRequest(in int qosPolicyRequestId, in android.hardware.wifi.supplicant.QosPolicyData[] qosPolicyData); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl index 8ab0c826f7..a96d1ebf92 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl @@ -418,6 +418,7 @@ interface ISupplicantStaIface { * sends a solicited (uses the ongoing DSCP request as dialog token) DSCP * response. Otherwise, sends an unsolicited DSCP response. * + * @param qosPolicyRequestId Dialog token to identify the request. * @param morePolicies Flag to indicate more QoS policies can be accommodated. * @param qosPolicyStatusList QoS policy status info for each QoS policy id. * @throws ServiceSpecificException with one of the following values: @@ -425,7 +426,8 @@ interface ISupplicantStaIface { * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_UNSUPPORTED| */ - void sendQosPolicyResponse(in boolean morePolicies, in QosPolicyStatus[] qosPolicyStatusList); + void sendQosPolicyResponse(in int qosPolicyRequestId, in boolean morePolicies, + in QosPolicyStatus[] qosPolicyStatusList); /** * Indicate removal of all active QoS policies configured by the AP. diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index ade68f0fe2..4e87ecff81 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -287,7 +287,8 @@ oneway interface ISupplicantStaIfaceCallback { /** * Used to indicate a DSCP request was received from the AP. * + * @param qosPolicyRequestId Dialog token to identify the request. * @param qosPolicyData QoS policies info requested by the AP. */ - void onQosPolicyRequest(in QosPolicyData[] qosPolicyData); + void onQosPolicyRequest(in int qosPolicyRequestId, in QosPolicyData[] qosPolicyData); } 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 fdafe08704..6c7a12595f 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 @@ -194,6 +194,7 @@ class SupplicantStaIfaceCallback : public BnSupplicantStaIfaceCallback { } ::ndk::ScopedAStatus onQosPolicyReset() override { return ndk::ScopedAStatus::ok(); } ::ndk::ScopedAStatus onQosPolicyRequest( + int32_t /* qosPolicyRequestId */, const std::vector<::aidl::android::hardware::wifi::supplicant :: QosPolicyData /* qosPolicyData */>&) override { return ndk::ScopedAStatus::ok(); -- GitLab From 89791a78919daacfff32aee8a2d777466353b418 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 22 Feb 2022 10:09:35 -0800 Subject: [PATCH 639/825] uwb(hal): Modify TLV value size for interleaving params Bug: 220173516 Test: Compiles Change-Id: Idf26f6d4adbbc79f4f1f260aa8b8c608f3391b98 --- .../uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl index 8547567ddf..f43b249c8f 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl @@ -60,10 +60,10 @@ enum UwbVendorSessionAppConfigTlvTypes { * Supported only if the UwbVendorCapabilityTlvTypes * .SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING set to 1. */ - /** 2 byte data */ + /** 1 byte data */ NB_OF_RANGE_MEASUREMENTS = 0xE3, - /** 2 byte data */ + /** 1 byte data */ NB_OF_AZIMUTH_MEASUREMENTS = 0xE4, - /** 2 byte data */ + /** 1 byte data */ NB_OF_ELEVATION_MEASUREMENTS = 0xE5, } -- GitLab From ce8b56cd0f12bdfa5a082f446c9e1c209f31da47 Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Tue, 22 Feb 2022 21:36:28 +0000 Subject: [PATCH 640/825] Add bssid to onEapFailure callback method. Bug: 165342942 Test: atest VtsHalWifiSupplicantStaIfaceTargetTest Change-Id: I2d2a272552d8c46eeba1ef28bdd2f8b61fb31b40 --- .../hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl | 2 +- .../hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl | 3 ++- .../aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) 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 46c8000a64..25a09b435e 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 @@ -46,7 +46,7 @@ interface ISupplicantStaIfaceCallback { oneway void onDppSuccess(in android.hardware.wifi.supplicant.DppEventType event); oneway void onDppSuccessConfigReceived(in byte[] ssid, in String password, in byte[] psk, in android.hardware.wifi.supplicant.DppAkm securityAkm, in android.hardware.wifi.supplicant.DppConnectionKeys dppConnectionKeys); oneway void onDppSuccessConfigSent(); - oneway void onEapFailure(in int errorCode); + oneway void onEapFailure(in byte[] bssid, in int errorCode); 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); diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index 895bc50436..0730a8cf54 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -154,11 +154,12 @@ oneway interface ISupplicantStaIfaceCallback { /** * Indicates an EAP authentication failure. + * @param bssid BSSID of the access point. * @param errorCode Error code for EAP authentication failure. * Either standard error code (enum EapErrorCode) or * private error code defined by network provider. */ - void onEapFailure(in int errorCode); + void onEapFailure(in byte[] bssid, in int errorCode); /** * Used to indicate that the external radio work can start now. 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 1c00ec7c46..2ed6a0e476 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 @@ -130,7 +130,8 @@ class SupplicantStaIfaceCallback : public BnSupplicantStaIfaceCallback { ::ndk::ScopedAStatus onDppSuccessConfigSent() override { return ndk::ScopedAStatus::ok(); } - ::ndk::ScopedAStatus onEapFailure(int32_t /* errorCode */) override { + ::ndk::ScopedAStatus onEapFailure(const std::vector& /* bssid */, + int32_t /* errorCode */) override { return ndk::ScopedAStatus::ok(); } ::ndk::ScopedAStatus onExtRadioWorkStart(int32_t /* id */) override { -- GitLab From cb4853941bea9fb7c44c1a27f0f20d6c7d99f450 Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Fri, 18 Feb 2022 15:25:48 -0800 Subject: [PATCH 641/825] camera: Address ANAPIC review comments and additional cleanup Bug: 218911443 Test: build Change-Id: Ia6d3f4d73e9ff29fa5fca2e11e0b9cb5a8d1e2ac Signed-off-by: Jayant Chowdhary --- .../hardware/camera/common/Status.aidl | 7 ++--- .../hardware/camera/common/Status.aidl | 16 ++++------ .../hardware/camera/device/ICameraDevice.aidl | 1 - .../hardware/camera/device/ICameraDevice.aidl | 31 ++----------------- .../metadata/CameraMetadataSectionStart.aidl | 1 - .../metadata/CameraMetadataSectionStart.aidl | 1 - .../ConcurrentCameraIdCombination.aidl | 4 +++ .../camera/provider/ICameraProvider.aidl | 3 +- 8 files changed, 17 insertions(+), 47 deletions(-) diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/Status.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/Status.aidl index e1ec1896e9..86589276e7 100644 --- a/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/Status.aidl +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/Status.aidl @@ -38,8 +38,7 @@ enum Status { ILLEGAL_ARGUMENT = 1, CAMERA_IN_USE = 2, MAX_CAMERAS_IN_USE = 3, - METHOD_NOT_SUPPORTED = 4, - OPERATION_NOT_SUPPORTED = 5, - CAMERA_DISCONNECTED = 6, - INTERNAL_ERROR = 7, + OPERATION_NOT_SUPPORTED = 4, + CAMERA_DISCONNECTED = 5, + INTERNAL_ERROR = 6, } diff --git a/camera/common/aidl/android/hardware/camera/common/Status.aidl b/camera/common/aidl/android/hardware/camera/common/Status.aidl index 1ea6ee8c16..4341d40be6 100644 --- a/camera/common/aidl/android/hardware/camera/common/Status.aidl +++ b/camera/common/aidl/android/hardware/camera/common/Status.aidl @@ -35,30 +35,26 @@ enum Status { * One of the arguments to the method call is invalid. For example, * the camera ID is unknown. */ - ILLEGAL_ARGUMENT = 1, + ILLEGAL_ARGUMENT, /** * The specified camera device is already in use */ - CAMERA_IN_USE = 2, + CAMERA_IN_USE, /** * The HAL cannot support more simultaneous cameras in use. */ - MAX_CAMERAS_IN_USE = 3, - /** - * This HAL does not support this method. - */ - METHOD_NOT_SUPPORTED = 4, + MAX_CAMERAS_IN_USE, /** * The specified camera device does not support this operation. */ - OPERATION_NOT_SUPPORTED = 5, + OPERATION_NOT_SUPPORTED, /** * This camera device is no longer connected or otherwise available for use */ - CAMERA_DISCONNECTED = 6, + CAMERA_DISCONNECTED, /** * The HAL has encountered an internal error and cannot complete the * request. */ - INTERNAL_ERROR = 7, + INTERNAL_ERROR, } 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 80bfc3c906..51c60676be 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 @@ -34,7 +34,6 @@ package android.hardware.camera.device; @VintfStability interface ICameraDevice { - void dumpState(in ParcelFileDescriptor fd); android.hardware.camera.device.CameraMetadata getCameraCharacteristics(); android.hardware.camera.device.CameraMetadata getPhysicalCameraCharacteristics(in String physicalCameraId); android.hardware.camera.common.CameraResourceCost getResourceCost(); diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl index f1f26d8331..57705bc621 100644 --- a/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl +++ b/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl @@ -22,7 +22,6 @@ import android.hardware.camera.device.ICameraDeviceCallback; import android.hardware.camera.device.ICameraDeviceSession; import android.hardware.camera.device.ICameraInjectionSession; import android.hardware.camera.device.StreamConfiguration; - import android.os.ParcelFileDescriptor; /** @@ -34,31 +33,6 @@ import android.os.ParcelFileDescriptor; */ @VintfStability interface ICameraDevice { - /** - * dumpState: - * - * Print out debugging state for the camera device. This may be called by - * the framework when the camera service is asked for a debug dump, which - * happens when using the dumpsys tool, or when capturing a bugreport. - * - * The passed-in file descriptor can be used to write debugging text using - * dprintf() or write(). - * - * In case this camera device has been disconnected, the dump must not fail, - * but may simply print out 'Device disconnected' or equivalent. - * - * Performance requirements: - * - * This must be a non-blocking call. The HAL should return from this call - * in 1ms, must return from this call in 10ms. This call must avoid - * deadlocks, as it may be called at any point during camera operation. - * Any synchronization primitives used (such as mutex locks or semaphores) - * must be acquired with a timeout. - * - * @param fd The file descriptor to which the camera HAL must write any dumpState information. - */ - void dumpState(in ParcelFileDescriptor fd); - /** * getCameraCharacteristics: * @@ -225,6 +199,8 @@ interface ICameraDevice { * INTERNAL_ERROR: * The camera device cannot be opened due to an internal * error. + * OPERATION_NOT_SUPPORTED: + * This camera device does not support opening an injection session. * ILLEGAL_ARGUMENT: * The callbacks handle is invalid (for example, it is null). * CAMERA_IN_USE: @@ -237,8 +213,7 @@ interface ICameraDevice { * longer available. This 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. - * @return The interface to the newly-opened camera session, - * or null if status is not OK. + * @return The interface to the newly-opened camera session, or null if status is not OK. */ ICameraInjectionSession openInjectionSession(in ICameraDeviceCallback callback); diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl index 0c355c8664..3a790b3a7a 100644 --- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl @@ -64,7 +64,6 @@ enum CameraMetadataSectionStart { ANDROID_SYNC_START = 1507328, ANDROID_REPROCESS_START = 1572864, ANDROID_DEPTH_START = 1638400, - VENDOR_SECTION_START = -2147483648, ANDROID_LOGICAL_MULTI_CAMERA_START = 1703936, ANDROID_DISTORTION_CORRECTION_START = 1769472, ANDROID_HEIC_START = 1835008, diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl index d5cd0b4b5d..93d6f13a8e 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl @@ -57,7 +57,6 @@ enum CameraMetadataSectionStart { ANDROID_SYNC_START = CameraMetadataSection.ANDROID_SYNC << 16, ANDROID_REPROCESS_START = CameraMetadataSection.ANDROID_REPROCESS << 16, ANDROID_DEPTH_START = CameraMetadataSection.ANDROID_DEPTH << 16, - VENDOR_SECTION_START = CameraMetadataSection.VENDOR_SECTION << 16, ANDROID_LOGICAL_MULTI_CAMERA_START = CameraMetadataSection.ANDROID_LOGICAL_MULTI_CAMERA << 16, ANDROID_DISTORTION_CORRECTION_START = CameraMetadataSection.ANDROID_DISTORTION_CORRECTION << 16, ANDROID_HEIC_START = CameraMetadataSection.ANDROID_HEIC << 16, diff --git a/camera/provider/aidl/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl b/camera/provider/aidl/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl index 7d8e48635e..46917a1caa 100644 --- a/camera/provider/aidl/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl +++ b/camera/provider/aidl/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl @@ -18,5 +18,9 @@ package android.hardware.camera.provider; @VintfStability parcelable ConcurrentCameraIdCombination { + /** + * Combination of camera ids, that can be opened + * and configured with sessions on, concurrently. + */ List combination; } diff --git a/camera/provider/aidl/android/hardware/camera/provider/ICameraProvider.aidl b/camera/provider/aidl/android/hardware/camera/provider/ICameraProvider.aidl index 7a4e01020a..c4eba8d492 100644 --- a/camera/provider/aidl/android/hardware/camera/provider/ICameraProvider.aidl +++ b/camera/provider/aidl/android/hardware/camera/provider/ICameraProvider.aidl @@ -56,7 +56,6 @@ import android.hardware.camera.provider.ICameraProviderCallback; @VintfStability interface ICameraProvider { - /** * Device states to be passed to notifyDeviceStateChange(). */ @@ -295,7 +294,7 @@ interface ICameraProvider { * configurations that need to be queried for support. * * On error, the service specific error for the operation will be, one of: - * METHOD_NOT_SUPPORTED: + * OPERATION_NOT_SUPPORTED: * The camera provider does not support stream combination query. * INTERNAL_ERROR: * The stream combination query cannot complete due to internal -- GitLab From 4ce76d242c67bf24a688c7d5a2ea28cba42ad776 Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Mon, 14 Feb 2022 16:04:26 -0800 Subject: [PATCH 642/825] Camera: Use 64bit integers for dynamic range profile values Additionally extend the dynamic range profile map to include hints about extra lookahead latency. Bug: 215396395 Test: Camera CTS Change-Id: I600a3147d94a9aad1a312b92aacee014c05db16f --- camera/metadata/3.8/types.hal | 4 ++-- ...equestAvailableDynamicRangeProfilesMap.aidl | 2 +- .../camera/metadata/CameraMetadataTag.aidl | 2 +- ...equestAvailableDynamicRangeProfilesMap.aidl | 2 +- .../VtsHalCameraProviderV2_4TargetTest.cpp | 18 +++++++++--------- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/camera/metadata/3.8/types.hal b/camera/metadata/3.8/types.hal index 1b1a7a263b..06839873c3 100644 --- a/camera/metadata/3.8/types.hal +++ b/camera/metadata/3.8/types.hal @@ -87,7 +87,7 @@ enum CameraMetadataTag : @3.7::CameraMetadataTag { */ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP = android.hardware.camera.metadata@3.4::CameraMetadataTag:ANDROID_REQUEST_END_3_4, - /** android.request.recommendedTenBitDynamicRangeProfile [static, int32, java_public] + /** android.request.recommendedTenBitDynamicRangeProfile [static, int64, java_public] * *

Recommended 10-bit dynamic range profile.

*/ @@ -154,7 +154,7 @@ enum CameraMetadataEnumAndroidRequestAvailableCapabilities : /** android.request.availableDynamicRangeProfilesMap enumeration values * @see ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP */ -enum CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap : uint32_t { +enum CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap : int64_t { ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD = 0x1, ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10 = 0x2, diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl index cec4ac16ab..16e38ba90f 100644 --- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl @@ -36,7 +36,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.camera.metadata; -@Backing(type="int") @VintfStability +@Backing(type="long") @VintfStability enum RequestAvailableDynamicRangeProfilesMap { ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD = 1, ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10 = 2, diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl index 1f388d9c38..f20a06edae 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl @@ -1024,7 +1024,7 @@ enum CameraMetadataTag { */ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP, /** - * android.request.recommendedTenBitDynamicRangeProfile [static, int32, java_public] + * android.request.recommendedTenBitDynamicRangeProfile [static, int64, java_public] * *

Recommended 10-bit dynamic range profile.

*/ diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl index c0ef8c663a..319be75abe 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl @@ -27,7 +27,7 @@ package android.hardware.camera.metadata; * @see ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP */ @VintfStability -@Backing(type="int") +@Backing(type="long") enum RequestAvailableDynamicRangeProfilesMap { ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD = 0x1, ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10 = 0x2, diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index 7e5e8b2bae..ab867cd4af 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -8287,21 +8287,21 @@ void CameraHidlTest::get10BitDynamicRangeProfiles(const camera_metadata_t* stati ASSERT_NE(nullptr, staticMeta); ASSERT_NE(nullptr, profiles); camera_metadata_ro_entry entry; - std::unordered_set entries; + std::unordered_set entries; int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP, &entry); ASSERT_EQ(rc, 0); ASSERT_TRUE(entry.count > 0); - ASSERT_EQ(entry.count % 2, 0); + ASSERT_EQ(entry.count % 3, 0); - for (uint32_t i = 0; i < entry.count; i += 2) { - ASSERT_NE(entry.data.i32[i], + for (uint32_t i = 0; i < entry.count; i += 3) { + ASSERT_NE(entry.data.i64[i], ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD); - ASSERT_EQ(entries.find(entry.data.i32[i]), entries.end()); - entries.insert(static_cast(entry.data.i32[i])); + ASSERT_EQ(entries.find(entry.data.i64[i]), entries.end()); + entries.insert(entry.data.i64[i]); profiles->emplace_back( static_cast - (entry.data.i32[i])); + (entry.data.i64[i])); } if (!entries.empty()) { @@ -8335,7 +8335,7 @@ void CameraHidlTest::verify10BitMetadata(HandleImporter& importer, bool smpte2094_40Present = importer.isSmpte2094_40Present( b.buffer.buffer.getNativeHandle()); - switch (static_cast(profile)) { + switch (static_cast(profile)) { case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10: ASSERT_FALSE(smpte2086Present); ASSERT_FALSE(smpte2094_10Present); @@ -8364,7 +8364,7 @@ void CameraHidlTest::verify10BitMetadata(HandleImporter& importer, ASSERT_FALSE(smpte2094_40Present); break; default: - ALOGE("%s: Unexpected 10-bit dynamic range profile: %d", + ALOGE("%s: Unexpected 10-bit dynamic range profile: %" PRId64, __FUNCTION__, profile); ADD_FAILURE(); } -- GitLab From c5e5f2059ce39f8af1c32fae885dd4c28dc6d237 Mon Sep 17 00:00:00 2001 From: Super Liu Date: Wed, 23 Feb 2022 01:19:06 +0000 Subject: [PATCH 643/825] Revert "Add bssid to onEapFailure callback method." Revert "[automerge] Add bssid to onEapFailure callback method. 2..." Revert "Update framework callback implementation to accept the b..." Revert "[automerge] Update framework callback implementation to ..." Revert "[automerge] Update framework callback implementation to ..." Revert submission 16982405-eap-failure-bssid Reason for revert: Broken build on git_master Reverted Changes: I2d2a27255:Add bssid to onEapFailure callback method. I5eb812575:[automerge] Update framework callback implementati... I64474d678:[automerge] Update framework callback implementati... If08fc19f0:Update framework callback implementation to accept... I71a514dde:[automerge] Add bssid to onEapFailure callback met... I1490b9dcc:[automerge] Add bssid to onEapFailure callback met... I699052131:Update supplicant service to call onEapFailure wit... Change-Id: I7c926e2d446399ee79ea62f50735647411a35576 --- .../hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl | 2 +- .../hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl | 3 +-- .../aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) 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 25a09b435e..46c8000a64 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 @@ -46,7 +46,7 @@ interface ISupplicantStaIfaceCallback { oneway void onDppSuccess(in android.hardware.wifi.supplicant.DppEventType event); oneway void onDppSuccessConfigReceived(in byte[] ssid, in String password, in byte[] psk, in android.hardware.wifi.supplicant.DppAkm securityAkm, in android.hardware.wifi.supplicant.DppConnectionKeys dppConnectionKeys); oneway void onDppSuccessConfigSent(); - oneway void onEapFailure(in byte[] bssid, in int errorCode); + oneway void onEapFailure(in int errorCode); 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); diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index 0730a8cf54..895bc50436 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -154,12 +154,11 @@ oneway interface ISupplicantStaIfaceCallback { /** * Indicates an EAP authentication failure. - * @param bssid BSSID of the access point. * @param errorCode Error code for EAP authentication failure. * Either standard error code (enum EapErrorCode) or * private error code defined by network provider. */ - void onEapFailure(in byte[] bssid, in int errorCode); + void onEapFailure(in int errorCode); /** * Used to indicate that the external radio work can start now. 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 2ed6a0e476..1c00ec7c46 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 @@ -130,8 +130,7 @@ class SupplicantStaIfaceCallback : public BnSupplicantStaIfaceCallback { ::ndk::ScopedAStatus onDppSuccessConfigSent() override { return ndk::ScopedAStatus::ok(); } - ::ndk::ScopedAStatus onEapFailure(const std::vector& /* bssid */, - int32_t /* errorCode */) override { + ::ndk::ScopedAStatus onEapFailure(int32_t /* errorCode */) override { return ndk::ScopedAStatus::ok(); } ::ndk::ScopedAStatus onExtRadioWorkStart(int32_t /* id */) override { -- GitLab From 5561b4babab76491d575934c5169645e3a64c9c1 Mon Sep 17 00:00:00 2001 From: sandeepjs Date: Tue, 15 Feb 2022 11:41:28 +0000 Subject: [PATCH 644/825] VTS testcases for HAL API setSimSlotMapping To accomodate MEP, we have updated the setSimSlotMapping API in the HAL, Writing the tescases to check functionality of the same. Test: atest VtsHalRadioTargetTest Bug: 217665559 Change-Id: Idbff19db2e536d3c2f7b80afbbf244575d8247d0 Merged-In: Idbff19db2e536d3c2f7b80afbbf244575d8247d0 (cherry picked from commit 2a01674368cc1e3506627edad5a41f03ad3e0b13) --- radio/aidl/vts/radio_aidl_hal_utils.cpp | 20 +++++++++ radio/aidl/vts/radio_aidl_hal_utils.h | 6 +++ radio/aidl/vts/radio_config_response.cpp | 3 +- radio/aidl/vts/radio_config_test.cpp | 56 ++++++++++++++++++++++++ radio/aidl/vts/radio_config_utils.h | 3 ++ radio/aidl/vts/radio_sim_test.cpp | 6 +++ 6 files changed, 93 insertions(+), 1 deletion(-) diff --git a/radio/aidl/vts/radio_aidl_hal_utils.cpp b/radio/aidl/vts/radio_aidl_hal_utils.cpp index dc61a3cfd3..1f739302b4 100644 --- a/radio/aidl/vts/radio_aidl_hal_utils.cpp +++ b/radio/aidl/vts/radio_aidl_hal_utils.cpp @@ -24,6 +24,7 @@ #define WAIT_TIMEOUT_PERIOD 75 sim::CardStatus cardStatus = {}; +config::SimSlotStatus slotStatus = {}; int serial = 0; int count_ = 0; @@ -204,3 +205,22 @@ void RadioServiceTest::updateSimCardStatus() { EXPECT_EQ(serial, radioSimRsp->rspInfo.serial); EXPECT_EQ(RadioError::NONE, radioSimRsp->rspInfo.error); } + +void RadioServiceTest::updateSimSlotStatus() { + // Update SimSlotStatus from RadioConfig + std::shared_ptr radioConfigRsp = + ndk::SharedRefBase::make(*this); + std::shared_ptr radioConfigInd = + ndk::SharedRefBase::make(*this); + radio_config->setResponseFunctions(radioConfigRsp, radioConfigInd); + serial = GetRandomSerialNumber(); + radio_config->getSimSlotsStatus(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioConfigRsp->rspInfo.type); + EXPECT_EQ(serial, radioConfigRsp->rspInfo.serial); + EXPECT_EQ(RadioError::NONE, radioConfigRsp->rspInfo.error); + // assuming only 1 slot + for (const SimSlotStatus& slotStatusResponse : radioConfigRsp->simSlotStatus) { + slotStatus = slotStatusResponse; + } +} diff --git a/radio/aidl/vts/radio_aidl_hal_utils.h b/radio/aidl/vts/radio_aidl_hal_utils.h index 414ffbc456..d6f7bf75b6 100644 --- a/radio/aidl/vts/radio_aidl_hal_utils.h +++ b/radio/aidl/vts/radio_aidl_hal_utils.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -27,10 +28,12 @@ #include using namespace aidl::android::hardware::radio; +using aidl::android::hardware::radio::config::SimSlotStatus; using aidl::android::hardware::radio::network::RegState; using aidl::android::hardware::radio::sim::CardStatus; extern CardStatus cardStatus; +extern SimSlotStatus slotStatus; extern int serial; extern int count_; @@ -141,4 +144,7 @@ class RadioServiceTest { /* Update SIM card status */ void updateSimCardStatus(); + + /* Update SIM slot status */ + void updateSimSlotStatus(); }; diff --git a/radio/aidl/vts/radio_config_response.cpp b/radio/aidl/vts/radio_config_response.cpp index 8d8160519a..7384f87adc 100644 --- a/radio/aidl/vts/radio_config_response.cpp +++ b/radio/aidl/vts/radio_config_response.cpp @@ -19,8 +19,9 @@ RadioConfigResponse::RadioConfigResponse(RadioServiceTest& parent) : parent_config(parent) {} ndk::ScopedAStatus RadioConfigResponse::getSimSlotsStatusResponse( - const RadioResponseInfo& info, const std::vector& /* slotStatus */) { + const RadioResponseInfo& info, const std::vector& slotStatus) { rspInfo = info; + simSlotStatus = slotStatus; parent_config.notify(info.serial); return ndk::ScopedAStatus::ok(); } diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp index a271b8af52..a124907ad0 100644 --- a/radio/aidl/vts/radio_config_test.cpp +++ b/radio/aidl/vts/radio_config_test.cpp @@ -44,6 +44,19 @@ void RadioConfigTest::SetUp() { radio_config->setResponseFunctions(radioRsp_config, radioInd_config); } +void RadioConfigTest::updateSimSlotStatus() { + serial = GetRandomSerialNumber(); + radio_config->getSimSlotsStatus(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type); + EXPECT_EQ(serial, radioRsp_config->rspInfo.serial); + EXPECT_EQ(RadioError::NONE, radioRsp_config->rspInfo.error); + // assuming only 1 slot + for (const SimSlotStatus& slotStatusResponse : radioRsp_config->simSlotStatus) { + slotStatus = slotStatusResponse; + } +} + /* * Test IRadioConfig.getHalDeviceCapabilities() for the response returned. */ @@ -153,3 +166,46 @@ TEST_P(RadioConfigTest, setPreferredDataModem_invalidArgument) { {RadioError::INVALID_ARGUMENTS, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR})); } + +/* + * Test IRadioConfig.setSimSlotsMapping() for the response returned. + */ +TEST_P(RadioConfigTest, setSimSlotsMapping) { + serial = GetRandomSerialNumber(); + SlotPortMapping slotPortMapping; + slotPortMapping.physicalSlotId = 0; + slotPortMapping.portId = 0; + std::vector slotPortMappingList = {slotPortMapping}; + ndk::ScopedAStatus res = radio_config->setSimSlotsMapping(serial, slotPortMappingList); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type); + EXPECT_EQ(serial, radioRsp_config->rspInfo.serial); + ALOGI("setSimSlotsMapping, rspInfo.error = %s\n", + toString(radioRsp_config->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_config->rspInfo.error, {RadioError::NONE})); +} + +/* + * Test IRadioConfig.getSimSlotStatus() for the response returned. + */ + +TEST_P(RadioConfigTest, checkPortInfoExistsAndPortActive) { + serial = GetRandomSerialNumber(); + ndk::ScopedAStatus res = radio_config->getSimSlotsStatus(serial); + ASSERT_OK(res); + ALOGI("getSimSlotsStatus, rspInfo.error = %s\n", + toString(radioRsp_config->rspInfo.error).c_str()); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type); + EXPECT_EQ(serial, radioRsp_config->rspInfo.serial); + if (radioRsp_config->rspInfo.error == RadioError::NONE) { + // check if cardState is present, portInfo size should be more than 0 + for (const SimSlotStatus& slotStatusResponse : radioRsp_config->simSlotStatus) { + if (slotStatusResponse.cardState == CardStatus::STATE_PRESENT) { + ASSERT_TRUE(slotStatusResponse.portInfo.size() > 0); + ASSERT_TRUE(slotStatusResponse.portInfo[0].portActive); + } + } + } +} diff --git a/radio/aidl/vts/radio_config_utils.h b/radio/aidl/vts/radio_config_utils.h index 465c10653b..3db430db5f 100644 --- a/radio/aidl/vts/radio_config_utils.h +++ b/radio/aidl/vts/radio_config_utils.h @@ -38,6 +38,7 @@ class RadioConfigResponse : public BnRadioConfigResponse { RadioResponseInfo rspInfo; PhoneCapability phoneCap; bool modemReducedFeatureSet1; + std::vector simSlotStatus; virtual ndk::ScopedAStatus getSimSlotsStatusResponse( const RadioResponseInfo& info, const std::vector& slotStatus) override; @@ -77,6 +78,8 @@ class RadioConfigTest : public ::testing::TestWithParam, public Rad public: virtual void SetUp() override; ndk::ScopedAStatus updateSimCardStatus(); + /* Override updateSimSlotStatus in RadioServiceTest to not call setResponseFunctions */ + void updateSimSlotStatus(); /* radio config service handle in RadioServiceTest */ /* radio config response handle */ diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp index e82235c2b6..f94a2a05b4 100644 --- a/radio/aidl/vts/radio_sim_test.cpp +++ b/radio/aidl/vts/radio_sim_test.cpp @@ -108,7 +108,13 @@ TEST_P(RadioSimTest, setSimCardPower) { // have CardStatus::STATE_PRESENT after turning the power back on if (radioRsp_sim->rspInfo.error == RadioError::NONE) { updateSimCardStatus(); + updateSimSlotStatus(); EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState); + EXPECT_EQ(CardStatus::STATE_PRESENT, slotStatus.cardState); + if (CardStatus::STATE_PRESENT == slotStatus.cardState) { + ASSERT_TRUE(slotStatus.portInfo[0].portActive); + EXPECT_EQ(0, cardStatus.slotMap.portId); + } } } -- GitLab From 915908797a04d11449f7c9bdaefc5e4ce327d0ad Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Wed, 23 Feb 2022 09:51:21 -0500 Subject: [PATCH 645/825] getDisplayDecorationSupport test: allow errors Allow getDisplayDecorationSupport to return an error, and treat that as unsupported. This allows Cuttlefish, which, with I91105fc3345dbd75aeb0b102f3f0138fa33120c0, returns Unsupported, to pass the test. Bug: 209458568 Test: this Change-Id: I8e17d3c0ca0ac4eacb0b5e4c8ae540f271e68a23 --- .../vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index f32738143c..35242c2482 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1627,10 +1627,8 @@ TEST_P(GraphicsComposerAidlCommandTest, DisplayDecoration) { const auto [error, support] = mComposerClient->getDisplayDecorationSupport(display.getDisplayId()); - EXPECT_TRUE(error.isOk()); - const auto format = - support ? support->format + const auto format = (error.isOk() && support) ? support->format : aidl::android::hardware::graphics::common::PixelFormat::RGBA_8888; const auto decorBuffer = allocate(static_cast<::android::PixelFormat>(format)); ASSERT_NE(nullptr, decorBuffer); -- GitLab From 8974cbcdd75b0af30ae4b0d041bb9b2ca145fd82 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 23 Feb 2022 09:00:01 -0800 Subject: [PATCH 646/825] uwb(hal): Fix typo in pulse shape combo caps This does not align with the values defined in UwbVendorCapabilityTlvValues.aidl. Bug: 221001452 Test: Compiles Change-Id: I41d4850e5455ec6679af5edfa0e510d20439a651 --- .../uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index 97f801078a..0140fdd5ed 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -129,9 +129,9 @@ enum UwbVendorCapabilityTlvTypes { * 1 byte tuple {initiator_tx (4 bits), responder_tx (4 bits)} array with list of supported * pulse shape combos * Values: - * PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 1 - * PULSE_SHAPE_PRECURSOR_FREE = 2 - * PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 3 + * PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 0 + * PULSE_SHAPE_PRECURSOR_FREE = 1 + * PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 2 */ /** */ CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 0xA6, -- GitLab From 758e5b37fe129bcd284558c4ba58a72a8179cbde Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Tue, 22 Feb 2022 21:36:28 +0000 Subject: [PATCH 647/825] Add bssid to onEapFailure callback method. Bug: 165342942 Test: atest VtsHalWifiSupplicantStaIfaceTargetTest Change-Id: I188ab7c5dbabd48220d38c66a46003ad3630721c --- .../hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl | 2 +- .../hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl | 3 ++- .../aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) 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 46c8000a64..25a09b435e 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 @@ -46,7 +46,7 @@ interface ISupplicantStaIfaceCallback { oneway void onDppSuccess(in android.hardware.wifi.supplicant.DppEventType event); oneway void onDppSuccessConfigReceived(in byte[] ssid, in String password, in byte[] psk, in android.hardware.wifi.supplicant.DppAkm securityAkm, in android.hardware.wifi.supplicant.DppConnectionKeys dppConnectionKeys); oneway void onDppSuccessConfigSent(); - oneway void onEapFailure(in int errorCode); + oneway void onEapFailure(in byte[] bssid, in int errorCode); 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); diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index 895bc50436..0730a8cf54 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -154,11 +154,12 @@ oneway interface ISupplicantStaIfaceCallback { /** * Indicates an EAP authentication failure. + * @param bssid BSSID of the access point. * @param errorCode Error code for EAP authentication failure. * Either standard error code (enum EapErrorCode) or * private error code defined by network provider. */ - void onEapFailure(in int errorCode); + void onEapFailure(in byte[] bssid, in int errorCode); /** * Used to indicate that the external radio work can start now. 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 1c00ec7c46..2ed6a0e476 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 @@ -130,7 +130,8 @@ class SupplicantStaIfaceCallback : public BnSupplicantStaIfaceCallback { ::ndk::ScopedAStatus onDppSuccessConfigSent() override { return ndk::ScopedAStatus::ok(); } - ::ndk::ScopedAStatus onEapFailure(int32_t /* errorCode */) override { + ::ndk::ScopedAStatus onEapFailure(const std::vector& /* bssid */, + int32_t /* errorCode */) override { return ndk::ScopedAStatus::ok(); } ::ndk::ScopedAStatus onExtRadioWorkStart(int32_t /* id */) override { -- GitLab From 6bdc75249be4fbd9e47eca45494217b0da6c5cd1 Mon Sep 17 00:00:00 2001 From: Quang Luong Date: Wed, 23 Feb 2022 11:27:31 -0800 Subject: [PATCH 648/825] Add VTS test for V1_6::IWifiChip::getAvailableModes_1_6 Bug: 220222963 Test: atest VtsHalWifiV1_6TargetTest Change-Id: I76908ae0e69f8e1b07a654062b1bd0122e0dd910 --- wifi/1.6/vts/functional/wifi_chip_hidl_test.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wifi/1.6/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.6/vts/functional/wifi_chip_hidl_test.cpp index 54fb7216fa..d1d4336222 100644 --- a/wifi/1.6/vts/functional/wifi_chip_hidl_test.cpp +++ b/wifi/1.6/vts/functional/wifi_chip_hidl_test.cpp @@ -95,6 +95,15 @@ TEST_P(WifiChipHidlTest, getUsableChannels_1_6) { EXPECT_EQ(WifiStatusCode::SUCCESS, statusNonEmpty.first.code); } +/* getAvailableModes_1_6: + * Ensures that a call to getAvailableModes_1_6 will return with a success status code. + */ +TEST_P(WifiChipHidlTest, getAvailableModes_1_6) { + const auto& status_and_modes = HIDL_INVOKE(wifi_chip_, getAvailableModes_1_6); + EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_modes.first.code); + EXPECT_LT(0u, status_and_modes.second.size()); +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiChipHidlTest); INSTANTIATE_TEST_SUITE_P(PerInstance, WifiChipHidlTest, testing::ValuesIn(android::hardware::getAllHalInstanceNames( -- GitLab From e77f6be875b1683ec0559a5ee13a20b355008b7b Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 22 Feb 2022 22:43:34 +0000 Subject: [PATCH 649/825] Add tests that might be affected by HAL to presubmit. Add list of tests to auto-presubmit for HAL changes. CarServiceTest and CarServiceUnitTest theoratically should not interact with real HAL, but add them as well just in case they are affected. Test: Presubmit Bug: 219843089 Change-Id: I47350d1d0683fd4fa505e289540fd5ce9034ebb9 --- automotive/TEST_MAPPING | 28 ++++++++++++++++++++++++++++ automotive/vehicle/TEST_MAPPING | 5 ----- 2 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 automotive/TEST_MAPPING diff --git a/automotive/TEST_MAPPING b/automotive/TEST_MAPPING new file mode 100644 index 0000000000..c64c8805d6 --- /dev/null +++ b/automotive/TEST_MAPPING @@ -0,0 +1,28 @@ +{ + "auto-presubmit": [ + { + "name": "AndroidCarApiTest" + }, + { + "name": "CarSecurityPermissionTest" + }, + { + "name": "CtsCarTestCases" + }, + { + "name": "CtsCarBuiltinApiTestCases" + }, + { + "name": "CtsCarHostTestCases" + }, + { + "name": "CtsCarBuiltinApiHostTestCases" + }, + { + "name": "CarServiceTest" + }, + { + "name": "CarServiceUnitTest" + } + ] +} \ No newline at end of file diff --git a/automotive/vehicle/TEST_MAPPING b/automotive/vehicle/TEST_MAPPING index 92cab96a87..ff6f3be52b 100644 --- a/automotive/vehicle/TEST_MAPPING +++ b/automotive/vehicle/TEST_MAPPING @@ -24,10 +24,5 @@ { "name": "DefaultVehicleHalTest" } - ], - "auto-postsubmit": [ - { - "name": "AndroidCarApiTest" - } ] } -- GitLab From 69ab393b882d165b6a510f45c0014f613f254163 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 17 Feb 2022 19:02:16 -0800 Subject: [PATCH 650/825] Always trigger prop change event for WAIT_FOR_VHAL. CarService always expect VHAL to generate a property change event when sending WAIT_FOR_VHAL even though there is not actual power state change in VHAL. VHAL power state might already be ON when receive WAIT_FOR_VHAL if CarService client crashes and restarts. In this case, CarService still expects an event to be generated. VehiclePropStore would only generate event when there is an actual property value change, so we must erase the value before setting the value to ensure a change event. Test: atest FakeVehicleHardwareTest Bug: 219861737 Change-Id: I185b07e188f0b581253b5ab29faf859247ed9d38 --- .../hardware/src/FakeVehicleHardware.cpp | 12 ++++++--- .../hardware/test/FakeVehicleHardwareTest.cpp | 26 +++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) 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 097257e3c0..a78d989605 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -211,10 +211,16 @@ Result FakeVehicleHardware::setApPowerStateReport(const VehiclePropValue& case toInt(VehicleApPowerStateReport::SHUTDOWN_CANCELLED): [[fallthrough]]; case toInt(VehicleApPowerStateReport::WAIT_FOR_VHAL): - // CPMS is in WAIT_FOR_VHAL state, simply move to ON - // Send back to HAL - // ALWAYS update status for generated property value + // CPMS is in WAIT_FOR_VHAL state, simply move to ON and send back to HAL. + // Must erase existing state because in the case when Car Service crashes, the power + // state would already be ON when we receive WAIT_FOR_VHAL and thus new property change + // event would be generated. However, Car Service always expect a property change event + // even though there is not actual state change. + mServerSidePropStore->removeValuesForProperty( + toInt(VehicleProperty::AP_POWER_STATE_REQ)); prop = createApPowerStateReq(VehicleApPowerStateReq::ON); + + // ALWAYS update status for generated property value if (auto writeResult = mServerSidePropStore->writeValue(std::move(prop), /*updateStatus=*/true); !writeResult.ok()) { 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 3dae9fc189..6259f9606f 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -924,6 +924,32 @@ INSTANTIATE_TEST_SUITE_P( return info.param.name; }); +TEST_F(FakeVehicleHardwareTest, testSetWaitForVhalAfterCarServiceCrash) { + int32_t propId = toInt(VehicleProperty::AP_POWER_STATE_REPORT); + VehiclePropValue request = VehiclePropValue{ + .prop = propId, + .value.int32Values = {toInt(VehicleApPowerStateReport::WAIT_FOR_VHAL)}, + }; + ASSERT_EQ(setValue(request), StatusCode::OK) << "failed to set property " << propId; + + // 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; + + std::vector events = getChangedProperties(); + // Even though the state is already ON, we should receive another ON event. + ASSERT_EQ(events.size(), 1u); + // Erase the timestamp for comparison. + events[0].timestamp = 0; + ASSERT_EQ(events[0], (VehiclePropValue{ + .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), + .status = VehiclePropertyStatus::AVAILABLE, + .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, + })); +} + TEST_F(FakeVehicleHardwareTest, testGetObd2FreezeFrame) { int64_t timestamp = elapsedRealtimeNano(); -- GitLab From 6ee0f7505137f7b75bfe5be78247269d7068fb99 Mon Sep 17 00:00:00 2001 From: Jason Macnak Date: Wed, 23 Feb 2022 21:06:07 +0000 Subject: [PATCH 651/825] Minor spelling fix Change-Id: Ibcad1d80e09ff547c2935bbc362809431a4c3f14 --- .../aidl/android/hardware/graphics/composer3/Composition.aidl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl index adcc9f6a31..82b218be3f 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl @@ -80,7 +80,7 @@ enum Composition { * * Only supported if the device returns a valid struct from * getDisplayDecorationSupport. Pixels in the buffer are interpreted - * according to the DisplayDecorationSupport.alphInterpretation. + * according to the DisplayDecorationSupport.alphaInterpretation. * * Upon validateDisplay, the device may request a change from this type * to either DEVICE or CLIENT. -- GitLab From 458e53e8899876708f813724b223ea68ec3f2ffe Mon Sep 17 00:00:00 2001 From: ramindani Date: Wed, 23 Feb 2022 17:30:16 +0000 Subject: [PATCH 652/825] Update the test directory structure vts is moved from aidl/android/ to aidl/vts functional, include & composer-vts directory is removed as well. BUG: 220171967 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I6cafbbd99374308a1cc06e27cc590e70618f7075 --- .../graphics/composer3/vts/functional => vts}/Android.bp | 8 ++++---- .../composer3/vts/functional => vts}/AndroidTest.xml | 0 .../composer-vts => vts}/GraphicsComposerCallback.cpp | 2 +- .../include => vts}/GraphicsComposerCallback.h | 0 .../graphics/composer3/vts/functional => vts}/OWNERS | 0 .../vts/functional/composer-vts => vts}/ReadbackVts.cpp | 4 ++-- .../functional/composer-vts/include => vts}/ReadbackVts.h | 0 .../functional/composer-vts => vts}/RenderEngineVts.cpp | 2 +- .../composer-vts/include => vts}/RenderEngineVts.h | 0 .../functional/composer-vts => vts}/VtsComposerClient.cpp | 2 +- .../composer-vts/include => vts}/VtsComposerClient.h | 0 .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 8 ++++---- .../VtsHalGraphicsComposer3_TargetTest.cpp | 4 ++-- 13 files changed, 15 insertions(+), 15 deletions(-) rename graphics/composer/aidl/{android/hardware/graphics/composer3/vts/functional => vts}/Android.bp (94%) rename graphics/composer/aidl/{android/hardware/graphics/composer3/vts/functional => vts}/AndroidTest.xml (100%) rename graphics/composer/aidl/{android/hardware/graphics/composer3/vts/functional/composer-vts => vts}/GraphicsComposerCallback.cpp (99%) rename graphics/composer/aidl/{android/hardware/graphics/composer3/vts/functional/composer-vts/include => vts}/GraphicsComposerCallback.h (100%) rename graphics/composer/aidl/{android/hardware/graphics/composer3/vts/functional => vts}/OWNERS (100%) rename graphics/composer/aidl/{android/hardware/graphics/composer3/vts/functional/composer-vts => vts}/ReadbackVts.cpp (99%) rename graphics/composer/aidl/{android/hardware/graphics/composer3/vts/functional/composer-vts/include => vts}/ReadbackVts.h (100%) rename graphics/composer/aidl/{android/hardware/graphics/composer3/vts/functional/composer-vts => vts}/RenderEngineVts.cpp (99%) rename graphics/composer/aidl/{android/hardware/graphics/composer3/vts/functional/composer-vts/include => vts}/RenderEngineVts.h (100%) rename graphics/composer/aidl/{android/hardware/graphics/composer3/vts/functional/composer-vts => vts}/VtsComposerClient.cpp (99%) rename graphics/composer/aidl/{android/hardware/graphics/composer3/vts/functional/composer-vts/include => vts}/VtsComposerClient.h (100%) rename graphics/composer/aidl/{android/hardware/graphics/composer3/vts/functional => vts}/VtsHalGraphicsComposer3_ReadbackTest.cpp (99%) rename graphics/composer/aidl/{android/hardware/graphics/composer3/vts/functional => vts}/VtsHalGraphicsComposer3_TargetTest.cpp (99%) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp b/graphics/composer/aidl/vts/Android.bp similarity index 94% rename from graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp rename to graphics/composer/aidl/vts/Android.bp index 139b5e8512..1e70a0ec45 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp +++ b/graphics/composer/aidl/vts/Android.bp @@ -34,10 +34,10 @@ cc_test { srcs: [ "VtsHalGraphicsComposer3_TargetTest.cpp", "VtsHalGraphicsComposer3_ReadbackTest.cpp", - "composer-vts/GraphicsComposerCallback.cpp", - "composer-vts/ReadbackVts.cpp", - "composer-vts/RenderEngineVts.cpp", - "composer-vts/VtsComposerClient.cpp", + "GraphicsComposerCallback.cpp", + "ReadbackVts.cpp", + "RenderEngineVts.cpp", + "VtsComposerClient.cpp", ], shared_libs: [ diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/AndroidTest.xml b/graphics/composer/aidl/vts/AndroidTest.xml similarity index 100% rename from graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/AndroidTest.xml rename to graphics/composer/aidl/vts/AndroidTest.xml diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/GraphicsComposerCallback.cpp b/graphics/composer/aidl/vts/GraphicsComposerCallback.cpp similarity index 99% rename from graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/GraphicsComposerCallback.cpp rename to graphics/composer/aidl/vts/GraphicsComposerCallback.cpp index 8f329b3b4c..d53494325a 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/GraphicsComposerCallback.cpp +++ b/graphics/composer/aidl/vts/GraphicsComposerCallback.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "include/GraphicsComposerCallback.h" +#include "GraphicsComposerCallback.h" #include #include diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h b/graphics/composer/aidl/vts/GraphicsComposerCallback.h similarity index 100% rename from graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/GraphicsComposerCallback.h rename to graphics/composer/aidl/vts/GraphicsComposerCallback.h diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/OWNERS b/graphics/composer/aidl/vts/OWNERS similarity index 100% rename from graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/OWNERS rename to graphics/composer/aidl/vts/OWNERS diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/vts/ReadbackVts.cpp similarity index 99% rename from graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp rename to graphics/composer/aidl/vts/ReadbackVts.cpp index f8a0ec4b4a..03b1b6ca12 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/vts/ReadbackVts.cpp @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "include/ReadbackVts.h" +#include "ReadbackVts.h" #include -#include "include/RenderEngineVts.h" +#include "RenderEngineVts.h" #include "renderengine/ExternalTexture.h" #include "renderengine/impl/ExternalTexture.h" diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/vts/ReadbackVts.h similarity index 100% rename from graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h rename to graphics/composer/aidl/vts/ReadbackVts.h diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp b/graphics/composer/aidl/vts/RenderEngineVts.cpp similarity index 99% rename from graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp rename to graphics/composer/aidl/vts/RenderEngineVts.cpp index 0a55484c78..71b011cb12 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp +++ b/graphics/composer/aidl/vts/RenderEngineVts.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "include/RenderEngineVts.h" +#include "RenderEngineVts.h" #include "renderengine/impl/ExternalTexture.h" namespace aidl::android::hardware::graphics::composer3::vts { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h b/graphics/composer/aidl/vts/RenderEngineVts.h similarity index 100% rename from graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h rename to graphics/composer/aidl/vts/RenderEngineVts.h diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp b/graphics/composer/aidl/vts/VtsComposerClient.cpp similarity index 99% rename from graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp rename to graphics/composer/aidl/vts/VtsComposerClient.cpp index 468a69ddf4..2b607038fe 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/VtsComposerClient.cpp +++ b/graphics/composer/aidl/vts/VtsComposerClient.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "include/VtsComposerClient.h" +#include "VtsComposerClient.h" #include #include #include diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h b/graphics/composer/aidl/vts/VtsComposerClient.h similarity index 100% rename from graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h rename to graphics/composer/aidl/vts/VtsComposerClient.h diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp similarity index 99% rename from graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp rename to graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp index 8f88bfccc7..f75af85300 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -20,22 +20,22 @@ #include #include #include -#include -#include #include #include #include #include #include #include +#include "GraphicsComposerCallback.h" +#include "ReadbackVts.h" +#include "RenderEngineVts.h" +#include "VtsComposerClient.h" // tinyxml2 does implicit conversions >:( #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wconversion" #include #pragma clang diagnostic pop -#include "composer-vts/include/GraphicsComposerCallback.h" -#include "composer-vts/include/VtsComposerClient.h" namespace aidl::android::hardware::graphics::composer3::vts { namespace { diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp similarity index 99% rename from graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp rename to graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 35242c2482..74a8a57e22 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -35,8 +35,8 @@ #include #include #include -#include "composer-vts/include/GraphicsComposerCallback.h" -#include "composer-vts/include/VtsComposerClient.h" +#include "GraphicsComposerCallback.h" +#include "VtsComposerClient.h" #undef LOG_TAG #define LOG_TAG "VtsHalGraphicsComposer3_TargetTest" -- GitLab From bf0bbc2db0868235d6d397d93f97943941df6513 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Wed, 9 Feb 2022 11:19:48 -0800 Subject: [PATCH 653/825] Remove concept of nits from the client target properties An earlier patch replaced white point nits with a per-layer brightness. This patch does the same for providing the brightness space of the client target relative to the display brightness. Bug: 217961164 Test: builds, boots Change-Id: I1be65f7c511fefa239305e0735637126a1cd6622 Merged-In: I1be65f7c511fefa239305e0735637126a1cd6622 --- ...aidl => ClientTargetPropertyWithBrightness.aidl} | 4 ++-- .../graphics/composer3/CommandResultPayload.aidl | 2 +- ...aidl => ClientTargetPropertyWithBrightness.aidl} | 6 +++--- .../graphics/composer3/CommandResultPayload.aidl | 7 ++++--- .../graphics/composer3/ComposerClientReader.h | 13 +++++++------ 5 files changed, 17 insertions(+), 15 deletions(-) rename graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/{ClientTargetPropertyWithNits.aidl => ClientTargetPropertyWithBrightness.aidl} (96%) rename graphics/composer/aidl/android/hardware/graphics/composer3/{ClientTargetPropertyWithNits.aidl => ClientTargetPropertyWithBrightness.aidl} (86%) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl similarity index 96% rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl index f0fb22eb15..c445f30bcd 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl @@ -33,8 +33,8 @@ package android.hardware.graphics.composer3; @VintfStability -parcelable ClientTargetPropertyWithNits { +parcelable ClientTargetPropertyWithBrightness { long display; android.hardware.graphics.composer3.ClientTargetProperty clientTargetProperty; - float whitePointNits; + float brightness; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl index ebbb31e59f..6892f06180 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl @@ -40,5 +40,5 @@ union CommandResultPayload { android.hardware.graphics.composer3.PresentFence presentFence; android.hardware.graphics.composer3.ReleaseFences releaseFences; android.hardware.graphics.composer3.PresentOrValidate presentOrValidateResult; - android.hardware.graphics.composer3.ClientTargetPropertyWithNits clientTargetProperty; + android.hardware.graphics.composer3.ClientTargetPropertyWithBrightness clientTargetProperty; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl similarity index 86% rename from graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl rename to graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl index 50376519d8..d9e4e16788 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl @@ -19,7 +19,7 @@ package android.hardware.graphics.composer3; import android.hardware.graphics.composer3.ClientTargetProperty; @VintfStability -parcelable ClientTargetPropertyWithNits { +parcelable ClientTargetPropertyWithBrightness { /** * The display which this commands refers to. * @see IComposer.createDisplay @@ -32,7 +32,7 @@ parcelable ClientTargetPropertyWithNits { ClientTargetProperty clientTargetProperty; /** - * The white points nits as described in CommandResultPayload.clientTargetProperty + * The brightness as described in CommandResultPayload.clientTargetProperty */ - float whitePointNits; + float brightness; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl index f2de68e025..106fd87ebd 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl @@ -17,7 +17,7 @@ package android.hardware.graphics.composer3; import android.hardware.graphics.composer3.ChangedCompositionTypes; -import android.hardware.graphics.composer3.ClientTargetPropertyWithNits; +import android.hardware.graphics.composer3.ClientTargetPropertyWithBrightness; import android.hardware.graphics.composer3.CommandError; import android.hardware.graphics.composer3.DisplayRequest; import android.hardware.graphics.composer3.PresentFence; @@ -83,12 +83,13 @@ union CommandResultPayload { PresentOrValidate presentOrValidateResult; /** - * The white point parameter describes the intended white point of the client target buffer. + * The brightness parameter describes the intended brightness space of the client target buffer. + * The brightness is in the range [0, 1], where 1 is the current brightness of the display. * When client composition blends both HDR and SDR content, the client must composite to the * brightness space as specified by the hardware composer. This is so that adjusting the real * display brightness may be applied atomically with compensating the client target output. For * instance, client-compositing a list of SDR layers requires dimming the brightness space of * the SDR buffers when an HDR layer is simultaneously device-composited. */ - ClientTargetPropertyWithNits clientTargetProperty; + ClientTargetPropertyWithBrightness clientTargetProperty; } diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h index f9e35e94e0..27dce76377 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h @@ -153,14 +153,14 @@ class ComposerClientReader { } // Get the client target properties requested by hardware composer. - ClientTargetPropertyWithNits takeClientTargetProperty(int64_t display) { + ClientTargetPropertyWithBrightness takeClientTargetProperty(int64_t display) { auto found = mReturnData.find(display); // If not found, return the default values. if (found == mReturnData.end()) { - return ClientTargetPropertyWithNits{ + return ClientTargetPropertyWithBrightness{ .clientTargetProperty = {common::PixelFormat::RGBA_8888, Dataspace::UNKNOWN}, - .whitePointNits = -1.f, + .brightness = 1.f, }; } @@ -201,7 +201,8 @@ class ComposerClientReader { data.presentOrValidateState = std::move(presentOrValidate.result); } - void parseSetClientTargetProperty(const ClientTargetPropertyWithNits&& clientTargetProperty) { + void parseSetClientTargetProperty( + const ClientTargetPropertyWithBrightness&& clientTargetProperty) { auto& data = mReturnData[clientTargetProperty.display]; data.clientTargetProperty = std::move(clientTargetProperty); } @@ -213,9 +214,9 @@ class ComposerClientReader { std::vector releasedLayers; PresentOrValidate::Result presentOrValidateState; - ClientTargetPropertyWithNits clientTargetProperty = { + ClientTargetPropertyWithBrightness clientTargetProperty = { .clientTargetProperty = {common::PixelFormat::RGBA_8888, Dataspace::UNKNOWN}, - .whitePointNits = -1.f, + .brightness = 1.f, }; }; -- GitLab From 362242f73c8552d336e412a47d7b46013eb8ac02 Mon Sep 17 00:00:00 2001 From: Avichal Rakesh Date: Tue, 8 Feb 2022 12:40:53 -0800 Subject: [PATCH 654/825] Camera: Migrate VTS tests to AIDL This CL migrates the existing camera VTS tests to AIDL Bug: 210912368 Test: Migrated all HIDL tests to AIDL Change-Id: I4da6d38105d96908684a754da73699486295da8b --- camera/provider/2.4/vts/OWNERS | 2 + camera/provider/2.4/vts/functional/Android.bp | 6 +- camera/provider/aidl/vts/Android.bp | 75 + camera/provider/aidl/vts/AndroidTest.xml | 33 + camera/provider/aidl/vts/OWNERS | 6 + .../VtsAidlHalCameraProvider_TargetTest.cpp | 3010 +++++++++++++++++ camera/provider/aidl/vts/camera_aidl_test.cpp | 2924 ++++++++++++++++ camera/provider/aidl/vts/camera_aidl_test.h | 528 +++ camera/provider/aidl/vts/device_cb.cpp | 544 +++ camera/provider/aidl/vts/device_cb.h | 82 + camera/provider/aidl/vts/empty_device_cb.cpp | 43 + camera/provider/aidl/vts/empty_device_cb.h | 38 + camera/provider/aidl/vts/simple_device_cb.cpp | 36 + camera/provider/aidl/vts/simple_device_cb.h | 41 + .../provider/aidl/vts/torch_provider_cb.cpp | 40 + camera/provider/aidl/vts/torch_provider_cb.h | 44 + 16 files changed, 7451 insertions(+), 1 deletion(-) create mode 100644 camera/provider/aidl/vts/Android.bp create mode 100644 camera/provider/aidl/vts/AndroidTest.xml create mode 100644 camera/provider/aidl/vts/OWNERS create mode 100644 camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp create mode 100644 camera/provider/aidl/vts/camera_aidl_test.cpp create mode 100644 camera/provider/aidl/vts/camera_aidl_test.h create mode 100644 camera/provider/aidl/vts/device_cb.cpp create mode 100644 camera/provider/aidl/vts/device_cb.h create mode 100644 camera/provider/aidl/vts/empty_device_cb.cpp create mode 100644 camera/provider/aidl/vts/empty_device_cb.h create mode 100644 camera/provider/aidl/vts/simple_device_cb.cpp create mode 100644 camera/provider/aidl/vts/simple_device_cb.h create mode 100644 camera/provider/aidl/vts/torch_provider_cb.cpp create mode 100644 camera/provider/aidl/vts/torch_provider_cb.h diff --git a/camera/provider/2.4/vts/OWNERS b/camera/provider/2.4/vts/OWNERS index b8f6b048d2..eb4f0e4b6c 100644 --- a/camera/provider/2.4/vts/OWNERS +++ b/camera/provider/2.4/vts/OWNERS @@ -1,3 +1,5 @@ +# Bug component: 41727 + # Camera team include platform/frameworks/av:/camera/OWNERS diff --git a/camera/provider/2.4/vts/functional/Android.bp b/camera/provider/2.4/vts/functional/Android.bp index 0e622655df..17fbdfe9b8 100644 --- a/camera/provider/2.4/vts/functional/Android.bp +++ b/camera/provider/2.4/vts/functional/Android.bp @@ -65,5 +65,9 @@ cc_test { "libhidlmemory", "libgralloctypes", ], - test_suites: ["general-tests", "vts"], + test_suites: [ + "general-tests", + "vts", + ], + } diff --git a/camera/provider/aidl/vts/Android.bp b/camera/provider/aidl/vts/Android.bp new file mode 100644 index 0000000000..727ef03e72 --- /dev/null +++ b/camera/provider/aidl/vts/Android.bp @@ -0,0 +1,75 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // 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: "VtsAidlHalCameraProvider_TargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: [ + "camera_aidl_test.cpp", + "device_cb.cpp", + "empty_device_cb.cpp", + "simple_device_cb.cpp", + "torch_provider_cb.cpp", + "VtsAidlHalCameraProvider_TargetTest.cpp", + ], + + // TODO(b/64437680): Assume these are always available on the device. + shared_libs: [ + "libbinder_ndk", + "libcamera_metadata", + "libcutils", + "libfmq", + "libgui", + "libui", + "libbase", + "android.hardware.common-V2-ndk", + "android.hardware.common.fmq-V1-ndk", + "android.hardware.graphics.mapper@2.0", + "android.hardware.graphics.mapper@3.0", + "android.hardware.graphics.mapper@4.0", + ], + + // 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-V1-ndk", + "android.hardware.camera.metadata-V1-ndk", + "android.hardware.camera.provider-V1-ndk", + "android.hardware.graphics.common-V3-ndk", + "android.hidl.allocator@1.0", + "libgrallocusage", + "libhidlmemory", + "libgralloctypes", + "libaidlcommonsupport", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/camera/provider/aidl/vts/AndroidTest.xml b/camera/provider/aidl/vts/AndroidTest.xml new file mode 100644 index 0000000000..226121da74 --- /dev/null +++ b/camera/provider/aidl/vts/AndroidTest.xml @@ -0,0 +1,33 @@ + + + + \ No newline at end of file diff --git a/camera/provider/aidl/vts/OWNERS b/camera/provider/aidl/vts/OWNERS new file mode 100644 index 0000000000..27d370bcbe --- /dev/null +++ b/camera/provider/aidl/vts/OWNERS @@ -0,0 +1,6 @@ +# Camera team +include platform/frameworks/av:/camera/OWNERS + +# VTS team +yim@google.com +zhuoyao@google.com \ No newline at end of file diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp new file mode 100644 index 0000000000..3da89e2237 --- /dev/null +++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp @@ -0,0 +1,3010 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using ::aidl::android::hardware::camera::common::CameraDeviceStatus; +using ::aidl::android::hardware::camera::common::CameraResourceCost; +using ::aidl::android::hardware::camera::common::TorchModeStatus; +using ::aidl::android::hardware::camera::common::VendorTagSection; +using ::aidl::android::hardware::camera::device::ICameraDevice; +using ::aidl::android::hardware::camera::metadata::SensorPixelMode; +using ::aidl::android::hardware::camera::provider::CameraIdAndStreamCombination; +using ::aidl::android::hardware::camera::provider::ICameraProviderCallbackDefault; + +using ::ndk::ScopedAStatus; + +namespace { +const int32_t kBurstFrameCount = 10; +const uint32_t kMaxStillWidth = 2048; +const uint32_t kMaxStillHeight = 1536; + +const int64_t kEmptyFlushTimeoutMSec = 200; + +const static std::vector kMandatoryUseCases = { + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL}; +} // namespace + +TEST_P(CameraAidlTest, getCameraIdList) { + std::vector idList; + ScopedAStatus ret = mProvider->getCameraIdList(&idList); + ASSERT_TRUE(ret.isOk()); + + for (size_t i = 0; i < idList.size(); i++) { + ALOGI("Camera Id[%zu] is %s", i, idList[i].c_str()); + } +} + +// Test if ICameraProvider::getVendorTags returns Status::OK +TEST_P(CameraAidlTest, getVendorTags) { + std::vector vendorTags; + ScopedAStatus ret = mProvider->getVendorTags(&vendorTags); + + ASSERT_TRUE(ret.isOk()); + for (size_t i = 0; i < vendorTags.size(); i++) { + ALOGI("Vendor tag section %zu name %s", i, vendorTags[i].sectionName.c_str()); + for (auto& tag : vendorTags[i].tags) { + ALOGI("Vendor tag id %u name %s type %d", tag.tagId, tag.tagName.c_str(), + (int)tag.tagType); + } + } +} + +// Test if ICameraProvider::setCallback returns Status::OK +TEST_P(CameraAidlTest, setCallback) { + struct ProviderCb : public ICameraProviderCallbackDefault { + ScopedAStatus cameraDeviceStatusChange(const std::string& cameraDeviceName, + CameraDeviceStatus newStatus) override { + ALOGI("camera device status callback name %s, status %d", cameraDeviceName.c_str(), + (int)newStatus); + return ScopedAStatus::ok(); + } + ScopedAStatus torchModeStatusChange(const std::string& cameraDeviceName, + TorchModeStatus newStatus) override { + ALOGI("Torch mode status callback name %s, status %d", cameraDeviceName.c_str(), + (int)newStatus); + return ScopedAStatus::ok(); + } + ScopedAStatus physicalCameraDeviceStatusChange(const std::string& cameraDeviceName, + const std::string& physicalCameraDeviceName, + CameraDeviceStatus newStatus) override { + ALOGI("physical camera device status callback name %s, physical camera name %s," + " status %d", + cameraDeviceName.c_str(), physicalCameraDeviceName.c_str(), (int)newStatus); + return ScopedAStatus::ok(); + } + }; + + std::shared_ptr cb = ProviderCb::make(); + ScopedAStatus ret = mProvider->setCallback(cb); + ASSERT_TRUE(ret.isOk()); + ret = mProvider->setCallback(nullptr); + ASSERT_TRUE(ret.isOk()); +} + +// Test if ICameraProvider::getCameraDeviceInterface returns Status::OK and non-null device +TEST_P(CameraAidlTest, getCameraDeviceInterface) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + + for (const auto& name : cameraDeviceNames) { + std::shared_ptr cameraDevice; + ScopedAStatus ret = mProvider->getCameraDeviceInterface(name, &cameraDevice); + ALOGI("getCameraDeviceInterface returns: %d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(cameraDevice, nullptr); + } +} + +// Verify that the device resource cost can be retrieved and the values are +// correct. +TEST_P(CameraAidlTest, getResourceCost) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + + for (const auto& deviceName : cameraDeviceNames) { + std::shared_ptr cameraDevice; + ScopedAStatus ret = mProvider->getCameraDeviceInterface(deviceName, &cameraDevice); + ALOGI("getCameraDeviceInterface returns: %d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(cameraDevice, nullptr); + + CameraResourceCost resourceCost; + ret = cameraDevice->getResourceCost(&resourceCost); + ALOGI("getResourceCost returns: %d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + + ALOGI(" Resource cost is %d", resourceCost.resourceCost); + ASSERT_LE(resourceCost.resourceCost, 100u); + + for (const auto& name : resourceCost.conflictingDevices) { + ALOGI(" Conflicting device: %s", name.c_str()); + } + } +} + +TEST_P(CameraAidlTest, systemCameraTest) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::map> hiddenPhysicalIdToLogicalMap; + for (const auto& name : cameraDeviceNames) { + std::shared_ptr device; + ALOGI("getCameraCharacteristics: Testing camera device %s", name.c_str()); + ndk::ScopedAStatus ret = mProvider->getCameraDeviceInterface(name, &device); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(device, nullptr); + + CameraMetadata cameraCharacteristics; + ret = device->getCameraCharacteristics(&cameraCharacteristics); + ASSERT_TRUE(ret.isOk()); + + const camera_metadata_t* staticMeta = + reinterpret_cast(cameraCharacteristics.metadata.data()); + Status rc = isLogicalMultiCamera(staticMeta); + if (rc == Status::OPERATION_NOT_SUPPORTED) { + return; + } + + ASSERT_EQ(rc, Status::OK); + std::unordered_set physicalIds; + ASSERT_EQ(getPhysicalCameraIds(staticMeta, &physicalIds), Status::OK); + SystemCameraKind systemCameraKind = SystemCameraKind::PUBLIC; + Status retStatus = getSystemCameraKind(staticMeta, &systemCameraKind); + ASSERT_EQ(retStatus, Status::OK); + + for (auto physicalId : physicalIds) { + bool isPublicId = false; + for (auto& deviceName : cameraDeviceNames) { + std::string publicVersion, publicId; + ASSERT_TRUE(matchDeviceName(deviceName, mProviderType, &publicVersion, &publicId)); + if (physicalId == publicId) { + isPublicId = true; + break; + } + } + // For hidden physical cameras, collect their associated logical cameras + // and store the system camera kind. + if (!isPublicId) { + auto it = hiddenPhysicalIdToLogicalMap.find(physicalId); + if (it == hiddenPhysicalIdToLogicalMap.end()) { + hiddenPhysicalIdToLogicalMap.insert(std::make_pair( + physicalId, std::vector(systemCameraKind))); + } else { + it->second.push_back(systemCameraKind); + } + } + } + } + + // Check that the system camera kind of the logical cameras associated with + // each hidden physical camera is the same. + for (const auto& it : hiddenPhysicalIdToLogicalMap) { + SystemCameraKind neededSystemCameraKind = it.second.front(); + for (auto foundSystemCamera : it.second) { + ASSERT_EQ(neededSystemCameraKind, foundSystemCamera); + } + } +} + +// Verify that the static camera characteristics can be retrieved +// successfully. +TEST_P(CameraAidlTest, getCameraCharacteristics) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + + for (const auto& name : cameraDeviceNames) { + std::shared_ptr device; + ALOGI("getCameraCharacteristics: Testing camera device %s", name.c_str()); + ndk::ScopedAStatus ret = mProvider->getCameraDeviceInterface(name, &device); + ALOGI("getCameraDeviceInterface returns: %d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(device, nullptr); + + CameraMetadata chars; + ret = device->getCameraCharacteristics(&chars); + ASSERT_TRUE(ret.isOk()); + verifyCameraCharacteristics(chars); + verifyMonochromeCharacteristics(chars); + verifyRecommendedConfigs(chars); + verifyLogicalOrUltraHighResCameraMetadata(name, device, chars, cameraDeviceNames); + + ASSERT_TRUE(ret.isOk()); + + // getPhysicalCameraCharacteristics will fail for publicly + // advertised camera IDs. + std::string version, cameraId; + ASSERT_TRUE(matchDeviceName(name, mProviderType, &version, &cameraId)); + CameraMetadata devChars; + ret = device->getPhysicalCameraCharacteristics(cameraId, &devChars); + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), ret.getServiceSpecificError()); + ASSERT_EQ(0, devChars.metadata.size()); + } +} + +// Verify that the torch strength level can be set and retrieved successfully. +TEST_P(CameraAidlTest, turnOnTorchWithStrengthLevel) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + + std::shared_ptr cb = ndk::SharedRefBase::make(this); + ndk::ScopedAStatus ret = mProvider->setCallback(cb); + ASSERT_TRUE(ret.isOk()); + + for (const auto& name : cameraDeviceNames) { + int32_t defaultLevel; + std::shared_ptr device; + ALOGI("%s: Testing camera device %s", __FUNCTION__, name.c_str()); + + ret = mProvider->getCameraDeviceInterface(name, &device); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(device, nullptr); + + CameraMetadata chars; + ret = device->getCameraCharacteristics(&chars); + ASSERT_TRUE(ret.isOk()); + + const camera_metadata_t* staticMeta = + reinterpret_cast(chars.metadata.data()); + bool torchStrengthControlSupported = isTorchStrengthControlSupported(staticMeta); + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry(staticMeta, + ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL, &entry); + if (torchStrengthControlSupported) { + ASSERT_EQ(rc, 0); + ASSERT_GT(entry.count, 0); + defaultLevel = *entry.data.i32; + ALOGI("Default level is:%d", defaultLevel); + } + + mTorchStatus = TorchModeStatus::NOT_AVAILABLE; + ret = device->turnOnTorchWithStrengthLevel(2); + ALOGI("turnOnTorchWithStrengthLevel returns status: %d", ret.getServiceSpecificError()); + // OPERATION_NOT_SUPPORTED check + if (!torchStrengthControlSupported) { + ALOGI("Torch strength control not supported."); + ASSERT_EQ(static_cast(Status::OPERATION_NOT_SUPPORTED), + ret.getServiceSpecificError()); + } else { + { + ASSERT_TRUE(ret.isOk()); + std::unique_lock l(mTorchLock); + while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kTorchTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l, timeout)); + } + ASSERT_EQ(TorchModeStatus::AVAILABLE_ON, mTorchStatus); + mTorchStatus = TorchModeStatus::NOT_AVAILABLE; + } + ALOGI("getTorchStrengthLevel: Testing"); + int32_t strengthLevel; + ret = device->getTorchStrengthLevel(&strengthLevel); + ASSERT_TRUE(ret.isOk()); + ALOGI("Torch strength level is : %d", strengthLevel); + ASSERT_EQ(strengthLevel, 2); + + // Turn OFF the torch and verify torch strength level is reset to default level. + ALOGI("Testing torch strength level reset after turning the torch OFF."); + ret = device->setTorchMode(false); + ASSERT_TRUE(ret.isOk()); + { + std::unique_lock l(mTorchLock); + while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kTorchTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l, timeout)); + } + ASSERT_EQ(TorchModeStatus::AVAILABLE_OFF, mTorchStatus); + } + + ret = device->getTorchStrengthLevel(&strengthLevel); + ASSERT_TRUE(ret.isOk()); + ALOGI("Torch strength level after turning OFF torch is : %d", strengthLevel); + ASSERT_EQ(strengthLevel, defaultLevel); + } + } +} + +// In case it is supported verify that torch can be enabled. +// Check for corresponding torch callbacks as well. +TEST_P(CameraAidlTest, setTorchMode) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + + std::shared_ptr cb = ndk::SharedRefBase::make(this); + ndk::ScopedAStatus ret = mProvider->setCallback(cb); + ALOGI("setCallback returns status: %d", ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(cb, nullptr); + + for (const auto& name : cameraDeviceNames) { + std::shared_ptr device; + ALOGI("setTorchMode: Testing camera device %s", name.c_str()); + ret = mProvider->getCameraDeviceInterface(name, &device); + ALOGI("getCameraDeviceInterface returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(device, nullptr); + + CameraMetadata metadata; + ret = device->getCameraCharacteristics(&metadata); + ALOGI("getCameraCharacteristics returns status:%d", ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + camera_metadata_t* staticMeta = + reinterpret_cast(metadata.metadata.data()); + bool torchSupported = isTorchSupported(staticMeta); + + mTorchStatus = TorchModeStatus::NOT_AVAILABLE; + ret = device->setTorchMode(true); + ALOGI("setTorchMode returns status: %d", ret.getServiceSpecificError()); + if (!torchSupported) { + ASSERT_EQ(static_cast(Status::OPERATION_NOT_SUPPORTED), + ret.getServiceSpecificError()); + } else { + ASSERT_TRUE(ret.isOk()); + { + std::unique_lock l(mTorchLock); + while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kTorchTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l, timeout)); + } + ASSERT_EQ(TorchModeStatus::AVAILABLE_ON, mTorchStatus); + mTorchStatus = TorchModeStatus::NOT_AVAILABLE; + } + + ret = device->setTorchMode(false); + ASSERT_TRUE(ret.isOk()); + { + std::unique_lock l(mTorchLock); + while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kTorchTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l, timeout)); + } + ASSERT_EQ(TorchModeStatus::AVAILABLE_OFF, mTorchStatus); + } + } + } + + ret = mProvider->setCallback(nullptr); + ASSERT_TRUE(ret.isOk()); +} + +// Check dump functionality. +TEST_P(CameraAidlTest, dump) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + + for (const auto& name : cameraDeviceNames) { + std::shared_ptr device; + ALOGI("dump: Testing camera device %s", name.c_str()); + + ndk::ScopedAStatus ret = mProvider->getCameraDeviceInterface(name, &device); + ALOGI("getCameraDeviceInterface returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(device, nullptr); + + int raw_handle = open(kDumpOutput, O_RDWR); + ASSERT_GE(raw_handle, 0); + + auto retStatus = device->dump(raw_handle, nullptr, 0); + ASSERT_EQ(retStatus, ::android::OK); + close(raw_handle); + } +} + +// Open, dump, then close +TEST_P(CameraAidlTest, openClose) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + + for (const auto& name : cameraDeviceNames) { + std::shared_ptr device; + ALOGI("openClose: Testing camera device %s", name.c_str()); + ndk::ScopedAStatus ret = mProvider->getCameraDeviceInterface(name, &device); + ALOGI("getCameraDeviceInterface returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(device, nullptr); + + std::shared_ptr cb = ndk::SharedRefBase::make(); + + ret = device->open(cb, &mSession); + ASSERT_TRUE(ret.isOk()); + ALOGI("device::open returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_NE(mSession, nullptr); + int raw_handle = open(kDumpOutput, O_RDWR); + ASSERT_GE(raw_handle, 0); + + auto retStatus = device->dump(raw_handle, nullptr, 0); + ASSERT_EQ(retStatus, ::android::OK); + close(raw_handle); + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + // TODO: test all session API calls return INTERNAL_ERROR after close + // TODO: keep a wp copy here and verify session cannot be promoted out of this scope + } +} + +// Check whether all common default request settings can be successfully +// constructed. +TEST_P(CameraAidlTest, constructDefaultRequestSettings) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + + for (const auto& name : cameraDeviceNames) { + std::shared_ptr device; + ALOGI("constructDefaultRequestSettings: Testing camera device %s", name.c_str()); + ndk::ScopedAStatus ret = mProvider->getCameraDeviceInterface(name, &device); + ALOGI("getCameraDeviceInterface returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(device, nullptr); + + std::shared_ptr cb = ndk::SharedRefBase::make(); + ret = device->open(cb, &mSession); + ALOGI("device::open returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(mSession, nullptr); + + for (int32_t t = (int32_t)RequestTemplate::PREVIEW; t <= (int32_t)RequestTemplate::MANUAL; + t++) { + RequestTemplate reqTemplate = (RequestTemplate)t; + CameraMetadata rawMetadata; + ret = mSession->constructDefaultRequestSettings(reqTemplate, &rawMetadata); + ALOGI("constructDefaultRequestSettings returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + if (reqTemplate == RequestTemplate::ZERO_SHUTTER_LAG || + reqTemplate == RequestTemplate::MANUAL) { + // optional templates + ASSERT_TRUE(ret.isOk() || static_cast(Status::ILLEGAL_ARGUMENT) == + ret.getServiceSpecificError()); + } else { + ASSERT_TRUE(ret.isOk()); + } + + if (ret.isOk()) { + const camera_metadata_t* metadata = (camera_metadata_t*)rawMetadata.metadata.data(); + size_t expectedSize = rawMetadata.metadata.size(); + int result = validate_camera_metadata_structure(metadata, &expectedSize); + ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED)); + verifyRequestTemplate(metadata, reqTemplate); + } else { + ASSERT_EQ(0u, rawMetadata.metadata.size()); + } + } + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +// Verify that all supported stream formats and sizes can be configured +// successfully. +TEST_P(CameraAidlTest, configureStreamsAvailableOutputs) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::vector outputStreams; + + for (const auto& name : cameraDeviceNames) { + CameraMetadata meta; + std::shared_ptr device; + + openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/, &device /*out*/); + + camera_metadata_t* staticMeta = reinterpret_cast(meta.metadata.data()); + outputStreams.clear(); + ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputStreams)); + ASSERT_NE(0u, outputStreams.size()); + + int32_t jpegBufferSize = 0; + ASSERT_EQ(Status::OK, getJpegBufferSize(staticMeta, &jpegBufferSize)); + ASSERT_NE(0u, jpegBufferSize); + + int32_t streamId = 0; + int32_t streamConfigCounter = 0; + for (auto& it : outputStreams) { + Stream stream; + Dataspace dataspace = getDataspace(static_cast(it.format)); + stream.id = streamId; + stream.streamType = StreamType::OUTPUT; + stream.width = it.width; + stream.height = it.height; + stream.format = static_cast(it.format); + stream.dataSpace = dataspace; + stream.usage = static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER); + stream.rotation = StreamRotation::ROTATION_0; + + std::vector streams = {stream}; + StreamConfiguration config; + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, + jpegBufferSize); + + bool expectStreamCombQuery = (isLogicalMultiCamera(staticMeta) == Status::OK); + verifyStreamCombination(device, config, /*expectedStatus*/ true, expectStreamCombQuery); + + config.streamConfigCounter = streamConfigCounter++; + std::vector halConfigs; + ndk::ScopedAStatus ret = mSession->configureStreams(config, &halConfigs); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(halConfigs.size(), 1); + ASSERT_EQ(halConfigs[0].id, streamId); + + streamId++; + } + + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +// Verify that mandatory concurrent streams and outputs are supported. +TEST_P(CameraAidlTest, configureConcurrentStreamsAvailableOutputs) { + struct CameraTestInfo { + CameraMetadata staticMeta; + std::shared_ptr session; + std::shared_ptr cameraDevice; + StreamConfiguration config; + }; + + std::map idToNameMap = getCameraDeviceIdToNameMap(mProvider); + std::vector concurrentDeviceCombinations = + getConcurrentDeviceCombinations(mProvider); + std::vector outputStreams; + for (const auto& cameraDeviceIds : concurrentDeviceCombinations) { + std::vector cameraIdsAndStreamCombinations; + std::vector cameraTestInfos; + size_t i = 0; + for (const auto& id : cameraDeviceIds.combination) { + CameraTestInfo cti; + auto it = idToNameMap.find(id); + ASSERT_TRUE(idToNameMap.end() != it); + std::string name = it->second; + + openEmptyDeviceSession(name, mProvider, &cti.session /*out*/, &cti.staticMeta /*out*/, + &cti.cameraDevice /*out*/); + + outputStreams.clear(); + camera_metadata_t* staticMeta = + reinterpret_cast(cti.staticMeta.metadata.data()); + ASSERT_EQ(Status::OK, getMandatoryConcurrentStreams(staticMeta, &outputStreams)); + ASSERT_NE(0u, outputStreams.size()); + + int32_t jpegBufferSize = 0; + ASSERT_EQ(Status::OK, getJpegBufferSize(staticMeta, &jpegBufferSize)); + ASSERT_NE(0u, jpegBufferSize); + + int32_t streamId = 0; + std::vector streams(outputStreams.size()); + size_t j = 0; + for (const auto& s : outputStreams) { + Stream stream; + Dataspace dataspace = getDataspace(static_cast(s.format)); + stream.id = streamId++; + stream.streamType = StreamType::OUTPUT; + stream.width = s.width; + stream.height = s.height; + stream.format = static_cast(s.format); + stream.usage = static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER); + stream.dataSpace = dataspace; + stream.rotation = StreamRotation::ROTATION_0; + stream.sensorPixelModesUsed = {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}; + streams[j] = stream; + j++; + } + + // Add the created stream configs to cameraIdsAndStreamCombinations + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &cti.config, + jpegBufferSize); + + cti.config.streamConfigCounter = outputStreams.size(); + CameraIdAndStreamCombination cameraIdAndStreamCombination; + cameraIdAndStreamCombination.cameraId = id; + cameraIdAndStreamCombination.streamConfiguration = cti.config; + cameraIdsAndStreamCombinations.push_back(cameraIdAndStreamCombination); + i++; + cameraTestInfos.push_back(cti); + } + // Now verify that concurrent streams are supported + bool combinationSupported; + ndk::ScopedAStatus ret = mProvider->isConcurrentStreamCombinationSupported( + cameraIdsAndStreamCombinations, &combinationSupported); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(combinationSupported, true); + + // Test the stream can actually be configured + for (auto& cti : cameraTestInfos) { + if (cti.session != nullptr) { + camera_metadata_t* staticMeta = + reinterpret_cast(cti.staticMeta.metadata.data()); + bool expectStreamCombQuery = (isLogicalMultiCamera(staticMeta) == Status::OK); + verifyStreamCombination(cti.cameraDevice, cti.config, /*expectedStatus*/ true, + expectStreamCombQuery); + } + + if (cti.session != nullptr) { + std::vector streamConfigs; + ret = cti.session->configureStreams(cti.config, &streamConfigs); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(cti.config.streams.size(), streamConfigs.size()); + } + } + + for (auto& cti : cameraTestInfos) { + ret = cti.session->close(); + ASSERT_TRUE(ret.isOk()); + } + } +} + +// Check for correct handling of invalid/incorrect configuration parameters. +TEST_P(CameraAidlTest, configureStreamsInvalidOutputs) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::vector outputStreams; + + for (const auto& name : cameraDeviceNames) { + CameraMetadata meta; + std::shared_ptr cameraDevice; + + openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/, + &cameraDevice /*out*/); + camera_metadata_t* staticMeta = reinterpret_cast(meta.metadata.data()); + outputStreams.clear(); + + ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputStreams)); + ASSERT_NE(0u, outputStreams.size()); + + int32_t jpegBufferSize = 0; + ASSERT_EQ(Status::OK, getJpegBufferSize(staticMeta, &jpegBufferSize)); + ASSERT_NE(0u, jpegBufferSize); + + int32_t streamId = 0; + Stream stream = {streamId++, + StreamType::OUTPUT, + static_cast(0), + static_cast(0), + static_cast(outputStreams[0].format), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + jpegBufferSize, + -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + int32_t streamConfigCounter = 0; + std::vector streams = {stream}; + StreamConfiguration config; + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, + jpegBufferSize); + + verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ false, + /*expectStreamCombQuery*/ false); + + config.streamConfigCounter = streamConfigCounter++; + std::vector halConfigs; + ndk::ScopedAStatus ret = mSession->configureStreams(config, &halConfigs); + ASSERT_TRUE(static_cast(Status::ILLEGAL_ARGUMENT) == + ret.getServiceSpecificError() || + static_cast(Status::INTERNAL_ERROR) == ret.getServiceSpecificError()); + + stream = {streamId++, + StreamType::OUTPUT, + /*width*/ INT32_MAX, + /*height*/ INT32_MAX, + static_cast(outputStreams[0].format), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + jpegBufferSize, + -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + + streams[0] = stream; + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, + jpegBufferSize); + + config.streamConfigCounter = streamConfigCounter++; + halConfigs.clear(); + ret = mSession->configureStreams(config, &halConfigs); + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), ret.getServiceSpecificError()); + + for (auto& it : outputStreams) { + stream = {streamId++, + StreamType::OUTPUT, + it.width, + it.height, + static_cast(UINT32_MAX), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + jpegBufferSize, + -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + + streams[0] = stream; + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, + jpegBufferSize); + config.streamConfigCounter = streamConfigCounter++; + halConfigs.clear(); + ret = mSession->configureStreams(config, &halConfigs); + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), + ret.getServiceSpecificError()); + + stream = {streamId++, + StreamType::OUTPUT, + it.width, + it.height, + static_cast(it.format), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + Dataspace::UNKNOWN, + static_cast(UINT32_MAX), + std::string(), + jpegBufferSize, + -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + + streams[0] = stream; + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, + jpegBufferSize); + + config.streamConfigCounter = streamConfigCounter++; + halConfigs.clear(); + ret = mSession->configureStreams(config, &halConfigs); + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), + ret.getServiceSpecificError()); + } + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +// Check whether all supported ZSL output stream combinations can be +// configured successfully. +TEST_P(CameraAidlTest, configureStreamsZSLInputOutputs) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::vector inputStreams; + std::vector inputOutputMap; + + for (const auto& name : cameraDeviceNames) { + CameraMetadata meta; + std::shared_ptr cameraDevice; + + openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/, + &cameraDevice /*out*/); + camera_metadata_t* staticMeta = reinterpret_cast(meta.metadata.data()); + + Status rc = isZSLModeAvailable(staticMeta); + if (Status::OPERATION_NOT_SUPPORTED == rc) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + ASSERT_EQ(Status::OK, rc); + + inputStreams.clear(); + ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, inputStreams)); + ASSERT_NE(0u, inputStreams.size()); + + inputOutputMap.clear(); + ASSERT_EQ(Status::OK, getZSLInputOutputMap(staticMeta, inputOutputMap)); + ASSERT_NE(0u, inputOutputMap.size()); + + bool supportMonoY8 = false; + if (Status::OK == isMonochromeCamera(staticMeta)) { + for (auto& it : inputStreams) { + if (it.format == static_cast(PixelFormat::Y8)) { + supportMonoY8 = true; + break; + } + } + } + + int32_t jpegBufferSize = 0; + ASSERT_EQ(Status::OK, getJpegBufferSize(staticMeta, &jpegBufferSize)); + ASSERT_NE(0u, jpegBufferSize); + + int32_t streamId = 0; + bool hasPrivToY8 = false, hasY8ToY8 = false, hasY8ToBlob = false; + uint32_t streamConfigCounter = 0; + for (auto& inputIter : inputOutputMap) { + AvailableStream input; + ASSERT_EQ(Status::OK, findLargestSize(inputStreams, inputIter.inputFormat, input)); + ASSERT_NE(0u, inputStreams.size()); + + if (inputIter.inputFormat == + static_cast(PixelFormat::IMPLEMENTATION_DEFINED) && + inputIter.outputFormat == static_cast(PixelFormat::Y8)) { + hasPrivToY8 = true; + } else if (inputIter.inputFormat == static_cast(PixelFormat::Y8)) { + if (inputIter.outputFormat == static_cast(PixelFormat::BLOB)) { + hasY8ToBlob = true; + } else if (inputIter.outputFormat == static_cast(PixelFormat::Y8)) { + hasY8ToY8 = true; + } + } + AvailableStream outputThreshold = {INT32_MAX, INT32_MAX, inputIter.outputFormat}; + std::vector outputStreams; + ASSERT_EQ(Status::OK, + getAvailableOutputStreams(staticMeta, outputStreams, &outputThreshold)); + for (auto& outputIter : outputStreams) { + Dataspace outputDataSpace = + getDataspace(static_cast(outputIter.format)); + Stream zslStream = { + streamId++, + StreamType::OUTPUT, + input.width, + input.height, + static_cast(input.format), + static_cast( + GRALLOC_USAGE_HW_CAMERA_ZSL), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + jpegBufferSize, + -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + Stream inputStream = { + streamId++, + StreamType::INPUT, + input.width, + input.height, + static_cast(input.format), + static_cast(0), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + jpegBufferSize, + -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + Stream outputStream = { + streamId++, + StreamType::OUTPUT, + outputIter.width, + outputIter.height, + static_cast(outputIter.format), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + outputDataSpace, + StreamRotation::ROTATION_0, + std::string(), + jpegBufferSize, + -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + + std::vector streams = {inputStream, zslStream, outputStream}; + + StreamConfiguration config; + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, + jpegBufferSize); + + verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ true, + /*expectStreamCombQuery*/ false); + + config.streamConfigCounter = streamConfigCounter++; + std::vector halConfigs; + ndk::ScopedAStatus ret = mSession->configureStreams(config, &halConfigs); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(3u, halConfigs.size()); + } + } + + if (supportMonoY8) { + if (Status::OK == isZSLModeAvailable(staticMeta, PRIV_REPROCESS)) { + ASSERT_TRUE(hasPrivToY8); + } + if (Status::OK == isZSLModeAvailable(staticMeta, YUV_REPROCESS)) { + ASSERT_TRUE(hasY8ToY8); + ASSERT_TRUE(hasY8ToBlob); + } + } + + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +// Check whether session parameters are supported. If Hal support for them +// exist, then try to configure a preview stream using them. +TEST_P(CameraAidlTest, configureStreamsWithSessionParameters) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::vector outputPreviewStreams; + AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; + + for (const auto& name : cameraDeviceNames) { + CameraMetadata meta; + + std::shared_ptr unusedCameraDevice; + openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/, + &unusedCameraDevice /*out*/); + camera_metadata_t* staticMetaBuffer = + reinterpret_cast(meta.metadata.data()); + + std::unordered_set availableSessionKeys; + auto rc = getSupportedKeys(staticMetaBuffer, ANDROID_REQUEST_AVAILABLE_SESSION_KEYS, + &availableSessionKeys); + ASSERT_TRUE(Status::OK == rc); + if (availableSessionKeys.empty()) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + + android::hardware::camera::common::V1_0::helper::CameraMetadata previewRequestSettings; + android::hardware::camera::common::V1_0::helper::CameraMetadata sessionParams, + modifiedSessionParams; + constructFilteredSettings(mSession, availableSessionKeys, RequestTemplate::PREVIEW, + &previewRequestSettings, &sessionParams); + if (sessionParams.isEmpty()) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + + outputPreviewStreams.clear(); + + ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMetaBuffer, outputPreviewStreams, + &previewThreshold)); + ASSERT_NE(0u, outputPreviewStreams.size()); + + Stream previewStream = {0, + StreamType::OUTPUT, + outputPreviewStreams[0].width, + outputPreviewStreams[0].height, + static_cast(outputPreviewStreams[0].format), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + /*bufferSize*/ 0, + /*groupId*/ -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + + std::vector streams = {previewStream}; + StreamConfiguration config; + + config.streams = streams; + config.operationMode = StreamConfigurationMode::NORMAL_MODE; + modifiedSessionParams = sessionParams; + auto sessionParamsBuffer = sessionParams.release(); + std::vector rawSessionParam = + std::vector(reinterpret_cast(sessionParamsBuffer), + reinterpret_cast(sessionParamsBuffer) + + get_camera_metadata_size(sessionParamsBuffer)); + + config.sessionParams.metadata = rawSessionParam; + config.streamConfigCounter = 0; + config.streams = {previewStream}; + config.streamConfigCounter = 0; + config.multiResolutionInputImage = false; + + bool newSessionParamsAvailable = false; + for (const auto& it : availableSessionKeys) { + if (modifiedSessionParams.exists(it)) { + modifiedSessionParams.erase(it); + newSessionParamsAvailable = true; + break; + } + } + if (newSessionParamsAvailable) { + auto modifiedSessionParamsBuffer = modifiedSessionParams.release(); + verifySessionReconfigurationQuery(mSession, sessionParamsBuffer, + modifiedSessionParamsBuffer); + modifiedSessionParams.acquire(modifiedSessionParamsBuffer); + } + + std::vector halConfigs; + ndk::ScopedAStatus ret = mSession->configureStreams(config, &halConfigs); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(1u, halConfigs.size()); + + sessionParams.acquire(sessionParamsBuffer); + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +// Verify that all supported preview + still capture stream combinations +// can be configured successfully. +TEST_P(CameraAidlTest, configureStreamsPreviewStillOutputs) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::vector outputBlobStreams; + std::vector outputPreviewStreams; + AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; + AvailableStream blobThreshold = {INT32_MAX, INT32_MAX, static_cast(PixelFormat::BLOB)}; + + for (const auto& name : cameraDeviceNames) { + CameraMetadata meta; + + std::shared_ptr cameraDevice; + openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/, + &cameraDevice /*out*/); + + camera_metadata_t* staticMeta = reinterpret_cast(meta.metadata.data()); + + // Check if camera support depth only + if (isDepthOnly(staticMeta)) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + + outputBlobStreams.clear(); + ASSERT_EQ(Status::OK, + getAvailableOutputStreams(staticMeta, outputBlobStreams, &blobThreshold)); + ASSERT_NE(0u, outputBlobStreams.size()); + + outputPreviewStreams.clear(); + ASSERT_EQ(Status::OK, + getAvailableOutputStreams(staticMeta, outputPreviewStreams, &previewThreshold)); + ASSERT_NE(0u, outputPreviewStreams.size()); + + int32_t jpegBufferSize = 0; + ASSERT_EQ(Status::OK, getJpegBufferSize(staticMeta, &jpegBufferSize)); + ASSERT_NE(0u, jpegBufferSize); + + int32_t streamId = 0; + uint32_t streamConfigCounter = 0; + + for (auto& blobIter : outputBlobStreams) { + for (auto& previewIter : outputPreviewStreams) { + Stream previewStream = { + streamId++, + StreamType::OUTPUT, + previewIter.width, + previewIter.height, + static_cast(previewIter.format), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + /*bufferSize*/ 0, + /*groupId*/ -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + Stream blobStream = { + streamId++, + StreamType::OUTPUT, + blobIter.width, + blobIter.height, + static_cast(blobIter.format), + static_cast( + GRALLOC1_CONSUMER_USAGE_CPU_READ), + Dataspace::JFIF, + StreamRotation::ROTATION_0, + std::string(), + /*bufferSize*/ 0, + /*groupId*/ -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + std::vector streams = {previewStream, blobStream}; + StreamConfiguration config; + + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, + jpegBufferSize); + config.streamConfigCounter = streamConfigCounter++; + verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ true, + /*expectStreamCombQuery*/ false); + + std::vector halConfigs; + ndk::ScopedAStatus ret = mSession->configureStreams(config, &halConfigs); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(2u, halConfigs.size()); + } + } + + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +// In case constrained mode is supported, test whether it can be +// configured. Additionally check for common invalid inputs when +// using this mode. +TEST_P(CameraAidlTest, configureStreamsConstrainedOutputs) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + + for (const auto& name : cameraDeviceNames) { + CameraMetadata meta; + std::shared_ptr cameraDevice; + + openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/, + &cameraDevice /*out*/); + camera_metadata_t* staticMeta = reinterpret_cast(meta.metadata.data()); + + Status rc = isConstrainedModeAvailable(staticMeta); + if (Status::OPERATION_NOT_SUPPORTED == rc) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + ASSERT_EQ(Status::OK, rc); + + AvailableStream hfrStream; + rc = pickConstrainedModeSize(staticMeta, hfrStream); + ASSERT_EQ(Status::OK, rc); + + int32_t streamId = 0; + uint32_t streamConfigCounter = 0; + Stream stream = {streamId, + StreamType::OUTPUT, + hfrStream.width, + hfrStream.height, + static_cast(hfrStream.format), + static_cast( + GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + /*bufferSize*/ 0, + /*groupId*/ -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + std::vector streams = {stream}; + StreamConfiguration config; + createStreamConfiguration(streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE, + &config); + + verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ true, + /*expectStreamCombQuery*/ false); + + config.streamConfigCounter = streamConfigCounter++; + std::vector halConfigs; + ndk::ScopedAStatus ret = mSession->configureStreams(config, &halConfigs); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(1u, halConfigs.size()); + ASSERT_EQ(halConfigs[0].id, streamId); + + stream = {streamId++, + StreamType::OUTPUT, + static_cast(0), + static_cast(0), + static_cast(hfrStream.format), + static_cast( + GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + /*bufferSize*/ 0, + /*groupId*/ -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + streams[0] = stream; + createStreamConfiguration(streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE, + &config); + + config.streamConfigCounter = streamConfigCounter++; + std::vector halConfig; + ret = mSession->configureStreams(config, &halConfig); + ASSERT_TRUE(static_cast(Status::ILLEGAL_ARGUMENT) == + ret.getServiceSpecificError() || + static_cast(Status::INTERNAL_ERROR) == ret.getServiceSpecificError()); + + stream = {streamId++, + StreamType::OUTPUT, + INT32_MAX, + INT32_MAX, + static_cast(hfrStream.format), + static_cast( + GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + /*bufferSize*/ 0, + /*groupId*/ -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + streams[0] = stream; + createStreamConfiguration(streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE, + &config); + + config.streamConfigCounter = streamConfigCounter++; + halConfigs.clear(); + ret = mSession->configureStreams(config, &halConfigs); + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), ret.getServiceSpecificError()); + + stream = {streamId++, + StreamType::OUTPUT, + hfrStream.width, + hfrStream.height, + static_cast(UINT32_MAX), + static_cast( + GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + /*bufferSize*/ 0, + /*groupId*/ -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + streams[0] = stream; + createStreamConfiguration(streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE, + &config); + + config.streamConfigCounter = streamConfigCounter++; + halConfigs.clear(); + ret = mSession->configureStreams(config, &halConfigs); + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), ret.getServiceSpecificError()); + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +// Verify that all supported video + snapshot stream combinations can +// be configured successfully. +TEST_P(CameraAidlTest, configureStreamsVideoStillOutputs) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::vector outputBlobStreams; + std::vector outputVideoStreams; + AvailableStream videoThreshold = {kMaxVideoWidth, kMaxVideoHeight, + static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; + AvailableStream blobThreshold = {kMaxVideoWidth, kMaxVideoHeight, + static_cast(PixelFormat::BLOB)}; + + for (const auto& name : cameraDeviceNames) { + CameraMetadata meta; + std::shared_ptr cameraDevice; + + openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/, + &cameraDevice /*out*/); + + camera_metadata_t* staticMeta = reinterpret_cast(meta.metadata.data()); + + // Check if camera support depth only + if (isDepthOnly(staticMeta)) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + + outputBlobStreams.clear(); + ASSERT_EQ(Status::OK, + getAvailableOutputStreams(staticMeta, outputBlobStreams, &blobThreshold)); + ASSERT_NE(0u, outputBlobStreams.size()); + + outputVideoStreams.clear(); + ASSERT_EQ(Status::OK, + getAvailableOutputStreams(staticMeta, outputVideoStreams, &videoThreshold)); + ASSERT_NE(0u, outputVideoStreams.size()); + + int32_t jpegBufferSize = 0; + ASSERT_EQ(Status::OK, getJpegBufferSize(staticMeta, &jpegBufferSize)); + ASSERT_NE(0u, jpegBufferSize); + + int32_t streamId = 0; + uint32_t streamConfigCounter = 0; + for (auto& blobIter : outputBlobStreams) { + for (auto& videoIter : outputVideoStreams) { + Stream videoStream = { + streamId++, + StreamType::OUTPUT, + videoIter.width, + videoIter.height, + static_cast(videoIter.format), + static_cast( + GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + jpegBufferSize, + /*groupId*/ -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + Stream blobStream = { + streamId++, + StreamType::OUTPUT, + blobIter.width, + blobIter.height, + static_cast(blobIter.format), + static_cast( + GRALLOC1_CONSUMER_USAGE_CPU_READ), + Dataspace::JFIF, + StreamRotation::ROTATION_0, + std::string(), + jpegBufferSize, + /*groupId*/ -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + std::vector streams = {videoStream, blobStream}; + StreamConfiguration config; + + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, + jpegBufferSize); + verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ true, + /*expectStreamCombQuery*/ false); + + config.streamConfigCounter = streamConfigCounter++; + std::vector halConfigs; + ndk::ScopedAStatus ret = mSession->configureStreams(config, &halConfigs); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(2u, halConfigs.size()); + } + } + + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +// Generate and verify a camera capture request +TEST_P(CameraAidlTest, processCaptureRequestPreview) { + // TODO(b/220897574): Failing with BUFFER_ERROR + processCaptureRequestInternal(GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, RequestTemplate::PREVIEW, + false /*secureOnlyCameras*/); +} + +// Generate and verify a secure camera capture request +TEST_P(CameraAidlTest, processSecureCaptureRequest) { + processCaptureRequestInternal(GRALLOC1_PRODUCER_USAGE_PROTECTED, RequestTemplate::STILL_CAPTURE, + true /*secureOnlyCameras*/); +} + +TEST_P(CameraAidlTest, processCaptureRequestPreviewStabilization) { + std::unordered_map cameraDeviceToTimeLag; + processPreviewStabilizationCaptureRequestInternal(/*previewStabilizationOn*/ false, + cameraDeviceToTimeLag); + processPreviewStabilizationCaptureRequestInternal(/*previewStabilizationOn*/ true, + cameraDeviceToTimeLag); +} + +// Generate and verify a multi-camera capture request +TEST_P(CameraAidlTest, processMultiCaptureRequestPreview) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::YCBCR_420_888)}; + int64_t bufferId = 1; + uint32_t frameNumber = 1; + std::vector settings; + std::vector emptySettings; + std::string invalidPhysicalId = "-1"; + + for (const auto& name : cameraDeviceNames) { + std::string version, deviceId; + ASSERT_TRUE(matchDeviceName(name, mProviderType, &version, &deviceId)); + CameraMetadata metadata; + + std::shared_ptr unusedDevice; + openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &metadata /*out*/, + &unusedDevice /*out*/); + + camera_metadata_t* staticMeta = + reinterpret_cast(metadata.metadata.data()); + Status rc = isLogicalMultiCamera(staticMeta); + if (Status::OPERATION_NOT_SUPPORTED == rc) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + + std::unordered_set physicalIds; + rc = getPhysicalCameraIds(staticMeta, &physicalIds); + ASSERT_TRUE(Status::OK == rc); + ASSERT_TRUE(physicalIds.size() > 1); + + std::unordered_set physicalRequestKeyIDs; + rc = getSupportedKeys(staticMeta, ANDROID_REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS, + &physicalRequestKeyIDs); + ASSERT_TRUE(Status::OK == rc); + if (physicalRequestKeyIDs.empty()) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + // The logical camera doesn't support any individual physical requests. + continue; + } + + android::hardware::camera::common::V1_0::helper::CameraMetadata defaultPreviewSettings; + android::hardware::camera::common::V1_0::helper::CameraMetadata filteredSettings; + constructFilteredSettings(mSession, physicalRequestKeyIDs, RequestTemplate::PREVIEW, + &defaultPreviewSettings, &filteredSettings); + if (filteredSettings.isEmpty()) { + // No physical device settings in default request. + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + + const camera_metadata_t* settingsBuffer = defaultPreviewSettings.getAndLock(); + uint8_t* rawSettingsBuffer = (uint8_t*)settingsBuffer; + settings.assign(rawSettingsBuffer, + rawSettingsBuffer + get_camera_metadata_size(settingsBuffer)); + CameraMetadata settingsMetadata = {settings}; + overrideRotateAndCrop(&settingsMetadata); + + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + + // Leave only 2 physical devices in the id set. + auto it = physicalIds.begin(); + std::string physicalDeviceId = *it; + it++; + physicalIds.erase(++it, physicalIds.end()); + ASSERT_EQ(physicalIds.size(), 2u); + + std::vector halStreams; + bool supportsPartialResults = false; + bool useHalBufManager = false; + int32_t partialResultCount = 0; + Stream previewStream; + std::shared_ptr cb; + + configurePreviewStreams(name, mProvider, &previewThreshold, physicalIds, &mSession, + &previewStream, &halStreams /*out*/, + &supportsPartialResults /*out*/, &partialResultCount /*out*/, + &useHalBufManager /*out*/, &cb /*out*/, 0 /*streamConfigCounter*/); + + ::aidl::android::hardware::common::fmq::MQDescriptor< + int8_t, aidl::android::hardware::common::fmq::SynchronizedReadWrite> + descriptor; + auto resultQueueRet = mSession->getCaptureResultMetadataQueue(&descriptor); + ASSERT_TRUE(resultQueueRet.isOk()); + std::shared_ptr resultQueue = + std::make_shared(descriptor); + if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) { + ALOGE("%s: HAL returns empty result metadata fmq, not use it", __func__); + resultQueue = nullptr; + // Don't use the queue onwards. + } + + std::shared_ptr inflightReq = std::make_shared( + static_cast(halStreams.size()), false, supportsPartialResults, + partialResultCount, physicalIds, resultQueue); + + std::vector requests(1); + CaptureRequest& request = requests[0]; + request.frameNumber = frameNumber; + request.fmqSettingsSize = 0; + request.settings.metadata = settings; + + std::vector& outputBuffers = request.outputBuffers; + + std::vector graphicBuffers; + graphicBuffers.reserve(halStreams.size()); + outputBuffers.resize(halStreams.size()); + size_t k = 0; + for (const auto& halStream : halStreams) { + buffer_handle_t buffer_handle; + if (useHalBufManager) { + outputBuffers[k] = {halStream.id, /*bufferId*/ 0, NativeHandle(), + BufferStatus::OK, NativeHandle(), NativeHandle()}; + } else { + allocateGraphicBuffer(previewStream.width, previewStream.height, + android_convertGralloc1To0Usage( + static_cast(halStream.producerUsage), + static_cast(halStream.consumerUsage)), + halStream.overrideFormat, &buffer_handle); + graphicBuffers.push_back(buffer_handle); + outputBuffers[k] = { + halStream.id, bufferId, ::android::makeToAidl(buffer_handle), + BufferStatus::OK, NativeHandle(), NativeHandle()}; + bufferId++; + } + k++; + } + + std::vector camSettings(1); + const camera_metadata_t* filteredSettingsBuffer = filteredSettings.getAndLock(); + uint8_t* rawFilteredSettingsBuffer = (uint8_t*)filteredSettingsBuffer; + camSettings[0].settings = {std::vector( + rawFilteredSettingsBuffer, + rawFilteredSettingsBuffer + get_camera_metadata_size(filteredSettingsBuffer))}; + overrideRotateAndCrop(&camSettings[0].settings); + camSettings[0].fmqSettingsSize = 0; + camSettings[0].physicalCameraId = physicalDeviceId; + + request.inputBuffer = { + -1, 0, NativeHandle(), BufferStatus::ERROR, NativeHandle(), NativeHandle()}; + request.physicalCameraSettings = camSettings; + + { + std::unique_lock l(mLock); + mInflightMap.clear(); + mInflightMap[frameNumber] = inflightReq; + } + + int32_t numRequestProcessed = 0; + std::vector cachesToRemove; + ndk::ScopedAStatus returnStatus = + mSession->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ASSERT_TRUE(returnStatus.isOk()); + ASSERT_EQ(numRequestProcessed, 1u); + + { + std::unique_lock l(mLock); + while (!inflightReq->errorCodeValid && + ((0 < inflightReq->numBuffersLeft) || (!inflightReq->haveResultMetadata))) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kStreamBufferTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + ASSERT_FALSE(inflightReq->errorCodeValid); + ASSERT_NE(inflightReq->resultOutputBuffers.size(), 0u); + + request.frameNumber++; + // Empty settings should be supported after the first call + // for repeating requests. + request.settings.metadata.clear(); + request.physicalCameraSettings[0].settings.metadata.clear(); + // The buffer has been registered to HAL by bufferId, so per + // API contract we should send a null handle for this buffer + request.outputBuffers[0].buffer = NativeHandle(); + mInflightMap.clear(); + inflightReq = std::make_shared( + static_cast(physicalIds.size()), false, supportsPartialResults, + partialResultCount, physicalIds, resultQueue); + mInflightMap[request.frameNumber] = inflightReq; + } + + returnStatus = + mSession->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ASSERT_TRUE(returnStatus.isOk()); + ASSERT_EQ(numRequestProcessed, 1u); + + { + std::unique_lock l(mLock); + while (!inflightReq->errorCodeValid && + ((0 < inflightReq->numBuffersLeft) || (!inflightReq->haveResultMetadata))) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kStreamBufferTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + ASSERT_FALSE(inflightReq->errorCodeValid); + ASSERT_NE(inflightReq->resultOutputBuffers.size(), 0u); + } + + // Invalid physical camera id should fail process requests + frameNumber++; + camSettings[0].physicalCameraId = invalidPhysicalId; + camSettings[0].settings.metadata = settings; + + request.physicalCameraSettings = camSettings; // Invalid camera settings + returnStatus = + mSession->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), + returnStatus.getServiceSpecificError()); + + defaultPreviewSettings.unlock(settingsBuffer); + filteredSettings.unlock(filteredSettingsBuffer); + + if (useHalBufManager) { + std::vector streamIds(halStreams.size()); + for (size_t i = 0; i < streamIds.size(); i++) { + streamIds[i] = halStreams[i].id; + } + verifyBuffersReturned(mSession, streamIds, cb); + } + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +// Generate and verify an ultra high resolution capture request +TEST_P(CameraAidlTest, processUltraHighResolutionRequest) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + int64_t bufferId = 1; + int32_t frameNumber = 1; + CameraMetadata settings; + + for (const auto& name : cameraDeviceNames) { + std::string version, deviceId; + ASSERT_TRUE(matchDeviceName(name, mProviderType, &version, &deviceId)); + CameraMetadata meta; + + std::shared_ptr unusedDevice; + openEmptyDeviceSession(name, mProvider, &mSession, &meta, &unusedDevice); + camera_metadata_t* staticMeta = reinterpret_cast(meta.metadata.data()); + if (!isUltraHighResolution(staticMeta)) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + CameraMetadata req; + android::hardware::camera::common::V1_0::helper::CameraMetadata defaultSettings; + ndk::ScopedAStatus ret = + mSession->constructDefaultRequestSettings(RequestTemplate::STILL_CAPTURE, &req); + ASSERT_TRUE(ret.isOk()); + + const camera_metadata_t* metadata = + reinterpret_cast(req.metadata.data()); + size_t expectedSize = req.metadata.size(); + int result = validate_camera_metadata_structure(metadata, &expectedSize); + ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED)); + + size_t entryCount = get_camera_metadata_entry_count(metadata); + ASSERT_GT(entryCount, 0u); + defaultSettings = metadata; + uint8_t sensorPixelMode = + static_cast(ANDROID_SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION); + ASSERT_EQ(::android::OK, + defaultSettings.update(ANDROID_SENSOR_PIXEL_MODE, &sensorPixelMode, 1)); + + const camera_metadata_t* settingsBuffer = defaultSettings.getAndLock(); + uint8_t* rawSettingsBuffer = (uint8_t*)settingsBuffer; + settings.metadata = std::vector( + rawSettingsBuffer, rawSettingsBuffer + get_camera_metadata_size(settingsBuffer)); + overrideRotateAndCrop(&settings); + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + + std::vector halStreams; + bool supportsPartialResults = false; + bool useHalBufManager = false; + int32_t partialResultCount = 0; + Stream previewStream; + std::shared_ptr cb; + + std::list pixelFormats = {PixelFormat::YCBCR_420_888, PixelFormat::RAW16}; + for (PixelFormat format : pixelFormats) { + configureStreams(name, mProvider, format, &mSession, &previewStream, &halStreams, + &supportsPartialResults, &partialResultCount, &useHalBufManager, &cb, + 0, /*maxResolution*/ true); + ASSERT_NE(mSession, nullptr); + + ::aidl::android::hardware::common::fmq::MQDescriptor< + int8_t, aidl::android::hardware::common::fmq::SynchronizedReadWrite> + descriptor; + auto resultQueueRet = mSession->getCaptureResultMetadataQueue(&descriptor); + ASSERT_TRUE(resultQueueRet.isOk()); + + std::shared_ptr resultQueue = + std::make_shared(descriptor); + if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) { + ALOGE("%s: HAL returns empty result metadata fmq, not use it", __func__); + resultQueue = nullptr; + // Don't use the queue onwards. + } + + std::vector graphicBuffers; + graphicBuffers.reserve(halStreams.size()); + std::shared_ptr inflightReq = std::make_shared( + static_cast(halStreams.size()), false, supportsPartialResults, + partialResultCount, std::unordered_set(), resultQueue); + + std::vector requests(1); + CaptureRequest& request = requests[0]; + std::vector& outputBuffers = request.outputBuffers; + outputBuffers.resize(halStreams.size()); + + size_t k = 0; + for (const auto& halStream : halStreams) { + buffer_handle_t buffer_handle; + if (useHalBufManager) { + outputBuffers[k] = {halStream.id, 0, + NativeHandle(), BufferStatus::OK, + NativeHandle(), NativeHandle()}; + } else { + allocateGraphicBuffer(previewStream.width, previewStream.height, + android_convertGralloc1To0Usage( + static_cast(halStream.producerUsage), + static_cast(halStream.consumerUsage)), + halStream.overrideFormat, &buffer_handle); + graphicBuffers.push_back(buffer_handle); + outputBuffers[k] = { + halStream.id, bufferId, ::android::makeToAidl(buffer_handle), + BufferStatus::OK, NativeHandle(), NativeHandle()}; + bufferId++; + } + k++; + } + + request.inputBuffer = { + -1, 0, NativeHandle(), BufferStatus::ERROR, NativeHandle(), NativeHandle()}; + request.frameNumber = frameNumber; + request.fmqSettingsSize = 0; + request.settings = settings; + request.inputWidth = 0; + request.inputHeight = 0; + + { + std::unique_lock l(mLock); + mInflightMap.clear(); + mInflightMap[frameNumber] = inflightReq; + } + + int32_t numRequestProcessed = 0; + std::vector cachesToRemove; + ndk::ScopedAStatus returnStatus = + mSession->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ASSERT_TRUE(returnStatus.isOk()); + ASSERT_EQ(numRequestProcessed, 1u); + + { + std::unique_lock l(mLock); + while (!inflightReq->errorCodeValid && + ((0 < inflightReq->numBuffersLeft) || (!inflightReq->haveResultMetadata))) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kStreamBufferTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + ASSERT_FALSE(inflightReq->errorCodeValid); + ASSERT_NE(inflightReq->resultOutputBuffers.size(), 0u); + } + if (useHalBufManager) { + std::vector streamIds(halStreams.size()); + for (size_t i = 0; i < streamIds.size(); i++) { + streamIds[i] = halStreams[i].id; + } + verifyBuffersReturned(mSession, streamIds, cb); + } + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } + } +} + +// Generate and verify 10-bit dynamic range request +TEST_P(CameraAidlTest, process10BitDynamicRangeRequest) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + int64_t bufferId = 1; + int32_t frameNumber = 1; + CameraMetadata settings; + + for (const auto& name : cameraDeviceNames) { + std::string version, deviceId; + ASSERT_TRUE(matchDeviceName(name, mProviderType, &version, &deviceId)); + CameraMetadata meta; + std::shared_ptr device; + openEmptyDeviceSession(name, mProvider, &mSession, &meta, &device); + camera_metadata_t* staticMeta = reinterpret_cast(meta.metadata.data()); + if (!is10BitDynamicRangeCapable(staticMeta)) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + std::vector< + aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap> + profileList; + get10BitDynamicRangeProfiles(staticMeta, &profileList); + ASSERT_FALSE(profileList.empty()); + + CameraMetadata req; + android::hardware::camera::common::V1_0::helper::CameraMetadata defaultSettings; + ndk::ScopedAStatus ret = + mSession->constructDefaultRequestSettings(RequestTemplate::STILL_CAPTURE, &req); + ASSERT_TRUE(ret.isOk()); + + const camera_metadata_t* metadata = + reinterpret_cast(req.metadata.data()); + size_t expectedSize = req.metadata.size(); + int result = validate_camera_metadata_structure(metadata, &expectedSize); + ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED)); + + size_t entryCount = get_camera_metadata_entry_count(metadata); + ASSERT_GT(entryCount, 0u); + defaultSettings = metadata; + + const camera_metadata_t* settingsBuffer = defaultSettings.getAndLock(); + uint8_t* rawSettingsBuffer = (uint8_t*)settingsBuffer; + settings.metadata = std::vector( + rawSettingsBuffer, rawSettingsBuffer + get_camera_metadata_size(settingsBuffer)); + overrideRotateAndCrop(&settings); + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + + std::vector halStreams; + bool supportsPartialResults = false; + bool useHalBufManager = false; + int32_t partialResultCount = 0; + Stream previewStream; + std::shared_ptr cb; + for (const auto& profile : profileList) { + configureStreams(name, mProvider, PixelFormat::IMPLEMENTATION_DEFINED, &mSession, + &previewStream, &halStreams, &supportsPartialResults, + &partialResultCount, &useHalBufManager, &cb, 0, + /*maxResolution*/ false, profile); + ASSERT_NE(mSession, nullptr); + + ::aidl::android::hardware::common::fmq::MQDescriptor< + int8_t, aidl::android::hardware::common::fmq::SynchronizedReadWrite> + descriptor; + auto resultQueueRet = mSession->getCaptureResultMetadataQueue(&descriptor); + ASSERT_TRUE(resultQueueRet.isOk()); + + std::shared_ptr resultQueue = + std::make_shared(descriptor); + if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) { + ALOGE("%s: HAL returns empty result metadata fmq, not use it", __func__); + resultQueue = nullptr; + // Don't use the queue onwards. + } + + std::vector graphicBuffers; + graphicBuffers.reserve(halStreams.size()); + + std::shared_ptr inflightReq = std::make_shared( + static_cast(halStreams.size()), false, supportsPartialResults, + partialResultCount, std::unordered_set(), resultQueue); + + std::vector requests(1); + CaptureRequest& request = requests[0]; + std::vector& outputBuffers = request.outputBuffers; + outputBuffers.resize(halStreams.size()); + + size_t k = 0; + for (const auto& halStream : halStreams) { + buffer_handle_t buffer_handle; + if (useHalBufManager) { + outputBuffers[k] = {halStream.id, 0, + NativeHandle(), BufferStatus::OK, + NativeHandle(), NativeHandle()}; + } else { + allocateGraphicBuffer(previewStream.width, previewStream.height, + android_convertGralloc1To0Usage( + static_cast(halStream.producerUsage), + static_cast(halStream.consumerUsage)), + halStream.overrideFormat, &buffer_handle); + + graphicBuffers.push_back(buffer_handle); + outputBuffers[k] = { + halStream.id, bufferId, android::makeToAidl(buffer_handle), + BufferStatus::OK, NativeHandle(), NativeHandle()}; + bufferId++; + } + k++; + } + + request.inputBuffer = { + -1, 0, NativeHandle(), BufferStatus::ERROR, NativeHandle(), NativeHandle()}; + request.frameNumber = frameNumber; + request.fmqSettingsSize = 0; + request.settings = settings; + request.inputWidth = 0; + request.inputHeight = 0; + + { + std::unique_lock l(mLock); + mInflightMap.clear(); + mInflightMap[frameNumber] = inflightReq; + } + + int32_t numRequestProcessed = 0; + std::vector cachesToRemove; + ndk::ScopedAStatus returnStatus = + mSession->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ASSERT_TRUE(returnStatus.isOk()); + ASSERT_EQ(numRequestProcessed, 1u); + + { + std::unique_lock l(mLock); + while (!inflightReq->errorCodeValid && + ((0 < inflightReq->numBuffersLeft) || (!inflightReq->haveResultMetadata))) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kStreamBufferTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + ASSERT_FALSE(inflightReq->errorCodeValid); + ASSERT_NE(inflightReq->resultOutputBuffers.size(), 0u); + verify10BitMetadata(mHandleImporter, *inflightReq, profile); + } + if (useHalBufManager) { + std::vector streamIds(halStreams.size()); + for (size_t i = 0; i < streamIds.size(); i++) { + streamIds[i] = halStreams[i].id; + } + mSession->signalStreamFlush(streamIds, /*streamConfigCounter*/ 0); + cb->waitForBuffersReturned(); + } + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } + } +} + +// Generate and verify a burst containing alternating sensor sensitivity values +TEST_P(CameraAidlTest, processCaptureRequestBurstISO) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; + int64_t bufferId = 1; + int32_t frameNumber = 1; + float isoTol = .03f; + CameraMetadata settings; + + for (const auto& name : cameraDeviceNames) { + CameraMetadata meta; + settings.metadata.clear(); + std::shared_ptr unusedDevice; + openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/, + &unusedDevice /*out*/); + camera_metadata_t* staticMetaBuffer = + clone_camera_metadata(reinterpret_cast(meta.metadata.data())); + ::android::hardware::camera::common::V1_0::helper::CameraMetadata staticMeta( + staticMetaBuffer); + + camera_metadata_entry_t hwLevel = staticMeta.find(ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL); + ASSERT_TRUE(0 < hwLevel.count); + if (ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED == hwLevel.data.u8[0] || + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL == hwLevel.data.u8[0]) { + // Limited/External devices can skip this test + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + + camera_metadata_entry_t isoRange = staticMeta.find(ANDROID_SENSOR_INFO_SENSITIVITY_RANGE); + ASSERT_EQ(isoRange.count, 2u); + + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + + bool supportsPartialResults = false; + bool useHalBufManager = false; + int32_t partialResultCount = 0; + Stream previewStream; + std::vector halStreams; + std::shared_ptr cb; + configurePreviewStream(name, mProvider, &previewThreshold, &mSession /*out*/, + &previewStream /*out*/, &halStreams /*out*/, + &supportsPartialResults /*out*/, &partialResultCount /*out*/, + &useHalBufManager /*out*/, &cb /*out*/); + + ::aidl::android::hardware::common::fmq::MQDescriptor< + int8_t, aidl::android::hardware::common::fmq::SynchronizedReadWrite> + descriptor; + auto resultQueueRet = mSession->getCaptureResultMetadataQueue(&descriptor); + std::shared_ptr resultQueue = + std::make_shared(descriptor); + ASSERT_TRUE(resultQueueRet.isOk()); + if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) { + ALOGE("%s: HAL returns empty result metadata fmq, not use it", __func__); + resultQueue = nullptr; + // Don't use the queue onwards. + } + + ret = mSession->constructDefaultRequestSettings(RequestTemplate::PREVIEW, &settings); + ASSERT_TRUE(ret.isOk()); + + ::android::hardware::camera::common::V1_0::helper::CameraMetadata requestMeta; + std::vector requests(kBurstFrameCount); + std::vector buffers(kBurstFrameCount); + std::vector> inflightReqs(kBurstFrameCount); + std::vector isoValues(kBurstFrameCount); + std::vector requestSettings(kBurstFrameCount); + + for (int32_t i = 0; i < kBurstFrameCount; i++) { + std::unique_lock l(mLock); + CaptureRequest& request = requests[i]; + std::vector& outputBuffers = request.outputBuffers; + outputBuffers.resize(1); + StreamBuffer& outputBuffer = outputBuffers[0]; + + isoValues[i] = ((i % 2) == 0) ? isoRange.data.i32[0] : isoRange.data.i32[1]; + if (useHalBufManager) { + outputBuffer = {halStreams[0].id, 0, + NativeHandle(), BufferStatus::OK, + NativeHandle(), NativeHandle()}; + } else { + allocateGraphicBuffer(previewStream.width, previewStream.height, + android_convertGralloc1To0Usage( + static_cast(halStreams[0].producerUsage), + static_cast(halStreams[0].consumerUsage)), + halStreams[0].overrideFormat, &buffers[i]); + outputBuffer = {halStreams[0].id, bufferId + i, ::android::makeToAidl(buffers[i]), + BufferStatus::OK, NativeHandle(), NativeHandle()}; + } + + requestMeta.append(reinterpret_cast(settings.metadata.data())); + + // Disable all 3A routines + uint8_t mode = static_cast(ANDROID_CONTROL_MODE_OFF); + ASSERT_EQ(::android::OK, requestMeta.update(ANDROID_CONTROL_MODE, &mode, 1)); + ASSERT_EQ(::android::OK, + requestMeta.update(ANDROID_SENSOR_SENSITIVITY, &isoValues[i], 1)); + camera_metadata_t* metaBuffer = requestMeta.release(); + uint8_t* rawMetaBuffer = reinterpret_cast(metaBuffer); + requestSettings[i].metadata = std::vector( + rawMetaBuffer, rawMetaBuffer + get_camera_metadata_size(metaBuffer)); + overrideRotateAndCrop(&(requestSettings[i])); + + request.frameNumber = frameNumber + i; + request.fmqSettingsSize = 0; + request.settings = requestSettings[i]; + request.inputBuffer = { + -1, 0, NativeHandle(), BufferStatus::ERROR, NativeHandle(), NativeHandle()}; + + inflightReqs[i] = std::make_shared(1, false, supportsPartialResults, + partialResultCount, resultQueue); + mInflightMap[frameNumber + i] = inflightReqs[i]; + } + + int32_t numRequestProcessed = 0; + std::vector cachesToRemove; + + ndk::ScopedAStatus returnStatus = + mSession->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ASSERT_TRUE(returnStatus.isOk()); + ASSERT_EQ(numRequestProcessed, kBurstFrameCount); + + for (size_t i = 0; i < kBurstFrameCount; i++) { + std::unique_lock l(mLock); + while (!inflightReqs[i]->errorCodeValid && ((0 < inflightReqs[i]->numBuffersLeft) || + (!inflightReqs[i]->haveResultMetadata))) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kStreamBufferTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + ASSERT_FALSE(inflightReqs[i]->errorCodeValid); + ASSERT_NE(inflightReqs[i]->resultOutputBuffers.size(), 0u); + ASSERT_EQ(previewStream.id, inflightReqs[i]->resultOutputBuffers[0].buffer.streamId); + ASSERT_FALSE(inflightReqs[i]->collectedResult.isEmpty()); + ASSERT_TRUE(inflightReqs[i]->collectedResult.exists(ANDROID_SENSOR_SENSITIVITY)); + camera_metadata_entry_t isoResult = + inflightReqs[i]->collectedResult.find(ANDROID_SENSOR_SENSITIVITY); + ASSERT_TRUE(std::abs(isoResult.data.i32[0] - isoValues[i]) <= + std::round(isoValues[i] * isoTol)); + } + + if (useHalBufManager) { + verifyBuffersReturned(mSession, previewStream.id, cb); + } + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +// Test whether an incorrect capture request with missing settings will +// be reported correctly. +TEST_P(CameraAidlTest, processCaptureRequestInvalidSinglePreview) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::vector outputPreviewStreams; + AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; + int64_t bufferId = 1; + int32_t frameNumber = 1; + CameraMetadata settings; + + for (const auto& name : cameraDeviceNames) { + Stream previewStream; + std::vector halStreams; + std::shared_ptr cb; + bool supportsPartialResults = false; + bool useHalBufManager = false; + int32_t partialResultCount = 0; + configurePreviewStream(name, mProvider, &previewThreshold, &mSession /*out*/, + &previewStream /*out*/, &halStreams /*out*/, + &supportsPartialResults /*out*/, &partialResultCount /*out*/, + &useHalBufManager /*out*/, &cb /*out*/); + ASSERT_NE(mSession, nullptr); + ASSERT_FALSE(halStreams.empty()); + + buffer_handle_t buffer_handle = nullptr; + + if (useHalBufManager) { + bufferId = 0; + } else { + allocateGraphicBuffer(previewStream.width, previewStream.height, + android_convertGralloc1To0Usage( + static_cast(halStreams[0].producerUsage), + static_cast(halStreams[0].consumerUsage)), + halStreams[0].overrideFormat, &buffer_handle); + } + + std::vector requests(1); + CaptureRequest& request = requests[0]; + std::vector& outputBuffers = request.outputBuffers; + outputBuffers.resize(1); + StreamBuffer& outputBuffer = outputBuffers[0]; + + outputBuffer = { + halStreams[0].id, + bufferId, + buffer_handle == nullptr ? NativeHandle() : ::android::makeToAidl(buffer_handle), + BufferStatus::OK, + NativeHandle(), + NativeHandle()}; + + request.inputBuffer = { + -1, 0, NativeHandle(), BufferStatus::ERROR, NativeHandle(), NativeHandle()}; + request.frameNumber = frameNumber; + request.fmqSettingsSize = 0; + request.settings = settings; + + // Settings were not correctly initialized, we should fail here + int32_t numRequestProcessed = 0; + std::vector cachesToRemove; + ndk::ScopedAStatus ret = + mSession->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), ret.getServiceSpecificError()); + ASSERT_EQ(numRequestProcessed, 0u); + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +// Verify camera offline session behavior +TEST_P(CameraAidlTest, switchToOffline) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + AvailableStream threshold = {kMaxStillWidth, kMaxStillHeight, + static_cast(PixelFormat::BLOB)}; + int64_t bufferId = 1; + int32_t frameNumber = 1; + CameraMetadata settings; + + for (const auto& name : cameraDeviceNames) { + CameraMetadata meta; + { + std::shared_ptr unusedDevice; + openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/, + &unusedDevice); + camera_metadata_t* staticMetaBuffer = clone_camera_metadata( + reinterpret_cast(meta.metadata.data())); + ::android::hardware::camera::common::V1_0::helper::CameraMetadata staticMeta( + staticMetaBuffer); + + if (isOfflineSessionSupported(staticMetaBuffer) != Status::OK) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } + + bool supportsPartialResults = false; + int32_t partialResultCount = 0; + Stream stream; + std::vector halStreams; + std::shared_ptr cb; + int32_t jpegBufferSize; + bool useHalBufManager; + configureOfflineStillStream(name, mProvider, &threshold, &mSession /*out*/, &stream /*out*/, + &halStreams /*out*/, &supportsPartialResults /*out*/, + &partialResultCount /*out*/, &cb /*out*/, + &jpegBufferSize /*out*/, &useHalBufManager /*out*/); + + auto ret = mSession->constructDefaultRequestSettings(RequestTemplate::STILL_CAPTURE, + &settings); + ASSERT_TRUE(ret.isOk()); + + ::aidl::android::hardware::common::fmq::MQDescriptor< + int8_t, aidl::android::hardware::common::fmq::SynchronizedReadWrite> + descriptor; + + ndk::ScopedAStatus resultQueueRet = mSession->getCaptureResultMetadataQueue(&descriptor); + ASSERT_TRUE(resultQueueRet.isOk()); + std::shared_ptr resultQueue = + std::make_shared(descriptor); + if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) { + ALOGE("%s: HAL returns empty result metadata fmq, not use it", __func__); + resultQueue = nullptr; + // Don't use the queue onwards. + } + + ::android::hardware::camera::common::V1_0::helper::CameraMetadata requestMeta; + + std::vector buffers(kBurstFrameCount); + std::vector> inflightReqs(kBurstFrameCount); + std::vector requestSettings(kBurstFrameCount); + + std::vector requests(kBurstFrameCount); + + HalStream halStream = halStreams[0]; + for (uint32_t i = 0; i < kBurstFrameCount; i++) { + CaptureRequest& request = requests[i]; + std::vector& outputBuffers = request.outputBuffers; + outputBuffers.resize(1); + StreamBuffer& outputBuffer = outputBuffers[0]; + + std::unique_lock l(mLock); + if (useHalBufManager) { + outputBuffer = {halStream.id, 0, NativeHandle(), BufferStatus::OK, NativeHandle(), + NativeHandle()}; + } else { + // jpeg buffer (w,h) = (blobLen, 1) + allocateGraphicBuffer(jpegBufferSize, /*height*/ 1, + android_convertGralloc1To0Usage( + static_cast(halStream.producerUsage), + static_cast(halStream.consumerUsage)), + halStream.overrideFormat, &buffers[i]); + outputBuffer = {halStream.id, bufferId + i, ::android::makeToAidl(buffers[i]), + BufferStatus::OK, NativeHandle(), NativeHandle()}; + } + + requestMeta.clear(); + requestMeta.append(reinterpret_cast(settings.metadata.data())); + + camera_metadata_t* metaBuffer = requestMeta.release(); + uint8_t* rawMetaBuffer = reinterpret_cast(metaBuffer); + requestSettings[i].metadata = std::vector( + rawMetaBuffer, rawMetaBuffer + get_camera_metadata_size(metaBuffer)); + overrideRotateAndCrop(&requestSettings[i]); + + request.frameNumber = frameNumber + i; + request.fmqSettingsSize = 0; + request.settings = requestSettings[i]; + request.inputBuffer = {/*streamId*/ -1, + /*bufferId*/ 0, NativeHandle(), + BufferStatus::ERROR, NativeHandle(), + NativeHandle()}; + + inflightReqs[i] = std::make_shared(1, false, supportsPartialResults, + partialResultCount, resultQueue); + mInflightMap[frameNumber + i] = inflightReqs[i]; + } + + int32_t numRequestProcessed = 0; + std::vector cachesToRemove; + + ndk::ScopedAStatus returnStatus = + mSession->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ASSERT_TRUE(returnStatus.isOk()); + ASSERT_EQ(numRequestProcessed, kBurstFrameCount); + + std::vector offlineStreamIds = {halStream.id}; + CameraOfflineSessionInfo offlineSessionInfo; + std::shared_ptr offlineSession; + returnStatus = + mSession->switchToOffline(offlineStreamIds, &offlineSessionInfo, &offlineSession); + + if (!halStreams[0].supportOffline) { + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), + returnStatus.getServiceSpecificError()); + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + + ASSERT_TRUE(returnStatus.isOk()); + // Hal might be unable to find any requests qualified for offline mode. + if (offlineSession == nullptr) { + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + + ASSERT_EQ(offlineSessionInfo.offlineStreams.size(), 1u); + ASSERT_EQ(offlineSessionInfo.offlineStreams[0].id, halStream.id); + ASSERT_NE(offlineSessionInfo.offlineRequests.size(), 0u); + + // close device session to make sure offline session does not rely on it + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + + ::aidl::android::hardware::common::fmq::MQDescriptor< + int8_t, aidl::android::hardware::common::fmq::SynchronizedReadWrite> + offlineResultDescriptor; + + auto offlineResultQueueRet = + offlineSession->getCaptureResultMetadataQueue(&offlineResultDescriptor); + std::shared_ptr offlineResultQueue = + std::make_shared(descriptor); + if (!offlineResultQueue->isValid() || offlineResultQueue->availableToWrite() <= 0) { + ALOGE("%s: offline session returns empty result metadata fmq, not use it", __func__); + offlineResultQueue = nullptr; + // Don't use the queue onwards. + } + ASSERT_TRUE(offlineResultQueueRet.isOk()); + + updateInflightResultQueue(offlineResultQueue); + + ret = offlineSession->setCallback(cb); + ASSERT_TRUE(ret.isOk()); + + for (size_t i = 0; i < kBurstFrameCount; i++) { + std::unique_lock l(mLock); + while (!inflightReqs[i]->errorCodeValid && ((0 < inflightReqs[i]->numBuffersLeft) || + (!inflightReqs[i]->haveResultMetadata))) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kStreamBufferTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + ASSERT_FALSE(inflightReqs[i]->errorCodeValid); + ASSERT_NE(inflightReqs[i]->resultOutputBuffers.size(), 0u); + ASSERT_EQ(stream.id, inflightReqs[i]->resultOutputBuffers[0].buffer.streamId); + ASSERT_FALSE(inflightReqs[i]->collectedResult.isEmpty()); + } + + ret = offlineSession->close(); + ASSERT_TRUE(ret.isOk()); + } +} + +// Check whether an invalid capture request with missing output buffers +// will be reported correctly. +TEST_P(CameraAidlTest, processCaptureRequestInvalidBuffer) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::vector outputBlobStreams; + AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; + int32_t frameNumber = 1; + CameraMetadata settings; + + for (const auto& name : cameraDeviceNames) { + Stream previewStream; + std::vector halStreams; + std::shared_ptr cb; + bool supportsPartialResults = false; + bool useHalBufManager = false; + int32_t partialResultCount = 0; + configurePreviewStream(name, mProvider, &previewThreshold, &mSession /*out*/, + &previewStream /*out*/, &halStreams /*out*/, + &supportsPartialResults /*out*/, &partialResultCount /*out*/, + &useHalBufManager /*out*/, &cb /*out*/); + + RequestTemplate reqTemplate = RequestTemplate::PREVIEW; + ndk::ScopedAStatus ret = mSession->constructDefaultRequestSettings(reqTemplate, &settings); + ASSERT_TRUE(ret.isOk()); + overrideRotateAndCrop(&settings); + + std::vector requests(1); + CaptureRequest& request = requests[0]; + std::vector& outputBuffers = request.outputBuffers; + outputBuffers.resize(1); + // Empty output buffer + outputBuffers[0] = { + -1, 0, NativeHandle(), BufferStatus::ERROR, NativeHandle(), NativeHandle()}; + + request.inputBuffer = { + -1, 0, NativeHandle(), BufferStatus::ERROR, NativeHandle(), NativeHandle()}; + request.frameNumber = frameNumber; + request.fmqSettingsSize = 0; + request.settings = settings; + + // Output buffers are missing, we should fail here + int32_t numRequestProcessed = 0; + std::vector cachesToRemove; + ret = mSession->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), ret.getServiceSpecificError()); + ASSERT_EQ(numRequestProcessed, 0u); + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +// Generate, trigger and flush a preview request +TEST_P(CameraAidlTest, flushPreviewRequest) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::vector outputPreviewStreams; + AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; + int64_t bufferId = 1; + int32_t frameNumber = 1; + CameraMetadata settings; + + for (const auto& name : cameraDeviceNames) { + Stream previewStream; + std::vector halStreams; + std::shared_ptr cb; + bool supportsPartialResults = false; + bool useHalBufManager = false; + int32_t partialResultCount = 0; + + configurePreviewStream(name, mProvider, &previewThreshold, &mSession /*out*/, + &previewStream /*out*/, &halStreams /*out*/, + &supportsPartialResults /*out*/, &partialResultCount /*out*/, + &useHalBufManager /*out*/, &cb /*out*/); + + ASSERT_NE(mSession, nullptr); + ASSERT_NE(cb, nullptr); + ASSERT_FALSE(halStreams.empty()); + + ::aidl::android::hardware::common::fmq::MQDescriptor< + int8_t, aidl::android::hardware::common::fmq::SynchronizedReadWrite> + descriptor; + + auto resultQueueRet = mSession->getCaptureResultMetadataQueue(&descriptor); + std::shared_ptr resultQueue = + std::make_shared(descriptor); + ASSERT_TRUE(resultQueueRet.isOk()); + if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) { + ALOGE("%s: HAL returns empty result metadata fmq, not use it", __func__); + resultQueue = nullptr; + // Don't use the queue onwards. + } + + std::shared_ptr inflightReq = std::make_shared( + 1, false, supportsPartialResults, partialResultCount, resultQueue); + RequestTemplate reqTemplate = RequestTemplate::PREVIEW; + + ndk::ScopedAStatus ret = mSession->constructDefaultRequestSettings(reqTemplate, &settings); + ASSERT_TRUE(ret.isOk()); + overrideRotateAndCrop(&settings); + + buffer_handle_t buffer_handle; + std::vector requests(1); + CaptureRequest& request = requests[0]; + std::vector& outputBuffers = request.outputBuffers; + outputBuffers.resize(1); + StreamBuffer& outputBuffer = outputBuffers[0]; + if (useHalBufManager) { + bufferId = 0; + outputBuffer = {halStreams[0].id, bufferId, NativeHandle(), + BufferStatus::OK, NativeHandle(), NativeHandle()}; + } else { + allocateGraphicBuffer(previewStream.width, previewStream.height, + android_convertGralloc1To0Usage( + static_cast(halStreams[0].producerUsage), + static_cast(halStreams[0].consumerUsage)), + halStreams[0].overrideFormat, &buffer_handle); + outputBuffer = {halStreams[0].id, bufferId, ::android::makeToAidl(buffer_handle), + BufferStatus::OK, NativeHandle(), NativeHandle()}; + } + + request.frameNumber = frameNumber; + request.fmqSettingsSize = 0; + request.settings = settings; + request.inputBuffer = { + -1, 0, NativeHandle(), BufferStatus::ERROR, NativeHandle(), NativeHandle()}; + + { + std::unique_lock l(mLock); + mInflightMap.clear(); + mInflightMap[frameNumber] = inflightReq; + } + + int32_t numRequestProcessed = 0; + std::vector cachesToRemove; + ret = mSession->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(numRequestProcessed, 1u); + + // Flush before waiting for request to complete. + ndk::ScopedAStatus returnStatus = mSession->flush(); + ASSERT_TRUE(returnStatus.isOk()); + + { + std::unique_lock l(mLock); + while (!inflightReq->errorCodeValid && + ((0 < inflightReq->numBuffersLeft) || (!inflightReq->haveResultMetadata))) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kStreamBufferTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + if (!inflightReq->errorCodeValid) { + ASSERT_NE(inflightReq->resultOutputBuffers.size(), 0u); + ASSERT_EQ(previewStream.id, inflightReq->resultOutputBuffers[0].buffer.streamId); + } else { + switch (inflightReq->errorCode) { + case ErrorCode::ERROR_REQUEST: + case ErrorCode::ERROR_RESULT: + case ErrorCode::ERROR_BUFFER: + // Expected + break; + case ErrorCode::ERROR_DEVICE: + default: + FAIL() << "Unexpected error:" + << static_cast(inflightReq->errorCode); + } + } + } + + if (useHalBufManager) { + verifyBuffersReturned(mSession, previewStream.id, cb); + } + + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +// Verify that camera flushes correctly without any pending requests. +TEST_P(CameraAidlTest, flushEmpty) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::vector outputPreviewStreams; + AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; + + for (const auto& name : cameraDeviceNames) { + Stream previewStream; + std::vector halStreams; + std::shared_ptr cb; + bool supportsPartialResults = false; + bool useHalBufManager = false; + + int32_t partialResultCount = 0; + configurePreviewStream(name, mProvider, &previewThreshold, &mSession /*out*/, + &previewStream /*out*/, &halStreams /*out*/, + &supportsPartialResults /*out*/, &partialResultCount /*out*/, + &useHalBufManager /*out*/, &cb /*out*/); + + ndk::ScopedAStatus returnStatus = mSession->flush(); + ASSERT_TRUE(returnStatus.isOk()); + + { + std::unique_lock l(mLock); + auto timeout = std::chrono::system_clock::now() + + std::chrono::milliseconds(kEmptyFlushTimeoutMSec); + ASSERT_EQ(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +// Test camera provider notify method +TEST_P(CameraAidlTest, providerDeviceStateNotification) { + notifyDeviceState(ICameraProvider::DEVICE_STATE_BACK_COVERED); + notifyDeviceState(ICameraProvider::DEVICE_STATE_NORMAL); +} + +// Verify that all supported stream formats and sizes can be configured +// successfully for injection camera. +TEST_P(CameraAidlTest, configureInjectionStreamsAvailableOutputs) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::vector outputStreams; + + for (const auto& name : cameraDeviceNames) { + CameraMetadata metadata; + + std::shared_ptr injectionSession; + std::shared_ptr unusedDevice; + openEmptyInjectionSession(name, mProvider, &injectionSession /*out*/, &metadata /*out*/, + &unusedDevice /*out*/); + if (injectionSession == nullptr) { + continue; + } + + camera_metadata_t* staticMetaBuffer = + reinterpret_cast(metadata.metadata.data()); + CameraMetadata chars; + chars.metadata = metadata.metadata; + + outputStreams.clear(); + ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMetaBuffer, outputStreams)); + ASSERT_NE(0u, outputStreams.size()); + + int32_t jpegBufferSize = 0; + ASSERT_EQ(Status::OK, getJpegBufferSize(staticMetaBuffer, &jpegBufferSize)); + ASSERT_NE(0u, jpegBufferSize); + + int32_t streamId = 0; + int32_t streamConfigCounter = 0; + for (auto& it : outputStreams) { + Dataspace dataspace = getDataspace(static_cast(it.format)); + Stream stream = {streamId, + StreamType::OUTPUT, + it.width, + it.height, + static_cast(it.format), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + dataspace, + StreamRotation::ROTATION_0, + std::string(), + jpegBufferSize, + 0, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + + std::vector streams = {stream}; + StreamConfiguration config; + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, + jpegBufferSize); + + config.streamConfigCounter = streamConfigCounter++; + ndk::ScopedAStatus s = injectionSession->configureInjectionStreams(config, chars); + ASSERT_TRUE(s.isOk()); + streamId++; + } + + std::shared_ptr session; + ndk::ScopedAStatus ret = injectionSession->getCameraDeviceSession(&session); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(session, nullptr); + ret = session->close(); + ASSERT_TRUE(ret.isOk()); + } +} + +// Check for correct handling of invalid/incorrect configuration parameters for injection camera. +TEST_P(CameraAidlTest, configureInjectionStreamsInvalidOutputs) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::vector outputStreams; + + for (const auto& name : cameraDeviceNames) { + CameraMetadata metadata; + std::shared_ptr injectionSession; + std::shared_ptr unusedDevice; + openEmptyInjectionSession(name, mProvider, &injectionSession /*out*/, &metadata /*out*/, + &unusedDevice); + if (injectionSession == nullptr) { + continue; + } + + camera_metadata_t* staticMetaBuffer = + reinterpret_cast(metadata.metadata.data()); + std::shared_ptr session; + ndk::ScopedAStatus ret = injectionSession->getCameraDeviceSession(&session); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(session, nullptr); + + CameraMetadata chars; + chars.metadata = metadata.metadata; + + outputStreams.clear(); + ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMetaBuffer, outputStreams)); + ASSERT_NE(0u, outputStreams.size()); + + int32_t jpegBufferSize = 0; + ASSERT_EQ(Status::OK, getJpegBufferSize(staticMetaBuffer, &jpegBufferSize)); + ASSERT_NE(0u, jpegBufferSize); + + int32_t streamId = 0; + Stream stream = {streamId++, + StreamType::OUTPUT, + 0, + 0, + static_cast(outputStreams[0].format), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + jpegBufferSize, + 0, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + + int32_t streamConfigCounter = 0; + std::vector streams = {stream}; + StreamConfiguration config; + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, + jpegBufferSize); + + config.streamConfigCounter = streamConfigCounter++; + ndk::ScopedAStatus s = injectionSession->configureInjectionStreams(config, chars); + ASSERT_TRUE( + (static_cast(Status::ILLEGAL_ARGUMENT) == s.getServiceSpecificError()) || + (static_cast(Status::INTERNAL_ERROR) == s.getServiceSpecificError())); + + stream = {streamId++, + StreamType::OUTPUT, + INT32_MAX, + INT32_MAX, + static_cast(outputStreams[0].format), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + jpegBufferSize, + 0, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + streams[0] = stream; + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, + jpegBufferSize); + config.streamConfigCounter = streamConfigCounter++; + s = injectionSession->configureInjectionStreams(config, chars); + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), s.getServiceSpecificError()); + + for (auto& it : outputStreams) { + stream = {streamId++, + StreamType::OUTPUT, + it.width, + it.height, + static_cast(INT32_MAX), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + jpegBufferSize, + 0, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + streams[0] = stream; + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, + jpegBufferSize); + config.streamConfigCounter = streamConfigCounter++; + s = injectionSession->configureInjectionStreams(config, chars); + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), s.getServiceSpecificError()); + + stream = {streamId++, + StreamType::OUTPUT, + it.width, + it.height, + static_cast(it.format), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + Dataspace::UNKNOWN, + static_cast(INT32_MAX), + std::string(), + jpegBufferSize, + 0, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + streams[0] = stream; + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, + jpegBufferSize); + config.streamConfigCounter = streamConfigCounter++; + s = injectionSession->configureInjectionStreams(config, chars); + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), s.getServiceSpecificError()); + } + + ret = session->close(); + ASSERT_TRUE(ret.isOk()); + } +} + +// Check whether session parameters are supported for injection camera. If Hal support for them +// exist, then try to configure a preview stream using them. +TEST_P(CameraAidlTest, configureInjectionStreamsWithSessionParameters) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + std::vector outputPreviewStreams; + AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; + + for (const auto& name : cameraDeviceNames) { + CameraMetadata metadata; + std::shared_ptr injectionSession; + std::shared_ptr unusedDevice; + openEmptyInjectionSession(name, mProvider, &injectionSession /*out*/, &metadata /*out*/, + &unusedDevice /*out*/); + if (injectionSession == nullptr) { + continue; + } + + std::shared_ptr session; + ndk::ScopedAStatus ret = injectionSession->getCameraDeviceSession(&session); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(session, nullptr); + + camera_metadata_t* staticMetaBuffer = + reinterpret_cast(metadata.metadata.data()); + CameraMetadata chars; + chars.metadata = metadata.metadata; + + std::unordered_set availableSessionKeys; + Status rc = getSupportedKeys(staticMetaBuffer, ANDROID_REQUEST_AVAILABLE_SESSION_KEYS, + &availableSessionKeys); + ASSERT_EQ(Status::OK, rc); + if (availableSessionKeys.empty()) { + ret = session->close(); + ASSERT_TRUE(ret.isOk()); + continue; + } + + android::hardware::camera::common::V1_0::helper::CameraMetadata previewRequestSettings; + android::hardware::camera::common::V1_0::helper::CameraMetadata sessionParams, + modifiedSessionParams; + constructFilteredSettings(session, availableSessionKeys, RequestTemplate::PREVIEW, + &previewRequestSettings, &sessionParams); + if (sessionParams.isEmpty()) { + ret = session->close(); + ASSERT_TRUE(ret.isOk()); + continue; + } + + outputPreviewStreams.clear(); + + ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMetaBuffer, outputPreviewStreams, + &previewThreshold)); + ASSERT_NE(0u, outputPreviewStreams.size()); + + Stream previewStream = { + 0, + StreamType::OUTPUT, + outputPreviewStreams[0].width, + outputPreviewStreams[0].height, + static_cast(outputPreviewStreams[0].format), + static_cast<::aidl::android::hardware::graphics::common::BufferUsage>( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + 0, + -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + std::vector streams = {previewStream}; + StreamConfiguration config; + config.streams = streams; + config.operationMode = StreamConfigurationMode::NORMAL_MODE; + + modifiedSessionParams = sessionParams; + camera_metadata_t* sessionParamsBuffer = sessionParams.release(); + uint8_t* rawSessionParamsBuffer = reinterpret_cast(sessionParamsBuffer); + config.sessionParams.metadata = + std::vector(rawSessionParamsBuffer, + rawSessionParamsBuffer + get_camera_metadata_size(sessionParamsBuffer)); + + config.streamConfigCounter = 0; + config.streamConfigCounter = 0; + config.multiResolutionInputImage = false; + + ndk::ScopedAStatus s = injectionSession->configureInjectionStreams(config, chars); + ASSERT_TRUE(s.isOk()); + + sessionParams.acquire(sessionParamsBuffer); + free_camera_metadata(staticMetaBuffer); + ret = session->close(); + ASSERT_TRUE(ret.isOk()); + } +} + +// Verify that valid stream use cases can be configured successfully, and invalid use cases +// fail stream configuration. +TEST_P(CameraAidlTest, configureStreamsUseCases) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + + for (const auto& name : cameraDeviceNames) { + CameraMetadata meta; + std::shared_ptr cameraDevice; + + openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/, + &cameraDevice /*out*/); + + camera_metadata_t* staticMeta = reinterpret_cast(meta.metadata.data()); + // Check if camera support depth only + if (isDepthOnly(staticMeta)) { + ndk::ScopedAStatus ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + continue; + } + + std::vector outputPreviewStreams; + AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::YCBCR_420_888)}; + ASSERT_EQ(Status::OK, + getAvailableOutputStreams(staticMeta, outputPreviewStreams, &previewThreshold)); + ASSERT_NE(0u, outputPreviewStreams.size()); + + // Combine valid and invalid stream use cases + std::vector useCases(kMandatoryUseCases); + useCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL + 1); + + std::vector supportedUseCases; + camera_metadata_ro_entry entry; + auto retcode = find_camera_metadata_ro_entry( + staticMeta, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, &entry); + if ((0 == retcode) && (entry.count > 0)) { + supportedUseCases.insert(supportedUseCases.end(), entry.data.i32, + entry.data.i32 + entry.count); + } else { + supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT); + } + + std::vector streams(1); + streams[0] = { + 0, + StreamType::OUTPUT, + outputPreviewStreams[0].width, + outputPreviewStreams[0].height, + static_cast(outputPreviewStreams[0].format), + static_cast<::aidl::android::hardware::graphics::common::BufferUsage>( + GRALLOC1_CONSUMER_USAGE_CPU_READ), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + 0, + -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; + + int32_t streamConfigCounter = 0; + CameraMetadata req; + StreamConfiguration config; + RequestTemplate reqTemplate = RequestTemplate::STILL_CAPTURE; + ndk::ScopedAStatus ret = mSession->constructDefaultRequestSettings(reqTemplate, &req); + ASSERT_TRUE(ret.isOk()); + config.sessionParams = req; + + for (int32_t useCase : useCases) { + bool useCaseSupported = std::find(supportedUseCases.begin(), supportedUseCases.end(), + useCase) != supportedUseCases.end(); + + streams[0].useCase = static_cast< + aidl::android::hardware::camera::metadata::ScalerAvailableStreamUseCases>( + useCase); + config.streams = streams; + config.operationMode = StreamConfigurationMode::NORMAL_MODE; + config.streamConfigCounter = streamConfigCounter; + config.multiResolutionInputImage = false; + + bool combSupported; + ret = cameraDevice->isStreamCombinationSupported(config, &combSupported); + ASSERT_TRUE((ret.isOk()) || (static_cast(Status::OPERATION_NOT_SUPPORTED) == + ret.getServiceSpecificError())); + if (ret.isOk()) { + ASSERT_EQ(combSupported, useCaseSupported); + } + ASSERT_TRUE(ret.isOk()); + + std::vector halStreams; + ret = mSession->configureStreams(config, &halStreams); + ALOGI("configureStreams returns status: %d", ret.getServiceSpecificError()); + if (useCaseSupported) { + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(1u, halStreams.size()); + } else { + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), + ret.getServiceSpecificError()); + } + } + ret = mSession->close(); + mSession = nullptr; + ASSERT_TRUE(ret.isOk()); + } +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CameraAidlTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, CameraAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(ICameraProvider::descriptor)), + android::hardware::PrintInstanceNameToString); \ No newline at end of file diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp new file mode 100644 index 0000000000..d03b09763b --- /dev/null +++ b/camera/provider/aidl/vts/camera_aidl_test.cpp @@ -0,0 +1,2924 @@ +/* + * 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. + */ + +#include "camera_aidl_test.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using ::aidl::android::hardware::camera::common::CameraDeviceStatus; +using ::aidl::android::hardware::camera::common::TorchModeStatus; +using ::aidl::android::hardware::camera::device::CameraMetadata; +using ::aidl::android::hardware::camera::device::ICameraDevice; +using ::aidl::android::hardware::camera::device::ICameraDeviceSessionDefault; +using ::aidl::android::hardware::camera::metadata::CameraMetadataTag; +using ::aidl::android::hardware::camera::metadata::SensorInfoColorFilterArrangement; +using ::aidl::android::hardware::camera::metadata::SensorPixelMode; +using ::aidl::android::hardware::camera::provider::BnCameraProviderCallback; +using ::aidl::android::hardware::camera::provider::ConcurrentCameraIdCombination; +using ::aidl::android::hardware::camera::provider::ICameraProvider; +using ::aidl::android::hardware::camera::provider::ICameraProviderCallback; +using ::aidl::android::hardware::common::NativeHandle; +using ::android::hardware::camera::common::V1_0::helper::Size; +using ::ndk::ScopedAStatus; +using ::ndk::SpAIBinder; + +namespace { +bool matchDeviceName(const std::string& deviceName, const std::string& providerType, + std::string* deviceVersion, std::string* cameraId) { + // expected format: device@.// + std::stringstream pattern; + pattern << "device@[0-9]+\\.[0-9]+/" << providerType << "/(.+)"; + std::regex e(pattern.str()); + + std::smatch sm; + if (std::regex_match(deviceName, sm, e)) { + if (deviceVersion != nullptr) { + *deviceVersion = sm[1]; + } + if (cameraId != nullptr) { + *cameraId = sm[2]; + } + return true; + } + return false; +} + +bool parseProviderName(const std::string& serviceDescriptor, std::string* type /*out*/, + uint32_t* id /*out*/) { + if (!type || !id) { + ADD_FAILURE(); + return false; + } + + // expected format: // + std::string::size_type slashIdx1 = serviceDescriptor.find('/'); + if (slashIdx1 == std::string::npos || slashIdx1 == serviceDescriptor.size() - 1) { + ADD_FAILURE() << "Provider name does not have / separator between name, type, and id"; + return false; + } + + std::string::size_type slashIdx2 = serviceDescriptor.find('/', slashIdx1 + 1); + if (slashIdx2 == std::string::npos || slashIdx2 == serviceDescriptor.size() - 1) { + ADD_FAILURE() << "Provider name does not have / separator between type and id"; + return false; + } + + std::string typeVal = serviceDescriptor.substr(slashIdx1 + 1, slashIdx2 - slashIdx1 - 1); + + char* endPtr; + errno = 0; + long idVal = strtol(serviceDescriptor.c_str() + slashIdx2 + 1, &endPtr, 10); + if (errno != 0) { + ADD_FAILURE() << "cannot parse provider id as an integer:" << serviceDescriptor.c_str() + << strerror(errno) << errno; + return false; + } + if (endPtr != serviceDescriptor.c_str() + serviceDescriptor.size()) { + ADD_FAILURE() << "provider id has unexpected length " << serviceDescriptor.c_str(); + return false; + } + if (idVal < 0) { + ADD_FAILURE() << "id is negative: " << serviceDescriptor.c_str() << idVal; + return false; + } + + *type = typeVal; + *id = static_cast(idVal); + + return true; +} + +const std::vector kMandatoryUseCases = { + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL}; +} // namespace + +void CameraAidlTest::SetUp() { + std::string serviceDescriptor = GetParam(); + ALOGI("get service with name: %s", serviceDescriptor.c_str()); + + bool success = ABinderProcess_setThreadPoolMaxThreadCount(5); + ALOGI("ABinderProcess_setThreadPoolMaxThreadCount returns %s", success ? "true" : "false"); + ASSERT_TRUE(success); + ABinderProcess_startThreadPool(); + + SpAIBinder cameraProviderBinder = + SpAIBinder(AServiceManager_getService(serviceDescriptor.c_str())); + ASSERT_NE(cameraProviderBinder.get(), nullptr); + + std::shared_ptr cameraProvider = + ICameraProvider::fromBinder(cameraProviderBinder); + ASSERT_NE(cameraProvider.get(), nullptr); + mProvider = cameraProvider; + uint32_t id; + ASSERT_TRUE(parseProviderName(serviceDescriptor, &mProviderType, &id)); + + notifyDeviceState(ICameraProvider::DEVICE_STATE_NORMAL); +} + +void CameraAidlTest::TearDown() { + if (mSession != nullptr) { + ndk::ScopedAStatus ret = mSession->close(); + ASSERT_TRUE(ret.isOk()); + } +} + +std::vector CameraAidlTest::getCameraDeviceNames( + std::shared_ptr& provider, bool addSecureOnly) { + std::vector cameraDeviceNames; + + ScopedAStatus ret = provider->getCameraIdList(&cameraDeviceNames); + if (!ret.isOk()) { + ADD_FAILURE() << "Could not get camera id list"; + } + + // External camera devices are reported through cameraDeviceStatusChange + struct ProviderCb : public BnCameraProviderCallback { + ScopedAStatus cameraDeviceStatusChange(const std::string& devName, + CameraDeviceStatus newStatus) override { + ALOGI("camera device status callback name %s, status %d", devName.c_str(), + (int)newStatus); + if (newStatus == CameraDeviceStatus::PRESENT) { + externalCameraDeviceNames.push_back(devName); + } + return ScopedAStatus::ok(); + } + + ScopedAStatus torchModeStatusChange(const std::string&, TorchModeStatus) override { + return ScopedAStatus::ok(); + } + + ScopedAStatus physicalCameraDeviceStatusChange( + const std::string&, const std::string&, + ::aidl::android::hardware::camera::common::CameraDeviceStatus) override { + return ndk::ScopedAStatus(); + } + + std::vector externalCameraDeviceNames; + }; + std::shared_ptr cb = ndk::SharedRefBase::make(); + auto status = mProvider->setCallback(cb); + + for (const auto& devName : cb->externalCameraDeviceNames) { + if (cameraDeviceNames.end() == + std::find(cameraDeviceNames.begin(), cameraDeviceNames.end(), devName)) { + cameraDeviceNames.push_back(devName); + } + } + + std::vector retList; + for (auto& cameraDeviceName : cameraDeviceNames) { + bool isSecureOnlyCamera = isSecureOnly(mProvider, cameraDeviceName); + if (addSecureOnly) { + if (isSecureOnlyCamera) { + retList.emplace_back(cameraDeviceName); + } + } else if (!isSecureOnlyCamera) { + retList.emplace_back(cameraDeviceName); + } + } + return retList; +} + +bool CameraAidlTest::isSecureOnly(const std::shared_ptr& provider, + const std::string& name) { + std::shared_ptr cameraDevice = nullptr; + ScopedAStatus retInterface = provider->getCameraDeviceInterface(name, &cameraDevice); + if (!retInterface.isOk()) { + ADD_FAILURE() << "Failed to get camera device interface for " << name; + } + + CameraMetadata cameraCharacteristics; + ScopedAStatus retChars = cameraDevice->getCameraCharacteristics(&cameraCharacteristics); + if (!retChars.isOk()) { + ADD_FAILURE() << "Failed to get camera characteristics for device " << name; + } + + camera_metadata_t* chars = + reinterpret_cast(cameraCharacteristics.metadata.data()); + + SystemCameraKind systemCameraKind = SystemCameraKind::PUBLIC; + Status retCameraKind = getSystemCameraKind(chars, &systemCameraKind); + if (retCameraKind != Status::OK) { + ADD_FAILURE() << "Failed to get camera kind for " << name; + } + + return systemCameraKind == SystemCameraKind::HIDDEN_SECURE_CAMERA; +} + +std::map CameraAidlTest::getCameraDeviceIdToNameMap( + std::shared_ptr provider) { + std::vector cameraDeviceNames = getCameraDeviceNames(provider); + + std::map idToNameMap; + for (auto& name : cameraDeviceNames) { + std::string version, cameraId; + if (!matchDeviceName(name, mProviderType, &version, &cameraId)) { + ADD_FAILURE(); + } + idToNameMap.insert(std::make_pair(std::string(cameraId), name)); + } + return idToNameMap; +} + +void CameraAidlTest::verifyMonochromeCameraResult( + const ::android::hardware::camera::common::V1_0::helper::CameraMetadata& metadata) { + camera_metadata_ro_entry entry; + + // Check tags that are not applicable for monochrome camera + ASSERT_FALSE(metadata.exists(ANDROID_SENSOR_GREEN_SPLIT)); + ASSERT_FALSE(metadata.exists(ANDROID_SENSOR_NEUTRAL_COLOR_POINT)); + ASSERT_FALSE(metadata.exists(ANDROID_COLOR_CORRECTION_MODE)); + ASSERT_FALSE(metadata.exists(ANDROID_COLOR_CORRECTION_TRANSFORM)); + ASSERT_FALSE(metadata.exists(ANDROID_COLOR_CORRECTION_GAINS)); + + // Check dynamicBlackLevel + entry = metadata.find(ANDROID_SENSOR_DYNAMIC_BLACK_LEVEL); + if (entry.count > 0) { + ASSERT_EQ(entry.count, 4); + for (size_t i = 1; i < entry.count; i++) { + ASSERT_FLOAT_EQ(entry.data.f[i], entry.data.f[0]); + } + } + + // Check noiseProfile + entry = metadata.find(ANDROID_SENSOR_NOISE_PROFILE); + if (entry.count > 0) { + ASSERT_EQ(entry.count, 2); + } + + // Check lensShadingMap + entry = metadata.find(ANDROID_STATISTICS_LENS_SHADING_MAP); + if (entry.count > 0) { + ASSERT_EQ(entry.count % 4, 0); + for (size_t i = 0; i < entry.count / 4; i++) { + ASSERT_FLOAT_EQ(entry.data.f[i * 4 + 1], entry.data.f[i * 4]); + ASSERT_FLOAT_EQ(entry.data.f[i * 4 + 2], entry.data.f[i * 4]); + ASSERT_FLOAT_EQ(entry.data.f[i * 4 + 3], entry.data.f[i * 4]); + } + } + + // Check tonemapCurve + camera_metadata_ro_entry curveRed = metadata.find(ANDROID_TONEMAP_CURVE_RED); + camera_metadata_ro_entry curveGreen = metadata.find(ANDROID_TONEMAP_CURVE_GREEN); + camera_metadata_ro_entry curveBlue = metadata.find(ANDROID_TONEMAP_CURVE_BLUE); + if (curveRed.count > 0 && curveGreen.count > 0 && curveBlue.count > 0) { + ASSERT_EQ(curveRed.count, curveGreen.count); + ASSERT_EQ(curveRed.count, curveBlue.count); + for (size_t i = 0; i < curveRed.count; i++) { + ASSERT_FLOAT_EQ(curveGreen.data.f[i], curveRed.data.f[i]); + ASSERT_FLOAT_EQ(curveBlue.data.f[i], curveRed.data.f[i]); + } + } +} + +void CameraAidlTest::verifyStreamUseCaseCharacteristics(const camera_metadata_t* metadata) { + camera_metadata_ro_entry entry; + // Check capabilities + int retcode = + find_camera_metadata_ro_entry(metadata, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, &entry); + bool hasStreamUseCaseCap = false; + if ((0 == retcode) && (entry.count > 0)) { + if (std::find(entry.data.u8, entry.data.u8 + entry.count, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE) != + entry.data.u8 + entry.count) { + hasStreamUseCaseCap = true; + } + } + + bool supportMandatoryUseCases = false; + retcode = find_camera_metadata_ro_entry(metadata, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, + &entry); + if ((0 == retcode) && (entry.count > 0)) { + supportMandatoryUseCases = true; + for (size_t i = 0; i < kMandatoryUseCases.size(); i++) { + if (std::find(entry.data.i32, entry.data.i32 + entry.count, kMandatoryUseCases[i]) == + entry.data.i32 + entry.count) { + supportMandatoryUseCases = false; + break; + } + } + bool supportDefaultUseCase = false; + for (size_t i = 0; i < entry.count; i++) { + if (entry.data.i32[i] == ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT) { + supportDefaultUseCase = true; + } + ASSERT_TRUE(entry.data.i32[i] <= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL || + entry.data.i32[i] >= + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START); + } + ASSERT_TRUE(supportDefaultUseCase); + } + + ASSERT_EQ(hasStreamUseCaseCap, supportMandatoryUseCases); +} + +Status CameraAidlTest::isMonochromeCamera(const camera_metadata_t* staticMeta) { + Status ret = Status::OPERATION_NOT_SUPPORTED; + if (nullptr == staticMeta) { + return Status::ILLEGAL_ARGUMENT; + } + + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + &entry); + if (0 != rc) { + return Status::ILLEGAL_ARGUMENT; + } + + for (size_t i = 0; i < entry.count; i++) { + if (ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME == entry.data.u8[i]) { + ret = Status::OK; + break; + } + } + + return ret; +} + +Status CameraAidlTest::isLogicalMultiCamera(const camera_metadata_t* staticMeta) { + Status ret = Status::OPERATION_NOT_SUPPORTED; + if (nullptr == staticMeta) { + return Status::ILLEGAL_ARGUMENT; + } + + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + &entry); + if (0 != rc) { + return Status::ILLEGAL_ARGUMENT; + } + + for (size_t i = 0; i < entry.count; i++) { + if (ANDROID_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA == entry.data.u8[i]) { + ret = Status::OK; + break; + } + } + + return ret; +} + +void CameraAidlTest::verifyLogicalCameraResult(const camera_metadata_t* staticMetadata, + const std::vector& resultMetadata) { + camera_metadata_t* metadata = (camera_metadata_t*)resultMetadata.data(); + + std::unordered_set physicalIds; + Status rc = getPhysicalCameraIds(staticMetadata, &physicalIds); + ASSERT_TRUE(Status::OK == rc); + ASSERT_TRUE(physicalIds.size() > 1); + + camera_metadata_ro_entry entry; + // Check mainPhysicalId + find_camera_metadata_ro_entry(metadata, ANDROID_LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID, + &entry); + if (entry.count > 0) { + std::string mainPhysicalId(reinterpret_cast(entry.data.u8)); + ASSERT_NE(physicalIds.find(mainPhysicalId), physicalIds.end()); + } else { + ADD_FAILURE() << "Get LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID failed!"; + } +} + +Status CameraAidlTest::getPhysicalCameraIds(const camera_metadata_t* staticMeta, + std::unordered_set* physicalIds) { + if ((nullptr == staticMeta) || (nullptr == physicalIds)) { + return Status::ILLEGAL_ARGUMENT; + } + + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS, + &entry); + if (0 != rc) { + return Status::ILLEGAL_ARGUMENT; + } + + const uint8_t* ids = entry.data.u8; + size_t start = 0; + for (size_t i = 0; i < entry.count; i++) { + if (ids[i] == '\0') { + if (start != i) { + std::string currentId(reinterpret_cast(ids + start)); + physicalIds->emplace(currentId); + } + start = i + 1; + } + } + + return Status::OK; +} + +Status CameraAidlTest::getSystemCameraKind(const camera_metadata_t* staticMeta, + SystemCameraKind* systemCameraKind) { + if (nullptr == staticMeta || nullptr == systemCameraKind) { + return Status::ILLEGAL_ARGUMENT; + } + + camera_metadata_ro_entry entry{}; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + &entry); + if (0 != rc) { + return Status::ILLEGAL_ARGUMENT; + } + + if (entry.count == 1 && + entry.data.u8[0] == ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA) { + *systemCameraKind = SystemCameraKind::HIDDEN_SECURE_CAMERA; + return Status::OK; + } + + // Go through the capabilities and check if it has + // ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA + for (size_t i = 0; i < entry.count; ++i) { + uint8_t capability = entry.data.u8[i]; + if (capability == ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA) { + *systemCameraKind = SystemCameraKind::SYSTEM_ONLY_CAMERA; + return Status::OK; + } + } + *systemCameraKind = SystemCameraKind::PUBLIC; + return Status::OK; +} + +void CameraAidlTest::notifyDeviceState(int64_t state) { + if (mProvider == nullptr) { + return; + } + mProvider->notifyDeviceStateChange(state); +} + +void CameraAidlTest::allocateGraphicBuffer(uint32_t width, uint32_t height, uint64_t usage, + PixelFormat format, buffer_handle_t* buffer_handle) { + ASSERT_NE(buffer_handle, nullptr); + + uint32_t stride; + + android::status_t err = android::GraphicBufferAllocator::get().allocateRawHandle( + width, height, static_cast(format), 1u /*layerCount*/, usage, buffer_handle, + &stride, "VtsHalCameraProviderV2"); + ASSERT_EQ(err, android::NO_ERROR); +} + +bool CameraAidlTest::matchDeviceName(const std::string& deviceName, const std::string& providerType, + std::string* deviceVersion, std::string* cameraId) { + // "device@/legacy/" + std::string pattern; + pattern.append("device@([0-9]+\\.[0-9]+)/"); + pattern.append(providerType); + pattern.append("/(.+)"); + + std::regex e(pattern); + std::smatch sm; + if (std::regex_match(deviceName, sm, e)) { + if (deviceVersion != nullptr) { + *deviceVersion = sm[1]; + } + if (cameraId != nullptr) { + *cameraId = sm[2]; + } + return true; + } + return false; +} + +void CameraAidlTest::verifyCameraCharacteristics(const CameraMetadata& chars) { + const camera_metadata_t* metadata = + reinterpret_cast(chars.metadata.data()); + + size_t expectedSize = chars.metadata.size(); + int result = validate_camera_metadata_structure(metadata, &expectedSize); + ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED)); + size_t entryCount = get_camera_metadata_entry_count(metadata); + // TODO: we can do better than 0 here. Need to check how many required + // characteristics keys we've defined. + ASSERT_GT(entryCount, 0u); + + camera_metadata_ro_entry entry; + int retcode = + find_camera_metadata_ro_entry(metadata, ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL, &entry); + if ((0 == retcode) && (entry.count > 0)) { + uint8_t hardwareLevel = entry.data.u8[0]; + ASSERT_TRUE(hardwareLevel == ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED || + hardwareLevel == ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL || + hardwareLevel == ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_3 || + hardwareLevel == ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL); + } else { + ADD_FAILURE() << "Get camera hardware level failed!"; + } + + entry.count = 0; + retcode = find_camera_metadata_ro_entry( + metadata, ANDROID_REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION, &entry); + if ((0 == retcode) || (entry.count > 0)) { + ADD_FAILURE() << "ANDROID_REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION " + << " per API contract should never be set by Hal!"; + } + retcode = find_camera_metadata_ro_entry( + metadata, ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS, &entry); + if ((0 == retcode) || (entry.count > 0)) { + ADD_FAILURE() << "ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS" + << " per API contract should never be set by Hal!"; + } + retcode = find_camera_metadata_ro_entry( + metadata, ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS, &entry); + if ((0 == retcode) || (entry.count > 0)) { + ADD_FAILURE() << "ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS" + << " per API contract should never be set by Hal!"; + } + retcode = find_camera_metadata_ro_entry( + metadata, ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS, &entry); + if ((0 == retcode) || (entry.count > 0)) { + ADD_FAILURE() << "ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS" + << " per API contract should never be set by Hal!"; + } + + retcode = find_camera_metadata_ro_entry( + metadata, ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS, &entry); + if (0 == retcode || entry.count > 0) { + ADD_FAILURE() << "ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS " + << " per API contract should never be set by Hal!"; + } + + retcode = find_camera_metadata_ro_entry( + metadata, ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS, &entry); + if (0 == retcode || entry.count > 0) { + ADD_FAILURE() << "ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS " + << " per API contract should never be set by Hal!"; + } + + retcode = find_camera_metadata_ro_entry(metadata, ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS, + &entry); + if (0 == retcode || entry.count > 0) { + ADD_FAILURE() << "ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS " + << " per API contract should never be set by Hal!"; + } + + retcode = find_camera_metadata_ro_entry(metadata, ANDROID_HEIC_INFO_SUPPORTED, &entry); + if (0 == retcode && entry.count > 0) { + retcode = find_camera_metadata_ro_entry( + metadata, ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT, &entry); + if (0 == retcode && entry.count > 0) { + uint8_t maxJpegAppSegmentsCount = entry.data.u8[0]; + ASSERT_TRUE(maxJpegAppSegmentsCount >= 1 && maxJpegAppSegmentsCount <= 16); + } else { + ADD_FAILURE() << "Get Heic maxJpegAppSegmentsCount failed!"; + } + } + + retcode = find_camera_metadata_ro_entry(metadata, ANDROID_LENS_POSE_REFERENCE, &entry); + if (0 == retcode && entry.count > 0) { + uint8_t poseReference = entry.data.u8[0]; + ASSERT_TRUE(poseReference <= ANDROID_LENS_POSE_REFERENCE_UNDEFINED && + poseReference >= ANDROID_LENS_POSE_REFERENCE_PRIMARY_CAMERA); + } + + retcode = + find_camera_metadata_ro_entry(metadata, ANDROID_INFO_DEVICE_STATE_ORIENTATIONS, &entry); + if (0 == retcode && entry.count > 0) { + ASSERT_TRUE((entry.count % 2) == 0); + uint64_t maxPublicState = ((uint64_t)ICameraProvider::DEVICE_STATE_FOLDED) << 1; + uint64_t vendorStateStart = 1UL << 31; // Reserved for vendor specific states + uint64_t stateMask = (1 << vendorStateStart) - 1; + stateMask &= ~((1 << maxPublicState) - 1); + for (int i = 0; i < entry.count; i += 2) { + ASSERT_TRUE((entry.data.i64[i] & stateMask) == 0); + ASSERT_TRUE((entry.data.i64[i + 1] % 90) == 0); + } + } + + verifyExtendedSceneModeCharacteristics(metadata); + verifyZoomCharacteristics(metadata); + verifyStreamUseCaseCharacteristics(metadata); +} + +void CameraAidlTest::verifyExtendedSceneModeCharacteristics(const camera_metadata_t* metadata) { + camera_metadata_ro_entry entry; + int retcode = 0; + + retcode = find_camera_metadata_ro_entry(metadata, ANDROID_CONTROL_AVAILABLE_MODES, &entry); + if ((0 == retcode) && (entry.count > 0)) { + for (auto i = 0; i < entry.count; i++) { + ASSERT_TRUE(entry.data.u8[i] >= ANDROID_CONTROL_MODE_OFF && + entry.data.u8[i] <= ANDROID_CONTROL_MODE_USE_EXTENDED_SCENE_MODE); + } + } else { + ADD_FAILURE() << "Get camera controlAvailableModes failed!"; + } + + // Check key availability in capabilities, request and result. + + retcode = + find_camera_metadata_ro_entry(metadata, ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS, &entry); + bool hasExtendedSceneModeRequestKey = false; + if ((0 == retcode) && (entry.count > 0)) { + hasExtendedSceneModeRequestKey = + std::find(entry.data.i32, entry.data.i32 + entry.count, + ANDROID_CONTROL_EXTENDED_SCENE_MODE) != entry.data.i32 + entry.count; + } else { + ADD_FAILURE() << "Get camera availableRequestKeys failed!"; + } + + retcode = + find_camera_metadata_ro_entry(metadata, ANDROID_REQUEST_AVAILABLE_RESULT_KEYS, &entry); + bool hasExtendedSceneModeResultKey = false; + if ((0 == retcode) && (entry.count > 0)) { + hasExtendedSceneModeResultKey = + std::find(entry.data.i32, entry.data.i32 + entry.count, + ANDROID_CONTROL_EXTENDED_SCENE_MODE) != entry.data.i32 + entry.count; + } else { + ADD_FAILURE() << "Get camera availableResultKeys failed!"; + } + + retcode = find_camera_metadata_ro_entry(metadata, + ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, &entry); + bool hasExtendedSceneModeMaxSizesKey = false; + bool hasExtendedSceneModeZoomRatioRangesKey = false; + if ((0 == retcode) && (entry.count > 0)) { + hasExtendedSceneModeMaxSizesKey = + std::find(entry.data.i32, entry.data.i32 + entry.count, + ANDROID_CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_MAX_SIZES) != + entry.data.i32 + entry.count; + hasExtendedSceneModeZoomRatioRangesKey = + std::find(entry.data.i32, entry.data.i32 + entry.count, + ANDROID_CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_ZOOM_RATIO_RANGES) != + entry.data.i32 + entry.count; + } else { + ADD_FAILURE() << "Get camera availableCharacteristicsKeys failed!"; + } + + camera_metadata_ro_entry maxSizesEntry; + retcode = find_camera_metadata_ro_entry( + metadata, ANDROID_CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_MAX_SIZES, &maxSizesEntry); + bool hasExtendedSceneModeMaxSizes = (0 == retcode && maxSizesEntry.count > 0); + + camera_metadata_ro_entry zoomRatioRangesEntry; + retcode = find_camera_metadata_ro_entry( + metadata, ANDROID_CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_ZOOM_RATIO_RANGES, + &zoomRatioRangesEntry); + bool hasExtendedSceneModeZoomRatioRanges = (0 == retcode && zoomRatioRangesEntry.count > 0); + + // Extended scene mode keys must all be available, or all be unavailable. + bool noExtendedSceneMode = + !hasExtendedSceneModeRequestKey && !hasExtendedSceneModeResultKey && + !hasExtendedSceneModeMaxSizesKey && !hasExtendedSceneModeZoomRatioRangesKey && + !hasExtendedSceneModeMaxSizes && !hasExtendedSceneModeZoomRatioRanges; + if (noExtendedSceneMode) { + return; + } + bool hasExtendedSceneMode = hasExtendedSceneModeRequestKey && hasExtendedSceneModeResultKey && + hasExtendedSceneModeMaxSizesKey && + hasExtendedSceneModeZoomRatioRangesKey && + hasExtendedSceneModeMaxSizes && hasExtendedSceneModeZoomRatioRanges; + ASSERT_TRUE(hasExtendedSceneMode); + + // Must have DISABLED, and must have one of BOKEH_STILL_CAPTURE, BOKEH_CONTINUOUS, or a VENDOR + // mode. + ASSERT_TRUE((maxSizesEntry.count == 6 && zoomRatioRangesEntry.count == 2) || + (maxSizesEntry.count == 9 && zoomRatioRangesEntry.count == 4)); + bool hasDisabledMode = false; + bool hasBokehStillCaptureMode = false; + bool hasBokehContinuousMode = false; + bool hasVendorMode = false; + std::vector outputStreams; + ASSERT_EQ(Status::OK, getAvailableOutputStreams(metadata, outputStreams)); + for (int i = 0, j = 0; i < maxSizesEntry.count && j < zoomRatioRangesEntry.count; i += 3) { + int32_t mode = maxSizesEntry.data.i32[i]; + int32_t maxWidth = maxSizesEntry.data.i32[i + 1]; + int32_t maxHeight = maxSizesEntry.data.i32[i + 2]; + switch (mode) { + case ANDROID_CONTROL_EXTENDED_SCENE_MODE_DISABLED: + hasDisabledMode = true; + ASSERT_TRUE(maxWidth == 0 && maxHeight == 0); + break; + case ANDROID_CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE: + hasBokehStillCaptureMode = true; + j += 2; + break; + case ANDROID_CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS: + hasBokehContinuousMode = true; + j += 2; + break; + default: + if (mode < ANDROID_CONTROL_EXTENDED_SCENE_MODE_VENDOR_START) { + ADD_FAILURE() << "Invalid extended scene mode advertised: " << mode; + } else { + hasVendorMode = true; + j += 2; + } + break; + } + + if (mode != ANDROID_CONTROL_EXTENDED_SCENE_MODE_DISABLED) { + // Make sure size is supported. + bool sizeSupported = false; + for (const auto& stream : outputStreams) { + if ((stream.format == static_cast(PixelFormat::YCBCR_420_888) || + stream.format == static_cast(PixelFormat::IMPLEMENTATION_DEFINED)) && + stream.width == maxWidth && stream.height == maxHeight) { + sizeSupported = true; + break; + } + } + ASSERT_TRUE(sizeSupported); + + // Make sure zoom range is valid + float minZoomRatio = zoomRatioRangesEntry.data.f[0]; + float maxZoomRatio = zoomRatioRangesEntry.data.f[1]; + ASSERT_GT(minZoomRatio, 0.0f); + ASSERT_LE(minZoomRatio, maxZoomRatio); + } + } + ASSERT_TRUE(hasDisabledMode); + ASSERT_TRUE(hasBokehStillCaptureMode || hasBokehContinuousMode || hasVendorMode); +} + +Status CameraAidlTest::getAvailableOutputStreams(const camera_metadata_t* staticMeta, + std::vector& outputStreams, + const AvailableStream* threshold, + bool maxResolution) { + AvailableStream depthPreviewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::Y16)}; + if (nullptr == staticMeta) { + return Status::ILLEGAL_ARGUMENT; + } + int scalerTag = maxResolution + ? ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION + : ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS; + int depthTag = maxResolution + ? ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION + : ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS; + + camera_metadata_ro_entry scalerEntry; + camera_metadata_ro_entry depthEntry; + int foundScaler = find_camera_metadata_ro_entry(staticMeta, scalerTag, &scalerEntry); + int foundDepth = find_camera_metadata_ro_entry(staticMeta, depthTag, &depthEntry); + if ((0 != foundScaler || (0 != (scalerEntry.count % 4))) && + (0 != foundDepth || (0 != (depthEntry.count % 4)))) { + return Status::ILLEGAL_ARGUMENT; + } + + if (foundScaler == 0 && (0 == (scalerEntry.count % 4))) { + fillOutputStreams(&scalerEntry, outputStreams, threshold, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT); + } + + if (foundDepth == 0 && (0 == (depthEntry.count % 4))) { + fillOutputStreams(&depthEntry, outputStreams, &depthPreviewThreshold, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT); + } + + return Status::OK; +} + +void CameraAidlTest::fillOutputStreams(camera_metadata_ro_entry_t* entry, + std::vector& outputStreams, + const AvailableStream* threshold, + const int32_t availableConfigOutputTag) { + for (size_t i = 0; i < entry->count; i += 4) { + if (availableConfigOutputTag == entry->data.i32[i + 3]) { + if (nullptr == threshold) { + AvailableStream s = {entry->data.i32[i + 1], entry->data.i32[i + 2], + entry->data.i32[i]}; + outputStreams.push_back(s); + } else { + if ((threshold->format == entry->data.i32[i]) && + (threshold->width >= entry->data.i32[i + 1]) && + (threshold->height >= entry->data.i32[i + 2])) { + AvailableStream s = {entry->data.i32[i + 1], entry->data.i32[i + 2], + threshold->format}; + outputStreams.push_back(s); + } + } + } + } +} + +void CameraAidlTest::verifyZoomCharacteristics(const camera_metadata_t* metadata) { + camera_metadata_ro_entry entry; + int retcode = 0; + + // Check key availability in capabilities, request and result. + retcode = find_camera_metadata_ro_entry(metadata, ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM, + &entry); + float maxDigitalZoom = 1.0; + if ((0 == retcode) && (entry.count == 1)) { + maxDigitalZoom = entry.data.f[0]; + } else { + ADD_FAILURE() << "Get camera scalerAvailableMaxDigitalZoom failed!"; + } + + retcode = + find_camera_metadata_ro_entry(metadata, ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS, &entry); + bool hasZoomRequestKey = false; + if ((0 == retcode) && (entry.count > 0)) { + hasZoomRequestKey = std::find(entry.data.i32, entry.data.i32 + entry.count, + ANDROID_CONTROL_ZOOM_RATIO) != entry.data.i32 + entry.count; + } else { + ADD_FAILURE() << "Get camera availableRequestKeys failed!"; + } + + retcode = + find_camera_metadata_ro_entry(metadata, ANDROID_REQUEST_AVAILABLE_RESULT_KEYS, &entry); + bool hasZoomResultKey = false; + if ((0 == retcode) && (entry.count > 0)) { + hasZoomResultKey = std::find(entry.data.i32, entry.data.i32 + entry.count, + ANDROID_CONTROL_ZOOM_RATIO) != entry.data.i32 + entry.count; + } else { + ADD_FAILURE() << "Get camera availableResultKeys failed!"; + } + + retcode = find_camera_metadata_ro_entry(metadata, + ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, &entry); + bool hasZoomCharacteristicsKey = false; + if ((0 == retcode) && (entry.count > 0)) { + hasZoomCharacteristicsKey = + std::find(entry.data.i32, entry.data.i32 + entry.count, + ANDROID_CONTROL_ZOOM_RATIO_RANGE) != entry.data.i32 + entry.count; + } else { + ADD_FAILURE() << "Get camera availableCharacteristicsKeys failed!"; + } + + retcode = find_camera_metadata_ro_entry(metadata, ANDROID_CONTROL_ZOOM_RATIO_RANGE, &entry); + bool hasZoomRatioRange = (0 == retcode && entry.count == 2); + + // Zoom keys must all be available, or all be unavailable. + bool noZoomRatio = !hasZoomRequestKey && !hasZoomResultKey && !hasZoomCharacteristicsKey && + !hasZoomRatioRange; + if (noZoomRatio) { + return; + } + bool hasZoomRatio = + hasZoomRequestKey && hasZoomResultKey && hasZoomCharacteristicsKey && hasZoomRatioRange; + ASSERT_TRUE(hasZoomRatio); + + float minZoomRatio = entry.data.f[0]; + float maxZoomRatio = entry.data.f[1]; + constexpr float FLOATING_POINT_THRESHOLD = 0.00001f; + if (maxDigitalZoom > maxZoomRatio + FLOATING_POINT_THRESHOLD) { + ADD_FAILURE() << "Maximum digital zoom " << maxDigitalZoom + << " is larger than maximum zoom ratio " << maxZoomRatio << " + threshold " + << FLOATING_POINT_THRESHOLD << "!"; + } + if (minZoomRatio > maxZoomRatio) { + ADD_FAILURE() << "Maximum zoom ratio is less than minimum zoom ratio!"; + } + if (minZoomRatio > 1.0f) { + ADD_FAILURE() << "Minimum zoom ratio is more than 1.0!"; + } + if (maxZoomRatio < 1.0f) { + ADD_FAILURE() << "Maximum zoom ratio is less than 1.0!"; + } + + // Make sure CROPPING_TYPE is CENTER_ONLY + retcode = find_camera_metadata_ro_entry(metadata, ANDROID_SCALER_CROPPING_TYPE, &entry); + if ((0 == retcode) && (entry.count == 1)) { + int8_t croppingType = entry.data.u8[0]; + ASSERT_EQ(croppingType, ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY); + } else { + ADD_FAILURE() << "Get camera scalerCroppingType failed!"; + } +} + +void CameraAidlTest::verifyMonochromeCharacteristics(const CameraMetadata& chars) { + const camera_metadata_t* metadata = (camera_metadata_t*)chars.metadata.data(); + Status rc = isMonochromeCamera(metadata); + if (Status::OPERATION_NOT_SUPPORTED == rc) { + return; + } + ASSERT_EQ(Status::OK, rc); + + camera_metadata_ro_entry entry; + // Check capabilities + int retcode = + find_camera_metadata_ro_entry(metadata, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, &entry); + if ((0 == retcode) && (entry.count > 0)) { + ASSERT_EQ(std::find(entry.data.u8, entry.data.u8 + entry.count, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING), + entry.data.u8 + entry.count); + } + + // Check Cfa + retcode = find_camera_metadata_ro_entry(metadata, ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT, + &entry); + if ((0 == retcode) && (entry.count == 1)) { + ASSERT_TRUE(entry.data.i32[0] == + static_cast( + SensorInfoColorFilterArrangement:: + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO) || + entry.data.i32[0] == + static_cast( + SensorInfoColorFilterArrangement:: + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR)); + } + + // Check availableRequestKeys + retcode = + find_camera_metadata_ro_entry(metadata, ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS, &entry); + if ((0 == retcode) && (entry.count > 0)) { + for (size_t i = 0; i < entry.count; i++) { + ASSERT_NE(entry.data.i32[i], ANDROID_COLOR_CORRECTION_MODE); + ASSERT_NE(entry.data.i32[i], ANDROID_COLOR_CORRECTION_TRANSFORM); + ASSERT_NE(entry.data.i32[i], ANDROID_COLOR_CORRECTION_GAINS); + } + } else { + ADD_FAILURE() << "Get camera availableRequestKeys failed!"; + } + + // Check availableResultKeys + retcode = + find_camera_metadata_ro_entry(metadata, ANDROID_REQUEST_AVAILABLE_RESULT_KEYS, &entry); + if ((0 == retcode) && (entry.count > 0)) { + for (size_t i = 0; i < entry.count; i++) { + ASSERT_NE(entry.data.i32[i], ANDROID_SENSOR_GREEN_SPLIT); + ASSERT_NE(entry.data.i32[i], ANDROID_SENSOR_NEUTRAL_COLOR_POINT); + ASSERT_NE(entry.data.i32[i], ANDROID_COLOR_CORRECTION_MODE); + ASSERT_NE(entry.data.i32[i], ANDROID_COLOR_CORRECTION_TRANSFORM); + ASSERT_NE(entry.data.i32[i], ANDROID_COLOR_CORRECTION_GAINS); + } + } else { + ADD_FAILURE() << "Get camera availableResultKeys failed!"; + } + + // Check availableCharacteristicKeys + retcode = find_camera_metadata_ro_entry(metadata, + ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, &entry); + if ((0 == retcode) && (entry.count > 0)) { + for (size_t i = 0; i < entry.count; i++) { + ASSERT_NE(entry.data.i32[i], ANDROID_SENSOR_REFERENCE_ILLUMINANT1); + ASSERT_NE(entry.data.i32[i], ANDROID_SENSOR_REFERENCE_ILLUMINANT2); + ASSERT_NE(entry.data.i32[i], ANDROID_SENSOR_CALIBRATION_TRANSFORM1); + ASSERT_NE(entry.data.i32[i], ANDROID_SENSOR_CALIBRATION_TRANSFORM2); + ASSERT_NE(entry.data.i32[i], ANDROID_SENSOR_COLOR_TRANSFORM1); + ASSERT_NE(entry.data.i32[i], ANDROID_SENSOR_COLOR_TRANSFORM2); + ASSERT_NE(entry.data.i32[i], ANDROID_SENSOR_FORWARD_MATRIX1); + ASSERT_NE(entry.data.i32[i], ANDROID_SENSOR_FORWARD_MATRIX2); + } + } else { + ADD_FAILURE() << "Get camera availableResultKeys failed!"; + } + + // Check blackLevelPattern + retcode = find_camera_metadata_ro_entry(metadata, ANDROID_SENSOR_BLACK_LEVEL_PATTERN, &entry); + if ((0 == retcode) && (entry.count > 0)) { + ASSERT_EQ(entry.count, 4); + for (size_t i = 1; i < entry.count; i++) { + ASSERT_EQ(entry.data.i32[i], entry.data.i32[0]); + } + } +} + +void CameraAidlTest::verifyRecommendedConfigs(const CameraMetadata& chars) { + size_t CONFIG_ENTRY_SIZE = 5; + size_t CONFIG_ENTRY_TYPE_OFFSET = 3; + size_t CONFIG_ENTRY_BITFIELD_OFFSET = 4; + uint32_t maxPublicUsecase = + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END_3_8; + uint32_t vendorUsecaseStart = + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VENDOR_START; + uint32_t usecaseMask = (1 << vendorUsecaseStart) - 1; + usecaseMask &= ~((1 << maxPublicUsecase) - 1); + + const camera_metadata_t* metadata = + reinterpret_cast(chars.metadata.data()); + + camera_metadata_ro_entry recommendedConfigsEntry, recommendedDepthConfigsEntry, ioMapEntry; + recommendedConfigsEntry.count = recommendedDepthConfigsEntry.count = ioMapEntry.count = 0; + int retCode = find_camera_metadata_ro_entry( + metadata, ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS, + &recommendedConfigsEntry); + int depthRetCode = find_camera_metadata_ro_entry( + metadata, ANDROID_DEPTH_AVAILABLE_RECOMMENDED_DEPTH_STREAM_CONFIGURATIONS, + &recommendedDepthConfigsEntry); + int ioRetCode = find_camera_metadata_ro_entry( + metadata, ANDROID_SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP, &ioMapEntry); + if ((0 != retCode) && (0 != depthRetCode)) { + // In case both regular and depth recommended configurations are absent, + // I/O should be absent as well. + ASSERT_NE(ioRetCode, 0); + return; + } + + camera_metadata_ro_entry availableKeysEntry; + retCode = find_camera_metadata_ro_entry( + metadata, ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, &availableKeysEntry); + ASSERT_TRUE((0 == retCode) && (availableKeysEntry.count > 0)); + std::vector availableKeys; + availableKeys.reserve(availableKeysEntry.count); + availableKeys.insert(availableKeys.end(), availableKeysEntry.data.i32, + availableKeysEntry.data.i32 + availableKeysEntry.count); + + if (recommendedConfigsEntry.count > 0) { + ASSERT_NE(std::find(availableKeys.begin(), availableKeys.end(), + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS), + availableKeys.end()); + ASSERT_EQ((recommendedConfigsEntry.count % CONFIG_ENTRY_SIZE), 0); + for (size_t i = 0; i < recommendedConfigsEntry.count; i += CONFIG_ENTRY_SIZE) { + int32_t entryType = recommendedConfigsEntry.data.i32[i + CONFIG_ENTRY_TYPE_OFFSET]; + uint32_t bitfield = recommendedConfigsEntry.data.i32[i + CONFIG_ENTRY_BITFIELD_OFFSET]; + ASSERT_TRUE((entryType == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT) || + (entryType == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT)); + ASSERT_TRUE((bitfield & usecaseMask) == 0); + } + } + + if (recommendedDepthConfigsEntry.count > 0) { + ASSERT_NE(std::find(availableKeys.begin(), availableKeys.end(), + ANDROID_DEPTH_AVAILABLE_RECOMMENDED_DEPTH_STREAM_CONFIGURATIONS), + availableKeys.end()); + ASSERT_EQ((recommendedDepthConfigsEntry.count % CONFIG_ENTRY_SIZE), 0); + for (size_t i = 0; i < recommendedDepthConfigsEntry.count; i += CONFIG_ENTRY_SIZE) { + int32_t entryType = recommendedDepthConfigsEntry.data.i32[i + CONFIG_ENTRY_TYPE_OFFSET]; + uint32_t bitfield = + recommendedDepthConfigsEntry.data.i32[i + CONFIG_ENTRY_BITFIELD_OFFSET]; + ASSERT_TRUE((entryType == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT) || + (entryType == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT)); + ASSERT_TRUE((bitfield & usecaseMask) == 0); + } + + if (recommendedConfigsEntry.count == 0) { + // In case regular recommended configurations are absent but suggested depth + // configurations are present, I/O should be absent. + ASSERT_NE(ioRetCode, 0); + } + } + + if ((ioRetCode == 0) && (ioMapEntry.count > 0)) { + ASSERT_NE(std::find(availableKeys.begin(), availableKeys.end(), + ANDROID_SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP), + availableKeys.end()); + ASSERT_EQ(isZSLModeAvailable(metadata), Status::OK); + } +} + +// Check whether ZSL is available using the static camera +// characteristics. +Status CameraAidlTest::isZSLModeAvailable(const camera_metadata_t* staticMeta) { + if (Status::OK == isZSLModeAvailable(staticMeta, PRIV_REPROCESS)) { + return Status::OK; + } else { + return isZSLModeAvailable(staticMeta, YUV_REPROCESS); + } +} + +Status CameraAidlTest::isZSLModeAvailable(const camera_metadata_t* staticMeta, + ReprocessType reprocType) { + Status ret = Status::OPERATION_NOT_SUPPORTED; + if (nullptr == staticMeta) { + return Status::ILLEGAL_ARGUMENT; + } + + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + &entry); + if (0 != rc) { + return Status::ILLEGAL_ARGUMENT; + } + + for (size_t i = 0; i < entry.count; i++) { + if ((reprocType == PRIV_REPROCESS && + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING == entry.data.u8[i]) || + (reprocType == YUV_REPROCESS && + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING == entry.data.u8[i])) { + ret = Status::OK; + break; + } + } + + return ret; +} + +// Verify logical or ultra high resolution camera static metadata +void CameraAidlTest::verifyLogicalOrUltraHighResCameraMetadata( + const std::string& cameraName, const std::shared_ptr& device, + const CameraMetadata& chars, const std::vector& deviceNames) { + const camera_metadata_t* metadata = + reinterpret_cast(chars.metadata.data()); + ASSERT_NE(nullptr, metadata); + SystemCameraKind systemCameraKind = SystemCameraKind::PUBLIC; + Status retStatus = getSystemCameraKind(metadata, &systemCameraKind); + ASSERT_EQ(retStatus, Status::OK); + Status rc = isLogicalMultiCamera(metadata); + ASSERT_TRUE(Status::OK == rc || Status::OPERATION_NOT_SUPPORTED == rc); + bool isMultiCamera = (Status::OK == rc); + bool isUltraHighResCamera = isUltraHighResolution(metadata); + if (!isMultiCamera && !isUltraHighResCamera) { + return; + } + + camera_metadata_ro_entry entry; + int retcode = find_camera_metadata_ro_entry(metadata, ANDROID_CONTROL_ZOOM_RATIO_RANGE, &entry); + bool hasZoomRatioRange = (0 == retcode && entry.count == 2); + retcode = find_camera_metadata_ro_entry( + metadata, ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION, &entry); + bool hasHalBufferManager = + (0 == retcode && 1 == entry.count && + entry.data.i32[0] == ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5); + 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); + } + + std::string version, cameraId; + ASSERT_TRUE(::matchDeviceName(cameraName, mProviderType, &version, &cameraId)); + std::unordered_set physicalIds; + rc = getPhysicalCameraIds(metadata, &physicalIds); + ASSERT_TRUE(isUltraHighResCamera || Status::OK == rc); + for (const auto& physicalId : physicalIds) { + ASSERT_NE(physicalId, cameraId); + } + if (physicalIds.size() == 0) { + ASSERT_TRUE(isUltraHighResCamera && !isMultiCamera); + physicalIds.insert(cameraId); + } + + std::unordered_set physicalRequestKeyIDs; + rc = getSupportedKeys(const_cast(metadata), + ANDROID_REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS, + &physicalRequestKeyIDs); + ASSERT_TRUE(Status::OK == rc); + bool hasTestPatternPhysicalRequestKey = + physicalRequestKeyIDs.find(ANDROID_SENSOR_TEST_PATTERN_MODE) != + physicalRequestKeyIDs.end(); + std::unordered_set privacyTestPatternModes; + getPrivacyTestPatternModes(metadata, &privacyTestPatternModes); + + // Map from image format to number of multi-resolution sizes for that format + std::unordered_map multiResOutputFormatCounterMap; + std::unordered_map multiResInputFormatCounterMap; + for (const auto& physicalId : physicalIds) { + bool isPublicId = false; + std::string fullPublicId; + SystemCameraKind physSystemCameraKind = SystemCameraKind::PUBLIC; + for (auto& deviceName : deviceNames) { + std::string publicVersion, publicId; + ASSERT_TRUE(::matchDeviceName(deviceName, mProviderType, &publicVersion, &publicId)); + if (physicalId == publicId) { + isPublicId = true; + fullPublicId = deviceName; + break; + } + } + + camera_metadata_ro_entry physicalMultiResStreamConfigs; + camera_metadata_ro_entry physicalStreamConfigs; + camera_metadata_ro_entry physicalMaxResolutionStreamConfigs; + bool isUltraHighRes = false; + std::unordered_set subCameraPrivacyTestPatterns; + if (isPublicId) { + std::shared_ptr subDevice; + ndk::ScopedAStatus ret = mProvider->getCameraDeviceInterface(fullPublicId, &subDevice); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(subDevice, nullptr); + + CameraMetadata subDeviceChars; + ret = subDevice->getCameraCharacteristics(&subDeviceChars); + ASSERT_TRUE(ret.isOk()); + + const camera_metadata_t* staticMetadata = + reinterpret_cast(subDeviceChars.metadata.data()); + retStatus = getSystemCameraKind(staticMetadata, &physSystemCameraKind); + ASSERT_EQ(retStatus, Status::OK); + + // Make sure that the system camera kind of a non-hidden + // physical cameras is the same as the logical camera associated + // with it. + ASSERT_EQ(physSystemCameraKind, systemCameraKind); + retcode = find_camera_metadata_ro_entry(staticMetadata, + ANDROID_CONTROL_ZOOM_RATIO_RANGE, &entry); + bool subCameraHasZoomRatioRange = (0 == retcode && entry.count == 2); + ASSERT_EQ(hasZoomRatioRange, subCameraHasZoomRatioRange); + + getMultiResolutionStreamConfigurations( + &physicalMultiResStreamConfigs, &physicalStreamConfigs, + &physicalMaxResolutionStreamConfigs, staticMetadata); + isUltraHighRes = isUltraHighResolution(staticMetadata); + + getPrivacyTestPatternModes(staticMetadata, &subCameraPrivacyTestPatterns); + } else { + // Check camera characteristics for hidden camera id + CameraMetadata physChars; + ndk::ScopedAStatus ret = + device->getPhysicalCameraCharacteristics(physicalId, &physChars); + ASSERT_TRUE(ret.isOk()); + verifyCameraCharacteristics(physChars); + verifyMonochromeCharacteristics(physChars); + + auto staticMetadata = (const camera_metadata_t*)physChars.metadata.data(); + retcode = find_camera_metadata_ro_entry(staticMetadata, + ANDROID_CONTROL_ZOOM_RATIO_RANGE, &entry); + bool subCameraHasZoomRatioRange = (0 == retcode && entry.count == 2); + ASSERT_EQ(hasZoomRatioRange, subCameraHasZoomRatioRange); + + getMultiResolutionStreamConfigurations( + &physicalMultiResStreamConfigs, &physicalStreamConfigs, + &physicalMaxResolutionStreamConfigs, staticMetadata); + isUltraHighRes = isUltraHighResolution(staticMetadata); + getPrivacyTestPatternModes(staticMetadata, &subCameraPrivacyTestPatterns); + + // Check calling getCameraDeviceInterface_V3_x() on hidden camera id returns + // ILLEGAL_ARGUMENT. + std::stringstream s; + s << "device@" << version << "/" << mProviderType << "/" << physicalId; + std::string fullPhysicalId(s.str()); + std::shared_ptr subDevice; + ret = mProvider->getCameraDeviceInterface(fullPhysicalId, &subDevice); + ASSERT_TRUE(static_cast(Status::ILLEGAL_ARGUMENT) == + ret.getServiceSpecificError()); + ASSERT_EQ(subDevice, nullptr); + } + + if (hasTestPatternPhysicalRequestKey) { + ASSERT_TRUE(privacyTestPatternModes == subCameraPrivacyTestPatterns); + } + + if (physicalMultiResStreamConfigs.count > 0) { + ASSERT_EQ(physicalMultiResStreamConfigs.count % 4, 0); + + // Each supported size must be max size for that format, + for (size_t i = 0; i < physicalMultiResStreamConfigs.count / 4; i++) { + int32_t multiResFormat = physicalMultiResStreamConfigs.data.i32[i * 4]; + int32_t multiResWidth = physicalMultiResStreamConfigs.data.i32[i * 4 + 1]; + int32_t multiResHeight = physicalMultiResStreamConfigs.data.i32[i * 4 + 2]; + int32_t multiResInput = physicalMultiResStreamConfigs.data.i32[i * 4 + 3]; + + // Check if the resolution is the max resolution in stream + // configuration map + bool supported = false; + bool isMaxSize = true; + for (size_t j = 0; j < physicalStreamConfigs.count / 4; j++) { + int32_t format = physicalStreamConfigs.data.i32[j * 4]; + int32_t width = physicalStreamConfigs.data.i32[j * 4 + 1]; + int32_t height = physicalStreamConfigs.data.i32[j * 4 + 2]; + int32_t input = physicalStreamConfigs.data.i32[j * 4 + 3]; + if (format == multiResFormat && input == multiResInput) { + if (width == multiResWidth && height == multiResHeight) { + supported = true; + } else if (width * height > multiResWidth * multiResHeight) { + isMaxSize = false; + } + } + } + // Check if the resolution is the max resolution in max + // resolution stream configuration map + bool supportedUltraHighRes = false; + bool isUltraHighResMaxSize = true; + for (size_t j = 0; j < physicalMaxResolutionStreamConfigs.count / 4; j++) { + int32_t format = physicalMaxResolutionStreamConfigs.data.i32[j * 4]; + int32_t width = physicalMaxResolutionStreamConfigs.data.i32[j * 4 + 1]; + int32_t height = physicalMaxResolutionStreamConfigs.data.i32[j * 4 + 2]; + int32_t input = physicalMaxResolutionStreamConfigs.data.i32[j * 4 + 3]; + if (format == multiResFormat && input == multiResInput) { + if (width == multiResWidth && height == multiResHeight) { + supportedUltraHighRes = true; + } else if (width * height > multiResWidth * multiResHeight) { + isUltraHighResMaxSize = false; + } + } + } + + if (isUltraHighRes) { + // For ultra high resolution camera, the configuration must + // be the maximum size in stream configuration map, or max + // resolution stream configuration map + ASSERT_TRUE((supported && isMaxSize) || + (supportedUltraHighRes && isUltraHighResMaxSize)); + } else { + // The configuration must be the maximum size in stream + // configuration map + ASSERT_TRUE(supported && isMaxSize); + ASSERT_FALSE(supportedUltraHighRes); + } + + // Increment the counter for the configuration's format. + auto& formatCounterMap = multiResInput ? multiResInputFormatCounterMap + : multiResOutputFormatCounterMap; + if (formatCounterMap.count(multiResFormat) == 0) { + formatCounterMap[multiResFormat] = 1; + } else { + formatCounterMap[multiResFormat]++; + } + } + + // There must be no duplicates + for (size_t i = 0; i < physicalMultiResStreamConfigs.count / 4 - 1; i++) { + for (size_t j = i + 1; j < physicalMultiResStreamConfigs.count / 4; j++) { + // Input/output doesn't match + if (physicalMultiResStreamConfigs.data.i32[i * 4 + 3] != + physicalMultiResStreamConfigs.data.i32[j * 4 + 3]) { + continue; + } + // Format doesn't match + if (physicalMultiResStreamConfigs.data.i32[i * 4] != + physicalMultiResStreamConfigs.data.i32[j * 4]) { + continue; + } + // Width doesn't match + if (physicalMultiResStreamConfigs.data.i32[i * 4 + 1] != + physicalMultiResStreamConfigs.data.i32[j * 4 + 1]) { + continue; + } + // Height doesn't match + if (physicalMultiResStreamConfigs.data.i32[i * 4 + 2] != + physicalMultiResStreamConfigs.data.i32[j * 4 + 2]) { + continue; + } + // input/output, format, width, and height all match + ADD_FAILURE(); + } + } + } + } + + // If a multi-resolution stream is supported, there must be at least one + // format with more than one resolutions + if (multiResolutionStreamSupported) { + size_t numMultiResFormats = 0; + for (const auto& [format, sizeCount] : multiResOutputFormatCounterMap) { + if (sizeCount >= 2) { + numMultiResFormats++; + } + } + for (const auto& [format, sizeCount] : multiResInputFormatCounterMap) { + if (sizeCount >= 2) { + numMultiResFormats++; + + // If multi-resolution reprocessing is supported, the logical + // camera or ultra-high resolution sensor camera must support + // the corresponding reprocessing capability. + if (format == static_cast(PixelFormat::IMPLEMENTATION_DEFINED)) { + ASSERT_EQ(isZSLModeAvailable(metadata, PRIV_REPROCESS), Status::OK); + } else if (format == static_cast(PixelFormat::YCBCR_420_888)) { + ASSERT_EQ(isZSLModeAvailable(metadata, YUV_REPROCESS), Status::OK); + } + } + } + ASSERT_GT(numMultiResFormats, 0); + } + + // Make sure ANDROID_LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID is available in + // result keys. + if (isMultiCamera) { + retcode = find_camera_metadata_ro_entry(metadata, ANDROID_REQUEST_AVAILABLE_RESULT_KEYS, + &entry); + if ((0 == retcode) && (entry.count > 0)) { + ASSERT_NE(std::find(entry.data.i32, entry.data.i32 + entry.count, + static_cast( + CameraMetadataTag:: + ANDROID_LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID)), + entry.data.i32 + entry.count); + } else { + ADD_FAILURE() << "Get camera availableResultKeys failed!"; + } + } +} + +bool CameraAidlTest::isUltraHighResolution(const camera_metadata_t* staticMeta) { + camera_metadata_ro_entry scalerEntry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + &scalerEntry); + if (rc == 0) { + for (uint32_t i = 0; i < scalerEntry.count; i++) { + if (scalerEntry.data.u8[i] == + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR) { + return true; + } + } + } + return false; +} + +Status CameraAidlTest::getSupportedKeys(camera_metadata_t* staticMeta, uint32_t tagId, + std::unordered_set* requestIDs) { + if ((nullptr == staticMeta) || (nullptr == requestIDs)) { + return Status::ILLEGAL_ARGUMENT; + } + + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry(staticMeta, tagId, &entry); + if ((0 != rc) || (entry.count == 0)) { + return Status::OK; + } + + requestIDs->insert(entry.data.i32, entry.data.i32 + entry.count); + + return Status::OK; +} + +void CameraAidlTest::getPrivacyTestPatternModes( + const camera_metadata_t* staticMetadata, + std::unordered_set* privacyTestPatternModes) { + ASSERT_NE(staticMetadata, nullptr); + ASSERT_NE(privacyTestPatternModes, nullptr); + + camera_metadata_ro_entry entry; + int retcode = find_camera_metadata_ro_entry( + staticMetadata, ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES, &entry); + ASSERT_TRUE(0 == retcode); + + for (auto i = 0; i < entry.count; i++) { + if (entry.data.i32[i] == ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR || + entry.data.i32[i] == ANDROID_SENSOR_TEST_PATTERN_MODE_BLACK) { + privacyTestPatternModes->insert(entry.data.i32[i]); + } + } +} + +void CameraAidlTest::getMultiResolutionStreamConfigurations( + camera_metadata_ro_entry* multiResStreamConfigs, camera_metadata_ro_entry* streamConfigs, + camera_metadata_ro_entry* maxResolutionStreamConfigs, + const camera_metadata_t* staticMetadata) { + ASSERT_NE(multiResStreamConfigs, nullptr); + ASSERT_NE(streamConfigs, nullptr); + ASSERT_NE(maxResolutionStreamConfigs, nullptr); + ASSERT_NE(staticMetadata, nullptr); + + int retcode = find_camera_metadata_ro_entry( + staticMetadata, ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, streamConfigs); + ASSERT_TRUE(0 == retcode); + retcode = find_camera_metadata_ro_entry( + staticMetadata, ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION, + maxResolutionStreamConfigs); + ASSERT_TRUE(-ENOENT == retcode || 0 == retcode); + retcode = find_camera_metadata_ro_entry( + staticMetadata, ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS, + multiResStreamConfigs); + ASSERT_TRUE(-ENOENT == retcode || 0 == retcode); +} + +bool CameraAidlTest::isTorchSupported(const camera_metadata_t* staticMeta) { + camera_metadata_ro_entry torchEntry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_FLASH_INFO_AVAILABLE, &torchEntry); + if (rc != 0) { + ALOGI("isTorchSupported: Failed to find entry for ANDROID_FLASH_INFO_AVAILABLE"); + return false; + } + if (torchEntry.count == 1 && !torchEntry.data.u8[0]) { + ALOGI("isTorchSupported: Torch not supported"); + return false; + } + ALOGI("isTorchSupported: Torch supported"); + return true; +} + +bool CameraAidlTest::isTorchStrengthControlSupported(const camera_metadata_t* staticMeta) { + int32_t maxLevel = 0; + camera_metadata_ro_entry maxEntry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL, + &maxEntry); + if (rc != 0) { + ALOGI("isTorchStrengthControlSupported: Failed to find entry for " + "ANDROID_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL"); + return false; + } + + maxLevel = *maxEntry.data.i32; + if (maxLevel > 1) { + ALOGI("isTorchStrengthControlSupported: Torch strength control supported."); + return true; + } + ALOGI("isTorchStrengthControlSupported: Torch strength control not supported."); + return false; +} + +void CameraAidlTest::verifyRequestTemplate(const camera_metadata_t* metadata, + RequestTemplate requestTemplate) { + ASSERT_NE(nullptr, metadata); + size_t entryCount = get_camera_metadata_entry_count(metadata); + ALOGI("template %u metadata entry count is %zu", (int32_t)requestTemplate, entryCount); + // TODO: we can do better than 0 here. Need to check how many required + // request keys we've defined for each template + ASSERT_GT(entryCount, 0u); + + // Check zoomRatio + camera_metadata_ro_entry zoomRatioEntry; + int foundZoomRatio = + find_camera_metadata_ro_entry(metadata, ANDROID_CONTROL_ZOOM_RATIO, &zoomRatioEntry); + if (foundZoomRatio == 0) { + ASSERT_EQ(zoomRatioEntry.count, 1); + ASSERT_EQ(zoomRatioEntry.data.f[0], 1.0f); + } +} + +void CameraAidlTest::openEmptyDeviceSession(const std::string& name, + std::shared_ptr provider, + std::shared_ptr* session, + CameraMetadata* staticMeta, + std::shared_ptr* device) { + ASSERT_NE(nullptr, session); + ASSERT_NE(nullptr, staticMeta); + ASSERT_NE(nullptr, device); + + ALOGI("configureStreams: Testing camera device %s", name.c_str()); + ndk::ScopedAStatus ret = provider->getCameraDeviceInterface(name, device); + ALOGI("getCameraDeviceInterface returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(device, nullptr); + + std::shared_ptr cb = ndk::SharedRefBase::make(); + ret = (*device)->open(cb, session); + ALOGI("device::open returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(*session, nullptr); + + ret = (*device)->getCameraCharacteristics(staticMeta); +} + +void CameraAidlTest::openEmptyInjectionSession(const std::string& name, + const std::shared_ptr& provider, + std::shared_ptr* session, + CameraMetadata* metadata, + std::shared_ptr* device) { + ASSERT_NE(nullptr, session); + ASSERT_NE(nullptr, metadata); + ASSERT_NE(nullptr, device); + + ALOGI("openEmptyInjectionSession: Testing camera device %s", name.c_str()); + ndk::ScopedAStatus ret = provider->getCameraDeviceInterface(name, device); + ALOGI("openEmptyInjectionSession: getCameraDeviceInterface returns status:%d:%d", + ret.getExceptionCode(), ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(*device, nullptr); + + std::shared_ptr cb = ndk::SharedRefBase::make(); + ret = (*device)->openInjectionSession(cb, session); + ALOGI("device::openInjectionSession returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + + if (static_cast(ret.getServiceSpecificError()) == Status::OPERATION_NOT_SUPPORTED && + *session == nullptr) { + return; // Injection Session not supported. Callee will receive nullptr in *session + } + + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(*session, nullptr); + + ret = (*device)->getCameraCharacteristics(metadata); + ASSERT_TRUE(ret.isOk()); +} + +Status CameraAidlTest::getJpegBufferSize(camera_metadata_t* staticMeta, int32_t* outBufSize) { + if (nullptr == staticMeta || nullptr == outBufSize) { + return Status::ILLEGAL_ARGUMENT; + } + + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_JPEG_MAX_SIZE, &entry); + if ((0 != rc) || (1 != entry.count)) { + return Status::ILLEGAL_ARGUMENT; + } + + *outBufSize = entry.data.i32[0]; + return Status::OK; +} + +Dataspace CameraAidlTest::getDataspace(PixelFormat format) { + switch (format) { + case PixelFormat::BLOB: + return Dataspace::JFIF; + case PixelFormat::Y16: + return Dataspace::DEPTH; + case PixelFormat::RAW16: + case PixelFormat::RAW_OPAQUE: + case PixelFormat::RAW10: + case PixelFormat::RAW12: + return Dataspace::ARBITRARY; + default: + return Dataspace::UNKNOWN; + } +} + +void CameraAidlTest::createStreamConfiguration(std::vector& streams, + StreamConfigurationMode configMode, + StreamConfiguration* config, + int32_t jpegBufferSize) { + ASSERT_NE(nullptr, config); + + for (auto& stream : streams) { + stream.bufferSize = + (stream.format == PixelFormat::BLOB && stream.dataSpace == Dataspace::JFIF) + ? jpegBufferSize + : 0; + } + + // Caller is responsible to fill in non-zero config->streamConfigCounter after this returns + config->streams = streams; + config->operationMode = configMode; + config->multiResolutionInputImage = false; +} + +void CameraAidlTest::verifyStreamCombination(const std::shared_ptr& device, + const StreamConfiguration& config, bool expectedStatus, + bool expectStreamCombQuery) { + 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); + } + } +} + +std::vector CameraAidlTest::getConcurrentDeviceCombinations( + std::shared_ptr& provider) { + std::vector combinations; + ndk::ScopedAStatus ret = provider->getConcurrentCameraIds(&combinations); + if (!ret.isOk()) { + ADD_FAILURE(); + } + + return combinations; +} + +Status CameraAidlTest::getMandatoryConcurrentStreams(const camera_metadata_t* staticMeta, + std::vector* outputStreams) { + if (nullptr == staticMeta || nullptr == outputStreams) { + return Status::ILLEGAL_ARGUMENT; + } + + if (isDepthOnly(staticMeta)) { + Size y16MaxSize(640, 480); + Size maxAvailableY16Size; + getMaxOutputSizeForFormat(staticMeta, PixelFormat::Y16, &maxAvailableY16Size); + Size y16ChosenSize = getMinSize(y16MaxSize, maxAvailableY16Size); + AvailableStream y16Stream = {.width = y16ChosenSize.width, + .height = y16ChosenSize.height, + .format = static_cast(PixelFormat::Y16)}; + outputStreams->push_back(y16Stream); + return Status::OK; + } + + Size yuvMaxSize(1280, 720); + Size jpegMaxSize(1920, 1440); + Size maxAvailableYuvSize; + Size maxAvailableJpegSize; + getMaxOutputSizeForFormat(staticMeta, PixelFormat::YCBCR_420_888, &maxAvailableYuvSize); + getMaxOutputSizeForFormat(staticMeta, PixelFormat::BLOB, &maxAvailableJpegSize); + Size yuvChosenSize = getMinSize(yuvMaxSize, maxAvailableYuvSize); + Size jpegChosenSize = getMinSize(jpegMaxSize, maxAvailableJpegSize); + + AvailableStream yuvStream = {.width = yuvChosenSize.width, + .height = yuvChosenSize.height, + .format = static_cast(PixelFormat::YCBCR_420_888)}; + + AvailableStream jpegStream = {.width = jpegChosenSize.width, + .height = jpegChosenSize.height, + .format = static_cast(PixelFormat::BLOB)}; + outputStreams->push_back(yuvStream); + outputStreams->push_back(jpegStream); + + return Status::OK; +} + +bool CameraAidlTest::isDepthOnly(const camera_metadata_t* staticMeta) { + camera_metadata_ro_entry scalerEntry; + camera_metadata_ro_entry depthEntry; + + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + &scalerEntry); + if (rc == 0) { + for (uint32_t i = 0; i < scalerEntry.count; i++) { + if (scalerEntry.data.u8[i] == + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE) { + return false; + } + } + } + + for (uint32_t i = 0; i < scalerEntry.count; i++) { + if (scalerEntry.data.u8[i] == ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT) { + rc = find_camera_metadata_ro_entry( + staticMeta, ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS, &depthEntry); + size_t idx = 0; + if (rc == 0 && depthEntry.data.i32[idx] == static_cast(PixelFormat::Y16)) { + // only Depth16 format is supported now + return true; + } + break; + } + } + + return false; +} + +Status CameraAidlTest::getMaxOutputSizeForFormat(const camera_metadata_t* staticMeta, + PixelFormat format, Size* size, + bool maxResolution) { + std::vector outputStreams; + if (size == nullptr || + getAvailableOutputStreams(staticMeta, outputStreams, + /*threshold*/ nullptr, maxResolution) != Status::OK) { + return Status::ILLEGAL_ARGUMENT; + } + Size maxSize; + bool found = false; + for (auto& outputStream : outputStreams) { + if (static_cast(format) == outputStream.format && + (outputStream.width * outputStream.height > maxSize.width * maxSize.height)) { + maxSize.width = outputStream.width; + maxSize.height = outputStream.height; + found = true; + } + } + if (!found) { + ALOGE("%s :chosen format %d not found", __FUNCTION__, static_cast(format)); + return Status::ILLEGAL_ARGUMENT; + } + *size = maxSize; + return Status::OK; +} + +Size CameraAidlTest::getMinSize(Size a, Size b) { + if (a.width * a.height < b.width * b.height) { + return a; + } + return b; +} + +Status CameraAidlTest::getZSLInputOutputMap(camera_metadata_t* staticMeta, + std::vector& inputOutputMap) { + if (nullptr == staticMeta) { + return Status::ILLEGAL_ARGUMENT; + } + + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry( + staticMeta, ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP, &entry); + if ((0 != rc) || (0 >= entry.count)) { + return Status::ILLEGAL_ARGUMENT; + } + + const int32_t* contents = &entry.data.i32[0]; + for (size_t i = 0; i < entry.count;) { + int32_t inputFormat = contents[i++]; + int32_t length = contents[i++]; + for (int32_t j = 0; j < length; j++) { + int32_t outputFormat = contents[i + j]; + AvailableZSLInputOutput zslEntry = {inputFormat, outputFormat}; + inputOutputMap.push_back(zslEntry); + } + i += length; + } + + return Status::OK; +} + +Status CameraAidlTest::findLargestSize(const std::vector& streamSizes, + int32_t format, AvailableStream& result) { + result = {0, 0, 0}; + for (auto& iter : streamSizes) { + if (format == iter.format) { + if ((result.width * result.height) < (iter.width * iter.height)) { + result = iter; + } + } + } + + return (result.format == format) ? Status::OK : Status::ILLEGAL_ARGUMENT; +} + +void CameraAidlTest::constructFilteredSettings( + const std::shared_ptr& session, + const std::unordered_set& availableKeys, RequestTemplate reqTemplate, + android::hardware::camera::common::V1_0::helper::CameraMetadata* defaultSettings, + android::hardware::camera::common::V1_0::helper::CameraMetadata* filteredSettings) { + ASSERT_NE(defaultSettings, nullptr); + ASSERT_NE(filteredSettings, nullptr); + + CameraMetadata req; + auto ret = session->constructDefaultRequestSettings(reqTemplate, &req); + ASSERT_TRUE(ret.isOk()); + + const camera_metadata_t* metadata = + clone_camera_metadata(reinterpret_cast(req.metadata.data())); + size_t expectedSize = req.metadata.size(); + int result = validate_camera_metadata_structure(metadata, &expectedSize); + ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED)); + + size_t entryCount = get_camera_metadata_entry_count(metadata); + ASSERT_GT(entryCount, 0u); + *defaultSettings = metadata; + + const android::hardware::camera::common::V1_0::helper::CameraMetadata& constSettings = + *defaultSettings; + for (const auto& keyIt : availableKeys) { + camera_metadata_ro_entry entry = constSettings.find(keyIt); + if (entry.count > 0) { + filteredSettings->update(entry); + } + } +} + +void CameraAidlTest::verifySessionReconfigurationQuery( + const std::shared_ptr& session, camera_metadata* oldSessionParams, + camera_metadata* newSessionParams) { + ASSERT_NE(nullptr, session); + ASSERT_NE(nullptr, oldSessionParams); + ASSERT_NE(nullptr, newSessionParams); + + std::vector oldParams = + std::vector(reinterpret_cast(oldSessionParams), + reinterpret_cast(oldSessionParams) + + get_camera_metadata_size(oldSessionParams)); + CameraMetadata oldMetadata = {oldParams}; + + std::vector newParams = + std::vector(reinterpret_cast(newSessionParams), + reinterpret_cast(newSessionParams) + + get_camera_metadata_size(newSessionParams)); + CameraMetadata newMetadata = {newParams}; + + bool reconfigReq; + ndk::ScopedAStatus ret = + session->isReconfigurationRequired(oldMetadata, newMetadata, &reconfigReq); + ASSERT_TRUE(ret.isOk() || static_cast(ret.getServiceSpecificError()) == + Status::OPERATION_NOT_SUPPORTED); +} + +Status CameraAidlTest::isConstrainedModeAvailable(camera_metadata_t* staticMeta) { + Status ret = Status::OPERATION_NOT_SUPPORTED; + if (nullptr == staticMeta) { + return Status::ILLEGAL_ARGUMENT; + } + + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + &entry); + if (0 != rc) { + return Status::ILLEGAL_ARGUMENT; + } + + for (size_t i = 0; i < entry.count; i++) { + if (ANDROID_REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO == + entry.data.u8[i]) { + ret = Status::OK; + break; + } + } + + return ret; +} + +Status CameraAidlTest::pickConstrainedModeSize(camera_metadata_t* staticMeta, + AvailableStream& hfrStream) { + if (nullptr == staticMeta) { + return Status::ILLEGAL_ARGUMENT; + } + + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry( + staticMeta, ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS, &entry); + if (0 != rc) { + return Status::OPERATION_NOT_SUPPORTED; + } else if (0 != (entry.count % 5)) { + return Status::ILLEGAL_ARGUMENT; + } + + hfrStream = {0, 0, static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; + for (size_t i = 0; i < entry.count; i += 5) { + int32_t w = entry.data.i32[i]; + int32_t h = entry.data.i32[i + 1]; + if ((hfrStream.width * hfrStream.height) < (w * h)) { + hfrStream.width = w; + hfrStream.height = h; + } + } + + return Status::OK; +} + +void CameraAidlTest::processCaptureRequestInternal(uint64_t bufferUsage, + RequestTemplate reqTemplate, + bool useSecureOnlyCameras) { + std::vector cameraDeviceNames = + getCameraDeviceNames(mProvider, useSecureOnlyCameras); + AvailableStream streamThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; + int64_t bufferId = 1; + int32_t frameNumber = 1; + CameraMetadata settings; + + for (const auto& name : cameraDeviceNames) { + Stream testStream; + std::vector halStreams; + std::shared_ptr session; + std::shared_ptr cb; + bool supportsPartialResults = false; + bool useHalBufManager = false; + int32_t partialResultCount = 0; + configureSingleStream(name, mProvider, &streamThreshold, bufferUsage, reqTemplate, + &session /*out*/, &testStream /*out*/, &halStreams /*out*/, + &supportsPartialResults /*out*/, &partialResultCount /*out*/, + &useHalBufManager /*out*/, &cb /*out*/); + + ASSERT_NE(session, nullptr); + ASSERT_NE(cb, nullptr); + ASSERT_FALSE(halStreams.empty()); + + std::shared_ptr resultQueue; + ::aidl::android::hardware::common::fmq::MQDescriptor< + int8_t, aidl::android::hardware::common::fmq::SynchronizedReadWrite> + descriptor; + ndk::ScopedAStatus ret = session->getCaptureResultMetadataQueue(&descriptor); + ASSERT_TRUE(ret.isOk()); + + resultQueue = std::make_shared(descriptor); + if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) { + ALOGE("%s: HAL returns empty result metadata fmq," + " not use it", + __func__); + resultQueue = nullptr; + // Don't use the queue onwards. + } + + std::shared_ptr inflightReq = std::make_shared( + 1, false, supportsPartialResults, partialResultCount, resultQueue); + + CameraMetadata req; + ret = session->constructDefaultRequestSettings(reqTemplate, &req); + ASSERT_TRUE(ret.isOk()); + settings = req; + + overrideRotateAndCrop(&settings); + + std::vector requests(1); + CaptureRequest& request = requests[0]; + request.frameNumber = frameNumber; + request.fmqSettingsSize = 0; + request.settings = settings; + + std::vector& outputBuffers = request.outputBuffers; + outputBuffers.resize(1); + StreamBuffer& outputBuffer = outputBuffers[0]; + if (useHalBufManager) { + outputBuffer = {halStreams[0].id, + /*bufferId*/ 0, NativeHandle(), BufferStatus::OK, + NativeHandle(), NativeHandle()}; + } else { + buffer_handle_t handle; + allocateGraphicBuffer( + testStream.width, testStream.height, + /* We don't look at halStreamConfig.streams[0].consumerUsage + * since that is 0 for output streams + */ + android_convertGralloc1To0Usage( + static_cast(halStreams[0].producerUsage), bufferUsage), + halStreams[0].overrideFormat, &handle); + + outputBuffer = {halStreams[0].id, bufferId, ::android::makeToAidl(handle), + BufferStatus::OK, NativeHandle(), NativeHandle()}; + } + request.inputBuffer = {-1, + 0, + NativeHandle(), + BufferStatus::ERROR, + NativeHandle(), + NativeHandle()}; // Empty Input Buffer + + { + std::unique_lock l(mLock); + mInflightMap.clear(); + mInflightMap.insert(std::make_pair(frameNumber, inflightReq)); + } + + int32_t numRequestProcessed = 0; + std::vector cachesToRemove; + ret = session->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ALOGI("processCaptureRequestInternal: processCaptureRequest returns status: %d:%d", + ret.getExceptionCode(), ret.getServiceSpecificError()); + + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(numRequestProcessed, 1u); + + { + std::unique_lock l(mLock); + while (!inflightReq->errorCodeValid && + ((0 < inflightReq->numBuffersLeft) || (!inflightReq->haveResultMetadata))) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kStreamBufferTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + ASSERT_FALSE(inflightReq->errorCodeValid); + ASSERT_NE(inflightReq->resultOutputBuffers.size(), 0u); + ASSERT_EQ(testStream.id, inflightReq->resultOutputBuffers[0].buffer.streamId); + + // shutterReadoutTimestamp must be available, and it must + // be >= shutterTimestamp + exposureTime, + // and < shutterTimestamp + exposureTime + rollingShutterSkew / 2. + ASSERT_TRUE(inflightReq->shutterReadoutTimestampValid); + ASSERT_FALSE(inflightReq->collectedResult.isEmpty()); + + if (inflightReq->collectedResult.exists(ANDROID_SENSOR_EXPOSURE_TIME)) { + camera_metadata_entry_t exposureTimeResult = + inflightReq->collectedResult.find(ANDROID_SENSOR_EXPOSURE_TIME); + nsecs_t exposureToReadout = + inflightReq->shutterReadoutTimestamp - inflightReq->shutterTimestamp; + ASSERT_GE(exposureToReadout, exposureTimeResult.data.i64[0]); + if (inflightReq->collectedResult.exists(ANDROID_SENSOR_ROLLING_SHUTTER_SKEW)) { + camera_metadata_entry_t rollingShutterSkew = + inflightReq->collectedResult.find(ANDROID_SENSOR_ROLLING_SHUTTER_SKEW); + ASSERT_LT(exposureToReadout, + exposureTimeResult.data.i64[0] + rollingShutterSkew.data.i64[0] / 2); + } + } + + request.frameNumber++; + // Empty settings should be supported after the first call + // for repeating requests. + request.settings.metadata.clear(); + // The buffer has been registered to HAL by bufferId, so per + // API contract we should send a null handle for this buffer + request.outputBuffers[0].buffer = NativeHandle(); + mInflightMap.clear(); + inflightReq = std::make_shared(1, false, supportsPartialResults, + partialResultCount, resultQueue); + mInflightMap.insert(std::make_pair(request.frameNumber, inflightReq)); + } + + ret = session->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ALOGI("processCaptureRequestInternal: processCaptureRequest returns status: %d:%d", + ret.getExceptionCode(), ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(numRequestProcessed, 1u); + + { + std::unique_lock l(mLock); + while (!inflightReq->errorCodeValid && + ((0 < inflightReq->numBuffersLeft) || (!inflightReq->haveResultMetadata))) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kStreamBufferTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + ASSERT_FALSE(inflightReq->errorCodeValid); + ASSERT_NE(inflightReq->resultOutputBuffers.size(), 0u); + ASSERT_EQ(testStream.id, inflightReq->resultOutputBuffers[0].buffer.streamId); + } + + if (useHalBufManager) { + verifyBuffersReturned(session, testStream.id, cb); + } + + ret = session->close(); + ASSERT_TRUE(ret.isOk()); + } +} + +void CameraAidlTest::configureSingleStream( + const std::string& name, const std::shared_ptr& provider, + const AvailableStream* previewThreshold, uint64_t bufferUsage, RequestTemplate reqTemplate, + std::shared_ptr* session, Stream* previewStream, + std::vector* halStreams, bool* supportsPartialResults, + int32_t* partialResultCount, bool* useHalBufManager, std::shared_ptr* cb, + uint32_t streamConfigCounter) { + ASSERT_NE(nullptr, session); + ASSERT_NE(nullptr, previewStream); + ASSERT_NE(nullptr, halStreams); + ASSERT_NE(nullptr, supportsPartialResults); + ASSERT_NE(nullptr, partialResultCount); + ASSERT_NE(nullptr, useHalBufManager); + ASSERT_NE(nullptr, cb); + + std::vector outputPreviewStreams; + std::shared_ptr device; + ALOGI("configureStreams: Testing camera device %s", name.c_str()); + + ndk::ScopedAStatus ret = provider->getCameraDeviceInterface(name, &device); + ALOGI("getCameraDeviceInterface returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(device, nullptr); + + camera_metadata_t* staticMeta; + CameraMetadata chars; + ret = device->getCameraCharacteristics(&chars); + ASSERT_TRUE(ret.isOk()); + staticMeta = clone_camera_metadata( + reinterpret_cast(chars.metadata.data())); + ASSERT_NE(nullptr, staticMeta); + + camera_metadata_ro_entry entry; + auto status = + find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_PARTIAL_RESULT_COUNT, &entry); + if ((0 == status) && (entry.count > 0)) { + *partialResultCount = entry.data.i32[0]; + *supportsPartialResults = (*partialResultCount > 1); + } + + *cb = ndk::SharedRefBase::make(this, staticMeta); + + device->open(*cb, session); + ALOGI("device::open returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(*session, nullptr); + + *useHalBufManager = 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); + } + + outputPreviewStreams.clear(); + auto rc = getAvailableOutputStreams(staticMeta, outputPreviewStreams, previewThreshold); + + int32_t jpegBufferSize = 0; + ASSERT_EQ(Status::OK, getJpegBufferSize(staticMeta, &jpegBufferSize)); + ASSERT_NE(0u, jpegBufferSize); + + free_camera_metadata(staticMeta); + ASSERT_EQ(Status::OK, rc); + ASSERT_FALSE(outputPreviewStreams.empty()); + + Dataspace dataspace = Dataspace::UNKNOWN; + switch (static_cast(outputPreviewStreams[0].format)) { + case PixelFormat::Y16: + dataspace = Dataspace::DEPTH; + break; + default: + dataspace = Dataspace::UNKNOWN; + } + + std::vector streams(1); + streams[0] = {0, + StreamType::OUTPUT, + outputPreviewStreams[0].width, + outputPreviewStreams[0].height, + static_cast(outputPreviewStreams[0].format), + static_cast(bufferUsage), + dataspace, + StreamRotation::ROTATION_0, + "", + 0, + /*groupId*/ -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + + StreamConfiguration config; + config.streams = streams; + createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, + jpegBufferSize); + if (*session != nullptr) { + CameraMetadata sessionParams; + ret = (*session)->constructDefaultRequestSettings(reqTemplate, &sessionParams); + ASSERT_TRUE(ret.isOk()); + config.sessionParams = sessionParams; + config.streamConfigCounter = (int32_t)streamConfigCounter; + + bool supported = false; + ret = device->isStreamCombinationSupported(config, &supported); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(supported, true); + + std::vector halConfigs; + ret = (*session)->configureStreams(config, &halConfigs); + ALOGI("configureStreams returns status: %d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(1u, halConfigs.size()); + halStreams->clear(); + halStreams->push_back(halConfigs[0]); + if (*useHalBufManager) { + std::vector ss(1); + std::vector hs(1); + ss[0] = config.streams[0]; + hs[0] = halConfigs[0]; + (*cb)->setCurrentStreamConfig(ss, hs); + } + } + *previewStream = config.streams[0]; + ASSERT_TRUE(ret.isOk()); +} + +void CameraAidlTest::overrideRotateAndCrop(CameraMetadata* settings) { + if (settings == nullptr) { + return; + } + + ::android::hardware::camera::common::V1_0::helper::CameraMetadata requestMeta = + clone_camera_metadata(reinterpret_cast(settings->metadata.data())); + auto entry = requestMeta.find(ANDROID_SCALER_ROTATE_AND_CROP); + if ((entry.count > 0) && (entry.data.u8[0] == ANDROID_SCALER_ROTATE_AND_CROP_AUTO)) { + uint8_t disableRotateAndCrop = ANDROID_SCALER_ROTATE_AND_CROP_NONE; + requestMeta.update(ANDROID_SCALER_ROTATE_AND_CROP, &disableRotateAndCrop, 1); + settings->metadata.clear(); + camera_metadata_t* metaBuffer = requestMeta.release(); + uint8_t* rawMetaBuffer = reinterpret_cast(metaBuffer); + settings->metadata = + std::vector(rawMetaBuffer, rawMetaBuffer + get_camera_metadata_size(metaBuffer)); + } +} + +void CameraAidlTest::verifyBuffersReturned(const std::shared_ptr& session, + int32_t streamId, const std::shared_ptr& cb, + uint32_t streamConfigCounter) { + ASSERT_NE(nullptr, session); + + std::vector streamIds(1); + streamIds[0] = streamId; + session->signalStreamFlush(streamIds, /*streamConfigCounter*/ streamConfigCounter); + cb->waitForBuffersReturned(); +} + +void CameraAidlTest::processPreviewStabilizationCaptureRequestInternal( + bool previewStabilizationOn, + // Used as output when preview stabilization is off, as output when its on. + std::unordered_map& cameraDeviceToTimeLag) { + std::vector cameraDeviceNames = getCameraDeviceNames(mProvider); + AvailableStream streamThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; + int64_t bufferId = 1; + int32_t frameNumber = 1; + std::vector settings; + + for (const auto& name : cameraDeviceNames) { + if (!supportsPreviewStabilization(name, mProvider)) { + ALOGI(" %s Camera device %s doesn't support preview stabilization, skipping", __func__, + name.c_str()); + continue; + } + + Stream testStream; + std::vector halStreams; + std::shared_ptr session; + std::shared_ptr cb; + bool supportsPartialResults = false; + bool useHalBufManager = false; + int32_t partialResultCount = 0; + configureSingleStream(name, mProvider, &streamThreshold, GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, + RequestTemplate::PREVIEW, &session /*out*/, &testStream /*out*/, + &halStreams /*out*/, &supportsPartialResults /*out*/, + &partialResultCount /*out*/, &useHalBufManager /*out*/, &cb /*out*/); + + ::aidl::android::hardware::common::fmq::MQDescriptor< + int8_t, aidl::android::hardware::common::fmq::SynchronizedReadWrite> + descriptor; + ndk::ScopedAStatus resultQueueRet = session->getCaptureResultMetadataQueue(&descriptor); + ASSERT_TRUE(resultQueueRet.isOk()); + + std::shared_ptr resultQueue = + std::make_shared(descriptor); + if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) { + ALOGE("%s: HAL returns empty result metadata fmq," + " not use it", + __func__); + resultQueue = nullptr; + // Don't use the queue onwards. + } + + std::shared_ptr inflightReq = std::make_shared( + 1, false, supportsPartialResults, partialResultCount, resultQueue); + + CameraMetadata defaultMetadata; + android::hardware::camera::common::V1_0::helper::CameraMetadata defaultSettings; + ndk::ScopedAStatus ret = session->constructDefaultRequestSettings(RequestTemplate::PREVIEW, + &defaultMetadata); + ASSERT_TRUE(ret.isOk()); + + const camera_metadata_t* metadata = + reinterpret_cast(defaultMetadata.metadata.data()); + defaultSettings = metadata; + android::status_t metadataRet = ::android::OK; + uint8_t videoStabilizationMode = ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF; + if (previewStabilizationOn) { + videoStabilizationMode = ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION; + metadataRet = defaultSettings.update(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, + &videoStabilizationMode, 1); + } else { + metadataRet = defaultSettings.update(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, + &videoStabilizationMode, 1); + } + ASSERT_EQ(metadataRet, ::android::OK); + + camera_metadata_t* releasedMetadata = defaultSettings.release(); + uint8_t* rawMetadata = reinterpret_cast(releasedMetadata); + + buffer_handle_t buffer_handle; + + std::vector requests(1); + CaptureRequest& request = requests[0]; + request.frameNumber = frameNumber; + request.fmqSettingsSize = 0; + request.settings.metadata = + std::vector(rawMetadata, rawMetadata + get_camera_metadata_size(releasedMetadata)); + request.outputBuffers = std::vector(1); + StreamBuffer& outputBuffer = request.outputBuffers[0]; + if (useHalBufManager) { + outputBuffer = {halStreams[0].id, + /*bufferId*/ 0, NativeHandle(), BufferStatus::OK, + NativeHandle(), NativeHandle()}; + } else { + allocateGraphicBuffer(testStream.width, testStream.height, + /* We don't look at halStreamConfig.streams[0].consumerUsage + * since that is 0 for output streams + */ + android_convertGralloc1To0Usage( + static_cast(halStreams[0].producerUsage), + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + halStreams[0].overrideFormat, &buffer_handle); + outputBuffer = {halStreams[0].id, bufferId, ::android::makeToAidl(buffer_handle), + BufferStatus::OK, NativeHandle(), NativeHandle()}; + } + request.inputBuffer = { + -1, 0, NativeHandle(), BufferStatus::ERROR, NativeHandle(), NativeHandle()}; + + { + std::unique_lock l(mLock); + mInflightMap.clear(); + mInflightMap.insert(std::make_pair(frameNumber, inflightReq)); + } + + int32_t numRequestProcessed = 0; + std::vector cachesToRemove; + ret = session->processCaptureRequest(requests, cachesToRemove, &numRequestProcessed); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(numRequestProcessed, 1u); + + { + std::unique_lock l(mLock); + while (!inflightReq->errorCodeValid && + ((0 < inflightReq->numBuffersLeft) || (!inflightReq->haveResultMetadata))) { + auto timeout = std::chrono::system_clock::now() + + std::chrono::seconds(kStreamBufferTimeoutSec); + ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); + } + + ASSERT_FALSE(inflightReq->errorCodeValid); + ASSERT_NE(inflightReq->resultOutputBuffers.size(), 0u); + ASSERT_EQ(testStream.id, inflightReq->resultOutputBuffers[0].buffer.streamId); + ASSERT_TRUE(inflightReq->shutterReadoutTimestampValid); + nsecs_t readoutTimestamp = inflightReq->shutterReadoutTimestamp; + + if (previewStabilizationOn) { + // Here we collect the time difference between the buffer ready + // timestamp - notify readout timestamp. + // timeLag = buffer ready timestamp - notify readout timestamp. + // timeLag(previewStabilization) must be <= + // timeLag(stabilization off) + 1 frame duration. + auto it = cameraDeviceToTimeLag.find(name); + camera_metadata_entry e; + e = inflightReq->collectedResult.find(ANDROID_SENSOR_FRAME_DURATION); + ASSERT_TRUE(e.count > 0); + nsecs_t frameDuration = e.data.i64[0]; + ASSERT_TRUE(it != cameraDeviceToTimeLag.end()); + + nsecs_t previewStabOnLagTime = + inflightReq->resultOutputBuffers[0].timeStamp - readoutTimestamp; + ASSERT_TRUE(previewStabOnLagTime <= (it->second + frameDuration)); + } else { + // Fill in the buffer ready timestamp - notify timestamp; + cameraDeviceToTimeLag[std::string(name)] = + inflightReq->resultOutputBuffers[0].timeStamp - readoutTimestamp; + } + } + + if (useHalBufManager) { + verifyBuffersReturned(session, testStream.id, cb); + } + + ret = session->close(); + ASSERT_TRUE(ret.isOk()); + } +} + +bool CameraAidlTest::supportsPreviewStabilization( + const std::string& name, const std::shared_ptr& provider) { + std::shared_ptr device; + ndk::ScopedAStatus ret = provider->getCameraDeviceInterface(name, &device); + ALOGI("getCameraDeviceInterface returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + if (!ret.isOk() || device == nullptr) { + ADD_FAILURE() << "Failed to get camera device interface for " << name; + } + + CameraMetadata metadata; + ret = device->getCameraCharacteristics(&metadata); + camera_metadata_t* staticMeta = clone_camera_metadata( + reinterpret_cast(metadata.metadata.data())); + if (!(ret.isOk())) { + ADD_FAILURE() << "Failed to get camera characteristics for " << name; + } + // Go through the characteristics and see if video stabilization modes have + // preview stabilization + camera_metadata_ro_entry entry; + + int retcode = find_camera_metadata_ro_entry( + staticMeta, ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES, &entry); + if ((0 == retcode) && (entry.count > 0)) { + for (auto i = 0; i < entry.count; i++) { + if (entry.data.u8[i] == + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION) { + return true; + } + } + } + return false; +} + +void CameraAidlTest::configurePreviewStreams( + const std::string& name, const std::shared_ptr& provider, + const AvailableStream* previewThreshold, const std::unordered_set& physicalIds, + std::shared_ptr* session, Stream* previewStream, + std::vector* halStreams, bool* supportsPartialResults, + int32_t* partialResultCount, bool* useHalBufManager, std::shared_ptr* cb, + int32_t streamConfigCounter) { + ASSERT_NE(nullptr, session); + ASSERT_NE(nullptr, halStreams); + ASSERT_NE(nullptr, previewStream); + ASSERT_NE(nullptr, supportsPartialResults); + ASSERT_NE(nullptr, partialResultCount); + ASSERT_NE(nullptr, useHalBufManager); + ASSERT_NE(nullptr, cb); + + ASSERT_FALSE(physicalIds.empty()); + + std::vector outputPreviewStreams; + std::shared_ptr device; + ALOGI("configureStreams: Testing camera device %s", name.c_str()); + + ndk::ScopedAStatus ret = provider->getCameraDeviceInterface(name, &device); + ALOGI("getCameraDeviceInterface returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(device, nullptr); + + CameraMetadata meta; + ret = device->getCameraCharacteristics(&meta); + ASSERT_TRUE(ret.isOk()); + camera_metadata_t* staticMeta = + clone_camera_metadata(reinterpret_cast(meta.metadata.data())); + ASSERT_NE(nullptr, staticMeta); + + camera_metadata_ro_entry entry; + auto status = + find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_PARTIAL_RESULT_COUNT, &entry); + if ((0 == status) && (entry.count > 0)) { + *partialResultCount = entry.data.i32[0]; + *supportsPartialResults = (*partialResultCount > 1); + } + + *cb = ndk::SharedRefBase::make(this, staticMeta); + ret = device->open(*cb, session); + ALOGI("device::open returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(*session, nullptr); + + *useHalBufManager = 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); + } + + outputPreviewStreams.clear(); + Status rc = getAvailableOutputStreams(staticMeta, outputPreviewStreams, previewThreshold); + free_camera_metadata(staticMeta); + ASSERT_EQ(Status::OK, rc); + ASSERT_FALSE(outputPreviewStreams.empty()); + + std::vector streams(physicalIds.size()); + int32_t streamId = 0; + for (auto const& physicalId : physicalIds) { + streams[streamId++] = {streamId, + StreamType::OUTPUT, + outputPreviewStreams[0].width, + outputPreviewStreams[0].height, + static_cast(outputPreviewStreams[0].format), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + physicalId, + 0, + 0, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + } + + StreamConfiguration config = {streams, StreamConfigurationMode::NORMAL_MODE, CameraMetadata()}; + + RequestTemplate reqTemplate = RequestTemplate::PREVIEW; + ret = (*session)->constructDefaultRequestSettings(reqTemplate, &config.sessionParams); + ASSERT_TRUE(ret.isOk()); + + bool supported = false; + ret = device->isStreamCombinationSupported(config, &supported); + ASSERT_TRUE(ret.isOk()); + + config.streamConfigCounter = streamConfigCounter; + std::vector halConfigs; + ret = (*session)->configureStreams(config, &halConfigs); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(physicalIds.size(), halConfigs.size()); + *halStreams = halConfigs; + if (*useHalBufManager) { + std::vector ss(physicalIds.size()); + std::vector hs(physicalIds.size()); + for (size_t i = 0; i < physicalIds.size(); i++) { + ss[i] = streams[i]; + hs[i] = halConfigs[i]; + } + (*cb)->setCurrentStreamConfig(ss, hs); + } + *previewStream = streams[0]; + ASSERT_TRUE(ret.isOk()); +} + +void CameraAidlTest::verifyBuffersReturned(const std::shared_ptr& session, + const std::vector& streamIds, + std::shared_ptr cb, + uint32_t streamConfigCounter) { + ndk::ScopedAStatus ret = + session->signalStreamFlush(streamIds, /*streamConfigCounter*/ streamConfigCounter); + ASSERT_TRUE(ret.isOk()); + cb->waitForBuffersReturned(); +} + +void CameraAidlTest::configureStreams( + const std::string& name, const std::shared_ptr& provider, + PixelFormat format, std::shared_ptr* session, Stream* previewStream, + std::vector* halStreams, bool* supportsPartialResults, + int32_t* partialResultCount, bool* useHalBufManager, std::shared_ptr* outCb, + uint32_t streamConfigCounter, bool maxResolution, + aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap prof) { + ASSERT_NE(nullptr, session); + ASSERT_NE(nullptr, halStreams); + ASSERT_NE(nullptr, previewStream); + ASSERT_NE(nullptr, supportsPartialResults); + ASSERT_NE(nullptr, partialResultCount); + ASSERT_NE(nullptr, useHalBufManager); + ASSERT_NE(nullptr, outCb); + + ALOGI("configureStreams: Testing camera device %s", name.c_str()); + + std::vector outputStreams; + std::shared_ptr device; + + ndk::ScopedAStatus ret = provider->getCameraDeviceInterface(name, &device); + ALOGI("getCameraDeviceInterface returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(device, nullptr); + + CameraMetadata metadata; + camera_metadata_t* staticMeta; + ret = device->getCameraCharacteristics(&metadata); + ASSERT_TRUE(ret.isOk()); + staticMeta = clone_camera_metadata( + reinterpret_cast(metadata.metadata.data())); + + camera_metadata_ro_entry entry; + auto status = + find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_PARTIAL_RESULT_COUNT, &entry); + if ((0 == status) && (entry.count > 0)) { + *partialResultCount = entry.data.i32[0]; + *supportsPartialResults = (*partialResultCount > 1); + } + + *outCb = ndk::SharedRefBase::make(this, staticMeta); + ret = device->open(*outCb, session); + ALOGI("device::open returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_TRUE(ret.isOk()); + ASSERT_NE(*session, nullptr); + + *useHalBufManager = 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); + } + + outputStreams.clear(); + Size maxSize; + auto rc = getMaxOutputSizeForFormat(staticMeta, format, &maxSize, maxResolution); + ASSERT_EQ(Status::OK, rc); + free_camera_metadata(staticMeta); + + std::vector streams(1); + streams[0] = {0, + StreamType::OUTPUT, + maxSize.width, + maxSize.height, + format, + static_cast<::aidl::android::hardware::graphics::common::BufferUsage>( + GRALLOC1_CONSUMER_USAGE_CPU_READ), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + "", + 0, + -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION}, + prof}; + + StreamConfiguration config; + config.streams = streams; + config.operationMode = StreamConfigurationMode::NORMAL_MODE; + config.streamConfigCounter = streamConfigCounter; + config.multiResolutionInputImage = false; + CameraMetadata req; + RequestTemplate reqTemplate = RequestTemplate::STILL_CAPTURE; + ret = (*session)->constructDefaultRequestSettings(reqTemplate, &req); + ASSERT_TRUE(ret.isOk()); + config.sessionParams = req; + + bool supported = false; + ret = device->isStreamCombinationSupported(config, &supported); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(supported, true); + + ret = (*session)->configureStreams(config, halStreams); + ASSERT_TRUE(ret.isOk()); + + if (*useHalBufManager) { + std::vector ss(1); + std::vector hs(1); + ss[0] = streams[0]; + hs[0] = (*halStreams)[0]; + (*outCb)->setCurrentStreamConfig(ss, hs); + } + + *previewStream = streams[0]; + ASSERT_TRUE(ret.isOk()); +} + +bool CameraAidlTest::is10BitDynamicRangeCapable(const camera_metadata_t* staticMeta) { + camera_metadata_ro_entry scalerEntry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + &scalerEntry); + if (rc == 0) { + for (uint32_t i = 0; i < scalerEntry.count; i++) { + if (scalerEntry.data.u8[i] == + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT) { + return true; + } + } + } + return false; +} + +void CameraAidlTest::get10BitDynamicRangeProfiles( + const camera_metadata_t* staticMeta, + std::vector< + aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap>* + profiles) { + ASSERT_NE(nullptr, staticMeta); + ASSERT_NE(nullptr, profiles); + camera_metadata_ro_entry entry; + std::unordered_set entries; + int rc = find_camera_metadata_ro_entry( + staticMeta, ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP, &entry); + ASSERT_EQ(rc, 0); + ASSERT_TRUE(entry.count > 0); + ASSERT_EQ(entry.count % 2, 0); + + for (uint32_t i = 0; i < entry.count; i += 2) { + ASSERT_NE(entry.data.i32[i], ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD); + ASSERT_EQ(entries.find(entry.data.i32[i]), entries.end()); + entries.insert(static_cast(entry.data.i32[i])); + profiles->emplace_back( + static_cast(entry.data.i32[i])); + } + + if (!entries.empty()) { + ASSERT_NE(entries.find(ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10), + entries.end()); + } +} + +void CameraAidlTest::verify10BitMetadata( + HandleImporter& importer, const InFlightRequest& request, + aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap + profile) { + for (const auto& b : request.resultOutputBuffers) { + bool smpte2086Present = importer.isSmpte2086Present(b.buffer.buffer); + bool smpte2094_10Present = importer.isSmpte2094_10Present(b.buffer.buffer); + bool smpte2094_40Present = importer.isSmpte2094_40Present(b.buffer.buffer); + + switch (static_cast(profile)) { + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10: + ASSERT_FALSE(smpte2086Present); + ASSERT_FALSE(smpte2094_10Present); + ASSERT_FALSE(smpte2094_40Present); + break; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10: + ASSERT_TRUE(smpte2086Present); + ASSERT_FALSE(smpte2094_10Present); + ASSERT_FALSE(smpte2094_40Present); + break; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS: + ASSERT_FALSE(smpte2086Present); + ASSERT_FALSE(smpte2094_10Present); + ASSERT_TRUE(smpte2094_40Present); + break; + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF: + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO: + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM: + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO: + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF: + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO: + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM: + case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO: + ASSERT_FALSE(smpte2086Present); + ASSERT_TRUE(smpte2094_10Present); + ASSERT_FALSE(smpte2094_40Present); + break; + default: + ALOGE("%s: Unexpected 10-bit dynamic range profile: %d", __FUNCTION__, profile); + ADD_FAILURE(); + } + } +} + +void CameraAidlTest::configurePreviewStream( + const std::string& name, const std::shared_ptr& provider, + const AvailableStream* previewThreshold, std::shared_ptr* session, + Stream* previewStream, std::vector* halStreams, bool* supportsPartialResults, + int32_t* partialResultCount, bool* useHalBufManager, std::shared_ptr* cb, + uint32_t streamConfigCounter) { + configureSingleStream(name, provider, previewThreshold, GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, + RequestTemplate::PREVIEW, session, previewStream, halStreams, + supportsPartialResults, partialResultCount, useHalBufManager, cb, + streamConfigCounter); +} + +Status CameraAidlTest::isOfflineSessionSupported(const camera_metadata_t* staticMeta) { + Status ret = Status::OPERATION_NOT_SUPPORTED; + if (nullptr == staticMeta) { + return Status::ILLEGAL_ARGUMENT; + } + + camera_metadata_ro_entry entry; + int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, + &entry); + if (0 != rc) { + return Status::ILLEGAL_ARGUMENT; + } + + for (size_t i = 0; i < entry.count; i++) { + if (ANDROID_REQUEST_AVAILABLE_CAPABILITIES_OFFLINE_PROCESSING == entry.data.u8[i]) { + ret = Status::OK; + break; + } + } + + return ret; +} + +void CameraAidlTest::configureOfflineStillStream( + const std::string& name, const std::shared_ptr& provider, + const AvailableStream* threshold, std::shared_ptr* session, + Stream* stream, std::vector* halStreams, bool* supportsPartialResults, + int32_t* partialResultCount, std::shared_ptr* outCb, int32_t* jpegBufferSize, + bool* useHalBufManager) { + ASSERT_NE(nullptr, session); + ASSERT_NE(nullptr, halStreams); + ASSERT_NE(nullptr, stream); + ASSERT_NE(nullptr, supportsPartialResults); + ASSERT_NE(nullptr, partialResultCount); + ASSERT_NE(nullptr, outCb); + ASSERT_NE(nullptr, jpegBufferSize); + ASSERT_NE(nullptr, useHalBufManager); + + std::vector outputStreams; + std::shared_ptr cameraDevice; + ALOGI("configureStreams: Testing camera device %s", name.c_str()); + + ndk::ScopedAStatus ret = provider->getCameraDeviceInterface(name, &cameraDevice); + ASSERT_TRUE(ret.isOk()); + ALOGI("getCameraDeviceInterface returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_NE(cameraDevice, nullptr); + + CameraMetadata metadata; + ret = cameraDevice->getCameraCharacteristics(&metadata); + ASSERT_TRUE(ret.isOk()); + camera_metadata_t* staticMeta = clone_camera_metadata( + reinterpret_cast(metadata.metadata.data())); + ASSERT_NE(nullptr, staticMeta); + + camera_metadata_ro_entry entry; + auto status = + find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_PARTIAL_RESULT_COUNT, &entry); + if ((0 == status) && (entry.count > 0)) { + *partialResultCount = entry.data.i32[0]; + *supportsPartialResults = (*partialResultCount > 1); + } + + *useHalBufManager = 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); + } + + auto st = getJpegBufferSize(staticMeta, jpegBufferSize); + ASSERT_EQ(st, Status::OK); + + *outCb = ndk::SharedRefBase::make(this, staticMeta); + ret = cameraDevice->open(*outCb, session); + ASSERT_TRUE(ret.isOk()); + ALOGI("device::open returns status:%d:%d", ret.getExceptionCode(), + ret.getServiceSpecificError()); + ASSERT_NE(session, nullptr); + + outputStreams.clear(); + auto rc = getAvailableOutputStreams(staticMeta, outputStreams, threshold); + size_t idx = 0; + int currLargest = outputStreams[0].width * outputStreams[0].height; + for (size_t i = 0; i < outputStreams.size(); i++) { + int area = outputStreams[i].width * outputStreams[i].height; + if (area > currLargest) { + idx = i; + currLargest = area; + } + } + free_camera_metadata(staticMeta); + ASSERT_EQ(Status::OK, rc); + ASSERT_FALSE(outputStreams.empty()); + + Dataspace dataspace = getDataspace(static_cast(outputStreams[idx].format)); + + std::vector streams(/*size*/ 1); + streams[0] = {/*id*/ 0, + StreamType::OUTPUT, + outputStreams[idx].width, + outputStreams[idx].height, + static_cast(outputStreams[idx].format), + static_cast<::aidl::android::hardware::graphics::common::BufferUsage>( + GRALLOC1_CONSUMER_USAGE_CPU_READ), + dataspace, + StreamRotation::ROTATION_0, + /*physicalId*/ std::string(), + *jpegBufferSize, + /*groupId*/ 0, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + + StreamConfiguration config = {streams, StreamConfigurationMode::NORMAL_MODE, CameraMetadata()}; + + (*session)->configureStreams(config, halStreams); + ASSERT_TRUE(ret.isOk()); + + if (*useHalBufManager) { + (*outCb)->setCurrentStreamConfig(streams, *halStreams); + } + + *stream = streams[0]; +} + +void CameraAidlTest::updateInflightResultQueue( + const std::shared_ptr& resultQueue) { + std::unique_lock l(mLock); + for (auto& it : mInflightMap) { + it.second->resultQueue = resultQueue; + } +} \ No newline at end of file diff --git a/camera/provider/aidl/vts/camera_aidl_test.h b/camera/provider/aidl/vts/camera_aidl_test.h new file mode 100644 index 0000000000..cc381696c7 --- /dev/null +++ b/camera/provider/aidl/vts/camera_aidl_test.h @@ -0,0 +1,528 @@ +/* + * 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 HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_CAMERA_AIDL_TEST_H_ +#define HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_CAMERA_AIDL_TEST_H_ + +#define LOG_TAG "camera_aidl_hal_test" + +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include +#include +#include +#include + +using ::aidl::android::hardware::camera::common::Status; +using ::aidl::android::hardware::camera::common::TorchModeStatus; +using ::aidl::android::hardware::camera::device::BufferRequest; +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::ErrorCode; +using ::aidl::android::hardware::camera::device::HalStream; +using ::aidl::android::hardware::camera::device::ICameraDevice; +using ::aidl::android::hardware::camera::device::ICameraDeviceSession; +using ::aidl::android::hardware::camera::device::ICameraInjectionSession; +using ::aidl::android::hardware::camera::device::NotifyMsg; +using ::aidl::android::hardware::camera::device::PhysicalCameraMetadata; +using ::aidl::android::hardware::camera::device::RequestTemplate; +using ::aidl::android::hardware::camera::device::Stream; +using ::aidl::android::hardware::camera::device::StreamBuffer; +using ::aidl::android::hardware::camera::device::StreamBufferRet; +using ::aidl::android::hardware::camera::device::StreamConfiguration; +using ::aidl::android::hardware::camera::device::StreamConfigurationMode; +using ::aidl::android::hardware::camera::provider::ConcurrentCameraIdCombination; +using ::aidl::android::hardware::camera::provider::ICameraProvider; + +using ::aidl::android::hardware::common::NativeHandle; +using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite; + +using ::aidl::android::hardware::graphics::common::Dataspace; +using ::aidl::android::hardware::graphics::common::PixelFormat; + +using ::android::hardware::camera::common::V1_0::helper::HandleImporter; +using ::android::hardware::camera::common::V1_0::helper::Size; + +using ResultMetadataQueue = android::AidlMessageQueue; + +using ::ndk::ScopedAStatus; + +class DeviceCb; // Forward declare to break circular header dependency + +class CameraAidlTest : public ::testing::TestWithParam { + public: + enum SystemCameraKind { + /** + * These camera devices are visible to all apps and system components alike + */ + PUBLIC = 0, + + /** + * These camera devices are visible only to processes having the + * android.permission.SYSTEM_CAMERA permission. They are not exposed to 3P + * apps. + */ + SYSTEM_ONLY_CAMERA, + + /** + * These camera devices are visible only to HAL clients (that try to connect + * on a hwbinder thread). + */ + HIDDEN_SECURE_CAMERA + }; + + struct AvailableStream { + int32_t width; + int32_t height; + int32_t format; + }; + + enum ReprocessType { + PRIV_REPROCESS, + YUV_REPROCESS, + }; + + struct AvailableZSLInputOutput { + int32_t inputFormat; + int32_t outputFormat; + }; + + virtual void SetUp() override; + virtual void TearDown() override; + + std::vector getCameraDeviceNames(std::shared_ptr& provider, + bool addSecureOnly = false); + + static bool isSecureOnly(const std::shared_ptr& provider, + const std::string& name); + + std::map getCameraDeviceIdToNameMap( + std::shared_ptr provider); + + static std::vector getConcurrentDeviceCombinations( + std::shared_ptr& provider); + + void notifyDeviceState(int64_t state); + + static void allocateGraphicBuffer(uint32_t width, uint32_t height, uint64_t usage, + PixelFormat format, buffer_handle_t* buffer_handle /*out*/); + + static void openEmptyDeviceSession(const std::string& name, + std::shared_ptr provider, + std::shared_ptr* session /*out*/, + CameraMetadata* staticMeta /*out*/, + std::shared_ptr* device /*out*/); + static void openEmptyInjectionSession(const std::string& name, + const std::shared_ptr& provider, + std::shared_ptr* session /*out*/, + CameraMetadata* staticMeta /*out*/, + std::shared_ptr* device /*out*/); + + static void createStreamConfiguration(std::vector& streams, + StreamConfigurationMode configMode, + StreamConfiguration* config, int32_t jpegBufferSize = 0); + + void configureOfflineStillStream( + const std::string& name, const std::shared_ptr& provider, + const AvailableStream* threshold, + std::shared_ptr* session /*out*/, Stream* stream /*out*/, + std::vector* halStreams, bool* supportsPartialResults /*out*/, + int32_t* partialResultCount /*out*/, std::shared_ptr* outCb /*out*/, + int32_t* jpegBufferSize /*out*/, bool* useHalBufManager /*out*/); + + void configureStreams( + const std::string& name, const std::shared_ptr& provider, + PixelFormat format, std::shared_ptr* session /*out*/, + Stream* previewStream /*out*/, std::vector* halStreams /*out*/, + bool* supportsPartialResults /*out*/, int32_t* partialResultCount /*out*/, + bool* useHalBufManager /*out*/, std::shared_ptr* outCb /*out*/, + uint32_t streamConfigCounter, bool maxResolution, + aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap + prof = ::aidl::android::hardware::camera::metadata:: + RequestAvailableDynamicRangeProfilesMap(0)); + + void configurePreviewStreams( + const std::string& name, const std::shared_ptr& provider, + const AvailableStream* previewThreshold, + const std::unordered_set& physicalIds, + std::shared_ptr* session /*out*/, Stream* previewStream /*out*/, + std::vector* halStreams /*out*/, bool* supportsPartialResults /*out*/, + int32_t* partialResultCount /*out*/, bool* useHalBufManager /*out*/, + std::shared_ptr* cb /*out*/, int32_t streamConfigCounter = 0); + + void configurePreviewStream( + const std::string& name, const std::shared_ptr& provider, + const AvailableStream* previewThreshold, + std::shared_ptr* session /*out*/, Stream* previewStream /*out*/, + std::vector* halStreams /*out*/, bool* supportsPartialResults /*out*/, + int32_t* partialResultCount /*out*/, bool* useHalBufManager /*out*/, + std::shared_ptr* cb /*out*/, uint32_t streamConfigCounter = 0); + + void configureSingleStream( + const std::string& name, const std::shared_ptr& provider, + const AvailableStream* previewThreshold, uint64_t bufferUsage, + RequestTemplate reqTemplate, std::shared_ptr* session /*out*/, + Stream* previewStream /*out*/, std::vector* halStreams /*out*/, + bool* supportsPartialResults /*out*/, int32_t* partialResultCount /*out*/, + bool* useHalBufManager /*out*/, std::shared_ptr* cb /*out*/, + uint32_t streamConfigCounter = 0); + + void verifyLogicalOrUltraHighResCameraMetadata(const std::string& cameraName, + const std::shared_ptr& device, + const CameraMetadata& chars, + const std::vector& deviceNames); + + static void verifyCameraCharacteristics(const CameraMetadata& chars); + + static void verifyExtendedSceneModeCharacteristics(const camera_metadata_t* metadata); + + static void verifyZoomCharacteristics(const camera_metadata_t* metadata); + + static void verifyRecommendedConfigs(const CameraMetadata& chars); + + static void verifyMonochromeCharacteristics(const CameraMetadata& chars); + + static void verifyMonochromeCameraResult( + const ::android::hardware::camera::common::V1_0::helper::CameraMetadata& metadata); + + static void verifyStreamUseCaseCharacteristics(const camera_metadata_t* metadata); + + static void verifyStreamCombination(const std::shared_ptr& device, + const StreamConfiguration& config, bool expectedStatus, + bool expectStreamCombQuery); + + static void verifyLogicalCameraResult(const camera_metadata_t* staticMetadata, + const std::vector& resultMetadata); + + static void verifyBuffersReturned(const std::shared_ptr& session, + int32_t streamId, const std::shared_ptr& cb, + uint32_t streamConfigCounter = 0); + + void verifyBuffersReturned(const std::shared_ptr& session, + const std::vector& streamIds, std::shared_ptr cb, + uint32_t streamConfigCounter = 0); + + static void verifySessionReconfigurationQuery( + const std::shared_ptr& session, camera_metadata* oldSessionParams, + camera_metadata* newSessionParams); + + static void verifyRequestTemplate(const camera_metadata_t* metadata, + RequestTemplate requestTemplate); + + static void overrideRotateAndCrop(CameraMetadata* settings /*in/out*/); + + static bool isDepthOnly(const camera_metadata_t* staticMeta); + + static bool isUltraHighResolution(const camera_metadata_t* staticMeta); + + static Status getAvailableOutputStreams(const camera_metadata_t* staticMeta, + std::vector& outputStreams, + const AvailableStream* threshold = nullptr, + bool maxResolution = false); + + static Status getMaxOutputSizeForFormat(const camera_metadata_t* staticMeta, PixelFormat format, + Size* size, bool maxResolution = false); + + static Status getMandatoryConcurrentStreams(const camera_metadata_t* staticMeta, + std::vector* outputStreams); + + static bool supportsPreviewStabilization(const std::string& name, + const std::shared_ptr& provider); + + static Status getJpegBufferSize(camera_metadata_t* staticMeta, int32_t* outBufSize); + + static Status isConstrainedModeAvailable(camera_metadata_t* staticMeta); + + static Status isLogicalMultiCamera(const camera_metadata_t* staticMeta); + + static bool isTorchSupported(const camera_metadata_t* staticMeta); + + static bool isTorchStrengthControlSupported(const camera_metadata_t* staticMeta); + + static Status isOfflineSessionSupported(const camera_metadata_t* staticMeta); + + static Status getPhysicalCameraIds(const camera_metadata_t* staticMeta, + std::unordered_set* physicalIds /*out*/); + + static Status getSupportedKeys(camera_metadata_t* staticMeta, uint32_t tagId, + std::unordered_set* requestIDs /*out*/); + + static void fillOutputStreams(camera_metadata_ro_entry_t* entry, + std::vector& outputStreams, + const AvailableStream* threshold = nullptr, + const int32_t availableConfigOutputTag = 0u); + + static void constructFilteredSettings( + const std::shared_ptr& session, + const std::unordered_set& availableKeys, RequestTemplate reqTemplate, + android::hardware::camera::common::V1_0::helper::CameraMetadata* + defaultSettings /*out*/, + android::hardware::camera::common::V1_0::helper::CameraMetadata* filteredSettings + /*out*/); + + static Status pickConstrainedModeSize(camera_metadata_t* staticMeta, + AvailableStream& hfrStream); + + static Status isZSLModeAvailable(const camera_metadata_t* staticMeta); + + static Status isZSLModeAvailable(const camera_metadata_t* staticMeta, ReprocessType reprocType); + + static Status getZSLInputOutputMap(camera_metadata_t* staticMeta, + std::vector& inputOutputMap); + + static Status findLargestSize(const std::vector& streamSizes, int32_t format, + AvailableStream& result); + + static Status isMonochromeCamera(const camera_metadata_t* staticMeta); + + static Status getSystemCameraKind(const camera_metadata_t* staticMeta, + SystemCameraKind* systemCameraKind); + + static void getMultiResolutionStreamConfigurations( + camera_metadata_ro_entry* multiResStreamConfigs, + camera_metadata_ro_entry* streamConfigs, + camera_metadata_ro_entry* maxResolutionStreamConfigs, + const camera_metadata_t* staticMetadata); + + static void getPrivacyTestPatternModes( + const camera_metadata_t* staticMetadata, + std::unordered_set* privacyTestPatternModes /*out*/); + + static Dataspace getDataspace(PixelFormat format); + + void processCaptureRequestInternal(uint64_t bufferUsage, RequestTemplate reqTemplate, + bool useSecureOnlyCameras); + + void processPreviewStabilizationCaptureRequestInternal( + bool previewStabilizationOn, + /*inout*/ std::unordered_map& cameraDeviceToTimeLag); + + static bool is10BitDynamicRangeCapable(const camera_metadata_t* staticMeta); + + static void get10BitDynamicRangeProfiles( + const camera_metadata_t* staticMeta, + std::vector* profiles); + + // Used by switchToOffline where a new result queue is created for offline reqs + void updateInflightResultQueue(const std::shared_ptr& resultQueue); + + static Size getMinSize(Size a, Size b); + + protected: + // In-flight queue for tracking completion of capture requests. + struct InFlightRequest { + // Set by notify() SHUTTER call. + nsecs_t shutterTimestamp; + + bool shutterReadoutTimestampValid; + nsecs_t shutterReadoutTimestamp; + + bool errorCodeValid; + ErrorCode errorCode; + + // Is partial result supported + bool usePartialResult; + + // Partial result count expected + int32_t numPartialResults; + + // Message queue + std::shared_ptr resultQueue; + + // Set by process_capture_result call with valid metadata + bool haveResultMetadata; + + // Decremented by calls to process_capture_result with valid output + // and input buffers + ssize_t numBuffersLeft; + + // A 64bit integer to index the frame number associated with this result. + int64_t frameNumber; + + // The partial result count (index) for this capture result. + int32_t partialResultCount; + + // For buffer drop errors, the stream ID for the stream that lost a buffer. + // For physical sub-camera result errors, the Id of the physical stream + // for the physical sub-camera. + // Otherwise -1. + int32_t errorStreamId; + + // If this request has any input buffer + bool hasInputBuffer; + + // Result metadata + ::android::hardware::camera::common::V1_0::helper::CameraMetadata collectedResult; + + // A copy-able StreamBuffer using buffer_handle_t instead of AIDLs NativeHandle + struct NativeStreamBuffer { + int32_t streamId; + int64_t bufferId; + buffer_handle_t buffer; + aidl::android::hardware::camera::device::BufferStatus status; + buffer_handle_t acquireFence; + buffer_handle_t releaseFence; + }; + + // Buffers are added by process_capture_result when output buffers + // return from HAL but framework. + struct StreamBufferAndTimestamp { + NativeStreamBuffer buffer; + nsecs_t timeStamp; + }; + std::vector resultOutputBuffers; + + std::unordered_set expectedPhysicalResults; + + InFlightRequest() + : shutterTimestamp(0), + shutterReadoutTimestampValid(false), + shutterReadoutTimestamp(0), + errorCodeValid(false), + errorCode(ErrorCode::ERROR_BUFFER), + usePartialResult(false), + numPartialResults(0), + resultQueue(nullptr), + haveResultMetadata(false), + numBuffersLeft(0), + frameNumber(0), + partialResultCount(0), + errorStreamId(-1), + hasInputBuffer(false), + collectedResult(1, 10) {} + + InFlightRequest(ssize_t numBuffers, bool hasInput, bool partialResults, + int32_t partialCount, std::shared_ptr queue = nullptr) + : shutterTimestamp(0), + shutterReadoutTimestampValid(false), + shutterReadoutTimestamp(0), + errorCodeValid(false), + errorCode(ErrorCode::ERROR_BUFFER), + usePartialResult(partialResults), + numPartialResults(partialCount), + resultQueue(queue), + haveResultMetadata(false), + numBuffersLeft(numBuffers), + frameNumber(0), + partialResultCount(0), + errorStreamId(-1), + hasInputBuffer(hasInput), + collectedResult(1, 10) {} + + InFlightRequest(ssize_t numBuffers, bool hasInput, bool partialResults, + int32_t partialCount, + const std::unordered_set& extraPhysicalResult, + std::shared_ptr queue = nullptr) + : shutterTimestamp(0), + shutterReadoutTimestampValid(false), + shutterReadoutTimestamp(0), + errorCodeValid(false), + errorCode(ErrorCode::ERROR_BUFFER), + usePartialResult(partialResults), + numPartialResults(partialCount), + resultQueue(queue), + haveResultMetadata(false), + numBuffersLeft(numBuffers), + frameNumber(0), + partialResultCount(0), + errorStreamId(-1), + hasInputBuffer(hasInput), + collectedResult(1, 10), + expectedPhysicalResults(extraPhysicalResult) {} + }; + + static bool matchDeviceName(const std::string& deviceName, const std::string& providerType, + std::string* deviceVersion, std::string* cameraId); + + static void verify10BitMetadata( + HandleImporter& importer, const InFlightRequest& request, + aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap + profile); + + // Map from frame number to the in-flight request state + typedef std::unordered_map> InFlightMap; + + std::mutex mLock; // Synchronize access to member variables + std::condition_variable mResultCondition; // Condition variable for incoming results + InFlightMap mInflightMap; // Map of all inflight requests + + std::vector mNotifyMessages; // Current notification message + + std::mutex mTorchLock; // Synchronize access to torch status + std::condition_variable mTorchCond; // Condition variable for torch status + TorchModeStatus mTorchStatus; // Current torch status + + // Camera provider service + std::shared_ptr mProvider; + + // Camera device session used by the tests + // Tests should take care of closing this session and setting it back to nullptr in successful + // case. Declared as a field to allow TeadDown function to close the session if a test assertion + // fails. + std::shared_ptr mSession; + + // Camera provider type. + std::string mProviderType; + + HandleImporter mHandleImporter; + + friend class DeviceCb; + friend class SimpleDeviceCb; + friend class TorchProviderCb; +}; + +namespace { +// device@.//id +const char* kDeviceNameRE = "device@([0-9]+\\.[0-9]+)/\\s+/(.+)"; +const int32_t kMaxVideoWidth = 4096; +const int32_t kMaxVideoHeight = 2160; + +const int64_t kStreamBufferTimeoutSec = 3; +const int64_t kTorchTimeoutSec = 1; +const char* kDumpOutput = "/dev/null"; +const uint32_t kMaxPreviewWidth = 1920; +const uint32_t kMaxPreviewHeight = 1080; +} // namespace +#endif // HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_CAMERA_AIDL_TEST_H_ diff --git a/camera/provider/aidl/vts/device_cb.cpp b/camera/provider/aidl/vts/device_cb.cpp new file mode 100644 index 0000000000..52b4079465 --- /dev/null +++ b/camera/provider/aidl/vts/device_cb.cpp @@ -0,0 +1,544 @@ +/* + * 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. + */ + +#include "device_cb.h" + +#include +#include +#include +#include +#include + +using ::aidl::android::hardware::camera::device::BufferStatus; +using ::aidl::android::hardware::camera::device::ErrorMsg; +using ::aidl::android::hardware::camera::device::StreamBufferRequestError; +using ::aidl::android::hardware::camera::device::StreamBuffersVal; +using ::aidl::android::hardware::graphics::common::PixelFormat; + +const int64_t kBufferReturnTimeoutSec = 1; + +DeviceCb::DeviceCb(CameraAidlTest* parent, camera_metadata_t* staticMeta) : mParent(parent) { + mStaticMetadata = staticMeta; +} + +ScopedAStatus DeviceCb::notify(const std::vector& msgs) { + std::vector> readoutTimestamps; + + size_t count = msgs.size(); + readoutTimestamps.resize(count); + + for (size_t i = 0; i < count; i++) { + const NotifyMsg& msg = msgs[i]; + switch (msg.getTag()) { + case NotifyMsg::Tag::error: + readoutTimestamps[i] = {false, 0}; + break; + case NotifyMsg::Tag::shutter: + const auto& shutter = msg.get(); + readoutTimestamps[i] = {true, shutter.readoutTimestamp}; + break; + } + } + + return notifyHelper(msgs, readoutTimestamps); +} + +ScopedAStatus DeviceCb::processCaptureResult(const std::vector& results) { + if (nullptr == mParent) { + return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); + } + + bool notify = false; + std::unique_lock l(mParent->mLock); + for (const auto& result : results) { + notify = processCaptureResultLocked(result, result.physicalCameraMetadata); + } + + l.unlock(); + if (notify) { + mParent->mResultCondition.notify_one(); + } + + return ndk::ScopedAStatus::ok(); +} + +ScopedAStatus DeviceCb::requestStreamBuffers(const std::vector& bufReqs, + std::vector* buffers, + BufferRequestStatus* _aidl_return) { + std::vector& bufRets = *buffers; + std::unique_lock l(mLock); + + if (!mUseHalBufManager) { + ALOGE("%s: Camera does not support HAL buffer management", __FUNCTION__); + ADD_FAILURE(); + *_aidl_return = BufferRequestStatus::FAILED_ILLEGAL_ARGUMENTS; + return ScopedAStatus::ok(); + } + + if (bufReqs.size() > mStreams.size()) { + ALOGE("%s: illegal buffer request: too many requests!", __FUNCTION__); + ADD_FAILURE(); + *_aidl_return = BufferRequestStatus::FAILED_ILLEGAL_ARGUMENTS; + return ndk::ScopedAStatus::ok(); + } + + std::vector indexes(bufReqs.size()); + for (size_t i = 0; i < bufReqs.size(); i++) { + bool found = false; + for (size_t idx = 0; idx < mStreams.size(); idx++) { + if (bufReqs[i].streamId == mStreams[idx].id) { + found = true; + indexes[i] = idx; + break; + } + } + if (!found) { + ALOGE("%s: illegal buffer request: unknown streamId %d!", __FUNCTION__, + bufReqs[i].streamId); + ADD_FAILURE(); + *_aidl_return = BufferRequestStatus::FAILED_ILLEGAL_ARGUMENTS; + return ScopedAStatus::ok(); + } + } + + bool allStreamOk = true; + bool atLeastOneStreamOk = false; + bufRets.resize(bufReqs.size()); + + for (size_t i = 0; i < bufReqs.size(); i++) { + size_t idx = indexes[i]; + const auto& stream = mStreams[idx]; + const auto& halStream = mHalStreams[idx]; + const BufferRequest& bufReq = bufReqs[i]; + + if (mOutstandingBufferIds[idx].size() + bufReq.numBuffersRequested > halStream.maxBuffers) { + bufRets[i].streamId = stream.id; + bufRets[i].val.set( + StreamBufferRequestError::MAX_BUFFER_EXCEEDED); + allStreamOk = false; + continue; + } + + std::vector tmpRetBuffers(bufReq.numBuffersRequested); + for (size_t j = 0; j < bufReq.numBuffersRequested; j++) { + buffer_handle_t handle; + uint32_t w = stream.width; + uint32_t h = stream.height; + if (stream.format == PixelFormat::BLOB) { + w = stream.bufferSize; + h = 1; + } + + CameraAidlTest::allocateGraphicBuffer( + w, h, + android_convertGralloc1To0Usage(static_cast(halStream.producerUsage), + static_cast(halStream.consumerUsage)), + halStream.overrideFormat, &handle); + + StreamBuffer streamBuffer = StreamBuffer(); + StreamBuffer& sb = tmpRetBuffers[j]; + sb = { + stream.id, mNextBufferId, ::android::dupToAidl(handle), + BufferStatus::OK, NativeHandle(), NativeHandle(), + }; + + mOutstandingBufferIds[idx][mNextBufferId++] = ::android::dupToAidl(handle); + } + atLeastOneStreamOk = true; + bufRets[i].streamId = stream.id; + bufRets[i].val.set(std::move(tmpRetBuffers)); + } + + if (allStreamOk) { + *_aidl_return = BufferRequestStatus::OK; + } else if (atLeastOneStreamOk) { + *_aidl_return = BufferRequestStatus::FAILED_PARTIAL; + } else { + *_aidl_return = BufferRequestStatus::FAILED_UNKNOWN; + } + + if (!hasOutstandingBuffersLocked()) { + l.unlock(); + mFlushedCondition.notify_one(); + } + + return ndk::ScopedAStatus::ok(); +} + +ScopedAStatus DeviceCb::returnStreamBuffers(const std::vector& buffers) { + if (!mUseHalBufManager) { + ALOGE("%s: Camera does not support HAL buffer management", __FUNCTION__); + ADD_FAILURE(); + } + + std::unique_lock l(mLock); + for (const auto& buf : buffers) { + if (buf.bufferId == 0) { + // Don't return buffers of bufId 0 (empty buffer) + continue; + } + bool found = false; + for (size_t idx = 0; idx < mOutstandingBufferIds.size(); idx++) { + if (mStreams[idx].id == buf.streamId && + mOutstandingBufferIds[idx].count(buf.bufferId) == 1) { + mOutstandingBufferIds[idx].erase(buf.bufferId); + // TODO: check do we need to close/delete native handle or assume we have enough + // memory to run till the test finish? since we do not capture much requests (and + // most of time one buffer is sufficient) + found = true; + break; + } + } + if (found) { + continue; + } + ALOGE("%s: unknown buffer ID %" PRIu64, __FUNCTION__, buf.bufferId); + ADD_FAILURE(); + } + if (!hasOutstandingBuffersLocked()) { + l.unlock(); + mFlushedCondition.notify_one(); + } + + return ndk::ScopedAStatus::ok(); +} + +void DeviceCb::setCurrentStreamConfig(const std::vector& streams, + const std::vector& halStreams) { + ASSERT_EQ(streams.size(), halStreams.size()); + ASSERT_NE(streams.size(), 0); + for (size_t i = 0; i < streams.size(); i++) { + ASSERT_EQ(streams[i].id, halStreams[i].id); + } + std::lock_guard l(mLock); + mUseHalBufManager = true; + mStreams = streams; + mHalStreams = halStreams; + mOutstandingBufferIds.clear(); + for (size_t i = 0; i < streams.size(); i++) { + mOutstandingBufferIds.emplace_back(); + } +} + +void DeviceCb::waitForBuffersReturned() { + std::unique_lock lk(mLock); + if (hasOutstandingBuffersLocked()) { + auto timeout = std::chrono::seconds(kBufferReturnTimeoutSec); + auto st = mFlushedCondition.wait_for(lk, timeout); + ASSERT_NE(std::cv_status::timeout, st); + } +} + +bool DeviceCb::processCaptureResultLocked( + const CaptureResult& results, std::vector physicalCameraMetadata) { + bool notify = false; + uint32_t frameNumber = results.frameNumber; + + if ((results.result.metadata.empty()) && (results.outputBuffers.empty()) && + (results.inputBuffer.buffer.fds.empty()) && (results.fmqResultSize == 0)) { + ALOGE("%s: No result data provided by HAL for frame %d result count: %d", __func__, + frameNumber, (int)results.fmqResultSize); + ADD_FAILURE(); + return notify; + } + + auto requestEntry = mParent->mInflightMap.find(frameNumber); + if (requestEntry == mParent->mInflightMap.end()) { + ALOGE("%s: Unexpected frame number! received: %u", __func__, frameNumber); + ADD_FAILURE(); + return notify; + } + + bool isPartialResult = false; + bool hasInputBufferInRequest = false; + auto& request = requestEntry->second; + + CameraMetadata resultMetadata; + size_t resultSize = 0; + if (results.fmqResultSize > 0) { + resultMetadata.metadata.resize(results.fmqResultSize); + if (request->resultQueue == nullptr) { + ADD_FAILURE(); + return notify; + } + + if (!request->resultQueue->read(reinterpret_cast(resultMetadata.metadata.data()), + results.fmqResultSize)) { + ALOGE("%s: Frame %d: Cannot read camera metadata from fmq," + "size = %" PRIu64, + __func__, frameNumber, results.fmqResultSize); + ADD_FAILURE(); + return notify; + } + + // Physical device results are only expected in the last/final + // partial result notification. + bool expectPhysicalResults = !(request->usePartialResult && + (results.partialResult < request->numPartialResults)); + if (expectPhysicalResults && + (physicalCameraMetadata.size() != request->expectedPhysicalResults.size())) { + ALOGE("%s: Frame %d: Returned physical metadata count %zu " + "must be equal to expected count %zu", + __func__, frameNumber, physicalCameraMetadata.size(), + request->expectedPhysicalResults.size()); + ADD_FAILURE(); + return notify; + } + std::vector> physResultMetadata; + physResultMetadata.resize(physicalCameraMetadata.size()); + for (size_t i = 0; i < physicalCameraMetadata.size(); i++) { + physResultMetadata[i].resize(physicalCameraMetadata[i].fmqMetadataSize); + if (!request->resultQueue->read(reinterpret_cast(physResultMetadata[i].data()), + physicalCameraMetadata[i].fmqMetadataSize)) { + ALOGE("%s: Frame %d: Cannot read physical camera metadata from fmq," + "size = %" PRIu64, + __func__, frameNumber, physicalCameraMetadata[i].fmqMetadataSize); + ADD_FAILURE(); + return notify; + } + } + resultSize = resultMetadata.metadata.size(); + } else if (!results.result.metadata.empty()) { + resultMetadata = results.result; + resultSize = resultMetadata.metadata.size(); + } + + if (!request->usePartialResult && (resultSize > 0) && (results.partialResult != 1)) { + ALOGE("%s: Result is malformed for frame %d: partial_result %u " + "must be 1 if partial result is not supported", + __func__, frameNumber, results.partialResult); + ADD_FAILURE(); + return notify; + } + + if (results.partialResult != 0) { + request->partialResultCount = results.partialResult; + } + + // Check if this result carries only partial metadata + if (request->usePartialResult && (resultSize > 0)) { + if ((results.partialResult > request->numPartialResults) || (results.partialResult < 1)) { + ALOGE("%s: Result is malformed for frame %d: partial_result %u" + " must be in the range of [1, %d] when metadata is " + "included in the result", + __func__, frameNumber, results.partialResult, request->numPartialResults); + ADD_FAILURE(); + return notify; + } + + // Verify no duplicate tags between partial results + const camera_metadata_t* partialMetadata = + reinterpret_cast(resultMetadata.metadata.data()); + const camera_metadata_t* collectedMetadata = request->collectedResult.getAndLock(); + camera_metadata_ro_entry_t searchEntry, foundEntry; + for (size_t i = 0; i < get_camera_metadata_entry_count(partialMetadata); i++) { + if (0 != get_camera_metadata_ro_entry(partialMetadata, i, &searchEntry)) { + ADD_FAILURE(); + request->collectedResult.unlock(collectedMetadata); + return notify; + } + if (-ENOENT != + find_camera_metadata_ro_entry(collectedMetadata, searchEntry.tag, &foundEntry)) { + ADD_FAILURE(); + request->collectedResult.unlock(collectedMetadata); + return notify; + } + } + request->collectedResult.unlock(collectedMetadata); + request->collectedResult.append(partialMetadata); + + isPartialResult = (results.partialResult < request->numPartialResults); + } else if (resultSize > 0) { + request->collectedResult.append( + reinterpret_cast(resultMetadata.metadata.data())); + isPartialResult = false; + } + + hasInputBufferInRequest = request->hasInputBuffer; + + // Did we get the (final) result metadata for this capture? + if ((resultSize > 0) && !isPartialResult) { + if (request->haveResultMetadata) { + ALOGE("%s: Called multiple times with metadata for frame %d", __func__, frameNumber); + ADD_FAILURE(); + return notify; + } + request->haveResultMetadata = true; + request->collectedResult.sort(); + + // Verify final result metadata + auto staticMetadataBuffer = mStaticMetadata; + bool isMonochrome = Status::OK == CameraAidlTest::isMonochromeCamera(staticMetadataBuffer); + if (isMonochrome) { + CameraAidlTest::verifyMonochromeCameraResult(request->collectedResult); + } + + // Verify logical camera result metadata + bool isLogicalCamera = + Status::OK == CameraAidlTest::isLogicalMultiCamera(staticMetadataBuffer); + if (isLogicalCamera) { + camera_metadata_t* collectedMetadata = + const_cast(request->collectedResult.getAndLock()); + uint8_t* rawMetadata = reinterpret_cast(collectedMetadata); + std::vector metadata = std::vector( + rawMetadata, rawMetadata + get_camera_metadata_size(collectedMetadata)); + CameraAidlTest::verifyLogicalCameraResult(staticMetadataBuffer, metadata); + request->collectedResult.unlock(collectedMetadata); + } + } + + uint32_t numBuffersReturned = results.outputBuffers.size(); + auto& inputBuffer = results.inputBuffer.buffer; + if (!inputBuffer.fds.empty() && !inputBuffer.ints.empty()) { + if (hasInputBufferInRequest) { + numBuffersReturned += 1; + } else { + ALOGW("%s: Input buffer should be NULL if there is no input" + " buffer sent in the request", + __func__); + } + } + request->numBuffersLeft -= numBuffersReturned; + if (request->numBuffersLeft < 0) { + ALOGE("%s: Too many buffers returned for frame %d", __func__, frameNumber); + ADD_FAILURE(); + return notify; + } + + for (const auto& buffer : results.outputBuffers) { + // wait for the fence timestamp and store it along with the buffer + // TODO: Check if we really need the dup here + android::sp releaseFence = nullptr; + if (buffer.releaseFence.fds.size() == 1 && buffer.releaseFence.fds[0].get() >= 0) { + releaseFence = new android::Fence(dup(buffer.releaseFence.fds[0].get())); + } + + CameraAidlTest::InFlightRequest::StreamBufferAndTimestamp streamBufferAndTimestamp; + streamBufferAndTimestamp.buffer = {buffer.streamId, + buffer.bufferId, + ::android::makeFromAidl(buffer.buffer), + buffer.status, + ::android::makeFromAidl(buffer.acquireFence), + ::android::makeFromAidl(buffer.releaseFence)}; + streamBufferAndTimestamp.timeStamp = systemTime(); + if (releaseFence && releaseFence->isValid()) { + releaseFence->wait(/*ms*/ 300); + nsecs_t releaseTime = releaseFence->getSignalTime(); + if (streamBufferAndTimestamp.timeStamp < releaseTime) + streamBufferAndTimestamp.timeStamp = releaseTime; + } + request->resultOutputBuffers.push_back(streamBufferAndTimestamp); + } + // If shutter event is received notify the pending threads. + if (request->shutterTimestamp != 0) { + notify = true; + } + + if (mUseHalBufManager) { + returnStreamBuffers(results.outputBuffers); + } + return notify; +} + +ScopedAStatus DeviceCb::notifyHelper( + const std::vector& msgs, + const std::vector>& readoutTimestamps) { + std::lock_guard l(mParent->mLock); + + for (size_t i = 0; i < msgs.size(); i++) { + const NotifyMsg& msg = msgs[i]; + NotifyMsg::Tag msgTag = msgs[i].getTag(); + switch (msgTag) { + case NotifyMsg::Tag::error: + if (ErrorCode::ERROR_DEVICE == msg.get().errorCode) { + ALOGE("%s: Camera reported serious device error", __func__); + ADD_FAILURE(); + } else { + auto itr = mParent->mInflightMap.find( + msg.get().frameNumber); + if (itr == mParent->mInflightMap.end()) { + ALOGE("%s: Unexpected error frame number! received: %u", __func__, + msg.get().frameNumber); + ADD_FAILURE(); + break; + } + + auto r = itr->second; + if (ErrorCode::ERROR_RESULT == msg.get().errorCode && + msg.get().errorStreamId != -1) { + if (r->haveResultMetadata) { + ALOGE("%s: Camera must report physical camera result error before " + "the final capture result!", + __func__); + ADD_FAILURE(); + } else { + for (auto& mStream : mStreams) { + if (mStream.id == msg.get().errorStreamId) { + std::string physicalCameraId = mStream.physicalCameraId; + bool idExpected = + r->expectedPhysicalResults.find(physicalCameraId) != + r->expectedPhysicalResults.end(); + if (!idExpected) { + ALOGE("%s: ERROR_RESULT's error stream's physicalCameraId " + "%s must be expected", + __func__, physicalCameraId.c_str()); + ADD_FAILURE(); + } else { + r->expectedPhysicalResults.erase(physicalCameraId); + } + break; + } + } + } + } else { + r->errorCodeValid = true; + r->errorCode = msg.get().errorCode; + r->errorStreamId = msg.get().errorStreamId; + } + } + break; + case NotifyMsg::Tag::shutter: + auto itr = + mParent->mInflightMap.find(msg.get().frameNumber); + if (itr == mParent->mInflightMap.end()) { + ALOGE("%s: Unexpected shutter frame number! received: %u", __func__, + msg.get().frameNumber); + ADD_FAILURE(); + break; + } + auto& r = itr->second; + r->shutterTimestamp = msg.get().timestamp; + r->shutterReadoutTimestampValid = readoutTimestamps[i].first; + r->shutterReadoutTimestamp = readoutTimestamps[i].second; + break; + } + } + + mParent->mResultCondition.notify_one(); + return ScopedAStatus::ok(); +} + +bool DeviceCb::hasOutstandingBuffersLocked() { + if (!mUseHalBufManager) { + return false; + } + for (const auto& outstandingBuffers : mOutstandingBufferIds) { + if (!outstandingBuffers.empty()) { + return true; + } + } + return false; +} diff --git a/camera/provider/aidl/vts/device_cb.h b/camera/provider/aidl/vts/device_cb.h new file mode 100644 index 0000000000..82ca10ddcb --- /dev/null +++ b/camera/provider/aidl/vts/device_cb.h @@ -0,0 +1,82 @@ +/* + * 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 HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_DEVICECB_H_ +#define HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_DEVICECB_H_ + +#include + +#include + +#include +#include +#include + +using ::aidl::android::hardware::camera::device::BnCameraDeviceCallback; +using ::aidl::android::hardware::camera::device::BufferRequest; +using ::aidl::android::hardware::camera::device::BufferRequestStatus; +using ::aidl::android::hardware::camera::device::CaptureResult; +using ::aidl::android::hardware::camera::device::HalStream; +using ::aidl::android::hardware::camera::device::NotifyMsg; +using ::aidl::android::hardware::camera::device::PhysicalCameraMetadata; +using ::aidl::android::hardware::camera::device::Stream; +using ::aidl::android::hardware::camera::device::StreamBuffer; +using ::aidl::android::hardware::camera::device::StreamBufferRet; +using ::aidl::android::hardware::common::NativeHandle; + +using ::ndk::ScopedAStatus; + +class CameraAidlTest; + +class DeviceCb : public BnCameraDeviceCallback { + public: + DeviceCb(CameraAidlTest* parent, camera_metadata_t* staticMeta); + ScopedAStatus notify(const std::vector& msgs) override; + ScopedAStatus processCaptureResult(const std::vector& results) override; + ScopedAStatus requestStreamBuffers(const std::vector& bufReqs, + std::vector* buffers, + BufferRequestStatus* _aidl_return) override; + ScopedAStatus returnStreamBuffers(const std::vector& buffers) override; + + void setCurrentStreamConfig(const std::vector& streams, + const std::vector& halStreams); + + void waitForBuffersReturned(); + + private: + bool processCaptureResultLocked(const CaptureResult& results, + std::vector physicalCameraMetadata); + ScopedAStatus notifyHelper(const std::vector& msgs, + const std::vector>& readoutTimestamps); + + CameraAidlTest* mParent; // Parent object + + camera_metadata_t* mStaticMetadata; + bool hasOutstandingBuffersLocked(); + + /* members for requestStreamBuffers() and returnStreamBuffers()*/ + std::mutex mLock; // protecting members below + bool mUseHalBufManager = false; + std::vector mStreams; + std::vector mHalStreams; + int64_t mNextBufferId = 1; + using OutstandingBuffers = std::unordered_map; + // size == mStreams.size(). Tracking each streams outstanding buffers + std::vector mOutstandingBufferIds; + std::condition_variable mFlushedCondition; +}; + +#endif // HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_DEVICECB_H_ diff --git a/camera/provider/aidl/vts/empty_device_cb.cpp b/camera/provider/aidl/vts/empty_device_cb.cpp new file mode 100644 index 0000000000..38b0d4c217 --- /dev/null +++ b/camera/provider/aidl/vts/empty_device_cb.cpp @@ -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. + */ + +#include "empty_device_cb.h" +#include + +ScopedAStatus EmptyDeviceCb::notify(const std::vector&) { + ALOGI("notify callback"); + ADD_FAILURE(); // Empty callback should not reach here + return ndk::ScopedAStatus::ok(); +} +ScopedAStatus EmptyDeviceCb::processCaptureResult(const std::vector&) { + ALOGI("processCaptureResult callback"); + ADD_FAILURE(); // Empty callback should not reach here + return ndk::ScopedAStatus::ok(); +} +ScopedAStatus EmptyDeviceCb::requestStreamBuffers(const std::vector&, + std::vector*, + BufferRequestStatus* _aidl_return) { + ALOGI("requestStreamBuffers callback"); + // HAL might want to request buffer after configureStreams, but tests with EmptyDeviceCb + // doesn't actually need to send capture requests, so just return an error. + *_aidl_return = BufferRequestStatus::FAILED_UNKNOWN; + return ndk::ScopedAStatus::ok(); +} +ScopedAStatus EmptyDeviceCb::returnStreamBuffers(const std::vector&) { + ALOGI("returnStreamBuffers"); + ADD_FAILURE(); // Empty callback should not reach here + return ndk::ScopedAStatus::ok(); +} diff --git a/camera/provider/aidl/vts/empty_device_cb.h b/camera/provider/aidl/vts/empty_device_cb.h new file mode 100644 index 0000000000..e777513068 --- /dev/null +++ b/camera/provider/aidl/vts/empty_device_cb.h @@ -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. + */ + +#ifndef HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_EMPTY_DEVICE_CB_H_ +#define HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_EMPTY_DEVICE_CB_H_ + +#include +#include + +using namespace ::aidl::android::hardware::camera::device; + +using ::aidl::android::hardware::camera::device::BnCameraDeviceCallback; +using ::ndk::ScopedAStatus; + +class EmptyDeviceCb : public BnCameraDeviceCallback { + public: + ScopedAStatus notify(const std::vector& msgs) override; + ScopedAStatus processCaptureResult(const std::vector<::CaptureResult>& results) override; + ScopedAStatus requestStreamBuffers(const std::vector& bufReqs, + std::vector* buffers, + BufferRequestStatus* _aidl_return) override; + ScopedAStatus returnStreamBuffers(const std::vector& buffers) override; +}; + +#endif // HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_EMPTY_DEVICE_CB_H_ diff --git a/camera/provider/aidl/vts/simple_device_cb.cpp b/camera/provider/aidl/vts/simple_device_cb.cpp new file mode 100644 index 0000000000..e9a2c73ad7 --- /dev/null +++ b/camera/provider/aidl/vts/simple_device_cb.cpp @@ -0,0 +1,36 @@ +/* + * 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. + */ + +#include "simple_device_cb.h" + +ScopedAStatus SimpleDeviceCb::notify(const std::vector& msgs) { + std::unique_lock l(mParent->mLock); + mParent->mNotifyMessages = msgs; + mParent->mResultCondition.notify_one(); + + return ndk::ScopedAStatus::ok(); +} +ScopedAStatus SimpleDeviceCb::processCaptureResult(const std::vector&) { + return ndk::ScopedAStatus::fromStatus(STATUS_UNKNOWN_TRANSACTION); +} +ScopedAStatus SimpleDeviceCb::requestStreamBuffers(const std::vector&, + std::vector*, + BufferRequestStatus*) { + return ndk::ScopedAStatus::fromStatus(STATUS_UNKNOWN_TRANSACTION); +} +ScopedAStatus SimpleDeviceCb::returnStreamBuffers(const std::vector&) { + return ndk::ScopedAStatus::fromStatus(STATUS_UNKNOWN_TRANSACTION); +} diff --git a/camera/provider/aidl/vts/simple_device_cb.h b/camera/provider/aidl/vts/simple_device_cb.h new file mode 100644 index 0000000000..6beffc7966 --- /dev/null +++ b/camera/provider/aidl/vts/simple_device_cb.h @@ -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. + */ + +#ifndef HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_SIMPLE_DEVICE_CB_H_ +#define HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_SIMPLE_DEVICE_CB_H_ + +#include "camera_aidl_test.h" + +#include + +#include + +using namespace ::aidl::android::hardware::camera::device; + +class SimpleDeviceCb : public BnCameraDeviceCallback { + public: + ScopedAStatus notify(const std::vector& msgs) override; + ScopedAStatus processCaptureResult(const std::vector& results) override; + ScopedAStatus requestStreamBuffers(const std::vector& bufReqs, + std::vector* buffers, + BufferRequestStatus* _aidl_return) override; + virtual ScopedAStatus returnStreamBuffers(const std::vector& buffers) override; + + private: + CameraAidlTest* mParent; +}; + +#endif // HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_SIMPLE_DEVICE_CB_H_ diff --git a/camera/provider/aidl/vts/torch_provider_cb.cpp b/camera/provider/aidl/vts/torch_provider_cb.cpp new file mode 100644 index 0000000000..52240dfed3 --- /dev/null +++ b/camera/provider/aidl/vts/torch_provider_cb.cpp @@ -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. + */ + +#include "torch_provider_cb.h" + +TorchProviderCb::TorchProviderCb(CameraAidlTest* parent) { + mParent = parent; +} + +ndk::ScopedAStatus TorchProviderCb::torchModeStatusChange(const std::string&, + TorchModeStatus newStatus) { + std::lock_guard l(mParent->mTorchLock); + mParent->mTorchStatus = newStatus; + mParent->mTorchCond.notify_one(); + return ndk::ScopedAStatus::ok(); +} +ScopedAStatus TorchProviderCb::cameraDeviceStatusChange( + const std::string&, ::aidl::android::hardware::camera::common::CameraDeviceStatus) { + // Should not be called + return ndk::ScopedAStatus::fromStatus(STATUS_UNKNOWN_TRANSACTION); +} +ScopedAStatus TorchProviderCb::physicalCameraDeviceStatusChange( + const std::string&, const std::string&, + ::aidl::android::hardware::camera::common::CameraDeviceStatus) { + // Should not be called + return ndk::ScopedAStatus::fromStatus(STATUS_UNKNOWN_TRANSACTION); +} diff --git a/camera/provider/aidl/vts/torch_provider_cb.h b/camera/provider/aidl/vts/torch_provider_cb.h new file mode 100644 index 0000000000..03532541b3 --- /dev/null +++ b/camera/provider/aidl/vts/torch_provider_cb.h @@ -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. + */ + +#ifndef HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_TORCH_PROVIDER_CB_H_ +#define HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_TORCH_PROVIDER_CB_H_ + +#import +#import + +using ::aidl::android::hardware::camera::common::TorchModeStatus; +using ::aidl::android::hardware::camera::provider::BnCameraProviderCallback; + +class TorchProviderCb : public BnCameraProviderCallback { + public: + TorchProviderCb(CameraAidlTest* parent); + ndk::ScopedAStatus torchModeStatusChange(const std::string& cameraDeviceName, + TorchModeStatus newStatus) override; + + ScopedAStatus cameraDeviceStatusChange( + const std::string& in_cameraDeviceName, + ::aidl::android::hardware::camera::common::CameraDeviceStatus in_newStatus) override; + + ScopedAStatus physicalCameraDeviceStatusChange( + const std::string& in_cameraDeviceName, const std::string& in_physicalCameraDeviceName, + ::aidl::android::hardware::camera::common::CameraDeviceStatus in_newStatus) override; + + private: + CameraAidlTest* mParent; +}; + +#endif // HARDWARE_INTERFACES_CAMERA_PROVIDER_AIDL_VTS_TORCH_PROVIDER_CB_H_ -- GitLab From 89b3de718d848a2809d819fc96fa74cb02d40c0f Mon Sep 17 00:00:00 2001 From: Chris Ye Date: Wed, 23 Feb 2022 15:54:06 -0800 Subject: [PATCH 655/825] Change the expected AP iface index when dual STAs supported. When the HAL support dual STAs, AP should start with idx 2. Bug: 220338166 Test: atest -c android.hardware.wifi@1.0-service-tests Change-Id: Ic3780ea346417cf878b94e4ead8fc3eff22baf8f --- wifi/1.6/default/tests/wifi_chip_unit_tests.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp index eaab211219..81117c5e06 100644 --- a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp +++ b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp @@ -846,13 +846,15 @@ TEST_F(WifiChip_MultiIfaceTest, CreateStaWithCustomAltNames) { } TEST_F(WifiChip_MultiIfaceTest, CreateApStartsWithIdx1) { + // WifiChip_MultiIfaceTest iface combo: STAx3 + APx1 + // When the HAL support dual STAs, AP should start with idx 2. findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA); // First AP will be slotted to wlan1. - ASSERT_EQ(createIface(IfaceType::AP), "wlan1"); + ASSERT_EQ(createIface(IfaceType::AP), "wlan2"); // First STA will be slotted to wlan0. ASSERT_EQ(createIface(IfaceType::STA), "wlan0"); // All further STA will be slotted to the remaining free indices. - ASSERT_EQ(createIface(IfaceType::STA), "wlan2"); + ASSERT_EQ(createIface(IfaceType::STA), "wlan1"); ASSERT_EQ(createIface(IfaceType::STA), "wlan3"); } } // namespace implementation -- GitLab From 8ff184b518b3ea78919fb636845372fc246c0a2a Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Fri, 18 Feb 2022 17:46:49 -0800 Subject: [PATCH 656/825] Add composer API changes in accordance to partner feedback * Add a DimmingStage to the client target configuration reported by HWC, which may be used for some vendor color modes to configure when dimming should occur during client composition * Communicate the display brightness in nits, so that HWC implementations do not need to parse the per-display xml to map from display brightness to nits. Furthermore, this is more plausible for extensibility for external displays. Bug: 220396224 Bug: 218954037 Test: builds Change-Id: I5675c16f0895f9958e3bee3ee4c85df8937ecdb7 --- .../graphics/composer3/DimmingStage.aidl | 40 +++++++++++++++++++ .../graphics/composer3/DisplayBrightness.aidl | 1 + .../graphics/composer3/DimmingStage.aidl | 35 ++++++++++++++++ .../graphics/composer3/DisplayBrightness.aidl | 11 ++++- 4 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DimmingStage.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/DimmingStage.aidl diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DimmingStage.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DimmingStage.aidl new file mode 100644 index 0000000000..44457f8ec1 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DimmingStage.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 -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 DimmingStage { + NONE = 0, + LINEAR = 1, + GAMMA_OETF = 2, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayBrightness.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayBrightness.aidl index be623df763..e765189b96 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayBrightness.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayBrightness.aidl @@ -35,4 +35,5 @@ package android.hardware.graphics.composer3; @VintfStability parcelable DisplayBrightness { float brightness; + float brightnessNits; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DimmingStage.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DimmingStage.aidl new file mode 100644 index 0000000000..f732d417b1 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DimmingStage.aidl @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +@Backing(type="int") +enum DimmingStage { + /** + * Corresponds to if the dimming stage is not meaningful for a scene, such as + * if client composition is not requesting dimming. + */ + NONE = 0, + /** + * Dimming operations must be applied in linear optical space + */ + LINEAR = 1, + /** + * Dimming operations must be applied in gamma space, after OETF has been applied + */ + GAMMA_OETF = 2, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayBrightness.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayBrightness.aidl index f66b235098..51f4db5dbb 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayBrightness.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayBrightness.aidl @@ -20,7 +20,16 @@ package android.hardware.graphics.composer3; parcelable DisplayBrightness { /** * A number between 0.0f (minimum brightness) and 1.0f (maximum brightness), a negative value to - * turn the backlight off. + * turn the backlight off */ float brightness; + + /** + * The absolute brightness in nits of the backlight, if it is available. This will be a negative + * value if it is not known. + * + * An implementation may choose to use this value to assist with tone-mapping, as a mapping + * between the brightness float and the nits may not otherwise be known. + */ + float brightnessNits; } -- GitLab From 51aa86c095da700219c3f93a874dd9b5e359824a Mon Sep 17 00:00:00 2001 From: Avichal Rakesh Date: Thu, 24 Feb 2022 05:41:13 +0000 Subject: [PATCH 657/825] camera: Fix build errors due to CLs interleaving. ag/16982347 and ag/16988237 were submitted around the same time, but can cause build failure when put together. This CL fixes the compilation issues and a few other other warnings. Fix: 221154052 Test: Existing Change-Id: Ia865e3bfc6cd77e7eff1efa5729d6db0d58c279d --- camera/provider/aidl/vts/camera_aidl_test.cpp | 29 ++++++++++--------- camera/provider/aidl/vts/camera_aidl_test.h | 5 ++-- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp index d03b09763b..48bca244d9 100644 --- a/camera/provider/aidl/vts/camera_aidl_test.cpp +++ b/camera/provider/aidl/vts/camera_aidl_test.cpp @@ -16,6 +16,8 @@ #include "camera_aidl_test.h" +#include + #include #include #include @@ -39,14 +41,12 @@ using ::aidl::android::hardware::camera::common::CameraDeviceStatus; using ::aidl::android::hardware::camera::common::TorchModeStatus; using ::aidl::android::hardware::camera::device::CameraMetadata; using ::aidl::android::hardware::camera::device::ICameraDevice; -using ::aidl::android::hardware::camera::device::ICameraDeviceSessionDefault; using ::aidl::android::hardware::camera::metadata::CameraMetadataTag; using ::aidl::android::hardware::camera::metadata::SensorInfoColorFilterArrangement; using ::aidl::android::hardware::camera::metadata::SensorPixelMode; using ::aidl::android::hardware::camera::provider::BnCameraProviderCallback; using ::aidl::android::hardware::camera::provider::ConcurrentCameraIdCombination; using ::aidl::android::hardware::camera::provider::ICameraProvider; -using ::aidl::android::hardware::camera::provider::ICameraProviderCallback; using ::aidl::android::hardware::common::NativeHandle; using ::android::hardware::camera::common::V1_0::helper::Size; using ::ndk::ScopedAStatus; @@ -97,7 +97,7 @@ bool parseProviderName(const std::string& serviceDescriptor, std::string* type / char* endPtr; errno = 0; - long idVal = strtol(serviceDescriptor.c_str() + slashIdx2 + 1, &endPtr, 10); + int64_t idVal = strtol(serviceDescriptor.c_str() + slashIdx2 + 1, &endPtr, 10); if (errno != 0) { ADD_FAILURE() << "cannot parse provider id as an integer:" << serviceDescriptor.c_str() << strerror(errno) << errno; @@ -1538,7 +1538,7 @@ void CameraAidlTest::verifyRequestTemplate(const camera_metadata_t* metadata, } void CameraAidlTest::openEmptyDeviceSession(const std::string& name, - std::shared_ptr provider, + const std::shared_ptr& provider, std::shared_ptr* session, CameraMetadata* staticMeta, std::shared_ptr* device) { @@ -2572,7 +2572,7 @@ void CameraAidlTest::configurePreviewStreams( void CameraAidlTest::verifyBuffersReturned(const std::shared_ptr& session, const std::vector& streamIds, - std::shared_ptr cb, + const std::shared_ptr& cb, uint32_t streamConfigCounter) { ndk::ScopedAStatus ret = session->signalStreamFlush(streamIds, /*streamConfigCounter*/ streamConfigCounter); @@ -2712,20 +2712,20 @@ void CameraAidlTest::get10BitDynamicRangeProfiles( ASSERT_NE(nullptr, staticMeta); ASSERT_NE(nullptr, profiles); camera_metadata_ro_entry entry; - std::unordered_set entries; + std::unordered_set entries; int rc = find_camera_metadata_ro_entry( staticMeta, ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP, &entry); ASSERT_EQ(rc, 0); ASSERT_TRUE(entry.count > 0); - ASSERT_EQ(entry.count % 2, 0); + ASSERT_EQ(entry.count % 3, 0); - for (uint32_t i = 0; i < entry.count; i += 2) { - ASSERT_NE(entry.data.i32[i], ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD); - ASSERT_EQ(entries.find(entry.data.i32[i]), entries.end()); - entries.insert(static_cast(entry.data.i32[i])); + for (uint32_t i = 0; i < entry.count; i += 3) { + ASSERT_NE(entry.data.i64[i], ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD); + ASSERT_EQ(entries.find(entry.data.i64[i]), entries.end()); + entries.insert(static_cast(entry.data.i64[i])); profiles->emplace_back( static_cast(entry.data.i32[i])); + RequestAvailableDynamicRangeProfilesMap>(entry.data.i64[i])); } if (!entries.empty()) { @@ -2743,7 +2743,7 @@ void CameraAidlTest::verify10BitMetadata( bool smpte2094_10Present = importer.isSmpte2094_10Present(b.buffer.buffer); bool smpte2094_40Present = importer.isSmpte2094_40Present(b.buffer.buffer); - switch (static_cast(profile)) { + switch (static_cast(profile)) { case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10: ASSERT_FALSE(smpte2086Present); ASSERT_FALSE(smpte2094_10Present); @@ -2772,7 +2772,8 @@ void CameraAidlTest::verify10BitMetadata( ASSERT_FALSE(smpte2094_40Present); break; default: - ALOGE("%s: Unexpected 10-bit dynamic range profile: %d", __FUNCTION__, profile); + ALOGE("%s: Unexpected 10-bit dynamic range profile: %" PRId64, __FUNCTION__, + profile); ADD_FAILURE(); } } diff --git a/camera/provider/aidl/vts/camera_aidl_test.h b/camera/provider/aidl/vts/camera_aidl_test.h index cc381696c7..8e284a27b6 100644 --- a/camera/provider/aidl/vts/camera_aidl_test.h +++ b/camera/provider/aidl/vts/camera_aidl_test.h @@ -149,7 +149,7 @@ class CameraAidlTest : public ::testing::TestWithParam { PixelFormat format, buffer_handle_t* buffer_handle /*out*/); static void openEmptyDeviceSession(const std::string& name, - std::shared_ptr provider, + const std::shared_ptr& provider, std::shared_ptr* session /*out*/, CameraMetadata* staticMeta /*out*/, std::shared_ptr* device /*out*/); @@ -240,7 +240,8 @@ class CameraAidlTest : public ::testing::TestWithParam { uint32_t streamConfigCounter = 0); void verifyBuffersReturned(const std::shared_ptr& session, - const std::vector& streamIds, std::shared_ptr cb, + const std::vector& streamIds, + const std::shared_ptr& cb, uint32_t streamConfigCounter = 0); static void verifySessionReconfigurationQuery( -- GitLab From ba362a8c195904d9d5577e05d07f4216b2b56e63 Mon Sep 17 00:00:00 2001 From: Cliff Wu Date: Mon, 21 Feb 2022 19:50:13 +0800 Subject: [PATCH 658/825] Added annotations to prevent misapply of this interface by OEM partners - This interface is only suitable for special camera injection hal, general camera hal does not need to implement it. Test: Camera VTS Bug: 219684073 Change-Id: I9b70e4640dff205008f3d6270f402b720b6b4434 --- camera/device/3.7/ICameraInjectionSession.hal | 5 ++++- current.txt | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/camera/device/3.7/ICameraInjectionSession.hal b/camera/device/3.7/ICameraInjectionSession.hal index f5797c3b17..9be9b2548b 100644 --- a/camera/device/3.7/ICameraInjectionSession.hal +++ b/camera/device/3.7/ICameraInjectionSession.hal @@ -24,7 +24,10 @@ import @3.6::HalStreamConfiguration; import @3.7::ICameraDeviceSession; /** - * Injection Camera device active session interface. + * Injection camera device active session interface. + * + * Note that this is implemented on a special camera injection hal, if it is a + * general camera hal, it is not necessary to implement this interface. * * When an external camera is injected to replace the internal camera session, the * injection session will be established in camera framework, and then diff --git a/current.txt b/current.txt index 1fedaa0d6e..df6f91dcb0 100644 --- a/current.txt +++ b/current.txt @@ -910,5 +910,6 @@ f767a132ef28275294db15353f14f3876a4048770751931a77d038d4228f2cb7 android.hardwar d0fb32f3ddeb9af7115ab32905225ea69b930d2472be8e9610f0cf136c15aefb android.hardware.keymaster@4.0::IKeymasterDevice # b/210424594 ca62a2a95d173ed323309e5e00f653ad3cceec82a6e5e4976a249cb5aafe2515 android.hardware.neuralnetworks@1.2::types fa76bced6b1b71c40fc706c508a9011284c57f57831cd0cf5f45653ed4ea463e android.hardware.neuralnetworks@1.3::types +700d9de9b47984898789f5706e59285ea6fe83aa5744dccf8491c4b881033ae7 android.hardware.camera.device@3.7::ICameraInjectionSession # There should be no more HIDL HALs - please use AIDL instead. -- GitLab From 6455e797c6a97f653cd69316462937ee5085eede Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Thu, 24 Feb 2022 12:18:58 -0500 Subject: [PATCH 659/825] getDisplayDecorationSupport: expect IComposerClient::EX_UNSUPPORTED This is the error returned by cuttlefish, not EX_UNSUPPORTED_OPERATION. This also matches other tests, e.g. SetDisplayBrightness. Bug: 209458568 Test: this Change-Id: I885767c4f1c42edfb11359b36852a863cbc8b0ed --- .../composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 74a8a57e22..68ec7e813d 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1655,7 +1655,7 @@ TEST_P(GraphicsComposerAidlCommandTest, DisplayDecoration) { } else { const auto errors = mReader.takeErrors(); ASSERT_EQ(1, errors.size()); - EXPECT_EQ(EX_UNSUPPORTED_OPERATION, errors[0].errorCode); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, errors[0].errorCode); const auto changedTypes = mReader.takeChangedCompositionTypes(display.getDisplayId()); ASSERT_EQ(1u, changedTypes.size()); -- GitLab From 88e871b66353803062f1d0ed5d06b176800a35f3 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Thu, 24 Feb 2022 12:15:09 -0800 Subject: [PATCH 660/825] Actually add DimmingStage to client target properties This change was missed while cherry-picking I5675c16f0895f9958e3bee3ee4c85df8937ecdb7 due to merge conflicts. So...actually merge this. Bug: 218954037 Test: builds Change-Id: Idb3a518f7dfd4f4fd598672ee709ccd5b1f3f06a --- .../ClientTargetPropertyWithBrightness.aidl | 1 + .../ClientTargetPropertyWithBrightness.aidl | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl index c445f30bcd..8fb6933c95 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl @@ -37,4 +37,5 @@ parcelable ClientTargetPropertyWithBrightness { long display; android.hardware.graphics.composer3.ClientTargetProperty clientTargetProperty; float brightness; + android.hardware.graphics.composer3.DimmingStage dimmingStage; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl index d9e4e16788..ba6fe97c3d 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl @@ -17,6 +17,7 @@ package android.hardware.graphics.composer3; import android.hardware.graphics.composer3.ClientTargetProperty; +import android.hardware.graphics.composer3.DimmingStage; @VintfStability parcelable ClientTargetPropertyWithBrightness { @@ -35,4 +36,18 @@ parcelable ClientTargetPropertyWithBrightness { * The brightness as described in CommandResultPayload.clientTargetProperty */ float brightness; + + /** + * The stage in which dimming operations should be performed when compositing + * the client target. + * Note that with a COLORIMETRIC RenderIntent, DimmingSpace must be LINEAR. That is, dimming + * is defined to occur in linear space. + * However, some composer implementations may, with other vendor-defined RenderIntents, + * configure their hardware such as image quality adjustments is intended to occur after + * composition. In this scenario, if the dimming operation were applied in linear space, + * then the resulting dimming operation may comepl those image quality adjustments to + * incorrectly alter the gamma curve. To avoid this issue, those implementations must opt to + * dim in gamma space. + */ + DimmingStage dimmingStage; } -- GitLab From b48b6e28cb300716b52e6ebdf44d31cbd33a7202 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 15 Feb 2022 12:33:42 -0800 Subject: [PATCH 661/825] Improve getPropConfigs and error logging. This CL improves getPropConfigs to return INVALID_ARG when one of the prop ID is not found according to the AIDL interface definition. This CL also improves logging to print out exception code. This CL also updates service manifest to be consistent with https://source.android.com/devices/architecture/aidl/aidl-hals Test: atest DefaultVehicleHalTest Bug: 219782023, 219612366 Change-Id: I96b091c5cf6641ab7d1df5c644bde7491cbaa5e7 --- .../aidl/impl/vhal/src/ConnectedClient.cpp | 14 +++--- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 6 +++ .../impl/vhal/test/DefaultVehicleHalTest.cpp | 44 +++++++++++++++++++ .../aidl/impl/vhal/vhal-default-service.xml | 6 +-- 4 files changed, 60 insertions(+), 10 deletions(-) diff --git a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp index 098bfee1bb..830b93657c 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp @@ -67,7 +67,8 @@ void sendGetOrSetValueResult(std::shared_ptr callback, const R parcelableResults.payloads[0] = result; if (ScopedAStatus callbackStatus = callCallback(callback, parcelableResults); !callbackStatus.isOk()) { - ALOGE("failed to call callback, error: %s, code: %d", callbackStatus.getMessage(), + ALOGE("failed to call callback, error: %s, exception: %d, service specific error: %d", + callbackStatus.getMessage(), callbackStatus.getExceptionCode(), callbackStatus.getServiceSpecificError()); } } @@ -90,8 +91,9 @@ void sendGetOrSetValueResults(std::shared_ptr callback, if (status.isOk()) { if (ScopedAStatus callbackStatus = callCallback(callback, parcelableResults); !callbackStatus.isOk()) { - ALOGE("failed to call callback, error: %s, code: %d", status.getMessage(), - status.getServiceSpecificError()); + ALOGE("failed to call callback, error: %s, exception: %d, service specific error: %d", + callbackStatus.getMessage(), callbackStatus.getExceptionCode(), + callbackStatus.getServiceSpecificError()); } return; } @@ -296,8 +298,10 @@ void SubscriptionClient::sendUpdatedValues(std::shared_ptr cal if (ScopedAStatus callbackStatus = callback->onPropertyEvent(vehiclePropValues, sharedMemoryFileCount); !callbackStatus.isOk()) { - ALOGE("subscribe: failed to call callback, error: %s, code: %d", status.getMessage(), - status.getServiceSpecificError()); + ALOGE("subscribe: failed to call callback, error: %s, exception: %d, " + "service specific error: %d", + callbackStatus.getMessage(), callbackStatus.getExceptionCode(), + callbackStatus.getServiceSpecificError()); } } diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index c0a66daf75..52f36316d9 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -218,6 +218,7 @@ void DefaultVehicleHal::onBinderDied(void* cookie) { } void DefaultVehicleHal::onBinderDiedWithContext(const AIBinder* clientId) { + ALOGD("binder died"); std::scoped_lock lockGuard(mLock); mSetValuesClients.erase(clientId); mGetValuesClients.erase(clientId); @@ -232,6 +233,7 @@ void DefaultVehicleHal::onBinderUnlinked(void* cookie) { } void DefaultVehicleHal::onBinderUnlinkedWithContext(const AIBinder* clientId) { + ALOGD("binder unlinked"); std::scoped_lock lockGuard(mLock); mOnBinderDiedContexts.erase(clientId); } @@ -534,6 +536,10 @@ ScopedAStatus DefaultVehicleHal::getPropConfigs(const std::vector& prop for (int32_t prop : props) { if (mConfigsByPropId.find(prop) != mConfigsByPropId.end()) { configs.push_back(mConfigsByPropId[prop]); + } else { + return ScopedAStatus::fromServiceSpecificErrorWithMessage( + toInt(StatusCode::INVALID_ARG), + StringPrintf("no config for property, ID: %" PRId32, prop).c_str()); } } return vectorToStableLargeParcelable(std::move(configs), output); diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 178498ba83..aafa17ecb2 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -514,6 +514,50 @@ TEST_F(DefaultVehicleHalTest, testGetAllPropConfigsLarge) { ASSERT_EQ(result.value().getObject()->payloads, testConfigs); } +TEST_F(DefaultVehicleHalTest, testGetPropConfigs) { + auto testConfigs = std::vector({ + VehiclePropConfig{ + .prop = 1, + }, + VehiclePropConfig{ + .prop = 2, + }, + }); + + auto hardware = std::make_unique(); + hardware->setPropertyConfigs(testConfigs); + auto vhal = ndk::SharedRefBase::make(std::move(hardware)); + std::shared_ptr client = IVehicle::fromBinder(vhal->asBinder()); + + VehiclePropConfigs output; + auto status = client->getPropConfigs(std::vector({1, 2}), &output); + + ASSERT_TRUE(status.isOk()) << "getPropConfigs failed: " << status.getMessage(); + ASSERT_EQ(output.payloads, testConfigs); +} + +TEST_F(DefaultVehicleHalTest, testGetPropConfigsInvalidArg) { + auto testConfigs = std::vector({ + VehiclePropConfig{ + .prop = 1, + }, + VehiclePropConfig{ + .prop = 2, + }, + }); + + auto hardware = std::make_unique(); + hardware->setPropertyConfigs(testConfigs); + auto vhal = ndk::SharedRefBase::make(std::move(hardware)); + std::shared_ptr client = IVehicle::fromBinder(vhal->asBinder()); + + VehiclePropConfigs output; + auto status = client->getPropConfigs(std::vector({1, 2, 3}), &output); + + ASSERT_FALSE(status.isOk()) << "getPropConfigs must fail with invalid prop ID"; + ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::INVALID_ARG)); +} + TEST_F(DefaultVehicleHalTest, testGetValuesSmall) { GetValueRequests requests; std::vector expectedResults; diff --git a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml index 8d237b8203..4d587eeba8 100644 --- a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml +++ b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml @@ -1,11 +1,7 @@ android.hardware.automotive.vehicle - hwbinder 1 - - IVehicle - default - + IVehicle/default -- GitLab From 83fe805275786b40e70d16af075d9a555319106b Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 18 Feb 2022 00:19:25 +0000 Subject: [PATCH 662/825] Improve test coverage for FakeValueGenerator. Bug: None Test: atest FakeVehicleHalValueGeneratorsTest Change-Id: I6df508e148ff0348fc28b467b4e5a70cf5727a27 Merged-In: I6df508e148ff0348fc28b467b4e5a70cf5727a27 (cherry picked from commit 6ae468c1e39f72456416697ee7cf483dcf0c6f3b) --- .../fake_impl/GeneratorHub/test/Android.bp | 1 + .../FakeVehicleHalValueGeneratorsTest.cpp | 165 ++++++++++++------ .../test/prop_different_types.json | 58 ++++++ .../aidl/impl/utils/common/test/Android.bp | 2 +- 4 files changed, 174 insertions(+), 52 deletions(-) create mode 100644 automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/prop_different_types.json diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp index ac8db44e59..2eef13c6e9 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/Android.bp @@ -41,6 +41,7 @@ filegroup { name: "FakeVehicleHalValueGeneratorsTestFiles", srcs: [ "prop.json", + "prop_different_types.json", "prop_invalid.json", ], } diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/FakeVehicleHalValueGeneratorsTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/FakeVehicleHalValueGeneratorsTest.cpp index 21aa680dda..674b07831b 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/FakeVehicleHalValueGeneratorsTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/FakeVehicleHalValueGeneratorsTest.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -38,6 +39,9 @@ namespace fake { using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; +using ::android::base::ScopedLockAssertion; + +using std::literals::chrono_literals::operator""s; class FakeVehicleHalValueGeneratorsTest : public ::testing::Test { protected: @@ -58,6 +62,16 @@ class FakeVehicleHalValueGeneratorsTest : public ::testing::Test { mEvents.clear(); } + void waitForEvents(size_t count) { + std::unique_lock uniqueLock(mEventsLock); + bool result = mCv.wait_for(uniqueLock, 10s, [this, count] { + ScopedLockAssertion lockAssertion(mEventsLock); + return mEvents.size() == count; + }); + + ASSERT_TRUE(result) << "didn't receive enough events"; + } + void TearDown() override { // Generator callback uses mEvents, must stop generator before destroying mEvents. mHub.reset(); @@ -71,12 +85,16 @@ class FakeVehicleHalValueGeneratorsTest : public ::testing::Test { private: void onHalEvent(const VehiclePropValue& event) { VehiclePropValue eventCopy = event; - std::scoped_lock lockGuard(mEventsLock); - mEvents.push_back(std::move(eventCopy)); + { + std::scoped_lock lockGuard(mEventsLock); + mEvents.push_back(std::move(eventCopy)); + } + mCv.notify_all(); } std::unique_ptr mHub; std::mutex mEventsLock; + std::condition_variable mCv; std::vector mEvents GUARDED_BY(mEventsLock); }; @@ -115,8 +133,7 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testRegisterTestFakeValueGenerator) { getHub()->registerGenerator(0, std::move(generator)); - // All the events require 500ms to generate, so waiting for 1000ms should be enough. - std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + waitForEvents(events.size()); ASSERT_EQ(getEvents(), events); @@ -137,11 +154,12 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testUnregisterGeneratorStopGeneration) generator->setEvents(events); getHub()->registerGenerator(0, std::move(generator)); - getHub()->unregisterGenerator(0); - std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + waitForEvents(1); - ASSERT_LT(getEvents().size(), static_cast(10)) + getHub()->unregisterGenerator(0); + + ASSERT_LE(getEvents().size(), 2u) << "Must stop generating event after generator is unregistered"; } @@ -155,13 +173,12 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testLinerFakeValueGeneratorFloat) { /*interval=*/10000000); getHub()->registerGenerator(0, std::move(generator)); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - + waitForEvents(10); auto events = getEvents(); - // We should get 10 events ideally, but let's be safe here. - ASSERT_LE((size_t)5, events.size()); + + ASSERT_EQ(events.size(), 10u); int value = 30; - for (size_t i = 0; i < 5; i++) { + for (size_t i = 0; i < 10; i++) { EXPECT_EQ(std::vector({static_cast(value)}), events[i].value.floatValues); value = (value + 20) % 100; } @@ -177,13 +194,11 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testLinerFakeValueGeneratorInt32) { /*interval=*/10000000); getHub()->registerGenerator(0, std::move(generator)); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - + waitForEvents(10); auto events = getEvents(); - // We should get 10 events ideally, but let's be safe here. - ASSERT_LE((size_t)5, events.size()); + ASSERT_EQ(events.size(), 10u); int value = 30; - for (size_t i = 0; i < 5; i++) { + for (size_t i = 0; i < 10; i++) { EXPECT_EQ(std::vector({value}), events[i].value.int32Values); value = (value + 20) % 100; } @@ -199,13 +214,12 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testLinerFakeValueGeneratorInt64) { /*interval=*/10000000); getHub()->registerGenerator(0, std::move(generator)); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - + waitForEvents(10); auto events = getEvents(); // We should get 10 events ideally, but let's be safe here. - ASSERT_LE((size_t)5, events.size()); + ASSERT_EQ(events.size(), 10u); int value = 30; - for (size_t i = 0; i < 5; i++) { + for (size_t i = 0; i < 10; i++) { EXPECT_EQ(std::vector({value}), events[i].value.int64Values); value = (value + 20) % 100; } @@ -221,13 +235,11 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testLinerFakeValueGeneratorUsingReques std::make_unique(request); getHub()->registerGenerator(0, std::move(generator)); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - + waitForEvents(10); auto events = getEvents(); - // We should get 10 events ideally, but let's be safe here. - ASSERT_LE((size_t)5, events.size()); + ASSERT_EQ(events.size(), 10u); int value = 50; - for (size_t i = 0; i < 5; i++) { + for (size_t i = 0; i < 10; i++) { EXPECT_EQ(std::vector({static_cast(value)}), events[i].value.floatValues); value = (value + 20) % 100; } @@ -244,15 +256,13 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testLinerFakeValueGeneratorInvalidInit /*interval=*/10000000); getHub()->registerGenerator(0, std::move(generator)); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - + waitForEvents(10); auto events = getEvents(); - // We should get 10 events ideally, but let's be safe here. - ASSERT_LE((size_t)5, events.size()); + ASSERT_EQ(events.size(), 10u); // Init value would be set to middleValue if given initValue is not valid. int value = 50; - for (size_t i = 0; i < 5; i++) { + for (size_t i = 0; i < 10; i++) { EXPECT_EQ(std::vector({static_cast(value)}), events[i].value.floatValues); value = (value + 20) % 100; } @@ -265,9 +275,6 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testJsonFakeValueGenerator) { std::make_unique(getTestFilePath("prop.json"), 2); getHub()->registerGenerator(0, std::move(generator)); - // wait for some time. - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - std::vector expectedValues = { VehiclePropValue{ .areaId = 0, @@ -296,6 +303,7 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testJsonFakeValueGenerator) { expectedValues.push_back(expectedValues[i]); } + waitForEvents(expectedValues.size()); auto events = getEvents(); long lastEventTime = currentTime; @@ -313,14 +321,7 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testJsonFakeValueGeneratorIterateIndef std::make_unique(getTestFilePath("prop.json"), -1); getHub()->registerGenerator(0, std::move(generator)); - // wait for some time. - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - - auto events = getEvents(); - - // Send 1 iteration takes 4ms + 1ms interval between iteration, so for 100ms we should get about - // 20 iteration, which is 80 events. - EXPECT_GT(events.size(), static_cast(50)); + waitForEvents(40); } TEST_F(FakeVehicleHalValueGeneratorsTest, testJsonFakeValueGeneratorUsingRequest) { @@ -335,9 +336,6 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testJsonFakeValueGeneratorUsingRequest std::make_unique(request); getHub()->registerGenerator(0, std::move(generator)); - // wait for some time. - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - std::vector expectedValues = { VehiclePropValue{ .areaId = 0, @@ -366,6 +364,7 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testJsonFakeValueGeneratorUsingRequest expectedValues.push_back(expectedValues[i]); } + waitForEvents(expectedValues.size()); auto events = getEvents(); long lastEventTime = currentTime; @@ -388,9 +387,6 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testJsonFakeValueGeneratorInvalidFile) std::make_unique(request); getHub()->registerGenerator(0, std::move(generator)); - // wait for some time. - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - ASSERT_TRUE(getEvents().empty()); } @@ -404,12 +400,79 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testJsonFakeValueGeneratorNonExistingF std::make_unique(request); getHub()->registerGenerator(0, std::move(generator)); - // wait for some time. - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - ASSERT_TRUE(getEvents().empty()); } +TEST_F(FakeVehicleHalValueGeneratorsTest, testJsonFakeValueGeneratorDifferentTypes) { + std::unique_ptr generator = std::make_unique( + getTestFilePath("prop_different_types.json"), 1); + getHub()->registerGenerator(0, std::move(generator)); + + std::vector expectedValues = { + VehiclePropValue{ + .areaId = 0, + .value.int32Values = {1}, + .prop = 287310600, + }, + VehiclePropValue{ + .areaId = 0, + .value.int32Values = {2}, + .prop = 289408000, + }, + VehiclePropValue{ + .areaId = 0, + .value.floatValues = {3.3}, + .prop = 291504905, + }, + VehiclePropValue{ + .areaId = 0, + .value.int64Values = {4}, + .prop = 290457096, + }, + VehiclePropValue{ + .areaId = 0, + .value.stringValue = "test", + .prop = 286265094, + }, + VehiclePropValue{ + .areaId = 0, + .value.int32Values = {1, 2}, + .prop = 289476368, + }, + VehiclePropValue{ + .areaId = 0, + .value = + { + .int32Values = {1, 2}, + .int64Values = {3, 4}, + .floatValues = {5.5, 6.6}, + .stringValue = "test", + }, + .prop = 299896626, + }, + VehiclePropValue{ + .areaId = 0, + .value = + { + .int32Values = {1}, + .floatValues = {1.0}, + .byteValues = {0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00}, + }, + .prop = 299896064, + }, + }; + + waitForEvents(expectedValues.size()); + auto events = getEvents(); + + for (auto& event : events) { + event.timestamp = 0; + } + + EXPECT_EQ(events, expectedValues); +} + } // namespace fake } // namespace vehicle } // namespace automotive diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/prop_different_types.json b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/prop_different_types.json new file mode 100644 index 0000000000..0363ebd131 --- /dev/null +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/prop_different_types.json @@ -0,0 +1,58 @@ +[ + { + "timestamp": 1000000, + "areaId": 0, + "value": 1, + "prop": 287310600 + }, + { + "timestamp": 1000000, + "areaId": 0, + "value": 2, + "prop": 289408000 + }, + { + "timestamp": 1000000, + "areaId": 0, + "value": 3.3, + "prop": 291504905 + }, + { + "timestamp": 1000000, + "areaId": 0, + "value": 4, + "prop": 290457096 + }, + { + "timestamp": 1000000, + "areaId": 0, + "value": "test", + "prop": 286265094 + }, + { + "timestamp": 1000000, + "areaId": 0, + "value": [1, 2], + "prop": 289476368 + }, + { + "timestamp": 1000000, + "areaId": 0, + "value": { + "int32Values": [1, 2], + "int64Values": [3, 4], + "floatValues": [5.5, 6.6], + "stringValue": "test" + }, + "prop": 299896626 + }, + { + "timestamp": 1000000, + "areaId": 0, + "value": { + "int32Values": [1], + "floatValues": [1] + }, + "prop": 299896064 + } +] \ No newline at end of file diff --git a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp index 5b41ff4df0..250b33135b 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp +++ b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp @@ -19,7 +19,7 @@ package { } cc_test { - name: "VehicleHalVehicleUtilsVendorTest", + name: "VehicleHalVehicleUtilsTest", srcs: ["*.cpp"], vendor: true, static_libs: [ -- GitLab From d0e9111cad97f053bfeeef3690e2eaae34cf69e1 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 23 Feb 2022 19:14:40 +0000 Subject: [PATCH 663/825] Fix a flaky test in FakeVehicleHalValueGeneratorsTest. Fix a flaky test which might be caused by when the lock is waked up, we might have more events than what we want. Furthermore, we have to clear existing events after unregistering event generator. Test: atest FakeVehicleHalValueGeneratorTest 10 times on cf_auto Bug: 221084327 Change-Id: I65e87fa62b8538164fcdd60a9df871a9817f4f8e Merged-In: I65e87fa62b8538164fcdd60a9df871a9817f4f8e (cherry picked from commit 6ae468c1e39f72456416697ee7cf483dcf0c6f3b) --- .../include/JsonFakeValueGenerator.h | 2 +- .../src/JsonFakeValueGenerator.cpp | 2 +- .../FakeVehicleHalValueGeneratorsTest.cpp | 31 ++++++++++--------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h index 947eb4f748..d421ac525d 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/JsonFakeValueGenerator.h @@ -56,7 +56,7 @@ class JsonFakeValueGenerator : public FakeValueGenerator { private: size_t mEventIndex = 0; std::vector mEvents; - long mLastEventTimestamp = 0; + int64_t mLastEventTimestamp = 0; int32_t mNumOfIterations = 0; void setBit(std::vector& bytes, size_t idx); diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/JsonFakeValueGenerator.cpp b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/JsonFakeValueGenerator.cpp index ae92797a32..d4d52a5849 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/JsonFakeValueGenerator.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/JsonFakeValueGenerator.cpp @@ -213,7 +213,7 @@ std::optional JsonFakeValueGenerator::nextEvent() { if (mLastEventTimestamp == 0) { mLastEventTimestamp = elapsedRealtimeNano(); } else { - long nextEventTime = 0; + int64_t nextEventTime = 0; if (mEventIndex > 0) { // All events (start from 2nd one) are supposed to happen in the future with a delay // equals to the duration between previous and current event. diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/FakeVehicleHalValueGeneratorsTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/FakeVehicleHalValueGeneratorsTest.cpp index 674b07831b..cdfa8b2031 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/FakeVehicleHalValueGeneratorsTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/test/FakeVehicleHalValueGeneratorsTest.cpp @@ -66,7 +66,7 @@ class FakeVehicleHalValueGeneratorsTest : public ::testing::Test { std::unique_lock uniqueLock(mEventsLock); bool result = mCv.wait_for(uniqueLock, 10s, [this, count] { ScopedLockAssertion lockAssertion(mEventsLock); - return mEvents.size() == count; + return mEvents.size() >= count; }); ASSERT_TRUE(result) << "didn't receive enough events"; @@ -126,7 +126,8 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testRegisterTestFakeValueGenerator) { for (size_t i = 0; i < eventCount; i++) { events.push_back(VehiclePropValue{ .prop = static_cast(i), - .timestamp = timestamp + static_cast(50 * i), + // Generate 1 event every 1ms. + .timestamp = timestamp + static_cast(1000000 * i), }); } generator->setEvents(events); @@ -148,7 +149,8 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testUnregisterGeneratorStopGeneration) for (size_t i = 0; i < eventCount; i++) { events.push_back(VehiclePropValue{ .prop = static_cast(i), - .timestamp = timestamp + static_cast(50 * i), + // Generate 1 event every 1ms. + .timestamp = timestamp + static_cast(1000000 * i), }); } generator->setEvents(events); @@ -158,8 +160,12 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testUnregisterGeneratorStopGeneration) waitForEvents(1); getHub()->unregisterGenerator(0); + clearEvents(); - ASSERT_LE(getEvents().size(), 2u) + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + + // It is possible that one last event would be generated after unregistering. + ASSERT_LE(getEvents().size(), 1u) << "Must stop generating event after generator is unregistered"; } @@ -176,7 +182,6 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testLinerFakeValueGeneratorFloat) { waitForEvents(10); auto events = getEvents(); - ASSERT_EQ(events.size(), 10u); int value = 30; for (size_t i = 0; i < 10; i++) { EXPECT_EQ(std::vector({static_cast(value)}), events[i].value.floatValues); @@ -196,7 +201,7 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testLinerFakeValueGeneratorInt32) { waitForEvents(10); auto events = getEvents(); - ASSERT_EQ(events.size(), 10u); + int value = 30; for (size_t i = 0; i < 10; i++) { EXPECT_EQ(std::vector({value}), events[i].value.int32Values); @@ -216,8 +221,7 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testLinerFakeValueGeneratorInt64) { waitForEvents(10); auto events = getEvents(); - // We should get 10 events ideally, but let's be safe here. - ASSERT_EQ(events.size(), 10u); + int value = 30; for (size_t i = 0; i < 10; i++) { EXPECT_EQ(std::vector({value}), events[i].value.int64Values); @@ -237,7 +241,7 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testLinerFakeValueGeneratorUsingReques waitForEvents(10); auto events = getEvents(); - ASSERT_EQ(events.size(), 10u); + int value = 50; for (size_t i = 0; i < 10; i++) { EXPECT_EQ(std::vector({static_cast(value)}), events[i].value.floatValues); @@ -258,7 +262,6 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testLinerFakeValueGeneratorInvalidInit waitForEvents(10); auto events = getEvents(); - ASSERT_EQ(events.size(), 10u); // Init value would be set to middleValue if given initValue is not valid. int value = 50; @@ -269,7 +272,7 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testLinerFakeValueGeneratorInvalidInit } TEST_F(FakeVehicleHalValueGeneratorsTest, testJsonFakeValueGenerator) { - long currentTime = elapsedRealtimeNano(); + int64_t currentTime = elapsedRealtimeNano(); std::unique_ptr generator = std::make_unique(getTestFilePath("prop.json"), 2); @@ -306,7 +309,7 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testJsonFakeValueGenerator) { waitForEvents(expectedValues.size()); auto events = getEvents(); - long lastEventTime = currentTime; + int64_t lastEventTime = currentTime; for (auto& event : events) { EXPECT_GT(event.timestamp, lastEventTime); lastEventTime = event.timestamp; @@ -325,7 +328,7 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testJsonFakeValueGeneratorIterateIndef } TEST_F(FakeVehicleHalValueGeneratorsTest, testJsonFakeValueGeneratorUsingRequest) { - long currentTime = elapsedRealtimeNano(); + int64_t currentTime = elapsedRealtimeNano(); VehiclePropValue request = {.value = { .stringValue = getTestFilePath("prop.json"), @@ -367,7 +370,7 @@ TEST_F(FakeVehicleHalValueGeneratorsTest, testJsonFakeValueGeneratorUsingRequest waitForEvents(expectedValues.size()); auto events = getEvents(); - long lastEventTime = currentTime; + int64_t lastEventTime = currentTime; for (auto& event : events) { EXPECT_GT(event.timestamp, lastEventTime); lastEventTime = event.timestamp; -- GitLab From d3503a349f211ed1a09191cadfcb57e8b618b15f Mon Sep 17 00:00:00 2001 From: Avichal Rakesh Date: Fri, 25 Feb 2022 06:23:14 +0000 Subject: [PATCH 664/825] camera: Fix AIDL VTS test The default value of a Stream's `dynamicRangeProfile` field is invalid, which means the caller needs to set it to a sensible default with each call. This CL updates the Stream creation in VTS test to use `ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD` wherever a Stream object was being created with implicit default. Bug: 210912368 Test: Existing VTS tests now pass on Cuttlefish Change-Id: Iaae2f6dfde852fc9c076a6029854ccdf8f68d39a --- .../VtsAidlHalCameraProvider_TargetTest.cpp | 156 ++++++++++++------ camera/provider/aidl/vts/camera_aidl_test.cpp | 77 +++++---- camera/provider/aidl/vts/camera_aidl_test.h | 3 +- camera/provider/aidl/vts/device_cb.cpp | 2 +- 4 files changed, 150 insertions(+), 88 deletions(-) diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp index 3da89e2237..d1fa94e5e3 100644 --- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp +++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp @@ -36,6 +36,7 @@ using ::aidl::android::hardware::camera::common::CameraResourceCost; using ::aidl::android::hardware::camera::common::TorchModeStatus; using ::aidl::android::hardware::camera::common::VendorTagSection; using ::aidl::android::hardware::camera::device::ICameraDevice; +using ::aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap; using ::aidl::android::hardware::camera::metadata::SensorPixelMode; using ::aidl::android::hardware::camera::provider::CameraIdAndStreamCombination; using ::aidl::android::hardware::camera::provider::ICameraProviderCallbackDefault; @@ -488,7 +489,7 @@ TEST_P(CameraAidlTest, constructDefaultRequestSettings) { ret = mSession->constructDefaultRequestSettings(reqTemplate, &rawMetadata); ALOGI("constructDefaultRequestSettings returns status:%d:%d", ret.getExceptionCode(), ret.getServiceSpecificError()); - ASSERT_TRUE(ret.isOk()); + if (reqTemplate == RequestTemplate::ZERO_SHUTTER_LAG || reqTemplate == RequestTemplate::MANUAL) { // optional templates @@ -549,6 +550,8 @@ TEST_P(CameraAidlTest, configureStreamsAvailableOutputs) { stream.usage = static_cast( GRALLOC1_CONSUMER_USAGE_HWCOMPOSER); stream.rotation = StreamRotation::ROTATION_0; + stream.dynamicRangeProfile = RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD; std::vector streams = {stream}; StreamConfiguration config; @@ -626,6 +629,8 @@ TEST_P(CameraAidlTest, configureConcurrentStreamsAvailableOutputs) { stream.dataSpace = dataspace; stream.rotation = StreamRotation::ROTATION_0; stream.sensorPixelModesUsed = {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}; + stream.dynamicRangeProfile = RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD; streams[j] = stream; j++; } @@ -708,7 +713,9 @@ TEST_P(CameraAidlTest, configureStreamsInvalidOutputs) { std::string(), jpegBufferSize, -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; int32_t streamConfigCounter = 0; std::vector streams = {stream}; StreamConfiguration config; @@ -737,7 +744,9 @@ TEST_P(CameraAidlTest, configureStreamsInvalidOutputs) { std::string(), jpegBufferSize, -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; streams[0] = stream; createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, @@ -761,7 +770,9 @@ TEST_P(CameraAidlTest, configureStreamsInvalidOutputs) { std::string(), jpegBufferSize, -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; streams[0] = stream; createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, @@ -784,7 +795,9 @@ TEST_P(CameraAidlTest, configureStreamsInvalidOutputs) { std::string(), jpegBufferSize, -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; streams[0] = stream; createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, @@ -888,7 +901,9 @@ TEST_P(CameraAidlTest, configureStreamsZSLInputOutputs) { std::string(), jpegBufferSize, -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; Stream inputStream = { streamId++, StreamType::INPUT, @@ -901,7 +916,9 @@ TEST_P(CameraAidlTest, configureStreamsZSLInputOutputs) { std::string(), jpegBufferSize, -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; Stream outputStream = { streamId++, StreamType::OUTPUT, @@ -915,7 +932,9 @@ TEST_P(CameraAidlTest, configureStreamsZSLInputOutputs) { std::string(), jpegBufferSize, -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; std::vector streams = {inputStream, zslStream, outputStream}; @@ -996,19 +1015,22 @@ TEST_P(CameraAidlTest, configureStreamsWithSessionParameters) { &previewThreshold)); ASSERT_NE(0u, outputPreviewStreams.size()); - Stream previewStream = {0, - StreamType::OUTPUT, - outputPreviewStreams[0].width, - outputPreviewStreams[0].height, - static_cast(outputPreviewStreams[0].format), - static_cast( - GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), - Dataspace::UNKNOWN, - StreamRotation::ROTATION_0, - std::string(), - /*bufferSize*/ 0, - /*groupId*/ -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + Stream previewStream = { + 0, + StreamType::OUTPUT, + outputPreviewStreams[0].width, + outputPreviewStreams[0].height, + static_cast(outputPreviewStreams[0].format), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + /*bufferSize*/ 0, + /*groupId*/ -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; std::vector streams = {previewStream}; StreamConfiguration config; @@ -1114,7 +1136,9 @@ TEST_P(CameraAidlTest, configureStreamsPreviewStillOutputs) { std::string(), /*bufferSize*/ 0, /*groupId*/ -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; Stream blobStream = { streamId++, StreamType::OUTPUT, @@ -1128,7 +1152,9 @@ TEST_P(CameraAidlTest, configureStreamsPreviewStillOutputs) { std::string(), /*bufferSize*/ 0, /*groupId*/ -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; std::vector streams = {previewStream, blobStream}; StreamConfiguration config; @@ -1192,7 +1218,9 @@ TEST_P(CameraAidlTest, configureStreamsConstrainedOutputs) { std::string(), /*bufferSize*/ 0, /*groupId*/ -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; std::vector streams = {stream}; StreamConfiguration config; createStreamConfiguration(streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE, @@ -1220,7 +1248,9 @@ TEST_P(CameraAidlTest, configureStreamsConstrainedOutputs) { std::string(), /*bufferSize*/ 0, /*groupId*/ -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; streams[0] = stream; createStreamConfiguration(streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE, &config); @@ -1244,7 +1274,9 @@ TEST_P(CameraAidlTest, configureStreamsConstrainedOutputs) { std::string(), /*bufferSize*/ 0, /*groupId*/ -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; streams[0] = stream; createStreamConfiguration(streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE, &config); @@ -1266,7 +1298,9 @@ TEST_P(CameraAidlTest, configureStreamsConstrainedOutputs) { std::string(), /*bufferSize*/ 0, /*groupId*/ -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; streams[0] = stream; createStreamConfiguration(streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE, &config); @@ -1341,7 +1375,9 @@ TEST_P(CameraAidlTest, configureStreamsVideoStillOutputs) { std::string(), jpegBufferSize, /*groupId*/ -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; Stream blobStream = { streamId++, StreamType::OUTPUT, @@ -1355,7 +1391,9 @@ TEST_P(CameraAidlTest, configureStreamsVideoStillOutputs) { std::string(), jpegBufferSize, /*groupId*/ -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; std::vector streams = {videoStream, blobStream}; StreamConfiguration config; @@ -1817,9 +1855,7 @@ TEST_P(CameraAidlTest, process10BitDynamicRangeRequest) { ASSERT_TRUE(ret.isOk()); continue; } - std::vector< - aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap> - profileList; + std::vector profileList; get10BitDynamicRangeProfiles(staticMeta, &profileList); ASSERT_FALSE(profileList.empty()); @@ -2652,7 +2688,9 @@ TEST_P(CameraAidlTest, configureInjectionStreamsAvailableOutputs) { std::string(), jpegBufferSize, 0, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; std::vector streams = {stream}; StreamConfiguration config; @@ -2720,7 +2758,9 @@ TEST_P(CameraAidlTest, configureInjectionStreamsInvalidOutputs) { std::string(), jpegBufferSize, 0, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; int32_t streamConfigCounter = 0; std::vector streams = {stream}; @@ -2746,7 +2786,10 @@ TEST_P(CameraAidlTest, configureInjectionStreamsInvalidOutputs) { std::string(), jpegBufferSize, 0, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; + streams[0] = stream; createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, jpegBufferSize); @@ -2767,7 +2810,9 @@ TEST_P(CameraAidlTest, configureInjectionStreamsInvalidOutputs) { std::string(), jpegBufferSize, 0, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; streams[0] = stream; createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, jpegBufferSize); @@ -2787,7 +2832,9 @@ TEST_P(CameraAidlTest, configureInjectionStreamsInvalidOutputs) { std::string(), jpegBufferSize, 0, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; streams[0] = stream; createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config, jpegBufferSize); @@ -2869,7 +2916,9 @@ TEST_P(CameraAidlTest, configureInjectionStreamsWithSessionParameters) { std::string(), 0, -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; std::vector streams = {previewStream}; StreamConfiguration config; config.streams = streams; @@ -2940,22 +2989,21 @@ TEST_P(CameraAidlTest, configureStreamsUseCases) { } std::vector streams(1); - streams[0] = { - 0, - StreamType::OUTPUT, - outputPreviewStreams[0].width, - outputPreviewStreams[0].height, - static_cast(outputPreviewStreams[0].format), - static_cast<::aidl::android::hardware::graphics::common::BufferUsage>( - GRALLOC1_CONSUMER_USAGE_CPU_READ), - Dataspace::UNKNOWN, - StreamRotation::ROTATION_0, - std::string(), - 0, - -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, - aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap:: - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; + streams[0] = {0, + StreamType::OUTPUT, + outputPreviewStreams[0].width, + outputPreviewStreams[0].height, + static_cast(outputPreviewStreams[0].format), + static_cast<::aidl::android::hardware::graphics::common::BufferUsage>( + GRALLOC1_CONSUMER_USAGE_CPU_READ), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + std::string(), + 0, + -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; int32_t streamConfigCounter = 0; CameraMetadata req; diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp index 48bca244d9..858dfd5fdc 100644 --- a/camera/provider/aidl/vts/camera_aidl_test.cpp +++ b/camera/provider/aidl/vts/camera_aidl_test.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,7 @@ using ::aidl::android::hardware::camera::common::TorchModeStatus; using ::aidl::android::hardware::camera::device::CameraMetadata; using ::aidl::android::hardware::camera::device::ICameraDevice; using ::aidl::android::hardware::camera::metadata::CameraMetadataTag; +using ::aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap; using ::aidl::android::hardware::camera::metadata::SensorInfoColorFilterArrangement; using ::aidl::android::hardware::camera::metadata::SensorPixelMode; using ::aidl::android::hardware::camera::provider::BnCameraProviderCallback; @@ -356,6 +358,7 @@ Status CameraAidlTest::isMonochromeCamera(const camera_metadata_t* staticMeta) { camera_metadata_ro_entry entry; int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, &entry); + if (0 != rc) { return Status::ILLEGAL_ARGUMENT; } @@ -2141,6 +2144,10 @@ void CameraAidlTest::configureSingleStream( reinterpret_cast(chars.metadata.data())); ASSERT_NE(nullptr, staticMeta); + size_t expectedSize = chars.metadata.size(); + ALOGE("validate_camera_metadata_structure: %d", + validate_camera_metadata_structure(staticMeta, &expectedSize)); + camera_metadata_ro_entry entry; auto status = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_PARTIAL_RESULT_COUNT, &entry); @@ -2172,7 +2179,6 @@ void CameraAidlTest::configureSingleStream( ASSERT_EQ(Status::OK, getJpegBufferSize(staticMeta, &jpegBufferSize)); ASSERT_NE(0u, jpegBufferSize); - free_camera_metadata(staticMeta); ASSERT_EQ(Status::OK, rc); ASSERT_FALSE(outputPreviewStreams.empty()); @@ -2197,7 +2203,9 @@ void CameraAidlTest::configureSingleStream( "", 0, /*groupId*/ -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; StreamConfiguration config; config.streams = streams; @@ -2519,26 +2527,29 @@ void CameraAidlTest::configurePreviewStreams( outputPreviewStreams.clear(); Status rc = getAvailableOutputStreams(staticMeta, outputPreviewStreams, previewThreshold); - free_camera_metadata(staticMeta); + ASSERT_EQ(Status::OK, rc); ASSERT_FALSE(outputPreviewStreams.empty()); std::vector streams(physicalIds.size()); int32_t streamId = 0; for (auto const& physicalId : physicalIds) { - streams[streamId++] = {streamId, - StreamType::OUTPUT, - outputPreviewStreams[0].width, - outputPreviewStreams[0].height, - static_cast(outputPreviewStreams[0].format), - static_cast( - GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), - Dataspace::UNKNOWN, - StreamRotation::ROTATION_0, - physicalId, - 0, - 0, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + streams[streamId] = {streamId, + StreamType::OUTPUT, + outputPreviewStreams[0].width, + outputPreviewStreams[0].height, + static_cast(outputPreviewStreams[0].format), + static_cast( + GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), + Dataspace::UNKNOWN, + StreamRotation::ROTATION_0, + physicalId, + 0, + -1, + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; + streamId++; } StreamConfiguration config = {streams, StreamConfigurationMode::NORMAL_MODE, CameraMetadata()}; @@ -2580,13 +2591,15 @@ void CameraAidlTest::verifyBuffersReturned(const std::shared_ptrwaitForBuffersReturned(); } -void CameraAidlTest::configureStreams( - const std::string& name, const std::shared_ptr& provider, - PixelFormat format, std::shared_ptr* session, Stream* previewStream, - std::vector* halStreams, bool* supportsPartialResults, - int32_t* partialResultCount, bool* useHalBufManager, std::shared_ptr* outCb, - uint32_t streamConfigCounter, bool maxResolution, - aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap prof) { +void CameraAidlTest::configureStreams(const std::string& name, + const std::shared_ptr& provider, + PixelFormat format, + std::shared_ptr* session, + Stream* previewStream, std::vector* halStreams, + bool* supportsPartialResults, int32_t* partialResultCount, + bool* useHalBufManager, std::shared_ptr* outCb, + uint32_t streamConfigCounter, bool maxResolution, + RequestAvailableDynamicRangeProfilesMap prof) { ASSERT_NE(nullptr, session); ASSERT_NE(nullptr, halStreams); ASSERT_NE(nullptr, previewStream); @@ -2612,6 +2625,7 @@ void CameraAidlTest::configureStreams( ASSERT_TRUE(ret.isOk()); staticMeta = clone_camera_metadata( reinterpret_cast(metadata.metadata.data())); + ASSERT_NE(staticMeta, nullptr); camera_metadata_ro_entry entry; auto status = @@ -2640,7 +2654,6 @@ void CameraAidlTest::configureStreams( Size maxSize; auto rc = getMaxOutputSizeForFormat(staticMeta, format, &maxSize, maxResolution); ASSERT_EQ(Status::OK, rc); - free_camera_metadata(staticMeta); std::vector streams(1); streams[0] = {0, @@ -2655,7 +2668,8 @@ void CameraAidlTest::configureStreams( "", 0, -1, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION}, + {maxResolution ? SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION + : SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, prof}; StreamConfiguration config; @@ -2706,9 +2720,7 @@ bool CameraAidlTest::is10BitDynamicRangeCapable(const camera_metadata_t* staticM void CameraAidlTest::get10BitDynamicRangeProfiles( const camera_metadata_t* staticMeta, - std::vector< - aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap>* - profiles) { + std::vector* profiles) { ASSERT_NE(nullptr, staticMeta); ASSERT_NE(nullptr, profiles); camera_metadata_ro_entry entry; @@ -2724,8 +2736,7 @@ void CameraAidlTest::get10BitDynamicRangeProfiles( ASSERT_EQ(entries.find(entry.data.i64[i]), entries.end()); entries.insert(static_cast(entry.data.i64[i])); profiles->emplace_back( - static_cast(entry.data.i64[i])); + static_cast(entry.data.i64[i])); } if (!entries.empty()) { @@ -2883,7 +2894,7 @@ void CameraAidlTest::configureOfflineStillStream( currLargest = area; } } - free_camera_metadata(staticMeta); + ASSERT_EQ(Status::OK, rc); ASSERT_FALSE(outputStreams.empty()); @@ -2902,7 +2913,9 @@ void CameraAidlTest::configureOfflineStillStream( /*physicalId*/ std::string(), *jpegBufferSize, /*groupId*/ 0, - {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}}; + {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}, + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD}; StreamConfiguration config = {streams, StreamConfigurationMode::NORMAL_MODE, CameraMetadata()}; diff --git a/camera/provider/aidl/vts/camera_aidl_test.h b/camera/provider/aidl/vts/camera_aidl_test.h index 8e284a27b6..1ca457b331 100644 --- a/camera/provider/aidl/vts/camera_aidl_test.h +++ b/camera/provider/aidl/vts/camera_aidl_test.h @@ -180,7 +180,8 @@ class CameraAidlTest : public ::testing::TestWithParam { uint32_t streamConfigCounter, bool maxResolution, aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap prof = ::aidl::android::hardware::camera::metadata:: - RequestAvailableDynamicRangeProfilesMap(0)); + RequestAvailableDynamicRangeProfilesMap:: + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD); void configurePreviewStreams( const std::string& name, const std::shared_ptr& provider, diff --git a/camera/provider/aidl/vts/device_cb.cpp b/camera/provider/aidl/vts/device_cb.cpp index 52b4079465..e5f2f1eae4 100644 --- a/camera/provider/aidl/vts/device_cb.cpp +++ b/camera/provider/aidl/vts/device_cb.cpp @@ -380,7 +380,7 @@ bool DeviceCb::processCaptureResultLocked( request->collectedResult.sort(); // Verify final result metadata - auto staticMetadataBuffer = mStaticMetadata; + camera_metadata_t* staticMetadataBuffer = mStaticMetadata; bool isMonochrome = Status::OK == CameraAidlTest::isMonochromeCamera(staticMetadataBuffer); if (isMonochrome) { CameraAidlTest::verifyMonochromeCameraResult(request->collectedResult); -- GitLab From 68b9acc4fea1173cc75276a57552c3d64c733cd3 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Fri, 25 Feb 2022 13:11:38 -0500 Subject: [PATCH 665/825] DisplayDecoration VTS: remove expected changed composition types If validateDisplay returns an error, changed composition types are not propagated back to the caller. Remove the expectation that they will be. Fixes: 221406264 Test: this Change-Id: I3e07e40b0c12a2cf6eaa685435647aab93172bb0 --- .../composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 68ec7e813d..bfb6b85d12 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1656,11 +1656,6 @@ TEST_P(GraphicsComposerAidlCommandTest, DisplayDecoration) { const auto errors = mReader.takeErrors(); ASSERT_EQ(1, errors.size()); EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, errors[0].errorCode); - - const auto changedTypes = mReader.takeChangedCompositionTypes(display.getDisplayId()); - ASSERT_EQ(1u, changedTypes.size()); - const auto changedType = changedTypes[0].composition; - EXPECT_TRUE(changedType == Composition::DEVICE || changedType == Composition::CLIENT); } } } -- GitLab From eac80de7c3c2f5f821072c46a02e4007c5ee5edc Mon Sep 17 00:00:00 2001 From: Nate Jiang Date: Thu, 24 Feb 2022 16:09:05 -0800 Subject: [PATCH 666/825] [VTS] fix getCapabilitiesRequest_1_5 issue Bug: 218970943 Test: vts VtsHalWifiNanV1_5TargetTest Change-Id: I4188134b9a02930661ca8c1ea7f6c5a153b87b33 --- wifi/1.5/vts/functional/Android.bp | 1 + wifi/1.5/vts/functional/wifi_nan_iface_hidl_test.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/wifi/1.5/vts/functional/Android.bp b/wifi/1.5/vts/functional/Android.bp index 764d14da0a..d906d069bc 100644 --- a/wifi/1.5/vts/functional/Android.bp +++ b/wifi/1.5/vts/functional/Android.bp @@ -83,6 +83,7 @@ cc_test { "android.hardware.wifi@1.3", "android.hardware.wifi@1.4", "android.hardware.wifi@1.5", + "android.hardware.wifi@1.6", "libwifi-system-iface", ], test_suites: [ diff --git a/wifi/1.5/vts/functional/wifi_nan_iface_hidl_test.cpp b/wifi/1.5/vts/functional/wifi_nan_iface_hidl_test.cpp index 803d39df15..8474d7807c 100644 --- a/wifi/1.5/vts/functional/wifi_nan_iface_hidl_test.cpp +++ b/wifi/1.5/vts/functional/wifi_nan_iface_hidl_test.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,6 @@ using namespace ::android::hardware::wifi::V1_0; using namespace ::android::hardware::wifi::V1_2; using namespace ::android::hardware::wifi::V1_4; using namespace ::android::hardware::wifi::V1_5; - using ::android::sp; using ::android::hardware::Return; using ::android::hardware::Void; @@ -586,6 +586,11 @@ TEST_P(WifiNanIfaceHidlTest, configRequest_1_5ShimInvalidArgs) { * getCapabilitiesRequest: validate that returns capabilities. */ TEST_P(WifiNanIfaceHidlTest, getCapabilitiesRequest_1_5) { + sp<::android::hardware::wifi::V1_6::IWifiNanIface> iface_converted = + ::android::hardware::wifi::V1_6::IWifiNanIface::castFrom(iwifiNanIface); + if (iface_converted != nullptr) { + return; + } uint16_t inputCmdId = 10; callbackType = INVALID; const auto& halStatus = -- GitLab From d7bad8cf803b97b3a345aac910a5595a3099133a Mon Sep 17 00:00:00 2001 From: Nate Jiang Date: Thu, 24 Feb 2022 17:22:52 -0800 Subject: [PATCH 667/825] [VTS] Add test for new HAL API Bug: 220222961 Test: vts VtsHalWifiNanV1_6TargetTest Change-Id: Ibcc4cc00c21e553a68bb69946497acad79b273f3 --- .../functional/wifi_nan_iface_hidl_test.cpp | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/wifi/1.6/vts/functional/wifi_nan_iface_hidl_test.cpp b/wifi/1.6/vts/functional/wifi_nan_iface_hidl_test.cpp index bf9e2307fd..46a1314541 100644 --- a/wifi/1.6/vts/functional/wifi_nan_iface_hidl_test.cpp +++ b/wifi/1.6/vts/functional/wifi_nan_iface_hidl_test.cpp @@ -604,6 +604,92 @@ TEST_P(WifiNanIfaceHidlTest, configRequest_1_6ShimInvalidArgs) { } } +/* + * notifyCapabilitiesResponse_1_6: validate that returns capabilities. + */ +TEST_P(WifiNanIfaceHidlTest, notifyCapabilitiesResponse_1_6) { + uint16_t inputCmdId = 10; + callbackType = INVALID; + const auto& halStatus = HIDL_INVOKE(iwifiNanIface, getCapabilitiesRequest_1_5, inputCmdId).code; + ASSERT_EQ(WifiStatusCode::SUCCESS, halStatus); + // wait for a callback + ASSERT_EQ(std::cv_status::no_timeout, wait(NOTIFY_CAPABILITIES_RESPONSE_1_6)); + ASSERT_EQ(NOTIFY_CAPABILITIES_RESPONSE_1_6, callbackType); + ASSERT_EQ(id, inputCmdId); + + // check for reasonable capability values + EXPECT_GT(capabilities_1_6.maxConcurrentClusters, (unsigned int)0); + EXPECT_GT(capabilities_1_6.maxPublishes, (unsigned int)0); + EXPECT_GT(capabilities_1_6.maxSubscribes, (unsigned int)0); + EXPECT_EQ(capabilities_1_6.maxServiceNameLen, (unsigned int)255); + EXPECT_EQ(capabilities_1_6.maxMatchFilterLen, (unsigned int)255); + EXPECT_GT(capabilities_1_6.maxTotalMatchFilterLen, (unsigned int)255); + EXPECT_EQ(capabilities_1_6.maxServiceSpecificInfoLen, (unsigned int)255); + EXPECT_GE(capabilities_1_6.maxExtendedServiceSpecificInfoLen, (unsigned int)255); + EXPECT_GT(capabilities_1_6.maxNdiInterfaces, (unsigned int)0); + EXPECT_GT(capabilities_1_6.maxNdpSessions, (unsigned int)0); + EXPECT_GT(capabilities_1_6.maxAppInfoLen, (unsigned int)0); + EXPECT_GT(capabilities_1_6.maxQueuedTransmitFollowupMsgs, (unsigned int)0); + EXPECT_GT(capabilities_1_6.maxSubscribeInterfaceAddresses, (unsigned int)0); + EXPECT_NE(capabilities_1_6.supportedCipherSuites, (unsigned int)0); + EXPECT_TRUE(capabilities_1_6.instantCommunicationModeSupportFlag || + !capabilities_1_6.instantCommunicationModeSupportFlag); +} + +/* + * startPublishRequest_1_6InvalidArgs: validate that fails with invalid arguments + */ +TEST_P(WifiNanIfaceHidlTest, startPublishRequest_1_6InvalidArgs) { + uint16_t inputCmdId = 10; + callbackType = INVALID; + ::android::hardware::wifi::V1_6::NanPublishRequest nanPublishRequest = {}; + const auto& halStatus = + HIDL_INVOKE(iwifiNanIface, startPublishRequest_1_6, inputCmdId, nanPublishRequest); + + if (halStatus.code != WifiStatusCode::ERROR_NOT_SUPPORTED) { + ASSERT_EQ(WifiStatusCode::SUCCESS, halStatus.code); + + // wait for a callback + ASSERT_EQ(std::cv_status::no_timeout, wait(NOTIFY_START_PUBLISH_RESPONSE)); + ASSERT_EQ(NOTIFY_START_PUBLISH_RESPONSE, callbackType); + ASSERT_EQ(id, inputCmdId); + ASSERT_EQ(status.status, NanStatusType::INTERNAL_FAILURE); + } +} + +/* + * respondToDataPathIndicationRequest_1_6InvalidArgs: validate that fails with invalid arguments + */ +TEST_P(WifiNanIfaceHidlTest, respondToDataPathIndicationRequest_1_6ShimInvalidArgs) { + uint16_t inputCmdId = 10; + callbackType = INVALID; + ::android::hardware::wifi::V1_6::NanRespondToDataPathIndicationRequest + nanRespondToDataPathIndicationRequest = {}; + nanRespondToDataPathIndicationRequest.ifaceName = "AwareinterfaceNameTooLong"; + const auto& halStatus = HIDL_INVOKE(iwifiNanIface, respondToDataPathIndicationRequest_1_6, + inputCmdId, nanRespondToDataPathIndicationRequest); + + if (halStatus.code != WifiStatusCode::ERROR_NOT_SUPPORTED) { + ASSERT_EQ(WifiStatusCode::ERROR_INVALID_ARGS, halStatus.code); + } +} + +/* + * initiateDataPathRequest_1_6InvalidArgs: validate that fails with invalid arguments + */ +TEST_P(WifiNanIfaceHidlTest, initiateDataPathRequest_1_6ShimInvalidArgs) { + uint16_t inputCmdId = 10; + callbackType = INVALID; + ::android::hardware::wifi::V1_6::NanInitiateDataPathRequest nanInitiateDataPathRequest = {}; + nanInitiateDataPathRequest.ifaceName = "AwareinterfaceNameTooLong"; + const auto& halStatus = HIDL_INVOKE(iwifiNanIface, initiateDataPathRequest_1_6, inputCmdId, + nanInitiateDataPathRequest); + + if (halStatus.code != WifiStatusCode::ERROR_NOT_SUPPORTED) { + ASSERT_EQ(WifiStatusCode::ERROR_INVALID_ARGS, halStatus.code); + } +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiNanIfaceHidlTest); INSTANTIATE_TEST_SUITE_P(PerInstance, WifiNanIfaceHidlTest, testing::ValuesIn(android::hardware::getAllHalInstanceNames( -- GitLab From 44c952f69c76b35cc4ff9d51e6405d6a2415e29b Mon Sep 17 00:00:00 2001 From: ramindani Date: Mon, 28 Feb 2022 23:29:29 +0000 Subject: [PATCH 668/825] Vts readback status check fixes When we query for the getReadbackBufferAttributes we can get EX_UNSUPPORTED error when not supported and when this happens readback should not be supported. EXPECT_TRUE for this failure case was causing the test to fail when we received an EX_UNSUPPORTED for this. See for documentation: https://source.corp.google.com/android/hardware/interfaces/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl;rcl=e1f0950945f687ed374a45911e2d7786de724ca4;l=436 BUG: 221889462 Test: atest VtsHalGraphicsComposer3_TargetTest Test link for the cf_x86_64_phone-userdebug http://ab/I39800010022763398 All the other test failures are tracked else where. Change-Id: Idf352761c5cc808540edfe2042c5ee4602b5e96b --- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 87 ++++++++++--------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp index f75af85300..4fadc17db6 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -214,15 +214,16 @@ class GraphicsCompositionTestBase : public ::testing::Test { mWriter.reset(); } - std::pair getHasReadbackBuffer() { + bool getHasReadbackBuffer() { auto [status, readBackBufferAttributes] = mComposerClient->getReadbackBufferAttributes(getPrimaryDisplayId()); if (status.isOk()) { mPixelFormat = readBackBufferAttributes.format; mDataspace = readBackBufferAttributes.dataspace; - return {std::move(status), ReadbackHelper::readbackSupported(mPixelFormat, mDataspace)}; + return ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); } - return {std::move(status), false}; + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); + return false; } std::shared_ptr mComposerClient; @@ -264,8 +265,8 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -316,8 +317,8 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -376,8 +377,8 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -425,8 +426,8 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { } TEST_P(GraphicsCompositionTest, SetReadbackBuffer) { - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -439,8 +440,8 @@ TEST_P(GraphicsCompositionTest, SetReadbackBuffer) { } TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadDisplay) { - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -461,8 +462,8 @@ TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadDisplay) { } TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadParameter) { - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -478,8 +479,8 @@ TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadParameter) { } TEST_P(GraphicsCompositionTest, GetReadbackBufferFenceInactive) { - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -503,8 +504,8 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -594,8 +595,8 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -693,8 +694,8 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -768,8 +769,8 @@ TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -819,8 +820,8 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -878,8 +879,8 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -982,8 +983,8 @@ TEST_P(GraphicsCompositionTest, SetLayerBrightnessDims) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace for " "color mode: " @@ -1135,8 +1136,8 @@ TEST_P(GraphicsBlendModeCompositionTest, DISABLED_None) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -1179,8 +1180,8 @@ TEST_P(GraphicsBlendModeCompositionTest, Coverage) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -1220,8 +1221,8 @@ TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -1303,8 +1304,8 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { return; } - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -1348,8 +1349,8 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; @@ -1393,8 +1394,8 @@ TEST_P(GraphicsTransformCompositionTest, ROT_180) { ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) .isOk()); - const auto& [readbackStatus, isSupported] = getHasReadbackBuffer(); - EXPECT_TRUE(readbackStatus.isOk()); + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); if (!isSupported) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; -- GitLab From 5cfd323e135c76f7aa1eb6906127ba8acb414b57 Mon Sep 17 00:00:00 2001 From: Sunil Ravi Date: Tue, 1 Mar 2022 10:18:10 -0800 Subject: [PATCH 669/825] wifi: VTS test for getSupportedRadioCombinationsMatrix This change added, 1. VTS test for getSupportedRadioCombinationsMatrix() 2. Skip test for getUsableChannels_1_6 if vendor doesn't support Bug: 220201314 Bug: 221389141 Bug: 220225758 Test: atest WifiChipHidlTest Change-Id: I5ddbd4be68d74f1fa26584c94d5b10211261cc1a --- .../vts/functional/wifi_chip_hidl_test.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/wifi/1.6/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.6/vts/functional/wifi_chip_hidl_test.cpp index d1d4336222..7c5b7e623b 100644 --- a/wifi/1.6/vts/functional/wifi_chip_hidl_test.cpp +++ b/wifi/1.6/vts/functional/wifi_chip_hidl_test.cpp @@ -91,6 +91,9 @@ TEST_P(WifiChipHidlTest, getUsableChannels_1_6) { WifiBand band = WifiBand::BAND_24GHZ_5GHZ_6GHZ; const auto& statusNonEmpty = HIDL_INVOKE(wifi_chip_, getUsableChannels_1_6, band, ifaceModeMask, filterMask); + if (statusNonEmpty.first.code == WifiStatusCode::ERROR_NOT_SUPPORTED) { + GTEST_SKIP() << "Skipping this test since getUsableChannels() is not supported by vendor."; + } EXPECT_EQ(WifiStatusCode::SUCCESS, statusNonEmpty.first.code); } @@ -104,6 +107,22 @@ TEST_P(WifiChipHidlTest, getAvailableModes_1_6) { EXPECT_LT(0u, status_and_modes.second.size()); } +/* + * getSupportedRadioCombinationsMatrix: + * Ensure that a call to getSupportedRadioCombinationsMatrix will return + * with a success status code. + */ +TEST_P(WifiChipHidlTest, getSupportedRadioCombinationsMatrix) { + configureChipForIfaceType(IfaceType::STA, true); + const auto& statusNonEmpty = HIDL_INVOKE(wifi_chip_, getSupportedRadioCombinationsMatrix); + if (statusNonEmpty.first.code == WifiStatusCode::ERROR_NOT_SUPPORTED) { + GTEST_SKIP() << "Skipping this test since getSupportedRadioCombinationsMatrix() is not " + "supported by vendor."; + } + + EXPECT_EQ(WifiStatusCode::SUCCESS, statusNonEmpty.first.code); +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiChipHidlTest); INSTANTIATE_TEST_SUITE_P(PerInstance, WifiChipHidlTest, testing::ValuesIn(android::hardware::getAllHalInstanceNames( -- GitLab From b6784321b5689f3b9de5ff003586f06be126b530 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Tue, 1 Mar 2022 12:24:55 -0800 Subject: [PATCH 670/825] health: batterymonitor uses AIDL HealthInfo. As a side effect, chargerDockOnline is properly set. Test: TH Bug: 222120465 Change-Id: I660e8ac0d1897ce30e3ae5d4f402a0b9ccac3c5c Merged-In: I660e8ac0d1897ce30e3ae5d4f402a0b9ccac3c5c --- health/aidl/default/Health.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/health/aidl/default/Health.cpp b/health/aidl/default/Health.cpp index e1d198221c..d41d01a450 100644 --- a/health/aidl/default/Health.cpp +++ b/health/aidl/default/Health.cpp @@ -130,12 +130,7 @@ ndk::ScopedAStatus Health::getStorageInfo(std::vector*) { ndk::ScopedAStatus Health::getHealthInfo(HealthInfo* out) { battery_monitor_.updateValues(); - // TODO(b/177269435): BatteryMonitor should store AIDL HealthInfo instead. - auto health_info_2_1 = battery_monitor_.getHealthInfo_2_1(); - if (!::android::h2a::translate(health_info_2_1, out)) { - return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( - IHealth::STATUS_UNKNOWN, "Cannot translate HIDL HealthInfo to AIDL"); - } + *out = battery_monitor_.getHealthInfo(); // Fill in storage infos; these aren't retrieved by BatteryMonitor. if (auto res = getStorageInfo(&out->storageInfos); !res.isOk()) { -- GitLab From a4e7636e6230283eb9cd385fe3723fb39e33961b Mon Sep 17 00:00:00 2001 From: ramindani Date: Wed, 2 Mar 2022 01:48:06 +0000 Subject: [PATCH 671/825] Vts BlendMode tests skip for UNSUPPORTED ColorMode BUG: 221887749 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I6c0a35c64883333c70451c717f50cb84d85ce994 --- .../aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp index 4fadc17db6..147a9eec82 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -1051,7 +1051,10 @@ class GraphicsBlendModeCompositionTest SetUpBase(std::get<0>(GetParam())); // TODO(b/219590743) we should remove the below SRGB color mode // once we have the BlendMode test fix for all the versions of the ColorMode - mTestColorModes = {ColorMode::SRGB}; + mTestColorModes.erase( + std::remove_if(mTestColorModes.begin(), mTestColorModes.end(), + [](ColorMode mode) { return mode != ColorMode::SRGB; }), + mTestColorModes.end()); mBackgroundColor = BLACK; mTopLayerColor = RED; } -- GitLab From d9d513fd47c2a7e25df148d3925f02ca669520b5 Mon Sep 17 00:00:00 2001 From: William Escande Date: Wed, 2 Mar 2022 20:27:06 +0100 Subject: [PATCH 672/825] Clear apex.go entries for bluetooth libs Test: Build + TH + boot phone & use bluetooth Bug: 216433795 Change-Id: Ib1f9fee90006c73e5726a208e6cba8647967f5f4 --- audio/common/5.0/Android.bp | 4 ++++ bluetooth/1.0/Android.bp | 4 ++++ bluetooth/1.1/Android.bp | 4 ++++ bluetooth/a2dp/1.0/Android.bp | 4 ++++ bluetooth/audio/2.0/Android.bp | 4 ++++ graphics/bufferqueue/1.0/Android.bp | 1 + graphics/bufferqueue/2.0/Android.bp | 1 + graphics/common/1.0/Android.bp | 1 + graphics/common/1.1/Android.bp | 1 + graphics/common/1.2/Android.bp | 1 + 10 files changed, 25 insertions(+) diff --git a/audio/common/5.0/Android.bp b/audio/common/5.0/Android.bp index c4f3d4c8c6..fd8e85ff45 100644 --- a/audio/common/5.0/Android.bp +++ b/audio/common/5.0/Android.bp @@ -20,4 +20,8 @@ hidl_interface { ], gen_java: true, gen_java_constants: true, + apex_available: [ + "//apex_available:platform", + "com.android.bluetooth", + ], } diff --git a/bluetooth/1.0/Android.bp b/bluetooth/1.0/Android.bp index 8d023c01d7..20775dd282 100644 --- a/bluetooth/1.0/Android.bp +++ b/bluetooth/1.0/Android.bp @@ -21,4 +21,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.bluetooth", + ], } diff --git a/bluetooth/1.1/Android.bp b/bluetooth/1.1/Android.bp index 4feb28bd96..4ac20094bd 100644 --- a/bluetooth/1.1/Android.bp +++ b/bluetooth/1.1/Android.bp @@ -21,4 +21,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.bluetooth", + ], } diff --git a/bluetooth/a2dp/1.0/Android.bp b/bluetooth/a2dp/1.0/Android.bp index 7f39d4f55c..20776dccb8 100644 --- a/bluetooth/a2dp/1.0/Android.bp +++ b/bluetooth/a2dp/1.0/Android.bp @@ -21,4 +21,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: false, + apex_available: [ + "//apex_available:platform", + "com.android.bluetooth", + ], } diff --git a/bluetooth/audio/2.0/Android.bp b/bluetooth/audio/2.0/Android.bp index dd39f9f9d3..e4d48c1b3f 100644 --- a/bluetooth/audio/2.0/Android.bp +++ b/bluetooth/audio/2.0/Android.bp @@ -24,4 +24,8 @@ hidl_interface { "android.hidl.safe_union@1.0", ], gen_java: false, + apex_available: [ + "//apex_available:platform", + "com.android.bluetooth", + ], } diff --git a/graphics/bufferqueue/1.0/Android.bp b/graphics/bufferqueue/1.0/Android.bp index c3d38d0a31..11559b2637 100644 --- a/graphics/bufferqueue/1.0/Android.bp +++ b/graphics/bufferqueue/1.0/Android.bp @@ -27,6 +27,7 @@ hidl_interface { gen_java: true, apex_available: [ "//apex_available:platform", + "com.android.bluetooth", "com.android.media", "com.android.media.swcodec", ], diff --git a/graphics/bufferqueue/2.0/Android.bp b/graphics/bufferqueue/2.0/Android.bp index 33d9104211..552dafff8b 100644 --- a/graphics/bufferqueue/2.0/Android.bp +++ b/graphics/bufferqueue/2.0/Android.bp @@ -29,6 +29,7 @@ hidl_interface { gen_java: true, apex_available: [ "//apex_available:platform", + "com.android.bluetooth", "com.android.media", "com.android.media.swcodec", ], diff --git a/graphics/common/1.0/Android.bp b/graphics/common/1.0/Android.bp index ac158d96d1..19c51cd8e9 100644 --- a/graphics/common/1.0/Android.bp +++ b/graphics/common/1.0/Android.bp @@ -23,6 +23,7 @@ hidl_interface { gen_java_constants: true, apex_available: [ "//apex_available:platform", + "com.android.bluetooth", "com.android.media.swcodec", "test_com.android.media.swcodec", ], diff --git a/graphics/common/1.1/Android.bp b/graphics/common/1.1/Android.bp index e45d6ddf27..0f1b5bf17a 100644 --- a/graphics/common/1.1/Android.bp +++ b/graphics/common/1.1/Android.bp @@ -26,6 +26,7 @@ hidl_interface { gen_java_constants: true, apex_available: [ "//apex_available:platform", + "com.android.bluetooth", "com.android.media.swcodec", "test_com.android.media.swcodec", ], diff --git a/graphics/common/1.2/Android.bp b/graphics/common/1.2/Android.bp index c23085d4a9..ce3350d648 100644 --- a/graphics/common/1.2/Android.bp +++ b/graphics/common/1.2/Android.bp @@ -27,6 +27,7 @@ hidl_interface { gen_java_constants: true, apex_available: [ "//apex_available:platform", + "com.android.bluetooth", "com.android.media.swcodec", "test_com.android.media.swcodec", ], -- GitLab From a58110ea5961f149974f34c274e65967995e6304 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 2 Mar 2022 00:46:13 +0000 Subject: [PATCH 673/825] Define custom error type for StatusCode. Define a wrapper class for StatusCode to be used as E in Result. By default E is errorno as defined in linux and does not print out the correct error message. Migrate existing Result usage in VHAL to Result. Test: atest VehicleUtilsTest Bug: 219612366 Change-Id: Ic5369b6035bc46afc4c61da26c4b50f7fa9969d8 --- .../hardware/include/FakeVehicleHardware.h | 16 ++- .../hardware/src/FakeVehicleHardware.cpp | 49 +++---- .../obd2frame/include/FakeObd2Frame.h | 6 +- .../fake_impl/obd2frame/src/FakeObd2Frame.cpp | 21 +-- .../fake_impl/userhal/include/FakeUserHal.h | 24 ++-- .../fake_impl/userhal/src/FakeUserHal.cpp | 50 +++---- .../utils/common/include/PendingRequestPool.h | 7 +- .../common/include/VehiclePropertyStore.h | 24 ++-- .../impl/utils/common/include/VehicleUtils.h | 124 ++++++++++-------- .../utils/common/src/PendingRequestPool.cpp | 15 ++- .../utils/common/src/VehiclePropertyStore.cpp | 39 +++--- .../impl/utils/common/src/VehicleUtils.cpp | 9 ++ .../common/test/PendingRequestPoolTest.cpp | 2 +- .../common/test/VehiclePropertyStoreTest.cpp | 18 +-- .../utils/common/test/VehicleUtilsTest.cpp | 9 ++ .../aidl/impl/vhal/include/ConnectedClient.h | 4 +- .../impl/vhal/include/DefaultVehicleHal.h | 7 +- .../aidl/impl/vhal/src/ConnectedClient.cpp | 3 +- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 32 ++--- 19 files changed, 258 insertions(+), 201 deletions(-) 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 9634c80bfc..fa494c6634 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -41,6 +41,8 @@ namespace fake { class FakeVehicleHardware : public IVehicleHardware { public: + using ValueResultType = android::base::Result; + FakeVehicleHardware(); explicit FakeVehicleHardware(std::unique_ptr valuePool); @@ -85,10 +87,10 @@ class FakeVehicleHardware : public IVehicleHardware { const std::shared_ptr mValuePool; const std::shared_ptr mServerSidePropStore; - android::base::Result getValue( + ValueResultType getValue( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; - android::base::Result setValue( + android::base::Result setValue( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); private: @@ -115,19 +117,19 @@ class FakeVehicleHardware : public IVehicleHardware { // Override the properties using config files in 'overrideDir'. void overrideProperties(const char* overrideDir); - android::base::Result maybeSetSpecialValue( + android::base::Result maybeSetSpecialValue( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, bool* isSpecialValue); - android::base::Result maybeGetSpecialValue( + ValueResultType maybeGetSpecialValue( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, bool* isSpecialValue) const; - android::base::Result setApPowerStateReport( + android::base::Result setApPowerStateReport( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); VehiclePropValuePool::RecyclableType createApPowerStateReq( aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq state); - android::base::Result setUserHalProp( + android::base::Result setUserHalProp( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); - android::base::Result getUserHalProp( + ValueResultType getUserHalProp( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; bool isHvacPropAndHvacNotAvailable(int32_t propId); 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 a78d989605..233efc8b14 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -68,6 +68,8 @@ using ::android::base::Result; using ::android::base::StartsWith; using ::android::base::StringPrintf; +using StatusError = android::base::Error; + const char* VENDOR_OVERRIDE_DIR = "/vendor/etc/automotive/vhaloverride/"; const char* OVERRIDE_PROPERTY = "persist.vendor.vhal_init_value_override"; @@ -191,13 +193,13 @@ VehiclePropValuePool::RecyclableType FakeVehicleHardware::createApPowerStateReq( return req; } -Result FakeVehicleHardware::setApPowerStateReport(const VehiclePropValue& value) { +Result FakeVehicleHardware::setApPowerStateReport(const VehiclePropValue& value) { auto updatedValue = mValuePool->obtain(value); updatedValue->timestamp = elapsedRealtimeNano(); if (auto writeResult = mServerSidePropStore->writeValue(std::move(updatedValue)); !writeResult.ok()) { - return Error(getIntErrorCode(writeResult)) + return StatusError(getErrorCode(writeResult)) << "failed to write value into property store, error: " << getErrorMsg(writeResult); } @@ -224,7 +226,7 @@ Result FakeVehicleHardware::setApPowerStateReport(const VehiclePropValue& if (auto writeResult = mServerSidePropStore->writeValue(std::move(prop), /*updateStatus=*/true); !writeResult.ok()) { - return Error(getIntErrorCode(writeResult)) + return StatusError(getErrorCode(writeResult)) << "failed to write AP_POWER_STATE_REQ into property store, error: " << getErrorMsg(writeResult); } @@ -241,7 +243,7 @@ Result FakeVehicleHardware::setApPowerStateReport(const VehiclePropValue& if (auto writeResult = mServerSidePropStore->writeValue(std::move(prop), /*updateStatus=*/true); !writeResult.ok()) { - return Error(getIntErrorCode(writeResult)) + return StatusError(getErrorCode(writeResult)) << "failed to write AP_POWER_STATE_REQ into property store, error: " << getErrorMsg(writeResult); } @@ -268,10 +270,10 @@ bool FakeVehicleHardware::isHvacPropAndHvacNotAvailable(int32_t propId) { return false; } -Result FakeVehicleHardware::setUserHalProp(const VehiclePropValue& value) { +Result FakeVehicleHardware::setUserHalProp(const VehiclePropValue& value) { auto result = mFakeUserHal->onSetProperty(value); if (!result.ok()) { - return Error(getIntErrorCode(result)) + return StatusError(getErrorCode(result)) << "onSetProperty(): HAL returned error: " << getErrorMsg(result); } auto& updatedValue = result.value(); @@ -280,7 +282,7 @@ Result FakeVehicleHardware::setUserHalProp(const VehiclePropValue& value) updatedValue->toString().c_str()); if (auto writeResult = mServerSidePropStore->writeValue(std::move(result.value())); !writeResult.ok()) { - return Error(getIntErrorCode(writeResult)) + return StatusError(getErrorCode(writeResult)) << "failed to write value into property store, error: " << getErrorMsg(writeResult); } @@ -288,14 +290,14 @@ Result FakeVehicleHardware::setUserHalProp(const VehiclePropValue& value) return {}; } -Result FakeVehicleHardware::getUserHalProp( +FakeVehicleHardware::ValueResultType FakeVehicleHardware::getUserHalProp( const VehiclePropValue& value) const { auto propId = value.prop; ALOGI("get(): getting value for prop %d from User HAL", propId); auto result = mFakeUserHal->onGetProperty(value); if (!result.ok()) { - return Error(getIntErrorCode(result)) + return StatusError(getErrorCode(result)) << "get(): User HAL returned error: " << getErrorMsg(result); } else { auto& gotValue = result.value(); @@ -304,17 +306,16 @@ Result FakeVehicleHardware::getUserHalProp gotValue->timestamp = elapsedRealtimeNano(); return result; } else { - return Error(toInt(StatusCode::INTERNAL_ERROR)) - << "get(): User HAL returned null value"; + return StatusError(StatusCode::INTERNAL_ERROR) << "get(): User HAL returned null value"; } } } -Result FakeVehicleHardware::maybeGetSpecialValue( +FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue( const VehiclePropValue& value, bool* isSpecialValue) const { *isSpecialValue = false; int32_t propId = value.prop; - Result result; + ValueResultType result; if (mFakeUserHal->isSupported(propId)) { *isSpecialValue = true; @@ -344,8 +345,8 @@ Result FakeVehicleHardware::maybeGetSpecia return nullptr; } -Result FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValue& value, - bool* isSpecialValue) { +Result FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValue& value, + bool* isSpecialValue) { *isSpecialValue = false; VehiclePropValuePool::RecyclableType updatedValue; int32_t propId = value.prop; @@ -357,7 +358,7 @@ Result FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValue& v if (isHvacPropAndHvacNotAvailable(propId)) { *isSpecialValue = true; - return Error(toInt(StatusCode::NOT_AVAILABLE)) << "hvac not available"; + return StatusError(StatusCode::NOT_AVAILABLE) << "hvac not available"; } switch (propId) { @@ -396,7 +397,7 @@ Result FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValue& v updatedValue->areaId = value.areaId; if (auto writeResult = mServerSidePropStore->writeValue(std::move(updatedValue)); !writeResult.ok()) { - return Error(getIntErrorCode(writeResult)) + return StatusError(getErrorCode(writeResult)) << "failed to write value into property store, error: " << getErrorMsg(writeResult); } @@ -441,13 +442,13 @@ StatusCode FakeVehicleHardware::setValues(std::shared_ptr FakeVehicleHardware::setValue(const VehiclePropValue& value) { +Result FakeVehicleHardware::setValue(const VehiclePropValue& value) { bool isSpecialValue = false; auto setSpecialValueResult = maybeSetSpecialValue(value, &isSpecialValue); if (isSpecialValue) { if (!setSpecialValueResult.ok()) { - return Error(getIntErrorCode(setSpecialValueResult)) + return StatusError(getErrorCode(setSpecialValueResult)) << StringPrintf("failed to set special value for property ID: %d, error: %s", value.prop, getErrorMsg(setSpecialValueResult).c_str()); } @@ -460,7 +461,7 @@ Result FakeVehicleHardware::setValue(const VehiclePropValue& value) { auto writeResult = mServerSidePropStore->writeValue(std::move(updatedValue)); if (!writeResult.ok()) { - return Error(getIntErrorCode(writeResult)) + return StatusError(getErrorCode(writeResult)) << StringPrintf("failed to write value into property store, error: %s", getErrorMsg(writeResult).c_str()); } @@ -501,13 +502,13 @@ StatusCode FakeVehicleHardware::getValues(std::shared_ptr FakeVehicleHardware::getValue( +FakeVehicleHardware::ValueResultType FakeVehicleHardware::getValue( const VehiclePropValue& value) const { bool isSpecialValue = false; auto result = maybeGetSpecialValue(value, &isSpecialValue); if (isSpecialValue) { if (!result.ok()) { - return Error(getIntErrorCode(result)) + return StatusError(getErrorCode(result)) << StringPrintf("failed to get special value: %d, error: %s", value.prop, getErrorMsg(result).c_str()); } else { @@ -519,9 +520,9 @@ Result FakeVehicleHardware::getValue( if (!readResult.ok()) { StatusCode errorCode = getErrorCode(readResult); if (errorCode == StatusCode::NOT_AVAILABLE) { - return Error(toInt(errorCode)) << "value has not been set yet"; + return StatusError(errorCode) << "value has not been set yet"; } else { - return Error(toInt(errorCode)) + return StatusError(errorCode) << "failed to get value, error: " << getErrorMsg(readResult); } } diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h index fa6d8f9dc6..ba40f60d74 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h +++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h @@ -38,11 +38,11 @@ class FakeObd2Frame final { const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig); void initObd2FreezeFrame( const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig); - android::base::Result getObd2FreezeFrame( + android::base::Result getObd2FreezeFrame( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& requestedPropValue) const; - android::base::Result getObd2DtcInfo() const; - android::base::Result clearObd2FreezeFrames( + android::base::Result getObd2DtcInfo() const; + android::base::Result clearObd2FreezeFrames( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); static bool isDiagnosticProperty( const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig); diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/src/FakeObd2Frame.cpp b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/src/FakeObd2Frame.cpp index 5585fb4c22..0a4affc9d7 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/src/FakeObd2Frame.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/src/FakeObd2Frame.cpp @@ -44,9 +44,10 @@ using ::aidl::android::hardware::automotive::vehicle::StatusCode; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; -using ::android::base::Error; using ::android::base::Result; +using StatusError = android::base::Error; + std::unique_ptr FakeObd2Frame::fillDefaultObd2Frame(size_t numVendorIntegerSensors, size_t numVendorFloatSensors) { std::unique_ptr sensorStore(new Obd2SensorStore( @@ -126,37 +127,37 @@ void FakeObd2Frame::initObd2FreezeFrame(const VehiclePropConfig& propConfig) { } } -Result FakeObd2Frame::getObd2FreezeFrame( +Result FakeObd2Frame::getObd2FreezeFrame( const VehiclePropValue& requestedPropValue) const { if (requestedPropValue.value.int64Values.size() != 1) { - return Error(toInt(StatusCode::INVALID_ARG)) + return StatusError(StatusCode::INVALID_ARG) << "asked for OBD2_FREEZE_FRAME without valid timestamp"; } auto readValuesResult = mPropStore->readValuesForProperty(OBD2_FREEZE_FRAME); if (!readValuesResult.ok()) { - return Error(toInt(StatusCode::INTERNAL_ERROR)) + return StatusError(StatusCode::INTERNAL_ERROR) << "failed to read OBD2_FREEZE_FRAME property: " << readValuesResult.error().message(); } if (readValuesResult.value().size() == 0) { // Should no freeze frame be available at the given timestamp, a response of NOT_AVAILABLE // must be returned by the implementation - return Error(toInt(StatusCode::NOT_AVAILABLE)); + return StatusError(StatusCode::NOT_AVAILABLE); } auto timestamp = requestedPropValue.value.int64Values[0]; auto readValueResult = mPropStore->readValue(OBD2_FREEZE_FRAME, /*area=*/0, timestamp); if (!readValueResult.ok()) { - return Error(toInt(StatusCode::INVALID_ARG)) + return StatusError(StatusCode::INVALID_ARG) << "asked for OBD2_FREEZE_FRAME at invalid timestamp"; } return readValueResult; } -Result FakeObd2Frame::getObd2DtcInfo() const { +Result FakeObd2Frame::getObd2DtcInfo() const { std::vector timestamps; auto result = mPropStore->readValuesForProperty(OBD2_FREEZE_FRAME); if (!result.ok()) { - return Error(toInt(StatusCode::INTERNAL_ERROR)) + return StatusError(StatusCode::INTERNAL_ERROR) << "failed to read OBD2_FREEZE_FRAME property: " << result.error().message(); } for (const auto& freezeFrame : result.value()) { @@ -169,7 +170,7 @@ Result FakeObd2Frame::getObd2DtcInfo() con return outValue; } -Result FakeObd2Frame::clearObd2FreezeFrames(const VehiclePropValue& propValue) { +Result FakeObd2Frame::clearObd2FreezeFrames(const VehiclePropValue& propValue) { if (propValue.value.int64Values.size() == 0) { mPropStore->removeValuesForProperty(OBD2_FREEZE_FRAME); return {}; @@ -177,7 +178,7 @@ Result FakeObd2Frame::clearObd2FreezeFrames(const VehiclePropValue& propVa for (int64_t timestamp : propValue.value.int64Values) { auto result = mPropStore->readValue(OBD2_FREEZE_FRAME, 0, timestamp); if (!result.ok()) { - return Error(toInt(StatusCode::INVALID_ARG)) + return StatusError(StatusCode::INVALID_ARG) << "asked for OBD2_FREEZE_FRAME at invalid timestamp, error: %s" << result.error().message(); } diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h b/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h index a220146c63..9c4887cdfe 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h +++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -38,6 +39,8 @@ constexpr char kUserHalDumpOption[] = "--user-hal"; // Class used to emulate a real User HAL behavior through lshal debug requests. class FakeUserHal final { public: + using ValueResultType = android::base::Result; + explicit FakeUserHal(std::shared_ptr valuePool) : mValuePool(valuePool) {} ~FakeUserHal() = default; @@ -48,13 +51,13 @@ class FakeUserHal final { // Lets the emulator set the property. // // @return updated property and StatusCode - android::base::Result onSetProperty( + ValueResultType onSetProperty( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); // Gets the property value from the emulator. // // @return property value and StatusCode - android::base::Result onGetProperty( + ValueResultType onGetProperty( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; // Shows the User HAL emulation help. @@ -93,34 +96,33 @@ class FakeUserHal final { // - if it's 2, reply with mInitialUserResponseFromCmd but a wrong request id (so Android can // test this error scenario) // - if it's 3, then don't send a property change (so Android can emulate a timeout) - android::base::Result onSetInitialUserInfoResponse( + ValueResultType onSetInitialUserInfoResponse( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); // Used to emulate SWITCH_USER - see onSetInitialUserInfoResponse() for usage. - android::base::Result onSetSwitchUserResponse( + ValueResultType onSetSwitchUserResponse( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); // Used to emulate CREATE_USER - see onSetInitialUserInfoResponse() for usage. - android::base::Result onSetCreateUserResponse( + ValueResultType onSetCreateUserResponse( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); // Used to emulate set USER_IDENTIFICATION_ASSOCIATION - see onSetInitialUserInfoResponse() for // usage. - android::base::Result onSetUserIdentificationAssociation( + ValueResultType onSetUserIdentificationAssociation( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); // Used to emulate get USER_IDENTIFICATION_ASSOCIATION - see onSetInitialUserInfoResponse() for // usage. - android::base::Result onGetUserIdentificationAssociation( + ValueResultType onGetUserIdentificationAssociation( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; // Creates a default USER_IDENTIFICATION_ASSOCIATION when it was not set by lshal. - static android::base::Result - defaultUserIdentificationAssociation( + static ValueResultType defaultUserIdentificationAssociation( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& request); - android::base::Result sendUserHalResponse( - VehiclePropValuePool::RecyclableType response, int32_t requestId); + ValueResultType sendUserHalResponse(VehiclePropValuePool::RecyclableType response, + int32_t requestId); }; } // namespace fake diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/src/FakeUserHal.cpp b/automotive/vehicle/aidl/impl/fake_impl/userhal/src/FakeUserHal.cpp index 9b6005364e..e37f619be7 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/userhal/src/FakeUserHal.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/src/FakeUserHal.cpp @@ -44,6 +44,8 @@ using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::base::Error; using ::android::base::Result; +using StatusError = android::base::Error; + constexpr int32_t INITIAL_USER_INFO = toInt(VehicleProperty::INITIAL_USER_INFO); constexpr int32_t SWITCH_USER = toInt(VehicleProperty::SWITCH_USER); constexpr int32_t CREATE_USER = toInt(VehicleProperty::CREATE_USER); @@ -51,20 +53,24 @@ constexpr int32_t REMOVE_USER = toInt(VehicleProperty::REMOVE_USER); constexpr int32_t USER_IDENTIFICATION_ASSOCIATION = toInt(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION); -Result getRequestId(const VehiclePropValue& value) { +Result getRequestId(const VehiclePropValue& value) { if (value.value.int32Values.size() < 1) { - return Error(toInt(StatusCode::INVALID_ARG)) + return StatusError(StatusCode::INVALID_ARG) << "no int32Values on property: " << value.toString(); } return value.value.int32Values[0]; } -Result getSwitchUserMessageType(const VehiclePropValue& value) { +Result getSwitchUserMessageType(const VehiclePropValue& value) { if (value.value.int32Values.size() < 2) { - return Error(toInt(StatusCode::INVALID_ARG)) + return StatusError(StatusCode::INVALID_ARG) << "missing switch user message type on property: " << value.toString(); } - return user_hal_helper::verifyAndCast(value.value.int32Values[1]); + auto result = user_hal_helper::verifyAndCast(value.value.int32Values[1]); + if (!result.ok()) { + return StatusError(StatusCode::INVALID_ARG) << result.error().message(); + } + return result.value(); } } // namespace @@ -82,8 +88,7 @@ bool FakeUserHal::isSupported(int32_t prop) { } } -Result FakeUserHal::onSetProperty( - const VehiclePropValue& value) { +FakeUserHal::ValueResultType FakeUserHal::onSetProperty(const VehiclePropValue& value) { ALOGV("onSetProperty(): %s", value.toString().c_str()); switch (value.prop) { @@ -99,13 +104,12 @@ Result FakeUserHal::onSetProperty( case USER_IDENTIFICATION_ASSOCIATION: return onSetUserIdentificationAssociation(value); default: - return Error(toInt(StatusCode::INVALID_ARG)) + return StatusError(StatusCode::INVALID_ARG) << "Unsupported property: " << value.toString(); } } -Result FakeUserHal::onGetProperty( - const VehiclePropValue& value) const { +FakeUserHal::ValueResultType FakeUserHal::onGetProperty(const VehiclePropValue& value) const { ALOGV("onGetProperty(%s)", value.toString().c_str()); switch (value.prop) { case INITIAL_USER_INFO: @@ -113,16 +117,16 @@ Result FakeUserHal::onGetProperty( case CREATE_USER: case REMOVE_USER: ALOGE("onGetProperty(): %d is only supported on SET", value.prop); - return Error(toInt(StatusCode::INVALID_ARG)) << "only supported on SET"; + return StatusError(StatusCode::INVALID_ARG) << "only supported on SET"; case USER_IDENTIFICATION_ASSOCIATION: return onGetUserIdentificationAssociation(value); default: ALOGE("onGetProperty(): %d is not supported", value.prop); - return Error(toInt(StatusCode::INVALID_ARG)) << "not supported by User HAL"; + return StatusError(StatusCode::INVALID_ARG) << "not supported by User HAL"; } } -Result FakeUserHal::onGetUserIdentificationAssociation( +FakeUserHal::ValueResultType FakeUserHal::onGetUserIdentificationAssociation( const VehiclePropValue& value) const { std::scoped_lock lockGuard(mLock); @@ -143,7 +147,7 @@ Result FakeUserHal::onGetUserIdentificatio return newValue; } -Result FakeUserHal::onSetInitialUserInfoResponse( +FakeUserHal::ValueResultType FakeUserHal::onSetInitialUserInfoResponse( const VehiclePropValue& value) { std::scoped_lock lockGuard(mLock); @@ -178,8 +182,7 @@ Result FakeUserHal::onSetInitialUserInfoRe return updatedValue; } -Result FakeUserHal::onSetSwitchUserResponse( - const VehiclePropValue& value) { +FakeUserHal::ValueResultType FakeUserHal::onSetSwitchUserResponse(const VehiclePropValue& value) { std::scoped_lock lockGuard(mLock); auto requestId = getRequestId(value); @@ -234,8 +237,7 @@ Result FakeUserHal::onSetSwitchUserRespons return updatedValue; } -Result FakeUserHal::onSetCreateUserResponse( - const VehiclePropValue& value) { +FakeUserHal::ValueResultType FakeUserHal::onSetCreateUserResponse(const VehiclePropValue& value) { std::scoped_lock lockGuard(mLock); auto requestId = getRequestId(value); @@ -268,7 +270,7 @@ Result FakeUserHal::onSetCreateUserRespons return updatedValue; } -Result FakeUserHal::onSetUserIdentificationAssociation( +FakeUserHal::ValueResultType FakeUserHal::onSetUserIdentificationAssociation( const VehiclePropValue& value) { std::scoped_lock lockGuard(mLock); @@ -298,14 +300,14 @@ Result FakeUserHal::onSetUserIdentificatio return defaultUserIdentificationAssociation(value); } -Result FakeUserHal::defaultUserIdentificationAssociation( +FakeUserHal::ValueResultType FakeUserHal::defaultUserIdentificationAssociation( const VehiclePropValue& request) { // TODO(b/159498909): return a response with NOT_ASSOCIATED_ANY_USER for all requested types ALOGE("no lshal response for %s; replying with NOT_AVAILABLE", request.toString().c_str()); - return Error(toInt(StatusCode::NOT_AVAILABLE)) << "not set by lshal"; + return StatusError(StatusCode::NOT_AVAILABLE) << "not set by lshal"; } -Result FakeUserHal::sendUserHalResponse( +FakeUserHal::ValueResultType FakeUserHal::sendUserHalResponse( VehiclePropValuePool::RecyclableType response, int32_t requestId) { switch (response->areaId) { case 1: @@ -319,12 +321,12 @@ Result FakeUserHal::sendUserHalResponse( case 3: ALOGD("not generating a property change event because of lshal prop: %s", response->toString().c_str()); - return Error(toInt(StatusCode::NOT_AVAILABLE)) + return StatusError(StatusCode::NOT_AVAILABLE) << "not generating a property change event because of lshal prop: " << response->toString(); default: ALOGE("invalid action on lshal response: %s", response->toString().c_str()); - return Error(toInt(StatusCode::INTERNAL_ERROR)) + return StatusError(StatusCode::INTERNAL_ERROR) << "invalid action on lshal response: " << response->toString(); } diff --git a/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h b/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h index dcf5057fcc..4ab8acd126 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h @@ -17,6 +17,7 @@ #ifndef android_hardware_automotive_vehicle_aidl_impl_vhal_include_PendingRequestPool_H_ #define android_hardware_automotive_vehicle_aidl_impl_vhal_include_PendingRequestPool_H_ +#include #include #include @@ -49,9 +50,9 @@ class PendingRequestPool final { // added. Otherwise, they would be added to the request pool. // The callback would be called if requests are not finished within {@code mTimeoutInNano} // seconds. - android::base::Result addRequests(const void* clientId, - const std::unordered_set& requestIds, - std::shared_ptr callback); + android::base::Result addRequests( + const void* clientId, const std::unordered_set& requestIds, + std::shared_ptr callback); // Checks whether the request is currently pending. bool isRequestPending(const void* clientId, int64_t requestId) const; diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h index 2c7aa97acd..cebf95c372 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -42,6 +43,10 @@ namespace vehicle { // This class is thread-safe, however it uses blocking synchronization across all methods. class VehiclePropertyStore final { public: + using ValueResultType = android::base::Result; + using ValuesResultType = + android::base::Result, VhalError>; + explicit VehiclePropertyStore(std::shared_ptr valuePool) : mValuePool(valuePool) {} @@ -68,8 +73,8 @@ class VehiclePropertyStore final { // '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. - android::base::Result writeValue(VehiclePropValuePool::RecyclableType propValue, - bool updateStatus = false); + android::base::Result writeValue( + VehiclePropValuePool::RecyclableType propValue, bool updateStatus = false); // Remove a given property value from the property store. The 'propValue' would be used to // generate the key for the value to remove. @@ -83,28 +88,26 @@ class VehiclePropertyStore final { std::vector readAllValues() const; // Read all the values for the property. - android::base::Result> readValuesForProperty( - int32_t propId) const; + ValuesResultType readValuesForProperty(int32_t propId) const; // 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. - android::base::Result readValue( + ValueResultType readValue( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& request) const; // 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. - android::base::Result 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; // Get all property configs. std::vector getAllConfigs() const; // Get the property config for the requested property. - android::base::Result + android::base::Result getConfig(int32_t propId) const; // Set a callback that would be called when a property value has been updated. @@ -146,8 +149,7 @@ class VehiclePropertyStore final { const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue, const Record& record) const; - android::base::Result readValueLocked( - const RecordId& recId, const Record& record) const; + ValueResultType readValueLocked(const RecordId& recId, const Record& record) const; }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h index 1fc5613a71..8ef02182da 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h @@ -190,31 +190,91 @@ inline size_t getVehiclePropValueSize( return size; } +// Check whether the value is valid according to config. +// We check for the following: +// * If the type is INT32, {@code value.int32Values} must contain one element. +// * If the type is INT32_VEC, {@code value.int32Values} must contain at least one element. +// * If the type is INT64, {@code value.int64Values} must contain one element. +// * If the type is INT64_VEC, {@code value.int64Values} must contain at least one element. +// * If the type is FLOAT, {@code value.floatValues} must contain one element. +// * If the type is FLOAT_VEC, {@code value.floatValues} must contain at least one element. +// * If the type is MIXED, see checkVendorMixedPropValue. +android::base::Result checkPropValue( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, + const aidl::android::hardware::automotive::vehicle::VehiclePropConfig* config); + +// Check whether the Mixed type value is valid according to config. +// We check for the following: +// * configArray[1] + configArray[2] + configArray[3] must be equal to the number of +// {@code value.int32Values} elements. +// * configArray[4] + configArray[5] must be equal to the number of {@code value.int64Values} +// elements. +// * configArray[6] + configArray[7] must be equal to the number of {@code value.floatValues} +// elements. +// * configArray[8] must be equal to the number of {@code value.byteValues} elements. +android::base::Result checkVendorMixedPropValue( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, + const aidl::android::hardware::automotive::vehicle::VehiclePropConfig* config); + +// Check whether the value is within the configured range. +// We check for the following types: +// * If type is INT32 or INT32_VEC, all {@code value.int32Values} elements must be within +// {@code minInt32Value} and {@code maxInt32Value} if either of them is not 0. +// * If type is INT64 or INT64_VEC, all {@code value.int64Values} elements must be within +// {@code minInt64Value} and {@code maxInt64Value} if either of them is not 0. +// * If type is FLOAT or FLOAT_VEC, all {@code value.floatValues} elements must be within +// {@code minFloatValues} and {@code maxFloatValues} if either of them is not 0. +// We don't check other types. If more checks are required, they should be added in VehicleHardware +// implementation. +android::base::Result checkValueRange( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, + const aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* config); + +// VhalError is a wrapper class for {@code StatusCode} that could act as E in {@code Result}. +class VhalError final { + public: + VhalError() : mCode(aidl::android::hardware::automotive::vehicle::StatusCode::OK) {} + + VhalError(aidl::android::hardware::automotive::vehicle::StatusCode&& code) : mCode(code) {} + + VhalError(const aidl::android::hardware::automotive::vehicle::StatusCode& code) : mCode(code) {} + + aidl::android::hardware::automotive::vehicle::StatusCode value() const; + + inline operator aidl::android::hardware::automotive::vehicle::StatusCode() const { + return value(); + } + + std::string print() const; + + private: + aidl::android::hardware::automotive::vehicle::StatusCode mCode; +}; + template aidl::android::hardware::automotive::vehicle::StatusCode getErrorCode( - const android::base::Result& result) { + const android::base::Result& result) { if (result.ok()) { return aidl::android::hardware::automotive::vehicle::StatusCode::OK; } - return static_cast( - result.error().code()); + return result.error().code(); } template -int getIntErrorCode(const android::base::Result& result) { +int getIntErrorCode(const android::base::Result& result) { return toInt(getErrorCode(result)); } -template -std::string getErrorMsg(const android::base::Result& result) { +template +std::string getErrorMsg(const android::base::Result& result) { if (result.ok()) { return ""; } return result.error().message(); } -template -ndk::ScopedAStatus toScopedAStatus(const android::base::Result& result, +template +ndk::ScopedAStatus toScopedAStatus(const android::base::Result& result, aidl::android::hardware::automotive::vehicle::StatusCode status, const std::string& additionalErrorMsg) { if (result.ok()) { @@ -225,64 +285,24 @@ ndk::ScopedAStatus toScopedAStatus(const android::base::Result& result, fmt::format("{}, error: {}", additionalErrorMsg, getErrorMsg(result)).c_str()); } -template +template ndk::ScopedAStatus toScopedAStatus( - const android::base::Result& result, + const android::base::Result& result, aidl::android::hardware::automotive::vehicle::StatusCode status) { return toScopedAStatus(result, status, ""); } template -ndk::ScopedAStatus toScopedAStatus(const android::base::Result& result) { +ndk::ScopedAStatus toScopedAStatus(const android::base::Result& result) { return toScopedAStatus(result, getErrorCode(result)); } template -ndk::ScopedAStatus toScopedAStatus(const android::base::Result& result, +ndk::ScopedAStatus toScopedAStatus(const android::base::Result& result, const std::string& additionalErrorMsg) { return toScopedAStatus(result, getErrorCode(result), additionalErrorMsg); } -// Check whether the value is valid according to config. -// We check for the following: -// * If the type is INT32, {@code value.int32Values} must contain one element. -// * If the type is INT32_VEC, {@code value.int32Values} must contain at least one element. -// * If the type is INT64, {@code value.int64Values} must contain one element. -// * If the type is INT64_VEC, {@code value.int64Values} must contain at least one element. -// * If the type is FLOAT, {@code value.floatValues} must contain one element. -// * If the type is FLOAT_VEC, {@code value.floatValues} must contain at least one element. -// * If the type is MIXED, see checkVendorMixedPropValue. -android::base::Result checkPropValue( - const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, - const aidl::android::hardware::automotive::vehicle::VehiclePropConfig* config); - -// Check whether the Mixed type value is valid according to config. -// We check for the following: -// * configArray[1] + configArray[2] + configArray[3] must be equal to the number of -// {@code value.int32Values} elements. -// * configArray[4] + configArray[5] must be equal to the number of {@code value.int64Values} -// elements. -// * configArray[6] + configArray[7] must be equal to the number of {@code value.floatValues} -// elements. -// * configArray[8] must be equal to the number of {@code value.byteValues} elements. -android::base::Result checkVendorMixedPropValue( - const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, - const aidl::android::hardware::automotive::vehicle::VehiclePropConfig* config); - -// Check whether the value is within the configured range. -// We check for the following types: -// * If type is INT32 or INT32_VEC, all {@code value.int32Values} elements must be within -// {@code minInt32Value} and {@code maxInt32Value} if either of them is not 0. -// * If type is INT64 or INT64_VEC, all {@code value.int64Values} elements must be within -// {@code minInt64Value} and {@code maxInt64Value} if either of them is not 0. -// * If type is FLOAT or FLOAT_VEC, all {@code value.floatValues} elements must be within -// {@code minFloatValues} and {@code maxFloatValues} if either of them is not 0. -// We don't check other types. If more checks are required, they should be added in VehicleHardware -// implementation. -android::base::Result checkValueRange( - const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, - const aidl::android::hardware::automotive::vehicle::VehicleAreaConfig* config); - } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp b/automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp index 23a540393a..f8a042d242 100644 --- a/automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp @@ -32,11 +32,12 @@ namespace vehicle { namespace { using ::aidl::android::hardware::automotive::vehicle::StatusCode; -using ::android::base::Error; using ::android::base::Result; // At least check every 1s. -constexpr int64_t CHECK_TIME_IN_NANO = 1000000000; +constexpr int64_t CHECK_TIME_IN_NANO = 1'000'000'000; + +using StatusError = android::base::Error; } // namespace @@ -72,9 +73,9 @@ PendingRequestPool::~PendingRequestPool() { } } -Result PendingRequestPool::addRequests(const void* clientId, - const std::unordered_set& requestIds, - std::shared_ptr callback) { +Result PendingRequestPool::addRequests( + const void* clientId, const std::unordered_set& requestIds, + std::shared_ptr callback) { std::scoped_lock lockGuard(mLock); std::list* pendingRequests; size_t pendingRequestCount = 0; @@ -84,7 +85,7 @@ Result PendingRequestPool::addRequests(const void* clientId, const auto& pendingRequestIds = pendingRequest.requestIds; for (int64_t requestId : requestIds) { if (pendingRequestIds.find(requestId) != pendingRequestIds.end()) { - return Error(toInt(StatusCode::INVALID_ARG)) + return StatusError(StatusCode::INVALID_ARG) << "duplicate request ID: " << requestId; } } @@ -96,7 +97,7 @@ Result PendingRequestPool::addRequests(const void* clientId, } if (requestIds.size() > MAX_PENDING_REQUEST_PER_CLIENT - pendingRequestCount) { - return Error(toInt(StatusCode::TRY_AGAIN)) << "too many pending requests"; + return StatusError(StatusCode::TRY_AGAIN) << "too many pending requests"; } int64_t currentTime = elapsedRealtimeNano(); diff --git a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp index c1fa89645c..776caed1f1 100644 --- a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp @@ -36,10 +36,11 @@ using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; -using ::android::base::Error; using ::android::base::Result; using ::android::base::StringPrintf; +using StatusError = android::base::Error; + bool VehiclePropertyStore::RecordId::operator==(const VehiclePropertyStore::RecordId& other) const { return area == other.area && token == other.token; } @@ -87,12 +88,12 @@ VehiclePropertyStore::RecordId VehiclePropertyStore::getRecordIdLocked( return recId; } -Result VehiclePropertyStore::readValueLocked( +Result VehiclePropertyStore::readValueLocked( const RecordId& recId, const Record& record) const REQUIRES(mLock) { if (auto it = record.values.find(recId); it != record.values.end()) { return mValuePool->obtain(*(it->second)); } - return Error(toInt(StatusCode::NOT_AVAILABLE)) + return StatusError(StatusCode::NOT_AVAILABLE) << "Record ID: " << recId.toString() << " is not found"; } @@ -106,19 +107,19 @@ void VehiclePropertyStore::registerProperty(const VehiclePropConfig& config, }; } -Result VehiclePropertyStore::writeValue(VehiclePropValuePool::RecyclableType propValue, - bool updateStatus) { +Result VehiclePropertyStore::writeValue( + VehiclePropValuePool::RecyclableType propValue, bool updateStatus) { std::scoped_lock g(mLock); int32_t propId = propValue->prop; VehiclePropertyStore::Record* record = getRecordLocked(propId); if (record == nullptr) { - return Error(toInt(StatusCode::INVALID_ARG)) << "property: " << propId << " not registered"; + return StatusError(StatusCode::INVALID_ARG) << "property: " << propId << " not registered"; } if (!isGlobalProp(propId) && getAreaConfig(*propValue, record->propConfig) == nullptr) { - return Error(toInt(StatusCode::INVALID_ARG)) + return StatusError(StatusCode::INVALID_ARG) << "no config for property: " << propId << " area: " << propValue->areaId; } @@ -130,7 +131,7 @@ Result VehiclePropertyStore::writeValue(VehiclePropValuePool::RecyclableTy VehiclePropertyStatus oldStatus = valueToUpdate->status; // propValue is outdated and drops it. if (oldTimestamp > propValue->timestamp) { - return Error(toInt(StatusCode::INVALID_ARG)) + return StatusError(StatusCode::INVALID_ARG) << "outdated timestamp: " << propValue->timestamp; } if (!updateStatus) { @@ -191,15 +192,15 @@ std::vector VehiclePropertyStore::readAllV return allValues; } -Result> -VehiclePropertyStore::readValuesForProperty(int32_t propId) const { +VehiclePropertyStore::ValuesResultType VehiclePropertyStore::readValuesForProperty( + int32_t propId) const { std::scoped_lock g(mLock); std::vector values; const VehiclePropertyStore::Record* record = getRecordLocked(propId); if (record == nullptr) { - return Error(toInt(StatusCode::INVALID_ARG)) << "property: " << propId << " not registered"; + return StatusError(StatusCode::INVALID_ARG) << "property: " << propId << " not registered"; } for (auto const& [_, value] : record->values) { @@ -208,28 +209,28 @@ VehiclePropertyStore::readValuesForProperty(int32_t propId) const { return values; } -Result VehiclePropertyStore::readValue( +VehiclePropertyStore::ValueResultType VehiclePropertyStore::readValue( const VehiclePropValue& propValue) const { std::scoped_lock g(mLock); int32_t propId = propValue.prop; const VehiclePropertyStore::Record* record = getRecordLocked(propId); if (record == nullptr) { - return Error(toInt(StatusCode::INVALID_ARG)) << "property: " << propId << " not registered"; + return StatusError(StatusCode::INVALID_ARG) << "property: " << propId << " not registered"; } VehiclePropertyStore::RecordId recId = getRecordIdLocked(propValue, *record); return readValueLocked(recId, *record); } -Result VehiclePropertyStore::readValue(int32_t propId, - int32_t areaId, - int64_t token) const { +VehiclePropertyStore::ValueResultType VehiclePropertyStore::readValue(int32_t propId, + int32_t areaId, + int64_t token) const { std::scoped_lock g(mLock); const VehiclePropertyStore::Record* record = getRecordLocked(propId); if (record == nullptr) { - return Error(toInt(StatusCode::INVALID_ARG)) << "property: " << propId << " not registered"; + return StatusError(StatusCode::INVALID_ARG) << "property: " << propId << " not registered"; } VehiclePropertyStore::RecordId recId{.area = isGlobalProp(propId) ? 0 : areaId, .token = token}; @@ -247,12 +248,12 @@ std::vector VehiclePropertyStore::getAllConfigs() const { return configs; } -Result VehiclePropertyStore::getConfig(int32_t propId) const { +Result VehiclePropertyStore::getConfig(int32_t propId) const { std::scoped_lock g(mLock); const VehiclePropertyStore::Record* record = getRecordLocked(propId); if (record == nullptr) { - return Error(toInt(StatusCode::INVALID_ARG)) << "property: " << propId << " not registered"; + return StatusError(StatusCode::INVALID_ARG) << "property: " << propId << " not registered"; } return &record->propConfig; diff --git a/automotive/vehicle/aidl/impl/utils/common/src/VehicleUtils.cpp b/automotive/vehicle/aidl/impl/utils/common/src/VehicleUtils.cpp index 5abde8de44..f85728d4b6 100644 --- a/automotive/vehicle/aidl/impl/utils/common/src/VehicleUtils.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/src/VehicleUtils.cpp @@ -21,6 +21,7 @@ namespace hardware { namespace automotive { namespace vehicle { +using ::aidl::android::hardware::automotive::vehicle::StatusCode; using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup; @@ -204,6 +205,14 @@ Result checkValueRange(const VehiclePropValue& value, const VehicleAreaCon return {}; } +StatusCode VhalError::value() const { + return mCode; +} + +std::string VhalError::print() const { + return aidl::android::hardware::automotive::vehicle::toString(mCode); +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/utils/common/test/PendingRequestPoolTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/PendingRequestPoolTest.cpp index 9c9e4b90aa..734c7392a9 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/PendingRequestPoolTest.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/test/PendingRequestPoolTest.cpp @@ -263,7 +263,7 @@ TEST_F(PendingRequestPoolTest, testPendingRequestCountLimit) { auto result = getPool()->addRequests(reinterpret_cast(0), {static_cast(10000)}, callback); ASSERT_FALSE(result.ok()) << "adding more pending requests than limit must fail"; - ASSERT_EQ(result.error().code(), toInt(StatusCode::TRY_AGAIN)); + ASSERT_EQ(result.error().code(), StatusCode::TRY_AGAIN); getPool()->tryFinishRequests(reinterpret_cast(0), requests); } diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp index 1f230e7b7f..c8bf1d8993 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp @@ -103,7 +103,7 @@ TEST_F(VehiclePropertyStoreTest, testGetAllConfigs) { } TEST_F(VehiclePropertyStoreTest, testGetConfig) { - Result result = + Result result = mStore->getConfig(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); ASSERT_RESULT_OK(result); @@ -111,10 +111,10 @@ TEST_F(VehiclePropertyStoreTest, testGetConfig) { } TEST_F(VehiclePropertyStoreTest, testGetConfigWithInvalidPropId) { - Result result = mStore->getConfig(INVALID_PROP_ID); + Result result = mStore->getConfig(INVALID_PROP_ID); EXPECT_FALSE(result.ok()) << "expect error when getting a config for an invalid property ID"; - EXPECT_EQ(result.error().code(), toInt(StatusCode::INVALID_ARG)); + EXPECT_EQ(result.error().code(), StatusCode::INVALID_ARG); } std::vector getTestPropValues() { @@ -184,7 +184,7 @@ TEST_F(VehiclePropertyStoreTest, testReadValuesForPropertyError) { auto result = mStore->readValuesForProperty(INVALID_PROP_ID); EXPECT_FALSE(result.ok()) << "expect error when reading values for an invalid property"; - EXPECT_EQ(result.error().code(), toInt(StatusCode::INVALID_ARG)); + EXPECT_EQ(result.error().code(), StatusCode::INVALID_ARG); } TEST_F(VehiclePropertyStoreTest, testReadValueOk) { @@ -224,7 +224,7 @@ TEST_F(VehiclePropertyStoreTest, testReadValueError) { auto result = mStore->readValue(toInt(VehicleProperty::TIRE_PRESSURE), WHEEL_REAR_LEFT); EXPECT_FALSE(result.ok()) << "expect error when reading a value that has not been written"; - EXPECT_EQ(result.error().code(), toInt(StatusCode::NOT_AVAILABLE)); + EXPECT_EQ(result.error().code(), StatusCode::NOT_AVAILABLE); } TEST_F(VehiclePropertyStoreTest, testWriteValueError) { @@ -235,7 +235,7 @@ TEST_F(VehiclePropertyStoreTest, testWriteValueError) { auto result = mStore->writeValue(std::move(v)); EXPECT_FALSE(result.ok()) << "expect error when writing value for an invalid property ID"; - EXPECT_EQ(result.error().code(), toInt(StatusCode::INVALID_ARG)); + EXPECT_EQ(result.error().code(), StatusCode::INVALID_ARG); } TEST_F(VehiclePropertyStoreTest, testWriteValueNoAreaConfig) { @@ -248,7 +248,7 @@ TEST_F(VehiclePropertyStoreTest, testWriteValueNoAreaConfig) { auto result = mStore->writeValue(std::move(v)); EXPECT_FALSE(result.ok()) << "expect error when writing value for an area without config"; - EXPECT_EQ(result.error().code(), toInt(StatusCode::INVALID_ARG)); + EXPECT_EQ(result.error().code(), StatusCode::INVALID_ARG); } TEST_F(VehiclePropertyStoreTest, testWriteOutdatedValue) { @@ -269,7 +269,7 @@ TEST_F(VehiclePropertyStoreTest, testWriteOutdatedValue) { auto result = mStore->writeValue(std::move(v2)); EXPECT_FALSE(result.ok()) << "expect error when writing an outdated value"; - EXPECT_EQ(result.error().code(), toInt(StatusCode::INVALID_ARG)); + EXPECT_EQ(result.error().code(), StatusCode::INVALID_ARG); } TEST_F(VehiclePropertyStoreTest, testToken) { @@ -317,7 +317,7 @@ TEST_F(VehiclePropertyStoreTest, testRemoveValue) { auto result = mStore->readValue(values[0]); EXPECT_FALSE(result.ok()) << "expect error when reading a removed value"; - EXPECT_EQ(result.error().code(), toInt(StatusCode::NOT_AVAILABLE)); + EXPECT_EQ(result.error().code(), StatusCode::NOT_AVAILABLE); auto leftTirePressureResult = mStore->readValue(values[1]); diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp index de8b26d37f..cc299641f8 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp @@ -32,6 +32,7 @@ namespace vehicle { namespace { +using ::aidl::android::hardware::automotive::vehicle::StatusCode; using ::aidl::android::hardware::automotive::vehicle::VehicleArea; using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; @@ -39,6 +40,8 @@ using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; +using ::android::base::Error; +using ::android::base::Result; struct InvalidPropValueTestCase { std::string name; @@ -759,6 +762,12 @@ TEST(VehicleUtilsTest, testConcurrentQueueDeactivateNotifyWaitingThread) { t.join(); } +TEST(VehicleUtilsTest, testVhalError) { + Result result = Error(StatusCode::INVALID_ARG) << "error message"; + + ASSERT_EQ(result.error().message(), "error message: INVALID_ARG"); +} + class InvalidPropValueTest : public testing::TestWithParam {}; INSTANTIATE_TEST_SUITE_P(InvalidPropValueTests, InvalidPropValueTest, diff --git a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h index 5d88f7c74d..6ab0e1e945 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h +++ b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -57,7 +58,8 @@ class ConnectedClient { // Returns {@code INVALID_ARG} error if any of the requestIds are duplicate with one of the // pending request IDs or {@code TRY_AGAIN} error if the pending request pool is full and could // no longer add requests. - android::base::Result addRequests(const std::unordered_set& requestIds); + android::base::Result addRequests( + const std::unordered_set& requestIds); // Marks the requests as finished. Returns a list of request IDs that was pending and has been // finished. It must be a set of the requested request IDs. diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index 9735ed3012..84b6742282 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -43,6 +43,7 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi public: using CallbackType = std::shared_ptr; + using StatusError = android::base::Error; explicit DefaultVehicleHal(std::unique_ptr hardware); @@ -189,14 +190,14 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi const std::vector& requests); - android::base::Result checkSubscribeOptions( + android::base::Result checkSubscribeOptions( const std::vector& options); - android::base::Result checkReadPermission( + android::base::Result checkReadPermission( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; - android::base::Result checkWritePermission( + android::base::Result checkWritePermission( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; android::base::Result diff --git a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp index 830b93657c..5c5f27e2e7 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp @@ -194,7 +194,8 @@ const void* ConnectedClient::id() { return reinterpret_cast(this); } -Result ConnectedClient::addRequests(const std::unordered_set& requestIds) { +Result ConnectedClient::addRequests( + const std::unordered_set& requestIds) { return mRequestPool->addRequests(id(), requestIds, getTimeoutCallback()); } diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index 52f36316d9..b50571b0c7 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -115,7 +115,7 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) auto result = LargeParcelableBase::parcelableToStableLargeParcelable(vehiclePropConfigs); if (!result.ok()) { ALOGE("failed to convert configs to shared memory file, error: %s, code: %d", - getErrorMsg(result).c_str(), getIntErrorCode(result)); + result.error().message().c_str(), static_cast(result.error().code())); return; } @@ -475,7 +475,7 @@ ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, if (auto addRequestResult = client->addRequests(hardwareRequestIds); !addRequestResult.ok()) { ALOGE("setValues[%s], failed to add pending requests, error: %s", toString(hardwareRequestIds).c_str(), getErrorMsg(addRequestResult).c_str()); - return toScopedAStatus(addRequestResult, StatusCode::INVALID_ARG); + return toScopedAStatus(addRequestResult); } if (!failedResults.empty()) { @@ -545,25 +545,25 @@ ScopedAStatus DefaultVehicleHal::getPropConfigs(const std::vector& prop return vectorToStableLargeParcelable(std::move(configs), output); } -Result DefaultVehicleHal::checkSubscribeOptions( +Result DefaultVehicleHal::checkSubscribeOptions( const std::vector& options) { for (const auto& option : options) { int32_t propId = option.propId; if (mConfigsByPropId.find(propId) == mConfigsByPropId.end()) { - return Error(toInt(StatusCode::INVALID_ARG)) + return StatusError(StatusCode::INVALID_ARG) << StringPrintf("no config for property, ID: %" PRId32, propId); } const VehiclePropConfig& config = mConfigsByPropId[propId]; if (config.changeMode != VehiclePropertyChangeMode::ON_CHANGE && config.changeMode != VehiclePropertyChangeMode::CONTINUOUS) { - return Error(toInt(StatusCode::INVALID_ARG)) + return StatusError(StatusCode::INVALID_ARG) << "only support subscribing to ON_CHANGE or CONTINUOUS property"; } if (config.access != VehiclePropertyAccess::READ && config.access != VehiclePropertyAccess::READ_WRITE) { - return Error(toInt(StatusCode::ACCESS_DENIED)) + return StatusError(StatusCode::ACCESS_DENIED) << StringPrintf("Property %" PRId32 " has no read access", propId); } @@ -572,12 +572,12 @@ Result DefaultVehicleHal::checkSubscribeOptions( float minSampleRate = config.minSampleRate; float maxSampleRate = config.maxSampleRate; if (sampleRate < minSampleRate || sampleRate > maxSampleRate) { - return Error(toInt(StatusCode::INVALID_ARG)) + return StatusError(StatusCode::INVALID_ARG) << StringPrintf("sample rate: %f out of range, must be within %f and %f", sampleRate, minSampleRate, maxSampleRate); } if (!SubscriptionManager::checkSampleRate(sampleRate)) { - return Error(toInt(StatusCode::INVALID_ARG)) + return StatusError(StatusCode::INVALID_ARG) << "invalid sample rate: " << sampleRate; } } @@ -589,7 +589,7 @@ Result DefaultVehicleHal::checkSubscribeOptions( // Non-global property. for (int32_t areaId : option.areaIds) { if (auto areaConfig = getAreaConfig(propId, areaId, config); areaConfig == nullptr) { - return Error(toInt(StatusCode::INVALID_ARG)) + return StatusError(StatusCode::INVALID_ARG) << StringPrintf("invalid area ID: %" PRId32 " for prop ID: %" PRId32 ", not listed in config", areaId, propId); @@ -662,33 +662,35 @@ IVehicleHardware* DefaultVehicleHal::getHardware() { return mVehicleHardware.get(); } -Result DefaultVehicleHal::checkWritePermission(const VehiclePropValue& value) const { +Result DefaultVehicleHal::checkWritePermission( + const VehiclePropValue& value) const { int32_t propId = value.prop; auto result = getConfig(propId); if (!result.ok()) { - return Error(toInt(StatusCode::INVALID_ARG)) << getErrorMsg(result); + return StatusError(StatusCode::INVALID_ARG) << getErrorMsg(result); } const VehiclePropConfig* config = result.value(); if (config->access != VehiclePropertyAccess::WRITE && config->access != VehiclePropertyAccess::READ_WRITE) { - return Error(toInt(StatusCode::ACCESS_DENIED)) + return StatusError(StatusCode::ACCESS_DENIED) << StringPrintf("Property %" PRId32 " has no write access", propId); } return {}; } -Result DefaultVehicleHal::checkReadPermission(const VehiclePropValue& value) const { +Result DefaultVehicleHal::checkReadPermission( + const VehiclePropValue& value) const { int32_t propId = value.prop; auto result = getConfig(propId); if (!result.ok()) { - return Error(toInt(StatusCode::INVALID_ARG)) << getErrorMsg(result); + return StatusError(StatusCode::INVALID_ARG) << getErrorMsg(result); } const VehiclePropConfig* config = result.value(); if (config->access != VehiclePropertyAccess::READ && config->access != VehiclePropertyAccess::READ_WRITE) { - return Error(toInt(StatusCode::ACCESS_DENIED)) + return StatusError(StatusCode::ACCESS_DENIED) << StringPrintf("Property %" PRId32 " has no read access", propId); } return {}; -- GitLab From a6e579a4589f583ae5af1a365880f08d65f818a3 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Sun, 27 Feb 2022 11:40:24 -0800 Subject: [PATCH 674/825] Remove GnssHidlHal from default implementation Since all HALs are in AIDL, HIDL implementation is no longer needed. Bug: 201253590 Test: on Cuttlefish Change-Id: Iaefe72760999ace6a9d3dc682a5b457c03a75746 --- gnss/aidl/default/Android.bp | 3 -- gnss/aidl/default/GnssHidlHal.cpp | 65 -------------------------- gnss/aidl/default/GnssHidlHal.h | 42 ----------------- gnss/aidl/default/gnss@2.1-service.xml | 12 ----- gnss/aidl/default/service.cpp | 11 ----- 5 files changed, 133 deletions(-) delete mode 100644 gnss/aidl/default/GnssHidlHal.cpp delete mode 100644 gnss/aidl/default/GnssHidlHal.h delete mode 100644 gnss/aidl/default/gnss@2.1-service.xml diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index 4543665346..c8ae6b263d 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -31,7 +31,6 @@ cc_binary { ], vintf_fragments: [ "gnss-default.xml", - "gnss@2.1-service.xml", ], vendor: true, cflags: [ @@ -47,7 +46,6 @@ cc_binary { "liblog", "android.hardware.gnss@2.1", "android.hardware.gnss@2.0", - "android.hardware.gnss@1.1", "android.hardware.gnss@1.0", "android.hardware.gnss.measurement_corrections@1.1", "android.hardware.gnss.measurement_corrections@1.0", @@ -62,7 +60,6 @@ cc_binary { "GnssBatching.cpp", "GnssDebug.cpp", "GnssGeofence.cpp", - "GnssHidlHal.cpp", "GnssNavigationMessageInterface.cpp", "GnssPowerIndication.cpp", "GnssPsds.cpp", diff --git a/gnss/aidl/default/GnssHidlHal.cpp b/gnss/aidl/default/GnssHidlHal.cpp deleted file mode 100644 index 10b0106f32..0000000000 --- a/gnss/aidl/default/GnssHidlHal.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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. - */ - -#define LOG_TAG "GnssHidlHal" - -#include "GnssHidlHal.h" - -namespace aidl::android::hardware::gnss { - -using GnssSvInfo = ::android::hardware::gnss::V2_1::IGnssCallback::GnssSvInfo; - -GnssHidlHal::GnssHidlHal(const std::shared_ptr& gnssAidl) : mGnssAidl(gnssAidl) { - Gnss* iGnss = mGnssAidl.get(); - std::shared_ptr iGnssConfiguration; - auto status = iGnss->getExtensionGnssConfiguration(&iGnssConfiguration); - if (!status.isOk()) { - ALOGE("Failed to getExtensionGnssConfiguration."); - } else { - mGnssConfigurationAidl = iGnss->mGnssConfiguration; - } - - std::shared_ptr iGnssPowerIndication; - status = iGnss->getExtensionGnssPowerIndication(&iGnssPowerIndication); - if (!status.isOk()) { - ALOGE("Failed to getExtensionGnssPowerIndication."); - } else { - mGnssPowerIndicationAidl = iGnss->mGnssPowerIndication; - } -}; - -hidl_vec GnssHidlHal::filterBlocklistedSatellitesV2_1( - hidl_vec gnssSvInfoList) { - if (mGnssConfigurationAidl == nullptr) { - ALOGE("Handle to AIDL GnssConfiguration is not available."); - return gnssSvInfoList; - } - for (uint32_t i = 0; i < gnssSvInfoList.size(); i++) { - if (mGnssConfigurationAidl->isBlocklistedV2_1(gnssSvInfoList[i])) { - ALOGD("Blocklisted constellation: %d, svid: %d", - (int)gnssSvInfoList[i].v2_0.constellation, gnssSvInfoList[i].v2_0.v1_0.svid); - gnssSvInfoList[i].v2_0.v1_0.svFlag &= ~static_cast( - ::android::hardware::gnss::V1_0::IGnssCallback::GnssSvFlags::USED_IN_FIX); - } - } - return gnssSvInfoList; -} - -void GnssHidlHal::notePowerConsumption() { - mGnssPowerIndicationAidl->notePowerConsumption(); -} - -} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/GnssHidlHal.h b/gnss/aidl/default/GnssHidlHal.h deleted file mode 100644 index 5fb4f972de..0000000000 --- a/gnss/aidl/default/GnssHidlHal.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -#pragma once - -#include "Gnss.h" -#include "GnssConfiguration.h" -#include "v2_1/GnssTemplate.h" - -namespace aidl::android::hardware::gnss { - -class GnssHidlHal : public ::android::hardware::gnss::common::implementation::GnssTemplate< - ::android::hardware::gnss::V2_1::IGnss> { - public: - GnssHidlHal(const std::shared_ptr& gnssAidl); - - private: - hidl_vec<::android::hardware::gnss::V2_1::IGnssCallback::GnssSvInfo> - filterBlocklistedSatellitesV2_1( - hidl_vec<::android::hardware::gnss::V2_1::IGnssCallback::GnssSvInfo> gnssSvInfoList) - override; - void notePowerConsumption() override; - - std::shared_ptr mGnssAidl; - std::shared_ptr mGnssConfigurationAidl; - std::shared_ptr mGnssPowerIndicationAidl; -}; - -} // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/gnss@2.1-service.xml b/gnss/aidl/default/gnss@2.1-service.xml deleted file mode 100644 index 12a1fdfa08..0000000000 --- a/gnss/aidl/default/gnss@2.1-service.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - android.hardware.gnss - hwbinder - 2.1 - 1.1 - - IGnss - default - - - diff --git a/gnss/aidl/default/service.cpp b/gnss/aidl/default/service.cpp index bbe34f1a28..162532be79 100644 --- a/gnss/aidl/default/service.cpp +++ b/gnss/aidl/default/service.cpp @@ -24,15 +24,12 @@ #include #include #include "Gnss.h" -#include "GnssHidlHal.h" using aidl::android::hardware::gnss::Gnss; -using aidl::android::hardware::gnss::GnssHidlHal; using ::android::OK; using ::android::sp; using ::android::hardware::configureRpcThreadpool; using ::android::hardware::joinRpcThreadpool; -using ::android::hardware::gnss::V2_1::IGnss; int main() { ABinderProcess_setThreadPoolMaxThreadCount(1); @@ -44,14 +41,6 @@ int main() { AServiceManager_addService(gnssAidl->asBinder().get(), instance.c_str()); CHECK_EQ(status, STATUS_OK); - sp gnss = new GnssHidlHal(gnssAidl); - configureRpcThreadpool(1, true /* will join */); - if (gnss->registerAsService() != OK) { - ALOGE("Could not register gnss 2.1 service."); - return 0; - } - - joinRpcThreadpool(); ABinderProcess_joinThreadPool(); return EXIT_FAILURE; // should not reach -- GitLab From 24f6d1d792f4fd1d67f0f3b90c95732fca0dcbf7 Mon Sep 17 00:00:00 2001 From: Etienne Ruffieux Date: Fri, 4 Mar 2022 14:09:08 +0000 Subject: [PATCH 675/825] Added platform to Bluetooth audio hardware interfaces Bug: 220306859 Test: atest Tag: #feature Change-Id: I965615a8cb8ad581e658cf9270571157c795eb60 --- bluetooth/1.0/Android.bp | 4 ++++ bluetooth/1.1/Android.bp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/bluetooth/1.0/Android.bp b/bluetooth/1.0/Android.bp index 8d023c01d7..20775dd282 100644 --- a/bluetooth/1.0/Android.bp +++ b/bluetooth/1.0/Android.bp @@ -21,4 +21,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.bluetooth", + ], } diff --git a/bluetooth/1.1/Android.bp b/bluetooth/1.1/Android.bp index 4feb28bd96..4ac20094bd 100644 --- a/bluetooth/1.1/Android.bp +++ b/bluetooth/1.1/Android.bp @@ -21,4 +21,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.bluetooth", + ], } -- GitLab From f46e1df10bf2eaab8cd658042d55cc3ae29ea209 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 25 Feb 2022 17:09:46 -0800 Subject: [PATCH 676/825] Clean up resource correctly when client died. Add proper lock to make sure that all resources would be cleaned up for a client if the client died. Also add check and not to allocate resources for an already dead client. Test: atest DefaultVehicleHalTest. Run manually and do not see 'failed to call callback' messages. Bug: 221500501 Change-Id: I1c799a6234017b976e7776537ab91526e785b9b4 --- .../utils/common/include/ConcurrentQueue.h | 3 +- .../impl/vhal/include/DefaultVehicleHal.h | 46 ++++-- .../aidl/impl/vhal/src/ConnectedClient.cpp | 22 +-- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 147 +++++++++++++----- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 101 ++++++++++-- 5 files changed, 242 insertions(+), 77 deletions(-) diff --git a/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h b/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h index 08b56a6a9f..327c0dc35d 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h @@ -33,12 +33,13 @@ namespace vehicle { template class ConcurrentQueue { public: - void waitForItems() { + bool waitForItems() { std::unique_lock lockGuard(mLock); android::base::ScopedLockAssertion lockAssertion(mLock); while (mQueue.empty() && mIsActive) { mCond.wait(lockGuard); } + return mIsActive; } std::vector flush() { diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index 84b6742282..2db7675fdd 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -22,6 +22,7 @@ #include "PendingRequestPool.h" #include "SubscriptionManager.h" +#include #include #include #include @@ -31,6 +32,7 @@ #include #include +#include #include #include @@ -105,6 +107,8 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi public: SubscriptionClients(std::shared_ptr pool) : mPendingRequestPool(pool) {} + std::shared_ptr maybeAddClient(const CallbackType& callback); + std::shared_ptr getClient(const CallbackType& callback); void removeClient(const AIBinder* clientId); @@ -119,20 +123,24 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi std::shared_ptr mPendingRequestPool; }; - // A wrapper for linkToDeath to enable stubbing for test. - class ILinkToDeath { + // A wrapper for binder operations to enable stubbing for test. + class IBinder { public: - virtual ~ILinkToDeath() = default; + virtual ~IBinder() = default; virtual binder_status_t linkToDeath(AIBinder* binder, AIBinder_DeathRecipient* recipient, void* cookie) = 0; + + virtual bool isAlive(const AIBinder* binder) = 0; }; - // A real implementation for ILinkToDeath. - class AIBinderLinkToDeathImpl final : public ILinkToDeath { + // A real implementation for IBinder. + class AIBinderImpl final : public IBinder { public: binder_status_t linkToDeath(AIBinder* binder, AIBinder_DeathRecipient* recipient, void* cookie) override; + + bool isAlive(const AIBinder* binder) override; }; // OnBinderDiedContext is a type used as a cookie passed deathRecipient. The deathRecipient's @@ -143,6 +151,13 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi const AIBinder* clientId; }; + // BinderDiedUnlinkedEvent represents either an onBinderDied or an onBinderUnlinked event. + struct BinderDiedUnlinkedEvent { + // true for onBinderDied, false for onBinderUnlinked. + bool onBinderDied; + const AIBinder* clientId; + }; + // The default timeout of get or set value requests is 30s. // TODO(b/214605968): define TIMEOUT_IN_NANO in IVehicle and allow getValues/setValues/subscribe // to specify custom timeouts. @@ -171,14 +186,20 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi GUARDED_BY(mLock); // SubscriptionClients is thread-safe. std::shared_ptr mSubscriptionClients; - // mLinkToDeathImpl is only going to be changed in test. - std::unique_ptr mLinkToDeathImpl; + // mBinderImpl is only going to be changed in test. + std::unique_ptr mBinderImpl; // RecurrentTimer is thread-safe. RecurrentTimer mRecurrentTimer; ndk::ScopedAIBinder_DeathRecipient mDeathRecipient; + // ConcurrentQueue is thread-safe. + ConcurrentQueue mBinderEvents; + + // A thread to handle onBinderDied or onBinderUnlinked event. + std::thread mOnBinderDiedUnlinkedHandlerThread; + android::base::Result checkProperty( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); @@ -207,10 +228,17 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi void onBinderUnlinkedWithContext(const AIBinder* clientId); - void monitorBinderLifeCycle(const CallbackType& callback); + // Registers a onBinderDied callback for the client if not already registered. + // Returns true if the client Binder is alive, false otherwise. + bool monitorBinderLifeCycleLocked(const AIBinder* clientId) REQUIRES(mLock); bool checkDumpPermission(); + // The looping handler function to process all onBinderDied or onBinderUnlinked events in + // mBinderEvents. + void onBinderDiedUnlinkedHandler(); + + // Gets or creates a {@code T} object for the client to or from {@code clients}. template static std::shared_ptr getOrCreateClient( std::unordered_map>* clients, @@ -239,7 +267,7 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi void setTimeout(int64_t timeoutInNano); // Test-only - void setLinkToDeathImpl(std::unique_ptr impl); + void setBinderImpl(std::unique_ptr impl); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp index 5c5f27e2e7..4cfc2be445 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp @@ -67,9 +67,10 @@ void sendGetOrSetValueResult(std::shared_ptr callback, const R parcelableResults.payloads[0] = result; if (ScopedAStatus callbackStatus = callCallback(callback, parcelableResults); !callbackStatus.isOk()) { - ALOGE("failed to call callback, error: %s, exception: %d, service specific error: %d", - callbackStatus.getMessage(), callbackStatus.getExceptionCode(), - callbackStatus.getServiceSpecificError()); + ALOGE("failed to call GetOrSetValueResult callback, client ID: %p, error: %s, " + "exception: %d, service specific error: %d", + callback->asBinder().get(), callbackStatus.getMessage(), + callbackStatus.getExceptionCode(), callbackStatus.getServiceSpecificError()); } } @@ -91,9 +92,10 @@ void sendGetOrSetValueResults(std::shared_ptr callback, if (status.isOk()) { if (ScopedAStatus callbackStatus = callCallback(callback, parcelableResults); !callbackStatus.isOk()) { - ALOGE("failed to call callback, error: %s, exception: %d, service specific error: %d", - callbackStatus.getMessage(), callbackStatus.getExceptionCode(), - callbackStatus.getServiceSpecificError()); + ALOGE("failed to call GetOrSetValueResults callback, client ID: %p, error: %s, " + "exception: %d, service specific error: %d", + callback->asBinder().get(), callbackStatus.getMessage(), + callbackStatus.getExceptionCode(), callbackStatus.getServiceSpecificError()); } return; } @@ -299,10 +301,10 @@ void SubscriptionClient::sendUpdatedValues(std::shared_ptr cal if (ScopedAStatus callbackStatus = callback->onPropertyEvent(vehiclePropValues, sharedMemoryFileCount); !callbackStatus.isOk()) { - ALOGE("subscribe: failed to call callback, error: %s, exception: %d, " - "service specific error: %d", - callbackStatus.getMessage(), callbackStatus.getExceptionCode(), - callbackStatus.getServiceSpecificError()); + ALOGE("subscribe: failed to call UpdateValues callback, client ID: %p, error: %s, " + "exception: %d, service specific error: %d", + callback->asBinder().get(), callbackStatus.getMessage(), + callbackStatus.getExceptionCode(), callbackStatus.getServiceSpecificError()); } } diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index b50571b0c7..886f89733f 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -80,12 +80,22 @@ std::string toString(const std::unordered_set& values) { } // namespace -std::shared_ptr DefaultVehicleHal::SubscriptionClients::getClient( +std::shared_ptr DefaultVehicleHal::SubscriptionClients::maybeAddClient( const CallbackType& callback) { std::scoped_lock lockGuard(mLock); return getOrCreateClient(&mClients, callback, mPendingRequestPool); } +std::shared_ptr DefaultVehicleHal::SubscriptionClients::getClient( + const CallbackType& callback) { + std::scoped_lock 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 lockGuard(mLock); // This would be initialized to 0 if callback does not exist in the map. @@ -148,7 +158,8 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) checkHealth(hardwareCopy, subscriptionManagerCopy); })); - mLinkToDeathImpl = std::make_unique(); + mBinderImpl = std::make_unique(); + mOnBinderDiedUnlinkedHandlerThread = std::thread([this] { onBinderDiedUnlinkedHandler(); }); mDeathRecipient = ScopedAIBinder_DeathRecipient( AIBinder_DeathRecipient_new(&DefaultVehicleHal::onBinderDied)); AIBinder_DeathRecipient_setOnUnlinked(mDeathRecipient.get(), @@ -158,6 +169,10 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) DefaultVehicleHal::~DefaultVehicleHal() { // Delete the deathRecipient so that onBinderDied would not be called to reference 'this'. mDeathRecipient = ScopedAIBinder_DeathRecipient(); + mBinderEvents.deactivate(); + if (mOnBinderDiedUnlinkedHandlerThread.joinable()) { + mOnBinderDiedUnlinkedHandlerThread.join(); + } } void DefaultVehicleHal::onPropertyChangeEvent( @@ -189,37 +204,41 @@ std::shared_ptr DefaultVehicleHal::getOrCreateClient( return (*clients)[clientId]; } -void DefaultVehicleHal::monitorBinderLifeCycle(const CallbackType& callback) { - AIBinder* clientId = callback->asBinder().get(); - { - std::scoped_lock lockGuard(mLock); - if (mOnBinderDiedContexts.find(clientId) != mOnBinderDiedContexts.end()) { - // Already registered. - return; - } +bool DefaultVehicleHal::monitorBinderLifeCycleLocked(const AIBinder* clientId) { + OnBinderDiedContext* contextPtr = nullptr; + if (mOnBinderDiedContexts.find(clientId) != mOnBinderDiedContexts.end()) { + return mBinderImpl->isAlive(clientId); + } else { + std::unique_ptr context = std::make_unique( + OnBinderDiedContext{.vhal = this, .clientId = clientId}); + // We know context must be alive when we use contextPtr because context would only + // be removed in OnBinderUnlinked, which must be called after OnBinderDied. + contextPtr = context.get(); + // Insert into a map to keep the context object alive. + mOnBinderDiedContexts[clientId] = std::move(context); } - std::unique_ptr context = std::make_unique( - OnBinderDiedContext{.vhal = this, .clientId = clientId}); - binder_status_t status = mLinkToDeathImpl->linkToDeath(clientId, mDeathRecipient.get(), - static_cast(context.get())); + // If this function fails, onBinderUnlinked would be called to remove the added context. + binder_status_t status = mBinderImpl->linkToDeath( + const_cast(clientId), mDeathRecipient.get(), static_cast(contextPtr)); if (status == STATUS_OK) { - std::scoped_lock lockGuard(mLock); - // Insert into a map to keep the context object alive. - mOnBinderDiedContexts[clientId] = std::move(context); - } else { - ALOGE("failed to call linkToDeath on client binder, status: %d", static_cast(status)); + return true; } + ALOGE("failed to call linkToDeath on client binder, client may already died, status: %d", + static_cast(status)); + return false; } void DefaultVehicleHal::onBinderDied(void* cookie) { OnBinderDiedContext* context = reinterpret_cast(cookie); - context->vhal->onBinderDiedWithContext(context->clientId); + // To be handled in mOnBinderDiedUnlinkedHandlerThread. We cannot handle the event in the same + // thread because we might be holding the mLock the handler requires. + context->vhal->mBinderEvents.push(BinderDiedUnlinkedEvent{true, context->clientId}); } void DefaultVehicleHal::onBinderDiedWithContext(const AIBinder* clientId) { - ALOGD("binder died"); std::scoped_lock lockGuard(mLock); + ALOGD("binder died, client ID: %p", clientId); mSetValuesClients.erase(clientId); mGetValuesClients.erase(clientId); mSubscriptionClients->removeClient(clientId); @@ -227,17 +246,31 @@ void DefaultVehicleHal::onBinderDiedWithContext(const AIBinder* clientId) { } void DefaultVehicleHal::onBinderUnlinked(void* cookie) { - // Delete the context associated with this cookie. OnBinderDiedContext* context = reinterpret_cast(cookie); - context->vhal->onBinderUnlinkedWithContext(context->clientId); + // To be handled in mOnBinderDiedUnlinkedHandlerThread. We cannot handle the event in the same + // thread because we might be holding the mLock the handler requires. + context->vhal->mBinderEvents.push(BinderDiedUnlinkedEvent{false, context->clientId}); } void DefaultVehicleHal::onBinderUnlinkedWithContext(const AIBinder* clientId) { ALOGD("binder unlinked"); std::scoped_lock lockGuard(mLock); + // Delete the context associated with this cookie. mOnBinderDiedContexts.erase(clientId); } +void DefaultVehicleHal::onBinderDiedUnlinkedHandler() { + while (mBinderEvents.waitForItems()) { + for (BinderDiedUnlinkedEvent& event : mBinderEvents.flush()) { + if (event.onBinderDied) { + onBinderDiedWithContext(event.clientId); + } else { + onBinderUnlinkedWithContext(event.clientId); + } + } + } +} + template std::shared_ptr DefaultVehicleHal::getOrCreateClient( std::unordered_map>* clients, @@ -258,6 +291,10 @@ void DefaultVehicleHal::getValueFromHardwareCallCallback( const VehiclePropValue& value) { int64_t subscribeId = subscribeIdByClient->getId(callback); auto client = subscriptionClients->getClient(callback); + if (client == nullptr) { + ALOGW("subscribe[%" PRId64 "]: the client has died", subscribeId); + return; + } if (auto addRequestResult = client->addRequests({subscribeId}); !addRequestResult.ok()) { ALOGE("subscribe[%" PRId64 "]: too many pending requests, ignore the getValue request", subscribeId); @@ -336,8 +373,6 @@ Result DefaultVehicleHal::checkProperty(const VehiclePropValue& propValue) ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, const GetValueRequests& requests) { - monitorBinderLifeCycle(callback); - expected, ScopedAStatus> deserializedResults = fromStableLargeParcelable(requests); if (!deserializedResults.ok()) { @@ -379,9 +414,16 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, std::shared_ptr client; { - std::scoped_lock lockGuard(mLock); + // Lock to make sure onBinderDied would not be called concurrently. + std::scoped_lock lockGuard(mLock); + if (!monitorBinderLifeCycleLocked(callback->asBinder().get())) { + return ScopedAStatus::fromExceptionCodeWithMessage(EX_TRANSACTION_FAILED, + "client died"); + } + client = getOrCreateClient(&mGetValuesClients, callback, mPendingRequestPool); } + // Register the pending hardware requests and also check for duplicate request Ids. if (auto addRequestResult = client->addRequests(hardwareRequestIds); !addRequestResult.ok()) { ALOGE("getValues[%s]: failed to add pending requests, error: %s", @@ -414,8 +456,6 @@ ScopedAStatus DefaultVehicleHal::getValues(const CallbackType& callback, ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, const SetValueRequests& requests) { - monitorBinderLifeCycle(callback); - expected, ScopedAStatus> deserializedResults = fromStableLargeParcelable(requests); if (!deserializedResults.ok()) { @@ -467,7 +507,12 @@ ScopedAStatus DefaultVehicleHal::setValues(const CallbackType& callback, std::shared_ptr client; { - std::scoped_lock lockGuard(mLock); + // Lock to make sure onBinderDied would not be called concurrently. + std::scoped_lock lockGuard(mLock); + if (!monitorBinderLifeCycleLocked(callback->asBinder().get())) { + return ScopedAStatus::fromExceptionCodeWithMessage(EX_TRANSACTION_FAILED, + "client died"); + } client = getOrCreateClient(&mSetValuesClients, callback, mPendingRequestPool); } @@ -602,8 +647,6 @@ Result DefaultVehicleHal::checkSubscribeOptions( ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, const std::vector& options, [[maybe_unused]] int32_t maxSharedMemoryFileCount) { - monitorBinderLifeCycle(callback); - // TODO(b/205189110): Use shared memory file count. if (auto result = checkSubscribeOptions(options); !result.ok()) { ALOGE("subscribe: invalid subscribe options: %s", getErrorMsg(result).c_str()); @@ -635,14 +678,27 @@ ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, onChangeSubscriptions.push_back(std::move(optionCopy)); } } - // Since we have already check the sample rates, the following functions must succeed. - if (!onChangeSubscriptions.empty()) { - mSubscriptionManager->subscribe(callback, onChangeSubscriptions, - /*isContinuousProperty=*/false); - } - if (!continuousSubscriptions.empty()) { - mSubscriptionManager->subscribe(callback, continuousSubscriptions, - /*isContinuousProperty=*/true); + + { + // Lock to make sure onBinderDied would not be called concurrently. + std::scoped_lock lockGuard(mLock); + if (!monitorBinderLifeCycleLocked(callback->asBinder().get())) { + return ScopedAStatus::fromExceptionCodeWithMessage(EX_TRANSACTION_FAILED, + "client died"); + } + + // Create a new SubscriptionClient if there isn't an existing one. + mSubscriptionClients->maybeAddClient(callback); + + // Since we have already check the sample rates, the following functions must succeed. + if (!onChangeSubscriptions.empty()) { + mSubscriptionManager->subscribe(callback, onChangeSubscriptions, + /*isContinuousProperty=*/false); + } + if (!continuousSubscriptions.empty()) { + mSubscriptionManager->subscribe(callback, continuousSubscriptions, + /*isContinuousProperty=*/true); + } } return ScopedAStatus::ok(); } @@ -719,13 +775,18 @@ void DefaultVehicleHal::checkHealth(std::weak_ptr hardware, return; } -binder_status_t DefaultVehicleHal::AIBinderLinkToDeathImpl::linkToDeath( - AIBinder* binder, AIBinder_DeathRecipient* recipient, void* cookie) { +binder_status_t DefaultVehicleHal::AIBinderImpl::linkToDeath(AIBinder* binder, + AIBinder_DeathRecipient* recipient, + void* cookie) { return AIBinder_linkToDeath(binder, recipient, cookie); } -void DefaultVehicleHal::setLinkToDeathImpl(std::unique_ptr impl) { - mLinkToDeathImpl = std::move(impl); +bool DefaultVehicleHal::AIBinderImpl::isAlive(const AIBinder* binder) { + return AIBinder_isAlive(binder); +} + +void DefaultVehicleHal::setBinderImpl(std::unique_ptr impl) { + mBinderImpl = std::move(impl); } bool DefaultVehicleHal::checkDumpPermission() { diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index aafa17ecb2..6f8eb1dab3 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -332,7 +332,9 @@ class DefaultVehicleHalTest : public testing::Test { mCallbackClient = IVehicleCallback::fromBinder(mBinder); // Set the linkToDeath to a fake implementation that always returns OK. - setTestLinkToDeathImpl(); + auto binderImpl = std::make_unique(); + mBinderImpl = binderImpl.get(); + mVhal->setBinderImpl(std::move(binderImpl)); } void TearDown() override { @@ -350,10 +352,6 @@ class DefaultVehicleHalTest : public testing::Test { void setTimeout(int64_t timeoutInNano) { mVhal->setTimeout(timeoutInNano); } - void setTestLinkToDeathImpl() { - mVhal->setLinkToDeathImpl(std::make_unique()); - } - size_t countPendingRequests() { return mVhal->mPendingRequestPool->countPendingRequests(); } size_t countClients() { @@ -380,6 +378,8 @@ class DefaultVehicleHalTest : public testing::Test { bool hasNoSubscriptions() { return mVhal->mSubscriptionManager->isEmpty(); } + void setBinderAlive(bool isAlive) { mBinderImpl->setAlive(isAlive); }; + static Result getValuesTestCases(size_t size, GetValueRequests& requests, std::vector& expectedResults, std::vector& expectedHardwareRequests) { @@ -452,19 +452,31 @@ class DefaultVehicleHalTest : public testing::Test { } private: + class TestBinderImpl final : public DefaultVehicleHal::IBinder { + public: + binder_status_t linkToDeath(AIBinder*, AIBinder_DeathRecipient*, void*) override { + if (mIsAlive) { + return STATUS_OK; + } else { + return STATUS_FAILED_TRANSACTION; + } + } + + bool isAlive(const AIBinder*) override { return mIsAlive; } + + void setAlive(bool isAlive) { mIsAlive = isAlive; } + + private: + bool mIsAlive = true; + }; + std::shared_ptr mVhal; std::shared_ptr mVhalClient; MockVehicleHardware* mHardwarePtr; std::shared_ptr mCallback; std::shared_ptr mCallbackClient; SpAIBinder mBinder; - - class TestLinkToDeathImpl final : public DefaultVehicleHal::ILinkToDeath { - public: - binder_status_t linkToDeath(AIBinder*, AIBinder_DeathRecipient*, void*) override { - return STATUS_OK; - } - }; + TestBinderImpl* mBinderImpl; }; TEST_F(DefaultVehicleHalTest, testGetAllPropConfigsSmall) { @@ -587,7 +599,6 @@ TEST_F(DefaultVehicleHalTest, testGetValuesLarge) { ASSERT_TRUE(getValuesTestCases(5000, requests, expectedResults, expectedHardwareRequests).ok()) << "requests to hardware mismatch"; - ; getHardware()->addGetValueResponses(expectedResults); @@ -806,6 +817,51 @@ TEST_F(DefaultVehicleHalTest, testGetValuesDuplicateRequestProps) { ASSERT_FALSE(status.isOk()) << "duplicate request properties in one request must fail"; } +TEST_F(DefaultVehicleHalTest, testGetValuesNewClientDied) { + GetValueRequests requests; + std::vector expectedResults; + std::vector expectedHardwareRequests; + + ASSERT_TRUE(getValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok()); + + getHardware()->addGetValueResponses(expectedResults); + + setBinderAlive(false); + + auto status = getClient()->getValues(getCallbackClient(), requests); + + ASSERT_FALSE(status.isOk()) << "getValues must fail if client died"; + ASSERT_EQ(status.getExceptionCode(), EX_TRANSACTION_FAILED); + EXPECT_EQ(countClients(), static_cast(0)) + << "No client should be created if the client binder died"; +} + +TEST_F(DefaultVehicleHalTest, testGetValuesExistingClientDied) { + GetValueRequests requests; + std::vector expectedResults; + std::vector expectedHardwareRequests; + + ASSERT_TRUE(getValuesTestCases(10, requests, expectedResults, expectedHardwareRequests).ok()); + + getHardware()->addGetValueResponses(expectedResults); + + // Try a normal getValue request to cache a GetValueClient first. + auto status = getClient()->getValues(getCallbackClient(), requests); + + ASSERT_TRUE(status.isOk()) << "getValues failed: " << status.getMessage(); + EXPECT_EQ(countClients(), static_cast(1)); + + // The client binder died before onBinderUnlinked clean up the GetValueClient. + setBinderAlive(false); + + status = getClient()->getValues(getCallbackClient(), requests); + + ASSERT_FALSE(status.isOk()) << "getValues must fail if client died"; + ASSERT_EQ(status.getExceptionCode(), EX_TRANSACTION_FAILED); + // The client count should still be 1 but onBinderUnlinked will remove this later. + EXPECT_EQ(countClients(), static_cast(1)); +} + TEST_F(DefaultVehicleHalTest, testSetValuesSmall) { SetValueRequests requests; std::vector expectedResults; @@ -1111,7 +1167,8 @@ TEST_F(DefaultVehicleHalTest, testSubscribeGlobalOnChangeNormal) { << "results mismatch, expect on change event for the updated value"; ASSERT_FALSE(getCallback()->nextOnPropertyEventResults().has_value()) << "more results than expected"; - EXPECT_EQ(countClients(), static_cast(1)); + EXPECT_EQ(countClients(), static_cast(2)) + << "expect 2 clients, 1 subscribe client and 1 setvalue client"; } TEST_F(DefaultVehicleHalTest, testSubscribeGlobalOnchangeUnrelatedEventIgnored) { @@ -1581,12 +1638,28 @@ TEST_F(DefaultVehicleHalTest, testOnBinderDiedUnlinked) { onBinderDied(context); + // Sleep for 100ms between checks. + int64_t sleep = 100; + // Timeout: 10s. + int64_t timeout = 10'000'000'000; + int64_t stopTime = elapsedRealtimeNano() + timeout; + // Wait until the onBinderDied event is handled. + while (countClients() != 0u && elapsedRealtimeNano() <= stopTime) { + std::this_thread::sleep_for(std::chrono::milliseconds(sleep)); + } + ASSERT_EQ(countClients(), static_cast(0)) << "expect all clients to be removed when binder died"; ASSERT_TRUE(hasNoSubscriptions()) << "expect no subscriptions when binder died"; onBinderUnlinked(context); + stopTime = elapsedRealtimeNano() + timeout; + // Wait until the onBinderUnlinked event is handled. + while (countOnBinderDiedContexts() != 0u && elapsedRealtimeNano() <= stopTime) { + std::this_thread::sleep_for(std::chrono::milliseconds(sleep)); + } + ASSERT_EQ(countOnBinderDiedContexts(), static_cast(0)) << "expect OnBinderDied context to be deleted when binder is unlinked"; } -- GitLab From 726d51a697eecc37b1ad5d30a2919f4661e36a45 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 22 Feb 2022 17:37:21 -0800 Subject: [PATCH 677/825] Migrate VHAL VTS to be AIDL compatible. Migrate VHAL VTS to be compatible with both HIDL and AIDL VHAL. The test cases remains the same. Test: atest VtsHalAutomotiveVehicle_TargetTest Bug: 216736141 Change-Id: I5010b9c205656187e890b91dadc69e97ddc96862 --- .../vehicle/2.0/vts/functional/Android.bp | 30 -- .../VtsHalAutomotiveVehicleV2_0TargetTest.cpp | 263 ------------- automotive/vehicle/TEST_MAPPING | 5 + automotive/vehicle/vts/Android.bp | 40 ++ .../{2.0/vts/functional => vts}/OWNERS | 1 + .../VtsHalAutomotiveVehicle_TargetTest.cpp | 364 ++++++++++++++++++ 6 files changed, 410 insertions(+), 293 deletions(-) delete mode 100644 automotive/vehicle/2.0/vts/functional/Android.bp delete mode 100644 automotive/vehicle/2.0/vts/functional/VtsHalAutomotiveVehicleV2_0TargetTest.cpp create mode 100644 automotive/vehicle/vts/Android.bp rename automotive/vehicle/{2.0/vts/functional => vts}/OWNERS (71%) create mode 100644 automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp diff --git a/automotive/vehicle/2.0/vts/functional/Android.bp b/automotive/vehicle/2.0/vts/functional/Android.bp deleted file mode 100644 index e64e942a0e..0000000000 --- a/automotive/vehicle/2.0/vts/functional/Android.bp +++ /dev/null @@ -1,30 +0,0 @@ -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: "VtsHalAutomotiveVehicleV2_0TargetTest", - defaults: [ - "VtsHalTargetTestDefaults", - ], - srcs: [ - "VtsHalAutomotiveVehicleV2_0TargetTest.cpp", - ], - shared_libs: [ - "libbase", - "libhidlbase", - "liblog", - ], - static_libs: [ - "android.hardware.automotive.vehicle@2.0", - ], - test_suites: [ - "vts", - "general-tests", - ], -} diff --git a/automotive/vehicle/2.0/vts/functional/VtsHalAutomotiveVehicleV2_0TargetTest.cpp b/automotive/vehicle/2.0/vts/functional/VtsHalAutomotiveVehicleV2_0TargetTest.cpp deleted file mode 100644 index 8adec8486f..0000000000 --- a/automotive/vehicle/2.0/vts/functional/VtsHalAutomotiveVehicleV2_0TargetTest.cpp +++ /dev/null @@ -1,263 +0,0 @@ -/* - * 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. - */ - -#define LOG_TAG "VtsHalAutomotiveVehicle" - -#include -#include -#include - -#include -#include -#include - -using namespace android::hardware::automotive::vehicle::V2_0; -using ::android::sp; -using ::android::hardware::hidl_vec; -using ::android::hardware::Return; - -constexpr auto kTimeout = std::chrono::milliseconds(500); -constexpr auto kInvalidProp = 0x31600207; - -class VtsVehicleCallback : public IVehicleCallback { - private: - using MutexGuard = std::lock_guard; - using HidlVecOfValues = hidl_vec; - std::mutex mLock; - std::condition_variable mEventCond; - std::vector mReceivedEvents; - - public: - Return onPropertyEvent(const hidl_vec& values) override { - { - MutexGuard guard(mLock); - mReceivedEvents.push_back(values); - } - mEventCond.notify_one(); - return Return(); - } - - Return onPropertySet(const VehiclePropValue& /* value */) override { - return Return(); - } - Return onPropertySetError(StatusCode /* errorCode */, int32_t /* propId */, - int32_t /* areaId */) override { - return Return(); - } - - bool waitForExpectedEvents(size_t expectedEvents) { - std::unique_lock g(mLock); - - if (expectedEvents == 0 && mReceivedEvents.size() == 0) { - return mEventCond.wait_for(g, kTimeout) == std::cv_status::timeout; - } - - while (expectedEvents != mReceivedEvents.size()) { - if (mEventCond.wait_for(g, kTimeout) == std::cv_status::timeout) { - return false; - } - } - return true; - } - - void reset() { mReceivedEvents.clear(); } -}; - -class VehicleHalHidlTest : public testing::TestWithParam { - public: - virtual void SetUp() override { - mVehicle = IVehicle::getService(GetParam()); - ASSERT_NE(mVehicle.get(), nullptr); - } - virtual void TearDown() override {} - - sp mVehicle; - - bool isBooleanGlobalProp(int32_t property) { - return (property & (int)VehiclePropertyType::MASK) == (int)VehiclePropertyType::BOOLEAN && - (property & (int)VehicleArea::MASK) == (int)VehicleArea::GLOBAL; - } - - void invokeGet(int32_t property, int32_t areaId) { - VehiclePropValue requestedValue{}; - requestedValue.prop = property; - requestedValue.areaId = areaId; - - invokeGet(requestedValue); - } - - void invokeGet(const VehiclePropValue& requestedPropValue) { - mActualValue = VehiclePropValue{}; // reset previous values - - StatusCode refStatus; - VehiclePropValue refValue; - bool isCalled = false; - mVehicle->get(requestedPropValue, - [&refStatus, &refValue, &isCalled](StatusCode status, - const VehiclePropValue& value) { - refStatus = status; - refValue = value; - isCalled = true; - }); - ASSERT_TRUE(isCalled) << "callback wasn't called for property: " << requestedPropValue.prop; - - mActualValue = refValue; - mActualStatusCode = refStatus; - } - - VehiclePropValue mActualValue; - StatusCode mActualStatusCode; -}; - -// Test getAllPropConfig() returns at least 4 property configs. -TEST_P(VehicleHalHidlTest, getAllPropConfigs) { - ALOGD("VehicleHalHidlTest::getAllPropConfigs"); - bool isCalled = false; - hidl_vec propConfigs; - mVehicle->getAllPropConfigs([&isCalled, &propConfigs](const hidl_vec& cfgs) { - propConfigs = cfgs; - isCalled = true; - }); - ASSERT_TRUE(isCalled); - ASSERT_GE(propConfigs.size(), 4); -} - -// Test getPropConfig() can query all properties listed in CDD. -TEST_P(VehicleHalHidlTest, getPropConfigs) { - ALOGD("VehicleHalHidlTest::getPropConfigs"); - // Check the properties listed in CDD - hidl_vec properties = { - (int)VehicleProperty::GEAR_SELECTION, (int)VehicleProperty::NIGHT_MODE, - (int)VehicleProperty::PARKING_BRAKE_ON, (int)VehicleProperty::PERF_VEHICLE_SPEED}; - bool isCalled = false; - mVehicle->getPropConfigs( - properties, [&isCalled](StatusCode status, const hidl_vec& cfgs) { - ASSERT_EQ(StatusCode::OK, status); - ASSERT_EQ(4u, cfgs.size()); - isCalled = true; - }); - ASSERT_TRUE(isCalled); -} - -// Test getPropConfig() with an invalid propertyId returns an error code. -TEST_P(VehicleHalHidlTest, getPropConfigsWithInvalidProp) { - ALOGD("VehicleHalHidlTest::getPropConfigsWithInvalidProp"); - hidl_vec properties = {kInvalidProp}; - bool isCalled = false; - mVehicle->getPropConfigs( - properties, [&isCalled](StatusCode status, const hidl_vec& cfgs) { - ASSERT_NE(StatusCode::OK, status); - ASSERT_EQ(0, cfgs.size()); - isCalled = true; - }); - ASSERT_TRUE(isCalled); -} - -// Test get() return current value for properties. -TEST_P(VehicleHalHidlTest, get) { - ALOGD("VehicleHalHidlTest::get"); - invokeGet((int)VehicleProperty::PERF_VEHICLE_SPEED, 0); - ASSERT_EQ(StatusCode::OK, mActualStatusCode); -} - -// Test get() with an invalid propertyId return an error codes. -TEST_P(VehicleHalHidlTest, getInvalidProp) { - ALOGD("VehicleHalHidlTest::getInvalidProp"); - - invokeGet(kInvalidProp, 0); - ASSERT_NE(StatusCode::OK, mActualStatusCode); -} - -// Test set() on read_write properties. -TEST_P(VehicleHalHidlTest, setProp) { - ALOGD("VehicleHalHidlTest::setProp"); - hidl_vec propConfigs; - // skip hvac related properties - std::unordered_set hvacProps = {(int)VehicleProperty::HVAC_DEFROSTER, - (int)VehicleProperty::HVAC_AC_ON, - (int)VehicleProperty::HVAC_MAX_AC_ON, - (int)VehicleProperty::HVAC_MAX_DEFROST_ON, - (int)VehicleProperty::HVAC_RECIRC_ON, - (int)VehicleProperty::HVAC_DUAL_ON, - (int)VehicleProperty::HVAC_AUTO_ON, - (int)VehicleProperty::HVAC_POWER_ON, - (int)VehicleProperty::HVAC_AUTO_RECIRC_ON, - (int)VehicleProperty::HVAC_ELECTRIC_DEFROSTER_ON}; - mVehicle->getAllPropConfigs( - [&propConfigs](const hidl_vec& cfgs) { propConfigs = cfgs; }); - for (const VehiclePropConfig& cfg : propConfigs) { - // test on boolean and writable property - if (cfg.access == VehiclePropertyAccess::READ_WRITE && isBooleanGlobalProp(cfg.prop) && - !hvacProps.count(cfg.prop)) { - invokeGet(cfg.prop, 0); - int setValue = mActualValue.value.int32Values[0] == 1 ? 0 : 1; - VehiclePropValue propToSet = mActualValue; - propToSet.value.int32Values[0] = setValue; - ASSERT_EQ(StatusCode::OK, mVehicle->set(propToSet)) - << "Invalid status code for setting property: " << cfg.prop; - // check set success - invokeGet(cfg.prop, 0); - ASSERT_EQ(StatusCode::OK, mActualStatusCode); - ASSERT_EQ(setValue, mActualValue.value.int32Values[0]) - << "Failed to set value for property: " << cfg.prop; - } - } -} - -// Test set() on an read_only property. -TEST_P(VehicleHalHidlTest, setNotWritableProp) { - ALOGD("VehicleHalHidlTest::setNotWritableProp"); - invokeGet(static_cast(VehicleProperty::PERF_VEHICLE_SPEED), 0); - ASSERT_EQ(StatusCode::OK, mActualStatusCode); - VehiclePropValue vehicleSpeed = mActualValue; - - ASSERT_EQ(StatusCode::ACCESS_DENIED, mVehicle->set(vehicleSpeed)); -} - -// Test subscribe() and unsubscribe(). -TEST_P(VehicleHalHidlTest, subscribeAndUnsubscribe) { - ALOGD("VehicleHalHidlTest::subscribeAndUnsubscribe"); - const auto prop = static_cast(VehicleProperty::PERF_VEHICLE_SPEED); - sp cb = new VtsVehicleCallback(); - - hidl_vec options = { - SubscribeOptions{.propId = prop, 100.0, .flags = SubscribeFlags::EVENTS_FROM_CAR}}; - - ASSERT_EQ(StatusCode::OK, mVehicle->subscribe(cb, options)); - ASSERT_TRUE(cb->waitForExpectedEvents(10)); - - ASSERT_EQ(StatusCode::OK, mVehicle->unsubscribe(cb, prop)); - cb->reset(); - ASSERT_FALSE(cb->waitForExpectedEvents(10)); -} - -// Test subscribe() with an invalid property. -TEST_P(VehicleHalHidlTest, subscribeInvalidProp) { - ALOGD("VehicleHalHidlTest::subscribeInvalidProp"); - - sp cb = new VtsVehicleCallback(); - - hidl_vec options = {SubscribeOptions{ - .propId = kInvalidProp, 10.0, .flags = SubscribeFlags::EVENTS_FROM_CAR}}; - - ASSERT_NE(StatusCode::OK, mVehicle->subscribe(cb, options)); -} - -GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VehicleHalHidlTest); -INSTANTIATE_TEST_SUITE_P( - PerInstance, VehicleHalHidlTest, - testing::ValuesIn(android::hardware::getAllHalInstanceNames(IVehicle::descriptor)), - android::hardware::PrintInstanceNameToString); diff --git a/automotive/vehicle/TEST_MAPPING b/automotive/vehicle/TEST_MAPPING index ff6f3be52b..7e425540f5 100644 --- a/automotive/vehicle/TEST_MAPPING +++ b/automotive/vehicle/TEST_MAPPING @@ -24,5 +24,10 @@ { "name": "DefaultVehicleHalTest" } + ], + "auto-presubmit": [ + { + "name": "VtsHalAutomotiveVehicle_TargetTest" + } ] } diff --git a/automotive/vehicle/vts/Android.bp b/automotive/vehicle/vts/Android.bp new file mode 100644 index 0000000000..c8276d780c --- /dev/null +++ b/automotive/vehicle/vts/Android.bp @@ -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. + */ + +cc_test { + name: "VtsHalAutomotiveVehicle_TargetTest", + srcs: [ + "src/*.cpp", + ], + static_libs: [ + "libgtest", + "libvhalclient", + ], + shared_libs: [ + "libhidlbase", + "libvndksupport", + ], + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + "vhalclient_defaults", + ], + test_suites: [ + "general-tests", + "vts", + ], + require_root: true, +} diff --git a/automotive/vehicle/2.0/vts/functional/OWNERS b/automotive/vehicle/vts/OWNERS similarity index 71% rename from automotive/vehicle/2.0/vts/functional/OWNERS rename to automotive/vehicle/vts/OWNERS index 8a0f2afdb8..c93a8439ee 100644 --- a/automotive/vehicle/2.0/vts/functional/OWNERS +++ b/automotive/vehicle/vts/OWNERS @@ -1,2 +1,3 @@ # Bug component: 533426 +shanyu@google.com kwangsudo@google.com diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp new file mode 100644 index 0000000000..32382f242c --- /dev/null +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -0,0 +1,364 @@ +/* + * 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. + */ + +#define LOG_TAG "VtsHalAutomotiveVehicle" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +using ::aidl::android::hardware::automotive::vehicle::IVehicle; +using ::aidl::android::hardware::automotive::vehicle::StatusCode; +using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; +using ::aidl::android::hardware::automotive::vehicle::VehicleArea; +using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; +using ::android::getAidlHalInstanceNames; +using ::android::base::ScopedLockAssertion; +using ::android::base::StringPrintf; +using ::android::frameworks::automotive::vhal::HalPropError; +using ::android::frameworks::automotive::vhal::IHalPropConfig; +using ::android::frameworks::automotive::vhal::IHalPropValue; +using ::android::frameworks::automotive::vhal::ISubscriptionCallback; +using ::android::frameworks::automotive::vhal::IVhalClient; +using ::android::hardware::getAllHalInstanceNames; +using ::android::hardware::Sanitize; +using ::android::hardware::automotive::vehicle::toInt; + +constexpr int32_t kInvalidProp = 0x31600207; + +struct ServiceDescriptor { + std::string name; + bool isAidlService; +}; + +class VtsVehicleCallback final : public ISubscriptionCallback { + private: + std::mutex mLock; + std::unordered_map mEventsCount GUARDED_BY(mLock); + std::condition_variable mEventCond; + + public: + void onPropertyEvent(const std::vector>& values) override { + { + std::lock_guard lockGuard(mLock); + for (auto& value : values) { + mEventsCount[value->getPropId()] += 1; + } + } + mEventCond.notify_one(); + } + + void onPropertySetError([[maybe_unused]] const std::vector& errors) override { + // Do nothing. + } + + template + bool waitForExpectedEvents(int32_t propId, size_t expectedEvents, + const std::chrono::duration& timeout) { + std::unique_lock uniqueLock(mLock); + return mEventCond.wait_for(uniqueLock, timeout, [this, propId, expectedEvents] { + ScopedLockAssertion lockAssertion(mLock); + return mEventsCount[propId] >= expectedEvents; + }); + } + + void reset() { + std::lock_guard lockGuard(mLock); + mEventsCount.clear(); + } +}; + +class VtsHalAutomotiveVehicleTargetTest : public testing::TestWithParam { + public: + virtual void SetUp() override { + auto descriptor = GetParam(); + if (descriptor.isAidlService) { + mVhalClient = IVhalClient::tryCreateAidlClient(descriptor.name.c_str()); + } else { + mVhalClient = IVhalClient::tryCreateHidlClient(descriptor.name.c_str()); + } + + ASSERT_NE(mVhalClient, nullptr) << "Failed to connect to VHAL"; + + mCallback = std::make_shared(); + } + + static bool isBooleanGlobalProp(int32_t property) { + return (property & toInt(VehiclePropertyType::MASK)) == + toInt(VehiclePropertyType::BOOLEAN) && + (property & toInt(VehicleArea::MASK)) == toInt(VehicleArea::GLOBAL); + } + + protected: + std::shared_ptr mVhalClient; + std::shared_ptr mCallback; +}; + +TEST_P(VtsHalAutomotiveVehicleTargetTest, useAidlBackend) { + if (!mVhalClient->isAidlVhal()) { + GTEST_SKIP() << "AIDL backend is not available, HIDL backend is used instead"; + } +} + +TEST_P(VtsHalAutomotiveVehicleTargetTest, useHidlBackend) { + if (mVhalClient->isAidlVhal()) { + GTEST_SKIP() << "AIDL backend is available, HIDL backend is not used"; + } +} + +// Test getAllPropConfig() returns at least 4 property configs. +TEST_P(VtsHalAutomotiveVehicleTargetTest, getAllPropConfigs) { + ALOGD("VtsHalAutomotiveVehicleTargetTest::getAllPropConfigs"); + + auto result = mVhalClient->getAllPropConfigs(); + + ASSERT_TRUE(result.ok()) << "Failed to get all property configs, error: " + << result.error().message(); + ASSERT_GE(result.value().size(), 4u) << StringPrintf( + "Expect to get at least 4 property configs, got %zu", result.value().size()); +} + +// Test getPropConfigs() can query all properties listed in CDD. +TEST_P(VtsHalAutomotiveVehicleTargetTest, getRequiredPropConfigs) { + ALOGD("VtsHalAutomotiveVehicleTargetTest::getRequiredPropConfigs"); + + // Check the properties listed in CDD + std::vector properties = { + toInt(VehicleProperty::GEAR_SELECTION), toInt(VehicleProperty::NIGHT_MODE), + toInt(VehicleProperty::PARKING_BRAKE_ON), toInt(VehicleProperty::PERF_VEHICLE_SPEED)}; + + auto result = mVhalClient->getPropConfigs(properties); + + ASSERT_TRUE(result.ok()) << "Failed to get required property config, error: " + << result.error().message(); + ASSERT_EQ(result.value().size(), 4u) + << StringPrintf("Expect to get exactly 4 configs, got %zu", result.value().size()); +} + +// Test getPropConfig() with an invalid propertyId returns an error code. +TEST_P(VtsHalAutomotiveVehicleTargetTest, getPropConfigsWithInvalidProp) { + ALOGD("VtsHalAutomotiveVehicleTargetTest::getPropConfigsWithInvalidProp"); + + auto result = mVhalClient->getPropConfigs({kInvalidProp}); + + ASSERT_FALSE(result.ok()) << StringPrintf( + "Expect failure to get prop configs for invalid prop: %" PRId32, kInvalidProp); + ASSERT_NE(result.error().message(), "") << "Expect error message not to be empty"; +} + +// Test get() return current value for properties. +TEST_P(VtsHalAutomotiveVehicleTargetTest, get) { + ALOGD("VtsHalAutomotiveVehicleTargetTest::get"); + + int32_t propId = toInt(VehicleProperty::PERF_VEHICLE_SPEED); + auto result = mVhalClient->getValueSync(*mVhalClient->createHalPropValue(propId)); + + ASSERT_TRUE(result.ok()) << StringPrintf("Failed to get value for property: %" PRId32 + ", error: %s", + propId, result.error().message().c_str()); + ASSERT_NE(result.value(), nullptr) << "Result value must not be null"; +} + +// Test get() with an invalid propertyId return an error codes. +TEST_P(VtsHalAutomotiveVehicleTargetTest, getInvalidProp) { + ALOGD("VtsHalAutomotiveVehicleTargetTest::getInvalidProp"); + + auto result = mVhalClient->getValueSync(*mVhalClient->createHalPropValue(kInvalidProp)); + + ASSERT_FALSE(result.ok()) << StringPrintf( + "Expect failure to get property for invalid prop: %" PRId32, kInvalidProp); +} + +// Test set() on read_write properties. +TEST_P(VtsHalAutomotiveVehicleTargetTest, setProp) { + ALOGD("VtsHalAutomotiveVehicleTargetTest::setProp"); + + // skip hvac related properties + std::unordered_set hvacProps = {toInt(VehicleProperty::HVAC_DEFROSTER), + toInt(VehicleProperty::HVAC_AC_ON), + toInt(VehicleProperty::HVAC_MAX_AC_ON), + toInt(VehicleProperty::HVAC_MAX_DEFROST_ON), + toInt(VehicleProperty::HVAC_RECIRC_ON), + toInt(VehicleProperty::HVAC_DUAL_ON), + toInt(VehicleProperty::HVAC_AUTO_ON), + toInt(VehicleProperty::HVAC_POWER_ON), + toInt(VehicleProperty::HVAC_AUTO_RECIRC_ON), + toInt(VehicleProperty::HVAC_ELECTRIC_DEFROSTER_ON)}; + auto result = mVhalClient->getAllPropConfigs(); + ASSERT_TRUE(result.ok()); + + for (const auto& cfgPtr : result.value()) { + const IHalPropConfig& cfg = *cfgPtr; + int32_t propId = cfg.getPropId(); + // test on boolean and writable property + if (cfg.getAccess() == toInt(VehiclePropertyAccess::READ_WRITE) && + isBooleanGlobalProp(propId) && !hvacProps.count(propId)) { + auto propToGet = mVhalClient->createHalPropValue(propId); + auto getValueResult = mVhalClient->getValueSync(*propToGet); + + ASSERT_TRUE(getValueResult.ok()) + << StringPrintf("Failed to get value for property: %" PRId32 ", error: %s", + propId, getValueResult.error().message().c_str()); + ASSERT_NE(getValueResult.value(), nullptr) + << StringPrintf("Result value must not be null for property: %" PRId32, propId); + + const IHalPropValue& value = *getValueResult.value(); + size_t intValueSize = value.getInt32Values().size(); + ASSERT_EQ(intValueSize, 1u) << StringPrintf( + "Expect exactly 1 int value for boolean property: %" PRId32 ", got %zu", propId, + intValueSize); + + int setValue = value.getInt32Values()[0] == 1 ? 0 : 1; + auto propToSet = mVhalClient->createHalPropValue(propId); + propToSet->setInt32Values({setValue}); + auto setValueResult = mVhalClient->setValueSync(*propToSet); + + ASSERT_TRUE(setValueResult.ok()) + << StringPrintf("Failed to set value for property: %" PRId32 ", error: %s", + propId, setValueResult.error().message().c_str()); + + // check set success + getValueResult = mVhalClient->getValueSync(*propToGet); + ASSERT_TRUE(getValueResult.ok()) + << StringPrintf("Failed to get value for property: %" PRId32 ", error: %s", + propId, getValueResult.error().message().c_str()); + ASSERT_NE(getValueResult.value(), nullptr) + << StringPrintf("Result value must not be null for property: %" PRId32, propId); + ASSERT_EQ(getValueResult.value()->getInt32Values(), std::vector({setValue})) + << StringPrintf("Boolean value not updated after set for property: %" PRId32, + propId); + } + } +} + +// Test set() on an read_only property. +TEST_P(VtsHalAutomotiveVehicleTargetTest, setNotWritableProp) { + ALOGD("VtsHalAutomotiveVehicleTargetTest::setNotWritableProp"); + + int32_t propId = toInt(VehicleProperty::PERF_VEHICLE_SPEED); + auto getValueResult = mVhalClient->getValueSync(*mVhalClient->createHalPropValue(propId)); + ASSERT_TRUE(getValueResult.ok()) + << StringPrintf("Failed to get value for property: %" PRId32 ", error: %s", propId, + getValueResult.error().message().c_str()); + + auto setValueResult = mVhalClient->setValueSync(*getValueResult.value()); + + ASSERT_FALSE(setValueResult.ok()) << "Expect set a read-only value to fail"; + ASSERT_EQ(setValueResult.error().code(), toInt(StatusCode::ACCESS_DENIED)); +} + +// Test subscribe() and unsubscribe(). +TEST_P(VtsHalAutomotiveVehicleTargetTest, subscribeAndUnsubscribe) { + ALOGD("VtsHalAutomotiveVehicleTargetTest::subscribeAndUnsubscribe"); + + int32_t propId = toInt(VehicleProperty::PERF_VEHICLE_SPEED); + + std::vector options = { + SubscribeOptions{.propId = propId, .sampleRate = 10.0}}; + + auto client = mVhalClient->getSubscriptionClient(mCallback); + ASSERT_NE(client, nullptr) << "Failed to get subscription client"; + + auto result = client->subscribe(options); + + ASSERT_TRUE(result.ok()) << StringPrintf("Failed to subscribe to property: %" PRId32 + ", error: %s", + propId, result.error().message().c_str()); + ASSERT_TRUE(mCallback->waitForExpectedEvents(propId, 10, std::chrono::seconds(10))) + << "Didn't get enough events for subscription"; + + result = client->unsubscribe({propId}); + ASSERT_TRUE(result.ok()) << StringPrintf("Failed to unsubscribe to property: %" PRId32 + ", error: %s", + propId, result.error().message().c_str()); + + mCallback->reset(); + ASSERT_FALSE(mCallback->waitForExpectedEvents(propId, 10, std::chrono::seconds(1))) + << "Expect not to get events after unsubscription"; +} + +// Test subscribe() with an invalid property. +TEST_P(VtsHalAutomotiveVehicleTargetTest, subscribeInvalidProp) { + ALOGD("VtsHalAutomotiveVehicleTargetTest::subscribeInvalidProp"); + + std::vector options = { + SubscribeOptions{.propId = kInvalidProp, .sampleRate = 10.0}}; + + auto client = mVhalClient->getSubscriptionClient(mCallback); + ASSERT_NE(client, nullptr) << "Failed to get subscription client"; + + auto result = client->subscribe(options); + + ASSERT_FALSE(result.ok()) << StringPrintf("Expect subscribing to property: %" PRId32 " to fail", + kInvalidProp); +} + +std::vector getDescriptors() { + std::vector descriptors; + for (std::string name : getAidlHalInstanceNames(IVehicle::descriptor)) { + descriptors.push_back({ + .name = name, + .isAidlService = true, + }); + } + for (std::string name : getAllHalInstanceNames(IVehicle::descriptor)) { + descriptors.push_back({ + .name = name, + .isAidlService = false, + }); + } + return descriptors; +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VtsHalAutomotiveVehicleTargetTest); + +INSTANTIATE_TEST_SUITE_P(PerInstance, VtsHalAutomotiveVehicleTargetTest, + testing::ValuesIn(getDescriptors()), + [](const testing::TestParamInfo& info) { + std::string name = ""; + if (info.param.isAidlService) { + name += "aidl_"; + } else { + name += "hidl_"; + } + name += info.param.name; + return Sanitize(name); + }); + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + ABinderProcess_setThreadPoolMaxThreadCount(1); + return RUN_ALL_TESTS(); +} -- GitLab From 24fee7bba90e333b5eeb98a11cdfba7a81f09b5d Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 3 Mar 2022 15:10:51 -0800 Subject: [PATCH 678/825] Define VhalResult alias. Define a VhalResult alias to represent Result that contains a VHAL StatusCode as error type. This alias helps client to easier migrate from android::base::Result to VhalResult. Test: Presubmit Bug: 219612366 Change-Id: I17f15044ee962c7148b0adc3925e0b0a9dfab2a8 --- .../hardware/include/FakeVehicleHardware.h | 10 +++++----- .../hardware/src/FakeVehicleHardware.cpp | 12 +++++------- .../fake_impl/obd2frame/include/FakeObd2Frame.h | 6 +++--- .../fake_impl/obd2frame/src/FakeObd2Frame.cpp | 8 +++----- .../fake_impl/userhal/include/FakeUserHal.h | 2 +- .../impl/fake_impl/userhal/src/FakeUserHal.cpp | 6 ++---- .../utils/common/include/PendingRequestPool.h | 6 +++--- .../utils/common/include/VehiclePropertyStore.h | 9 ++++----- .../impl/utils/common/include/VehicleUtils.h | 17 ++++++++++++----- .../utils/common/src/PendingRequestPool.cpp | 4 +--- .../utils/common/src/VehiclePropertyStore.cpp | 10 ++++------ .../common/test/VehiclePropertyStoreTest.cpp | 5 ++--- .../impl/utils/common/test/VehicleUtilsTest.cpp | 2 +- .../aidl/impl/vhal/include/ConnectedClient.h | 3 +-- .../aidl/impl/vhal/include/DefaultVehicleHal.h | 7 +++---- .../aidl/impl/vhal/src/ConnectedClient.cpp | 3 +-- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 8 +++----- .../src/VtsHalAutomotiveVehicle_TargetTest.cpp | 2 +- 18 files changed, 55 insertions(+), 65 deletions(-) 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 fa494c6634..1c076d364a 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -41,7 +41,7 @@ namespace fake { class FakeVehicleHardware : public IVehicleHardware { public: - using ValueResultType = android::base::Result; + using ValueResultType = VhalResult; FakeVehicleHardware(); @@ -90,7 +90,7 @@ class FakeVehicleHardware : public IVehicleHardware { ValueResultType getValue( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; - android::base::Result setValue( + VhalResult setValue( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); private: @@ -117,17 +117,17 @@ class FakeVehicleHardware : public IVehicleHardware { // Override the properties using config files in 'overrideDir'. void overrideProperties(const char* overrideDir); - android::base::Result maybeSetSpecialValue( + VhalResult maybeSetSpecialValue( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, bool* isSpecialValue); ValueResultType maybeGetSpecialValue( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, bool* isSpecialValue) const; - android::base::Result setApPowerStateReport( + VhalResult setApPowerStateReport( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); VehiclePropValuePool::RecyclableType createApPowerStateReq( aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq state); - android::base::Result setUserHalProp( + VhalResult setUserHalProp( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); ValueResultType getUserHalProp( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; 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 233efc8b14..462506d56c 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -68,8 +68,6 @@ using ::android::base::Result; using ::android::base::StartsWith; using ::android::base::StringPrintf; -using StatusError = android::base::Error; - const char* VENDOR_OVERRIDE_DIR = "/vendor/etc/automotive/vhaloverride/"; const char* OVERRIDE_PROPERTY = "persist.vendor.vhal_init_value_override"; @@ -193,7 +191,7 @@ VehiclePropValuePool::RecyclableType FakeVehicleHardware::createApPowerStateReq( return req; } -Result FakeVehicleHardware::setApPowerStateReport(const VehiclePropValue& value) { +VhalResult FakeVehicleHardware::setApPowerStateReport(const VehiclePropValue& value) { auto updatedValue = mValuePool->obtain(value); updatedValue->timestamp = elapsedRealtimeNano(); @@ -270,7 +268,7 @@ bool FakeVehicleHardware::isHvacPropAndHvacNotAvailable(int32_t propId) { return false; } -Result FakeVehicleHardware::setUserHalProp(const VehiclePropValue& value) { +VhalResult FakeVehicleHardware::setUserHalProp(const VehiclePropValue& value) { auto result = mFakeUserHal->onSetProperty(value); if (!result.ok()) { return StatusError(getErrorCode(result)) @@ -345,8 +343,8 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue( return nullptr; } -Result FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValue& value, - bool* isSpecialValue) { +VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValue& value, + bool* isSpecialValue) { *isSpecialValue = false; VehiclePropValuePool::RecyclableType updatedValue; int32_t propId = value.prop; @@ -442,7 +440,7 @@ StatusCode FakeVehicleHardware::setValues(std::shared_ptr FakeVehicleHardware::setValue(const VehiclePropValue& value) { +VhalResult FakeVehicleHardware::setValue(const VehiclePropValue& value) { bool isSpecialValue = false; auto setSpecialValueResult = maybeSetSpecialValue(value, &isSpecialValue); diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h index ba40f60d74..4d2ffd049b 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h +++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/include/FakeObd2Frame.h @@ -38,11 +38,11 @@ class FakeObd2Frame final { const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig); void initObd2FreezeFrame( const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig); - android::base::Result getObd2FreezeFrame( + VhalResult getObd2FreezeFrame( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& requestedPropValue) const; - android::base::Result getObd2DtcInfo() const; - android::base::Result clearObd2FreezeFrames( + VhalResult getObd2DtcInfo() const; + VhalResult clearObd2FreezeFrames( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); static bool isDiagnosticProperty( const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& propConfig); diff --git a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/src/FakeObd2Frame.cpp b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/src/FakeObd2Frame.cpp index 0a4affc9d7..5f9f2174f0 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/obd2frame/src/FakeObd2Frame.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/obd2frame/src/FakeObd2Frame.cpp @@ -46,8 +46,6 @@ using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::base::Result; -using StatusError = android::base::Error; - std::unique_ptr FakeObd2Frame::fillDefaultObd2Frame(size_t numVendorIntegerSensors, size_t numVendorFloatSensors) { std::unique_ptr sensorStore(new Obd2SensorStore( @@ -127,7 +125,7 @@ void FakeObd2Frame::initObd2FreezeFrame(const VehiclePropConfig& propConfig) { } } -Result FakeObd2Frame::getObd2FreezeFrame( +VhalResult FakeObd2Frame::getObd2FreezeFrame( const VehiclePropValue& requestedPropValue) const { if (requestedPropValue.value.int64Values.size() != 1) { return StatusError(StatusCode::INVALID_ARG) @@ -153,7 +151,7 @@ Result FakeObd2Frame::getObd2Fr return readValueResult; } -Result FakeObd2Frame::getObd2DtcInfo() const { +VhalResult FakeObd2Frame::getObd2DtcInfo() const { std::vector timestamps; auto result = mPropStore->readValuesForProperty(OBD2_FREEZE_FRAME); if (!result.ok()) { @@ -170,7 +168,7 @@ Result FakeObd2Frame::getObd2Dt return outValue; } -Result FakeObd2Frame::clearObd2FreezeFrames(const VehiclePropValue& propValue) { +VhalResult FakeObd2Frame::clearObd2FreezeFrames(const VehiclePropValue& propValue) { if (propValue.value.int64Values.size() == 0) { mPropStore->removeValuesForProperty(OBD2_FREEZE_FRAME); return {}; diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h b/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h index 9c4887cdfe..4ae9c8c1cb 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h +++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/include/FakeUserHal.h @@ -39,7 +39,7 @@ constexpr char kUserHalDumpOption[] = "--user-hal"; // Class used to emulate a real User HAL behavior through lshal debug requests. class FakeUserHal final { public: - using ValueResultType = android::base::Result; + using ValueResultType = VhalResult; explicit FakeUserHal(std::shared_ptr valuePool) : mValuePool(valuePool) {} diff --git a/automotive/vehicle/aidl/impl/fake_impl/userhal/src/FakeUserHal.cpp b/automotive/vehicle/aidl/impl/fake_impl/userhal/src/FakeUserHal.cpp index e37f619be7..7748fb6618 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/userhal/src/FakeUserHal.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/userhal/src/FakeUserHal.cpp @@ -44,8 +44,6 @@ using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::base::Error; using ::android::base::Result; -using StatusError = android::base::Error; - constexpr int32_t INITIAL_USER_INFO = toInt(VehicleProperty::INITIAL_USER_INFO); constexpr int32_t SWITCH_USER = toInt(VehicleProperty::SWITCH_USER); constexpr int32_t CREATE_USER = toInt(VehicleProperty::CREATE_USER); @@ -53,7 +51,7 @@ constexpr int32_t REMOVE_USER = toInt(VehicleProperty::REMOVE_USER); constexpr int32_t USER_IDENTIFICATION_ASSOCIATION = toInt(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION); -Result getRequestId(const VehiclePropValue& value) { +VhalResult getRequestId(const VehiclePropValue& value) { if (value.value.int32Values.size() < 1) { return StatusError(StatusCode::INVALID_ARG) << "no int32Values on property: " << value.toString(); @@ -61,7 +59,7 @@ Result getRequestId(const VehiclePropValue& value) { return value.value.int32Values[0]; } -Result getSwitchUserMessageType(const VehiclePropValue& value) { +VhalResult getSwitchUserMessageType(const VehiclePropValue& value) { if (value.value.int32Values.size() < 2) { return StatusError(StatusCode::INVALID_ARG) << "missing switch user message type on property: " << value.toString(); diff --git a/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h b/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h index 4ab8acd126..3f8db93ba3 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/PendingRequestPool.h @@ -50,9 +50,9 @@ class PendingRequestPool final { // added. Otherwise, they would be added to the request pool. // The callback would be called if requests are not finished within {@code mTimeoutInNano} // seconds. - android::base::Result addRequests( - const void* clientId, const std::unordered_set& requestIds, - std::shared_ptr callback); + VhalResult addRequests(const void* clientId, + const std::unordered_set& requestIds, + std::shared_ptr callback); // Checks whether the request is currently pending. bool isRequestPending(const void* clientId, int64_t requestId) const; diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h index cebf95c372..ddc4f684aa 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h @@ -43,9 +43,8 @@ namespace vehicle { // This class is thread-safe, however it uses blocking synchronization across all methods. class VehiclePropertyStore final { public: - using ValueResultType = android::base::Result; - using ValuesResultType = - android::base::Result, VhalError>; + using ValueResultType = VhalResult; + using ValuesResultType = VhalResult>; explicit VehiclePropertyStore(std::shared_ptr valuePool) : mValuePool(valuePool) {} @@ -73,8 +72,8 @@ class VehiclePropertyStore final { // '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. - android::base::Result writeValue( - VehiclePropValuePool::RecyclableType propValue, bool updateStatus = false); + VhalResult writeValue(VehiclePropValuePool::RecyclableType propValue, + bool updateStatus = false); // Remove a given property value from the property store. The 'propValue' would be used to // generate the key for the value to remove. diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h index 8ef02182da..6d7d13120d 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h @@ -251,9 +251,16 @@ class VhalError final { aidl::android::hardware::automotive::vehicle::StatusCode mCode; }; +// VhalResult is a {@code Result} that contains {@code StatusCode} as error type. template -aidl::android::hardware::automotive::vehicle::StatusCode getErrorCode( - const android::base::Result& result) { +using VhalResult = android::base::Result; + +// StatusError could be cast to {@code ResultError} with a {@code StatusCode} and should be used +// as error type for {@VhalResult}. +using StatusError = android::base::Error; + +template +aidl::android::hardware::automotive::vehicle::StatusCode getErrorCode(const VhalResult& result) { if (result.ok()) { return aidl::android::hardware::automotive::vehicle::StatusCode::OK; } @@ -261,7 +268,7 @@ aidl::android::hardware::automotive::vehicle::StatusCode getErrorCode( } template -int getIntErrorCode(const android::base::Result& result) { +int getIntErrorCode(const VhalResult& result) { return toInt(getErrorCode(result)); } @@ -293,12 +300,12 @@ ndk::ScopedAStatus toScopedAStatus( } template -ndk::ScopedAStatus toScopedAStatus(const android::base::Result& result) { +ndk::ScopedAStatus toScopedAStatus(const VhalResult& result) { return toScopedAStatus(result, getErrorCode(result)); } template -ndk::ScopedAStatus toScopedAStatus(const android::base::Result& result, +ndk::ScopedAStatus toScopedAStatus(const VhalResult& result, const std::string& additionalErrorMsg) { return toScopedAStatus(result, getErrorCode(result), additionalErrorMsg); } diff --git a/automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp b/automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp index f8a042d242..0196edd2ca 100644 --- a/automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/src/PendingRequestPool.cpp @@ -37,8 +37,6 @@ using ::android::base::Result; // At least check every 1s. constexpr int64_t CHECK_TIME_IN_NANO = 1'000'000'000; -using StatusError = android::base::Error; - } // namespace PendingRequestPool::PendingRequestPool(int64_t timeoutInNano) @@ -73,7 +71,7 @@ PendingRequestPool::~PendingRequestPool() { } } -Result PendingRequestPool::addRequests( +VhalResult PendingRequestPool::addRequests( const void* clientId, const std::unordered_set& requestIds, std::shared_ptr callback) { std::scoped_lock lockGuard(mLock); diff --git a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp index 776caed1f1..c8fb994684 100644 --- a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp @@ -39,8 +39,6 @@ using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::base::Result; using ::android::base::StringPrintf; -using StatusError = android::base::Error; - bool VehiclePropertyStore::RecordId::operator==(const VehiclePropertyStore::RecordId& other) const { return area == other.area && token == other.token; } @@ -88,7 +86,7 @@ VehiclePropertyStore::RecordId VehiclePropertyStore::getRecordIdLocked( return recId; } -Result VehiclePropertyStore::readValueLocked( +VhalResult VehiclePropertyStore::readValueLocked( const RecordId& recId, const Record& record) const REQUIRES(mLock) { if (auto it = record.values.find(recId); it != record.values.end()) { return mValuePool->obtain(*(it->second)); @@ -107,8 +105,8 @@ void VehiclePropertyStore::registerProperty(const VehiclePropConfig& config, }; } -Result VehiclePropertyStore::writeValue( - VehiclePropValuePool::RecyclableType propValue, bool updateStatus) { +VhalResult VehiclePropertyStore::writeValue(VehiclePropValuePool::RecyclableType propValue, + bool updateStatus) { std::scoped_lock g(mLock); int32_t propId = propValue->prop; @@ -248,7 +246,7 @@ std::vector VehiclePropertyStore::getAllConfigs() const { return configs; } -Result VehiclePropertyStore::getConfig(int32_t propId) const { +VhalResult VehiclePropertyStore::getConfig(int32_t propId) const { std::scoped_lock g(mLock); const VehiclePropertyStore::Record* record = getRecordLocked(propId); diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp index c8bf1d8993..4d6f811795 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp @@ -37,7 +37,6 @@ using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyChangeMode; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; -using ::android::base::Result; using ::testing::ElementsAre; using ::testing::Eq; using ::testing::WhenSortedBy; @@ -103,7 +102,7 @@ TEST_F(VehiclePropertyStoreTest, testGetAllConfigs) { } TEST_F(VehiclePropertyStoreTest, testGetConfig) { - Result result = + VhalResult result = mStore->getConfig(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); ASSERT_RESULT_OK(result); @@ -111,7 +110,7 @@ TEST_F(VehiclePropertyStoreTest, testGetConfig) { } TEST_F(VehiclePropertyStoreTest, testGetConfigWithInvalidPropId) { - Result result = mStore->getConfig(INVALID_PROP_ID); + VhalResult result = mStore->getConfig(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); diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp index cc299641f8..411539b38f 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp @@ -763,7 +763,7 @@ TEST(VehicleUtilsTest, testConcurrentQueueDeactivateNotifyWaitingThread) { } TEST(VehicleUtilsTest, testVhalError) { - Result result = Error(StatusCode::INVALID_ARG) << "error message"; + VhalResult result = Error(StatusCode::INVALID_ARG) << "error message"; ASSERT_EQ(result.error().message(), "error message: INVALID_ARG"); } diff --git a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h index 6ab0e1e945..2e7298ff0b 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h +++ b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h @@ -58,8 +58,7 @@ class ConnectedClient { // Returns {@code INVALID_ARG} error if any of the requestIds are duplicate with one of the // pending request IDs or {@code TRY_AGAIN} error if the pending request pool is full and could // no longer add requests. - android::base::Result addRequests( - const std::unordered_set& requestIds); + VhalResult addRequests(const std::unordered_set& requestIds); // Marks the requests as finished. Returns a list of request IDs that was pending and has been // finished. It must be a set of the requested request IDs. diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index 2db7675fdd..f646b6b1bb 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -45,7 +45,6 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi public: using CallbackType = std::shared_ptr; - using StatusError = android::base::Error; explicit DefaultVehicleHal(std::unique_ptr hardware); @@ -211,14 +210,14 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi const std::vector& requests); - android::base::Result checkSubscribeOptions( + VhalResult checkSubscribeOptions( const std::vector& options); - android::base::Result checkReadPermission( + VhalResult checkReadPermission( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; - android::base::Result checkWritePermission( + VhalResult checkWritePermission( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; android::base::Result diff --git a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp index 4cfc2be445..81d231c87f 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp @@ -196,8 +196,7 @@ const void* ConnectedClient::id() { return reinterpret_cast(this); } -Result ConnectedClient::addRequests( - const std::unordered_set& requestIds) { +VhalResult ConnectedClient::addRequests(const std::unordered_set& requestIds) { return mRequestPool->addRequests(id(), requestIds, getTimeoutCallback()); } diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index 886f89733f..08700f28dc 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -590,7 +590,7 @@ ScopedAStatus DefaultVehicleHal::getPropConfigs(const std::vector& prop return vectorToStableLargeParcelable(std::move(configs), output); } -Result DefaultVehicleHal::checkSubscribeOptions( +VhalResult DefaultVehicleHal::checkSubscribeOptions( const std::vector& options) { for (const auto& option : options) { int32_t propId = option.propId; @@ -718,8 +718,7 @@ IVehicleHardware* DefaultVehicleHal::getHardware() { return mVehicleHardware.get(); } -Result DefaultVehicleHal::checkWritePermission( - const VehiclePropValue& value) const { +VhalResult DefaultVehicleHal::checkWritePermission(const VehiclePropValue& value) const { int32_t propId = value.prop; auto result = getConfig(propId); if (!result.ok()) { @@ -735,8 +734,7 @@ Result DefaultVehicleHal::checkWritePermission( return {}; } -Result DefaultVehicleHal::checkReadPermission( - const VehiclePropValue& value) const { +VhalResult DefaultVehicleHal::checkReadPermission(const VehiclePropValue& value) const { int32_t propId = value.prop; auto result = getConfig(propId); if (!result.ok()) { diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 32382f242c..c33f3e91d3 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -276,7 +276,7 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, setNotWritableProp) { auto setValueResult = mVhalClient->setValueSync(*getValueResult.value()); ASSERT_FALSE(setValueResult.ok()) << "Expect set a read-only value to fail"; - ASSERT_EQ(setValueResult.error().code(), toInt(StatusCode::ACCESS_DENIED)); + ASSERT_EQ(setValueResult.error().code(), StatusCode::ACCESS_DENIED); } // Test subscribe() and unsubscribe(). -- GitLab From 2bb879d8bb843a33171c32e058587c41355f27ac Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Sat, 5 Mar 2022 15:09:55 -0800 Subject: [PATCH 679/825] Update documentation for data call list APIs Test: build Bug: 221174412 Change-Id: Ibab472f979815cdbec3ce64d7855c7a21fdbec01 --- radio/aidl/android/hardware/radio/data/IRadioData.aidl | 4 ++-- .../aidl/android/hardware/radio/data/IRadioDataResponse.aidl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/aidl/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/android/hardware/radio/data/IRadioData.aidl index e1ba56828f..724b515945 100644 --- a/radio/aidl/android/hardware/radio/data/IRadioData.aidl +++ b/radio/aidl/android/hardware/radio/data/IRadioData.aidl @@ -65,6 +65,7 @@ oneway interface IRadioData { /** * Deactivate packet data connection and remove from the data call list. An * unsolDataCallListChanged() must be sent when data connection is deactivated. + * A return value of RadioError::RADIO_NOT_AVAILABLE will remove the network from the list. * * @param serial Serial number of request. * @param cid Data call id. @@ -76,8 +77,7 @@ oneway interface IRadioData { /** * Returns the data call list. An entry is added when a setupDataCall() is issued and removed - * on a deactivateDataCall(). The list is emptied when setRadioPower() off/on issued or when - * the vendor HAL or modem crashes. + * on a deactivateDataCall(). The list is emptied when the vendor HAL crashes. * * @param serial Serial number of request. * diff --git a/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl b/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl index bbc8d07b0a..1cb8ff3fd5 100644 --- a/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl +++ b/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl @@ -68,7 +68,7 @@ oneway interface IRadioDataResponse { * Valid errors returned: * RadioError:REQUEST_NOT_SUPPORTED may be returned when HAL 1.2 or higher is supported. * RadioError:NONE - * RadioError:RADIO_NOT_AVAILABLE + * RadioError:RADIO_NOT_AVAILABLE will remove the network from the list. * RadioError:INVALID_CALL_ID * RadioError:INVALID_STATE * RadioError:INVALID_ARGUMENTS -- GitLab From 7044a51c4f13246ab656acfeed8df21f3887b0d6 Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Mon, 7 Mar 2022 16:02:13 -0800 Subject: [PATCH 680/825] DeactivateDataCall remove network on all errors Remove network on all errors instead of only RADIO_NOT_AVAIALBLE. Test: atest DataNetworkTest Bug: 219998284 Change-Id: I9e36829c627c7fa1286174e536ef5ff561e8b142 --- radio/aidl/android/hardware/radio/data/IRadioData.aidl | 2 +- .../aidl/android/hardware/radio/data/IRadioDataResponse.aidl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/aidl/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/android/hardware/radio/data/IRadioData.aidl index 724b515945..0171d39b42 100644 --- a/radio/aidl/android/hardware/radio/data/IRadioData.aidl +++ b/radio/aidl/android/hardware/radio/data/IRadioData.aidl @@ -65,7 +65,7 @@ oneway interface IRadioData { /** * Deactivate packet data connection and remove from the data call list. An * unsolDataCallListChanged() must be sent when data connection is deactivated. - * A return value of RadioError::RADIO_NOT_AVAILABLE will remove the network from the list. + * Any return value other than RadioError::NONE will remove the network from the list. * * @param serial Serial number of request. * @param cid Data call id. diff --git a/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl b/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl index 1cb8ff3fd5..88b6c1b720 100644 --- a/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl +++ b/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl @@ -67,8 +67,8 @@ oneway interface IRadioDataResponse { * * Valid errors returned: * RadioError:REQUEST_NOT_SUPPORTED may be returned when HAL 1.2 or higher is supported. - * RadioError:NONE - * RadioError:RADIO_NOT_AVAILABLE will remove the network from the list. + * RadioError:NONE indicates success. Any other error will remove the network from the list. + * RadioError:RADIO_NOT_AVAILABLE * RadioError:INVALID_CALL_ID * RadioError:INVALID_STATE * RadioError:INVALID_ARGUMENTS -- GitLab From c5131093b11d3871ad70cc852f8ab292ea23a691 Mon Sep 17 00:00:00 2001 From: Chris Weir Date: Mon, 7 Mar 2022 15:34:06 -0800 Subject: [PATCH 681/825] Fix VtsHalNetlinkInterceptorV1_0Test Move library dependencies to static_libs to fix linker error when running with ABI=armeabi-v7a Bug: 222019884 Test: atest VtsHalNetlinkInterceptorV1_0Test -- --abi armeabi-v7a Change-Id: I3566f1898b3b3fe89fcb69563b1dbd93789135dd --- wifi/netlinkinterceptor/vts/functional/Android.bp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wifi/netlinkinterceptor/vts/functional/Android.bp b/wifi/netlinkinterceptor/vts/functional/Android.bp index 33284e8e89..80608a74a6 100644 --- a/wifi/netlinkinterceptor/vts/functional/Android.bp +++ b/wifi/netlinkinterceptor/vts/functional/Android.bp @@ -34,13 +34,13 @@ cc_test { "interceptor_aidl_test.cpp", ], shared_libs: [ - "android.hardware.net.nlinterceptor-V1-ndk", "libbase", "libbinder_ndk", ], static_libs: [ - "libgmock", + "android.hardware.net.nlinterceptor-V1-ndk", "android.hardware.automotive.can@libnetdevice", + "libgmock", "libnl++", ], test_suites: [ -- GitLab From 54d7fb5029880795d80485b177d6d9694abfea59 Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Tue, 8 Mar 2022 20:46:50 +0000 Subject: [PATCH 682/825] Add automotive related keys to AIDL. This CL adds a new automotive metadata section with below fields: - AUTOMOTIVE_LOCATION describes where the camera exists. - AUTOMOTIVE_LENS_FACING tells where the camera's lens is facing toward. These were added to the temporary HIDL interface but not AIDL. Bug: 223262543 Test: build Change-Id: Id074c6878690767c89792f867a7754ae8193405d Signed-off-by: Jayant Chowdhary --- .../camera/metadata/AutomotiveLensFacing.aidl | 56 +++++++++++++++++++ .../camera/metadata/AutomotiveLocation.aidl | 52 +++++++++++++++++ .../metadata/CameraMetadataSection.aidl | 2 + .../metadata/CameraMetadataSectionStart.aidl | 2 + .../camera/metadata/CameraMetadataTag.aidl | 2 + .../camera/metadata/LensPoseReference.aidl | 1 + .../camera/metadata/AutomotiveLensFacing.aidl | 46 +++++++++++++++ .../camera/metadata/AutomotiveLocation.aidl | 42 ++++++++++++++ .../metadata/CameraMetadataSection.aidl | 2 + .../metadata/CameraMetadataSectionStart.aidl | 2 + .../camera/metadata/CameraMetadataTag.aidl | 11 ++++ .../camera/metadata/LensPoseReference.aidl | 1 + 12 files changed, 219 insertions(+) create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/AutomotiveLensFacing.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/AutomotiveLocation.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLensFacing.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLocation.aidl diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/AutomotiveLensFacing.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/AutomotiveLensFacing.aidl new file mode 100644 index 0000000000..14ad26e08a --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/AutomotiveLensFacing.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. + *//* + * 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 -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 AutomotiveLensFacing { + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_OTHER = 0, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_FRONT = 1, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_REAR = 2, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_LEFT = 3, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_RIGHT = 4, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_OTHER = 5, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_LEFT = 6, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_CENTER = 7, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_RIGHT = 8, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_LEFT = 9, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_CENTER = 10, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_RIGHT = 11, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_LEFT = 12, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_CENTER = 13, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_RIGHT = 14, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/AutomotiveLocation.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/AutomotiveLocation.aidl new file mode 100644 index 0000000000..5417bdbf44 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/AutomotiveLocation.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. + *//* + * 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 -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 AutomotiveLocation { + ANDROID_AUTOMOTIVE_LOCATION_INTERIOR = 0, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_OTHER = 1, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_FRONT = 2, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_REAR = 3, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_LEFT = 4, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_RIGHT = 5, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_OTHER = 6, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_FRONT = 7, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_REAR = 8, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_LEFT = 9, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_RIGHT = 10, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl index dc3383692d..8bed156d8f 100644 --- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl @@ -68,5 +68,7 @@ enum CameraMetadataSection { ANDROID_DISTORTION_CORRECTION = 27, ANDROID_HEIC = 28, ANDROID_HEIC_INFO = 29, + ANDROID_AUTOMOTIVE = 30, + ANDROID_AUTOMOTIVE_LENS = 31, VENDOR_SECTION = 32768, } diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl index 3a790b3a7a..1725347698 100644 --- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl @@ -68,5 +68,7 @@ enum CameraMetadataSectionStart { ANDROID_DISTORTION_CORRECTION_START = 1769472, ANDROID_HEIC_START = 1835008, ANDROID_HEIC_INFO_START = 1900544, + ANDROID_AUTOMOTIVE_START = 1966080, + ANDROID_AUTOMOTIVE_LENS_START = 2031616, VENDOR_SECTION_START = -2147483648, } 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 432c9fd2ac..13c7924eda 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 @@ -325,4 +325,6 @@ enum CameraMetadataTag { ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS_MAXIMUM_RESOLUTION = 1835013, ANDROID_HEIC_INFO_SUPPORTED = 1900544, ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT = 1900545, + ANDROID_AUTOMOTIVE_LOCATION = 1966080, + ANDROID_AUTOMOTIVE_LENS_FACING = 2031616, } diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensPoseReference.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensPoseReference.aidl index 275d77ba0c..b2d837a0ff 100644 --- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensPoseReference.aidl +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/LensPoseReference.aidl @@ -41,4 +41,5 @@ enum LensPoseReference { ANDROID_LENS_POSE_REFERENCE_PRIMARY_CAMERA = 0, ANDROID_LENS_POSE_REFERENCE_GYROSCOPE = 1, ANDROID_LENS_POSE_REFERENCE_UNDEFINED = 2, + ANDROID_LENS_POSE_REFERENCE_AUTOMOTIVE = 3, } diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLensFacing.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLensFacing.aidl new file mode 100644 index 0000000000..704da86461 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLensFacing.aidl @@ -0,0 +1,46 @@ +/* + * 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.automotive.lens.facing enumeration values + * @see ANDROID_AUTOMOTIVE_LENS_FACING + */ +@VintfStability +@Backing(type="int") +enum AutomotiveLensFacing { + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_OTHER, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_FRONT, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_REAR, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_LEFT, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_RIGHT, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_OTHER, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_LEFT, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_CENTER, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_RIGHT, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_LEFT, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_CENTER, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_RIGHT, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_LEFT, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_CENTER, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_RIGHT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLocation.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLocation.aidl new file mode 100644 index 0000000000..c55563d76a --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLocation.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. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** android.automotive.location enumeration values + * @see ANDROID_AUTOMOTIVE_LOCATION + */ +@VintfStability +@Backing(type="int") +enum AutomotiveLocation { + ANDROID_AUTOMOTIVE_LOCATION_INTERIOR, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_OTHER, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_FRONT, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_REAR, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_LEFT, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_RIGHT, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_OTHER, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_FRONT, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_REAR, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_LEFT, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_RIGHT, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl index cc3d3b38ce..99e28b9cc7 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl @@ -59,5 +59,7 @@ enum CameraMetadataSection { ANDROID_DISTORTION_CORRECTION, ANDROID_HEIC, ANDROID_HEIC_INFO, + ANDROID_AUTOMOTIVE, + ANDROID_AUTOMOTIVE_LENS, VENDOR_SECTION = 0x8000, } diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl index 93d6f13a8e..62c71e9a74 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl @@ -61,5 +61,7 @@ enum CameraMetadataSectionStart { ANDROID_DISTORTION_CORRECTION_START = CameraMetadataSection.ANDROID_DISTORTION_CORRECTION << 16, ANDROID_HEIC_START = CameraMetadataSection.ANDROID_HEIC << 16, ANDROID_HEIC_INFO_START = CameraMetadataSection.ANDROID_HEIC_INFO << 16, + ANDROID_AUTOMOTIVE_START = CameraMetadataSection.ANDROID_AUTOMOTIVE << 16, + ANDROID_AUTOMOTIVE_LENS_START = CameraMetadataSection.ANDROID_AUTOMOTIVE_LENS << 16, VENDOR_SECTION_START = CameraMetadataSection.VENDOR_SECTION << 16, } diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl index f20a06edae..fe91dcfdac 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl @@ -2232,4 +2232,15 @@ enum CameraMetadataTag { *

The maximum number of Jpeg APP segments supported by the camera HAL device.

*/ ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT, + /** android.automotive.location [static, enum, public] + * + *

Location of the cameras on the automotive devices.

+ */ + ANDROID_AUTOMOTIVE_LOCATION = CameraMetadataSectionStart.ANDROID_AUTOMOTIVE_START, + /** android.automotive.lens.facing [static, enum[], public] + * + *

The direction of the camera faces relative to the vehicle body frame and the + * passenger seats.

+ */ + ANDROID_AUTOMOTIVE_LENS_FACING = CameraMetadataSectionStart.ANDROID_AUTOMOTIVE_LENS_START, } diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl index ca18676303..3e6034b067 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl @@ -32,4 +32,5 @@ enum LensPoseReference { ANDROID_LENS_POSE_REFERENCE_PRIMARY_CAMERA, ANDROID_LENS_POSE_REFERENCE_GYROSCOPE, ANDROID_LENS_POSE_REFERENCE_UNDEFINED, + ANDROID_LENS_POSE_REFERENCE_AUTOMOTIVE, } -- GitLab From 261db780b41ba573b7e08e3fadabd1ffda6f783c Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Tue, 8 Mar 2022 23:21:19 +0000 Subject: [PATCH 683/825] composer: minor documentation fix Bug: NA Change-Id: I167f6a1224ceed48723f3af15a07d71fbde168cc Test: NA --- .../android/hardware/graphics/composer3/IComposerClient.aidl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 769f803905..bbc9c4620a 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -798,7 +798,7 @@ interface IComposerClient { * idle period. * * This function should only be called if the display reports support for - * DisplayCapability.DISPLAY_IDLE from getDisplayCapabilities. + * DisplayCapability.DISPLAY_IDLE_TIMER from getDisplayCapabilities. * * @param display is the display to which the idle timer is set. * @param timeoutMs is the minimum requirements of idle period in milliseconds. Panel -- GitLab From fbcf7ea5143a51059fadbf74e56508c6dd095a67 Mon Sep 17 00:00:00 2001 From: Avichal Rakesh Date: Wed, 9 Mar 2022 01:00:34 +0000 Subject: [PATCH 684/825] Camera: Misc VTS test fixes This CL fixes two tests: * `systemCameraTest`: Fix incorrect vector initialization. The test was accidentally using the size constructor instead of initialization list constructor. * `processMultiCaptureRequestPreview`: Allow unsupported stream configs. The test assumed that all stream combinations from physical cameras that back a LogicalMultiCamera were supported. This led to false test failures. This CL allows the test to exit early if the HAL reports that a stream combination is not supported. Bug: 222648486 Test: `test VtsAidlHalCameraProvider_TargetTest` pass on failing devices Change-Id: I009cc2f4b8b94a26b813883cdc1403ae0eb5c477 --- .../VtsAidlHalCameraProvider_TargetTest.cpp | 19 +++++++++++++------ camera/provider/aidl/vts/camera_aidl_test.cpp | 11 ++++++++++- camera/provider/aidl/vts/camera_aidl_test.h | 3 ++- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp index d1fa94e5e3..463f5d186a 100644 --- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp +++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp @@ -163,7 +163,7 @@ TEST_P(CameraAidlTest, systemCameraTest) { std::map> hiddenPhysicalIdToLogicalMap; for (const auto& name : cameraDeviceNames) { std::shared_ptr device; - ALOGI("getCameraCharacteristics: Testing camera device %s", name.c_str()); + ALOGI("systemCameraTest: Testing camera device %s", name.c_str()); ndk::ScopedAStatus ret = mProvider->getCameraDeviceInterface(name, &device); ASSERT_TRUE(ret.isOk()); ASSERT_NE(device, nullptr); @@ -196,13 +196,14 @@ TEST_P(CameraAidlTest, systemCameraTest) { break; } } + // For hidden physical cameras, collect their associated logical cameras // and store the system camera kind. if (!isPublicId) { auto it = hiddenPhysicalIdToLogicalMap.find(physicalId); if (it == hiddenPhysicalIdToLogicalMap.end()) { hiddenPhysicalIdToLogicalMap.insert(std::make_pair( - physicalId, std::vector(systemCameraKind))); + physicalId, std::vector({systemCameraKind}))); } else { it->second.push_back(systemCameraKind); } @@ -1450,6 +1451,7 @@ TEST_P(CameraAidlTest, processMultiCaptureRequestPreview) { for (const auto& name : cameraDeviceNames) { std::string version, deviceId; + ALOGI("processMultiCaptureRequestPreview: Test device %s", name.c_str()); ASSERT_TRUE(matchDeviceName(name, mProviderType, &version, &deviceId)); CameraMetadata metadata; @@ -1466,6 +1468,7 @@ TEST_P(CameraAidlTest, processMultiCaptureRequestPreview) { ASSERT_TRUE(ret.isOk()); continue; } + ASSERT_EQ(Status::OK, rc); std::unordered_set physicalIds; rc = getPhysicalCameraIds(staticMeta, &physicalIds); @@ -1521,10 +1524,14 @@ TEST_P(CameraAidlTest, processMultiCaptureRequestPreview) { Stream previewStream; std::shared_ptr cb; - configurePreviewStreams(name, mProvider, &previewThreshold, physicalIds, &mSession, - &previewStream, &halStreams /*out*/, - &supportsPartialResults /*out*/, &partialResultCount /*out*/, - &useHalBufManager /*out*/, &cb /*out*/, 0 /*streamConfigCounter*/); + configurePreviewStreams( + name, mProvider, &previewThreshold, physicalIds, &mSession, &previewStream, + &halStreams /*out*/, &supportsPartialResults /*out*/, &partialResultCount /*out*/, + &useHalBufManager /*out*/, &cb /*out*/, 0 /*streamConfigCounter*/, true); + if (mSession == nullptr) { + // stream combination not supported by HAL, skip test for device + continue; + } ::aidl::android::hardware::common::fmq::MQDescriptor< int8_t, aidl::android::hardware::common::fmq::SynchronizedReadWrite> diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp index 858dfd5fdc..ee0c6914d4 100644 --- a/camera/provider/aidl/vts/camera_aidl_test.cpp +++ b/camera/provider/aidl/vts/camera_aidl_test.cpp @@ -1564,6 +1564,7 @@ void CameraAidlTest::openEmptyDeviceSession(const std::string& name, ASSERT_NE(*session, nullptr); ret = (*device)->getCameraCharacteristics(staticMeta); + ASSERT_TRUE(ret.isOk()); } void CameraAidlTest::openEmptyInjectionSession(const std::string& name, @@ -2474,7 +2475,7 @@ void CameraAidlTest::configurePreviewStreams( std::shared_ptr* session, Stream* previewStream, std::vector* halStreams, bool* supportsPartialResults, int32_t* partialResultCount, bool* useHalBufManager, std::shared_ptr* cb, - int32_t streamConfigCounter) { + int32_t streamConfigCounter, bool allowUnsupport) { ASSERT_NE(nullptr, session); ASSERT_NE(nullptr, halStreams); ASSERT_NE(nullptr, previewStream); @@ -2561,6 +2562,14 @@ void CameraAidlTest::configurePreviewStreams( bool supported = false; ret = device->isStreamCombinationSupported(config, &supported); ASSERT_TRUE(ret.isOk()); + if (allowUnsupport && !supported) { + // stream combination not supported. return null session + ret = (*session)->close(); + ASSERT_TRUE(ret.isOk()); + *session = nullptr; + return; + } + ASSERT_TRUE(supported) << "Stream combination must be supported."; config.streamConfigCounter = streamConfigCounter; std::vector halConfigs; diff --git a/camera/provider/aidl/vts/camera_aidl_test.h b/camera/provider/aidl/vts/camera_aidl_test.h index 1ca457b331..ac4b2c9d0e 100644 --- a/camera/provider/aidl/vts/camera_aidl_test.h +++ b/camera/provider/aidl/vts/camera_aidl_test.h @@ -190,7 +190,8 @@ class CameraAidlTest : public ::testing::TestWithParam { std::shared_ptr* session /*out*/, Stream* previewStream /*out*/, std::vector* halStreams /*out*/, bool* supportsPartialResults /*out*/, int32_t* partialResultCount /*out*/, bool* useHalBufManager /*out*/, - std::shared_ptr* cb /*out*/, int32_t streamConfigCounter = 0); + std::shared_ptr* cb /*out*/, int32_t streamConfigCounter = 0, + bool allowUnsupport = false); void configurePreviewStream( const std::string& name, const std::shared_ptr& provider, -- GitLab From 36efa7161a8824fb2115af0a8a4b9999e357c77b Mon Sep 17 00:00:00 2001 From: Shuzhen Wang Date: Tue, 8 Mar 2022 10:10:44 -0800 Subject: [PATCH 685/825] Camera: Increase bit depth of stream use case to 64 Test: Camera CTS Bug: 223387965 Change-Id: I23a4324602ed37cf38c7a1a34dade615c4adb72b --- camera/metadata/3.8/types.hal | 2 +- .../ScalerAvailableStreamUseCases.aidl | 2 +- .../ScalerAvailableStreamUseCases.aidl | 2 +- .../VtsHalCameraProviderV2_4TargetTest.cpp | 22 +++++++++---------- .../VtsAidlHalCameraProvider_TargetTest.cpp | 8 +++---- camera/provider/aidl/vts/camera_aidl_test.cpp | 12 +++++----- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/camera/metadata/3.8/types.hal b/camera/metadata/3.8/types.hal index 06839873c3..8cc6646799 100644 --- a/camera/metadata/3.8/types.hal +++ b/camera/metadata/3.8/types.hal @@ -194,7 +194,7 @@ enum CameraMetadataEnumAndroidScalerAvailableRecommendedStreamConfigurations : /** android.scaler.availableStreamUseCases enumeration values * @see ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES */ -enum CameraMetadataEnumAndroidScalerAvailableStreamUseCases : uint32_t { +enum CameraMetadataEnumAndroidScalerAvailableStreamUseCases : int64_t { ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0x0, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 0x1, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE = 0x2, diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl index 0ed55a325e..bfa4f1ae8b 100644 --- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl @@ -36,7 +36,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.camera.metadata; -@Backing(type="int") @VintfStability +@Backing(type="long") @VintfStability enum ScalerAvailableStreamUseCases { ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 1, diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl index 19ebab5a0a..1b80032f59 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl @@ -27,7 +27,7 @@ package android.hardware.camera.metadata; * @see ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES */ @VintfStability -@Backing(type="int") +@Backing(type="long") enum ScalerAvailableStreamUseCases { ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0x0, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 0x1, diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index ab867cd4af..f89c71d241 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -222,7 +222,7 @@ enum SystemCameraKind { HIDDEN_SECURE_CAMERA }; -const static std::vector kMandatoryUseCases = { +const static std::vector kMandatoryUseCases = { ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE, @@ -6995,16 +6995,16 @@ TEST_P(CameraHidlTest, configureStreamsUseCases) { ASSERT_NE(0u, outputPreviewStreams.size()); // Combine valid and invalid stream use cases - std::vector useCases(kMandatoryUseCases); + std::vector useCases(kMandatoryUseCases); useCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL + 1); - std::vector supportedUseCases; + std::vector supportedUseCases; camera_metadata_ro_entry entry; auto retcode = find_camera_metadata_ro_entry(staticMeta, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, &entry); if ((0 == retcode) && (entry.count > 0)) { - supportedUseCases.insert(supportedUseCases.end(), entry.data.i32, - entry.data.i32 + entry.count); + supportedUseCases.insert(supportedUseCases.end(), entry.data.i64, + entry.data.i64 + entry.count); } else { supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT); } @@ -7038,7 +7038,7 @@ TEST_P(CameraHidlTest, configureStreamsUseCases) { }); ASSERT_TRUE(ret.isOk()); - for (int32_t useCase : useCases) { + for (int64_t useCase : useCases) { bool useCaseSupported = std::find(supportedUseCases.begin(), supportedUseCases.end(), useCase) != supportedUseCases.end(); @@ -9488,19 +9488,19 @@ void CameraHidlTest::verifyStreamUseCaseCharacteristics(const camera_metadata_t* if ((0 == retcode) && (entry.count > 0)) { supportMandatoryUseCases = true; for (size_t i = 0; i < kMandatoryUseCases.size(); i++) { - if (std::find(entry.data.i32, entry.data.i32 + entry.count, kMandatoryUseCases[i]) - == entry.data.i32 + entry.count) { + if (std::find(entry.data.i64, entry.data.i64 + entry.count, kMandatoryUseCases[i]) + == entry.data.i64 + entry.count) { supportMandatoryUseCases = false; break; } } bool supportDefaultUseCase = false; for (size_t i = 0; i < entry.count; i++) { - if (entry.data.i32[i] == ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT) { + if (entry.data.i64[i] == ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT) { supportDefaultUseCase = true; } - ASSERT_TRUE(entry.data.i32[i] <= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL || - entry.data.i32[i] >= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START); + ASSERT_TRUE(entry.data.i64[i] <= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL || + entry.data.i64[i] >= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START); } ASSERT_TRUE(supportDefaultUseCase); } diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp index d1fa94e5e3..5e8d1aeb2d 100644 --- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp +++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp @@ -50,7 +50,7 @@ const uint32_t kMaxStillHeight = 1536; const int64_t kEmptyFlushTimeoutMSec = 200; -const static std::vector kMandatoryUseCases = { +const static std::vector kMandatoryUseCases = { ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE, @@ -2974,10 +2974,10 @@ TEST_P(CameraAidlTest, configureStreamsUseCases) { ASSERT_NE(0u, outputPreviewStreams.size()); // Combine valid and invalid stream use cases - std::vector useCases(kMandatoryUseCases); + std::vector useCases(kMandatoryUseCases); useCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL + 1); - std::vector supportedUseCases; + std::vector supportedUseCases; camera_metadata_ro_entry entry; auto retcode = find_camera_metadata_ro_entry( staticMeta, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, &entry); @@ -3013,7 +3013,7 @@ TEST_P(CameraAidlTest, configureStreamsUseCases) { ASSERT_TRUE(ret.isOk()); config.sessionParams = req; - for (int32_t useCase : useCases) { + for (int64_t useCase : useCases) { bool useCaseSupported = std::find(supportedUseCases.begin(), supportedUseCases.end(), useCase) != supportedUseCases.end(); diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp index 858dfd5fdc..bb02d902fc 100644 --- a/camera/provider/aidl/vts/camera_aidl_test.cpp +++ b/camera/provider/aidl/vts/camera_aidl_test.cpp @@ -120,7 +120,7 @@ bool parseProviderName(const std::string& serviceDescriptor, std::string* type / return true; } -const std::vector kMandatoryUseCases = { +const std::vector kMandatoryUseCases = { ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE, @@ -328,19 +328,19 @@ void CameraAidlTest::verifyStreamUseCaseCharacteristics(const camera_metadata_t* if ((0 == retcode) && (entry.count > 0)) { supportMandatoryUseCases = true; for (size_t i = 0; i < kMandatoryUseCases.size(); i++) { - if (std::find(entry.data.i32, entry.data.i32 + entry.count, kMandatoryUseCases[i]) == - entry.data.i32 + entry.count) { + if (std::find(entry.data.i64, entry.data.i64 + entry.count, kMandatoryUseCases[i]) == + entry.data.i64 + entry.count) { supportMandatoryUseCases = false; break; } } bool supportDefaultUseCase = false; for (size_t i = 0; i < entry.count; i++) { - if (entry.data.i32[i] == ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT) { + if (entry.data.i64[i] == ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT) { supportDefaultUseCase = true; } - ASSERT_TRUE(entry.data.i32[i] <= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL || - entry.data.i32[i] >= + ASSERT_TRUE(entry.data.i64[i] <= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL || + entry.data.i64[i] >= ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START); } ASSERT_TRUE(supportDefaultUseCase); -- GitLab From 88561d938085dcbb1916e22acd553a30d4366f93 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 10 Mar 2022 10:26:47 -0800 Subject: [PATCH 686/825] uwb(hal): Add 2 CCC specific error codes in vendor portion Note: This update is in the types-only package that we plan to update throughout the year. Bug: 222291913 Test: Compiles Change-Id: Iffc7532a86f3beb6b9f745faf4a523d6d0017542 --- .../fira_android/UwbVendorStatusCodes.aidl | 39 +++++++++++++++++++ .../fira_android/UwbVendorStatusCodes.aidl | 36 +++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl create mode 100644 uwb/aidl/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl new file mode 100644 index 0000000000..2f534df10c --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.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 -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.uwb.fira_android; +@Backing(type="byte") @VintfStability +enum UwbVendorStatusCodes { + STATUS_ERROR_CCC_SE_BUSY = 80, + STATUS_ERROR_CCC_LIFECYCLE = 81, +} diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl new file mode 100644 index 0000000000..8505b8a7cf --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.uwb.fira_android; + +/** + * Android specific vendor status codes should be defined here. + * + */ +@VintfStability +@Backing(type="byte") +enum UwbVendorStatusCodes { + /** + * Use values from the vendor specific status code range: 0x50 – 0xFF defined in Table 32 of + * UCI specification. + */ + + /** CCC specific */ + /** Secure element is busy */ + STATUS_ERROR_CCC_SE_BUSY = 0x50, + /** CCC Lifecycle error */ + STATUS_ERROR_CCC_LIFECYCLE = 0x51, +} -- GitLab From 75a6af2318c076849d67a8d0fe038b669075fa57 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Fri, 4 Mar 2022 13:46:52 -0800 Subject: [PATCH 687/825] Hide all GNSS AIDL interfaces/parcelables/enums Bug: 201253590 Test: atest VtsHalGnssTargetTest Change-Id: I8062085f5cb148189eebd6a7e7addf1b20de37db --- gnss/aidl/Android.bp | 8 +++++++- .../current/android/hardware/gnss/BlocklistedSource.aidl | 1 + .../current/android/hardware/gnss/CorrelationVector.aidl | 1 + .../current/android/hardware/gnss/ElapsedRealtime.aidl | 1 + .../current/android/hardware/gnss/GnssClock.aidl | 1 + .../android/hardware/gnss/GnssConstellationType.aidl | 1 + .../current/android/hardware/gnss/GnssData.aidl | 1 + .../current/android/hardware/gnss/GnssLocation.aidl | 1 + .../current/android/hardware/gnss/GnssMeasurement.aidl | 1 + .../android/hardware/gnss/GnssMultipathIndicator.aidl | 1 + .../current/android/hardware/gnss/GnssPowerStats.aidl | 1 + .../current/android/hardware/gnss/GnssSignalType.aidl | 1 + .../current/android/hardware/gnss/IAGnss.aidl | 1 + .../current/android/hardware/gnss/IAGnssCallback.aidl | 1 + .../current/android/hardware/gnss/IAGnssRil.aidl | 1 + .../current/android/hardware/gnss/IAGnssRilCallback.aidl | 1 + .../current/android/hardware/gnss/IGnss.aidl | 1 + .../current/android/hardware/gnss/IGnssAntennaInfo.aidl | 1 + .../android/hardware/gnss/IGnssAntennaInfoCallback.aidl | 1 + .../current/android/hardware/gnss/IGnssBatching.aidl | 1 + .../android/hardware/gnss/IGnssBatchingCallback.aidl | 1 + .../current/android/hardware/gnss/IGnssCallback.aidl | 1 + .../current/android/hardware/gnss/IGnssConfiguration.aidl | 1 + .../current/android/hardware/gnss/IGnssDebug.aidl | 1 + .../current/android/hardware/gnss/IGnssGeofence.aidl | 1 + .../android/hardware/gnss/IGnssGeofenceCallback.aidl | 1 + .../android/hardware/gnss/IGnssMeasurementCallback.aidl | 1 + .../android/hardware/gnss/IGnssMeasurementInterface.aidl | 1 + .../hardware/gnss/IGnssNavigationMessageCallback.aidl | 1 + .../hardware/gnss/IGnssNavigationMessageInterface.aidl | 1 + .../android/hardware/gnss/IGnssPowerIndication.aidl | 1 + .../hardware/gnss/IGnssPowerIndicationCallback.aidl | 1 + .../current/android/hardware/gnss/IGnssPsds.aidl | 1 + .../current/android/hardware/gnss/IGnssPsdsCallback.aidl | 1 + .../current/android/hardware/gnss/PsdsType.aidl | 1 + .../current/android/hardware/gnss/SatelliteClockInfo.aidl | 1 + .../android/hardware/gnss/SatellitePositionEcef.aidl | 1 + .../current/android/hardware/gnss/SatellitePvt.aidl | 1 + .../android/hardware/gnss/SatelliteVelocityEcef.aidl | 1 + .../IMeasurementCorrectionsCallback.aidl | 1 + .../IMeasurementCorrectionsInterface.aidl | 1 + .../measurement_corrections/MeasurementCorrections.aidl | 1 + .../gnss/measurement_corrections/ReflectingPlane.aidl | 1 + .../gnss/measurement_corrections/SingleSatCorrection.aidl | 1 + .../gnss/visibility_control/IGnssVisibilityControl.aidl | 1 + .../IGnssVisibilityControlCallback.aidl | 1 + gnss/aidl/android/hardware/gnss/BlocklistedSource.aidl | 4 +++- gnss/aidl/android/hardware/gnss/CorrelationVector.aidl | 2 ++ gnss/aidl/android/hardware/gnss/ElapsedRealtime.aidl | 4 +++- gnss/aidl/android/hardware/gnss/GnssClock.aidl | 4 +++- .../aidl/android/hardware/gnss/GnssConstellationType.aidl | 4 +++- gnss/aidl/android/hardware/gnss/GnssData.aidl | 2 ++ gnss/aidl/android/hardware/gnss/GnssLocation.aidl | 2 +- gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl | 2 ++ .../android/hardware/gnss/GnssMultipathIndicator.aidl | 4 +++- gnss/aidl/android/hardware/gnss/GnssPowerStats.aidl | 4 +++- gnss/aidl/android/hardware/gnss/GnssSignalType.aidl | 2 ++ gnss/aidl/android/hardware/gnss/IAGnss.aidl | 6 +++++- gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl | 6 +++++- gnss/aidl/android/hardware/gnss/IAGnssRil.aidl | 2 ++ gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl | 2 ++ gnss/aidl/android/hardware/gnss/IGnss.aidl | 2 ++ gnss/aidl/android/hardware/gnss/IGnssAntennaInfo.aidl | 2 ++ .../android/hardware/gnss/IGnssAntennaInfoCallback.aidl | 2 ++ gnss/aidl/android/hardware/gnss/IGnssBatching.aidl | 2 ++ .../aidl/android/hardware/gnss/IGnssBatchingCallback.aidl | 6 +++++- gnss/aidl/android/hardware/gnss/IGnssCallback.aidl | 2 ++ gnss/aidl/android/hardware/gnss/IGnssConfiguration.aidl | 4 +++- gnss/aidl/android/hardware/gnss/IGnssDebug.aidl | 2 ++ gnss/aidl/android/hardware/gnss/IGnssGeofence.aidl | 6 +++++- .../aidl/android/hardware/gnss/IGnssGeofenceCallback.aidl | 2 ++ .../android/hardware/gnss/IGnssMeasurementCallback.aidl | 4 +++- .../android/hardware/gnss/IGnssMeasurementInterface.aidl | 2 ++ .../hardware/gnss/IGnssNavigationMessageCallback.aidl | 6 +++++- .../hardware/gnss/IGnssNavigationMessageInterface.aidl | 2 ++ gnss/aidl/android/hardware/gnss/IGnssPowerIndication.aidl | 4 +++- .../hardware/gnss/IGnssPowerIndicationCallback.aidl | 4 +++- gnss/aidl/android/hardware/gnss/IGnssPsds.aidl | 4 +++- gnss/aidl/android/hardware/gnss/IGnssPsdsCallback.aidl | 4 +++- gnss/aidl/android/hardware/gnss/PsdsType.aidl | 6 +++++- gnss/aidl/android/hardware/gnss/SatelliteClockInfo.aidl | 2 ++ .../aidl/android/hardware/gnss/SatellitePositionEcef.aidl | 2 ++ gnss/aidl/android/hardware/gnss/SatellitePvt.aidl | 2 ++ .../aidl/android/hardware/gnss/SatelliteVelocityEcef.aidl | 2 ++ .../IMeasurementCorrectionsCallback.aidl | 2 ++ .../IMeasurementCorrectionsInterface.aidl | 2 ++ .../measurement_corrections/MeasurementCorrections.aidl | 2 ++ .../gnss/measurement_corrections/ReflectingPlane.aidl | 2 ++ .../gnss/measurement_corrections/SingleSatCorrection.aidl | 2 ++ .../gnss/visibility_control/IGnssVisibilityControl.aidl | 2 ++ .../IGnssVisibilityControlCallback.aidl | 2 ++ 91 files changed, 171 insertions(+), 20 deletions(-) diff --git a/gnss/aidl/Android.bp b/gnss/aidl/Android.bp index 4d9c5cc231..cc7c4e9183 100644 --- a/gnss/aidl/Android.bp +++ b/gnss/aidl/Android.bp @@ -42,5 +42,11 @@ aidl_interface { }, }, }, - versions: ["1"], + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/BlocklistedSource.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/BlocklistedSource.aidl index a4f00971c5..ccb2b281db 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/BlocklistedSource.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/BlocklistedSource.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability parcelable BlocklistedSource { android.hardware.gnss.GnssConstellationType constellation = android.hardware.gnss.GnssConstellationType.UNKNOWN; diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/CorrelationVector.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/CorrelationVector.aidl index b0848bb9c4..b9590036db 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/CorrelationVector.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/CorrelationVector.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability parcelable CorrelationVector { double frequencyOffsetMps; 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 7d3baa41f2..559ed2915f 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability parcelable ElapsedRealtime { int flags; 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 c54cc2c500..a8454ddfc0 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability parcelable GnssClock { int gnssClockFlags; diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssConstellationType.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssConstellationType.aidl index c1fcfcc741..fee2ef67c3 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssConstellationType.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssConstellationType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @Backing(type="int") @VintfStability enum GnssConstellationType { UNKNOWN = 0, diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl index 01a3b3a19e..31426f0507 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssData.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability parcelable GnssData { android.hardware.gnss.GnssMeasurement[] measurements; 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 54c126c281..ed9dcfa967 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability parcelable GnssLocation { int gnssLocationFlags; 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 948c540fc3..8a44887419 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability parcelable GnssMeasurement { int flags; diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMultipathIndicator.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMultipathIndicator.aidl index 24f45c42fa..62ade9c3e8 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMultipathIndicator.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMultipathIndicator.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @Backing(type="int") @VintfStability enum GnssMultipathIndicator { UNKNOWN = 0, diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssPowerStats.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssPowerStats.aidl index 670244fd1f..c4a9e6179e 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssPowerStats.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssPowerStats.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability parcelable GnssPowerStats { android.hardware.gnss.ElapsedRealtime elapsedRealtime; 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 c2a5b51e15..4a49547b49 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability parcelable GnssSignalType { android.hardware.gnss.GnssConstellationType constellation = android.hardware.gnss.GnssConstellationType.UNKNOWN; diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnss.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnss.aidl index 1a69f3338a..639539ad65 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnss.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnss.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IAGnss { void setCallback(in android.hardware.gnss.IAGnssCallback callback); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssCallback.aidl index 2a46f61758..b2da8d9583 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssCallback.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssCallback.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IAGnssCallback { void agnssStatusCb(in android.hardware.gnss.IAGnssCallback.AGnssType type, in android.hardware.gnss.IAGnssCallback.AGnssStatusValue status); 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 69fa32b21e..8930752f7f 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IAGnssRil { void setCallback(in android.hardware.gnss.IAGnssRilCallback callback); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.aidl index 152b10aea0..3717026622 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRilCallback.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IAGnssRilCallback { void requestSetIdCb(in int setIdflag); 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 56574344a8..0e6405ea7c 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnss { void setCallback(in android.hardware.gnss.IGnssCallback callback); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfo.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfo.aidl index 2734ac1d69..43ad328e5c 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfo.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssAntennaInfo { void setCallback(in android.hardware.gnss.IGnssAntennaInfoCallback callback); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfoCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfoCallback.aidl index ada97077e7..eb6abe55f8 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfoCallback.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssAntennaInfoCallback.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssAntennaInfoCallback { void gnssAntennaInfoCb(in android.hardware.gnss.IGnssAntennaInfoCallback.GnssAntennaInfo[] gnssAntennaInfos); 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 e1beed3b89..d82aa1fe07 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssBatching { void init(in android.hardware.gnss.IGnssBatchingCallback callback); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatchingCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatchingCallback.aidl index 427137ab26..b12a8bd519 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatchingCallback.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatchingCallback.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssBatchingCallback { void gnssLocationBatchCb(in android.hardware.gnss.GnssLocation[] locations); 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 957a75fe9a..48c88f5ffe 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssCallback { void gnssSetCapabilitiesCb(in int capabilities); 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 54cd022f66..1d6399e52b 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssConfiguration { void setSuplVersion(in int version); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl index 8e4b5f2c73..591b53301f 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssDebug { android.hardware.gnss.IGnssDebug.DebugData getDebugData(); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofence.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofence.aidl index 50da5bf4aa..5065ad49c8 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofence.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofence.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssGeofence { void setCallback(in android.hardware.gnss.IGnssGeofenceCallback callback); 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 26482eadeb..df5dc2d919 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssGeofenceCallback { void gnssGeofenceTransitionCb(in int geofenceId, in android.hardware.gnss.GnssLocation location, in int transition, in long timestampMillis); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssMeasurementCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssMeasurementCallback.aidl index 6e626172b9..624a7ae84d 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssMeasurementCallback.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssMeasurementCallback.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssMeasurementCallback { void gnssMeasurementCb(in android.hardware.gnss.GnssData data); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssMeasurementInterface.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssMeasurementInterface.aidl index 9c4a54beb1..6fe6a6c6fd 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssMeasurementInterface.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssMeasurementInterface.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssMeasurementInterface { void setCallback(in android.hardware.gnss.IGnssMeasurementCallback callback, in boolean enableFullTracking, in boolean enableCorrVecOutputs); 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 d513c15a85..c65cff21be 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssNavigationMessageCallback { void gnssNavigationMessageCb(in android.hardware.gnss.IGnssNavigationMessageCallback.GnssNavigationMessage message); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageInterface.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageInterface.aidl index 196e9b9334..187773dd81 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageInterface.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageInterface.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssNavigationMessageInterface { void setCallback(in android.hardware.gnss.IGnssNavigationMessageCallback callback); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndication.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndication.aidl index fbf1f6ffb6..f77dbfff86 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndication.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndication.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssPowerIndication { void setCallback(in android.hardware.gnss.IGnssPowerIndicationCallback callback); 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 bfa787e3e2..d35c77fdf1 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssPowerIndicationCallback { void setCapabilitiesCb(in int capabilities); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPsds.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPsds.aidl index 526ecc8fcd..3aee798b33 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPsds.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPsds.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssPsds { void injectPsdsData(in android.hardware.gnss.PsdsType psdsType, in byte[] psdsData); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPsdsCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPsdsCallback.aidl index 2205bc46dd..dadc9fb092 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPsdsCallback.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPsdsCallback.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability interface IGnssPsdsCallback { void downloadRequestCb(in android.hardware.gnss.PsdsType psdsType); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/PsdsType.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/PsdsType.aidl index 727bb6912b..60b15d63eb 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/PsdsType.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/PsdsType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @Backing(type="int") @VintfStability enum PsdsType { LONG_TERM = 1, diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatelliteClockInfo.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatelliteClockInfo.aidl index ed23e639a8..05f7733280 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatelliteClockInfo.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatelliteClockInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability parcelable SatelliteClockInfo { double satHardwareCodeBiasMeters; diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePositionEcef.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePositionEcef.aidl index e1a20c378e..3d4f7ff6e2 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePositionEcef.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePositionEcef.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability parcelable SatellitePositionEcef { double posXMeters; 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 dc875fae8b..5fd411fa84 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability parcelable SatellitePvt { int flags; diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatelliteVelocityEcef.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatelliteVelocityEcef.aidl index a571048c20..94d0b344b7 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatelliteVelocityEcef.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatelliteVelocityEcef.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss; +/* @hide */ @VintfStability parcelable SatelliteVelocityEcef { double velXMps; 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 c4cf13f406..4126702a2d 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss.measurement_corrections; +/* @hide */ @VintfStability interface IMeasurementCorrectionsCallback { void setCapabilitiesCb(in int capabilities); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl index 5dc55960c5..bd305345f6 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss.measurement_corrections; +/* @hide */ @VintfStability interface IMeasurementCorrectionsInterface { void setCorrections(in android.hardware.gnss.measurement_corrections.MeasurementCorrections corrections); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl index f32c8c27bf..35fd79e57e 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss.measurement_corrections; +/* @hide */ @VintfStability parcelable MeasurementCorrections { double latitudeDegrees; diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl index 90c3818b1c..bb7d800fa9 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss.measurement_corrections; +/* @hide */ @VintfStability parcelable ReflectingPlane { double latitudeDegrees; 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 d18c1a7339..53baa01d33 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 @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss.measurement_corrections; +/* @hide */ @VintfStability parcelable SingleSatCorrection { int singleSatCorrectionFlags; diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl index f6740992c4..d7a7a9651f 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss.visibility_control; +/* @hide */ @VintfStability interface IGnssVisibilityControl { void enableNfwLocationAccess(in @utf8InCpp String[] proxyApps); diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl index 37e1886576..c9b96f50bb 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.gnss.visibility_control; +/* @hide */ @VintfStability interface IGnssVisibilityControlCallback { void nfwNotifyCb(in android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwNotification notification); diff --git a/gnss/aidl/android/hardware/gnss/BlocklistedSource.aidl b/gnss/aidl/android/hardware/gnss/BlocklistedSource.aidl index 8b730921ff..0c40a49f9b 100644 --- a/gnss/aidl/android/hardware/gnss/BlocklistedSource.aidl +++ b/gnss/aidl/android/hardware/gnss/BlocklistedSource.aidl @@ -20,6 +20,8 @@ import android.hardware.gnss.GnssConstellationType; /** * Represents a blocklisted source. + * + * @hide */ @VintfStability parcelable BlocklistedSource { @@ -33,4 +35,4 @@ parcelable BlocklistedSource { * svid's for the specified constellation. */ int svid; -} \ No newline at end of file +} diff --git a/gnss/aidl/android/hardware/gnss/CorrelationVector.aidl b/gnss/aidl/android/hardware/gnss/CorrelationVector.aidl index 6fbabbc140..a933c67add 100644 --- a/gnss/aidl/android/hardware/gnss/CorrelationVector.aidl +++ b/gnss/aidl/android/hardware/gnss/CorrelationVector.aidl @@ -19,6 +19,8 @@ package android.hardware.gnss; /** * Contains info about the correlation output of incoming GNSS signal and a local copy of * its corresponding spreading code at a given frequency offset. + * + * @hide */ @VintfStability parcelable CorrelationVector { diff --git a/gnss/aidl/android/hardware/gnss/ElapsedRealtime.aidl b/gnss/aidl/android/hardware/gnss/ElapsedRealtime.aidl index 67d090eb24..67ecbcb580 100644 --- a/gnss/aidl/android/hardware/gnss/ElapsedRealtime.aidl +++ b/gnss/aidl/android/hardware/gnss/ElapsedRealtime.aidl @@ -18,6 +18,8 @@ package android.hardware.gnss; /** * Cumulative GNSS power statistics since boot. + * + * @hide */ @VintfStability parcelable ElapsedRealtime { @@ -50,4 +52,4 @@ parcelable ElapsedRealtime { * reported measurements in nanoseconds (68% confidence). */ double timeUncertaintyNs; -} \ No newline at end of file +} diff --git a/gnss/aidl/android/hardware/gnss/GnssClock.aidl b/gnss/aidl/android/hardware/gnss/GnssClock.aidl index f416e08e5f..f5c090bd05 100644 --- a/gnss/aidl/android/hardware/gnss/GnssClock.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssClock.aidl @@ -20,6 +20,8 @@ import android.hardware.gnss.GnssSignalType; /** * Represents an estimate of the GNSS clock time. + * + * @hide */ @VintfStability parcelable GnssClock { @@ -200,4 +202,4 @@ parcelable GnssClock { * Reference GNSS signal type for inter-signal bias. */ GnssSignalType referenceSignalTypeForIsb; -} \ No newline at end of file +} diff --git a/gnss/aidl/android/hardware/gnss/GnssConstellationType.aidl b/gnss/aidl/android/hardware/gnss/GnssConstellationType.aidl index af3e089c5e..2efd1d9fde 100644 --- a/gnss/aidl/android/hardware/gnss/GnssConstellationType.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssConstellationType.aidl @@ -21,6 +21,8 @@ package android.hardware.gnss; * * This is to specify the navigation satellite system, for example, as listed in Section 3.5 in * RINEX Version 3.04. + * + * @hide */ @VintfStability @Backing(type="int") @@ -40,4 +42,4 @@ enum GnssConstellationType { GALILEO = 6, /** Indian Regional Navigation Satellite System. */ IRNSS = 7, -} \ No newline at end of file +} diff --git a/gnss/aidl/android/hardware/gnss/GnssData.aidl b/gnss/aidl/android/hardware/gnss/GnssData.aidl index 6b2068e700..075a0391e2 100644 --- a/gnss/aidl/android/hardware/gnss/GnssData.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssData.aidl @@ -28,6 +28,8 @@ import android.hardware.gnss.GnssMeasurement; * * - Reporting of GNSS constellation measurements is mandatory. * - Reporting of all tracked constellations are encouraged. + * + * @hide */ @VintfStability parcelable GnssData { diff --git a/gnss/aidl/android/hardware/gnss/GnssLocation.aidl b/gnss/aidl/android/hardware/gnss/GnssLocation.aidl index 25aea4d850..994685137a 100644 --- a/gnss/aidl/android/hardware/gnss/GnssLocation.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssLocation.aidl @@ -18,7 +18,7 @@ package android.hardware.gnss; import android.hardware.gnss.ElapsedRealtime; -/** Represents a location. */ +/** Represents a location. @hide */ @VintfStability parcelable GnssLocation { /** Bit mask to indicate GnssLocation has valid latitude and longitude. */ diff --git a/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl b/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl index efecddd41e..db724a49c8 100644 --- a/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl @@ -28,6 +28,8 @@ import android.hardware.gnss.SatellitePvt; * this struct must be based on GNSS signal measurements only. You must not synthesize measurements * by calculating or reporting expected measurements based on known or estimated position, velocity, * or time. + * + * @hide */ @VintfStability parcelable GnssMeasurement { diff --git a/gnss/aidl/android/hardware/gnss/GnssMultipathIndicator.aidl b/gnss/aidl/android/hardware/gnss/GnssMultipathIndicator.aidl index ec1ce62705..98ffe284f1 100644 --- a/gnss/aidl/android/hardware/gnss/GnssMultipathIndicator.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssMultipathIndicator.aidl @@ -19,6 +19,8 @@ package android.hardware.gnss; /** * Enumeration of available values for the GNSS Measurement's multipath * indicator. + * + * @hide */ @VintfStability @Backing(type="int") @@ -29,4 +31,4 @@ enum GnssMultipathIndicator { PRESENT = 1, /** The measurement is indicated to be not affected by multipath. */ NOT_PRESENT = 2, -} \ No newline at end of file +} diff --git a/gnss/aidl/android/hardware/gnss/GnssPowerStats.aidl b/gnss/aidl/android/hardware/gnss/GnssPowerStats.aidl index 2bea44dbb9..3f33dd6389 100644 --- a/gnss/aidl/android/hardware/gnss/GnssPowerStats.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssPowerStats.aidl @@ -20,6 +20,8 @@ import android.hardware.gnss.ElapsedRealtime; /** * Cumulative GNSS power statistics since boot. + * + * @hide */ @VintfStability parcelable GnssPowerStats { @@ -63,4 +65,4 @@ parcelable GnssPowerStats { * operating in each of the vendor-specific power modes. */ double[] otherModesEnergyMilliJoule; -} \ No newline at end of file +} diff --git a/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl b/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl index a16b170da4..241971fe93 100644 --- a/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl @@ -20,6 +20,8 @@ import android.hardware.gnss.GnssConstellationType; /** * Represents a GNSS signal type. + * + * @hide */ @VintfStability parcelable GnssSignalType { diff --git a/gnss/aidl/android/hardware/gnss/IAGnss.aidl b/gnss/aidl/android/hardware/gnss/IAGnss.aidl index 30b2167445..ca67e01ecf 100644 --- a/gnss/aidl/android/hardware/gnss/IAGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IAGnss.aidl @@ -19,7 +19,11 @@ package android.hardware.gnss; import android.hardware.gnss.IAGnssCallback; import android.hardware.gnss.IAGnssCallback.AGnssType; -/** Extended interface for Assisted GNSS support. */ +/** + * Extended interface for Assisted GNSS support. + * + * @hide + */ @VintfStability interface IAGnss { /** Access point name IP type */ diff --git a/gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl b/gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl index 8f881b7887..e3a16493f3 100644 --- a/gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IAGnssCallback.aidl @@ -16,7 +16,11 @@ package android.hardware.gnss; -/** Callback structure for the AGNSS interface. */ +/** + * Callback structure for the AGNSS interface. + * + * @hide + */ @VintfStability interface IAGnssCallback { /** AGNSS service type */ diff --git a/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl b/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl index b505d81c62..44847f0ab1 100644 --- a/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl +++ b/gnss/aidl/android/hardware/gnss/IAGnssRil.aidl @@ -23,6 +23,8 @@ import android.hardware.gnss.IAGnssRilCallback; * Layer interface allows the GNSS chipset to request radio interface layer * information from Android platform. Examples of such information are reference * location, unique subscriber ID, phone number string and network availability changes. + * + * @hide */ @VintfStability interface IAGnssRil { diff --git a/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl b/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl index 485626dc40..99fe2b74a2 100644 --- a/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IAGnssRilCallback.aidl @@ -19,6 +19,8 @@ package android.hardware.gnss; /** * Callback for IAGnssRil interface. Used to request SET ID and * Reference Location. + * + * @hide */ @VintfStability interface IAGnssRilCallback { diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl index 12fdbb4b7b..f0b583d164 100644 --- a/gnss/aidl/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl @@ -34,6 +34,8 @@ import android.hardware.gnss.visibility_control.IGnssVisibilityControl; /** * Represents the standard GNSS (Global Navigation Satellite System) interface. + * + * @hide */ @VintfStability interface IGnss { diff --git a/gnss/aidl/android/hardware/gnss/IGnssAntennaInfo.aidl b/gnss/aidl/android/hardware/gnss/IGnssAntennaInfo.aidl index de83b67bd6..3b173f995a 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssAntennaInfo.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssAntennaInfo.aidl @@ -20,6 +20,8 @@ import android.hardware.gnss.IGnssAntennaInfoCallback; /** * Extended interface for GNSS antenna information support. + * + * @hide */ @VintfStability interface IGnssAntennaInfo { diff --git a/gnss/aidl/android/hardware/gnss/IGnssAntennaInfoCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssAntennaInfoCallback.aidl index ef0a7fc6fd..48565518ca 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssAntennaInfoCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssAntennaInfoCallback.aidl @@ -18,6 +18,8 @@ package android.hardware.gnss; /** * The callback interface to report GNSS antenna information from the HAL. + * + * @hide */ @VintfStability interface IGnssAntennaInfoCallback { diff --git a/gnss/aidl/android/hardware/gnss/IGnssBatching.aidl b/gnss/aidl/android/hardware/gnss/IGnssBatching.aidl index 0d03a0f009..2880df6bb9 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssBatching.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssBatching.aidl @@ -32,6 +32,8 @@ import android.hardware.gnss.IGnssBatchingCallback; * As with GNSS Location outputs, source of location must be GNSS satellite measurements, optionally * using interial and baro sensors to improve relative motion filtering. No additional absolute * positioning information, such as WiFi derived location, may be mixed with the GNSS information. + * + * @hide */ @VintfStability interface IGnssBatching { diff --git a/gnss/aidl/android/hardware/gnss/IGnssBatchingCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssBatchingCallback.aidl index b1bfc5752a..36e8307f7a 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssBatchingCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssBatchingCallback.aidl @@ -18,7 +18,11 @@ package android.hardware.gnss; import android.hardware.gnss.GnssLocation; -/** The callback interface to report batched GNSS locations from the HAL. */ +/** + * The callback interface to report batched GNSS locations from the HAL. + * + * @hide + */ @VintfStability interface IGnssBatchingCallback { /** diff --git a/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl index 866606fcf7..8633bea070 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl @@ -25,6 +25,8 @@ import android.hardware.gnss.IGnssPsds; * This interface is required for the HAL to communicate certain information * like status and location info back to the framework, the framework implements * the interfaces and passes a handle to the HAL. + * + * @hide */ @VintfStability interface IGnssCallback { diff --git a/gnss/aidl/android/hardware/gnss/IGnssConfiguration.aidl b/gnss/aidl/android/hardware/gnss/IGnssConfiguration.aidl index e0ad3575f0..313ae22cc2 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssConfiguration.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssConfiguration.aidl @@ -20,6 +20,8 @@ import android.hardware.gnss.BlocklistedSource; /** * Extended interface for GNSS Configuration support. + * + * @hide */ @VintfStability interface IGnssConfiguration { @@ -119,4 +121,4 @@ interface IGnssConfiguration { * @param blocklist The BlocklistedSource(s) of satellites the HAL must not use. */ void setBlocklist(in BlocklistedSource[] blocklist); -} \ No newline at end of file +} diff --git a/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl b/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl index 3071dce569..9e1b5edc87 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl @@ -24,6 +24,8 @@ import android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource; * * This information is used for debugging purpose, e.g., shown in a bugreport to * describe the chipset states including time, position, and satellite data. + * + * @hide */ @VintfStability interface IGnssDebug { diff --git a/gnss/aidl/android/hardware/gnss/IGnssGeofence.aidl b/gnss/aidl/android/hardware/gnss/IGnssGeofence.aidl index bb4ff9307f..2a540a2661 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssGeofence.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssGeofence.aidl @@ -18,7 +18,11 @@ package android.hardware.gnss; import android.hardware.gnss.IGnssGeofenceCallback; -/** Extended interface for GNSS Geofence support. */ +/** + * Extended interface for GNSS Geofence support. + * + * @hide + */ @VintfStability interface IGnssGeofence { /** diff --git a/gnss/aidl/android/hardware/gnss/IGnssGeofenceCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssGeofenceCallback.aidl index c1769653b5..5cb8d9c934 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssGeofenceCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssGeofenceCallback.aidl @@ -90,6 +90,8 @@ import android.hardware.gnss.GnssLocation; * hopefully provide a definitive state transition to the third party * application. GNSS Geofence will just be a signal indicating what the GNSS * subsystem knows about the Geofence. + * + * @hide */ @VintfStability interface IGnssGeofenceCallback { diff --git a/gnss/aidl/android/hardware/gnss/IGnssMeasurementCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssMeasurementCallback.aidl index 328cf2abad..a8bd8a3219 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssMeasurementCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssMeasurementCallback.aidl @@ -20,6 +20,8 @@ import android.hardware.gnss.GnssData; /** * The callback interface to report GNSS Measurement from the HAL. + * + * @hide */ @VintfStability interface IGnssMeasurementCallback { @@ -29,4 +31,4 @@ interface IGnssMeasurementCallback { * @param data Contains a reading of GNSS measurements. */ void gnssMeasurementCb(in GnssData data); -} \ No newline at end of file +} diff --git a/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl b/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl index 102cdcd1d4..8062aed390 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl @@ -20,6 +20,8 @@ import android.hardware.gnss.IGnssMeasurementCallback; /** * Extended interface for GNSS Measurement support. + * + * @hide */ @VintfStability interface IGnssMeasurementInterface { diff --git a/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl index 0fdfaf81b2..6990e19ff6 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl @@ -16,7 +16,11 @@ package android.hardware.gnss; -/** Represents a GNSS navigation message (or a fragment of it). */ +/** + * Represents a GNSS navigation message (or a fragment of it). + * + * @hide + */ @VintfStability interface IGnssNavigationMessageCallback { /** diff --git a/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageInterface.aidl b/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageInterface.aidl index e2f57c3582..6c0f83a782 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageInterface.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageInterface.aidl @@ -20,6 +20,8 @@ import android.hardware.gnss.IGnssNavigationMessageCallback; /** * Extended interface for GNSS navigation message reporting support. + * + * @hide */ @VintfStability interface IGnssNavigationMessageInterface { diff --git a/gnss/aidl/android/hardware/gnss/IGnssPowerIndication.aidl b/gnss/aidl/android/hardware/gnss/IGnssPowerIndication.aidl index 93fdadc886..1486095b4e 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssPowerIndication.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssPowerIndication.aidl @@ -20,6 +20,8 @@ import android.hardware.gnss.IGnssPowerIndicationCallback; /** * Extended interface for GNSS Power Indication support. + * + * @hide */ @VintfStability interface IGnssPowerIndication { @@ -36,4 +38,4 @@ interface IGnssPowerIndication { * from IGnssPowerIndicationCallback.gnssPowerStatsCb(). */ oneway void requestGnssPowerStats(); -} \ No newline at end of file +} diff --git a/gnss/aidl/android/hardware/gnss/IGnssPowerIndicationCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssPowerIndicationCallback.aidl index 4474c0c69c..8e6a6e45d5 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssPowerIndicationCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssPowerIndicationCallback.aidl @@ -20,6 +20,8 @@ import android.hardware.gnss.GnssPowerStats; /** * The callback interface to report GNSS Power Indication from the HAL. + * + * @hide */ @VintfStability interface IGnssPowerIndicationCallback { @@ -60,4 +62,4 @@ interface IGnssPowerIndicationCallback { * @param gnssPowerStats GNSS power statistics since boot. */ oneway void gnssPowerStatsCb(in GnssPowerStats gnssPowerStats); -} \ No newline at end of file +} diff --git a/gnss/aidl/android/hardware/gnss/IGnssPsds.aidl b/gnss/aidl/android/hardware/gnss/IGnssPsds.aidl index 7c4609653f..8de2dcfca8 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssPsds.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssPsds.aidl @@ -22,6 +22,8 @@ import android.hardware.gnss.PsdsType; /** * This interface is used by the GNSS HAL to request the framework to download Predicted Satellite * Data Service data. + * + * @hide */ @VintfStability interface IGnssPsds { @@ -42,4 +44,4 @@ interface IGnssPsds { * @param callback Handle to the IGnssPsdsCallback interface. */ void setCallback(in IGnssPsdsCallback callback); -} \ No newline at end of file +} diff --git a/gnss/aidl/android/hardware/gnss/IGnssPsdsCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssPsdsCallback.aidl index 72b693b4a3..bc31000217 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssPsdsCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssPsdsCallback.aidl @@ -21,6 +21,8 @@ import android.hardware.gnss.PsdsType; /** * This interface is used by the GNSS HAL to request download data from Predicted Satellite Data * Service (PSDS). + * + * @hide */ @VintfStability interface IGnssPsdsCallback { @@ -34,4 +36,4 @@ interface IGnssPsdsCallback { * @param psdsType Type of PSDS data. */ void downloadRequestCb(in PsdsType psdsType); -} \ No newline at end of file +} diff --git a/gnss/aidl/android/hardware/gnss/PsdsType.aidl b/gnss/aidl/android/hardware/gnss/PsdsType.aidl index d4fec77ade..67a74c7e67 100644 --- a/gnss/aidl/android/hardware/gnss/PsdsType.aidl +++ b/gnss/aidl/android/hardware/gnss/PsdsType.aidl @@ -16,7 +16,11 @@ package android.hardware.gnss; -/** The type of PSDS data. */ +/** + * The type of PSDS data. + * + * @hide + */ @VintfStability @Backing(type="int") enum PsdsType { diff --git a/gnss/aidl/android/hardware/gnss/SatelliteClockInfo.aidl b/gnss/aidl/android/hardware/gnss/SatelliteClockInfo.aidl index 4b7d5d68cb..84f35ffc88 100644 --- a/gnss/aidl/android/hardware/gnss/SatelliteClockInfo.aidl +++ b/gnss/aidl/android/hardware/gnss/SatelliteClockInfo.aidl @@ -18,6 +18,8 @@ package android.hardware.gnss; /** * Contains estimates of the satellite clock info. + * + * @hide */ @VintfStability parcelable SatelliteClockInfo { diff --git a/gnss/aidl/android/hardware/gnss/SatellitePositionEcef.aidl b/gnss/aidl/android/hardware/gnss/SatellitePositionEcef.aidl index febe62333f..105cb85c4a 100644 --- a/gnss/aidl/android/hardware/gnss/SatellitePositionEcef.aidl +++ b/gnss/aidl/android/hardware/gnss/SatellitePositionEcef.aidl @@ -21,6 +21,8 @@ package android.hardware.gnss; * * The satellite position must be defined at the time of transmission of the * signal receivedSvTimeNs. + * + * @hide */ @VintfStability parcelable SatellitePositionEcef { diff --git a/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl b/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl index d9f767ab05..2d52415e56 100644 --- a/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl +++ b/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl @@ -23,6 +23,8 @@ import android.hardware.gnss.SatelliteVelocityEcef; /** * Contains estimates of the satellite position, velocity and time in the * ECEF coordinate frame. + * + * @hide */ @VintfStability parcelable SatellitePvt { diff --git a/gnss/aidl/android/hardware/gnss/SatelliteVelocityEcef.aidl b/gnss/aidl/android/hardware/gnss/SatelliteVelocityEcef.aidl index f2d7ab6030..3d3ea1add3 100644 --- a/gnss/aidl/android/hardware/gnss/SatelliteVelocityEcef.aidl +++ b/gnss/aidl/android/hardware/gnss/SatelliteVelocityEcef.aidl @@ -21,6 +21,8 @@ package android.hardware.gnss; * * The satellite velocity must be defined at the time of transmission of the * signal receivedSvTimeNs. + * + * @hide */ @VintfStability parcelable SatelliteVelocityEcef { diff --git a/gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl b/gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl index d695e70451..4732ffc813 100644 --- a/gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl @@ -18,6 +18,8 @@ package android.hardware.gnss.measurement_corrections; /** * GNSS measurement corrections callback interface. + * + * @hide */ @VintfStability interface IMeasurementCorrectionsCallback { diff --git a/gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl b/gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl index eeabc6d399..841fed3154 100644 --- a/gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl +++ b/gnss/aidl/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl @@ -21,6 +21,8 @@ import android.hardware.gnss.measurement_corrections.MeasurementCorrections; /** * Interface for measurement corrections support. + * + * @hide */ @VintfStability interface IMeasurementCorrectionsInterface { diff --git a/gnss/aidl/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl b/gnss/aidl/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl index 285c7d4faa..d6224b4fcc 100644 --- a/gnss/aidl/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl +++ b/gnss/aidl/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl @@ -22,6 +22,8 @@ import android.hardware.gnss.measurement_corrections.SingleSatCorrection; * A struct containing a set of measurement corrections for all used GNSS satellites at the location * specified by latitudeDegrees, longitudeDegrees, altitudeMeters and at the time of week specified * toaGpsNanosecondsOfWeek + * + * @hide */ @VintfStability parcelable MeasurementCorrections { diff --git a/gnss/aidl/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl b/gnss/aidl/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl index 9bf2b4417d..abd29f095b 100644 --- a/gnss/aidl/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl +++ b/gnss/aidl/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl @@ -23,6 +23,8 @@ package android.hardware.gnss.measurement_corrections; * The value is only valid if HAS_REFLECTING_PLANE flag is set. An invalid reflecting plane * means either reflection planes serving is not supported or the satellite signal has gone * through multiple reflections. + * + * @hide */ @VintfStability parcelable ReflectingPlane { diff --git a/gnss/aidl/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl b/gnss/aidl/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl index d9f7105170..36320ebb80 100644 --- a/gnss/aidl/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl +++ b/gnss/aidl/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl @@ -23,6 +23,8 @@ import android.hardware.gnss.measurement_corrections.ReflectingPlane; * A struct with measurement corrections for a single visible satellites * * The bit mask singleSatCorrectionFlags indicates which correction values are valid in the struct + * + * @hide */ @VintfStability parcelable SingleSatCorrection { diff --git a/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl b/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl index c9c15491fb..2fdf0bec07 100644 --- a/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl +++ b/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl @@ -47,6 +47,8 @@ import android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback; * status, or other information that can be used to derive user location to any entity when not * expressly authorized by this HAL. This includes all endpoints for location information * off the device, including carriers, vendors, OEM and others directly or indirectly. + * + * @hide */ @VintfStability interface IGnssVisibilityControl { diff --git a/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl b/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl index 051fbe6fb0..8b08098f70 100644 --- a/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl @@ -18,6 +18,8 @@ package android.hardware.gnss.visibility_control; /** * GNSS location reporting permissions and notification callback interface. + * + * @hide */ @VintfStability interface IGnssVisibilityControlCallback { -- GitLab From 7b346190c5b35bc111291bc815220dd3f5f2007f Mon Sep 17 00:00:00 2001 From: Tom Pratt Date: Fri, 11 Feb 2022 10:18:11 +0100 Subject: [PATCH 688/825] Add vintf fragment for default broadcastradio Bug: b/145694104 Test: Build and boot emulator locally. Observe that CarRadio app shows static data provided by default broadcast radio. Change-Id: Ia70e8a040cb281f3d0e8fc7f3a8dd25bcd6d09bd --- broadcastradio/2.0/default/Android.bp | 5 ++++- .../android.hardware.broadcastradio@2.0-service.xml | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 broadcastradio/2.0/default/android.hardware.broadcastradio@2.0-service.xml diff --git a/broadcastradio/2.0/default/Android.bp b/broadcastradio/2.0/default/Android.bp index 870c944d75..38eeb15cdb 100644 --- a/broadcastradio/2.0/default/Android.bp +++ b/broadcastradio/2.0/default/Android.bp @@ -25,6 +25,9 @@ package { cc_binary { name: "android.hardware.broadcastradio@2.0-service", + vintf_fragments: [ + "android.hardware.broadcastradio@2.0-service.xml", + ], init_rc: ["android.hardware.broadcastradio@2.0-service.rc"], vendor: true, relative_install_path: "hw", @@ -41,7 +44,7 @@ cc_binary { "TunerSession.cpp", "VirtualProgram.cpp", "VirtualRadio.cpp", - "service.cpp" + "service.cpp", ], static_libs: [ "android.hardware.broadcastradio@common-utils-2x-lib", diff --git a/broadcastradio/2.0/default/android.hardware.broadcastradio@2.0-service.xml b/broadcastradio/2.0/default/android.hardware.broadcastradio@2.0-service.xml new file mode 100644 index 0000000000..97f2e4d848 --- /dev/null +++ b/broadcastradio/2.0/default/android.hardware.broadcastradio@2.0-service.xml @@ -0,0 +1,12 @@ + + + android.hardware.broadcastradio + hwbinder + 2.0 + + IBroadcastRadio + amfm + dab + + + -- GitLab From dba89696b0885505e90dad57bfcccf480bdf3d0d Mon Sep 17 00:00:00 2001 From: Joshua Mccloskey Date: Mon, 28 Feb 2022 20:58:37 +0000 Subject: [PATCH 689/825] Updated Face AIDL createSession docs Test: N/A Bug: 219081263 Change-Id: I05af5a64ca9275932a026ed43e2061e7fd51d247 --- .../face/aidl/android/hardware/biometrics/face/IFace.aidl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/IFace.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/IFace.aidl index 4d7e59ebb7..65c589f192 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/IFace.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/IFace.aidl @@ -46,6 +46,10 @@ interface IFace { * vold_prepare_subdirs.cpp). Implementations may store additional user-specific data, such as * embeddings or templates, in StrongBox. * + * During create session it is expected that the HAL will call linkToDeath with the callee's + * binder token. The recommended implementation is to close this session if the callee dies, + * to prevent subsequent createSession calls from failing. + * * @param sensorId The sensorId for which this session is being created. * @param userId The userId for which this session is being created. * @param cb A callback to notify the framework about the session's events. -- GitLab From f5bd7c054bb1533a59f96900b036d79e28849294 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Fri, 4 Mar 2022 13:46:52 -0800 Subject: [PATCH 690/825] Add ExcessPathInfo (hardware/interfaces) Bug: 201253590 Test: atest VtsHalGnssTargetTest Change-Id: I68562d0332d161d31dbd494254ef404d110066dd --- .../ReflectingPlane.aidl | 2 +- .../SingleSatCorrection.aidl | 25 ++++-- .../ReflectingPlane.aidl | 2 +- .../SingleSatCorrection.aidl | 89 +++++++++++++++---- .../MeasurementCorrectionsInterface.cpp | 26 ++++-- gnss/common/utils/vts/Utils.cpp | 53 ++++++++--- 6 files changed, 152 insertions(+), 45 deletions(-) diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl index bb7d800fa9..90c9e03336 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl @@ -38,5 +38,5 @@ parcelable ReflectingPlane { double latitudeDegrees; double longitudeDegrees; double altitudeMeters; - double azimuthDegrees; + double reflectingPlaneAzimuthDegrees; } 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 53baa01d33..ebbe6846e9 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 @@ -40,11 +40,24 @@ parcelable SingleSatCorrection { int svid; long carrierFrequencyHz; float probSatIsLos; - float excessPathLengthMeters; - float excessPathLengthUncertaintyMeters; - android.hardware.gnss.measurement_corrections.ReflectingPlane reflectingPlane; + float combinedExcessPathLengthMeters; + 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_EXCESS_PATH_LENGTH = 2; - const int SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH_UNC = 4; - const int SINGLE_SAT_CORRECTION_HAS_REFLECTING_PLANE = 8; + 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; + @VintfStability + parcelable ExcessPathInfo { + int excessPathInfoFlags; + float excessPathLengthMeters; + 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; + } } diff --git a/gnss/aidl/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl b/gnss/aidl/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl index abd29f095b..810437271c 100644 --- a/gnss/aidl/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl +++ b/gnss/aidl/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl @@ -41,5 +41,5 @@ parcelable ReflectingPlane { double altitudeMeters; /** Represents azimuth clockwise from north of the reflecting plane in degrees. */ - double azimuthDegrees; + double reflectingPlaneAzimuthDegrees; } diff --git a/gnss/aidl/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl b/gnss/aidl/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl index 36320ebb80..56c691c3a4 100644 --- a/gnss/aidl/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl +++ b/gnss/aidl/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl @@ -29,14 +29,14 @@ import android.hardware.gnss.measurement_corrections.ReflectingPlane; @VintfStability parcelable SingleSatCorrection { /** Bit mask to indicate which values are valid in a SingleSatCorrection object. */ - /** GnssSingleSatCorrectionFlags has valid satellite-is-line-of-sight-probability field. */ + /** GnssSingleSatCorrectionFlags has valid probSatIsLos field. */ const int SINGLE_SAT_CORRECTION_HAS_SAT_IS_LOS_PROBABILITY = 0x0001; - /** GnssSingleSatCorrectionFlags has valid Excess Path Length field. */ - const int SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH = 0x0002; - /** GnssSingleSatCorrectionFlags has valid Excess Path Length Uncertainty field. */ - const int SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH_UNC = 0x0004; - /** GnssSingleSatCorrectionFlags has valid Reflecting Plane field. */ - const int SINGLE_SAT_CORRECTION_HAS_REFLECTING_PLANE = 0x0008; + /** GnssSingleSatCorrectionFlags has valid combinedExcessPathLengthMeters field. */ + const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH = 0x0002; + /** GnssSingleSatCorrectionFlags has valid combinedExcessPathLengthUncertaintyMeters field. */ + const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH_UNC = 0x0004; + /** GnssSingleSatCorrectionFlags has valid combinedAttenuationDb field. */ + const int SINGLE_SAT_CORRECTION_HAS_COMBINED_ATTENUATION = 0x0010; /** Contains GnssSingleSatCorrectionFlags bits. */ int singleSatCorrectionFlags; @@ -67,21 +67,74 @@ parcelable SingleSatCorrection { float probSatIsLos; /** - * Excess path length to be subtracted from pseudorange before using it in calculating location. + * Combined excess path length to be subtracted from pseudorange before using it in + * calculating location. * - * Note this value is NOT to be used to adjust the GnsseasurementCallback outputs. + * The value is computed by correlating the individual paths and picking the delay at the + * highest peak. + * + * Note this value is NOT to be used to adjust the GnssMeasurementCallback outputs. */ - float excessPathLengthMeters; - - /** Error estimate (1-sigma) for the Excess path length estimate */ - float excessPathLengthUncertaintyMeters; + float combinedExcessPathLengthMeters; /** - * Defines the reflecting plane characteristics such as location and azimuth + * Error estimate (1-sigma) for the Excess path length estimate. * - * The value is only valid if HAS_REFLECTING_PLANE flag is set. An invalid reflecting plane - * means either reflection planes serving is not supported or the satellite signal has gone - * through multiple reflections. + * The value is computed by combining the individual excessPathLengthUncertaintyMeters values + * into a single value for this satellite. + */ + float combinedExcessPathLengthUncertaintyMeters; + + /** + * Combined expected reduction of signal strength for this satellite in non-negative dB. + */ + float combinedAttenuationDb; + + /** + * A struct for the info of an excess path caused by reflection. + */ + @VintfStability + parcelable ExcessPathInfo { + /** ExcessPathInfo has valid Excess Path Length field. */ + const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH = 0x0001; + /** ExcessPathInfo has valid Excess Path Length Uncertainty field. */ + const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH_UNC = 0x0002; + /** ExcessPathInfo has valid Reflecting Plane field. */ + const int EXCESS_PATH_INFO_HAS_REFLECTING_PLANE = 0x0004; + /** ExcessPathInfo has valid Attenuation field. */ + const int EXCESS_PATH_INFO_HAS_ATTENUATION = 0x0008; + + /** Contains flag bits to indicate which fields exist in the ExcessPathInfo object. */ + int excessPathInfoFlags; + + /** + * Excess path length to be subtracted from pseudorange before using it in calculating + * location. + * + * Note this value is NOT to be used to adjust the GnssMeasurementCallback outputs. + */ + float excessPathLengthMeters; + + /** Error estimate (1-sigma) for the Excess path length estimate. */ + float excessPathLengthUncertaintyMeters; + + /** + * Defines the reflecting plane characteristics such as location and azimuth. + * + * The value is only valid if HAS_REFLECTING_PLANE flag is set. An invalid reflecting plane + * means either reflection planes serving is not supported or the satellite signal has gone + * through multiple reflections. + */ + ReflectingPlane reflectingPlane; + + /** + * The expected reduction of signal strength of this path in non-negative dB. + */ + float attenuationDb; + } + + /** + * A list of excess path info. */ - ReflectingPlane reflectingPlane; + ExcessPathInfo[] excessPathInfos; } diff --git a/gnss/aidl/default/MeasurementCorrectionsInterface.cpp b/gnss/aidl/default/MeasurementCorrectionsInterface.cpp index 0f1851cafe..66270c89da 100644 --- a/gnss/aidl/default/MeasurementCorrectionsInterface.cpp +++ b/gnss/aidl/default/MeasurementCorrectionsInterface.cpp @@ -37,16 +37,26 @@ ndk::ScopedAStatus MeasurementCorrectionsInterface::setCorrections( static_cast(corrections.satCorrections.size())); for (auto singleSatCorrection : corrections.satCorrections) { ALOGD("singleSatCorrection = flags: %d, constellation: %d, svid: %d" - ", cfHz: %" PRId64 ", probLos: %f, epl: %f, eplUnc: %f", + ", cfHz: %" PRId64 + ", probLos: %f, combinedEpl: %f, combinedEplUnc: %f, combinedAttenuation: %f" + ", excessPathInfos.size: %d", singleSatCorrection.singleSatCorrectionFlags, singleSatCorrection.constellation, singleSatCorrection.svid, singleSatCorrection.carrierFrequencyHz, - singleSatCorrection.probSatIsLos, singleSatCorrection.excessPathLengthMeters, - singleSatCorrection.excessPathLengthUncertaintyMeters); - ALOGD("reflecting plane = lat: %f, lng: %f, alt: %f, azm: %f", - singleSatCorrection.reflectingPlane.latitudeDegrees, - singleSatCorrection.reflectingPlane.longitudeDegrees, - singleSatCorrection.reflectingPlane.altitudeMeters, - singleSatCorrection.reflectingPlane.azimuthDegrees); + singleSatCorrection.probSatIsLos, singleSatCorrection.combinedExcessPathLengthMeters, + singleSatCorrection.combinedExcessPathLengthUncertaintyMeters, + singleSatCorrection.combinedAttenuationDb, + static_cast(singleSatCorrection.excessPathInfos.size())); + + for (auto excessPathInfo : singleSatCorrection.excessPathInfos) { + ALOGD("excessPathInfo = epl: %f, eplUnc: %f, attenuation: %f", + excessPathInfo.excessPathLengthMeters, + excessPathInfo.excessPathLengthUncertaintyMeters, excessPathInfo.attenuationDb); + ALOGD("reflecting plane = lat: %f, lng: %f, alt: %f, azm: %f", + excessPathInfo.reflectingPlane.latitudeDegrees, + excessPathInfo.reflectingPlane.longitudeDegrees, + excessPathInfo.reflectingPlane.altitudeMeters, + excessPathInfo.reflectingPlane.reflectingPlaneAzimuthDegrees); + } } return ndk::ScopedAStatus::ok(); } diff --git a/gnss/common/utils/vts/Utils.cpp b/gnss/common/utils/vts/Utils.cpp index 4c725a855b..69e2b346b0 100644 --- a/gnss/common/utils/vts/Utils.cpp +++ b/gnss/common/utils/vts/Utils.cpp @@ -38,6 +38,7 @@ using MeasurementCorrectionsAidl = using ReflectingPlaneAidl = android::hardware::gnss::measurement_corrections::ReflectingPlane; using SingleSatCorrectionAidl = android::hardware::gnss::measurement_corrections::SingleSatCorrection; +using ExcessPathInfo = SingleSatCorrectionAidl::ExcessPathInfo; template <> int64_t Utils::getLocationTimestampMillis(const android::hardware::gnss::GnssLocation& location) { @@ -170,38 +171,68 @@ Utils::getMockMeasurementCorrections_1_1() { return mockCorrections_1_1; } +namespace { +const ExcessPathInfo createExcessPathInfo(float excessPathLengthMeters, + float excessPathLengthUncertaintyMeters, + const ReflectingPlaneAidl* reflectingPlane, + float attenuationDb) { + ExcessPathInfo excessPathInfo; + excessPathInfo.excessPathInfoFlags = + ExcessPathInfo::EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH | + ExcessPathInfo::EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH_UNC | + ExcessPathInfo::EXCESS_PATH_INFO_HAS_ATTENUATION | + (reflectingPlane == nullptr ? 0 + : ExcessPathInfo::EXCESS_PATH_INFO_HAS_REFLECTING_PLANE); + excessPathInfo.excessPathLengthMeters = excessPathLengthMeters; + excessPathInfo.excessPathLengthUncertaintyMeters = excessPathLengthUncertaintyMeters; + if (reflectingPlane != nullptr) { + excessPathInfo.reflectingPlane = *reflectingPlane; + } + excessPathInfo.attenuationDb = attenuationDb; + return excessPathInfo; +} +} // anonymous namespace + const MeasurementCorrectionsAidl Utils::getMockMeasurementCorrections_aidl() { ReflectingPlaneAidl reflectingPlane; reflectingPlane.latitudeDegrees = 37.4220039; reflectingPlane.longitudeDegrees = -122.0840991; reflectingPlane.altitudeMeters = 250.35; - reflectingPlane.azimuthDegrees = 203.0; + reflectingPlane.reflectingPlaneAzimuthDegrees = 203.0; SingleSatCorrectionAidl singleSatCorrection1; singleSatCorrection1.singleSatCorrectionFlags = SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_SAT_IS_LOS_PROBABILITY | - SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH | - SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH_UNC | - SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_REFLECTING_PLANE; + SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH | + SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH_UNC | + SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_COMBINED_ATTENUATION; singleSatCorrection1.constellation = android::hardware::gnss::GnssConstellationType::GPS; singleSatCorrection1.svid = 12; singleSatCorrection1.carrierFrequencyHz = 1.59975e+09; singleSatCorrection1.probSatIsLos = 0.50001; - singleSatCorrection1.excessPathLengthMeters = 137.4802; - singleSatCorrection1.excessPathLengthUncertaintyMeters = 25.5; - singleSatCorrection1.reflectingPlane = reflectingPlane; + singleSatCorrection1.combinedExcessPathLengthMeters = 203.5; + singleSatCorrection1.combinedExcessPathLengthUncertaintyMeters = 59.1; + singleSatCorrection1.combinedAttenuationDb = -4.3; + singleSatCorrection1.excessPathInfos.push_back( + createExcessPathInfo(137.4, 25.5, &reflectingPlane, -3.5)); + singleSatCorrection1.excessPathInfos.push_back( + createExcessPathInfo(296.3, 87.2, &reflectingPlane, -5.1)); SingleSatCorrectionAidl singleSatCorrection2; singleSatCorrection2.singleSatCorrectionFlags = SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_SAT_IS_LOS_PROBABILITY | - SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH | - SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_EXCESS_PATH_LENGTH_UNC; + SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH | + SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH_UNC | + SingleSatCorrectionAidl::SINGLE_SAT_CORRECTION_HAS_COMBINED_ATTENUATION; singleSatCorrection2.constellation = GnssConstellationType::GPS; singleSatCorrection2.svid = 9; singleSatCorrection2.carrierFrequencyHz = 1.59975e+09; singleSatCorrection2.probSatIsLos = 0.873; - singleSatCorrection2.excessPathLengthMeters = 26.294; - singleSatCorrection2.excessPathLengthUncertaintyMeters = 10.0; + singleSatCorrection2.combinedExcessPathLengthMeters = 26.294; + singleSatCorrection2.combinedExcessPathLengthUncertaintyMeters = 10.0; + singleSatCorrection2.combinedAttenuationDb = -0.5; + singleSatCorrection2.excessPathInfos.push_back( + createExcessPathInfo(26.294, 10.0, nullptr, -0.5)); std::vector singleSatCorrections = {singleSatCorrection1, singleSatCorrection2}; -- GitLab From 2456a147a538ade5d9f50c6fb3ed4e8afe38db6d Mon Sep 17 00:00:00 2001 From: chasewu Date: Tue, 15 Mar 2022 15:16:04 +0800 Subject: [PATCH 691/825] Fix the maximum frequency value calculation Fix: 205250672 Test: VtsHalVibratorTargetTest Signed-off-by: chasewu Change-Id: I908ab93eaee17de2af163c0fe3c50feea567ee48 --- vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp index 09cc21ba32..abb80a28f6 100644 --- a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp +++ b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp @@ -167,9 +167,9 @@ static float getFrequencyMaximumHz(sp vibrator, int32_t capabilities) EXPECT_TRUE(isUnknownOrUnsupported(status)) << status; } - float freqMaximumHz = - (bandwidthAmplitudeMap.size() * getFrequencyResolutionHz(vibrator, capabilities)) + - getFrequencyMinimumHz(vibrator, capabilities); + float freqMaximumHz = ((bandwidthAmplitudeMap.size() - 1) * + getFrequencyResolutionHz(vibrator, capabilities)) + + getFrequencyMinimumHz(vibrator, capabilities); return freqMaximumHz; } -- GitLab From 76dd9336ada13055af3408885abbaa82ec95451e Mon Sep 17 00:00:00 2001 From: Nate Jiang Date: Tue, 15 Mar 2022 16:39:26 -0700 Subject: [PATCH 692/825] [VTS] test new API with success result Bug: 222654265 Test: atest VtsHalWifiNanV1_6TargetTest Change-Id: I2e25ddafa4bf9caf0110a35f328330329fab8581 --- .../functional/wifi_nan_iface_hidl_test.cpp | 112 ++++++++++++++++-- 1 file changed, 105 insertions(+), 7 deletions(-) diff --git a/wifi/1.6/vts/functional/wifi_nan_iface_hidl_test.cpp b/wifi/1.6/vts/functional/wifi_nan_iface_hidl_test.cpp index 46a1314541..7bcc6d3a06 100644 --- a/wifi/1.6/vts/functional/wifi_nan_iface_hidl_test.cpp +++ b/wifi/1.6/vts/functional/wifi_nan_iface_hidl_test.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include "wifi_hidl_call_util.h" #include "wifi_hidl_test_utils.h" @@ -616,6 +617,7 @@ TEST_P(WifiNanIfaceHidlTest, notifyCapabilitiesResponse_1_6) { ASSERT_EQ(std::cv_status::no_timeout, wait(NOTIFY_CAPABILITIES_RESPONSE_1_6)); ASSERT_EQ(NOTIFY_CAPABILITIES_RESPONSE_1_6, callbackType); ASSERT_EQ(id, inputCmdId); + ASSERT_EQ(status.status, NanStatusType::SUCCESS); // check for reasonable capability values EXPECT_GT(capabilities_1_6.maxConcurrentClusters, (unsigned int)0); @@ -637,23 +639,119 @@ TEST_P(WifiNanIfaceHidlTest, notifyCapabilitiesResponse_1_6) { } /* - * startPublishRequest_1_6InvalidArgs: validate that fails with invalid arguments + * startPublishRequest_1_6: validate that success with valid arguments */ -TEST_P(WifiNanIfaceHidlTest, startPublishRequest_1_6InvalidArgs) { +TEST_P(WifiNanIfaceHidlTest, startPublishRequest_1_6) { uint16_t inputCmdId = 10; + ::android::hardware::wifi::V1_0::NanBandSpecificConfig config24 = {}; + config24.rssiClose = 60; + config24.rssiMiddle = 70; + config24.rssiCloseProximity = 60; + config24.dwellTimeMs = 200; + config24.scanPeriodSec = 20; + config24.validDiscoveryWindowIntervalVal = false; + config24.discoveryWindowIntervalVal = 0; + + ::android::hardware::wifi::V1_0::NanBandSpecificConfig config5 = {}; + config5.rssiClose = 60; + config5.rssiMiddle = 75; + config5.rssiCloseProximity = 60; + config5.dwellTimeMs = 200; + config5.scanPeriodSec = 20; + config5.validDiscoveryWindowIntervalVal = false; + config5.discoveryWindowIntervalVal = 0; + ::android::hardware::wifi::V1_4::NanEnableRequest req = {}; + req.operateInBand[(size_t)::android::hardware::wifi::V1_4::NanBandIndex::NAN_BAND_24GHZ] = true; + req.operateInBand[(size_t)::android::hardware::wifi::V1_4::NanBandIndex::NAN_BAND_5GHZ] = false; + req.hopCountMax = 2; + req.configParams.masterPref = 0; + req.configParams.disableDiscoveryAddressChangeIndication = true; + req.configParams.disableStartedClusterIndication = true; + req.configParams.disableJoinedClusterIndication = true; + req.configParams.includePublishServiceIdsInBeacon = true; + req.configParams.numberOfPublishServiceIdsInBeacon = 0; + req.configParams.includeSubscribeServiceIdsInBeacon = true; + req.configParams.numberOfSubscribeServiceIdsInBeacon = 0; + req.configParams.rssiWindowSize = 8; + req.configParams.macAddressRandomizationIntervalSec = 1800; + req.configParams.bandSpecificConfig[( + size_t)::android::hardware::wifi::V1_4::NanBandIndex::NAN_BAND_24GHZ] = config24; + req.configParams.bandSpecificConfig[( + size_t)::android::hardware::wifi::V1_4::NanBandIndex::NAN_BAND_5GHZ] = config5; + + req.debugConfigs.validClusterIdVals = true; + req.debugConfigs.clusterIdTopRangeVal = 65535; + req.debugConfigs.clusterIdBottomRangeVal = 0; + req.debugConfigs.validIntfAddrVal = false; + req.debugConfigs.validOuiVal = false; + req.debugConfigs.ouiVal = 0; + req.debugConfigs.validRandomFactorForceVal = false; + req.debugConfigs.randomFactorForceVal = 0; + req.debugConfigs.validHopCountForceVal = false; + req.debugConfigs.hopCountForceVal = 0; + req.debugConfigs.validDiscoveryChannelVal = false; + req.debugConfigs.discoveryChannelMhzVal[( + size_t)::android::hardware::wifi::V1_4::NanBandIndex::NAN_BAND_24GHZ] = 0; + req.debugConfigs.discoveryChannelMhzVal[( + size_t)::android::hardware::wifi::V1_4::NanBandIndex::NAN_BAND_5GHZ] = 0; + req.debugConfigs.validUseBeaconsInBandVal = false; + req.debugConfigs.useBeaconsInBandVal[( + size_t)::android::hardware::wifi::V1_4::NanBandIndex::NAN_BAND_24GHZ] = true; + req.debugConfigs.useBeaconsInBandVal[( + size_t)::android::hardware::wifi::V1_4::NanBandIndex::NAN_BAND_5GHZ] = true; + req.debugConfigs.validUseSdfInBandVal = false; + req.debugConfigs.useSdfInBandVal[( + size_t)::android::hardware::wifi::V1_4::NanBandIndex::NAN_BAND_24GHZ] = true; + req.debugConfigs + .useSdfInBandVal[(size_t)::android::hardware::wifi::V1_4::NanBandIndex::NAN_BAND_5GHZ] = + true; + + ::android::hardware::wifi::V1_6::NanConfigRequestSupplemental nanConfigRequestSupp = {}; + nanConfigRequestSupp.V1_5.V1_2.discoveryBeaconIntervalMs = 20; + nanConfigRequestSupp.V1_5.V1_2.numberOfSpatialStreamsInDiscovery = 0; + nanConfigRequestSupp.V1_5.V1_2.enableDiscoveryWindowEarlyTermination = false; + callbackType = INVALID; - ::android::hardware::wifi::V1_6::NanPublishRequest nanPublishRequest = {}; - const auto& halStatus = - HIDL_INVOKE(iwifiNanIface, startPublishRequest_1_6, inputCmdId, nanPublishRequest); + const auto& halStatus = + HIDL_INVOKE(iwifiNanIface, enableRequest_1_6, inputCmdId, req, nanConfigRequestSupp); if (halStatus.code != WifiStatusCode::ERROR_NOT_SUPPORTED) { ASSERT_EQ(WifiStatusCode::SUCCESS, halStatus.code); + // wait for a callback + ASSERT_EQ(std::cv_status::no_timeout, wait(NOTIFY_ENABLE_RESPONSE)); + ASSERT_EQ(NOTIFY_ENABLE_RESPONSE, callbackType); + ASSERT_EQ(id, inputCmdId); + ASSERT_EQ(status.status, NanStatusType::SUCCESS); + } + ::android::hardware::wifi::V1_6::NanPublishRequest nanPublishRequest = {}; + nanPublishRequest.baseConfigs.sessionId = 0; + nanPublishRequest.baseConfigs.ttlSec = 0; + nanPublishRequest.baseConfigs.discoveryWindowPeriod = 1; + nanPublishRequest.baseConfigs.discoveryCount = 0; + nanPublishRequest.baseConfigs.serviceName = {97}; + + nanPublishRequest.baseConfigs.discoveryMatchIndicator = NanMatchAlg::MATCH_NEVER; + nanPublishRequest.baseConfigs.useRssiThreshold = false; + nanPublishRequest.baseConfigs.disableDiscoveryTerminationIndication = false; + nanPublishRequest.baseConfigs.disableMatchExpirationIndication = true; + nanPublishRequest.baseConfigs.disableFollowupReceivedIndication = false; + nanPublishRequest.baseConfigs.securityConfig.securityType = NanDataPathSecurityType::OPEN; + nanPublishRequest.autoAcceptDataPathRequests = false; + nanPublishRequest.publishType = NanPublishType::UNSOLICITED; + nanPublishRequest.txType = NanTxType::BROADCAST; + + const auto& halStatus1 = + HIDL_INVOKE(iwifiNanIface, startPublishRequest_1_6, inputCmdId + 1, nanPublishRequest); + + if (halStatus1.code != WifiStatusCode::ERROR_NOT_SUPPORTED) { + ASSERT_EQ(WifiStatusCode::SUCCESS, halStatus1.code); + // wait for a callback ASSERT_EQ(std::cv_status::no_timeout, wait(NOTIFY_START_PUBLISH_RESPONSE)); ASSERT_EQ(NOTIFY_START_PUBLISH_RESPONSE, callbackType); - ASSERT_EQ(id, inputCmdId); - ASSERT_EQ(status.status, NanStatusType::INTERNAL_FAILURE); + ASSERT_EQ(id, inputCmdId + 1); + ASSERT_EQ(status.status, NanStatusType::SUCCESS); } } -- GitLab From f6c4ef8507951848c7fa3c5e9ae7fdd09dff80b7 Mon Sep 17 00:00:00 2001 From: ChihYao Chien Date: Wed, 1 Dec 2021 10:24:11 +0800 Subject: [PATCH 693/825] Declare android.hardware.radio@1.6 as system_ext module Minor versions of android.hardware.radio were all declared but version 1.6 Bug: 207067211 Change-Id: Ib77a9b6daa2e70983e9a37716f3f7b059ec1f97f --- radio/1.6/Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/radio/1.6/Android.bp b/radio/1.6/Android.bp index 4b79c0a43e..2137e8d7d9 100644 --- a/radio/1.6/Android.bp +++ b/radio/1.6/Android.bp @@ -29,4 +29,5 @@ hidl_interface { "android.hidl.safe_union@1.0", ], gen_java: true, + system_ext_specific: true, } -- GitLab From 476314cc5430df02796609db905f0c835804a769 Mon Sep 17 00:00:00 2001 From: ramindani Date: Wed, 16 Mar 2022 00:17:08 +0000 Subject: [PATCH 694/825] [HWC3.0] Add capability BOOT_DISPLAY_CONFIG This Capabiliy::BOOT_DISPLAY_CONFIG will make the display boot display config optional on the HWC3.0 BUG: 216113429 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I3be3383922fdd91e0bbccebd3c73e458753b749f --- .../graphics/composer3/Capability.aidl | 1 + .../graphics/composer3/Capability.aidl | 9 ++++ .../graphics/composer3/IComposerClient.aidl | 3 ++ .../VtsHalGraphicsComposer3_TargetTest.cpp | 48 +++++++++++++++++++ 4 files changed, 61 insertions(+) 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 9c49583fd2..b89f7d5105 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 @@ -39,4 +39,5 @@ enum Capability { SKIP_CLIENT_COLOR_TRANSFORM = 2, PRESENT_FENCE_IS_NOT_RELIABLE = 3, SKIP_VALIDATE = 4, + BOOT_DISPLAY_CONFIG = 5, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl index ea619aeaf3..2f9eab937c 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl @@ -57,4 +57,13 @@ enum Capability { * validateDisplay step is needed. */ SKIP_VALIDATE = 4, + + /** + * Specifies that the device supports setting a display configuration that + * the device should boot at. + * @see IComposerClient.setBootDisplayConfig + * @see IComposerClient.clearBootDisplayConfig + * @see IComposerClient.getPreferredBootDisplayConfig + */ + BOOT_DISPLAY_CONFIG = 5, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index bbc9c4620a..a4ea64f815 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -590,6 +590,7 @@ interface IComposerClient { * * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. * @exception EX_BAD_CONFIG when an invalid config id was passed in. + * @exception EX_UNSUPPORTED when not supported by the underlying HAL * * @see getDisplayConfigs * @see clearBootDisplayConfig @@ -605,6 +606,7 @@ interface IComposerClient { * @param display is the display for which the cached boot config is cleared. * * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_UNSUPPORTED when not supported by the underlying HAL * * @see getDisplayConfigs * @see setBootDisplayConfig @@ -622,6 +624,7 @@ interface IComposerClient { * @return the implementation's preferred display config. * * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @exception EX_UNSUPPORTED when not supported by the underlying HAL * * @see getDisplayConfigs * @see setBootDisplayConfig diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index bfb6b85d12..2d08ac611b 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -495,6 +495,10 @@ TEST_P(GraphicsComposerAidlTest, SetActiveConfigWithConstraints_BadConfig) { } TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadDisplay) { + if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) { + GTEST_SUCCEED() << "Boot Display Config not supported"; + return; + } const auto& status = mComposerClient->setBootDisplayConfig(getInvalidDisplayId(), /*config*/ 0); EXPECT_FALSE(status.isOk()); @@ -502,6 +506,10 @@ TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadDisplay) { } TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadConfig) { + if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) { + GTEST_SUCCEED() << "Boot Display Config not supported"; + return; + } for (VtsDisplay& display : mDisplays) { int32_t constexpr kInvalidConfigId = IComposerClient::INVALID_CONFIGURATION; const auto& status = @@ -513,6 +521,10 @@ TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadConfig) { } TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig) { + if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) { + GTEST_SUCCEED() << "Boot Display Config not supported"; + return; + } const auto& [status, configs] = mComposerClient->getDisplayConfigs(getPrimaryDisplayId()); EXPECT_TRUE(status.isOk()); for (const auto& config : configs) { @@ -521,6 +533,10 @@ TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig) { } TEST_P(GraphicsComposerAidlTest, ClearBootDisplayConfig_BadDisplay) { + if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) { + GTEST_SUCCEED() << "Boot Display Config not supported"; + return; + } const auto& status = mComposerClient->clearBootDisplayConfig(getInvalidDisplayId()); EXPECT_FALSE(status.isOk()); @@ -528,10 +544,18 @@ TEST_P(GraphicsComposerAidlTest, ClearBootDisplayConfig_BadDisplay) { } TEST_P(GraphicsComposerAidlTest, ClearBootDisplayConfig) { + if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) { + GTEST_SUCCEED() << "Boot Display Config not supported"; + return; + } EXPECT_TRUE(mComposerClient->clearBootDisplayConfig(getPrimaryDisplayId()).isOk()); } TEST_P(GraphicsComposerAidlTest, GetPreferredBootDisplayConfig_BadDisplay) { + if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) { + GTEST_SUCCEED() << "Boot Display Config not supported"; + return; + } const auto& [status, _] = mComposerClient->getPreferredBootDisplayConfig(getInvalidDisplayId()); EXPECT_FALSE(status.isOk()); @@ -539,6 +563,10 @@ TEST_P(GraphicsComposerAidlTest, GetPreferredBootDisplayConfig_BadDisplay) { } TEST_P(GraphicsComposerAidlTest, GetPreferredBootDisplayConfig) { + if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) { + GTEST_SUCCEED() << "Boot Display Config not supported"; + return; + } const auto& [status, preferredDisplayConfig] = mComposerClient->getPreferredBootDisplayConfig(getPrimaryDisplayId()); EXPECT_TRUE(status.isOk()); @@ -549,6 +577,26 @@ TEST_P(GraphicsComposerAidlTest, GetPreferredBootDisplayConfig) { EXPECT_NE(configs.end(), std::find(configs.begin(), configs.end(), preferredDisplayConfig)); } +TEST_P(GraphicsComposerAidlTest, BootDisplayConfig_Unsupported) { + if (!hasCapability(Capability::BOOT_DISPLAY_CONFIG)) { + const auto& [configStatus, config] = + mComposerClient->getActiveConfig(getPrimaryDisplayId()); + EXPECT_TRUE(configStatus.isOk()); + + auto status = mComposerClient->setBootDisplayConfig(getPrimaryDisplayId(), config); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); + + status = mComposerClient->getPreferredBootDisplayConfig(getPrimaryDisplayId()).first; + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); + + status = mComposerClient->clearBootDisplayConfig(getPrimaryDisplayId()); + EXPECT_FALSE(status.isOk()); + EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); + } +} + TEST_P(GraphicsComposerAidlTest, SetAutoLowLatencyMode_BadDisplay) { auto status = mComposerClient->setAutoLowLatencyMode(getInvalidDisplayId(), /*isEnabled*/ true); EXPECT_FALSE(status.isOk()); -- GitLab From 5da33a22ac31844290b44a184aade22fbcacd6b6 Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Wed, 16 Mar 2022 11:52:47 -0700 Subject: [PATCH 695/825] Fix AIDL VTS setup Setup code was causing all tests to be ignored on devices with AIDL HAL. Fix the setup code and increase GTEST timeout to prevent the test suite from crashing. Test: atest VtsHalRadioTargetTest Bug: 225032427 Change-Id: Ice60f7fae313863e97e425994bee5ad1d703c807 --- radio/aidl/vts/AndroidTest.xml | 34 +++++++++++++++++++++++++ radio/aidl/vts/radio_aidl_hal_utils.cpp | 4 +-- radio/aidl/vts/radio_config_test.cpp | 5 ---- 3 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 radio/aidl/vts/AndroidTest.xml diff --git a/radio/aidl/vts/AndroidTest.xml b/radio/aidl/vts/AndroidTest.xml new file mode 100644 index 0000000000..36381d1dd6 --- /dev/null +++ b/radio/aidl/vts/AndroidTest.xml @@ -0,0 +1,34 @@ + + + + \ No newline at end of file diff --git a/radio/aidl/vts/radio_aidl_hal_utils.cpp b/radio/aidl/vts/radio_aidl_hal_utils.cpp index 1f739302b4..861885111f 100644 --- a/radio/aidl/vts/radio_aidl_hal_utils.cpp +++ b/radio/aidl/vts/radio_aidl_hal_utils.cpp @@ -108,7 +108,7 @@ bool isVoiceEmergencyOnly(RegState state) { bool stringEndsWith(std::string const& string, std::string const& end) { if (string.size() >= end.size()) { - return (0 == string.compare(string.size() - end.size() - 1, end.size(), end)); + return std::equal(end.rbegin(), end.rend(), string.rbegin()); } else { return false; } @@ -117,7 +117,7 @@ bool stringEndsWith(std::string const& string, std::string const& end) { bool isServiceValidForDeviceConfiguration(std::string& serviceName) { if (isSsSsEnabled()) { // Device is configured as SSSS. - if (stringEndsWith(serviceName, RADIO_SERVICE_SLOT1_NAME)) { + if (!stringEndsWith(serviceName, RADIO_SERVICE_SLOT1_NAME)) { ALOGI("%s instance is not valid for SSSS device.", serviceName.c_str()); return false; } diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp index a124907ad0..83c4de0090 100644 --- a/radio/aidl/vts/radio_config_test.cpp +++ b/radio/aidl/vts/radio_config_test.cpp @@ -24,11 +24,6 @@ void RadioConfigTest::SetUp() { std::string serviceName = GetParam(); - if (!isServiceValidForDeviceConfiguration(serviceName)) { - ALOGI("Skipped the test due to device configuration."); - GTEST_SKIP(); - } - radio_config = IRadioConfig::fromBinder( ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); ASSERT_NE(nullptr, radio_config.get()); -- GitLab From 2897aff9d8c79e44f452c35ee05097bea4848381 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 16 Mar 2022 23:19:26 +0000 Subject: [PATCH 696/825] Handle sample rate out of bound correctly. This CL changes the behavior when sample rate is out of bound for VHAL. Sample rate would be fitted to the range if out-of-bound. Also added some comments to clearly document this behavior. Test: atest DefaultVehicleHalTest atest CtsCarTestCases Bug: 225025926 Change-Id: Id853070cb0dc823855a68f86a01de2ff2a011577 --- .../hardware/automotive/vehicle/IVehicle.aidl | 5 ++ .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 19 +++++-- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 53 ++++++++++++++++--- .../impl/vhal/test/MockVehicleCallback.cpp | 5 ++ .../aidl/impl/vhal/test/MockVehicleCallback.h | 1 + 5 files changed, 72 insertions(+), 11 deletions(-) diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl index a9479636fe..dc9b876f60 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl @@ -165,6 +165,11 @@ interface IVehicle { * a property set failure message sent from the vehicle bus. * @param options List of options to subscribe. SubscribeOption contains * information such as property Id, area Id, sample rate, etc. + * For continuous properties, sample rate must be provided. If sample + * rate is less than {@link VehiclePropConfig#minSampleRate}, the sample + * rate would be minSampleRate. If sample rate is larger than + * {@link VehiclePropValue#maxSampleRate}, the sample rate would be + * maxSampleRate. * @param maxSharedMemoryFileCount The maximum number of shared memory files * allocated for in VHAL for this subscription. When a memory file is * handled back to the client, it cannot be used by VHAL to deliver diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index 886f89733f..76736d7225 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -78,6 +78,16 @@ std::string toString(const std::unordered_set& values) { return str; } +float getDefaultSampleRate(float sampleRate, float minSampleRate, float maxSampleRate) { + if (sampleRate < minSampleRate) { + return minSampleRate; + } + if (sampleRate > maxSampleRate) { + return maxSampleRate; + } + return sampleRate; +} + } // namespace std::shared_ptr DefaultVehicleHal::SubscriptionClients::maybeAddClient( @@ -617,9 +627,10 @@ Result DefaultVehicleHal::checkSubscribeOptions( float minSampleRate = config.minSampleRate; float maxSampleRate = config.maxSampleRate; if (sampleRate < minSampleRate || sampleRate > maxSampleRate) { - return StatusError(StatusCode::INVALID_ARG) - << StringPrintf("sample rate: %f out of range, must be within %f and %f", - sampleRate, minSampleRate, maxSampleRate); + float defaultRate = getDefaultSampleRate(sampleRate, minSampleRate, maxSampleRate); + ALOGW("sample rate: %f out of range, must be within %f and %f, set to %f", + sampleRate, minSampleRate, maxSampleRate, defaultRate); + sampleRate = defaultRate; } if (!SubscriptionManager::checkSampleRate(sampleRate)) { return StatusError(StatusCode::INVALID_ARG) @@ -673,6 +684,8 @@ ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, } if (config.changeMode == VehiclePropertyChangeMode::CONTINUOUS) { + optionCopy.sampleRate = getDefaultSampleRate( + optionCopy.sampleRate, config.minSampleRate, config.maxSampleRate); continuousSubscriptions.push_back(std::move(optionCopy)); } else { onChangeSubscriptions.push_back(std::move(optionCopy)); diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 6f8eb1dab3..49f5b7e435 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -196,14 +196,6 @@ std::vector getSubscribeInvalidOptionsTestCases .sampleRate = 0.0, }, }, - { - .name = "sample_rate_out_of_range", - .option = - { - .propId = GLOBAL_CONTINUOUS_PROP, - .sampleRate = 1000.0, - }, - }, { .name = "static_property", .option = @@ -1360,6 +1352,51 @@ TEST_F(DefaultVehicleHalTest, testSubscribeGlobalContinuous) { EXPECT_EQ(countClients(), static_cast(1)); } +TEST_F(DefaultVehicleHalTest, testSubscribeGlobalContinuousRateOutOfRange) { + VehiclePropValue testValue{ + .prop = GLOBAL_CONTINUOUS_PROP, + .value.int32Values = {0}, + }; + // Set responses for all the hardware getValues requests. + getHardware()->setGetValueResponder( + [](std::shared_ptr callback, + const std::vector& requests) { + std::vector results; + for (auto& request : requests) { + VehiclePropValue prop = request.prop; + prop.value.int32Values = {0}; + results.push_back({ + .requestId = request.requestId, + .status = StatusCode::OK, + .prop = prop, + }); + } + (*callback)(results); + return StatusCode::OK; + }); + + // The maxSampleRate is 100, so the sample rate should be the default max 100. + std::vector options = { + { + .propId = GLOBAL_CONTINUOUS_PROP, + .sampleRate = 1000.0, + }, + }; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + + // Sleep for 1s, which should generate ~100 events. + std::this_thread::sleep_for(std::chrono::seconds(1)); + + size_t eventCount = getCallback()->countOnPropertyEventResults(); + ASSERT_GE(eventCount, 50u) << "expect at least 50 events to be generated"; + ASSERT_LE(eventCount, 150u) << "expect no more than 150 events to be generated"; + + EXPECT_EQ(countClients(), static_cast(1)); +} + TEST_F(DefaultVehicleHalTest, testSubscribeAreaContinuous) { // Set responses for all the hardware getValues requests. getHardware()->setGetValueResponder( diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp index 5e3e03c64a..0e463571d9 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp @@ -82,6 +82,11 @@ std::optional MockVehicleCallback::nextOnPropertyEventResults return pop(mOnPropertyEventResults); } +size_t MockVehicleCallback::countOnPropertyEventResults() { + std::scoped_lock lockGuard(mLock); + return mOnPropertyEventResults.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 03bfd5be9c..0faaa1f670 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h @@ -62,6 +62,7 @@ class MockVehicleCallback final nextSetValueResults(); std::optional nextOnPropertyEventResults(); + size_t countOnPropertyEventResults(); private: std::mutex mLock; -- GitLab From 6bb92e00b8ae85e095e73ffd48d5fa210177416a Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Mon, 28 Feb 2022 20:00:08 +0900 Subject: [PATCH 697/825] Cast to int for union tag Union tag will be changed from `enum` to `enum class`. We need explicit casting with enum class. Bug: 225119187 Bug: 218912230 Test: m Merged-In: I2401e66dc9d8bc511a601fcdce365e5f823576d4 Change-Id: I2401e66dc9d8bc511a601fcdce365e5f823576d4 (cherry picked from commit 1c4e9829ec684f1c33447f522db516b14e011255) --- sensors/aidl/default/multihal/ConvertUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sensors/aidl/default/multihal/ConvertUtils.cpp b/sensors/aidl/default/multihal/ConvertUtils.cpp index 7751fd2994..9b2d8fe309 100644 --- a/sensors/aidl/default/multihal/ConvertUtils.cpp +++ b/sensors/aidl/default/multihal/ConvertUtils.cpp @@ -173,7 +173,7 @@ void convertToHidlEvent(const AidlEvent& aidlEvent, V2_1Event* hidlEvent) { } default: ALOGE("Invalid sensor additioanl info tag: %d", - additionalInfo.payload.getTag()); + static_cast(additionalInfo.payload.getTag())); break; } break; -- GitLab From 2e2c6e7b316f9f23844c2becfa5109e28bc6afd1 Mon Sep 17 00:00:00 2001 From: Alain Michaud Date: Sun, 23 Jan 2022 21:55:35 +0000 Subject: [PATCH 698/825] uwb(hal): Adding support for host tests. Adding support for building hosts tests using the HAL interface. Bug: 216784920 Test: atest --host libuwb_uci_packet_tests Change-Id: I3e855b8b7bf203fc4f9769327348bfc3d1e10796 --- uwb/aidl/Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/uwb/aidl/Android.bp b/uwb/aidl/Android.bp index 2cc1e6a8f9..36cde9b68d 100755 --- a/uwb/aidl/Android.bp +++ b/uwb/aidl/Android.bp @@ -14,6 +14,7 @@ aidl_interface { vendor_available: true, srcs: ["android/hardware/uwb/*.aidl"], stability: "vintf", + host_supported: true, backend: { java: { sdk_version: "module_Tiramisu", -- GitLab From 1b7ebd29283ac3851318e0045eea40b87c7e86d8 Mon Sep 17 00:00:00 2001 From: Austin Borger Date: Thu, 17 Mar 2022 17:25:34 -0700 Subject: [PATCH 699/825] [AIDL] Add L to TagBoundaryId::VENDOR to indicate that it is a long integer literal. Bug: 225049648 Test: Ran m android.hardware.camera.common and observed output files Change-Id: I098c8d537a9a9809ff3bd594c69b30c69b3b2ed9 --- .../current/android/hardware/camera/common/TagBoundaryId.aidl | 2 +- .../aidl/android/hardware/camera/common/TagBoundaryId.aidl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TagBoundaryId.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TagBoundaryId.aidl index 2c6b500061..cd5048347e 100644 --- a/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TagBoundaryId.aidl +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/current/android/hardware/camera/common/TagBoundaryId.aidl @@ -35,5 +35,5 @@ package android.hardware.camera.common; @Backing(type="long") @VintfStability enum TagBoundaryId { AOSP = 0, - VENDOR = -2147483648, + VENDOR = 2147483648, } diff --git a/camera/common/aidl/android/hardware/camera/common/TagBoundaryId.aidl b/camera/common/aidl/android/hardware/camera/common/TagBoundaryId.aidl index f81e5b67b3..6c4ef3c0ff 100644 --- a/camera/common/aidl/android/hardware/camera/common/TagBoundaryId.aidl +++ b/camera/common/aidl/android/hardware/camera/common/TagBoundaryId.aidl @@ -20,5 +20,5 @@ package android.hardware.camera.common; @Backing(type="long") enum TagBoundaryId { AOSP = 0x0, - VENDOR = 0x80000000, + VENDOR = 0x80000000L, } -- GitLab From c31af39ecb862d5199aa55b0de88da84bd917c5d Mon Sep 17 00:00:00 2001 From: Austin Borger Date: Fri, 18 Mar 2022 11:14:01 -0700 Subject: [PATCH 700/825] Update AIDL files accidentally diverged from HIDL / libcamera_metadata. Bug: 222124945 Test: Built android. Change-Id: Iadec82bdb792f00ba475e07b5b62b363c5f56586 --- .../camera/metadata/CameraMetadataTag.aidl | 17 ++++++------ .../RequestAvailableCapabilities.aidl | 1 + .../metadata/SensorTestPatternMode.aidl | 2 +- .../camera/metadata/AutomotiveLensFacing.aidl | 3 ++- .../camera/metadata/AutomotiveLocation.aidl | 3 ++- .../camera/metadata/CameraMetadataTag.aidl | 15 ++++++++--- .../camera/metadata/ColorCorrectionMode.aidl | 5 +--- .../camera/metadata/ControlAeMode.aidl | 7 ++--- .../hardware/camera/metadata/ControlMode.aidl | 5 +--- .../ControlVideoStabilizationMode.aidl | 5 +--- .../RequestAvailableCapabilities.aidl | 1 + ...questAvailableDynamicRangeProfilesMap.aidl | 26 +++++++++---------- .../ScalerAvailableStreamUseCases.aidl | 14 +++++----- .../metadata/SensorTestPatternMode.aidl | 2 +- 14 files changed, 54 insertions(+), 52 deletions(-) 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 13c7924eda..9bb55d27df 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 @@ -188,14 +188,15 @@ enum CameraMetadataTag { ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS = 851982, ANDROID_SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP = 851983, ANDROID_SCALER_AVAILABLE_ROTATE_AND_CROP_MODES = 851984, - ANDROID_SCALER_DEFAULT_SECURE_IMAGE_SIZE = 851985, - ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS = 851986, - ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = 851987, - ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION = 851988, - ANDROID_SCALER_AVAILABLE_STALL_DURATIONS_MAXIMUM_RESOLUTION = 851989, - ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP_MAXIMUM_RESOLUTION = 851990, - ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED = 851991, - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES = 851992, + ANDROID_SCALER_ROTATE_AND_CROP = 851985, + ANDROID_SCALER_DEFAULT_SECURE_IMAGE_SIZE = 851986, + ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS = 851987, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = 851988, + ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION = 851989, + ANDROID_SCALER_AVAILABLE_STALL_DURATIONS_MAXIMUM_RESOLUTION = 851990, + ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP_MAXIMUM_RESOLUTION = 851991, + ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED = 851992, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES = 851994, ANDROID_SENSOR_EXPOSURE_TIME = 917504, ANDROID_SENSOR_FRAME_DURATION = 917505, ANDROID_SENSOR_SENSITIVITY = 917506, diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl index 4462936468..8dc2aa2010 100644 --- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl @@ -57,4 +57,5 @@ enum RequestAvailableCapabilities { ANDROID_REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR = 16, ANDROID_REQUEST_AVAILABLE_CAPABILITIES_REMOSAIC_REPROCESSING = 17, ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT = 18, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE = 19, } diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorTestPatternMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorTestPatternMode.aidl index d013bf431e..3f49b9a731 100644 --- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorTestPatternMode.aidl +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorTestPatternMode.aidl @@ -43,6 +43,6 @@ enum SensorTestPatternMode { ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS = 2, ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY = 3, ANDROID_SENSOR_TEST_PATTERN_MODE_PN9 = 4, + ANDROID_SENSOR_TEST_PATTERN_MODE_BLACK = 5, ANDROID_SENSOR_TEST_PATTERN_MODE_CUSTOM1 = 256, - ANDROID_SENSOR_TEST_PATTERN_MODE_BLACK = 257, } diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLensFacing.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLensFacing.aidl index 704da86461..8cd222948c 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLensFacing.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLensFacing.aidl @@ -22,7 +22,8 @@ package android.hardware.camera.metadata; -/** android.automotive.lens.facing enumeration values +/** + * android.automotive.lens.facing enumeration values * @see ANDROID_AUTOMOTIVE_LENS_FACING */ @VintfStability diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLocation.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLocation.aidl index c55563d76a..0ef64b4c43 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLocation.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLocation.aidl @@ -22,7 +22,8 @@ package android.hardware.camera.metadata; -/** android.automotive.location enumeration values +/** + * android.automotive.location enumeration values * @see ANDROID_AUTOMOTIVE_LOCATION */ @VintfStability diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl index fe91dcfdac..692421ae8d 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl @@ -1160,6 +1160,13 @@ enum CameraMetadataTag { * @see ANDROID_SCALER_ROTATE_AND_CROP */ ANDROID_SCALER_AVAILABLE_ROTATE_AND_CROP_MODES, + /** + * android.scaler.rotateAndCrop [dynamic, enum, public] + * + *

Whether a rotation-and-crop operation is applied to processed + * outputs from the camera.

+ */ + ANDROID_SCALER_ROTATE_AND_CROP, /** * android.scaler.defaultSecureImageSize [static, int32[], public] * @@ -1229,7 +1236,7 @@ enum CameraMetadataTag { * *

The stream use cases supported by this camera device.

*/ - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES = 851994, /** * android.sensor.exposureTime [dynamic, int64, public] * @@ -2232,12 +2239,14 @@ enum CameraMetadataTag { *

The maximum number of Jpeg APP segments supported by the camera HAL device.

*/ ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT, - /** android.automotive.location [static, enum, public] + /** + * android.automotive.location [static, enum, public] * *

Location of the cameras on the automotive devices.

*/ ANDROID_AUTOMOTIVE_LOCATION = CameraMetadataSectionStart.ANDROID_AUTOMOTIVE_START, - /** android.automotive.lens.facing [static, enum[], public] + /** + * android.automotive.lens.facing [static, enum[], public] * *

The direction of the camera faces relative to the vehicle body frame and the * passenger seats.

diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.aidl index 33a0879457..080ca027f6 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.aidl @@ -22,10 +22,7 @@ package android.hardware.camera.metadata; -/* - * Enumeration definitions for the various entries that need them - * - * +/** * android.colorCorrection.mode enumeration values * @see ANDROID_COLOR_CORRECTION_MODE */ diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl index 9a9d5bcf12..e2f5553aee 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl @@ -22,11 +22,8 @@ package android.hardware.camera.metadata; -/* - * Enumeration definitions for the various entries that need them - * - * - * android.control.aeMode enumeration values added +/** + * android.control.aeMode enumeration values * @see ANDROID_CONTROL_AE_MODE */ @VintfStability diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.aidl index 047556dc73..d9ab9ab10a 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.aidl @@ -22,10 +22,7 @@ package android.hardware.camera.metadata; -/* - * Enumeration definitions for the various entries that need them - * - * +/** * android.control.mode enumeration values * @see ANDROID_CONTROL_MODE */ diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl index 4046c4e926..497846c71f 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl @@ -22,10 +22,7 @@ package android.hardware.camera.metadata; -/* - * Enumeration definitions for the various entries that need them - * - * +/** * android.control.videoStabilizationMode enumeration values * @see ANDROID_CONTROL_VIDEO_STABILIZATION_MODE */ diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl index 89f14add1c..f5c77eb28c 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl @@ -48,4 +48,5 @@ enum RequestAvailableCapabilities { ANDROID_REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR, ANDROID_REQUEST_AVAILABLE_CAPABILITIES_REMOSAIC_REPROCESSING, ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE, } diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl index 319be75abe..f04fae3e43 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl @@ -29,17 +29,17 @@ package android.hardware.camera.metadata; @VintfStability @Backing(type="long") enum RequestAvailableDynamicRangeProfilesMap { - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD = 0x1, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10 = 0x2, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10 = 0x4, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS = 0x8, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF = 0x10, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO = 0x20, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM = 0x40, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO = 0x80, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF = 0x100, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO = 0x200, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM = 0x400, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO = 0x800, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_MAX = 0x1000, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD = 0x1L, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10 = 0x2L, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10 = 0x4L, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS = 0x8L, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF = 0x10L, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO = 0x20L, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM = 0x40L, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO = 0x80L, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF = 0x100L, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO = 0x200L, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM = 0x400L, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO = 0x800L, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_MAX = 0x1000L, } diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl index 1b80032f59..daa0fd3028 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl @@ -29,11 +29,11 @@ package android.hardware.camera.metadata; @VintfStability @Backing(type="long") enum ScalerAvailableStreamUseCases { - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0x0, - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 0x1, - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE = 0x2, - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD = 0x3, - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL = 0x4, - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL = 0x5, - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START = 0x10000, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0x0L, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 0x1L, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE = 0x2L, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD = 0x3L, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL = 0x4L, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL = 0x5L, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START = 0x10000L, } diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.aidl index c9ca70aa48..29aede4bbc 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.aidl @@ -34,6 +34,6 @@ enum SensorTestPatternMode { ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS, ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY, ANDROID_SENSOR_TEST_PATTERN_MODE_PN9, - ANDROID_SENSOR_TEST_PATTERN_MODE_CUSTOM1 = 256, ANDROID_SENSOR_TEST_PATTERN_MODE_BLACK, + ANDROID_SENSOR_TEST_PATTERN_MODE_CUSTOM1 = 256, } -- GitLab From 8a6930870efed057f9841dd82130e927b711a2d4 Mon Sep 17 00:00:00 2001 From: Francois Gaffie Date: Tue, 8 Feb 2022 17:40:14 +0100 Subject: [PATCH 701/825] Update Default AudioControl AIDL HAL for version 2 - Add Gain Callback to notify unexpected gain changed from HAL (as currently done for Audio Focus). - Add dumpsys commands Bug: 154906631 Test: build and run VTS tests Signed-off-by: Francois Gaffie Change-Id: I6be9620feb19d766d43be7199be2e9cd6d63c644 Merged-In: I6be9620feb19d766d43be7199be2e9cd6d63c644 (cherry picked from commit 625a8984e8cdcfc908101a3b94e76b3a2f023eb6) --- .../audiocontrol/aidl/default/Android.bp | 3 +- .../aidl/default/AudioControl.cpp | 254 +++++++++++++++++- .../audiocontrol/aidl/default/AudioControl.h | 30 +++ .../aidl/default/audiocontrol-default.xml | 2 +- 4 files changed, 284 insertions(+), 5 deletions(-) diff --git a/automotive/audiocontrol/aidl/default/Android.bp b/automotive/audiocontrol/aidl/default/Android.bp index 1439cce606..6bf4b9d860 100644 --- a/automotive/audiocontrol/aidl/default/Android.bp +++ b/automotive/audiocontrol/aidl/default/Android.bp @@ -29,8 +29,9 @@ cc_binary { vendor: true, shared_libs: [ "android.hardware.audio.common@7.0-enums", + "android.hardware.audio.common-V1-ndk", "android.frameworks.automotive.powerpolicy-V1-ndk", - "android.hardware.automotive.audiocontrol-V1-ndk", + "android.hardware.automotive.audiocontrol-V2-ndk", "libbase", "libbinder_ndk", "libcutils", diff --git a/automotive/audiocontrol/aidl/default/AudioControl.cpp b/automotive/audiocontrol/aidl/default/AudioControl.cpp index c0bc796cdf..a121f8be21 100644 --- a/automotive/audiocontrol/aidl/default/AudioControl.cpp +++ b/automotive/audiocontrol/aidl/default/AudioControl.cpp @@ -30,6 +30,8 @@ #include #include +#include + #include namespace aidl::android::hardware::automotive::audiocontrol { @@ -147,6 +149,47 @@ ndk::ScopedAStatus AudioControl::onDevicesToMuteChange( return ndk::ScopedAStatus::ok(); } +template +static inline std::string toString(const std::vector& in_values) { + return std::accumulate(std::begin(in_values), std::end(in_values), std::string{}, + [](std::string& ls, const aidl_type& rs) { + return ls += (ls.empty() ? "" : ",") + rs.toString(); + }); +} +template +static inline std::string toEnumString(const std::vector& in_values) { + return std::accumulate(std::begin(in_values), std::end(in_values), std::string{}, + [](std::string& ls, const aidl_enum_type& rs) { + return ls += (ls.empty() ? "" : ",") + toString(rs); + }); +} + +ndk::ScopedAStatus AudioControl::onAudioFocusChangeWithMetaData( + const audiohalcommon::PlaybackTrackMetadata& in_playbackMetaData, int32_t in_zoneId, + AudioFocusChange in_focusChange) { + LOG(INFO) << "Focus changed: " << toString(in_focusChange).c_str() << " for metadata " + << in_playbackMetaData.toString().c_str() << " in zone " << in_zoneId; + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus AudioControl::setAudioDeviceGainsChanged( + const std::vector& in_reasons, const std::vector& in_gains) { + LOG(INFO) << "Audio Device Gains changed: resons:" << toEnumString(in_reasons).c_str() + << " for devices: " << toString(in_gains).c_str(); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus AudioControl::registerGainCallback( + const std::shared_ptr& in_callback) { + LOG(DEBUG) << ": " << __func__; + if (in_callback) { + std::atomic_store(&mAudioGainCallback, in_callback); + } else { + LOG(ERROR) << "Unexpected nullptr for audio gain callback resulting in no-op."; + } + return ndk::ScopedAStatus::ok(); +} + binder_status_t AudioControl::dump(int fd, const char** args, uint32_t numArgs) { if (numArgs == 0) { return dumpsys(fd); @@ -159,6 +202,12 @@ binder_status_t AudioControl::dump(int fd, const char** args, uint32_t numArgs) return cmdRequestFocus(fd, args, numArgs); } else if (EqualsIgnoreCase(option, "--abandon")) { return cmdAbandonFocus(fd, args, numArgs); + } else if (EqualsIgnoreCase(option, "--requestFocusWithMetaData")) { + return cmdRequestFocusWithMetaData(fd, args, numArgs); + } else if (EqualsIgnoreCase(option, "--abandonFocusWithMetaData")) { + return cmdAbandonFocusWithMetaData(fd, args, numArgs); + } else if (EqualsIgnoreCase(option, "--audioGainCallback")) { + return cmdOnAudioDeviceGainsChanged(fd, args, numArgs); } else { dprintf(fd, "Invalid option: %s\n", option.c_str()); return STATUS_BAD_VALUE; @@ -171,20 +220,49 @@ binder_status_t AudioControl::dumpsys(int fd) { } else { dprintf(fd, "Focus listener registered\n"); } + dprintf(fd, "AudioGainCallback %sregistered\n", (mAudioGainCallback == nullptr ? "NOT " : "")); return STATUS_OK; } binder_status_t AudioControl::cmdHelp(int fd) const { dprintf(fd, "Usage: \n\n"); - dprintf(fd, "[no args]: dumps focus listener status\n"); + dprintf(fd, "[no args]: dumps focus listener / gain callback registered status\n"); dprintf(fd, "--help: shows this help\n"); dprintf(fd, "--request : requests audio focus for specified " - "usage (string), audio zone ID (int), and focus gain type (int)\n"); + "usage (string), audio zone ID (int), and focus gain type (int)\n" + "Deprecated, use MetaData instead\n"); dprintf(fd, "--abandon : abandons audio focus for specified usage (string) and " - "audio zone ID (int)\n"); + "audio zone ID (int)\n" + "Deprecated, use MetaData instead\n"); dprintf(fd, "See audio_policy_configuration.xsd for valid AudioUsage values.\n"); + + dprintf(fd, + "--requestFocusWithMetaData : " + "requests audio focus for specified metadata, audio zone ID (int), " + "and focus gain type (int)\n"); + dprintf(fd, + "--abandonFocusWithMetaData : " + "abandons audio focus for specified metadata and audio zone ID (int)\n"); + dprintf(fd, + "--audioGainCallback [, ...]" + " [ ...]: fire audio " + "gain callback for audio zone ID (int), the given reasons (csv int) for given pairs " + "of device address (string) and gain index (int) \n"); + + dprintf(fd, + "Note on : specified as where (int)usage, " + "(int)content type and tags (string)string)\n"); + dprintf(fd, + "See android/media/audio/common/AudioUsageType.aidl for valid AudioUsage values.\n"); + dprintf(fd, + "See android/media/audio/common/AudioContentType.aidl for valid AudioContentType " + "values.\n"); + dprintf(fd, + "Tags are optional. If provided, it must follow the = pattern, where the " + "value is namespaced (for example com.google.strategy=VR).\n"); + return STATUS_OK; } @@ -266,4 +344,174 @@ binder_status_t AudioControl::cmdAbandonFocus(int fd, const char** args, uint32_ return STATUS_OK; } +binder_status_t AudioControl::parseMetaData(int fd, const std::string& metadataLiteral, + audiohalcommon::PlaybackTrackMetadata& trackMetadata) { + std::stringstream csvMetaData(metadataLiteral); + std::vector splitMetaData; + std::string attribute; + while (getline(csvMetaData, attribute, ',')) { + splitMetaData.push_back(attribute); + } + if (splitMetaData.size() != 2 && splitMetaData.size() != 3) { + dprintf(fd, + "Invalid metadata: %s, please provide as " + "where (int)usage, (int)content type and tags (string)string)\n", + metadataLiteral.c_str()); + return STATUS_BAD_VALUE; + } + int usage; + if (!safelyParseInt(splitMetaData[0], &usage)) { + dprintf(fd, "Non-integer usage provided with request: %s\n", splitMetaData[0].c_str()); + return STATUS_BAD_VALUE; + } + int contentType; + if (!safelyParseInt(splitMetaData[1], &contentType)) { + dprintf(fd, "Non-integer content type provided with request: %s\n", + splitMetaData[1].c_str()); + return STATUS_BAD_VALUE; + } + const std::string tags = (splitMetaData.size() == 3 ? splitMetaData[2] : ""); + + trackMetadata = {.usage = static_cast(usage), + .contentType = static_cast(contentType), + .tags = {tags}}; + return STATUS_OK; +} + +binder_status_t AudioControl::cmdRequestFocusWithMetaData(int fd, const char** args, + uint32_t numArgs) { + if (!checkCallerHasWritePermissions(fd)) { + return STATUS_PERMISSION_DENIED; + } + if (numArgs != 4) { + dprintf(fd, + "Invalid number of arguments: please provide:\n" + "--requestFocusWithMetaData : " + "requests audio focus for specified metadata, audio zone ID (int), " + "and focus gain type (int)\n"); + return STATUS_BAD_VALUE; + } + std::string metadataLiteral = std::string(args[1]); + audiohalcommon::PlaybackTrackMetadata trackMetadata{}; + auto status = parseMetaData(fd, metadataLiteral, trackMetadata); + if (status != STATUS_OK) { + return status; + } + + int zoneId; + if (!safelyParseInt(std::string(args[2]), &zoneId)) { + dprintf(fd, "Non-integer zoneId provided with request: %s\n", std::string(args[2]).c_str()); + return STATUS_BAD_VALUE; + } + + int focusGainValue; + if (!safelyParseInt(std::string(args[3]), &focusGainValue)) { + dprintf(fd, "Non-integer focusGain provided with request: %s\n", + std::string(args[3]).c_str()); + return STATUS_BAD_VALUE; + } + AudioFocusChange focusGain = AudioFocusChange(focusGainValue); + + if (mFocusListener == nullptr) { + dprintf(fd, "Unable to request focus - no focus listener registered\n"); + return STATUS_BAD_VALUE; + } + mFocusListener->requestAudioFocusWithMetaData(trackMetadata, zoneId, focusGain); + dprintf(fd, "Requested focus for metadata %s, zoneId %d, and focusGain %d\n", + trackMetadata.toString().c_str(), zoneId, focusGain); + return STATUS_OK; +} + +binder_status_t AudioControl::cmdAbandonFocusWithMetaData(int fd, const char** args, + uint32_t numArgs) { + if (!checkCallerHasWritePermissions(fd)) { + return STATUS_PERMISSION_DENIED; + } + if (numArgs != 3) { + dprintf(fd, + "Invalid number of arguments: please provide:\n" + "--abandonFocusWithMetaData : " + "abandons audio focus for specified metadata and audio zone ID (int)\n"); + return STATUS_BAD_VALUE; + } + std::string metadataLiteral = std::string(args[1]); + audiohalcommon::PlaybackTrackMetadata trackMetadata{}; + auto status = parseMetaData(fd, metadataLiteral, trackMetadata); + if (status != STATUS_OK) { + return status; + } + int zoneId; + if (!safelyParseInt(std::string(args[2]), &zoneId)) { + dprintf(fd, "Non-integer zoneId provided with request: %s\n", std::string(args[2]).c_str()); + return STATUS_BAD_VALUE; + } + if (mFocusListener == nullptr) { + dprintf(fd, "Unable to abandon focus - no focus listener registered\n"); + return STATUS_BAD_VALUE; + } + + mFocusListener->abandonAudioFocusWithMetaData(trackMetadata, zoneId); + dprintf(fd, "Abandoned focus for metadata %s and zoneId %d\n", trackMetadata.toString().c_str(), + zoneId); + return STATUS_OK; +} + +binder_status_t AudioControl::cmdOnAudioDeviceGainsChanged(int fd, const char** args, + uint32_t numArgs) { + if (!checkCallerHasWritePermissions(fd)) { + return STATUS_PERMISSION_DENIED; + } + if ((numArgs + 1) % 2 != 0) { + dprintf(fd, + "Invalid number of arguments: please provide\n" + "--audioGainCallback [, ...]" + " [ ...]: " + "fire audio gain callback for audio zone ID (int), " + "with the given reasons (csv int) for given pairs of device address (string) " + "and gain index (int) \n"); + return STATUS_BAD_VALUE; + } + int zoneId; + if (!safelyParseInt(string(args[1]), &zoneId)) { + dprintf(fd, "Non-integer zoneId provided with request: %s\n", std::string(args[1]).c_str()); + return STATUS_BAD_VALUE; + } + std::string reasonsLiteral = std::string(args[2]); + std::stringstream csvReasonsLiteral(reasonsLiteral); + std::vector reasons; + std::string reasonLiteral; + while (getline(csvReasonsLiteral, reasonLiteral, ',')) { + int reason; + if (!safelyParseInt(reasonLiteral, &reason)) { + dprintf(fd, "Invalid Reason(s) provided %s\n", reasonLiteral.c_str()); + return STATUS_BAD_VALUE; + } + reasons.push_back(static_cast(reason)); + } + + std::vector agcis{}; + for (uint32_t i = 3; i < numArgs; i += 2) { + std::string deviceAddress = std::string(args[i]); + int32_t index; + if (!safelyParseInt(std::string(args[i + 1]), &index)) { + dprintf(fd, "Non-integer index provided with request: %s\n", + std::string(args[i + 1]).c_str()); + return STATUS_BAD_VALUE; + } + AudioGainConfigInfo agci{zoneId, deviceAddress, index}; + agcis.push_back(agci); + } + if (mAudioGainCallback == nullptr) { + dprintf(fd, + "Unable to trig audio gain callback for reasons=%s and gains=%s\n" + " - no audio gain callback registered\n", + toEnumString(reasons).c_str(), toString(agcis).c_str()); + return STATUS_BAD_VALUE; + } + + mAudioGainCallback->onAudioDeviceGainsChanged(reasons, agcis); + dprintf(fd, "Fired audio gain callback for reasons=%s and gains=%s\n", + toEnumString(reasons).c_str(), toString(agcis).c_str()); + return STATUS_OK; +} } // namespace aidl::android::hardware::automotive::audiocontrol diff --git a/automotive/audiocontrol/aidl/default/AudioControl.h b/automotive/audiocontrol/aidl/default/AudioControl.h index cca9c44004..16b80e890c 100644 --- a/automotive/audiocontrol/aidl/default/AudioControl.h +++ b/automotive/audiocontrol/aidl/default/AudioControl.h @@ -17,12 +17,20 @@ #define ANDROID_HARDWARE_AUTOMOTIVE_AUDIOCONTROL_AUDIOCONTROL_H #include +#include #include #include +#include #include +#include + +#include namespace aidl::android::hardware::automotive::audiocontrol { +namespace audiohalcommon = ::aidl::android::hardware::audio::common; +namespace audiomediacommon = ::aidl::android::media::audio::common; + class AudioControl : public BnAudioControl { public: ndk::ScopedAStatus onAudioFocusChange(const std::string& in_usage, int32_t in_zoneId, @@ -35,6 +43,15 @@ class AudioControl : public BnAudioControl { const std::shared_ptr& in_listener) override; ndk::ScopedAStatus setBalanceTowardRight(float in_value) override; ndk::ScopedAStatus setFadeTowardFront(float in_value) override; + ndk::ScopedAStatus onAudioFocusChangeWithMetaData( + const audiohalcommon::PlaybackTrackMetadata& in_playbackMetaData, int32_t in_zoneId, + AudioFocusChange in_focusChange) override; + ndk::ScopedAStatus setAudioDeviceGainsChanged( + const std::vector& in_reasons, + const std::vector& in_gains) override; + ndk::ScopedAStatus registerGainCallback( + const std::shared_ptr& in_callback) override; + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; private: @@ -44,9 +61,22 @@ class AudioControl : public BnAudioControl { // listener, then it should also include mutexes or make the listener atomic. std::shared_ptr mFocusListener; + /** + * @brief mAudioGainCallback will be used by this HAL instance to communicate e.g. with a single + * instance of CarAudioService to report unexpected gain changed. + */ + std::shared_ptr mAudioGainCallback = nullptr; + binder_status_t cmdHelp(int fd) const; binder_status_t cmdRequestFocus(int fd, const char** args, uint32_t numArgs); binder_status_t cmdAbandonFocus(int fd, const char** args, uint32_t numArgs); + binder_status_t cmdRequestFocusWithMetaData(int fd, const char** args, uint32_t numArgs); + binder_status_t cmdAbandonFocusWithMetaData(int fd, const char** args, uint32_t numArgs); + binder_status_t cmdOnAudioDeviceGainsChanged(int fd, const char** args, uint32_t numArgs); + + binder_status_t parseMetaData(int fd, const std::string& metadataLiteral, + audiohalcommon::PlaybackTrackMetadata& trackMetadata); + binder_status_t dumpsys(int fd); }; diff --git a/automotive/audiocontrol/aidl/default/audiocontrol-default.xml b/automotive/audiocontrol/aidl/default/audiocontrol-default.xml index f95d05fe77..e82f6fada9 100644 --- a/automotive/audiocontrol/aidl/default/audiocontrol-default.xml +++ b/automotive/audiocontrol/aidl/default/audiocontrol-default.xml @@ -1,4 +1,4 @@ - + android.hardware.automotive.audiocontrol IAudioControl/default -- GitLab From b22e1d6f3ec576931afbdc855d1752be9055260e Mon Sep 17 00:00:00 2001 From: Francois Gaffie Date: Wed, 9 Feb 2022 11:36:55 +0100 Subject: [PATCH 702/825] Update VTS tests for AudioControl AIDL HAL version 2 Bug: 154906631 Test: atest VtsAidlHalAudioControlTest Signed-off-by: Francois Gaffie Change-Id: Iea05f7bfcc102ccd5d79b2f29c3fbf179044e537 Merged-In: Iea05f7bfcc102ccd5d79b2f29c3fbf179044e537 (cherry picked from commit e5af282ccc36ac9a95a1a0a815c831aeb8ad23fd) --- automotive/audiocontrol/aidl/vts/Android.bp | 7 +- .../aidl/vts/VtsHalAudioControlTargetTest.cpp | 67 +++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/automotive/audiocontrol/aidl/vts/Android.bp b/automotive/audiocontrol/aidl/vts/Android.bp index 6856b91d2b..3d4be4828f 100644 --- a/automotive/audiocontrol/aidl/vts/Android.bp +++ b/automotive/audiocontrol/aidl/vts/Android.bp @@ -37,11 +37,16 @@ cc_test { "libxml2", ], static_libs: [ - "android.hardware.automotive.audiocontrol-V1-cpp", + "android.hardware.automotive.audiocontrol-V2-cpp", + "android.hardware.audio.common-V1-cpp", + "android.media.audio.common.types-V1-cpp", "libgmock", ], test_suites: [ "general-tests", "vts", ], + cflags: [ + "-Wno-deprecated-declarations", + ], } diff --git a/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp b/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp index ae53c68528..f4f5eef757 100644 --- a/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp +++ b/automotive/audiocontrol/aidl/vts/VtsHalAudioControlTargetTest.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -30,10 +31,13 @@ using android::sp; using android::String16; using android::binder::Status; using android::hardware::automotive::audiocontrol::AudioFocusChange; +using android::hardware::automotive::audiocontrol::AudioGainConfigInfo; +using android::hardware::automotive::audiocontrol::BnAudioGainCallback; using android::hardware::automotive::audiocontrol::BnFocusListener; using android::hardware::automotive::audiocontrol::DuckingInfo; using android::hardware::automotive::audiocontrol::IAudioControl; using android::hardware::automotive::audiocontrol::MutingInfo; +using android::hardware::automotive::audiocontrol::Reasons; #include "android_audio_policy_configuration_V7_0.h" @@ -41,6 +45,9 @@ namespace xsd { using namespace android::audio::policy::configuration::V7_0; } +namespace audiohalcommon = android::hardware::audio::common; +namespace audiomediacommon = android::media::audio::common; + class AudioControlAidl : public testing::TestWithParam { public: virtual void SetUp() override { @@ -103,6 +110,11 @@ struct FocusListenerMock : BnFocusListener { MOCK_METHOD(Status, requestAudioFocus, (const String16& usage, int32_t zoneId, AudioFocusChange focusGain)); MOCK_METHOD(Status, abandonAudioFocus, (const String16& usage, int32_t zoneId)); + MOCK_METHOD(Status, requestAudioFocusWithMetaData, + (const audiohalcommon::PlaybackTrackMetadata& metaData, int32_t zoneId, + AudioFocusChange focusGain)); + MOCK_METHOD(Status, abandonAudioFocusWithMetaData, + (const audiohalcommon::PlaybackTrackMetadata& metaData, int32_t zoneId)); }; /* @@ -159,6 +171,61 @@ TEST_P(AudioControlAidl, DuckChangeExercise) { ASSERT_TRUE(audioControl->onDevicesToDuckChange(duckingInfos).isOk()); } +TEST_P(AudioControlAidl, FocusChangeWithMetaDataExercise) { + ALOGI("Focus Change test"); + + audiohalcommon::PlaybackTrackMetadata metadata; + metadata.usage = audiomediacommon::AudioUsage::MEDIA; + metadata.contentType = audiomediacommon::AudioContentType::MUSIC; + metadata.tags = {"com.google.android=VR"}; + ASSERT_TRUE( + audioControl + ->onAudioFocusChangeWithMetaData(metadata, 0, AudioFocusChange::GAIN_TRANSIENT) + .isOk()); +}; + +TEST_P(AudioControlAidl, SetAudioDeviceGainsChangedExercise) { + ALOGI("Set Audio Gains Changed test"); + + const std::vector reasons{Reasons::FORCED_MASTER_MUTE, Reasons::NAV_DUCKING}; + AudioGainConfigInfo agci1; + agci1.zoneId = 0; + agci1.devicePortAddress = String16("address 1"); + agci1.volumeIndex = 8; + + AudioGainConfigInfo agci2; + agci1.zoneId = 0; + agci1.devicePortAddress = String16("address 2"); + agci1.volumeIndex = 1; + + std::vector gains{agci1, agci2}; + ASSERT_TRUE(audioControl->setAudioDeviceGainsChanged(reasons, gains).isOk()); +} + +/* + * Test Audio Gain Callback registration. + * + * Verifies that: + * - registerGainCallback succeeds; + * - registering a second callback succeeds in replacing the first; + * - closing handle does not crash; + */ +struct AudioGainCallbackMock : BnAudioGainCallback { + MOCK_METHOD(Status, onAudioDeviceGainsChanged, + (const std::vector& reasons, + const std::vector& gains)); +}; + +TEST_P(AudioControlAidl, AudioGainCallbackRegistration) { + ALOGI("Focus listener test"); + + sp gainCallback = new AudioGainCallbackMock(); + ASSERT_TRUE(audioControl->registerGainCallback(gainCallback).isOk()); + + sp gainCallback2 = new AudioGainCallbackMock(); + ASSERT_TRUE(audioControl->registerGainCallback(gainCallback2).isOk()); +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AudioControlAidl); INSTANTIATE_TEST_SUITE_P( Audiocontrol, AudioControlAidl, -- GitLab From 13c5375859e82f4a77cda18ec2b5a0ddf49c036f Mon Sep 17 00:00:00 2001 From: Sunil Ravi Date: Mon, 21 Mar 2022 18:31:48 -0700 Subject: [PATCH 703/825] wifi: Remove RxFilter Tests from VTS test suite APF is the latest packet filter supportered in Android. So remove the tests related to deprecated RXFILTER commands. Bug: 217233384 Test: atest VtsHalWifiSupplicantStaIfaceTargetTest Change-Id: I1eb2558fe17f1f7e468440fb541aaadff215b542 --- .../supplicant_sta_iface_aidl_test.cpp | 31 ------------------- 1 file changed, 31 deletions(-) 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 2ed6a0e476..272a427e77 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 @@ -43,7 +43,6 @@ using aidl::android::hardware::wifi::supplicant::ISupplicant; using aidl::android::hardware::wifi::supplicant::ISupplicantStaIface; using aidl::android::hardware::wifi::supplicant::ISupplicantStaNetwork; using aidl::android::hardware::wifi::supplicant::KeyMgmtMask; -using aidl::android::hardware::wifi::supplicant::RxFilterType; using aidl::android::hardware::wifi::supplicant::WpaDriverCapabilitiesMask; using aidl::android::hardware::wifi::supplicant::WpsConfigMethods; using android::ProcessState; @@ -543,36 +542,6 @@ TEST_P(SupplicantStaIfaceAidlTest, SetPowerSave) { EXPECT_TRUE(sta_iface_->setPowerSave(false).isOk()); } -/* - * StartRxFilter - */ -TEST_P(SupplicantStaIfaceAidlTest, StartRxFilter) { - EXPECT_TRUE(sta_iface_->startRxFilter().isOk()); -} - -/* - * StopRxFilter - */ -TEST_P(SupplicantStaIfaceAidlTest, StopRxFilter) { - EXPECT_TRUE(sta_iface_->stopRxFilter().isOk()); -} - -/* - * AddRxFilter - */ -TEST_P(SupplicantStaIfaceAidlTest, AddRxFilter) { - EXPECT_TRUE(sta_iface_->addRxFilter(RxFilterType::V4_MULTICAST).isOk()); - EXPECT_TRUE(sta_iface_->addRxFilter(RxFilterType::V6_MULTICAST).isOk()); -} - -/* - * RemoveRxFilter - */ -TEST_P(SupplicantStaIfaceAidlTest, RemoveRxFilter) { - EXPECT_TRUE(sta_iface_->removeRxFilter(RxFilterType::V4_MULTICAST).isOk()); - EXPECT_TRUE(sta_iface_->removeRxFilter(RxFilterType::V6_MULTICAST).isOk()); -} - /* * AddExtRadioWork */ -- GitLab From e1685a735ed23a66305beb779d16cebb258177fc Mon Sep 17 00:00:00 2001 From: Avichal Rakesh Date: Tue, 22 Mar 2022 13:52:36 -0700 Subject: [PATCH 704/825] Camera: Fix test to use 64 bit pointer in stream use cases I23a4324602 updated stream use cases to use 64 bit integers. The `configureStreamUseCases` test was still using a pointer to 32 bit integer to determine supported use cases. This CL updates how supported use cases are populated to use a pointer to 64 bit integers instead. Bug: 226171215 Test: `configureStreamUseCases` which was failing on cuttlefish is now passing Change-Id: I5b1ef4e8e344e43b10ea5c992afaace03608660d --- .../vts/VtsAidlHalCameraProvider_TargetTest.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp index af83578ef4..bde56b315c 100644 --- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp +++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp @@ -2989,8 +2989,8 @@ TEST_P(CameraAidlTest, configureStreamsUseCases) { auto retcode = find_camera_metadata_ro_entry( staticMeta, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, &entry); if ((0 == retcode) && (entry.count > 0)) { - supportedUseCases.insert(supportedUseCases.end(), entry.data.i32, - entry.data.i32 + entry.count); + supportedUseCases.insert(supportedUseCases.end(), entry.data.i64, + entry.data.i64 + entry.count); } else { supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT); } @@ -3034,12 +3034,13 @@ TEST_P(CameraAidlTest, configureStreamsUseCases) { bool combSupported; ret = cameraDevice->isStreamCombinationSupported(config, &combSupported); - ASSERT_TRUE((ret.isOk()) || (static_cast(Status::OPERATION_NOT_SUPPORTED) == - ret.getServiceSpecificError())); - if (ret.isOk()) { - ASSERT_EQ(combSupported, useCaseSupported); + if (static_cast(Status::OPERATION_NOT_SUPPORTED) == + ret.getServiceSpecificError()) { + continue; } + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(combSupported, useCaseSupported); std::vector halStreams; ret = mSession->configureStreams(config, &halStreams); -- GitLab From 8af5e8479a751f6c2acaf3a17ee3b4c16272c421 Mon Sep 17 00:00:00 2001 From: chasewu Date: Tue, 22 Mar 2022 01:42:24 +0800 Subject: [PATCH 705/825] Fix the default BandwidthAmplitudeMap contant Fix: 225286612 Fix: 224650717 Test: forrest test Signed-off-by: chasewu Change-Id: I5c550426b7cbbdf6e4e9ad90d6248b6ed0523399 --- vibrator/aidl/default/Vibrator.cpp | 91 ++++++++++++++++++------------ 1 file changed, 54 insertions(+), 37 deletions(-) diff --git a/vibrator/aidl/default/Vibrator.cpp b/vibrator/aidl/default/Vibrator.cpp index 5755ce55b6..ddc6ee0d02 100644 --- a/vibrator/aidl/default/Vibrator.cpp +++ b/vibrator/aidl/default/Vibrator.cpp @@ -24,21 +24,23 @@ namespace android { namespace hardware { namespace vibrator { -static constexpr int32_t kComposeDelayMaxMs = 1000; -static constexpr int32_t kComposeSizeMax = 256; -static constexpr int32_t kComposePwleSizeMax = 127; +static constexpr int32_t COMPOSE_DELAY_MAX_MS = 1000; +static constexpr int32_t COMPOSE_SIZE_MAX = 256; +static constexpr int32_t COMPOSE_PWLE_SIZE_MAX = 127; -static constexpr float kResonantFrequency = 150.0; -static constexpr float kQFactor = 11.0; +static constexpr float Q_FACTOR = 11.0; static constexpr int32_t COMPOSE_PWLE_PRIMITIVE_DURATION_MAX_MS = 16383; static constexpr float PWLE_LEVEL_MIN = 0.0; -static constexpr float PWLE_LEVEL_MAX = 0.98256; +static constexpr float PWLE_LEVEL_MAX = 1.0; static constexpr float PWLE_FREQUENCY_RESOLUTION_HZ = 1.0; static constexpr float PWLE_FREQUENCY_MIN_HZ = 140.0; +static constexpr float RESONANT_FREQUENCY_HZ = 150.0; static constexpr float PWLE_FREQUENCY_MAX_HZ = 160.0; +static constexpr float PWLE_BW_MAP_SIZE = + 1 + ((PWLE_FREQUENCY_MAX_HZ - PWLE_FREQUENCY_MIN_HZ) / PWLE_FREQUENCY_RESOLUTION_HZ); ndk::ScopedAStatus Vibrator::getCapabilities(int32_t* _aidl_return) { - LOG(INFO) << "Vibrator reporting capabilities"; + LOG(VERBOSE) << "Vibrator reporting capabilities"; *_aidl_return = IVibrator::CAP_ON_CALLBACK | IVibrator::CAP_PERFORM_CALLBACK | IVibrator::CAP_AMPLITUDE_CONTROL | IVibrator::CAP_EXTERNAL_CONTROL | IVibrator::CAP_EXTERNAL_AMPLITUDE_CONTROL | IVibrator::CAP_COMPOSE_EFFECTS | @@ -49,18 +51,18 @@ ndk::ScopedAStatus Vibrator::getCapabilities(int32_t* _aidl_return) { } ndk::ScopedAStatus Vibrator::off() { - LOG(INFO) << "Vibrator off"; + LOG(VERBOSE) << "Vibrator off"; return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus Vibrator::on(int32_t timeoutMs, const std::shared_ptr& callback) { - LOG(INFO) << "Vibrator on for timeoutMs: " << timeoutMs; + LOG(VERBOSE) << "Vibrator on for timeoutMs: " << timeoutMs; if (callback != nullptr) { std::thread([=] { - LOG(INFO) << "Starting on on another thread"; + LOG(VERBOSE) << "Starting on on another thread"; usleep(timeoutMs * 1000); - LOG(INFO) << "Notifying on complete"; + LOG(VERBOSE) << "Notifying on complete"; if (!callback->onComplete().isOk()) { LOG(ERROR) << "Failed to call onComplete"; } @@ -72,7 +74,7 @@ ndk::ScopedAStatus Vibrator::on(int32_t timeoutMs, ndk::ScopedAStatus Vibrator::perform(Effect effect, EffectStrength strength, const std::shared_ptr& callback, int32_t* _aidl_return) { - LOG(INFO) << "Vibrator perform"; + LOG(VERBOSE) << "Vibrator perform"; if (effect != Effect::CLICK && effect != Effect::TICK) { return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION)); @@ -86,9 +88,9 @@ ndk::ScopedAStatus Vibrator::perform(Effect effect, EffectStrength strength, if (callback != nullptr) { std::thread([=] { - LOG(INFO) << "Starting perform on another thread"; + LOG(VERBOSE) << "Starting perform on another thread"; usleep(kEffectMillis * 1000); - LOG(INFO) << "Notifying perform complete"; + LOG(VERBOSE) << "Notifying perform complete"; callback->onComplete(); }).detach(); } @@ -103,7 +105,7 @@ ndk::ScopedAStatus Vibrator::getSupportedEffects(std::vector* _aidl_retu } ndk::ScopedAStatus Vibrator::setAmplitude(float amplitude) { - LOG(INFO) << "Vibrator set amplitude: " << amplitude; + LOG(VERBOSE) << "Vibrator set amplitude: " << amplitude; if (amplitude <= 0.0f || amplitude > 1.0f) { return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_ILLEGAL_ARGUMENT)); } @@ -111,17 +113,17 @@ ndk::ScopedAStatus Vibrator::setAmplitude(float amplitude) { } ndk::ScopedAStatus Vibrator::setExternalControl(bool enabled) { - LOG(INFO) << "Vibrator set external control: " << enabled; + LOG(VERBOSE) << "Vibrator set external control: " << enabled; return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus Vibrator::getCompositionDelayMax(int32_t* maxDelayMs) { - *maxDelayMs = kComposeDelayMaxMs; + *maxDelayMs = COMPOSE_DELAY_MAX_MS; return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus Vibrator::getCompositionSizeMax(int32_t* maxSize) { - *maxSize = kComposeSizeMax; + *maxSize = COMPOSE_SIZE_MAX; return ndk::ScopedAStatus::ok(); } @@ -153,7 +155,7 @@ ndk::ScopedAStatus Vibrator::getPrimitiveDuration(CompositePrimitive primitive, ndk::ScopedAStatus Vibrator::compose(const std::vector& composite, const std::shared_ptr& callback) { - if (composite.size() > kComposeSizeMax) { + if (composite.size() > COMPOSE_SIZE_MAX) { return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } @@ -161,7 +163,7 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector& composi getSupportedPrimitives(&supported); for (auto& e : composite) { - if (e.delayMs > kComposeDelayMaxMs) { + if (e.delayMs > COMPOSE_DELAY_MAX_MS) { return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } if (e.scale < 0.0f || e.scale > 1.0f) { @@ -173,14 +175,14 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector& composi } std::thread([=] { - LOG(INFO) << "Starting compose on another thread"; + LOG(VERBOSE) << "Starting compose on another thread"; for (auto& e : composite) { if (e.delayMs) { usleep(e.delayMs * 1000); } - LOG(INFO) << "triggering primitive " << static_cast(e.primitive) << " @ scale " - << e.scale; + LOG(VERBOSE) << "triggering primitive " << static_cast(e.primitive) << " @ scale " + << e.scale; int32_t durationMs; getPrimitiveDuration(e.primitive, &durationMs); @@ -188,7 +190,7 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector& composi } if (callback != nullptr) { - LOG(INFO) << "Notifying perform complete"; + LOG(VERBOSE) << "Notifying perform complete"; callback->onComplete(); } }).detach(); @@ -207,24 +209,24 @@ ndk::ScopedAStatus Vibrator::alwaysOnEnable(int32_t id, Effect effect, EffectStr if (std::find(effects.begin(), effects.end(), effect) == effects.end()) { return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } else { - LOG(INFO) << "Enabling always-on ID " << id << " with " << toString(effect) << "/" - << toString(strength); + LOG(VERBOSE) << "Enabling always-on ID " << id << " with " << toString(effect) << "/" + << toString(strength); return ndk::ScopedAStatus::ok(); } } ndk::ScopedAStatus Vibrator::alwaysOnDisable(int32_t id) { - LOG(INFO) << "Disabling always-on ID " << id; + LOG(VERBOSE) << "Disabling always-on ID " << id; return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus Vibrator::getResonantFrequency(float *resonantFreqHz) { - *resonantFreqHz = kResonantFrequency; + *resonantFreqHz = RESONANT_FREQUENCY_HZ; return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus Vibrator::getQFactor(float *qFactor) { - *qFactor = kQFactor; + *qFactor = Q_FACTOR; return ndk::ScopedAStatus::ok(); } @@ -239,11 +241,26 @@ ndk::ScopedAStatus Vibrator::getFrequencyMinimum(float *freqMinimumHz) { } ndk::ScopedAStatus Vibrator::getBandwidthAmplitudeMap(std::vector *_aidl_return) { - // A valid array should be of size: - // (PWLE_FREQUENCY_MAX_HZ - PWLE_FREQUENCY_MIN_HZ) / PWLE_FREQUENCY_RESOLUTION_HZ - *_aidl_return = {0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, - 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20}; - return ndk::ScopedAStatus::ok(); + // The output BandwidthAmplitudeMap will be as below and the maximum + // amplitude 1.0 will be set on RESONANT_FREQUENCY_HZ + // {0.9, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1, 0.99, 0.98, 0.97, + // 0.96, 0.95, 0.94, 0.93, 0.92, 0.91, 0.9} + int32_t capabilities = 0; + int halfMapSize = PWLE_BW_MAP_SIZE / 2; + Vibrator::getCapabilities(&capabilities); + if (capabilities & IVibrator::CAP_FREQUENCY_CONTROL) { + std::vector bandwidthAmplitudeMap(PWLE_BW_MAP_SIZE, PWLE_LEVEL_MAX); + for (int i = 0; i < halfMapSize; ++i) { + bandwidthAmplitudeMap[halfMapSize + i + 1] = + bandwidthAmplitudeMap[halfMapSize + i] - 0.01; + bandwidthAmplitudeMap[halfMapSize - i - 1] = + bandwidthAmplitudeMap[halfMapSize - i] - 0.01; + } + *_aidl_return = bandwidthAmplitudeMap; + return ndk::ScopedAStatus::ok(); + } else { + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); + } } ndk::ScopedAStatus Vibrator::getPwlePrimitiveDurationMax(int32_t *durationMs) { @@ -252,7 +269,7 @@ ndk::ScopedAStatus Vibrator::getPwlePrimitiveDurationMax(int32_t *durationMs) { } ndk::ScopedAStatus Vibrator::getPwleCompositionSizeMax(int32_t *maxSize) { - *maxSize = kComposePwleSizeMax; + *maxSize = COMPOSE_PWLE_SIZE_MAX; return ndk::ScopedAStatus::ok(); } @@ -380,10 +397,10 @@ ndk::ScopedAStatus Vibrator::composePwle(const std::vector &compo } std::thread([=] { - LOG(INFO) << "Starting composePwle on another thread"; + LOG(VERBOSE) << "Starting composePwle on another thread"; usleep(totalDuration * 1000); if (callback != nullptr) { - LOG(INFO) << "Notifying compose PWLE complete"; + LOG(VERBOSE) << "Notifying compose PWLE complete"; callback->onComplete(); } }).detach(); -- GitLab From d48a5a982957bdce249b989ca2b8839e87e6f562 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Fri, 18 Mar 2022 23:16:20 +0000 Subject: [PATCH 706/825] Clarify documentation for the dimming stage. Plumbing this enum to RenderEngine requires knowledge of the intended transfer function to apply the dimming stage in. Because this is expected to be a contrained use-case and because apis are frozen, document that RenderEngine is allowed to assume that the resulting dimming matrix may be gamma corrected using a 2.2 power function. Bug: 218954037 Test: builds Change-Id: Ie7d357f8ce79295af017d80c62a2759dbccce5d2 --- .../android/hardware/graphics/composer3/DimmingStage.aidl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DimmingStage.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DimmingStage.aidl index f732d417b1..23d5f4a007 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DimmingStage.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DimmingStage.aidl @@ -29,7 +29,12 @@ enum DimmingStage { */ LINEAR = 1, /** - * Dimming operations must be applied in gamma space, after OETF has been applied + * Dimming operations must be applied in gamma space, after OETF has been applied. + * Note that for this dimming operation to be perceptually correct it must also be gamma + * corrected. The framework will assume that it is able to use the gamma 2.2 + * power function for gamma correcting the dimming matrix, for simplicity of + * implementation and the fact that gamma 2.2 is close enough to typical SDR + * transfer functions that would be used for the client target. */ GAMMA_OETF = 2, } -- GitLab From da10904e96f61e8aa56dd98e5232a6134f4a2491 Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Thu, 17 Mar 2022 18:44:20 -0700 Subject: [PATCH 707/825] Add JavaDerive toString to AIDL classes Test: manually verify logcat Bug: 223230764 Change-Id: If6d459823d3d6ceb0d7c49ba00f01268482128f6 --- .../current/android/hardware/radio/config/PhoneCapability.aidl | 2 +- .../current/android/hardware/radio/config/SimPortInfo.aidl | 2 +- .../current/android/hardware/radio/config/SimSlotStatus.aidl | 2 +- .../current/android/hardware/radio/config/SlotPortMapping.aidl | 2 +- .../current/android/hardware/radio/data/ApnAuthType.aidl | 2 +- .../current/android/hardware/radio/data/ApnTypes.aidl | 2 +- .../current/android/hardware/radio/data/DataCallFailCause.aidl | 2 +- .../current/android/hardware/radio/data/DataProfileInfo.aidl | 2 +- .../current/android/hardware/radio/data/DataRequestReason.aidl | 2 +- .../android/hardware/radio/data/DataThrottlingAction.aidl | 2 +- .../current/android/hardware/radio/data/EpsQos.aidl | 2 +- .../current/android/hardware/radio/data/KeepaliveRequest.aidl | 2 +- .../current/android/hardware/radio/data/KeepaliveStatus.aidl | 2 +- .../current/android/hardware/radio/data/LinkAddress.aidl | 2 +- .../current/android/hardware/radio/data/NrQos.aidl | 2 +- .../current/android/hardware/radio/data/OsAppId.aidl | 2 +- .../current/android/hardware/radio/data/PcoDataInfo.aidl | 2 +- .../current/android/hardware/radio/data/PdpProtocolType.aidl | 2 +- .../current/android/hardware/radio/data/PortRange.aidl | 2 +- .../current/android/hardware/radio/data/Qos.aidl | 2 +- .../current/android/hardware/radio/data/QosBandwidth.aidl | 2 +- .../current/android/hardware/radio/data/QosFilter.aidl | 2 +- .../current/android/hardware/radio/data/QosFilterIpsecSpi.aidl | 2 +- .../android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl | 2 +- .../android/hardware/radio/data/QosFilterTypeOfService.aidl | 2 +- .../current/android/hardware/radio/data/QosSession.aidl | 2 +- .../android/hardware/radio/data/RouteSelectionDescriptor.aidl | 2 +- .../android/hardware/radio/data/SetupDataCallResult.aidl | 2 +- .../current/android/hardware/radio/data/SliceInfo.aidl | 2 +- .../current/android/hardware/radio/data/SlicingConfig.aidl | 2 +- .../current/android/hardware/radio/data/TrafficDescriptor.aidl | 2 +- .../current/android/hardware/radio/data/UrspRule.aidl | 2 +- .../hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl | 2 +- .../current/android/hardware/radio/messaging/CdmaSmsAck.aidl | 2 +- .../android/hardware/radio/messaging/CdmaSmsAddress.aidl | 2 +- .../android/hardware/radio/messaging/CdmaSmsMessage.aidl | 2 +- .../android/hardware/radio/messaging/CdmaSmsSubaddress.aidl | 2 +- .../android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl | 2 +- .../hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl | 2 +- .../current/android/hardware/radio/messaging/GsmSmsMessage.aidl | 2 +- .../current/android/hardware/radio/messaging/ImsSmsMessage.aidl | 2 +- .../current/android/hardware/radio/messaging/SendSmsResult.aidl | 2 +- .../hardware/radio/messaging/SmsAcknowledgeFailCause.aidl | 2 +- .../current/android/hardware/radio/messaging/SmsWriteArgs.aidl | 2 +- .../current/android/hardware/radio/modem/ActivityStatsInfo.aidl | 2 +- .../hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl | 2 +- .../current/android/hardware/radio/modem/DeviceStateType.aidl | 2 +- .../current/android/hardware/radio/modem/HardwareConfig.aidl | 2 +- .../android/hardware/radio/modem/HardwareConfigModem.aidl | 2 +- .../current/android/hardware/radio/modem/HardwareConfigSim.aidl | 2 +- .../current/android/hardware/radio/modem/NvItem.aidl | 2 +- .../current/android/hardware/radio/modem/NvWriteItem.aidl | 2 +- .../current/android/hardware/radio/modem/RadioCapability.aidl | 2 +- .../current/android/hardware/radio/modem/RadioState.aidl | 2 +- .../current/android/hardware/radio/modem/ResetNvType.aidl | 2 +- .../hardware/radio/network/AccessTechnologySpecificInfo.aidl | 2 +- .../current/android/hardware/radio/network/BarringInfo.aidl | 2 +- .../android/hardware/radio/network/BarringTypeSpecificInfo.aidl | 2 +- .../hardware/radio/network/Cdma2000RegistrationInfo.aidl | 2 +- .../current/android/hardware/radio/network/CdmaRoamingType.aidl | 2 +- .../android/hardware/radio/network/CdmaSignalStrength.aidl | 2 +- .../android/hardware/radio/network/CellConnectionStatus.aidl | 2 +- .../current/android/hardware/radio/network/CellIdentity.aidl | 2 +- .../android/hardware/radio/network/CellIdentityCdma.aidl | 2 +- .../current/android/hardware/radio/network/CellIdentityGsm.aidl | 2 +- .../current/android/hardware/radio/network/CellIdentityLte.aidl | 2 +- .../current/android/hardware/radio/network/CellIdentityNr.aidl | 2 +- .../android/hardware/radio/network/CellIdentityTdscdma.aidl | 2 +- .../android/hardware/radio/network/CellIdentityWcdma.aidl | 2 +- .../current/android/hardware/radio/network/CellInfo.aidl | 2 +- .../current/android/hardware/radio/network/CellInfoCdma.aidl | 2 +- .../current/android/hardware/radio/network/CellInfoGsm.aidl | 2 +- .../current/android/hardware/radio/network/CellInfoLte.aidl | 2 +- .../current/android/hardware/radio/network/CellInfoNr.aidl | 2 +- .../android/hardware/radio/network/CellInfoRatSpecificInfo.aidl | 2 +- .../current/android/hardware/radio/network/CellInfoTdscdma.aidl | 2 +- .../current/android/hardware/radio/network/CellInfoWcdma.aidl | 2 +- .../hardware/radio/network/ClosedSubscriberGroupInfo.aidl | 2 +- .../current/android/hardware/radio/network/Domain.aidl | 2 +- .../current/android/hardware/radio/network/EutranBands.aidl | 2 +- .../android/hardware/radio/network/EutranRegistrationInfo.aidl | 2 +- .../android/hardware/radio/network/EvdoSignalStrength.aidl | 2 +- .../current/android/hardware/radio/network/GeranBands.aidl | 2 +- .../android/hardware/radio/network/GsmSignalStrength.aidl | 2 +- .../android/hardware/radio/network/IndicationFilter.aidl | 2 +- .../current/android/hardware/radio/network/LceDataInfo.aidl | 2 +- .../android/hardware/radio/network/LinkCapacityEstimate.aidl | 2 +- .../android/hardware/radio/network/LteSignalStrength.aidl | 2 +- .../current/android/hardware/radio/network/LteVopsInfo.aidl | 2 +- .../android/hardware/radio/network/NetworkScanRequest.aidl | 2 +- .../android/hardware/radio/network/NetworkScanResult.aidl | 2 +- .../current/android/hardware/radio/network/NgranBands.aidl | 2 +- .../android/hardware/radio/network/NrDualConnectivityState.aidl | 2 +- .../current/android/hardware/radio/network/NrIndicators.aidl | 2 +- .../android/hardware/radio/network/NrSignalStrength.aidl | 2 +- .../current/android/hardware/radio/network/NrVopsInfo.aidl | 2 +- .../current/android/hardware/radio/network/OperatorInfo.aidl | 2 +- .../android/hardware/radio/network/PhoneRestrictedState.aidl | 2 +- .../android/hardware/radio/network/PhysicalChannelConfig.aidl | 2 +- .../hardware/radio/network/PhysicalChannelConfigBand.aidl | 2 +- .../android/hardware/radio/network/RadioAccessSpecifier.aidl | 2 +- .../hardware/radio/network/RadioAccessSpecifierBands.aidl | 2 +- .../current/android/hardware/radio/network/RadioBandMode.aidl | 2 +- .../current/android/hardware/radio/network/RegState.aidl | 2 +- .../current/android/hardware/radio/network/RegStateResult.aidl | 2 +- .../android/hardware/radio/network/RegistrationFailCause.aidl | 2 +- .../current/android/hardware/radio/network/SignalStrength.aidl | 2 +- .../android/hardware/radio/network/SignalThresholdInfo.aidl | 2 +- .../android/hardware/radio/network/SuppSvcNotification.aidl | 2 +- .../android/hardware/radio/network/TdscdmaSignalStrength.aidl | 2 +- .../current/android/hardware/radio/network/UsageSetting.aidl | 2 +- .../current/android/hardware/radio/network/UtranBands.aidl | 2 +- .../android/hardware/radio/network/WcdmaSignalStrength.aidl | 2 +- .../current/android/hardware/radio/sim/AppStatus.aidl | 2 +- .../current/android/hardware/radio/sim/CardPowerState.aidl | 2 +- .../current/android/hardware/radio/sim/CardStatus.aidl | 2 +- .../current/android/hardware/radio/sim/Carrier.aidl | 2 +- .../current/android/hardware/radio/sim/CarrierRestrictions.aidl | 2 +- .../android/hardware/radio/sim/CdmaSubscriptionSource.aidl | 2 +- .../current/android/hardware/radio/sim/IccIo.aidl | 2 +- .../current/android/hardware/radio/sim/IccIoResult.aidl | 2 +- .../current/android/hardware/radio/sim/ImsiEncryptionInfo.aidl | 2 +- .../current/android/hardware/radio/sim/PbReceivedStatus.aidl | 2 +- .../current/android/hardware/radio/sim/PersoSubstate.aidl | 2 +- .../current/android/hardware/radio/sim/PhonebookCapacity.aidl | 2 +- .../current/android/hardware/radio/sim/PhonebookRecordInfo.aidl | 2 +- .../current/android/hardware/radio/sim/PinState.aidl | 2 +- .../current/android/hardware/radio/sim/SelectUiccSub.aidl | 2 +- .../current/android/hardware/radio/sim/SimApdu.aidl | 2 +- .../android/hardware/radio/sim/SimLockMultiSimPolicy.aidl | 2 +- .../current/android/hardware/radio/sim/SimRefreshResult.aidl | 2 +- .../current/android/hardware/radio/voice/AudioQuality.aidl | 2 +- .../current/android/hardware/radio/voice/Call.aidl | 2 +- .../current/android/hardware/radio/voice/CallForwardInfo.aidl | 2 +- .../current/android/hardware/radio/voice/CdmaCallWaiting.aidl | 2 +- .../android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl | 2 +- .../android/hardware/radio/voice/CdmaInformationRecord.aidl | 2 +- .../android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl | 2 +- .../android/hardware/radio/voice/CdmaNumberInfoRecord.aidl | 2 +- .../android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl | 2 +- .../hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl | 2 +- .../android/hardware/radio/voice/CdmaSignalInfoRecord.aidl | 2 +- .../hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl | 2 +- .../android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl | 2 +- .../current/android/hardware/radio/voice/CfData.aidl | 2 +- .../current/android/hardware/radio/voice/ClipStatus.aidl | 2 +- .../current/android/hardware/radio/voice/Dial.aidl | 2 +- .../android/hardware/radio/voice/EmergencyCallRouting.aidl | 2 +- .../current/android/hardware/radio/voice/EmergencyNumber.aidl | 2 +- .../android/hardware/radio/voice/EmergencyServiceCategory.aidl | 2 +- .../current/android/hardware/radio/voice/LastCallFailCause.aidl | 2 +- .../android/hardware/radio/voice/LastCallFailCauseInfo.aidl | 2 +- .../current/android/hardware/radio/voice/SrvccState.aidl | 2 +- .../current/android/hardware/radio/voice/SsInfoData.aidl | 2 +- .../android/hardware/radio/voice/StkCcUnsolSsResult.aidl | 2 +- .../current/android/hardware/radio/voice/TtyMode.aidl | 2 +- .../current/android/hardware/radio/voice/UssdModeType.aidl | 2 +- .../current/android/hardware/radio/voice/UusInfo.aidl | 2 +- .../current/android/hardware/radio/AccessNetwork.aidl | 2 +- .../current/android/hardware/radio/RadioAccessFamily.aidl | 2 +- .../current/android/hardware/radio/RadioConst.aidl | 2 +- .../current/android/hardware/radio/RadioError.aidl | 2 +- .../current/android/hardware/radio/RadioIndicationType.aidl | 2 +- .../current/android/hardware/radio/RadioResponseInfo.aidl | 2 +- .../current/android/hardware/radio/RadioResponseInfoModem.aidl | 2 +- .../current/android/hardware/radio/RadioResponseType.aidl | 2 +- .../current/android/hardware/radio/RadioTechnology.aidl | 2 +- .../current/android/hardware/radio/RadioTechnologyFamily.aidl | 2 +- radio/aidl/android/hardware/radio/AccessNetwork.aidl | 1 + radio/aidl/android/hardware/radio/RadioAccessFamily.aidl | 1 + radio/aidl/android/hardware/radio/RadioConst.aidl | 1 + radio/aidl/android/hardware/radio/RadioError.aidl | 1 + radio/aidl/android/hardware/radio/RadioIndicationType.aidl | 1 + radio/aidl/android/hardware/radio/RadioResponseInfo.aidl | 1 + radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl | 1 + radio/aidl/android/hardware/radio/RadioResponseType.aidl | 1 + radio/aidl/android/hardware/radio/RadioTechnology.aidl | 1 + radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl | 1 + radio/aidl/android/hardware/radio/config/PhoneCapability.aidl | 1 + radio/aidl/android/hardware/radio/config/SimPortInfo.aidl | 1 + radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl | 1 + radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl | 1 + radio/aidl/android/hardware/radio/data/ApnAuthType.aidl | 1 + radio/aidl/android/hardware/radio/data/ApnTypes.aidl | 1 + radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl | 1 + radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl | 1 + radio/aidl/android/hardware/radio/data/DataRequestReason.aidl | 1 + .../aidl/android/hardware/radio/data/DataThrottlingAction.aidl | 1 + radio/aidl/android/hardware/radio/data/EpsQos.aidl | 1 + radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl | 1 + radio/aidl/android/hardware/radio/data/KeepaliveStatus.aidl | 1 + radio/aidl/android/hardware/radio/data/LinkAddress.aidl | 1 + radio/aidl/android/hardware/radio/data/NrQos.aidl | 1 + radio/aidl/android/hardware/radio/data/OsAppId.aidl | 1 + radio/aidl/android/hardware/radio/data/PcoDataInfo.aidl | 1 + radio/aidl/android/hardware/radio/data/PdpProtocolType.aidl | 1 + radio/aidl/android/hardware/radio/data/PortRange.aidl | 1 + radio/aidl/android/hardware/radio/data/Qos.aidl | 1 + radio/aidl/android/hardware/radio/data/QosBandwidth.aidl | 1 + radio/aidl/android/hardware/radio/data/QosFilter.aidl | 1 + radio/aidl/android/hardware/radio/data/QosFilterIpsecSpi.aidl | 1 + .../android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl | 1 + .../android/hardware/radio/data/QosFilterTypeOfService.aidl | 1 + radio/aidl/android/hardware/radio/data/QosSession.aidl | 1 + .../android/hardware/radio/data/RouteSelectionDescriptor.aidl | 1 + radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl | 1 + radio/aidl/android/hardware/radio/data/SliceInfo.aidl | 1 + radio/aidl/android/hardware/radio/data/SlicingConfig.aidl | 1 + radio/aidl/android/hardware/radio/data/TrafficDescriptor.aidl | 1 + radio/aidl/android/hardware/radio/data/UrspRule.aidl | 1 + .../hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl | 1 + radio/aidl/android/hardware/radio/messaging/CdmaSmsAck.aidl | 1 + radio/aidl/android/hardware/radio/messaging/CdmaSmsAddress.aidl | 1 + radio/aidl/android/hardware/radio/messaging/CdmaSmsMessage.aidl | 1 + .../android/hardware/radio/messaging/CdmaSmsSubaddress.aidl | 1 + .../aidl/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl | 1 + .../hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl | 1 + radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl | 1 + radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl | 1 + radio/aidl/android/hardware/radio/messaging/SendSmsResult.aidl | 1 + .../hardware/radio/messaging/SmsAcknowledgeFailCause.aidl | 1 + radio/aidl/android/hardware/radio/messaging/SmsWriteArgs.aidl | 1 + radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl | 1 + .../hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl | 1 + radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl | 1 + radio/aidl/android/hardware/radio/modem/HardwareConfig.aidl | 1 + .../aidl/android/hardware/radio/modem/HardwareConfigModem.aidl | 1 + radio/aidl/android/hardware/radio/modem/HardwareConfigSim.aidl | 1 + radio/aidl/android/hardware/radio/modem/NvItem.aidl | 1 + radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl | 1 + radio/aidl/android/hardware/radio/modem/RadioCapability.aidl | 1 + radio/aidl/android/hardware/radio/modem/RadioState.aidl | 1 + radio/aidl/android/hardware/radio/modem/ResetNvType.aidl | 1 + .../hardware/radio/network/AccessTechnologySpecificInfo.aidl | 1 + radio/aidl/android/hardware/radio/network/BarringInfo.aidl | 1 + .../android/hardware/radio/network/BarringTypeSpecificInfo.aidl | 1 + .../hardware/radio/network/Cdma2000RegistrationInfo.aidl | 1 + radio/aidl/android/hardware/radio/network/CdmaRoamingType.aidl | 1 + .../aidl/android/hardware/radio/network/CdmaSignalStrength.aidl | 1 + .../android/hardware/radio/network/CellConnectionStatus.aidl | 1 + radio/aidl/android/hardware/radio/network/CellIdentity.aidl | 1 + radio/aidl/android/hardware/radio/network/CellIdentityCdma.aidl | 1 + radio/aidl/android/hardware/radio/network/CellIdentityGsm.aidl | 1 + radio/aidl/android/hardware/radio/network/CellIdentityLte.aidl | 1 + radio/aidl/android/hardware/radio/network/CellIdentityNr.aidl | 1 + .../android/hardware/radio/network/CellIdentityTdscdma.aidl | 1 + .../aidl/android/hardware/radio/network/CellIdentityWcdma.aidl | 1 + radio/aidl/android/hardware/radio/network/CellInfo.aidl | 1 + radio/aidl/android/hardware/radio/network/CellInfoCdma.aidl | 1 + radio/aidl/android/hardware/radio/network/CellInfoGsm.aidl | 1 + radio/aidl/android/hardware/radio/network/CellInfoLte.aidl | 1 + radio/aidl/android/hardware/radio/network/CellInfoNr.aidl | 1 + .../android/hardware/radio/network/CellInfoRatSpecificInfo.aidl | 1 + radio/aidl/android/hardware/radio/network/CellInfoTdscdma.aidl | 1 + radio/aidl/android/hardware/radio/network/CellInfoWcdma.aidl | 1 + .../hardware/radio/network/ClosedSubscriberGroupInfo.aidl | 1 + radio/aidl/android/hardware/radio/network/Domain.aidl | 1 + radio/aidl/android/hardware/radio/network/EutranBands.aidl | 1 + .../android/hardware/radio/network/EutranRegistrationInfo.aidl | 1 + .../aidl/android/hardware/radio/network/EvdoSignalStrength.aidl | 1 + radio/aidl/android/hardware/radio/network/GeranBands.aidl | 1 + .../aidl/android/hardware/radio/network/GsmSignalStrength.aidl | 1 + radio/aidl/android/hardware/radio/network/IndicationFilter.aidl | 1 + radio/aidl/android/hardware/radio/network/LceDataInfo.aidl | 1 + .../android/hardware/radio/network/LinkCapacityEstimate.aidl | 1 + .../aidl/android/hardware/radio/network/LteSignalStrength.aidl | 1 + radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl | 1 + .../aidl/android/hardware/radio/network/NetworkScanRequest.aidl | 1 + .../aidl/android/hardware/radio/network/NetworkScanResult.aidl | 1 + radio/aidl/android/hardware/radio/network/NgranBands.aidl | 1 + .../android/hardware/radio/network/NrDualConnectivityState.aidl | 1 + radio/aidl/android/hardware/radio/network/NrIndicators.aidl | 1 + radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl | 1 + radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl | 1 + radio/aidl/android/hardware/radio/network/OperatorInfo.aidl | 1 + .../android/hardware/radio/network/PhoneRestrictedState.aidl | 1 + .../android/hardware/radio/network/PhysicalChannelConfig.aidl | 1 + .../hardware/radio/network/PhysicalChannelConfigBand.aidl | 1 + .../android/hardware/radio/network/RadioAccessSpecifier.aidl | 1 + .../hardware/radio/network/RadioAccessSpecifierBands.aidl | 1 + radio/aidl/android/hardware/radio/network/RadioBandMode.aidl | 1 + radio/aidl/android/hardware/radio/network/RegState.aidl | 1 + radio/aidl/android/hardware/radio/network/RegStateResult.aidl | 1 + .../android/hardware/radio/network/RegistrationFailCause.aidl | 1 + radio/aidl/android/hardware/radio/network/SignalStrength.aidl | 1 + .../android/hardware/radio/network/SignalThresholdInfo.aidl | 1 + .../android/hardware/radio/network/SuppSvcNotification.aidl | 1 + .../android/hardware/radio/network/TdscdmaSignalStrength.aidl | 1 + radio/aidl/android/hardware/radio/network/UsageSetting.aidl | 1 + radio/aidl/android/hardware/radio/network/UtranBands.aidl | 1 + .../android/hardware/radio/network/WcdmaSignalStrength.aidl | 1 + radio/aidl/android/hardware/radio/sim/AppStatus.aidl | 1 + radio/aidl/android/hardware/radio/sim/CardPowerState.aidl | 1 + radio/aidl/android/hardware/radio/sim/CardStatus.aidl | 1 + radio/aidl/android/hardware/radio/sim/Carrier.aidl | 1 + radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl | 1 + .../aidl/android/hardware/radio/sim/CdmaSubscriptionSource.aidl | 1 + radio/aidl/android/hardware/radio/sim/IccIo.aidl | 1 + radio/aidl/android/hardware/radio/sim/IccIoResult.aidl | 1 + radio/aidl/android/hardware/radio/sim/ImsiEncryptionInfo.aidl | 1 + radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl | 1 + radio/aidl/android/hardware/radio/sim/PersoSubstate.aidl | 1 + radio/aidl/android/hardware/radio/sim/PhonebookCapacity.aidl | 1 + radio/aidl/android/hardware/radio/sim/PhonebookRecordInfo.aidl | 1 + radio/aidl/android/hardware/radio/sim/PinState.aidl | 1 + radio/aidl/android/hardware/radio/sim/SelectUiccSub.aidl | 1 + radio/aidl/android/hardware/radio/sim/SimApdu.aidl | 1 + .../aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl | 1 + radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl | 1 + radio/aidl/android/hardware/radio/voice/AudioQuality.aidl | 1 + radio/aidl/android/hardware/radio/voice/Call.aidl | 1 + radio/aidl/android/hardware/radio/voice/CallForwardInfo.aidl | 1 + radio/aidl/android/hardware/radio/voice/CdmaCallWaiting.aidl | 1 + .../android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl | 1 + .../android/hardware/radio/voice/CdmaInformationRecord.aidl | 1 + .../android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl | 1 + .../aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl | 1 + .../android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl | 1 + .../hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl | 1 + .../aidl/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl | 1 + .../hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl | 1 + .../android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl | 1 + radio/aidl/android/hardware/radio/voice/CfData.aidl | 1 + radio/aidl/android/hardware/radio/voice/ClipStatus.aidl | 1 + radio/aidl/android/hardware/radio/voice/Dial.aidl | 1 + .../aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl | 1 + radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl | 1 + .../android/hardware/radio/voice/EmergencyServiceCategory.aidl | 1 + radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl | 1 + .../android/hardware/radio/voice/LastCallFailCauseInfo.aidl | 1 + radio/aidl/android/hardware/radio/voice/SrvccState.aidl | 1 + radio/aidl/android/hardware/radio/voice/SsInfoData.aidl | 1 + radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl | 1 + radio/aidl/android/hardware/radio/voice/TtyMode.aidl | 1 + radio/aidl/android/hardware/radio/voice/UssdModeType.aidl | 1 + radio/aidl/android/hardware/radio/voice/UusInfo.aidl | 1 + 336 files changed, 336 insertions(+), 168 deletions(-) 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 c60200ce13..db3a4c65f3 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable PhoneCapability { byte maxActiveData; byte maxActiveInternetData; 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 5cc90176ac..b5d31ada35 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SimPortInfo { String iccId; int logicalSlotId; 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 bc7f63ca9a..be4c08064a 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SimSlotStatus { int cardState; String atr; 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 f38c4213d0..31271eed8d 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SlotPortMapping { int physicalSlotId; int portId; 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 929cfe3ccf..86272c22eb 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ApnAuthType { NO_PAP_NO_CHAP = 0, PAP_NO_CHAP = 1, 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 980b042cdf..1518a5749e 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ApnTypes { NONE = 0, DEFAULT = 1, 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 6130e71a1a..d7d6983236 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum DataCallFailCause { NONE = 0, OPERATOR_BARRED = 8, 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 02bbf21ef3..16fada1d76 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable DataProfileInfo { int profileId; String apn; 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 c94fa6f604..0ddaff1662 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum DataRequestReason { NORMAL = 1, SHUTDOWN = 2, 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 c0ade454dd..4f976cd593 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@Backing(type="byte") @VintfStability +@Backing(type="byte") @JavaDerive(toString=true) @VintfStability enum DataThrottlingAction { NO_DATA_THROTTLING = 0, THROTTLE_SECONDARY_CARRIER = 1, 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 36367315d6..5b9aaa0b1e 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable EpsQos { int qci; android.hardware.radio.data.QosBandwidth downlink; 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 788adfbfde..592a54a90c 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable KeepaliveRequest { int type; byte[] sourceAddress; 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 4729b8e194..82b0fc8ec1 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable KeepaliveStatus { int sessionHandle; int code; 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 9aee44c4fc..48e646ea22 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable LinkAddress { String address; int addressProperties; 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 a8a169635e..62f6204038 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable NrQos { int fiveQi; android.hardware.radio.data.QosBandwidth downlink; 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 205b1e92bd..8595d5206d 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@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 edfa7592df..033b12f4ee 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable PcoDataInfo { int cid; String bearerProto; 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 363cdf30b9..9771e5ccc1 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PdpProtocolType { UNKNOWN = -1, IP = 0, 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 f3749ed7ac..470a9c11b3 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable PortRange { int start; int end; 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 1981721b5b..ca06e4112b 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability union Qos { boolean noinit; android.hardware.radio.data.EpsQos eps; 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 d7ebe100bd..6d4b7a9f49 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable QosBandwidth { int maxBitrateKbps; int guaranteedBitrateKbps; 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 b9098f7f88..e22b359163 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable QosFilter { String[] localAddresses; String[] remoteAddresses; 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 565e49904e..4b75340276 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability union QosFilterIpsecSpi { boolean noinit; int value; 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 16117b252b..3fb34ea375 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability union QosFilterIpv6FlowLabel { boolean noinit; int value; 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 95fda167f5..fa85b5acc3 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability union QosFilterTypeOfService { boolean noinit; byte value; 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 53dcef0131..bbfdd2d48c 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable QosSession { int qosSessionId; android.hardware.radio.data.Qos qos; 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 02596a1f63..434ee7d102 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable RouteSelectionDescriptor { byte precedence; android.hardware.radio.data.PdpProtocolType sessionType; 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 ff2459c0b2..83f9db61ac 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SetupDataCallResult { android.hardware.radio.data.DataCallFailCause cause; long suggestedRetryTime; 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 0dd8127e1d..efe48165ee 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SliceInfo { byte sliceServiceType; int sliceDifferentiator; 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 54e2f12171..b00febebaf 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SlicingConfig { android.hardware.radio.data.UrspRule[] urspRules; android.hardware.radio.data.SliceInfo[] sliceInfo; 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 d5079c1d76..d7b0654970 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable TrafficDescriptor { @nullable String dnn; @nullable android.hardware.radio.data.OsAppId osAppId; 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 c0be05426c..7002fd118c 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable UrspRule { int precedence; android.hardware.radio.data.TrafficDescriptor[] trafficDescriptors; 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 54e8a7b051..39e2be2f63 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaBroadcastSmsConfigInfo { int serviceCategory; int language; 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 0de1688f98..befdbdefb6 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaSmsAck { boolean errorClass; int smsCauseCode; 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 4a55745724..ab29c775dd 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaSmsAddress { int digitMode; boolean isNumberModeDataNetwork; 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 fdb74fb49b..867596c81b 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaSmsMessage { int teleserviceId; boolean isServicePresent; 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 deb1102f0d..d67fe8c577 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaSmsSubaddress { int subaddressType; boolean odd; 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 4969663834..b0a7f98dc6 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaSmsWriteArgs { int status; android.hardware.radio.messaging.CdmaSmsMessage message; 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 6cc7636f79..46604cabe6 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable GsmBroadcastSmsConfigInfo { int fromServiceId; int toServiceId; 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 2937d5ca79..4df7fd2508 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable GsmSmsMessage { String smscPdu; String pdu; 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 706bfddd49..85f62b781d 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable ImsSmsMessage { android.hardware.radio.RadioTechnologyFamily tech; boolean retry; 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 0fbec6fed1..32f7a5cb71 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SendSmsResult { int messageRef; String ackPDU; 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 b1f8ff8583..019b18539f 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SmsAcknowledgeFailCause { MEMORY_CAPACITY_EXCEEDED = 211, UNSPECIFIED_ERROR = 255, 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 1748b62cfc..489cc07068 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SmsWriteArgs { int status; String pdu; 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 93940fd295..7e22ee046e 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable ActivityStatsInfo { int sleepModeTimeMs; int idleModeTimeMs; 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 798ec36ffb..08ed9a529e 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable ActivityStatsTechSpecificInfo { android.hardware.radio.AccessNetwork rat; int frequencyRange; 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 0f0006d3e4..4e8c6d7545 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum DeviceStateType { POWER_SAVE_MODE = 0, CHARGING_STATE = 1, 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 7593ca7a03..3a0ec2514b 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable HardwareConfig { int type; String uuid; 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 bf7099541c..62bb160fc4 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable HardwareConfigModem { int rilModel; android.hardware.radio.RadioTechnology rat; 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 1b887c220e..5810982975 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable HardwareConfigSim { String modemUuid; } 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 bda4ab7884..3e276434ac 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 @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum NvItem { CDMA_MEID = 1, CDMA_MIN = 2, 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 58e84988e8..17b7de0a74 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 @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable NvWriteItem { android.hardware.radio.modem.NvItem itemId; String value; 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 5aaf5a7303..f2e2858590 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable RadioCapability { int session; int phase; 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 4bde770e15..57f29410c5 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioState { OFF = 0, UNAVAILABLE = 1, 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 81f225433f..e3b5796cfc 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ResetNvType { RELOAD = 0, ERASE = 1, 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 4a4a120965..28d886256d 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability union AccessTechnologySpecificInfo { boolean noinit; android.hardware.radio.network.Cdma2000RegistrationInfo cdmaInfo; 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 a96ef510c4..e105b39101 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable BarringInfo { int serviceType; int barringType; 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 c04cdb54bc..a81363339e 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable BarringTypeSpecificInfo { int factor; int timeSeconds; 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 7d9292d9b3..74c4e29d2b 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable Cdma2000RegistrationInfo { boolean cssSupported; int roamingIndicator; 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 54c431b015..24ec26b893 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CdmaRoamingType { HOME_NETWORK = 0, AFFILIATED_ROAM = 1, 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 b4aee1cdd2..e2f97bf98f 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaSignalStrength { int dbm; int ecio; 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 066cb60594..8986d719c4 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CellConnectionStatus { NONE = 0, PRIMARY_SERVING = 1, 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 1c68e8c817..2ee92dee29 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability union CellIdentity { boolean noinit; android.hardware.radio.network.CellIdentityGsm gsm; 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 8c1fdfa92a..d659a2891c 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellIdentityCdma { int networkId; int systemId; 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 2e384e96f5..d3193be072 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellIdentityGsm { String mcc; String mnc; 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 c83997e130..2ae7b43e2d 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellIdentityLte { String mcc; String mnc; 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 6bdfd99af8..b30af506d8 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellIdentityNr { String mcc; String mnc; 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 4100805d8b..e99d14771c 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellIdentityTdscdma { String mcc; String mnc; 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 907f30d0ac..12001fcd67 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellIdentityWcdma { String mcc; String mnc; 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 38e0a44e95..467c6b77cc 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellInfo { boolean registered; android.hardware.radio.network.CellConnectionStatus connectionStatus; 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 d171a4b7df..e3bf46b918 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellInfoCdma { android.hardware.radio.network.CellIdentityCdma cellIdentityCdma; android.hardware.radio.network.CdmaSignalStrength signalStrengthCdma; 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 491b6868ec..84dcd07d72 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellInfoGsm { android.hardware.radio.network.CellIdentityGsm cellIdentityGsm; android.hardware.radio.network.GsmSignalStrength signalStrengthGsm; 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 67c5a18b22..221340b06a 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellInfoLte { android.hardware.radio.network.CellIdentityLte cellIdentityLte; android.hardware.radio.network.LteSignalStrength signalStrengthLte; 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 a094600b6b..b392c1d2c7 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellInfoNr { android.hardware.radio.network.CellIdentityNr cellIdentityNr; android.hardware.radio.network.NrSignalStrength signalStrengthNr; 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 4e0719cd7f..4ab0640b29 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability union CellInfoRatSpecificInfo { android.hardware.radio.network.CellInfoGsm gsm; android.hardware.radio.network.CellInfoWcdma wcdma; 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 d4e0874914..138b35ce62 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellInfoTdscdma { android.hardware.radio.network.CellIdentityTdscdma cellIdentityTdscdma; android.hardware.radio.network.TdscdmaSignalStrength signalStrengthTdscdma; 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 da19e37952..cf7b135c63 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellInfoWcdma { android.hardware.radio.network.CellIdentityWcdma cellIdentityWcdma; android.hardware.radio.network.WcdmaSignalStrength signalStrengthWcdma; 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 5c45d93e68..fe734c8f78 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable ClosedSubscriberGroupInfo { boolean csgIndication; String homeNodebName; 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 712bbdb91e..209cf5e802 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum Domain { CS = 1, PS = 2, 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 6c94d156cc..57fac3f5d7 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EutranBands { BAND_1 = 1, BAND_2 = 2, 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 098b57e9cd..dfbf881353 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable EutranRegistrationInfo { android.hardware.radio.network.LteVopsInfo lteVopsInfo; android.hardware.radio.network.NrIndicators nrIndicators; 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 7ec1635c4d..7c567119f8 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable EvdoSignalStrength { int dbm; int ecio; 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 7cb0fd5bad..135935ff8f 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum GeranBands { BAND_T380 = 1, BAND_T410 = 2, 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 4142ae7781..2b53b39317 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable GsmSignalStrength { int signalStrength; int bitErrorRate; 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 f79ff2a8b7..d9ed68ed6d 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum IndicationFilter { NONE = 0, ALL = -1, 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 1876465e41..27b16c11fb 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable LceDataInfo { int lastHopCapacityKbps; byte confidenceLevel; 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 c34f177722..5707b8e990 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable LinkCapacityEstimate { int downlinkCapacityKbps; int uplinkCapacityKbps; 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 c7b41f1173..b5b8579305 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable LteSignalStrength { int signalStrength; int rsrp; 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 9f20b1026e..6d8dd4e83a 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable LteVopsInfo { boolean isVopsSupported; boolean isEmcBearerSupported; 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 1e657e571b..6039740167 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable NetworkScanRequest { int type; int interval; 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 3dc39406e7..4e392d0c5c 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable NetworkScanResult { int status; android.hardware.radio.RadioError error; 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 aa60cde74f..590469076a 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum NgranBands { BAND_1 = 1, BAND_2 = 2, 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 6ee526ff2b..62c2a56c8d 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="byte") @VintfStability +@Backing(type="byte") @JavaDerive(toString=true) @VintfStability enum NrDualConnectivityState { ENABLE = 1, DISABLE = 2, 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 54f9b8f75f..88429f6f38 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable NrIndicators { boolean isEndcAvailable; boolean isDcNrRestricted; 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 14b60a622c..98bbe6bd94 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable NrSignalStrength { int ssRsrp; int ssRsrq; 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 7f58ee17fa..e5a0a700ca 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable NrVopsInfo { byte vopsSupported; byte emcSupported; 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 c3658d9f91..034150e61f 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable OperatorInfo { String alphaLong; String alphaShort; 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 dff8be052e..41555f9e3d 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PhoneRestrictedState { NONE = 0, CS_EMERGENCY = 1, 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 8db6bc40da..928c6b728c 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable PhysicalChannelConfig { android.hardware.radio.network.CellConnectionStatus status; android.hardware.radio.RadioTechnology rat; 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 50af816485..efc64a6930 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability union PhysicalChannelConfigBand { boolean noinit; android.hardware.radio.network.GeranBands geranBand; 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 b412f63899..1566bb5224 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable RadioAccessSpecifier { android.hardware.radio.AccessNetwork accessNetwork; android.hardware.radio.network.RadioAccessSpecifierBands bands; 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 d44a883671..a6ac12a28a 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability union RadioAccessSpecifierBands { boolean noinit; android.hardware.radio.network.GeranBands[] geranBands; 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 7266fd5e06..e9a9f6034c 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioBandMode { BAND_MODE_UNSPECIFIED = 0, BAND_MODE_EURO = 1, 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 d10f41313d..e6e7999f6d 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RegState { NOT_REG_MT_NOT_SEARCHING_OP = 0, REG_HOME = 1, 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 eff22166b9..f0a03aea4f 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable RegStateResult { android.hardware.radio.network.RegState regState; android.hardware.radio.RadioTechnology rat; 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 75fcdf453d..e2cd44ce0c 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RegistrationFailCause { NONE = 0, IMSI_UNKNOWN_IN_HLR = 2, 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 7187116fce..1c50190947 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SignalStrength { android.hardware.radio.network.GsmSignalStrength gsm; android.hardware.radio.network.CdmaSignalStrength cdma; 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 159d9c1547..040932cf5b 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SignalThresholdInfo { int signalMeasurement; int hysteresisMs; 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 541754e3ad..b62c71bd37 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SuppSvcNotification { boolean isMT; int code; 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 a00345f16a..d74c950bde 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable TdscdmaSignalStrength { int signalStrength; int bitErrorRate; 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 7fdf8313d3..3ca16b5eaa 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum UsageSetting { VOICE_CENTRIC = 1, DATA_CENTRIC = 2, 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 87d5b8535d..8be3da28f3 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum UtranBands { BAND_1 = 1, BAND_2 = 2, 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 678ace9735..91125271d2 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable WcdmaSignalStrength { int signalStrength; int bitErrorRate; 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 89d8f9a6ee..8a41fb9d90 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable AppStatus { int appType; int appState; 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 c0026ba95c..05bc13ac45 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CardPowerState { POWER_DOWN = 0, POWER_UP = 1, 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 cf37a0d9e1..9000d43506 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CardStatus { int cardState; android.hardware.radio.sim.PinState universalPinState; 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 c7fced175f..cc56888f31 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable Carrier { String mcc; String mnc; 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 85cf86e41f..944f1ca981 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CarrierRestrictions { android.hardware.radio.sim.Carrier[] allowedCarriers; android.hardware.radio.sim.Carrier[] excludedCarriers; 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 50e768c10e..13469f3d6a 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CdmaSubscriptionSource { RUIM_SIM = 0, NV = 1, 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 3e4dcf6730..5a312dc4fd 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable IccIo { int command; int fileId; 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 58e43ebcca..6c6bde2012 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable IccIoResult { int sw1; int sw2; 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 087f399ce7..05e71cd102 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable ImsiEncryptionInfo { String mcc; String mnc; 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 61babacce2..5e96fc6f22 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@Backing(type="byte") @VintfStability +@Backing(type="byte") @JavaDerive(toString=true) @VintfStability enum PbReceivedStatus { PB_RECEIVED_OK = 1, PB_RECEIVED_ERROR = 2, 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 a09d7816c9..e33769e812 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PersoSubstate { UNKNOWN = 0, IN_PROGRESS = 1, 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 c1fa765de7..7531c9638a 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable PhonebookCapacity { int maxAdnRecords; int usedAdnRecords; 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 36bc9201e7..2e96a4bf54 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable PhonebookRecordInfo { int recordId; String name; 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 c78b92c70b..5cdc6d17d4 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PinState { UNKNOWN = 0, ENABLED_NOT_VERIFIED = 1, 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 4842fbe6df..02121e632c 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SelectUiccSub { int slot; int appIndex; 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 d8e1dde370..2201345695 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SimApdu { int sessionId; int cla; 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 6fd89d50c6..4ded3e96ec 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SimLockMultiSimPolicy { NO_MULTISIM_POLICY = 0, ONE_VALID_SIM_MUST_BE_PRESENT = 1, 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 dd3c1f2cf3..69bf4767d3 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SimRefreshResult { int type; int efId; 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 89bd2dcf5b..15669ac483 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum AudioQuality { UNSPECIFIED = 0, AMR = 1, 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 7f445314b6..10d2ee751b 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable Call { int state; int index; 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 7ef9e46387..8e7aaab565 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CallForwardInfo { int status; int reason; 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 9edf1e7e75..310f9a0fac 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaCallWaiting { String number; int numberPresentation; 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 b373aa5dc0..b6b562c028 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaDisplayInfoRecord { String alphaBuf; const int CDMA_ALPHA_INFO_BUFFER_LENGTH = 64; 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 cc4d3fa11e..24ae775479 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaInformationRecord { int name; android.hardware.radio.voice.CdmaDisplayInfoRecord[] display; 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 d7f6cd4e2c..e34b3937b4 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaLineControlInfoRecord { byte lineCtrlPolarityIncluded; byte lineCtrlToggle; 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 26a7df544d..aeb0347d67 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaNumberInfoRecord { String number; byte numberType; 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 5ea4e50546..7877fda730 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CdmaOtaProvisionStatus { SPL_UNLOCKED = 0, SPC_RETRIES_EXCEEDED = 1, 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 f0f2b04c95..b61b91b34f 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaRedirectingNumberInfoRecord { android.hardware.radio.voice.CdmaNumberInfoRecord redirectingNumber; int redirectingReason; 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 2ebb3960ba..6c7b264476 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaSignalInfoRecord { boolean isPresent; byte signalType; 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 33e2c2bd3f..438231cbad 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaT53AudioControlInfoRecord { byte upLink; byte downLink; 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 457fd18f75..1b254f56a0 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@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 744e7ae7fa..7e799c7b03 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CfData { android.hardware.radio.voice.CallForwardInfo[] cfInfo; const int NUM_SERVICE_CLASSES = 7; 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 dafc2b9d36..3fbb0d8f7f 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ClipStatus { CLIP_PROVISIONED = 0, CLIP_UNPROVISIONED = 1, 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 c9a02a91c4..2b2e7590bc 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable Dial { String address; int clir; 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 b31a661158..07f011d349 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EmergencyCallRouting { UNKNOWN = 0, EMERGENCY = 1, 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 39bcf1a20e..98df8cd625 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable EmergencyNumber { String number; String mcc; 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 34d3c40eb3..042dd6155e 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EmergencyServiceCategory { UNSPECIFIED = 0, POLICE = 1, 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 3e178405df..1740134ef0 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum LastCallFailCause { UNOBTAINABLE_NUMBER = 1, NO_ROUTE_TO_DESTINATION = 3, 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 af75a4063a..221acf7306 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable LastCallFailCauseInfo { android.hardware.radio.voice.LastCallFailCause causeCode; String vendorCause; 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 8e7e9fbdf7..864374b508 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SrvccState { HANDOVER_STARTED = 0, HANDOVER_COMPLETED = 1, 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 9517847ada..f18b404605 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SsInfoData { int[] ssInfo; const int SS_INFO_MAX = 4; 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 71ef7a77fc..50bb1fd35b 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable StkCcUnsolSsResult { int serviceType; int requestType; 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 bb0a9f1ac9..77417e8718 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum TtyMode { OFF = 0, FULL = 1, 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 9a9d723ada..ad243d2de7 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum UssdModeType { NOTIFY = 0, REQUEST = 1, 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 0198de9bb0..931376014c 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable UusInfo { int uusType; int uusDcs; 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 0327d6c19d..8ce689f501 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum AccessNetwork { UNKNOWN = 0, GERAN = 1, 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 9bb17fe2d8..ecc2a9be7c 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioAccessFamily { UNKNOWN = 1, GPRS = 2, 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 f411ca26ad..b91bf03511 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable RadioConst { const int MAX_RILDS = 3; const int MAX_UUID_LENGTH = 64; 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 3ef67bccdb..98606e588b 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioError { NONE = 0, RADIO_NOT_AVAILABLE = 1, 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 fc5d4dfc04..54ea3a4b4f 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioIndicationType { UNSOLICITED = 0, UNSOLICITED_ACK_EXP = 1, 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 08c30232f5..b2a7a062f9 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable RadioResponseInfo { android.hardware.radio.RadioResponseType type; int serial; 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 cbc4ab9759..37ed7bb230 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable RadioResponseInfoModem { android.hardware.radio.RadioResponseType type; int serial; 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 cf24183016..5cd99c43b0 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioResponseType { SOLICITED = 0, SOLICITED_ACK = 1, 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 d0ca9b5cf5..9dad0a4977 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioTechnology { UNKNOWN = 0, GPRS = 1, 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 c11cd1cac6..e6fdce269d 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,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioTechnologyFamily { THREE_GPP = 0, THREE_GPP2 = 1, diff --git a/radio/aidl/android/hardware/radio/AccessNetwork.aidl b/radio/aidl/android/hardware/radio/AccessNetwork.aidl index 10b84f4948..2885642e83 100644 --- a/radio/aidl/android/hardware/radio/AccessNetwork.aidl +++ b/radio/aidl/android/hardware/radio/AccessNetwork.aidl @@ -18,6 +18,7 @@ package android.hardware.radio; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum AccessNetwork { /** * Unknown access network diff --git a/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl b/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl index b8fbf9b6d2..6cd0a9530a 100644 --- a/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl +++ b/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.RadioTechnology; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum RadioAccessFamily { UNKNOWN = 1 << RadioTechnology.UNKNOWN, GPRS = 1 << RadioTechnology.GPRS, diff --git a/radio/aidl/android/hardware/radio/RadioConst.aidl b/radio/aidl/android/hardware/radio/RadioConst.aidl index cd03f845b3..6591ef16a2 100644 --- a/radio/aidl/android/hardware/radio/RadioConst.aidl +++ b/radio/aidl/android/hardware/radio/RadioConst.aidl @@ -17,6 +17,7 @@ package android.hardware.radio; @VintfStability +@JavaDerive(toString=true) parcelable RadioConst { const int MAX_RILDS = 3; const int MAX_UUID_LENGTH = 64; diff --git a/radio/aidl/android/hardware/radio/RadioError.aidl b/radio/aidl/android/hardware/radio/RadioError.aidl index a708d2bd9c..ae58a0eb6a 100644 --- a/radio/aidl/android/hardware/radio/RadioError.aidl +++ b/radio/aidl/android/hardware/radio/RadioError.aidl @@ -18,6 +18,7 @@ package android.hardware.radio; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum RadioError { /** * Success diff --git a/radio/aidl/android/hardware/radio/RadioIndicationType.aidl b/radio/aidl/android/hardware/radio/RadioIndicationType.aidl index aa5215f439..2dcc492a1c 100644 --- a/radio/aidl/android/hardware/radio/RadioIndicationType.aidl +++ b/radio/aidl/android/hardware/radio/RadioIndicationType.aidl @@ -18,6 +18,7 @@ package android.hardware.radio; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum RadioIndicationType { UNSOLICITED, UNSOLICITED_ACK_EXP, diff --git a/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl b/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl index d81c49c83e..f70a3fe457 100644 --- a/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl +++ b/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.RadioError; import android.hardware.radio.RadioResponseType; @VintfStability +@JavaDerive(toString=true) parcelable RadioResponseInfo { /** * Response type diff --git a/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl b/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl index 8c7b94c1a4..13abfb991f 100644 --- a/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl +++ b/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.RadioError; import android.hardware.radio.RadioResponseType; @VintfStability +@JavaDerive(toString=true) parcelable RadioResponseInfoModem { /** * Response type diff --git a/radio/aidl/android/hardware/radio/RadioResponseType.aidl b/radio/aidl/android/hardware/radio/RadioResponseType.aidl index 882c759eb1..cd4a305d4b 100644 --- a/radio/aidl/android/hardware/radio/RadioResponseType.aidl +++ b/radio/aidl/android/hardware/radio/RadioResponseType.aidl @@ -18,6 +18,7 @@ package android.hardware.radio; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum RadioResponseType { SOLICITED, SOLICITED_ACK, diff --git a/radio/aidl/android/hardware/radio/RadioTechnology.aidl b/radio/aidl/android/hardware/radio/RadioTechnology.aidl index d439866f2f..917cb16057 100644 --- a/radio/aidl/android/hardware/radio/RadioTechnology.aidl +++ b/radio/aidl/android/hardware/radio/RadioTechnology.aidl @@ -18,6 +18,7 @@ package android.hardware.radio; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum RadioTechnology { UNKNOWN, GPRS, diff --git a/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl b/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl index 37a1df238b..a2b989d18d 100644 --- a/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl +++ b/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl @@ -18,6 +18,7 @@ package android.hardware.radio; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum RadioTechnologyFamily { /** * 3GPP Technologies - GSM, WCDMA diff --git a/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl b/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl index bc55e3924b..8e4f3380cb 100644 --- a/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl +++ b/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl @@ -22,6 +22,7 @@ package android.hardware.radio.config; * SIM device to multi-SIM device. */ @VintfStability +@JavaDerive(toString=true) parcelable PhoneCapability { /** * maxActiveData defines how many logical modems can have diff --git a/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl b/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl index 54b98907bc..db247191ad 100644 --- a/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl +++ b/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.config; @VintfStability +@JavaDerive(toString=true) parcelable SimPortInfo { /** * Integrated Circuit Card IDentifier (ICCID) is unique identifier of the SIM card. File is diff --git a/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl b/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl index b5cf633d5f..748660fecc 100644 --- a/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl +++ b/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.config; import android.hardware.radio.config.SimPortInfo; @VintfStability +@JavaDerive(toString=true) parcelable SimSlotStatus { /** * Card state in the physical slot. Values are CardStatus.[STATE_ABSENT, STATE_PRESENT, diff --git a/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl b/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl index 3046d4fa9e..c78afcbc5f 100644 --- a/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl +++ b/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.config; @VintfStability +@JavaDerive(toString=true) parcelable SlotPortMapping { /** * Physical slot id is the index of the slots diff --git a/radio/aidl/android/hardware/radio/data/ApnAuthType.aidl b/radio/aidl/android/hardware/radio/data/ApnAuthType.aidl index 8209dfec02..a4116db172 100644 --- a/radio/aidl/android/hardware/radio/data/ApnAuthType.aidl +++ b/radio/aidl/android/hardware/radio/data/ApnAuthType.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.data; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum ApnAuthType { /** * PAP and CHAP is never performed. diff --git a/radio/aidl/android/hardware/radio/data/ApnTypes.aidl b/radio/aidl/android/hardware/radio/data/ApnTypes.aidl index ae103fc7e5..ed1256d744 100644 --- a/radio/aidl/android/hardware/radio/data/ApnTypes.aidl +++ b/radio/aidl/android/hardware/radio/data/ApnTypes.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.data; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum ApnTypes { /** * None diff --git a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl index 89cd8f2626..29ece76711 100644 --- a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl +++ b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.data; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum DataCallFailCause { /** * An integer cause code defined in TS 24.008 section 6.1.3.1.3 or TS 24.301 Release 8+ Annex B. diff --git a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl index 123b3edf39..ea4e751fce 100644 --- a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl +++ b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.data.PdpProtocolType; import android.hardware.radio.data.TrafficDescriptor; @VintfStability +@JavaDerive(toString=true) parcelable DataProfileInfo { const int ID_DEFAULT = 0; const int ID_TETHERED = 1; diff --git a/radio/aidl/android/hardware/radio/data/DataRequestReason.aidl b/radio/aidl/android/hardware/radio/data/DataRequestReason.aidl index 2bb5bd69b3..44b47f84ec 100644 --- a/radio/aidl/android/hardware/radio/data/DataRequestReason.aidl +++ b/radio/aidl/android/hardware/radio/data/DataRequestReason.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.data; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum DataRequestReason { /** * The reason of the data request is normal diff --git a/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl b/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl index dfa64e2b9d..e4ee444207 100644 --- a/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl +++ b/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.data; @VintfStability @Backing(type="byte") +@JavaDerive(toString=true) enum DataThrottlingAction { /* * Clear all existing data throttling. diff --git a/radio/aidl/android/hardware/radio/data/EpsQos.aidl b/radio/aidl/android/hardware/radio/data/EpsQos.aidl index 559a153e05..8965d6eb5d 100644 --- a/radio/aidl/android/hardware/radio/data/EpsQos.aidl +++ b/radio/aidl/android/hardware/radio/data/EpsQos.aidl @@ -22,6 +22,7 @@ import android.hardware.radio.data.QosBandwidth; * LTE/EPS Quality of Service parameters as per 3gpp spec 24.301 sec 9.9.4.3. */ @VintfStability +@JavaDerive(toString=true) parcelable EpsQos { /** * Quality of Service Class Identifier (QCI), see 3GPP TS 23.203 and 29.212. diff --git a/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl b/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl index 57c9f68414..c720de0547 100644 --- a/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl +++ b/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.data; @VintfStability +@JavaDerive(toString=true) parcelable KeepaliveRequest { /** * Keepalive specified by RFC 3948 Sec. 2.3 using IPv4 diff --git a/radio/aidl/android/hardware/radio/data/KeepaliveStatus.aidl b/radio/aidl/android/hardware/radio/data/KeepaliveStatus.aidl index 2df280c1ef..0b829c4a4d 100644 --- a/radio/aidl/android/hardware/radio/data/KeepaliveStatus.aidl +++ b/radio/aidl/android/hardware/radio/data/KeepaliveStatus.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.data; @VintfStability +@JavaDerive(toString=true) parcelable KeepaliveStatus { /** * Keepalive is currently active. diff --git a/radio/aidl/android/hardware/radio/data/LinkAddress.aidl b/radio/aidl/android/hardware/radio/data/LinkAddress.aidl index 599d382ddf..12a7637a59 100644 --- a/radio/aidl/android/hardware/radio/data/LinkAddress.aidl +++ b/radio/aidl/android/hardware/radio/data/LinkAddress.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.data; * Describes a data link address for mobile data connection. */ @VintfStability +@JavaDerive(toString=true) parcelable LinkAddress { const int ADDRESS_PROPERTY_NONE = 0; /** diff --git a/radio/aidl/android/hardware/radio/data/NrQos.aidl b/radio/aidl/android/hardware/radio/data/NrQos.aidl index 1d69b4fc53..af8ab833ff 100644 --- a/radio/aidl/android/hardware/radio/data/NrQos.aidl +++ b/radio/aidl/android/hardware/radio/data/NrQos.aidl @@ -22,6 +22,7 @@ import android.hardware.radio.data.QosBandwidth; * 5G Quality of Service parameters as per 3gpp spec 24.501 sec 9.11.4.12 */ @VintfStability +@JavaDerive(toString=true) parcelable NrQos { const byte FLOW_ID_RANGE_MIN = 1; const byte FLOW_ID_RANGE_MAX = 63; diff --git a/radio/aidl/android/hardware/radio/data/OsAppId.aidl b/radio/aidl/android/hardware/radio/data/OsAppId.aidl index 0bf6d7eb53..88e7832af0 100644 --- a/radio/aidl/android/hardware/radio/data/OsAppId.aidl +++ b/radio/aidl/android/hardware/radio/data/OsAppId.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.data; * This struct represents the OsId + OsAppId as defined in TS 24.526 Section 5.2 */ @VintfStability +@JavaDerive(toString=true) parcelable OsAppId { /** * Byte array representing OsId + OsAppId. The minimum length of the array is 18 and maximum diff --git a/radio/aidl/android/hardware/radio/data/PcoDataInfo.aidl b/radio/aidl/android/hardware/radio/data/PcoDataInfo.aidl index 958761436f..38a821fb85 100644 --- a/radio/aidl/android/hardware/radio/data/PcoDataInfo.aidl +++ b/radio/aidl/android/hardware/radio/data/PcoDataInfo.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.data; @VintfStability +@JavaDerive(toString=true) parcelable PcoDataInfo { /** * Context ID, uniquely identifies this call diff --git a/radio/aidl/android/hardware/radio/data/PdpProtocolType.aidl b/radio/aidl/android/hardware/radio/data/PdpProtocolType.aidl index 9b1136c128..792a503a7d 100644 --- a/radio/aidl/android/hardware/radio/data/PdpProtocolType.aidl +++ b/radio/aidl/android/hardware/radio/data/PdpProtocolType.aidl @@ -21,6 +21,7 @@ package android.hardware.radio.data; */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum PdpProtocolType { /** * Unknown protocol diff --git a/radio/aidl/android/hardware/radio/data/PortRange.aidl b/radio/aidl/android/hardware/radio/data/PortRange.aidl index b1f88e60e1..5c83ca4e64 100644 --- a/radio/aidl/android/hardware/radio/data/PortRange.aidl +++ b/radio/aidl/android/hardware/radio/data/PortRange.aidl @@ -22,6 +22,7 @@ package android.hardware.radio.data; * be represented by the same start and end value. */ @VintfStability +@JavaDerive(toString=true) parcelable PortRange { const int PORT_RANGE_MIN = 20; const int PORT_RANGE_MAX = 65535; diff --git a/radio/aidl/android/hardware/radio/data/Qos.aidl b/radio/aidl/android/hardware/radio/data/Qos.aidl index 3d458de5dc..d9ab9e70b9 100644 --- a/radio/aidl/android/hardware/radio/data/Qos.aidl +++ b/radio/aidl/android/hardware/radio/data/Qos.aidl @@ -23,6 +23,7 @@ import android.hardware.radio.data.NrQos; * EPS or NR QOS parameters */ @VintfStability +@JavaDerive(toString=true) union Qos { boolean noinit; EpsQos eps; diff --git a/radio/aidl/android/hardware/radio/data/QosBandwidth.aidl b/radio/aidl/android/hardware/radio/data/QosBandwidth.aidl index a21003af2d..e841548089 100644 --- a/radio/aidl/android/hardware/radio/data/QosBandwidth.aidl +++ b/radio/aidl/android/hardware/radio/data/QosBandwidth.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.data; @VintfStability +@JavaDerive(toString=true) parcelable QosBandwidth { /** * Maximum bit rate possible on the bearer diff --git a/radio/aidl/android/hardware/radio/data/QosFilter.aidl b/radio/aidl/android/hardware/radio/data/QosFilter.aidl index 626f2b4614..f5dc7ec9c6 100644 --- a/radio/aidl/android/hardware/radio/data/QosFilter.aidl +++ b/radio/aidl/android/hardware/radio/data/QosFilter.aidl @@ -25,6 +25,7 @@ import android.hardware.radio.data.QosFilterTypeOfService; * See 3gpp 24.008 10.5.6.12 and 3gpp 24.501 9.11.4.13 */ @VintfStability +@JavaDerive(toString=true) parcelable QosFilter { const byte DIRECTION_DOWNLINK = 0; const byte DIRECTION_UPLINK = 1; diff --git a/radio/aidl/android/hardware/radio/data/QosFilterIpsecSpi.aidl b/radio/aidl/android/hardware/radio/data/QosFilterIpsecSpi.aidl index fd7efb1c75..5059c28c17 100644 --- a/radio/aidl/android/hardware/radio/data/QosFilterIpsecSpi.aidl +++ b/radio/aidl/android/hardware/radio/data/QosFilterIpsecSpi.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.data; @VintfStability +@JavaDerive(toString=true) union QosFilterIpsecSpi { boolean noinit; int value; diff --git a/radio/aidl/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl b/radio/aidl/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl index d6ce84b353..6f149348c4 100644 --- a/radio/aidl/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl +++ b/radio/aidl/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.data; @VintfStability +@JavaDerive(toString=true) union QosFilterIpv6FlowLabel { boolean noinit; int value; diff --git a/radio/aidl/android/hardware/radio/data/QosFilterTypeOfService.aidl b/radio/aidl/android/hardware/radio/data/QosFilterTypeOfService.aidl index c50c5b6f20..f5770a42ae 100644 --- a/radio/aidl/android/hardware/radio/data/QosFilterTypeOfService.aidl +++ b/radio/aidl/android/hardware/radio/data/QosFilterTypeOfService.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.data; @VintfStability +@JavaDerive(toString=true) union QosFilterTypeOfService { boolean noinit; byte value; diff --git a/radio/aidl/android/hardware/radio/data/QosSession.aidl b/radio/aidl/android/hardware/radio/data/QosSession.aidl index 389c3491e5..770b124fe1 100644 --- a/radio/aidl/android/hardware/radio/data/QosSession.aidl +++ b/radio/aidl/android/hardware/radio/data/QosSession.aidl @@ -23,6 +23,7 @@ import android.hardware.radio.data.QosFilter; * QOS session associated with a dedicated bearer */ @VintfStability +@JavaDerive(toString=true) parcelable QosSession { /** * Unique ID of the QoS session within the data call diff --git a/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl b/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl index d9d602e5df..14b0ffcb34 100644 --- a/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl +++ b/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl @@ -23,6 +23,7 @@ import android.hardware.radio.data.SliceInfo; * This struct represents a single route selection descriptor as defined in 3GPP TS 24.526. */ @VintfStability +@JavaDerive(toString=true) parcelable RouteSelectionDescriptor { const byte SSC_MODE_UNKNOWN = -1; const byte SSC_MODE_1 = 1; diff --git a/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl b/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl index ebfc55d260..fee54aceaa 100644 --- a/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl +++ b/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl @@ -25,6 +25,7 @@ import android.hardware.radio.data.SliceInfo; import android.hardware.radio.data.TrafficDescriptor; @VintfStability +@JavaDerive(toString=true) parcelable SetupDataCallResult { /** * Indicates the data connection is inactive. diff --git a/radio/aidl/android/hardware/radio/data/SliceInfo.aidl b/radio/aidl/android/hardware/radio/data/SliceInfo.aidl index 0943031dfd..7ad7fc36a4 100644 --- a/radio/aidl/android/hardware/radio/data/SliceInfo.aidl +++ b/radio/aidl/android/hardware/radio/data/SliceInfo.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.data; * This struct represents a S-NSSAI as defined in 3GPP TS 24.501. */ @VintfStability +@JavaDerive(toString=true) parcelable SliceInfo { /* * Not specified diff --git a/radio/aidl/android/hardware/radio/data/SlicingConfig.aidl b/radio/aidl/android/hardware/radio/data/SlicingConfig.aidl index eea2d4982f..e94b58c257 100644 --- a/radio/aidl/android/hardware/radio/data/SlicingConfig.aidl +++ b/radio/aidl/android/hardware/radio/data/SlicingConfig.aidl @@ -23,6 +23,7 @@ import android.hardware.radio.data.UrspRule; * This struct represents the current slicing configuration. */ @VintfStability +@JavaDerive(toString=true) parcelable SlicingConfig { /** * This vector contains the current URSP rules. Empty vector indicates no rules are configured. diff --git a/radio/aidl/android/hardware/radio/data/TrafficDescriptor.aidl b/radio/aidl/android/hardware/radio/data/TrafficDescriptor.aidl index e6ea27c749..2c117a5de2 100644 --- a/radio/aidl/android/hardware/radio/data/TrafficDescriptor.aidl +++ b/radio/aidl/android/hardware/radio/data/TrafficDescriptor.aidl @@ -24,6 +24,7 @@ import android.hardware.radio.data.OsAppId; * TS 24.526 Section 5.2. */ @VintfStability +@JavaDerive(toString=true) parcelable TrafficDescriptor { /** * DNN stands for Data Network Name and represents an APN as defined in 3GPP TS 23.003. diff --git a/radio/aidl/android/hardware/radio/data/UrspRule.aidl b/radio/aidl/android/hardware/radio/data/UrspRule.aidl index de85be5662..0499edd1e2 100644 --- a/radio/aidl/android/hardware/radio/data/UrspRule.aidl +++ b/radio/aidl/android/hardware/radio/data/UrspRule.aidl @@ -23,6 +23,7 @@ import android.hardware.radio.data.TrafficDescriptor; * This struct represents a single URSP rule as defined in 3GPP TS 24.526. */ @VintfStability +@JavaDerive(toString=true) parcelable UrspRule { /** * Precedence value in the range of 0 to 255. Higher value has lower precedence. diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl index 3d715e2934..4173f156a2 100644 --- a/radio/aidl/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl +++ b/radio/aidl/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.messaging; @VintfStability +@JavaDerive(toString=true) parcelable CdmaBroadcastSmsConfigInfo { /** * Defines a broadcast message identifier whose value is 0x0000 - 0xFFFF as defined in diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsAck.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsAck.aidl index 25871c8bb1..85ef692a86 100644 --- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsAck.aidl +++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsAck.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.messaging; @VintfStability +@JavaDerive(toString=true) parcelable CdmaSmsAck { boolean errorClass; /** diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsAddress.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsAddress.aidl index 835dda5be2..8e521df0c1 100644 --- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsAddress.aidl +++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsAddress.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.messaging; @VintfStability +@JavaDerive(toString=true) parcelable CdmaSmsAddress { /** * DTMF digits diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsMessage.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsMessage.aidl index f1f065f0ee..d4fb26f411 100644 --- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsMessage.aidl +++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsMessage.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.messaging.CdmaSmsAddress; import android.hardware.radio.messaging.CdmaSmsSubaddress; @VintfStability +@JavaDerive(toString=true) parcelable CdmaSmsMessage { int teleserviceId; boolean isServicePresent; diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl index 9dfe503369..18e5837085 100644 --- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl +++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.messaging; @VintfStability +@JavaDerive(toString=true) parcelable CdmaSmsSubaddress { /** * CCITT X.213 or ISO 8348 AD2 diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl index e73a0d791f..41919857dc 100644 --- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl +++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.messaging; import android.hardware.radio.messaging.CdmaSmsMessage; @VintfStability +@JavaDerive(toString=true) parcelable CdmaSmsWriteArgs { const int STATUS_REC_UNREAD = 0; const int STATUS_REC_READ = 1; diff --git a/radio/aidl/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl b/radio/aidl/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl index 2a52f0a56e..5138c3c0d3 100644 --- a/radio/aidl/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl +++ b/radio/aidl/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.messaging; * Which types of Cell Broadcast Message (CBM) are to be received by the ME */ @VintfStability +@JavaDerive(toString=true) parcelable GsmBroadcastSmsConfigInfo { /** * Beginning of the range of CBM message identifiers whose value is 0x0000 - 0xFFFF as defined diff --git a/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl b/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl index 45c09afac7..ee62d957f4 100644 --- a/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl +++ b/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.messaging; @VintfStability +@JavaDerive(toString=true) parcelable GsmSmsMessage { /** * SMSC address in GSM BCD format prefixed by a length byte (as expected by TS 27.005) diff --git a/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl b/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl index 809cfb38bd..d4be04460d 100644 --- a/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl +++ b/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.messaging.CdmaSmsMessage; import android.hardware.radio.messaging.GsmSmsMessage; @VintfStability +@JavaDerive(toString=true) parcelable ImsSmsMessage { RadioTechnologyFamily tech; /** diff --git a/radio/aidl/android/hardware/radio/messaging/SendSmsResult.aidl b/radio/aidl/android/hardware/radio/messaging/SendSmsResult.aidl index 15d68f14a0..80e059c5fb 100644 --- a/radio/aidl/android/hardware/radio/messaging/SendSmsResult.aidl +++ b/radio/aidl/android/hardware/radio/messaging/SendSmsResult.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.messaging; @VintfStability +@JavaDerive(toString=true) parcelable SendSmsResult { /** * TP-Message-Reference for GSM, and BearerData MessageId for CDMA. diff --git a/radio/aidl/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl b/radio/aidl/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl index a47cdb61c8..eb15bf1129 100644 --- a/radio/aidl/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl +++ b/radio/aidl/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.messaging; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum SmsAcknowledgeFailCause { MEMORY_CAPACITY_EXCEEDED = 0xD3, UNSPECIFIED_ERROR = 0XFF, diff --git a/radio/aidl/android/hardware/radio/messaging/SmsWriteArgs.aidl b/radio/aidl/android/hardware/radio/messaging/SmsWriteArgs.aidl index 539f68bf67..6eef9417d7 100644 --- a/radio/aidl/android/hardware/radio/messaging/SmsWriteArgs.aidl +++ b/radio/aidl/android/hardware/radio/messaging/SmsWriteArgs.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.messaging; @VintfStability +@JavaDerive(toString=true) parcelable SmsWriteArgs { const int STATUS_REC_UNREAD = 0; const int STATUS_REC_READ = 1; diff --git a/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl b/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl index d0aa695c28..b2a56d470d 100644 --- a/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl +++ b/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.modem; import android.hardware.radio.modem.ActivityStatsTechSpecificInfo; @VintfStability +@JavaDerive(toString=true) parcelable ActivityStatsInfo { /** * Total time (in ms) when modem is in a low power or sleep state diff --git a/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl b/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl index fb14223963..fcc2df20e9 100644 --- a/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl +++ b/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.modem; import android.hardware.radio.AccessNetwork; @VintfStability +@JavaDerive(toString=true) parcelable ActivityStatsTechSpecificInfo { /** Indicates the frequency range is unknown. */ const int FREQUENCY_RANGE_UNKNOWN = 0; diff --git a/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl b/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl index 0dae351c41..ad0d59cdf7 100644 --- a/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl +++ b/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.modem; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum DeviceStateType { /** * Device power save mode (provided by PowerManager). True indicates the device is in diff --git a/radio/aidl/android/hardware/radio/modem/HardwareConfig.aidl b/radio/aidl/android/hardware/radio/modem/HardwareConfig.aidl index c38df5e859..8eb1f2d1a9 100644 --- a/radio/aidl/android/hardware/radio/modem/HardwareConfig.aidl +++ b/radio/aidl/android/hardware/radio/modem/HardwareConfig.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.modem.HardwareConfigModem; import android.hardware.radio.modem.HardwareConfigSim; @VintfStability +@JavaDerive(toString=true) parcelable HardwareConfig { const int STATE_ENABLED = 0; const int STATE_STANDBY = 1; diff --git a/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl b/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl index 0b7343b3d6..f5e2c278e4 100644 --- a/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl +++ b/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.modem; import android.hardware.radio.RadioTechnology; @VintfStability +@JavaDerive(toString=true) parcelable HardwareConfigModem { /** * RIL attachment model. Values are: diff --git a/radio/aidl/android/hardware/radio/modem/HardwareConfigSim.aidl b/radio/aidl/android/hardware/radio/modem/HardwareConfigSim.aidl index 0f0c05fe6f..c82bc6e444 100644 --- a/radio/aidl/android/hardware/radio/modem/HardwareConfigSim.aidl +++ b/radio/aidl/android/hardware/radio/modem/HardwareConfigSim.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.modem; @VintfStability +@JavaDerive(toString=true) parcelable HardwareConfigSim { /** * RadioConst:MAX_UUID_LENGTH is max length of the string diff --git a/radio/aidl/android/hardware/radio/modem/NvItem.aidl b/radio/aidl/android/hardware/radio/modem/NvItem.aidl index cdae1c8b05..649b0d2db6 100644 --- a/radio/aidl/android/hardware/radio/modem/NvItem.aidl +++ b/radio/aidl/android/hardware/radio/modem/NvItem.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.modem; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum NvItem { /** * CDMA radio and account information (items 1-10) diff --git a/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl b/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl index d66c2cdcd6..47fb4904ef 100644 --- a/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl +++ b/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.modem; import android.hardware.radio.modem.NvItem; @VintfStability +@JavaDerive(toString=true) parcelable NvWriteItem { NvItem itemId; String value; diff --git a/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl b/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl index 96b9d0de48..16cba09248 100644 --- a/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl +++ b/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.modem; @VintfStability +@JavaDerive(toString=true) parcelable RadioCapability { /** * Logical Modem's (LM) initial value and value after PHASE_FINISH completes. diff --git a/radio/aidl/android/hardware/radio/modem/RadioState.aidl b/radio/aidl/android/hardware/radio/modem/RadioState.aidl index b9826a4b36..dedad25483 100644 --- a/radio/aidl/android/hardware/radio/modem/RadioState.aidl +++ b/radio/aidl/android/hardware/radio/modem/RadioState.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.modem; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum RadioState { /** * Radio explicitly powered off (eg CFUN=0) diff --git a/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl b/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl index a1411c9290..16487f8391 100644 --- a/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl +++ b/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.modem; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum ResetNvType { /** * Reload all NV items diff --git a/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl b/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl index dfd62a7b8e..8b95ced7e8 100644 --- a/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.network.EutranRegistrationInfo; import android.hardware.radio.network.NrVopsInfo; @VintfStability +@JavaDerive(toString=true) union AccessTechnologySpecificInfo { boolean noinit; Cdma2000RegistrationInfo cdmaInfo; diff --git a/radio/aidl/android/hardware/radio/network/BarringInfo.aidl b/radio/aidl/android/hardware/radio/network/BarringInfo.aidl index da49ba51f3..2759406689 100644 --- a/radio/aidl/android/hardware/radio/network/BarringInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/BarringInfo.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.BarringTypeSpecificInfo; @VintfStability +@JavaDerive(toString=true) parcelable BarringInfo { /** * Device is not barred for the given service diff --git a/radio/aidl/android/hardware/radio/network/BarringTypeSpecificInfo.aidl b/radio/aidl/android/hardware/radio/network/BarringTypeSpecificInfo.aidl index 3899711420..3db3bf36a5 100644 --- a/radio/aidl/android/hardware/radio/network/BarringTypeSpecificInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/BarringTypeSpecificInfo.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.network; @VintfStability +@JavaDerive(toString=true) parcelable BarringTypeSpecificInfo { /** * The barring factor as a percentage 0-100 diff --git a/radio/aidl/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl b/radio/aidl/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl index 6ea6cf92dc..b06fabb542 100644 --- a/radio/aidl/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.network; @VintfStability +@JavaDerive(toString=true) parcelable Cdma2000RegistrationInfo { const int PRL_INDICATOR_NOT_REGISTERED = -1; const int PRL_INDICATOR_NOT_IN_PRL = 0; diff --git a/radio/aidl/android/hardware/radio/network/CdmaRoamingType.aidl b/radio/aidl/android/hardware/radio/network/CdmaRoamingType.aidl index 3da8c98346..2fea519a2a 100644 --- a/radio/aidl/android/hardware/radio/network/CdmaRoamingType.aidl +++ b/radio/aidl/android/hardware/radio/network/CdmaRoamingType.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum CdmaRoamingType { HOME_NETWORK, AFFILIATED_ROAM, diff --git a/radio/aidl/android/hardware/radio/network/CdmaSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/CdmaSignalStrength.aidl index c7754f2ac7..1286f67fc9 100644 --- a/radio/aidl/android/hardware/radio/network/CdmaSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/CdmaSignalStrength.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.network; @VintfStability +@JavaDerive(toString=true) parcelable CdmaSignalStrength { /** * This value is the actual RSSI value multiplied by -1. Example: If the actual RSSI is -75, diff --git a/radio/aidl/android/hardware/radio/network/CellConnectionStatus.aidl b/radio/aidl/android/hardware/radio/network/CellConnectionStatus.aidl index d9f5766d76..da36ff06f0 100644 --- a/radio/aidl/android/hardware/radio/network/CellConnectionStatus.aidl +++ b/radio/aidl/android/hardware/radio/network/CellConnectionStatus.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum CellConnectionStatus { /** * Cell is not a serving cell. diff --git a/radio/aidl/android/hardware/radio/network/CellIdentity.aidl b/radio/aidl/android/hardware/radio/network/CellIdentity.aidl index af6d38e34f..e34866b2f4 100644 --- a/radio/aidl/android/hardware/radio/network/CellIdentity.aidl +++ b/radio/aidl/android/hardware/radio/network/CellIdentity.aidl @@ -27,6 +27,7 @@ import android.hardware.radio.network.CellIdentityWcdma; * A union representing the CellIdentity of a single cell. */ @VintfStability +@JavaDerive(toString=true) union CellIdentity { boolean noinit; CellIdentityGsm gsm; diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityCdma.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityCdma.aidl index ae6fda4177..5bb26c1c94 100644 --- a/radio/aidl/android/hardware/radio/network/CellIdentityCdma.aidl +++ b/radio/aidl/android/hardware/radio/network/CellIdentityCdma.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.OperatorInfo; @VintfStability +@JavaDerive(toString=true) parcelable CellIdentityCdma { /** * Network Id 0..65535, INT_MAX if unknown diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityGsm.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityGsm.aidl index 75a96e86aa..60f42b652d 100644 --- a/radio/aidl/android/hardware/radio/network/CellIdentityGsm.aidl +++ b/radio/aidl/android/hardware/radio/network/CellIdentityGsm.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.OperatorInfo; @VintfStability +@JavaDerive(toString=true) parcelable CellIdentityGsm { /** * 3-digit Mobile Country Code, 0..999, empty string if unknown diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityLte.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityLte.aidl index ae52cf2627..bfa58acf05 100644 --- a/radio/aidl/android/hardware/radio/network/CellIdentityLte.aidl +++ b/radio/aidl/android/hardware/radio/network/CellIdentityLte.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.network.EutranBands; import android.hardware.radio.network.OperatorInfo; @VintfStability +@JavaDerive(toString=true) parcelable CellIdentityLte { /** * 3-digit Mobile Country Code, 0..999, empty string if unknown diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityNr.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityNr.aidl index 73a56ea931..d51a18ec90 100644 --- a/radio/aidl/android/hardware/radio/network/CellIdentityNr.aidl +++ b/radio/aidl/android/hardware/radio/network/CellIdentityNr.aidl @@ -24,6 +24,7 @@ import android.hardware.radio.network.OperatorInfo; * broadcast in SIB1 CellAccessRelatedInfo as per 3GPP TS 38.331 Section 6.3.2. */ @VintfStability +@JavaDerive(toString=true) parcelable CellIdentityNr { /** * 3-digit Mobile Country Code, in range[0, 999]; This value must be valid for registered or diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityTdscdma.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityTdscdma.aidl index 5b00df1177..f6e790f64f 100644 --- a/radio/aidl/android/hardware/radio/network/CellIdentityTdscdma.aidl +++ b/radio/aidl/android/hardware/radio/network/CellIdentityTdscdma.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.network.ClosedSubscriberGroupInfo; import android.hardware.radio.network.OperatorInfo; @VintfStability +@JavaDerive(toString=true) parcelable CellIdentityTdscdma { /** * 3-digit Mobile Country Code, 0..999, empty string if unknown. diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityWcdma.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityWcdma.aidl index bf4d6cbdb7..a76509b3dc 100644 --- a/radio/aidl/android/hardware/radio/network/CellIdentityWcdma.aidl +++ b/radio/aidl/android/hardware/radio/network/CellIdentityWcdma.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.network.ClosedSubscriberGroupInfo; import android.hardware.radio.network.OperatorInfo; @VintfStability +@JavaDerive(toString=true) parcelable CellIdentityWcdma { /** * 3-digit Mobile Country Code, 0..999, empty string if unknown. diff --git a/radio/aidl/android/hardware/radio/network/CellInfo.aidl b/radio/aidl/android/hardware/radio/network/CellInfo.aidl index 58cf9f5838..161ac718a6 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfo.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.network.CellConnectionStatus; import android.hardware.radio.network.CellInfoRatSpecificInfo; @VintfStability +@JavaDerive(toString=true) parcelable CellInfo { /** * True if this cell is registered false if not registered. diff --git a/radio/aidl/android/hardware/radio/network/CellInfoCdma.aidl b/radio/aidl/android/hardware/radio/network/CellInfoCdma.aidl index 6d9291827a..5408104209 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfoCdma.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfoCdma.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.network.CellIdentityCdma; import android.hardware.radio.network.EvdoSignalStrength; @VintfStability +@JavaDerive(toString=true) parcelable CellInfoCdma { CellIdentityCdma cellIdentityCdma; CdmaSignalStrength signalStrengthCdma; diff --git a/radio/aidl/android/hardware/radio/network/CellInfoGsm.aidl b/radio/aidl/android/hardware/radio/network/CellInfoGsm.aidl index fc85248590..cadcd913d0 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfoGsm.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfoGsm.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.network.CellIdentityGsm; import android.hardware.radio.network.GsmSignalStrength; @VintfStability +@JavaDerive(toString=true) parcelable CellInfoGsm { CellIdentityGsm cellIdentityGsm; GsmSignalStrength signalStrengthGsm; diff --git a/radio/aidl/android/hardware/radio/network/CellInfoLte.aidl b/radio/aidl/android/hardware/radio/network/CellInfoLte.aidl index 22db722c99..443a6689a7 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfoLte.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfoLte.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.network.CellIdentityLte; import android.hardware.radio.network.LteSignalStrength; @VintfStability +@JavaDerive(toString=true) parcelable CellInfoLte { CellIdentityLte cellIdentityLte; LteSignalStrength signalStrengthLte; diff --git a/radio/aidl/android/hardware/radio/network/CellInfoNr.aidl b/radio/aidl/android/hardware/radio/network/CellInfoNr.aidl index fbf026ec32..6b3d4f4ec9 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfoNr.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfoNr.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.network.CellIdentityNr; import android.hardware.radio.network.NrSignalStrength; @VintfStability +@JavaDerive(toString=true) parcelable CellInfoNr { CellIdentityNr cellIdentityNr; NrSignalStrength signalStrengthNr; diff --git a/radio/aidl/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl b/radio/aidl/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl index 7e8a437873..76e92a4b3e 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl @@ -24,6 +24,7 @@ import android.hardware.radio.network.CellInfoTdscdma; import android.hardware.radio.network.CellInfoWcdma; @VintfStability +@JavaDerive(toString=true) union CellInfoRatSpecificInfo { /** * 3gpp CellInfo types. diff --git a/radio/aidl/android/hardware/radio/network/CellInfoTdscdma.aidl b/radio/aidl/android/hardware/radio/network/CellInfoTdscdma.aidl index e07e721c7d..fb9c984b47 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfoTdscdma.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfoTdscdma.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.network.CellIdentityTdscdma; import android.hardware.radio.network.TdscdmaSignalStrength; @VintfStability +@JavaDerive(toString=true) parcelable CellInfoTdscdma { CellIdentityTdscdma cellIdentityTdscdma; TdscdmaSignalStrength signalStrengthTdscdma; diff --git a/radio/aidl/android/hardware/radio/network/CellInfoWcdma.aidl b/radio/aidl/android/hardware/radio/network/CellInfoWcdma.aidl index 38b6903109..2d6a2e55d9 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfoWcdma.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfoWcdma.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.network.CellIdentityWcdma; import android.hardware.radio.network.WcdmaSignalStrength; @VintfStability +@JavaDerive(toString=true) parcelable CellInfoWcdma { CellIdentityWcdma cellIdentityWcdma; WcdmaSignalStrength signalStrengthWcdma; diff --git a/radio/aidl/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl b/radio/aidl/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl index b5b4add416..a2d82d76cf 100644 --- a/radio/aidl/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.network; @VintfStability +@JavaDerive(toString=true) parcelable ClosedSubscriberGroupInfo { /** * Indicates whether the cell is restricted to only CSG members. A cell not broadcasting the diff --git a/radio/aidl/android/hardware/radio/network/Domain.aidl b/radio/aidl/android/hardware/radio/network/Domain.aidl index b62f0eeb72..be5f3204a1 100644 --- a/radio/aidl/android/hardware/radio/network/Domain.aidl +++ b/radio/aidl/android/hardware/radio/network/Domain.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum Domain { /** * Circuit-switched diff --git a/radio/aidl/android/hardware/radio/network/EutranBands.aidl b/radio/aidl/android/hardware/radio/network/EutranBands.aidl index 48ee26e179..72e76e3eff 100644 --- a/radio/aidl/android/hardware/radio/network/EutranBands.aidl +++ b/radio/aidl/android/hardware/radio/network/EutranBands.aidl @@ -21,6 +21,7 @@ package android.hardware.radio.network; */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum EutranBands { BAND_1 = 1, BAND_2 = 2, diff --git a/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl b/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl index 5e19c56690..c9563ace60 100644 --- a/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.network.LteVopsInfo; import android.hardware.radio.network.NrIndicators; @VintfStability +@JavaDerive(toString=true) parcelable EutranRegistrationInfo { /** * Network capabilities for voice over PS services. This info is valid only on LTE network and diff --git a/radio/aidl/android/hardware/radio/network/EvdoSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/EvdoSignalStrength.aidl index 0ab8b59024..c3b3898b1f 100644 --- a/radio/aidl/android/hardware/radio/network/EvdoSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/EvdoSignalStrength.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.network; @VintfStability +@JavaDerive(toString=true) parcelable EvdoSignalStrength { /** * This value is the actual RSSI value multiplied by -1. Example: If the actual RSSI is -75, diff --git a/radio/aidl/android/hardware/radio/network/GeranBands.aidl b/radio/aidl/android/hardware/radio/network/GeranBands.aidl index 573d77146b..0e5b7b20a4 100644 --- a/radio/aidl/android/hardware/radio/network/GeranBands.aidl +++ b/radio/aidl/android/hardware/radio/network/GeranBands.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum GeranBands { BAND_T380 = 1, BAND_T410 = 2, diff --git a/radio/aidl/android/hardware/radio/network/GsmSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/GsmSignalStrength.aidl index 539e1cec87..796f80fde1 100644 --- a/radio/aidl/android/hardware/radio/network/GsmSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/GsmSignalStrength.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.network; @VintfStability +@JavaDerive(toString=true) parcelable GsmSignalStrength { /** * Valid values are (0-61, 99) as defined in TS 27.007 8.69; INT_MAX means invalid/unreported. diff --git a/radio/aidl/android/hardware/radio/network/IndicationFilter.aidl b/radio/aidl/android/hardware/radio/network/IndicationFilter.aidl index ac482277c0..9cab28d1e3 100644 --- a/radio/aidl/android/hardware/radio/network/IndicationFilter.aidl +++ b/radio/aidl/android/hardware/radio/network/IndicationFilter.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum IndicationFilter { NONE = 0, ALL = ~0, diff --git a/radio/aidl/android/hardware/radio/network/LceDataInfo.aidl b/radio/aidl/android/hardware/radio/network/LceDataInfo.aidl index 344227e570..fdbdc2b455 100644 --- a/radio/aidl/android/hardware/radio/network/LceDataInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/LceDataInfo.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.network; @VintfStability +@JavaDerive(toString=true) parcelable LceDataInfo { /** * Last-hop cellular capacity: kilobits/second. diff --git a/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl b/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl index 8d31bbc240..6461719cc1 100644 --- a/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl +++ b/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.network; @VintfStability +@JavaDerive(toString=true) parcelable LinkCapacityEstimate { /** * Estimated downlink capacity in kbps. In case of a dual connected network, this includes diff --git a/radio/aidl/android/hardware/radio/network/LteSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/LteSignalStrength.aidl index a727aa5658..2d97c4565e 100644 --- a/radio/aidl/android/hardware/radio/network/LteSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/LteSignalStrength.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.network; @VintfStability +@JavaDerive(toString=true) parcelable LteSignalStrength { /** * Valid values are (0-31, 99) as defined in TS 27.007 8.5; INT_MAX means invalid/unreported. diff --git a/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl b/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl index 1cda8db0d3..fb3b986fed 100644 --- a/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl @@ -21,6 +21,7 @@ package android.hardware.radio.network; * normal voice calls. */ @VintfStability +@JavaDerive(toString=true) parcelable LteVopsInfo { /** * This indicates if camped network support VoLTE services. This information is received from diff --git a/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl b/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl index 7cea1de417..ae173c7eac 100644 --- a/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl +++ b/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.RadioAccessSpecifier; @VintfStability +@JavaDerive(toString=true) parcelable NetworkScanRequest { const int RADIO_ACCESS_SPECIFIER_MAX_SIZE = 8; diff --git a/radio/aidl/android/hardware/radio/network/NetworkScanResult.aidl b/radio/aidl/android/hardware/radio/network/NetworkScanResult.aidl index e08d63e312..6d83f74690 100644 --- a/radio/aidl/android/hardware/radio/network/NetworkScanResult.aidl +++ b/radio/aidl/android/hardware/radio/network/NetworkScanResult.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.RadioError; import android.hardware.radio.network.CellInfo; @VintfStability +@JavaDerive(toString=true) parcelable NetworkScanResult { /** * The result contains a part of the scan results. diff --git a/radio/aidl/android/hardware/radio/network/NgranBands.aidl b/radio/aidl/android/hardware/radio/network/NgranBands.aidl index a1c2957c5d..53c7a3d4e7 100644 --- a/radio/aidl/android/hardware/radio/network/NgranBands.aidl +++ b/radio/aidl/android/hardware/radio/network/NgranBands.aidl @@ -21,6 +21,7 @@ package android.hardware.radio.network; */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum NgranBands { /** * 3GPP TS 38.101-1, Table 5.2-1: FR1 bands diff --git a/radio/aidl/android/hardware/radio/network/NrDualConnectivityState.aidl b/radio/aidl/android/hardware/radio/network/NrDualConnectivityState.aidl index e40d4f92b1..e293dff818 100644 --- a/radio/aidl/android/hardware/radio/network/NrDualConnectivityState.aidl +++ b/radio/aidl/android/hardware/radio/network/NrDualConnectivityState.aidl @@ -21,6 +21,7 @@ package android.hardware.radio.network; */ @VintfStability @Backing(type="byte") +@JavaDerive(toString=true) enum NrDualConnectivityState { /** * Enable NR dual connectivity. Enabled state does not mean dual connectivity is active. diff --git a/radio/aidl/android/hardware/radio/network/NrIndicators.aidl b/radio/aidl/android/hardware/radio/network/NrIndicators.aidl index 98fac25747..32cc964007 100644 --- a/radio/aidl/android/hardware/radio/network/NrIndicators.aidl +++ b/radio/aidl/android/hardware/radio/network/NrIndicators.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.network; * The parameters of NR 5G Non-Standalone. */ @VintfStability +@JavaDerive(toString=true) parcelable NrIndicators { /** * Indicates that if E-UTRA-NR Dual Connectivity (EN-DC) is supported by the primary serving diff --git a/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl index d2ac02bdfa..1bb569a91b 100644 --- a/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.network; @VintfStability +@JavaDerive(toString=true) parcelable NrSignalStrength { /** * SS reference signal received power, multiplied by -1. diff --git a/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl b/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl index bae5f40c25..197f401e7e 100644 --- a/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl @@ -21,6 +21,7 @@ package android.hardware.radio.network; * normal voice calls. */ @VintfStability +@JavaDerive(toString=true) parcelable NrVopsInfo { /** * Emergency services not supported diff --git a/radio/aidl/android/hardware/radio/network/OperatorInfo.aidl b/radio/aidl/android/hardware/radio/network/OperatorInfo.aidl index 9fa126d399..56f4dcad36 100644 --- a/radio/aidl/android/hardware/radio/network/OperatorInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/OperatorInfo.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.network; @VintfStability +@JavaDerive(toString=true) parcelable OperatorInfo { const int STATUS_UNKNOWN = 0; const int STATUS_AVAILABLE = 1; diff --git a/radio/aidl/android/hardware/radio/network/PhoneRestrictedState.aidl b/radio/aidl/android/hardware/radio/network/PhoneRestrictedState.aidl index bf3f75a989..23ae3b1a82 100644 --- a/radio/aidl/android/hardware/radio/network/PhoneRestrictedState.aidl +++ b/radio/aidl/android/hardware/radio/network/PhoneRestrictedState.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum PhoneRestrictedState { /** * No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. diff --git a/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl b/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl index b6072ba400..9996953dcb 100644 --- a/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl +++ b/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.network.CellConnectionStatus; import android.hardware.radio.network.PhysicalChannelConfigBand; @VintfStability +@JavaDerive(toString=true) parcelable PhysicalChannelConfig { /** * Connection status for cell. Valid values are PRIMARY_SERVING and SECONDARY_SERVING diff --git a/radio/aidl/android/hardware/radio/network/PhysicalChannelConfigBand.aidl b/radio/aidl/android/hardware/radio/network/PhysicalChannelConfigBand.aidl index f5b248e2fd..707a032494 100644 --- a/radio/aidl/android/hardware/radio/network/PhysicalChannelConfigBand.aidl +++ b/radio/aidl/android/hardware/radio/network/PhysicalChannelConfigBand.aidl @@ -22,6 +22,7 @@ import android.hardware.radio.network.NgranBands; import android.hardware.radio.network.UtranBands; @VintfStability +@JavaDerive(toString=true) union PhysicalChannelConfigBand { boolean noinit; /** diff --git a/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl b/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl index dcc9d53572..85042489a9 100644 --- a/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl +++ b/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.AccessNetwork; import android.hardware.radio.network.RadioAccessSpecifierBands; @VintfStability +@JavaDerive(toString=true) parcelable RadioAccessSpecifier { /** * The type of network to scan. diff --git a/radio/aidl/android/hardware/radio/network/RadioAccessSpecifierBands.aidl b/radio/aidl/android/hardware/radio/network/RadioAccessSpecifierBands.aidl index c72d8c947b..38afee5693 100644 --- a/radio/aidl/android/hardware/radio/network/RadioAccessSpecifierBands.aidl +++ b/radio/aidl/android/hardware/radio/network/RadioAccessSpecifierBands.aidl @@ -22,6 +22,7 @@ import android.hardware.radio.network.NgranBands; import android.hardware.radio.network.UtranBands; @VintfStability +@JavaDerive(toString=true) union RadioAccessSpecifierBands { boolean noinit; /** diff --git a/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl b/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl index 4fdc614f8c..45c4a516db 100644 --- a/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl +++ b/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum RadioBandMode { /** * "Unspecified" (selected by baseband automatically) diff --git a/radio/aidl/android/hardware/radio/network/RegState.aidl b/radio/aidl/android/hardware/radio/network/RegState.aidl index bb2c3c30e7..3f1378321e 100644 --- a/radio/aidl/android/hardware/radio/network/RegState.aidl +++ b/radio/aidl/android/hardware/radio/network/RegState.aidl @@ -23,6 +23,7 @@ package android.hardware.radio.network; */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum RegState { /** * Not registered, MT is not currently searching for a new operator to register diff --git a/radio/aidl/android/hardware/radio/network/RegStateResult.aidl b/radio/aidl/android/hardware/radio/network/RegStateResult.aidl index 312182e9e4..3d96b8cbf2 100644 --- a/radio/aidl/android/hardware/radio/network/RegStateResult.aidl +++ b/radio/aidl/android/hardware/radio/network/RegStateResult.aidl @@ -23,6 +23,7 @@ import android.hardware.radio.network.RegState; import android.hardware.radio.network.RegistrationFailCause; @VintfStability +@JavaDerive(toString=true) parcelable RegStateResult { /** * Registration state. If the RAT is indicated as a GERAN, UTRAN, or CDMA2000 technology, this diff --git a/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl b/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl index 586436efb6..9549f2e841 100644 --- a/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl +++ b/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl @@ -22,6 +22,7 @@ package android.hardware.radio.network; */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum RegistrationFailCause { /** * 0 - None diff --git a/radio/aidl/android/hardware/radio/network/SignalStrength.aidl b/radio/aidl/android/hardware/radio/network/SignalStrength.aidl index 5a18b18280..ddb45822b7 100644 --- a/radio/aidl/android/hardware/radio/network/SignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/SignalStrength.aidl @@ -25,6 +25,7 @@ import android.hardware.radio.network.TdscdmaSignalStrength; import android.hardware.radio.network.WcdmaSignalStrength; @VintfStability +@JavaDerive(toString=true) parcelable SignalStrength { /** * If GSM measurements are provided, this structure must contain valid measurements; otherwise diff --git a/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl b/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl index 584ea38222..2f901807e8 100644 --- a/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl @@ -22,6 +22,7 @@ import android.hardware.radio.AccessNetwork; * Contains the threshold values of each signal measurement type. */ @VintfStability +@JavaDerive(toString=true) parcelable SignalThresholdInfo { /** * Received Signal Strength Indication. diff --git a/radio/aidl/android/hardware/radio/network/SuppSvcNotification.aidl b/radio/aidl/android/hardware/radio/network/SuppSvcNotification.aidl index dce437aaf8..d4229e1b1a 100644 --- a/radio/aidl/android/hardware/radio/network/SuppSvcNotification.aidl +++ b/radio/aidl/android/hardware/radio/network/SuppSvcNotification.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.network; @VintfStability +@JavaDerive(toString=true) parcelable SuppSvcNotification { /** * Notification type diff --git a/radio/aidl/android/hardware/radio/network/TdscdmaSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/TdscdmaSignalStrength.aidl index 13f394abb2..ec9ca6bb69 100644 --- a/radio/aidl/android/hardware/radio/network/TdscdmaSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/TdscdmaSignalStrength.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.network; @VintfStability +@JavaDerive(toString=true) parcelable TdscdmaSignalStrength { /** * UTRA carrier RSSI as defined in TS 25.225 5.1.4. Valid values are (0-31, 99) as defined in diff --git a/radio/aidl/android/hardware/radio/network/UsageSetting.aidl b/radio/aidl/android/hardware/radio/network/UsageSetting.aidl index ba8fe93f55..5a714a436d 100644 --- a/radio/aidl/android/hardware/radio/network/UsageSetting.aidl +++ b/radio/aidl/android/hardware/radio/network/UsageSetting.aidl @@ -24,6 +24,7 @@ package android.hardware.radio.network; */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum UsageSetting { /** * UE operates in voice-centric mode. Generally speaking, in this mode of operation, the UE diff --git a/radio/aidl/android/hardware/radio/network/UtranBands.aidl b/radio/aidl/android/hardware/radio/network/UtranBands.aidl index da21f9bcb8..a0fd427c28 100644 --- a/radio/aidl/android/hardware/radio/network/UtranBands.aidl +++ b/radio/aidl/android/hardware/radio/network/UtranBands.aidl @@ -21,6 +21,7 @@ package android.hardware.radio.network; */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum UtranBands { BAND_1 = 1, BAND_2 = 2, diff --git a/radio/aidl/android/hardware/radio/network/WcdmaSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/WcdmaSignalStrength.aidl index 21021e51c3..7595c0542e 100644 --- a/radio/aidl/android/hardware/radio/network/WcdmaSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/WcdmaSignalStrength.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.network; @VintfStability +@JavaDerive(toString=true) parcelable WcdmaSignalStrength { /** * Valid values are (0-31, 99) as defined in TS 27.007 8.5; INT_MAX means unreported. diff --git a/radio/aidl/android/hardware/radio/sim/AppStatus.aidl b/radio/aidl/android/hardware/radio/sim/AppStatus.aidl index 07939bba6d..c072f6a321 100644 --- a/radio/aidl/android/hardware/radio/sim/AppStatus.aidl +++ b/radio/aidl/android/hardware/radio/sim/AppStatus.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.sim.PersoSubstate; import android.hardware.radio.sim.PinState; @VintfStability +@JavaDerive(toString=true) parcelable AppStatus { const int APP_STATE_UNKNOWN = 0; const int APP_STATE_DETECTED = 1; diff --git a/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl b/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl index b69296d36c..f8b5922c3b 100644 --- a/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl +++ b/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.sim; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum CardPowerState { POWER_DOWN, POWER_UP, diff --git a/radio/aidl/android/hardware/radio/sim/CardStatus.aidl b/radio/aidl/android/hardware/radio/sim/CardStatus.aidl index 3098c4d069..a14cf7d4cc 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; @VintfStability +@JavaDerive(toString=true) parcelable CardStatus { /* * Card is physically absent from device. (Some old modems use STATE_ABSENT when the SIM diff --git a/radio/aidl/android/hardware/radio/sim/Carrier.aidl b/radio/aidl/android/hardware/radio/sim/Carrier.aidl index c870c00e89..d25214f542 100644 --- a/radio/aidl/android/hardware/radio/sim/Carrier.aidl +++ b/radio/aidl/android/hardware/radio/sim/Carrier.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.sim; @VintfStability +@JavaDerive(toString=true) parcelable Carrier { /** * Apply to all carrier with the same mcc/mnc diff --git a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl index ef38fdc171..3dce9076ea 100644 --- a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl +++ b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.sim; import android.hardware.radio.sim.Carrier; @VintfStability +@JavaDerive(toString=true) parcelable CarrierRestrictions { /** * Allowed carriers diff --git a/radio/aidl/android/hardware/radio/sim/CdmaSubscriptionSource.aidl b/radio/aidl/android/hardware/radio/sim/CdmaSubscriptionSource.aidl index bdd7e07904..6aa6926c27 100644 --- a/radio/aidl/android/hardware/radio/sim/CdmaSubscriptionSource.aidl +++ b/radio/aidl/android/hardware/radio/sim/CdmaSubscriptionSource.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.sim; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum CdmaSubscriptionSource { RUIM_SIM, NV, diff --git a/radio/aidl/android/hardware/radio/sim/IccIo.aidl b/radio/aidl/android/hardware/radio/sim/IccIo.aidl index be5e832c99..f173c8e6c7 100644 --- a/radio/aidl/android/hardware/radio/sim/IccIo.aidl +++ b/radio/aidl/android/hardware/radio/sim/IccIo.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.sim; @VintfStability +@JavaDerive(toString=true) parcelable IccIo { /** * One of the commands listed for TS 27.007 +CRSM diff --git a/radio/aidl/android/hardware/radio/sim/IccIoResult.aidl b/radio/aidl/android/hardware/radio/sim/IccIoResult.aidl index 8aa9e8fadb..efcbbda039 100644 --- a/radio/aidl/android/hardware/radio/sim/IccIoResult.aidl +++ b/radio/aidl/android/hardware/radio/sim/IccIoResult.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.sim; @VintfStability +@JavaDerive(toString=true) parcelable IccIoResult { int sw1; int sw2; diff --git a/radio/aidl/android/hardware/radio/sim/ImsiEncryptionInfo.aidl b/radio/aidl/android/hardware/radio/sim/ImsiEncryptionInfo.aidl index e8b3807ce2..ba1dda5c59 100644 --- a/radio/aidl/android/hardware/radio/sim/ImsiEncryptionInfo.aidl +++ b/radio/aidl/android/hardware/radio/sim/ImsiEncryptionInfo.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.sim; * Carrier specific Information sent by the carrier, which will be used to encrypt IMSI and IMPI. */ @VintfStability +@JavaDerive(toString=true) parcelable ImsiEncryptionInfo { /** * Key type to be used for ePDG diff --git a/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl b/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl index 953335baf2..b1385a4d88 100644 --- a/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl +++ b/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl @@ -21,6 +21,7 @@ package android.hardware.radio.sim; */ @VintfStability @Backing(type="byte") +@JavaDerive(toString=true) enum PbReceivedStatus { /** * Indicates that retrieval is fine. diff --git a/radio/aidl/android/hardware/radio/sim/PersoSubstate.aidl b/radio/aidl/android/hardware/radio/sim/PersoSubstate.aidl index f01ff61a50..f85c84bb64 100644 --- a/radio/aidl/android/hardware/radio/sim/PersoSubstate.aidl +++ b/radio/aidl/android/hardware/radio/sim/PersoSubstate.aidl @@ -22,6 +22,7 @@ package android.hardware.radio.sim; */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum PersoSubstate { /** * Initial state diff --git a/radio/aidl/android/hardware/radio/sim/PhonebookCapacity.aidl b/radio/aidl/android/hardware/radio/sim/PhonebookCapacity.aidl index 23a0208ecc..97c3dba2ff 100644 --- a/radio/aidl/android/hardware/radio/sim/PhonebookCapacity.aidl +++ b/radio/aidl/android/hardware/radio/sim/PhonebookCapacity.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.sim; @VintfStability +@JavaDerive(toString=true) parcelable PhonebookCapacity { /** * Maximum number of ADN records possible in the SIM phonebook. Needs to be non-negative. diff --git a/radio/aidl/android/hardware/radio/sim/PhonebookRecordInfo.aidl b/radio/aidl/android/hardware/radio/sim/PhonebookRecordInfo.aidl index 03326b8877..c4db0e6608 100644 --- a/radio/aidl/android/hardware/radio/sim/PhonebookRecordInfo.aidl +++ b/radio/aidl/android/hardware/radio/sim/PhonebookRecordInfo.aidl @@ -21,6 +21,7 @@ package android.hardware.radio.sim; * as per 3GPP spec 31.102 v15 Section-4.4.2.3. */ @VintfStability +@JavaDerive(toString=true) parcelable PhonebookRecordInfo { /** * Record index. 0 is used to insert a record diff --git a/radio/aidl/android/hardware/radio/sim/PinState.aidl b/radio/aidl/android/hardware/radio/sim/PinState.aidl index 03b8e4ea6e..85048bbb77 100644 --- a/radio/aidl/android/hardware/radio/sim/PinState.aidl +++ b/radio/aidl/android/hardware/radio/sim/PinState.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.sim; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum PinState { UNKNOWN, ENABLED_NOT_VERIFIED, diff --git a/radio/aidl/android/hardware/radio/sim/SelectUiccSub.aidl b/radio/aidl/android/hardware/radio/sim/SelectUiccSub.aidl index 3c152d6a6b..553404bdf4 100644 --- a/radio/aidl/android/hardware/radio/sim/SelectUiccSub.aidl +++ b/radio/aidl/android/hardware/radio/sim/SelectUiccSub.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.sim; @VintfStability +@JavaDerive(toString=true) parcelable SelectUiccSub { const int SUBSCRIPTION_TYPE_1 = 0; const int SUBSCRIPTION_TYPE_2 = 1; diff --git a/radio/aidl/android/hardware/radio/sim/SimApdu.aidl b/radio/aidl/android/hardware/radio/sim/SimApdu.aidl index 1dc707ecb9..43adbbcd5e 100644 --- a/radio/aidl/android/hardware/radio/sim/SimApdu.aidl +++ b/radio/aidl/android/hardware/radio/sim/SimApdu.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.sim; @VintfStability +@JavaDerive(toString=true) parcelable SimApdu { /** * "sessionid" from TS 27.007 +CGLA command. Must be ignored for +CSIM command. diff --git a/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl index 6c031220d9..6490d5118d 100644 --- a/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl +++ b/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.sim; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum SimLockMultiSimPolicy { /** * Indicates that configuration applies to each slot independently. diff --git a/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl b/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl index 483a54c611..69aff668c2 100644 --- a/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl +++ b/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.sim; @VintfStability +@JavaDerive(toString=true) parcelable SimRefreshResult { /** * A file on SIM has been updated. diff --git a/radio/aidl/android/hardware/radio/voice/AudioQuality.aidl b/radio/aidl/android/hardware/radio/voice/AudioQuality.aidl index 94d5f880b7..dc4717297a 100644 --- a/radio/aidl/android/hardware/radio/voice/AudioQuality.aidl +++ b/radio/aidl/android/hardware/radio/voice/AudioQuality.aidl @@ -22,6 +22,7 @@ package android.hardware.radio.voice; */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum AudioQuality { /** * Unspecified audio codec diff --git a/radio/aidl/android/hardware/radio/voice/Call.aidl b/radio/aidl/android/hardware/radio/voice/Call.aidl index beb079b838..b09d7a015d 100644 --- a/radio/aidl/android/hardware/radio/voice/Call.aidl +++ b/radio/aidl/android/hardware/radio/voice/Call.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.voice.AudioQuality; import android.hardware.radio.voice.UusInfo; @VintfStability +@JavaDerive(toString=true) parcelable Call { const int PRESENTATION_ALLOWED = 0; const int PRESENTATION_RESTRICTED = 1; diff --git a/radio/aidl/android/hardware/radio/voice/CallForwardInfo.aidl b/radio/aidl/android/hardware/radio/voice/CallForwardInfo.aidl index b7ddcd9fac..c4143b9f9f 100644 --- a/radio/aidl/android/hardware/radio/voice/CallForwardInfo.aidl +++ b/radio/aidl/android/hardware/radio/voice/CallForwardInfo.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.voice; * See also com.android.internal.telephony.gsm.CallForwardInfo */ @VintfStability +@JavaDerive(toString=true) parcelable CallForwardInfo { const int STATUS_DISABLE = 0; const int STATUS_ENABLE = 1; diff --git a/radio/aidl/android/hardware/radio/voice/CdmaCallWaiting.aidl b/radio/aidl/android/hardware/radio/voice/CdmaCallWaiting.aidl index 7ba6a72744..4d447d7675 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaCallWaiting.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaCallWaiting.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.voice; import android.hardware.radio.voice.CdmaSignalInfoRecord; @VintfStability +@JavaDerive(toString=true) parcelable CdmaCallWaiting { const int NUMBER_PLAN_UNKNOWN = 0; const int NUMBER_PLAN_ISDN = 1; diff --git a/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl index ac66237823..522f7ae643 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl @@ -24,6 +24,7 @@ package android.hardware.radio.voice; * a byte buffer. The display_tag, display_len and chari fields are all 1 byte. */ @VintfStability +@JavaDerive(toString=true) parcelable CdmaDisplayInfoRecord { const int CDMA_ALPHA_INFO_BUFFER_LENGTH = 64; /** diff --git a/radio/aidl/android/hardware/radio/voice/CdmaInformationRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaInformationRecord.aidl index 69204620f4..1a4f1b37e0 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaInformationRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaInformationRecord.aidl @@ -28,6 +28,7 @@ import android.hardware.radio.voice.CdmaT53ClirInfoRecord; /** * Max length of CdmaInformationRecords[] is CDMA_MAX_NUMBER_OF_INFO_RECS */ +@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 c3bda23013..8bfc5f77dc 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.voice; * Line Control Information Record as defined in C.S0005 section 3.7.5.15 */ @VintfStability +@JavaDerive(toString=true) parcelable CdmaLineControlInfoRecord { byte lineCtrlPolarityIncluded; byte lineCtrlToggle; diff --git a/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl index 265bf67dfc..9084b257d5 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl @@ -22,6 +22,7 @@ package android.hardware.radio.voice; * Connected Number Info Rec as defined in C.S0005 section 3.7.5.4 */ @VintfStability +@JavaDerive(toString=true) parcelable CdmaNumberInfoRecord { const int CDMA_NUMBER_INFO_BUFFER_LENGTH = 81; /** diff --git a/radio/aidl/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl b/radio/aidl/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl index 7b4205ac6f..81fb003b7e 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum CdmaOtaProvisionStatus { SPL_UNLOCKED, SPC_RETRIES_EXCEEDED, diff --git a/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl index f3bcc0f9b6..5c9e2f22d9 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.voice; import android.hardware.radio.voice.CdmaNumberInfoRecord; @VintfStability +@JavaDerive(toString=true) parcelable CdmaRedirectingNumberInfoRecord { /** * Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 diff --git a/radio/aidl/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl index 5fc877680c..3334475d4f 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.voice; * CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */ @VintfStability +@JavaDerive(toString=true) parcelable CdmaSignalInfoRecord { /** * True if signal information record is present diff --git a/radio/aidl/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl index c41f8e365a..9795cf01ec 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.voice; * T53 Audio Control Information Record */ @VintfStability +@JavaDerive(toString=true) parcelable CdmaT53AudioControlInfoRecord { byte upLink; byte downLink; diff --git a/radio/aidl/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl index e37a072258..5ccd251bd5 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.voice; * T53 CLIR Information Record */ @VintfStability +@JavaDerive(toString=true) parcelable CdmaT53ClirInfoRecord { byte cause; } diff --git a/radio/aidl/android/hardware/radio/voice/CfData.aidl b/radio/aidl/android/hardware/radio/voice/CfData.aidl index f28c7c85d2..8f4c22711a 100644 --- a/radio/aidl/android/hardware/radio/voice/CfData.aidl +++ b/radio/aidl/android/hardware/radio/voice/CfData.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.voice; import android.hardware.radio.voice.CallForwardInfo; @VintfStability +@JavaDerive(toString=true) parcelable CfData { const int NUM_SERVICE_CLASSES = 7; /** diff --git a/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl b/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl index 4b10ecc5d0..4021471734 100644 --- a/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl +++ b/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum ClipStatus { /** * CLIP provisioned diff --git a/radio/aidl/android/hardware/radio/voice/Dial.aidl b/radio/aidl/android/hardware/radio/voice/Dial.aidl index 7d61fe5fe0..ca028ad949 100644 --- a/radio/aidl/android/hardware/radio/voice/Dial.aidl +++ b/radio/aidl/android/hardware/radio/voice/Dial.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.voice; import android.hardware.radio.voice.UusInfo; @VintfStability +@JavaDerive(toString=true) parcelable Dial { /** * Use subscription default value diff --git a/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl b/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl index 75a41c9c36..d623346256 100644 --- a/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl +++ b/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl @@ -21,6 +21,7 @@ package android.hardware.radio.voice; */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum EmergencyCallRouting { /** * Indicates Android does not require how to handle the corresponding emergency call; it is diff --git a/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl b/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl index 9fed78e2cb..e380ce8874 100644 --- a/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl +++ b/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl @@ -39,6 +39,7 @@ package android.hardware.radio.voice; * RFC 5031 */ @VintfStability +@JavaDerive(toString=true) parcelable EmergencyNumber { /** * Indicates the number is from the network signal. diff --git a/radio/aidl/android/hardware/radio/voice/EmergencyServiceCategory.aidl b/radio/aidl/android/hardware/radio/voice/EmergencyServiceCategory.aidl index cfebc47e35..a4ac7aa2f5 100644 --- a/radio/aidl/android/hardware/radio/voice/EmergencyServiceCategory.aidl +++ b/radio/aidl/android/hardware/radio/voice/EmergencyServiceCategory.aidl @@ -34,6 +34,7 @@ package android.hardware.radio.voice; */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum EmergencyServiceCategory { /** * General emergency call, all categories diff --git a/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl b/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl index 5e328d4bd1..5c8c81929c 100644 --- a/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl +++ b/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum LastCallFailCause { UNOBTAINABLE_NUMBER = 1, NO_ROUTE_TO_DESTINATION = 3, diff --git a/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl b/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl index 084beddcbb..078722af60 100644 --- a/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl +++ b/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.voice; import android.hardware.radio.voice.LastCallFailCause; @VintfStability +@JavaDerive(toString=true) parcelable LastCallFailCauseInfo { LastCallFailCause causeCode; String vendorCause; diff --git a/radio/aidl/android/hardware/radio/voice/SrvccState.aidl b/radio/aidl/android/hardware/radio/voice/SrvccState.aidl index ddf75dbbbd..08eb877ef7 100644 --- a/radio/aidl/android/hardware/radio/voice/SrvccState.aidl +++ b/radio/aidl/android/hardware/radio/voice/SrvccState.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum SrvccState { HANDOVER_STARTED, HANDOVER_COMPLETED, diff --git a/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl b/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl index d562925be4..b944bf4f84 100644 --- a/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl +++ b/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.voice; @VintfStability +@JavaDerive(toString=true) parcelable SsInfoData { const int SS_INFO_MAX = 4; /** diff --git a/radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl b/radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl index be1b6116f2..798227575e 100644 --- a/radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl +++ b/radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.voice.CfData; import android.hardware.radio.voice.SsInfoData; @VintfStability +@JavaDerive(toString=true) parcelable StkCcUnsolSsResult { const int REQUEST_TYPE_ACTIVATION = 0; const int REQUEST_TYPE_DEACTIVATION = 1; diff --git a/radio/aidl/android/hardware/radio/voice/TtyMode.aidl b/radio/aidl/android/hardware/radio/voice/TtyMode.aidl index 81a846bcca..e8dd7236aa 100644 --- a/radio/aidl/android/hardware/radio/voice/TtyMode.aidl +++ b/radio/aidl/android/hardware/radio/voice/TtyMode.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum TtyMode { OFF, FULL, diff --git a/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl b/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl index 48d1fca37d..cece4bd3ed 100644 --- a/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl +++ b/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum UssdModeType { /** * USSD-Notify diff --git a/radio/aidl/android/hardware/radio/voice/UusInfo.aidl b/radio/aidl/android/hardware/radio/voice/UusInfo.aidl index 19e73f724c..220a8fc7e6 100644 --- a/radio/aidl/android/hardware/radio/voice/UusInfo.aidl +++ b/radio/aidl/android/hardware/radio/voice/UusInfo.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.voice; * User-to-User Signaling Information defined in 3GPP 23.087 v8.0 */ @VintfStability +@JavaDerive(toString=true) parcelable UusInfo { /** * User specified protocol -- GitLab From 852a53027aec2d3cd6c83a36118714c38373da1e Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Thu, 24 Mar 2022 11:42:38 -0700 Subject: [PATCH 708/825] [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces Added SPDX-license-identifier-Apache-2.0 to: automotive/vehicle/vts/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Change-Id: Ic7216f0da29aabfad2ce3614e5f9ee40055aa609 --- automotive/vehicle/vts/Android.bp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/automotive/vehicle/vts/Android.bp b/automotive/vehicle/vts/Android.bp index c8276d780c..b78e0ff7c4 100644 --- a/automotive/vehicle/vts/Android.bp +++ b/automotive/vehicle/vts/Android.bp @@ -14,6 +14,15 @@ * 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: "VtsHalAutomotiveVehicle_TargetTest", srcs: [ -- GitLab From dd1221d2d478648bff18752c91d90b4baad311fc Mon Sep 17 00:00:00 2001 From: Suren Baghdasaryan Date: Tue, 22 Mar 2022 15:59:54 +0000 Subject: [PATCH 709/825] Replace writepid with task_profiles command for cgroup migration writepid command usage to join a cgroup has been deprecated in favor of a more flexible approach using task_profiles. This way cgroup path is not hardcoded and cgroup changes can be easily made. Replace writepid with task_profiles command to migrate between cgroups. Bug: 191283136 Test: build and boot Signed-off-by: Suren Baghdasaryan Change-Id: Icbf3e66e61e7ebb570ac3aba5f1cf9e10ef6720d Merged-In: Icbf3e66e61e7ebb570ac3aba5f1cf9e10ef6720d --- .../1.1/default/android.hardware.tv.tuner@1.1-service-lazy.rc | 2 +- tv/tuner/1.1/default/android.hardware.tv.tuner@1.1-service.rc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tv/tuner/1.1/default/android.hardware.tv.tuner@1.1-service-lazy.rc b/tv/tuner/1.1/default/android.hardware.tv.tuner@1.1-service-lazy.rc index abff430d3c..3fe6b52453 100644 --- a/tv/tuner/1.1/default/android.hardware.tv.tuner@1.1-service-lazy.rc +++ b/tv/tuner/1.1/default/android.hardware.tv.tuner@1.1-service-lazy.rc @@ -7,4 +7,4 @@ service vendor.tuner-hal-1-1 /vendor/bin/hw/android.hardware.tv.tuner@1.1-servic user media group mediadrm drmrpc ioprio rt 4 - writepid /dev/cpuset/foreground/tasks \ No newline at end of file + task_profiles ProcessCapacityHigh diff --git a/tv/tuner/1.1/default/android.hardware.tv.tuner@1.1-service.rc b/tv/tuner/1.1/default/android.hardware.tv.tuner@1.1-service.rc index 62ee52019a..4ee6fa9a27 100644 --- a/tv/tuner/1.1/default/android.hardware.tv.tuner@1.1-service.rc +++ b/tv/tuner/1.1/default/android.hardware.tv.tuner@1.1-service.rc @@ -3,5 +3,5 @@ service vendor.tuner-hal-1-1 /vendor/bin/hw/android.hardware.tv.tuner@1.1-servic user media group mediadrm drmrpc ioprio rt 4 - writepid /dev/cpuset/foreground/tasks + task_profiles ProcessCapacityHigh onrestart restart media.tuner -- GitLab From abd3431f9eb099aca12ba70a6f69be1ca7167f61 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 18 Mar 2022 21:26:20 +0000 Subject: [PATCH 710/825] Add ECHO_REVERSE_BYTES in VHAL ref impl. This is a test property to test LargeParcelable end to end. It would echo byte values back in reversed order. Test: atest AndroidCarApiTest:android.car.apitest.VehicleHalLargeParcelableTest Bug: 224595312 Change-Id: Ib07c7f602613919aef452ac8796a93988a1a9d65 --- .../default_config/include/DefaultConfig.h | 8 +++++++ .../hardware/include/FakeVehicleHardware.h | 2 ++ .../hardware/src/FakeVehicleHardware.cpp | 20 ++++++++++++++++ .../hardware/test/FakeVehicleHardwareTest.cpp | 23 +++++++++++++++++++ .../utils/test/include/TestPropertyUtils.h | 10 ++++++++ 5 files changed, 63 insertions(+) diff --git a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h index 6ecac704f4..50c4f311cf 100644 --- a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +++ b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h @@ -1124,6 +1124,14 @@ const std::vector kVehicleProperties = { }, .initialValue = {.stringValue = {"Test"}}, }, + { + .config = + { + .prop = ECHO_REVERSE_BYTES, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + }, #ifdef ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING // Vendor propetry for E2E ClusterHomeService testing. { 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 1c076d364a..e799a28944 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -131,6 +131,8 @@ class FakeVehicleHardware : public IVehicleHardware { const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); ValueResultType getUserHalProp( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; + ValueResultType getEchoReverseBytes( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; bool isHvacPropAndHvacNotAvailable(int32_t propId); std::string dumpAllProperties(); 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 462506d56c..f8b64f2a0a 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -335,6 +336,9 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue( result.value()->timestamp = elapsedRealtimeNano(); } return result; + case ECHO_REVERSE_BYTES: + *isSpecialValue = true; + return getEchoReverseBytes(value); default: // Do nothing. break; @@ -343,6 +347,22 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue( return nullptr; } +FakeVehicleHardware::ValueResultType FakeVehicleHardware::getEchoReverseBytes( + const VehiclePropValue& value) const { + auto readResult = mServerSidePropStore->readValue(value); + if (!readResult.ok()) { + return readResult; + } + auto& gotValue = readResult.value(); + gotValue->timestamp = elapsedRealtimeNano(); + std::vector byteValues = gotValue->value.byteValues; + size_t byteSize = byteValues.size(); + for (size_t i = 0; i < byteSize; i++) { + gotValue->value.byteValues[i] = byteValues[byteSize - 1 - i]; + } + return std::move(gotValue); +} + VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValue& value, bool* isSpecialValue) { *isSpecialValue = false; 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 6259f9606f..7a7fb3745a 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -276,6 +276,11 @@ TEST_F(FakeVehicleHardwareTest, testGetDefaultValues) { continue; } + if (config.config.prop == ECHO_REVERSE_BYTES) { + // Ignore ECHO_REVERSE_BYTES, it has special logic. + continue; + } + int propId = config.config.prop; if (isGlobalProp(propId)) { if (config.initialValue == RawPropValues{}) { @@ -1487,6 +1492,24 @@ TEST_F(FakeVehicleHardwareTest, SetComplexPropTest) { ASSERT_EQ(3.402823466E+38f, value.value.floatValues[2]); } +TEST_F(FakeVehicleHardwareTest, testGetEchoReverseBytes) { + ASSERT_EQ(setValue(VehiclePropValue{ + .prop = ECHO_REVERSE_BYTES, + .value = + { + .byteValues = {0x01, 0x02, 0x03, 0x04}, + }, + }), + StatusCode::OK); + + auto result = getValue(VehiclePropValue{ + .prop = ECHO_REVERSE_BYTES, + }); + + ASSERT_TRUE(result.ok()) << "failed to get ECHO_REVERSE_BYTES value: " << getStatus(result); + ASSERT_EQ(result.value().value.byteValues, std::vector({0x04, 0x03, 0x02, 0x01})); +} + } // namespace fake } // namespace vehicle } // namespace automotive diff --git a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h index 42135011d3..d512713cc9 100644 --- a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h +++ b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h @@ -76,6 +76,16 @@ constexpr int32_t PLACEHOLDER_PROPERTY_STRING = 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 test purpose. End to end tests use this property to test set and get // method for MIXED type properties. constexpr int32_t kMixedTypePropertyForTest = -- GitLab From c04af1c235a0d1a2fff56563d7970f6d6a4695f4 Mon Sep 17 00:00:00 2001 From: Chris Ye Date: Mon, 28 Mar 2022 18:42:23 -0700 Subject: [PATCH 711/825] Fixed HostApd VTS test failure. Add filed in hwModeParams.maximumChannelBandwidth for Non-ACS AP interface. Use HAL AP iface name instead of hardcoding constant. Bug: 226872346 Test: atest VtsHalHostApdTargetTest Change-Id: Ic5eacb99659a27cb18536a1c11f9027c13281862 --- .../functional/VtsHalHostapdTargetTest.cpp | 78 ++++++++++--------- 1 file changed, 43 insertions(+), 35 deletions(-) diff --git a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp index c1f2bb7280..bd2649fc50 100644 --- a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp +++ b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp @@ -32,6 +32,7 @@ using aidl::android::hardware::wifi::hostapd::BandMask; using aidl::android::hardware::wifi::hostapd::BnHostapdCallback; +using aidl::android::hardware::wifi::hostapd::ChannelBandwidth; using aidl::android::hardware::wifi::hostapd::ChannelParams; using aidl::android::hardware::wifi::hostapd::DebugLevel; using aidl::android::hardware::wifi::hostapd::EncryptionType; @@ -44,7 +45,6 @@ using android::ProcessState; namespace { const unsigned char kNwSsid[] = {'t', 'e', 's', 't', '1', '2', '3', '4', '5'}; -const std::string kIfaceName = "wlan0"; const std::string kPassphrase = "test12345"; const std::string kInvalidMinPassphrase = "test"; const std::string kInvalidMaxPassphrase = @@ -123,6 +123,7 @@ class HostapdAidl : public testing::TestWithParam { iface_params.hwModeParams.enable80211AC = false; iface_params.hwModeParams.enable80211AX = false; iface_params.hwModeParams.enable6GhzBand = false; + iface_params.hwModeParams.maximumChannelBandwidth = ChannelBandwidth::BANDWIDTH_20; channelParams.enableAcs = false; channelParams.acsShouldExcludeDfs = false; @@ -284,8 +285,8 @@ TEST_P(HostapdAidl, RegisterCallback) { */ TEST_P(HostapdAidl, AddPskAccessPointWithAcs) { if (!isAcsSupport) GTEST_SKIP() << "Missing ACS support"; - auto status = hostapd->addAccessPoint(getIfaceParamsWithAcs(kIfaceName), - getPskNwParams()); + std::string ifname = setupApIfaceAndGetName(false); + auto status = hostapd->addAccessPoint(getIfaceParamsWithAcs(ifname), getPskNwParams()); EXPECT_TRUE(status.isOk()); } @@ -295,8 +296,9 @@ TEST_P(HostapdAidl, AddPskAccessPointWithAcs) { */ TEST_P(HostapdAidl, AddPskAccessPointWithAcsAndFreqRange) { if (!isAcsSupport) GTEST_SKIP() << "Missing ACS support"; - auto status = hostapd->addAccessPoint( - getIfaceParamsWithAcsAndFreqRange(kIfaceName), getPskNwParams()); + std::string ifname = setupApIfaceAndGetName(false); + auto status = + hostapd->addAccessPoint(getIfaceParamsWithAcsAndFreqRange(ifname), getPskNwParams()); EXPECT_TRUE(status.isOk()); } @@ -306,8 +308,9 @@ TEST_P(HostapdAidl, AddPskAccessPointWithAcsAndFreqRange) { */ TEST_P(HostapdAidl, AddPskAccessPointWithAcsAndInvalidFreqRange) { if (!isAcsSupport) GTEST_SKIP() << "Missing ACS support"; - auto status = hostapd->addAccessPoint( - getIfaceParamsWithAcsAndInvalidFreqRange(kIfaceName), getPskNwParams()); + std::string ifname = setupApIfaceAndGetName(false); + auto status = hostapd->addAccessPoint(getIfaceParamsWithAcsAndInvalidFreqRange(ifname), + getPskNwParams()); EXPECT_FALSE(status.isOk()); } @@ -317,8 +320,8 @@ TEST_P(HostapdAidl, AddPskAccessPointWithAcsAndInvalidFreqRange) { */ TEST_P(HostapdAidl, AddOpenAccessPointWithAcs) { if (!isAcsSupport) GTEST_SKIP() << "Missing ACS support"; - auto status = hostapd->addAccessPoint(getIfaceParamsWithAcs(kIfaceName), - getOpenNwParams()); + std::string ifname = setupApIfaceAndGetName(false); + auto status = hostapd->addAccessPoint(getIfaceParamsWithAcs(ifname), getOpenNwParams()); EXPECT_TRUE(status.isOk()); } @@ -327,8 +330,8 @@ TEST_P(HostapdAidl, AddOpenAccessPointWithAcs) { * Access point creation should pass. */ TEST_P(HostapdAidl, AddPskAccessPointWithoutAcs) { - auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(kIfaceName), - getPskNwParams()); + std::string ifname = setupApIfaceAndGetName(false); + auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(ifname), getPskNwParams()); EXPECT_TRUE(status.isOk()); } @@ -337,7 +340,8 @@ TEST_P(HostapdAidl, AddPskAccessPointWithoutAcs) { * Access point creation should pass. */ TEST_P(HostapdAidl, AddPskAccessPointWithoutAcsAndNonMetered) { - auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(kIfaceName), + std::string ifname = setupApIfaceAndGetName(false); + auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(ifname), getPskNwParamsWithNonMetered()); EXPECT_TRUE(status.isOk()); } @@ -347,8 +351,8 @@ TEST_P(HostapdAidl, AddPskAccessPointWithoutAcsAndNonMetered) { * Access point creation should pass. */ TEST_P(HostapdAidl, AddOpenAccessPointWithoutAcs) { - auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(kIfaceName), - getOpenNwParams()); + std::string ifname = setupApIfaceAndGetName(false); + auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(ifname), getOpenNwParams()); EXPECT_TRUE(status.isOk()); } @@ -358,8 +362,9 @@ TEST_P(HostapdAidl, AddOpenAccessPointWithoutAcs) { */ TEST_P(HostapdAidl, AddSaeTransitionAccessPointWithoutAcs) { if (!isWpa3SaeSupport) GTEST_SKIP() << "Missing SAE support"; - auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(kIfaceName), - getSaeTransitionNwParams()); + std::string ifname = setupApIfaceAndGetName(false); + auto status = + hostapd->addAccessPoint(getIfaceParamsWithoutAcs(ifname), getSaeTransitionNwParams()); EXPECT_TRUE(status.isOk()); } @@ -369,8 +374,8 @@ TEST_P(HostapdAidl, AddSaeTransitionAccessPointWithoutAcs) { */ TEST_P(HostapdAidl, AddSAEAccessPointWithoutAcs) { if (!isWpa3SaeSupport) GTEST_SKIP() << "Missing SAE support"; - auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(kIfaceName), - getSaeNwParams()); + std::string ifname = setupApIfaceAndGetName(false); + auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(ifname), getSaeNwParams()); EXPECT_TRUE(status.isOk()); } @@ -380,10 +385,10 @@ TEST_P(HostapdAidl, AddSAEAccessPointWithoutAcs) { */ TEST_P(HostapdAidl, RemoveAccessPointWithAcs) { if (!isAcsSupport) GTEST_SKIP() << "Missing ACS support"; - auto status = hostapd->addAccessPoint(getIfaceParamsWithAcs(kIfaceName), - getPskNwParams()); + std::string ifname = setupApIfaceAndGetName(false); + auto status = hostapd->addAccessPoint(getIfaceParamsWithAcs(ifname), getPskNwParams()); EXPECT_TRUE(status.isOk()); - EXPECT_TRUE(hostapd->removeAccessPoint(kIfaceName).isOk()); + EXPECT_TRUE(hostapd->removeAccessPoint(ifname).isOk()); } /** @@ -391,10 +396,10 @@ TEST_P(HostapdAidl, RemoveAccessPointWithAcs) { * Access point creation & removal should pass. */ TEST_P(HostapdAidl, RemoveAccessPointWithoutAcs) { - auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(kIfaceName), - getPskNwParams()); + std::string ifname = setupApIfaceAndGetName(false); + auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(ifname), getPskNwParams()); EXPECT_TRUE(status.isOk()); - EXPECT_TRUE(hostapd->removeAccessPoint(kIfaceName).isOk()); + EXPECT_TRUE(hostapd->removeAccessPoint(ifname).isOk()); } /** @@ -402,8 +407,9 @@ TEST_P(HostapdAidl, RemoveAccessPointWithoutAcs) { * Access point creation should fail. */ TEST_P(HostapdAidl, AddPskAccessPointWithInvalidChannel) { - auto status = hostapd->addAccessPoint( - getIfaceParamsWithInvalidChannel(kIfaceName), getPskNwParams()); + std::string ifname = setupApIfaceAndGetName(false); + auto status = + hostapd->addAccessPoint(getIfaceParamsWithInvalidChannel(ifname), getPskNwParams()); EXPECT_FALSE(status.isOk()); } @@ -412,8 +418,9 @@ TEST_P(HostapdAidl, AddPskAccessPointWithInvalidChannel) { * Access point creation should fail. */ TEST_P(HostapdAidl, AddInvalidPskAccessPointWithoutAcs) { - auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(kIfaceName), - getInvalidPskNwParams()); + std::string ifname = setupApIfaceAndGetName(false); + auto status = + hostapd->addAccessPoint(getIfaceParamsWithoutAcs(ifname), getInvalidPskNwParams()); EXPECT_FALSE(status.isOk()); } @@ -422,8 +429,9 @@ TEST_P(HostapdAidl, AddInvalidPskAccessPointWithoutAcs) { * Access point creation should fail. */ TEST_P(HostapdAidl, AddInvalidSaeTransitionAccessPointWithoutAcs) { + std::string ifname = setupApIfaceAndGetName(false); if (!isWpa3SaeSupport) GTEST_SKIP() << "Missing SAE support"; - auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(kIfaceName), + auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(ifname), getInvalidSaeTransitionNwParams()); EXPECT_FALSE(status.isOk()); } @@ -433,9 +441,10 @@ TEST_P(HostapdAidl, AddInvalidSaeTransitionAccessPointWithoutAcs) { * Access point creation should fail. */ TEST_P(HostapdAidl, AddInvalidSaeAccessPointWithoutAcs) { + std::string ifname = setupApIfaceAndGetName(false); if (!isWpa3SaeSupport) GTEST_SKIP() << "Missing SAE support"; - auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(kIfaceName), - getInvalidSaeNwParams()); + auto status = + hostapd->addAccessPoint(getIfaceParamsWithoutAcs(ifname), getInvalidSaeNwParams()); EXPECT_FALSE(status.isOk()); } @@ -443,12 +452,11 @@ TEST_P(HostapdAidl, AddInvalidSaeAccessPointWithoutAcs) { * forceClientDisconnect should fail when hotspot interface available. */ TEST_P(HostapdAidl, DisconnectClientWhenIfacAvailable) { - auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(kIfaceName), - getOpenNwParams()); + std::string ifname = setupApIfaceAndGetName(false); + auto status = hostapd->addAccessPoint(getIfaceParamsWithoutAcs(ifname), getOpenNwParams()); EXPECT_TRUE(status.isOk()); - status = hostapd->forceClientDisconnect(kIfaceName, kTestZeroMacAddr, - kTestDisconnectReasonCode); + status = hostapd->forceClientDisconnect(ifname, kTestZeroMacAddr, kTestDisconnectReasonCode); EXPECT_FALSE(status.isOk()); } -- GitLab From 7056b24f8d0ae5dd806a15d2fe690196a5f1861d Mon Sep 17 00:00:00 2001 From: Frederick Mayle Date: Tue, 29 Mar 2022 02:38:12 +0000 Subject: [PATCH 712/825] evs: Fix double ownership of FrameHandler and FrameHandlerUltrasonics Using std::make_shared with ndk::SharedRefBase objects causes memory errors. Test: TH Bug: 226379467 Change-Id: I7ee1f4f4fe00fde23d502345c7e2760c7d671390 --- .../evs/aidl/vts/VtsHalEvsTargetTest.cpp | 66 ++++++++++--------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp index c709d40690..7fcac38aea 100644 --- a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp +++ b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp @@ -430,8 +430,8 @@ TEST_P(EvsAidlTest, CameraStreamPerformance) { mActiveCameras.push_back(pCam); // Set up a frame receiver object which will fire up its own thread - std::shared_ptr frameHandler = - std::make_shared(pCam, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandler = ndk::SharedRefBase::make( + pCam, cam, nullptr, FrameHandler::eAutoReturn); EXPECT_NE(frameHandler, nullptr); // Start the camera's video stream @@ -529,8 +529,8 @@ TEST_P(EvsAidlTest, CameraStreamBuffering) { ASSERT_TRUE(pCam->setMaxFramesInFlight(kBuffersToHold).isOk()); // Set up a frame receiver object which will fire up its own thread. - std::shared_ptr frameHandler = - std::make_shared(pCam, cam, nullptr, FrameHandler::eNoAutoReturn); + std::shared_ptr frameHandler = ndk::SharedRefBase::make( + pCam, cam, nullptr, FrameHandler::eNoAutoReturn); EXPECT_NE(frameHandler, nullptr); // Start the camera's video stream @@ -619,8 +619,8 @@ TEST_P(EvsAidlTest, CameraToDisplayRoundTrip) { mActiveCameras.push_back(pCam); // Set up a frame receiver object which will fire up its own thread. - std::shared_ptr frameHandler = - std::make_shared(pCam, cam, pDisplay, FrameHandler::eAutoReturn); + std::shared_ptr frameHandler = ndk::SharedRefBase::make( + pCam, cam, pDisplay, FrameHandler::eAutoReturn); EXPECT_NE(frameHandler, nullptr); // Activate the display @@ -697,10 +697,10 @@ TEST_P(EvsAidlTest, MultiCameraStream) { mActiveCameras.push_back(pCam1); // Set up per-client frame receiver objects which will fire up its own thread - std::shared_ptr frameHandler0 = - std::make_shared(pCam0, cam, nullptr, FrameHandler::eAutoReturn); - std::shared_ptr frameHandler1 = - std::make_shared(pCam1, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandler0 = ndk::SharedRefBase::make( + pCam0, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandler1 = ndk::SharedRefBase::make( + pCam1, cam, nullptr, FrameHandler::eAutoReturn); EXPECT_NE(frameHandler0, nullptr); EXPECT_NE(frameHandler1, nullptr); @@ -803,8 +803,8 @@ TEST_P(EvsAidlTest, CameraParameter) { } // Set up per-client frame receiver objects which will fire up its own thread - std::shared_ptr frameHandler = - std::make_shared(pCam, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandler = ndk::SharedRefBase::make( + pCam, cam, nullptr, FrameHandler::eAutoReturn); EXPECT_NE(frameHandler, nullptr); // Start the camera's video stream @@ -903,10 +903,11 @@ TEST_P(EvsAidlTest, CameraPrimaryClientRelease) { mActiveCameras.push_back(pSecondaryCam); // Set up per-client frame receiver objects which will fire up its own thread - std::shared_ptr frameHandlerPrimary = std::make_shared( + std::shared_ptr frameHandlerPrimary = ndk::SharedRefBase::make( pPrimaryCam, cam, nullptr, FrameHandler::eAutoReturn); - std::shared_ptr frameHandlerSecondary = std::make_shared( - pSecondaryCam, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandlerSecondary = + ndk::SharedRefBase::make(pSecondaryCam, cam, nullptr, + FrameHandler::eAutoReturn); EXPECT_NE(frameHandlerPrimary, nullptr); EXPECT_NE(frameHandlerSecondary, nullptr); @@ -1075,10 +1076,11 @@ TEST_P(EvsAidlTest, MultiCameraParameter) { } // Set up per-client frame receiver objects which will fire up its own thread - std::shared_ptr frameHandlerPrimary = std::make_shared( + std::shared_ptr frameHandlerPrimary = ndk::SharedRefBase::make( pPrimaryCam, cam, nullptr, FrameHandler::eAutoReturn); - std::shared_ptr frameHandlerSecondary = std::make_shared( - pSecondaryCam, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandlerSecondary = + ndk::SharedRefBase::make(pSecondaryCam, cam, nullptr, + FrameHandler::eAutoReturn); EXPECT_NE(frameHandlerPrimary, nullptr); EXPECT_NE(frameHandlerSecondary, nullptr); @@ -1418,10 +1420,10 @@ TEST_P(EvsAidlTest, HighPriorityCameraClient) { } // Set up a frame receiver object which will fire up its own thread. - std::shared_ptr frameHandler0 = - std::make_shared(pCam0, cam, nullptr, FrameHandler::eAutoReturn); - std::shared_ptr frameHandler1 = - std::make_shared(pCam1, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandler0 = ndk::SharedRefBase::make( + pCam0, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandler1 = ndk::SharedRefBase::make( + pCam1, cam, nullptr, FrameHandler::eAutoReturn); EXPECT_NE(frameHandler0, nullptr); EXPECT_NE(frameHandler1, nullptr); @@ -1733,8 +1735,8 @@ TEST_P(EvsAidlTest, CameraUseStreamConfigToDisplay) { mActiveCameras.push_back(pCam); // Set up a frame receiver object which will fire up its own thread. - std::shared_ptr frameHandler = - std::make_shared(pCam, cam, pDisplay, FrameHandler::eAutoReturn); + std::shared_ptr frameHandler = ndk::SharedRefBase::make( + pCam, cam, pDisplay, FrameHandler::eAutoReturn); EXPECT_NE(frameHandler, nullptr); // Activate the display @@ -1843,10 +1845,10 @@ TEST_P(EvsAidlTest, MultiCameraStreamUseConfig) { EXPECT_NE(pCam1, nullptr); // Set up per-client frame receiver objects which will fire up its own thread - std::shared_ptr frameHandler0 = - std::make_shared(pCam0, cam, nullptr, FrameHandler::eAutoReturn); - std::shared_ptr frameHandler1 = - std::make_shared(pCam1, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandler0 = ndk::SharedRefBase::make( + pCam0, cam, nullptr, FrameHandler::eAutoReturn); + std::shared_ptr frameHandler1 = ndk::SharedRefBase::make( + pCam1, cam, nullptr, FrameHandler::eAutoReturn); EXPECT_NE(frameHandler0, nullptr); EXPECT_NE(frameHandler1, nullptr); @@ -2008,8 +2010,8 @@ TEST_P(EvsAidlTest, CameraStreamExternalBuffering) { EXPECT_GE(delta, kBuffersToHold); // Set up a frame receiver object which will fire up its own thread. - std::shared_ptr frameHandler = - std::make_shared(pCam, cam, nullptr, FrameHandler::eNoAutoReturn); + std::shared_ptr frameHandler = ndk::SharedRefBase::make( + pCam, cam, nullptr, FrameHandler::eNoAutoReturn); EXPECT_NE(frameHandler, nullptr); // Start the camera's video stream @@ -2101,7 +2103,7 @@ TEST_P(EvsAidlTest, UltrasonicsVerifyStreamData) { EXPECT_NE(pUltrasonicsArray, nullptr); std::shared_ptr frameHandler = - std::make_shared(pUltrasonicsArray); + ndk::SharedRefBase::make(pUltrasonicsArray); EXPECT_NE(frameHandler, nullptr); // Start stream. @@ -2141,7 +2143,7 @@ TEST_P(EvsAidlTest, UltrasonicsSetFramesInFlight) { ASSERT_TRUE(pUltrasonicsArray->setMaxFramesInFlight(10).isOk()); std::shared_ptr frameHandler = - std::make_shared(pUltrasonicsArray); + ndk::SharedRefBase::make(pUltrasonicsArray); EXPECT_NE(frameHandler, nullptr); // Start stream. -- GitLab From 10651a6e68803e0591e59e64a4d83d65b17f9d81 Mon Sep 17 00:00:00 2001 From: Nishtha Ahuja Date: Fri, 25 Mar 2022 03:11:03 +0000 Subject: [PATCH 713/825] Add default config for new VHAL properties in Android T. Bug: 218388191 Test: manually tested in KitchenSink app Change-Id: I08b980a272e66d87de134dc37d6916209f4b4374 --- .../default_config/include/DefaultConfig.h | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h index 6ecac704f4..f31ead345c 100644 --- a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +++ b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h @@ -287,6 +287,71 @@ const std::vector kVehicleProperties = { }, .initialValue = {.floatValues = {0.0f}}}, + {.config = + { + .prop = toInt(VehicleProperty::EV_CHARGE_CURRENT_DRAW_LIMIT), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.floatValues = {(float)VehicleUnit::AMPERE}}}, + + {.config = + { + .prop = toInt(VehicleProperty::EV_CHARGE_PERCENT_LIMIT), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {20, 40, 60, 80, 100}, + }, + .initialValue = {.floatValues = {40}}}, + + {.config = + { + .prop = toInt(VehicleProperty::EV_CHARGE_STATE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {2}}}, + + {.config = + { + .prop = toInt(VehicleProperty::EV_CHARGE_SWITCH), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0 /* false */}}}, + + {.config = + { + .prop = toInt(VehicleProperty::EV_CHARGE_TIME_REMAINING), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, + }, + .initialValue = {.int32Values = {20}}}, + + {.config = + { + .prop = toInt(VehicleProperty::EV_REGENERATIVE_BRAKING_STATE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {2}}}, + + {.config = + { + .prop = toInt(VehicleProperty::TRAILER_PRESENT), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {2}}}, + + {.config = + { + .prop = toInt(VehicleProperty::VEHICLE_CURB_WEIGHT), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.int32Values = {30}}}, + {.config = { .prop = toInt(VehicleProperty::RANGE_REMAINING), @@ -818,6 +883,22 @@ const std::vector kVehicleProperties = { }, .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, + {.config = + { + .prop = toInt(VehicleProperty::FRONT_FOG_LIGHTS_STATE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, + + {.config = + { + .prop = toInt(VehicleProperty::REAR_FOG_LIGHTS_STATE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, + {.config = { .prop = toInt(VehicleProperty::HAZARD_LIGHTS_STATE), @@ -850,6 +931,22 @@ const std::vector kVehicleProperties = { }, .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, + {.config = + { + .prop = toInt(VehicleProperty::FRONT_FOG_LIGHTS_SWITCH), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, + + {.config = + { + .prop = toInt(VehicleProperty::REAR_FOG_LIGHTS_SWITCH), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, + {.config = { .prop = toInt(VehicleProperty::HAZARD_LIGHTS_SWITCH), -- GitLab From 11d4ab8f615496869c7f6455f103de6298ac127d Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Thu, 31 Mar 2022 00:08:02 +0000 Subject: [PATCH 714/825] Replace instances of strncpy and sprintf in the wifi vendor HAL with strlcpy and snprintf. Bug: 218897284 Test: m Change-Id: I0a62d1c5043cabcf6a513b8b082ad1d7a1ea451c --- wifi/1.6/default/hidl_struct_util.cpp | 8 ++++---- wifi/1.6/default/wifi_chip.cpp | 26 ++++++++++++++------------ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/wifi/1.6/default/hidl_struct_util.cpp b/wifi/1.6/default/hidl_struct_util.cpp index 45459e2cd3..2112b260f3 100644 --- a/wifi/1.6/default/hidl_struct_util.cpp +++ b/wifi/1.6/default/hidl_struct_util.cpp @@ -1881,7 +1881,7 @@ bool convertHidlNanDataPathInitiatorRequestToLegacy( "ifaceName too long"; return false; } - strncpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); + strlcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); legacy_request->ndp_cfg.security_cfg = (hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN) ? legacy_hal::NAN_DP_CONFIG_SECURITY @@ -1958,7 +1958,7 @@ bool convertHidlNanDataPathInitiatorRequest_1_6ToLegacy( "ifaceName too long"; return false; } - strncpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); + strlcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); legacy_request->ndp_cfg.security_cfg = (hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN) ? legacy_hal::NAN_DP_CONFIG_SECURITY @@ -2039,7 +2039,7 @@ bool convertHidlNanDataPathIndicationResponseToLegacy( "ifaceName too long"; return false; } - strncpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); + strlcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); legacy_request->ndp_cfg.security_cfg = (hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN) ? legacy_hal::NAN_DP_CONFIG_SECURITY @@ -2114,7 +2114,7 @@ bool convertHidlNanDataPathIndicationResponse_1_6ToLegacy( "ifaceName too long"; return false; } - strncpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); + strlcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str(), IFNAMSIZ + 1); legacy_request->ndp_cfg.security_cfg = (hidl_request.securityConfig.securityType != NanDataPathSecurityType::OPEN) ? legacy_hal::NAN_DP_CONFIG_SECURITY diff --git a/wifi/1.6/default/wifi_chip.cpp b/wifi/1.6/default/wifi_chip.cpp index 6cc12358e5..7f0e97df7f 100644 --- a/wifi/1.6/default/wifi_chip.cpp +++ b/wifi/1.6/default/wifi_chip.cpp @@ -131,7 +131,7 @@ std::string getPredefinedP2pIfaceName() { if (strncmp(buffer.data(), P2P_MGMT_DEVICE_PREFIX, strlen(P2P_MGMT_DEVICE_PREFIX)) == 0) { /* Get the p2p parent interface name from p2p device interface name set * in property */ - strncpy(p2pParentIfname, buffer.data() + strlen(P2P_MGMT_DEVICE_PREFIX), + strlcpy(p2pParentIfname, buffer.data() + strlen(P2P_MGMT_DEVICE_PREFIX), strlen(buffer.data()) - strlen(P2P_MGMT_DEVICE_PREFIX)); if (property_get(kActiveWlanIfaceNameProperty, primaryIfaceName.data(), nullptr) == 0) { return buffer.data(); @@ -217,14 +217,15 @@ bool removeOldFilesInternal() { // Helper function for |cpioArchiveFilesInDir| bool cpioWriteHeader(int out_fd, struct stat& st, const char* file_name, size_t file_name_len) { - std::array read_buf; - ssize_t llen = - sprintf(read_buf.data(), "%s%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X", - kCpioMagic, static_cast(st.st_ino), st.st_mode, st.st_uid, st.st_gid, - static_cast(st.st_nlink), static_cast(st.st_mtime), - static_cast(st.st_size), major(st.st_dev), minor(st.st_dev), - major(st.st_rdev), minor(st.st_rdev), static_cast(file_name_len), 0); - if (write(out_fd, read_buf.data(), llen) == -1) { + const int buf_size = 32 * 1024; + std::array 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(st.st_ino), st.st_mode, st.st_uid, st.st_gid, + static_cast(st.st_nlink), static_cast(st.st_mtime), + static_cast(st.st_size), major(st.st_dev), minor(st.st_dev), major(st.st_rdev), + minor(st.st_rdev), static_cast(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; } @@ -282,10 +283,11 @@ size_t cpioWriteFileContent(int fd_read, int out_fd, struct stat& st) { // Helper function for |cpioArchiveFilesInDir| bool cpioWriteFileTrailer(int out_fd) { - std::array read_buf; + const int buf_size = 4096; + std::array read_buf; read_buf.fill(0); - if (write(out_fd, read_buf.data(), - sprintf(read_buf.data(), "070701%040X%056X%08XTRAILER!!!", 1, 0x0b, 0) + 4) == -1) { + 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; } -- GitLab From 03b6daac4a75481aea3cd68e28b154115f029587 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Wed, 23 Mar 2022 18:45:02 +0000 Subject: [PATCH 715/825] Send brightness nits to composer Bug: 220396224 Test: builds, boots Change-Id: I6866422130776ae25d791b3cfd0d1a754d2488b9 --- .../graphics/composer3/ComposerClientWriter.h | 5 +++-- .../vts/VtsHalGraphicsComposer3_ReadbackTest.cpp | 2 +- .../vts/VtsHalGraphicsComposer3_TargetTest.cpp | 14 +++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) 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 ae17c51ea2..1d81f7b602 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -80,8 +80,9 @@ class ComposerClientWriter { getDisplayCommand(display).colorTransformMatrix.emplace(std::move(matVec)); } - void setDisplayBrightness(int64_t display, float brightness) { - getDisplayCommand(display).brightness.emplace(DisplayBrightness{.brightness = brightness}); + void setDisplayBrightness(int64_t display, float brightness, float brightnessNits) { + getDisplayCommand(display).brightness.emplace( + DisplayBrightness{.brightness = brightness, .brightnessNits = brightnessNits}); } void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target, diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp index 147a9eec82..c081199ba6 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -974,7 +974,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBrightnessDims) { // Preconditions to successfully run are knowing the max brightness and successfully applying // the max brightness ASSERT_GT(maxBrightnessNits, 0.f); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.f, maxBrightnessNits); execute(); ASSERT_TRUE(mReader.takeErrors().empty()); diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 2d08ac611b..2cae5a2c93 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1374,7 +1374,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { bool brightnessSupport = std::find(capabilities.begin(), capabilities.end(), DisplayCapability::BRIGHTNESS) != capabilities.end(); if (!brightnessSupport) { - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f, -1.f); execute(); const auto errors = mReader.takeErrors(); EXPECT_EQ(1, errors.size()); @@ -1383,23 +1383,23 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { return; } - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.0f, -1.f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 0.5f, -1.f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.0f, -1.f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -1.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -1.0f, -1.f); execute(); EXPECT_TRUE(mReader.takeErrors().empty()); - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 2.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 2.0f, -1.f); execute(); { const auto errors = mReader.takeErrors(); @@ -1407,7 +1407,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetDisplayBrightness) { EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, errors[0].errorCode); } - mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -2.0f); + mWriter.setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ -2.0f, -1.f); execute(); { const auto errors = mReader.takeErrors(); -- GitLab From 55f76ca7afcf6ea027486624387a39fe8ee0a1c3 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Thu, 24 Mar 2022 20:05:25 +0000 Subject: [PATCH 716/825] Update renderengine dependency to VTS Bug: 218954037 Test: builds Change-Id: I31f8a8764fa66a9aec4762354c425ba1442ef351 Merged-In: I31f8a8764fa66a9aec4762354c425ba1442ef351 --- graphics/composer/2.2/utils/vts/Android.bp | 1 + graphics/composer/2.2/vts/functional/Android.bp | 1 + 2 files changed, 2 insertions(+) diff --git a/graphics/composer/2.2/utils/vts/Android.bp b/graphics/composer/2.2/utils/vts/Android.bp index 4faf84bcdd..aa8e541edb 100644 --- a/graphics/composer/2.2/utils/vts/Android.bp +++ b/graphics/composer/2.2/utils/vts/Android.bp @@ -37,6 +37,7 @@ cc_library_static { static_libs: [ "android.hardware.graphics.composer@2.1-vts", "android.hardware.graphics.composer@2.2", + "android.hardware.graphics.composer3-V1-ndk", "android.hardware.graphics.mapper@2.1-vts", "libarect", "libgtest", diff --git a/graphics/composer/2.2/vts/functional/Android.bp b/graphics/composer/2.2/vts/functional/Android.bp index 7af0fb4724..dd519e7e6e 100644 --- a/graphics/composer/2.2/vts/functional/Android.bp +++ b/graphics/composer/2.2/vts/functional/Android.bp @@ -65,6 +65,7 @@ cc_test { "android.hardware.graphics.composer@2.1-vts", "android.hardware.graphics.composer@2.2", "android.hardware.graphics.composer@2.2-vts", + "android.hardware.graphics.composer3-V1-ndk", "android.hardware.graphics.mapper@2.0-vts", "android.hardware.graphics.mapper@2.1-vts", "android.hardware.graphics.mapper@3.0-vts", -- GitLab From 703e97920e80be235e447410e164132081048b2f Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 22 Mar 2022 14:18:48 +0900 Subject: [PATCH 717/825] Freeze AIDL APIs for TM Bug: 225941299 Test: m Change-Id: Ie41cc0797710f813f92c65c387f247c7806d8394 --- audio/aidl/Android.bp | 7 +- .../android.hardware.audio.common/1/.hash | 1 + .../audio/common/PlaybackTrackMetadata.aidl | 43 ++ .../audio/common/RecordTrackMetadata.aidl | 42 ++ .../hardware/audio/common/SinkMetadata.aidl | 38 ++ .../hardware/audio/common/SourceMetadata.aidl | 38 ++ automotive/audiocontrol/aidl/Android.bp | 19 +- .../2/.hash | 1 + .../audiocontrol/AudioFocusChange.aidl | 45 +++ .../audiocontrol/AudioGainConfigInfo.aidl | 40 ++ .../automotive/audiocontrol/DuckingInfo.aidl | 42 ++ .../audiocontrol/IAudioControl.aidl | 49 +++ .../audiocontrol/IAudioGainCallback.aidl | 38 ++ .../audiocontrol/IFocusListener.aidl | 41 ++ .../automotive/audiocontrol/MutingInfo.aidl | 40 ++ .../automotive/audiocontrol/Reasons.aidl | 47 +++ automotive/evs/aidl/Android.bp | 14 +- .../android.hardware.automotive.evs/1/.hash | 1 + .../hardware/automotive/evs/BufferDesc.aidl | 43 ++ .../hardware/automotive/evs/CameraDesc.aidl | 40 ++ .../hardware/automotive/evs/CameraParam.aidl | 49 +++ .../hardware/automotive/evs/DeviceStatus.aidl | 39 ++ .../automotive/evs/DeviceStatusType.aidl | 41 ++ .../hardware/automotive/evs/DisplayDesc.aidl | 42 ++ .../hardware/automotive/evs/DisplayState.aidl | 42 ++ .../hardware/automotive/evs/EvsEventDesc.aidl | 40 ++ .../hardware/automotive/evs/EvsEventType.aidl | 44 ++ .../hardware/automotive/evs/EvsResult.aidl | 48 +++ .../hardware/automotive/evs/IEvsCamera.aidl | 55 +++ .../automotive/evs/IEvsCameraStream.aidl | 39 ++ .../hardware/automotive/evs/IEvsDisplay.aidl | 42 ++ .../automotive/evs/IEvsEnumerator.aidl | 50 +++ .../evs/IEvsEnumeratorStatusCallback.aidl | 38 ++ .../automotive/evs/IEvsUltrasonicsArray.aidl | 42 ++ .../evs/IEvsUltrasonicsArrayStream.aidl | 39 ++ .../automotive/evs/ParameterRange.aidl | 40 ++ .../hardware/automotive/evs/Rotation.aidl | 41 ++ .../automotive/evs/RotationQuaternion.aidl | 41 ++ .../hardware/automotive/evs/SensorPose.aidl | 39 ++ .../hardware/automotive/evs/Stream.aidl | 45 +++ .../hardware/automotive/evs/StreamType.aidl | 39 ++ .../hardware/automotive/evs/Translation.aidl | 40 ++ .../automotive/evs/UltrasonicSensor.aidl | 40 ++ .../automotive/evs/UltrasonicsArrayDesc.aidl | 41 ++ .../evs/UltrasonicsDataFrameDesc.aidl | 43 ++ .../1/.hash | 1 + .../automotive/vehicle/CreateUserRequest.aidl | 41 ++ .../vehicle/CreateUserResponse.aidl | 40 ++ .../automotive/vehicle/CreateUserStatus.aidl | 39 ++ .../automotive/vehicle/CustomInputType.aidl | 47 +++ .../vehicle/DiagnosticFloatSensorIndex.aidl | 108 +++++ .../vehicle/DiagnosticIntegerSensorIndex.aidl | 69 ++++ .../ElectronicTollCollectionCardStatus.aidl | 41 ++ .../ElectronicTollCollectionCardType.aidl | 40 ++ .../automotive/vehicle/EvChargeState.aidl | 42 ++ .../automotive/vehicle/EvConnectorType.aidl | 50 +++ .../vehicle/EvRegenerativeBrakingState.aidl | 41 ++ .../vehicle/EvsServiceRequestIndex.aidl | 39 ++ .../automotive/vehicle/EvsServiceState.aidl | 39 ++ .../automotive/vehicle/EvsServiceType.aidl | 39 ++ .../hardware/automotive/vehicle/FuelType.aidl | 50 +++ .../automotive/vehicle/GetValueRequest.aidl | 39 ++ .../automotive/vehicle/GetValueRequests.aidl | 39 ++ .../automotive/vehicle/GetValueResult.aidl | 40 ++ .../automotive/vehicle/GetValueResults.aidl | 39 ++ .../hardware/automotive/vehicle/IVehicle.aidl | 46 +++ .../automotive/vehicle/IVehicleCallback.aidl | 41 ++ .../vehicle/InitialUserInfoRequest.aidl | 40 ++ .../vehicle/InitialUserInfoRequestType.aidl | 42 ++ .../vehicle/InitialUserInfoResponse.aidl | 42 ++ .../InitialUserInfoResponseAction.aidl | 40 ++ .../vehicle/Obd2CommonIgnitionMonitors.aidl | 43 ++ .../Obd2CompressionIgnitionMonitors.aidl | 55 +++ .../vehicle/Obd2FuelSystemStatus.aidl | 42 ++ .../automotive/vehicle/Obd2FuelType.aidl | 61 +++ .../vehicle/Obd2IgnitionMonitorKind.aidl | 39 ++ .../vehicle/Obd2SecondaryAirStatus.aidl | 41 ++ .../vehicle/Obd2SparkIgnitionMonitors.aidl | 59 +++ .../automotive/vehicle/PortLocationType.aidl | 44 ++ .../vehicle/ProcessTerminationReason.aidl | 40 ++ .../automotive/vehicle/RawPropValues.aidl | 42 ++ .../automotive/vehicle/RemoveUserRequest.aidl | 40 ++ .../automotive/vehicle/RotaryInputType.aidl | 39 ++ .../automotive/vehicle/SetValueRequest.aidl | 39 ++ .../automotive/vehicle/SetValueRequests.aidl | 39 ++ .../automotive/vehicle/SetValueResult.aidl | 39 ++ .../automotive/vehicle/SetValueResults.aidl | 39 ++ .../automotive/vehicle/StatusCode.aidl | 43 ++ .../automotive/vehicle/SubscribeOptions.aidl | 40 ++ .../vehicle/SwitchUserMessageType.aidl | 43 ++ .../automotive/vehicle/SwitchUserRequest.aidl | 41 ++ .../vehicle/SwitchUserResponse.aidl | 41 ++ .../automotive/vehicle/SwitchUserStatus.aidl | 39 ++ .../automotive/vehicle/TrailerState.aidl | 41 ++ .../UserIdentificationAssociation.aidl | 39 ++ ...UserIdentificationAssociationSetValue.aidl | 41 ++ .../UserIdentificationAssociationType.aidl | 43 ++ .../UserIdentificationAssociationValue.aidl | 41 ++ .../vehicle/UserIdentificationGetRequest.aidl | 41 ++ .../vehicle/UserIdentificationResponse.aidl | 41 ++ .../UserIdentificationSetAssociation.aidl | 39 ++ .../vehicle/UserIdentificationSetRequest.aidl | 41 ++ .../hardware/automotive/vehicle/UserInfo.aidl | 45 +++ .../automotive/vehicle/UsersInfo.aidl | 40 ++ .../VehicleApPowerStateConfigFlag.aidl | 40 ++ .../vehicle/VehicleApPowerStateReport.aidl | 47 +++ .../vehicle/VehicleApPowerStateReq.aidl | 41 ++ .../vehicle/VehicleApPowerStateReqIndex.aidl | 39 ++ .../VehicleApPowerStateShutdownParam.aidl | 43 ++ .../automotive/vehicle/VehicleArea.aidl | 44 ++ .../automotive/vehicle/VehicleAreaConfig.aidl | 44 ++ .../automotive/vehicle/VehicleAreaDoor.aidl | 45 +++ .../automotive/vehicle/VehicleAreaMirror.aidl | 40 ++ .../automotive/vehicle/VehicleAreaSeat.aidl | 46 +++ .../automotive/vehicle/VehicleAreaWheel.aidl | 42 ++ .../automotive/vehicle/VehicleAreaWindow.aidl | 47 +++ .../automotive/vehicle/VehicleDisplay.aidl | 39 ++ .../automotive/vehicle/VehicleGear.aidl | 51 +++ .../vehicle/VehicleHvacFanDirection.aidl | 43 ++ .../vehicle/VehicleHwKeyInputAction.aidl | 39 ++ .../vehicle/VehicleIgnitionState.aidl | 43 ++ .../automotive/vehicle/VehicleLightState.aidl | 40 ++ .../vehicle/VehicleLightSwitch.aidl | 41 ++ .../automotive/vehicle/VehicleOilLevel.aidl | 42 ++ .../automotive/vehicle/VehiclePropConfig.aidl | 45 +++ .../vehicle/VehiclePropConfigs.aidl | 39 ++ .../automotive/vehicle/VehiclePropError.aidl | 40 ++ .../automotive/vehicle/VehiclePropErrors.aidl | 39 ++ .../automotive/vehicle/VehiclePropValue.aidl | 42 ++ .../automotive/vehicle/VehiclePropValues.aidl | 40 ++ .../automotive/vehicle/VehicleProperty.aidl | 209 ++++++++++ .../vehicle/VehiclePropertyAccess.aidl | 41 ++ .../vehicle/VehiclePropertyChangeMode.aidl | 40 ++ .../vehicle/VehiclePropertyGroup.aidl | 40 ++ .../vehicle/VehiclePropertyStatus.aidl | 40 ++ .../vehicle/VehiclePropertyType.aidl | 48 +++ .../vehicle/VehicleSeatOccupancyState.aidl | 40 ++ .../automotive/vehicle/VehicleTurnSignal.aidl | 40 ++ .../automotive/vehicle/VehicleUnit.aidl | 70 ++++ .../vehicle/VehicleVendorPermission.aidl | 75 ++++ ...msAvailabilityStateIntegerValuesIndex.aidl | 41 ++ .../VmsBaseMessageIntegerValuesIndex.aidl | 38 ++ .../automotive/vehicle/VmsMessageType.aidl | 54 +++ ...LayerAndPublisherIdIntegerValuesIndex.aidl | 42 ++ ...VmsMessageWithLayerIntegerValuesIndex.aidl | 41 ++ .../VmsOfferingMessageIntegerValuesIndex.aidl | 41 ++ ...ublisherInformationIntegerValuesIndex.aidl | 39 ++ ...StartSessionMessageIntegerValuesIndex.aidl | 40 ++ ...sSubscriptionsStateIntegerValuesIndex.aidl | 42 ++ biometrics/face/aidl/Android.bp | 21 +- .../android.hardware.biometrics.face/2/.hash | 1 + .../biometrics/face/AcquiredInfo.aidl | 64 +++ .../biometrics/face/AuthenticationFrame.aidl | 38 ++ .../hardware/biometrics/face/BaseFrame.aidl | 43 ++ .../hardware/biometrics/face/Cell.aidl | 40 ++ .../biometrics/face/EnrollmentFrame.aidl | 40 ++ .../biometrics/face/EnrollmentStage.aidl | 44 ++ .../face/EnrollmentStageConfig.aidl | 39 ++ .../biometrics/face/EnrollmentType.aidl | 39 ++ .../hardware/biometrics/face/Error.aidl | 46 +++ .../biometrics/face/FaceSensorType.aidl | 40 ++ .../hardware/biometrics/face/Feature.aidl | 40 ++ .../hardware/biometrics/face/IFace.aidl | 39 ++ .../hardware/biometrics/face/ISession.aidl | 55 +++ .../biometrics/face/ISessionCallback.aidl | 56 +++ .../hardware/biometrics/face/SensorProps.aidl | 47 +++ biometrics/fingerprint/aidl/Android.bp | 19 +- .../2/.hash | 1 + .../biometrics/fingerprint/AcquiredInfo.aidl | 50 +++ .../biometrics/fingerprint/Error.aidl | 46 +++ .../fingerprint/FingerprintSensorType.aidl | 43 ++ .../biometrics/fingerprint/IFingerprint.aidl | 39 ++ .../biometrics/fingerprint/ISession.aidl | 57 +++ .../fingerprint/ISessionCallback.aidl | 53 +++ .../fingerprint/PointerContext.aidl | 46 +++ .../fingerprint/SensorLocation.aidl | 42 ++ .../biometrics/fingerprint/SensorProps.aidl | 44 ++ bluetooth/audio/aidl/Android.bp | 11 + .../android.hardware.bluetooth.audio/1/.hash | 1 + .../bluetooth/audio/AacCapabilities.aidl | 42 ++ .../bluetooth/audio/AacConfiguration.aidl | 42 ++ .../bluetooth/audio/AacObjectType.aidl | 41 ++ .../audio/AptxAdaptiveCapabilities.aidl | 46 +++ .../audio/AptxAdaptiveChannelMode.aidl | 42 ++ .../audio/AptxAdaptiveConfiguration.aidl | 46 +++ .../audio/AptxAdaptiveInputMode.aidl | 39 ++ .../audio/AptxAdaptiveTimeToPlay.aidl | 43 ++ .../bluetooth/audio/AptxCapabilities.aidl | 40 ++ .../bluetooth/audio/AptxConfiguration.aidl | 40 ++ .../hardware/bluetooth/audio/AptxMode.aidl | 41 ++ .../bluetooth/audio/AptxSinkBuffering.aidl | 43 ++ .../bluetooth/audio/AudioCapabilities.aidl | 40 ++ .../bluetooth/audio/AudioConfiguration.aidl | 41 ++ .../bluetooth/audio/AudioLocation.aidl | 40 ++ .../bluetooth/audio/BluetoothAudioStatus.aidl | 42 ++ .../bluetooth/audio/BroadcastCapability.aidl | 50 +++ .../hardware/bluetooth/audio/ChannelMode.aidl | 40 ++ .../bluetooth/audio/CodecCapabilities.aidl | 53 +++ .../bluetooth/audio/CodecConfiguration.aidl | 58 +++ .../hardware/bluetooth/audio/CodecType.aidl | 46 +++ .../bluetooth/audio/IBluetoothAudioPort.aidl | 44 ++ .../audio/IBluetoothAudioProvider.aidl | 43 ++ .../audio/IBluetoothAudioProviderFactory.aidl | 39 ++ .../hardware/bluetooth/audio/LatencyMode.aidl | 40 ++ .../bluetooth/audio/Lc3Capabilities.aidl | 43 ++ .../bluetooth/audio/Lc3Configuration.aidl | 43 ++ .../bluetooth/audio/LdacCapabilities.aidl | 41 ++ .../bluetooth/audio/LdacChannelMode.aidl | 41 ++ .../bluetooth/audio/LdacConfiguration.aidl | 41 ++ .../bluetooth/audio/LdacQualityIndex.aidl | 41 ++ .../audio/LeAudioBroadcastConfiguration.aidl | 45 +++ .../LeAudioCodecCapabilitiesSetting.aidl | 40 ++ .../audio/LeAudioCodecConfiguration.aidl | 43 ++ .../bluetooth/audio/LeAudioConfiguration.aidl | 46 +++ .../bluetooth/audio/PcmCapabilities.aidl | 41 ++ .../bluetooth/audio/PcmConfiguration.aidl | 41 ++ .../bluetooth/audio/PresentationPosition.aidl | 45 +++ .../bluetooth/audio/SbcAllocMethod.aidl | 39 ++ .../bluetooth/audio/SbcCapabilities.aidl | 45 +++ .../bluetooth/audio/SbcChannelMode.aidl | 42 ++ .../bluetooth/audio/SbcConfiguration.aidl | 45 +++ .../hardware/bluetooth/audio/SessionType.aidl | 49 +++ .../bluetooth/audio/UnicastCapability.aidl | 51 +++ camera/device/aidl/Android.bp | 15 +- .../android.hardware.camera.device/1/.hash | 1 + .../hardware/camera/device/BufferCache.aidl | 39 ++ .../hardware/camera/device/BufferRequest.aidl | 39 ++ .../camera/device/BufferRequestStatus.aidl | 42 ++ .../hardware/camera/device/BufferStatus.aidl | 39 ++ .../hardware/camera/device/CameraBlob.aidl | 39 ++ .../hardware/camera/device/CameraBlobId.aidl | 39 ++ .../camera/device/CameraMetadata.aidl | 38 ++ .../device/CameraOfflineSessionInfo.aidl | 39 ++ .../camera/device/CaptureRequest.aidl | 45 +++ .../hardware/camera/device/CaptureResult.aidl | 44 ++ .../hardware/camera/device/ErrorCode.aidl | 41 ++ .../hardware/camera/device/ErrorMsg.aidl | 40 ++ .../hardware/camera/device/HalStream.aidl | 45 +++ .../hardware/camera/device/ICameraDevice.aidl | 46 +++ .../camera/device/ICameraDeviceCallback.aidl | 41 ++ .../camera/device/ICameraDeviceSession.aidl | 48 +++ .../device/ICameraInjectionSession.aidl | 39 ++ .../camera/device/ICameraOfflineSession.aidl | 40 ++ .../hardware/camera/device/NotifyMsg.aidl | 39 ++ .../camera/device/OfflineRequest.aidl | 39 ++ .../hardware/camera/device/OfflineStream.aidl | 40 ++ .../camera/device/PhysicalCameraMetadata.aidl | 40 ++ .../camera/device/PhysicalCameraSetting.aidl | 40 ++ .../camera/device/RequestTemplate.aidl | 44 ++ .../hardware/camera/device/ShutterMsg.aidl | 40 ++ .../hardware/camera/device/Stream.aidl | 51 +++ .../hardware/camera/device/StreamBuffer.aidl | 43 ++ .../device/StreamBufferRequestError.aidl | 41 ++ .../camera/device/StreamBufferRet.aidl | 39 ++ .../camera/device/StreamBuffersVal.aidl | 39 ++ .../camera/device/StreamConfiguration.aidl | 42 ++ .../device/StreamConfigurationMode.aidl | 47 +++ .../camera/device/StreamRotation.aidl | 41 ++ .../hardware/camera/device/StreamType.aidl | 39 ++ .../android.hardware.camera.metadata/1/.hash | 1 + .../camera/metadata/AutomotiveLensFacing.aidl | 56 +++ .../camera/metadata/AutomotiveLocation.aidl | 52 +++ .../camera/metadata/BlackLevelLock.aidl | 43 ++ .../metadata/CameraMetadataSection.aidl | 74 ++++ .../metadata/CameraMetadataSectionStart.aidl | 74 ++++ .../camera/metadata/CameraMetadataTag.aidl | 331 +++++++++++++++ .../ColorCorrectionAberrationMode.aidl | 44 ++ .../camera/metadata/ColorCorrectionMode.aidl | 44 ++ .../metadata/ControlAeAntibandingMode.aidl | 45 +++ .../camera/metadata/ControlAeLock.aidl | 43 ++ .../metadata/ControlAeLockAvailable.aidl | 43 ++ .../camera/metadata/ControlAeMode.aidl | 47 +++ .../metadata/ControlAePrecaptureTrigger.aidl | 44 ++ .../camera/metadata/ControlAeState.aidl | 47 +++ .../camera/metadata/ControlAfMode.aidl | 47 +++ .../camera/metadata/ControlAfSceneChange.aidl | 43 ++ .../camera/metadata/ControlAfState.aidl | 48 +++ .../camera/metadata/ControlAfTrigger.aidl | 44 ++ .../camera/metadata/ControlAwbLock.aidl | 43 ++ .../metadata/ControlAwbLockAvailable.aidl | 43 ++ .../camera/metadata/ControlAwbMode.aidl | 50 +++ .../camera/metadata/ControlAwbState.aidl | 45 +++ .../camera/metadata/ControlCaptureIntent.aidl | 49 +++ .../camera/metadata/ControlEffectMode.aidl | 50 +++ .../camera/metadata/ControlEnableZsl.aidl | 43 ++ .../metadata/ControlExtendedSceneMode.aidl | 45 +++ .../hardware/camera/metadata/ControlMode.aidl | 46 +++ .../camera/metadata/ControlSceneMode.aidl | 63 +++ .../ControlVideoStabilizationMode.aidl | 44 ++ .../camera/metadata/DemosaicMode.aidl | 43 ++ ...pthAvailableDepthStreamConfigurations.aidl | 43 ++ ...StreamConfigurationsMaximumResolution.aidl | 43 ++ ...lableDynamicDepthStreamConfigurations.aidl | 43 ++ ...StreamConfigurationsMaximumResolution.aidl | 43 ++ .../metadata/DepthDepthIsExclusive.aidl | 43 ++ .../metadata/DistortionCorrectionMode.aidl | 44 ++ .../hardware/camera/metadata/EdgeMode.aidl | 45 +++ .../camera/metadata/FlashInfoAvailable.aidl | 43 ++ .../hardware/camera/metadata/FlashMode.aidl | 44 ++ .../hardware/camera/metadata/FlashState.aidl | 46 +++ ...HeicAvailableHeicStreamConfigurations.aidl | 43 ++ ...StreamConfigurationsMaximumResolution.aidl | 43 ++ .../camera/metadata/HeicInfoSupported.aidl | 43 ++ .../camera/metadata/HotPixelMode.aidl | 44 ++ .../InfoSupportedBufferManagementVersion.aidl | 42 ++ .../metadata/InfoSupportedHardwareLevel.aidl | 46 +++ .../camera/metadata/LedAvailableLeds.aidl | 42 ++ .../hardware/camera/metadata/LedTransmit.aidl | 43 ++ .../hardware/camera/metadata/LensFacing.aidl | 44 ++ .../LensInfoFocusDistanceCalibration.aidl | 44 ++ .../LensOpticalStabilizationMode.aidl | 43 ++ .../camera/metadata/LensPoseReference.aidl | 45 +++ .../hardware/camera/metadata/LensState.aidl | 43 ++ .../LogicalMultiCameraSensorSyncType.aidl | 43 ++ .../camera/metadata/NoiseReductionMode.aidl | 46 +++ .../camera/metadata/QuirksPartialResult.aidl | 43 ++ .../RequestAvailableCapabilities.aidl | 61 +++ ...questAvailableDynamicRangeProfilesMap.aidl | 54 +++ .../camera/metadata/RequestMetadataMode.aidl | 43 ++ .../hardware/camera/metadata/RequestType.aidl | 43 ++ .../metadata/ScalerAvailableFormats.aidl | 51 +++ ...ilableRecommendedStreamConfigurations.aidl | 50 +++ .../ScalerAvailableStreamConfigurations.aidl | 43 ++ ...StreamConfigurationsMaximumResolution.aidl | 43 ++ .../ScalerAvailableStreamUseCases.aidl | 48 +++ .../camera/metadata/ScalerCroppingType.aidl | 43 ++ .../ScalerMultiResolutionStreamSupported.aidl | 43 ++ ...raMultiResolutionStreamConfigurations.aidl | 43 ++ .../camera/metadata/ScalerRotateAndCrop.aidl | 46 +++ .../SensorInfoColorFilterArrangement.aidl | 48 +++ .../SensorInfoLensShadingApplied.aidl | 43 ++ .../metadata/SensorInfoTimestampSource.aidl | 43 ++ .../camera/metadata/SensorPixelMode.aidl | 43 ++ .../metadata/SensorRawBinningFactorUsed.aidl | 43 ++ .../metadata/SensorReferenceIlluminant1.aidl | 60 +++ .../metadata/SensorTestPatternMode.aidl | 48 +++ .../hardware/camera/metadata/ShadingMode.aidl | 44 ++ .../metadata/StatisticsFaceDetectMode.aidl | 44 ++ .../metadata/StatisticsHistogramMode.aidl | 43 ++ .../metadata/StatisticsHotPixelMapMode.aidl | 43 ++ .../StatisticsLensShadingMapMode.aidl | 43 ++ .../metadata/StatisticsOisDataMode.aidl | 43 ++ .../metadata/StatisticsSceneFlicker.aidl | 44 ++ .../metadata/StatisticsSharpnessMapMode.aidl | 43 ++ .../camera/metadata/SyncFrameNumber.aidl | 43 ++ .../camera/metadata/SyncMaxLatency.aidl | 43 ++ .../hardware/camera/metadata/TonemapMode.aidl | 46 +++ .../camera/metadata/TonemapPresetCurve.aidl | 43 ++ camera/provider/aidl/Android.bp | 12 +- .../android.hardware.camera.provider/1/.hash | 1 + .../CameraIdAndStreamCombination.aidl | 39 ++ .../ConcurrentCameraIdCombination.aidl | 38 ++ .../camera/provider/ICameraProvider.aidl | 48 +++ .../provider/ICameraProviderCallback.aidl | 40 ++ gnss/aidl/Android.bp | 5 + .../aidl_api/android.hardware.gnss/2/.hash | 1 + .../hardware/gnss/BlocklistedSource.aidl | 40 ++ .../hardware/gnss/CorrelationVector.aidl | 42 ++ .../hardware/gnss/ElapsedRealtime.aidl | 43 ++ .../2/android/hardware/gnss/GnssClock.aidl | 56 +++ .../hardware/gnss/GnssConstellationType.aidl | 46 +++ .../2/android/hardware/gnss/GnssData.aidl | 48 +++ .../2/android/hardware/gnss/GnssLocation.aidl | 58 +++ .../hardware/gnss/GnssMeasurement.aidl | 99 +++++ .../hardware/gnss/GnssMultipathIndicator.aidl | 41 ++ .../android/hardware/gnss/GnssPowerStats.aidl | 45 +++ .../android/hardware/gnss/GnssSignalType.aidl | 57 +++ .../2/android/hardware/gnss/IAGnss.aidl | 50 +++ .../android/hardware/gnss/IAGnssCallback.aidl | 54 +++ .../2/android/hardware/gnss/IAGnssRil.aidl | 80 ++++ .../hardware/gnss/IAGnssRilCallback.aidl | 40 ++ .../2/android/hardware/gnss/IGnss.aidl | 103 +++++ .../hardware/gnss/IGnssAntennaInfo.aidl | 40 ++ .../gnss/IGnssAntennaInfoCallback.aidl | 61 +++ .../android/hardware/gnss/IGnssBatching.aidl | 51 +++ .../hardware/gnss/IGnssBatchingCallback.aidl | 39 ++ .../android/hardware/gnss/IGnssCallback.aidl | 95 +++++ .../hardware/gnss/IGnssConfiguration.aidl | 52 +++ .../2/android/hardware/gnss/IGnssDebug.aidl | 88 ++++ .../android/hardware/gnss/IGnssGeofence.aidl | 43 ++ .../hardware/gnss/IGnssGeofenceCallback.aidl | 55 +++ .../gnss/IGnssMeasurementCallback.aidl | 39 ++ .../gnss/IGnssMeasurementInterface.aidl | 47 +++ .../gnss/IGnssNavigationMessageCallback.aidl | 69 ++++ .../gnss/IGnssNavigationMessageInterface.aidl | 40 ++ .../hardware/gnss/IGnssPowerIndication.aidl | 40 ++ .../gnss/IGnssPowerIndicationCallback.aidl | 46 +++ .../2/android/hardware/gnss/IGnssPsds.aidl | 40 ++ .../hardware/gnss/IGnssPsdsCallback.aidl | 39 ++ .../2/android/hardware/gnss/PsdsType.aidl | 41 ++ .../hardware/gnss/SatelliteClockInfo.aidl | 41 ++ .../hardware/gnss/SatellitePositionEcef.aidl | 42 ++ .../2/android/hardware/gnss/SatellitePvt.aidl | 59 +++ .../hardware/gnss/SatelliteVelocityEcef.aidl | 42 ++ .../IMeasurementCorrectionsCallback.aidl | 42 ++ .../IMeasurementCorrectionsInterface.aidl | 40 ++ .../MeasurementCorrections.aidl | 48 +++ .../ReflectingPlane.aidl | 42 ++ .../SingleSatCorrection.aidl | 63 +++ .../IGnssVisibilityControl.aidl | 40 ++ .../IGnssVisibilityControlCallback.aidl | 75 ++++ .../android.hardware.graphics.common/3/.hash | 1 + .../graphics/common/AlphaInterpretation.aidl | 40 ++ .../hardware/graphics/common/BlendMode.aidl | 42 ++ .../hardware/graphics/common/BufferUsage.aidl | 65 +++ .../graphics/common/ChromaSiting.aidl | 42 ++ .../graphics/common/ColorTransform.aidl | 45 +++ .../hardware/graphics/common/Compression.aidl | 40 ++ .../hardware/graphics/common/Cta861_3.aidl | 40 ++ .../hardware/graphics/common/Dataspace.aidl | 98 +++++ .../common/DisplayDecorationSupport.aidl | 40 ++ .../graphics/common/ExtendableType.aidl | 40 ++ .../hardware/graphics/common/FRect.aidl | 42 ++ .../graphics/common/HardwareBuffer.aidl | 40 ++ .../common/HardwareBufferDescription.aidl | 44 ++ .../android/hardware/graphics/common/Hdr.aidl | 42 ++ .../hardware/graphics/common/Interlaced.aidl | 41 ++ .../hardware/graphics/common/PixelFormat.aidl | 68 ++++ .../hardware/graphics/common/PlaneLayout.aidl | 47 +++ .../graphics/common/PlaneLayoutComponent.aidl | 41 ++ .../common/PlaneLayoutComponentType.aidl | 46 +++ .../hardware/graphics/common/Point.aidl | 40 ++ .../hardware/graphics/common/Rect.aidl | 42 ++ .../hardware/graphics/common/Smpte2086.aidl | 44 ++ .../graphics/common/StandardMetadataType.aidl | 61 +++ .../hardware/graphics/common/Transform.aidl | 44 ++ .../hardware/graphics/common/XyColor.aidl | 40 ++ graphics/composer/aidl/Android.bp | 10 + .../1/.hash | 1 + .../hardware/graphics/composer3/Buffer.aidl | 40 ++ .../graphics/composer3/Capability.aidl | 43 ++ .../composer3/ChangedCompositionLayer.aidl | 39 ++ .../composer3/ChangedCompositionTypes.aidl | 39 ++ .../graphics/composer3/ClientTarget.aidl | 40 ++ .../composer3/ClientTargetProperty.aidl | 39 ++ .../ClientTargetPropertyWithBrightness.aidl | 41 ++ .../composer3/ClockMonotonicTimestamp.aidl | 38 ++ .../hardware/graphics/composer3/Color.aidl | 41 ++ .../graphics/composer3/ColorMode.aidl | 51 +++ .../graphics/composer3/CommandError.aidl | 39 ++ .../composer3/CommandResultPayload.aidl | 44 ++ .../graphics/composer3/Composition.aidl | 44 ++ .../graphics/composer3/ContentType.aidl | 42 ++ .../graphics/composer3/DimmingStage.aidl | 40 ++ .../graphics/composer3/DisplayAttribute.aidl | 44 ++ .../graphics/composer3/DisplayBrightness.aidl | 39 ++ .../graphics/composer3/DisplayCapability.aidl | 45 +++ .../graphics/composer3/DisplayCommand.aidl | 48 +++ .../composer3/DisplayConnectionType.aidl | 39 ++ .../composer3/DisplayContentSample.aidl | 42 ++ .../DisplayContentSamplingAttributes.aidl | 40 ++ .../composer3/DisplayIdentification.aidl | 39 ++ .../graphics/composer3/DisplayRequest.aidl | 48 +++ .../composer3/FormatColorComponent.aidl | 41 ++ .../graphics/composer3/HdrCapabilities.aidl | 41 ++ .../graphics/composer3/IComposer.aidl | 40 ++ .../graphics/composer3/IComposerCallback.aidl | 43 ++ .../graphics/composer3/IComposerClient.aidl | 89 +++++ .../graphics/composer3/LayerBrightness.aidl | 38 ++ .../graphics/composer3/LayerCommand.aidl | 57 +++ .../composer3/ParcelableBlendMode.aidl | 38 ++ .../composer3/ParcelableComposition.aidl | 38 ++ .../composer3/ParcelableDataspace.aidl | 38 ++ .../composer3/ParcelableTransform.aidl | 38 ++ .../graphics/composer3/PerFrameMetadata.aidl | 39 ++ .../composer3/PerFrameMetadataBlob.aidl | 39 ++ .../composer3/PerFrameMetadataKey.aidl | 50 +++ .../graphics/composer3/PlaneAlpha.aidl | 38 ++ .../graphics/composer3/PowerMode.aidl | 42 ++ .../graphics/composer3/PresentFence.aidl | 39 ++ .../graphics/composer3/PresentOrValidate.aidl | 44 ++ .../composer3/ReadbackBufferAttributes.aidl | 39 ++ .../graphics/composer3/ReleaseFences.aidl | 44 ++ .../graphics/composer3/RenderIntent.aidl | 41 ++ .../graphics/composer3/VirtualDisplay.aidl | 39 ++ .../VsyncPeriodChangeConstraints.aidl | 39 ++ .../composer3/VsyncPeriodChangeTimeline.aidl | 40 ++ .../hardware/graphics/composer3/ZOrder.aidl | 38 ++ identity/aidl/Android.bp | 35 +- .../android.hardware.identity/4/.hash | 1 + .../hardware/identity/Certificate.aidl | 38 ++ .../hardware/identity/CipherSuite.aidl | 38 ++ .../identity/HardwareInformation.aidl | 43 ++ .../identity/IIdentityCredential.aidl | 54 +++ .../identity/IIdentityCredentialStore.aidl | 55 +++ .../identity/IPresentationSession.aidl | 42 ++ .../identity/IWritableIdentityCredential.aidl | 45 +++ .../hardware/identity/RequestDataItem.aidl | 40 ++ .../hardware/identity/RequestNamespace.aidl | 39 ++ .../identity/SecureAccessControlProfile.aidl | 43 ++ input/processor/aidl/Android.bp | 7 + .../android.hardware.input.processor/1/.hash | 1 + .../input/processor/IInputProcessor.aidl | 40 ++ neuralnetworks/aidl/Android.bp | 35 +- .../android.hardware.neuralnetworks/4/.hash | 1 + .../hardware/neuralnetworks/BufferDesc.aidl | 38 ++ .../hardware/neuralnetworks/BufferRole.aidl | 40 ++ .../hardware/neuralnetworks/Capabilities.aidl | 42 ++ .../hardware/neuralnetworks/DataLocation.aidl | 41 ++ .../hardware/neuralnetworks/DeviceBuffer.aidl | 39 ++ .../hardware/neuralnetworks/DeviceType.aidl | 41 ++ .../hardware/neuralnetworks/ErrorStatus.aidl | 46 +++ .../neuralnetworks/ExecutionConfig.aidl | 41 ++ .../neuralnetworks/ExecutionPreference.aidl | 40 ++ .../neuralnetworks/ExecutionResult.aidl | 40 ++ .../hardware/neuralnetworks/Extension.aidl | 39 ++ .../ExtensionNameAndPrefix.aidl | 39 ++ .../ExtensionOperandTypeInformation.aidl | 40 ++ .../neuralnetworks/FencedExecutionResult.aidl | 39 ++ .../neuralnetworks/FusedActivationFunc.aidl | 41 ++ .../hardware/neuralnetworks/IBuffer.aidl | 39 ++ .../hardware/neuralnetworks/IBurst.aidl | 40 ++ .../hardware/neuralnetworks/IDevice.aidl | 53 +++ .../hardware/neuralnetworks/IExecution.aidl | 39 ++ .../IFencedExecutionCallback.aidl | 38 ++ .../neuralnetworks/IPreparedModel.aidl | 45 +++ .../IPreparedModelCallback.aidl | 38 ++ .../neuralnetworks/IPreparedModelParcel.aidl | 38 ++ .../hardware/neuralnetworks/Memory.aidl | 40 ++ .../hardware/neuralnetworks/Model.aidl | 43 ++ .../neuralnetworks/NumberOfCacheFiles.aidl | 39 ++ .../hardware/neuralnetworks/Operand.aidl | 44 ++ .../neuralnetworks/OperandExtraParams.aidl | 39 ++ .../neuralnetworks/OperandLifeTime.aidl | 44 ++ .../neuralnetworks/OperandPerformance.aidl | 39 ++ .../hardware/neuralnetworks/OperandType.aidl | 53 +++ .../hardware/neuralnetworks/Operation.aidl | 40 ++ .../neuralnetworks/OperationType.aidl | 143 +++++++ .../hardware/neuralnetworks/OutputShape.aidl | 39 ++ .../neuralnetworks/PerformanceInfo.aidl | 39 ++ .../neuralnetworks/PrepareModelConfig.aidl | 46 +++ .../hardware/neuralnetworks/Priority.aidl | 40 ++ .../hardware/neuralnetworks/Request.aidl | 40 ++ .../neuralnetworks/RequestArgument.aidl | 40 ++ .../neuralnetworks/RequestMemoryPool.aidl | 39 ++ .../hardware/neuralnetworks/Subgraph.aidl | 41 ++ .../SymmPerChannelQuantParams.aidl | 39 ++ .../hardware/neuralnetworks/Timing.aidl | 39 ++ .../neuralnetworks/TokenValuePair.aidl | 39 ++ radio/aidl/Android.bp | 45 +++ .../android.hardware.radio.config/1/.hash | 1 + .../hardware/radio/config/IRadioConfig.aidl | 53 +++ .../radio/config/IRadioConfigIndication.aidl | 38 ++ .../radio/config/IRadioConfigResponse.aidl | 44 ++ .../radio/config/PhoneCapability.aidl | 41 ++ .../hardware/radio/config/SimPortInfo.aidl | 40 ++ .../hardware/radio/config/SimSlotStatus.aidl | 41 ++ .../radio/config/SlotPortMapping.aidl | 39 ++ .../android.hardware.radio.data/1/.hash | 1 + .../hardware/radio/data/ApnAuthType.aidl | 41 ++ .../android/hardware/radio/data/ApnTypes.aidl | 53 +++ .../radio/data/DataCallFailCause.aidl | 377 ++++++++++++++++++ .../hardware/radio/data/DataProfileInfo.aidl | 67 ++++ .../radio/data/DataRequestReason.aidl | 40 ++ .../radio/data/DataThrottlingAction.aidl | 41 ++ .../1/android/hardware/radio/data/EpsQos.aidl | 40 ++ .../hardware/radio/data/IRadioData.aidl | 53 +++ .../radio/data/IRadioDataIndication.aidl | 42 ++ .../radio/data/IRadioDataResponse.aidl | 52 +++ .../hardware/radio/data/KeepaliveRequest.aidl | 46 +++ .../hardware/radio/data/KeepaliveStatus.aidl | 42 ++ .../hardware/radio/data/LinkAddress.aidl | 43 ++ .../1/android/hardware/radio/data/NrQos.aidl | 44 ++ .../android/hardware/radio/data/OsAppId.aidl | 38 ++ .../hardware/radio/data/PcoDataInfo.aidl | 41 ++ .../hardware/radio/data/PdpProtocolType.aidl | 44 ++ .../hardware/radio/data/PortRange.aidl | 41 ++ .../1/android/hardware/radio/data/Qos.aidl | 40 ++ .../hardware/radio/data/QosBandwidth.aidl | 39 ++ .../hardware/radio/data/QosFilter.aidl | 55 +++ .../radio/data/QosFilterIpsecSpi.aidl | 39 ++ .../radio/data/QosFilterIpv6FlowLabel.aidl | 39 ++ .../radio/data/QosFilterTypeOfService.aidl | 39 ++ .../hardware/radio/data/QosSession.aidl | 40 ++ .../radio/data/RouteSelectionDescriptor.aidl | 46 +++ .../radio/data/SetupDataCallResult.aidl | 62 +++ .../hardware/radio/data/SliceInfo.aidl | 52 +++ .../hardware/radio/data/SlicingConfig.aidl | 39 ++ .../radio/data/TrafficDescriptor.aidl | 39 ++ .../android/hardware/radio/data/UrspRule.aidl | 40 ++ .../android.hardware.radio.messaging/1/.hash | 1 + .../messaging/CdmaBroadcastSmsConfigInfo.aidl | 40 ++ .../hardware/radio/messaging/CdmaSmsAck.aidl | 39 ++ .../radio/messaging/CdmaSmsAddress.aidl | 68 ++++ .../radio/messaging/CdmaSmsMessage.aidl | 43 ++ .../radio/messaging/CdmaSmsSubaddress.aidl | 42 ++ .../radio/messaging/CdmaSmsWriteArgs.aidl | 43 ++ .../messaging/GsmBroadcastSmsConfigInfo.aidl | 42 ++ .../radio/messaging/GsmSmsMessage.aidl | 39 ++ .../radio/messaging/IRadioMessaging.aidl | 60 +++ .../messaging/IRadioMessagingIndication.aidl | 44 ++ .../messaging/IRadioMessagingResponse.aidl | 59 +++ .../radio/messaging/ImsSmsMessage.aidl | 42 ++ .../radio/messaging/SendSmsResult.aidl | 40 ++ .../messaging/SmsAcknowledgeFailCause.aidl | 39 ++ .../radio/messaging/SmsWriteArgs.aidl | 44 ++ .../android.hardware.radio.modem/1/.hash | 1 + .../radio/modem/ActivityStatsInfo.aidl | 40 ++ .../modem/ActivityStatsTechSpecificInfo.aidl | 46 +++ .../hardware/radio/modem/DeviceStateType.aidl | 40 ++ .../hardware/radio/modem/HardwareConfig.aidl | 47 +++ .../radio/modem/HardwareConfigModem.aidl | 42 ++ .../radio/modem/HardwareConfigSim.aidl | 38 ++ .../hardware/radio/modem/IRadioModem.aidl | 54 +++ .../radio/modem/IRadioModemIndication.aidl | 42 ++ .../radio/modem/IRadioModemResponse.aidl | 53 +++ .../android/hardware/radio/modem/NvItem.aidl | 78 ++++ .../hardware/radio/modem/NvWriteItem.aidl | 39 ++ .../hardware/radio/modem/RadioCapability.aidl | 50 +++ .../hardware/radio/modem/RadioState.aidl | 40 ++ .../hardware/radio/modem/ResetNvType.aidl | 40 ++ .../android.hardware.radio.network/1/.hash | 1 + .../network/AccessTechnologySpecificInfo.aidl | 42 ++ .../hardware/radio/network/BarringInfo.aidl | 85 ++++ .../network/BarringTypeSpecificInfo.aidl | 40 ++ .../network/Cdma2000RegistrationInfo.aidl | 44 ++ .../radio/network/CdmaRoamingType.aidl | 40 ++ .../radio/network/CdmaSignalStrength.aidl | 39 ++ .../radio/network/CellConnectionStatus.aidl | 40 ++ .../hardware/radio/network/CellIdentity.aidl | 44 ++ .../radio/network/CellIdentityCdma.aidl | 43 ++ .../radio/network/CellIdentityGsm.aidl | 45 +++ .../radio/network/CellIdentityLte.aidl | 48 +++ .../radio/network/CellIdentityNr.aidl | 46 +++ .../radio/network/CellIdentityTdscdma.aidl | 46 +++ .../radio/network/CellIdentityWcdma.aidl | 46 +++ .../hardware/radio/network/CellInfo.aidl | 40 ++ .../hardware/radio/network/CellInfoCdma.aidl | 40 ++ .../hardware/radio/network/CellInfoGsm.aidl | 39 ++ .../hardware/radio/network/CellInfoLte.aidl | 39 ++ .../hardware/radio/network/CellInfoNr.aidl | 39 ++ .../network/CellInfoRatSpecificInfo.aidl | 43 ++ .../radio/network/CellInfoTdscdma.aidl | 39 ++ .../hardware/radio/network/CellInfoWcdma.aidl | 39 ++ .../network/ClosedSubscriberGroupInfo.aidl | 40 ++ .../hardware/radio/network/Domain.aidl | 39 ++ .../hardware/radio/network/EutranBands.aidl | 97 +++++ .../radio/network/EutranRegistrationInfo.aidl | 39 ++ .../radio/network/EvdoSignalStrength.aidl | 40 ++ .../hardware/radio/network/GeranBands.aidl | 51 +++ .../radio/network/GsmSignalStrength.aidl | 40 ++ .../hardware/radio/network/IRadioNetwork.aidl | 73 ++++ .../network/IRadioNetworkIndication.aidl | 51 +++ .../radio/network/IRadioNetworkResponse.aidl | 72 ++++ .../radio/network/IndicationFilter.aidl | 46 +++ .../hardware/radio/network/LceDataInfo.aidl | 40 ++ .../radio/network/LinkCapacityEstimate.aidl | 41 ++ .../radio/network/LteSignalStrength.aidl | 44 ++ .../hardware/radio/network/LteVopsInfo.aidl | 39 ++ .../radio/network/NetworkScanRequest.aidl | 53 +++ .../radio/network/NetworkScanResult.aidl | 42 ++ .../hardware/radio/network/NgranBands.aidl | 90 +++++ .../network/NrDualConnectivityState.aidl | 40 ++ .../hardware/radio/network/NrIndicators.aidl | 40 ++ .../radio/network/NrSignalStrength.aidl | 45 +++ .../hardware/radio/network/NrVopsInfo.aidl | 51 +++ .../hardware/radio/network/OperatorInfo.aidl | 45 +++ .../radio/network/PhoneRestrictedState.aidl | 42 ++ .../radio/network/PhysicalChannelConfig.aidl | 46 +++ .../network/PhysicalChannelConfigBand.aidl | 42 ++ .../radio/network/RadioAccessSpecifier.aidl | 40 ++ .../network/RadioAccessSpecifierBands.aidl | 42 ++ .../hardware/radio/network/RadioBandMode.aidl | 56 +++ .../hardware/radio/network/RegState.aidl | 47 +++ .../radio/network/RegStateResult.aidl | 43 ++ .../radio/network/RegistrationFailCause.aidl | 89 +++++ .../radio/network/SignalStrength.aidl | 44 ++ .../radio/network/SignalThresholdInfo.aidl | 51 +++ .../radio/network/SuppSvcNotification.aidl | 42 ++ .../radio/network/TdscdmaSignalStrength.aidl | 40 ++ .../hardware/radio/network/UsageSetting.aidl | 39 ++ .../hardware/radio/network/UtranBands.aidl | 63 +++ .../radio/network/WcdmaSignalStrength.aidl | 41 ++ .../android.hardware.radio.sim/1/.hash | 1 + .../android/hardware/radio/sim/AppStatus.aidl | 57 +++ .../hardware/radio/sim/CardPowerState.aidl | 40 ++ .../hardware/radio/sim/CardStatus.aidl | 51 +++ .../1/android/hardware/radio/sim/Carrier.aidl | 46 +++ .../radio/sim/CarrierRestrictions.aidl | 40 ++ .../radio/sim/CdmaSubscriptionSource.aidl | 39 ++ .../android/hardware/radio/sim/IRadioSim.aidl | 73 ++++ .../radio/sim/IRadioSimIndication.aidl | 48 +++ .../hardware/radio/sim/IRadioSimResponse.aidl | 72 ++++ .../1/android/hardware/radio/sim/IccIo.aidl | 46 +++ .../hardware/radio/sim/IccIoResult.aidl | 40 ++ .../radio/sim/ImsiEncryptionInfo.aidl | 45 +++ .../hardware/radio/sim/PbReceivedStatus.aidl | 41 ++ .../hardware/radio/sim/PersoSubstate.aidl | 72 ++++ .../hardware/radio/sim/PhonebookCapacity.aidl | 47 +++ .../radio/sim/PhonebookRecordInfo.aidl | 42 ++ .../android/hardware/radio/sim/PinState.aidl | 43 ++ .../hardware/radio/sim/SelectUiccSub.aidl | 46 +++ .../1/android/hardware/radio/sim/SimApdu.aidl | 44 ++ .../radio/sim/SimLockMultiSimPolicy.aidl | 39 ++ .../hardware/radio/sim/SimRefreshResult.aidl | 43 ++ .../android.hardware.radio.voice/1/.hash | 1 + .../hardware/radio/voice/AudioQuality.aidl | 47 +++ .../1/android/hardware/radio/voice/Call.aidl | 62 +++ .../hardware/radio/voice/CallForwardInfo.aidl | 48 +++ .../hardware/radio/voice/CdmaCallWaiting.aidl | 57 +++ .../radio/voice/CdmaDisplayInfoRecord.aidl | 39 ++ .../radio/voice/CdmaInformationRecord.aidl | 57 +++ .../voice/CdmaLineControlInfoRecord.aidl | 41 ++ .../radio/voice/CdmaNumberInfoRecord.aidl | 43 ++ .../radio/voice/CdmaOtaProvisionStatus.aidl | 49 +++ .../CdmaRedirectingNumberInfoRecord.aidl | 46 +++ .../radio/voice/CdmaSignalInfoRecord.aidl | 41 ++ .../voice/CdmaT53AudioControlInfoRecord.aidl | 39 ++ .../radio/voice/CdmaT53ClirInfoRecord.aidl | 38 ++ .../android/hardware/radio/voice/CfData.aidl | 39 ++ .../hardware/radio/voice/ClipStatus.aidl | 40 ++ .../1/android/hardware/radio/voice/Dial.aidl | 43 ++ .../radio/voice/EmergencyCallRouting.aidl | 40 ++ .../hardware/radio/voice/EmergencyNumber.aidl | 47 +++ .../radio/voice/EmergencyServiceCategory.aidl | 45 +++ .../hardware/radio/voice/IRadioVoice.aidl | 76 ++++ .../radio/voice/IRadioVoiceIndication.aidl | 52 +++ .../radio/voice/IRadioVoiceResponse.aidl | 75 ++++ .../radio/voice/LastCallFailCause.aidl | 133 ++++++ .../radio/voice/LastCallFailCauseInfo.aidl | 39 ++ .../hardware/radio/voice/SrvccState.aidl | 41 ++ .../hardware/radio/voice/SsInfoData.aidl | 39 ++ .../radio/voice/StkCcUnsolSsResult.aidl | 84 ++++ .../android/hardware/radio/voice/TtyMode.aidl | 41 ++ .../hardware/radio/voice/UssdModeType.aidl | 43 ++ .../android/hardware/radio/voice/UusInfo.aidl | 52 +++ security/keymint/aidl/Android.bp | 13 +- .../android.hardware.security.keymint/2/.hash | 1 + .../hardware/security/keymint/Algorithm.aidl | 43 ++ .../security/keymint/AttestationKey.aidl | 41 ++ .../security/keymint/BeginResult.aidl | 41 ++ .../hardware/security/keymint/BlockMode.aidl | 42 ++ .../security/keymint/Certificate.aidl | 39 ++ .../hardware/security/keymint/DeviceInfo.aidl | 39 ++ .../hardware/security/keymint/Digest.aidl | 45 +++ .../hardware/security/keymint/EcCurve.aidl | 43 ++ .../hardware/security/keymint/ErrorCode.aidl | 125 ++++++ .../security/keymint/HardwareAuthToken.aidl | 44 ++ .../keymint/HardwareAuthenticatorType.aidl | 42 ++ .../security/keymint/IKeyMintDevice.aidl | 56 +++ .../security/keymint/IKeyMintOperation.aidl | 42 ++ .../IRemotelyProvisionedComponent.aidl | 46 +++ .../security/keymint/KeyCharacteristics.aidl | 40 ++ .../security/keymint/KeyCreationResult.aidl | 41 ++ .../hardware/security/keymint/KeyFormat.aidl | 41 ++ .../security/keymint/KeyMintHardwareInfo.aidl | 43 ++ .../hardware/security/keymint/KeyOrigin.aidl | 43 ++ .../security/keymint/KeyParameter.aidl | 40 ++ .../security/keymint/KeyParameterValue.aidl | 53 +++ .../hardware/security/keymint/KeyPurpose.aidl | 45 +++ .../security/keymint/MacedPublicKey.aidl | 39 ++ .../security/keymint/PaddingMode.aidl | 44 ++ .../security/keymint/ProtectedData.aidl | 39 ++ .../security/keymint/RpcHardwareInfo.aidl | 45 +++ .../security/keymint/SecurityLevel.aidl | 42 ++ .../hardware/security/keymint/Tag.aidl | 103 +++++ .../hardware/security/keymint/TagType.aidl | 49 +++ .../aidl_api/android.hardware.sensors/1/.hash | 1 + .../hardware/sensors/AdditionalInfo.aidl | 76 ++++ .../hardware/sensors/DynamicSensorInfo.aidl | 44 ++ .../1/android/hardware/sensors/Event.aidl | 139 +++++++ .../1/android/hardware/sensors/ISensors.aidl | 89 +++++ .../hardware/sensors/ISensorsCallback.aidl | 39 ++ .../android/hardware/sensors/SensorInfo.aidl | 71 ++++ .../hardware/sensors/SensorStatus.aidl | 42 ++ .../android/hardware/sensors/SensorType.aidl | 80 ++++ soundtrigger/aidl/Android.bp | 14 +- .../android.hardware.soundtrigger3/1/.hash | 1 + .../soundtrigger3/ISoundTriggerHw.aidl | 48 +++ .../ISoundTriggerHwCallback.aidl | 40 ++ .../ISoundTriggerHwGlobalCallback.aidl | 38 ++ .../android.hardware.tv.tuner/1/.hash | 1 + .../hardware/tv/tuner/AudioExtraMetaData.aidl | 44 ++ .../hardware/tv/tuner/AudioStreamType.aidl | 58 +++ .../hardware/tv/tuner/AvStreamType.aidl | 40 ++ .../1/android/hardware/tv/tuner/Constant.aidl | 51 +++ .../hardware/tv/tuner/Constant64Bit.aidl | 41 ++ .../android/hardware/tv/tuner/DataFormat.aidl | 43 ++ .../tv/tuner/DemuxAlpFilterSettings.aidl | 41 ++ .../DemuxAlpFilterSettingsFilterSettings.aidl | 40 ++ .../hardware/tv/tuner/DemuxAlpFilterType.aidl | 42 ++ .../hardware/tv/tuner/DemuxAlpLengthType.aidl | 41 ++ .../hardware/tv/tuner/DemuxCapabilities.aidl | 51 +++ .../tv/tuner/DemuxFilterAvSettings.aidl | 40 ++ .../tv/tuner/DemuxFilterDownloadEvent.aidl | 44 ++ .../tv/tuner/DemuxFilterDownloadSettings.aidl | 40 ++ .../hardware/tv/tuner/DemuxFilterEvent.aidl | 48 +++ .../tv/tuner/DemuxFilterIpPayloadEvent.aidl | 39 ++ .../tv/tuner/DemuxFilterMainType.aidl | 44 ++ .../tv/tuner/DemuxFilterMediaEvent.aidl | 52 +++ .../DemuxFilterMediaEventExtraMetaData.aidl | 40 ++ .../tv/tuner/DemuxFilterMmtpRecordEvent.aidl | 44 ++ .../tv/tuner/DemuxFilterMonitorEvent.aidl | 40 ++ .../tv/tuner/DemuxFilterMonitorEventType.aidl | 40 ++ .../tv/tuner/DemuxFilterPesDataSettings.aidl | 40 ++ .../tv/tuner/DemuxFilterPesEvent.aidl | 41 ++ .../tv/tuner/DemuxFilterRecordSettings.aidl | 41 ++ .../tv/tuner/DemuxFilterScIndexMask.aidl | 41 ++ .../tv/tuner/DemuxFilterSectionBits.aidl | 41 ++ .../tv/tuner/DemuxFilterSectionEvent.aidl | 42 ++ .../tv/tuner/DemuxFilterSectionSettings.aidl | 43 ++ .../DemuxFilterSectionSettingsCondition.aidl | 40 ++ ...lterSectionSettingsConditionTableInfo.aidl | 40 ++ .../tv/tuner/DemuxFilterSettings.aidl | 43 ++ .../hardware/tv/tuner/DemuxFilterStatus.aidl | 42 ++ .../hardware/tv/tuner/DemuxFilterSubType.aidl | 43 ++ .../tv/tuner/DemuxFilterTemiEvent.aidl | 41 ++ .../tv/tuner/DemuxFilterTsRecordEvent.aidl | 44 ++ .../hardware/tv/tuner/DemuxFilterType.aidl | 40 ++ .../hardware/tv/tuner/DemuxIpAddress.aidl | 42 ++ .../tv/tuner/DemuxIpAddressIpAddress.aidl | 40 ++ .../tv/tuner/DemuxIpFilterSettings.aidl | 40 ++ .../DemuxIpFilterSettingsFilterSettings.aidl | 41 ++ .../hardware/tv/tuner/DemuxIpFilterType.aidl | 44 ++ .../tv/tuner/DemuxMmtpFilterSettings.aidl | 40 ++ ...DemuxMmtpFilterSettingsFilterSettings.aidl | 44 ++ .../tv/tuner/DemuxMmtpFilterType.aidl | 46 +++ .../1/android/hardware/tv/tuner/DemuxPid.aidl | 40 ++ .../tv/tuner/DemuxQueueNotifyBits.aidl | 40 ++ .../tv/tuner/DemuxRecordScIndexType.aidl | 42 ++ .../hardware/tv/tuner/DemuxScAvcIndex.aidl | 44 ++ .../hardware/tv/tuner/DemuxScHevcIndex.aidl | 47 +++ .../hardware/tv/tuner/DemuxScIndex.aidl | 43 ++ .../tv/tuner/DemuxTlvFilterSettings.aidl | 41 ++ .../DemuxTlvFilterSettingsFilterSettings.aidl | 41 ++ .../hardware/tv/tuner/DemuxTlvFilterType.aidl | 42 ++ .../tv/tuner/DemuxTsFilterSettings.aidl | 40 ++ .../DemuxTsFilterSettingsFilterSettings.aidl | 43 ++ .../hardware/tv/tuner/DemuxTsFilterType.aidl | 47 +++ .../hardware/tv/tuner/DemuxTsIndex.aidl | 56 +++ .../hardware/tv/tuner/DvrSettings.aidl | 40 ++ .../1/android/hardware/tv/tuner/DvrType.aidl | 40 ++ .../hardware/tv/tuner/FilterDelayHint.aidl | 40 ++ .../tv/tuner/FilterDelayHintType.aidl | 41 ++ .../tv/tuner/FrontendAnalogAftFlag.aidl | 41 ++ .../tv/tuner/FrontendAnalogCapabilities.aidl | 40 ++ .../tv/tuner/FrontendAnalogSettings.aidl | 44 ++ .../tv/tuner/FrontendAnalogSifStandard.aidl | 57 +++ .../hardware/tv/tuner/FrontendAnalogType.aidl | 47 +++ .../tv/tuner/FrontendAtsc3Bandwidth.aidl | 43 ++ .../tv/tuner/FrontendAtsc3Capabilities.aidl | 44 ++ .../tv/tuner/FrontendAtsc3CodeRate.aidl | 52 +++ .../tuner/FrontendAtsc3DemodOutputFormat.aidl | 41 ++ .../hardware/tv/tuner/FrontendAtsc3Fec.aidl | 46 +++ .../tv/tuner/FrontendAtsc3Modulation.aidl | 46 +++ .../tv/tuner/FrontendAtsc3PlpSettings.aidl | 43 ++ .../tv/tuner/FrontendAtsc3Settings.aidl | 44 ++ .../FrontendAtsc3TimeInterleaveMode.aidl | 42 ++ .../tv/tuner/FrontendAtscCapabilities.aidl | 39 ++ .../tv/tuner/FrontendAtscModulation.aidl | 42 ++ .../tv/tuner/FrontendAtscSettings.aidl | 42 ++ .../hardware/tv/tuner/FrontendBandwidth.aidl | 43 ++ .../FrontendCableTimeInterleaveMode.aidl | 49 +++ .../tv/tuner/FrontendCapabilities.aidl | 48 +++ .../tv/tuner/FrontendDtmbBandwidth.aidl | 42 ++ .../tv/tuner/FrontendDtmbCapabilities.aidl | 44 ++ .../tv/tuner/FrontendDtmbCodeRate.aidl | 43 ++ .../tv/tuner/FrontendDtmbGuardInterval.aidl | 46 +++ .../tv/tuner/FrontendDtmbModulation.aidl | 45 +++ .../tv/tuner/FrontendDtmbSettings.aidl | 47 +++ .../tuner/FrontendDtmbTimeInterleaveMode.aidl | 42 ++ .../tuner/FrontendDtmbTransmissionMode.aidl | 42 ++ .../hardware/tv/tuner/FrontendDvbcAnnex.aidl | 42 ++ .../tv/tuner/FrontendDvbcBandwidth.aidl | 43 ++ .../tv/tuner/FrontendDvbcCapabilities.aidl | 41 ++ .../tv/tuner/FrontendDvbcModulation.aidl | 45 +++ .../tv/tuner/FrontendDvbcOuterFec.aidl | 41 ++ .../tv/tuner/FrontendDvbcSettings.aidl | 48 +++ .../tv/tuner/FrontendDvbsCapabilities.aidl | 41 ++ .../tv/tuner/FrontendDvbsCodeRate.aidl | 42 ++ .../tv/tuner/FrontendDvbsModulation.aidl | 53 +++ .../hardware/tv/tuner/FrontendDvbsPilot.aidl | 42 ++ .../tv/tuner/FrontendDvbsRolloff.aidl | 45 +++ .../tv/tuner/FrontendDvbsScanType.aidl | 43 ++ .../tv/tuner/FrontendDvbsSettings.aidl | 51 +++ .../tv/tuner/FrontendDvbsStandard.aidl | 43 ++ .../tv/tuner/FrontendDvbsVcmMode.aidl | 41 ++ .../tv/tuner/FrontendDvbtBandwidth.aidl | 46 +++ .../tv/tuner/FrontendDvbtCapabilities.aidl | 46 +++ .../tv/tuner/FrontendDvbtCoderate.aidl | 49 +++ .../tv/tuner/FrontendDvbtConstellation.aidl | 48 +++ .../tv/tuner/FrontendDvbtGuardInterval.aidl | 47 +++ .../tv/tuner/FrontendDvbtHierarchy.aidl | 48 +++ .../tv/tuner/FrontendDvbtPlpMode.aidl | 41 ++ .../tv/tuner/FrontendDvbtSettings.aidl | 54 +++ .../tv/tuner/FrontendDvbtStandard.aidl | 42 ++ .../tuner/FrontendDvbtTransmissionMode.aidl | 49 +++ .../hardware/tv/tuner/FrontendEventType.aidl | 41 ++ .../tv/tuner/FrontendGuardInterval.aidl | 41 ++ .../hardware/tv/tuner/FrontendInfo.aidl | 47 +++ .../hardware/tv/tuner/FrontendInnerFec.aidl | 92 +++++ .../tv/tuner/FrontendInterleaveMode.aidl | 42 ++ .../tv/tuner/FrontendIsdbs3Capabilities.aidl | 40 ++ .../tv/tuner/FrontendIsdbs3Coderate.aidl | 51 +++ .../tv/tuner/FrontendIsdbs3Modulation.aidl | 45 +++ .../tv/tuner/FrontendIsdbs3Rolloff.aidl | 40 ++ .../tv/tuner/FrontendIsdbs3Settings.aidl | 46 +++ .../tv/tuner/FrontendIsdbsCapabilities.aidl | 40 ++ .../tv/tuner/FrontendIsdbsCoderate.aidl | 45 +++ .../tv/tuner/FrontendIsdbsModulation.aidl | 43 ++ .../tv/tuner/FrontendIsdbsRolloff.aidl | 40 ++ .../tv/tuner/FrontendIsdbsSettings.aidl | 46 +++ .../tv/tuner/FrontendIsdbsStreamIdType.aidl | 41 ++ .../tv/tuner/FrontendIsdbtBandwidth.aidl | 43 ++ .../tv/tuner/FrontendIsdbtCapabilities.aidl | 46 +++ .../tv/tuner/FrontendIsdbtCoderate.aidl | 49 +++ .../tv/tuner/FrontendIsdbtGuardInterval.aidl | 47 +++ .../tv/tuner/FrontendIsdbtLayerSettings.aidl | 42 ++ .../hardware/tv/tuner/FrontendIsdbtMode.aidl | 43 ++ .../tv/tuner/FrontendIsdbtModulation.aidl | 44 ++ .../FrontendIsdbtPartialReceptionFlag.aidl | 42 ++ .../tv/tuner/FrontendIsdbtSettings.aidl | 47 +++ .../FrontendIsdbtTimeInterleaveMode.aidl | 52 +++ .../hardware/tv/tuner/FrontendModulation.aidl | 47 +++ .../tv/tuner/FrontendModulationStatus.aidl | 43 ++ .../hardware/tv/tuner/FrontendRollOff.aidl | 41 ++ .../tv/tuner/FrontendScanAtsc3PlpInfo.aidl | 40 ++ .../tv/tuner/FrontendScanMessage.aidl | 54 +++ .../tv/tuner/FrontendScanMessageStandard.aidl | 41 ++ .../tv/tuner/FrontendScanMessageType.aidl | 54 +++ .../hardware/tv/tuner/FrontendScanType.aidl | 41 ++ .../hardware/tv/tuner/FrontendSettings.aidl | 48 +++ .../tv/tuner/FrontendSpectralInversion.aidl | 41 ++ .../hardware/tv/tuner/FrontendStatus.aidl | 80 ++++ .../tv/tuner/FrontendStatusAtsc3PlpInfo.aidl | 41 ++ .../tv/tuner/FrontendStatusReadiness.aidl | 43 ++ .../hardware/tv/tuner/FrontendStatusType.aidl | 80 ++++ .../tv/tuner/FrontendTransmissionMode.aidl | 41 ++ .../hardware/tv/tuner/FrontendType.aidl | 49 +++ .../1/android/hardware/tv/tuner/IDemux.aidl | 47 +++ .../hardware/tv/tuner/IDescrambler.aidl | 43 ++ .../1/android/hardware/tv/tuner/IDvr.aidl | 46 +++ .../hardware/tv/tuner/IDvrCallback.aidl | 40 ++ .../1/android/hardware/tv/tuner/IFilter.aidl | 53 +++ .../hardware/tv/tuner/IFilterCallback.aidl | 40 ++ .../android/hardware/tv/tuner/IFrontend.aidl | 51 +++ .../hardware/tv/tuner/IFrontendCallback.aidl | 40 ++ .../1/android/hardware/tv/tuner/ILnb.aidl | 44 ++ .../hardware/tv/tuner/ILnbCallback.aidl | 40 ++ .../hardware/tv/tuner/ITimeFilter.aidl | 43 ++ .../1/android/hardware/tv/tuner/ITuner.aidl | 50 +++ .../hardware/tv/tuner/LnbEventType.aidl | 42 ++ .../hardware/tv/tuner/LnbPosition.aidl | 41 ++ .../1/android/hardware/tv/tuner/LnbTone.aidl | 40 ++ .../android/hardware/tv/tuner/LnbVoltage.aidl | 47 +++ .../hardware/tv/tuner/PlaybackSettings.aidl | 43 ++ .../hardware/tv/tuner/PlaybackStatus.aidl | 42 ++ .../hardware/tv/tuner/RecordSettings.aidl | 43 ++ .../hardware/tv/tuner/RecordStatus.aidl | 42 ++ .../1/android/hardware/tv/tuner/Result.aidl | 45 +++ .../hardware/tv/tuner/ScramblingStatus.aidl | 41 ++ .../hardware/tv/tuner/VideoStreamType.aidl | 51 +++ .../android.hardware.wifi.supplicant/1/.hash | 1 + .../hardware/wifi/supplicant/AnqpData.aidl | 44 ++ .../hardware/wifi/supplicant/AnqpInfoId.aidl | 43 ++ .../supplicant/AssociationRejectionData.aidl | 45 +++ .../hardware/wifi/supplicant/AuthAlgMask.aidl | 41 ++ .../AuxiliarySupplicantEventCode.aidl | 40 ++ .../hardware/wifi/supplicant/BssTmData.aidl | 42 ++ .../wifi/supplicant/BssTmDataFlagsMask.aidl | 45 +++ .../wifi/supplicant/BssTmStatusCode.aidl | 46 +++ .../wifi/supplicant/BssidChangeReason.aidl | 40 ++ .../wifi/supplicant/BtCoexistenceMode.aidl | 40 ++ .../supplicant/ConnectionCapabilities.aidl | 42 ++ .../hardware/wifi/supplicant/DebugLevel.aidl | 43 ++ .../hardware/wifi/supplicant/DppAkm.aidl | 41 ++ .../wifi/supplicant/DppConnectionKeys.aidl | 40 ++ .../hardware/wifi/supplicant/DppCurve.aidl | 43 ++ .../wifi/supplicant/DppEventType.aidl | 39 ++ .../wifi/supplicant/DppFailureCode.aidl | 49 +++ .../hardware/wifi/supplicant/DppNetRole.aidl | 39 ++ .../wifi/supplicant/DppProgressCode.aidl | 41 ++ .../supplicant/DppResponderBootstrapInfo.aidl | 40 ++ .../wifi/supplicant/EapErrorCode.aidl | 42 ++ .../hardware/wifi/supplicant/EapMethod.aidl | 45 +++ .../wifi/supplicant/EapPhase2Method.aidl | 45 +++ .../wifi/supplicant/ExtRadioWorkDefaults.aidl | 38 ++ .../hardware/wifi/supplicant/FreqRange.aidl | 39 ++ .../wifi/supplicant/GroupCipherMask.aidl | 45 +++ .../wifi/supplicant/GroupMgmtCipherMask.aidl | 40 ++ .../hardware/wifi/supplicant/GsmRand.aidl | 38 ++ .../wifi/supplicant/Hs20AnqpData.aidl | 41 ++ .../wifi/supplicant/Hs20AnqpSubtypes.aidl | 41 ++ .../hardware/wifi/supplicant/ISupplicant.aidl | 51 +++ .../wifi/supplicant/ISupplicantCallback.aidl | 39 ++ .../wifi/supplicant/ISupplicantP2pIface.aidl | 99 +++++ .../ISupplicantP2pIfaceCallback.aidl | 55 +++ .../supplicant/ISupplicantP2pNetwork.aidl | 47 +++ .../wifi/supplicant/ISupplicantStaIface.aidl | 98 +++++ .../ISupplicantStaIfaceCallback.aidl | 66 +++ .../supplicant/ISupplicantStaNetwork.aidl | 136 +++++++ .../ISupplicantStaNetworkCallback.aidl | 42 ++ .../hardware/wifi/supplicant/IfaceInfo.aidl | 39 ++ .../hardware/wifi/supplicant/IfaceType.aidl | 39 ++ .../hardware/wifi/supplicant/IpVersion.aidl | 39 ++ .../hardware/wifi/supplicant/KeyMgmtMask.aidl | 54 +++ .../hardware/wifi/supplicant/LegacyMode.aidl | 41 ++ .../hardware/wifi/supplicant/MacAddress.aidl | 38 ++ .../MboAssocDisallowedReasonCode.aidl | 43 ++ .../MboCellularDataConnectionPrefValue.aidl | 40 ++ .../supplicant/MboTransitionReasonCode.aidl | 47 +++ .../wifi/supplicant/MiracastMode.aidl | 40 ++ .../hardware/wifi/supplicant/MloLink.aidl | 39 ++ .../wifi/supplicant/MloLinksInfo.aidl | 38 ++ .../NetworkRequestEapSimGsmAuthParams.aidl | 38 ++ .../NetworkRequestEapSimUmtsAuthParams.aidl | 39 ++ .../NetworkResponseEapSimGsmAuthParams.aidl | 39 ++ .../NetworkResponseEapSimUmtsAuthParams.aidl | 40 ++ .../OceRssiBasedAssocRejectAttr.aidl | 39 ++ .../hardware/wifi/supplicant/OcspType.aidl | 41 ++ .../hardware/wifi/supplicant/OsuMethod.aidl | 39 ++ .../wifi/supplicant/P2pFrameTypeMask.aidl | 50 +++ .../supplicant/P2pGroupCapabilityMask.aidl | 44 ++ .../supplicant/P2pProvDiscStatusCode.aidl | 42 ++ .../wifi/supplicant/P2pStatusCode.aidl | 50 +++ .../wifi/supplicant/PairwiseCipherMask.aidl | 43 ++ .../hardware/wifi/supplicant/PortRange.aidl | 39 ++ .../hardware/wifi/supplicant/ProtoMask.aidl | 41 ++ .../wifi/supplicant/ProtocolNextHeader.aidl | 40 ++ .../supplicant/QosPolicyClassifierParams.aidl | 46 +++ .../QosPolicyClassifierParamsMask.aidl | 44 ++ .../wifi/supplicant/QosPolicyData.aidl | 41 ++ .../wifi/supplicant/QosPolicyRequestType.aidl | 39 ++ .../wifi/supplicant/QosPolicyStatus.aidl | 39 ++ .../wifi/supplicant/QosPolicyStatusCode.aidl | 41 ++ .../wifi/supplicant/RxFilterType.aidl | 39 ++ .../hardware/wifi/supplicant/SaeH2eMode.aidl | 40 ++ .../supplicant/StaIfaceCallbackState.aidl | 47 +++ .../wifi/supplicant/StaIfaceReasonCode.aidl | 98 +++++ .../wifi/supplicant/StaIfaceStatusCode.aidl | 134 +++++++ .../wifi/supplicant/SupplicantStatusCode.aidl | 48 +++ .../TransitionDisableIndication.aidl | 41 ++ .../wifi/supplicant/WifiTechnology.aidl | 43 ++ .../supplicant/WpaDriverCapabilitiesMask.aidl | 42 ++ .../wifi/supplicant/WpsConfigError.aidl | 58 +++ .../wifi/supplicant/WpsConfigMethods.aidl | 51 +++ .../wifi/supplicant/WpsDevPasswordId.aidl | 45 +++ .../wifi/supplicant/WpsErrorIndication.aidl | 41 ++ .../wifi/supplicant/WpsProvisionMethod.aidl | 40 ++ 1039 files changed, 46402 insertions(+), 20 deletions(-) create mode 100644 audio/aidl/aidl_api/android.hardware.audio.common/1/.hash create mode 100644 audio/aidl/aidl_api/android.hardware.audio.common/1/android/hardware/audio/common/PlaybackTrackMetadata.aidl create mode 100644 audio/aidl/aidl_api/android.hardware.audio.common/1/android/hardware/audio/common/RecordTrackMetadata.aidl create mode 100644 audio/aidl/aidl_api/android.hardware.audio.common/1/android/hardware/audio/common/SinkMetadata.aidl create mode 100644 audio/aidl/aidl_api/android.hardware.audio.common/1/android/hardware/audio/common/SourceMetadata.aidl create mode 100644 automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/.hash create mode 100644 automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl create mode 100644 automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl create mode 100644 automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/DuckingInfo.aidl create mode 100644 automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/IAudioControl.aidl create mode 100644 automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl create mode 100644 automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/IFocusListener.aidl create mode 100644 automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/MutingInfo.aidl create mode 100644 automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/Reasons.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/.hash create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/BufferDesc.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/CameraDesc.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/CameraParam.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DeviceStatus.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DeviceStatusType.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DisplayDesc.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DisplayState.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/EvsEventDesc.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/EvsEventType.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/EvsResult.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsCamera.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsCameraStream.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsDisplay.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsEnumerator.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsUltrasonicsArray.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/ParameterRange.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/Rotation.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/RotationQuaternion.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/SensorPose.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/Stream.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/StreamType.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/Translation.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/UltrasonicSensor.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/UltrasonicsArrayDesc.aidl create mode 100644 automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserResponse.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserStatus.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CustomInputType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvChargeState.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvConnectorType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceState.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/FuelType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueRequests.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueResult.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueResults.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/IVehicle.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/IVehicleCallback.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/PortLocationType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RawPropValues.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RemoveUserRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RotaryInputType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueRequests.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueResult.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueResults.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/StatusCode.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SubscribeOptions.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserResponse.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserStatus.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/TrailerState.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserInfo.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UsersInfo.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleArea.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleDisplay.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleGear.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightState.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleOilLevel.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropConfig.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropError.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropErrors.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropValue.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropValues.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleProperty.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleUnit.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageType.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl create mode 100644 automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/.hash create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/AcquiredInfo.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/AuthenticationFrame.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/BaseFrame.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/Cell.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentFrame.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentStage.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentStageConfig.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentType.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/Error.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/FaceSensorType.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/Feature.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/IFace.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/ISession.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/ISessionCallback.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/SensorProps.aidl create mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/.hash create mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl create mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/Error.aidl create mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl create mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/IFingerprint.aidl create mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISession.aidl create mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISessionCallback.aidl create mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/PointerContext.aidl create mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorLocation.aidl create mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorProps.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/.hash create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AacCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AacConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AacObjectType.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveChannelMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveInputMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveTimeToPlay.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxSinkBuffering.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AudioCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AudioConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AudioLocation.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/BroadcastCapability.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/ChannelMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/CodecCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/CodecConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/CodecType.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LatencyMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/Lc3Capabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/Lc3Configuration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacChannelMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacQualityIndex.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioCodecCapabilitiesSetting.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/PcmCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/PcmConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/PresentationPosition.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcAllocMethod.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcChannelMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SessionType.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/UnicastCapability.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/.hash create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferCache.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferRequest.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferRequestStatus.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferStatus.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraBlob.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraBlobId.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraMetadata.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraOfflineSessionInfo.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CaptureRequest.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CaptureResult.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ErrorCode.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ErrorMsg.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/HalStream.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraDevice.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraDeviceCallback.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraDeviceSession.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraInjectionSession.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraOfflineSession.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/NotifyMsg.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/OfflineRequest.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/OfflineStream.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/PhysicalCameraMetadata.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/PhysicalCameraSetting.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/RequestTemplate.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ShutterMsg.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/Stream.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBuffer.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBufferRequestError.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBufferRet.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBuffersVal.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamConfiguration.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamConfigurationMode.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamRotation.aidl create mode 100644 camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamType.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/.hash create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/AutomotiveLensFacing.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/AutomotiveLocation.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/BlackLevelLock.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/CameraMetadataSection.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/CameraMetadataTag.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ColorCorrectionMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeLock.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeLockAvailable.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeState.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfSceneChange.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfState.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfTrigger.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbLock.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbState.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlCaptureIntent.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlEffectMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlEnableZsl.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlSceneMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DemosaicMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DistortionCorrectionMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/EdgeMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/FlashInfoAvailable.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/FlashMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/FlashState.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HeicInfoSupported.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HotPixelMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LedAvailableLeds.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LedTransmit.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensFacing.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensPoseReference.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensState.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/NoiseReductionMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/QuirksPartialResult.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestMetadataMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestType.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableFormats.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerCroppingType.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorPixelMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorTestPatternMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ShadingMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsHistogramMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsOisDataMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SyncFrameNumber.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SyncMaxLatency.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/TonemapMode.aidl create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/TonemapPresetCurve.aidl create mode 100644 camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/.hash create mode 100644 camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl create mode 100644 camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl create mode 100644 camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/ICameraProvider.aidl create mode 100644 camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/ICameraProviderCallback.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/.hash create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/BlocklistedSource.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/CorrelationVector.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/ElapsedRealtime.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssClock.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssConstellationType.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssData.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssLocation.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssMeasurement.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssMultipathIndicator.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssPowerStats.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssSignalType.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnss.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnssCallback.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnssRil.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnssRilCallback.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnss.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssAntennaInfo.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssAntennaInfoCallback.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssBatching.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssBatchingCallback.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssCallback.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssConfiguration.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssDebug.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssGeofence.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssGeofenceCallback.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssMeasurementCallback.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssMeasurementInterface.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssNavigationMessageCallback.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssNavigationMessageInterface.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPowerIndication.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPowerIndicationCallback.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPsds.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPsdsCallback.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/PsdsType.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatelliteClockInfo.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatellitePositionEcef.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatellitePvt.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatelliteVelocityEcef.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl create mode 100644 gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/.hash create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/AlphaInterpretation.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/BlendMode.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/BufferUsage.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/ChromaSiting.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/ColorTransform.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Compression.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Cta861_3.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Dataspace.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/DisplayDecorationSupport.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/ExtendableType.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/FRect.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/HardwareBuffer.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/HardwareBufferDescription.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Hdr.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Interlaced.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PixelFormat.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PlaneLayout.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PlaneLayoutComponent.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PlaneLayoutComponentType.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Point.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Rect.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Smpte2086.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/StandardMetadataType.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Transform.aidl create mode 100644 graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/XyColor.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/.hash create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Buffer.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Capability.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClientTarget.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClientTargetProperty.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Color.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ColorMode.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/CommandError.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/CommandResultPayload.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Composition.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ContentType.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DimmingStage.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayAttribute.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayBrightness.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayCapability.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayCommand.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayConnectionType.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayContentSample.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayIdentification.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayRequest.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/FormatColorComponent.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/HdrCapabilities.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/IComposer.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/IComposerCallback.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/IComposerClient.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/LayerBrightness.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/LayerCommand.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableBlendMode.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableComposition.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableDataspace.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableTransform.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PerFrameMetadata.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PerFrameMetadataBlob.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PlaneAlpha.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PowerMode.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PresentFence.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PresentOrValidate.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ReadbackBufferAttributes.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ReleaseFences.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/RenderIntent.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/VirtualDisplay.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.aidl create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ZOrder.aidl create mode 100644 identity/aidl/aidl_api/android.hardware.identity/4/.hash create mode 100644 identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/Certificate.aidl create mode 100644 identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/CipherSuite.aidl create mode 100644 identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/HardwareInformation.aidl create mode 100644 identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IIdentityCredential.aidl create mode 100644 identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IIdentityCredentialStore.aidl create mode 100644 identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IPresentationSession.aidl create mode 100644 identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IWritableIdentityCredential.aidl create mode 100644 identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/RequestDataItem.aidl create mode 100644 identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/RequestNamespace.aidl create mode 100644 identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/SecureAccessControlProfile.aidl create mode 100644 input/processor/aidl/aidl_api/android.hardware.input.processor/1/.hash create mode 100644 input/processor/aidl/aidl_api/android.hardware.input.processor/1/android/hardware/input/processor/IInputProcessor.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/.hash create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/BufferDesc.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/BufferRole.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Capabilities.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/DataLocation.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/DeviceBuffer.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/DeviceType.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ErrorStatus.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExecutionConfig.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExecutionPreference.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExecutionResult.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Extension.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/FencedExecutionResult.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/FusedActivationFunc.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IBuffer.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IBurst.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IDevice.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IExecution.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IPreparedModel.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IPreparedModelCallback.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IPreparedModelParcel.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Memory.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Model.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Operand.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandExtraParams.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandLifeTime.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandPerformance.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandType.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Operation.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperationType.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OutputShape.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/PerformanceInfo.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/PrepareModelConfig.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Priority.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Request.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/RequestArgument.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/RequestMemoryPool.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Subgraph.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Timing.aidl create mode 100644 neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/TokenValuePair.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.config/1/.hash create mode 100644 radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/IRadioConfig.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/IRadioConfigIndication.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/IRadioConfigResponse.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/PhoneCapability.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimPortInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimSlotStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SlotPortMapping.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/.hash create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnAuthType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnTypes.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataCallFailCause.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataProfileInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataRequestReason.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataThrottlingAction.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/EpsQos.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/IRadioData.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/IRadioDataIndication.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/IRadioDataResponse.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveRequest.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/LinkAddress.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/NrQos.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/OsAppId.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PcoDataInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PdpProtocolType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PortRange.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/Qos.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosBandwidth.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilter.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpsecSpi.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterTypeOfService.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosSession.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/RouteSelectionDescriptor.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SetupDataCallResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SliceInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SlicingConfig.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/TrafficDescriptor.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/UrspRule.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/.hash create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAck.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAddress.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsMessage.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmSmsMessage.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/IRadioMessaging.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/IRadioMessagingIndication.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/IRadioMessagingResponse.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/ImsSmsMessage.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SendSmsResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsWriteArgs.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/.hash create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/DeviceStateType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfig.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigModem.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigSim.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/IRadioModem.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/IRadioModemIndication.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/IRadioModemResponse.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvItem.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvWriteItem.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioCapability.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ResetNvType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/.hash create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringTypeSpecificInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaRoamingType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaSignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellConnectionStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentity.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityCdma.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityGsm.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityLte.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityNr.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityTdscdma.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityWcdma.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoCdma.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoGsm.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoLte.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoNr.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoTdscdma.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoWcdma.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Domain.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranBands.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranRegistrationInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EvdoSignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GeranBands.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GsmSignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IRadioNetwork.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IRadioNetworkIndication.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IRadioNetworkResponse.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IndicationFilter.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LceDataInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LinkCapacityEstimate.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteSignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteVopsInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanRequest.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NgranBands.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrDualConnectivityState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrIndicators.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrSignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrVopsInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/OperatorInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhoneRestrictedState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfig.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfigBand.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifier.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifierBands.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioBandMode.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegStateResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegistrationFailCause.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalThresholdInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SuppSvcNotification.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/TdscdmaSignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UsageSetting.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UtranBands.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/WcdmaSignalStrength.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/.hash create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/AppStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardPowerState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/Carrier.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CarrierRestrictions.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CdmaSubscriptionSource.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IRadioSim.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IRadioSimIndication.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IRadioSimResponse.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIoResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/ImsiEncryptionInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PbReceivedStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PersoSubstate.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookCapacity.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookRecordInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PinState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SelectUiccSub.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimApdu.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimRefreshResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/.hash create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/AudioQuality.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Call.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CallForwardInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaCallWaiting.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaInformationRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CfData.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/ClipStatus.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Dial.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyCallRouting.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyNumber.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyServiceCategory.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/IRadioVoice.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/IRadioVoiceIndication.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/IRadioVoiceResponse.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCause.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCauseInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SrvccState.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SsInfoData.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/StkCcUnsolSsResult.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/TtyMode.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UssdModeType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UusInfo.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/.hash create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Algorithm.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/AttestationKey.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/BeginResult.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/BlockMode.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Certificate.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/DeviceInfo.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Digest.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/EcCurve.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/ErrorCode.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/HardwareAuthToken.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/HardwareAuthenticatorType.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/IKeyMintDevice.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/IKeyMintOperation.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyCharacteristics.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyCreationResult.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyFormat.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyMintHardwareInfo.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyOrigin.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyParameter.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyParameterValue.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyPurpose.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/MacedPublicKey.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/PaddingMode.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/ProtectedData.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/RpcHardwareInfo.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/SecurityLevel.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Tag.aidl create mode 100644 security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/TagType.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/1/.hash create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/AdditionalInfo.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/DynamicSensorInfo.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/Event.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/ISensors.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/ISensorsCallback.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/SensorInfo.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/SensorStatus.aidl create mode 100644 sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/SensorType.aidl create mode 100644 soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/.hash create mode 100644 soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/android/hardware/soundtrigger3/ISoundTriggerHw.aidl create mode 100644 soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl create mode 100644 soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/.hash create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/AudioExtraMetaData.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/AudioStreamType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/AvStreamType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/Constant.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/Constant64Bit.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DataFormat.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpFilterType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpLengthType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMainType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterStatus.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSubType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpAddress.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpFilterType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxPid.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxScAvcIndex.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxScHevcIndex.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxScIndex.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTlvFilterType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsFilterType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsIndex.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DvrSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DvrType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FilterDelayHint.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FilterDelayHintType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtscModulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtscSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendBandwidth.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbModulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcModulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsModulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsPilot.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsScanType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsStandard.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtStandard.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendEventType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendGuardInterval.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendInfo.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendInnerFec.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendInterleaveMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtLayerSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtPartialReceptionFlag.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtTimeInterleaveMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendModulation.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendModulationStatus.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendRollOff.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanMessage.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanMessageType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendSpectralInversion.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatus.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatusReadiness.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatusType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendTransmissionMode.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDemux.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDescrambler.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDvr.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDvrCallback.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFilter.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFilterCallback.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFrontend.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFrontendCallback.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ILnb.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ILnbCallback.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ITimeFilter.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ITuner.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbEventType.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbPosition.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbTone.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbVoltage.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/PlaybackSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/PlaybackStatus.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/RecordSettings.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/RecordStatus.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/Result.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ScramblingStatus.aidl create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/VideoStreamType.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/.hash create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AnqpData.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AnqpInfoId.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AssociationRejectionData.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AuthAlgMask.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssTmData.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssTmStatusCode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssidChangeReason.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BtCoexistenceMode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DebugLevel.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppAkm.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppConnectionKeys.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppCurve.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppEventType.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppFailureCode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppNetRole.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppProgressCode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppResponderBootstrapInfo.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/EapErrorCode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/EapMethod.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/EapPhase2Method.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ExtRadioWorkDefaults.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/FreqRange.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/GroupCipherMask.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/GsmRand.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/Hs20AnqpData.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/Hs20AnqpSubtypes.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicant.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantCallback.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantP2pNetwork.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/IfaceInfo.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/IfaceType.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/IpVersion.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/KeyMgmtMask.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/LegacyMode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MacAddress.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MboAssocDisallowedReasonCode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MboCellularDataConnectionPrefValue.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MboTransitionReasonCode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MiracastMode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MloLink.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MloLinksInfo.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkRequestEapSimGsmAuthParams.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkRequestEapSimUmtsAuthParams.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkResponseEapSimGsmAuthParams.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkResponseEapSimUmtsAuthParams.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/OceRssiBasedAssocRejectAttr.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/OcspType.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/OsuMethod.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pProvDiscStatusCode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pStatusCode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/PortRange.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ProtoMask.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyData.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyStatus.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/RxFilterType.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/SaeH2eMode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/StaIfaceCallbackState.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/StaIfaceReasonCode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/StaIfaceStatusCode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WifiTechnology.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsConfigError.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsConfigMethods.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsErrorIndication.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp index a8846b0ac5..46d177f79d 100644 --- a/audio/aidl/Android.bp +++ b/audio/aidl/Android.bp @@ -59,6 +59,11 @@ aidl_interface { min_sdk_version: "31", }, }, - versions: [ + versions_with_info: [ + { + version: "1", + imports: ["android.media.audio.common.types-V1"], + }, ], + } diff --git a/audio/aidl/aidl_api/android.hardware.audio.common/1/.hash b/audio/aidl/aidl_api/android.hardware.audio.common/1/.hash new file mode 100644 index 0000000000..7fe1e43876 --- /dev/null +++ b/audio/aidl/aidl_api/android.hardware.audio.common/1/.hash @@ -0,0 +1 @@ +90d0a7ea5cee4579d33066885d8648f180387f55 diff --git a/audio/aidl/aidl_api/android.hardware.audio.common/1/android/hardware/audio/common/PlaybackTrackMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/1/android/hardware/audio/common/PlaybackTrackMetadata.aidl new file mode 100644 index 0000000000..be4941c751 --- /dev/null +++ b/audio/aidl/aidl_api/android.hardware.audio.common/1/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 -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/1/android/hardware/audio/common/RecordTrackMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/1/android/hardware/audio/common/RecordTrackMetadata.aidl new file mode 100644 index 0000000000..8f667d1081 --- /dev/null +++ b/audio/aidl/aidl_api/android.hardware.audio.common/1/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 -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/1/android/hardware/audio/common/SinkMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/1/android/hardware/audio/common/SinkMetadata.aidl new file mode 100644 index 0000000000..270147d2bb --- /dev/null +++ b/audio/aidl/aidl_api/android.hardware.audio.common/1/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 -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/1/android/hardware/audio/common/SourceMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/1/android/hardware/audio/common/SourceMetadata.aidl new file mode 100644 index 0000000000..2d4a982352 --- /dev/null +++ b/audio/aidl/aidl_api/android.hardware.audio.common/1/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 -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/automotive/audiocontrol/aidl/Android.bp b/automotive/audiocontrol/aidl/Android.bp index 890d7a0d89..0a3e1f5913 100644 --- a/automotive/audiocontrol/aidl/Android.bp +++ b/automotive/audiocontrol/aidl/Android.bp @@ -28,7 +28,22 @@ aidl_interface { ], }, }, - versions: [ - "1", + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.audio.common-V1", + "android.media.audio.common.types-V1", + ], + }, + { + version: "2", + imports: [ + "android.hardware.audio.common-V1", + "android.media.audio.common.types-V1", + ], + }, + ], + } diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/.hash b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/.hash new file mode 100644 index 0000000000..c10902125c --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/.hash @@ -0,0 +1 @@ +b9c1e8584d328e39eac9eff2ef039a6541186cc4 diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl new file mode 100644 index 0000000000..58a36673cd --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl @@ -0,0 +1,45 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@Backing(type="int") @VintfStability +enum AudioFocusChange { + NONE = 0, + GAIN = 1, + GAIN_TRANSIENT = 2, + GAIN_TRANSIENT_MAY_DUCK = 3, + GAIN_TRANSIENT_EXCLUSIVE = 4, + LOSS = -1, + LOSS_TRANSIENT = -2, + LOSS_TRANSIENT_CAN_DUCK = -3, +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl new file mode 100644 index 0000000000..91ce035229 --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.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 -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.audiocontrol; +@VintfStability +parcelable AudioGainConfigInfo { + int zoneId; + String devicePortAddress; + int volumeIndex; +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/DuckingInfo.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/DuckingInfo.aidl new file mode 100644 index 0000000000..23abb46bd7 --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/DuckingInfo.aidl @@ -0,0 +1,42 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@VintfStability +parcelable DuckingInfo { + int zoneId; + String[] deviceAddressesToDuck; + String[] deviceAddressesToUnduck; + String[] usagesHoldingFocus; + @nullable android.hardware.audio.common.PlaybackTrackMetadata[] playbackMetaDataHoldingFocus; +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/IAudioControl.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/IAudioControl.aidl new file mode 100644 index 0000000000..8dc5ffe2eb --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/IAudioControl.aidl @@ -0,0 +1,49 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@VintfStability +interface IAudioControl { + /** + * @deprecated use {@link android.hardware.audio.common.PlaybackTrackMetadata} instead. + */ + oneway void onAudioFocusChange(in String usage, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusChange); + oneway void onDevicesToDuckChange(in android.hardware.automotive.audiocontrol.DuckingInfo[] duckingInfos); + oneway void onDevicesToMuteChange(in android.hardware.automotive.audiocontrol.MutingInfo[] mutingInfos); + oneway void registerFocusListener(in android.hardware.automotive.audiocontrol.IFocusListener listener); + oneway void setBalanceTowardRight(in float value); + oneway void setFadeTowardFront(in float value); + oneway void onAudioFocusChangeWithMetaData(in android.hardware.audio.common.PlaybackTrackMetadata playbackMetaData, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusChange); + oneway void setAudioDeviceGainsChanged(in android.hardware.automotive.audiocontrol.Reasons[] reasons, in android.hardware.automotive.audiocontrol.AudioGainConfigInfo[] gains); + oneway void registerGainCallback(in android.hardware.automotive.audiocontrol.IAudioGainCallback callback); +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl new file mode 100644 index 0000000000..17a087f20c --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/IAudioGainCallback.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 -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.audiocontrol; +@VintfStability +interface IAudioGainCallback { + oneway void onAudioDeviceGainsChanged(in android.hardware.automotive.audiocontrol.Reasons[] reasons, in android.hardware.automotive.audiocontrol.AudioGainConfigInfo[] gains); +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/IFocusListener.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/IFocusListener.aidl new file mode 100644 index 0000000000..3e175529fa --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/IFocusListener.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@VintfStability +interface IFocusListener { + oneway void abandonAudioFocus(in String usage, in int zoneId); + oneway void requestAudioFocus(in String usage, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusGain); + oneway void abandonAudioFocusWithMetaData(in android.hardware.audio.common.PlaybackTrackMetadata playbackMetaData, in int zoneId); + oneway void requestAudioFocusWithMetaData(in android.hardware.audio.common.PlaybackTrackMetadata playbackMetaData, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusGain); +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/MutingInfo.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/MutingInfo.aidl new file mode 100644 index 0000000000..b25ed0f1e9 --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/MutingInfo.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.audiocontrol; +@VintfStability +parcelable MutingInfo { + int zoneId; + String[] deviceAddressesToMute; + String[] deviceAddressesToUnmute; +} diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/Reasons.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/Reasons.aidl new file mode 100644 index 0000000000..c1e22d44a7 --- /dev/null +++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/2/android/hardware/automotive/audiocontrol/Reasons.aidl @@ -0,0 +1,47 @@ +/* + * 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 -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.audiocontrol; +@Backing(type="int") @VintfStability +enum Reasons { + FORCED_MASTER_MUTE = 1, + REMOTE_MUTE = 2, + TCU_MUTE = 4, + ADAS_DUCKING = 8, + NAV_DUCKING = 16, + PROJECTION_DUCKING = 32, + THERMAL_LIMITATION = 64, + SUSPEND_EXIT_VOL_LIMITATION = 128, + EXTERNAL_AMP_VOL_FEEDBACK = 256, + OTHER = -2147483648, +} diff --git a/automotive/evs/aidl/Android.bp b/automotive/evs/aidl/Android.bp index 3c0aa13f49..1c908aa60d 100644 --- a/automotive/evs/aidl/Android.bp +++ b/automotive/evs/aidl/Android.bp @@ -25,7 +25,7 @@ aidl_interface { name: "android.hardware.automotive.evs", vendor_available: true, srcs: [ - "android/hardware/automotive/evs/*.aidl" + "android/hardware/automotive/evs/*.aidl", ], stability: "vintf", imports: [ @@ -45,7 +45,17 @@ aidl_interface { vndk: { enabled: false, }, - min_sdk_version: "29" + min_sdk_version: "29", }, }, + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.common-V2", + "android.hardware.graphics.common-V3", + ], + }, + ], + } diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/.hash b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/.hash new file mode 100644 index 0000000000..b01d9abbc1 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/.hash @@ -0,0 +1 @@ +4ebb038edc1da5aa232909382999b2831e70a319 diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/BufferDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/BufferDesc.aidl new file mode 100644 index 0000000000..31acdb8e27 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/BufferDesc.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 -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.evs; +@VintfStability +parcelable BufferDesc { + android.hardware.graphics.common.HardwareBuffer buffer; + int pixelSizeBytes; + int bufferId; + @utf8InCpp String deviceId; + long timestamp; + byte[] metadata; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/CameraDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/CameraDesc.aidl new file mode 100644 index 0000000000..4dadeb88b2 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/CameraDesc.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 -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.evs; +@VintfStability +parcelable CameraDesc { + @utf8InCpp String id; + int vendorFlags; + byte[] metadata; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/CameraParam.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/CameraParam.aidl new file mode 100644 index 0000000000..ae4ce77192 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/CameraParam.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 -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.evs; +@Backing(type="int") @VintfStability +enum CameraParam { + BRIGHTNESS = 0, + CONTRAST = 1, + AUTOGAIN = 2, + GAIN = 3, + AUTO_WHITE_BALANCE = 4, + WHITE_BALANCE_TEMPERATURE = 5, + SHARPNESS = 6, + AUTO_EXPOSURE = 7, + ABSOLUTE_EXPOSURE = 8, + ABSOLUTE_FOCUS = 9, + AUTO_FOCUS = 10, + ABSOLUTE_ZOOM = 11, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DeviceStatus.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DeviceStatus.aidl new file mode 100644 index 0000000000..cc066ac6db --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DeviceStatus.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 -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.evs; +@VintfStability +parcelable DeviceStatus { + @utf8InCpp String id; + android.hardware.automotive.evs.DeviceStatusType status; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DeviceStatusType.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DeviceStatusType.aidl new file mode 100644 index 0000000000..d0f1d8e1d6 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DeviceStatusType.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 -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.evs; +@Backing(type="int") @VintfStability +enum DeviceStatusType { + CAMERA_AVAILABLE = 0, + CAMERA_NOT_AVAILABLE = 1, + DISPLAY_AVAILABLE = 2, + DISPLAY_NOT_AVAILABLE = 3, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DisplayDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DisplayDesc.aidl new file mode 100644 index 0000000000..4ac029e479 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DisplayDesc.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 -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.evs; +@VintfStability +parcelable DisplayDesc { + @utf8InCpp String id; + int width; + int height; + android.hardware.automotive.evs.Rotation orientation; + int vendorFlags; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DisplayState.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DisplayState.aidl new file mode 100644 index 0000000000..a5f43095c8 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/DisplayState.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 -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.evs; +@Backing(type="int") @VintfStability +enum DisplayState { + NOT_OPEN = 0, + NOT_VISIBLE = 1, + VISIBLE_ON_NEXT_FRAME = 2, + VISIBLE = 3, + DEAD = 4, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/EvsEventDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/EvsEventDesc.aidl new file mode 100644 index 0000000000..09b2b9db13 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/EvsEventDesc.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 -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.evs; +@VintfStability +parcelable EvsEventDesc { + android.hardware.automotive.evs.EvsEventType aType; + @utf8InCpp String deviceId; + int[] payload; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/EvsEventType.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/EvsEventType.aidl new file mode 100644 index 0000000000..052a6b3969 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/EvsEventType.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 -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.evs; +@Backing(type="int") @VintfStability +enum EvsEventType { + STREAM_STARTED = 0, + STREAM_STOPPED = 1, + FRAME_DROPPED = 2, + TIMEOUT = 3, + PARAMETER_CHANGED = 4, + MASTER_RELEASED = 5, + STREAM_ERROR = 6, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/EvsResult.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/EvsResult.aidl new file mode 100644 index 0000000000..a0418a94ef --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/EvsResult.aidl @@ -0,0 +1,48 @@ +/* + * 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 -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.evs; +@Backing(type="int") @VintfStability +enum EvsResult { + OK = 0, + INVALID_ARG = 1, + STREAM_ALREADY_RUNNING = 2, + BUFFER_NOT_AVAILABLE = 3, + OWNERSHIP_LOST = 4, + UNDERLYING_SERVICE_ERROR = 5, + PERMISSION_DENIED = 6, + RESOURCE_NOT_AVAILABLE = 7, + RESOURCE_BUSY = 8, + NOT_IMPLEMENTED = 9, + NOT_SUPPORTED = 10, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsCamera.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsCamera.aidl new file mode 100644 index 0000000000..ce1b97d16c --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsCamera.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 -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.evs; +@VintfStability +interface IEvsCamera { + void doneWithFrame(in android.hardware.automotive.evs.BufferDesc[] buffer); + void forcePrimaryClient(in android.hardware.automotive.evs.IEvsDisplay display); + android.hardware.automotive.evs.CameraDesc getCameraInfo(); + byte[] getExtendedInfo(in int opaqueIdentifier); + int[] getIntParameter(in android.hardware.automotive.evs.CameraParam id); + android.hardware.automotive.evs.ParameterRange getIntParameterRange(in android.hardware.automotive.evs.CameraParam id); + android.hardware.automotive.evs.CameraParam[] getParameterList(); + android.hardware.automotive.evs.CameraDesc getPhysicalCameraInfo(in String deviceId); + int importExternalBuffers(in android.hardware.automotive.evs.BufferDesc[] buffers); + void pauseVideoStream(); + void resumeVideoStream(); + void setExtendedInfo(in int opaqueIdentifier, in byte[] opaqueValue); + int[] setIntParameter(in android.hardware.automotive.evs.CameraParam id, in int value); + void setPrimaryClient(); + void setMaxFramesInFlight(in int bufferCount); + void startVideoStream(in android.hardware.automotive.evs.IEvsCameraStream receiver); + void stopVideoStream(); + void unsetPrimaryClient(); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsCameraStream.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsCameraStream.aidl new file mode 100644 index 0000000000..6e2e64a3c4 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsCameraStream.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 -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.evs; +@VintfStability +interface IEvsCameraStream { + oneway void deliverFrame(in android.hardware.automotive.evs.BufferDesc[] buffer); + oneway void notify(in android.hardware.automotive.evs.EvsEventDesc event); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsDisplay.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsDisplay.aidl new file mode 100644 index 0000000000..9b538d43a2 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsDisplay.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 -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.evs; +@VintfStability +interface IEvsDisplay { + android.hardware.automotive.evs.DisplayDesc getDisplayInfo(); + android.hardware.automotive.evs.DisplayState getDisplayState(); + android.hardware.automotive.evs.BufferDesc getTargetBuffer(); + void returnTargetBufferForDisplay(in android.hardware.automotive.evs.BufferDesc buffer); + void setDisplayState(in android.hardware.automotive.evs.DisplayState state); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsEnumerator.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsEnumerator.aidl new file mode 100644 index 0000000000..225b5041b8 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsEnumerator.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 -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.evs; +@VintfStability +interface IEvsEnumerator { + void closeCamera(in android.hardware.automotive.evs.IEvsCamera carCamera); + void closeDisplay(in android.hardware.automotive.evs.IEvsDisplay display); + void closeUltrasonicsArray(in android.hardware.automotive.evs.IEvsUltrasonicsArray evsUltrasonicsArray); + android.hardware.automotive.evs.CameraDesc[] getCameraList(); + byte[] getDisplayIdList(); + android.hardware.automotive.evs.DisplayState getDisplayState(); + android.hardware.automotive.evs.Stream[] getStreamList(in android.hardware.automotive.evs.CameraDesc description); + android.hardware.automotive.evs.UltrasonicsArrayDesc[] getUltrasonicsArrayList(); + boolean isHardware(); + android.hardware.automotive.evs.IEvsCamera openCamera(in String cameraId, in android.hardware.automotive.evs.Stream streamCfg); + android.hardware.automotive.evs.IEvsDisplay openDisplay(in int id); + android.hardware.automotive.evs.IEvsUltrasonicsArray openUltrasonicsArray(in String ultrasonicsArrayId); + void registerStatusCallback(in android.hardware.automotive.evs.IEvsEnumeratorStatusCallback callback); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.aidl new file mode 100644 index 0000000000..c39a4e855e --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.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 -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.evs; +@VintfStability +interface IEvsEnumeratorStatusCallback { + oneway void deviceStatusChanged(in android.hardware.automotive.evs.DeviceStatus[] status); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsUltrasonicsArray.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsUltrasonicsArray.aidl new file mode 100644 index 0000000000..1183ab392c --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsUltrasonicsArray.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 -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.evs; +@VintfStability +interface IEvsUltrasonicsArray { + void doneWithDataFrame(in android.hardware.automotive.evs.UltrasonicsDataFrameDesc dataFrameDesc); + android.hardware.automotive.evs.UltrasonicsArrayDesc getUltrasonicArrayInfo(); + void setMaxFramesInFlight(in int bufferCount); + void startStream(in android.hardware.automotive.evs.IEvsUltrasonicsArrayStream stream); + void stopStream(); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.aidl new file mode 100644 index 0000000000..510b0a4692 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/IEvsUltrasonicsArrayStream.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 -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.evs; +@VintfStability +interface IEvsUltrasonicsArrayStream { + oneway void deliverDataFrame(in android.hardware.automotive.evs.UltrasonicsDataFrameDesc dataFrameDesc); + oneway void notify(in android.hardware.automotive.evs.EvsEventDesc event); +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/ParameterRange.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/ParameterRange.aidl new file mode 100644 index 0000000000..44e9b59276 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/ParameterRange.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 -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.evs; +@VintfStability +parcelable ParameterRange { + int min; + int max; + int step; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/Rotation.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/Rotation.aidl new file mode 100644 index 0000000000..91971fc5e7 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/Rotation.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 -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.evs; +@Backing(type="int") @VintfStability +enum Rotation { + ROTATION_0 = 0, + ROTATION_90 = 1, + ROTATION_180 = 2, + ROTATION_270 = 3, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/RotationQuaternion.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/RotationQuaternion.aidl new file mode 100644 index 0000000000..d9c8b6e247 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/RotationQuaternion.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 -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.evs; +@VintfStability +parcelable RotationQuaternion { + float x; + float y; + float z; + float w; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/SensorPose.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/SensorPose.aidl new file mode 100644 index 0000000000..4ead9eaf2e --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/SensorPose.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 -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.evs; +@VintfStability +parcelable SensorPose { + android.hardware.automotive.evs.RotationQuaternion rotation; + android.hardware.automotive.evs.Translation translation; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/Stream.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/Stream.aidl new file mode 100644 index 0000000000..154a693a51 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/Stream.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 -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.evs; +@VintfStability +parcelable Stream { + int id; + android.hardware.automotive.evs.StreamType streamType; + int width; + int height; + int framerate; + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.BufferUsage usage; + android.hardware.automotive.evs.Rotation rotation; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/StreamType.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/StreamType.aidl new file mode 100644 index 0000000000..9819c8910b --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/StreamType.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 -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.evs; +@Backing(type="int") @VintfStability +enum StreamType { + OUTPUT = 0, + INPUT = 1, +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/Translation.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/Translation.aidl new file mode 100644 index 0000000000..488d80f479 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/Translation.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 -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.evs; +@VintfStability +parcelable Translation { + float x; + float y; + float z; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/UltrasonicSensor.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/UltrasonicSensor.aidl new file mode 100644 index 0000000000..23f81f8093 --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/UltrasonicSensor.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 -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.evs; +@VintfStability +parcelable UltrasonicSensor { + android.hardware.automotive.evs.SensorPose pose; + float maxRangeMm; + float angleOfMeasurement; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/UltrasonicsArrayDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/UltrasonicsArrayDesc.aidl new file mode 100644 index 0000000000..4a988759fd --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/UltrasonicsArrayDesc.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 -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.evs; +@VintfStability +parcelable UltrasonicsArrayDesc { + @utf8InCpp String ultrasonicsArrayId; + int maxReadingsPerSensorCount; + int maxReceiversCount; + android.hardware.automotive.evs.UltrasonicSensor[] sensors; +} diff --git a/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.aidl b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.aidl new file mode 100644 index 0000000000..35ec84bdcc --- /dev/null +++ b/automotive/evs/aidl/aidl_api/android.hardware.automotive.evs/1/android/hardware/automotive/evs/UltrasonicsDataFrameDesc.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 -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.evs; +@VintfStability +parcelable UltrasonicsDataFrameDesc { + long timestampNs; + int id; + byte[] transmittersIdList; + byte[] receiversIdList; + int[] receiversReadingsCountList; + android.hardware.common.Ashmem waveformsData; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash new file mode 100644 index 0000000000..7bb15e8f53 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash @@ -0,0 +1 @@ +38469e5a0359c95015bea304c463b686cf4ee9ca diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserRequest.aidl new file mode 100644 index 0000000000..22c690c00f --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserRequest.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable CreateUserRequest { + int requestId; + android.hardware.automotive.vehicle.UserInfo newUserInfo; + @utf8InCpp String newUserName; + android.hardware.automotive.vehicle.UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserResponse.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserResponse.aidl new file mode 100644 index 0000000000..7d0196b4e5 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserResponse.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable CreateUserResponse { + int requestId; + android.hardware.automotive.vehicle.CreateUserStatus status = android.hardware.automotive.vehicle.CreateUserStatus.SUCCESS; + @utf8InCpp String errorMessage; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserStatus.aidl new file mode 100644 index 0000000000..4c3b751656 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CreateUserStatus.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 -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 CreateUserStatus { + SUCCESS = 1, + FAILURE = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CustomInputType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CustomInputType.aidl new file mode 100644 index 0000000000..4decb6985d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/CustomInputType.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 -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 CustomInputType { + CUSTOM_EVENT_F1 = 1001, + CUSTOM_EVENT_F2 = 1002, + CUSTOM_EVENT_F3 = 1003, + CUSTOM_EVENT_F4 = 1004, + CUSTOM_EVENT_F5 = 1005, + CUSTOM_EVENT_F6 = 1006, + CUSTOM_EVENT_F7 = 1007, + CUSTOM_EVENT_F8 = 1008, + CUSTOM_EVENT_F9 = 1009, + CUSTOM_EVENT_F10 = 1010, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl new file mode 100644 index 0000000000..9704704eab --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.aidl @@ -0,0 +1,108 @@ +/* + * 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 -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 DiagnosticFloatSensorIndex { + CALCULATED_ENGINE_LOAD = 0, + ENGINE_COOLANT_TEMPERATURE = 1, + SHORT_TERM_FUEL_TRIM_BANK1 = 2, + LONG_TERM_FUEL_TRIM_BANK1 = 3, + SHORT_TERM_FUEL_TRIM_BANK2 = 4, + LONG_TERM_FUEL_TRIM_BANK2 = 5, + FUEL_PRESSURE = 6, + INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 7, + ENGINE_RPM = 8, + VEHICLE_SPEED = 9, + TIMING_ADVANCE = 10, + MAF_AIR_FLOW_RATE = 11, + THROTTLE_POSITION = 12, + OXYGEN_SENSOR1_VOLTAGE = 13, + OXYGEN_SENSOR1_SHORT_TERM_FUEL_TRIM = 14, + OXYGEN_SENSOR1_FUEL_AIR_EQUIVALENCE_RATIO = 15, + OXYGEN_SENSOR2_VOLTAGE = 16, + OXYGEN_SENSOR2_SHORT_TERM_FUEL_TRIM = 17, + OXYGEN_SENSOR2_FUEL_AIR_EQUIVALENCE_RATIO = 18, + OXYGEN_SENSOR3_VOLTAGE = 19, + OXYGEN_SENSOR3_SHORT_TERM_FUEL_TRIM = 20, + OXYGEN_SENSOR3_FUEL_AIR_EQUIVALENCE_RATIO = 21, + OXYGEN_SENSOR4_VOLTAGE = 22, + OXYGEN_SENSOR4_SHORT_TERM_FUEL_TRIM = 23, + OXYGEN_SENSOR4_FUEL_AIR_EQUIVALENCE_RATIO = 24, + OXYGEN_SENSOR5_VOLTAGE = 25, + OXYGEN_SENSOR5_SHORT_TERM_FUEL_TRIM = 26, + OXYGEN_SENSOR5_FUEL_AIR_EQUIVALENCE_RATIO = 27, + OXYGEN_SENSOR6_VOLTAGE = 28, + OXYGEN_SENSOR6_SHORT_TERM_FUEL_TRIM = 29, + OXYGEN_SENSOR6_FUEL_AIR_EQUIVALENCE_RATIO = 30, + OXYGEN_SENSOR7_VOLTAGE = 31, + OXYGEN_SENSOR7_SHORT_TERM_FUEL_TRIM = 32, + OXYGEN_SENSOR7_FUEL_AIR_EQUIVALENCE_RATIO = 33, + OXYGEN_SENSOR8_VOLTAGE = 34, + OXYGEN_SENSOR8_SHORT_TERM_FUEL_TRIM = 35, + OXYGEN_SENSOR8_FUEL_AIR_EQUIVALENCE_RATIO = 36, + FUEL_RAIL_PRESSURE = 37, + FUEL_RAIL_GAUGE_PRESSURE = 38, + COMMANDED_EXHAUST_GAS_RECIRCULATION = 39, + EXHAUST_GAS_RECIRCULATION_ERROR = 40, + COMMANDED_EVAPORATIVE_PURGE = 41, + FUEL_TANK_LEVEL_INPUT = 42, + EVAPORATION_SYSTEM_VAPOR_PRESSURE = 43, + CATALYST_TEMPERATURE_BANK1_SENSOR1 = 44, + CATALYST_TEMPERATURE_BANK2_SENSOR1 = 45, + CATALYST_TEMPERATURE_BANK1_SENSOR2 = 46, + CATALYST_TEMPERATURE_BANK2_SENSOR2 = 47, + ABSOLUTE_LOAD_VALUE = 48, + FUEL_AIR_COMMANDED_EQUIVALENCE_RATIO = 49, + RELATIVE_THROTTLE_POSITION = 50, + ABSOLUTE_THROTTLE_POSITION_B = 51, + ABSOLUTE_THROTTLE_POSITION_C = 52, + ACCELERATOR_PEDAL_POSITION_D = 53, + ACCELERATOR_PEDAL_POSITION_E = 54, + ACCELERATOR_PEDAL_POSITION_F = 55, + COMMANDED_THROTTLE_ACTUATOR = 56, + ETHANOL_FUEL_PERCENTAGE = 57, + ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE = 58, + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 59, + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 60, + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 61, + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 62, + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 63, + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 64, + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 65, + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 66, + RELATIVE_ACCELERATOR_PEDAL_POSITION = 67, + HYBRID_BATTERY_PACK_REMAINING_LIFE = 68, + FUEL_INJECTION_TIMING = 69, + ENGINE_FUEL_RATE = 70, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl new file mode 100644 index 0000000000..b3f13d4263 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.aidl @@ -0,0 +1,69 @@ +/* + * 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 -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 DiagnosticIntegerSensorIndex { + FUEL_SYSTEM_STATUS = 0, + MALFUNCTION_INDICATOR_LIGHT_ON = 1, + IGNITION_MONITORS_SUPPORTED = 2, + IGNITION_SPECIFIC_MONITORS = 3, + INTAKE_AIR_TEMPERATURE = 4, + COMMANDED_SECONDARY_AIR_STATUS = 5, + NUM_OXYGEN_SENSORS_PRESENT = 6, + RUNTIME_SINCE_ENGINE_START = 7, + DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON = 8, + WARMUPS_SINCE_CODES_CLEARED = 9, + DISTANCE_TRAVELED_SINCE_CODES_CLEARED = 10, + ABSOLUTE_BAROMETRIC_PRESSURE = 11, + CONTROL_MODULE_VOLTAGE = 12, + AMBIENT_AIR_TEMPERATURE = 13, + TIME_WITH_MALFUNCTION_LIGHT_ON = 14, + TIME_SINCE_TROUBLE_CODES_CLEARED = 15, + MAX_FUEL_AIR_EQUIVALENCE_RATIO = 16, + MAX_OXYGEN_SENSOR_VOLTAGE = 17, + MAX_OXYGEN_SENSOR_CURRENT = 18, + MAX_INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 19, + MAX_AIR_FLOW_RATE_FROM_MASS_AIR_FLOW_SENSOR = 20, + FUEL_TYPE = 21, + FUEL_RAIL_ABSOLUTE_PRESSURE = 22, + ENGINE_OIL_TEMPERATURE = 23, + DRIVER_DEMAND_PERCENT_TORQUE = 24, + ENGINE_ACTUAL_PERCENT_TORQUE = 25, + ENGINE_REFERENCE_PERCENT_TORQUE = 26, + ENGINE_PERCENT_TORQUE_DATA_IDLE = 27, + ENGINE_PERCENT_TORQUE_DATA_POINT1 = 28, + ENGINE_PERCENT_TORQUE_DATA_POINT2 = 29, + ENGINE_PERCENT_TORQUE_DATA_POINT3 = 30, + ENGINE_PERCENT_TORQUE_DATA_POINT4 = 31, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.aidl new file mode 100644 index 0000000000..9772aeeba0 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardStatus.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 -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 ElectronicTollCollectionCardStatus { + UNKNOWN = 0, + ELECTRONIC_TOLL_COLLECTION_CARD_VALID = 1, + ELECTRONIC_TOLL_COLLECTION_CARD_INVALID = 2, + ELECTRONIC_TOLL_COLLECTION_CARD_NOT_INSERTED = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.aidl new file mode 100644 index 0000000000..22cf2c388b --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ElectronicTollCollectionCardType.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 -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 ElectronicTollCollectionCardType { + UNKNOWN = 0, + JP_ELECTRONIC_TOLL_COLLECTION_CARD = 1, + JP_ELECTRONIC_TOLL_COLLECTION_CARD_V2 = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvChargeState.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvChargeState.aidl new file mode 100644 index 0000000000..fe1c240a2d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvChargeState.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 -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 EvChargeState { + UNKNOWN = 0, + CHARGING = 1, + FULLY_CHARGED = 2, + NOT_CHARGING = 3, + ERROR = 4, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvConnectorType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvConnectorType.aidl new file mode 100644 index 0000000000..b469578e77 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvConnectorType.aidl @@ -0,0 +1,50 @@ +/* + * 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 -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 EvConnectorType { + UNKNOWN = 0, + IEC_TYPE_1_AC = 1, + IEC_TYPE_2_AC = 2, + IEC_TYPE_3_AC = 3, + IEC_TYPE_4_DC = 4, + IEC_TYPE_1_CCS_DC = 5, + IEC_TYPE_2_CCS_DC = 6, + TESLA_ROADSTER = 7, + TESLA_HPWC = 8, + TESLA_SUPERCHARGER = 9, + GBT_AC = 10, + GBT_DC = 11, + OTHER = 101, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.aidl new file mode 100644 index 0000000000..b8695623fb --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvRegenerativeBrakingState.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 -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 EvRegenerativeBrakingState { + UNKNOWN = 0, + DISABLED = 1, + PARTIALLY_ENABLED = 2, + FULLY_ENABLED = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceRequestIndex.aidl new file mode 100644 index 0000000000..2fdb9b5a8d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceRequestIndex.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 -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 EvsServiceRequestIndex { + TYPE = 0, + STATE = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceState.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceState.aidl new file mode 100644 index 0000000000..df81ee7d27 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceState.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 -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 EvsServiceState { + OFF = 0, + ON = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceType.aidl new file mode 100644 index 0000000000..1363a64cca --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/EvsServiceType.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 -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 EvsServiceType { + REARVIEW = 0, + SURROUNDVIEW = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/FuelType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/FuelType.aidl new file mode 100644 index 0000000000..14bb61b7af --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/FuelType.aidl @@ -0,0 +1,50 @@ +/* + * 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 -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 FuelType { + FUEL_TYPE_UNKNOWN = 0, + FUEL_TYPE_UNLEADED = 1, + FUEL_TYPE_LEADED = 2, + FUEL_TYPE_DIESEL_1 = 3, + FUEL_TYPE_DIESEL_2 = 4, + FUEL_TYPE_BIODIESEL = 5, + FUEL_TYPE_E85 = 6, + FUEL_TYPE_LPG = 7, + FUEL_TYPE_CNG = 8, + FUEL_TYPE_LNG = 9, + FUEL_TYPE_ELECTRIC = 10, + FUEL_TYPE_HYDROGEN = 11, + FUEL_TYPE_OTHER = 12, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueRequest.aidl new file mode 100644 index 0000000000..d88cd8b076 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueRequest.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable GetValueRequest { + long requestId; + android.hardware.automotive.vehicle.VehiclePropValue prop; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueRequests.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueRequests.aidl new file mode 100644 index 0000000000..a7df2ff24d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueRequests.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable GetValueRequests { + android.hardware.automotive.vehicle.GetValueRequest[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueResult.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueResult.aidl new file mode 100644 index 0000000000..25f3575862 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueResult.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable GetValueResult { + long requestId; + android.hardware.automotive.vehicle.StatusCode status = android.hardware.automotive.vehicle.StatusCode.OK; + @nullable android.hardware.automotive.vehicle.VehiclePropValue prop; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueResults.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueResults.aidl new file mode 100644 index 0000000000..4c365b1074 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/GetValueResults.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable GetValueResults { + android.hardware.automotive.vehicle.GetValueResult[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/IVehicle.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/IVehicle.aidl new file mode 100644 index 0000000000..b5f62aa3bf --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/IVehicle.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +interface IVehicle { + android.hardware.automotive.vehicle.VehiclePropConfigs getAllPropConfigs(); + android.hardware.automotive.vehicle.VehiclePropConfigs getPropConfigs(in int[] props); + void getValues(android.hardware.automotive.vehicle.IVehicleCallback callback, in android.hardware.automotive.vehicle.GetValueRequests requests); + void setValues(android.hardware.automotive.vehicle.IVehicleCallback callback, in android.hardware.automotive.vehicle.SetValueRequests requests); + void subscribe(in android.hardware.automotive.vehicle.IVehicleCallback callback, in android.hardware.automotive.vehicle.SubscribeOptions[] options, int maxSharedMemoryFileCount); + void unsubscribe(in android.hardware.automotive.vehicle.IVehicleCallback callback, in int[] propIds); + void returnSharedMemory(in android.hardware.automotive.vehicle.IVehicleCallback callback, long sharedMemoryId); + const long INVALID_MEMORY_ID = 0; + const int MAX_SHARED_MEMORY_FILES_PER_CLIENT = 3; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/IVehicleCallback.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/IVehicleCallback.aidl new file mode 100644 index 0000000000..2c5a333dde --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/IVehicleCallback.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 -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; +@VintfStability +interface IVehicleCallback { + oneway void onGetValues(in android.hardware.automotive.vehicle.GetValueResults responses); + oneway void onSetValues(in android.hardware.automotive.vehicle.SetValueResults responses); + oneway void onPropertyEvent(in android.hardware.automotive.vehicle.VehiclePropValues propValues, int sharedMemoryFileCount); + oneway void onPropertySetError(in android.hardware.automotive.vehicle.VehiclePropErrors errors); +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequest.aidl new file mode 100644 index 0000000000..a4c048aadb --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequest.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable InitialUserInfoRequest { + int requestId; + android.hardware.automotive.vehicle.InitialUserInfoRequestType requestType = android.hardware.automotive.vehicle.InitialUserInfoRequestType.UNKNOWN; + android.hardware.automotive.vehicle.UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequestType.aidl new file mode 100644 index 0000000000..51260fa7b0 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoRequestType.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 -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 InitialUserInfoRequestType { + UNKNOWN = 0, + FIRST_BOOT = 1, + FIRST_BOOT_AFTER_OTA = 2, + COLD_BOOT = 3, + RESUME = 4, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponse.aidl new file mode 100644 index 0000000000..f0e161261d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponse.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable InitialUserInfoResponse { + int requestId; + android.hardware.automotive.vehicle.InitialUserInfoResponseAction action = android.hardware.automotive.vehicle.InitialUserInfoResponseAction.DEFAULT; + android.hardware.automotive.vehicle.UserInfo userToSwitchOrCreate; + @utf8InCpp String userLocales; + @utf8InCpp String userNameToCreate; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.aidl new file mode 100644 index 0000000000..d654b5c23e --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/InitialUserInfoResponseAction.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 -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 InitialUserInfoResponseAction { + DEFAULT = 0, + SWITCH = 1, + CREATE = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.aidl new file mode 100644 index 0000000000..73d4a143b7 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.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 -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 Obd2CommonIgnitionMonitors { + COMPONENTS_AVAILABLE = 1, + COMPONENTS_INCOMPLETE = 2, + FUEL_SYSTEM_AVAILABLE = 4, + FUEL_SYSTEM_INCOMPLETE = 8, + MISFIRE_AVAILABLE = 16, + MISFIRE_INCOMPLETE = 32, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl new file mode 100644 index 0000000000..01104c1baf --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2CompressionIgnitionMonitors.aidl @@ -0,0 +1,55 @@ +/* + * 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 -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 Obd2CompressionIgnitionMonitors { + COMPONENTS_AVAILABLE = 1, + COMPONENTS_INCOMPLETE = 2, + FUEL_SYSTEM_AVAILABLE = 4, + FUEL_SYSTEM_INCOMPLETE = 8, + MISFIRE_AVAILABLE = 16, + MISFIRE_INCOMPLETE = 32, + EGR_OR_VVT_AVAILABLE = 64, + EGR_OR_VVT_INCOMPLETE = 128, + PM_FILTER_AVAILABLE = 256, + PM_FILTER_INCOMPLETE = 512, + EXHAUST_GAS_SENSOR_AVAILABLE = 1024, + EXHAUST_GAS_SENSOR_INCOMPLETE = 2048, + BOOST_PRESSURE_AVAILABLE = 4096, + BOOST_PRESSURE_INCOMPLETE = 8192, + NOx_SCR_AVAILABLE = 16384, + NOx_SCR_INCOMPLETE = 32768, + NMHC_CATALYST_AVAILABLE = 65536, + NMHC_CATALYST_INCOMPLETE = 131072, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.aidl new file mode 100644 index 0000000000..9d588ead1c --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.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 -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 Obd2FuelSystemStatus { + OPEN_INSUFFICIENT_ENGINE_TEMPERATURE = 1, + CLOSED_LOOP = 2, + OPEN_ENGINE_LOAD_OR_DECELERATION = 4, + OPEN_SYSTEM_FAILURE = 8, + CLOSED_LOOP_BUT_FEEDBACK_FAULT = 16, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelType.aidl new file mode 100644 index 0000000000..3ab3920d04 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2FuelType.aidl @@ -0,0 +1,61 @@ +/* + * 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 -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 Obd2FuelType { + NOT_AVAILABLE = 0, + GASOLINE = 1, + METHANOL = 2, + ETHANOL = 3, + DIESEL = 4, + LPG = 5, + CNG = 6, + PROPANE = 7, + ELECTRIC = 8, + BIFUEL_RUNNING_GASOLINE = 9, + BIFUEL_RUNNING_METHANOL = 10, + BIFUEL_RUNNING_ETHANOL = 11, + BIFUEL_RUNNING_LPG = 12, + BIFUEL_RUNNING_CNG = 13, + BIFUEL_RUNNING_PROPANE = 14, + BIFUEL_RUNNING_ELECTRIC = 15, + BIFUEL_RUNNING_ELECTRIC_AND_COMBUSTION = 16, + HYBRID_GASOLINE = 17, + HYBRID_ETHANOL = 18, + HYBRID_DIESEL = 19, + HYBRID_ELECTRIC = 20, + HYBRID_RUNNING_ELECTRIC_AND_COMBUSTION = 21, + HYBRID_REGENERATIVE = 22, + BIFUEL_RUNNING_DIESEL = 23, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.aidl new file mode 100644 index 0000000000..ec8f1c2e57 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2IgnitionMonitorKind.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 -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 Obd2IgnitionMonitorKind { + SPARK = 0, + COMPRESSION = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.aidl new file mode 100644 index 0000000000..7f445bf564 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SecondaryAirStatus.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 -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 Obd2SecondaryAirStatus { + UPSTREAM = 1, + DOWNSTREAM_OF_CATALYCIC_CONVERTER = 2, + FROM_OUTSIDE_OR_OFF = 4, + PUMP_ON_FOR_DIAGNOSTICS = 8, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl new file mode 100644 index 0000000000..badc29c454 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/Obd2SparkIgnitionMonitors.aidl @@ -0,0 +1,59 @@ +/* + * 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 -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 Obd2SparkIgnitionMonitors { + COMPONENTS_AVAILABLE = 1, + COMPONENTS_INCOMPLETE = 2, + FUEL_SYSTEM_AVAILABLE = 4, + FUEL_SYSTEM_INCOMPLETE = 8, + MISFIRE_AVAILABLE = 16, + MISFIRE_INCOMPLETE = 32, + EGR_AVAILABLE = 64, + EGR_INCOMPLETE = 128, + OXYGEN_SENSOR_HEATER_AVAILABLE = 256, + OXYGEN_SENSOR_HEATER_INCOMPLETE = 512, + OXYGEN_SENSOR_AVAILABLE = 1024, + OXYGEN_SENSOR_INCOMPLETE = 2048, + AC_REFRIGERANT_AVAILABLE = 4096, + AC_REFRIGERANT_INCOMPLETE = 8192, + SECONDARY_AIR_SYSTEM_AVAILABLE = 16384, + SECONDARY_AIR_SYSTEM_INCOMPLETE = 32768, + EVAPORATIVE_SYSTEM_AVAILABLE = 65536, + EVAPORATIVE_SYSTEM_INCOMPLETE = 131072, + HEATED_CATALYST_AVAILABLE = 262144, + HEATED_CATALYST_INCOMPLETE = 524288, + CATALYST_AVAILABLE = 1048576, + CATALYST_INCOMPLETE = 2097152, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/PortLocationType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/PortLocationType.aidl new file mode 100644 index 0000000000..b831c7ebd9 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/PortLocationType.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 -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 PortLocationType { + UNKNOWN = 0, + FRONT_LEFT = 1, + FRONT_RIGHT = 2, + REAR_RIGHT = 3, + REAR_LEFT = 4, + FRONT = 5, + REAR = 6, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ProcessTerminationReason.aidl new file mode 100644 index 0000000000..f2838ad818 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/ProcessTerminationReason.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 -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 ProcessTerminationReason { + NOT_RESPONDING = 1, + IO_OVERUSE = 2, + MEMORY_OVERUSE = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RawPropValues.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RawPropValues.aidl new file mode 100644 index 0000000000..e7b0a137cf --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RawPropValues.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable RawPropValues { + int[] int32Values = {}; + float[] floatValues; + long[] int64Values; + byte[] byteValues; + @utf8InCpp String stringValue; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RemoveUserRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RemoveUserRequest.aidl new file mode 100644 index 0000000000..74457b9ab7 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RemoveUserRequest.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable RemoveUserRequest { + int requestId; + android.hardware.automotive.vehicle.UserInfo removedUserInfo; + android.hardware.automotive.vehicle.UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RotaryInputType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RotaryInputType.aidl new file mode 100644 index 0000000000..ff90034711 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/RotaryInputType.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 -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 RotaryInputType { + ROTARY_INPUT_TYPE_SYSTEM_NAVIGATION = 0, + ROTARY_INPUT_TYPE_AUDIO_VOLUME = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueRequest.aidl new file mode 100644 index 0000000000..6a65307f3c --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueRequest.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable SetValueRequest { + long requestId; + android.hardware.automotive.vehicle.VehiclePropValue value; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueRequests.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueRequests.aidl new file mode 100644 index 0000000000..15fd7ea8a8 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueRequests.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable SetValueRequests { + android.hardware.automotive.vehicle.SetValueRequest[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueResult.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueResult.aidl new file mode 100644 index 0000000000..ec5fabb0b4 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueResult.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 -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; +@JavaDerive(equals=true, toString=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/1/android/hardware/automotive/vehicle/SetValueResults.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueResults.aidl new file mode 100644 index 0000000000..47f16563ce --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SetValueResults.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable SetValueResults { + android.hardware.automotive.vehicle.SetValueResult[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/StatusCode.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/StatusCode.aidl new file mode 100644 index 0000000000..9b724126af --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/StatusCode.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 -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 StatusCode { + OK = 0, + TRY_AGAIN = 1, + INVALID_ARG = 2, + NOT_AVAILABLE = 3, + ACCESS_DENIED = 4, + INTERNAL_ERROR = 5, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SubscribeOptions.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SubscribeOptions.aidl new file mode 100644 index 0000000000..91e7c1499a --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SubscribeOptions.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable SubscribeOptions { + int propId; + int[] areaIds; + float sampleRate; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserMessageType.aidl new file mode 100644 index 0000000000..a3e59f128d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserMessageType.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 -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 SwitchUserMessageType { + UNKNOWN = 0, + LEGACY_ANDROID_SWITCH = 1, + ANDROID_SWITCH = 2, + VEHICLE_RESPONSE = 3, + VEHICLE_REQUEST = 4, + ANDROID_POST_SWITCH = 5, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserRequest.aidl new file mode 100644 index 0000000000..3012b7a51d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserRequest.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable SwitchUserRequest { + int requestId; + android.hardware.automotive.vehicle.SwitchUserMessageType messageType = android.hardware.automotive.vehicle.SwitchUserMessageType.UNKNOWN; + android.hardware.automotive.vehicle.UserInfo targetUser; + android.hardware.automotive.vehicle.UsersInfo usersInfo; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserResponse.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserResponse.aidl new file mode 100644 index 0000000000..8915d1b866 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserResponse.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable SwitchUserResponse { + int requestId; + android.hardware.automotive.vehicle.SwitchUserMessageType messageType = android.hardware.automotive.vehicle.SwitchUserMessageType.UNKNOWN; + android.hardware.automotive.vehicle.SwitchUserStatus status = android.hardware.automotive.vehicle.SwitchUserStatus.SUCCESS; + @utf8InCpp String errorMessage; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserStatus.aidl new file mode 100644 index 0000000000..c7be9ec949 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/SwitchUserStatus.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 -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 SwitchUserStatus { + SUCCESS = 1, + FAILURE = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/TrailerState.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/TrailerState.aidl new file mode 100644 index 0000000000..2491340acd --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/TrailerState.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 -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 TrailerState { + UNKNOWN = 0, + NOT_PRESENT = 1, + PRESENT = 2, + ERROR = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociation.aidl new file mode 100644 index 0000000000..a540f8ead8 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociation.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable UserIdentificationAssociation { + android.hardware.automotive.vehicle.UserIdentificationAssociationType type = android.hardware.automotive.vehicle.UserIdentificationAssociationType.INVALID; + android.hardware.automotive.vehicle.UserIdentificationAssociationValue value = android.hardware.automotive.vehicle.UserIdentificationAssociationValue.UNKNOWN; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.aidl new file mode 100644 index 0000000000..1fd9ee8c31 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationSetValue.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 -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 UserIdentificationAssociationSetValue { + INVALID = 0, + ASSOCIATE_CURRENT_USER = 1, + DISASSOCIATE_CURRENT_USER = 2, + DISASSOCIATE_ALL_USERS = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationType.aidl new file mode 100644 index 0000000000..6498375b0f --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationType.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 -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 UserIdentificationAssociationType { + INVALID = 0, + KEY_FOB = 1, + CUSTOM_1 = 101, + CUSTOM_2 = 102, + CUSTOM_3 = 103, + CUSTOM_4 = 104, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.aidl new file mode 100644 index 0000000000..d5e01691fa --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationAssociationValue.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 -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 UserIdentificationAssociationValue { + UNKNOWN = 1, + ASSOCIATED_CURRENT_USER = 2, + ASSOCIATED_ANOTHER_USER = 3, + NOT_ASSOCIATED_ANY_USER = 4, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationGetRequest.aidl new file mode 100644 index 0000000000..fe7fd6f6bc --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationGetRequest.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable UserIdentificationGetRequest { + int requestId; + android.hardware.automotive.vehicle.UserInfo userInfo; + int numberAssociationTypes; + android.hardware.automotive.vehicle.UserIdentificationAssociationType[] associationTypes; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationResponse.aidl new file mode 100644 index 0000000000..3e2a2579cc --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationResponse.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable UserIdentificationResponse { + int requestId; + int numberAssociation; + android.hardware.automotive.vehicle.UserIdentificationAssociation[] associations; + @utf8InCpp String errorMessage; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.aidl new file mode 100644 index 0000000000..57840fb77c --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetAssociation.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable UserIdentificationSetAssociation { + android.hardware.automotive.vehicle.UserIdentificationAssociationType type = android.hardware.automotive.vehicle.UserIdentificationAssociationType.INVALID; + android.hardware.automotive.vehicle.UserIdentificationAssociationSetValue value = android.hardware.automotive.vehicle.UserIdentificationAssociationSetValue.INVALID; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetRequest.aidl new file mode 100644 index 0000000000..db01b515a8 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserIdentificationSetRequest.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable UserIdentificationSetRequest { + int requestId; + android.hardware.automotive.vehicle.UserInfo userInfo; + int numberAssociations; + android.hardware.automotive.vehicle.UserIdentificationSetAssociation[] associations; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserInfo.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserInfo.aidl new file mode 100644 index 0000000000..f47d5e74bb --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UserInfo.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable UserInfo { + int userId = 0; + int flags; + const int USER_FLAG_SYSTEM = 1; + const int USER_FLAG_GUEST = 2; + const int USER_FLAG_EPHEMERAL = 4; + const int USER_FLAG_ADMIN = 8; + const int USER_FLAG_DISABLED = 16; + const int USER_FLAG_PROFILE = 32; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UsersInfo.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UsersInfo.aidl new file mode 100644 index 0000000000..edcef2edfd --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/UsersInfo.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable UsersInfo { + android.hardware.automotive.vehicle.UserInfo currentUser; + int numberUsers; + android.hardware.automotive.vehicle.UserInfo[] existingUsers; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl new file mode 100644 index 0000000000..7e48eba788 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.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 -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 VehicleApPowerStateConfigFlag { + ENABLE_DEEP_SLEEP_FLAG = 1, + CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 2, + ENABLE_HIBERNATION_FLAG = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReport.aidl new file mode 100644 index 0000000000..fc669ec17c --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReport.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 -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 VehicleApPowerStateReport { + WAIT_FOR_VHAL = 1, + DEEP_SLEEP_ENTRY = 2, + DEEP_SLEEP_EXIT = 3, + SHUTDOWN_POSTPONE = 4, + SHUTDOWN_START = 5, + ON = 6, + SHUTDOWN_PREPARE = 7, + SHUTDOWN_CANCELLED = 8, + HIBERNATION_ENTRY = 9, + HIBERNATION_EXIT = 10, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReq.aidl new file mode 100644 index 0000000000..8b94d31598 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReq.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 -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 VehicleApPowerStateReq { + ON = 0, + SHUTDOWN_PREPARE = 1, + CANCEL_SHUTDOWN = 2, + FINISHED = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.aidl new file mode 100644 index 0000000000..f995c73ee5 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateReqIndex.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 -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 VehicleApPowerStateReqIndex { + STATE = 0, + ADDITIONAL = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl new file mode 100644 index 0000000000..3fde1c7869 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.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 -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 VehicleApPowerStateShutdownParam { + SHUTDOWN_IMMEDIATELY = 1, + CAN_SLEEP = 2, + SHUTDOWN_ONLY = 3, + SLEEP_IMMEDIATELY = 4, + HIBERNATE_IMMEDIATELY = 5, + CAN_HIBERNATE = 6, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleArea.aidl new file mode 100644 index 0000000000..4f8b917256 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleArea.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 -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 VehicleArea { + GLOBAL = 16777216, + WINDOW = 50331648, + MIRROR = 67108864, + SEAT = 83886080, + DOOR = 100663296, + WHEEL = 117440512, + MASK = 251658240, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl new file mode 100644 index 0000000000..b93a11b60f --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaConfig.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VehicleAreaConfig { + int areaId; + int minInt32Value; + int maxInt32Value; + long minInt64Value; + long maxInt64Value; + float minFloatValue; + float maxFloatValue; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaDoor.aidl new file mode 100644 index 0000000000..11139f9a3a --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaDoor.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 -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 VehicleAreaDoor { + ROW_1_LEFT = 1, + ROW_1_RIGHT = 4, + ROW_2_LEFT = 16, + ROW_2_RIGHT = 64, + ROW_3_LEFT = 256, + ROW_3_RIGHT = 1024, + HOOD = 268435456, + REAR = 536870912, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaMirror.aidl new file mode 100644 index 0000000000..c1e2fbd6ff --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaMirror.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 -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 VehicleAreaMirror { + DRIVER_LEFT = 1, + DRIVER_RIGHT = 2, + DRIVER_CENTER = 4, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl new file mode 100644 index 0000000000..e76de324d3 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 VehicleAreaSeat { + ROW_1_LEFT = 1, + ROW_1_CENTER = 2, + ROW_1_RIGHT = 4, + ROW_2_LEFT = 16, + ROW_2_CENTER = 32, + ROW_2_RIGHT = 64, + ROW_3_LEFT = 256, + ROW_3_CENTER = 512, + ROW_3_RIGHT = 1024, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWheel.aidl new file mode 100644 index 0000000000..9e834340b1 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWheel.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 -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 VehicleAreaWheel { + UNKNOWN = 0, + LEFT_FRONT = 1, + RIGHT_FRONT = 2, + LEFT_REAR = 4, + RIGHT_REAR = 8, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWindow.aidl new file mode 100644 index 0000000000..6ec26fe261 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleAreaWindow.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 -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 VehicleAreaWindow { + FRONT_WINDSHIELD = 1, + REAR_WINDSHIELD = 2, + ROW_1_LEFT = 16, + ROW_1_RIGHT = 64, + ROW_2_LEFT = 256, + ROW_2_RIGHT = 1024, + ROW_3_LEFT = 4096, + ROW_3_RIGHT = 16384, + ROOF_TOP_1 = 65536, + ROOF_TOP_2 = 131072, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleDisplay.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleDisplay.aidl new file mode 100644 index 0000000000..5aeafa4676 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleDisplay.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 -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 VehicleDisplay { + MAIN = 0, + INSTRUMENT_CLUSTER = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleGear.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleGear.aidl new file mode 100644 index 0000000000..db4760d7a3 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleGear.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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 VehicleGear { + GEAR_UNKNOWN = 0, + GEAR_NEUTRAL = 1, + GEAR_REVERSE = 2, + GEAR_PARK = 4, + GEAR_DRIVE = 8, + GEAR_1 = 16, + GEAR_2 = 32, + GEAR_3 = 64, + GEAR_4 = 128, + GEAR_5 = 256, + GEAR_6 = 512, + GEAR_7 = 1024, + GEAR_8 = 2048, + GEAR_9 = 4096, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHvacFanDirection.aidl new file mode 100644 index 0000000000..a85751f94f --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHvacFanDirection.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 -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 VehicleHvacFanDirection { + UNKNOWN = 0, + FACE = 1, + FLOOR = 2, + FACE_AND_FLOOR = 3, + DEFROST = 4, + DEFROST_AND_FLOOR = 6, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.aidl new file mode 100644 index 0000000000..c4ac002067 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleHwKeyInputAction.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 -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 VehicleHwKeyInputAction { + ACTION_DOWN = 0, + ACTION_UP = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleIgnitionState.aidl new file mode 100644 index 0000000000..09d5423edc --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleIgnitionState.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 -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 VehicleIgnitionState { + UNDEFINED = 0, + LOCK = 1, + OFF = 2, + ACC = 3, + ON = 4, + START = 5, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightState.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightState.aidl new file mode 100644 index 0000000000..d569851407 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightState.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 -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 VehicleLightState { + OFF = 0, + ON = 1, + DAYTIME_RUNNING = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightSwitch.aidl new file mode 100644 index 0000000000..0d3c636b16 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleLightSwitch.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 -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 VehicleLightSwitch { + OFF = 0, + ON = 1, + DAYTIME_RUNNING = 2, + AUTOMATIC = 256, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleOilLevel.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleOilLevel.aidl new file mode 100644 index 0000000000..f2eb5aa913 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleOilLevel.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 -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 VehicleOilLevel { + CRITICALLY_LOW = 0, + LOW = 1, + NORMAL = 2, + HIGH = 3, + ERROR = 4, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropConfig.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropConfig.aidl new file mode 100644 index 0000000000..8602d2d03d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropConfig.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VehiclePropConfig { + int prop; + android.hardware.automotive.vehicle.VehiclePropertyAccess access = android.hardware.automotive.vehicle.VehiclePropertyAccess.NONE; + android.hardware.automotive.vehicle.VehiclePropertyChangeMode changeMode = android.hardware.automotive.vehicle.VehiclePropertyChangeMode.STATIC; + android.hardware.automotive.vehicle.VehicleAreaConfig[] areaConfigs; + int[] configArray; + @utf8InCpp String configString; + float minSampleRate; + float maxSampleRate; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropConfigs.aidl new file mode 100644 index 0000000000..04c8006983 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropConfigs.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VehiclePropConfigs { + android.hardware.automotive.vehicle.VehiclePropConfig[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropError.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropError.aidl new file mode 100644 index 0000000000..983529542f --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropError.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VehiclePropError { + int propId; + int areaId; + android.hardware.automotive.vehicle.StatusCode errorCode = android.hardware.automotive.vehicle.StatusCode.OK; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropErrors.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropErrors.aidl new file mode 100644 index 0000000000..9dcb10bc9e --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropErrors.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VehiclePropErrors { + android.hardware.automotive.vehicle.VehiclePropError[] payloads; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropValue.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropValue.aidl new file mode 100644 index 0000000000..c87379fd9b --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropValue.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VehiclePropValue { + long timestamp; + int areaId; + int prop; + android.hardware.automotive.vehicle.VehiclePropertyStatus status = android.hardware.automotive.vehicle.VehiclePropertyStatus.AVAILABLE; + android.hardware.automotive.vehicle.RawPropValues value; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropValues.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropValues.aidl new file mode 100644 index 0000000000..e09a6b95df --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropValues.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 -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; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable VehiclePropValues { + android.hardware.automotive.vehicle.VehiclePropValue[] payloads; + long sharedMemoryId; + @nullable ParcelFileDescriptor sharedMemoryFd; +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleProperty.aidl new file mode 100644 index 0000000000..04f8fa3b80 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -0,0 +1,209 @@ +/* + * 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 -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 VehicleProperty { + INVALID = 0, + INFO_VIN = 286261504, + INFO_MAKE = 286261505, + INFO_MODEL = 286261506, + INFO_MODEL_YEAR = 289407235, + INFO_FUEL_CAPACITY = 291504388, + INFO_FUEL_TYPE = 289472773, + INFO_EV_BATTERY_CAPACITY = 291504390, + INFO_EV_CONNECTOR_TYPE = 289472775, + INFO_FUEL_DOOR_LOCATION = 289407240, + INFO_EV_PORT_LOCATION = 289407241, + INFO_DRIVER_SEAT = 356516106, + INFO_EXTERIOR_DIMENSIONS = 289472779, + INFO_MULTI_EV_PORT_LOCATIONS = 289472780, + PERF_ODOMETER = 291504644, + PERF_VEHICLE_SPEED = 291504647, + PERF_VEHICLE_SPEED_DISPLAY = 291504648, + PERF_STEERING_ANGLE = 291504649, + PERF_REAR_STEERING_ANGLE = 291504656, + ENGINE_COOLANT_TEMP = 291504897, + ENGINE_OIL_LEVEL = 289407747, + ENGINE_OIL_TEMP = 291504900, + ENGINE_RPM = 291504901, + WHEEL_TICK = 290521862, + FUEL_LEVEL = 291504903, + FUEL_DOOR_OPEN = 287310600, + EV_BATTERY_LEVEL = 291504905, + EV_CHARGE_PORT_OPEN = 287310602, + EV_CHARGE_PORT_CONNECTED = 287310603, + EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = 291504908, + RANGE_REMAINING = 291504904, + TIRE_PRESSURE = 392168201, + CRITICALLY_LOW_TIRE_PRESSURE = 392168202, + GEAR_SELECTION = 289408000, + CURRENT_GEAR = 289408001, + PARKING_BRAKE_ON = 287310850, + PARKING_BRAKE_AUTO_APPLY = 287310851, + FUEL_LEVEL_LOW = 287310853, + NIGHT_MODE = 287310855, + TURN_SIGNAL_STATE = 289408008, + IGNITION_STATE = 289408009, + ABS_ACTIVE = 287310858, + TRACTION_CONTROL_ACTIVE = 287310859, + HVAC_FAN_SPEED = 356517120, + HVAC_FAN_DIRECTION = 356517121, + HVAC_TEMPERATURE_CURRENT = 358614274, + HVAC_TEMPERATURE_SET = 358614275, + HVAC_DEFROSTER = 320865540, + HVAC_AC_ON = 354419973, + HVAC_MAX_AC_ON = 354419974, + HVAC_MAX_DEFROST_ON = 354419975, + HVAC_RECIRC_ON = 354419976, + HVAC_DUAL_ON = 354419977, + HVAC_AUTO_ON = 354419978, + HVAC_SEAT_TEMPERATURE = 356517131, + HVAC_SIDE_MIRROR_HEAT = 339739916, + HVAC_STEERING_WHEEL_HEAT = 289408269, + HVAC_TEMPERATURE_DISPLAY_UNITS = 289408270, + HVAC_ACTUAL_FAN_SPEED_RPM = 356517135, + HVAC_POWER_ON = 354419984, + HVAC_FAN_DIRECTION_AVAILABLE = 356582673, + HVAC_AUTO_RECIRC_ON = 354419986, + HVAC_SEAT_VENTILATION = 356517139, + HVAC_ELECTRIC_DEFROSTER_ON = 320865556, + HVAC_TEMPERATURE_VALUE_SUGGESTION = 291570965, + DISTANCE_DISPLAY_UNITS = 289408512, + FUEL_VOLUME_DISPLAY_UNITS = 289408513, + TIRE_PRESSURE_DISPLAY_UNITS = 289408514, + EV_BATTERY_DISPLAY_UNITS = 289408515, + FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = 287311364, + VEHICLE_SPEED_DISPLAY_UNITS = 289408517, + EXTERNAL_CAR_TIME = 290457096, + ANDROID_EPOCH_TIME = 290457094, + STORAGE_ENCRYPTION_BINDING_SEED = 292554247, + ENV_OUTSIDE_TEMPERATURE = 291505923, + AP_POWER_STATE_REQ = 289475072, + AP_POWER_STATE_REPORT = 289475073, + AP_POWER_BOOTUP_REASON = 289409538, + DISPLAY_BRIGHTNESS = 289409539, + HW_KEY_INPUT = 289475088, + HW_ROTARY_INPUT = 289475104, + HW_CUSTOM_INPUT = 289475120, + DOOR_POS = 373295872, + DOOR_MOVE = 373295873, + DOOR_LOCK = 371198722, + MIRROR_Z_POS = 339741504, + MIRROR_Z_MOVE = 339741505, + MIRROR_Y_POS = 339741506, + MIRROR_Y_MOVE = 339741507, + MIRROR_LOCK = 287312708, + MIRROR_FOLD = 287312709, + SEAT_MEMORY_SELECT = 356518784, + SEAT_MEMORY_SET = 356518785, + SEAT_BELT_BUCKLED = 354421634, + SEAT_BELT_HEIGHT_POS = 356518787, + SEAT_BELT_HEIGHT_MOVE = 356518788, + SEAT_FORE_AFT_POS = 356518789, + SEAT_FORE_AFT_MOVE = 356518790, + SEAT_BACKREST_ANGLE_1_POS = 356518791, + SEAT_BACKREST_ANGLE_1_MOVE = 356518792, + SEAT_BACKREST_ANGLE_2_POS = 356518793, + SEAT_BACKREST_ANGLE_2_MOVE = 356518794, + SEAT_HEIGHT_POS = 356518795, + SEAT_HEIGHT_MOVE = 356518796, + SEAT_DEPTH_POS = 356518797, + SEAT_DEPTH_MOVE = 356518798, + SEAT_TILT_POS = 356518799, + SEAT_TILT_MOVE = 356518800, + SEAT_LUMBAR_FORE_AFT_POS = 356518801, + SEAT_LUMBAR_FORE_AFT_MOVE = 356518802, + SEAT_LUMBAR_SIDE_SUPPORT_POS = 356518803, + SEAT_LUMBAR_SIDE_SUPPORT_MOVE = 356518804, + SEAT_HEADREST_HEIGHT_POS = 289409941, + SEAT_HEADREST_HEIGHT_MOVE = 356518806, + SEAT_HEADREST_ANGLE_POS = 356518807, + SEAT_HEADREST_ANGLE_MOVE = 356518808, + SEAT_HEADREST_FORE_AFT_POS = 356518809, + SEAT_HEADREST_FORE_AFT_MOVE = 356518810, + SEAT_OCCUPANCY = 356518832, + WINDOW_POS = 322964416, + WINDOW_MOVE = 322964417, + WINDOW_LOCK = 320867268, + VEHICLE_MAP_SERVICE = 299895808, + OBD2_LIVE_FRAME = 299896064, + OBD2_FREEZE_FRAME = 299896065, + OBD2_FREEZE_FRAME_INFO = 299896066, + OBD2_FREEZE_FRAME_CLEAR = 299896067, + HEADLIGHTS_STATE = 289410560, + HIGH_BEAM_LIGHTS_STATE = 289410561, + FOG_LIGHTS_STATE = 289410562, + HAZARD_LIGHTS_STATE = 289410563, + HEADLIGHTS_SWITCH = 289410576, + HIGH_BEAM_LIGHTS_SWITCH = 289410577, + FOG_LIGHTS_SWITCH = 289410578, + HAZARD_LIGHTS_SWITCH = 289410579, + CABIN_LIGHTS_STATE = 289410817, + CABIN_LIGHTS_SWITCH = 289410818, + READING_LIGHTS_STATE = 356519683, + READING_LIGHTS_SWITCH = 356519684, + SUPPORT_CUSTOMIZE_VENDOR_PERMISSION = 287313669, + DISABLED_OPTIONAL_FEATURES = 286265094, + INITIAL_USER_INFO = 299896583, + SWITCH_USER = 299896584, + CREATE_USER = 299896585, + REMOVE_USER = 299896586, + USER_IDENTIFICATION_ASSOCIATION = 299896587, + EVS_SERVICE_REQUEST = 289476368, + POWER_POLICY_REQ = 286265121, + POWER_POLICY_GROUP_REQ = 286265122, + CURRENT_POWER_POLICY = 286265123, + WATCHDOG_ALIVE = 290459441, + WATCHDOG_TERMINATED_PROCESS = 299896626, + VHAL_HEARTBEAT = 290459443, + CLUSTER_SWITCH_UI = 289410868, + CLUSTER_DISPLAY_STATE = 289476405, + CLUSTER_REPORT_STATE = 299896630, + CLUSTER_REQUEST_DISPLAY = 289410871, + CLUSTER_NAVIGATION_STATE = 292556600, + ELECTRONIC_TOLL_COLLECTION_CARD_TYPE = 289410873, + ELECTRONIC_TOLL_COLLECTION_CARD_STATUS = 289410874, + FRONT_FOG_LIGHTS_STATE = 289410875, + FRONT_FOG_LIGHTS_SWITCH = 289410876, + REAR_FOG_LIGHTS_STATE = 289410877, + REAR_FOG_LIGHTS_SWITCH = 289410878, + EV_CHARGE_CURRENT_DRAW_LIMIT = 291508031, + EV_CHARGE_PERCENT_LIMIT = 291508032, + EV_CHARGE_STATE = 289410881, + EV_CHARGE_SWITCH = 287313730, + EV_CHARGE_TIME_REMAINING = 289410883, + EV_REGENERATIVE_BRAKING_STATE = 289410884, + TRAILER_PRESENT = 289410885, + VEHICLE_CURB_WEIGHT = 289410886, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyAccess.aidl new file mode 100644 index 0000000000..ec9587f60c --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyAccess.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 -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 VehiclePropertyAccess { + NONE = 0, + READ = 1, + WRITE = 2, + READ_WRITE = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.aidl new file mode 100644 index 0000000000..5455fdd5ca --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.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 -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 VehiclePropertyChangeMode { + STATIC = 0, + ON_CHANGE = 1, + CONTINUOUS = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl new file mode 100644 index 0000000000..0c049c4814 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyGroup.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 -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 VehiclePropertyGroup { + SYSTEM = 268435456, + VENDOR = 536870912, + MASK = -268435456, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl new file mode 100644 index 0000000000..6d0e041ff6 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyStatus.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 -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 VehiclePropertyStatus { + AVAILABLE = 0, + UNAVAILABLE = 1, + ERROR = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyType.aidl new file mode 100644 index 0000000000..da6d2c2168 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehiclePropertyType.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 -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 VehiclePropertyType { + STRING = 1048576, + BOOLEAN = 2097152, + INT32 = 4194304, + INT32_VEC = 4259840, + INT64 = 5242880, + INT64_VEC = 5308416, + FLOAT = 6291456, + FLOAT_VEC = 6356992, + BYTES = 7340032, + MIXED = 14680064, + MASK = 16711680, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.aidl new file mode 100644 index 0000000000..3e870e8925 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleSeatOccupancyState.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 -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 VehicleSeatOccupancyState { + UNKNOWN = 0, + VACANT = 1, + OCCUPIED = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleTurnSignal.aidl new file mode 100644 index 0000000000..78c17959b4 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleTurnSignal.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 -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 VehicleTurnSignal { + NONE = 0, + RIGHT = 1, + LEFT = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleUnit.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleUnit.aidl new file mode 100644 index 0000000000..c80fdbbdbe --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleUnit.aidl @@ -0,0 +1,70 @@ +/* + * 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 -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 VehicleUnit { + SHOULD_NOT_USE = 0, + METER_PER_SEC = 1, + RPM = 2, + HERTZ = 3, + PERCENTILE = 16, + MILLIMETER = 32, + METER = 33, + KILOMETER = 35, + MILE = 36, + CELSIUS = 48, + FAHRENHEIT = 49, + KELVIN = 50, + MILLILITER = 64, + LITER = 65, + GALLON = 66, + US_GALLON = 66, + IMPERIAL_GALLON = 67, + NANO_SECS = 80, + SECS = 83, + YEAR = 89, + WATT_HOUR = 96, + MILLIAMPERE = 97, + MILLIVOLT = 98, + MILLIWATTS = 99, + AMPERE_HOURS = 100, + KILOWATT_HOUR = 101, + AMPERE = 102, + KILOPASCAL = 112, + PSI = 113, + BAR = 114, + DEGREES = 128, + MILES_PER_HOUR = 144, + KILOMETERS_PER_HOUR = 145, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl new file mode 100644 index 0000000000..58524f3c66 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleVendorPermission.aidl @@ -0,0 +1,75 @@ +/* + * 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 -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 VehicleVendorPermission { + PERMISSION_DEFAULT = 0, + PERMISSION_SET_VENDOR_CATEGORY_WINDOW = 1, + PERMISSION_GET_VENDOR_CATEGORY_WINDOW = 2, + PERMISSION_SET_VENDOR_CATEGORY_DOOR = 3, + PERMISSION_GET_VENDOR_CATEGORY_DOOR = 4, + PERMISSION_SET_VENDOR_CATEGORY_SEAT = 5, + PERMISSION_GET_VENDOR_CATEGORY_SEAT = 6, + PERMISSION_SET_VENDOR_CATEGORY_MIRROR = 7, + PERMISSION_GET_VENDOR_CATEGORY_MIRROR = 8, + PERMISSION_SET_VENDOR_CATEGORY_INFO = 9, + PERMISSION_GET_VENDOR_CATEGORY_INFO = 10, + PERMISSION_SET_VENDOR_CATEGORY_ENGINE = 11, + PERMISSION_GET_VENDOR_CATEGORY_ENGINE = 12, + PERMISSION_SET_VENDOR_CATEGORY_HVAC = 13, + PERMISSION_GET_VENDOR_CATEGORY_HVAC = 14, + PERMISSION_SET_VENDOR_CATEGORY_LIGHT = 15, + PERMISSION_GET_VENDOR_CATEGORY_LIGHT = 16, + PERMISSION_SET_VENDOR_CATEGORY_1 = 65536, + PERMISSION_GET_VENDOR_CATEGORY_1 = 69632, + PERMISSION_SET_VENDOR_CATEGORY_2 = 131072, + PERMISSION_GET_VENDOR_CATEGORY_2 = 135168, + PERMISSION_SET_VENDOR_CATEGORY_3 = 196608, + PERMISSION_GET_VENDOR_CATEGORY_3 = 200704, + PERMISSION_SET_VENDOR_CATEGORY_4 = 262144, + PERMISSION_GET_VENDOR_CATEGORY_4 = 266240, + PERMISSION_SET_VENDOR_CATEGORY_5 = 327680, + PERMISSION_GET_VENDOR_CATEGORY_5 = 331776, + PERMISSION_SET_VENDOR_CATEGORY_6 = 393216, + PERMISSION_GET_VENDOR_CATEGORY_6 = 397312, + PERMISSION_SET_VENDOR_CATEGORY_7 = 458752, + PERMISSION_GET_VENDOR_CATEGORY_7 = 462848, + PERMISSION_SET_VENDOR_CATEGORY_8 = 524288, + PERMISSION_GET_VENDOR_CATEGORY_8 = 528384, + PERMISSION_SET_VENDOR_CATEGORY_9 = 589824, + PERMISSION_GET_VENDOR_CATEGORY_9 = 593920, + PERMISSION_SET_VENDOR_CATEGORY_10 = 655360, + PERMISSION_GET_VENDOR_CATEGORY_10 = 659456, + PERMISSION_NOT_ACCESSIBLE = -268435456, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.aidl new file mode 100644 index 0000000000..0dcfbc4a5d --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsAvailabilityStateIntegerValuesIndex.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 -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 VmsAvailabilityStateIntegerValuesIndex { + MESSAGE_TYPE = 0, + SEQUENCE_NUMBER = 1, + NUMBER_OF_ASSOCIATED_LAYERS = 2, + LAYERS_START = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.aidl new file mode 100644 index 0000000000..45514d081a --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsBaseMessageIntegerValuesIndex.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 -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 VmsBaseMessageIntegerValuesIndex { + MESSAGE_TYPE = 0, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageType.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageType.aidl new file mode 100644 index 0000000000..1248c069ce --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageType.aidl @@ -0,0 +1,54 @@ +/* + * 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 -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 VmsMessageType { + SUBSCRIBE = 1, + SUBSCRIBE_TO_PUBLISHER = 2, + UNSUBSCRIBE = 3, + UNSUBSCRIBE_TO_PUBLISHER = 4, + OFFERING = 5, + AVAILABILITY_REQUEST = 6, + SUBSCRIPTIONS_REQUEST = 7, + AVAILABILITY_RESPONSE = 8, + AVAILABILITY_CHANGE = 9, + SUBSCRIPTIONS_RESPONSE = 10, + SUBSCRIPTIONS_CHANGE = 11, + DATA = 12, + PUBLISHER_ID_REQUEST = 13, + PUBLISHER_ID_RESPONSE = 14, + PUBLISHER_INFORMATION_REQUEST = 15, + PUBLISHER_INFORMATION_RESPONSE = 16, + START_SESSION = 17, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.aidl new file mode 100644 index 0000000000..8b0e3a5ef2 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.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 -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 VmsMessageWithLayerAndPublisherIdIntegerValuesIndex { + MESSAGE_TYPE = 0, + LAYER_TYPE = 1, + LAYER_SUBTYPE = 2, + LAYER_VERSION = 3, + PUBLISHER_ID = 4, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.aidl new file mode 100644 index 0000000000..65dd4ae395 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsMessageWithLayerIntegerValuesIndex.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 -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 VmsMessageWithLayerIntegerValuesIndex { + MESSAGE_TYPE = 0, + LAYER_TYPE = 1, + LAYER_SUBTYPE = 2, + LAYER_VERSION = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.aidl new file mode 100644 index 0000000000..fc2a9c1844 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsOfferingMessageIntegerValuesIndex.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 -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 VmsOfferingMessageIntegerValuesIndex { + MESSAGE_TYPE = 0, + PUBLISHER_ID = 1, + NUMBER_OF_OFFERS = 2, + OFFERING_START = 3, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.aidl new file mode 100644 index 0000000000..a9b017fdb1 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsPublisherInformationIntegerValuesIndex.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 -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 VmsPublisherInformationIntegerValuesIndex { + MESSAGE_TYPE = 0, + PUBLISHER_ID = 1, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.aidl new file mode 100644 index 0000000000..d942bc8392 --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsStartSessionMessageIntegerValuesIndex.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 -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 VmsStartSessionMessageIntegerValuesIndex { + MESSAGE_TYPE = 0, + SERVICE_ID = 1, + CLIENT_ID = 2, +} diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.aidl new file mode 100644 index 0000000000..796d7f722c --- /dev/null +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VmsSubscriptionsStateIntegerValuesIndex.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 -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 VmsSubscriptionsStateIntegerValuesIndex { + MESSAGE_TYPE = 0, + SEQUENCE_NUMBER = 1, + NUMBER_OF_LAYERS = 2, + NUMBER_OF_ASSOCIATED_LAYERS = 3, + SUBSCRIPTIONS_START = 4, +} diff --git a/biometrics/face/aidl/Android.bp b/biometrics/face/aidl/Android.bp index 174f1da197..0bec0c54ca 100644 --- a/biometrics/face/aidl/Android.bp +++ b/biometrics/face/aidl/Android.bp @@ -27,5 +27,24 @@ aidl_interface { enabled: false, }, }, - versions: ["1"], + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.biometrics.common-V1", + "android.hardware.common-V2", + "android.hardware.keymaster-V3", + ], + }, + { + version: "2", + imports: [ + "android.hardware.biometrics.common-V2", + "android.hardware.common-V2", + "android.hardware.keymaster-V3", + ], + }, + + ], + } diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/.hash b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/.hash new file mode 100644 index 0000000000..6440018a7a --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/.hash @@ -0,0 +1 @@ +74b0b7cb149ee205b12cd2254d216725c6e5429c diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/AcquiredInfo.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/AcquiredInfo.aidl new file mode 100644 index 0000000000..eaa43f3f9e --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/AcquiredInfo.aidl @@ -0,0 +1,64 @@ +/* + * 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 -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; +@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, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/AuthenticationFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/AuthenticationFrame.aidl new file mode 100644 index 0000000000..20bc76779b --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/AuthenticationFrame.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 -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; +@VintfStability +parcelable AuthenticationFrame { + android.hardware.biometrics.face.BaseFrame data; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/BaseFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/BaseFrame.aidl new file mode 100644 index 0000000000..67b5cf4169 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/BaseFrame.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 -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; +@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/2/android/hardware/biometrics/face/Cell.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/Cell.aidl new file mode 100644 index 0000000000..6be8c8e975 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/Cell.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 -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; +@VintfStability +parcelable Cell { + int x; + int y; + int z; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentFrame.aidl new file mode 100644 index 0000000000..0ea10d6ddb --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentFrame.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 -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; +@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/2/android/hardware/biometrics/face/EnrollmentStage.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentStage.aidl new file mode 100644 index 0000000000..ce5679ab31 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentStage.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 -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; +@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, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentStageConfig.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentStageConfig.aidl new file mode 100644 index 0000000000..48db2cf615 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentStageConfig.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 -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; +@VintfStability +parcelable EnrollmentStageConfig { + android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN; + List cells; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentType.aidl new file mode 100644 index 0000000000..8e99ad6529 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/EnrollmentType.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 -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; +@Backing(type="byte") @VintfStability +enum EnrollmentType { + DEFAULT = 0, + ACCESSIBILITY = 1, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/Error.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/Error.aidl new file mode 100644 index 0000000000..1a21661932 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/Error.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@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, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/FaceSensorType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/FaceSensorType.aidl new file mode 100644 index 0000000000..a215b99f72 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/FaceSensorType.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 -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; +@Backing(type="byte") @VintfStability +enum FaceSensorType { + UNKNOWN = 0, + RGB = 1, + IR = 2, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/Feature.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/Feature.aidl new file mode 100644 index 0000000000..1875b97431 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/Feature.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 -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; +@Backing(type="byte") @VintfStability +enum Feature { + REQUIRE_ATTENTION = 0, + REQUIRE_DIVERSE_POSES = 1, + DEBUG = 2, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/IFace.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/IFace.aidl new file mode 100644 index 0000000000..fc4a4d04bb --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/IFace.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 -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; +@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/2/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/ISession.aidl new file mode 100644 index 0000000000..366553485a --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/ISession.aidl @@ -0,0 +1,55 @@ +/* + * 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 -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; +@VintfStability +interface ISession { + void generateChallenge(); + void revokeChallenge(in long challenge); + android.hardware.biometrics.face.EnrollmentStageConfig[] getEnrollmentConfig(in android.hardware.biometrics.face.EnrollmentType enrollmentType); + 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); + 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); +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/ISessionCallback.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/ISessionCallback.aidl new file mode 100644 index 0000000000..bbace29aa0 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/ISessionCallback.aidl @@ -0,0 +1,56 @@ +/* + * 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 -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; +@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/2/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/SensorProps.aidl new file mode 100644 index 0000000000..8b3c51bb12 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/2/android/hardware/biometrics/face/SensorProps.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 -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; +@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/fingerprint/aidl/Android.bp b/biometrics/fingerprint/aidl/Android.bp index c3a056cc2b..0bd642237c 100644 --- a/biometrics/fingerprint/aidl/Android.bp +++ b/biometrics/fingerprint/aidl/Android.bp @@ -26,5 +26,22 @@ aidl_interface { enabled: false, }, }, - versions: ["1"], + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.biometrics.common-V1", + "android.hardware.keymaster-V3", + ], + }, + { + version: "2", + imports: [ + "android.hardware.biometrics.common-V2", + "android.hardware.keymaster-V3", + ], + }, + + ], + } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/.hash b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/.hash new file mode 100644 index 0000000000..5d0d717241 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/.hash @@ -0,0 +1 @@ +c2f3b863b6dff925bc4451473ee6caa1aa304b8f diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl new file mode 100644 index 0000000000..c51aa033d4 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl @@ -0,0 +1,50 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +@Backing(type="byte") @VintfStability +enum AcquiredInfo { + UNKNOWN = 0, + GOOD = 1, + PARTIAL = 2, + INSUFFICIENT = 3, + SENSOR_DIRTY = 4, + TOO_SLOW = 5, + TOO_FAST = 6, + VENDOR = 7, + START = 8, + TOO_DARK = 9, + TOO_BRIGHT = 10, + IMMOBILE = 11, + RETRYING_CAPTURE = 12, +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/Error.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/Error.aidl new file mode 100644 index 0000000000..af7bc3c56b --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/Error.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +@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, + BAD_CALIBRATION = 8, +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl new file mode 100644 index 0000000000..9c208c4e7c --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl @@ -0,0 +1,43 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +@Backing(type="byte") @VintfStability +enum FingerprintSensorType { + UNKNOWN = 0, + REAR = 1, + UNDER_DISPLAY_ULTRASONIC = 2, + UNDER_DISPLAY_OPTICAL = 3, + POWER_BUTTON = 4, + HOME_BUTTON = 5, +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/IFingerprint.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/IFingerprint.aidl new file mode 100644 index 0000000000..5d3df6fbaa --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/IFingerprint.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +@VintfStability +interface IFingerprint { + android.hardware.biometrics.fingerprint.SensorProps[] getSensorProps(); + android.hardware.biometrics.fingerprint.ISession createSession(in int sensorId, in int userId, in android.hardware.biometrics.fingerprint.ISessionCallback cb); +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISession.aidl new file mode 100644 index 0000000000..30f299d1fc --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISession.aidl @@ -0,0 +1,57 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +@VintfStability +interface ISession { + void generateChallenge(); + void revokeChallenge(in long challenge); + android.hardware.biometrics.common.ICancellationSignal enroll(in android.hardware.keymaster.HardwareAuthToken hat); + android.hardware.biometrics.common.ICancellationSignal authenticate(in long operationId); + android.hardware.biometrics.common.ICancellationSignal detectInteraction(); + void enumerateEnrollments(); + void removeEnrollments(in int[] enrollmentIds); + void getAuthenticatorId(); + void invalidateAuthenticatorId(); + void resetLockout(in android.hardware.keymaster.HardwareAuthToken hat); + void close(); + void onPointerDown(in int pointerId, in int x, in int y, in float minor, in float major); + void onPointerUp(in int pointerId); + void onUiReady(); + android.hardware.biometrics.common.ICancellationSignal authenticateWithContext(in long operationId, in android.hardware.biometrics.common.OperationContext context); + android.hardware.biometrics.common.ICancellationSignal enrollWithContext(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.common.OperationContext context); + android.hardware.biometrics.common.ICancellationSignal detectInteractionWithContext(in android.hardware.biometrics.common.OperationContext context); + void onPointerDownWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); + void onPointerUpWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); + void onContextChanged(in android.hardware.biometrics.common.OperationContext context); +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISessionCallback.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISessionCallback.aidl new file mode 100644 index 0000000000..3c40ad63bf --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/ISessionCallback.aidl @@ -0,0 +1,53 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +@VintfStability +interface ISessionCallback { + void onChallengeGenerated(in long challenge); + void onChallengeRevoked(in long challenge); + void onAcquired(in android.hardware.biometrics.fingerprint.AcquiredInfo info, in int vendorCode); + void onError(in android.hardware.biometrics.fingerprint.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 onEnrollmentsRemoved(in int[] enrollmentIds); + void onAuthenticatorIdRetrieved(in long authenticatorId); + void onAuthenticatorIdInvalidated(in long newAuthenticatorId); + void onSessionClosed(); +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/PointerContext.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/PointerContext.aidl new file mode 100644 index 0000000000..43db6cfb51 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/PointerContext.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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.fingerprint; +@VintfStability +parcelable PointerContext { + int pointerId = -1; + float x = 0.000000f; + float y = 0.000000f; + float minor = 0.000000f; + float major = 0.000000f; + float orientation = 0.000000f; + boolean isAod = false; + long time = 0; + long gestureStart = 0; +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorLocation.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorLocation.aidl new file mode 100644 index 0000000000..295fde9f5f --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorLocation.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 -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.fingerprint; +@VintfStability +parcelable SensorLocation { + int displayId; + int sensorLocationX; + int sensorLocationY; + int sensorRadius; + String display = ""; +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorProps.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorProps.aidl new file mode 100644 index 0000000000..782d2899d3 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/2/android/hardware/biometrics/fingerprint/SensorProps.aidl @@ -0,0 +1,44 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +@VintfStability +parcelable SensorProps { + android.hardware.biometrics.common.CommonProps commonProps; + android.hardware.biometrics.fingerprint.FingerprintSensorType sensorType = android.hardware.biometrics.fingerprint.FingerprintSensorType.UNKNOWN; + android.hardware.biometrics.fingerprint.SensorLocation[] sensorLocations; + boolean supportsNavigationGestures; + boolean supportsDetectInteraction; + boolean halHandlesDisplayTouches; + boolean halControlsIllumination; +} diff --git a/bluetooth/audio/aidl/Android.bp b/bluetooth/audio/aidl/Android.bp index 52671b867e..cd6617b094 100644 --- a/bluetooth/audio/aidl/Android.bp +++ b/bluetooth/audio/aidl/Android.bp @@ -50,4 +50,15 @@ aidl_interface { min_sdk_version: "31", }, }, + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.common-V2", + "android.hardware.common.fmq-V1", + "android.hardware.audio.common-V1", + ], + }, + ], + } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/.hash b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/.hash new file mode 100644 index 0000000000..6d86950c3b --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/.hash @@ -0,0 +1 @@ +f8e3fbe6eb69d5ee54f70c8af2f8168b6badc86d diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AacCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AacCapabilities.aidl new file mode 100644 index 0000000000..899b8ca6db --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AacCapabilities.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable AacCapabilities { + android.hardware.bluetooth.audio.AacObjectType[] objectType; + int[] sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; + boolean variableBitRateSupported; + byte[] bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AacConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AacConfiguration.aidl new file mode 100644 index 0000000000..6adef6df16 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AacConfiguration.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable AacConfiguration { + android.hardware.bluetooth.audio.AacObjectType objectType; + int sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode channelMode; + boolean variableBitRateEnabled; + byte bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AacObjectType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AacObjectType.aidl new file mode 100644 index 0000000000..2148244d06 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AacObjectType.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 -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.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum AacObjectType { + MPEG2_LC = 0, + MPEG4_LC = 1, + MPEG4_LTP = 2, + MPEG4_SCALABLE = 3, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveCapabilities.aidl new file mode 100644 index 0000000000..4e5dfe66c2 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveCapabilities.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@VintfStability +parcelable AptxAdaptiveCapabilities { + int[] sampleRateHz; + android.hardware.bluetooth.audio.AptxAdaptiveChannelMode[] channelMode; + byte[] bitsPerSample; + android.hardware.bluetooth.audio.AptxMode[] aptxMode; + android.hardware.bluetooth.audio.AptxSinkBuffering sinkBufferingMs; + android.hardware.bluetooth.audio.AptxAdaptiveTimeToPlay ttp; + android.hardware.bluetooth.audio.AptxAdaptiveInputMode inputMode; + int inputFadeDurationMs; + byte[] aptxAdaptiveConfigStream; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveChannelMode.aidl new file mode 100644 index 0000000000..0499b706ff --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveChannelMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@Backing(type="int") @VintfStability +enum AptxAdaptiveChannelMode { + JOINT_STEREO = 0, + MONO = 1, + DUAL_MONO = 2, + TWS_STEREO = 4, + UNKNOWN = 255, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveConfiguration.aidl new file mode 100644 index 0000000000..aab05213b4 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveConfiguration.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@VintfStability +parcelable AptxAdaptiveConfiguration { + int sampleRateHz; + android.hardware.bluetooth.audio.AptxAdaptiveChannelMode channelMode; + byte bitsPerSample; + android.hardware.bluetooth.audio.AptxMode aptxMode; + android.hardware.bluetooth.audio.AptxSinkBuffering sinkBufferingMs; + android.hardware.bluetooth.audio.AptxAdaptiveTimeToPlay ttp; + android.hardware.bluetooth.audio.AptxAdaptiveInputMode inputMode; + int inputFadeDurationMs; + byte[] aptxAdaptiveConfigStream; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveInputMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveInputMode.aidl new file mode 100644 index 0000000000..f7029396c6 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveInputMode.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@Backing(type="int") @VintfStability +enum AptxAdaptiveInputMode { + STEREO = 0, + DUAL_MONO = 1, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveTimeToPlay.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveTimeToPlay.aidl new file mode 100644 index 0000000000..35606667cb --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxAdaptiveTimeToPlay.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@VintfStability +parcelable AptxAdaptiveTimeToPlay { + byte lowLowLatency; + byte highLowLatency; + byte lowHighQuality; + byte highHighQuality; + byte lowTws; + byte highTws; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxCapabilities.aidl new file mode 100644 index 0000000000..08a38e26e1 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable AptxCapabilities { + int[] sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; + byte[] bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxConfiguration.aidl new file mode 100644 index 0000000000..91e88b32f3 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxConfiguration.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable AptxConfiguration { + int sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode channelMode; + byte bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxMode.aidl new file mode 100644 index 0000000000..d5dd9d9deb --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@Backing(type="int") @VintfStability +enum AptxMode { + UNKNOWN = 0, + HIGH_QUALITY = 4096, + LOW_LATENCY = 8192, + ULTRA_LOW_LATENCY = 16384, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxSinkBuffering.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxSinkBuffering.aidl new file mode 100644 index 0000000000..527418e308 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AptxSinkBuffering.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@VintfStability +parcelable AptxSinkBuffering { + byte minLowLatency; + byte maxLowLatency; + byte minHighQuality; + byte maxHighQuality; + byte minTws; + byte maxTws; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AudioCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AudioCapabilities.aidl new file mode 100644 index 0000000000..8ae716ff23 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AudioCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +union AudioCapabilities { + android.hardware.bluetooth.audio.PcmCapabilities pcmCapabilities; + android.hardware.bluetooth.audio.CodecCapabilities a2dpCapabilities; + android.hardware.bluetooth.audio.LeAudioCodecCapabilitiesSetting leAudioCapabilities; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AudioConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AudioConfiguration.aidl new file mode 100644 index 0000000000..3abfb31b7b --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AudioConfiguration.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +union AudioConfiguration { + android.hardware.bluetooth.audio.PcmConfiguration pcmConfig; + android.hardware.bluetooth.audio.CodecConfiguration a2dpConfig; + android.hardware.bluetooth.audio.LeAudioConfiguration leAudioConfig; + android.hardware.bluetooth.audio.LeAudioBroadcastConfiguration leAudioBroadcastConfig; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AudioLocation.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AudioLocation.aidl new file mode 100644 index 0000000000..319a5e2ad0 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/AudioLocation.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="int") @VintfStability +enum AudioLocation { + UNKNOWN = 1, + FRONT_LEFT = 2, + FRONT_RIGHT = 4, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl new file mode 100644 index 0000000000..c20c057626 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="int") @VintfStability +enum BluetoothAudioStatus { + UNKNOWN = 0, + SUCCESS = 1, + UNSUPPORTED_CODEC_CONFIGURATION = 2, + FAILURE = 3, + RECONFIGURATION = 4, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/BroadcastCapability.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/BroadcastCapability.aidl new file mode 100644 index 0000000000..58710effe7 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/BroadcastCapability.aidl @@ -0,0 +1,50 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@VintfStability +parcelable BroadcastCapability { + android.hardware.bluetooth.audio.CodecType codecType; + android.hardware.bluetooth.audio.AudioLocation supportedChannel; + int channelCountPerStream; + android.hardware.bluetooth.audio.BroadcastCapability.LeAudioCodecCapabilities leAudioCodecCapabilities; + @VintfStability + parcelable VendorCapabilities { + ParcelableHolder extension; + } + @VintfStability + union LeAudioCodecCapabilities { + @nullable android.hardware.bluetooth.audio.Lc3Capabilities[] lc3Capabilities; + @nullable android.hardware.bluetooth.audio.BroadcastCapability.VendorCapabilities[] vendorCapabillities; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/ChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/ChannelMode.aidl new file mode 100644 index 0000000000..c3bc7410e4 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/ChannelMode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum ChannelMode { + UNKNOWN = 0, + MONO = 1, + STEREO = 2, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/CodecCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/CodecCapabilities.aidl new file mode 100644 index 0000000000..6efdcb745e --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/CodecCapabilities.aidl @@ -0,0 +1,53 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable CodecCapabilities { + android.hardware.bluetooth.audio.CodecType codecType; + android.hardware.bluetooth.audio.CodecCapabilities.Capabilities capabilities; + @VintfStability + parcelable VendorCapabilities { + ParcelableHolder extension; + } + @VintfStability + union Capabilities { + android.hardware.bluetooth.audio.SbcCapabilities sbcCapabilities; + android.hardware.bluetooth.audio.AacCapabilities aacCapabilities; + android.hardware.bluetooth.audio.LdacCapabilities ldacCapabilities; + android.hardware.bluetooth.audio.AptxCapabilities aptxCapabilities; + android.hardware.bluetooth.audio.AptxAdaptiveCapabilities aptxAdaptiveCapabilities; + android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities; + android.hardware.bluetooth.audio.CodecCapabilities.VendorCapabilities vendorCapabilities; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/CodecConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/CodecConfiguration.aidl new file mode 100644 index 0000000000..77a6b1b0f2 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/CodecConfiguration.aidl @@ -0,0 +1,58 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable CodecConfiguration { + android.hardware.bluetooth.audio.CodecType codecType; + int encodedAudioBitrate; + int peerMtu; + boolean isScmstEnabled; + android.hardware.bluetooth.audio.CodecConfiguration.CodecSpecific config; + @VintfStability + parcelable VendorConfiguration { + int vendorId; + char codecId; + ParcelableHolder codecConfig; + } + @VintfStability + union CodecSpecific { + android.hardware.bluetooth.audio.SbcConfiguration sbcConfig; + android.hardware.bluetooth.audio.AacConfiguration aacConfig; + android.hardware.bluetooth.audio.LdacConfiguration ldacConfig; + android.hardware.bluetooth.audio.AptxConfiguration aptxConfig; + android.hardware.bluetooth.audio.AptxAdaptiveConfiguration aptxAdaptiveConfig; + android.hardware.bluetooth.audio.Lc3Configuration lc3Config; + android.hardware.bluetooth.audio.CodecConfiguration.VendorConfiguration vendorConfig; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/CodecType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/CodecType.aidl new file mode 100644 index 0000000000..1522cb4fd6 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/CodecType.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="int") @VintfStability +enum CodecType { + UNKNOWN = 0, + SBC = 1, + AAC = 2, + APTX = 3, + APTX_HD = 4, + LDAC = 5, + LC3 = 6, + VENDOR = 7, + APTX_ADAPTIVE = 8, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl new file mode 100644 index 0000000000..d364371707 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +interface IBluetoothAudioPort { + android.hardware.bluetooth.audio.PresentationPosition getPresentationPosition(); + void startStream(boolean isLowLatency); + void stopStream(); + void suspendStream(); + void updateSourceMetadata(in android.hardware.audio.common.SourceMetadata sourceMetadata); + void updateSinkMetadata(in android.hardware.audio.common.SinkMetadata sinkMetadata); + void setLatencyMode(in android.hardware.bluetooth.audio.LatencyMode latencyMode); +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl new file mode 100644 index 0000000000..267af0f4b4 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +interface IBluetoothAudioProvider { + void endSession(); + android.hardware.common.fmq.MQDescriptor startSession(in android.hardware.bluetooth.audio.IBluetoothAudioPort hostIf, in android.hardware.bluetooth.audio.AudioConfiguration audioConfig, in android.hardware.bluetooth.audio.LatencyMode[] supportedLatencyModes); + void streamStarted(in android.hardware.bluetooth.audio.BluetoothAudioStatus status); + void streamSuspended(in android.hardware.bluetooth.audio.BluetoothAudioStatus status); + void updateAudioConfiguration(in android.hardware.bluetooth.audio.AudioConfiguration audioConfig); + void setLowLatencyModeAllowed(in boolean allowed); +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl new file mode 100644 index 0000000000..5e33deb856 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +interface IBluetoothAudioProviderFactory { + android.hardware.bluetooth.audio.AudioCapabilities[] getProviderCapabilities(in android.hardware.bluetooth.audio.SessionType sessionType); + android.hardware.bluetooth.audio.IBluetoothAudioProvider openProvider(in android.hardware.bluetooth.audio.SessionType sessionType); +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LatencyMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LatencyMode.aidl new file mode 100644 index 0000000000..5583679412 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LatencyMode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@Backing(type="int") @VintfStability +enum LatencyMode { + UNKNOWN = 0, + LOW_LATENCY = 1, + FREE = 2, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/Lc3Capabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/Lc3Capabilities.aidl new file mode 100644 index 0000000000..cc4449aea9 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/Lc3Capabilities.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable Lc3Capabilities { + byte[] pcmBitDepth; + int[] samplingFrequencyHz; + int[] frameDurationUs; + int[] octetsPerFrame; + byte[] blocksPerSdu; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/Lc3Configuration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/Lc3Configuration.aidl new file mode 100644 index 0000000000..7e8dccff5f --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/Lc3Configuration.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable Lc3Configuration { + byte pcmBitDepth; + int samplingFrequencyHz; + int frameDurationUs; + int octetsPerFrame; + byte blocksPerSdu; + android.hardware.bluetooth.audio.ChannelMode channelMode; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacCapabilities.aidl new file mode 100644 index 0000000000..aa4e4c8793 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacCapabilities.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable LdacCapabilities { + int[] sampleRateHz; + android.hardware.bluetooth.audio.LdacChannelMode[] channelMode; + android.hardware.bluetooth.audio.LdacQualityIndex[] qualityIndex; + byte[] bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacChannelMode.aidl new file mode 100644 index 0000000000..88d6faff53 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacChannelMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum LdacChannelMode { + UNKNOWN = 0, + STEREO = 1, + DUAL = 2, + MONO = 3, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacConfiguration.aidl new file mode 100644 index 0000000000..8a3763800b --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacConfiguration.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable LdacConfiguration { + int sampleRateHz; + android.hardware.bluetooth.audio.LdacChannelMode channelMode; + android.hardware.bluetooth.audio.LdacQualityIndex qualityIndex; + byte bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacQualityIndex.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacQualityIndex.aidl new file mode 100644 index 0000000000..35e435867e --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LdacQualityIndex.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum LdacQualityIndex { + HIGH = 0, + MID = 1, + LOW = 2, + ABR = 3, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.aidl new file mode 100644 index 0000000000..7d53b0ca8e --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable LeAudioBroadcastConfiguration { + android.hardware.bluetooth.audio.CodecType codecType; + android.hardware.bluetooth.audio.LeAudioBroadcastConfiguration.BroadcastStreamMap[] streamMap; + @VintfStability + parcelable BroadcastStreamMap { + char streamHandle; + int audioChannelAllocation; + android.hardware.bluetooth.audio.LeAudioCodecConfiguration leAudioCodecConfig; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioCodecCapabilitiesSetting.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioCodecCapabilitiesSetting.aidl new file mode 100644 index 0000000000..9818d543ac --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioCodecCapabilitiesSetting.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@VintfStability +parcelable LeAudioCodecCapabilitiesSetting { + android.hardware.bluetooth.audio.UnicastCapability unicastEncodeCapability; + android.hardware.bluetooth.audio.UnicastCapability unicastDecodeCapability; + android.hardware.bluetooth.audio.BroadcastCapability broadcastCapability; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl new file mode 100644 index 0000000000..bb3d7e4b1e --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +union LeAudioCodecConfiguration { + android.hardware.bluetooth.audio.Lc3Configuration lc3Config; + android.hardware.bluetooth.audio.LeAudioCodecConfiguration.VendorConfiguration vendorConfig; + @VintfStability + parcelable VendorConfiguration { + ParcelableHolder extension; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl new file mode 100644 index 0000000000..edb6795ddc --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable LeAudioConfiguration { + android.hardware.bluetooth.audio.CodecType codecType; + android.hardware.bluetooth.audio.LeAudioConfiguration.StreamMap[] streamMap; + int peerDelayUs; + android.hardware.bluetooth.audio.LeAudioCodecConfiguration leAudioCodecConfig; + @VintfStability + parcelable StreamMap { + char streamHandle; + int audioChannelAllocation; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/PcmCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/PcmCapabilities.aidl new file mode 100644 index 0000000000..0c2f87d599 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/PcmCapabilities.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable PcmCapabilities { + int[] sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; + byte[] bitsPerSample; + int[] dataIntervalUs; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/PcmConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/PcmConfiguration.aidl new file mode 100644 index 0000000000..93d7805a33 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/PcmConfiguration.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable PcmConfiguration { + int sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode channelMode; + byte bitsPerSample; + int dataIntervalUs; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/PresentationPosition.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/PresentationPosition.aidl new file mode 100644 index 0000000000..7e997e8c8f --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/PresentationPosition.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 -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.bluetooth.audio; +@VintfStability +parcelable PresentationPosition { + long remoteDeviceAudioDelayNanos; + long transmittedOctets; + android.hardware.bluetooth.audio.PresentationPosition.TimeSpec transmittedOctetsTimestamp; + @VintfStability + parcelable TimeSpec { + long tvSec; + long tvNSec; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcAllocMethod.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcAllocMethod.aidl new file mode 100644 index 0000000000..091f6d7246 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcAllocMethod.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum SbcAllocMethod { + ALLOC_MD_S = 0, + ALLOC_MD_L = 1, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcCapabilities.aidl new file mode 100644 index 0000000000..c8d7e7e74e --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcCapabilities.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable SbcCapabilities { + int[] sampleRateHz; + android.hardware.bluetooth.audio.SbcChannelMode[] channelMode; + byte[] blockLength; + byte[] numSubbands; + android.hardware.bluetooth.audio.SbcAllocMethod[] allocMethod; + byte[] bitsPerSample; + int minBitpool; + int maxBitpool; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcChannelMode.aidl new file mode 100644 index 0000000000..6441a99877 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcChannelMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum SbcChannelMode { + UNKNOWN = 0, + JOINT_STEREO = 1, + STEREO = 2, + DUAL = 3, + MONO = 4, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcConfiguration.aidl new file mode 100644 index 0000000000..8eab9c3d96 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SbcConfiguration.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable SbcConfiguration { + int sampleRateHz; + android.hardware.bluetooth.audio.SbcChannelMode channelMode; + byte blockLength; + byte numSubbands; + android.hardware.bluetooth.audio.SbcAllocMethod allocMethod; + byte bitsPerSample; + int minBitpool; + int maxBitpool; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SessionType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SessionType.aidl new file mode 100644 index 0000000000..33a3187c3b --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/SessionType.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum SessionType { + UNKNOWN = 0, + A2DP_SOFTWARE_ENCODING_DATAPATH = 1, + A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH = 2, + HEARING_AID_SOFTWARE_ENCODING_DATAPATH = 3, + LE_AUDIO_SOFTWARE_ENCODING_DATAPATH = 4, + LE_AUDIO_SOFTWARE_DECODING_DATAPATH = 5, + LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH = 6, + LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH = 7, + LE_AUDIO_BROADCAST_SOFTWARE_ENCODING_DATAPATH = 8, + LE_AUDIO_BROADCAST_HARDWARE_OFFLOAD_ENCODING_DATAPATH = 9, + A2DP_SOFTWARE_DECODING_DATAPATH = 10, + A2DP_HARDWARE_OFFLOAD_DECODING_DATAPATH = 11, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/UnicastCapability.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/UnicastCapability.aidl new file mode 100644 index 0000000000..130fef971c --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/1/android/hardware/bluetooth/audio/UnicastCapability.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable UnicastCapability { + android.hardware.bluetooth.audio.CodecType codecType; + android.hardware.bluetooth.audio.AudioLocation supportedChannel; + int deviceCount; + int channelCountPerDevice; + android.hardware.bluetooth.audio.UnicastCapability.LeAudioCodecCapabilities leAudioCodecCapabilities; + @VintfStability + parcelable VendorCapabilities { + ParcelableHolder extension; + } + @VintfStability + union LeAudioCodecCapabilities { + android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities; + android.hardware.bluetooth.audio.UnicastCapability.VendorCapabilities vendorCapabillities; + } +} diff --git a/camera/device/aidl/Android.bp b/camera/device/aidl/Android.bp index b6f4c58ae7..afc6b8d101 100644 --- a/camera/device/aidl/Android.bp +++ b/camera/device/aidl/Android.bp @@ -17,7 +17,7 @@ aidl_interface { "android.hardware.common.fmq-V1", "android.hardware.camera.common", "android.hardware.camera.metadata", - "android.hardware.graphics.common" + "android.hardware.graphics.common", ], backend: { cpp: { @@ -33,4 +33,17 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.common-V2", + "android.hardware.common.fmq-V1", + "android.hardware.camera.common-V1", + "android.hardware.camera.metadata-V1", + "android.hardware.graphics.common-V3", + ], + }, + ], + } diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/.hash b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/.hash new file mode 100644 index 0000000000..4405ef5e1e --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/.hash @@ -0,0 +1 @@ +ef5889d8da1473ff5dfc481b9ce32a3f173ea048 diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferCache.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferCache.aidl new file mode 100644 index 0000000000..9439172d6b --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferCache.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 -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 BufferCache { + int streamId; + long bufferId; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferRequest.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferRequest.aidl new file mode 100644 index 0000000000..c40a24aa79 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferRequest.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 -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 BufferRequest { + int streamId; + int numBuffersRequested; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferRequestStatus.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferRequestStatus.aidl new file mode 100644 index 0000000000..72fb61ba29 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferRequestStatus.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 -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; +@Backing(type="int") @VintfStability +enum BufferRequestStatus { + OK = 0, + FAILED_PARTIAL = 1, + FAILED_CONFIGURING = 2, + FAILED_ILLEGAL_ARGUMENTS = 3, + FAILED_UNKNOWN = 4, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferStatus.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferStatus.aidl new file mode 100644 index 0000000000..43a2b35e74 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/BufferStatus.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 -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; +@Backing(type="int") @VintfStability +enum BufferStatus { + OK = 0, + ERROR = 1, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraBlob.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraBlob.aidl new file mode 100644 index 0000000000..520181c87f --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraBlob.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 -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 CameraBlob { + android.hardware.camera.device.CameraBlobId blobId; + int blobSizeBytes; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraBlobId.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraBlobId.aidl new file mode 100644 index 0000000000..632499d55d --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraBlobId.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 -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; +@Backing(type="int") @VintfStability +enum CameraBlobId { + JPEG = 255, + JPEG_APP_SEGMENTS = 256, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraMetadata.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraMetadata.aidl new file mode 100644 index 0000000000..b96d69e1b8 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraMetadata.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 -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 CameraMetadata { + byte[] metadata; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraOfflineSessionInfo.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraOfflineSessionInfo.aidl new file mode 100644 index 0000000000..1ad8e115c8 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CameraOfflineSessionInfo.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 -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 CameraOfflineSessionInfo { + android.hardware.camera.device.OfflineStream[] offlineStreams; + android.hardware.camera.device.OfflineRequest[] offlineRequests; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CaptureRequest.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CaptureRequest.aidl new file mode 100644 index 0000000000..6b5b256571 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CaptureRequest.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 -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 CaptureRequest { + int frameNumber; + long fmqSettingsSize; + android.hardware.camera.device.CameraMetadata settings; + android.hardware.camera.device.StreamBuffer inputBuffer; + int inputWidth; + int inputHeight; + android.hardware.camera.device.StreamBuffer[] outputBuffers; + android.hardware.camera.device.PhysicalCameraSetting[] physicalCameraSettings; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CaptureResult.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CaptureResult.aidl new file mode 100644 index 0000000000..a820e2c463 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/CaptureResult.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 -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 CaptureResult { + int frameNumber; + long fmqResultSize; + android.hardware.camera.device.CameraMetadata result; + android.hardware.camera.device.StreamBuffer[] outputBuffers; + android.hardware.camera.device.StreamBuffer inputBuffer; + int partialResult; + android.hardware.camera.device.PhysicalCameraMetadata[] physicalCameraMetadata; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ErrorCode.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ErrorCode.aidl new file mode 100644 index 0000000000..2f9887a7a5 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ErrorCode.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 -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; +@Backing(type="int") @VintfStability +enum ErrorCode { + ERROR_DEVICE = 1, + ERROR_REQUEST = 2, + ERROR_RESULT = 3, + ERROR_BUFFER = 4, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ErrorMsg.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ErrorMsg.aidl new file mode 100644 index 0000000000..b2e9512bbf --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ErrorMsg.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 -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 ErrorMsg { + int frameNumber; + int errorStreamId; + android.hardware.camera.device.ErrorCode errorCode; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/HalStream.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/HalStream.aidl new file mode 100644 index 0000000000..a5784bcf32 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/HalStream.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 -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 HalStream { + int id; + android.hardware.graphics.common.PixelFormat overrideFormat; + android.hardware.graphics.common.BufferUsage producerUsage; + android.hardware.graphics.common.BufferUsage consumerUsage; + int maxBuffers; + android.hardware.graphics.common.Dataspace overrideDataSpace; + String physicalCameraId; + boolean supportOffline; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraDevice.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraDevice.aidl new file mode 100644 index 0000000000..51c60676be --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraDevice.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 +interface ICameraDevice { + android.hardware.camera.device.CameraMetadata getCameraCharacteristics(); + android.hardware.camera.device.CameraMetadata getPhysicalCameraCharacteristics(in String physicalCameraId); + android.hardware.camera.common.CameraResourceCost getResourceCost(); + boolean isStreamCombinationSupported(in android.hardware.camera.device.StreamConfiguration streams); + android.hardware.camera.device.ICameraDeviceSession open(in android.hardware.camera.device.ICameraDeviceCallback callback); + android.hardware.camera.device.ICameraInjectionSession openInjectionSession(in android.hardware.camera.device.ICameraDeviceCallback callback); + void setTorchMode(boolean on); + void turnOnTorchWithStrengthLevel(int torchStrength); + int getTorchStrengthLevel(); +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraDeviceCallback.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraDeviceCallback.aidl new file mode 100644 index 0000000000..7b79c6c87a --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraDeviceCallback.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 -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 +interface ICameraDeviceCallback { + void notify(in android.hardware.camera.device.NotifyMsg[] msgs); + void processCaptureResult(in android.hardware.camera.device.CaptureResult[] results); + android.hardware.camera.device.BufferRequestStatus requestStreamBuffers(in android.hardware.camera.device.BufferRequest[] bufReqs, out android.hardware.camera.device.StreamBufferRet[] buffers); + void returnStreamBuffers(in android.hardware.camera.device.StreamBuffer[] buffers); +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraDeviceSession.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraDeviceSession.aidl new file mode 100644 index 0000000000..2196d37a6c --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraDeviceSession.aidl @@ -0,0 +1,48 @@ +/* + * 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 -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 +interface ICameraDeviceSession { + void close(); + android.hardware.camera.device.HalStream[] configureStreams(in android.hardware.camera.device.StreamConfiguration requestedConfiguration); + android.hardware.camera.device.CameraMetadata constructDefaultRequestSettings(in android.hardware.camera.device.RequestTemplate type); + void flush(); + android.hardware.common.fmq.MQDescriptor getCaptureRequestMetadataQueue(); + android.hardware.common.fmq.MQDescriptor getCaptureResultMetadataQueue(); + boolean isReconfigurationRequired(in android.hardware.camera.device.CameraMetadata oldSessionParams, in android.hardware.camera.device.CameraMetadata newSessionParams); + int processCaptureRequest(in android.hardware.camera.device.CaptureRequest[] requests, in android.hardware.camera.device.BufferCache[] cachesToRemove); + 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); +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraInjectionSession.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraInjectionSession.aidl new file mode 100644 index 0000000000..80f74f331c --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraInjectionSession.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 -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 +interface ICameraInjectionSession { + void configureInjectionStreams(in android.hardware.camera.device.StreamConfiguration requestedConfiguration, in android.hardware.camera.device.CameraMetadata characteristics); + android.hardware.camera.device.ICameraDeviceSession getCameraDeviceSession(); +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraOfflineSession.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraOfflineSession.aidl new file mode 100644 index 0000000000..727d856fc8 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ICameraOfflineSession.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 -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 +interface ICameraOfflineSession { + void close(); + android.hardware.common.fmq.MQDescriptor getCaptureResultMetadataQueue(); + void setCallback(in android.hardware.camera.device.ICameraDeviceCallback cb); +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/NotifyMsg.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/NotifyMsg.aidl new file mode 100644 index 0000000000..3ad7e52e63 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/NotifyMsg.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 -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 +union NotifyMsg { + android.hardware.camera.device.ErrorMsg error; + android.hardware.camera.device.ShutterMsg shutter; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/OfflineRequest.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/OfflineRequest.aidl new file mode 100644 index 0000000000..6e6f29d6fc --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/OfflineRequest.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 -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 OfflineRequest { + int frameNumber; + int[] pendingStreams; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/OfflineStream.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/OfflineStream.aidl new file mode 100644 index 0000000000..54cb1fed0e --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/OfflineStream.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 -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 OfflineStream { + int id; + int numOutstandingBuffers; + long[] circulatingBufferIds; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/PhysicalCameraMetadata.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/PhysicalCameraMetadata.aidl new file mode 100644 index 0000000000..3d66ab8713 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/PhysicalCameraMetadata.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 -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 PhysicalCameraMetadata { + long fmqMetadataSize; + String physicalCameraId; + android.hardware.camera.device.CameraMetadata metadata; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/PhysicalCameraSetting.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/PhysicalCameraSetting.aidl new file mode 100644 index 0000000000..a6c241d453 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/PhysicalCameraSetting.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 -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 PhysicalCameraSetting { + long fmqSettingsSize; + String physicalCameraId; + android.hardware.camera.device.CameraMetadata settings; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/RequestTemplate.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/RequestTemplate.aidl new file mode 100644 index 0000000000..b70b8997d9 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/RequestTemplate.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 -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; +@Backing(type="int") @VintfStability +enum RequestTemplate { + PREVIEW = 1, + STILL_CAPTURE = 2, + VIDEO_RECORD = 3, + VIDEO_SNAPSHOT = 4, + ZERO_SHUTTER_LAG = 5, + MANUAL = 6, + VENDOR_TEMPLATE_START = 1073741824, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ShutterMsg.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ShutterMsg.aidl new file mode 100644 index 0000000000..ce059ac0db --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/ShutterMsg.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 -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 ShutterMsg { + int frameNumber; + long timestamp; + long readoutTimestamp; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/Stream.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/Stream.aidl new file mode 100644 index 0000000000..d2f295a160 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/Stream.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 -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 Stream { + int id; + android.hardware.camera.device.StreamType streamType; + int width; + int height; + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.BufferUsage usage; + android.hardware.graphics.common.Dataspace dataSpace; + android.hardware.camera.device.StreamRotation rotation; + String physicalCameraId; + int bufferSize; + int groupId; + android.hardware.camera.metadata.SensorPixelMode[] sensorPixelModesUsed; + android.hardware.camera.metadata.RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile; + android.hardware.camera.metadata.ScalerAvailableStreamUseCases useCase; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBuffer.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBuffer.aidl new file mode 100644 index 0000000000..8fabf032db --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBuffer.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 -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 StreamBuffer { + int streamId; + long bufferId; + android.hardware.common.NativeHandle buffer; + android.hardware.camera.device.BufferStatus status; + android.hardware.common.NativeHandle acquireFence; + android.hardware.common.NativeHandle releaseFence; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBufferRequestError.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBufferRequestError.aidl new file mode 100644 index 0000000000..f450149635 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBufferRequestError.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 -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; +@Backing(type="int") @VintfStability +enum StreamBufferRequestError { + NO_BUFFER_AVAILABLE = 1, + MAX_BUFFER_EXCEEDED = 2, + STREAM_DISCONNECTED = 3, + UNKNOWN_ERROR = 4, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBufferRet.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBufferRet.aidl new file mode 100644 index 0000000000..3998cc34fa --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBufferRet.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 -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 StreamBufferRet { + int streamId; + android.hardware.camera.device.StreamBuffersVal val; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBuffersVal.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBuffersVal.aidl new file mode 100644 index 0000000000..bebc9fcced --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamBuffersVal.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 -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 +union StreamBuffersVal { + android.hardware.camera.device.StreamBufferRequestError error = android.hardware.camera.device.StreamBufferRequestError.UNKNOWN_ERROR; + android.hardware.camera.device.StreamBuffer[] buffers; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamConfiguration.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamConfiguration.aidl new file mode 100644 index 0000000000..f3405780be --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamConfiguration.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 -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 StreamConfiguration { + android.hardware.camera.device.Stream[] streams; + android.hardware.camera.device.StreamConfigurationMode operationMode; + android.hardware.camera.device.CameraMetadata sessionParams; + int streamConfigCounter; + boolean multiResolutionInputImage; +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamConfigurationMode.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamConfigurationMode.aidl new file mode 100644 index 0000000000..bdef41209d --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamConfigurationMode.aidl @@ -0,0 +1,47 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum StreamConfigurationMode { + NORMAL_MODE = 0, + CONSTRAINED_HIGH_SPEED_MODE = 1, + VENDOR_MODE_0 = 32768, + VENDOR_MODE_1 = 32769, + VENDOR_MODE_2 = 32770, + VENDOR_MODE_3 = 32771, + VENDOR_MODE_4 = 32772, + VENDOR_MODE_5 = 32773, + VENDOR_MODE_6 = 32774, + VENDOR_MODE_7 = 32775, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamRotation.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamRotation.aidl new file mode 100644 index 0000000000..2ef4274f88 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamRotation.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 -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; +@Backing(type="int") @VintfStability +enum StreamRotation { + ROTATION_0 = 0, + ROTATION_90 = 1, + ROTATION_180 = 2, + ROTATION_270 = 3, +} diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamType.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamType.aidl new file mode 100644 index 0000000000..0f13fe8be7 --- /dev/null +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/1/android/hardware/camera/device/StreamType.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 -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; +@Backing(type="int") @VintfStability +enum StreamType { + OUTPUT = 0, + INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/.hash b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/.hash new file mode 100644 index 0000000000..337c869590 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/.hash @@ -0,0 +1 @@ +070719d32c4dd88360ee5ccc25f70280374a0a89 diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/AutomotiveLensFacing.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/AutomotiveLensFacing.aidl new file mode 100644 index 0000000000..14ad26e08a --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/AutomotiveLensFacing.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. + *//* + * 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 -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 AutomotiveLensFacing { + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_OTHER = 0, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_FRONT = 1, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_REAR = 2, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_LEFT = 3, + ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_RIGHT = 4, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_OTHER = 5, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_LEFT = 6, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_CENTER = 7, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_RIGHT = 8, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_LEFT = 9, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_CENTER = 10, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_RIGHT = 11, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_LEFT = 12, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_CENTER = 13, + ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_RIGHT = 14, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/AutomotiveLocation.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/AutomotiveLocation.aidl new file mode 100644 index 0000000000..5417bdbf44 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/AutomotiveLocation.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. + *//* + * 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 -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 AutomotiveLocation { + ANDROID_AUTOMOTIVE_LOCATION_INTERIOR = 0, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_OTHER = 1, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_FRONT = 2, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_REAR = 3, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_LEFT = 4, + ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_RIGHT = 5, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_OTHER = 6, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_FRONT = 7, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_REAR = 8, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_LEFT = 9, + ANDROID_AUTOMOTIVE_LOCATION_EXTRA_RIGHT = 10, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/BlackLevelLock.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/BlackLevelLock.aidl new file mode 100644 index 0000000000..dcefa2f697 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/BlackLevelLock.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 -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 BlackLevelLock { + ANDROID_BLACK_LEVEL_LOCK_OFF = 0, + ANDROID_BLACK_LEVEL_LOCK_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/CameraMetadataSection.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/CameraMetadataSection.aidl new file mode 100644 index 0000000000..8bed156d8f --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/CameraMetadataSection.aidl @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *//* + * 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 -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 CameraMetadataSection { + ANDROID_COLOR_CORRECTION = 0, + ANDROID_CONTROL = 1, + ANDROID_DEMOSAIC = 2, + ANDROID_EDGE = 3, + ANDROID_FLASH = 4, + ANDROID_FLASH_INFO = 5, + ANDROID_HOT_PIXEL = 6, + ANDROID_JPEG = 7, + ANDROID_LENS = 8, + ANDROID_LENS_INFO = 9, + ANDROID_NOISE_REDUCTION = 10, + ANDROID_QUIRKS = 11, + ANDROID_REQUEST = 12, + ANDROID_SCALER = 13, + ANDROID_SENSOR = 14, + ANDROID_SENSOR_INFO = 15, + ANDROID_SHADING = 16, + ANDROID_STATISTICS = 17, + ANDROID_STATISTICS_INFO = 18, + ANDROID_TONEMAP = 19, + ANDROID_LED = 20, + ANDROID_INFO = 21, + ANDROID_BLACK_LEVEL = 22, + ANDROID_SYNC = 23, + ANDROID_REPROCESS = 24, + ANDROID_DEPTH = 25, + ANDROID_LOGICAL_MULTI_CAMERA = 26, + ANDROID_DISTORTION_CORRECTION = 27, + ANDROID_HEIC = 28, + ANDROID_HEIC_INFO = 29, + ANDROID_AUTOMOTIVE = 30, + ANDROID_AUTOMOTIVE_LENS = 31, + VENDOR_SECTION = 32768, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl new file mode 100644 index 0000000000..1725347698 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *//* + * 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 -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 CameraMetadataSectionStart { + ANDROID_COLOR_CORRECTION_START = 0, + ANDROID_CONTROL_START = 65536, + ANDROID_DEMOSAIC_START = 131072, + ANDROID_EDGE_START = 196608, + ANDROID_FLASH_START = 262144, + ANDROID_FLASH_INFO_START = 327680, + ANDROID_HOT_PIXEL_START = 393216, + ANDROID_JPEG_START = 458752, + ANDROID_LENS_START = 524288, + ANDROID_LENS_INFO_START = 589824, + ANDROID_NOISE_REDUCTION_START = 655360, + ANDROID_QUIRKS_START = 720896, + ANDROID_REQUEST_START = 786432, + ANDROID_SCALER_START = 851968, + ANDROID_SENSOR_START = 917504, + ANDROID_SENSOR_INFO_START = 983040, + ANDROID_SHADING_START = 1048576, + ANDROID_STATISTICS_START = 1114112, + ANDROID_STATISTICS_INFO_START = 1179648, + ANDROID_TONEMAP_START = 1245184, + ANDROID_LED_START = 1310720, + ANDROID_INFO_START = 1376256, + ANDROID_BLACK_LEVEL_START = 1441792, + ANDROID_SYNC_START = 1507328, + ANDROID_REPROCESS_START = 1572864, + ANDROID_DEPTH_START = 1638400, + ANDROID_LOGICAL_MULTI_CAMERA_START = 1703936, + ANDROID_DISTORTION_CORRECTION_START = 1769472, + ANDROID_HEIC_START = 1835008, + ANDROID_HEIC_INFO_START = 1900544, + ANDROID_AUTOMOTIVE_START = 1966080, + ANDROID_AUTOMOTIVE_LENS_START = 2031616, + VENDOR_SECTION_START = -2147483648, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/CameraMetadataTag.aidl new file mode 100644 index 0000000000..9bb55d27df --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/CameraMetadataTag.aidl @@ -0,0 +1,331 @@ +/* + * 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 -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 CameraMetadataTag { + ANDROID_COLOR_CORRECTION_MODE = 0, + ANDROID_COLOR_CORRECTION_TRANSFORM = 1, + ANDROID_COLOR_CORRECTION_GAINS = 2, + ANDROID_COLOR_CORRECTION_ABERRATION_MODE = 3, + ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES = 4, + ANDROID_CONTROL_AE_ANTIBANDING_MODE = 65536, + ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION = 65537, + ANDROID_CONTROL_AE_LOCK = 65538, + ANDROID_CONTROL_AE_MODE = 65539, + ANDROID_CONTROL_AE_REGIONS = 65540, + ANDROID_CONTROL_AE_TARGET_FPS_RANGE = 65541, + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER = 65542, + ANDROID_CONTROL_AF_MODE = 65543, + ANDROID_CONTROL_AF_REGIONS = 65544, + ANDROID_CONTROL_AF_TRIGGER = 65545, + ANDROID_CONTROL_AWB_LOCK = 65546, + ANDROID_CONTROL_AWB_MODE = 65547, + ANDROID_CONTROL_AWB_REGIONS = 65548, + ANDROID_CONTROL_CAPTURE_INTENT = 65549, + ANDROID_CONTROL_EFFECT_MODE = 65550, + ANDROID_CONTROL_MODE = 65551, + ANDROID_CONTROL_SCENE_MODE = 65552, + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE = 65553, + ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES = 65554, + ANDROID_CONTROL_AE_AVAILABLE_MODES = 65555, + ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES = 65556, + ANDROID_CONTROL_AE_COMPENSATION_RANGE = 65557, + ANDROID_CONTROL_AE_COMPENSATION_STEP = 65558, + ANDROID_CONTROL_AF_AVAILABLE_MODES = 65559, + ANDROID_CONTROL_AVAILABLE_EFFECTS = 65560, + ANDROID_CONTROL_AVAILABLE_SCENE_MODES = 65561, + ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES = 65562, + ANDROID_CONTROL_AWB_AVAILABLE_MODES = 65563, + ANDROID_CONTROL_MAX_REGIONS = 65564, + ANDROID_CONTROL_SCENE_MODE_OVERRIDES = 65565, + ANDROID_CONTROL_AE_PRECAPTURE_ID = 65566, + ANDROID_CONTROL_AE_STATE = 65567, + ANDROID_CONTROL_AF_STATE = 65568, + ANDROID_CONTROL_AF_TRIGGER_ID = 65569, + ANDROID_CONTROL_AWB_STATE = 65570, + ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS = 65571, + ANDROID_CONTROL_AE_LOCK_AVAILABLE = 65572, + ANDROID_CONTROL_AWB_LOCK_AVAILABLE = 65573, + ANDROID_CONTROL_AVAILABLE_MODES = 65574, + ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE = 65575, + ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST = 65576, + ANDROID_CONTROL_ENABLE_ZSL = 65577, + ANDROID_CONTROL_AF_SCENE_CHANGE = 65578, + ANDROID_CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_MAX_SIZES = 65579, + ANDROID_CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_ZOOM_RATIO_RANGES = 65580, + ANDROID_CONTROL_EXTENDED_SCENE_MODE = 65581, + ANDROID_CONTROL_ZOOM_RATIO_RANGE = 65582, + ANDROID_CONTROL_ZOOM_RATIO = 65583, + ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS_MAXIMUM_RESOLUTION = 65584, + ANDROID_DEMOSAIC_MODE = 131072, + ANDROID_EDGE_MODE = 196608, + ANDROID_EDGE_STRENGTH = 196609, + ANDROID_EDGE_AVAILABLE_EDGE_MODES = 196610, + ANDROID_FLASH_FIRING_POWER = 262144, + ANDROID_FLASH_FIRING_TIME = 262145, + ANDROID_FLASH_MODE = 262146, + ANDROID_FLASH_COLOR_TEMPERATURE = 262147, + ANDROID_FLASH_MAX_ENERGY = 262148, + ANDROID_FLASH_STATE = 262149, + ANDROID_FLASH_INFO_AVAILABLE = 327680, + ANDROID_FLASH_INFO_CHARGE_DURATION = 327681, + ANDROID_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL = 327682, + ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL = 327683, + ANDROID_HOT_PIXEL_MODE = 393216, + ANDROID_HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES = 393217, + ANDROID_JPEG_GPS_COORDINATES = 458752, + ANDROID_JPEG_GPS_PROCESSING_METHOD = 458753, + ANDROID_JPEG_GPS_TIMESTAMP = 458754, + ANDROID_JPEG_ORIENTATION = 458755, + ANDROID_JPEG_QUALITY = 458756, + ANDROID_JPEG_THUMBNAIL_QUALITY = 458757, + ANDROID_JPEG_THUMBNAIL_SIZE = 458758, + ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES = 458759, + ANDROID_JPEG_MAX_SIZE = 458760, + ANDROID_JPEG_SIZE = 458761, + ANDROID_LENS_APERTURE = 524288, + ANDROID_LENS_FILTER_DENSITY = 524289, + ANDROID_LENS_FOCAL_LENGTH = 524290, + ANDROID_LENS_FOCUS_DISTANCE = 524291, + ANDROID_LENS_OPTICAL_STABILIZATION_MODE = 524292, + ANDROID_LENS_FACING = 524293, + ANDROID_LENS_POSE_ROTATION = 524294, + ANDROID_LENS_POSE_TRANSLATION = 524295, + ANDROID_LENS_FOCUS_RANGE = 524296, + ANDROID_LENS_STATE = 524297, + ANDROID_LENS_INTRINSIC_CALIBRATION = 524298, + ANDROID_LENS_RADIAL_DISTORTION = 524299, + ANDROID_LENS_POSE_REFERENCE = 524300, + ANDROID_LENS_DISTORTION = 524301, + ANDROID_LENS_DISTORTION_MAXIMUM_RESOLUTION = 524302, + ANDROID_LENS_INTRINSIC_CALIBRATION_MAXIMUM_RESOLUTION = 524303, + ANDROID_LENS_INFO_AVAILABLE_APERTURES = 589824, + ANDROID_LENS_INFO_AVAILABLE_FILTER_DENSITIES = 589825, + ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS = 589826, + ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION = 589827, + ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE = 589828, + ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE = 589829, + ANDROID_LENS_INFO_SHADING_MAP_SIZE = 589830, + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION = 589831, + ANDROID_NOISE_REDUCTION_MODE = 655360, + ANDROID_NOISE_REDUCTION_STRENGTH = 655361, + ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES = 655362, + ANDROID_QUIRKS_METERING_CROP_REGION = 720896, + ANDROID_QUIRKS_TRIGGER_AF_WITH_AUTO = 720897, + ANDROID_QUIRKS_USE_ZSL_FORMAT = 720898, + ANDROID_QUIRKS_USE_PARTIAL_RESULT = 720899, + ANDROID_QUIRKS_PARTIAL_RESULT = 720900, + ANDROID_REQUEST_FRAME_COUNT = 786432, + ANDROID_REQUEST_ID = 786433, + ANDROID_REQUEST_INPUT_STREAMS = 786434, + ANDROID_REQUEST_METADATA_MODE = 786435, + ANDROID_REQUEST_OUTPUT_STREAMS = 786436, + ANDROID_REQUEST_TYPE = 786437, + ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS = 786438, + ANDROID_REQUEST_MAX_NUM_REPROCESS_STREAMS = 786439, + ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS = 786440, + ANDROID_REQUEST_PIPELINE_DEPTH = 786441, + ANDROID_REQUEST_PIPELINE_MAX_DEPTH = 786442, + ANDROID_REQUEST_PARTIAL_RESULT_COUNT = 786443, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES = 786444, + ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS = 786445, + ANDROID_REQUEST_AVAILABLE_RESULT_KEYS = 786446, + ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS = 786447, + ANDROID_REQUEST_AVAILABLE_SESSION_KEYS = 786448, + ANDROID_REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS = 786449, + ANDROID_REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION = 786450, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP = 786451, + ANDROID_REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE = 786452, + ANDROID_SCALER_CROP_REGION = 851968, + ANDROID_SCALER_AVAILABLE_FORMATS = 851969, + ANDROID_SCALER_AVAILABLE_JPEG_MIN_DURATIONS = 851970, + ANDROID_SCALER_AVAILABLE_JPEG_SIZES = 851971, + ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM = 851972, + ANDROID_SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS = 851973, + ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES = 851974, + ANDROID_SCALER_AVAILABLE_RAW_MIN_DURATIONS = 851975, + ANDROID_SCALER_AVAILABLE_RAW_SIZES = 851976, + ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP = 851977, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS = 851978, + ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS = 851979, + ANDROID_SCALER_AVAILABLE_STALL_DURATIONS = 851980, + ANDROID_SCALER_CROPPING_TYPE = 851981, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS = 851982, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP = 851983, + ANDROID_SCALER_AVAILABLE_ROTATE_AND_CROP_MODES = 851984, + ANDROID_SCALER_ROTATE_AND_CROP = 851985, + ANDROID_SCALER_DEFAULT_SECURE_IMAGE_SIZE = 851986, + ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS = 851987, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = 851988, + ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION = 851989, + ANDROID_SCALER_AVAILABLE_STALL_DURATIONS_MAXIMUM_RESOLUTION = 851990, + ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP_MAXIMUM_RESOLUTION = 851991, + ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED = 851992, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES = 851994, + ANDROID_SENSOR_EXPOSURE_TIME = 917504, + ANDROID_SENSOR_FRAME_DURATION = 917505, + ANDROID_SENSOR_SENSITIVITY = 917506, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1 = 917507, + ANDROID_SENSOR_REFERENCE_ILLUMINANT2 = 917508, + ANDROID_SENSOR_CALIBRATION_TRANSFORM1 = 917509, + ANDROID_SENSOR_CALIBRATION_TRANSFORM2 = 917510, + ANDROID_SENSOR_COLOR_TRANSFORM1 = 917511, + ANDROID_SENSOR_COLOR_TRANSFORM2 = 917512, + ANDROID_SENSOR_FORWARD_MATRIX1 = 917513, + ANDROID_SENSOR_FORWARD_MATRIX2 = 917514, + ANDROID_SENSOR_BASE_GAIN_FACTOR = 917515, + ANDROID_SENSOR_BLACK_LEVEL_PATTERN = 917516, + ANDROID_SENSOR_MAX_ANALOG_SENSITIVITY = 917517, + ANDROID_SENSOR_ORIENTATION = 917518, + ANDROID_SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS = 917519, + ANDROID_SENSOR_TIMESTAMP = 917520, + ANDROID_SENSOR_TEMPERATURE = 917521, + ANDROID_SENSOR_NEUTRAL_COLOR_POINT = 917522, + ANDROID_SENSOR_NOISE_PROFILE = 917523, + ANDROID_SENSOR_PROFILE_HUE_SAT_MAP = 917524, + ANDROID_SENSOR_PROFILE_TONE_CURVE = 917525, + ANDROID_SENSOR_GREEN_SPLIT = 917526, + ANDROID_SENSOR_TEST_PATTERN_DATA = 917527, + ANDROID_SENSOR_TEST_PATTERN_MODE = 917528, + ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES = 917529, + ANDROID_SENSOR_ROLLING_SHUTTER_SKEW = 917530, + ANDROID_SENSOR_OPTICAL_BLACK_REGIONS = 917531, + ANDROID_SENSOR_DYNAMIC_BLACK_LEVEL = 917532, + ANDROID_SENSOR_DYNAMIC_WHITE_LEVEL = 917533, + ANDROID_SENSOR_OPAQUE_RAW_SIZE = 917534, + ANDROID_SENSOR_OPAQUE_RAW_SIZE_MAXIMUM_RESOLUTION = 917535, + ANDROID_SENSOR_PIXEL_MODE = 917536, + ANDROID_SENSOR_RAW_BINNING_FACTOR_USED = 917537, + ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE = 983040, + ANDROID_SENSOR_INFO_SENSITIVITY_RANGE = 983041, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT = 983042, + ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE = 983043, + ANDROID_SENSOR_INFO_MAX_FRAME_DURATION = 983044, + ANDROID_SENSOR_INFO_PHYSICAL_SIZE = 983045, + ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE = 983046, + ANDROID_SENSOR_INFO_WHITE_LEVEL = 983047, + ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE = 983048, + ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED = 983049, + ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE = 983050, + ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION = 983051, + ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE_MAXIMUM_RESOLUTION = 983052, + ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION = 983053, + ANDROID_SENSOR_INFO_BINNING_FACTOR = 983054, + ANDROID_SHADING_MODE = 1048576, + ANDROID_SHADING_STRENGTH = 1048577, + ANDROID_SHADING_AVAILABLE_MODES = 1048578, + ANDROID_STATISTICS_FACE_DETECT_MODE = 1114112, + ANDROID_STATISTICS_HISTOGRAM_MODE = 1114113, + ANDROID_STATISTICS_SHARPNESS_MAP_MODE = 1114114, + ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE = 1114115, + ANDROID_STATISTICS_FACE_IDS = 1114116, + ANDROID_STATISTICS_FACE_LANDMARKS = 1114117, + ANDROID_STATISTICS_FACE_RECTANGLES = 1114118, + ANDROID_STATISTICS_FACE_SCORES = 1114119, + ANDROID_STATISTICS_HISTOGRAM = 1114120, + ANDROID_STATISTICS_SHARPNESS_MAP = 1114121, + ANDROID_STATISTICS_LENS_SHADING_CORRECTION_MAP = 1114122, + ANDROID_STATISTICS_LENS_SHADING_MAP = 1114123, + ANDROID_STATISTICS_PREDICTED_COLOR_GAINS = 1114124, + ANDROID_STATISTICS_PREDICTED_COLOR_TRANSFORM = 1114125, + ANDROID_STATISTICS_SCENE_FLICKER = 1114126, + ANDROID_STATISTICS_HOT_PIXEL_MAP = 1114127, + ANDROID_STATISTICS_LENS_SHADING_MAP_MODE = 1114128, + ANDROID_STATISTICS_OIS_DATA_MODE = 1114129, + ANDROID_STATISTICS_OIS_TIMESTAMPS = 1114130, + ANDROID_STATISTICS_OIS_X_SHIFTS = 1114131, + ANDROID_STATISTICS_OIS_Y_SHIFTS = 1114132, + ANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES = 1179648, + ANDROID_STATISTICS_INFO_HISTOGRAM_BUCKET_COUNT = 1179649, + ANDROID_STATISTICS_INFO_MAX_FACE_COUNT = 1179650, + ANDROID_STATISTICS_INFO_MAX_HISTOGRAM_COUNT = 1179651, + ANDROID_STATISTICS_INFO_MAX_SHARPNESS_MAP_VALUE = 1179652, + ANDROID_STATISTICS_INFO_SHARPNESS_MAP_SIZE = 1179653, + ANDROID_STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES = 1179654, + ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES = 1179655, + ANDROID_STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES = 1179656, + ANDROID_TONEMAP_CURVE_BLUE = 1245184, + ANDROID_TONEMAP_CURVE_GREEN = 1245185, + ANDROID_TONEMAP_CURVE_RED = 1245186, + ANDROID_TONEMAP_MODE = 1245187, + ANDROID_TONEMAP_MAX_CURVE_POINTS = 1245188, + ANDROID_TONEMAP_AVAILABLE_TONE_MAP_MODES = 1245189, + ANDROID_TONEMAP_GAMMA = 1245190, + ANDROID_TONEMAP_PRESET_CURVE = 1245191, + ANDROID_LED_TRANSMIT = 1310720, + ANDROID_LED_AVAILABLE_LEDS = 1310721, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL = 1376256, + ANDROID_INFO_VERSION = 1376257, + ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION = 1376258, + ANDROID_INFO_DEVICE_STATE_ORIENTATIONS = 1376259, + ANDROID_BLACK_LEVEL_LOCK = 1441792, + ANDROID_SYNC_FRAME_NUMBER = 1507328, + ANDROID_SYNC_MAX_LATENCY = 1507329, + ANDROID_REPROCESS_EFFECTIVE_EXPOSURE_FACTOR = 1572864, + ANDROID_REPROCESS_MAX_CAPTURE_STALL = 1572865, + ANDROID_DEPTH_MAX_DEPTH_SAMPLES = 1638400, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS = 1638401, + ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS = 1638402, + ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS = 1638403, + ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE = 1638404, + ANDROID_DEPTH_AVAILABLE_RECOMMENDED_DEPTH_STREAM_CONFIGURATIONS = 1638405, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS = 1638406, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS = 1638407, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS = 1638408, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = 1638409, + ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION = 1638410, + ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS_MAXIMUM_RESOLUTION = 1638411, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = 1638412, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION = 1638413, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS_MAXIMUM_RESOLUTION = 1638414, + ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS = 1703936, + ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE = 1703937, + ANDROID_LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID = 1703938, + ANDROID_DISTORTION_CORRECTION_MODE = 1769472, + ANDROID_DISTORTION_CORRECTION_AVAILABLE_MODES = 1769473, + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS = 1835008, + ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS = 1835009, + ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS = 1835010, + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = 1835011, + ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION = 1835012, + ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS_MAXIMUM_RESOLUTION = 1835013, + ANDROID_HEIC_INFO_SUPPORTED = 1900544, + ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT = 1900545, + ANDROID_AUTOMOTIVE_LOCATION = 1966080, + ANDROID_AUTOMOTIVE_LENS_FACING = 2031616, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl new file mode 100644 index 0000000000..d04ffe3906 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ColorCorrectionAberrationMode.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. + *//* + * 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 -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 ColorCorrectionAberrationMode { + ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF = 0, + ANDROID_COLOR_CORRECTION_ABERRATION_MODE_FAST = 1, + ANDROID_COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ColorCorrectionMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ColorCorrectionMode.aidl new file mode 100644 index 0000000000..219c802bb8 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ColorCorrectionMode.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. + *//* + * 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 -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 ColorCorrectionMode { + ANDROID_COLOR_CORRECTION_MODE_TRANSFORM_MATRIX = 0, + ANDROID_COLOR_CORRECTION_MODE_FAST = 1, + ANDROID_COLOR_CORRECTION_MODE_HIGH_QUALITY = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl new file mode 100644 index 0000000000..84fd718c53 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeAntibandingMode.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. + *//* + * 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 -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 ControlAeAntibandingMode { + ANDROID_CONTROL_AE_ANTIBANDING_MODE_OFF = 0, + ANDROID_CONTROL_AE_ANTIBANDING_MODE_50HZ = 1, + ANDROID_CONTROL_AE_ANTIBANDING_MODE_60HZ = 2, + ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO = 3, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeLock.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeLock.aidl new file mode 100644 index 0000000000..f825f112a1 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeLock.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 -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 ControlAeLock { + ANDROID_CONTROL_AE_LOCK_OFF = 0, + ANDROID_CONTROL_AE_LOCK_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeLockAvailable.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeLockAvailable.aidl new file mode 100644 index 0000000000..df7924ed49 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeLockAvailable.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 -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 ControlAeLockAvailable { + ANDROID_CONTROL_AE_LOCK_AVAILABLE_FALSE = 0, + ANDROID_CONTROL_AE_LOCK_AVAILABLE_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeMode.aidl new file mode 100644 index 0000000000..75a3486b37 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeMode.aidl @@ -0,0 +1,47 @@ +/* + * 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 -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 ControlAeMode { + ANDROID_CONTROL_AE_MODE_OFF = 0, + ANDROID_CONTROL_AE_MODE_ON = 1, + ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH = 2, + ANDROID_CONTROL_AE_MODE_ON_ALWAYS_FLASH = 3, + ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE = 4, + ANDROID_CONTROL_AE_MODE_ON_EXTERNAL_FLASH = 5, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl new file mode 100644 index 0000000000..4678e01880 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAePrecaptureTrigger.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. + *//* + * 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 -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 ControlAePrecaptureTrigger { + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_IDLE = 0, + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_START = 1, + ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeState.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeState.aidl new file mode 100644 index 0000000000..3be64ea802 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAeState.aidl @@ -0,0 +1,47 @@ +/* + * 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 -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 ControlAeState { + ANDROID_CONTROL_AE_STATE_INACTIVE = 0, + ANDROID_CONTROL_AE_STATE_SEARCHING = 1, + ANDROID_CONTROL_AE_STATE_CONVERGED = 2, + ANDROID_CONTROL_AE_STATE_LOCKED = 3, + ANDROID_CONTROL_AE_STATE_FLASH_REQUIRED = 4, + ANDROID_CONTROL_AE_STATE_PRECAPTURE = 5, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfMode.aidl new file mode 100644 index 0000000000..155d3c9f92 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfMode.aidl @@ -0,0 +1,47 @@ +/* + * 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 -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 ControlAfMode { + ANDROID_CONTROL_AF_MODE_OFF = 0, + ANDROID_CONTROL_AF_MODE_AUTO = 1, + ANDROID_CONTROL_AF_MODE_MACRO = 2, + ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO = 3, + ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE = 4, + ANDROID_CONTROL_AF_MODE_EDOF = 5, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfSceneChange.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfSceneChange.aidl new file mode 100644 index 0000000000..4b31c84fb2 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfSceneChange.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 -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 ControlAfSceneChange { + ANDROID_CONTROL_AF_SCENE_CHANGE_NOT_DETECTED = 0, + ANDROID_CONTROL_AF_SCENE_CHANGE_DETECTED = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfState.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfState.aidl new file mode 100644 index 0000000000..4aac8c8a9d --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfState.aidl @@ -0,0 +1,48 @@ +/* + * 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 -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 ControlAfState { + ANDROID_CONTROL_AF_STATE_INACTIVE = 0, + ANDROID_CONTROL_AF_STATE_PASSIVE_SCAN = 1, + ANDROID_CONTROL_AF_STATE_PASSIVE_FOCUSED = 2, + ANDROID_CONTROL_AF_STATE_ACTIVE_SCAN = 3, + ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED = 4, + ANDROID_CONTROL_AF_STATE_NOT_FOCUSED_LOCKED = 5, + ANDROID_CONTROL_AF_STATE_PASSIVE_UNFOCUSED = 6, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfTrigger.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfTrigger.aidl new file mode 100644 index 0000000000..3fbf94b724 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAfTrigger.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. + *//* + * 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 -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 ControlAfTrigger { + ANDROID_CONTROL_AF_TRIGGER_IDLE = 0, + ANDROID_CONTROL_AF_TRIGGER_START = 1, + ANDROID_CONTROL_AF_TRIGGER_CANCEL = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbLock.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbLock.aidl new file mode 100644 index 0000000000..0e297a51a3 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbLock.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 -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 ControlAwbLock { + ANDROID_CONTROL_AWB_LOCK_OFF = 0, + ANDROID_CONTROL_AWB_LOCK_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl new file mode 100644 index 0000000000..d471d190bd --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbLockAvailable.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 -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 ControlAwbLockAvailable { + ANDROID_CONTROL_AWB_LOCK_AVAILABLE_FALSE = 0, + ANDROID_CONTROL_AWB_LOCK_AVAILABLE_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbMode.aidl new file mode 100644 index 0000000000..a3463f835f --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbMode.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. + *//* + * 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 -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 ControlAwbMode { + ANDROID_CONTROL_AWB_MODE_OFF = 0, + ANDROID_CONTROL_AWB_MODE_AUTO = 1, + ANDROID_CONTROL_AWB_MODE_INCANDESCENT = 2, + ANDROID_CONTROL_AWB_MODE_FLUORESCENT = 3, + ANDROID_CONTROL_AWB_MODE_WARM_FLUORESCENT = 4, + ANDROID_CONTROL_AWB_MODE_DAYLIGHT = 5, + ANDROID_CONTROL_AWB_MODE_CLOUDY_DAYLIGHT = 6, + ANDROID_CONTROL_AWB_MODE_TWILIGHT = 7, + ANDROID_CONTROL_AWB_MODE_SHADE = 8, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbState.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbState.aidl new file mode 100644 index 0000000000..f1b0e40d2b --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlAwbState.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. + *//* + * 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 -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 ControlAwbState { + ANDROID_CONTROL_AWB_STATE_INACTIVE = 0, + ANDROID_CONTROL_AWB_STATE_SEARCHING = 1, + ANDROID_CONTROL_AWB_STATE_CONVERGED = 2, + ANDROID_CONTROL_AWB_STATE_LOCKED = 3, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlCaptureIntent.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlCaptureIntent.aidl new file mode 100644 index 0000000000..283bb1be02 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlCaptureIntent.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. + *//* + * 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 -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 ControlCaptureIntent { + ANDROID_CONTROL_CAPTURE_INTENT_CUSTOM = 0, + ANDROID_CONTROL_CAPTURE_INTENT_PREVIEW = 1, + ANDROID_CONTROL_CAPTURE_INTENT_STILL_CAPTURE = 2, + ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_RECORD = 3, + ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4, + ANDROID_CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG = 5, + ANDROID_CONTROL_CAPTURE_INTENT_MANUAL = 6, + ANDROID_CONTROL_CAPTURE_INTENT_MOTION_TRACKING = 7, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlEffectMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlEffectMode.aidl new file mode 100644 index 0000000000..911223dcf3 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlEffectMode.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. + *//* + * 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 -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 ControlEffectMode { + ANDROID_CONTROL_EFFECT_MODE_OFF = 0, + ANDROID_CONTROL_EFFECT_MODE_MONO = 1, + ANDROID_CONTROL_EFFECT_MODE_NEGATIVE = 2, + ANDROID_CONTROL_EFFECT_MODE_SOLARIZE = 3, + ANDROID_CONTROL_EFFECT_MODE_SEPIA = 4, + ANDROID_CONTROL_EFFECT_MODE_POSTERIZE = 5, + ANDROID_CONTROL_EFFECT_MODE_WHITEBOARD = 6, + ANDROID_CONTROL_EFFECT_MODE_BLACKBOARD = 7, + ANDROID_CONTROL_EFFECT_MODE_AQUA = 8, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlEnableZsl.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlEnableZsl.aidl new file mode 100644 index 0000000000..920def7c20 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlEnableZsl.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 -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 ControlEnableZsl { + ANDROID_CONTROL_ENABLE_ZSL_FALSE = 0, + ANDROID_CONTROL_ENABLE_ZSL_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl new file mode 100644 index 0000000000..2655d6144a --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlExtendedSceneMode.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. + *//* + * 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 -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 ControlExtendedSceneMode { + ANDROID_CONTROL_EXTENDED_SCENE_MODE_DISABLED = 0, + ANDROID_CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE = 1, + ANDROID_CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS = 2, + ANDROID_CONTROL_EXTENDED_SCENE_MODE_VENDOR_START = 64, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlMode.aidl new file mode 100644 index 0000000000..f58491e536 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlMode.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 ControlMode { + ANDROID_CONTROL_MODE_OFF = 0, + ANDROID_CONTROL_MODE_AUTO = 1, + ANDROID_CONTROL_MODE_USE_SCENE_MODE = 2, + ANDROID_CONTROL_MODE_OFF_KEEP_STATE = 3, + ANDROID_CONTROL_MODE_USE_EXTENDED_SCENE_MODE = 4, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlSceneMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlSceneMode.aidl new file mode 100644 index 0000000000..994bbf3aa7 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlSceneMode.aidl @@ -0,0 +1,63 @@ +/* + * 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 -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 ControlSceneMode { + ANDROID_CONTROL_SCENE_MODE_DISABLED = 0, + ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY = 1, + ANDROID_CONTROL_SCENE_MODE_ACTION = 2, + ANDROID_CONTROL_SCENE_MODE_PORTRAIT = 3, + ANDROID_CONTROL_SCENE_MODE_LANDSCAPE = 4, + ANDROID_CONTROL_SCENE_MODE_NIGHT = 5, + ANDROID_CONTROL_SCENE_MODE_NIGHT_PORTRAIT = 6, + ANDROID_CONTROL_SCENE_MODE_THEATRE = 7, + ANDROID_CONTROL_SCENE_MODE_BEACH = 8, + ANDROID_CONTROL_SCENE_MODE_SNOW = 9, + ANDROID_CONTROL_SCENE_MODE_SUNSET = 10, + ANDROID_CONTROL_SCENE_MODE_STEADYPHOTO = 11, + ANDROID_CONTROL_SCENE_MODE_FIREWORKS = 12, + ANDROID_CONTROL_SCENE_MODE_SPORTS = 13, + ANDROID_CONTROL_SCENE_MODE_PARTY = 14, + ANDROID_CONTROL_SCENE_MODE_CANDLELIGHT = 15, + ANDROID_CONTROL_SCENE_MODE_BARCODE = 16, + ANDROID_CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO = 17, + ANDROID_CONTROL_SCENE_MODE_HDR = 18, + ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY_LOW_LIGHT = 19, + ANDROID_CONTROL_SCENE_MODE_DEVICE_CUSTOM_START = 100, + ANDROID_CONTROL_SCENE_MODE_DEVICE_CUSTOM_END = 127, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl new file mode 100644 index 0000000000..b3b24f750b --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ControlVideoStabilizationMode.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. + *//* + * 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 -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 ControlVideoStabilizationMode { + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF = 0, + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_ON = 1, + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DemosaicMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DemosaicMode.aidl new file mode 100644 index 0000000000..26874a2f85 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DemosaicMode.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 -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 DemosaicMode { + ANDROID_DEMOSAIC_MODE_FAST = 0, + ANDROID_DEMOSAIC_MODE_HIGH_QUALITY = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl new file mode 100644 index 0000000000..6a154ca0c9 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.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 -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 DepthAvailableDepthStreamConfigurations { + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT = 0, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl new file mode 100644 index 0000000000..23d6589a1c --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.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 -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 DepthAvailableDepthStreamConfigurationsMaximumResolution { + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT = 0, + ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl new file mode 100644 index 0000000000..f3ca03964f --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.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 -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 DepthAvailableDynamicDepthStreamConfigurations { + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_OUTPUT = 0, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl new file mode 100644 index 0000000000..46a4ce61e6 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.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 -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 DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution { + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT = 0, + ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl new file mode 100644 index 0000000000..f5fc218318 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DepthDepthIsExclusive.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 -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 DepthDepthIsExclusive { + ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE_FALSE = 0, + ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DistortionCorrectionMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DistortionCorrectionMode.aidl new file mode 100644 index 0000000000..46327e0bea --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/DistortionCorrectionMode.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. + *//* + * 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 -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 DistortionCorrectionMode { + ANDROID_DISTORTION_CORRECTION_MODE_OFF = 0, + ANDROID_DISTORTION_CORRECTION_MODE_FAST = 1, + ANDROID_DISTORTION_CORRECTION_MODE_HIGH_QUALITY = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/EdgeMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/EdgeMode.aidl new file mode 100644 index 0000000000..4b02e194bc --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/EdgeMode.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. + *//* + * 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 -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 EdgeMode { + ANDROID_EDGE_MODE_OFF = 0, + ANDROID_EDGE_MODE_FAST = 1, + ANDROID_EDGE_MODE_HIGH_QUALITY = 2, + ANDROID_EDGE_MODE_ZERO_SHUTTER_LAG = 3, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/FlashInfoAvailable.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/FlashInfoAvailable.aidl new file mode 100644 index 0000000000..10d07a5c96 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/FlashInfoAvailable.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 -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 FlashInfoAvailable { + ANDROID_FLASH_INFO_AVAILABLE_FALSE = 0, + ANDROID_FLASH_INFO_AVAILABLE_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/FlashMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/FlashMode.aidl new file mode 100644 index 0000000000..1ab056067e --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/FlashMode.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. + *//* + * 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 -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 FlashMode { + ANDROID_FLASH_MODE_OFF = 0, + ANDROID_FLASH_MODE_SINGLE = 1, + ANDROID_FLASH_MODE_TORCH = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/FlashState.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/FlashState.aidl new file mode 100644 index 0000000000..a571e6608d --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/FlashState.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 FlashState { + ANDROID_FLASH_STATE_UNAVAILABLE = 0, + ANDROID_FLASH_STATE_CHARGING = 1, + ANDROID_FLASH_STATE_READY = 2, + ANDROID_FLASH_STATE_FIRED = 3, + ANDROID_FLASH_STATE_PARTIAL = 4, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl new file mode 100644 index 0000000000..d92c2db86d --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.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 -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 HeicAvailableHeicStreamConfigurations { + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_OUTPUT = 0, + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl new file mode 100644 index 0000000000..f02cf588bf --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.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 -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 HeicAvailableHeicStreamConfigurationsMaximumResolution { + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT = 0, + ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HeicInfoSupported.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HeicInfoSupported.aidl new file mode 100644 index 0000000000..ae5a8e784e --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HeicInfoSupported.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 -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 HeicInfoSupported { + ANDROID_HEIC_INFO_SUPPORTED_FALSE = 0, + ANDROID_HEIC_INFO_SUPPORTED_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HotPixelMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HotPixelMode.aidl new file mode 100644 index 0000000000..1248c6040f --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/HotPixelMode.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. + *//* + * 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 -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 HotPixelMode { + ANDROID_HOT_PIXEL_MODE_OFF = 0, + ANDROID_HOT_PIXEL_MODE_FAST = 1, + ANDROID_HOT_PIXEL_MODE_HIGH_QUALITY = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl new file mode 100644 index 0000000000..1272f27944 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.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. + *//* + * 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 -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 InfoSupportedBufferManagementVersion { + ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_AIDL_DEVICE = 0, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl new file mode 100644 index 0000000000..8ae39b0984 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 InfoSupportedHardwareLevel { + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY = 2, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_3 = 3, + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL = 4, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LedAvailableLeds.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LedAvailableLeds.aidl new file mode 100644 index 0000000000..da558d2056 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LedAvailableLeds.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. + *//* + * 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 -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 LedAvailableLeds { + ANDROID_LED_AVAILABLE_LEDS_TRANSMIT = 0, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LedTransmit.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LedTransmit.aidl new file mode 100644 index 0000000000..658b3cd3b2 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LedTransmit.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 -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 LedTransmit { + ANDROID_LED_TRANSMIT_OFF = 0, + ANDROID_LED_TRANSMIT_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensFacing.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensFacing.aidl new file mode 100644 index 0000000000..4db987bc67 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensFacing.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. + *//* + * 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 -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 LensFacing { + ANDROID_LENS_FACING_FRONT = 0, + ANDROID_LENS_FACING_BACK = 1, + ANDROID_LENS_FACING_EXTERNAL = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl new file mode 100644 index 0000000000..d83d67f103 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.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. + *//* + * 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 -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 LensInfoFocusDistanceCalibration { + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED = 0, + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE = 1, + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl new file mode 100644 index 0000000000..f2f039c39a --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensOpticalStabilizationMode.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 -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 LensOpticalStabilizationMode { + ANDROID_LENS_OPTICAL_STABILIZATION_MODE_OFF = 0, + ANDROID_LENS_OPTICAL_STABILIZATION_MODE_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensPoseReference.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensPoseReference.aidl new file mode 100644 index 0000000000..b2d837a0ff --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensPoseReference.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. + *//* + * 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 -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 LensPoseReference { + ANDROID_LENS_POSE_REFERENCE_PRIMARY_CAMERA = 0, + ANDROID_LENS_POSE_REFERENCE_GYROSCOPE = 1, + ANDROID_LENS_POSE_REFERENCE_UNDEFINED = 2, + ANDROID_LENS_POSE_REFERENCE_AUTOMOTIVE = 3, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensState.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensState.aidl new file mode 100644 index 0000000000..4b15b0fe20 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LensState.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 -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 LensState { + ANDROID_LENS_STATE_STATIONARY = 0, + ANDROID_LENS_STATE_MOVING = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl new file mode 100644 index 0000000000..224a7fab64 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.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 -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 LogicalMultiCameraSensorSyncType { + ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE = 0, + ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/NoiseReductionMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/NoiseReductionMode.aidl new file mode 100644 index 0000000000..ed0ebc164a --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/NoiseReductionMode.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 NoiseReductionMode { + ANDROID_NOISE_REDUCTION_MODE_OFF = 0, + ANDROID_NOISE_REDUCTION_MODE_FAST = 1, + ANDROID_NOISE_REDUCTION_MODE_HIGH_QUALITY = 2, + ANDROID_NOISE_REDUCTION_MODE_MINIMAL = 3, + ANDROID_NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG = 4, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/QuirksPartialResult.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/QuirksPartialResult.aidl new file mode 100644 index 0000000000..d217fe8055 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/QuirksPartialResult.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 -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 QuirksPartialResult { + ANDROID_QUIRKS_PARTIAL_RESULT_FINAL = 0, + ANDROID_QUIRKS_PARTIAL_RESULT_PARTIAL = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl new file mode 100644 index 0000000000..8dc2aa2010 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestAvailableCapabilities.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. + *//* + * 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 -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 RequestAvailableCapabilities { + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE = 0, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 1, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW = 3, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING = 4, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS = 5, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE = 6, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING = 7, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT = 8, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO = 9, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING = 10, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA = 11, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME = 12, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA = 13, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA = 14, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_OFFLINE_PROCESSING = 15, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR = 16, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_REMOSAIC_REPROCESSING = 17, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT = 18, + ANDROID_REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE = 19, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl new file mode 100644 index 0000000000..16e38ba90f --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.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. + *//* + * 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 -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="long") @VintfStability +enum RequestAvailableDynamicRangeProfilesMap { + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD = 1, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10 = 2, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10 = 4, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS = 8, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF = 16, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO = 32, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM = 64, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO = 128, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF = 256, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO = 512, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM = 1024, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO = 2048, + ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_MAX = 4096, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestMetadataMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestMetadataMode.aidl new file mode 100644 index 0000000000..90fba00fe0 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestMetadataMode.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 -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 RequestMetadataMode { + ANDROID_REQUEST_METADATA_MODE_NONE = 0, + ANDROID_REQUEST_METADATA_MODE_FULL = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestType.aidl new file mode 100644 index 0000000000..4f38cfbb4d --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/RequestType.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 -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 RequestType { + ANDROID_REQUEST_TYPE_CAPTURE = 0, + ANDROID_REQUEST_TYPE_REPROCESS = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableFormats.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableFormats.aidl new file mode 100644 index 0000000000..41fd2c2340 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableFormats.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. + *//* + * 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 -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 ScalerAvailableFormats { + ANDROID_SCALER_AVAILABLE_FORMATS_RAW16 = 32, + ANDROID_SCALER_AVAILABLE_FORMATS_RAW_OPAQUE = 36, + ANDROID_SCALER_AVAILABLE_FORMATS_YV12 = 842094169, + ANDROID_SCALER_AVAILABLE_FORMATS_YCrCb_420_SP = 17, + ANDROID_SCALER_AVAILABLE_FORMATS_IMPLEMENTATION_DEFINED = 34, + ANDROID_SCALER_AVAILABLE_FORMATS_YCbCr_420_888 = 35, + ANDROID_SCALER_AVAILABLE_FORMATS_BLOB = 33, + ANDROID_SCALER_AVAILABLE_FORMATS_RAW10 = 37, + ANDROID_SCALER_AVAILABLE_FORMATS_RAW12 = 38, + ANDROID_SCALER_AVAILABLE_FORMATS_Y8 = 538982489, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl new file mode 100644 index 0000000000..85daa85849 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.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. + *//* + * 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 -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 ScalerAvailableRecommendedStreamConfigurations { + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PREVIEW = 0, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RECORD = 1, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VIDEO_SNAPSHOT = 2, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_SNAPSHOT = 3, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_ZSL = 4, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RAW = 5, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_LOW_LATENCY_SNAPSHOT = 6, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_10BIT_OUTPUT = 8, + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VENDOR_START = 24, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl new file mode 100644 index 0000000000..1515ad5552 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.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 -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 ScalerAvailableStreamConfigurations { + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT = 0, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl new file mode 100644 index 0000000000..b9c3374e90 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.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 -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 ScalerAvailableStreamConfigurationsMaximumResolution { + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT = 0, + ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl new file mode 100644 index 0000000000..bfa4f1ae8b --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl @@ -0,0 +1,48 @@ +/* + * 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 -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="long") @VintfStability +enum ScalerAvailableStreamUseCases { + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 1, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE = 2, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD = 3, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL = 4, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL = 5, + ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START = 65536, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerCroppingType.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerCroppingType.aidl new file mode 100644 index 0000000000..0487196937 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerCroppingType.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 -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 ScalerCroppingType { + ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY = 0, + ANDROID_SCALER_CROPPING_TYPE_FREEFORM = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl new file mode 100644 index 0000000000..711243f58c --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.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 -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 ScalerMultiResolutionStreamSupported { + ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED_FALSE = 0, + ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl new file mode 100644 index 0000000000..50bc09780e --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.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 -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 ScalerPhysicalCameraMultiResolutionStreamConfigurations { + ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS_OUTPUT = 0, + ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS_INPUT = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl new file mode 100644 index 0000000000..3b9c5b8ef9 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 ScalerRotateAndCrop { + ANDROID_SCALER_ROTATE_AND_CROP_NONE = 0, + ANDROID_SCALER_ROTATE_AND_CROP_90 = 1, + ANDROID_SCALER_ROTATE_AND_CROP_180 = 2, + ANDROID_SCALER_ROTATE_AND_CROP_270 = 3, + ANDROID_SCALER_ROTATE_AND_CROP_AUTO = 4, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl new file mode 100644 index 0000000000..3400233f0c --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl @@ -0,0 +1,48 @@ +/* + * 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 -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 SensorInfoColorFilterArrangement { + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB = 0, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG = 1, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG = 2, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR = 3, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB = 4, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO = 5, + ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR = 6, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl new file mode 100644 index 0000000000..c8faaee8bc --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorInfoLensShadingApplied.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 -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 SensorInfoLensShadingApplied { + ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED_FALSE = 0, + ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED_TRUE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl new file mode 100644 index 0000000000..2a4b3dd08b --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorInfoTimestampSource.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 -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 SensorInfoTimestampSource { + ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN = 0, + ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorPixelMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorPixelMode.aidl new file mode 100644 index 0000000000..e0214341cf --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorPixelMode.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 -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 SensorPixelMode { + ANDROID_SENSOR_PIXEL_MODE_DEFAULT = 0, + ANDROID_SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl new file mode 100644 index 0000000000..a1f0c5fed5 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorRawBinningFactorUsed.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 -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 SensorRawBinningFactorUsed { + ANDROID_SENSOR_RAW_BINNING_FACTOR_USED_TRUE = 0, + ANDROID_SENSOR_RAW_BINNING_FACTOR_USED_FALSE = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl new file mode 100644 index 0000000000..cd22d2e35d --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl @@ -0,0 +1,60 @@ +/* + * 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 -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 SensorReferenceIlluminant1 { + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT = 1, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT = 2, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN = 3, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FLASH = 4, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER = 9, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER = 10, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_SHADE = 11, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT = 12, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT = 13, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT = 14, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT = 15, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A = 17, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B = 18, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C = 19, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D55 = 20, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D65 = 21, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D75 = 22, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_D50 = 23, + ANDROID_SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN = 24, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorTestPatternMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorTestPatternMode.aidl new file mode 100644 index 0000000000..3f49b9a731 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SensorTestPatternMode.aidl @@ -0,0 +1,48 @@ +/* + * 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 -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 SensorTestPatternMode { + ANDROID_SENSOR_TEST_PATTERN_MODE_OFF = 0, + ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR = 1, + ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS = 2, + ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY = 3, + ANDROID_SENSOR_TEST_PATTERN_MODE_PN9 = 4, + ANDROID_SENSOR_TEST_PATTERN_MODE_BLACK = 5, + ANDROID_SENSOR_TEST_PATTERN_MODE_CUSTOM1 = 256, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ShadingMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ShadingMode.aidl new file mode 100644 index 0000000000..a2d2a320fc --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/ShadingMode.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. + *//* + * 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 -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 ShadingMode { + ANDROID_SHADING_MODE_OFF = 0, + ANDROID_SHADING_MODE_FAST = 1, + ANDROID_SHADING_MODE_HIGH_QUALITY = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl new file mode 100644 index 0000000000..1c65f990be --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsFaceDetectMode.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. + *//* + * 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 -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 StatisticsFaceDetectMode { + ANDROID_STATISTICS_FACE_DETECT_MODE_OFF = 0, + ANDROID_STATISTICS_FACE_DETECT_MODE_SIMPLE = 1, + ANDROID_STATISTICS_FACE_DETECT_MODE_FULL = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsHistogramMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsHistogramMode.aidl new file mode 100644 index 0000000000..39a013e32f --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsHistogramMode.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 -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 StatisticsHistogramMode { + ANDROID_STATISTICS_HISTOGRAM_MODE_OFF = 0, + ANDROID_STATISTICS_HISTOGRAM_MODE_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl new file mode 100644 index 0000000000..3a8c6c2a03 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsHotPixelMapMode.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 -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 StatisticsHotPixelMapMode { + ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE_OFF = 0, + ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl new file mode 100644 index 0000000000..cc280caca6 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsLensShadingMapMode.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 -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 StatisticsLensShadingMapMode { + ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF = 0, + ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsOisDataMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsOisDataMode.aidl new file mode 100644 index 0000000000..6607037cb9 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsOisDataMode.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 -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 StatisticsOisDataMode { + ANDROID_STATISTICS_OIS_DATA_MODE_OFF = 0, + ANDROID_STATISTICS_OIS_DATA_MODE_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl new file mode 100644 index 0000000000..bc286c36cd --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsSceneFlicker.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. + *//* + * 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 -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 StatisticsSceneFlicker { + ANDROID_STATISTICS_SCENE_FLICKER_NONE = 0, + ANDROID_STATISTICS_SCENE_FLICKER_50HZ = 1, + ANDROID_STATISTICS_SCENE_FLICKER_60HZ = 2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl new file mode 100644 index 0000000000..774a43a76d --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/StatisticsSharpnessMapMode.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 -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 StatisticsSharpnessMapMode { + ANDROID_STATISTICS_SHARPNESS_MAP_MODE_OFF = 0, + ANDROID_STATISTICS_SHARPNESS_MAP_MODE_ON = 1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SyncFrameNumber.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SyncFrameNumber.aidl new file mode 100644 index 0000000000..12ccbb9479 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SyncFrameNumber.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 -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 SyncFrameNumber { + ANDROID_SYNC_FRAME_NUMBER_CONVERGING = -1, + ANDROID_SYNC_FRAME_NUMBER_UNKNOWN = -2, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SyncMaxLatency.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SyncMaxLatency.aidl new file mode 100644 index 0000000000..e0116e7117 --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/SyncMaxLatency.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 -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 SyncMaxLatency { + ANDROID_SYNC_MAX_LATENCY_PER_FRAME_CONTROL = 0, + ANDROID_SYNC_MAX_LATENCY_UNKNOWN = -1, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/TonemapMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/TonemapMode.aidl new file mode 100644 index 0000000000..728b2987ee --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/TonemapMode.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 TonemapMode { + ANDROID_TONEMAP_MODE_CONTRAST_CURVE = 0, + ANDROID_TONEMAP_MODE_FAST = 1, + ANDROID_TONEMAP_MODE_HIGH_QUALITY = 2, + ANDROID_TONEMAP_MODE_GAMMA_VALUE = 3, + ANDROID_TONEMAP_MODE_PRESET_CURVE = 4, +} diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/TonemapPresetCurve.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/TonemapPresetCurve.aidl new file mode 100644 index 0000000000..fc2e39bc3e --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/1/android/hardware/camera/metadata/TonemapPresetCurve.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 -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 TonemapPresetCurve { + ANDROID_TONEMAP_PRESET_CURVE_SRGB = 0, + ANDROID_TONEMAP_PRESET_CURVE_REC709 = 1, +} diff --git a/camera/provider/aidl/Android.bp b/camera/provider/aidl/Android.bp index 6f1b7815b3..f082bce8b5 100644 --- a/camera/provider/aidl/Android.bp +++ b/camera/provider/aidl/Android.bp @@ -15,7 +15,7 @@ aidl_interface { ], imports: [ "android.hardware.camera.device", - "android.hardware.camera.common" + "android.hardware.camera.common", ], stability: "vintf", backend: { @@ -31,4 +31,14 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.camera.device-V1", + "android.hardware.camera.common-V1", + ], + }, + ], + } diff --git a/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/.hash b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/.hash new file mode 100644 index 0000000000..ccebb86948 --- /dev/null +++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/.hash @@ -0,0 +1 @@ +5904a53ea55472ca9b45b731cb148c65d1090ba5 diff --git a/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/CameraIdAndStreamCombination.aidl new file mode 100644 index 0000000000..df77c40a28 --- /dev/null +++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/CameraIdAndStreamCombination.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 -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.provider; +@VintfStability +parcelable CameraIdAndStreamCombination { + String cameraId; + android.hardware.camera.device.StreamConfiguration streamConfiguration; +} diff --git a/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/ConcurrentCameraIdCombination.aidl new file mode 100644 index 0000000000..334fb2c827 --- /dev/null +++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/ConcurrentCameraIdCombination.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 -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.provider; +@VintfStability +parcelable ConcurrentCameraIdCombination { + List combination; +} diff --git a/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/ICameraProvider.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/ICameraProvider.aidl new file mode 100644 index 0000000000..c15bdee62b --- /dev/null +++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/ICameraProvider.aidl @@ -0,0 +1,48 @@ +/* + * 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 -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.provider; +@VintfStability +interface ICameraProvider { + void setCallback(android.hardware.camera.provider.ICameraProviderCallback callback); + android.hardware.camera.common.VendorTagSection[] getVendorTags(); + String[] getCameraIdList(); + android.hardware.camera.device.ICameraDevice getCameraDeviceInterface(String cameraDeviceName); + void notifyDeviceStateChange(long deviceState); + android.hardware.camera.provider.ConcurrentCameraIdCombination[] getConcurrentCameraIds(); + boolean isConcurrentStreamCombinationSupported(in android.hardware.camera.provider.CameraIdAndStreamCombination[] configs); + const long DEVICE_STATE_NORMAL = 0; + const long DEVICE_STATE_BACK_COVERED = 1; + const long DEVICE_STATE_FRONT_COVERED = 2; + const long DEVICE_STATE_FOLDED = 4; +} diff --git a/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/ICameraProviderCallback.aidl b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/ICameraProviderCallback.aidl new file mode 100644 index 0000000000..d3c53f5bc2 --- /dev/null +++ b/camera/provider/aidl/aidl_api/android.hardware.camera.provider/1/android/hardware/camera/provider/ICameraProviderCallback.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 -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.provider; +@VintfStability +interface ICameraProviderCallback { + void cameraDeviceStatusChange(String cameraDeviceName, android.hardware.camera.common.CameraDeviceStatus newStatus); + void torchModeStatusChange(String cameraDeviceName, android.hardware.camera.common.TorchModeStatus newStatus); + void physicalCameraDeviceStatusChange(String cameraDeviceName, String physicalCameraDeviceName, android.hardware.camera.common.CameraDeviceStatus newStatus); +} diff --git a/gnss/aidl/Android.bp b/gnss/aidl/Android.bp index cc7c4e9183..9f9090c195 100644 --- a/gnss/aidl/Android.bp +++ b/gnss/aidl/Android.bp @@ -47,6 +47,11 @@ aidl_interface { version: "1", imports: [], }, + { + version: "2", + imports: [], + }, + ], } diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/.hash b/gnss/aidl/aidl_api/android.hardware.gnss/2/.hash new file mode 100644 index 0000000000..0e529bbd67 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/.hash @@ -0,0 +1 @@ +fc957f1d3d261d065ff5e5415f2d21caa79c310f diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/BlocklistedSource.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/BlocklistedSource.aidl new file mode 100644 index 0000000000..ccb2b281db --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/BlocklistedSource.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable BlocklistedSource { + android.hardware.gnss.GnssConstellationType constellation = android.hardware.gnss.GnssConstellationType.UNKNOWN; + int svid; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/CorrelationVector.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/CorrelationVector.aidl new file mode 100644 index 0000000000..b9590036db --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/CorrelationVector.aidl @@ -0,0 +1,42 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable CorrelationVector { + double frequencyOffsetMps; + double samplingWidthM; + double samplingStartM; + int[] magnitude; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/ElapsedRealtime.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/ElapsedRealtime.aidl new file mode 100644 index 0000000000..559ed2915f --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/ElapsedRealtime.aidl @@ -0,0 +1,43 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable ElapsedRealtime { + int flags; + long timestampNs; + double timeUncertaintyNs; + const int HAS_TIMESTAMP_NS = 1; + const int HAS_TIME_UNCERTAINTY_NS = 2; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssClock.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssClock.aidl new file mode 100644 index 0000000000..a8454ddfc0 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssClock.aidl @@ -0,0 +1,56 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable GnssClock { + int gnssClockFlags; + int leapSecond; + long timeNs; + double timeUncertaintyNs; + long fullBiasNs; + double biasNs; + double biasUncertaintyNs; + double driftNsps; + 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; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssConstellationType.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssConstellationType.aidl new file mode 100644 index 0000000000..fee2ef67c3 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssConstellationType.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@Backing(type="int") @VintfStability +enum GnssConstellationType { + UNKNOWN = 0, + GPS = 1, + SBAS = 2, + GLONASS = 3, + QZSS = 4, + BEIDOU = 5, + GALILEO = 6, + IRNSS = 7, +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssData.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssData.aidl new file mode 100644 index 0000000000..31426f0507 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssData.aidl @@ -0,0 +1,48 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable GnssData { + android.hardware.gnss.GnssMeasurement[] measurements; + android.hardware.gnss.GnssClock clock; + android.hardware.gnss.ElapsedRealtime elapsedRealtime; + android.hardware.gnss.GnssData.GnssAgc[] gnssAgcs = {}; + @VintfStability + parcelable GnssAgc { + double agcLevelDb; + android.hardware.gnss.GnssConstellationType constellation = android.hardware.gnss.GnssConstellationType.UNKNOWN; + long carrierFrequencyHz; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssLocation.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssLocation.aidl new file mode 100644 index 0000000000..ed9dcfa967 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssLocation.aidl @@ -0,0 +1,58 @@ +/* + * 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 -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.gnss; +/* @hide */ +@VintfStability +parcelable GnssLocation { + int gnssLocationFlags; + double latitudeDegrees; + double longitudeDegrees; + double altitudeMeters; + double speedMetersPerSec; + double bearingDegrees; + double horizontalAccuracyMeters; + double verticalAccuracyMeters; + double speedAccuracyMetersPerSecond; + 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; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssMeasurement.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssMeasurement.aidl new file mode 100644 index 0000000000..8a44887419 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssMeasurement.aidl @@ -0,0 +1,99 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable GnssMeasurement { + int flags; + int svid; + android.hardware.gnss.GnssSignalType signalType; + double timeOffsetNs; + int state; + long receivedSvTimeInNs; + long receivedSvTimeUncertaintyInNs; + double antennaCN0DbHz; + double basebandCN0DbHz; + double pseudorangeRateMps; + double pseudorangeRateUncertaintyMps; + int accumulatedDeltaRangeState; + double accumulatedDeltaRangeM; + double accumulatedDeltaRangeUncertaintyM; + long carrierCycles; + double carrierPhase; + double carrierPhaseUncertainty; + android.hardware.gnss.GnssMultipathIndicator multipathIndicator = android.hardware.gnss.GnssMultipathIndicator.UNKNOWN; + double snrDb; + double agcLevelDb; + double fullInterSignalBiasNs; + double fullInterSignalBiasUncertaintyNs; + double satelliteInterSignalBiasNs; + 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 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 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; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssMultipathIndicator.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssMultipathIndicator.aidl new file mode 100644 index 0000000000..62ade9c3e8 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssMultipathIndicator.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@Backing(type="int") @VintfStability +enum GnssMultipathIndicator { + UNKNOWN = 0, + PRESENT = 1, + NOT_PRESENT = 2, +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssPowerStats.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssPowerStats.aidl new file mode 100644 index 0000000000..c4a9e6179e --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssPowerStats.aidl @@ -0,0 +1,45 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable GnssPowerStats { + android.hardware.gnss.ElapsedRealtime elapsedRealtime; + double totalEnergyMilliJoule; + double singlebandTrackingModeEnergyMilliJoule; + double multibandTrackingModeEnergyMilliJoule; + double singlebandAcquisitionModeEnergyMilliJoule; + double multibandAcquisitionModeEnergyMilliJoule; + double[] otherModesEnergyMilliJoule; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssSignalType.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssSignalType.aidl new file mode 100644 index 0000000000..4a49547b49 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/GnssSignalType.aidl @@ -0,0 +1,57 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable GnssSignalType { + android.hardware.gnss.GnssConstellationType constellation = android.hardware.gnss.GnssConstellationType.UNKNOWN; + double carrierFrequencyHz; + @utf8InCpp String codeType; + const @utf8InCpp String CODE_TYPE_A = "A"; + 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_I = "I"; + const @utf8InCpp String CODE_TYPE_L = "L"; + const @utf8InCpp String CODE_TYPE_M = "M"; + const @utf8InCpp String CODE_TYPE_N = "N"; + const @utf8InCpp String CODE_TYPE_P = "P"; + const @utf8InCpp String CODE_TYPE_Q = "Q"; + const @utf8InCpp String CODE_TYPE_S = "S"; + const @utf8InCpp String CODE_TYPE_W = "W"; + const @utf8InCpp String CODE_TYPE_X = "X"; + const @utf8InCpp String CODE_TYPE_Y = "Y"; + const @utf8InCpp String CODE_TYPE_Z = "Z"; + const @utf8InCpp String CODE_TYPE_UNKNOWN = "UNKNOWN"; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnss.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnss.aidl new file mode 100644 index 0000000000..639539ad65 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnss.aidl @@ -0,0 +1,50 @@ +/* + * 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 -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.gnss; +/* @hide */ +@VintfStability +interface IAGnss { + void setCallback(in android.hardware.gnss.IAGnssCallback callback); + void dataConnClosed(); + void dataConnFailed(); + void setServer(in android.hardware.gnss.IAGnssCallback.AGnssType type, in @utf8InCpp String hostname, in int port); + void dataConnOpen(in long networkHandle, in @utf8InCpp String apn, in android.hardware.gnss.IAGnss.ApnIpType apnIpType); + @Backing(type="int") @VintfStability + enum ApnIpType { + INVALID = 0, + IPV4 = 1, + IPV6 = 2, + IPV4V6 = 3, + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnssCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnssCallback.aidl new file mode 100644 index 0000000000..b2da8d9583 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnssCallback.aidl @@ -0,0 +1,54 @@ +/* + * 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 -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.gnss; +/* @hide */ +@VintfStability +interface IAGnssCallback { + void agnssStatusCb(in android.hardware.gnss.IAGnssCallback.AGnssType type, in android.hardware.gnss.IAGnssCallback.AGnssStatusValue status); + @Backing(type="int") @VintfStability + enum AGnssType { + SUPL = 1, + C2K = 2, + SUPL_EIMS = 3, + SUPL_IMS = 4, + } + @Backing(type="int") @VintfStability + enum AGnssStatusValue { + REQUEST_AGNSS_DATA_CONN = 1, + RELEASE_AGNSS_DATA_CONN = 2, + AGNSS_DATA_CONNECTED = 3, + AGNSS_DATA_CONN_DONE = 4, + AGNSS_DATA_CONN_FAILED = 5, + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnssRil.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnssRil.aidl new file mode 100644 index 0000000000..8930752f7f --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnssRil.aidl @@ -0,0 +1,80 @@ +/* + * 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 -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.gnss; +/* @hide */ +@VintfStability +interface IAGnssRil { + void setCallback(in android.hardware.gnss.IAGnssRilCallback callback); + void setRefLocation(in android.hardware.gnss.IAGnssRil.AGnssRefLocation agnssReflocation); + void setSetId(in android.hardware.gnss.IAGnssRil.SetIdType type, in @utf8InCpp String setid); + void updateNetworkState(in android.hardware.gnss.IAGnssRil.NetworkAttributes attributes); + const int NETWORK_CAPABILITY_NOT_METERED = 1; + const int NETWORK_CAPABILITY_NOT_ROAMING = 2; + @Backing(type="int") @VintfStability + enum AGnssRefLocationType { + GSM_CELLID = 1, + UMTS_CELLID = 2, + LTE_CELLID = 4, + NR_CELLID = 8, + } + @Backing(type="int") @VintfStability + enum SetIdType { + NONE = 0, + IMSI = 1, + MSISDM = 2, + } + @VintfStability + parcelable AGnssRefLocationCellID { + android.hardware.gnss.IAGnssRil.AGnssRefLocationType type; + int mcc; + int mnc; + int lac; + long cid; + int tac; + int pcid; + int arfcn; + } + @VintfStability + parcelable AGnssRefLocation { + android.hardware.gnss.IAGnssRil.AGnssRefLocationType type; + android.hardware.gnss.IAGnssRil.AGnssRefLocationCellID cellID; + } + @VintfStability + parcelable NetworkAttributes { + long networkHandle; + boolean isConnected; + int capabilities; + @utf8InCpp String apn; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnssRilCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnssRilCallback.aidl new file mode 100644 index 0000000000..3717026622 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IAGnssRilCallback.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 -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.gnss; +/* @hide */ +@VintfStability +interface IAGnssRilCallback { + void requestSetIdCb(in int setIdflag); + void requestRefLocCb(); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnss.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnss.aidl new file mode 100644 index 0000000000..0e6405ea7c --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnss.aidl @@ -0,0 +1,103 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnss { + void setCallback(in android.hardware.gnss.IGnssCallback callback); + void close(); + @nullable android.hardware.gnss.IGnssPsds getExtensionPsds(); + android.hardware.gnss.IGnssConfiguration getExtensionGnssConfiguration(); + android.hardware.gnss.IGnssMeasurementInterface getExtensionGnssMeasurement(); + android.hardware.gnss.IGnssPowerIndication getExtensionGnssPowerIndication(); + @nullable android.hardware.gnss.IGnssBatching getExtensionGnssBatching(); + @nullable android.hardware.gnss.IGnssGeofence getExtensionGnssGeofence(); + @nullable android.hardware.gnss.IGnssNavigationMessageInterface getExtensionGnssNavigationMessage(); + android.hardware.gnss.IAGnss getExtensionAGnss(); + android.hardware.gnss.IAGnssRil getExtensionAGnssRil(); + android.hardware.gnss.IGnssDebug getExtensionGnssDebug(); + android.hardware.gnss.visibility_control.IGnssVisibilityControl getExtensionGnssVisibilityControl(); + void start(); + void stop(); + void injectTime(in long timeMs, in long timeReferenceMs, in int uncertaintyMs); + void injectLocation(in android.hardware.gnss.GnssLocation location); + void injectBestLocation(in android.hardware.gnss.GnssLocation location); + void deleteAidingData(in android.hardware.gnss.IGnss.GnssAidingData aidingDataFlags); + void setPositionMode(in android.hardware.gnss.IGnss.PositionModeOptions options); + android.hardware.gnss.IGnssAntennaInfo getExtensionGnssAntennaInfo(); + @nullable android.hardware.gnss.measurement_corrections.IMeasurementCorrectionsInterface getExtensionMeasurementCorrections(); + void startSvStatus(); + void stopSvStatus(); + void startNmea(); + void stopNmea(); + const int ERROR_INVALID_ARGUMENT = 1; + const int ERROR_ALREADY_INIT = 2; + const int ERROR_GENERIC = 3; + @Backing(type="int") @VintfStability + enum GnssPositionMode { + STANDALONE = 0, + MS_BASED = 1, + MS_ASSISTED = 2, + } + @Backing(type="int") @VintfStability + enum GnssPositionRecurrence { + RECURRENCE_PERIODIC = 0, + RECURRENCE_SINGLE = 1, + } + @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, + } + @VintfStability + parcelable PositionModeOptions { + android.hardware.gnss.IGnss.GnssPositionMode mode; + android.hardware.gnss.IGnss.GnssPositionRecurrence recurrence; + int minIntervalMs; + int preferredAccuracyMeters; + int preferredTimeMs; + boolean lowPowerMode; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssAntennaInfo.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssAntennaInfo.aidl new file mode 100644 index 0000000000..43ad328e5c --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssAntennaInfo.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 -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.gnss; +/* @hide */ +@VintfStability +interface IGnssAntennaInfo { + void setCallback(in android.hardware.gnss.IGnssAntennaInfoCallback callback); + void close(); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssAntennaInfoCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssAntennaInfoCallback.aidl new file mode 100644 index 0000000000..eb6abe55f8 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssAntennaInfoCallback.aidl @@ -0,0 +1,61 @@ +/* + * 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 -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.gnss; +/* @hide */ +@VintfStability +interface IGnssAntennaInfoCallback { + void gnssAntennaInfoCb(in android.hardware.gnss.IGnssAntennaInfoCallback.GnssAntennaInfo[] gnssAntennaInfos); + @VintfStability + parcelable Row { + double[] row; + } + @VintfStability + parcelable Coord { + double x; + double xUncertainty; + double y; + double yUncertainty; + double z; + double zUncertainty; + } + @VintfStability + parcelable GnssAntennaInfo { + long carrierFrequencyHz; + android.hardware.gnss.IGnssAntennaInfoCallback.Coord phaseCenterOffsetCoordinateMillimeters; + android.hardware.gnss.IGnssAntennaInfoCallback.Row[] phaseCenterVariationCorrectionMillimeters; + android.hardware.gnss.IGnssAntennaInfoCallback.Row[] phaseCenterVariationCorrectionUncertaintyMillimeters; + android.hardware.gnss.IGnssAntennaInfoCallback.Row[] signalGainCorrectionDbi; + android.hardware.gnss.IGnssAntennaInfoCallback.Row[] signalGainCorrectionUncertaintyDbi; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssBatching.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssBatching.aidl new file mode 100644 index 0000000000..d82aa1fe07 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssBatching.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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.gnss; +/* @hide */ +@VintfStability +interface IGnssBatching { + void init(in android.hardware.gnss.IGnssBatchingCallback callback); + int getBatchSize(); + void start(in android.hardware.gnss.IGnssBatching.Options options); + void flush(); + void stop(); + void cleanup(); + const int WAKEUP_ON_FIFO_FULL = 1; + @VintfStability + parcelable Options { + long periodNanos; + float minDistanceMeters; + int flags; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssBatchingCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssBatchingCallback.aidl new file mode 100644 index 0000000000..b12a8bd519 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssBatchingCallback.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 -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.gnss; +/* @hide */ +@VintfStability +interface IGnssBatchingCallback { + void gnssLocationBatchCb(in android.hardware.gnss.GnssLocation[] locations); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssCallback.aidl new file mode 100644 index 0000000000..48c88f5ffe --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssCallback.aidl @@ -0,0 +1,95 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssCallback { + void gnssSetCapabilitiesCb(in int capabilities); + void gnssStatusCb(in android.hardware.gnss.IGnssCallback.GnssStatusValue status); + void gnssSvStatusCb(in android.hardware.gnss.IGnssCallback.GnssSvInfo[] svInfoList); + void gnssLocationCb(in android.hardware.gnss.GnssLocation location); + void gnssNmeaCb(in long timestamp, in @utf8InCpp String nmea); + void gnssAcquireWakelockCb(); + void gnssReleaseWakelockCb(); + void gnssSetSystemInfoCb(in android.hardware.gnss.IGnssCallback.GnssSystemInfo info); + void gnssRequestTimeCb(); + void gnssRequestLocationCb(in boolean independentFromGnss, in boolean isUserEmergency); + 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; + @Backing(type="int") @VintfStability + enum GnssStatusValue { + NONE = 0, + SESSION_BEGIN = 1, + SESSION_END = 2, + ENGINE_ON = 3, + ENGINE_OFF = 4, + } + @Backing(type="int") @VintfStability + enum GnssSvFlags { + NONE = 0, + HAS_EPHEMERIS_DATA = 1, + HAS_ALMANAC_DATA = 2, + USED_IN_FIX = 4, + HAS_CARRIER_FREQUENCY = 8, + } + @VintfStability + parcelable GnssSvInfo { + int svid; + android.hardware.gnss.GnssConstellationType constellation; + float cN0Dbhz; + float basebandCN0DbHz; + float elevationDegrees; + float azimuthDegrees; + long carrierFrequencyHz; + int svFlag; + } + @VintfStability + parcelable GnssSystemInfo { + int yearOfHw; + @utf8InCpp String name; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssConfiguration.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssConfiguration.aidl new file mode 100644 index 0000000000..1d6399e52b --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssConfiguration.aidl @@ -0,0 +1,52 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssConfiguration { + void setSuplVersion(in int version); + void setSuplMode(in int mode); + void setLppProfile(in int lppProfile); + void setGlonassPositioningProtocol(in int protocol); + 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; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssDebug.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssDebug.aidl new file mode 100644 index 0000000000..591b53301f --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssDebug.aidl @@ -0,0 +1,88 @@ +/* + * 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 -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.gnss; +/* @hide */ +@VintfStability +interface IGnssDebug { + android.hardware.gnss.IGnssDebug.DebugData getDebugData(); + @Backing(type="int") @VintfStability + enum SatelliteEphemerisType { + EPHEMERIS = 0, + ALMANAC_ONLY = 1, + NOT_AVAILABLE = 2, + } + @Backing(type="int") @VintfStability + enum SatelliteEphemerisHealth { + GOOD = 0, + BAD = 1, + UNKNOWN = 2, + } + @VintfStability + parcelable TimeDebug { + long timeEstimateMs; + float timeUncertaintyNs; + float frequencyUncertaintyNsPerSec; + } + @VintfStability + parcelable PositionDebug { + boolean valid; + double latitudeDegrees; + double longitudeDegrees; + float altitudeMeters; + float speedMetersPerSec; + float bearingDegrees; + double horizontalAccuracyMeters; + double verticalAccuracyMeters; + double speedAccuracyMetersPerSecond; + double bearingAccuracyDegrees; + float ageSeconds; + } + @VintfStability + parcelable SatelliteData { + int svid; + android.hardware.gnss.GnssConstellationType constellation; + android.hardware.gnss.IGnssDebug.SatelliteEphemerisType ephemerisType; + android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource ephemerisSource; + android.hardware.gnss.IGnssDebug.SatelliteEphemerisHealth ephemerisHealth; + float ephemerisAgeSeconds; + boolean serverPredictionIsAvailable; + float serverPredictionAgeSeconds; + } + @VintfStability + parcelable DebugData { + android.hardware.gnss.IGnssDebug.PositionDebug position; + android.hardware.gnss.IGnssDebug.TimeDebug time; + List satelliteDataArray; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssGeofence.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssGeofence.aidl new file mode 100644 index 0000000000..5065ad49c8 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssGeofence.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 -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.gnss; +/* @hide */ +@VintfStability +interface IGnssGeofence { + void setCallback(in android.hardware.gnss.IGnssGeofenceCallback callback); + void addGeofence(in int geofenceId, in double latitudeDegrees, in double longitudeDegrees, in double radiusMeters, in int lastTransition, in int monitorTransitions, in int notificationResponsivenessMs, in int unknownTimerMs); + void pauseGeofence(in int geofenceId); + void resumeGeofence(in int geofenceId, in int monitorTransitions); + void removeGeofence(in int geofenceId); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssGeofenceCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssGeofenceCallback.aidl new file mode 100644 index 0000000000..df5dc2d919 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssGeofenceCallback.aidl @@ -0,0 +1,55 @@ +/* + * 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 -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.gnss; +/* @hide */ +@VintfStability +interface IGnssGeofenceCallback { + void gnssGeofenceTransitionCb(in int geofenceId, in android.hardware.gnss.GnssLocation location, in int transition, in long timestampMillis); + void gnssGeofenceStatusCb(in int availability, in android.hardware.gnss.GnssLocation lastLocation); + void gnssGeofenceAddCb(in int geofenceId, in int status); + 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 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; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssMeasurementCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssMeasurementCallback.aidl new file mode 100644 index 0000000000..624a7ae84d --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssMeasurementCallback.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssMeasurementCallback { + void gnssMeasurementCb(in android.hardware.gnss.GnssData data); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssMeasurementInterface.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssMeasurementInterface.aidl new file mode 100644 index 0000000000..6fe6a6c6fd --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssMeasurementInterface.aidl @@ -0,0 +1,47 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssMeasurementInterface { + void setCallback(in android.hardware.gnss.IGnssMeasurementCallback callback, in boolean enableFullTracking, in boolean enableCorrVecOutputs); + void close(); + void setCallbackWithOptions(in android.hardware.gnss.IGnssMeasurementCallback callback, in android.hardware.gnss.IGnssMeasurementInterface.Options options); + @VintfStability + parcelable Options { + boolean enableFullTracking; + boolean enableCorrVecOutputs; + int intervalMs; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssNavigationMessageCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssNavigationMessageCallback.aidl new file mode 100644 index 0000000000..c65cff21be --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssNavigationMessageCallback.aidl @@ -0,0 +1,69 @@ +/* + * 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 -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.gnss; +/* @hide */ +@VintfStability +interface IGnssNavigationMessageCallback { + void gnssNavigationMessageCb(in android.hardware.gnss.IGnssNavigationMessageCallback.GnssNavigationMessage message); + @VintfStability + parcelable GnssNavigationMessage { + int svid; + android.hardware.gnss.IGnssNavigationMessageCallback.GnssNavigationMessage.GnssNavigationMessageType type; + int status; + int messageId; + int submessageId; + byte[] data; + const int STATUS_PARITY_PASSED = 1; + const int STATUS_PARITY_REBUILT = 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, + } + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssNavigationMessageInterface.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssNavigationMessageInterface.aidl new file mode 100644 index 0000000000..187773dd81 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssNavigationMessageInterface.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 -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.gnss; +/* @hide */ +@VintfStability +interface IGnssNavigationMessageInterface { + void setCallback(in android.hardware.gnss.IGnssNavigationMessageCallback callback); + void close(); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPowerIndication.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPowerIndication.aidl new file mode 100644 index 0000000000..f77dbfff86 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPowerIndication.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssPowerIndication { + void setCallback(in android.hardware.gnss.IGnssPowerIndicationCallback callback); + oneway void requestGnssPowerStats(); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPowerIndicationCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPowerIndicationCallback.aidl new file mode 100644 index 0000000000..d35c77fdf1 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPowerIndicationCallback.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +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; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPsds.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPsds.aidl new file mode 100644 index 0000000000..3aee798b33 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPsds.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssPsds { + void injectPsdsData(in android.hardware.gnss.PsdsType psdsType, in byte[] psdsData); + void setCallback(in android.hardware.gnss.IGnssPsdsCallback callback); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPsdsCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPsdsCallback.aidl new file mode 100644 index 0000000000..dadc9fb092 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/IGnssPsdsCallback.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +interface IGnssPsdsCallback { + void downloadRequestCb(in android.hardware.gnss.PsdsType psdsType); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/PsdsType.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/PsdsType.aidl new file mode 100644 index 0000000000..60b15d63eb --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/PsdsType.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@Backing(type="int") @VintfStability +enum PsdsType { + LONG_TERM = 1, + NORMAL = 2, + REALTIME = 3, +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatelliteClockInfo.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatelliteClockInfo.aidl new file mode 100644 index 0000000000..05f7733280 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatelliteClockInfo.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable SatelliteClockInfo { + double satHardwareCodeBiasMeters; + double satTimeCorrectionMeters; + double satClkDriftMps; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatellitePositionEcef.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatellitePositionEcef.aidl new file mode 100644 index 0000000000..3d4f7ff6e2 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatellitePositionEcef.aidl @@ -0,0 +1,42 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable SatellitePositionEcef { + double posXMeters; + double posYMeters; + double posZMeters; + double ureMeters; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatellitePvt.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatellitePvt.aidl new file mode 100644 index 0000000000..5fd411fa84 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatellitePvt.aidl @@ -0,0 +1,59 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable SatellitePvt { + int flags; + android.hardware.gnss.SatellitePositionEcef satPosEcef; + android.hardware.gnss.SatelliteVelocityEcef satVelEcef; + android.hardware.gnss.SatelliteClockInfo satClockInfo; + double ionoDelayMeters; + double tropoDelayMeters; + long timeOfClockSeconds; + int issueOfDataClock; + 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; + @Backing(type="int") @VintfStability + enum SatelliteEphemerisSource { + DEMODULATED = 0, + SERVER_NORMAL = 1, + SERVER_LONG_TERM = 2, + OTHER = 3, + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatelliteVelocityEcef.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatelliteVelocityEcef.aidl new file mode 100644 index 0000000000..94d0b344b7 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/SatelliteVelocityEcef.aidl @@ -0,0 +1,42 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.gnss; +/* @hide */ +@VintfStability +parcelable SatelliteVelocityEcef { + double velXMps; + double velYMps; + double velZMps; + double ureRateMps; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl new file mode 100644 index 0000000000..4126702a2d --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.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 -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.gnss.measurement_corrections; +/* @hide */ +@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; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.aidl new file mode 100644 index 0000000000..bd305345f6 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.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 -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.gnss.measurement_corrections; +/* @hide */ +@VintfStability +interface IMeasurementCorrectionsInterface { + void setCorrections(in android.hardware.gnss.measurement_corrections.MeasurementCorrections corrections); + void setCallback(in android.hardware.gnss.measurement_corrections.IMeasurementCorrectionsCallback callback); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/MeasurementCorrections.aidl new file mode 100644 index 0000000000..35fd79e57e --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/MeasurementCorrections.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 -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.gnss.measurement_corrections; +/* @hide */ +@VintfStability +parcelable MeasurementCorrections { + double latitudeDegrees; + double longitudeDegrees; + double altitudeMeters; + double horizontalPositionUncertaintyMeters; + double verticalPositionUncertaintyMeters; + long toaGpsNanosecondsOfWeek; + android.hardware.gnss.measurement_corrections.SingleSatCorrection[] satCorrections; + boolean hasEnvironmentBearing; + float environmentBearingDegrees; + float environmentBearingUncertaintyDegrees; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/ReflectingPlane.aidl new file mode 100644 index 0000000000..90c9e03336 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/ReflectingPlane.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 -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.gnss.measurement_corrections; +/* @hide */ +@VintfStability +parcelable ReflectingPlane { + double latitudeDegrees; + double longitudeDegrees; + double altitudeMeters; + double reflectingPlaneAzimuthDegrees; +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl new file mode 100644 index 0000000000..ebbe6846e9 --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/measurement_corrections/SingleSatCorrection.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 -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.gnss.measurement_corrections; +/* @hide */ +@VintfStability +parcelable SingleSatCorrection { + int singleSatCorrectionFlags; + android.hardware.gnss.GnssConstellationType constellation; + int svid; + long carrierFrequencyHz; + float probSatIsLos; + float combinedExcessPathLengthMeters; + 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; + @VintfStability + parcelable ExcessPathInfo { + int excessPathInfoFlags; + float excessPathLengthMeters; + 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; + } +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl new file mode 100644 index 0000000000..d7a7a9651f --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/visibility_control/IGnssVisibilityControl.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 -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.gnss.visibility_control; +/* @hide */ +@VintfStability +interface IGnssVisibilityControl { + void enableNfwLocationAccess(in @utf8InCpp String[] proxyApps); + void setCallback(in android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback callback); +} diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl new file mode 100644 index 0000000000..c9b96f50bb --- /dev/null +++ b/gnss/aidl/aidl_api/android.hardware.gnss/2/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl @@ -0,0 +1,75 @@ +/* + * 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 -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.gnss.visibility_control; +/* @hide */ +@VintfStability +interface IGnssVisibilityControlCallback { + void nfwNotifyCb(in android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwNotification notification); + boolean isInEmergencySession(); + @Backing(type="int") @VintfStability + enum NfwProtocolStack { + CTRL_PLANE = 0, + SUPL = 1, + IMS = 10, + SIM = 11, + OTHER_PROTOCOL_STACK = 100, + } + @Backing(type="int") @VintfStability + enum NfwRequestor { + CARRIER = 0, + OEM = 10, + MODEM_CHIPSET_VENDOR = 11, + GNSS_CHIPSET_VENDOR = 12, + OTHER_CHIPSET_VENDOR = 13, + AUTOMOBILE_CLIENT = 20, + OTHER_REQUESTOR = 100, + } + @Backing(type="int") @VintfStability + enum NfwResponseType { + REJECTED = 0, + ACCEPTED_NO_LOCATION_PROVIDED = 1, + ACCEPTED_LOCATION_PROVIDED = 2, + } + @VintfStability + parcelable NfwNotification { + String proxyAppPackageName; + android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwProtocolStack protocolStack; + String otherProtocolStackName; + android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwRequestor requestor; + String requestorId; + android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwResponseType responseType; + boolean inEmergencyMode; + boolean isCachedLocation; + } +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/.hash b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/.hash new file mode 100644 index 0000000000..dfda68f42d --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/.hash @@ -0,0 +1 @@ +e7e8b0bd7cd27ab4f1998700ef19ebc82e022d87 diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/AlphaInterpretation.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/AlphaInterpretation.aidl new file mode 100644 index 0000000000..ea60283fe1 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/AlphaInterpretation.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 -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; +/* @hide */ +@Backing(type="int") @VintfStability +enum AlphaInterpretation { + COVERAGE = 0, + MASK = 1, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/BlendMode.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/BlendMode.aidl new file mode 100644 index 0000000000..d1f61beee8 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/BlendMode.aidl @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum BlendMode { + INVALID = 0, + NONE = 1, + PREMULTIPLIED = 2, + COVERAGE = 3, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/BufferUsage.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/BufferUsage.aidl new file mode 100644 index 0000000000..d3ab44f2ce --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/BufferUsage.aidl @@ -0,0 +1,65 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="long") @VintfStability +enum BufferUsage { + CPU_READ_MASK = 15, + 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, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/ChromaSiting.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/ChromaSiting.aidl new file mode 100644 index 0000000000..b8af644604 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/ChromaSiting.aidl @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="long") @VintfStability +enum ChromaSiting { + NONE = 0, + UNKNOWN = 1, + SITED_INTERSTITIAL = 2, + COSITED_HORIZONTAL = 3, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/ColorTransform.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/ColorTransform.aidl new file mode 100644 index 0000000000..f74859b788 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/ColorTransform.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 -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; +/* @hide */ +@Backing(type="int") @VintfStability +enum ColorTransform { + IDENTITY = 0, + ARBITRARY_MATRIX = 1, + VALUE_INVERSE = 2, + GRAYSCALE = 3, + CORRECT_PROTANOPIA = 4, + CORRECT_DEUTERANOPIA = 5, + CORRECT_TRITANOPIA = 6, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Compression.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Compression.aidl new file mode 100644 index 0000000000..4f155e19a9 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Compression.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="long") @VintfStability +enum Compression { + NONE = 0, + DISPLAY_STREAM_COMPRESSION = 1, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Cta861_3.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Cta861_3.aidl new file mode 100644 index 0000000000..ec90c9c64f --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Cta861_3.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable Cta861_3 { + float maxContentLightLevel; + float maxFrameAverageLightLevel; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Dataspace.aidl new file mode 100644 index 0000000000..668b033174 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Dataspace.aidl @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum Dataspace { + UNKNOWN = 0, + ARBITRARY = 1, + 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, + 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, + 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, + BT709_FULL_RANGE = 146866176, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/DisplayDecorationSupport.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/DisplayDecorationSupport.aidl new file mode 100644 index 0000000000..27eff76432 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/DisplayDecorationSupport.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 -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; +/* @hide */ +@VintfStability +parcelable DisplayDecorationSupport { + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.AlphaInterpretation alphaInterpretation; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/ExtendableType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/ExtendableType.aidl new file mode 100644 index 0000000000..5ff17752f7 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/ExtendableType.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable ExtendableType { + @utf8InCpp String name; + long value = 0; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/FRect.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/FRect.aidl new file mode 100644 index 0000000000..7972e111e2 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/FRect.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 -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; +/* @hide */ +@VintfStability +parcelable FRect { + float left; + float top; + float right; + float bottom; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/HardwareBuffer.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/HardwareBuffer.aidl new file mode 100644 index 0000000000..1817769af2 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/HardwareBuffer.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable HardwareBuffer { + android.hardware.graphics.common.HardwareBufferDescription description; + android.hardware.common.NativeHandle handle; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/HardwareBufferDescription.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/HardwareBufferDescription.aidl new file mode 100644 index 0000000000..70f46a1e6c --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/HardwareBufferDescription.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable HardwareBufferDescription { + int width; + int height; + int layers; + android.hardware.graphics.common.PixelFormat format = android.hardware.graphics.common.PixelFormat.UNSPECIFIED; + android.hardware.graphics.common.BufferUsage usage = android.hardware.graphics.common.BufferUsage.CPU_READ_NEVER; + int stride; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Hdr.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Hdr.aidl new file mode 100644 index 0000000000..7bae45e949 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Hdr.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 -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; +/* @hide */ +@Backing(type="int") @VintfStability +enum Hdr { + DOLBY_VISION = 1, + HDR10 = 2, + HLG = 3, + HDR10_PLUS = 4, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Interlaced.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Interlaced.aidl new file mode 100644 index 0000000000..e04d2ab2bd --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Interlaced.aidl @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="long") @VintfStability +enum Interlaced { + NONE = 0, + TOP_BOTTOM = 1, + RIGHT_LEFT = 2, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PixelFormat.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PixelFormat.aidl new file mode 100644 index 0000000000..59d6468d54 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PixelFormat.aidl @@ -0,0 +1,68 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@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, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PlaneLayout.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PlaneLayout.aidl new file mode 100644 index 0000000000..a09097511b --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PlaneLayout.aidl @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable PlaneLayout { + android.hardware.graphics.common.PlaneLayoutComponent[] components; + long offsetInBytes; + long sampleIncrementInBits; + long strideInBytes; + long widthInSamples; + long heightInSamples; + long totalSizeInBytes; + long horizontalSubsampling; + long verticalSubsampling; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PlaneLayoutComponent.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PlaneLayoutComponent.aidl new file mode 100644 index 0000000000..0768240bf5 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PlaneLayoutComponent.aidl @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable PlaneLayoutComponent { + android.hardware.graphics.common.ExtendableType type; + long offsetInBits; + long sizeInBits; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PlaneLayoutComponentType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PlaneLayoutComponentType.aidl new file mode 100644 index 0000000000..8ba93811a4 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/PlaneLayoutComponentType.aidl @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="long") @VintfStability +enum PlaneLayoutComponentType { + Y = 1, + CB = 2, + CR = 4, + R = 1024, + G = 2048, + B = 4096, + RAW = 1048576, + A = 1073741824, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Point.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Point.aidl new file mode 100644 index 0000000000..af4705a1e4 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Point.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 -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; +/* @hide */ +@VintfStability +parcelable Point { + int x; + int y; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Rect.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Rect.aidl new file mode 100644 index 0000000000..463a68f973 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Rect.aidl @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable Rect { + int left; + int top; + int right; + int bottom; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Smpte2086.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Smpte2086.aidl new file mode 100644 index 0000000000..dce9226c09 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Smpte2086.aidl @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable Smpte2086 { + android.hardware.graphics.common.XyColor primaryRed; + android.hardware.graphics.common.XyColor primaryGreen; + android.hardware.graphics.common.XyColor primaryBlue; + android.hardware.graphics.common.XyColor whitePoint; + float maxLuminance; + float minLuminance; +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/StandardMetadataType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/StandardMetadataType.aidl new file mode 100644 index 0000000000..06b31a2036 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/StandardMetadataType.aidl @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2019,libgralloctypes_helper The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@Backing(type="long") @VintfStability +enum StandardMetadataType { + INVALID = 0, + BUFFER_ID = 1, + NAME = 2, + WIDTH = 3, + HEIGHT = 4, + LAYER_COUNT = 5, + PIXEL_FORMAT_REQUESTED = 6, + PIXEL_FORMAT_FOURCC = 7, + PIXEL_FORMAT_MODIFIER = 8, + USAGE = 9, + ALLOCATION_SIZE = 10, + PROTECTED_CONTENT = 11, + COMPRESSION = 12, + INTERLACED = 13, + CHROMA_SITING = 14, + PLANE_LAYOUTS = 15, + CROP = 16, + DATASPACE = 17, + BLEND_MODE = 18, + SMPTE2086 = 19, + CTA861_3 = 20, + SMPTE2094_40 = 21, + SMPTE2094_10 = 22, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Transform.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Transform.aidl new file mode 100644 index 0000000000..986d089027 --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/Transform.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 -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; +/* @hide */ +@Backing(type="int") @VintfStability +enum Transform { + NONE = 0, + FLIP_H = 1, + FLIP_V = 2, + ROT_90 = 4, + ROT_180 = 3, + ROT_270 = 7, +} diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/XyColor.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/XyColor.aidl new file mode 100644 index 0000000000..e300f25dad --- /dev/null +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/3/android/hardware/graphics/common/XyColor.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2019, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.common; +/* @hide */ +@VintfStability +parcelable XyColor { + float x; + float y; +} diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp index 2532a7a740..9b88d98f9c 100644 --- a/graphics/composer/aidl/Android.bp +++ b/graphics/composer/aidl/Android.bp @@ -53,6 +53,16 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.graphics.common-V3", + "android.hardware.common-V2", + ], + }, + ], + } cc_library_headers { diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/.hash b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/.hash new file mode 100644 index 0000000000..b7a3f2641c --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/.hash @@ -0,0 +1 @@ +6e0e98f955d0bf3e7502a30fac0465e56cc98e75 diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Buffer.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Buffer.aidl new file mode 100644 index 0000000000..a33ad23323 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Buffer.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 -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 Buffer { + int slot; + @nullable android.hardware.common.NativeHandle handle; + @nullable ParcelFileDescriptor fence; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Capability.aidl new file mode 100644 index 0000000000..b89f7d5105 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Capability.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 -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 Capability { + INVALID = 0, + SIDEBAND_STREAM = 1, + SKIP_CLIENT_COLOR_TRANSFORM = 2, + PRESENT_FENCE_IS_NOT_RELIABLE = 3, + SKIP_VALIDATE = 4, + BOOT_DISPLAY_CONFIG = 5, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl new file mode 100644 index 0000000000..7e47ba8b5e --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ChangedCompositionLayer.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 -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 ChangedCompositionLayer { + long layer; + android.hardware.graphics.composer3.Composition composition; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl new file mode 100644 index 0000000000..9a5ca9700d --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ChangedCompositionTypes.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 -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 ChangedCompositionTypes { + long display; + android.hardware.graphics.composer3.ChangedCompositionLayer[] layers; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClientTarget.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClientTarget.aidl new file mode 100644 index 0000000000..7632707ec2 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClientTarget.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 -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 ClientTarget { + android.hardware.graphics.composer3.Buffer buffer; + android.hardware.graphics.common.Dataspace dataspace; + android.hardware.graphics.common.Rect[] damage; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClientTargetProperty.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClientTargetProperty.aidl new file mode 100644 index 0000000000..d34d1b0ab8 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClientTargetProperty.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 -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 ClientTargetProperty { + android.hardware.graphics.common.PixelFormat pixelFormat; + android.hardware.graphics.common.Dataspace dataspace; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.aidl new file mode 100644 index 0000000000..8fb6933c95 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.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 -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 ClientTargetPropertyWithBrightness { + long display; + android.hardware.graphics.composer3.ClientTargetProperty clientTargetProperty; + float brightness; + android.hardware.graphics.composer3.DimmingStage dimmingStage; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl new file mode 100644 index 0000000000..480a85c27f --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ClockMonotonicTimestamp.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 -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 ClockMonotonicTimestamp { + long timestampNanos; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Color.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Color.aidl new file mode 100644 index 0000000000..822290908e --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Color.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 -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 Color { + float r; + float g; + float b; + float a; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ColorMode.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ColorMode.aidl new file mode 100644 index 0000000000..53852b6270 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ColorMode.aidl @@ -0,0 +1,51 @@ +/** + * 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 -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 ColorMode { + NATIVE = 0, + STANDARD_BT601_625 = 1, + STANDARD_BT601_625_UNADJUSTED = 2, + STANDARD_BT601_525 = 3, + STANDARD_BT601_525_UNADJUSTED = 4, + STANDARD_BT709 = 5, + DCI_P3 = 6, + SRGB = 7, + ADOBE_RGB = 8, + DISPLAY_P3 = 9, + BT2020 = 10, + BT2100_PQ = 11, + BT2100_HLG = 12, + DISPLAY_BT2020 = 13, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/CommandError.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/CommandError.aidl new file mode 100644 index 0000000000..103bfdc689 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/CommandError.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 -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 CommandError { + int commandIndex; + int errorCode; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/CommandResultPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/CommandResultPayload.aidl new file mode 100644 index 0000000000..6892f06180 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/CommandResultPayload.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 -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 +union CommandResultPayload { + android.hardware.graphics.composer3.CommandError error; + android.hardware.graphics.composer3.ChangedCompositionTypes changedCompositionTypes; + android.hardware.graphics.composer3.DisplayRequest displayRequest; + android.hardware.graphics.composer3.PresentFence presentFence; + android.hardware.graphics.composer3.ReleaseFences releaseFences; + android.hardware.graphics.composer3.PresentOrValidate presentOrValidateResult; + android.hardware.graphics.composer3.ClientTargetPropertyWithBrightness clientTargetProperty; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Composition.aidl new file mode 100644 index 0000000000..d2d8f0486a --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/Composition.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 -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 Composition { + INVALID = 0, + CLIENT = 1, + DEVICE = 2, + SOLID_COLOR = 3, + CURSOR = 4, + SIDEBAND = 5, + DISPLAY_DECORATION = 6, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ContentType.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ContentType.aidl new file mode 100644 index 0000000000..d87b7670dd --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ContentType.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 -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 ContentType { + NONE = 0, + GRAPHICS = 1, + PHOTO = 2, + CINEMA = 3, + GAME = 4, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DimmingStage.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DimmingStage.aidl new file mode 100644 index 0000000000..44457f8ec1 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DimmingStage.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 -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 DimmingStage { + NONE = 0, + LINEAR = 1, + GAMMA_OETF = 2, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayAttribute.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayAttribute.aidl new file mode 100644 index 0000000000..8454c40dbe --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayAttribute.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 -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 DisplayAttribute { + INVALID = 0, + WIDTH = 1, + HEIGHT = 2, + VSYNC_PERIOD = 3, + DPI_X = 4, + DPI_Y = 5, + CONFIG_GROUP = 7, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayBrightness.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayBrightness.aidl new file mode 100644 index 0000000000..e765189b96 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayBrightness.aidl @@ -0,0 +1,39 @@ +/** + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable DisplayBrightness { + float brightness; + float brightnessNits; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayCapability.aidl new file mode 100644 index 0000000000..6eba887aef --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayCapability.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 -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 DisplayCapability { + INVALID = 0, + SKIP_CLIENT_COLOR_TRANSFORM = 1, + DOZE = 2, + BRIGHTNESS = 3, + PROTECTED_CONTENTS = 4, + AUTO_LOW_LATENCY_MODE = 5, + SUSPEND = 6, + DISPLAY_IDLE_TIMER = 7, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayCommand.aidl new file mode 100644 index 0000000000..662240e96b --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayCommand.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 -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 DisplayCommand { + long display; + android.hardware.graphics.composer3.LayerCommand[] layers; + @nullable float[] colorTransformMatrix; + @nullable android.hardware.graphics.composer3.DisplayBrightness brightness; + @nullable android.hardware.graphics.composer3.ClientTarget clientTarget; + @nullable android.hardware.graphics.composer3.Buffer virtualDisplayOutputBuffer; + @nullable android.hardware.graphics.composer3.ClockMonotonicTimestamp expectedPresentTime; + boolean validateDisplay; + boolean acceptDisplayChanges; + boolean presentDisplay; + boolean presentOrValidateDisplay; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayConnectionType.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayConnectionType.aidl new file mode 100644 index 0000000000..640f82a0cd --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayConnectionType.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 -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 DisplayConnectionType { + INTERNAL = 0, + EXTERNAL = 1, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayContentSample.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayContentSample.aidl new file mode 100644 index 0000000000..c62453634f --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayContentSample.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 -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 DisplayContentSample { + long frameCount; + long[] sampleComponent0; + long[] sampleComponent1; + long[] sampleComponent2; + long[] sampleComponent3; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.aidl new file mode 100644 index 0000000000..7c6542f527 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayContentSamplingAttributes.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 -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 DisplayContentSamplingAttributes { + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.Dataspace dataspace; + android.hardware.graphics.composer3.FormatColorComponent componentMask; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayIdentification.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayIdentification.aidl new file mode 100644 index 0000000000..a0cc9b097b --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayIdentification.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 -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 DisplayIdentification { + byte port; + byte[] data; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayRequest.aidl new file mode 100644 index 0000000000..13462ce298 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/DisplayRequest.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 -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 DisplayRequest { + long display; + int mask; + android.hardware.graphics.composer3.DisplayRequest.LayerRequest[] layerRequests; + const int FLIP_CLIENT_TARGET = 1; + const int WRITE_CLIENT_TARGET_TO_OUTPUT = 2; + @VintfStability + parcelable LayerRequest { + long layer; + int mask; + const int CLEAR_CLIENT_TARGET = 1; + } +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/FormatColorComponent.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/FormatColorComponent.aidl new file mode 100644 index 0000000000..4b737de0c8 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/FormatColorComponent.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 -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="byte") @VintfStability +enum FormatColorComponent { + FORMAT_COMPONENT_0 = 1, + FORMAT_COMPONENT_1 = 2, + FORMAT_COMPONENT_2 = 4, + FORMAT_COMPONENT_3 = 8, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/HdrCapabilities.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/HdrCapabilities.aidl new file mode 100644 index 0000000000..80141d3543 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/HdrCapabilities.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 -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 HdrCapabilities { + android.hardware.graphics.common.Hdr[] types; + float maxLuminance; + float maxAverageLuminance; + float minLuminance; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/IComposer.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/IComposer.aidl new file mode 100644 index 0000000000..21b9ad88cd --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/IComposer.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 -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 +interface IComposer { + android.hardware.graphics.composer3.IComposerClient createClient(); + android.hardware.graphics.composer3.Capability[] getCapabilities(); + const int EX_NO_RESOURCES = 6; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/IComposerCallback.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/IComposerCallback.aidl new file mode 100644 index 0000000000..21620e7f31 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/IComposerCallback.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 -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 +interface IComposerCallback { + void onHotplug(long display, boolean connected); + oneway void onRefresh(long display); + oneway void onSeamlessPossible(long display); + oneway void onVsync(long display, long timestamp, int vsyncPeriodNanos); + oneway void onVsyncPeriodTimingChanged(long display, in android.hardware.graphics.composer3.VsyncPeriodChangeTimeline updatedTimeline); + oneway void onVsyncIdle(long display); +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/IComposerClient.aidl new file mode 100644 index 0000000000..b49f239ed0 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/IComposerClient.aidl @@ -0,0 +1,89 @@ +/** + * 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 -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 +interface IComposerClient { + long createLayer(long display, int bufferSlotCount); + android.hardware.graphics.composer3.VirtualDisplay createVirtualDisplay(int width, int height, android.hardware.graphics.common.PixelFormat formatHint, int outputBufferSlotCount); + void destroyLayer(long display, long layer); + void destroyVirtualDisplay(long display); + android.hardware.graphics.composer3.CommandResultPayload[] executeCommands(in android.hardware.graphics.composer3.DisplayCommand[] commands); + int getActiveConfig(long display); + android.hardware.graphics.composer3.ColorMode[] getColorModes(long display); + float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); + int getDisplayAttribute(long display, int config, android.hardware.graphics.composer3.DisplayAttribute attribute); + android.hardware.graphics.composer3.DisplayCapability[] getDisplayCapabilities(long display); + int[] getDisplayConfigs(long display); + android.hardware.graphics.composer3.DisplayConnectionType getDisplayConnectionType(long display); + android.hardware.graphics.composer3.DisplayIdentification getDisplayIdentificationData(long display); + String getDisplayName(long display); + int getDisplayVsyncPeriod(long display); + android.hardware.graphics.composer3.DisplayContentSample getDisplayedContentSample(long display, long maxFrames, long timestamp); + android.hardware.graphics.composer3.DisplayContentSamplingAttributes getDisplayedContentSamplingAttributes(long display); + android.hardware.graphics.common.Transform getDisplayPhysicalOrientation(long display); + android.hardware.graphics.composer3.HdrCapabilities getHdrCapabilities(long display); + int getMaxVirtualDisplayCount(); + android.hardware.graphics.composer3.PerFrameMetadataKey[] getPerFrameMetadataKeys(long display); + android.hardware.graphics.composer3.ReadbackBufferAttributes getReadbackBufferAttributes(long display); + @nullable ParcelFileDescriptor getReadbackBufferFence(long display); + android.hardware.graphics.composer3.RenderIntent[] getRenderIntents(long display, android.hardware.graphics.composer3.ColorMode mode); + android.hardware.graphics.composer3.ContentType[] getSupportedContentTypes(long display); + @nullable android.hardware.graphics.common.DisplayDecorationSupport getDisplayDecorationSupport(long display); + void registerCallback(in android.hardware.graphics.composer3.IComposerCallback callback); + void setActiveConfig(long display, int config); + android.hardware.graphics.composer3.VsyncPeriodChangeTimeline setActiveConfigWithConstraints(long display, int config, in android.hardware.graphics.composer3.VsyncPeriodChangeConstraints vsyncPeriodChangeConstraints); + void setBootDisplayConfig(long display, int config); + void clearBootDisplayConfig(long display); + int getPreferredBootDisplayConfig(long display); + void setAutoLowLatencyMode(long display, boolean on); + void setClientTargetSlotCount(long display, int clientTargetSlotCount); + void setColorMode(long display, android.hardware.graphics.composer3.ColorMode mode, android.hardware.graphics.composer3.RenderIntent intent); + void setContentType(long display, android.hardware.graphics.composer3.ContentType type); + void setDisplayedContentSamplingEnabled(long display, boolean enable, android.hardware.graphics.composer3.FormatColorComponent componentMask, long maxFrames); + void setPowerMode(long display, android.hardware.graphics.composer3.PowerMode mode); + void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, in @nullable ParcelFileDescriptor releaseFence); + void setVsyncEnabled(long display, boolean enabled); + void setIdleTimerEnabled(long display, int timeoutMs); + const int EX_BAD_CONFIG = 1; + const int EX_BAD_DISPLAY = 2; + const int EX_BAD_LAYER = 3; + const int EX_BAD_PARAMETER = 4; + const int EX_RESERVED = 5; + const int EX_NO_RESOURCES = 6; + const int EX_NOT_VALIDATED = 7; + const int EX_UNSUPPORTED = 8; + const int EX_SEAMLESS_NOT_ALLOWED = 9; + const int EX_SEAMLESS_NOT_POSSIBLE = 10; + const int INVALID_CONFIGURATION = 2147483647; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/LayerBrightness.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/LayerBrightness.aidl new file mode 100644 index 0000000000..a726cc12bf --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/LayerBrightness.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 -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 LayerBrightness { + float brightness; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/LayerCommand.aidl new file mode 100644 index 0000000000..0c5fac9640 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/LayerCommand.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 -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 LayerCommand { + long layer; + @nullable android.hardware.graphics.common.Point cursorPosition; + @nullable android.hardware.graphics.composer3.Buffer buffer; + @nullable android.hardware.graphics.common.Rect[] damage; + @nullable android.hardware.graphics.composer3.ParcelableBlendMode blendMode; + @nullable android.hardware.graphics.composer3.Color color; + @nullable android.hardware.graphics.composer3.ParcelableComposition composition; + @nullable android.hardware.graphics.composer3.ParcelableDataspace dataspace; + @nullable android.hardware.graphics.common.Rect displayFrame; + @nullable android.hardware.graphics.composer3.PlaneAlpha planeAlpha; + @nullable android.hardware.common.NativeHandle sidebandStream; + @nullable android.hardware.graphics.common.FRect sourceCrop; + @nullable android.hardware.graphics.composer3.ParcelableTransform transform; + @nullable android.hardware.graphics.common.Rect[] visibleRegion; + @nullable android.hardware.graphics.composer3.ZOrder z; + @nullable float[] colorTransform; + @nullable android.hardware.graphics.composer3.LayerBrightness brightness; + @nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata; + @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob; + @nullable android.hardware.graphics.common.Rect[] blockingRegion; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableBlendMode.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableBlendMode.aidl new file mode 100644 index 0000000000..f1fee5f376 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableBlendMode.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 -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 ParcelableBlendMode { + android.hardware.graphics.common.BlendMode blendMode; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableComposition.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableComposition.aidl new file mode 100644 index 0000000000..98fbb665e2 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableComposition.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 -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 ParcelableComposition { + android.hardware.graphics.composer3.Composition composition; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableDataspace.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableDataspace.aidl new file mode 100644 index 0000000000..76ecf85b9f --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableDataspace.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 -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 ParcelableDataspace { + android.hardware.graphics.common.Dataspace dataspace; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableTransform.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableTransform.aidl new file mode 100644 index 0000000000..b673656438 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ParcelableTransform.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 -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 ParcelableTransform { + android.hardware.graphics.common.Transform transform; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PerFrameMetadata.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PerFrameMetadata.aidl new file mode 100644 index 0000000000..cd1f351381 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PerFrameMetadata.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 -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 PerFrameMetadata { + android.hardware.graphics.composer3.PerFrameMetadataKey key; + float value; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PerFrameMetadataBlob.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PerFrameMetadataBlob.aidl new file mode 100644 index 0000000000..c1e74d9e3d --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PerFrameMetadataBlob.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 -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 PerFrameMetadataBlob { + android.hardware.graphics.composer3.PerFrameMetadataKey key; + byte[] blob; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl new file mode 100644 index 0000000000..8722f878fe --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl @@ -0,0 +1,50 @@ +/** + * 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 -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 PerFrameMetadataKey { + DISPLAY_RED_PRIMARY_X = 0, + DISPLAY_RED_PRIMARY_Y = 1, + DISPLAY_GREEN_PRIMARY_X = 2, + DISPLAY_GREEN_PRIMARY_Y = 3, + DISPLAY_BLUE_PRIMARY_X = 4, + DISPLAY_BLUE_PRIMARY_Y = 5, + WHITE_POINT_X = 6, + WHITE_POINT_Y = 7, + MAX_LUMINANCE = 8, + MIN_LUMINANCE = 9, + MAX_CONTENT_LIGHT_LEVEL = 10, + MAX_FRAME_AVERAGE_LIGHT_LEVEL = 11, + HDR10_PLUS_SEI = 12, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PlaneAlpha.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PlaneAlpha.aidl new file mode 100644 index 0000000000..c48c2a8a34 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PlaneAlpha.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 -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 PlaneAlpha { + float alpha; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PowerMode.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PowerMode.aidl new file mode 100644 index 0000000000..f587d4dfa8 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PowerMode.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 -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 PowerMode { + OFF = 0, + DOZE = 1, + DOZE_SUSPEND = 3, + ON = 2, + ON_SUSPEND = 4, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PresentFence.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PresentFence.aidl new file mode 100644 index 0000000000..3bb09cdb34 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PresentFence.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 -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 PresentFence { + long display; + ParcelFileDescriptor fence; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PresentOrValidate.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PresentOrValidate.aidl new file mode 100644 index 0000000000..e6ddeba784 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/PresentOrValidate.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 -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 PresentOrValidate { + long display; + android.hardware.graphics.composer3.PresentOrValidate.Result result; + @VintfStability + enum Result { + Validated = 0, + Presented = 1, + } +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ReadbackBufferAttributes.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ReadbackBufferAttributes.aidl new file mode 100644 index 0000000000..bb51bdc04a --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ReadbackBufferAttributes.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 -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 ReadbackBufferAttributes { + android.hardware.graphics.common.PixelFormat format; + android.hardware.graphics.common.Dataspace dataspace; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ReleaseFences.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ReleaseFences.aidl new file mode 100644 index 0000000000..d623661250 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ReleaseFences.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 -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 ReleaseFences { + long display; + android.hardware.graphics.composer3.ReleaseFences.Layer[] layers; + @VintfStability + parcelable Layer { + long layer; + ParcelFileDescriptor fence; + } +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/RenderIntent.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/RenderIntent.aidl new file mode 100644 index 0000000000..5670c10655 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/RenderIntent.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 -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 RenderIntent { + COLORIMETRIC = 0, + ENHANCE = 1, + TONE_MAP_COLORIMETRIC = 2, + TONE_MAP_ENHANCE = 3, +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/VirtualDisplay.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/VirtualDisplay.aidl new file mode 100644 index 0000000000..886be2e3d0 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/VirtualDisplay.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 -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 VirtualDisplay { + long display; + android.hardware.graphics.common.PixelFormat format; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.aidl new file mode 100644 index 0000000000..df38c11f58 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.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 -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 VsyncPeriodChangeConstraints { + long desiredTimeNanos; + boolean seamlessRequired; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.aidl new file mode 100644 index 0000000000..9fb3999e3e --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.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 -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 VsyncPeriodChangeTimeline { + long newVsyncAppliedTimeNanos; + boolean refreshRequired; + long refreshTimeNanos; +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ZOrder.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ZOrder.aidl new file mode 100644 index 0000000000..ea96ea3a69 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/1/android/hardware/graphics/composer3/ZOrder.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 -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 ZOrder { + int z; +} diff --git a/identity/aidl/Android.bp b/identity/aidl/Android.bp index e3b819125a..920a4b9fff 100644 --- a/identity/aidl/Android.bp +++ b/identity/aidl/Android.bp @@ -29,9 +29,36 @@ aidl_interface { apps_enabled: false, }, }, - versions: [ - "1", - "2", - "3", + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.keymaster-V3", + "android.hardware.security.keymint-V1", + ], + }, + { + version: "2", + imports: [ + "android.hardware.keymaster-V3", + "android.hardware.security.keymint-V1", + ], + }, + { + version: "3", + imports: [ + "android.hardware.keymaster-V3", + "android.hardware.security.keymint-V1", + ], + }, + { + version: "4", + imports: [ + "android.hardware.keymaster-V3", + "android.hardware.security.keymint-V2", + ], + }, + ], + } diff --git a/identity/aidl/aidl_api/android.hardware.identity/4/.hash b/identity/aidl/aidl_api/android.hardware.identity/4/.hash new file mode 100644 index 0000000000..244be6d9fb --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/4/.hash @@ -0,0 +1 @@ +2d63b17eb0f860c87b3564eda281342fb362e38d diff --git a/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/Certificate.aidl b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/Certificate.aidl new file mode 100644 index 0000000000..83e1797386 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/Certificate.aidl @@ -0,0 +1,38 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +parcelable Certificate { + byte[] encodedCertificate; +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/CipherSuite.aidl b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/CipherSuite.aidl new file mode 100644 index 0000000000..e6ec04e805 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/CipherSuite.aidl @@ -0,0 +1,38 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@Backing(type="int") @VintfStability +enum CipherSuite { + CIPHERSUITE_ECDHE_HKDF_ECDSA_WITH_AES_256_GCM_SHA256 = 1, +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/HardwareInformation.aidl b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/HardwareInformation.aidl new file mode 100644 index 0000000000..9b96ea8a68 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/HardwareInformation.aidl @@ -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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +parcelable HardwareInformation { + @utf8InCpp String credentialStoreName; + @utf8InCpp String credentialStoreAuthorName; + int dataChunkSize; + boolean isDirectAccess; + @utf8InCpp String[] supportedDocTypes; + boolean isRemoteKeyProvisioningSupported = false; +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IIdentityCredential.aidl b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IIdentityCredential.aidl new file mode 100644 index 0000000000..5065641109 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IIdentityCredential.aidl @@ -0,0 +1,54 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +interface IIdentityCredential { + /** + * @deprecated use deleteCredentalWithChallenge() instead. + */ + byte[] deleteCredential(); + byte[] createEphemeralKeyPair(); + void setReaderEphemeralPublicKey(in byte[] publicKey); + long createAuthChallenge(); + void startRetrieval(in android.hardware.identity.SecureAccessControlProfile[] accessControlProfiles, in android.hardware.keymaster.HardwareAuthToken authToken, in byte[] itemsRequest, in byte[] signingKeyBlob, in byte[] sessionTranscript, in byte[] readerSignature, in int[] requestCounts); + void startRetrieveEntryValue(in @utf8InCpp String nameSpace, in @utf8InCpp String name, in int entrySize, in int[] accessControlProfileIds); + byte[] retrieveEntryValue(in byte[] encryptedContent); + @SuppressWarnings(value={"out-array"}) void finishRetrieval(out byte[] mac, out byte[] deviceNameSpaces); + @SuppressWarnings(value={"out-array"}) android.hardware.identity.Certificate generateSigningKeyPair(out byte[] signingKeyBlob); + void setRequestedNamespaces(in android.hardware.identity.RequestNamespace[] requestNamespaces); + void setVerificationToken(in android.hardware.keymaster.VerificationToken verificationToken); + byte[] deleteCredentialWithChallenge(in byte[] challenge); + byte[] proveOwnership(in byte[] challenge); + android.hardware.identity.IWritableIdentityCredential updateCredential(); +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IIdentityCredentialStore.aidl b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IIdentityCredentialStore.aidl new file mode 100644 index 0000000000..31ca8b10f3 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IIdentityCredentialStore.aidl @@ -0,0 +1,55 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +interface IIdentityCredentialStore { + android.hardware.identity.HardwareInformation getHardwareInformation(); + android.hardware.identity.IWritableIdentityCredential createCredential(in @utf8InCpp String docType, in boolean testCredential); + android.hardware.identity.IIdentityCredential getCredential(in android.hardware.identity.CipherSuite cipherSuite, in byte[] credentialData); + android.hardware.identity.IPresentationSession createPresentationSession(in android.hardware.identity.CipherSuite cipherSuite); + android.hardware.security.keymint.IRemotelyProvisionedComponent getRemotelyProvisionedComponent(); + const int STATUS_OK = 0; + const int STATUS_FAILED = 1; + const int STATUS_CIPHER_SUITE_NOT_SUPPORTED = 2; + const int STATUS_INVALID_DATA = 3; + const int STATUS_INVALID_AUTH_TOKEN = 4; + const int STATUS_INVALID_ITEMS_REQUEST_MESSAGE = 5; + const int STATUS_READER_SIGNATURE_CHECK_FAILED = 6; + const int STATUS_EPHEMERAL_PUBLIC_KEY_NOT_FOUND = 7; + const int STATUS_USER_AUTHENTICATION_FAILED = 8; + const int STATUS_READER_AUTHENTICATION_FAILED = 9; + const int STATUS_NO_ACCESS_CONTROL_PROFILES = 10; + const int STATUS_NOT_IN_REQUEST_MESSAGE = 11; + const int STATUS_SESSION_TRANSCRIPT_MISMATCH = 12; +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IPresentationSession.aidl b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IPresentationSession.aidl new file mode 100644 index 0000000000..705dc292c5 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IPresentationSession.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +interface IPresentationSession { + byte[] getEphemeralKeyPair(); + long getAuthChallenge(); + void setReaderEphemeralPublicKey(in byte[] publicKey); + void setSessionTranscript(in byte[] sessionTranscript); + android.hardware.identity.IIdentityCredential getCredential(in byte[] credentialData); +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IWritableIdentityCredential.aidl b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IWritableIdentityCredential.aidl new file mode 100644 index 0000000000..5377349a52 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/IWritableIdentityCredential.aidl @@ -0,0 +1,45 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +interface IWritableIdentityCredential { + android.hardware.identity.Certificate[] getAttestationCertificate(in byte[] attestationApplicationId, in byte[] attestationChallenge); + void startPersonalization(in int accessControlProfileCount, in int[] entryCounts); + android.hardware.identity.SecureAccessControlProfile addAccessControlProfile(in int id, in android.hardware.identity.Certificate readerCertificate, in boolean userAuthenticationRequired, in long timeoutMillis, in long secureUserId); + void beginAddEntry(in int[] accessControlProfileIds, in @utf8InCpp String nameSpace, in @utf8InCpp String name, in int entrySize); + byte[] addEntryValue(in byte[] content); + @SuppressWarnings(value={"out-array"}) void finishAddingEntries(out byte[] credentialData, out byte[] proofOfProvisioningSignature); + void setExpectedProofOfProvisioningSize(in int expectedProofOfProvisioningSize); + void setRemotelyProvisionedAttestationKey(in byte[] attestationKeyBlob, in byte[] attestationCertificate); +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/RequestDataItem.aidl b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/RequestDataItem.aidl new file mode 100644 index 0000000000..cec8e0c94d --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/RequestDataItem.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +parcelable RequestDataItem { + @utf8InCpp String name; + long size; + int[] accessControlProfileIds; +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/RequestNamespace.aidl b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/RequestNamespace.aidl new file mode 100644 index 0000000000..05b9ec295f --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/RequestNamespace.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +parcelable RequestNamespace { + @utf8InCpp String namespaceName; + android.hardware.identity.RequestDataItem[] items; +} diff --git a/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/SecureAccessControlProfile.aidl b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/SecureAccessControlProfile.aidl new file mode 100644 index 0000000000..2003594eb4 --- /dev/null +++ b/identity/aidl/aidl_api/android.hardware.identity/4/android/hardware/identity/SecureAccessControlProfile.aidl @@ -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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.identity; +@VintfStability +parcelable SecureAccessControlProfile { + int id; + android.hardware.identity.Certificate readerCertificate; + boolean userAuthenticationRequired; + long timeoutMillis; + long secureUserId; + byte[] mac; +} diff --git a/input/processor/aidl/Android.bp b/input/processor/aidl/Android.bp index f848a5706a..354816ec74 100644 --- a/input/processor/aidl/Android.bp +++ b/input/processor/aidl/Android.bp @@ -23,4 +23,11 @@ aidl_interface { enabled: false, }, }, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.input.common-V1"], + }, + ], + } diff --git a/input/processor/aidl/aidl_api/android.hardware.input.processor/1/.hash b/input/processor/aidl/aidl_api/android.hardware.input.processor/1/.hash new file mode 100644 index 0000000000..e1f0b00774 --- /dev/null +++ b/input/processor/aidl/aidl_api/android.hardware.input.processor/1/.hash @@ -0,0 +1 @@ +8caabf520f562590b693af83b1d2a0c409fb0236 diff --git a/input/processor/aidl/aidl_api/android.hardware.input.processor/1/android/hardware/input/processor/IInputProcessor.aidl b/input/processor/aidl/aidl_api/android.hardware.input.processor/1/android/hardware/input/processor/IInputProcessor.aidl new file mode 100644 index 0000000000..9d00c70ec2 --- /dev/null +++ b/input/processor/aidl/aidl_api/android.hardware.input.processor/1/android/hardware/input/processor/IInputProcessor.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 -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.input.processor; +@VintfStability +interface IInputProcessor { + android.hardware.input.common.Classification classify(in android.hardware.input.common.MotionEvent event); + void reset(); + void resetDevice(in int deviceId); +} diff --git a/neuralnetworks/aidl/Android.bp b/neuralnetworks/aidl/Android.bp index 47f3b30280..db1188d814 100644 --- a/neuralnetworks/aidl/Android.bp +++ b/neuralnetworks/aidl/Android.bp @@ -35,9 +35,36 @@ aidl_interface { min_sdk_version: "30", }, }, - versions: [ - "1", - "2", - "3", + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.common-V2", + "android.hardware.graphics.common-V3", + ], + }, + { + version: "2", + imports: [ + "android.hardware.common-V2", + "android.hardware.graphics.common-V3", + ], + }, + { + version: "3", + imports: [ + "android.hardware.common-V2", + "android.hardware.graphics.common-V3", + ], + }, + { + version: "4", + imports: [ + "android.hardware.common-V2", + "android.hardware.graphics.common-V3", + ], + }, + ], + } diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/.hash b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/.hash new file mode 100644 index 0000000000..81025c7a1a --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/.hash @@ -0,0 +1 @@ +53178f8de9b8861df391cf0593f6f3e08adad33d diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/BufferDesc.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/BufferDesc.aidl new file mode 100644 index 0000000000..05cec76c88 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/BufferDesc.aidl @@ -0,0 +1,38 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable BufferDesc { + int[] dimensions; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/BufferRole.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/BufferRole.aidl new file mode 100644 index 0000000000..10a6b75ac7 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/BufferRole.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable BufferRole { + int modelIndex; + int ioIndex; + float probability; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Capabilities.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Capabilities.aidl new file mode 100644 index 0000000000..30877c0294 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Capabilities.aidl @@ -0,0 +1,42 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Capabilities { + android.hardware.neuralnetworks.PerformanceInfo relaxedFloat32toFloat16PerformanceScalar; + android.hardware.neuralnetworks.PerformanceInfo relaxedFloat32toFloat16PerformanceTensor; + android.hardware.neuralnetworks.OperandPerformance[] operandPerformance; + android.hardware.neuralnetworks.PerformanceInfo ifPerformance; + android.hardware.neuralnetworks.PerformanceInfo whilePerformance; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/DataLocation.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/DataLocation.aidl new file mode 100644 index 0000000000..db49a38979 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/DataLocation.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable DataLocation { + int poolIndex; + long offset; + long length; + long padding; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/DeviceBuffer.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/DeviceBuffer.aidl new file mode 100644 index 0000000000..7cdd6db742 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/DeviceBuffer.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable DeviceBuffer { + android.hardware.neuralnetworks.IBuffer buffer; + int token; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/DeviceType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/DeviceType.aidl new file mode 100644 index 0000000000..82fe8ae3e7 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/DeviceType.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum DeviceType { + OTHER = 1, + CPU = 2, + GPU = 3, + ACCELERATOR = 4, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ErrorStatus.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ErrorStatus.aidl new file mode 100644 index 0000000000..57d5d6e4cd --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ErrorStatus.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum ErrorStatus { + NONE = 0, + DEVICE_UNAVAILABLE = 1, + GENERAL_FAILURE = 2, + OUTPUT_INSUFFICIENT_SIZE = 3, + INVALID_ARGUMENT = 4, + MISSED_DEADLINE_TRANSIENT = 5, + MISSED_DEADLINE_PERSISTENT = 6, + RESOURCE_EXHAUSTED_TRANSIENT = 7, + RESOURCE_EXHAUSTED_PERSISTENT = 8, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExecutionConfig.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExecutionConfig.aidl new file mode 100644 index 0000000000..cb85743a01 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExecutionConfig.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 -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.neuralnetworks; +@VintfStability +parcelable ExecutionConfig { + boolean measureTiming; + long loopTimeoutDurationNs; + android.hardware.neuralnetworks.TokenValuePair[] executionHints; + android.hardware.neuralnetworks.ExtensionNameAndPrefix[] extensionNameToPrefix; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExecutionPreference.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExecutionPreference.aidl new file mode 100644 index 0000000000..4352d8f334 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExecutionPreference.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum ExecutionPreference { + LOW_POWER = 0, + FAST_SINGLE_ANSWER = 1, + SUSTAINED_SPEED = 2, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExecutionResult.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExecutionResult.aidl new file mode 100644 index 0000000000..44e9922f52 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExecutionResult.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 -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.neuralnetworks; +@VintfStability +parcelable ExecutionResult { + boolean outputSufficientSize; + android.hardware.neuralnetworks.OutputShape[] outputShapes; + android.hardware.neuralnetworks.Timing timing; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Extension.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Extension.aidl new file mode 100644 index 0000000000..c47028d99f --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Extension.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Extension { + String name; + android.hardware.neuralnetworks.ExtensionOperandTypeInformation[] operandTypes; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl new file mode 100644 index 0000000000..6c287fd460 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExtensionNameAndPrefix.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable ExtensionNameAndPrefix { + String name; + char prefix; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl new file mode 100644 index 0000000000..a3680aa9dd --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable ExtensionOperandTypeInformation { + char type; + boolean isTensor; + int byteSize; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/FencedExecutionResult.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/FencedExecutionResult.aidl new file mode 100644 index 0000000000..7952b34632 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/FencedExecutionResult.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 -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.neuralnetworks; +@VintfStability +parcelable FencedExecutionResult { + android.hardware.neuralnetworks.IFencedExecutionCallback callback; + @nullable ParcelFileDescriptor syncFence; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/FusedActivationFunc.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/FusedActivationFunc.aidl new file mode 100644 index 0000000000..7e61bbbdb1 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/FusedActivationFunc.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum FusedActivationFunc { + NONE = 0, + RELU = 1, + RELU1 = 2, + RELU6 = 3, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IBuffer.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IBuffer.aidl new file mode 100644 index 0000000000..f10e7e24ca --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IBuffer.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +interface IBuffer { + void copyFrom(in android.hardware.neuralnetworks.Memory src, in int[] dimensions); + void copyTo(in android.hardware.neuralnetworks.Memory dst); +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IBurst.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IBurst.aidl new file mode 100644 index 0000000000..461fdfa2c6 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IBurst.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 -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.neuralnetworks; +@VintfStability +interface IBurst { + android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in android.hardware.neuralnetworks.Request request, in long[] memoryIdentifierTokens, in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs); + void releaseMemoryResource(in long memoryIdentifierToken); + android.hardware.neuralnetworks.ExecutionResult executeSynchronouslyWithConfig(in android.hardware.neuralnetworks.Request request, in long[] memoryIdentifierTokens, in android.hardware.neuralnetworks.ExecutionConfig config, in long deadlineNs); +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IDevice.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IDevice.aidl new file mode 100644 index 0000000000..c0fba47d0e --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IDevice.aidl @@ -0,0 +1,53 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +interface IDevice { + android.hardware.neuralnetworks.DeviceBuffer allocate(in android.hardware.neuralnetworks.BufferDesc desc, in android.hardware.neuralnetworks.IPreparedModelParcel[] preparedModels, in android.hardware.neuralnetworks.BufferRole[] inputRoles, in android.hardware.neuralnetworks.BufferRole[] outputRoles); + android.hardware.neuralnetworks.Capabilities getCapabilities(); + android.hardware.neuralnetworks.NumberOfCacheFiles getNumberOfCacheFilesNeeded(); + android.hardware.neuralnetworks.Extension[] getSupportedExtensions(); + boolean[] getSupportedOperations(in android.hardware.neuralnetworks.Model model); + android.hardware.neuralnetworks.DeviceType getType(); + String getVersionString(); + void prepareModel(in android.hardware.neuralnetworks.Model model, in android.hardware.neuralnetworks.ExecutionPreference preference, in android.hardware.neuralnetworks.Priority priority, in long deadlineNs, in ParcelFileDescriptor[] modelCache, in ParcelFileDescriptor[] dataCache, in byte[] token, in android.hardware.neuralnetworks.IPreparedModelCallback callback); + void prepareModelFromCache(in long deadlineNs, in ParcelFileDescriptor[] modelCache, in ParcelFileDescriptor[] dataCache, in byte[] token, in android.hardware.neuralnetworks.IPreparedModelCallback callback); + void prepareModelWithConfig(in android.hardware.neuralnetworks.Model model, in android.hardware.neuralnetworks.PrepareModelConfig config, in android.hardware.neuralnetworks.IPreparedModelCallback callback); + const int BYTE_SIZE_OF_CACHE_TOKEN = 32; + const int MAX_NUMBER_OF_CACHE_FILES = 32; + const int EXTENSION_TYPE_HIGH_BITS_PREFIX = 15; + const int EXTENSION_TYPE_LOW_BITS_TYPE = 16; + const int OPERAND_TYPE_BASE_MAX = 65535; + const int OPERATION_TYPE_BASE_MAX = 65535; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IExecution.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IExecution.aidl new file mode 100644 index 0000000000..ab5275e582 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IExecution.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 -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.neuralnetworks; +@VintfStability +interface IExecution { + android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in long deadlineNs); + android.hardware.neuralnetworks.FencedExecutionResult executeFenced(in ParcelFileDescriptor[] waitFor, in long deadlineNs, in long durationNs); +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl new file mode 100644 index 0000000000..0bfb80ac78 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IFencedExecutionCallback.aidl @@ -0,0 +1,38 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +interface IFencedExecutionCallback { + android.hardware.neuralnetworks.ErrorStatus getExecutionInfo(out android.hardware.neuralnetworks.Timing timingLaunched, out android.hardware.neuralnetworks.Timing timingFenced); +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IPreparedModel.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IPreparedModel.aidl new file mode 100644 index 0000000000..fb0c372267 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IPreparedModel.aidl @@ -0,0 +1,45 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +interface IPreparedModel { + android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in android.hardware.neuralnetworks.Request request, in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs); + android.hardware.neuralnetworks.FencedExecutionResult executeFenced(in android.hardware.neuralnetworks.Request request, in ParcelFileDescriptor[] waitFor, in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs, in long durationNs); + android.hardware.neuralnetworks.IBurst configureExecutionBurst(); + android.hardware.neuralnetworks.IExecution createReusableExecution(in android.hardware.neuralnetworks.Request request, in android.hardware.neuralnetworks.ExecutionConfig config); + android.hardware.neuralnetworks.ExecutionResult executeSynchronouslyWithConfig(in android.hardware.neuralnetworks.Request request, in android.hardware.neuralnetworks.ExecutionConfig config, in long deadlineNs); + android.hardware.neuralnetworks.FencedExecutionResult executeFencedWithConfig(in android.hardware.neuralnetworks.Request request, in ParcelFileDescriptor[] waitFor, in android.hardware.neuralnetworks.ExecutionConfig config, in long deadlineNs, in long durationNs); + const long DEFAULT_LOOP_TIMEOUT_DURATION_NS = 2000000000; + const long MAXIMUM_LOOP_TIMEOUT_DURATION_NS = 15000000000; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IPreparedModelCallback.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IPreparedModelCallback.aidl new file mode 100644 index 0000000000..e0c763bc2a --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IPreparedModelCallback.aidl @@ -0,0 +1,38 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +interface IPreparedModelCallback { + void notify(in android.hardware.neuralnetworks.ErrorStatus status, in android.hardware.neuralnetworks.IPreparedModel preparedModel); +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IPreparedModelParcel.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IPreparedModelParcel.aidl new file mode 100644 index 0000000000..dbedf12772 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/IPreparedModelParcel.aidl @@ -0,0 +1,38 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable IPreparedModelParcel { + android.hardware.neuralnetworks.IPreparedModel preparedModel; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Memory.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Memory.aidl new file mode 100644 index 0000000000..37fa102cf4 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Memory.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +union Memory { + android.hardware.common.Ashmem ashmem; + android.hardware.common.MappableFile mappableFile; + android.hardware.graphics.common.HardwareBuffer hardwareBuffer; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Model.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Model.aidl new file mode 100644 index 0000000000..30d8dda55d --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Model.aidl @@ -0,0 +1,43 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Model { + android.hardware.neuralnetworks.Subgraph main; + android.hardware.neuralnetworks.Subgraph[] referenced; + byte[] operandValues; + android.hardware.neuralnetworks.Memory[] pools; + boolean relaxComputationFloat32toFloat16; + android.hardware.neuralnetworks.ExtensionNameAndPrefix[] extensionNameToPrefix; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl new file mode 100644 index 0000000000..9314760a43 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/NumberOfCacheFiles.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable NumberOfCacheFiles { + int numModelCache; + int numDataCache; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Operand.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Operand.aidl new file mode 100644 index 0000000000..1d9bdd8446 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Operand.aidl @@ -0,0 +1,44 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Operand { + android.hardware.neuralnetworks.OperandType type = android.hardware.neuralnetworks.OperandType.FLOAT32; + int[] dimensions; + float scale; + int zeroPoint; + android.hardware.neuralnetworks.OperandLifeTime lifetime = android.hardware.neuralnetworks.OperandLifeTime.TEMPORARY_VARIABLE; + android.hardware.neuralnetworks.DataLocation location; + @nullable android.hardware.neuralnetworks.OperandExtraParams extraParams; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandExtraParams.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandExtraParams.aidl new file mode 100644 index 0000000000..14792cff08 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandExtraParams.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +union OperandExtraParams { + android.hardware.neuralnetworks.SymmPerChannelQuantParams channelQuant; + byte[] extension; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandLifeTime.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandLifeTime.aidl new file mode 100644 index 0000000000..40adfb1dd8 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandLifeTime.aidl @@ -0,0 +1,44 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum OperandLifeTime { + TEMPORARY_VARIABLE = 0, + SUBGRAPH_INPUT = 1, + SUBGRAPH_OUTPUT = 2, + CONSTANT_COPY = 3, + CONSTANT_POOL = 4, + NO_VALUE = 5, + SUBGRAPH = 6, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandPerformance.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandPerformance.aidl new file mode 100644 index 0000000000..ebb361b762 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandPerformance.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable OperandPerformance { + android.hardware.neuralnetworks.OperandType type = android.hardware.neuralnetworks.OperandType.FLOAT32; + android.hardware.neuralnetworks.PerformanceInfo info; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandType.aidl new file mode 100644 index 0000000000..9f2c759d38 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperandType.aidl @@ -0,0 +1,53 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum OperandType { + FLOAT32 = 0, + INT32 = 1, + UINT32 = 2, + TENSOR_FLOAT32 = 3, + TENSOR_INT32 = 4, + TENSOR_QUANT8_ASYMM = 5, + BOOL = 6, + TENSOR_QUANT16_SYMM = 7, + TENSOR_FLOAT16 = 8, + TENSOR_BOOL8 = 9, + FLOAT16 = 10, + TENSOR_QUANT8_SYMM_PER_CHANNEL = 11, + TENSOR_QUANT16_ASYMM = 12, + TENSOR_QUANT8_SYMM = 13, + TENSOR_QUANT8_ASYMM_SIGNED = 14, + SUBGRAPH = 15, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Operation.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Operation.aidl new file mode 100644 index 0000000000..a4a3fbee60 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Operation.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Operation { + android.hardware.neuralnetworks.OperationType type = android.hardware.neuralnetworks.OperationType.ADD; + int[] inputs; + int[] outputs; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperationType.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperationType.aidl new file mode 100644 index 0000000000..34506c8860 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OperationType.aidl @@ -0,0 +1,143 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum OperationType { + ADD = 0, + AVERAGE_POOL_2D = 1, + CONCATENATION = 2, + CONV_2D = 3, + DEPTHWISE_CONV_2D = 4, + DEPTH_TO_SPACE = 5, + DEQUANTIZE = 6, + EMBEDDING_LOOKUP = 7, + FLOOR = 8, + FULLY_CONNECTED = 9, + HASHTABLE_LOOKUP = 10, + L2_NORMALIZATION = 11, + L2_POOL_2D = 12, + LOCAL_RESPONSE_NORMALIZATION = 13, + LOGISTIC = 14, + LSH_PROJECTION = 15, + LSTM = 16, + MAX_POOL_2D = 17, + MUL = 18, + RELU = 19, + RELU1 = 20, + RELU6 = 21, + RESHAPE = 22, + RESIZE_BILINEAR = 23, + RNN = 24, + SOFTMAX = 25, + SPACE_TO_DEPTH = 26, + SVDF = 27, + TANH = 28, + BATCH_TO_SPACE_ND = 29, + DIV = 30, + MEAN = 31, + PAD = 32, + SPACE_TO_BATCH_ND = 33, + SQUEEZE = 34, + STRIDED_SLICE = 35, + SUB = 36, + TRANSPOSE = 37, + ABS = 38, + ARGMAX = 39, + ARGMIN = 40, + AXIS_ALIGNED_BBOX_TRANSFORM = 41, + BIDIRECTIONAL_SEQUENCE_LSTM = 42, + BIDIRECTIONAL_SEQUENCE_RNN = 43, + BOX_WITH_NMS_LIMIT = 44, + CAST = 45, + CHANNEL_SHUFFLE = 46, + DETECTION_POSTPROCESSING = 47, + EQUAL = 48, + EXP = 49, + EXPAND_DIMS = 50, + GATHER = 51, + GENERATE_PROPOSALS = 52, + GREATER = 53, + GREATER_EQUAL = 54, + GROUPED_CONV_2D = 55, + HEATMAP_MAX_KEYPOINT = 56, + INSTANCE_NORMALIZATION = 57, + LESS = 58, + LESS_EQUAL = 59, + LOG = 60, + LOGICAL_AND = 61, + LOGICAL_NOT = 62, + LOGICAL_OR = 63, + LOG_SOFTMAX = 64, + MAXIMUM = 65, + MINIMUM = 66, + NEG = 67, + NOT_EQUAL = 68, + PAD_V2 = 69, + POW = 70, + PRELU = 71, + QUANTIZE = 72, + QUANTIZED_16BIT_LSTM = 73, + RANDOM_MULTINOMIAL = 74, + REDUCE_ALL = 75, + REDUCE_ANY = 76, + REDUCE_MAX = 77, + REDUCE_MIN = 78, + REDUCE_PROD = 79, + REDUCE_SUM = 80, + ROI_ALIGN = 81, + ROI_POOLING = 82, + RSQRT = 83, + SELECT = 84, + SIN = 85, + SLICE = 86, + SPLIT = 87, + SQRT = 88, + TILE = 89, + TOPK_V2 = 90, + TRANSPOSE_CONV_2D = 91, + UNIDIRECTIONAL_SEQUENCE_LSTM = 92, + UNIDIRECTIONAL_SEQUENCE_RNN = 93, + RESIZE_NEAREST_NEIGHBOR = 94, + QUANTIZED_LSTM = 95, + IF = 96, + WHILE = 97, + ELU = 98, + HARD_SWISH = 99, + FILL = 100, + RANK = 101, + BATCH_MATMUL = 102, + PACK = 103, + MIRROR_PAD = 104, + REVERSE = 105, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OutputShape.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OutputShape.aidl new file mode 100644 index 0000000000..f7335054cf --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/OutputShape.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable OutputShape { + int[] dimensions; + boolean isSufficient; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/PerformanceInfo.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/PerformanceInfo.aidl new file mode 100644 index 0000000000..04910f5410 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/PerformanceInfo.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable PerformanceInfo { + float execTime; + float powerUsage; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/PrepareModelConfig.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/PrepareModelConfig.aidl new file mode 100644 index 0000000000..1f44ba724f --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/PrepareModelConfig.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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.neuralnetworks; +@VintfStability +parcelable PrepareModelConfig { + android.hardware.neuralnetworks.ExecutionPreference preference; + android.hardware.neuralnetworks.Priority priority; + long deadlineNs; + ParcelFileDescriptor[] modelCache; + ParcelFileDescriptor[] dataCache; + byte[32] cacheToken; + android.hardware.neuralnetworks.TokenValuePair[] compilationHints; + android.hardware.neuralnetworks.ExtensionNameAndPrefix[] extensionNameToPrefix; + const int BYTE_SIZE_OF_CACHE_TOKEN = 32; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Priority.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Priority.aidl new file mode 100644 index 0000000000..8f357097ab --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Priority.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@Backing(type="int") @VintfStability +enum Priority { + LOW = 0, + MEDIUM = 1, + HIGH = 2, +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Request.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Request.aidl new file mode 100644 index 0000000000..39ec7a9acd --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Request.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Request { + android.hardware.neuralnetworks.RequestArgument[] inputs; + android.hardware.neuralnetworks.RequestArgument[] outputs; + android.hardware.neuralnetworks.RequestMemoryPool[] pools; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/RequestArgument.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/RequestArgument.aidl new file mode 100644 index 0000000000..e3541c0ece --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/RequestArgument.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable RequestArgument { + boolean hasNoValue; + android.hardware.neuralnetworks.DataLocation location; + int[] dimensions; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/RequestMemoryPool.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/RequestMemoryPool.aidl new file mode 100644 index 0000000000..312f5813bc --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/RequestMemoryPool.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +union RequestMemoryPool { + android.hardware.neuralnetworks.Memory pool; + int token; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Subgraph.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Subgraph.aidl new file mode 100644 index 0000000000..b7d44515f4 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Subgraph.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Subgraph { + android.hardware.neuralnetworks.Operand[] operands; + android.hardware.neuralnetworks.Operation[] operations; + int[] inputIndexes; + int[] outputIndexes; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl new file mode 100644 index 0000000000..02d68f9ed1 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/SymmPerChannelQuantParams.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable SymmPerChannelQuantParams { + float[] scales; + int channelDim; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Timing.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Timing.aidl new file mode 100644 index 0000000000..bcc83cfbee --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/Timing.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.neuralnetworks; +@VintfStability +parcelable Timing { + long timeOnDeviceNs; + long timeInDriverNs; +} diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/TokenValuePair.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/TokenValuePair.aidl new file mode 100644 index 0000000000..e477d6e555 --- /dev/null +++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/4/android/hardware/neuralnetworks/TokenValuePair.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 -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.neuralnetworks; +@VintfStability +parcelable TokenValuePair { + int token; + byte[] value; +} diff --git a/radio/aidl/Android.bp b/radio/aidl/Android.bp index c5a3a8bb81..24764307f1 100644 --- a/radio/aidl/Android.bp +++ b/radio/aidl/Android.bp @@ -46,6 +46,13 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.radio-V1"], + }, + ], + } aidl_interface { @@ -67,6 +74,13 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.radio-V1"], + }, + ], + } aidl_interface { @@ -109,6 +123,13 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.radio-V1"], + }, + ], + } aidl_interface { @@ -130,6 +151,13 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.radio-V1"], + }, + ], + } aidl_interface { @@ -154,6 +182,16 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.radio-V1", + "android.hardware.radio.config-V1", + ], + }, + ], + } aidl_interface { @@ -175,4 +213,11 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.radio-V1"], + }, + ], + } diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.config/1/.hash new file mode 100644 index 0000000000..4d5fc89ef3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/1/.hash @@ -0,0 +1 @@ +6e0b1fb58d66a76df8f46a1a6dae5c346ea17d7b diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/IRadioConfig.aidl new file mode 100644 index 0000000000..a48a89b458 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/IRadioConfig.aidl @@ -0,0 +1,53 @@ +/* + * 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 interface is used by telephony and telecom to talk to cellular radio for the purpose of + * radio configuration, and it is not associated with any specific modem or slot. + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.config; +@VintfStability +interface IRadioConfig { + oneway void getHalDeviceCapabilities(in int serial); + oneway void getNumOfLiveModems(in int serial); + oneway void getPhoneCapability(in int serial); + oneway void getSimSlotsStatus(in int serial); + oneway void setNumOfLiveModems(in int serial, in byte numOfLiveModems); + oneway void setPreferredDataModem(in int serial, in byte modemId); + oneway void setResponseFunctions(in android.hardware.radio.config.IRadioConfigResponse radioConfigResponse, in android.hardware.radio.config.IRadioConfigIndication radioConfigIndication); + oneway void setSimSlotsMapping(in int serial, in android.hardware.radio.config.SlotPortMapping[] slotMap); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/IRadioConfigIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/IRadioConfigIndication.aidl new file mode 100644 index 0000000000..994e337c04 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/IRadioConfigIndication.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 -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.config; +@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/1/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/IRadioConfigResponse.aidl new file mode 100644 index 0000000000..038b0aeb58 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/IRadioConfigResponse.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 -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.config; +@VintfStability +interface IRadioConfigResponse { + oneway void getHalDeviceCapabilitiesResponse(in android.hardware.radio.RadioResponseInfo info, in boolean modemReducedFeatureSet1); + oneway void getNumOfLiveModemsResponse(in android.hardware.radio.RadioResponseInfo info, in byte numOfLiveModems); + oneway void getPhoneCapabilityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.config.PhoneCapability phoneCapability); + oneway void getSimSlotsStatusResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.config.SimSlotStatus[] slotStatus); + oneway void setNumOfLiveModemsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setPreferredDataModemResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSimSlotsMappingResponse(in android.hardware.radio.RadioResponseInfo info); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/PhoneCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/PhoneCapability.aidl new file mode 100644 index 0000000000..c60200ce13 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/PhoneCapability.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 -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.config; +@VintfStability +parcelable PhoneCapability { + byte maxActiveData; + byte maxActiveInternetData; + boolean isInternetLingeringSupported; + byte[] logicalModemIds; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimPortInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimPortInfo.aidl new file mode 100644 index 0000000000..5cc90176ac --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimPortInfo.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 -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.config; +@VintfStability +parcelable SimPortInfo { + String iccId; + int logicalSlotId; + boolean portActive; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimSlotStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimSlotStatus.aidl new file mode 100644 index 0000000000..bc7f63ca9a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimSlotStatus.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 -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.config; +@VintfStability +parcelable SimSlotStatus { + int cardState; + String atr; + String eid; + android.hardware.radio.config.SimPortInfo[] portInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SlotPortMapping.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SlotPortMapping.aidl new file mode 100644 index 0000000000..f38c4213d0 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SlotPortMapping.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 -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.config; +@VintfStability +parcelable SlotPortMapping { + int physicalSlotId; + int portId; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.data/1/.hash new file mode 100644 index 0000000000..986768a0e1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/.hash @@ -0,0 +1 @@ +21e60e4149e36bed0fe2af962995f021e88a1da7 diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnAuthType.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnAuthType.aidl new file mode 100644 index 0000000000..929cfe3ccf --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnAuthType.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 -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.data; +@Backing(type="int") @VintfStability +enum ApnAuthType { + NO_PAP_NO_CHAP = 0, + PAP_NO_CHAP = 1, + NO_PAP_CHAP = 2, + PAP_CHAP = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnTypes.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnTypes.aidl new file mode 100644 index 0000000000..980b042cdf --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnTypes.aidl @@ -0,0 +1,53 @@ +/* + * 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 -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.data; +@Backing(type="int") @VintfStability +enum ApnTypes { + NONE = 0, + DEFAULT = 1, + MMS = 2, + SUPL = 4, + DUN = 8, + HIPRI = 16, + FOTA = 32, + IMS = 64, + CBS = 128, + IA = 256, + EMERGENCY = 512, + MCX = 1024, + XCAP = 2048, + VSIM = 4096, + BIP = 8192, + ENTERPRISE = 16384, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataCallFailCause.aidl new file mode 100644 index 0000000000..6130e71a1a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataCallFailCause.aidl @@ -0,0 +1,377 @@ +/* + * 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 -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.data; +@Backing(type="int") @VintfStability +enum DataCallFailCause { + NONE = 0, + OPERATOR_BARRED = 8, + NAS_SIGNALLING = 14, + INSUFFICIENT_RESOURCES = 26, + MISSING_UNKNOWN_APN = 27, + UNKNOWN_PDP_ADDRESS_TYPE = 28, + USER_AUTHENTICATION = 29, + ACTIVATION_REJECT_GGSN = 30, + ACTIVATION_REJECT_UNSPECIFIED = 31, + SERVICE_OPTION_NOT_SUPPORTED = 32, + SERVICE_OPTION_NOT_SUBSCRIBED = 33, + SERVICE_OPTION_OUT_OF_ORDER = 34, + NSAPI_IN_USE = 35, + REGULAR_DEACTIVATION = 36, + QOS_NOT_ACCEPTED = 37, + NETWORK_FAILURE = 38, + UMTS_REACTIVATION_REQ = 39, + FEATURE_NOT_SUPP = 40, + TFT_SEMANTIC_ERROR = 41, + TFT_SYTAX_ERROR = 42, + UNKNOWN_PDP_CONTEXT = 43, + FILTER_SEMANTIC_ERROR = 44, + FILTER_SYTAX_ERROR = 45, + PDP_WITHOUT_ACTIVE_TFT = 46, + ONLY_IPV4_ALLOWED = 50, + ONLY_IPV6_ALLOWED = 51, + ONLY_SINGLE_BEARER_ALLOWED = 52, + ESM_INFO_NOT_RECEIVED = 53, + PDN_CONN_DOES_NOT_EXIST = 54, + MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 55, + MAX_ACTIVE_PDP_CONTEXT_REACHED = 65, + UNSUPPORTED_APN_IN_CURRENT_PLMN = 66, + INVALID_TRANSACTION_ID = 81, + MESSAGE_INCORRECT_SEMANTIC = 95, + INVALID_MANDATORY_INFO = 96, + MESSAGE_TYPE_UNSUPPORTED = 97, + MSG_TYPE_NONCOMPATIBLE_STATE = 98, + UNKNOWN_INFO_ELEMENT = 99, + CONDITIONAL_IE_ERROR = 100, + MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 101, + PROTOCOL_ERRORS = 111, + APN_TYPE_CONFLICT = 112, + INVALID_PCSCF_ADDR = 113, + INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 114, + EMM_ACCESS_BARRED = 115, + EMERGENCY_IFACE_ONLY = 116, + IFACE_MISMATCH = 117, + COMPANION_IFACE_IN_USE = 118, + IP_ADDRESS_MISMATCH = 119, + IFACE_AND_POL_FAMILY_MISMATCH = 120, + EMM_ACCESS_BARRED_INFINITE_RETRY = 121, + AUTH_FAILURE_ON_EMERGENCY_CALL = 122, + OEM_DCFAILCAUSE_1 = 4097, + OEM_DCFAILCAUSE_2 = 4098, + OEM_DCFAILCAUSE_3 = 4099, + OEM_DCFAILCAUSE_4 = 4100, + OEM_DCFAILCAUSE_5 = 4101, + OEM_DCFAILCAUSE_6 = 4102, + OEM_DCFAILCAUSE_7 = 4103, + OEM_DCFAILCAUSE_8 = 4104, + OEM_DCFAILCAUSE_9 = 4105, + OEM_DCFAILCAUSE_10 = 4106, + OEM_DCFAILCAUSE_11 = 4107, + OEM_DCFAILCAUSE_12 = 4108, + OEM_DCFAILCAUSE_13 = 4109, + OEM_DCFAILCAUSE_14 = 4110, + OEM_DCFAILCAUSE_15 = 4111, + VOICE_REGISTRATION_FAIL = -1, + DATA_REGISTRATION_FAIL = -2, + SIGNAL_LOST = -3, + PREF_RADIO_TECH_CHANGED = -4, + RADIO_POWER_OFF = -5, + TETHERED_CALL_ACTIVE = -6, + ERROR_UNSPECIFIED = 65535, + LLC_SNDCP = 25, + ACTIVATION_REJECTED_BCM_VIOLATION = 48, + COLLISION_WITH_NETWORK_INITIATED_REQUEST = 56, + ONLY_IPV4V6_ALLOWED = 57, + ONLY_NON_IP_ALLOWED = 58, + UNSUPPORTED_QCI_VALUE = 59, + BEARER_HANDLING_NOT_SUPPORTED = 60, + INVALID_DNS_ADDR = 123, + INVALID_PCSCF_OR_DNS_ADDRESS = 124, + CALL_PREEMPT_BY_EMERGENCY_APN = 127, + UE_INITIATED_DETACH_OR_DISCONNECT = 128, + MIP_FA_REASON_UNSPECIFIED = 2000, + MIP_FA_ADMIN_PROHIBITED = 2001, + MIP_FA_INSUFFICIENT_RESOURCES = 2002, + MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE = 2003, + MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE = 2004, + MIP_FA_REQUESTED_LIFETIME_TOO_LONG = 2005, + MIP_FA_MALFORMED_REQUEST = 2006, + MIP_FA_MALFORMED_REPLY = 2007, + MIP_FA_ENCAPSULATION_UNAVAILABLE = 2008, + MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE = 2009, + MIP_FA_REVERSE_TUNNEL_UNAVAILABLE = 2010, + MIP_FA_REVERSE_TUNNEL_IS_MANDATORY = 2011, + MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED = 2012, + MIP_FA_MISSING_NAI = 2013, + MIP_FA_MISSING_HOME_AGENT = 2014, + MIP_FA_MISSING_HOME_ADDRESS = 2015, + MIP_FA_UNKNOWN_CHALLENGE = 2016, + MIP_FA_MISSING_CHALLENGE = 2017, + MIP_FA_STALE_CHALLENGE = 2018, + MIP_HA_REASON_UNSPECIFIED = 2019, + MIP_HA_ADMIN_PROHIBITED = 2020, + MIP_HA_INSUFFICIENT_RESOURCES = 2021, + MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE = 2022, + MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE = 2023, + MIP_HA_REGISTRATION_ID_MISMATCH = 2024, + MIP_HA_MALFORMED_REQUEST = 2025, + MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS = 2026, + MIP_HA_REVERSE_TUNNEL_UNAVAILABLE = 2027, + MIP_HA_REVERSE_TUNNEL_IS_MANDATORY = 2028, + MIP_HA_ENCAPSULATION_UNAVAILABLE = 2029, + CLOSE_IN_PROGRESS = 2030, + NETWORK_INITIATED_TERMINATION = 2031, + MODEM_APP_PREEMPTED = 2032, + PDN_IPV4_CALL_DISALLOWED = 2033, + PDN_IPV4_CALL_THROTTLED = 2034, + PDN_IPV6_CALL_DISALLOWED = 2035, + PDN_IPV6_CALL_THROTTLED = 2036, + MODEM_RESTART = 2037, + PDP_PPP_NOT_SUPPORTED = 2038, + UNPREFERRED_RAT = 2039, + PHYSICAL_LINK_CLOSE_IN_PROGRESS = 2040, + APN_PENDING_HANDOVER = 2041, + PROFILE_BEARER_INCOMPATIBLE = 2042, + SIM_CARD_CHANGED = 2043, + LOW_POWER_MODE_OR_POWERING_DOWN = 2044, + APN_DISABLED = 2045, + MAX_PPP_INACTIVITY_TIMER_EXPIRED = 2046, + IPV6_ADDRESS_TRANSFER_FAILED = 2047, + TRAT_SWAP_FAILED = 2048, + EHRPD_TO_HRPD_FALLBACK = 2049, + MIP_CONFIG_FAILURE = 2050, + PDN_INACTIVITY_TIMER_EXPIRED = 2051, + MAX_IPV4_CONNECTIONS = 2052, + MAX_IPV6_CONNECTIONS = 2053, + APN_MISMATCH = 2054, + IP_VERSION_MISMATCH = 2055, + DUN_CALL_DISALLOWED = 2056, + INTERNAL_EPC_NONEPC_TRANSITION = 2057, + INTERFACE_IN_USE = 2058, + APN_DISALLOWED_ON_ROAMING = 2059, + APN_PARAMETERS_CHANGED = 2060, + NULL_APN_DISALLOWED = 2061, + THERMAL_MITIGATION = 2062, + DATA_SETTINGS_DISABLED = 2063, + DATA_ROAMING_SETTINGS_DISABLED = 2064, + DDS_SWITCHED = 2065, + FORBIDDEN_APN_NAME = 2066, + DDS_SWITCH_IN_PROGRESS = 2067, + CALL_DISALLOWED_IN_ROAMING = 2068, + NON_IP_NOT_SUPPORTED = 2069, + PDN_NON_IP_CALL_THROTTLED = 2070, + PDN_NON_IP_CALL_DISALLOWED = 2071, + CDMA_LOCK = 2072, + CDMA_INTERCEPT = 2073, + CDMA_REORDER = 2074, + CDMA_RELEASE_DUE_TO_SO_REJECTION = 2075, + CDMA_INCOMING_CALL = 2076, + CDMA_ALERT_STOP = 2077, + CHANNEL_ACQUISITION_FAILURE = 2078, + MAX_ACCESS_PROBE = 2079, + CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION = 2080, + NO_RESPONSE_FROM_BASE_STATION = 2081, + REJECTED_BY_BASE_STATION = 2082, + CONCURRENT_SERVICES_INCOMPATIBLE = 2083, + NO_CDMA_SERVICE = 2084, + RUIM_NOT_PRESENT = 2085, + CDMA_RETRY_ORDER = 2086, + ACCESS_BLOCK = 2087, + ACCESS_BLOCK_ALL = 2088, + IS707B_MAX_ACCESS_PROBES = 2089, + THERMAL_EMERGENCY = 2090, + CONCURRENT_SERVICES_NOT_ALLOWED = 2091, + INCOMING_CALL_REJECTED = 2092, + NO_SERVICE_ON_GATEWAY = 2093, + NO_GPRS_CONTEXT = 2094, + ILLEGAL_MS = 2095, + ILLEGAL_ME = 2096, + GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 2097, + GPRS_SERVICES_NOT_ALLOWED = 2098, + MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK = 2099, + IMPLICITLY_DETACHED = 2100, + PLMN_NOT_ALLOWED = 2101, + LOCATION_AREA_NOT_ALLOWED = 2102, + GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = 2103, + PDP_DUPLICATE = 2104, + UE_RAT_CHANGE = 2105, + CONGESTION = 2106, + NO_PDP_CONTEXT_ACTIVATED = 2107, + ACCESS_CLASS_DSAC_REJECTION = 2108, + PDP_ACTIVATE_MAX_RETRY_FAILED = 2109, + RADIO_ACCESS_BEARER_FAILURE = 2110, + ESM_UNKNOWN_EPS_BEARER_CONTEXT = 2111, + DRB_RELEASED_BY_RRC = 2112, + CONNECTION_RELEASED = 2113, + EMM_DETACHED = 2114, + EMM_ATTACH_FAILED = 2115, + EMM_ATTACH_STARTED = 2116, + LTE_NAS_SERVICE_REQUEST_FAILED = 2117, + DUPLICATE_BEARER_ID = 2118, + ESM_COLLISION_SCENARIOS = 2119, + ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK = 2120, + ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER = 2121, + ESM_BAD_OTA_MESSAGE = 2122, + ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL = 2123, + ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT = 2124, + DS_EXPLICIT_DEACTIVATION = 2125, + ESM_LOCAL_CAUSE_NONE = 2126, + LTE_THROTTLING_NOT_REQUIRED = 2127, + ACCESS_CONTROL_LIST_CHECK_FAILURE = 2128, + SERVICE_NOT_ALLOWED_ON_PLMN = 2129, + EMM_T3417_EXPIRED = 2130, + EMM_T3417_EXT_EXPIRED = 2131, + RRC_UPLINK_DATA_TRANSMISSION_FAILURE = 2132, + RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER = 2133, + RRC_UPLINK_CONNECTION_RELEASE = 2134, + RRC_UPLINK_RADIO_LINK_FAILURE = 2135, + RRC_UPLINK_ERROR_REQUEST_FROM_NAS = 2136, + RRC_CONNECTION_ACCESS_STRATUM_FAILURE = 2137, + RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS = 2138, + RRC_CONNECTION_ACCESS_BARRED = 2139, + RRC_CONNECTION_CELL_RESELECTION = 2140, + RRC_CONNECTION_CONFIG_FAILURE = 2141, + RRC_CONNECTION_TIMER_EXPIRED = 2142, + RRC_CONNECTION_LINK_FAILURE = 2143, + RRC_CONNECTION_CELL_NOT_CAMPED = 2144, + RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE = 2145, + RRC_CONNECTION_REJECT_BY_NETWORK = 2146, + RRC_CONNECTION_NORMAL_RELEASE = 2147, + RRC_CONNECTION_RADIO_LINK_FAILURE = 2148, + RRC_CONNECTION_REESTABLISHMENT_FAILURE = 2149, + RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER = 2150, + RRC_CONNECTION_ABORT_REQUEST = 2151, + RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR = 2152, + NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH = 2153, + NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH = 2154, + ESM_PROCEDURE_TIME_OUT = 2155, + INVALID_CONNECTION_ID = 2156, + MAXIMIUM_NSAPIS_EXCEEDED = 2157, + INVALID_PRIMARY_NSAPI = 2158, + CANNOT_ENCODE_OTA_MESSAGE = 2159, + RADIO_ACCESS_BEARER_SETUP_FAILURE = 2160, + PDP_ESTABLISH_TIMEOUT_EXPIRED = 2161, + PDP_MODIFY_TIMEOUT_EXPIRED = 2162, + PDP_INACTIVE_TIMEOUT_EXPIRED = 2163, + PDP_LOWERLAYER_ERROR = 2164, + PDP_MODIFY_COLLISION = 2165, + MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 2166, + NAS_REQUEST_REJECTED_BY_NETWORK = 2167, + RRC_CONNECTION_INVALID_REQUEST = 2168, + RRC_CONNECTION_TRACKING_AREA_ID_CHANGED = 2169, + RRC_CONNECTION_RF_UNAVAILABLE = 2170, + RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE = 2171, + RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE = 2172, + RRC_CONNECTION_ABORTED_AFTER_HANDOVER = 2173, + RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE = 2174, + RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE = 2175, + IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER = 2176, + IMEI_NOT_ACCEPTED = 2177, + EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = 2178, + EPS_SERVICES_NOT_ALLOWED_IN_PLMN = 2179, + MSC_TEMPORARILY_NOT_REACHABLE = 2180, + CS_DOMAIN_NOT_AVAILABLE = 2181, + ESM_FAILURE = 2182, + MAC_FAILURE = 2183, + SYNCHRONIZATION_FAILURE = 2184, + UE_SECURITY_CAPABILITIES_MISMATCH = 2185, + SECURITY_MODE_REJECTED = 2186, + UNACCEPTABLE_NON_EPS_AUTHENTICATION = 2187, + CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED = 2188, + NO_EPS_BEARER_CONTEXT_ACTIVATED = 2189, + INVALID_EMM_STATE = 2190, + NAS_LAYER_FAILURE = 2191, + MULTIPLE_PDP_CALL_NOT_ALLOWED = 2192, + EMBMS_NOT_ENABLED = 2193, + IRAT_HANDOVER_FAILED = 2194, + EMBMS_REGULAR_DEACTIVATION = 2195, + TEST_LOOPBACK_REGULAR_DEACTIVATION = 2196, + LOWER_LAYER_REGISTRATION_FAILURE = 2197, + DATA_PLAN_EXPIRED = 2198, + UMTS_HANDOVER_TO_IWLAN = 2199, + EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY = 2200, + EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE = 2201, + EVDO_HDR_CHANGED = 2202, + EVDO_HDR_EXITED = 2203, + EVDO_HDR_NO_SESSION = 2204, + EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL = 2205, + EVDO_HDR_CONNECTION_SETUP_TIMEOUT = 2206, + FAILED_TO_ACQUIRE_COLOCATED_HDR = 2207, + OTASP_COMMIT_IN_PROGRESS = 2208, + NO_HYBRID_HDR_SERVICE = 2209, + HDR_NO_LOCK_GRANTED = 2210, + DBM_OR_SMS_IN_PROGRESS = 2211, + HDR_FADE = 2212, + HDR_ACCESS_FAILURE = 2213, + UNSUPPORTED_1X_PREV = 2214, + LOCAL_END = 2215, + NO_SERVICE = 2216, + FADE = 2217, + NORMAL_RELEASE = 2218, + ACCESS_ATTEMPT_ALREADY_IN_PROGRESS = 2219, + REDIRECTION_OR_HANDOFF_IN_PROGRESS = 2220, + EMERGENCY_MODE = 2221, + PHONE_IN_USE = 2222, + INVALID_MODE = 2223, + INVALID_SIM_STATE = 2224, + NO_COLLOCATED_HDR = 2225, + UE_IS_ENTERING_POWERSAVE_MODE = 2226, + DUAL_SWITCH = 2227, + PPP_TIMEOUT = 2228, + PPP_AUTH_FAILURE = 2229, + PPP_OPTION_MISMATCH = 2230, + PPP_PAP_FAILURE = 2231, + PPP_CHAP_FAILURE = 2232, + PPP_CLOSE_IN_PROGRESS = 2233, + LIMITED_TO_IPV4 = 2234, + LIMITED_TO_IPV6 = 2235, + VSNCP_TIMEOUT = 2236, + VSNCP_GEN_ERROR = 2237, + VSNCP_APN_UNAUTHORIZED = 2238, + VSNCP_PDN_LIMIT_EXCEEDED = 2239, + VSNCP_NO_PDN_GATEWAY_ADDRESS = 2240, + VSNCP_PDN_GATEWAY_UNREACHABLE = 2241, + VSNCP_PDN_GATEWAY_REJECT = 2242, + VSNCP_INSUFFICIENT_PARAMETERS = 2243, + VSNCP_RESOURCE_UNAVAILABLE = 2244, + VSNCP_ADMINISTRATIVELY_PROHIBITED = 2245, + VSNCP_PDN_ID_IN_USE = 2246, + VSNCP_SUBSCRIBER_LIMITATION = 2247, + VSNCP_PDN_EXISTS_FOR_THIS_APN = 2248, + VSNCP_RECONNECT_NOT_ALLOWED = 2249, + IPV6_PREFIX_UNAVAILABLE = 2250, + HANDOFF_PREFERENCE_CHANGED = 2251, + SLICE_REJECTED = 2252, + MATCH_ALL_RULE_NOT_ALLOWED = 2253, + ALL_MATCHING_RULES_FAILED = 2254, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataProfileInfo.aidl new file mode 100644 index 0000000000..02bbf21ef3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataProfileInfo.aidl @@ -0,0 +1,67 @@ +/* + * 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 -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.data; +@VintfStability +parcelable DataProfileInfo { + int profileId; + String apn; + android.hardware.radio.data.PdpProtocolType protocol; + android.hardware.radio.data.PdpProtocolType roamingProtocol; + android.hardware.radio.data.ApnAuthType authType; + String user; + String password; + int type; + int maxConnsTime; + int maxConns; + int waitTime; + boolean enabled; + int supportedApnTypesBitmap; + int bearerBitmap; + int mtuV4; + int mtuV6; + boolean preferred; + boolean persistent; + boolean alwaysOn; + android.hardware.radio.data.TrafficDescriptor trafficDescriptor; + const int ID_DEFAULT = 0; + const int ID_TETHERED = 1; + const int ID_IMS = 2; + const int ID_FOTA = 3; + const int ID_CBS = 4; + const int ID_OEM_BASE = 1000; + const int ID_INVALID = -1; + const int TYPE_COMMON = 0; + const int TYPE_3GPP = 1; + const int TYPE_3GPP2 = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataRequestReason.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataRequestReason.aidl new file mode 100644 index 0000000000..c94fa6f604 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataRequestReason.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 -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.data; +@Backing(type="int") @VintfStability +enum DataRequestReason { + NORMAL = 1, + SHUTDOWN = 2, + HANDOVER = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataThrottlingAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataThrottlingAction.aidl new file mode 100644 index 0000000000..c0ade454dd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataThrottlingAction.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 -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.data; +@Backing(type="byte") @VintfStability +enum DataThrottlingAction { + NO_DATA_THROTTLING = 0, + THROTTLE_SECONDARY_CARRIER = 1, + THROTTLE_ANCHOR_CARRIER = 2, + HOLD = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/EpsQos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/EpsQos.aidl new file mode 100644 index 0000000000..36367315d6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/EpsQos.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 -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.data; +@VintfStability +parcelable EpsQos { + int qci; + android.hardware.radio.data.QosBandwidth downlink; + android.hardware.radio.data.QosBandwidth uplink; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/IRadioData.aidl new file mode 100644 index 0000000000..7b572f1f8e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/IRadioData.aidl @@ -0,0 +1,53 @@ +/* + * 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 -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.data; +@VintfStability +interface IRadioData { + oneway void allocatePduSessionId(in int serial); + oneway void cancelHandover(in int serial, in int callId); + oneway void deactivateDataCall(in int serial, in int cid, in android.hardware.radio.data.DataRequestReason reason); + oneway void getDataCallList(in int serial); + oneway void getSlicingConfig(in int serial); + oneway void releasePduSessionId(in int serial, in int id); + oneway void responseAcknowledgement(); + oneway void setDataAllowed(in int serial, in boolean allow); + oneway void setDataProfile(in int serial, in android.hardware.radio.data.DataProfileInfo[] profiles); + oneway void setDataThrottling(in int serial, in android.hardware.radio.data.DataThrottlingAction dataThrottlingAction, in long completionDurationMillis); + oneway void setInitialAttachApn(in int serial, in @nullable android.hardware.radio.data.DataProfileInfo dataProfileInfo); + oneway void setResponseFunctions(in android.hardware.radio.data.IRadioDataResponse radioDataResponse, in android.hardware.radio.data.IRadioDataIndication radioDataIndication); + oneway void setupDataCall(in int serial, in android.hardware.radio.AccessNetwork accessNetwork, in android.hardware.radio.data.DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in android.hardware.radio.data.DataRequestReason reason, in android.hardware.radio.data.LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in @nullable android.hardware.radio.data.SliceInfo sliceInfo, in boolean matchAllRuleAllowed); + oneway void startHandover(in int serial, in int callId); + oneway void startKeepalive(in int serial, in android.hardware.radio.data.KeepaliveRequest keepalive); + oneway void stopKeepalive(in int serial, in int sessionHandle); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/IRadioDataIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/IRadioDataIndication.aidl new file mode 100644 index 0000000000..0ffa1f7ddf --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/IRadioDataIndication.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 -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.data; +@VintfStability +interface IRadioDataIndication { + oneway void dataCallListChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.SetupDataCallResult[] dcList); + oneway void keepaliveStatus(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.KeepaliveStatus status); + oneway void pcoData(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.PcoDataInfo pco); + oneway void unthrottleApn(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.DataProfileInfo dataProfileInfo); + oneway void slicingConfigChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.SlicingConfig slicingConfig); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/IRadioDataResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/IRadioDataResponse.aidl new file mode 100644 index 0000000000..4edc17d4ad --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/IRadioDataResponse.aidl @@ -0,0 +1,52 @@ +/* + * 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 -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.data; +@VintfStability +interface IRadioDataResponse { + oneway void acknowledgeRequest(in int serial); + oneway void allocatePduSessionIdResponse(in android.hardware.radio.RadioResponseInfo info, in int id); + oneway void cancelHandoverResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void deactivateDataCallResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getDataCallListResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.data.SetupDataCallResult[] dcResponse); + oneway void getSlicingConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.data.SlicingConfig slicingConfig); + oneway void releasePduSessionIdResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setDataAllowedResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setDataProfileResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setDataThrottlingResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setInitialAttachApnResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setupDataCallResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.data.SetupDataCallResult dcResponse); + oneway void startHandoverResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void startKeepaliveResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.data.KeepaliveStatus status); + oneway void stopKeepaliveResponse(in android.hardware.radio.RadioResponseInfo info); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveRequest.aidl new file mode 100644 index 0000000000..788adfbfde --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveRequest.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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.data; +@VintfStability +parcelable KeepaliveRequest { + int type; + byte[] sourceAddress; + int sourcePort; + byte[] destinationAddress; + int destinationPort; + int maxKeepaliveIntervalMillis; + int cid; + const int TYPE_NATT_IPV4 = 0; + const int TYPE_NATT_IPV6 = 1; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveStatus.aidl new file mode 100644 index 0000000000..4729b8e194 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveStatus.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 -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.data; +@VintfStability +parcelable KeepaliveStatus { + int sessionHandle; + int code; + const int CODE_ACTIVE = 0; + const int CODE_INACTIVE = 1; + const int CODE_PENDING = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/LinkAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/LinkAddress.aidl new file mode 100644 index 0000000000..9aee44c4fc --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/LinkAddress.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 -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.data; +@VintfStability +parcelable LinkAddress { + String address; + int addressProperties; + long deprecationTime; + long expirationTime; + const int ADDRESS_PROPERTY_NONE = 0; + const int ADDRESS_PROPERTY_DEPRECATED = 32; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/NrQos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/NrQos.aidl new file mode 100644 index 0000000000..a8a169635e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/NrQos.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 -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.data; +@VintfStability +parcelable NrQos { + int fiveQi; + android.hardware.radio.data.QosBandwidth downlink; + android.hardware.radio.data.QosBandwidth uplink; + byte qfi; + char averagingWindowMs; + const byte FLOW_ID_RANGE_MIN = 1; + const byte FLOW_ID_RANGE_MAX = 63; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/OsAppId.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/OsAppId.aidl new file mode 100644 index 0000000000..205b1e92bd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/OsAppId.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 -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.data; +@VintfStability +parcelable OsAppId { + byte[] osAppId; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PcoDataInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PcoDataInfo.aidl new file mode 100644 index 0000000000..edfa7592df --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PcoDataInfo.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 -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.data; +@VintfStability +parcelable PcoDataInfo { + int cid; + String bearerProto; + int pcoId; + byte[] contents; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PdpProtocolType.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PdpProtocolType.aidl new file mode 100644 index 0000000000..363cdf30b9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PdpProtocolType.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 -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.data; +@Backing(type="int") @VintfStability +enum PdpProtocolType { + UNKNOWN = -1, + IP = 0, + IPV6 = 1, + IPV4V6 = 2, + PPP = 3, + NON_IP = 4, + UNSTRUCTURED = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PortRange.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PortRange.aidl new file mode 100644 index 0000000000..f3749ed7ac --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PortRange.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 -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.data; +@VintfStability +parcelable PortRange { + int start; + int end; + const int PORT_RANGE_MIN = 20; + const int PORT_RANGE_MAX = 65535; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/Qos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/Qos.aidl new file mode 100644 index 0000000000..1981721b5b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/Qos.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 -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.data; +@VintfStability +union Qos { + boolean noinit; + android.hardware.radio.data.EpsQos eps; + android.hardware.radio.data.NrQos nr; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosBandwidth.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosBandwidth.aidl new file mode 100644 index 0000000000..d7ebe100bd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosBandwidth.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 -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.data; +@VintfStability +parcelable QosBandwidth { + int maxBitrateKbps; + int guaranteedBitrateKbps; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilter.aidl new file mode 100644 index 0000000000..b9098f7f88 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilter.aidl @@ -0,0 +1,55 @@ +/* + * 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 -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.data; +@VintfStability +parcelable QosFilter { + String[] localAddresses; + String[] remoteAddresses; + @nullable android.hardware.radio.data.PortRange localPort; + @nullable android.hardware.radio.data.PortRange remotePort; + byte protocol; + android.hardware.radio.data.QosFilterTypeOfService tos; + android.hardware.radio.data.QosFilterIpv6FlowLabel flowLabel; + android.hardware.radio.data.QosFilterIpsecSpi spi; + byte direction; + int precedence; + const byte DIRECTION_DOWNLINK = 0; + const byte DIRECTION_UPLINK = 1; + const byte DIRECTION_BIDIRECTIONAL = 2; + const byte PROTOCOL_UNSPECIFIED = -1; + const byte PROTOCOL_TCP = 6; + const byte PROTOCOL_UDP = 17; + const byte PROTOCOL_ESP = 50; + const byte PROTOCOL_AH = 51; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpsecSpi.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpsecSpi.aidl new file mode 100644 index 0000000000..565e49904e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpsecSpi.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 -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.data; +@VintfStability +union QosFilterIpsecSpi { + boolean noinit; + int value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl new file mode 100644 index 0000000000..16117b252b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpv6FlowLabel.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 -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.data; +@VintfStability +union QosFilterIpv6FlowLabel { + boolean noinit; + int value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterTypeOfService.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterTypeOfService.aidl new file mode 100644 index 0000000000..95fda167f5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterTypeOfService.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 -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.data; +@VintfStability +union QosFilterTypeOfService { + boolean noinit; + byte value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosSession.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosSession.aidl new file mode 100644 index 0000000000..53dcef0131 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosSession.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 -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.data; +@VintfStability +parcelable QosSession { + int qosSessionId; + android.hardware.radio.data.Qos qos; + android.hardware.radio.data.QosFilter[] qosFilters; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/RouteSelectionDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/RouteSelectionDescriptor.aidl new file mode 100644 index 0000000000..02596a1f63 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/RouteSelectionDescriptor.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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.data; +@VintfStability +parcelable RouteSelectionDescriptor { + byte precedence; + android.hardware.radio.data.PdpProtocolType sessionType; + byte sscMode; + android.hardware.radio.data.SliceInfo[] sliceInfo; + String[] dnn; + const byte SSC_MODE_UNKNOWN = -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/1/android/hardware/radio/data/SetupDataCallResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SetupDataCallResult.aidl new file mode 100644 index 0000000000..ff2459c0b2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SetupDataCallResult.aidl @@ -0,0 +1,62 @@ +/* + * 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 -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.data; +@VintfStability +parcelable SetupDataCallResult { + android.hardware.radio.data.DataCallFailCause cause; + long suggestedRetryTime; + int cid; + int active; + android.hardware.radio.data.PdpProtocolType type; + String ifname; + android.hardware.radio.data.LinkAddress[] addresses; + String[] dnses; + String[] gateways; + String[] pcscf; + int mtuV4; + int mtuV6; + android.hardware.radio.data.Qos defaultQos; + android.hardware.radio.data.QosSession[] qosSessions; + byte handoverFailureMode; + int pduSessionId; + @nullable android.hardware.radio.data.SliceInfo sliceInfo; + android.hardware.radio.data.TrafficDescriptor[] trafficDescriptors; + const int DATA_CONNECTION_STATUS_INACTIVE = 0; + const int DATA_CONNECTION_STATUS_DORMANT = 1; + const int DATA_CONNECTION_STATUS_ACTIVE = 2; + const byte HANDOVER_FAILURE_MODE_LEGACY = 0; + const byte HANDOVER_FAILURE_MODE_DO_FALLBACK = 1; + const byte HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_HANDOVER = 2; + const byte HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 3; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SliceInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SliceInfo.aidl new file mode 100644 index 0000000000..0dd8127e1d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SliceInfo.aidl @@ -0,0 +1,52 @@ +/* + * 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 -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.data; +@VintfStability +parcelable SliceInfo { + byte sliceServiceType; + int sliceDifferentiator; + byte mappedHplmnSst; + int mappedHplmnSd; + byte status; + const byte SERVICE_TYPE_NONE = 0; + const byte SERVICE_TYPE_EMBB = 1; + const byte SERVICE_TYPE_URLLC = 2; + const byte SERVICE_TYPE_MIOT = 3; + const byte STATUS_UNKNOWN = 0; + const byte STATUS_CONFIGURED = 1; + const byte STATUS_ALLOWED = 2; + const byte STATUS_REJECTED_NOT_AVAILABLE_IN_PLMN = 3; + const byte STATUS_REJECTED_NOT_AVAILABLE_IN_REG_AREA = 4; + const byte STATUS_DEFAULT_CONFIGURED = 5; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SlicingConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SlicingConfig.aidl new file mode 100644 index 0000000000..54e2f12171 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SlicingConfig.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 -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.data; +@VintfStability +parcelable SlicingConfig { + android.hardware.radio.data.UrspRule[] urspRules; + android.hardware.radio.data.SliceInfo[] sliceInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/TrafficDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/TrafficDescriptor.aidl new file mode 100644 index 0000000000..d5079c1d76 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/TrafficDescriptor.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 -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.data; +@VintfStability +parcelable TrafficDescriptor { + @nullable String dnn; + @nullable android.hardware.radio.data.OsAppId osAppId; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/UrspRule.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/UrspRule.aidl new file mode 100644 index 0000000000..c0be05426c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/UrspRule.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 -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.data; +@VintfStability +parcelable UrspRule { + int precedence; + android.hardware.radio.data.TrafficDescriptor[] trafficDescriptors; + android.hardware.radio.data.RouteSelectionDescriptor[] routeSelectionDescriptor; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/.hash new file mode 100644 index 0000000000..c70c2c86c9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/.hash @@ -0,0 +1 @@ +725d66fbe595788886858e33291c8a9048825f85 diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl new file mode 100644 index 0000000000..54e8a7b051 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.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 -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.messaging; +@VintfStability +parcelable CdmaBroadcastSmsConfigInfo { + int serviceCategory; + int language; + boolean selected; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAck.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAck.aidl new file mode 100644 index 0000000000..0de1688f98 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAck.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 -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.messaging; +@VintfStability +parcelable CdmaSmsAck { + boolean errorClass; + int smsCauseCode; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAddress.aidl new file mode 100644 index 0000000000..4a55745724 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAddress.aidl @@ -0,0 +1,68 @@ +/* + * 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 -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.messaging; +@VintfStability +parcelable CdmaSmsAddress { + int digitMode; + boolean isNumberModeDataNetwork; + int numberType; + int numberPlan; + byte[] digits; + const int DIGIT_MODE_FOUR_BIT = 0; + const int DIGIT_MODE_EIGHT_BIT = 1; + const int NUMBER_PLAN_UNKNOWN = 0; + const int NUMBER_PLAN_TELEPHONY = 1; + const int NUMBER_PLAN_RESERVED_2 = 2; + const int NUMBER_PLAN_DATA = 3; + const int NUMBER_PLAN_TELEX = 4; + const int NUMBER_PLAN_RESERVED_5 = 5; + const int NUMBER_PLAN_RESERVED_6 = 6; + const int NUMBER_PLAN_RESERVED_7 = 7; + const int NUMBER_PLAN_RESERVED_8 = 8; + const int NUMBER_PLAN_PRIVATE = 9; + const int NUMBER_PLAN_RESERVED_10 = 10; + const int NUMBER_PLAN_RESERVED_11 = 11; + const int NUMBER_PLAN_RESERVED_12 = 12; + const int NUMBER_PLAN_RESERVED_13 = 13; + const int NUMBER_PLAN_RESERVED_14 = 14; + const int NUMBER_PLAN_RESERVED_15 = 15; + const int NUMBER_TYPE_UNKNOWN = 0; + const int NUMBER_TYPE_INTERNATIONAL_OR_DATA_IP = 1; + const int NUMBER_TYPE_NATIONAL_OR_INTERNET_MAIL = 2; + const int NUMBER_TYPE_NETWORK = 3; + const int NUMBER_TYPE_SUBSCRIBER = 4; + const int NUMBER_TYPE_ALPHANUMERIC = 5; + const int NUMBER_TYPE_ABBREVIATED = 6; + const int NUMBER_TYPE_RESERVED_7 = 7; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsMessage.aidl new file mode 100644 index 0000000000..fdb74fb49b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsMessage.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 -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.messaging; +@VintfStability +parcelable CdmaSmsMessage { + int teleserviceId; + boolean isServicePresent; + int serviceCategory; + android.hardware.radio.messaging.CdmaSmsAddress address; + android.hardware.radio.messaging.CdmaSmsSubaddress subAddress; + byte[] bearerData; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl new file mode 100644 index 0000000000..deb1102f0d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsSubaddress.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 -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.messaging; +@VintfStability +parcelable CdmaSmsSubaddress { + int subaddressType; + boolean odd; + byte[] digits; + const int SUBADDRESS_TYPE_NSAP = 0; + const int SUBADDRESS_TYPE_USER_SPECIFIED = 1; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl new file mode 100644 index 0000000000..4969663834 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsWriteArgs.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 -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.messaging; +@VintfStability +parcelable CdmaSmsWriteArgs { + int status; + android.hardware.radio.messaging.CdmaSmsMessage message; + const int STATUS_REC_UNREAD = 0; + const int STATUS_REC_READ = 1; + const int STATUS_STO_UNSENT = 2; + const int STATUS_STO_SENT = 3; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl new file mode 100644 index 0000000000..6cc7636f79 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.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 -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.messaging; +@VintfStability +parcelable GsmBroadcastSmsConfigInfo { + int fromServiceId; + int toServiceId; + int fromCodeScheme; + int toCodeScheme; + boolean selected; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmSmsMessage.aidl new file mode 100644 index 0000000000..2937d5ca79 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmSmsMessage.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 -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.messaging; +@VintfStability +parcelable GsmSmsMessage { + String smscPdu; + String pdu; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/IRadioMessaging.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/IRadioMessaging.aidl new file mode 100644 index 0000000000..dfec59ae45 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/IRadioMessaging.aidl @@ -0,0 +1,60 @@ +/* + * 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 -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.messaging; +@VintfStability +interface IRadioMessaging { + oneway void acknowledgeIncomingGsmSmsWithPdu(in int serial, in boolean success, in String ackPdu); + oneway void acknowledgeLastIncomingCdmaSms(in int serial, in android.hardware.radio.messaging.CdmaSmsAck smsAck); + oneway void acknowledgeLastIncomingGsmSms(in int serial, in boolean success, in android.hardware.radio.messaging.SmsAcknowledgeFailCause cause); + oneway void deleteSmsOnRuim(in int serial, in int index); + oneway void deleteSmsOnSim(in int serial, in int index); + oneway void getCdmaBroadcastConfig(in int serial); + oneway void getGsmBroadcastConfig(in int serial); + oneway void getSmscAddress(in int serial); + oneway void reportSmsMemoryStatus(in int serial, in boolean available); + oneway void responseAcknowledgement(); + oneway void sendCdmaSms(in int serial, in android.hardware.radio.messaging.CdmaSmsMessage sms); + oneway void sendCdmaSmsExpectMore(in int serial, in android.hardware.radio.messaging.CdmaSmsMessage sms); + oneway void sendImsSms(in int serial, in android.hardware.radio.messaging.ImsSmsMessage message); + oneway void sendSms(in int serial, in android.hardware.radio.messaging.GsmSmsMessage message); + oneway void sendSmsExpectMore(in int serial, in android.hardware.radio.messaging.GsmSmsMessage message); + oneway void setCdmaBroadcastActivation(in int serial, in boolean activate); + oneway void setCdmaBroadcastConfig(in int serial, in android.hardware.radio.messaging.CdmaBroadcastSmsConfigInfo[] configInfo); + oneway void setGsmBroadcastActivation(in int serial, in boolean activate); + oneway void setGsmBroadcastConfig(in int serial, in android.hardware.radio.messaging.GsmBroadcastSmsConfigInfo[] configInfo); + oneway void setResponseFunctions(in android.hardware.radio.messaging.IRadioMessagingResponse radioMessagingResponse, in android.hardware.radio.messaging.IRadioMessagingIndication radioMessagingIndication); + oneway void setSmscAddress(in int serial, in String smsc); + oneway void writeSmsToRuim(in int serial, in android.hardware.radio.messaging.CdmaSmsWriteArgs cdmaSms); + oneway void writeSmsToSim(in int serial, in android.hardware.radio.messaging.SmsWriteArgs smsWriteArgs); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/IRadioMessagingIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/IRadioMessagingIndication.aidl new file mode 100644 index 0000000000..8f7824f515 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/IRadioMessagingIndication.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 -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.messaging; +@VintfStability +interface IRadioMessagingIndication { + oneway void cdmaNewSms(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.messaging.CdmaSmsMessage msg); + oneway void cdmaRuimSmsStorageFull(in android.hardware.radio.RadioIndicationType type); + oneway void newBroadcastSms(in android.hardware.radio.RadioIndicationType type, in byte[] data); + oneway void newSms(in android.hardware.radio.RadioIndicationType type, in byte[] pdu); + oneway void newSmsOnSim(in android.hardware.radio.RadioIndicationType type, in int recordNumber); + oneway void newSmsStatusReport(in android.hardware.radio.RadioIndicationType type, in byte[] pdu); + oneway void simSmsStorageFull(in android.hardware.radio.RadioIndicationType type); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/IRadioMessagingResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/IRadioMessagingResponse.aidl new file mode 100644 index 0000000000..c3af7a684c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/IRadioMessagingResponse.aidl @@ -0,0 +1,59 @@ +/* + * 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 -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.messaging; +@VintfStability +interface IRadioMessagingResponse { + oneway void acknowledgeIncomingGsmSmsWithPduResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void acknowledgeLastIncomingCdmaSmsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void acknowledgeLastIncomingGsmSmsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void acknowledgeRequest(in int serial); + oneway void deleteSmsOnRuimResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void deleteSmsOnSimResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getCdmaBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.CdmaBroadcastSmsConfigInfo[] configs); + oneway void getGsmBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.GsmBroadcastSmsConfigInfo[] configs); + oneway void getSmscAddressResponse(in android.hardware.radio.RadioResponseInfo info, in String smsc); + oneway void reportSmsMemoryStatusResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendCdmaSmsExpectMoreResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms); + oneway void sendCdmaSmsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms); + oneway void sendImsSmsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms); + oneway void sendSmsExpectMoreResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms); + oneway void sendSmsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.messaging.SendSmsResult sms); + oneway void setCdmaBroadcastActivationResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCdmaBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setGsmBroadcastActivationResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setGsmBroadcastConfigResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSmscAddressResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void writeSmsToRuimResponse(in android.hardware.radio.RadioResponseInfo info, in int index); + oneway void writeSmsToSimResponse(in android.hardware.radio.RadioResponseInfo info, in int index); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/ImsSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/ImsSmsMessage.aidl new file mode 100644 index 0000000000..706bfddd49 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/ImsSmsMessage.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 -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.messaging; +@VintfStability +parcelable ImsSmsMessage { + android.hardware.radio.RadioTechnologyFamily tech; + boolean retry; + int messageRef; + android.hardware.radio.messaging.CdmaSmsMessage[] cdmaMessage; + android.hardware.radio.messaging.GsmSmsMessage[] gsmMessage; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SendSmsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SendSmsResult.aidl new file mode 100644 index 0000000000..0fbec6fed1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SendSmsResult.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 -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.messaging; +@VintfStability +parcelable SendSmsResult { + int messageRef; + String ackPDU; + int errorCode; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl new file mode 100644 index 0000000000..b1f8ff8583 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsAcknowledgeFailCause.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 -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.messaging; +@Backing(type="int") @VintfStability +enum SmsAcknowledgeFailCause { + MEMORY_CAPACITY_EXCEEDED = 211, + UNSPECIFIED_ERROR = 255, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsWriteArgs.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsWriteArgs.aidl new file mode 100644 index 0000000000..1748b62cfc --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsWriteArgs.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 -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.messaging; +@VintfStability +parcelable SmsWriteArgs { + int status; + String pdu; + String smsc; + const int STATUS_REC_UNREAD = 0; + const int STATUS_REC_READ = 1; + const int STATUS_STO_UNSENT = 2; + const int STATUS_STO_SENT = 3; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.modem/1/.hash new file mode 100644 index 0000000000..18996c56c6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/.hash @@ -0,0 +1 @@ +8883a1066be2bbc8c65a2db115b02e3e92bbfc98 diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsInfo.aidl new file mode 100644 index 0000000000..93940fd295 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsInfo.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 -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.modem; +@VintfStability +parcelable ActivityStatsInfo { + int sleepModeTimeMs; + int idleModeTimeMs; + android.hardware.radio.modem.ActivityStatsTechSpecificInfo[] techSpecificInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl new file mode 100644 index 0000000000..798ec36ffb --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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.modem; +@VintfStability +parcelable ActivityStatsTechSpecificInfo { + android.hardware.radio.AccessNetwork rat; + int frequencyRange; + int[] txmModetimeMs; + int rxModeTimeMs; + const int FREQUENCY_RANGE_UNKNOWN = 0; + const int FREQUENCY_RANGE_LOW = 1; + const int FREQUENCY_RANGE_MID = 2; + const int FREQUENCY_RANGE_HIGH = 3; + const int FREQUENCY_RANGE_MMWAVE = 4; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/DeviceStateType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/DeviceStateType.aidl new file mode 100644 index 0000000000..0f0006d3e4 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/DeviceStateType.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 -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.modem; +@Backing(type="int") @VintfStability +enum DeviceStateType { + POWER_SAVE_MODE = 0, + CHARGING_STATE = 1, + LOW_DATA_EXPECTED = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfig.aidl new file mode 100644 index 0000000000..7593ca7a03 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfig.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 -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.modem; +@VintfStability +parcelable HardwareConfig { + int type; + String uuid; + int state; + android.hardware.radio.modem.HardwareConfigModem[] modem; + android.hardware.radio.modem.HardwareConfigSim[] sim; + const int STATE_ENABLED = 0; + const int STATE_STANDBY = 1; + const int STATE_DISABLED = 2; + const int TYPE_MODEM = 0; + const int TYPE_SIM = 1; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigModem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigModem.aidl new file mode 100644 index 0000000000..bf7099541c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigModem.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 -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.modem; +@VintfStability +parcelable HardwareConfigModem { + int rilModel; + android.hardware.radio.RadioTechnology rat; + int maxVoiceCalls; + int maxDataCalls; + int maxStandby; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigSim.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigSim.aidl new file mode 100644 index 0000000000..1b887c220e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigSim.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 -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.modem; +@VintfStability +parcelable HardwareConfigSim { + String modemUuid; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/IRadioModem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/IRadioModem.aidl new file mode 100644 index 0000000000..41eff51773 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/IRadioModem.aidl @@ -0,0 +1,54 @@ +/* + * 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 -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.modem; +@VintfStability +interface IRadioModem { + oneway void enableModem(in int serial, in boolean on); + oneway void getBasebandVersion(in int serial); + oneway void getDeviceIdentity(in int serial); + oneway void getHardwareConfig(in int serial); + oneway void getModemActivityInfo(in int serial); + oneway void getModemStackStatus(in int serial); + oneway void getRadioCapability(in int serial); + oneway void nvReadItem(in int serial, in android.hardware.radio.modem.NvItem itemId); + oneway void nvResetConfig(in int serial, in android.hardware.radio.modem.ResetNvType resetType); + oneway void nvWriteCdmaPrl(in int serial, in byte[] prl); + oneway void nvWriteItem(in int serial, in android.hardware.radio.modem.NvWriteItem item); + oneway void requestShutdown(in int serial); + oneway void responseAcknowledgement(); + oneway void sendDeviceState(in int serial, in android.hardware.radio.modem.DeviceStateType deviceStateType, in boolean state); + oneway void setRadioCapability(in int serial, in android.hardware.radio.modem.RadioCapability rc); + oneway void setRadioPower(in int serial, in boolean powerOn, in boolean forEmergencyCall, in boolean preferredForEmergencyCall); + oneway void setResponseFunctions(in android.hardware.radio.modem.IRadioModemResponse radioModemResponse, in android.hardware.radio.modem.IRadioModemIndication radioModemIndication); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/IRadioModemIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/IRadioModemIndication.aidl new file mode 100644 index 0000000000..514ff9a03e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/IRadioModemIndication.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 -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.modem; +@VintfStability +interface IRadioModemIndication { + oneway void hardwareConfigChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.modem.HardwareConfig[] configs); + oneway void modemReset(in android.hardware.radio.RadioIndicationType type, in String reason); + 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); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/IRadioModemResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/IRadioModemResponse.aidl new file mode 100644 index 0000000000..dcaff45017 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/IRadioModemResponse.aidl @@ -0,0 +1,53 @@ +/* + * 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 -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.modem; +@VintfStability +interface IRadioModemResponse { + oneway void acknowledgeRequest(in int serial); + oneway void enableModemResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getBasebandVersionResponse(in android.hardware.radio.RadioResponseInfo info, in String version); + oneway void getDeviceIdentityResponse(in android.hardware.radio.RadioResponseInfo info, in String imei, in String imeisv, in String esn, in String meid); + oneway void getHardwareConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.HardwareConfig[] config); + oneway void getModemActivityInfoResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.ActivityStatsInfo activityInfo); + oneway void getModemStackStatusResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isEnabled); + oneway void getRadioCapabilityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.RadioCapability rc); + oneway void nvReadItemResponse(in android.hardware.radio.RadioResponseInfo info, in String result); + oneway void nvResetConfigResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void nvWriteCdmaPrlResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void nvWriteItemResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void requestShutdownResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendDeviceStateResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setRadioCapabilityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.RadioCapability rc); + oneway void setRadioPowerResponse(in android.hardware.radio.RadioResponseInfo info); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvItem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvItem.aidl new file mode 100644 index 0000000000..bda4ab7884 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvItem.aidl @@ -0,0 +1,78 @@ +/* + * 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 -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.modem; +@Backing(type="int") @VintfStability +enum NvItem { + CDMA_MEID = 1, + CDMA_MIN = 2, + CDMA_MDN = 3, + CDMA_ACCOLC = 4, + DEVICE_MSL = 11, + RTN_RECONDITIONED_STATUS = 12, + RTN_ACTIVATION_DATE = 13, + RTN_LIFE_TIMER = 14, + RTN_LIFE_CALLS = 15, + RTN_LIFE_DATA_TX = 16, + RTN_LIFE_DATA_RX = 17, + OMADM_HFA_LEVEL = 18, + MIP_PROFILE_NAI = 31, + MIP_PROFILE_HOME_ADDRESS = 32, + MIP_PROFILE_AAA_AUTH = 33, + MIP_PROFILE_HA_AUTH = 34, + MIP_PROFILE_PRI_HA_ADDR = 35, + MIP_PROFILE_SEC_HA_ADDR = 36, + MIP_PROFILE_REV_TUN_PREF = 37, + MIP_PROFILE_HA_SPI = 38, + MIP_PROFILE_AAA_SPI = 39, + MIP_PROFILE_MN_HA_SS = 40, + MIP_PROFILE_MN_AAA_SS = 41, + CDMA_PRL_VERSION = 51, + CDMA_BC10 = 52, + CDMA_BC14 = 53, + CDMA_SO68 = 54, + CDMA_SO73_COP0 = 55, + CDMA_SO73_COP1TO7 = 56, + CDMA_1X_ADVANCED_ENABLED = 57, + CDMA_EHRPD_ENABLED = 58, + CDMA_EHRPD_FORCED = 59, + LTE_BAND_ENABLE_25 = 71, + LTE_BAND_ENABLE_26 = 72, + LTE_BAND_ENABLE_41 = 73, + LTE_SCAN_PRIORITY_25 = 74, + LTE_SCAN_PRIORITY_26 = 75, + LTE_SCAN_PRIORITY_41 = 76, + LTE_HIDDEN_BAND_PRIORITY_25 = 77, + LTE_HIDDEN_BAND_PRIORITY_26 = 78, + LTE_HIDDEN_BAND_PRIORITY_41 = 79, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvWriteItem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvWriteItem.aidl new file mode 100644 index 0000000000..58e84988e8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvWriteItem.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 -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.modem; +@VintfStability +parcelable NvWriteItem { + android.hardware.radio.modem.NvItem itemId; + String value; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioCapability.aidl new file mode 100644 index 0000000000..5aaf5a7303 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioCapability.aidl @@ -0,0 +1,50 @@ +/* + * 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 -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.modem; +@VintfStability +parcelable RadioCapability { + int session; + int phase; + int raf; + String logicalModemUuid; + int status; + const int PHASE_CONFIGURED = 0; + const int PHASE_START = 1; + const int PHASE_APPLY = 2; + const int PHASE_UNSOL_RSP = 3; + const int PHASE_FINISH = 4; + const int STATUS_NONE = 0; + const int STATUS_SUCCESS = 1; + const int STATUS_FAIL = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioState.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioState.aidl new file mode 100644 index 0000000000..4bde770e15 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioState.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 -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.modem; +@Backing(type="int") @VintfStability +enum RadioState { + OFF = 0, + UNAVAILABLE = 1, + ON = 10, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ResetNvType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ResetNvType.aidl new file mode 100644 index 0000000000..81f225433f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ResetNvType.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 -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.modem; +@Backing(type="int") @VintfStability +enum ResetNvType { + RELOAD = 0, + ERASE = 1, + FACTORY_RESET = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.network/1/.hash new file mode 100644 index 0000000000..747eca4afa --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/.hash @@ -0,0 +1 @@ +ffa236a8203511b871b2d141b0f7c6d37f746bb4 diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl new file mode 100644 index 0000000000..4a4a120965 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/AccessTechnologySpecificInfo.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 -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; +@VintfStability +union AccessTechnologySpecificInfo { + boolean noinit; + android.hardware.radio.network.Cdma2000RegistrationInfo cdmaInfo; + android.hardware.radio.network.EutranRegistrationInfo eutranInfo; + android.hardware.radio.network.NrVopsInfo ngranNrVopsInfo; + boolean geranDtmSupported; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringInfo.aidl new file mode 100644 index 0000000000..a96ef510c4 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringInfo.aidl @@ -0,0 +1,85 @@ +/* + * 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 -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; +@VintfStability +parcelable BarringInfo { + int serviceType; + int barringType; + @nullable android.hardware.radio.network.BarringTypeSpecificInfo barringTypeSpecificInfo; + const int BARRING_TYPE_NONE = 0; + const int BARRING_TYPE_CONDITIONAL = 1; + const int BARRING_TYPE_UNCONDITIONAL = 2; + const int SERVICE_TYPE_CS_SERVICE = 0; + const int SERVICE_TYPE_PS_SERVICE = 1; + const int SERVICE_TYPE_CS_VOICE = 2; + const int SERVICE_TYPE_MO_SIGNALLING = 3; + const int SERVICE_TYPE_MO_DATA = 4; + const int SERVICE_TYPE_CS_FALLBACK = 5; + const int SERVICE_TYPE_MMTEL_VOICE = 6; + const int SERVICE_TYPE_MMTEL_VIDEO = 7; + const int SERVICE_TYPE_EMERGENCY = 8; + const int SERVICE_TYPE_SMS = 9; + const int SERVICE_TYPE_OPERATOR_1 = 1001; + const int SERVICE_TYPE_OPERATOR_2 = 1002; + const int SERVICE_TYPE_OPERATOR_3 = 1003; + const int SERVICE_TYPE_OPERATOR_4 = 1004; + const int SERVICE_TYPE_OPERATOR_5 = 1005; + const int SERVICE_TYPE_OPERATOR_6 = 1006; + const int SERVICE_TYPE_OPERATOR_7 = 1007; + const int SERVICE_TYPE_OPERATOR_8 = 1008; + const int SERVICE_TYPE_OPERATOR_9 = 1009; + const int SERVICE_TYPE_OPERATOR_10 = 1010; + const int SERVICE_TYPE_OPERATOR_11 = 1011; + const int SERVICE_TYPE_OPERATOR_12 = 1012; + const int SERVICE_TYPE_OPERATOR_13 = 1013; + const int SERVICE_TYPE_OPERATOR_14 = 1014; + const int SERVICE_TYPE_OPERATOR_15 = 1015; + const int SERVICE_TYPE_OPERATOR_16 = 1016; + const int SERVICE_TYPE_OPERATOR_17 = 1017; + const int SERVICE_TYPE_OPERATOR_18 = 1018; + const int SERVICE_TYPE_OPERATOR_19 = 1019; + const int SERVICE_TYPE_OPERATOR_20 = 1020; + const int SERVICE_TYPE_OPERATOR_21 = 1021; + const int SERVICE_TYPE_OPERATOR_22 = 1022; + const int SERVICE_TYPE_OPERATOR_23 = 1023; + const int SERVICE_TYPE_OPERATOR_24 = 1024; + const int SERVICE_TYPE_OPERATOR_25 = 1025; + const int SERVICE_TYPE_OPERATOR_26 = 1026; + const int SERVICE_TYPE_OPERATOR_27 = 1027; + const int SERVICE_TYPE_OPERATOR_28 = 1028; + const int SERVICE_TYPE_OPERATOR_29 = 1029; + const int SERVICE_TYPE_OPERATOR_30 = 1030; + const int SERVICE_TYPE_OPERATOR_31 = 1031; + const int SERVICE_TYPE_OPERATOR_32 = 1032; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringTypeSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringTypeSpecificInfo.aidl new file mode 100644 index 0000000000..c04cdb54bc --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringTypeSpecificInfo.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 -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; +@VintfStability +parcelable BarringTypeSpecificInfo { + int factor; + int timeSeconds; + boolean isBarred; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl new file mode 100644 index 0000000000..7d9292d9b3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Cdma2000RegistrationInfo.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 -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; +@VintfStability +parcelable Cdma2000RegistrationInfo { + boolean cssSupported; + int roamingIndicator; + int systemIsInPrl; + int defaultRoamingIndicator; + const int PRL_INDICATOR_NOT_REGISTERED = -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/1/android/hardware/radio/network/CdmaRoamingType.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaRoamingType.aidl new file mode 100644 index 0000000000..54c431b015 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaRoamingType.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 -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; +@Backing(type="int") @VintfStability +enum CdmaRoamingType { + HOME_NETWORK = 0, + AFFILIATED_ROAM = 1, + ANY_ROAM = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaSignalStrength.aidl new file mode 100644 index 0000000000..b4aee1cdd2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaSignalStrength.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 -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; +@VintfStability +parcelable CdmaSignalStrength { + int dbm; + int ecio; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellConnectionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellConnectionStatus.aidl new file mode 100644 index 0000000000..066cb60594 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellConnectionStatus.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 -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; +@Backing(type="int") @VintfStability +enum CellConnectionStatus { + NONE = 0, + PRIMARY_SERVING = 1, + SECONDARY_SERVING = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentity.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentity.aidl new file mode 100644 index 0000000000..1c68e8c817 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentity.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 -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; +@VintfStability +union CellIdentity { + boolean noinit; + android.hardware.radio.network.CellIdentityGsm gsm; + android.hardware.radio.network.CellIdentityWcdma wcdma; + android.hardware.radio.network.CellIdentityTdscdma tdscdma; + android.hardware.radio.network.CellIdentityCdma cdma; + android.hardware.radio.network.CellIdentityLte lte; + android.hardware.radio.network.CellIdentityNr nr; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityCdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityCdma.aidl new file mode 100644 index 0000000000..8c1fdfa92a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityCdma.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 -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; +@VintfStability +parcelable CellIdentityCdma { + int networkId; + int systemId; + int baseStationId; + int longitude; + int latitude; + android.hardware.radio.network.OperatorInfo operatorNames; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityGsm.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityGsm.aidl new file mode 100644 index 0000000000..2e384e96f5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityGsm.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 -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; +@VintfStability +parcelable CellIdentityGsm { + String mcc; + String mnc; + int lac; + int cid; + int arfcn; + byte bsic; + android.hardware.radio.network.OperatorInfo operatorNames; + String[] additionalPlmns; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityLte.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityLte.aidl new file mode 100644 index 0000000000..c83997e130 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityLte.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 -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; +@VintfStability +parcelable CellIdentityLte { + String mcc; + String mnc; + int ci; + int pci; + int tac; + int earfcn; + android.hardware.radio.network.OperatorInfo operatorNames; + int bandwidth; + String[] additionalPlmns; + @nullable android.hardware.radio.network.ClosedSubscriberGroupInfo csgInfo; + android.hardware.radio.network.EutranBands[] bands; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityNr.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityNr.aidl new file mode 100644 index 0000000000..6bdfd99af8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityNr.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +parcelable CellIdentityNr { + String mcc; + String mnc; + long nci; + int pci; + int tac; + int nrarfcn; + android.hardware.radio.network.OperatorInfo operatorNames; + String[] additionalPlmns; + android.hardware.radio.network.NgranBands[] bands; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityTdscdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityTdscdma.aidl new file mode 100644 index 0000000000..4100805d8b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityTdscdma.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +parcelable CellIdentityTdscdma { + String mcc; + String mnc; + int lac; + int cid; + int cpid; + int uarfcn; + android.hardware.radio.network.OperatorInfo operatorNames; + String[] additionalPlmns; + @nullable android.hardware.radio.network.ClosedSubscriberGroupInfo csgInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityWcdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityWcdma.aidl new file mode 100644 index 0000000000..907f30d0ac --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityWcdma.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +parcelable CellIdentityWcdma { + String mcc; + String mnc; + int lac; + int cid; + int psc; + int uarfcn; + android.hardware.radio.network.OperatorInfo operatorNames; + String[] additionalPlmns; + @nullable android.hardware.radio.network.ClosedSubscriberGroupInfo csgInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfo.aidl new file mode 100644 index 0000000000..38e0a44e95 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfo.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 -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; +@VintfStability +parcelable CellInfo { + boolean registered; + android.hardware.radio.network.CellConnectionStatus connectionStatus; + android.hardware.radio.network.CellInfoRatSpecificInfo ratSpecificInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoCdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoCdma.aidl new file mode 100644 index 0000000000..d171a4b7df --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoCdma.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 -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; +@VintfStability +parcelable CellInfoCdma { + android.hardware.radio.network.CellIdentityCdma cellIdentityCdma; + android.hardware.radio.network.CdmaSignalStrength signalStrengthCdma; + android.hardware.radio.network.EvdoSignalStrength signalStrengthEvdo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoGsm.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoGsm.aidl new file mode 100644 index 0000000000..491b6868ec --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoGsm.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 -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; +@VintfStability +parcelable CellInfoGsm { + android.hardware.radio.network.CellIdentityGsm cellIdentityGsm; + android.hardware.radio.network.GsmSignalStrength signalStrengthGsm; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoLte.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoLte.aidl new file mode 100644 index 0000000000..67c5a18b22 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoLte.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 -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; +@VintfStability +parcelable CellInfoLte { + android.hardware.radio.network.CellIdentityLte cellIdentityLte; + android.hardware.radio.network.LteSignalStrength signalStrengthLte; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoNr.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoNr.aidl new file mode 100644 index 0000000000..a094600b6b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoNr.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 -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; +@VintfStability +parcelable CellInfoNr { + android.hardware.radio.network.CellIdentityNr cellIdentityNr; + android.hardware.radio.network.NrSignalStrength signalStrengthNr; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl new file mode 100644 index 0000000000..4e0719cd7f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoRatSpecificInfo.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 -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; +@VintfStability +union CellInfoRatSpecificInfo { + android.hardware.radio.network.CellInfoGsm gsm; + android.hardware.radio.network.CellInfoWcdma wcdma; + android.hardware.radio.network.CellInfoTdscdma tdscdma; + android.hardware.radio.network.CellInfoLte lte; + android.hardware.radio.network.CellInfoNr nr; + android.hardware.radio.network.CellInfoCdma cdma; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoTdscdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoTdscdma.aidl new file mode 100644 index 0000000000..d4e0874914 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoTdscdma.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 -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; +@VintfStability +parcelable CellInfoTdscdma { + android.hardware.radio.network.CellIdentityTdscdma cellIdentityTdscdma; + android.hardware.radio.network.TdscdmaSignalStrength signalStrengthTdscdma; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoWcdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoWcdma.aidl new file mode 100644 index 0000000000..da19e37952 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoWcdma.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 -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; +@VintfStability +parcelable CellInfoWcdma { + android.hardware.radio.network.CellIdentityWcdma cellIdentityWcdma; + android.hardware.radio.network.WcdmaSignalStrength signalStrengthWcdma; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl new file mode 100644 index 0000000000..5c45d93e68 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/ClosedSubscriberGroupInfo.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 -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; +@VintfStability +parcelable ClosedSubscriberGroupInfo { + boolean csgIndication; + String homeNodebName; + int csgIdentity; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Domain.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Domain.aidl new file mode 100644 index 0000000000..712bbdb91e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Domain.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 -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; +@Backing(type="int") @VintfStability +enum Domain { + CS = 1, + PS = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranBands.aidl new file mode 100644 index 0000000000..6c94d156cc --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranBands.aidl @@ -0,0 +1,97 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum EutranBands { + BAND_1 = 1, + BAND_2 = 2, + BAND_3 = 3, + BAND_4 = 4, + BAND_5 = 5, + BAND_6 = 6, + BAND_7 = 7, + BAND_8 = 8, + BAND_9 = 9, + BAND_10 = 10, + BAND_11 = 11, + BAND_12 = 12, + BAND_13 = 13, + BAND_14 = 14, + BAND_17 = 17, + BAND_18 = 18, + BAND_19 = 19, + BAND_20 = 20, + BAND_21 = 21, + BAND_22 = 22, + BAND_23 = 23, + BAND_24 = 24, + BAND_25 = 25, + BAND_26 = 26, + BAND_27 = 27, + BAND_28 = 28, + BAND_30 = 30, + BAND_31 = 31, + BAND_33 = 33, + BAND_34 = 34, + BAND_35 = 35, + BAND_36 = 36, + BAND_37 = 37, + BAND_38 = 38, + BAND_39 = 39, + BAND_40 = 40, + BAND_41 = 41, + BAND_42 = 42, + BAND_43 = 43, + BAND_44 = 44, + BAND_45 = 45, + BAND_46 = 46, + BAND_47 = 47, + BAND_48 = 48, + BAND_65 = 65, + BAND_66 = 66, + BAND_68 = 68, + BAND_70 = 70, + BAND_49 = 49, + BAND_50 = 50, + BAND_51 = 51, + BAND_52 = 52, + BAND_53 = 53, + BAND_71 = 71, + BAND_72 = 72, + BAND_73 = 73, + BAND_74 = 74, + BAND_85 = 85, + BAND_87 = 87, + BAND_88 = 88, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranRegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranRegistrationInfo.aidl new file mode 100644 index 0000000000..098b57e9cd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranRegistrationInfo.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 -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; +@VintfStability +parcelable EutranRegistrationInfo { + android.hardware.radio.network.LteVopsInfo lteVopsInfo; + android.hardware.radio.network.NrIndicators nrIndicators; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EvdoSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EvdoSignalStrength.aidl new file mode 100644 index 0000000000..7ec1635c4d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EvdoSignalStrength.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 -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; +@VintfStability +parcelable EvdoSignalStrength { + int dbm; + int ecio; + int signalNoiseRatio; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GeranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GeranBands.aidl new file mode 100644 index 0000000000..7cb0fd5bad --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GeranBands.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum GeranBands { + BAND_T380 = 1, + BAND_T410 = 2, + BAND_450 = 3, + BAND_480 = 4, + BAND_710 = 5, + BAND_750 = 6, + BAND_T810 = 7, + BAND_850 = 8, + BAND_P900 = 9, + BAND_E900 = 10, + BAND_R900 = 11, + BAND_DCS1800 = 12, + BAND_PCS1900 = 13, + BAND_ER900 = 14, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GsmSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GsmSignalStrength.aidl new file mode 100644 index 0000000000..4142ae7781 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GsmSignalStrength.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 -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; +@VintfStability +parcelable GsmSignalStrength { + int signalStrength; + int bitErrorRate; + int timingAdvance; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IRadioNetwork.aidl new file mode 100644 index 0000000000..2b70e45084 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IRadioNetwork.aidl @@ -0,0 +1,73 @@ +/* + * 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 -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; +@VintfStability +interface IRadioNetwork { + oneway void getAllowedNetworkTypesBitmap(in int serial); + oneway void getAvailableBandModes(in int serial); + oneway void getAvailableNetworks(in int serial); + oneway void getBarringInfo(in int serial); + oneway void getCdmaRoamingPreference(in int serial); + oneway void getCellInfoList(in int serial); + oneway void getDataRegistrationState(in int serial); + oneway void getImsRegistrationState(in int serial); + oneway void getNetworkSelectionMode(in int serial); + oneway void getOperator(in int serial); + oneway void getSignalStrength(in int serial); + oneway void getSystemSelectionChannels(in int serial); + oneway void getVoiceRadioTechnology(in int serial); + oneway void getVoiceRegistrationState(in int serial); + oneway void isNrDualConnectivityEnabled(in int serial); + oneway void responseAcknowledgement(); + oneway void setAllowedNetworkTypesBitmap(in int serial, in int networkTypeBitmap); + oneway void setBandMode(in int serial, in android.hardware.radio.network.RadioBandMode mode); + oneway void setBarringPassword(in int serial, in String facility, in String oldPassword, in String newPassword); + oneway void setCdmaRoamingPreference(in int serial, in android.hardware.radio.network.CdmaRoamingType type); + oneway void setCellInfoListRate(in int serial, in int rate); + oneway void setIndicationFilter(in int serial, in int indicationFilter); + oneway void setLinkCapacityReportingCriteria(in int serial, in int hysteresisMs, in int hysteresisDlKbps, in int hysteresisUlKbps, in int[] thresholdsDownlinkKbps, in int[] thresholdsUplinkKbps, in android.hardware.radio.AccessNetwork accessNetwork); + oneway void setLocationUpdates(in int serial, in boolean enable); + oneway void setNetworkSelectionModeAutomatic(in int serial); + oneway void setNetworkSelectionModeManual(in int serial, in String operatorNumeric, in android.hardware.radio.AccessNetwork ran); + oneway void setNrDualConnectivityState(in int serial, in android.hardware.radio.network.NrDualConnectivityState nrDualConnectivityState); + oneway void setResponseFunctions(in android.hardware.radio.network.IRadioNetworkResponse radioNetworkResponse, in android.hardware.radio.network.IRadioNetworkIndication radioNetworkIndication); + oneway void setSignalStrengthReportingCriteria(in int serial, in android.hardware.radio.network.SignalThresholdInfo[] signalThresholdInfos); + oneway void setSuppServiceNotifications(in int serial, in boolean enable); + oneway void setSystemSelectionChannels(in int serial, in boolean specifyChannels, in android.hardware.radio.network.RadioAccessSpecifier[] specifiers); + oneway void startNetworkScan(in int serial, in android.hardware.radio.network.NetworkScanRequest request); + oneway void stopNetworkScan(in int serial); + oneway void supplyNetworkDepersonalization(in int serial, in String netPin); + oneway void setUsageSetting(in int serial, in android.hardware.radio.network.UsageSetting usageSetting); + oneway void getUsageSetting(in int serial); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IRadioNetworkIndication.aidl new file mode 100644 index 0000000000..bd03c51ec7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IRadioNetworkIndication.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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; +@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); + oneway void cdmaPrlChanged(in android.hardware.radio.RadioIndicationType type, in int version); + oneway void cellInfoList(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.CellInfo[] records); + oneway void currentLinkCapacityEstimate(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.LinkCapacityEstimate lce); + oneway void currentPhysicalChannelConfigs(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.PhysicalChannelConfig[] configs); + oneway void currentSignalStrength(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.SignalStrength signalStrength); + oneway void imsNetworkStateChanged(in android.hardware.radio.RadioIndicationType type); + oneway void networkScanResult(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.NetworkScanResult result); + oneway void networkStateChanged(in android.hardware.radio.RadioIndicationType type); + oneway void nitzTimeReceived(in android.hardware.radio.RadioIndicationType type, in String nitzTime, in long receivedTimeMs, in long ageMs); + oneway void registrationFailed(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.CellIdentity cellIdentity, in String chosenPlmn, in int domain, in int causeCode, in int additionalCauseCode); + oneway void restrictedStateChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.PhoneRestrictedState state); + 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); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IRadioNetworkResponse.aidl new file mode 100644 index 0000000000..5f6c7369f4 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IRadioNetworkResponse.aidl @@ -0,0 +1,72 @@ +/* + * 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 -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; +@VintfStability +interface IRadioNetworkResponse { + oneway void acknowledgeRequest(in int serial); + oneway void getAllowedNetworkTypesBitmapResponse(in android.hardware.radio.RadioResponseInfo info, in int networkTypeBitmap); + oneway void getAvailableBandModesResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.RadioBandMode[] bandModes); + oneway void getAvailableNetworksResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.OperatorInfo[] networkInfos); + oneway void getBarringInfoResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.CellIdentity cellIdentity, in android.hardware.radio.network.BarringInfo[] barringInfos); + oneway void getCdmaRoamingPreferenceResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.CdmaRoamingType type); + oneway void getCellInfoListResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.CellInfo[] cellInfo); + oneway void getDataRegistrationStateResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.RegStateResult dataRegResponse); + oneway void getImsRegistrationStateResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isRegistered, in android.hardware.radio.RadioTechnologyFamily ratFamily); + oneway void getNetworkSelectionModeResponse(in android.hardware.radio.RadioResponseInfo info, in boolean manual); + oneway void getOperatorResponse(in android.hardware.radio.RadioResponseInfo info, in String longName, in String shortName, in String numeric); + oneway void getSignalStrengthResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.SignalStrength signalStrength); + oneway void getSystemSelectionChannelsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.RadioAccessSpecifier[] specifiers); + oneway void getVoiceRadioTechnologyResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.RadioTechnology rat); + oneway void getVoiceRegistrationStateResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.RegStateResult voiceRegResponse); + oneway void isNrDualConnectivityEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isEnabled); + oneway void setAllowedNetworkTypesBitmapResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setBandModeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setBarringPasswordResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCdmaRoamingPreferenceResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCellInfoListRateResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setIndicationFilterResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setLinkCapacityReportingCriteriaResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setLocationUpdatesResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setNetworkSelectionModeAutomaticResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setNetworkSelectionModeManualResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setNrDualConnectivityStateResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSignalStrengthReportingCriteriaResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSuppServiceNotificationsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSystemSelectionChannelsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void startNetworkScanResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void stopNetworkScanResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void supplyNetworkDepersonalizationResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void setUsageSettingResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getUsageSettingResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.UsageSetting usageSetting); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IndicationFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IndicationFilter.aidl new file mode 100644 index 0000000000..f79ff2a8b7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IndicationFilter.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum IndicationFilter { + NONE = 0, + ALL = -1, + SIGNAL_STRENGTH = 1, + FULL_NETWORK_STATE = 2, + DATA_CALL_DORMANCY_CHANGED = 4, + LINK_CAPACITY_ESTIMATE = 8, + PHYSICAL_CHANNEL_CONFIG = 16, + REGISTRATION_FAILURE = 32, + BARRING_INFO = 64, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LceDataInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LceDataInfo.aidl new file mode 100644 index 0000000000..1876465e41 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LceDataInfo.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 -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; +@VintfStability +parcelable LceDataInfo { + int lastHopCapacityKbps; + byte confidenceLevel; + boolean lceSuspended; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LinkCapacityEstimate.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LinkCapacityEstimate.aidl new file mode 100644 index 0000000000..c34f177722 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LinkCapacityEstimate.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 -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; +@VintfStability +parcelable LinkCapacityEstimate { + int downlinkCapacityKbps; + int uplinkCapacityKbps; + int secondaryDownlinkCapacityKbps; + int secondaryUplinkCapacityKbps; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteSignalStrength.aidl new file mode 100644 index 0000000000..c7b41f1173 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteSignalStrength.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 -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; +@VintfStability +parcelable LteSignalStrength { + int signalStrength; + int rsrp; + int rsrq; + int rssnr; + int cqi; + int timingAdvance; + int cqiTableIndex; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteVopsInfo.aidl new file mode 100644 index 0000000000..9f20b1026e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteVopsInfo.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 -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; +@VintfStability +parcelable LteVopsInfo { + boolean isVopsSupported; + boolean isEmcBearerSupported; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanRequest.aidl new file mode 100644 index 0000000000..1e657e571b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanRequest.aidl @@ -0,0 +1,53 @@ +/* + * 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 -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; +@VintfStability +parcelable NetworkScanRequest { + int type; + int interval; + android.hardware.radio.network.RadioAccessSpecifier[] specifiers; + int maxSearchTime; + boolean incrementalResults; + int incrementalResultsPeriodicity; + String[] mccMncs; + const int RADIO_ACCESS_SPECIFIER_MAX_SIZE = 8; + const int INCREMENTAL_RESULTS_PREIODICITY_RANGE_MIN = 1; + const int INCREMENTAL_RESULTS_PREIODICITY_RANGE_MAX = 10; + const int MAX_SEARCH_TIME_RANGE_MIN = 60; + const int MAX_SEARCH_TIME_RANGE_MAX = 3600; + const int SCAN_INTERVAL_RANGE_MIN = 5; + const int SCAN_INTERVAL_RANGE_MAX = 300; + const int SCAN_TYPE_ONE_SHOT = 0; + const int SCAN_TYPE_PERIODIC = 1; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanResult.aidl new file mode 100644 index 0000000000..3dc39406e7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanResult.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 -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; +@VintfStability +parcelable NetworkScanResult { + int status; + android.hardware.radio.RadioError error; + android.hardware.radio.network.CellInfo[] networkInfos; + const int SCAN_STATUS_PARTIAL = 1; + const int SCAN_STATUS_COMPLETE = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NgranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NgranBands.aidl new file mode 100644 index 0000000000..aa60cde74f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NgranBands.aidl @@ -0,0 +1,90 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum NgranBands { + BAND_1 = 1, + BAND_2 = 2, + BAND_3 = 3, + BAND_5 = 5, + BAND_7 = 7, + BAND_8 = 8, + BAND_12 = 12, + BAND_14 = 14, + BAND_18 = 18, + BAND_20 = 20, + BAND_25 = 25, + BAND_26 = 26, + BAND_28 = 28, + BAND_29 = 29, + BAND_30 = 30, + BAND_34 = 34, + BAND_38 = 38, + BAND_39 = 39, + BAND_40 = 40, + BAND_41 = 41, + BAND_46 = 46, + BAND_48 = 48, + BAND_50 = 50, + BAND_51 = 51, + BAND_53 = 53, + BAND_65 = 65, + BAND_66 = 66, + BAND_70 = 70, + BAND_71 = 71, + BAND_74 = 74, + BAND_75 = 75, + BAND_76 = 76, + BAND_77 = 77, + BAND_78 = 78, + BAND_79 = 79, + BAND_80 = 80, + BAND_81 = 81, + BAND_82 = 82, + BAND_83 = 83, + BAND_84 = 84, + BAND_86 = 86, + BAND_89 = 89, + BAND_90 = 90, + BAND_91 = 91, + BAND_92 = 92, + BAND_93 = 93, + BAND_94 = 94, + BAND_95 = 95, + BAND_96 = 96, + BAND_257 = 257, + BAND_258 = 258, + BAND_260 = 260, + BAND_261 = 261, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrDualConnectivityState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrDualConnectivityState.aidl new file mode 100644 index 0000000000..6ee526ff2b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrDualConnectivityState.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 -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; +@Backing(type="byte") @VintfStability +enum NrDualConnectivityState { + ENABLE = 1, + DISABLE = 2, + DISABLE_IMMEDIATE = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrIndicators.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrIndicators.aidl new file mode 100644 index 0000000000..54f9b8f75f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrIndicators.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 -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; +@VintfStability +parcelable NrIndicators { + boolean isEndcAvailable; + boolean isDcNrRestricted; + boolean isNrAvailable; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrSignalStrength.aidl new file mode 100644 index 0000000000..14b60a622c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrSignalStrength.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 -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; +@VintfStability +parcelable NrSignalStrength { + int ssRsrp; + int ssRsrq; + int ssSinr; + int csiRsrp; + int csiRsrq; + int csiSinr; + int csiCqiTableIndex; + byte[] csiCqiReport; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrVopsInfo.aidl new file mode 100644 index 0000000000..7f58ee17fa --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrVopsInfo.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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; +@VintfStability +parcelable NrVopsInfo { + byte vopsSupported; + byte emcSupported; + byte emfSupported; + const byte EMC_INDICATOR_NOT_SUPPORTED = 0; + const byte EMC_INDICATOR_NR_CONNECTED_TO_5GCN = 1; + const byte EMC_INDICATOR_EUTRA_CONNECTED_TO_5GCN = 2; + const byte EMC_INDICATOR_BOTH_NR_EUTRA_CONNECTED_TO_5GCN = 3; + const byte EMF_INDICATOR_NOT_SUPPORTED = 0; + const byte EMF_INDICATOR_NR_CONNECTED_TO_5GCN = 1; + const byte EMF_INDICATOR_EUTRA_CONNECTED_TO_5GCN = 2; + const byte EMF_INDICATOR_BOTH_NR_EUTRA_CONNECTED_TO_5GCN = 3; + const byte VOPS_INDICATOR_VOPS_NOT_SUPPORTED = 0; + const byte VOPS_INDICATOR_VOPS_OVER_3GPP = 1; + const byte VOPS_INDICATOR_VOPS_OVER_NON_3GPP = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/OperatorInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/OperatorInfo.aidl new file mode 100644 index 0000000000..c3658d9f91 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/OperatorInfo.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 -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; +@VintfStability +parcelable OperatorInfo { + String alphaLong; + String alphaShort; + String operatorNumeric; + int status; + const int STATUS_UNKNOWN = 0; + const int STATUS_AVAILABLE = 1; + const int STATUS_CURRENT = 2; + const int STATUS_FORBIDDEN = 3; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhoneRestrictedState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhoneRestrictedState.aidl new file mode 100644 index 0000000000..dff8be052e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhoneRestrictedState.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 -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; +@Backing(type="int") @VintfStability +enum PhoneRestrictedState { + NONE = 0, + CS_EMERGENCY = 1, + CS_NORMAL = 2, + CS_ALL = 4, + PS_ALL = 16, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfig.aidl new file mode 100644 index 0000000000..8db6bc40da --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfig.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +parcelable PhysicalChannelConfig { + android.hardware.radio.network.CellConnectionStatus status; + android.hardware.radio.RadioTechnology rat; + int downlinkChannelNumber; + int uplinkChannelNumber; + int cellBandwidthDownlinkKhz; + int cellBandwidthUplinkKhz; + int[] contextIds; + int physicalCellId; + android.hardware.radio.network.PhysicalChannelConfigBand band; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfigBand.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfigBand.aidl new file mode 100644 index 0000000000..50af816485 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfigBand.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 -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; +@VintfStability +union PhysicalChannelConfigBand { + boolean noinit; + android.hardware.radio.network.GeranBands geranBand; + android.hardware.radio.network.UtranBands utranBand; + android.hardware.radio.network.EutranBands eutranBand; + android.hardware.radio.network.NgranBands ngranBand; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifier.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifier.aidl new file mode 100644 index 0000000000..b412f63899 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifier.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 -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; +@VintfStability +parcelable RadioAccessSpecifier { + android.hardware.radio.AccessNetwork accessNetwork; + android.hardware.radio.network.RadioAccessSpecifierBands bands; + int[] channels; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifierBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifierBands.aidl new file mode 100644 index 0000000000..d44a883671 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifierBands.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 -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; +@VintfStability +union RadioAccessSpecifierBands { + boolean noinit; + android.hardware.radio.network.GeranBands[] geranBands; + android.hardware.radio.network.UtranBands[] utranBands; + android.hardware.radio.network.EutranBands[] eutranBands; + android.hardware.radio.network.NgranBands[] ngranBands; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioBandMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioBandMode.aidl new file mode 100644 index 0000000000..7266fd5e06 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioBandMode.aidl @@ -0,0 +1,56 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum RadioBandMode { + BAND_MODE_UNSPECIFIED = 0, + BAND_MODE_EURO = 1, + BAND_MODE_USA = 2, + BAND_MODE_JPN = 3, + BAND_MODE_AUS = 4, + BAND_MODE_AUS_2 = 5, + BAND_MODE_CELL_800 = 6, + BAND_MODE_PCS = 7, + BAND_MODE_JTACS = 8, + BAND_MODE_KOREA_PCS = 9, + BAND_MODE_5_450M = 10, + BAND_MODE_IMT2000 = 11, + BAND_MODE_7_700M_2 = 12, + BAND_MODE_8_1800M = 13, + BAND_MODE_9_900M = 14, + BAND_MODE_10_800M_2 = 15, + BAND_MODE_EURO_PAMR_400M = 16, + BAND_MODE_AWS = 17, + BAND_MODE_USA_2500M = 18, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegState.aidl new file mode 100644 index 0000000000..d10f41313d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegState.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 -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; +@Backing(type="int") @VintfStability +enum RegState { + NOT_REG_MT_NOT_SEARCHING_OP = 0, + REG_HOME = 1, + NOT_REG_MT_SEARCHING_OP = 2, + REG_DENIED = 3, + UNKNOWN = 4, + REG_ROAMING = 5, + NOT_REG_MT_NOT_SEARCHING_OP_EM = 10, + NOT_REG_MT_SEARCHING_OP_EM = 12, + REG_DENIED_EM = 13, + UNKNOWN_EM = 14, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegStateResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegStateResult.aidl new file mode 100644 index 0000000000..eff22166b9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegStateResult.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 -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; +@VintfStability +parcelable RegStateResult { + android.hardware.radio.network.RegState regState; + android.hardware.radio.RadioTechnology rat; + android.hardware.radio.network.RegistrationFailCause reasonForDenial; + android.hardware.radio.network.CellIdentity cellIdentity; + String registeredPlmn; + android.hardware.radio.network.AccessTechnologySpecificInfo accessTechnologySpecificInfo; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegistrationFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegistrationFailCause.aidl new file mode 100644 index 0000000000..75fcdf453d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegistrationFailCause.aidl @@ -0,0 +1,89 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum RegistrationFailCause { + NONE = 0, + IMSI_UNKNOWN_IN_HLR = 2, + ILLEGAL_MS = 3, + IMSI_UNKNOWN_IN_VLR = 4, + IMEI_NOT_ACCEPTED = 5, + ILLEGAL_ME = 6, + GPRS_SERVICES_NOT_ALLOWED = 7, + GPRS_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 8, + MS_IDENTITY_CANNOT_BE_DERIVED_BY_NETWORK = 9, + IMPLICITLY_DETACHED = 10, + PLMN_NOT_ALLOWED = 11, + LOCATION_AREA_NOT_ALLOWED = 12, + ROAMING_NOT_ALLOWED = 13, + GPRS_SERVICES_NOT_ALLOWED_IN_PLMN = 14, + NO_SUITABLE_CELLS = 15, + MSC_TEMPORARILY_NOT_REACHABLE = 15, + NETWORK_FAILURE = 17, + MAC_FAILURE = 20, + SYNC_FAILURE = 21, + CONGESTION = 22, + GSM_AUTHENTICATION_UNACCEPTABLE = 23, + NOT_AUTHORIZED_FOR_THIS_CSG = 25, + SMS_PROVIDED_BY_GPRS_IN_ROUTING_AREA = 26, + SERVICE_OPTION_NOT_SUPPORTED = 32, + SERVICE_OPTION_NOT_SUBSCRIBED = 33, + SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER = 34, + CALL_CANNOT_BE_IDENTIFIED = 38, + NO_PDP_CONTEXT_ACTIVATED = 40, + RETRY_UPON_ENTRY_INTO_NEW_CELL_1 = 48, + RETRY_UPON_ENTRY_INTO_NEW_CELL_2 = 49, + RETRY_UPON_ENTRY_INTO_NEW_CELL_3 = 50, + RETRY_UPON_ENTRY_INTO_NEW_CELL_4 = 51, + RETRY_UPON_ENTRY_INTO_NEW_CELL_5 = 52, + RETRY_UPON_ENTRY_INTO_NEW_CELL_6 = 53, + RETRY_UPON_ENTRY_INTO_NEW_CELL_7 = 54, + RETRY_UPON_ENTRY_INTO_NEW_CELL_8 = 55, + RETRY_UPON_ENTRY_INTO_NEW_CELL_9 = 56, + RETRY_UPON_ENTRY_INTO_NEW_CELL_10 = 57, + RETRY_UPON_ENTRY_INTO_NEW_CELL_11 = 58, + RETRY_UPON_ENTRY_INTO_NEW_CELL_12 = 59, + RETRY_UPON_ENTRY_INTO_NEW_CELL_13 = 60, + RETRY_UPON_ENTRY_INTO_NEW_CELL_14 = 61, + RETRY_UPON_ENTRY_INTO_NEW_CELL_15 = 62, + RETRY_UPON_ENTRY_INTO_NEW_CELL_16 = 63, + SEMANTICALLY_INCORRECT_MESSAGE = 95, + INVALID_MANDATORY_INFORMATION = 96, + MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED = 97, + MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98, + INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED = 99, + CONDITIONAL_IE_ERROR = 100, + MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101, + PROTOCOL_ERROR_UNSPECIFIED = 111, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalStrength.aidl new file mode 100644 index 0000000000..7187116fce --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalStrength.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 -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; +@VintfStability +parcelable SignalStrength { + android.hardware.radio.network.GsmSignalStrength gsm; + android.hardware.radio.network.CdmaSignalStrength cdma; + android.hardware.radio.network.EvdoSignalStrength evdo; + android.hardware.radio.network.LteSignalStrength lte; + android.hardware.radio.network.TdscdmaSignalStrength tdscdma; + android.hardware.radio.network.WcdmaSignalStrength wcdma; + android.hardware.radio.network.NrSignalStrength nr; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalThresholdInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalThresholdInfo.aidl new file mode 100644 index 0000000000..159d9c1547 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalThresholdInfo.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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; +@VintfStability +parcelable SignalThresholdInfo { + int signalMeasurement; + int hysteresisMs; + int hysteresisDb; + int[] thresholds; + boolean isEnabled; + android.hardware.radio.AccessNetwork ran; + const int SIGNAL_MEASUREMENT_TYPE_RSSI = 1; + const int SIGNAL_MEASUREMENT_TYPE_RSCP = 2; + const int SIGNAL_MEASUREMENT_TYPE_RSRP = 3; + const int SIGNAL_MEASUREMENT_TYPE_RSRQ = 4; + const int SIGNAL_MEASUREMENT_TYPE_RSSNR = 5; + const int SIGNAL_MEASUREMENT_TYPE_SSRSRP = 6; + const int SIGNAL_MEASUREMENT_TYPE_SSRSRQ = 7; + const int SIGNAL_MEASUREMENT_TYPE_SSSINR = 8; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SuppSvcNotification.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SuppSvcNotification.aidl new file mode 100644 index 0000000000..541754e3ad --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SuppSvcNotification.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 -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; +@VintfStability +parcelable SuppSvcNotification { + boolean isMT; + int code; + int index; + int type; + String number; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/TdscdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/TdscdmaSignalStrength.aidl new file mode 100644 index 0000000000..a00345f16a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/TdscdmaSignalStrength.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 -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; +@VintfStability +parcelable TdscdmaSignalStrength { + int signalStrength; + int bitErrorRate; + int rscp; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UsageSetting.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UsageSetting.aidl new file mode 100644 index 0000000000..7fdf8313d3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UsageSetting.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 -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; +@Backing(type="int") @VintfStability +enum UsageSetting { + VOICE_CENTRIC = 1, + DATA_CENTRIC = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UtranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UtranBands.aidl new file mode 100644 index 0000000000..87d5b8535d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UtranBands.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 -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; +@Backing(type="int") @VintfStability +enum UtranBands { + BAND_1 = 1, + BAND_2 = 2, + BAND_3 = 3, + BAND_4 = 4, + BAND_5 = 5, + BAND_6 = 6, + BAND_7 = 7, + BAND_8 = 8, + BAND_9 = 9, + BAND_10 = 10, + BAND_11 = 11, + BAND_12 = 12, + BAND_13 = 13, + BAND_14 = 14, + BAND_19 = 19, + BAND_20 = 20, + BAND_21 = 21, + BAND_22 = 22, + BAND_25 = 25, + BAND_26 = 26, + BAND_A = 101, + BAND_B = 102, + BAND_C = 103, + BAND_D = 104, + BAND_E = 105, + BAND_F = 106, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/WcdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/WcdmaSignalStrength.aidl new file mode 100644 index 0000000000..678ace9735 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/WcdmaSignalStrength.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 -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; +@VintfStability +parcelable WcdmaSignalStrength { + int signalStrength; + int bitErrorRate; + int rscp; + int ecno; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.sim/1/.hash new file mode 100644 index 0000000000..8d5d79aa8b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/.hash @@ -0,0 +1 @@ +6c75ba42a812cccc0f73ada23e5b2581dfedcacb diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/AppStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/AppStatus.aidl new file mode 100644 index 0000000000..89d8f9a6ee --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/AppStatus.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 -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; +@VintfStability +parcelable AppStatus { + int appType; + int appState; + android.hardware.radio.sim.PersoSubstate persoSubstate; + String aidPtr; + String appLabelPtr; + boolean pin1Replaced; + android.hardware.radio.sim.PinState pin1; + android.hardware.radio.sim.PinState pin2; + const int APP_STATE_UNKNOWN = 0; + const int APP_STATE_DETECTED = 1; + const int APP_STATE_PIN = 2; + const int APP_STATE_PUK = 3; + const int APP_STATE_SUBSCRIPTION_PERSO = 4; + const int APP_STATE_READY = 5; + const int APP_TYPE_UNKNOWN = 0; + const int APP_TYPE_SIM = 1; + const int APP_TYPE_USIM = 2; + const int APP_TYPE_RUIM = 3; + const int APP_TYPE_CSIM = 4; + const int APP_TYPE_ISIM = 5; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardPowerState.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardPowerState.aidl new file mode 100644 index 0000000000..c0026ba95c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardPowerState.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 -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; +@Backing(type="int") @VintfStability +enum CardPowerState { + POWER_DOWN = 0, + POWER_UP = 1, + POWER_UP_PASS_THROUGH = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardStatus.aidl new file mode 100644 index 0000000000..cf37a0d9e1 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardStatus.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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; +@VintfStability +parcelable CardStatus { + int cardState; + android.hardware.radio.sim.PinState universalPinState; + int gsmUmtsSubscriptionAppIndex; + int cdmaSubscriptionAppIndex; + int imsSubscriptionAppIndex; + android.hardware.radio.sim.AppStatus[] applications; + String atr; + String iccid; + String eid; + android.hardware.radio.config.SlotPortMapping slotMap; + const int STATE_ABSENT = 0; + const int STATE_PRESENT = 1; + const int STATE_ERROR = 2; + const int STATE_RESTRICTED = 3; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/Carrier.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/Carrier.aidl new file mode 100644 index 0000000000..c7fced175f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/Carrier.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +parcelable Carrier { + String mcc; + String mnc; + int matchType; + String matchData; + const int MATCH_TYPE_ALL = 0; + const int MATCH_TYPE_SPN = 1; + const int MATCH_TYPE_IMSI_PREFIX = 2; + const int MATCH_TYPE_GID1 = 3; + const int MATCH_TYPE_GID2 = 4; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CarrierRestrictions.aidl new file mode 100644 index 0000000000..85cf86e41f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CarrierRestrictions.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 -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; +@VintfStability +parcelable CarrierRestrictions { + android.hardware.radio.sim.Carrier[] allowedCarriers; + android.hardware.radio.sim.Carrier[] excludedCarriers; + boolean allowedCarriersPrioritized; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CdmaSubscriptionSource.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CdmaSubscriptionSource.aidl new file mode 100644 index 0000000000..50e768c10e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CdmaSubscriptionSource.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 -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; +@Backing(type="int") @VintfStability +enum CdmaSubscriptionSource { + RUIM_SIM = 0, + NV = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IRadioSim.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IRadioSim.aidl new file mode 100644 index 0000000000..85a0c710d8 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IRadioSim.aidl @@ -0,0 +1,73 @@ +/* + * 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 -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; +@VintfStability +interface IRadioSim { + oneway void areUiccApplicationsEnabled(in int serial); + oneway void changeIccPin2ForApp(in int serial, in String oldPin2, in String newPin2, in String aid); + oneway void changeIccPinForApp(in int serial, in String oldPin, in String newPin, in String aid); + oneway void enableUiccApplications(in int serial, in boolean enable); + oneway void getAllowedCarriers(in int serial); + oneway void getCdmaSubscription(in int serial); + oneway void getCdmaSubscriptionSource(in int serial); + oneway void getFacilityLockForApp(in int serial, in String facility, in String password, in int serviceClass, in String appId); + oneway void getIccCardStatus(in int serial); + oneway void getImsiForApp(in int serial, in String aid); + oneway void getSimPhonebookCapacity(in int serial); + oneway void getSimPhonebookRecords(in int serial); + oneway void iccCloseLogicalChannel(in int serial, in int channelId); + oneway void iccIoForApp(in int serial, in android.hardware.radio.sim.IccIo iccIo); + oneway void iccOpenLogicalChannel(in int serial, in String aid, in int p2); + oneway void iccTransmitApduBasicChannel(in int serial, in android.hardware.radio.sim.SimApdu message); + oneway void iccTransmitApduLogicalChannel(in int serial, in android.hardware.radio.sim.SimApdu message); + oneway void reportStkServiceIsRunning(in int serial); + oneway void requestIccSimAuthentication(in int serial, in int authContext, in String authData, in String aid); + oneway void responseAcknowledgement(); + oneway void sendEnvelope(in int serial, in String contents); + oneway void sendEnvelopeWithStatus(in int serial, in String contents); + oneway void sendTerminalResponseToSim(in int serial, in String contents); + oneway void setAllowedCarriers(in int serial, in android.hardware.radio.sim.CarrierRestrictions carriers, in android.hardware.radio.sim.SimLockMultiSimPolicy multiSimPolicy); + oneway void setCarrierInfoForImsiEncryption(in int serial, in android.hardware.radio.sim.ImsiEncryptionInfo imsiEncryptionInfo); + oneway void setCdmaSubscriptionSource(in int serial, in android.hardware.radio.sim.CdmaSubscriptionSource cdmaSub); + oneway void setFacilityLockForApp(in int serial, in String facility, in boolean lockState, in String password, in int serviceClass, in String appId); + oneway void setResponseFunctions(in android.hardware.radio.sim.IRadioSimResponse radioSimResponse, in android.hardware.radio.sim.IRadioSimIndication radioSimIndication); + oneway void setSimCardPower(in int serial, in android.hardware.radio.sim.CardPowerState powerUp); + oneway void setUiccSubscription(in int serial, in android.hardware.radio.sim.SelectUiccSub uiccSub); + oneway void supplyIccPin2ForApp(in int serial, in String pin2, in String aid); + oneway void supplyIccPinForApp(in int serial, in String pin, in String aid); + oneway void supplyIccPuk2ForApp(in int serial, in String puk2, in String pin2, in String aid); + oneway void supplyIccPukForApp(in int serial, in String puk, in String pin, in String aid); + oneway void supplySimDepersonalization(in int serial, in android.hardware.radio.sim.PersoSubstate persoType, in String controlKey); + oneway void updateSimPhonebookRecords(in int serial, in android.hardware.radio.sim.PhonebookRecordInfo recordInfo); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IRadioSimIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IRadioSimIndication.aidl new file mode 100644 index 0000000000..d4371b8e69 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IRadioSimIndication.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 -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; +@VintfStability +interface IRadioSimIndication { + oneway void carrierInfoForImsiEncryption(in android.hardware.radio.RadioIndicationType info); + oneway void cdmaSubscriptionSourceChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.sim.CdmaSubscriptionSource cdmaSource); + oneway void simPhonebookChanged(in android.hardware.radio.RadioIndicationType type); + oneway void simPhonebookRecordsReceived(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.sim.PbReceivedStatus status, in android.hardware.radio.sim.PhonebookRecordInfo[] records); + oneway void simRefresh(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.sim.SimRefreshResult refreshResult); + oneway void simStatusChanged(in android.hardware.radio.RadioIndicationType type); + oneway void stkEventNotify(in android.hardware.radio.RadioIndicationType type, in String cmd); + oneway void stkProactiveCommand(in android.hardware.radio.RadioIndicationType type, in String cmd); + oneway void stkSessionEnd(in android.hardware.radio.RadioIndicationType type); + oneway void subscriptionStatusChanged(in android.hardware.radio.RadioIndicationType type, in boolean activate); + oneway void uiccApplicationsEnablementChanged(in android.hardware.radio.RadioIndicationType type, in boolean enabled); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IRadioSimResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IRadioSimResponse.aidl new file mode 100644 index 0000000000..8e68e3042d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IRadioSimResponse.aidl @@ -0,0 +1,72 @@ +/* + * 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 -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; +@VintfStability +interface IRadioSimResponse { + oneway void acknowledgeRequest(in int serial); + oneway void areUiccApplicationsEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean enabled); + oneway void changeIccPin2ForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void changeIccPinForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void enableUiccApplicationsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getAllowedCarriersResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.CarrierRestrictions carriers, in android.hardware.radio.sim.SimLockMultiSimPolicy multiSimPolicy); + oneway void getCdmaSubscriptionResponse(in android.hardware.radio.RadioResponseInfo info, in String mdn, in String hSid, in String hNid, in String min, in String prl); + oneway void getCdmaSubscriptionSourceResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.CdmaSubscriptionSource source); + oneway void getFacilityLockForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int response); + oneway void getIccCardStatusResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.CardStatus cardStatus); + oneway void getImsiForAppResponse(in android.hardware.radio.RadioResponseInfo info, in String imsi); + oneway void getSimPhonebookCapacityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.PhonebookCapacity capacity); + oneway void getSimPhonebookRecordsResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void iccCloseLogicalChannelResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void iccIoForAppResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.IccIoResult iccIo); + oneway void iccOpenLogicalChannelResponse(in android.hardware.radio.RadioResponseInfo info, in int channelId, in byte[] selectResponse); + oneway void iccTransmitApduBasicChannelResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.IccIoResult result); + oneway void iccTransmitApduLogicalChannelResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.IccIoResult result); + oneway void reportStkServiceIsRunningResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void requestIccSimAuthenticationResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.IccIoResult result); + oneway void sendEnvelopeResponse(in android.hardware.radio.RadioResponseInfo info, in String commandResponse); + oneway void sendEnvelopeWithStatusResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.IccIoResult iccIo); + oneway void sendTerminalResponseToSimResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setAllowedCarriersResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCarrierInfoForImsiEncryptionResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCdmaSubscriptionSourceResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setFacilityLockForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int retry); + oneway void setSimCardPowerResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setUiccSubscriptionResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void supplyIccPin2ForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void supplyIccPinForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void supplyIccPuk2ForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void supplyIccPukForAppResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries); + oneway void supplySimDepersonalizationResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.sim.PersoSubstate persoType, in int remainingRetries); + oneway void updateSimPhonebookRecordsResponse(in android.hardware.radio.RadioResponseInfo info, in int updatedRecordIndex); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIo.aidl new file mode 100644 index 0000000000..3e4dcf6730 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIo.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +parcelable IccIo { + int command; + int fileId; + String path; + int p1; + int p2; + int p3; + String data; + String pin2; + String aid; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIoResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIoResult.aidl new file mode 100644 index 0000000000..58e43ebcca --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIoResult.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 -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; +@VintfStability +parcelable IccIoResult { + int sw1; + int sw2; + String simResponse; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/ImsiEncryptionInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/ImsiEncryptionInfo.aidl new file mode 100644 index 0000000000..087f399ce7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/ImsiEncryptionInfo.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 -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; +@VintfStability +parcelable ImsiEncryptionInfo { + String mcc; + String mnc; + byte[] carrierKey; + String keyIdentifier; + long expirationTime; + byte keyType; + const byte PUBLIC_KEY_TYPE_EPDG = 1; + const byte PUBLIC_KEY_TYPE_WLAN = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PbReceivedStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PbReceivedStatus.aidl new file mode 100644 index 0000000000..61babacce2 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PbReceivedStatus.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 -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; +@Backing(type="byte") @VintfStability +enum PbReceivedStatus { + PB_RECEIVED_OK = 1, + PB_RECEIVED_ERROR = 2, + PB_RECEIVED_ABORT = 3, + PB_RECEIVED_FINAL = 4, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PersoSubstate.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PersoSubstate.aidl new file mode 100644 index 0000000000..a09d7816c9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PersoSubstate.aidl @@ -0,0 +1,72 @@ +/* + * 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 -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; +@Backing(type="int") @VintfStability +enum PersoSubstate { + UNKNOWN = 0, + IN_PROGRESS = 1, + READY = 2, + SIM_NETWORK = 3, + SIM_NETWORK_SUBSET = 4, + SIM_CORPORATE = 5, + SIM_SERVICE_PROVIDER = 6, + SIM_SIM = 7, + SIM_NETWORK_PUK = 8, + SIM_NETWORK_SUBSET_PUK = 9, + SIM_CORPORATE_PUK = 10, + SIM_SERVICE_PROVIDER_PUK = 11, + SIM_SIM_PUK = 12, + RUIM_NETWORK1 = 13, + RUIM_NETWORK2 = 14, + RUIM_HRPD = 15, + RUIM_CORPORATE = 16, + RUIM_SERVICE_PROVIDER = 17, + RUIM_RUIM = 18, + RUIM_NETWORK1_PUK = 19, + RUIM_NETWORK2_PUK = 20, + RUIM_HRPD_PUK = 21, + RUIM_CORPORATE_PUK = 22, + RUIM_SERVICE_PROVIDER_PUK = 23, + RUIM_RUIM_PUK = 24, + SIM_SPN = 25, + SIM_SPN_PUK = 26, + SIM_SP_EHPLMN = 27, + SIM_SP_EHPLMN_PUK = 28, + SIM_ICCID = 29, + SIM_ICCID_PUK = 30, + SIM_IMPI = 31, + SIM_IMPI_PUK = 32, + SIM_NS_SP = 33, + SIM_NS_SP_PUK = 34, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookCapacity.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookCapacity.aidl new file mode 100644 index 0000000000..c1fa765de7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookCapacity.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 -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; +@VintfStability +parcelable PhonebookCapacity { + int maxAdnRecords; + int usedAdnRecords; + int maxEmailRecords; + int usedEmailRecords; + int maxAdditionalNumberRecords; + int usedAdditionalNumberRecords; + int maxNameLen; + int maxNumberLen; + int maxEmailLen; + int maxAdditionalNumberLen; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookRecordInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookRecordInfo.aidl new file mode 100644 index 0000000000..36bc9201e7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookRecordInfo.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 -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; +@VintfStability +parcelable PhonebookRecordInfo { + int recordId; + String name; + String number; + String[] emails; + String[] additionalNumbers; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PinState.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PinState.aidl new file mode 100644 index 0000000000..c78b92c70b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PinState.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 -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; +@Backing(type="int") @VintfStability +enum PinState { + UNKNOWN = 0, + ENABLED_NOT_VERIFIED = 1, + ENABLED_VERIFIED = 2, + DISABLED = 3, + ENABLED_BLOCKED = 4, + ENABLED_PERM_BLOCKED = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SelectUiccSub.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SelectUiccSub.aidl new file mode 100644 index 0000000000..4842fbe6df --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SelectUiccSub.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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; +@VintfStability +parcelable SelectUiccSub { + int slot; + int appIndex; + int subType; + int actStatus; + const int SUBSCRIPTION_TYPE_1 = 0; + const int SUBSCRIPTION_TYPE_2 = 1; + const int SUBSCRIPTION_TYPE_3 = 2; + const int ACT_STATUS_DEACTIVATE = 0; + const int ACT_STATUS_ACTIVATE = 1; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimApdu.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimApdu.aidl new file mode 100644 index 0000000000..d8e1dde370 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimApdu.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 -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; +@VintfStability +parcelable SimApdu { + int sessionId; + int cla; + int instruction; + int p1; + int p2; + int p3; + String data; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl new file mode 100644 index 0000000000..6fd89d50c6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimLockMultiSimPolicy.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 -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; +@Backing(type="int") @VintfStability +enum SimLockMultiSimPolicy { + NO_MULTISIM_POLICY = 0, + ONE_VALID_SIM_MUST_BE_PRESENT = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimRefreshResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimRefreshResult.aidl new file mode 100644 index 0000000000..dd3c1f2cf3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimRefreshResult.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 -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; +@VintfStability +parcelable SimRefreshResult { + int type; + int efId; + String aid; + const int TYPE_SIM_FILE_UPDATE = 0; + const int TYPE_SIM_INIT = 1; + const int TYPE_SIM_RESET = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.voice/1/.hash new file mode 100644 index 0000000000..5434224346 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/.hash @@ -0,0 +1 @@ +bc19c55b40e9ed285c21b6c1aaa66fe855bf031b diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/AudioQuality.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/AudioQuality.aidl new file mode 100644 index 0000000000..89bd2dcf5b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/AudioQuality.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 -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.voice; +@Backing(type="int") @VintfStability +enum AudioQuality { + UNSPECIFIED = 0, + AMR = 1, + AMR_WB = 2, + GSM_EFR = 3, + GSM_FR = 4, + GSM_HR = 5, + EVRC = 6, + EVRC_B = 7, + EVRC_WB = 8, + EVRC_NW = 9, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Call.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Call.aidl new file mode 100644 index 0000000000..7f445314b6 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Call.aidl @@ -0,0 +1,62 @@ +/* + * 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 -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.voice; +@VintfStability +parcelable Call { + int state; + int index; + int toa; + boolean isMpty; + boolean isMT; + byte als; + boolean isVoice; + boolean isVoicePrivacy; + String number; + int numberPresentation; + String name; + int namePresentation; + android.hardware.radio.voice.UusInfo[] uusInfo; + android.hardware.radio.voice.AudioQuality audioQuality; + String forwardedNumber; + const int PRESENTATION_ALLOWED = 0; + const int PRESENTATION_RESTRICTED = 1; + const int PRESENTATION_UNKNOWN = 2; + const int PRESENTATION_PAYPHONE = 3; + const int STATE_ACTIVE = 0; + const int STATE_HOLDING = 1; + const int STATE_DIALING = 2; + const int STATE_ALERTING = 3; + const int STATE_INCOMING = 4; + const int STATE_WAITING = 5; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CallForwardInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CallForwardInfo.aidl new file mode 100644 index 0000000000..7ef9e46387 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CallForwardInfo.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 -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.voice; +@VintfStability +parcelable CallForwardInfo { + int status; + int reason; + int serviceClass; + int toa; + String number; + int timeSeconds; + const int STATUS_DISABLE = 0; + const int STATUS_ENABLE = 1; + const int STATUS_INTERROGATE = 2; + const int STATUS_REGISTRATION = 3; + const int STATUS_ERASURE = 4; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaCallWaiting.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaCallWaiting.aidl new file mode 100644 index 0000000000..9edf1e7e75 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaCallWaiting.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 -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.voice; +@VintfStability +parcelable CdmaCallWaiting { + String number; + int numberPresentation; + String name; + android.hardware.radio.voice.CdmaSignalInfoRecord signalInfoRecord; + int numberType; + int numberPlan; + const int NUMBER_PLAN_UNKNOWN = 0; + const int NUMBER_PLAN_ISDN = 1; + const int NUMBER_PLAN_DATA = 3; + const int NUMBER_PLAN_TELEX = 4; + const int NUMBER_PLAN_NATIONAL = 8; + const int NUMBER_PLAN_PRIVATE = 9; + const int NUMBER_PRESENTATION_ALLOWED = 0; + const int NUMBER_PRESENTATION_RESTRICTED = 1; + const int NUMBER_PRESENTATION_UNKNOWN = 2; + const int NUMBER_TYPE_UNKNOWN = 0; + const int NUMBER_TYPE_INTERNATIONAL = 1; + const int NUMBER_TYPE_NATIONAL = 2; + const int NUMBER_TYPE_NETWORK_SPECIFIC = 3; + const int NUMBER_TYPE_SUBSCRIBER = 4; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl new file mode 100644 index 0000000000..b373aa5dc0 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaDisplayInfoRecord.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 -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.voice; +@VintfStability +parcelable CdmaDisplayInfoRecord { + String alphaBuf; + const int CDMA_ALPHA_INFO_BUFFER_LENGTH = 64; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaInformationRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaInformationRecord.aidl new file mode 100644 index 0000000000..cc4d3fa11e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaInformationRecord.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 -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.voice; +@VintfStability +parcelable CdmaInformationRecord { + int name; + android.hardware.radio.voice.CdmaDisplayInfoRecord[] display; + android.hardware.radio.voice.CdmaNumberInfoRecord[] number; + android.hardware.radio.voice.CdmaSignalInfoRecord[] signal; + android.hardware.radio.voice.CdmaRedirectingNumberInfoRecord[] redir; + android.hardware.radio.voice.CdmaLineControlInfoRecord[] lineCtrl; + android.hardware.radio.voice.CdmaT53ClirInfoRecord[] clir; + android.hardware.radio.voice.CdmaT53AudioControlInfoRecord[] audioCtrl; + const int CDMA_MAX_NUMBER_OF_INFO_RECS = 10; + const int NAME_DISPLAY = 0; + const int NAME_CALLED_PARTY_NUMBER = 1; + const int NAME_CALLING_PARTY_NUMBER = 2; + const int NAME_CONNECTED_NUMBER = 3; + const int NAME_SIGNAL = 4; + const int NAME_REDIRECTING_NUMBER = 5; + const int NAME_LINE_CONTROL = 6; + const int NAME_EXTENDED_DISPLAY = 7; + const int NAME_T53_CLIR = 8; + const int NAME_T53_RELEASE = 9; + const int NAME_T53_AUDIO_CONTROL = 10; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl new file mode 100644 index 0000000000..d7f6cd4e2c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaLineControlInfoRecord.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 -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.voice; +@VintfStability +parcelable CdmaLineControlInfoRecord { + byte lineCtrlPolarityIncluded; + byte lineCtrlToggle; + byte lineCtrlReverse; + byte lineCtrlPowerDenial; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl new file mode 100644 index 0000000000..26a7df544d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaNumberInfoRecord.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 -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.voice; +@VintfStability +parcelable CdmaNumberInfoRecord { + String number; + byte numberType; + byte numberPlan; + byte pi; + byte si; + const int CDMA_NUMBER_INFO_BUFFER_LENGTH = 81; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl new file mode 100644 index 0000000000..5ea4e50546 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl @@ -0,0 +1,49 @@ +/* + * 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 -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.voice; +@Backing(type="int") @VintfStability +enum CdmaOtaProvisionStatus { + SPL_UNLOCKED = 0, + SPC_RETRIES_EXCEEDED = 1, + A_KEY_EXCHANGED = 2, + SSD_UPDATED = 3, + NAM_DOWNLOADED = 4, + MDN_DOWNLOADED = 5, + IMSI_DOWNLOADED = 6, + PRL_DOWNLOADED = 7, + COMMITTED = 8, + OTAPA_STARTED = 9, + OTAPA_STOPPED = 10, + OTAPA_ABORTED = 11, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl new file mode 100644 index 0000000000..f0f2b04c95 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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.voice; +@VintfStability +parcelable CdmaRedirectingNumberInfoRecord { + android.hardware.radio.voice.CdmaNumberInfoRecord redirectingNumber; + int redirectingReason; + const int REDIRECTING_REASON_UNKNOWN = 0; + const int REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1; + const int REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2; + const int REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9; + const int REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10; + const int REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15; + const int REDIRECTING_REASON_RESERVED = 16; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl new file mode 100644 index 0000000000..2ebb3960ba --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaSignalInfoRecord.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 -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.voice; +@VintfStability +parcelable CdmaSignalInfoRecord { + boolean isPresent; + byte signalType; + byte alertPitch; + byte signal; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl new file mode 100644 index 0000000000..33e2c2bd3f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.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 -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.voice; +@VintfStability +parcelable CdmaT53AudioControlInfoRecord { + byte upLink; + byte downLink; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl new file mode 100644 index 0000000000..457fd18f75 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53ClirInfoRecord.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 -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.voice; +@VintfStability +parcelable CdmaT53ClirInfoRecord { + byte cause; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CfData.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CfData.aidl new file mode 100644 index 0000000000..744e7ae7fa --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CfData.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 -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.voice; +@VintfStability +parcelable CfData { + android.hardware.radio.voice.CallForwardInfo[] cfInfo; + const int NUM_SERVICE_CLASSES = 7; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/ClipStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/ClipStatus.aidl new file mode 100644 index 0000000000..dafc2b9d36 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/ClipStatus.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 -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.voice; +@Backing(type="int") @VintfStability +enum ClipStatus { + CLIP_PROVISIONED = 0, + CLIP_UNPROVISIONED = 1, + UNKNOWN = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Dial.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Dial.aidl new file mode 100644 index 0000000000..c9a02a91c4 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Dial.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 -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.voice; +@VintfStability +parcelable Dial { + String address; + int clir; + android.hardware.radio.voice.UusInfo[] uusInfo; + const int CLIR_DEFAULT = 0; + const int CLIR_INVOCATION = 1; + const int CLIR_SUPPRESSION = 2; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyCallRouting.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyCallRouting.aidl new file mode 100644 index 0000000000..b31a661158 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyCallRouting.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 -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.voice; +@Backing(type="int") @VintfStability +enum EmergencyCallRouting { + UNKNOWN = 0, + EMERGENCY = 1, + NORMAL = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyNumber.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyNumber.aidl new file mode 100644 index 0000000000..39bcf1a20e --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyNumber.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 -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.voice; +@VintfStability +parcelable EmergencyNumber { + String number; + String mcc; + String mnc; + int categories; + String[] urns; + int sources; + const int SOURCE_NETWORK_SIGNALING = 1; + const int SOURCE_SIM = 2; + const int SOURCE_MODEM_CONFIG = 4; + const int SOURCE_DEFAULT = 8; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyServiceCategory.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyServiceCategory.aidl new file mode 100644 index 0000000000..34d3c40eb3 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyServiceCategory.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 -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.voice; +@Backing(type="int") @VintfStability +enum EmergencyServiceCategory { + UNSPECIFIED = 0, + POLICE = 1, + AMBULANCE = 2, + FIRE_BRIGADE = 4, + MARINE_GUARD = 8, + MOUNTAIN_RESCUE = 16, + MIEC = 32, + AIEC = 64, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/IRadioVoice.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/IRadioVoice.aidl new file mode 100644 index 0000000000..603b1d67aa --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/IRadioVoice.aidl @@ -0,0 +1,76 @@ +/* + * 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 -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.voice; +@VintfStability +interface IRadioVoice { + oneway void acceptCall(in int serial); + oneway void cancelPendingUssd(in int serial); + oneway void conference(in int serial); + oneway void dial(in int serial, in android.hardware.radio.voice.Dial dialInfo); + oneway void emergencyDial(in int serial, in android.hardware.radio.voice.Dial dialInfo, in int categories, in String[] urns, in android.hardware.radio.voice.EmergencyCallRouting routing, in boolean hasKnownUserIntentEmergency, in boolean isTesting); + oneway void exitEmergencyCallbackMode(in int serial); + oneway void explicitCallTransfer(in int serial); + oneway void getCallForwardStatus(in int serial, in android.hardware.radio.voice.CallForwardInfo callInfo); + oneway void getCallWaiting(in int serial, in int serviceClass); + oneway void getClip(in int serial); + oneway void getClir(in int serial); + oneway void getCurrentCalls(in int serial); + oneway void getLastCallFailCause(in int serial); + oneway void getMute(in int serial); + oneway void getPreferredVoicePrivacy(in int serial); + oneway void getTtyMode(in int serial); + oneway void handleStkCallSetupRequestFromSim(in int serial, in boolean accept); + oneway void hangup(in int serial, in int gsmIndex); + oneway void hangupForegroundResumeBackground(in int serial); + oneway void hangupWaitingOrBackground(in int serial); + oneway void isVoNrEnabled(in int serial); + oneway void rejectCall(in int serial); + oneway void responseAcknowledgement(); + oneway void sendBurstDtmf(in int serial, in String dtmf, in int on, in int off); + oneway void sendCdmaFeatureCode(in int serial, in String featureCode); + oneway void sendDtmf(in int serial, in String s); + oneway void sendUssd(in int serial, in String ussd); + oneway void separateConnection(in int serial, in int gsmIndex); + oneway void setCallForward(in int serial, in android.hardware.radio.voice.CallForwardInfo callInfo); + oneway void setCallWaiting(in int serial, in boolean enable, in int serviceClass); + oneway void setClir(in int serial, in int status); + oneway void setMute(in int serial, in boolean enable); + oneway void setPreferredVoicePrivacy(in int serial, in boolean enable); + oneway void setResponseFunctions(in android.hardware.radio.voice.IRadioVoiceResponse radioVoiceResponse, in android.hardware.radio.voice.IRadioVoiceIndication radioVoiceIndication); + oneway void setTtyMode(in int serial, in android.hardware.radio.voice.TtyMode mode); + oneway void setVoNrEnabled(in int serial, in boolean enable); + oneway void startDtmf(in int serial, in String s); + oneway void stopDtmf(in int serial); + oneway void switchWaitingOrHoldingAndActive(in int serial); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/IRadioVoiceIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/IRadioVoiceIndication.aidl new file mode 100644 index 0000000000..189ed43cf9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/IRadioVoiceIndication.aidl @@ -0,0 +1,52 @@ +/* + * 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 -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.voice; +@VintfStability +interface IRadioVoiceIndication { + oneway void callRing(in android.hardware.radio.RadioIndicationType type, in boolean isGsm, in android.hardware.radio.voice.CdmaSignalInfoRecord record); + oneway void callStateChanged(in android.hardware.radio.RadioIndicationType type); + oneway void cdmaCallWaiting(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.CdmaCallWaiting callWaitingRecord); + oneway void cdmaInfoRec(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.CdmaInformationRecord[] records); + oneway void cdmaOtaProvisionStatus(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.CdmaOtaProvisionStatus status); + oneway void currentEmergencyNumberList(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.EmergencyNumber[] emergencyNumberList); + oneway void enterEmergencyCallbackMode(in android.hardware.radio.RadioIndicationType type); + oneway void exitEmergencyCallbackMode(in android.hardware.radio.RadioIndicationType type); + oneway void indicateRingbackTone(in android.hardware.radio.RadioIndicationType type, in boolean start); + oneway void onSupplementaryServiceIndication(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.StkCcUnsolSsResult ss); + oneway void onUssd(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.UssdModeType modeType, in String msg); + oneway void resendIncallMute(in android.hardware.radio.RadioIndicationType type); + oneway void srvccStateNotify(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.voice.SrvccState state); + oneway void stkCallControlAlphaNotify(in android.hardware.radio.RadioIndicationType type, in String alpha); + oneway void stkCallSetup(in android.hardware.radio.RadioIndicationType type, in long timeout); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/IRadioVoiceResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/IRadioVoiceResponse.aidl new file mode 100644 index 0000000000..7acc0446dd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/IRadioVoiceResponse.aidl @@ -0,0 +1,75 @@ +/* + * 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 -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.voice; +@VintfStability +interface IRadioVoiceResponse { + oneway void acceptCallResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void acknowledgeRequest(in int serial); + oneway void cancelPendingUssdResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void conferenceResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void dialResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void emergencyDialResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void exitEmergencyCallbackModeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void explicitCallTransferResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getCallForwardStatusResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.voice.CallForwardInfo[] callForwardInfos); + oneway void getCallWaitingResponse(in android.hardware.radio.RadioResponseInfo info, in boolean enable, in int serviceClass); + oneway void getClipResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.voice.ClipStatus status); + oneway void getClirResponse(in android.hardware.radio.RadioResponseInfo info, in int n, in int m); + oneway void getCurrentCallsResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.voice.Call[] calls); + oneway void getLastCallFailCauseResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.voice.LastCallFailCauseInfo failCauseinfo); + oneway void getMuteResponse(in android.hardware.radio.RadioResponseInfo info, in boolean enable); + oneway void getPreferredVoicePrivacyResponse(in android.hardware.radio.RadioResponseInfo info, in boolean enable); + oneway void getTtyModeResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.voice.TtyMode mode); + oneway void handleStkCallSetupRequestFromSimResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void hangupConnectionResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void hangupForegroundResumeBackgroundResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void hangupWaitingOrBackgroundResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void isVoNrEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean enable); + oneway void rejectCallResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendBurstDtmfResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendCdmaFeatureCodeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendDtmfResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void sendUssdResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void separateConnectionResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCallForwardResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setCallWaitingResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setClirResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setMuteResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setPreferredVoicePrivacyResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setTtyModeResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setVoNrEnabledResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void startDtmfResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void stopDtmfResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void switchWaitingOrHoldingAndActiveResponse(in android.hardware.radio.RadioResponseInfo info); +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCause.aidl new file mode 100644 index 0000000000..3e178405df --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCause.aidl @@ -0,0 +1,133 @@ +/* + * 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 -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.voice; +@Backing(type="int") @VintfStability +enum LastCallFailCause { + UNOBTAINABLE_NUMBER = 1, + NO_ROUTE_TO_DESTINATION = 3, + CHANNEL_UNACCEPTABLE = 6, + OPERATOR_DETERMINED_BARRING = 8, + NORMAL = 16, + BUSY = 17, + NO_USER_RESPONDING = 18, + NO_ANSWER_FROM_USER = 19, + CALL_REJECTED = 21, + NUMBER_CHANGED = 22, + PREEMPTION = 25, + DESTINATION_OUT_OF_ORDER = 27, + INVALID_NUMBER_FORMAT = 28, + FACILITY_REJECTED = 29, + RESP_TO_STATUS_ENQUIRY = 30, + NORMAL_UNSPECIFIED = 31, + CONGESTION = 34, + NETWORK_OUT_OF_ORDER = 38, + TEMPORARY_FAILURE = 41, + SWITCHING_EQUIPMENT_CONGESTION = 42, + ACCESS_INFORMATION_DISCARDED = 43, + REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE = 44, + RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 47, + QOS_UNAVAILABLE = 49, + REQUESTED_FACILITY_NOT_SUBSCRIBED = 50, + INCOMING_CALLS_BARRED_WITHIN_CUG = 55, + BEARER_CAPABILITY_NOT_AUTHORIZED = 57, + BEARER_CAPABILITY_UNAVAILABLE = 58, + SERVICE_OPTION_NOT_AVAILABLE = 63, + BEARER_SERVICE_NOT_IMPLEMENTED = 65, + ACM_LIMIT_EXCEEDED = 68, + REQUESTED_FACILITY_NOT_IMPLEMENTED = 69, + ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 70, + SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79, + INVALID_TRANSACTION_IDENTIFIER = 81, + USER_NOT_MEMBER_OF_CUG = 87, + INCOMPATIBLE_DESTINATION = 88, + INVALID_TRANSIT_NW_SELECTION = 91, + SEMANTICALLY_INCORRECT_MESSAGE = 95, + INVALID_MANDATORY_INFORMATION = 96, + MESSAGE_TYPE_NON_IMPLEMENTED = 97, + MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98, + INFORMATION_ELEMENT_NON_EXISTENT = 99, + CONDITIONAL_IE_ERROR = 100, + MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101, + RECOVERY_ON_TIMER_EXPIRED = 102, + PROTOCOL_ERROR_UNSPECIFIED = 111, + INTERWORKING_UNSPECIFIED = 127, + CALL_BARRED = 240, + FDN_BLOCKED = 241, + IMSI_UNKNOWN_IN_VLR = 242, + IMEI_NOT_ACCEPTED = 243, + DIAL_MODIFIED_TO_USSD = 244, + DIAL_MODIFIED_TO_SS = 245, + DIAL_MODIFIED_TO_DIAL = 246, + RADIO_OFF = 247, + OUT_OF_SERVICE = 248, + NO_VALID_SIM = 249, + RADIO_INTERNAL_ERROR = 250, + NETWORK_RESP_TIMEOUT = 251, + NETWORK_REJECT = 252, + RADIO_ACCESS_FAILURE = 253, + RADIO_LINK_FAILURE = 254, + RADIO_LINK_LOST = 255, + RADIO_UPLINK_FAILURE = 256, + RADIO_SETUP_FAILURE = 257, + RADIO_RELEASE_NORMAL = 258, + RADIO_RELEASE_ABNORMAL = 259, + ACCESS_CLASS_BLOCKED = 260, + NETWORK_DETACH = 261, + CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000, + CDMA_DROP = 1001, + CDMA_INTERCEPT = 1002, + CDMA_REORDER = 1003, + CDMA_SO_REJECT = 1004, + CDMA_RETRY_ORDER = 1005, + CDMA_ACCESS_FAILURE = 1006, + CDMA_PREEMPTED = 1007, + CDMA_NOT_EMERGENCY = 1008, + CDMA_ACCESS_BLOCKED = 1009, + OEM_CAUSE_1 = 61441, + OEM_CAUSE_2 = 61442, + OEM_CAUSE_3 = 61443, + OEM_CAUSE_4 = 61444, + OEM_CAUSE_5 = 61445, + OEM_CAUSE_6 = 61446, + OEM_CAUSE_7 = 61447, + OEM_CAUSE_8 = 61448, + OEM_CAUSE_9 = 61449, + OEM_CAUSE_10 = 61450, + OEM_CAUSE_11 = 61451, + OEM_CAUSE_12 = 61452, + OEM_CAUSE_13 = 61453, + OEM_CAUSE_14 = 61454, + OEM_CAUSE_15 = 61455, + ERROR_UNSPECIFIED = 65535, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCauseInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCauseInfo.aidl new file mode 100644 index 0000000000..af75a4063a --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCauseInfo.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 -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.voice; +@VintfStability +parcelable LastCallFailCauseInfo { + android.hardware.radio.voice.LastCallFailCause causeCode; + String vendorCause; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SrvccState.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SrvccState.aidl new file mode 100644 index 0000000000..8e7e9fbdf7 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SrvccState.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 -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.voice; +@Backing(type="int") @VintfStability +enum SrvccState { + HANDOVER_STARTED = 0, + HANDOVER_COMPLETED = 1, + HANDOVER_FAILED = 2, + HANDOVER_CANCELED = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SsInfoData.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SsInfoData.aidl new file mode 100644 index 0000000000..9517847ada --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SsInfoData.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 -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.voice; +@VintfStability +parcelable SsInfoData { + int[] ssInfo; + const int SS_INFO_MAX = 4; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/StkCcUnsolSsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/StkCcUnsolSsResult.aidl new file mode 100644 index 0000000000..71ef7a77fc --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/StkCcUnsolSsResult.aidl @@ -0,0 +1,84 @@ +/* + * 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 -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.voice; +@VintfStability +parcelable StkCcUnsolSsResult { + int serviceType; + int requestType; + int teleserviceType; + int serviceClass; + android.hardware.radio.RadioError result; + android.hardware.radio.voice.SsInfoData[] ssInfo; + android.hardware.radio.voice.CfData[] cfData; + const int REQUEST_TYPE_ACTIVATION = 0; + const int REQUEST_TYPE_DEACTIVATION = 1; + const int REQUEST_TYPE_INTERROGATION = 2; + const int REQUEST_TYPE_REGISTRATION = 3; + const int REQUEST_TYPE_ERASURE = 4; + const int SERVICE_TYPE_CFU = 0; + const int SERVICE_TYPE_CF_BUSY = 1; + const int SERVICE_TYPE_CF_NO_REPLY = 2; + const int SERVICE_TYPE_CF_NOT_REACHABLE = 3; + const int SERVICE_TYPE_CF_ALL = 4; + const int SERVICE_TYPE_CF_ALL_CONDITIONAL = 5; + const int SERVICE_TYPE_CLIP = 6; + const int SERVICE_TYPE_CLIR = 7; + const int SERVICE_TYPE_COLP = 8; + const int SERVICE_TYPE_COLR = 9; + const int SERVICE_TYPE_WAIT = 10; + const int SERVICE_TYPE_BAOC = 11; + const int SERVICE_TYPE_BAOIC = 12; + const int SERVICE_TYPE_BAOIC_EXC_HOME = 13; + const int SERVICE_TYPE_BAIC = 14; + const int SERVICE_TYPE_BAIC_ROAMING = 15; + const int SERVICE_TYPE_ALL_BARRING = 16; + const int SERVICE_TYPE_OUTGOING_BARRING = 17; + const int SERVICE_TYPE_INCOMING_BARRING = 18; + const int TELESERVICE_TYPE_ALL_TELE_AND_BEARER_SERVICES = 0; + const int TELESERVICE_TYPE_ALL_TELESEVICES = 1; + const int TELESERVICE_TYPE_TELEPHONY = 2; + const int TELESERVICE_TYPE_ALL_DATA_TELESERVICES = 3; + 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; + const int SUPP_SERVICE_CLASS_DATA = 2; + const int SUPP_SERVICE_CLASS_FAX = 4; + const int SUPP_SERVICE_CLASS_SMS = 8; + const int SUPP_SERVICE_CLASS_DATA_SYNC = 16; + const int SUPP_SERVICE_CLASS_DATA_ASYNC = 32; + const int SUPP_SERVICE_CLASS_PACKET = 64; + const int SUPP_SERVICE_CLASS_PAD = 128; + const int SUPP_SERVICE_CLASS_MAX = 128; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/TtyMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/TtyMode.aidl new file mode 100644 index 0000000000..bb0a9f1ac9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/TtyMode.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 -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.voice; +@Backing(type="int") @VintfStability +enum TtyMode { + OFF = 0, + FULL = 1, + HCO = 2, + VCO = 3, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UssdModeType.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UssdModeType.aidl new file mode 100644 index 0000000000..9a9d723ada --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UssdModeType.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 -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.voice; +@Backing(type="int") @VintfStability +enum UssdModeType { + NOTIFY = 0, + REQUEST = 1, + NW_RELEASE = 2, + LOCAL_CLIENT = 3, + NOT_SUPPORTED = 4, + NW_TIMEOUT = 5, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UusInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UusInfo.aidl new file mode 100644 index 0000000000..0198de9bb0 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UusInfo.aidl @@ -0,0 +1,52 @@ +/* + * 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 -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.voice; +@VintfStability +parcelable UusInfo { + int uusType; + int uusDcs; + String uusData; + const int UUS_DCS_USP = 0; + const int UUS_DCS_OSIHLP = 1; + const int UUS_DCS_X244 = 2; + const int UUS_DCS_RMCF = 3; + const int UUS_DCS_IA5C = 4; + const int UUS_TYPE_TYPE1_IMPLICIT = 0; + const int UUS_TYPE_TYPE1_REQUIRED = 1; + const int UUS_TYPE_TYPE1_NOT_REQUIRED = 2; + const int UUS_TYPE_TYPE2_REQUIRED = 3; + const int UUS_TYPE_TYPE2_NOT_REQUIRED = 4; + const int UUS_TYPE_TYPE3_REQUIRED = 5; + const int UUS_TYPE_TYPE3_NOT_REQUIRED = 6; +} diff --git a/security/keymint/aidl/Android.bp b/security/keymint/aidl/Android.bp index c9ee1b3d27..a233087fab 100644 --- a/security/keymint/aidl/Android.bp +++ b/security/keymint/aidl/Android.bp @@ -35,7 +35,18 @@ aidl_interface { ], }, }, - versions: ["1"], + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.security.secureclock-V1"], + }, + { + version: "2", + imports: ["android.hardware.security.secureclock-V1"], + }, + + ], + } // cc_defaults that includes the latest KeyMint AIDL library. diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/.hash b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/.hash new file mode 100644 index 0000000000..69ba9a6bc5 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/.hash @@ -0,0 +1 @@ +207c9f218b9b9e4e74ff5232eb16511eca9d7d2e diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Algorithm.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Algorithm.aidl new file mode 100644 index 0000000000..6da124f601 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Algorithm.aidl @@ -0,0 +1,43 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum Algorithm { + RSA = 1, + EC = 3, + AES = 32, + TRIPLE_DES = 33, + HMAC = 128, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/AttestationKey.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/AttestationKey.aidl new file mode 100644 index 0000000000..90f2e6ee54 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/AttestationKey.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 -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.keymint; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable AttestationKey { + byte[] keyBlob; + android.hardware.security.keymint.KeyParameter[] attestKeyParams; + byte[] issuerSubjectName; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/BeginResult.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/BeginResult.aidl new file mode 100644 index 0000000000..c952a3152a --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/BeginResult.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@VintfStability +parcelable BeginResult { + long challenge; + android.hardware.security.keymint.KeyParameter[] params; + android.hardware.security.keymint.IKeyMintOperation operation; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/BlockMode.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/BlockMode.aidl new file mode 100644 index 0000000000..004988326b --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/BlockMode.aidl @@ -0,0 +1,42 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum BlockMode { + ECB = 1, + CBC = 2, + CTR = 3, + GCM = 32, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Certificate.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Certificate.aidl new file mode 100644 index 0000000000..645f0a72ee --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Certificate.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@VintfStability +parcelable Certificate { + byte[] encodedCertificate; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/DeviceInfo.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/DeviceInfo.aidl new file mode 100644 index 0000000000..d04d49cea8 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/DeviceInfo.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 -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.keymint; +/* @hide */ +@VintfStability +parcelable DeviceInfo { + byte[] deviceInfo; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Digest.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Digest.aidl new file mode 100644 index 0000000000..0df709609f --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Digest.aidl @@ -0,0 +1,45 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum Digest { + NONE = 0, + MD5 = 1, + SHA1 = 2, + SHA_2_224 = 3, + SHA_2_256 = 4, + SHA_2_384 = 5, + SHA_2_512 = 6, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/EcCurve.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/EcCurve.aidl new file mode 100644 index 0000000000..ffc7efe0e7 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/EcCurve.aidl @@ -0,0 +1,43 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum EcCurve { + P_224 = 0, + P_256 = 1, + P_384 = 2, + P_521 = 3, + CURVE_25519 = 4, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/ErrorCode.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/ErrorCode.aidl new file mode 100644 index 0000000000..b05a0f3d83 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/ErrorCode.aidl @@ -0,0 +1,125 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum ErrorCode { + OK = 0, + ROOT_OF_TRUST_ALREADY_SET = -1, + UNSUPPORTED_PURPOSE = -2, + INCOMPATIBLE_PURPOSE = -3, + UNSUPPORTED_ALGORITHM = -4, + INCOMPATIBLE_ALGORITHM = -5, + UNSUPPORTED_KEY_SIZE = -6, + UNSUPPORTED_BLOCK_MODE = -7, + INCOMPATIBLE_BLOCK_MODE = -8, + UNSUPPORTED_MAC_LENGTH = -9, + UNSUPPORTED_PADDING_MODE = -10, + INCOMPATIBLE_PADDING_MODE = -11, + UNSUPPORTED_DIGEST = -12, + INCOMPATIBLE_DIGEST = -13, + INVALID_EXPIRATION_TIME = -14, + INVALID_USER_ID = -15, + INVALID_AUTHORIZATION_TIMEOUT = -16, + UNSUPPORTED_KEY_FORMAT = -17, + INCOMPATIBLE_KEY_FORMAT = -18, + UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM = -19, + UNSUPPORTED_KEY_VERIFICATION_ALGORITHM = -20, + INVALID_INPUT_LENGTH = -21, + KEY_EXPORT_OPTIONS_INVALID = -22, + DELEGATION_NOT_ALLOWED = -23, + KEY_NOT_YET_VALID = -24, + KEY_EXPIRED = -25, + KEY_USER_NOT_AUTHENTICATED = -26, + OUTPUT_PARAMETER_NULL = -27, + INVALID_OPERATION_HANDLE = -28, + INSUFFICIENT_BUFFER_SPACE = -29, + VERIFICATION_FAILED = -30, + TOO_MANY_OPERATIONS = -31, + UNEXPECTED_NULL_POINTER = -32, + INVALID_KEY_BLOB = -33, + IMPORTED_KEY_NOT_ENCRYPTED = -34, + IMPORTED_KEY_DECRYPTION_FAILED = -35, + IMPORTED_KEY_NOT_SIGNED = -36, + IMPORTED_KEY_VERIFICATION_FAILED = -37, + INVALID_ARGUMENT = -38, + UNSUPPORTED_TAG = -39, + INVALID_TAG = -40, + MEMORY_ALLOCATION_FAILED = -41, + IMPORT_PARAMETER_MISMATCH = -44, + SECURE_HW_ACCESS_DENIED = -45, + OPERATION_CANCELLED = -46, + CONCURRENT_ACCESS_CONFLICT = -47, + SECURE_HW_BUSY = -48, + SECURE_HW_COMMUNICATION_FAILED = -49, + UNSUPPORTED_EC_FIELD = -50, + MISSING_NONCE = -51, + INVALID_NONCE = -52, + MISSING_MAC_LENGTH = -53, + KEY_RATE_LIMIT_EXCEEDED = -54, + CALLER_NONCE_PROHIBITED = -55, + KEY_MAX_OPS_EXCEEDED = -56, + INVALID_MAC_LENGTH = -57, + MISSING_MIN_MAC_LENGTH = -58, + UNSUPPORTED_MIN_MAC_LENGTH = -59, + UNSUPPORTED_KDF = -60, + UNSUPPORTED_EC_CURVE = -61, + KEY_REQUIRES_UPGRADE = -62, + ATTESTATION_CHALLENGE_MISSING = -63, + KEYMINT_NOT_CONFIGURED = -64, + ATTESTATION_APPLICATION_ID_MISSING = -65, + CANNOT_ATTEST_IDS = -66, + ROLLBACK_RESISTANCE_UNAVAILABLE = -67, + HARDWARE_TYPE_UNAVAILABLE = -68, + PROOF_OF_PRESENCE_REQUIRED = -69, + CONCURRENT_PROOF_OF_PRESENCE_REQUESTED = -70, + NO_USER_CONFIRMATION = -71, + DEVICE_LOCKED = -72, + EARLY_BOOT_ENDED = -73, + ATTESTATION_KEYS_NOT_PROVISIONED = -74, + ATTESTATION_IDS_NOT_PROVISIONED = -75, + INVALID_OPERATION = -76, + STORAGE_KEY_UNSUPPORTED = -77, + INCOMPATIBLE_MGF_DIGEST = -78, + UNSUPPORTED_MGF_DIGEST = -79, + MISSING_NOT_BEFORE = -80, + MISSING_NOT_AFTER = -81, + MISSING_ISSUER_SUBJECT = -82, + INVALID_ISSUER_SUBJECT = -83, + BOOT_LEVEL_EXCEEDED = -84, + HARDWARE_NOT_YET_AVAILABLE = -85, + UNIMPLEMENTED = -100, + VERSION_MISMATCH = -101, + UNKNOWN_ERROR = -1000, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/HardwareAuthToken.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/HardwareAuthToken.aidl new file mode 100644 index 0000000000..2e07924382 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/HardwareAuthToken.aidl @@ -0,0 +1,44 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable HardwareAuthToken { + long challenge; + long userId; + long authenticatorId; + android.hardware.security.keymint.HardwareAuthenticatorType authenticatorType = android.hardware.security.keymint.HardwareAuthenticatorType.NONE; + android.hardware.security.secureclock.Timestamp timestamp; + byte[] mac; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/HardwareAuthenticatorType.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/HardwareAuthenticatorType.aidl new file mode 100644 index 0000000000..dfc98f0066 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/HardwareAuthenticatorType.aidl @@ -0,0 +1,42 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum HardwareAuthenticatorType { + NONE = 0, + PASSWORD = 1, + FINGERPRINT = 2, + ANY = -1, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/IKeyMintDevice.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/IKeyMintDevice.aidl new file mode 100644 index 0000000000..dcc22c4ba7 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/IKeyMintDevice.aidl @@ -0,0 +1,56 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@SensitiveData @VintfStability +interface IKeyMintDevice { + android.hardware.security.keymint.KeyMintHardwareInfo getHardwareInfo(); + void addRngEntropy(in byte[] data); + android.hardware.security.keymint.KeyCreationResult generateKey(in android.hardware.security.keymint.KeyParameter[] keyParams, in @nullable android.hardware.security.keymint.AttestationKey attestationKey); + android.hardware.security.keymint.KeyCreationResult importKey(in android.hardware.security.keymint.KeyParameter[] keyParams, in android.hardware.security.keymint.KeyFormat keyFormat, in byte[] keyData, in @nullable android.hardware.security.keymint.AttestationKey attestationKey); + android.hardware.security.keymint.KeyCreationResult importWrappedKey(in byte[] wrappedKeyData, in byte[] wrappingKeyBlob, in byte[] maskingKey, in android.hardware.security.keymint.KeyParameter[] unwrappingParams, in long passwordSid, in long biometricSid); + byte[] upgradeKey(in byte[] keyBlobToUpgrade, in android.hardware.security.keymint.KeyParameter[] upgradeParams); + void deleteKey(in byte[] keyBlob); + void deleteAllKeys(); + void destroyAttestationIds(); + android.hardware.security.keymint.BeginResult begin(in android.hardware.security.keymint.KeyPurpose purpose, in byte[] keyBlob, in android.hardware.security.keymint.KeyParameter[] params, in @nullable android.hardware.security.keymint.HardwareAuthToken authToken); + void deviceLocked(in boolean passwordOnly, in @nullable android.hardware.security.secureclock.TimeStampToken timestampToken); + void earlyBootEnded(); + byte[] convertStorageKeyToEphemeral(in byte[] storageKeyBlob); + android.hardware.security.keymint.KeyCharacteristics[] getKeyCharacteristics(in byte[] keyBlob, in byte[] appId, in byte[] appData); + byte[16] getRootOfTrustChallenge(); + byte[] getRootOfTrust(in byte[16] challenge); + void sendRootOfTrust(in byte[] rootOfTrust); + const int AUTH_TOKEN_MAC_LENGTH = 32; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/IKeyMintOperation.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/IKeyMintOperation.aidl new file mode 100644 index 0000000000..4ab4ffed11 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/IKeyMintOperation.aidl @@ -0,0 +1,42 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@SensitiveData @VintfStability +interface IKeyMintOperation { + void updateAad(in byte[] input, in @nullable android.hardware.security.keymint.HardwareAuthToken authToken, in @nullable android.hardware.security.secureclock.TimeStampToken timeStampToken); + byte[] update(in byte[] input, in @nullable android.hardware.security.keymint.HardwareAuthToken authToken, in @nullable android.hardware.security.secureclock.TimeStampToken timeStampToken); + byte[] finish(in @nullable byte[] input, in @nullable byte[] signature, in @nullable android.hardware.security.keymint.HardwareAuthToken authToken, in @nullable android.hardware.security.secureclock.TimeStampToken timestampToken, in @nullable byte[] confirmationToken); + void abort(); +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl new file mode 100644 index 0000000000..f56646227b --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl @@ -0,0 +1,46 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@VintfStability +interface IRemotelyProvisionedComponent { + android.hardware.security.keymint.RpcHardwareInfo getHardwareInfo(); + byte[] generateEcdsaP256KeyPair(in boolean testMode, out android.hardware.security.keymint.MacedPublicKey macedPublicKey); + byte[] generateCertificateRequest(in boolean testMode, in android.hardware.security.keymint.MacedPublicKey[] keysToSign, in byte[] endpointEncryptionCertChain, in byte[] challenge, out android.hardware.security.keymint.DeviceInfo deviceInfo, out android.hardware.security.keymint.ProtectedData protectedData); + const int STATUS_FAILED = 1; + const int STATUS_INVALID_MAC = 2; + const int STATUS_PRODUCTION_KEY_IN_TEST_REQUEST = 3; + const int STATUS_TEST_KEY_IN_PRODUCTION_REQUEST = 4; + const int STATUS_INVALID_EEK = 5; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyCharacteristics.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyCharacteristics.aidl new file mode 100644 index 0000000000..008381f282 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyCharacteristics.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@VintfStability +parcelable KeyCharacteristics { + android.hardware.security.keymint.SecurityLevel securityLevel = android.hardware.security.keymint.SecurityLevel.SOFTWARE; + android.hardware.security.keymint.KeyParameter[] authorizations; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyCreationResult.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyCreationResult.aidl new file mode 100644 index 0000000000..9f77d3e3d5 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyCreationResult.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 -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.keymint; +/* @hide */ +@VintfStability +parcelable KeyCreationResult { + byte[] keyBlob; + android.hardware.security.keymint.KeyCharacteristics[] keyCharacteristics; + android.hardware.security.keymint.Certificate[] certificateChain; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyFormat.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyFormat.aidl new file mode 100644 index 0000000000..9560d8d2b5 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyFormat.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum KeyFormat { + X509 = 0, + PKCS8 = 1, + RAW = 3, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyMintHardwareInfo.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyMintHardwareInfo.aidl new file mode 100644 index 0000000000..2113e42a8e --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyMintHardwareInfo.aidl @@ -0,0 +1,43 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable KeyMintHardwareInfo { + int versionNumber; + android.hardware.security.keymint.SecurityLevel securityLevel = android.hardware.security.keymint.SecurityLevel.SOFTWARE; + @utf8InCpp String keyMintName; + @utf8InCpp String keyMintAuthorName; + boolean timestampTokenRequired; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyOrigin.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyOrigin.aidl new file mode 100644 index 0000000000..4b3c659ffe --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyOrigin.aidl @@ -0,0 +1,43 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum KeyOrigin { + GENERATED = 0, + DERIVED = 1, + IMPORTED = 2, + RESERVED = 3, + SECURELY_IMPORTED = 4, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyParameter.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyParameter.aidl new file mode 100644 index 0000000000..c5a1e011d2 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyParameter.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable KeyParameter { + android.hardware.security.keymint.Tag tag = android.hardware.security.keymint.Tag.INVALID; + android.hardware.security.keymint.KeyParameterValue value; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyParameterValue.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyParameterValue.aidl new file mode 100644 index 0000000000..7a0b074fe5 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyParameterValue.aidl @@ -0,0 +1,53 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +union KeyParameterValue { + int invalid; + android.hardware.security.keymint.Algorithm algorithm; + android.hardware.security.keymint.BlockMode blockMode; + android.hardware.security.keymint.PaddingMode paddingMode; + android.hardware.security.keymint.Digest digest; + android.hardware.security.keymint.EcCurve ecCurve; + android.hardware.security.keymint.KeyOrigin origin; + android.hardware.security.keymint.KeyPurpose keyPurpose; + android.hardware.security.keymint.HardwareAuthenticatorType hardwareAuthenticatorType; + android.hardware.security.keymint.SecurityLevel securityLevel; + boolean boolValue; + int integer; + long longInteger; + long dateTime; + byte[] blob; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyPurpose.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyPurpose.aidl new file mode 100644 index 0000000000..b84bec1fc0 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/KeyPurpose.aidl @@ -0,0 +1,45 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum KeyPurpose { + ENCRYPT = 0, + DECRYPT = 1, + SIGN = 2, + VERIFY = 3, + WRAP_KEY = 5, + AGREE_KEY = 6, + ATTEST_KEY = 7, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/MacedPublicKey.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/MacedPublicKey.aidl new file mode 100644 index 0000000000..8095e8ce04 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/MacedPublicKey.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@VintfStability +parcelable MacedPublicKey { + byte[] macedKey; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/PaddingMode.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/PaddingMode.aidl new file mode 100644 index 0000000000..dba4a8a06e --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/PaddingMode.aidl @@ -0,0 +1,44 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum PaddingMode { + NONE = 1, + RSA_OAEP = 2, + RSA_PSS = 3, + RSA_PKCS1_1_5_ENCRYPT = 4, + RSA_PKCS1_1_5_SIGN = 5, + PKCS7 = 64, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/ProtectedData.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/ProtectedData.aidl new file mode 100644 index 0000000000..d1610b4d6f --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/ProtectedData.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 -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.keymint; +/* @hide */ +@VintfStability +parcelable ProtectedData { + byte[] protectedData; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/RpcHardwareInfo.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/RpcHardwareInfo.aidl new file mode 100644 index 0000000000..5ff45f8a94 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/RpcHardwareInfo.aidl @@ -0,0 +1,45 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable RpcHardwareInfo { + int versionNumber; + @utf8InCpp String rpcAuthorName; + int supportedEekCurve = 0; + @nullable @utf8InCpp String uniqueId; + const int CURVE_NONE = 0; + const int CURVE_P256 = 1; + const int CURVE_25519 = 2; +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/SecurityLevel.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/SecurityLevel.aidl new file mode 100644 index 0000000000..0d278e0af9 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/SecurityLevel.aidl @@ -0,0 +1,42 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum SecurityLevel { + SOFTWARE = 0, + TRUSTED_ENVIRONMENT = 1, + STRONGBOX = 2, + KEYSTORE = 100, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Tag.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Tag.aidl new file mode 100644 index 0000000000..e310b4448f --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/Tag.aidl @@ -0,0 +1,103 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum Tag { + INVALID = 0, + PURPOSE = 536870913, + ALGORITHM = 268435458, + KEY_SIZE = 805306371, + BLOCK_MODE = 536870916, + DIGEST = 536870917, + PADDING = 536870918, + CALLER_NONCE = 1879048199, + MIN_MAC_LENGTH = 805306376, + EC_CURVE = 268435466, + RSA_PUBLIC_EXPONENT = 1342177480, + INCLUDE_UNIQUE_ID = 1879048394, + RSA_OAEP_MGF_DIGEST = 536871115, + BOOTLOADER_ONLY = 1879048494, + ROLLBACK_RESISTANCE = 1879048495, + HARDWARE_TYPE = 268435760, + EARLY_BOOT_ONLY = 1879048497, + ACTIVE_DATETIME = 1610613136, + ORIGINATION_EXPIRE_DATETIME = 1610613137, + USAGE_EXPIRE_DATETIME = 1610613138, + MIN_SECONDS_BETWEEN_OPS = 805306771, + MAX_USES_PER_BOOT = 805306772, + USAGE_COUNT_LIMIT = 805306773, + USER_ID = 805306869, + USER_SECURE_ID = -1610612234, + NO_AUTH_REQUIRED = 1879048695, + USER_AUTH_TYPE = 268435960, + AUTH_TIMEOUT = 805306873, + ALLOW_WHILE_ON_BODY = 1879048698, + TRUSTED_USER_PRESENCE_REQUIRED = 1879048699, + TRUSTED_CONFIRMATION_REQUIRED = 1879048700, + UNLOCKED_DEVICE_REQUIRED = 1879048701, + APPLICATION_ID = -1879047591, + APPLICATION_DATA = -1879047492, + CREATION_DATETIME = 1610613437, + ORIGIN = 268436158, + ROOT_OF_TRUST = -1879047488, + OS_VERSION = 805307073, + OS_PATCHLEVEL = 805307074, + UNIQUE_ID = -1879047485, + ATTESTATION_CHALLENGE = -1879047484, + ATTESTATION_APPLICATION_ID = -1879047483, + ATTESTATION_ID_BRAND = -1879047482, + ATTESTATION_ID_DEVICE = -1879047481, + ATTESTATION_ID_PRODUCT = -1879047480, + ATTESTATION_ID_SERIAL = -1879047479, + ATTESTATION_ID_IMEI = -1879047478, + ATTESTATION_ID_MEID = -1879047477, + ATTESTATION_ID_MANUFACTURER = -1879047476, + ATTESTATION_ID_MODEL = -1879047475, + VENDOR_PATCHLEVEL = 805307086, + BOOT_PATCHLEVEL = 805307087, + DEVICE_UNIQUE_ATTESTATION = 1879048912, + IDENTITY_CREDENTIAL_KEY = 1879048913, + STORAGE_KEY = 1879048914, + ASSOCIATED_DATA = -1879047192, + NONCE = -1879047191, + MAC_LENGTH = 805307371, + RESET_SINCE_ID_ROTATION = 1879049196, + CONFIRMATION_TOKEN = -1879047187, + CERTIFICATE_SERIAL = -2147482642, + CERTIFICATE_SUBJECT = -1879047185, + CERTIFICATE_NOT_BEFORE = 1610613744, + CERTIFICATE_NOT_AFTER = 1610613745, + MAX_BOOT_LEVEL = 805307378, +} diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/TagType.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/TagType.aidl new file mode 100644 index 0000000000..a7d1de5fd4 --- /dev/null +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/2/android/hardware/security/keymint/TagType.aidl @@ -0,0 +1,49 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.keymint; +/* @hide */ +@Backing(type="int") @VintfStability +enum TagType { + INVALID = 0, + ENUM = 268435456, + ENUM_REP = 536870912, + UINT = 805306368, + UINT_REP = 1073741824, + ULONG = 1342177280, + DATE = 1610612736, + BOOL = 1879048192, + BIGNUM = -2147483648, + BYTES = -1879048192, + ULONG_REP = -1610612736, +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/1/.hash b/sensors/aidl/aidl_api/android.hardware.sensors/1/.hash new file mode 100644 index 0000000000..4002c53793 --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/1/.hash @@ -0,0 +1 @@ +c38c6b75e592ba5a6400b6348ad7f27db3064410 diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/AdditionalInfo.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/AdditionalInfo.aidl new file mode 100644 index 0000000000..518472305d --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/AdditionalInfo.aidl @@ -0,0 +1,76 @@ +/* + * 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 -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.sensors; +@FixedSize @VintfStability +parcelable AdditionalInfo { + android.hardware.sensors.AdditionalInfo.AdditionalInfoType type; + int serial; + android.hardware.sensors.AdditionalInfo.AdditionalInfoPayload payload; + @FixedSize @VintfStability + union AdditionalInfoPayload { + android.hardware.sensors.AdditionalInfo.AdditionalInfoPayload.Int32Values dataInt32; + android.hardware.sensors.AdditionalInfo.AdditionalInfoPayload.FloatValues dataFloat; + @FixedSize @VintfStability + parcelable Int32Values { + int[14] values; + } + @FixedSize @VintfStability + parcelable FloatValues { + float[14] values; + } + } + @Backing(type="int") @VintfStability + enum AdditionalInfoType { + AINFO_BEGIN = 0, + AINFO_END = 1, + AINFO_UNTRACKED_DELAY = 65536, + AINFO_INTERNAL_TEMPERATURE = 65537, + AINFO_VEC3_CALIBRATION = 65538, + AINFO_SENSOR_PLACEMENT = 65539, + AINFO_SAMPLING = 65540, + AINFO_CHANNEL_NOISE = 131072, + AINFO_CHANNEL_SAMPLER = 131073, + AINFO_CHANNEL_FILTER = 131074, + AINFO_CHANNEL_LINEAR_TRANSFORM = 131075, + AINFO_CHANNEL_NONLINEAR_MAP = 131076, + AINFO_CHANNEL_RESAMPLER = 131077, + AINFO_LOCAL_GEOMAGNETIC_FIELD = 196608, + AINFO_LOCAL_GRAVITY = 196609, + AINFO_DOCK_STATE = 196610, + AINFO_HIGH_PERFORMANCE_MODE = 196611, + AINFO_MAGNETIC_FIELD_CALIBRATION = 196612, + AINFO_CUSTOM_START = 268435456, + AINFO_DEBUGGING_START = 1073741824, + } +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/DynamicSensorInfo.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/DynamicSensorInfo.aidl new file mode 100644 index 0000000000..0c9a493a91 --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/DynamicSensorInfo.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 -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.sensors; +@FixedSize @VintfStability +parcelable DynamicSensorInfo { + boolean connected; + int sensorHandle; + android.hardware.sensors.DynamicSensorInfo.Uuid uuid; + @FixedSize @VintfStability + parcelable Uuid { + byte[16] values; + } +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/Event.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/Event.aidl new file mode 100644 index 0000000000..4f49002fce --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/Event.aidl @@ -0,0 +1,139 @@ +/* + * 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 -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.sensors; +@FixedSize @VintfStability +parcelable Event { + long timestamp; + int sensorHandle; + android.hardware.sensors.SensorType sensorType; + android.hardware.sensors.Event.EventPayload payload; + @FixedSize @VintfStability + union EventPayload { + android.hardware.sensors.Event.EventPayload.Vec3 vec3; + android.hardware.sensors.Event.EventPayload.Vec4 vec4; + android.hardware.sensors.Event.EventPayload.Uncal uncal; + android.hardware.sensors.Event.EventPayload.MetaData meta; + float scalar; + long stepCount; + android.hardware.sensors.Event.EventPayload.HeartRate heartRate; + android.hardware.sensors.Event.EventPayload.Pose6Dof pose6DOF; + android.hardware.sensors.DynamicSensorInfo dynamic; + android.hardware.sensors.AdditionalInfo additional; + android.hardware.sensors.Event.EventPayload.Data data; + android.hardware.sensors.Event.EventPayload.HeadTracker headTracker; + android.hardware.sensors.Event.EventPayload.LimitedAxesImu limitedAxesImu; + android.hardware.sensors.Event.EventPayload.LimitedAxesImuUncal limitedAxesImuUncal; + android.hardware.sensors.Event.EventPayload.Heading heading; + @FixedSize @VintfStability + parcelable Vec4 { + float x; + float y; + float z; + float w; + } + @FixedSize @VintfStability + parcelable Vec3 { + float x; + float y; + float z; + android.hardware.sensors.SensorStatus status; + } + @FixedSize @VintfStability + parcelable Uncal { + float x; + float y; + float z; + float xBias; + float yBias; + float zBias; + } + @FixedSize @VintfStability + parcelable HeadTracker { + float rx; + float ry; + float rz; + float vx; + float vy; + float vz; + int discontinuityCount; + } + @FixedSize @VintfStability + parcelable LimitedAxesImu { + float x; + float y; + float z; + float xSupported; + float ySupported; + float zSupported; + } + @FixedSize @VintfStability + parcelable LimitedAxesImuUncal { + float x; + float y; + float z; + float xBias; + float yBias; + float zBias; + float xSupported; + float ySupported; + float zSupported; + } + @FixedSize @VintfStability + parcelable HeartRate { + float bpm; + android.hardware.sensors.SensorStatus status; + } + @FixedSize @VintfStability + parcelable Heading { + float heading; + float accuracy; + } + @FixedSize @VintfStability + parcelable MetaData { + android.hardware.sensors.Event.EventPayload.MetaData.MetaDataEventType what; + @Backing(type="int") @VintfStability + enum MetaDataEventType { + META_DATA_FLUSH_COMPLETE = 1, + } + } + @FixedSize @VintfStability + parcelable Pose6Dof { + float[15] values; + } + @FixedSize @VintfStability + parcelable Data { + float[16] values; + } + } +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/ISensors.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/ISensors.aidl new file mode 100644 index 0000000000..f60f5bb247 --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/ISensors.aidl @@ -0,0 +1,89 @@ +/* + * 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 -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.sensors; +@VintfStability +interface ISensors { + void activate(in int sensorHandle, in boolean enabled); + void batch(in int sensorHandle, in long samplingPeriodNs, in long maxReportLatencyNs); + int configDirectReport(in int sensorHandle, in int channelHandle, in android.hardware.sensors.ISensors.RateLevel rate); + void flush(in int sensorHandle); + android.hardware.sensors.SensorInfo[] getSensorsList(); + void initialize(in android.hardware.common.fmq.MQDescriptor eventQueueDescriptor, in android.hardware.common.fmq.MQDescriptor wakeLockDescriptor, in android.hardware.sensors.ISensorsCallback sensorsCallback); + void injectSensorData(in android.hardware.sensors.Event event); + int registerDirectChannel(in android.hardware.sensors.ISensors.SharedMemInfo mem); + void setOperationMode(in android.hardware.sensors.ISensors.OperationMode mode); + void unregisterDirectChannel(in int channelHandle); + const int ERROR_NO_MEMORY = -12; + const int ERROR_BAD_VALUE = -22; + const int WAKE_LOCK_TIMEOUT_SECONDS = 1; + const int EVENT_QUEUE_FLAG_BITS_READ_AND_PROCESS = 1; + const int EVENT_QUEUE_FLAG_BITS_EVENTS_READ = 2; + const int WAKE_LOCK_QUEUE_FLAG_BITS_DATA_WRITTEN = 1; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_FIELD = 0; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_REPORT_TOKEN = 4; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_SENSOR_TYPE = 8; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_ATOMIC_COUNTER = 12; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_TIMESTAMP = 16; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_DATA = 24; + const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_RESERVED = 88; + const int DIRECT_REPORT_SENSOR_EVENT_TOTAL_LENGTH = 104; + @Backing(type="int") @VintfStability + enum RateLevel { + STOP = 0, + NORMAL = 1, + FAST = 2, + VERY_FAST = 3, + } + @Backing(type="int") @VintfStability + enum OperationMode { + NORMAL = 0, + DATA_INJECTION = 1, + } + @VintfStability + parcelable SharedMemInfo { + android.hardware.sensors.ISensors.SharedMemInfo.SharedMemType type; + android.hardware.sensors.ISensors.SharedMemInfo.SharedMemFormat format; + int size; + android.hardware.common.NativeHandle memoryHandle; + @Backing(type="int") @VintfStability + enum SharedMemFormat { + SENSORS_EVENT = 1, + } + @Backing(type="int") @VintfStability + enum SharedMemType { + ASHMEM = 1, + GRALLOC = 2, + } + } +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/ISensorsCallback.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/ISensorsCallback.aidl new file mode 100644 index 0000000000..78ab56711b --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/ISensorsCallback.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 -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.sensors; +@VintfStability +interface ISensorsCallback { + void onDynamicSensorsConnected(in android.hardware.sensors.SensorInfo[] sensorInfos); + void onDynamicSensorsDisconnected(in int[] sensorHandles); +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/SensorInfo.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/SensorInfo.aidl new file mode 100644 index 0000000000..996be3d4db --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/SensorInfo.aidl @@ -0,0 +1,71 @@ +/* + * 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 -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.sensors; +@VintfStability +parcelable SensorInfo { + int sensorHandle; + String name; + String vendor; + int version; + android.hardware.sensors.SensorType type; + String typeAsString; + float maxRange; + float resolution; + float power; + int minDelayUs; + int fifoReservedEventCount; + int fifoMaxEventCount; + String requiredPermission; + int maxDelayUs; + int flags; + const int SENSOR_FLAG_BITS_WAKE_UP = 1; + const int SENSOR_FLAG_BITS_CONTINUOUS_MODE = 0; + const int SENSOR_FLAG_BITS_ON_CHANGE_MODE = 2; + const int SENSOR_FLAG_BITS_ONE_SHOT_MODE = 4; + const int SENSOR_FLAG_BITS_SPECIAL_REPORTING_MODE = 6; + const int SENSOR_FLAG_BITS_DATA_INJECTION = 16; + const int SENSOR_FLAG_BITS_DYNAMIC_SENSOR = 32; + const int SENSOR_FLAG_BITS_ADDITIONAL_INFO = 64; + const int SENSOR_FLAG_BITS_DIRECT_CHANNEL_ASHMEM = 1024; + const int SENSOR_FLAG_BITS_DIRECT_CHANNEL_GRALLOC = 2048; + const int SENSOR_FLAG_BITS_MASK_REPORTING_MODE = 14; + const int SENSOR_FLAG_BITS_MASK_DIRECT_REPORT = 896; + const int SENSOR_FLAG_BITS_MASK_DIRECT_CHANNEL = 3072; + const int SENSOR_FLAG_SHIFT_REPORTING_MODE = 1; + const int SENSOR_FLAG_SHIFT_DATA_INJECTION = 4; + const int SENSOR_FLAG_SHIFT_DYNAMIC_SENSOR = 5; + const int SENSOR_FLAG_SHIFT_ADDITIONAL_INFO = 6; + const int SENSOR_FLAG_SHIFT_DIRECT_REPORT = 7; + const int SENSOR_FLAG_SHIFT_DIRECT_CHANNEL = 10; +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/SensorStatus.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/SensorStatus.aidl new file mode 100644 index 0000000000..45217107fc --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/SensorStatus.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 -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.sensors; +@Backing(type="byte") @VintfStability +enum SensorStatus { + NO_CONTACT = -1, + UNRELIABLE = 0, + ACCURACY_LOW = 1, + ACCURACY_MEDIUM = 2, + ACCURACY_HIGH = 3, +} diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/SensorType.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/SensorType.aidl new file mode 100644 index 0000000000..8c864e90be --- /dev/null +++ b/sensors/aidl/aidl_api/android.hardware.sensors/1/android/hardware/sensors/SensorType.aidl @@ -0,0 +1,80 @@ +/* + * 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 -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.sensors; +@Backing(type="int") @VintfStability +enum SensorType { + META_DATA = 0, + ACCELEROMETER = 1, + MAGNETIC_FIELD = 2, + ORIENTATION = 3, + GYROSCOPE = 4, + LIGHT = 5, + PRESSURE = 6, + PROXIMITY = 8, + GRAVITY = 9, + LINEAR_ACCELERATION = 10, + ROTATION_VECTOR = 11, + RELATIVE_HUMIDITY = 12, + AMBIENT_TEMPERATURE = 13, + MAGNETIC_FIELD_UNCALIBRATED = 14, + GAME_ROTATION_VECTOR = 15, + GYROSCOPE_UNCALIBRATED = 16, + SIGNIFICANT_MOTION = 17, + STEP_DETECTOR = 18, + STEP_COUNTER = 19, + GEOMAGNETIC_ROTATION_VECTOR = 20, + HEART_RATE = 21, + TILT_DETECTOR = 22, + WAKE_GESTURE = 23, + GLANCE_GESTURE = 24, + PICK_UP_GESTURE = 25, + WRIST_TILT_GESTURE = 26, + DEVICE_ORIENTATION = 27, + POSE_6DOF = 28, + STATIONARY_DETECT = 29, + MOTION_DETECT = 30, + HEART_BEAT = 31, + DYNAMIC_SENSOR_META = 32, + ADDITIONAL_INFO = 33, + LOW_LATENCY_OFFBODY_DETECT = 34, + ACCELEROMETER_UNCALIBRATED = 35, + HINGE_ANGLE = 36, + HEAD_TRACKER = 37, + ACCELEROMETER_LIMITED_AXES = 38, + GYROSCOPE_LIMITED_AXES = 39, + ACCELEROMETER_LIMITED_AXES_UNCALIBRATED = 40, + GYROSCOPE_LIMITED_AXES_UNCALIBRATED = 41, + HEADING = 42, + DEVICE_PRIVATE_BASE = 65536, +} diff --git a/soundtrigger/aidl/Android.bp b/soundtrigger/aidl/Android.bp index 28e809047a..ab104c878b 100644 --- a/soundtrigger/aidl/Android.bp +++ b/soundtrigger/aidl/Android.bp @@ -11,7 +11,10 @@ aidl_interface { name: "android.hardware.soundtrigger3", vendor_available: true, host_supported: true, - flags: ["-Werror", "-Weverything", ], + flags: [ + "-Werror", + "-Weverything", + ], srcs: [ "android/hardware/soundtrigger3/ISoundTriggerHw.aidl", "android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl", @@ -19,7 +22,7 @@ aidl_interface { ], stability: "vintf", imports: [ - "android.media.soundtrigger.types", + "android.media.soundtrigger.types-V1", ], backend: { cpp: { @@ -35,4 +38,11 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: ["android.media.soundtrigger.types-V1"], + }, + ], + } diff --git a/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/.hash b/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/.hash new file mode 100644 index 0000000000..4ec3b8cab6 --- /dev/null +++ b/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/.hash @@ -0,0 +1 @@ +7d8d63478cd50e766d2072140c8aa3457f9fb585 diff --git a/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/android/hardware/soundtrigger3/ISoundTriggerHw.aidl b/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/android/hardware/soundtrigger3/ISoundTriggerHw.aidl new file mode 100644 index 0000000000..bbfe7d9161 --- /dev/null +++ b/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/android/hardware/soundtrigger3/ISoundTriggerHw.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.soundtrigger3; +@VintfStability +interface ISoundTriggerHw { + android.media.soundtrigger.Properties getProperties(); + void registerGlobalCallback(in android.hardware.soundtrigger3.ISoundTriggerHwGlobalCallback callback); + int loadSoundModel(in android.media.soundtrigger.SoundModel soundModel, in android.hardware.soundtrigger3.ISoundTriggerHwCallback callback); + int loadPhraseSoundModel(in android.media.soundtrigger.PhraseSoundModel soundModel, in android.hardware.soundtrigger3.ISoundTriggerHwCallback callback); + void unloadSoundModel(in int modelHandle); + void startRecognition(in int modelHandle, in int deviceHandle, in int ioHandle, in android.media.soundtrigger.RecognitionConfig config); + void stopRecognition(in int modelHandle); + void forceRecognitionEvent(in int modelHandle); + @nullable android.media.soundtrigger.ModelParameterRange queryParameter(in int modelHandle, in android.media.soundtrigger.ModelParameter modelParam); + int getParameter(in int modelHandle, in android.media.soundtrigger.ModelParameter modelParam); + void setParameter(in int modelHandle, in android.media.soundtrigger.ModelParameter modelParam, in int value); +} diff --git a/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl b/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl new file mode 100644 index 0000000000..152dfed637 --- /dev/null +++ b/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/android/hardware/soundtrigger3/ISoundTriggerHwCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.soundtrigger3; +@VintfStability +interface ISoundTriggerHwCallback { + void modelUnloaded(in int model); + void phraseRecognitionCallback(in int model, in android.media.soundtrigger.PhraseRecognitionEvent event); + void recognitionCallback(in int model, in android.media.soundtrigger.RecognitionEvent event); +} diff --git a/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl b/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl new file mode 100644 index 0000000000..6dfee9fa2f --- /dev/null +++ b/soundtrigger/aidl/aidl_api/android.hardware.soundtrigger3/1/android/hardware/soundtrigger3/ISoundTriggerHwGlobalCallback.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.soundtrigger3; +@VintfStability +interface ISoundTriggerHwGlobalCallback { + void onResourcesAvailable(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/.hash b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/.hash new file mode 100644 index 0000000000..e2fc715d03 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/.hash @@ -0,0 +1 @@ +d42f1677ada3f62036894111686245c3c8310fe4 diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/AudioExtraMetaData.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/AudioExtraMetaData.aidl new file mode 100644 index 0000000000..9db960926b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/AudioExtraMetaData.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable AudioExtraMetaData { + byte adFade; + byte adPan; + char versionTextTag; + byte adGainCenter; + byte adGainFront; + byte adGainSurround; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/AudioStreamType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/AudioStreamType.aidl new file mode 100644 index 0000000000..6c538ea951 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/AudioStreamType.aidl @@ -0,0 +1,58 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum AudioStreamType { + UNDEFINED = 0, + PCM = 1, + MP3 = 2, + MPEG1 = 3, + MPEG2 = 4, + MPEGH = 5, + AAC = 6, + AC3 = 7, + EAC3 = 8, + AC4 = 9, + DTS = 10, + DTS_HD = 11, + WMA = 12, + OPUS = 13, + VORBIS = 14, + DRA = 15, + AAC_ADTS = 16, + AAC_LATM = 17, + AAC_HE_ADTS = 18, + AAC_HE_LATM = 19, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/AvStreamType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/AvStreamType.aidl new file mode 100644 index 0000000000..4d6acfffa1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/AvStreamType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union AvStreamType { + android.hardware.tv.tuner.VideoStreamType video = android.hardware.tv.tuner.VideoStreamType.UNDEFINED; + android.hardware.tv.tuner.AudioStreamType audio; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/Constant.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/Constant.aidl new file mode 100644 index 0000000000..95ecc51e6c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/Constant.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum Constant { + INVALID_TS_PID = 65535, + INVALID_STREAM_ID = 65535, + INVALID_FILTER_ID = -1, + INVALID_AV_SYNC_ID = -1, + INVALID_MMTP_RECORD_EVENT_MPT_SEQUENCE_NUM = -1, + INVALID_FIRST_MACROBLOCK_IN_SLICE = -1, + INVALID_FRONTEND_SETTING_FREQUENCY = -1, + INVALID_IP_FILTER_CONTEXT_ID = -1, + INVALID_LTS_ID = -1, + INVALID_FRONTEND_ID = -1, + INVALID_LNB_ID = -1, + INVALID_KEYTOKEN = 0, + INVALID_TABINFO_VERSION = -1, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/Constant64Bit.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/Constant64Bit.aidl new file mode 100644 index 0000000000..a56a0cf2f9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/Constant64Bit.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="long") @VintfStability +enum Constant64Bit { + INVALID_FILTER_ID_64BIT = -1, + INVALID_AV_SYNC_ID_64BIT = -1, + INVALID_PRESENTATION_TIME_STAMP = -1, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DataFormat.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DataFormat.aidl new file mode 100644 index 0000000000..3b8fee403d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DataFormat.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DataFormat { + TS = 0, + PES = 1, + ES = 2, + SHV_TLV = 3, + UNDEFINED = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl new file mode 100644 index 0000000000..91a04a436c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpFilterSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxAlpFilterSettings { + int packetType; + android.hardware.tv.tuner.DemuxAlpLengthType lengthType = android.hardware.tv.tuner.DemuxAlpLengthType.UNDEFINED; + android.hardware.tv.tuner.DemuxAlpFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..6b15492768 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpFilterSettingsFilterSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxAlpFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpFilterType.aidl new file mode 100644 index 0000000000..f0df497ed2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpFilterType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxAlpFilterType { + UNDEFINED = 0, + SECTION = 1, + PTP = 2, + PAYLOAD_THROUGH = 3, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpLengthType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpLengthType.aidl new file mode 100644 index 0000000000..ccca6de8c6 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxAlpLengthType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum DemuxAlpLengthType { + UNDEFINED = 0, + WITHOUT_ADDITIONAL_HEADER = 1, + WITH_ADDITIONAL_HEADER = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxCapabilities.aidl new file mode 100644 index 0000000000..49afb94b6b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxCapabilities.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxCapabilities { + int numDemux; + int numRecord; + int numPlayback; + int numTsFilter; + int numSectionFilter; + int numAudioFilter; + int numVideoFilter; + int numPesFilter; + int numPcrFilter; + long numBytesInSectionFilter; + int filterCaps; + int[] linkCaps; + boolean bTimeFilter; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl new file mode 100644 index 0000000000..3e5df2d635 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterAvSettings { + boolean isPassthrough; + boolean isSecureMemory; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl new file mode 100644 index 0000000000..8a05dbd6b8 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterDownloadEvent { + int itemId; + int downloadId; + int mpuSequenceNumber; + int itemFragmentIndex; + int lastItemFragmentIndex; + int dataLength; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl new file mode 100644 index 0000000000..86ce646f69 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterDownloadSettings { + boolean useDownloadId; + int downloadId; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterEvent.aidl new file mode 100644 index 0000000000..617f71cc34 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterEvent.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterEvent { + android.hardware.tv.tuner.DemuxFilterSectionEvent section; + android.hardware.tv.tuner.DemuxFilterMediaEvent media; + android.hardware.tv.tuner.DemuxFilterPesEvent pes; + android.hardware.tv.tuner.DemuxFilterTsRecordEvent tsRecord; + android.hardware.tv.tuner.DemuxFilterMmtpRecordEvent mmtpRecord; + android.hardware.tv.tuner.DemuxFilterDownloadEvent download; + android.hardware.tv.tuner.DemuxFilterIpPayloadEvent ipPayload; + android.hardware.tv.tuner.DemuxFilterTemiEvent temi; + android.hardware.tv.tuner.DemuxFilterMonitorEvent monitorEvent; + int startId; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl new file mode 100644 index 0000000000..9134df35c2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterIpPayloadEvent.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterIpPayloadEvent { + int dataLength; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMainType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMainType.aidl new file mode 100644 index 0000000000..6abd87b0f3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMainType.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxFilterMainType { + UNDEFINED = 0, + TS = 1, + MMTP = 2, + IP = 4, + TLV = 8, + ALP = 16, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl new file mode 100644 index 0000000000..61a955590e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl @@ -0,0 +1,52 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterMediaEvent { + int streamId; + boolean isPtsPresent; + long pts; + boolean isDtsPresent; + long dts; + long dataLength; + long offset; + android.hardware.common.NativeHandle avMemory; + boolean isSecureMemory; + long avDataId; + int mpuSequenceNumber; + boolean isPesPrivateData; + android.hardware.tv.tuner.DemuxFilterMediaEventExtraMetaData extraMetaData; + android.hardware.tv.tuner.DemuxFilterScIndexMask scIndexMask; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl new file mode 100644 index 0000000000..ab36188069 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMediaEventExtraMetaData.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterMediaEventExtraMetaData { + boolean noinit; + android.hardware.tv.tuner.AudioExtraMetaData audio; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl new file mode 100644 index 0000000000..4e31ba8c73 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMmtpRecordEvent.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterMmtpRecordEvent { + int scHevcIndexMask; + long byteNumber; + long pts; + int mpuSequenceNumber; + int firstMbInSlice; + int tsIndexMask; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl new file mode 100644 index 0000000000..177de7a0c1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMonitorEvent.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterMonitorEvent { + android.hardware.tv.tuner.ScramblingStatus scramblingStatus = android.hardware.tv.tuner.ScramblingStatus.UNKNOWN; + int cid; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl new file mode 100644 index 0000000000..5d27f76025 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterMonitorEventType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxFilterMonitorEventType { + SCRAMBLING_STATUS = 1, + IP_CID_CHANGE = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl new file mode 100644 index 0000000000..2420142149 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterPesDataSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterPesDataSettings { + int streamId; + boolean isRaw; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl new file mode 100644 index 0000000000..3ddd5e0a35 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterPesEvent.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterPesEvent { + int streamId; + int dataLength; + int mpuSequenceNumber; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl new file mode 100644 index 0000000000..02c478f4c1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterRecordSettings { + int tsIndexMask; + android.hardware.tv.tuner.DemuxRecordScIndexType scIndexType = android.hardware.tv.tuner.DemuxRecordScIndexType.NONE; + android.hardware.tv.tuner.DemuxFilterScIndexMask scIndexMask; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl new file mode 100644 index 0000000000..371e075617 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterScIndexMask { + int scIndex; + int scAvc; + int scHevc; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl new file mode 100644 index 0000000000..b666c7b6ba --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionBits.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterSectionBits { + byte[] filter; + byte[] mask; + byte[] mode; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl new file mode 100644 index 0000000000..199a09c747 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterSectionEvent { + int tableId; + int version; + int sectionNum; + long dataLength; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl new file mode 100644 index 0000000000..7936e59001 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterSectionSettings { + android.hardware.tv.tuner.DemuxFilterSectionSettingsCondition condition; + boolean isCheckCrc; + boolean isRepeat; + boolean isRaw; + int bitWidthOfLengthField; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl new file mode 100644 index 0000000000..0b101dece4 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionSettingsCondition.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterSectionSettingsCondition { + android.hardware.tv.tuner.DemuxFilterSectionBits sectionBits; + android.hardware.tv.tuner.DemuxFilterSectionSettingsConditionTableInfo tableInfo; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl new file mode 100644 index 0000000000..82d30cbf7e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterSectionSettingsConditionTableInfo { + int tableId; + int version; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSettings.aidl new file mode 100644 index 0000000000..c12fde25ab --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterSettings { + android.hardware.tv.tuner.DemuxTsFilterSettings ts; + android.hardware.tv.tuner.DemuxMmtpFilterSettings mmtp; + android.hardware.tv.tuner.DemuxIpFilterSettings ip; + android.hardware.tv.tuner.DemuxTlvFilterSettings tlv; + android.hardware.tv.tuner.DemuxAlpFilterSettings alp; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterStatus.aidl new file mode 100644 index 0000000000..36b40ea5b9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum DemuxFilterStatus { + DATA_READY = 1, + LOW_WATER = 2, + HIGH_WATER = 4, + OVERFLOW = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSubType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSubType.aidl new file mode 100644 index 0000000000..2e2a774535 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterSubType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxFilterSubType { + android.hardware.tv.tuner.DemuxTsFilterType tsFilterType = android.hardware.tv.tuner.DemuxTsFilterType.UNDEFINED; + android.hardware.tv.tuner.DemuxMmtpFilterType mmtpFilterType; + android.hardware.tv.tuner.DemuxIpFilterType ipFilterType; + android.hardware.tv.tuner.DemuxTlvFilterType tlvFilterType; + android.hardware.tv.tuner.DemuxAlpFilterType alpFilterType; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl new file mode 100644 index 0000000000..ce158618e3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterTemiEvent.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterTemiEvent { + long pts; + byte descrTag; + byte[] descrData; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl new file mode 100644 index 0000000000..5c27faf95d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterTsRecordEvent.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterTsRecordEvent { + android.hardware.tv.tuner.DemuxPid pid; + int tsIndexMask; + android.hardware.tv.tuner.DemuxFilterScIndexMask scIndexMask; + long byteNumber; + long pts; + int firstMbInSlice; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterType.aidl new file mode 100644 index 0000000000..b2f499d65d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxFilterType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxFilterType { + android.hardware.tv.tuner.DemuxFilterMainType mainType = android.hardware.tv.tuner.DemuxFilterMainType.UNDEFINED; + android.hardware.tv.tuner.DemuxFilterSubType subType; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpAddress.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpAddress.aidl new file mode 100644 index 0000000000..a044a19d7e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpAddress.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxIpAddress { + android.hardware.tv.tuner.DemuxIpAddressIpAddress srcIpAddress; + android.hardware.tv.tuner.DemuxIpAddressIpAddress dstIpAddress; + int srcPort; + int dstPort; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl new file mode 100644 index 0000000000..62de08847e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpAddressIpAddress.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxIpAddressIpAddress { + byte[] v4 = {}; + byte[] v6; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl new file mode 100644 index 0000000000..2b0610b4ef --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpFilterSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxIpFilterSettings { + android.hardware.tv.tuner.DemuxIpAddress ipAddr; + android.hardware.tv.tuner.DemuxIpFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..daac2847a6 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpFilterSettingsFilterSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxIpFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; + boolean bPassthrough; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpFilterType.aidl new file mode 100644 index 0000000000..b78ac9a69e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxIpFilterType.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxIpFilterType { + UNDEFINED = 0, + SECTION = 1, + NTP = 2, + IP_PAYLOAD = 3, + IP = 4, + PAYLOAD_THROUGH = 5, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl new file mode 100644 index 0000000000..b22c564cf9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxMmtpFilterSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxMmtpFilterSettings { + int mmtpPid; + android.hardware.tv.tuner.DemuxMmtpFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..4b23306818 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxMmtpFilterSettingsFilterSettings.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxMmtpFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; + android.hardware.tv.tuner.DemuxFilterAvSettings av; + android.hardware.tv.tuner.DemuxFilterPesDataSettings pesData; + android.hardware.tv.tuner.DemuxFilterRecordSettings record; + android.hardware.tv.tuner.DemuxFilterDownloadSettings download; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl new file mode 100644 index 0000000000..7e9e3a64a7 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxMmtpFilterType.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxMmtpFilterType { + UNDEFINED = 0, + SECTION = 1, + PES = 2, + MMTP = 3, + AUDIO = 4, + VIDEO = 5, + RECORD = 6, + DOWNLOAD = 7, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxPid.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxPid.aidl new file mode 100644 index 0000000000..c452f35b36 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxPid.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxPid { + int tPid; + int mmtpPid; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl new file mode 100644 index 0000000000..bcd0aebbde --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxQueueNotifyBits.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxQueueNotifyBits { + DATA_READY = 1, + DATA_CONSUMED = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl new file mode 100644 index 0000000000..30ec29a23b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxRecordScIndexType { + NONE = 0, + SC = 1, + SC_HEVC = 2, + SC_AVC = 3, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxScAvcIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxScAvcIndex.aidl new file mode 100644 index 0000000000..651b66c345 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxScAvcIndex.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxScAvcIndex { + UNDEFINED = 0, + I_SLICE = 1, + P_SLICE = 2, + B_SLICE = 4, + SI_SLICE = 8, + SP_SLICE = 16, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxScHevcIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxScHevcIndex.aidl new file mode 100644 index 0000000000..670b34e62a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxScHevcIndex.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxScHevcIndex { + UNDEFINED = 0, + SPS = 1, + AUD = 2, + SLICE_CE_BLA_W_LP = 4, + SLICE_BLA_W_RADL = 8, + SLICE_BLA_N_LP = 16, + SLICE_IDR_W_RADL = 32, + SLICE_IDR_N_LP = 64, + SLICE_TRAIL_CRA = 128, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxScIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxScIndex.aidl new file mode 100644 index 0000000000..25f0585715 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxScIndex.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxScIndex { + UNDEFINED = 0, + I_FRAME = 1, + P_FRAME = 2, + B_FRAME = 4, + SEQUENCE = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl new file mode 100644 index 0000000000..ddb61cea79 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTlvFilterSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxTlvFilterSettings { + int packetType; + boolean isCompressedIpPacket; + android.hardware.tv.tuner.DemuxTlvFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..a9d319803c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTlvFilterSettingsFilterSettings.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxTlvFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; + boolean bPassthrough; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTlvFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTlvFilterType.aidl new file mode 100644 index 0000000000..a4e1ff176e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTlvFilterType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxTlvFilterType { + UNDEFINED = 0, + SECTION = 1, + TLV = 2, + PAYLOAD_THROUGH = 3, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl new file mode 100644 index 0000000000..d8d424f193 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsFilterSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable DemuxTsFilterSettings { + int tpid; + android.hardware.tv.tuner.DemuxTsFilterSettingsFilterSettings filterSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl new file mode 100644 index 0000000000..5d81bb6237 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsFilterSettingsFilterSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DemuxTsFilterSettingsFilterSettings { + boolean noinit; + android.hardware.tv.tuner.DemuxFilterSectionSettings section; + android.hardware.tv.tuner.DemuxFilterAvSettings av; + android.hardware.tv.tuner.DemuxFilterPesDataSettings pesData; + android.hardware.tv.tuner.DemuxFilterRecordSettings record; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsFilterType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsFilterType.aidl new file mode 100644 index 0000000000..8b806bf6ec --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsFilterType.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxTsFilterType { + UNDEFINED = 0, + SECTION = 1, + PES = 2, + TS = 3, + AUDIO = 4, + VIDEO = 5, + PCR = 6, + RECORD = 7, + TEMI = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsIndex.aidl new file mode 100644 index 0000000000..ed034779f9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DemuxTsIndex.aidl @@ -0,0 +1,56 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum DemuxTsIndex { + FIRST_PACKET = 1, + PAYLOAD_UNIT_START_INDICATOR = 2, + CHANGE_TO_NOT_SCRAMBLED = 4, + CHANGE_TO_EVEN_SCRAMBLED = 8, + CHANGE_TO_ODD_SCRAMBLED = 16, + DISCONTINUITY_INDICATOR = 32, + RANDOM_ACCESS_INDICATOR = 64, + PRIORITY_INDICATOR = 128, + PCR_FLAG = 256, + OPCR_FLAG = 512, + SPLICING_POINT_FLAG = 1024, + PRIVATE_DATA = 2048, + ADAPTATION_EXTENSION_FLAG = 4096, + MPT_INDEX_MPT = 65536, + MPT_INDEX_VIDEO = 131072, + MPT_INDEX_AUDIO = 262144, + MPT_INDEX_TIMESTAMP_TARGET_VIDEO = 524288, + MPT_INDEX_TIMESTAMP_TARGET_AUDIO = 1048576, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DvrSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DvrSettings.aidl new file mode 100644 index 0000000000..26f864a08e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DvrSettings.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union DvrSettings { + android.hardware.tv.tuner.RecordSettings record; + android.hardware.tv.tuner.PlaybackSettings playback; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DvrType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DvrType.aidl new file mode 100644 index 0000000000..3a0c1e421e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/DvrType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum DvrType { + RECORD = 0, + PLAYBACK = 1, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FilterDelayHint.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FilterDelayHint.aidl new file mode 100644 index 0000000000..1fdafd2f09 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FilterDelayHint.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FilterDelayHint { + android.hardware.tv.tuner.FilterDelayHintType hintType = android.hardware.tv.tuner.FilterDelayHintType.INVALID; + int hintValue; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FilterDelayHintType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FilterDelayHintType.aidl new file mode 100644 index 0000000000..8c5a3f5cf1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FilterDelayHintType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FilterDelayHintType { + INVALID = 0, + TIME_DELAY_IN_MS = 1, + DATA_SIZE_DELAY_IN_BYTES = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl new file mode 100644 index 0000000000..6b32110389 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogAftFlag.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAnalogAftFlag { + UNDEFINED = 0, + AFT_TRUE = 1, + AFT_FALSE = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl new file mode 100644 index 0000000000..46131be795 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAnalogCapabilities { + int typeCap; + int sifStandardCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogSettings.aidl new file mode 100644 index 0000000000..33e934739c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogSettings.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAnalogSettings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendAnalogType type = android.hardware.tv.tuner.FrontendAnalogType.UNDEFINED; + android.hardware.tv.tuner.FrontendAnalogAftFlag aftFlag = android.hardware.tv.tuner.FrontendAnalogAftFlag.UNDEFINED; + android.hardware.tv.tuner.FrontendAnalogSifStandard sifStandard = android.hardware.tv.tuner.FrontendAnalogSifStandard.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl new file mode 100644 index 0000000000..35025220ac --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogSifStandard.aidl @@ -0,0 +1,57 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAnalogSifStandard { + UNDEFINED = 0, + AUTO = 1, + BG = 2, + BG_A2 = 4, + BG_NICAM = 8, + I = 16, + DK = 32, + DK1_A2 = 64, + DK2_A2 = 128, + DK3_A2 = 256, + DK_NICAM = 512, + L = 1024, + M = 2048, + M_BTSC = 4096, + M_A2 = 8192, + M_EIAJ = 16384, + I_NICAM = 32768, + L_NICAM = 65536, + L_PRIME = 131072, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogType.aidl new file mode 100644 index 0000000000..33fd93dc63 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAnalogType.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAnalogType { + UNDEFINED = 0, + AUTO = 1, + PAL = 2, + PAL_M = 4, + PAL_N = 8, + PAL_60 = 16, + NTSC = 32, + NTSC_443 = 64, + SECAM = 128, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl new file mode 100644 index 0000000000..51a3fc5c50 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Bandwidth.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3Bandwidth { + UNDEFINED = 0, + AUTO = 1, + BANDWIDTH_6MHZ = 2, + BANDWIDTH_7MHZ = 4, + BANDWIDTH_8MHZ = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl new file mode 100644 index 0000000000..b2a25c7d49 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Capabilities.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtsc3Capabilities { + int bandwidthCap; + int modulationCap; + int timeInterleaveModeCap; + int codeRateCap; + int fecCap; + byte demodOutputFormatCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl new file mode 100644 index 0000000000..aec07186a3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3CodeRate.aidl @@ -0,0 +1,52 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3CodeRate { + UNDEFINED = 0, + AUTO = 1, + CODERATE_2_15 = 2, + CODERATE_3_15 = 4, + CODERATE_4_15 = 8, + CODERATE_5_15 = 16, + CODERATE_6_15 = 32, + CODERATE_7_15 = 64, + CODERATE_8_15 = 128, + CODERATE_9_15 = 256, + CODERATE_10_15 = 512, + CODERATE_11_15 = 1024, + CODERATE_12_15 = 2048, + CODERATE_13_15 = 4096, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl new file mode 100644 index 0000000000..8702a496c5 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3DemodOutputFormat.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum FrontendAtsc3DemodOutputFormat { + UNDEFINED = 0, + ATSC3_LINKLAYER_PACKET = 1, + BASEBAND_PACKET = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl new file mode 100644 index 0000000000..a2c140aa9f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Fec.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3Fec { + UNDEFINED = 0, + AUTO = 1, + BCH_LDPC_16K = 2, + BCH_LDPC_64K = 4, + CRC_LDPC_16K = 8, + CRC_LDPC_64K = 16, + LDPC_16K = 32, + LDPC_64K = 64, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl new file mode 100644 index 0000000000..09e513d8aa --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Modulation.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3Modulation { + UNDEFINED = 0, + AUTO = 1, + MOD_QPSK = 2, + MOD_16QAM = 4, + MOD_64QAM = 8, + MOD_256QAM = 16, + MOD_1024QAM = 32, + MOD_4096QAM = 64, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl new file mode 100644 index 0000000000..6301f96c61 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3PlpSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtsc3PlpSettings { + int plpId; + android.hardware.tv.tuner.FrontendAtsc3Modulation modulation = android.hardware.tv.tuner.FrontendAtsc3Modulation.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode interleaveMode = android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3CodeRate codeRate = android.hardware.tv.tuner.FrontendAtsc3CodeRate.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3Fec fec = android.hardware.tv.tuner.FrontendAtsc3Fec.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl new file mode 100644 index 0000000000..3cbb0d0337 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3Settings.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtsc3Settings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendAtsc3Bandwidth bandwidth = android.hardware.tv.tuner.FrontendAtsc3Bandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3DemodOutputFormat demodOutputFormat = android.hardware.tv.tuner.FrontendAtsc3DemodOutputFormat.UNDEFINED; + android.hardware.tv.tuner.FrontendAtsc3PlpSettings[] plpSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl new file mode 100644 index 0000000000..a9747f0eb7 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtsc3TimeInterleaveMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtsc3TimeInterleaveMode { + UNDEFINED = 0, + AUTO = 1, + CTI = 2, + HTI = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl new file mode 100644 index 0000000000..c24afae7b0 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtscCapabilities.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtscCapabilities { + int modulationCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtscModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtscModulation.aidl new file mode 100644 index 0000000000..426fe20739 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtscModulation.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendAtscModulation { + UNDEFINED = 0, + AUTO = 1, + MOD_8VSB = 4, + MOD_16VSB = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtscSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtscSettings.aidl new file mode 100644 index 0000000000..9121c12d5d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendAtscSettings.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendAtscSettings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendAtscModulation modulation = android.hardware.tv.tuner.FrontendAtscModulation.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendBandwidth.aidl new file mode 100644 index 0000000000..5355637422 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendBandwidth.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendBandwidth { + android.hardware.tv.tuner.FrontendAtsc3Bandwidth atsc3 = android.hardware.tv.tuner.FrontendAtsc3Bandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbcBandwidth dvbc; + android.hardware.tv.tuner.FrontendDvbtBandwidth dvbt; + android.hardware.tv.tuner.FrontendIsdbtBandwidth isdbt; + android.hardware.tv.tuner.FrontendDtmbBandwidth dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl new file mode 100644 index 0000000000..ff71df39cf --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendCableTimeInterleaveMode.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendCableTimeInterleaveMode { + UNDEFINED = 0, + AUTO = 1, + INTERLEAVING_128_1_0 = 2, + INTERLEAVING_128_1_1 = 4, + INTERLEAVING_64_2 = 8, + INTERLEAVING_32_4 = 16, + INTERLEAVING_16_8 = 32, + INTERLEAVING_8_16 = 64, + INTERLEAVING_128_2 = 128, + INTERLEAVING_128_3 = 256, + INTERLEAVING_128_4 = 512, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendCapabilities.aidl new file mode 100644 index 0000000000..c013cd111a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendCapabilities.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendCapabilities { + android.hardware.tv.tuner.FrontendAnalogCapabilities analogCaps; + android.hardware.tv.tuner.FrontendAtscCapabilities atscCaps; + android.hardware.tv.tuner.FrontendAtsc3Capabilities atsc3Caps; + android.hardware.tv.tuner.FrontendDtmbCapabilities dtmbCaps; + android.hardware.tv.tuner.FrontendDvbsCapabilities dvbsCaps; + android.hardware.tv.tuner.FrontendDvbcCapabilities dvbcCaps; + android.hardware.tv.tuner.FrontendDvbtCapabilities dvbtCaps; + android.hardware.tv.tuner.FrontendIsdbsCapabilities isdbsCaps; + android.hardware.tv.tuner.FrontendIsdbs3Capabilities isdbs3Caps; + android.hardware.tv.tuner.FrontendIsdbtCapabilities isdbtCaps; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl new file mode 100644 index 0000000000..18d71d2a7f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbBandwidth.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbBandwidth { + UNDEFINED = 0, + AUTO = 1, + BANDWIDTH_8MHZ = 2, + BANDWIDTH_6MHZ = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl new file mode 100644 index 0000000000..8d35104e09 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbCapabilities.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDtmbCapabilities { + int transmissionModeCap; + int bandwidthCap; + int modulationCap; + int codeRateCap; + int guardIntervalCap; + int interleaveModeCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl new file mode 100644 index 0000000000..c9454e7506 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbCodeRate.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbCodeRate { + UNDEFINED = 0, + AUTO = 1, + CODERATE_2_5 = 2, + CODERATE_3_5 = 4, + CODERATE_4_5 = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl new file mode 100644 index 0000000000..872eb6ae1c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbGuardInterval.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbGuardInterval { + UNDEFINED = 0, + AUTO = 1, + PN_420_VARIOUS = 2, + PN_595_CONST = 4, + PN_945_VARIOUS = 8, + PN_420_CONST = 16, + PN_945_CONST = 32, + PN_RESERVED = 64, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbModulation.aidl new file mode 100644 index 0000000000..088aac5e50 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbModulation.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbModulation { + UNDEFINED = 0, + AUTO = 1, + CONSTELLATION_4QAM = 2, + CONSTELLATION_4QAM_NR = 4, + CONSTELLATION_16QAM = 8, + CONSTELLATION_32QAM = 16, + CONSTELLATION_64QAM = 32, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbSettings.aidl new file mode 100644 index 0000000000..5f9b775db1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbSettings.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDtmbSettings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbTransmissionMode transmissionMode = android.hardware.tv.tuner.FrontendDtmbTransmissionMode.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbBandwidth bandwidth = android.hardware.tv.tuner.FrontendDtmbBandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbModulation modulation = android.hardware.tv.tuner.FrontendDtmbModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbCodeRate codeRate = android.hardware.tv.tuner.FrontendDtmbCodeRate.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbGuardInterval guardInterval = android.hardware.tv.tuner.FrontendDtmbGuardInterval.UNDEFINED; + android.hardware.tv.tuner.FrontendDtmbTimeInterleaveMode interleaveMode = android.hardware.tv.tuner.FrontendDtmbTimeInterleaveMode.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl new file mode 100644 index 0000000000..8321ad0ebc --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbTimeInterleaveMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbTimeInterleaveMode { + UNDEFINED = 0, + AUTO = 1, + TIMER_INT_240 = 2, + TIMER_INT_720 = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl new file mode 100644 index 0000000000..5298291cd2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDtmbTransmissionMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDtmbTransmissionMode { + UNDEFINED = 0, + AUTO = 1, + C1 = 2, + C3780 = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl new file mode 100644 index 0000000000..cdfedb6702 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcAnnex.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum FrontendDvbcAnnex { + UNDEFINED = 0, + A = 1, + B = 2, + C = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl new file mode 100644 index 0000000000..f0fe460d68 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcBandwidth.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbcBandwidth { + UNDEFINED = 0, + BANDWIDTH_5MHZ = 1, + BANDWIDTH_6MHZ = 2, + BANDWIDTH_7MHZ = 4, + BANDWIDTH_8MHZ = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl new file mode 100644 index 0000000000..0c0e3ee5d0 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcCapabilities.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbcCapabilities { + int modulationCap; + long fecCap; + byte annexCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcModulation.aidl new file mode 100644 index 0000000000..0871777509 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcModulation.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbcModulation { + UNDEFINED = 0, + AUTO = 1, + MOD_16QAM = 2, + MOD_32QAM = 4, + MOD_64QAM = 8, + MOD_128QAM = 16, + MOD_256QAM = 32, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl new file mode 100644 index 0000000000..f1e92c9d5a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcOuterFec.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbcOuterFec { + UNDEFINED = 0, + OUTER_FEC_NONE = 1, + OUTER_FEC_RS = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcSettings.aidl new file mode 100644 index 0000000000..6b2caedf83 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbcSettings.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbcSettings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendDvbcModulation modulation = android.hardware.tv.tuner.FrontendDvbcModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendInnerFec fec = android.hardware.tv.tuner.FrontendInnerFec.FEC_UNDEFINED; + int symbolRate; + android.hardware.tv.tuner.FrontendDvbcOuterFec outerFec = android.hardware.tv.tuner.FrontendDvbcOuterFec.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbcAnnex annex = android.hardware.tv.tuner.FrontendDvbcAnnex.UNDEFINED; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendCableTimeInterleaveMode interleaveMode = android.hardware.tv.tuner.FrontendCableTimeInterleaveMode.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbcBandwidth bandwidth = android.hardware.tv.tuner.FrontendDvbcBandwidth.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl new file mode 100644 index 0000000000..43e8aee23b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsCapabilities.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbsCapabilities { + int modulationCap; + long innerfecCap; + byte standard; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl new file mode 100644 index 0000000000..4c3d4e466a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsCodeRate.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbsCodeRate { + android.hardware.tv.tuner.FrontendInnerFec fec = android.hardware.tv.tuner.FrontendInnerFec.FEC_UNDEFINED; + boolean isLinear; + boolean isShortFrames; + int bitsPer1000Symbol; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsModulation.aidl new file mode 100644 index 0000000000..25951ccecb --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsModulation.aidl @@ -0,0 +1,53 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsModulation { + UNDEFINED = 0, + AUTO = 1, + MOD_QPSK = 2, + MOD_8PSK = 4, + MOD_16QAM = 8, + MOD_16PSK = 16, + MOD_32PSK = 32, + MOD_ACM = 64, + MOD_8APSK = 128, + MOD_16APSK = 256, + MOD_32APSK = 512, + MOD_64APSK = 1024, + MOD_128APSK = 2048, + MOD_256APSK = 4096, + MOD_RESERVED = 8192, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsPilot.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsPilot.aidl new file mode 100644 index 0000000000..4f2c6eb8d7 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsPilot.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsPilot { + UNDEFINED = 0, + ON = 1, + OFF = 2, + AUTO = 3, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl new file mode 100644 index 0000000000..56ee37b613 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsRolloff.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsRolloff { + UNDEFINED = 0, + ROLLOFF_0_35 = 1, + ROLLOFF_0_25 = 2, + ROLLOFF_0_20 = 3, + ROLLOFF_0_15 = 4, + ROLLOFF_0_10 = 5, + ROLLOFF_0_5 = 6, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsScanType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsScanType.aidl new file mode 100644 index 0000000000..110b1d8b1f --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsScanType.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsScanType { + UNDEFINED = 0, + DIRECT = 1, + DISEQC = 2, + UNICABLE = 3, + JESS = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsSettings.aidl new file mode 100644 index 0000000000..dab8888b65 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsSettings.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbsSettings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsModulation modulation = android.hardware.tv.tuner.FrontendDvbsModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsCodeRate coderate; + int symbolRate; + android.hardware.tv.tuner.FrontendDvbsRolloff rolloff = android.hardware.tv.tuner.FrontendDvbsRolloff.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsPilot pilot = android.hardware.tv.tuner.FrontendDvbsPilot.UNDEFINED; + int inputStreamId; + android.hardware.tv.tuner.FrontendDvbsStandard standard = android.hardware.tv.tuner.FrontendDvbsStandard.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsVcmMode vcmMode = android.hardware.tv.tuner.FrontendDvbsVcmMode.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsScanType scanType = android.hardware.tv.tuner.FrontendDvbsScanType.UNDEFINED; + boolean isDiseqcRxMessage; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsStandard.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsStandard.aidl new file mode 100644 index 0000000000..b9cb657fb5 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsStandard.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum FrontendDvbsStandard { + UNDEFINED = 0, + AUTO = 1, + S = 2, + S2 = 4, + S2X = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl new file mode 100644 index 0000000000..2cbff7cc1b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbsVcmMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbsVcmMode { + UNDEFINED = 0, + AUTO = 1, + MANUAL = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl new file mode 100644 index 0000000000..f5d14e898b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtBandwidth.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtBandwidth { + UNDEFINED = 0, + AUTO = 1, + BANDWIDTH_8MHZ = 2, + BANDWIDTH_7MHZ = 4, + BANDWIDTH_6MHZ = 8, + BANDWIDTH_5MHZ = 16, + BANDWIDTH_1_7MHZ = 32, + BANDWIDTH_10MHZ = 64, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl new file mode 100644 index 0000000000..a0e6ce2710 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtCapabilities.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbtCapabilities { + int transmissionModeCap; + int bandwidthCap; + int constellationCap; + int coderateCap; + int hierarchyCap; + int guardIntervalCap; + boolean isT2Supported; + boolean isMisoSupported; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl new file mode 100644 index 0000000000..8bd0489a6e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtCoderate.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtCoderate { + UNDEFINED = 0, + AUTO = 1, + CODERATE_1_2 = 2, + CODERATE_2_3 = 4, + CODERATE_3_4 = 8, + CODERATE_5_6 = 16, + CODERATE_7_8 = 32, + CODERATE_3_5 = 64, + CODERATE_4_5 = 128, + CODERATE_6_7 = 256, + CODERATE_8_9 = 512, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl new file mode 100644 index 0000000000..bc40901de4 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtConstellation.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtConstellation { + UNDEFINED = 0, + AUTO = 1, + CONSTELLATION_QPSK = 2, + CONSTELLATION_16QAM = 4, + CONSTELLATION_64QAM = 8, + CONSTELLATION_256QAM = 16, + CONSTELLATION_QPSK_R = 32, + CONSTELLATION_16QAM_R = 64, + CONSTELLATION_64QAM_R = 128, + CONSTELLATION_256QAM_R = 256, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl new file mode 100644 index 0000000000..073a77e2b8 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtGuardInterval.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtGuardInterval { + UNDEFINED = 0, + AUTO = 1, + INTERVAL_1_32 = 2, + INTERVAL_1_16 = 4, + INTERVAL_1_8 = 8, + INTERVAL_1_4 = 16, + INTERVAL_1_128 = 32, + INTERVAL_19_128 = 64, + INTERVAL_19_256 = 128, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl new file mode 100644 index 0000000000..9ed5c8ceae --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtHierarchy.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtHierarchy { + UNDEFINED = 0, + AUTO = 1, + HIERARCHY_NON_NATIVE = 2, + HIERARCHY_1_NATIVE = 4, + HIERARCHY_2_NATIVE = 8, + HIERARCHY_4_NATIVE = 16, + HIERARCHY_NON_INDEPTH = 32, + HIERARCHY_1_INDEPTH = 64, + HIERARCHY_2_INDEPTH = 128, + HIERARCHY_4_INDEPTH = 256, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl new file mode 100644 index 0000000000..c80bc2aa5a --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtPlpMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtPlpMode { + UNDEFINED = 0, + AUTO = 1, + MANUAL = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtSettings.aidl new file mode 100644 index 0000000000..ec1277aa99 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtSettings.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendDvbtSettings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtTransmissionMode transmissionMode = android.hardware.tv.tuner.FrontendDvbtTransmissionMode.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtBandwidth bandwidth = android.hardware.tv.tuner.FrontendDvbtBandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtConstellation constellation = android.hardware.tv.tuner.FrontendDvbtConstellation.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtHierarchy hierarchy = android.hardware.tv.tuner.FrontendDvbtHierarchy.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtCoderate hpCoderate = android.hardware.tv.tuner.FrontendDvbtCoderate.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtCoderate lpCoderate = android.hardware.tv.tuner.FrontendDvbtCoderate.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtGuardInterval guardInterval = android.hardware.tv.tuner.FrontendDvbtGuardInterval.UNDEFINED; + boolean isHighPriority; + android.hardware.tv.tuner.FrontendDvbtStandard standard = android.hardware.tv.tuner.FrontendDvbtStandard.UNDEFINED; + boolean isMiso; + android.hardware.tv.tuner.FrontendDvbtPlpMode plpMode = android.hardware.tv.tuner.FrontendDvbtPlpMode.UNDEFINED; + int plpId; + int plpGroupId; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtStandard.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtStandard.aidl new file mode 100644 index 0000000000..c7ba68abc6 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtStandard.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum FrontendDvbtStandard { + UNDEFINED = 0, + AUTO = 1, + T = 2, + T2 = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl new file mode 100644 index 0000000000..e3ca2e3901 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendDvbtTransmissionMode { + UNDEFINED = 0, + AUTO = 1, + MODE_2K = 2, + MODE_8K = 4, + MODE_4K = 8, + MODE_1K = 16, + MODE_16K = 32, + MODE_32K = 64, + MODE_8K_E = 128, + MODE_16K_E = 256, + MODE_32K_E = 512, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendEventType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendEventType.aidl new file mode 100644 index 0000000000..443313fead --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendEventType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendEventType { + LOCKED = 0, + NO_SIGNAL = 1, + LOST_LOCK = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendGuardInterval.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendGuardInterval.aidl new file mode 100644 index 0000000000..15c738a47c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendGuardInterval.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendGuardInterval { + android.hardware.tv.tuner.FrontendDvbtGuardInterval dvbt = android.hardware.tv.tuner.FrontendDvbtGuardInterval.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtGuardInterval isdbt; + android.hardware.tv.tuner.FrontendDtmbGuardInterval dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendInfo.aidl new file mode 100644 index 0000000000..d5bdd58505 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendInfo.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendInfo { + android.hardware.tv.tuner.FrontendType type = android.hardware.tv.tuner.FrontendType.UNDEFINED; + long minFrequency; + long maxFrequency; + int minSymbolRate; + int maxSymbolRate; + long acquireRange; + int exclusiveGroupId; + android.hardware.tv.tuner.FrontendStatusType[] statusCaps; + android.hardware.tv.tuner.FrontendCapabilities frontendCaps; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendInnerFec.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendInnerFec.aidl new file mode 100644 index 0000000000..19599a3f82 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendInnerFec.aidl @@ -0,0 +1,92 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="long") @VintfStability +enum FrontendInnerFec { + FEC_UNDEFINED = 0, + AUTO = 1, + FEC_1_2 = 2, + FEC_1_3 = 4, + FEC_1_4 = 8, + FEC_1_5 = 16, + FEC_2_3 = 32, + FEC_2_5 = 64, + FEC_2_9 = 128, + FEC_3_4 = 256, + FEC_3_5 = 512, + FEC_4_5 = 1024, + FEC_4_15 = 2048, + FEC_5_6 = 4096, + FEC_5_9 = 8192, + FEC_6_7 = 16384, + FEC_7_8 = 32768, + FEC_7_9 = 65536, + FEC_7_15 = 131072, + FEC_8_9 = 262144, + FEC_8_15 = 524288, + FEC_9_10 = 1048576, + FEC_9_20 = 2097152, + FEC_11_15 = 4194304, + FEC_11_20 = 8388608, + FEC_11_45 = 16777216, + FEC_13_18 = 33554432, + FEC_13_45 = 67108864, + FEC_14_45 = 134217728, + FEC_23_36 = 268435456, + FEC_25_36 = 536870912, + FEC_26_45 = 1073741824, + FEC_28_45 = 2147483648, + FEC_29_45 = 4294967296, + FEC_31_45 = 8589934592, + FEC_32_45 = 17179869184, + FEC_77_90 = 34359738368, + FEC_2_15 = 68719476736, + FEC_3_15 = 137438953472, + FEC_5_15 = 274877906944, + FEC_6_15 = 549755813888, + FEC_9_15 = 1099511627776, + FEC_10_15 = 2199023255552, + FEC_12_15 = 4398046511104, + FEC_13_15 = 8796093022208, + FEC_18_30 = 17592186044416, + FEC_20_30 = 35184372088832, + FEC_90_180 = 70368744177664, + FEC_96_180 = 140737488355328, + FEC_104_180 = 281474976710656, + FEC_128_180 = 562949953421312, + FEC_132_180 = 1125899906842624, + FEC_135_180 = 2251799813685248, + FEC_140_180 = 4503599627370496, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendInterleaveMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendInterleaveMode.aidl new file mode 100644 index 0000000000..ac38731260 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendInterleaveMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendInterleaveMode { + android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode atsc3 = android.hardware.tv.tuner.FrontendAtsc3TimeInterleaveMode.UNDEFINED; + android.hardware.tv.tuner.FrontendCableTimeInterleaveMode dvbc; + android.hardware.tv.tuner.FrontendDtmbTimeInterleaveMode dtmb; + android.hardware.tv.tuner.FrontendIsdbtTimeInterleaveMode isdbt; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl new file mode 100644 index 0000000000..4be37c2006 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Capabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbs3Capabilities { + int modulationCap; + int coderateCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl new file mode 100644 index 0000000000..1ee7f07e71 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Coderate.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbs3Coderate { + UNDEFINED = 0, + AUTO = 1, + CODERATE_1_3 = 2, + CODERATE_2_5 = 4, + CODERATE_1_2 = 8, + CODERATE_3_5 = 16, + CODERATE_2_3 = 32, + CODERATE_3_4 = 64, + CODERATE_7_9 = 128, + CODERATE_4_5 = 256, + CODERATE_5_6 = 512, + CODERATE_7_8 = 1024, + CODERATE_9_10 = 2048, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl new file mode 100644 index 0000000000..3603292eca --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Modulation.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbs3Modulation { + UNDEFINED = 0, + AUTO = 1, + MOD_BPSK = 2, + MOD_QPSK = 4, + MOD_8PSK = 8, + MOD_16APSK = 16, + MOD_32APSK = 32, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl new file mode 100644 index 0000000000..733760c471 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Rolloff.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbs3Rolloff { + UNDEFINED = 0, + ROLLOFF_0_03 = 1, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl new file mode 100644 index 0000000000..8c491d6fa2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbs3Settings.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbs3Settings { + long frequency; + long endFrequency; + int streamId; + android.hardware.tv.tuner.FrontendIsdbsStreamIdType streamIdType = android.hardware.tv.tuner.FrontendIsdbsStreamIdType.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbs3Modulation modulation = android.hardware.tv.tuner.FrontendIsdbs3Modulation.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbs3Coderate coderate = android.hardware.tv.tuner.FrontendIsdbs3Coderate.UNDEFINED; + int symbolRate; + android.hardware.tv.tuner.FrontendIsdbs3Rolloff rolloff = android.hardware.tv.tuner.FrontendIsdbs3Rolloff.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl new file mode 100644 index 0000000000..2cb892cd3d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbsCapabilities { + int modulationCap; + int coderateCap; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl new file mode 100644 index 0000000000..09e9c5902d --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsCoderate.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbsCoderate { + UNDEFINED = 0, + AUTO = 1, + CODERATE_1_2 = 2, + CODERATE_2_3 = 4, + CODERATE_3_4 = 8, + CODERATE_5_6 = 16, + CODERATE_7_8 = 32, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl new file mode 100644 index 0000000000..7b9bde66dd --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsModulation.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbsModulation { + UNDEFINED = 0, + AUTO = 1, + MOD_BPSK = 2, + MOD_QPSK = 4, + MOD_TC8PSK = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl new file mode 100644 index 0000000000..a2ab154661 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsRolloff.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbsRolloff { + UNDEFINED = 0, + ROLLOFF_0_35 = 1, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl new file mode 100644 index 0000000000..324fb6feb4 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsSettings.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbsSettings { + long frequency; + long endFrequency; + int streamId; + android.hardware.tv.tuner.FrontendIsdbsStreamIdType streamIdType = android.hardware.tv.tuner.FrontendIsdbsStreamIdType.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbsModulation modulation = android.hardware.tv.tuner.FrontendIsdbsModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbsCoderate coderate = android.hardware.tv.tuner.FrontendIsdbsCoderate.UNDEFINED; + int symbolRate; + android.hardware.tv.tuner.FrontendIsdbsRolloff rolloff = android.hardware.tv.tuner.FrontendIsdbsRolloff.UNDEFINED; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl new file mode 100644 index 0000000000..089f611e9c --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbsStreamIdType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbsStreamIdType { + STREAM_ID = 0, + RELATIVE_STREAM_NUMBER = 1, + UNDEFINED = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl new file mode 100644 index 0000000000..cd492142a9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtBandwidth.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtBandwidth { + UNDEFINED = 0, + AUTO = 1, + BANDWIDTH_8MHZ = 2, + BANDWIDTH_7MHZ = 4, + BANDWIDTH_6MHZ = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl new file mode 100644 index 0000000000..dbf631b8c7 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtCapabilities.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbtCapabilities { + int modeCap; + int bandwidthCap; + int modulationCap; + int coderateCap; + int guardIntervalCap; + int timeInterleaveCap; + boolean isSegmentAuto; + boolean isFullSegment; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl new file mode 100644 index 0000000000..2b747edbbd --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtCoderate.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtCoderate { + UNDEFINED = 0, + AUTO = 1, + CODERATE_1_2 = 2, + CODERATE_2_3 = 4, + CODERATE_3_4 = 8, + CODERATE_5_6 = 16, + CODERATE_7_8 = 32, + CODERATE_3_5 = 64, + CODERATE_4_5 = 128, + CODERATE_6_7 = 256, + CODERATE_8_9 = 512, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl new file mode 100644 index 0000000000..42a023adc9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtGuardInterval.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtGuardInterval { + UNDEFINED = 0, + AUTO = 1, + INTERVAL_1_32 = 2, + INTERVAL_1_16 = 4, + INTERVAL_1_8 = 8, + INTERVAL_1_4 = 16, + INTERVAL_1_128 = 32, + INTERVAL_19_128 = 64, + INTERVAL_19_256 = 128, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtLayerSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtLayerSettings.aidl new file mode 100644 index 0000000000..0055793439 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtLayerSettings.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbtLayerSettings { + android.hardware.tv.tuner.FrontendIsdbtModulation modulation = android.hardware.tv.tuner.FrontendIsdbtModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtCoderate coderate = android.hardware.tv.tuner.FrontendIsdbtCoderate.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtTimeInterleaveMode timeInterleave = android.hardware.tv.tuner.FrontendIsdbtTimeInterleaveMode.UNDEFINED; + int numOfSegment; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtMode.aidl new file mode 100644 index 0000000000..54698abb53 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtMode.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtMode { + UNDEFINED = 0, + AUTO = 1, + MODE_1 = 2, + MODE_2 = 4, + MODE_3 = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl new file mode 100644 index 0000000000..a31e0cf7b0 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtModulation.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtModulation { + UNDEFINED = 0, + AUTO = 1, + MOD_DQPSK = 2, + MOD_QPSK = 4, + MOD_16QAM = 8, + MOD_64QAM = 16, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtPartialReceptionFlag.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtPartialReceptionFlag.aidl new file mode 100644 index 0000000000..133887f659 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtPartialReceptionFlag.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtPartialReceptionFlag { + UNDEFINED = 0, + AUTO = 1, + FALSE = 2, + TRUE = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl new file mode 100644 index 0000000000..605bc210e5 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtSettings.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendIsdbtSettings { + long frequency; + long endFrequency; + android.hardware.tv.tuner.FrontendSpectralInversion inversion = android.hardware.tv.tuner.FrontendSpectralInversion.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtBandwidth bandwidth = android.hardware.tv.tuner.FrontendIsdbtBandwidth.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtMode mode = android.hardware.tv.tuner.FrontendIsdbtMode.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtGuardInterval guardInterval = android.hardware.tv.tuner.FrontendIsdbtGuardInterval.UNDEFINED; + int serviceAreaId; + android.hardware.tv.tuner.FrontendIsdbtPartialReceptionFlag partialReceptionFlag = android.hardware.tv.tuner.FrontendIsdbtPartialReceptionFlag.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtLayerSettings[] layerSettings; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtTimeInterleaveMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtTimeInterleaveMode.aidl new file mode 100644 index 0000000000..50adde92b3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendIsdbtTimeInterleaveMode.aidl @@ -0,0 +1,52 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendIsdbtTimeInterleaveMode { + UNDEFINED = 0, + AUTO = 1, + INTERLEAVE_1_0 = 2, + INTERLEAVE_1_4 = 4, + INTERLEAVE_1_8 = 8, + INTERLEAVE_1_16 = 16, + INTERLEAVE_2_0 = 32, + INTERLEAVE_2_2 = 64, + INTERLEAVE_2_4 = 128, + INTERLEAVE_2_8 = 256, + INTERLEAVE_3_0 = 512, + INTERLEAVE_3_1 = 1024, + INTERLEAVE_3_2 = 2048, + INTERLEAVE_3_4 = 4096, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendModulation.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendModulation.aidl new file mode 100644 index 0000000000..6e396b0422 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendModulation.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendModulation { + android.hardware.tv.tuner.FrontendDvbcModulation dvbc = android.hardware.tv.tuner.FrontendDvbcModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsModulation dvbs; + android.hardware.tv.tuner.FrontendDvbtConstellation dvbt; + android.hardware.tv.tuner.FrontendIsdbsModulation isdbs; + android.hardware.tv.tuner.FrontendIsdbs3Modulation isdbs3; + android.hardware.tv.tuner.FrontendIsdbtModulation isdbt; + android.hardware.tv.tuner.FrontendAtscModulation atsc; + android.hardware.tv.tuner.FrontendAtsc3Modulation atsc3; + android.hardware.tv.tuner.FrontendDtmbModulation dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendModulationStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendModulationStatus.aidl new file mode 100644 index 0000000000..723fdd044b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendModulationStatus.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendModulationStatus { + android.hardware.tv.tuner.FrontendDvbcModulation dvbc = android.hardware.tv.tuner.FrontendDvbcModulation.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbsModulation dvbs; + android.hardware.tv.tuner.FrontendIsdbsModulation isdbs; + android.hardware.tv.tuner.FrontendIsdbs3Modulation isdbs3; + android.hardware.tv.tuner.FrontendIsdbtModulation isdbt; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendRollOff.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendRollOff.aidl new file mode 100644 index 0000000000..c5f8b8e8b7 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendRollOff.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendRollOff { + android.hardware.tv.tuner.FrontendDvbsRolloff dvbs = android.hardware.tv.tuner.FrontendDvbsRolloff.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbsRolloff isdbs; + android.hardware.tv.tuner.FrontendIsdbs3Rolloff isdbs3; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl new file mode 100644 index 0000000000..56ef3e3d13 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanAtsc3PlpInfo.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendScanAtsc3PlpInfo { + int plpId; + boolean bLlsFlag; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanMessage.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanMessage.aidl new file mode 100644 index 0000000000..e763cfb617 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanMessage.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendScanMessage { + boolean isLocked; + boolean isEnd; + int progressPercent; + long[] frequencies; + int[] symbolRates; + android.hardware.tv.tuner.FrontendDvbtHierarchy hierarchy; + android.hardware.tv.tuner.FrontendAnalogType analogType; + int[] plpIds; + int[] groupIds; + int[] inputStreamIds; + android.hardware.tv.tuner.FrontendScanMessageStandard std; + android.hardware.tv.tuner.FrontendScanAtsc3PlpInfo[] atsc3PlpInfos; + android.hardware.tv.tuner.FrontendModulation modulation; + android.hardware.tv.tuner.FrontendDvbcAnnex annex; + boolean isHighPriority; + int[] dvbtCellIds; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl new file mode 100644 index 0000000000..e163fc6670 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanMessageStandard.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendScanMessageStandard { + android.hardware.tv.tuner.FrontendDvbsStandard sStd = android.hardware.tv.tuner.FrontendDvbsStandard.UNDEFINED; + android.hardware.tv.tuner.FrontendDvbtStandard tStd; + android.hardware.tv.tuner.FrontendAnalogSifStandard sifStd; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanMessageType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanMessageType.aidl new file mode 100644 index 0000000000..6976ecd8d0 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanMessageType.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendScanMessageType { + LOCKED = 0, + END = 1, + PROGRESS_PERCENT = 2, + FREQUENCY = 3, + SYMBOL_RATE = 4, + HIERARCHY = 5, + ANALOG_TYPE = 6, + PLP_IDS = 7, + GROUP_IDS = 8, + INPUT_STREAM_IDS = 9, + STANDARD = 10, + ATSC3_PLP_INFO = 11, + MODULATION = 12, + DVBC_ANNEX = 13, + HIGH_PRIORITY = 14, + DVBT_CELL_IDS = 15, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanType.aidl new file mode 100644 index 0000000000..ed42d0aac9 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendScanType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendScanType { + SCAN_UNDEFINED = 0, + SCAN_AUTO = 1, + SCAN_BLIND = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendSettings.aidl new file mode 100644 index 0000000000..7eae9df379 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendSettings.aidl @@ -0,0 +1,48 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendSettings { + android.hardware.tv.tuner.FrontendAnalogSettings analog; + android.hardware.tv.tuner.FrontendAtscSettings atsc; + android.hardware.tv.tuner.FrontendAtsc3Settings atsc3; + android.hardware.tv.tuner.FrontendDvbsSettings dvbs; + android.hardware.tv.tuner.FrontendDvbcSettings dvbc; + android.hardware.tv.tuner.FrontendDvbtSettings dvbt; + android.hardware.tv.tuner.FrontendIsdbsSettings isdbs; + android.hardware.tv.tuner.FrontendIsdbs3Settings isdbs3; + android.hardware.tv.tuner.FrontendIsdbtSettings isdbt; + android.hardware.tv.tuner.FrontendDtmbSettings dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendSpectralInversion.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendSpectralInversion.aidl new file mode 100644 index 0000000000..ff11bb8dab --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendSpectralInversion.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendSpectralInversion { + UNDEFINED = 0, + NORMAL = 1, + INVERTED = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatus.aidl new file mode 100644 index 0000000000..1e0f5f0840 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatus.aidl @@ -0,0 +1,80 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendStatus { + boolean isDemodLocked; + int snr; + int ber; + int per; + int preBer; + int signalQuality; + int signalStrength; + int symbolRate; + android.hardware.tv.tuner.FrontendInnerFec innerFec; + android.hardware.tv.tuner.FrontendModulationStatus modulationStatus; + android.hardware.tv.tuner.FrontendSpectralInversion inversion; + android.hardware.tv.tuner.LnbVoltage lnbVoltage; + int plpId; + boolean isEWBS; + int agc; + boolean isLnaOn; + boolean[] isLayerError; + int mer; + long freqOffset; + android.hardware.tv.tuner.FrontendDvbtHierarchy hierarchy; + boolean isRfLocked; + android.hardware.tv.tuner.FrontendStatusAtsc3PlpInfo[] plpInfo; + android.hardware.tv.tuner.FrontendModulation[] modulations; + int[] bers; + android.hardware.tv.tuner.FrontendInnerFec[] codeRates; + android.hardware.tv.tuner.FrontendBandwidth bandwidth; + android.hardware.tv.tuner.FrontendGuardInterval interval; + android.hardware.tv.tuner.FrontendTransmissionMode transmissionMode; + int uec; + int systemId; + android.hardware.tv.tuner.FrontendInterleaveMode[] interleaving; + int[] isdbtSegment; + int[] tsDataRate; + android.hardware.tv.tuner.FrontendRollOff rollOff; + boolean isMiso; + boolean isLinear; + boolean isShortFrames; + android.hardware.tv.tuner.FrontendIsdbtMode isdbtMode; + android.hardware.tv.tuner.FrontendIsdbtPartialReceptionFlag partialReceptionFlag; + int[] streamIdList; + int[] dvbtCellIds; + android.hardware.tv.tuner.FrontendScanAtsc3PlpInfo[] allPlpInfo; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl new file mode 100644 index 0000000000..8f65925236 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatusAtsc3PlpInfo.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable FrontendStatusAtsc3PlpInfo { + int plpId; + boolean isLocked; + int uec; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatusReadiness.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatusReadiness.aidl new file mode 100644 index 0000000000..41944ce440 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatusReadiness.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 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 -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.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendStatusReadiness { + UNDEFINED = 0, + UNAVAILABLE = 1, + UNSTABLE = 2, + STABLE = 3, + UNSUPPORTED = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatusType.aidl new file mode 100644 index 0000000000..cd6ccb3dc1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendStatusType.aidl @@ -0,0 +1,80 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendStatusType { + DEMOD_LOCK = 0, + SNR = 1, + BER = 2, + PER = 3, + PRE_BER = 4, + SIGNAL_QUALITY = 5, + SIGNAL_STRENGTH = 6, + SYMBOL_RATE = 7, + FEC = 8, + MODULATION = 9, + SPECTRAL = 10, + LNB_VOLTAGE = 11, + PLP_ID = 12, + EWBS = 13, + AGC = 14, + LNA = 15, + LAYER_ERROR = 16, + MER = 17, + FREQ_OFFSET = 18, + HIERARCHY = 19, + RF_LOCK = 20, + ATSC3_PLP_INFO = 21, + MODULATIONS = 22, + BERS = 23, + CODERATES = 24, + BANDWIDTH = 25, + GUARD_INTERVAL = 26, + TRANSMISSION_MODE = 27, + UEC = 28, + T2_SYSTEM_ID = 29, + INTERLEAVINGS = 30, + ISDBT_SEGMENTS = 31, + TS_DATA_RATES = 32, + ROLL_OFF = 33, + IS_MISO = 34, + IS_LINEAR = 35, + IS_SHORT_FRAMES = 36, + ISDBT_MODE = 37, + ISDBT_PARTIAL_RECEPTION_FLAG = 38, + STREAM_ID_LIST = 39, + DVBT_CELL_IDS = 40, + ATSC3_ALL_PLP_INFO = 41, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendTransmissionMode.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendTransmissionMode.aidl new file mode 100644 index 0000000000..72c36419ec --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendTransmissionMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +union FrontendTransmissionMode { + android.hardware.tv.tuner.FrontendDvbtTransmissionMode dvbt = android.hardware.tv.tuner.FrontendDvbtTransmissionMode.UNDEFINED; + android.hardware.tv.tuner.FrontendIsdbtMode isdbt; + android.hardware.tv.tuner.FrontendDtmbTransmissionMode dtmb; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendType.aidl new file mode 100644 index 0000000000..99a120bcb3 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/FrontendType.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendType { + UNDEFINED = 0, + ANALOG = 1, + ATSC = 2, + ATSC3 = 3, + DVBC = 4, + DVBS = 5, + DVBT = 6, + ISDBS = 7, + ISDBS3 = 8, + ISDBT = 9, + DTMB = 10, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDemux.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDemux.aidl new file mode 100644 index 0000000000..59ec92ba3b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDemux.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IDemux { + void setFrontendDataSource(in int frontendId); + android.hardware.tv.tuner.IFilter openFilter(in android.hardware.tv.tuner.DemuxFilterType type, in int bufferSize, in android.hardware.tv.tuner.IFilterCallback cb); + android.hardware.tv.tuner.ITimeFilter openTimeFilter(); + int getAvSyncHwId(in android.hardware.tv.tuner.IFilter filter); + long getAvSyncTime(in int avSyncHwId); + void close(); + android.hardware.tv.tuner.IDvr openDvr(in android.hardware.tv.tuner.DvrType type, in int bufferSize, in android.hardware.tv.tuner.IDvrCallback cb); + void connectCiCam(in int ciCamId); + void disconnectCiCam(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDescrambler.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDescrambler.aidl new file mode 100644 index 0000000000..3cf3c044ba --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDescrambler.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IDescrambler { + void setDemuxSource(in int demuxId); + void setKeyToken(in byte[] keyToken); + void addPid(in android.hardware.tv.tuner.DemuxPid pid, in android.hardware.tv.tuner.IFilter optionalSourceFilter); + void removePid(in android.hardware.tv.tuner.DemuxPid pid, in android.hardware.tv.tuner.IFilter optionalSourceFilter); + void close(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDvr.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDvr.aidl new file mode 100644 index 0000000000..450cd79129 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDvr.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IDvr { + void getQueueDesc(out android.hardware.common.fmq.MQDescriptor queue); + void configure(in android.hardware.tv.tuner.DvrSettings settings); + void attachFilter(in android.hardware.tv.tuner.IFilter filter); + void detachFilter(in android.hardware.tv.tuner.IFilter filter); + void start(); + void stop(); + void flush(); + void close(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDvrCallback.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDvrCallback.aidl new file mode 100644 index 0000000000..13c8644b7b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IDvrCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IDvrCallback { + oneway void onPlaybackStatus(in android.hardware.tv.tuner.PlaybackStatus status); + oneway void onRecordStatus(in android.hardware.tv.tuner.RecordStatus status); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFilter.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFilter.aidl new file mode 100644 index 0000000000..32d9d64f73 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFilter.aidl @@ -0,0 +1,53 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IFilter { + void getQueueDesc(out android.hardware.common.fmq.MQDescriptor queue); + void close(); + void configure(in android.hardware.tv.tuner.DemuxFilterSettings settings); + void configureAvStreamType(in android.hardware.tv.tuner.AvStreamType avStreamType); + void configureIpCid(in int ipCid); + void configureMonitorEvent(in int monitorEventTypes); + void start(); + void stop(); + void flush(); + long getAvSharedHandle(out android.hardware.common.NativeHandle avMemory); + int getId(); + long getId64Bit(); + void releaseAvHandle(in android.hardware.common.NativeHandle avMemory, in long avDataId); + void setDataSource(in android.hardware.tv.tuner.IFilter filter); + void setDelayHint(in android.hardware.tv.tuner.FilterDelayHint hint); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFilterCallback.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFilterCallback.aidl new file mode 100644 index 0000000000..d8bedba451 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFilterCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IFilterCallback { + oneway void onFilterEvent(in android.hardware.tv.tuner.DemuxFilterEvent[] events); + oneway void onFilterStatus(in android.hardware.tv.tuner.DemuxFilterStatus status); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFrontend.aidl new file mode 100644 index 0000000000..3e3ff4fad6 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFrontend.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IFrontend { + void setCallback(in android.hardware.tv.tuner.IFrontendCallback callback); + void tune(in android.hardware.tv.tuner.FrontendSettings settings); + void stopTune(); + void close(); + void scan(in android.hardware.tv.tuner.FrontendSettings settings, in android.hardware.tv.tuner.FrontendScanType type); + void stopScan(); + android.hardware.tv.tuner.FrontendStatus[] getStatus(in android.hardware.tv.tuner.FrontendStatusType[] statusTypes); + void setLnb(in int lnbId); + int linkCiCam(in int ciCamId); + void unlinkCiCam(in int ciCamId); + String getHardwareInfo(); + void removeOutputPid(int pid); + android.hardware.tv.tuner.FrontendStatusReadiness[] getFrontendStatusReadiness(in android.hardware.tv.tuner.FrontendStatusType[] statusTypes); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFrontendCallback.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFrontendCallback.aidl new file mode 100644 index 0000000000..c22d280834 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/IFrontendCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface IFrontendCallback { + oneway void onEvent(in android.hardware.tv.tuner.FrontendEventType frontendEventType); + oneway void onScanMessage(in android.hardware.tv.tuner.FrontendScanMessageType type, in android.hardware.tv.tuner.FrontendScanMessage message); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ILnb.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ILnb.aidl new file mode 100644 index 0000000000..c3fdd87e62 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ILnb.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface ILnb { + void setCallback(in android.hardware.tv.tuner.ILnbCallback callback); + void setVoltage(in android.hardware.tv.tuner.LnbVoltage voltage); + void setTone(in android.hardware.tv.tuner.LnbTone tone); + void setSatellitePosition(in android.hardware.tv.tuner.LnbPosition position); + void sendDiseqcMessage(in byte[] diseqcMessage); + void close(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ILnbCallback.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ILnbCallback.aidl new file mode 100644 index 0000000000..42e84da4d1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ILnbCallback.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface ILnbCallback { + oneway void onDiseqcMessage(in byte[] diseqcMessage); + oneway void onEvent(in android.hardware.tv.tuner.LnbEventType lnbEventType); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ITimeFilter.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ITimeFilter.aidl new file mode 100644 index 0000000000..838eeba1d2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ITimeFilter.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +interface ITimeFilter { + void setTimeStamp(in long timeStamp); + void clearTimeStamp(); + long getTimeStamp(); + long getSourceTime(); + void close(); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ITuner.aidl new file mode 100644 index 0000000000..0ff2da9aa1 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ITuner.aidl @@ -0,0 +1,50 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@SuppressWarnings(value={"out-array"}) @VintfStability +interface ITuner { + int[] getFrontendIds(); + android.hardware.tv.tuner.IFrontend openFrontendById(in int frontendId); + android.hardware.tv.tuner.IDemux openDemux(out int[] demuxId); + android.hardware.tv.tuner.DemuxCapabilities getDemuxCaps(); + android.hardware.tv.tuner.IDescrambler openDescrambler(); + android.hardware.tv.tuner.FrontendInfo getFrontendInfo(in int frontendId); + int[] getLnbIds(); + android.hardware.tv.tuner.ILnb openLnbById(in int lnbId); + android.hardware.tv.tuner.ILnb openLnbByName(in String lnbName, out int[] lnbId); + void setLna(in boolean bEnable); + void setMaxNumberOfFrontends(in android.hardware.tv.tuner.FrontendType frontendType, in int maxNumber); + int getMaxNumberOfFrontends(in android.hardware.tv.tuner.FrontendType frontendType); +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbEventType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbEventType.aidl new file mode 100644 index 0000000000..e6e2b0548b --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbEventType.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum LnbEventType { + DISEQC_RX_OVERFLOW = 0, + DISEQC_RX_TIMEOUT = 1, + DISEQC_RX_PARITY_ERROR = 2, + LNB_OVERLOAD = 3, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbPosition.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbPosition.aidl new file mode 100644 index 0000000000..5fc4d152d2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbPosition.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum LnbPosition { + UNDEFINED = 0, + POSITION_A = 1, + POSITION_B = 2, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbTone.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbTone.aidl new file mode 100644 index 0000000000..3217de99ff --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbTone.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum LnbTone { + NONE = 0, + CONTINUOUS = 1, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbVoltage.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbVoltage.aidl new file mode 100644 index 0000000000..034c7e6a6e --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/LnbVoltage.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum LnbVoltage { + NONE = 0, + VOLTAGE_5V = 1, + VOLTAGE_11V = 2, + VOLTAGE_12V = 3, + VOLTAGE_13V = 4, + VOLTAGE_14V = 5, + VOLTAGE_15V = 6, + VOLTAGE_18V = 7, + VOLTAGE_19V = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/PlaybackSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/PlaybackSettings.aidl new file mode 100644 index 0000000000..e0dd5db071 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/PlaybackSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable PlaybackSettings { + int statusMask; + long lowThreshold; + long highThreshold; + android.hardware.tv.tuner.DataFormat dataFormat = android.hardware.tv.tuner.DataFormat.UNDEFINED; + long packetSize; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/PlaybackStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/PlaybackStatus.aidl new file mode 100644 index 0000000000..850b737559 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/PlaybackStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum PlaybackStatus { + SPACE_EMPTY = 1, + SPACE_ALMOST_EMPTY = 2, + SPACE_ALMOST_FULL = 4, + SPACE_FULL = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/RecordSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/RecordSettings.aidl new file mode 100644 index 0000000000..de693cd2d2 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/RecordSettings.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@VintfStability +parcelable RecordSettings { + int statusMask; + long lowThreshold; + long highThreshold; + android.hardware.tv.tuner.DataFormat dataFormat = android.hardware.tv.tuner.DataFormat.UNDEFINED; + long packetSize; +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/RecordStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/RecordStatus.aidl new file mode 100644 index 0000000000..48bf9ecacf --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/RecordStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="byte") @VintfStability +enum RecordStatus { + DATA_READY = 1, + LOW_WATER = 2, + HIGH_WATER = 4, + OVERFLOW = 8, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/Result.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/Result.aidl new file mode 100644 index 0000000000..4e22f678c8 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/Result.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum Result { + SUCCESS = 0, + UNAVAILABLE = 1, + NOT_INITIALIZED = 2, + INVALID_STATE = 3, + INVALID_ARGUMENT = 4, + OUT_OF_MEMORY = 5, + UNKNOWN_ERROR = 6, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ScramblingStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ScramblingStatus.aidl new file mode 100644 index 0000000000..656fe20f21 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/ScramblingStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum ScramblingStatus { + UNKNOWN = 1, + NOT_SCRAMBLED = 2, + SCRAMBLED = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/VideoStreamType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/VideoStreamType.aidl new file mode 100644 index 0000000000..9dfd686a69 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/1/android/hardware/tv/tuner/VideoStreamType.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum VideoStreamType { + UNDEFINED = 0, + RESERVED = 1, + MPEG1 = 2, + MPEG2 = 3, + MPEG4P2 = 4, + AVC = 5, + HEVC = 6, + VC1 = 7, + VP8 = 8, + VP9 = 9, + AV1 = 10, + AVS = 11, + AVS2 = 12, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/.hash b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/.hash new file mode 100644 index 0000000000..41cace4af1 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/.hash @@ -0,0 +1 @@ +5b8bcab6b43177dffdec5873e84205b04757cc9d diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AnqpData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AnqpData.aidl new file mode 100644 index 0000000000..d8e49d70f3 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AnqpData.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 -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 AnqpData { + byte[] venueName; + byte[] roamingConsortium; + byte[] ipAddrTypeAvailability; + byte[] naiRealm; + byte[] anqp3gppCellularNetwork; + byte[] domainName; + byte[] venueUrl; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AnqpInfoId.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AnqpInfoId.aidl new file mode 100644 index 0000000000..cc323608f9 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AnqpInfoId.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 -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 AnqpInfoId { + VENUE_NAME = 258, + ROAMING_CONSORTIUM = 261, + IP_ADDR_TYPE_AVAILABILITY = 262, + NAI_REALM = 263, + ANQP_3GPP_CELLULAR_NETWORK = 264, + DOMAIN_NAME = 268, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AssociationRejectionData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AssociationRejectionData.aidl new file mode 100644 index 0000000000..f6830dc8be --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AssociationRejectionData.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 -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 AssociationRejectionData { + byte[] ssid; + byte[] bssid; + android.hardware.wifi.supplicant.StaIfaceStatusCode statusCode; + boolean timedOut; + boolean isMboAssocDisallowedReasonCodePresent; + android.hardware.wifi.supplicant.MboAssocDisallowedReasonCode mboAssocDisallowedReason; + boolean isOceRssiBasedAssocRejectAttrPresent; + android.hardware.wifi.supplicant.OceRssiBasedAssocRejectAttr oceRssiBasedAssocRejectData; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AuthAlgMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AuthAlgMask.aidl new file mode 100644 index 0000000000..9cd178d7ba --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AuthAlgMask.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 -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 AuthAlgMask { + OPEN = 1, + SHARED = 2, + LEAP = 4, + SAE = 16, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl new file mode 100644 index 0000000000..471cfff906 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.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 -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 AuxiliarySupplicantEventCode { + EAP_METHOD_SELECTED = 0, + SSID_TEMP_DISABLED = 1, + OPEN_SSL_FAILURE = 2, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssTmData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssTmData.aidl new file mode 100644 index 0000000000..34d894d6fa --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssTmData.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 -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 BssTmData { + android.hardware.wifi.supplicant.BssTmStatusCode status; + android.hardware.wifi.supplicant.BssTmDataFlagsMask flags; + int assocRetryDelayMs; + android.hardware.wifi.supplicant.MboTransitionReasonCode mboTransitionReason; + android.hardware.wifi.supplicant.MboCellularDataConnectionPrefValue mboCellPreference; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl new file mode 100644 index 0000000000..f215f0557f --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssTmDataFlagsMask.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 -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 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, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssTmStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssTmStatusCode.aidl new file mode 100644 index 0000000000..c95825fe3c --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssTmStatusCode.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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="byte") @VintfStability +enum BssTmStatusCode { + ACCEPT = 0, + REJECT_UNSPECIFIED = 1, + REJECT_INSUFFICIENT_BEACON = 2, + REJECT_INSUFFICIENT_CAPABITY = 3, + REJECT_BSS_TERMINATION_UNDESIRED = 4, + REJECT_BSS_TERMINATION_DELAY_REQUEST = 5, + REJECT_STA_CANDIDATE_LIST_PROVIDED = 6, + REJECT_NO_SUITABLE_CANDIDATES = 7, + REJECT_LEAVING_ESS = 8, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssidChangeReason.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssidChangeReason.aidl new file mode 100644 index 0000000000..1d24579201 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BssidChangeReason.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 -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="byte") @VintfStability +enum BssidChangeReason { + ASSOC_START = 0, + ASSOC_COMPLETE = 1, + DISASSOC = 2, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BtCoexistenceMode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BtCoexistenceMode.aidl new file mode 100644 index 0000000000..bdc1b4a991 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/BtCoexistenceMode.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 -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="byte") @VintfStability +enum BtCoexistenceMode { + ENABLED = 0, + DISABLED = 1, + SENSE = 2, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl new file mode 100644 index 0000000000..433b3d8018 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ConnectionCapabilities.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 -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 ConnectionCapabilities { + android.hardware.wifi.supplicant.WifiTechnology technology; + int channelBandwidth; + int maxNumberTxSpatialStreams; + int maxNumberRxSpatialStreams; + android.hardware.wifi.supplicant.LegacyMode legacyMode; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DebugLevel.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DebugLevel.aidl new file mode 100644 index 0000000000..fbfb5b3468 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DebugLevel.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 -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 DebugLevel { + EXCESSIVE = 0, + MSGDUMP = 1, + DEBUG = 2, + INFO = 3, + WARNING = 4, + ERROR = 5, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppAkm.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppAkm.aidl new file mode 100644 index 0000000000..df2aef8c11 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppAkm.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 -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 DppAkm { + PSK = 0, + PSK_SAE = 1, + SAE = 2, + DPP = 3, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppConnectionKeys.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppConnectionKeys.aidl new file mode 100644 index 0000000000..559d1c94ce --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppConnectionKeys.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 -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 DppConnectionKeys { + byte[] connector; + byte[] cSign; + byte[] netAccessKey; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppCurve.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppCurve.aidl new file mode 100644 index 0000000000..e69da44399 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppCurve.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 -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 DppCurve { + PRIME256V1 = 0, + SECP384R1 = 1, + SECP521R1 = 2, + BRAINPOOLP256R1 = 3, + BRAINPOOLP384R1 = 4, + BRAINPOOLP512R1 = 5, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppEventType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppEventType.aidl new file mode 100644 index 0000000000..9e394fc5df --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppEventType.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 -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 DppEventType { + CONFIGURATION_SENT = 0, + CONFIGURATION_APPLIED = 1, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppFailureCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppFailureCode.aidl new file mode 100644 index 0000000000..7e7c806733 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppFailureCode.aidl @@ -0,0 +1,49 @@ +/* + * 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 -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 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, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppNetRole.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppNetRole.aidl new file mode 100644 index 0000000000..c6d3522675 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppNetRole.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 -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 DppNetRole { + STA = 0, + AP = 1, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppProgressCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppProgressCode.aidl new file mode 100644 index 0000000000..f0618a5a6d --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppProgressCode.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 -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 DppProgressCode { + AUTHENTICATION_SUCCESS = 0, + RESPONSE_PENDING = 1, + CONFIGURATION_SENT_WAITING_RESPONSE = 2, + CONFIGURATION_ACCEPTED = 3, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppResponderBootstrapInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppResponderBootstrapInfo.aidl new file mode 100644 index 0000000000..8b6492b4f3 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/DppResponderBootstrapInfo.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 -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 DppResponderBootstrapInfo { + int bootstrapId; + int listenChannel; + String uri; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/EapErrorCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/EapErrorCode.aidl new file mode 100644 index 0000000000..2cf81d9ca2 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/EapErrorCode.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 -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 EapErrorCode { + SIM_GENERAL_FAILURE_AFTER_AUTH = 0, + SIM_TEMPORARILY_DENIED = 1026, + SIM_NOT_SUBSCRIBED = 1031, + SIM_GENERAL_FAILURE_BEFORE_AUTH = 16384, + SIM_VENDOR_SPECIFIC_EXPIRED_CERT = 16385, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/EapMethod.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/EapMethod.aidl new file mode 100644 index 0000000000..4ab23afefd --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/EapMethod.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 -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 EapMethod { + PEAP = 0, + TLS = 1, + TTLS = 2, + PWD = 3, + SIM = 4, + AKA = 5, + AKA_PRIME = 6, + WFA_UNAUTH_TLS = 7, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/EapPhase2Method.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/EapPhase2Method.aidl new file mode 100644 index 0000000000..4bd93a08da --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/EapPhase2Method.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 -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 EapPhase2Method { + NONE = 0, + PAP = 1, + MSPAP = 2, + MSPAPV2 = 3, + GTC = 4, + SIM = 5, + AKA = 6, + AKA_PRIME = 7, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ExtRadioWorkDefaults.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ExtRadioWorkDefaults.aidl new file mode 100644 index 0000000000..cbf1a3ee37 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ExtRadioWorkDefaults.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 -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 ExtRadioWorkDefaults { + TIMEOUT_IN_SECS = 10, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/FreqRange.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/FreqRange.aidl new file mode 100644 index 0000000000..0971d517f6 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/FreqRange.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 -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 FreqRange { + int min; + int max; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/GroupCipherMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/GroupCipherMask.aidl new file mode 100644 index 0000000000..f2da92532a --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/GroupCipherMask.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 -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 GroupCipherMask { + WEP40 = 2, + WEP104 = 4, + TKIP = 8, + CCMP = 16, + GTK_NOT_USED = 16384, + GCMP_256 = 256, + SMS4 = 128, + GCMP_128 = 64, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl new file mode 100644 index 0000000000..c24d6cc744 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/GroupMgmtCipherMask.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 -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 GroupMgmtCipherMask { + BIP_GMAC_128 = 2048, + BIP_GMAC_256 = 4096, + BIP_CMAC_256 = 8192, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/GsmRand.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/GsmRand.aidl new file mode 100644 index 0000000000..599a68339a --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/GsmRand.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 -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 GsmRand { + byte[] data; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/Hs20AnqpData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/Hs20AnqpData.aidl new file mode 100644 index 0000000000..43b182a24a --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/Hs20AnqpData.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 -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 Hs20AnqpData { + byte[] operatorFriendlyName; + byte[] wanMetrics; + byte[] connectionCapability; + byte[] osuProvidersList; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/Hs20AnqpSubtypes.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/Hs20AnqpSubtypes.aidl new file mode 100644 index 0000000000..270d43b073 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/Hs20AnqpSubtypes.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 -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 Hs20AnqpSubtypes { + OPERATOR_FRIENDLY_NAME = 3, + WAN_METRICS = 4, + CONNECTION_CAPABILITY = 5, + OSU_PROVIDERS_LIST = 8, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicant.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicant.aidl new file mode 100644 index 0000000000..4b26ac3013 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicant.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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 +interface ISupplicant { + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantP2pIface addP2pInterface(in String ifName); + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantStaIface addStaInterface(in String ifName); + android.hardware.wifi.supplicant.DebugLevel getDebugLevel(); + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantP2pIface getP2pInterface(in String ifName); + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantStaIface getStaInterface(in String ifName); + boolean isDebugShowKeysEnabled(); + boolean isDebugShowTimestampEnabled(); + android.hardware.wifi.supplicant.IfaceInfo[] listInterfaces(); + void registerCallback(in android.hardware.wifi.supplicant.ISupplicantCallback callback); + void removeInterface(in android.hardware.wifi.supplicant.IfaceInfo ifaceInfo); + void setConcurrencyPriority(in android.hardware.wifi.supplicant.IfaceType type); + void setDebugParams(in android.hardware.wifi.supplicant.DebugLevel level, in boolean showTimestamp, in boolean showKeys); + oneway void terminate(); + const int EXT_RADIO_WORK_TIMEOUT_IN_SECS = 10; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantCallback.aidl new file mode 100644 index 0000000000..7281053cdb --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantCallback.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 -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 +interface ISupplicantCallback { + oneway void onInterfaceCreated(in String ifaceName); + oneway void onInterfaceRemoved(in String ifaceName); +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl new file mode 100644 index 0000000000..e204184a98 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl @@ -0,0 +1,99 @@ +/* + * 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 -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 +interface ISupplicantP2pIface { + void addBonjourService(in byte[] query, in byte[] response); + void addGroup(in boolean persistent, in int persistentNetworkId); + void addGroupWithConfig(in byte[] ssid, in String pskPassphrase, in boolean persistent, in int freq, in byte[] peerAddress, in boolean joinExistingGroup); + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantP2pNetwork addNetwork(); + void addUpnpService(in int version, in String serviceName); + void cancelConnect(); + void cancelServiceDiscovery(in long identifier); + void cancelWps(in String groupIfName); + void configureExtListen(in int periodInMillis, in int intervalInMillis); + 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); + void find(in int timeoutInSec); + void flush(); + void flushServices(); + byte[] getDeviceAddress(); + boolean getEdmg(); + android.hardware.wifi.supplicant.P2pGroupCapabilityMask getGroupCapability(in byte[] peerAddress); + String getName(); + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantP2pNetwork getNetwork(in int id); + byte[] getSsid(in byte[] peerAddress); + android.hardware.wifi.supplicant.IfaceType getType(); + void invite(in String groupIfName, in byte[] goDeviceAddress, in byte[] peerAddress); + int[] listNetworks(); + void provisionDiscovery(in byte[] peerAddress, in android.hardware.wifi.supplicant.WpsProvisionMethod provisionMethod); + void registerCallback(in android.hardware.wifi.supplicant.ISupplicantP2pIfaceCallback callback); + void reinvoke(in int persistentNetworkId, in byte[] peerAddress); + void reject(in byte[] peerAddress); + void removeBonjourService(in byte[] query); + void removeGroup(in String groupIfName); + void removeNetwork(in int id); + void removeUpnpService(in int version, in String serviceName); + void reportNfcHandoverInitiation(in byte[] select); + void reportNfcHandoverResponse(in byte[] request); + long requestServiceDiscovery(in byte[] peerAddress, in byte[] query); + void saveConfig(); + void setDisallowedFrequencies(in android.hardware.wifi.supplicant.FreqRange[] ranges); + void setEdmg(in boolean enable); + void setGroupIdle(in String groupIfName, in int timeoutInSec); + void setListenChannel(in int channel, in int operatingClass); + void setMacRandomization(in boolean enable); + void setMiracastMode(in android.hardware.wifi.supplicant.MiracastMode mode); + void setPowerSave(in String groupIfName, in boolean enable); + void setSsidPostfix(in byte[] postfix); + void setWfdDeviceInfo(in byte[] info); + void setWfdR2DeviceInfo(in byte[] info); + void removeClient(in byte[] peerAddress, in boolean isLegacyClient); + void setWpsConfigMethods(in android.hardware.wifi.supplicant.WpsConfigMethods configMethods); + void setWpsDeviceName(in String name); + void setWpsDeviceType(in byte[] type); + void setWpsManufacturer(in String manufacturer); + void setWpsModelName(in String modelName); + void setWpsModelNumber(in String modelNumber); + void setWpsSerialNumber(in String serialNumber); + void startWpsPbc(in String groupIfName, in byte[] bssid); + String startWpsPinDisplay(in String groupIfName, in byte[] bssid); + void startWpsPinKeypad(in String groupIfName, in String pin); + void stopFind(); + void findOnSocialChannels(in int timeoutInSec); + void findOnSpecificFrequency(in int freqInHz, in int timeoutInSec); + void setVendorElements(in android.hardware.wifi.supplicant.P2pFrameTypeMask frameTypeMask, in byte[] vendorElemBytes); +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl new file mode 100644 index 0000000000..8d9f498abb --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl @@ -0,0 +1,55 @@ +/* + * 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 -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 +interface ISupplicantP2pIfaceCallback { + 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(); + oneway void onGoNegotiationCompleted(in android.hardware.wifi.supplicant.P2pStatusCode status); + oneway void onGoNegotiationRequest(in byte[] srcAddress, in android.hardware.wifi.supplicant.WpsDevPasswordId passwordId); + oneway void onGroupFormationFailure(in String failureReason); + oneway void onGroupFormationSuccess(); + oneway void onGroupRemoved(in String groupIfname, in boolean isGroupOwner); + 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); + 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); + oneway void onStaAuthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress); + oneway void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress); + oneway void onGroupFrequencyChanged(in String groupIfname, in int frequency); + 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); +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantP2pNetwork.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantP2pNetwork.aidl new file mode 100644 index 0000000000..ef72724642 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantP2pNetwork.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 -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 +interface ISupplicantP2pNetwork { + byte[] getBssid(); + android.hardware.wifi.supplicant.MacAddress[] getClientList(); + int getId(); + String getInterfaceName(); + byte[] getSsid(); + android.hardware.wifi.supplicant.IfaceType getType(); + boolean isCurrent(); + boolean isGroupOwner(); + boolean isPersistent(); + void setClientList(in android.hardware.wifi.supplicant.MacAddress[] clients); +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl new file mode 100644 index 0000000000..53d5770e7f --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl @@ -0,0 +1,98 @@ +/* + * 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 -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 +interface ISupplicantStaIface { + int addDppPeerUri(in String uri); + int addExtRadioWork(in String name, in int freqInMhz, in int timeoutInSec); + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantStaNetwork addNetwork(); + void addRxFilter(in android.hardware.wifi.supplicant.RxFilterType type); + void cancelWps(); + void disconnect(); + void enableAutoReconnect(in boolean enable); + void filsHlpAddRequest(in byte[] dst_mac, in byte[] pkt); + void filsHlpFlushRequest(); + android.hardware.wifi.supplicant.DppResponderBootstrapInfo generateDppBootstrapInfoForResponder(in byte[] macAddress, in String deviceInfo, in android.hardware.wifi.supplicant.DppCurve curve); + void generateSelfDppConfiguration(in String ssid, in byte[] privEcKey); + android.hardware.wifi.supplicant.ConnectionCapabilities getConnectionCapabilities(); + android.hardware.wifi.supplicant.MloLinksInfo getConnectionMloLinksInfo(); + android.hardware.wifi.supplicant.KeyMgmtMask getKeyMgmtCapabilities(); + byte[] getMacAddress(); + String getName(); + @PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantStaNetwork getNetwork(in int id); + 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); + void initiateHs20IconQuery(in byte[] macAddress, in String fileName); + void initiateTdlsDiscover(in byte[] macAddress); + void initiateTdlsSetup(in byte[] macAddress); + void initiateTdlsTeardown(in byte[] macAddress); + void initiateVenueUrlAnqpQuery(in byte[] macAddress); + int[] listNetworks(); + void reassociate(); + void reconnect(); + void registerCallback(in android.hardware.wifi.supplicant.ISupplicantStaIfaceCallback callback); + void setQosPolicyFeatureEnabled(in boolean enable); + void sendQosPolicyResponse(in int qosPolicyRequestId, in boolean morePolicies, in android.hardware.wifi.supplicant.QosPolicyStatus[] qosPolicyStatusList); + void removeAllQosPolicies(); + void removeDppUri(in int id); + void removeExtRadioWork(in int id); + void removeNetwork(in int id); + void removeRxFilter(in android.hardware.wifi.supplicant.RxFilterType type); + void setBtCoexistenceMode(in android.hardware.wifi.supplicant.BtCoexistenceMode mode); + void setBtCoexistenceScanModeEnabled(in boolean enable); + void setCountryCode(in byte[] code); + void setExternalSim(in boolean useExternalSim); + void setMboCellularDataStatus(in boolean available); + void setPowerSave(in boolean enable); + void setSuspendModeEnabled(in boolean enable); + void setWpsConfigMethods(in android.hardware.wifi.supplicant.WpsConfigMethods configMethods); + void setWpsDeviceName(in String name); + void setWpsDeviceType(in byte[] type); + void setWpsManufacturer(in String manufacturer); + void setWpsModelName(in String modelName); + void setWpsModelNumber(in String modelNumber); + void setWpsSerialNumber(in String serialNumber); + byte[] startDppConfiguratorInitiator(in int peerBootstrapId, in int ownBootstrapId, in String ssid, in String password, in String psk, in android.hardware.wifi.supplicant.DppNetRole netRole, in android.hardware.wifi.supplicant.DppAkm securityAkm, in byte[] privEcKey); + void startDppEnrolleeInitiator(in int peerBootstrapId, in int ownBootstrapId); + void startDppEnrolleeResponder(in int listenChannel); + void startRxFilter(); + void startWpsPbc(in byte[] bssid); + String startWpsPinDisplay(in byte[] bssid); + void startWpsPinKeypad(in String pin); + void startWpsRegistrar(in byte[] bssid, in String pin); + void stopDppInitiator(); + void stopDppResponder(in int ownBootstrapId); + void stopRxFilter(); +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl new file mode 100644 index 0000000000..25a09b435e --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -0,0 +1,66 @@ +/* + * 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 -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 +interface ISupplicantStaIfaceCallback { + oneway void onAnqpQueryDone(in byte[] bssid, in android.hardware.wifi.supplicant.AnqpData data, in android.hardware.wifi.supplicant.Hs20AnqpData hs20Data); + oneway void onAssociationRejected(in android.hardware.wifi.supplicant.AssociationRejectionData assocRejectData); + oneway void onAuthenticationTimeout(in byte[] bssid); + oneway void onAuxiliarySupplicantEvent(in android.hardware.wifi.supplicant.AuxiliarySupplicantEventCode eventCode, in byte[] bssid, in String reasonString); + oneway void onBssTmHandlingDone(in android.hardware.wifi.supplicant.BssTmData tmData); + oneway void onBssidChanged(in android.hardware.wifi.supplicant.BssidChangeReason reason, in byte[] bssid); + oneway void onDisconnected(in byte[] bssid, in boolean locallyGenerated, in android.hardware.wifi.supplicant.StaIfaceReasonCode reasonCode); + oneway void onDppFailure(in android.hardware.wifi.supplicant.DppFailureCode code, in String ssid, in String channelList, in char[] bandList); + oneway void onDppProgress(in android.hardware.wifi.supplicant.DppProgressCode code); + oneway void onDppSuccess(in android.hardware.wifi.supplicant.DppEventType event); + oneway void onDppSuccessConfigReceived(in byte[] ssid, in String password, in byte[] psk, in android.hardware.wifi.supplicant.DppAkm securityAkm, in android.hardware.wifi.supplicant.DppConnectionKeys dppConnectionKeys); + oneway void onDppSuccessConfigSent(); + oneway void onEapFailure(in byte[] bssid, in int errorCode); + 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); + 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); + oneway void onNetworkAdded(in int id); + oneway void onNetworkNotFound(in byte[] ssid); + oneway void onNetworkRemoved(in int id); + oneway void onPmkCacheAdded(in long expirationTimeInSec, in byte[] serializedEntry); + oneway void onStateChanged(in android.hardware.wifi.supplicant.StaIfaceCallbackState newState, in byte[] bssid, in int id, in byte[] ssid, in boolean filsHlpSent); + oneway void onWpsEventFail(in byte[] bssid, in android.hardware.wifi.supplicant.WpsConfigError configError, in android.hardware.wifi.supplicant.WpsErrorIndication errorInd); + oneway void onWpsEventPbcOverlap(); + oneway void onWpsEventSuccess(); + oneway void onQosPolicyReset(); + oneway void onQosPolicyRequest(in int qosPolicyRequestId, in android.hardware.wifi.supplicant.QosPolicyData[] qosPolicyData); +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl new file mode 100644 index 0000000000..0b3cb8156e --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl @@ -0,0 +1,136 @@ +/* + * 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 -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 +interface ISupplicantStaNetwork { + void disable(); + void enable(in boolean noConnect); + void enableSaePkOnlyMode(in boolean enable); + void enableSuiteBEapOpenSslCiphers(); + void enableTlsSuiteBEapPhase1Param(in boolean enable); + android.hardware.wifi.supplicant.AuthAlgMask getAuthAlg(); + byte[] getBssid(); + String getEapAltSubjectMatch(); + byte[] getEapAnonymousIdentity(); + String getEapCACert(); + String getEapCAPath(); + String getEapClientCert(); + String getEapDomainSuffixMatch(); + boolean getEapEngine(); + String getEapEngineId(); + byte[] getEapIdentity(); + android.hardware.wifi.supplicant.EapMethod getEapMethod(); + byte[] getEapPassword(); + android.hardware.wifi.supplicant.EapPhase2Method getEapPhase2Method(); + String getEapPrivateKeyId(); + String getEapSubjectMatch(); + boolean getEdmg(); + android.hardware.wifi.supplicant.GroupCipherMask getGroupCipher(); + android.hardware.wifi.supplicant.GroupMgmtCipherMask getGroupMgmtCipher(); + int getId(); + String getIdStr(); + String getInterfaceName(); + android.hardware.wifi.supplicant.KeyMgmtMask getKeyMgmt(); + android.hardware.wifi.supplicant.OcspType getOcsp(); + android.hardware.wifi.supplicant.PairwiseCipherMask getPairwiseCipher(); + android.hardware.wifi.supplicant.ProtoMask getProto(); + byte[] getPsk(); + String getPskPassphrase(); + boolean getRequirePmf(); + String getSaePassword(); + String getSaePasswordId(); + boolean getScanSsid(); + byte[] getSsid(); + android.hardware.wifi.supplicant.IfaceType getType(); + String getWapiCertSuite(); + byte[] getWepKey(in int keyIdx); + int getWepTxKeyIdx(); + byte[] getWpsNfcConfigurationToken(); + void registerCallback(in android.hardware.wifi.supplicant.ISupplicantStaNetworkCallback callback); + void select(); + void sendNetworkEapIdentityResponse(in byte[] identity, in byte[] encryptedIdentity); + void sendNetworkEapSimGsmAuthFailure(); + void sendNetworkEapSimGsmAuthResponse(in android.hardware.wifi.supplicant.NetworkResponseEapSimGsmAuthParams[] params); + void sendNetworkEapSimUmtsAuthFailure(); + void sendNetworkEapSimUmtsAuthResponse(in android.hardware.wifi.supplicant.NetworkResponseEapSimUmtsAuthParams params); + void sendNetworkEapSimUmtsAutsResponse(in byte[] auts); + void setAuthAlg(in android.hardware.wifi.supplicant.AuthAlgMask authAlgMask); + void setBssid(in byte[] bssid); + void setDppKeys(in android.hardware.wifi.supplicant.DppConnectionKeys keys); + void setEapAltSubjectMatch(in String match); + void setEapAnonymousIdentity(in byte[] identity); + void setEapCACert(in String path); + void setEapCAPath(in String path); + void setEapClientCert(in String path); + void setEapDomainSuffixMatch(in String match); + void setEapEncryptedImsiIdentity(in byte[] identity); + void setEapEngine(in boolean enable); + void setEapEngineID(in String id); + void setEapErp(in boolean enable); + void setEapIdentity(in byte[] identity); + void setEapMethod(in android.hardware.wifi.supplicant.EapMethod method); + void setEapPassword(in byte[] password); + void setEapPhase2Method(in android.hardware.wifi.supplicant.EapPhase2Method method); + void setEapPrivateKeyId(in String id); + void setEapSubjectMatch(in String match); + void setEdmg(in boolean enable); + void setGroupCipher(in android.hardware.wifi.supplicant.GroupCipherMask groupCipherMask); + void setGroupMgmtCipher(in android.hardware.wifi.supplicant.GroupMgmtCipherMask groupMgmtCipherMask); + void setIdStr(in String idStr); + void setKeyMgmt(in android.hardware.wifi.supplicant.KeyMgmtMask keyMgmtMask); + void setOcsp(in android.hardware.wifi.supplicant.OcspType ocspType); + void setPairwiseCipher(in android.hardware.wifi.supplicant.PairwiseCipherMask pairwiseCipherMask); + void setPmkCache(in byte[] serializedEntry); + void setProactiveKeyCaching(in boolean enable); + void setProto(in android.hardware.wifi.supplicant.ProtoMask protoMask); + void setPsk(in byte[] psk); + void setPskPassphrase(in String psk); + void setRequirePmf(in boolean enable); + void setSaeH2eMode(in android.hardware.wifi.supplicant.SaeH2eMode mode); + void setSaePassword(in String saePassword); + void setSaePasswordId(in String saePasswordId); + void setScanSsid(in boolean enable); + void setSsid(in byte[] ssid); + void setUpdateIdentifier(in int id); + void setWapiCertSuite(in String suite); + void setWepKey(in int keyIdx, in byte[] wepKey); + void setWepTxKeyIdx(in int keyIdx); + void setRoamingConsortiumSelection(in byte[] selectedRcoi); + 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; + const int WEP_KEYS_MAX_NUM = 4; + const int WEP40_KEY_LEN_IN_BYTES = 5; + const int WEP104_KEY_LEN_IN_BYTES = 13; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl new file mode 100644 index 0000000000..6276a3521b --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.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 -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 +interface ISupplicantStaNetworkCallback { + oneway void onNetworkEapIdentityRequest(); + oneway void onNetworkEapSimGsmAuthRequest(in android.hardware.wifi.supplicant.NetworkRequestEapSimGsmAuthParams params); + oneway void onNetworkEapSimUmtsAuthRequest(in android.hardware.wifi.supplicant.NetworkRequestEapSimUmtsAuthParams params); + oneway void onTransitionDisable(in android.hardware.wifi.supplicant.TransitionDisableIndication ind); + oneway void onServerCertificateAvailable(in int depth, in byte[] subject, in byte[] certHash, in byte[] certBlob); +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/IfaceInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/IfaceInfo.aidl new file mode 100644 index 0000000000..6706c8c6ef --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/IfaceInfo.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 -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 IfaceInfo { + android.hardware.wifi.supplicant.IfaceType type; + String name; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/IfaceType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/IfaceType.aidl new file mode 100644 index 0000000000..557dbd7656 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/IfaceType.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 -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 IfaceType { + STA = 0, + P2P = 1, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/IpVersion.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/IpVersion.aidl new file mode 100644 index 0000000000..f571b44eb2 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/IpVersion.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 -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="byte") @VintfStability +enum IpVersion { + VERSION_4 = 0, + VERSION_6 = 1, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/KeyMgmtMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/KeyMgmtMask.aidl new file mode 100644 index 0000000000..7228480f56 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/KeyMgmtMask.aidl @@ -0,0 +1,54 @@ +/* + * 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 -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 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, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/LegacyMode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/LegacyMode.aidl new file mode 100644 index 0000000000..6896d75f7f --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/LegacyMode.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 -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 LegacyMode { + UNKNOWN = 0, + A_MODE = 1, + B_MODE = 2, + G_MODE = 3, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MacAddress.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MacAddress.aidl new file mode 100644 index 0000000000..d17930a649 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MacAddress.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 -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 MacAddress { + byte[] data; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MboAssocDisallowedReasonCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MboAssocDisallowedReasonCode.aidl new file mode 100644 index 0000000000..661165d062 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MboAssocDisallowedReasonCode.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 -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="byte") @VintfStability +enum MboAssocDisallowedReasonCode { + RESERVED = 0, + UNSPECIFIED = 1, + MAX_NUM_STA_ASSOCIATED = 2, + AIR_INTERFACE_OVERLOADED = 3, + AUTH_SERVER_OVERLOADED = 4, + INSUFFICIENT_RSSI = 5, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MboCellularDataConnectionPrefValue.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MboCellularDataConnectionPrefValue.aidl new file mode 100644 index 0000000000..c4024d097b --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MboCellularDataConnectionPrefValue.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 -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 MboCellularDataConnectionPrefValue { + EXCLUDED = 0, + NOT_PREFERRED = 1, + PREFERRED = 255, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MboTransitionReasonCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MboTransitionReasonCode.aidl new file mode 100644 index 0000000000..caed0950ee --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MboTransitionReasonCode.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 -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="byte") @VintfStability +enum MboTransitionReasonCode { + UNSPECIFIED = 0, + EXCESSIVE_FRAME_LOSS = 1, + EXCESSIVE_TRAFFIC_DELAY = 2, + INSUFFICIENT_BANDWIDTH = 3, + LOAD_BALANCING = 4, + LOW_RSSI = 5, + RX_EXCESSIVE_RETRIES = 6, + HIGH_INTERFERENCE = 7, + GRAY_ZONE = 8, + TRANSITION_TO_PREMIUM_AP = 9, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MiracastMode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MiracastMode.aidl new file mode 100644 index 0000000000..6bc9e4d629 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MiracastMode.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 -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="byte") @VintfStability +enum MiracastMode { + DISABLED = 0, + SOURCE = 1, + SINK = 2, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MloLink.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MloLink.aidl new file mode 100644 index 0000000000..5e2c47bdb5 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MloLink.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 -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 MloLink { + byte linkId; + byte[] staLinkMacAddress; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MloLinksInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MloLinksInfo.aidl new file mode 100644 index 0000000000..14fcb9178d --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/MloLinksInfo.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 -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 MloLinksInfo { + android.hardware.wifi.supplicant.MloLink[] links; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkRequestEapSimGsmAuthParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkRequestEapSimGsmAuthParams.aidl new file mode 100644 index 0000000000..1f03bb84c7 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkRequestEapSimGsmAuthParams.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 -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 NetworkRequestEapSimGsmAuthParams { + android.hardware.wifi.supplicant.GsmRand[] rands; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkRequestEapSimUmtsAuthParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkRequestEapSimUmtsAuthParams.aidl new file mode 100644 index 0000000000..956a799b7d --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkRequestEapSimUmtsAuthParams.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 -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 NetworkRequestEapSimUmtsAuthParams { + byte[] rand; + byte[] autn; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkResponseEapSimGsmAuthParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkResponseEapSimGsmAuthParams.aidl new file mode 100644 index 0000000000..29415b739d --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkResponseEapSimGsmAuthParams.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 -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 NetworkResponseEapSimGsmAuthParams { + byte[] kc; + byte[] sres; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkResponseEapSimUmtsAuthParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkResponseEapSimUmtsAuthParams.aidl new file mode 100644 index 0000000000..4e58dd8261 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/NetworkResponseEapSimUmtsAuthParams.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 -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 NetworkResponseEapSimUmtsAuthParams { + byte[] res; + byte[] ik; + byte[] ck; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/OceRssiBasedAssocRejectAttr.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/OceRssiBasedAssocRejectAttr.aidl new file mode 100644 index 0000000000..95a95bc543 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/OceRssiBasedAssocRejectAttr.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 -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 OceRssiBasedAssocRejectAttr { + int deltaRssi; + int retryDelayS; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/OcspType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/OcspType.aidl new file mode 100644 index 0000000000..89de811b04 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/OcspType.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 -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 OcspType { + NONE = 0, + REQUEST_CERT_STATUS = 1, + REQUIRE_CERT_STATUS = 2, + REQUIRE_ALL_CERTS_STATUS = 3, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/OsuMethod.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/OsuMethod.aidl new file mode 100644 index 0000000000..1b99e2f157 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/OsuMethod.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 -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="byte") @VintfStability +enum OsuMethod { + OMA_DM = 0, + SOAP_XML_SPP = 1, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl new file mode 100644 index 0000000000..6e1b957941 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pFrameTypeMask.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 -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 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, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl new file mode 100644 index 0000000000..ffee12c1bc --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.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 -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 P2pGroupCapabilityMask { + GROUP_OWNER = 1, + PERSISTENT_GROUP = 2, + GROUP_LIMIT = 4, + INTRA_BSS_DIST = 8, + CROSS_CONN = 16, + PERSISTENT_RECONN = 32, + GROUP_FORMATION = 64, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pProvDiscStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pProvDiscStatusCode.aidl new file mode 100644 index 0000000000..c8e53b93c1 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pProvDiscStatusCode.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 -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="byte") @VintfStability +enum P2pProvDiscStatusCode { + SUCCESS = 0, + TIMEOUT = 1, + REJECTED = 2, + TIMEOUT_JOIN = 3, + INFO_UNAVAILABLE = 4, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pStatusCode.aidl new file mode 100644 index 0000000000..c7ad3832c7 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/P2pStatusCode.aidl @@ -0,0 +1,50 @@ +/* + * 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 -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 P2pStatusCode { + SUCCESS = 0, + FAIL_INFO_CURRENTLY_UNAVAILABLE = 1, + FAIL_INCOMPATIBLE_PARAMS = 2, + FAIL_LIMIT_REACHED = 3, + FAIL_INVALID_PARAMS = 4, + FAIL_UNABLE_TO_ACCOMMODATE = 5, + FAIL_PREV_PROTOCOL_ERROR = 6, + FAIL_NO_COMMON_CHANNELS = 7, + FAIL_UNKNOWN_GROUP = 8, + FAIL_BOTH_GO_INTENT_15 = 9, + FAIL_INCOMPATIBLE_PROV_METHOD = 10, + FAIL_REJECTED_BY_USER = 11, + SUCCESS_DEFERRED = 12, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl new file mode 100644 index 0000000000..d9b00e1261 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/PairwiseCipherMask.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 -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 PairwiseCipherMask { + NONE = 1, + TKIP = 8, + CCMP = 16, + GCMP_128 = 64, + SMS4 = 128, + GCMP_256 = 256, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/PortRange.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/PortRange.aidl new file mode 100644 index 0000000000..b2004f242b --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/PortRange.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 -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 PortRange { + int startPort; + int endPort; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ProtoMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ProtoMask.aidl new file mode 100644 index 0000000000..de9242835e --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ProtoMask.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 -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 ProtoMask { + WPA = 1, + RSN = 2, + WAPI = 4, + OSEN = 8, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ProtocolNextHeader.aidl new file mode 100644 index 0000000000..8fb91d0511 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/ProtocolNextHeader.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 -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="byte") @VintfStability +enum ProtocolNextHeader { + TCP = 6, + UDP = 17, + ESP = 50, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl new file mode 100644 index 0000000000..8bf5fd836d --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 QosPolicyClassifierParams { + android.hardware.wifi.supplicant.IpVersion ipVersion; + android.hardware.wifi.supplicant.QosPolicyClassifierParamsMask classifierParamMask; + byte[] srcIp; + byte[] dstIp; + int srcPort; + android.hardware.wifi.supplicant.PortRange dstPortRange; + android.hardware.wifi.supplicant.ProtocolNextHeader protocolNextHdr; + byte[] flowLabelIpv6; + String domainName; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl new file mode 100644 index 0000000000..280ddbe3b2 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.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 -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 QosPolicyClassifierParamsMask { + SRC_IP = 1, + DST_IP = 2, + SRC_PORT = 4, + DST_PORT_RANGE = 8, + PROTOCOL_NEXT_HEADER = 16, + FLOW_LABEL = 32, + DOMAIN_NAME = 64, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyData.aidl new file mode 100644 index 0000000000..1719565a81 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyData.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 -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 QosPolicyData { + byte policyId; + android.hardware.wifi.supplicant.QosPolicyRequestType requestType; + byte dscp; + android.hardware.wifi.supplicant.QosPolicyClassifierParams classifierParams; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl new file mode 100644 index 0000000000..4c1e4fad5b --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyRequestType.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 -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="byte") @VintfStability +enum QosPolicyRequestType { + QOS_POLICY_ADD = 0, + QOS_POLICY_REMOVE = 1, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyStatus.aidl new file mode 100644 index 0000000000..61278c5fe5 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyStatus.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 -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 QosPolicyStatus { + byte policyId; + android.hardware.wifi.supplicant.QosPolicyStatusCode status; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl new file mode 100644 index 0000000000..4d40edcc17 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/QosPolicyStatusCode.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 -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="byte") @VintfStability +enum QosPolicyStatusCode { + QOS_POLICY_SUCCESS = 0, + QOS_POLICY_REQUEST_DECLINED = 1, + QOS_POLICY_CLASSIFIER_NOT_SUPPORTED = 2, + QOS_POLICY_INSUFFICIENT_RESOURCES = 3, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/RxFilterType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/RxFilterType.aidl new file mode 100644 index 0000000000..63f5bf2c45 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/RxFilterType.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 -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="byte") @VintfStability +enum RxFilterType { + V4_MULTICAST = 0, + V6_MULTICAST = 1, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/SaeH2eMode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/SaeH2eMode.aidl new file mode 100644 index 0000000000..978c3375f7 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/SaeH2eMode.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 -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="byte") @VintfStability +enum SaeH2eMode { + DISABLED = 0, + H2E_OPTIONAL = 1, + H2E_MANDATORY = 2, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/StaIfaceCallbackState.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/StaIfaceCallbackState.aidl new file mode 100644 index 0000000000..d78cfa2f28 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/StaIfaceCallbackState.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 -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 StaIfaceCallbackState { + DISCONNECTED = 0, + IFACE_DISABLED = 1, + INACTIVE = 2, + SCANNING = 3, + AUTHENTICATING = 4, + ASSOCIATING = 5, + ASSOCIATED = 6, + FOURWAY_HANDSHAKE = 7, + GROUP_HANDSHAKE = 8, + COMPLETED = 9, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/StaIfaceReasonCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/StaIfaceReasonCode.aidl new file mode 100644 index 0000000000..f26e7c5393 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/StaIfaceReasonCode.aidl @@ -0,0 +1,98 @@ +/* + * 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 -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 StaIfaceReasonCode { + UNSPECIFIED = 1, + PREV_AUTH_NOT_VALID = 2, + DEAUTH_LEAVING = 3, + DISASSOC_DUE_TO_INACTIVITY = 4, + DISASSOC_AP_BUSY = 5, + CLASS2_FRAME_FROM_NONAUTH_STA = 6, + CLASS3_FRAME_FROM_NONASSOC_STA = 7, + DISASSOC_STA_HAS_LEFT = 8, + STA_REQ_ASSOC_WITHOUT_AUTH = 9, + PWR_CAPABILITY_NOT_VALID = 10, + SUPPORTED_CHANNEL_NOT_VALID = 11, + BSS_TRANSITION_DISASSOC = 12, + INVALID_IE = 13, + MICHAEL_MIC_FAILURE = 14, + FOURWAY_HANDSHAKE_TIMEOUT = 15, + GROUP_KEY_UPDATE_TIMEOUT = 16, + IE_IN_4WAY_DIFFERS = 17, + GROUP_CIPHER_NOT_VALID = 18, + PAIRWISE_CIPHER_NOT_VALID = 19, + AKMP_NOT_VALID = 20, + UNSUPPORTED_RSN_IE_VERSION = 21, + INVALID_RSN_IE_CAPAB = 22, + IEEE_802_1X_AUTH_FAILED = 23, + CIPHER_SUITE_REJECTED = 24, + TDLS_TEARDOWN_UNREACHABLE = 25, + TDLS_TEARDOWN_UNSPECIFIED = 26, + SSP_REQUESTED_DISASSOC = 27, + NO_SSP_ROAMING_AGREEMENT = 28, + BAD_CIPHER_OR_AKM = 29, + NOT_AUTHORIZED_THIS_LOCATION = 30, + SERVICE_CHANGE_PRECLUDES_TS = 31, + UNSPECIFIED_QOS_REASON = 32, + NOT_ENOUGH_BANDWIDTH = 33, + DISASSOC_LOW_ACK = 34, + EXCEEDED_TXOP = 35, + STA_LEAVING = 36, + END_TS_BA_DLS = 37, + UNKNOWN_TS_BA = 38, + TIMEOUT = 39, + PEERKEY_MISMATCH = 45, + AUTHORIZED_ACCESS_LIMIT_REACHED = 46, + EXTERNAL_SERVICE_REQUIREMENTS = 47, + INVALID_FT_ACTION_FRAME_COUNT = 48, + INVALID_PMKID = 49, + INVALID_MDE = 50, + INVALID_FTE = 51, + MESH_PEERING_CANCELLED = 52, + MESH_MAX_PEERS = 53, + MESH_CONFIG_POLICY_VIOLATION = 54, + MESH_CLOSE_RCVD = 55, + MESH_MAX_RETRIES = 56, + MESH_CONFIRM_TIMEOUT = 57, + MESH_INVALID_GTK = 58, + MESH_INCONSISTENT_PARAMS = 59, + MESH_INVALID_SECURITY_CAP = 60, + MESH_PATH_ERROR_NO_PROXY_INFO = 61, + MESH_PATH_ERROR_NO_FORWARDING_INFO = 62, + MESH_PATH_ERROR_DEST_UNREACHABLE = 63, + MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS = 64, + MESH_CHANNEL_SWITCH_REGULATORY_REQ = 65, + MESH_CHANNEL_SWITCH_UNSPECIFIED = 66, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/StaIfaceStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/StaIfaceStatusCode.aidl new file mode 100644 index 0000000000..13529a5be1 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/StaIfaceStatusCode.aidl @@ -0,0 +1,134 @@ +/* + * 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 -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 StaIfaceStatusCode { + SUCCESS = 0, + UNSPECIFIED_FAILURE = 1, + TDLS_WAKEUP_ALTERNATE = 2, + TDLS_WAKEUP_REJECT = 3, + SECURITY_DISABLED = 5, + UNACCEPTABLE_LIFETIME = 6, + NOT_IN_SAME_BSS = 7, + CAPS_UNSUPPORTED = 10, + REASSOC_NO_ASSOC = 11, + ASSOC_DENIED_UNSPEC = 12, + NOT_SUPPORTED_AUTH_ALG = 13, + UNKNOWN_AUTH_TRANSACTION = 14, + CHALLENGE_FAIL = 15, + AUTH_TIMEOUT = 16, + AP_UNABLE_TO_HANDLE_NEW_STA = 17, + ASSOC_DENIED_RATES = 18, + ASSOC_DENIED_NOSHORT = 19, + SPEC_MGMT_REQUIRED = 22, + PWR_CAPABILITY_NOT_VALID = 23, + SUPPORTED_CHANNEL_NOT_VALID = 24, + ASSOC_DENIED_NO_SHORT_SLOT_TIME = 25, + ASSOC_DENIED_NO_HT = 27, + R0KH_UNREACHABLE = 28, + ASSOC_DENIED_NO_PCO = 29, + ASSOC_REJECTED_TEMPORARILY = 30, + ROBUST_MGMT_FRAME_POLICY_VIOLATION = 31, + UNSPECIFIED_QOS_FAILURE = 32, + DENIED_INSUFFICIENT_BANDWIDTH = 33, + DENIED_POOR_CHANNEL_CONDITIONS = 34, + DENIED_QOS_NOT_SUPPORTED = 35, + REQUEST_DECLINED = 37, + INVALID_PARAMETERS = 38, + REJECTED_WITH_SUGGESTED_CHANGES = 39, + INVALID_IE = 40, + GROUP_CIPHER_NOT_VALID = 41, + PAIRWISE_CIPHER_NOT_VALID = 42, + AKMP_NOT_VALID = 43, + UNSUPPORTED_RSN_IE_VERSION = 44, + INVALID_RSN_IE_CAPAB = 45, + CIPHER_REJECTED_PER_POLICY = 46, + TS_NOT_CREATED = 47, + DIRECT_LINK_NOT_ALLOWED = 48, + DEST_STA_NOT_PRESENT = 49, + DEST_STA_NOT_QOS_STA = 50, + ASSOC_DENIED_LISTEN_INT_TOO_LARGE = 51, + INVALID_FT_ACTION_FRAME_COUNT = 52, + INVALID_PMKID = 53, + INVALID_MDIE = 54, + INVALID_FTIE = 55, + REQUESTED_TCLAS_NOT_SUPPORTED = 56, + INSUFFICIENT_TCLAS_PROCESSING_RESOURCES = 57, + TRY_ANOTHER_BSS = 58, + GAS_ADV_PROTO_NOT_SUPPORTED = 59, + NO_OUTSTANDING_GAS_REQ = 60, + GAS_RESP_NOT_RECEIVED = 61, + STA_TIMED_OUT_WAITING_FOR_GAS_RESP = 62, + GAS_RESP_LARGER_THAN_LIMIT = 63, + REQ_REFUSED_HOME = 64, + ADV_SRV_UNREACHABLE = 65, + REQ_REFUSED_SSPN = 67, + REQ_REFUSED_UNAUTH_ACCESS = 68, + INVALID_RSNIE = 72, + U_APSD_COEX_NOT_SUPPORTED = 73, + U_APSD_COEX_MODE_NOT_SUPPORTED = 74, + BAD_INTERVAL_WITH_U_APSD_COEX = 75, + ANTI_CLOGGING_TOKEN_REQ = 76, + FINITE_CYCLIC_GROUP_NOT_SUPPORTED = 77, + CANNOT_FIND_ALT_TBTT = 78, + TRANSMISSION_FAILURE = 79, + REQ_TCLAS_NOT_SUPPORTED = 80, + TCLAS_RESOURCES_EXCHAUSTED = 81, + REJECTED_WITH_SUGGESTED_BSS_TRANSITION = 82, + REJECT_WITH_SCHEDULE = 83, + REJECT_NO_WAKEUP_SPECIFIED = 84, + SUCCESS_POWER_SAVE_MODE = 85, + PENDING_ADMITTING_FST_SESSION = 86, + PERFORMING_FST_NOW = 87, + PENDING_GAP_IN_BA_WINDOW = 88, + REJECT_U_PID_SETTING = 89, + REFUSED_EXTERNAL_REASON = 92, + REFUSED_AP_OUT_OF_MEMORY = 93, + REJECTED_EMERGENCY_SERVICE_NOT_SUPPORTED = 94, + QUERY_RESP_OUTSTANDING = 95, + REJECT_DSE_BAND = 96, + TCLAS_PROCESSING_TERMINATED = 97, + TS_SCHEDULE_CONFLICT = 98, + DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL = 99, + MCCAOP_RESERVATION_CONFLICT = 100, + MAF_LIMIT_EXCEEDED = 101, + MCCA_TRACK_LIMIT_EXCEEDED = 102, + DENIED_DUE_TO_SPECTRUM_MANAGEMENT = 103, + ASSOC_DENIED_NO_VHT = 104, + ENABLEMENT_DENIED = 105, + RESTRICTION_FROM_AUTHORIZED_GDB = 106, + AUTHORIZATION_DEENABLED = 107, + FILS_AUTHENTICATION_FAILURE = 112, + UNKNOWN_AUTHENTICATION_SERVER = 113, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl new file mode 100644 index 0000000000..32d71a3a8c --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/SupplicantStatusCode.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 -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 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, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl new file mode 100644 index 0000000000..7c6321782a --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/TransitionDisableIndication.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 -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 TransitionDisableIndication { + USE_WPA3_PERSONAL = 1, + USE_SAE_PK = 2, + USE_WPA3_ENTERPRISE = 4, + USE_ENHANCED_OPEN = 8, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WifiTechnology.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WifiTechnology.aidl new file mode 100644 index 0000000000..bf5081ea70 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WifiTechnology.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 -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 WifiTechnology { + UNKNOWN = 0, + LEGACY = 1, + HT = 2, + VHT = 3, + HE = 4, + EHT = 5, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl new file mode 100644 index 0000000000..9a0a924c66 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.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 -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 WpaDriverCapabilitiesMask { + MBO = 1, + OCE = 2, + SAE_PK = 4, + WFD_R2 = 8, + TRUST_ON_FIRST_USE = 16, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsConfigError.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsConfigError.aidl new file mode 100644 index 0000000000..c48b282e35 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsConfigError.aidl @@ -0,0 +1,58 @@ +/* + * 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 -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 WpsConfigError { + NO_ERROR = 0, + OOB_IFACE_READ_ERROR = 1, + DECRYPTION_CRC_FAILURE = 2, + CHAN_24_NOT_SUPPORTED = 3, + CHAN_50_NOT_SUPPORTED = 4, + SIGNAL_TOO_WEAK = 5, + NETWORK_AUTH_FAILURE = 6, + NETWORK_ASSOC_FAILURE = 7, + NO_DHCP_RESPONSE = 8, + FAILED_DHCP_CONFIG = 9, + IP_ADDR_CONFLICT = 10, + NO_CONN_TO_REGISTRAR = 11, + MULTIPLE_PBC_DETECTED = 12, + ROGUE_SUSPECTED = 13, + DEVICE_BUSY = 14, + SETUP_LOCKED = 15, + MSG_TIMEOUT = 16, + REG_SESS_TIMEOUT = 17, + DEV_PASSWORD_AUTH_FAILURE = 18, + CHAN_60G_NOT_SUPPORTED = 19, + PUBLIC_KEY_HASH_MISMATCH = 20, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsConfigMethods.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsConfigMethods.aidl new file mode 100644 index 0000000000..c98c479b4a --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsConfigMethods.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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 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, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl new file mode 100644 index 0000000000..975f1ab3fb --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsDevPasswordId.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 -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 WpsDevPasswordId { + DEFAULT = 0, + USER_SPECIFIED = 1, + MACHINE_SPECIFIED = 2, + REKEY = 3, + PUSHBUTTON = 4, + REGISTRAR_SPECIFIED = 5, + NFC_CONNECTION_HANDOVER = 7, + P2PS_DEFAULT = 8, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsErrorIndication.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsErrorIndication.aidl new file mode 100644 index 0000000000..50e69ff03b --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsErrorIndication.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 -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 WpsErrorIndication { + NO_ERROR = 0, + SECURITY_TKIP_ONLY_PROHIBITED = 1, + SECURITY_WEP_PROHIBITED = 2, + AUTH_FAILURE = 3, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl new file mode 100644 index 0000000000..f6dba234d4 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/1/android/hardware/wifi/supplicant/WpsProvisionMethod.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 -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 WpsProvisionMethod { + PBC = 0, + DISPLAY = 1, + KEYPAD = 2, +} -- GitLab From 3c4b1725fa01849553cf14d232f50e062bf75fae Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 22 Mar 2022 14:46:00 +0900 Subject: [PATCH 718/825] V3 is the latest version of keymaster HAL interface Bug: 225941299 Test: m Change-Id: I653ab8fd188228439128a75a58363da211e4b79f --- identity/aidl/default/Android.bp | 4 ++-- identity/aidl/vts/Android.bp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/identity/aidl/default/Android.bp b/identity/aidl/default/Android.bp index 32b35439ef..31ab40004f 100644 --- a/identity/aidl/default/Android.bp +++ b/identity/aidl/default/Android.bp @@ -41,7 +41,7 @@ cc_library_static { "libpuresoftkeymasterdevice", "android.hardware.identity-support-lib", "android.hardware.identity-V4-ndk", - "android.hardware.keymaster-V4-ndk", + "android.hardware.keymaster-V3-ndk", "android.hardware.security.keymint-V2-ndk", ], } @@ -107,7 +107,7 @@ cc_binary { "libpuresoftkeymasterdevice", "android.hardware.identity-support-lib", "android.hardware.identity-V4-ndk", - "android.hardware.keymaster-V4-ndk", + "android.hardware.keymaster-V3-ndk", "android.hardware.identity-libeic-hal-common", "android.hardware.identity-libeic-library", ], diff --git a/identity/aidl/vts/Android.bp b/identity/aidl/vts/Android.bp index 20faeeefaa..a471efb5b4 100644 --- a/identity/aidl/vts/Android.bp +++ b/identity/aidl/vts/Android.bp @@ -47,8 +47,8 @@ cc_test { "android.hardware.keymaster@4.0", "android.hardware.identity-support-lib", "android.hardware.identity-V4-cpp", - "android.hardware.keymaster-V4-cpp", - "android.hardware.keymaster-V4-ndk", + "android.hardware.keymaster-V3-cpp", + "android.hardware.keymaster-V3-ndk", "libkeymaster4support", "libkeymaster4_1support", "libkeymint_remote_prov_support", -- GitLab From bb73ba4e68cd66f755ab681808021fecc5d06604 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 23 Mar 2022 17:43:54 +0900 Subject: [PATCH 719/825] Add -Wno-missing-permission-annotation for soundtrigger3 Soundtrigger3 has been built with "-Werror -Weverything" (from Android.bp) and "-Weverything -Wno-missing-permission-annotation" (from the AIDL build system). The former is added only for the ToT version of an AIDL interface. So far, soundtrigger3 wasn't frozen and therefore the implicit version 1 was the ToT version. As a result, absence of @RequiresPermission in its interface didn't break the build due to the automatically added "-Wno-missing-permission-annotation" despite that it had "-Werror". However, this is causing build breakage as soundtrigger3 now has version 1 and 2 (ToT) and the version 1 is built *without* "-Wno-missing-permission-annotation". Fixing this by manually adding the diag flag so that it's applied to all versions. Bug: 225941299 Test: m Change-Id: I3a43fc77997ef900b0f173c88530f570e436bc77 --- soundtrigger/aidl/Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/soundtrigger/aidl/Android.bp b/soundtrigger/aidl/Android.bp index ab104c878b..448895c26c 100644 --- a/soundtrigger/aidl/Android.bp +++ b/soundtrigger/aidl/Android.bp @@ -14,6 +14,7 @@ aidl_interface { flags: [ "-Werror", "-Weverything", + "-Wno-missing-permission-annotation", ], srcs: [ "android/hardware/soundtrigger3/ISoundTriggerHw.aidl", -- GitLab From 46c12147615b603d44e7b0281f90c4721669d951 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Thu, 24 Mar 2022 07:02:43 +0900 Subject: [PATCH 720/825] Implement getInterfaceHash/Version for SoundTrigger As the soundtrigger AIDL interface gets frozen for TM, java services implementing the interface are required to implement getInterfaceHash and getInterfaceVersion [1]. [1] https://source.android.com/devices/architecture/aidl/stable-aidl#new-meta-interface-methods Bug: 225941299 Test: m Change-Id: I71f27131d2619cea2ae10a53c01ca883a459d159 --- .../android/hardware/soundtrigger3/cli/SthalCli.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 0fd1dda73d..127f0629ff 100644 --- a/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java +++ b/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java @@ -357,5 +357,15 @@ public class SthalCli { config.base.sampleRate = 16000; return config; } + + @Override + public int getInterfaceVersion() { + return ISoundTriggerHw.VERSION; + } + + @Override + public String getInterfaceHash() { + return ISoundTriggerHw.HASH; + } } } -- GitLab From a266b2c8f270ca04179019bb37d2da35dfffeb46 Mon Sep 17 00:00:00 2001 From: chasewu Date: Thu, 31 Mar 2022 23:23:27 +0800 Subject: [PATCH 721/825] Correct the PWLE valid duration Getting the maximum duration from HAL to avoid different supported duration under different devices. Fix: 227606057 Test: atest VtsHalVibratorTargetTest Signed-off-by: chasewu Change-Id: I02e96869d9a8e6d5143ae64e3a077bf90dcdb43e --- vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp index abb80a28f6..38417154eb 100644 --- a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp +++ b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp @@ -196,7 +196,7 @@ static ActivePwle composeValidActivePwle(sp vibrator, int32_t capabil active.startFrequency = frequencyHz; active.endAmplitude = (getAmplitudeMin() + getAmplitudeMax()) / 2; active.endFrequency = frequencyHz; - active.duration = 1000; + vibrator->getPwlePrimitiveDurationMax(&(active.duration)); return active; } @@ -759,7 +759,9 @@ TEST_P(VibratorAidl, ComposeValidPwleWithCallback) { std::future completionFuture{completionPromise.get_future()}; sp callback = new CompletionCallback([&completionPromise] { completionPromise.set_value(); }); - uint32_t durationMs = 2100; // Sum of 2 active and 1 braking below + int32_t segmentDurationMaxMs; + vibrator->getPwlePrimitiveDurationMax(&segmentDurationMaxMs); + uint32_t durationMs = segmentDurationMaxMs * 2 + 100; // Sum of 2 active and 1 braking below //TODO(b/187207798): revert back to conservative timeout values once //latencies have been fixed std::chrono::milliseconds timeout{durationMs * 4}; @@ -863,7 +865,7 @@ TEST_P(VibratorAidl, ComposePwleSegmentDurationBoundary) { if (capabilities & IVibrator::CAP_COMPOSE_PWLE_EFFECTS) { ActivePwle active = composeValidActivePwle(vibrator, capabilities); - int segmentDurationMaxMs; + int32_t segmentDurationMaxMs; vibrator->getPwlePrimitiveDurationMax(&segmentDurationMaxMs); active.duration = segmentDurationMaxMs + 10; // Segment duration greater than allowed -- GitLab From ddd4329e61b153b5574a94490f8a7b8c35373d66 Mon Sep 17 00:00:00 2001 From: John Reck Date: Wed, 30 Mar 2022 22:08:49 -0400 Subject: [PATCH 722/825] Add a few tests that FRONT_BUFFER is flushing properly Test: this Bug: 217776226 Change-Id: I49e32391620e005700d39539ca47da64199067a0 --- graphics/allocator/aidl/vts/Android.bp | 6 + ...VtsHalGraphicsAllocatorAidl_TargetTest.cpp | 259 +++++++++++++++--- 2 files changed, 230 insertions(+), 35 deletions(-) diff --git a/graphics/allocator/aidl/vts/Android.bp b/graphics/allocator/aidl/vts/Android.bp index d74129b059..99ffb24079 100644 --- a/graphics/allocator/aidl/vts/Android.bp +++ b/graphics/allocator/aidl/vts/Android.bp @@ -28,6 +28,7 @@ cc_test { defaults: [ "VtsHalTargetTestDefaults", "use_libaidlvintf_gtest_helper_static", + "hwui_defaults", ], srcs: [ "VtsHalGraphicsAllocatorAidl_TargetTest.cpp", @@ -46,10 +47,15 @@ cc_test { "libgui", "libhidlbase", "libvndksupport", + "libnativewindow", ], static_libs: [ "libaidlcommonsupport", "libgtest", + "libhwui", + ], + header_libs: [ + "libhwui_internal_headers", ], cflags: [ "-Wall", diff --git a/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp b/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp index 784bc66cc5..c9d058db7b 100644 --- a/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp +++ b/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#undef LOG_TAG #define LOG_TAG "VtsHalGraphicsAllocatorAidl_TargetTest" #include @@ -28,6 +29,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -38,6 +43,10 @@ using namespace aidl::android::hardware::graphics::common; using namespace android; using namespace android::hardware; using namespace android::hardware::graphics::mapper::V4_0; +using android::uirenderer::AutoEglImage; +using android::uirenderer::AutoGLFramebuffer; +using android::uirenderer::AutoSkiaGlTexture; +using android::uirenderer::renderthread::EglManager; static constexpr uint64_t pack(const std::initializer_list& usages) { uint64_t ret = 0; @@ -56,13 +65,15 @@ class BufferHandle { native_handle_t* mRawHandle; bool mImported = false; uint32_t mStride; + const IMapper::BufferDescriptorInfo mInfo; BufferHandle(const BufferHandle&) = delete; void operator=(const BufferHandle&) = delete; public: - BufferHandle(const sp mapper, native_handle_t* handle, bool imported, uint32_t stride) - : mMapper(mapper), mRawHandle(handle), mImported(imported), mStride(stride) {} + BufferHandle(const sp mapper, native_handle_t* handle, bool imported, uint32_t stride, + const IMapper::BufferDescriptorInfo& info) + : mMapper(mapper), mRawHandle(handle), mImported(imported), mStride(stride), mInfo(info) {} ~BufferHandle() { if (mRawHandle == nullptr) return; @@ -77,27 +88,47 @@ class BufferHandle { } uint32_t stride() const { return mStride; } + + AHardwareBuffer_Desc describe() const { + return { + .width = mInfo.width, + .height = mInfo.height, + .layers = mInfo.layerCount, + .format = static_cast(mInfo.format), + .usage = mInfo.usage, + .stride = stride(), + .rfu0 = 0, + .rfu1 = 0, + }; + } + + AHardwareBuffer* createAHardwareBuffer() const { + auto desc = describe(); + AHardwareBuffer* buffer = nullptr; + int err = AHardwareBuffer_createFromHandle( + &desc, mRawHandle, AHARDWAREBUFFER_CREATE_FROM_HANDLE_METHOD_CLONE, &buffer); + EXPECT_EQ(0, err) << "Failed to AHardwareBuffer_createFromHandle"; + return err ? nullptr : buffer; + } }; -class GraphicsAllocatorAidlTests - : public ::testing::TestWithParam> { +class GraphicsTestsBase { private: std::shared_ptr mAllocator; sp mMapper; - public: - void SetUp() override { + protected: + void Initialize(std::string allocatorService, std::string mapperService) { mAllocator = IAllocator::fromBinder( - ndk::SpAIBinder(AServiceManager_checkService(std::get<0>(GetParam()).c_str()))); - mMapper = IMapper::getService(std::get<1>(GetParam())); + ndk::SpAIBinder(AServiceManager_checkService(allocatorService.c_str()))); + mMapper = IMapper::getService(mapperService); ASSERT_NE(nullptr, mAllocator.get()) << "failed to get allocator service"; ASSERT_NE(nullptr, mMapper.get()) << "failed to get mapper service"; ASSERT_FALSE(mMapper->isRemote()) << "mapper is not in passthrough mode"; } - void TearDown() override {} - + public: BufferDescriptor createDescriptor(const IMapper::BufferDescriptorInfo& descriptorInfo) { BufferDescriptor descriptor; mMapper->createDescriptor( @@ -109,18 +140,7 @@ class GraphicsAllocatorAidlTests return descriptor; } - native_handle_t* importBuffer(const hidl_handle& rawHandle) { - native_handle_t* bufferHandle = nullptr; - mMapper->importBuffer(rawHandle, [&](const auto& tmpError, const auto& tmpBuffer) { - ASSERT_EQ(Error::NONE, tmpError) - << "failed to import buffer %p" << rawHandle.getNativeHandle(); - bufferHandle = static_cast(tmpBuffer); - }); - return bufferHandle; - } - - std::unique_ptr allocate(const IMapper::BufferDescriptorInfo& descriptorInfo, - bool import = false) { + std::unique_ptr allocate(const IMapper::BufferDescriptorInfo& descriptorInfo) { auto descriptor = createDescriptor(descriptorInfo); if (::testing::Test::HasFatalFailure()) { return nullptr; @@ -139,20 +159,81 @@ class GraphicsAllocatorAidlTests } return nullptr; } else { - if (import) { - native_handle_t* importedHandle = importBuffer(makeFromAidl(result.buffers[0])); - if (importedHandle) { - return std::make_unique(mMapper, importedHandle, true, - result.stride); - } else { - return nullptr; - } - } else { - return std::make_unique(mMapper, dupFromAidl(result.buffers[0]), - false, result.stride); - } + return std::make_unique(mMapper, dupFromAidl(result.buffers[0]), false, + result.stride, descriptorInfo); } } + + bool isSupported(const IMapper::BufferDescriptorInfo& descriptorInfo) { + bool ret = false; + EXPECT_TRUE(mMapper->isSupported(descriptorInfo, + [&](auto error, bool supported) { + ASSERT_EQ(Error::NONE, error); + ret = supported; + }) + .isOk()); + return ret; + } +}; + +class GraphicsAllocatorAidlTests + : public GraphicsTestsBase, + public ::testing::TestWithParam> { + public: + void SetUp() override { Initialize(std::get<0>(GetParam()), std::get<1>(GetParam())); } + + void TearDown() override {} +}; + +struct FlushMethod { + std::string name; + std::function func; +}; + +class GraphicsFrontBufferTests + : public GraphicsTestsBase, + public ::testing::TestWithParam> { + private: + EglManager eglManager; + std::function flush; + + public: + void SetUp() override { + Initialize(std::get<0>(GetParam()), std::get<1>(GetParam())); + flush = std::get<2>(GetParam()).func; + eglManager.initialize(); + } + + void TearDown() override { eglManager.destroy(); } + + void fillWithGpu(AHardwareBuffer* buffer, float red, float green, float blue, float alpha) { + const EGLClientBuffer clientBuffer = eglGetNativeClientBufferANDROID(buffer); + AutoEglImage eglImage(eglManager.eglDisplay(), clientBuffer); + AutoSkiaGlTexture glTexture; + AutoGLFramebuffer glFbo; + glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, eglImage.image); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, + glTexture.mTexture, 0); + + AHardwareBuffer_Desc desc; + AHardwareBuffer_describe(buffer, &desc); + glViewport(0, 0, desc.width, desc.height); + glDisable(GL_STENCIL_TEST); + glDisable(GL_SCISSOR_TEST); + glClearColor(red, green, blue, alpha); + glClear(GL_COLOR_BUFFER_BIT); + flush(eglManager); + } + + void fillWithGpu(AHardwareBuffer* buffer, /*RGBA*/ uint32_t color) { + // Keep it simple for now + static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__); + float a = float((color >> 24) & 0xff) / 255.0f; + float b = float((color >> 16) & 0xff) / 255.0f; + float g = float((color >> 8) & 0xff) / 255.0f; + float r = float((color)&0xff) / 255.0f; + fillWithGpu(buffer, r, g, b, a); + } }; TEST_P(GraphicsAllocatorAidlTests, CreateDescriptorBasic) { @@ -181,9 +262,117 @@ TEST_P(GraphicsAllocatorAidlTests, CanAllocate) { EXPECT_GE(buffer->stride(), 64); } +TEST_P(GraphicsFrontBufferTests, FrontBufferGpuToCpu) { + IMapper::BufferDescriptorInfo info{ + .name = "CPU_8888", + .width = 64, + .height = 64, + .layerCount = 1, + .format = cast(PixelFormat::RGBA_8888), + .usage = pack({BufferUsage::GPU_RENDER_TARGET, BufferUsage::CPU_READ_OFTEN, + BufferUsage::FRONT_BUFFER}), + .reservedSize = 0, + }; + const bool supported = isSupported(info); + auto buffer = allocate(info); + if (!supported) { + ASSERT_EQ(nullptr, buffer.get()) + << "Allocation succeeded, but IMapper::isSupported was false"; + } else { + ASSERT_NE(nullptr, buffer.get()) << "Allocation failed, but IMapper::isSupported was true"; + } + + AHardwareBuffer* ahb = buffer->createAHardwareBuffer(); + ASSERT_NE(nullptr, ahb); + + // We draw 3 times with 3 different colors to ensure the flush is consistently flushing. + // Particularly for glFlush() there's occasions where it seems something triggers a flush + // to happen even though glFlush itself isn't consistently doing so, but for FRONT_BUFFER + // bound buffers it is supposed to consistently flush. + for (uint32_t color : {0xFF0000FFu, 0x00FF00FFu, 0x0000FFFFu}) { + fillWithGpu(ahb, color); + uint32_t* addr; + ASSERT_EQ(0, AHardwareBuffer_lock(ahb, AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN, -1, nullptr, + (void**)&addr)); + // Spot check a few pixels + EXPECT_EQ(color, addr[0]); + EXPECT_EQ(color, addr[32 + (32 * buffer->stride())]); + AHardwareBuffer_unlock(ahb, nullptr); + } + + AHardwareBuffer_release(ahb); +} + +TEST_P(GraphicsFrontBufferTests, FrontBufferGpuToGpu) { + IMapper::BufferDescriptorInfo info{ + .name = "CPU_8888", + .width = 64, + .height = 64, + .layerCount = 1, + .format = cast(PixelFormat::RGBA_8888), + .usage = pack({BufferUsage::GPU_RENDER_TARGET, BufferUsage::GPU_TEXTURE, + BufferUsage::FRONT_BUFFER}), + .reservedSize = 0, + }; + const bool supported = isSupported(info); + auto buffer = allocate(info); + if (!supported) { + ASSERT_EQ(nullptr, buffer.get()) + << "Allocation succeeded, but IMapper::isSupported was false"; + } else { + ASSERT_NE(nullptr, buffer.get()) << "Allocation failed, but IMapper::isSupported was true"; + } + + AHardwareBuffer* ahb = buffer->createAHardwareBuffer(); + ASSERT_NE(nullptr, ahb); + + // We draw 3 times with 3 different colors to ensure the flush is consistently flushing. + // Particularly for glFlush() there's occasions where it seems something triggers a flush + // to happen even though glFlush itself isn't consistently doing so, but for FRONT_BUFFER + // bound buffers it is supposed to consistently flush. + for (uint32_t color : {0xFF0000FFu, 0x00FF00FFu, 0x0000FFFFu}) { + fillWithGpu(ahb, color); + sk_sp hwBitmap = Bitmap::createFrom(ahb, SkColorSpace::MakeSRGB()); + SkBitmap cpuBitmap = hwBitmap->getSkBitmap(); + // Spot check a few pixels + EXPECT_EQ(color, *cpuBitmap.getAddr32(0, 0)); + EXPECT_EQ(color, *cpuBitmap.getAddr32(16, 30)); + } + + AHardwareBuffer_release(ahb); +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsAllocatorAidlTests); INSTANTIATE_TEST_CASE_P( PerInstance, GraphicsAllocatorAidlTests, testing::Combine(testing::ValuesIn(getAidlHalInstanceNames(IAllocator::descriptor)), testing::ValuesIn(getAllHalInstanceNames(IMapper::descriptor))), - PrintInstanceTupleNameToString<>); \ No newline at end of file + PrintInstanceTupleNameToString<>); + +const auto FlushMethodsValues = testing::Values( + FlushMethod{"glFinish", [](EglManager&) { glFinish(); }}, + FlushMethod{"glFlush", + [](EglManager&) { + glFlush(); + // Since the goal is to verify that glFlush() actually flushes, we can't + // wait on any sort of fence since that will change behavior So instead we + // just sleep & hope + sleep(1); + }}, + FlushMethod{"eglClientWaitSync", [](EglManager& eglManager) { + EGLDisplay display = eglManager.eglDisplay(); + EGLSyncKHR fence = eglCreateSyncKHR(display, EGL_SYNC_FENCE_KHR, NULL); + eglClientWaitSyncKHR(display, fence, EGL_SYNC_FLUSH_COMMANDS_BIT_KHR, + EGL_FOREVER_KHR); + eglDestroySyncKHR(display, fence); + }}); +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsFrontBufferTests); +INSTANTIATE_TEST_CASE_P( + PerInstance, GraphicsFrontBufferTests, + testing::Combine(testing::ValuesIn(getAidlHalInstanceNames(IAllocator::descriptor)), + testing::ValuesIn(getAllHalInstanceNames(IMapper::descriptor)), + FlushMethodsValues), + [](auto info) -> std::string { + std::string name = std::to_string(info.index) + "/" + std::get<2>(info.param).name; + return Sanitize(name); + }); \ No newline at end of file -- GitLab From 8a6a1d38dc7a761e1477f1e9aedca7f3cbdfbae3 Mon Sep 17 00:00:00 2001 From: Tim Lin Date: Thu, 31 Mar 2022 21:06:57 +0800 Subject: [PATCH 723/825] fix SIM related VTS failures 1. Add 6s delay after setSimSlotsMapping because modem needs time to process SIM configuration change. The next TC could fail at checking SIM status if there is no delay. The default SIM configuration on my test device is that physical#0 maps to logical#1 and physical#1 maps to logical#0. When running setSimSlotsMapping, it then becomes physical#0 maps to logical#0 and physical#1 maps to logical#1. 2. Support DSDS case and TSTS case for setSimSlotsMapping. The original code only set for 1 slot and it caused 2nd slot SIM absent when testing with DSDS enabled. 3. Set slotStatus from corresponding physical slot for setSimCardPower. Bug: 227579281 Test: run vts -m VtsHalRadioTargetTest Change-Id: I8c12cb1dbc439655f9de88b1e217b3f34e44ebeb --- radio/aidl/vts/radio_aidl_hal_utils.cpp | 7 +++---- radio/aidl/vts/radio_aidl_hal_utils.h | 3 ++- radio/aidl/vts/radio_config_test.cpp | 12 ++++++++++++ radio/aidl/vts/radio_sim_test.cpp | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/radio/aidl/vts/radio_aidl_hal_utils.cpp b/radio/aidl/vts/radio_aidl_hal_utils.cpp index 861885111f..efc4f26dad 100644 --- a/radio/aidl/vts/radio_aidl_hal_utils.cpp +++ b/radio/aidl/vts/radio_aidl_hal_utils.cpp @@ -206,7 +206,7 @@ void RadioServiceTest::updateSimCardStatus() { EXPECT_EQ(RadioError::NONE, radioSimRsp->rspInfo.error); } -void RadioServiceTest::updateSimSlotStatus() { +void RadioServiceTest::updateSimSlotStatus(int physicalSlotId) { // Update SimSlotStatus from RadioConfig std::shared_ptr radioConfigRsp = ndk::SharedRefBase::make(*this); @@ -219,8 +219,7 @@ void RadioServiceTest::updateSimSlotStatus() { EXPECT_EQ(RadioResponseType::SOLICITED, radioConfigRsp->rspInfo.type); EXPECT_EQ(serial, radioConfigRsp->rspInfo.serial); EXPECT_EQ(RadioError::NONE, radioConfigRsp->rspInfo.error); - // assuming only 1 slot - for (const SimSlotStatus& slotStatusResponse : radioConfigRsp->simSlotStatus) { - slotStatus = slotStatusResponse; + if (radioConfigRsp->simSlotStatus.size() > physicalSlotId) { + slotStatus = radioConfigRsp->simSlotStatus[physicalSlotId]; } } diff --git a/radio/aidl/vts/radio_aidl_hal_utils.h b/radio/aidl/vts/radio_aidl_hal_utils.h index d6f7bf75b6..47976b9099 100644 --- a/radio/aidl/vts/radio_aidl_hal_utils.h +++ b/radio/aidl/vts/radio_aidl_hal_utils.h @@ -70,6 +70,7 @@ static constexpr const char* FEATURE_TELEPHONY_CDMA = "android.hardware.telephon #define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3 #define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3 #define MODEM_SET_SIM_POWER_DELAY_IN_SECONDS 2 +#define MODEM_SET_SIM_SLOT_MAPPING_DELAY_IN_SECONDS 6 #define RADIO_SERVICE_SLOT1_NAME "slot1" // HAL instance name for SIM slot 1 or single SIM device #define RADIO_SERVICE_SLOT2_NAME "slot2" // HAL instance name for SIM slot 2 on dual SIM device @@ -146,5 +147,5 @@ class RadioServiceTest { void updateSimCardStatus(); /* Update SIM slot status */ - void updateSimSlotStatus(); + void updateSimSlotStatus(int physicalSlotId); }; diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp index 83c4de0090..5e1c811d91 100644 --- a/radio/aidl/vts/radio_config_test.cpp +++ b/radio/aidl/vts/radio_config_test.cpp @@ -171,6 +171,15 @@ TEST_P(RadioConfigTest, setSimSlotsMapping) { slotPortMapping.physicalSlotId = 0; slotPortMapping.portId = 0; std::vector slotPortMappingList = {slotPortMapping}; + if (isDsDsEnabled()) { + slotPortMapping.physicalSlotId = 1; + slotPortMappingList.push_back(slotPortMapping); + } else if (isTsTsEnabled()) { + slotPortMapping.physicalSlotId = 1; + slotPortMappingList.push_back(slotPortMapping); + slotPortMapping.physicalSlotId = 2; + slotPortMappingList.push_back(slotPortMapping); + } ndk::ScopedAStatus res = radio_config->setSimSlotsMapping(serial, slotPortMappingList); ASSERT_OK(res); EXPECT_EQ(std::cv_status::no_timeout, wait()); @@ -179,6 +188,9 @@ TEST_P(RadioConfigTest, setSimSlotsMapping) { ALOGI("setSimSlotsMapping, rspInfo.error = %s\n", toString(radioRsp_config->rspInfo.error).c_str()); ASSERT_TRUE(CheckAnyOfErrors(radioRsp_config->rspInfo.error, {RadioError::NONE})); + + // Give some time for modem to fully switch SIM configuration + sleep(MODEM_SET_SIM_SLOT_MAPPING_DELAY_IN_SECONDS); } /* diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp index f94a2a05b4..e69247d135 100644 --- a/radio/aidl/vts/radio_sim_test.cpp +++ b/radio/aidl/vts/radio_sim_test.cpp @@ -108,7 +108,7 @@ TEST_P(RadioSimTest, setSimCardPower) { // have CardStatus::STATE_PRESENT after turning the power back on if (radioRsp_sim->rspInfo.error == RadioError::NONE) { updateSimCardStatus(); - updateSimSlotStatus(); + updateSimSlotStatus(cardStatus.slotMap.physicalSlotId); EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState); EXPECT_EQ(CardStatus::STATE_PRESENT, slotStatus.cardState); if (CardStatus::STATE_PRESENT == slotStatus.cardState) { -- GitLab From 9a8084505ed8938c72fd4ca248a87dd6507b2931 Mon Sep 17 00:00:00 2001 From: Gareth Fenn Date: Thu, 31 Mar 2022 08:40:00 +0100 Subject: [PATCH 724/825] Fix support for platforms without Frontends Fix: 227741234 Test: atest VtsHalTvTunerTargetTest Change-Id: Ic3d74be776bbdb377541ea24fb890152ad632508 --- .../functional/VtsHalTvTunerTargetTest.cpp | 72 ++++++++++++++++--- .../VtsHalTvTunerTestConfigurations.h | 17 +++-- .../config/TunerTestingConfigAidlReaderV1_0.h | 2 + 3 files changed, 75 insertions(+), 16 deletions(-) diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp index c99da419ed..07e3e3cbe2 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp @@ -640,6 +640,48 @@ TEST_P(TunerFilterAidlTest, testTimeFilter) { testTimeFilter(timeFilterMap[timeFilter.timeFilterId]); } +static bool isEventProducingFilter(const FilterConfig& filterConfig) { + switch (filterConfig.type.mainType) { + case DemuxFilterMainType::TS: { + auto tsFilterType = + filterConfig.type.subType.get(); + return (tsFilterType == DemuxTsFilterType::SECTION || + tsFilterType == DemuxTsFilterType::PES || + tsFilterType == DemuxTsFilterType::AUDIO || + tsFilterType == DemuxTsFilterType::VIDEO || + tsFilterType == DemuxTsFilterType::RECORD || + tsFilterType == DemuxTsFilterType::TEMI); + } + case DemuxFilterMainType::MMTP: { + auto mmtpFilterType = + filterConfig.type.subType.get(); + return (mmtpFilterType == DemuxMmtpFilterType::SECTION || + mmtpFilterType == DemuxMmtpFilterType::PES || + mmtpFilterType == DemuxMmtpFilterType::AUDIO || + mmtpFilterType == DemuxMmtpFilterType::VIDEO || + mmtpFilterType == DemuxMmtpFilterType::RECORD || + mmtpFilterType == DemuxMmtpFilterType::DOWNLOAD); + } + case DemuxFilterMainType::IP: { + auto ipFilterType = + filterConfig.type.subType.get(); + return (ipFilterType == DemuxIpFilterType::SECTION); + } + case DemuxFilterMainType::TLV: { + auto tlvFilterType = + filterConfig.type.subType.get(); + return (tlvFilterType == DemuxTlvFilterType::SECTION); + } + case DemuxFilterMainType::ALP: { + auto alpFilterType = + filterConfig.type.subType.get(); + return (alpFilterType == DemuxAlpFilterType::SECTION); + } + default: + return false; + } +} + static bool isMediaFilter(const FilterConfig& filterConfig) { switch (filterConfig.type.mainType) { case DemuxFilterMainType::TS: { @@ -685,6 +727,12 @@ static int getDemuxFilterEventDataLength(const DemuxFilterEvent& event) { // TODO: move boilerplate into text fixture void TunerFilterAidlTest::testDelayHint(const FilterConfig& filterConf) { + if (!filterConf.timeDelayInMs && !filterConf.dataDelayInBytes) { + return; + } + if (!isEventProducingFilter(filterConf)) { + return; + } int32_t feId; int32_t demuxId; std::shared_ptr demux; @@ -707,11 +755,11 @@ void TunerFilterAidlTest::testDelayHint(const FilterConfig& filterConf) { // startTime needs to be set before calling setDelayHint. auto startTime = std::chrono::steady_clock::now(); - auto timeDelayInMs = std::chrono::milliseconds(filterConf.timeDelayInMs); - if (timeDelayInMs.count() > 0) { + int timeDelayInMs = filterConf.timeDelayInMs; + if (timeDelayInMs > 0) { FilterDelayHint delayHint; delayHint.hintType = FilterDelayHintType::TIME_DELAY_IN_MS; - delayHint.hintValue = timeDelayInMs.count(); + delayHint.hintValue = timeDelayInMs; // setDelayHint should fail for media filters. ASSERT_EQ(filter->setDelayHint(delayHint).isOk(), !mediaFilter); @@ -733,6 +781,10 @@ void TunerFilterAidlTest::testDelayHint(const FilterConfig& filterConf) { auto cb = mFilterTests.getFilterCallbacks().at(filterId); auto future = cb->verifyFilterCallback([](const std::vector&) { return true; }); + + // The configure stage can also produce events, so we should set the delay + // hint beforehand. + ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId)); mFilterTests.startFilter(filterId); auto timeout = std::chrono::seconds(30); @@ -750,20 +802,16 @@ void TunerFilterAidlTest::testDelayHint(const FilterConfig& filterConf) { return true; }); - // The configure stage can also produce events, so we should set the delay - // hint beforehand. - ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId)); - ASSERT_TRUE(mFilterTests.startFilter(filterId)); // block and wait for callback to be received. ASSERT_EQ(future.wait_for(timeout), std::future_status::ready); - auto duration = std::chrono::steady_clock::now() - startTime; - bool delayHintTest = duration >= timeDelayInMs; + auto duration = std::chrono::steady_clock::now() - startTime; + bool delayHintTest = duration >= std::chrono::milliseconds(timeDelayInMs); bool dataSizeTest = callbackSize >= dataDelayInBytes; - if (timeDelayInMs.count() > 0 && dataDelayInBytes > 0) { + if (timeDelayInMs > 0 && dataDelayInBytes > 0) { ASSERT_TRUE(delayHintTest || dataSizeTest); } else { // if only one of time delay / data delay is configured, one of them @@ -781,7 +829,9 @@ void TunerFilterAidlTest::testDelayHint(const FilterConfig& filterConf) { TEST_P(TunerFilterAidlTest, FilterDelayHintTest) { description("Test filter time delay hint."); - + if (!live.hasFrontendConnection) { + return; + } for (const auto& obj : filterMap) { testDelayHint(obj.second); } diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h index 5a72ba45b5..5f1f9c5385 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h @@ -175,9 +175,14 @@ inline bool validateConnections() { ALOGW("[vts config] Record must support either a DVR source or a Frontend source."); return false; } - bool feIsValid = frontendMap.find(live.frontendId) != frontendMap.end() && - frontendMap.find(scan.frontendId) != frontendMap.end(); - feIsValid &= record.support ? frontendMap.find(record.frontendId) != frontendMap.end() : true; + bool feIsValid = live.hasFrontendConnection + ? frontendMap.find(live.frontendId) != frontendMap.end() + : true; + feIsValid &= scan.hasFrontendConnection ? frontendMap.find(scan.frontendId) != frontendMap.end() + : true; + feIsValid &= record.support && record.hasFrontendConnection + ? frontendMap.find(record.frontendId) != frontendMap.end() + : true; if (!feIsValid) { ALOGW("[vts config] dynamic config fe connection is invalid."); @@ -204,8 +209,10 @@ inline bool validateConnections() { return false; } - bool filterIsValid = filterMap.find(live.audioFilterId) != filterMap.end() && - filterMap.find(live.videoFilterId) != filterMap.end(); + bool filterIsValid = (live.hasFrontendConnection) + ? filterMap.find(live.audioFilterId) != filterMap.end() && + filterMap.find(live.videoFilterId) != filterMap.end() + : true; filterIsValid &= record.support ? filterMap.find(record.recordFilterId) != filterMap.end() : true; diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h index 3009c4a28d..189f5fdf77 100644 --- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h +++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h @@ -867,6 +867,8 @@ struct TunerTestingConfigAidlReader1_0 { settings.set(ip); break; case FilterSubTypeEnum::IP: { + type.subType.set( + DemuxIpFilterType::IP); ip.ipAddr = readIpAddress(filterConfig), ip.filterSettings .set( -- GitLab From 25c8c53725077d44607036f7da7d63854b829654 Mon Sep 17 00:00:00 2001 From: Sunil Ravi Date: Wed, 6 Apr 2022 05:05:14 -0700 Subject: [PATCH 725/825] wifi: Fix for returning wrong radio combinations matrix Allocate memory in heap for carrying radio combinations matrix from driver/firmware to wifi HAL. Bug: 225764376 Bug: 225762955 Test: atest WifiChipHidlTest Change-Id: I1049f7ab9f16a35a87b7cda34ba31797fde046e3 --- wifi/1.6/default/wifi_legacy_hal.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wifi/1.6/default/wifi_legacy_hal.cpp b/wifi/1.6/default/wifi_legacy_hal.cpp index 8a75fd83e3..bb8cf590d9 100644 --- a/wifi/1.6/default/wifi_legacy_hal.cpp +++ b/wifi/1.6/default/wifi_legacy_hal.cpp @@ -1549,13 +1549,14 @@ wifi_error WifiLegacyHal::setIndoorState(bool isIndoor) { std::pair WifiLegacyHal::getSupportedRadioCombinationsMatrix() { - std::array buffer; - buffer.fill(0); + char* buffer = new char[kMaxSupportedRadioCombinationsMatrixLength]; + std::fill(buffer, buffer + kMaxSupportedRadioCombinationsMatrixLength, 0); uint32_t size = 0; wifi_radio_combination_matrix* radio_combination_matrix_ptr = - reinterpret_cast(buffer.data()); + reinterpret_cast(buffer); wifi_error status = global_func_table_.wifi_get_supported_radio_combinations_matrix( - global_handle_, buffer.size(), &size, radio_combination_matrix_ptr); + global_handle_, kMaxSupportedRadioCombinationsMatrixLength, &size, + radio_combination_matrix_ptr); CHECK(size >= 0 && size <= kMaxSupportedRadioCombinationsMatrixLength); return {status, radio_combination_matrix_ptr}; } -- GitLab From 18339992dd5298f3f797edce5953bc8fca9cf753 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Mon, 4 Apr 2022 21:53:57 +0000 Subject: [PATCH 726/825] Allow old gralloc implementations to skip P010 support. P010 is mandated for vendor versions that are at least api level 33. Gralloc versions below this may not support P010 due to lack of enforcement, but tests for already-shipping devices must still pass. Bug: 220360702 Test: VtsHalGraphicsMapperV3_0TargetTest Change-Id: I7ba268713bada133491813aa3c9bd87fdecd2fef --- graphics/mapper/3.0/utils/vts/MapperVts.cpp | 42 ++++++++++++------- .../VtsHalGraphicsMapperV3_0TargetTest.cpp | 4 ++ graphics/mapper/4.0/utils/vts/MapperVts.cpp | 16 ++++--- .../VtsHalGraphicsMapperV4_0TargetTest.cpp | 9 ++-- 4 files changed, 46 insertions(+), 25 deletions(-) diff --git a/graphics/mapper/3.0/utils/vts/MapperVts.cpp b/graphics/mapper/3.0/utils/vts/MapperVts.cpp index de886a9c70..c470a4aca0 100644 --- a/graphics/mapper/3.0/utils/vts/MapperVts.cpp +++ b/graphics/mapper/3.0/utils/vts/MapperVts.cpp @@ -14,7 +14,9 @@ * limitations under the License. */ +#include #include +#include "gtest/gtest.h" namespace android { namespace hardware { @@ -94,23 +96,31 @@ std::vector Gralloc::allocate(const BufferDescriptor& de std::vector bufferHandles; bufferHandles.reserve(count); mAllocator->allocate( - descriptor, count, - [&](const auto& tmpError, const auto& tmpStride, const auto& tmpBuffers) { - ASSERT_EQ(Error::NONE, tmpError) << "failed to allocate buffers"; - ASSERT_EQ(count, tmpBuffers.size()) << "invalid buffer array"; - - for (uint32_t i = 0; i < count; i++) { - if (import) { - ASSERT_NO_FATAL_FAILURE(bufferHandles.push_back(importBuffer(tmpBuffers[i]))); - } else { - ASSERT_NO_FATAL_FAILURE(bufferHandles.push_back(cloneBuffer(tmpBuffers[i]))); + descriptor, count, + [&](const auto& tmpError, const auto& tmpStride, const auto& tmpBuffers) { + if (tmpError != Error::NONE) { + if (base::GetIntProperty("ro.vendor.build.version.sdk", 0, 0, INT_MAX) < 33) { + GTEST_SKIP() << "Old vendor grallocs may not support P010"; + } else { + GTEST_FAIL() << "failed to allocate buffers"; + } + } + ASSERT_EQ(count, tmpBuffers.size()) << "invalid buffer array"; + + for (uint32_t i = 0; i < count; i++) { + if (import) { + ASSERT_NO_FATAL_FAILURE( + bufferHandles.push_back(importBuffer(tmpBuffers[i]))); + } else { + ASSERT_NO_FATAL_FAILURE( + bufferHandles.push_back(cloneBuffer(tmpBuffers[i]))); + } } - } - if (outStride) { - *outStride = tmpStride; - } - }); + if (outStride) { + *outStride = tmpStride; + } + }); if (::testing::Test::HasFatalFailure()) { bufferHandles.clear(); @@ -127,7 +137,7 @@ const native_handle_t* Gralloc::allocate(const IMapper::BufferDescriptorInfo& de } auto buffers = allocate(descriptor, 1, import, outStride); - if (::testing::Test::HasFatalFailure()) { + if (::testing::Test::HasFatalFailure() || ::testing::Test::IsSkipped()) { return nullptr; } diff --git a/graphics/mapper/3.0/vts/functional/VtsHalGraphicsMapperV3_0TargetTest.cpp b/graphics/mapper/3.0/vts/functional/VtsHalGraphicsMapperV3_0TargetTest.cpp index 6c90af407a..3b1bfab867 100644 --- a/graphics/mapper/3.0/vts/functional/VtsHalGraphicsMapperV3_0TargetTest.cpp +++ b/graphics/mapper/3.0/vts/functional/VtsHalGraphicsMapperV3_0TargetTest.cpp @@ -337,6 +337,10 @@ TEST_P(GraphicsMapperHidlTest, LockYCbCrP010) { uint32_t stride; ASSERT_NO_FATAL_FAILURE(bufferHandle = mGralloc->allocate(info, true, &stride)); + if (::testing::Test::IsSkipped()) { + GTEST_SKIP(); + } + ASSERT_NE(nullptr, bufferHandle); const IMapper::Rect region{0, 0, static_cast(info.width), diff --git a/graphics/mapper/4.0/utils/vts/MapperVts.cpp b/graphics/mapper/4.0/utils/vts/MapperVts.cpp index 901f0e3ae7..4a6f68da26 100644 --- a/graphics/mapper/4.0/utils/vts/MapperVts.cpp +++ b/graphics/mapper/4.0/utils/vts/MapperVts.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include #include @@ -95,7 +96,14 @@ std::vector Gralloc::allocate(const BufferDescriptor& de return; } - ASSERT_EQ(Error::NONE, tmpError) << "failed to allocate buffers"; + if (tmpError != Error::NONE) { + if (base::GetIntProperty("ro.vendor.build.version.sdk", 0, 0, + INT_MAX) < 33) { + GTEST_SKIP() << "Old vendor grallocs may not support P010"; + } else { + GTEST_FAIL() << "failed to allocate buffers"; + } + } ASSERT_EQ(count, tmpBuffers.size()) << "invalid buffer array"; for (uint32_t i = 0; i < count; i++) { @@ -133,11 +141,7 @@ const native_handle_t* Gralloc::allocate(const IMapper::BufferDescriptorInfo& de } auto buffers = allocate(descriptor, 1, import, tolerance, outStride); - if (::testing::Test::HasFatalFailure()) { - return nullptr; - } - - if (buffers.size() != 1) { + if (::testing::Test::HasFatalFailure() || ::testing::Test::IsSkipped() || buffers.size() != 1) { return nullptr; } return buffers[0]; diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp index 463b565c2c..8f440e4d1e 100644 --- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp +++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp @@ -999,10 +999,13 @@ TEST_P(GraphicsMapperHidlTest, Lock_YCBCR_P010) { auto info = mDummyDescriptorInfo; info.format = PixelFormat::YCBCR_P010; - const native_handle_t* bufferHandle; uint32_t stride; - ASSERT_NO_FATAL_FAILURE( - bufferHandle = mGralloc->allocate(info, true, Tolerance::kToleranceStrict, &stride)); + const native_handle_t* bufferHandle = + mGralloc->allocate(info, true, Tolerance::kToleranceStrict, &stride); + + if (::testing::Test::IsSkipped()) { + GTEST_SKIP(); + } const IMapper::Rect region{0, 0, static_cast(info.width), static_cast(info.height)}; -- GitLab From 5a06465d3c697bb27a4b2d28b53d02984be2c150 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 23 Mar 2022 22:21:14 +0000 Subject: [PATCH 727/825] Update subscription logic for VHAL ref impl. Update the implementation for subscription logic. Add clearer documentation for sampleRate and timestamp behavior. The sampleRate specified in subscribeOptions is just a guidance to tell VHAL what the polling rate could be. For timestamp, the timestamp returned for each property must be the timestamp when that property is updated, not when the property is retrieved. Test: atest FakeVehicleHardwareTest Bug: 225191802, 226000926 Change-Id: I1e886133258236eedfa7fcffe5c4fb49aead4f6f --- .../hardware/automotive/vehicle/IVehicle.aidl | 46 +++- .../hardware/include/FakeVehicleHardware.h | 17 +- .../hardware/src/FakeVehicleHardware.cpp | 56 ++++- .../hardware/test/FakeVehicleHardwareTest.cpp | 87 ++++++- .../impl/hardware/include/IVehicleHardware.h | 29 +++ .../common}/include/RecurrentTimer.h | 0 .../impl/utils/common/include/VehicleUtils.h | 19 ++ .../common}/src/RecurrentTimer.cpp | 0 .../common}/test/RecurrentTimerTest.cpp | 0 automotive/vehicle/aidl/impl/vhal/Android.bp | 1 - .../impl/vhal/include/DefaultVehicleHal.h | 21 +- .../impl/vhal/include/SubscriptionManager.h | 116 ++++------ .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 86 ++----- .../impl/vhal/src/SubscriptionManager.cpp | 219 +++++++++++------- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 88 +------ .../impl/vhal/test/MockVehicleHardware.cpp | 41 ++++ .../aidl/impl/vhal/test/MockVehicleHardware.h | 10 + .../vhal/test/SubscriptionManagerTest.cpp | 22 +- 18 files changed, 508 insertions(+), 350 deletions(-) rename automotive/vehicle/aidl/impl/{vhal => utils/common}/include/RecurrentTimer.h (100%) rename automotive/vehicle/aidl/impl/{vhal => utils/common}/src/RecurrentTimer.cpp (100%) rename automotive/vehicle/aidl/impl/{vhal => utils/common}/test/RecurrentTimerTest.cpp (100%) diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl index dc9b876f60..47fc54b8dc 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/IVehicle.aidl @@ -90,6 +90,14 @@ interface IVehicle { * area ID) are not allowed in a single call. This function must return * {@link StatusCode#INVALID_ARG} for duplicate properties. * + * The {@link VehiclePropValue#timestamp} field in request is ignored. The + * {@link VehiclePropValue#timestamp} field in {@link GetValueResult} must + * be the system uptime since boot when the value changes for + * ON_CHANGE property or when the value is checked according to polling rate + * for CONTINUOUS property. Note that for CONTINUOUS property, VHAL client + * reading the property multiple times between the polling interval will get + * the same timestamp. + * * @param callback A callback interface, whose 'onGetValues' would be called * after the value is fetched. Caller should use * {@code android-automotive-large-parcelable} library to parse the @@ -104,7 +112,7 @@ interface IVehicle { * Set vehicle property values. * * The {@link IVehicleCallback#onSetValues} function would be called after - * the values set request are sent through vehicle bus or are failed to set. + * the values set request are sent through vehicle bus or failed to set. * If the bus protocol supports confirmation, the callback would be called * after getting the confirmation. * @@ -152,11 +160,36 @@ interface IVehicle { * Clients must be able to subscribe to multiple properties at a time * depending on data provided in options argument. * - * For one callback, the is only one subscription for one property. + * For one callback, there is only one subscription for one property. * A new subscription with a different sample rate would override the old * subscription. One property could be subscribed multiple times for * different callbacks. * + * If error is returned, some of the properties failed to subscribe. + * Caller is safe to try again, since subscribing to an already subscribed + * property is okay. + * + * The specified sample rate is just a guidance. It is not guaranteed that + * the sample rate is achievable depending on how the polling refresh rate + * is. The actual property event rate might be higher/lower than the + * specified sampleRate, for example, if the polling rate can be 5 times/s + * or 10 times/s, subscribing to a sample rate of 7 might use the 5 times/s + * polling rate, thus generating 5 events/s. We only require that on + * average, the {@code minSampleRate} and {@code maxSampleRate} can be + * achieved, all the sampleRate within min and max would on average + * generates events with rate >= {@code minSampleRate} and <= + * {@code maxSampleRate}. + * + * The {@link VehiclePropValue#timestamp} field for each property event must + * be the system uptime since boot when the value changes for + * ON_CHANGE property or when the value is checked according to polling rate + * for CONTINUOUS property. Note that for CONTINUOUS property, VHAL client + * reading the property multiple times between the polling interval will get + * the same timestamp. + * For example, if the polling rate for a property is 10 times/s, no matter + * what the sampleRate specified in {@code options}, the timestamp for + * the timestamp is updated 10 times/s. + * * @param callback The subscription callbacks. * {@link IVehicleCallback#onPropertyEvent} would be called when a new * property event arrives. @@ -189,8 +222,13 @@ interface IVehicle { /** * Unsubscribes from property events. * - * If 'callback' is not valid or 'propIds' were not subscribed for this - * 'callback', this method must return {@link StatusCode#INVALID_ARG}. + * If 'callback' is not valid this method must return + * {@link StatusCode#INVALID_ARG}. If a specified propId was not subscribed + * before, this method must ignore that propId. + * + * If error is returned, some of the properties failed to unsubscribe. + * Caller is safe to try again, since unsubscribing an already unsubscribed + * property is okay. * * @param callback The callback used in the previous subscription. * @param propIds The IDs for the properties to unsubscribe. 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 e799a28944..892b4060bd 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -82,6 +83,10 @@ class FakeVehicleHardware : public IVehicleHardware { void registerOnPropertySetErrorEvent( std::unique_ptr 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; + protected: // mValuePool is also used in mServerSidePropStore. const std::shared_ptr mValuePool; @@ -99,11 +104,13 @@ class FakeVehicleHardware : public IVehicleHardware { const std::unique_ptr mFakeObd2Frame; const std::unique_ptr mFakeUserHal; - std::mutex mCallbackLock; - std::unique_ptr mOnPropertyChangeCallback - GUARDED_BY(mCallbackLock); - std::unique_ptr mOnPropertySetErrorCallback - GUARDED_BY(mCallbackLock); + // RecurrentTimer is thread-safe. + std::unique_ptr mRecurrentTimer; + std::mutex mLock; + std::unique_ptr mOnPropertyChangeCallback GUARDED_BY(mLock); + std::unique_ptr mOnPropertySetErrorCallback GUARDED_BY(mLock); + std::unordered_map, PropIdAreaIdHash> + mRecurrentActions GUARDED_BY(mLock); void init(); // Stores the initial value to property store. 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 f8b64f2a0a..8f8cc5cf23 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -66,6 +66,7 @@ using ::android::base::EqualsIgnoreCase; using ::android::base::Error; using ::android::base::ParseFloat; using ::android::base::Result; +using ::android::base::ScopedLockAssertion; using ::android::base::StartsWith; using ::android::base::StringPrintf; @@ -131,18 +132,14 @@ void FakeVehicleHardware::storePropInitialValue(const defaultconfig::ConfigDecla } FakeVehicleHardware::FakeVehicleHardware() - : mValuePool(new VehiclePropValuePool), - mServerSidePropStore(new VehiclePropertyStore(mValuePool)), - mFakeObd2Frame(new obd2frame::FakeObd2Frame(mServerSidePropStore)), - mFakeUserHal(new FakeUserHal(mValuePool)) { - init(); -} + : FakeVehicleHardware(std::make_unique()) {} FakeVehicleHardware::FakeVehicleHardware(std::unique_ptr valuePool) : mValuePool(std::move(valuePool)), mServerSidePropStore(new VehiclePropertyStore(mValuePool)), mFakeObd2Frame(new obd2frame::FakeObd2Frame(mServerSidePropStore)), - mFakeUserHal(new FakeUserHal(mValuePool)) { + mFakeUserHal(new FakeUserHal(mValuePool)), + mRecurrentTimer(new RecurrentTimer()) { init(); } @@ -837,18 +834,57 @@ StatusCode FakeVehicleHardware::checkHealth() { void FakeVehicleHardware::registerOnPropertyChangeEvent( std::unique_ptr callback) { - std::scoped_lock lockGuard(mCallbackLock); + std::scoped_lock lockGuard(mLock); mOnPropertyChangeCallback = std::move(callback); } void FakeVehicleHardware::registerOnPropertySetErrorEvent( std::unique_ptr callback) { - std::scoped_lock lockGuard(mCallbackLock); + std::scoped_lock lockGuard(mLock); 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 lockGuard(mLock); + + PropIdAreaId propIdAreaId{ + .propId = propId, + .areaId = areaId, + }; + if (mRecurrentActions.find(propIdAreaId) != mRecurrentActions.end()) { + mRecurrentTimer->unregisterTimerCallback(mRecurrentActions[propIdAreaId]); + } + if (sampleRate == 0) { + return StatusCode::OK; + } + int64_t interval = static_cast(1'000'000'000. / sampleRate); + auto action = std::make_shared([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{ + .prop = propId, + .areaId = areaId, + }); + if (!result.ok()) { + // Failed to read current value, skip refreshing. + return; + } + result.value()->timestamp = elapsedRealtimeNano(); + // Must remove the value before writing, otherwise, we would generate no update event since + // the value is the same. + mServerSidePropStore->removeValue(*result.value()); + mServerSidePropStore->writeValue(std::move(result.value())); + }); + mRecurrentTimer->registerTimerCallback(interval, action); + mRecurrentActions[propIdAreaId] = action; + return StatusCode::OK; +} + void FakeVehicleHardware::onValueChangeCallback(const VehiclePropValue& value) { - std::scoped_lock lockGuard(mCallbackLock); + std::scoped_lock lockGuard(mLock); if (mOnPropertyChangeCallback == nullptr) { return; 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 7a7fb3745a..8839c18e55 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -25,12 +25,15 @@ #include #include #include +#include #include #include #include #include #include +#include +#include #include namespace android { @@ -53,6 +56,7 @@ using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::base::expected; +using ::android::base::ScopedLockAssertion; using ::android::base::StringPrintf; using ::android::base::unexpected; using ::testing::ContainerEq; @@ -60,6 +64,8 @@ using ::testing::ContainsRegex; using ::testing::Eq; using ::testing::WhenSortedBy; +using std::chrono::milliseconds; + constexpr int INVALID_PROP_ID = 0; constexpr char CAR_MAKE[] = "Default Car"; @@ -158,30 +164,65 @@ class FakeVehicleHardwareTest : public ::testing::Test { } void onSetValues(std::vector results) { + std::scoped_lock lockGuard(mLock); for (auto& result : results) { mSetValueResults.push_back(result); } } - const std::vector& getSetValueResults() { return mSetValueResults; } + const std::vector& getSetValueResults() { + std::scoped_lock lockGuard(mLock); + return mSetValueResults; + } void onGetValues(std::vector results) { + std::scoped_lock lockGuard(mLock); for (auto& result : results) { mGetValueResults.push_back(result); } } - const std::vector& getGetValueResults() { return mGetValueResults; } + const std::vector& getGetValueResults() { + std::scoped_lock lockGuard(mLock); + return mGetValueResults; + } void onPropertyChangeEvent(std::vector values) { + std::scoped_lock lockGuard(mLock); for (auto& value : values) { mChangedProperties.push_back(value); + PropIdAreaId propIdAreaId{ + .propId = value.prop, + .areaId = value.areaId, + }; + mEventCount[propIdAreaId]++; } + mCv.notify_one(); + } + + const std::vector& getChangedProperties() { + std::scoped_lock lockGuard(mLock); + return mChangedProperties; } - const std::vector& getChangedProperties() { return mChangedProperties; } + bool waitForChangedProperties(int32_t propId, int32_t areaId, size_t count, + milliseconds timeout) { + PropIdAreaId propIdAreaId{ + .propId = propId, + .areaId = areaId, + }; + std::unique_lock lk(mLock); + return mCv.wait_for(lk, timeout, [this, propIdAreaId, count] { + ScopedLockAssertion lockAssertion(mLock); + return mEventCount[propIdAreaId] >= count; + }); + } - void clearChangedProperties() { mChangedProperties.clear(); } + void clearChangedProperties() { + std::scoped_lock lockGuard(mLock); + mEventCount.clear(); + mChangedProperties.clear(); + } static void addSetValueRequest(std::vector& requests, std::vector& expectedResults, int64_t requestId, @@ -246,11 +287,14 @@ class FakeVehicleHardwareTest : public ::testing::Test { private: FakeVehicleHardware mHardware; - std::vector mSetValueResults; - std::vector mGetValueResults; - std::vector mChangedProperties; std::shared_ptr mSetValuesCallback; std::shared_ptr mGetValuesCallback; + std::condition_variable mCv; + std::mutex mLock; + std::unordered_map mEventCount GUARDED_BY(mLock); + std::vector mSetValueResults GUARDED_BY(mLock); + std::vector mGetValueResults GUARDED_BY(mLock); + std::vector mChangedProperties GUARDED_BY(mLock); }; TEST_F(FakeVehicleHardwareTest, testGetAllPropertyConfigs) { @@ -1510,6 +1554,35 @@ TEST_F(FakeVehicleHardwareTest, testGetEchoReverseBytes) { ASSERT_EQ(result.value().value.byteValues, std::vector({0x04, 0x03, 0x02, 0x01})); } +TEST_F(FakeVehicleHardwareTest, testUpdateSampleRate) { + 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); + + ASSERT_TRUE(waitForChangedProperties(propSpeed, areaId, /*count=*/5, milliseconds(1500))) + << "not enough events generated for speed"; + + getHardware()->updateSampleRate(propSteering, areaId, 10); + + 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); + clearChangedProperties(); + + ASSERT_TRUE(waitForChangedProperties(propSteering, areaId, /*count=*/5, milliseconds(1500))) + << "should still receive steering events after disable polling for speed"; + auto updatedValues = getChangedProperties(); + for (auto& value : updatedValues) { + ASSERT_GE(value.timestamp, timestamp); + ASSERT_EQ(value.prop, propSteering); + ASSERT_EQ(value.areaId, areaId); + } +} + } // namespace fake } // namespace vehicle } // namespace automotive diff --git a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h index 4a38827574..759db4153d 100644 --- a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h @@ -80,6 +80,35 @@ class IVehicleHardware { const std::vector& requests) const = 0; + // 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 + // this many OnPropertyChange events per seconds. + // A sampleRate of 0 means the property is no longer subscribed and server does not need to + // generate any onPropertyEvent for this property. + // 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 + // 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. + // 4. The initial subscriber is removed, updateSampleRate would be 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, updateSampleRate would be called with sampleRate as 0. + // The impl can optionally disable the polling for vehicle speed. + // + // If the impl is always polling at {@code maxSampleRate} as specified in config, then this + // function can be a no-op. + virtual aidl::android::hardware::automotive::vehicle::StatusCode updateSampleRate( + [[maybe_unused]] int32_t propId, [[maybe_unused]] int32_t areaId, + [[maybe_unused]] float sampleRate) { + return aidl::android::hardware::automotive::vehicle::StatusCode::OK; + } + // Dump debug information in the server. virtual DumpResult dump(const std::vector& options) = 0; diff --git a/automotive/vehicle/aidl/impl/vhal/include/RecurrentTimer.h b/automotive/vehicle/aidl/impl/utils/common/include/RecurrentTimer.h similarity index 100% rename from automotive/vehicle/aidl/impl/vhal/include/RecurrentTimer.h rename to automotive/vehicle/aidl/impl/utils/common/include/RecurrentTimer.h diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h index 6d7d13120d..c94bad6ca6 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h @@ -21,6 +21,7 @@ #include #include +#include #include namespace android { @@ -310,6 +311,24 @@ ndk::ScopedAStatus toScopedAStatus(const VhalResult& result, return toScopedAStatus(result, getErrorCode(result), additionalErrorMsg); } +struct PropIdAreaId { + int32_t propId; + int32_t areaId; + + inline bool operator==(const PropIdAreaId& other) const { + return areaId == other.areaId && propId == other.propId; + } +}; + +struct PropIdAreaIdHash { + inline size_t operator()(const PropIdAreaId& propIdAreaId) const { + size_t res = 0; + hashCombine(res, propIdAreaId.propId); + hashCombine(res, propIdAreaId.areaId); + return res; + } +}; + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/src/RecurrentTimer.cpp b/automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp similarity index 100% rename from automotive/vehicle/aidl/impl/vhal/src/RecurrentTimer.cpp rename to automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp diff --git a/automotive/vehicle/aidl/impl/vhal/test/RecurrentTimerTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/RecurrentTimerTest.cpp similarity index 100% rename from automotive/vehicle/aidl/impl/vhal/test/RecurrentTimerTest.cpp rename to automotive/vehicle/aidl/impl/utils/common/test/RecurrentTimerTest.cpp diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp index 49f48f7aa8..5abcaf6980 100644 --- a/automotive/vehicle/aidl/impl/vhal/Android.bp +++ b/automotive/vehicle/aidl/impl/vhal/Android.bp @@ -54,7 +54,6 @@ cc_library { srcs: [ "src/ConnectedClient.cpp", "src/DefaultVehicleHal.cpp", - "src/RecurrentTimer.cpp", "src/SubscriptionManager.cpp", ], static_libs: [ diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index f646b6b1bb..9c29816faf 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -17,10 +17,11 @@ #ifndef android_hardware_automotive_vehicle_aidl_impl_vhal_include_DefaultVehicleHal_H_ #define android_hardware_automotive_vehicle_aidl_impl_vhal_include_DefaultVehicleHal_H_ -#include "ConnectedClient.h" -#include "ParcelableUtils.h" -#include "PendingRequestPool.h" -#include "SubscriptionManager.h" +#include +#include +#include +#include +#include #include #include @@ -163,7 +164,7 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi static constexpr int64_t TIMEOUT_IN_NANO = 30'000'000'000; // heart beat event interval: 3s static constexpr int64_t HEART_BEAT_INTERVAL_IN_NANO = 3'000'000'000; - const std::shared_ptr mVehicleHardware; + std::unique_ptr mVehicleHardware; // mConfigsByPropId and mConfigFile are only modified during initialization, so no need to // lock guard them. @@ -188,6 +189,8 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi // mBinderImpl is only going to be changed in test. std::unique_ptr mBinderImpl; + // Only initialized once. + std::shared_ptr> mRecurrentAction; // RecurrentTimer is thread-safe. RecurrentTimer mRecurrentTimer; @@ -243,18 +246,12 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi std::unordered_map>* clients, const CallbackType& callback, std::shared_ptr pendingRequestPool); - static void getValueFromHardwareCallCallback( - std::weak_ptr vehicleHardware, - std::shared_ptr subscribeIdByClient, - std::shared_ptr subscriptionClients, const CallbackType& callback, - const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); - static void onPropertyChangeEvent( std::weak_ptr subscriptionManager, const std::vector& updatedValues); - static void checkHealth(std::weak_ptr hardware, + static void checkHealth(IVehicleHardware* hardware, std::weak_ptr subscriptionManager); static void onBinderDied(void* cookie); diff --git a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h index b0d67010b1..7c8f1b4672 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h +++ b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h @@ -17,15 +17,16 @@ #ifndef android_hardware_automotive_vehicle_aidl_impl_vhal_include_SubscriptionManager_H_ #define android_hardware_automotive_vehicle_aidl_impl_vhal_include_SubscriptionManager_H_ -#include "RecurrentTimer.h" - +#include #include +#include #include #include #include #include +#include #include #include #include @@ -35,43 +36,58 @@ namespace hardware { namespace automotive { namespace vehicle { +// 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 sampleRate); + void removeClient(const ClientIdType& clientId); + float getMaxSampleRate(); + + private: + float mMaxSampleRate = 0.; + std::unordered_map mSampleRates; + + void refreshMaxSampleRate(); +}; + // A thread-safe subscription manager that manages all VHAL subscriptions. class SubscriptionManager final { public: using ClientIdType = const AIBinder*; using CallbackType = std::shared_ptr; - using GetValueFunc = std::function; - explicit SubscriptionManager(GetValueFunc&& action); + explicit SubscriptionManager(IVehicleHardware* hardware); ~SubscriptionManager(); // Subscribes to properties according to {@code SubscribeOptions}. Note that all option must // contain non-empty areaIds field, which contains all area IDs to subscribe. As a result, // the options here is different from the options passed from VHAL client. - // Returns error if any of the subscribe options is not valid. If error is returned, no - // properties would be subscribed. + // Returns error if any of the subscribe options is not valid or one of the properties failed + // to subscribe. Part of the properties maybe be subscribed successfully if this function + // returns error. Caller is safe to retry since subscribing to an already subscribed property + // is okay. // Returns ok if all the options are parsed correctly and all the properties are subscribed. - android::base::Result subscribe( + VhalResult subscribe( const CallbackType& callback, const std::vector& options, bool isContinuousProperty); // Unsubscribes from the properties for the client. - // Returns error if the client was not subscribed before or one of the given property was not - // subscribed. If error is returned, no property would be unsubscribed. + // Returns error if the client was not subscribed before, or one of the given property was not + // subscribed, or one of the property failed to unsubscribe. Caller is safe to retry since + // unsubscribing to an already unsubscribed property is okay (it would be ignored). // Returns ok if all the requested properties for the client are unsubscribed. - android::base::Result unsubscribe(ClientIdType client, - const std::vector& propIds); + VhalResult unsubscribe(ClientIdType client, const std::vector& propIds); // Unsubscribes from all the properties for the client. - // Returns error if the client was not subscribed before. If error is returned, no property - // would be unsubscribed. + // Returns error if the client was not subscribed before or one of the subscribed properties + // for the client failed to unsubscribe. Caller is safe to retry. // Returns ok if all the properties for the client are unsubscribed. - android::base::Result unsubscribe(ClientIdType client); + VhalResult unsubscribe(ClientIdType client); // 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 @@ -83,6 +99,11 @@ class SubscriptionManager final { const std::vector& updatedValues); + // Gets the sample rate for the continuous property. Returns {@code std::nullopt} if the + // property has not been subscribed before or is not a continuous property. + std::optional getSampleRate(const ClientIdType& clientId, int32_t propId, + int32_t areaId); + // Checks whether the sample rate is valid. static bool checkSampleRate(float sampleRate); @@ -90,65 +111,28 @@ class SubscriptionManager final { // Friend class for testing. friend class DefaultVehicleHalTest; - struct PropIdAreaId { - int32_t propId; - int32_t areaId; - - bool operator==(const PropIdAreaId& other) const; - }; - - struct PropIdAreaIdHash { - size_t operator()(const PropIdAreaId& propIdAreaId) const; - }; - - // A class to represent a registered subscription. - class Subscription { - public: - Subscription() = default; - - Subscription(const Subscription&) = delete; - - virtual ~Subscription() = default; - - virtual bool isOnChange(); - }; - - // A subscription for OnContinuous property. The registered action would be called recurrently - // until this class is destructed. - class RecurrentSubscription final : public Subscription { - public: - explicit RecurrentSubscription(std::shared_ptr timer, - std::function&& action, int64_t interval); - ~RecurrentSubscription(); - - bool isOnChange() override; - - private: - std::shared_ptr> mAction; - std::shared_ptr mTimer; - }; - - // A subscription for OnChange property. - class OnChangeSubscription final : public Subscription { - public: - bool isOnChange() override; - }; + IVehicleHardware* mVehicleHardware; mutable std::mutex mLock; std::unordered_map, PropIdAreaIdHash> mClientsByPropIdArea GUARDED_BY(mLock); - std::unordered_map, - PropIdAreaIdHash>> - mSubscriptionsByClient GUARDED_BY(mLock); - // RecurrentTimer is thread-safe. - std::shared_ptr mTimer; - const GetValueFunc mGetValue; + std::unordered_map> + mSubscribedPropsByClient GUARDED_BY(mLock); + std::unordered_map mContSubConfigsByPropIdArea + GUARDED_BY(mLock); - static android::base::Result getInterval(float sampleRate); + VhalResult updateSampleRateLocked(const ClientIdType& clientId, + const PropIdAreaId& propIdAreaId, float sampleRate) + REQUIRES(mLock); + VhalResult removeSampleRateLocked(const ClientIdType& clientId, + const PropIdAreaId& propIdAreaId) REQUIRES(mLock); // Checks whether the manager is empty. For testing purpose. bool isEmpty(); + + // Get the interval in nanoseconds accroding to sample rate. + static android::base::Result getInterval(float sampleRate); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index 82f2c1bbcb..b191aef9b3 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -143,16 +143,12 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) mConfigFile = std::move(result.value()); } + mSubscriptionClients = std::make_shared(mPendingRequestPool); mSubscriptionClients = std::make_shared(mPendingRequestPool); auto subscribeIdByClient = std::make_shared(); - // Make a weak copy of IVehicleHardware because subscriptionManager uses IVehicleHardware and - // IVehicleHardware uses subscriptionManager. We want to avoid cyclic reference. - std::weak_ptr hardwareCopy = mVehicleHardware; - SubscriptionManager::GetValueFunc getValueFunc = std::bind( - &DefaultVehicleHal::getValueFromHardwareCallCallback, hardwareCopy, subscribeIdByClient, - mSubscriptionClients, std::placeholders::_1, std::placeholders::_2); - mSubscriptionManager = std::make_shared(std::move(getValueFunc)); + IVehicleHardware* hardwarePtr = mVehicleHardware.get(); + mSubscriptionManager = std::make_shared(hardwarePtr); std::weak_ptr subscriptionManagerCopy = mSubscriptionManager; mVehicleHardware->registerOnPropertyChangeEvent( @@ -162,11 +158,11 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr hardware) })); // Register heartbeat event. - mRecurrentTimer.registerTimerCallback( - HEART_BEAT_INTERVAL_IN_NANO, - std::make_shared>([hardwareCopy, subscriptionManagerCopy]() { - checkHealth(hardwareCopy, subscriptionManagerCopy); - })); + mRecurrentAction = + std::make_shared>([hardwarePtr, subscriptionManagerCopy]() { + checkHealth(hardwarePtr, subscriptionManagerCopy); + }); + mRecurrentTimer.registerTimerCallback(HEART_BEAT_INTERVAL_IN_NANO, mRecurrentAction); mBinderImpl = std::make_unique(); mOnBinderDiedUnlinkedHandlerThread = std::thread([this] { onBinderDiedUnlinkedHandler(); }); @@ -183,6 +179,13 @@ DefaultVehicleHal::~DefaultVehicleHal() { if (mOnBinderDiedUnlinkedHandlerThread.joinable()) { mOnBinderDiedUnlinkedHandlerThread.join(); } + // mRecurrentAction uses pointer to mVehicleHardware, so it has to be unregistered before + // mVehicleHardware. + mRecurrentTimer.unregisterTimerCallback(mRecurrentAction); + // mSubscriptionManager uses pointer to mVehicleHardware, so it has to be destroyed before + // mVehicleHardware. + mSubscriptionManager.reset(); + mVehicleHardware.reset(); } void DefaultVehicleHal::onPropertyChangeEvent( @@ -294,43 +297,6 @@ DefaultVehicleHal::getOrCreateClient( std::unordered_map>* clients, const CallbackType& callback, std::shared_ptr pendingRequestPool); -void DefaultVehicleHal::getValueFromHardwareCallCallback( - std::weak_ptr vehicleHardware, - std::shared_ptr subscribeIdByClient, - std::shared_ptr subscriptionClients, const CallbackType& callback, - const VehiclePropValue& value) { - int64_t subscribeId = subscribeIdByClient->getId(callback); - auto client = subscriptionClients->getClient(callback); - if (client == nullptr) { - ALOGW("subscribe[%" PRId64 "]: the client has died", subscribeId); - return; - } - if (auto addRequestResult = client->addRequests({subscribeId}); !addRequestResult.ok()) { - ALOGE("subscribe[%" PRId64 "]: too many pending requests, ignore the getValue request", - subscribeId); - return; - } - - std::vector hardwareRequests = {{ - .requestId = subscribeId, - .prop = value, - }}; - - std::shared_ptr hardware = vehicleHardware.lock(); - if (hardware == nullptr) { - ALOGW("the IVehicleHardware is destroyed, DefaultVehicleHal is ending"); - return; - } - if (StatusCode status = hardware->getValues(client->getResultCallback(), hardwareRequests); - status != StatusCode::OK) { - // If the hardware returns error, finish all the pending requests for this request because - // we never expect hardware to call callback for these requests. - client->tryFinishRequests({subscribeId}); - ALOGE("subscribe[%" PRId64 "]: failed to get value from VehicleHardware, code: %d", - subscribeId, toInt(status)); - } -} - void DefaultVehicleHal::setTimeout(int64_t timeoutInNano) { mPendingRequestPool = std::make_unique(timeoutInNano); } @@ -705,12 +671,13 @@ ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, // Since we have already check the sample rates, the following functions must succeed. if (!onChangeSubscriptions.empty()) { - mSubscriptionManager->subscribe(callback, onChangeSubscriptions, - /*isContinuousProperty=*/false); + return toScopedAStatus(mSubscriptionManager->subscribe(callback, onChangeSubscriptions, + /*isContinuousProperty=*/false)); } if (!continuousSubscriptions.empty()) { - mSubscriptionManager->subscribe(callback, continuousSubscriptions, - /*isContinuousProperty=*/true); + return toScopedAStatus(mSubscriptionManager->subscribe(callback, + continuousSubscriptions, + /*isContinuousProperty=*/true)); } } return ScopedAStatus::ok(); @@ -718,8 +685,7 @@ ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, ScopedAStatus DefaultVehicleHal::unsubscribe(const CallbackType& callback, const std::vector& propIds) { - return toScopedAStatus(mSubscriptionManager->unsubscribe(callback->asBinder().get(), propIds), - StatusCode::INVALID_ARG); + return toScopedAStatus(mSubscriptionManager->unsubscribe(callback->asBinder().get(), propIds)); } ScopedAStatus DefaultVehicleHal::returnSharedMemory(const CallbackType&, int64_t) { @@ -763,15 +729,9 @@ VhalResult DefaultVehicleHal::checkReadPermission(const VehiclePropValue& return {}; } -void DefaultVehicleHal::checkHealth(std::weak_ptr hardware, +void DefaultVehicleHal::checkHealth(IVehicleHardware* hardware, std::weak_ptr subscriptionManager) { - auto hardwarePtr = hardware.lock(); - if (hardwarePtr == nullptr) { - ALOGW("the VehicleHardware is destroyed, DefaultVehicleHal is ending"); - return; - } - - StatusCode status = hardwarePtr->checkHealth(); + StatusCode status = hardware->checkHealth(); if (status != StatusCode::OK) { ALOGE("VHAL check health returns non-okay status"); return; diff --git a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp index 21bfba6e3a..26944018df 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp @@ -16,8 +16,11 @@ #include "SubscriptionManager.h" -#include +#include #include +#include + +#include namespace android { namespace hardware { @@ -31,33 +34,21 @@ 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; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::base::Error; using ::android::base::Result; +using ::android::base::StringPrintf; using ::ndk::ScopedAStatus; -bool SubscriptionManager::PropIdAreaId::operator==(const PropIdAreaId& other) const { - return areaId == other.areaId && propId == other.propId; -} - -size_t SubscriptionManager::PropIdAreaIdHash::operator()(PropIdAreaId const& propIdAreaId) const { - size_t res = 0; - hashCombine(res, propIdAreaId.propId); - hashCombine(res, propIdAreaId.areaId); - return res; -} - -SubscriptionManager::SubscriptionManager(GetValueFunc&& action) - : mTimer(std::make_shared()), mGetValue(std::move(action)) {} +SubscriptionManager::SubscriptionManager(IVehicleHardware* hardware) : mVehicleHardware(hardware) {} SubscriptionManager::~SubscriptionManager() { std::scoped_lock lockGuard(mLock); mClientsByPropIdArea.clear(); - // RecurrentSubscription has reference to mGetValue, so it must be destroyed before mGetValue is - // destroyed. - mSubscriptionsByClient.clear(); + mSubscribedPropsByClient.clear(); } bool SubscriptionManager::checkSampleRate(float sampleRate) { @@ -76,9 +67,84 @@ Result SubscriptionManager::getInterval(float sampleRate) { return interval; } -Result SubscriptionManager::subscribe(const std::shared_ptr& callback, - const std::vector& options, - bool isContinuousProperty) { +void ContSubConfigs::refreshMaxSampleRate() { + float maxSampleRate = 0.; + // This is not called frequently so a brute-focre is okay. More efficient way exists but this + // is simpler. + for (const auto& [_, sampleRate] : mSampleRates) { + if (sampleRate > maxSampleRate) { + maxSampleRate = sampleRate; + } + } + mMaxSampleRate = maxSampleRate; +} + +void ContSubConfigs::addClient(const ClientIdType& clientId, float sampleRate) { + mSampleRates[clientId] = sampleRate; + refreshMaxSampleRate(); +} + +void ContSubConfigs::removeClient(const ClientIdType& clientId) { + mSampleRates.erase(clientId); + refreshMaxSampleRate(); +} + +float ContSubConfigs::getMaxSampleRate() { + return mMaxSampleRate; +} + +VhalResult SubscriptionManager::updateSampleRateLocked(const ClientIdType& clientId, + const PropIdAreaId& propIdAreaId, + float sampleRate) { + // Make a copy so that we don't modify 'mContSubConfigsByPropIdArea' on failure cases. + ContSubConfigs infoCopy = mContSubConfigsByPropIdArea[propIdAreaId]; + infoCopy.addClient(clientId, sampleRate); + if (infoCopy.getMaxSampleRate() == + mContSubConfigsByPropIdArea[propIdAreaId].getMaxSampleRate()) { + mContSubConfigsByPropIdArea[propIdAreaId] = infoCopy; + return {}; + } + float newRate = infoCopy.getMaxSampleRate(); + int32_t propId = propIdAreaId.propId; + int32_t areaId = propIdAreaId.areaId; + if (auto status = mVehicleHardware->updateSampleRate(propId, areaId, newRate); + status != StatusCode::OK) { + return StatusError(status) << StringPrintf("failed to update sample rate for prop: %" PRId32 + ", area" + ": %" PRId32 ", sample rate: %f", + propId, areaId, newRate); + } + mContSubConfigsByPropIdArea[propIdAreaId] = infoCopy; + return {}; +} + +VhalResult SubscriptionManager::removeSampleRateLocked(const ClientIdType& clientId, + const PropIdAreaId& propIdAreaId) { + // Make a copy so that we don't modify 'mContSubConfigsByPropIdArea' on failure cases. + ContSubConfigs infoCopy = mContSubConfigsByPropIdArea[propIdAreaId]; + infoCopy.removeClient(clientId); + if (infoCopy.getMaxSampleRate() == + mContSubConfigsByPropIdArea[propIdAreaId].getMaxSampleRate()) { + mContSubConfigsByPropIdArea[propIdAreaId] = infoCopy; + return {}; + } + float newRate = infoCopy.getMaxSampleRate(); + int32_t propId = propIdAreaId.propId; + int32_t areaId = propIdAreaId.areaId; + if (auto status = mVehicleHardware->updateSampleRate(propId, areaId, newRate); + status != StatusCode::OK) { + return StatusError(status) << StringPrintf("failed to update sample rate for prop: %" PRId32 + ", area" + ": %" PRId32 ", sample rate: %f", + propId, areaId, newRate); + } + mContSubConfigsByPropIdArea[propIdAreaId] = infoCopy; + return {}; +} + +VhalResult SubscriptionManager::subscribe(const std::shared_ptr& callback, + const std::vector& options, + bool isContinuousProperty) { std::scoped_lock lockGuard(mLock); std::vector intervals; @@ -88,109 +154,108 @@ Result SubscriptionManager::subscribe(const std::shared_ptrasBinder().get(); + for (const auto& option : options) { int32_t propId = option.propId; const std::vector& areaIds = option.areaIds; - int64_t interval = 0; - if (isContinuousProperty) { - interval = intervals[intervalIndex]; - intervalIndex++; - } for (int32_t areaId : areaIds) { PropIdAreaId propIdAreaId = { .propId = propId, .areaId = areaId, }; if (isContinuousProperty) { - VehiclePropValue propValueRequest{ - .prop = propId, - .areaId = areaId, - }; - mSubscriptionsByClient[clientId][propIdAreaId] = - std::make_unique( - mTimer, - [this, callback, propValueRequest] { - mGetValue(callback, propValueRequest); - }, - interval); - } else { - mSubscriptionsByClient[clientId][propIdAreaId] = - std::make_unique(); + if (auto result = updateSampleRateLocked(clientId, propIdAreaId, option.sampleRate); + !result.ok()) { + return result; + } } + + mSubscribedPropsByClient[clientId].insert(propIdAreaId); mClientsByPropIdArea[propIdAreaId][clientId] = callback; } } return {}; } -Result SubscriptionManager::unsubscribe(SubscriptionManager::ClientIdType clientId, - const std::vector& propIds) { +VhalResult SubscriptionManager::unsubscribe(SubscriptionManager::ClientIdType clientId, + const std::vector& propIds) { std::scoped_lock lockGuard(mLock); - if (mSubscriptionsByClient.find(clientId) == mSubscriptionsByClient.end()) { - return Error() << "No property was subscribed for the callback"; + if (mSubscribedPropsByClient.find(clientId) == mSubscribedPropsByClient.end()) { + return StatusError(StatusCode::INVALID_ARG) + << "No property was subscribed for the callback"; } std::unordered_set subscribedPropIds; - for (auto const& [propIdAreaId, _] : mSubscriptionsByClient[clientId]) { + for (auto const& propIdAreaId : mSubscribedPropsByClient[clientId]) { subscribedPropIds.insert(propIdAreaId.propId); } for (int32_t propId : propIds) { if (subscribedPropIds.find(propId) == subscribedPropIds.end()) { - return Error() << "property ID: " << propId << " is not subscribed"; + return StatusError(StatusCode::INVALID_ARG) + << "property ID: " << propId << " is not subscribed"; } } - auto& subscriptions = mSubscriptionsByClient[clientId]; - auto it = subscriptions.begin(); - while (it != subscriptions.end()) { - int32_t propId = it->first.propId; + 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()) { - auto& clients = mClientsByPropIdArea[it->first]; + if (auto result = removeSampleRateLocked(clientId, *it); !result.ok()) { + return result; + } + + auto& clients = mClientsByPropIdArea[*it]; clients.erase(clientId); if (clients.empty()) { - mClientsByPropIdArea.erase(it->first); + mClientsByPropIdArea.erase(*it); + mContSubConfigsByPropIdArea.erase(*it); } - it = subscriptions.erase(it); + it = propIdAreaIds.erase(it); } else { it++; } } - if (subscriptions.empty()) { - mSubscriptionsByClient.erase(clientId); + if (propIdAreaIds.empty()) { + mSubscribedPropsByClient.erase(clientId); } return {}; } -Result SubscriptionManager::unsubscribe(SubscriptionManager::ClientIdType clientId) { +VhalResult SubscriptionManager::unsubscribe(SubscriptionManager::ClientIdType clientId) { std::scoped_lock lockGuard(mLock); - if (mSubscriptionsByClient.find(clientId) == mSubscriptionsByClient.end()) { - return Error() << "No property was subscribed for this client"; + if (mSubscribedPropsByClient.find(clientId) == mSubscribedPropsByClient.end()) { + return StatusError(StatusCode::INVALID_ARG) << "No property was subscribed for this client"; } - auto& subscriptions = mSubscriptionsByClient[clientId]; - for (auto const& [propIdAreaId, _] : subscriptions) { + auto& subscriptions = mSubscribedPropsByClient[clientId]; + for (auto const& propIdAreaId : subscriptions) { + if (auto result = removeSampleRateLocked(clientId, propIdAreaId); !result.ok()) { + return result; + } + auto& clients = mClientsByPropIdArea[propIdAreaId]; clients.erase(clientId); if (clients.empty()) { mClientsByPropIdArea.erase(propIdAreaId); + mContSubConfigsByPropIdArea.erase(propIdAreaId); } } - mSubscriptionsByClient.erase(clientId); + mSubscribedPropsByClient.erase(clientId); return {}; } @@ -208,10 +273,8 @@ SubscriptionManager::getSubscribedClients(const std::vector& u if (mClientsByPropIdArea.find(propIdAreaId) == mClientsByPropIdArea.end()) { continue; } - for (const auto& [clientId, client] : mClientsByPropIdArea[propIdAreaId]) { - if (!mSubscriptionsByClient[clientId][propIdAreaId]->isOnChange()) { - continue; - } + + for (const auto& [_, client] : mClientsByPropIdArea[propIdAreaId]) { clients[client].push_back(&value); } } @@ -220,25 +283,7 @@ SubscriptionManager::getSubscribedClients(const std::vector& u bool SubscriptionManager::isEmpty() { std::scoped_lock lockGuard(mLock); - return mSubscriptionsByClient.empty() && mClientsByPropIdArea.empty(); -} - -SubscriptionManager::RecurrentSubscription::RecurrentSubscription( - std::shared_ptr timer, std::function&& action, int64_t interval) - : mAction(std::make_shared>(action)), mTimer(timer) { - mTimer->registerTimerCallback(interval, mAction); -} - -SubscriptionManager::RecurrentSubscription::~RecurrentSubscription() { - mTimer->unregisterTimerCallback(mAction); -} - -bool SubscriptionManager::RecurrentSubscription::isOnChange() { - return false; -} - -bool SubscriptionManager::OnChangeSubscription::isOnChange() { - return true; + return mSubscribedPropsByClient.empty() && mClientsByPropIdArea.empty(); } } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 49f5b7e435..f48b906503 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -1308,25 +1308,7 @@ TEST_F(DefaultVehicleHalTest, testSubscribeAreaOnChangeAllAreas) { TEST_F(DefaultVehicleHalTest, testSubscribeGlobalContinuous) { VehiclePropValue testValue{ .prop = GLOBAL_CONTINUOUS_PROP, - .value.int32Values = {0}, }; - // Set responses for all the hardware getValues requests. - getHardware()->setGetValueResponder( - [](std::shared_ptr callback, - const std::vector& requests) { - std::vector results; - for (auto& request : requests) { - VehiclePropValue prop = request.prop; - prop.value.int32Values = {0}; - results.push_back({ - .requestId = request.requestId, - .status = StatusCode::OK, - .prop = prop, - }); - } - (*callback)(results); - return StatusCode::OK; - }); std::vector options = { { @@ -1353,28 +1335,6 @@ TEST_F(DefaultVehicleHalTest, testSubscribeGlobalContinuous) { } TEST_F(DefaultVehicleHalTest, testSubscribeGlobalContinuousRateOutOfRange) { - VehiclePropValue testValue{ - .prop = GLOBAL_CONTINUOUS_PROP, - .value.int32Values = {0}, - }; - // Set responses for all the hardware getValues requests. - getHardware()->setGetValueResponder( - [](std::shared_ptr callback, - const std::vector& requests) { - std::vector results; - for (auto& request : requests) { - VehiclePropValue prop = request.prop; - prop.value.int32Values = {0}; - results.push_back({ - .requestId = request.requestId, - .status = StatusCode::OK, - .prop = prop, - }); - } - (*callback)(results); - return StatusCode::OK; - }); - // The maxSampleRate is 100, so the sample rate should be the default max 100. std::vector options = { { @@ -1398,24 +1358,6 @@ TEST_F(DefaultVehicleHalTest, testSubscribeGlobalContinuousRateOutOfRange) { } TEST_F(DefaultVehicleHalTest, testSubscribeAreaContinuous) { - // Set responses for all the hardware getValues requests. - getHardware()->setGetValueResponder( - [](std::shared_ptr callback, - const std::vector& requests) { - std::vector results; - for (auto& request : requests) { - VehiclePropValue prop = request.prop; - prop.value.int32Values = {0}; - results.push_back({ - .requestId = request.requestId, - .status = StatusCode::OK, - .prop = prop, - }); - } - (*callback)(results); - return StatusCode::OK; - }); - std::vector options = { { .propId = AREA_CONTINUOUS_PROP, @@ -1436,6 +1378,8 @@ TEST_F(DefaultVehicleHalTest, testSubscribeAreaContinuous) { // Sleep for 1s, which should generate ~20 events. std::this_thread::sleep_for(std::chrono::seconds(1)); + getClient()->unsubscribe(getCallbackClient(), std::vector({AREA_CONTINUOUS_PROP})); + std::vector events; while (true) { auto maybeResults = getCallback()->nextOnPropertyEventResults(); @@ -1509,28 +1453,6 @@ TEST_F(DefaultVehicleHalTest, testUnsubscribeOnChange) { } TEST_F(DefaultVehicleHalTest, testUnsubscribeContinuous) { - VehiclePropValue testValue{ - .prop = GLOBAL_CONTINUOUS_PROP, - .value.int32Values = {0}, - }; - // Set responses for all the hardware getValues requests. - getHardware()->setGetValueResponder( - [](std::shared_ptr callback, - const std::vector& requests) { - std::vector results; - for (auto& request : requests) { - VehiclePropValue prop = request.prop; - prop.value.int32Values = {0}; - results.push_back({ - .requestId = request.requestId, - .status = StatusCode::OK, - .prop = prop, - }); - } - (*callback)(results); - return StatusCode::OK; - }); - std::vector options = { { .propId = GLOBAL_CONTINUOUS_PROP, @@ -1621,12 +1543,6 @@ TEST_F(DefaultVehicleHalTest, testHeartbeatEvent) { } TEST_F(DefaultVehicleHalTest, testOnBinderDiedUnlinked) { - // First subscribe to a continuous property so that we register a death recipient for our - // client. - VehiclePropValue testValue{ - .prop = GLOBAL_CONTINUOUS_PROP, - .value.int32Values = {0}, - }; // Set responses for all the hardware getValues requests. getHardware()->setGetValueResponder( [](std::shared_ptr callback, diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp index 66aef7c2da..4df4e1aea5 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp @@ -32,9 +32,14 @@ using ::aidl::android::hardware::automotive::vehicle::StatusCode; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; +MockVehicleHardware::MockVehicleHardware() { + mRecurrentTimer = std::make_unique(); +} + MockVehicleHardware::~MockVehicleHardware() { std::unique_lock lk(mLock); mCv.wait(lk, [this] { return mThreadCount == 0; }); + mRecurrentTimer.reset(); } std::vector MockVehicleHardware::getAllPropertyConfigs() const { @@ -83,6 +88,42 @@ StatusCode MockVehicleHardware::checkHealth() { return StatusCode::OK; } +StatusCode MockVehicleHardware::updateSampleRate(int32_t propId, int32_t areaId, float sampleRate) { + std::shared_ptr> action; + + { + std::scoped_lock lockGuard(mLock); + if (mRecurrentActions[propId][areaId] != nullptr) { + // 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. + const PropertyChangeCallback* propertyChangeCallback = mPropertyChangeCallback.get(); + action = std::make_shared>([propertyChangeCallback, propId, areaId] { + std::vector values = { + { + .prop = propId, + .areaId = areaId, + }, + }; + (*propertyChangeCallback)(values); + }); + // Store the action in a map so that we could remove the action later. + mRecurrentActions[propId][areaId] = action; + } + + // In mock implementation, we generate a new property change event for this property at sample + // rate. + int64_t interval = static_cast(1'000'000'000. / sampleRate); + mRecurrentTimer->registerTimerCallback(interval, action); + return StatusCode::OK; +} + void MockVehicleHardware::registerOnPropertyChangeEvent( std::unique_ptr callback) { std::scoped_lock lockGuard(mLock); diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h index cb8b6a03f3..743841c216 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h @@ -18,6 +18,7 @@ #define android_hardware_automotive_vehicle_aidl_impl_vhal_test_MockVehicleHardware_H_ #include +#include #include #include @@ -38,6 +39,8 @@ namespace vehicle { class MockVehicleHardware final : public IVehicleHardware { public: + MockVehicleHardware(); + ~MockVehicleHardware(); std::vector @@ -55,6 +58,8 @@ class MockVehicleHardware final : public IVehicleHardware { void registerOnPropertyChangeEvent( std::unique_ptr callback) override; void registerOnPropertySetErrorEvent(std::unique_ptr) override; + aidl::android::hardware::automotive::vehicle::StatusCode updateSampleRate( + int32_t propId, int32_t areaId, float sampleRate) override; // Test functions. void setPropertyConfigs( @@ -117,6 +122,11 @@ class MockVehicleHardware final : public IVehicleHardware { std::list>* storedResponses) const REQUIRES(mLock); DumpResult mDumpResult; + + // RecurrentTimer is thread-safe. + std::shared_ptr mRecurrentTimer; + std::unordered_map>>> + mRecurrentActions GUARDED_BY(mLock); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp index 2a468f608f..3f593633f9 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp @@ -16,6 +16,7 @@ #include "SubscriptionManager.h" +#include #include #include @@ -86,19 +87,21 @@ class PropertyCallback final : public BnVehicleCallback { class SubscriptionManagerTest : public testing::Test { public: void SetUp() override { - mManager = std::make_unique( - [](const std::shared_ptr& callback, - const VehiclePropValue& value) { - callback->onPropertyEvent( - VehiclePropValues{ - .payloads = {value}, - }, - 0); - }); + mHardware = std::make_shared(); + mManager = std::make_unique(mHardware.get()); mCallback = ndk::SharedRefBase::make(); // Keep the local binder alive. mBinder = mCallback->asBinder(); mCallbackClient = IVehicleCallback::fromBinder(mBinder); + std::shared_ptr callbackClient = mCallbackClient; + mHardware->registerOnPropertyChangeEvent( + std::make_unique( + [callbackClient](std::vector updatedValues) { + VehiclePropValues values = { + .payloads = std::move(updatedValues), + }; + callbackClient->onPropertyEvent(values, 0); + })); } SubscriptionManager* getManager() { return mManager.get(); } @@ -115,6 +118,7 @@ class SubscriptionManagerTest : public testing::Test { std::unique_ptr mManager; std::shared_ptr mCallback; std::shared_ptr mCallbackClient; + std::shared_ptr mHardware; SpAIBinder mBinder; }; -- GitLab From 62cf454638bc6ce5841e493125b91bc60065bbcc Mon Sep 17 00:00:00 2001 From: Tim Lin Date: Thu, 7 Apr 2022 09:33:45 +0800 Subject: [PATCH 728/825] fix infinite loop in enableModem TC Bug: 227585563 Test: run vts -m VtsHalRadioTargetTest Change-Id: I879faa5ecef026865d17ad1a23e52cb9f8f70454 --- radio/aidl/vts/radio_modem_response.cpp | 1 + radio/aidl/vts/radio_modem_utils.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/radio/aidl/vts/radio_modem_response.cpp b/radio/aidl/vts/radio_modem_response.cpp index d2715a8198..20b44c5831 100644 --- a/radio/aidl/vts/radio_modem_response.cpp +++ b/radio/aidl/vts/radio_modem_response.cpp @@ -24,6 +24,7 @@ ndk::ScopedAStatus RadioModemResponse::acknowledgeRequest(int32_t /*serial*/) { ndk::ScopedAStatus RadioModemResponse::enableModemResponse(const RadioResponseInfo& info) { rspInfo = info; + enableModemResponseToggle = !enableModemResponseToggle; parent_modem.notify(info.serial); return ndk::ScopedAStatus::ok(); } diff --git a/radio/aidl/vts/radio_modem_utils.h b/radio/aidl/vts/radio_modem_utils.h index 8779e0cbd2..49e1891212 100644 --- a/radio/aidl/vts/radio_modem_utils.h +++ b/radio/aidl/vts/radio_modem_utils.h @@ -37,7 +37,7 @@ class RadioModemResponse : public BnRadioModemResponse { RadioResponseInfo rspInfo; bool isModemEnabled; - bool enableModemResponseToggle; + bool enableModemResponseToggle = false; virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; -- GitLab From c19a0bb019493a3d868ae0bc8ff1da87132bcf8e Mon Sep 17 00:00:00 2001 From: Tim Lin Date: Thu, 7 Apr 2022 01:25:37 +0800 Subject: [PATCH 729/825] set SIM slots mapping based on current mapping If we set the SIM slots mapping arbitrarily on single SIM enabled device, the SIM state could become absent and cause other TCs fail. Bug: 227693614 Test: run vts -m VtsHalRadioTargetTest Change-Id: I2c8d3a162e1dca5a0bd6cfe93a1cc269f4c25188 --- radio/aidl/vts/radio_config_test.cpp | 77 +++++++++++++++++++--------- 1 file changed, 53 insertions(+), 24 deletions(-) diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp index 5e1c811d91..2309f9ef7e 100644 --- a/radio/aidl/vts/radio_config_test.cpp +++ b/radio/aidl/vts/radio_config_test.cpp @@ -166,31 +166,60 @@ TEST_P(RadioConfigTest, setPreferredDataModem_invalidArgument) { * Test IRadioConfig.setSimSlotsMapping() for the response returned. */ TEST_P(RadioConfigTest, setSimSlotsMapping) { - serial = GetRandomSerialNumber(); - SlotPortMapping slotPortMapping; - slotPortMapping.physicalSlotId = 0; - slotPortMapping.portId = 0; - std::vector slotPortMappingList = {slotPortMapping}; - if (isDsDsEnabled()) { - slotPortMapping.physicalSlotId = 1; - slotPortMappingList.push_back(slotPortMapping); - } else if (isTsTsEnabled()) { - slotPortMapping.physicalSlotId = 1; - slotPortMappingList.push_back(slotPortMapping); - slotPortMapping.physicalSlotId = 2; - slotPortMappingList.push_back(slotPortMapping); - } - ndk::ScopedAStatus res = radio_config->setSimSlotsMapping(serial, slotPortMappingList); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type); - EXPECT_EQ(serial, radioRsp_config->rspInfo.serial); - ALOGI("setSimSlotsMapping, rspInfo.error = %s\n", - toString(radioRsp_config->rspInfo.error).c_str()); - ASSERT_TRUE(CheckAnyOfErrors(radioRsp_config->rspInfo.error, {RadioError::NONE})); + // get slot status and set SIM slots mapping based on the result. + updateSimSlotStatus(); + if (radioRsp_config->rspInfo.error == RadioError::NONE) { + SlotPortMapping slotPortMapping; + // put invalid value at first and adjust by slotStatusResponse. + slotPortMapping.physicalSlotId = -1; + slotPortMapping.portId = -1; + std::vector slotPortMappingList = {slotPortMapping}; + if (isDsDsEnabled()) { + slotPortMappingList.push_back(slotPortMapping); + } else if (isTsTsEnabled()) { + slotPortMappingList.push_back(slotPortMapping); + slotPortMappingList.push_back(slotPortMapping); + } + for (size_t i = 0; i < radioRsp_config->simSlotStatus.size(); i++) { + ASSERT_TRUE(radioRsp_config->simSlotStatus[i].portInfo.size() > 0); + for (size_t j = 0; j < radioRsp_config->simSlotStatus[i].portInfo.size(); j++) { + if (radioRsp_config->simSlotStatus[i].portInfo[j].portActive) { + int32_t logicalSlotId = + radioRsp_config->simSlotStatus[i].portInfo[j].logicalSlotId; + // logicalSlotId should be 0 or positive numbers if the port + // is active. + EXPECT_GE(logicalSlotId, 0); + // logicalSlotId should be less than the maximum number of + // supported SIM slots. + EXPECT_LT(logicalSlotId, slotPortMappingList.size()); + if (logicalSlotId >= 0 && logicalSlotId < slotPortMappingList.size()) { + slotPortMappingList[logicalSlotId].physicalSlotId = i; + slotPortMappingList[logicalSlotId].portId = j; + } + } + } + } - // Give some time for modem to fully switch SIM configuration - sleep(MODEM_SET_SIM_SLOT_MAPPING_DELAY_IN_SECONDS); + // set SIM slots mapping + for (size_t i = 0; i < slotPortMappingList.size(); i++) { + // physicalSlotId and portId should be 0 or positive numbers for the + // input of setSimSlotsMapping. + EXPECT_GE(slotPortMappingList[i].physicalSlotId, 0); + EXPECT_GE(slotPortMappingList[i].portId, 0); + } + serial = GetRandomSerialNumber(); + ndk::ScopedAStatus res = radio_config->setSimSlotsMapping(serial, slotPortMappingList); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type); + EXPECT_EQ(serial, radioRsp_config->rspInfo.serial); + ALOGI("setSimSlotsMapping, rspInfo.error = %s\n", + toString(radioRsp_config->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_config->rspInfo.error, {RadioError::NONE})); + + // Give some time for modem to fully switch SIM configuration + sleep(MODEM_SET_SIM_SLOT_MAPPING_DELAY_IN_SECONDS); + } } /* -- GitLab From 4370ecf4e74cfbe6dee9edd2cfef00ba2c37430d Mon Sep 17 00:00:00 2001 From: Tim Lin Date: Fri, 8 Apr 2022 22:54:48 +0800 Subject: [PATCH 730/825] wait for response before running next TC All TCs store RadioResponseInfo in a shared variable and read it to verify the result. So there is race condition problem if we don't wait for responses. Bug: 228593077 Test: run vts -m VtsHalRadioTargetTest Change-Id: I45e60f324926588c55abd0a719fd55352767a3eb --- radio/aidl/vts/radio_config_test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp index 2309f9ef7e..81d87d23c4 100644 --- a/radio/aidl/vts/radio_config_test.cpp +++ b/radio/aidl/vts/radio_config_test.cpp @@ -59,6 +59,7 @@ TEST_P(RadioConfigTest, getHalDeviceCapabilities) { serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = radio_config->getHalDeviceCapabilities(serial); ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); ALOGI("getHalDeviceCapabilities, rspInfo.error = %s\n", toString(radioRsp_config->rspInfo.error).c_str()); } @@ -70,6 +71,7 @@ TEST_P(RadioConfigTest, getSimSlotsStatus) { serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = radio_config->getSimSlotsStatus(serial); ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); ALOGI("getSimSlotsStatus, rspInfo.error = %s\n", toString(radioRsp_config->rspInfo.error).c_str()); } -- GitLab From 926d66ed0098f28af8ce83eb6bf0ede2c970e253 Mon Sep 17 00:00:00 2001 From: Rambo Wang Date: Mon, 28 Mar 2022 15:29:15 -0700 Subject: [PATCH 731/825] Add VTS test case to cover multiple RANs per request Test IRadioNetwork.setSignalStrengthReportingCriteria should support multiple RANs per request. Bug: 206857183 Test: atest VtsHalRadioTargetTest Change-Id: I9d48029b4c2f5c36c7f48c9712c17dbdcf890dc4 --- radio/aidl/vts/radio_network_test.cpp | 83 +++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp index e1d508d1d3..0bae3748da 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -591,6 +591,89 @@ TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_NGRAN_SSSINR) { {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } +/* + * Test IRadioNetwork.setSignalStrengthReportingCriteria() for multi-RANs per request + */ +TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_multiRansPerRequest) { + SignalThresholdInfo signalThresholdInfoGeran; + signalThresholdInfoGeran.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSI; + signalThresholdInfoGeran.hysteresisMs = 5000; + signalThresholdInfoGeran.hysteresisDb = 2; + signalThresholdInfoGeran.thresholds = {-109, -103, -97, -89}; + signalThresholdInfoGeran.isEnabled = true; + signalThresholdInfoGeran.ran = AccessNetwork::GERAN; + + SignalThresholdInfo signalThresholdInfoUtran; + signalThresholdInfoUtran.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSCP; + signalThresholdInfoUtran.hysteresisMs = 5000; + signalThresholdInfoUtran.hysteresisDb = 2; + signalThresholdInfoUtran.thresholds = {-110, -97, -73, -49, -25}; + signalThresholdInfoUtran.isEnabled = true; + signalThresholdInfoUtran.ran = AccessNetwork::UTRAN; + + SignalThresholdInfo signalThresholdInfoEutran; + signalThresholdInfoEutran.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSRP; + signalThresholdInfoEutran.hysteresisMs = 5000; + signalThresholdInfoEutran.hysteresisDb = 2; + signalThresholdInfoEutran.thresholds = {-128, -108, -88, -68}; + signalThresholdInfoEutran.isEnabled = true; + signalThresholdInfoEutran.ran = AccessNetwork::EUTRAN; + + SignalThresholdInfo signalThresholdInfoCdma2000; + signalThresholdInfoCdma2000.signalMeasurement = + SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSI; + signalThresholdInfoCdma2000.hysteresisMs = 5000; + signalThresholdInfoCdma2000.hysteresisDb = 2; + signalThresholdInfoCdma2000.thresholds = {-105, -90, -75, -65}; + signalThresholdInfoCdma2000.isEnabled = true; + signalThresholdInfoCdma2000.ran = AccessNetwork::CDMA2000; + + SignalThresholdInfo signalThresholdInfoNgran; + signalThresholdInfoNgran.signalMeasurement = + SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_SSRSRP; + signalThresholdInfoNgran.hysteresisMs = 5000; + signalThresholdInfoNgran.hysteresisDb = 0; + signalThresholdInfoNgran.thresholds = {-105, -90, -75, -65}; + signalThresholdInfoNgran.isEnabled = true; + signalThresholdInfoNgran.ran = AccessNetwork::NGRAN; + + const static std::vector candidateSignalThresholdInfos = { + signalThresholdInfoGeran, signalThresholdInfoUtran, signalThresholdInfoEutran, + signalThresholdInfoCdma2000, signalThresholdInfoNgran}; + + std::vector supportedSignalThresholdInfos; + for (size_t i = 0; i < candidateSignalThresholdInfos.size(); i++) { + serial = GetRandomSerialNumber(); + ndk::ScopedAStatus res = radio_network->setSignalStrengthReportingCriteria( + serial, {candidateSignalThresholdInfos[i]}); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + if (radioRsp_network->rspInfo.error == RadioError::NONE) { + supportedSignalThresholdInfos.push_back(signalThresholdInfoGeran); + } else { + // Refer to IRadioNetworkResponse#setSignalStrengthReportingCriteriaResponse + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::INVALID_ARGUMENTS, RadioError::RADIO_NOT_AVAILABLE})); + } + } + + ASSERT_FALSE(supportedSignalThresholdInfos.empty()); + + serial = GetRandomSerialNumber(); + ndk::ScopedAStatus res = radio_network->setSignalStrengthReportingCriteria( + serial, supportedSignalThresholdInfos); + 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); + + ALOGI("setSignalStrengthReportingCriteria_multiRansPerRequest, rspInfo.error = %s\n", + toString(radioRsp_network->rspInfo.error).c_str()); + + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE})); +} + /* * Test IRadioNetwork.setLinkCapacityReportingCriteria() invalid hysteresisDlKbps */ -- GitLab From d69c54a4e1ec9a6b2f1de111c84388562361dc99 Mon Sep 17 00:00:00 2001 From: Rachel Lee Date: Thu, 7 Apr 2022 15:22:15 -0700 Subject: [PATCH 732/825] Move ComposerServiceWriter to composer3. It can be reused more easily. Bug: 216204575 Test: m; flashall Change-Id: I76b8533ba16ad1d01fcd182bf72b65982dce7c20 --- .../composer3/ComposerServiceWriter.h | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerServiceWriter.h diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerServiceWriter.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerServiceWriter.h new file mode 100644 index 0000000000..34cda6a770 --- /dev/null +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerServiceWriter.h @@ -0,0 +1,128 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "Util.h" + +namespace aidl::android::hardware::graphics::composer3::impl { + +class ComposerServiceWriter { + public: + ComposerServiceWriter() { reset(); } + + virtual ~ComposerServiceWriter() { reset(); } + + void reset() { mCommandsResults.clear(); } + + void setError(int32_t index, int32_t errorCode) { + CommandError error; + error.commandIndex = index; + error.errorCode = errorCode; + mCommandsResults.emplace_back(std::move(error)); + } + + void setPresentOrValidateResult(int64_t display, PresentOrValidate::Result result) { + PresentOrValidate presentOrValidate; + presentOrValidate.display = display; + presentOrValidate.result = result; + mCommandsResults.emplace_back(std::move(presentOrValidate)); + } + + void setChangedCompositionTypes(int64_t display, const std::vector& layers, + const std::vector& types) { + ChangedCompositionTypes changedCompositionTypes; + changedCompositionTypes.display = display; + changedCompositionTypes.layers.reserve(layers.size()); + for (int i = 0; i < layers.size(); i++) { + auto layer = ChangedCompositionLayer{.layer = layers[i], .composition = types[i]}; + changedCompositionTypes.layers.emplace_back(std::move(layer)); + } + mCommandsResults.emplace_back(std::move(changedCompositionTypes)); + } + + void setDisplayRequests(int64_t display, int32_t displayRequestMask, + const std::vector& layers, + const std::vector& layerRequestMasks) { + DisplayRequest displayRequest; + displayRequest.display = display; + displayRequest.mask = displayRequestMask; + displayRequest.layerRequests.reserve(layers.size()); + for (int i = 0; i < layers.size(); i++) { + auto layerRequest = + DisplayRequest::LayerRequest{.layer = layers[i], .mask = layerRequestMasks[i]}; + displayRequest.layerRequests.emplace_back(std::move(layerRequest)); + } + mCommandsResults.emplace_back(std::move(displayRequest)); + } + + void setPresentFence(int64_t display, ::ndk::ScopedFileDescriptor presentFence) { + if (presentFence.get() >= 0) { + PresentFence presentFenceCommand; + presentFenceCommand.fence = std::move(presentFence); + presentFenceCommand.display = display; + mCommandsResults.emplace_back(std::move(presentFenceCommand)); + } else { + LOG(WARNING) << __func__ << ": invalid present fence " << presentFence.get(); + } + } + + void setReleaseFences(int64_t display, const std::vector& layers, + std::vector<::ndk::ScopedFileDescriptor> releaseFences) { + ReleaseFences releaseFencesCommand; + releaseFencesCommand.display = display; + for (int i = 0; i < layers.size(); i++) { + if (releaseFences[i].get() >= 0) { + ReleaseFences::Layer layer; + layer.layer = layers[i]; + layer.fence = std::move(releaseFences[i]); + releaseFencesCommand.layers.emplace_back(std::move(layer)); + } else { + LOG(WARNING) << __func__ << ": invalid release fence " << releaseFences[i].get(); + } + } + mCommandsResults.emplace_back(std::move(releaseFencesCommand)); + } + + void setClientTargetProperty(int64_t display, const ClientTargetProperty& clientTargetProperty, + float brightness, const DimmingStage& dimmingStage) { + ClientTargetPropertyWithBrightness clientTargetPropertyWithBrightness; + clientTargetPropertyWithBrightness.display = display; + clientTargetPropertyWithBrightness.clientTargetProperty = clientTargetProperty; + clientTargetPropertyWithBrightness.brightness = brightness; + clientTargetPropertyWithBrightness.dimmingStage = dimmingStage; + mCommandsResults.emplace_back(std::move(clientTargetPropertyWithBrightness)); + } + + std::vector getPendingCommandResults() { + return std::move(mCommandsResults); + } + + private: + std::vector mCommandsResults; +}; + +} // namespace aidl::android::hardware::graphics::composer3::impl \ No newline at end of file -- GitLab From 6923449c42b6a237f474892d94dd5c85db2726c2 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 5 Apr 2022 02:03:53 +0000 Subject: [PATCH 733/825] Make FakeVehicleHardware async. Use a handler thread to handle all the get/set value requests in FakeVehicleHardware to make it async. Vendor implementation should use similar logic to make their VHAL async. Test: atest FakeVehicleHardwareTest Bug: 226001897 Change-Id: Iba95125e63566c27597b9d11bff131c229846d49 --- .../hardware/include/FakeVehicleHardware.h | 37 +++++ .../hardware/src/FakeVehicleHardware.cpp | 155 +++++++++++++----- .../hardware/test/FakeVehicleHardwareTest.cpp | 54 +++++- 3 files changed, 199 insertions(+), 47 deletions(-) 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 892b4060bd..34b2b2454f 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -17,6 +17,7 @@ #ifndef android_hardware_automotive_vehicle_aidl_impl_fake_impl_hardware_include_FakeVehicleHardware_H_ #define android_hardware_automotive_vehicle_aidl_impl_fake_impl_hardware_include_FakeVehicleHardware_H_ +#include #include #include #include @@ -48,6 +49,8 @@ class FakeVehicleHardware : public IVehicleHardware { explicit FakeVehicleHardware(std::unique_ptr valuePool); + ~FakeVehicleHardware(); + // Get all the property configs. std::vector getAllPropertyConfigs() const override; @@ -102,6 +105,29 @@ class FakeVehicleHardware : public IVehicleHardware { // Expose private methods to unit test. friend class FakeVehicleHardwareTestHelper; + template + struct RequestWithCallback { + RequestType request; + std::shared_ptr callback; + }; + + template + class PendingRequestHandler { + public: + PendingRequestHandler(FakeVehicleHardware* hardware); + + void addRequest(RequestType request, std::shared_ptr callback); + + void stop(); + + private: + FakeVehicleHardware* mHardware; + std::thread mThread; + ConcurrentQueue> mRequests; + + void handleRequestsOnce(); + }; + const std::unique_ptr mFakeObd2Frame; const std::unique_ptr mFakeUserHal; // RecurrentTimer is thread-safe. @@ -111,6 +137,13 @@ class FakeVehicleHardware : public IVehicleHardware { std::unique_ptr mOnPropertySetErrorCallback GUARDED_BY(mLock); std::unordered_map, PropIdAreaIdHash> mRecurrentActions GUARDED_BY(mLock); + // PendingRequestHandler is thread-safe. + mutable PendingRequestHandler + mPendingGetValueRequests; + mutable PendingRequestHandler + mPendingSetValueRequests; void init(); // Stores the initial value to property store. @@ -170,6 +203,10 @@ class FakeVehicleHardware : public IVehicleHardware { android::base::Result checkArgumentsSize(const std::vector& options, size_t minSize); + aidl::android::hardware::automotive::vehicle::GetValueResult handleGetValueRequest( + const aidl::android::hardware::automotive::vehicle::GetValueRequest& request); + aidl::android::hardware::automotive::vehicle::SetValueResult handleSetValueRequest( + const aidl::android::hardware::automotive::vehicle::SetValueRequest& request); }; } // 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 8f8cc5cf23..1c2916c005 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -139,10 +139,17 @@ FakeVehicleHardware::FakeVehicleHardware(std::unique_ptr v mServerSidePropStore(new VehiclePropertyStore(mValuePool)), mFakeObd2Frame(new obd2frame::FakeObd2Frame(mServerSidePropStore)), mFakeUserHal(new FakeUserHal(mValuePool)), - mRecurrentTimer(new RecurrentTimer()) { + mRecurrentTimer(new RecurrentTimer()), + mPendingGetValueRequests(this), + mPendingSetValueRequests(this) { init(); } +FakeVehicleHardware::~FakeVehicleHardware() { + mPendingGetValueRequests.stop(); + mPendingSetValueRequests.stop(); +} + void FakeVehicleHardware::init() { for (auto& it : defaultconfig::getDefaultConfigs()) { VehiclePropConfig cfg = it.config; @@ -427,37 +434,25 @@ VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu StatusCode FakeVehicleHardware::setValues(std::shared_ptr callback, const std::vector& requests) { - std::vector results; for (auto& request : requests) { - const VehiclePropValue& value = request.value; - int propId = value.prop; - if (FAKE_VEHICLEHARDWARE_DEBUG) { - ALOGD("Set value for property ID: %d", propId); - } - - SetValueResult setValueResult; - setValueResult.requestId = request.requestId; - - if (auto result = setValue(value); !result.ok()) { - ALOGE("failed to set value, error: %s, code: %d", getErrorMsg(result).c_str(), - getIntErrorCode(result)); - setValueResult.status = getErrorCode(result); - } else { - setValueResult.status = StatusCode::OK; + ALOGD("Set value for property ID: %d", request.value.prop); } - results.push_back(std::move(setValueResult)); + // In a real VHAL implementation, you could either send the setValue request to vehicle bus + // here in the binder thread, or you could send the request in setValue which runs in + // the handler thread. If you decide to send the setValue request here, you should not + // wait for the response here and the handler thread should handle the setValue response. + mPendingSetValueRequests.addRequest(request, callback); } - // In the real vhal, the values will be sent to Car ECU. We just pretend it is done here and - // send back the updated property values to client. - (*callback)(std::move(results)); - return StatusCode::OK; } VhalResult FakeVehicleHardware::setValue(const VehiclePropValue& value) { + // In a real VHAL implementation, this will send the request to vehicle bus if not already + // sent in setValues, and wait for the response from vehicle bus. + // Here we are just updating mValuePool. bool isSpecialValue = false; auto setSpecialValueResult = maybeSetSpecialValue(value, &isSpecialValue); @@ -484,41 +479,59 @@ VhalResult FakeVehicleHardware::setValue(const VehiclePropValue& value) { return {}; } +SetValueResult FakeVehicleHardware::handleSetValueRequest(const SetValueRequest& request) { + SetValueResult setValueResult; + setValueResult.requestId = request.requestId; + + if (auto result = setValue(request.value); !result.ok()) { + ALOGE("failed to set value, error: %s, code: %d", getErrorMsg(result).c_str(), + getIntErrorCode(result)); + setValueResult.status = getErrorCode(result); + } else { + setValueResult.status = StatusCode::OK; + } + + return setValueResult; +} + StatusCode FakeVehicleHardware::getValues(std::shared_ptr callback, const std::vector& requests) const { - std::vector results; for (auto& request : requests) { - const VehiclePropValue& value = request.prop; - if (FAKE_VEHICLEHARDWARE_DEBUG) { - ALOGD("getValues(%d)", value.prop); + ALOGD("getValues(%d)", request.prop.prop); } - GetValueResult getValueResult; - getValueResult.requestId = request.requestId; - - auto result = getValue(value); - if (!result.ok()) { - ALOGE("failed to get value, error: %s, code: %d", getErrorMsg(result).c_str(), - getIntErrorCode(result)); - getValueResult.status = getErrorCode(result); - } else { - getValueResult.status = StatusCode::OK; - getValueResult.prop = *result.value(); - } - results.push_back(std::move(getValueResult)); + // In a real VHAL implementation, you could either send the getValue request to vehicle bus + // here in the binder thread, or you could send the request in getValue which runs in + // the handler thread. If you decide to send the getValue request here, you should not + // wait for the response here and the handler thread should handle the getValue response. + mPendingGetValueRequests.addRequest(request, callback); } - // In a real VHAL implementation, getValue would be async and we would call the callback after - // we actually received the values from vehicle bus. Here we are getting the result - // synchronously so we could call the callback here. - (*callback)(std::move(results)); - return StatusCode::OK; } +GetValueResult FakeVehicleHardware::handleGetValueRequest(const GetValueRequest& request) { + GetValueResult getValueResult; + getValueResult.requestId = request.requestId; + + auto result = getValue(request.prop); + if (!result.ok()) { + ALOGE("failed to get value, error: %s, code: %d", getErrorMsg(result).c_str(), + getIntErrorCode(result)); + getValueResult.status = getErrorCode(result); + } else { + getValueResult.status = StatusCode::OK; + getValueResult.prop = *result.value(); + } + return getValueResult; +} + FakeVehicleHardware::ValueResultType FakeVehicleHardware::getValue( const VehiclePropValue& value) const { + // In a real VHAL implementation, this will send the request to vehicle bus if not already + // sent in getValues, and wait for the response from vehicle bus. + // Here we are just reading value from mValuePool. bool isSpecialValue = false; auto result = maybeGetSpecialValue(value, &isSpecialValue); if (isSpecialValue) { @@ -971,6 +984,60 @@ Result> FakeVehicleHardware::parseHexString(const std::stri return bytes; } +template +FakeVehicleHardware::PendingRequestHandler::PendingRequestHandler( + FakeVehicleHardware* hardware) + : mHardware(hardware), mThread([this] { + while (mRequests.waitForItems()) { + handleRequestsOnce(); + } + }) {} + +template +void FakeVehicleHardware::PendingRequestHandler::addRequest( + RequestType request, std::shared_ptr callback) { + mRequests.push({ + request, + callback, + }); +} + +template +void FakeVehicleHardware::PendingRequestHandler::stop() { + mRequests.deactivate(); + if (mThread.joinable()) { + mThread.join(); + } +} + +template <> +void FakeVehicleHardware::PendingRequestHandler::handleRequestsOnce() { + std::unordered_map, std::vector> + callbackToResults; + for (const auto& rwc : mRequests.flush()) { + auto result = mHardware->handleGetValueRequest(rwc.request); + callbackToResults[rwc.callback].push_back(std::move(result)); + } + for (const auto& [callback, results] : callbackToResults) { + (*callback)(std::move(results)); + } +} + +template <> +void FakeVehicleHardware::PendingRequestHandler::handleRequestsOnce() { + std::unordered_map, std::vector> + callbackToResults; + for (const auto& rwc : mRequests.flush()) { + auto result = mHardware->handleSetValueRequest(rwc.request); + callbackToResults[rwc.callback].push_back(std::move(result)); + } + for (const auto& [callback, results] : callbackToResults) { + (*callback)(std::move(results)); + } +} + } // namespace fake } // namespace vehicle } // namespace automotive 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 8839c18e55..504940bb9a 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -34,6 +34,8 @@ #include #include #include +#include +#include #include namespace android { @@ -99,11 +101,51 @@ class FakeVehicleHardwareTest : public ::testing::Test { FakeVehicleHardware* getHardware() { return &mHardware; } StatusCode setValues(const std::vector& requests) { - return getHardware()->setValues(mSetValuesCallback, requests); + { + std::scoped_lock lockGuard(mLock); + for (const auto& request : requests) { + mPendingSetValueRequests.insert(request.requestId); + } + } + if (StatusCode status = getHardware()->setValues(mSetValuesCallback, requests); + status != StatusCode::OK) { + return status; + } + std::unique_lock lk(mLock); + // Wait for the onSetValueResults. + bool result = mCv.wait_for(lk, milliseconds(1000), [this] { + ScopedLockAssertion lockAssertion(mLock); + return mPendingSetValueRequests.size() == 0; + }); + if (!result) { + ALOGE("wait for callbacks for setValues timed-out"); + return StatusCode::INTERNAL_ERROR; + } + return StatusCode::OK; } StatusCode getValues(const std::vector& requests) { - return getHardware()->getValues(mGetValuesCallback, requests); + { + std::scoped_lock lockGuard(mLock); + for (const auto& request : requests) { + mPendingGetValueRequests.insert(request.requestId); + } + } + if (StatusCode status = getHardware()->getValues(mGetValuesCallback, requests); + status != StatusCode::OK) { + return status; + } + std::unique_lock lk(mLock); + // Wait for the onGetValueResults. + bool result = mCv.wait_for(lk, milliseconds(1000), [this] { + ScopedLockAssertion lockAssertion(mLock); + return mPendingGetValueRequests.size() == 0; + }); + if (!result) { + ALOGE("wait for callbacks for getValues timed-out"); + return StatusCode::INTERNAL_ERROR; + } + return StatusCode::OK; } StatusCode setValue(const VehiclePropValue& value) { @@ -167,7 +209,9 @@ class FakeVehicleHardwareTest : public ::testing::Test { std::scoped_lock lockGuard(mLock); for (auto& result : results) { mSetValueResults.push_back(result); + mPendingSetValueRequests.erase(result.requestId); } + mCv.notify_all(); } const std::vector& getSetValueResults() { @@ -179,7 +223,9 @@ class FakeVehicleHardwareTest : public ::testing::Test { std::scoped_lock lockGuard(mLock); for (auto& result : results) { mGetValueResults.push_back(result); + mPendingGetValueRequests.erase(result.requestId); } + mCv.notify_all(); } const std::vector& getGetValueResults() { @@ -197,7 +243,7 @@ class FakeVehicleHardwareTest : public ::testing::Test { }; mEventCount[propIdAreaId]++; } - mCv.notify_one(); + mCv.notify_all(); } const std::vector& getChangedProperties() { @@ -295,6 +341,8 @@ class FakeVehicleHardwareTest : public ::testing::Test { std::vector mSetValueResults GUARDED_BY(mLock); std::vector mGetValueResults GUARDED_BY(mLock); std::vector mChangedProperties GUARDED_BY(mLock); + std::unordered_set mPendingSetValueRequests GUARDED_BY(mLock); + std::unordered_set mPendingGetValueRequests GUARDED_BY(mLock); }; TEST_F(FakeVehicleHardwareTest, testGetAllPropertyConfigs) { -- GitLab From 4569ef55427c97c96d6fb333e64feccd458d5063 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 18 Mar 2022 14:34:25 -0700 Subject: [PATCH 734/825] Add VTS test for timestamp for AIDL backend. The expected behavior for timestamp was not clearly defined in HIDL. In AIDL, we add clearer definition based on the existing HIDL ref impl's behavior. This CL add VTS test to enforce these behavior for AIDL backend. Test: atest VtsHalAutomotiveVehicle_TargetTest Bug: 225191802 Change-Id: Ic208d6ac20cb7b820249c9b545c7b3a83528a1dd --- .../VtsHalAutomotiveVehicle_TargetTest.cpp | 106 +++++++++++++++++- 1 file changed, 100 insertions(+), 6 deletions(-) diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index c33f3e91d3..c431d85eef 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -67,6 +68,7 @@ class VtsVehicleCallback final : public ISubscriptionCallback { private: std::mutex mLock; std::unordered_map mEventsCount GUARDED_BY(mLock); + std::unordered_map> mEventTimestamps GUARDED_BY(mLock); std::condition_variable mEventCond; public: @@ -74,7 +76,9 @@ class VtsVehicleCallback final : public ISubscriptionCallback { { std::lock_guard lockGuard(mLock); for (auto& value : values) { - mEventsCount[value->getPropId()] += 1; + int32_t propId = value->getPropId(); + mEventsCount[propId] += 1; + mEventTimestamps[propId].push_back(value->getTimestamp()); } } mEventCond.notify_one(); @@ -94,6 +98,13 @@ class VtsVehicleCallback final : public ISubscriptionCallback { }); } + std::vector getEventTimestamps(int32_t propId) { + { + std::lock_guard lockGuard(mLock); + return mEventTimestamps[propId]; + } + } + void reset() { std::lock_guard lockGuard(mLock); mEventsCount.clear(); @@ -285,19 +296,59 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, subscribeAndUnsubscribe) { int32_t propId = toInt(VehicleProperty::PERF_VEHICLE_SPEED); - std::vector options = { - SubscribeOptions{.propId = propId, .sampleRate = 10.0}}; + auto propConfigsResult = mVhalClient->getPropConfigs({propId}); + + ASSERT_TRUE(propConfigsResult.ok()) << "Failed to get property config for PERF_VEHICLE_SPEED: " + << "error: " << propConfigsResult.error().message(); + ASSERT_EQ(propConfigsResult.value().size(), 1u) + << "Expect to return 1 config for PERF_VEHICLE_SPEED"; + auto& propConfig = propConfigsResult.value()[0]; + float minSampleRate = propConfig->getMinSampleRate(); + float maxSampleRate = propConfig->getMaxSampleRate(); + + if (minSampleRate < 1) { + GTEST_SKIP() << "Sample rate for vehicle speed < 1 times/sec, skip test since it would " + "take too long"; + } auto client = mVhalClient->getSubscriptionClient(mCallback); ASSERT_NE(client, nullptr) << "Failed to get subscription client"; - auto result = client->subscribe(options); + auto result = client->subscribe({{.propId = propId, .sampleRate = minSampleRate}}); ASSERT_TRUE(result.ok()) << StringPrintf("Failed to subscribe to property: %" PRId32 ", error: %s", propId, result.error().message().c_str()); - ASSERT_TRUE(mCallback->waitForExpectedEvents(propId, 10, std::chrono::seconds(10))) - << "Didn't get enough events for subscription"; + + if (mVhalClient->isAidlVhal()) { + // Skip checking timestamp for HIDL because the behavior for sample rate and timestamp is + // only specified clearly for AIDL. + + // Timeout is 2 seconds, which gives a 1 second buffer. + ASSERT_TRUE(mCallback->waitForExpectedEvents(propId, std::floor(minSampleRate), + std::chrono::seconds(2))) + << "Didn't get enough events for subscribing to minSampleRate"; + } + + result = client->subscribe({{.propId = propId, .sampleRate = maxSampleRate}}); + + ASSERT_TRUE(result.ok()) << StringPrintf("Failed to subscribe to property: %" PRId32 + ", error: %s", + propId, result.error().message().c_str()); + + if (mVhalClient->isAidlVhal()) { + ASSERT_TRUE(mCallback->waitForExpectedEvents(propId, std::floor(maxSampleRate), + std::chrono::seconds(2))) + << "Didn't get enough events for subscribing to maxSampleRate"; + + std::unordered_set timestamps; + // Event event should have a different timestamp. + for (const int64_t& eventTimestamp : mCallback->getEventTimestamps(propId)) { + ASSERT_TRUE(timestamps.find(eventTimestamp) == timestamps.end()) + << "two events for the same property must not have the same timestamp"; + timestamps.insert(eventTimestamp); + } + } result = client->unsubscribe({propId}); ASSERT_TRUE(result.ok()) << StringPrintf("Failed to unsubscribe to property: %" PRId32 @@ -325,6 +376,49 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, subscribeInvalidProp) { kInvalidProp); } +// Test the timestamp returned in GetValues results is the timestamp when the value is retrieved. +TEST_P(VtsHalAutomotiveVehicleTargetTest, testGetValuesTimestampAIDL) { + if (!mVhalClient->isAidlVhal()) { + GTEST_SKIP() << "Skip checking timestamp for HIDL because the behavior is only specified " + "for AIDL"; + } + + int32_t propId = toInt(VehicleProperty::PARKING_BRAKE_ON); + auto prop = mVhalClient->createHalPropValue(propId); + + auto result = mVhalClient->getValueSync(*prop); + + ASSERT_TRUE(result.ok()) << StringPrintf("Failed to get value for property: %" PRId32 + ", error: %s", + propId, result.error().message().c_str()); + ASSERT_NE(result.value(), nullptr) << "Result value must not be null"; + ASSERT_EQ(result.value()->getInt32Values().size(), 1u) << "Result must contain 1 int value"; + + bool parkBrakeOnValue1 = (result.value()->getInt32Values()[0] == 1); + int64_t timestampValue1 = result.value()->getTimestamp(); + + result = mVhalClient->getValueSync(*prop); + + ASSERT_TRUE(result.ok()) << StringPrintf("Failed to get value for property: %" PRId32 + ", error: %s", + propId, result.error().message().c_str()); + ASSERT_NE(result.value(), nullptr) << "Result value must not be null"; + ASSERT_EQ(result.value()->getInt32Values().size(), 1u) << "Result must contain 1 int value"; + + bool parkBarkeOnValue2 = (result.value()->getInt32Values()[0] == 1); + int64_t timestampValue2 = result.value()->getTimestamp(); + + if (parkBarkeOnValue2 == parkBrakeOnValue1) { + ASSERT_EQ(timestampValue2, timestampValue1) + << "getValue result must contain a timestamp updated when the value was updated, if" + "the value does not change, expect the same timestamp"; + } else { + ASSERT_GT(timestampValue2, timestampValue1) + << "getValue result must contain a timestamp updated when the value was updated, if" + "the value changes, expect the newer value has a larger timestamp"; + } +} + std::vector getDescriptors() { std::vector descriptors; for (std::string name : getAidlHalInstanceNames(IVehicle::descriptor)) { -- GitLab From e3421c3ce26aecdbf83d04f091e3a88ace032033 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 7 Apr 2022 00:20:48 +0000 Subject: [PATCH 735/825] Support '--user-hal' in FakeVehicleHardware. Support dump fake user hal command in FakeVehicleHardware. Test: atest FakeVehicleHardwareTest Bug: 228218366 Change-Id: I9884a1a216d07da6ccb58af1fa869266c959f80c --- .../hardware/src/FakeVehicleHardware.cpp | 10 ++++++++- .../hardware/test/FakeVehicleHardwareTest.cpp | 22 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) 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 1c2916c005..7b3de586c8 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -577,6 +577,12 @@ DumpResult FakeVehicleHardware::dump(const std::vector& options) { result.buffer = dumpSpecificProperty(options); } else if (EqualsIgnoreCase(option, "--set")) { result.buffer = dumpSetProperties(options); + } else if (EqualsIgnoreCase(option, kUserHalDumpOption)) { + if (options.size() == 1) { + result.buffer = mFakeUserHal->showDumpHelp(); + } else { + result.buffer = mFakeUserHal->dump(options[1]); + } } else { result.buffer = StringPrintf("Invalid option: %s\n", option.c_str()); } @@ -594,7 +600,9 @@ std::string FakeVehicleHardware::dumpHelp() { "[-b BYTES_VALUE] [-a AREA_ID] : sets the value of property PROP. " "Notice that the string, bytes and area value can be set just once, while the other can" " have multiple values (so they're used in the respective array), " - "BYTES_VALUE is in the form of 0xXXXX, e.g. 0xdeadbeef.\n"; + "BYTES_VALUE is in the form of 0xXXXX, e.g. 0xdeadbeef.\n\n" + "Fake user HAL usage: \n" + + mFakeUserHal->showDumpHelp(); } std::string FakeVehicleHardware::dumpAllProperties() { 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 504940bb9a..3e8f634ab7 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -1405,6 +1405,28 @@ TEST_F(FakeVehicleHardwareTest, testDumpInvalidOptions) { ASSERT_THAT(result.buffer, ContainsRegex("Invalid option: --invalid")); } +TEST_F(FakeVehicleHardwareTest, testDumpFakeUserHalHelp) { + std::vector options; + options.push_back("--user-hal"); + + DumpResult result = getHardware()->dump(options); + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_NE(result.buffer, ""); + ASSERT_THAT(result.buffer, ContainsRegex("dumps state used for user management")); +} + +TEST_F(FakeVehicleHardwareTest, testDumpFakeUserHal) { + std::vector options; + options.push_back("--user-hal"); + // Indent: " ". + options.push_back(" "); + + DumpResult result = getHardware()->dump(options); + ASSERT_FALSE(result.callerShouldDumpState); + ASSERT_NE(result.buffer, ""); + ASSERT_THAT(result.buffer, ContainsRegex(" No InitialUserInfo response\n")); +} + struct SetPropTestCase { std::string test_name; std::vector options; -- GitLab From 5fc076011ca247da94426196f125aa1ee4040fa0 Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Mon, 11 Apr 2022 15:35:05 +0000 Subject: [PATCH 736/825] Implements AIDL multi-HAL debug dump Bug: 228645167 Test: adb shell dumpsys android.hardware.sensors.ISensors/default Change-Id: If5985d669d5fae6ca99d0156f61841f868c8c60f --- sensors/aidl/default/multihal/HalProxyAidl.cpp | 12 ++++++++++++ sensors/aidl/default/multihal/include/HalProxyAidl.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/sensors/aidl/default/multihal/HalProxyAidl.cpp b/sensors/aidl/default/multihal/HalProxyAidl.cpp index 64805e6638..327db124c8 100644 --- a/sensors/aidl/default/multihal/HalProxyAidl.cpp +++ b/sensors/aidl/default/multihal/HalProxyAidl.cpp @@ -206,6 +206,18 @@ static ::android::hardware::sensors::V1_0::SharedMemInfo convertSharedMemInfo( resultToBinderStatus(HalProxy::unregisterDirectChannel(in_channelHandle))); } +binder_status_t HalProxyAidl::dump(int fd, const char ** /* args */, + uint32_t /* numArgs */) { + native_handle_t *nativeHandle = + native_handle_create(1 /* numFds */, 0 /* numInts */); + nativeHandle->data[0] = fd; + + HalProxy::debug(nativeHandle, {} /* args */); + + native_handle_delete(nativeHandle); + return STATUS_OK; +} + } // namespace implementation } // namespace sensors } // namespace hardware diff --git a/sensors/aidl/default/multihal/include/HalProxyAidl.h b/sensors/aidl/default/multihal/include/HalProxyAidl.h index 7401726cf9..5c81715933 100644 --- a/sensors/aidl/default/multihal/include/HalProxyAidl.h +++ b/sensors/aidl/default/multihal/include/HalProxyAidl.h @@ -55,6 +55,8 @@ class HalProxyAidl : public ::android::hardware::sensors::V2_1::implementation:: ::ndk::ScopedAStatus setOperationMode( ::aidl::android::hardware::sensors::ISensors::OperationMode in_mode) override; ::ndk::ScopedAStatus unregisterDirectChannel(int32_t in_channelHandle) override; + + binder_status_t dump(int fd, const char **args, uint32_t numArgs) override; }; } // namespace implementation -- GitLab From eae8adf209f8ce92955fd8a8207ab028a322e217 Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Mon, 11 Apr 2022 21:28:34 +0000 Subject: [PATCH 737/825] Fix return values in AIDL multi-HAL shim - Converts HIDL return values directly to ScopedAStatus - Adds asserts for unexpected values of conversion code Bug: 228645167 Test: Run VTS Change-Id: Ifcc57f565b4e1d9c140db9363e21ab6ee7dd6660 --- .../aidl/default/multihal/HalProxyAidl.cpp | 237 ++++++++++-------- 1 file changed, 132 insertions(+), 105 deletions(-) diff --git a/sensors/aidl/default/multihal/HalProxyAidl.cpp b/sensors/aidl/default/multihal/HalProxyAidl.cpp index 327db124c8..628914c3e3 100644 --- a/sensors/aidl/default/multihal/HalProxyAidl.cpp +++ b/sensors/aidl/default/multihal/HalProxyAidl.cpp @@ -29,6 +29,7 @@ using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite; using ::aidl::android::hardware::sensors::ISensors; using ::aidl::android::hardware::sensors::ISensorsCallback; using ::android::hardware::sensors::V2_1::implementation::convertToOldEvent; +using ::ndk::ScopedAStatus; namespace aidl { namespace android { @@ -36,19 +37,22 @@ namespace hardware { namespace sensors { namespace implementation { -static binder_status_t resultToBinderStatus(::android::hardware::sensors::V1_0::Result result) { - switch (result) { - case ::android::hardware::sensors::V1_0::Result::OK: - return STATUS_OK; - case ::android::hardware::sensors::V1_0::Result::PERMISSION_DENIED: - return STATUS_PERMISSION_DENIED; - case ::android::hardware::sensors::V1_0::Result::NO_MEMORY: - return STATUS_NO_MEMORY; - case ::android::hardware::sensors::V1_0::Result::BAD_VALUE: - return STATUS_BAD_VALUE; - case ::android::hardware::sensors::V1_0::Result::INVALID_OPERATION: - return STATUS_INVALID_OPERATION; - } +static ScopedAStatus +resultToAStatus(::android::hardware::sensors::V1_0::Result result) { + switch (result) { + case ::android::hardware::sensors::V1_0::Result::OK: + return ScopedAStatus::ok(); + case ::android::hardware::sensors::V1_0::Result::PERMISSION_DENIED: + return ScopedAStatus::fromExceptionCode(EX_SECURITY); + case ::android::hardware::sensors::V1_0::Result::NO_MEMORY: + return ScopedAStatus::fromServiceSpecificError(ISensors::ERROR_NO_MEMORY); + case ::android::hardware::sensors::V1_0::Result::BAD_VALUE: + return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + case ::android::hardware::sensors::V1_0::Result::INVALID_OPERATION: + return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); + default: + return ScopedAStatus::fromExceptionCode(EX_TRANSACTION_FAILED); + } } static ::android::hardware::sensors::V1_0::RateLevel convertRateLevel( @@ -62,6 +66,8 @@ static ::android::hardware::sensors::V1_0::RateLevel convertRateLevel( return ::android::hardware::sensors::V1_0::RateLevel::FAST; case ISensors::RateLevel::VERY_FAST: return ::android::hardware::sensors::V1_0::RateLevel::VERY_FAST; + default: + assert(false); } } @@ -72,6 +78,8 @@ static ::android::hardware::sensors::V1_0::OperationMode convertOperationMode( return ::android::hardware::sensors::V1_0::OperationMode::NORMAL; case ISensors::OperationMode::DATA_INJECTION: return ::android::hardware::sensors::V1_0::OperationMode::DATA_INJECTION; + default: + assert(false); } } @@ -82,6 +90,8 @@ static ::android::hardware::sensors::V1_0::SharedMemType convertSharedMemType( return ::android::hardware::sensors::V1_0::SharedMemType::ASHMEM; case ISensors::SharedMemInfo::SharedMemType::GRALLOC: return ::android::hardware::sensors::V1_0::SharedMemType::GRALLOC; + default: + assert(false); } } @@ -90,6 +100,8 @@ static ::android::hardware::sensors::V1_0::SharedMemFormat convertSharedMemForma switch (sharedMemFormat) { case ISensors::SharedMemInfo::SharedMemFormat::SENSORS_EVENT: return ::android::hardware::sensors::V1_0::SharedMemFormat::SENSORS_EVENT; + default: + assert(false); } } @@ -104,106 +116,121 @@ static ::android::hardware::sensors::V1_0::SharedMemInfo convertSharedMemInfo( return v1SharedMemInfo; } -::ndk::ScopedAStatus HalProxyAidl::activate(int32_t in_sensorHandle, bool in_enabled) { - return ndk::ScopedAStatus::fromStatus( - resultToBinderStatus(HalProxy::activate(in_sensorHandle, in_enabled))); +ScopedAStatus HalProxyAidl::activate(int32_t in_sensorHandle, bool in_enabled) { + return resultToAStatus(HalProxy::activate(in_sensorHandle, in_enabled)); +} + +ScopedAStatus HalProxyAidl::batch(int32_t in_sensorHandle, + int64_t in_samplingPeriodNs, + int64_t in_maxReportLatencyNs) { + return resultToAStatus(HalProxy::batch(in_sensorHandle, in_samplingPeriodNs, + in_maxReportLatencyNs)); +} + +ScopedAStatus HalProxyAidl::configDirectReport(int32_t in_sensorHandle, + int32_t in_channelHandle, + ISensors::RateLevel in_rate, + int32_t *_aidl_return) { + ScopedAStatus status = + ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); + HalProxy::configDirectReport( + in_sensorHandle, in_channelHandle, convertRateLevel(in_rate), + [&status, _aidl_return](::android::hardware::sensors::V1_0::Result result, + int32_t reportToken) { + status = resultToAStatus(result); + *_aidl_return = reportToken; + }); + + if (!status.isOk()) { + *_aidl_return = -1; + } + + return status; } -::ndk::ScopedAStatus HalProxyAidl::batch(int32_t in_sensorHandle, int64_t in_samplingPeriodNs, - int64_t in_maxReportLatencyNs) { - return ndk::ScopedAStatus::fromStatus(resultToBinderStatus( - HalProxy::batch(in_sensorHandle, in_samplingPeriodNs, in_maxReportLatencyNs))); +ScopedAStatus HalProxyAidl::flush(int32_t in_sensorHandle) { + return resultToAStatus(HalProxy::flush(in_sensorHandle)); } -::ndk::ScopedAStatus HalProxyAidl::configDirectReport(int32_t in_sensorHandle, - int32_t in_channelHandle, - ISensors::RateLevel in_rate, - int32_t* _aidl_return) { - binder_status_t binderStatus; - HalProxy::configDirectReport( - in_sensorHandle, in_channelHandle, convertRateLevel(in_rate), - [&binderStatus, _aidl_return](::android::hardware::sensors::V1_0::Result result, - int32_t reportToken) { - binderStatus = resultToBinderStatus(result); - *_aidl_return = reportToken; - }); - return ndk::ScopedAStatus::fromStatus(binderStatus); +ScopedAStatus HalProxyAidl::getSensorsList( + std::vector<::aidl::android::hardware::sensors::SensorInfo> *_aidl_return) { + for (const auto &sensor : HalProxy::getSensors()) { + _aidl_return->push_back(convertSensorInfo(sensor.second)); + } + return ScopedAStatus::ok(); } -::ndk::ScopedAStatus HalProxyAidl::flush(int32_t in_sensorHandle) { - return ndk::ScopedAStatus::fromStatus(resultToBinderStatus(HalProxy::flush(in_sensorHandle))); +ScopedAStatus HalProxyAidl::initialize( + const MQDescriptor<::aidl::android::hardware::sensors::Event, + SynchronizedReadWrite> &in_eventQueueDescriptor, + const MQDescriptor &in_wakeLockDescriptor, + const std::shared_ptr &in_sensorsCallback) { + ::android::sp<::android::hardware::sensors::V2_1::implementation:: + ISensorsCallbackWrapperBase> + dynamicCallback = new ISensorsCallbackWrapperAidl(in_sensorsCallback); + + auto aidlEventQueue = std::make_unique<::android::AidlMessageQueue< + ::aidl::android::hardware::sensors::Event, SynchronizedReadWrite>>( + in_eventQueueDescriptor, true /* resetPointers */); + std::unique_ptr<::android::hardware::sensors::V2_1::implementation:: + EventMessageQueueWrapperBase> + eventQueue = + std::make_unique(aidlEventQueue); + + auto aidlWakeLockQueue = std::make_unique< + ::android::AidlMessageQueue>( + in_wakeLockDescriptor, true /* resetPointers */); + std::unique_ptr<::android::hardware::sensors::V2_1::implementation:: + WakeLockMessageQueueWrapperBase> + wakeLockQueue = + std::make_unique(aidlWakeLockQueue); + + return resultToAStatus( + initializeCommon(eventQueue, wakeLockQueue, dynamicCallback)); } -::ndk::ScopedAStatus HalProxyAidl::getSensorsList( - std::vector<::aidl::android::hardware::sensors::SensorInfo>* _aidl_return) { - for (const auto& sensor : HalProxy::getSensors()) { - _aidl_return->push_back(convertSensorInfo(sensor.second)); - } - return ndk::ScopedAStatus::ok(); -} - -::ndk::ScopedAStatus HalProxyAidl::initialize( - const MQDescriptor<::aidl::android::hardware::sensors::Event, SynchronizedReadWrite>& - in_eventQueueDescriptor, - const MQDescriptor& in_wakeLockDescriptor, - const std::shared_ptr& in_sensorsCallback) { - ::android::sp<::android::hardware::sensors::V2_1::implementation::ISensorsCallbackWrapperBase> - dynamicCallback = new ISensorsCallbackWrapperAidl(in_sensorsCallback); - - auto aidlEventQueue = - std::make_unique<::android::AidlMessageQueue<::aidl::android::hardware::sensors::Event, - SynchronizedReadWrite>>( - in_eventQueueDescriptor, true /* resetPointers */); - std::unique_ptr< - ::android::hardware::sensors::V2_1::implementation::EventMessageQueueWrapperBase> - eventQueue = std::make_unique(aidlEventQueue); - - auto aidlWakeLockQueue = - std::make_unique<::android::AidlMessageQueue>( - in_wakeLockDescriptor, true /* resetPointers */); - std::unique_ptr< - ::android::hardware::sensors::V2_1::implementation::WakeLockMessageQueueWrapperBase> - wakeLockQueue = std::make_unique(aidlWakeLockQueue); - - return ndk::ScopedAStatus::fromStatus( - resultToBinderStatus(initializeCommon(eventQueue, wakeLockQueue, dynamicCallback))); -} - -::ndk::ScopedAStatus HalProxyAidl::injectSensorData( - const ::aidl::android::hardware::sensors::Event& in_event) { - ::android::hardware::sensors::V2_1::Event hidlEvent; - convertToHidlEvent(in_event, &hidlEvent); - return ndk::ScopedAStatus::fromStatus( - resultToBinderStatus(HalProxy::injectSensorData(convertToOldEvent(hidlEvent)))); -} - -::ndk::ScopedAStatus HalProxyAidl::registerDirectChannel(const ISensors::SharedMemInfo& in_mem, - int32_t* _aidl_return) { - binder_status_t binderStatus; - ::android::hardware::sensors::V1_0::SharedMemInfo sharedMemInfo = convertSharedMemInfo(in_mem); - - HalProxy::registerDirectChannel( - sharedMemInfo, - [&binderStatus, _aidl_return](::android::hardware::sensors::V1_0::Result result, - int32_t reportToken) { - binderStatus = resultToBinderStatus(result); - *_aidl_return = reportToken; - }); - - native_handle_delete( - const_cast(sharedMemInfo.memoryHandle.getNativeHandle())); - return ndk::ScopedAStatus::fromStatus(binderStatus); -} - -::ndk::ScopedAStatus HalProxyAidl::setOperationMode( - ::aidl::android::hardware::sensors::ISensors::OperationMode in_mode) { - return ndk::ScopedAStatus::fromStatus( - resultToBinderStatus(HalProxy::setOperationMode(convertOperationMode(in_mode)))); -} - -::ndk::ScopedAStatus HalProxyAidl::unregisterDirectChannel(int32_t in_channelHandle) { - return ndk::ScopedAStatus::fromStatus( - resultToBinderStatus(HalProxy::unregisterDirectChannel(in_channelHandle))); +ScopedAStatus HalProxyAidl::injectSensorData( + const ::aidl::android::hardware::sensors::Event &in_event) { + ::android::hardware::sensors::V2_1::Event hidlEvent; + convertToHidlEvent(in_event, &hidlEvent); + return resultToAStatus( + HalProxy::injectSensorData(convertToOldEvent(hidlEvent))); +} + +ScopedAStatus +HalProxyAidl::registerDirectChannel(const ISensors::SharedMemInfo &in_mem, + int32_t *_aidl_return) { + ScopedAStatus status = + ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); + ::android::hardware::sensors::V1_0::SharedMemInfo sharedMemInfo = + convertSharedMemInfo(in_mem); + + HalProxy::registerDirectChannel( + sharedMemInfo, + [&status, _aidl_return](::android::hardware::sensors::V1_0::Result result, + int32_t reportToken) { + status = resultToAStatus(result); + *_aidl_return = reportToken; + }); + + native_handle_delete(const_cast( + sharedMemInfo.memoryHandle.getNativeHandle())); + + if (!status.isOk()) { + *_aidl_return = -1; + } + + return status; +} + +ScopedAStatus HalProxyAidl::setOperationMode( + ::aidl::android::hardware::sensors::ISensors::OperationMode in_mode) { + return resultToAStatus( + HalProxy::setOperationMode(convertOperationMode(in_mode))); +} + +ScopedAStatus HalProxyAidl::unregisterDirectChannel(int32_t in_channelHandle) { + return resultToAStatus(HalProxy::unregisterDirectChannel(in_channelHandle)); } binder_status_t HalProxyAidl::dump(int fd, const char ** /* args */, -- GitLab From 5f29a4d8476ad9138a546f20000f713af1cd455d Mon Sep 17 00:00:00 2001 From: Les Lee Date: Fri, 8 Apr 2022 16:32:11 +0800 Subject: [PATCH 738/825] wifi: Fix single AP iface isn't deleted Bug: 222599182 Test: Manual Test, the AP iface is deleted. Change-Id: I07faf0afcd1f69af4ef57204ceac02c2572453f2 --- wifi/1.6/default/wifi_chip.cpp | 32 +++++++++++++++++++------------- wifi/1.6/default/wifi_chip.h | 2 +- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/wifi/1.6/default/wifi_chip.cpp b/wifi/1.6/default/wifi_chip.cpp index 7f0e97df7f..f062409d4e 100644 --- a/wifi/1.6/default/wifi_chip.cpp +++ b/wifi/1.6/default/wifi_chip.cpp @@ -1003,14 +1003,14 @@ std::pair> WifiChip::createBridgedApIfaceInte br_ifaces_ap_instances_[br_ifname] = ap_instances; if (!iface_util_->createBridge(br_ifname)) { LOG(ERROR) << "Failed createBridge - br_name=" << br_ifname.c_str(); - invalidateAndClearBridgedAp(br_ifname); + deleteApIface(br_ifname); return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } for (auto const& instance : ap_instances) { // Bind ap instance interface to AP bridge if (!iface_util_->addIfaceToBridge(br_ifname, instance)) { LOG(ERROR) << "Failed add if to Bridge - if_name=" << instance.c_str(); - invalidateAndClearBridgedAp(br_ifname); + deleteApIface(br_ifname); return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}}; } } @@ -1044,8 +1044,7 @@ WifiStatus WifiChip::removeApIfaceInternal(const std::string& ifname) { // nan/rtt objects over AP iface. But, there is no harm to do it // here and not make that assumption all over the place. invalidateAndRemoveDependencies(ifname); - // Clear the bridge interface and the iface instance. - invalidateAndClearBridgedAp(ifname); + deleteApIface(ifname); invalidateAndClear(ap_ifaces_, iface); for (const auto& callback : event_cb_handler_.getCallbacks()) { if (!callback->onIfaceRemoved(IfaceType::AP, ifname).isOk()) { @@ -2005,21 +2004,28 @@ void WifiChip::invalidateAndClearBridgedApAll() { br_ifaces_ap_instances_.clear(); } -void WifiChip::invalidateAndClearBridgedAp(const std::string& br_name) { - if (br_name.empty()) return; - // delete managed interfaces +void WifiChip::deleteApIface(const std::string& if_name) { + if (if_name.empty()) return; + // delete bridged interfaces if have for (auto const& it : br_ifaces_ap_instances_) { - if (it.first == br_name) { + if (it.first == if_name) { for (auto const& iface : it.second) { - iface_util_->removeIfaceFromBridge(br_name, iface); + iface_util_->removeIfaceFromBridge(if_name, iface); legacy_hal_.lock()->deleteVirtualInterface(iface); } - iface_util_->deleteBridge(br_name); - br_ifaces_ap_instances_.erase(br_name); - break; + iface_util_->deleteBridge(if_name); + br_ifaces_ap_instances_.erase(if_name); + // ifname is bridged AP, return here. + return; } } - return; + + // No bridged AP case, delete AP iface + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->deleteVirtualInterface(if_name); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + LOG(ERROR) << "Failed to remove interface: " << if_name << " " + << legacyErrorToString(legacy_status); + } } bool WifiChip::findUsingNameFromBridgedApInstances(const std::string& name) { diff --git a/wifi/1.6/default/wifi_chip.h b/wifi/1.6/default/wifi_chip.h index f952a68654..e8ddaa6f9e 100644 --- a/wifi/1.6/default/wifi_chip.h +++ b/wifi/1.6/default/wifi_chip.h @@ -272,7 +272,7 @@ class WifiChip : public V1_6::IWifiChip { bool writeRingbufferFilesInternal(); std::string getWlanIfaceNameWithType(IfaceType type, unsigned idx); void invalidateAndClearBridgedApAll(); - void invalidateAndClearBridgedAp(const std::string& br_name); + void deleteApIface(const std::string& if_name); bool findUsingNameFromBridgedApInstances(const std::string& name); WifiStatus triggerSubsystemRestartInternal(); std::pair> createRttControllerInternal_1_6( -- GitLab From 3c4b22cef2388ee572b069ac568966813c6e835e Mon Sep 17 00:00:00 2001 From: Tim Lin Date: Tue, 12 Apr 2022 21:24:03 +0800 Subject: [PATCH 739/825] check all active ports Bug: 226018537 Test: run vts -m VtsHalRadioTargetTest Change-Id: Ie3d8f7387ebb2846ea772d4f879039a127282c9a --- radio/aidl/vts/radio_config_test.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp index 81d87d23c4..258b172918 100644 --- a/radio/aidl/vts/radio_config_test.cpp +++ b/radio/aidl/vts/radio_config_test.cpp @@ -238,12 +238,24 @@ TEST_P(RadioConfigTest, checkPortInfoExistsAndPortActive) { EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type); EXPECT_EQ(serial, radioRsp_config->rspInfo.serial); if (radioRsp_config->rspInfo.error == RadioError::NONE) { + uint8_t simCount = 0; // check if cardState is present, portInfo size should be more than 0 for (const SimSlotStatus& slotStatusResponse : radioRsp_config->simSlotStatus) { if (slotStatusResponse.cardState == CardStatus::STATE_PRESENT) { ASSERT_TRUE(slotStatusResponse.portInfo.size() > 0); - ASSERT_TRUE(slotStatusResponse.portInfo[0].portActive); + for (const SimPortInfo& simPortInfo : slotStatusResponse.portInfo) { + if (simPortInfo.portActive) { + simCount++; + } + } } } + if (isSsSsEnabled()) { + EXPECT_EQ(1, simCount); + } else if (isDsDsEnabled()) { + EXPECT_EQ(2, simCount); + } else if (isTsTsEnabled()) { + EXPECT_EQ(3, simCount); + } } } -- GitLab From e9cb2933a43f436e4e152f61a28cb0aee1e4bdda Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Tue, 12 Apr 2022 15:43:51 +0000 Subject: [PATCH 740/825] Fix AIDL sensors VTS test - According to the AIDL backends, return values are not propagated when the status is !ok(). Update the VTS test, HAL implementation, and ISensors definition to remove the requirement that the handle is populated to -1 on failure for registerDirectChannel. - Also update VTS tests for some error code checks to reflect the actual expecataions according to the ISensors documentation. Bug: 228645167 Test: VTS passes Change-Id: I5d4d4d0af3b033b34a58d8462aa40214d89fa442 --- .../android/hardware/sensors/ISensors.aidl | 5 ++-- .../aidl/default/multihal/HalProxyAidl.cpp | 8 ------ .../aidl/vts/VtsAidlHalSensorsTargetTest.cpp | 26 ++++++++++++------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/sensors/aidl/android/hardware/sensors/ISensors.aidl b/sensors/aidl/android/hardware/sensors/ISensors.aidl index 2ac188454b..2c684897cf 100644 --- a/sensors/aidl/android/hardware/sensors/ISensors.aidl +++ b/sensors/aidl/android/hardware/sensors/ISensors.aidl @@ -229,8 +229,7 @@ interface ISensors { * * @param mem shared memory info data structure. * @param out channelHandle The registered channel handle. - * @return The direct channel handle, which is positive if successfully registered, and -1 - * otherwise. + * @return The direct channel handle, which is positive if successfully registered. * @return Status::ok on success * EX_ILLEGAL_ARGUMENT if the shared memory information is not consistent. * EX_UNSUPPORTED_OPERATION if this functionality is unsupported. @@ -245,7 +244,7 @@ interface ISensors { * @see OperationMode * @param mode The operation mode. * @return Status::ok on success - * EX_UNSUPPORTED_OPERATION if requested mode is not supported. + * EX_UNSUPPORTED_OPERATION or EX_ILLEGAL_ARGUMENT if requested mode is not supported. * EX_SECURITY if the operation is not allowed. */ void setOperationMode(in OperationMode mode); diff --git a/sensors/aidl/default/multihal/HalProxyAidl.cpp b/sensors/aidl/default/multihal/HalProxyAidl.cpp index 628914c3e3..e6bcdada52 100644 --- a/sensors/aidl/default/multihal/HalProxyAidl.cpp +++ b/sensors/aidl/default/multihal/HalProxyAidl.cpp @@ -141,10 +141,6 @@ ScopedAStatus HalProxyAidl::configDirectReport(int32_t in_sensorHandle, *_aidl_return = reportToken; }); - if (!status.isOk()) { - *_aidl_return = -1; - } - return status; } @@ -216,10 +212,6 @@ HalProxyAidl::registerDirectChannel(const ISensors::SharedMemInfo &in_mem, native_handle_delete(const_cast( sharedMemInfo.memoryHandle.getNativeHandle())); - if (!status.isOk()) { - *_aidl_return = -1; - } - return status; } diff --git a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp index 83d0dc97e1..d536e290b2 100644 --- a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp +++ b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp @@ -599,10 +599,12 @@ TEST_P(SensorsAidlTest, SetOperationMode) { ASSERT_TRUE(getSensors()->setOperationMode(ISensors::OperationMode::DATA_INJECTION).isOk()); ASSERT_TRUE(getSensors()->setOperationMode(ISensors::OperationMode::NORMAL).isOk()); } else { - ASSERT_EQ(getSensors() - ->setOperationMode(ISensors::OperationMode::DATA_INJECTION) - .getExceptionCode(), - EX_UNSUPPORTED_OPERATION); + int errorCode = + getSensors() + ->setOperationMode(ISensors::OperationMode::DATA_INJECTION) + .getExceptionCode(); + ASSERT_TRUE((errorCode == EX_UNSUPPORTED_OPERATION) || + (errorCode == EX_ILLEGAL_ARGUMENT)); } } @@ -938,10 +940,10 @@ void SensorsAidlTest::checkRateLevel(const SensorInfo& sensor, int32_t directCha if (isDirectReportRateSupported(sensor, rateLevel)) { ASSERT_TRUE(status.isOk()); if (rateLevel != ISensors::RateLevel::STOP) { - ASSERT_GT(*reportToken, 0); - } else { - ASSERT_EQ(status.getExceptionCode(), EX_ILLEGAL_ARGUMENT); + ASSERT_GT(*reportToken, 0); } + } else { + ASSERT_EQ(status.getExceptionCode(), EX_ILLEGAL_ARGUMENT); } } @@ -982,11 +984,15 @@ void SensorsAidlTest::verifyRegisterDirectChannel( ::ndk::ScopedAStatus status = registerDirectChannel(mem->getSharedMemInfo(), &channelHandle); if (supportsSharedMemType) { ASSERT_TRUE(status.isOk()); - ASSERT_EQ(channelHandle, 0); + ASSERT_GT(channelHandle, 0); + + // Verify that the memory has been zeroed + for (size_t i = 0; i < mem->getSize(); i++) { + ASSERT_EQ(buffer[i], 0x00); + } } else { int32_t error = supportsAnyDirectChannel ? EX_ILLEGAL_ARGUMENT : EX_UNSUPPORTED_OPERATION; ASSERT_EQ(status.getExceptionCode(), error); - ASSERT_EQ(channelHandle, -1); } *directChannelHandle = channelHandle; } @@ -1038,7 +1044,7 @@ void SensorsAidlTest::verifyConfigure(const SensorInfo& sensor, // Verify that a sensor handle of -1 is only acceptable when using RateLevel::STOP ndk::ScopedAStatus status = configDirectReport(-1 /* sensorHandle */, directChannelHandle, ISensors::RateLevel::NORMAL, &reportToken); - ASSERT_EQ(status.getServiceSpecificError(), android::BAD_VALUE); + ASSERT_EQ(status.getExceptionCode(), EX_ILLEGAL_ARGUMENT); status = configDirectReport(-1 /* sensorHandle */, directChannelHandle, ISensors::RateLevel::STOP, &reportToken); -- GitLab From 9f6f592cb8528550406f6f673c2a9994a5e11c95 Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Tue, 12 Apr 2022 19:29:10 -0700 Subject: [PATCH 741/825] Fix EVS VTS test cases - Correctly handle a payload of EvsEventDesc type variables. - Explicitly duplicate buffers to hold. - Proeprly handle ultrasonic APIs that are not implemented yet. Bug: 226628778 Test: atest VtsHalEvsTargetTest on Seahawk Change-Id: I4c202b171d6cc905732e0687743cb481893a6dd2 --- automotive/evs/aidl/vts/FrameHandler.cpp | 79 ++++++++++++++++--- .../evs/aidl/vts/VtsHalEvsTargetTest.cpp | 63 +++++++++------ 2 files changed, 105 insertions(+), 37 deletions(-) diff --git a/automotive/evs/aidl/vts/FrameHandler.cpp b/automotive/evs/aidl/vts/FrameHandler.cpp index bab832b09c..e51be674d7 100644 --- a/automotive/evs/aidl/vts/FrameHandler.cpp +++ b/automotive/evs/aidl/vts/FrameHandler.cpp @@ -19,22 +19,73 @@ #include "FrameHandler.h" #include "FormatConvert.h" +#include #include #include #include #include #include +namespace { + using ::aidl::android::hardware::automotive::evs::BufferDesc; using ::aidl::android::hardware::automotive::evs::CameraDesc; using ::aidl::android::hardware::automotive::evs::EvsEventDesc; using ::aidl::android::hardware::automotive::evs::EvsEventType; using ::aidl::android::hardware::automotive::evs::IEvsCamera; using ::aidl::android::hardware::automotive::evs::IEvsDisplay; +using ::aidl::android::hardware::common::NativeHandle; +using ::aidl::android::hardware::graphics::common::HardwareBuffer; using ::aidl::android::hardware::graphics::common::HardwareBufferDescription; using ::ndk::ScopedAStatus; using std::chrono_literals::operator""s; +NativeHandle dupNativeHandle(const NativeHandle& handle, bool doDup) { + NativeHandle dup; + + dup.fds = std::vector<::ndk::ScopedFileDescriptor>(handle.fds.size()); + if (!doDup) { + for (auto i = 0; i < handle.fds.size(); ++i) { + dup.fds.at(i).set(handle.fds[i].get()); + } + } else { + for (auto i = 0; i < handle.fds.size(); ++i) { + dup.fds[i] = std::move(handle.fds[i].dup()); + } + } + dup.ints = handle.ints; + + return std::move(dup); +} + +HardwareBuffer dupHardwareBuffer(const HardwareBuffer& buffer, bool doDup) { + HardwareBuffer dup = { + .description = buffer.description, + .handle = dupNativeHandle(buffer.handle, doDup), + }; + + return std::move(dup); +} + +BufferDesc dupBufferDesc(const BufferDesc& src, bool doDup) { + BufferDesc dup = { + .buffer = dupHardwareBuffer(src.buffer, doDup), + .pixelSizeBytes = src.pixelSizeBytes, + .bufferId = src.bufferId, + .deviceId = src.deviceId, + .timestamp = src.timestamp, + .metadata = src.metadata, + }; + + return std::move(dup); +} + +bool comparePayload(const EvsEventDesc& l, const EvsEventDesc& r) { + return std::equal(l.payload.begin(), l.payload.end(), r.payload.begin()); +} + +} // namespace + FrameHandler::FrameHandler(const std::shared_ptr& pCamera, const CameraDesc& cameraInfo, const std::shared_ptr& pDisplay, BufferControlFlag mode) : mCamera(pCamera), mCameraInfo(cameraInfo), mDisplay(pDisplay), mReturnMode(mode) { @@ -169,15 +220,24 @@ ScopedAStatus FrameHandler::deliverFrame(const std::vector& buffers) mFrameSignal.notify_all(); switch (mReturnMode) { - case eAutoReturn: + case eAutoReturn: { // Send the camera buffer back now that the client has seen it LOG(DEBUG) << "Calling doneWithFrame"; - mCamera->doneWithFrame(buffers); + if (!mCamera->doneWithFrame(buffers).isOk()) { + LOG(WARNING) << "Failed to return buffers"; + } break; - case eNoAutoReturn: + } + + case eNoAutoReturn: { // Hang onto the buffer handles for now -- the client will return it explicitly later - // mHeldBuffers.push(buffers); + std::vector buffersToHold; + for (const auto& buffer : buffers) { + buffersToHold.push_back(dupBufferDesc(buffer, /* doDup = */ true)); + } + mHeldBuffers.push(std::move(buffersToHold)); break; + } } LOG(DEBUG) << "Frame handling complete"; @@ -188,8 +248,7 @@ ScopedAStatus FrameHandler::notify(const EvsEventDesc& event) { // Local flag we use to keep track of when the stream is stopping std::unique_lock lock(mEventLock); mLatestEventDesc.aType = event.aType; - mLatestEventDesc.payload[0] = event.payload[0]; - mLatestEventDesc.payload[1] = event.payload[1]; + mLatestEventDesc.payload = event.payload; if (mLatestEventDesc.aType == EvsEventType::STREAM_STOPPED) { // Signal that the last frame has been received and the stream is stopped mRunning = false; @@ -319,13 +378,9 @@ bool FrameHandler::waitForEvent(const EvsEventDesc& aTargetEvent, EvsEventDesc& bool result = mEventSignal.wait_until( lock, now + 5s, [this, aTargetEvent, ignorePayload, &aReceivedEvent, &found]() { found = (mLatestEventDesc.aType == aTargetEvent.aType) && - (ignorePayload || - (mLatestEventDesc.payload[0] == aTargetEvent.payload[0] && - mLatestEventDesc.payload[1] == aTargetEvent.payload[1])); - + (ignorePayload || comparePayload(mLatestEventDesc, aTargetEvent)); aReceivedEvent.aType = mLatestEventDesc.aType; - aReceivedEvent.payload[0] = mLatestEventDesc.payload[0]; - aReceivedEvent.payload[1] = mLatestEventDesc.payload[1]; + aReceivedEvent.payload = mLatestEventDesc.payload; return found; }); diff --git a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp index 7fcac38aea..a442368c4e 100644 --- a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp +++ b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp @@ -139,7 +139,12 @@ class EvsAidlTest : public ::testing::TestWithParam { ASSERT_NE(mEnumerator, nullptr); // Get the ultrasonics array list - ASSERT_TRUE(mEnumerator->getUltrasonicsArrayList(&mUltrasonicsArraysInfo).isOk()) + auto result = mEnumerator->getUltrasonicsArrayList(&mUltrasonicsArraysInfo); + ASSERT_TRUE(result.isOk() || + // TODO(b/149874793): Remove below conditions when + // getUltrasonicsArrayList() is implemented. + (!result.isOk() && result.getServiceSpecificError() == + static_cast(EvsResult::NOT_IMPLEMENTED))) << "Failed to get a list of available ultrasonics arrays"; LOG(INFO) << "We have " << mCameraInfo.size() << " ultrasonics arrays."; } @@ -523,7 +528,7 @@ TEST_P(EvsAidlTest, CameraStreamBuffering) { // Ask for a very large number of buffers in flight to ensure it errors correctly auto badResult = pCam->setMaxFramesInFlight(0xFFFFFFFF); EXPECT_TRUE(!badResult.isOk() && badResult.getServiceSpecificError() == - static_cast(EvsResult::BUFFER_NOT_AVAILABLE)); + static_cast(EvsResult::INVALID_ARG)); // Now ask for exactly two buffers in flight as we'll test behavior in that case ASSERT_TRUE(pCam->setMaxFramesInFlight(kBuffersToHold).isOk()); @@ -587,7 +592,7 @@ TEST_P(EvsAidlTest, CameraToDisplayRoundTrip) { std::shared_ptr pDisplay; ASSERT_TRUE(mEnumerator->openDisplay(targetDisplayId, &pDisplay).isOk()); EXPECT_NE(pDisplay, nullptr); - LOG(INFO) << "Display " << targetDisplayId << " is in use."; + LOG(INFO) << "Display " << static_cast(targetDisplayId) << " is in use."; // Get the display descriptor DisplayDesc displayDesc; @@ -1137,8 +1142,8 @@ TEST_P(EvsAidlTest, MultiCameraParameter) { EvsEventDesc aTargetEvent; aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; - aTargetEvent.payload[0] = static_cast(cmd); - aTargetEvent.payload[1] = val0; + aTargetEvent.payload.push_back(static_cast(cmd)); + aTargetEvent.payload.push_back(val0); if (!frameHandlerPrimary->waitForEvent(aTargetEvent, aNotification0)) { LOG(WARNING) << "A timer is expired before a target event is fired."; } @@ -1152,8 +1157,8 @@ TEST_P(EvsAidlTest, MultiCameraParameter) { EvsEventDesc aTargetEvent; aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; - aTargetEvent.payload[0] = static_cast(cmd); - aTargetEvent.payload[1] = val0; + aTargetEvent.payload.push_back(static_cast(cmd)); + aTargetEvent.payload.push_back(val0); if (!frameHandlerSecondary->waitForEvent(aTargetEvent, aNotification1)) { LOG(WARNING) << "A timer is expired before a target event is fired."; } @@ -1188,11 +1193,13 @@ TEST_P(EvsAidlTest, MultiCameraParameter) { static_cast(aNotification0.aType)); ASSERT_EQ(EvsEventType::PARAMETER_CHANGED, static_cast(aNotification1.aType)); + ASSERT_GE(aNotification0.payload.size(), 2); + ASSERT_GE(aNotification1.payload.size(), 2); ASSERT_EQ(cmd, static_cast(aNotification0.payload[0])); ASSERT_EQ(cmd, static_cast(aNotification1.payload[0])); for (auto&& v : values) { - ASSERT_EQ(v, static_cast(aNotification0.payload[1])); - ASSERT_EQ(v, static_cast(aNotification1.payload[1])); + ASSERT_EQ(v, aNotification0.payload[1]); + ASSERT_EQ(v, aNotification1.payload[1]); } // Clients expects to receive a parameter change notification @@ -1281,8 +1288,8 @@ TEST_P(EvsAidlTest, MultiCameraParameter) { EvsEventDesc aTargetEvent; aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; - aTargetEvent.payload[0] = static_cast(cmd); - aTargetEvent.payload[1] = val0; + aTargetEvent.payload.push_back(static_cast(cmd)); + aTargetEvent.payload.push_back(val0); if (!frameHandlerPrimary->waitForEvent(aTargetEvent, aNotification0)) { LOG(WARNING) << "A timer is expired before a target event is fired."; } @@ -1295,8 +1302,8 @@ TEST_P(EvsAidlTest, MultiCameraParameter) { EvsEventDesc aTargetEvent; aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; - aTargetEvent.payload[0] = static_cast(cmd); - aTargetEvent.payload[1] = val0; + aTargetEvent.payload.push_back(static_cast(cmd)); + aTargetEvent.payload.push_back(val0); if (!frameHandlerSecondary->waitForEvent(aTargetEvent, aNotification1)) { LOG(WARNING) << "A timer is expired before a target event is fired."; } @@ -1336,11 +1343,13 @@ TEST_P(EvsAidlTest, MultiCameraParameter) { static_cast(aNotification0.aType)); ASSERT_EQ(EvsEventType::PARAMETER_CHANGED, static_cast(aNotification1.aType)); + ASSERT_GE(aNotification0.payload.size(), 2); + ASSERT_GE(aNotification1.payload.size(), 2); ASSERT_EQ(cmd, static_cast(aNotification0.payload[0])); ASSERT_EQ(cmd, static_cast(aNotification1.payload[0])); for (auto&& v : values) { - ASSERT_EQ(v, static_cast(aNotification0.payload[1])); - ASSERT_EQ(v, static_cast(aNotification1.payload[1])); + ASSERT_EQ(v, aNotification0.payload[1]); + ASSERT_EQ(v, aNotification1.payload[1]); } } @@ -1461,8 +1470,9 @@ TEST_P(EvsAidlTest, HighPriorityCameraClient) { EvsEventDesc aTargetEvent; aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; - aTargetEvent.payload[0] = static_cast(CameraParam::AUTO_FOCUS); - aTargetEvent.payload[1] = 0; + aTargetEvent.payload.push_back( + static_cast(CameraParam::AUTO_FOCUS)); + aTargetEvent.payload.push_back(0); if (!frameHandler0->waitForEvent(aTargetEvent, aNotification)) { LOG(WARNING) << "A timer is expired before a target event is fired."; } @@ -1504,8 +1514,8 @@ TEST_P(EvsAidlTest, HighPriorityCameraClient) { EvsEventDesc aTargetEvent; aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; - aTargetEvent.payload[0] = static_cast(cam1Cmds[0]); - aTargetEvent.payload[1] = val0; + aTargetEvent.payload.push_back(static_cast(cam1Cmds[0])); + aTargetEvent.payload.push_back(val0); if (!frameHandler1->waitForEvent(aTargetEvent, aNotification)) { LOG(WARNING) << "A timer is expired before a target event is fired."; } @@ -1533,9 +1543,10 @@ TEST_P(EvsAidlTest, HighPriorityCameraClient) { // Verify a change notification ASSERT_EQ(static_cast(aNotification.aType), EvsEventType::PARAMETER_CHANGED); + ASSERT_GE(aNotification.payload.size(), 2); ASSERT_EQ(static_cast(aNotification.payload[0]), cam1Cmds[0]); for (auto&& v : values) { - ASSERT_EQ(v, static_cast(aNotification.payload[1])); + ASSERT_EQ(v, aNotification.payload[1]); } listener = std::thread([&frameHandler1, &aNotification, &listening, &eventCond] { @@ -1582,8 +1593,9 @@ TEST_P(EvsAidlTest, HighPriorityCameraClient) { EvsEventDesc aTargetEvent; aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; - aTargetEvent.payload[0] = static_cast(CameraParam::AUTO_FOCUS); - aTargetEvent.payload[1] = 0; + aTargetEvent.payload.push_back( + static_cast(CameraParam::AUTO_FOCUS)); + aTargetEvent.payload.push_back(0); if (!frameHandler1->waitForEvent(aTargetEvent, aNotification)) { LOG(WARNING) << "A timer is expired before a target event is fired."; } @@ -1621,8 +1633,8 @@ TEST_P(EvsAidlTest, HighPriorityCameraClient) { EvsEventDesc aTargetEvent; aTargetEvent.aType = EvsEventType::PARAMETER_CHANGED; - aTargetEvent.payload[0] = static_cast(cam0Cmds[0]); - aTargetEvent.payload[1] = val0; + aTargetEvent.payload.push_back(static_cast(cam0Cmds[0])); + aTargetEvent.payload.push_back(val0); if (!frameHandler0->waitForEvent(aTargetEvent, aNotification)) { LOG(WARNING) << "A timer is expired before a target event is fired."; } @@ -1646,9 +1658,10 @@ TEST_P(EvsAidlTest, HighPriorityCameraClient) { } // Verify a change notification ASSERT_EQ(static_cast(aNotification.aType), EvsEventType::PARAMETER_CHANGED); + ASSERT_GE(aNotification.payload.size(), 2); ASSERT_EQ(static_cast(aNotification.payload[0]), cam0Cmds[0]); for (auto&& v : values) { - ASSERT_EQ(v, static_cast(aNotification.payload[1])); + ASSERT_EQ(v, aNotification.payload[1]); } // Turn off the display (yes, before the stream stops -- it should be handled) -- GitLab From fdf818ffce0ba1d469a712a8943a561387092f93 Mon Sep 17 00:00:00 2001 From: Tyler Trephan Date: Wed, 13 Apr 2022 19:46:48 +0000 Subject: [PATCH 742/825] Updated EV_CHARGE_CURRENT_DRAW_LIMIT config array Test: atest CarPropertyManagerTest Bug: 229118601 Change-Id: If894454260852a1c7fa7ebfb3cf98682120bb397 --- .../vehicle/aidl/impl/default_config/include/DefaultConfig.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h index fda0da929b..4d96fd38ae 100644 --- a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +++ b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h @@ -292,8 +292,9 @@ const std::vector kVehicleProperties = { .prop = toInt(VehicleProperty::EV_CHARGE_CURRENT_DRAW_LIMIT), .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {/*max current draw allowed by vehicle in amperes=*/20}, }, - .initialValue = {.floatValues = {(float)VehicleUnit::AMPERE}}}, + .initialValue = {.floatValues = {(float)12.5}}}, {.config = { -- GitLab From 95a32bcde4360f662f58d965e7e98320b1798226 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Tue, 12 Apr 2022 23:52:16 +0000 Subject: [PATCH 743/825] Make graphics.allocator HIDL service optional This allows the use of the AIDL graphics.allocator AIDL service by itself. Bug: 205761012 Test: atest hal_implementation_test Test: Build and boot cuttlefish without the HIDL service Change-Id: Ief394181ab2193c56e05c406ca5ba120a988835c --- compatibility_matrices/compatibility_matrix.current.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index 8b3830a373..acee459ca0 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -277,9 +277,9 @@ default - + android.hardware.graphics.allocator - + 2.0 3.0 4.0 -- GitLab From b6686e725a5a06757d66898562f20d5ea04ea9b3 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Wed, 13 Apr 2022 12:40:52 -0700 Subject: [PATCH 744/825] Fix use-after-free in GnssMesaurementInterface Bug: 228639296 Test: on Cuttlefish Change-Id: Ibd36d23f2059ae994132099dd67d8fd10f84cd72 --- gnss/aidl/default/Gnss.cpp | 1 - gnss/aidl/default/GnssMeasurementInterface.cpp | 4 +++- gnss/aidl/default/GnssNavigationMessageInterface.cpp | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 7855b5196a..226b1f4b27 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -153,7 +153,6 @@ void Gnss::reportSvStatus(const std::vector& svInfoList) const { std::vector Gnss::filterBlocklistedSatellites( std::vector gnssSvInfoList) const { - ALOGD("filterBlocklistedSatellites"); for (uint32_t i = 0; i < gnssSvInfoList.size(); i++) { if (mGnssConfiguration->isBlocklisted(gnssSvInfoList[i])) { gnssSvInfoList[i].svFlag &= ~(uint32_t)IGnssCallback::GnssSvFlags::USED_IN_FIX; diff --git a/gnss/aidl/default/GnssMeasurementInterface.cpp b/gnss/aidl/default/GnssMeasurementInterface.cpp index 2c7241b82e..228d5bf854 100644 --- a/gnss/aidl/default/GnssMeasurementInterface.cpp +++ b/gnss/aidl/default/GnssMeasurementInterface.cpp @@ -106,12 +106,14 @@ void GnssMeasurementInterface::start(const bool enableCorrVecOutputs) { std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMillis)); } }); - mThread.detach(); } void GnssMeasurementInterface::stop() { ALOGD("stop"); mIsActive = false; + if (mThread.joinable()) { + mThread.join(); + } } void GnssMeasurementInterface::reportMeasurement(const GnssData& data) { diff --git a/gnss/aidl/default/GnssNavigationMessageInterface.cpp b/gnss/aidl/default/GnssNavigationMessageInterface.cpp index 4bc859d35f..fe34787c82 100644 --- a/gnss/aidl/default/GnssNavigationMessageInterface.cpp +++ b/gnss/aidl/default/GnssNavigationMessageInterface.cpp @@ -69,12 +69,14 @@ void GnssNavigationMessageInterface::start() { std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMillis)); } }); - mThread.detach(); } void GnssNavigationMessageInterface::stop() { ALOGD("stop"); mIsActive = false; + if (mThread.joinable()) { + mThread.join(); + } } void GnssNavigationMessageInterface::reportMessage(const GnssNavigationMessage& message) { -- GitLab From 70f5837e1f5f86d3ef8604cdb4d641e70da3b332 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Sat, 16 Apr 2022 07:03:24 +0900 Subject: [PATCH 745/825] Freeze AIDL APIs for TM Bug: 225941299 Test: m Change-Id: I61eb51c0334eb99489c6f1570110d7e18c350c99 --- automotive/vehicle/aidl/Android.bp | 7 + camera/common/aidl/Android.bp | 7 + .../android.hardware.camera.common/1/.hash | 1 + .../camera/common/CameraDeviceStatus.aidl | 40 ++++++ .../camera/common/CameraMetadataType.aidl | 43 ++++++ .../camera/common/CameraResourceCost.aidl | 39 ++++++ .../hardware/camera/common/Status.aidl | 44 ++++++ .../hardware/camera/common/TagBoundaryId.aidl | 39 ++++++ .../camera/common/TorchModeStatus.aidl | 40 ++++++ .../hardware/camera/common/VendorTag.aidl | 40 ++++++ .../camera/common/VendorTagSection.aidl | 39 ++++++ camera/metadata/aidl/Android.bp | 7 + contexthub/aidl/Android.bp | 7 + .../android.hardware.contexthub/1/.hash | 1 + .../hardware/contexthub/AsyncEventType.aidl | 38 ++++++ .../hardware/contexthub/ContextHubInfo.aidl | 48 +++++++ .../contexthub/ContextHubMessage.aidl | 42 ++++++ .../hardware/contexthub/HostEndpointInfo.aidl | 46 +++++++ .../hardware/contexthub/IContextHub.aidl | 49 +++++++ .../contexthub/IContextHubCallback.aidl | 41 ++++++ .../hardware/contexthub/NanoappBinary.aidl | 46 +++++++ .../hardware/contexthub/NanoappInfo.aidl | 42 ++++++ .../contexthub/NanoappRpcService.aidl | 39 ++++++ .../android/hardware/contexthub/Setting.aidl | 44 ++++++ drm/aidl/Android.bp | 7 + .../aidl_api/android.hardware.drm/1/.hash | 1 + .../1/android/hardware/drm/CryptoSchemes.aidl | 39 ++++++ .../1/android/hardware/drm/DecryptArgs.aidl | 46 +++++++ .../hardware/drm/DestinationBuffer.aidl | 39 ++++++ .../1/android/hardware/drm/DrmMetric.aidl | 40 ++++++ .../android/hardware/drm/DrmMetricGroup.aidl | 38 ++++++ .../hardware/drm/DrmMetricNamedValue.aidl | 39 ++++++ .../android/hardware/drm/DrmMetricValue.aidl | 40 ++++++ .../1/android/hardware/drm/EventType.aidl | 42 ++++++ .../1/android/hardware/drm/HdcpLevel.aidl | 45 +++++++ .../1/android/hardware/drm/HdcpLevels.aidl | 39 ++++++ .../1/android/hardware/drm/ICryptoPlugin.aidl | 43 ++++++ .../1/android/hardware/drm/IDrmFactory.aidl | 40 ++++++ .../1/android/hardware/drm/IDrmPlugin.aidl | 76 +++++++++++ .../hardware/drm/IDrmPluginListener.aidl | 41 ++++++ .../1/android/hardware/drm/KeyRequest.aidl | 40 ++++++ .../android/hardware/drm/KeyRequestType.aidl | 43 ++++++ .../1/android/hardware/drm/KeySetId.aidl | 38 ++++++ .../1/android/hardware/drm/KeyStatus.aidl | 39 ++++++ .../1/android/hardware/drm/KeyStatusType.aidl | 43 ++++++ .../1/android/hardware/drm/KeyType.aidl | 40 ++++++ .../1/android/hardware/drm/KeyValue.aidl | 39 ++++++ .../1/android/hardware/drm/LogMessage.aidl | 40 ++++++ .../1/android/hardware/drm/LogPriority.aidl | 45 +++++++ .../1/android/hardware/drm/Mode.aidl | 41 ++++++ .../hardware/drm/NumberOfSessions.aidl | 39 ++++++ .../hardware/drm/OfflineLicenseState.aidl | 40 ++++++ .../1/android/hardware/drm/OpaqueData.aidl | 38 ++++++ .../1/android/hardware/drm/Pattern.aidl | 39 ++++++ .../drm/ProvideProvisionResponseResult.aidl | 39 ++++++ .../hardware/drm/ProvisionRequest.aidl | 39 ++++++ .../1/android/hardware/drm/SecureStop.aidl | 38 ++++++ .../1/android/hardware/drm/SecureStopId.aidl | 38 ++++++ .../1/android/hardware/drm/SecurityLevel.aidl | 44 ++++++ .../1/android/hardware/drm/SharedBuffer.aidl | 41 ++++++ .../1/android/hardware/drm/Status.aidl | 77 +++++++++++ .../1/android/hardware/drm/SubSample.aidl | 39 ++++++ .../hardware/drm/SupportedContentType.aidl | 40 ++++++ .../1/android/hardware/drm/Uuid.aidl | 38 ++++++ dumpstate/aidl/Android.bp | 7 + .../android.hardware.dumpstate/1/.hash | 1 + .../hardware/dumpstate/IDumpstateDevice.aidl | 53 ++++++++ graphics/allocator/aidl/Android.bp | 7 + .../1/.hash | 1 + .../graphics/allocator/AllocationError.aidl | 40 ++++++ .../graphics/allocator/AllocationResult.aidl | 39 ++++++ .../graphics/allocator/IAllocator.aidl | 38 ++++++ health/aidl/Android.bp | 7 + .../aidl_api/android.hardware.health/1/.hash | 1 + .../hardware/health/BatteryCapacityLevel.aidl | 44 ++++++ .../hardware/health/BatteryHealth.aidl | 44 ++++++ .../hardware/health/BatteryStatus.aidl | 42 ++++++ .../1/android/hardware/health/DiskStats.aidl | 48 +++++++ .../1/android/hardware/health/HealthInfo.aidl | 61 +++++++++ .../1/android/hardware/health/IHealth.aidl | 51 +++++++ .../hardware/health/IHealthInfoCallback.aidl | 38 ++++++ .../android/hardware/health/StorageInfo.aidl | 41 ++++++ input/common/aidl/Android.bp | 7 + .../android.hardware.input.common/1/.hash | 1 + .../android/hardware/input/common/Action.aidl | 50 +++++++ .../1/android/hardware/input/common/Axis.aidl | 82 ++++++++++++ .../android/hardware/input/common/Button.aidl | 45 +++++++ .../hardware/input/common/Classification.aidl | 40 ++++++ .../hardware/input/common/EdgeFlag.aidl | 42 ++++++ .../1/android/hardware/input/common/Flag.aidl | 40 ++++++ .../1/android/hardware/input/common/Meta.aidl | 55 ++++++++ .../hardware/input/common/MotionEvent.aidl | 56 ++++++++ .../hardware/input/common/PointerCoords.aidl | 39 ++++++ .../input/common/PointerProperties.aidl | 39 ++++++ .../hardware/input/common/PolicyFlag.aidl | 47 +++++++ .../android/hardware/input/common/Source.aidl | 54 ++++++++ .../hardware/input/common/SourceClass.aidl | 43 ++++++ .../hardware/input/common/ToolType.aidl | 42 ++++++ .../hardware/input/common/VideoFrame.aidl | 41 ++++++ ir/aidl/Android.bp | 7 + ir/aidl/aidl_api/android.hardware.ir/1/.hash | 1 + .../hardware/ir/ConsumerIrFreqRange.aidl | 39 ++++++ .../1/android/hardware/ir/IConsumerIr.aidl | 39 ++++++ nfc/aidl/Android.bp | 7 + .../aidl_api/android.hardware.nfc/1/.hash | 1 + .../1/android/hardware/nfc/INfc.aidl | 47 +++++++ .../hardware/nfc/INfcClientCallback.aidl | 39 ++++++ .../1/android/hardware/nfc/NfcCloseType.aidl | 39 ++++++ .../1/android/hardware/nfc/NfcConfig.aidl | 52 ++++++++ .../1/android/hardware/nfc/NfcEvent.aidl | 43 ++++++ .../1/android/hardware/nfc/NfcStatus.aidl | 42 ++++++ .../hardware/nfc/PresenceCheckAlgorithm.aidl | 40 ++++++ .../hardware/nfc/ProtocolDiscoveryConfig.aidl | 46 +++++++ radio/aidl/Android.bp | 14 ++ .../aidl_api/android.hardware.radio/1/.hash | 1 + .../android/hardware/radio/AccessNetwork.aidl | 44 ++++++ .../hardware/radio/RadioAccessFamily.aidl | 58 ++++++++ .../1/android/hardware/radio/RadioConst.aidl | 41 ++++++ .../1/android/hardware/radio/RadioError.aidl | 126 ++++++++++++++++++ .../hardware/radio/RadioIndicationType.aidl | 39 ++++++ .../hardware/radio/RadioResponseInfo.aidl | 40 ++++++ .../radio/RadioResponseInfoModem.aidl | 41 ++++++ .../hardware/radio/RadioResponseType.aidl | 40 ++++++ .../hardware/radio/RadioTechnology.aidl | 58 ++++++++ .../hardware/radio/RadioTechnologyFamily.aidl | 39 ++++++ security/dice/aidl/Android.bp | 7 + .../android.hardware.security.dice/1/.hash | 1 + .../1/android/hardware/security/dice/Bcc.aidl | 39 ++++++ .../hardware/security/dice/BccHandover.aidl | 41 ++++++ .../hardware/security/dice/Config.aidl | 39 ++++++ .../hardware/security/dice/IDiceDevice.aidl | 42 ++++++ .../hardware/security/dice/InputValues.aidl | 44 ++++++ .../android/hardware/security/dice/Mode.aidl | 42 ++++++ .../hardware/security/dice/ResponseCode.aidl | 41 ++++++ .../hardware/security/dice/Signature.aidl | 39 ++++++ sensors/aidl/Android.bp | 10 ++ tv/tuner/aidl/Android.bp | 10 ++ usb/aidl/Android.bp | 7 + .../aidl_api/android.hardware.usb/1/.hash | 1 + .../usb/ContaminantDetectionStatus.aidl | 41 ++++++ .../usb/ContaminantProtectionMode.aidl | 41 ++++++ .../usb/ContaminantProtectionStatus.aidl | 42 ++++++ .../1/android/hardware/usb/IUsb.aidl | 45 +++++++ .../1/android/hardware/usb/IUsbCallback.aidl | 45 +++++++ .../1/android/hardware/usb/PortDataRole.aidl | 40 ++++++ .../1/android/hardware/usb/PortMode.aidl | 43 ++++++ .../1/android/hardware/usb/PortPowerRole.aidl | 40 ++++++ .../1/android/hardware/usb/PortRole.aidl | 40 ++++++ .../1/android/hardware/usb/PortStatus.aidl | 53 ++++++++ .../hardware/usb/PowerBrickStatus.aidl | 40 ++++++ .../1/android/hardware/usb/Status.aidl | 42 ++++++ .../1/android/hardware/usb/UsbDataStatus.aidl | 44 ++++++ uwb/aidl/Android.bp | 14 ++ .../android.hardware.uwb.fira_android/1/.hash | 1 + .../UwbVendorCapabilityTlvTypes.aidl | 47 +++++++ .../UwbVendorCapabilityTlvValues.aidl | 56 ++++++++ .../fira_android/UwbVendorGidAndroidOids.aidl | 39 ++++++ .../uwb/fira_android/UwbVendorGids.aidl | 38 ++++++ .../UwbVendorSessionAppConfigTlvTypes.aidl | 46 +++++++ .../UwbVendorSessionAppConfigTlvValues.aidl | 38 ++++++ .../UwbVendorSessionInitSessionType.aidl | 38 ++++++ .../fira_android/UwbVendorStatusCodes.aidl | 39 ++++++ .../aidl_api/android.hardware.uwb/1/.hash | 1 + .../1/android/hardware/uwb/IUwb.aidl | 41 ++++++ .../1/android/hardware/uwb/IUwbChip.aidl | 46 +++++++ .../hardware/uwb/IUwbClientCallback.aidl | 41 ++++++ .../1/android/hardware/uwb/UwbEvent.aidl | 43 ++++++ .../1/android/hardware/uwb/UwbStatus.aidl | 44 ++++++ wifi/hostapd/aidl/Android.bp | 7 + .../android.hardware.wifi.hostapd/1/.hash | 1 + .../android/hardware/wifi/hostapd/ApInfo.aidl | 43 ++++++ .../hardware/wifi/hostapd/BandMask.aidl | 41 ++++++ .../wifi/hostapd/ChannelBandwidth.aidl | 50 +++++++ .../hardware/wifi/hostapd/ChannelParams.aidl | 42 ++++++ .../hardware/wifi/hostapd/ClientInfo.aidl | 41 ++++++ .../hardware/wifi/hostapd/DebugLevel.aidl | 43 ++++++ .../hardware/wifi/hostapd/EncryptionType.aidl | 44 ++++++ .../hardware/wifi/hostapd/FrequencyRange.aidl | 39 ++++++ .../hardware/wifi/hostapd/Generation.aidl | 44 ++++++ .../wifi/hostapd/HostapdStatusCode.aidl | 43 ++++++ .../hardware/wifi/hostapd/HwModeParams.aidl | 48 +++++++ .../hardware/wifi/hostapd/IHostapd.aidl | 43 ++++++ .../wifi/hostapd/IHostapdCallback.aidl | 40 ++++++ .../wifi/hostapd/Ieee80211ReasonCode.aidl | 40 ++++++ .../hardware/wifi/hostapd/IfaceParams.aidl | 40 ++++++ .../hardware/wifi/hostapd/NetworkParams.aidl | 43 ++++++ .../wifi/hostapd/ParamSizeLimits.aidl | 40 ++++++ wifi/netlinkinterceptor/aidl/Android.bp | 7 + .../1/.hash | 1 + .../net/nlinterceptor/IInterceptor.aidl | 41 ++++++ .../net/nlinterceptor/InterceptedSocket.aidl | 39 ++++++ wifi/supplicant/aidl/Android.bp | 7 + 192 files changed, 6988 insertions(+) create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/1/.hash create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/CameraDeviceStatus.aidl create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/CameraMetadataType.aidl create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/CameraResourceCost.aidl create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/Status.aidl create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/TagBoundaryId.aidl create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/TorchModeStatus.aidl create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/VendorTag.aidl create mode 100644 camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/VendorTagSection.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/1/.hash create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/AsyncEventType.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/ContextHubInfo.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/ContextHubMessage.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/HostEndpointInfo.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/IContextHub.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/IContextHubCallback.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/NanoappBinary.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/NanoappInfo.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/NanoappRpcService.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/Setting.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/.hash create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/CryptoSchemes.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DecryptArgs.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DestinationBuffer.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetric.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetricGroup.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetricNamedValue.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetricValue.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/EventType.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/HdcpLevel.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/HdcpLevels.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/ICryptoPlugin.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/IDrmFactory.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/IDrmPlugin.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/IDrmPluginListener.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyRequest.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyRequestType.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeySetId.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyStatus.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyStatusType.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyType.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyValue.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/LogMessage.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/LogPriority.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Mode.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/NumberOfSessions.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/OfflineLicenseState.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/OpaqueData.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Pattern.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/ProvideProvisionResponseResult.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/ProvisionRequest.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SecureStop.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SecureStopId.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SecurityLevel.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SharedBuffer.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Status.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SubSample.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SupportedContentType.aidl create mode 100644 drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Uuid.aidl create mode 100644 dumpstate/aidl/aidl_api/android.hardware.dumpstate/1/.hash create mode 100644 dumpstate/aidl/aidl_api/android.hardware.dumpstate/1/android/hardware/dumpstate/IDumpstateDevice.aidl create mode 100644 graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/.hash create mode 100644 graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/android/hardware/graphics/allocator/AllocationError.aidl create mode 100644 graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/android/hardware/graphics/allocator/AllocationResult.aidl create mode 100644 graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/android/hardware/graphics/allocator/IAllocator.aidl create mode 100644 health/aidl/aidl_api/android.hardware.health/1/.hash create mode 100644 health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/BatteryCapacityLevel.aidl create mode 100644 health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/BatteryHealth.aidl create mode 100644 health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/BatteryStatus.aidl create mode 100644 health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/DiskStats.aidl create mode 100644 health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/HealthInfo.aidl create mode 100644 health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/IHealth.aidl create mode 100644 health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/IHealthInfoCallback.aidl create mode 100644 health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/StorageInfo.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/.hash create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Action.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Axis.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Button.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Classification.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/EdgeFlag.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Flag.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Meta.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/MotionEvent.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/PointerCoords.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/PointerProperties.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/PolicyFlag.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Source.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/SourceClass.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/ToolType.aidl create mode 100644 input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/VideoFrame.aidl create mode 100644 ir/aidl/aidl_api/android.hardware.ir/1/.hash create mode 100644 ir/aidl/aidl_api/android.hardware.ir/1/android/hardware/ir/ConsumerIrFreqRange.aidl create mode 100644 ir/aidl/aidl_api/android.hardware.ir/1/android/hardware/ir/IConsumerIr.aidl create mode 100644 nfc/aidl/aidl_api/android.hardware.nfc/1/.hash create mode 100644 nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/INfc.aidl create mode 100644 nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/INfcClientCallback.aidl create mode 100644 nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcCloseType.aidl create mode 100644 nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcConfig.aidl create mode 100644 nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcEvent.aidl create mode 100644 nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcStatus.aidl create mode 100644 nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/PresenceCheckAlgorithm.aidl create mode 100644 nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/ProtocolDiscoveryConfig.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/1/.hash create mode 100644 radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/AccessNetwork.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioAccessFamily.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioConst.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioError.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioIndicationType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioResponseInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioResponseInfoModem.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioResponseType.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioTechnology.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioTechnologyFamily.aidl create mode 100644 security/dice/aidl/aidl_api/android.hardware.security.dice/1/.hash create mode 100644 security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Bcc.aidl create mode 100644 security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/BccHandover.aidl create mode 100644 security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Config.aidl create mode 100644 security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/IDiceDevice.aidl create mode 100644 security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/InputValues.aidl create mode 100644 security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Mode.aidl create mode 100644 security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/ResponseCode.aidl create mode 100644 security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Signature.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/1/.hash create mode 100644 usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/ContaminantDetectionStatus.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/ContaminantProtectionMode.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/ContaminantProtectionStatus.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/IUsb.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/IUsbCallback.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortDataRole.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortMode.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortPowerRole.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortRole.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortStatus.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PowerBrickStatus.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/Status.aidl create mode 100644 usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/UsbDataStatus.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/.hash create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorGids.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb/1/.hash create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/IUwb.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/IUwbChip.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/IUwbClientCallback.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/UwbEvent.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/UwbStatus.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/.hash create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ApInfo.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/BandMask.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ChannelBandwidth.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ChannelParams.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ClientInfo.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/DebugLevel.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/EncryptionType.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/FrequencyRange.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/Generation.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/HostapdStatusCode.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/HwModeParams.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/IHostapd.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/IHostapdCallback.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/Ieee80211ReasonCode.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/IfaceParams.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/NetworkParams.aidl create mode 100644 wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ParamSizeLimits.aidl create mode 100644 wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/1/.hash create mode 100644 wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/1/android/hardware/net/nlinterceptor/IInterceptor.aidl create mode 100644 wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/1/android/hardware/net/nlinterceptor/InterceptedSocket.aidl diff --git a/automotive/vehicle/aidl/Android.bp b/automotive/vehicle/aidl/Android.bp index 1ca62ac207..9aeb4d2c78 100644 --- a/automotive/vehicle/aidl/Android.bp +++ b/automotive/vehicle/aidl/Android.bp @@ -41,4 +41,11 @@ aidl_interface { ], }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } diff --git a/camera/common/aidl/Android.bp b/camera/common/aidl/Android.bp index 39857efc95..19de22d586 100644 --- a/camera/common/aidl/Android.bp +++ b/camera/common/aidl/Android.bp @@ -25,4 +25,11 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/1/.hash b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/.hash new file mode 100644 index 0000000000..84cd552c29 --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/.hash @@ -0,0 +1 @@ +d1a423213d80e15de2b10e54d908ac5c29644fef diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/CameraDeviceStatus.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/CameraDeviceStatus.aidl new file mode 100644 index 0000000000..a53a914884 --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/CameraDeviceStatus.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 -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.common; +@Backing(type="int") @VintfStability +enum CameraDeviceStatus { + NOT_PRESENT = 0, + PRESENT = 1, + ENUMERATING = 2, +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/CameraMetadataType.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/CameraMetadataType.aidl new file mode 100644 index 0000000000..287dea3ffc --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/CameraMetadataType.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 -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.common; +@Backing(type="int") @VintfStability +enum CameraMetadataType { + BYTE = 0, + INT32 = 1, + FLOAT = 2, + INT64 = 3, + DOUBLE = 4, + RATIONAL = 5, +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/CameraResourceCost.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/CameraResourceCost.aidl new file mode 100644 index 0000000000..467f4510af --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/CameraResourceCost.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 -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.common; +@VintfStability +parcelable CameraResourceCost { + int resourceCost; + String[] conflictingDevices; +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/Status.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/Status.aidl new file mode 100644 index 0000000000..86589276e7 --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/Status.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 -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.common; +@Backing(type="int") @VintfStability +enum Status { + OK = 0, + ILLEGAL_ARGUMENT = 1, + CAMERA_IN_USE = 2, + MAX_CAMERAS_IN_USE = 3, + OPERATION_NOT_SUPPORTED = 4, + CAMERA_DISCONNECTED = 5, + INTERNAL_ERROR = 6, +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/TagBoundaryId.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/TagBoundaryId.aidl new file mode 100644 index 0000000000..cd5048347e --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/TagBoundaryId.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 -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.common; +@Backing(type="long") @VintfStability +enum TagBoundaryId { + AOSP = 0, + VENDOR = 2147483648, +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/TorchModeStatus.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/TorchModeStatus.aidl new file mode 100644 index 0000000000..cb1a2ae3d3 --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/TorchModeStatus.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 -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.common; +@Backing(type="int") @VintfStability +enum TorchModeStatus { + NOT_AVAILABLE = 0, + AVAILABLE_OFF = 1, + AVAILABLE_ON = 2, +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/VendorTag.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/VendorTag.aidl new file mode 100644 index 0000000000..b8b4ef4a38 --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/VendorTag.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 -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.common; +@VintfStability +parcelable VendorTag { + int tagId; + String tagName; + android.hardware.camera.common.CameraMetadataType tagType; +} diff --git a/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/VendorTagSection.aidl b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/VendorTagSection.aidl new file mode 100644 index 0000000000..140fba4545 --- /dev/null +++ b/camera/common/aidl/aidl_api/android.hardware.camera.common/1/android/hardware/camera/common/VendorTagSection.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 -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.common; +@VintfStability +parcelable VendorTagSection { + String sectionName; + android.hardware.camera.common.VendorTag[] tags; +} diff --git a/camera/metadata/aidl/Android.bp b/camera/metadata/aidl/Android.bp index c5f16e64d9..31d4b4d62c 100644 --- a/camera/metadata/aidl/Android.bp +++ b/camera/metadata/aidl/Android.bp @@ -25,4 +25,11 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } diff --git a/contexthub/aidl/Android.bp b/contexthub/aidl/Android.bp index 5926b776e1..a8654455e7 100644 --- a/contexthub/aidl/Android.bp +++ b/contexthub/aidl/Android.bp @@ -35,4 +35,11 @@ aidl_interface { apps_enabled: false, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/1/.hash b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/.hash new file mode 100644 index 0000000000..b01d289b28 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/.hash @@ -0,0 +1 @@ +10abe2e5202d9b80ccebf5f6376d711a9a212b27 diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/AsyncEventType.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/AsyncEventType.aidl new file mode 100644 index 0000000000..8e0ff89c12 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/AsyncEventType.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 -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="int") @VintfStability +enum AsyncEventType { + RESTARTED = 1, +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/ContextHubInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/ContextHubInfo.aidl new file mode 100644 index 0000000000..e5735566e7 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/ContextHubInfo.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 -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 ContextHubInfo { + String name; + String vendor; + String toolchain; + int id; + float peakMips; + int maxSupportedMessageLengthBytes; + long chrePlatformId; + byte chreApiMajorVersion; + byte chreApiMinorVersion; + char chrePatchVersion; + String[] supportedPermissions; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/ContextHubMessage.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/ContextHubMessage.aidl new file mode 100644 index 0000000000..e38c251928 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/ContextHubMessage.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 -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 ContextHubMessage { + long nanoappId; + char hostEndPoint; + int messageType; + byte[] messageBody; + String[] permissions; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/HostEndpointInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/HostEndpointInfo.aidl new file mode 100644 index 0000000000..84e8531eb9 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/HostEndpointInfo.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 HostEndpointInfo { + char hostEndpointId; + android.hardware.contexthub.HostEndpointInfo.Type type; + @nullable String packageName; + @nullable String attributionTag; + @Backing(type="int") @VintfStability + enum Type { + FRAMEWORK = 1, + APP = 2, + } +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/IContextHub.aidl new file mode 100644 index 0000000000..f0676bec74 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/IContextHub.aidl @@ -0,0 +1,49 @@ +/* + * 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 -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 +interface IContextHub { + List getContextHubs(); + void loadNanoapp(in int contextHubId, in android.hardware.contexthub.NanoappBinary appBinary, in int transactionId); + void unloadNanoapp(in int contextHubId, in long appId, in int transactionId); + void disableNanoapp(in int contextHubId, in long appId, in int transactionId); + void enableNanoapp(in int contextHubId, in long appId, in int transactionId); + void onSettingChanged(in android.hardware.contexthub.Setting setting, in boolean enabled); + void queryNanoapps(in int contextHubId); + void registerCallback(in int contextHubId, in android.hardware.contexthub.IContextHubCallback cb); + void sendMessageToHub(in int contextHubId, in android.hardware.contexthub.ContextHubMessage message); + void onHostEndpointConnected(in android.hardware.contexthub.HostEndpointInfo hostEndpointInfo); + void onHostEndpointDisconnected(char hostEndpointId); + const int EX_CONTEXT_HUB_UNSPECIFIED = -1; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/IContextHubCallback.aidl new file mode 100644 index 0000000000..f81f7cfdee --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/IContextHubCallback.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 -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 +interface IContextHubCallback { + void handleNanoappInfo(in android.hardware.contexthub.NanoappInfo[] appInfo); + void handleContextHubMessage(in android.hardware.contexthub.ContextHubMessage msg, in String[] msgContentPerms); + void handleContextHubAsyncEvent(in android.hardware.contexthub.AsyncEventType evt); + void handleTransactionResult(in int transactionId, in boolean success); +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/NanoappBinary.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/NanoappBinary.aidl new file mode 100644 index 0000000000..d53b28f943 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/NanoappBinary.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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 NanoappBinary { + long nanoappId; + int nanoappVersion; + int flags; + byte targetChreApiMajorVersion; + byte targetChreApiMinorVersion; + byte[] customBinary; + const int FLAG_SIGNED = 1; + const int FLAG_ENCRYPTED = 2; + const int FLAG_TCM_CAPABLE = 4; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/NanoappInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/NanoappInfo.aidl new file mode 100644 index 0000000000..7175d7f329 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/NanoappInfo.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 -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 NanoappInfo { + long nanoappId; + int nanoappVersion; + boolean enabled; + String[] permissions; + android.hardware.contexthub.NanoappRpcService[] rpcServices; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/NanoappRpcService.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/NanoappRpcService.aidl new file mode 100644 index 0000000000..a6a1644195 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/NanoappRpcService.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 -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 NanoappRpcService { + long id; + int version; +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/Setting.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/Setting.aidl new file mode 100644 index 0000000000..d998478db6 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/1/android/hardware/contexthub/Setting.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 -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 Setting { + LOCATION = 1, + WIFI_MAIN = 2, + WIFI_SCANNING = 3, + AIRPLANE_MODE = 4, + MICROPHONE = 5, + BT_MAIN = 6, + BT_SCANNING = 7, +} diff --git a/drm/aidl/Android.bp b/drm/aidl/Android.bp index 1d97e80aca..0fdba31c84 100644 --- a/drm/aidl/Android.bp +++ b/drm/aidl/Android.bp @@ -30,4 +30,11 @@ aidl_interface { }, }, double_loadable: true, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.common-V2"], + }, + ], + } diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/.hash b/drm/aidl/aidl_api/android.hardware.drm/1/.hash new file mode 100644 index 0000000000..886e28c0cb --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/.hash @@ -0,0 +1 @@ +7b4b0a0f36a7a6bb22d2016375e4a9d4a033592f diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/CryptoSchemes.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/CryptoSchemes.aidl new file mode 100644 index 0000000000..1d3c293eca --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/CryptoSchemes.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 -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.drm; +@VintfStability +parcelable CryptoSchemes { + List uuids; + List mimeTypes; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DecryptArgs.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DecryptArgs.aidl new file mode 100644 index 0000000000..9c574a48ef --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DecryptArgs.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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.drm; +@VintfStability +parcelable DecryptArgs { + boolean secure; + byte[] keyId; + byte[] iv; + android.hardware.drm.Mode mode; + android.hardware.drm.Pattern pattern; + android.hardware.drm.SubSample[] subSamples; + android.hardware.drm.SharedBuffer source; + long offset; + android.hardware.drm.DestinationBuffer destination; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DestinationBuffer.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DestinationBuffer.aidl new file mode 100644 index 0000000000..8c3ba7d0b7 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DestinationBuffer.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 -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.drm; +@VintfStability +union DestinationBuffer { + android.hardware.drm.SharedBuffer nonsecureMemory; + android.hardware.common.NativeHandle secureMemory; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetric.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetric.aidl new file mode 100644 index 0000000000..c78dff0b16 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetric.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 -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.drm; +@VintfStability +parcelable DrmMetric { + String name; + List attributes; + List values; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetricGroup.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetricGroup.aidl new file mode 100644 index 0000000000..4128eaa54d --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetricGroup.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 -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.drm; +@VintfStability +parcelable DrmMetricGroup { + List metrics; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetricNamedValue.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetricNamedValue.aidl new file mode 100644 index 0000000000..76ec35c0cf --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetricNamedValue.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 -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.drm; +@VintfStability +parcelable DrmMetricNamedValue { + String name; + android.hardware.drm.DrmMetricValue value; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetricValue.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetricValue.aidl new file mode 100644 index 0000000000..806491357c --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/DrmMetricValue.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 -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.drm; +@VintfStability +union DrmMetricValue { + long int64Value; + double doubleValue; + String stringValue; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/EventType.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/EventType.aidl new file mode 100644 index 0000000000..80ebb285ae --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/EventType.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 -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.drm; +@Backing(type="int") @VintfStability +enum EventType { + PROVISION_REQUIRED = 0, + KEY_NEEDED = 1, + KEY_EXPIRED = 2, + VENDOR_DEFINED = 3, + SESSION_RECLAIMED = 4, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/HdcpLevel.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/HdcpLevel.aidl new file mode 100644 index 0000000000..5704fb0726 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/HdcpLevel.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 -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.drm; +@Backing(type="int") @VintfStability +enum HdcpLevel { + HDCP_UNKNOWN = 0, + HDCP_NONE = 1, + HDCP_V1 = 2, + HDCP_V2 = 3, + HDCP_V2_1 = 4, + HDCP_V2_2 = 5, + HDCP_NO_OUTPUT = 6, + HDCP_V2_3 = 7, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/HdcpLevels.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/HdcpLevels.aidl new file mode 100644 index 0000000000..a6f86ace67 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/HdcpLevels.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 -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.drm; +@VintfStability +parcelable HdcpLevels { + android.hardware.drm.HdcpLevel connectedLevel; + android.hardware.drm.HdcpLevel maxLevel; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/ICryptoPlugin.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/ICryptoPlugin.aidl new file mode 100644 index 0000000000..31c45e0e1f --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/ICryptoPlugin.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 -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.drm; +@VintfStability +interface ICryptoPlugin { + int decrypt(in android.hardware.drm.DecryptArgs args); + List getLogMessages(); + void notifyResolution(in int width, in int height); + boolean requiresSecureDecoderComponent(in String mime); + void setMediaDrmSession(in byte[] sessionId); + void setSharedBufferBase(in android.hardware.drm.SharedBuffer base); +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/IDrmFactory.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/IDrmFactory.aidl new file mode 100644 index 0000000000..82efbb7ea0 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/IDrmFactory.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 -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.drm; +@VintfStability +interface IDrmFactory { + @nullable android.hardware.drm.IDrmPlugin createDrmPlugin(in android.hardware.drm.Uuid uuid, in String appPackageName); + @nullable android.hardware.drm.ICryptoPlugin createCryptoPlugin(in android.hardware.drm.Uuid uuid, in byte[] initData); + android.hardware.drm.CryptoSchemes getSupportedCryptoSchemes(); +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/IDrmPlugin.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/IDrmPlugin.aidl new file mode 100644 index 0000000000..ae10062c81 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/IDrmPlugin.aidl @@ -0,0 +1,76 @@ +/* + * 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 -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.drm; +@VintfStability +interface IDrmPlugin { + void closeSession(in byte[] sessionId); + byte[] decrypt(in byte[] sessionId, in byte[] keyId, in byte[] input, in byte[] iv); + byte[] encrypt(in byte[] sessionId, in byte[] keyId, in byte[] input, in byte[] iv); + android.hardware.drm.HdcpLevels getHdcpLevels(); + android.hardware.drm.KeyRequest getKeyRequest(in byte[] scope, in byte[] initData, in String mimeType, in android.hardware.drm.KeyType keyType, in android.hardware.drm.KeyValue[] optionalParameters); + List getLogMessages(); + List getMetrics(); + android.hardware.drm.NumberOfSessions getNumberOfSessions(); + List getOfflineLicenseKeySetIds(); + android.hardware.drm.OfflineLicenseState getOfflineLicenseState(in android.hardware.drm.KeySetId keySetId); + byte[] getPropertyByteArray(in String propertyName); + String getPropertyString(in String propertyName); + android.hardware.drm.ProvisionRequest getProvisionRequest(in String certificateType, in String certificateAuthority); + android.hardware.drm.SecureStop getSecureStop(in android.hardware.drm.SecureStopId secureStopId); + List getSecureStopIds(); + List getSecureStops(); + android.hardware.drm.SecurityLevel getSecurityLevel(in byte[] sessionId); + byte[] openSession(in android.hardware.drm.SecurityLevel securityLevel); + android.hardware.drm.KeySetId provideKeyResponse(in byte[] scope, in byte[] response); + android.hardware.drm.ProvideProvisionResponseResult provideProvisionResponse(in byte[] response); + List queryKeyStatus(in byte[] sessionId); + void releaseAllSecureStops(); + void releaseSecureStop(in android.hardware.drm.SecureStopId secureStopId); + void releaseSecureStops(in android.hardware.drm.OpaqueData ssRelease); + void removeAllSecureStops(); + void removeKeys(in byte[] sessionId); + void removeOfflineLicense(in android.hardware.drm.KeySetId keySetId); + void removeSecureStop(in android.hardware.drm.SecureStopId secureStopId); + boolean requiresSecureDecoder(in String mime, in android.hardware.drm.SecurityLevel level); + void restoreKeys(in byte[] sessionId, in android.hardware.drm.KeySetId keySetId); + void setCipherAlgorithm(in byte[] sessionId, in String algorithm); + void setListener(in android.hardware.drm.IDrmPluginListener listener); + void setMacAlgorithm(in byte[] sessionId, in String algorithm); + void setPlaybackId(in byte[] sessionId, in String playbackId); + void setPropertyByteArray(in String propertyName, in byte[] value); + void setPropertyString(in String propertyName, in String value); + byte[] sign(in byte[] sessionId, in byte[] keyId, in byte[] message); + byte[] signRSA(in byte[] sessionId, in String algorithm, in byte[] message, in byte[] wrappedkey); + boolean verify(in byte[] sessionId, in byte[] keyId, in byte[] message, in byte[] signature); +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/IDrmPluginListener.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/IDrmPluginListener.aidl new file mode 100644 index 0000000000..0a4b4b70bc --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/IDrmPluginListener.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 -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.drm; +@VintfStability +interface IDrmPluginListener { + oneway void onEvent(in android.hardware.drm.EventType eventType, in byte[] sessionId, in byte[] data); + oneway void onExpirationUpdate(in byte[] sessionId, in long expiryTimeInMS); + oneway void onKeysChange(in byte[] sessionId, in android.hardware.drm.KeyStatus[] keyStatusList, in boolean hasNewUsableKey); + oneway void onSessionLostState(in byte[] sessionId); +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyRequest.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyRequest.aidl new file mode 100644 index 0000000000..267f532755 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyRequest.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 -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.drm; +@VintfStability +parcelable KeyRequest { + byte[] request; + android.hardware.drm.KeyRequestType requestType; + String defaultUrl; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyRequestType.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyRequestType.aidl new file mode 100644 index 0000000000..34b9615c55 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyRequestType.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 -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.drm; +@Backing(type="int") @VintfStability +enum KeyRequestType { + INITIAL = 0, + RENEWAL = 1, + RELEASE = 2, + UNKNOWN = 3, + NONE = 4, + UPDATE = 5, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeySetId.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeySetId.aidl new file mode 100644 index 0000000000..58dfe1a412 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeySetId.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 -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.drm; +@VintfStability +parcelable KeySetId { + byte[] keySetId; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyStatus.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyStatus.aidl new file mode 100644 index 0000000000..53ab70f0fb --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyStatus.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 -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.drm; +@VintfStability +parcelable KeyStatus { + byte[] keyId; + android.hardware.drm.KeyStatusType type; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyStatusType.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyStatusType.aidl new file mode 100644 index 0000000000..261516f8ef --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyStatusType.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 -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.drm; +@Backing(type="int") @VintfStability +enum KeyStatusType { + USABLE = 0, + EXPIRED = 1, + OUTPUT_NOT_ALLOWED = 2, + STATUS_PENDING = 3, + INTERNAL_ERROR = 4, + USABLE_IN_FUTURE = 5, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyType.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyType.aidl new file mode 100644 index 0000000000..7a9d633578 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyType.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 -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.drm; +@Backing(type="int") @VintfStability +enum KeyType { + OFFLINE = 0, + STREAMING = 1, + RELEASE = 2, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyValue.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyValue.aidl new file mode 100644 index 0000000000..35d7b77bc9 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/KeyValue.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 -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.drm; +@VintfStability +parcelable KeyValue { + String key; + String value; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/LogMessage.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/LogMessage.aidl new file mode 100644 index 0000000000..93f76e1c41 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/LogMessage.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 -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.drm; +@VintfStability +parcelable LogMessage { + long timeMs; + android.hardware.drm.LogPriority priority; + String message; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/LogPriority.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/LogPriority.aidl new file mode 100644 index 0000000000..83362c359f --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/LogPriority.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 -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.drm; +@Backing(type="int") @VintfStability +enum LogPriority { + UNKNOWN = 0, + DEFAULT = 1, + VERBOSE = 2, + DEBUG = 3, + INFO = 4, + WARN = 5, + ERROR = 6, + FATAL = 7, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Mode.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Mode.aidl new file mode 100644 index 0000000000..7379774093 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Mode.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 -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.drm; +@Backing(type="int") @VintfStability +enum Mode { + UNENCRYPTED = 0, + AES_CTR = 1, + AES_CBC_CTS = 2, + AES_CBC = 3, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/NumberOfSessions.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/NumberOfSessions.aidl new file mode 100644 index 0000000000..a421125fc3 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/NumberOfSessions.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 -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.drm; +@VintfStability +parcelable NumberOfSessions { + int currentSessions; + int maxSessions; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/OfflineLicenseState.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/OfflineLicenseState.aidl new file mode 100644 index 0000000000..629564d706 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/OfflineLicenseState.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 -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.drm; +@Backing(type="int") @VintfStability +enum OfflineLicenseState { + UNKNOWN = 0, + USABLE = 1, + INACTIVE = 2, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/OpaqueData.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/OpaqueData.aidl new file mode 100644 index 0000000000..3085889faf --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/OpaqueData.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 -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.drm; +@VintfStability +parcelable OpaqueData { + byte[] opaqueData; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Pattern.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Pattern.aidl new file mode 100644 index 0000000000..b01562e67e --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Pattern.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 -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.drm; +@VintfStability +parcelable Pattern { + int encryptBlocks; + int skipBlocks; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/ProvideProvisionResponseResult.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/ProvideProvisionResponseResult.aidl new file mode 100644 index 0000000000..827de59093 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/ProvideProvisionResponseResult.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 -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.drm; +@VintfStability +parcelable ProvideProvisionResponseResult { + byte[] certificate; + byte[] wrappedKey; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/ProvisionRequest.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/ProvisionRequest.aidl new file mode 100644 index 0000000000..84c56621f2 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/ProvisionRequest.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 -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.drm; +@VintfStability +parcelable ProvisionRequest { + byte[] request; + String defaultUrl; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SecureStop.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SecureStop.aidl new file mode 100644 index 0000000000..81d2dfe75c --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SecureStop.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 -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.drm; +@VintfStability +parcelable SecureStop { + byte[] opaqueData; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SecureStopId.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SecureStopId.aidl new file mode 100644 index 0000000000..2b904c8629 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SecureStopId.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 -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.drm; +@VintfStability +parcelable SecureStopId { + byte[] secureStopId; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SecurityLevel.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SecurityLevel.aidl new file mode 100644 index 0000000000..65b2b9d2ae --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SecurityLevel.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 -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.drm; +@Backing(type="int") @VintfStability +enum SecurityLevel { + UNKNOWN = 0, + SW_SECURE_CRYPTO = 1, + SW_SECURE_DECODE = 2, + HW_SECURE_CRYPTO = 3, + HW_SECURE_DECODE = 4, + HW_SECURE_ALL = 5, + DEFAULT = 6, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SharedBuffer.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SharedBuffer.aidl new file mode 100644 index 0000000000..314fe7cf00 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SharedBuffer.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 -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.drm; +@VintfStability +parcelable SharedBuffer { + int bufferId; + long offset; + long size; + android.hardware.common.NativeHandle handle; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Status.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Status.aidl new file mode 100644 index 0000000000..c64068958f --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Status.aidl @@ -0,0 +1,77 @@ +/* + * 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 -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.drm; +@Backing(type="int") @VintfStability +enum Status { + OK = 0, + ERROR_DRM_NO_LICENSE = 1, + ERROR_DRM_LICENSE_EXPIRED = 2, + ERROR_DRM_SESSION_NOT_OPENED = 3, + ERROR_DRM_CANNOT_HANDLE = 4, + ERROR_DRM_INVALID_STATE = 5, + BAD_VALUE = 6, + ERROR_DRM_NOT_PROVISIONED = 7, + ERROR_DRM_RESOURCE_BUSY = 8, + ERROR_DRM_INSUFFICIENT_OUTPUT_PROTECTION = 9, + ERROR_DRM_DEVICE_REVOKED = 10, + ERROR_DRM_DECRYPT = 11, + ERROR_DRM_UNKNOWN = 12, + ERROR_DRM_INSUFFICIENT_SECURITY = 13, + ERROR_DRM_FRAME_TOO_LARGE = 14, + ERROR_DRM_SESSION_LOST_STATE = 15, + ERROR_DRM_RESOURCE_CONTENTION = 16, + CANNOT_DECRYPT_ZERO_SUBSAMPLES = 17, + CRYPTO_LIBRARY_ERROR = 18, + GENERAL_OEM_ERROR = 19, + GENERAL_PLUGIN_ERROR = 20, + INIT_DATA_INVALID = 21, + KEY_NOT_LOADED = 22, + LICENSE_PARSE_ERROR = 23, + LICENSE_POLICY_ERROR = 24, + LICENSE_RELEASE_ERROR = 25, + LICENSE_REQUEST_REJECTED = 26, + LICENSE_RESTORE_ERROR = 27, + LICENSE_STATE_ERROR = 28, + MALFORMED_CERTIFICATE = 29, + MEDIA_FRAMEWORK_ERROR = 30, + MISSING_CERTIFICATE = 31, + PROVISIONING_CERTIFICATE_ERROR = 32, + PROVISIONING_CONFIGURATION_ERROR = 33, + PROVISIONING_PARSE_ERROR = 34, + PROVISIONING_REQUEST_REJECTED = 35, + RETRYABLE_PROVISIONING_ERROR = 36, + SECURE_STOP_RELEASE_ERROR = 37, + STORAGE_READ_FAILURE = 38, + STORAGE_WRITE_FAILURE = 39, +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SubSample.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SubSample.aidl new file mode 100644 index 0000000000..57d815eeb2 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SubSample.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 -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.drm; +@VintfStability +parcelable SubSample { + int numBytesOfClearData; + int numBytesOfEncryptedData; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SupportedContentType.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SupportedContentType.aidl new file mode 100644 index 0000000000..6ef5db860a --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/SupportedContentType.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 -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.drm; +@VintfStability +parcelable SupportedContentType { + String mime; + android.hardware.drm.SecurityLevel minLevel; + android.hardware.drm.SecurityLevel maxLevel; +} diff --git a/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Uuid.aidl b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Uuid.aidl new file mode 100644 index 0000000000..3c2cfa2037 --- /dev/null +++ b/drm/aidl/aidl_api/android.hardware.drm/1/android/hardware/drm/Uuid.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 -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.drm; +@VintfStability +parcelable Uuid { + byte[16] uuid; +} diff --git a/dumpstate/aidl/Android.bp b/dumpstate/aidl/Android.bp index 22d836baa3..d9acc7a59c 100644 --- a/dumpstate/aidl/Android.bp +++ b/dumpstate/aidl/Android.bp @@ -39,4 +39,11 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } diff --git a/dumpstate/aidl/aidl_api/android.hardware.dumpstate/1/.hash b/dumpstate/aidl/aidl_api/android.hardware.dumpstate/1/.hash new file mode 100644 index 0000000000..d5c42266e9 --- /dev/null +++ b/dumpstate/aidl/aidl_api/android.hardware.dumpstate/1/.hash @@ -0,0 +1 @@ +d7c8d1b9054ec2fb0510edb68b95ca69fd038719 diff --git a/dumpstate/aidl/aidl_api/android.hardware.dumpstate/1/android/hardware/dumpstate/IDumpstateDevice.aidl b/dumpstate/aidl/aidl_api/android.hardware.dumpstate/1/android/hardware/dumpstate/IDumpstateDevice.aidl new file mode 100644 index 0000000000..4d78a4c09c --- /dev/null +++ b/dumpstate/aidl/aidl_api/android.hardware.dumpstate/1/android/hardware/dumpstate/IDumpstateDevice.aidl @@ -0,0 +1,53 @@ +/* + * 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 -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.dumpstate; +@VintfStability +interface IDumpstateDevice { + void dumpstateBoard(in ParcelFileDescriptor[] fd, in android.hardware.dumpstate.IDumpstateDevice.DumpstateMode mode, in long timeoutMillis); + boolean getVerboseLoggingEnabled(); + void setVerboseLoggingEnabled(in boolean enable); + const int ERROR_UNSUPPORTED_MODE = 1; + const int ERROR_DEVICE_LOGGING_NOT_ENABLED = 2; + @Backing(type="int") @VintfStability + enum DumpstateMode { + FULL = 0, + INTERACTIVE = 1, + REMOTE = 2, + WEAR = 3, + CONNECTIVITY = 4, + WIFI = 5, + DEFAULT = 6, + PROTO = 7, + } +} diff --git a/graphics/allocator/aidl/Android.bp b/graphics/allocator/aidl/Android.bp index ea8a599578..272ab48809 100644 --- a/graphics/allocator/aidl/Android.bp +++ b/graphics/allocator/aidl/Android.bp @@ -37,4 +37,11 @@ aidl_interface { min_sdk_version: "29", }, }, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.common-V2"], + }, + ], + } diff --git a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/.hash b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/.hash new file mode 100644 index 0000000000..783f3d7902 --- /dev/null +++ b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/.hash @@ -0,0 +1 @@ +0dab5f7fc46756d126ac127cd6033fc242eff0aa diff --git a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/android/hardware/graphics/allocator/AllocationError.aidl b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/android/hardware/graphics/allocator/AllocationError.aidl new file mode 100644 index 0000000000..6e7b739ed5 --- /dev/null +++ b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/android/hardware/graphics/allocator/AllocationError.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 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 -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.allocator; +@Backing(type="int") @VintfStability +enum AllocationError { + BAD_DESCRIPTOR = 0, + NO_RESOURCES = 1, + UNSUPPORTED = 2, +} diff --git a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/android/hardware/graphics/allocator/AllocationResult.aidl b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/android/hardware/graphics/allocator/AllocationResult.aidl new file mode 100644 index 0000000000..73cfeb5422 --- /dev/null +++ b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/android/hardware/graphics/allocator/AllocationResult.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 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 -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.allocator; +@VintfStability +parcelable AllocationResult { + int stride; + android.hardware.common.NativeHandle[] buffers; +} diff --git a/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/android/hardware/graphics/allocator/IAllocator.aidl b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/android/hardware/graphics/allocator/IAllocator.aidl new file mode 100644 index 0000000000..fe0b0a214b --- /dev/null +++ b/graphics/allocator/aidl/aidl_api/android.hardware.graphics.allocator/1/android/hardware/graphics/allocator/IAllocator.aidl @@ -0,0 +1,38 @@ +/* + * Copyright 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 -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.allocator; +@VintfStability +interface IAllocator { + android.hardware.graphics.allocator.AllocationResult allocate(in byte[] descriptor, in int count); +} diff --git a/health/aidl/Android.bp b/health/aidl/Android.bp index 86bca69e07..f0cd33f868 100644 --- a/health/aidl/Android.bp +++ b/health/aidl/Android.bp @@ -42,6 +42,13 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } cc_library { diff --git a/health/aidl/aidl_api/android.hardware.health/1/.hash b/health/aidl/aidl_api/android.hardware.health/1/.hash new file mode 100644 index 0000000000..92740100b5 --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/1/.hash @@ -0,0 +1 @@ +94e77215594f8ad98ab33a769263d48fdabed92e diff --git a/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/BatteryCapacityLevel.aidl b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/BatteryCapacityLevel.aidl new file mode 100644 index 0000000000..e5438865c1 --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/BatteryCapacityLevel.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 -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.health; +@Backing(type="int") @VintfStability +enum BatteryCapacityLevel { + UNSUPPORTED = -1, + UNKNOWN = 0, + CRITICAL = 1, + LOW = 2, + NORMAL = 3, + HIGH = 4, + FULL = 5, +} diff --git a/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/BatteryHealth.aidl b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/BatteryHealth.aidl new file mode 100644 index 0000000000..4ce7952af2 --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/BatteryHealth.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 -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.health; +@Backing(type="int") @VintfStability +enum BatteryHealth { + UNKNOWN = 1, + GOOD = 2, + OVERHEAT = 3, + DEAD = 4, + OVER_VOLTAGE = 5, + UNSPECIFIED_FAILURE = 6, + COLD = 7, +} diff --git a/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/BatteryStatus.aidl b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/BatteryStatus.aidl new file mode 100644 index 0000000000..340b2ecc3f --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/BatteryStatus.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 -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.health; +@Backing(type="int") @VintfStability +enum BatteryStatus { + UNKNOWN = 1, + CHARGING = 2, + DISCHARGING = 3, + NOT_CHARGING = 4, + FULL = 5, +} diff --git a/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/DiskStats.aidl b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/DiskStats.aidl new file mode 100644 index 0000000000..5aa58900bb --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/DiskStats.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 -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.health; +@VintfStability +parcelable DiskStats { + long reads; + long readMerges; + long readSectors; + long readTicks; + long writes; + long writeMerges; + long writeSectors; + long writeTicks; + long ioInFlight; + long ioTicks; + long ioInQueue; +} diff --git a/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/HealthInfo.aidl b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/HealthInfo.aidl new file mode 100644 index 0000000000..97d9e845db --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/HealthInfo.aidl @@ -0,0 +1,61 @@ +/* + * 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 -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.health; +@VintfStability +parcelable HealthInfo { + boolean chargerAcOnline; + boolean chargerUsbOnline; + boolean chargerWirelessOnline; + boolean chargerDockOnline; + int maxChargingCurrentMicroamps; + int maxChargingVoltageMicrovolts; + android.hardware.health.BatteryStatus batteryStatus; + android.hardware.health.BatteryHealth batteryHealth; + boolean batteryPresent; + int batteryLevel; + int batteryVoltageMillivolts; + int batteryTemperatureTenthsCelsius; + int batteryCurrentMicroamps; + int batteryCycleCount; + int batteryFullChargeUah; + int batteryChargeCounterUah; + String batteryTechnology; + int batteryCurrentAverageMicroamps; + android.hardware.health.DiskStats[] diskStats; + android.hardware.health.StorageInfo[] storageInfos; + android.hardware.health.BatteryCapacityLevel batteryCapacityLevel; + long batteryChargeTimeToFullNowSeconds; + int batteryFullChargeDesignCapacityUah; + const int BATTERY_CHARGE_TIME_TO_FULL_NOW_SECONDS_UNSUPPORTED = -1; +} diff --git a/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/IHealth.aidl b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/IHealth.aidl new file mode 100644 index 0000000000..7016ae4c86 --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/IHealth.aidl @@ -0,0 +1,51 @@ +/* + * 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 -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.health; +@VintfStability +interface IHealth { + void registerCallback(in android.hardware.health.IHealthInfoCallback callback); + void unregisterCallback(in android.hardware.health.IHealthInfoCallback callback); + void update(); + int getChargeCounterUah(); + int getCurrentNowMicroamps(); + int getCurrentAverageMicroamps(); + int getCapacity(); + long getEnergyCounterNwh(); + android.hardware.health.BatteryStatus getChargeStatus(); + android.hardware.health.StorageInfo[] getStorageInfo(); + android.hardware.health.DiskStats[] getDiskStats(); + android.hardware.health.HealthInfo getHealthInfo(); + const int STATUS_UNKNOWN = 2; + const int STATUS_CALLBACK_DIED = 4; +} diff --git a/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/IHealthInfoCallback.aidl b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/IHealthInfoCallback.aidl new file mode 100644 index 0000000000..1b6366fa7a --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/IHealthInfoCallback.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 -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.health; +@VintfStability +interface IHealthInfoCallback { + oneway void healthInfoChanged(in android.hardware.health.HealthInfo info); +} diff --git a/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/StorageInfo.aidl b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/StorageInfo.aidl new file mode 100644 index 0000000000..eaae5a6110 --- /dev/null +++ b/health/aidl/aidl_api/android.hardware.health/1/android/hardware/health/StorageInfo.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 -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.health; +@VintfStability +parcelable StorageInfo { + int eol; + int lifetimeA; + int lifetimeB; + String version; +} diff --git a/input/common/aidl/Android.bp b/input/common/aidl/Android.bp index b96f4d0635..390d8b54b1 100644 --- a/input/common/aidl/Android.bp +++ b/input/common/aidl/Android.bp @@ -20,4 +20,11 @@ aidl_interface { enabled: false, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/.hash b/input/common/aidl/aidl_api/android.hardware.input.common/1/.hash new file mode 100644 index 0000000000..6a5e1345b4 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/.hash @@ -0,0 +1 @@ +a796f8e2fe447a0ddba069b6edd1aba2b1c9fc42 diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Action.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Action.aidl new file mode 100644 index 0000000000..a2e0381188 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Action.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 -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.input.common; +@Backing(type="int") @VintfStability +enum Action { + DOWN = 0, + UP = 1, + MOVE = 2, + CANCEL = 3, + OUTSIDE = 4, + POINTER_DOWN = 5, + POINTER_UP = 6, + HOVER_MOVE = 7, + SCROLL = 8, + HOVER_ENTER = 9, + HOVER_EXIT = 10, + BUTTON_PRESS = 11, + BUTTON_RELEASE = 12, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Axis.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Axis.aidl new file mode 100644 index 0000000000..2114c7deb1 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Axis.aidl @@ -0,0 +1,82 @@ +/* + * 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 -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.input.common; +@Backing(type="int") @VintfStability +enum Axis { + X = 0, + Y = 1, + PRESSURE = 2, + SIZE = 3, + TOUCH_MAJOR = 4, + TOUCH_MINOR = 5, + TOOL_MAJOR = 6, + TOOL_MINOR = 7, + ORIENTATION = 8, + VSCROLL = 9, + HSCROLL = 10, + Z = 11, + RX = 12, + RY = 13, + RZ = 14, + HAT_X = 15, + HAT_Y = 16, + LTRIGGER = 17, + RTRIGGER = 18, + THROTTLE = 19, + RUDDER = 20, + WHEEL = 21, + GAS = 22, + BRAKE = 23, + DISTANCE = 24, + TILT = 25, + SCROLL = 26, + RELATIVE_X = 27, + RELATIVE_Y = 28, + GENERIC_1 = 32, + GENERIC_2 = 33, + GENERIC_3 = 34, + GENERIC_4 = 35, + GENERIC_5 = 36, + GENERIC_6 = 37, + GENERIC_7 = 38, + GENERIC_8 = 39, + GENERIC_9 = 40, + GENERIC_10 = 41, + GENERIC_11 = 42, + GENERIC_12 = 43, + GENERIC_13 = 44, + GENERIC_14 = 45, + GENERIC_15 = 46, + GENERIC_16 = 47, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Button.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Button.aidl new file mode 100644 index 0000000000..10ad65a19a --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Button.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 -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.input.common; +@Backing(type="int") @VintfStability +enum Button { + NONE = 0, + PRIMARY = 1, + SECONDARY = 2, + TERTIARY = 4, + BACK = 8, + FORWARD = 16, + STYLUS_PRIMARY = 32, + STYLUS_SECONDARY = 64, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Classification.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Classification.aidl new file mode 100644 index 0000000000..ddd524685f --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Classification.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 -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.input.common; +@Backing(type="byte") @VintfStability +enum Classification { + NONE = 0, + AMBIGUOUS_GESTURE = 1, + DEEP_PRESS = 2, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/EdgeFlag.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/EdgeFlag.aidl new file mode 100644 index 0000000000..1040049b81 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/EdgeFlag.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 -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.input.common; +@Backing(type="int") @VintfStability +enum EdgeFlag { + NONE = 0, + TOP = 1, + BOTTOM = 2, + LEFT = 4, + RIGHT = 8, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Flag.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Flag.aidl new file mode 100644 index 0000000000..d3fcd9ff16 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Flag.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 -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.input.common; +@Backing(type="int") @VintfStability +enum Flag { + WINDOW_IS_OBSCURED = 1, + IS_GENERATED_GESTURE = 8, + TAINTED = -2147483648, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Meta.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Meta.aidl new file mode 100644 index 0000000000..2c229f9f36 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Meta.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 -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.input.common; +@Backing(type="int") @VintfStability +enum Meta { + NONE = 0, + ALT_ON = 2, + ALT_LEFT_ON = 16, + ALT_RIGHT_ON = 32, + SHIFT_ON = 1, + SHIFT_LEFT_ON = 64, + SHIFT_RIGHT_ON = 128, + SYM_ON = 4, + FUNCTION_ON = 8, + CTRL_ON = 4096, + CTRL_LEFT_ON = 8192, + CTRL_RIGHT_ON = 16384, + META_ON = 65536, + META_LEFT_ON = 131072, + META_RIGHT_ON = 262144, + CAPS_LOCK_ON = 1048576, + NUM_LOCK_ON = 2097152, + SCROLL_LOCK_ON = 4194304, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/MotionEvent.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/MotionEvent.aidl new file mode 100644 index 0000000000..84af4bf4ca --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/MotionEvent.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 -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.input.common; +@VintfStability +parcelable MotionEvent { + int deviceId; + android.hardware.input.common.Source source; + int displayId; + long downTime; + long eventTime; + android.hardware.input.common.Action action; + byte actionIndex; + android.hardware.input.common.Button actionButton; + android.hardware.input.common.Flag flags; + android.hardware.input.common.PolicyFlag policyFlags; + android.hardware.input.common.EdgeFlag edgeFlags; + android.hardware.input.common.Meta metaState; + android.hardware.input.common.Button buttonState; + float xPrecision; + float yPrecision; + android.hardware.input.common.PointerProperties[] pointerProperties; + android.hardware.input.common.PointerCoords[] pointerCoords; + int deviceTimestamp; + android.hardware.input.common.VideoFrame[] frames; +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/PointerCoords.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/PointerCoords.aidl new file mode 100644 index 0000000000..353a106868 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/PointerCoords.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 -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.input.common; +@VintfStability +parcelable PointerCoords { + long bits; + float[] values; +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/PointerProperties.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/PointerProperties.aidl new file mode 100644 index 0000000000..a49581b438 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/PointerProperties.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 -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.input.common; +@VintfStability +parcelable PointerProperties { + int id; + android.hardware.input.common.ToolType toolType; +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/PolicyFlag.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/PolicyFlag.aidl new file mode 100644 index 0000000000..247e868fcb --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/PolicyFlag.aidl @@ -0,0 +1,47 @@ +/* + * 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 -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.input.common; +@Backing(type="int") @VintfStability +enum PolicyFlag { + WAKE = 1, + VIRTUAL = 2, + FUNCTION = 4, + GESTURE = 8, + INJECTED = 16777216, + TRUSTED = 33554432, + FILTERED = 67108864, + DISABLE_KEY_REPEAT = 134217728, + INTERACTIVE = 536870912, + PASS_TO_USER = 1073741824, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Source.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Source.aidl new file mode 100644 index 0000000000..396e06de97 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/Source.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 -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.input.common; +@Backing(type="int") @VintfStability +enum Source { + UNKNOWN = 0, + KEYBOARD = 257, + DPAD = 513, + GAMEPAD = 1025, + TOUCHSCREEN = 4098, + MOUSE = 8194, + STYLUS = 16386, + BLUETOOTH_STYLUS = 49154, + TRACKBALL = 65540, + MOUSE_RELATIVE = 131076, + TOUCHPAD = 1048584, + TOUCH_NAVIGATION = 2097152, + ROTARY_ENCODER = 4194304, + JOYSTICK = 16777232, + HDMI = 33554433, + SENSOR = 67108864, + ANY = -256, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/SourceClass.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/SourceClass.aidl new file mode 100644 index 0000000000..96eede24b0 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/SourceClass.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 -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.input.common; +@Backing(type="byte") @VintfStability +enum SourceClass { + NONE = 0, + BUTTON = 1, + POINTER = 2, + NAVIGATION = 4, + POSITION = 8, + JOYSTICK = 16, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/ToolType.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/ToolType.aidl new file mode 100644 index 0000000000..ac1b69d74e --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/ToolType.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 -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.input.common; +@Backing(type="byte") @VintfStability +enum ToolType { + UNKNOWN = 0, + FINGER = 1, + STYLUS = 2, + MOUSE = 3, + ERASER = 4, +} diff --git a/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/VideoFrame.aidl b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/VideoFrame.aidl new file mode 100644 index 0000000000..14985c51d5 --- /dev/null +++ b/input/common/aidl/aidl_api/android.hardware.input.common/1/android/hardware/input/common/VideoFrame.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 -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.input.common; +@VintfStability +parcelable VideoFrame { + char[] data; + int height; + int width; + long timestamp; +} diff --git a/ir/aidl/Android.bp b/ir/aidl/Android.bp index 5dbf68fdbe..2485f5bf87 100644 --- a/ir/aidl/Android.bp +++ b/ir/aidl/Android.bp @@ -39,4 +39,11 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } diff --git a/ir/aidl/aidl_api/android.hardware.ir/1/.hash b/ir/aidl/aidl_api/android.hardware.ir/1/.hash new file mode 100644 index 0000000000..30d216650f --- /dev/null +++ b/ir/aidl/aidl_api/android.hardware.ir/1/.hash @@ -0,0 +1 @@ +3e04aed366e96850c6164287eaf78a8e4ab071b0 diff --git a/ir/aidl/aidl_api/android.hardware.ir/1/android/hardware/ir/ConsumerIrFreqRange.aidl b/ir/aidl/aidl_api/android.hardware.ir/1/android/hardware/ir/ConsumerIrFreqRange.aidl new file mode 100644 index 0000000000..4a0d286938 --- /dev/null +++ b/ir/aidl/aidl_api/android.hardware.ir/1/android/hardware/ir/ConsumerIrFreqRange.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 -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.ir; +@VintfStability +parcelable ConsumerIrFreqRange { + int minHz; + int maxHz; +} diff --git a/ir/aidl/aidl_api/android.hardware.ir/1/android/hardware/ir/IConsumerIr.aidl b/ir/aidl/aidl_api/android.hardware.ir/1/android/hardware/ir/IConsumerIr.aidl new file mode 100644 index 0000000000..07bf4b4af2 --- /dev/null +++ b/ir/aidl/aidl_api/android.hardware.ir/1/android/hardware/ir/IConsumerIr.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 -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.ir; +@VintfStability +interface IConsumerIr { + android.hardware.ir.ConsumerIrFreqRange[] getCarrierFreqs(); + void transmit(in int carrierFreqHz, in int[] pattern); +} diff --git a/nfc/aidl/Android.bp b/nfc/aidl/Android.bp index 30365f636f..b9578f4858 100644 --- a/nfc/aidl/Android.bp +++ b/nfc/aidl/Android.bp @@ -40,4 +40,11 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } diff --git a/nfc/aidl/aidl_api/android.hardware.nfc/1/.hash b/nfc/aidl/aidl_api/android.hardware.nfc/1/.hash new file mode 100644 index 0000000000..46ec1e2a33 --- /dev/null +++ b/nfc/aidl/aidl_api/android.hardware.nfc/1/.hash @@ -0,0 +1 @@ +37acf94ceb095ad537b66c3bd77c30a6ad5f5b0e diff --git a/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/INfc.aidl b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/INfc.aidl new file mode 100644 index 0000000000..7a0ae54963 --- /dev/null +++ b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/INfc.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 -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.nfc; +@VintfStability +interface INfc { + void open(in android.hardware.nfc.INfcClientCallback clientCallback); + void close(in android.hardware.nfc.NfcCloseType type); + void coreInitialized(); + void factoryReset(); + android.hardware.nfc.NfcConfig getConfig(); + void powerCycle(); + void preDiscover(); + int write(in byte[] data); + void setEnableVerboseLogging(in boolean enable); + boolean isVerboseLoggingEnabled(); +} diff --git a/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/INfcClientCallback.aidl b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/INfcClientCallback.aidl new file mode 100644 index 0000000000..8150e818d7 --- /dev/null +++ b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/INfcClientCallback.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 -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.nfc; +@VintfStability +interface INfcClientCallback { + void sendData(in byte[] data); + void sendEvent(in android.hardware.nfc.NfcEvent event, in android.hardware.nfc.NfcStatus status); +} diff --git a/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcCloseType.aidl b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcCloseType.aidl new file mode 100644 index 0000000000..7d44d48e3e --- /dev/null +++ b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcCloseType.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 -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.nfc; +@Backing(type="int") @VintfStability +enum NfcCloseType { + DISABLE = 0, + HOST_SWITCHED_OFF = 1, +} diff --git a/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcConfig.aidl b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcConfig.aidl new file mode 100644 index 0000000000..92e0a9a82c --- /dev/null +++ b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcConfig.aidl @@ -0,0 +1,52 @@ +/* + * 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 -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.nfc; +@VintfStability +parcelable NfcConfig { + boolean nfaPollBailOutMode; + android.hardware.nfc.PresenceCheckAlgorithm presenceCheckAlgorithm; + android.hardware.nfc.ProtocolDiscoveryConfig nfaProprietaryCfg; + byte defaultOffHostRoute; + byte defaultOffHostRouteFelica; + byte defaultSystemCodeRoute; + byte defaultSystemCodePowerState; + byte defaultRoute; + byte offHostESEPipeId; + byte offHostSIMPipeId; + int maxIsoDepTransceiveLength; + byte[] hostAllowlist; + byte[] offHostRouteUicc; + byte[] offHostRouteEse; + byte defaultIsoDepRoute; +} diff --git a/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcEvent.aidl b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcEvent.aidl new file mode 100644 index 0000000000..dda258eb08 --- /dev/null +++ b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcEvent.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 -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.nfc; +@Backing(type="int") @VintfStability +enum NfcEvent { + OPEN_CPLT = 0, + CLOSE_CPLT = 1, + POST_INIT_CPLT = 2, + PRE_DISCOVER_CPLT = 3, + HCI_NETWORK_RESET = 4, + ERROR = 5, +} diff --git a/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcStatus.aidl b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcStatus.aidl new file mode 100644 index 0000000000..2632480bdb --- /dev/null +++ b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/NfcStatus.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 -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.nfc; +@Backing(type="int") @VintfStability +enum NfcStatus { + OK = 0, + FAILED = 1, + ERR_TRANSPORT = 2, + ERR_CMD_TIMEOUT = 3, + REFUSED = 4, +} diff --git a/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/PresenceCheckAlgorithm.aidl b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/PresenceCheckAlgorithm.aidl new file mode 100644 index 0000000000..9a9be215a6 --- /dev/null +++ b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/PresenceCheckAlgorithm.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 -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.nfc; +@Backing(type="byte") @VintfStability +enum PresenceCheckAlgorithm { + DEFAULT = 0, + I_BLOCK = 1, + ISO_DEP_NAK = 2, +} diff --git a/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/ProtocolDiscoveryConfig.aidl b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/ProtocolDiscoveryConfig.aidl new file mode 100644 index 0000000000..021dfe22d4 --- /dev/null +++ b/nfc/aidl/aidl_api/android.hardware.nfc/1/android/hardware/nfc/ProtocolDiscoveryConfig.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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.nfc; +@VintfStability +parcelable ProtocolDiscoveryConfig { + byte protocol18092Active; + byte protocolBPrime; + byte protocolDual; + byte protocol15693; + byte protocolKovio; + byte protocolMifare; + byte discoveryPollKovio; + byte discoveryPollBPrime; + byte discoveryListenBPrime; +} diff --git a/radio/aidl/Android.bp b/radio/aidl/Android.bp index c3288799a0..72f160d797 100644 --- a/radio/aidl/Android.bp +++ b/radio/aidl/Android.bp @@ -26,6 +26,13 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } aidl_interface { @@ -106,6 +113,13 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: ["android.hardware.radio-V1"], + }, + ], + } aidl_interface { diff --git a/radio/aidl/aidl_api/android.hardware.radio/1/.hash b/radio/aidl/aidl_api/android.hardware.radio/1/.hash new file mode 100644 index 0000000000..f6b2564745 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/1/.hash @@ -0,0 +1 @@ +31b668688e937e8e1eff48fea7b4bb37681114a0 diff --git a/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/AccessNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/AccessNetwork.aidl new file mode 100644 index 0000000000..8ce689f501 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/AccessNetwork.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 -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; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum AccessNetwork { + UNKNOWN = 0, + GERAN = 1, + UTRAN = 2, + EUTRAN = 3, + CDMA2000 = 4, + IWLAN = 5, + NGRAN = 6, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioAccessFamily.aidl b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioAccessFamily.aidl new file mode 100644 index 0000000000..ecc2a9be7c --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioAccessFamily.aidl @@ -0,0 +1,58 @@ +/* + * 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 -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; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RadioAccessFamily { + UNKNOWN = 1, + GPRS = 2, + EDGE = 4, + UMTS = 8, + IS95A = 16, + IS95B = 32, + ONE_X_RTT = 64, + EVDO_0 = 128, + EVDO_A = 256, + HSDPA = 512, + HSUPA = 1024, + HSPA = 2048, + EVDO_B = 4096, + EHRPD = 8192, + LTE = 16384, + HSPAP = 32768, + GSM = 65536, + TD_SCDMA = 131072, + IWLAN = 262144, + LTE_CA = 524288, + NR = 1048576, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioConst.aidl b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioConst.aidl new file mode 100644 index 0000000000..b91bf03511 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioConst.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 -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; +@JavaDerive(toString=true) @VintfStability +parcelable RadioConst { + const int MAX_RILDS = 3; + const int MAX_UUID_LENGTH = 64; + const int CARD_MAX_APPS = 8; + const int P2_CONSTANT_NO_P2 = -1; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioError.aidl b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioError.aidl new file mode 100644 index 0000000000..98606e588b --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioError.aidl @@ -0,0 +1,126 @@ +/* + * 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 -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; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RadioError { + NONE = 0, + RADIO_NOT_AVAILABLE = 1, + GENERIC_FAILURE = 2, + PASSWORD_INCORRECT = 3, + SIM_PIN2 = 4, + SIM_PUK2 = 5, + REQUEST_NOT_SUPPORTED = 6, + CANCELLED = 7, + OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, + OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9, + SMS_SEND_FAIL_RETRY = 10, + SIM_ABSENT = 11, + SUBSCRIPTION_NOT_AVAILABLE = 12, + MODE_NOT_SUPPORTED = 13, + FDN_CHECK_FAILURE = 14, + ILLEGAL_SIM_OR_ME = 15, + MISSING_RESOURCE = 16, + NO_SUCH_ELEMENT = 17, + DIAL_MODIFIED_TO_USSD = 18, + DIAL_MODIFIED_TO_SS = 19, + DIAL_MODIFIED_TO_DIAL = 20, + USSD_MODIFIED_TO_DIAL = 21, + USSD_MODIFIED_TO_SS = 22, + USSD_MODIFIED_TO_USSD = 23, + SS_MODIFIED_TO_DIAL = 24, + SS_MODIFIED_TO_USSD = 25, + SUBSCRIPTION_NOT_SUPPORTED = 26, + SS_MODIFIED_TO_SS = 27, + LCE_NOT_SUPPORTED = 36, + NO_MEMORY = 37, + INTERNAL_ERR = 38, + SYSTEM_ERR = 39, + MODEM_ERR = 40, + INVALID_STATE = 41, + NO_RESOURCES = 42, + SIM_ERR = 43, + INVALID_ARGUMENTS = 44, + INVALID_SIM_STATE = 45, + INVALID_MODEM_STATE = 46, + INVALID_CALL_ID = 47, + NO_SMS_TO_ACK = 48, + NETWORK_ERR = 49, + REQUEST_RATE_LIMITED = 50, + SIM_BUSY = 51, + SIM_FULL = 52, + NETWORK_REJECT = 53, + OPERATION_NOT_ALLOWED = 54, + EMPTY_RECORD = 55, + INVALID_SMS_FORMAT = 56, + ENCODING_ERR = 57, + INVALID_SMSC_ADDRESS = 58, + NO_SUCH_ENTRY = 59, + NETWORK_NOT_READY = 60, + NOT_PROVISIONED = 61, + NO_SUBSCRIPTION = 62, + NO_NETWORK_FOUND = 63, + DEVICE_IN_USE = 64, + ABORTED = 65, + INVALID_RESPONSE = 66, + OEM_ERROR_1 = 501, + OEM_ERROR_2 = 502, + OEM_ERROR_3 = 503, + OEM_ERROR_4 = 504, + OEM_ERROR_5 = 505, + OEM_ERROR_6 = 506, + OEM_ERROR_7 = 507, + OEM_ERROR_8 = 508, + OEM_ERROR_9 = 509, + OEM_ERROR_10 = 510, + OEM_ERROR_11 = 511, + OEM_ERROR_12 = 512, + OEM_ERROR_13 = 513, + OEM_ERROR_14 = 514, + OEM_ERROR_15 = 515, + OEM_ERROR_16 = 516, + OEM_ERROR_17 = 517, + OEM_ERROR_18 = 518, + OEM_ERROR_19 = 519, + OEM_ERROR_20 = 520, + OEM_ERROR_21 = 521, + OEM_ERROR_22 = 522, + OEM_ERROR_23 = 523, + OEM_ERROR_24 = 524, + OEM_ERROR_25 = 525, + SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED = 67, + ACCESS_BARRED = 68, + BLOCKED_DUE_TO_CALL = 69, + RF_HARDWARE_ISSUE = 70, + NO_RF_CALIBRATION_INFO = 71, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioIndicationType.aidl b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioIndicationType.aidl new file mode 100644 index 0000000000..54ea3a4b4f --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioIndicationType.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 -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; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RadioIndicationType { + UNSOLICITED = 0, + UNSOLICITED_ACK_EXP = 1, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioResponseInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioResponseInfo.aidl new file mode 100644 index 0000000000..b2a7a062f9 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioResponseInfo.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 -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; +@JavaDerive(toString=true) @VintfStability +parcelable RadioResponseInfo { + android.hardware.radio.RadioResponseType type; + int serial; + android.hardware.radio.RadioError error; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioResponseInfoModem.aidl b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioResponseInfoModem.aidl new file mode 100644 index 0000000000..37ed7bb230 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioResponseInfoModem.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 -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; +@JavaDerive(toString=true) @VintfStability +parcelable RadioResponseInfoModem { + android.hardware.radio.RadioResponseType type; + int serial; + android.hardware.radio.RadioError error; + boolean isEnabled; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioResponseType.aidl b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioResponseType.aidl new file mode 100644 index 0000000000..5cd99c43b0 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioResponseType.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 -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; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RadioResponseType { + SOLICITED = 0, + SOLICITED_ACK = 1, + SOLICITED_ACK_EXP = 2, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioTechnology.aidl b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioTechnology.aidl new file mode 100644 index 0000000000..9dad0a4977 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioTechnology.aidl @@ -0,0 +1,58 @@ +/* + * 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 -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; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RadioTechnology { + UNKNOWN = 0, + GPRS = 1, + EDGE = 2, + UMTS = 3, + IS95A = 4, + IS95B = 5, + ONE_X_RTT = 6, + EVDO_0 = 7, + EVDO_A = 8, + HSDPA = 9, + HSUPA = 10, + HSPA = 11, + EVDO_B = 12, + EHRPD = 13, + LTE = 14, + HSPAP = 15, + GSM = 16, + TD_SCDMA = 17, + IWLAN = 18, + LTE_CA = 19, + NR = 20, +} diff --git a/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioTechnologyFamily.aidl b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioTechnologyFamily.aidl new file mode 100644 index 0000000000..e6fdce269d --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio/1/android/hardware/radio/RadioTechnologyFamily.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 -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; +@Backing(type="int") @JavaDerive(toString=true) @VintfStability +enum RadioTechnologyFamily { + THREE_GPP = 0, + THREE_GPP2 = 1, +} diff --git a/security/dice/aidl/Android.bp b/security/dice/aidl/Android.bp index 8c31e26fe9..97781b325b 100644 --- a/security/dice/aidl/Android.bp +++ b/security/dice/aidl/Android.bp @@ -51,5 +51,12 @@ aidl_interface { ], }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + // versions: ["1"], } diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/.hash b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/.hash new file mode 100644 index 0000000000..3f08fd85f5 --- /dev/null +++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/.hash @@ -0,0 +1 @@ +02994f275fd7b1b40610c10eaeb0573f4312e358 diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Bcc.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Bcc.aidl new file mode 100644 index 0000000000..5af73583aa --- /dev/null +++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Bcc.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.dice; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable Bcc { + byte[] data; +} diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/BccHandover.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/BccHandover.aidl new file mode 100644 index 0000000000..8baca94ce8 --- /dev/null +++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/BccHandover.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.dice; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable BccHandover { + byte[32] cdiAttest; + byte[32] cdiSeal; + android.hardware.security.dice.Bcc bcc; +} diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Config.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Config.aidl new file mode 100644 index 0000000000..78dd2f886c --- /dev/null +++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Config.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.dice; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable Config { + byte[] desc; +} diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/IDiceDevice.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/IDiceDevice.aidl new file mode 100644 index 0000000000..383f4d1f26 --- /dev/null +++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/IDiceDevice.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 -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.dice; +/* @hide */ +@SensitiveData @VintfStability +interface IDiceDevice { + android.hardware.security.dice.Signature sign(in android.hardware.security.dice.InputValues[] id, in byte[] payload); + android.hardware.security.dice.Bcc getAttestationChain(in android.hardware.security.dice.InputValues[] inputValues); + android.hardware.security.dice.BccHandover derive(in android.hardware.security.dice.InputValues[] inputValues); + void demote(in android.hardware.security.dice.InputValues[] inputValues); +} diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/InputValues.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/InputValues.aidl new file mode 100644 index 0000000000..e43c4292e4 --- /dev/null +++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/InputValues.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.dice; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable InputValues { + byte[64] codeHash; + android.hardware.security.dice.Config config; + byte[64] authorityHash; + @nullable byte[] authorityDescriptor; + android.hardware.security.dice.Mode mode = android.hardware.security.dice.Mode.NOT_INITIALIZED; + byte[64] hidden; +} diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Mode.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Mode.aidl new file mode 100644 index 0000000000..295c32ec0c --- /dev/null +++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Mode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.dice; +/* @hide */ +@Backing(type="int") @VintfStability +enum Mode { + NOT_INITIALIZED = 0, + NORMAL = 1, + DEBUG = 2, + RECOVERY = 3, +} diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/ResponseCode.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/ResponseCode.aidl new file mode 100644 index 0000000000..c13afa6d95 --- /dev/null +++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/ResponseCode.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.dice; +@Backing(type="int") @VintfStability +enum ResponseCode { + PERMISSION_DENIED = 1, + SYSTEM_ERROR = 2, + NOT_IMPLEMENTED = 3, + DEMOTION_FAILED = 4, +} diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Signature.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Signature.aidl new file mode 100644 index 0000000000..294170d11f --- /dev/null +++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Signature.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.security.dice; +/* @hide */ +@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability +parcelable Signature { + byte[] data; +} diff --git a/sensors/aidl/Android.bp b/sensors/aidl/Android.bp index 92b7ad03d8..1c2d83fee7 100644 --- a/sensors/aidl/Android.bp +++ b/sensors/aidl/Android.bp @@ -29,4 +29,14 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.common-V2", + "android.hardware.common.fmq-V1", + ], + }, + ], + } diff --git a/tv/tuner/aidl/Android.bp b/tv/tuner/aidl/Android.bp index 63f91accdb..ecb744ccbf 100644 --- a/tv/tuner/aidl/Android.bp +++ b/tv/tuner/aidl/Android.bp @@ -24,4 +24,14 @@ aidl_interface { enabled: false, }, }, + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.common-V2", + "android.hardware.common.fmq-V1", + ], + }, + ], + } diff --git a/usb/aidl/Android.bp b/usb/aidl/Android.bp index f71cacb686..7eb60208f1 100644 --- a/usb/aidl/Android.bp +++ b/usb/aidl/Android.bp @@ -39,4 +39,11 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } diff --git a/usb/aidl/aidl_api/android.hardware.usb/1/.hash b/usb/aidl/aidl_api/android.hardware.usb/1/.hash new file mode 100644 index 0000000000..8f9ea333dd --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/1/.hash @@ -0,0 +1 @@ +9762531142d72e03bb4228209846c135f276d40e diff --git a/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/ContaminantDetectionStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/ContaminantDetectionStatus.aidl new file mode 100644 index 0000000000..24c69664f7 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/ContaminantDetectionStatus.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 -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.usb; +@VintfStability +enum ContaminantDetectionStatus { + NOT_SUPPORTED = 0, + DISABLED = 1, + NOT_DETECTED = 2, + DETECTED = 3, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/ContaminantProtectionMode.aidl b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/ContaminantProtectionMode.aidl new file mode 100644 index 0000000000..99798693ff --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/ContaminantProtectionMode.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 -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.usb; +@VintfStability +enum ContaminantProtectionMode { + NONE = 0, + FORCE_SINK = 1, + FORCE_SOURCE = 2, + FORCE_DISABLE = 3, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/ContaminantProtectionStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/ContaminantProtectionStatus.aidl new file mode 100644 index 0000000000..9642261444 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/ContaminantProtectionStatus.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 -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.usb; +@VintfStability +enum ContaminantProtectionStatus { + NONE = 0, + FORCE_SINK = 1, + FORCE_SOURCE = 2, + FORCE_DISABLE = 3, + DISABLED = 4, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/IUsb.aidl b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/IUsb.aidl new file mode 100644 index 0000000000..859f52652b --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/IUsb.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 -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.usb; +@VintfStability +interface IUsb { + oneway void enableContaminantPresenceDetection(in String portName, in boolean enable, long transactionId); + oneway void enableUsbData(in String portName, boolean enable, long transactionId); + oneway void enableUsbDataWhileDocked(in String portName, long transactionId); + oneway void queryPortStatus(long transactionId); + oneway void setCallback(in android.hardware.usb.IUsbCallback callback); + oneway void switchRole(in String portName, in android.hardware.usb.PortRole role, long transactionId); + oneway void limitPowerTransfer(in String portName, boolean limit, long transactionId); + oneway void resetUsbPort(in String portName, long transactionId); +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/IUsbCallback.aidl b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/IUsbCallback.aidl new file mode 100644 index 0000000000..4abfaec53b --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/IUsbCallback.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 -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.usb; +@VintfStability +interface IUsbCallback { + oneway void notifyPortStatusChange(in android.hardware.usb.PortStatus[] currentPortStatus, in android.hardware.usb.Status retval); + oneway void notifyRoleSwitchStatus(in String portName, in android.hardware.usb.PortRole newRole, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyEnableUsbDataStatus(in String portName, boolean enable, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyEnableUsbDataWhileDockedStatus(in String portName, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyContaminantEnabledStatus(in String portName, boolean enable, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyQueryPortStatus(in String portName, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyLimitPowerTransferStatus(in String portName, boolean limit, in android.hardware.usb.Status retval, long transactionId); + oneway void notifyResetUsbPortStatus(in String portName, in android.hardware.usb.Status retval, long transactionId); +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortDataRole.aidl b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortDataRole.aidl new file mode 100644 index 0000000000..105b316775 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortDataRole.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 -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.usb; +@VintfStability +enum PortDataRole { + NONE = 0, + HOST = 1, + DEVICE = 2, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortMode.aidl b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortMode.aidl new file mode 100644 index 0000000000..34e43343ad --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortMode.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 -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.usb; +@VintfStability +enum PortMode { + NONE = 0, + UFP = 1, + DFP = 2, + DRP = 3, + AUDIO_ACCESSORY = 4, + DEBUG_ACCESSORY = 5, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortPowerRole.aidl b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortPowerRole.aidl new file mode 100644 index 0000000000..0e6f3fb426 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortPowerRole.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 -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.usb; +@VintfStability +enum PortPowerRole { + NONE = 0, + SOURCE = 1, + SINK = 2, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortRole.aidl b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortRole.aidl new file mode 100644 index 0000000000..c66aeccde9 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortRole.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 -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.usb; +@VintfStability +union PortRole { + android.hardware.usb.PortPowerRole powerRole = android.hardware.usb.PortPowerRole.NONE; + android.hardware.usb.PortDataRole dataRole; + android.hardware.usb.PortMode mode; +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortStatus.aidl new file mode 100644 index 0000000000..dfd99fb249 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PortStatus.aidl @@ -0,0 +1,53 @@ +/* + * 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 -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.usb; +@VintfStability +parcelable PortStatus { + String portName; + android.hardware.usb.PortDataRole currentDataRole = android.hardware.usb.PortDataRole.NONE; + android.hardware.usb.PortPowerRole currentPowerRole = android.hardware.usb.PortPowerRole.NONE; + android.hardware.usb.PortMode currentMode = android.hardware.usb.PortMode.NONE; + boolean canChangeMode; + boolean canChangeDataRole; + boolean canChangePowerRole; + android.hardware.usb.PortMode[] supportedModes; + android.hardware.usb.ContaminantProtectionMode[] supportedContaminantProtectionModes; + boolean supportsEnableContaminantPresenceProtection; + android.hardware.usb.ContaminantProtectionStatus contaminantProtectionStatus = android.hardware.usb.ContaminantProtectionStatus.NONE; + boolean supportsEnableContaminantPresenceDetection; + android.hardware.usb.ContaminantDetectionStatus contaminantDetectionStatus = android.hardware.usb.ContaminantDetectionStatus.NOT_SUPPORTED; + android.hardware.usb.UsbDataStatus[] usbDataStatus; + boolean powerTransferLimited; + android.hardware.usb.PowerBrickStatus powerBrickStatus; +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PowerBrickStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PowerBrickStatus.aidl new file mode 100644 index 0000000000..01d2fdd9f7 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/PowerBrickStatus.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 -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.usb; +@VintfStability +enum PowerBrickStatus { + UNKNOWN = 0, + CONNECTED = 1, + NOT_CONNECTED = 2, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/Status.aidl b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/Status.aidl new file mode 100644 index 0000000000..f28fc2a70e --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/Status.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 -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.usb; +@Backing(type="int") @VintfStability +enum Status { + SUCCESS = 0, + ERROR = 1, + INVALID_ARGUMENT = 2, + UNRECOGNIZED_ROLE = 3, + NOT_SUPPORTED = 4, +} diff --git a/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/UsbDataStatus.aidl b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/UsbDataStatus.aidl new file mode 100644 index 0000000000..e2c0cfbef1 --- /dev/null +++ b/usb/aidl/aidl_api/android.hardware.usb/1/android/hardware/usb/UsbDataStatus.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 -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.usb; +@VintfStability +enum UsbDataStatus { + UNKNOWN = 0, + ENABLED = 1, + DISABLED_OVERHEAT = 2, + DISABLED_CONTAMINANT = 3, + DISABLED_DOCK = 4, + DISABLED_FORCE = 5, + DISABLED_DEBUG = 6, +} diff --git a/uwb/aidl/Android.bp b/uwb/aidl/Android.bp index 36cde9b68d..cc61046683 100755 --- a/uwb/aidl/Android.bp +++ b/uwb/aidl/Android.bp @@ -39,6 +39,13 @@ aidl_interface { min_sdk_version: "Tiramisu", }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } aidl_interface { @@ -62,4 +69,11 @@ aidl_interface { min_sdk_version: "Tiramisu", }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/.hash b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/.hash new file mode 100644 index 0000000000..ac0f6d8b4a --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/.hash @@ -0,0 +1 @@ +f9f7a7ae2f4650c0a42af37720c8a11e95a6bf33 diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl new file mode 100644 index 0000000000..cbe20688ad --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.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 -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.uwb.fira_android; +@Backing(type="int") @VintfStability +enum UwbVendorCapabilityTlvTypes { + SUPPORTED_POWER_STATS_QUERY = 192, + CCC_SUPPORTED_CHAPS_PER_SLOT = 160, + CCC_SUPPORTED_SYNC_CODES = 161, + CCC_SUPPORTED_HOPPING_CONFIG_MODES_AND_SEQUENCES = 162, + CCC_SUPPORTED_CHANNELS = 163, + CCC_SUPPORTED_VERSIONS = 164, + CCC_SUPPORTED_UWB_CONFIGS = 165, + CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 166, + CCC_SUPPORTED_RAN_MULTIPLIER = 167, + SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 227, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl new file mode 100644 index 0000000000..0e33f70221 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl @@ -0,0 +1,56 @@ +/* + * 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 -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.uwb.fira_android; +@Backing(type="long") @VintfStability +enum UwbVendorCapabilityTlvValues { + UWB_CONFIG_0 = 0, + UWB_CONFIG_1 = 1, + PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 0, + PULSE_SHAPE_PRECURSOR_FREE = 1, + PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 2, + CHAPS_PER_SLOT_3 = 1, + CHAPS_PER_SLOT_4 = 2, + CHAPS_PER_SLOT_6 = 4, + CHAPS_PER_SLOT_8 = 8, + CHAPS_PER_SLOT_9 = 16, + CHAPS_PER_SLOT_12 = 32, + CHAPS_PER_SLOT_24 = 64, + HOPPING_SEQUENCE_DEFAULT = 16, + HOPPING_SEQUENCE_AES = 8, + HOPPING_CONFIG_MODE_NONE = 128, + HOPPING_CONFIG_MODE_CONTINUOUS = 64, + HOPPING_CONFIG_MODE_ADAPTIVE = 32, + CCC_CHANNEL_5 = 1, + CCC_CHANNEL_9 = 2, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl new file mode 100644 index 0000000000..cd2e122029 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.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 -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.uwb.fira_android; +@Backing(type="byte") @VintfStability +enum UwbVendorGidAndroidOids { + ANDROID_GET_POWER_STATS = 0, + ANDROID_SET_COUNTRY_CODE = 1, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorGids.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorGids.aidl new file mode 100644 index 0000000000..5515c67961 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorGids.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 -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.uwb.fira_android; +@Backing(type="byte") @VintfStability +enum UwbVendorGids { + ANDROID = 12, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl new file mode 100644 index 0000000000..d35728fbef --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl @@ -0,0 +1,46 @@ +/* + * 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 -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.uwb.fira_android; +@Backing(type="int") @VintfStability +enum UwbVendorSessionAppConfigTlvTypes { + CCC_HOP_MODE_KEY = 160, + CCC_UWB_TIME0 = 161, + CCC_RANGING_PROTOCOL_VER = 163, + CCC_UWB_CONFIG_ID = 164, + CCC_PULSESHAPE_COMBO = 165, + CCC_URSK_TTL = 166, + NB_OF_RANGE_MEASUREMENTS = 227, + NB_OF_AZIMUTH_MEASUREMENTS = 228, + NB_OF_ELEVATION_MEASUREMENTS = 229, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl new file mode 100644 index 0000000000..a7f487bcd2 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.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 -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.uwb.fira_android; +@Backing(type="int") @VintfStability +enum UwbVendorSessionAppConfigTlvValues { + AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 240, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl new file mode 100644 index 0000000000..30a0a1b98f --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.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 -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.uwb.fira_android; +@Backing(type="int") @VintfStability +enum UwbVendorSessionInitSessionType { + CCC = 160, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl new file mode 100644 index 0000000000..2f534df10c --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/1/android/hardware/uwb/fira_android/UwbVendorStatusCodes.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 -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.uwb.fira_android; +@Backing(type="byte") @VintfStability +enum UwbVendorStatusCodes { + STATUS_ERROR_CCC_SE_BUSY = 80, + STATUS_ERROR_CCC_LIFECYCLE = 81, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/1/.hash b/uwb/aidl/aidl_api/android.hardware.uwb/1/.hash new file mode 100644 index 0000000000..b4bd21e465 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb/1/.hash @@ -0,0 +1 @@ +5bffd1b593a254bcbe9cb0b2fcf29f71452ae0af diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/IUwb.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/IUwb.aidl new file mode 100644 index 0000000000..9553ffc26d --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/IUwb.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.uwb; +@VintfStability +interface IUwb { + List getChips(); + android.hardware.uwb.IUwbChip getChip(String name); +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/IUwbChip.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/IUwbChip.aidl new file mode 100644 index 0000000000..0e640be2dd --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/IUwbChip.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.uwb; +@VintfStability +interface IUwbChip { + String getName(); + void open(in android.hardware.uwb.IUwbClientCallback clientCallback); + void close(); + void coreInit(); + void sessionInit(int sessionId); + int getSupportedAndroidUciVersion(); + int sendUciMessage(in byte[] data); +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/IUwbClientCallback.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/IUwbClientCallback.aidl new file mode 100644 index 0000000000..aac8e966bd --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/IUwbClientCallback.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.uwb; +@VintfStability +interface IUwbClientCallback { + oneway void onUciMessage(in byte[] data); + oneway void onHalEvent(in android.hardware.uwb.UwbEvent event, in android.hardware.uwb.UwbStatus status); +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/UwbEvent.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/UwbEvent.aidl new file mode 100644 index 0000000000..6b30d8c6ed --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/UwbEvent.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.uwb; +@Backing(type="int") @VintfStability +enum UwbEvent { + OPEN_CPLT = 0, + CLOSE_CPLT = 1, + POST_INIT_CPLT = 2, + ERROR = 3, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/UwbStatus.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/UwbStatus.aidl new file mode 100644 index 0000000000..88d766a7fa --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb/1/android/hardware/uwb/UwbStatus.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Copyright 2021 NXP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.uwb; +@Backing(type="int") @VintfStability +enum UwbStatus { + OK = 0, + FAILED = 1, + ERR_TRANSPORT = 2, + ERR_CMD_TIMEOUT = 3, + REFUSED = 4, +} diff --git a/wifi/hostapd/aidl/Android.bp b/wifi/hostapd/aidl/Android.bp index fcd06ffb7a..c97f8da833 100644 --- a/wifi/hostapd/aidl/Android.bp +++ b/wifi/hostapd/aidl/Android.bp @@ -43,4 +43,11 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/.hash b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/.hash new file mode 100644 index 0000000000..9a92d8acb4 --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/.hash @@ -0,0 +1 @@ +370160cd436c80c5d355de5ad11d2aaee684d801 diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ApInfo.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ApInfo.aidl new file mode 100644 index 0000000000..ca20f377be --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ApInfo.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 -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.hostapd; +@VintfStability +parcelable ApInfo { + String ifaceName; + String apIfaceInstance; + int freqMhz; + android.hardware.wifi.hostapd.ChannelBandwidth channelBandwidth; + android.hardware.wifi.hostapd.Generation generation; + byte[] apIfaceInstanceMacAddress; +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/BandMask.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/BandMask.aidl new file mode 100644 index 0000000000..b1e7f66ed4 --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/BandMask.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 -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.hostapd; +@Backing(type="int") @VintfStability +enum BandMask { + BAND_2_GHZ = 1, + BAND_5_GHZ = 2, + BAND_6_GHZ = 4, + BAND_60_GHZ = 8, +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ChannelBandwidth.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ChannelBandwidth.aidl new file mode 100644 index 0000000000..6c1fd22266 --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ChannelBandwidth.aidl @@ -0,0 +1,50 @@ +/* + * 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 -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.hostapd; +@Backing(type="int") @VintfStability +enum ChannelBandwidth { + BANDWIDTH_INVALID = 0, + BANDWIDTH_AUTO = 1, + BANDWIDTH_20_NOHT = 2, + BANDWIDTH_20 = 3, + BANDWIDTH_40 = 4, + BANDWIDTH_80 = 5, + BANDWIDTH_80P80 = 6, + BANDWIDTH_160 = 7, + BANDWIDTH_320 = 8, + BANDWIDTH_2160 = 9, + BANDWIDTH_4320 = 10, + BANDWIDTH_6480 = 11, + BANDWIDTH_8640 = 12, +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ChannelParams.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ChannelParams.aidl new file mode 100644 index 0000000000..43a9ada0e8 --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ChannelParams.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 -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.hostapd; +@VintfStability +parcelable ChannelParams { + android.hardware.wifi.hostapd.BandMask bandMask; + android.hardware.wifi.hostapd.FrequencyRange[] acsChannelFreqRangesMhz; + boolean enableAcs; + boolean acsShouldExcludeDfs; + int channel; +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ClientInfo.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ClientInfo.aidl new file mode 100644 index 0000000000..c4d62b68cc --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ClientInfo.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 -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.hostapd; +@VintfStability +parcelable ClientInfo { + String ifaceName; + String apIfaceInstance; + byte[] clientAddress; + boolean isConnected; +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/DebugLevel.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/DebugLevel.aidl new file mode 100644 index 0000000000..9795211df0 --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/DebugLevel.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 -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.hostapd; +@Backing(type="int") @VintfStability +enum DebugLevel { + EXCESSIVE = 0, + MSGDUMP = 1, + DEBUG = 2, + INFO = 3, + WARNING = 4, + ERROR = 5, +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/EncryptionType.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/EncryptionType.aidl new file mode 100644 index 0000000000..a7b20fa053 --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/EncryptionType.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 -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.hostapd; +@Backing(type="int") @VintfStability +enum EncryptionType { + NONE = 0, + WPA = 1, + WPA2 = 2, + WPA3_SAE_TRANSITION = 3, + WPA3_SAE = 4, + WPA3_OWE_TRANSITION = 5, + WPA3_OWE = 6, +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/FrequencyRange.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/FrequencyRange.aidl new file mode 100644 index 0000000000..11851438bd --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/FrequencyRange.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 -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.hostapd; +@VintfStability +parcelable FrequencyRange { + int startMhz; + int endMhz; +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/Generation.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/Generation.aidl new file mode 100644 index 0000000000..5bb0d32869 --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/Generation.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 -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.hostapd; +@Backing(type="int") @VintfStability +enum Generation { + WIFI_STANDARD_UNKNOWN = -1, + WIFI_STANDARD_LEGACY = 0, + WIFI_STANDARD_11N = 1, + WIFI_STANDARD_11AC = 2, + WIFI_STANDARD_11AD = 3, + WIFI_STANDARD_11AX = 4, + WIFI_STANDARD_11BE = 5, +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/HostapdStatusCode.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/HostapdStatusCode.aidl new file mode 100644 index 0000000000..548e497680 --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/HostapdStatusCode.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 -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.hostapd; +@Backing(type="int") @VintfStability +enum HostapdStatusCode { + SUCCESS = 0, + FAILURE_UNKNOWN = 1, + FAILURE_ARGS_INVALID = 2, + FAILURE_IFACE_UNKNOWN = 3, + FAILURE_IFACE_EXISTS = 4, + FAILURE_CLIENT_UNKNOWN = 5, +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/HwModeParams.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/HwModeParams.aidl new file mode 100644 index 0000000000..d732bcbcd8 --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/HwModeParams.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 -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.hostapd; +@VintfStability +parcelable HwModeParams { + boolean enable80211N; + boolean enable80211AC; + boolean enable80211AX; + boolean enable6GhzBand; + boolean enableHeSingleUserBeamformer; + boolean enableHeSingleUserBeamformee; + boolean enableHeMultiUserBeamformer; + boolean enableHeTargetWakeTime; + boolean enableEdmg; + boolean enable80211BE; + android.hardware.wifi.hostapd.ChannelBandwidth maximumChannelBandwidth; +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/IHostapd.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/IHostapd.aidl new file mode 100644 index 0000000000..ff941fdbf7 --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/IHostapd.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 -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.hostapd; +@VintfStability +interface IHostapd { + void addAccessPoint(in android.hardware.wifi.hostapd.IfaceParams ifaceParams, in android.hardware.wifi.hostapd.NetworkParams nwParams); + void forceClientDisconnect(in String ifaceName, in byte[] clientAddress, in android.hardware.wifi.hostapd.Ieee80211ReasonCode reasonCode); + void registerCallback(in android.hardware.wifi.hostapd.IHostapdCallback callback); + void removeAccessPoint(in String ifaceName); + void setDebugParams(in android.hardware.wifi.hostapd.DebugLevel level); + oneway void terminate(); +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/IHostapdCallback.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/IHostapdCallback.aidl new file mode 100644 index 0000000000..9dd062a1f2 --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/IHostapdCallback.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 -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.hostapd; +@VintfStability +interface IHostapdCallback { + oneway void onApInstanceInfoChanged(in android.hardware.wifi.hostapd.ApInfo apInfo); + oneway void onConnectedClientsChanged(in android.hardware.wifi.hostapd.ClientInfo clientInfo); + oneway void onFailure(in String ifaceName, in String instanceName); +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/Ieee80211ReasonCode.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/Ieee80211ReasonCode.aidl new file mode 100644 index 0000000000..99879b59bd --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/Ieee80211ReasonCode.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 -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.hostapd; +@Backing(type="int") @VintfStability +enum Ieee80211ReasonCode { + WLAN_REASON_UNSPECIFIED = 1, + WLAN_REASON_PREV_AUTH_NOT_VALID = 2, + WLAN_REASON_DISASSOC_AP_BUSY = 5, +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/IfaceParams.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/IfaceParams.aidl new file mode 100644 index 0000000000..0c88a398a3 --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/IfaceParams.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 -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.hostapd; +@VintfStability +parcelable IfaceParams { + String name; + android.hardware.wifi.hostapd.HwModeParams hwModeParams; + android.hardware.wifi.hostapd.ChannelParams[] channelParams; +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/NetworkParams.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/NetworkParams.aidl new file mode 100644 index 0000000000..4554223751 --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/NetworkParams.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 -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.hostapd; +@VintfStability +parcelable NetworkParams { + byte[] ssid; + boolean isHidden; + android.hardware.wifi.hostapd.EncryptionType encryptionType; + String passphrase; + boolean isMetered; + byte[] vendorElements; +} diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ParamSizeLimits.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ParamSizeLimits.aidl new file mode 100644 index 0000000000..70f94c1b5e --- /dev/null +++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/1/android/hardware/wifi/hostapd/ParamSizeLimits.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 -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.hostapd; +@Backing(type="int") @VintfStability +enum ParamSizeLimits { + SSID_MAX_LEN_IN_BYTES = 32, + WPA2_PSK_PASSPHRASE_MIN_LEN_IN_BYTES = 8, + WPA2_PSK_PASSPHRASE_MAX_LEN_IN_BYTES = 63, +} diff --git a/wifi/netlinkinterceptor/aidl/Android.bp b/wifi/netlinkinterceptor/aidl/Android.bp index 924edee384..2f7f34fb24 100644 --- a/wifi/netlinkinterceptor/aidl/Android.bp +++ b/wifi/netlinkinterceptor/aidl/Android.bp @@ -33,4 +33,11 @@ aidl_interface { enabled: false, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } diff --git a/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/1/.hash b/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/1/.hash new file mode 100644 index 0000000000..ea75498cd4 --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/1/.hash @@ -0,0 +1 @@ +32dabbc53f6f51763228400e3dea8e11c36d677f diff --git a/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/1/android/hardware/net/nlinterceptor/IInterceptor.aidl b/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/1/android/hardware/net/nlinterceptor/IInterceptor.aidl new file mode 100644 index 0000000000..3d0f955371 --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/1/android/hardware/net/nlinterceptor/IInterceptor.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 -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.net.nlinterceptor; +@VintfStability +interface IInterceptor { + android.hardware.net.nlinterceptor.InterceptedSocket createSocket(in int nlFamily, in int clientNlPid, in String clientName); + void closeSocket(in android.hardware.net.nlinterceptor.InterceptedSocket handle); + void subscribeGroup(in android.hardware.net.nlinterceptor.InterceptedSocket handle, in int nlGroup); + void unsubscribeGroup(in android.hardware.net.nlinterceptor.InterceptedSocket handle, in int nlGroup); +} diff --git a/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/1/android/hardware/net/nlinterceptor/InterceptedSocket.aidl b/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/1/android/hardware/net/nlinterceptor/InterceptedSocket.aidl new file mode 100644 index 0000000000..b679be506a --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/1/android/hardware/net/nlinterceptor/InterceptedSocket.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 -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.net.nlinterceptor; +@VintfStability +parcelable InterceptedSocket { + int nlFamily; + int portId; +} diff --git a/wifi/supplicant/aidl/Android.bp b/wifi/supplicant/aidl/Android.bp index d00dd2189f..ca0785b6a6 100644 --- a/wifi/supplicant/aidl/Android.bp +++ b/wifi/supplicant/aidl/Android.bp @@ -43,4 +43,11 @@ aidl_interface { }, }, }, + versions_with_info: [ + { + version: "1", + imports: [], + }, + ], + } -- GitLab From 0c7505f89dd3830ce1ebe8c9da66dcc43fd9a5e4 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Sat, 16 Apr 2022 08:32:29 +0900 Subject: [PATCH 746/825] V1 is the latest version of android.media.audio.common.types As part of the AIDL API freeze for TM, the V1 of android.media.autio.common.types was frozen. As a result, unversioned reference to the interface now refers to the V2 of the interface, yet to be frozen. This causes ODR violation where V1 and V2 of the interfaces are both used in the platform. To fix that, replaced the unversioned reference explicitly with the reference to V1. Bug: 225941299 Test: m Change-Id: I8c57c730bebfe88b182d42a4bb8acea32ac4aee8 --- audio/aidl/Android.bp | 2 +- automotive/audiocontrol/aidl/Android.bp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp index 46d177f79d..0b5b99340a 100644 --- a/audio/aidl/Android.bp +++ b/audio/aidl/Android.bp @@ -33,7 +33,7 @@ aidl_interface { "android/hardware/audio/common/SourceMetadata.aidl", ], imports: [ - "android.media.audio.common.types", + "android.media.audio.common.types-V1", ], stability: "vintf", backend: { diff --git a/automotive/audiocontrol/aidl/Android.bp b/automotive/audiocontrol/aidl/Android.bp index 0a3e1f5913..e5f7a4f8c1 100644 --- a/automotive/audiocontrol/aidl/Android.bp +++ b/automotive/audiocontrol/aidl/Android.bp @@ -14,8 +14,8 @@ aidl_interface { vendor_available: true, srcs: ["android/hardware/automotive/audiocontrol/*.aidl"], imports: [ - "android.hardware.audio.common", - "android.media.audio.common.types", + "android.hardware.audio.common-V1", + "android.media.audio.common.types-V1", ], stability: "vintf", backend: { -- GitLab From a811822a7b0d11f10e4b3e6927093a3796535967 Mon Sep 17 00:00:00 2001 From: Chris Weir Date: Mon, 18 Apr 2022 15:12:39 -0700 Subject: [PATCH 747/825] Unregistering HIDL interfaces breaks VTS Based on some back and forth on the internal IDL discuss group, it sounds like we can't unregister interfaces anymore if they're defined in the manifest. The CAN interface behind the HIDL interface will still be taken down correctly, but this will get rid of the failing attempt to bring down the HIDL interface. Bug: 213841914 Bug: 213843613 Test: VtsHalCanBusV1_0TargetTest Test: VtsHalCanControllerV1_0TargetTest Test: VtsHalCanBusVirtualV1_0TargetTest Change-Id: Iae4d6a650c30adacdc7c51140e0295915b516833 (cherry picked from commit d349f1d5213dc14d90016efb5e4934a80888064c) --- automotive/can/1.0/default/CanController.cpp | 14 --- .../VtsHalCanControllerV1_0TargetTest.cpp | 111 +++++++++++++----- 2 files changed, 81 insertions(+), 44 deletions(-) diff --git a/automotive/can/1.0/default/CanController.cpp b/automotive/can/1.0/default/CanController.cpp index 9c0f2c57a2..1b5bf5b48b 100644 --- a/automotive/can/1.0/default/CanController.cpp +++ b/automotive/can/1.0/default/CanController.cpp @@ -292,14 +292,6 @@ Return CanController::upInterface(const ICanController:: return ICanController::Result::OK; } -static bool unregisterCanBusService(const hidl_string& name, sp busService) { - auto manager = hidl::manager::V1_2::IServiceManager::getService(); - if (!manager) return false; - const auto res = manager->tryUnregister(ICanBus::descriptor, name, busService); - if (!res.isOk()) return false; - return res; -} - Return CanController::downInterface(const hidl_string& name) { LOG(VERBOSE) << "Attempting to bring interface down: " << name; @@ -313,12 +305,6 @@ Return CanController::downInterface(const hidl_string& name) { auto success = true; - if (!unregisterCanBusService(name, busEntry.mapped())) { - LOG(ERROR) << "Couldn't unregister " << name; - // don't return yet, let's try to do best-effort cleanup - success = false; - } - if (!busEntry.mapped()->down()) { LOG(ERROR) << "Couldn't bring " << name << " down"; success = false; diff --git a/automotive/can/1.0/vts/functional/VtsHalCanControllerV1_0TargetTest.cpp b/automotive/can/1.0/vts/functional/VtsHalCanControllerV1_0TargetTest.cpp index 294cd17758..f8ae871b33 100644 --- a/automotive/can/1.0/vts/functional/VtsHalCanControllerV1_0TargetTest.cpp +++ b/automotive/can/1.0/vts/functional/VtsHalCanControllerV1_0TargetTest.cpp @@ -33,18 +33,45 @@ using hardware::hidl_vec; using InterfaceType = ICanController::InterfaceType; using IfId = ICanController::BusConfig::InterfaceId; +struct Bus { + DISALLOW_COPY_AND_ASSIGN(Bus); + + Bus(sp controller, const ICanController::BusConfig& config) + : mIfname(config.name), mController(controller) { + // Don't bring up the bus, we just need a wrapper for the ICanBus object + /* Not using ICanBus::getService here, since it ignores interfaces not in the manifest + * file -- this is a test, so we don't want to add fake services to a device manifest. */ + auto manager = hidl::manager::V1_2::IServiceManager::getService(); + auto service = manager->get(ICanBus::descriptor, config.name); + mBus = ICanBus::castFrom(service); + } + + ICanBus* operator->() const { return mBus.get(); } + sp get() { return mBus; } + + Return send(const CanMessage& msg) { return mBus->send(msg); } + + private: + const std::string mIfname; + sp mController; + sp mBus; +}; + class CanControllerHalTest : public ::testing::TestWithParam { protected: virtual void SetUp() override; virtual void TearDown() override; static void SetUpTestCase(); + Bus makeBus(const std::string ifaceName); + hidl_vec getSupportedInterfaceTypes(); bool isSupported(InterfaceType iftype); bool up(InterfaceType iftype, const std::string srvname, std::string ifname, ICanController::Result expected); - void assertRegistered(const std::string srvname, bool expectRegistered); + void assertRegistered(const std::string srvname, const std::string ifaceName, + bool expectRegistered); sp mCanController; static hidl_vec mBusNames; @@ -117,16 +144,33 @@ bool CanControllerHalTest::up(InterfaceType iftype, std::string srvname, std::st return true; } -void CanControllerHalTest::assertRegistered(std::string srvname, bool expectRegistered) { +void CanControllerHalTest::assertRegistered(const std::string srvname, const std::string ifaceName, + bool expectRegistered) { /* Not using ICanBus::tryGetService here, since it ignores interfaces not in the manifest * file -- this is a test, so we don't want to add fake services to a device manifest. */ auto manager = hidl::manager::V1_2::IServiceManager::getService(); auto busService = manager->get(ICanBus::descriptor, srvname); + if (!expectRegistered) { + /* We can't unregister a HIDL interface defined in the manifest, so we'll just check to make + * sure that the interface behind it is down */ + auto bus = makeBus(ifaceName); + const auto result = bus->send({}); + ASSERT_EQ(Result::INTERFACE_DOWN, result); + return; + } ASSERT_EQ(expectRegistered, busService.withDefault(nullptr) != nullptr) << "ICanBus/" << srvname << (expectRegistered ? " is not " : " is ") << "registered" << " (should be otherwise)"; } +Bus CanControllerHalTest::makeBus(const std::string ifaceName) { + ICanController::BusConfig config = {}; + config.name = mBusNames[0]; + config.interfaceId.virtualif({ifaceName}); + + return Bus(mCanController, config); +} + TEST_P(CanControllerHalTest, SupportsSomething) { const auto supported = getSupportedInterfaceTypes(); ASSERT_GT(supported.size(), 0u); @@ -134,15 +178,17 @@ TEST_P(CanControllerHalTest, SupportsSomething) { TEST_P(CanControllerHalTest, BringUpDown) { const std::string name = mBusNames[0]; + const std::string iface = "vcan57"; + mCanController->downInterface(name); + + assertRegistered(name, iface, false); - assertRegistered(name, false); - if (!up(InterfaceType::VIRTUAL, name, "vcan57", ICanController::Result::OK)) GTEST_SKIP(); - assertRegistered(name, true); + if (!up(InterfaceType::VIRTUAL, name, iface, ICanController::Result::OK)) GTEST_SKIP(); + assertRegistered(name, iface, true); const auto dnresult = mCanController->downInterface(name); ASSERT_TRUE(dnresult); - - assertRegistered(name, false); + assertRegistered(name, iface, false); } TEST_P(CanControllerHalTest, DownFake) { @@ -152,18 +198,19 @@ TEST_P(CanControllerHalTest, DownFake) { TEST_P(CanControllerHalTest, UpTwice) { const std::string name = mBusNames[0]; + const std::string iface = "vcan72"; - assertRegistered(name, false); - if (!up(InterfaceType::VIRTUAL, name, "vcan72", ICanController::Result::OK)) GTEST_SKIP(); - assertRegistered(name, true); + assertRegistered(name, iface, false); + if (!up(InterfaceType::VIRTUAL, name, iface, ICanController::Result::OK)) GTEST_SKIP(); + assertRegistered(name, iface, true); if (!up(InterfaceType::VIRTUAL, name, "vcan73", ICanController::Result::INVALID_STATE)) { GTEST_SKIP(); } - assertRegistered(name, true); + assertRegistered(name, iface, true); const auto result = mCanController->downInterface(name); ASSERT_TRUE(result); - assertRegistered(name, false); + assertRegistered(name, iface, false); } TEST_P(CanControllerHalTest, ConfigCompatibility) { @@ -230,63 +277,67 @@ TEST_P(CanControllerHalTest, ConfigCompatibility) { TEST_P(CanControllerHalTest, FailEmptyName) { const std::string name = ""; + const std::string iface = "vcan57"; - assertRegistered(name, false); - if (!up(InterfaceType::VIRTUAL, name, "vcan57", ICanController::Result::BAD_SERVICE_NAME)) { + assertRegistered(name, iface, false); + if (!up(InterfaceType::VIRTUAL, name, iface, ICanController::Result::BAD_SERVICE_NAME)) { GTEST_SKIP(); } - assertRegistered(name, false); + assertRegistered(name, iface, false); } TEST_P(CanControllerHalTest, FailBadName) { // 33 characters (name can be at most 32 characters long) const std::string name = "ab012345678901234567890123456789c"; + const std::string iface = "vcan57"; - assertRegistered(name, false); - if (!up(InterfaceType::VIRTUAL, name, "vcan57", ICanController::Result::BAD_SERVICE_NAME)) { + assertRegistered(name, iface, false); + if (!up(InterfaceType::VIRTUAL, name, iface, ICanController::Result::BAD_SERVICE_NAME)) { GTEST_SKIP(); } - assertRegistered(name, false); + assertRegistered(name, iface, false); } TEST_P(CanControllerHalTest, FailBadVirtualAddress) { const std::string name = mBusNames[0]; + const std::string iface = ""; - assertRegistered(name, false); - if (!up(InterfaceType::VIRTUAL, name, "", ICanController::Result::BAD_INTERFACE_ID)) { + assertRegistered(name, iface, false); + if (!up(InterfaceType::VIRTUAL, name, iface, ICanController::Result::BAD_INTERFACE_ID)) { GTEST_SKIP(); } - assertRegistered(name, false); + assertRegistered(name, iface, false); } TEST_P(CanControllerHalTest, FailBadSocketcanAddress) { const std::string name = mBusNames[0]; + const std::string iface = "can87"; - assertRegistered(name, false); - if (!up(InterfaceType::SOCKETCAN, name, "can87", ICanController::Result::BAD_INTERFACE_ID)) { + assertRegistered(name, iface, false); + if (!up(InterfaceType::SOCKETCAN, name, iface, ICanController::Result::BAD_INTERFACE_ID)) { GTEST_SKIP(); } - assertRegistered(name, false); + assertRegistered(name, iface, false); auto supported = up(InterfaceType::SOCKETCAN, name, "", ICanController::Result::BAD_INTERFACE_ID); ASSERT_TRUE(supported); - assertRegistered(name, false); + assertRegistered(name, iface, false); } TEST_P(CanControllerHalTest, FailBadSlcanAddress) { const std::string name = mBusNames[0]; + const std::string iface = "/dev/shouldnotexist123"; - assertRegistered(name, false); - if (!up(InterfaceType::SLCAN, name, "/dev/shouldnotexist123", - ICanController::Result::BAD_INTERFACE_ID)) { + assertRegistered(name, iface, false); + if (!up(InterfaceType::SLCAN, name, iface, ICanController::Result::BAD_INTERFACE_ID)) { GTEST_SKIP(); } - assertRegistered(name, false); + assertRegistered(name, iface, false); auto supported = up(InterfaceType::SLCAN, name, "", ICanController::Result::BAD_INTERFACE_ID); ASSERT_TRUE(supported); - assertRegistered(name, false); + assertRegistered(name, iface, false); } /** -- GitLab From 712f48c2176b4833cafb4972478939c8e8f7f04a Mon Sep 17 00:00:00 2001 From: Tim Murray Date: Tue, 19 Apr 2022 17:36:33 -0700 Subject: [PATCH 748/825] Fix WorkerThreadTest Queue capacity needs to be NUM_TASKS + 1 for the extra final cv.notify at the end. Test: atest --host --rerun-until-failure 1000 WorkerThreadTest Bug: b/229801892 Change-Id: I95eb07680fe80cfc3bfafaa2de81c48d61d14b4b --- biometrics/fingerprint/aidl/default/tests/WorkerThreadTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biometrics/fingerprint/aidl/default/tests/WorkerThreadTest.cpp b/biometrics/fingerprint/aidl/default/tests/WorkerThreadTest.cpp index b2417bd242..902fb40c6b 100644 --- a/biometrics/fingerprint/aidl/default/tests/WorkerThreadTest.cpp +++ b/biometrics/fingerprint/aidl/default/tests/WorkerThreadTest.cpp @@ -71,7 +71,7 @@ TEST(WorkerThreadTest, ScheduleReturnsFalseWhenQueueIsFull) { TEST(WorkerThreadTest, TasksExecuteInOrder) { constexpr int NUM_TASKS = 10000; - WorkerThread worker(NUM_TASKS); + WorkerThread worker(NUM_TASKS + 1); std::mutex mut; std::condition_variable cv; -- GitLab From 3d919f9f6cd2a5addf67542173a77032dbecb3fd Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Wed, 20 Apr 2022 13:50:59 -0700 Subject: [PATCH 749/825] Camera: Correct request settings R&C override Assign the R&C overriden 'settingsMetadata' in the capture request. Bug: 222648486 Test: adb shell VtsAidlHalCameraProvider_TargetTest --gtest_filter=PerInstance/CameraAidlTest.processMultiCaptureRequestPreview/0_android_hardware_camera_provider_ICameraProvider_internal_0 Change-Id: I5825ebae59e8d3c05e5c301825b0ab8e6c1f50dc --- .../provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp index bde56b315c..462698c87a 100644 --- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp +++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp @@ -1554,7 +1554,7 @@ TEST_P(CameraAidlTest, processMultiCaptureRequestPreview) { CaptureRequest& request = requests[0]; request.frameNumber = frameNumber; request.fmqSettingsSize = 0; - request.settings.metadata = settings; + request.settings = settingsMetadata; std::vector& outputBuffers = request.outputBuffers; -- GitLab From 52afeb68e3d0f2166cde4b173dd890812d01ea61 Mon Sep 17 00:00:00 2001 From: Isaac Chiou Date: Wed, 16 Mar 2022 18:47:01 +0800 Subject: [PATCH 750/825] Add HAL APIs for TX power limits To lower the instantaneous battery current draw of WiFi, we provide a way to allow PowerManager to enable/disable Tx power limits. In the legacy HAL, we call the API in Broadcom HAL to enable/disable WiFi TX power limits. Bug: 215193418 Test: New APIs work fine Change-Id: I1fbe71c3380514e2eba96adc5902d2028a55e006 --- wifi/1.6/default/wifi_legacy_hal.cpp | 4 ++++ wifi/1.6/default/wifi_legacy_hal.h | 2 ++ wifi/1.6/default/wifi_legacy_hal_stubs.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/wifi/1.6/default/wifi_legacy_hal.cpp b/wifi/1.6/default/wifi_legacy_hal.cpp index bb8cf590d9..2211897cd2 100644 --- a/wifi/1.6/default/wifi_legacy_hal.cpp +++ b/wifi/1.6/default/wifi_legacy_hal.cpp @@ -1585,6 +1585,10 @@ wifi_error WifiLegacyHal::chreRegisterHandler(const std::string& iface_name, return status; } +wifi_error WifiLegacyHal::enableWifiTxPowerLimits(const std::string& iface_name, bool enable) { + return global_func_table_.wifi_enable_tx_power_limits(getIfaceHandle(iface_name), enable); +} + void WifiLegacyHal::invalidate() { global_handle_ = nullptr; iface_name_to_handle_.clear(); diff --git a/wifi/1.6/default/wifi_legacy_hal.h b/wifi/1.6/default/wifi_legacy_hal.h index 6f42f70359..2b923b44a7 100644 --- a/wifi/1.6/default/wifi_legacy_hal.h +++ b/wifi/1.6/default/wifi_legacy_hal.h @@ -683,6 +683,8 @@ class WifiLegacyHal { wifi_error chreRegisterHandler(const std::string& iface_name, const ChreCallbackHandlers& handler); + wifi_error enableWifiTxPowerLimits(const std::string& iface_name, bool enable); + private: // Retrieve interface handles for all the available interfaces. wifi_error retrieveIfaceHandles(); diff --git a/wifi/1.6/default/wifi_legacy_hal_stubs.cpp b/wifi/1.6/default/wifi_legacy_hal_stubs.cpp index 5ad22f5803..b3bd37389c 100644 --- a/wifi/1.6/default/wifi_legacy_hal_stubs.cpp +++ b/wifi/1.6/default/wifi_legacy_hal_stubs.cpp @@ -166,6 +166,7 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) { populateStubFor(&hal_fn->wifi_nan_rtt_chre_enable_request); populateStubFor(&hal_fn->wifi_nan_rtt_chre_disable_request); populateStubFor(&hal_fn->wifi_chre_register_handler); + populateStubFor(&hal_fn->wifi_enable_tx_power_limits); return true; } } // namespace legacy_hal -- GitLab From e05cbc632526576e91084892e66a91a00569f5ad Mon Sep 17 00:00:00 2001 From: Darren Hsu Date: Tue, 19 Apr 2022 15:58:52 +0800 Subject: [PATCH 751/825] Exclude timed power entities due to timeout mechanism The AoC power stats reporting might not be present when the AoC latency exceeds the allowed time after the timeout mechanism introduced in AoC state residency data provider. Bug: 229696611 Test: run vts -m VtsHalPowerStatsTargetTest Change-Id: I7c59ab50065961ed338314d6c8d22d41ece43e5f Signed-off-by: Darren Hsu --- .../aidl/vts/VtsHalPowerStatsTargetTest.cpp | 59 +++++++++++++++---- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/power/stats/aidl/vts/VtsHalPowerStatsTargetTest.cpp b/power/stats/aidl/vts/VtsHalPowerStatsTargetTest.cpp index c7ba96cec3..4ee14e3bd9 100644 --- a/power/stats/aidl/vts/VtsHalPowerStatsTargetTest.cpp +++ b/power/stats/aidl/vts/VtsHalPowerStatsTargetTest.cpp @@ -65,6 +65,11 @@ class PowerStatsAidl : public testing::TestWithParam { template void testMatching(std::vector const& c1, R T::*f1, std::vector const& c2, R S::*f2); + bool containsTimedEntity(const std::string& str); + + void excludeTimedEntities(std::vector* entities, + std::vector* results); + std::shared_ptr powerstats; }; @@ -111,6 +116,29 @@ void PowerStatsAidl::testMatching(std::vector const& c1, R T::*f1, std::vecto EXPECT_EQ(c1fields, c2fields); } +bool PowerStatsAidl::containsTimedEntity(const std::string& str) { + // TODO(b/229698505): Extend PowerEntityInfo to identify timed power entity + return str.find("AoC") != std::string::npos; +} + +void PowerStatsAidl::excludeTimedEntities(std::vector* entities, + std::vector* results) { + for (auto it = entities->begin(); it != entities->end(); it++) { + if (containsTimedEntity((*it).name)) { + auto entityId = (*it).id; + entities->erase(it--); + + // Erase result element matching the entity ID + for (auto resultsIt = results->begin(); resultsIt != results->end(); resultsIt++) { + if ((*resultsIt).id == entityId) { + results->erase(resultsIt--); + break; + } + } + } + } +} + // Each PowerEntity must have a valid name TEST_P(PowerStatsAidl, ValidatePowerEntityNames) { std::vector infos; @@ -185,19 +213,20 @@ TEST_P(PowerStatsAidl, TestGetStateResidency) { ASSERT_OK(powerstats->getStateResidency({}, &results)); } -// State residency must return all results -TEST_P(PowerStatsAidl, TestGetStateResidencyAllResults) { +// State residency must return all results except timed power entities +TEST_P(PowerStatsAidl, TestGetStateResidencyAllResultsExceptTimedEntities) { std::vector entities; ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); std::vector results; ASSERT_OK(powerstats->getStateResidency({}, &results)); + excludeTimedEntities(&entities, &results); testMatching(entities, &PowerEntity::id, results, &StateResidencyResult::id); } -// Each result must contain all state residencies -TEST_P(PowerStatsAidl, TestGetStateResidencyAllStateResidencies) { +// Each result must contain all state residencies except timed power entities +TEST_P(PowerStatsAidl, TestGetStateResidencyAllStateResidenciesExceptTimedEntities) { std::vector entities; ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); @@ -205,16 +234,18 @@ TEST_P(PowerStatsAidl, TestGetStateResidencyAllStateResidencies) { ASSERT_OK(powerstats->getStateResidency({}, &results)); for (auto entity : entities) { - auto it = std::find_if(results.begin(), results.end(), - [&entity](const auto& x) { return x.id == entity.id; }); - ASSERT_NE(it, results.end()); + if (!containsTimedEntity(entity.name)) { + auto it = std::find_if(results.begin(), results.end(), + [&entity](const auto& x) { return x.id == entity.id; }); + ASSERT_NE(it, results.end()); - testMatching(entity.states, &State::id, it->stateResidencyData, &StateResidency::id); + testMatching(entity.states, &State::id, it->stateResidencyData, &StateResidency::id); + } } } -// State residency must return results for each requested power entity -TEST_P(PowerStatsAidl, TestGetStateResidencySelectedResults) { +// State residency must return results for each requested power entity except timed power entities +TEST_P(PowerStatsAidl, TestGetStateResidencySelectedResultsExceptTimedEntities) { std::vector entities; ASSERT_OK(powerstats->getPowerEntityInfo(&entities)); if (entities.empty()) { @@ -223,8 +254,12 @@ TEST_P(PowerStatsAidl, TestGetStateResidencySelectedResults) { std::vector selectedEntities = getRandomSubset(entities); std::vector selectedIds; - for (auto const& entity : selectedEntities) { - selectedIds.push_back(entity.id); + for (auto it = selectedEntities.begin(); it != selectedEntities.end(); it++) { + if (!containsTimedEntity((*it).name)) { + selectedIds.push_back((*it).id); + } else { + selectedEntities.erase(it--); + } } std::vector selectedResults; -- GitLab From e438bd358b52470b62afb6af0a08c76c7a40e58f Mon Sep 17 00:00:00 2001 From: Tyler Trephan Date: Thu, 21 Apr 2022 20:30:17 +0000 Subject: [PATCH 752/825] Added min/max rates for EV_CHARGE_TIME_REMAINING Test: atest CarPropertyManagerTest Bug: 229118601 Change-Id: I6adedf1def47486ebe3cf9d12abe2bd65e0d6d48 --- .../vehicle/aidl/impl/default_config/include/DefaultConfig.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h index 4d96fd38ae..5a579f1e5e 100644 --- a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +++ b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h @@ -326,6 +326,8 @@ const std::vector kVehicleProperties = { .prop = toInt(VehicleProperty::EV_CHARGE_TIME_REMAINING), .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 1.0f, + .maxSampleRate = 10.0f, }, .initialValue = {.int32Values = {20}}}, -- GitLab From 160e4a1dee6e4aca54190c057884d0ddf869d2ef Mon Sep 17 00:00:00 2001 From: Sam Dubey Date: Fri, 22 Apr 2022 13:35:08 +0000 Subject: [PATCH 753/825] Revert "Fix use-after-free in GnssMesaurementInterface" This reverts commit b6686e725a5a06757d66898562f20d5ea04ea9b3. Reason for revert: Broke LocationManagerFineTest Bug: 230085457 Change-Id: Ic699cf1583dd9b858cb5dcd2545ca448a17def6e --- gnss/aidl/default/Gnss.cpp | 1 + gnss/aidl/default/GnssMeasurementInterface.cpp | 4 +--- gnss/aidl/default/GnssNavigationMessageInterface.cpp | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 226b1f4b27..7855b5196a 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -153,6 +153,7 @@ void Gnss::reportSvStatus(const std::vector& svInfoList) const { std::vector Gnss::filterBlocklistedSatellites( std::vector gnssSvInfoList) const { + ALOGD("filterBlocklistedSatellites"); for (uint32_t i = 0; i < gnssSvInfoList.size(); i++) { if (mGnssConfiguration->isBlocklisted(gnssSvInfoList[i])) { gnssSvInfoList[i].svFlag &= ~(uint32_t)IGnssCallback::GnssSvFlags::USED_IN_FIX; diff --git a/gnss/aidl/default/GnssMeasurementInterface.cpp b/gnss/aidl/default/GnssMeasurementInterface.cpp index 228d5bf854..2c7241b82e 100644 --- a/gnss/aidl/default/GnssMeasurementInterface.cpp +++ b/gnss/aidl/default/GnssMeasurementInterface.cpp @@ -106,14 +106,12 @@ void GnssMeasurementInterface::start(const bool enableCorrVecOutputs) { std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMillis)); } }); + mThread.detach(); } void GnssMeasurementInterface::stop() { ALOGD("stop"); mIsActive = false; - if (mThread.joinable()) { - mThread.join(); - } } void GnssMeasurementInterface::reportMeasurement(const GnssData& data) { diff --git a/gnss/aidl/default/GnssNavigationMessageInterface.cpp b/gnss/aidl/default/GnssNavigationMessageInterface.cpp index fe34787c82..4bc859d35f 100644 --- a/gnss/aidl/default/GnssNavigationMessageInterface.cpp +++ b/gnss/aidl/default/GnssNavigationMessageInterface.cpp @@ -69,14 +69,12 @@ void GnssNavigationMessageInterface::start() { std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMillis)); } }); + mThread.detach(); } void GnssNavigationMessageInterface::stop() { ALOGD("stop"); mIsActive = false; - if (mThread.joinable()) { - mThread.join(); - } } void GnssNavigationMessageInterface::reportMessage(const GnssNavigationMessage& message) { -- GitLab From c7585d9dc4a26d0e04b8d81e10b67235f0015d47 Mon Sep 17 00:00:00 2001 From: ramindani Date: Fri, 15 Apr 2022 18:30:41 +0000 Subject: [PATCH 754/825] Set isOpaque For BlendMode::None Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 216205298 BUG: 219576457 Change-Id: I479d8367e5abf8893b94ac64b7149a2f0e4cf75b --- graphics/composer/aidl/vts/ReadbackVts.cpp | 1 + .../aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/graphics/composer/aidl/vts/ReadbackVts.cpp b/graphics/composer/aidl/vts/ReadbackVts.cpp index 03b1b6ca12..abb58e25dd 100644 --- a/graphics/composer/aidl/vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/vts/ReadbackVts.cpp @@ -76,6 +76,7 @@ LayerSettings TestLayer::toRenderEngineLayerSettings() { layerSettings.alpha = ::android::half(mAlpha); layerSettings.disableBlending = mBlendMode == BlendMode::NONE; + layerSettings.source.buffer.isOpaque = mBlendMode == BlendMode::NONE; layerSettings.geometry.boundaries = ::android::FloatRect( static_cast(mDisplayFrame.left), static_cast(mDisplayFrame.top), static_cast(mDisplayFrame.right), static_cast(mDisplayFrame.bottom)); diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp index c081199ba6..72ff9babed 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -1132,8 +1132,8 @@ class GraphicsBlendModeCompositionTest Color mBackgroundColor; Color mTopLayerColor; }; -// TODO(b/219576457) Enable tests once we have fixed the bug on composer. -TEST_P(GraphicsBlendModeCompositionTest, DISABLED_None) { + +TEST_P(GraphicsBlendModeCompositionTest, None) { for (ColorMode mode : mTestColorModes) { EXPECT_TRUE(mComposerClient ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) -- GitLab From b8069b37ab93f82cac53a98a494f3fd449c43e08 Mon Sep 17 00:00:00 2001 From: Chris Weir Date: Fri, 22 Apr 2022 13:01:08 -0700 Subject: [PATCH 755/825] Fix VtsHalCanBusV1_0TargetTest VtsHalCanBusV1_0TargetTest needs buses brought up. On GSI images, canhalctrl doesn't exist, so we have to attempt it on our own. Bug: 213841914 Test: VtsHalCanBusV1_0TargetTest Change-Id: I5553a95d047aef8e9d8e1eb6092cddea98f6d81e --- .../functional/VtsHalCanBusV1_0TargetTest.cpp | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/automotive/can/1.0/vts/functional/VtsHalCanBusV1_0TargetTest.cpp b/automotive/can/1.0/vts/functional/VtsHalCanBusV1_0TargetTest.cpp index d91d9f5035..a6e7baddc9 100644 --- a/automotive/can/1.0/vts/functional/VtsHalCanBusV1_0TargetTest.cpp +++ b/automotive/can/1.0/vts/functional/VtsHalCanBusV1_0TargetTest.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -27,6 +28,8 @@ namespace android::hardware::automotive::can::V1_0::vts { using hardware::hidl_vec; +using InterfaceType = ICanController::InterfaceType; +using IfId = ICanController::BusConfig::InterfaceId; struct CanMessageListener : public can::V1_0::ICanMessageListener { virtual Return onReceive(const can::V1_0::CanMessage&) override { return {}; } @@ -41,22 +44,62 @@ class CanBusHalTest : public ::testing::TestWithParam { virtual void SetUp() override; virtual void TearDown() override; + bool up(InterfaceType iftype, const std::string& srvname, const std::string& ifname); + std::tuple> listen(const hidl_vec& filter, const sp& listener); sp listenForErrors(const sp& listener); sp mCanBus; + sp mCanController; }; void CanBusHalTest::SetUp() { mCanBus = ICanBus::getService(GetParam()); ASSERT_TRUE(mCanBus) << "Couldn't open CAN Bus: " << GetParam(); + const auto controllers = getAllHalInstanceNames(ICanController::descriptor); + ASSERT_GT(controllers.size(), 0u); + // just grab the first one + mCanController = ICanController::getService(controllers[0]); + ASSERT_TRUE(mCanController) << "Couldn't open CAN Controller: " << controllers[0]; + + // this will throw an error if the bus is already up, but we have to try. + up(InterfaceType::VIRTUAL, GetParam(), "vcan0"); } void CanBusHalTest::TearDown() { mCanBus.clear(); } +bool CanBusHalTest::up(InterfaceType iftype, const std::string& srvname, + const std::string& ifname) { + ICanController::BusConfig config = {}; + config.name = srvname; + + // TODO(b/146214370): move interfaceId constructors to a library + if (iftype == InterfaceType::SOCKETCAN) { + IfId::Socketcan socketcan = {}; + socketcan.ifname(ifname); + config.interfaceId.socketcan(socketcan); + } else if (iftype == InterfaceType::SLCAN) { + IfId::Slcan slcan = {}; + slcan.ttyname(ifname); + config.interfaceId.slcan(slcan); + } else if (iftype == InterfaceType::VIRTUAL) { + config.interfaceId.virtualif({ifname}); + } else { + ADD_FAILURE() << "Unexpected iftype: " << toString(iftype); + } + + const auto upresult = mCanController->upInterface(config); + if (upresult != ICanController::Result::OK) { + // upInterface returns INVALID_STATE if the interface is already up (which is fine). + EXPECT_EQ(ICanController::Result::INVALID_STATE, upresult) + << ifname << " can't be brought up!"; + } + return true; +} + std::tuple> CanBusHalTest::listen( const hidl_vec& filter, const sp& listener) { Result halResult; -- GitLab From 83cf51eb33463bddd508c44c704feeb4f522ff7a Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Thu, 21 Apr 2022 18:52:32 +0000 Subject: [PATCH 756/825] VTSHalAudio: Increase test timeout for V6, V7.x to 10 minutes TV devices can list a lot of configurations and have low performing CPUs which causes the test to run for a significant amount of time. From b/229824670 it seems that 10 minutes should be enough. Bug: 229824670 Test: atest VtsHalAudioV6_0TargetTest Test: atest VtsHalAudioV7_0TargetTest Test: atest VtsHalAudioV7_1TargetTest Change-Id: Id7fa8eaa98bf2437fd1f676b9e5a7290df260fbd (cherry picked from commit 0b9b03eb710e7bcf4b2b2cf4489777e3c321b95f) Merged-In: Id7fa8eaa98bf2437fd1f676b9e5a7290df260fbd --- .../all-versions/vts/functional/VtsHalAudioV6_0TargetTest.xml | 2 +- .../all-versions/vts/functional/VtsHalAudioV7_0TargetTest.xml | 2 +- .../all-versions/vts/functional/VtsHalAudioV7_1TargetTest.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/audio/core/all-versions/vts/functional/VtsHalAudioV6_0TargetTest.xml b/audio/core/all-versions/vts/functional/VtsHalAudioV6_0TargetTest.xml index ae571258dc..1e73f8a01a 100644 --- a/audio/core/all-versions/vts/functional/VtsHalAudioV6_0TargetTest.xml +++ b/audio/core/all-versions/vts/functional/VtsHalAudioV6_0TargetTest.xml @@ -34,6 +34,6 @@ diff --git a/audio/core/all-versions/vts/functional/VtsHalAudioV7_0TargetTest.xml b/audio/core/all-versions/vts/functional/VtsHalAudioV7_0TargetTest.xml index 55dbaf1e78..f0e26958b9 100644 --- a/audio/core/all-versions/vts/functional/VtsHalAudioV7_0TargetTest.xml +++ b/audio/core/all-versions/vts/functional/VtsHalAudioV7_0TargetTest.xml @@ -34,6 +34,6 @@ diff --git a/audio/core/all-versions/vts/functional/VtsHalAudioV7_1TargetTest.xml b/audio/core/all-versions/vts/functional/VtsHalAudioV7_1TargetTest.xml index 7b33a8f340..7ce1477e1a 100644 --- a/audio/core/all-versions/vts/functional/VtsHalAudioV7_1TargetTest.xml +++ b/audio/core/all-versions/vts/functional/VtsHalAudioV7_1TargetTest.xml @@ -34,6 +34,6 @@ -- GitLab From 4b6d5a48a7321592144d876c1be7a3480f319836 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 22 Apr 2022 23:19:13 +0000 Subject: [PATCH 757/825] Freeze HIDL HALs for Android T. Let this be the last time! :) Bug: 203103997 Test: build (checks hashes) Change-Id: I8c6f7b0064b6df764f41b644a54e0e581fa74137 --- current.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/current.txt b/current.txt index df6f91dcb0..ce03b552e0 100644 --- a/current.txt +++ b/current.txt @@ -912,4 +912,12 @@ ca62a2a95d173ed323309e5e00f653ad3cceec82a6e5e4976a249cb5aafe2515 android.hardwar fa76bced6b1b71c40fc706c508a9011284c57f57831cd0cf5f45653ed4ea463e android.hardware.neuralnetworks@1.3::types 700d9de9b47984898789f5706e59285ea6fe83aa5744dccf8491c4b881033ae7 android.hardware.camera.device@3.7::ICameraInjectionSession -# There should be no more HIDL HALs - please use AIDL instead. +# HALs released in Android T +75d10baa98d661fb455622a1b0c76b53f0b19a906c6fb058daadfed5db77ed3f android.hardware.audio@7.1::IDevice +3a69d224c3351bdc5651c77cd588d5a36bb65a34abd423901a9cf63ac5916f20 android.hardware.audio@7.1::IDevicesFactory +4569e703efb9ab0f4fc02bcca866a77d4352e292fbf715927cba31e6eba51ad6 android.hardware.audio@7.1::IPrimaryDevice +ec11690878547a55eb1d6a286f83e227d8328c2cf1d069316b55b4e4084fd9a2 android.hardware.audio@7.1::IStreamOut +786b8619580d7cfae70f02136307e141481714fcc76c6b700e655568f1bf0733 android.hardware.audio@7.1::IStreamOutLatencyModeCallback +bfbf383768881eb06f99db76ce79135e37b2b105a90d67bf7468f8df05180bf4 android.hardware.audio@7.1::types + +# There will be no more HIDL HALs. Use AIDL instead. -- GitLab From 953448bb3b8282cca9bcb340da4f9da6dc7b23fb Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Sat, 23 Apr 2022 00:10:33 +0000 Subject: [PATCH 758/825] Freeze compat matrix 7 for Android T The current matrix is left in this same CL because this way, downstream modifications to the current CL will automatically get absorbed into the level 8 compatibility matrix. A CL on top of this will disable the 7 matrix and then get reverted in the aosp/master..goog/master merge path. Bug: 203103997 Test: boot, vts_treble_vintf_vendor_test Change-Id: I5c04d26e2b4dd0aac6e7d6ce3c72496081e9539d --- compatibility_matrices/Android.bp | 12 + compatibility_matrices/Android.mk | 1 + .../compatibility_matrix.7.xml | 810 ++++++++++++++++++ .../compatibility_matrix.current.xml | 2 +- 4 files changed, 824 insertions(+), 1 deletion(-) create mode 100644 compatibility_matrices/compatibility_matrix.7.xml diff --git a/compatibility_matrices/Android.bp b/compatibility_matrices/Android.bp index 193fd2b400..7dc6cc75b2 100644 --- a/compatibility_matrices/Android.bp +++ b/compatibility_matrices/Android.bp @@ -73,6 +73,18 @@ vintf_compatibility_matrix { ], } +vintf_compatibility_matrix { + name: "framework_compatibility_matrix.7.xml", + stem: "compatibility_matrix.7.xml", + srcs: [ + "compatibility_matrix.7.xml", + ], + kernel_configs: [ + "kernel_config_current_5.10", + "kernel_config_current_5.15", + ], +} + vintf_compatibility_matrix { name: "framework_compatibility_matrix.current.xml", stem: "compatibility_matrix.current.xml", diff --git a/compatibility_matrices/Android.mk b/compatibility_matrices/Android.mk index 9e715bf37d..d19f0dae1f 100644 --- a/compatibility_matrices/Android.mk +++ b/compatibility_matrices/Android.mk @@ -102,6 +102,7 @@ my_system_matrix_deps := \ framework_compatibility_matrix.4.xml \ framework_compatibility_matrix.5.xml \ framework_compatibility_matrix.6.xml \ + framework_compatibility_matrix.7.xml \ framework_compatibility_matrix.current.xml \ framework_compatibility_matrix.device.xml \ diff --git a/compatibility_matrices/compatibility_matrix.7.xml b/compatibility_matrices/compatibility_matrix.7.xml new file mode 100644 index 0000000000..acee459ca0 --- /dev/null +++ b/compatibility_matrices/compatibility_matrix.7.xml @@ -0,0 +1,810 @@ + + + android.hardware.atrace + 1.0 + + IAtraceDevice + default + + + + android.hardware.audio + 6.0 + 7.0-1 + + IDevicesFactory + default + + + + android.hardware.audio.effect + 6.0 + 7.0 + + IEffectsFactory + default + + + + android.hardware.authsecret + 1 + + IAuthSecret + default + + + + android.hardware.authsecret + 1.0 + + IAuthSecret + default + + + + android.hardware.automotive.audiocontrol + + IAudioControl + default + + + + android.hardware.automotive.can + 1.0 + + ICanBus + .* + + + ICanController + .* + + + + android.hardware.automotive.evs + + IEvsEnumerator + default + [a-z]+/[0-9]+ + + + + android.hardware.automotive.evs + 1.0-1 + + IEvsEnumerator + default + [a-z]+/[0-9]+ + + + + android.hardware.automotive.occupant_awareness + 1 + + IOccupantAwareness + default + + + + android.hardware.automotive.vehicle + + IVehicle + .* + + + + android.hardware.automotive.vehicle + 2.0 + + IVehicle + .* + + + + android.hardware.biometrics.face + 1.0 + + IBiometricsFace + default + + + + android.hardware.biometrics.face + 2 + + IFace + default + + + + android.hardware.biometrics.fingerprint + 2.1-3 + + IBiometricsFingerprint + default + + + + android.hardware.biometrics.fingerprint + 2 + + IFingerprint + default + + + + android.hardware.bluetooth + 1.0-1 + + IBluetoothHci + default + + + + android.hardware.bluetooth.audio + + IBluetoothAudioProviderFactory + default + + + + android.hardware.boot + 1.2 + + IBootControl + default + + + + android.hardware.broadcastradio + 1.0-1 + + IBroadcastRadioFactory + default + + + + android.hardware.broadcastradio + 2.0 + + IBroadcastRadio + .* + + + + android.hardware.camera.provider + 2.4-7 + + ICameraProvider + [^/]+/[0-9]+ + + + + android.hardware.camera.provider + 1 + + ICameraProvider + [^/]+/[0-9]+ + + + + android.hardware.cas + 1.1-2 + + IMediaCasService + default + + + + android.hardware.confirmationui + 1.0 + + IConfirmationUI + default + + + + android.hardware.contexthub + + IContextHub + default + + + + android.hardware.drm + 1 + + IDrmFactory + .* + + + + android.hardware.drm + 1.3-4 + + ICryptoFactory + .* + + + IDrmFactory + .* + + + + android.hardware.dumpstate + + IDumpstateDevice + default + + + + android.hardware.gatekeeper + 1.0 + + IGatekeeper + default + + + + android.hardware.gnss + 2.0-1 + + IGnss + default + + + + android.hardware.gnss + 2 + + IGnss + default + + + + android.hardware.gnss.visibility_control + 1 + + IGnssVisibilityControl + default + + + + android.hardware.gnss.measurement_corrections + 1 + + IMeasurementCorrectionsInterface + default + + + + android.hardware.graphics.allocator + + 2.0 + 3.0 + 4.0 + + IAllocator + default + + + + android.hardware.graphics.allocator + 1 + + IAllocator + default + + + + + android.hardware.graphics.composer + 2.1-4 + + IComposer + default + + + + android.hardware.graphics.composer3 + 1 + + IComposer + default + + + + android.hardware.graphics.mapper + + 2.1 + 3.0 + 4.0 + + IMapper + default + + + + android.hardware.health + 1 + + IHealth + default + + + + android.hardware.health.storage + 1 + + IStorage + default + + + + android.hardware.identity + 1-4 + + IIdentityCredentialStore + default + + + + android.hardware.net.nlinterceptor + + IInterceptor + default + + + + android.hardware.oemlock + 1 + + IOemLock + default + + + + android.hardware.ir + 1 + + IConsumerIr + default + + + + android.hardware.input.processor + 1 + + IInputProcessor + default + + + + android.hardware.keymaster + 3.0 + 4.0-1 + + IKeymasterDevice + default + + + + android.hardware.keymaster + 4.0-1 + + IKeymasterDevice + strongbox + + + + android.hardware.security.dice + 1 + + IDiceDevice + default + + + + android.hardware.security.keymint + 1-2 + + IKeyMintDevice + default + strongbox + + + + android.hardware.security.keymint + 1-2 + + IRemotelyProvisionedComponent + default + strongbox + + + + android.hardware.light + 2 + + ILights + default + + + + android.hardware.media.c2 + 1.0-2 + + IComponentStore + default[0-9]* + vendor[0-9]*_software + + + + android.hardware.media.omx + 1.0 + + IOmx + default + + + IOmxStore + default + + + + android.hardware.memtrack + 1 + + IMemtrack + default + + + + android.hardware.neuralnetworks + 1.0-3 + + IDevice + .* + + + + android.hardware.neuralnetworks + 1-4 + + IDevice + .* + + + + android.hardware.nfc + 1.2 + + INfc + default + + + + android.hardware.nfc + + INfc + default + + + + android.hardware.oemlock + 1.0 + + IOemLock + default + + + + android.hardware.power + 2-3 + + IPower + default + + + + android.hardware.power.stats + + IPowerStats + default + + + + android.hardware.radio.config + 1 + + IRadioConfig + default + + + + android.hardware.radio.data + 1 + + IRadioData + slot1 + slot2 + slot3 + + + + android.hardware.radio.messaging + 1 + + IRadioMessaging + slot1 + slot2 + slot3 + + + + android.hardware.radio.modem + 1 + + IRadioModem + slot1 + slot2 + slot3 + + + + android.hardware.radio.network + 1 + + IRadioNetwork + slot1 + slot2 + slot3 + + + + android.hardware.radio.sim + 1 + + IRadioSim + slot1 + slot2 + slot3 + + + + android.hardware.radio.voice + 1 + + IRadioVoice + slot1 + slot2 + slot3 + + + + android.hardware.radio + 1.2 + + ISap + slot1 + + + + android.hardware.renderscript + 1.0 + + IDevice + default + + + + android.hardware.rebootescrow + 1 + + IRebootEscrow + default + + + + android.hardware.secure_element + 1.0-2 + + ISecureElement + eSE[1-9][0-9]* + SIM[1-9][0-9]* + + + + android.hardware.security.secureclock + 1 + + ISecureClock + default + + + + android.hardware.security.sharedsecret + 1 + + ISharedSecret + default + strongbox + + + + android.hardware.sensors + + ISensors + default + + + + android.hardware.sensors + 1.0 + 2.0-1 + + ISensors + default + + + + android.hardware.soundtrigger + 2.3 + + ISoundTriggerHw + default + + + + android.hardware.soundtrigger3 + 1 + + ISoundTriggerHw + default + + + + android.hardware.tetheroffload.config + 1.0 + + IOffloadConfig + default + + + + android.hardware.tetheroffload.control + 1.1 + + IOffloadControl + default + + + + android.hardware.thermal + 2.0 + + IThermal + default + + + + android.hardware.tv.cec + 1.0-1 + + IHdmiCec + default + + + + android.hardware.tv.input + 1.0 + + ITvInput + default + + + + android.hardware.tv.tuner + 1.0-1 + + ITuner + default + + + + android.hardware.tv.tuner + 1 + + ITuner + default + + + + android.hardware.usb + 1.0-3 + + IUsb + default + + + + android.hardware.usb + + IUsb + default + + + + android.hardware.usb.gadget + 1.0-2 + + IUsbGadget + default + + + + android.hardware.vibrator + 1-2 + + IVibrator + default + + + + android.hardware.vibrator + 1-2 + + IVibratorManager + default + + + + android.hardware.weaver + 1.0 + + IWeaver + default + + + + android.hardware.weaver + 1 + + IWeaver + default + + + + android.hardware.wifi + 1.3-6 + + IWifi + default + + + + android.hardware.uwb + 1 + + IUwb + default + + + + android.hardware.wifi.hostapd + 1 + + IHostapd + default + + + + android.hardware.wifi.supplicant + + ISupplicant + default + + + diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index acee459ca0..bf271994fb 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -1,4 +1,4 @@ - + android.hardware.atrace 1.0 -- GitLab From 95939ed30071d6a2356eb6170c4361eaf1faab2c Mon Sep 17 00:00:00 2001 From: Nate Jiang Date: Mon, 25 Apr 2022 13:08:38 -0700 Subject: [PATCH 759/825] Check and catch the callback transaction error Bug: 230277359 Test: vts VtsHalWifiRttV1_6TargetTest Change-Id: Ibcccd0d60d6907c95cfa95c0e55501248bc65e4b --- wifi/1.6/default/wifi_rtt_controller.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wifi/1.6/default/wifi_rtt_controller.cpp b/wifi/1.6/default/wifi_rtt_controller.cpp index b328f311ab..aa9ee2f520 100644 --- a/wifi/1.6/default/wifi_rtt_controller.cpp +++ b/wifi/1.6/default/wifi_rtt_controller.cpp @@ -316,7 +316,9 @@ WifiStatus WifiRttController::rangeRequestInternal_1_6( return; } for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - callback->onResults_1_6(id, hidl_results); + if (!callback->onResults_1_6(id, hidl_results).isOk()) { + LOG(ERROR) << "Failed to invoke the callback"; + } } }; legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRttRangeRequest( -- GitLab From d575109c1e97d00686297de9c2d40efa8ad9fc88 Mon Sep 17 00:00:00 2001 From: ramindani Date: Fri, 22 Apr 2022 22:30:20 +0000 Subject: [PATCH 760/825] Check Exception Code for Service specific error Before checking the service specific error we need to check that getExceptionCode returns EX_SERVICE_SPECIFIC error code. Added a method and used that to do the two checks together for exceptionCode and for the service specific error code, so that we don't repeat two lines in all the tests that need them. EXPECT_NO_FATAL_FAILURES print the correct line number of the test or iteration of the test when used with helper functions, and testing guidelines recommend it too here: go/gunitadvanced#propagating-fatal-failures Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 205152739 Change-Id: I1d3c3aa9b34dcefb14be507ff61b73b6f08a5204 --- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 16 +- .../VtsHalGraphicsComposer3_TargetTest.cpp | 144 +++++++++++------- 2 files changed, 97 insertions(+), 63 deletions(-) diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp index 72ff9babed..46dde09dd4 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -109,6 +109,11 @@ class GraphicsCompositionTestBase : public ::testing::Test { int32_t getDisplayHeight() const { return getPrimaryDisplay().getDisplayHeight(); } + void assertServiceSpecificError(const ScopedAStatus& status, int32_t serviceSpecificError) { + ASSERT_EQ(status.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(status.getServiceSpecificError(), serviceSpecificError); + } + std::pair> allocateBuffer(uint32_t usage) { const auto width = static_cast(getDisplayWidth()); const auto height = static_cast(getDisplayHeight()); @@ -222,7 +227,8 @@ class GraphicsCompositionTestBase : public ::testing::Test { mDataspace = readBackBufferAttributes.dataspace; return ReadbackHelper::readbackSupported(mPixelFormat, mDataspace); } - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED)); return false; } @@ -458,7 +464,7 @@ TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadDisplay) { mComposerClient->setReadbackBuffer(getInvalidDisplayId(), bufferHandle, fence); EXPECT_FALSE(status.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadParameter) { @@ -475,7 +481,7 @@ TEST_P(GraphicsCompositionTest, SetReadbackBuffer_BadParameter) { mComposerClient->setReadbackBuffer(getPrimaryDisplayId(), &bufferHandle, releaseFence); EXPECT_FALSE(status.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_PARAMETER)); } TEST_P(GraphicsCompositionTest, GetReadbackBufferFenceInactive) { @@ -490,7 +496,7 @@ TEST_P(GraphicsCompositionTest, GetReadbackBufferFenceInactive) { mComposerClient->getReadbackBufferFence(getPrimaryDisplayId()); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED)); EXPECT_EQ(-1, releaseFence.get()); } @@ -1300,7 +1306,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { for (ColorMode mode : mTestColorModes) { auto status = mComposerClient->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC); - if (!status.isOk() && + if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC && (status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED || status.getServiceSpecificError() == IComposerClient::EX_BAD_PARAMETER)) { SUCCEED() << "ColorMode not supported, skip test"; diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 2cae5a2c93..759bfecca3 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -71,6 +71,11 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { mComposerClient.reset(); } + void assertServiceSpecificError(const ScopedAStatus& status, int32_t serviceSpecificError) { + ASSERT_EQ(status.getExceptionCode(), EX_SERVICE_SPECIFIC); + ASSERT_EQ(status.getServiceSpecificError(), serviceSpecificError); + } + void Test_setContentTypeForDisplay(int64_t display, const std::vector& supportedContentTypes, ContentType contentType, const char* contentTypeStr) { @@ -81,7 +86,8 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam { if (!contentTypeSupport) { const auto& status = mComposerClient->setContentType(display, contentType); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED)); GTEST_SUCCEED() << contentTypeStr << " content type is not supported on display " << std::to_string(display) << ", skipping test"; return; @@ -132,7 +138,7 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayCapabilities_BadDisplay) { const auto& [status, _] = mComposerClient->getDisplayCapabilities(getInvalidDisplayId()); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, GetDisplayCapabilities) { @@ -153,13 +159,14 @@ TEST_P(GraphicsComposerAidlTest, CreateClientSingleton) { const auto& status = mComposerClient->createClient(); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_NO_RESOURCES, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_NO_RESOURCES)); } TEST_P(GraphicsComposerAidlTest, GetDisplayIdentificationData) { const auto& [status0, displayIdentification0] = mComposerClient->getDisplayIdentificationData(getPrimaryDisplayId()); - if (!status0.isOk() && status0.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + if (!status0.isOk() && status0.getExceptionCode() == EX_SERVICE_SPECIFIC && + status0.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { GTEST_SUCCEED() << "Display identification data not supported, skipping test"; return; } @@ -200,7 +207,8 @@ TEST_P(GraphicsComposerAidlTest, GetHdrCapabilities) { TEST_P(GraphicsComposerAidlTest, GetPerFrameMetadataKeys) { const auto& [status, keys] = mComposerClient->getPerFrameMetadataKeys(getPrimaryDisplayId()); - if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC && + status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { GTEST_SUCCEED() << "getPerFrameMetadataKeys is not supported"; return; } @@ -211,7 +219,8 @@ TEST_P(GraphicsComposerAidlTest, GetPerFrameMetadataKeys) { TEST_P(GraphicsComposerAidlTest, GetReadbackBufferAttributes) { const auto& [status, _] = mComposerClient->getReadbackBufferAttributes(getPrimaryDisplayId()); - if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC && + status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { GTEST_SUCCEED() << "getReadbackBufferAttributes is not supported"; return; } @@ -254,7 +263,8 @@ TEST_P(GraphicsComposerAidlTest, GetRenderIntents_BadDisplay) { mComposerClient->getRenderIntents(getInvalidDisplayId(), mode); EXPECT_FALSE(intentStatus.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, intentStatus.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(intentStatus, IComposerClient::EX_BAD_DISPLAY)); } } @@ -263,7 +273,7 @@ TEST_P(GraphicsComposerAidlTest, GetRenderIntents_BadParameter) { mComposerClient->getRenderIntents(getPrimaryDisplayId(), static_cast(-1)); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_PARAMETER)); } TEST_P(GraphicsComposerAidlTest, GetColorModes) { @@ -278,7 +288,7 @@ TEST_P(GraphicsComposerAidlTest, GetColorMode_BadDisplay) { const auto& [status, _] = mComposerClient->getColorModes(getInvalidDisplayId()); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, SetColorMode) { @@ -294,7 +304,8 @@ TEST_P(GraphicsComposerAidlTest, SetColorMode) { const auto modeStatus = mComposerClient->setColorMode(getPrimaryDisplayId(), mode, intent); EXPECT_TRUE(modeStatus.isOk() || - IComposerClient::EX_UNSUPPORTED == modeStatus.getServiceSpecificError()) + (modeStatus.getExceptionCode() == EX_SERVICE_SPECIFIC && + IComposerClient::EX_UNSUPPORTED == modeStatus.getServiceSpecificError())) << "failed to set color mode"; } } @@ -302,7 +313,8 @@ TEST_P(GraphicsComposerAidlTest, SetColorMode) { const auto modeStatus = mComposerClient->setColorMode(getPrimaryDisplayId(), ColorMode::NATIVE, RenderIntent::COLORIMETRIC); EXPECT_TRUE(modeStatus.isOk() || - IComposerClient::EX_UNSUPPORTED == modeStatus.getServiceSpecificError()) + (modeStatus.getExceptionCode() == EX_SERVICE_SPECIFIC && + IComposerClient::EX_UNSUPPORTED == modeStatus.getServiceSpecificError())) << "failed to set color mode"; } @@ -320,7 +332,8 @@ TEST_P(GraphicsComposerAidlTest, SetColorMode_BadDisplay) { mComposerClient->setColorMode(getInvalidDisplayId(), mode, intent); EXPECT_FALSE(modeStatus.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, modeStatus.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(modeStatus, IComposerClient::EX_BAD_DISPLAY)); } } } @@ -330,13 +343,13 @@ TEST_P(GraphicsComposerAidlTest, SetColorMode_BadParameter) { RenderIntent::COLORIMETRIC); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_PARAMETER)); status = mComposerClient->setColorMode(getPrimaryDisplayId(), ColorMode::NATIVE, static_cast(-1)); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_PARAMETER)); } TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSamplingAttributes) { @@ -344,7 +357,8 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSamplingAttributes) { const auto& [status, format] = mComposerClient->getDisplayedContentSamplingAttributes(getPrimaryDisplayId()); - if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC && + status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { SUCCEED() << "Device does not support optional extension. Test skipped"; return; } @@ -360,7 +374,8 @@ TEST_P(GraphicsComposerAidlTest, SetDisplayedContentSamplingEnabled) { FormatColorComponent enableAllComponents = FormatColorComponent::FORMAT_COMPONENT_0; auto status = mComposerClient->setDisplayedContentSamplingEnabled( getPrimaryDisplayId(), /*isEnabled*/ true, enableAllComponents, kMaxFrames); - if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC && + status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { SUCCEED() << "Device does not support optional extension. Test skipped"; return; } @@ -374,7 +389,8 @@ TEST_P(GraphicsComposerAidlTest, SetDisplayedContentSamplingEnabled) { TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSample) { const auto& [status, displayContentSamplingAttributes] = mComposerClient->getDisplayedContentSamplingAttributes(getPrimaryDisplayId()); - if (!status.isOk() && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC && + status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { SUCCEED() << "Sampling attributes aren't supported on this device, test skipped"; return; } @@ -383,7 +399,7 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayedContentSample) { int64_t constexpr kTimestamp = 0; const auto& [sampleStatus, displayContentSample] = mComposerClient->getDisplayedContentSample( getPrimaryDisplayId(), kMaxFrames, kTimestamp); - if (!sampleStatus.isOk() && + if (!sampleStatus.isOk() && sampleStatus.getExceptionCode() == EX_SERVICE_SPECIFIC && sampleStatus.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { SUCCEED() << "Device does not support optional extension. Test skipped"; return; @@ -405,7 +421,7 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayConnectionType) { const auto& [status, type] = mComposerClient->getDisplayConnectionType(getInvalidDisplayId()); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); for (const auto& display : mDisplays) { const auto& [connectionTypeStatus, _] = @@ -440,8 +456,10 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayAttribute) { for (const auto& attribute : optionalAttributes) { const auto& [attribStatus, value] = mComposerClient->getDisplayAttribute( display.getDisplayId(), config, attribute); - EXPECT_TRUE(attribStatus.isOk() || IComposerClient::EX_UNSUPPORTED == - attribStatus.getServiceSpecificError()); + EXPECT_TRUE(attribStatus.isOk() || + (attribStatus.getExceptionCode() == EX_SERVICE_SPECIFIC && + IComposerClient::EX_UNSUPPORTED == + attribStatus.getServiceSpecificError())); } } } @@ -463,7 +481,7 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayVsyncPeriod_BadDisplay) { mComposerClient->getDisplayVsyncPeriod(getInvalidDisplayId()); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, SetActiveConfigWithConstraints_BadDisplay) { @@ -476,7 +494,7 @@ TEST_P(GraphicsComposerAidlTest, SetActiveConfigWithConstraints_BadDisplay) { &invalidDisplay, /*config*/ 0, constraints); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, SetActiveConfigWithConstraints_BadConfig) { @@ -490,7 +508,7 @@ TEST_P(GraphicsComposerAidlTest, SetActiveConfigWithConstraints_BadConfig) { &display, kInvalidConfigId, constraints); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_CONFIG, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_CONFIG)); } } @@ -502,7 +520,7 @@ TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadDisplay) { const auto& status = mComposerClient->setBootDisplayConfig(getInvalidDisplayId(), /*config*/ 0); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadConfig) { @@ -516,7 +534,7 @@ TEST_P(GraphicsComposerAidlTest, SetBootDisplayConfig_BadConfig) { mComposerClient->setBootDisplayConfig(display.getDisplayId(), kInvalidConfigId); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_CONFIG, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_CONFIG)); } } @@ -540,7 +558,7 @@ TEST_P(GraphicsComposerAidlTest, ClearBootDisplayConfig_BadDisplay) { const auto& status = mComposerClient->clearBootDisplayConfig(getInvalidDisplayId()); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, ClearBootDisplayConfig) { @@ -559,7 +577,7 @@ TEST_P(GraphicsComposerAidlTest, GetPreferredBootDisplayConfig_BadDisplay) { const auto& [status, _] = mComposerClient->getPreferredBootDisplayConfig(getInvalidDisplayId()); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, GetPreferredBootDisplayConfig) { @@ -585,26 +603,29 @@ TEST_P(GraphicsComposerAidlTest, BootDisplayConfig_Unsupported) { auto status = mComposerClient->setBootDisplayConfig(getPrimaryDisplayId(), config); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED)); status = mComposerClient->getPreferredBootDisplayConfig(getPrimaryDisplayId()).first; EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED)); status = mComposerClient->clearBootDisplayConfig(getPrimaryDisplayId()); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED)); } } TEST_P(GraphicsComposerAidlTest, SetAutoLowLatencyMode_BadDisplay) { auto status = mComposerClient->setAutoLowLatencyMode(getInvalidDisplayId(), /*isEnabled*/ true); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); status = mComposerClient->setAutoLowLatencyMode(getInvalidDisplayId(), /*isEnabled*/ false); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, SetAutoLowLatencyMode) { @@ -621,11 +642,13 @@ TEST_P(GraphicsComposerAidlTest, SetAutoLowLatencyMode) { const auto& statusIsOn = mComposerClient->setAutoLowLatencyMode(display.getDisplayId(), /*isEnabled*/ true); EXPECT_FALSE(statusIsOn.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, statusIsOn.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(statusIsOn, IComposerClient::EX_UNSUPPORTED)); const auto& statusIsOff = mComposerClient->setAutoLowLatencyMode(display.getDisplayId(), /*isEnabled*/ false); EXPECT_FALSE(statusIsOff.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, statusIsOff.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(statusIsOff, IComposerClient::EX_UNSUPPORTED)); GTEST_SUCCEED() << "Auto Low Latency Mode is not supported on display " << std::to_string(display.getDisplayId()) << ", skipping test"; return; @@ -640,7 +663,7 @@ TEST_P(GraphicsComposerAidlTest, GetSupportedContentTypes_BadDisplay) { const auto& [status, _] = mComposerClient->getSupportedContentTypes(getInvalidDisplayId()); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, GetSupportedContentTypes) { @@ -671,7 +694,8 @@ TEST_P(GraphicsComposerAidlTest, SetContentType_BadDisplay) { const auto& status = mComposerClient->setContentType(getInvalidDisplayId(), type); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } } @@ -720,7 +744,8 @@ TEST_P(GraphicsComposerAidlTest, DestroyVirtualDisplay_BadDisplay) { const auto& destroyStatus = mComposerClient->destroyVirtualDisplay(getInvalidDisplayId()); EXPECT_FALSE(destroyStatus.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, destroyStatus.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(destroyStatus, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, CreateLayer) { @@ -735,7 +760,7 @@ TEST_P(GraphicsComposerAidlTest, CreateLayer_BadDisplay) { const auto& [status, _] = mComposerClient->createLayer(getInvalidDisplayId(), kBufferSlotCount); EXPECT_FALSE(status.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, DestroyLayer_BadDisplay) { @@ -746,7 +771,8 @@ TEST_P(GraphicsComposerAidlTest, DestroyLayer_BadDisplay) { const auto& destroyStatus = mComposerClient->destroyLayer(getInvalidDisplayId(), layer); EXPECT_FALSE(destroyStatus.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_DISPLAY, destroyStatus.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(destroyStatus, IComposerClient::EX_BAD_DISPLAY)); ASSERT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk()); } @@ -755,14 +781,14 @@ TEST_P(GraphicsComposerAidlTest, DestroyLayer_BadLayerError) { const auto& status = mComposerClient->destroyLayer(getPrimaryDisplayId(), /*layer*/ 1); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_LAYER, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_LAYER)); } TEST_P(GraphicsComposerAidlTest, GetActiveConfig_BadDisplay) { const auto& [status, _] = mComposerClient->getActiveConfig(getInvalidDisplayId()); EXPECT_FALSE(status.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, GetDisplayConfig) { @@ -774,7 +800,7 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayConfig_BadDisplay) { const auto& [status, _] = mComposerClient->getDisplayConfigs(getInvalidDisplayId()); EXPECT_FALSE(status.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, GetDisplayName) { @@ -786,7 +812,7 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientation_BadDisplay) { const auto& [status, _] = mComposerClient->getDisplayPhysicalOrientation(getInvalidDisplayId()); EXPECT_FALSE(status.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientation) { @@ -863,27 +889,28 @@ TEST_P(GraphicsComposerAidlTest, SetPowerModeUnsupported) { const auto& powerModeDozeStatus = mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::DOZE); EXPECT_FALSE(powerModeDozeStatus.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, powerModeDozeStatus.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(powerModeDozeStatus, IComposerClient::EX_UNSUPPORTED)); const auto& powerModeDozeSuspendStatus = mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::DOZE_SUSPEND); EXPECT_FALSE(powerModeDozeSuspendStatus.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, - powerModeDozeSuspendStatus.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(powerModeDozeSuspendStatus, + IComposerClient::EX_UNSUPPORTED)); } if (!isSuspendSupported) { const auto& powerModeSuspendStatus = mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON_SUSPEND); EXPECT_FALSE(powerModeSuspendStatus.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, - powerModeSuspendStatus.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(powerModeSuspendStatus, + IComposerClient::EX_UNSUPPORTED)); const auto& powerModeDozeSuspendStatus = mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::DOZE_SUSPEND); EXPECT_FALSE(powerModeDozeSuspendStatus.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, - powerModeDozeSuspendStatus.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(powerModeDozeSuspendStatus, + IComposerClient::EX_UNSUPPORTED)); } } @@ -994,7 +1021,7 @@ TEST_P(GraphicsComposerAidlTest, SetPowerMode_BadDisplay) { const auto& status = mComposerClient->setPowerMode(getInvalidDisplayId(), PowerMode::ON); EXPECT_FALSE(status.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY)); } TEST_P(GraphicsComposerAidlTest, SetPowerMode_BadParameter) { @@ -1002,7 +1029,7 @@ TEST_P(GraphicsComposerAidlTest, SetPowerMode_BadParameter) { mComposerClient->setPowerMode(getPrimaryDisplayId(), static_cast(-1)); EXPECT_FALSE(status.isOk()); - ASSERT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_PARAMETER)); } TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrix) { @@ -1023,7 +1050,7 @@ TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrix_BadParameter) { mComposerClient->getDataspaceSaturationMatrix(common::Dataspace::UNKNOWN); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_PARAMETER)); } // Tests for Command. @@ -2003,8 +2030,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SetActiveConfigWithConstraints_SeamlessN const auto& [status, _] = mComposerClient->setActiveConfigWithConstraints( &display, config2, constraints); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_SEAMLESS_NOT_ALLOWED, - status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError( + status, IComposerClient::EX_SEAMLESS_NOT_ALLOWED)); } }); } @@ -2029,7 +2056,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_Unsupported) { const auto& status = mComposerClient->setIdleTimerEnabled(getPrimaryDisplayId(), /*timeout*/ 0); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE( + assertServiceSpecificError(status, IComposerClient::EX_UNSUPPORTED)); } } @@ -2044,7 +2072,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_BadParameter) { const auto& status = mComposerClient->setIdleTimerEnabled(getPrimaryDisplayId(), /*timeout*/ -1); EXPECT_FALSE(status.isOk()); - EXPECT_EQ(IComposerClient::EX_BAD_PARAMETER, status.getServiceSpecificError()); + EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_PARAMETER)); } TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_Disable) { -- GitLab From 46770129126cbb68ca1f36cfa125aa65f6c40999 Mon Sep 17 00:00:00 2001 From: Tyler Trephan Date: Mon, 25 Apr 2022 22:58:59 +0000 Subject: [PATCH 761/825] Added supportedAreas for CRITICALLY_LOW_TIRE_PRESSURE Test: atest CarPropertyManagerTest Fix: 230386029 Change-Id: Idbd07a361f11b6b616c11ef2c359b656012b40cc --- .../vehicle/aidl/impl/default_config/include/DefaultConfig.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h index 5a579f1e5e..e00f775a04 100644 --- a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +++ b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h @@ -400,6 +400,10 @@ const std::vector kVehicleProperties = { .prop = toInt(VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE), .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::STATIC, + .areaConfigs = {VehicleAreaConfig{.areaId = WHEEL_FRONT_LEFT}, + VehicleAreaConfig{.areaId = WHEEL_FRONT_RIGHT}, + VehicleAreaConfig{.areaId = WHEEL_REAR_RIGHT}, + VehicleAreaConfig{.areaId = WHEEL_REAR_LEFT}}, }, .initialAreaValues = {{WHEEL_FRONT_LEFT, {.floatValues = {137.0f}}}, {WHEEL_FRONT_RIGHT, {.floatValues = {137.0f}}}, -- GitLab From e8981922a41f5c1d3a8e950bb65498b8d37a8432 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Mon, 25 Apr 2022 11:34:52 -0700 Subject: [PATCH 762/825] Freeze kernel configs for Android T. Use the frozen kernel configs, not the 'current' unfrozen kernel configs. Test: TH Fixes: 230144764 Change-Id: I2c6b1a1d5ec81acfb60380efeca0e6ee24b33089 --- compatibility_matrices/Android.bp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compatibility_matrices/Android.bp b/compatibility_matrices/Android.bp index 7dc6cc75b2..524242f6d3 100644 --- a/compatibility_matrices/Android.bp +++ b/compatibility_matrices/Android.bp @@ -80,8 +80,8 @@ vintf_compatibility_matrix { "compatibility_matrix.7.xml", ], kernel_configs: [ - "kernel_config_current_5.10", - "kernel_config_current_5.15", + "kernel_config_t_5.10", + "kernel_config_t_5.15", ], } -- GitLab From d468abed9bbb7b1e5395ae84c07ce12ff0bec9e8 Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Tue, 26 Apr 2022 12:42:22 -0700 Subject: [PATCH 763/825] Do not call releaseMemoryResource on ignored slot in NN VTS For IBurst, a slot value of -1 indicates the slot should be ignored. However, GeneratedTestHarness still attempts to call IBurst::releaseMemoryResource on ignored slots. Instead, we should skip releasing any ignored slots. Bug: 230103381 Test: mma Test: VtsHalNeuralnetworksTargetTest Test: presubmit Change-Id: I82e538aa0fd9e8ecc077df1c1ceece46a6166e67 --- .../aidl/vts/functional/GeneratedTestHarness.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp index 40f6cd1573..dcf8451919 100644 --- a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp +++ b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp @@ -659,6 +659,7 @@ void EvaluatePreparedModel(const std::shared_ptr& device, ASSERT_NE(nullptr, burst.get()); // associate a unique slot with each memory pool + constexpr int64_t kIgnoreSlot = -1; int64_t currentSlot = 0; std::vector slots; slots.reserve(request.pools.size()); @@ -667,7 +668,7 @@ void EvaluatePreparedModel(const std::shared_ptr& device, slots.push_back(currentSlot++); } else { EXPECT_EQ(pool.getTag(), RequestMemoryPool::Tag::token); - slots.push_back(-1); + slots.push_back(kIgnoreSlot); } } @@ -698,8 +699,10 @@ void EvaluatePreparedModel(const std::shared_ptr& device, // Mark each slot as unused after the execution. This is unnecessary because the // burst is freed after this scope ends, but this is here to test the functionality. for (int64_t slot : slots) { - ret = burst->releaseMemoryResource(slot); - ASSERT_TRUE(ret.isOk()) << ret.getDescription(); + if (slot != kIgnoreSlot) { + ret = burst->releaseMemoryResource(slot); + ASSERT_TRUE(ret.isOk()) << ret.getDescription(); + } } break; -- GitLab From 739ae49519f6c0b78000f3c03da124db4adda447 Mon Sep 17 00:00:00 2001 From: Brian Duddie Date: Mon, 18 Apr 2022 12:41:44 -0700 Subject: [PATCH 764/825] Fix sub-HAL handle in dynamic sensor meta events Need to apply the sub-HAL index byte to ensure handles provided in DYNAMIC_SENSOR_META events align properly with the [dis]connected callbacks. Bug: 228879057 Test: try on device with dynamic sensors sub-HAL at index > 0 Merged-In: Ic7290b51733bb829a5494ef41e9430b51dc6074e Change-Id: Ic7290b51733bb829a5494ef41e9430b51dc6074e --- sensors/common/default/2.X/multihal/HalProxyCallback.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sensors/common/default/2.X/multihal/HalProxyCallback.cpp b/sensors/common/default/2.X/multihal/HalProxyCallback.cpp index 3c1b17c8f0..addefe8d09 100644 --- a/sensors/common/default/2.X/multihal/HalProxyCallback.cpp +++ b/sensors/common/default/2.X/multihal/HalProxyCallback.cpp @@ -68,6 +68,10 @@ std::vector HalProxyCallbackBase::processEvents(const std::vector eventsOut; for (V2_1::Event event : events) { event.sensorHandle = setSubHalIndex(event.sensorHandle, mSubHalIndex); + if (event.sensorType == V2_1::SensorType::DYNAMIC_SENSOR_META) { + event.u.dynamic.sensorHandle = + setSubHalIndex(event.u.dynamic.sensorHandle, mSubHalIndex); + } eventsOut.push_back(event); const V2_1::SensorInfo& sensor = mCallback->getSensorInfo(event.sensorHandle); if ((sensor.flags & V1_0::SensorFlagBits::WAKE_UP) != 0) { -- GitLab From 9264d3f783f77baba2a0b12b4d80361be759bb7a Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Thu, 28 Apr 2022 08:07:53 +0900 Subject: [PATCH 765/825] Finalize android.hardware.graphics.common-V3 For some unknown reason, the Android.bp file was not updated when freezeing the V3 of android.hardware.graphics.common interface. Fixing it manually. Bug: 230660133 Test: `m nothing` with https://googleplex-android-review.git.corp.google.com/q/topic:Tiramisu-SDK-Finalization-rel Change-Id: I4bf6548e1200864810bcf8a7c1025ba56d48747b --- graphics/common/aidl/Android.bp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/graphics/common/aidl/Android.bp b/graphics/common/aidl/Android.bp index d44252a61b..40a575d555 100644 --- a/graphics/common/aidl/Android.bp +++ b/graphics/common/aidl/Android.bp @@ -40,8 +40,24 @@ aidl_interface { min_sdk_version: "29", }, }, - versions: [ - "1", - "2", + versions_with_info: [ + { + version: "1", + imports: [ + "android.hardware.common-V2", + ], + }, + { + version: "2", + imports: [ + "android.hardware.common-V2", + ], + }, + { + version: "3", + imports: [ + "android.hardware.common-V2", + ], + }, ], } -- GitLab From 9267a4b495b96f67e7dec1426e53ce4bd0ef29c4 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Thu, 28 Apr 2022 08:34:30 +0900 Subject: [PATCH 766/825] Finalize V3 of android.hardware.power Bug: 230660133 Test: m nothing with https://googleplex-android-review.git.corp.google.com/q/topic:Tiramisu-SDK-Finalization-rel Change-Id: Ib7f774f7679945b6a4562f53d4724c73c5193d28 --- power/aidl/Android.bp | 18 +++++-- .../aidl_api/android.hardware.power/3/.hash | 1 + .../3/android/hardware/power/Boost.aidl | 43 +++++++++++++++ .../3/android/hardware/power/IPower.aidl | 43 +++++++++++++++ .../hardware/power/IPowerHintSession.aidl | 42 +++++++++++++++ .../3/android/hardware/power/Mode.aidl | 54 +++++++++++++++++++ .../android/hardware/power/WorkDuration.aidl | 39 ++++++++++++++ 7 files changed, 237 insertions(+), 3 deletions(-) create mode 100644 power/aidl/aidl_api/android.hardware.power/3/.hash create mode 100644 power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/Boost.aidl create mode 100644 power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/IPower.aidl create mode 100644 power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/IPowerHintSession.aidl create mode 100644 power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/Mode.aidl create mode 100644 power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/WorkDuration.aidl diff --git a/power/aidl/Android.bp b/power/aidl/Android.bp index c722795a6c..e4708f8ec5 100644 --- a/power/aidl/Android.bp +++ b/power/aidl/Android.bp @@ -41,8 +41,20 @@ aidl_interface { }, }, }, - versions: [ - "1", - "2", + versions_with_info: [ + { + version: "1", + imports: [], + }, + { + version: "2", + imports: [], + }, + { + version: "3", + imports: [], + }, + ], + } diff --git a/power/aidl/aidl_api/android.hardware.power/3/.hash b/power/aidl/aidl_api/android.hardware.power/3/.hash new file mode 100644 index 0000000000..c697a13c1d --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/3/.hash @@ -0,0 +1 @@ +fd3434f993d791e75d959a042010dd6fca13e33c diff --git a/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/Boost.aidl b/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/Boost.aidl new file mode 100644 index 0000000000..c792d4e0c2 --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/Boost.aidl @@ -0,0 +1,43 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.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, +} diff --git a/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/IPower.aidl b/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/IPower.aidl new file mode 100644 index 0000000000..ae03313f11 --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/IPower.aidl @@ -0,0 +1,43 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.power; +@VintfStability +interface IPower { + oneway void setMode(in android.hardware.power.Mode type, in boolean enabled); + boolean isModeSupported(in android.hardware.power.Mode type); + oneway void setBoost(in android.hardware.power.Boost type, in int durationMs); + boolean isBoostSupported(in android.hardware.power.Boost type); + android.hardware.power.IPowerHintSession createHintSession(in int tgid, in int uid, in int[] threadIds, in long durationNanos); + long getHintSessionPreferredRate(); +} diff --git a/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/IPowerHintSession.aidl b/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/IPowerHintSession.aidl new file mode 100644 index 0000000000..1d3ecb7eee --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/IPowerHintSession.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 -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; +@VintfStability +interface IPowerHintSession { + oneway void updateTargetWorkDuration(long targetDurationNanos); + oneway void reportActualWorkDuration(in android.hardware.power.WorkDuration[] durations); + oneway void pause(); + oneway void resume(); + oneway void close(); +} diff --git a/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/Mode.aidl b/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/Mode.aidl new file mode 100644 index 0000000000..f38426b785 --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/Mode.aidl @@ -0,0 +1,54 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.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, +} diff --git a/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/WorkDuration.aidl b/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/WorkDuration.aidl new file mode 100644 index 0000000000..e86cd40ec2 --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/3/android/hardware/power/WorkDuration.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 -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; +@VintfStability +parcelable WorkDuration { + long timeStampNanos; + long durationNanos; +} -- GitLab From 36e00b0741c67a652ec6687243563492b14a1b75 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Thu, 28 Apr 2022 08:48:50 +0900 Subject: [PATCH 767/825] Finalize V2 of android.hardware.biometrics.common It was missing in the prior attempt to finzalize all AIDL interfaces. Bug: 230660133 Test: m nothing Change-Id: Icc319c84d57639ce083730a8bf15957e3ab7fe1d --- biometrics/common/aidl/Android.bp | 13 +++++- .../2/.hash | 1 + .../biometrics/common/CommonProps.aidl | 41 ++++++++++++++++++ .../biometrics/common/ComponentInfo.aidl | 42 +++++++++++++++++++ .../common/ICancellationSignal.aidl | 38 +++++++++++++++++ .../biometrics/common/OperationContext.aidl | 41 ++++++++++++++++++ .../biometrics/common/OperationReason.aidl | 40 ++++++++++++++++++ .../biometrics/common/SensorStrength.aidl | 40 ++++++++++++++++++ 8 files changed, 255 insertions(+), 1 deletion(-) create mode 100644 biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/.hash create mode 100644 biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/CommonProps.aidl create mode 100644 biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/ComponentInfo.aidl create mode 100644 biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/ICancellationSignal.aidl create mode 100644 biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/OperationContext.aidl create mode 100644 biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/OperationReason.aidl create mode 100644 biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/SensorStrength.aidl diff --git a/biometrics/common/aidl/Android.bp b/biometrics/common/aidl/Android.bp index 05028c4e50..167e0c78da 100644 --- a/biometrics/common/aidl/Android.bp +++ b/biometrics/common/aidl/Android.bp @@ -22,5 +22,16 @@ aidl_interface { enabled: false, }, }, - versions: ["1"], + versions_with_info: [ + { + version: "1", + imports: [], + }, + { + version: "2", + imports: [], + }, + + ], + } diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/.hash b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/.hash new file mode 100644 index 0000000000..2771cb1d44 --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/.hash @@ -0,0 +1 @@ +a6d4d8e7b26408ab30a3d87cf6b7ffd9e067e4d8 diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/CommonProps.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/CommonProps.aidl new file mode 100644 index 0000000000..d4433c5bde --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/CommonProps.aidl @@ -0,0 +1,41 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +@VintfStability +parcelable CommonProps { + int sensorId; + android.hardware.biometrics.common.SensorStrength sensorStrength = android.hardware.biometrics.common.SensorStrength.CONVENIENCE; + int maxEnrollmentsPerUser; + android.hardware.biometrics.common.ComponentInfo[] componentInfo; +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/ComponentInfo.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/ComponentInfo.aidl new file mode 100644 index 0000000000..ad11ddaa6d --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/ComponentInfo.aidl @@ -0,0 +1,42 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +@VintfStability +parcelable ComponentInfo { + String componentId; + String hardwareVersion; + String firmwareVersion; + String serialNumber; + String softwareVersion; +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/ICancellationSignal.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/ICancellationSignal.aidl new file mode 100644 index 0000000000..2bc6a6df05 --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/ICancellationSignal.aidl @@ -0,0 +1,38 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +@VintfStability +interface ICancellationSignal { + oneway void cancel(); +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/OperationContext.aidl new file mode 100644 index 0000000000..9d1cb8ff86 --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/OperationContext.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 -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; +@VintfStability +parcelable OperationContext { + int id = 0; + android.hardware.biometrics.common.OperationReason reason = android.hardware.biometrics.common.OperationReason.UNKNOWN; + boolean isAod = false; + boolean isCrypto = false; +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/OperationReason.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/OperationReason.aidl new file mode 100644 index 0000000000..3da3a6ab0b --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/OperationReason.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 -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; +@Backing(type="byte") @VintfStability +enum OperationReason { + UNKNOWN = 0, + BIOMETRIC_PROMPT = 1, + KEYGUARD = 2, +} diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/SensorStrength.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/SensorStrength.aidl new file mode 100644 index 0000000000..6675d091e5 --- /dev/null +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/2/android/hardware/biometrics/common/SensorStrength.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.common; +@Backing(type="byte") @VintfStability +enum SensorStrength { + CONVENIENCE = 0, + WEAK = 1, + STRONG = 2, +} -- GitLab From ac70f417cc27b8c8de1b071c169d07bd655112b1 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Thu, 28 Apr 2022 08:56:28 +0900 Subject: [PATCH 768/825] Finalize V2 of android.hardware.light It was missing in the prior attempt to finalize all AIDL interfaces. Bug: 230660133 Test: m nothing with https://googleplex-android-review.git.corp.google.com/q/topic:Tiramisu-SDK-Finalization-rel Change-Id: I5e105fc4176ab326c40ee2297cab59be83c34351 --- light/aidl/Android.bp | 13 ++++- .../aidl_api/android.hardware.light/2/.hash | 1 + .../hardware/light/BrightnessMode.aidl | 40 ++++++++++++++++ .../2/android/hardware/light/FlashMode.aidl | 40 ++++++++++++++++ .../2/android/hardware/light/HwLight.aidl | 40 ++++++++++++++++ .../android/hardware/light/HwLightState.aidl | 42 +++++++++++++++++ .../2/android/hardware/light/ILights.aidl | 39 +++++++++++++++ .../2/android/hardware/light/LightType.aidl | 47 +++++++++++++++++++ 8 files changed, 261 insertions(+), 1 deletion(-) create mode 100644 light/aidl/aidl_api/android.hardware.light/2/.hash create mode 100644 light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/BrightnessMode.aidl create mode 100644 light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/FlashMode.aidl create mode 100644 light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/HwLight.aidl create mode 100644 light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/HwLightState.aidl create mode 100644 light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/ILights.aidl create mode 100644 light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/LightType.aidl diff --git a/light/aidl/Android.bp b/light/aidl/Android.bp index c8973f3c25..6f478d7f22 100644 --- a/light/aidl/Android.bp +++ b/light/aidl/Android.bp @@ -24,5 +24,16 @@ aidl_interface { }, }, }, - versions: ["1"], + versions_with_info: [ + { + version: "1", + imports: [], + }, + { + version: "2", + imports: [], + }, + + ], + } diff --git a/light/aidl/aidl_api/android.hardware.light/2/.hash b/light/aidl/aidl_api/android.hardware.light/2/.hash new file mode 100644 index 0000000000..d27f4ad9d4 --- /dev/null +++ b/light/aidl/aidl_api/android.hardware.light/2/.hash @@ -0,0 +1 @@ +c8b1e8ebb88c57dcb2c350a8d9b722e77dd864c8 diff --git a/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/BrightnessMode.aidl b/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/BrightnessMode.aidl new file mode 100644 index 0000000000..881390764f --- /dev/null +++ b/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/BrightnessMode.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.light; +@VintfStability +enum BrightnessMode { + USER = 0, + SENSOR = 1, + LOW_PERSISTENCE = 2, +} diff --git a/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/FlashMode.aidl b/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/FlashMode.aidl new file mode 100644 index 0000000000..0411f82904 --- /dev/null +++ b/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/FlashMode.aidl @@ -0,0 +1,40 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.light; +@VintfStability +enum FlashMode { + NONE = 0, + TIMED = 1, + HARDWARE = 2, +} diff --git a/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/HwLight.aidl b/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/HwLight.aidl new file mode 100644 index 0000000000..25a2dce37d --- /dev/null +++ b/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/HwLight.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.light; +@VintfStability +parcelable HwLight { + int id; + int ordinal; + android.hardware.light.LightType type; +} diff --git a/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/HwLightState.aidl b/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/HwLightState.aidl new file mode 100644 index 0000000000..40e520b796 --- /dev/null +++ b/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/HwLightState.aidl @@ -0,0 +1,42 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.light; +@VintfStability +parcelable HwLightState { + int color; + android.hardware.light.FlashMode flashMode; + int flashOnMs; + int flashOffMs; + android.hardware.light.BrightnessMode brightnessMode; +} diff --git a/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/ILights.aidl b/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/ILights.aidl new file mode 100644 index 0000000000..30bb3c3d8b --- /dev/null +++ b/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/ILights.aidl @@ -0,0 +1,39 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.light; +@VintfStability +interface ILights { + void setLightState(in int id, in android.hardware.light.HwLightState state); + android.hardware.light.HwLight[] getLights(); +} diff --git a/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/LightType.aidl b/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/LightType.aidl new file mode 100644 index 0000000000..2b978ab8d5 --- /dev/null +++ b/light/aidl/aidl_api/android.hardware.light/2/android/hardware/light/LightType.aidl @@ -0,0 +1,47 @@ +/* + * 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.light; +@VintfStability +enum LightType { + BACKLIGHT = 0, + KEYBOARD = 1, + BUTTONS = 2, + BATTERY = 3, + NOTIFICATIONS = 4, + ATTENTION = 5, + BLUETOOTH = 6, + WIFI = 7, + MICROPHONE = 8, + CAMERA = 9, +} -- GitLab From e7938a23bbf538037fd7d850905f77137909218f Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Sat, 23 Apr 2022 00:12:09 +0000 Subject: [PATCH 769/825] DO NOT MERGE: Disable current matrix. The current matrix should not be used in Android T. However, it is left here so that any late fixes to the T matrix can be made in a way that will flow downstream. Reason for 'DO NOT MERGE' - avoid landing this change in goog/master, since the current matrix has HALs added there, some devices may be relying on it. In order to allow the (AOSP subset of) the T manifest to be frozen in AOSP, and the current matrix to be enabled from aosp/master -..-> goog/master, this will be reverted in tm-dev-plus-aosp immediately after it merges. Bug: 203103997 Test: boot devices and vts_treble_vintf_vendor_test passes Change-Id: I15bacedd0820e0086a742b97ee18e097ef8086e5 --- compatibility_matrices/Android.bp | 1 + compatibility_matrices/Android.mk | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/compatibility_matrices/Android.bp b/compatibility_matrices/Android.bp index 524242f6d3..422b37e68c 100644 --- a/compatibility_matrices/Android.bp +++ b/compatibility_matrices/Android.bp @@ -87,6 +87,7 @@ vintf_compatibility_matrix { vintf_compatibility_matrix { name: "framework_compatibility_matrix.current.xml", + enabled: false, stem: "compatibility_matrix.current.xml", srcs: [ "compatibility_matrix.current.xml", diff --git a/compatibility_matrices/Android.mk b/compatibility_matrices/Android.mk index d19f0dae1f..d6a44d0177 100644 --- a/compatibility_matrices/Android.mk +++ b/compatibility_matrices/Android.mk @@ -103,7 +103,6 @@ my_system_matrix_deps := \ framework_compatibility_matrix.5.xml \ framework_compatibility_matrix.6.xml \ framework_compatibility_matrix.7.xml \ - framework_compatibility_matrix.current.xml \ framework_compatibility_matrix.device.xml \ my_framework_matrix_deps += \ -- GitLab From d64dd7b6a8098f05dbec033ebbcff8d83b6f0b67 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Wed, 27 Apr 2022 10:05:35 -0700 Subject: [PATCH 770/825] Clarify measurement interval documentation The GNSS chipset must report measurements at the requested rate if location is not requested. Bug: 206670536 Test: doc update only Change-Id: I3b488f8b38def4b6ebf13733149d9b75b23db0cb --- .../android/hardware/gnss/IGnssMeasurementInterface.aidl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl b/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl index 8062aed390..8733754e96 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssMeasurementInterface.aidl @@ -53,8 +53,13 @@ interface IGnssMeasurementInterface { /** * Time interval between the reported measurements in milliseconds. * - * The GNSS chipset must not report measurements with a rate slower than requested. All the - * available measurements must be reported to the framework. + * When there is no concurrent location and measurement requests, the GNSS chipset must + * report measurements at as close as possible to the requested rate, as is supported by the + * implementation. + * + * When there are concurrent location and measurement requests, the GNSS chipset must report + * measurements at the same or a faster rate than the requested. In the concurrency cases, + * all the available measurements must be reported to the framework. * * For cases where concurrently serving the location and the measurement requests would not * consume more power than only the measurement request, the faster rate of the 2 requests -- GitLab From 7ecc2907453d7cb39e6a4de8d52388bdb00e69ed Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Mon, 25 Apr 2022 22:36:51 -0700 Subject: [PATCH 771/825] Move NN_TRY macro out of struct initialization NNAPI NN_TRY macros use Statement Expressions (a GNU extension) to propagate errors. However, a "return" statement in a Statement Expression can lead to memory leaks when the Statement Expression is being used to initialize a member of a struct. Specifically, when one member of a struct is already initialized, and a Statement Expression used to initialize a subsequent member early-returns, the previously initialized members will not have their destructors called. This CL moves any NN_TRY macro out of struct initialization to avoid any potential memory leaks. Bug: 230500484 Test: mma Test: presubmit Change-Id: I3493fd4764f8eacc86750e6414e62bc891abaccd --- neuralnetworks/1.0/utils/src/Conversions.cpp | 83 ++++--- neuralnetworks/1.1/utils/src/Conversions.cpp | 39 ++-- neuralnetworks/1.2/utils/src/Conversions.cpp | 91 +++++--- neuralnetworks/1.3/utils/src/Conversions.cpp | 137 ++++++++---- neuralnetworks/aidl/utils/src/Conversions.cpp | 206 ++++++++++++------ neuralnetworks/aidl/utils/src/Utils.cpp | 22 +- 6 files changed, 376 insertions(+), 202 deletions(-) diff --git a/neuralnetworks/1.0/utils/src/Conversions.cpp b/neuralnetworks/1.0/utils/src/Conversions.cpp index daa10fdb69..d98fef025d 100644 --- a/neuralnetworks/1.0/utils/src/Conversions.cpp +++ b/neuralnetworks/1.0/utils/src/Conversions.cpp @@ -110,8 +110,9 @@ nn::GeneralResult createSharedMemoryFromHidlMemory(const hidl_ return NN_ERROR() << "Unable to convert invalid ashmem memory object with " << memory.handle()->numInts << " numInts, but expected 0"; } + auto fd = NN_TRY(nn::dupFd(memory.handle()->data[0])); auto handle = nn::Memory::Ashmem{ - .fd = NN_TRY(nn::dupFd(memory.handle()->data[0])), + .fd = std::move(fd), .size = static_cast(memory.size()), }; return std::make_shared(nn::Memory{.handle = std::move(handle)}); @@ -137,12 +138,13 @@ nn::GeneralResult createSharedMemoryFromHidlMemory(const hidl_ } if (memory.name() != "hardware_buffer_blob") { - auto handle = nn::Memory::Unknown{ - .handle = NN_TRY(unknownHandleFromNativeHandle(memory.handle())), + auto handle = NN_TRY(unknownHandleFromNativeHandle(memory.handle())); + auto unknown = nn::Memory::Unknown{ + .handle = std::move(handle), .size = static_cast(memory.size()), .name = memory.name(), }; - return std::make_shared(nn::Memory{.handle = std::move(handle)}); + return std::make_shared(nn::Memory{.handle = std::move(unknown)}); } #ifdef __ANDROID__ @@ -245,19 +247,23 @@ GeneralResult unvalidatedConvert(const hal::V1_0::DataLocation& lo } GeneralResult unvalidatedConvert(const hal::V1_0::Operand& operand) { + const auto type = NN_TRY(unvalidatedConvert(operand.type)); + const auto lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)); + const auto location = NN_TRY(unvalidatedConvert(operand.location)); return Operand{ - .type = NN_TRY(unvalidatedConvert(operand.type)), + .type = type, .dimensions = operand.dimensions, .scale = operand.scale, .zeroPoint = operand.zeroPoint, - .lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)), - .location = NN_TRY(unvalidatedConvert(operand.location)), + .lifetime = lifetime, + .location = location, }; } GeneralResult unvalidatedConvert(const hal::V1_0::Operation& operation) { + const auto type = NN_TRY(unvalidatedConvert(operation.type)); return Operation{ - .type = NN_TRY(unvalidatedConvert(operation.type)), + .type = type, .inputs = operation.inputs, .outputs = operation.outputs, }; @@ -298,26 +304,30 @@ GeneralResult unvalidatedConvert(const hal::V1_0::Model& model) { } } + auto operands = NN_TRY(unvalidatedConvert(model.operands)); auto main = Model::Subgraph{ - .operands = NN_TRY(unvalidatedConvert(model.operands)), + .operands = std::move(operands), .operations = std::move(operations), .inputIndexes = model.inputIndexes, .outputIndexes = model.outputIndexes, }; + auto operandValues = NN_TRY(unvalidatedConvert(model.operandValues)); + auto pools = NN_TRY(unvalidatedConvert(model.pools)); return Model{ .main = std::move(main), - .operandValues = NN_TRY(unvalidatedConvert(model.operandValues)), - .pools = NN_TRY(unvalidatedConvert(model.pools)), + .operandValues = std::move(operandValues), + .pools = std::move(pools), }; } GeneralResult unvalidatedConvert(const hal::V1_0::RequestArgument& argument) { const auto lifetime = argument.hasNoValue ? Request::Argument::LifeTime::NO_VALUE : Request::Argument::LifeTime::POOL; + const auto location = NN_TRY(unvalidatedConvert(argument.location)); return Request::Argument{ .lifetime = lifetime, - .location = NN_TRY(unvalidatedConvert(argument.location)), + .location = location, .dimensions = argument.dimensions, }; } @@ -328,9 +338,11 @@ GeneralResult unvalidatedConvert(const hal::V1_0::Request& request) { pools.reserve(memories.size()); std::move(memories.begin(), memories.end(), std::back_inserter(pools)); + auto inputs = NN_TRY(unvalidatedConvert(request.inputs)); + auto outputs = NN_TRY(unvalidatedConvert(request.outputs)); return Request{ - .inputs = NN_TRY(unvalidatedConvert(request.inputs)), - .outputs = NN_TRY(unvalidatedConvert(request.outputs)), + .inputs = std::move(inputs), + .outputs = std::move(outputs), .pools = std::move(pools), }; } @@ -500,11 +512,13 @@ nn::GeneralResult unvalidatedConvert( } nn::GeneralResult unvalidatedConvert(const nn::Capabilities& capabilities) { + const auto float32Performance = NN_TRY(unvalidatedConvert( + capabilities.operandPerformance.lookup(nn::OperandType::TENSOR_FLOAT32))); + const auto quantized8Performance = NN_TRY(unvalidatedConvert( + capabilities.operandPerformance.lookup(nn::OperandType::TENSOR_QUANT8_ASYMM))); return Capabilities{ - .float32Performance = NN_TRY(unvalidatedConvert( - capabilities.operandPerformance.lookup(nn::OperandType::TENSOR_FLOAT32))), - .quantized8Performance = NN_TRY(unvalidatedConvert( - capabilities.operandPerformance.lookup(nn::OperandType::TENSOR_QUANT8_ASYMM))), + .float32Performance = float32Performance, + .quantized8Performance = quantized8Performance, }; } @@ -517,20 +531,24 @@ nn::GeneralResult unvalidatedConvert(const nn::DataLocation& locat } nn::GeneralResult unvalidatedConvert(const nn::Operand& operand) { + const auto type = NN_TRY(unvalidatedConvert(operand.type)); + const auto lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)); + const auto location = NN_TRY(unvalidatedConvert(operand.location)); return Operand{ - .type = NN_TRY(unvalidatedConvert(operand.type)), + .type = type, .dimensions = operand.dimensions, .numberOfConsumers = 0, .scale = operand.scale, .zeroPoint = operand.zeroPoint, - .lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)), - .location = NN_TRY(unvalidatedConvert(operand.location)), + .lifetime = lifetime, + .location = location, }; } nn::GeneralResult unvalidatedConvert(const nn::Operation& operation) { + const auto type = NN_TRY(unvalidatedConvert(operation.type)); return Operation{ - .type = NN_TRY(unvalidatedConvert(operation.type)), + .type = type, .inputs = operation.inputs, .outputs = operation.outputs, }; @@ -572,13 +590,16 @@ nn::GeneralResult unvalidatedConvert(const nn::Model& model) { operands[i].numberOfConsumers = numberOfConsumers[i]; } + auto operations = NN_TRY(unvalidatedConvert(model.main.operations)); + auto operandValues = NN_TRY(unvalidatedConvert(model.operandValues)); + auto pools = NN_TRY(unvalidatedConvert(model.pools)); return Model{ .operands = std::move(operands), - .operations = NN_TRY(unvalidatedConvert(model.main.operations)), + .operations = std::move(operations), .inputIndexes = model.main.inputIndexes, .outputIndexes = model.main.outputIndexes, - .operandValues = NN_TRY(unvalidatedConvert(model.operandValues)), - .pools = NN_TRY(unvalidatedConvert(model.pools)), + .operandValues = std::move(operandValues), + .pools = std::move(pools), }; } @@ -589,9 +610,10 @@ nn::GeneralResult unvalidatedConvert( << "Request cannot be unvalidatedConverted because it contains pointer-based memory"; } const bool hasNoValue = requestArgument.lifetime == nn::Request::Argument::LifeTime::NO_VALUE; + const auto location = NN_TRY(unvalidatedConvert(requestArgument.location)); return RequestArgument{ .hasNoValue = hasNoValue, - .location = NN_TRY(unvalidatedConvert(requestArgument.location)), + .location = location, .dimensions = requestArgument.dimensions, }; } @@ -606,10 +628,13 @@ nn::GeneralResult unvalidatedConvert(const nn::Request& request) { << "Request cannot be unvalidatedConverted because it contains pointer-based memory"; } + auto inputs = NN_TRY(unvalidatedConvert(request.inputs)); + auto outputs = NN_TRY(unvalidatedConvert(request.outputs)); + auto pools = NN_TRY(unvalidatedConvert(request.pools)); return Request{ - .inputs = NN_TRY(unvalidatedConvert(request.inputs)), - .outputs = NN_TRY(unvalidatedConvert(request.outputs)), - .pools = NN_TRY(unvalidatedConvert(request.pools)), + .inputs = std::move(inputs), + .outputs = std::move(outputs), + .pools = std::move(pools), }; } diff --git a/neuralnetworks/1.1/utils/src/Conversions.cpp b/neuralnetworks/1.1/utils/src/Conversions.cpp index 5bdbe314b6..887c8eca05 100644 --- a/neuralnetworks/1.1/utils/src/Conversions.cpp +++ b/neuralnetworks/1.1/utils/src/Conversions.cpp @@ -88,8 +88,9 @@ GeneralResult unvalidatedConvert(const hal::V1_1::Capabilities& ca } GeneralResult unvalidatedConvert(const hal::V1_1::Operation& operation) { + const auto type = NN_TRY(unvalidatedConvert(operation.type)); return Operation{ - .type = NN_TRY(unvalidatedConvert(operation.type)), + .type = type, .inputs = operation.inputs, .outputs = operation.outputs, }; @@ -110,17 +111,20 @@ GeneralResult unvalidatedConvert(const hal::V1_1::Model& model) { } } + auto operands = NN_TRY(unvalidatedConvert(model.operands)); auto main = Model::Subgraph{ - .operands = NN_TRY(unvalidatedConvert(model.operands)), + .operands = std::move(operands), .operations = std::move(operations), .inputIndexes = model.inputIndexes, .outputIndexes = model.outputIndexes, }; + auto operandValues = NN_TRY(unvalidatedConvert(model.operandValues)); + auto pools = NN_TRY(unvalidatedConvert(model.pools)); return Model{ .main = std::move(main), - .operandValues = NN_TRY(unvalidatedConvert(model.operandValues)), - .pools = NN_TRY(unvalidatedConvert(model.pools)), + .operandValues = std::move(operandValues), + .pools = std::move(pools), .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, }; } @@ -195,19 +199,23 @@ nn::GeneralResult unvalidatedConvert(const nn::OperationType& ope } nn::GeneralResult unvalidatedConvert(const nn::Capabilities& capabilities) { + const auto float32Performance = NN_TRY(unvalidatedConvert( + capabilities.operandPerformance.lookup(nn::OperandType::TENSOR_FLOAT32))); + const auto quanitized8Performance = NN_TRY(unvalidatedConvert( + capabilities.operandPerformance.lookup(nn::OperandType::TENSOR_QUANT8_ASYMM))); + const auto relaxedFloat32toFloat16Performance = + NN_TRY(unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceTensor)); return Capabilities{ - .float32Performance = NN_TRY(unvalidatedConvert( - capabilities.operandPerformance.lookup(nn::OperandType::TENSOR_FLOAT32))), - .quantized8Performance = NN_TRY(unvalidatedConvert( - capabilities.operandPerformance.lookup(nn::OperandType::TENSOR_QUANT8_ASYMM))), - .relaxedFloat32toFloat16Performance = NN_TRY( - unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceTensor)), + .float32Performance = float32Performance, + .quantized8Performance = quanitized8Performance, + .relaxedFloat32toFloat16Performance = relaxedFloat32toFloat16Performance, }; } nn::GeneralResult unvalidatedConvert(const nn::Operation& operation) { + const auto type = NN_TRY(unvalidatedConvert(operation.type)); return Operation{ - .type = NN_TRY(unvalidatedConvert(operation.type)), + .type = type, .inputs = operation.inputs, .outputs = operation.outputs, }; @@ -229,13 +237,16 @@ nn::GeneralResult unvalidatedConvert(const nn::Model& model) { operands[i].numberOfConsumers = numberOfConsumers[i]; } + auto operations = NN_TRY(unvalidatedConvert(model.main.operations)); + auto operandValues = NN_TRY(unvalidatedConvert(model.operandValues)); + auto pools = NN_TRY(unvalidatedConvert(model.pools)); return Model{ .operands = std::move(operands), - .operations = NN_TRY(unvalidatedConvert(model.main.operations)), + .operations = std::move(operations), .inputIndexes = model.main.inputIndexes, .outputIndexes = model.main.outputIndexes, - .operandValues = NN_TRY(unvalidatedConvert(model.operandValues)), - .pools = NN_TRY(unvalidatedConvert(model.pools)), + .operandValues = std::move(operandValues), + .pools = std::move(pools), .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, }; } diff --git a/neuralnetworks/1.2/utils/src/Conversions.cpp b/neuralnetworks/1.2/utils/src/Conversions.cpp index 62ec2ed6c6..78d71cf990 100644 --- a/neuralnetworks/1.2/utils/src/Conversions.cpp +++ b/neuralnetworks/1.2/utils/src/Conversions.cpp @@ -131,15 +131,18 @@ GeneralResult unvalidatedConvert(const hal::V1_2::Capabilities& ca GeneralResult unvalidatedConvert( const hal::V1_2::Capabilities::OperandPerformance& operandPerformance) { + const auto type = NN_TRY(unvalidatedConvert(operandPerformance.type)); + const auto info = NN_TRY(unvalidatedConvert(operandPerformance.info)); return Capabilities::OperandPerformance{ - .type = NN_TRY(unvalidatedConvert(operandPerformance.type)), - .info = NN_TRY(unvalidatedConvert(operandPerformance.info)), + .type = type, + .info = info, }; } GeneralResult unvalidatedConvert(const hal::V1_2::Operation& operation) { + const auto type = NN_TRY(unvalidatedConvert(operation.type)); return Operation{ - .type = NN_TRY(unvalidatedConvert(operation.type)), + .type = type, .inputs = operation.inputs, .outputs = operation.outputs, }; @@ -154,14 +157,18 @@ GeneralResult unvalidatedConvert( } GeneralResult unvalidatedConvert(const hal::V1_2::Operand& operand) { + const auto type = NN_TRY(unvalidatedConvert(operand.type)); + const auto lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)); + const auto location = NN_TRY(unvalidatedConvert(operand.location)); + auto extraParams = NN_TRY(unvalidatedConvert(operand.extraParams)); return Operand{ - .type = NN_TRY(unvalidatedConvert(operand.type)), + .type = type, .dimensions = operand.dimensions, .scale = operand.scale, .zeroPoint = operand.zeroPoint, - .lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)), - .location = NN_TRY(unvalidatedConvert(operand.location)), - .extraParams = NN_TRY(unvalidatedConvert(operand.extraParams)), + .lifetime = lifetime, + .location = location, + .extraParams = std::move(extraParams), }; } @@ -196,19 +203,23 @@ GeneralResult unvalidatedConvert(const hal::V1_2::Model& model) { } } + auto operands = NN_TRY(unvalidatedConvert(model.operands)); auto main = Model::Subgraph{ - .operands = NN_TRY(unvalidatedConvert(model.operands)), + .operands = std::move(operands), .operations = std::move(operations), .inputIndexes = model.inputIndexes, .outputIndexes = model.outputIndexes, }; + auto operandValues = NN_TRY(unvalidatedConvert(model.operandValues)); + auto pools = NN_TRY(unvalidatedConvert(model.pools)); + auto extensionNameToPrefix = NN_TRY(unvalidatedConvert(model.extensionNameToPrefix)); return Model{ .main = std::move(main), - .operandValues = NN_TRY(unvalidatedConvert(model.operandValues)), - .pools = NN_TRY(unvalidatedConvert(model.pools)), + .operandValues = std::move(operandValues), + .pools = std::move(pools), .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, - .extensionNameToPrefix = NN_TRY(unvalidatedConvert(model.extensionNameToPrefix)), + .extensionNameToPrefix = std::move(extensionNameToPrefix), }; } @@ -248,9 +259,10 @@ GeneralResult unvalidatedConvert(const hal::V1_2::Timing& timing) { } GeneralResult unvalidatedConvert(const hal::V1_2::Extension& extension) { + auto operandTypes = NN_TRY(unvalidatedConvert(extension.operandTypes)); return Extension{ .name = extension.name, - .operandTypes = NN_TRY(unvalidatedConvert(extension.operandTypes)), + .operandTypes = std::move(operandTypes), }; } @@ -406,35 +418,41 @@ nn::GeneralResult unvalidatedConvert(const nn::DeviceType& deviceTyp } nn::GeneralResult unvalidatedConvert(const nn::Capabilities& capabilities) { - std::vector operandPerformance; - operandPerformance.reserve(capabilities.operandPerformance.asVector().size()); + std::vector filteredOperandPerformances; + filteredOperandPerformances.reserve(capabilities.operandPerformance.asVector().size()); std::copy_if(capabilities.operandPerformance.asVector().begin(), capabilities.operandPerformance.asVector().end(), - std::back_inserter(operandPerformance), + std::back_inserter(filteredOperandPerformances), [](const nn::Capabilities::OperandPerformance& operandPerformance) { return compliantVersion(operandPerformance.type).has_value(); }); + const auto relaxedFloat32toFloat16PerformanceScalar = + NN_TRY(unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceScalar)); + const auto relaxedFloat32toFloat16PerformanceTensor = + NN_TRY(unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceTensor)); + auto operandPerformance = NN_TRY(unvalidatedConvert(filteredOperandPerformances)); return Capabilities{ - .relaxedFloat32toFloat16PerformanceScalar = NN_TRY( - unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceScalar)), - .relaxedFloat32toFloat16PerformanceTensor = NN_TRY( - unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceTensor)), - .operandPerformance = NN_TRY(unvalidatedConvert(operandPerformance)), + .relaxedFloat32toFloat16PerformanceScalar = relaxedFloat32toFloat16PerformanceScalar, + .relaxedFloat32toFloat16PerformanceTensor = relaxedFloat32toFloat16PerformanceTensor, + .operandPerformance = std::move(operandPerformance), }; } nn::GeneralResult unvalidatedConvert( const nn::Capabilities::OperandPerformance& operandPerformance) { + const auto type = NN_TRY(unvalidatedConvert(operandPerformance.type)); + const auto info = NN_TRY(unvalidatedConvert(operandPerformance.info)); return Capabilities::OperandPerformance{ - .type = NN_TRY(unvalidatedConvert(operandPerformance.type)), - .info = NN_TRY(unvalidatedConvert(operandPerformance.info)), + .type = type, + .info = info, }; } nn::GeneralResult unvalidatedConvert(const nn::Operation& operation) { + const auto type = NN_TRY(unvalidatedConvert(operation.type)); return Operation{ - .type = NN_TRY(unvalidatedConvert(operation.type)), + .type = type, .inputs = operation.inputs, .outputs = operation.outputs, }; @@ -449,15 +467,19 @@ nn::GeneralResult unvalidatedConvert( } nn::GeneralResult unvalidatedConvert(const nn::Operand& operand) { + const auto type = NN_TRY(unvalidatedConvert(operand.type)); + const auto lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)); + const auto location = NN_TRY(unvalidatedConvert(operand.location)); + auto extraParams = NN_TRY(unvalidatedConvert(operand.extraParams)); return Operand{ - .type = NN_TRY(unvalidatedConvert(operand.type)), + .type = type, .dimensions = operand.dimensions, .numberOfConsumers = 0, .scale = operand.scale, .zeroPoint = operand.zeroPoint, - .lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)), - .location = NN_TRY(unvalidatedConvert(operand.location)), - .extraParams = NN_TRY(unvalidatedConvert(operand.extraParams)), + .lifetime = lifetime, + .location = location, + .extraParams = std::move(extraParams), }; } @@ -482,15 +504,19 @@ nn::GeneralResult unvalidatedConvert(const nn::Model& model) { operands[i].numberOfConsumers = numberOfConsumers[i]; } + auto operations = NN_TRY(unvalidatedConvert(model.main.operations)); + auto operandValues = NN_TRY(unvalidatedConvert(model.operandValues)); + auto pools = NN_TRY(unvalidatedConvert(model.pools)); + auto extensionNameToPrefix = NN_TRY(unvalidatedConvert(model.extensionNameToPrefix)); return Model{ .operands = std::move(operands), - .operations = NN_TRY(unvalidatedConvert(model.main.operations)), + .operations = std::move(operations), .inputIndexes = model.main.inputIndexes, .outputIndexes = model.main.outputIndexes, - .operandValues = NN_TRY(unvalidatedConvert(model.operandValues)), - .pools = NN_TRY(unvalidatedConvert(model.pools)), + .operandValues = std::move(operandValues), + .pools = std::move(pools), .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, - .extensionNameToPrefix = NN_TRY(unvalidatedConvert(model.extensionNameToPrefix)), + .extensionNameToPrefix = std::move(extensionNameToPrefix), }; } @@ -524,9 +550,10 @@ nn::GeneralResult unvalidatedConvert(const nn::Timing& timing) { } nn::GeneralResult unvalidatedConvert(const nn::Extension& extension) { + auto operandTypes = NN_TRY(unvalidatedConvert(extension.operandTypes)); return Extension{ .name = extension.name, - .operandTypes = NN_TRY(unvalidatedConvert(extension.operandTypes)), + .operandTypes = std::move(operandTypes), }; } diff --git a/neuralnetworks/1.3/utils/src/Conversions.cpp b/neuralnetworks/1.3/utils/src/Conversions.cpp index 09e9d80d38..4eeb414dc8 100644 --- a/neuralnetworks/1.3/utils/src/Conversions.cpp +++ b/neuralnetworks/1.3/utils/src/Conversions.cpp @@ -133,28 +133,35 @@ GeneralResult unvalidatedConvert(const hal::V1_3::Capabilities& ca auto table = NN_TRY(Capabilities::OperandPerformanceTable::create(std::move(operandPerformance))); + const auto relaxedFloat32toFloat16PerformanceScalar = + NN_TRY(unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceScalar)); + const auto relaxedFloat32toFloat16PerformanceTensor = + NN_TRY(unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceTensor)); + const auto ifPerformance = NN_TRY(unvalidatedConvert(capabilities.ifPerformance)); + const auto whilePerformance = NN_TRY(unvalidatedConvert(capabilities.whilePerformance)); return Capabilities{ - .relaxedFloat32toFloat16PerformanceScalar = NN_TRY( - unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceScalar)), - .relaxedFloat32toFloat16PerformanceTensor = NN_TRY( - unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceTensor)), + .relaxedFloat32toFloat16PerformanceScalar = relaxedFloat32toFloat16PerformanceScalar, + .relaxedFloat32toFloat16PerformanceTensor = relaxedFloat32toFloat16PerformanceTensor, .operandPerformance = std::move(table), - .ifPerformance = NN_TRY(unvalidatedConvert(capabilities.ifPerformance)), - .whilePerformance = NN_TRY(unvalidatedConvert(capabilities.whilePerformance)), + .ifPerformance = ifPerformance, + .whilePerformance = whilePerformance, }; } GeneralResult unvalidatedConvert( const hal::V1_3::Capabilities::OperandPerformance& operandPerformance) { + const auto type = NN_TRY(unvalidatedConvert(operandPerformance.type)); + const auto info = NN_TRY(unvalidatedConvert(operandPerformance.info)); return Capabilities::OperandPerformance{ - .type = NN_TRY(unvalidatedConvert(operandPerformance.type)), - .info = NN_TRY(unvalidatedConvert(operandPerformance.info)), + .type = type, + .info = info, }; } GeneralResult unvalidatedConvert(const hal::V1_3::Operation& operation) { + const auto type = NN_TRY(unvalidatedConvert(operation.type)); return Operation{ - .type = NN_TRY(unvalidatedConvert(operation.type)), + .type = type, .inputs = operation.inputs, .outputs = operation.outputs, }; @@ -166,25 +173,34 @@ GeneralResult unvalidatedConvert( } GeneralResult unvalidatedConvert(const hal::V1_3::Operand& operand) { + const auto type = NN_TRY(unvalidatedConvert(operand.type)); + const auto lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)); + const auto location = NN_TRY(unvalidatedConvert(operand.location)); + auto extraParams = NN_TRY(unvalidatedConvert(operand.extraParams)); return Operand{ - .type = NN_TRY(unvalidatedConvert(operand.type)), + .type = type, .dimensions = operand.dimensions, .scale = operand.scale, .zeroPoint = operand.zeroPoint, - .lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)), - .location = NN_TRY(unvalidatedConvert(operand.location)), - .extraParams = NN_TRY(unvalidatedConvert(operand.extraParams)), + .lifetime = lifetime, + .location = location, + .extraParams = std::move(extraParams), }; } GeneralResult unvalidatedConvert(const hal::V1_3::Model& model) { + auto main = NN_TRY(unvalidatedConvert(model.main)); + auto referenced = NN_TRY(unvalidatedConvert(model.referenced)); + auto operandValues = NN_TRY(unvalidatedConvert(model.operandValues)); + auto pools = NN_TRY(unvalidatedConvert(model.pools)); + auto extensionNameToPrefix = NN_TRY(unvalidatedConvert(model.extensionNameToPrefix)); return Model{ - .main = NN_TRY(unvalidatedConvert(model.main)), - .referenced = NN_TRY(unvalidatedConvert(model.referenced)), - .operandValues = NN_TRY(unvalidatedConvert(model.operandValues)), - .pools = NN_TRY(unvalidatedConvert(model.pools)), + .main = std::move(main), + .referenced = std::move(referenced), + .operandValues = std::move(operandValues), + .pools = std::move(pools), .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, - .extensionNameToPrefix = NN_TRY(unvalidatedConvert(model.extensionNameToPrefix)), + .extensionNameToPrefix = std::move(extensionNameToPrefix), }; } @@ -204,8 +220,9 @@ GeneralResult unvalidatedConvert(const hal::V1_3::Subgraph& sub } } + auto operands = NN_TRY(unvalidatedConvert(subgraph.operands)); return Model::Subgraph{ - .operands = NN_TRY(unvalidatedConvert(subgraph.operands)), + .operands = std::move(operands), .operations = std::move(operations), .inputIndexes = subgraph.inputIndexes, .outputIndexes = subgraph.outputIndexes, @@ -225,10 +242,13 @@ GeneralResult unvalidatedConvert(const hal::V1_3::BufferRole& buffer } GeneralResult unvalidatedConvert(const hal::V1_3::Request& request) { + auto inputs = NN_TRY(unvalidatedConvert(request.inputs)); + auto outputs = NN_TRY(unvalidatedConvert(request.outputs)); + auto pools = NN_TRY(unvalidatedConvert(request.pools)); return Request{ - .inputs = NN_TRY(unvalidatedConvert(request.inputs)), - .outputs = NN_TRY(unvalidatedConvert(request.outputs)), - .pools = NN_TRY(unvalidatedConvert(request.pools)), + .inputs = std::move(inputs), + .outputs = std::move(outputs), + .pools = std::move(pools), }; } @@ -463,37 +483,45 @@ nn::GeneralResult unvalidatedConvert(const nn::Priority& priority) { } nn::GeneralResult unvalidatedConvert(const nn::Capabilities& capabilities) { - std::vector operandPerformance; - operandPerformance.reserve(capabilities.operandPerformance.asVector().size()); + std::vector filteredOperandPerformances; + filteredOperandPerformances.reserve(capabilities.operandPerformance.asVector().size()); std::copy_if(capabilities.operandPerformance.asVector().begin(), capabilities.operandPerformance.asVector().end(), - std::back_inserter(operandPerformance), + std::back_inserter(filteredOperandPerformances), [](const nn::Capabilities::OperandPerformance& operandPerformance) { return compliantVersion(operandPerformance.type).has_value(); }); + const auto relaxedFloat32toFloat16PerformanceScalar = + NN_TRY(unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceScalar)); + const auto relaxedFloat32toFloat16PerformanceTensor = + NN_TRY(unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceTensor)); + auto operandPerformance = NN_TRY(unvalidatedConvert(filteredOperandPerformances)); + const auto ifPerformance = NN_TRY(unvalidatedConvert(capabilities.ifPerformance)); + const auto whilePerformance = NN_TRY(unvalidatedConvert(capabilities.whilePerformance)); return Capabilities{ - .relaxedFloat32toFloat16PerformanceScalar = NN_TRY( - unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceScalar)), - .relaxedFloat32toFloat16PerformanceTensor = NN_TRY( - unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceTensor)), - .operandPerformance = NN_TRY(unvalidatedConvert(operandPerformance)), - .ifPerformance = NN_TRY(unvalidatedConvert(capabilities.ifPerformance)), - .whilePerformance = NN_TRY(unvalidatedConvert(capabilities.whilePerformance)), + .relaxedFloat32toFloat16PerformanceScalar = relaxedFloat32toFloat16PerformanceScalar, + .relaxedFloat32toFloat16PerformanceTensor = relaxedFloat32toFloat16PerformanceTensor, + .operandPerformance = std::move(operandPerformance), + .ifPerformance = ifPerformance, + .whilePerformance = whilePerformance, }; } nn::GeneralResult unvalidatedConvert( const nn::Capabilities::OperandPerformance& operandPerformance) { + const auto type = NN_TRY(unvalidatedConvert(operandPerformance.type)); + const auto info = NN_TRY(unvalidatedConvert(operandPerformance.info)); return Capabilities::OperandPerformance{ - .type = NN_TRY(unvalidatedConvert(operandPerformance.type)), - .info = NN_TRY(unvalidatedConvert(operandPerformance.info)), + .type = type, + .info = info, }; } nn::GeneralResult unvalidatedConvert(const nn::Operation& operation) { + const auto type = NN_TRY(unvalidatedConvert(operation.type)); return Operation{ - .type = NN_TRY(unvalidatedConvert(operation.type)), + .type = type, .inputs = operation.inputs, .outputs = operation.outputs, }; @@ -509,15 +537,19 @@ nn::GeneralResult unvalidatedConvert( } nn::GeneralResult unvalidatedConvert(const nn::Operand& operand) { + const auto type = NN_TRY(unvalidatedConvert(operand.type)); + const auto lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)); + const auto location = NN_TRY(unvalidatedConvert(operand.location)); + auto extraParams = NN_TRY(unvalidatedConvert(operand.extraParams)); return Operand{ - .type = NN_TRY(unvalidatedConvert(operand.type)), + .type = type, .dimensions = operand.dimensions, .numberOfConsumers = 0, .scale = operand.scale, .zeroPoint = operand.zeroPoint, - .lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)), - .location = NN_TRY(unvalidatedConvert(operand.location)), - .extraParams = NN_TRY(unvalidatedConvert(operand.extraParams)), + .lifetime = lifetime, + .location = location, + .extraParams = std::move(extraParams), }; } @@ -527,13 +559,18 @@ nn::GeneralResult unvalidatedConvert(const nn::Model& model) { << "Model cannot be unvalidatedConverted because it contains pointer-based memory"; } + auto main = NN_TRY(unvalidatedConvert(model.main)); + auto referenced = NN_TRY(unvalidatedConvert(model.referenced)); + auto operandValues = NN_TRY(unvalidatedConvert(model.operandValues)); + auto pools = NN_TRY(unvalidatedConvert(model.pools)); + auto extensionNameToPrefix = NN_TRY(unvalidatedConvert(model.extensionNameToPrefix)); return Model{ - .main = NN_TRY(unvalidatedConvert(model.main)), - .referenced = NN_TRY(unvalidatedConvert(model.referenced)), - .operandValues = NN_TRY(unvalidatedConvert(model.operandValues)), - .pools = NN_TRY(unvalidatedConvert(model.pools)), + .main = std::move(main), + .referenced = std::move(referenced), + .operandValues = std::move(operandValues), + .pools = std::move(pools), .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, - .extensionNameToPrefix = NN_TRY(unvalidatedConvert(model.extensionNameToPrefix)), + .extensionNameToPrefix = std::move(extensionNameToPrefix), }; } @@ -548,9 +585,10 @@ nn::GeneralResult unvalidatedConvert(const nn::Model::Subgraph& subgra operands[i].numberOfConsumers = numberOfConsumers[i]; } + auto operations = NN_TRY(unvalidatedConvert(subgraph.operations)); return Subgraph{ .operands = std::move(operands), - .operations = NN_TRY(unvalidatedConvert(subgraph.operations)), + .operations = std::move(operations), .inputIndexes = subgraph.inputIndexes, .outputIndexes = subgraph.outputIndexes, }; @@ -574,10 +612,13 @@ nn::GeneralResult unvalidatedConvert(const nn::Request& request) { << "Request cannot be unvalidatedConverted because it contains pointer-based memory"; } + auto inputs = NN_TRY(unvalidatedConvert(request.inputs)); + auto outputs = NN_TRY(unvalidatedConvert(request.outputs)); + auto pools = NN_TRY(unvalidatedConvert(request.pools)); return Request{ - .inputs = NN_TRY(unvalidatedConvert(request.inputs)), - .outputs = NN_TRY(unvalidatedConvert(request.outputs)), - .pools = NN_TRY(unvalidatedConvert(request.pools)), + .inputs = std::move(inputs), + .outputs = std::move(outputs), + .pools = std::move(pools), }; } diff --git a/neuralnetworks/aidl/utils/src/Conversions.cpp b/neuralnetworks/aidl/utils/src/Conversions.cpp index 081e3d7142..47c72b47af 100644 --- a/neuralnetworks/aidl/utils/src/Conversions.cpp +++ b/neuralnetworks/aidl/utils/src/Conversions.cpp @@ -177,22 +177,28 @@ GeneralResult unvalidatedConvert(const aidl_hal::Capabilities& cap auto table = NN_TRY(Capabilities::OperandPerformanceTable::create(std::move(operandPerformance))); + const auto relaxedFloat32toFloat16PerformanceScalar = + NN_TRY(unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceScalar)); + const auto relaxedFloat32toFloat16PerformanceTensor = + NN_TRY(unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceTensor)); + const auto ifPerformance = NN_TRY(unvalidatedConvert(capabilities.ifPerformance)); + const auto whilePerformance = NN_TRY(unvalidatedConvert(capabilities.whilePerformance)); return Capabilities{ - .relaxedFloat32toFloat16PerformanceScalar = NN_TRY( - unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceScalar)), - .relaxedFloat32toFloat16PerformanceTensor = NN_TRY( - unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceTensor)), + .relaxedFloat32toFloat16PerformanceScalar = relaxedFloat32toFloat16PerformanceScalar, + .relaxedFloat32toFloat16PerformanceTensor = relaxedFloat32toFloat16PerformanceTensor, .operandPerformance = std::move(table), - .ifPerformance = NN_TRY(unvalidatedConvert(capabilities.ifPerformance)), - .whilePerformance = NN_TRY(unvalidatedConvert(capabilities.whilePerformance)), + .ifPerformance = ifPerformance, + .whilePerformance = whilePerformance, }; } GeneralResult unvalidatedConvert( const aidl_hal::OperandPerformance& operandPerformance) { + const auto type = NN_TRY(unvalidatedConvert(operandPerformance.type)); + const auto info = NN_TRY(unvalidatedConvert(operandPerformance.info)); return Capabilities::OperandPerformance{ - .type = NN_TRY(unvalidatedConvert(operandPerformance.type)), - .info = NN_TRY(unvalidatedConvert(operandPerformance.info)), + .type = type, + .info = info, }; } @@ -228,10 +234,13 @@ GeneralResult unvalidatedConvert(const aidl_hal::DataLocation& loc } GeneralResult unvalidatedConvert(const aidl_hal::Operation& operation) { + const auto type = NN_TRY(unvalidatedConvert(operation.type)); + auto inputs = NN_TRY(toUnsigned(operation.inputs)); + auto outputs = NN_TRY(toUnsigned(operation.outputs)); return Operation{ - .type = NN_TRY(unvalidatedConvert(operation.type)), - .inputs = NN_TRY(toUnsigned(operation.inputs)), - .outputs = NN_TRY(toUnsigned(operation.outputs)), + .type = type, + .inputs = std::move(inputs), + .outputs = std::move(outputs), }; } @@ -241,14 +250,19 @@ GeneralResult unvalidatedConvert( } GeneralResult unvalidatedConvert(const aidl_hal::Operand& operand) { + const auto type = NN_TRY(unvalidatedConvert(operand.type)); + auto dimensions = NN_TRY(toUnsigned(operand.dimensions)); + const auto lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)); + const auto location = NN_TRY(unvalidatedConvert(operand.location)); + auto extraParams = NN_TRY(unvalidatedConvert(operand.extraParams)); return Operand{ - .type = NN_TRY(unvalidatedConvert(operand.type)), - .dimensions = NN_TRY(toUnsigned(operand.dimensions)), + .type = type, + .dimensions = std::move(dimensions), .scale = operand.scale, .zeroPoint = operand.zeroPoint, - .lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)), - .location = NN_TRY(unvalidatedConvert(operand.location)), - .extraParams = NN_TRY(unvalidatedConvert(operand.extraParams)), + .lifetime = lifetime, + .location = location, + .extraParams = std::move(extraParams), }; } @@ -280,22 +294,31 @@ GeneralResult unvalidatedConvert( } GeneralResult unvalidatedConvert(const aidl_hal::Model& model) { + auto main = NN_TRY(unvalidatedConvert(model.main)); + auto referenced = NN_TRY(unvalidatedConvert(model.referenced)); + auto operandValues = NN_TRY(unvalidatedConvert(model.operandValues)); + auto pools = NN_TRY(unvalidatedConvert(model.pools)); + auto extensionNameToPrefix = NN_TRY(unvalidatedConvert(model.extensionNameToPrefix)); return Model{ - .main = NN_TRY(unvalidatedConvert(model.main)), - .referenced = NN_TRY(unvalidatedConvert(model.referenced)), - .operandValues = NN_TRY(unvalidatedConvert(model.operandValues)), - .pools = NN_TRY(unvalidatedConvert(model.pools)), + .main = std::move(main), + .referenced = std::move(referenced), + .operandValues = std::move(operandValues), + .pools = std::move(pools), .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, - .extensionNameToPrefix = NN_TRY(unvalidatedConvert(model.extensionNameToPrefix)), + .extensionNameToPrefix = std::move(extensionNameToPrefix), }; } GeneralResult unvalidatedConvert(const aidl_hal::Subgraph& subgraph) { + auto operands = NN_TRY(unvalidatedConvert(subgraph.operands)); + auto operations = NN_TRY(unvalidatedConvert(subgraph.operations)); + auto inputIndexes = NN_TRY(toUnsigned(subgraph.inputIndexes)); + auto outputIndexes = NN_TRY(toUnsigned(subgraph.outputIndexes)); return Model::Subgraph{ - .operands = NN_TRY(unvalidatedConvert(subgraph.operands)), - .operations = NN_TRY(unvalidatedConvert(subgraph.operations)), - .inputIndexes = NN_TRY(toUnsigned(subgraph.inputIndexes)), - .outputIndexes = NN_TRY(toUnsigned(subgraph.outputIndexes)), + .operands = std::move(operands), + .operations = std::move(operations), + .inputIndexes = std::move(inputIndexes), + .outputIndexes = std::move(outputIndexes), }; } @@ -308,9 +331,10 @@ GeneralResult unvalidatedConvert( } GeneralResult unvalidatedConvert(const aidl_hal::Extension& extension) { + auto operandTypes = NN_TRY(unvalidatedConvert(extension.operandTypes)); return Extension{ .name = extension.name, - .operandTypes = NN_TRY(unvalidatedConvert(extension.operandTypes)), + .operandTypes = std::move(operandTypes), }; } @@ -326,8 +350,9 @@ GeneralResult unvalidatedConvert( } GeneralResult unvalidatedConvert(const aidl_hal::OutputShape& outputShape) { + auto dimensions = NN_TRY(toUnsigned(outputShape.dimensions)); return OutputShape{ - .dimensions = NN_TRY(toUnsigned(outputShape.dimensions)), + .dimensions = std::move(dimensions), .isSufficient = outputShape.isSufficient, }; } @@ -346,8 +371,9 @@ GeneralResult unvalidatedConvert(const aidl_hal::Memory& memory) { return NN_ERROR() << "Memory: size must be <= std::numeric_limits::max()"; } + auto fd = NN_TRY(dupFd(ashmem.fd.get())); auto handle = Memory::Ashmem{ - .fd = NN_TRY(dupFd(ashmem.fd.get())), + .fd = std::move(fd), .size = static_cast(ashmem.size), }; return std::make_shared(Memory{.handle = std::move(handle)}); @@ -426,7 +452,8 @@ GeneralResult unvalidatedConvert(const std::vector unvalidatedConvert(const aidl_hal::BufferDesc& bufferDesc) { - return BufferDesc{.dimensions = NN_TRY(toUnsigned(bufferDesc.dimensions))}; + auto dimensions = NN_TRY(toUnsigned(bufferDesc.dimensions)); + return BufferDesc{.dimensions = std::move(dimensions)}; } GeneralResult unvalidatedConvert(const aidl_hal::BufferRole& bufferRole) { @@ -440,20 +467,25 @@ GeneralResult unvalidatedConvert(const aidl_hal::BufferRole& bufferR } GeneralResult unvalidatedConvert(const aidl_hal::Request& request) { + auto inputs = NN_TRY(unvalidatedConvert(request.inputs)); + auto outputs = NN_TRY(unvalidatedConvert(request.outputs)); + auto pools = NN_TRY(unvalidatedConvert(request.pools)); return Request{ - .inputs = NN_TRY(unvalidatedConvert(request.inputs)), - .outputs = NN_TRY(unvalidatedConvert(request.outputs)), - .pools = NN_TRY(unvalidatedConvert(request.pools)), + .inputs = std::move(inputs), + .outputs = std::move(outputs), + .pools = std::move(pools), }; } GeneralResult unvalidatedConvert(const aidl_hal::RequestArgument& argument) { const auto lifetime = argument.hasNoValue ? Request::Argument::LifeTime::NO_VALUE : Request::Argument::LifeTime::POOL; + const auto location = NN_TRY(unvalidatedConvert(argument.location)); + auto dimensions = NN_TRY(toUnsigned(argument.dimensions)); return Request::Argument{ .lifetime = lifetime, - .location = NN_TRY(unvalidatedConvert(argument.location)), - .dimensions = NN_TRY(toUnsigned(argument.dimensions)), + .location = location, + .dimensions = std::move(dimensions), }; } @@ -720,8 +752,9 @@ nn::GeneralResult unvalidatedConvert( nn::GeneralResult unvalidatedConvert( const nn::Capabilities::OperandPerformance& operandPerformance) { - return OperandPerformance{.type = NN_TRY(unvalidatedConvert(operandPerformance.type)), - .info = NN_TRY(unvalidatedConvert(operandPerformance.info))}; + const auto type = NN_TRY(unvalidatedConvert(operandPerformance.type)); + const auto info = NN_TRY(unvalidatedConvert(operandPerformance.info)); + return OperandPerformance{.type = type, .info = info}; } nn::GeneralResult> unvalidatedConvert( @@ -788,7 +821,8 @@ nn::GeneralResult> unvalidatedConvert(const nn::CacheToken& } nn::GeneralResult unvalidatedConvert(const nn::BufferDesc& bufferDesc) { - return BufferDesc{.dimensions = NN_TRY(toSigned(bufferDesc.dimensions))}; + auto dimensions = NN_TRY(toSigned(bufferDesc.dimensions)); + return BufferDesc{.dimensions = std::move(dimensions)}; } nn::GeneralResult unvalidatedConvert(const nn::BufferRole& bufferRole) { @@ -847,7 +881,8 @@ nn::GeneralResult unvalidatedConvert(const nn::ErrorStatus& errorSt } nn::GeneralResult unvalidatedConvert(const nn::OutputShape& outputShape) { - return OutputShape{.dimensions = NN_TRY(toSigned(outputShape.dimensions)), + auto dimensions = NN_TRY(toSigned(outputShape.dimensions)); + return OutputShape{.dimensions = std::move(dimensions), .isSufficient = outputShape.isSufficient}; } @@ -915,14 +950,19 @@ nn::GeneralResult> unvalidatedConvert( } nn::GeneralResult unvalidatedConvert(const nn::Operand& operand) { + const auto type = NN_TRY(unvalidatedConvert(operand.type)); + auto dimensions = NN_TRY(toSigned(operand.dimensions)); + const auto lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)); + const auto location = NN_TRY(unvalidatedConvert(operand.location)); + auto extraParams = NN_TRY(unvalidatedConvert(operand.extraParams)); return Operand{ - .type = NN_TRY(unvalidatedConvert(operand.type)), - .dimensions = NN_TRY(toSigned(operand.dimensions)), + .type = type, + .dimensions = std::move(dimensions), .scale = operand.scale, .zeroPoint = operand.zeroPoint, - .lifetime = NN_TRY(unvalidatedConvert(operand.lifetime)), - .location = NN_TRY(unvalidatedConvert(operand.location)), - .extraParams = NN_TRY(unvalidatedConvert(operand.extraParams)), + .lifetime = lifetime, + .location = location, + .extraParams = std::move(extraParams), }; } @@ -934,19 +974,26 @@ nn::GeneralResult unvalidatedConvert(const nn::OperationType& ope } nn::GeneralResult unvalidatedConvert(const nn::Operation& operation) { + const auto type = NN_TRY(unvalidatedConvert(operation.type)); + auto inputs = NN_TRY(toSigned(operation.inputs)); + auto outputs = NN_TRY(toSigned(operation.outputs)); return Operation{ - .type = NN_TRY(unvalidatedConvert(operation.type)), - .inputs = NN_TRY(toSigned(operation.inputs)), - .outputs = NN_TRY(toSigned(operation.outputs)), + .type = type, + .inputs = std::move(inputs), + .outputs = std::move(outputs), }; } nn::GeneralResult unvalidatedConvert(const nn::Model::Subgraph& subgraph) { + auto operands = NN_TRY(unvalidatedConvert(subgraph.operands)); + auto operations = NN_TRY(unvalidatedConvert(subgraph.operations)); + auto inputIndexes = NN_TRY(toSigned(subgraph.inputIndexes)); + auto outputIndexes = NN_TRY(toSigned(subgraph.outputIndexes)); return Subgraph{ - .operands = NN_TRY(unvalidatedConvert(subgraph.operands)), - .operations = NN_TRY(unvalidatedConvert(subgraph.operations)), - .inputIndexes = NN_TRY(toSigned(subgraph.inputIndexes)), - .outputIndexes = NN_TRY(toSigned(subgraph.outputIndexes)), + .operands = std::move(operands), + .operations = std::move(operations), + .inputIndexes = std::move(inputIndexes), + .outputIndexes = std::move(outputIndexes), }; } @@ -969,13 +1016,18 @@ nn::GeneralResult unvalidatedConvert(const nn::Model& model) { << "Model cannot be unvalidatedConverted because it contains pointer-based memory"; } + auto main = NN_TRY(unvalidatedConvert(model.main)); + auto referenced = NN_TRY(unvalidatedConvert(model.referenced)); + auto operandValues = NN_TRY(unvalidatedConvert(model.operandValues)); + auto pools = NN_TRY(unvalidatedConvert(model.pools)); + auto extensionNameToPrefix = NN_TRY(unvalidatedConvert(model.extensionNameToPrefix)); return Model{ - .main = NN_TRY(unvalidatedConvert(model.main)), - .referenced = NN_TRY(unvalidatedConvert(model.referenced)), - .operandValues = NN_TRY(unvalidatedConvert(model.operandValues)), - .pools = NN_TRY(unvalidatedConvert(model.pools)), + .main = std::move(main), + .referenced = std::move(referenced), + .operandValues = std::move(operandValues), + .pools = std::move(pools), .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, - .extensionNameToPrefix = NN_TRY(unvalidatedConvert(model.extensionNameToPrefix)), + .extensionNameToPrefix = std::move(extensionNameToPrefix), }; } @@ -989,10 +1041,13 @@ nn::GeneralResult unvalidatedConvert(const nn::Request& request) { << "Request cannot be unvalidatedConverted because it contains pointer-based memory"; } + auto inputs = NN_TRY(unvalidatedConvert(request.inputs)); + auto outputs = NN_TRY(unvalidatedConvert(request.outputs)); + auto pools = NN_TRY(unvalidatedConvert(request.pools)); return Request{ - .inputs = NN_TRY(unvalidatedConvert(request.inputs)), - .outputs = NN_TRY(unvalidatedConvert(request.outputs)), - .pools = NN_TRY(unvalidatedConvert(request.pools)), + .inputs = std::move(inputs), + .outputs = std::move(outputs), + .pools = std::move(pools), }; } @@ -1003,10 +1058,12 @@ nn::GeneralResult unvalidatedConvert( << "Request cannot be unvalidatedConverted because it contains pointer-based memory"; } const bool hasNoValue = requestArgument.lifetime == nn::Request::Argument::LifeTime::NO_VALUE; + const auto location = NN_TRY(unvalidatedConvert(requestArgument.location)); + auto dimensions = NN_TRY(toSigned(requestArgument.dimensions)); return RequestArgument{ .hasNoValue = hasNoValue, - .location = NN_TRY(unvalidatedConvert(requestArgument.location)), - .dimensions = NN_TRY(toSigned(requestArgument.dimensions)), + .location = location, + .dimensions = std::move(dimensions), }; } @@ -1033,9 +1090,11 @@ nn::GeneralResult unvalidatedConvert(const nn::Request::Memor } nn::GeneralResult unvalidatedConvert(const nn::Timing& timing) { + const auto timeOnDeviceNs = NN_TRY(unvalidatedConvert(timing.timeOnDevice)); + const auto timeInDriverNs = NN_TRY(unvalidatedConvert(timing.timeInDriver)); return Timing{ - .timeOnDeviceNs = NN_TRY(unvalidatedConvert(timing.timeOnDevice)), - .timeInDriverNs = NN_TRY(unvalidatedConvert(timing.timeInDriver)), + .timeOnDeviceNs = timeOnDeviceNs, + .timeInDriverNs = timeInDriverNs, }; } @@ -1064,20 +1123,25 @@ nn::GeneralResult unvalidatedConvert(const nn::Shared } nn::GeneralResult unvalidatedConvert(const nn::Capabilities& capabilities) { + const auto relaxedFloat32toFloat16PerformanceTensor = + NN_TRY(unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceTensor)); + const auto relaxedFloat32toFloat16PerformanceScalar = + NN_TRY(unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceScalar)); + auto operandPerformance = NN_TRY(unvalidatedConvert(capabilities.operandPerformance)); + const auto ifPerformance = NN_TRY(unvalidatedConvert(capabilities.ifPerformance)); + const auto whilePerformance = NN_TRY(unvalidatedConvert(capabilities.whilePerformance)); return Capabilities{ - .relaxedFloat32toFloat16PerformanceTensor = NN_TRY( - unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceTensor)), - .relaxedFloat32toFloat16PerformanceScalar = NN_TRY( - unvalidatedConvert(capabilities.relaxedFloat32toFloat16PerformanceScalar)), - .operandPerformance = NN_TRY(unvalidatedConvert(capabilities.operandPerformance)), - .ifPerformance = NN_TRY(unvalidatedConvert(capabilities.ifPerformance)), - .whilePerformance = NN_TRY(unvalidatedConvert(capabilities.whilePerformance)), + .relaxedFloat32toFloat16PerformanceTensor = relaxedFloat32toFloat16PerformanceTensor, + .relaxedFloat32toFloat16PerformanceScalar = relaxedFloat32toFloat16PerformanceScalar, + .operandPerformance = std::move(operandPerformance), + .ifPerformance = ifPerformance, + .whilePerformance = whilePerformance, }; } nn::GeneralResult unvalidatedConvert(const nn::Extension& extension) { - return Extension{.name = extension.name, - .operandTypes = NN_TRY(unvalidatedConvert(extension.operandTypes))}; + auto operandTypes = NN_TRY(unvalidatedConvert(extension.operandTypes)); + return Extension{.name = extension.name, .operandTypes = std::move(operandTypes)}; } #ifdef NN_AIDL_V4_OR_ABOVE nn::GeneralResult unvalidatedConvert(const nn::TokenValuePair& tokenValuePair) { diff --git a/neuralnetworks/aidl/utils/src/Utils.cpp b/neuralnetworks/aidl/utils/src/Utils.cpp index 76a0b07d86..f9b4f6edbc 100644 --- a/neuralnetworks/aidl/utils/src/Utils.cpp +++ b/neuralnetworks/aidl/utils/src/Utils.cpp @@ -51,8 +51,9 @@ nn::GeneralResult clone(const ndk::ScopedFileDescript } nn::GeneralResult clone(const common::NativeHandle& handle) { + auto fds = NN_TRY(cloneVec(handle.fds)); return common::NativeHandle{ - .fds = NN_TRY(cloneVec(handle.fds)), + .fds = std::move(fds), .ints = handle.ints, }; } @@ -63,29 +64,32 @@ nn::GeneralResult clone(const Memory& memory) { switch (memory.getTag()) { case Memory::Tag::ashmem: { const auto& ashmem = memory.get(); + auto fd = NN_TRY(clone(ashmem.fd)); auto handle = common::Ashmem{ - .fd = NN_TRY(clone(ashmem.fd)), + .fd = std::move(fd), .size = ashmem.size, }; return Memory::make(std::move(handle)); } case Memory::Tag::mappableFile: { const auto& memFd = memory.get(); + auto fd = NN_TRY(clone(memFd.fd)); auto handle = common::MappableFile{ .length = memFd.length, .prot = memFd.prot, - .fd = NN_TRY(clone(memFd.fd)), + .fd = std::move(fd), .offset = memFd.offset, }; return Memory::make(std::move(handle)); } case Memory::Tag::hardwareBuffer: { const auto& hardwareBuffer = memory.get(); - auto handle = graphics::common::HardwareBuffer{ + auto handle = NN_TRY(clone(hardwareBuffer.handle)); + auto ahwbHandle = graphics::common::HardwareBuffer{ .description = hardwareBuffer.description, - .handle = NN_TRY(clone(hardwareBuffer.handle)), + .handle = std::move(handle), }; - return Memory::make(std::move(handle)); + return Memory::make(std::move(ahwbHandle)); } } return (NN_ERROR() << "Unrecognized Memory::Tag: " << underlyingType(memory.getTag())) @@ -109,19 +113,21 @@ nn::GeneralResult clone(const RequestMemoryPool& requestPool) } nn::GeneralResult clone(const Request& request) { + auto pools = NN_TRY(clone(request.pools)); return Request{ .inputs = request.inputs, .outputs = request.outputs, - .pools = NN_TRY(clone(request.pools)), + .pools = std::move(pools), }; } nn::GeneralResult clone(const Model& model) { + auto pools = NN_TRY(clone(model.pools)); return Model{ .main = model.main, .referenced = model.referenced, .operandValues = model.operandValues, - .pools = NN_TRY(clone(model.pools)), + .pools = std::move(pools), .relaxComputationFloat32toFloat16 = model.relaxComputationFloat32toFloat16, .extensionNameToPrefix = model.extensionNameToPrefix, }; -- GitLab From e644bb509e5f8f684bc031ff5819bf1dea866647 Mon Sep 17 00:00:00 2001 From: Guanwei Chen Date: Thu, 7 Apr 2022 14:34:36 +0800 Subject: [PATCH 772/825] fix first_api_level property fail in VF projects Should use "ro.board.first_api_level" for vendor freeze project Bug: 228778569 Test: run cts VtsHalMediaOmxV1_0TargetStoreTest pass Change-Id: Ib46206be6267a44aaa0a8235a4f017569bb4de94 (cherry picked from commit a8c914ae693e2f3bc1b86563a6a0e461b18319ff) Merged-In: Ib46206be6267a44aaa0a8235a4f017569bb4de94 --- .../functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp diff --git a/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp old mode 100644 new mode 100755 index 5fa13e7c5a..2ae9c2b001 --- a/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp +++ b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp @@ -375,6 +375,11 @@ TEST_P(StoreHidlTest, ListRoles) { } static int getFirstApiLevel() { + int boardApiLevel = android::base::GetIntProperty("ro.board.first_api_level", 0); + if (boardApiLevel != 0) { + return boardApiLevel; + } + return android::base::GetIntProperty("ro.product.first_api_level", __ANDROID_API_T__); } -- GitLab From 3f51f6e447de1747ecd40e47c35585723f4a5f11 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Thu, 28 Apr 2022 23:05:21 +0000 Subject: [PATCH 773/825] Revert "Disable current matrix." This reverts commit e7938a23bbf538037fd7d850905f77137909218f. Reason for revert: re-enable change aosp/master .. goog/master Change-Id: I9ca426ff3bc8f144e81fb7013102e8b0fa1fb63d --- compatibility_matrices/Android.bp | 1 - compatibility_matrices/Android.mk | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/compatibility_matrices/Android.bp b/compatibility_matrices/Android.bp index 422b37e68c..524242f6d3 100644 --- a/compatibility_matrices/Android.bp +++ b/compatibility_matrices/Android.bp @@ -87,7 +87,6 @@ vintf_compatibility_matrix { vintf_compatibility_matrix { name: "framework_compatibility_matrix.current.xml", - enabled: false, stem: "compatibility_matrix.current.xml", srcs: [ "compatibility_matrix.current.xml", diff --git a/compatibility_matrices/Android.mk b/compatibility_matrices/Android.mk index d6a44d0177..d19f0dae1f 100644 --- a/compatibility_matrices/Android.mk +++ b/compatibility_matrices/Android.mk @@ -103,6 +103,7 @@ my_system_matrix_deps := \ framework_compatibility_matrix.5.xml \ framework_compatibility_matrix.6.xml \ framework_compatibility_matrix.7.xml \ + framework_compatibility_matrix.current.xml \ framework_compatibility_matrix.device.xml \ my_framework_matrix_deps += \ -- GitLab From 7c0353f8e43fb700fd5874eba22c270641c14561 Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Thu, 21 Apr 2022 16:40:09 -0700 Subject: [PATCH 774/825] Handle case where NN AIDL callback is null in IDevice::prepareModel* Prior to this change, if IDevice::prepareModel* was passed a null callback, the code would still attempt to call "notify" on the callback to return the error to the client. This CL ensures the "notify" method will not be invoked if the callback is null. Bug: 230914930 Test: mma Test: presubmit Change-Id: I4a15d02c4879a0261ec26cc0e7a47d0a4da86b8b Merged-In: I4a15d02c4879a0261ec26cc0e7a47d0a4da86b8b (cherry picked from commit d6f6d01499d84d0186114262a5bd190aa09e99fa) --- .../utils/adapter/aidl/src/Device.cpp | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/neuralnetworks/utils/adapter/aidl/src/Device.cpp b/neuralnetworks/utils/adapter/aidl/src/Device.cpp index 1b90a1ab4b..453ec9b7a9 100644 --- a/neuralnetworks/utils/adapter/aidl/src/Device.cpp +++ b/neuralnetworks/utils/adapter/aidl/src/Device.cpp @@ -135,16 +135,26 @@ std::shared_ptr adaptPreparedModel(nn::SharedPreparedModel prepar return ndk::SharedRefBase::make(std::move(preparedModel)); } +void notify(IPreparedModelCallback* callback, ErrorStatus status, + const std::shared_ptr& preparedModel) { + if (callback != nullptr) { + const auto ret = callback->notify(status, preparedModel); + if (!ret.isOk()) { + LOG(ERROR) << "IPreparedModelCallback::notify failed with " << ret.getDescription(); + } + } +} + void notify(IPreparedModelCallback* callback, PrepareModelResult result) { if (!result.has_value()) { const auto& [message, status] = result.error(); LOG(ERROR) << message; const auto aidlCode = utils::convert(status).value_or(ErrorStatus::GENERAL_FAILURE); - callback->notify(aidlCode, nullptr); + notify(callback, aidlCode, nullptr); } else { auto preparedModel = std::move(result).value(); auto aidlPreparedModel = adaptPreparedModel(std::move(preparedModel)); - callback->notify(ErrorStatus::NONE, std::move(aidlPreparedModel)); + notify(callback, ErrorStatus::NONE, std::move(aidlPreparedModel)); } } @@ -284,7 +294,7 @@ ndk::ScopedAStatus Device::prepareModel(const Model& model, ExecutionPreference if (!result.has_value()) { const auto& [message, code] = result.error(); const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); - callback->notify(aidlCode, nullptr); + notify(callback.get(), aidlCode, nullptr); return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( static_cast(aidlCode), message.c_str()); } @@ -300,7 +310,7 @@ ndk::ScopedAStatus Device::prepareModelFromCache( if (!result.has_value()) { const auto& [message, code] = result.error(); const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); - callback->notify(aidlCode, nullptr); + notify(callback.get(), aidlCode, nullptr); return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( static_cast(aidlCode), message.c_str()); } @@ -317,7 +327,7 @@ ndk::ScopedAStatus Device::prepareModelWithConfig( if (!result.has_value()) { const auto& [message, code] = result.error(); const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE); - callback->notify(aidlCode, nullptr); + notify(callback.get(), aidlCode, nullptr); return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage( static_cast(aidlCode), message.c_str()); } -- GitLab From 0d814ce524770ef201c11ecb1ac57ec5328c13fa Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Sat, 23 Apr 2022 05:26:16 -0700 Subject: [PATCH 775/825] Update CameraStreamBuffering test case CameraStreamBuffering test case intentionally calls setMaxFramesInFight() with very large integer value to verify that API handles unreasonaly large value properly. A type of its parameter is changed from unsigned 32-bit integer to signed 32-bit integer in the latest EVS interface definition written in the stable AIDL. To adapt a test case, this CL updates it to use std::numeric_limits::max() instead of 0xFFFFFFFF, which is translated as -1 in signed 32-bit integer format. Bug: 226628778 Test: atest VtsHalEvsV1_1TargetTest atest VtsHalEvsTargetTest Change-Id: Ic35c6c962617825bc271cec8544770340db7728a --- automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp | 3 ++- automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp b/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp index 84323ead10..623438f70e 100644 --- a/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp +++ b/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp @@ -563,7 +563,8 @@ TEST_P(EvsHidlTest, CameraStreamBuffering) { activeCameras.push_back(pCam); // Ask for a very large number of buffers in flight to ensure it errors correctly - Return badResult = pCam->setMaxFramesInFlight(0xFFFFFFFF); + Return badResult = + pCam->setMaxFramesInFlight(std::numeric_limits::max()); EXPECT_EQ(EvsResult::BUFFER_NOT_AVAILABLE, badResult); // Now ask for exactly two buffers in flight as we'll test behavior in that case diff --git a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp index a442368c4e..09e1088ee4 100644 --- a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp +++ b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp @@ -526,7 +526,7 @@ TEST_P(EvsAidlTest, CameraStreamBuffering) { mActiveCameras.push_back(pCam); // Ask for a very large number of buffers in flight to ensure it errors correctly - auto badResult = pCam->setMaxFramesInFlight(0xFFFFFFFF); + auto badResult = pCam->setMaxFramesInFlight(std::numeric_limits::max()); EXPECT_TRUE(!badResult.isOk() && badResult.getServiceSpecificError() == static_cast(EvsResult::INVALID_ARG)); -- GitLab From 5c036af317ebdc1c46014440f3c29cb765861513 Mon Sep 17 00:00:00 2001 From: Shuzhen Wang Date: Tue, 3 May 2022 12:40:58 -0700 Subject: [PATCH 776/825] Camera: Fix broken link in doc Test: Build Bug: 231252657 Change-Id: I4118369e0f387128dcbba746cb2be18627da7f36 --- .../android/hardware/camera/metadata/CameraMetadataTag.aidl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl index 692421ae8d..48b1ee4957 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl @@ -543,7 +543,7 @@ enum CameraMetadataTag { * android.flash.info.strengthDefaultLevel [static, int32, public] * *

Default flashlight brightness level to be set via - * {android.hardware.camera2.CameraManager#turnOnTorchWithStrengthLevel}.

+ * CameraManager#turnOnTorchWithStrengthLevel.

*/ ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL, /** -- GitLab From bdf65ba94f9f733a5d22c6459b52693a9af3f7a8 Mon Sep 17 00:00:00 2001 From: Patty Huang Date: Tue, 26 Apr 2022 20:33:39 +0800 Subject: [PATCH 777/825] Support 24k and 32k config for LE Audio Offload Bug: 230402180 Test: Manual Change-Id: If4931999009b27423adeab3af50238dd6d8c8637 (cherry picked from commit f4e3551eb14038563665f7bc274be5fb588b1fe8) Merged-In: If4931999009b27423adeab3af50238dd6d8c8637 --- .../utils/aidl_session/BluetoothAudioCodecs.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp index fc54c70158..f3ca279867 100644 --- a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp +++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp @@ -114,6 +114,20 @@ static const Lc3Capabilities kLc3Capability_16_2 = { .frameDurationUs = {10000}, .octetsPerFrame = {40}}; +// Default Supported Codecs +// LC3 24_2: sample rate: 24 kHz, frame duration: 10 ms, octets per frame: 60 +static const Lc3Capabilities kLc3Capability_24_2 = { + .samplingFrequencyHz = {24000}, + .frameDurationUs = {10000}, + .octetsPerFrame = {60}}; + +// Default Supported Codecs +// LC3 32_2: sample rate: 32 kHz, frame duration: 10 ms, octets per frame: 80 +static const Lc3Capabilities kLc3Capability_32_2 = { + .samplingFrequencyHz = {32000}, + .frameDurationUs = {10000}, + .octetsPerFrame = {80}}; + // Default Supported Codecs // LC3 48_4: sample rate: 48 kHz, frame duration: 10 ms, octets per frame: 120 static const Lc3Capabilities kLc3Capability_48_4 = { @@ -122,7 +136,8 @@ static const Lc3Capabilities kLc3Capability_48_4 = { .octetsPerFrame = {120}}; static const std::vector supportedLc3CapabilityList = { - kLc3Capability_48_4, kLc3Capability_16_2, kLc3Capability_16_1}; + kLc3Capability_48_4, kLc3Capability_32_2, kLc3Capability_24_2, + kLc3Capability_16_2, kLc3Capability_16_1}; static AudioLocation stereoAudio = static_cast( static_cast(AudioLocation::FRONT_LEFT) | -- GitLab From bebd9520dbd6032fbe21b195221c895a080617cd Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Wed, 4 May 2022 09:57:06 +0000 Subject: [PATCH 778/825] Merge "Run SecureElementProvision tests for KeyMint version >= 2." am: d347852bcc Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2051222 Bug: 230803681 Change-Id: I42b63bdea5fa0fb6c3a79e457f8bd63c6b346111 Signed-off-by: Automerger Merge Worker (cherry picked from commit 009d595c0f84d060120b9012d8fa6a9921664b14) --- .../SecureElementProvisioningTest.cpp | 95 +++++++++++++------ 1 file changed, 64 insertions(+), 31 deletions(-) diff --git a/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp b/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp index 6f138672ba..e630f7008e 100644 --- a/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp +++ b/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp @@ -57,6 +57,15 @@ class SecureElementProvisioningTest : public testing::Test { } } + int32_t AidlVersion(shared_ptr keymint) { + int32_t version = 0; + auto status = keymint->getInterfaceVersion(&version); + if (!status.isOk()) { + ADD_FAILURE() << "Failed to determine interface version"; + } + return version; + } + static map> keymints_; }; @@ -73,12 +82,14 @@ TEST_F(SecureElementProvisioningTest, ValidConfigurations) { } TEST_F(SecureElementProvisioningTest, TeeOnly) { - if (keymints_.empty()) { - GTEST_SKIP() << "Test not applicable to device with no KeyMint devices"; + if (keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT) == 0) { + GTEST_SKIP() << "Test not applicable to device with no TEE KeyMint device"; } - ASSERT_EQ(keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT), 1); auto tee = keymints_.find(SecurityLevel::TRUSTED_ENVIRONMENT)->second; - ASSERT_NE(tee, nullptr); + // Execute the test only for KeyMint version >= 2. + if (AidlVersion(tee) < 2) { + GTEST_SKIP() << "Test not applicable to TEE KeyMint device before v2"; + } array challenge1 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; array challenge2 = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -111,12 +122,14 @@ TEST_F(SecureElementProvisioningTest, TeeOnly) { } TEST_F(SecureElementProvisioningTest, TeeDoesNotImplementStrongBoxMethods) { - if (keymints_.empty()) { - GTEST_SKIP() << "Test not applicable to device with no KeyMint devices"; + if (keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT) == 0) { + GTEST_SKIP() << "Test not applicable to device with no TEE KeyMint device"; } - ASSERT_EQ(keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT), 1); auto tee = keymints_.find(SecurityLevel::TRUSTED_ENVIRONMENT)->second; - ASSERT_NE(tee, nullptr); + // Execute the test only for KeyMint version >= 2. + if (AidlVersion(tee) < 2) { + GTEST_SKIP() << "Test not applicable to TEE KeyMint device before v2"; + } array challenge; Status result = tee->getRootOfTrustChallenge(&challenge); @@ -135,9 +148,11 @@ TEST_F(SecureElementProvisioningTest, StrongBoxDoesNotImplementTeeMethods) { // Need a StrongBox to provision. GTEST_SKIP() << "Test not applicable to device with no StrongBox KeyMint device"; } - + // Execute the test only for KeyMint version >= 2. auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second; - ASSERT_NE(sb, nullptr); + if (AidlVersion(sb) < 2) { + GTEST_SKIP() << "Test not applicable to StrongBox KeyMint device before v2"; + } vector rootOfTrust; Status result = sb->getRootOfTrust({}, &rootOfTrust); @@ -151,14 +166,19 @@ TEST_F(SecureElementProvisioningTest, UnimplementedTest) { // Need a StrongBox to provision. GTEST_SKIP() << "Test not applicable to device with no StrongBox KeyMint device"; } + // Execute the test only for KeyMint version >= 2. + auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second; + if (AidlVersion(sb) < 2) { + GTEST_SKIP() << "Test not applicable to StrongBox KeyMint device before v2"; + } - ASSERT_EQ(keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT), 1); + if (keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT) == 0) { + GTEST_SKIP() << "Test not applicable to device with no TEE KeyMint device"; + } auto tee = keymints_.find(SecurityLevel::TRUSTED_ENVIRONMENT)->second; - ASSERT_NE(tee, nullptr); - - ASSERT_EQ(keymints_.count(SecurityLevel::STRONGBOX), 1); - auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second; - ASSERT_NE(sb, nullptr); + if (AidlVersion(tee) < 2) { + GTEST_SKIP() << "Test not applicable to TEE KeyMint device before v2"; + } array challenge; Status result = sb->getRootOfTrustChallenge(&challenge); @@ -185,10 +205,11 @@ TEST_F(SecureElementProvisioningTest, ChallengeQualityTest) { // Need a StrongBox to provision. GTEST_SKIP() << "Test not applicable to device with no StrongBox KeyMint device"; } - - ASSERT_EQ(keymints_.count(SecurityLevel::STRONGBOX), 1); + // Execute the test only for KeyMint version >= 2. auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second; - ASSERT_NE(sb, nullptr); + if (AidlVersion(sb) < 2) { + GTEST_SKIP() << "Test not applicable to StrongBox KeyMint device before v2"; + } array challenge1; Status result = sb->getRootOfTrustChallenge(&challenge1); @@ -208,14 +229,20 @@ TEST_F(SecureElementProvisioningTest, ProvisioningTest) { // Need a StrongBox to provision. GTEST_SKIP() << "Test not applicable to device with no StrongBox KeyMint device"; } + // Execute the test only for KeyMint version >= 2. + auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second; + if (AidlVersion(sb) < 2) { + GTEST_SKIP() << "Test not applicable to StrongBox KeyMint device before v2"; + } - ASSERT_EQ(keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT), 1); + if (keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT) == 0) { + GTEST_SKIP() << "Test not applicable to device with no TEE KeyMint device"; + } + // Execute the test only for KeyMint version >= 2. auto tee = keymints_.find(SecurityLevel::TRUSTED_ENVIRONMENT)->second; - ASSERT_NE(tee, nullptr); - - ASSERT_EQ(keymints_.count(SecurityLevel::STRONGBOX), 1); - auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second; - ASSERT_NE(sb, nullptr); + if (AidlVersion(tee) < 2) { + GTEST_SKIP() << "Test not applicable to TEE KeyMint device before v2"; + } array challenge; Status result = sb->getRootOfTrustChallenge(&challenge); @@ -240,14 +267,20 @@ TEST_F(SecureElementProvisioningTest, InvalidProvisioningTest) { // Need a StrongBox to provision. GTEST_SKIP() << "Test not applicable to device with no StrongBox KeyMint device"; } + // Execute the test only for KeyMint version >= 2. + auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second; + if (AidlVersion(sb) < 2) { + GTEST_SKIP() << "Test not applicable to StrongBox KeyMint device before v2"; + } - ASSERT_EQ(keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT), 1); + if (keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT) == 0) { + GTEST_SKIP() << "Test not applicable to device with no TEE KeyMint device"; + } + // Execute the test only for KeyMint version >= 2. auto tee = keymints_.find(SecurityLevel::TRUSTED_ENVIRONMENT)->second; - ASSERT_NE(tee, nullptr); - - ASSERT_EQ(keymints_.count(SecurityLevel::STRONGBOX), 1); - auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second; - ASSERT_NE(sb, nullptr); + if (AidlVersion(tee) < 2) { + GTEST_SKIP() << "Test not applicable to TEE KeyMint device before v2"; + } array challenge; Status result = sb->getRootOfTrustChallenge(&challenge); -- GitLab From 502f9d017a581bb296e26e5983a9351f6aba4ee8 Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Tue, 26 Apr 2022 18:37:36 -0700 Subject: [PATCH 779/825] Effect: benchmark the effect process Required for Spatializer tuning. Test: adb shell dumpsys media.audio_flinger Bug: 228862341 Change-Id: I59f3b35c9cdd1e45e9afc79cbf9aac30a5decd67 --- audio/effect/all-versions/default/Android.bp | 2 + audio/effect/all-versions/default/Effect.cpp | 42 ++++++++++++-------- audio/effect/all-versions/default/Effect.h | 7 +++- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/audio/effect/all-versions/default/Android.bp b/audio/effect/all-versions/default/Android.bp index 1e01ffb377..a3c3ed6882 100644 --- a/audio/effect/all-versions/default/Android.bp +++ b/audio/effect/all-versions/default/Android.bp @@ -30,6 +30,7 @@ cc_defaults { ], shared_libs: [ + "libaudioutils", "libbase", "libcutils", "libeffects", @@ -48,6 +49,7 @@ cc_defaults { "libeffects_headers", "libhardware_headers", "libmedia_headers", + "libmediautils_headers", ], } diff --git a/audio/effect/all-versions/default/Effect.cpp b/audio/effect/all-versions/default/Effect.cpp index 49f6bf2ece..3baafc9343 100644 --- a/audio/effect/all-versions/default/Effect.cpp +++ b/audio/effect/all-versions/default/Effect.cpp @@ -22,13 +22,11 @@ #include "Effect.h" #include "common/all-versions/default/EffectMap.h" -#include - #define ATRACE_TAG ATRACE_TAG_AUDIO - #include #include #include +#include #include #include @@ -49,21 +47,27 @@ using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementati namespace { +#define SCOPED_STATS() \ + ::android::mediautils::ScopedStatistics scopedStatistics { \ + std::string("EffectHal::").append(__func__), mEffectHal->mStatistics \ + } + class ProcessThread : public Thread { public: // ProcessThread's lifespan never exceeds Effect's lifespan. - ProcessThread(std::atomic* stop, effect_handle_t effect, - std::atomic* inBuffer, std::atomic* outBuffer, - Effect::StatusMQ* statusMQ, EventFlag* efGroup) - : Thread(false /*canCallJava*/), - mStop(stop), - mEffect(effect), - mHasProcessReverse((*mEffect)->process_reverse != NULL), - mInBuffer(inBuffer), - mOutBuffer(outBuffer), - mStatusMQ(statusMQ), - mEfGroup(efGroup) {} - virtual ~ProcessThread() {} + ProcessThread(std::atomic* stop, effect_handle_t effect, + std::atomic* inBuffer, std::atomic* outBuffer, + Effect::StatusMQ* statusMQ, EventFlag* efGroup, Effect* effectHal) + : Thread(false /*canCallJava*/), + mStop(stop), + mEffect(effect), + mHasProcessReverse((*mEffect)->process_reverse != NULL), + mInBuffer(inBuffer), + mOutBuffer(outBuffer), + mStatusMQ(statusMQ), + mEfGroup(efGroup), + mEffectHal(effectHal) {} + virtual ~ProcessThread() {} private: std::atomic* mStop; @@ -73,6 +77,7 @@ class ProcessThread : public Thread { std::atomic* mOutBuffer; Effect::StatusMQ* mStatusMQ; EventFlag* mEfGroup; + Effect* const mEffectHal; bool threadLoop() override; }; @@ -102,6 +107,9 @@ bool ProcessThread::threadLoop() { audio_buffer_t* outBuffer = std::atomic_load_explicit(mOutBuffer, std::memory_order_relaxed); if (inBuffer != nullptr && outBuffer != nullptr) { + // Time this effect process + SCOPED_STATS(); + if (efState & static_cast(MessageQueueFlagBits::REQUEST_PROCESS)) { processResult = (*mEffect)->process(mEffect, inBuffer, outBuffer); } else { @@ -359,7 +367,7 @@ Return Effect::prepareForProcessing(prepareForProcessing_cb _hidl_cb) { // Create and launch the thread. mProcessThread = new ProcessThread(&mStopProcessThread, mHandle, &mHalInBufferPtr, - &mHalOutBufferPtr, tempStatusMQ.get(), mEfGroup); + &mHalOutBufferPtr, tempStatusMQ.get(), mEfGroup, this); status = mProcessThread->run("effect", PRIORITY_URGENT_AUDIO); if (status != OK) { ALOGW("failed to start effect processing thread: %s", strerror(-status)); @@ -749,6 +757,8 @@ Return Effect::debug(const hidl_handle& fd, const hidl_vec& / if (fd.getNativeHandle() != nullptr && fd->numFds == 1) { uint32_t cmdData = fd->data[0]; (void)sendCommand(EFFECT_CMD_DUMP, "DUMP", sizeof(cmdData), &cmdData); + const std::string s = mStatistics->dump(); + if (s.size() != 0) write(cmdData, s.c_str(), s.size()); } return Void(); } diff --git a/audio/effect/all-versions/default/Effect.h b/audio/effect/all-versions/default/Effect.h index f9a6796e8f..011544d760 100644 --- a/audio/effect/all-versions/default/Effect.h +++ b/audio/effect/all-versions/default/Effect.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -169,7 +170,11 @@ struct Effect : public IEffect { Result setParameterImpl(uint32_t paramSize, const void* paramData, uint32_t valueSize, const void* valueData); - private: + // process execution statistics + const std::shared_ptr> mStatistics = + std::make_shared>(); + + private: friend struct VirtualizerEffect; // for getParameterImpl friend struct VisualizerEffect; // to allow executing commands -- GitLab From b8f9efc5e796ca8fc427d61adb76250ce2966e43 Mon Sep 17 00:00:00 2001 From: Seth Moore Date: Mon, 25 Apr 2022 17:03:09 -0700 Subject: [PATCH 780/825] Clean up keymint ProtectedData documentation - Fix up some minor CDDL formatting issues. - Add more definition around the BCC, hopefully clearing up partner confusion around how to implement it. - Explain when BccPayload entries may be omitted in the case of a "Degenerate BCC" - Add a bit more description to the DKSignature format Bug: 227350250 Test: N/A -- doc changes only Change-Id: I28337a80e2b49661cc37876400d7ac3b8759ba01 Merged-In: I28337a80e2b49661cc37876400d7ac3b8759ba01 --- .../security/keymint/ProtectedData.aidl | 149 +++++++++++------- 1 file changed, 95 insertions(+), 54 deletions(-) diff --git a/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl b/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl index cfbf171393..8b3875b551 100644 --- a/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl +++ b/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl @@ -18,13 +18,20 @@ package android.hardware.security.keymint; /** * ProtectedData contains the encrypted BCC and the ephemeral MAC key used to - * authenticate the keysToSign (see keysToSignMac output argument). + * authenticate the keysToSign (see keysToSignMac output argument of + * IRemotelyProvisionedComponent.generateCertificateRequest). * @hide */ @VintfStability parcelable ProtectedData { /** - * ProtectedData is a COSE_Encrypt structure, specified by the following CDDL + * ProtectedData is a COSE_Encrypt structure, encrypted with an AES key that is agreed upon + * using Elliptic-curve Diffie-Hellman. The contents of the structure are specified by the + * following CDDL [RFC8610]. + * + * Notes: + * - None of the CBOR in ProtectedData uses CBOR tags. If an implementation includes + * tags, parsers may reject the data. * * ProtectedData = [ // COSE_Encrypt * protected: bstr .cbor { @@ -34,13 +41,18 @@ parcelable ProtectedData { * 5 : bstr .size 12 // IV * }, * ciphertext: bstr, // AES-GCM-256(K, .cbor ProtectedDataPayload) + * // Where the encryption key 'K' is derived as follows: + * // ikm = ECDH(EEK_pub, Ephemeral_priv) + * // salt = null + * // info = .cbor Context (see below) + * // K = HKDF-SHA-256(ikm, salt, info) * recipients : [ * [ // COSE_Recipient * protected : bstr .cbor { * 1 : -25 // Algorithm : ECDH-ES + HKDF-256 * }, * unprotected : { - * -1 : PubKeyX25519 / PubKeyEcdhP256 // Of the sender + * -1 : PubKeyX25519 / PubKeyEcdhP256 // Ephemeral_pub * 4 : bstr, // KID : EEK ID * }, * ciphertext : nil @@ -48,14 +60,14 @@ parcelable ProtectedData { * ] * ] * - * K = HKDF-256(ECDH(EEK_pub, Ephemeral_priv), Context) - * - * Context = [ // COSE_KDF_Context + * // The COSE_KDF_Context that is used to derive the ProtectedData encryption key with + * // HKDF. See details on use in ProtectedData comments above. + * Context = [ * AlgorithmID : 3 // AES-GCM 256 * PartyUInfo : [ * identity : bstr "client" * nonce : bstr .size 0, - * other : bstr // Ephemeral pubkey + * other : bstr // Ephemeral_pub * ], * PartyVInfo : [ * identity : bstr "server", @@ -68,41 +80,53 @@ parcelable ProtectedData { * ] * ] * + * // The data that is encrypted and included in ProtectedData ciphertext (see above). * ProtectedDataPayload [ * SignedMac, * Bcc, * ? AdditionalDKSignatures, * ] + * + * // AdditionalDKSignatures allows the platform to provide additional certifications + * // for the DK_pub. For example, this could be provided by the hardware vendor, who + * // certifies all of their devices. The SignerName is a free-form string describing + * // who generated the signature. * AdditionalDKSignatures = { * + SignerName => DKCertChain * } * + * // SignerName is a string identifier that indicates both the signing authority as + * // well as the format of the DKCertChain * SignerName = tstr * * DKCertChain = [ - * 2* Certificate // Root -> Leaf. Root is the vendor - * // self-signed cert, leaf contains DK_pub + * 2* X509Certificate // Root -> ... -> Leaf. "Root" is the vendor self-signed + * // cert, "Leaf" contains DK_pub. There may also be + * // intermediate certificates between Root and Leaf. * ] * - * Certificate = COSE_Sign1 of a public key + * // A bstr containing a DER-encoded X.509 certificate (RSA, NIST P-curve, or edDSA) + * X509Certificate = bstr * - * SignedMac = [ // COSE_Sign1 - * bstr .cbor { // Protected params - * 1 : AlgorithmEdDSA / AlgorithmES256, // Algorithm + * // The SignedMac, which authenticates the MAC key that is used to authenticate the + * // keysToSign. + * SignedMac = [ // COSE_Sign1 + * bstr .cbor { // Protected params + * 1 : AlgorithmEdDSA / AlgorithmES256, // Algorithm * }, - * {}, // Unprotected params - * bstr .size 32, // MAC key + * {}, // Unprotected params + * bstr .size 32, // Payload: MAC key * bstr // PureEd25519(KM_priv, bstr .cbor SignedMac_structure) / * // ECDSA(KM_priv, bstr .cbor SignedMac_structure) * ] * - * SignedMac_structure = [ + * SignedMac_structure = [ // COSE Sig_structure * "Signature1", - * bstr .cbor { // Protected params - * 1 : AlgorithmEdDSA / AlgorithmES256, // Algorithm + * bstr .cbor { // Protected params + * 1 : AlgorithmEdDSA / AlgorithmES256, // Algorithm * }, - * bstr .cbor SignedMacAad - * bstr .size 32 // MAC key + * bstr .cbor SignedMacAad, + * bstr .size 32 // MAC key * ] * * SignedMacAad = [ @@ -114,31 +138,48 @@ parcelable ProtectedData { * // the signature. * ] * + * VerifiedDeviceInfo = DeviceInfo // See DeviceInfo.aidl + * + * // The BCC is the boot certificate chain, containing measurements about the device + * // boot chain. The BCC generally follows the Open Profile for DICE specification at + * // https://pigweed.googlesource.com/open-dice/+/HEAD/docs/specification.md. + * // + * // The first entry in the Bcc is the DK_pub, encoded as a COSE_key. All entries after + * // the first describe a link in the boot chain (e.g. bootloaders: BL1, BL2, ... BLN). + * // Note that there is no BccEntry for DK_pub, only a "bare" COSE_key. * Bcc = [ * PubKeyEd25519 / PubKeyECDSA256, // DK_pub * + BccEntry, // Root -> leaf (KM_pub) * ] * - * BccPayload = { // CWT - * 1 : tstr, // Issuer - * 2 : tstr, // Subject - * // See the Open Profile for DICE for details on these fields. - * ? -4670545 : bstr, // Code Hash - * ? -4670546 : bstr, // Code Descriptor - * ? -4670547 : bstr, // Configuration Hash - * ? -4670548 : bstr .cbor { // Configuration Descriptor - * ? -70002 : tstr, // Component name - * ? -70003 : int, // Firmware version - * ? -70004 : null, // Resettable - * }, - * ? -4670549 : bstr, // Authority Hash - * ? -4670550 : bstr, // Authority Descriptor - * ? -4670551 : bstr, // Mode + * // This is the signed payload for each entry in the Bcc. Note that the "Configuration + * // Input Values" described by the Open Profile are not used here. Instead, the Bcc + * // defines its own configuration values for the Configuration Descriptor field. See + * // the Open Profile for DICE for more details on the fields. All hashes are SHA256. + * BccPayload = { // CWT [RFC8392] + * 1 : tstr, // Issuer + * 2 : tstr, // Subject * -4670552 : bstr .cbor PubKeyEd25519 / - * bstr .cbor PubKeyECDSA256 // Subject Public Key - * -4670553 : bstr // Key Usage + * bstr .cbor PubKeyECDSA256, // Subject Public Key + * -4670553 : bstr // Key Usage + * + * // NOTE: All of the following fields may be omitted for a "Degenerate BCC", as + * // described by IRemotelyProvisionedComponent.aidl. + * -4670545 : bstr, // Code Hash + * ? -4670546 : bstr, // Code Descriptor + * ? -4670547 : bstr, // Configuration Hash + * -4670548 : bstr .cbor { // Configuration Descriptor + * ? -70002 : tstr, // Component name + * ? -70003 : int, // Firmware version + * ? -70004 : null, // Resettable + * }, + * -4670549 : bstr, // Authority Hash + * ? -4670550 : bstr, // Authority Descriptor + * -4670551 : bstr, // Mode * } * + * // Each entry in the Bcc is a BccPayload signed by the key from the previous entry + * // in the Bcc array. * BccEntry = [ // COSE_Sign1 (untagged) * protected : bstr .cbor { * 1 : AlgorithmEdDSA / AlgorithmES256, // Algorithm @@ -159,8 +200,8 @@ parcelable ProtectedData { * payload: bstr .cbor BccPayload * ] * - * VerifiedDeviceInfo = DeviceInfo // See DeviceInfo.aidl - * + * // The following section defines some types that are reused throughout the above + * // data structures. * PubKeyX25519 = { // COSE_Key * 1 : 1, // Key type : Octet Key Pair * -1 : 4, // Curve : X25519 @@ -168,25 +209,25 @@ parcelable ProtectedData { * } * * PubKeyEd25519 = { // COSE_Key - * 1 : 1, // Key type : octet key pair - * 3 : AlgorithmEdDSA, // Algorithm : EdDSA - * -1 : 6, // Curve : Ed25519 - * -2 : bstr // X coordinate, little-endian + * 1 : 1, // Key type : octet key pair + * 3 : AlgorithmEdDSA, // Algorithm : EdDSA + * -1 : 6, // Curve : Ed25519 + * -2 : bstr // X coordinate, little-endian * } * - * PubKeyEcdhP256 = { // COSE_Key - * 1 : 2, // Key type : EC2 - * -1 : 1, // Curve : P256 - * -2 : bstr // Sender X coordinate - * -3 : bstr // Sender Y coordinate + * PubKeyEcdhP256 = { // COSE_Key + * 1 : 2, // Key type : EC2 + * -1 : 1, // Curve : P256 + * -2 : bstr // Sender X coordinate + * -3 : bstr // Sender Y coordinate * } * - * PubKeyECDSA256 = { // COSE_Key - * 1 : 2, // Key type : EC2 - * 3 : AlgorithmES256, // Algorithm : ECDSA w/ SHA-256 - * -1 : 1, // Curve: P256 - * -2 : bstr, // X coordinate - * -3 : bstr // Y coordinate + * PubKeyECDSA256 = { // COSE_Key + * 1 : 2, // Key type : EC2 + * 3 : AlgorithmES256, // Algorithm : ECDSA w/ SHA-256 + * -1 : 1, // Curve: P256 + * -2 : bstr, // X coordinate + * -3 : bstr // Y coordinate * } * * AlgorithmES256 = -7 -- GitLab From 32a7bece10eb1f47cb4473a86df12cabd7910d46 Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Tue, 3 May 2022 18:48:57 +0100 Subject: [PATCH 781/825] KeyMint VTS: skip device ID checks on GSI Bug: 229356841 Test: VtsAidlKeyMintTargetTest Change-Id: I3182bad5584c35df7b1eeb476dabb39d19fdf12c (cherry picked from commit 555ba00c0f2adb6bed6f507a78e43885e9f46048) Merged-In: I3182bad5584c35df7b1eeb476dabb39d19fdf12c --- security/keymint/aidl/vts/functional/AttestKeyTest.cpp | 5 +++++ .../keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp | 6 ++++++ security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h | 3 +++ security/keymint/aidl/vts/functional/KeyMintTest.cpp | 5 +++++ 4 files changed, 19 insertions(+) diff --git a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp index 5cdea93a19..240de351d6 100644 --- a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp +++ b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp @@ -743,6 +743,11 @@ TEST_P(AttestKeyTest, AttestWithNonAttestKey) { } TEST_P(AttestKeyTest, EcdsaAttestationID) { + if (is_gsi_image()) { + // GSI sets up a standard set of device identifiers that may not match + // the device identifiers held by the device. + GTEST_SKIP() << "Test not applicable under GSI"; + } // Create attestation key. AttestationKey attest_key; vector attest_key_characteristics; diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp index 943c692c3e..be219940f8 100644 --- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp +++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp @@ -17,6 +17,7 @@ #include "KeyMintAidlTestBase.h" #include +#include #include #include @@ -1460,6 +1461,11 @@ void verify_subject(const X509* cert, // OPENSSL_free(cert_issuer); } +bool is_gsi_image() { + std::ifstream ifs("/system/system_ext/etc/init/init.gsi.rc"); + return ifs.good(); +} + vector build_serial_blob(const uint64_t serial_int) { BIGNUM_Ptr serial(BN_new()); EXPECT_TRUE(BN_set_u64(serial.get(), serial_int)); diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h index 7279c95692..2634ab7868 100644 --- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h +++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h @@ -354,6 +354,9 @@ void add_tag_from_prop(AuthorizationSetBuilder* tags, TypedTag build_serial_blob(const uint64_t serial_int); void verify_subject(const X509* cert, const string& subject, bool self_signed); void verify_serial(X509* cert, const uint64_t expected_serial); diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp index cbe4512ab3..7950850f91 100644 --- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp +++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp @@ -1949,6 +1949,11 @@ TEST_P(NewKeyGenerationTest, EcdsaAttestationTags) { * attestation extension. */ TEST_P(NewKeyGenerationTest, EcdsaAttestationIdTags) { + if (is_gsi_image()) { + // GSI sets up a standard set of device identifiers that may not match + // the device identifiers held by the device. + GTEST_SKIP() << "Test not applicable under GSI"; + } auto challenge = "hello"; auto app_id = "foo"; auto subject = "cert subj 2"; -- GitLab From abc4ffe565f277a3350f8bfe045ec439f00558de Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Wed, 4 May 2022 22:13:12 +0000 Subject: [PATCH 782/825] audio VTS: Fix handling of ULTRASOUND sources When opening a stream on an ultrasound input (AUDIO_INPUT_FLAG_ULTRASOUND), the source type AUDIO_SOURCE_ULTRASOUND must be used. Bug: 231275185 Test: atest VtsHalAudioV7_0TargetTest Test: atest VtsHalAudioV7_1TargetTest Change-Id: Ib1fb5b8218eb0c52edf31789fa937c0a8b6c5082 Merged-In: Ib1fb5b8218eb0c52edf31789fa937c0a8b6c5082 (cherry picked from commit 1ce9d5488ab1ebb885d49f9b15eecedf67be5e09) --- .../vts/functional/7.0/AudioPrimaryHidlHalTest.cpp | 2 +- .../vts/functional/AudioPrimaryHidlHalTest.h | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp index f25c391ba9..dfc238623c 100644 --- a/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp +++ b/audio/core/all-versions/vts/functional/7.0/AudioPrimaryHidlHalTest.cpp @@ -715,7 +715,7 @@ class PcmOnlyConfigInputStreamTest : public InputStreamTest { sink.base.channelMask.value(getConfig().base.channelMask); sink.ext.mix({}); sink.ext.mix().ioHandle = helper.getIoHandle(); - sink.ext.mix().useCase.source(toString(xsd::AudioSource::AUDIO_SOURCE_MIC)); + sink.ext.mix().useCase.source(initMetadata.tracks[0].source); EXPECT_OK(getDevice()->createAudioPatch(hidl_vec{source}, hidl_vec{sink}, returnIn(res, mPatchHandle))); diff --git a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h index 38d6eff7d0..38e9e5f467 100644 --- a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h +++ b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h @@ -1239,23 +1239,30 @@ class InputStreamTest : public OpenStreamTest<::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn> { void SetUp() override { ASSERT_NO_FATAL_FAILURE(OpenStreamTest::SetUp()); // setup base + auto flags = getInputFlags(); #if MAJOR_VERSION <= 6 address.device = AudioDevice::IN_DEFAULT; #elif MAJOR_VERSION >= 7 auto maybeSourceAddress = getCachedPolicyConfig().getSourceDeviceForMixPort( getDeviceName(), getMixPortName()); + auto& metadata = initMetadata.tracks[0]; if (maybeSourceAddress.has_value() && !xsd::isTelephonyDevice(maybeSourceAddress.value().deviceType)) { address = maybeSourceAddress.value(); - auto& metadata = initMetadata.tracks[0]; metadata.source = toString(xsd::AudioSource::AUDIO_SOURCE_UNPROCESSED); metadata.channelMask = getConfig().base.channelMask; } else { address.deviceType = toString(xsd::AudioDevice::AUDIO_DEVICE_IN_DEFAULT); } -#endif +#if MAJOR_VERSION == 7 && MINOR_VERSION >= 1 + auto flagsIt = std::find(flags.begin(), flags.end(), + toString(xsd::AudioInOutFlag::AUDIO_INPUT_FLAG_ULTRASOUND)); + if (flagsIt != flags.end()) { + metadata.source = toString(xsd::AudioSource::AUDIO_SOURCE_ULTRASOUND); + } +#endif // 7.1 +#endif // MAJOR_VERSION >= 7 const AudioConfig& config = getConfig(); - auto flags = getInputFlags(); testOpen( [&](AudioIoHandle handle, AudioConfig config, auto cb) { return getDevice()->openInputStream(handle, address, config, flags, -- GitLab From b47e11e847a3f95c1cf68d30acdf7da27ef98438 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 6 May 2022 01:27:53 +0000 Subject: [PATCH 783/825] Fix a bug that would access uninitialized data. Fix a bug where mThread is initialized before mRequests, causing the new thread to access uninitialized mRequests. Test: None. This is a race condition depending on when the thread is started and hard to reproduce. Bug: 231647009 Change-Id: I68037125bf4d14846585bd3a038844e4a7ced377 (cherry picked from commit 5e26ad3bf7c5923775fead0fd1018032fa9ed832) --- .../fake_impl/hardware/src/FakeVehicleHardware.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 7b3de586c8..b64c1a65cc 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -995,11 +995,15 @@ Result> FakeVehicleHardware::parseHexString(const std::stri template FakeVehicleHardware::PendingRequestHandler::PendingRequestHandler( FakeVehicleHardware* hardware) - : mHardware(hardware), mThread([this] { - while (mRequests.waitForItems()) { - handleRequestsOnce(); - } - }) {} + : mHardware(hardware) { + // Don't initialize mThread in initialization list because mThread depends on mRequests and we + // want mRequests to be initialized first. + mThread = std::thread([this] { + while (mRequests.waitForItems()) { + handleRequestsOnce(); + } + }); +} template void FakeVehicleHardware::PendingRequestHandler::addRequest( -- GitLab From 857158ba122d565f6dcdfe8df87e8db72e6c5dcd Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Mon, 9 May 2022 16:44:13 +0100 Subject: [PATCH 784/825] KeyMint VTS: x25519 pubkey as SubjectPublicKeyInfo The data for a key agreement operation should always send in the SubjectPublicKeyInfo structure, not a raw key for X25519. Test: VtsAidlKeyMintTargetTest Bug: 231959070 Change-Id: Ib5157da6a986d957162fab60dbe927017cfdd703 Merged-In: Ib5157da6a986d957162fab60dbe927017cfdd703 --- .../aidl/vts/functional/KeyMintTest.cpp | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp index 7950850f91..3c2bece4af 100644 --- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp +++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp @@ -7525,7 +7525,6 @@ class KeyAgreementTest : public KeyMintAidlTestBase { uint8_t privKeyData[32]; uint8_t pubKeyData[32]; X25519_keypair(pubKeyData, privKeyData); - *localPublicKey = vector(pubKeyData, pubKeyData + 32); *localPrivKey = EVP_PKEY_Ptr(EVP_PKEY_new_raw_private_key( EVP_PKEY_X25519, nullptr, privKeyData, sizeof(privKeyData))); } else { @@ -7537,16 +7536,15 @@ class KeyAgreementTest : public KeyMintAidlTestBase { ASSERT_EQ(EC_KEY_generate_key(ecKey.get()), 1); *localPrivKey = EVP_PKEY_Ptr(EVP_PKEY_new()); ASSERT_EQ(EVP_PKEY_set1_EC_KEY(localPrivKey->get(), ecKey.get()), 1); - - // Get encoded form of the public part of the locally generated key... - unsigned char* p = nullptr; - int localPublicKeySize = i2d_PUBKEY(localPrivKey->get(), &p); - ASSERT_GT(localPublicKeySize, 0); - *localPublicKey = - vector(reinterpret_cast(p), - reinterpret_cast(p + localPublicKeySize)); - OPENSSL_free(p); } + + // Get encoded form of the public part of the locally generated key... + unsigned char* p = nullptr; + int localPublicKeySize = i2d_PUBKEY(localPrivKey->get(), &p); + ASSERT_GT(localPublicKeySize, 0); + *localPublicKey = vector(reinterpret_cast(p), + reinterpret_cast(p + localPublicKeySize)); + OPENSSL_free(p); } void GenerateKeyMintEcKey(EcCurve curve, EVP_PKEY_Ptr* kmPubKey) { @@ -7641,6 +7639,9 @@ TEST_P(KeyAgreementTest, Ecdh) { // for (auto curve : ValidCurves()) { for (auto localCurve : ValidCurves()) { + SCOPED_TRACE(testing::Message() + << "local-curve-" << localCurve << "-keymint-curve-" << curve); + // Generate EC key locally (with access to private key material) EVP_PKEY_Ptr localPrivKey; vector localPublicKey; -- GitLab From e779c76cccfc29aaa06518b24fd89b2320b3412b Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Tue, 10 May 2022 22:36:27 +0000 Subject: [PATCH 785/825] Freeze another test HAL. Easier to freeze these than adding an exception to the test for cuttlefish. Bug: 231907796 Test: build (checks hash) Change-Id: I07a5e4d038270879aa3c58f774adbb257506fca0 --- current.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/current.txt b/current.txt index ce03b552e0..32a9bc6098 100644 --- a/current.txt +++ b/current.txt @@ -5,6 +5,7 @@ 717c17cd380bb48710dff601d1a03351d4ebc28028353d5d60489248f506523c android.hardware.tests.lazy@1.0::ILazy 67222a2ed4071b6c232e671ce0f4be4f85c1c6fb017ec2355396adaae1fe26be android.hardware.tests.lazy@1.1::ILazy +c1c5fbd3a81c0d190c89348eed39539c77e97fe1d8d1b9874eba56393e70c6f0 android.hardware.tests.lazy_cb@1.0::ILazyCb # HALs released in Android O -- GitLab From 13a8c20d600f46dd73c5753776dc690a308b41e9 Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Tue, 10 May 2022 17:57:02 +0000 Subject: [PATCH 786/825] Add hashes for android.hardware.wifi@1.6::IWifi to current.txt Bug: 232081804 Test: atest vts_treble_vintf_vendor_test Change-Id: I97bd10476b57eeb45279fe69c7d937214b54a517 --- current.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/current.txt b/current.txt index 32a9bc6098..afde7b17fa 100644 --- a/current.txt +++ b/current.txt @@ -920,5 +920,13 @@ fa76bced6b1b71c40fc706c508a9011284c57f57831cd0cf5f45653ed4ea463e android.hardwar ec11690878547a55eb1d6a286f83e227d8328c2cf1d069316b55b4e4084fd9a2 android.hardware.audio@7.1::IStreamOut 786b8619580d7cfae70f02136307e141481714fcc76c6b700e655568f1bf0733 android.hardware.audio@7.1::IStreamOutLatencyModeCallback bfbf383768881eb06f99db76ce79135e37b2b105a90d67bf7468f8df05180bf4 android.hardware.audio@7.1::types +1de444305084b815a1cf45b41d8bd7fa8dc960da89c2d548f38feaa662d8f310 android.hardware.wifi@1.6::IWifi +e8cf2570d2f3d8cf7a7251e85a87cbf633d0bff3c28e1c9bbf339dea04b254fa android.hardware.wifi@1.6::IWifiChip +e05c047de0a7f2cc8f166a1c808b78e8565ff866fb69991fc3bbfa9141871d5b android.hardware.wifi@1.6::IWifiNanIface +b7ce2d87841585551b082fca6d099622e63b7099e0d8013f687ea1a1dc35c4dc android.hardware.wifi@1.6::IWifiNanIfaceEventCallback +8c51742b2540b005edb16d2003b87f8e8220e113b234ddbb133f95e86837e9aa android.hardware.wifi@1.6::IWifiRttController +537f0bcfaf9d91b3136984f5e85d6ea559771726d6624a1d17c151b9c9f4b2f9 android.hardware.wifi@1.6::IWifiRttControllerEventCallback +1bac6a7c8136dfb0414fe5639eec115aa2d12927e64a0642a43fb53225f099b2 android.hardware.wifi@1.6::IWifiStaIface +0a800e010e8eb6eecdfdc96f04fd2ae2f417a79a74a7c0eec3a9f539199bccd4 android.hardware.wifi@1.6::types # There will be no more HIDL HALs. Use AIDL instead. -- GitLab From b440b234cadb7b450670590b3348d6936d663605 Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Tue, 10 May 2022 22:49:28 -0700 Subject: [PATCH 787/825] Corrects CameraStreamBuffering test case EvsManager returns BUFFER_NOT_AVAILABLE to AIDL clients when it fails to process setMaxFramesInFlight() call. Fix: 232021994 Test: atest VtsHalEvsTargetTest Change-Id: I8c6760a77e413cc168f40166e6e9eb472d3e6a12 --- automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp index 09e1088ee4..d963253abd 100644 --- a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp +++ b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp @@ -528,7 +528,7 @@ TEST_P(EvsAidlTest, CameraStreamBuffering) { // Ask for a very large number of buffers in flight to ensure it errors correctly auto badResult = pCam->setMaxFramesInFlight(std::numeric_limits::max()); EXPECT_TRUE(!badResult.isOk() && badResult.getServiceSpecificError() == - static_cast(EvsResult::INVALID_ARG)); + static_cast(EvsResult::BUFFER_NOT_AVAILABLE)); // Now ask for exactly two buffers in flight as we'll test behavior in that case ASSERT_TRUE(pCam->setMaxFramesInFlight(kBuffersToHold).isOk()); -- GitLab From 780d8c5ab6a40e36c790d19303cfbc8ee99af3b5 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Fri, 6 May 2022 09:58:04 +0200 Subject: [PATCH 788/825] Bluetooth LE Audio: pass the 24 bit stream as unpacked through HAL LC3 encoder/decoder expects unpacked 24 bit stream Bug: 230578655 Test: use 24_2 configuration to play over LE Audio Merged-In: I298d6d3a0cd9786581730de88487c982e1fa9d9d Change-Id: I298d6d3a0cd9786581730de88487c982e1fa9d9d --- .../aidl/default/LeAudioSoftwareAudioProvider.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp b/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp index 911c9282eb..c16ff54dda 100644 --- a/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp +++ b/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp @@ -91,17 +91,21 @@ ndk::ScopedAStatus LeAudioSoftwareAudioProvider::startSession( else if (session_type_ == SessionType::LE_AUDIO_SOFTWARE_DECODING_DATAPATH) buffer_modifier = kBufferInCount; + // 24 bit audio stream is sent as unpacked + int bytes_per_sample = + (pcm_config.bitsPerSample == 24) ? 4 : (pcm_config.bitsPerSample / 8); + uint32_t data_mq_size = (ceil(pcm_config.sampleRateHz) / 1000) * - channel_mode_to_channel_count(pcm_config.channelMode) * - (pcm_config.bitsPerSample / 8) * (pcm_config.dataIntervalUs / 1000) * - buffer_modifier; + channel_mode_to_channel_count(pcm_config.channelMode) * bytes_per_sample * + (pcm_config.dataIntervalUs / 1000) * buffer_modifier; if (data_mq_size <= 0) { LOG(ERROR) << __func__ << "Unexpected audio buffer size: " << data_mq_size << ", SampleRateHz: " << pcm_config.sampleRateHz << ", ChannelMode: " << toString(pcm_config.channelMode) << ", BitsPerSample: " << static_cast(pcm_config.bitsPerSample) + << ", BytesPerSample: " << bytes_per_sample << ", DataIntervalUs: " << pcm_config.dataIntervalUs << ", SessionType: " << toString(session_type_); return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); -- GitLab From dbcf52c2b152e8422de909fa5dea83a599f5d13e Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Wed, 11 May 2022 00:01:31 -0700 Subject: [PATCH 789/825] Add a test to verify a status callback registration Bug: 195672428 Test: atest VtsHalEvsTargetTest Change-Id: I0f86c82379bbfa249f159cac0bd0564711394caa --- .../evs/aidl/vts/VtsHalEvsTargetTest.cpp | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp index d963253abd..9c6c573174 100644 --- a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp +++ b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp @@ -19,9 +19,11 @@ #include #include +#include #include #include #include +#include #include #include #include @@ -30,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -77,11 +80,11 @@ typedef struct { } RawStreamConfig; constexpr size_t kStreamCfgSz = sizeof(RawStreamConfig) / sizeof(int32_t); -} // namespace - +using ::aidl::android::hardware::automotive::evs::BnEvsEnumeratorStatusCallback; using ::aidl::android::hardware::automotive::evs::BufferDesc; using ::aidl::android::hardware::automotive::evs::CameraDesc; using ::aidl::android::hardware::automotive::evs::CameraParam; +using ::aidl::android::hardware::automotive::evs::DeviceStatus; using ::aidl::android::hardware::automotive::evs::DisplayDesc; using ::aidl::android::hardware::automotive::evs::DisplayState; using ::aidl::android::hardware::automotive::evs::EvsEventDesc; @@ -90,6 +93,7 @@ using ::aidl::android::hardware::automotive::evs::EvsResult; using ::aidl::android::hardware::automotive::evs::IEvsCamera; using ::aidl::android::hardware::automotive::evs::IEvsDisplay; using ::aidl::android::hardware::automotive::evs::IEvsEnumerator; +using ::aidl::android::hardware::automotive::evs::IEvsEnumeratorStatusCallback; using ::aidl::android::hardware::automotive::evs::IEvsUltrasonicsArray; using ::aidl::android::hardware::automotive::evs::ParameterRange; using ::aidl::android::hardware::automotive::evs::Stream; @@ -99,6 +103,8 @@ using ::aidl::android::hardware::graphics::common::HardwareBufferDescription; using ::aidl::android::hardware::graphics::common::PixelFormat; using std::chrono_literals::operator""s; +} // namespace + // The main test class for EVS class EvsAidlTest : public ::testing::TestWithParam { public: @@ -239,6 +245,13 @@ class EvsAidlTest : public ::testing::TestWithParam { return targetCfg; } + class DeviceStatusCallback : public BnEvsEnumeratorStatusCallback { + ndk::ScopedAStatus deviceStatusChanged(const std::vector&) override { + // This empty implementation returns always ok(). + return ndk::ScopedAStatus::ok(); + } + }; + // Every test needs access to the service std::shared_ptr mEnumerator; // Empty unless/util loadCameraList() is called @@ -2064,6 +2077,20 @@ TEST_P(EvsAidlTest, CameraStreamExternalBuffering) { } } +TEST_P(EvsAidlTest, DeviceStatusCallbackRegistration) { + std::shared_ptr cb = + ndk::SharedRefBase::make(); + ndk::ScopedAStatus status = mEnumerator->registerStatusCallback(cb); + if (mIsHwModule) { + ASSERT_TRUE(status.isOk()); + } else { + // A callback registration may fail if a HIDL EVS HAL implementation is + // running. + ASSERT_TRUE(status.isOk() || + status.getServiceSpecificError() == static_cast(EvsResult::NOT_SUPPORTED)); + } +} + /* * UltrasonicsArrayOpenClean: * Opens each ultrasonics arrays reported by the enumerator and then explicitly closes it via a -- GitLab From 19a32b627098fdec92cee2eeb41dffdc4921fb93 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Wed, 27 Apr 2022 09:57:01 -0700 Subject: [PATCH 790/825] Add VTS tests for measurementInterval, stopSvStatus, and stopNmea Bug: 206670536 Test: atest VtsHalGnssTargetTest Change-Id: Id597c772fbe63789cb394b2aa14faeb755196f64 --- gnss/aidl/default/Gnss.cpp | 69 +++-- gnss/aidl/default/Gnss.h | 6 + .../aidl/default/GnssMeasurementInterface.cpp | 73 ++++-- gnss/aidl/default/GnssMeasurementInterface.h | 11 +- .../GnssNavigationMessageInterface.cpp | 37 ++- .../default/GnssNavigationMessageInterface.h | 5 + gnss/aidl/vts/GnssCallbackAidl.cpp | 5 +- gnss/aidl/vts/GnssCallbackAidl.h | 6 +- gnss/aidl/vts/GnssMeasurementCallbackAidl.cpp | 6 +- gnss/aidl/vts/gnss_hal_test.cpp | 175 +++++++++++- gnss/aidl/vts/gnss_hal_test.h | 19 +- gnss/aidl/vts/gnss_hal_test_cases.cpp | 248 +++++++++++------- gnss/common/utils/default/include/Utils.h | 25 ++ 13 files changed, 527 insertions(+), 158 deletions(-) diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index 7855b5196a..cf2c90d359 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -19,6 +19,7 @@ #include "Gnss.h" #include #include +#include #include "AGnss.h" #include "AGnssRil.h" #include "DeviceFileReader.h" @@ -28,7 +29,6 @@ #include "GnssConfiguration.h" #include "GnssDebug.h" #include "GnssGeofence.h" -#include "GnssMeasurementInterface.h" #include "GnssNavigationMessageInterface.h" #include "GnssPsds.h" #include "GnssVisibilityControl.h" @@ -95,6 +95,9 @@ ScopedAStatus Gnss::start() { } mIsActive = true; + mThreadBlocker.reset(); + // notify measurement engine to update measurement interval + mGnssMeasurementInterface->setLocationEnabled(true); this->reportGnssStatusValue(IGnssCallback::GnssStatusValue::SESSION_BEGIN); mThread = std::thread([this]() { this->reportSvStatus(); @@ -102,8 +105,12 @@ ScopedAStatus Gnss::start() { std::this_thread::sleep_for(std::chrono::milliseconds(TTFF_MILLIS)); mFirstFixReceived = true; } - while (mIsActive == true) { + do { + if (!mIsActive) { + break; + } this->reportSvStatus(); + this->reportNmea(); auto currentLocation = getLocationFromHW(); mGnssPowerIndication->notePowerConsumption(); @@ -113,12 +120,29 @@ ScopedAStatus Gnss::start() { const auto location = Utils::getMockLocation(); this->reportLocation(location); } - std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMs)); - } + } while (mIsActive && mThreadBlocker.wait_for(std::chrono::milliseconds(mMinIntervalMs))); }); return ScopedAStatus::ok(); } +ScopedAStatus Gnss::stop() { + ALOGD("stop"); + mIsActive = false; + mGnssMeasurementInterface->setLocationEnabled(false); + this->reportGnssStatusValue(IGnssCallback::GnssStatusValue::SESSION_END); + mThreadBlocker.notify(); + if (mThread.joinable()) { + mThread.join(); + } + return ScopedAStatus::ok(); +} + +ScopedAStatus Gnss::close() { + ALOGD("close"); + sGnssCallback = nullptr; + return ScopedAStatus::ok(); +} + void Gnss::reportLocation(const GnssLocation& location) const { std::unique_lock lock(mMutex); if (sGnssCallback == nullptr) { @@ -153,7 +177,6 @@ void Gnss::reportSvStatus(const std::vector& svInfoList) const { std::vector Gnss::filterBlocklistedSatellites( std::vector gnssSvInfoList) const { - ALOGD("filterBlocklistedSatellites"); for (uint32_t i = 0; i < gnssSvInfoList.size(); i++) { if (mGnssConfiguration->isBlocklisted(gnssSvInfoList[i])) { gnssSvInfoList[i].svFlag &= ~(uint32_t)IGnssCallback::GnssSvFlags::USED_IN_FIX; @@ -174,14 +197,19 @@ void Gnss::reportGnssStatusValue(const IGnssCallback::GnssStatusValue gnssStatus } } -ScopedAStatus Gnss::stop() { - ALOGD("stop"); - mIsActive = false; - this->reportGnssStatusValue(IGnssCallback::GnssStatusValue::SESSION_END); - if (mThread.joinable()) { - mThread.join(); +void Gnss::reportNmea() const { + if (mIsNmeaActive) { + std::unique_lock lock(mMutex); + if (sGnssCallback == nullptr) { + ALOGE("%s: sGnssCallback is null.", __func__); + return; + } + nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); + auto status = sGnssCallback->gnssNmeaCb(now, "$TEST,0,1,2,3,4,5"); + if (!status.isOk()) { + ALOGE("%s: Unable to invoke callback", __func__); + } } - return ScopedAStatus::ok(); } ScopedAStatus Gnss::startSvStatus() { @@ -197,16 +225,12 @@ ScopedAStatus Gnss::stopSvStatus() { } ScopedAStatus Gnss::startNmea() { ALOGD("startNmea"); + mIsNmeaActive = true; return ScopedAStatus::ok(); } ScopedAStatus Gnss::stopNmea() { ALOGD("stopNmea"); - return ScopedAStatus::ok(); -} - -ScopedAStatus Gnss::close() { - ALOGD("close"); - sGnssCallback = nullptr; + mIsNmeaActive = false; return ScopedAStatus::ok(); } @@ -249,7 +273,8 @@ ScopedAStatus Gnss::deleteAidingData(GnssAidingData aidingDataFlags) { ScopedAStatus Gnss::setPositionMode(const PositionModeOptions& options) { ALOGD("setPositionMode. minIntervalMs:%d, lowPowerMode:%d", options.minIntervalMs, (int)options.lowPowerMode); - mMinIntervalMs = options.minIntervalMs; + mMinIntervalMs = std::max(1000, options.minIntervalMs); + mGnssMeasurementInterface->setLocationInterval(mMinIntervalMs); return ScopedAStatus::ok(); } @@ -283,8 +308,10 @@ ScopedAStatus Gnss::getExtensionGnssPowerIndication( ScopedAStatus Gnss::getExtensionGnssMeasurement( std::shared_ptr* iGnssMeasurement) { ALOGD("getExtensionGnssMeasurement"); - - *iGnssMeasurement = SharedRefBase::make(); + if (mGnssMeasurementInterface == nullptr) { + mGnssMeasurementInterface = SharedRefBase::make(); + } + *iGnssMeasurement = mGnssMeasurementInterface; return ScopedAStatus::ok(); } diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index 1489b4b5e2..df10fc856b 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -32,7 +32,9 @@ #include #include #include "GnssConfiguration.h" +#include "GnssMeasurementInterface.h" #include "GnssPowerIndication.h" +#include "Utils.h" namespace aidl::android::hardware::gnss { @@ -84,6 +86,7 @@ class Gnss : public BnGnss { std::shared_ptr mGnssConfiguration; std::shared_ptr mGnssPowerIndication; + std::shared_ptr mGnssMeasurementInterface; private: void reportLocation(const GnssLocation&) const; @@ -93,14 +96,17 @@ class Gnss : public BnGnss { std::vector gnssSvInfoList) const; void reportGnssStatusValue(const IGnssCallback::GnssStatusValue gnssStatusValue) const; std::unique_ptr getLocationFromHW(); + void reportNmea() const; static std::shared_ptr sGnssCallback; std::atomic mMinIntervalMs; std::atomic mIsActive; std::atomic mIsSvStatusActive; + std::atomic mIsNmeaActive; std::atomic mFirstFixReceived; std::thread mThread; + ::android::hardware::gnss::common::ThreadBlocker mThreadBlocker; mutable std::mutex mMutex; }; diff --git a/gnss/aidl/default/GnssMeasurementInterface.cpp b/gnss/aidl/default/GnssMeasurementInterface.cpp index 2c7241b82e..606de07367 100644 --- a/gnss/aidl/default/GnssMeasurementInterface.cpp +++ b/gnss/aidl/default/GnssMeasurementInterface.cpp @@ -33,10 +33,11 @@ using DeviceFileReader = ::android::hardware::gnss::common::DeviceFileReader; std::shared_ptr GnssMeasurementInterface::sCallback = nullptr; -GnssMeasurementInterface::GnssMeasurementInterface() : mMinIntervalMillis(1000) {} +GnssMeasurementInterface::GnssMeasurementInterface() + : mIntervalMs(1000), mLocationIntervalMs(1000), mFutures(std::vector>()) {} GnssMeasurementInterface::~GnssMeasurementInterface() { - stop(); + waitForStoppingThreads(); } ndk::ScopedAStatus GnssMeasurementInterface::setCallback( @@ -44,8 +45,10 @@ ndk::ScopedAStatus GnssMeasurementInterface::setCallback( const bool enableCorrVecOutputs) { ALOGD("setCallback: enableFullTracking: %d enableCorrVecOutputs: %d", (int)enableFullTracking, (int)enableCorrVecOutputs); - std::unique_lock lock(mMutex); - sCallback = callback; + { + std::unique_lock lock(mMutex); + sCallback = callback; + } if (mIsActive) { ALOGW("GnssMeasurement callback already set. Resetting the callback..."); @@ -60,14 +63,16 @@ ndk::ScopedAStatus GnssMeasurementInterface::setCallbackWithOptions( const std::shared_ptr& callback, const Options& options) { ALOGD("setCallbackWithOptions: fullTracking:%d, corrVec:%d, intervalMs:%d", (int)options.enableFullTracking, (int)options.enableCorrVecOutputs, options.intervalMs); - std::unique_lock lock(mMutex); - sCallback = callback; + { + std::unique_lock lock(mMutex); + sCallback = callback; + } if (mIsActive) { ALOGW("GnssMeasurement callback already set. Resetting the callback..."); stop(); } - mMinIntervalMillis = options.intervalMs; + mIntervalMs = std::max(options.intervalMs, 1000); start(options.enableCorrVecOutputs); return ndk::ScopedAStatus::ok(); @@ -75,18 +80,35 @@ ndk::ScopedAStatus GnssMeasurementInterface::setCallbackWithOptions( ndk::ScopedAStatus GnssMeasurementInterface::close() { ALOGD("close"); - stop(); - std::unique_lock lock(mMutex); - sCallback = nullptr; - mMinIntervalMillis = 1000; + if (mIsActive) { + stop(); + } + { + std::unique_lock lock(mMutex); + sCallback = nullptr; + } + mIntervalMs = 1000; return ndk::ScopedAStatus::ok(); } void GnssMeasurementInterface::start(const bool enableCorrVecOutputs) { ALOGD("start"); + + if (mIsActive) { + ALOGD("restarting since measurement has started"); + stop(); + } + // Wait for stopping previous thread. + waitForStoppingThreads(); + mIsActive = true; + mThreadBlocker.reset(); mThread = std::thread([this, enableCorrVecOutputs]() { - while (mIsActive == true) { + int intervalMs; + do { + if (!mIsActive) { + break; + } std::string rawMeasurementStr = ""; if (ReplayUtils::hasGnssDeviceFile() && ReplayUtils::isGnssRawMeasurement( @@ -103,15 +125,19 @@ void GnssMeasurementInterface::start(const bool enableCorrVecOutputs) { auto measurement = Utils::getMockMeasurement(enableCorrVecOutputs); this->reportMeasurement(measurement); } - std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMillis)); - } + intervalMs = + (mLocationEnabled) ? std::min(mLocationIntervalMs, mIntervalMs) : mIntervalMs; + } while (mIsActive && mThreadBlocker.wait_for(std::chrono::milliseconds(intervalMs))); }); - mThread.detach(); } void GnssMeasurementInterface::stop() { ALOGD("stop"); mIsActive = false; + mThreadBlocker.notify(); + if (mThread.joinable()) { + mFutures.push_back(std::async(std::launch::async, [this] { mThread.join(); })); + } } void GnssMeasurementInterface::reportMeasurement(const GnssData& data) { @@ -128,4 +154,21 @@ void GnssMeasurementInterface::reportMeasurement(const GnssData& data) { callbackCopy->gnssMeasurementCb(data); } +void GnssMeasurementInterface::setLocationInterval(const int intervalMs) { + mLocationIntervalMs = intervalMs; +} + +void GnssMeasurementInterface::setLocationEnabled(const bool enabled) { + mLocationEnabled = enabled; +} + +void GnssMeasurementInterface::waitForStoppingThreads() { + for (auto& future : mFutures) { + ALOGD("Stopping previous thread."); + future.wait(); + ALOGD("Done stopping thread."); + } + mFutures.clear(); +} + } // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/GnssMeasurementInterface.h b/gnss/aidl/default/GnssMeasurementInterface.h index bf77806acb..bb08027568 100644 --- a/gnss/aidl/default/GnssMeasurementInterface.h +++ b/gnss/aidl/default/GnssMeasurementInterface.h @@ -19,8 +19,10 @@ #include #include #include +#include #include #include +#include "Utils.h" namespace aidl::android::hardware::gnss { @@ -35,15 +37,22 @@ struct GnssMeasurementInterface : public BnGnssMeasurementInterface { ndk::ScopedAStatus setCallbackWithOptions( const std::shared_ptr& callback, const Options& options) override; + void setLocationInterval(const int intervalMs); + void setLocationEnabled(const bool enabled); private: void start(const bool enableCorrVecOutputs); void stop(); void reportMeasurement(const GnssData&); + void waitForStoppingThreads(); - std::atomic mMinIntervalMillis; + std::atomic mIntervalMs; + std::atomic mLocationIntervalMs; std::atomic mIsActive; + std::atomic mLocationEnabled; std::thread mThread; + std::vector> mFutures; + ::android::hardware::gnss::common::ThreadBlocker mThreadBlocker; // Guarded by mMutex static std::shared_ptr sCallback; diff --git a/gnss/aidl/default/GnssNavigationMessageInterface.cpp b/gnss/aidl/default/GnssNavigationMessageInterface.cpp index 4bc859d35f..75b962452a 100644 --- a/gnss/aidl/default/GnssNavigationMessageInterface.cpp +++ b/gnss/aidl/default/GnssNavigationMessageInterface.cpp @@ -32,7 +32,7 @@ std::shared_ptr GnssNavigationMessageInterface:: GnssNavigationMessageInterface::GnssNavigationMessageInterface() : mMinIntervalMillis(1000) {} GnssNavigationMessageInterface::~GnssNavigationMessageInterface() { - stop(); + waitForStoppingThreads(); } ndk::ScopedAStatus GnssNavigationMessageInterface::setCallback( @@ -46,7 +46,9 @@ ndk::ScopedAStatus GnssNavigationMessageInterface::setCallback( ndk::ScopedAStatus GnssNavigationMessageInterface::close() { ALOGD("close"); - stop(); + if (mIsActive) { + stop(); + } std::unique_lock lock(mMutex); sCallback = nullptr; return ndk::ScopedAStatus::ok(); @@ -54,9 +56,20 @@ ndk::ScopedAStatus GnssNavigationMessageInterface::close() { void GnssNavigationMessageInterface::start() { ALOGD("start"); + + if (mIsActive) { + ALOGD("restarting since nav msg has started"); + stop(); + } + // Wait for stopping previous thread. + waitForStoppingThreads(); + mIsActive = true; mThread = std::thread([this]() { - while (mIsActive == true) { + do { + if (!mIsActive) { + break; + } GnssNavigationMessage message = { .svid = 19, .type = GnssNavigationMessageType::GPS_L1CA, @@ -66,15 +79,18 @@ void GnssNavigationMessageInterface::start() { .data = std::vector(40, 0xF9), }; this->reportMessage(message); - std::this_thread::sleep_for(std::chrono::milliseconds(mMinIntervalMillis)); - } + } while (mIsActive && + mThreadBlocker.wait_for(std::chrono::milliseconds(mMinIntervalMillis))); }); - mThread.detach(); } void GnssNavigationMessageInterface::stop() { ALOGD("stop"); mIsActive = false; + mThreadBlocker.notify(); + if (mThread.joinable()) { + mFutures.push_back(std::async(std::launch::async, [this] { mThread.join(); })); + } } void GnssNavigationMessageInterface::reportMessage(const GnssNavigationMessage& message) { @@ -91,4 +107,13 @@ void GnssNavigationMessageInterface::reportMessage(const GnssNavigationMessage& callbackCopy->gnssNavigationMessageCb(message); } +void GnssNavigationMessageInterface::waitForStoppingThreads() { + for (auto& future : mFutures) { + ALOGD("Stopping previous thread."); + future.wait(); + ALOGD("Done stopping thread."); + } + mFutures.clear(); +} + } // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/GnssNavigationMessageInterface.h b/gnss/aidl/default/GnssNavigationMessageInterface.h index 600b23ab0a..b3353480f4 100644 --- a/gnss/aidl/default/GnssNavigationMessageInterface.h +++ b/gnss/aidl/default/GnssNavigationMessageInterface.h @@ -18,7 +18,9 @@ #include #include +#include #include +#include "Utils.h" namespace aidl::android::hardware::gnss { @@ -34,10 +36,13 @@ struct GnssNavigationMessageInterface : public BnGnssNavigationMessageInterface void start(); void stop(); void reportMessage(const IGnssNavigationMessageCallback::GnssNavigationMessage& message); + void waitForStoppingThreads(); std::atomic mMinIntervalMillis; std::atomic mIsActive; std::thread mThread; + std::vector> mFutures; + ::android::hardware::gnss::common::ThreadBlocker mThreadBlocker; // Guarded by mMutex static std::shared_ptr sCallback; diff --git a/gnss/aidl/vts/GnssCallbackAidl.cpp b/gnss/aidl/vts/GnssCallbackAidl.cpp index 77a2506820..2f6128b6d2 100644 --- a/gnss/aidl/vts/GnssCallbackAidl.cpp +++ b/gnss/aidl/vts/GnssCallbackAidl.cpp @@ -31,7 +31,7 @@ Status GnssCallbackAidl::gnssSetCapabilitiesCb(const int capabilities) { } Status GnssCallbackAidl::gnssStatusCb(const GnssStatusValue /* status */) { - ALOGI("gnssSvStatusCb"); + ALOGI("gnssStatusCb"); return Status::ok(); } @@ -47,7 +47,8 @@ Status GnssCallbackAidl::gnssLocationCb(const GnssLocation& location) { return Status::ok(); } -Status GnssCallbackAidl::gnssNmeaCb(const int64_t /* timestamp */, const std::string& /* nmea */) { +Status GnssCallbackAidl::gnssNmeaCb(const int64_t timestamp, const std::string& nmea) { + nmea_cbq_.store(std::make_pair(timestamp, nmea)); return Status::ok(); } diff --git a/gnss/aidl/vts/GnssCallbackAidl.h b/gnss/aidl/vts/GnssCallbackAidl.h index 209728df7f..a9495ba3c2 100644 --- a/gnss/aidl/vts/GnssCallbackAidl.h +++ b/gnss/aidl/vts/GnssCallbackAidl.h @@ -17,6 +17,7 @@ #pragma once #include +#include #include "GnssCallbackEventQueue.h" /* Callback class for data & Event. */ @@ -26,7 +27,8 @@ class GnssCallbackAidl : public android::hardware::gnss::BnGnssCallback { : capabilities_cbq_("capabilities"), info_cbq_("system_info"), location_cbq_("location"), - sv_info_list_cbq_("sv_info"){}; + sv_info_list_cbq_("sv_info"), + nmea_cbq_("nmea"){}; ~GnssCallbackAidl(){}; android::binder::Status gnssSetCapabilitiesCb(const int capabilities) override; @@ -55,4 +57,6 @@ class GnssCallbackAidl : public android::hardware::gnss::BnGnssCallback { android::hardware::gnss::common::GnssCallbackEventQueue< std::vector> sv_info_list_cbq_; + android::hardware::gnss::common::GnssCallbackEventQueue> + nmea_cbq_; }; \ No newline at end of file diff --git a/gnss/aidl/vts/GnssMeasurementCallbackAidl.cpp b/gnss/aidl/vts/GnssMeasurementCallbackAidl.cpp index c4fad7fb35..a553954a97 100644 --- a/gnss/aidl/vts/GnssMeasurementCallbackAidl.cpp +++ b/gnss/aidl/vts/GnssMeasurementCallbackAidl.cpp @@ -24,12 +24,10 @@ using android::hardware::gnss::GnssData; android::binder::Status GnssMeasurementCallbackAidl::gnssMeasurementCb(const GnssData& gnssData) { ALOGI("gnssMeasurementCb"); - ALOGI("elapsedRealtime: flags = %d, timestampNs: %" PRId64 ", timeUncertaintyNs=%lf", + ALOGV("elapsedRealtime: flags = 0x%X, timestampNs: %" PRId64 ", timeUncertaintyNs=%lf", gnssData.elapsedRealtime.flags, gnssData.elapsedRealtime.timestampNs, gnssData.elapsedRealtime.timeUncertaintyNs); - for (const auto& measurement : gnssData.measurements) { - ALOGI("measurement.receivedSvTimeInNs=%" PRId64, measurement.receivedSvTimeInNs); - } + gnss_data_cbq_.store(gnssData); return android::binder::Status::ok(); } diff --git a/gnss/aidl/vts/gnss_hal_test.cpp b/gnss/aidl/vts/gnss_hal_test.cpp index f184f8132d..407ac0cad8 100644 --- a/gnss/aidl/vts/gnss_hal_test.cpp +++ b/gnss/aidl/vts/gnss_hal_test.cpp @@ -18,15 +18,50 @@ #include "gnss_hal_test.h" #include +#include +#include #include "Utils.h" +using android::hardware::gnss::GnssClock; using android::hardware::gnss::GnssConstellationType; +using android::hardware::gnss::GnssData; using android::hardware::gnss::GnssLocation; +using android::hardware::gnss::GnssMeasurement; using android::hardware::gnss::IGnss; using android::hardware::gnss::IGnssCallback; +using android::hardware::gnss::IGnssMeasurementInterface; using android::hardware::gnss::common::Utils; using GnssConstellationTypeV2_0 = android::hardware::gnss::V2_0::GnssConstellationType; +namespace { +// The difference between the mean of the received intervals and the requested interval should not +// be larger mInterval * ALLOWED_MEAN_ERROR_RATIO +constexpr double ALLOWED_MEAN_ERROR_RATIO = 0.25; + +// The standard deviation computed for the deltas should not be bigger +// than mInterval * ALLOWED_STDEV_ERROR_RATIO or MIN_STDEV_MS, whichever is higher. +constexpr double ALLOWED_STDEV_ERROR_RATIO = 0.50; +constexpr double MIN_STDEV_MS = 1000; + +double computeMean(std::vector& deltas) { + long accumulator = 0; + for (auto& d : deltas) { + accumulator += d; + } + return accumulator / deltas.size(); +} + +double computeStdev(double mean, std::vector& deltas) { + double accumulator = 0; + for (auto& d : deltas) { + double diff = d - mean; + accumulator += diff * diff; + } + return std::sqrt(accumulator / (deltas.size() - 1)); +} + +} // anonymous namespace + void GnssHalTest::SetUp() { // Get AIDL handle aidl_gnss_hal_ = android::waitForDeclaredService(String16(GetParam().c_str())); @@ -97,20 +132,26 @@ void GnssHalTest::SetPositionMode(const int min_interval_msec, const bool low_po ASSERT_TRUE(status.isOk()); } -bool GnssHalTest::StartAndCheckFirstLocation(const int min_interval_msec, - const bool low_power_mode) { +bool GnssHalTest::StartAndCheckFirstLocation(const int min_interval_msec, const bool low_power_mode, + const bool start_sv_status, const bool start_nmea) { if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { // Invoke the super method. return GnssHalTestTemplate::StartAndCheckFirstLocation(min_interval_msec, low_power_mode); } - SetPositionMode(min_interval_msec, low_power_mode); + auto status = aidl_gnss_hal_->start(); EXPECT_TRUE(status.isOk()); - status = aidl_gnss_hal_->startSvStatus(); - EXPECT_TRUE(status.isOk()); + if (start_sv_status) { + status = aidl_gnss_hal_->startSvStatus(); + EXPECT_TRUE(status.isOk()); + } + if (start_nmea) { + status = aidl_gnss_hal_->startNmea(); + EXPECT_TRUE(status.isOk()); + } /* * GnssLocationProvider support of AGPS SUPL & XtraDownloader is not available in VTS, @@ -131,6 +172,12 @@ bool GnssHalTest::StartAndCheckFirstLocation(const int min_interval_msec, return false; } +bool GnssHalTest::StartAndCheckFirstLocation(const int min_interval_msec, + const bool low_power_mode) { + return StartAndCheckFirstLocation(min_interval_msec, low_power_mode, + /* start_sv_status= */ true, /* start_nmea= */ true); +} + void GnssHalTest::StopAndClearLocations() { ALOGD("StopAndClearLocations"); if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { @@ -139,6 +186,8 @@ void GnssHalTest::StopAndClearLocations() { } auto status = aidl_gnss_hal_->stopSvStatus(); EXPECT_TRUE(status.isOk()); + status = aidl_gnss_hal_->stopNmea(); + EXPECT_TRUE(status.isOk()); status = aidl_gnss_hal_->stop(); EXPECT_TRUE(status.isOk()); @@ -153,7 +202,8 @@ void GnssHalTest::StopAndClearLocations() { aidl_gnss_cb_->location_cbq_.reset(); } -void GnssHalTest::StartAndCheckLocations(int count) { +void GnssHalTest::StartAndCheckLocations(const int count, const bool start_sv_status, + const bool start_nmea) { if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { // Invoke the super method. return GnssHalTestTemplate::StartAndCheckLocations(count); @@ -162,7 +212,8 @@ void GnssHalTest::StartAndCheckLocations(int count) { const int kLocationTimeoutSubsequentSec = 2; const bool kLowPowerMode = false; - EXPECT_TRUE(StartAndCheckFirstLocation(kMinIntervalMsec, kLowPowerMode)); + EXPECT_TRUE(StartAndCheckFirstLocation(kMinIntervalMsec, kLowPowerMode, start_sv_status, + start_nmea)); for (int i = 1; i < count; i++) { EXPECT_TRUE(aidl_gnss_cb_->location_cbq_.retrieve(aidl_gnss_cb_->last_location_, @@ -177,6 +228,10 @@ void GnssHalTest::StartAndCheckLocations(int count) { } } +void GnssHalTest::StartAndCheckLocations(const int count) { + StartAndCheckLocations(count, /* start_sv_status= */ true, /* start_nmea= */ true); +} + std::list> GnssHalTest::convertToAidl( const std::list>& sv_info_list) { std::list> aidl_sv_info_list; @@ -313,3 +368,109 @@ GnssConstellationType GnssHalTest::startLocationAndGetNonGpsConstellation( return constellation_to_blocklist; } + +void GnssHalTest::checkGnssMeasurementClockFields(const GnssData& measurement) { + Utils::checkElapsedRealtime(measurement.elapsedRealtime); + ASSERT_TRUE(measurement.clock.gnssClockFlags >= 0 && + measurement.clock.gnssClockFlags <= + (GnssClock::HAS_LEAP_SECOND | GnssClock::HAS_TIME_UNCERTAINTY | + GnssClock::HAS_FULL_BIAS | GnssClock::HAS_BIAS | + GnssClock::HAS_BIAS_UNCERTAINTY | GnssClock::HAS_DRIFT | + GnssClock::HAS_DRIFT_UNCERTAINTY)); +} + +void GnssHalTest::checkGnssMeasurementFlags(const GnssMeasurement& measurement) { + ASSERT_TRUE(measurement.flags >= 0 && + measurement.flags <= + (GnssMeasurement::HAS_SNR | GnssMeasurement::HAS_CARRIER_FREQUENCY | + GnssMeasurement::HAS_CARRIER_CYCLES | GnssMeasurement::HAS_CARRIER_PHASE | + GnssMeasurement::HAS_CARRIER_PHASE_UNCERTAINTY | + GnssMeasurement::HAS_AUTOMATIC_GAIN_CONTROL | + GnssMeasurement::HAS_FULL_ISB | GnssMeasurement::HAS_FULL_ISB_UNCERTAINTY | + GnssMeasurement::HAS_SATELLITE_ISB | + GnssMeasurement::HAS_SATELLITE_ISB_UNCERTAINTY | + GnssMeasurement::HAS_SATELLITE_PVT | + GnssMeasurement::HAS_CORRELATION_VECTOR)); +} + +void GnssHalTest::checkGnssMeasurementFields(const GnssMeasurement& measurement, + const GnssData& data) { + checkGnssMeasurementFlags(measurement); + // Verify CodeType is valid. + ASSERT_NE(measurement.signalType.codeType, ""); + // Verify basebandCn0DbHz is valid. + ASSERT_TRUE(measurement.basebandCN0DbHz > 0.0 && measurement.basebandCN0DbHz <= 65.0); + + if (((measurement.flags & GnssMeasurement::HAS_FULL_ISB) > 0) && + ((measurement.flags & GnssMeasurement::HAS_FULL_ISB_UNCERTAINTY) > 0) && + ((measurement.flags & GnssMeasurement::HAS_SATELLITE_ISB) > 0) && + ((measurement.flags & GnssMeasurement::HAS_SATELLITE_ISB_UNCERTAINTY) > 0)) { + GnssConstellationType referenceConstellation = + data.clock.referenceSignalTypeForIsb.constellation; + double carrierFrequencyHz = data.clock.referenceSignalTypeForIsb.carrierFrequencyHz; + std::string codeType = data.clock.referenceSignalTypeForIsb.codeType; + + ASSERT_TRUE(referenceConstellation >= GnssConstellationType::UNKNOWN && + referenceConstellation <= GnssConstellationType::IRNSS); + ASSERT_TRUE(carrierFrequencyHz > 0); + ASSERT_NE(codeType, ""); + + ASSERT_TRUE(std::abs(measurement.fullInterSignalBiasNs) < 1.0e6); + ASSERT_TRUE(measurement.fullInterSignalBiasUncertaintyNs >= 0); + ASSERT_TRUE(std::abs(measurement.satelliteInterSignalBiasNs) < 1.0e6); + ASSERT_TRUE(measurement.satelliteInterSignalBiasUncertaintyNs >= 0); + } +} + +void GnssHalTest::startMeasurementWithInterval( + int intervalMs, const sp& iGnssMeasurement, + sp& callback) { + ALOGD("Start requesting measurement at interval of %d millis.", intervalMs); + IGnssMeasurementInterface::Options options; + options.intervalMs = intervalMs; + auto status = iGnssMeasurement->setCallbackWithOptions(callback, options); + ASSERT_TRUE(status.isOk()); +} + +void GnssHalTest::collectMeasurementIntervals(const sp& callback, + const int numMeasurementEvents, + const int timeoutSeconds, + std::vector& deltasMs) { + int64_t lastElapsedRealtimeMillis = 0; + for (int i = 0; i < numMeasurementEvents; i++) { + GnssData lastGnssData; + ASSERT_TRUE(callback->gnss_data_cbq_.retrieve(lastGnssData, timeoutSeconds)); + EXPECT_EQ(callback->gnss_data_cbq_.calledCount(), i + 1); + ASSERT_TRUE(lastGnssData.measurements.size() > 0); + + // Validity check GnssData fields + checkGnssMeasurementClockFields(lastGnssData); + for (const auto& measurement : lastGnssData.measurements) { + checkGnssMeasurementFields(measurement, lastGnssData); + } + + long currentElapsedRealtimeMillis = lastGnssData.elapsedRealtime.timestampNs * 1e-6; + if (lastElapsedRealtimeMillis != 0) { + deltasMs.push_back(currentElapsedRealtimeMillis - lastElapsedRealtimeMillis); + } + lastElapsedRealtimeMillis = currentElapsedRealtimeMillis; + } +} + +void GnssHalTest::assertMeanAndStdev(int intervalMs, std::vector& deltasMs) { + double mean = computeMean(deltasMs); + double stdev = computeStdev(mean, deltasMs); + EXPECT_TRUE(std::abs(mean - intervalMs) <= intervalMs * ALLOWED_MEAN_ERROR_RATIO) + << "Test failed, because the mean of intervals is " << mean + << " millis. The test requires that abs(" << mean << " - " << intervalMs + << ") <= " << intervalMs * ALLOWED_MEAN_ERROR_RATIO + << " millis, when the requested interval is " << intervalMs << " millis."; + + double maxStdev = std::max(MIN_STDEV_MS, intervalMs * ALLOWED_STDEV_ERROR_RATIO); + EXPECT_TRUE(stdev <= maxStdev) + << "Test failed, because the stdev of intervals is " << stdev + << " millis, which must be <= " << maxStdev + << " millis, when the requested interval is " << intervalMs << " millis."; + ALOGD("Mean of interval deltas in millis: %.1lf", mean); + ALOGD("Stdev of interval deltas in millis: %.1lf", stdev); +} diff --git a/gnss/aidl/vts/gnss_hal_test.h b/gnss/aidl/vts/gnss_hal_test.h index d479af3445..645fc824e0 100644 --- a/gnss/aidl/vts/gnss_hal_test.h +++ b/gnss/aidl/vts/gnss_hal_test.h @@ -25,6 +25,7 @@ #include #include "GnssBatchingCallback.h" #include "GnssCallbackAidl.h" +#include "GnssMeasurementCallbackAidl.h" #include "v2_1/gnss_hal_test_template.h" using IGnss_V2_1 = android::hardware::gnss::V2_1::IGnss; @@ -68,8 +69,11 @@ class GnssHalTest : public android::hardware::gnss::common::GnssHalTestTemplate< const bool check_speed); void SetPositionMode(const int min_interval_msec, const bool low_power_mode); bool StartAndCheckFirstLocation(const int min_interval_msec, const bool low_power_mode); + bool StartAndCheckFirstLocation(const int min_interval_msec, const bool low_power_mode, + const bool start_sv_status, const bool start_nmea); void StopAndClearLocations(); - void StartAndCheckLocations(int count); + void StartAndCheckLocations(const int count); + void StartAndCheckLocations(const int count, const bool start_sv_status, const bool start_nmea); android::hardware::gnss::GnssConstellationType startLocationAndGetNonGpsConstellation( const int locations_to_await, const int gnss_sv_info_list_timeout); @@ -85,6 +89,19 @@ class GnssHalTest : public android::hardware::gnss::common::GnssHalTestTemplate< sv_info_list, const int min_observations); + void checkGnssMeasurementClockFields(const android::hardware::gnss::GnssData& measurement); + void checkGnssMeasurementFlags(const android::hardware::gnss::GnssMeasurement& measurement); + void checkGnssMeasurementFields(const android::hardware::gnss::GnssMeasurement& measurement, + const android::hardware::gnss::GnssData& data); + void startMeasurementWithInterval( + int intervalMillis, + const sp& iMeasurement, + sp& callback); + void collectMeasurementIntervals(const sp& callback, + const int numMeasurementEvents, const int timeoutSeconds, + std::vector& deltaMs); + void assertMeanAndStdev(int intervalMillis, std::vector& deltasMillis); + sp aidl_gnss_hal_; sp aidl_gnss_cb_; // Primary callback interface }; diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 54946fb64f..f926c40884 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -28,7 +28,9 @@ #include #include #include +#include #include +#include #include "AGnssCallbackAidl.h" #include "AGnssRilCallbackAidl.h" #include "GnssAntennaInfoCallbackAidl.h" @@ -376,58 +378,6 @@ void CheckSatellitePvt(const SatellitePvt& satellitePvt, const int interfaceVers } } -void CheckGnssMeasurementClockFields(const GnssData& measurement) { - Utils::checkElapsedRealtime(measurement.elapsedRealtime); - ASSERT_TRUE(measurement.clock.gnssClockFlags >= 0 && - measurement.clock.gnssClockFlags <= - (GnssClock::HAS_LEAP_SECOND | GnssClock::HAS_TIME_UNCERTAINTY | - GnssClock::HAS_FULL_BIAS | GnssClock::HAS_BIAS | - GnssClock::HAS_BIAS_UNCERTAINTY | GnssClock::HAS_DRIFT | - GnssClock::HAS_DRIFT_UNCERTAINTY)); -} - -void CheckGnssMeasurementFlags(const GnssMeasurement& measurement) { - ASSERT_TRUE(measurement.flags >= 0 && - measurement.flags <= - (GnssMeasurement::HAS_SNR | GnssMeasurement::HAS_CARRIER_FREQUENCY | - GnssMeasurement::HAS_CARRIER_CYCLES | GnssMeasurement::HAS_CARRIER_PHASE | - GnssMeasurement::HAS_CARRIER_PHASE_UNCERTAINTY | - GnssMeasurement::HAS_AUTOMATIC_GAIN_CONTROL | - GnssMeasurement::HAS_FULL_ISB | GnssMeasurement::HAS_FULL_ISB_UNCERTAINTY | - GnssMeasurement::HAS_SATELLITE_ISB | - GnssMeasurement::HAS_SATELLITE_ISB_UNCERTAINTY | - GnssMeasurement::HAS_SATELLITE_PVT | - GnssMeasurement::HAS_CORRELATION_VECTOR)); -} - -void CheckGnssMeasurementFields(const GnssMeasurement& measurement, const GnssData& data) { - CheckGnssMeasurementFlags(measurement); - // Verify CodeType is valid. - ASSERT_NE(measurement.signalType.codeType, ""); - // Verify basebandCn0DbHz is valid. - ASSERT_TRUE(measurement.basebandCN0DbHz > 0.0 && measurement.basebandCN0DbHz <= 65.0); - - if (((measurement.flags & GnssMeasurement::HAS_FULL_ISB) > 0) && - ((measurement.flags & GnssMeasurement::HAS_FULL_ISB_UNCERTAINTY) > 0) && - ((measurement.flags & GnssMeasurement::HAS_SATELLITE_ISB) > 0) && - ((measurement.flags & GnssMeasurement::HAS_SATELLITE_ISB_UNCERTAINTY) > 0)) { - GnssConstellationType referenceConstellation = - data.clock.referenceSignalTypeForIsb.constellation; - double carrierFrequencyHz = data.clock.referenceSignalTypeForIsb.carrierFrequencyHz; - std::string codeType = data.clock.referenceSignalTypeForIsb.codeType; - - ASSERT_TRUE(referenceConstellation >= GnssConstellationType::UNKNOWN && - referenceConstellation <= GnssConstellationType::IRNSS); - ASSERT_TRUE(carrierFrequencyHz > 0); - ASSERT_NE(codeType, ""); - - ASSERT_TRUE(std::abs(measurement.fullInterSignalBiasNs) < 1.0e6); - ASSERT_TRUE(measurement.fullInterSignalBiasUncertaintyNs >= 0); - ASSERT_TRUE(std::abs(measurement.satelliteInterSignalBiasNs) < 1.0e6); - ASSERT_TRUE(measurement.satelliteInterSignalBiasUncertaintyNs >= 0); - } -} - /* * TestGnssMeasurementExtensionAndSatellitePvt: * 1. Gets the GnssMeasurementExtension and verifies that it returns a non-null extension. @@ -465,10 +415,10 @@ TEST_P(GnssHalTest, TestGnssMeasurementExtensionAndSatellitePvt) { ASSERT_TRUE(lastMeasurement.measurements.size() > 0); // Validity check GnssData fields - CheckGnssMeasurementClockFields(lastMeasurement); + checkGnssMeasurementClockFields(lastMeasurement); for (const auto& measurement : lastMeasurement.measurements) { - CheckGnssMeasurementFields(measurement, lastMeasurement); + checkGnssMeasurementFields(measurement, lastMeasurement); if (measurement.flags & GnssMeasurement::HAS_SATELLITE_PVT && kIsSatellitePvtSupported == true) { ALOGD("Found a measurement with SatellitePvt"); @@ -525,10 +475,10 @@ TEST_P(GnssHalTest, TestCorrelationVector) { ASSERT_TRUE(lastMeasurement.measurements.size() > 0); // Validity check GnssData fields - CheckGnssMeasurementClockFields(lastMeasurement); + checkGnssMeasurementClockFields(lastMeasurement); for (const auto& measurement : lastMeasurement.measurements) { - CheckGnssMeasurementFields(measurement, lastMeasurement); + checkGnssMeasurementFields(measurement, lastMeasurement); if (measurement.flags & GnssMeasurement::HAS_CORRELATION_VECTOR) { correlationVectorFound = true; ASSERT_TRUE(measurement.correlationVectors.size() > 0); @@ -1241,48 +1191,6 @@ TEST_P(GnssHalTest, TestGnssVisibilityControlExtension) { ASSERT_TRUE(status.isOk()); } -/* - * TestGnssMeasurementSetCallbackWithOptions: - * 1. Gets the GnssMeasurementExtension and verifies that it returns a non-null extension. - * 2. Sets a GnssMeasurementCallback with intervalMillis option, waits for measurements reported, - * and verifies mandatory fields are valid. - */ -TEST_P(GnssHalTest, TestGnssMeasurementSetCallbackWithOptions) { - if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { - return; - } - const int kFirstGnssMeasurementTimeoutSeconds = 10; - const int kNumMeasurementEvents = 5; - - sp iGnssMeasurement; - auto status = aidl_gnss_hal_->getExtensionGnssMeasurement(&iGnssMeasurement); - ASSERT_TRUE(status.isOk()); - ASSERT_TRUE(iGnssMeasurement != nullptr); - - auto callback = sp::make(); - IGnssMeasurementInterface::Options options; - options.intervalMs = 2000; - status = iGnssMeasurement->setCallbackWithOptions(callback, options); - ASSERT_TRUE(status.isOk()); - - for (int i = 0; i < kNumMeasurementEvents; i++) { - GnssData lastMeasurement; - ASSERT_TRUE(callback->gnss_data_cbq_.retrieve(lastMeasurement, - kFirstGnssMeasurementTimeoutSeconds)); - EXPECT_EQ(callback->gnss_data_cbq_.calledCount(), i + 1); - ASSERT_TRUE(lastMeasurement.measurements.size() > 0); - - // Validity check GnssData fields - CheckGnssMeasurementClockFields(lastMeasurement); - for (const auto& measurement : lastMeasurement.measurements) { - CheckGnssMeasurementFields(measurement, lastMeasurement); - } - } - - status = iGnssMeasurement->close(); - ASSERT_TRUE(status.isOk()); -} - /* * TestGnssAgcInGnssMeasurement: * 1. Gets the GnssMeasurementExtension and verifies that it returns a non-null extension. @@ -1293,7 +1201,7 @@ TEST_P(GnssHalTest, TestGnssAgcInGnssMeasurement) { return; } const int kFirstGnssMeasurementTimeoutSeconds = 10; - const int kNumMeasurementEvents = 15; + const int kNumMeasurementEvents = 5; sp iGnssMeasurement; auto status = aidl_gnss_hal_->getExtensionGnssMeasurement(&iGnssMeasurement); @@ -1313,7 +1221,7 @@ TEST_P(GnssHalTest, TestGnssAgcInGnssMeasurement) { ASSERT_TRUE(lastMeasurement.measurements.size() > 0); // Validity check GnssData fields - CheckGnssMeasurementClockFields(lastMeasurement); + checkGnssMeasurementClockFields(lastMeasurement); ASSERT_TRUE(lastMeasurement.gnssAgcs.size() > 0); for (const auto& gnssAgc : lastMeasurement.gnssAgcs) { @@ -1444,3 +1352,143 @@ TEST_P(GnssHalTest, TestGnssMeasurementCorrections) { Utils::getMockMeasurementCorrections_aidl()); ASSERT_TRUE(status.isOk()); } + +/* + * TestStopSvStatusAndNmea: + * 1. Call stopSvStatus and stopNmea. + * 2. Start location and verify that + * - no SvStatus is received. + * - no Nmea is received. + */ +TEST_P(GnssHalTest, TestStopSvStatusAndNmea) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { + return; + } + auto status = aidl_gnss_hal_->stopSvStatus(); + EXPECT_TRUE(status.isOk()); + status = aidl_gnss_hal_->stopNmea(); + EXPECT_TRUE(status.isOk()); + + int kLocationsToAwait = 5; + aidl_gnss_cb_->location_cbq_.reset(); + aidl_gnss_cb_->sv_info_list_cbq_.reset(); + aidl_gnss_cb_->nmea_cbq_.reset(); + StartAndCheckLocations(/* count= */ kLocationsToAwait, + /* start_sv_status= */ false, /* start_nmea= */ false); + int location_called_count = aidl_gnss_cb_->location_cbq_.calledCount(); + ALOGD("Observed %d GnssSvStatus, and %d Nmea while awaiting %d locations (%d received)", + aidl_gnss_cb_->sv_info_list_cbq_.size(), aidl_gnss_cb_->nmea_cbq_.size(), + kLocationsToAwait, location_called_count); + + // Ensure that no SvStatus & no Nmea is received. + EXPECT_EQ(aidl_gnss_cb_->sv_info_list_cbq_.size(), 0); + EXPECT_EQ(aidl_gnss_cb_->nmea_cbq_.size(), 0); + + StopAndClearLocations(); +} + +/* + * TestGnssMeasurementIntervals_WithoutLocation: + * 1. start measurement with interval + * 2. verify that the received measurement intervals have expected mean and stdev + */ +TEST_P(GnssHalTest, TestGnssMeasurementIntervals_WithoutLocation) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { + return; + } + + std::vector intervals({2000, 4000}); + std::vector numEvents({10, 5}); + + sp iGnssMeasurement; + auto status = aidl_gnss_hal_->getExtensionGnssMeasurement(&iGnssMeasurement); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(iGnssMeasurement != nullptr); + + ALOGD("TestGnssMeasurementIntervals_WithoutLocation"); + for (int i = 0; i < intervals.size(); i++) { + auto callback = sp::make(); + startMeasurementWithInterval(intervals[i], iGnssMeasurement, callback); + + std::vector deltas; + collectMeasurementIntervals(callback, numEvents[i], /* timeoutSeconds= */ 10, deltas); + + status = iGnssMeasurement->close(); + ASSERT_TRUE(status.isOk()); + + assertMeanAndStdev(intervals[i], deltas); + } +} + +/* + * TestGnssMeasurementIntervals_LocationOnBeforeMeasurement: + * 1. start measurement with interval + * 2. verify that the received measurement intervals have expected mean and stdev + */ +TEST_P(GnssHalTest, TestGnssMeasurementIntervals_LocationOnBeforeMeasurement) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { + return; + } + + std::vector intervals({2000}); + + sp iGnssMeasurement; + auto status = aidl_gnss_hal_->getExtensionGnssMeasurement(&iGnssMeasurement); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(iGnssMeasurement != nullptr); + + int locationIntervalMs = 1000; + + // Start location first and then start measurement + ALOGD("TestGnssMeasurementIntervals_LocationOnBeforeMeasurement"); + StartAndCheckFirstLocation(locationIntervalMs, /* lowPowerMode= */ false); + for (auto& intervalMs : intervals) { + auto callback = sp::make(); + startMeasurementWithInterval(intervalMs, iGnssMeasurement, callback); + + std::vector deltas; + collectMeasurementIntervals(callback, /*numEvents=*/10, /*timeoutSeconds=*/10, deltas); + + status = iGnssMeasurement->close(); + ASSERT_TRUE(status.isOk()); + + assertMeanAndStdev(locationIntervalMs, deltas); + } + StopAndClearLocations(); +} + +/* + * TestGnssMeasurementIntervals: + * 1. start measurement with interval + * 2. verify that the received measurement intervals have expected mean and stdev + */ +TEST_P(GnssHalTest, TestGnssMeasurementIntervals_LocationOnAfterMeasurement) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 1) { + return; + } + + std::vector intervals({2000}); + + sp iGnssMeasurement; + auto status = aidl_gnss_hal_->getExtensionGnssMeasurement(&iGnssMeasurement); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(iGnssMeasurement != nullptr); + + int locationIntervalMs = 1000; + // Start location first and then start measurement + ALOGD("TestGnssMeasurementIntervals_LocationOnAfterMeasurement"); + for (auto& intervalMs : intervals) { + auto callback = sp::make(); + startMeasurementWithInterval(intervalMs, iGnssMeasurement, callback); + + StartAndCheckFirstLocation(locationIntervalMs, /* lowPowerMode= */ false); + std::vector deltas; + collectMeasurementIntervals(callback, /*numEvents=*/10, /*timeoutSeconds=*/10, deltas); + + StopAndClearLocations(); + status = iGnssMeasurement->close(); + ASSERT_TRUE(status.isOk()); + + assertMeanAndStdev(locationIntervalMs, deltas); + } +} diff --git a/gnss/common/utils/default/include/Utils.h b/gnss/common/utils/default/include/Utils.h index 7065a6fb00..ad8f539248 100644 --- a/gnss/common/utils/default/include/Utils.h +++ b/gnss/common/utils/default/include/Utils.h @@ -56,6 +56,31 @@ struct Utils { static hidl_vec getMockAntennaInfos(); }; +struct ThreadBlocker { + // returns false if unblocked: + template + bool wait_for(std::chrono::duration const& time) { + std::unique_lock lock(m); + return !cv.wait_for(lock, time, [&] { return terminate; }); + } + + void notify() { + std::unique_lock lock(m); + terminate = true; + cv.notify_all(); + } + + void reset() { + std::unique_lock lock(m); + terminate = false; + } + + private: + std::condition_variable cv; + std::mutex m; + bool terminate = false; +}; + } // namespace common } // namespace gnss } // namespace hardware -- GitLab From 895d411403e9c4bcfa1c2cf212274ddfb985424a Mon Sep 17 00:00:00 2001 From: Jason Macnak Date: Wed, 11 May 2022 21:56:30 +0000 Subject: [PATCH 791/825] Update Mapper4 SetBadMetadata VTS test for optional metadata The common decode function for optional gralloc4 metadata `android::gralloc4::decodeOptionalMetadata()` treats an empty input `hidl_vec` as `std::nullopt` and not a bad value. aosp/1907915 previously tried to update the encoding and decoding of optional metadata in order to distinguish this case but the change broke GRF. Instead, let's update the SetBadMetadata test to use some actual incorrect data for the optional metadata tests instead of an empty vec. Bug: b/207388558 Test: cvd start Test: VtsHalGraphicsMapperV4_0TargetTest Change-Id: I87c20930cb701e87c89489bd0359cce0522cfe44 --- .../vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp index 8f440e4d1e..2aac337ca7 100644 --- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp +++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp @@ -2212,6 +2212,11 @@ TEST_P(GraphicsMapperHidlTest, SetBadMetadata) { mGralloc->set(bufferHandle, gralloc4::MetadataType_Dataspace, vec)); ASSERT_EQ(Error::UNSUPPORTED, mGralloc->set(bufferHandle, gralloc4::MetadataType_BlendMode, vec)); + + // 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, -- GitLab From 4d14c1edba521268342530600a8f8abb0ae0ee5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Rymanowski?= Date: Fri, 6 May 2022 17:12:50 +0000 Subject: [PATCH 792/825] Add 32kHz as supported setting Bug: 230550335 Test: Build, test audio Change-Id: I94c4c54092d0afb71aee555fa46936e228397444 (cherry picked from commit 12f82bb40c5afebfb43a6622da7bd0453edfc0b0) Merged-In: I94c4c54092d0afb71aee555fa46936e228397444 --- bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp index f3ca279867..1fb0e4199c 100644 --- a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp +++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp @@ -37,7 +37,7 @@ namespace bluetooth { namespace audio { static const PcmCapabilities kDefaultSoftwarePcmCapabilities = { - .sampleRateHz = {16000, 24000, 44100, 48000, 88200, 96000}, + .sampleRateHz = {16000, 24000, 32000, 44100, 48000, 88200, 96000}, .channelMode = {ChannelMode::MONO, ChannelMode::STEREO}, .bitsPerSample = {16, 24, 32}, .dataIntervalUs = {}, -- GitLab From a2587da5b2cc401f522fb9d3652b9ac42fa4fa15 Mon Sep 17 00:00:00 2001 From: Omer Osman Date: Sun, 1 May 2022 03:54:11 +0000 Subject: [PATCH 793/825] Add Opus to BT Audio HAL and update version to V2 This CL adds Opus as a supported A2DP codec to the BT Audio HAL and updates HAL compatibility matrix. Bug: 226441860 Test: A2DP sink device using bds-dev Change-Id: I21249e3e7e76412af7ed62a3fc9ec133434cf963 --- bluetooth/audio/aidl/Android.bp | 9 ++ .../android.hardware.bluetooth.audio/2/.hash | 1 + .../bluetooth/audio/AacCapabilities.aidl | 42 +++++++++ .../bluetooth/audio/AacConfiguration.aidl | 42 +++++++++ .../bluetooth/audio/AacObjectType.aidl | 41 +++++++++ .../audio/AptxAdaptiveCapabilities.aidl | 46 ++++++++++ .../audio/AptxAdaptiveChannelMode.aidl | 42 +++++++++ .../audio/AptxAdaptiveConfiguration.aidl | 46 ++++++++++ .../audio/AptxAdaptiveInputMode.aidl | 39 +++++++++ .../audio/AptxAdaptiveTimeToPlay.aidl | 43 ++++++++++ .../bluetooth/audio/AptxCapabilities.aidl | 40 +++++++++ .../bluetooth/audio/AptxConfiguration.aidl | 40 +++++++++ .../hardware/bluetooth/audio/AptxMode.aidl | 41 +++++++++ .../bluetooth/audio/AptxSinkBuffering.aidl | 43 ++++++++++ .../bluetooth/audio/AudioCapabilities.aidl | 40 +++++++++ .../bluetooth/audio/AudioConfiguration.aidl | 41 +++++++++ .../bluetooth/audio/AudioLocation.aidl | 40 +++++++++ .../bluetooth/audio/BluetoothAudioStatus.aidl | 42 +++++++++ .../bluetooth/audio/BroadcastCapability.aidl | 50 +++++++++++ .../hardware/bluetooth/audio/ChannelMode.aidl | 41 +++++++++ .../bluetooth/audio/CodecCapabilities.aidl | 54 ++++++++++++ .../bluetooth/audio/CodecConfiguration.aidl | 59 +++++++++++++ .../hardware/bluetooth/audio/CodecType.aidl | 47 ++++++++++ .../bluetooth/audio/IBluetoothAudioPort.aidl | 44 ++++++++++ .../audio/IBluetoothAudioProvider.aidl | 43 ++++++++++ .../audio/IBluetoothAudioProviderFactory.aidl | 39 +++++++++ .../hardware/bluetooth/audio/LatencyMode.aidl | 40 +++++++++ .../bluetooth/audio/Lc3Capabilities.aidl | 43 ++++++++++ .../bluetooth/audio/Lc3Configuration.aidl | 43 ++++++++++ .../bluetooth/audio/LdacCapabilities.aidl | 41 +++++++++ .../bluetooth/audio/LdacChannelMode.aidl | 41 +++++++++ .../bluetooth/audio/LdacConfiguration.aidl | 41 +++++++++ .../bluetooth/audio/LdacQualityIndex.aidl | 41 +++++++++ .../audio/LeAudioBroadcastConfiguration.aidl | 45 ++++++++++ .../LeAudioCodecCapabilitiesSetting.aidl | 40 +++++++++ .../audio/LeAudioCodecConfiguration.aidl | 43 ++++++++++ .../bluetooth/audio/LeAudioConfiguration.aidl | 46 ++++++++++ .../bluetooth/audio/OpusCapabilities.aidl | 43 ++++++++++ .../bluetooth/audio/OpusConfiguration.aidl | 43 ++++++++++ .../bluetooth/audio/PcmCapabilities.aidl | 41 +++++++++ .../bluetooth/audio/PcmConfiguration.aidl | 41 +++++++++ .../bluetooth/audio/PresentationPosition.aidl | 45 ++++++++++ .../bluetooth/audio/SbcAllocMethod.aidl | 39 +++++++++ .../bluetooth/audio/SbcCapabilities.aidl | 45 ++++++++++ .../bluetooth/audio/SbcChannelMode.aidl | 42 +++++++++ .../bluetooth/audio/SbcConfiguration.aidl | 45 ++++++++++ .../hardware/bluetooth/audio/SessionType.aidl | 49 +++++++++++ .../bluetooth/audio/UnicastCapability.aidl | 51 +++++++++++ .../hardware/bluetooth/audio/ChannelMode.aidl | 1 + .../bluetooth/audio/CodecCapabilities.aidl | 1 + .../bluetooth/audio/CodecConfiguration.aidl | 1 + .../hardware/bluetooth/audio/CodecType.aidl | 1 + .../bluetooth/audio/OpusCapabilities.aidl | 43 ++++++++++ .../bluetooth/audio/OpusConfiguration.aidl | 43 ++++++++++ .../hardware/bluetooth/audio/ChannelMode.aidl | 1 + .../bluetooth/audio/CodecCapabilities.aidl | 4 +- .../bluetooth/audio/CodecConfiguration.aidl | 4 +- .../hardware/bluetooth/audio/CodecType.aidl | 1 + .../bluetooth/audio/OpusCapabilities.aidl | 50 +++++++++++ .../bluetooth/audio/OpusConfiguration.aidl | 50 +++++++++++ bluetooth/audio/aidl/default/Android.bp | 2 +- .../audio/aidl/default/bluetooth_audio.xml | 3 +- bluetooth/audio/aidl/vts/Android.bp | 2 +- .../vts/VtsHalBluetoothAudioTargetTest.cpp | 86 ++++++++++--------- bluetooth/audio/utils/Android.bp | 2 +- .../aidl_session/BluetoothAudioCodecs.cpp | 46 +++++----- .../utils/aidl_session/BluetoothAudioCodecs.h | 4 +- .../compatibility_matrix.7.xml | 1 + .../compatibility_matrix.current.xml | 1 + 69 files changed, 2282 insertions(+), 68 deletions(-) create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/.hash create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AacCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AacConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AacObjectType.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveChannelMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveInputMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveTimeToPlay.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxSinkBuffering.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AudioCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AudioConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AudioLocation.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/BroadcastCapability.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/ChannelMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/CodecCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/CodecConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/CodecType.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LatencyMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/Lc3Capabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/Lc3Configuration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacChannelMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacQualityIndex.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioCodecCapabilitiesSetting.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/OpusCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/OpusConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/PcmCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/PcmConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/PresentationPosition.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcAllocMethod.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcChannelMode.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcConfiguration.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SessionType.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/UnicastCapability.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/OpusCapabilities.aidl create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/OpusConfiguration.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/OpusCapabilities.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/OpusConfiguration.aidl diff --git a/bluetooth/audio/aidl/Android.bp b/bluetooth/audio/aidl/Android.bp index cd6617b094..c581702ea9 100644 --- a/bluetooth/audio/aidl/Android.bp +++ b/bluetooth/audio/aidl/Android.bp @@ -59,6 +59,15 @@ aidl_interface { "android.hardware.audio.common-V1", ], }, + { + version: "2", + imports: [ + "android.hardware.common-V2", + "android.hardware.common.fmq-V1", + "android.hardware.audio.common-V1", + ], + }, + ], } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/.hash b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/.hash new file mode 100644 index 0000000000..52e6933384 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/.hash @@ -0,0 +1 @@ +b82d5b9f717bbf63bef774ee8f72572065ca61ce diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AacCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AacCapabilities.aidl new file mode 100644 index 0000000000..899b8ca6db --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AacCapabilities.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable AacCapabilities { + android.hardware.bluetooth.audio.AacObjectType[] objectType; + int[] sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; + boolean variableBitRateSupported; + byte[] bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AacConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AacConfiguration.aidl new file mode 100644 index 0000000000..6adef6df16 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AacConfiguration.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable AacConfiguration { + android.hardware.bluetooth.audio.AacObjectType objectType; + int sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode channelMode; + boolean variableBitRateEnabled; + byte bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AacObjectType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AacObjectType.aidl new file mode 100644 index 0000000000..2148244d06 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AacObjectType.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 -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.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum AacObjectType { + MPEG2_LC = 0, + MPEG4_LC = 1, + MPEG4_LTP = 2, + MPEG4_SCALABLE = 3, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveCapabilities.aidl new file mode 100644 index 0000000000..4e5dfe66c2 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveCapabilities.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@VintfStability +parcelable AptxAdaptiveCapabilities { + int[] sampleRateHz; + android.hardware.bluetooth.audio.AptxAdaptiveChannelMode[] channelMode; + byte[] bitsPerSample; + android.hardware.bluetooth.audio.AptxMode[] aptxMode; + android.hardware.bluetooth.audio.AptxSinkBuffering sinkBufferingMs; + android.hardware.bluetooth.audio.AptxAdaptiveTimeToPlay ttp; + android.hardware.bluetooth.audio.AptxAdaptiveInputMode inputMode; + int inputFadeDurationMs; + byte[] aptxAdaptiveConfigStream; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveChannelMode.aidl new file mode 100644 index 0000000000..0499b706ff --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveChannelMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@Backing(type="int") @VintfStability +enum AptxAdaptiveChannelMode { + JOINT_STEREO = 0, + MONO = 1, + DUAL_MONO = 2, + TWS_STEREO = 4, + UNKNOWN = 255, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveConfiguration.aidl new file mode 100644 index 0000000000..aab05213b4 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveConfiguration.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@VintfStability +parcelable AptxAdaptiveConfiguration { + int sampleRateHz; + android.hardware.bluetooth.audio.AptxAdaptiveChannelMode channelMode; + byte bitsPerSample; + android.hardware.bluetooth.audio.AptxMode aptxMode; + android.hardware.bluetooth.audio.AptxSinkBuffering sinkBufferingMs; + android.hardware.bluetooth.audio.AptxAdaptiveTimeToPlay ttp; + android.hardware.bluetooth.audio.AptxAdaptiveInputMode inputMode; + int inputFadeDurationMs; + byte[] aptxAdaptiveConfigStream; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveInputMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveInputMode.aidl new file mode 100644 index 0000000000..f7029396c6 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveInputMode.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@Backing(type="int") @VintfStability +enum AptxAdaptiveInputMode { + STEREO = 0, + DUAL_MONO = 1, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveTimeToPlay.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveTimeToPlay.aidl new file mode 100644 index 0000000000..35606667cb --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxAdaptiveTimeToPlay.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@VintfStability +parcelable AptxAdaptiveTimeToPlay { + byte lowLowLatency; + byte highLowLatency; + byte lowHighQuality; + byte highHighQuality; + byte lowTws; + byte highTws; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxCapabilities.aidl new file mode 100644 index 0000000000..08a38e26e1 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable AptxCapabilities { + int[] sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; + byte[] bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxConfiguration.aidl new file mode 100644 index 0000000000..91e88b32f3 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxConfiguration.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable AptxConfiguration { + int sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode channelMode; + byte bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxMode.aidl new file mode 100644 index 0000000000..d5dd9d9deb --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@Backing(type="int") @VintfStability +enum AptxMode { + UNKNOWN = 0, + HIGH_QUALITY = 4096, + LOW_LATENCY = 8192, + ULTRA_LOW_LATENCY = 16384, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxSinkBuffering.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxSinkBuffering.aidl new file mode 100644 index 0000000000..527418e308 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AptxSinkBuffering.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@VintfStability +parcelable AptxSinkBuffering { + byte minLowLatency; + byte maxLowLatency; + byte minHighQuality; + byte maxHighQuality; + byte minTws; + byte maxTws; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AudioCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AudioCapabilities.aidl new file mode 100644 index 0000000000..8ae716ff23 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AudioCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +union AudioCapabilities { + android.hardware.bluetooth.audio.PcmCapabilities pcmCapabilities; + android.hardware.bluetooth.audio.CodecCapabilities a2dpCapabilities; + android.hardware.bluetooth.audio.LeAudioCodecCapabilitiesSetting leAudioCapabilities; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AudioConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AudioConfiguration.aidl new file mode 100644 index 0000000000..3abfb31b7b --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AudioConfiguration.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +union AudioConfiguration { + android.hardware.bluetooth.audio.PcmConfiguration pcmConfig; + android.hardware.bluetooth.audio.CodecConfiguration a2dpConfig; + android.hardware.bluetooth.audio.LeAudioConfiguration leAudioConfig; + android.hardware.bluetooth.audio.LeAudioBroadcastConfiguration leAudioBroadcastConfig; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AudioLocation.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AudioLocation.aidl new file mode 100644 index 0000000000..319a5e2ad0 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/AudioLocation.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="int") @VintfStability +enum AudioLocation { + UNKNOWN = 1, + FRONT_LEFT = 2, + FRONT_RIGHT = 4, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl new file mode 100644 index 0000000000..c20c057626 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="int") @VintfStability +enum BluetoothAudioStatus { + UNKNOWN = 0, + SUCCESS = 1, + UNSUPPORTED_CODEC_CONFIGURATION = 2, + FAILURE = 3, + RECONFIGURATION = 4, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/BroadcastCapability.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/BroadcastCapability.aidl new file mode 100644 index 0000000000..58710effe7 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/BroadcastCapability.aidl @@ -0,0 +1,50 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@VintfStability +parcelable BroadcastCapability { + android.hardware.bluetooth.audio.CodecType codecType; + android.hardware.bluetooth.audio.AudioLocation supportedChannel; + int channelCountPerStream; + android.hardware.bluetooth.audio.BroadcastCapability.LeAudioCodecCapabilities leAudioCodecCapabilities; + @VintfStability + parcelable VendorCapabilities { + ParcelableHolder extension; + } + @VintfStability + union LeAudioCodecCapabilities { + @nullable android.hardware.bluetooth.audio.Lc3Capabilities[] lc3Capabilities; + @nullable android.hardware.bluetooth.audio.BroadcastCapability.VendorCapabilities[] vendorCapabillities; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/ChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/ChannelMode.aidl new file mode 100644 index 0000000000..feacb80438 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/ChannelMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum ChannelMode { + UNKNOWN = 0, + MONO = 1, + STEREO = 2, + DUALMONO = 3, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/CodecCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/CodecCapabilities.aidl new file mode 100644 index 0000000000..b00649a62d --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/CodecCapabilities.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable CodecCapabilities { + android.hardware.bluetooth.audio.CodecType codecType; + android.hardware.bluetooth.audio.CodecCapabilities.Capabilities capabilities; + @VintfStability + parcelable VendorCapabilities { + ParcelableHolder extension; + } + @VintfStability + union Capabilities { + android.hardware.bluetooth.audio.SbcCapabilities sbcCapabilities; + android.hardware.bluetooth.audio.AacCapabilities aacCapabilities; + android.hardware.bluetooth.audio.LdacCapabilities ldacCapabilities; + android.hardware.bluetooth.audio.AptxCapabilities aptxCapabilities; + android.hardware.bluetooth.audio.AptxAdaptiveCapabilities aptxAdaptiveCapabilities; + android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities; + android.hardware.bluetooth.audio.CodecCapabilities.VendorCapabilities vendorCapabilities; + @nullable android.hardware.bluetooth.audio.OpusCapabilities opusCapabilities; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/CodecConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/CodecConfiguration.aidl new file mode 100644 index 0000000000..7f5ea48d8a --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/CodecConfiguration.aidl @@ -0,0 +1,59 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable CodecConfiguration { + android.hardware.bluetooth.audio.CodecType codecType; + int encodedAudioBitrate; + int peerMtu; + boolean isScmstEnabled; + android.hardware.bluetooth.audio.CodecConfiguration.CodecSpecific config; + @VintfStability + parcelable VendorConfiguration { + int vendorId; + char codecId; + ParcelableHolder codecConfig; + } + @VintfStability + union CodecSpecific { + android.hardware.bluetooth.audio.SbcConfiguration sbcConfig; + android.hardware.bluetooth.audio.AacConfiguration aacConfig; + android.hardware.bluetooth.audio.LdacConfiguration ldacConfig; + android.hardware.bluetooth.audio.AptxConfiguration aptxConfig; + android.hardware.bluetooth.audio.AptxAdaptiveConfiguration aptxAdaptiveConfig; + android.hardware.bluetooth.audio.Lc3Configuration lc3Config; + android.hardware.bluetooth.audio.CodecConfiguration.VendorConfiguration vendorConfig; + @nullable android.hardware.bluetooth.audio.OpusConfiguration opusConfig; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/CodecType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/CodecType.aidl new file mode 100644 index 0000000000..d1723e6dab --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/CodecType.aidl @@ -0,0 +1,47 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="int") @VintfStability +enum CodecType { + UNKNOWN = 0, + SBC = 1, + AAC = 2, + APTX = 3, + APTX_HD = 4, + LDAC = 5, + LC3 = 6, + VENDOR = 7, + APTX_ADAPTIVE = 8, + OPUS = 9, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl new file mode 100644 index 0000000000..d364371707 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +interface IBluetoothAudioPort { + android.hardware.bluetooth.audio.PresentationPosition getPresentationPosition(); + void startStream(boolean isLowLatency); + void stopStream(); + void suspendStream(); + void updateSourceMetadata(in android.hardware.audio.common.SourceMetadata sourceMetadata); + void updateSinkMetadata(in android.hardware.audio.common.SinkMetadata sinkMetadata); + void setLatencyMode(in android.hardware.bluetooth.audio.LatencyMode latencyMode); +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl new file mode 100644 index 0000000000..267af0f4b4 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +interface IBluetoothAudioProvider { + void endSession(); + android.hardware.common.fmq.MQDescriptor startSession(in android.hardware.bluetooth.audio.IBluetoothAudioPort hostIf, in android.hardware.bluetooth.audio.AudioConfiguration audioConfig, in android.hardware.bluetooth.audio.LatencyMode[] supportedLatencyModes); + void streamStarted(in android.hardware.bluetooth.audio.BluetoothAudioStatus status); + void streamSuspended(in android.hardware.bluetooth.audio.BluetoothAudioStatus status); + void updateAudioConfiguration(in android.hardware.bluetooth.audio.AudioConfiguration audioConfig); + void setLowLatencyModeAllowed(in boolean allowed); +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl new file mode 100644 index 0000000000..5e33deb856 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/IBluetoothAudioProviderFactory.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +interface IBluetoothAudioProviderFactory { + android.hardware.bluetooth.audio.AudioCapabilities[] getProviderCapabilities(in android.hardware.bluetooth.audio.SessionType sessionType); + android.hardware.bluetooth.audio.IBluetoothAudioProvider openProvider(in android.hardware.bluetooth.audio.SessionType sessionType); +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LatencyMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LatencyMode.aidl new file mode 100644 index 0000000000..5583679412 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LatencyMode.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@Backing(type="int") @VintfStability +enum LatencyMode { + UNKNOWN = 0, + LOW_LATENCY = 1, + FREE = 2, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/Lc3Capabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/Lc3Capabilities.aidl new file mode 100644 index 0000000000..cc4449aea9 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/Lc3Capabilities.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable Lc3Capabilities { + byte[] pcmBitDepth; + int[] samplingFrequencyHz; + int[] frameDurationUs; + int[] octetsPerFrame; + byte[] blocksPerSdu; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/Lc3Configuration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/Lc3Configuration.aidl new file mode 100644 index 0000000000..7e8dccff5f --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/Lc3Configuration.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable Lc3Configuration { + byte pcmBitDepth; + int samplingFrequencyHz; + int frameDurationUs; + int octetsPerFrame; + byte blocksPerSdu; + android.hardware.bluetooth.audio.ChannelMode channelMode; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacCapabilities.aidl new file mode 100644 index 0000000000..aa4e4c8793 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacCapabilities.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable LdacCapabilities { + int[] sampleRateHz; + android.hardware.bluetooth.audio.LdacChannelMode[] channelMode; + android.hardware.bluetooth.audio.LdacQualityIndex[] qualityIndex; + byte[] bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacChannelMode.aidl new file mode 100644 index 0000000000..88d6faff53 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacChannelMode.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum LdacChannelMode { + UNKNOWN = 0, + STEREO = 1, + DUAL = 2, + MONO = 3, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacConfiguration.aidl new file mode 100644 index 0000000000..8a3763800b --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacConfiguration.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable LdacConfiguration { + int sampleRateHz; + android.hardware.bluetooth.audio.LdacChannelMode channelMode; + android.hardware.bluetooth.audio.LdacQualityIndex qualityIndex; + byte bitsPerSample; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacQualityIndex.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacQualityIndex.aidl new file mode 100644 index 0000000000..35e435867e --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LdacQualityIndex.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum LdacQualityIndex { + HIGH = 0, + MID = 1, + LOW = 2, + ABR = 3, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.aidl new file mode 100644 index 0000000000..7d53b0ca8e --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable LeAudioBroadcastConfiguration { + android.hardware.bluetooth.audio.CodecType codecType; + android.hardware.bluetooth.audio.LeAudioBroadcastConfiguration.BroadcastStreamMap[] streamMap; + @VintfStability + parcelable BroadcastStreamMap { + char streamHandle; + int audioChannelAllocation; + android.hardware.bluetooth.audio.LeAudioCodecConfiguration leAudioCodecConfig; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioCodecCapabilitiesSetting.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioCodecCapabilitiesSetting.aidl new file mode 100644 index 0000000000..9818d543ac --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioCodecCapabilitiesSetting.aidl @@ -0,0 +1,40 @@ +/* + * Copyright 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 -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.bluetooth.audio; +@VintfStability +parcelable LeAudioCodecCapabilitiesSetting { + android.hardware.bluetooth.audio.UnicastCapability unicastEncodeCapability; + android.hardware.bluetooth.audio.UnicastCapability unicastDecodeCapability; + android.hardware.bluetooth.audio.BroadcastCapability broadcastCapability; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl new file mode 100644 index 0000000000..bb3d7e4b1e --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +union LeAudioCodecConfiguration { + android.hardware.bluetooth.audio.Lc3Configuration lc3Config; + android.hardware.bluetooth.audio.LeAudioCodecConfiguration.VendorConfiguration vendorConfig; + @VintfStability + parcelable VendorConfiguration { + ParcelableHolder extension; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl new file mode 100644 index 0000000000..edb6795ddc --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl @@ -0,0 +1,46 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable LeAudioConfiguration { + android.hardware.bluetooth.audio.CodecType codecType; + android.hardware.bluetooth.audio.LeAudioConfiguration.StreamMap[] streamMap; + int peerDelayUs; + android.hardware.bluetooth.audio.LeAudioCodecConfiguration leAudioCodecConfig; + @VintfStability + parcelable StreamMap { + char streamHandle; + int audioChannelAllocation; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/OpusCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/OpusCapabilities.aidl new file mode 100644 index 0000000000..2781893973 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/OpusCapabilities.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable OpusCapabilities { + byte[] pcmBitDepth; + int[] samplingFrequencyHz; + int[] frameDurationUs; + int[] octetsPerFrame; + byte[] blocksPerSdu; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/OpusConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/OpusConfiguration.aidl new file mode 100644 index 0000000000..067690ede2 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/OpusConfiguration.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable OpusConfiguration { + byte pcmBitDepth; + int samplingFrequencyHz; + int frameDurationUs; + int octetsPerFrame; + byte blocksPerSdu; + android.hardware.bluetooth.audio.ChannelMode channelMode; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/PcmCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/PcmCapabilities.aidl new file mode 100644 index 0000000000..0c2f87d599 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/PcmCapabilities.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable PcmCapabilities { + int[] sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; + byte[] bitsPerSample; + int[] dataIntervalUs; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/PcmConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/PcmConfiguration.aidl new file mode 100644 index 0000000000..93d7805a33 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/PcmConfiguration.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable PcmConfiguration { + int sampleRateHz; + android.hardware.bluetooth.audio.ChannelMode channelMode; + byte bitsPerSample; + int dataIntervalUs; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/PresentationPosition.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/PresentationPosition.aidl new file mode 100644 index 0000000000..7e997e8c8f --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/PresentationPosition.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 -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.bluetooth.audio; +@VintfStability +parcelable PresentationPosition { + long remoteDeviceAudioDelayNanos; + long transmittedOctets; + android.hardware.bluetooth.audio.PresentationPosition.TimeSpec transmittedOctetsTimestamp; + @VintfStability + parcelable TimeSpec { + long tvSec; + long tvNSec; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcAllocMethod.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcAllocMethod.aidl new file mode 100644 index 0000000000..091f6d7246 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcAllocMethod.aidl @@ -0,0 +1,39 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum SbcAllocMethod { + ALLOC_MD_S = 0, + ALLOC_MD_L = 1, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcCapabilities.aidl new file mode 100644 index 0000000000..c8d7e7e74e --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcCapabilities.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable SbcCapabilities { + int[] sampleRateHz; + android.hardware.bluetooth.audio.SbcChannelMode[] channelMode; + byte[] blockLength; + byte[] numSubbands; + android.hardware.bluetooth.audio.SbcAllocMethod[] allocMethod; + byte[] bitsPerSample; + int minBitpool; + int maxBitpool; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcChannelMode.aidl new file mode 100644 index 0000000000..6441a99877 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcChannelMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum SbcChannelMode { + UNKNOWN = 0, + JOINT_STEREO = 1, + STEREO = 2, + DUAL = 3, + MONO = 4, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcConfiguration.aidl new file mode 100644 index 0000000000..8eab9c3d96 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SbcConfiguration.aidl @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable SbcConfiguration { + int sampleRateHz; + android.hardware.bluetooth.audio.SbcChannelMode channelMode; + byte blockLength; + byte numSubbands; + android.hardware.bluetooth.audio.SbcAllocMethod allocMethod; + byte bitsPerSample; + int minBitpool; + int maxBitpool; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SessionType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SessionType.aidl new file mode 100644 index 0000000000..33a3187c3b --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/SessionType.aidl @@ -0,0 +1,49 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="byte") @VintfStability +enum SessionType { + UNKNOWN = 0, + A2DP_SOFTWARE_ENCODING_DATAPATH = 1, + A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH = 2, + HEARING_AID_SOFTWARE_ENCODING_DATAPATH = 3, + LE_AUDIO_SOFTWARE_ENCODING_DATAPATH = 4, + LE_AUDIO_SOFTWARE_DECODING_DATAPATH = 5, + LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH = 6, + LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH = 7, + LE_AUDIO_BROADCAST_SOFTWARE_ENCODING_DATAPATH = 8, + LE_AUDIO_BROADCAST_HARDWARE_OFFLOAD_ENCODING_DATAPATH = 9, + A2DP_SOFTWARE_DECODING_DATAPATH = 10, + A2DP_HARDWARE_OFFLOAD_DECODING_DATAPATH = 11, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/UnicastCapability.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/UnicastCapability.aidl new file mode 100644 index 0000000000..130fef971c --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/2/android/hardware/bluetooth/audio/UnicastCapability.aidl @@ -0,0 +1,51 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable UnicastCapability { + android.hardware.bluetooth.audio.CodecType codecType; + android.hardware.bluetooth.audio.AudioLocation supportedChannel; + int deviceCount; + int channelCountPerDevice; + android.hardware.bluetooth.audio.UnicastCapability.LeAudioCodecCapabilities leAudioCodecCapabilities; + @VintfStability + parcelable VendorCapabilities { + ParcelableHolder extension; + } + @VintfStability + union LeAudioCodecCapabilities { + android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities; + android.hardware.bluetooth.audio.UnicastCapability.VendorCapabilities vendorCapabillities; + } +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/ChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/ChannelMode.aidl index c3bc7410e4..feacb80438 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/ChannelMode.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/ChannelMode.aidl @@ -37,4 +37,5 @@ enum ChannelMode { UNKNOWN = 0, MONO = 1, STEREO = 2, + DUALMONO = 3, } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl index 6efdcb745e..b00649a62d 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl @@ -49,5 +49,6 @@ parcelable CodecCapabilities { android.hardware.bluetooth.audio.AptxAdaptiveCapabilities aptxAdaptiveCapabilities; android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities; android.hardware.bluetooth.audio.CodecCapabilities.VendorCapabilities vendorCapabilities; + @nullable android.hardware.bluetooth.audio.OpusCapabilities opusCapabilities; } } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl index 77a6b1b0f2..7f5ea48d8a 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl @@ -54,5 +54,6 @@ parcelable CodecConfiguration { android.hardware.bluetooth.audio.AptxAdaptiveConfiguration aptxAdaptiveConfig; android.hardware.bluetooth.audio.Lc3Configuration lc3Config; android.hardware.bluetooth.audio.CodecConfiguration.VendorConfiguration vendorConfig; + @nullable android.hardware.bluetooth.audio.OpusConfiguration opusConfig; } } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecType.aidl index 1522cb4fd6..d1723e6dab 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecType.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecType.aidl @@ -43,4 +43,5 @@ enum CodecType { LC3 = 6, VENDOR = 7, APTX_ADAPTIVE = 8, + OPUS = 9, } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/OpusCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/OpusCapabilities.aidl new file mode 100644 index 0000000000..2781893973 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/OpusCapabilities.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable OpusCapabilities { + byte[] pcmBitDepth; + int[] samplingFrequencyHz; + int[] frameDurationUs; + int[] octetsPerFrame; + byte[] blocksPerSdu; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/OpusConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/OpusConfiguration.aidl new file mode 100644 index 0000000000..067690ede2 --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/OpusConfiguration.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@VintfStability +parcelable OpusConfiguration { + byte pcmBitDepth; + int samplingFrequencyHz; + int frameDurationUs; + int octetsPerFrame; + byte blocksPerSdu; + android.hardware.bluetooth.audio.ChannelMode channelMode; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/ChannelMode.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/ChannelMode.aidl index 66138724ae..128089edd8 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/ChannelMode.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/ChannelMode.aidl @@ -22,4 +22,5 @@ enum ChannelMode { UNKNOWN, MONO, STEREO, + DUALMONO, } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl index 9fcdf1c362..641e2d664a 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl @@ -17,11 +17,12 @@ package android.hardware.bluetooth.audio; import android.hardware.bluetooth.audio.AacCapabilities; -import android.hardware.bluetooth.audio.AptxCapabilities; import android.hardware.bluetooth.audio.AptxAdaptiveCapabilities; +import android.hardware.bluetooth.audio.AptxCapabilities; import android.hardware.bluetooth.audio.CodecType; import android.hardware.bluetooth.audio.Lc3Capabilities; import android.hardware.bluetooth.audio.LdacCapabilities; +import android.hardware.bluetooth.audio.OpusCapabilities; import android.hardware.bluetooth.audio.SbcCapabilities; /** @@ -43,6 +44,7 @@ parcelable CodecCapabilities { AptxAdaptiveCapabilities aptxAdaptiveCapabilities; Lc3Capabilities lc3Capabilities; VendorCapabilities vendorCapabilities; + @nullable OpusCapabilities opusCapabilities; } CodecType codecType; Capabilities capabilities; diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl index 5ed12e3179..8f7e4190e0 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl @@ -17,11 +17,12 @@ package android.hardware.bluetooth.audio; import android.hardware.bluetooth.audio.AacConfiguration; -import android.hardware.bluetooth.audio.AptxConfiguration; import android.hardware.bluetooth.audio.AptxAdaptiveConfiguration; +import android.hardware.bluetooth.audio.AptxConfiguration; import android.hardware.bluetooth.audio.CodecType; import android.hardware.bluetooth.audio.Lc3Configuration; import android.hardware.bluetooth.audio.LdacConfiguration; +import android.hardware.bluetooth.audio.OpusConfiguration; import android.hardware.bluetooth.audio.SbcConfiguration; /** @@ -45,6 +46,7 @@ parcelable CodecConfiguration { AptxAdaptiveConfiguration aptxAdaptiveConfig; Lc3Configuration lc3Config; VendorConfiguration vendorConfig; + @nullable OpusConfiguration opusConfig; } CodecType codecType; /** diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecType.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecType.aidl index 386876e295..34991558de 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecType.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecType.aidl @@ -28,4 +28,5 @@ enum CodecType { LC3, VENDOR, APTX_ADAPTIVE, + OPUS, } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/OpusCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/OpusCapabilities.aidl new file mode 100644 index 0000000000..5f05b3c2ab --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/OpusCapabilities.aidl @@ -0,0 +1,50 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.ChannelMode; + +/** + * Used for Hardware Encoding/Decoding Opus codec capabilities. + */ +@VintfStability +parcelable OpusCapabilities { + /* + * PCM is Input for encoder, Output for decoder + */ + byte[] pcmBitDepth; + /* + * codec-specific parameters + */ + int[] samplingFrequencyHz; + /* + * FrameDuration based on microseconds. + */ + int[] frameDurationUs; + /* + * length in octets of a codec frame + */ + int[] octetsPerFrame; + /* + * Number of blocks of codec frames per single SDU (Service Data Unit) + */ + byte[] blocksPerSdu; + /* + * Channel mode used in A2DP special audio, ignored in standard LE Audio mode + */ + ChannelMode[] channelMode; +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/OpusConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/OpusConfiguration.aidl new file mode 100644 index 0000000000..6d35a54411 --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/OpusConfiguration.aidl @@ -0,0 +1,50 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +import android.hardware.bluetooth.audio.ChannelMode; + +/** + * Used for Hardware Encoding/Decoding Opus codec configuration. + */ +@VintfStability +parcelable OpusConfiguration { + /* + * PCM is Input for encoder, Output for decoder + */ + byte pcmBitDepth; + /* + * codec-specific parameters + */ + int samplingFrequencyHz; + /* + * FrameDuration based on microseconds. + */ + int frameDurationUs; + /* + * length in octets of a codec frame + */ + int octetsPerFrame; + /* + * Number of blocks of codec frames per single SDU (Service Data Unit) + */ + byte blocksPerSdu; + /* + * Channel mode used in A2DP special audio, ignored in standard LE Audio mode + */ + ChannelMode channelMode; +} diff --git a/bluetooth/audio/aidl/default/Android.bp b/bluetooth/audio/aidl/default/Android.bp index 13a5440861..cbf23dce46 100644 --- a/bluetooth/audio/aidl/default/Android.bp +++ b/bluetooth/audio/aidl/default/Android.bp @@ -29,7 +29,7 @@ cc_library_shared { "libcutils", "libfmq", "liblog", - "android.hardware.bluetooth.audio-V1-ndk", + "android.hardware.bluetooth.audio-V2-ndk", "libbluetooth_audio_session_aidl", ], } diff --git a/bluetooth/audio/aidl/default/bluetooth_audio.xml b/bluetooth/audio/aidl/default/bluetooth_audio.xml index 1859a1a366..c4b1872333 100644 --- a/bluetooth/audio/aidl/default/bluetooth_audio.xml +++ b/bluetooth/audio/aidl/default/bluetooth_audio.xml @@ -1,6 +1,7 @@ android.hardware.bluetooth.audio + 2 IBluetoothAudioProviderFactory/default - \ No newline at end of file +
diff --git a/bluetooth/audio/aidl/vts/Android.bp b/bluetooth/audio/aidl/vts/Android.bp index feb952edf7..3aed1b38ff 100644 --- a/bluetooth/audio/aidl/vts/Android.bp +++ b/bluetooth/audio/aidl/vts/Android.bp @@ -17,7 +17,7 @@ cc_test { srcs: ["VtsHalBluetoothAudioTargetTest.cpp"], shared_libs: [ "android.hardware.audio.common-V1-ndk", - "android.hardware.bluetooth.audio-V1-ndk", + "android.hardware.bluetooth.audio-V2-ndk", "android.hardware.common-V2-ndk", "android.hardware.common.fmq-V1-ndk", "libbase", diff --git a/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.cpp b/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.cpp index b599365d21..ebd728db34 100644 --- a/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.cpp +++ b/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.cpp @@ -57,6 +57,8 @@ using aidl::android::hardware::bluetooth::audio:: LeAudioCodecCapabilitiesSetting; using aidl::android::hardware::bluetooth::audio::LeAudioCodecConfiguration; using aidl::android::hardware::bluetooth::audio::LeAudioConfiguration; +using aidl::android::hardware::bluetooth::audio::OpusCapabilities; +using aidl::android::hardware::bluetooth::audio::OpusConfiguration; using aidl::android::hardware::bluetooth::audio::PcmConfiguration; using aidl::android::hardware::bluetooth::audio::PresentationPosition; using aidl::android::hardware::bluetooth::audio::SbcAllocMethod; @@ -121,9 +123,9 @@ void copy_codec_specific(CodecConfiguration::CodecSpecific& dst, dst.set( src.get()); break; - case CodecConfiguration::CodecSpecific::lc3Config: - dst.set( - src.get()); + case CodecConfiguration::CodecSpecific::opusConfig: + dst.set( + src.get()); break; case CodecConfiguration::CodecSpecific::aptxAdaptiveConfig: dst.set( @@ -230,11 +232,12 @@ class BluetoothAudioProviderFactoryAidl ASSERT_EQ(codec_capabilities.capabilities.getTag(), CodecCapabilities::Capabilities::ldacCapabilities); break; - case CodecType::LC3: + case CodecType::OPUS: ASSERT_EQ(codec_capabilities.capabilities.getTag(), - CodecCapabilities::Capabilities::lc3Capabilities); + CodecCapabilities::Capabilities::opusCapabilities); break; case CodecType::APTX_ADAPTIVE: + case CodecType::LC3: case CodecType::VENDOR: case CodecType::UNKNOWN: break; @@ -484,39 +487,40 @@ class BluetoothAudioProviderFactoryAidl } std::vector - GetLc3CodecSpecificSupportedList(bool supported) { - std::vector lc3_codec_specifics; + GetOpusCodecSpecificSupportedList(bool supported) { + std::vector opus_codec_specifics; if (!supported) { - Lc3Configuration lc3_config{.samplingFrequencyHz = 0, - .frameDurationUs = 0}; - lc3_codec_specifics.push_back( - CodecConfiguration::CodecSpecific(lc3_config)); - return lc3_codec_specifics; + OpusConfiguration opus_config{.samplingFrequencyHz = 0, + .frameDurationUs = 0}; + opus_codec_specifics.push_back( + CodecConfiguration::CodecSpecific(opus_config)); + return opus_codec_specifics; } - GetA2dpOffloadCapabilityHelper(CodecType::LC3); + GetA2dpOffloadCapabilityHelper(CodecType::OPUS); if (temp_codec_capabilities_ == nullptr || - temp_codec_capabilities_->codecType != CodecType::LC3) { - return lc3_codec_specifics; + temp_codec_capabilities_->codecType != CodecType::OPUS) { + return opus_codec_specifics; } // parse the capability - auto& lc3_capability = + auto& opus_capability = temp_codec_capabilities_->capabilities - .get(); + .get(); // combine those parameters into one list of // CodecConfiguration::CodecSpecific - for (int32_t samplingFrequencyHz : lc3_capability.samplingFrequencyHz) { - for (int32_t frameDurationUs : lc3_capability.frameDurationUs) { - for (auto channel_mode : lc3_capability.channelMode) { - Lc3Configuration lc3_data{.samplingFrequencyHz = samplingFrequencyHz, - .channelMode = channel_mode, - .frameDurationUs = frameDurationUs}; - lc3_codec_specifics.push_back( - CodecConfiguration::CodecSpecific(lc3_data)); + for (int32_t samplingFrequencyHz : opus_capability->samplingFrequencyHz) { + for (int32_t frameDurationUs : opus_capability->frameDurationUs) { + for (auto channel_mode : opus_capability->channelMode) { + OpusConfiguration opus_data{ + .samplingFrequencyHz = samplingFrequencyHz, + .channelMode = channel_mode, + .frameDurationUs = frameDurationUs}; + opus_codec_specifics.push_back( + CodecConfiguration::CodecSpecific(opus_data)); } } } - return lc3_codec_specifics; + return opus_codec_specifics; } bool IsPcmConfigSupported(const PcmConfiguration& pcm_config) { @@ -762,23 +766,23 @@ TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl, /** * Test whether each provider of type * SessionType::A2DP_HARDWARE_ENCODING_DATAPATH can be started and stopped with - * LDAC hardware encoding config + * Opus hardware encoding config */ TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl, - StartAndEndA2dpLc3EncodingHardwareSession) { + StartAndEndA2dpOpusEncodingHardwareSession) { if (!IsOffloadSupported()) { return; } CodecConfiguration codec_config = { - .codecType = CodecType::LC3, + .codecType = CodecType::OPUS, .encodedAudioBitrate = 990000, .peerMtu = 1005, .isScmstEnabled = false, }; - auto lc3_codec_specifics = GetLc3CodecSpecificSupportedList(true); + auto opus_codec_specifics = GetOpusCodecSpecificSupportedList(true); - for (auto& codec_specific : lc3_codec_specifics) { + for (auto& codec_specific : opus_codec_specifics) { copy_codec_specific(codec_config.config, codec_specific); DataMQDesc mq_desc; auto aidl_retval = audio_provider_->startSession( @@ -855,10 +859,11 @@ TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl, case CodecType::APTX_HD: codec_specifics = GetAptxCodecSpecificSupportedList(true, false); break; - case CodecType::LC3: - codec_specifics = GetLc3CodecSpecificSupportedList(false); + case CodecType::OPUS: + codec_specifics = GetOpusCodecSpecificSupportedList(false); continue; case CodecType::APTX_ADAPTIVE: + case CodecType::LC3: case CodecType::VENDOR: case CodecType::UNKNOWN: codec_specifics.clear(); @@ -1788,23 +1793,23 @@ TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl, /** * Test whether each provider of type * SessionType::A2DP_HARDWARE_DECODING_DATAPATH can be started and stopped with - * LDAC hardware encoding config + * Opus hardware encoding config */ TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl, - StartAndEndA2dpLc3DecodingHardwareSession) { + StartAndEndA2dpOpusDecodingHardwareSession) { if (!IsOffloadSupported()) { return; } CodecConfiguration codec_config = { - .codecType = CodecType::LC3, + .codecType = CodecType::OPUS, .encodedAudioBitrate = 990000, .peerMtu = 1005, .isScmstEnabled = false, }; - auto lc3_codec_specifics = GetLc3CodecSpecificSupportedList(true); + auto opus_codec_specifics = GetOpusCodecSpecificSupportedList(true); - for (auto& codec_specific : lc3_codec_specifics) { + for (auto& codec_specific : opus_codec_specifics) { copy_codec_specific(codec_config.config, codec_specific); DataMQDesc mq_desc; auto aidl_retval = audio_provider_->startSession( @@ -1881,10 +1886,11 @@ TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl, case CodecType::APTX_HD: codec_specifics = GetAptxCodecSpecificSupportedList(true, false); break; - case CodecType::LC3: - codec_specifics = GetLc3CodecSpecificSupportedList(false); + case CodecType::OPUS: + codec_specifics = GetOpusCodecSpecificSupportedList(false); continue; case CodecType::APTX_ADAPTIVE: + case CodecType::LC3: case CodecType::VENDOR: case CodecType::UNKNOWN: codec_specifics.clear(); diff --git a/bluetooth/audio/utils/Android.bp b/bluetooth/audio/utils/Android.bp index 42f9455623..d08cb0a8e6 100644 --- a/bluetooth/audio/utils/Android.bp +++ b/bluetooth/audio/utils/Android.bp @@ -51,7 +51,7 @@ cc_library_shared { "libbinder_ndk", "libfmq", "liblog", - "android.hardware.bluetooth.audio-V1-ndk", + "android.hardware.bluetooth.audio-V2-ndk", "libhidlbase", ], } diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp index f3ca279867..7debfab73f 100644 --- a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp +++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include #include @@ -78,9 +80,9 @@ static const AptxCapabilities kDefaultOffloadAptxHdCapability = { .bitsPerSample = {24}, }; -static const Lc3Capabilities kDefaultA2dpOffloadLc3Capability = { - .samplingFrequencyHz = {44100, 48000}, - .frameDurationUs = {7500, 10000}, +static const OpusCapabilities kDefaultOffloadOpusCapability = { + .samplingFrequencyHz = {48000}, + .frameDurationUs = {10000, 20000}, .channelMode = {ChannelMode::MONO, ChannelMode::STEREO}, }; @@ -90,7 +92,7 @@ const std::vector kDefaultOffloadA2dpCodecCapabilities = { {.codecType = CodecType::LDAC, .capabilities = {}}, {.codecType = CodecType::APTX, .capabilities = {}}, {.codecType = CodecType::APTX_HD, .capabilities = {}}, - {.codecType = CodecType::LC3, .capabilities = {}}}; + {.codecType = CodecType::OPUS, .capabilities = {}}}; std::vector kDefaultOffloadLeAudioCapabilities; @@ -294,22 +296,24 @@ bool BluetoothAudioCodecs::IsOffloadAptxHdConfigurationValid( return false; } -bool BluetoothAudioCodecs::IsOffloadLc3ConfigurationValid( +bool BluetoothAudioCodecs::IsOffloadOpusConfigurationValid( const CodecConfiguration::CodecSpecific& codec_specific) { - if (codec_specific.getTag() != CodecConfiguration::CodecSpecific::lc3Config) { + if (codec_specific.getTag() != + CodecConfiguration::CodecSpecific::opusConfig) { LOG(WARNING) << __func__ << ": Invalid CodecSpecific=" << codec_specific.toString(); return false; } - const Lc3Configuration lc3_data = - codec_specific.get(); - - if (ContainedInVector(kDefaultA2dpOffloadLc3Capability.samplingFrequencyHz, - lc3_data.samplingFrequencyHz) && - ContainedInVector(kDefaultA2dpOffloadLc3Capability.frameDurationUs, - lc3_data.frameDurationUs) && - ContainedInVector(kDefaultA2dpOffloadLc3Capability.channelMode, - lc3_data.channelMode)) { + std::optional opus_data = + codec_specific.get(); + + if (opus_data.has_value() && + ContainedInVector(kDefaultOffloadOpusCapability.samplingFrequencyHz, + opus_data->samplingFrequencyHz) && + ContainedInVector(kDefaultOffloadOpusCapability.frameDurationUs, + opus_data->frameDurationUs) && + ContainedInVector(kDefaultOffloadOpusCapability.channelMode, + opus_data->channelMode)) { return true; } LOG(WARNING) << __func__ @@ -371,13 +375,14 @@ BluetoothAudioCodecs::GetA2dpOffloadCodecCapabilities( .set( kDefaultOffloadAptxHdCapability); break; - case CodecType::LC3: + case CodecType::OPUS: codec_capability.capabilities - .set( - kDefaultA2dpOffloadLc3Capability); + .set( + kDefaultOffloadOpusCapability); break; case CodecType::UNKNOWN: case CodecType::VENDOR: + case CodecType::LC3: case CodecType::APTX_ADAPTIVE: break; } @@ -438,12 +443,13 @@ bool BluetoothAudioCodecs::IsOffloadCodecConfigurationValid( return true; } break; - case CodecType::LC3: - if (IsOffloadLc3ConfigurationValid(codec_specific)) { + case CodecType::OPUS: + if (IsOffloadOpusConfigurationValid(codec_specific)) { return true; } break; case CodecType::APTX_ADAPTIVE: + case CodecType::LC3: case CodecType::UNKNOWN: case CodecType::VENDOR: break; diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.h b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.h index 0259a7e770..ed0598b975 100644 --- a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.h +++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.h @@ -18,9 +18,9 @@ #include #include -#include #include #include +#include #include #include #include @@ -71,7 +71,7 @@ class BluetoothAudioCodecs { const CodecConfiguration::CodecSpecific& codec_specific); static bool IsOffloadAptxHdConfigurationValid( const CodecConfiguration::CodecSpecific& codec_specific); - static bool IsOffloadLc3ConfigurationValid( + static bool IsOffloadOpusConfigurationValid( const CodecConfiguration::CodecSpecific& codec_specific); }; diff --git a/compatibility_matrices/compatibility_matrix.7.xml b/compatibility_matrices/compatibility_matrix.7.xml index acee459ca0..26b8d63c5c 100644 --- a/compatibility_matrices/compatibility_matrix.7.xml +++ b/compatibility_matrices/compatibility_matrix.7.xml @@ -142,6 +142,7 @@
android.hardware.bluetooth.audio + 2 IBluetoothAudioProviderFactory default diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index bf271994fb..84263b6c27 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -142,6 +142,7 @@ android.hardware.bluetooth.audio + 2 IBluetoothAudioProviderFactory default -- GitLab From e8b22c1da1e04b8a9c828f151567a2f01f951418 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Wed, 11 May 2022 17:44:47 +0000 Subject: [PATCH 794/825] Add changes to Radio V1 AIDL interfaces During the API freeze some of the sub-interfaces of radio were frozen without the latest change adding "@Javaderive(toString=true)". Instead of creating V2 with these changes, we are updating V1 to include these changes instead. The change will not break anyone downstream, and any devices built with the previous V1 will continue to work. The hashes of the original V1 interfaces are still included in the .hash files, so VTS will allow both. Steps taken: m android.hardware.radio.config-freeze-api rm aidl_api/android.hardware.radio.config/2/.hash cp -r aidl_api/android.hardware.radio.config/2/* aidl_api/android.hardware.radio.config/1/ rm -rf aidl_api/android.hardware.radio.config/2/ vim Android.bp # remove the newly created version 2 system/tools/aidl/build/hash_gen.sh aidl_api/android.hardware.radio.config/1/ latest-version aidl_api/android.hardware.radio.config/1/.hash Test: atest hal_implementation_test Bug: 225941299 Change-Id: Id14cfffd326bd664acb678f15f4129d85ce251b2 Merged-In: Id14cfffd326bd664acb678f15f4129d85ce251b2 --- radio/aidl/aidl_api/android.hardware.radio.config/1/.hash | 1 + .../1/android/hardware/radio/config/PhoneCapability.aidl | 2 +- .../1/android/hardware/radio/config/SimPortInfo.aidl | 2 +- .../1/android/hardware/radio/config/SimSlotStatus.aidl | 2 +- .../1/android/hardware/radio/config/SlotPortMapping.aidl | 2 +- radio/aidl/aidl_api/android.hardware.radio.data/1/.hash | 1 + .../1/android/hardware/radio/data/ApnAuthType.aidl | 2 +- .../1/android/hardware/radio/data/ApnTypes.aidl | 2 +- .../1/android/hardware/radio/data/DataCallFailCause.aidl | 2 +- .../1/android/hardware/radio/data/DataProfileInfo.aidl | 2 +- .../1/android/hardware/radio/data/DataRequestReason.aidl | 2 +- .../1/android/hardware/radio/data/DataThrottlingAction.aidl | 2 +- .../1/android/hardware/radio/data/EpsQos.aidl | 2 +- .../1/android/hardware/radio/data/KeepaliveRequest.aidl | 2 +- .../1/android/hardware/radio/data/KeepaliveStatus.aidl | 2 +- .../1/android/hardware/radio/data/LinkAddress.aidl | 2 +- .../1/android/hardware/radio/data/NrQos.aidl | 2 +- .../1/android/hardware/radio/data/OsAppId.aidl | 2 +- .../1/android/hardware/radio/data/PcoDataInfo.aidl | 2 +- .../1/android/hardware/radio/data/PdpProtocolType.aidl | 2 +- .../1/android/hardware/radio/data/PortRange.aidl | 2 +- .../1/android/hardware/radio/data/Qos.aidl | 2 +- .../1/android/hardware/radio/data/QosBandwidth.aidl | 2 +- .../1/android/hardware/radio/data/QosFilter.aidl | 2 +- .../1/android/hardware/radio/data/QosFilterIpsecSpi.aidl | 2 +- .../1/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl | 2 +- .../1/android/hardware/radio/data/QosFilterTypeOfService.aidl | 2 +- .../1/android/hardware/radio/data/QosSession.aidl | 2 +- .../1/android/hardware/radio/data/RouteSelectionDescriptor.aidl | 2 +- .../1/android/hardware/radio/data/SetupDataCallResult.aidl | 2 +- .../1/android/hardware/radio/data/SliceInfo.aidl | 2 +- .../1/android/hardware/radio/data/SlicingConfig.aidl | 2 +- .../1/android/hardware/radio/data/TrafficDescriptor.aidl | 2 +- .../1/android/hardware/radio/data/UrspRule.aidl | 2 +- radio/aidl/aidl_api/android.hardware.radio.messaging/1/.hash | 1 + .../hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl | 2 +- .../1/android/hardware/radio/messaging/CdmaSmsAck.aidl | 2 +- .../1/android/hardware/radio/messaging/CdmaSmsAddress.aidl | 2 +- .../1/android/hardware/radio/messaging/CdmaSmsMessage.aidl | 2 +- .../1/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl | 2 +- .../1/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl | 2 +- .../hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl | 2 +- .../1/android/hardware/radio/messaging/GsmSmsMessage.aidl | 2 +- .../1/android/hardware/radio/messaging/ImsSmsMessage.aidl | 2 +- .../1/android/hardware/radio/messaging/SendSmsResult.aidl | 2 +- .../hardware/radio/messaging/SmsAcknowledgeFailCause.aidl | 2 +- .../1/android/hardware/radio/messaging/SmsWriteArgs.aidl | 2 +- radio/aidl/aidl_api/android.hardware.radio.modem/1/.hash | 1 + .../1/android/hardware/radio/modem/ActivityStatsInfo.aidl | 2 +- .../hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl | 2 +- .../1/android/hardware/radio/modem/DeviceStateType.aidl | 2 +- .../1/android/hardware/radio/modem/HardwareConfig.aidl | 2 +- .../1/android/hardware/radio/modem/HardwareConfigModem.aidl | 2 +- .../1/android/hardware/radio/modem/HardwareConfigSim.aidl | 2 +- .../1/android/hardware/radio/modem/NvItem.aidl | 2 +- .../1/android/hardware/radio/modem/NvWriteItem.aidl | 2 +- .../1/android/hardware/radio/modem/RadioCapability.aidl | 2 +- .../1/android/hardware/radio/modem/RadioState.aidl | 2 +- .../1/android/hardware/radio/modem/ResetNvType.aidl | 2 +- radio/aidl/aidl_api/android.hardware.radio.network/1/.hash | 1 + .../hardware/radio/network/AccessTechnologySpecificInfo.aidl | 2 +- .../1/android/hardware/radio/network/BarringInfo.aidl | 2 +- .../android/hardware/radio/network/BarringTypeSpecificInfo.aidl | 2 +- .../hardware/radio/network/Cdma2000RegistrationInfo.aidl | 2 +- .../1/android/hardware/radio/network/CdmaRoamingType.aidl | 2 +- .../1/android/hardware/radio/network/CdmaSignalStrength.aidl | 2 +- .../1/android/hardware/radio/network/CellConnectionStatus.aidl | 2 +- .../1/android/hardware/radio/network/CellIdentity.aidl | 2 +- .../1/android/hardware/radio/network/CellIdentityCdma.aidl | 2 +- .../1/android/hardware/radio/network/CellIdentityGsm.aidl | 2 +- .../1/android/hardware/radio/network/CellIdentityLte.aidl | 2 +- .../1/android/hardware/radio/network/CellIdentityNr.aidl | 2 +- .../1/android/hardware/radio/network/CellIdentityTdscdma.aidl | 2 +- .../1/android/hardware/radio/network/CellIdentityWcdma.aidl | 2 +- .../1/android/hardware/radio/network/CellInfo.aidl | 2 +- .../1/android/hardware/radio/network/CellInfoCdma.aidl | 2 +- .../1/android/hardware/radio/network/CellInfoGsm.aidl | 2 +- .../1/android/hardware/radio/network/CellInfoLte.aidl | 2 +- .../1/android/hardware/radio/network/CellInfoNr.aidl | 2 +- .../android/hardware/radio/network/CellInfoRatSpecificInfo.aidl | 2 +- .../1/android/hardware/radio/network/CellInfoTdscdma.aidl | 2 +- .../1/android/hardware/radio/network/CellInfoWcdma.aidl | 2 +- .../hardware/radio/network/ClosedSubscriberGroupInfo.aidl | 2 +- .../1/android/hardware/radio/network/Domain.aidl | 2 +- .../1/android/hardware/radio/network/EutranBands.aidl | 2 +- .../android/hardware/radio/network/EutranRegistrationInfo.aidl | 2 +- .../1/android/hardware/radio/network/EvdoSignalStrength.aidl | 2 +- .../1/android/hardware/radio/network/GeranBands.aidl | 2 +- .../1/android/hardware/radio/network/GsmSignalStrength.aidl | 2 +- .../1/android/hardware/radio/network/IndicationFilter.aidl | 2 +- .../1/android/hardware/radio/network/LceDataInfo.aidl | 2 +- .../1/android/hardware/radio/network/LinkCapacityEstimate.aidl | 2 +- .../1/android/hardware/radio/network/LteSignalStrength.aidl | 2 +- .../1/android/hardware/radio/network/LteVopsInfo.aidl | 2 +- .../1/android/hardware/radio/network/NetworkScanRequest.aidl | 2 +- .../1/android/hardware/radio/network/NetworkScanResult.aidl | 2 +- .../1/android/hardware/radio/network/NgranBands.aidl | 2 +- .../android/hardware/radio/network/NrDualConnectivityState.aidl | 2 +- .../1/android/hardware/radio/network/NrIndicators.aidl | 2 +- .../1/android/hardware/radio/network/NrSignalStrength.aidl | 2 +- .../1/android/hardware/radio/network/NrVopsInfo.aidl | 2 +- .../1/android/hardware/radio/network/OperatorInfo.aidl | 2 +- .../1/android/hardware/radio/network/PhoneRestrictedState.aidl | 2 +- .../1/android/hardware/radio/network/PhysicalChannelConfig.aidl | 2 +- .../hardware/radio/network/PhysicalChannelConfigBand.aidl | 2 +- .../1/android/hardware/radio/network/RadioAccessSpecifier.aidl | 2 +- .../hardware/radio/network/RadioAccessSpecifierBands.aidl | 2 +- .../1/android/hardware/radio/network/RadioBandMode.aidl | 2 +- .../1/android/hardware/radio/network/RegState.aidl | 2 +- .../1/android/hardware/radio/network/RegStateResult.aidl | 2 +- .../1/android/hardware/radio/network/RegistrationFailCause.aidl | 2 +- .../1/android/hardware/radio/network/SignalStrength.aidl | 2 +- .../1/android/hardware/radio/network/SignalThresholdInfo.aidl | 2 +- .../1/android/hardware/radio/network/SuppSvcNotification.aidl | 2 +- .../1/android/hardware/radio/network/TdscdmaSignalStrength.aidl | 2 +- .../1/android/hardware/radio/network/UsageSetting.aidl | 2 +- .../1/android/hardware/radio/network/UtranBands.aidl | 2 +- .../1/android/hardware/radio/network/WcdmaSignalStrength.aidl | 2 +- radio/aidl/aidl_api/android.hardware.radio.sim/1/.hash | 1 + .../1/android/hardware/radio/sim/AppStatus.aidl | 2 +- .../1/android/hardware/radio/sim/CardPowerState.aidl | 2 +- .../1/android/hardware/radio/sim/CardStatus.aidl | 2 +- .../1/android/hardware/radio/sim/Carrier.aidl | 2 +- .../1/android/hardware/radio/sim/CarrierRestrictions.aidl | 2 +- .../1/android/hardware/radio/sim/CdmaSubscriptionSource.aidl | 2 +- .../1/android/hardware/radio/sim/IccIo.aidl | 2 +- .../1/android/hardware/radio/sim/IccIoResult.aidl | 2 +- .../1/android/hardware/radio/sim/ImsiEncryptionInfo.aidl | 2 +- .../1/android/hardware/radio/sim/PbReceivedStatus.aidl | 2 +- .../1/android/hardware/radio/sim/PersoSubstate.aidl | 2 +- .../1/android/hardware/radio/sim/PhonebookCapacity.aidl | 2 +- .../1/android/hardware/radio/sim/PhonebookRecordInfo.aidl | 2 +- .../1/android/hardware/radio/sim/PinState.aidl | 2 +- .../1/android/hardware/radio/sim/SelectUiccSub.aidl | 2 +- .../1/android/hardware/radio/sim/SimApdu.aidl | 2 +- .../1/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl | 2 +- .../1/android/hardware/radio/sim/SimRefreshResult.aidl | 2 +- radio/aidl/aidl_api/android.hardware.radio.voice/1/.hash | 1 + .../1/android/hardware/radio/voice/AudioQuality.aidl | 2 +- .../1/android/hardware/radio/voice/Call.aidl | 2 +- .../1/android/hardware/radio/voice/CallForwardInfo.aidl | 2 +- .../1/android/hardware/radio/voice/CdmaCallWaiting.aidl | 2 +- .../1/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl | 2 +- .../1/android/hardware/radio/voice/CdmaInformationRecord.aidl | 2 +- .../android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl | 2 +- .../1/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl | 2 +- .../1/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl | 2 +- .../hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl | 2 +- .../1/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl | 2 +- .../hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl | 2 +- .../1/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl | 2 +- .../1/android/hardware/radio/voice/CfData.aidl | 2 +- .../1/android/hardware/radio/voice/ClipStatus.aidl | 2 +- .../1/android/hardware/radio/voice/Dial.aidl | 2 +- .../1/android/hardware/radio/voice/EmergencyCallRouting.aidl | 2 +- .../1/android/hardware/radio/voice/EmergencyNumber.aidl | 2 +- .../android/hardware/radio/voice/EmergencyServiceCategory.aidl | 2 +- .../1/android/hardware/radio/voice/LastCallFailCause.aidl | 2 +- .../1/android/hardware/radio/voice/LastCallFailCauseInfo.aidl | 2 +- .../1/android/hardware/radio/voice/SrvccState.aidl | 2 +- .../1/android/hardware/radio/voice/SsInfoData.aidl | 2 +- .../1/android/hardware/radio/voice/StkCcUnsolSsResult.aidl | 2 +- .../1/android/hardware/radio/voice/TtyMode.aidl | 2 +- .../1/android/hardware/radio/voice/UssdModeType.aidl | 2 +- .../1/android/hardware/radio/voice/UusInfo.aidl | 2 +- 165 files changed, 165 insertions(+), 158 deletions(-) diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.config/1/.hash index 4d5fc89ef3..960539da6a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/1/.hash +++ b/radio/aidl/aidl_api/android.hardware.radio.config/1/.hash @@ -1 +1,2 @@ 6e0b1fb58d66a76df8f46a1a6dae5c346ea17d7b +dd9c3f8e21930f9b4c46a4125bd5f5cec90318ec diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/PhoneCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/PhoneCapability.aidl index c60200ce13..db3a4c65f3 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/PhoneCapability.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/PhoneCapability.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable PhoneCapability { byte maxActiveData; byte maxActiveInternetData; diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimPortInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimPortInfo.aidl index 5cc90176ac..b5d31ada35 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimPortInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimPortInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SimPortInfo { String iccId; int logicalSlotId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimSlotStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimSlotStatus.aidl index bc7f63ca9a..be4c08064a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimSlotStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SimSlotStatus.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SimSlotStatus { int cardState; String atr; diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SlotPortMapping.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SlotPortMapping.aidl index f38c4213d0..31271eed8d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SlotPortMapping.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/1/android/hardware/radio/config/SlotPortMapping.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SlotPortMapping { int physicalSlotId; int portId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.data/1/.hash index 986768a0e1..0c0c93608d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/.hash +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/.hash @@ -1 +1,2 @@ 21e60e4149e36bed0fe2af962995f021e88a1da7 +6d7a86008ea4fe79ced2a86b526a92618eb4c84a diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnAuthType.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnAuthType.aidl index 929cfe3ccf..86272c22eb 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnAuthType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnAuthType.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ApnAuthType { NO_PAP_NO_CHAP = 0, PAP_NO_CHAP = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnTypes.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnTypes.aidl index 980b042cdf..1518a5749e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnTypes.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/ApnTypes.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ApnTypes { NONE = 0, DEFAULT = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataCallFailCause.aidl index 6130e71a1a..d7d6983236 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataCallFailCause.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataCallFailCause.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum DataCallFailCause { NONE = 0, OPERATOR_BARRED = 8, diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataProfileInfo.aidl index 02bbf21ef3..16fada1d76 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataProfileInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataProfileInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable DataProfileInfo { int profileId; String apn; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataRequestReason.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataRequestReason.aidl index c94fa6f604..0ddaff1662 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataRequestReason.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataRequestReason.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum DataRequestReason { NORMAL = 1, SHUTDOWN = 2, diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataThrottlingAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataThrottlingAction.aidl index c0ade454dd..4f976cd593 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataThrottlingAction.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/DataThrottlingAction.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@Backing(type="byte") @VintfStability +@Backing(type="byte") @JavaDerive(toString=true) @VintfStability enum DataThrottlingAction { NO_DATA_THROTTLING = 0, THROTTLE_SECONDARY_CARRIER = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/EpsQos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/EpsQos.aidl index 36367315d6..5b9aaa0b1e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/EpsQos.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/EpsQos.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable EpsQos { int qci; android.hardware.radio.data.QosBandwidth downlink; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveRequest.aidl index 788adfbfde..592a54a90c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveRequest.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveRequest.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable KeepaliveRequest { int type; byte[] sourceAddress; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveStatus.aidl index 4729b8e194..82b0fc8ec1 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/KeepaliveStatus.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable KeepaliveStatus { int sessionHandle; int code; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/LinkAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/LinkAddress.aidl index 9aee44c4fc..48e646ea22 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/LinkAddress.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/LinkAddress.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable LinkAddress { String address; int addressProperties; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/NrQos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/NrQos.aidl index a8a169635e..62f6204038 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/NrQos.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/NrQos.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable NrQos { int fiveQi; android.hardware.radio.data.QosBandwidth downlink; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/OsAppId.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/OsAppId.aidl index 205b1e92bd..8595d5206d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/OsAppId.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/OsAppId.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable OsAppId { byte[] osAppId; } diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PcoDataInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PcoDataInfo.aidl index edfa7592df..033b12f4ee 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PcoDataInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PcoDataInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable PcoDataInfo { int cid; String bearerProto; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PdpProtocolType.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PdpProtocolType.aidl index 363cdf30b9..9771e5ccc1 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PdpProtocolType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PdpProtocolType.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PdpProtocolType { UNKNOWN = -1, IP = 0, diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PortRange.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PortRange.aidl index f3749ed7ac..470a9c11b3 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PortRange.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/PortRange.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable PortRange { int start; int end; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/Qos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/Qos.aidl index 1981721b5b..ca06e4112b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/Qos.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/Qos.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability union Qos { boolean noinit; android.hardware.radio.data.EpsQos eps; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosBandwidth.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosBandwidth.aidl index d7ebe100bd..6d4b7a9f49 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosBandwidth.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosBandwidth.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable QosBandwidth { int maxBitrateKbps; int guaranteedBitrateKbps; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilter.aidl index b9098f7f88..e22b359163 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilter.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilter.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable QosFilter { String[] localAddresses; String[] remoteAddresses; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpsecSpi.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpsecSpi.aidl index 565e49904e..4b75340276 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpsecSpi.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpsecSpi.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability union QosFilterIpsecSpi { boolean noinit; int value; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl index 16117b252b..3fb34ea375 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability union QosFilterIpv6FlowLabel { boolean noinit; int value; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterTypeOfService.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterTypeOfService.aidl index 95fda167f5..fa85b5acc3 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterTypeOfService.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosFilterTypeOfService.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability union QosFilterTypeOfService { boolean noinit; byte value; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosSession.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosSession.aidl index 53dcef0131..bbfdd2d48c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosSession.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/QosSession.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable QosSession { int qosSessionId; android.hardware.radio.data.Qos qos; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/RouteSelectionDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/RouteSelectionDescriptor.aidl index 02596a1f63..434ee7d102 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/RouteSelectionDescriptor.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/RouteSelectionDescriptor.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable RouteSelectionDescriptor { byte precedence; android.hardware.radio.data.PdpProtocolType sessionType; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SetupDataCallResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SetupDataCallResult.aidl index ff2459c0b2..83f9db61ac 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SetupDataCallResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SetupDataCallResult.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SetupDataCallResult { android.hardware.radio.data.DataCallFailCause cause; long suggestedRetryTime; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SliceInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SliceInfo.aidl index 0dd8127e1d..efe48165ee 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SliceInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SliceInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SliceInfo { byte sliceServiceType; int sliceDifferentiator; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SlicingConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SlicingConfig.aidl index 54e2f12171..b00febebaf 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SlicingConfig.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/SlicingConfig.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SlicingConfig { android.hardware.radio.data.UrspRule[] urspRules; android.hardware.radio.data.SliceInfo[] sliceInfo; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/TrafficDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/TrafficDescriptor.aidl index d5079c1d76..d7b0654970 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/TrafficDescriptor.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/TrafficDescriptor.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable TrafficDescriptor { @nullable String dnn; @nullable android.hardware.radio.data.OsAppId osAppId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/UrspRule.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/UrspRule.aidl index c0be05426c..7002fd118c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/UrspRule.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/1/android/hardware/radio/data/UrspRule.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable UrspRule { int precedence; android.hardware.radio.data.TrafficDescriptor[] trafficDescriptors; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/.hash index c70c2c86c9..b972bab2e2 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/.hash +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/.hash @@ -1 +1,2 @@ 725d66fbe595788886858e33291c8a9048825f85 +5237ec5f500627b6b844b155e356e603157f9ba6 diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl index 54e8a7b051..39e2be2f63 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaBroadcastSmsConfigInfo { int serviceCategory; int language; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAck.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAck.aidl index 0de1688f98..befdbdefb6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAck.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAck.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaSmsAck { boolean errorClass; int smsCauseCode; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAddress.aidl index 4a55745724..ab29c775dd 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAddress.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsAddress.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaSmsAddress { int digitMode; boolean isNumberModeDataNetwork; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsMessage.aidl index fdb74fb49b..867596c81b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsMessage.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsMessage.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaSmsMessage { int teleserviceId; boolean isServicePresent; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl index deb1102f0d..d67fe8c577 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaSmsSubaddress { int subaddressType; boolean odd; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl index 4969663834..b0a7f98dc6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaSmsWriteArgs { int status; android.hardware.radio.messaging.CdmaSmsMessage message; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl index 6cc7636f79..46604cabe6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable GsmBroadcastSmsConfigInfo { int fromServiceId; int toServiceId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmSmsMessage.aidl index 2937d5ca79..4df7fd2508 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmSmsMessage.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/GsmSmsMessage.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable GsmSmsMessage { String smscPdu; String pdu; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/ImsSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/ImsSmsMessage.aidl index 706bfddd49..85f62b781d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/ImsSmsMessage.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/ImsSmsMessage.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable ImsSmsMessage { android.hardware.radio.RadioTechnologyFamily tech; boolean retry; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SendSmsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SendSmsResult.aidl index 0fbec6fed1..32f7a5cb71 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SendSmsResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SendSmsResult.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SendSmsResult { int messageRef; String ackPDU; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl index b1f8ff8583..019b18539f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SmsAcknowledgeFailCause { MEMORY_CAPACITY_EXCEEDED = 211, UNSPECIFIED_ERROR = 255, diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsWriteArgs.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsWriteArgs.aidl index 1748b62cfc..489cc07068 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsWriteArgs.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/1/android/hardware/radio/messaging/SmsWriteArgs.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SmsWriteArgs { int status; String pdu; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.modem/1/.hash index 18996c56c6..a6d3c50263 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/1/.hash +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/.hash @@ -1 +1,2 @@ 8883a1066be2bbc8c65a2db115b02e3e92bbfc98 +9dee2319b599d654955c05268c1eed6ca4373b58 diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsInfo.aidl index 93940fd295..7e22ee046e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable ActivityStatsInfo { int sleepModeTimeMs; int idleModeTimeMs; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl index 798ec36ffb..08ed9a529e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable ActivityStatsTechSpecificInfo { android.hardware.radio.AccessNetwork rat; int frequencyRange; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/DeviceStateType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/DeviceStateType.aidl index 0f0006d3e4..4e8c6d7545 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/DeviceStateType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/DeviceStateType.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum DeviceStateType { POWER_SAVE_MODE = 0, CHARGING_STATE = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfig.aidl index 7593ca7a03..3a0ec2514b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfig.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfig.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable HardwareConfig { int type; String uuid; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigModem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigModem.aidl index bf7099541c..62bb160fc4 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigModem.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigModem.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable HardwareConfigModem { int rilModel; android.hardware.radio.RadioTechnology rat; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigSim.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigSim.aidl index 1b887c220e..5810982975 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigSim.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/HardwareConfigSim.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable HardwareConfigSim { String modemUuid; } diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvItem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvItem.aidl index bda4ab7884..3e276434ac 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvItem.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvItem.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum NvItem { CDMA_MEID = 1, CDMA_MIN = 2, diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvWriteItem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvWriteItem.aidl index 58e84988e8..17b7de0a74 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvWriteItem.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/NvWriteItem.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable NvWriteItem { android.hardware.radio.modem.NvItem itemId; String value; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioCapability.aidl index 5aaf5a7303..f2e2858590 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioCapability.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioCapability.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable RadioCapability { int session; int phase; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioState.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioState.aidl index 4bde770e15..57f29410c5 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/RadioState.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioState { OFF = 0, UNAVAILABLE = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ResetNvType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ResetNvType.aidl index 81f225433f..e3b5796cfc 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ResetNvType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/1/android/hardware/radio/modem/ResetNvType.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ResetNvType { RELOAD = 0, ERASE = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.network/1/.hash index 747eca4afa..43dd434edc 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/.hash +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/.hash @@ -1 +1,2 @@ ffa236a8203511b871b2d141b0f7c6d37f746bb4 +57e8e923513d80a26102e450d335e89b4346be66 diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl index 4a4a120965..28d886256d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability union AccessTechnologySpecificInfo { boolean noinit; android.hardware.radio.network.Cdma2000RegistrationInfo cdmaInfo; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringInfo.aidl index a96ef510c4..e105b39101 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable BarringInfo { int serviceType; int barringType; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringTypeSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringTypeSpecificInfo.aidl index c04cdb54bc..a81363339e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringTypeSpecificInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/BarringTypeSpecificInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable BarringTypeSpecificInfo { int factor; int timeSeconds; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl index 7d9292d9b3..74c4e29d2b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable Cdma2000RegistrationInfo { boolean cssSupported; int roamingIndicator; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaRoamingType.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaRoamingType.aidl index 54c431b015..24ec26b893 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaRoamingType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaRoamingType.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CdmaRoamingType { HOME_NETWORK = 0, AFFILIATED_ROAM = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaSignalStrength.aidl index b4aee1cdd2..e2f97bf98f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CdmaSignalStrength.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaSignalStrength { int dbm; int ecio; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellConnectionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellConnectionStatus.aidl index 066cb60594..8986d719c4 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellConnectionStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellConnectionStatus.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CellConnectionStatus { NONE = 0, PRIMARY_SERVING = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentity.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentity.aidl index 1c68e8c817..2ee92dee29 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentity.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentity.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability union CellIdentity { boolean noinit; android.hardware.radio.network.CellIdentityGsm gsm; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityCdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityCdma.aidl index 8c1fdfa92a..d659a2891c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityCdma.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityCdma.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellIdentityCdma { int networkId; int systemId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityGsm.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityGsm.aidl index 2e384e96f5..d3193be072 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityGsm.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityGsm.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellIdentityGsm { String mcc; String mnc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityLte.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityLte.aidl index c83997e130..2ae7b43e2d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityLte.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityLte.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellIdentityLte { String mcc; String mnc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityNr.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityNr.aidl index 6bdfd99af8..b30af506d8 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityNr.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityNr.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellIdentityNr { String mcc; String mnc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityTdscdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityTdscdma.aidl index 4100805d8b..e99d14771c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityTdscdma.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityTdscdma.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellIdentityTdscdma { String mcc; String mnc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityWcdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityWcdma.aidl index 907f30d0ac..12001fcd67 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityWcdma.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellIdentityWcdma.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellIdentityWcdma { String mcc; String mnc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfo.aidl index 38e0a44e95..467c6b77cc 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellInfo { boolean registered; android.hardware.radio.network.CellConnectionStatus connectionStatus; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoCdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoCdma.aidl index d171a4b7df..e3bf46b918 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoCdma.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoCdma.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellInfoCdma { android.hardware.radio.network.CellIdentityCdma cellIdentityCdma; android.hardware.radio.network.CdmaSignalStrength signalStrengthCdma; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoGsm.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoGsm.aidl index 491b6868ec..84dcd07d72 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoGsm.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoGsm.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellInfoGsm { android.hardware.radio.network.CellIdentityGsm cellIdentityGsm; android.hardware.radio.network.GsmSignalStrength signalStrengthGsm; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoLte.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoLte.aidl index 67c5a18b22..221340b06a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoLte.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoLte.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellInfoLte { android.hardware.radio.network.CellIdentityLte cellIdentityLte; android.hardware.radio.network.LteSignalStrength signalStrengthLte; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoNr.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoNr.aidl index a094600b6b..b392c1d2c7 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoNr.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoNr.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellInfoNr { android.hardware.radio.network.CellIdentityNr cellIdentityNr; android.hardware.radio.network.NrSignalStrength signalStrengthNr; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl index 4e0719cd7f..4ab0640b29 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability union CellInfoRatSpecificInfo { android.hardware.radio.network.CellInfoGsm gsm; android.hardware.radio.network.CellInfoWcdma wcdma; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoTdscdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoTdscdma.aidl index d4e0874914..138b35ce62 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoTdscdma.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoTdscdma.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellInfoTdscdma { android.hardware.radio.network.CellIdentityTdscdma cellIdentityTdscdma; android.hardware.radio.network.TdscdmaSignalStrength signalStrengthTdscdma; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoWcdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoWcdma.aidl index da19e37952..cf7b135c63 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoWcdma.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/CellInfoWcdma.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CellInfoWcdma { android.hardware.radio.network.CellIdentityWcdma cellIdentityWcdma; android.hardware.radio.network.WcdmaSignalStrength signalStrengthWcdma; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl index 5c45d93e68..fe734c8f78 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable ClosedSubscriberGroupInfo { boolean csgIndication; String homeNodebName; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Domain.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Domain.aidl index 712bbdb91e..209cf5e802 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Domain.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/Domain.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum Domain { CS = 1, PS = 2, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranBands.aidl index 6c94d156cc..57fac3f5d7 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranBands.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranBands.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EutranBands { BAND_1 = 1, BAND_2 = 2, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranRegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranRegistrationInfo.aidl index 098b57e9cd..dfbf881353 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranRegistrationInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EutranRegistrationInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable EutranRegistrationInfo { android.hardware.radio.network.LteVopsInfo lteVopsInfo; android.hardware.radio.network.NrIndicators nrIndicators; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EvdoSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EvdoSignalStrength.aidl index 7ec1635c4d..7c567119f8 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EvdoSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/EvdoSignalStrength.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable EvdoSignalStrength { int dbm; int ecio; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GeranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GeranBands.aidl index 7cb0fd5bad..135935ff8f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GeranBands.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GeranBands.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum GeranBands { BAND_T380 = 1, BAND_T410 = 2, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GsmSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GsmSignalStrength.aidl index 4142ae7781..2b53b39317 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GsmSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/GsmSignalStrength.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable GsmSignalStrength { int signalStrength; int bitErrorRate; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IndicationFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IndicationFilter.aidl index f79ff2a8b7..d9ed68ed6d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IndicationFilter.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/IndicationFilter.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum IndicationFilter { NONE = 0, ALL = -1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LceDataInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LceDataInfo.aidl index 1876465e41..27b16c11fb 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LceDataInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LceDataInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable LceDataInfo { int lastHopCapacityKbps; byte confidenceLevel; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LinkCapacityEstimate.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LinkCapacityEstimate.aidl index c34f177722..5707b8e990 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LinkCapacityEstimate.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LinkCapacityEstimate.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable LinkCapacityEstimate { int downlinkCapacityKbps; int uplinkCapacityKbps; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteSignalStrength.aidl index c7b41f1173..b5b8579305 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteSignalStrength.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable LteSignalStrength { int signalStrength; int rsrp; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteVopsInfo.aidl index 9f20b1026e..6d8dd4e83a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteVopsInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/LteVopsInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable LteVopsInfo { boolean isVopsSupported; boolean isEmcBearerSupported; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanRequest.aidl index 1e657e571b..6039740167 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanRequest.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanRequest.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable NetworkScanRequest { int type; int interval; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanResult.aidl index 3dc39406e7..4e392d0c5c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NetworkScanResult.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable NetworkScanResult { int status; android.hardware.radio.RadioError error; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NgranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NgranBands.aidl index aa60cde74f..590469076a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NgranBands.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NgranBands.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum NgranBands { BAND_1 = 1, BAND_2 = 2, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrDualConnectivityState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrDualConnectivityState.aidl index 6ee526ff2b..62c2a56c8d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrDualConnectivityState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrDualConnectivityState.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="byte") @VintfStability +@Backing(type="byte") @JavaDerive(toString=true) @VintfStability enum NrDualConnectivityState { ENABLE = 1, DISABLE = 2, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrIndicators.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrIndicators.aidl index 54f9b8f75f..88429f6f38 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrIndicators.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrIndicators.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable NrIndicators { boolean isEndcAvailable; boolean isDcNrRestricted; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrSignalStrength.aidl index 14b60a622c..98bbe6bd94 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrSignalStrength.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable NrSignalStrength { int ssRsrp; int ssRsrq; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrVopsInfo.aidl index 7f58ee17fa..e5a0a700ca 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrVopsInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/NrVopsInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable NrVopsInfo { byte vopsSupported; byte emcSupported; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/OperatorInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/OperatorInfo.aidl index c3658d9f91..034150e61f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/OperatorInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/OperatorInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable OperatorInfo { String alphaLong; String alphaShort; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhoneRestrictedState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhoneRestrictedState.aidl index dff8be052e..41555f9e3d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhoneRestrictedState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhoneRestrictedState.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PhoneRestrictedState { NONE = 0, CS_EMERGENCY = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfig.aidl index 8db6bc40da..928c6b728c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfig.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfig.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable PhysicalChannelConfig { android.hardware.radio.network.CellConnectionStatus status; android.hardware.radio.RadioTechnology rat; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfigBand.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfigBand.aidl index 50af816485..efc64a6930 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfigBand.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/PhysicalChannelConfigBand.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability union PhysicalChannelConfigBand { boolean noinit; android.hardware.radio.network.GeranBands geranBand; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifier.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifier.aidl index b412f63899..1566bb5224 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifier.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifier.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable RadioAccessSpecifier { android.hardware.radio.AccessNetwork accessNetwork; android.hardware.radio.network.RadioAccessSpecifierBands bands; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifierBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifierBands.aidl index d44a883671..a6ac12a28a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifierBands.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioAccessSpecifierBands.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability union RadioAccessSpecifierBands { boolean noinit; android.hardware.radio.network.GeranBands[] geranBands; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioBandMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioBandMode.aidl index 7266fd5e06..e9a9f6034c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioBandMode.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RadioBandMode.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioBandMode { BAND_MODE_UNSPECIFIED = 0, BAND_MODE_EURO = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegState.aidl index d10f41313d..e6e7999f6d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegState.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RegState { NOT_REG_MT_NOT_SEARCHING_OP = 0, REG_HOME = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegStateResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegStateResult.aidl index eff22166b9..f0a03aea4f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegStateResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegStateResult.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable RegStateResult { android.hardware.radio.network.RegState regState; android.hardware.radio.RadioTechnology rat; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegistrationFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegistrationFailCause.aidl index 75fcdf453d..e2cd44ce0c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegistrationFailCause.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/RegistrationFailCause.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RegistrationFailCause { NONE = 0, IMSI_UNKNOWN_IN_HLR = 2, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalStrength.aidl index 7187116fce..1c50190947 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalStrength.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SignalStrength { android.hardware.radio.network.GsmSignalStrength gsm; android.hardware.radio.network.CdmaSignalStrength cdma; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalThresholdInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalThresholdInfo.aidl index 159d9c1547..040932cf5b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalThresholdInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SignalThresholdInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SignalThresholdInfo { int signalMeasurement; int hysteresisMs; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SuppSvcNotification.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SuppSvcNotification.aidl index 541754e3ad..b62c71bd37 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SuppSvcNotification.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/SuppSvcNotification.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SuppSvcNotification { boolean isMT; int code; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/TdscdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/TdscdmaSignalStrength.aidl index a00345f16a..d74c950bde 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/TdscdmaSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/TdscdmaSignalStrength.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable TdscdmaSignalStrength { int signalStrength; int bitErrorRate; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UsageSetting.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UsageSetting.aidl index 7fdf8313d3..3ca16b5eaa 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UsageSetting.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UsageSetting.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum UsageSetting { VOICE_CENTRIC = 1, DATA_CENTRIC = 2, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UtranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UtranBands.aidl index 87d5b8535d..8be3da28f3 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UtranBands.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/UtranBands.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum UtranBands { BAND_1 = 1, BAND_2 = 2, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/WcdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/WcdmaSignalStrength.aidl index 678ace9735..91125271d2 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/WcdmaSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/1/android/hardware/radio/network/WcdmaSignalStrength.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable WcdmaSignalStrength { int signalStrength; int bitErrorRate; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.sim/1/.hash index 8d5d79aa8b..77252d7e82 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/.hash +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/.hash @@ -1 +1,2 @@ 6c75ba42a812cccc0f73ada23e5b2581dfedcacb +01cea196fdf8f5e41fda8dc41125f1cc2b96f757 diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/AppStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/AppStatus.aidl index 89d8f9a6ee..8a41fb9d90 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/AppStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/AppStatus.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable AppStatus { int appType; int appState; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardPowerState.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardPowerState.aidl index c0026ba95c..05bc13ac45 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardPowerState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardPowerState.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CardPowerState { POWER_DOWN = 0, POWER_UP = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardStatus.aidl index cf37a0d9e1..9000d43506 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CardStatus.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CardStatus { int cardState; android.hardware.radio.sim.PinState universalPinState; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/Carrier.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/Carrier.aidl index c7fced175f..cc56888f31 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/Carrier.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/Carrier.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable Carrier { String mcc; String mnc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CarrierRestrictions.aidl index 85cf86e41f..944f1ca981 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CarrierRestrictions.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CarrierRestrictions.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CarrierRestrictions { android.hardware.radio.sim.Carrier[] allowedCarriers; android.hardware.radio.sim.Carrier[] excludedCarriers; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CdmaSubscriptionSource.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CdmaSubscriptionSource.aidl index 50e768c10e..13469f3d6a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CdmaSubscriptionSource.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/CdmaSubscriptionSource.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CdmaSubscriptionSource { RUIM_SIM = 0, NV = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIo.aidl index 3e4dcf6730..5a312dc4fd 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable IccIo { int command; int fileId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIoResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIoResult.aidl index 58e43ebcca..6c6bde2012 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIoResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/IccIoResult.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable IccIoResult { int sw1; int sw2; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/ImsiEncryptionInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/ImsiEncryptionInfo.aidl index 087f399ce7..05e71cd102 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/ImsiEncryptionInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/ImsiEncryptionInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable ImsiEncryptionInfo { String mcc; String mnc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PbReceivedStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PbReceivedStatus.aidl index 61babacce2..5e96fc6f22 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PbReceivedStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PbReceivedStatus.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@Backing(type="byte") @VintfStability +@Backing(type="byte") @JavaDerive(toString=true) @VintfStability enum PbReceivedStatus { PB_RECEIVED_OK = 1, PB_RECEIVED_ERROR = 2, diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PersoSubstate.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PersoSubstate.aidl index a09d7816c9..e33769e812 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PersoSubstate.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PersoSubstate.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PersoSubstate { UNKNOWN = 0, IN_PROGRESS = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookCapacity.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookCapacity.aidl index c1fa765de7..7531c9638a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookCapacity.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookCapacity.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable PhonebookCapacity { int maxAdnRecords; int usedAdnRecords; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookRecordInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookRecordInfo.aidl index 36bc9201e7..2e96a4bf54 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookRecordInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PhonebookRecordInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable PhonebookRecordInfo { int recordId; String name; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PinState.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PinState.aidl index c78b92c70b..5cdc6d17d4 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PinState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/PinState.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PinState { UNKNOWN = 0, ENABLED_NOT_VERIFIED = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SelectUiccSub.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SelectUiccSub.aidl index 4842fbe6df..02121e632c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SelectUiccSub.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SelectUiccSub.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SelectUiccSub { int slot; int appIndex; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimApdu.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimApdu.aidl index d8e1dde370..2201345695 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimApdu.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimApdu.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SimApdu { int sessionId; int cla; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl index 6fd89d50c6..4ded3e96ec 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SimLockMultiSimPolicy { NO_MULTISIM_POLICY = 0, ONE_VALID_SIM_MUST_BE_PRESENT = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimRefreshResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimRefreshResult.aidl index dd3c1f2cf3..69bf4767d3 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimRefreshResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/1/android/hardware/radio/sim/SimRefreshResult.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SimRefreshResult { int type; int efId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/.hash b/radio/aidl/aidl_api/android.hardware.radio.voice/1/.hash index 5434224346..fd705aff5c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/.hash +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/.hash @@ -1 +1,2 @@ bc19c55b40e9ed285c21b6c1aaa66fe855bf031b +e9ffc70247a89e6c1e526c6334c37da46f33ebea diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/AudioQuality.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/AudioQuality.aidl index 89bd2dcf5b..15669ac483 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/AudioQuality.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/AudioQuality.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum AudioQuality { UNSPECIFIED = 0, AMR = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Call.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Call.aidl index 7f445314b6..10d2ee751b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Call.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Call.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable Call { int state; int index; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CallForwardInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CallForwardInfo.aidl index 7ef9e46387..8e7aaab565 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CallForwardInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CallForwardInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CallForwardInfo { int status; int reason; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaCallWaiting.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaCallWaiting.aidl index 9edf1e7e75..310f9a0fac 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaCallWaiting.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaCallWaiting.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaCallWaiting { String number; int numberPresentation; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl index b373aa5dc0..b6b562c028 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaDisplayInfoRecord { String alphaBuf; const int CDMA_ALPHA_INFO_BUFFER_LENGTH = 64; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaInformationRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaInformationRecord.aidl index cc4d3fa11e..24ae775479 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaInformationRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaInformationRecord.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaInformationRecord { int name; android.hardware.radio.voice.CdmaDisplayInfoRecord[] display; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl index d7f6cd4e2c..e34b3937b4 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaLineControlInfoRecord { byte lineCtrlPolarityIncluded; byte lineCtrlToggle; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl index 26a7df544d..aeb0347d67 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaNumberInfoRecord { String number; byte numberType; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl index 5ea4e50546..7877fda730 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CdmaOtaProvisionStatus { SPL_UNLOCKED = 0, SPC_RETRIES_EXCEEDED = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl index f0f2b04c95..b61b91b34f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaRedirectingNumberInfoRecord { android.hardware.radio.voice.CdmaNumberInfoRecord redirectingNumber; int redirectingReason; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl index 2ebb3960ba..6c7b264476 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaSignalInfoRecord { boolean isPresent; byte signalType; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl index 33e2c2bd3f..438231cbad 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaT53AudioControlInfoRecord { byte upLink; byte downLink; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl index 457fd18f75..1b254f56a0 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CdmaT53ClirInfoRecord { byte cause; } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CfData.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CfData.aidl index 744e7ae7fa..7e799c7b03 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CfData.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/CfData.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable CfData { android.hardware.radio.voice.CallForwardInfo[] cfInfo; const int NUM_SERVICE_CLASSES = 7; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/ClipStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/ClipStatus.aidl index dafc2b9d36..3fbb0d8f7f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/ClipStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/ClipStatus.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ClipStatus { CLIP_PROVISIONED = 0, CLIP_UNPROVISIONED = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Dial.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Dial.aidl index c9a02a91c4..2b2e7590bc 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Dial.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/Dial.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable Dial { String address; int clir; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyCallRouting.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyCallRouting.aidl index b31a661158..07f011d349 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyCallRouting.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyCallRouting.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EmergencyCallRouting { UNKNOWN = 0, EMERGENCY = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyNumber.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyNumber.aidl index 39bcf1a20e..98df8cd625 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyNumber.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyNumber.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable EmergencyNumber { String number; String mcc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyServiceCategory.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyServiceCategory.aidl index 34d3c40eb3..042dd6155e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyServiceCategory.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/EmergencyServiceCategory.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EmergencyServiceCategory { UNSPECIFIED = 0, POLICE = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCause.aidl index 3e178405df..1740134ef0 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCause.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCause.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum LastCallFailCause { UNOBTAINABLE_NUMBER = 1, NO_ROUTE_TO_DESTINATION = 3, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCauseInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCauseInfo.aidl index af75a4063a..221acf7306 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCauseInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/LastCallFailCauseInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable LastCallFailCauseInfo { android.hardware.radio.voice.LastCallFailCause causeCode; String vendorCause; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SrvccState.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SrvccState.aidl index 8e7e9fbdf7..864374b508 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SrvccState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SrvccState.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SrvccState { HANDOVER_STARTED = 0, HANDOVER_COMPLETED = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SsInfoData.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SsInfoData.aidl index 9517847ada..f18b404605 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SsInfoData.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/SsInfoData.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable SsInfoData { int[] ssInfo; const int SS_INFO_MAX = 4; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/StkCcUnsolSsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/StkCcUnsolSsResult.aidl index 71ef7a77fc..50bb1fd35b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/StkCcUnsolSsResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/StkCcUnsolSsResult.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable StkCcUnsolSsResult { int serviceType; int requestType; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/TtyMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/TtyMode.aidl index bb0a9f1ac9..77417e8718 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/TtyMode.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/TtyMode.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum TtyMode { OFF = 0, FULL = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UssdModeType.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UssdModeType.aidl index 9a9d723ada..ad243d2de7 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UssdModeType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UssdModeType.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@Backing(type="int") @VintfStability +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum UssdModeType { NOTIFY = 0, REQUEST = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UusInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UusInfo.aidl index 0198de9bb0..931376014c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UusInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/1/android/hardware/radio/voice/UusInfo.aidl @@ -32,7 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; -@VintfStability +@JavaDerive(toString=true) @VintfStability parcelable UusInfo { int uusType; int uusDcs; -- GitLab From 431154230cc96992bb2ec2605f3f01b601293cba Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Wed, 11 May 2022 22:12:00 +0000 Subject: [PATCH 795/825] Update VtsHalAudioPolicyV1_0TargetTest to match XML changes There was a proposal for a backward-compatible XML schema change (https://android-review.googlesource.com/q/I1bf31c6bf6c57c9b79f0d5751601aa77780f1f80) which had a mistake. Express the change correctly to match the implementation. Bug: 231929160 Test: atest VtsHalAudioPolicyV1_0TargetTest Change-Id: Id581e290740a3c00ba3719a339c9bc47d730f35c Merged-In: Id581e290740a3c00ba3719a339c9bc47d730f35c (cherry picked from commit 356bb458dc5b5e79a9aee89098a49e8865baa144) --- audio/policy/1.0/xml/api/current.txt | 8 ++++---- .../1.0/xml/audio_policy_engine_configuration.xsd | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/audio/policy/1.0/xml/api/current.txt b/audio/policy/1.0/xml/api/current.txt index 14783810a0..0b77d45539 100644 --- a/audio/policy/1.0/xml/api/current.txt +++ b/audio/policy/1.0/xml/api/current.txt @@ -232,12 +232,12 @@ package audio.policy.V1_0 { public class ValueType { ctor public ValueType(); - method public int getAndroid_type(); + method public String getAndroid_type(); method public String getLiteral(); - method public int getNumerical(); - method public void setAndroid_type(int); + method public long getNumerical(); + method public void setAndroid_type(String); method public void setLiteral(String); - method public void setNumerical(int); + method public void setNumerical(long); } public class ValuesType { diff --git a/audio/policy/1.0/xml/audio_policy_engine_configuration.xsd b/audio/policy/1.0/xml/audio_policy_engine_configuration.xsd index 852ea77dac..3ce12e709b 100644 --- a/audio/policy/1.0/xml/audio_policy_engine_configuration.xsd +++ b/audio/policy/1.0/xml/audio_policy_engine_configuration.xsd @@ -189,10 +189,20 @@ - - + + + + + + + + + + + + -- GitLab From 9b7f79cbf66c62d9831d84563913ba8206e86ef1 Mon Sep 17 00:00:00 2001 From: Seth Moore Date: Thu, 5 May 2022 11:01:33 -0700 Subject: [PATCH 796/825] Clean up description of IRemotelyProvisionedComponent uniqueId The identifier is to be used in telemetry to identify problematic implementations. Thus, it needs to be globally consistent, at least within a given device type. Test: None -- doc only changes Bug: 231495834 Change-Id: Ia55db336fa099d8e1196f6bfe2bafb6fa5ead329 Merged-In: Ia55db336fa099d8e1196f6bfe2bafb6fa5ead329 --- .../android/hardware/security/keymint/RpcHardwareInfo.aidl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/security/keymint/aidl/android/hardware/security/keymint/RpcHardwareInfo.aidl b/security/keymint/aidl/android/hardware/security/keymint/RpcHardwareInfo.aidl index 3a4c233cf5..0cb33ce91e 100644 --- a/security/keymint/aidl/android/hardware/security/keymint/RpcHardwareInfo.aidl +++ b/security/keymint/aidl/android/hardware/security/keymint/RpcHardwareInfo.aidl @@ -59,13 +59,17 @@ parcelable RpcHardwareInfo { * client should NOT interpret the content of the identifier in any way. The client can only * compare identifiers to determine if two IRemotelyProvisionedComponents share the same * implementation. Each IRemotelyProvisionedComponent implementation must have a distinct - * identifier from all other implementations on the same device. + * identifier from all other implementations, and it must be consistent across all devices. + * It's critical that this identifier not be usable to uniquely identify a specific device. * * This identifier must be consistent across reboots, as it is used to store and track * provisioned keys in a persistent, on-device database. * * uniqueId may not be empty, and must not be any longer than 32 characters. * + * A recommended construction for this value is "[Vendor] [Component Name] [Major Version]", + * e.g. "Google Trusty KeyMint 1". + * * This field was added in API version 2. * */ -- GitLab From 2f5764315b58ffe9da487b7eb5c34ca668eb9568 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Thu, 12 May 2022 15:53:48 -0700 Subject: [PATCH 797/825] Gralloc: AIDL HAL may replace HIDL HAL. Relax the requirement on compatibility matrices that HIDL allocator HAL must exist on devices with target level 3~6, because they may have the AIDL Gralloc HAL instead. Use DeviceManifestTest.GrallocHal to enforce the requirement. Also fix comments. Bug: 232003062 Test: TH Change-Id: Ia00a9bdb15a39ebeb1ad74f3c922fe7923d7542d --- compatibility_matrices/compatibility_matrix.3.xml | 5 ++++- compatibility_matrices/compatibility_matrix.4.xml | 5 ++++- compatibility_matrices/compatibility_matrix.5.xml | 5 ++++- compatibility_matrices/compatibility_matrix.6.xml | 5 ++++- compatibility_matrices/compatibility_matrix.current.xml | 6 +++++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.3.xml b/compatibility_matrices/compatibility_matrix.3.xml index 468735d2ba..0964c9964c 100644 --- a/compatibility_matrices/compatibility_matrix.3.xml +++ b/compatibility_matrices/compatibility_matrix.3.xml @@ -183,7 +183,10 @@ default - + + android.hardware.graphics.allocator 2.0 diff --git a/compatibility_matrices/compatibility_matrix.4.xml b/compatibility_matrices/compatibility_matrix.4.xml index 96f291ff83..8ef0b3ad27 100644 --- a/compatibility_matrices/compatibility_matrix.4.xml +++ b/compatibility_matrices/compatibility_matrix.4.xml @@ -187,7 +187,10 @@ default - + + android.hardware.graphics.allocator 2.0 3.0 diff --git a/compatibility_matrices/compatibility_matrix.5.xml b/compatibility_matrices/compatibility_matrix.5.xml index 3642814f7e..12b85c7724 100644 --- a/compatibility_matrices/compatibility_matrix.5.xml +++ b/compatibility_matrices/compatibility_matrix.5.xml @@ -208,7 +208,10 @@ default - + + android.hardware.graphics.allocator 2.0 diff --git a/compatibility_matrices/compatibility_matrix.6.xml b/compatibility_matrices/compatibility_matrix.6.xml index 9c42cb0647..e19d2dd12e 100644 --- a/compatibility_matrices/compatibility_matrix.6.xml +++ b/compatibility_matrices/compatibility_matrix.6.xml @@ -238,7 +238,10 @@ default - + + android.hardware.graphics.allocator 2.0 diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml index bf271994fb..ce5766078d 100644 --- a/compatibility_matrices/compatibility_matrix.current.xml +++ b/compatibility_matrices/compatibility_matrix.current.xml @@ -277,9 +277,13 @@ default + android.hardware.graphics.allocator - + 2.0 3.0 4.0 -- GitLab From ec60f0582321d8bdc172778d460bbe8633328933 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Tue, 17 May 2022 16:48:24 -0400 Subject: [PATCH 798/825] identity: Remove test to check if Identity Credential is implemented. This requirement has been punted to Android 14. Bug: 217197568 Test: N/A Change-Id: I93f6db2a32a6bf093c1af53e0ae2f4a8a49aca53 (cherry picked from commit 52a6780b93847e7c104ff375aedb9b6b6dad1943) Merged-In: I93f6db2a32a6bf093c1af53e0ae2f4a8a49aca53 --- identity/aidl/vts/Android.bp | 13 ---- .../vts/IdentityCredentialImplementedTest.xml | 22 ------- .../IdentityCredentialImplementedTest.java | 64 ------------------- 3 files changed, 99 deletions(-) delete mode 100644 identity/aidl/vts/IdentityCredentialImplementedTest.xml delete mode 100644 identity/aidl/vts/src/com/android/tests/security/identity/IdentityCredentialImplementedTest.java diff --git a/identity/aidl/vts/Android.bp b/identity/aidl/vts/Android.bp index fee58a48a1..51ab110ebd 100644 --- a/identity/aidl/vts/Android.bp +++ b/identity/aidl/vts/Android.bp @@ -59,16 +59,3 @@ cc_test { ], require_root: true, } - -java_test_host { - name: "IdentityCredentialImplementedTest", - libs: [ - "tradefed", - "vts-core-tradefed-harness", - ], - srcs: ["src/**/*.java"], - test_suites: [ - "vts", - ], - test_config: "IdentityCredentialImplementedTest.xml", -} diff --git a/identity/aidl/vts/IdentityCredentialImplementedTest.xml b/identity/aidl/vts/IdentityCredentialImplementedTest.xml deleted file mode 100644 index 1d76a74db4..0000000000 --- a/identity/aidl/vts/IdentityCredentialImplementedTest.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/identity/aidl/vts/src/com/android/tests/security/identity/IdentityCredentialImplementedTest.java b/identity/aidl/vts/src/com/android/tests/security/identity/IdentityCredentialImplementedTest.java deleted file mode 100644 index 19568af497..0000000000 --- a/identity/aidl/vts/src/com/android/tests/security/identity/IdentityCredentialImplementedTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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. - */ -package com.android.tests.security.identity; - -import static org.junit.Assert.fail; -import static org.junit.Assume.assumeTrue; - -import android.platform.test.annotations.RequiresDevice; -import com.android.tradefed.device.DeviceNotAvailableException; -import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; -import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test; -import org.junit.Test; -import org.junit.runner.RunWith; - -@RunWith(DeviceJUnit4ClassRunner.class) -public class IdentityCredentialImplementedTest extends BaseHostJUnit4Test { - // Returns the ro.vendor.api_level or 0 if not set. - // - // Throws NumberFormatException if ill-formatted. - // - // Throws DeviceNotAvailableException if device is not available. - // - private int getVendorApiLevel() throws NumberFormatException, DeviceNotAvailableException { - String vendorApiLevelString = - getDevice().executeShellCommand("getprop ro.vendor.api_level").trim(); - if (vendorApiLevelString.isEmpty()) { - return 0; - } - return Integer.parseInt(vendorApiLevelString); - } - - // As of Android 13 (API level 32), Identity Credential is required at feature version 202201 - // or newer. - // - @RequiresDevice - @Test - public void testIdentityCredentialIsImplemented() throws Exception { - int vendorApiLevel = getVendorApiLevel(); - assumeTrue(vendorApiLevel >= 32); - - final String minimumFeatureVersionNeeded = "202201"; - - String result = getDevice().executeShellCommand( - "pm has-feature android.hardware.identity_credential " - + minimumFeatureVersionNeeded); - if (!result.trim().equals("true")) { - fail("Identity Credential feature version " + minimumFeatureVersionNeeded - + " required but not found"); - } - } -} -- GitLab From 479ec9e172e9b302512171e1f236e90ccdfe6597 Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Wed, 18 May 2022 15:59:32 -0700 Subject: [PATCH 799/825] VTS setSystemSelectionChannels maintain current state Test: atest VtsHalRadioTargetTest Bug: 231271472 Change-Id: If261f548da102963130b8cd669eb6392c9270f9a --- radio/aidl/vts/radio_network_response.cpp | 3 ++- radio/aidl/vts/radio_network_test.cpp | 24 +++++++++++++++++++---- radio/aidl/vts/radio_network_utils.h | 1 + 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/radio/aidl/vts/radio_network_response.cpp b/radio/aidl/vts/radio_network_response.cpp index 666d617771..2292c549ca 100644 --- a/radio/aidl/vts/radio_network_response.cpp +++ b/radio/aidl/vts/radio_network_response.cpp @@ -109,8 +109,9 @@ ndk::ScopedAStatus RadioNetworkResponse::getSignalStrengthResponse( } ndk::ScopedAStatus RadioNetworkResponse::getSystemSelectionChannelsResponse( - const RadioResponseInfo& info, const std::vector& /*specifier*/) { + const RadioResponseInfo& info, const std::vector& specifiers) { rspInfo = info; + this->specifiers = specifiers; 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 0bae3748da..c83571ee0a 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -769,6 +769,16 @@ TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_Geran) { */ TEST_P(RadioNetworkTest, setSystemSelectionChannels) { serial = GetRandomSerialNumber(); + ndk::ScopedAStatus res = radio_network->getSystemSelectionChannels(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + if (radioRsp_network->specifiers.size() == 0) { + // TODO (b/189255895): Throw an error once getSystemSelectionChannels is functional. + ALOGI("Skipped the test due to empty system selection channels."); + GTEST_SKIP(); + } + std::vector originalSpecifiers = radioRsp_network->specifiers; RadioAccessSpecifierBands bandP900 = RadioAccessSpecifierBands::make( @@ -781,8 +791,8 @@ TEST_P(RadioNetworkTest, setSystemSelectionChannels) { RadioAccessSpecifier specifier850 = { .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}}; - ndk::ScopedAStatus res = - radio_network->setSystemSelectionChannels(serial, true, {specifierP900, specifier850}); + serial = GetRandomSerialNumber(); + res = radio_network->setSystemSelectionChannels(serial, true, {specifierP900, specifier850}); ASSERT_OK(res); EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); @@ -795,8 +805,8 @@ TEST_P(RadioNetworkTest, setSystemSelectionChannels) { if (radioRsp_network->rspInfo.error == RadioError::NONE) { serial = GetRandomSerialNumber(); - ndk::ScopedAStatus res = radio_network->setSystemSelectionChannels( - serial, false, {specifierP900, specifier850}); + res = radio_network->setSystemSelectionChannels(serial, false, + {specifierP900, specifier850}); ASSERT_OK(res); EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); @@ -805,6 +815,12 @@ TEST_P(RadioNetworkTest, setSystemSelectionChannels) { toString(radioRsp_network->rspInfo.error).c_str()); EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error); } + + serial = GetRandomSerialNumber(); + res = radio_network->setSystemSelectionChannels(serial, true, originalSpecifiers); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); } /* diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h index 29ba2f282e..29f20e8dbd 100644 --- a/radio/aidl/vts/radio_network_utils.h +++ b/radio/aidl/vts/radio_network_utils.h @@ -45,6 +45,7 @@ class RadioNetworkResponse : public BnRadioNetworkResponse { CellIdentity barringCellIdentity; std::vector barringInfoList; UsageSetting usageSetting; + std::vector specifiers; virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; -- GitLab From ceae2a604e9fab4a65e626d253d0bfecfe83828f Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Wed, 11 May 2022 22:12:00 +0000 Subject: [PATCH 800/825] Update VtsHalAudioPolicyV1_0TargetTest to match XML changes There was a proposal for a backward-compatible XML schema change (https://android-review.googlesource.com/q/I1bf31c6bf6c57c9b79f0d5751601aa77780f1f80) which had a mistake. Express the change correctly to match the implementation. Bug: 231929160 Test: atest VtsHalAudioPolicyV1_0TargetTest Change-Id: Id581e290740a3c00ba3719a339c9bc47d730f35c (cherry picked from commit 356bb458dc5b5e79a9aee89098a49e8865baa144) Merged-In: Id581e290740a3c00ba3719a339c9bc47d730f35c --- audio/policy/1.0/xml/api/current.txt | 8 ++++---- .../1.0/xml/audio_policy_engine_configuration.xsd | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/audio/policy/1.0/xml/api/current.txt b/audio/policy/1.0/xml/api/current.txt index 14783810a0..0b77d45539 100644 --- a/audio/policy/1.0/xml/api/current.txt +++ b/audio/policy/1.0/xml/api/current.txt @@ -232,12 +232,12 @@ package audio.policy.V1_0 { public class ValueType { ctor public ValueType(); - method public int getAndroid_type(); + method public String getAndroid_type(); method public String getLiteral(); - method public int getNumerical(); - method public void setAndroid_type(int); + method public long getNumerical(); + method public void setAndroid_type(String); method public void setLiteral(String); - method public void setNumerical(int); + method public void setNumerical(long); } public class ValuesType { diff --git a/audio/policy/1.0/xml/audio_policy_engine_configuration.xsd b/audio/policy/1.0/xml/audio_policy_engine_configuration.xsd index 852ea77dac..3ce12e709b 100644 --- a/audio/policy/1.0/xml/audio_policy_engine_configuration.xsd +++ b/audio/policy/1.0/xml/audio_policy_engine_configuration.xsd @@ -189,10 +189,20 @@ - - + + + + + + + + + + + + -- GitLab From 124c3cde03785d535f6c7fccbe67a72da24a4442 Mon Sep 17 00:00:00 2001 From: Maxim Pleshivenkov Date: Fri, 20 May 2022 17:49:31 +0000 Subject: [PATCH 801/825] Update flag value Set ENABLE_HIBERNATION_FLAG to a correct value. Flag is used as a bitmask, and should set single bit. Bug: 233373476 Change-Id: Ia60cdb3c9c344b3606ea07ed411ed6325a71c396 Test: atest CarServiceUnitTest --- .../aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash | 2 +- .../automotive/vehicle/VehicleApPowerStateConfigFlag.aidl | 2 +- .../automotive/vehicle/VehicleApPowerStateConfigFlag.aidl | 2 +- .../automotive/vehicle/VehicleApPowerStateConfigFlag.aidl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash index 7bb15e8f53..f4785043b5 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/.hash @@ -1 +1 @@ -38469e5a0359c95015bea304c463b686cf4ee9ca +8610b651e162c614a97542d6f4ed039c969823e5 diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl index 7e48eba788..d7b874a0be 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/1/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl @@ -36,5 +36,5 @@ package android.hardware.automotive.vehicle; enum VehicleApPowerStateConfigFlag { ENABLE_DEEP_SLEEP_FLAG = 1, CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 2, - ENABLE_HIBERNATION_FLAG = 3, + ENABLE_HIBERNATION_FLAG = 4, } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl index 7e48eba788..d7b874a0be 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl @@ -36,5 +36,5 @@ package android.hardware.automotive.vehicle; enum VehicleApPowerStateConfigFlag { ENABLE_DEEP_SLEEP_FLAG = 1, CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 2, - ENABLE_HIBERNATION_FLAG = 3, + ENABLE_HIBERNATION_FLAG = 4, } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl index 4d8e2f5045..8b0190cea4 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleApPowerStateConfigFlag.aidl @@ -37,5 +37,5 @@ enum VehicleApPowerStateConfigFlag { * (via VehicleApPowerStateShutdownParam#CAN_HIBERNATE or * VehicleApPowerStateShutdownParam#HIBERNATE_IMMEDIATELY flags) */ - ENABLE_HIBERNATION_FLAG = 0x3, + ENABLE_HIBERNATION_FLAG = 0x4, } -- GitLab From aff537b777f4ce0f0d41fef30981d7424b285a83 Mon Sep 17 00:00:00 2001 From: jimblackler Date: Thu, 19 May 2022 21:19:16 +0000 Subject: [PATCH 802/825] Do not enforce GAME_LOADING in VTS Test: N/A Bug: 232500898 Change-Id: I3800d721e978f44e3477b60451a83ff8c08120aa --- power/aidl/vts/VtsHalPowerTargetTest.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/power/aidl/vts/VtsHalPowerTargetTest.cpp b/power/aidl/vts/VtsHalPowerTargetTest.cpp index e0ca87f496..2cfa04ada9 100644 --- a/power/aidl/vts/VtsHalPowerTargetTest.cpp +++ b/power/aidl/vts/VtsHalPowerTargetTest.cpp @@ -211,19 +211,6 @@ TEST_P(PowerAidl, hasFixedPerformance) { } } -// GAME_LOADING mode is required for all devices which ship on Android T -// or later -TEST_P(PowerAidl, hasGameLoading) { - auto apiLevel = GetUintProperty("ro.vendor.api_level", 0); - ASSERT_NE(apiLevel, 0); - - if (apiLevel >= 33) { - bool supported; - ASSERT_TRUE(power->isModeSupported(Mode::GAME_LOADING, &supported).isOk()); - ASSERT_TRUE(supported); - } -} - GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(PowerAidl); INSTANTIATE_TEST_SUITE_P(Power, PowerAidl, testing::ValuesIn(::android::getAidlHalInstanceNames(IPower::descriptor)), -- GitLab From 07ef191b5a16f08cef8518827c3cd7a66f387b51 Mon Sep 17 00:00:00 2001 From: Sunil Ravi Date: Tue, 17 May 2022 18:01:06 -0700 Subject: [PATCH 803/825] wifi: Clear ring bufffers on detecting buffer corruption While appending the newly received buffer to ring buffer list, check the size of the first buffer in the ring buffer list. If it is invalid(zero size or exceeding the max allowed size), return failure & clear all the ring buffers. Bug: 232477451 Test: vts test - 1.6/default/tests/runtests.sh Test: Manual - Ran basic wifi tests & checked bugreports Change-Id: Iaa41262f534914b971fe178053f1974248a46e70 --- wifi/1.6/default/ringbuffer.cpp | 12 +++++++++--- wifi/1.6/default/ringbuffer.h | 10 +++++++++- wifi/1.6/default/wifi_chip.cpp | 14 +++++++++++++- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/wifi/1.6/default/ringbuffer.cpp b/wifi/1.6/default/ringbuffer.cpp index 6d4ed843c3..981bf7bce7 100644 --- a/wifi/1.6/default/ringbuffer.cpp +++ b/wifi/1.6/default/ringbuffer.cpp @@ -26,20 +26,26 @@ namespace implementation { Ringbuffer::Ringbuffer(size_t maxSize) : size_(0), maxSize_(maxSize) {} -void Ringbuffer::append(const std::vector& input) { +enum Ringbuffer::AppendStatus Ringbuffer::append(const std::vector& input) { if (input.size() == 0) { - return; + return AppendStatus::FAIL_IP_BUFFER_ZERO; } if (input.size() > maxSize_) { LOG(INFO) << "Oversized message of " << input.size() << " bytes is dropped"; - return; + return AppendStatus::FAIL_IP_BUFFER_EXCEEDED_MAXSIZE; } data_.push_back(input); size_ += input.size() * sizeof(input[0]); while (size_ > maxSize_) { + if (data_.front().size() <= 0 || data_.front().size() > maxSize_) { + LOG(ERROR) << "First buffer in the ring buffer is Invalid. Size: " + << data_.front().size(); + return AppendStatus::FAIL_RING_BUFFER_CORRUPTED; + } size_ -= data_.front().size() * sizeof(data_.front()[0]); data_.pop_front(); } + return AppendStatus::SUCCESS; } const std::list>& Ringbuffer::getData() const { diff --git a/wifi/1.6/default/ringbuffer.h b/wifi/1.6/default/ringbuffer.h index 8571a9f3d4..c6a1e4c52d 100644 --- a/wifi/1.6/default/ringbuffer.h +++ b/wifi/1.6/default/ringbuffer.h @@ -31,11 +31,19 @@ namespace implementation { */ class Ringbuffer { public: + // Error codes for the append ring buffer operation + enum AppendStatus { + SUCCESS, + FAIL_GENERIC, + FAIL_IP_BUFFER_ZERO, + FAIL_IP_BUFFER_EXCEEDED_MAXSIZE, + FAIL_RING_BUFFER_CORRUPTED + }; explicit Ringbuffer(size_t maxSize); // Appends the data buffer and deletes from the front until buffer is // within |maxSize_|. - void append(const std::vector& input); + enum AppendStatus append(const std::vector& input); const std::list>& getData() const; void clear(); diff --git a/wifi/1.6/default/wifi_chip.cpp b/wifi/1.6/default/wifi_chip.cpp index f062409d4e..c7c00b17fd 100644 --- a/wifi/1.6/default/wifi_chip.cpp +++ b/wifi/1.6/default/wifi_chip.cpp @@ -1613,6 +1613,7 @@ WifiStatus WifiChip::registerDebugRingBufferCallback() { return; } WifiDebugRingBufferStatus hidl_status; + Ringbuffer::AppendStatus appendstatus; if (!hidl_struct_util::convertLegacyDebugRingBufferStatusToHidl(status, &hidl_status)) { LOG(ERROR) << "Error converting ring buffer status"; @@ -1623,13 +1624,19 @@ WifiStatus WifiChip::registerDebugRingBufferCallback() { const auto& target = shared_ptr_this->ringbuffer_map_.find(name); if (target != shared_ptr_this->ringbuffer_map_.end()) { Ringbuffer& cur_buffer = target->second; - cur_buffer.append(data); + appendstatus = cur_buffer.append(data); } else { LOG(ERROR) << "Ringname " << name << " not found"; return; } // unique_lock unlocked here } + if (appendstatus == Ringbuffer::AppendStatus::FAIL_RING_BUFFER_CORRUPTED) { + LOG(ERROR) << "Ringname " << name << " is corrupted. Clear the ring buffer"; + shared_ptr_this->writeRingbufferFilesInternal(); + return; + } + }; legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->registerRingBufferCallbackHandler( getFirstActiveWlanIfaceName(), on_ring_buffer_data_callback); @@ -1971,6 +1978,11 @@ bool WifiChip::writeRingbufferFilesInternal() { } unique_fd file_auto_closer(dump_fd); for (const auto& cur_block : cur_buffer.getData()) { + if (cur_block.size() <= 0 || cur_block.size() > kMaxBufferSizeBytes) { + PLOG(ERROR) << "Ring buffer: " << item.first + << " is corrupted. Invalid block size: " << cur_block.size(); + break; + } if (write(dump_fd, cur_block.data(), sizeof(cur_block[0]) * cur_block.size()) == -1) { PLOG(ERROR) << "Error writing to file"; -- GitLab From 38ccfd7a299ca7f6088cf70ae8d37d3ab487a2c2 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Mon, 16 May 2022 20:20:28 +0000 Subject: [PATCH 804/825] Tweak IMapper 4.0 VTS to run with AIDL IAllocator When there is no HIDL IAllocator installed on the device, then these tests must still run. Bug: 231982605 Test: VtsHalGraphicsMapperV4_0TargetTest Change-Id: If7503d398c03086df470971cc2c10029270525f9 --- graphics/composer/2.1/utils/vts/Android.bp | 2 + .../composer/2.1/utils/vts/ComposerVts.cpp | 2 +- .../composer/2.1/vts/functional/Android.bp | 9 +- graphics/composer/2.2/utils/vts/Android.bp | 2 + .../composer/2.2/utils/vts/ComposerVts.cpp | 2 +- .../composer/2.2/vts/functional/Android.bp | 4 + .../composer/2.3/vts/functional/Android.bp | 9 +- graphics/composer/2.4/utils/vts/Android.bp | 1 + .../composer/2.4/vts/functional/Android.bp | 9 +- graphics/mapper/4.0/utils/vts/Android.bp | 7 ++ graphics/mapper/4.0/utils/vts/MapperVts.cpp | 108 +++++++++++------- .../vts/include/mapper-vts/4.0/MapperVts.h | 35 +++++- graphics/mapper/4.0/vts/functional/Android.bp | 9 +- .../VtsHalGraphicsMapperV4_0TargetTest.cpp | 45 ++++++-- 14 files changed, 183 insertions(+), 61 deletions(-) diff --git a/graphics/composer/2.1/utils/vts/Android.bp b/graphics/composer/2.1/utils/vts/Android.bp index 8732d53a44..c0a0c078b2 100644 --- a/graphics/composer/2.1/utils/vts/Android.bp +++ b/graphics/composer/2.1/utils/vts/Android.bp @@ -32,6 +32,7 @@ cc_library_static { "TestCommandReader.cpp", ], static_libs: [ + "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.composer@2.1", "android.hardware.graphics.mapper@2.0-vts", "android.hardware.graphics.mapper@3.0-vts", @@ -39,6 +40,7 @@ cc_library_static { "libgtest", ], export_static_lib_headers: [ + "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.composer@2.1", "android.hardware.graphics.mapper@2.0-vts", "android.hardware.graphics.mapper@3.0-vts", diff --git a/graphics/composer/2.1/utils/vts/ComposerVts.cpp b/graphics/composer/2.1/utils/vts/ComposerVts.cpp index 55aaf12b8e..e777010483 100644 --- a/graphics/composer/2.1/utils/vts/ComposerVts.cpp +++ b/graphics/composer/2.1/utils/vts/ComposerVts.cpp @@ -318,7 +318,7 @@ Gralloc::Gralloc() { [this] { ASSERT_NO_FATAL_FAILURE(mGralloc4 = std::make_shared("default", "default", /*errOnFailure=*/false)); - if (mGralloc4->getAllocator() == nullptr || mGralloc4->getMapper() == nullptr) { + if (!mGralloc4->hasAllocator() || mGralloc4->getMapper() == nullptr) { mGralloc4 = nullptr; ASSERT_NO_FATAL_FAILURE(mGralloc3 = std::make_shared("default", "default", /*errOnFailure=*/false)); diff --git a/graphics/composer/2.1/vts/functional/Android.bp b/graphics/composer/2.1/vts/functional/Android.bp index 9ffd7d52e0..502036edb4 100644 --- a/graphics/composer/2.1/vts/functional/Android.bp +++ b/graphics/composer/2.1/vts/functional/Android.bp @@ -32,14 +32,17 @@ cc_test { // TODO(b/64437680): Assume these libs are always available on the device. shared_libs: [ "libbase", + "libbinder_ndk", "libfmq", "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-V1-ndk", "android.hardware.graphics.allocator@2.0", "android.hardware.graphics.allocator@3.0", "android.hardware.graphics.allocator@4.0", @@ -49,10 +52,14 @@ cc_test { "android.hardware.graphics.mapper@2.1-vts", "android.hardware.graphics.mapper@3.0-vts", "android.hardware.graphics.mapper@4.0-vts", + "libaidlcommonsupport", ], header_libs: [ "android.hardware.graphics.composer@2.1-command-buffer", ], disable_framework: true, - test_suites: ["general-tests", "vts"], + test_suites: [ + "general-tests", + "vts", + ], } diff --git a/graphics/composer/2.2/utils/vts/Android.bp b/graphics/composer/2.2/utils/vts/Android.bp index aa8e541edb..cca53230ae 100644 --- a/graphics/composer/2.2/utils/vts/Android.bp +++ b/graphics/composer/2.2/utils/vts/Android.bp @@ -35,6 +35,7 @@ cc_library_static { "libui", ], static_libs: [ + "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.composer@2.1-vts", "android.hardware.graphics.composer@2.2", "android.hardware.graphics.composer3-V1-ndk", @@ -52,6 +53,7 @@ cc_library_static { "android.hardware.graphics.mapper@4.0-vts", ], export_static_lib_headers: [ + "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.composer@2.1-vts", "android.hardware.graphics.composer@2.2", "android.hardware.graphics.mapper@2.1-vts", diff --git a/graphics/composer/2.2/utils/vts/ComposerVts.cpp b/graphics/composer/2.2/utils/vts/ComposerVts.cpp index a526137c41..7de4007d01 100644 --- a/graphics/composer/2.2/utils/vts/ComposerVts.cpp +++ b/graphics/composer/2.2/utils/vts/ComposerVts.cpp @@ -184,7 +184,7 @@ Gralloc::Gralloc() { ALOGD("Attempting to initialize gralloc4"); ASSERT_NO_FATAL_FAILURE(mGralloc4 = std::make_shared("default", "default", /*errOnFailure=*/false)); - if (mGralloc4->getMapper() == nullptr || mGralloc4->getAllocator() == nullptr) { + if (mGralloc4->getMapper() == nullptr || !mGralloc4->hasAllocator()) { mGralloc4 = nullptr; ALOGD("Failed to initialize gralloc4, initializing gralloc3"); ASSERT_NO_FATAL_FAILURE(mGralloc3 = std::make_shared("default", "default", diff --git a/graphics/composer/2.2/vts/functional/Android.bp b/graphics/composer/2.2/vts/functional/Android.bp index dd519e7e6e..960b62da8a 100644 --- a/graphics/composer/2.2/vts/functional/Android.bp +++ b/graphics/composer/2.2/vts/functional/Android.bp @@ -45,18 +45,21 @@ cc_test { "libGLESv1_CM", "libGLESv2", "libbase", + "libbinder_ndk", "libfmq", "libgui", "libhidlbase", "libprocessgroup", "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-V1-ndk", "android.hardware.graphics.allocator@2.0", "android.hardware.graphics.allocator@3.0", "android.hardware.graphics.allocator@4.0", @@ -70,6 +73,7 @@ cc_test { "android.hardware.graphics.mapper@2.1-vts", "android.hardware.graphics.mapper@3.0-vts", "android.hardware.graphics.mapper@4.0-vts", + "libaidlcommonsupport", "libgtest", "librenderengine", "libshaders", diff --git a/graphics/composer/2.3/vts/functional/Android.bp b/graphics/composer/2.3/vts/functional/Android.bp index 70384ac62e..40b77d5a15 100644 --- a/graphics/composer/2.3/vts/functional/Android.bp +++ b/graphics/composer/2.3/vts/functional/Android.bp @@ -32,15 +32,18 @@ cc_test { // TODO(b/64437680): Assume these libs are always available on the device. shared_libs: [ "libbase", + "libbinder_ndk", "libfmq", "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-V1-ndk", "android.hardware.graphics.allocator@2.0", "android.hardware.graphics.allocator@3.0", "android.hardware.graphics.allocator@4.0", @@ -54,6 +57,7 @@ cc_test { "android.hardware.graphics.mapper@2.1-vts", "android.hardware.graphics.mapper@3.0-vts", "android.hardware.graphics.mapper@4.0-vts", + "libaidlcommonsupport", ], header_libs: [ "android.hardware.graphics.composer@2.1-command-buffer", @@ -61,5 +65,8 @@ cc_test { "android.hardware.graphics.composer@2.3-command-buffer", ], disable_framework: true, - test_suites: ["general-tests", "vts"], + test_suites: [ + "general-tests", + "vts", + ], } diff --git a/graphics/composer/2.4/utils/vts/Android.bp b/graphics/composer/2.4/utils/vts/Android.bp index 5ef861c4f7..de3197573d 100644 --- a/graphics/composer/2.4/utils/vts/Android.bp +++ b/graphics/composer/2.4/utils/vts/Android.bp @@ -32,6 +32,7 @@ cc_library_static { "TestCommandReader.cpp", ], static_libs: [ + "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.composer@2.1", "android.hardware.graphics.composer@2.2", "android.hardware.graphics.composer@2.3-vts", diff --git a/graphics/composer/2.4/vts/functional/Android.bp b/graphics/composer/2.4/vts/functional/Android.bp index 22ae7c48cf..b73ea9403e 100644 --- a/graphics/composer/2.4/vts/functional/Android.bp +++ b/graphics/composer/2.4/vts/functional/Android.bp @@ -32,14 +32,17 @@ cc_test { // TODO(b/64437680): Assume these libs are always available on the device. shared_libs: [ "libbase", + "libbinder_ndk", "libfmq", "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-V1-ndk", "android.hardware.graphics.allocator@2.0", "android.hardware.graphics.allocator@3.0", "android.hardware.graphics.allocator@4.0", @@ -55,6 +58,7 @@ cc_test { "android.hardware.graphics.mapper@2.1-vts", "android.hardware.graphics.mapper@3.0-vts", "android.hardware.graphics.mapper@4.0-vts", + "libaidlcommonsupport", ], header_libs: [ "android.hardware.graphics.composer@2.1-command-buffer", @@ -63,5 +67,8 @@ cc_test { "android.hardware.graphics.composer@2.4-command-buffer", ], disable_framework: true, - test_suites: ["general-tests", "vts"], + test_suites: [ + "general-tests", + "vts", + ], } diff --git a/graphics/mapper/4.0/utils/vts/Android.bp b/graphics/mapper/4.0/utils/vts/Android.bp index 633149805c..7abf5dba24 100644 --- a/graphics/mapper/4.0/utils/vts/Android.bp +++ b/graphics/mapper/4.0/utils/vts/Android.bp @@ -32,14 +32,21 @@ cc_library_static { "-g", ], static_libs: [ + "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.allocator@4.0", + "android.hardware.graphics.common-V3-ndk", "android.hardware.graphics.mapper@4.0", + "libaidlcommonsupport", ], shared_libs: [ + "libbinder_ndk", "libgralloctypes", + "libvndksupport", ], export_static_lib_headers: [ + "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.allocator@4.0", + "android.hardware.graphics.common-V3-ndk", "android.hardware.graphics.mapper@4.0", ], export_include_dirs: ["include"], diff --git a/graphics/mapper/4.0/utils/vts/MapperVts.cpp b/graphics/mapper/4.0/utils/vts/MapperVts.cpp index 4a6f68da26..e4a2535a92 100644 --- a/graphics/mapper/4.0/utils/vts/MapperVts.cpp +++ b/graphics/mapper/4.0/utils/vts/MapperVts.cpp @@ -14,7 +14,9 @@ * limitations under the License. */ +#include #include +#include #include #include @@ -35,8 +37,14 @@ Gralloc::Gralloc(const std::string& allocatorServiceName, const std::string& map } void Gralloc::init(const std::string& allocatorServiceName, const std::string& mapperServiceName) { - mAllocator = IAllocator::getService(allocatorServiceName); - ASSERT_NE(nullptr, mAllocator.get()) << "failed to get allocator service"; + mAidlAllocator = aidl::android::hardware::graphics::allocator::IAllocator::fromBinder( + ndk::SpAIBinder(AServiceManager_checkService(allocatorServiceName.c_str()))); + + if (mAidlAllocator == nullptr) { + mHidlAllocator = IAllocator::getService(allocatorServiceName); + } + ASSERT_TRUE(nullptr != mAidlAllocator || mHidlAllocator != nullptr) + << "failed to get allocator service"; mMapper = IMapper::getService(mapperServiceName); ASSERT_NE(nullptr, mMapper.get()) << "failed to get mapper service"; @@ -45,7 +53,12 @@ void Gralloc::init(const std::string& allocatorServiceName, const std::string& m void Gralloc::initNoErr(const std::string& allocatorServiceName, const std::string& mapperServiceName) { - mAllocator = IAllocator::getService(allocatorServiceName); + mAidlAllocator = aidl::android::hardware::graphics::allocator::IAllocator::fromBinder( + ndk::SpAIBinder(AServiceManager_checkService(allocatorServiceName.c_str()))); + + if (mAidlAllocator == nullptr) { + mHidlAllocator = IAllocator::getService(allocatorServiceName); + } mMapper = IMapper::getService(mapperServiceName); if (mMapper.get()) { @@ -68,10 +81,6 @@ Gralloc::~Gralloc() { mImportedBuffers.clear(); } -sp Gralloc::getAllocator() const { - return mAllocator; -} - const native_handle_t* Gralloc::cloneBuffer(const hidl_handle& rawHandle, enum Tolerance /*tolerance*/) { const native_handle_t* bufferHandle = native_handle_clone(rawHandle.getNativeHandle()); @@ -90,40 +99,40 @@ std::vector Gralloc::allocate(const BufferDescriptor& de uint32_t* outStride) { std::vector bufferHandles; bufferHandles.reserve(count); - mAllocator->allocate(descriptor, count, - [&](const auto& tmpError, const auto& tmpStride, const auto& tmpBuffers) { - if (canTolerate(tolerance, tmpError)) { - return; - } - - if (tmpError != Error::NONE) { - if (base::GetIntProperty("ro.vendor.build.version.sdk", 0, 0, - INT_MAX) < 33) { - GTEST_SKIP() << "Old vendor grallocs may not support P010"; - } else { - GTEST_FAIL() << "failed to allocate buffers"; - } - } - ASSERT_EQ(count, tmpBuffers.size()) << "invalid buffer array"; - - for (uint32_t i = 0; i < count; i++) { - const native_handle_t* bufferHandle = nullptr; - if (import) { - ASSERT_NO_FATAL_FAILURE( - bufferHandle = importBuffer(tmpBuffers[i], tolerance)); - } else { - ASSERT_NO_FATAL_FAILURE( - bufferHandle = cloneBuffer(tmpBuffers[i], tolerance)); - } - if (bufferHandle) { - bufferHandles.push_back(bufferHandle); - } - } - - if (outStride) { - *outStride = tmpStride; - } - }); + + auto callback = [&](Error error, uint32_t stride, + const hidl_vec& buffers) -> void { + if (canTolerate(tolerance, error)) { + return; + } + + if (error != Error::NONE) { + if (base::GetIntProperty("ro.vendor.build.version.sdk", 0, 0, INT_MAX) < 33) { + GTEST_SKIP() << "Old vendor grallocs may not support P010"; + } else { + GTEST_FAIL() << "failed to allocate buffers"; + } + } + ASSERT_EQ(count, buffers.size()) << "invalid buffer array"; + + for (uint32_t i = 0; i < count; i++) { + const native_handle_t* bufferHandle = nullptr; + if (import) { + ASSERT_NO_FATAL_FAILURE(bufferHandle = importBuffer(buffers[i], tolerance)); + } else { + ASSERT_NO_FATAL_FAILURE(bufferHandle = cloneBuffer(buffers[i], tolerance)); + } + if (bufferHandle) { + bufferHandles.push_back(bufferHandle); + } + } + + if (outStride) { + *outStride = stride; + } + }; + + rawAllocate(descriptor, count, callback); if (::testing::Test::HasFatalFailure()) { bufferHandles.clear(); @@ -147,6 +156,23 @@ const native_handle_t* Gralloc::allocate(const IMapper::BufferDescriptorInfo& de return buffers[0]; } +void Gralloc::rawAllocate( + const BufferDescriptor& descriptor, uint32_t count, + std::function&)> callback) { + if (mAidlAllocator) { + aidl::android::hardware::graphics::allocator::AllocationResult result; + auto status = mAidlAllocator->allocate(descriptor, count, &result); + const Error error = toHidlError(status); + std::vector handles; + for (const auto& aidlHandle : result.buffers) { + handles.push_back(hidl_handle(makeFromAidl(aidlHandle))); + } + callback(error, result.stride, handles); + } else { + mHidlAllocator->allocate(descriptor, count, callback); + } +} + sp Gralloc::getMapper() const { return mMapper; } diff --git a/graphics/mapper/4.0/utils/vts/include/mapper-vts/4.0/MapperVts.h b/graphics/mapper/4.0/utils/vts/include/mapper-vts/4.0/MapperVts.h index c5406c90b0..b956e494aa 100644 --- a/graphics/mapper/4.0/utils/vts/include/mapper-vts/4.0/MapperVts.h +++ b/graphics/mapper/4.0/utils/vts/include/mapper-vts/4.0/MapperVts.h @@ -20,6 +20,8 @@ #include #include +#include +#include #include #include #include @@ -51,9 +53,33 @@ class Gralloc { const std::string& mapperServiceName = "default", bool errOnFailure = true); ~Gralloc(); + static Error toHidlError(aidl::android::hardware::graphics::allocator::AllocationError error) { + switch (error) { + case aidl::android::hardware::graphics::allocator::AllocationError::BAD_DESCRIPTOR: + return Error::BAD_DESCRIPTOR; + case aidl::android::hardware::graphics::allocator::AllocationError::NO_RESOURCES: + return Error::NO_RESOURCES; + case aidl::android::hardware::graphics::allocator::AllocationError::UNSUPPORTED: + return Error::UNSUPPORTED; + } + } + static Error toHidlError(const ndk::ScopedAStatus& status) { + if (status.isOk()) { + return Error::NONE; + } + + if (status.getExceptionCode() != EX_SERVICE_SPECIFIC) { + return Error::NO_RESOURCES; + } + + return toHidlError( + static_cast( + status.getServiceSpecificError())); + } + // IAllocator methods - sp getAllocator() const; + bool hasAllocator() { return mHidlAllocator != nullptr || mAidlAllocator != nullptr; } // When import is false, this simply calls IAllocator::allocate. When import // is true, the returned buffers are also imported into the mapper. @@ -81,6 +107,10 @@ class Gralloc { return allocate(descriptorInfo, import, Tolerance::kToleranceStrict, outStride); } + // Dispatches directly to the allocator + void rawAllocate(const BufferDescriptor& descriptor, uint32_t count, + std::function&)> callback); + // IMapper methods sp getMapper() const; @@ -143,7 +173,8 @@ class Gralloc { return cloneBuffer(rawHandle, Tolerance::kToleranceStrict); } - sp mAllocator; + sp mHidlAllocator; + std::shared_ptr mAidlAllocator; sp mMapper; // Keep track of all cloned and imported handles. When a test fails with diff --git a/graphics/mapper/4.0/vts/functional/Android.bp b/graphics/mapper/4.0/vts/functional/Android.bp index 65bc38029d..e83063367d 100644 --- a/graphics/mapper/4.0/vts/functional/Android.bp +++ b/graphics/mapper/4.0/vts/functional/Android.bp @@ -25,20 +25,27 @@ package { cc_test { name: "VtsHalGraphicsMapperV4_0TargetTest", - defaults: ["VtsHalTargetTestDefaults"], + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], srcs: ["VtsHalGraphicsMapperV4_0TargetTest.cpp"], static_libs: [ "android.hardware.graphics.common-V3-ndk", "android.hardware.graphics.mapper@4.0-vts", + "libaidlcommonsupport", "libgralloctypes", "libsync", ], shared_libs: [ + "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.allocator@4.0", "android.hardware.graphics.common@1.0", "android.hardware.graphics.common@1.1", "android.hardware.graphics.common@1.2", "android.hardware.graphics.mapper@4.0", + "libbinder_ndk", + "libvndksupport", ], header_libs: [ "libsystem_headers", diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp index 2aac337ca7..5a450e385a 100644 --- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp +++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp @@ -21,8 +21,12 @@ #include #include +#include +#include +#include #include #include +#include #include #include @@ -72,7 +76,7 @@ class GraphicsMapperHidlTest void SetUp() override { ASSERT_NO_FATAL_FAILURE(mGralloc = std::make_unique(std::get<0>(GetParam()), std::get<1>(GetParam()))); - ASSERT_NE(nullptr, mGralloc->getAllocator().get()); + ASSERT_TRUE(mGralloc->hasAllocator()); ASSERT_NE(nullptr, mGralloc->getMapper().get()); mDummyDescriptorInfo.name = "dummy"; @@ -504,10 +508,10 @@ TEST_P(GraphicsMapperHidlTest, AllocatorAllocate) { TEST_P(GraphicsMapperHidlTest, AllocatorAllocateNegative) { // this assumes any valid descriptor is non-empty BufferDescriptor descriptor; - mGralloc->getAllocator()->allocate(descriptor, 1, - [&](const auto& tmpError, const auto&, const auto&) { - EXPECT_EQ(Error::BAD_DESCRIPTOR, tmpError); - }); + + mGralloc->rawAllocate(descriptor, 1, [&](const auto& tmpError, const auto&, const auto&) { + EXPECT_EQ(Error::BAD_DESCRIPTOR, tmpError); + }); } /** @@ -535,9 +539,9 @@ TEST_P(GraphicsMapperHidlTest, AllocatorAllocateThreaded) { std::atomic allocationCount(0); auto threadLoop = [&]() { while (!timeUp) { - mGralloc->getAllocator()->allocate( - descriptor, 1, - [&](const auto&, const auto&, const auto&) { allocationCount++; }); + mGralloc->rawAllocate(descriptor, 1, [&](const auto&, const auto&, const auto&) { + allocationCount++; + }); } }; @@ -2755,8 +2759,9 @@ TEST_P(GraphicsMapperHidlTest, GetLargeReservedRegion) { BufferDescriptor descriptor; ASSERT_NO_FATAL_FAILURE(descriptor = mGralloc->createDescriptor(info)); - Error err; - mGralloc->getAllocator()->allocate( + Error err = Error::NONE; + + mGralloc->rawAllocate( descriptor, 1, [&](const auto& tmpError, const auto&, const auto& tmpBuffers) { err = tmpError; if (err == Error::NONE) { @@ -2827,11 +2832,27 @@ TEST_P(GraphicsMapperHidlTest, GetReservedRegionBadBuffer) { } GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsMapperHidlTest); + +namespace { +std::vector getAllocatorInstances() { + std::vector instances; + for (auto halInstance : android::hardware::getAllHalInstanceNames(IAllocator::descriptor)) { + instances.emplace_back(std::move(halInstance)); + } + + for (auto aidlInstance : getAidlHalInstanceNames( + aidl::android::hardware::graphics::allocator::IAllocator::descriptor)) { + instances.emplace_back(std::move(aidlInstance)); + } + + return instances; +} +} // namespace + INSTANTIATE_TEST_CASE_P( PerInstance, GraphicsMapperHidlTest, testing::Combine( - testing::ValuesIn( - android::hardware::getAllHalInstanceNames(IAllocator::descriptor)), + testing::ValuesIn(getAllocatorInstances()), testing::ValuesIn(android::hardware::getAllHalInstanceNames(IMapper::descriptor))), android::hardware::PrintInstanceTupleNameToString<>); -- GitLab From 4bf91c7e38f72a961785126519371e278e2f6345 Mon Sep 17 00:00:00 2001 From: Avichal Rakesh Date: Mon, 23 May 2022 20:44:02 +0000 Subject: [PATCH 805/825] Camera VTS: Fix incorrect return value check The AIDL interface specificies that ICameraProvider::setCallback should return Status::ILLEGAL_ARGUMENT if the provided callback is null. The setCallback test incorrectly checked for the return value to be OK instead. This CL fixes the test to check for ILLEGAL_ARGUMENT and removes setting callback to null from setTorchMode test. In addition it fixes `setCallback` test to use Bn* variant of ICameraProviderCallback to ensure that the object makes it through the binder. Bug: 233221359 Test: atest VtsAidlHalCameraProvider_TargetTest Change-Id: Ia33226b15efd9628bf8e1b53ec2a3012b08eaaac --- .../aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp index 462698c87a..fe03732aff 100644 --- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp +++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp @@ -39,7 +39,7 @@ using ::aidl::android::hardware::camera::device::ICameraDevice; using ::aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap; using ::aidl::android::hardware::camera::metadata::SensorPixelMode; using ::aidl::android::hardware::camera::provider::CameraIdAndStreamCombination; -using ::aidl::android::hardware::camera::provider::ICameraProviderCallbackDefault; +using ::aidl::android::hardware::camera::provider::BnCameraProviderCallback; using ::ndk::ScopedAStatus; @@ -86,7 +86,7 @@ TEST_P(CameraAidlTest, getVendorTags) { // Test if ICameraProvider::setCallback returns Status::OK TEST_P(CameraAidlTest, setCallback) { - struct ProviderCb : public ICameraProviderCallbackDefault { + struct ProviderCb : public BnCameraProviderCallback { ScopedAStatus cameraDeviceStatusChange(const std::string& cameraDeviceName, CameraDeviceStatus newStatus) override { ALOGI("camera device status callback name %s, status %d", cameraDeviceName.c_str(), @@ -109,11 +109,11 @@ TEST_P(CameraAidlTest, setCallback) { } }; - std::shared_ptr cb = ProviderCb::make(); + std::shared_ptr cb = ndk::SharedRefBase::make(); ScopedAStatus ret = mProvider->setCallback(cb); ASSERT_TRUE(ret.isOk()); ret = mProvider->setCallback(nullptr); - ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(static_cast(Status::ILLEGAL_ARGUMENT), ret.getServiceSpecificError()); } // Test if ICameraProvider::getCameraDeviceInterface returns Status::OK and non-null device @@ -399,9 +399,6 @@ TEST_P(CameraAidlTest, setTorchMode) { } } } - - ret = mProvider->setCallback(nullptr); - ASSERT_TRUE(ret.isOk()); } // Check dump functionality. -- GitLab From 9f352766a9a68c6d9158426b7460da7d65bc1ed8 Mon Sep 17 00:00:00 2001 From: Avichal Rakesh Date: Mon, 23 May 2022 21:33:06 +0000 Subject: [PATCH 806/825] Camera VTS: remove duplicate function in anonymous namespace The anonymous namespace in camera_aidl_test.cpp contained a buggy implementation of `matchDeviceName` can was being called into by a few tests. This CL removes the buggy implementation and fixes the faulty calls to call into the correct function. Bug: 233252432 Bug: 233221359 Test: atest VtsAidlHalCameraProvider_TargetTest Change-Id: Icfe9bbc75e38d4d23bdcf64a048120708045b639 --- camera/provider/aidl/vts/camera_aidl_test.cpp | 34 ++++--------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp index fd83e372e8..c11fc0cd2b 100644 --- a/camera/provider/aidl/vts/camera_aidl_test.cpp +++ b/camera/provider/aidl/vts/camera_aidl_test.cpp @@ -55,26 +55,6 @@ using ::ndk::ScopedAStatus; using ::ndk::SpAIBinder; namespace { -bool matchDeviceName(const std::string& deviceName, const std::string& providerType, - std::string* deviceVersion, std::string* cameraId) { - // expected format: device@.// - std::stringstream pattern; - pattern << "device@[0-9]+\\.[0-9]+/" << providerType << "/(.+)"; - std::regex e(pattern.str()); - - std::smatch sm; - if (std::regex_match(deviceName, sm, e)) { - if (deviceVersion != nullptr) { - *deviceVersion = sm[1]; - } - if (cameraId != nullptr) { - *cameraId = sm[2]; - } - return true; - } - return false; -} - bool parseProviderName(const std::string& serviceDescriptor, std::string* type /*out*/, uint32_t* id /*out*/) { if (!type || !id) { @@ -498,13 +478,11 @@ void CameraAidlTest::allocateGraphicBuffer(uint32_t width, uint32_t height, uint bool CameraAidlTest::matchDeviceName(const std::string& deviceName, const std::string& providerType, std::string* deviceVersion, std::string* cameraId) { - // "device@/legacy/" - std::string pattern; - pattern.append("device@([0-9]+\\.[0-9]+)/"); - pattern.append(providerType); - pattern.append("/(.+)"); + // expected format: device@.// + std::stringstream pattern; + pattern << "device@([0-9]+\\.[0-9]+)/" << providerType << "/(.+)"; + std::regex e(pattern.str()); - std::regex e(pattern); std::smatch sm; if (std::regex_match(deviceName, sm, e)) { if (deviceVersion != nullptr) { @@ -1160,7 +1138,7 @@ void CameraAidlTest::verifyLogicalOrUltraHighResCameraMetadata( } std::string version, cameraId; - ASSERT_TRUE(::matchDeviceName(cameraName, mProviderType, &version, &cameraId)); + ASSERT_TRUE(matchDeviceName(cameraName, mProviderType, &version, &cameraId)); std::unordered_set physicalIds; rc = getPhysicalCameraIds(metadata, &physicalIds); ASSERT_TRUE(isUltraHighResCamera || Status::OK == rc); @@ -1192,7 +1170,7 @@ void CameraAidlTest::verifyLogicalOrUltraHighResCameraMetadata( SystemCameraKind physSystemCameraKind = SystemCameraKind::PUBLIC; for (auto& deviceName : deviceNames) { std::string publicVersion, publicId; - ASSERT_TRUE(::matchDeviceName(deviceName, mProviderType, &publicVersion, &publicId)); + ASSERT_TRUE(matchDeviceName(deviceName, mProviderType, &publicVersion, &publicId)); if (physicalId == publicId) { isPublicId = true; fullPublicId = deviceName; -- GitLab From 9ab187f1183c0096c26a7519a7ee993500943323 Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Mon, 16 May 2022 21:10:06 +0000 Subject: [PATCH 807/825] Delete HIDL 3.8 - HIDL camera device@3.8, metadata@3.8 were temporary interfaces Bug: 221108824 Test: GCA Test: Camera CTS Merged-In: I44cd1ac0e2f6647e3e9d5c60a535faf716d5ed93 Change-Id: I44cd1ac0e2f6647e3e9d5c60a535faf716d5ed93 Signed-off-by: Jayant Chowdhary (cherry picked from commit 406da449098d5afb6812d600ba76ea2bb1c16ff9) --- camera/device/3.8/Android.bp | 39 - camera/device/3.8/ICameraDevice.hal | 122 -- camera/device/3.8/ICameraDeviceCallback.hal | 34 - camera/device/3.8/ICameraDeviceSession.hal | 98 -- camera/device/3.8/types.hal | 157 --- camera/metadata/3.8/Android.bp | 27 - camera/metadata/3.8/types.hal | 244 ---- camera/provider/2.4/vts/functional/Android.bp | 2 - .../VtsHalCameraProviderV2_4TargetTest.cpp | 1220 ++--------------- 9 files changed, 100 insertions(+), 1843 deletions(-) delete mode 100644 camera/device/3.8/Android.bp delete mode 100644 camera/device/3.8/ICameraDevice.hal delete mode 100644 camera/device/3.8/ICameraDeviceCallback.hal delete mode 100644 camera/device/3.8/ICameraDeviceSession.hal delete mode 100644 camera/device/3.8/types.hal delete mode 100644 camera/metadata/3.8/Android.bp delete mode 100644 camera/metadata/3.8/types.hal diff --git a/camera/device/3.8/Android.bp b/camera/device/3.8/Android.bp deleted file mode 100644 index c3c29416a9..0000000000 --- a/camera/device/3.8/Android.bp +++ /dev/null @@ -1,39 +0,0 @@ -// This file is autogenerated by hidl-gen -Landroidbp. - -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"], -} - -hidl_interface { - name: "android.hardware.camera.device@3.8", - root: "android.hardware", - srcs: [ - "types.hal", - "ICameraDevice.hal", - "ICameraDeviceCallback.hal", - "ICameraDeviceSession.hal", - ], - interfaces: [ - "android.hardware.camera.common@1.0", - "android.hardware.camera.device@3.2", - "android.hardware.camera.device@3.3", - "android.hardware.camera.device@3.4", - "android.hardware.camera.device@3.5", - "android.hardware.camera.device@3.6", - "android.hardware.camera.device@3.7", - "android.hardware.camera.metadata@3.2", - "android.hardware.camera.metadata@3.3", - "android.hardware.camera.metadata@3.4", - "android.hardware.camera.metadata@3.5", - "android.hardware.camera.metadata@3.6", - "android.hardware.camera.metadata@3.8", - "android.hardware.graphics.common@1.0", - "android.hidl.base@1.0", - ], - gen_java: false, -} diff --git a/camera/device/3.8/ICameraDevice.hal b/camera/device/3.8/ICameraDevice.hal deleted file mode 100644 index 09edb8ba20..0000000000 --- a/camera/device/3.8/ICameraDevice.hal +++ /dev/null @@ -1,122 +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. - */ - -package android.hardware.camera.device@3.8; - -import android.hardware.camera.common@1.0::Status; -import @3.7::ICameraDevice; - -/** - * Camera device interface - * - * Supports the android.hardware.Camera API, and the android.hardware.camera2 - * API at LIMITED or better hardware level. - * - * ICameraDevice.open() must return @3.2::ICameraDeviceSession, - * @3.5::ICameraDeviceSession, @3.6::ICameraDeviceSession, - * @3.7::ICameraDeviceSession, or @3.8::ICameraDeviceSession. - */ -interface ICameraDevice extends @3.7::ICameraDevice { - /** - * turnOnTorchWithStrengthLevel: - * - * Change the brightness level of the flash unit associated with this camera device - * and set it to value in torchStrength. This function also turns ON the torch - * with specified torchStrength if the torch is OFF. - * - * The torchStrength value must be within the valid range i.e. >=1 and - * <= FLASH_INFO_STRENGTH_MAXIMUM_LEVEL. Whenever the torch is turned OFF, - * the brightness level will reset to FLASH_INFO_STRENGTH_DEFAULT_LEVEL. - * When the client calls setTorchMode(ON) after turnOnTorchWithStrengthLevel(N), - * the flash unit will have brightness level equal to N. This level does not - * represent the real brightness units. It is linear in nature i.e. flashlight - * at level 10 is twice as bright as at level 5. - * - * @param torchStrength Brightness level to be set for the flashlight. - * - * @return status Status code for the operation, one of: - * OK: - * On a successful change to the torch strength level. - * INTERNAL_ERROR: - * The flash unit cannot be operated due to an unexpected internal - * error. - * CAMERA_IN_USE: - * This status code is returned when: - * - This camera device has been opened, so the torch cannot be - * controlled until it is closed. - * - Due to other camera devices being open, or due to other - * resource constraints, the torch cannot be controlled currently. - * ILLEGAL_ARGUMENT: - * If the torchStrength value is not within the range i.e. < 1 or - * > FLASH_INFO_STRENGTH_MAXIMUM_LEVEL. - * METHOD_NOT_SUPPORTED: - * This status code is returned when: - * - This camera device does not support direct operation of flashlight - * torch mode. The framework must open the camera device and turn - * the torch on through the device interface. - * - This camera device does not have a flash unit. - * - This camera device has flash unit but does not support torch - * strength control. - * 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. - * - */ - turnOnTorchWithStrengthLevel(int32_t torchStrength) generates (Status status); - - /** - * getTorchStrengthLevel: - * - * Get current torch strength level. - * If the device supports torch strength control, when the torch is OFF the - * strength level will reset to default level, so the return - * value in this case will be equal to FLASH_INFO_STRENGTH_DEFAULT_LEVEL. - * - * @return status Status code for the operation, one of: - * OK: - * On success. - * INTERNAL_ERROR: - * An unexpected error occurred and the information is not - * available. - * METHOD_NOT_SUPPORTED: - * This status code is returned when: - * - This camera device does not support direct operation of flashlight - * torch mode. The framework must open the camera device and turn - * the torch on through the device interface. - * - This camera device does not have a flash unit. - * - This camera device has flash unit but does not support torch - * strength control. - * - * @return torchStrength Current torch strength level. - * - */ - getTorchStrengthLevel() generates (Status status, int32_t torchStrength); - - /** - * isStreamCombinationSupported_3_8: - * - * Identical to @3.7::ICameraDevice.isStreamCombinationSupported, except - * that it takes a @3.8::StreamConfiguration parameter, which could contain - * additional information about a specific 10-bit dynamic range profile or - * stream use case. - * - */ - isStreamCombinationSupported_3_8(StreamConfiguration streams) - generates (Status status, bool queryStatus); -}; diff --git a/camera/device/3.8/ICameraDeviceCallback.hal b/camera/device/3.8/ICameraDeviceCallback.hal deleted file mode 100644 index de0775d59f..0000000000 --- a/camera/device/3.8/ICameraDeviceCallback.hal +++ /dev/null @@ -1,34 +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. - */ - -package android.hardware.camera.device@3.8; - -import @3.5::ICameraDeviceCallback; - -/** - * Callback methods for the HAL to call into the framework. - */ -interface ICameraDeviceCallback extends @3.5::ICameraDeviceCallback { - /** - * Identical to @3.5::ICameraDeviceCallback.notify, except that it takes a - * list of @3.8::NotifyMsg which contain readout timestamp in addition - * to exposure start timestamp for shutter. - * - * The readout timestamp is used for the framework to re-time the viewfinder - * frames targeted for SurfaceView so that preview jitter can be reduced. - */ - notify_3_8(vec msgs); -}; diff --git a/camera/device/3.8/ICameraDeviceSession.hal b/camera/device/3.8/ICameraDeviceSession.hal deleted file mode 100644 index c3aa836ec1..0000000000 --- a/camera/device/3.8/ICameraDeviceSession.hal +++ /dev/null @@ -1,98 +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. - */ - -package android.hardware.camera.device@3.8; - -import android.hardware.camera.common@1.0::Status; -import @3.5::StreamConfiguration; -import @3.7::ICameraDeviceSession; -import @3.6::HalStreamConfiguration; - -/** - * Camera device active session interface. - * - * Obtained via ICameraDevice::open(), this interface contains the methods to - * configure and request captures from an active camera device. - */ -interface ICameraDeviceSession extends @3.7::ICameraDeviceSession { - /** - * configureStreams_3_8: - * - * Identical to @3.7::ICameraDeviceSession.configureStreams_3_7, except that: - * - * - The requestedConfiguration allows the camera framework to configure - * 10-bit dynamic range profile. - * - The requestedConfiguration allows the camera framework to configure - * stream use cases. - * - * @return status Status code for the operation, one of: - * OK: - * On successful stream configuration. - * INTERNAL_ERROR: - * If there has been a fatal error and the device is no longer - * operational. Only close() can be called successfully by the - * framework after this error is returned. - * ILLEGAL_ARGUMENT: - * If the requested stream configuration is invalid. Some examples - * of invalid stream configurations include: - * - Including more than 1 INPUT stream - * - Not including any OUTPUT streams - * - Including streams with unsupported formats, or an unsupported - * size for that format. - * - Including too many output streams of a certain format. - * - Unsupported rotation configuration - * - Stream sizes/formats don't satisfy the - * StreamConfigurationMode requirements - * for non-NORMAL mode, or the requested operation_mode is not - * supported by the HAL. - * - Unsupported usage flag - * - Unsupported stream groupIds, or unsupported multi-resolution - * input stream. - * - Invalid combination between a 10-bit dynamic range profile - * and none impl. defined 8-bit format for a particular stream. - * - Unsupported stream use case - * The camera service cannot filter out all possible illegal stream - * configurations, since some devices may support more simultaneous - * streams or larger stream resolutions than the minimum required - * for a given camera device hardware level. The HAL must return an - * ILLEGAL_ARGUMENT for any unsupported stream set, and then be - * ready to accept a future valid stream configuration in a later - * configureStreams call. - * @return halConfiguration The stream parameters desired by the HAL for - * each stream, including maximum buffers, the usage flags, and the - * override format and dataspace. - */ - configureStreams_3_8(StreamConfiguration requestedConfiguration) - generates (Status status, @3.6::HalStreamConfiguration halConfiguration); - - /** - * repeatingRequestEnd: - * - * Notification about the last frame number in a repeating request along with the - * ids of all streams included in the repeating request. - * - * This can be called at any point after 'processCaptureRequest' in response - * to camera clients disabling an active repeating request. - * - * Performance requirements: - * The call must not be blocked for extensive periods and should be extremely lightweight. There - * must be no frame rate degradation or frame jitter introduced. - * - * This method must always succeed, even if the device has encountered a - * serious error. - */ - repeatingRequestEnd(uint32_t frameNumber, vec streamIds); -}; diff --git a/camera/device/3.8/types.hal b/camera/device/3.8/types.hal deleted file mode 100644 index 04a245085b..0000000000 --- a/camera/device/3.8/types.hal +++ /dev/null @@ -1,157 +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. - */ - -package android.hardware.camera.device@3.8; - -import @3.2::ErrorMsg; -import @3.2::CameraMetadata; -import @3.2::MsgType; -import @3.2::ShutterMsg; -import @3.2::CameraMetadata; -import @3.2::StreamConfigurationMode; -import @3.7::Stream; - -import android.hardware.camera.metadata@3.8::CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap; -import android.hardware.camera.metadata@3.8::CameraMetadataEnumAndroidScalerAvailableStreamUseCases; - -/** - * ShutterMsg: - * - * Message contents for MsgType::SHUTTER - * - * This version extends the @3.2 ShutterMsg with the readout timestamp. - */ -struct ShutterMsg { - /** - * The definition of ShutterMsg from prior version. - */ - @3.2::ShutterMsg v3_2; - - /** - * Timestamp for the capture readout. This must be in the same time domain - * as v3_2.timestamp, and for a rolling shutter sensor, the value must be - * v3_2.timestamp + exposureTime + t_crop_top where t_crop_top is the exposure time - * skew of the cropped lines on the top. - */ - uint64_t readoutTimestamp; -}; - -/** - * NotifyMsg: - * - * The message structure sent to ICameraDevice3Callback::notify() - * - * This version extends the @3.2 NotifyMsg with the @3.8 version of ShutterMsg. - */ -struct NotifyMsg { - /** - * The message type. - */ - @3.2::MsgType type; - - union Message { - /** - * Error message contents. Valid if type is MsgType::ERROR - */ - @3.2::ErrorMsg error; - - /** - * Shutter message contents. Valid if type is MsgType::SHUTTER - */ - ShutterMsg shutter; - } msg; -}; - -/** - * Stream: - * - * A descriptor for a single camera input or output stream. A stream is defined - * by the framework by its buffer resolution and format, and additionally by the - * HAL with the gralloc usage flags and the maximum in-flight buffer count. - * - * This version extends the @3.7 Stream with the dynamic range profile and the - * stream use case field. - */ -struct Stream { - /** - * The definition of Stream from the prior version. - */ - @3.7::Stream v3_7; - - /** - * The dynamic range profile for this stream. - * - * This field is valid and must only be considered for streams with format - * android.hardware.graphics.common.PixelFormat.YCBCR_P010 or - * android.hardware.graphics.common.PixelFormat.IMPLEMENTATION_DEFINED on devices supporting the - * ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_10_BIT capability. - * - */ - CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap dynamicRangeProfile; - - /** - * The stream use case describing the stream's purpose - * - * This flag provides the camera device a hint on what user scenario this - * stream is intended for. With this flag, the camera device can optimize - * camera pipeline parameters, such as tuning, sensor mode, and ISP settings, - * for the intended use case. - * - * When this field is set to DEFAULT, the camera device should behave in - * the same way as in previous HAL versions, and optimize the camera pipeline - * based on stream format, data space, usage flag, and other stream properties. - * - * The HAL reports supported stream use cases in - * ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES. If the HAL doesn't support - * setting stream use cases, the camera framework leaves this field as - * DEFAULT. - */ - CameraMetadataEnumAndroidScalerAvailableStreamUseCases useCase; -}; - -/** - * StreamConfiguration: - * - * Identical to @3.7::StreamConfiguration, except that the streams - * vector contains @3.8::Stream. - */ -struct StreamConfiguration { - /** - * An array of camera stream pointers, defining the input/output - * configuration for the camera HAL device. - */ - vec streams; - - /** - * The definition of operation mode from prior version. - */ - @3.2::StreamConfigurationMode operationMode; - - /** - * The definition of session parameters from prior version. - */ - @3.2::CameraMetadata sessionParams; - - /** - * The definition of stream configuration counter from prior version. - */ - uint32_t streamConfigCounter; - - /** - * The definition of multi-resolution input image flag from prior version. - */ - bool multiResolutionInputImage; -}; diff --git a/camera/metadata/3.8/Android.bp b/camera/metadata/3.8/Android.bp deleted file mode 100644 index ead9543812..0000000000 --- a/camera/metadata/3.8/Android.bp +++ /dev/null @@ -1,27 +0,0 @@ -// This file is autogenerated by hidl-gen -Landroidbp. - -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"], -} - -hidl_interface { - name: "android.hardware.camera.metadata@3.8", - root: "android.hardware", - srcs: [ - "types.hal", - ], - interfaces: [ - "android.hardware.camera.metadata@3.2", - "android.hardware.camera.metadata@3.3", - "android.hardware.camera.metadata@3.4", - "android.hardware.camera.metadata@3.5", - "android.hardware.camera.metadata@3.6", - "android.hardware.camera.metadata@3.7", - ], - gen_java: true, -} diff --git a/camera/metadata/3.8/types.hal b/camera/metadata/3.8/types.hal deleted file mode 100644 index 8cc6646799..0000000000 --- a/camera/metadata/3.8/types.hal +++ /dev/null @@ -1,244 +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. - */ - -/* - * Autogenerated from camera metadata definitions in - * /system/media/camera/docs/metadata_definitions.xml - * *** DO NOT EDIT BY HAND *** - */ - -package android.hardware.camera.metadata@3.8; - -import android.hardware.camera.metadata@3.2; -import android.hardware.camera.metadata@3.3; -import android.hardware.camera.metadata@3.4; -import android.hardware.camera.metadata@3.5; -import android.hardware.camera.metadata@3.6; -import android.hardware.camera.metadata@3.7; - -/** - * Top level hierarchy definitions for camera metadata. *_INFO sections are for - * the static metadata that can be retrieved without opening the camera device. - */ -enum CameraMetadataSection : @3.4::CameraMetadataSection { - ANDROID_AUTOMOTIVE = - android.hardware.camera.metadata@3.4::CameraMetadataSection:ANDROID_SECTION_COUNT, - - ANDROID_AUTOMOTIVE_LENS, - - ANDROID_SECTION_COUNT_3_8, - - VENDOR_SECTION_3_8 = 0x8000, - -}; - -/** - * Hierarchy positions in enum space. All vendor extension sections must be - * defined with tag >= VENDOR_SECTION_START - */ -enum CameraMetadataSectionStart : android.hardware.camera.metadata@3.4::CameraMetadataSectionStart { - ANDROID_AUTOMOTIVE_START = CameraMetadataSection:ANDROID_AUTOMOTIVE << 16, - - ANDROID_AUTOMOTIVE_LENS_START = CameraMetadataSection:ANDROID_AUTOMOTIVE_LENS << 16, - - VENDOR_SECTION_START_3_8 = CameraMetadataSection:VENDOR_SECTION_3_8 << 16, - -}; - -/** - * Main enumeration for defining camera metadata tags added in this revision - * - *

Partial documentation is included for each tag; for complete documentation, reference - * '/system/media/camera/docs/docs.html' in the corresponding Android source tree.

- */ -enum CameraMetadataTag : @3.7::CameraMetadataTag { - /** android.flash.info.strengthMaximumLevel [static, int32, public] - * - *

Maximum flashlight brightness level.

- */ - ANDROID_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL = android.hardware.camera.metadata@3.2::CameraMetadataTag:ANDROID_FLASH_INFO_END, - - /** android.flash.info.strengthDefaultLevel [static, int32, public] - * - *

Default flashlight brightness level to be set via - * {android.hardware.camera2.CameraManager#turnOnTorchWithStrengthLevel}.

- */ - ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL, - - ANDROID_FLASH_INFO_END_3_8, - - /** android.request.availableDynamicRangeProfilesMap [static, enum[], ndk_public] - * - *

A map of all available 10-bit dynamic range profiles along with their - * capture request constraints.

- */ - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP = android.hardware.camera.metadata@3.4::CameraMetadataTag:ANDROID_REQUEST_END_3_4, - - /** android.request.recommendedTenBitDynamicRangeProfile [static, int64, java_public] - * - *

Recommended 10-bit dynamic range profile.

- */ - ANDROID_REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE, - - ANDROID_REQUEST_END_3_8, - - /** android.scaler.availableStreamUseCases [static, enum[], public] - * - *

The stream use cases supported by this camera device.

- */ - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES = android.hardware.camera.metadata@3.6::CameraMetadataTag:ANDROID_SCALER_END_3_6, - - ANDROID_SCALER_END_3_8, - - /** android.automotive.location [static, enum, public] - * - *

Location of the cameras on the automotive devices.

- */ - ANDROID_AUTOMOTIVE_LOCATION = CameraMetadataSectionStart:ANDROID_AUTOMOTIVE_START, - - ANDROID_AUTOMOTIVE_END_3_8, - - /** android.automotive.lens.facing [static, enum[], public] - * - *

The direction of the camera faces relative to the vehicle body frame and the - * passenger seats.

- */ - ANDROID_AUTOMOTIVE_LENS_FACING = CameraMetadataSectionStart:ANDROID_AUTOMOTIVE_LENS_START, - - ANDROID_AUTOMOTIVE_LENS_END_3_8, - -}; - -/* - * Enumeration definitions for the various entries that need them - */ - -/** android.control.videoStabilizationMode enumeration values added since v3.2 - * @see ANDROID_CONTROL_VIDEO_STABILIZATION_MODE - */ -enum CameraMetadataEnumAndroidControlVideoStabilizationMode : - @3.2::CameraMetadataEnumAndroidControlVideoStabilizationMode { - ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION, -}; - -/** android.lens.poseReference enumeration values added since v3.5 - * @see ANDROID_LENS_POSE_REFERENCE - */ -enum CameraMetadataEnumAndroidLensPoseReference : - @3.5::CameraMetadataEnumAndroidLensPoseReference { - ANDROID_LENS_POSE_REFERENCE_AUTOMOTIVE, -}; - -/** android.request.availableCapabilities enumeration values added since v3.6 - * @see ANDROID_REQUEST_AVAILABLE_CAPABILITIES - */ -enum CameraMetadataEnumAndroidRequestAvailableCapabilities : - @3.6::CameraMetadataEnumAndroidRequestAvailableCapabilities { - ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT, - ANDROID_REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE, -}; - -/** android.request.availableDynamicRangeProfilesMap enumeration values - * @see ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP - */ -enum CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap : int64_t { - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD - = 0x1, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10 = 0x2, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10 = 0x4, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS - = 0x8, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF - = 0x10, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO - = 0x20, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM - = 0x40, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO - = 0x80, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF - = 0x100, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO - = 0x200, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM - = 0x400, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO - = 0x800, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_MAX = 0x1000, -}; - -/** android.scaler.availableRecommendedStreamConfigurations enumeration values added since v3.4 - * @see ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS - */ -enum CameraMetadataEnumAndroidScalerAvailableRecommendedStreamConfigurations : - @3.4::CameraMetadataEnumAndroidScalerAvailableRecommendedStreamConfigurations { - ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_10BIT_OUTPUT - = 0x8, - ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END_3_8 - = 0x9, -}; - -/** android.scaler.availableStreamUseCases enumeration values - * @see ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES - */ -enum CameraMetadataEnumAndroidScalerAvailableStreamUseCases : int64_t { - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT = 0x0, - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW = 0x1, - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE = 0x2, - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD = 0x3, - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL - = 0x4, - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL = 0x5, - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VENDOR_START = 0x10000, -}; - -/** android.automotive.location enumeration values - * @see ANDROID_AUTOMOTIVE_LOCATION - */ -enum CameraMetadataEnumAndroidAutomotiveLocation : uint32_t { - ANDROID_AUTOMOTIVE_LOCATION_INTERIOR, - ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_OTHER, - ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_FRONT, - ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_REAR, - ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_LEFT, - ANDROID_AUTOMOTIVE_LOCATION_EXTERIOR_RIGHT, - ANDROID_AUTOMOTIVE_LOCATION_EXTRA_OTHER, - ANDROID_AUTOMOTIVE_LOCATION_EXTRA_FRONT, - ANDROID_AUTOMOTIVE_LOCATION_EXTRA_REAR, - ANDROID_AUTOMOTIVE_LOCATION_EXTRA_LEFT, - ANDROID_AUTOMOTIVE_LOCATION_EXTRA_RIGHT, -}; - -/** android.automotive.lens.facing enumeration values - * @see ANDROID_AUTOMOTIVE_LENS_FACING - */ -enum CameraMetadataEnumAndroidAutomotiveLensFacing : uint32_t { - ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_OTHER, - ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_FRONT, - ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_REAR, - ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_LEFT, - ANDROID_AUTOMOTIVE_LENS_FACING_EXTERIOR_RIGHT, - ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_OTHER, - ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_LEFT, - ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_CENTER, - ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_RIGHT, - ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_LEFT, - ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_CENTER, - ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_RIGHT, - ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_LEFT, - ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_CENTER, - ANDROID_AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_RIGHT, -}; diff --git a/camera/provider/2.4/vts/functional/Android.bp b/camera/provider/2.4/vts/functional/Android.bp index 2f24dfd503..85e69eb866 100644 --- a/camera/provider/2.4/vts/functional/Android.bp +++ b/camera/provider/2.4/vts/functional/Android.bp @@ -50,9 +50,7 @@ cc_test { "android.hardware.camera.device@3.5", "android.hardware.camera.device@3.6", "android.hardware.camera.device@3.7", - "android.hardware.camera.device@3.8", "android.hardware.camera.metadata@3.4", - "android.hardware.camera.metadata@3.8", "android.hardware.camera.provider@2.4", "android.hardware.camera.provider@2.5", "android.hardware.camera.provider@2.6", diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index f89c71d241..6866776ba5 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -42,14 +42,9 @@ #include #include #include -#include #include -#include #include -#include -#include #include -#include #include #include #include @@ -134,10 +129,6 @@ using ::android::hardware::camera::metadata::V3_4:: CameraMetadataEnumAndroidSensorInfoColorFilterArrangement; using ::android::hardware::camera::metadata::V3_4::CameraMetadataTag; using ::android::hardware::camera::metadata::V3_6::CameraMetadataEnumAndroidSensorPixelMode; -using ::android::hardware::camera::metadata::V3_8:: - CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap; -using ::android::hardware::camera::metadata::V3_8:: - CameraMetadataEnumAndroidScalerAvailableStreamUseCases; using ::android::hardware::camera::provider::V2_4::ICameraProvider; using ::android::hardware::camera::provider::V2_4::ICameraProviderCallback; using ::android::hardware::camera::provider::V2_6::CameraIdAndStreamCombination; @@ -233,8 +224,7 @@ const static std::vector kMandatoryUseCases = { namespace { // "device@/legacy/" - const char *kDeviceNameRE = "device@([0-9]+\\.[0-9]+)/%s/(.+)"; - const int CAMERA_DEVICE_API_VERSION_3_8 = 0x308; + const char* kDeviceNameRE = "device@([0-9]+\\.[0-9]+)/%s/(.+)"; const int CAMERA_DEVICE_API_VERSION_3_7 = 0x307; const int CAMERA_DEVICE_API_VERSION_3_6 = 0x306; const int CAMERA_DEVICE_API_VERSION_3_5 = 0x305; @@ -242,19 +232,16 @@ namespace { const int CAMERA_DEVICE_API_VERSION_3_3 = 0x303; const int CAMERA_DEVICE_API_VERSION_3_2 = 0x302; const int CAMERA_DEVICE_API_VERSION_1_0 = 0x100; - const char *kHAL3_8 = "3.8"; - const char *kHAL3_7 = "3.7"; - const char *kHAL3_6 = "3.6"; - const char *kHAL3_5 = "3.5"; - const char *kHAL3_4 = "3.4"; - const char *kHAL3_3 = "3.3"; - const char *kHAL3_2 = "3.2"; - const char *kHAL1_0 = "1.0"; - - bool matchDeviceName(const hidl_string& deviceName, - const hidl_string &providerType, - std::string* deviceVersion, - std::string* cameraId) { + const char* kHAL3_7 = "3.7"; + const char* kHAL3_6 = "3.6"; + const char* kHAL3_5 = "3.5"; + const char* kHAL3_4 = "3.4"; + const char* kHAL3_3 = "3.3"; + const char* kHAL3_2 = "3.2"; + const char* kHAL1_0 = "1.0"; + + bool matchDeviceName(const hidl_string& deviceName, const hidl_string& providerType, + std::string* deviceVersion, std::string* cameraId) { ::android::String8 pattern; pattern.appendFormat(kDeviceNameRE, providerType.c_str()); std::regex e(pattern.string()); @@ -280,9 +267,7 @@ namespace { return -1; } - if (version.compare(kHAL3_8) == 0) { - return CAMERA_DEVICE_API_VERSION_3_8; - } else if (version.compare(kHAL3_7) == 0) { + if (version.compare(kHAL3_7) == 0) { return CAMERA_DEVICE_API_VERSION_3_7; } else if (version.compare(kHAL3_6) == 0) { return CAMERA_DEVICE_API_VERSION_3_6; @@ -652,7 +637,8 @@ public: } virtual Return processCaptureResult_3_4( - const hidl_vec& /*results*/) override { + + const hidl_vec& /*results*/) override { ALOGI("processCaptureResult_3_4 callback"); ADD_FAILURE(); // Empty callback should not reach here return Void(); @@ -682,44 +668,41 @@ public: } }; - struct DeviceCb : public V3_8::ICameraDeviceCallback { - DeviceCb(CameraHidlTest *parent, int deviceVersion, const camera_metadata_t *staticMeta) : - mParent(parent), mDeviceVersion(deviceVersion) { + struct DeviceCb : public V3_5::ICameraDeviceCallback { + DeviceCb(CameraHidlTest* parent, int deviceVersion, const camera_metadata_t* staticMeta) + : mParent(parent), mDeviceVersion(deviceVersion) { mStaticMetadata = staticMeta; } - Return processCaptureResult_3_4( - const hidl_vec& results) override; + Return processCaptureResult_3_4(const hidl_vec& results) override; Return processCaptureResult(const hidl_vec& results) override; Return notify(const hidl_vec& msgs) override; - Return notify_3_8(const hidl_vec& msgs) override; - Return requestStreamBuffers( - const hidl_vec& bufReqs, - requestStreamBuffers_cb _hidl_cb) override; + Return requestStreamBuffers(const hidl_vec& bufReqs, + requestStreamBuffers_cb _hidl_cb) override; Return returnStreamBuffers(const hidl_vec& buffers) override; void setCurrentStreamConfig(const hidl_vec& streams, - const hidl_vec& halStreams); + const hidl_vec& halStreams); void waitForBuffersReturned(); private: bool processCaptureResultLocked(const CaptureResult& results, - hidl_vec physicalCameraMetadata); + hidl_vec physicalCameraMetadata); Return notifyHelper(const hidl_vec& msgs, - const std::vector>& readoutTimestamps); + const std::vector>& readoutTimestamps); - CameraHidlTest *mParent; // Parent object + CameraHidlTest* mParent; // Parent object int mDeviceVersion; android::hardware::camera::common::V1_0::helper::CameraMetadata mStaticMetadata; bool hasOutstandingBuffersLocked(); /* members for requestStreamBuffers() and returnStreamBuffers()*/ - std::mutex mLock; // protecting members below - bool mUseHalBufManager = false; - hidl_vec mStreams; + std::mutex mLock; // protecting members below + bool mUseHalBufManager = false; + hidl_vec mStreams; hidl_vec mHalStreams; uint64_t mNextBufferId = 1; using OutstandingBuffers = std::unordered_map; @@ -814,20 +797,18 @@ public: sp* provider2_5 /*out*/, sp* provider2_6 /*out*/, sp* provider2_7 /*out*/); - void castSession(const sp &session, int32_t deviceVersion, - sp *session3_3 /*out*/, - sp *session3_4 /*out*/, - sp *session3_5 /*out*/, - sp *session3_6 /*out*/, - sp *session3_7 /*out*/, - sp *session3_8 /*out*/); + void castSession(const sp& session, int32_t deviceVersion, + sp* session3_3 /*out*/, + sp* session3_4 /*out*/, + sp* session3_5 /*out*/, + sp* session3_6 /*out*/, + sp* session3_7 /*out*/); void castInjectionSession( const sp& session, sp* injectionSession3_7 /*out*/); void castDevice(const sp& device, int32_t deviceVersion, sp* device3_5 /*out*/, - sp* device3_7 /*out*/, - sp* device3_8 /*out*/); + sp* device3_7 /*out*/); void createStreamConfiguration( const ::android::hardware::hidl_vec& streams3_2, StreamConfigurationMode configMode, @@ -857,16 +838,6 @@ public: uint32_t* partialResultCount /*out*/, bool* useHalBufManager /*out*/, sp* outCb /*out*/, uint32_t streamConfigCounter, bool maxResolution); - void configureStreams3_8(const std::string& name, int32_t deviceVersion, - sp provider, PixelFormat format, - sp* session3_8 /*out*/, - V3_2::Stream* previewStream /*out*/, - device::V3_6::HalStreamConfiguration* halStreamConfig /*out*/, - bool* supportsPartialResults /*out*/, - uint32_t* partialResultCount /*out*/, bool* useHalBufManager /*out*/, - sp* outCb /*out*/, uint32_t streamConfigCounter, - bool maxResolution, - CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap prof); void configurePreviewStreams3_4(const std::string &name, int32_t deviceVersion, sp provider, @@ -947,9 +918,6 @@ public: static bool isDepthOnly(const camera_metadata_t* staticMeta); static bool isUltraHighResolution(const camera_metadata_t* staticMeta); - static void get10BitDynamicRangeProfiles(const camera_metadata_t* staticMeta, - std::vector *profiles); - static bool is10BitDynamicRangeCapable(const camera_metadata_t* staticMeta); static Status getAvailableOutputStreams(const camera_metadata_t* staticMeta, std::vector& outputStreams, @@ -1130,10 +1098,6 @@ protected: expectedPhysicalResults(extraPhysicalResult) {} }; - static void verify10BitMetadata(HandleImporter& importer, - const InFlightRequest& request, - CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap profile); - // Map from frame number to the in-flight request state typedef ::android::KeyedVector InFlightMap; @@ -1564,32 +1528,6 @@ void CameraHidlTest::DeviceCb::waitForBuffersReturned() { } } -Return CameraHidlTest::DeviceCb::notify_3_8( - const hidl_vec& msgs) { - hidl_vec msgs3_2; - std::vector> readoutTimestamps; - - nsecs_t count = msgs.size(); - msgs3_2.resize(count); - readoutTimestamps.resize(count); - - for (size_t i = 0; i < count; i++) { - msgs3_2[i].type = msgs[i].type; - switch (msgs[i].type) { - case MsgType::ERROR: - msgs3_2[i].msg.error = msgs[i].msg.error; - readoutTimestamps[i] = {false, 0}; - break; - case MsgType::SHUTTER: - msgs3_2[i].msg.shutter = msgs[i].msg.shutter.v3_2; - readoutTimestamps[i] = {true, msgs[i].msg.shutter.readoutTimestamp}; - break; - } - } - - return notifyHelper(msgs3_2, readoutTimestamps); -} - Return CameraHidlTest::DeviceCb::notify( const hidl_vec& messages) { std::vector> readoutTimestamps; @@ -2082,7 +2020,6 @@ TEST_P(CameraHidlTest, getCameraDeviceInterface) { for (const auto& name : cameraDeviceNames) { int deviceVersion = getCameraDeviceVersion(name, mProviderType); switch (deviceVersion) { - case CAMERA_DEVICE_API_VERSION_3_8: case CAMERA_DEVICE_API_VERSION_3_7: case CAMERA_DEVICE_API_VERSION_3_6: case CAMERA_DEVICE_API_VERSION_3_5: @@ -2127,7 +2064,6 @@ TEST_P(CameraHidlTest, getResourceCost) { for (const auto& name : cameraDeviceNames) { int deviceVersion = getCameraDeviceVersion(name, mProviderType); switch (deviceVersion) { - case CAMERA_DEVICE_API_VERSION_3_8: case CAMERA_DEVICE_API_VERSION_3_7: case CAMERA_DEVICE_API_VERSION_3_6: case CAMERA_DEVICE_API_VERSION_3_5: @@ -2869,7 +2805,6 @@ TEST_P(CameraHidlTest, systemCameraTest) { for (const auto& name : cameraDeviceNames) { int deviceVersion = getCameraDeviceVersion(name, mProviderType); switch (deviceVersion) { - case CAMERA_DEVICE_API_VERSION_3_8: case CAMERA_DEVICE_API_VERSION_3_7: case CAMERA_DEVICE_API_VERSION_3_6: case CAMERA_DEVICE_API_VERSION_3_5: @@ -2957,7 +2892,6 @@ TEST_P(CameraHidlTest, getCameraCharacteristics) { for (const auto& name : cameraDeviceNames) { int deviceVersion = getCameraDeviceVersion(name, mProviderType); switch (deviceVersion) { - case CAMERA_DEVICE_API_VERSION_3_8: case CAMERA_DEVICE_API_VERSION_3_7: case CAMERA_DEVICE_API_VERSION_3_6: case CAMERA_DEVICE_API_VERSION_3_5: @@ -3018,137 +2952,6 @@ TEST_P(CameraHidlTest, getCameraCharacteristics) { } } -// Verify that the torch strength level can be set and retrieved successfully. -TEST_P(CameraHidlTest, turnOnTorchWithStrengthLevel) { - hidl_vec cameraDeviceNames = getCameraDeviceNames(mProvider); - bool torchControlSupported = false; - bool torchStrengthControlSupported = false; - Return ret; - - ret = mProvider->isSetTorchModeSupported([&](auto status, bool support) { - ALOGI("isSetTorchModeSupported returns status:%d supported:%d", (int)status, support); - ASSERT_EQ(Status::OK, status); - torchControlSupported = support; - }); - - sp cb = new TorchProviderCb(this); - Return returnStatus = mProvider->setCallback(cb); - ASSERT_TRUE(returnStatus.isOk()); - ASSERT_EQ(Status::OK, returnStatus); - - for (const auto& name : cameraDeviceNames) { - int deviceVersion = getCameraDeviceVersion(name, mProviderType); - int32_t defaultLevel; - switch (deviceVersion) { - case CAMERA_DEVICE_API_VERSION_3_8: { - ::android::sp<::android::hardware::camera::device::V3_8::ICameraDevice> device3_8; - ALOGI("%s: Testing camera device %s", __FUNCTION__, name.c_str()); - ret = mProvider->getCameraDeviceInterface_V3_x( - name, [&](auto status, const auto& device) { - ASSERT_EQ(Status::OK, status); - ASSERT_NE(device, nullptr); - auto castResult = device::V3_8::ICameraDevice::castFrom(device); - ASSERT_TRUE(castResult.isOk()); - device3_8 = castResult; - }); - ASSERT_TRUE(ret.isOk()); - - ret = device3_8->getCameraCharacteristics([&] (auto s, const auto& chars) { - ASSERT_EQ(Status::OK, s); - const camera_metadata_t* staticMeta = - reinterpret_cast(chars.data()); - ASSERT_NE(nullptr, staticMeta); - torchStrengthControlSupported = isTorchStrengthControlSupported(staticMeta); - camera_metadata_ro_entry entry; - int rc = find_camera_metadata_ro_entry(staticMeta, - ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL, &entry); - if (torchStrengthControlSupported) { - ASSERT_EQ(rc, 0); - ASSERT_GT(entry.count, 0); - defaultLevel = *entry.data.i32; - ALOGI("Default level is:%d", defaultLevel); - } - }); - ASSERT_TRUE(ret.isOk()); - // If torchStrengthControl is supported, torchControlSupported should be true. - if (torchStrengthControlSupported) { - ASSERT_TRUE(torchControlSupported); - } - mTorchStatus = TorchModeStatus::NOT_AVAILABLE; - returnStatus = device3_8->turnOnTorchWithStrengthLevel(2); - ASSERT_TRUE(returnStatus.isOk()); - // Method_not_supported check - if (!torchStrengthControlSupported) { - ALOGI("Torch strength control not supported."); - ASSERT_EQ(Status::METHOD_NOT_SUPPORTED, returnStatus); - } else { - ASSERT_EQ(Status::OK, returnStatus); - if (returnStatus == Status::OK) { - { - std::unique_lock l(mTorchLock); - while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) { - auto timeout = std::chrono::system_clock::now() + - std::chrono::seconds(kTorchTimeoutSec); - ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l, - timeout)); - } - ASSERT_EQ(TorchModeStatus::AVAILABLE_ON, mTorchStatus); - mTorchStatus = TorchModeStatus::NOT_AVAILABLE; - } - ALOGI("getTorchStrengthLevel: Testing"); - ret = device3_8->getTorchStrengthLevel([&] - (auto status, const auto& strengthLevel) { - ASSERT_TRUE(ret.isOk()); - ASSERT_EQ(Status::OK, status); - ALOGI("Torch strength level is : %d", strengthLevel); - ASSERT_EQ(strengthLevel, 2); - }); - // Turn OFF the torch and verify torch strength level is reset to default level. - ALOGI("Testing torch strength level reset after turning the torch OFF."); - returnStatus = device3_8->setTorchMode(TorchMode::OFF); - ASSERT_TRUE(returnStatus.isOk()); - ASSERT_EQ(Status::OK, returnStatus); - { - std::unique_lock l(mTorchLock); - while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) { - auto timeout = std::chrono::system_clock::now() + - std::chrono::seconds(kTorchTimeoutSec); - ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l, - timeout)); - } - ASSERT_EQ(TorchModeStatus::AVAILABLE_OFF, mTorchStatus); - } - ret = device3_8->getTorchStrengthLevel([&] - (auto status, const auto& strengthLevel) { - ASSERT_TRUE(ret.isOk()); - ASSERT_EQ(Status::OK, status); - ALOGI("Torch strength level after turning OFF torch is : %d", - strengthLevel); - ASSERT_EQ(strengthLevel, defaultLevel); - }); - } - } - } - break; - case CAMERA_DEVICE_API_VERSION_3_7: - case CAMERA_DEVICE_API_VERSION_3_6: - case CAMERA_DEVICE_API_VERSION_3_5: - case CAMERA_DEVICE_API_VERSION_3_4: - case CAMERA_DEVICE_API_VERSION_3_3: - case CAMERA_DEVICE_API_VERSION_3_2: - case CAMERA_DEVICE_API_VERSION_1_0: { - ALOGI("Torch strength control feature not supported."); - } - break; - default: { - ALOGI("Invalid device version."); - ADD_FAILURE(); - } - break; - } - } -} - //In case it is supported verify that torch can be enabled. //Check for corresponding toch callbacks as well. TEST_P(CameraHidlTest, setTorchMode) { @@ -3170,7 +2973,6 @@ TEST_P(CameraHidlTest, setTorchMode) { for (const auto& name : cameraDeviceNames) { int deviceVersion = getCameraDeviceVersion(name, mProviderType); switch (deviceVersion) { - case CAMERA_DEVICE_API_VERSION_3_8: case CAMERA_DEVICE_API_VERSION_3_7: case CAMERA_DEVICE_API_VERSION_3_6: case CAMERA_DEVICE_API_VERSION_3_5: @@ -3299,7 +3101,6 @@ TEST_P(CameraHidlTest, dumpState) { for (const auto& name : cameraDeviceNames) { int deviceVersion = getCameraDeviceVersion(name, mProviderType); switch (deviceVersion) { - case CAMERA_DEVICE_API_VERSION_3_8: case CAMERA_DEVICE_API_VERSION_3_7: case CAMERA_DEVICE_API_VERSION_3_6: case CAMERA_DEVICE_API_VERSION_3_5: @@ -3367,7 +3168,6 @@ TEST_P(CameraHidlTest, openClose) { for (const auto& name : cameraDeviceNames) { int deviceVersion = getCameraDeviceVersion(name, mProviderType); switch (deviceVersion) { - case CAMERA_DEVICE_API_VERSION_3_8: case CAMERA_DEVICE_API_VERSION_3_7: case CAMERA_DEVICE_API_VERSION_3_6: case CAMERA_DEVICE_API_VERSION_3_5: @@ -3401,13 +3201,10 @@ TEST_P(CameraHidlTest, openClose) { sp sessionV3_5; sp sessionV3_6; sp sessionV3_7; - sp sessionV3_8; - castSession(session, deviceVersion, &sessionV3_3, - &sessionV3_4, &sessionV3_5, &sessionV3_6, - &sessionV3_7, &sessionV3_8); - if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_8) { - ASSERT_TRUE(sessionV3_8.get() != nullptr); - } else if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_7) { + castSession(session, deviceVersion, &sessionV3_3, &sessionV3_4, &sessionV3_5, + &sessionV3_6, &sessionV3_7); + + if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_7) { ASSERT_TRUE(sessionV3_7.get() != nullptr); } else if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_6) { ASSERT_TRUE(sessionV3_6.get() != nullptr); @@ -3417,7 +3214,7 @@ TEST_P(CameraHidlTest, openClose) { ASSERT_TRUE(sessionV3_4.get() != nullptr); } else if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_3) { ASSERT_TRUE(sessionV3_3.get() != nullptr); - } else { //V3_2 + } else { // V3_2 ASSERT_TRUE(sessionV3_3.get() == nullptr); ASSERT_TRUE(sessionV3_4.get() == nullptr); ASSERT_TRUE(sessionV3_5.get() == nullptr); @@ -3473,7 +3270,6 @@ TEST_P(CameraHidlTest, constructDefaultRequestSettings) { for (const auto& name : cameraDeviceNames) { int deviceVersion = getCameraDeviceVersion(name, mProviderType); switch (deviceVersion) { - case CAMERA_DEVICE_API_VERSION_3_8: case CAMERA_DEVICE_API_VERSION_3_7: case CAMERA_DEVICE_API_VERSION_3_6: case CAMERA_DEVICE_API_VERSION_3_5: @@ -3575,17 +3371,14 @@ TEST_P(CameraHidlTest, configureStreamsAvailableOutputs) { sp session3_5; sp session3_6; sp session3_7; - sp session3_8; sp cameraDevice; sp cameraDevice3_5; sp cameraDevice3_7; - sp cameraDevice3_8; openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/, &cameraDevice /*out*/); - castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7, &session3_8); - castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, - &cameraDevice3_8); + castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6, + &session3_7); + castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); outputStreams.clear(); ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputStreams)); @@ -3681,11 +3474,9 @@ TEST_P(CameraHidlTest, configureConcurrentStreamsAvailableOutputs) { sp session3_5; sp session3_6; sp session3_7; - sp session3_8; sp cameraDevice; sp cameraDevice3_5; sp cameraDevice3_7; - sp cameraDevice3_8; ::android::hardware::camera::device::V3_7::StreamConfiguration config3_7; ::android::hardware::camera::device::V3_5::StreamConfiguration config3_5; ::android::hardware::camera::device::V3_4::StreamConfiguration config3_4; @@ -3722,9 +3513,8 @@ TEST_P(CameraHidlTest, configureConcurrentStreamsAvailableOutputs) { openEmptyDeviceSession(name, mProvider2_6, &cti.session /*out*/, &cti.staticMeta /*out*/, &cti.cameraDevice /*out*/); castSession(cti.session, deviceVersion, &cti.session3_3, &cti.session3_4, - &cti.session3_5, &cti.session3_6, &cti.session3_7, &cti.session3_8); - castDevice(cti.cameraDevice, deviceVersion, &cti.cameraDevice3_5, &cti.cameraDevice3_7, - &cti.cameraDevice3_8); + &cti.session3_5, &cti.session3_6, &cti.session3_7); + castDevice(cti.cameraDevice, deviceVersion, &cti.cameraDevice3_5, &cti.cameraDevice3_7); outputStreams.clear(); ASSERT_EQ(Status::OK, getMandatoryConcurrentStreams(cti.staticMeta, &outputStreams)); @@ -3853,17 +3643,14 @@ TEST_P(CameraHidlTest, configureStreamsInvalidOutputs) { sp session3_5; sp session3_6; sp session3_7; - sp session3_8; sp cameraDevice; sp cameraDevice3_5; sp cameraDevice3_7; - sp cameraDevice3_8; openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/, &cameraDevice /*out*/); - castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7, &session3_8); - castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, - &cameraDevice3_8); + castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6, + &session3_7); + castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); outputStreams.clear(); ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputStreams)); @@ -4069,17 +3856,14 @@ TEST_P(CameraHidlTest, configureStreamsZSLInputOutputs) { sp session3_5; sp session3_6; sp session3_7; - sp session3_8; sp cameraDevice; sp cameraDevice3_5; sp cameraDevice3_7; - sp cameraDevice3_8; openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/, &cameraDevice /*out*/); - castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7, &session3_8); - castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, - &cameraDevice3_8); + castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6, + &session3_7); + castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); Status rc = isZSLModeAvailable(staticMeta); if (Status::METHOD_NOT_SUPPORTED == rc) { @@ -4258,10 +4042,9 @@ TEST_P(CameraHidlTest, configureStreamsWithSessionParameters) { sp session3_5; sp session3_6; sp session3_7; - sp session3_8; openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMetaBuffer /*out*/); - castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7, &session3_8); + castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6, + &session3_7); if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_4) { ASSERT_NE(session3_4, nullptr); } else { @@ -4400,17 +4183,14 @@ TEST_P(CameraHidlTest, configureStreamsPreviewStillOutputs) { sp session3_5; sp session3_6; sp session3_7; - sp session3_8; sp cameraDevice; sp cameraDevice3_5; sp cameraDevice3_7; - sp cameraDevice3_8; openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/, &cameraDevice /*out*/); - castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7, &session3_8); - castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, - &cameraDevice3_8); + castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6, + &session3_7); + castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); // Check if camera support depth only if (isDepthOnly(staticMeta)) { @@ -4537,17 +4317,14 @@ TEST_P(CameraHidlTest, configureStreamsConstrainedOutputs) { sp session3_5; sp session3_6; sp session3_7; - sp session3_8; sp cameraDevice; sp cameraDevice3_5; sp cameraDevice3_7; - sp cameraDevice3_8; openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/, &cameraDevice /*out*/); - castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7, &session3_8); - castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, - &cameraDevice3_8); + castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6, + &session3_7); + castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); Status rc = isConstrainedModeAvailable(staticMeta); if (Status::METHOD_NOT_SUPPORTED == rc) { @@ -4820,17 +4597,14 @@ TEST_P(CameraHidlTest, configureStreamsVideoStillOutputs) { sp session3_5; sp session3_6; sp session3_7; - sp session3_8; sp cameraDevice; sp cameraDevice3_5; sp cameraDevice3_7; - sp cameraDevice3_8; openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/, &cameraDevice /*out*/); - castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7, &session3_8); - castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, - &cameraDevice3_8); + castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6, + &session3_7); + castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); // Check if camera support depth only if (isDepthOnly(staticMeta)) { @@ -5069,28 +4843,6 @@ void CameraHidlTest::processCaptureRequestInternal(uint64_t bufferUsage, ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u); ASSERT_EQ(testStream.id, inflightReq.resultOutputBuffers[0].buffer.streamId); - // For camera device 3.8 or newer, shutterReadoutTimestamp must be - // available, and it must be >= shutterTimestamp + exposureTime, and - // < shutterTimestamp + exposureTime + rollingShutterSkew / 2. - if (deviceVersion >= CAMERA_DEVICE_API_VERSION_3_8) { - ASSERT_TRUE(inflightReq.shutterReadoutTimestampValid); - ASSERT_FALSE(inflightReq.collectedResult.isEmpty()); - if (inflightReq.collectedResult.exists(ANDROID_SENSOR_EXPOSURE_TIME)) { - camera_metadata_entry_t exposureTimeResult = inflightReq.collectedResult.find( - ANDROID_SENSOR_EXPOSURE_TIME); - nsecs_t exposureToReadout = - inflightReq.shutterReadoutTimestamp - inflightReq.shutterTimestamp; - ASSERT_GE(exposureToReadout, exposureTimeResult.data.i64[0]); - if (inflightReq.collectedResult.exists(ANDROID_SENSOR_ROLLING_SHUTTER_SKEW)) { - camera_metadata_entry_t rollingShutterSkew = - inflightReq.collectedResult.find( - ANDROID_SENSOR_ROLLING_SHUTTER_SKEW); - ASSERT_LT(exposureToReadout, exposureTimeResult.data.i64[0] + - rollingShutterSkew.data.i64[0] / 2); - } - } - } - request.frameNumber++; // Empty settings should be supported after the first call // for repeating requests. @@ -5114,20 +4866,6 @@ void CameraHidlTest::processCaptureRequestInternal(uint64_t bufferUsage, ASSERT_EQ(Status::OK, status); ASSERT_EQ(numRequestProcessed, 1u); - if (deviceVersion >= CAMERA_DEVICE_API_VERSION_3_8) { - sp session3_3; - sp session3_4; - sp session3_5; - sp session3_6; - sp session3_7; - sp session3_8; - castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7, &session3_8); - ASSERT_TRUE(session3_8.get() != nullptr); - hidl_vec streamIds = { halStreamConfig.streams[0].id }; - session3_8->repeatingRequestEnd(request.frameNumber, streamIds); - } - { std::unique_lock l(mLock); while (!inflightReq.errorCodeValid && @@ -5153,196 +4891,6 @@ void CameraHidlTest::processCaptureRequestInternal(uint64_t bufferUsage, } } -TEST_P(CameraHidlTest, processCaptureRequestPreviewStabilization) { - std::unordered_map cameraDeviceToTimeLag; - processPreviewStabilizationCaptureRequestInternal(/*previewStabilizationOn*/ false, - cameraDeviceToTimeLag); - processPreviewStabilizationCaptureRequestInternal(/*previewStabilizationOn*/ true, - cameraDeviceToTimeLag); -} - -void CameraHidlTest::processPreviewStabilizationCaptureRequestInternal( - bool previewStabilizationOn, - // Used as output when preview stabilization is off, as output when its - // on. - std::unordered_map& cameraDeviceToTimeLag) { - hidl_vec cameraDeviceNames = getCameraDeviceNames(mProvider); - AvailableStream streamThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, - static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; - uint64_t bufferId = 1; - uint32_t frameNumber = 1; - ::android::hardware::hidl_vec settings; - - for (const auto& name : cameraDeviceNames) { - int deviceVersion = getCameraDeviceVersion(name, mProviderType); - if (deviceVersion == CAMERA_DEVICE_API_VERSION_1_0) { - continue; - } else if (deviceVersion <= 0) { - ALOGE("%s: Unsupported device version %d", __func__, deviceVersion); - ADD_FAILURE(); - return; - } - - if (!supportsPreviewStabilization(name, mProvider)) { - ALOGI(" %s Camera device %s doesn't support preview stabilization, skipping", __func__, - name.c_str()); - continue; - } - - if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_8) { - ALOGE("%s: device version < 3.8 must not advertise preview stabilization," - " camera metadata validation will fail", - __func__); - ADD_FAILURE(); - } - - V3_2::Stream testStream; - HalStreamConfiguration halStreamConfig; - sp session; - sp cb; - bool supportsPartialResults = false; - bool useHalBufManager = false; - uint32_t partialResultCount = 0; - configureSingleStream(name, deviceVersion, mProvider, &streamThreshold, - GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, RequestTemplate::PREVIEW, - &session /*out*/, &testStream /*out*/, &halStreamConfig /*out*/, - &supportsPartialResults /*out*/, &partialResultCount /*out*/, - &useHalBufManager /*out*/, &cb /*out*/); - - std::shared_ptr resultQueue; - auto resultQueueRet = - session->getCaptureResultMetadataQueue([&resultQueue](const auto& descriptor) { - resultQueue = std::make_shared(descriptor); - if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) { - ALOGE("%s: HAL returns empty result metadata fmq," - " not use it", - __func__); - resultQueue = nullptr; - // Don't use the queue onwards. - } - }); - ASSERT_TRUE(resultQueueRet.isOk()); - - InFlightRequest inflightReq = {1, false, supportsPartialResults, partialResultCount, - resultQueue}; - - Return ret; - android::hardware::camera::common::V1_0::helper::CameraMetadata defaultSettings; - ret = session->constructDefaultRequestSettings( - RequestTemplate::PREVIEW, [&](auto status, const auto& req) { - ASSERT_EQ(Status::OK, status); - const camera_metadata_t* metadata = - reinterpret_cast(req.data()); - defaultSettings = metadata; - settings = req; - }); - ASSERT_TRUE(ret.isOk()); - android::status_t metadataRet = ::android::OK; - uint8_t videoStabilizationMode = ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF; - if (previewStabilizationOn) { - videoStabilizationMode = ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION; - metadataRet = defaultSettings.update(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, - &videoStabilizationMode, 1); - } else { - metadataRet = defaultSettings.update(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, - &videoStabilizationMode, 1); - } - ASSERT_EQ(metadataRet, ::android::OK); - hidl_handle buffer_handle; - StreamBuffer outputBuffer; - if (useHalBufManager) { - outputBuffer = {halStreamConfig.streams[0].id, - /*bufferId*/ 0, - buffer_handle, - BufferStatus::OK, - nullptr, - nullptr}; - } else { - allocateGraphicBuffer( - testStream.width, testStream.height, - /* We don't look at halStreamConfig.streams[0].consumerUsage - * since that is 0 for output streams - */ - android_convertGralloc1To0Usage(halStreamConfig.streams[0].producerUsage, - GRALLOC1_CONSUMER_USAGE_HWCOMPOSER), - halStreamConfig.streams[0].overrideFormat, &buffer_handle); - outputBuffer = {halStreamConfig.streams[0].id, - bufferId, - buffer_handle, - BufferStatus::OK, - nullptr, - nullptr}; - } - ::android::hardware::hidl_vec outputBuffers = {outputBuffer}; - StreamBuffer emptyInputBuffer = {-1, 0, nullptr, BufferStatus::ERROR, nullptr, nullptr}; - CaptureRequest request = {frameNumber, 0 /* fmqSettingsSize */, settings, emptyInputBuffer, - outputBuffers}; - - { - std::unique_lock l(mLock); - mInflightMap.clear(); - mInflightMap.add(frameNumber, &inflightReq); - } - - Status status = Status::INTERNAL_ERROR; - uint32_t numRequestProcessed = 0; - hidl_vec cachesToRemove; - Return returnStatus = session->processCaptureRequest( - {request}, cachesToRemove, [&status, &numRequestProcessed](auto s, uint32_t n) { - status = s; - numRequestProcessed = n; - }); - ASSERT_TRUE(returnStatus.isOk()); - ASSERT_EQ(Status::OK, status); - ASSERT_EQ(numRequestProcessed, 1u); - - { - std::unique_lock l(mLock); - while (!inflightReq.errorCodeValid && - ((0 < inflightReq.numBuffersLeft) || (!inflightReq.haveResultMetadata))) { - auto timeout = std::chrono::system_clock::now() + - std::chrono::seconds(kStreamBufferTimeoutSec); - ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); - } - - ASSERT_FALSE(inflightReq.errorCodeValid); - ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u); - ASSERT_EQ(testStream.id, inflightReq.resultOutputBuffers[0].buffer.streamId); - ASSERT_TRUE(inflightReq.shutterReadoutTimestampValid); - nsecs_t readoutTimestamp = inflightReq.shutterReadoutTimestamp; - - if (previewStabilizationOn) { - // Here we collect the time difference between the buffer ready - // timestamp - notify readout timestamp. - // timeLag = buffer ready timestamp - notify readout timestamp. - // timeLag(previewStabilization) must be <= - // timeLag(stabilization off) + 1 frame duration. - auto it = cameraDeviceToTimeLag.find(name.c_str()); - camera_metadata_entry e; - e = inflightReq.collectedResult.find(ANDROID_SENSOR_FRAME_DURATION); - ASSERT_TRUE(e.count > 0); - nsecs_t frameDuration = e.data.i64[0]; - ASSERT_TRUE(it != cameraDeviceToTimeLag.end()); - - nsecs_t previewStabOnLagTime = - inflightReq.resultOutputBuffers[0].timeStamp - readoutTimestamp; - ASSERT_TRUE(previewStabOnLagTime <= (it->second + frameDuration)); - } else { - // Fill in the buffer ready timestamp - notify timestamp; - cameraDeviceToTimeLag[std::string(name.c_str())] = - inflightReq.resultOutputBuffers[0].timeStamp - readoutTimestamp; - } - } - - if (useHalBufManager) { - verifyBuffersReturned(session, deviceVersion, testStream.id, cb); - } - - ret = session->close(); - ASSERT_TRUE(ret.isOk()); - } -} - // Generate and verify a multi-camera capture request TEST_P(CameraHidlTest, processMultiCaptureRequestPreview) { hidl_vec cameraDeviceNames = getCameraDeviceNames(mProvider); @@ -5771,226 +5319,44 @@ TEST_P(CameraHidlTest, processUltraHighResolutionRequest) { } } -// Generate and verify 10-bit dynamic range request -TEST_P(CameraHidlTest, process10BitDynamicRangeRequest) { +// Generate and verify a burst containing alternating sensor sensitivity values +TEST_P(CameraHidlTest, processCaptureRequestBurstISO) { hidl_vec cameraDeviceNames = getCameraDeviceNames(mProvider); + AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, + static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; uint64_t bufferId = 1; uint32_t frameNumber = 1; + float isoTol = .03f; ::android::hardware::hidl_vec settings; for (const auto& name : cameraDeviceNames) { int deviceVersion = getCameraDeviceVersion(name, mProviderType); - if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_8) { + if (deviceVersion == CAMERA_DEVICE_API_VERSION_1_0) { continue; + } else if (deviceVersion <= 0) { + ALOGE("%s: Unsupported device version %d", __func__, deviceVersion); + ADD_FAILURE(); + return; } - std::string version, deviceId; - ASSERT_TRUE(::matchDeviceName(name, mProviderType, &version, &deviceId)); - camera_metadata_t* staticMeta; + camera_metadata_t* staticMetaBuffer; Return ret; sp session; - openEmptyDeviceSession(name, mProvider, &session, &staticMeta); - if (!is10BitDynamicRangeCapable(staticMeta)) { - free_camera_metadata(staticMeta); + openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMetaBuffer /*out*/); + ::android::hardware::camera::common::V1_0::helper::CameraMetadata staticMeta( + staticMetaBuffer); + + camera_metadata_entry_t hwLevel = staticMeta.find(ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL); + ASSERT_TRUE(0 < hwLevel.count); + if (ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED == hwLevel.data.u8[0] || + ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL == hwLevel.data.u8[0]) { + // Limited/External devices can skip this test ret = session->close(); ASSERT_TRUE(ret.isOk()); continue; } - std::vector profileList; - get10BitDynamicRangeProfiles(staticMeta, &profileList); - ASSERT_FALSE(profileList.empty()); - android::hardware::camera::common::V1_0::helper::CameraMetadata defaultSettings; - ret = session->constructDefaultRequestSettings( - RequestTemplate::STILL_CAPTURE, - [&defaultSettings](auto status, const auto& req) mutable { - ASSERT_EQ(Status::OK, status); - - const camera_metadata_t* metadata = - reinterpret_cast(req.data()); - size_t expectedSize = req.size(); - int result = validate_camera_metadata_structure(metadata, &expectedSize); - ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED)); - - size_t entryCount = get_camera_metadata_entry_count(metadata); - ASSERT_GT(entryCount, 0u); - defaultSettings = metadata; - }); - ASSERT_TRUE(ret.isOk()); - - const camera_metadata_t* settingsBuffer = defaultSettings.getAndLock(); - settings.setToExternal( - reinterpret_cast(const_cast(settingsBuffer)), - get_camera_metadata_size(settingsBuffer)); - overrideRotateAndCrop(&settings); - - free_camera_metadata(staticMeta); - ret = session->close(); - ASSERT_TRUE(ret.isOk()); - V3_6::HalStreamConfiguration halStreamConfig; - bool supportsPartialResults = false; - bool useHalBufManager = false; - uint32_t partialResultCount = 0; - V3_2::Stream previewStream; - sp session3_8; - sp cb; - for (const auto& profile : profileList) { - configureStreams3_8(name, deviceVersion, mProvider, PixelFormat::IMPLEMENTATION_DEFINED, - &session3_8, &previewStream, &halStreamConfig, - &supportsPartialResults, &partialResultCount, &useHalBufManager, - &cb, 0, /*maxResolution*/ false, profile); - ASSERT_NE(session3_8, nullptr); - - std::shared_ptr resultQueue; - auto resultQueueRet = session3_8->getCaptureResultMetadataQueue( - [&resultQueue](const auto& descriptor) { - resultQueue = std::make_shared(descriptor); - if (!resultQueue->isValid() || resultQueue->availableToWrite() <= 0) { - ALOGE("%s: HAL returns empty result metadata fmq," - " not use it", - __func__); - resultQueue = nullptr; - // Don't use the queue onwards. - } - }); - ASSERT_TRUE(resultQueueRet.isOk()); - - std::vector graphicBuffers; - graphicBuffers.reserve(halStreamConfig.streams.size()); - ::android::hardware::hidl_vec outputBuffers; - outputBuffers.resize(halStreamConfig.streams.size()); - InFlightRequest inflightReq = {static_cast(halStreamConfig.streams.size()), - false, - supportsPartialResults, - partialResultCount, - std::unordered_set(), - resultQueue}; - - size_t k = 0; - for (const auto& halStream : halStreamConfig.streams) { - hidl_handle buffer_handle; - if (useHalBufManager) { - outputBuffers[k] = {halStream.v3_4.v3_3.v3_2.id, - 0, - buffer_handle, - BufferStatus::OK, - nullptr, - nullptr}; - } else { - allocateGraphicBuffer( - previewStream.width, previewStream.height, - android_convertGralloc1To0Usage(halStream.v3_4.v3_3.v3_2.producerUsage, - halStream.v3_4.v3_3.v3_2.consumerUsage), - halStream.v3_4.v3_3.v3_2.overrideFormat, &buffer_handle); - - graphicBuffers.push_back(buffer_handle); - outputBuffers[k] = {halStream.v3_4.v3_3.v3_2.id, - bufferId, - buffer_handle, - BufferStatus::OK, - nullptr, - nullptr}; - bufferId++; - } - k++; - } - - StreamBuffer emptyInputBuffer = {-1, 0, nullptr, BufferStatus::ERROR, nullptr, nullptr}; - V3_4::CaptureRequest request3_4; - request3_4.v3_2.frameNumber = frameNumber; - request3_4.v3_2.fmqSettingsSize = 0; - request3_4.v3_2.settings = settings; - request3_4.v3_2.inputBuffer = emptyInputBuffer; - request3_4.v3_2.outputBuffers = outputBuffers; - V3_7::CaptureRequest request3_7; - request3_7.v3_4 = request3_4; - request3_7.inputWidth = 0; - request3_7.inputHeight = 0; - - { - std::unique_lock l(mLock); - mInflightMap.clear(); - mInflightMap.add(frameNumber, &inflightReq); - } - - Status stat = Status::INTERNAL_ERROR; - uint32_t numRequestProcessed = 0; - hidl_vec cachesToRemove; - Return returnStatus = session3_8->processCaptureRequest_3_7( - {request3_7}, cachesToRemove, - [&stat, &numRequestProcessed](auto s, uint32_t n) { - stat = s; - numRequestProcessed = n; - }); - ASSERT_TRUE(returnStatus.isOk()); - ASSERT_EQ(Status::OK, stat); - ASSERT_EQ(numRequestProcessed, 1u); - - { - std::unique_lock l(mLock); - while (!inflightReq.errorCodeValid && - ((0 < inflightReq.numBuffersLeft) || (!inflightReq.haveResultMetadata))) { - auto timeout = std::chrono::system_clock::now() + - std::chrono::seconds(kStreamBufferTimeoutSec); - ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout)); - } - - ASSERT_FALSE(inflightReq.errorCodeValid); - ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u); - verify10BitMetadata(mHandleImporter, inflightReq, profile); - } - if (useHalBufManager) { - hidl_vec streamIds(halStreamConfig.streams.size()); - for (size_t i = 0; i < streamIds.size(); i++) { - streamIds[i] = halStreamConfig.streams[i].v3_4.v3_3.v3_2.id; - } - session3_8->signalStreamFlush(streamIds, /*streamConfigCounter*/ 0); - cb->waitForBuffersReturned(); - } - - ret = session3_8->close(); - ASSERT_TRUE(ret.isOk()); - } - } -} - -// Generate and verify a burst containing alternating sensor sensitivity values -TEST_P(CameraHidlTest, processCaptureRequestBurstISO) { - hidl_vec cameraDeviceNames = getCameraDeviceNames(mProvider); - AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, - static_cast(PixelFormat::IMPLEMENTATION_DEFINED)}; - uint64_t bufferId = 1; - uint32_t frameNumber = 1; - float isoTol = .03f; - ::android::hardware::hidl_vec settings; - - for (const auto& name : cameraDeviceNames) { - int deviceVersion = getCameraDeviceVersion(name, mProviderType); - if (deviceVersion == CAMERA_DEVICE_API_VERSION_1_0) { - continue; - } else if (deviceVersion <= 0) { - ALOGE("%s: Unsupported device version %d", __func__, deviceVersion); - ADD_FAILURE(); - return; - } - camera_metadata_t* staticMetaBuffer; - Return ret; - sp session; - openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMetaBuffer /*out*/); - ::android::hardware::camera::common::V1_0::helper::CameraMetadata staticMeta( - staticMetaBuffer); - - camera_metadata_entry_t hwLevel = staticMeta.find(ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL); - ASSERT_TRUE(0 < hwLevel.count); - if (ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED == hwLevel.data.u8[0] || - ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL == hwLevel.data.u8[0]) { - //Limited/External devices can skip this test - ret = session->close(); - ASSERT_TRUE(ret.isOk()); - continue; - } - - camera_metadata_entry_t isoRange = staticMeta.find(ANDROID_SENSOR_INFO_SENSITIVITY_RANGE); - ASSERT_EQ(isoRange.count, 2u); + camera_metadata_entry_t isoRange = staticMeta.find(ANDROID_SENSOR_INFO_SENSITIVITY_RANGE); + ASSERT_EQ(isoRange.count, 2u); ret = session->close(); ASSERT_TRUE(ret.isOk()); @@ -6946,134 +6312,6 @@ TEST_P(CameraHidlTest, configureInjectionStreamsWithSessionParameters) { } } -// Verify that valid stream use cases can be configured successfully, and invalid use cases -// fail stream configuration. -TEST_P(CameraHidlTest, configureStreamsUseCases) { - hidl_vec cameraDeviceNames = getCameraDeviceNames(mProvider); - - for (const auto& name : cameraDeviceNames) { - int deviceVersion = getCameraDeviceVersion(name, mProviderType); - if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_8) { - continue; - } - - camera_metadata_t* staticMeta; - Return ret; - sp session; - sp session3_3; - sp session3_4; - sp session3_5; - sp session3_6; - sp session3_7; - sp session3_8; - sp cameraDevice; - sp cameraDevice3_5; - sp cameraDevice3_7; - sp cameraDevice3_8; - openEmptyDeviceSession(name, mProvider, &session /*out*/, &staticMeta /*out*/, - &cameraDevice /*out*/); - castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7, &session3_8); - ASSERT_NE(nullptr, session3_8); - castDevice(cameraDevice, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, - &cameraDevice3_8); - ASSERT_NE(nullptr, cameraDevice3_8); - - // Check if camera support depth only - if (isDepthOnly(staticMeta)) { - free_camera_metadata(staticMeta); - ret = session->close(); - ASSERT_TRUE(ret.isOk()); - continue; - } - - std::vector outputPreviewStreams; - AvailableStream previewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight, - static_cast(PixelFormat::YCBCR_420_888)}; - ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputPreviewStreams, - &previewThreshold)); - ASSERT_NE(0u, outputPreviewStreams.size()); - - // Combine valid and invalid stream use cases - std::vector useCases(kMandatoryUseCases); - useCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL + 1); - - std::vector supportedUseCases; - camera_metadata_ro_entry entry; - auto retcode = find_camera_metadata_ro_entry(staticMeta, - ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, &entry); - if ((0 == retcode) && (entry.count > 0)) { - supportedUseCases.insert(supportedUseCases.end(), entry.data.i64, - entry.data.i64 + entry.count); - } else { - supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT); - } - free_camera_metadata(staticMeta); - - ::android::hardware::hidl_vec streams3_8(1); - streams3_8[0].v3_7.groupId = -1; - streams3_8[0].v3_7.sensorPixelModesUsed = { - CameraMetadataEnumAndroidSensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}; - streams3_8[0].v3_7.v3_4.bufferSize = 0; - streams3_8[0].v3_7.v3_4.v3_2.id = 0; - streams3_8[0].v3_7.v3_4.v3_2.streamType = StreamType::OUTPUT; - streams3_8[0].v3_7.v3_4.v3_2.width = static_cast(outputPreviewStreams[0].width); - streams3_8[0].v3_7.v3_4.v3_2.height = static_cast(outputPreviewStreams[0].height); - streams3_8[0].v3_7.v3_4.v3_2.format = - static_cast(outputPreviewStreams[0].format); - streams3_8[0].v3_7.v3_4.v3_2.usage = GRALLOC1_CONSUMER_USAGE_CPU_READ; - streams3_8[0].v3_7.v3_4.v3_2.dataSpace = 0; - streams3_8[0].v3_7.v3_4.v3_2.rotation = StreamRotation::ROTATION_0; - streams3_8[0].dynamicRangeProfile = - static_cast( - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD); - - uint32_t streamConfigCounter = 0; - ::android::hardware::camera::device::V3_8::StreamConfiguration config3_8; - RequestTemplate reqTemplate = RequestTemplate::STILL_CAPTURE; - ret = session3_8->constructDefaultRequestSettings(reqTemplate, - [&config3_8](auto status, const auto& req) { - ASSERT_EQ(Status::OK, status); - config3_8.sessionParams = req; - }); - ASSERT_TRUE(ret.isOk()); - - for (int64_t useCase : useCases) { - bool useCaseSupported = std::find(supportedUseCases.begin(), - supportedUseCases.end(), useCase) != supportedUseCases.end(); - - streams3_8[0].useCase = - static_cast(useCase); - config3_8.streams = streams3_8; - config3_8.operationMode = StreamConfigurationMode::NORMAL_MODE; - config3_8.streamConfigCounter = streamConfigCounter; - config3_8.multiResolutionInputImage = false; - ret = cameraDevice3_8->isStreamCombinationSupported_3_8( - config3_8, [&useCaseSupported](Status s, bool combStatus) { - ASSERT_TRUE((Status::OK == s) || (Status::METHOD_NOT_SUPPORTED == s)); - if (Status::OK == s) { - ASSERT_EQ(combStatus, useCaseSupported); - } - }); - ASSERT_TRUE(ret.isOk()); - - ret = session3_8->configureStreams_3_8( - config3_8, - [&](Status s, device::V3_6::HalStreamConfiguration halConfig) { - if (useCaseSupported) { - ASSERT_EQ(Status::OK, s); - ASSERT_EQ(1u, halConfig.streams.size()); - } else { - ASSERT_EQ(Status::ILLEGAL_ARGUMENT, s); - } - }); - ASSERT_TRUE(ret.isOk()); - } - ret = session3_8->close(); - ASSERT_TRUE(ret.isOk()); - } -} - // Retrieve all valid output stream resolutions from the camera // static characteristics. Status CameraHidlTest::getAvailableOutputStreams(const camera_metadata_t* staticMeta, @@ -7736,9 +6974,8 @@ void CameraHidlTest::configureStreams3_7( sp session3_4; sp session3_5; sp session3_6; - sp session3_8; castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6, - session3_7, &session3_8); + session3_7); ASSERT_NE(nullptr, (*session3_7).get()); *useHalBufManager = false; @@ -7786,8 +7023,7 @@ void CameraHidlTest::configureStreams3_7( ASSERT_TRUE(deviceVersion >= CAMERA_DEVICE_API_VERSION_3_7); sp cameraDevice3_5 = nullptr; sp cameraDevice3_7 = nullptr; - sp cameraDevice3_8 = nullptr; - castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, &cameraDevice3_8); + castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); ASSERT_NE(cameraDevice3_7, nullptr); bool supported = false; ret = cameraDevice3_7->isStreamCombinationSupported_3_7( @@ -7820,153 +7056,6 @@ void CameraHidlTest::configureStreams3_7( ASSERT_TRUE(ret.isOk()); } -// Configure streams -void CameraHidlTest::configureStreams3_8( - const std::string& name, int32_t deviceVersion, sp provider, - PixelFormat format, sp* session3_8 /*out*/, - V3_2::Stream* previewStream /*out*/, - device::V3_6::HalStreamConfiguration* halStreamConfig /*out*/, - bool* supportsPartialResults /*out*/, uint32_t* partialResultCount /*out*/, - bool* useHalBufManager /*out*/, sp* outCb /*out*/, uint32_t streamConfigCounter, - bool maxResolution, - CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap prof) { - ASSERT_NE(nullptr, session3_8); - ASSERT_NE(nullptr, halStreamConfig); - ASSERT_NE(nullptr, previewStream); - ASSERT_NE(nullptr, supportsPartialResults); - ASSERT_NE(nullptr, partialResultCount); - ASSERT_NE(nullptr, useHalBufManager); - ASSERT_NE(nullptr, outCb); - ASSERT_TRUE(deviceVersion >= CAMERA_DEVICE_API_VERSION_3_8); - - std::vector outputStreams; - ::android::sp device3_x; - ALOGI("configureStreams: Testing camera device %s", name.c_str()); - Return ret; - ret = provider->getCameraDeviceInterface_V3_x(name, [&](auto status, const auto& device) { - ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status); - ASSERT_EQ(Status::OK, status); - ASSERT_NE(device, nullptr); - device3_x = device; - }); - ASSERT_TRUE(ret.isOk()); - - camera_metadata_t* staticMeta; - ret = device3_x->getCameraCharacteristics([&](Status s, CameraMetadata metadata) { - ASSERT_EQ(Status::OK, s); - staticMeta = - clone_camera_metadata(reinterpret_cast(metadata.data())); - ASSERT_NE(nullptr, staticMeta); - }); - ASSERT_TRUE(ret.isOk()); - - camera_metadata_ro_entry entry; - auto status = - find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_PARTIAL_RESULT_COUNT, &entry); - if ((0 == status) && (entry.count > 0)) { - *partialResultCount = entry.data.i32[0]; - *supportsPartialResults = (*partialResultCount > 1); - } - - sp cb = new DeviceCb(this, deviceVersion, staticMeta); - sp session; - ret = device3_x->open(cb, [&session](auto status, const auto& newSession) { - ALOGI("device::open returns status:%d", (int)status); - ASSERT_EQ(Status::OK, status); - ASSERT_NE(newSession, nullptr); - session = newSession; - }); - ASSERT_TRUE(ret.isOk()); - *outCb = cb; - - sp session3_3; - sp session3_4; - sp session3_5; - sp session3_6; - sp session3_7; - castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6, - &session3_7, session3_8); - ASSERT_NE(nullptr, (*session3_8).get()); - - *useHalBufManager = 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); - } - - outputStreams.clear(); - Size maxSize; - auto rc = getMaxOutputSizeForFormat(staticMeta, format, &maxSize, maxResolution); - ASSERT_EQ(Status::OK, rc); - free_camera_metadata(staticMeta); - - ::android::hardware::hidl_vec streams3_8(1); - streams3_8[0].v3_7.groupId = -1; - streams3_8[0].v3_7.sensorPixelModesUsed = { - CameraMetadataEnumAndroidSensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}; - streams3_8[0].v3_7.v3_4.bufferSize = 0; - streams3_8[0].v3_7.v3_4.v3_2.id = 0; - streams3_8[0].v3_7.v3_4.v3_2.streamType = StreamType::OUTPUT; - streams3_8[0].v3_7.v3_4.v3_2.width = static_cast(maxSize.width); - streams3_8[0].v3_7.v3_4.v3_2.height = static_cast(maxSize.height); - streams3_8[0].v3_7.v3_4.v3_2.format = static_cast(format); - streams3_8[0].v3_7.v3_4.v3_2.usage = GRALLOC1_CONSUMER_USAGE_CPU_READ; - streams3_8[0].v3_7.v3_4.v3_2.dataSpace = 0; - streams3_8[0].v3_7.v3_4.v3_2.rotation = StreamRotation::ROTATION_0; - streams3_8[0].dynamicRangeProfile = prof; - - ::android::hardware::camera::device::V3_8::StreamConfiguration config3_8; - config3_8.streams = streams3_8; - config3_8.operationMode = StreamConfigurationMode::NORMAL_MODE; - config3_8.streamConfigCounter = streamConfigCounter; - config3_8.multiResolutionInputImage = false; - RequestTemplate reqTemplate = RequestTemplate::STILL_CAPTURE; - ret = (*session3_8) - ->constructDefaultRequestSettings(reqTemplate, - [&config3_8](auto status, const auto& req) { - ASSERT_EQ(Status::OK, status); - config3_8.sessionParams = req; - }); - ASSERT_TRUE(ret.isOk()); - - sp cameraDevice3_5 = nullptr; - sp cameraDevice3_7 = nullptr; - sp cameraDevice3_8 = nullptr; - castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, &cameraDevice3_8); - ASSERT_NE(cameraDevice3_8, nullptr); - bool supported = false; - ret = cameraDevice3_8->isStreamCombinationSupported_3_8( - config3_8, [&supported](Status s, bool combStatus) { - ASSERT_TRUE((Status::OK == s) || (Status::METHOD_NOT_SUPPORTED == s)); - if (Status::OK == s) { - supported = combStatus; - } - }); - ASSERT_TRUE(ret.isOk()); - ASSERT_EQ(supported, true); - - if (*session3_8 != nullptr) { - ret = (*session3_8) - ->configureStreams_3_8( - config3_8, - [&](Status s, device::V3_6::HalStreamConfiguration halConfig) { - ASSERT_EQ(Status::OK, s); - *halStreamConfig = halConfig; - if (*useHalBufManager) { - hidl_vec streams(1); - hidl_vec halStreams(1); - streams[0] = streams3_8[0].v3_7.v3_4; - halStreams[0] = halConfig.streams[0].v3_4.v3_3.v3_2; - cb->setCurrentStreamConfig(streams, halStreams); - } - }); - } - *previewStream = streams3_8[0].v3_7.v3_4.v3_2; - ASSERT_TRUE(ret.isOk()); -} - // Configure multiple preview streams using different physical ids. void CameraHidlTest::configurePreviewStreams3_4(const std::string &name, int32_t deviceVersion, sp provider, @@ -8041,9 +7130,8 @@ void CameraHidlTest::configurePreviewStreams3_4(const std::string &name, int32_t sp session3_3; sp session3_6; sp session3_7; - sp session3_8; - castSession(session, deviceVersion, &session3_3, session3_4, session3_5, - &session3_6, &session3_7, &session3_8); + castSession(session, deviceVersion, &session3_3, session3_4, session3_5, &session3_6, + &session3_7); ASSERT_NE(nullptr, (*session3_4).get()); *useHalBufManager = false; @@ -8088,8 +7176,7 @@ void CameraHidlTest::configurePreviewStreams3_4(const std::string &name, int32_t if (allowUnsupport) { sp cameraDevice3_5; sp cameraDevice3_7; - sp cameraDevice3_8; - castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7, &cameraDevice3_8); + castDevice(device3_x, deviceVersion, &cameraDevice3_5, &cameraDevice3_7); bool supported = false; ret = cameraDevice3_5->isStreamCombinationSupported(config3_4, @@ -8282,95 +7369,6 @@ bool CameraHidlTest::isUltraHighResolution(const camera_metadata_t* staticMeta) return false; } -void CameraHidlTest::get10BitDynamicRangeProfiles(const camera_metadata_t* staticMeta, - std::vector *profiles) { - ASSERT_NE(nullptr, staticMeta); - ASSERT_NE(nullptr, profiles); - camera_metadata_ro_entry entry; - std::unordered_set entries; - int rc = find_camera_metadata_ro_entry(staticMeta, - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP, &entry); - ASSERT_EQ(rc, 0); - ASSERT_TRUE(entry.count > 0); - ASSERT_EQ(entry.count % 3, 0); - - for (uint32_t i = 0; i < entry.count; i += 3) { - ASSERT_NE(entry.data.i64[i], - ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD); - ASSERT_EQ(entries.find(entry.data.i64[i]), entries.end()); - entries.insert(entry.data.i64[i]); - profiles->emplace_back( - static_cast - (entry.data.i64[i])); - } - - if (!entries.empty()) { - ASSERT_NE(entries.find(ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10), - entries.end()); - } -} - -bool CameraHidlTest::is10BitDynamicRangeCapable(const camera_metadata_t* staticMeta) { - camera_metadata_ro_entry scalarEntry; - int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, - &scalarEntry); - if (rc == 0) { - for (uint32_t i = 0; i < scalarEntry.count; i++) { - if (scalarEntry.data.u8[i] == - ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT) { - return true; - } - } - } - return false; -} - -void CameraHidlTest::verify10BitMetadata(HandleImporter& importer, - const InFlightRequest& request, - CameraMetadataEnumAndroidRequestAvailableDynamicRangeProfilesMap profile) { - for (const auto& b : request.resultOutputBuffers) { - bool smpte2086Present = importer.isSmpte2086Present(b.buffer.buffer.getNativeHandle()); - bool smpte2094_10Present = importer.isSmpte2094_10Present( - b.buffer.buffer.getNativeHandle()); - bool smpte2094_40Present = importer.isSmpte2094_40Present( - b.buffer.buffer.getNativeHandle()); - - switch (static_cast(profile)) { - case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10: - ASSERT_FALSE(smpte2086Present); - ASSERT_FALSE(smpte2094_10Present); - ASSERT_FALSE(smpte2094_40Present); - break; - case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10: - ASSERT_TRUE(smpte2086Present); - ASSERT_FALSE(smpte2094_10Present); - ASSERT_FALSE(smpte2094_40Present); - break; - case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS: - ASSERT_FALSE(smpte2086Present); - ASSERT_FALSE(smpte2094_10Present); - ASSERT_TRUE(smpte2094_40Present); - break; - case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF: - case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO: - case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM: - case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO: - case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF: - case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO: - case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM: - case ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO: - ASSERT_FALSE(smpte2086Present); - ASSERT_TRUE(smpte2094_10Present); - ASSERT_FALSE(smpte2094_40Present); - break; - default: - ALOGE("%s: Unexpected 10-bit dynamic range profile: %" PRId64, - __FUNCTION__, profile); - ADD_FAILURE(); - } - } -} - bool CameraHidlTest::isDepthOnly(const camera_metadata_t* staticMeta) { camera_metadata_ro_entry scalarEntry; camera_metadata_ro_entry depthEntry; @@ -8534,9 +7532,8 @@ void CameraHidlTest::configureSingleStream( sp session3_5; sp session3_6; sp session3_7; - sp session3_8; - castSession(*session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7, &session3_8); + castSession(*session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6, + &session3_7); *useHalBufManager = false; status = find_camera_metadata_ro_entry(staticMeta, @@ -8667,19 +7664,11 @@ void CameraHidlTest::configureSingleStream( void CameraHidlTest::castDevice(const sp& device, int32_t deviceVersion, sp* device3_5 /*out*/, - sp* device3_7 /*out*/, - sp* device3_8 /*out*/) { + sp* device3_7 /*out*/) { ASSERT_NE(nullptr, device3_5); ASSERT_NE(nullptr, device3_7); - ASSERT_NE(nullptr, device3_8); switch (deviceVersion) { - case CAMERA_DEVICE_API_VERSION_3_8: { - auto castResult = device::V3_8::ICameraDevice::castFrom(device); - ASSERT_TRUE(castResult.isOk()); - *device3_8 = castResult; - } - [[fallthrough]]; case CAMERA_DEVICE_API_VERSION_3_7: { auto castResult = device::V3_7::ICameraDevice::castFrom(device); ASSERT_TRUE(castResult.isOk()); @@ -8723,27 +7712,19 @@ void CameraHidlTest::castProvider(const sp& provider, } //Cast camera device session to corresponding version -void CameraHidlTest::castSession(const sp &session, int32_t deviceVersion, - sp *session3_3 /*out*/, - sp *session3_4 /*out*/, - sp *session3_5 /*out*/, - sp *session3_6 /*out*/, - sp *session3_7 /*out*/, - sp *session3_8 /*out*/) { +void CameraHidlTest::castSession(const sp& session, int32_t deviceVersion, + sp* session3_3 /*out*/, + sp* session3_4 /*out*/, + sp* session3_5 /*out*/, + sp* session3_6 /*out*/, + sp* session3_7 /*out*/) { ASSERT_NE(nullptr, session3_3); ASSERT_NE(nullptr, session3_4); ASSERT_NE(nullptr, session3_5); ASSERT_NE(nullptr, session3_6); ASSERT_NE(nullptr, session3_7); - ASSERT_NE(nullptr, session3_8); switch (deviceVersion) { - case CAMERA_DEVICE_API_VERSION_3_8: { - auto castResult = device::V3_8::ICameraDeviceSession::castFrom(session); - ASSERT_TRUE(castResult.isOk()); - *session3_8 = castResult; - } - [[fallthrough]]; case CAMERA_DEVICE_API_VERSION_3_7: { auto castResult = device::V3_7::ICameraDeviceSession::castFrom(session); ASSERT_TRUE(castResult.isOk()); @@ -9661,9 +8642,8 @@ void CameraHidlTest::verifyBuffersReturned( sp session3_5; sp session3_6; sp session3_7; - sp session3_8; - castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, - &session3_6, &session3_7, &session3_8); + castSession(session, deviceVersion, &session3_3, &session3_4, &session3_5, &session3_6, + &session3_7); ASSERT_NE(nullptr, session3_5.get()); hidl_vec streamIds(1); @@ -9905,7 +8885,7 @@ void CameraHidlTest::verifyRecommendedConfigs(const CameraMetadata& chars) { size_t CONFIG_ENTRY_TYPE_OFFSET = 3; size_t CONFIG_ENTRY_BITFIELD_OFFSET = 4; uint32_t maxPublicUsecase = - ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END_3_8; + ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END; uint32_t vendorUsecaseStart = ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VENDOR_START; uint32_t usecaseMask = (1 << vendorUsecaseStart) - 1; -- GitLab From f782f6431c28ca75f17dae5a07e981b41d359ac7 Mon Sep 17 00:00:00 2001 From: Kyle Zhang Date: Mon, 23 May 2022 23:43:38 +0000 Subject: [PATCH 808/825] Add multiple provision attempts in vts openSession test Bug: 233085112 Test: VtsAidlHalDrmTargetTest Change-Id: I4dd42b3c7155b6476f51a8cc4cca185bea7d565f --- drm/aidl/vts/drm_hal_common.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drm/aidl/vts/drm_hal_common.cpp b/drm/aidl/vts/drm_hal_common.cpp index de7dc288ec..7de81670ab 100644 --- a/drm/aidl/vts/drm_hal_common.cpp +++ b/drm/aidl/vts/drm_hal_common.cpp @@ -73,6 +73,7 @@ std::string HalBaseName(const std::string& fullname) { } const char* kDrmIface = "android.hardware.drm.IDrmFactory"; +const int MAX_OPEN_SESSION_ATTEMPTS = 3; std::string HalFullName(const std::string& iface, const std::string& basename) { return iface + '/' + basename; @@ -328,9 +329,19 @@ SessionId DrmHalTest::openSession(SecurityLevel level, Status* err) { */ SessionId DrmHalTest::openSession() { SessionId sessionId; - auto ret = drmPlugin->openSession(SecurityLevel::DEFAULT, &sessionId); - EXPECT_OK(ret); - EXPECT_NE(0u, sessionId.size()); + + int attmpt = 0; + while (attmpt++ < MAX_OPEN_SESSION_ATTEMPTS) { + auto ret = drmPlugin->openSession(SecurityLevel::DEFAULT, &sessionId); + if(DrmErr(ret) == Status::ERROR_DRM_NOT_PROVISIONED) { + provision(); + } else { + EXPECT_OK(ret); + EXPECT_NE(0u, sessionId.size()); + break; + } + } + return sessionId; } -- GitLab From 72415bcfa325e1fe63be70f470324b5a0f671b37 Mon Sep 17 00:00:00 2001 From: Ankit Goyal Date: Thu, 26 May 2022 16:23:22 -0700 Subject: [PATCH 809/825] Do not generate failed status on allocation failure Bug: 218383959 Test: this Change-Id: Ibb37d9cad8004d31c3d7cb75ebfa7839f7d07ed0 --- .../aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp b/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp index c9d058db7b..346c208329 100644 --- a/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp +++ b/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp @@ -153,7 +153,6 @@ class GraphicsTestsBase { if (error == EX_SERVICE_SPECIFIC) { error = status.getServiceSpecificError(); EXPECT_NE(OK, error) << "Failed to set error properly"; - EXPECT_EQ(OK, error) << "Failed to allocate"; } else { EXPECT_EQ(OK, error) << "Allocation transport failure"; } @@ -375,4 +374,4 @@ INSTANTIATE_TEST_CASE_P( [](auto info) -> std::string { std::string name = std::to_string(info.index) + "/" + std::get<2>(info.param).name; return Sanitize(name); - }); \ No newline at end of file + }); -- GitLab From 694e50be3b2b20d24c7cd88d0c8fa71b574a6fd9 Mon Sep 17 00:00:00 2001 From: Ankit Goyal Date: Thu, 26 May 2022 16:24:33 -0700 Subject: [PATCH 810/825] Skip front buffer test if not supported Bug: 218383959 Test: this Change-Id: I61beba63556c1d6a32e220fffd8e4b4fdfd8bd94 --- .../aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp b/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp index 346c208329..59af5cf375 100644 --- a/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp +++ b/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp @@ -277,6 +277,7 @@ TEST_P(GraphicsFrontBufferTests, FrontBufferGpuToCpu) { if (!supported) { ASSERT_EQ(nullptr, buffer.get()) << "Allocation succeeded, but IMapper::isSupported was false"; + GTEST_SKIP(); } else { ASSERT_NE(nullptr, buffer.get()) << "Allocation failed, but IMapper::isSupported was true"; } @@ -318,6 +319,7 @@ TEST_P(GraphicsFrontBufferTests, FrontBufferGpuToGpu) { if (!supported) { ASSERT_EQ(nullptr, buffer.get()) << "Allocation succeeded, but IMapper::isSupported was false"; + GTEST_SKIP(); } else { ASSERT_NE(nullptr, buffer.get()) << "Allocation failed, but IMapper::isSupported was true"; } -- GitLab From 0ae6bb0656aeb1b3cc2a9f79201a6244aaae91f5 Mon Sep 17 00:00:00 2001 From: Shawn Willden Date: Sun, 20 Mar 2022 12:49:46 -0600 Subject: [PATCH 811/825] Implement alternate SE RoT provisioning Bug: 219076736 Test: VtsAidlKeyMintTargetTest Change-Id: Ia696d7765f316d35eba1b4e65acae6c1072987b1 --- .../security/keymint/IKeyMintDevice.aidl | 4 +- .../vts/functional/KeyMintAidlTestBase.cpp | 106 +++++++++--------- .../aidl/vts/functional/KeyMintAidlTestBase.h | 6 +- .../SecureElementProvisioningTest.cpp | 99 +++++++++++++--- 4 files changed, 147 insertions(+), 68 deletions(-) diff --git a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl index da02d54662..95a371096f 100644 --- a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl +++ b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl @@ -873,7 +873,7 @@ interface IKeyMintDevice { * The returned data is an encoded COSE_Mac0 structure, denoted MacedRootOfTrust in the * following CDDL schema. Note that K_mac is the shared HMAC key used for auth tokens, etc.: * - * MacedRootOfTrust = [ ; COSE_Mac0 (untagged) + * MacedRootOfTrust = #6.17 [ ; COSE_Mac0 (tagged) * protected: bstr .cbor { * 1 : 5, ; Algorithm : HMAC-256 * }, @@ -891,7 +891,7 @@ interface IKeyMintDevice { * payload : bstr .cbor RootOfTrust, * ] * - * RootOfTrust = [ + * RootOfTrust = #6.40001 [ ; Tag 40001 indicates RoT v1. * verifiedBootKey : bstr .size 32, * deviceLocked : bool, * verifiedBootState : &VerifiedBootState, diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp index be219940f8..70b89c3280 100644 --- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp +++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp @@ -31,7 +31,6 @@ #include #include -#include #include #include #include @@ -1497,6 +1496,60 @@ void verify_subject_and_serial(const Certificate& certificate, // verify_subject(cert.get(), subject, self_signed); } +void verify_root_of_trust(const vector& verified_boot_key, bool device_locked, + VerifiedBoot verified_boot_state, + const vector& verified_boot_hash) { + char property_value[PROPERTY_VALUE_MAX] = {}; + + if (avb_verification_enabled()) { + EXPECT_NE(property_get("ro.boot.vbmeta.digest", property_value, ""), 0); + string prop_string(property_value); + EXPECT_EQ(prop_string.size(), 64); + EXPECT_EQ(prop_string, bin2hex(verified_boot_hash)); + + EXPECT_NE(property_get("ro.boot.vbmeta.device_state", property_value, ""), 0); + if (!strcmp(property_value, "unlocked")) { + EXPECT_FALSE(device_locked); + } else { + EXPECT_TRUE(device_locked); + } + + // Check that the device is locked if not debuggable, e.g., user build + // images in CTS. For VTS, debuggable images are used to allow adb root + // and the device is unlocked. + if (!property_get_bool("ro.debuggable", false)) { + EXPECT_TRUE(device_locked); + } else { + EXPECT_FALSE(device_locked); + } + } + + // Verified boot key should be all 0's if the boot state is not verified or self signed + std::string empty_boot_key(32, '\0'); + std::string verified_boot_key_str((const char*)verified_boot_key.data(), + verified_boot_key.size()); + EXPECT_NE(property_get("ro.boot.verifiedbootstate", property_value, ""), 0); + if (!strcmp(property_value, "green")) { + EXPECT_EQ(verified_boot_state, VerifiedBoot::VERIFIED); + EXPECT_NE(0, memcmp(verified_boot_key.data(), empty_boot_key.data(), + verified_boot_key.size())); + } else if (!strcmp(property_value, "yellow")) { + EXPECT_EQ(verified_boot_state, VerifiedBoot::SELF_SIGNED); + EXPECT_NE(0, memcmp(verified_boot_key.data(), empty_boot_key.data(), + verified_boot_key.size())); + } else if (!strcmp(property_value, "orange")) { + EXPECT_EQ(verified_boot_state, VerifiedBoot::UNVERIFIED); + EXPECT_EQ(0, memcmp(verified_boot_key.data(), empty_boot_key.data(), + verified_boot_key.size())); + } else if (!strcmp(property_value, "red")) { + EXPECT_EQ(verified_boot_state, VerifiedBoot::FAILED); + } else { + EXPECT_EQ(verified_boot_state, VerifiedBoot::UNVERIFIED); + EXPECT_EQ(0, memcmp(verified_boot_key.data(), empty_boot_key.data(), + verified_boot_key.size())); + } +} + bool verify_attestation_record(int32_t aidl_version, // const string& challenge, // const string& app_id, // @@ -1551,8 +1604,6 @@ bool verify_attestation_record(int32_t aidl_version, // EXPECT_EQ(security_level, att_keymint_security_level); EXPECT_EQ(security_level, att_attestation_security_level); - - char property_value[PROPERTY_VALUE_MAX] = {}; // TODO(b/136282179): When running under VTS-on-GSI the TEE-backed // keymint implementation will report YYYYMM dates instead of YYYYMMDD // for the BOOT_PATCH_LEVEL. @@ -1612,54 +1663,7 @@ bool verify_attestation_record(int32_t aidl_version, // error = parse_root_of_trust(attest_rec->data, attest_rec->length, &verified_boot_key, &verified_boot_state, &device_locked, &verified_boot_hash); EXPECT_EQ(ErrorCode::OK, error); - - if (avb_verification_enabled()) { - EXPECT_NE(property_get("ro.boot.vbmeta.digest", property_value, ""), 0); - string prop_string(property_value); - EXPECT_EQ(prop_string.size(), 64); - EXPECT_EQ(prop_string, bin2hex(verified_boot_hash)); - - EXPECT_NE(property_get("ro.boot.vbmeta.device_state", property_value, ""), 0); - if (!strcmp(property_value, "unlocked")) { - EXPECT_FALSE(device_locked); - } else { - EXPECT_TRUE(device_locked); - } - - // Check that the device is locked if not debuggable, e.g., user build - // images in CTS. For VTS, debuggable images are used to allow adb root - // and the device is unlocked. - if (!property_get_bool("ro.debuggable", false)) { - EXPECT_TRUE(device_locked); - } else { - EXPECT_FALSE(device_locked); - } - } - - // Verified boot key should be all 0's if the boot state is not verified or self signed - std::string empty_boot_key(32, '\0'); - std::string verified_boot_key_str((const char*)verified_boot_key.data(), - verified_boot_key.size()); - EXPECT_NE(property_get("ro.boot.verifiedbootstate", property_value, ""), 0); - if (!strcmp(property_value, "green")) { - EXPECT_EQ(verified_boot_state, VerifiedBoot::VERIFIED); - EXPECT_NE(0, memcmp(verified_boot_key.data(), empty_boot_key.data(), - verified_boot_key.size())); - } else if (!strcmp(property_value, "yellow")) { - EXPECT_EQ(verified_boot_state, VerifiedBoot::SELF_SIGNED); - EXPECT_NE(0, memcmp(verified_boot_key.data(), empty_boot_key.data(), - verified_boot_key.size())); - } else if (!strcmp(property_value, "orange")) { - EXPECT_EQ(verified_boot_state, VerifiedBoot::UNVERIFIED); - EXPECT_EQ(0, memcmp(verified_boot_key.data(), empty_boot_key.data(), - verified_boot_key.size())); - } else if (!strcmp(property_value, "red")) { - EXPECT_EQ(verified_boot_state, VerifiedBoot::FAILED); - } else { - EXPECT_EQ(verified_boot_state, VerifiedBoot::UNVERIFIED); - EXPECT_EQ(0, memcmp(verified_boot_key.data(), empty_boot_key.data(), - verified_boot_key.size())); - } + verify_root_of_trust(verified_boot_key, device_locked, verified_boot_state, verified_boot_hash); att_sw_enforced.Sort(); expected_sw_enforced.Sort(); diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h index 2634ab7868..043d8b5144 100644 --- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h +++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -363,7 +364,10 @@ void verify_serial(X509* cert, const uint64_t expected_serial); void verify_subject_and_serial(const Certificate& certificate, // const uint64_t expected_serial, // const string& subject, bool self_signed); - +void verify_root_of_trust(const vector& verified_boot_key, // + bool device_locked, // + VerifiedBoot verified_boot_state, // + const vector& verified_boot_hash); bool verify_attestation_record(int aidl_version, // const string& challenge, // const string& app_id, // diff --git a/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp b/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp index e630f7008e..c9a156d3e6 100644 --- a/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp +++ b/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp @@ -36,6 +36,8 @@ using std::map; using std::shared_ptr; using std::vector; +constexpr int kRoTVersion1 = 40001; + class SecureElementProvisioningTest : public testing::Test { protected: static void SetUpTestSuite() { @@ -57,6 +59,83 @@ class SecureElementProvisioningTest : public testing::Test { } } + void validateMacedRootOfTrust(const vector& rootOfTrust) { + SCOPED_TRACE(testing::Message() << "RoT: " << bin2hex(rootOfTrust)); + + const auto [macItem, macEndPos, macErrMsg] = cppbor::parse(rootOfTrust); + ASSERT_TRUE(macItem) << "Root of trust parsing failed: " << macErrMsg; + ASSERT_EQ(macItem->semanticTagCount(), 1); + ASSERT_EQ(macItem->semanticTag(0), cppcose::kCoseMac0SemanticTag); + ASSERT_TRUE(macItem->asArray()); + ASSERT_EQ(macItem->asArray()->size(), cppcose::kCoseMac0EntryCount); + + const auto& protectedItem = macItem->asArray()->get(cppcose::kCoseMac0ProtectedParams); + ASSERT_TRUE(protectedItem); + ASSERT_TRUE(protectedItem->asBstr()); + const auto [protMap, protEndPos, protErrMsg] = cppbor::parse(protectedItem->asBstr()); + ASSERT_TRUE(protMap); + ASSERT_TRUE(protMap->asMap()); + ASSERT_EQ(protMap->asMap()->size(), 1); + + const auto& algorithm = protMap->asMap()->get(cppcose::ALGORITHM); + ASSERT_TRUE(algorithm); + ASSERT_TRUE(algorithm->asInt()); + ASSERT_EQ(algorithm->asInt()->value(), cppcose::HMAC_256); + + const auto& unprotItem = macItem->asArray()->get(cppcose::kCoseMac0UnprotectedParams); + ASSERT_TRUE(unprotItem); + ASSERT_TRUE(unprotItem->asMap()); + ASSERT_EQ(unprotItem->asMap()->size(), 0); + + const auto& payload = macItem->asArray()->get(cppcose::kCoseMac0Payload); + ASSERT_TRUE(payload); + ASSERT_TRUE(payload->asBstr()); + validateRootOfTrust(payload->asBstr()->value()); + + const auto& tag = macItem->asArray()->get(cppcose::kCoseMac0Tag); + ASSERT_TRUE(tag); + ASSERT_TRUE(tag->asBstr()); + ASSERT_EQ(tag->asBstr()->value().size(), 32); + // Cannot validate tag correctness. Only the secure side has the necessary key. + } + + void validateRootOfTrust(const vector& payload) { + SCOPED_TRACE(testing::Message() << "RoT payload: " << bin2hex(payload)); + + const auto [rot, rotPos, rotErrMsg] = cppbor::parse(payload); + ASSERT_TRUE(rot); + ASSERT_EQ(rot->semanticTagCount(), 1); + ASSERT_EQ(rot->semanticTag(), kRoTVersion1); + ASSERT_TRUE(rot->asArray()); + ASSERT_EQ(rot->asArray()->size(), 5); + + size_t pos = 0; + + const auto& vbKey = rot->asArray()->get(pos++); + ASSERT_TRUE(vbKey); + ASSERT_TRUE(vbKey->asBstr()); + + const auto& deviceLocked = rot->asArray()->get(pos++); + ASSERT_TRUE(deviceLocked); + ASSERT_TRUE(deviceLocked->asBool()); + + const auto& verifiedBootState = rot->asArray()->get(pos++); + ASSERT_TRUE(verifiedBootState); + ASSERT_TRUE(verifiedBootState->asInt()); + + const auto& verifiedBootHash = rot->asArray()->get(pos++); + ASSERT_TRUE(verifiedBootHash); + ASSERT_TRUE(verifiedBootHash->asBstr()); + + const auto& bootPatchLevel = rot->asArray()->get(pos++); + ASSERT_TRUE(bootPatchLevel); + ASSERT_TRUE(bootPatchLevel->asInt()); + + verify_root_of_trust(vbKey->asBstr()->value(), deviceLocked->asBool()->value(), + static_cast(verifiedBootState->asInt()->value()), + verifiedBootHash->asBstr()->value()); + } + int32_t AidlVersion(shared_ptr keymint) { int32_t version = 0; auto status = keymint->getInterfaceVersion(&version); @@ -96,29 +175,19 @@ TEST_F(SecureElementProvisioningTest, TeeOnly) { vector rootOfTrust1; Status result = tee->getRootOfTrust(challenge1, &rootOfTrust1); - - // TODO: Remove the next line to require TEEs to succeed. - if (!result.isOk()) return; - - ASSERT_TRUE(result.isOk()); - - // TODO: Parse and validate rootOfTrust1 here + ASSERT_TRUE(result.isOk()) << "getRootOfTrust returned " << result.getServiceSpecificError(); + validateMacedRootOfTrust(rootOfTrust1); vector rootOfTrust2; result = tee->getRootOfTrust(challenge2, &rootOfTrust2); ASSERT_TRUE(result.isOk()); - - // TODO: Parse and validate rootOfTrust2 here - + validateMacedRootOfTrust(rootOfTrust2); ASSERT_NE(rootOfTrust1, rootOfTrust2); vector rootOfTrust3; result = tee->getRootOfTrust(challenge1, &rootOfTrust3); ASSERT_TRUE(result.isOk()); - ASSERT_EQ(rootOfTrust1, rootOfTrust3); - - // TODO: Parse and validate rootOfTrust3 here } TEST_F(SecureElementProvisioningTest, TeeDoesNotImplementStrongBoxMethods) { @@ -252,7 +321,7 @@ TEST_F(SecureElementProvisioningTest, ProvisioningTest) { result = tee->getRootOfTrust(challenge, &rootOfTrust); ASSERT_TRUE(result.isOk()); - // TODO: Verify COSE_Mac0 structure and content here. + validateMacedRootOfTrust(rootOfTrust); result = sb->sendRootOfTrust(rootOfTrust); ASSERT_TRUE(result.isOk()); @@ -296,6 +365,8 @@ TEST_F(SecureElementProvisioningTest, InvalidProvisioningTest) { result = tee->getRootOfTrust(challenge, &rootOfTrust); ASSERT_TRUE(result.isOk()); + validateMacedRootOfTrust(rootOfTrust); + vector corruptedRootOfTrust = rootOfTrust; corruptedRootOfTrust[corruptedRootOfTrust.size() / 2]++; result = sb->sendRootOfTrust(corruptedRootOfTrust); -- GitLab From 8292bc9292e21b88cd6df77a3dc0969b349a4264 Mon Sep 17 00:00:00 2001 From: Shawn Willden Date: Thu, 2 Jun 2022 14:04:33 -0600 Subject: [PATCH 812/825] Implement KeyMint2 test for VSR13 Test: VtsAidlKeyMintTargetTest & VtsHalKeymasterV4_0TargetTest Bug: 235099905 Ignore-AOSP-First: Cherry pick from aosp/2115214 Change-Id: Ie10b705bb06990a2a2c6223fcce28f5fde6bf3f3 Merged-In: Ie10b705bb06990a2a2c6223fcce28f5fde6bf3f3 --- .../functional/keymaster_hidl_hal_test.cpp | 35 +++++++++++++++++++ .../vts/functional/KeyMintAidlTestBase.cpp | 22 ++++++++++++ .../aidl/vts/functional/KeyMintAidlTestBase.h | 3 ++ .../aidl/vts/functional/KeyMintTest.cpp | 12 +++++++ 4 files changed, 72 insertions(+) diff --git a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp index bf568600d6..bdaaf96dc4 100644 --- a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp +++ b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -386,6 +387,28 @@ bool avb_verification_enabled() { return property_get("ro.boot.vbmeta.device_state", value, "") != 0; } +int get_vsr_api_level() { + int api_level = ::android::base::GetIntProperty("ro.board.api_level", -1); + if (api_level == -1) { + api_level = ::android::base::GetIntProperty("ro.board.first_api_level", -1); + } + if (api_level == -1) { + api_level = ::android::base::GetIntProperty("ro.vndk.version", -1); + } + // We really should have a VSR API level by now. But on cuttlefish, and perhaps other weird + // devices, we may not. So, we use the SDK first or current API level if needed. If this goes + // wrong, it should go wrong in the direction of being too strict rather than too lenient, which + // should provoke someone to examine why we don't have proper VSR API level properties. + if (api_level == -1) { + api_level = ::android::base::GetIntProperty("ro.product.first_api_level", -1); + } + if (api_level == -1) { + api_level = ::android::base::GetIntProperty("ro.build.version.sdk", -1); + } + EXPECT_NE(api_level, -1) << "Could not find a VSR level, or equivalent."; + return api_level; +} + bool is_gsi() { char property_value[PROPERTY_VALUE_MAX] = {}; EXPECT_NE(property_get("ro.product.system.name", property_value, ""), 0); @@ -4833,6 +4856,18 @@ TEST_P(TransportLimitTest, LargeFinishInput) { INSTANTIATE_KEYMASTER_HIDL_TEST(TransportLimitTest); +using VsrRequirementTest = KeymasterHidlTest; + +TEST_P(VsrRequirementTest, Vsr13Test) { + int vsr_api_level = get_vsr_api_level(); + if (vsr_api_level < 33) { + GTEST_SKIP() << "Applies only to VSR API level 33, this device is: " << vsr_api_level; + } + FAIL() << "VSR 13+ requires KeyMint version 2"; +} + +INSTANTIATE_KEYMASTER_HIDL_TEST(VsrRequirementTest); + } // namespace test } // namespace V4_0 } // namespace keymaster diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp index be219940f8..6f21d3e6e7 100644 --- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp +++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp @@ -1461,6 +1461,28 @@ void verify_subject(const X509* cert, // OPENSSL_free(cert_issuer); } +int get_vsr_api_level() { + int api_level = ::android::base::GetIntProperty("ro.board.api_level", -1); + if (api_level == -1) { + api_level = ::android::base::GetIntProperty("ro.board.first_api_level", -1); + } + if (api_level == -1) { + api_level = ::android::base::GetIntProperty("ro.vndk.version", -1); + } + // We really should have a VSR API level by now. But on cuttlefish, and perhaps other weird + // devices, we may not. So, we use the SDK first or current API level if needed. If this goes + // wrong, it should go wrong in the direction of being too strict rather than too lenient, which + // should provoke someone to examine why we don't have proper VSR API level properties. + if (api_level == -1) { + api_level = ::android::base::GetIntProperty("ro.product.first_api_level", -1); + } + if (api_level == -1) { + api_level = ::android::base::GetIntProperty("ro.build.version.sdk", -1); + } + EXPECT_NE(api_level, -1) << "Could not find a VSR level, or equivalent."; + return api_level; +} + bool is_gsi_image() { std::ifstream ifs("/system/system_ext/etc/init/init.gsi.rc"); return ifs.good(); diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h index 2634ab7868..abbfb398df 100644 --- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h +++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h @@ -354,6 +354,9 @@ void add_tag_from_prop(AuthorizationSetBuilder* tags, TypedTag Date: Sat, 4 Jun 2022 00:16:44 +0000 Subject: [PATCH 813/825] [VTS] Update allocator name for AIDL allocator. We used "default" value for the allocator in the test and this value was used as is for the AIDL allocator. This caused the test to fail because we were not able to acquire the appropriate allocator as AIDL allocator instance is not named "default". Update the test to use the correct instance name for AIDL allocator, if available. Test: atest VtsHalGraphicsComposerV2_1TargetTest atest VtsHalGraphicsComposerV2_2TargetTest atest VtsHalGraphicsComposerV2_3TargetTest atest VtsHalGraphicsComposerV2_4TargetTest atest VtsHalGraphicsComposer3_TargetTest BUG: 234671596 test results after updates: VTS 2.1 : http://ab/I84600010058657636 VTS 2.2 : http://ab/I51800010058498973 VTS 2.3 : http://ab/I87700010058914863 VTS 2.4 : http://ab/I88900010058592031 VTS 3.0 : http://ab/I96200010058838905 Change-Id: I04ae1a18d757cfd941d4929ad08f6bb2c8643f76 --- .../composer/2.1/utils/vts/ComposerVts.cpp | 8 +++++-- .../include/composer-vts/2.1/ComposerVts.h | 1 + .../composer/2.2/utils/vts/ComposerVts.cpp | 8 +++++-- .../include/composer-vts/2.2/ComposerVts.h | 1 + graphics/mapper/4.0/utils/vts/MapperVts.cpp | 22 +++++++++++-------- .../vts/include/mapper-vts/4.0/MapperVts.h | 11 +++++++--- 6 files changed, 35 insertions(+), 16 deletions(-) diff --git a/graphics/composer/2.1/utils/vts/ComposerVts.cpp b/graphics/composer/2.1/utils/vts/ComposerVts.cpp index e777010483..4603dd1b8c 100644 --- a/graphics/composer/2.1/utils/vts/ComposerVts.cpp +++ b/graphics/composer/2.1/utils/vts/ComposerVts.cpp @@ -316,8 +316,12 @@ NativeHandleWrapper::~NativeHandleWrapper() { Gralloc::Gralloc() { [this] { - ASSERT_NO_FATAL_FAILURE(mGralloc4 = std::make_shared("default", "default", - /*errOnFailure=*/false)); + ASSERT_NO_FATAL_FAILURE(mGralloc4 = std::make_shared( + /*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("default", "default", 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 2949823364..f8ea661f12 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 @@ -49,6 +49,7 @@ 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; diff --git a/graphics/composer/2.2/utils/vts/ComposerVts.cpp b/graphics/composer/2.2/utils/vts/ComposerVts.cpp index 7de4007d01..b706596df4 100644 --- a/graphics/composer/2.2/utils/vts/ComposerVts.cpp +++ b/graphics/composer/2.2/utils/vts/ComposerVts.cpp @@ -182,8 +182,12 @@ std::array ComposerClient::getDataspaceSaturationMatrix(Dataspace dat Gralloc::Gralloc() { [this] { ALOGD("Attempting to initialize gralloc4"); - ASSERT_NO_FATAL_FAILURE(mGralloc4 = std::make_shared("default", "default", - /*errOnFailure=*/false)); + ASSERT_NO_FATAL_FAILURE(mGralloc4 = std::make_shared( + /*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"); 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 d3bba17ed3..02d7bdb9da 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 @@ -48,6 +48,7 @@ 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; diff --git a/graphics/mapper/4.0/utils/vts/MapperVts.cpp b/graphics/mapper/4.0/utils/vts/MapperVts.cpp index e4a2535a92..c6c9834eaf 100644 --- a/graphics/mapper/4.0/utils/vts/MapperVts.cpp +++ b/graphics/mapper/4.0/utils/vts/MapperVts.cpp @@ -27,21 +27,24 @@ namespace mapper { namespace V4_0 { namespace vts { -Gralloc::Gralloc(const std::string& allocatorServiceName, const std::string& mapperServiceName, +Gralloc::Gralloc(const std::string& aidlAllocatorServiceName, + const std::string& hidlAllocatorServiceName, const std::string& mapperServiceName, bool errOnFailure) { if (errOnFailure) { - init(allocatorServiceName, mapperServiceName); + init(aidlAllocatorServiceName, hidlAllocatorServiceName, mapperServiceName); } else { - initNoErr(allocatorServiceName, mapperServiceName); + initNoErr(aidlAllocatorServiceName, hidlAllocatorServiceName, mapperServiceName); } } -void Gralloc::init(const std::string& allocatorServiceName, const std::string& mapperServiceName) { +void Gralloc::init(const std::string& aidlAllocatorServiceName, + const std::string& hidlAllocatorServiceName, + const std::string& mapperServiceName) { mAidlAllocator = aidl::android::hardware::graphics::allocator::IAllocator::fromBinder( - ndk::SpAIBinder(AServiceManager_checkService(allocatorServiceName.c_str()))); + ndk::SpAIBinder(AServiceManager_checkService(aidlAllocatorServiceName.c_str()))); if (mAidlAllocator == nullptr) { - mHidlAllocator = IAllocator::getService(allocatorServiceName); + mHidlAllocator = IAllocator::getService(hidlAllocatorServiceName); } ASSERT_TRUE(nullptr != mAidlAllocator || mHidlAllocator != nullptr) << "failed to get allocator service"; @@ -51,13 +54,14 @@ void Gralloc::init(const std::string& allocatorServiceName, const std::string& m ASSERT_FALSE(mMapper->isRemote()) << "mapper is not in passthrough mode"; } -void Gralloc::initNoErr(const std::string& allocatorServiceName, +void Gralloc::initNoErr(const std::string& aidlAllocatorServiceName, + const std::string& hidlAllocatorServiceName, const std::string& mapperServiceName) { mAidlAllocator = aidl::android::hardware::graphics::allocator::IAllocator::fromBinder( - ndk::SpAIBinder(AServiceManager_checkService(allocatorServiceName.c_str()))); + ndk::SpAIBinder(AServiceManager_checkService(aidlAllocatorServiceName.c_str()))); if (mAidlAllocator == nullptr) { - mHidlAllocator = IAllocator::getService(allocatorServiceName); + mHidlAllocator = IAllocator::getService(hidlAllocatorServiceName); } mMapper = IMapper::getService(mapperServiceName); diff --git a/graphics/mapper/4.0/utils/vts/include/mapper-vts/4.0/MapperVts.h b/graphics/mapper/4.0/utils/vts/include/mapper-vts/4.0/MapperVts.h index b956e494aa..ecbbc58c42 100644 --- a/graphics/mapper/4.0/utils/vts/include/mapper-vts/4.0/MapperVts.h +++ b/graphics/mapper/4.0/utils/vts/include/mapper-vts/4.0/MapperVts.h @@ -49,7 +49,9 @@ class Gralloc { kToleranceAllErrors = ~0x0U, }; - Gralloc(const std::string& allocatorServiceName = "default", + Gralloc(const std::string& aidlAllocatorServiceName = + "android.hardware.graphics.allocator.IAllocator/default", + const std::string& hidlAllocatorServiceName = "default", const std::string& mapperServiceName = "default", bool errOnFailure = true); ~Gralloc(); @@ -164,10 +166,13 @@ class Gralloc { 0x1U << std::underlying_type_t(error)) != 0; } - void init(const std::string& allocatorServiceName, const std::string& mapperServiceName); + void init(const std::string& aidlAllocatorServiceName, + const std::string& hidlAllocatorServiceName, const std::string& mapperServiceName); // initialize without checking for failure to get service - void initNoErr(const std::string& allocatorServiceName, const std::string& mapperServiceName); + void initNoErr(const std::string& aidlAllocatorServiceName, + const std::string& hidlAllocatorServiceName, + const std::string& mapperServiceName); const native_handle_t* cloneBuffer(const hidl_handle& rawHandle, enum Tolerance tolerance); const native_handle_t* cloneBuffer(const hidl_handle& rawHandle) { return cloneBuffer(rawHandle, Tolerance::kToleranceStrict); -- GitLab From dcf3c519fc024b5317d689e24e0de41a5fadc9ee Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Thu, 9 Jun 2022 23:01:28 +0000 Subject: [PATCH 814/825] Minor fixes on VTS tests - call startSvStatus()/startNmea() before calling start(). This will avoid missing the first SvStatus - in TestGnssSvInfoFieldsTest, avoid calling list::back() if the list is empty. Bug: 235062809 Test: atest VtsHalGnssTargetTest Change-Id: I612d42e23085dbb0b32da328869bfd443ee66362 --- gnss/aidl/vts/gnss_hal_test.cpp | 10 +++++----- gnss/aidl/vts/gnss_hal_test_cases.cpp | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gnss/aidl/vts/gnss_hal_test.cpp b/gnss/aidl/vts/gnss_hal_test.cpp index 407ac0cad8..0e1218e40c 100644 --- a/gnss/aidl/vts/gnss_hal_test.cpp +++ b/gnss/aidl/vts/gnss_hal_test.cpp @@ -141,18 +141,18 @@ bool GnssHalTest::StartAndCheckFirstLocation(const int min_interval_msec, const } SetPositionMode(min_interval_msec, low_power_mode); - auto status = aidl_gnss_hal_->start(); - EXPECT_TRUE(status.isOk()); - if (start_sv_status) { - status = aidl_gnss_hal_->startSvStatus(); + auto status = aidl_gnss_hal_->startSvStatus(); EXPECT_TRUE(status.isOk()); } if (start_nmea) { - status = aidl_gnss_hal_->startNmea(); + auto status = aidl_gnss_hal_->startNmea(); EXPECT_TRUE(status.isOk()); } + auto status = aidl_gnss_hal_->start(); + EXPECT_TRUE(status.isOk()); + /* * GnssLocationProvider support of AGPS SUPL & XtraDownloader is not available in VTS, * so allow time to demodulate ephemeris over the air. diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index f926c40884..3696233d3b 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -291,10 +291,12 @@ TEST_P(GnssHalTest, TestGnssSvInfoFields) { EXPECT_GT(aidl_gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_lists, kNumSvInfoLists, kTimeoutSeconds), 0); - last_sv_info_list = sv_info_lists.back(); - } while (last_sv_info_list.size() == 0); + if (!sv_info_lists.empty()) { + last_sv_info_list = sv_info_lists.back(); + ALOGD("last_sv_info size = %d", (int)last_sv_info_list.size()); + } + } while (!sv_info_lists.empty() && last_sv_info_list.size() == 0); - ALOGD("last_sv_info size = %d", (int)last_sv_info_list.size()); bool nonZeroCn0Found = false; for (auto sv_info : last_sv_info_list) { EXPECT_TRUE(sv_info.basebandCN0DbHz >= 0.0 && sv_info.basebandCN0DbHz <= 65.0); -- GitLab From c3253373527a2508ae29cb1e915522db171d2ca5 Mon Sep 17 00:00:00 2001 From: Brian Duddie Date: Thu, 9 Jun 2022 12:37:53 -0700 Subject: [PATCH 815/825] Support AIDL IAllocator for direct channel tests Bug: 234673324 Test: atest VtsHalSensorsV2_1TargetTest -> DirectChannelGralloc pass on device using AIDL IAllocator Change-Id: I169d3bc863f7e588f42e408f151064066b9960cc --- sensors/1.0/vts/functional/Android.bp | 10 ++- sensors/2.0/vts/functional/Android.bp | 9 ++- sensors/2.1/vts/functional/Android.bp | 6 +- sensors/aidl/vts/Android.bp | 3 +- sensors/common/vts/utils/Android.bp | 23 ++++++ sensors/common/vts/utils/GrallocWrapper.cpp | 88 ++++++++++++++++----- 6 files changed, 114 insertions(+), 25 deletions(-) diff --git a/sensors/1.0/vts/functional/Android.bp b/sensors/1.0/vts/functional/Android.bp index 274cfa7fd6..d53179a380 100644 --- a/sensors/1.0/vts/functional/Android.bp +++ b/sensors/1.0/vts/functional/Android.bp @@ -26,7 +26,10 @@ package { cc_test { name: "VtsHalSensorsV1_0TargetTest", cflags: ["-DLOG_TAG=\"sensors_hidl_hal_test\""], - defaults: ["VtsHalTargetTestDefaults"], + defaults: [ + "VtsHalSensorsDefaults", + "VtsHalTargetTestDefaults", + ], tidy_timeout_srcs: [ "VtsHalSensorsV1_0TargetTest.cpp", ], @@ -34,9 +37,12 @@ cc_test { "SensorsHidlEnvironmentV1_0.cpp", "VtsHalSensorsV1_0TargetTest.cpp", ], + shared_libs: [ + "libbinder_ndk", + "libvndksupport", + ], static_libs: [ "android.hardware.sensors@1.0", - "VtsHalSensorsTargetTestUtils", ], test_suites: [ "general-tests", diff --git a/sensors/2.0/vts/functional/Android.bp b/sensors/2.0/vts/functional/Android.bp index c4ec866fc1..62eaf6b765 100644 --- a/sensors/2.0/vts/functional/Android.bp +++ b/sensors/2.0/vts/functional/Android.bp @@ -26,7 +26,10 @@ package { cc_test { name: "VtsHalSensorsV2_0TargetTest", cflags: ["-DLOG_TAG=\"sensors_hidl_hal_test\""], - defaults: ["VtsHalTargetTestDefaults"], + defaults: [ + "VtsHalSensorsDefaults", + "VtsHalTargetTestDefaults", + ], tidy_timeout_srcs: [ "VtsHalSensorsV2_0TargetTest.cpp", ], @@ -36,13 +39,15 @@ cc_test { header_libs: [ "android.hardware.sensors@2.X-shared-utils", ], + shared_libs: [ + "libbinder_ndk", + ], static_libs: [ "android.hardware.sensors@1.0", "android.hardware.sensors@1.0-convert", "android.hardware.sensors@2.0", "android.hardware.sensors@2.1", "libfmq", - "VtsHalSensorsTargetTestUtils", "VtsHalSensorsV2_0TargetTest-lib", ], test_suites: [ diff --git a/sensors/2.1/vts/functional/Android.bp b/sensors/2.1/vts/functional/Android.bp index 3659e11ffc..61cfd14d15 100644 --- a/sensors/2.1/vts/functional/Android.bp +++ b/sensors/2.1/vts/functional/Android.bp @@ -28,7 +28,10 @@ cc_test { cflags: [ "-DLOG_TAG=\"sensors_hidl_hal_test\"", ], - defaults: ["VtsHalTargetTestDefaults"], + defaults: [ + "VtsHalSensorsDefaults", + "VtsHalTargetTestDefaults", + ], srcs: [ "VtsHalSensorsV2_1TargetTest.cpp", ], @@ -41,7 +44,6 @@ cc_test { "android.hardware.sensors@2.0", "android.hardware.sensors@2.1", "libfmq", - "VtsHalSensorsTargetTestUtils", "VtsHalSensorsV2_1TargetTest-lib", ], test_suites: [ diff --git a/sensors/aidl/vts/Android.bp b/sensors/aidl/vts/Android.bp index b5a5f15691..f3972ec2a3 100644 --- a/sensors/aidl/vts/Android.bp +++ b/sensors/aidl/vts/Android.bp @@ -24,8 +24,9 @@ package { cc_test { name: "VtsAidlHalSensorsTargetTest", defaults: [ - "VtsHalTargetTestDefaults", "use_libaidlvintf_gtest_helper_static", + "VtsHalSensorsDefaults", + "VtsHalTargetTestDefaults", ], srcs: [ "VtsAidlHalSensorsTargetTest.cpp", diff --git a/sensors/common/vts/utils/Android.bp b/sensors/common/vts/utils/Android.bp index 44bed6e002..08b6afa202 100644 --- a/sensors/common/vts/utils/Android.bp +++ b/sensors/common/vts/utils/Android.bp @@ -23,6 +23,23 @@ package { default_applicable_licenses: ["hardware_interfaces_license"], } +// Prefer to use these defaults to pull in VtsHalSensorsTargetTestUtils + its +// dependencies +cc_defaults { + name: "VtsHalSensorsDefaults", + shared_libs: [ + "android.hardware.graphics.allocator-V1-ndk", + "android.hardware.graphics.common-V3-ndk", + "libbinder_ndk", + "libutils", + "libvndksupport", + ], + static_libs: [ + "libaidlcommonsupport", + "VtsHalSensorsTargetTestUtils", + ], +} + cc_library_static { name: "VtsHalSensorsTargetTestUtils", defaults: ["VtsHalTargetTestDefaults"], @@ -36,13 +53,19 @@ cc_library_static { local_include_dirs: [ "include/sensors-vts-utils", ], + // Targets that depend on us need to also include these shared_libs: [ + "android.hardware.graphics.allocator-V1-ndk", + "android.hardware.graphics.common-V3-ndk", + "libbinder_ndk", "libutils", + "libvndksupport", ], static_libs: [ "android.hardware.sensors@1.0", "android.hardware.sensors@2.0", "android.hardware.sensors@2.1", + "libaidlcommonsupport", ], whole_static_libs: [ "android.hardware.graphics.allocator@2.0", diff --git a/sensors/common/vts/utils/GrallocWrapper.cpp b/sensors/common/vts/utils/GrallocWrapper.cpp index 47d1f42152..e6e088826b 100644 --- a/sensors/common/vts/utils/GrallocWrapper.cpp +++ b/sensors/common/vts/utils/GrallocWrapper.cpp @@ -16,6 +16,9 @@ #include "GrallocWrapper.h" +#include +#include +#include #include #include #include @@ -27,8 +30,10 @@ #include #include +#include #include +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; @@ -41,6 +46,9 @@ 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; @@ -97,10 +105,11 @@ using BaseTypeOfFirstArg = typename std::remove_const< // 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 +template typename AllocatorWrapperT = sp> class GrallocHalWrapper : public IGrallocHalWrapper { public: - GrallocHalWrapper(const sp& allocator, const sp& mapper) + GrallocHalWrapper(const AllocatorWrapperT& allocator, const sp& mapper) : mAllocator(allocator), mMapper(mapper) { if (mapper->isRemote()) { ALOGE("Mapper is in passthrough mode"); @@ -116,7 +125,7 @@ class GrallocHalWrapper : public IGrallocHalWrapper { private: static constexpr uint64_t kBufferUsage = static_cast(BufferUsage::SENSOR_DIRECT_DATA | BufferUsage::CPU_READ_OFTEN); - sp mAllocator; + AllocatorWrapperT mAllocator; sp mMapper; // v2.0 and v3.0 use vec for BufferDescriptor, but v4.0 uses vec, so use @@ -128,8 +137,34 @@ class GrallocHalWrapper : public IGrallocHalWrapper { native_handle_t* importBuffer(const hidl_handle& rawHandle); }; -template -native_handle_t* GrallocHalWrapper::allocate(uint32_t size) { +template <> +native_handle_t* GrallocHalWrapper::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(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 AllocatorWrapperT> +native_handle_t* GrallocHalWrapper::allocate( + uint32_t size) { constexpr uint32_t kBufferCount = 1; BufferDescriptorT descriptor = getDescriptor(size); native_handle_t* bufferHandle = nullptr; @@ -149,17 +184,18 @@ native_handle_t* GrallocHalWrapper::allocate(uint32_t size) return bufferHandle; } -template -void GrallocHalWrapper::freeBuffer(native_handle_t* bufferHandle) { +template typename AllocatorWrapperT> +void GrallocHalWrapper::freeBuffer( + native_handle_t* bufferHandle) { auto error = mMapper->freeBuffer(bufferHandle); if (!error.isOk() || failed(error)) { ALOGE("Failed to free buffer %p", bufferHandle); } } -template -typename GrallocHalWrapper::BufferDescriptorT -GrallocHalWrapper::getDescriptor(uint32_t size) { +template typename AllocatorWrapperT> +typename GrallocHalWrapper::BufferDescriptorT +GrallocHalWrapper::getDescriptor(uint32_t size) { typename MapperT::BufferDescriptorInfo descriptorInfo = { .width = size, .height = 1, @@ -181,8 +217,8 @@ GrallocHalWrapper::getDescriptor(uint32_t size) { return descriptor; } -template -native_handle_t* GrallocHalWrapper::importBuffer( +template typename AllocatorWrapperT> +native_handle_t* GrallocHalWrapper::importBuffer( const hidl_handle& rawHandle) { native_handle_t* bufferHandle = nullptr; @@ -198,8 +234,9 @@ native_handle_t* GrallocHalWrapper::importBuffer( return bufferHandle; } -template -void* GrallocHalWrapper::lock(native_handle_t* bufferHandle) { +template typename AllocatorWrapperT> +void* GrallocHalWrapper::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 @@ -218,8 +255,9 @@ void* GrallocHalWrapper::lock(native_handle_t* bufferHandle return data; } -template -void GrallocHalWrapper::unlock(native_handle_t* bufferHandle) { +template typename AllocatorWrapperT> +void GrallocHalWrapper::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, @@ -234,8 +272,22 @@ GrallocWrapper::GrallocWrapper() { sp allocator4 = IAllocator4::getService(); sp mapper4 = IMapper4::getService(); - if (allocator4 != nullptr && mapper4 != nullptr) { - ALOGD("Using IAllocator/IMapper v4.0"); + const auto kAllocatorSvc = std::string(IAllocatorAidl::descriptor) + "/default"; + std::shared_ptr 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( + new GrallocHalWrapper(allocatorAidl, + mapper4)); + } else if (allocator4 != nullptr && mapper4 != nullptr) { + ALOGD("AIDL IAllocator not found, using HIDL IAllocator/IMapper v4.0"); mGrallocHal = std::unique_ptr( new GrallocHalWrapper(allocator4, mapper4)); } else { -- GitLab From c08e808a781b75bf949c59d53c472df08c44e063 Mon Sep 17 00:00:00 2001 From: Max Bires Date: Fri, 27 May 2022 12:05:39 -0700 Subject: [PATCH 816/825] Add a README for Remote Key Provisioning. This document goes a little more in depth on the motivating factors and background mechanisms that occur with RKP, that are not appropriate for direct inclusion in the HAL docs in the .aidl files. Bug: 234159998 Test: Readable Change-Id: I141fb098c536a5468b1113af64dcf6185ea7ae9f --- security/keymint/RKP_README.md | 374 +++++++++++++++++++++++++++++++++ 1 file changed, 374 insertions(+) create mode 100644 security/keymint/RKP_README.md diff --git a/security/keymint/RKP_README.md b/security/keymint/RKP_README.md new file mode 100644 index 0000000000..89a2598f66 --- /dev/null +++ b/security/keymint/RKP_README.md @@ -0,0 +1,374 @@ +# Remote Provisioning HAL + +## Objective + +Design a HAL to support over-the-air provisioning of certificates for asymmetric +keys. The HAL must interact effectively with Keystore (and other daemons) and +protect device privacy and security. + +Note that this API is designed for KeyMint, but with the intention that it +should be usable for other HALs that require certificate provisioning. +Throughout this document we'll refer to the Keystore and KeyMint (formerly +called Keymaster) components, but only for concreteness and convenience; those +labels could be replaced with the names of any system and secure area +components, respectively, that need certificates provisioned. + +## Key design decisions + +### General approach + +To more securely and reliably get keys and certificates to Android devices, we +need to create a system where no party outside of the device's secure components +is responsible for managing private keys. The strategy we've chosen is to +deliver certificates over the air, using an asymmetric key pair created +on-device in the factory as a root of trust to create an authenticated, secure +channel. In this document we refer to this device-unique asymmetric key pair as +Device Key (DK), its public half DK\_pub, its private half DK\_priv and a Device +Key Certificate containing DK\_pub is denoted DKC. + +In order for the provisioning service to use DK (or a key authenticated by DK), +it must know whether a given DK\_pub is known and trusted. To prove trust, we +ask device OEMs to use one of two mechanisms: + +1. (Preferred, recommended) The device OEM extracts DK\_pub from each device it + manufactures and uploads the public keys to a backend server. + +1. The device OEM signs the DK\_pub to produce DKC and stores it on the device. + This has the advantage that they don't need to upload a DK\_pub for every + device immediately, but the disadvantage that they have to manage their + private signing keys, which means they have to have HSMs, configure and + secure them correctly, etc. Some backend providers may also require that the + OEM passes a factory security audit, and additionally promises to upload the + keys eventually as well. + +Note that in the full elaboration of this plan, DK\_pub is not the key used to +establish a secure channel. Instead, DK\_pub is just the first public key in a +chain of public keys which ends with the KeyMint public key, KM\_pub. All keys +in the chain are device-unique and are joined in a certificate chain called the +_Boot Certificate Chain_ (BCC), because in phases 2 and 3 of the remote +provisioning project it is a chain of certificates corresponding to boot phases. +We speak of the BCC even for phase 1, though in phase 1 it contains only a +single self-signed DKC. This is described in more depth in the Phases section +below. + +The BCC is authenticated by DK\_pub. To authenticate DK\_pub, we may have +additional DKCs, from the SoC vendor, the device OEM, or both. Those are not +part of the BCC but included as optional fields in the certificate request +structure. + +The format of the the DK and BCC is specified within [Open Profile for DICE] +(https://pigweed.googlesource.com/open-dice/+/HEAD/docs/specification.md). To +map phrases within this document to their equivalent terminology in the DICE +specification, read the terms as follows: the DK corresponds to the UDS-derived +key pair, DKC corresponds to the UDS certificate, and the BCC entries between +DK\_pub and KM\_pub correspond to a chain of CDI certificates. + +Note: In addition to allowing 32 byte hash values for fields in the BCC payload, +this spec additionally constrains some of the choices allowed in open-DICE. +Specifically, these include which entries are required and which are optional in +the BCC payload, and which algorithms are acceptable for use. + +### Phases + +RKP will be deployed in three phases, in terms of managing the root of trust +binding between the device and the backend. To briefly describe them: + +* Phase 1: In phase 1 there is only one entry in the BCC; DK_pub and KM_pub are + the same key and the certificate is self-signed. +* Phase 2: This is identical to phase 1, except it leverages the hardware root + of trust process described by DICE. Instead of trust being rooted in the TEE, + it is now rooted in the ROM by key material blown into fuses which are only + accessible to the ROM code. +* Phase 3: This is identical to Phase 2, except the SoC vendor also does the + public key extraction or certification in their facilities, along with the OEM + doing it in the factory. This tightens up the "supply chain" and aims to make + key upload management more secure. + +### Privacy considerations + +Because DK and the DKCs are unique, immutable, unspoofable hardware-bound +identifiers for the device, we must limit access to them to the absolute minimum +possible. We do this in two ways: + +1. We require KeyMint (which knows the BCC and either knows or at least has the +ability to use KM\_priv) to refuse to ever divulge the BCC or additional +signatures in plaintext. Instead, KeyMint requires the caller to provide an +_Endpoint Encryption Key_ (EEK), with which it will encrypt the data before +returning it. When provisioning production keys, the EEK must be signed by an +approved authority whose public key is embedded in KeyMint. When certifying test +keys, KeyMint will accept any EEK without checking the signature, but will +encrypt and return a test BCC, rather than the real one. The result is that +only an entity in possession of an Trusted EEK (TEEK) private key can discover +the plaintext of the production BCC. +1. Having thus limited access to the public keys to the trusted party only, we +need to prevent the entity from abusing this unique device identifier. The +approach and mechanisms for doing that are beyond the scope of this document +(they must be addressed in the server design), but generally involve taking care +to ensure that we do not create any links between user IDs, IP addresses or +issued certificates and the device pubkey. + +Although the details of the mechanisms for preventing the entity from abusing +the BCC are, as stated, beyond the scope of this document, there is a subtle +design decision here made specifically to enable abuse prevention. Specifically +the `CertificateRequest` message sent to the server is (in +[CDDL](https://tools.ietf.org/html/rfc8610)): + +``` +cddl +CertificateRequest = [ + DeviceInfo, + challenge : bstr, + ProtectedData, + MacedKeysToSign +] +``` + +The public keys to be attested by the server are in `MacedKeysToSign`, which is +a COSE\_Mac0 structure, MACed with a key that is found in `ProtectedData`. The +MAC key is signed by DK\_pub. + +This structure allows the backend component that has access to EEK\_priv to +decrypt `ProtectedData`, validate that the request is from an authorized device, +check that the request is fresh and verify and extract the MAC key. That backend +component never sees any data related to the keys to be signed, but can provide +the MAC key to another backend component that can verify `MacedKeysToSign` and +proceed to generate the certificates. + +In this way, we can partition the provisioning server into one component that +knows the device identity, as represented by DK\_pub, but never sees the keys to +be certified or certificates generated, and another component that sees the keys +to be certified and certificates generated but does not know the device +identity. + +### Key and cryptographic message formatting + +For simplicity of generation and parsing, compactness of wire representation, +and flexibility and standardization, we've settled on using the CBOR Object +Signing and Encryption (COSE) standard, defined in [RFC +8152](https://tools.ietf.org/html/rfc8152). COSE provides compact and reasonably +simple, yet easily-extensible, wire formats for: + +* Keys, +* MACed messages, +* Signed messages, and +* Encrypted messages + +COSE enables easy layering of these message formats, such as using a COSE\_Sign +structure to contain a COSE\_Key with a public key in it. We call this a +"certificate". + +Due to the complexity of the standard, we'll spell out the COSE structures +completely in this document and in the HAL and other documentation, so that +although implementors will need to understand CBOR and the CBOR Data Definition +Language ([CDDL, defined in RFC 8610](https://tools.ietf.org/html/rfc8610)), +they shouldn't need to understand COSE. + +Note, however, that the certificate chains returned from the provisioning server +are standard X.509 certificates. + +### Algorithm choices + +This document uses: + +* ECDSA P-256 for attestation signing keys; +* Remote provisioning protocol signing keys: + * Ed25519 / P-256 +* ECDH keys: + * X25519 / P-256 +* AES-GCM for all encryption; +* SHA-256 for all message digesting; +* HMAC-SHA-256 for all MACing; and +* HKDF-SHA-256 for all key derivation. + +We believe that Curve25519 offers the best tradeoff in terms of security, +efficiency and global trustworthiness, and that it is now sufficiently +widely-used and widely-implemented to make it a practical choice. + +However, since Secure Elements (SE) do not currently offer support for curve +25519, we are allowing implementations to instead make use of EC P-256 for +signing and ECDH. To put it simply, the device unique key pair will be a P-256 +key pair for ECDSA instead of Ed25519, and the ProtectedData COSE\_Encrypt +message will have its payload encrypted with P-256 ECDH key exchange instead of +X25519. + +The CDDL in the rest of the document will use the '/' operator to show areas +where either curve 25519 or P-256 may be used. Since there is no easy way to +bind choices across different CDDL groups, it is important that the implementor +stays consistent in which type is chosen. E.g. taking ES256 as the choice for +algorithm implies the implementor should also choose the P256 public key group +further down in the COSE structure. + +### Testability + +It's critical that the remote provisioning implementation be testable, to +minimize the probability that broken devices are sold to end users. To support +testing, the remote provisioning HAL methods take a `testMode` argument. Keys +created in test mode are tagged to indicate this. The provisioning server will +check for the test mode tag and issue test certificates that do not chain back +to a trusted public key. In test mode, any EEK will be accepted, enabling +testing tools to use EEKs for which they have the private key so they can +validate the content of certificate requests. The BCC included in the +`CertificateRequest` must contain freshly-generated keys, not the real BCC keys. + +Keystore (or similar) will need to be able to handle both testMode keys and +production keys and keep them distinct, generating test certificate requests +when asked with a test EEK and production certificate requests when asked with a +production EEK. Likewise, the interface used to instruct Keystore to create keys +will need to be able to specify whether test or production keys are desired. + +## Design + +### Certificate provisioning flow + +TODO(jbires): Replace this with a `.png` containing a sequence diagram. The +provisioning flow looks something like this: + +Provisioner -> Keystore: Prepare N keys +Keystore -> KeyMint: generateKeyPair +KeyMint -> KeyMint: Generate key pair +KeyMint --> Keystore: key\_blob,pubkey +Keystore -> Keystore: Store key\_blob,pubkey +Provisioner -> Server: Get TEEK +Server --> Provisioner: TEEK +Provisioner -> Keystore: genCertReq(N, TEEK) +Keystore -> KeyMint: genCertReq(pubkeys, TEEK) +KeyMint -> KeyMint: Sign pubkeys & encrypt BCC +KeyMint --> Keystore: signature, encrypted BCC +Keystore -> Keystore: Construct cert\_request +Keystore --> Provisioner: cert\_request +Provisioner --> Server: cert\_request +Server -> Server: Validate cert\_request +Server -> Server: Generate certificates +Server --> Provisioner: certificates +Provisioner -> Keystore: certificates +Keystore -> Keystore: Store certificates + +The actors in the above diagram are: + +* **Server** is the backend certificate provisioning server. It has access to + the uploaded device public keys and is responsible for providing encryption + keys, decrypting and validating requests, and generating certificates in + response to requests. +* **Provisioner** is an application that is responsible for communicating with + the server and all of the system components that require key certificates + from the server. It also implements the policy that defines how many key + pairs each client should keep in their pool. +* **Keystore** is the [Android keystore + daemon](https://developer.android.com/training/articles/keystore) (or, more + generally, whatever system component manages communications with a + particular secure aread component). +* **KeyMint** is the secure area component that manages cryptographic keys and + performs attestations (or perhaps some other secure area component). + +### `BCC` + +The _Boot Certificate Chain_ (BCC) is the chain of certificates that contains +DK\_pub as well as other often device-unique certificates. The BCC is +represented as a COSE\_Key containing DK\_pub followed by an array of +COSE\_Sign1 "certificates" containing public keys and optional additional +information, ordered from root to leaf, with each certificate signing the next. +The first certificate in the array is signed by DK\_pub, the last certificate +has the KeyMint (or whatever) signing key's public key, KM\_pub. In phase 1 +there is only one entry; DK\_pub and KM\_pub are the same key and the +certificate is self-signed. + +Each COSE\_Sign1 certificate is a CBOR Web Token (CWT) as described in [RFC +8392](https://tools.ietf.org/html/rfc8392) with additional fields as described +in the Open Profile for DICE. Of these additional fields, only the +_subjectPublicKey_ and _keyUsage_ fields are expected to be present for the +KM\_pub entry (that is, the last entry) in a BCC, but all fields required by the +Open Profile for DICE are expected for other entries (each of which corresponds +to a particular firmware component or boot stage). The CWT fields _iss_ and +_sub_ identify the issuer and subject of the certificate and are consistent +along the BCC entries; the issuer of a given entry matches the subject of the +previous entry. + +The BCC is designed to be constructed using the Open Profile for DICE. In this +case the DK key pair is derived from the UDS as described by that profile and +all BCC entries before the leaf are CBOR CDI certificates chained from DK\_pub. +The KM key pair is not part of the derived DICE chain. It is generated (not +derived) by the KeyMint module, certified by the last key in the DICE chain, and +added as the leaf BCC entry. The key usage field in this leaf certificate must +indicate the key is not used to sign certificates. If a UDS certificate is +available on the device it should appear in the certificate request as the leaf +of a DKCertChain in AdditionalDKSignatures (see +[CertificateRequest](#certificaterequest)). + +The Open Profile for DICE allows for an arbitrary configuration descriptor. For +BCC entries, this configuration descriptor is a CBOR map with the following +optional fields. If no fields are relevant, an empty map should be encoded. +Additional implementation-specific fields may be added using key values not in +the range \[-70000, -70999\] (these are reserved for future additions here). + +``` +| Name | Key | Value type | Meaning | +| ----------------- | ------ | ---------- | ----------------------------------| +| Component name | -70002 | tstr | Name of firmware component / boot | +: : : : stage : +| Component version | -70003 | int | Version of firmware component / | +: : : : boot stage : +| Resettable | -70004 | null | If present, key changes on factory| +: : : : reset : +``` + +Please see +[ProtectedData.aidl](https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl) +for a full CDDL definition of the BCC. + +### `CertificateRequest` + +The full CBOR message that will be sent to the server to request certificates +is: + +```cddl +CertificateRequest = [ + DeviceInfo, + challenge : bstr, // Provided by the server + ProtectedData, // See ProtectedData.aidl + MacedKeysToSign // See IRemotelyProvisionedComponent.aidl +] + +DeviceInfo = [ + VerifiedDeviceInfo, // See DeviceInfo.aidl + UnverifiedDeviceInfo +] + +// Unverified info is anything provided by the HLOS. Subject to change out of +// step with the HAL. +UnverifiedDeviceInfo = { + ? "fingerprint" : tstr, +} + +``` + +It will be the responsibility of Keystore and the Provisioner to construct the +`CertificateRequest`. The HAL provides a method to generate the elements that +need to be constructed on the secure side, which are the tag field of +`MacedKeysToSign`, `VerifiedDeviceInfo`, and the ciphertext field of +`ProtectedData`. + +### HAL + +The remote provisioning HAL provides a simple interface that can be implemented +by multiple secure components that require remote provisioning. It would be +slightly simpler to extend the KeyMint API, but that approach would only serve +the needs of KeyMint, this is more general. + +NOTE the data structures defined in this HAL may look a little bloated and +complex. This is because the COSE data structures are fully spelled-out; we +could make it much more compact by not re-specifying the standardized elements +and instead just referencing the standard, but it seems better to fully specify +them. If the apparent complexity seems daunting, consider what the same would +look like if traditional ASN.1 DER-based structures from X.509 and related +standards were used and also fully elaborated. + +Please see the related HAL documentation directly in the source code at the +following links: + +* [IRemotelyProvisionedComponent + HAL](https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/keymint/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl) +* [ProtectedData](https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl) +* [MacedPublicKey](https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/keymint/aidl/android/hardware/security/keymint/MacedPublicKey.aidl) +* [RpcHardwareInfo](https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/keymint/aidl/android/hardware/security/keymint/RpcHardwareInfo.aidl) +* [DeviceInfo](https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/keymint/aidl/android/hardware/security/keymint/DeviceInfo.aidl) + -- GitLab From 3ba0e635e1e04c05a0142f4f02bb423c71acae17 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 10 Jun 2022 19:57:41 +0000 Subject: [PATCH 817/825] uwb(vts): Close HAL at end of each test Bug: 235558748 Test: atest VtsHalUwbTargetTest Change-Id: I5361baab1f9204052e0f625b3c17242fbfe66190 --- uwb/aidl/vts/VtsHalUwbTargetTest.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/uwb/aidl/vts/VtsHalUwbTargetTest.cpp b/uwb/aidl/vts/VtsHalUwbTargetTest.cpp index edd8dd6608..81d26ba06b 100644 --- a/uwb/aidl/vts/VtsHalUwbTargetTest.cpp +++ b/uwb/aidl/vts/VtsHalUwbTargetTest.cpp @@ -68,6 +68,11 @@ class UwbAidl : public testing::TestWithParam { iuwb_ = IUwb::fromBinder(SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); ASSERT_NE(iuwb_, nullptr); } + virtual void TearDown() override { + // Trigger HAL close at end of each test. + const auto iuwb_chip = getAnyChip(); + iuwb_chip->close(); + } std::shared_ptr iuwb_; // TODO (b/197638976): We pick the first chip here. Need to fix this -- GitLab From cdfb9615854da52fa7af3f3f0527d9c6d92dbd81 Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Mon, 13 Jun 2022 10:12:12 +0100 Subject: [PATCH 818/825] KeyMint VTS: cope with ATTEST_KEY +/- SIGN This change syncs aosp/master with the change in http://aosp/2117528, allowing devices that launched with the (incorrect) version of ATTEST_KEY VTS tests in Android S to continue to pass the test. Bug: 197096139 Bug: 230074335 Test: VtsAidlKeyMintTargetTest Change-Id: If88642e238e64ca9ec80303a4a72f7171c63464f Merged-In: If88642e238e64ca9ec80303a4a72f7171c63464f --- .../aidl/vts/functional/AttestKeyTest.cpp | 193 ++++++++++-------- 1 file changed, 112 insertions(+), 81 deletions(-) diff --git a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp index 240de351d6..ca517ac61c 100644 --- a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp +++ b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp @@ -16,6 +16,7 @@ #define LOG_TAG "keymint_1_attest_key_test" #include +#include #include #include @@ -33,7 +34,33 @@ bool IsSelfSigned(const vector& chain) { } // namespace -using AttestKeyTest = KeyMintAidlTestBase; +class AttestKeyTest : public KeyMintAidlTestBase { + protected: + ErrorCode GenerateAttestKey(const AuthorizationSet& key_desc, + const optional& attest_key, + vector* key_blob, + vector* key_characteristics, + vector* cert_chain) { + // The original specification for KeyMint v1 required ATTEST_KEY not be combined + // with any other key purpose, but the original VTS tests incorrectly did exactly that. + // This means that a device that launched prior to Android T (API level 33) may + // accept or even require KeyPurpose::SIGN too. + if (property_get_int32("ro.board.first_api_level", 0) < 33) { + AuthorizationSet key_desc_plus_sign = key_desc; + key_desc_plus_sign.push_back(TAG_PURPOSE, KeyPurpose::SIGN); + + auto result = GenerateKey(key_desc_plus_sign, attest_key, key_blob, key_characteristics, + cert_chain); + if (result == ErrorCode::OK) { + return result; + } + // If the key generation failed, it may be because the device is (correctly) + // rejecting the combination of ATTEST_KEY+SIGN. Fall through to try again with + // just ATTEST_KEY. + } + return GenerateKey(key_desc, attest_key, key_blob, key_characteristics, cert_chain); + } +}; /* * AttestKeyTest.AllRsaSizes @@ -49,12 +76,13 @@ TEST_P(AttestKeyTest, AllRsaSizes) { AttestationKey attest_key; vector attest_key_characteristics; vector attest_key_cert_chain; - ASSERT_EQ(ErrorCode::OK, GenerateKey(AuthorizationSetBuilder() - .RsaKey(size, 65537) - .AttestKey() - .SetDefaultValidity(), - {} /* attestation signing key */, &attest_key.keyBlob, - &attest_key_characteristics, &attest_key_cert_chain)); + ASSERT_EQ(ErrorCode::OK, + GenerateAttestKey(AuthorizationSetBuilder() + .RsaKey(size, 65537) + .AttestKey() + .SetDefaultValidity(), + {} /* attestation signing key */, &attest_key.keyBlob, + &attest_key_characteristics, &attest_key_cert_chain)); ASSERT_GT(attest_key_cert_chain.size(), 0); EXPECT_EQ(attest_key_cert_chain.size(), 1); @@ -227,17 +255,17 @@ TEST_P(AttestKeyTest, RsaAttestedAttestKeys) { AttestationKey attest_key; vector attest_key_characteristics; vector attest_key_cert_chain; - auto result = GenerateKey(AuthorizationSetBuilder() - .RsaKey(2048, 65537) - .AttestKey() - .AttestationChallenge(challenge) - .AttestationApplicationId(app_id) - .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob) - .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der) - .Authorization(TAG_NO_AUTH_REQUIRED) - .SetDefaultValidity(), - {} /* attestation signing key */, &attest_key.keyBlob, - &attest_key_characteristics, &attest_key_cert_chain); + auto result = GenerateAttestKey(AuthorizationSetBuilder() + .RsaKey(2048, 65537) + .AttestKey() + .AttestationChallenge(challenge) + .AttestationApplicationId(app_id) + .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob) + .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der) + .Authorization(TAG_NO_AUTH_REQUIRED) + .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; @@ -331,17 +359,17 @@ TEST_P(AttestKeyTest, RsaAttestKeyChaining) { attest_key_opt = attest_key; } - auto result = GenerateKey(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]); + 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; @@ -408,17 +436,17 @@ TEST_P(AttestKeyTest, EcAttestKeyChaining) { attest_key_opt = attest_key; } - auto result = GenerateKey(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]); + 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; @@ -513,29 +541,29 @@ TEST_P(AttestKeyTest, AlternateAttestKeyChaining) { } ErrorCode result; if ((i & 0x1) == 1) { - result = GenerateKey(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]); + 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]); } else { - result = GenerateKey(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]); + 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]); } // Strongbox may not support factory provisioned attestation key. if (SecLevel() == SecurityLevel::STRONGBOX) { @@ -581,12 +609,13 @@ TEST_P(AttestKeyTest, MissingChallenge) { AttestationKey attest_key; vector attest_key_characteristics; vector attest_key_cert_chain; - ASSERT_EQ(ErrorCode::OK, GenerateKey(AuthorizationSetBuilder() - .RsaKey(size, 65537) - .AttestKey() - .SetDefaultValidity(), - {} /* attestation signing key */, &attest_key.keyBlob, - &attest_key_characteristics, &attest_key_cert_chain)); + ASSERT_EQ(ErrorCode::OK, + GenerateAttestKey(AuthorizationSetBuilder() + .RsaKey(size, 65537) + .AttestKey() + .SetDefaultValidity(), + {} /* attestation signing key */, &attest_key.keyBlob, + &attest_key_characteristics, &attest_key_cert_chain)); EXPECT_EQ(attest_key_cert_chain.size(), 1); EXPECT_TRUE(IsSelfSigned(attest_key_cert_chain)) << "Failed on size " << size; @@ -630,7 +659,7 @@ TEST_P(AttestKeyTest, AllEcCurves) { vector attest_key_cert_chain; ASSERT_EQ( ErrorCode::OK, - GenerateKey( + GenerateAttestKey( AuthorizationSetBuilder().EcdsaKey(curve).AttestKey().SetDefaultValidity(), {} /* attestation signing key */, &attest_key.keyBlob, &attest_key_characteristics, &attest_key_cert_chain)); @@ -752,12 +781,13 @@ TEST_P(AttestKeyTest, EcdsaAttestationID) { AttestationKey attest_key; vector attest_key_characteristics; vector attest_key_cert_chain; - ASSERT_EQ(ErrorCode::OK, GenerateKey(AuthorizationSetBuilder() - .EcdsaKey(EcCurve::P_256) - .AttestKey() - .SetDefaultValidity(), - {} /* attestation signing key */, &attest_key.keyBlob, - &attest_key_characteristics, &attest_key_cert_chain)); + ASSERT_EQ(ErrorCode::OK, + GenerateAttestKey(AuthorizationSetBuilder() + .EcdsaKey(EcCurve::P_256) + .AttestKey() + .SetDefaultValidity(), + {} /* attestation signing key */, &attest_key.keyBlob, + &attest_key_characteristics, &attest_key_cert_chain)); attest_key.issuerSubjectName = make_name_from_str("Android Keystore Key"); ASSERT_GT(attest_key_cert_chain.size(), 0); EXPECT_EQ(attest_key_cert_chain.size(), 1); @@ -816,12 +846,13 @@ TEST_P(AttestKeyTest, EcdsaAttestationMismatchID) { AttestationKey attest_key; vector attest_key_characteristics; vector attest_key_cert_chain; - ASSERT_EQ(ErrorCode::OK, GenerateKey(AuthorizationSetBuilder() - .EcdsaKey(EcCurve::P_256) - .AttestKey() - .SetDefaultValidity(), - {} /* attestation signing key */, &attest_key.keyBlob, - &attest_key_characteristics, &attest_key_cert_chain)); + ASSERT_EQ(ErrorCode::OK, + GenerateAttestKey(AuthorizationSetBuilder() + .EcdsaKey(EcCurve::P_256) + .AttestKey() + .SetDefaultValidity(), + {} /* attestation signing key */, &attest_key.keyBlob, + &attest_key_characteristics, &attest_key_cert_chain)); attest_key.issuerSubjectName = make_name_from_str("Android Keystore Key"); ASSERT_GT(attest_key_cert_chain.size(), 0); EXPECT_EQ(attest_key_cert_chain.size(), 1); -- GitLab From 6b48d121d9cdea0f3a1ed93e55b1b60056c62b8d Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Fri, 10 Jun 2022 21:49:15 +0000 Subject: [PATCH 819/825] Adds missing AIDL HAL SensorStatus conversion logic Bug: 235629868 Test: Compile Change-Id: Ice2df3935f2bcab9e9612ebd3fdacc57ea6f8dbc --- sensors/aidl/default/multihal/ConvertUtils.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sensors/aidl/default/multihal/ConvertUtils.cpp b/sensors/aidl/default/multihal/ConvertUtils.cpp index 9b2d8fe309..bf56ed52a3 100644 --- a/sensors/aidl/default/multihal/ConvertUtils.cpp +++ b/sensors/aidl/default/multihal/ConvertUtils.cpp @@ -77,6 +77,8 @@ void convertToHidlEvent(const AidlEvent& aidlEvent, V2_1Event* hidlEvent) { hidlEvent->u.vec3.x = aidlEvent.payload.get().x; hidlEvent->u.vec3.y = aidlEvent.payload.get().y; hidlEvent->u.vec3.z = aidlEvent.payload.get().z; + hidlEvent->u.vec3.status = + (V1_0SensorStatus)aidlEvent.payload.get().status; break; case AidlSensorType::GAME_ROTATION_VECTOR: hidlEvent->u.vec4.x = aidlEvent.payload.get().x; @@ -225,6 +227,7 @@ void convertToAidlEvent(const V2_1Event& hidlEvent, AidlEvent* aidlEvent) { vec3.x = hidlEvent.u.vec3.x; vec3.y = hidlEvent.u.vec3.y; vec3.z = hidlEvent.u.vec3.z; + vec3.status = (SensorStatus)hidlEvent.u.vec3.status; aidlEvent->payload.set(vec3); break; } -- GitLab From c0b24f4f132868d1af33fd15d1383e15391e8511 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Mon, 30 May 2022 16:14:23 +0900 Subject: [PATCH 820/825] Remove AIDL-libs from VNDK Some are still in VNDK because they are used in other VNDK libs. Ignore-AOSP-First: some libs are still in internal master only. Bug: 234181591 Test: m Merged-In: If999df9c78a20df931177da11742b1c5de19bc08 Change-Id: If999df9c78a20df931177da11742b1c5de19bc08 (cherry picked from commit 5527adfd7fcae91ea99c583432800e0b377a2f89) --- audio/aidl/Android.bp | 3 -- authsecret/aidl/Android.bp | 5 --- automotive/occupant_awareness/aidl/Android.bp | 5 --- bluetooth/audio/aidl/Android.bp | 3 -- camera/common/aidl/Android.bp | 5 --- camera/device/aidl/Android.bp | 5 --- camera/metadata/aidl/Android.bp | 5 --- camera/provider/aidl/Android.bp | 5 --- drm/aidl/Android.bp | 3 -- dumpstate/aidl/Android.bp | 5 --- gnss/aidl/Android.bp | 5 --- health/aidl/Android.bp | 5 --- health/storage/aidl/Android.bp | 5 --- identity/aidl/Android.bp | 3 -- ir/aidl/Android.bp | 5 --- keymaster/aidl/Android.bp | 5 --- light/aidl/Android.bp | 5 --- nfc/aidl/Android.bp | 5 --- oemlock/aidl/Android.bp | 5 --- power/aidl/Android.bp | 5 --- power/stats/aidl/Android.bp | 5 --- radio/aidl/Android.bp | 40 ------------------- rebootescrow/aidl/Android.bp | 5 --- security/dice/aidl/Android.bp | 3 -- security/keymint/aidl/Android.bp | 3 -- security/secureclock/aidl/Android.bp | 5 --- security/sharedsecret/aidl/Android.bp | 5 --- sensors/aidl/Android.bp | 5 --- soundtrigger/aidl/Android.bp | 5 --- usb/aidl/Android.bp | 5 --- uwb/aidl/Android.bp | 3 -- vibrator/aidl/Android.bp | 5 --- weaver/aidl/Android.bp | 5 --- wifi/hostapd/aidl/Android.bp | 5 --- wifi/supplicant/aidl/Android.bp | 5 --- 35 files changed, 196 deletions(-) diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp index 0b5b99340a..fd893ec1ed 100644 --- a/audio/aidl/Android.bp +++ b/audio/aidl/Android.bp @@ -49,9 +49,6 @@ aidl_interface { ], }, ndk: { - vndk: { - enabled: true, - }, apex_available: [ "//apex_available:platform", "com.android.bluetooth", diff --git a/authsecret/aidl/Android.bp b/authsecret/aidl/Android.bp index 432c1b97c3..90e128d8b6 100644 --- a/authsecret/aidl/Android.bp +++ b/authsecret/aidl/Android.bp @@ -16,11 +16,6 @@ aidl_interface { java: { platform_apis: true, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions: ["1"], } diff --git a/automotive/occupant_awareness/aidl/Android.bp b/automotive/occupant_awareness/aidl/Android.bp index 6ddc1270eb..1a8124c011 100644 --- a/automotive/occupant_awareness/aidl/Android.bp +++ b/automotive/occupant_awareness/aidl/Android.bp @@ -23,11 +23,6 @@ aidl_interface { "com.android.car.framework", ], }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions: ["1"], } diff --git a/bluetooth/audio/aidl/Android.bp b/bluetooth/audio/aidl/Android.bp index c581702ea9..a6871624d5 100644 --- a/bluetooth/audio/aidl/Android.bp +++ b/bluetooth/audio/aidl/Android.bp @@ -40,9 +40,6 @@ aidl_interface { enabled: false, }, ndk: { - vndk: { - enabled: true, - }, apex_available: [ "//apex_available:platform", "com.android.bluetooth", diff --git a/camera/common/aidl/Android.bp b/camera/common/aidl/Android.bp index 19de22d586..d21ae581fb 100644 --- a/camera/common/aidl/Android.bp +++ b/camera/common/aidl/Android.bp @@ -19,11 +19,6 @@ aidl_interface { java: { enabled: false, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/camera/device/aidl/Android.bp b/camera/device/aidl/Android.bp index afc6b8d101..365a5ff07f 100644 --- a/camera/device/aidl/Android.bp +++ b/camera/device/aidl/Android.bp @@ -27,11 +27,6 @@ aidl_interface { sdk_version: "module_current", enabled: false, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/camera/metadata/aidl/Android.bp b/camera/metadata/aidl/Android.bp index 31d4b4d62c..301a9435cf 100644 --- a/camera/metadata/aidl/Android.bp +++ b/camera/metadata/aidl/Android.bp @@ -19,11 +19,6 @@ aidl_interface { java: { enabled: false, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/camera/provider/aidl/Android.bp b/camera/provider/aidl/Android.bp index f082bce8b5..87a94b2176 100644 --- a/camera/provider/aidl/Android.bp +++ b/camera/provider/aidl/Android.bp @@ -25,11 +25,6 @@ aidl_interface { cpp: { enabled: false, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/drm/aidl/Android.bp b/drm/aidl/Android.bp index 0fdba31c84..6273a38a26 100644 --- a/drm/aidl/Android.bp +++ b/drm/aidl/Android.bp @@ -23,9 +23,6 @@ aidl_interface { sdk_version: "module_current", }, ndk: { - vndk: { - enabled: true, - }, min_sdk_version: "current", }, }, diff --git a/dumpstate/aidl/Android.bp b/dumpstate/aidl/Android.bp index d9acc7a59c..63670bb0ab 100644 --- a/dumpstate/aidl/Android.bp +++ b/dumpstate/aidl/Android.bp @@ -33,11 +33,6 @@ aidl_interface { java: { enabled: false, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/gnss/aidl/Android.bp b/gnss/aidl/Android.bp index 9f9090c195..f45fe5d54b 100644 --- a/gnss/aidl/Android.bp +++ b/gnss/aidl/Android.bp @@ -36,11 +36,6 @@ aidl_interface { java: { platform_apis: true, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/health/aidl/Android.bp b/health/aidl/Android.bp index f0cd33f868..a4d4acee65 100644 --- a/health/aidl/Android.bp +++ b/health/aidl/Android.bp @@ -36,11 +36,6 @@ aidl_interface { enabled: true, sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/health/storage/aidl/Android.bp b/health/storage/aidl/Android.bp index 4cd9263b2b..c614efb991 100644 --- a/health/storage/aidl/Android.bp +++ b/health/storage/aidl/Android.bp @@ -33,11 +33,6 @@ aidl_interface { java: { enabled: false, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions: ["1"], } diff --git a/identity/aidl/Android.bp b/identity/aidl/Android.bp index 920a4b9fff..f6855e86c1 100644 --- a/identity/aidl/Android.bp +++ b/identity/aidl/Android.bp @@ -23,9 +23,6 @@ aidl_interface { platform_apis: true, }, ndk: { - vndk: { - enabled: true, - }, apps_enabled: false, }, }, diff --git a/ir/aidl/Android.bp b/ir/aidl/Android.bp index 2485f5bf87..25f6c8f417 100644 --- a/ir/aidl/Android.bp +++ b/ir/aidl/Android.bp @@ -33,11 +33,6 @@ aidl_interface { java: { sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/keymaster/aidl/Android.bp b/keymaster/aidl/Android.bp index c4b6740ed4..0fb6e4c903 100644 --- a/keymaster/aidl/Android.bp +++ b/keymaster/aidl/Android.bp @@ -18,11 +18,6 @@ aidl_interface { java: { platform_apis: true, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions: [ "1", diff --git a/light/aidl/Android.bp b/light/aidl/Android.bp index 6f478d7f22..c11934f527 100644 --- a/light/aidl/Android.bp +++ b/light/aidl/Android.bp @@ -18,11 +18,6 @@ aidl_interface { java: { sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/nfc/aidl/Android.bp b/nfc/aidl/Android.bp index b9578f4858..09a45d12de 100644 --- a/nfc/aidl/Android.bp +++ b/nfc/aidl/Android.bp @@ -34,11 +34,6 @@ aidl_interface { sdk_version: "module_current", enabled: false, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/oemlock/aidl/Android.bp b/oemlock/aidl/Android.bp index d1930f982e..1c19bb109c 100644 --- a/oemlock/aidl/Android.bp +++ b/oemlock/aidl/Android.bp @@ -16,11 +16,6 @@ aidl_interface { java: { platform_apis: true, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions: ["1"], } diff --git a/power/aidl/Android.bp b/power/aidl/Android.bp index e4708f8ec5..70b1203031 100644 --- a/power/aidl/Android.bp +++ b/power/aidl/Android.bp @@ -35,11 +35,6 @@ aidl_interface { java: { platform_apis: true, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/power/stats/aidl/Android.bp b/power/stats/aidl/Android.bp index 48d3c51f1a..b1b2515035 100644 --- a/power/stats/aidl/Android.bp +++ b/power/stats/aidl/Android.bp @@ -32,11 +32,6 @@ aidl_interface { java: { platform_apis: true, }, - ndk: { - vndk: { - enabled: true, - }, - }, cpp: { enabled: true, }, diff --git a/radio/aidl/Android.bp b/radio/aidl/Android.bp index 72f160d797..98eafc1bda 100644 --- a/radio/aidl/Android.bp +++ b/radio/aidl/Android.bp @@ -20,11 +20,6 @@ aidl_interface { java: { sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { @@ -49,11 +44,6 @@ aidl_interface { java: { sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { @@ -78,11 +68,6 @@ aidl_interface { java: { sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { @@ -107,11 +92,6 @@ aidl_interface { java: { sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { @@ -136,11 +116,6 @@ aidl_interface { java: { sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { @@ -165,11 +140,6 @@ aidl_interface { java: { sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { @@ -197,11 +167,6 @@ aidl_interface { java: { sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { @@ -229,11 +194,6 @@ aidl_interface { java: { sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/rebootescrow/aidl/Android.bp b/rebootescrow/aidl/Android.bp index c764f86e9f..39aaa07a4a 100644 --- a/rebootescrow/aidl/Android.bp +++ b/rebootescrow/aidl/Android.bp @@ -18,11 +18,6 @@ aidl_interface { java: { platform_apis: true, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions: ["1"], } diff --git a/security/dice/aidl/Android.bp b/security/dice/aidl/Android.bp index 97781b325b..5625d70269 100644 --- a/security/dice/aidl/Android.bp +++ b/security/dice/aidl/Android.bp @@ -34,9 +34,6 @@ aidl_interface { platform_apis: false, }, ndk: { - vndk: { - enabled: true, - }, apps_enabled: false, apex_available: [ "//apex_available:platform", diff --git a/security/keymint/aidl/Android.bp b/security/keymint/aidl/Android.bp index a233087fab..96d44a7935 100644 --- a/security/keymint/aidl/Android.bp +++ b/security/keymint/aidl/Android.bp @@ -22,9 +22,6 @@ aidl_interface { platform_apis: true, }, ndk: { - vndk: { - enabled: true, - }, apps_enabled: false, }, rust: { diff --git a/security/secureclock/aidl/Android.bp b/security/secureclock/aidl/Android.bp index 00a6ba3019..853ad892a1 100644 --- a/security/secureclock/aidl/Android.bp +++ b/security/secureclock/aidl/Android.bp @@ -18,11 +18,6 @@ aidl_interface { java: { platform_apis: true, }, - ndk: { - vndk: { - enabled: true, - }, - }, rust: { enabled: true, apex_available: [ diff --git a/security/sharedsecret/aidl/Android.bp b/security/sharedsecret/aidl/Android.bp index f1fce7455b..fe77c10d97 100644 --- a/security/sharedsecret/aidl/Android.bp +++ b/security/sharedsecret/aidl/Android.bp @@ -18,11 +18,6 @@ aidl_interface { java: { sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, rust: { enabled: true, }, diff --git a/sensors/aidl/Android.bp b/sensors/aidl/Android.bp index 1c2d83fee7..d04017ccd0 100644 --- a/sensors/aidl/Android.bp +++ b/sensors/aidl/Android.bp @@ -23,11 +23,6 @@ aidl_interface { java: { enabled: false, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/soundtrigger/aidl/Android.bp b/soundtrigger/aidl/Android.bp index 448895c26c..0658519bd9 100644 --- a/soundtrigger/aidl/Android.bp +++ b/soundtrigger/aidl/Android.bp @@ -33,11 +33,6 @@ aidl_interface { java: { sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/usb/aidl/Android.bp b/usb/aidl/Android.bp index 7eb60208f1..4f59f02024 100644 --- a/usb/aidl/Android.bp +++ b/usb/aidl/Android.bp @@ -33,11 +33,6 @@ aidl_interface { java: { sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/uwb/aidl/Android.bp b/uwb/aidl/Android.bp index cc61046683..52f060575c 100755 --- a/uwb/aidl/Android.bp +++ b/uwb/aidl/Android.bp @@ -21,9 +21,6 @@ aidl_interface { enabled: false, }, ndk: { - vndk: { - enabled: true, - }, apex_available: [ "//apex_available:platform", "com.android.uwb", diff --git a/vibrator/aidl/Android.bp b/vibrator/aidl/Android.bp index d4d5857492..86ef027b92 100644 --- a/vibrator/aidl/Android.bp +++ b/vibrator/aidl/Android.bp @@ -19,11 +19,6 @@ aidl_interface { java: { sdk_version: "module_current", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions: [ "1", diff --git a/weaver/aidl/Android.bp b/weaver/aidl/Android.bp index 8b4306f3f1..caa92aa9b4 100644 --- a/weaver/aidl/Android.bp +++ b/weaver/aidl/Android.bp @@ -16,11 +16,6 @@ aidl_interface { java: { platform_apis: true, }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions: ["1"], } diff --git a/wifi/hostapd/aidl/Android.bp b/wifi/hostapd/aidl/Android.bp index c97f8da833..624093365a 100644 --- a/wifi/hostapd/aidl/Android.bp +++ b/wifi/hostapd/aidl/Android.bp @@ -37,11 +37,6 @@ aidl_interface { ], min_sdk_version: "30", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { diff --git a/wifi/supplicant/aidl/Android.bp b/wifi/supplicant/aidl/Android.bp index ca0785b6a6..35de751c0c 100644 --- a/wifi/supplicant/aidl/Android.bp +++ b/wifi/supplicant/aidl/Android.bp @@ -37,11 +37,6 @@ aidl_interface { ], min_sdk_version: "30", }, - ndk: { - vndk: { - enabled: true, - }, - }, }, versions_with_info: [ { -- GitLab From e5364d7617ffb1c787aa5ddb185727115ebbd88c Mon Sep 17 00:00:00 2001 From: Shawn Willden Date: Thu, 16 Jun 2022 12:50:40 -0600 Subject: [PATCH 821/825] Read VSR level from correct property. Bug: 235424890 Test: VtsHalKeymasterV4_0TargetTest & VtsAidlKeyMintTargetTest Ignore-AOSP-First: Cherry-pick of aosp/2128833 Change-Id: I39109c097d129124097a303c3f108d015cb367e3 Merged-In: I39109c097d129124097a303c3f108d015cb367e3 --- .../functional/keymaster_hidl_hal_test.cpp | 33 ++++++++++--------- .../vts/functional/KeyMintAidlTestBase.cpp | 33 ++++++++++--------- 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp index bdaaf96dc4..fb5048a2f3 100644 --- a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp +++ b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp @@ -388,25 +388,28 @@ bool avb_verification_enabled() { } int get_vsr_api_level() { - int api_level = ::android::base::GetIntProperty("ro.board.api_level", -1); - if (api_level == -1) { - api_level = ::android::base::GetIntProperty("ro.board.first_api_level", -1); + int vendor_api_level = ::android::base::GetIntProperty("ro.vendor.api_level", -1); + if (vendor_api_level != -1) { + return vendor_api_level; } - if (api_level == -1) { - api_level = ::android::base::GetIntProperty("ro.vndk.version", -1); + + // Android S and older devices do not define ro.vendor.api_level + vendor_api_level = ::android::base::GetIntProperty("ro.board.api_level", -1); + if (vendor_api_level == -1) { + vendor_api_level = ::android::base::GetIntProperty("ro.board.first_api_level", -1); } - // We really should have a VSR API level by now. But on cuttlefish, and perhaps other weird - // devices, we may not. So, we use the SDK first or current API level if needed. If this goes - // wrong, it should go wrong in the direction of being too strict rather than too lenient, which - // should provoke someone to examine why we don't have proper VSR API level properties. - if (api_level == -1) { - api_level = ::android::base::GetIntProperty("ro.product.first_api_level", -1); + + int product_api_level = ::android::base::GetIntProperty("ro.product.first_api_level", -1); + if (product_api_level == -1) { + product_api_level = ::android::base::GetIntProperty("ro.build.version.sdk", -1); + EXPECT_NE(product_api_level, -1) << "Could not find ro.build.version.sdk"; } - if (api_level == -1) { - api_level = ::android::base::GetIntProperty("ro.build.version.sdk", -1); + + // VSR API level is the minimum of vendor_api_level and product_api_level. + if (vendor_api_level == -1 || vendor_api_level > product_api_level) { + return product_api_level; } - EXPECT_NE(api_level, -1) << "Could not find a VSR level, or equivalent."; - return api_level; + return vendor_api_level; } bool is_gsi() { diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp index 33945fd0e5..46db4f0c78 100644 --- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp +++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp @@ -1461,25 +1461,28 @@ void verify_subject(const X509* cert, // } int get_vsr_api_level() { - int api_level = ::android::base::GetIntProperty("ro.board.api_level", -1); - if (api_level == -1) { - api_level = ::android::base::GetIntProperty("ro.board.first_api_level", -1); + int vendor_api_level = ::android::base::GetIntProperty("ro.vendor.api_level", -1); + if (vendor_api_level != -1) { + return vendor_api_level; } - if (api_level == -1) { - api_level = ::android::base::GetIntProperty("ro.vndk.version", -1); + + // Android S and older devices do not define ro.vendor.api_level + vendor_api_level = ::android::base::GetIntProperty("ro.board.api_level", -1); + if (vendor_api_level == -1) { + vendor_api_level = ::android::base::GetIntProperty("ro.board.first_api_level", -1); } - // We really should have a VSR API level by now. But on cuttlefish, and perhaps other weird - // devices, we may not. So, we use the SDK first or current API level if needed. If this goes - // wrong, it should go wrong in the direction of being too strict rather than too lenient, which - // should provoke someone to examine why we don't have proper VSR API level properties. - if (api_level == -1) { - api_level = ::android::base::GetIntProperty("ro.product.first_api_level", -1); + + int product_api_level = ::android::base::GetIntProperty("ro.product.first_api_level", -1); + if (product_api_level == -1) { + product_api_level = ::android::base::GetIntProperty("ro.build.version.sdk", -1); + EXPECT_NE(product_api_level, -1) << "Could not find ro.build.version.sdk"; } - if (api_level == -1) { - api_level = ::android::base::GetIntProperty("ro.build.version.sdk", -1); + + // VSR API level is the minimum of vendor_api_level and product_api_level. + if (vendor_api_level == -1 || vendor_api_level > product_api_level) { + return product_api_level; } - EXPECT_NE(api_level, -1) << "Could not find a VSR level, or equivalent."; - return api_level; + return vendor_api_level; } bool is_gsi_image() { -- GitLab From fbbb209b6334c8e2d947f3e0c1f9651b017fbd95 Mon Sep 17 00:00:00 2001 From: Silver Chen Date: Fri, 13 May 2022 10:03:45 +0800 Subject: [PATCH 822/825] Fix VTS PlaybackDataFlowWithTsVideoFilterTest sometimes failed. [Description] If filter is started after playback thread, sometimes filter cannot get data correctly because of timing issue. Start playback thread after filter is started so that filter will always get data correctly. Bug: 235185563 Test: 1. Testcase pass Change-Id: I97c38dab1ff81c31b4bb48c8015b626b3a6325ed (cherry picked from commit 8ab7fd8b21b59e736cea26badb56e992debf0d4e) --- tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp index 3e3a4d4732..59b7939833 100644 --- a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp +++ b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp @@ -144,9 +144,9 @@ void TunerPlaybackHidlTest::playbackSingleFilterTest(FilterConfig filterConf, Dv ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId(filterId)); ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId)); ASSERT_TRUE(mFilterTests.getFilterMQDescriptor(filterId, filterConf.getMqDesc)); - mDvrTests.startPlaybackInputThread(dvrConf.playbackInputFile, dvrConf.settings.playback()); ASSERT_TRUE(mDvrTests.startDvrPlayback()); ASSERT_TRUE(mFilterTests.startFilter(filterId)); + mDvrTests.startPlaybackInputThread(dvrConf.playbackInputFile, dvrConf.settings.playback()); ASSERT_TRUE(filterDataOutputTest()); mDvrTests.stopPlaybackThread(); ASSERT_TRUE(mFilterTests.stopFilter(filterId)); -- GitLab From 8c75b834f4267d4e46c52ebc84425c087e2c355f Mon Sep 17 00:00:00 2001 From: Midas Chien Date: Tue, 7 Jun 2022 02:32:28 +0800 Subject: [PATCH 823/825] composer: vts: configure layer for DisplayDecoration Some HW may not support crop function for decoration and current API can't query this capability. Configure decoration layer to full screen to avoid this limitation. Bug: 225765061 Test: VtsHalGraphicsComposer3_TargetTest --gtest_filter=*DisplayDecoration* Change-Id: If47154adf9d48f9c1b8390b4bee090d8bf40ff3b (cherry picked from commit 7d55d4269d5ec7247c00f9f1a84c33a6d6f53a00) Merged-In: If47154adf9d48f9c1b8390b4bee090d8bf40ff3b (cherry picked from commit 308f4ac90690febbac077c297302890772ada495) Merged-In: If47154adf9d48f9c1b8390b4bee090d8bf40ff3b --- .../composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 759bfecca3..047109e35f 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1719,10 +1719,10 @@ TEST_P(GraphicsComposerAidlCommandTest, DisplayDecoration) { } } + configureLayer(display, layer, Composition::DISPLAY_DECORATION, display.getFrameRect(), + display.getCrop()); mWriter.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, decorBuffer->handle, /*acquireFence*/ -1); - mWriter.setLayerCompositionType(display.getDisplayId(), layer, - Composition::DISPLAY_DECORATION); mWriter.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp); execute(); if (support) { -- GitLab From 03fba7a807b8dc573f76a99838753663e016c933 Mon Sep 17 00:00:00 2001 From: Arun Johnson Date: Fri, 24 Jun 2022 18:17:00 +0000 Subject: [PATCH 824/825] Allowing OMX.google* codecs for Devices launching with S S AOSP did not remove the OMX.google* codecs, so this cannot be enforced for devices launching with S bug: 230582620 Change-Id: I25e8f827645db8e83c8c3142f5e76a912fdf7b22 (cherry picked from commit 6973e79b917ff1b7b0febddee69dd245f4222b22) Merged-In: I25e8f827645db8e83c8c3142f5e76a912fdf7b22 --- .../store/VtsHalMediaOmxV1_0TargetStoreTest.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp index 2ae9c2b001..00e9837710 100755 --- a/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp +++ b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp @@ -400,9 +400,18 @@ TEST_P(StoreHidlTest, OmxCodecAllowedTest) { << " Component: " << info.mName.c_str() << " Role: " << role.c_str() << " not allowed for devices launching with Android T and above"; } else { - ASSERT_LT(getFirstApiLevel(), __ANDROID_API_S__) + std::string codecName = info.mName; + bool isAndroidCodec = (codecName.rfind("OMX.google", 0) != std::string::npos); + if (isAndroidCodec && (getFirstApiLevel() <= __ANDROID_API_S__)) { + // refer b/230582620 + // S AOSP build did not remove the OMX.google video codecs + // so it is infeasible to require no OMX.google.* video codecs + // on S launching devices + } else { + ASSERT_LT(getFirstApiLevel(), __ANDROID_API_S__) << " Component: " << info.mName.c_str() << " Role: " << role.c_str() << " not allowed for devices launching with Android S and above"; + } } } if (role.find("audio_decoder") != std::string::npos || -- GitLab From 5769163d4bbdec8a281f8560404d961d71eeafec Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 15 Jul 2022 22:54:22 +0000 Subject: [PATCH 825/825] VehicleManager: use with RefBase RefBase with sp<> Bug: 232557259 Test: build Merged-In: Id6b3b7e222980fd0e82b2d94ff2518e92d42a4d9 Change-Id: Id6b3b7e222980fd0e82b2d94ff2518e92d42a4d9 (cherry picked from commit 3b8e60afa3d2d6b64c25b0c171fac115ac6c107b) --- automotive/vehicle/2.0/default/VehicleService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automotive/vehicle/2.0/default/VehicleService.cpp b/automotive/vehicle/2.0/default/VehicleService.cpp index 12e15f9db3..2968232ed4 100644 --- a/automotive/vehicle/2.0/default/VehicleService.cpp +++ b/automotive/vehicle/2.0/default/VehicleService.cpp @@ -33,7 +33,7 @@ int main(int /* argc */, char* /* argv */ []) { auto store = std::make_unique(); auto connector = std::make_unique(); auto hal = std::make_unique(store.get(), connector.get()); - auto service = std::make_unique(hal.get()); + auto service = android::sp::make(hal.get()); connector->setValuePool(hal->getValuePool()); android::hardware::configureRpcThreadpool(4, true /* callerWillJoin */); -- GitLab